From 173e662b5cb968d0f34b09c6971cc1e61f772a63 Mon Sep 17 00:00:00 2001 From: Andrea Amorese Date: Mon, 4 Oct 2021 12:14:20 +0200 Subject: [PATCH] Built motion from commit 9a9fea8c.|2.5.35 --- 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.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/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/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 +- 1151 files changed, 1151 insertions(+), 1151 deletions(-) diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 56b1c7a..2e5ceee 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-04T09:47:34.837Z", + "time": "2021-10-04T10:02:00.575Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 483f655..40ff06e 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-04T09:47:34.837Z", + "time": "2021-10-04T10:02:00.575Z", "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 28aa970..1aea757 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 _0xc33f=['jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','VIRTUAL','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'];(function(_0x196600,_0x33bb13){var _0x34f0e1=function(_0x40f762){while(--_0x40f762){_0x196600['push'](_0x196600['shift']());}};_0x34f0e1(++_0x33bb13);}(_0xc33f,0x1ee));var _0xfc33=function(_0x3fe28f,_0x49f18d){_0x3fe28f=_0x3fe28f-0x0;var _0x276544=_0xc33f[_0x3fe28f];return _0x276544;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xfc33('0x0')],'get':function(_0x1d7f5f){return this['getDataValue']('action');}},'action':{'type':Sequelize[_0xfc33('0x1')],'allowNull':![],'validate':{'isIn':{'args':[[_0xfc33('0x2'),_0xfc33('0x3'),_0xfc33('0x4'),_0xfc33('0x5'),_0xfc33('0x6'),_0xfc33('0x7'),'bot',_0xfc33('0x8')]],'msg':_0xfc33('0x9')}},'comment':_0xfc33('0x9')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xfc33('0xa')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xfc33('0xb')},'data3':{'type':Sequelize[_0xfc33('0x1')](0x1000),'comment':_0xfc33('0xc')},'data4':{'type':Sequelize[_0xfc33('0x1')](0x1000),'comments':_0xfc33('0xd')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0xfc33('0xe')},'data6':{'type':Sequelize[_0xfc33('0x1')],'comments':_0xfc33('0xf')},'data7':{'type':Sequelize[_0xfc33('0x10')],'comments':_0xfc33('0x11')}}; \ No newline at end of file +var _0xef30=['contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','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)]'];(function(_0x346790,_0x432400){var _0xa3f648=function(_0x3c24d4){while(--_0x3c24d4){_0x346790['push'](_0x346790['shift']());}};_0xa3f648(++_0x432400);}(_0xef30,0x118));var _0x0ef3=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0xef30[_0x9cd4c3];return _0x4c9025;};'use strict';var Sequelize=require(_0x0ef3('0x0'));module[_0x0ef3('0x1')]={'name':{'type':Sequelize[_0x0ef3('0x2')],'get':function(_0x3924cd){return this[_0x0ef3('0x3')]('action');}},'action':{'type':Sequelize[_0x0ef3('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x0ef3('0x5'),_0x0ef3('0x6'),_0x0ef3('0x7'),_0x0ef3('0x8'),_0x0ef3('0x9'),_0x0ef3('0xa'),_0x0ef3('0xb'),'script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x0ef3('0xc')},'data1':{'type':Sequelize[_0x0ef3('0x4')](0x1000),'comment':_0x0ef3('0xd')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x0ef3('0xe')},'data3':{'type':Sequelize[_0x0ef3('0x4')](0x1000),'comment':_0x0ef3('0xf')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x0ef3('0x10')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x0ef3('0x11')},'data6':{'type':Sequelize[_0x0ef3('0x4')],'comments':_0x0ef3('0x12')},'data7':{'type':Sequelize[_0x0ef3('0x13')],'comments':_0x0ef3('0x14')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 44d2cc0..d396b9c 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 _0x39b8=['../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','name','send','body','Action','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x3b7b8a,_0x52c3b0){var _0x441206=function(_0x5d34d3){while(--_0x5d34d3){_0x3b7b8a['push'](_0x3b7b8a['shift']());}};_0x441206(++_0x52c3b0);}(_0x39b8,0x1e2));var _0x839b=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x39b8[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0x839b('0x0'));var rimraf=require(_0x839b('0x1'));var zipdir=require(_0x839b('0x2'));var jsonpatch=require(_0x839b('0x3'));var rp=require(_0x839b('0x4'));var moment=require(_0x839b('0x5'));var BPromise=require(_0x839b('0x6'));var Mustache=require(_0x839b('0x7'));var util=require(_0x839b('0x8'));var path=require(_0x839b('0x9'));var sox=require(_0x839b('0xa'));var csv=require('to-csv');var ejs=require(_0x839b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x839b('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x839b('0xd'));var querystring=require(_0x839b('0xe'));var Papa=require('papaparse');var Redis=require(_0x839b('0xf'));var authService=require(_0x839b('0x10'));var qs=require(_0x839b('0x11'));var as=require(_0x839b('0x12'));var hardwareService=require(_0x839b('0x13'));var logger=require(_0x839b('0x14'))(_0x839b('0x15'));var utils=require(_0x839b('0x16'));var config=require(_0x839b('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x839b('0x18'))['db'];function respondWithStatusCode(_0x10ff98,_0x34b397){_0x34b397=_0x34b397||0xcc;return function(_0x11b7c0){if(_0x11b7c0){return _0x10ff98[_0x839b('0x19')](_0x34b397);}return _0x10ff98['status'](_0x34b397)[_0x839b('0x1a')]();};}function respondWithResult(_0x3e1f85,_0x55369b){_0x55369b=_0x55369b||0xc8;return function(_0x513b61){if(_0x513b61){return _0x3e1f85[_0x839b('0x1b')](_0x55369b)['json'](_0x513b61);}};}function respondWithFilteredResult(_0x405001,_0x5e97b4){return function(_0xeb63bc){if(_0xeb63bc){var _0x1d53da=typeof _0x5e97b4[_0x839b('0x1c')]===_0x839b('0x1d')&&typeof _0x5e97b4[_0x839b('0x1e')]===_0x839b('0x1d');var _0x1fe726=_0xeb63bc[_0x839b('0x1f')];var _0x1dbfc0=_0x1d53da?0x0:_0x5e97b4['offset'];var _0x57db61=_0x1d53da?_0xeb63bc[_0x839b('0x1f')]:_0x5e97b4[_0x839b('0x1c')]+_0x5e97b4[_0x839b('0x1e')];var _0x2226f1;if(_0x57db61>=_0x1fe726){_0x57db61=_0x1fe726;_0x2226f1=0xc8;}else{_0x2226f1=0xce;}_0x405001['status'](_0x2226f1);return _0x405001[_0x839b('0x20')]('Content-Range',_0x1dbfc0+'-'+_0x57db61+'/'+_0x1fe726)[_0x839b('0x21')](_0xeb63bc);}return null;};}function patchUpdates(_0x38bb8f){return function(_0x417287){try{jsonpatch[_0x839b('0x22')](_0x417287,_0x38bb8f,!![]);}catch(_0x23d556){return BPromise[_0x839b('0x23')](_0x23d556);}return _0x417287[_0x839b('0x24')]();};}function saveUpdates(_0x5e8f7e,_0x3b2dfc){return function(_0x56bcc1){if(_0x56bcc1){return _0x56bcc1[_0x839b('0x25')](_0x5e8f7e)[_0x839b('0x26')](function(_0x9bba66){return _0x9bba66;});}return null;};}function removeEntity(_0x234309,_0x3340e0){return function(_0x330e0b){if(_0x330e0b){return _0x330e0b[_0x839b('0x27')]()['then'](function(){_0x234309['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x17a711,_0x515b25){return function(_0x470ae5){if(!_0x470ae5){_0x17a711['sendStatus'](0x194);}return _0x470ae5;};}function handleError(_0x2dca5e,_0x5bc649){_0x5bc649=_0x5bc649||0x1f4;return function(_0x2a14ca){logger['error'](_0x2a14ca['stack']);if(_0x2a14ca[_0x839b('0x28')]){delete _0x2a14ca[_0x839b('0x28')];}_0x2dca5e[_0x839b('0x1b')](_0x5bc649)[_0x839b('0x29')](_0x2a14ca);};}exports[_0x839b('0x25')]=function(_0x325550,_0x2c0903){if(_0x325550[_0x839b('0x2a')]['id']){delete _0x325550[_0x839b('0x2a')]['id'];}return db[_0x839b('0x2b')][_0x839b('0x2c')]({'where':{'id':_0x325550[_0x839b('0x2d')]['id']}})[_0x839b('0x26')](handleEntityNotFound(_0x2c0903,null))[_0x839b('0x26')](saveUpdates(_0x325550[_0x839b('0x2a')],null))[_0x839b('0x26')](respondWithResult(_0x2c0903,null))['catch'](handleError(_0x2c0903,null));};exports['destroy']=function(_0x22eb9c,_0x3cff69){return db[_0x839b('0x2b')][_0x839b('0x2c')]({'where':{'id':_0x22eb9c[_0x839b('0x2d')]['id']}})[_0x839b('0x26')](handleEntityNotFound(_0x3cff69,null))[_0x839b('0x26')](removeEntity(_0x3cff69,null))['catch'](handleError(_0x3cff69,null));}; \ No newline at end of file +var _0x59bc=['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','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','end','stack','send','find','params','catch','Action','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv'];(function(_0x2f52c0,_0x15a9cb){var _0x378a40=function(_0x3a9d2d){while(--_0x3a9d2d){_0x2f52c0['push'](_0x2f52c0['shift']());}};_0x378a40(++_0x15a9cb);}(_0x59bc,0x15a));var _0xc59b=function(_0x1b7b17,_0x4da230){_0x1b7b17=_0x1b7b17-0x0;var _0x1afb97=_0x59bc[_0x1b7b17];return _0x1afb97;};'use strict';var emlformat=require(_0xc59b('0x0'));var rimraf=require(_0xc59b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc59b('0x2'));var rp=require(_0xc59b('0x3'));var moment=require(_0xc59b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc59b('0x5'));var util=require('util');var path=require(_0xc59b('0x6'));var sox=require(_0xc59b('0x7'));var csv=require('to-csv');var ejs=require(_0xc59b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc59b('0x9'));var squel=require(_0xc59b('0xa'));var crypto=require('crypto');var jsforce=require(_0xc59b('0xb'));var deskjs=require(_0xc59b('0xc'));var toCsv=require(_0xc59b('0xd'));var querystring=require(_0xc59b('0xe'));var Papa=require(_0xc59b('0xf'));var Redis=require('ioredis');var authService=require(_0xc59b('0x10'));var qs=require(_0xc59b('0x11'));var as=require(_0xc59b('0x12'));var hardwareService=require(_0xc59b('0x13'));var logger=require(_0xc59b('0x14'))(_0xc59b('0x15'));var utils=require(_0xc59b('0x16'));var config=require(_0xc59b('0x17'));var licenseUtil=require(_0xc59b('0x18'));var db=require(_0xc59b('0x19'))['db'];function respondWithStatusCode(_0x38aa10,_0xd45ee3){_0xd45ee3=_0xd45ee3||0xcc;return function(_0x3a28a4){if(_0x3a28a4){return _0x38aa10['sendStatus'](_0xd45ee3);}return _0x38aa10['status'](_0xd45ee3)['end']();};}function respondWithResult(_0x15f758,_0x25c53f){_0x25c53f=_0x25c53f||0xc8;return function(_0x1da842){if(_0x1da842){return _0x15f758[_0xc59b('0x1a')](_0x25c53f)[_0xc59b('0x1b')](_0x1da842);}};}function respondWithFilteredResult(_0x400c3d,_0xc7fd3d){return function(_0x46511d){if(_0x46511d){var _0x5518b2=typeof _0xc7fd3d['offset']===_0xc59b('0x1c')&&typeof _0xc7fd3d['limit']===_0xc59b('0x1c');var _0x1ffb2b=_0x46511d[_0xc59b('0x1d')];var _0x493f09=_0x5518b2?0x0:_0xc7fd3d[_0xc59b('0x1e')];var _0x4ba1f1=_0x5518b2?_0x46511d['count']:_0xc7fd3d[_0xc59b('0x1e')]+_0xc7fd3d[_0xc59b('0x1f')];var _0x3ca068;if(_0x4ba1f1>=_0x1ffb2b){_0x4ba1f1=_0x1ffb2b;_0x3ca068=0xc8;}else{_0x3ca068=0xce;}_0x400c3d[_0xc59b('0x1a')](_0x3ca068);return _0x400c3d['set'](_0xc59b('0x20'),_0x493f09+'-'+_0x4ba1f1+'/'+_0x1ffb2b)[_0xc59b('0x1b')](_0x46511d);}return null;};}function patchUpdates(_0x13291f){return function(_0x4877e5){try{jsonpatch[_0xc59b('0x21')](_0x4877e5,_0x13291f,!![]);}catch(_0x16bd80){return BPromise[_0xc59b('0x22')](_0x16bd80);}return _0x4877e5[_0xc59b('0x23')]();};}function saveUpdates(_0x347329,_0x141ecc){return function(_0x449ad3){if(_0x449ad3){return _0x449ad3[_0xc59b('0x24')](_0x347329)[_0xc59b('0x25')](function(_0x370263){return _0x370263;});}return null;};}function removeEntity(_0x1e71f0,_0x1aee97){return function(_0x470ec1){if(_0x470ec1){return _0x470ec1['destroy']()[_0xc59b('0x25')](function(){_0x1e71f0[_0xc59b('0x1a')](0xcc)[_0xc59b('0x26')]();});}};}function handleEntityNotFound(_0x9e6c57,_0x36f49a){return function(_0x5c6359){if(!_0x5c6359){_0x9e6c57['sendStatus'](0x194);}return _0x5c6359;};}function handleError(_0x5cfd47,_0x4bcf28){_0x4bcf28=_0x4bcf28||0x1f4;return function(_0x2805a4){logger['error'](_0x2805a4[_0xc59b('0x27')]);if(_0x2805a4['name']){delete _0x2805a4['name'];}_0x5cfd47[_0xc59b('0x1a')](_0x4bcf28)[_0xc59b('0x28')](_0x2805a4);};}exports[_0xc59b('0x24')]=function(_0x39e31c,_0x35daa5){if(_0x39e31c['body']['id']){delete _0x39e31c['body']['id'];}return db['Action'][_0xc59b('0x29')]({'where':{'id':_0x39e31c[_0xc59b('0x2a')]['id']}})[_0xc59b('0x25')](handleEntityNotFound(_0x35daa5,null))['then'](saveUpdates(_0x39e31c['body'],null))[_0xc59b('0x25')](respondWithResult(_0x35daa5,null))[_0xc59b('0x2b')](handleError(_0x35daa5,null));};exports['destroy']=function(_0x5cee57,_0x488cd5){return db[_0xc59b('0x2c')][_0xc59b('0x29')]({'where':{'id':_0x5cee57[_0xc59b('0x2a')]['id']}})[_0xc59b('0x25')](handleEntityNotFound(_0x488cd5,null))['then'](removeEntity(_0x488cd5,null))[_0xc59b('0x2b')](handleError(_0x488cd5,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 318bed4..6b998a7 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 _0xa3a0=['tools_actions','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports','Action'];(function(_0x804b9c,_0x3141a2){var _0x4786a7=function(_0x2c9d3b){while(--_0x2c9d3b){_0x804b9c['push'](_0x804b9c['shift']());}};_0x4786a7(++_0x3141a2);}(_0xa3a0,0xf3));var _0x0a3a=function(_0x28ec84,_0x5561a8){_0x28ec84=_0x28ec84-0x0;var _0x1c6e77=_0xa3a0[_0x28ec84];return _0x1c6e77;};'use strict';var _=require(_0x0a3a('0x0'));var util=require(_0x0a3a('0x1'));var logger=require(_0x0a3a('0x2'))(_0x0a3a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0a3a('0x4'));var fs=require('fs');var path=require(_0x0a3a('0x5'));var rimraf=require(_0x0a3a('0x6'));var config=require(_0x0a3a('0x7'));var attributes=require('./action.attributes');module[_0x0a3a('0x8')]=function(_0x1ffc82,_0x1d9d95){return _0x1ffc82['define'](_0x0a3a('0x9'),attributes,{'tableName':_0x0a3a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x096b=['path','../../config/environment','./action.attributes','exports','define','tools_actions','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3f00f9,_0xe140fb){var _0x3161e2=function(_0x4e7acd){while(--_0x4e7acd){_0x3f00f9['push'](_0x3f00f9['shift']());}};_0x3161e2(++_0xe140fb);}(_0x096b,0x1df));var _0xb096=function(_0x5f3734,_0x10f54f){_0x5f3734=_0x5f3734-0x0;var _0x4c07bc=_0x096b[_0x5f3734];return _0x4c07bc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb096('0x0'))(_0xb096('0x1'));var moment=require(_0xb096('0x2'));var BPromise=require(_0xb096('0x3'));var rp=require(_0xb096('0x4'));var fs=require('fs');var path=require(_0xb096('0x5'));var rimraf=require('rimraf');var config=require(_0xb096('0x6'));var attributes=require(_0xb096('0x7'));module[_0xb096('0x8')]=function(_0x18aa4c,_0x2de10b){return _0x18aa4c[_0xb096('0x9')]('Action',attributes,{'tableName':_0xb096('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index e478581..d506a37 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 _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x478874,_0x19e9ef){var _0x49f15c=function(_0x3d355d){while(--_0x3d355d){_0x478874['push'](_0x478874['shift']());}};_0x49f15c(++_0x19e9ef);}(_0x1261,0x144));var _0x1126=function(_0x1989e2,_0x5a3b47){_0x1989e2=_0x1989e2-0x0;var _0x218d38=_0x1261[_0x1989e2];return _0x218d38;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('Action,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x30014e,_0x555f27){var _0x1e3be1=function(_0x36b923){while(--_0x36b923){_0x30014e['push'](_0x30014e['shift']());}};_0x1e3be1(++_0x555f27);}(_0x5fab,0x177));var _0xb5fa=function(_0x2b72ef,_0x574981){_0x2b72ef=_0x2b72ef-0x0;var _0x56a161=_0x5fab[_0x2b72ef];return _0x56a161;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('Action,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index f2c4a42..c4a8516 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 _0xf602=['../../config/environment','./action.controller','put','isAuthenticated','update','/:id','destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5caf8e,_0x592ada){var _0x5ba61f=function(_0x5a4cea){while(--_0x5a4cea){_0x5caf8e['push'](_0x5caf8e['shift']());}};_0x5ba61f(++_0x592ada);}(_0xf602,0x12e));var _0x2f60=function(_0xcca263,_0x4d8686){_0xcca263=_0xcca263-0x0;var _0x1de5ed=_0xf602[_0xcca263];return _0x1de5ed;};'use strict';var multer=require(_0x2f60('0x0'));var util=require(_0x2f60('0x1'));var path=require(_0x2f60('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x2f60('0x3'));var auth=require(_0x2f60('0x4'));var interaction=require(_0x2f60('0x5'));var config=require(_0x2f60('0x6'));var controller=require(_0x2f60('0x7'));router[_0x2f60('0x8')]('/:id',auth[_0x2f60('0x9')](),controller[_0x2f60('0xa')]);router['delete'](_0x2f60('0xb'),auth[_0x2f60('0x9')](),controller[_0x2f60('0xc')]);module[_0x2f60('0xd')]=router; \ No newline at end of file +var _0x4700=['/:id','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller'];(function(_0x2fcdf5,_0x36ef43){var _0xe475f=function(_0xc2ea80){while(--_0xc2ea80){_0x2fcdf5['push'](_0x2fcdf5['shift']());}};_0xe475f(++_0x36ef43);}(_0x4700,0x17d));var _0x0470=function(_0x524305,_0x17929f){_0x524305=_0x524305-0x0;var _0x3b9e3f=_0x4700[_0x524305];return _0x3b9e3f;};'use strict';var multer=require(_0x0470('0x0'));var util=require('util');var path=require(_0x0470('0x1'));var timeout=require(_0x0470('0x2'));var express=require(_0x0470('0x3'));var router=express[_0x0470('0x4')]();var fs_extra=require(_0x0470('0x5'));var auth=require(_0x0470('0x6'));var interaction=require(_0x0470('0x7'));var config=require('../../config/environment');var controller=require(_0x0470('0x8'));router['put'](_0x0470('0x9'),auth['isAuthenticated'](),controller[_0x0470('0xa')]);router[_0x0470('0xb')](_0x0470('0x9'),auth['isAuthenticated'](),controller[_0x0470('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 6aad648..3798a96 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 _0x326f=['STRING','TEXT','sequelize'];(function(_0x45ce77,_0x333ef8){var _0x3bf775=function(_0xcefa8e){while(--_0xcefa8e){_0x45ce77['push'](_0x45ce77['shift']());}};_0x3bf775(++_0x333ef8);}(_0x326f,0xd1));var _0xf326=function(_0x12ab62,_0x248d6d){_0x12ab62=_0x12ab62-0x0;var _0x1b9599=_0x326f[_0x12ab62];return _0x1b9599;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf326('0x1')]},'parent':{'type':Sequelize[_0xf326('0x1')]},'table':{'type':Sequelize[_0xf326('0x1')]},'conditions':{'type':Sequelize[_0xf326('0x2')]},'joins':{'type':Sequelize[_0xf326('0x2')]}}; \ No newline at end of file +var _0xbd51=['sequelize','STRING'];(function(_0x405f28,_0x3ea99f){var _0x1a6075=function(_0x1d8d30){while(--_0x1d8d30){_0x405f28['push'](_0x405f28['shift']());}};_0x1a6075(++_0x3ea99f);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x301df8,_0x507b76){_0x301df8=_0x301df8-0x0;var _0x58fcb9=_0xbd51[_0x301df8];return _0x58fcb9;};'use strict';var Sequelize=require(_0x1bd5('0x0'));module['exports']={'name':{'type':Sequelize[_0x1bd5('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1bd5('0x1')]},'parent':{'type':Sequelize[_0x1bd5('0x1')]},'table':{'type':Sequelize[_0x1bd5('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index b040dbc..2f1a0e7 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 _0xa852=['model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','update','body','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','findAll','keyBy','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','AVG(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','parse','output','fullPath','%s-%s.%s','randomstring','generate','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','countTable','QueryTypes','MIN(%s)','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','CustomReports','UserProfileResource','destroy','error','name','send','index','AnalyticCustomReport','rawAttributes','fieldName','type','key'];(function(_0x5a80af,_0x453c64){var _0x1addb3=function(_0x37e07f){while(--_0x37e07f){_0x5a80af['push'](_0x5a80af['shift']());}};_0x1addb3(++_0x453c64);}(_0xa852,0x1bc));var _0x2a85=function(_0x4c5534,_0x561d95){_0x4c5534=_0x4c5534-0x0;var _0x56ad59=_0xa852[_0x4c5534];return _0x56ad59;};'use strict';var emlformat=require(_0x2a85('0x0'));var rimraf=require(_0x2a85('0x1'));var zipdir=require(_0x2a85('0x2'));var jsonpatch=require(_0x2a85('0x3'));var rp=require(_0x2a85('0x4'));var moment=require('moment');var BPromise=require(_0x2a85('0x5'));var Mustache=require(_0x2a85('0x6'));var util=require(_0x2a85('0x7'));var path=require(_0x2a85('0x8'));var sox=require(_0x2a85('0x9'));var csv=require(_0x2a85('0xa'));var ejs=require(_0x2a85('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2a85('0xc'));var crypto=require(_0x2a85('0xd'));var jsforce=require(_0x2a85('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2a85('0xa'));var querystring=require(_0x2a85('0xf'));var Papa=require(_0x2a85('0x10'));var Redis=require(_0x2a85('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2a85('0x12'));var hardwareService=require(_0x2a85('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x2a85('0x14'));var config=require(_0x2a85('0x15'));var licenseUtil=require(_0x2a85('0x16'));var db=require('../../mysqldb')['db'];var dbH=require(_0x2a85('0x17'))[_0x2a85('0x18')];function respondWithStatusCode(_0x391868,_0x1a4f82){_0x1a4f82=_0x1a4f82||0xcc;return function(_0x3cc9b9){if(_0x3cc9b9){return _0x391868[_0x2a85('0x19')](_0x1a4f82);}return _0x391868[_0x2a85('0x1a')](_0x1a4f82)[_0x2a85('0x1b')]();};}function respondWithResult(_0xb20042,_0x155b9f){_0x155b9f=_0x155b9f||0xc8;return function(_0x33475c){if(_0x33475c){return _0xb20042[_0x2a85('0x1a')](_0x155b9f)[_0x2a85('0x1c')](_0x33475c);}};}function respondWithFilteredResult(_0x45b57d,_0x14e3b7){return function(_0x4b91a8){if(_0x4b91a8){var _0x5c0299=typeof _0x14e3b7[_0x2a85('0x1d')]===_0x2a85('0x1e')&&typeof _0x14e3b7[_0x2a85('0x1f')]===_0x2a85('0x1e');var _0x599719=_0x4b91a8['count'];var _0xa4c84d=_0x5c0299?0x0:_0x14e3b7['offset'];var _0x1b4c95=_0x5c0299?_0x4b91a8[_0x2a85('0x20')]:_0x14e3b7['offset']+_0x14e3b7[_0x2a85('0x1f')];var _0x36be99;if(_0x1b4c95>=_0x599719){_0x1b4c95=_0x599719;_0x36be99=0xc8;}else{_0x36be99=0xce;}_0x45b57d[_0x2a85('0x1a')](_0x36be99);return _0x45b57d[_0x2a85('0x21')](_0x2a85('0x22'),_0xa4c84d+'-'+_0x1b4c95+'/'+_0x599719)[_0x2a85('0x1c')](_0x4b91a8);}return null;};}function patchUpdates(_0x47d082){return function(_0x239835){try{jsonpatch[_0x2a85('0x23')](_0x239835,_0x47d082,!![]);}catch(_0x1716c8){return BPromise[_0x2a85('0x24')](_0x1716c8);}return _0x239835[_0x2a85('0x25')]();};}function saveUpdates(_0x1ba8bf,_0x1c3084){return function(_0x340d97){if(_0x340d97){return _0x340d97['update'](_0x1ba8bf)['then'](function(_0x319eb9){return _0x319eb9;});}return null;};}function removeEntity(_0x1794ee,_0x3ed82b){return function(_0x148a28){if(_0x148a28){return _0x148a28['destroy']()[_0x2a85('0x26')](function(){var _0x28fda8=_0x148a28['get']({'plain':!![]});var _0x3d6907=_0x2a85('0x27');return db[_0x2a85('0x28')][_0x2a85('0x29')]({'where':{'type':_0x3d6907,'resourceId':_0x28fda8['id']}})[_0x2a85('0x26')](function(){return _0x148a28;});})[_0x2a85('0x26')](function(){_0x1794ee[_0x2a85('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c6fd1,_0x18a98a){return function(_0x41ae02){if(!_0x41ae02){_0x3c6fd1[_0x2a85('0x19')](0x194);}return _0x41ae02;};}function handleError(_0x2bf15e,_0x3ed9f6){_0x3ed9f6=_0x3ed9f6||0x1f4;return function(_0x24f6e5){logger[_0x2a85('0x2a')](_0x24f6e5['stack']);if(_0x24f6e5[_0x2a85('0x2b')]){delete _0x24f6e5['name'];}_0x2bf15e[_0x2a85('0x1a')](_0x3ed9f6)[_0x2a85('0x2c')](_0x24f6e5);};}exports[_0x2a85('0x2d')]=function(_0x977c66,_0x13f072){var _0x4faa1f={},_0x4fa485={},_0x59131e={'count':0x0,'rows':[]};var _0x2dd3b5=_['map'](db[_0x2a85('0x2e')][_0x2a85('0x2f')],function(_0x921401){return{'name':_0x921401[_0x2a85('0x30')],'type':_0x921401[_0x2a85('0x31')][_0x2a85('0x32')]};});_0x4fa485[_0x2a85('0x33')]=_[_0x2a85('0x34')](_0x2dd3b5,_0x2a85('0x2b'));_0x4fa485['query']=_[_0x2a85('0x35')](_0x977c66[_0x2a85('0x36')]);_0x4fa485[_0x2a85('0x37')]=_[_0x2a85('0x38')](_0x4fa485[_0x2a85('0x33')],_0x4fa485[_0x2a85('0x36')]);_0x4faa1f[_0x2a85('0x39')]=_[_0x2a85('0x38')](_0x4fa485['model'],qs['fields'](_0x977c66['query'][_0x2a85('0x3a')]));_0x4faa1f[_0x2a85('0x39')]=_0x4faa1f[_0x2a85('0x39')][_0x2a85('0x3b')]?_0x4faa1f[_0x2a85('0x39')]:_0x4fa485[_0x2a85('0x33')];if(!_0x977c66[_0x2a85('0x36')]['hasOwnProperty'](_0x2a85('0x3c'))){_0x4faa1f[_0x2a85('0x1f')]=qs[_0x2a85('0x1f')](_0x977c66[_0x2a85('0x36')][_0x2a85('0x1f')]);_0x4faa1f[_0x2a85('0x1d')]=qs['offset'](_0x977c66['query'][_0x2a85('0x1d')]);}_0x4faa1f[_0x2a85('0x3d')]=qs['sort'](_0x977c66[_0x2a85('0x36')][_0x2a85('0x3e')]);_0x4faa1f[_0x2a85('0x3f')]=qs[_0x2a85('0x37')](_[_0x2a85('0x40')](_0x977c66[_0x2a85('0x36')],_0x4fa485[_0x2a85('0x37')]),_0x2dd3b5);if(_0x977c66['query'][_0x2a85('0x41')]){_0x4faa1f['where']=_[_0x2a85('0x42')](_0x4faa1f['where'],{'$or':_['map'](_0x2dd3b5,function(_0x197e55){if(_0x197e55[_0x2a85('0x31')]!=='VIRTUAL'){var _0x1028ef={};_0x1028ef[_0x197e55[_0x2a85('0x2b')]]={'$like':'%'+_0x977c66['query'][_0x2a85('0x41')]+'%'};return _0x1028ef;}})});}_0x4faa1f=_[_0x2a85('0x42')]({},_0x4faa1f,_0x977c66[_0x2a85('0x43')]);var _0x1b09cb={'where':_0x4faa1f['where']};return db[_0x2a85('0x2e')][_0x2a85('0x20')](_0x1b09cb)[_0x2a85('0x26')](function(_0x489cc5){_0x59131e[_0x2a85('0x20')]=_0x489cc5;if(_0x977c66[_0x2a85('0x36')][_0x2a85('0x44')]){_0x4faa1f[_0x2a85('0x45')]=[{'all':!![]}];}return db[_0x2a85('0x2e')]['findAll'](_0x4faa1f);})['then'](function(_0x5813c4){_0x59131e[_0x2a85('0x46')]=_0x5813c4;return _0x59131e;})[_0x2a85('0x26')](respondWithFilteredResult(_0x13f072,_0x4faa1f))[_0x2a85('0x47')](handleError(_0x13f072,null));};exports[_0x2a85('0x48')]=function(_0x501531,_0x4845f0){var _0x9f1abe={'raw':![],'where':{'id':_0x501531[_0x2a85('0x49')]['id']}},_0x9c8c32={};_0x9c8c32[_0x2a85('0x33')]=_[_0x2a85('0x35')](db[_0x2a85('0x2e')][_0x2a85('0x2f')]);_0x9c8c32[_0x2a85('0x36')]=_[_0x2a85('0x35')](_0x501531[_0x2a85('0x36')]);_0x9c8c32[_0x2a85('0x37')]=_[_0x2a85('0x38')](_0x9c8c32[_0x2a85('0x33')],_0x9c8c32[_0x2a85('0x36')]);_0x9f1abe[_0x2a85('0x39')]=_[_0x2a85('0x38')](_0x9c8c32[_0x2a85('0x33')],qs[_0x2a85('0x3a')](_0x501531[_0x2a85('0x36')][_0x2a85('0x3a')]));_0x9f1abe[_0x2a85('0x39')]=_0x9f1abe[_0x2a85('0x39')][_0x2a85('0x3b')]?_0x9f1abe[_0x2a85('0x39')]:_0x9c8c32[_0x2a85('0x33')];if(_0x501531[_0x2a85('0x36')]['includeAll']){_0x9f1abe['include']=[{'all':!![]}];}_0x9f1abe=_[_0x2a85('0x42')]({},_0x9f1abe,_0x501531[_0x2a85('0x43')]);return db[_0x2a85('0x2e')][_0x2a85('0x4a')](_0x9f1abe)[_0x2a85('0x26')](handleEntityNotFound(_0x4845f0,null))[_0x2a85('0x26')](respondWithResult(_0x4845f0,null))[_0x2a85('0x47')](handleError(_0x4845f0,null));};exports[_0x2a85('0x4b')]=function(_0x5761a2,_0x183db9){return db[_0x2a85('0x2e')][_0x2a85('0x4b')](_0x5761a2['body'],{})[_0x2a85('0x26')](function(_0x32d038){var _0x2a93be=_0x5761a2[_0x2a85('0x4c')][_0x2a85('0x4d')]({'plain':!![]});if(!_0x2a93be)throw new Error(_0x2a85('0x4e'));if(_0x2a93be[_0x2a85('0x4f')]===_0x2a85('0x4c')){var _0x11e463=_0x32d038[_0x2a85('0x4d')]({'plain':!![]});var _0x2e1f8d=_0x2a85('0x50');return db[_0x2a85('0x51')]['find']({'where':{'name':_0x2e1f8d,'userProfileId':_0x2a93be['userProfileId']},'raw':!![]})[_0x2a85('0x26')](function(_0x39fc46){if(_0x39fc46&&_0x39fc46[_0x2a85('0x52')]===0x0){return db[_0x2a85('0x28')][_0x2a85('0x4b')]({'name':_0x11e463['name'],'resourceId':_0x11e463['id'],'type':_0x2a85('0x27'),'sectionId':_0x39fc46['id']},{})[_0x2a85('0x26')](function(){return _0x32d038;});}else{return _0x32d038;}})[_0x2a85('0x47')](function(_0x185672){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x185672);throw _0x185672;});}return _0x32d038;})[_0x2a85('0x26')](respondWithResult(_0x183db9,0xc9))[_0x2a85('0x47')](handleError(_0x183db9,null));};exports[_0x2a85('0x53')]=function(_0x1d40cd,_0x1aefc4){if(_0x1d40cd[_0x2a85('0x54')]['id']){delete _0x1d40cd[_0x2a85('0x54')]['id'];}return db[_0x2a85('0x2e')][_0x2a85('0x4a')]({'where':{'id':_0x1d40cd[_0x2a85('0x49')]['id']}})[_0x2a85('0x26')](handleEntityNotFound(_0x1aefc4,null))[_0x2a85('0x26')](saveUpdates(_0x1d40cd[_0x2a85('0x54')],null))[_0x2a85('0x26')](respondWithResult(_0x1aefc4,null))[_0x2a85('0x47')](handleError(_0x1aefc4,null));};exports[_0x2a85('0x29')]=function(_0x3a3cee,_0x13636e){return db[_0x2a85('0x2e')][_0x2a85('0x4a')]({'where':{'id':_0x3a3cee[_0x2a85('0x49')]['id']}})['then'](handleEntityNotFound(_0x13636e,null))[_0x2a85('0x26')](removeEntity(_0x13636e,null))['catch'](handleError(_0x13636e,null));};exports[_0x2a85('0x55')]=function(_0x4e842d,_0x11cfa7){var _0xee1eeb=0xa;var _0x293ab5=[_0x2a85('0x56'),_0x2a85('0x57'),_0x2a85('0x58'),_0x2a85('0x59')];var _0x4d5c80={'SUM':_0x2a85('0x5a'),'COUNT':_0x2a85('0x5b'),'COUNT DISTINCT':_0x2a85('0x5c'),'MAX':_0x2a85('0x5d'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x2a85('0x5e'),'GROUP_CONCAT ASC':_0x2a85('0x5f'),'GROUP_CONCAT DESC':_0x2a85('0x60')};var _0x6626a4={'SEC_TO_TIME':_0x2a85('0x61'),'DATE':_0x2a85('0x62'),'HOUR':_0x2a85('0x63'),'ROUND':_0x2a85('0x64'),'UNIX_TIMESTAMP':_0x2a85('0x65')};var _0x283792=function(_0x28fb20){return!_[_0x2a85('0x66')](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY',_0x2a85('0x67')],_0x28fb20);};var _0x5e4938=function(_0x4a1608){if(!_0x4a1608||!_0x4a1608[_0x2a85('0x68')]['length']){return'';}for(var _0x4a8f5f='(',_0x48c477=0x0;_0x48c477<_0x4a1608[_0x2a85('0x68')][_0x2a85('0x3b')];_0x48c477+=0x1){_0x48c477>0x0&&(_0x4a8f5f+='\x20'+_0x4a1608[_0x2a85('0x69')]+'\x20');_0x4a8f5f+=_0x4a1608['rules'][_0x48c477][_0x2a85('0x6a')]?_0x5e4938(_0x4a1608['rules'][_0x48c477][_0x2a85('0x6a')]):_0x4a1608[_0x2a85('0x68')][_0x48c477][_0x2a85('0x6b')]+'\x20'+_0x4a1608[_0x2a85('0x68')][_0x48c477][_0x2a85('0x6c')]+(_0x283792(_0x4a1608['rules'][_0x48c477][_0x2a85('0x6c')])?'\x20'+_0x4a1608[_0x2a85('0x68')][_0x48c477]['value']:'');}return _0x4a8f5f+')';};var _0x10d858={'where':{'id':_0x4e842d[_0x2a85('0x49')]['id']}},_0x24c2a0,_0x4b1cf4,_0x33da57,_0x236f16,_0x371ab0;_0x10d858=_[_0x2a85('0x42')]({},_0x10d858,_0x4e842d[_0x2a85('0x43')]);return db[_0x2a85('0x2e')][_0x2a85('0x4a')](_0x10d858)['then'](function(_0x15d402){if(_0x15d402){_0x24c2a0=_0x15d402;return _0x15d402[_0x2a85('0x6d')]();}return null;})[_0x2a85('0x26')](function(_0x17b4ae){if(_0x17b4ae){if(!_0x17b4ae[_0x2a85('0x3b')]){throw new db[(_0x2a85('0x6e'))][(_0x2a85('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4b1cf4=_0x17b4ae;return db['AnalyticMetric'][_0x2a85('0x70')]({'raw':!![]});}return null;})[_0x2a85('0x26')](function(_0x4a1c9d){if(_0x4a1c9d){_0x33da57=_[_0x2a85('0x71')](_0x4a1c9d,'id');var _0x46cf0c;var _0x55d003=squel[_0x2a85('0x72')]();_0x55d003['from'](_0x24c2a0[_0x2a85('0x73')]);for(var _0x21b3d1=0x0;_0x21b3d1<_0x4b1cf4[_0x2a85('0x3b')];_0x21b3d1+=0x1){_0x46cf0c=_0x4b1cf4[_0x21b3d1]['MetricId']?_0x33da57[_0x4b1cf4[_0x21b3d1][_0x2a85('0x74')]][_0x2a85('0x75')]:_0x4b1cf4[_0x21b3d1][_0x2a85('0x6b')];_0x46cf0c=_0x4b1cf4[_0x21b3d1][_0x2a85('0x76')]?_[_0x2a85('0x77')](_0x4d5c80[_0x4b1cf4[_0x21b3d1][_0x2a85('0x76')]],'%s',_0x46cf0c):_0x46cf0c;_0x46cf0c=_0x4b1cf4[_0x21b3d1][_0x2a85('0x78')]?_[_0x2a85('0x77')](_0x6626a4[_0x4b1cf4[_0x21b3d1][_0x2a85('0x78')]],'%s',_0x46cf0c):_0x46cf0c;if(_0x4b1cf4[_0x21b3d1][_0x2a85('0x79')]){_0x55d003[_0x2a85('0x6a')](_0x46cf0c);}_0x4b1cf4[_0x21b3d1]['orderBy']&&_0x55d003[_0x2a85('0x3d')](_0x46cf0c,_0x4b1cf4[_0x21b3d1][_0x2a85('0x7a')]===_0x2a85('0x7b')?![]:!![]);_0x55d003[_0x2a85('0x6b')](_0x46cf0c,_0x4b1cf4[_0x21b3d1][_0x2a85('0x7c')]||_0x46cf0c);}if(_0x24c2a0[_0x2a85('0x7d')]){_0x24c2a0['joins']=JSON['parse'](_0x24c2a0['joins']);for(var _0x45880f=0x0;_0x45880f<_0x24c2a0[_0x2a85('0x7d')]['length'];_0x45880f+=0x1){if(_0x24c2a0[_0x2a85('0x7d')][_0x45880f][_0x2a85('0x31')]&&_[_0x2a85('0x66')](_0x293ab5,_0x24c2a0['joins'][_0x45880f][_0x2a85('0x31')])&&_0x24c2a0['joins'][_0x45880f]['parentKey']&&_0x24c2a0[_0x2a85('0x7d')][_0x45880f]['foreignTable']&&_0x24c2a0[_0x2a85('0x7d')][_0x45880f]['foreignKey']){_0x55d003[_0x24c2a0[_0x2a85('0x7d')][_0x45880f][_0x2a85('0x31')]](_0x24c2a0['joins'][_0x45880f][_0x2a85('0x7e')],null,util['format'](_0x2a85('0x7f'),_0x24c2a0[_0x2a85('0x73')],_0x24c2a0[_0x2a85('0x7d')][_0x45880f][_0x2a85('0x80')],_0x24c2a0[_0x2a85('0x7d')][_0x45880f][_0x2a85('0x7e')],_0x24c2a0[_0x2a85('0x7d')][_0x45880f][_0x2a85('0x81')]));}}}if(_0x24c2a0['conditions']){_0x24c2a0['conditions']=JSON['parse'](_0x24c2a0[_0x2a85('0x82')]);_0x55d003[_0x2a85('0x3f')](_0x5e4938(_0x24c2a0[_0x2a85('0x82')][_0x2a85('0x6a')]));}_0x371ab0=_0x55d003[_0x2a85('0x83')]();_0x55d003['limit'](_0xee1eeb);_0x55d003['offset'](0x0);logger[_0x2a85('0x84')](_0x2a85('0x85'),_0x55d003[_0x2a85('0x86')]());return dbH[_0x2a85('0x87')][_0x2a85('0x36')](_0x55d003['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x2a85('0x88')]});}})[_0x2a85('0x26')](respondWithResult(_0x11cfa7,null))['catch'](handleError(_0x11cfa7,null));};function runReport(_0x8c1012,_0x539ccb,_0x5815bb){var _0x104fea=_0x539ccb[_0x2a85('0x2b')];var _0x20d216=0xa;var _0x32ccea=[_0x2a85('0x56'),'left_join',_0x2a85('0x58'),_0x2a85('0x59')];var _0x538c52={'SUM':_0x2a85('0x5a'),'COUNT':_0x2a85('0x5b'),'COUNT DISTINCT':_0x2a85('0x5c'),'MAX':_0x2a85('0x5d'),'MIN':'MIN(%s)','AVG':_0x2a85('0x89'),'GROUP_CONCAT':_0x2a85('0x5e'),'GROUP_CONCAT ASC':_0x2a85('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1d78b1={'SEC_TO_TIME':_0x2a85('0x61'),'DATE':_0x2a85('0x62'),'HOUR':_0x2a85('0x63'),'ROUND':_0x2a85('0x64'),'UNIX_TIMESTAMP':_0x2a85('0x65')};var _0x239292=function(_0x251db1){return!_[_0x2a85('0x66')]([_0x2a85('0x8a'),_0x2a85('0x8b'),_0x2a85('0x8c'),_0x2a85('0x67')],_0x251db1);};var _0x130081=function(_0x4f44f5){if(!_0x4f44f5||!_0x4f44f5[_0x2a85('0x68')][_0x2a85('0x3b')]){return'';}for(var _0x2ef08d='(',_0xc8718=0x0;_0xc8718<_0x4f44f5[_0x2a85('0x68')][_0x2a85('0x3b')];_0xc8718+=0x1){_0xc8718>0x0&&(_0x2ef08d+='\x20'+_0x4f44f5[_0x2a85('0x69')]+'\x20');_0x2ef08d+=_0x4f44f5[_0x2a85('0x68')][_0xc8718][_0x2a85('0x6a')]?_0x130081(_0x4f44f5[_0x2a85('0x68')][_0xc8718][_0x2a85('0x6a')]):_0x4f44f5['rules'][_0xc8718][_0x2a85('0x6b')]+'\x20'+_0x4f44f5[_0x2a85('0x68')][_0xc8718][_0x2a85('0x6c')]+(_0x239292(_0x4f44f5[_0x2a85('0x68')][_0xc8718][_0x2a85('0x6c')])?'\x20'+_0x4f44f5['rules'][_0xc8718]['value']:'');}return _0x2ef08d+')';};var _0x3b65a0={'where':{'id':_0x8c1012['id']}},_0x1549d6,_0x5a7ec2,_0x256d03,_0x28601e,_0x23f549;_0x3b65a0=_[_0x2a85('0x42')]({},_0x3b65a0,_0x5815bb);return db[_0x2a85('0x2e')][_0x2a85('0x4a')](_0x3b65a0)[_0x2a85('0x26')](function(_0x554335){if(_0x554335){_0x1549d6=_0x554335;return _0x554335[_0x2a85('0x6d')]();}return null;})['then'](function(_0x27c7f0){if(_0x27c7f0){if(!_0x27c7f0[_0x2a85('0x3b')]){throw new db[(_0x2a85('0x6e'))][(_0x2a85('0x6f'))](_0x2a85('0x8d'),0x193);}_0x5a7ec2=_0x27c7f0;return db[_0x2a85('0x8e')][_0x2a85('0x70')]({'raw':!![]});}return null;})[_0x2a85('0x26')](function(_0x12c4a3){if(_0x12c4a3){_0x256d03=_[_0x2a85('0x71')](_0x12c4a3,'id');var _0x4bca22;var _0x404a3f=squel[_0x2a85('0x72')]();_0x404a3f['from'](_0x1549d6['table']);for(var _0x4aaf75=0x0;_0x4aaf75<_0x5a7ec2[_0x2a85('0x3b')];_0x4aaf75+=0x1){_0x4bca22=_0x5a7ec2[_0x4aaf75][_0x2a85('0x74')]?_0x256d03[_0x5a7ec2[_0x4aaf75][_0x2a85('0x74')]]['metric']:_0x5a7ec2[_0x4aaf75][_0x2a85('0x6b')];_0x4bca22=_0x5a7ec2[_0x4aaf75][_0x2a85('0x76')]?_[_0x2a85('0x77')](_0x538c52[_0x5a7ec2[_0x4aaf75]['function']],'%s',_0x4bca22):_0x4bca22;_0x4bca22=_0x5a7ec2[_0x4aaf75][_0x2a85('0x78')]?_[_0x2a85('0x77')](_0x1d78b1[_0x5a7ec2[_0x4aaf75][_0x2a85('0x78')]],'%s',_0x4bca22):_0x4bca22;if(_0x5a7ec2[_0x4aaf75]['groupBy']){_0x404a3f['group'](_0x4bca22);}_0x5a7ec2[_0x4aaf75][_0x2a85('0x7a')]&&_0x404a3f[_0x2a85('0x3d')](_0x4bca22,_0x5a7ec2[_0x4aaf75][_0x2a85('0x7a')]===_0x2a85('0x7b')?![]:!![]);_0x404a3f[_0x2a85('0x6b')](_0x4bca22,_0x5a7ec2[_0x4aaf75][_0x2a85('0x7c')]||_0x4bca22);}if(_0x1549d6[_0x2a85('0x7d')]){_0x1549d6[_0x2a85('0x7d')]=JSON['parse'](_0x1549d6[_0x2a85('0x7d')]);for(var _0x3b26e0=0x0;_0x3b26e0<_0x1549d6[_0x2a85('0x7d')][_0x2a85('0x3b')];_0x3b26e0+=0x1){if(_0x1549d6['joins'][_0x3b26e0][_0x2a85('0x31')]&&_[_0x2a85('0x66')](_0x32ccea,_0x1549d6[_0x2a85('0x7d')][_0x3b26e0]['type'])&&_0x1549d6[_0x2a85('0x7d')][_0x3b26e0][_0x2a85('0x80')]&&_0x1549d6[_0x2a85('0x7d')][_0x3b26e0][_0x2a85('0x7e')]&&_0x1549d6[_0x2a85('0x7d')][_0x3b26e0][_0x2a85('0x81')]){_0x404a3f[_0x1549d6[_0x2a85('0x7d')][_0x3b26e0][_0x2a85('0x31')]](_0x1549d6[_0x2a85('0x7d')][_0x3b26e0][_0x2a85('0x7e')],null,util[_0x2a85('0x78')]('%s.%s\x20=\x20%s.%s',_0x1549d6['table'],_0x1549d6['joins'][_0x3b26e0][_0x2a85('0x80')],_0x1549d6[_0x2a85('0x7d')][_0x3b26e0][_0x2a85('0x7e')],_0x1549d6[_0x2a85('0x7d')][_0x3b26e0][_0x2a85('0x81')]));}}}if(_0x1549d6[_0x2a85('0x82')]){_0x1549d6[_0x2a85('0x82')]=JSON[_0x2a85('0x8f')](_0x1549d6[_0x2a85('0x82')]);_0x404a3f[_0x2a85('0x3f')](_0x130081(_0x1549d6[_0x2a85('0x82')][_0x2a85('0x6a')]));}_0x23f549=_0x404a3f[_0x2a85('0x83')]();_0x404a3f[_0x2a85('0x1f')](_0x20d216);_0x404a3f[_0x2a85('0x1d')](0x0);return;}})[_0x2a85('0x26')](function(){if(_0x539ccb[_0x2a85('0x90')]==='web'){return null;}var _0x4ec39e=_[_0x2a85('0x42')](_0x539ccb,{'name':_0x539ccb[_0x2a85('0x91')]||_0x539ccb[_0x2a85('0x2b')]||_0x1549d6['name'],'basename':_0x104fea,'savename':util[_0x2a85('0x78')](_0x2a85('0x92'),_0x539ccb[_0x2a85('0x2b')]||_0x1549d6[_0x2a85('0x2b')],require(_0x2a85('0x93'))[_0x2a85('0x94')](0x4),_0x539ccb[_0x2a85('0x90')]||'csv'),'reportId':_0x1549d6['id'],'reportType':_0x2a85('0x95')});return db[_0x2a85('0x96')][_0x2a85('0x4b')](_0x4ec39e,{'raw':!![]});})[_0x2a85('0x26')](function(_0x30454e){if(_0x1549d6[_0x2a85('0x73')]==='cdr'){_0x23f549['where'](_0x1549d6[_0x2a85('0x73')]+_0x2a85('0x97'),_0x539ccb[_0x2a85('0x98')],_0x539ccb[_0x2a85('0x99')]);}else{_0x23f549['where'](_0x1549d6['table']+_0x2a85('0x9a'),_0x539ccb[_0x2a85('0x98')],_0x539ccb['endDate']);}if(_0x30454e){logger[_0x2a85('0x9b')](_0x2a85('0x9c'),_0x23f549['toString']());require(_0x2a85('0x9d'))[_0x2a85('0x9e')](path[_0x2a85('0x56')](__dirname,_0x2a85('0x9f'),_0x30454e[_0x2a85('0x90')]),[_0x30454e['id'],_0x23f549[_0x2a85('0x86')](),path[_0x2a85('0x56')](__dirname,_0x2a85('0xa0'),_0x30454e['savename']),_0x104fea]);return _0x30454e;}else{var _0x34c5e2=squel['select']();_0x34c5e2['from']('('+_0x23f549[_0x2a85('0x86')]()+')',_0x2a85('0xa1'));_0x34c5e2[_0x2a85('0x6b')]('COUNT(*)',_0x2a85('0x20'));_0x23f549[_0x2a85('0x1f')](_0x539ccb[_0x2a85('0x1f')]||_0x20d216);_0x23f549[_0x2a85('0x1d')](_0x539ccb['offset']||0x0);return dbH[_0x2a85('0x87')]['query'](_0x34c5e2[_0x2a85('0x86')](),{'type':dbH[_0x2a85('0x87')][_0x2a85('0xa2')][_0x2a85('0x88')]})['then'](function(_0x1cf6d8){if(!_0x1cf6d8[_0x2a85('0x3b')]){_0x28601e=0x0;}else{_0x28601e=_0x1cf6d8[0x0][_0x2a85('0x20')]||0x0;}return dbH[_0x2a85('0x87')][_0x2a85('0x36')](_0x23f549['toString'](),{'type':dbH[_0x2a85('0x87')][_0x2a85('0xa2')][_0x2a85('0x88')]});})[_0x2a85('0x26')](function(_0x4d89c5){return{'rows':_0x4d89c5||[],'count':_0x28601e};});}});}exports['run']=function(_0x3f7f3f,_0x445f17){return runReport(_0x3f7f3f[_0x2a85('0x49')],_0x3f7f3f[_0x2a85('0x36')],_0x3f7f3f[_0x2a85('0x43')])[_0x2a85('0x26')](respondWithResult(_0x445f17,null))[_0x2a85('0x47')](handleError(_0x445f17,null));};exports['runReport']=runReport;exports[_0x2a85('0x36')]=function(_0x391e61,_0x2c18f5){var _0x349b7f=0xa;var _0x565d03=[_0x2a85('0x56'),_0x2a85('0x57'),_0x2a85('0x58'),_0x2a85('0x59')];var _0x3f27b7={'SUM':_0x2a85('0x5a'),'COUNT':_0x2a85('0x5b'),'COUNT DISTINCT':_0x2a85('0x5c'),'MAX':_0x2a85('0x5d'),'MIN':_0x2a85('0xa3'),'AVG':_0x2a85('0x89'),'GROUP_CONCAT':_0x2a85('0x5e'),'GROUP_CONCAT ASC':_0x2a85('0x5f'),'GROUP_CONCAT DESC':_0x2a85('0x60')};var _0x5ea1be={'SEC_TO_TIME':_0x2a85('0x61'),'DATE':'DATE(%s)','HOUR':_0x2a85('0x63'),'ROUND':_0x2a85('0x64'),'UNIX_TIMESTAMP':_0x2a85('0x65')};var _0x47db3b=function(_0x4a0b5c){return!_[_0x2a85('0x66')]([_0x2a85('0x8a'),_0x2a85('0x8b'),_0x2a85('0x8c'),_0x2a85('0x67')],_0x4a0b5c);};var _0x5ad575=function(_0x471c7d){if(!_0x471c7d||!_0x471c7d[_0x2a85('0x68')][_0x2a85('0x3b')]){return'';}for(var _0x279239='(',_0x59def0=0x0;_0x59def0<_0x471c7d[_0x2a85('0x68')]['length'];_0x59def0+=0x1){_0x59def0>0x0&&(_0x279239+='\x20'+_0x471c7d[_0x2a85('0x69')]+'\x20');_0x279239+=_0x471c7d[_0x2a85('0x68')][_0x59def0][_0x2a85('0x6a')]?_0x5ad575(_0x471c7d[_0x2a85('0x68')][_0x59def0][_0x2a85('0x6a')]):_0x471c7d[_0x2a85('0x68')][_0x59def0]['field']+'\x20'+_0x471c7d[_0x2a85('0x68')][_0x59def0][_0x2a85('0x6c')]+(_0x47db3b(_0x471c7d['rules'][_0x59def0][_0x2a85('0x6c')])?'\x20'+_0x471c7d[_0x2a85('0x68')][_0x59def0][_0x2a85('0xa4')]:'');}return _0x279239+')';};var _0x1e059b={'where':{'id':_0x391e61['params']['id']}},_0x4fc3b3,_0x9844f3,_0x195538,_0x45944f,_0x1c150e;_0x1e059b=_[_0x2a85('0x42')]({},_0x1e059b,_0x391e61[_0x2a85('0x43')]);return db[_0x2a85('0x2e')][_0x2a85('0x4a')](_0x1e059b)[_0x2a85('0x26')](function(_0x572621){if(_0x572621){_0x4fc3b3=_0x572621;return _0x572621['getFields']();}return null;})[_0x2a85('0x26')](function(_0x59a2aa){if(_0x59a2aa){if(!_0x59a2aa[_0x2a85('0x3b')]){throw new db[(_0x2a85('0x6e'))][(_0x2a85('0x6f'))](_0x2a85('0x8d'),0x193);}_0x9844f3=_0x59a2aa;return db['AnalyticMetric'][_0x2a85('0x70')]({'raw':!![]});}return null;})[_0x2a85('0x26')](function(_0x3fdec5){if(_0x3fdec5){_0x195538=_['keyBy'](_0x3fdec5,'id');var _0x416c84;var _0x4c0afe=squel['select']();_0x4c0afe['from'](_0x4fc3b3['table']);for(var _0x20947d=0x0;_0x20947d<_0x9844f3[_0x2a85('0x3b')];_0x20947d+=0x1){_0x416c84=_0x9844f3[_0x20947d][_0x2a85('0x74')]?_0x195538[_0x9844f3[_0x20947d]['MetricId']][_0x2a85('0x75')]:_0x9844f3[_0x20947d][_0x2a85('0x6b')];_0x416c84=_0x9844f3[_0x20947d][_0x2a85('0x76')]?_[_0x2a85('0x77')](_0x3f27b7[_0x9844f3[_0x20947d][_0x2a85('0x76')]],'%s',_0x416c84):_0x416c84;_0x416c84=_0x9844f3[_0x20947d]['format']?_[_0x2a85('0x77')](_0x5ea1be[_0x9844f3[_0x20947d][_0x2a85('0x78')]],'%s',_0x416c84):_0x416c84;if(_0x9844f3[_0x20947d][_0x2a85('0x79')]){_0x4c0afe['group'](_0x416c84);}_0x9844f3[_0x20947d][_0x2a85('0x7a')]&&_0x4c0afe['order'](_0x416c84,_0x9844f3[_0x20947d][_0x2a85('0x7a')]===_0x2a85('0x7b')?![]:!![]);_0x4c0afe[_0x2a85('0x6b')](_0x416c84,_0x9844f3[_0x20947d][_0x2a85('0x7c')]||_0x416c84);}if(_0x4fc3b3['joins']){_0x4fc3b3[_0x2a85('0x7d')]=JSON[_0x2a85('0x8f')](_0x4fc3b3[_0x2a85('0x7d')]);for(var _0x4e083c=0x0;_0x4e083c<_0x4fc3b3[_0x2a85('0x7d')][_0x2a85('0x3b')];_0x4e083c+=0x1){if(_0x4fc3b3[_0x2a85('0x7d')][_0x4e083c][_0x2a85('0x31')]&&_[_0x2a85('0x66')](_0x565d03,_0x4fc3b3[_0x2a85('0x7d')][_0x4e083c][_0x2a85('0x31')])&&_0x4fc3b3[_0x2a85('0x7d')][_0x4e083c][_0x2a85('0x80')]&&_0x4fc3b3[_0x2a85('0x7d')][_0x4e083c][_0x2a85('0x7e')]&&_0x4fc3b3[_0x2a85('0x7d')][_0x4e083c][_0x2a85('0x81')]){_0x4c0afe[_0x4fc3b3['joins'][_0x4e083c][_0x2a85('0x31')]](_0x4fc3b3[_0x2a85('0x7d')][_0x4e083c]['foreignTable'],null,util['format'](_0x2a85('0x7f'),_0x4fc3b3[_0x2a85('0x73')],_0x4fc3b3[_0x2a85('0x7d')][_0x4e083c][_0x2a85('0x80')],_0x4fc3b3[_0x2a85('0x7d')][_0x4e083c]['foreignTable'],_0x4fc3b3[_0x2a85('0x7d')][_0x4e083c]['foreignKey']));}}}if(_0x4fc3b3[_0x2a85('0x82')]){_0x4fc3b3[_0x2a85('0x82')]=JSON[_0x2a85('0x8f')](_0x4fc3b3['conditions']);_0x4c0afe[_0x2a85('0x3f')](_0x5ad575(_0x4fc3b3['conditions'][_0x2a85('0x6a')]));}_0x1c150e=_0x4c0afe[_0x2a85('0x83')]();_0x4c0afe[_0x2a85('0x1f')](_0x349b7f);_0x4c0afe[_0x2a85('0x1d')](0x0);logger['debug'](_0x2a85('0x85'),_0x4c0afe[_0x2a85('0x86')]());return dbH[_0x2a85('0x87')][_0x2a85('0x36')](_0x4c0afe[_0x2a85('0x86')](),{'type':dbH['sequelize'][_0x2a85('0xa2')][_0x2a85('0x88')]});}})[_0x2a85('0x26')](function(){return{'sql':_0x1c150e[_0x2a85('0x86')]()};})[_0x2a85('0x26')](respondWithResult(_0x2c18f5,null))['catch'](handleError(_0x2c18f5,null));}; \ No newline at end of file +var _0x6343=['foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','right_join','SUM(%s)','AVG(%s)','SEC_TO_TIME(%s)','HOUR(%s)','IS\x20NOT\x20NULL','value','Sequelize','function','output','%s-%s.%s','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','QueryTypes','SELECT','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','zip-dir','fast-json-patch','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','offset','limit','count','set','json','apply','reject','update','destroy','then','get','CustomReports','UserProfileResource','stack','name','send','index','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','VIRTUAL','findAll','rows','catch','show','params','keys','AnalyticCustomReport','rawAttributes','includeAll','include','merge','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','find','userProfileId','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)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','replace','format','groupBy','orderBy','DESC','alias','joins','parse'];(function(_0x48d059,_0x1841b3){var _0x3450db=function(_0x3ffe10){while(--_0x3ffe10){_0x48d059['push'](_0x48d059['shift']());}};_0x3450db(++_0x1841b3);}(_0x6343,0x168));var _0x3634=function(_0x3a060c,_0x1fb019){_0x3a060c=_0x3a060c-0x0;var _0x24fee=_0x6343[_0x3a060c];return _0x24fee;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3634('0x0'));var jsonpatch=require(_0x3634('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3634('0x2'));var path=require(_0x3634('0x3'));var sox=require('sox');var csv=require(_0x3634('0x4'));var ejs=require(_0x3634('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3634('0x6'));var squel=require(_0x3634('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3634('0x8'));var toCsv=require(_0x3634('0x4'));var querystring=require(_0x3634('0x9'));var Papa=require(_0x3634('0xa'));var Redis=require(_0x3634('0xb'));var authService=require(_0x3634('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3634('0xd'));var logger=require(_0x3634('0xe'))('api');var utils=require(_0x3634('0xf'));var config=require(_0x3634('0x10'));var licenseUtil=require(_0x3634('0x11'));var db=require(_0x3634('0x12'))['db'];var dbH=require(_0x3634('0x12'))[_0x3634('0x13')];function respondWithStatusCode(_0x35ae07,_0x501eba){_0x501eba=_0x501eba||0xcc;return function(_0x7f5aca){if(_0x7f5aca){return _0x35ae07[_0x3634('0x14')](_0x501eba);}return _0x35ae07[_0x3634('0x15')](_0x501eba)[_0x3634('0x16')]();};}function respondWithResult(_0x7e4801,_0x2ad793){_0x2ad793=_0x2ad793||0xc8;return function(_0x5a5063){if(_0x5a5063){return _0x7e4801[_0x3634('0x15')](_0x2ad793)['json'](_0x5a5063);}};}function respondWithFilteredResult(_0x69609d,_0x18285c){return function(_0x2fc628){if(_0x2fc628){var _0x78f93f=typeof _0x18285c[_0x3634('0x17')]==='undefined'&&typeof _0x18285c[_0x3634('0x18')]==='undefined';var _0x50350d=_0x2fc628[_0x3634('0x19')];var _0x4b2115=_0x78f93f?0x0:_0x18285c[_0x3634('0x17')];var _0x32e3c6=_0x78f93f?_0x2fc628[_0x3634('0x19')]:_0x18285c['offset']+_0x18285c[_0x3634('0x18')];var _0x4366bc;if(_0x32e3c6>=_0x50350d){_0x32e3c6=_0x50350d;_0x4366bc=0xc8;}else{_0x4366bc=0xce;}_0x69609d['status'](_0x4366bc);return _0x69609d[_0x3634('0x1a')]('Content-Range',_0x4b2115+'-'+_0x32e3c6+'/'+_0x50350d)[_0x3634('0x1b')](_0x2fc628);}return null;};}function patchUpdates(_0x2fa200){return function(_0x5b77a7){try{jsonpatch[_0x3634('0x1c')](_0x5b77a7,_0x2fa200,!![]);}catch(_0x3df472){return BPromise[_0x3634('0x1d')](_0x3df472);}return _0x5b77a7['save']();};}function saveUpdates(_0x22b7ef,_0x2c8874){return function(_0x52652d){if(_0x52652d){return _0x52652d[_0x3634('0x1e')](_0x22b7ef)['then'](function(_0x5e9188){return _0x5e9188;});}return null;};}function removeEntity(_0x3a8c41,_0x862ab5){return function(_0x5df6fb){if(_0x5df6fb){return _0x5df6fb[_0x3634('0x1f')]()[_0x3634('0x20')](function(){var _0x17db44=_0x5df6fb[_0x3634('0x21')]({'plain':!![]});var _0x363ca2=_0x3634('0x22');return db[_0x3634('0x23')][_0x3634('0x1f')]({'where':{'type':_0x363ca2,'resourceId':_0x17db44['id']}})[_0x3634('0x20')](function(){return _0x5df6fb;});})['then'](function(){_0x3a8c41[_0x3634('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58841d,_0x59f481){return function(_0x7a35c4){if(!_0x7a35c4){_0x58841d['sendStatus'](0x194);}return _0x7a35c4;};}function handleError(_0x3bf28b,_0x12b80e){_0x12b80e=_0x12b80e||0x1f4;return function(_0x49804f){logger['error'](_0x49804f[_0x3634('0x24')]);if(_0x49804f['name']){delete _0x49804f[_0x3634('0x25')];}_0x3bf28b['status'](_0x12b80e)[_0x3634('0x26')](_0x49804f);};}exports[_0x3634('0x27')]=function(_0x1d88f7,_0x17a0fd){var _0x1f46d9={},_0x20b062={},_0x309d53={'count':0x0,'rows':[]};var _0xe1a964=_['map'](db['AnalyticCustomReport']['rawAttributes'],function(_0x3ebdbf){return{'name':_0x3ebdbf['fieldName'],'type':_0x3ebdbf[_0x3634('0x28')][_0x3634('0x29')]};});_0x20b062[_0x3634('0x2a')]=_[_0x3634('0x2b')](_0xe1a964,_0x3634('0x25'));_0x20b062[_0x3634('0x2c')]=_['keys'](_0x1d88f7[_0x3634('0x2c')]);_0x20b062[_0x3634('0x2d')]=_[_0x3634('0x2e')](_0x20b062[_0x3634('0x2a')],_0x20b062[_0x3634('0x2c')]);_0x1f46d9[_0x3634('0x2f')]=_[_0x3634('0x2e')](_0x20b062[_0x3634('0x2a')],qs[_0x3634('0x30')](_0x1d88f7['query'][_0x3634('0x30')]));_0x1f46d9[_0x3634('0x2f')]=_0x1f46d9[_0x3634('0x2f')][_0x3634('0x31')]?_0x1f46d9['attributes']:_0x20b062[_0x3634('0x2a')];if(!_0x1d88f7[_0x3634('0x2c')][_0x3634('0x32')]('nolimit')){_0x1f46d9['limit']=qs['limit'](_0x1d88f7[_0x3634('0x2c')][_0x3634('0x18')]);_0x1f46d9['offset']=qs[_0x3634('0x17')](_0x1d88f7[_0x3634('0x2c')][_0x3634('0x17')]);}_0x1f46d9[_0x3634('0x33')]=qs[_0x3634('0x34')](_0x1d88f7[_0x3634('0x2c')][_0x3634('0x34')]);_0x1f46d9['where']=qs[_0x3634('0x2d')](_['pick'](_0x1d88f7[_0x3634('0x2c')],_0x20b062[_0x3634('0x2d')]),_0xe1a964);if(_0x1d88f7[_0x3634('0x2c')][_0x3634('0x35')]){_0x1f46d9[_0x3634('0x36')]=_['merge'](_0x1f46d9[_0x3634('0x36')],{'$or':_[_0x3634('0x2b')](_0xe1a964,function(_0x32d112){if(_0x32d112[_0x3634('0x28')]!==_0x3634('0x37')){var _0x17714e={};_0x17714e[_0x32d112[_0x3634('0x25')]]={'$like':'%'+_0x1d88f7[_0x3634('0x2c')][_0x3634('0x35')]+'%'};return _0x17714e;}})});}_0x1f46d9=_['merge']({},_0x1f46d9,_0x1d88f7['options']);var _0x14586d={'where':_0x1f46d9['where']};return db['AnalyticCustomReport']['count'](_0x14586d)[_0x3634('0x20')](function(_0x4d06f9){_0x309d53[_0x3634('0x19')]=_0x4d06f9;if(_0x1d88f7[_0x3634('0x2c')]['includeAll']){_0x1f46d9['include']=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x3634('0x38')](_0x1f46d9);})[_0x3634('0x20')](function(_0x5b1dad){_0x309d53[_0x3634('0x39')]=_0x5b1dad;return _0x309d53;})[_0x3634('0x20')](respondWithFilteredResult(_0x17a0fd,_0x1f46d9))[_0x3634('0x3a')](handleError(_0x17a0fd,null));};exports[_0x3634('0x3b')]=function(_0x123a91,_0x5f0711){var _0x497278={'raw':![],'where':{'id':_0x123a91[_0x3634('0x3c')]['id']}},_0x29acea={};_0x29acea[_0x3634('0x2a')]=_[_0x3634('0x3d')](db[_0x3634('0x3e')][_0x3634('0x3f')]);_0x29acea['query']=_[_0x3634('0x3d')](_0x123a91[_0x3634('0x2c')]);_0x29acea[_0x3634('0x2d')]=_['intersection'](_0x29acea['model'],_0x29acea[_0x3634('0x2c')]);_0x497278[_0x3634('0x2f')]=_[_0x3634('0x2e')](_0x29acea[_0x3634('0x2a')],qs[_0x3634('0x30')](_0x123a91[_0x3634('0x2c')][_0x3634('0x30')]));_0x497278[_0x3634('0x2f')]=_0x497278['attributes'][_0x3634('0x31')]?_0x497278[_0x3634('0x2f')]:_0x29acea[_0x3634('0x2a')];if(_0x123a91[_0x3634('0x2c')][_0x3634('0x40')]){_0x497278[_0x3634('0x41')]=[{'all':!![]}];}_0x497278=_[_0x3634('0x42')]({},_0x497278,_0x123a91[_0x3634('0x43')]);return db[_0x3634('0x3e')]['find'](_0x497278)[_0x3634('0x20')](handleEntityNotFound(_0x5f0711,null))[_0x3634('0x20')](respondWithResult(_0x5f0711,null))['catch'](handleError(_0x5f0711,null));};exports[_0x3634('0x44')]=function(_0x454012,_0x254c83){return db[_0x3634('0x3e')][_0x3634('0x44')](_0x454012[_0x3634('0x45')],{})['then'](function(_0x2663a2){var _0x2356a9=_0x454012[_0x3634('0x46')][_0x3634('0x21')]({'plain':!![]});if(!_0x2356a9)throw new Error(_0x3634('0x47'));if(_0x2356a9['role']===_0x3634('0x46')){var _0x20f9f8=_0x2663a2['get']({'plain':!![]});var _0x52b79b=_0x3634('0x48');return db['UserProfileSection'][_0x3634('0x49')]({'where':{'name':_0x52b79b,'userProfileId':_0x2356a9[_0x3634('0x4a')]},'raw':!![]})[_0x3634('0x20')](function(_0x1834a3){if(_0x1834a3&&_0x1834a3['autoAssociation']===0x0){return db[_0x3634('0x23')][_0x3634('0x44')]({'name':_0x20f9f8[_0x3634('0x25')],'resourceId':_0x20f9f8['id'],'type':_0x3634('0x22'),'sectionId':_0x1834a3['id']},{})[_0x3634('0x20')](function(){return _0x2663a2;});}else{return _0x2663a2;}})[_0x3634('0x3a')](function(_0xe3b65){logger[_0x3634('0x4b')](_0x3634('0x4c'),_0xe3b65);throw _0xe3b65;});}return _0x2663a2;})[_0x3634('0x20')](respondWithResult(_0x254c83,0xc9))[_0x3634('0x3a')](handleError(_0x254c83,null));};exports[_0x3634('0x1e')]=function(_0x557438,_0x32b48c){if(_0x557438[_0x3634('0x45')]['id']){delete _0x557438[_0x3634('0x45')]['id'];}return db[_0x3634('0x3e')][_0x3634('0x49')]({'where':{'id':_0x557438[_0x3634('0x3c')]['id']}})[_0x3634('0x20')](handleEntityNotFound(_0x32b48c,null))[_0x3634('0x20')](saveUpdates(_0x557438[_0x3634('0x45')],null))['then'](respondWithResult(_0x32b48c,null))[_0x3634('0x3a')](handleError(_0x32b48c,null));};exports[_0x3634('0x1f')]=function(_0x48d641,_0x31165c){return db[_0x3634('0x3e')]['find']({'where':{'id':_0x48d641[_0x3634('0x3c')]['id']}})[_0x3634('0x20')](handleEntityNotFound(_0x31165c,null))[_0x3634('0x20')](removeEntity(_0x31165c,null))['catch'](handleError(_0x31165c,null));};exports[_0x3634('0x4d')]=function(_0x53da29,_0x1ab731){var _0x51f2f8=0xa;var _0x960c9a=[_0x3634('0x4e'),_0x3634('0x4f'),'right_join',_0x3634('0x50')];var _0x2b72cd={'SUM':'SUM(%s)','COUNT':_0x3634('0x51'),'COUNT DISTINCT':_0x3634('0x52'),'MAX':_0x3634('0x53'),'MIN':_0x3634('0x54'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x3634('0x55'),'GROUP_CONCAT ASC':_0x3634('0x56'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5b8db4={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x3634('0x57'),'HOUR':'HOUR(%s)','ROUND':_0x3634('0x58'),'UNIX_TIMESTAMP':_0x3634('0x59')};var _0x185b18=function(_0x5e29a2){return!_[_0x3634('0x5a')]([_0x3634('0x5b'),'IS\x20NOT\x20NULL',_0x3634('0x5c'),_0x3634('0x5d')],_0x5e29a2);};var _0x27e00b=function(_0x5a9808){if(!_0x5a9808||!_0x5a9808[_0x3634('0x5e')][_0x3634('0x31')]){return'';}for(var _0x897c0e='(',_0xb7dd01=0x0;_0xb7dd01<_0x5a9808[_0x3634('0x5e')]['length'];_0xb7dd01+=0x1){_0xb7dd01>0x0&&(_0x897c0e+='\x20'+_0x5a9808[_0x3634('0x5f')]+'\x20');_0x897c0e+=_0x5a9808[_0x3634('0x5e')][_0xb7dd01][_0x3634('0x60')]?_0x27e00b(_0x5a9808['rules'][_0xb7dd01][_0x3634('0x60')]):_0x5a9808['rules'][_0xb7dd01][_0x3634('0x61')]+'\x20'+_0x5a9808[_0x3634('0x5e')][_0xb7dd01]['condition']+(_0x185b18(_0x5a9808[_0x3634('0x5e')][_0xb7dd01][_0x3634('0x62')])?'\x20'+_0x5a9808[_0x3634('0x5e')][_0xb7dd01]['value']:'');}return _0x897c0e+')';};var _0x44b9c1={'where':{'id':_0x53da29[_0x3634('0x3c')]['id']}},_0x4b724c,_0x4b81ec,_0x1cea1b,_0x58cd2e,_0x30fd12;_0x44b9c1=_[_0x3634('0x42')]({},_0x44b9c1,_0x53da29[_0x3634('0x43')]);return db['AnalyticCustomReport'][_0x3634('0x49')](_0x44b9c1)[_0x3634('0x20')](function(_0x49a72f){if(_0x49a72f){_0x4b724c=_0x49a72f;return _0x49a72f[_0x3634('0x63')]();}return null;})['then'](function(_0xf9a13){if(_0xf9a13){if(!_0xf9a13['length']){throw new db['Sequelize'][(_0x3634('0x64'))](_0x3634('0x65'),0x193);}_0x4b81ec=_0xf9a13;return db[_0x3634('0x66')][_0x3634('0x38')]({'raw':!![]});}return null;})[_0x3634('0x20')](function(_0x49e63d){if(_0x49e63d){_0x1cea1b=_[_0x3634('0x67')](_0x49e63d,'id');var _0x14d4b8;var _0x2e7b1d=squel[_0x3634('0x68')]();_0x2e7b1d[_0x3634('0x69')](_0x4b724c[_0x3634('0x6a')]);for(var _0x23f153=0x0;_0x23f153<_0x4b81ec[_0x3634('0x31')];_0x23f153+=0x1){_0x14d4b8=_0x4b81ec[_0x23f153][_0x3634('0x6b')]?_0x1cea1b[_0x4b81ec[_0x23f153][_0x3634('0x6b')]][_0x3634('0x6c')]:_0x4b81ec[_0x23f153]['field'];_0x14d4b8=_0x4b81ec[_0x23f153]['function']?_[_0x3634('0x6d')](_0x2b72cd[_0x4b81ec[_0x23f153]['function']],'%s',_0x14d4b8):_0x14d4b8;_0x14d4b8=_0x4b81ec[_0x23f153][_0x3634('0x6e')]?_[_0x3634('0x6d')](_0x5b8db4[_0x4b81ec[_0x23f153][_0x3634('0x6e')]],'%s',_0x14d4b8):_0x14d4b8;if(_0x4b81ec[_0x23f153][_0x3634('0x6f')]){_0x2e7b1d[_0x3634('0x60')](_0x14d4b8);}_0x4b81ec[_0x23f153]['orderBy']&&_0x2e7b1d[_0x3634('0x33')](_0x14d4b8,_0x4b81ec[_0x23f153][_0x3634('0x70')]===_0x3634('0x71')?![]:!![]);_0x2e7b1d[_0x3634('0x61')](_0x14d4b8,_0x4b81ec[_0x23f153][_0x3634('0x72')]||_0x14d4b8);}if(_0x4b724c['joins']){_0x4b724c[_0x3634('0x73')]=JSON[_0x3634('0x74')](_0x4b724c[_0x3634('0x73')]);for(var _0x363d8b=0x0;_0x363d8b<_0x4b724c['joins']['length'];_0x363d8b+=0x1){if(_0x4b724c[_0x3634('0x73')][_0x363d8b][_0x3634('0x28')]&&_[_0x3634('0x5a')](_0x960c9a,_0x4b724c[_0x3634('0x73')][_0x363d8b]['type'])&&_0x4b724c[_0x3634('0x73')][_0x363d8b]['parentKey']&&_0x4b724c[_0x3634('0x73')][_0x363d8b]['foreignTable']&&_0x4b724c[_0x3634('0x73')][_0x363d8b][_0x3634('0x75')]){_0x2e7b1d[_0x4b724c[_0x3634('0x73')][_0x363d8b][_0x3634('0x28')]](_0x4b724c[_0x3634('0x73')][_0x363d8b][_0x3634('0x76')],null,util['format'](_0x3634('0x77'),_0x4b724c['table'],_0x4b724c[_0x3634('0x73')][_0x363d8b][_0x3634('0x78')],_0x4b724c[_0x3634('0x73')][_0x363d8b][_0x3634('0x76')],_0x4b724c[_0x3634('0x73')][_0x363d8b][_0x3634('0x75')]));}}}if(_0x4b724c[_0x3634('0x79')]){_0x4b724c[_0x3634('0x79')]=JSON[_0x3634('0x74')](_0x4b724c['conditions']);_0x2e7b1d[_0x3634('0x36')](_0x27e00b(_0x4b724c[_0x3634('0x79')][_0x3634('0x60')]));}_0x30fd12=_0x2e7b1d[_0x3634('0x7a')]();_0x2e7b1d[_0x3634('0x18')](_0x51f2f8);_0x2e7b1d[_0x3634('0x17')](0x0);logger[_0x3634('0x7b')](_0x3634('0x7c'),_0x2e7b1d[_0x3634('0x7d')]());return dbH[_0x3634('0x7e')]['query'](_0x2e7b1d[_0x3634('0x7d')](),{'type':dbH[_0x3634('0x7e')]['QueryTypes']['SELECT']});}})[_0x3634('0x20')](respondWithResult(_0x1ab731,null))[_0x3634('0x3a')](handleError(_0x1ab731,null));};function runReport(_0x32373b,_0x30f7ca,_0x47e9f8){var _0x448db1=_0x30f7ca[_0x3634('0x25')];var _0x5bacd9=0xa;var _0x45f090=[_0x3634('0x4e'),'left_join',_0x3634('0x7f'),_0x3634('0x50')];var _0x4e167a={'SUM':_0x3634('0x80'),'COUNT':_0x3634('0x51'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x3634('0x53'),'MIN':_0x3634('0x54'),'AVG':_0x3634('0x81'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3018cd={'SEC_TO_TIME':_0x3634('0x82'),'DATE':_0x3634('0x57'),'HOUR':_0x3634('0x83'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x7ba69b=function(_0x11f24e){return!_[_0x3634('0x5a')]([_0x3634('0x5b'),_0x3634('0x84'),_0x3634('0x5c'),_0x3634('0x5d')],_0x11f24e);};var _0x4ccc03=function(_0x5ef909){if(!_0x5ef909||!_0x5ef909[_0x3634('0x5e')][_0x3634('0x31')]){return'';}for(var _0x182a13='(',_0x52d5a6=0x0;_0x52d5a6<_0x5ef909[_0x3634('0x5e')][_0x3634('0x31')];_0x52d5a6+=0x1){_0x52d5a6>0x0&&(_0x182a13+='\x20'+_0x5ef909[_0x3634('0x5f')]+'\x20');_0x182a13+=_0x5ef909['rules'][_0x52d5a6][_0x3634('0x60')]?_0x4ccc03(_0x5ef909['rules'][_0x52d5a6][_0x3634('0x60')]):_0x5ef909['rules'][_0x52d5a6][_0x3634('0x61')]+'\x20'+_0x5ef909[_0x3634('0x5e')][_0x52d5a6][_0x3634('0x62')]+(_0x7ba69b(_0x5ef909[_0x3634('0x5e')][_0x52d5a6][_0x3634('0x62')])?'\x20'+_0x5ef909[_0x3634('0x5e')][_0x52d5a6][_0x3634('0x85')]:'');}return _0x182a13+')';};var _0x1b101f={'where':{'id':_0x32373b['id']}},_0x15cb16,_0x2de3cb,_0x4ae858,_0x1feaeb,_0x307f2c;_0x1b101f=_[_0x3634('0x42')]({},_0x1b101f,_0x47e9f8);return db[_0x3634('0x3e')][_0x3634('0x49')](_0x1b101f)[_0x3634('0x20')](function(_0xb4f1f){if(_0xb4f1f){_0x15cb16=_0xb4f1f;return _0xb4f1f[_0x3634('0x63')]();}return null;})[_0x3634('0x20')](function(_0x10e0a2){if(_0x10e0a2){if(!_0x10e0a2[_0x3634('0x31')]){throw new db[(_0x3634('0x86'))][(_0x3634('0x64'))](_0x3634('0x65'),0x193);}_0x2de3cb=_0x10e0a2;return db[_0x3634('0x66')][_0x3634('0x38')]({'raw':!![]});}return null;})[_0x3634('0x20')](function(_0x351c1f){if(_0x351c1f){_0x4ae858=_[_0x3634('0x67')](_0x351c1f,'id');var _0x5e68cd;var _0x512ed4=squel[_0x3634('0x68')]();_0x512ed4[_0x3634('0x69')](_0x15cb16['table']);for(var _0x3f7ee6=0x0;_0x3f7ee6<_0x2de3cb[_0x3634('0x31')];_0x3f7ee6+=0x1){_0x5e68cd=_0x2de3cb[_0x3f7ee6]['MetricId']?_0x4ae858[_0x2de3cb[_0x3f7ee6][_0x3634('0x6b')]]['metric']:_0x2de3cb[_0x3f7ee6][_0x3634('0x61')];_0x5e68cd=_0x2de3cb[_0x3f7ee6][_0x3634('0x87')]?_[_0x3634('0x6d')](_0x4e167a[_0x2de3cb[_0x3f7ee6][_0x3634('0x87')]],'%s',_0x5e68cd):_0x5e68cd;_0x5e68cd=_0x2de3cb[_0x3f7ee6][_0x3634('0x6e')]?_[_0x3634('0x6d')](_0x3018cd[_0x2de3cb[_0x3f7ee6][_0x3634('0x6e')]],'%s',_0x5e68cd):_0x5e68cd;if(_0x2de3cb[_0x3f7ee6][_0x3634('0x6f')]){_0x512ed4[_0x3634('0x60')](_0x5e68cd);}_0x2de3cb[_0x3f7ee6][_0x3634('0x70')]&&_0x512ed4['order'](_0x5e68cd,_0x2de3cb[_0x3f7ee6][_0x3634('0x70')]===_0x3634('0x71')?![]:!![]);_0x512ed4['field'](_0x5e68cd,_0x2de3cb[_0x3f7ee6][_0x3634('0x72')]||_0x5e68cd);}if(_0x15cb16['joins']){_0x15cb16['joins']=JSON[_0x3634('0x74')](_0x15cb16['joins']);for(var _0xac7d50=0x0;_0xac7d50<_0x15cb16[_0x3634('0x73')][_0x3634('0x31')];_0xac7d50+=0x1){if(_0x15cb16[_0x3634('0x73')][_0xac7d50][_0x3634('0x28')]&&_[_0x3634('0x5a')](_0x45f090,_0x15cb16[_0x3634('0x73')][_0xac7d50][_0x3634('0x28')])&&_0x15cb16['joins'][_0xac7d50][_0x3634('0x78')]&&_0x15cb16[_0x3634('0x73')][_0xac7d50][_0x3634('0x76')]&&_0x15cb16[_0x3634('0x73')][_0xac7d50][_0x3634('0x75')]){_0x512ed4[_0x15cb16[_0x3634('0x73')][_0xac7d50]['type']](_0x15cb16[_0x3634('0x73')][_0xac7d50][_0x3634('0x76')],null,util['format'](_0x3634('0x77'),_0x15cb16[_0x3634('0x6a')],_0x15cb16[_0x3634('0x73')][_0xac7d50][_0x3634('0x78')],_0x15cb16[_0x3634('0x73')][_0xac7d50]['foreignTable'],_0x15cb16[_0x3634('0x73')][_0xac7d50][_0x3634('0x75')]));}}}if(_0x15cb16[_0x3634('0x79')]){_0x15cb16['conditions']=JSON[_0x3634('0x74')](_0x15cb16[_0x3634('0x79')]);_0x512ed4[_0x3634('0x36')](_0x4ccc03(_0x15cb16[_0x3634('0x79')]['group']));}_0x307f2c=_0x512ed4['clone']();_0x512ed4[_0x3634('0x18')](_0x5bacd9);_0x512ed4[_0x3634('0x17')](0x0);return;}})[_0x3634('0x20')](function(){if(_0x30f7ca[_0x3634('0x88')]==='web'){return null;}var _0x4a0665=_[_0x3634('0x42')](_0x30f7ca,{'name':_0x30f7ca['fullPath']||_0x30f7ca[_0x3634('0x25')]||_0x15cb16[_0x3634('0x25')],'basename':_0x448db1,'savename':util[_0x3634('0x6e')](_0x3634('0x89'),_0x30f7ca['name']||_0x15cb16[_0x3634('0x25')],require('randomstring')[_0x3634('0x8a')](0x4),_0x30f7ca[_0x3634('0x88')]||_0x3634('0x8b')),'reportId':_0x15cb16['id'],'reportType':'custom'});return db[_0x3634('0x8c')]['create'](_0x4a0665,{'raw':!![]});})['then'](function(_0x46be9f){if(_0x15cb16[_0x3634('0x6a')]===_0x3634('0x8d')){_0x307f2c['where'](_0x15cb16['table']+_0x3634('0x8e'),_0x30f7ca[_0x3634('0x8f')],_0x30f7ca[_0x3634('0x90')]);}else{_0x307f2c[_0x3634('0x36')](_0x15cb16[_0x3634('0x6a')]+_0x3634('0x91'),_0x30f7ca[_0x3634('0x8f')],_0x30f7ca[_0x3634('0x90')]);}if(_0x46be9f){logger[_0x3634('0x92')](_0x3634('0x93'),_0x307f2c[_0x3634('0x7d')]());require(_0x3634('0x94'))[_0x3634('0x95')](path[_0x3634('0x4e')](__dirname,_0x3634('0x96'),_0x46be9f[_0x3634('0x88')]),[_0x46be9f['id'],_0x307f2c[_0x3634('0x7d')](),path[_0x3634('0x4e')](__dirname,_0x3634('0x97'),_0x46be9f[_0x3634('0x98')]),_0x448db1]);return _0x46be9f;}else{var _0x3e7ae9=squel[_0x3634('0x68')]();_0x3e7ae9[_0x3634('0x69')]('('+_0x307f2c['toString']()+')',_0x3634('0x99'));_0x3e7ae9[_0x3634('0x61')]('COUNT(*)','count');_0x307f2c['limit'](_0x30f7ca[_0x3634('0x18')]||_0x5bacd9);_0x307f2c[_0x3634('0x17')](_0x30f7ca[_0x3634('0x17')]||0x0);return dbH['sequelize'][_0x3634('0x2c')](_0x3e7ae9[_0x3634('0x7d')](),{'type':dbH['sequelize'][_0x3634('0x9a')]['SELECT']})['then'](function(_0x5ef8f0){if(!_0x5ef8f0[_0x3634('0x31')]){_0x1feaeb=0x0;}else{_0x1feaeb=_0x5ef8f0[0x0][_0x3634('0x19')]||0x0;}return dbH[_0x3634('0x7e')]['query'](_0x307f2c[_0x3634('0x7d')](),{'type':dbH[_0x3634('0x7e')][_0x3634('0x9a')][_0x3634('0x9b')]});})[_0x3634('0x20')](function(_0x2c88cf){return{'rows':_0x2c88cf||[],'count':_0x1feaeb};});}});}exports[_0x3634('0x9c')]=function(_0x2cdc07,_0x17186f){return runReport(_0x2cdc07[_0x3634('0x3c')],_0x2cdc07[_0x3634('0x2c')],_0x2cdc07['options'])[_0x3634('0x20')](respondWithResult(_0x17186f,null))[_0x3634('0x3a')](handleError(_0x17186f,null));};exports[_0x3634('0x9d')]=runReport;exports['query']=function(_0x1308b9,_0x24d445){var _0x193129=0xa;var _0x4652ea=[_0x3634('0x4e'),_0x3634('0x4f'),'right_join',_0x3634('0x50')];var _0x2d341d={'SUM':_0x3634('0x80'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x3634('0x52'),'MAX':_0x3634('0x53'),'MIN':'MIN(%s)','AVG':_0x3634('0x81'),'GROUP_CONCAT':_0x3634('0x55'),'GROUP_CONCAT ASC':_0x3634('0x56'),'GROUP_CONCAT DESC':_0x3634('0x9e')};var _0xa6b7e4={'SEC_TO_TIME':_0x3634('0x82'),'DATE':_0x3634('0x57'),'HOUR':_0x3634('0x83'),'ROUND':_0x3634('0x58'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xb5ca9f=function(_0x56e0e8){return!_[_0x3634('0x5a')]([_0x3634('0x5b'),_0x3634('0x84'),'IS\x20EMPTY',_0x3634('0x5d')],_0x56e0e8);};var _0x523840=function(_0x2390b9){if(!_0x2390b9||!_0x2390b9[_0x3634('0x5e')][_0x3634('0x31')]){return'';}for(var _0x537825='(',_0x41cd86=0x0;_0x41cd86<_0x2390b9[_0x3634('0x5e')][_0x3634('0x31')];_0x41cd86+=0x1){_0x41cd86>0x0&&(_0x537825+='\x20'+_0x2390b9[_0x3634('0x5f')]+'\x20');_0x537825+=_0x2390b9[_0x3634('0x5e')][_0x41cd86]['group']?_0x523840(_0x2390b9['rules'][_0x41cd86]['group']):_0x2390b9[_0x3634('0x5e')][_0x41cd86]['field']+'\x20'+_0x2390b9['rules'][_0x41cd86][_0x3634('0x62')]+(_0xb5ca9f(_0x2390b9[_0x3634('0x5e')][_0x41cd86]['condition'])?'\x20'+_0x2390b9[_0x3634('0x5e')][_0x41cd86][_0x3634('0x85')]:'');}return _0x537825+')';};var _0x362e43={'where':{'id':_0x1308b9[_0x3634('0x3c')]['id']}},_0x4d874c,_0x48eeaf,_0x1f31d0,_0x302c96,_0x1c986b;_0x362e43=_['merge']({},_0x362e43,_0x1308b9[_0x3634('0x43')]);return db[_0x3634('0x3e')][_0x3634('0x49')](_0x362e43)['then'](function(_0xa65b57){if(_0xa65b57){_0x4d874c=_0xa65b57;return _0xa65b57[_0x3634('0x63')]();}return null;})[_0x3634('0x20')](function(_0x5c1f18){if(_0x5c1f18){if(!_0x5c1f18['length']){throw new db['Sequelize']['ValidationErrorItem'](_0x3634('0x65'),0x193);}_0x48eeaf=_0x5c1f18;return db[_0x3634('0x66')][_0x3634('0x38')]({'raw':!![]});}return null;})[_0x3634('0x20')](function(_0x2293c8){if(_0x2293c8){_0x1f31d0=_[_0x3634('0x67')](_0x2293c8,'id');var _0x3dd2e2;var _0x40b6e0=squel[_0x3634('0x68')]();_0x40b6e0[_0x3634('0x69')](_0x4d874c[_0x3634('0x6a')]);for(var _0x1ddc27=0x0;_0x1ddc27<_0x48eeaf[_0x3634('0x31')];_0x1ddc27+=0x1){_0x3dd2e2=_0x48eeaf[_0x1ddc27][_0x3634('0x6b')]?_0x1f31d0[_0x48eeaf[_0x1ddc27][_0x3634('0x6b')]][_0x3634('0x6c')]:_0x48eeaf[_0x1ddc27][_0x3634('0x61')];_0x3dd2e2=_0x48eeaf[_0x1ddc27][_0x3634('0x87')]?_['replace'](_0x2d341d[_0x48eeaf[_0x1ddc27][_0x3634('0x87')]],'%s',_0x3dd2e2):_0x3dd2e2;_0x3dd2e2=_0x48eeaf[_0x1ddc27][_0x3634('0x6e')]?_[_0x3634('0x6d')](_0xa6b7e4[_0x48eeaf[_0x1ddc27][_0x3634('0x6e')]],'%s',_0x3dd2e2):_0x3dd2e2;if(_0x48eeaf[_0x1ddc27][_0x3634('0x6f')]){_0x40b6e0['group'](_0x3dd2e2);}_0x48eeaf[_0x1ddc27][_0x3634('0x70')]&&_0x40b6e0[_0x3634('0x33')](_0x3dd2e2,_0x48eeaf[_0x1ddc27][_0x3634('0x70')]===_0x3634('0x71')?![]:!![]);_0x40b6e0[_0x3634('0x61')](_0x3dd2e2,_0x48eeaf[_0x1ddc27]['alias']||_0x3dd2e2);}if(_0x4d874c[_0x3634('0x73')]){_0x4d874c[_0x3634('0x73')]=JSON[_0x3634('0x74')](_0x4d874c[_0x3634('0x73')]);for(var _0x18e824=0x0;_0x18e824<_0x4d874c['joins'][_0x3634('0x31')];_0x18e824+=0x1){if(_0x4d874c[_0x3634('0x73')][_0x18e824][_0x3634('0x28')]&&_[_0x3634('0x5a')](_0x4652ea,_0x4d874c['joins'][_0x18e824][_0x3634('0x28')])&&_0x4d874c[_0x3634('0x73')][_0x18e824][_0x3634('0x78')]&&_0x4d874c[_0x3634('0x73')][_0x18e824]['foreignTable']&&_0x4d874c[_0x3634('0x73')][_0x18e824][_0x3634('0x75')]){_0x40b6e0[_0x4d874c[_0x3634('0x73')][_0x18e824][_0x3634('0x28')]](_0x4d874c['joins'][_0x18e824][_0x3634('0x76')],null,util[_0x3634('0x6e')](_0x3634('0x77'),_0x4d874c[_0x3634('0x6a')],_0x4d874c[_0x3634('0x73')][_0x18e824][_0x3634('0x78')],_0x4d874c[_0x3634('0x73')][_0x18e824][_0x3634('0x76')],_0x4d874c[_0x3634('0x73')][_0x18e824][_0x3634('0x75')]));}}}if(_0x4d874c[_0x3634('0x79')]){_0x4d874c[_0x3634('0x79')]=JSON['parse'](_0x4d874c[_0x3634('0x79')]);_0x40b6e0[_0x3634('0x36')](_0x523840(_0x4d874c[_0x3634('0x79')][_0x3634('0x60')]));}_0x1c986b=_0x40b6e0[_0x3634('0x7a')]();_0x40b6e0[_0x3634('0x18')](_0x193129);_0x40b6e0['offset'](0x0);logger['debug'](_0x3634('0x7c'),_0x40b6e0[_0x3634('0x7d')]());return dbH['sequelize'][_0x3634('0x2c')](_0x40b6e0['toString'](),{'type':dbH[_0x3634('0x7e')][_0x3634('0x9a')][_0x3634('0x9b')]});}})[_0x3634('0x20')](function(){return{'sql':_0x1c986b[_0x3634('0x7d')]()};})[_0x3634('0x20')](respondWithResult(_0x24d445,null))[_0x3634('0x3a')](handleError(_0x24d445,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 26148b4..9375960 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 _0xb81b=['rimraf','../../config/environment','exports','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment','path'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb81b,0x186));var _0xbb81=function(_0x3ce69a,_0x30d0ad){_0x3ce69a=_0x3ce69a-0x0;var _0x371e19=_0xb81b[_0x3ce69a];return _0x371e19;};'use strict';var _=require(_0xbb81('0x0'));var util=require(_0xbb81('0x1'));var logger=require(_0xbb81('0x2'))(_0xbb81('0x3'));var moment=require(_0xbb81('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb81('0x5'));var rimraf=require(_0xbb81('0x6'));var config=require(_0xbb81('0x7'));var attributes=require('./analyticCustomReport.attributes');module[_0xbb81('0x8')]=function(_0x34be1c,_0x50a8c8){return _0x34be1c['define'](_0xbb81('0x9'),attributes,{'tableName':_0xbb81('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1158=['analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define'];(function(_0x787e9d,_0x59ea62){var _0x4bf116=function(_0x47df0b){while(--_0x47df0b){_0x787e9d['push'](_0x787e9d['shift']());}};_0x4bf116(++_0x59ea62);}(_0x1158,0x8d));var _0x8115=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x1158[_0x9cd4c3];return _0x4c9025;};'use strict';var _=require(_0x8115('0x0'));var util=require(_0x8115('0x1'));var logger=require(_0x8115('0x2'))(_0x8115('0x3'));var moment=require(_0x8115('0x4'));var BPromise=require(_0x8115('0x5'));var rp=require(_0x8115('0x6'));var fs=require('fs');var path=require(_0x8115('0x7'));var rimraf=require(_0x8115('0x8'));var config=require(_0x8115('0x9'));var attributes=require(_0x8115('0xa'));module[_0x8115('0xb')]=function(_0x15b2ae,_0x178030){return _0x15b2ae[_0x8115('0xc')]('AnalyticCustomReport',attributes,{'tableName':_0x8115('0xd'),'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 fc61729..ba0c88c 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 _0xe265=['request','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2d61ac,_0x18ff36){var _0x3f7d3c=function(_0x2ba7e5){while(--_0x2ba7e5){_0x2d61ac['push'](_0x2d61ac['shift']());}};_0x3f7d3c(++_0x18ff36);}(_0xe265,0xdb));var _0x5e26=function(_0x1f1b8e,_0x20bf10){_0x1f1b8e=_0x1f1b8e-0x0;var _0x15cbfd=_0xe265[_0x1f1b8e];return _0x15cbfd;};'use strict';var _=require('lodash');var util=require(_0x5e26('0x0'));var moment=require('moment');var BPromise=require(_0x5e26('0x1'));var rs=require(_0x5e26('0x2'));var fs=require('fs');var Redis=require(_0x5e26('0x3'));var db=require(_0x5e26('0x4'))['db'];var utils=require(_0x5e26('0x5'));var logger=require(_0x5e26('0x6'))(_0x5e26('0x7'));var config=require(_0x5e26('0x8'));var jayson=require(_0x5e26('0x9'));var client=jayson['client'][_0x5e26('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5309c4,_0xf833a5,_0x4ae13a){return new BPromise(function(_0x572c,_0x39d158){return client[_0x5e26('0xb')](_0x5309c4,_0x4ae13a)['then'](function(_0x55cfa1){logger['info'](_0x5e26('0xc'),_0xf833a5,_0x5e26('0xd'));logger[_0x5e26('0xe')](_0x5e26('0xf'),_0xf833a5,'request\x20sent',JSON[_0x5e26('0x10')](_0x55cfa1));if(_0x55cfa1[_0x5e26('0x11')]){if(_0x55cfa1['error'][_0x5e26('0x12')]===0x1f4){logger['error'](_0x5e26('0xc'),_0xf833a5,_0x55cfa1['error'][_0x5e26('0x13')]);return _0x39d158(_0x55cfa1[_0x5e26('0x11')][_0x5e26('0x13')]);}logger[_0x5e26('0x11')](_0x5e26('0xc'),_0xf833a5,_0x55cfa1[_0x5e26('0x11')]['message']);return _0x572c(_0x55cfa1[_0x5e26('0x11')][_0x5e26('0x13')]);}else{logger[_0x5e26('0x14')]('AnalyticCustomReport,\x20%s,\x20%s',_0xf833a5,'request\x20sent');_0x572c(_0x55cfa1[_0x5e26('0x15')][_0x5e26('0x13')]);}})[_0x5e26('0x16')](function(_0x357f46){logger[_0x5e26('0x11')](_0x5e26('0xc'),_0xf833a5,_0x357f46);_0x39d158(_0x357f46);});});} \ No newline at end of file +var _0xa096=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment'];(function(_0x210d44,_0x2aee9b){var _0x4fd2f0=function(_0x3778c6){while(--_0x3778c6){_0x210d44['push'](_0x210d44['shift']());}};_0x4fd2f0(++_0x2aee9b);}(_0xa096,0x13d));var _0x6a09=function(_0x1823c8,_0x243627){_0x1823c8=_0x1823c8-0x0;var _0x5760f9=_0xa096[_0x1823c8];return _0x5760f9;};'use strict';var _=require(_0x6a09('0x0'));var util=require(_0x6a09('0x1'));var moment=require(_0x6a09('0x2'));var BPromise=require('bluebird');var rs=require(_0x6a09('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6a09('0x4'))['db'];var utils=require(_0x6a09('0x5'));var logger=require(_0x6a09('0x6'))(_0x6a09('0x7'));var config=require(_0x6a09('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x29fde9,_0x190c17,_0xb34253){return new BPromise(function(_0x239bb0,_0x5d8229){return client[_0x6a09('0x9')](_0x29fde9,_0xb34253)[_0x6a09('0xa')](function(_0x5d09d3){logger[_0x6a09('0xb')](_0x6a09('0xc'),_0x190c17,'request\x20sent');logger['debug'](_0x6a09('0xd'),_0x190c17,_0x6a09('0xe'),JSON[_0x6a09('0xf')](_0x5d09d3));if(_0x5d09d3[_0x6a09('0x10')]){if(_0x5d09d3['error'][_0x6a09('0x11')]===0x1f4){logger[_0x6a09('0x10')](_0x6a09('0xc'),_0x190c17,_0x5d09d3[_0x6a09('0x10')]['message']);return _0x5d8229(_0x5d09d3[_0x6a09('0x10')][_0x6a09('0x12')]);}logger[_0x6a09('0x10')](_0x6a09('0xc'),_0x190c17,_0x5d09d3[_0x6a09('0x10')]['message']);return _0x239bb0(_0x5d09d3[_0x6a09('0x10')][_0x6a09('0x12')]);}else{logger[_0x6a09('0xb')](_0x6a09('0xc'),_0x190c17,'request\x20sent');_0x239bb0(_0x5d09d3[_0x6a09('0x13')]['message']);}})['catch'](function(_0x13e130){logger[_0x6a09('0x10')](_0x6a09('0xc'),_0x190c17,_0x13e130);_0x5d8229(_0x13e130);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index cb1469a..0483d27 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 _0x6b18=['express','fs-extra','get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','/:id/query','query','post','create','delete','destroy','util','path','connect-timeout'];(function(_0xbf3f74,_0x1ae4bf){var _0xd26ead=function(_0x558853){while(--_0x558853){_0xbf3f74['push'](_0xbf3f74['shift']());}};_0xd26ead(++_0x1ae4bf);}(_0x6b18,0xf9));var _0x86b1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6b18[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x86b1('0x0'));var path=require(_0x86b1('0x1'));var timeout=require(_0x86b1('0x2'));var express=require(_0x86b1('0x3'));var router=express['Router']();var fs_extra=require(_0x86b1('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router[_0x86b1('0x5')]('/',auth[_0x86b1('0x6')](),controller[_0x86b1('0x7')]);router[_0x86b1('0x5')](_0x86b1('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x86b1('0x5')](_0x86b1('0x9'),auth[_0x86b1('0x6')](),controller[_0x86b1('0xa')]);router['get'](_0x86b1('0xb'),auth[_0x86b1('0x6')](),controller['run']);router['get'](_0x86b1('0xc'),auth[_0x86b1('0x6')](),controller[_0x86b1('0xd')]);router[_0x86b1('0xe')]('/',auth[_0x86b1('0x6')](),controller[_0x86b1('0xf')]);router['put'](_0x86b1('0x8'),auth[_0x86b1('0x6')](),controller['update']);router[_0x86b1('0x10')](_0x86b1('0x8'),auth['isAuthenticated'](),controller[_0x86b1('0x11')]);module['exports']=router; \ No newline at end of file +var _0x8693=['/:id/run','run','/:id/query','query','post','create','put','update','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','preview'];(function(_0x42dffa,_0x5431a3){var _0x40293a=function(_0x4a392c){while(--_0x4a392c){_0x42dffa['push'](_0x42dffa['shift']());}};_0x40293a(++_0x5431a3);}(_0x8693,0x1d7));var _0x3869=function(_0x9b6ce7,_0x18816e){_0x9b6ce7=_0x9b6ce7-0x0;var _0x350863=_0x8693[_0x9b6ce7];return _0x350863;};'use strict';var multer=require(_0x3869('0x0'));var util=require(_0x3869('0x1'));var path=require(_0x3869('0x2'));var timeout=require('connect-timeout');var express=require(_0x3869('0x3'));var router=express['Router']();var fs_extra=require(_0x3869('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3869('0x5'));var config=require(_0x3869('0x6'));var controller=require('./analyticCustomReport.controller');router['get']('/',auth[_0x3869('0x7')](),controller[_0x3869('0x8')]);router[_0x3869('0x9')](_0x3869('0xa'),auth['isAuthenticated'](),controller[_0x3869('0xb')]);router['get']('/:id/preview',auth['isAuthenticated'](),controller[_0x3869('0xc')]);router[_0x3869('0x9')](_0x3869('0xd'),auth[_0x3869('0x7')](),controller[_0x3869('0xe')]);router[_0x3869('0x9')](_0x3869('0xf'),auth[_0x3869('0x7')](),controller[_0x3869('0x10')]);router[_0x3869('0x11')]('/',auth[_0x3869('0x7')](),controller[_0x3869('0x12')]);router[_0x3869('0x13')](_0x3869('0xa'),auth[_0x3869('0x7')](),controller[_0x3869('0x14')]);router['delete'](_0x3869('0xa'),auth[_0x3869('0x7')](),controller['destroy']);module[_0x3869('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 9ce8afb..c4e499e 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 _0xbd51=['sequelize','STRING'];(function(_0xa5a920,_0x2d8772){var _0x596618=function(_0x5eab42){while(--_0x5eab42){_0xa5a920['push'](_0xa5a920['shift']());}};_0x596618(++_0x2d8772);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x41b649,_0x4f6ca4){_0x41b649=_0x41b649-0x0;var _0x5e2d4b=_0xbd51[_0x41b649];return _0x5e2d4b;};'use strict';var Sequelize=require(_0x1bd5('0x0'));module['exports']={'name':{'type':Sequelize[_0x1bd5('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1bd5('0x1')]},'parent':{'type':Sequelize[_0x1bd5('0x1')]},'table':{'type':Sequelize[_0x1bd5('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xbd51=['sequelize','STRING'];(function(_0x30df3b,_0x90abb5){var _0xe1b865=function(_0x290722){while(--_0x290722){_0x30df3b['push'](_0x30df3b['shift']());}};_0xe1b865(++_0x90abb5);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x2ad8cc,_0x12275d){_0x2ad8cc=_0x2ad8cc-0x0;var _0x34e054=_0xbd51[_0x2ad8cc];return _0x34e054;};'use strict';var Sequelize=require(_0x1bd5('0x0'));module['exports']={'name':{'type':Sequelize[_0x1bd5('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1bd5('0x1')]},'parent':{'type':Sequelize[_0x1bd5('0x1')]},'table':{'type':Sequelize[_0x1bd5('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index baad183..62eaed7 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 _0x2542=['getFields','ValidationErrorItem','metric','format','DESC','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','sequelize','SELECT','run','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','set','save','destroy','then','get','end','error','stack','name','send','index','map','AnalyticDefaultReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','params','rawAttributes','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20EMPTY','rules','group','condition','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','field','replace','function','groupBy','orderBy','alias','parse','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','toString','QueryTypes','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','operator','value'];(function(_0xa2fa45,_0x21f746){var _0x13d0c1=function(_0x4759f3){while(--_0x4759f3){_0xa2fa45['push'](_0xa2fa45['shift']());}};_0x13d0c1(++_0x21f746);}(_0x2542,0x169));var _0x2254=function(_0x265cc9,_0x2c2e96){_0x265cc9=_0x265cc9-0x0;var _0x5686a4=_0x2542[_0x265cc9];return _0x5686a4;};'use strict';var emlformat=require(_0x2254('0x0'));var rimraf=require(_0x2254('0x1'));var zipdir=require(_0x2254('0x2'));var jsonpatch=require(_0x2254('0x3'));var rp=require('request-promise');var moment=require(_0x2254('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2254('0x5'));var util=require(_0x2254('0x6'));var path=require(_0x2254('0x7'));var sox=require(_0x2254('0x8'));var csv=require(_0x2254('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2254('0xa'));var _=require(_0x2254('0xb'));var squel=require(_0x2254('0xc'));var crypto=require(_0x2254('0xd'));var jsforce=require(_0x2254('0xe'));var deskjs=require(_0x2254('0xf'));var toCsv=require(_0x2254('0x9'));var querystring=require(_0x2254('0x10'));var Papa=require(_0x2254('0x11'));var Redis=require(_0x2254('0x12'));var authService=require(_0x2254('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2254('0x14'));var hardwareService=require(_0x2254('0x15'));var logger=require(_0x2254('0x16'))(_0x2254('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2254('0x18'));var db=require(_0x2254('0x19'))['db'];var dbH=require(_0x2254('0x19'))[_0x2254('0x1a')];function respondWithStatusCode(_0x3c326b,_0x381efe){_0x381efe=_0x381efe||0xcc;return function(_0x592a4f){if(_0x592a4f){return _0x3c326b[_0x2254('0x1b')](_0x381efe);}return _0x3c326b[_0x2254('0x1c')](_0x381efe)['end']();};}function respondWithResult(_0x2f4de,_0x1e582d){_0x1e582d=_0x1e582d||0xc8;return function(_0xfb23cb){if(_0xfb23cb){return _0x2f4de[_0x2254('0x1c')](_0x1e582d)[_0x2254('0x1d')](_0xfb23cb);}};}function respondWithFilteredResult(_0xbc5548,_0x50f137){return function(_0x18baf4){if(_0x18baf4){var _0x57247a=typeof _0x50f137[_0x2254('0x1e')]===_0x2254('0x1f')&&typeof _0x50f137[_0x2254('0x20')]===_0x2254('0x1f');var _0x1ae11e=_0x18baf4[_0x2254('0x21')];var _0x497724=_0x57247a?0x0:_0x50f137['offset'];var _0x5ec98d=_0x57247a?_0x18baf4[_0x2254('0x21')]:_0x50f137[_0x2254('0x1e')]+_0x50f137[_0x2254('0x20')];var _0x1f1163;if(_0x5ec98d>=_0x1ae11e){_0x5ec98d=_0x1ae11e;_0x1f1163=0xc8;}else{_0x1f1163=0xce;}_0xbc5548[_0x2254('0x1c')](_0x1f1163);return _0xbc5548[_0x2254('0x22')]('Content-Range',_0x497724+'-'+_0x5ec98d+'/'+_0x1ae11e)[_0x2254('0x1d')](_0x18baf4);}return null;};}function patchUpdates(_0x16148d){return function(_0x906cde){try{jsonpatch['apply'](_0x906cde,_0x16148d,!![]);}catch(_0x52fedc){return BPromise['reject'](_0x52fedc);}return _0x906cde[_0x2254('0x23')]();};}function saveUpdates(_0x559af4,_0xf88b56){return function(_0x56b91e){if(_0x56b91e){return _0x56b91e['update'](_0x559af4)['then'](function(_0x540020){return _0x540020;});}return null;};}function removeEntity(_0x5e5edb,_0x4f797d){return function(_0x1aa71f){if(_0x1aa71f){return _0x1aa71f[_0x2254('0x24')]()[_0x2254('0x25')](function(){var _0x265467=_0x1aa71f[_0x2254('0x26')]({'plain':!![]});var _0x1349c9='DefaultReports';return db['UserProfileResource'][_0x2254('0x24')]({'where':{'type':_0x1349c9,'resourceId':_0x265467['id']}})['then'](function(){return _0x1aa71f;});})[_0x2254('0x25')](function(){_0x5e5edb[_0x2254('0x1c')](0xcc)[_0x2254('0x27')]();});}};}function handleEntityNotFound(_0x3aa0bd,_0x19043b){return function(_0x482688){if(!_0x482688){_0x3aa0bd[_0x2254('0x1b')](0x194);}return _0x482688;};}function handleError(_0x2a789b,_0x21285d){_0x21285d=_0x21285d||0x1f4;return function(_0x37af8b){logger[_0x2254('0x28')](_0x37af8b[_0x2254('0x29')]);if(_0x37af8b[_0x2254('0x2a')]){delete _0x37af8b[_0x2254('0x2a')];}_0x2a789b[_0x2254('0x1c')](_0x21285d)[_0x2254('0x2b')](_0x37af8b);};}exports[_0x2254('0x2c')]=function(_0xad7774,_0x220f2a){var _0x27d30a={},_0x4577f4={},_0x1b16c8={'count':0x0,'rows':[]};var _0x2c929f=_[_0x2254('0x2d')](db[_0x2254('0x2e')]['rawAttributes'],function(_0xe29526){return{'name':_0xe29526[_0x2254('0x2f')],'type':_0xe29526[_0x2254('0x30')][_0x2254('0x31')]};});_0x4577f4[_0x2254('0x32')]=_[_0x2254('0x2d')](_0x2c929f,_0x2254('0x2a'));_0x4577f4[_0x2254('0x33')]=_[_0x2254('0x34')](_0xad7774['query']);_0x4577f4[_0x2254('0x35')]=_[_0x2254('0x36')](_0x4577f4['model'],_0x4577f4[_0x2254('0x33')]);_0x27d30a[_0x2254('0x37')]=_[_0x2254('0x36')](_0x4577f4[_0x2254('0x32')],qs['fields'](_0xad7774['query'][_0x2254('0x38')]));_0x27d30a['attributes']=_0x27d30a[_0x2254('0x37')][_0x2254('0x39')]?_0x27d30a[_0x2254('0x37')]:_0x4577f4[_0x2254('0x32')];if(!_0xad7774[_0x2254('0x33')][_0x2254('0x3a')](_0x2254('0x3b'))){_0x27d30a['limit']=qs[_0x2254('0x20')](_0xad7774[_0x2254('0x33')][_0x2254('0x20')]);_0x27d30a[_0x2254('0x1e')]=qs[_0x2254('0x1e')](_0xad7774[_0x2254('0x33')][_0x2254('0x1e')]);}_0x27d30a[_0x2254('0x3c')]=qs[_0x2254('0x3d')](_0xad7774[_0x2254('0x33')]['sort']);_0x27d30a[_0x2254('0x3e')]=qs[_0x2254('0x35')](_[_0x2254('0x3f')](_0xad7774[_0x2254('0x33')],_0x4577f4['filters']),_0x2c929f);if(_0xad7774[_0x2254('0x33')][_0x2254('0x40')]){_0x27d30a[_0x2254('0x3e')]=_[_0x2254('0x41')](_0x27d30a[_0x2254('0x3e')],{'$or':_[_0x2254('0x2d')](_0x2c929f,function(_0x423377){if(_0x423377[_0x2254('0x30')]!=='VIRTUAL'){var _0x362ad1={};_0x362ad1[_0x423377['name']]={'$like':'%'+_0xad7774[_0x2254('0x33')][_0x2254('0x40')]+'%'};return _0x362ad1;}})});}_0x27d30a=_[_0x2254('0x41')]({},_0x27d30a,_0xad7774[_0x2254('0x42')]);var _0x460bb3={'where':_0x27d30a[_0x2254('0x3e')]};return db[_0x2254('0x2e')]['count'](_0x460bb3)[_0x2254('0x25')](function(_0x2f1ff9){_0x1b16c8[_0x2254('0x21')]=_0x2f1ff9;if(_0xad7774[_0x2254('0x33')][_0x2254('0x43')]){_0x27d30a['include']=[{'all':!![]}];}return db[_0x2254('0x2e')][_0x2254('0x44')](_0x27d30a);})[_0x2254('0x25')](function(_0x135ed8){_0x1b16c8[_0x2254('0x45')]=_0x135ed8;return _0x1b16c8;})['then'](respondWithFilteredResult(_0x220f2a,_0x27d30a))[_0x2254('0x46')](handleError(_0x220f2a,null));};exports['show']=function(_0x91e091,_0x1ded9a){var _0xb4d042={'raw':!![],'where':{'id':_0x91e091[_0x2254('0x47')]['id']}},_0x31c31e={};_0x31c31e[_0x2254('0x32')]=_[_0x2254('0x34')](db[_0x2254('0x2e')][_0x2254('0x48')]);_0x31c31e[_0x2254('0x33')]=_[_0x2254('0x34')](_0x91e091[_0x2254('0x33')]);_0x31c31e[_0x2254('0x35')]=_['intersection'](_0x31c31e[_0x2254('0x32')],_0x31c31e[_0x2254('0x33')]);_0xb4d042[_0x2254('0x37')]=_['intersection'](_0x31c31e[_0x2254('0x32')],qs[_0x2254('0x38')](_0x91e091[_0x2254('0x33')][_0x2254('0x38')]));_0xb4d042[_0x2254('0x37')]=_0xb4d042[_0x2254('0x37')][_0x2254('0x39')]?_0xb4d042[_0x2254('0x37')]:_0x31c31e[_0x2254('0x32')];if(_0x91e091['query'][_0x2254('0x43')]){_0xb4d042[_0x2254('0x49')]=[{'all':!![]}];}_0xb4d042=_[_0x2254('0x41')]({},_0xb4d042,_0x91e091[_0x2254('0x42')]);return db[_0x2254('0x2e')][_0x2254('0x4a')](_0xb4d042)[_0x2254('0x25')](handleEntityNotFound(_0x1ded9a,null))[_0x2254('0x25')](respondWithResult(_0x1ded9a,null))[_0x2254('0x46')](handleError(_0x1ded9a,null));};exports[_0x2254('0x4b')]=function(_0x5b14c5,_0x36b977){return db[_0x2254('0x2e')]['create'](_0x5b14c5[_0x2254('0x4c')],{})[_0x2254('0x25')](function(_0x12e2ff){var _0x4331a9=_0x5b14c5['user'][_0x2254('0x26')]({'plain':!![]});if(!_0x4331a9)throw new Error(_0x2254('0x4d'));if(_0x4331a9['role']===_0x2254('0x4e')){var _0x3f0670=_0x12e2ff[_0x2254('0x26')]({'plain':!![]});var _0x43bb88='Reports';return db[_0x2254('0x4f')][_0x2254('0x4a')]({'where':{'name':_0x43bb88,'userProfileId':_0x4331a9[_0x2254('0x50')]},'raw':!![]})['then'](function(_0x4cc18a){if(_0x4cc18a&&_0x4cc18a[_0x2254('0x51')]===0x0){return db[_0x2254('0x52')]['create']({'name':_0x3f0670[_0x2254('0x2a')],'resourceId':_0x3f0670['id'],'type':'DefaultReports','sectionId':_0x4cc18a['id']},{})['then'](function(){return _0x12e2ff;});}else{return _0x12e2ff;}})[_0x2254('0x46')](function(_0x135962){logger[_0x2254('0x28')](_0x2254('0x53'),_0x135962);throw _0x135962;});}return _0x12e2ff;})[_0x2254('0x25')](respondWithResult(_0x36b977,0xc9))['catch'](handleError(_0x36b977,null));};exports['update']=function(_0x1bd988,_0x5e3fbc){if(_0x1bd988[_0x2254('0x4c')]['id']){delete _0x1bd988[_0x2254('0x4c')]['id'];}return db[_0x2254('0x2e')][_0x2254('0x4a')]({'where':{'id':_0x1bd988['params']['id']}})[_0x2254('0x25')](handleEntityNotFound(_0x5e3fbc,null))[_0x2254('0x25')](saveUpdates(_0x1bd988['body'],null))['then'](respondWithResult(_0x5e3fbc,null))[_0x2254('0x46')](handleError(_0x5e3fbc,null));};exports['destroy']=function(_0x2cc59c,_0x305ace){return db[_0x2254('0x2e')][_0x2254('0x4a')]({'where':{'id':_0x2cc59c[_0x2254('0x47')]['id']}})['then'](handleEntityNotFound(_0x305ace,null))['then'](removeEntity(_0x305ace,null))[_0x2254('0x46')](handleError(_0x305ace,null));};exports['preview']=function(_0x335c66,_0x510fe0){var _0x4da493=0xa;var _0x5999c8=[_0x2254('0x54'),_0x2254('0x55'),_0x2254('0x56'),_0x2254('0x57')];var _0x13606e={'SUM':_0x2254('0x58'),'COUNT':_0x2254('0x59'),'COUNT DISTINCT':_0x2254('0x5a'),'MAX':_0x2254('0x5b'),'MIN':_0x2254('0x5c'),'AVG':_0x2254('0x5d'),'GROUP_CONCAT':_0x2254('0x5e'),'GROUP_CONCAT ASC':_0x2254('0x5f'),'GROUP_CONCAT DESC':_0x2254('0x60')};var _0x2f391d={'SEC_TO_TIME':_0x2254('0x61'),'DATE':_0x2254('0x62'),'HOUR':_0x2254('0x63'),'ROUND':_0x2254('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x329378=function(_0xae171c){return!_[_0x2254('0x65')]([_0x2254('0x66'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x2254('0x67')],_0xae171c);};var _0x423c17=function(_0x1d73a3){if(!_0x1d73a3||!_0x1d73a3[_0x2254('0x68')][_0x2254('0x39')]){return'';}for(var _0x53b55b='(',_0x45b7bd=0x0;_0x45b7bd<_0x1d73a3[_0x2254('0x68')][_0x2254('0x39')];_0x45b7bd+=0x1){_0x45b7bd>0x0&&(_0x53b55b+='\x20'+_0x1d73a3['operator']+'\x20');_0x53b55b+=_0x1d73a3['rules'][_0x45b7bd][_0x2254('0x69')]?_0x423c17(_0x1d73a3['rules'][_0x45b7bd][_0x2254('0x69')]):_0x1d73a3[_0x2254('0x68')][_0x45b7bd]['field']+'\x20'+_0x1d73a3[_0x2254('0x68')][_0x45b7bd][_0x2254('0x6a')]+(_0x329378(_0x1d73a3['rules'][_0x45b7bd][_0x2254('0x6a')])?'\x20'+_0x1d73a3[_0x2254('0x68')][_0x45b7bd]['value']:'');}return _0x53b55b+')';};var _0x5cc6bd={'where':{'id':_0x335c66['params']['id']}},_0xde4e7,_0xa159a4,_0x486b82,_0x506d95,_0x48406e;_0x5cc6bd=_[_0x2254('0x41')]({},_0x5cc6bd,_0x335c66['options']);return db[_0x2254('0x2e')][_0x2254('0x4a')](_0x5cc6bd)[_0x2254('0x25')](function(_0x1ed6b9){if(_0x1ed6b9){_0xde4e7=_0x1ed6b9;return _0x1ed6b9['getFields']();}return null;})[_0x2254('0x25')](function(_0x5ecf82){if(_0x5ecf82){if(!_0x5ecf82[_0x2254('0x39')]){throw new db[(_0x2254('0x6b'))]['ValidationErrorItem'](_0x2254('0x6c'),0x193);}_0xa159a4=_0x5ecf82;return db[_0x2254('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x2254('0x25')](function(_0x3b3b20){if(_0x3b3b20){_0x486b82=_[_0x2254('0x6e')](_0x3b3b20,'id');var _0x3cefbe;var _0x4f77e5=squel[_0x2254('0x6f')]();_0x4f77e5[_0x2254('0x70')](_0xde4e7['table']);for(var _0x1ac8ff=0x0;_0x1ac8ff<_0xa159a4[_0x2254('0x39')];_0x1ac8ff+=0x1){_0x3cefbe=_0xa159a4[_0x1ac8ff]['MetricId']?_0x486b82[_0xa159a4[_0x1ac8ff][_0x2254('0x71')]]['metric']:_0xa159a4[_0x1ac8ff][_0x2254('0x72')];_0x3cefbe=_0xa159a4[_0x1ac8ff]['function']?_[_0x2254('0x73')](_0x13606e[_0xa159a4[_0x1ac8ff][_0x2254('0x74')]],'%s',_0x3cefbe):_0x3cefbe;_0x3cefbe=_0xa159a4[_0x1ac8ff]['format']?_[_0x2254('0x73')](_0x2f391d[_0xa159a4[_0x1ac8ff]['format']],'%s',_0x3cefbe):_0x3cefbe;if(_0xa159a4[_0x1ac8ff][_0x2254('0x75')]){_0x4f77e5[_0x2254('0x69')](_0x3cefbe);}_0xa159a4[_0x1ac8ff][_0x2254('0x76')]&&_0x4f77e5['order'](_0x3cefbe,_0xa159a4[_0x1ac8ff][_0x2254('0x76')]==='DESC'?![]:!![]);_0x4f77e5[_0x2254('0x72')](_0x3cefbe,_0xa159a4[_0x1ac8ff][_0x2254('0x77')]||_0x3cefbe);}if(_0xde4e7['joins']){_0xde4e7['joins']=JSON[_0x2254('0x78')](_0xde4e7[_0x2254('0x79')]);for(var _0x451520=0x0;_0x451520<_0xde4e7[_0x2254('0x79')]['length'];_0x451520+=0x1){if(_0xde4e7[_0x2254('0x79')][_0x451520][_0x2254('0x30')]&&_[_0x2254('0x65')](_0x5999c8,_0xde4e7[_0x2254('0x79')][_0x451520]['type'])&&_0xde4e7[_0x2254('0x79')][_0x451520][_0x2254('0x7a')]&&_0xde4e7['joins'][_0x451520][_0x2254('0x7b')]&&_0xde4e7['joins'][_0x451520][_0x2254('0x7c')]){_0x4f77e5[_0xde4e7['joins'][_0x451520]['type']](_0xde4e7['joins'][_0x451520][_0x2254('0x7b')],null,util['format'](_0x2254('0x7d'),_0xde4e7[_0x2254('0x7e')],_0xde4e7['joins'][_0x451520][_0x2254('0x7a')],_0xde4e7[_0x2254('0x79')][_0x451520][_0x2254('0x7b')],_0xde4e7[_0x2254('0x79')][_0x451520][_0x2254('0x7c')]));}}}if(_0xde4e7[_0x2254('0x7f')]){_0xde4e7['conditions']=JSON['parse'](_0xde4e7[_0x2254('0x7f')]);_0x4f77e5[_0x2254('0x3e')](_0x423c17(_0xde4e7[_0x2254('0x7f')][_0x2254('0x69')]));}_0x48406e=_0x4f77e5[_0x2254('0x80')]();_0x4f77e5[_0x2254('0x20')](_0x4da493);_0x4f77e5[_0x2254('0x1e')](0x0);logger[_0x2254('0x81')](_0x2254('0x82'),_0x4f77e5[_0x2254('0x83')]());return dbH['sequelize'][_0x2254('0x33')](_0x4f77e5[_0x2254('0x83')](),{'type':dbH['sequelize'][_0x2254('0x84')]['SELECT']});}})[_0x2254('0x25')](respondWithResult(_0x510fe0,null))[_0x2254('0x46')](handleError(_0x510fe0,null));};function runReport(_0x4dfcb4,_0x1c317b,_0x4e699c){var _0x2ad519=_0x1c317b[_0x2254('0x2a')];var _0x30f2c9=0xa;var _0x1f7a48=['join',_0x2254('0x55'),_0x2254('0x56'),_0x2254('0x57')];var _0x3a8d4f={'SUM':'SUM(%s)','COUNT':_0x2254('0x59'),'COUNT DISTINCT':_0x2254('0x5a'),'MAX':'MAX(%s)','MIN':_0x2254('0x5c'),'AVG':_0x2254('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x2254('0x60')};var _0x2f3650={'SEC_TO_TIME':_0x2254('0x61'),'DATE':_0x2254('0x62'),'HOUR':_0x2254('0x63'),'ROUND':_0x2254('0x64'),'UNIX_TIMESTAMP':_0x2254('0x85')};var _0x251d70=function(_0x2c7705){return!_['includes']([_0x2254('0x66'),'IS\x20NOT\x20NULL',_0x2254('0x86'),'IS\x20NOT\x20EMPTY'],_0x2c7705);};var _0x36d121=function(_0x207a09){if(!_0x207a09||!_0x207a09[_0x2254('0x68')]['length']){return'';}for(var _0x8a3656='(',_0x1554f1=0x0;_0x1554f1<_0x207a09[_0x2254('0x68')][_0x2254('0x39')];_0x1554f1+=0x1){_0x1554f1>0x0&&(_0x8a3656+='\x20'+_0x207a09[_0x2254('0x87')]+'\x20');_0x8a3656+=_0x207a09[_0x2254('0x68')][_0x1554f1][_0x2254('0x69')]?_0x36d121(_0x207a09[_0x2254('0x68')][_0x1554f1][_0x2254('0x69')]):_0x207a09[_0x2254('0x68')][_0x1554f1][_0x2254('0x72')]+'\x20'+_0x207a09[_0x2254('0x68')][_0x1554f1][_0x2254('0x6a')]+(_0x251d70(_0x207a09['rules'][_0x1554f1][_0x2254('0x6a')])?'\x20'+_0x207a09['rules'][_0x1554f1][_0x2254('0x88')]:'');}return _0x8a3656+')';};var _0xb98b40={'where':{'id':_0x4dfcb4['id']}},_0x3b1d5c,_0x2c907a,_0x23b78c,_0x2b5dba,_0x30307a;_0xb98b40=_['merge']({},_0xb98b40,_0x4e699c);return db[_0x2254('0x2e')]['find'](_0xb98b40)[_0x2254('0x25')](function(_0x52712d){if(_0x52712d){_0x3b1d5c=_0x52712d;return _0x52712d[_0x2254('0x89')]();}return null;})[_0x2254('0x25')](function(_0x1d0c8f){if(_0x1d0c8f){if(!_0x1d0c8f['length']){throw new db[(_0x2254('0x6b'))][(_0x2254('0x8a'))](_0x2254('0x6c'),0x193);}_0x2c907a=_0x1d0c8f;return db[_0x2254('0x6d')][_0x2254('0x44')]({'raw':!![]});}return null;})[_0x2254('0x25')](function(_0x34185c){if(_0x34185c){_0x23b78c=_[_0x2254('0x6e')](_0x34185c,'id');var _0x5e94b6;var _0x56239e=squel[_0x2254('0x6f')]();_0x56239e['from'](_0x3b1d5c[_0x2254('0x7e')]);for(var _0x3a1365=0x0;_0x3a1365<_0x2c907a[_0x2254('0x39')];_0x3a1365+=0x1){_0x5e94b6=_0x2c907a[_0x3a1365][_0x2254('0x71')]?_0x23b78c[_0x2c907a[_0x3a1365][_0x2254('0x71')]][_0x2254('0x8b')]:_0x2c907a[_0x3a1365][_0x2254('0x72')];_0x5e94b6=_0x2c907a[_0x3a1365]['function']?_[_0x2254('0x73')](_0x3a8d4f[_0x2c907a[_0x3a1365][_0x2254('0x74')]],'%s',_0x5e94b6):_0x5e94b6;_0x5e94b6=_0x2c907a[_0x3a1365][_0x2254('0x8c')]?_['replace'](_0x2f3650[_0x2c907a[_0x3a1365][_0x2254('0x8c')]],'%s',_0x5e94b6):_0x5e94b6;if(_0x2c907a[_0x3a1365][_0x2254('0x75')]){_0x56239e[_0x2254('0x69')](_0x5e94b6);}_0x2c907a[_0x3a1365][_0x2254('0x76')]&&_0x56239e[_0x2254('0x3c')](_0x5e94b6,_0x2c907a[_0x3a1365][_0x2254('0x76')]===_0x2254('0x8d')?![]:!![]);_0x56239e[_0x2254('0x72')](_0x5e94b6,_0x2c907a[_0x3a1365][_0x2254('0x77')]||_0x5e94b6);}if(_0x3b1d5c['joins']){_0x3b1d5c[_0x2254('0x79')]=JSON[_0x2254('0x78')](_0x3b1d5c['joins']);for(var _0x4cec5b=0x0;_0x4cec5b<_0x3b1d5c[_0x2254('0x79')]['length'];_0x4cec5b+=0x1){if(_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x30')]&&_[_0x2254('0x65')](_0x1f7a48,_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x30')])&&_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x7a')]&&_0x3b1d5c[_0x2254('0x79')][_0x4cec5b]['foreignTable']&&_0x3b1d5c['joins'][_0x4cec5b][_0x2254('0x7c')]){_0x56239e[_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x30')]](_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3b1d5c[_0x2254('0x7e')],_0x3b1d5c['joins'][_0x4cec5b][_0x2254('0x7a')],_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x7b')],_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x7c')]));}}}if(_0x3b1d5c[_0x2254('0x7f')]){_0x3b1d5c[_0x2254('0x7f')]=JSON['parse'](_0x3b1d5c[_0x2254('0x7f')]);_0x56239e[_0x2254('0x3e')](_0x36d121(_0x3b1d5c['conditions'][_0x2254('0x69')]));}_0x30307a=_0x56239e[_0x2254('0x80')]();_0x56239e[_0x2254('0x20')](_0x30f2c9);_0x56239e[_0x2254('0x1e')](0x0);return;}})[_0x2254('0x25')](function(){if(_0x1c317b[_0x2254('0x8e')]===_0x2254('0x8f')){return null;}var _0x38e2df=_[_0x2254('0x41')](_0x1c317b,{'name':_0x1c317b[_0x2254('0x90')]||_0x1c317b[_0x2254('0x2a')]||_0x3b1d5c['name'],'basename':_0x2ad519,'savename':util[_0x2254('0x8c')](_0x2254('0x91'),_0x1c317b[_0x2254('0x2a')]||_0x3b1d5c[_0x2254('0x2a')],require(_0x2254('0x92'))[_0x2254('0x93')](0x4),_0x1c317b[_0x2254('0x8e')]||'csv'),'reportId':_0x3b1d5c['id'],'reportType':_0x2254('0x94')});return db[_0x2254('0x95')][_0x2254('0x4b')](_0x38e2df,{'raw':!![]});})['then'](function(_0x60f5ac){if(_0x3b1d5c[_0x2254('0x7e')]===_0x2254('0x96')){_0x30307a[_0x2254('0x3e')](_0x3b1d5c[_0x2254('0x7e')]+_0x2254('0x97'),_0x1c317b['startDate'],_0x1c317b[_0x2254('0x98')]);}else{_0x30307a[_0x2254('0x3e')](_0x3b1d5c[_0x2254('0x7e')]+_0x2254('0x99'),_0x1c317b[_0x2254('0x9a')],_0x1c317b['endDate']);}if(_0x60f5ac){logger['info'](_0x2254('0x9b'),_0x30307a['toString']());require(_0x2254('0x9c'))[_0x2254('0x9d')](path[_0x2254('0x54')](__dirname,_0x2254('0x9e'),_0x60f5ac[_0x2254('0x8e')]),[_0x60f5ac['id'],_0x30307a[_0x2254('0x83')](),path['join'](__dirname,'../../files/reports',_0x60f5ac[_0x2254('0x9f')]),_0x2ad519]);return _0x60f5ac;}else{var _0x3317d4=squel[_0x2254('0x6f')]();_0x3317d4[_0x2254('0x70')]('('+_0x30307a['toString']()+')',_0x2254('0xa0'));_0x3317d4[_0x2254('0x72')](_0x2254('0xa1'),_0x2254('0x21'));_0x30307a[_0x2254('0x20')](_0x1c317b[_0x2254('0x20')]||_0x30f2c9);_0x30307a[_0x2254('0x1e')](_0x1c317b[_0x2254('0x1e')]||0x0);return dbH[_0x2254('0xa2')]['query'](_0x3317d4[_0x2254('0x83')](),{'type':dbH[_0x2254('0xa2')][_0x2254('0x84')]['SELECT']})[_0x2254('0x25')](function(_0xe38a28){if(!_0xe38a28[_0x2254('0x39')]){_0x2b5dba=0x0;}else{_0x2b5dba=_0xe38a28[0x0]['count']||0x0;}return dbH['sequelize'][_0x2254('0x33')](_0x30307a[_0x2254('0x83')](),{'type':dbH[_0x2254('0xa2')][_0x2254('0x84')][_0x2254('0xa3')]});})[_0x2254('0x25')](function(_0x4011de){return{'rows':_0x4011de||[],'count':_0x2b5dba};});}});}exports[_0x2254('0xa4')]=function(_0x5cb3d1,_0x1d8238){return runReport(_0x5cb3d1[_0x2254('0x47')],_0x5cb3d1[_0x2254('0x33')],_0x5cb3d1[_0x2254('0x42')])[_0x2254('0x25')](respondWithResult(_0x1d8238,null))[_0x2254('0x46')](handleError(_0x1d8238,null));};exports['runReport']=runReport;exports['query']=function(_0x40339d,_0x4b3b96){var _0x59b8af=0xa;var _0x408695=[_0x2254('0x54'),_0x2254('0x55'),_0x2254('0x56'),'cross_join'];var _0x596eae={'SUM':_0x2254('0x58'),'COUNT':_0x2254('0x59'),'COUNT DISTINCT':_0x2254('0x5a'),'MAX':'MAX(%s)','MIN':_0x2254('0x5c'),'AVG':_0x2254('0x5d'),'GROUP_CONCAT':_0x2254('0x5e'),'GROUP_CONCAT ASC':_0x2254('0x5f'),'GROUP_CONCAT DESC':_0x2254('0x60')};var _0x739a29={'SEC_TO_TIME':_0x2254('0x61'),'DATE':'DATE(%s)','HOUR':_0x2254('0x63'),'ROUND':_0x2254('0x64'),'UNIX_TIMESTAMP':_0x2254('0x85')};var _0x243466=function(_0x1b8587){return!_[_0x2254('0x65')]([_0x2254('0x66'),_0x2254('0xa5'),_0x2254('0x86'),'IS\x20NOT\x20EMPTY'],_0x1b8587);};var _0xbec5d0=function(_0x18f841){if(!_0x18f841||!_0x18f841[_0x2254('0x68')][_0x2254('0x39')]){return'';}for(var _0x275b56='(',_0x315add=0x0;_0x315add<_0x18f841['rules']['length'];_0x315add+=0x1){_0x315add>0x0&&(_0x275b56+='\x20'+_0x18f841[_0x2254('0x87')]+'\x20');_0x275b56+=_0x18f841['rules'][_0x315add][_0x2254('0x69')]?_0xbec5d0(_0x18f841[_0x2254('0x68')][_0x315add][_0x2254('0x69')]):_0x18f841[_0x2254('0x68')][_0x315add]['field']+'\x20'+_0x18f841[_0x2254('0x68')][_0x315add][_0x2254('0x6a')]+(_0x243466(_0x18f841[_0x2254('0x68')][_0x315add]['condition'])?'\x20'+_0x18f841['rules'][_0x315add][_0x2254('0x88')]:'');}return _0x275b56+')';};var _0x51b02a={'where':{'id':_0x40339d[_0x2254('0x47')]['id']}},_0x3e7642,_0xe1abb6,_0x1a44d0,_0x4af6a7,_0x539aba;_0x51b02a=_[_0x2254('0x41')]({},_0x51b02a,_0x40339d[_0x2254('0x42')]);return db[_0x2254('0x2e')][_0x2254('0x4a')](_0x51b02a)['then'](function(_0x34e28b){if(_0x34e28b){_0x3e7642=_0x34e28b;return _0x34e28b[_0x2254('0x89')]();}return null;})[_0x2254('0x25')](function(_0x5d373){if(_0x5d373){if(!_0x5d373[_0x2254('0x39')]){throw new db[(_0x2254('0x6b'))]['ValidationErrorItem'](_0x2254('0x6c'),0x193);}_0xe1abb6=_0x5d373;return db[_0x2254('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x2254('0x25')](function(_0x56a7ce){if(_0x56a7ce){_0x1a44d0=_[_0x2254('0x6e')](_0x56a7ce,'id');var _0x34bf19;var _0x4965c7=squel[_0x2254('0x6f')]();_0x4965c7[_0x2254('0x70')](_0x3e7642[_0x2254('0x7e')]);for(var _0x45541b=0x0;_0x45541b<_0xe1abb6[_0x2254('0x39')];_0x45541b+=0x1){_0x34bf19=_0xe1abb6[_0x45541b][_0x2254('0x71')]?_0x1a44d0[_0xe1abb6[_0x45541b][_0x2254('0x71')]][_0x2254('0x8b')]:_0xe1abb6[_0x45541b][_0x2254('0x72')];_0x34bf19=_0xe1abb6[_0x45541b][_0x2254('0x74')]?_[_0x2254('0x73')](_0x596eae[_0xe1abb6[_0x45541b][_0x2254('0x74')]],'%s',_0x34bf19):_0x34bf19;_0x34bf19=_0xe1abb6[_0x45541b][_0x2254('0x8c')]?_[_0x2254('0x73')](_0x739a29[_0xe1abb6[_0x45541b]['format']],'%s',_0x34bf19):_0x34bf19;if(_0xe1abb6[_0x45541b][_0x2254('0x75')]){_0x4965c7[_0x2254('0x69')](_0x34bf19);}_0xe1abb6[_0x45541b]['orderBy']&&_0x4965c7['order'](_0x34bf19,_0xe1abb6[_0x45541b][_0x2254('0x76')]===_0x2254('0x8d')?![]:!![]);_0x4965c7[_0x2254('0x72')](_0x34bf19,_0xe1abb6[_0x45541b][_0x2254('0x77')]||_0x34bf19);}if(_0x3e7642['joins']){_0x3e7642[_0x2254('0x79')]=JSON['parse'](_0x3e7642['joins']);for(var _0x40fec0=0x0;_0x40fec0<_0x3e7642[_0x2254('0x79')][_0x2254('0x39')];_0x40fec0+=0x1){if(_0x3e7642[_0x2254('0x79')][_0x40fec0]['type']&&_[_0x2254('0x65')](_0x408695,_0x3e7642['joins'][_0x40fec0][_0x2254('0x30')])&&_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7a')]&&_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7b')]&&_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7c')]){_0x4965c7[_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x30')]](_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7b')],null,util['format'](_0x2254('0x7d'),_0x3e7642[_0x2254('0x7e')],_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7a')],_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7b')],_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7c')]));}}}if(_0x3e7642['conditions']){_0x3e7642[_0x2254('0x7f')]=JSON[_0x2254('0x78')](_0x3e7642[_0x2254('0x7f')]);_0x4965c7[_0x2254('0x3e')](_0xbec5d0(_0x3e7642[_0x2254('0x7f')]['group']));}_0x539aba=_0x4965c7[_0x2254('0x80')]();_0x4965c7[_0x2254('0x20')](_0x59b8af);_0x4965c7['offset'](0x0);logger[_0x2254('0x81')](_0x2254('0x82'),_0x4965c7[_0x2254('0x83')]());return dbH['sequelize'][_0x2254('0x33')](_0x4965c7[_0x2254('0x83')](),{'type':dbH['sequelize'][_0x2254('0x84')][_0x2254('0xa3')]});}})[_0x2254('0x25')](function(){return{'sql':_0x539aba[_0x2254('0x83')]()};})['then'](respondWithResult(_0x4b3b96,null))[_0x2254('0x46')](handleError(_0x4b3b96,null));}; \ No newline at end of file +var _0x5fc3=['QueryTypes','right_join','HOUR(%s)','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','dbH','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','DefaultReports','destroy','error','stack','name','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','groupBy','orderBy','order','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','format','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','sequelize','toString','SELECT','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','getFields','ValidationErrorItem','fullPath','%s-%s.%s','generate','output','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)'];(function(_0x25acfc,_0x4ca8d3){var _0x1285be=function(_0x558e77){while(--_0x558e77){_0x25acfc['push'](_0x25acfc['shift']());}};_0x1285be(++_0x4ca8d3);}(_0x5fc3,0xa8));var _0x35fc=function(_0x191154,_0x56f74c){_0x191154=_0x191154-0x0;var _0x3dcd73=_0x5fc3[_0x191154];return _0x3dcd73;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x35fc('0x17')];function respondWithStatusCode(_0x5d462a,_0x397738){_0x397738=_0x397738||0xcc;return function(_0x22055e){if(_0x22055e){return _0x5d462a[_0x35fc('0x18')](_0x397738);}return _0x5d462a[_0x35fc('0x19')](_0x397738)[_0x35fc('0x1a')]();};}function respondWithResult(_0x5cfe94,_0x59507a){_0x59507a=_0x59507a||0xc8;return function(_0x5eac0f){if(_0x5eac0f){return _0x5cfe94['status'](_0x59507a)[_0x35fc('0x1b')](_0x5eac0f);}};}function respondWithFilteredResult(_0x229d56,_0x53b898){return function(_0x154958){if(_0x154958){var _0x227a49=typeof _0x53b898[_0x35fc('0x1c')]==='undefined'&&typeof _0x53b898[_0x35fc('0x1d')]===_0x35fc('0x1e');var _0x553677=_0x154958[_0x35fc('0x1f')];var _0x363e47=_0x227a49?0x0:_0x53b898[_0x35fc('0x1c')];var _0x5f56c6=_0x227a49?_0x154958[_0x35fc('0x1f')]:_0x53b898[_0x35fc('0x1c')]+_0x53b898[_0x35fc('0x1d')];var _0x488234;if(_0x5f56c6>=_0x553677){_0x5f56c6=_0x553677;_0x488234=0xc8;}else{_0x488234=0xce;}_0x229d56[_0x35fc('0x19')](_0x488234);return _0x229d56[_0x35fc('0x20')](_0x35fc('0x21'),_0x363e47+'-'+_0x5f56c6+'/'+_0x553677)[_0x35fc('0x1b')](_0x154958);}return null;};}function patchUpdates(_0x20ffde){return function(_0x21f1a9){try{jsonpatch[_0x35fc('0x22')](_0x21f1a9,_0x20ffde,!![]);}catch(_0x3b05b0){return BPromise[_0x35fc('0x23')](_0x3b05b0);}return _0x21f1a9[_0x35fc('0x24')]();};}function saveUpdates(_0x5bd2b8,_0x323aee){return function(_0xd5399f){if(_0xd5399f){return _0xd5399f[_0x35fc('0x25')](_0x5bd2b8)[_0x35fc('0x26')](function(_0x3b4743){return _0x3b4743;});}return null;};}function removeEntity(_0x55e9e7,_0x33f5e8){return function(_0x4c587a){if(_0x4c587a){return _0x4c587a['destroy']()[_0x35fc('0x26')](function(){var _0x5a93df=_0x4c587a[_0x35fc('0x27')]({'plain':!![]});var _0x51cfec=_0x35fc('0x28');return db['UserProfileResource'][_0x35fc('0x29')]({'where':{'type':_0x51cfec,'resourceId':_0x5a93df['id']}})[_0x35fc('0x26')](function(){return _0x4c587a;});})['then'](function(){_0x55e9e7['status'](0xcc)[_0x35fc('0x1a')]();});}};}function handleEntityNotFound(_0x58edb6,_0x274208){return function(_0x1a5d92){if(!_0x1a5d92){_0x58edb6['sendStatus'](0x194);}return _0x1a5d92;};}function handleError(_0x26b7cb,_0x645eac){_0x645eac=_0x645eac||0x1f4;return function(_0x383837){logger[_0x35fc('0x2a')](_0x383837[_0x35fc('0x2b')]);if(_0x383837[_0x35fc('0x2c')]){delete _0x383837[_0x35fc('0x2c')];}_0x26b7cb[_0x35fc('0x19')](_0x645eac)['send'](_0x383837);};}exports[_0x35fc('0x2d')]=function(_0x220931,_0x22af18){var _0x52acc5={},_0xe79f52={},_0x16f067={'count':0x0,'rows':[]};var _0x3822a8=_[_0x35fc('0x2e')](db[_0x35fc('0x2f')][_0x35fc('0x30')],function(_0x222ddb){return{'name':_0x222ddb[_0x35fc('0x31')],'type':_0x222ddb[_0x35fc('0x32')][_0x35fc('0x33')]};});_0xe79f52['model']=_['map'](_0x3822a8,_0x35fc('0x2c'));_0xe79f52['query']=_[_0x35fc('0x34')](_0x220931[_0x35fc('0x35')]);_0xe79f52[_0x35fc('0x36')]=_[_0x35fc('0x37')](_0xe79f52[_0x35fc('0x38')],_0xe79f52[_0x35fc('0x35')]);_0x52acc5['attributes']=_[_0x35fc('0x37')](_0xe79f52[_0x35fc('0x38')],qs[_0x35fc('0x39')](_0x220931[_0x35fc('0x35')][_0x35fc('0x39')]));_0x52acc5[_0x35fc('0x3a')]=_0x52acc5['attributes'][_0x35fc('0x3b')]?_0x52acc5[_0x35fc('0x3a')]:_0xe79f52[_0x35fc('0x38')];if(!_0x220931['query'][_0x35fc('0x3c')]('nolimit')){_0x52acc5[_0x35fc('0x1d')]=qs[_0x35fc('0x1d')](_0x220931[_0x35fc('0x35')][_0x35fc('0x1d')]);_0x52acc5['offset']=qs['offset'](_0x220931['query'][_0x35fc('0x1c')]);}_0x52acc5['order']=qs[_0x35fc('0x3d')](_0x220931['query'][_0x35fc('0x3d')]);_0x52acc5[_0x35fc('0x3e')]=qs[_0x35fc('0x36')](_[_0x35fc('0x3f')](_0x220931[_0x35fc('0x35')],_0xe79f52[_0x35fc('0x36')]),_0x3822a8);if(_0x220931[_0x35fc('0x35')]['filter']){_0x52acc5[_0x35fc('0x3e')]=_[_0x35fc('0x40')](_0x52acc5['where'],{'$or':_[_0x35fc('0x2e')](_0x3822a8,function(_0x1ccc41){if(_0x1ccc41[_0x35fc('0x32')]!==_0x35fc('0x41')){var _0x813866={};_0x813866[_0x1ccc41[_0x35fc('0x2c')]]={'$like':'%'+_0x220931['query'][_0x35fc('0x42')]+'%'};return _0x813866;}})});}_0x52acc5=_[_0x35fc('0x40')]({},_0x52acc5,_0x220931[_0x35fc('0x43')]);var _0x52543b={'where':_0x52acc5[_0x35fc('0x3e')]};return db[_0x35fc('0x2f')]['count'](_0x52543b)[_0x35fc('0x26')](function(_0x280af1){_0x16f067[_0x35fc('0x1f')]=_0x280af1;if(_0x220931[_0x35fc('0x35')][_0x35fc('0x44')]){_0x52acc5[_0x35fc('0x45')]=[{'all':!![]}];}return db[_0x35fc('0x2f')][_0x35fc('0x46')](_0x52acc5);})['then'](function(_0x596e83){_0x16f067[_0x35fc('0x47')]=_0x596e83;return _0x16f067;})[_0x35fc('0x26')](respondWithFilteredResult(_0x22af18,_0x52acc5))['catch'](handleError(_0x22af18,null));};exports['show']=function(_0x4ff202,_0x79677d){var _0x10f98b={'raw':!![],'where':{'id':_0x4ff202[_0x35fc('0x48')]['id']}},_0x4e56ed={};_0x4e56ed[_0x35fc('0x38')]=_[_0x35fc('0x34')](db[_0x35fc('0x2f')]['rawAttributes']);_0x4e56ed['query']=_['keys'](_0x4ff202['query']);_0x4e56ed['filters']=_[_0x35fc('0x37')](_0x4e56ed[_0x35fc('0x38')],_0x4e56ed['query']);_0x10f98b[_0x35fc('0x3a')]=_['intersection'](_0x4e56ed[_0x35fc('0x38')],qs[_0x35fc('0x39')](_0x4ff202[_0x35fc('0x35')][_0x35fc('0x39')]));_0x10f98b[_0x35fc('0x3a')]=_0x10f98b['attributes'][_0x35fc('0x3b')]?_0x10f98b[_0x35fc('0x3a')]:_0x4e56ed['model'];if(_0x4ff202[_0x35fc('0x35')][_0x35fc('0x44')]){_0x10f98b[_0x35fc('0x45')]=[{'all':!![]}];}_0x10f98b=_[_0x35fc('0x40')]({},_0x10f98b,_0x4ff202['options']);return db[_0x35fc('0x2f')]['find'](_0x10f98b)['then'](handleEntityNotFound(_0x79677d,null))[_0x35fc('0x26')](respondWithResult(_0x79677d,null))[_0x35fc('0x49')](handleError(_0x79677d,null));};exports[_0x35fc('0x4a')]=function(_0xca8aef,_0xf2ca20){return db[_0x35fc('0x2f')][_0x35fc('0x4a')](_0xca8aef[_0x35fc('0x4b')],{})['then'](function(_0x3e2961){var _0x91d7c0=_0xca8aef[_0x35fc('0x4c')][_0x35fc('0x27')]({'plain':!![]});if(!_0x91d7c0)throw new Error(_0x35fc('0x4d'));if(_0x91d7c0[_0x35fc('0x4e')]===_0x35fc('0x4c')){var _0x347a4a=_0x3e2961[_0x35fc('0x27')]({'plain':!![]});var _0xe6eb6a=_0x35fc('0x4f');return db[_0x35fc('0x50')][_0x35fc('0x51')]({'where':{'name':_0xe6eb6a,'userProfileId':_0x91d7c0[_0x35fc('0x52')]},'raw':!![]})['then'](function(_0x553ed6){if(_0x553ed6&&_0x553ed6[_0x35fc('0x53')]===0x0){return db[_0x35fc('0x54')][_0x35fc('0x4a')]({'name':_0x347a4a[_0x35fc('0x2c')],'resourceId':_0x347a4a['id'],'type':_0x35fc('0x28'),'sectionId':_0x553ed6['id']},{})[_0x35fc('0x26')](function(){return _0x3e2961;});}else{return _0x3e2961;}})['catch'](function(_0x4f024c){logger[_0x35fc('0x2a')](_0x35fc('0x55'),_0x4f024c);throw _0x4f024c;});}return _0x3e2961;})[_0x35fc('0x26')](respondWithResult(_0xf2ca20,0xc9))[_0x35fc('0x49')](handleError(_0xf2ca20,null));};exports['update']=function(_0x467980,_0x13281f){if(_0x467980['body']['id']){delete _0x467980[_0x35fc('0x4b')]['id'];}return db[_0x35fc('0x2f')]['find']({'where':{'id':_0x467980[_0x35fc('0x48')]['id']}})[_0x35fc('0x26')](handleEntityNotFound(_0x13281f,null))[_0x35fc('0x26')](saveUpdates(_0x467980[_0x35fc('0x4b')],null))['then'](respondWithResult(_0x13281f,null))['catch'](handleError(_0x13281f,null));};exports['destroy']=function(_0x240338,_0x2ea8d6){return db['AnalyticDefaultReport'][_0x35fc('0x51')]({'where':{'id':_0x240338[_0x35fc('0x48')]['id']}})[_0x35fc('0x26')](handleEntityNotFound(_0x2ea8d6,null))[_0x35fc('0x26')](removeEntity(_0x2ea8d6,null))[_0x35fc('0x49')](handleError(_0x2ea8d6,null));};exports['preview']=function(_0x2d9d45,_0x757aa6){var _0x39d470=0xa;var _0x509e77=[_0x35fc('0x56'),_0x35fc('0x57'),'right_join',_0x35fc('0x58')];var _0x164c7b={'SUM':_0x35fc('0x59'),'COUNT':_0x35fc('0x5a'),'COUNT DISTINCT':_0x35fc('0x5b'),'MAX':_0x35fc('0x5c'),'MIN':_0x35fc('0x5d'),'AVG':_0x35fc('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':_0x35fc('0x60')};var _0x303927={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x35fc('0x61'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x23b54f=function(_0xb1c68a){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xb1c68a);};var _0x5353ea=function(_0x4faef4){if(!_0x4faef4||!_0x4faef4['rules'][_0x35fc('0x3b')]){return'';}for(var _0x44250b='(',_0xd470e8=0x0;_0xd470e8<_0x4faef4[_0x35fc('0x65')]['length'];_0xd470e8+=0x1){_0xd470e8>0x0&&(_0x44250b+='\x20'+_0x4faef4[_0x35fc('0x66')]+'\x20');_0x44250b+=_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x67')]?_0x5353ea(_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x67')]):_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x68')]+'\x20'+_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x69')]+(_0x23b54f(_0x4faef4['rules'][_0xd470e8][_0x35fc('0x69')])?'\x20'+_0x4faef4['rules'][_0xd470e8][_0x35fc('0x6a')]:'');}return _0x44250b+')';};var _0x9029e3={'where':{'id':_0x2d9d45['params']['id']}},_0x2ac8e1,_0x2bc76c,_0x4bdde7,_0x465c14,_0x4af592;_0x9029e3=_['merge']({},_0x9029e3,_0x2d9d45[_0x35fc('0x43')]);return db['AnalyticDefaultReport'][_0x35fc('0x51')](_0x9029e3)['then'](function(_0x11717){if(_0x11717){_0x2ac8e1=_0x11717;return _0x11717['getFields']();}return null;})[_0x35fc('0x26')](function(_0x455b84){if(_0x455b84){if(!_0x455b84[_0x35fc('0x3b')]){throw new db[(_0x35fc('0x6b'))]['ValidationErrorItem'](_0x35fc('0x6c'),0x193);}_0x2bc76c=_0x455b84;return db[_0x35fc('0x6d')][_0x35fc('0x46')]({'raw':!![]});}return null;})['then'](function(_0x3aa7fa){if(_0x3aa7fa){_0x4bdde7=_[_0x35fc('0x6e')](_0x3aa7fa,'id');var _0x37764b;var _0x3c1b56=squel[_0x35fc('0x6f')]();_0x3c1b56[_0x35fc('0x70')](_0x2ac8e1[_0x35fc('0x71')]);for(var _0x4464d5=0x0;_0x4464d5<_0x2bc76c['length'];_0x4464d5+=0x1){_0x37764b=_0x2bc76c[_0x4464d5][_0x35fc('0x72')]?_0x4bdde7[_0x2bc76c[_0x4464d5][_0x35fc('0x72')]][_0x35fc('0x73')]:_0x2bc76c[_0x4464d5]['field'];_0x37764b=_0x2bc76c[_0x4464d5][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0x164c7b[_0x2bc76c[_0x4464d5]['function']],'%s',_0x37764b):_0x37764b;_0x37764b=_0x2bc76c[_0x4464d5]['format']?_[_0x35fc('0x75')](_0x303927[_0x2bc76c[_0x4464d5]['format']],'%s',_0x37764b):_0x37764b;if(_0x2bc76c[_0x4464d5][_0x35fc('0x76')]){_0x3c1b56[_0x35fc('0x67')](_0x37764b);}_0x2bc76c[_0x4464d5][_0x35fc('0x77')]&&_0x3c1b56[_0x35fc('0x78')](_0x37764b,_0x2bc76c[_0x4464d5][_0x35fc('0x77')]===_0x35fc('0x79')?![]:!![]);_0x3c1b56[_0x35fc('0x68')](_0x37764b,_0x2bc76c[_0x4464d5][_0x35fc('0x7a')]||_0x37764b);}if(_0x2ac8e1[_0x35fc('0x7b')]){_0x2ac8e1[_0x35fc('0x7b')]=JSON[_0x35fc('0x7c')](_0x2ac8e1[_0x35fc('0x7b')]);for(var _0x29f2b9=0x0;_0x29f2b9<_0x2ac8e1[_0x35fc('0x7b')][_0x35fc('0x3b')];_0x29f2b9+=0x1){if(_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')]&&_[_0x35fc('0x62')](_0x509e77,_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')])&&_0x2ac8e1['joins'][_0x29f2b9][_0x35fc('0x7d')]&&_0x2ac8e1['joins'][_0x29f2b9][_0x35fc('0x7e')]&&_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7f')]){_0x3c1b56[_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')]](_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7e')],null,util[_0x35fc('0x80')](_0x35fc('0x81'),_0x2ac8e1[_0x35fc('0x71')],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9]['parentKey'],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7e')],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7f')]));}}}if(_0x2ac8e1[_0x35fc('0x82')]){_0x2ac8e1[_0x35fc('0x82')]=JSON['parse'](_0x2ac8e1[_0x35fc('0x82')]);_0x3c1b56[_0x35fc('0x3e')](_0x5353ea(_0x2ac8e1[_0x35fc('0x82')][_0x35fc('0x67')]));}_0x4af592=_0x3c1b56[_0x35fc('0x83')]();_0x3c1b56[_0x35fc('0x1d')](_0x39d470);_0x3c1b56[_0x35fc('0x1c')](0x0);logger[_0x35fc('0x84')](_0x35fc('0x85'),_0x3c1b56['toString']());return dbH[_0x35fc('0x86')]['query'](_0x3c1b56[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')]['QueryTypes'][_0x35fc('0x88')]});}})[_0x35fc('0x26')](respondWithResult(_0x757aa6,null))[_0x35fc('0x49')](handleError(_0x757aa6,null));};function runReport(_0x4274d6,_0x4026cc,_0x1a765f){var _0x42f87e=_0x4026cc[_0x35fc('0x2c')];var _0x25ee61=0xa;var _0x5806bf=['join','left_join','right_join',_0x35fc('0x58')];var _0x23cf84={'SUM':_0x35fc('0x59'),'COUNT':_0x35fc('0x5a'),'COUNT DISTINCT':_0x35fc('0x5b'),'MAX':'MAX(%s)','MIN':_0x35fc('0x5d'),'AVG':_0x35fc('0x5e'),'GROUP_CONCAT':_0x35fc('0x89'),'GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x15e936={'SEC_TO_TIME':_0x35fc('0x8a'),'DATE':_0x35fc('0x61'),'HOUR':'HOUR(%s)','ROUND':_0x35fc('0x8b'),'UNIX_TIMESTAMP':_0x35fc('0x8c')};var _0x319033=function(_0x9fe765){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),_0x35fc('0x8d'),'IS\x20NOT\x20EMPTY'],_0x9fe765);};var _0x2faff7=function(_0xa2c5f8){if(!_0xa2c5f8||!_0xa2c5f8[_0x35fc('0x65')][_0x35fc('0x3b')]){return'';}for(var _0x221c5b='(',_0x1fcd36=0x0;_0x1fcd36<_0xa2c5f8['rules'][_0x35fc('0x3b')];_0x1fcd36+=0x1){_0x1fcd36>0x0&&(_0x221c5b+='\x20'+_0xa2c5f8['operator']+'\x20');_0x221c5b+=_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x67')]?_0x2faff7(_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x67')]):_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x68')]+'\x20'+_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x69')]+(_0x319033(_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x69')])?'\x20'+_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x6a')]:'');}return _0x221c5b+')';};var _0x5abdf9={'where':{'id':_0x4274d6['id']}},_0x5512f6,_0x487cb5,_0x23b261,_0x4c742c,_0x2fae26;_0x5abdf9=_[_0x35fc('0x40')]({},_0x5abdf9,_0x1a765f);return db[_0x35fc('0x2f')][_0x35fc('0x51')](_0x5abdf9)['then'](function(_0x28e80d){if(_0x28e80d){_0x5512f6=_0x28e80d;return _0x28e80d[_0x35fc('0x8e')]();}return null;})[_0x35fc('0x26')](function(_0x47c507){if(_0x47c507){if(!_0x47c507[_0x35fc('0x3b')]){throw new db[(_0x35fc('0x6b'))][(_0x35fc('0x8f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x487cb5=_0x47c507;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x35fc('0x26')](function(_0x2edb1b){if(_0x2edb1b){_0x23b261=_[_0x35fc('0x6e')](_0x2edb1b,'id');var _0x3858a9;var _0x4859be=squel[_0x35fc('0x6f')]();_0x4859be[_0x35fc('0x70')](_0x5512f6['table']);for(var _0x5849a0=0x0;_0x5849a0<_0x487cb5[_0x35fc('0x3b')];_0x5849a0+=0x1){_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x72')]?_0x23b261[_0x487cb5[_0x5849a0][_0x35fc('0x72')]]['metric']:_0x487cb5[_0x5849a0]['field'];_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0x23cf84[_0x487cb5[_0x5849a0]['function']],'%s',_0x3858a9):_0x3858a9;_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x80')]?_[_0x35fc('0x75')](_0x15e936[_0x487cb5[_0x5849a0][_0x35fc('0x80')]],'%s',_0x3858a9):_0x3858a9;if(_0x487cb5[_0x5849a0]['groupBy']){_0x4859be[_0x35fc('0x67')](_0x3858a9);}_0x487cb5[_0x5849a0][_0x35fc('0x77')]&&_0x4859be[_0x35fc('0x78')](_0x3858a9,_0x487cb5[_0x5849a0][_0x35fc('0x77')]==='DESC'?![]:!![]);_0x4859be[_0x35fc('0x68')](_0x3858a9,_0x487cb5[_0x5849a0][_0x35fc('0x7a')]||_0x3858a9);}if(_0x5512f6[_0x35fc('0x7b')]){_0x5512f6['joins']=JSON[_0x35fc('0x7c')](_0x5512f6[_0x35fc('0x7b')]);for(var _0x425f72=0x0;_0x425f72<_0x5512f6['joins'][_0x35fc('0x3b')];_0x425f72+=0x1){if(_0x5512f6[_0x35fc('0x7b')][_0x425f72]['type']&&_[_0x35fc('0x62')](_0x5806bf,_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x32')])&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7d')]&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')]&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7f')]){_0x4859be[_0x5512f6['joins'][_0x425f72][_0x35fc('0x32')]](_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')],null,util[_0x35fc('0x80')]('%s.%s\x20=\x20%s.%s',_0x5512f6[_0x35fc('0x71')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7d')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7f')]));}}}if(_0x5512f6[_0x35fc('0x82')]){_0x5512f6['conditions']=JSON['parse'](_0x5512f6[_0x35fc('0x82')]);_0x4859be[_0x35fc('0x3e')](_0x2faff7(_0x5512f6[_0x35fc('0x82')]['group']));}_0x2fae26=_0x4859be[_0x35fc('0x83')]();_0x4859be[_0x35fc('0x1d')](_0x25ee61);_0x4859be[_0x35fc('0x1c')](0x0);return;}})[_0x35fc('0x26')](function(){if(_0x4026cc['output']==='web'){return null;}var _0x379650=_['merge'](_0x4026cc,{'name':_0x4026cc[_0x35fc('0x90')]||_0x4026cc[_0x35fc('0x2c')]||_0x5512f6['name'],'basename':_0x42f87e,'savename':util['format'](_0x35fc('0x91'),_0x4026cc[_0x35fc('0x2c')]||_0x5512f6[_0x35fc('0x2c')],require('randomstring')[_0x35fc('0x92')](0x4),_0x4026cc[_0x35fc('0x93')]||_0x35fc('0x94')),'reportId':_0x5512f6['id'],'reportType':'default'});return db[_0x35fc('0x95')][_0x35fc('0x4a')](_0x379650,{'raw':!![]});})[_0x35fc('0x26')](function(_0x328e90){if(_0x5512f6['table']===_0x35fc('0x96')){_0x2fae26[_0x35fc('0x3e')](_0x5512f6[_0x35fc('0x71')]+_0x35fc('0x97'),_0x4026cc[_0x35fc('0x98')],_0x4026cc[_0x35fc('0x99')]);}else{_0x2fae26['where'](_0x5512f6[_0x35fc('0x71')]+_0x35fc('0x9a'),_0x4026cc['startDate'],_0x4026cc[_0x35fc('0x99')]);}if(_0x328e90){logger[_0x35fc('0x9b')]('Run\x20Query:',_0x2fae26[_0x35fc('0x87')]());require(_0x35fc('0x9c'))[_0x35fc('0x9d')](path[_0x35fc('0x56')](__dirname,_0x35fc('0x9e'),_0x328e90['output']),[_0x328e90['id'],_0x2fae26[_0x35fc('0x87')](),path[_0x35fc('0x56')](__dirname,_0x35fc('0x9f'),_0x328e90['savename']),_0x42f87e]);return _0x328e90;}else{var _0x1224cd=squel['select']();_0x1224cd['from']('('+_0x2fae26[_0x35fc('0x87')]()+')',_0x35fc('0xa0'));_0x1224cd[_0x35fc('0x68')](_0x35fc('0xa1'),_0x35fc('0x1f'));_0x2fae26['limit'](_0x4026cc[_0x35fc('0x1d')]||_0x25ee61);_0x2fae26[_0x35fc('0x1c')](_0x4026cc[_0x35fc('0x1c')]||0x0);return dbH['sequelize'][_0x35fc('0x35')](_0x1224cd[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')][_0x35fc('0xa2')][_0x35fc('0x88')]})['then'](function(_0x1a2d73){if(!_0x1a2d73[_0x35fc('0x3b')]){_0x4c742c=0x0;}else{_0x4c742c=_0x1a2d73[0x0]['count']||0x0;}return dbH['sequelize'][_0x35fc('0x35')](_0x2fae26[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')][_0x35fc('0xa2')][_0x35fc('0x88')]});})[_0x35fc('0x26')](function(_0x8c80ca){return{'rows':_0x8c80ca||[],'count':_0x4c742c};});}});}exports['run']=function(_0x5dc286,_0x146ce1){return runReport(_0x5dc286[_0x35fc('0x48')],_0x5dc286[_0x35fc('0x35')],_0x5dc286[_0x35fc('0x43')])[_0x35fc('0x26')](respondWithResult(_0x146ce1,null))['catch'](handleError(_0x146ce1,null));};exports['runReport']=runReport;exports[_0x35fc('0x35')]=function(_0x2451f2,_0x3fff79){var _0x1c6ce9=0xa;var _0x4b2079=['join',_0x35fc('0x57'),_0x35fc('0xa3'),_0x35fc('0x58')];var _0xd46d64={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x35fc('0x5b'),'MAX':_0x35fc('0x5c'),'MIN':'MIN(%s)','AVG':_0x35fc('0x5e'),'GROUP_CONCAT':_0x35fc('0x89'),'GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':_0x35fc('0x60')};var _0x274337={'SEC_TO_TIME':_0x35fc('0x8a'),'DATE':_0x35fc('0x61'),'HOUR':_0x35fc('0xa4'),'ROUND':_0x35fc('0x8b'),'UNIX_TIMESTAMP':_0x35fc('0x8c')};var _0x19ae76=function(_0x366a3b){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),_0x35fc('0x8d'),'IS\x20NOT\x20EMPTY'],_0x366a3b);};var _0x345026=function(_0x553f7d){if(!_0x553f7d||!_0x553f7d[_0x35fc('0x65')]['length']){return'';}for(var _0x5aa072='(',_0x3c96ef=0x0;_0x3c96ef<_0x553f7d[_0x35fc('0x65')][_0x35fc('0x3b')];_0x3c96ef+=0x1){_0x3c96ef>0x0&&(_0x5aa072+='\x20'+_0x553f7d['operator']+'\x20');_0x5aa072+=_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x67')]?_0x345026(_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x67')]):_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x68')]+'\x20'+_0x553f7d['rules'][_0x3c96ef]['condition']+(_0x19ae76(_0x553f7d[_0x35fc('0x65')][_0x3c96ef]['condition'])?'\x20'+_0x553f7d['rules'][_0x3c96ef][_0x35fc('0x6a')]:'');}return _0x5aa072+')';};var _0x48b826={'where':{'id':_0x2451f2[_0x35fc('0x48')]['id']}},_0x556f9a,_0x5ae83f,_0x450769,_0x5d461c,_0x355154;_0x48b826=_[_0x35fc('0x40')]({},_0x48b826,_0x2451f2[_0x35fc('0x43')]);return db[_0x35fc('0x2f')][_0x35fc('0x51')](_0x48b826)['then'](function(_0x522ff2){if(_0x522ff2){_0x556f9a=_0x522ff2;return _0x522ff2[_0x35fc('0x8e')]();}return null;})['then'](function(_0x233c94){if(_0x233c94){if(!_0x233c94[_0x35fc('0x3b')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5ae83f=_0x233c94;return db[_0x35fc('0x6d')][_0x35fc('0x46')]({'raw':!![]});}return null;})[_0x35fc('0x26')](function(_0x135e18){if(_0x135e18){_0x450769=_[_0x35fc('0x6e')](_0x135e18,'id');var _0x28525f;var _0x9116b1=squel[_0x35fc('0x6f')]();_0x9116b1['from'](_0x556f9a['table']);for(var _0x5cefdb=0x0;_0x5cefdb<_0x5ae83f['length'];_0x5cefdb+=0x1){_0x28525f=_0x5ae83f[_0x5cefdb][_0x35fc('0x72')]?_0x450769[_0x5ae83f[_0x5cefdb]['MetricId']][_0x35fc('0x73')]:_0x5ae83f[_0x5cefdb]['field'];_0x28525f=_0x5ae83f[_0x5cefdb][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0xd46d64[_0x5ae83f[_0x5cefdb]['function']],'%s',_0x28525f):_0x28525f;_0x28525f=_0x5ae83f[_0x5cefdb]['format']?_[_0x35fc('0x75')](_0x274337[_0x5ae83f[_0x5cefdb][_0x35fc('0x80')]],'%s',_0x28525f):_0x28525f;if(_0x5ae83f[_0x5cefdb][_0x35fc('0x76')]){_0x9116b1[_0x35fc('0x67')](_0x28525f);}_0x5ae83f[_0x5cefdb][_0x35fc('0x77')]&&_0x9116b1['order'](_0x28525f,_0x5ae83f[_0x5cefdb]['orderBy']===_0x35fc('0x79')?![]:!![]);_0x9116b1['field'](_0x28525f,_0x5ae83f[_0x5cefdb][_0x35fc('0x7a')]||_0x28525f);}if(_0x556f9a['joins']){_0x556f9a[_0x35fc('0x7b')]=JSON[_0x35fc('0x7c')](_0x556f9a[_0x35fc('0x7b')]);for(var _0x10e30e=0x0;_0x10e30e<_0x556f9a['joins'][_0x35fc('0x3b')];_0x10e30e+=0x1){if(_0x556f9a['joins'][_0x10e30e][_0x35fc('0x32')]&&_['includes'](_0x4b2079,_0x556f9a['joins'][_0x10e30e][_0x35fc('0x32')])&&_0x556f9a['joins'][_0x10e30e][_0x35fc('0x7d')]&&_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')]&&_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7f')]){_0x9116b1[_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x32')]](_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')],null,util['format'](_0x35fc('0x81'),_0x556f9a[_0x35fc('0x71')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7d')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7f')]));}}}if(_0x556f9a['conditions']){_0x556f9a['conditions']=JSON['parse'](_0x556f9a['conditions']);_0x9116b1['where'](_0x345026(_0x556f9a[_0x35fc('0x82')][_0x35fc('0x67')]));}_0x355154=_0x9116b1[_0x35fc('0x83')]();_0x9116b1[_0x35fc('0x1d')](_0x1c6ce9);_0x9116b1[_0x35fc('0x1c')](0x0);logger['debug'](_0x35fc('0x85'),_0x9116b1[_0x35fc('0x87')]());return dbH[_0x35fc('0x86')][_0x35fc('0x35')](_0x9116b1[_0x35fc('0x87')](),{'type':dbH['sequelize'][_0x35fc('0xa2')][_0x35fc('0x88')]});}})[_0x35fc('0x26')](function(){return{'sql':_0x355154['toString']()};})[_0x35fc('0x26')](respondWithResult(_0x3fff79,null))[_0x35fc('0x49')](handleError(_0x3fff79,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 5b11623..bb3bafd 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 _0x2de2=['exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','../../config/logger','moment','bluebird','request-promise','./analyticDefaultReport.attributes'];(function(_0x4565eb,_0x167f79){var _0x67832=function(_0x5322ff){while(--_0x5322ff){_0x4565eb['push'](_0x4565eb['shift']());}};_0x67832(++_0x167f79);}(_0x2de2,0x1c6));var _0x22de=function(_0x3ccd90,_0x2bc696){_0x3ccd90=_0x3ccd90-0x0;var _0x1bca9f=_0x2de2[_0x3ccd90];return _0x1bca9f;};'use strict';var _=require(_0x22de('0x0'));var util=require('util');var logger=require(_0x22de('0x1'))('api');var moment=require(_0x22de('0x2'));var BPromise=require(_0x22de('0x3'));var rp=require(_0x22de('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x22de('0x5'));module[_0x22de('0x6')]=function(_0x39de8b,_0x55755c){return _0x39de8b[_0x22de('0x7')](_0x22de('0x8'),attributes,{'tableName':_0x22de('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x718f=['request-promise','path','rimraf','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','../../config/logger','api','moment'];(function(_0x5f52e4,_0x5a69b3){var _0x25148b=function(_0x461a44){while(--_0x461a44){_0x5f52e4['push'](_0x5f52e4['shift']());}};_0x25148b(++_0x5a69b3);}(_0x718f,0x128));var _0xf718=function(_0x129fa8,_0x3dba2a){_0x129fa8=_0x129fa8-0x0;var _0x546bab=_0x718f[_0x129fa8];return _0x546bab;};'use strict';var _=require(_0xf718('0x0'));var util=require('util');var logger=require(_0xf718('0x1'))(_0xf718('0x2'));var moment=require(_0xf718('0x3'));var BPromise=require('bluebird');var rp=require(_0xf718('0x4'));var fs=require('fs');var path=require(_0xf718('0x5'));var rimraf=require(_0xf718('0x6'));var config=require('../../config/environment');var attributes=require(_0xf718('0x7'));module[_0xf718('0x8')]=function(_0x4d8631,_0x1893bf){return _0x4d8631[_0xf718('0x9')](_0xf718('0xa'),attributes,{'tableName':_0xf718('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 3ea371a..3820e94 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 _0xb332=['error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x2d38f7,_0x38ee45){var _0x2417d6=function(_0x506cf3){while(--_0x506cf3){_0x2d38f7['push'](_0x2d38f7['shift']());}};_0x2417d6(++_0x38ee45);}(_0xb332,0x16a));var _0x2b33=function(_0x3a3758,_0x4dd8cf){_0x3a3758=_0x3a3758-0x0;var _0x1a9234=_0xb332[_0x3a3758];return _0x1a9234;};'use strict';var _=require(_0x2b33('0x0'));var util=require('util');var moment=require(_0x2b33('0x1'));var BPromise=require(_0x2b33('0x2'));var rs=require(_0x2b33('0x3'));var fs=require('fs');var Redis=require(_0x2b33('0x4'));var db=require(_0x2b33('0x5'))['db'];var utils=require(_0x2b33('0x6'));var logger=require('../../config/logger')(_0x2b33('0x7'));var config=require('../../config/environment');var jayson=require(_0x2b33('0x8'));var client=jayson[_0x2b33('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b2217,_0x3482b5,_0x213b7d){return new BPromise(function(_0x5a8372,_0x245062){return client['request'](_0x3b2217,_0x213b7d)['then'](function(_0x97c1f7){logger[_0x2b33('0xa')](_0x2b33('0xb'),_0x3482b5,'request\x20sent');logger[_0x2b33('0xc')](_0x2b33('0xd'),_0x3482b5,_0x2b33('0xe'),JSON[_0x2b33('0xf')](_0x97c1f7));if(_0x97c1f7[_0x2b33('0x10')]){if(_0x97c1f7['error'][_0x2b33('0x11')]===0x1f4){logger[_0x2b33('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3482b5,_0x97c1f7[_0x2b33('0x10')][_0x2b33('0x12')]);return _0x245062(_0x97c1f7[_0x2b33('0x10')][_0x2b33('0x12')]);}logger[_0x2b33('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3482b5,_0x97c1f7[_0x2b33('0x10')][_0x2b33('0x12')]);return _0x5a8372(_0x97c1f7['error'][_0x2b33('0x12')]);}else{logger['info'](_0x2b33('0xb'),_0x3482b5,_0x2b33('0xe'));_0x5a8372(_0x97c1f7[_0x2b33('0x13')]['message']);}})[_0x2b33('0x14')](function(_0x26fbe3){logger['error'](_0x2b33('0xb'),_0x3482b5,_0x26fbe3);_0x245062(_0x26fbe3);});});} \ No newline at end of file +var _0xf02f=['then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','request'];(function(_0x4d9dc7,_0x38ee05){var _0x18780a=function(_0x1ed086){while(--_0x1ed086){_0x4d9dc7['push'](_0x4d9dc7['shift']());}};_0x18780a(++_0x38ee05);}(_0xf02f,0xbc));var _0xff02=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf02f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xff02('0x0'));var util=require(_0xff02('0x1'));var moment=require(_0xff02('0x2'));var BPromise=require(_0xff02('0x3'));var rs=require(_0xff02('0x4'));var fs=require('fs');var Redis=require(_0xff02('0x5'));var db=require(_0xff02('0x6'))['db'];var utils=require(_0xff02('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xff02('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x53df27,_0x7c02dd,_0x55218e){return new BPromise(function(_0x4f24b2,_0x29fad0){return client[_0xff02('0x9')](_0x53df27,_0x55218e)[_0xff02('0xa')](function(_0x586ee2){logger['info'](_0xff02('0xb'),_0x7c02dd,_0xff02('0xc'));logger[_0xff02('0xd')](_0xff02('0xe'),_0x7c02dd,_0xff02('0xc'),JSON[_0xff02('0xf')](_0x586ee2));if(_0x586ee2[_0xff02('0x10')]){if(_0x586ee2[_0xff02('0x10')][_0xff02('0x11')]===0x1f4){logger[_0xff02('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x7c02dd,_0x586ee2[_0xff02('0x10')]['message']);return _0x29fad0(_0x586ee2[_0xff02('0x10')]['message']);}logger[_0xff02('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x7c02dd,_0x586ee2[_0xff02('0x10')][_0xff02('0x12')]);return _0x4f24b2(_0x586ee2[_0xff02('0x10')]['message']);}else{logger[_0xff02('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x7c02dd,_0xff02('0xc'));_0x4f24b2(_0x586ee2[_0xff02('0x14')][_0xff02('0x12')]);}})[_0xff02('0x15')](function(_0x4cbd26){logger[_0xff02('0x10')](_0xff02('0xb'),_0x7c02dd,_0x4cbd26);_0x29fad0(_0x4cbd26);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index e5b8d03..1015d21 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 _0x19b7=['get','isAuthenticated','/:id/preview','/:id/run','run','/:id/query','query','create','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x19b7,0x157));var _0x719b=function(_0x469236,_0x1afbeb){_0x469236=_0x469236-0x0;var _0xa3f585=_0x19b7[_0x469236];return _0xa3f585;};'use strict';var multer=require('multer');var util=require(_0x719b('0x0'));var path=require(_0x719b('0x1'));var timeout=require(_0x719b('0x2'));var express=require(_0x719b('0x3'));var router=express[_0x719b('0x4')]();var fs_extra=require(_0x719b('0x5'));var auth=require(_0x719b('0x6'));var interaction=require(_0x719b('0x7'));var config=require('../../config/environment');var controller=require(_0x719b('0x8'));router[_0x719b('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x719b('0xa')](),controller['show']);router[_0x719b('0x9')](_0x719b('0xb'),auth[_0x719b('0xa')](),controller['preview']);router[_0x719b('0x9')](_0x719b('0xc'),auth[_0x719b('0xa')](),controller[_0x719b('0xd')]);router['get'](_0x719b('0xe'),auth[_0x719b('0xa')](),controller[_0x719b('0xf')]);router['post']('/',auth[_0x719b('0xa')](),controller[_0x719b('0x10')]);router['put'](_0x719b('0x11'),auth[_0x719b('0xa')](),controller[_0x719b('0x12')]);router[_0x719b('0x13')](_0x719b('0x11'),auth['isAuthenticated'](),controller[_0x719b('0x14')]);module[_0x719b('0x15')]=router; \ No newline at end of file +var _0x757b=['query','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','run','/:id/query'];(function(_0x200bec,_0x1a697e){var _0x42c7df=function(_0x2c2b6a){while(--_0x2c2b6a){_0x200bec['push'](_0x200bec['shift']());}};_0x42c7df(++_0x1a697e);}(_0x757b,0x7a));var _0xb757=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x757b[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xb757('0x0'));var util=require('util');var path=require(_0xb757('0x1'));var timeout=require(_0xb757('0x2'));var express=require(_0xb757('0x3'));var router=express['Router']();var fs_extra=require(_0xb757('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb757('0x5'));var config=require('../../config/environment');var controller=require(_0xb757('0x6'));router[_0xb757('0x7')]('/',auth[_0xb757('0x8')](),controller[_0xb757('0x9')]);router[_0xb757('0x7')](_0xb757('0xa'),auth[_0xb757('0x8')](),controller[_0xb757('0xb')]);router['get'](_0xb757('0xc'),auth[_0xb757('0x8')](),controller[_0xb757('0xd')]);router[_0xb757('0x7')]('/:id/run',auth[_0xb757('0x8')](),controller[_0xb757('0xe')]);router[_0xb757('0x7')](_0xb757('0xf'),auth['isAuthenticated'](),controller[_0xb757('0x10')]);router['post']('/',auth[_0xb757('0x8')](),controller[_0xb757('0x11')]);router[_0xb757('0x12')](_0xb757('0xa'),auth[_0xb757('0x8')](),controller[_0xb757('0x13')]);router[_0xb757('0x14')](_0xb757('0xa'),auth[_0xb757('0x8')](),controller[_0xb757('0x15')]);module[_0xb757('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 b3812e9..21edc16 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 _0x6d73=['manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','pdf','csv','DATE','Loading'];(function(_0x4ec7f2,_0x3d92d2){var _0x118004=function(_0x1ac4fb){while(--_0x1ac4fb){_0x4ec7f2['push'](_0x4ec7f2['shift']());}};_0x118004(++_0x3d92d2);}(_0x6d73,0x163));var _0x36d7=function(_0x576cc7,_0x3c6b04){_0x576cc7=_0x576cc7-0x0;var _0x2686f0=_0x6d73[_0x576cc7];return _0x2686f0;};'use strict';var Sequelize=require(_0x36d7('0x0'));var moment=require(_0x36d7('0x1'));module[_0x36d7('0x2')]={'name':{'type':Sequelize[_0x36d7('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x36d7('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x36d7('0x4')]('csv',_0x36d7('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0x36d7('0x6')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x36d7('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x36d7('0x8')},'type':{'type':Sequelize[_0x36d7('0x4')](_0x36d7('0x9'),_0x36d7('0xa')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x36d7('0xb')](0xb)[_0x36d7('0xc')]},'reportType':{'type':Sequelize[_0x36d7('0x3')]}}; \ No newline at end of file +var _0x65c7=['STRING','ENUM','csv','pdf','xlsx','DATE','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','exports'];(function(_0x91a34b,_0x21b8b5){var _0x257b89=function(_0x353ee8){while(--_0x353ee8){_0x91a34b['push'](_0x91a34b['shift']());}};_0x257b89(++_0x21b8b5);}(_0x65c7,0xb3));var _0x765c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x65c7[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x765c('0x0'));var moment=require(_0x765c('0x1'));module[_0x765c('0x2')]={'name':{'type':Sequelize[_0x765c('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x765c('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x765c('0x4')](_0x765c('0x5'),_0x765c('0x6'),_0x765c('0x7')),'allowNull':![],'defaultValue':_0x765c('0x5')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x765c('0x8')]},'endDate':{'type':Sequelize[_0x765c('0x8')]},'status':{'type':Sequelize[_0x765c('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0x765c('0x9'),_0x765c('0xa')),'allowNull':![],'defaultValue':_0x765c('0x9')},'reportId':{'type':Sequelize[_0x765c('0xb')](0xb)[_0x765c('0xc')]},'reportType':{'type':Sequelize[_0x765c('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index f6745b7..e1697cb 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 _0x3337=['attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','show','include','find','create','user','role','UserProfileSection','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','download','basename','output','join','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','server/files/reports','format','%s.%s','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','offset','limit','undefined','count','set','json','reject','save','update','then','get','destroy','error','stack','name','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x3337,0x188));var _0x7333=function(_0x45d56b,_0x3b99e4){_0x45d56b=_0x45d56b-0x0;var _0xd62e37=_0x3337[_0x45d56b];return _0xd62e37;};'use strict';var emlformat=require(_0x7333('0x0'));var rimraf=require(_0x7333('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7333('0x2'));var rp=require('request-promise');var moment=require(_0x7333('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7333('0x4'));var util=require(_0x7333('0x5'));var path=require(_0x7333('0x6'));var sox=require(_0x7333('0x7'));var csv=require(_0x7333('0x8'));var ejs=require(_0x7333('0x9'));var fs=require('fs');var fs_extra=require(_0x7333('0xa'));var _=require(_0x7333('0xb'));var squel=require(_0x7333('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7333('0xd'));var toCsv=require(_0x7333('0x8'));var querystring=require('querystring');var Papa=require(_0x7333('0xe'));var Redis=require(_0x7333('0xf'));var authService=require(_0x7333('0x10'));var qs=require(_0x7333('0x11'));var as=require(_0x7333('0x12'));var hardwareService=require(_0x7333('0x13'));var logger=require(_0x7333('0x14'))(_0x7333('0x15'));var utils=require(_0x7333('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7333('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e9bc3,_0x8a9fa9){_0x8a9fa9=_0x8a9fa9||0xcc;return function(_0x3f486e){if(_0x3f486e){return _0x1e9bc3[_0x7333('0x18')](_0x8a9fa9);}return _0x1e9bc3[_0x7333('0x19')](_0x8a9fa9)['end']();};}function respondWithResult(_0x30fd3c,_0x2431c3){_0x2431c3=_0x2431c3||0xc8;return function(_0x503467){if(_0x503467){return _0x30fd3c[_0x7333('0x19')](_0x2431c3)['json'](_0x503467);}};}function respondWithFilteredResult(_0x1fd70d,_0x2a9a3b){return function(_0x303b1c){if(_0x303b1c){var _0x3b08af=typeof _0x2a9a3b[_0x7333('0x1a')]==='undefined'&&typeof _0x2a9a3b[_0x7333('0x1b')]===_0x7333('0x1c');var _0x1755fa=_0x303b1c[_0x7333('0x1d')];var _0x2f55be=_0x3b08af?0x0:_0x2a9a3b['offset'];var _0x1c7f67=_0x3b08af?_0x303b1c[_0x7333('0x1d')]:_0x2a9a3b['offset']+_0x2a9a3b[_0x7333('0x1b')];var _0x42e019;if(_0x1c7f67>=_0x1755fa){_0x1c7f67=_0x1755fa;_0x42e019=0xc8;}else{_0x42e019=0xce;}_0x1fd70d['status'](_0x42e019);return _0x1fd70d[_0x7333('0x1e')]('Content-Range',_0x2f55be+'-'+_0x1c7f67+'/'+_0x1755fa)[_0x7333('0x1f')](_0x303b1c);}return null;};}function patchUpdates(_0x31f914){return function(_0x232779){try{jsonpatch['apply'](_0x232779,_0x31f914,!![]);}catch(_0x1248eb){return BPromise[_0x7333('0x20')](_0x1248eb);}return _0x232779[_0x7333('0x21')]();};}function saveUpdates(_0x511f0a,_0xcb48e6){return function(_0x4bb4b6){if(_0x4bb4b6){return _0x4bb4b6[_0x7333('0x22')](_0x511f0a)['then'](function(_0x280f1d){return _0x280f1d;});}return null;};}function removeEntity(_0x3ec625,_0x512abe){return function(_0x33d090){if(_0x33d090){return _0x33d090['destroy']()[_0x7333('0x23')](function(){var _0x4489d3=_0x33d090[_0x7333('0x24')]({'plain':!![]});var _0x16c4d8='ExtractedReports';return db['UserProfileResource'][_0x7333('0x25')]({'where':{'type':_0x16c4d8,'resourceId':_0x4489d3['id']}})['then'](function(){return _0x33d090;});})[_0x7333('0x23')](function(){_0x3ec625[_0x7333('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4490ce,_0x2e4279){return function(_0x2d5c09){if(!_0x2d5c09){_0x4490ce[_0x7333('0x18')](0x194);}return _0x2d5c09;};}function handleError(_0x9c431c,_0x54fdb0){_0x54fdb0=_0x54fdb0||0x1f4;return function(_0x4ff8dc){logger[_0x7333('0x26')](_0x4ff8dc[_0x7333('0x27')]);if(_0x4ff8dc[_0x7333('0x28')]){delete _0x4ff8dc['name'];}_0x9c431c['status'](_0x54fdb0)['send'](_0x4ff8dc);};}exports[_0x7333('0x29')]=function(_0x180183,_0x57e888){var _0xacdcd6={},_0x26a5f4={},_0x4fc18c={'count':0x0,'rows':[]};var _0xedfe78=_[_0x7333('0x2a')](db[_0x7333('0x2b')][_0x7333('0x2c')],function(_0x3a4e5f){return{'name':_0x3a4e5f[_0x7333('0x2d')],'type':_0x3a4e5f[_0x7333('0x2e')][_0x7333('0x2f')]};});_0x26a5f4[_0x7333('0x30')]=_[_0x7333('0x2a')](_0xedfe78,_0x7333('0x28'));_0x26a5f4[_0x7333('0x31')]=_[_0x7333('0x32')](_0x180183['query']);_0x26a5f4[_0x7333('0x33')]=_[_0x7333('0x34')](_0x26a5f4[_0x7333('0x30')],_0x26a5f4[_0x7333('0x31')]);_0xacdcd6[_0x7333('0x35')]=_['intersection'](_0x26a5f4[_0x7333('0x30')],qs['fields'](_0x180183[_0x7333('0x31')][_0x7333('0x36')]));_0xacdcd6[_0x7333('0x35')]=_0xacdcd6[_0x7333('0x35')][_0x7333('0x37')]?_0xacdcd6[_0x7333('0x35')]:_0x26a5f4[_0x7333('0x30')];if(!_0x180183['query'][_0x7333('0x38')](_0x7333('0x39'))){_0xacdcd6[_0x7333('0x1b')]=qs['limit'](_0x180183[_0x7333('0x31')][_0x7333('0x1b')]);_0xacdcd6[_0x7333('0x1a')]=qs[_0x7333('0x1a')](_0x180183['query']['offset']);}_0xacdcd6['order']=qs['sort'](_0x180183[_0x7333('0x31')][_0x7333('0x3a')]);_0xacdcd6[_0x7333('0x3b')]=qs['filters'](_[_0x7333('0x3c')](_0x180183['query'],_0x26a5f4[_0x7333('0x33')]),_0xedfe78);if(_0x180183[_0x7333('0x31')][_0x7333('0x3d')]){_0xacdcd6[_0x7333('0x3b')]=_[_0x7333('0x3e')](_0xacdcd6[_0x7333('0x3b')],{'$or':_[_0x7333('0x2a')](_0xedfe78,function(_0x30b7c2){if(_0x30b7c2[_0x7333('0x2e')]!=='VIRTUAL'){var _0x44b561={};_0x44b561[_0x30b7c2['name']]={'$like':'%'+_0x180183[_0x7333('0x31')][_0x7333('0x3d')]+'%'};return _0x44b561;}})});}_0xacdcd6=_[_0x7333('0x3e')]({},_0xacdcd6,_0x180183[_0x7333('0x3f')]);var _0x46b2c6={'where':_0xacdcd6[_0x7333('0x3b')]};return db[_0x7333('0x2b')][_0x7333('0x1d')](_0x46b2c6)[_0x7333('0x23')](function(_0x22f81d){_0x4fc18c['count']=_0x22f81d;if(_0x180183[_0x7333('0x31')][_0x7333('0x40')]){_0xacdcd6['include']=[{'all':!![]}];}return db[_0x7333('0x2b')]['findAll'](_0xacdcd6);})['then'](function(_0x373ea8){_0x4fc18c['rows']=_0x373ea8;return _0x4fc18c;})[_0x7333('0x23')](respondWithFilteredResult(_0x57e888,_0xacdcd6))['catch'](handleError(_0x57e888,null));};exports[_0x7333('0x41')]=function(_0x4e19c7,_0x3a21bb){var _0x508bdf={'raw':!![],'where':{'id':_0x4e19c7['params']['id']}},_0x2d8efb={};_0x2d8efb['model']=_['keys'](db['AnalyticExtractedReport']['rawAttributes']);_0x2d8efb[_0x7333('0x31')]=_['keys'](_0x4e19c7['query']);_0x2d8efb['filters']=_[_0x7333('0x34')](_0x2d8efb[_0x7333('0x30')],_0x2d8efb[_0x7333('0x31')]);_0x508bdf[_0x7333('0x35')]=_[_0x7333('0x34')](_0x2d8efb[_0x7333('0x30')],qs[_0x7333('0x36')](_0x4e19c7[_0x7333('0x31')]['fields']));_0x508bdf[_0x7333('0x35')]=_0x508bdf[_0x7333('0x35')][_0x7333('0x37')]?_0x508bdf[_0x7333('0x35')]:_0x2d8efb[_0x7333('0x30')];if(_0x4e19c7[_0x7333('0x31')][_0x7333('0x40')]){_0x508bdf[_0x7333('0x42')]=[{'all':!![]}];}_0x508bdf=_[_0x7333('0x3e')]({},_0x508bdf,_0x4e19c7[_0x7333('0x3f')]);return db[_0x7333('0x2b')][_0x7333('0x43')](_0x508bdf)['then'](handleEntityNotFound(_0x3a21bb,null))[_0x7333('0x23')](respondWithResult(_0x3a21bb,null))['catch'](handleError(_0x3a21bb,null));};exports[_0x7333('0x44')]=function(_0x2ff78e,_0x2c205e){return db[_0x7333('0x2b')]['create'](_0x2ff78e['body'],{})['then'](function(_0x1e8cc6){var _0x198cca=_0x2ff78e[_0x7333('0x45')][_0x7333('0x24')]({'plain':!![]});if(!_0x198cca)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x198cca[_0x7333('0x46')]===_0x7333('0x45')){var _0x106b3e=_0x1e8cc6[_0x7333('0x24')]({'plain':!![]});var _0x4b6fb0='ExtractedReports';return db[_0x7333('0x47')]['find']({'where':{'name':_0x4b6fb0,'userProfileId':_0x198cca['userProfileId']},'raw':!![]})[_0x7333('0x23')](function(_0x179bde){if(_0x179bde&&_0x179bde['autoAssociation']===0x0){return db[_0x7333('0x48')][_0x7333('0x44')]({'name':_0x106b3e[_0x7333('0x28')],'resourceId':_0x106b3e['id'],'type':_0x179bde[_0x7333('0x28')],'sectionId':_0x179bde['id']},{})[_0x7333('0x23')](function(){return _0x1e8cc6;});}else{return _0x1e8cc6;}})[_0x7333('0x49')](function(_0x178659){logger[_0x7333('0x26')](_0x7333('0x4a'),_0x178659);throw _0x178659;});}return _0x1e8cc6;})[_0x7333('0x23')](respondWithResult(_0x2c205e,0xc9))[_0x7333('0x49')](handleError(_0x2c205e,null));};exports['update']=function(_0x44d0fa,_0x399bce){if(_0x44d0fa[_0x7333('0x4b')]['id']){delete _0x44d0fa[_0x7333('0x4b')]['id'];}return db[_0x7333('0x2b')]['find']({'where':{'id':_0x44d0fa[_0x7333('0x4c')]['id']}})[_0x7333('0x23')](handleEntityNotFound(_0x399bce,null))[_0x7333('0x23')](saveUpdates(_0x44d0fa[_0x7333('0x4b')],null))[_0x7333('0x23')](respondWithResult(_0x399bce,null))[_0x7333('0x49')](handleError(_0x399bce,null));};exports[_0x7333('0x25')]=function(_0xda0922,_0xca1210){return db[_0x7333('0x2b')]['find']({'where':{'id':_0xda0922[_0x7333('0x4c')]['id']}})['then'](handleEntityNotFound(_0xca1210,null))[_0x7333('0x23')](removeEntity(_0xca1210,null))[_0x7333('0x49')](handleError(_0xca1210,null));};exports[_0x7333('0x4d')]=function(_0x31b132,_0x13ed9c,_0x32a281){return db[_0x7333('0x2b')][_0x7333('0x43')]({'where':{'id':_0x31b132['params']['id']},'attributes':['name',_0x7333('0x4e'),'savename',_0x7333('0x4f')],'raw':!![]})[_0x7333('0x23')](handleEntityNotFound(_0x13ed9c,null))[_0x7333('0x23')](function(_0x579007){if(_0x579007){if(!fs['existsSync'](path[_0x7333('0x50')](config['root'],'server/files/reports',_0x579007[_0x7333('0x51')]))){throw new db[(_0x7333('0x52'))][(_0x7333('0x53'))](_0x7333('0x54'));}if(_0x31b132[_0x7333('0x31')][_0x7333('0x55')]){return _0x13ed9c[_0x7333('0x18')](0xc8);}return _0x13ed9c['download'](path['join'](config['root'],_0x7333('0x56'),_0x579007[_0x7333('0x51')]),util[_0x7333('0x57')](_0x7333('0x58'),_0x579007[_0x7333('0x4e')]||_0x579007['name'],_0x579007[_0x7333('0x4f')]['toLowerCase']()));}})[_0x7333('0x49')](handleError(_0x13ed9c,null));}; \ No newline at end of file +var _0xc780=['AnalyticExtractedReport','includeAll','include','rows','catch','show','params','keys','intersection','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','output','existsSync','join','root','server/files/reports','savename','Sequelize','Report\x20not\x20found\x20or\x20empty','format','%s.%s','basename','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','apply','update','destroy','then','get','ExtractedReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','attributes','fields','length','nolimit','sort','where','pick','filter','merge','options'];(function(_0x24392f,_0x15a3e5){var _0x591e33=function(_0xe0ccea){while(--_0xe0ccea){_0x24392f['push'](_0x24392f['shift']());}};_0x591e33(++_0x15a3e5);}(_0xc780,0xd9));var _0x0c78=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc780[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x0c78('0x0'));var rimraf=require(_0x0c78('0x1'));var zipdir=require(_0x0c78('0x2'));var jsonpatch=require(_0x0c78('0x3'));var rp=require(_0x0c78('0x4'));var moment=require(_0x0c78('0x5'));var BPromise=require(_0x0c78('0x6'));var Mustache=require('mustache');var util=require(_0x0c78('0x7'));var path=require(_0x0c78('0x8'));var sox=require(_0x0c78('0x9'));var csv=require('to-csv');var ejs=require(_0x0c78('0xa'));var fs=require('fs');var fs_extra=require(_0x0c78('0xb'));var _=require(_0x0c78('0xc'));var squel=require(_0x0c78('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0c78('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0c78('0xf'));var Papa=require(_0x0c78('0x10'));var Redis=require(_0x0c78('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0c78('0x12'));var hardwareService=require(_0x0c78('0x13'));var logger=require(_0x0c78('0x14'))(_0x0c78('0x15'));var utils=require(_0x0c78('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0c78('0x17'));var db=require(_0x0c78('0x18'))['db'];function respondWithStatusCode(_0xc5c1f9,_0x240e24){_0x240e24=_0x240e24||0xcc;return function(_0x164802){if(_0x164802){return _0xc5c1f9['sendStatus'](_0x240e24);}return _0xc5c1f9['status'](_0x240e24)[_0x0c78('0x19')]();};}function respondWithResult(_0x33da42,_0x5d0d64){_0x5d0d64=_0x5d0d64||0xc8;return function(_0x1a9012){if(_0x1a9012){return _0x33da42[_0x0c78('0x1a')](_0x5d0d64)[_0x0c78('0x1b')](_0x1a9012);}};}function respondWithFilteredResult(_0x40cf71,_0x4787bd){return function(_0x422f49){if(_0x422f49){var _0x3b213f=typeof _0x4787bd[_0x0c78('0x1c')]===_0x0c78('0x1d')&&typeof _0x4787bd[_0x0c78('0x1e')]===_0x0c78('0x1d');var _0x3e5956=_0x422f49[_0x0c78('0x1f')];var _0x41450c=_0x3b213f?0x0:_0x4787bd[_0x0c78('0x1c')];var _0x115ce6=_0x3b213f?_0x422f49['count']:_0x4787bd['offset']+_0x4787bd[_0x0c78('0x1e')];var _0x23382e;if(_0x115ce6>=_0x3e5956){_0x115ce6=_0x3e5956;_0x23382e=0xc8;}else{_0x23382e=0xce;}_0x40cf71['status'](_0x23382e);return _0x40cf71['set']('Content-Range',_0x41450c+'-'+_0x115ce6+'/'+_0x3e5956)['json'](_0x422f49);}return null;};}function patchUpdates(_0xc9a28e){return function(_0x36bba6){try{jsonpatch[_0x0c78('0x20')](_0x36bba6,_0xc9a28e,!![]);}catch(_0x1f9060){return BPromise['reject'](_0x1f9060);}return _0x36bba6['save']();};}function saveUpdates(_0x292f7c,_0x36f481){return function(_0x442485){if(_0x442485){return _0x442485[_0x0c78('0x21')](_0x292f7c)['then'](function(_0x4607c4){return _0x4607c4;});}return null;};}function removeEntity(_0x59087e,_0xae6009){return function(_0x17b8ec){if(_0x17b8ec){return _0x17b8ec[_0x0c78('0x22')]()[_0x0c78('0x23')](function(){var _0x3b13c5=_0x17b8ec[_0x0c78('0x24')]({'plain':!![]});var _0xa43e2a=_0x0c78('0x25');return db[_0x0c78('0x26')][_0x0c78('0x22')]({'where':{'type':_0xa43e2a,'resourceId':_0x3b13c5['id']}})[_0x0c78('0x23')](function(){return _0x17b8ec;});})[_0x0c78('0x23')](function(){_0x59087e['status'](0xcc)[_0x0c78('0x19')]();});}};}function handleEntityNotFound(_0x5ac821,_0x4928eb){return function(_0xe65a6){if(!_0xe65a6){_0x5ac821[_0x0c78('0x27')](0x194);}return _0xe65a6;};}function handleError(_0x55845a,_0x4eb00e){_0x4eb00e=_0x4eb00e||0x1f4;return function(_0x23e1b9){logger[_0x0c78('0x28')](_0x23e1b9[_0x0c78('0x29')]);if(_0x23e1b9[_0x0c78('0x2a')]){delete _0x23e1b9[_0x0c78('0x2a')];}_0x55845a['status'](_0x4eb00e)[_0x0c78('0x2b')](_0x23e1b9);};}exports[_0x0c78('0x2c')]=function(_0x12069e,_0x5e4ba2){var _0x25d700={},_0x4e4c9e={},_0x1087ba={'count':0x0,'rows':[]};var _0x2f9940=_[_0x0c78('0x2d')](db['AnalyticExtractedReport'][_0x0c78('0x2e')],function(_0x429daf){return{'name':_0x429daf['fieldName'],'type':_0x429daf[_0x0c78('0x2f')][_0x0c78('0x30')]};});_0x4e4c9e[_0x0c78('0x31')]=_['map'](_0x2f9940,_0x0c78('0x2a'));_0x4e4c9e[_0x0c78('0x32')]=_['keys'](_0x12069e[_0x0c78('0x32')]);_0x4e4c9e[_0x0c78('0x33')]=_['intersection'](_0x4e4c9e['model'],_0x4e4c9e['query']);_0x25d700[_0x0c78('0x34')]=_['intersection'](_0x4e4c9e[_0x0c78('0x31')],qs[_0x0c78('0x35')](_0x12069e[_0x0c78('0x32')][_0x0c78('0x35')]));_0x25d700[_0x0c78('0x34')]=_0x25d700[_0x0c78('0x34')][_0x0c78('0x36')]?_0x25d700[_0x0c78('0x34')]:_0x4e4c9e[_0x0c78('0x31')];if(!_0x12069e[_0x0c78('0x32')]['hasOwnProperty'](_0x0c78('0x37'))){_0x25d700[_0x0c78('0x1e')]=qs[_0x0c78('0x1e')](_0x12069e['query'][_0x0c78('0x1e')]);_0x25d700[_0x0c78('0x1c')]=qs[_0x0c78('0x1c')](_0x12069e[_0x0c78('0x32')][_0x0c78('0x1c')]);}_0x25d700['order']=qs['sort'](_0x12069e[_0x0c78('0x32')][_0x0c78('0x38')]);_0x25d700[_0x0c78('0x39')]=qs['filters'](_[_0x0c78('0x3a')](_0x12069e[_0x0c78('0x32')],_0x4e4c9e[_0x0c78('0x33')]),_0x2f9940);if(_0x12069e['query']['filter']){_0x25d700['where']=_['merge'](_0x25d700[_0x0c78('0x39')],{'$or':_['map'](_0x2f9940,function(_0x208eec){if(_0x208eec[_0x0c78('0x2f')]!=='VIRTUAL'){var _0x59988e={};_0x59988e[_0x208eec['name']]={'$like':'%'+_0x12069e[_0x0c78('0x32')][_0x0c78('0x3b')]+'%'};return _0x59988e;}})});}_0x25d700=_[_0x0c78('0x3c')]({},_0x25d700,_0x12069e[_0x0c78('0x3d')]);var _0x39c8d9={'where':_0x25d700[_0x0c78('0x39')]};return db[_0x0c78('0x3e')]['count'](_0x39c8d9)[_0x0c78('0x23')](function(_0x5c8368){_0x1087ba[_0x0c78('0x1f')]=_0x5c8368;if(_0x12069e['query'][_0x0c78('0x3f')]){_0x25d700[_0x0c78('0x40')]=[{'all':!![]}];}return db[_0x0c78('0x3e')]['findAll'](_0x25d700);})[_0x0c78('0x23')](function(_0x1ae781){_0x1087ba[_0x0c78('0x41')]=_0x1ae781;return _0x1087ba;})[_0x0c78('0x23')](respondWithFilteredResult(_0x5e4ba2,_0x25d700))[_0x0c78('0x42')](handleError(_0x5e4ba2,null));};exports[_0x0c78('0x43')]=function(_0x5623bb,_0x44c035){var _0x2a7008={'raw':!![],'where':{'id':_0x5623bb[_0x0c78('0x44')]['id']}},_0x42b03d={};_0x42b03d[_0x0c78('0x31')]=_[_0x0c78('0x45')](db[_0x0c78('0x3e')][_0x0c78('0x2e')]);_0x42b03d[_0x0c78('0x32')]=_[_0x0c78('0x45')](_0x5623bb['query']);_0x42b03d[_0x0c78('0x33')]=_[_0x0c78('0x46')](_0x42b03d[_0x0c78('0x31')],_0x42b03d[_0x0c78('0x32')]);_0x2a7008['attributes']=_[_0x0c78('0x46')](_0x42b03d[_0x0c78('0x31')],qs[_0x0c78('0x35')](_0x5623bb['query'][_0x0c78('0x35')]));_0x2a7008['attributes']=_0x2a7008[_0x0c78('0x34')]['length']?_0x2a7008[_0x0c78('0x34')]:_0x42b03d[_0x0c78('0x31')];if(_0x5623bb[_0x0c78('0x32')][_0x0c78('0x3f')]){_0x2a7008[_0x0c78('0x40')]=[{'all':!![]}];}_0x2a7008=_[_0x0c78('0x3c')]({},_0x2a7008,_0x5623bb['options']);return db[_0x0c78('0x3e')][_0x0c78('0x47')](_0x2a7008)[_0x0c78('0x23')](handleEntityNotFound(_0x44c035,null))[_0x0c78('0x23')](respondWithResult(_0x44c035,null))[_0x0c78('0x42')](handleError(_0x44c035,null));};exports[_0x0c78('0x48')]=function(_0x3a055f,_0x38ebf1){return db['AnalyticExtractedReport'][_0x0c78('0x48')](_0x3a055f['body'],{})[_0x0c78('0x23')](function(_0x468aa6){var _0x54bf0a=_0x3a055f[_0x0c78('0x49')][_0x0c78('0x24')]({'plain':!![]});if(!_0x54bf0a)throw new Error(_0x0c78('0x4a'));if(_0x54bf0a['role']==='user'){var _0x3dd323=_0x468aa6[_0x0c78('0x24')]({'plain':!![]});var _0x4f2eed=_0x0c78('0x25');return db[_0x0c78('0x4b')][_0x0c78('0x47')]({'where':{'name':_0x4f2eed,'userProfileId':_0x54bf0a[_0x0c78('0x4c')]},'raw':!![]})[_0x0c78('0x23')](function(_0x191e31){if(_0x191e31&&_0x191e31[_0x0c78('0x4d')]===0x0){return db[_0x0c78('0x26')][_0x0c78('0x48')]({'name':_0x3dd323[_0x0c78('0x2a')],'resourceId':_0x3dd323['id'],'type':_0x191e31[_0x0c78('0x2a')],'sectionId':_0x191e31['id']},{})[_0x0c78('0x23')](function(){return _0x468aa6;});}else{return _0x468aa6;}})[_0x0c78('0x42')](function(_0x7e297f){logger[_0x0c78('0x28')](_0x0c78('0x4e'),_0x7e297f);throw _0x7e297f;});}return _0x468aa6;})[_0x0c78('0x23')](respondWithResult(_0x38ebf1,0xc9))[_0x0c78('0x42')](handleError(_0x38ebf1,null));};exports['update']=function(_0x2954d4,_0x75bd73){if(_0x2954d4[_0x0c78('0x4f')]['id']){delete _0x2954d4['body']['id'];}return db[_0x0c78('0x3e')][_0x0c78('0x47')]({'where':{'id':_0x2954d4[_0x0c78('0x44')]['id']}})[_0x0c78('0x23')](handleEntityNotFound(_0x75bd73,null))[_0x0c78('0x23')](saveUpdates(_0x2954d4['body'],null))[_0x0c78('0x23')](respondWithResult(_0x75bd73,null))[_0x0c78('0x42')](handleError(_0x75bd73,null));};exports[_0x0c78('0x22')]=function(_0x4a1121,_0xbdda5f){return db[_0x0c78('0x3e')]['find']({'where':{'id':_0x4a1121[_0x0c78('0x44')]['id']}})['then'](handleEntityNotFound(_0xbdda5f,null))['then'](removeEntity(_0xbdda5f,null))[_0x0c78('0x42')](handleError(_0xbdda5f,null));};exports[_0x0c78('0x50')]=function(_0xa01ce,_0x3ba92c,_0x4c60c0){return db[_0x0c78('0x3e')][_0x0c78('0x47')]({'where':{'id':_0xa01ce['params']['id']},'attributes':[_0x0c78('0x2a'),'basename','savename',_0x0c78('0x51')],'raw':!![]})[_0x0c78('0x23')](handleEntityNotFound(_0x3ba92c,null))[_0x0c78('0x23')](function(_0x41d774){if(_0x41d774){if(!fs[_0x0c78('0x52')](path[_0x0c78('0x53')](config[_0x0c78('0x54')],_0x0c78('0x55'),_0x41d774[_0x0c78('0x56')]))){throw new db[(_0x0c78('0x57'))]['ValidationError'](_0x0c78('0x58'));}if(_0xa01ce[_0x0c78('0x32')]['exists']){return _0x3ba92c[_0x0c78('0x27')](0xc8);}return _0x3ba92c[_0x0c78('0x50')](path[_0x0c78('0x53')](config[_0x0c78('0x54')],_0x0c78('0x55'),_0x41d774[_0x0c78('0x56')]),util[_0x0c78('0x59')](_0x0c78('0x5a'),_0x41d774[_0x0c78('0x5b')]||_0x41d774['name'],_0x41d774['output'][_0x0c78('0x5c')]()));}})[_0x0c78('0x42')](handleError(_0x3ba92c,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 9f81145..f237b80 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 _0xed20=['define','analytics_extracted_reports','util','api','request-promise','path','rimraf','./analyticExtractedReport.attributes','exports'];(function(_0x996bc8,_0x291e01){var _0x20b0ea=function(_0x5ba992){while(--_0x5ba992){_0x996bc8['push'](_0x996bc8['shift']());}};_0x20b0ea(++_0x291e01);}(_0xed20,0x92));var _0x0ed2=function(_0x4024f8,_0xfb5ebf){_0x4024f8=_0x4024f8-0x0;var _0x589d17=_0xed20[_0x4024f8];return _0x589d17;};'use strict';var _=require('lodash');var util=require(_0x0ed2('0x0'));var logger=require('../../config/logger')(_0x0ed2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0ed2('0x2'));var fs=require('fs');var path=require(_0x0ed2('0x3'));var rimraf=require(_0x0ed2('0x4'));var config=require('../../config/environment');var attributes=require(_0x0ed2('0x5'));module[_0x0ed2('0x6')]=function(_0x38d932,_0x57f40a){return _0x38d932[_0x0ed2('0x7')]('AnalyticExtractedReport',attributes,{'tableName':_0x0ed2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3231=['bluebird','request-promise','rimraf','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','lodash','../../config/logger','api','moment'];(function(_0x127728,_0x11c9c5){var _0x3b6cfe=function(_0x627b1e){while(--_0x627b1e){_0x127728['push'](_0x127728['shift']());}};_0x3b6cfe(++_0x11c9c5);}(_0x3231,0x15c));var _0x1323=function(_0x4aba51,_0xcc8225){_0x4aba51=_0x4aba51-0x0;var _0x3de7b4=_0x3231[_0x4aba51];return _0x3de7b4;};'use strict';var _=require(_0x1323('0x0'));var util=require('util');var logger=require(_0x1323('0x1'))(_0x1323('0x2'));var moment=require(_0x1323('0x3'));var BPromise=require(_0x1323('0x4'));var rp=require(_0x1323('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1323('0x6'));var config=require('../../config/environment');var attributes=require(_0x1323('0x7'));module[_0x1323('0x8')]=function(_0x432206,_0x22e4d2){return _0x432206[_0x1323('0x9')]('AnalyticExtractedReport',attributes,{'tableName':_0x1323('0xa'),'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 3c12002..fdb8d3b 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 _0x3440=['moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','request','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util'];(function(_0x1255bf,_0x508dcb){var _0x35397e=function(_0x3df71e){while(--_0x3df71e){_0x1255bf['push'](_0x1255bf['shift']());}};_0x35397e(++_0x508dcb);}(_0x3440,0x18e));var _0x0344=function(_0x14d58f,_0xc59576){_0x14d58f=_0x14d58f-0x0;var _0x5d7e92=_0x3440[_0x14d58f];return _0x5d7e92;};'use strict';var _=require(_0x0344('0x0'));var util=require(_0x0344('0x1'));var moment=require(_0x0344('0x2'));var BPromise=require(_0x0344('0x3'));var rs=require(_0x0344('0x4'));var fs=require('fs');var Redis=require(_0x0344('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0344('0x6'));var logger=require('../../config/logger')(_0x0344('0x7'));var config=require(_0x0344('0x8'));var jayson=require(_0x0344('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c16b6,_0x3d7236,_0x24e85d){return new BPromise(function(_0xafca2a,_0x2e3999){return client[_0x0344('0xa')](_0x3c16b6,_0x24e85d)['then'](function(_0x2e80fd){logger['info'](_0x0344('0xb'),_0x3d7236,_0x0344('0xc'));logger[_0x0344('0xd')](_0x0344('0xe'),_0x3d7236,_0x0344('0xc'),JSON['stringify'](_0x2e80fd));if(_0x2e80fd[_0x0344('0xf')]){if(_0x2e80fd[_0x0344('0xf')][_0x0344('0x10')]===0x1f4){logger[_0x0344('0xf')](_0x0344('0xb'),_0x3d7236,_0x2e80fd[_0x0344('0xf')][_0x0344('0x11')]);return _0x2e3999(_0x2e80fd[_0x0344('0xf')][_0x0344('0x11')]);}logger[_0x0344('0xf')](_0x0344('0xb'),_0x3d7236,_0x2e80fd[_0x0344('0xf')][_0x0344('0x11')]);return _0xafca2a(_0x2e80fd[_0x0344('0xf')][_0x0344('0x11')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x3d7236,'request\x20sent');_0xafca2a(_0x2e80fd[_0x0344('0x12')][_0x0344('0x11')]);}})[_0x0344('0x13')](function(_0x563d90){logger[_0x0344('0xf')](_0x0344('0xb'),_0x3d7236,_0x563d90);_0x2e3999(_0x563d90);});});} \ No newline at end of file +var _0x75c8=['debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s'];(function(_0x3f0114,_0x34ef8e){var _0x5269f4=function(_0x1760b2){while(--_0x1760b2){_0x3f0114['push'](_0x3f0114['shift']());}};_0x5269f4(++_0x34ef8e);}(_0x75c8,0x1c2));var _0x875c=function(_0x217c41,_0xd11329){_0x217c41=_0x217c41-0x0;var _0x2d75a9=_0x75c8[_0x217c41];return _0x2d75a9;};'use strict';var _=require(_0x875c('0x0'));var util=require(_0x875c('0x1'));var moment=require(_0x875c('0x2'));var BPromise=require(_0x875c('0x3'));var rs=require(_0x875c('0x4'));var fs=require('fs');var Redis=require(_0x875c('0x5'));var db=require(_0x875c('0x6'))['db'];var utils=require(_0x875c('0x7'));var logger=require(_0x875c('0x8'))(_0x875c('0x9'));var config=require(_0x875c('0xa'));var jayson=require(_0x875c('0xb'));var client=jayson[_0x875c('0xc')][_0x875c('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xea85db,_0x2fbb18,_0x480ec0){return new BPromise(function(_0x380c23,_0x474442){return client[_0x875c('0xe')](_0xea85db,_0x480ec0)[_0x875c('0xf')](function(_0x148fe4){logger[_0x875c('0x10')](_0x875c('0x11'),_0x2fbb18,'request\x20sent');logger[_0x875c('0x12')](_0x875c('0x13'),_0x2fbb18,_0x875c('0x14'),JSON[_0x875c('0x15')](_0x148fe4));if(_0x148fe4[_0x875c('0x16')]){if(_0x148fe4[_0x875c('0x16')][_0x875c('0x17')]===0x1f4){logger[_0x875c('0x16')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2fbb18,_0x148fe4[_0x875c('0x16')][_0x875c('0x18')]);return _0x474442(_0x148fe4['error']['message']);}logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x2fbb18,_0x148fe4['error'][_0x875c('0x18')]);return _0x380c23(_0x148fe4[_0x875c('0x16')][_0x875c('0x18')]);}else{logger[_0x875c('0x10')](_0x875c('0x11'),_0x2fbb18,_0x875c('0x14'));_0x380c23(_0x148fe4[_0x875c('0x19')][_0x875c('0x18')]);}})['catch'](function(_0x1ef14e){logger[_0x875c('0x16')](_0x875c('0x11'),_0x2fbb18,_0x1ef14e);_0x474442(_0x1ef14e);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index aad8ec9..ae6a9cd 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 _0x9e08=['Router','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x18afca,_0x4219d9){var _0x11603f=function(_0x21d5d1){while(--_0x21d5d1){_0x18afca['push'](_0x18afca['shift']());}};_0x11603f(++_0x4219d9);}(_0x9e08,0x187));var _0x89e0=function(_0x5067ab,_0x4d7697){_0x5067ab=_0x5067ab-0x0;var _0x1347fe=_0x9e08[_0x5067ab];return _0x1347fe;};'use strict';var multer=require(_0x89e0('0x0'));var util=require(_0x89e0('0x1'));var path=require(_0x89e0('0x2'));var timeout=require(_0x89e0('0x3'));var express=require(_0x89e0('0x4'));var router=express[_0x89e0('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x89e0('0x6'));var config=require(_0x89e0('0x7'));var controller=require(_0x89e0('0x8'));router[_0x89e0('0x9')]('/',auth[_0x89e0('0xa')](),controller[_0x89e0('0xb')]);router['get'](_0x89e0('0xc'),auth['isAuthenticated'](),controller[_0x89e0('0xd')]);router[_0x89e0('0x9')](_0x89e0('0xe'),auth[_0x89e0('0xa')](),controller[_0x89e0('0xf')]);router[_0x89e0('0x10')]('/',auth[_0x89e0('0xa')](),controller[_0x89e0('0x11')]);router['put'](_0x89e0('0xc'),auth['isAuthenticated'](),controller[_0x89e0('0x12')]);router[_0x89e0('0x13')](_0x89e0('0xc'),auth[_0x89e0('0xa')](),controller[_0x89e0('0x14')]);module[_0x89e0('0x15')]=router; \ No newline at end of file +var _0xffec=['update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','download','post','create','put'];(function(_0xdd3c0,_0x37ca60){var _0x4faa02=function(_0x3771e7){while(--_0x3771e7){_0xdd3c0['push'](_0xdd3c0['shift']());}};_0x4faa02(++_0x37ca60);}(_0xffec,0xc9));var _0xcffe=function(_0x2cbe38,_0x3155de){_0x2cbe38=_0x2cbe38-0x0;var _0x46bb17=_0xffec[_0x2cbe38];return _0x46bb17;};'use strict';var multer=require(_0xcffe('0x0'));var util=require(_0xcffe('0x1'));var path=require('path');var timeout=require(_0xcffe('0x2'));var express=require(_0xcffe('0x3'));var router=express[_0xcffe('0x4')]();var fs_extra=require(_0xcffe('0x5'));var auth=require(_0xcffe('0x6'));var interaction=require(_0xcffe('0x7'));var config=require(_0xcffe('0x8'));var controller=require(_0xcffe('0x9'));router[_0xcffe('0xa')]('/',auth[_0xcffe('0xb')](),controller[_0xcffe('0xc')]);router['get'](_0xcffe('0xd'),auth[_0xcffe('0xb')](),controller[_0xcffe('0xe')]);router[_0xcffe('0xa')]('/:id/download',auth[_0xcffe('0xb')](),controller[_0xcffe('0xf')]);router[_0xcffe('0x10')]('/',auth['isAuthenticated'](),controller[_0xcffe('0x11')]);router[_0xcffe('0x12')]('/:id',auth[_0xcffe('0xb')](),controller[_0xcffe('0x13')]);router[_0xcffe('0x14')](_0xcffe('0xd'),auth['isAuthenticated'](),controller[_0xcffe('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index a293a25..b6fddb6 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 _0x1f1d=['BOOLEAN','sequelize','TEXT','STRING'];(function(_0x53dda6,_0x14af4b){var _0xa65bea=function(_0x3e2810){while(--_0x3e2810){_0x53dda6['push'](_0x53dda6['shift']());}};_0xa65bea(++_0x14af4b);}(_0x1f1d,0xe1));var _0xd1f1=function(_0x2a78c4,_0x4c0fb9){_0x2a78c4=_0x2a78c4-0x0;var _0x20b512=_0x1f1d[_0x2a78c4];return _0x20b512;};'use strict';var Sequelize=require(_0xd1f1('0x0'));module['exports']={'field':{'type':Sequelize[_0xd1f1('0x1')]},'alias':{'type':Sequelize[_0xd1f1('0x2')]},'function':{'type':Sequelize[_0xd1f1('0x2')]},'format':{'type':Sequelize[_0xd1f1('0x2')]},'groupBy':{'type':Sequelize[_0xd1f1('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0xd1f1('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x34bd=['STRING','BOOLEAN','exports','TEXT'];(function(_0x554047,_0x46ec41){var _0x5d11e4=function(_0x5a026e){while(--_0x5a026e){_0x554047['push'](_0x554047['shift']());}};_0x5d11e4(++_0x46ec41);}(_0x34bd,0x112));var _0xd34b=function(_0x2542d1,_0xdb7645){_0x2542d1=_0x2542d1-0x0;var _0xec2ce7=_0x34bd[_0x2542d1];return _0xec2ce7;};'use strict';var Sequelize=require('sequelize');module[_0xd34b('0x0')]={'field':{'type':Sequelize[_0xd34b('0x1')]},'alias':{'type':Sequelize[_0xd34b('0x2')]},'function':{'type':Sequelize[_0xd34b('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0xd34b('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xd34b('0x2')]},'custom':{'type':Sequelize[_0xd34b('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 0d6baee..0e1685d 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 _0x36a9=['bulkDestroy','ids','AnalyticCustomReport','sequelize','CustomReportId','bulkCreate','findAll','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','map','AnalyticFieldReport','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','count','includeAll','rows','catch','show','params','length','find','create','body'];(function(_0x5d126e,_0x5c97c3){var _0x1a1856=function(_0x111b2c){while(--_0x111b2c){_0x5d126e['push'](_0x5d126e['shift']());}};_0x1a1856(++_0x5c97c3);}(_0x36a9,0xee));var _0x936a=function(_0xf805c9,_0x1f88b9){_0xf805c9=_0xf805c9-0x0;var _0xb782dc=_0x36a9[_0xf805c9];return _0xb782dc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x936a('0x0'));var zipdir=require(_0x936a('0x1'));var jsonpatch=require(_0x936a('0x2'));var rp=require(_0x936a('0x3'));var moment=require('moment');var BPromise=require(_0x936a('0x4'));var Mustache=require(_0x936a('0x5'));var util=require(_0x936a('0x6'));var path=require(_0x936a('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x936a('0x8'));var fs=require('fs');var fs_extra=require(_0x936a('0x9'));var _=require(_0x936a('0xa'));var squel=require('squel');var crypto=require(_0x936a('0xb'));var jsforce=require(_0x936a('0xc'));var deskjs=require(_0x936a('0xd'));var toCsv=require(_0x936a('0xe'));var querystring=require(_0x936a('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x936a('0x10'));var qs=require(_0x936a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x936a('0x12'));var logger=require(_0x936a('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x936a('0x14'));var db=require(_0x936a('0x15'))['db'];function respondWithStatusCode(_0x210413,_0x5e1927){_0x5e1927=_0x5e1927||0xcc;return function(_0x358f53){if(_0x358f53){return _0x210413[_0x936a('0x16')](_0x5e1927);}return _0x210413[_0x936a('0x17')](_0x5e1927)[_0x936a('0x18')]();};}function respondWithResult(_0x1b538a,_0x151bca){_0x151bca=_0x151bca||0xc8;return function(_0x35716a){if(_0x35716a){return _0x1b538a[_0x936a('0x17')](_0x151bca)['json'](_0x35716a);}};}function respondWithFilteredResult(_0x124ee0,_0x1ef65a){return function(_0x268580){if(_0x268580){var _0x51151f=typeof _0x1ef65a[_0x936a('0x19')]===_0x936a('0x1a')&&typeof _0x1ef65a[_0x936a('0x1b')]===_0x936a('0x1a');var _0x55cfca=_0x268580['count'];var _0x372c97=_0x51151f?0x0:_0x1ef65a[_0x936a('0x19')];var _0x2fb4a0=_0x51151f?_0x268580['count']:_0x1ef65a[_0x936a('0x19')]+_0x1ef65a['limit'];var _0x283e65;if(_0x2fb4a0>=_0x55cfca){_0x2fb4a0=_0x55cfca;_0x283e65=0xc8;}else{_0x283e65=0xce;}_0x124ee0['status'](_0x283e65);return _0x124ee0[_0x936a('0x1c')](_0x936a('0x1d'),_0x372c97+'-'+_0x2fb4a0+'/'+_0x55cfca)[_0x936a('0x1e')](_0x268580);}return null;};}function patchUpdates(_0x2c939a){return function(_0x410b40){try{jsonpatch['apply'](_0x410b40,_0x2c939a,!![]);}catch(_0x39a70c){return BPromise[_0x936a('0x1f')](_0x39a70c);}return _0x410b40[_0x936a('0x20')]();};}function saveUpdates(_0x2179e0,_0x1e73d7){return function(_0x49cfc0){if(_0x49cfc0){return _0x49cfc0[_0x936a('0x21')](_0x2179e0)[_0x936a('0x22')](function(_0x192528){return _0x192528;});}return null;};}function removeEntity(_0x310402,_0x1ae636){return function(_0x3f04c4){if(_0x3f04c4){return _0x3f04c4[_0x936a('0x23')]()['then'](function(){_0x310402[_0x936a('0x17')](0xcc)[_0x936a('0x18')]();});}};}function handleEntityNotFound(_0x2a0852,_0x1bf37e){return function(_0x52e43d){if(!_0x52e43d){_0x2a0852[_0x936a('0x16')](0x194);}return _0x52e43d;};}function handleError(_0x41c6cf,_0x3d2781){_0x3d2781=_0x3d2781||0x1f4;return function(_0x6708f9){logger[_0x936a('0x24')](_0x6708f9[_0x936a('0x25')]);if(_0x6708f9['name']){delete _0x6708f9[_0x936a('0x26')];}_0x41c6cf['status'](_0x3d2781)[_0x936a('0x27')](_0x6708f9);};}exports['index']=function(_0x4b2784,_0x7a23f5){var _0x37c0e9={},_0x1de929={},_0x49e102={'count':0x0,'rows':[]};var _0x362cce=_[_0x936a('0x28')](db[_0x936a('0x29')][_0x936a('0x2a')],function(_0x4babc6){return{'name':_0x4babc6[_0x936a('0x2b')],'type':_0x4babc6['type']['key']};});_0x1de929[_0x936a('0x2c')]=_[_0x936a('0x28')](_0x362cce,_0x936a('0x26'));_0x1de929[_0x936a('0x2d')]=_[_0x936a('0x2e')](_0x4b2784[_0x936a('0x2d')]);_0x1de929[_0x936a('0x2f')]=_['intersection'](_0x1de929[_0x936a('0x2c')],_0x1de929['query']);_0x37c0e9[_0x936a('0x30')]=_[_0x936a('0x31')](_0x1de929[_0x936a('0x2c')],qs[_0x936a('0x32')](_0x4b2784[_0x936a('0x2d')][_0x936a('0x32')]));_0x37c0e9[_0x936a('0x30')]=_0x37c0e9['attributes']['length']?_0x37c0e9['attributes']:_0x1de929[_0x936a('0x2c')];if(!_0x4b2784[_0x936a('0x2d')][_0x936a('0x33')]('nolimit')){_0x37c0e9[_0x936a('0x1b')]=qs[_0x936a('0x1b')](_0x4b2784[_0x936a('0x2d')][_0x936a('0x1b')]);_0x37c0e9[_0x936a('0x19')]=qs[_0x936a('0x19')](_0x4b2784[_0x936a('0x2d')][_0x936a('0x19')]);}_0x37c0e9[_0x936a('0x34')]=qs[_0x936a('0x35')](_0x4b2784[_0x936a('0x2d')][_0x936a('0x35')]);_0x37c0e9['where']=qs[_0x936a('0x2f')](_[_0x936a('0x36')](_0x4b2784[_0x936a('0x2d')],_0x1de929[_0x936a('0x2f')]),_0x362cce);if(_0x4b2784[_0x936a('0x2d')][_0x936a('0x37')]){_0x37c0e9[_0x936a('0x38')]=_[_0x936a('0x39')](_0x37c0e9[_0x936a('0x38')],{'$or':_['map'](_0x362cce,function(_0x9c098a){if(_0x9c098a[_0x936a('0x3a')]!==_0x936a('0x3b')){var _0x26982e={};_0x26982e[_0x9c098a['name']]={'$like':'%'+_0x4b2784[_0x936a('0x2d')][_0x936a('0x37')]+'%'};return _0x26982e;}})});}_0x37c0e9=_[_0x936a('0x39')]({},_0x37c0e9,_0x4b2784['options']);var _0x4eac11={'where':_0x37c0e9[_0x936a('0x38')]};return db['AnalyticFieldReport'][_0x936a('0x3c')](_0x4eac11)[_0x936a('0x22')](function(_0x2eb15a){_0x49e102[_0x936a('0x3c')]=_0x2eb15a;if(_0x4b2784[_0x936a('0x2d')][_0x936a('0x3d')]){_0x37c0e9['include']=[{'all':!![]}];}return db[_0x936a('0x29')]['findAll'](_0x37c0e9);})['then'](function(_0x4db508){_0x49e102[_0x936a('0x3e')]=_0x4db508;return _0x49e102;})[_0x936a('0x22')](respondWithFilteredResult(_0x7a23f5,_0x37c0e9))[_0x936a('0x3f')](handleError(_0x7a23f5,null));};exports[_0x936a('0x40')]=function(_0x49686b,_0x23fc0d){var _0x111c8e={'raw':![],'where':{'id':_0x49686b[_0x936a('0x41')]['id']}},_0x184da0={};_0x184da0[_0x936a('0x2c')]=_['keys'](db[_0x936a('0x29')][_0x936a('0x2a')]);_0x184da0['query']=_['keys'](_0x49686b[_0x936a('0x2d')]);_0x184da0[_0x936a('0x2f')]=_['intersection'](_0x184da0['model'],_0x184da0[_0x936a('0x2d')]);_0x111c8e[_0x936a('0x30')]=_[_0x936a('0x31')](_0x184da0[_0x936a('0x2c')],qs[_0x936a('0x32')](_0x49686b[_0x936a('0x2d')][_0x936a('0x32')]));_0x111c8e['attributes']=_0x111c8e[_0x936a('0x30')][_0x936a('0x42')]?_0x111c8e['attributes']:_0x184da0[_0x936a('0x2c')];if(_0x49686b[_0x936a('0x2d')][_0x936a('0x3d')]){_0x111c8e['include']=[{'all':!![]}];}_0x111c8e=_['merge']({},_0x111c8e,_0x49686b['options']);return db['AnalyticFieldReport'][_0x936a('0x43')](_0x111c8e)[_0x936a('0x22')](handleEntityNotFound(_0x23fc0d,null))[_0x936a('0x22')](respondWithResult(_0x23fc0d,null))[_0x936a('0x3f')](handleError(_0x23fc0d,null));};exports[_0x936a('0x44')]=function(_0x320471,_0x3a048d){return db[_0x936a('0x29')]['create'](_0x320471[_0x936a('0x45')],{})[_0x936a('0x22')](respondWithResult(_0x3a048d,0xc9))[_0x936a('0x3f')](handleError(_0x3a048d,null));};exports['bulkCreate']=function(_0xf3c309,_0x5353ba){return db['AnalyticFieldReport']['bulkCreate'](_0xf3c309[_0x936a('0x45')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x5353ba,0xc9))[_0x936a('0x3f')](handleError(_0x5353ba,null));};exports['update']=function(_0x2d9ae5,_0x48b789){if(_0x2d9ae5[_0x936a('0x45')]['id']){delete _0x2d9ae5['body']['id'];}return db['AnalyticFieldReport'][_0x936a('0x43')]({'where':{'id':_0x2d9ae5[_0x936a('0x41')]['id']}})[_0x936a('0x22')](handleEntityNotFound(_0x48b789,null))['then'](saveUpdates(_0x2d9ae5[_0x936a('0x45')],null))['then'](respondWithResult(_0x48b789,null))['catch'](handleError(_0x48b789,null));};exports[_0x936a('0x23')]=function(_0x18cfbc,_0x35c081){return db['AnalyticFieldReport'][_0x936a('0x43')]({'where':{'id':_0x18cfbc[_0x936a('0x41')]['id']}})[_0x936a('0x22')](handleEntityNotFound(_0x35c081,null))[_0x936a('0x22')](removeEntity(_0x35c081,null))[_0x936a('0x3f')](handleError(_0x35c081,null));};exports[_0x936a('0x46')]=function(_0x3a121b,_0x20a2fe){return db[_0x936a('0x29')][_0x936a('0x23')]({'where':{'id':_0x3a121b['query'][_0x936a('0x47')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x20a2fe,0xcc))['catch'](handleError(_0x20a2fe,null));};exports['addFields']=function(_0x38c5e6,_0x18ac8e,_0x43b5f5){return db[_0x936a('0x48')]['findOne']({'where':{'id':_0x38c5e6[_0x936a('0x41')]['id']}})[_0x936a('0x22')](handleEntityNotFound(_0x18ac8e,null))['then'](function(_0x456fc9){if(_0x456fc9){return db[_0x936a('0x49')]['transaction'](function(_0x5a86f2){return db['AnalyticFieldReport'][_0x936a('0x23')]({'where':{'CustomReportId':_0x38c5e6[_0x936a('0x41')]['id']},'transaction':_0x5a86f2})[_0x936a('0x22')](function(_0x5761b4){var _0x1a32c6=_[_0x936a('0x28')](_0x38c5e6[_0x936a('0x45')],function(_0x3f227d){delete _0x3f227d['id'];_0x3f227d[_0x936a('0x4a')]=_0x38c5e6[_0x936a('0x41')]['id'];return _0x3f227d;});return db['AnalyticFieldReport'][_0x936a('0x4b')](_0x1a32c6,{'transaction':_0x5a86f2});});})[_0x936a('0x22')](function(){return db[_0x936a('0x29')][_0x936a('0x4c')]({'where':{'CustomReportId':_0x38c5e6[_0x936a('0x41')]['id']}});});}})[_0x936a('0x22')](respondWithResult(_0x18ac8e,null))[_0x936a('0x3f')](handleError(_0x18ac8e,null));}; \ No newline at end of file +var _0x318d=['apply','reject','update','destroy','then','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','model','keys','filters','intersection','query','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','merge','options','count','includeAll','findAll','rows','catch','params','length','include','find','create','body','bulkCreate','bulkDestroy','ids','addFields','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','Content-Range'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x318d,0x7d));var _0xd318=function(_0x44c0c2,_0x29d866){_0x44c0c2=_0x44c0c2-0x0;var _0x5b2eb8=_0x318d[_0x44c0c2];return _0x5b2eb8;};'use strict';var emlformat=require(_0xd318('0x0'));var rimraf=require(_0xd318('0x1'));var zipdir=require(_0xd318('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd318('0x3'));var moment=require(_0xd318('0x4'));var BPromise=require(_0xd318('0x5'));var Mustache=require(_0xd318('0x6'));var util=require(_0xd318('0x7'));var path=require('path');var sox=require(_0xd318('0x8'));var csv=require(_0xd318('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd318('0xa'));var squel=require(_0xd318('0xb'));var crypto=require(_0xd318('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd318('0xd'));var toCsv=require(_0xd318('0x9'));var querystring=require(_0xd318('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd318('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd318('0x10'));var logger=require(_0xd318('0x11'))(_0xd318('0x12'));var utils=require(_0xd318('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xd318('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35bf73,_0x27c39a){_0x27c39a=_0x27c39a||0xcc;return function(_0x2fe697){if(_0x2fe697){return _0x35bf73[_0xd318('0x15')](_0x27c39a);}return _0x35bf73[_0xd318('0x16')](_0x27c39a)[_0xd318('0x17')]();};}function respondWithResult(_0x5d0f07,_0x4d6277){_0x4d6277=_0x4d6277||0xc8;return function(_0x3b17dd){if(_0x3b17dd){return _0x5d0f07[_0xd318('0x16')](_0x4d6277)[_0xd318('0x18')](_0x3b17dd);}};}function respondWithFilteredResult(_0x4c0e71,_0xc463a6){return function(_0x301e65){if(_0x301e65){var _0x1f5cd8=typeof _0xc463a6[_0xd318('0x19')]===_0xd318('0x1a')&&typeof _0xc463a6[_0xd318('0x1b')]===_0xd318('0x1a');var _0x176198=_0x301e65['count'];var _0x35f75b=_0x1f5cd8?0x0:_0xc463a6[_0xd318('0x19')];var _0x3a60b9=_0x1f5cd8?_0x301e65['count']:_0xc463a6[_0xd318('0x19')]+_0xc463a6[_0xd318('0x1b')];var _0x49d6d8;if(_0x3a60b9>=_0x176198){_0x3a60b9=_0x176198;_0x49d6d8=0xc8;}else{_0x49d6d8=0xce;}_0x4c0e71['status'](_0x49d6d8);return _0x4c0e71['set'](_0xd318('0x1c'),_0x35f75b+'-'+_0x3a60b9+'/'+_0x176198)[_0xd318('0x18')](_0x301e65);}return null;};}function patchUpdates(_0x28d7be){return function(_0x3f40a3){try{jsonpatch[_0xd318('0x1d')](_0x3f40a3,_0x28d7be,!![]);}catch(_0x564173){return BPromise[_0xd318('0x1e')](_0x564173);}return _0x3f40a3['save']();};}function saveUpdates(_0x44fe39,_0x19e9f8){return function(_0xc2a190){if(_0xc2a190){return _0xc2a190[_0xd318('0x1f')](_0x44fe39)['then'](function(_0x5db1f2){return _0x5db1f2;});}return null;};}function removeEntity(_0x22c9ec,_0x4edd99){return function(_0x456a44){if(_0x456a44){return _0x456a44[_0xd318('0x20')]()[_0xd318('0x21')](function(){_0x22c9ec['status'](0xcc)[_0xd318('0x17')]();});}};}function handleEntityNotFound(_0x42ffca,_0x20eb9f){return function(_0x4eec19){if(!_0x4eec19){_0x42ffca[_0xd318('0x15')](0x194);}return _0x4eec19;};}function handleError(_0x1eb65f,_0x213101){_0x213101=_0x213101||0x1f4;return function(_0x5d06b6){logger['error'](_0x5d06b6[_0xd318('0x22')]);if(_0x5d06b6[_0xd318('0x23')]){delete _0x5d06b6[_0xd318('0x23')];}_0x1eb65f[_0xd318('0x16')](_0x213101)[_0xd318('0x24')](_0x5d06b6);};}exports[_0xd318('0x25')]=function(_0x2767e3,_0x76672d){var _0x287ff0={},_0x5b732c={},_0x22c947={'count':0x0,'rows':[]};var _0x2bba54=_[_0xd318('0x26')](db[_0xd318('0x27')][_0xd318('0x28')],function(_0x54e3ed){return{'name':_0x54e3ed[_0xd318('0x29')],'type':_0x54e3ed['type']['key']};});_0x5b732c[_0xd318('0x2a')]=_[_0xd318('0x26')](_0x2bba54,_0xd318('0x23'));_0x5b732c['query']=_[_0xd318('0x2b')](_0x2767e3['query']);_0x5b732c[_0xd318('0x2c')]=_[_0xd318('0x2d')](_0x5b732c[_0xd318('0x2a')],_0x5b732c[_0xd318('0x2e')]);_0x287ff0['attributes']=_[_0xd318('0x2d')](_0x5b732c['model'],qs['fields'](_0x2767e3[_0xd318('0x2e')][_0xd318('0x2f')]));_0x287ff0[_0xd318('0x30')]=_0x287ff0[_0xd318('0x30')]['length']?_0x287ff0[_0xd318('0x30')]:_0x5b732c[_0xd318('0x2a')];if(!_0x2767e3[_0xd318('0x2e')][_0xd318('0x31')](_0xd318('0x32'))){_0x287ff0[_0xd318('0x1b')]=qs[_0xd318('0x1b')](_0x2767e3['query'][_0xd318('0x1b')]);_0x287ff0[_0xd318('0x19')]=qs[_0xd318('0x19')](_0x2767e3[_0xd318('0x2e')]['offset']);}_0x287ff0['order']=qs['sort'](_0x2767e3[_0xd318('0x2e')][_0xd318('0x33')]);_0x287ff0[_0xd318('0x34')]=qs[_0xd318('0x2c')](_[_0xd318('0x35')](_0x2767e3[_0xd318('0x2e')],_0x5b732c['filters']),_0x2bba54);if(_0x2767e3[_0xd318('0x2e')]['filter']){_0x287ff0[_0xd318('0x34')]=_['merge'](_0x287ff0[_0xd318('0x34')],{'$or':_[_0xd318('0x26')](_0x2bba54,function(_0x1ca0a6){if(_0x1ca0a6[_0xd318('0x36')]!==_0xd318('0x37')){var _0x379327={};_0x379327[_0x1ca0a6[_0xd318('0x23')]]={'$like':'%'+_0x2767e3[_0xd318('0x2e')]['filter']+'%'};return _0x379327;}})});}_0x287ff0=_[_0xd318('0x38')]({},_0x287ff0,_0x2767e3[_0xd318('0x39')]);var _0x4917a9={'where':_0x287ff0[_0xd318('0x34')]};return db['AnalyticFieldReport'][_0xd318('0x3a')](_0x4917a9)[_0xd318('0x21')](function(_0x4f173d){_0x22c947[_0xd318('0x3a')]=_0x4f173d;if(_0x2767e3[_0xd318('0x2e')][_0xd318('0x3b')]){_0x287ff0['include']=[{'all':!![]}];}return db[_0xd318('0x27')][_0xd318('0x3c')](_0x287ff0);})[_0xd318('0x21')](function(_0x7db432){_0x22c947[_0xd318('0x3d')]=_0x7db432;return _0x22c947;})[_0xd318('0x21')](respondWithFilteredResult(_0x76672d,_0x287ff0))[_0xd318('0x3e')](handleError(_0x76672d,null));};exports['show']=function(_0x5e3f57,_0x5ad4ba){var _0x4298df={'raw':![],'where':{'id':_0x5e3f57[_0xd318('0x3f')]['id']}},_0xb7b96d={};_0xb7b96d[_0xd318('0x2a')]=_['keys'](db[_0xd318('0x27')][_0xd318('0x28')]);_0xb7b96d[_0xd318('0x2e')]=_[_0xd318('0x2b')](_0x5e3f57[_0xd318('0x2e')]);_0xb7b96d[_0xd318('0x2c')]=_['intersection'](_0xb7b96d['model'],_0xb7b96d[_0xd318('0x2e')]);_0x4298df[_0xd318('0x30')]=_[_0xd318('0x2d')](_0xb7b96d[_0xd318('0x2a')],qs[_0xd318('0x2f')](_0x5e3f57[_0xd318('0x2e')][_0xd318('0x2f')]));_0x4298df[_0xd318('0x30')]=_0x4298df['attributes'][_0xd318('0x40')]?_0x4298df[_0xd318('0x30')]:_0xb7b96d['model'];if(_0x5e3f57['query']['includeAll']){_0x4298df[_0xd318('0x41')]=[{'all':!![]}];}_0x4298df=_[_0xd318('0x38')]({},_0x4298df,_0x5e3f57[_0xd318('0x39')]);return db[_0xd318('0x27')][_0xd318('0x42')](_0x4298df)[_0xd318('0x21')](handleEntityNotFound(_0x5ad4ba,null))[_0xd318('0x21')](respondWithResult(_0x5ad4ba,null))[_0xd318('0x3e')](handleError(_0x5ad4ba,null));};exports['create']=function(_0x1d7f07,_0x3d3c16){return db[_0xd318('0x27')][_0xd318('0x43')](_0x1d7f07[_0xd318('0x44')],{})[_0xd318('0x21')](respondWithResult(_0x3d3c16,0xc9))[_0xd318('0x3e')](handleError(_0x3d3c16,null));};exports[_0xd318('0x45')]=function(_0x10a6cc,_0x5f5dcd){return db[_0xd318('0x27')]['bulkCreate'](_0x10a6cc[_0xd318('0x44')],{'raw':![],'individualHooks':!![]})[_0xd318('0x21')](respondWithResult(_0x5f5dcd,0xc9))[_0xd318('0x3e')](handleError(_0x5f5dcd,null));};exports[_0xd318('0x1f')]=function(_0x26c57a,_0x211be6){if(_0x26c57a[_0xd318('0x44')]['id']){delete _0x26c57a[_0xd318('0x44')]['id'];}return db['AnalyticFieldReport'][_0xd318('0x42')]({'where':{'id':_0x26c57a['params']['id']}})[_0xd318('0x21')](handleEntityNotFound(_0x211be6,null))[_0xd318('0x21')](saveUpdates(_0x26c57a['body'],null))['then'](respondWithResult(_0x211be6,null))[_0xd318('0x3e')](handleError(_0x211be6,null));};exports[_0xd318('0x20')]=function(_0x139293,_0x38b1a9){return db[_0xd318('0x27')][_0xd318('0x42')]({'where':{'id':_0x139293['params']['id']}})['then'](handleEntityNotFound(_0x38b1a9,null))['then'](removeEntity(_0x38b1a9,null))[_0xd318('0x3e')](handleError(_0x38b1a9,null));};exports[_0xd318('0x46')]=function(_0x2b61e9,_0x12e0b3){return db[_0xd318('0x27')][_0xd318('0x20')]({'where':{'id':_0x2b61e9['query'][_0xd318('0x47')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x12e0b3,0xcc))[_0xd318('0x3e')](handleError(_0x12e0b3,null));};exports[_0xd318('0x48')]=function(_0x2b32af,_0x5093e2,_0x18a930){return db['AnalyticCustomReport'][_0xd318('0x49')]({'where':{'id':_0x2b32af[_0xd318('0x3f')]['id']}})[_0xd318('0x21')](handleEntityNotFound(_0x5093e2,null))[_0xd318('0x21')](function(_0x347622){if(_0x347622){return db[_0xd318('0x4a')][_0xd318('0x4b')](function(_0x4b2fc5){return db['AnalyticFieldReport'][_0xd318('0x20')]({'where':{'CustomReportId':_0x2b32af['params']['id']},'transaction':_0x4b2fc5})[_0xd318('0x21')](function(_0x2e5cfb){var _0x21379b=_[_0xd318('0x26')](_0x2b32af[_0xd318('0x44')],function(_0x41ac6d){delete _0x41ac6d['id'];_0x41ac6d[_0xd318('0x4c')]=_0x2b32af['params']['id'];return _0x41ac6d;});return db[_0xd318('0x27')][_0xd318('0x45')](_0x21379b,{'transaction':_0x4b2fc5});});})['then'](function(){return db[_0xd318('0x27')][_0xd318('0x3c')]({'where':{'CustomReportId':_0x2b32af[_0xd318('0x3f')]['id']}});});}})['then'](respondWithResult(_0x5093e2,null))[_0xd318('0x3e')](handleError(_0x5093e2,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 0e6759b..9477c2e 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 _0x55e9=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api'];(function(_0x2a6241,_0x4cfcab){var _0x357401=function(_0x17394c){while(--_0x17394c){_0x2a6241['push'](_0x2a6241['shift']());}};_0x357401(++_0x4cfcab);}(_0x55e9,0xbf));var _0x955e=function(_0x217c2e,_0x358f06){_0x217c2e=_0x217c2e-0x0;var _0x22b7d8=_0x55e9[_0x217c2e];return _0x22b7d8;};'use strict';var _=require(_0x955e('0x0'));var util=require(_0x955e('0x1'));var logger=require(_0x955e('0x2'))(_0x955e('0x3'));var moment=require(_0x955e('0x4'));var BPromise=require(_0x955e('0x5'));var rp=require(_0x955e('0x6'));var fs=require('fs');var path=require(_0x955e('0x7'));var rimraf=require(_0x955e('0x8'));var config=require(_0x955e('0x9'));var attributes=require(_0x955e('0xa'));module[_0x955e('0xb')]=function(_0x14f2f8,_0x112d37){return _0x14f2f8[_0x955e('0xc')](_0x955e('0xd'),attributes,{'tableName':_0x955e('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2a6c=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash'];(function(_0x20a008,_0x463a98){var _0x15cd94=function(_0x519623){while(--_0x519623){_0x20a008['push'](_0x20a008['shift']());}};_0x15cd94(++_0x463a98);}(_0x2a6c,0xa8));var _0xc2a6=function(_0x37b097,_0xcecfd8){_0x37b097=_0x37b097-0x0;var _0x376470=_0x2a6c[_0x37b097];return _0x376470;};'use strict';var _=require(_0xc2a6('0x0'));var util=require('util');var logger=require(_0xc2a6('0x1'))(_0xc2a6('0x2'));var moment=require(_0xc2a6('0x3'));var BPromise=require(_0xc2a6('0x4'));var rp=require(_0xc2a6('0x5'));var fs=require('fs');var path=require(_0xc2a6('0x6'));var rimraf=require('rimraf');var config=require(_0xc2a6('0x7'));var attributes=require(_0xc2a6('0x8'));module[_0xc2a6('0x9')]=function(_0x395e3a,_0x3465b5){return _0x395e3a[_0xc2a6('0xa')](_0xc2a6('0xb'),attributes,{'tableName':_0xc2a6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index 169c52b..1e4b3c5 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 _0x3c62=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x495d4d,_0x244bb1){var _0x30a114=function(_0x108167){while(--_0x108167){_0x495d4d['push'](_0x495d4d['shift']());}};_0x30a114(++_0x244bb1);}(_0x3c62,0x160));var _0x23c6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3c62[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x23c6('0x0'));var util=require(_0x23c6('0x1'));var moment=require(_0x23c6('0x2'));var BPromise=require(_0x23c6('0x3'));var rs=require(_0x23c6('0x4'));var fs=require('fs');var Redis=require(_0x23c6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x23c6('0x6'));var logger=require(_0x23c6('0x7'))(_0x23c6('0x8'));var config=require(_0x23c6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x23c6('0xa')][_0x23c6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3fdd16,_0x2363ca,_0x534ca7){return new BPromise(function(_0x1d6924,_0x1cd567){return client[_0x23c6('0xc')](_0x3fdd16,_0x534ca7)[_0x23c6('0xd')](function(_0x5aba84){logger['info'](_0x23c6('0xe'),_0x2363ca,_0x23c6('0xf'));logger[_0x23c6('0x10')](_0x23c6('0x11'),_0x2363ca,_0x23c6('0xf'),JSON['stringify'](_0x5aba84));if(_0x5aba84[_0x23c6('0x12')]){if(_0x5aba84[_0x23c6('0x12')]['code']===0x1f4){logger['error'](_0x23c6('0xe'),_0x2363ca,_0x5aba84[_0x23c6('0x12')][_0x23c6('0x13')]);return _0x1cd567(_0x5aba84[_0x23c6('0x12')][_0x23c6('0x13')]);}logger['error'](_0x23c6('0xe'),_0x2363ca,_0x5aba84[_0x23c6('0x12')]['message']);return _0x1d6924(_0x5aba84[_0x23c6('0x12')]['message']);}else{logger['info'](_0x23c6('0xe'),_0x2363ca,_0x23c6('0xf'));_0x1d6924(_0x5aba84[_0x23c6('0x14')][_0x23c6('0x13')]);}})['catch'](function(_0x505a10){logger['error'](_0x23c6('0xe'),_0x2363ca,_0x505a10);_0x1cd567(_0x505a10);});});} \ No newline at end of file +var _0x4aff=['info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','error','message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x4aff,0xfd));var _0xf4af=function(_0x4de226,_0xf589ec){_0x4de226=_0x4de226-0x0;var _0x2fb276=_0x4aff[_0x4de226];return _0x2fb276;};'use strict';var _=require(_0xf4af('0x0'));var util=require(_0xf4af('0x1'));var moment=require(_0xf4af('0x2'));var BPromise=require('bluebird');var rs=require(_0xf4af('0x3'));var fs=require('fs');var Redis=require(_0xf4af('0x4'));var db=require(_0xf4af('0x5'))['db'];var utils=require(_0xf4af('0x6'));var logger=require(_0xf4af('0x7'))(_0xf4af('0x8'));var config=require(_0xf4af('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf4af('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x473f75,_0x1fbcf2,_0x4bc3d8){return new BPromise(function(_0x4fc213,_0x2f583d){return client[_0xf4af('0xb')](_0x473f75,_0x4bc3d8)[_0xf4af('0xc')](function(_0xfec765){logger[_0xf4af('0xd')](_0xf4af('0xe'),_0x1fbcf2,_0xf4af('0xf'));logger[_0xf4af('0x10')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x1fbcf2,'request\x20sent',JSON['stringify'](_0xfec765));if(_0xfec765[_0xf4af('0x11')]){if(_0xfec765[_0xf4af('0x11')]['code']===0x1f4){logger[_0xf4af('0x11')](_0xf4af('0xe'),_0x1fbcf2,_0xfec765['error'][_0xf4af('0x12')]);return _0x2f583d(_0xfec765[_0xf4af('0x11')][_0xf4af('0x12')]);}logger[_0xf4af('0x11')](_0xf4af('0xe'),_0x1fbcf2,_0xfec765['error'][_0xf4af('0x12')]);return _0x4fc213(_0xfec765[_0xf4af('0x11')]['message']);}else{logger[_0xf4af('0xd')](_0xf4af('0xe'),_0x1fbcf2,_0xf4af('0xf'));_0x4fc213(_0xfec765['result'][_0xf4af('0x12')]);}})['catch'](function(_0x4a8066){logger[_0xf4af('0x11')](_0xf4af('0xe'),_0x1fbcf2,_0x4a8066);_0x2f583d(_0x4a8066);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 0224b40..5ff481b 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(_0x22848f,_0x312e3e){var _0x2158de=function(_0x237bfe){while(--_0x237bfe){_0x22848f['push'](_0x22848f['shift']());}};_0x2158de(++_0x312e3e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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(_0x199128,_0x38136e){var _0x15f671=function(_0x3b6ae0){while(--_0x3b6ae0){_0x199128['push'](_0x199128['shift']());}};_0x15f671(++_0x38136e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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 8e3dafb..b768675 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 _0xfe57=['TEXT','sequelize','exports','STRING'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0xfe57,0x195));var _0x7fe5=function(_0x133277,_0xb1d6b2){_0x133277=_0x133277-0x0;var _0x5b4a22=_0xfe57[_0x133277];return _0x5b4a22;};'use strict';var Sequelize=require(_0x7fe5('0x0'));module[_0x7fe5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x7fe5('0x2')]},'metric':{'type':Sequelize[_0x7fe5('0x3')]},'description':{'type':Sequelize[_0x7fe5('0x2')]}}; \ No newline at end of file +var _0xfaa4=['exports','STRING','name','TEXT','sequelize'];(function(_0x35a7b3,_0x599a42){var _0x2efcc3=function(_0x2d2697){while(--_0x2d2697){_0x35a7b3['push'](_0x35a7b3['shift']());}};_0x2efcc3(++_0x599a42);}(_0xfaa4,0x1a8));var _0x4faa=function(_0x11cbc6,_0x1e3fd3){_0x11cbc6=_0x11cbc6-0x0;var _0x5efc16=_0xfaa4[_0x11cbc6];return _0x5efc16;};'use strict';var Sequelize=require(_0x4faa('0x0'));module[_0x4faa('0x1')]={'name':{'type':Sequelize[_0x4faa('0x2')],'allowNull':![],'unique':_0x4faa('0x3')},'table':{'type':Sequelize[_0x4faa('0x2')]},'metric':{'type':Sequelize[_0x4faa('0x4')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index bb6f2e9..3d8a4ea 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(_0x5035bc,_0x43ed66){_0x5035bc=_0x5035bc-0x0;var _0x55ecd9=_0x1cb9[_0x5035bc];return _0x55ecd9;};'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 _0x9a19=['AnalyticMetric','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','body','user','UserProfileSection','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','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','offset','undefined','limit','count','set','Content-Range','save','then','destroy','get','Metrics','stack','name','send','index','map'];(function(_0x477c84,_0x5396ac){var _0x2722fa=function(_0x298e4d){while(--_0x298e4d){_0x477c84['push'](_0x477c84['shift']());}};_0x2722fa(++_0x5396ac);}(_0x9a19,0x114));var _0x99a1=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x9a19[_0x1928c9];return _0x51b5fb;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];function respondWithStatusCode(_0x1bc7aa,_0x2ff655){_0x2ff655=_0x2ff655||0xcc;return function(_0x532f56){if(_0x532f56){return _0x1bc7aa[_0x99a1('0x19')](_0x2ff655);}return _0x1bc7aa[_0x99a1('0x1a')](_0x2ff655)[_0x99a1('0x1b')]();};}function respondWithResult(_0x47815e,_0xe1a1f){_0xe1a1f=_0xe1a1f||0xc8;return function(_0x3c9ef4){if(_0x3c9ef4){return _0x47815e[_0x99a1('0x1a')](_0xe1a1f)['json'](_0x3c9ef4);}};}function respondWithFilteredResult(_0x2d81ed,_0x3e45d4){return function(_0x1bb464){if(_0x1bb464){var _0x3d40cc=typeof _0x3e45d4[_0x99a1('0x1c')]===_0x99a1('0x1d')&&typeof _0x3e45d4[_0x99a1('0x1e')]==='undefined';var _0x4f049c=_0x1bb464[_0x99a1('0x1f')];var _0xbf62f1=_0x3d40cc?0x0:_0x3e45d4[_0x99a1('0x1c')];var _0x1fcd00=_0x3d40cc?_0x1bb464[_0x99a1('0x1f')]:_0x3e45d4[_0x99a1('0x1c')]+_0x3e45d4[_0x99a1('0x1e')];var _0x3cd62c;if(_0x1fcd00>=_0x4f049c){_0x1fcd00=_0x4f049c;_0x3cd62c=0xc8;}else{_0x3cd62c=0xce;}_0x2d81ed[_0x99a1('0x1a')](_0x3cd62c);return _0x2d81ed[_0x99a1('0x20')](_0x99a1('0x21'),_0xbf62f1+'-'+_0x1fcd00+'/'+_0x4f049c)['json'](_0x1bb464);}return null;};}function patchUpdates(_0x3023a1){return function(_0x20007e){try{jsonpatch['apply'](_0x20007e,_0x3023a1,!![]);}catch(_0x38435b){return BPromise['reject'](_0x38435b);}return _0x20007e[_0x99a1('0x22')]();};}function saveUpdates(_0x2927b0,_0x2d6f20){return function(_0x2d3b82){if(_0x2d3b82){return _0x2d3b82['update'](_0x2927b0)[_0x99a1('0x23')](function(_0x1268a7){return _0x1268a7;});}return null;};}function removeEntity(_0x483c17,_0x44df2d){return function(_0x5b5dfa){if(_0x5b5dfa){return _0x5b5dfa[_0x99a1('0x24')]()[_0x99a1('0x23')](function(){var _0x179597=_0x5b5dfa[_0x99a1('0x25')]({'plain':!![]});var _0x3c813=_0x99a1('0x26');return db['UserProfileResource'][_0x99a1('0x24')]({'where':{'type':_0x3c813,'resourceId':_0x179597['id']}})['then'](function(){return _0x5b5dfa;});})['then'](function(){_0x483c17[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();});}};}function handleEntityNotFound(_0xa6799b,_0x15a0b6){return function(_0x25d560){if(!_0x25d560){_0xa6799b[_0x99a1('0x19')](0x194);}return _0x25d560;};}function handleError(_0x183037,_0x549645){_0x549645=_0x549645||0x1f4;return function(_0xf41b0d){logger['error'](_0xf41b0d[_0x99a1('0x27')]);if(_0xf41b0d[_0x99a1('0x28')]){delete _0xf41b0d[_0x99a1('0x28')];}_0x183037['status'](_0x549645)[_0x99a1('0x29')](_0xf41b0d);};}exports[_0x99a1('0x2a')]=function(_0x5718b9,_0x37514e){var _0x1434a0={},_0x36aa34={},_0x303d1e={'count':0x0,'rows':[]};var _0x2a5b8c=_[_0x99a1('0x2b')](db[_0x99a1('0x2c')][_0x99a1('0x2d')],function(_0x52da8d){return{'name':_0x52da8d['fieldName'],'type':_0x52da8d[_0x99a1('0x2e')]['key']};});_0x36aa34[_0x99a1('0x2f')]=_[_0x99a1('0x2b')](_0x2a5b8c,'name');_0x36aa34[_0x99a1('0x30')]=_[_0x99a1('0x31')](_0x5718b9[_0x99a1('0x30')]);_0x36aa34[_0x99a1('0x32')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],_0x36aa34[_0x99a1('0x30')]);_0x1434a0[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1434a0[_0x99a1('0x34')]=_0x1434a0['attributes']['length']?_0x1434a0[_0x99a1('0x34')]:_0x36aa34[_0x99a1('0x2f')];if(!_0x5718b9[_0x99a1('0x30')][_0x99a1('0x36')](_0x99a1('0x37'))){_0x1434a0[_0x99a1('0x1e')]=qs[_0x99a1('0x1e')](_0x5718b9['query'][_0x99a1('0x1e')]);_0x1434a0[_0x99a1('0x1c')]=qs['offset'](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x1c')]);}_0x1434a0[_0x99a1('0x38')]=qs[_0x99a1('0x39')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x39')]);_0x1434a0[_0x99a1('0x3a')]=qs[_0x99a1('0x32')](_[_0x99a1('0x3b')](_0x5718b9[_0x99a1('0x30')],_0x36aa34[_0x99a1('0x32')]),_0x2a5b8c);if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]){_0x1434a0['where']=_['merge'](_0x1434a0['where'],{'$or':_[_0x99a1('0x2b')](_0x2a5b8c,function(_0x169df7){if(_0x169df7[_0x99a1('0x2e')]!==_0x99a1('0x3d')){var _0x40613a={};_0x40613a[_0x169df7['name']]={'$like':'%'+_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]+'%'};return _0x40613a;}})});}_0x1434a0=_[_0x99a1('0x3e')]({},_0x1434a0,_0x5718b9['options']);var _0x49be37={'where':_0x1434a0[_0x99a1('0x3a')]};return db[_0x99a1('0x2c')][_0x99a1('0x1f')](_0x49be37)['then'](function(_0x6c4cb){_0x303d1e[_0x99a1('0x1f')]=_0x6c4cb;if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3f')]){_0x1434a0[_0x99a1('0x40')]=[{'all':!![]}];}return db[_0x99a1('0x2c')][_0x99a1('0x41')](_0x1434a0);})[_0x99a1('0x23')](function(_0x1c4ce4){_0x303d1e[_0x99a1('0x42')]=_0x1c4ce4;return _0x303d1e;})['then'](respondWithFilteredResult(_0x37514e,_0x1434a0))[_0x99a1('0x43')](handleError(_0x37514e,null));};exports[_0x99a1('0x44')]=function(_0x3d5373,_0x50d38b){var _0x1beed2={'raw':!![],'where':{'id':_0x3d5373[_0x99a1('0x45')]['id']}},_0x51536d={};_0x51536d[_0x99a1('0x2f')]=_[_0x99a1('0x31')](db[_0x99a1('0x2c')][_0x99a1('0x2d')]);_0x51536d[_0x99a1('0x30')]=_['keys'](_0x3d5373[_0x99a1('0x30')]);_0x51536d['filters']=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],_0x51536d[_0x99a1('0x30')]);_0x1beed2[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x3d5373[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1beed2[_0x99a1('0x34')]=_0x1beed2[_0x99a1('0x34')]['length']?_0x1beed2[_0x99a1('0x34')]:_0x51536d[_0x99a1('0x2f')];if(_0x3d5373['query'][_0x99a1('0x3f')]){_0x1beed2[_0x99a1('0x40')]=[{'all':!![]}];}_0x1beed2=_[_0x99a1('0x3e')]({},_0x1beed2,_0x3d5373[_0x99a1('0x46')]);return db[_0x99a1('0x2c')][_0x99a1('0x47')](_0x1beed2)[_0x99a1('0x23')](handleEntityNotFound(_0x50d38b,null))['then'](respondWithResult(_0x50d38b,null))[_0x99a1('0x43')](handleError(_0x50d38b,null));};exports['create']=function(_0x1d4d3f,_0x269798){return db['AnalyticMetric']['create'](_0x1d4d3f[_0x99a1('0x48')],{})[_0x99a1('0x23')](function(_0x462c15){var _0x4519fb=_0x1d4d3f[_0x99a1('0x49')]['get']({'plain':!![]});if(!_0x4519fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4519fb['role']===_0x99a1('0x49')){var _0x4ae90e=_0x462c15[_0x99a1('0x25')]({'plain':!![]});var _0x30fdfb=_0x99a1('0x26');return db[_0x99a1('0x4a')][_0x99a1('0x47')]({'where':{'name':_0x30fdfb,'userProfileId':_0x4519fb['userProfileId']},'raw':!![]})[_0x99a1('0x23')](function(_0x22bfd8){if(_0x22bfd8&&_0x22bfd8[_0x99a1('0x4b')]===0x0){return db['UserProfileResource'][_0x99a1('0x4c')]({'name':_0x4ae90e['name'],'resourceId':_0x4ae90e['id'],'type':_0x22bfd8['name'],'sectionId':_0x22bfd8['id']},{})[_0x99a1('0x23')](function(){return _0x462c15;});}else{return _0x462c15;}})[_0x99a1('0x43')](function(_0x1dd17b){logger[_0x99a1('0x4d')](_0x99a1('0x4e'),_0x1dd17b);throw _0x1dd17b;});}return _0x462c15;})[_0x99a1('0x23')](respondWithResult(_0x269798,0xc9))[_0x99a1('0x43')](handleError(_0x269798,null));};exports[_0x99a1('0x4f')]=function(_0x16641e,_0x53e9eb){if(_0x16641e[_0x99a1('0x48')]['id']){delete _0x16641e['body']['id'];}return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x16641e['params']['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x53e9eb,null))[_0x99a1('0x23')](saveUpdates(_0x16641e[_0x99a1('0x48')],null))[_0x99a1('0x23')](respondWithResult(_0x53e9eb,null))[_0x99a1('0x43')](handleError(_0x53e9eb,null));};exports[_0x99a1('0x24')]=function(_0x157c49,_0x1a5658){return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x157c49[_0x99a1('0x45')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x1a5658,null))['then'](removeEntity(_0x1a5658,null))['catch'](handleError(_0x1a5658,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index d861cae..722d1eb 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 _0xc1fa=['./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x512973,_0x564e8b){var _0x32f2e1=function(_0x5d5d3b){while(--_0x5d5d3b){_0x512973['push'](_0x512973['shift']());}};_0x32f2e1(++_0x564e8b);}(_0xc1fa,0x83));var _0xac1f=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xc1fa[_0x5f09c5];return _0x426ad9;};'use strict';var _=require(_0xac1f('0x0'));var util=require(_0xac1f('0x1'));var logger=require(_0xac1f('0x2'))(_0xac1f('0x3'));var moment=require(_0xac1f('0x4'));var BPromise=require(_0xac1f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xac1f('0x6'));var rimraf=require(_0xac1f('0x7'));var config=require(_0xac1f('0x8'));var attributes=require(_0xac1f('0x9'));module[_0xac1f('0xa')]=function(_0x4342a5,_0x38bd1d){return _0x4342a5[_0xac1f('0xb')](_0xac1f('0xc'),attributes,{'tableName':_0xac1f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9303=['api','bluebird','rimraf','../../config/environment','./analyticMetric.attributes','exports','analytics_metrics','lodash'];(function(_0xabd460,_0x2bb00a){var _0x4ad7bc=function(_0x2221bf){while(--_0x2221bf){_0xabd460['push'](_0xabd460['shift']());}};_0x4ad7bc(++_0x2bb00a);}(_0x9303,0xd7));var _0x3930=function(_0x46aa6f,_0xf7b072){_0x46aa6f=_0x46aa6f-0x0;var _0x44759c=_0x9303[_0x46aa6f];return _0x44759c;};'use strict';var _=require(_0x3930('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3930('0x1'));var moment=require('moment');var BPromise=require(_0x3930('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3930('0x3'));var config=require(_0x3930('0x4'));var attributes=require(_0x3930('0x5'));module[_0x3930('0x6')]=function(_0x57e19d,_0x44949e){return _0x57e19d['define']('AnalyticMetric',attributes,{'tableName':_0x3930('0x7'),'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 2ddbac7..f6be230 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 _0x7396=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','info','result','moment','bluebird'];(function(_0xad35f7,_0x2498b2){var _0x32d300=function(_0x3987cb){while(--_0x3987cb){_0xad35f7['push'](_0xad35f7['shift']());}};_0x32d300(++_0x2498b2);}(_0x7396,0x18a));var _0x6739=function(_0x3645ac,_0x5027b3){_0x3645ac=_0x3645ac-0x0;var _0x3772b9=_0x7396[_0x3645ac];return _0x3772b9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6739('0x0'));var BPromise=require(_0x6739('0x1'));var rs=require(_0x6739('0x2'));var fs=require('fs');var Redis=require(_0x6739('0x3'));var db=require(_0x6739('0x4'))['db'];var utils=require(_0x6739('0x5'));var logger=require(_0x6739('0x6'))(_0x6739('0x7'));var config=require(_0x6739('0x8'));var jayson=require(_0x6739('0x9'));var client=jayson[_0x6739('0xa')][_0x6739('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36e2f5,_0x434c2b,_0x4c1bb0){return new BPromise(function(_0x4869a9,_0x4668f8){return client['request'](_0x36e2f5,_0x4c1bb0)[_0x6739('0xc')](function(_0x216381){logger['info'](_0x6739('0xd'),_0x434c2b,_0x6739('0xe'));logger[_0x6739('0xf')](_0x6739('0x10'),_0x434c2b,'request\x20sent',JSON['stringify'](_0x216381));if(_0x216381[_0x6739('0x11')]){if(_0x216381['error'][_0x6739('0x12')]===0x1f4){logger[_0x6739('0x11')](_0x6739('0xd'),_0x434c2b,_0x216381[_0x6739('0x11')][_0x6739('0x13')]);return _0x4668f8(_0x216381[_0x6739('0x11')][_0x6739('0x13')]);}logger[_0x6739('0x11')](_0x6739('0xd'),_0x434c2b,_0x216381['error'][_0x6739('0x13')]);return _0x4869a9(_0x216381[_0x6739('0x11')]['message']);}else{logger[_0x6739('0x14')](_0x6739('0xd'),_0x434c2b,_0x6739('0xe'));_0x4869a9(_0x216381[_0x6739('0x15')]['message']);}})['catch'](function(_0x464fb3){logger[_0x6739('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x434c2b,_0x464fb3);_0x4668f8(_0x464fb3);});});} \ No newline at end of file +var _0x84b2=['client','http','then','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','ioredis','rpc','../../config/environment'];(function(_0x37acc3,_0x3a7786){var _0x4d00ba=function(_0xfd3917){while(--_0xfd3917){_0x37acc3['push'](_0x37acc3['shift']());}};_0x4d00ba(++_0x3a7786);}(_0x84b2,0x1cb));var _0x284b=function(_0x5efc1c,_0x14885){_0x5efc1c=_0x5efc1c-0x0;var _0x159b8c=_0x84b2[_0x5efc1c];return _0x159b8c;};'use strict';var _=require(_0x284b('0x0'));var util=require('util');var moment=require(_0x284b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x284b('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x284b('0x3'));var config=require(_0x284b('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x284b('0x5')][_0x284b('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5e74c8,_0x496a79,_0x3d1013){return new BPromise(function(_0x536110,_0xaad315){return client['request'](_0x5e74c8,_0x3d1013)[_0x284b('0x7')](function(_0xe8047a){logger[_0x284b('0x8')](_0x284b('0x9'),_0x496a79,'request\x20sent');logger[_0x284b('0xa')](_0x284b('0xb'),_0x496a79,'request\x20sent',JSON['stringify'](_0xe8047a));if(_0xe8047a[_0x284b('0xc')]){if(_0xe8047a[_0x284b('0xc')][_0x284b('0xd')]===0x1f4){logger[_0x284b('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x496a79,_0xe8047a['error'][_0x284b('0xe')]);return _0xaad315(_0xe8047a[_0x284b('0xc')][_0x284b('0xe')]);}logger[_0x284b('0xc')](_0x284b('0x9'),_0x496a79,_0xe8047a[_0x284b('0xc')][_0x284b('0xe')]);return _0x536110(_0xe8047a[_0x284b('0xc')][_0x284b('0xe')]);}else{logger[_0x284b('0x8')](_0x284b('0x9'),_0x496a79,'request\x20sent');_0x536110(_0xe8047a['result'][_0x284b('0xe')]);}})[_0x284b('0xf')](function(_0x206b02){logger[_0x284b('0xc')](_0x284b('0x9'),_0x496a79,_0x206b02);_0xaad315(_0x206b02);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 64885fb..c9d1569 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 _0xc2d6=['index','get','post','create','update','delete','/:id','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','isAuthenticated'];(function(_0x1dcb61,_0x533143){var _0x275729=function(_0x1987eb){while(--_0x1987eb){_0x1dcb61['push'](_0x1dcb61['shift']());}};_0x275729(++_0x533143);}(_0xc2d6,0x171));var _0x6c2d=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xc2d6[_0x220dbb];return _0x2b77de;};'use strict';var multer=require('multer');var util=require(_0x6c2d('0x0'));var path=require(_0x6c2d('0x1'));var timeout=require(_0x6c2d('0x2'));var express=require(_0x6c2d('0x3'));var router=express[_0x6c2d('0x4')]();var fs_extra=require(_0x6c2d('0x5'));var auth=require(_0x6c2d('0x6'));var interaction=require(_0x6c2d('0x7'));var config=require(_0x6c2d('0x8'));var controller=require(_0x6c2d('0x9'));router['get']('/',auth[_0x6c2d('0xa')](),controller[_0x6c2d('0xb')]);router[_0x6c2d('0xc')]('/:id',auth[_0x6c2d('0xa')](),controller['show']);router[_0x6c2d('0xd')]('/',auth[_0x6c2d('0xa')](),controller[_0x6c2d('0xe')]);router['put']('/:id',auth[_0x6c2d('0xa')](),controller[_0x6c2d('0xf')]);router[_0x6c2d('0x10')](_0x6c2d('0x11'),auth['isAuthenticated'](),controller[_0x6c2d('0x12')]);module[_0x6c2d('0x13')]=router; \ No newline at end of file +var _0x8c32=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','index','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x1bc42b,_0x5f38c0){var _0x193af5=function(_0x539fb8){while(--_0x539fb8){_0x1bc42b['push'](_0x1bc42b['shift']());}};_0x193af5(++_0x5f38c0);}(_0x8c32,0x130));var _0x28c3=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x8c32[_0x36ed48];return _0x51c63a;};'use strict';var multer=require(_0x28c3('0x0'));var util=require(_0x28c3('0x1'));var path=require(_0x28c3('0x2'));var timeout=require(_0x28c3('0x3'));var express=require(_0x28c3('0x4'));var router=express[_0x28c3('0x5')]();var fs_extra=require(_0x28c3('0x6'));var auth=require(_0x28c3('0x7'));var interaction=require(_0x28c3('0x8'));var config=require(_0x28c3('0x9'));var controller=require(_0x28c3('0xa'));router[_0x28c3('0xb')]('/',auth['isAuthenticated'](),controller[_0x28c3('0xc')]);router[_0x28c3('0xb')](_0x28c3('0xd'),auth[_0x28c3('0xe')](),controller[_0x28c3('0xf')]);router[_0x28c3('0x10')]('/',auth['isAuthenticated'](),controller[_0x28c3('0x11')]);router[_0x28c3('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x28c3('0x13')](_0x28c3('0xd'),auth['isAuthenticated'](),controller[_0x28c3('0x14')]);module[_0x28c3('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index e10d884..2f95416 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 _0xeacc=['TEXT','sequelize','exports'];(function(_0x239013,_0x4b6af3){var _0x1f80af=function(_0x4b9517){while(--_0x4b9517){_0x239013['push'](_0x239013['shift']());}};_0x1f80af(++_0x4b6af3);}(_0xeacc,0x1e4));var _0xceac=function(_0x9e48b,_0x210358){_0x9e48b=_0x9e48b-0x0;var _0x1aeb1c=_0xeacc[_0x9e48b];return _0x1aeb1c;};'use strict';var Sequelize=require(_0xceac('0x0'));module[_0xceac('0x1')]={'tree':{'type':Sequelize[_0xceac('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xafdb=['exports','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xafdb,0x77));var _0xbafd=function(_0x146a97,_0x2d8483){_0x146a97=_0x146a97-0x0;var _0x259d5c=_0xafdb[_0x146a97];return _0x259d5c;};'use strict';var Sequelize=require(_0xbafd('0x0'));module[_0xbafd('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 813d854..eca5e45 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 _0xd53b=['length','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','includeAll','findAll','rows','show','rawAttributes','include','find','catch','create','body','params','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../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','send','index','map','AnalyticTreeReport','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes'];(function(_0xe0c60e,_0x3aa1af){var _0x27914f=function(_0x4213e5){while(--_0x4213e5){_0xe0c60e['push'](_0xe0c60e['shift']());}};_0x27914f(++_0x3aa1af);}(_0xd53b,0x65));var _0xbd53=function(_0x432346,_0x5a4f27){_0x432346=_0x432346-0x0;var _0x4f6238=_0xd53b[_0x432346];return _0x4f6238;};'use strict';var emlformat=require(_0xbd53('0x0'));var rimraf=require(_0xbd53('0x1'));var zipdir=require(_0xbd53('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbd53('0x3'));var moment=require(_0xbd53('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbd53('0x5'));var path=require(_0xbd53('0x6'));var sox=require(_0xbd53('0x7'));var csv=require(_0xbd53('0x8'));var ejs=require(_0xbd53('0x9'));var fs=require('fs');var fs_extra=require(_0xbd53('0xa'));var _=require(_0xbd53('0xb'));var squel=require('squel');var crypto=require(_0xbd53('0xc'));var jsforce=require(_0xbd53('0xd'));var deskjs=require(_0xbd53('0xe'));var toCsv=require(_0xbd53('0x8'));var querystring=require(_0xbd53('0xf'));var Papa=require(_0xbd53('0x10'));var Redis=require(_0xbd53('0x11'));var authService=require(_0xbd53('0x12'));var qs=require(_0xbd53('0x13'));var as=require(_0xbd53('0x14'));var hardwareService=require(_0xbd53('0x15'));var logger=require(_0xbd53('0x16'))(_0xbd53('0x17'));var utils=require(_0xbd53('0x18'));var config=require(_0xbd53('0x19'));var licenseUtil=require(_0xbd53('0x1a'));var db=require(_0xbd53('0x1b'))['db'];function respondWithStatusCode(_0x1801f2,_0x37dbca){_0x37dbca=_0x37dbca||0xcc;return function(_0x3223e6){if(_0x3223e6){return _0x1801f2[_0xbd53('0x1c')](_0x37dbca);}return _0x1801f2[_0xbd53('0x1d')](_0x37dbca)['end']();};}function respondWithResult(_0x36f41f,_0x1dac71){_0x1dac71=_0x1dac71||0xc8;return function(_0x515300){if(_0x515300){return _0x36f41f[_0xbd53('0x1d')](_0x1dac71)[_0xbd53('0x1e')](_0x515300);}};}function respondWithFilteredResult(_0x4fd763,_0x47216b){return function(_0x5ad25b){if(_0x5ad25b){var _0x286117=typeof _0x47216b[_0xbd53('0x1f')]===_0xbd53('0x20')&&typeof _0x47216b[_0xbd53('0x21')]===_0xbd53('0x20');var _0x59e17a=_0x5ad25b[_0xbd53('0x22')];var _0x1525d6=_0x286117?0x0:_0x47216b[_0xbd53('0x1f')];var _0x3d9686=_0x286117?_0x5ad25b[_0xbd53('0x22')]:_0x47216b[_0xbd53('0x1f')]+_0x47216b[_0xbd53('0x21')];var _0x24bf78;if(_0x3d9686>=_0x59e17a){_0x3d9686=_0x59e17a;_0x24bf78=0xc8;}else{_0x24bf78=0xce;}_0x4fd763[_0xbd53('0x1d')](_0x24bf78);return _0x4fd763[_0xbd53('0x23')](_0xbd53('0x24'),_0x1525d6+'-'+_0x3d9686+'/'+_0x59e17a)['json'](_0x5ad25b);}return null;};}function patchUpdates(_0x252cac){return function(_0x40de83){try{jsonpatch[_0xbd53('0x25')](_0x40de83,_0x252cac,!![]);}catch(_0x1eb9dc){return BPromise[_0xbd53('0x26')](_0x1eb9dc);}return _0x40de83[_0xbd53('0x27')]();};}function saveUpdates(_0x1837c6,_0x2ef9be){return function(_0x3bdc69){if(_0x3bdc69){return _0x3bdc69[_0xbd53('0x28')](_0x1837c6)[_0xbd53('0x29')](function(_0xf0f7d3){return _0xf0f7d3;});}return null;};}function removeEntity(_0x430e17,_0x39f9ab){return function(_0x3aee6b){if(_0x3aee6b){return _0x3aee6b[_0xbd53('0x2a')]()[_0xbd53('0x29')](function(){_0x430e17[_0xbd53('0x1d')](0xcc)[_0xbd53('0x2b')]();});}};}function handleEntityNotFound(_0x1e1610,_0x3e0366){return function(_0x4ac649){if(!_0x4ac649){_0x1e1610[_0xbd53('0x1c')](0x194);}return _0x4ac649;};}function handleError(_0x38bcbd,_0x5f2a3c){_0x5f2a3c=_0x5f2a3c||0x1f4;return function(_0x3959ab){logger[_0xbd53('0x2c')](_0x3959ab[_0xbd53('0x2d')]);if(_0x3959ab['name']){delete _0x3959ab['name'];}_0x38bcbd['status'](_0x5f2a3c)[_0xbd53('0x2e')](_0x3959ab);};}exports[_0xbd53('0x2f')]=function(_0xd68763,_0x511b74){var _0x41d836={},_0x44cd00={},_0x122aa0={'count':0x0,'rows':[]};var _0x56c752=_[_0xbd53('0x30')](db[_0xbd53('0x31')]['rawAttributes'],function(_0x29cc86){return{'name':_0x29cc86[_0xbd53('0x32')],'type':_0x29cc86[_0xbd53('0x33')][_0xbd53('0x34')]};});_0x44cd00[_0xbd53('0x35')]=_['map'](_0x56c752,_0xbd53('0x36'));_0x44cd00[_0xbd53('0x37')]=_[_0xbd53('0x38')](_0xd68763[_0xbd53('0x37')]);_0x44cd00[_0xbd53('0x39')]=_['intersection'](_0x44cd00[_0xbd53('0x35')],_0x44cd00[_0xbd53('0x37')]);_0x41d836['attributes']=_[_0xbd53('0x3a')](_0x44cd00[_0xbd53('0x35')],qs[_0xbd53('0x3b')](_0xd68763['query']['fields']));_0x41d836[_0xbd53('0x3c')]=_0x41d836[_0xbd53('0x3c')][_0xbd53('0x3d')]?_0x41d836[_0xbd53('0x3c')]:_0x44cd00['model'];if(!_0xd68763[_0xbd53('0x37')][_0xbd53('0x3e')](_0xbd53('0x3f'))){_0x41d836[_0xbd53('0x21')]=qs[_0xbd53('0x21')](_0xd68763[_0xbd53('0x37')][_0xbd53('0x21')]);_0x41d836[_0xbd53('0x1f')]=qs[_0xbd53('0x1f')](_0xd68763['query'][_0xbd53('0x1f')]);}_0x41d836[_0xbd53('0x40')]=qs['sort'](_0xd68763[_0xbd53('0x37')]['sort']);_0x41d836[_0xbd53('0x41')]=qs[_0xbd53('0x39')](_[_0xbd53('0x42')](_0xd68763[_0xbd53('0x37')],_0x44cd00[_0xbd53('0x39')]),_0x56c752);if(_0xd68763['query'][_0xbd53('0x43')]){_0x41d836[_0xbd53('0x41')]=_[_0xbd53('0x44')](_0x41d836[_0xbd53('0x41')],{'$or':_[_0xbd53('0x30')](_0x56c752,function(_0x4ca719){if(_0x4ca719[_0xbd53('0x33')]!=='VIRTUAL'){var _0x4a6698={};_0x4a6698[_0x4ca719[_0xbd53('0x36')]]={'$like':'%'+_0xd68763[_0xbd53('0x37')][_0xbd53('0x43')]+'%'};return _0x4a6698;}})});}_0x41d836=_['merge']({},_0x41d836,_0xd68763[_0xbd53('0x45')]);var _0x1ac0ba={'where':_0x41d836[_0xbd53('0x41')]};return db[_0xbd53('0x31')][_0xbd53('0x22')](_0x1ac0ba)[_0xbd53('0x29')](function(_0x47e25b){_0x122aa0[_0xbd53('0x22')]=_0x47e25b;if(_0xd68763['query'][_0xbd53('0x46')]){_0x41d836['include']=[{'all':!![]}];}return db[_0xbd53('0x31')][_0xbd53('0x47')](_0x41d836);})[_0xbd53('0x29')](function(_0x132b93){_0x122aa0[_0xbd53('0x48')]=_0x132b93;return _0x122aa0;})[_0xbd53('0x29')](respondWithFilteredResult(_0x511b74,_0x41d836))['catch'](handleError(_0x511b74,null));};exports[_0xbd53('0x49')]=function(_0x2da3a7,_0x257833){var _0x33494c={'raw':!![],'where':{'id':_0x2da3a7['params']['id']}},_0x46dc23={};_0x46dc23['model']=_[_0xbd53('0x38')](db[_0xbd53('0x31')][_0xbd53('0x4a')]);_0x46dc23['query']=_['keys'](_0x2da3a7['query']);_0x46dc23[_0xbd53('0x39')]=_['intersection'](_0x46dc23[_0xbd53('0x35')],_0x46dc23['query']);_0x33494c['attributes']=_[_0xbd53('0x3a')](_0x46dc23[_0xbd53('0x35')],qs[_0xbd53('0x3b')](_0x2da3a7[_0xbd53('0x37')][_0xbd53('0x3b')]));_0x33494c['attributes']=_0x33494c[_0xbd53('0x3c')]['length']?_0x33494c[_0xbd53('0x3c')]:_0x46dc23['model'];if(_0x2da3a7[_0xbd53('0x37')][_0xbd53('0x46')]){_0x33494c[_0xbd53('0x4b')]=[{'all':!![]}];}_0x33494c=_[_0xbd53('0x44')]({},_0x33494c,_0x2da3a7[_0xbd53('0x45')]);return db[_0xbd53('0x31')][_0xbd53('0x4c')](_0x33494c)[_0xbd53('0x29')](handleEntityNotFound(_0x257833,null))[_0xbd53('0x29')](respondWithResult(_0x257833,null))[_0xbd53('0x4d')](handleError(_0x257833,null));};exports[_0xbd53('0x4e')]=function(_0x12f73d,_0x274f44){return db[_0xbd53('0x31')][_0xbd53('0x4e')](_0x12f73d[_0xbd53('0x4f')],{})[_0xbd53('0x29')](respondWithResult(_0x274f44,0xc9))[_0xbd53('0x4d')](handleError(_0x274f44,null));};exports[_0xbd53('0x28')]=function(_0x3022d5,_0x336669){if(_0x3022d5[_0xbd53('0x4f')]['id']){delete _0x3022d5[_0xbd53('0x4f')]['id'];}return db[_0xbd53('0x31')][_0xbd53('0x4c')]({'where':{'id':_0x3022d5['params']['id']}})[_0xbd53('0x29')](handleEntityNotFound(_0x336669,null))['then'](saveUpdates(_0x3022d5[_0xbd53('0x4f')],null))[_0xbd53('0x29')](respondWithResult(_0x336669,null))['catch'](handleError(_0x336669,null));};exports[_0xbd53('0x2a')]=function(_0x4de38d,_0xea67e6){return db[_0xbd53('0x31')][_0xbd53('0x4c')]({'where':{'id':_0x4de38d[_0xbd53('0x50')]['id']}})['then'](handleEntityNotFound(_0xea67e6,null))['then'](removeEntity(_0xea67e6,null))[_0xbd53('0x4d')](handleError(_0xea67e6,null));}; \ No newline at end of file +var _0xc6fd=['Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','AnalyticTreeReport','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','rawAttributes','keys','includeAll','create','body','find','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','set'];(function(_0x571609,_0x4e139a){var _0x384592=function(_0x4e9d41){while(--_0x4e9d41){_0x571609['push'](_0x571609['shift']());}};_0x384592(++_0x4e139a);}(_0xc6fd,0x1d4));var _0xdc6f=function(_0x42356b,_0x39cb18){_0x42356b=_0x42356b-0x0;var _0x3efe78=_0xc6fd[_0x42356b];return _0x3efe78;};'use strict';var emlformat=require(_0xdc6f('0x0'));var rimraf=require(_0xdc6f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdc6f('0x2'));var rp=require('request-promise');var moment=require(_0xdc6f('0x3'));var BPromise=require(_0xdc6f('0x4'));var Mustache=require('mustache');var util=require(_0xdc6f('0x5'));var path=require(_0xdc6f('0x6'));var sox=require('sox');var csv=require(_0xdc6f('0x7'));var ejs=require(_0xdc6f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdc6f('0x9'));var squel=require(_0xdc6f('0xa'));var crypto=require('crypto');var jsforce=require(_0xdc6f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xdc6f('0x7'));var querystring=require(_0xdc6f('0xc'));var Papa=require('papaparse');var Redis=require(_0xdc6f('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdc6f('0xe'));var hardwareService=require(_0xdc6f('0xf'));var logger=require(_0xdc6f('0x10'))(_0xdc6f('0x11'));var utils=require(_0xdc6f('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdc6f('0x13'))['db'];function respondWithStatusCode(_0x4bee0c,_0x343531){_0x343531=_0x343531||0xcc;return function(_0x30fb71){if(_0x30fb71){return _0x4bee0c[_0xdc6f('0x14')](_0x343531);}return _0x4bee0c['status'](_0x343531)[_0xdc6f('0x15')]();};}function respondWithResult(_0x52ac65,_0x5556ea){_0x5556ea=_0x5556ea||0xc8;return function(_0x35eb92){if(_0x35eb92){return _0x52ac65['status'](_0x5556ea)[_0xdc6f('0x16')](_0x35eb92);}};}function respondWithFilteredResult(_0x346a43,_0x261d0d){return function(_0x222e01){if(_0x222e01){var _0x3d44d9=typeof _0x261d0d[_0xdc6f('0x17')]===_0xdc6f('0x18')&&typeof _0x261d0d['limit']===_0xdc6f('0x18');var _0x51e77f=_0x222e01[_0xdc6f('0x19')];var _0x365ccb=_0x3d44d9?0x0:_0x261d0d[_0xdc6f('0x17')];var _0x21e205=_0x3d44d9?_0x222e01[_0xdc6f('0x19')]:_0x261d0d['offset']+_0x261d0d[_0xdc6f('0x1a')];var _0x596616;if(_0x21e205>=_0x51e77f){_0x21e205=_0x51e77f;_0x596616=0xc8;}else{_0x596616=0xce;}_0x346a43[_0xdc6f('0x1b')](_0x596616);return _0x346a43[_0xdc6f('0x1c')](_0xdc6f('0x1d'),_0x365ccb+'-'+_0x21e205+'/'+_0x51e77f)[_0xdc6f('0x16')](_0x222e01);}return null;};}function patchUpdates(_0x5e0d62){return function(_0x1ec541){try{jsonpatch[_0xdc6f('0x1e')](_0x1ec541,_0x5e0d62,!![]);}catch(_0x547a09){return BPromise[_0xdc6f('0x1f')](_0x547a09);}return _0x1ec541[_0xdc6f('0x20')]();};}function saveUpdates(_0x804833,_0x5cbfb6){return function(_0x5b8580){if(_0x5b8580){return _0x5b8580[_0xdc6f('0x21')](_0x804833)[_0xdc6f('0x22')](function(_0x54e005){return _0x54e005;});}return null;};}function removeEntity(_0xd35e24,_0x2288a5){return function(_0x1c98e4){if(_0x1c98e4){return _0x1c98e4[_0xdc6f('0x23')]()[_0xdc6f('0x22')](function(){_0xd35e24[_0xdc6f('0x1b')](0xcc)[_0xdc6f('0x15')]();});}};}function handleEntityNotFound(_0x5459a2,_0x2f8d8a){return function(_0x55c838){if(!_0x55c838){_0x5459a2[_0xdc6f('0x14')](0x194);}return _0x55c838;};}function handleError(_0x49a228,_0x58e621){_0x58e621=_0x58e621||0x1f4;return function(_0x257a69){logger[_0xdc6f('0x24')](_0x257a69[_0xdc6f('0x25')]);if(_0x257a69[_0xdc6f('0x26')]){delete _0x257a69[_0xdc6f('0x26')];}_0x49a228[_0xdc6f('0x1b')](_0x58e621)[_0xdc6f('0x27')](_0x257a69);};}exports['index']=function(_0x10fb50,_0x1b8020){var _0x7632de={},_0x22e2bd={},_0x78b1d9={'count':0x0,'rows':[]};var _0x54d286=_[_0xdc6f('0x28')](db[_0xdc6f('0x29')]['rawAttributes'],function(_0x54097c){return{'name':_0x54097c['fieldName'],'type':_0x54097c[_0xdc6f('0x2a')][_0xdc6f('0x2b')]};});_0x22e2bd[_0xdc6f('0x2c')]=_[_0xdc6f('0x28')](_0x54d286,_0xdc6f('0x26'));_0x22e2bd[_0xdc6f('0x2d')]=_['keys'](_0x10fb50[_0xdc6f('0x2d')]);_0x22e2bd[_0xdc6f('0x2e')]=_[_0xdc6f('0x2f')](_0x22e2bd[_0xdc6f('0x2c')],_0x22e2bd['query']);_0x7632de[_0xdc6f('0x30')]=_[_0xdc6f('0x2f')](_0x22e2bd[_0xdc6f('0x2c')],qs[_0xdc6f('0x31')](_0x10fb50[_0xdc6f('0x2d')][_0xdc6f('0x31')]));_0x7632de['attributes']=_0x7632de[_0xdc6f('0x30')][_0xdc6f('0x32')]?_0x7632de[_0xdc6f('0x30')]:_0x22e2bd['model'];if(!_0x10fb50[_0xdc6f('0x2d')]['hasOwnProperty'](_0xdc6f('0x33'))){_0x7632de['limit']=qs['limit'](_0x10fb50[_0xdc6f('0x2d')][_0xdc6f('0x1a')]);_0x7632de[_0xdc6f('0x17')]=qs[_0xdc6f('0x17')](_0x10fb50[_0xdc6f('0x2d')][_0xdc6f('0x17')]);}_0x7632de[_0xdc6f('0x34')]=qs[_0xdc6f('0x35')](_0x10fb50['query'][_0xdc6f('0x35')]);_0x7632de[_0xdc6f('0x36')]=qs[_0xdc6f('0x2e')](_[_0xdc6f('0x37')](_0x10fb50[_0xdc6f('0x2d')],_0x22e2bd[_0xdc6f('0x2e')]),_0x54d286);if(_0x10fb50[_0xdc6f('0x2d')][_0xdc6f('0x38')]){_0x7632de['where']=_[_0xdc6f('0x39')](_0x7632de['where'],{'$or':_[_0xdc6f('0x28')](_0x54d286,function(_0x2bbba9){if(_0x2bbba9[_0xdc6f('0x2a')]!=='VIRTUAL'){var _0x47b7ae={};_0x47b7ae[_0x2bbba9[_0xdc6f('0x26')]]={'$like':'%'+_0x10fb50[_0xdc6f('0x2d')][_0xdc6f('0x38')]+'%'};return _0x47b7ae;}})});}_0x7632de=_[_0xdc6f('0x39')]({},_0x7632de,_0x10fb50[_0xdc6f('0x3a')]);var _0x267d39={'where':_0x7632de[_0xdc6f('0x36')]};return db['AnalyticTreeReport']['count'](_0x267d39)[_0xdc6f('0x22')](function(_0x2c1e99){_0x78b1d9[_0xdc6f('0x19')]=_0x2c1e99;if(_0x10fb50[_0xdc6f('0x2d')]['includeAll']){_0x7632de[_0xdc6f('0x3b')]=[{'all':!![]}];}return db[_0xdc6f('0x29')][_0xdc6f('0x3c')](_0x7632de);})[_0xdc6f('0x22')](function(_0x42cba5){_0x78b1d9[_0xdc6f('0x3d')]=_0x42cba5;return _0x78b1d9;})[_0xdc6f('0x22')](respondWithFilteredResult(_0x1b8020,_0x7632de))[_0xdc6f('0x3e')](handleError(_0x1b8020,null));};exports[_0xdc6f('0x3f')]=function(_0x5dc064,_0x3db329){var _0x3838af={'raw':!![],'where':{'id':_0x5dc064[_0xdc6f('0x40')]['id']}},_0x3b95cb={};_0x3b95cb[_0xdc6f('0x2c')]=_['keys'](db['AnalyticTreeReport'][_0xdc6f('0x41')]);_0x3b95cb[_0xdc6f('0x2d')]=_[_0xdc6f('0x42')](_0x5dc064['query']);_0x3b95cb['filters']=_[_0xdc6f('0x2f')](_0x3b95cb[_0xdc6f('0x2c')],_0x3b95cb[_0xdc6f('0x2d')]);_0x3838af[_0xdc6f('0x30')]=_[_0xdc6f('0x2f')](_0x3b95cb['model'],qs[_0xdc6f('0x31')](_0x5dc064['query']['fields']));_0x3838af['attributes']=_0x3838af[_0xdc6f('0x30')]['length']?_0x3838af[_0xdc6f('0x30')]:_0x3b95cb[_0xdc6f('0x2c')];if(_0x5dc064[_0xdc6f('0x2d')][_0xdc6f('0x43')]){_0x3838af['include']=[{'all':!![]}];}_0x3838af=_[_0xdc6f('0x39')]({},_0x3838af,_0x5dc064[_0xdc6f('0x3a')]);return db[_0xdc6f('0x29')]['find'](_0x3838af)[_0xdc6f('0x22')](handleEntityNotFound(_0x3db329,null))[_0xdc6f('0x22')](respondWithResult(_0x3db329,null))[_0xdc6f('0x3e')](handleError(_0x3db329,null));};exports['create']=function(_0x1bc425,_0x2b8a30){return db['AnalyticTreeReport'][_0xdc6f('0x44')](_0x1bc425[_0xdc6f('0x45')],{})[_0xdc6f('0x22')](respondWithResult(_0x2b8a30,0xc9))[_0xdc6f('0x3e')](handleError(_0x2b8a30,null));};exports[_0xdc6f('0x21')]=function(_0x2715b3,_0x31c7bf){if(_0x2715b3['body']['id']){delete _0x2715b3[_0xdc6f('0x45')]['id'];}return db[_0xdc6f('0x29')][_0xdc6f('0x46')]({'where':{'id':_0x2715b3[_0xdc6f('0x40')]['id']}})[_0xdc6f('0x22')](handleEntityNotFound(_0x31c7bf,null))[_0xdc6f('0x22')](saveUpdates(_0x2715b3[_0xdc6f('0x45')],null))['then'](respondWithResult(_0x31c7bf,null))[_0xdc6f('0x3e')](handleError(_0x31c7bf,null));};exports['destroy']=function(_0x28e90d,_0x3536e7){return db[_0xdc6f('0x29')]['find']({'where':{'id':_0x28e90d[_0xdc6f('0x40')]['id']}})['then'](handleEntityNotFound(_0x3536e7,null))[_0xdc6f('0x22')](removeEntity(_0x3536e7,null))[_0xdc6f('0x3e')](handleError(_0x3536e7,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 4a7a1a0..fd0acd1 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 _0x67ff=['lodash','util','../../config/logger','bluebird','request-promise','rimraf','./analyticTreeReport.attributes','define','analytics_report_trees'];(function(_0x4eb913,_0xcbd670){var _0x5e0c78=function(_0x136cf){while(--_0x136cf){_0x4eb913['push'](_0x4eb913['shift']());}};_0x5e0c78(++_0xcbd670);}(_0x67ff,0x129));var _0xf67f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x67ff[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xf67f('0x0'));var util=require(_0xf67f('0x1'));var logger=require(_0xf67f('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf67f('0x3'));var rp=require(_0xf67f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf67f('0x5'));var config=require('../../config/environment');var attributes=require(_0xf67f('0x6'));module['exports']=function(_0x40b0d4,_0x3c9400){return _0x40b0d4[_0xf67f('0x7')]('AnalyticTreeReport',attributes,{'tableName':_0xf67f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x30b7=['rimraf','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','api','bluebird','path'];(function(_0x562fd7,_0x272019){var _0x573f4b=function(_0x514850){while(--_0x514850){_0x562fd7['push'](_0x562fd7['shift']());}};_0x573f4b(++_0x272019);}(_0x30b7,0x183));var _0x730b=function(_0x1cf568,_0x269629){_0x1cf568=_0x1cf568-0x0;var _0x5f2325=_0x30b7[_0x1cf568];return _0x5f2325;};'use strict';var _=require(_0x730b('0x0'));var util=require('util');var logger=require(_0x730b('0x1'))(_0x730b('0x2'));var moment=require('moment');var BPromise=require(_0x730b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x730b('0x4'));var rimraf=require(_0x730b('0x5'));var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x4da88d,_0xcbca00){return _0x4da88d['define'](_0x730b('0x6'),attributes,{'tableName':_0x730b('0x7'),'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 1f58196..0f251d9 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x10c4d6,_0xd9091c){var _0x39fb70=function(_0x40953d){while(--_0x40953d){_0x10c4d6['push'](_0x10c4d6['shift']());}};_0x39fb70(++_0xd9091c);}(_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')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x621cf2,_0x3ddaee){var _0x230c70=function(_0x143bf1){while(--_0x143bf1){_0x621cf2['push'](_0x621cf2['shift']());}};_0x230c70(++_0x3ddaee);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4cfb3a,_0x3a0b99){_0x4cfb3a=_0x4cfb3a-0x0;var _0x5480dd=_0x5f2f[_0x4cfb3a];return _0x5480dd;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 7000cc0..e6c1539 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 _0x5c96=['delete','destroy','exports','util','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update'];(function(_0x503d48,_0x42e5a9){var _0x59743e=function(_0x496dbd){while(--_0x496dbd){_0x503d48['push'](_0x503d48['shift']());}};_0x59743e(++_0x42e5a9);}(_0x5c96,0x8b));var _0x65c9=function(_0x8e843f,_0x1af0e8){_0x8e843f=_0x8e843f-0x0;var _0x4cb235=_0x5c96[_0x8e843f];return _0x4cb235;};'use strict';var multer=require('multer');var util=require(_0x65c9('0x0'));var path=require(_0x65c9('0x1'));var timeout=require('connect-timeout');var express=require(_0x65c9('0x2'));var router=express[_0x65c9('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x65c9('0x4'));var config=require(_0x65c9('0x5'));var controller=require('./analyticTreeReport.controller');router[_0x65c9('0x6')]('/',auth[_0x65c9('0x7')](),controller[_0x65c9('0x8')]);router['get'](_0x65c9('0x9'),auth[_0x65c9('0x7')](),controller['show']);router[_0x65c9('0xa')]('/',auth[_0x65c9('0x7')](),controller[_0x65c9('0xb')]);router[_0x65c9('0xc')]('/:id',auth[_0x65c9('0x7')](),controller[_0x65c9('0xd')]);router[_0x65c9('0xe')](_0x65c9('0x9'),auth[_0x65c9('0x7')](),controller[_0x65c9('0xf')]);module[_0x65c9('0x10')]=router; \ No newline at end of file +var _0xf7bf=['connect-timeout','Router','fs-extra','../../components/interaction/service','./analyticTreeReport.controller','get','index','/:id','show','post','isAuthenticated','create','put','update','delete','exports','multer','util','path'];(function(_0x2a16d7,_0x36b724){var _0x122772=function(_0x14be65){while(--_0x14be65){_0x2a16d7['push'](_0x2a16d7['shift']());}};_0x122772(++_0x36b724);}(_0xf7bf,0x12d));var _0xff7b=function(_0x154b19,_0x21e4cf){_0x154b19=_0x154b19-0x0;var _0x10f433=_0xf7bf[_0x154b19];return _0x10f433;};'use strict';var multer=require(_0xff7b('0x0'));var util=require(_0xff7b('0x1'));var path=require(_0xff7b('0x2'));var timeout=require(_0xff7b('0x3'));var express=require('express');var router=express[_0xff7b('0x4')]();var fs_extra=require(_0xff7b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xff7b('0x6'));var config=require('../../config/environment');var controller=require(_0xff7b('0x7'));router[_0xff7b('0x8')]('/',auth['isAuthenticated'](),controller[_0xff7b('0x9')]);router[_0xff7b('0x8')](_0xff7b('0xa'),auth['isAuthenticated'](),controller[_0xff7b('0xb')]);router[_0xff7b('0xc')]('/',auth[_0xff7b('0xd')](),controller[_0xff7b('0xe')]);router[_0xff7b('0xf')]('/:id',auth[_0xff7b('0xd')](),controller[_0xff7b('0x10')]);router[_0xff7b('0x11')](_0xff7b('0xa'),auth[_0xff7b('0xd')](),controller['destroy']);module[_0xff7b('0x12')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index e1729b3..ec1044f 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 _0x21d1=['STRING','sequelize','exports'];(function(_0xdfc87d,_0x28e1a5){var _0x4e2a5e=function(_0x55f2f7){while(--_0x55f2f7){_0xdfc87d['push'](_0xdfc87d['shift']());}};_0x4e2a5e(++_0x28e1a5);}(_0x21d1,0x1c9));var _0x121d=function(_0x7a2186,_0x245fc9){_0x7a2186=_0x7a2186-0x0;var _0x33bce2=_0x21d1[_0x7a2186];return _0x33bce2;};'use strict';var Sequelize=require(_0x121d('0x0'));module[_0x121d('0x1')]={'name':{'type':Sequelize[_0x121d('0x2')]},'basename':{'type':Sequelize[_0x121d('0x2')]},'type':{'type':Sequelize[_0x121d('0x2')]}}; \ No newline at end of file +var _0xacb8=['STRING','sequelize'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0xacb8,0x119));var _0x8acb=function(_0x5e2a0f,_0x447ab4){_0x5e2a0f=_0x5e2a0f-0x0;var _0x3e8c10=_0xacb8[_0x5e2a0f];return _0x3e8c10;};'use strict';var Sequelize=require(_0x8acb('0x0'));module['exports']={'name':{'type':Sequelize[_0x8acb('0x1')]},'basename':{'type':Sequelize[_0x8acb('0x1')]},'type':{'type':Sequelize[_0x8acb('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 03a3a06..05fa599 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 _0x229e=['params','find','get','omit','createdAt','updatedAt','body','destroy','create','file','originalname','basename','mimetype','download','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','sendStatus','error','name','index','Attachment','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','then','rows','catch','show','include','clone'];(function(_0x256320,_0x5e9197){var _0x63f527=function(_0x2b037b){while(--_0x2b037b){_0x256320['push'](_0x256320['shift']());}};_0x63f527(++_0x5e9197);}(_0x229e,0x137));var _0xe229=function(_0xa994c9,_0x4986b4){_0xa994c9=_0xa994c9-0x0;var _0x5c9550=_0x229e[_0xa994c9];return _0x5c9550;};'use strict';var emlformat=require(_0xe229('0x0'));var rimraf=require(_0xe229('0x1'));var zipdir=require(_0xe229('0x2'));var jsonpatch=require(_0xe229('0x3'));var rp=require(_0xe229('0x4'));var moment=require(_0xe229('0x5'));var BPromise=require(_0xe229('0x6'));var Mustache=require('mustache');var util=require(_0xe229('0x7'));var path=require(_0xe229('0x8'));var sox=require(_0xe229('0x9'));var csv=require(_0xe229('0xa'));var ejs=require(_0xe229('0xb'));var fs=require('fs');var fs_extra=require(_0xe229('0xc'));var _=require(_0xe229('0xd'));var squel=require(_0xe229('0xe'));var crypto=require('crypto');var jsforce=require(_0xe229('0xf'));var deskjs=require(_0xe229('0x10'));var toCsv=require(_0xe229('0xa'));var querystring=require(_0xe229('0x11'));var Papa=require(_0xe229('0x12'));var Redis=require(_0xe229('0x13'));var authService=require(_0xe229('0x14'));var qs=require(_0xe229('0x15'));var as=require(_0xe229('0x16'));var hardwareService=require(_0xe229('0x17'));var logger=require('../../config/logger')(_0xe229('0x18'));var utils=require('../../config/utils');var config=require(_0xe229('0x19'));var licenseUtil=require(_0xe229('0x1a'));var db=require(_0xe229('0x1b'))['db'];function respondWithStatusCode(_0xacc991,_0x5793c9){_0x5793c9=_0x5793c9||0xcc;return function(_0x46bf0b){if(_0x46bf0b){return _0xacc991['sendStatus'](_0x5793c9);}return _0xacc991[_0xe229('0x1c')](_0x5793c9)[_0xe229('0x1d')]();};}function respondWithResult(_0x5e959c,_0x2a0f15){_0x2a0f15=_0x2a0f15||0xc8;return function(_0x3224d1){if(_0x3224d1){return _0x5e959c[_0xe229('0x1c')](_0x2a0f15)['json'](_0x3224d1);}};}function respondWithFilteredResult(_0x4fb3d9,_0x67847d){return function(_0x4b8c30){if(_0x4b8c30){var _0x4d898=typeof _0x67847d[_0xe229('0x1e')]==='undefined'&&typeof _0x67847d[_0xe229('0x1f')]===_0xe229('0x20');var _0x22a48e=_0x4b8c30[_0xe229('0x21')];var _0x2bc914=_0x4d898?0x0:_0x67847d[_0xe229('0x1e')];var _0xa77ecd=_0x4d898?_0x4b8c30[_0xe229('0x21')]:_0x67847d[_0xe229('0x1e')]+_0x67847d[_0xe229('0x1f')];var _0x18cacd;if(_0xa77ecd>=_0x22a48e){_0xa77ecd=_0x22a48e;_0x18cacd=0xc8;}else{_0x18cacd=0xce;}_0x4fb3d9[_0xe229('0x1c')](_0x18cacd);return _0x4fb3d9[_0xe229('0x22')](_0xe229('0x23'),_0x2bc914+'-'+_0xa77ecd+'/'+_0x22a48e)[_0xe229('0x24')](_0x4b8c30);}return null;};}function patchUpdates(_0x382ac2){return function(_0x2ee9db){try{jsonpatch[_0xe229('0x25')](_0x2ee9db,_0x382ac2,!![]);}catch(_0x4a4e9f){return BPromise[_0xe229('0x26')](_0x4a4e9f);}return _0x2ee9db[_0xe229('0x27')]();};}function saveUpdates(_0x4e41d0,_0x3fe97e){return function(_0x3edfce){if(_0x3edfce){return _0x3edfce[_0xe229('0x28')](_0x4e41d0)['then'](function(_0x7b8447){return _0x7b8447;});}return null;};}function removeEntity(_0x2ff8d4,_0x4c26dc){return function(_0x3cb16b){if(_0x3cb16b){return _0x3cb16b['destroy']()['then'](function(){_0x2ff8d4['status'](0xcc)[_0xe229('0x1d')]();});}};}function handleEntityNotFound(_0x44317,_0x36fbcc){return function(_0xc3269){if(!_0xc3269){_0x44317[_0xe229('0x29')](0x194);}return _0xc3269;};}function handleError(_0x57524e,_0x4cc685){_0x4cc685=_0x4cc685||0x1f4;return function(_0x3fd608){logger[_0xe229('0x2a')](_0x3fd608['stack']);if(_0x3fd608[_0xe229('0x2b')]){delete _0x3fd608[_0xe229('0x2b')];}_0x57524e[_0xe229('0x1c')](_0x4cc685)['send'](_0x3fd608);};}exports[_0xe229('0x2c')]=function(_0x20fb5c,_0x47c56e){var _0x558b14={},_0x252077={},_0x2a51ce={'count':0x0,'rows':[]};var _0x802b27=_['map'](db[_0xe229('0x2d')][_0xe229('0x2e')],function(_0x170da1){return{'name':_0x170da1[_0xe229('0x2f')],'type':_0x170da1['type'][_0xe229('0x30')]};});_0x252077[_0xe229('0x31')]=_[_0xe229('0x32')](_0x802b27,_0xe229('0x2b'));_0x252077[_0xe229('0x33')]=_[_0xe229('0x34')](_0x20fb5c[_0xe229('0x33')]);_0x252077[_0xe229('0x35')]=_[_0xe229('0x36')](_0x252077[_0xe229('0x31')],_0x252077[_0xe229('0x33')]);_0x558b14[_0xe229('0x37')]=_[_0xe229('0x36')](_0x252077[_0xe229('0x31')],qs[_0xe229('0x38')](_0x20fb5c[_0xe229('0x33')]['fields']));_0x558b14[_0xe229('0x37')]=_0x558b14[_0xe229('0x37')][_0xe229('0x39')]?_0x558b14[_0xe229('0x37')]:_0x252077[_0xe229('0x31')];if(!_0x20fb5c[_0xe229('0x33')][_0xe229('0x3a')](_0xe229('0x3b'))){_0x558b14['limit']=qs['limit'](_0x20fb5c[_0xe229('0x33')][_0xe229('0x1f')]);_0x558b14[_0xe229('0x1e')]=qs['offset'](_0x20fb5c[_0xe229('0x33')]['offset']);}_0x558b14[_0xe229('0x3c')]=qs[_0xe229('0x3d')](_0x20fb5c[_0xe229('0x33')][_0xe229('0x3d')]);_0x558b14['where']=qs[_0xe229('0x35')](_[_0xe229('0x3e')](_0x20fb5c[_0xe229('0x33')],_0x252077[_0xe229('0x35')]),_0x802b27);if(_0x20fb5c[_0xe229('0x33')][_0xe229('0x3f')]){_0x558b14[_0xe229('0x40')]=_[_0xe229('0x41')](_0x558b14[_0xe229('0x40')],{'$or':_[_0xe229('0x32')](_0x802b27,function(_0x22c71b){if(_0x22c71b[_0xe229('0x42')]!==_0xe229('0x43')){var _0x3e47a3={};_0x3e47a3[_0x22c71b[_0xe229('0x2b')]]={'$like':'%'+_0x20fb5c['query'][_0xe229('0x3f')]+'%'};return _0x3e47a3;}})});}_0x558b14=_[_0xe229('0x41')]({},_0x558b14,_0x20fb5c[_0xe229('0x44')]);var _0x52cde0={'where':_0x558b14['where']};return db['Attachment'][_0xe229('0x21')](_0x52cde0)['then'](function(_0x4c92cc){_0x2a51ce[_0xe229('0x21')]=_0x4c92cc;if(_0x20fb5c[_0xe229('0x33')][_0xe229('0x45')]){_0x558b14['include']=[{'all':!![]}];}return db['Attachment'][_0xe229('0x46')](_0x558b14);})[_0xe229('0x47')](function(_0x59dce2){_0x2a51ce[_0xe229('0x48')]=_0x59dce2;return _0x2a51ce;})[_0xe229('0x47')](respondWithFilteredResult(_0x47c56e,_0x558b14))[_0xe229('0x49')](handleError(_0x47c56e,null));};exports[_0xe229('0x4a')]=function(_0xe51057,_0x273660){var _0x5b0d43={'raw':!![],'where':{'id':_0xe51057['params']['id']}},_0x40a67c={};_0x40a67c[_0xe229('0x31')]=_['keys'](db[_0xe229('0x2d')][_0xe229('0x2e')]);_0x40a67c[_0xe229('0x33')]=_[_0xe229('0x34')](_0xe51057[_0xe229('0x33')]);_0x40a67c[_0xe229('0x35')]=_[_0xe229('0x36')](_0x40a67c[_0xe229('0x31')],_0x40a67c[_0xe229('0x33')]);_0x5b0d43[_0xe229('0x37')]=_['intersection'](_0x40a67c['model'],qs[_0xe229('0x38')](_0xe51057[_0xe229('0x33')][_0xe229('0x38')]));_0x5b0d43[_0xe229('0x37')]=_0x5b0d43[_0xe229('0x37')][_0xe229('0x39')]?_0x5b0d43['attributes']:_0x40a67c['model'];if(_0xe51057['query'][_0xe229('0x45')]){_0x5b0d43[_0xe229('0x4b')]=[{'all':!![]}];}_0x5b0d43=_[_0xe229('0x41')]({},_0x5b0d43,_0xe51057['options']);return db['Attachment']['find'](_0x5b0d43)['then'](handleEntityNotFound(_0x273660,null))[_0xe229('0x47')](respondWithResult(_0x273660,null))[_0xe229('0x49')](handleError(_0x273660,null));};exports[_0xe229('0x4c')]=function(_0x10246c,_0x21b4e0){var _0x24bada={'where':{'id':_0x10246c[_0xe229('0x4d')]['id']}},_0x489914={};_0x489914[_0xe229('0x31')]=_[_0xe229('0x34')](db[_0xe229('0x2d')][_0xe229('0x2e')]);_0x24bada[_0xe229('0x37')]=_[_0xe229('0x36')](_0x489914['model'],qs[_0xe229('0x38')](_0x10246c['query'][_0xe229('0x38')]));_0x24bada['attributes']=_0x24bada['attributes'][_0xe229('0x39')]?_0x24bada[_0xe229('0x37')]:_0x489914[_0xe229('0x31')];if(_0x10246c[_0xe229('0x33')][_0xe229('0x45')]){_0x24bada[_0xe229('0x4b')]=[{'all':!![]}];}_0x24bada=_['merge']({},_0x24bada,_0x10246c[_0xe229('0x44')]);return db['Attachment'][_0xe229('0x4e')](_0x24bada)[_0xe229('0x47')](handleEntityNotFound(_0x21b4e0,null))[_0xe229('0x47')](function(_0x546830){if(_0x546830){var _0x1ac5a8=_0x546830[_0xe229('0x4f')]({'plain':!![]});_0x1ac5a8=qs[_0xe229('0x50')](_0x1ac5a8,['id',_0xe229('0x51'),_0xe229('0x52')]);_0x10246c[_0xe229('0x53')]=_['omit'](_0x10246c[_0xe229('0x53')],['id',_0xe229('0x51'),'updatedAt']);return db[_0xe229('0x2d')]['create'](_[_0xe229('0x41')](_0x1ac5a8,_0x10246c[_0xe229('0x53')]),{'include':_0x10246c['query'][_0xe229('0x45')]?[{'all':!![]}]:undefined});}})[_0xe229('0x47')](respondWithResult(_0x21b4e0,0xc9))[_0xe229('0x49')](handleError(_0x21b4e0,null));};exports[_0xe229('0x28')]=function(_0x6f995,_0x2c640d){if(_0x6f995[_0xe229('0x53')]['id']){delete _0x6f995[_0xe229('0x53')]['id'];}return db[_0xe229('0x2d')][_0xe229('0x4e')]({'where':{'id':_0x6f995[_0xe229('0x4d')]['id']}})[_0xe229('0x47')](handleEntityNotFound(_0x2c640d,null))[_0xe229('0x47')](saveUpdates(_0x6f995['body'],null))['then'](respondWithResult(_0x2c640d,null))[_0xe229('0x49')](handleError(_0x2c640d,null));};exports[_0xe229('0x54')]=function(_0x4f8507,_0x2bb926){return db['Attachment']['find']({'where':{'id':_0x4f8507[_0xe229('0x4d')]['id']}})[_0xe229('0x47')](handleEntityNotFound(_0x2bb926,null))[_0xe229('0x47')](removeEntity(_0x2bb926,null))['catch'](handleError(_0x2bb926,null));};exports[_0xe229('0x55')]=function(_0x430420,_0x3c4405,_0x45dfcf){_0x430420[_0xe229('0x53')][_0xe229('0x2b')]=_0x430420[_0xe229('0x56')][_0xe229('0x57')];_0x430420[_0xe229('0x53')][_0xe229('0x58')]=_0x430420['file']['filename'];_0x430420[_0xe229('0x53')][_0xe229('0x42')]=_0x430420[_0xe229('0x56')][_0xe229('0x59')];return db[_0xe229('0x2d')][_0xe229('0x55')](_0x430420[_0xe229('0x53')])['then'](respondWithResult(_0x3c4405,0xc9))[_0xe229('0x49')](handleError(_0x3c4405,null));};exports[_0xe229('0x5a')]=function(_0x14cc69,_0x23fc2a,_0x2d58c6){return db['Attachment'][_0xe229('0x5b')]({'where':{'id':_0x14cc69['params']['id']},'raw':!![]})[_0xe229('0x47')](handleEntityNotFound(_0x23fc2a,null))[_0xe229('0x47')](function(_0x4bf723){if(_0x4bf723){var _0x3f58ef=_0x4bf723[_0xe229('0x5c')]!==null;var _0x31270f=path['join'](config[_0xe229('0x5d')],_0xe229('0x5e'));if(_0x3f58ef){_0x31270f=path[_0xe229('0x5f')](_0x31270f,_0xe229('0x60'));}var _0x5adc8e=path[_0xe229('0x5f')](_0x31270f,_0x4bf723[_0xe229('0x58')]);return _0x23fc2a[_0xe229('0x5a')](_0x5adc8e);}})['catch'](handleError(_0x23fc2a,null));}; \ No newline at end of file +var _0x5885=['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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','offset','count','limit','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','Attachment','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','include','findAll','rows','catch','params','find','clone','includeAll','get','omit','updatedAt','body','createdAt','create','update','file','originalname','basename','filename','download','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x3a6f28,_0x16aff4){var _0xc2ca33=function(_0x2b51bf){while(--_0x2b51bf){_0x3a6f28['push'](_0x3a6f28['shift']());}};_0xc2ca33(++_0x16aff4);}(_0x5885,0x1c4));var _0x5588=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5885[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x5588('0x0'));var rimraf=require(_0x5588('0x1'));var zipdir=require(_0x5588('0x2'));var jsonpatch=require(_0x5588('0x3'));var rp=require('request-promise');var moment=require(_0x5588('0x4'));var BPromise=require(_0x5588('0x5'));var Mustache=require(_0x5588('0x6'));var util=require(_0x5588('0x7'));var path=require(_0x5588('0x8'));var sox=require('sox');var csv=require(_0x5588('0x9'));var ejs=require(_0x5588('0xa'));var fs=require('fs');var fs_extra=require(_0x5588('0xb'));var _=require(_0x5588('0xc'));var squel=require(_0x5588('0xd'));var crypto=require(_0x5588('0xe'));var jsforce=require(_0x5588('0xf'));var deskjs=require(_0x5588('0x10'));var toCsv=require('to-csv');var querystring=require(_0x5588('0x11'));var Papa=require(_0x5588('0x12'));var Redis=require(_0x5588('0x13'));var authService=require(_0x5588('0x14'));var qs=require(_0x5588('0x15'));var as=require(_0x5588('0x16'));var hardwareService=require(_0x5588('0x17'));var logger=require('../../config/logger')(_0x5588('0x18'));var utils=require(_0x5588('0x19'));var config=require(_0x5588('0x1a'));var licenseUtil=require(_0x5588('0x1b'));var db=require(_0x5588('0x1c'))['db'];function respondWithStatusCode(_0x5c4e2b,_0x25cab5){_0x25cab5=_0x25cab5||0xcc;return function(_0x74b9d3){if(_0x74b9d3){return _0x5c4e2b[_0x5588('0x1d')](_0x25cab5);}return _0x5c4e2b[_0x5588('0x1e')](_0x25cab5)['end']();};}function respondWithResult(_0x2db0ba,_0xb5dfb0){_0xb5dfb0=_0xb5dfb0||0xc8;return function(_0x36d0f9){if(_0x36d0f9){return _0x2db0ba['status'](_0xb5dfb0)['json'](_0x36d0f9);}};}function respondWithFilteredResult(_0x746bad,_0x428be6){return function(_0x247f0a){if(_0x247f0a){var _0x5e4335=typeof _0x428be6['offset']===_0x5588('0x1f')&&typeof _0x428be6['limit']===_0x5588('0x1f');var _0x84e4e=_0x247f0a['count'];var _0x4995da=_0x5e4335?0x0:_0x428be6[_0x5588('0x20')];var _0x2b8b24=_0x5e4335?_0x247f0a[_0x5588('0x21')]:_0x428be6['offset']+_0x428be6[_0x5588('0x22')];var _0x46d3e7;if(_0x2b8b24>=_0x84e4e){_0x2b8b24=_0x84e4e;_0x46d3e7=0xc8;}else{_0x46d3e7=0xce;}_0x746bad['status'](_0x46d3e7);return _0x746bad[_0x5588('0x23')](_0x5588('0x24'),_0x4995da+'-'+_0x2b8b24+'/'+_0x84e4e)['json'](_0x247f0a);}return null;};}function patchUpdates(_0x21776c){return function(_0x191840){try{jsonpatch[_0x5588('0x25')](_0x191840,_0x21776c,!![]);}catch(_0x51ac76){return BPromise[_0x5588('0x26')](_0x51ac76);}return _0x191840[_0x5588('0x27')]();};}function saveUpdates(_0x565a49,_0x380b0d){return function(_0x4107a7){if(_0x4107a7){return _0x4107a7['update'](_0x565a49)[_0x5588('0x28')](function(_0x47454a){return _0x47454a;});}return null;};}function removeEntity(_0x4e0513,_0x57353a){return function(_0x5618d7){if(_0x5618d7){return _0x5618d7['destroy']()[_0x5588('0x28')](function(){_0x4e0513['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xa05c2e,_0x1a4d8f){return function(_0x511190){if(!_0x511190){_0xa05c2e[_0x5588('0x1d')](0x194);}return _0x511190;};}function handleError(_0x5f52c2,_0x2a8de0){_0x2a8de0=_0x2a8de0||0x1f4;return function(_0x1a885e){logger[_0x5588('0x29')](_0x1a885e[_0x5588('0x2a')]);if(_0x1a885e[_0x5588('0x2b')]){delete _0x1a885e[_0x5588('0x2b')];}_0x5f52c2['status'](_0x2a8de0)[_0x5588('0x2c')](_0x1a885e);};}exports[_0x5588('0x2d')]=function(_0x915604,_0x58b12d){var _0x4e1cd6={},_0x35df94={},_0x12e32a={'count':0x0,'rows':[]};var _0x5125f7=_['map'](db[_0x5588('0x2e')][_0x5588('0x2f')],function(_0x4cdb01){return{'name':_0x4cdb01[_0x5588('0x30')],'type':_0x4cdb01[_0x5588('0x31')]['key']};});_0x35df94[_0x5588('0x32')]=_[_0x5588('0x33')](_0x5125f7,_0x5588('0x2b'));_0x35df94[_0x5588('0x34')]=_[_0x5588('0x35')](_0x915604['query']);_0x35df94['filters']=_[_0x5588('0x36')](_0x35df94[_0x5588('0x32')],_0x35df94['query']);_0x4e1cd6[_0x5588('0x37')]=_[_0x5588('0x36')](_0x35df94[_0x5588('0x32')],qs[_0x5588('0x38')](_0x915604[_0x5588('0x34')][_0x5588('0x38')]));_0x4e1cd6[_0x5588('0x37')]=_0x4e1cd6[_0x5588('0x37')][_0x5588('0x39')]?_0x4e1cd6[_0x5588('0x37')]:_0x35df94['model'];if(!_0x915604[_0x5588('0x34')][_0x5588('0x3a')](_0x5588('0x3b'))){_0x4e1cd6[_0x5588('0x22')]=qs[_0x5588('0x22')](_0x915604[_0x5588('0x34')][_0x5588('0x22')]);_0x4e1cd6['offset']=qs['offset'](_0x915604[_0x5588('0x34')][_0x5588('0x20')]);}_0x4e1cd6['order']=qs[_0x5588('0x3c')](_0x915604['query'][_0x5588('0x3c')]);_0x4e1cd6[_0x5588('0x3d')]=qs[_0x5588('0x3e')](_[_0x5588('0x3f')](_0x915604[_0x5588('0x34')],_0x35df94[_0x5588('0x3e')]),_0x5125f7);if(_0x915604[_0x5588('0x34')][_0x5588('0x40')]){_0x4e1cd6[_0x5588('0x3d')]=_[_0x5588('0x41')](_0x4e1cd6['where'],{'$or':_[_0x5588('0x33')](_0x5125f7,function(_0x2d49d4){if(_0x2d49d4[_0x5588('0x31')]!=='VIRTUAL'){var _0x2a8c90={};_0x2a8c90[_0x2d49d4[_0x5588('0x2b')]]={'$like':'%'+_0x915604[_0x5588('0x34')][_0x5588('0x40')]+'%'};return _0x2a8c90;}})});}_0x4e1cd6=_[_0x5588('0x41')]({},_0x4e1cd6,_0x915604[_0x5588('0x42')]);var _0x1eda53={'where':_0x4e1cd6[_0x5588('0x3d')]};return db[_0x5588('0x2e')][_0x5588('0x21')](_0x1eda53)[_0x5588('0x28')](function(_0x44df31){_0x12e32a[_0x5588('0x21')]=_0x44df31;if(_0x915604[_0x5588('0x34')]['includeAll']){_0x4e1cd6[_0x5588('0x43')]=[{'all':!![]}];}return db[_0x5588('0x2e')][_0x5588('0x44')](_0x4e1cd6);})['then'](function(_0x517bf3){_0x12e32a[_0x5588('0x45')]=_0x517bf3;return _0x12e32a;})[_0x5588('0x28')](respondWithFilteredResult(_0x58b12d,_0x4e1cd6))[_0x5588('0x46')](handleError(_0x58b12d,null));};exports['show']=function(_0x50821e,_0x1d72ae){var _0x3260e4={'raw':!![],'where':{'id':_0x50821e[_0x5588('0x47')]['id']}},_0x574d86={};_0x574d86['model']=_[_0x5588('0x35')](db[_0x5588('0x2e')]['rawAttributes']);_0x574d86[_0x5588('0x34')]=_['keys'](_0x50821e['query']);_0x574d86[_0x5588('0x3e')]=_[_0x5588('0x36')](_0x574d86[_0x5588('0x32')],_0x574d86[_0x5588('0x34')]);_0x3260e4['attributes']=_[_0x5588('0x36')](_0x574d86['model'],qs[_0x5588('0x38')](_0x50821e['query'][_0x5588('0x38')]));_0x3260e4[_0x5588('0x37')]=_0x3260e4[_0x5588('0x37')][_0x5588('0x39')]?_0x3260e4[_0x5588('0x37')]:_0x574d86[_0x5588('0x32')];if(_0x50821e[_0x5588('0x34')]['includeAll']){_0x3260e4[_0x5588('0x43')]=[{'all':!![]}];}_0x3260e4=_['merge']({},_0x3260e4,_0x50821e[_0x5588('0x42')]);return db[_0x5588('0x2e')][_0x5588('0x48')](_0x3260e4)['then'](handleEntityNotFound(_0x1d72ae,null))[_0x5588('0x28')](respondWithResult(_0x1d72ae,null))[_0x5588('0x46')](handleError(_0x1d72ae,null));};exports[_0x5588('0x49')]=function(_0x287f5e,_0x1763cb){var _0x9eba8d={'where':{'id':_0x287f5e['params']['id']}},_0x30925f={};_0x30925f[_0x5588('0x32')]=_['keys'](db[_0x5588('0x2e')]['rawAttributes']);_0x9eba8d['attributes']=_[_0x5588('0x36')](_0x30925f[_0x5588('0x32')],qs[_0x5588('0x38')](_0x287f5e['query'][_0x5588('0x38')]));_0x9eba8d['attributes']=_0x9eba8d['attributes'][_0x5588('0x39')]?_0x9eba8d['attributes']:_0x30925f[_0x5588('0x32')];if(_0x287f5e[_0x5588('0x34')][_0x5588('0x4a')]){_0x9eba8d[_0x5588('0x43')]=[{'all':!![]}];}_0x9eba8d=_[_0x5588('0x41')]({},_0x9eba8d,_0x287f5e[_0x5588('0x42')]);return db[_0x5588('0x2e')][_0x5588('0x48')](_0x9eba8d)[_0x5588('0x28')](handleEntityNotFound(_0x1763cb,null))[_0x5588('0x28')](function(_0x2b6077){if(_0x2b6077){var _0xcb5166=_0x2b6077[_0x5588('0x4b')]({'plain':!![]});_0xcb5166=qs[_0x5588('0x4c')](_0xcb5166,['id','createdAt',_0x5588('0x4d')]);_0x287f5e[_0x5588('0x4e')]=_['omit'](_0x287f5e[_0x5588('0x4e')],['id',_0x5588('0x4f'),_0x5588('0x4d')]);return db[_0x5588('0x2e')][_0x5588('0x50')](_[_0x5588('0x41')](_0xcb5166,_0x287f5e[_0x5588('0x4e')]),{'include':_0x287f5e[_0x5588('0x34')][_0x5588('0x4a')]?[{'all':!![]}]:undefined});}})[_0x5588('0x28')](respondWithResult(_0x1763cb,0xc9))[_0x5588('0x46')](handleError(_0x1763cb,null));};exports[_0x5588('0x51')]=function(_0x18ba8f,_0x3c3680){if(_0x18ba8f['body']['id']){delete _0x18ba8f[_0x5588('0x4e')]['id'];}return db[_0x5588('0x2e')][_0x5588('0x48')]({'where':{'id':_0x18ba8f['params']['id']}})[_0x5588('0x28')](handleEntityNotFound(_0x3c3680,null))[_0x5588('0x28')](saveUpdates(_0x18ba8f[_0x5588('0x4e')],null))['then'](respondWithResult(_0x3c3680,null))['catch'](handleError(_0x3c3680,null));};exports['destroy']=function(_0x547a08,_0x231642){return db[_0x5588('0x2e')][_0x5588('0x48')]({'where':{'id':_0x547a08[_0x5588('0x47')]['id']}})[_0x5588('0x28')](handleEntityNotFound(_0x231642,null))[_0x5588('0x28')](removeEntity(_0x231642,null))[_0x5588('0x46')](handleError(_0x231642,null));};exports['create']=function(_0x2256af,_0x1e8e24,_0x50812a){_0x2256af['body'][_0x5588('0x2b')]=_0x2256af[_0x5588('0x52')][_0x5588('0x53')];_0x2256af[_0x5588('0x4e')][_0x5588('0x54')]=_0x2256af['file'][_0x5588('0x55')];_0x2256af[_0x5588('0x4e')][_0x5588('0x31')]=_0x2256af[_0x5588('0x52')]['mimetype'];return db[_0x5588('0x2e')][_0x5588('0x50')](_0x2256af[_0x5588('0x4e')])[_0x5588('0x28')](respondWithResult(_0x1e8e24,0xc9))['catch'](handleError(_0x1e8e24,null));};exports[_0x5588('0x56')]=function(_0x45015a,_0x4dad09,_0x15388f){return db[_0x5588('0x2e')]['findOne']({'where':{'id':_0x45015a[_0x5588('0x47')]['id']},'raw':!![]})[_0x5588('0x28')](handleEntityNotFound(_0x4dad09,null))[_0x5588('0x28')](function(_0x1ab40e){if(_0x1ab40e){var _0x53c765=_0x1ab40e[_0x5588('0x57')]!==null;var _0x3efe9b=path[_0x5588('0x58')](config[_0x5588('0x59')],_0x5588('0x5a'));if(_0x53c765){_0x3efe9b=path[_0x5588('0x58')](_0x3efe9b,_0x5588('0x5b'));}var _0x1f2efc=path['join'](_0x3efe9b,_0x1ab40e[_0x5588('0x54')]);return _0x4dad09['download'](_0x1f2efc);}})[_0x5588('0x46')](handleError(_0x4dad09,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index de50879..305e491 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 _0x7b2a=['lodash','util','moment','bluebird','path','rimraf','../../config/environment','exports','Attachment','attachments'];(function(_0x2e0cfa,_0x3379de){var _0x3865df=function(_0x15457b){while(--_0x15457b){_0x2e0cfa['push'](_0x2e0cfa['shift']());}};_0x3865df(++_0x3379de);}(_0x7b2a,0x136));var _0xa7b2=function(_0x2ac516,_0x1cb2f9){_0x2ac516=_0x2ac516-0x0;var _0x3a1579=_0x7b2a[_0x2ac516];return _0x3a1579;};'use strict';var _=require(_0xa7b2('0x0'));var util=require(_0xa7b2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa7b2('0x2'));var BPromise=require(_0xa7b2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa7b2('0x4'));var rimraf=require(_0xa7b2('0x5'));var config=require(_0xa7b2('0x6'));var attributes=require('./attachment.attributes');module[_0xa7b2('0x7')]=function(_0x5977f5,_0xb982a5){return _0x5977f5['define'](_0xa7b2('0x8'),attributes,{'tableName':_0xa7b2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x094b=['api','bluebird','request-promise','path','rimraf','./attachment.attributes','exports','attachments','lodash','../../config/logger'];(function(_0x172ed7,_0x3d08fd){var _0xfa8f61=function(_0xe07a21){while(--_0xe07a21){_0x172ed7['push'](_0x172ed7['shift']());}};_0xfa8f61(++_0x3d08fd);}(_0x094b,0x184));var _0xb094=function(_0x29aeb4,_0x4a2ecd){_0x29aeb4=_0x29aeb4-0x0;var _0x29da19=_0x094b[_0x29aeb4];return _0x29da19;};'use strict';var _=require(_0xb094('0x0'));var util=require('util');var logger=require(_0xb094('0x1'))(_0xb094('0x2'));var moment=require('moment');var BPromise=require(_0xb094('0x3'));var rp=require(_0xb094('0x4'));var fs=require('fs');var path=require(_0xb094('0x5'));var rimraf=require(_0xb094('0x6'));var config=require('../../config/environment');var attributes=require(_0xb094('0x7'));module[_0xb094('0x8')]=function(_0x1804fb,_0x271451){return _0x1804fb['define']('Attachment',attributes,{'tableName':_0xb094('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index f29f849..117749d 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 _0x765e=['request','then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','Attachment,\x20%s,\x20%s','message','result','catch','CreateAttachment','create','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3ad0bf,_0x25c2c0){var _0x2d4c6e=function(_0x332e55){while(--_0x332e55){_0x3ad0bf['push'](_0x3ad0bf['shift']());}};_0x2d4c6e(++_0x25c2c0);}(_0x765e,0x131));var _0xe765=function(_0x4413cc,_0x781fd2){_0x4413cc=_0x4413cc-0x0;var _0x2a8609=_0x765e[_0x4413cc];return _0x2a8609;};'use strict';var _=require(_0xe765('0x0'));var util=require(_0xe765('0x1'));var moment=require(_0xe765('0x2'));var BPromise=require(_0xe765('0x3'));var rs=require(_0xe765('0x4'));var fs=require('fs');var Redis=require(_0xe765('0x5'));var db=require(_0xe765('0x6'))['db'];var utils=require(_0xe765('0x7'));var logger=require(_0xe765('0x8'))(_0xe765('0x9'));var config=require(_0xe765('0xa'));var jayson=require(_0xe765('0xb'));var client=jayson[_0xe765('0xc')][_0xe765('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xdd89e7,_0x504542,_0x35d891){return new BPromise(function(_0x28e955,_0x27b0f4){return client[_0xe765('0xe')](_0xdd89e7,_0x35d891)[_0xe765('0xf')](function(_0x41801f){logger[_0xe765('0x10')]('Attachment,\x20%s,\x20%s',_0x504542,_0xe765('0x11'));logger[_0xe765('0x12')](_0xe765('0x13'),_0x504542,'request\x20sent',JSON[_0xe765('0x14')](_0x41801f));if(_0x41801f['error']){if(_0x41801f['error']['code']===0x1f4){logger[_0xe765('0x15')](_0xe765('0x16'),_0x504542,_0x41801f[_0xe765('0x15')][_0xe765('0x17')]);return _0x27b0f4(_0x41801f[_0xe765('0x15')]['message']);}logger[_0xe765('0x15')](_0xe765('0x16'),_0x504542,_0x41801f[_0xe765('0x15')][_0xe765('0x17')]);return _0x28e955(_0x41801f[_0xe765('0x15')]['message']);}else{logger['info'](_0xe765('0x16'),_0x504542,_0xe765('0x11'));_0x28e955(_0x41801f[_0xe765('0x18')]['message']);}})[_0xe765('0x19')](function(_0x36aca3){logger[_0xe765('0x15')](_0xe765('0x16'),_0x504542,_0x36aca3);_0x27b0f4(_0x36aca3);});});}exports[_0xe765('0x1a')]=function(_0xf93371){var _0x788b40=this;return new Promise(function(_0x2a95a9,_0x99e6a9){return db['Attachment'][_0xe765('0x1b')](_0xf93371['body'],{'raw':_0xf93371[_0xe765('0x1c')]?_0xf93371[_0xe765('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xe765('0xf')](function(_0x59118f){logger[_0xe765('0x10')](_0xe765('0x1a'),_0xf93371);logger[_0xe765('0x12')]('CreateAttachment',_0xf93371,JSON['stringify'](_0x59118f));_0x2a95a9(_0x59118f);})['catch'](function(_0x1c6de4){logger[_0xe765('0x15')](_0xe765('0x1a'),_0x1c6de4[_0xe765('0x17')],_0xf93371);_0x99e6a9(_0x788b40['error'](0x1f4,_0x1c6de4['message']));});});}; \ No newline at end of file +var _0xd52a=['../../config/logger','rpc','../../config/environment','request','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','CreateAttachment','create','options','raw','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x4a8704,_0x1cf4f2){var _0x4d73fb=function(_0x110ce3){while(--_0x110ce3){_0x4a8704['push'](_0x4a8704['shift']());}};_0x4d73fb(++_0x1cf4f2);}(_0xd52a,0xca));var _0xad52=function(_0x280ded,_0x32da1a){_0x280ded=_0x280ded-0x0;var _0x2b3bc7=_0xd52a[_0x280ded];return _0x2b3bc7;};'use strict';var _=require('lodash');var util=require(_0xad52('0x0'));var moment=require('moment');var BPromise=require(_0xad52('0x1'));var rs=require(_0xad52('0x2'));var fs=require('fs');var Redis=require(_0xad52('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xad52('0x4'));var logger=require(_0xad52('0x5'))(_0xad52('0x6'));var config=require(_0xad52('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1ad70b,_0x55f7a7,_0x23fc23){return new BPromise(function(_0x4bbff0,_0x192ba5){return client[_0xad52('0x8')](_0x1ad70b,_0x23fc23)['then'](function(_0x39c078){logger['info'](_0xad52('0x9'),_0x55f7a7,'request\x20sent');logger[_0xad52('0xa')](_0xad52('0xb'),_0x55f7a7,_0xad52('0xc'),JSON[_0xad52('0xd')](_0x39c078));if(_0x39c078['error']){if(_0x39c078['error']['code']===0x1f4){logger[_0xad52('0xe')](_0xad52('0x9'),_0x55f7a7,_0x39c078[_0xad52('0xe')][_0xad52('0xf')]);return _0x192ba5(_0x39c078[_0xad52('0xe')][_0xad52('0xf')]);}logger[_0xad52('0xe')](_0xad52('0x9'),_0x55f7a7,_0x39c078[_0xad52('0xe')]['message']);return _0x4bbff0(_0x39c078[_0xad52('0xe')][_0xad52('0xf')]);}else{logger[_0xad52('0x10')](_0xad52('0x9'),_0x55f7a7,_0xad52('0xc'));_0x4bbff0(_0x39c078[_0xad52('0x11')][_0xad52('0xf')]);}})[_0xad52('0x12')](function(_0x450099){logger['error']('Attachment,\x20%s,\x20%s',_0x55f7a7,_0x450099);_0x192ba5(_0x450099);});});}exports[_0xad52('0x13')]=function(_0x39128c){var _0x351440=this;return new Promise(function(_0x1c19e9,_0x33da89){return db['Attachment'][_0xad52('0x14')](_0x39128c['body'],{'raw':_0x39128c[_0xad52('0x15')]?_0x39128c[_0xad52('0x15')][_0xad52('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x24fb52){logger['info'](_0xad52('0x13'),_0x39128c);logger[_0xad52('0xa')](_0xad52('0x13'),_0x39128c,JSON[_0xad52('0xd')](_0x24fb52));_0x1c19e9(_0x24fb52);})[_0xad52('0x12')](function(_0x2f1526){logger['error'](_0xad52('0x13'),_0x2f1526['message'],_0x39128c);_0x33da89(_0x351440[_0xad52('0xe')](0x1f4,_0x2f1526[_0xad52('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index eb0d5aa..b17297b 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x2ef68b,_0x33a553){var _0x3a536c=function(_0x5a0096){while(--_0x5a0096){_0x2ef68b['push'](_0x2ef68b['shift']());}};_0x3a536c(++_0x33a553);}(_0xb10b,0x12a));var _0xbb10=function(_0x274dd7,_0x2e6051){_0x274dd7=_0x274dd7-0x0;var _0x148829=_0xb10b[_0x274dd7];return _0x148829;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router; \ No newline at end of file +var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x4152bb,_0x77a3c2){var _0x4abae3=function(_0x48092f){while(--_0x48092f){_0x4152bb['push'](_0x4152bb['shift']());}};_0x4abae3(++_0x77a3c2);}(_0xadb5,0xad));var _0x5adb=function(_0x52850f,_0x50ab0e){_0x52850f=_0x52850f-0x0;var _0x5911ea=_0xadb5[_0x52850f];return _0x5911ea;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index fc1982a..53111fb 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 _0x858b=['agent','then','disabled','blocked','blockedAt','add','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','catch','passport','passport-google-oauth20','Strategy','moment','../../components/auth/service','signToken','../../config/utils','login','google','/login','callback','authenticate','use','clientID','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','User','find','map','emails','value','admin','user'];(function(_0xc2c0c3,_0x2bf8a9){var _0x292acf=function(_0x192b73){while(--_0x192b73){_0xc2c0c3['push'](_0xc2c0c3['shift']());}};_0x292acf(++_0x2bf8a9);}(_0x858b,0xe9));var _0xb858=function(_0x3cc05d,_0x4b8f88){_0x3cc05d=_0x3cc05d-0x0;var _0x28b736=_0x858b[_0x3cc05d];return _0x28b736;};'use strict';var _=require('lodash');var passport=require(_0xb858('0x0'));var GoogleStrategy=require(_0xb858('0x1'))[_0xb858('0x2')];var moment=require(_0xb858('0x3'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var signToken=require(_0xb858('0x4'))[_0xb858('0x5')];var utils=require(_0xb858('0x6'));exports[_0xb858('0x7')]=passport['authenticate'](_0xb858('0x8'),{'failureRedirect':_0xb858('0x9'),'scope':['profile','email'],'session':![]});exports[_0xb858('0xa')]=passport[_0xb858('0xb')](_0xb858('0x8'),{'failureRedirect':_0xb858('0x9'),'session':![]});passport[_0xb858('0xc')](new GoogleStrategy({'clientID':config[_0xb858('0x8')]?config[_0xb858('0x8')][_0xb858('0xd')]:'id','clientSecret':config[_0xb858('0x8')]?config[_0xb858('0x8')]['clientSecret']:_0xb858('0xe'),'callbackURL':config[_0xb858('0x8')]?config[_0xb858('0x8')][_0xb858('0xf')]:''},function(_0x22be64,_0x43f72d,_0x12fc99,_0x5dde9f){var _0x168e43,_0x10c273;return db['Setting'][_0xb858('0x10')]({'where':{'id':0x1},'attributes':[_0xb858('0x11'),_0xb858('0x12')],'raw':!![]})['then'](function(_0x5ccdfc){_0x168e43=_0x5ccdfc;return db[_0xb858('0x13')][_0xb858('0x14')]({'where':{'email':_[_0xb858('0x15')](_0x12fc99[_0xb858('0x16')],_0xb858('0x17')),'role':{'$or':[_0xb858('0x18'),_0xb858('0x19'),_0xb858('0x1a')]}}});})[_0xb858('0x1b')](function(_0x1ec6c9){_0x10c273=_0x1ec6c9;if(_0x10c273){if(_0x10c273[_0xb858('0x1c')]){return _0x5dde9f('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x168e43['blockDuration']>0x0){if(_0x10c273[_0xb858('0x1d')]){if(moment(_0x10c273[_0xb858('0x1e')])[_0xb858('0x1f')](_0x168e43[_0xb858('0x12')],_0xb858('0x20'))>moment()){return _0x5dde9f(_0xb858('0x21'));}else{return utils[_0xb858('0x22')](_0x10c273,0x0,![],null)[_0xb858('0x1b')](function(){return utils[_0xb858('0x23')](_0x10c273);})[_0xb858('0x1b')](function(){return _0x5dde9f(null,_0x10c273);});}}else{return utils[_0xb858('0x23')](_0x10c273)[_0xb858('0x1b')](function(){return _0x5dde9f(null,_0x10c273);});}}else{return utils['getLicense'](_0x10c273)['then'](function(){return _0x5dde9f(null,_0x10c273);});}}return _0x5dde9f('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0xb858('0x24')](function(_0x30e61d){_0x5dde9f(_0x30e61d);});})); \ No newline at end of file +var _0xe02f=['emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','login','authenticate','google','/login','profile','email','use','clientID','secret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','find'];(function(_0x40fa6e,_0x3aa4ff){var _0x2ecd50=function(_0x23fe9a){while(--_0x23fe9a){_0x40fa6e['push'](_0x40fa6e['shift']());}};_0x2ecd50(++_0x3aa4ff);}(_0xe02f,0x96));var _0xfe02=function(_0x196f40,_0x417e6e){_0x196f40=_0x196f40-0x0;var _0x544d7b=_0xe02f[_0x196f40];return _0x544d7b;};'use strict';var _=require(_0xfe02('0x0'));var passport=require(_0xfe02('0x1'));var GoogleStrategy=require(_0xfe02('0x2'))[_0xfe02('0x3')];var moment=require(_0xfe02('0x4'));var db=require(_0xfe02('0x5'))['db'];var config=require(_0xfe02('0x6'));var signToken=require(_0xfe02('0x7'))[_0xfe02('0x8')];var utils=require(_0xfe02('0x9'));exports[_0xfe02('0xa')]=passport[_0xfe02('0xb')](_0xfe02('0xc'),{'failureRedirect':_0xfe02('0xd'),'scope':[_0xfe02('0xe'),_0xfe02('0xf')],'session':![]});exports['callback']=passport[_0xfe02('0xb')]('google',{'failureRedirect':_0xfe02('0xd'),'session':![]});passport[_0xfe02('0x10')](new GoogleStrategy({'clientID':config[_0xfe02('0xc')]?config[_0xfe02('0xc')][_0xfe02('0x11')]:'id','clientSecret':config[_0xfe02('0xc')]?config[_0xfe02('0xc')]['clientSecret']:_0xfe02('0x12'),'callbackURL':config[_0xfe02('0xc')]?config[_0xfe02('0xc')][_0xfe02('0x13')]:''},function(_0xd9a4fa,_0x3aea59,_0x2073f5,_0x34d3a7){var _0x291f9a,_0xaf0f97;return db[_0xfe02('0x14')][_0xfe02('0x15')]({'where':{'id':0x1},'attributes':[_0xfe02('0x16'),_0xfe02('0x17')],'raw':!![]})['then'](function(_0x4e34b8){_0x291f9a=_0x4e34b8;return db['User'][_0xfe02('0x18')]({'where':{'email':_['map'](_0x2073f5[_0xfe02('0x19')],_0xfe02('0x1a')),'role':{'$or':[_0xfe02('0x1b'),_0xfe02('0x1c'),'agent']}}});})[_0xfe02('0x1d')](function(_0x394ef1){_0xaf0f97=_0x394ef1;if(_0xaf0f97){if(_0xaf0f97[_0xfe02('0x1e')]){return _0x34d3a7(_0xfe02('0x1f'));}else if(_0x291f9a['blockDuration']>0x0){if(_0xaf0f97['blocked']){if(moment(_0xaf0f97['blockedAt'])[_0xfe02('0x20')](_0x291f9a[_0xfe02('0x17')],'minutes')>moment()){return _0x34d3a7(_0xfe02('0x1f'));}else{return utils['clearBlockUser'](_0xaf0f97,0x0,![],null)['then'](function(){return utils[_0xfe02('0x21')](_0xaf0f97);})[_0xfe02('0x1d')](function(){return _0x34d3a7(null,_0xaf0f97);});}}else{return utils[_0xfe02('0x21')](_0xaf0f97)[_0xfe02('0x1d')](function(){return _0x34d3a7(null,_0xaf0f97);});}}else{return utils['getLicense'](_0xaf0f97)[_0xfe02('0x1d')](function(){return _0x34d3a7(null,_0xaf0f97);});}}return _0x34d3a7('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0xfe02('0x22')](function(_0x25d930){_0x34d3a7(_0x25d930);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 15ba923..4a3c695 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 _0xcba7=['exports','express','passport','Router','./authGoogle.controller','../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie'];(function(_0x1ef91b,_0x1d2f1d){var _0x5069ea=function(_0x5c6254){while(--_0x5c6254){_0x1ef91b['push'](_0x1ef91b['shift']());}};_0x5069ea(++_0x1d2f1d);}(_0xcba7,0x199));var _0x7cba=function(_0x25ea25,_0x1e6541){_0x25ea25=_0x25ea25-0x0;var _0x150ba9=_0xcba7[_0x25ea25];return _0x150ba9;};'use strict';var express=require(_0x7cba('0x0'));var passport=require(_0x7cba('0x1'));var router=express[_0x7cba('0x2')]();var controller=require(_0x7cba('0x3'));var userController=require('../user/user.controller.js');var authService=require(_0x7cba('0x4'));router[_0x7cba('0x5')]('/',controller[_0x7cba('0x6')]);router['get'](_0x7cba('0x7'),controller[_0x7cba('0x8')],authService[_0x7cba('0x9')],userController[_0x7cba('0x6')],authService[_0x7cba('0xa')]);module[_0x7cba('0xb')]=router; \ No newline at end of file +var _0xb268=['express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','/callback','callback','isMiddleware','login','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb268,0x114));var _0x8b26=function(_0x4793ec,_0x2c98e7){_0x4793ec=_0x4793ec-0x0;var _0x180cf4=_0xb268[_0x4793ec];return _0x180cf4;};'use strict';var express=require(_0x8b26('0x0'));var passport=require(_0x8b26('0x1'));var router=express[_0x8b26('0x2')]();var controller=require(_0x8b26('0x3'));var userController=require(_0x8b26('0x4'));var authService=require(_0x8b26('0x5'));router['get']('/',controller['login']);router[_0x8b26('0x6')](_0x8b26('0x7'),controller[_0x8b26('0x8')],authService[_0x8b26('0x9')],userController[_0x8b26('0xa')],authService['setTokenCookie']);module[_0x8b26('0xb')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 2be3525..5fe1c57 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 _0x2e35=['Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordExpires','Password\x20reset!','use','util','passport','passport-local','jayson/promise','lodash','randomstring','moment','../../components/auth/service','../../config/utils','client','http','Setting','findOne','blockDuration','then','password','salt','role','blocked','blockedAt','admin','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','disabled','allowedLoginAttempts','add','minutes','clearBlockUser','getLicense','catch','MailAccount','name','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','authentication','auth','user','pass','format','\x22%s\x22\x20<%s>','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','status','message','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','trim','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','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0x2e35,0x1d0));var _0x52e3=function(_0x1e3b31,_0x3e9164){_0x1e3b31=_0x1e3b31-0x0;var _0x2e9bee=_0x2e35[_0x1e3b31];return _0x2e9bee;};'use strict';var util=require(_0x52e3('0x0'));var passport=require(_0x52e3('0x1'));var LocalStrategy=require(_0x52e3('0x2'))['Strategy'];var jayson=require(_0x52e3('0x3'));var _=require(_0x52e3('0x4'));var rs=require(_0x52e3('0x5'));var moment=require(_0x52e3('0x6'));var db=require('../../mysqldb')['db'];var authService=require(_0x52e3('0x7'));var utils=require(_0x52e3('0x8'));var client=jayson[_0x52e3('0x9')][_0x52e3('0xa')]({'port':0x232b});function localAuthenticate(_0x5f117a,_0x483b93,_0x507a6c,_0x21ae13){var _0x4d77a0,_0x4b2662;return db[_0x52e3('0xb')][_0x52e3('0xc')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x52e3('0xd')],'raw':!![]})[_0x52e3('0xe')](function(_0x542097){_0x4d77a0=_0x542097;return _0x5f117a[_0x52e3('0xc')]({'attributes':['id','name',_0x52e3('0xf'),_0x52e3('0x10'),_0x52e3('0x11'),'disabled',_0x52e3('0x12'),_0x52e3('0x13'),'loginAttempts'],'where':{'name':_0x483b93,'role':{'$or':[_0x52e3('0x14'),'user','agent']}}});})['then'](function(_0x478ff9){if(!_0x478ff9||_0x478ff9&&_0x478ff9['name']!==_0x483b93){throw new Error(_0x52e3('0x15'));}else{_0x4b2662=_0x478ff9;return _0x4b2662;}})[_0x52e3('0xe')](function(){_0x4b2662[_0x52e3('0x16')](_0x507a6c,function(_0x1f8f16,_0x46a90b){var _0x445438=_0x4b2662[_0x52e3('0x17')]+0x1;if(_0x1f8f16){return _0x21ae13(_0x1f8f16);}else if(!_0x46a90b){if(_0x4b2662[_0x52e3('0x18')]){return _0x21ae13(null,![],{'message':_0x52e3('0x15')});}else if(_0x4d77a0[_0x52e3('0x19')]>0x0){if(_0x4b2662[_0x52e3('0x12')]){if(_0x4d77a0['blockDuration']>0x0){if(moment(_0x4b2662[_0x52e3('0x13')])[_0x52e3('0x1a')](_0x4d77a0['blockDuration'],_0x52e3('0x1b'))>moment()){return _0x21ae13(null,![],{'message':_0x52e3('0x15')});}else{return utils[_0x52e3('0x1c')](_0x4b2662,_0x445438,![],null)[_0x52e3('0xe')](function(){return _0x21ae13(null,![],{'message':_0x52e3('0x15')});});}}else{return _0x21ae13(null,![],{'message':_0x52e3('0x15')});}}else{if(_0x445438>=_0x4d77a0[_0x52e3('0x19')]){return utils[_0x52e3('0x1c')](_0x4b2662,0x0,!![],moment())[_0x52e3('0xe')](function(){return _0x21ae13(null,![],{'message':_0x52e3('0x15')});});}else{return utils[_0x52e3('0x1c')](_0x4b2662,_0x445438,![],null)[_0x52e3('0xe')](function(){return _0x21ae13(null,![],{'message':_0x52e3('0x15')});});}}}else{return _0x21ae13(null,![],{'message':_0x52e3('0x15')});}}else{if(_0x4b2662[_0x52e3('0x18')]){return _0x21ae13(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x4d77a0['allowedLoginAttempts']>0x0){if(_0x4b2662['blocked']){if(_0x4d77a0[_0x52e3('0xd')]>0x0){if(moment(_0x4b2662['blockedAt'])['add'](_0x4d77a0['blockDuration'],_0x52e3('0x1b'))>moment()){return _0x21ae13(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x52e3('0x1c')](_0x4b2662,0x0,![],null)['then'](function(){return utils[_0x52e3('0x1d')](_0x4b2662);})[_0x52e3('0xe')](function(){return _0x21ae13(null,_0x4b2662);});}}else{return _0x21ae13(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x52e3('0x1c')](_0x4b2662,0x0,![],null)[_0x52e3('0xe')](function(){return utils[_0x52e3('0x1d')](_0x4b2662);})[_0x52e3('0xe')](function(){return _0x21ae13(null,_0x4b2662);})['catch'](function(_0x4db3e3){return _0x21ae13(null,![],_0x4db3e3);});}}else{if(_0x4b2662['blocked']){return _0x21ae13(null,![],{'message':_0x52e3('0x15')});}else{return utils[_0x52e3('0x1d')](_0x4b2662)[_0x52e3('0xe')](function(){return _0x21ae13(null,_0x4b2662);});}}}});})[_0x52e3('0x1e')](function(_0x3fe875){return _0x21ae13(null,![],_0x3fe875);});}function sendServiceMail(_0x5940be){return db[_0x52e3('0x1f')]['find']({'where':{'service':!![]},'attributes':['id',_0x52e3('0x20'),_0x52e3('0x21')],'include':[{'model':db[_0x52e3('0x22')],'as':_0x52e3('0x23')}]})['then'](function(_0x2aa5c7){if(!_0x2aa5c7){throw new Error(_0x52e3('0x24'));}var _0x4885ce={'tls':{'rejectUnauthorized':![]}};if(_0x2aa5c7['Smtp'][_0x52e3('0x25')]){_0x4885ce[_0x52e3('0x25')]=_0x2aa5c7[_0x52e3('0x23')]['service'];}else{_0x4885ce[_0x52e3('0x26')]=_0x2aa5c7[_0x52e3('0x23')][_0x52e3('0x26')];_0x4885ce[_0x52e3('0x27')]=_0x2aa5c7[_0x52e3('0x23')][_0x52e3('0x27')];_0x4885ce['secure']=_0x2aa5c7[_0x52e3('0x23')]['secure'];}if(_0x2aa5c7[_0x52e3('0x23')][_0x52e3('0x28')]){_0x4885ce[_0x52e3('0x29')]={'user':_0x2aa5c7[_0x52e3('0x23')][_0x52e3('0x2a')],'pass':_0x2aa5c7['Smtp'][_0x52e3('0x2b')]};}var _0x4a4c26={'account':_0x4885ce,'message':_['merge']({'from':util[_0x52e3('0x2c')](_0x52e3('0x2d'),_0x2aa5c7[_0x52e3('0x20')],_0x2aa5c7[_0x52e3('0x21')]||_0x2aa5c7[_0x52e3('0x23')]['user'])},_0x5940be)};return client[_0x52e3('0x2e')](_0x52e3('0x2f'),_0x4a4c26);})[_0x52e3('0xe')](function(_0x18970b){if(_0x18970b['error']){throw new Error(util['format'](_0x52e3('0x30'),_0x18970b[_0x52e3('0x31')]['message']||JSON['stringify'](_0x18970b['error'])));}return!![];});}function handleError(_0x39ac64,_0x16faf9,_0x59dda1){return _0x39ac64[_0x52e3('0x32')](_0x16faf9||0x1f4)['send']({'message':_0x59dda1?_0x59dda1[_0x52e3('0x33')]||_0x59dda1:''});}exports[_0x52e3('0x34')]=function(_0x439560,_0x2460c8,_0x208147){passport[_0x52e3('0x16')](_0x52e3('0x35'),function(_0x26fa3f,_0x82b2ad,_0x2a3921){var _0x2d7498=_0x26fa3f||_0x2a3921;if(_0x2d7498){return handleError(_0x2460c8,0x191,_0x2d7498);}if(!_0x82b2ad){return handleError(_0x2460c8,0x194,{'message':_0x52e3('0x36')});}else{var _0x3579c6={'payload':{'id':_0x82b2ad['id'],'role':_0x82b2ad[_0x52e3('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0x52e3('0x37')](_0x3579c6)['then'](function(_0x37238b){_0x2460c8[_0x52e3('0x38')]({'id':_0x82b2ad['id'],'token':_0x37238b,'statusCall':'','isAlreadyLogged':_0x82b2ad[_0x52e3('0x39')]});});}})(_0x439560,_0x2460c8,_0x208147);};exports[_0x52e3('0x3a')]=function(_0x47a274,_0x14c1a6,_0x520f74){if(!_0x47a274['body']['email']){return handleError(_0x14c1a6,0x1f4,{'message':_0x52e3('0x3b')});}var _0x236c61=rs[_0x52e3('0x3c')]();_0x47a274[_0x52e3('0x3d')][_0x52e3('0x21')]=_0x47a274[_0x52e3('0x3d')][_0x52e3('0x21')][_0x52e3('0x3e')]()['toLowerCase']();var _0x40f4ea;return db[_0x52e3('0xb')][_0x52e3('0xc')]({'where':{'id':0x1},'attributes':[_0x52e3('0x19'),_0x52e3('0xd')],'raw':!![]})[_0x52e3('0xe')](function(_0x360e5f){_0x40f4ea=_0x360e5f;return db[_0x52e3('0x3f')][_0x52e3('0x40')]({'where':{'email':_0x47a274[_0x52e3('0x3d')][_0x52e3('0x21')]}});})[_0x52e3('0xe')](function(_0x3e5414){if(!_0x3e5414){throw new Error(_0x52e3('0x41'));}if(_0x3e5414[_0x52e3('0x18')]){throw new Error(_0x52e3('0x42'));}if(_0x3e5414[_0x52e3('0x12')]){if(moment(_0x3e5414['blockedAt'])[_0x52e3('0x1a')](_0x40f4ea['blockDuration'],_0x52e3('0x1b'))>moment()){throw new Error(_0x52e3('0x43'));}else{_0x3e5414['blocked']=![];_0x3e5414[_0x52e3('0x13')]=null;}}_0x3e5414[_0x52e3('0x44')]=_0x236c61;_0x3e5414['resetPasswordExpires']=Date[_0x52e3('0x45')]()+0x36ee80;return _0x3e5414[_0x52e3('0x46')]();})[_0x52e3('0xe')](function(){return sendServiceMail({'to':_0x47a274[_0x52e3('0x3d')][_0x52e3('0x21')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x52e3('0x47')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x52e3('0x48')+_0x47a274[_0x52e3('0x49')]['host']+'/reset/'+_0x236c61+'\x0a\x0a'+_0x52e3('0x4a')});})['then'](function(){_0x14c1a6['status'](0xc8)[_0x52e3('0x4b')]({'message':_0x52e3('0x4c')});})[_0x52e3('0x1e')](function(_0x5a6897){return handleError(_0x14c1a6,0x1f4,_0x5a6897);});};exports[_0x52e3('0x4d')]=function(_0x4dc088,_0x44491f,_0x5e7ff2){return db[_0x52e3('0x3f')][_0x52e3('0x40')]({'where':{'resetPasswordToken':_0x4dc088[_0x52e3('0x4e')][_0x52e3('0x4f')],'resetPasswordExpires':{'$gt':Date[_0x52e3('0x45')]()}}})[_0x52e3('0xe')](function(_0x4a2c2f){if(!_0x4a2c2f){throw new Error(_0x52e3('0x50'));}return db[_0x52e3('0xb')][_0x52e3('0xc')]({'attributes':['id',_0x52e3('0x51'),_0x52e3('0x52'),_0x52e3('0x53')]})[_0x52e3('0xe')](function(_0x107b03){if(_0x107b03[_0x52e3('0x51')])authService[_0x52e3('0x54')](_0x4dc088[_0x52e3('0x3d')][_0x52e3('0xf')]);if(!_0x107b03[_0x52e3('0x52')]||!_0x4a2c2f[_0x52e3('0x55')])return _0x4a2c2f;authService[_0x52e3('0x56')](_0x4dc088['body']['password'],_0x4a2c2f[_0x52e3('0x55')],_0x107b03[_0x52e3('0x53')]);return _0x4a2c2f;})[_0x52e3('0xe')](function(){_0x4a2c2f['password']=_0x4dc088[_0x52e3('0x3d')][_0x52e3('0xf')];_0x4a2c2f[_0x52e3('0x44')]=null;_0x4a2c2f[_0x52e3('0x57')]=null;return _0x4a2c2f[_0x52e3('0x46')]();});})['then'](function(){_0x44491f[_0x52e3('0x32')](0xc8)[_0x52e3('0x4b')]({'message':_0x52e3('0x58')});})[_0x52e3('0x1e')](function(_0x1e986e){return handleError(_0x44491f,0x1f4,_0x1e986e);});};passport[_0x52e3('0x59')](new LocalStrategy({'usernameField':_0x52e3('0x20'),'passwordField':_0x52e3('0xf')},function(_0x11e318,_0x2f08c4,_0x73512b){return localAuthenticate(db[_0x52e3('0x3f')],_0x11e318,_0x2f08c4,_0x73512b);})); \ No newline at end of file +var _0x5ce6=['authenticate','blocked','blockDuration','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','add','getLicense','catch','MailAccount','find','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','secure','authentication','auth','pass','merge','format','request','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','email','Email\x20parameter\x20is\x20missing','trim','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../components/auth/service','../../config/utils','client','http','findOne','allowedLoginAttempts','then','password','salt','role','disabled','blockedAt','loginAttempts','admin','user','name'];(function(_0x164735,_0x307209){var _0x49804a=function(_0x9cc28){while(--_0x9cc28){_0x164735['push'](_0x164735['shift']());}};_0x49804a(++_0x307209);}(_0x5ce6,0xee));var _0x65ce=function(_0x2d23d2,_0x494788){_0x2d23d2=_0x2d23d2-0x0;var _0xcc59f1=_0x5ce6[_0x2d23d2];return _0xcc59f1;};'use strict';var util=require('util');var passport=require(_0x65ce('0x0'));var LocalStrategy=require(_0x65ce('0x1'))[_0x65ce('0x2')];var jayson=require(_0x65ce('0x3'));var _=require(_0x65ce('0x4'));var rs=require(_0x65ce('0x5'));var moment=require(_0x65ce('0x6'));var db=require('../../mysqldb')['db'];var authService=require(_0x65ce('0x7'));var utils=require(_0x65ce('0x8'));var client=jayson[_0x65ce('0x9')][_0x65ce('0xa')]({'port':0x232b});function localAuthenticate(_0x53afee,_0x1a6018,_0x1a3021,_0x4b6ab2){var _0x49a56b,_0xc99619;return db['Setting'][_0x65ce('0xb')]({'where':{'id':0x1},'attributes':[_0x65ce('0xc'),'blockDuration'],'raw':!![]})[_0x65ce('0xd')](function(_0x4995dd){_0x49a56b=_0x4995dd;return _0x53afee['findOne']({'attributes':['id','name',_0x65ce('0xe'),_0x65ce('0xf'),_0x65ce('0x10'),_0x65ce('0x11'),'blocked',_0x65ce('0x12'),_0x65ce('0x13')],'where':{'name':_0x1a6018,'role':{'$or':[_0x65ce('0x14'),_0x65ce('0x15'),'agent']}}});})[_0x65ce('0xd')](function(_0x26b897){if(!_0x26b897||_0x26b897&&_0x26b897[_0x65ce('0x16')]!==_0x1a6018){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0xc99619=_0x26b897;return _0xc99619;}})[_0x65ce('0xd')](function(){_0xc99619[_0x65ce('0x17')](_0x1a3021,function(_0x52f0a7,_0xfd6b83){var _0x46d483=_0xc99619[_0x65ce('0x13')]+0x1;if(_0x52f0a7){return _0x4b6ab2(_0x52f0a7);}else if(!_0xfd6b83){if(_0xc99619[_0x65ce('0x11')]){return _0x4b6ab2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x49a56b[_0x65ce('0xc')]>0x0){if(_0xc99619[_0x65ce('0x18')]){if(_0x49a56b[_0x65ce('0x19')]>0x0){if(moment(_0xc99619[_0x65ce('0x12')])['add'](_0x49a56b[_0x65ce('0x19')],_0x65ce('0x1a'))>moment()){return _0x4b6ab2(null,![],{'message':_0x65ce('0x1b')});}else{return utils['clearBlockUser'](_0xc99619,_0x46d483,![],null)[_0x65ce('0xd')](function(){return _0x4b6ab2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x4b6ab2(null,![],{'message':_0x65ce('0x1b')});}}else{if(_0x46d483>=_0x49a56b['allowedLoginAttempts']){return utils[_0x65ce('0x1c')](_0xc99619,0x0,!![],moment())[_0x65ce('0xd')](function(){return _0x4b6ab2(null,![],{'message':_0x65ce('0x1b')});});}else{return utils[_0x65ce('0x1c')](_0xc99619,_0x46d483,![],null)['then'](function(){return _0x4b6ab2(null,![],{'message':_0x65ce('0x1b')});});}}}else{return _0x4b6ab2(null,![],{'message':_0x65ce('0x1b')});}}else{if(_0xc99619['disabled']){return _0x4b6ab2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x49a56b[_0x65ce('0xc')]>0x0){if(_0xc99619[_0x65ce('0x18')]){if(_0x49a56b['blockDuration']>0x0){if(moment(_0xc99619['blockedAt'])[_0x65ce('0x1d')](_0x49a56b['blockDuration'],_0x65ce('0x1a'))>moment()){return _0x4b6ab2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x65ce('0x1c')](_0xc99619,0x0,![],null)[_0x65ce('0xd')](function(){return utils[_0x65ce('0x1e')](_0xc99619);})[_0x65ce('0xd')](function(){return _0x4b6ab2(null,_0xc99619);});}}else{return _0x4b6ab2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x65ce('0x1c')](_0xc99619,0x0,![],null)[_0x65ce('0xd')](function(){return utils[_0x65ce('0x1e')](_0xc99619);})[_0x65ce('0xd')](function(){return _0x4b6ab2(null,_0xc99619);})[_0x65ce('0x1f')](function(_0x362604){return _0x4b6ab2(null,![],_0x362604);});}}else{if(_0xc99619[_0x65ce('0x18')]){return _0x4b6ab2(null,![],{'message':_0x65ce('0x1b')});}else{return utils['getLicense'](_0xc99619)['then'](function(){return _0x4b6ab2(null,_0xc99619);});}}}});})[_0x65ce('0x1f')](function(_0x1c61eb){return _0x4b6ab2(null,![],_0x1c61eb);});}function sendServiceMail(_0x4e33bf){return db[_0x65ce('0x20')][_0x65ce('0x21')]({'where':{'service':!![]},'attributes':['id',_0x65ce('0x16'),'email'],'include':[{'model':db[_0x65ce('0x22')],'as':'Smtp'}]})[_0x65ce('0xd')](function(_0x340bbb){if(!_0x340bbb){throw new Error(_0x65ce('0x23'));}var _0x4e858c={'tls':{'rejectUnauthorized':![]}};if(_0x340bbb[_0x65ce('0x24')]['service']){_0x4e858c['service']=_0x340bbb[_0x65ce('0x24')][_0x65ce('0x25')];}else{_0x4e858c[_0x65ce('0x26')]=_0x340bbb[_0x65ce('0x24')][_0x65ce('0x26')];_0x4e858c[_0x65ce('0x27')]=_0x340bbb['Smtp'][_0x65ce('0x27')];_0x4e858c[_0x65ce('0x28')]=_0x340bbb[_0x65ce('0x24')]['secure'];}if(_0x340bbb['Smtp'][_0x65ce('0x29')]){_0x4e858c[_0x65ce('0x2a')]={'user':_0x340bbb[_0x65ce('0x24')][_0x65ce('0x15')],'pass':_0x340bbb['Smtp'][_0x65ce('0x2b')]};}var _0x142036={'account':_0x4e858c,'message':_[_0x65ce('0x2c')]({'from':util[_0x65ce('0x2d')]('\x22%s\x22\x20<%s>',_0x340bbb[_0x65ce('0x16')],_0x340bbb['email']||_0x340bbb['Smtp'][_0x65ce('0x15')])},_0x4e33bf)};return client[_0x65ce('0x2e')]('SendMail',_0x142036);})[_0x65ce('0xd')](function(_0x3db0f9){if(_0x3db0f9['error']){throw new Error(util[_0x65ce('0x2d')](_0x65ce('0x2f'),_0x3db0f9['error']['message']||JSON[_0x65ce('0x30')](_0x3db0f9['error'])));}return!![];});}function handleError(_0x47828c,_0x51fa8d,_0x20d38d){return _0x47828c[_0x65ce('0x31')](_0x51fa8d||0x1f4)[_0x65ce('0x32')]({'message':_0x20d38d?_0x20d38d[_0x65ce('0x33')]||_0x20d38d:''});}exports[_0x65ce('0x34')]=function(_0x4bd221,_0x209145,_0x19fc3b){passport['authenticate']('local',function(_0x4f281e,_0x186a47,_0x52c5be){var _0x2a0a26=_0x4f281e||_0x52c5be;if(_0x2a0a26){return handleError(_0x209145,0x191,_0x2a0a26);}if(!_0x186a47){return handleError(_0x209145,0x194,{'message':_0x65ce('0x35')});}else{var _0x1b8160={'payload':{'id':_0x186a47['id'],'role':_0x186a47[_0x65ce('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0x65ce('0x36')](_0x1b8160)['then'](function(_0x336fbe){_0x209145[_0x65ce('0x37')]({'id':_0x186a47['id'],'token':_0x336fbe,'statusCall':'','isAlreadyLogged':_0x186a47[_0x65ce('0x38')]});});}})(_0x4bd221,_0x209145,_0x19fc3b);};exports[_0x65ce('0x39')]=function(_0x1f0728,_0xc156b5,_0x499ab0){if(!_0x1f0728[_0x65ce('0x3a')][_0x65ce('0x3b')]){return handleError(_0xc156b5,0x1f4,{'message':_0x65ce('0x3c')});}var _0x25b2f1=rs['generate']();_0x1f0728[_0x65ce('0x3a')][_0x65ce('0x3b')]=_0x1f0728[_0x65ce('0x3a')][_0x65ce('0x3b')][_0x65ce('0x3d')]()[_0x65ce('0x3e')]();var _0x37cc87;return db[_0x65ce('0x3f')][_0x65ce('0xb')]({'where':{'id':0x1},'attributes':[_0x65ce('0xc'),_0x65ce('0x19')],'raw':!![]})['then'](function(_0x198e39){_0x37cc87=_0x198e39;return db[_0x65ce('0x40')][_0x65ce('0x21')]({'where':{'email':_0x1f0728[_0x65ce('0x3a')][_0x65ce('0x3b')]}});})['then'](function(_0x582a57){if(!_0x582a57){throw new Error(_0x65ce('0x41'));}if(_0x582a57[_0x65ce('0x11')]){throw new Error(_0x65ce('0x42'));}if(_0x582a57[_0x65ce('0x18')]){if(moment(_0x582a57[_0x65ce('0x12')])[_0x65ce('0x1d')](_0x37cc87[_0x65ce('0x19')],'minutes')>moment()){throw new Error(_0x65ce('0x43'));}else{_0x582a57[_0x65ce('0x18')]=![];_0x582a57[_0x65ce('0x12')]=null;}}_0x582a57[_0x65ce('0x44')]=_0x25b2f1;_0x582a57[_0x65ce('0x45')]=Date[_0x65ce('0x46')]()+0x36ee80;return _0x582a57[_0x65ce('0x47')]();})[_0x65ce('0xd')](function(){return sendServiceMail({'to':_0x1f0728[_0x65ce('0x3a')]['email'],'subject':_0x65ce('0x48'),'text':_0x65ce('0x49')+_0x65ce('0x4a')+_0x65ce('0x4b')+_0x1f0728[_0x65ce('0x4c')][_0x65ce('0x26')]+'/reset/'+_0x25b2f1+'\x0a\x0a'+_0x65ce('0x4d')});})['then'](function(){_0xc156b5[_0x65ce('0x31')](0xc8)[_0x65ce('0x32')]({'message':_0x65ce('0x4e')});})[_0x65ce('0x1f')](function(_0x4600b2){return handleError(_0xc156b5,0x1f4,_0x4600b2);});};exports['reset']=function(_0x32fada,_0x5189df,_0x5281c3){return db[_0x65ce('0x40')][_0x65ce('0x21')]({'where':{'resetPasswordToken':_0x32fada[_0x65ce('0x4f')][_0x65ce('0x50')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x65ce('0xd')](function(_0x4fd3d0){if(!_0x4fd3d0){throw new Error(_0x65ce('0x51'));}return db['Setting'][_0x65ce('0xb')]({'attributes':['id',_0x65ce('0x52'),_0x65ce('0x53'),_0x65ce('0x54')]})[_0x65ce('0xd')](function(_0x5d6e69){if(_0x5d6e69[_0x65ce('0x52')])authService['validatePasswordPattern'](_0x32fada[_0x65ce('0x3a')]['password']);if(!_0x5d6e69[_0x65ce('0x53')]||!_0x4fd3d0[_0x65ce('0x55')])return _0x4fd3d0;authService[_0x65ce('0x56')](_0x32fada['body']['password'],_0x4fd3d0[_0x65ce('0x55')],_0x5d6e69[_0x65ce('0x54')]);return _0x4fd3d0;})[_0x65ce('0xd')](function(){_0x4fd3d0['password']=_0x32fada[_0x65ce('0x3a')][_0x65ce('0xe')];_0x4fd3d0[_0x65ce('0x44')]=null;_0x4fd3d0[_0x65ce('0x45')]=null;return _0x4fd3d0[_0x65ce('0x47')]();});})[_0x65ce('0xd')](function(){_0x5189df[_0x65ce('0x31')](0xc8)[_0x65ce('0x32')]({'message':'Password\x20reset!'});})[_0x65ce('0x1f')](function(_0x135de1){return handleError(_0x5189df,0x1f4,_0x135de1);});};passport['use'](new LocalStrategy({'usernameField':'name','passwordField':_0x65ce('0xe')},function(_0x5341a3,_0x2f4e58,_0xe52352){return localAuthenticate(db['User'],_0x5341a3,_0x2f4e58,_0xe52352);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index c59e82b..8973224 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 _0xe491=['/reset/:token','reset','exports','express','Router','./authLocal.controller','login','post','/forgot','forgot'];(function(_0x51ac7f,_0x4c08b5){var _0x13b3f2=function(_0x178eaa){while(--_0x178eaa){_0x51ac7f['push'](_0x51ac7f['shift']());}};_0x13b3f2(++_0x4c08b5);}(_0xe491,0x175));var _0x1e49=function(_0x5801f7,_0x5ae3da){_0x5801f7=_0x5801f7-0x0;var _0x1e79c8=_0xe491[_0x5801f7];return _0x1e79c8;};'use strict';var express=require(_0x1e49('0x0'));var router=express[_0x1e49('0x1')]();var controller=require(_0x1e49('0x2'));router['post']('/',controller[_0x1e49('0x3')]);router[_0x1e49('0x4')](_0x1e49('0x5'),controller[_0x1e49('0x6')]);router[_0x1e49('0x4')](_0x1e49('0x7'),controller[_0x1e49('0x8')]);module[_0x1e49('0x9')]=router; \ No newline at end of file +var _0xb717=['forgot','post','/reset/:token','reset','exports','express','Router','./authLocal.controller','login','/forgot'];(function(_0x47b456,_0x173597){var _0x30551c=function(_0x504570){while(--_0x504570){_0x47b456['push'](_0x47b456['shift']());}};_0x30551c(++_0x173597);}(_0xb717,0xf5));var _0x7b71=function(_0x291967,_0x380df9){_0x291967=_0x291967-0x0;var _0x128ca7=_0xb717[_0x291967];return _0x128ca7;};'use strict';var express=require(_0x7b71('0x0'));var router=express[_0x7b71('0x1')]();var controller=require(_0x7b71('0x2'));router['post']('/',controller[_0x7b71('0x3')]);router['post'](_0x7b71('0x4'),controller[_0x7b71('0x5')]);router[_0x7b71('0x6')](_0x7b71('0x7'),controller[_0x7b71('0x8')]);module[_0x7b71('0x9')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index a359beb..b2ee0b9 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 _0xe190=['sequelize','STRING','BOOLEAN','INTEGER'];(function(_0x494451,_0x54b7fe){var _0x3b4f04=function(_0x20c41d){while(--_0x20c41d){_0x494451['push'](_0x494451['shift']());}};_0x3b4f04(++_0x54b7fe);}(_0xe190,0x64));var _0x0e19=function(_0x71d4f3,_0x4662e1){_0x71d4f3=_0x71d4f3-0x0;var _0x330245=_0xe190[_0x71d4f3];return _0x330245;};'use strict';var Sequelize=require(_0x0e19('0x0'));module['exports']={'name':{'type':Sequelize[_0x0e19('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x0e19('0x1')]},'description':{'type':Sequelize[_0x0e19('0x1')]},'status':{'type':Sequelize[_0x0e19('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x0e19('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0x7d6b=['INTEGER','sequelize','STRING'];(function(_0x1fddfd,_0x153a74){var _0x595b32=function(_0x2512d4){while(--_0x2512d4){_0x1fddfd['push'](_0x1fddfd['shift']());}};_0x595b32(++_0x153a74);}(_0x7d6b,0x1c9));var _0xb7d6=function(_0x189c28,_0x26e114){_0x189c28=_0x189c28-0x0;var _0x2ca13f=_0x7d6b[_0x189c28];return _0x2ca13f;};'use strict';var Sequelize=require(_0xb7d6('0x0'));module['exports']={'name':{'type':Sequelize[_0xb7d6('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xb7d6('0x1')]},'description':{'type':Sequelize[_0xb7d6('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xb7d6('0x2')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index c551ae7..2581d5d 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 _0x319c=['catch','destroy','addConditions','Condition','ids','getConditions','findOne','hasOwnProperty','addActions','Action','omit','getActions','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','order','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','findAll','rows','show','params','keys','include','find','create','body'];(function(_0x3f74da,_0x22b3da){var _0x73d29c=function(_0x2aeced){while(--_0x2aeced){_0x3f74da['push'](_0x3f74da['shift']());}};_0x73d29c(++_0x22b3da);}(_0x319c,0xb6));var _0xc319=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x319c[_0x39096d];return _0x13da4f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc319('0x0'));var zipdir=require(_0xc319('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc319('0x2'));var moment=require(_0xc319('0x3'));var BPromise=require(_0xc319('0x4'));var Mustache=require(_0xc319('0x5'));var util=require(_0xc319('0x6'));var path=require(_0xc319('0x7'));var sox=require(_0xc319('0x8'));var csv=require(_0xc319('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc319('0xa'));var _=require(_0xc319('0xb'));var squel=require(_0xc319('0xc'));var crypto=require(_0xc319('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc319('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc319('0xf'));var Papa=require(_0xc319('0x10'));var Redis=require(_0xc319('0x11'));var authService=require(_0xc319('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc319('0x13'))(_0xc319('0x14'));var utils=require('../../config/utils');var config=require(_0xc319('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc319('0x16'))['db'];function respondWithStatusCode(_0x9beca9,_0x1d2d4e){_0x1d2d4e=_0x1d2d4e||0xcc;return function(_0x1cccda){if(_0x1cccda){return _0x9beca9[_0xc319('0x17')](_0x1d2d4e);}return _0x9beca9[_0xc319('0x18')](_0x1d2d4e)[_0xc319('0x19')]();};}function respondWithResult(_0x385ab4,_0x35bfae){_0x35bfae=_0x35bfae||0xc8;return function(_0x460ece){if(_0x460ece){return _0x385ab4[_0xc319('0x18')](_0x35bfae)[_0xc319('0x1a')](_0x460ece);}};}function respondWithFilteredResult(_0x41308d,_0x5b3568){return function(_0x581641){if(_0x581641){var _0x3a86a2=typeof _0x5b3568[_0xc319('0x1b')]===_0xc319('0x1c')&&typeof _0x5b3568[_0xc319('0x1d')]===_0xc319('0x1c');var _0x4930a5=_0x581641['count'];var _0x19ec94=_0x3a86a2?0x0:_0x5b3568[_0xc319('0x1b')];var _0x348111=_0x3a86a2?_0x581641['count']:_0x5b3568['offset']+_0x5b3568[_0xc319('0x1d')];var _0xa82f47;if(_0x348111>=_0x4930a5){_0x348111=_0x4930a5;_0xa82f47=0xc8;}else{_0xa82f47=0xce;}_0x41308d[_0xc319('0x18')](_0xa82f47);return _0x41308d[_0xc319('0x1e')](_0xc319('0x1f'),_0x19ec94+'-'+_0x348111+'/'+_0x4930a5)[_0xc319('0x1a')](_0x581641);}return null;};}function patchUpdates(_0x5463e9){return function(_0x4f9086){try{jsonpatch[_0xc319('0x20')](_0x4f9086,_0x5463e9,!![]);}catch(_0x584208){return BPromise[_0xc319('0x21')](_0x584208);}return _0x4f9086[_0xc319('0x22')]();};}function saveUpdates(_0x3c8314,_0x5706ef){return function(_0x49f284){if(_0x49f284){return _0x49f284['update'](_0x3c8314)['then'](function(_0x2dbadc){return _0x2dbadc;});}return null;};}function removeEntity(_0x2484ba,_0x5c60e7){return function(_0x411668){if(_0x411668){return _0x411668['destroy']()[_0xc319('0x23')](function(){_0x2484ba[_0xc319('0x18')](0xcc)[_0xc319('0x19')]();});}};}function handleEntityNotFound(_0x22bcee,_0x1670b1){return function(_0x19d893){if(!_0x19d893){_0x22bcee[_0xc319('0x17')](0x194);}return _0x19d893;};}function handleError(_0x5abf54,_0x17500a){_0x17500a=_0x17500a||0x1f4;return function(_0x1d45ce){logger[_0xc319('0x24')](_0x1d45ce[_0xc319('0x25')]);if(_0x1d45ce[_0xc319('0x26')]){delete _0x1d45ce[_0xc319('0x26')];}_0x5abf54[_0xc319('0x18')](_0x17500a)[_0xc319('0x27')](_0x1d45ce);};}exports[_0xc319('0x28')]=function(_0x2431ff,_0x1a47ee){var _0x391a57={},_0x571e85={},_0x6a9f3a={'count':0x0,'rows':[]};var _0x467fc7=_[_0xc319('0x29')](db[_0xc319('0x2a')][_0xc319('0x2b')],function(_0x1dde14){return{'name':_0x1dde14[_0xc319('0x2c')],'type':_0x1dde14[_0xc319('0x2d')][_0xc319('0x2e')]};});_0x571e85[_0xc319('0x2f')]=_[_0xc319('0x29')](_0x467fc7,_0xc319('0x26'));_0x571e85['query']=_['keys'](_0x2431ff[_0xc319('0x30')]);_0x571e85[_0xc319('0x31')]=_['intersection'](_0x571e85[_0xc319('0x2f')],_0x571e85[_0xc319('0x30')]);_0x391a57[_0xc319('0x32')]=_[_0xc319('0x33')](_0x571e85[_0xc319('0x2f')],qs['fields'](_0x2431ff[_0xc319('0x30')][_0xc319('0x34')]));_0x391a57['attributes']=_0x391a57[_0xc319('0x32')][_0xc319('0x35')]?_0x391a57['attributes']:_0x571e85[_0xc319('0x2f')];if(!_0x2431ff[_0xc319('0x30')]['hasOwnProperty']('nolimit')){_0x391a57[_0xc319('0x1d')]=qs[_0xc319('0x1d')](_0x2431ff[_0xc319('0x30')][_0xc319('0x1d')]);_0x391a57['offset']=qs['offset'](_0x2431ff[_0xc319('0x30')][_0xc319('0x1b')]);}_0x391a57[_0xc319('0x36')]=qs['sort'](_0x2431ff[_0xc319('0x30')][_0xc319('0x37')]);_0x391a57['where']=qs[_0xc319('0x31')](_[_0xc319('0x38')](_0x2431ff[_0xc319('0x30')],_0x571e85[_0xc319('0x31')]),_0x467fc7);if(_0x2431ff[_0xc319('0x30')][_0xc319('0x39')]){_0x391a57[_0xc319('0x3a')]=_[_0xc319('0x3b')](_0x391a57[_0xc319('0x3a')],{'$or':_[_0xc319('0x29')](_0x467fc7,function(_0x15ebcd){if(_0x15ebcd[_0xc319('0x2d')]!==_0xc319('0x3c')){var _0x54c7c6={};_0x54c7c6[_0x15ebcd['name']]={'$like':'%'+_0x2431ff[_0xc319('0x30')][_0xc319('0x39')]+'%'};return _0x54c7c6;}})});}_0x391a57=_[_0xc319('0x3b')]({},_0x391a57,_0x2431ff[_0xc319('0x3d')]);var _0x81b6f3={'where':_0x391a57['where']};return db[_0xc319('0x2a')][_0xc319('0x3e')](_0x81b6f3)[_0xc319('0x23')](function(_0x2325b6){_0x6a9f3a[_0xc319('0x3e')]=_0x2325b6;if(_0x2431ff[_0xc319('0x30')][_0xc319('0x3f')]){_0x391a57['include']=[{'all':!![]}];}return db[_0xc319('0x2a')][_0xc319('0x40')](_0x391a57);})[_0xc319('0x23')](function(_0x424b6a){_0x6a9f3a[_0xc319('0x41')]=_0x424b6a;return _0x6a9f3a;})[_0xc319('0x23')](respondWithFilteredResult(_0x1a47ee,_0x391a57))['catch'](handleError(_0x1a47ee,null));};exports[_0xc319('0x42')]=function(_0x1159e9,_0x2ea476){var _0x36ac18={'raw':![],'where':{'id':_0x1159e9[_0xc319('0x43')]['id']}},_0x362cd3={};_0x362cd3[_0xc319('0x2f')]=_[_0xc319('0x44')](db['Automation']['rawAttributes']);_0x362cd3['query']=_['keys'](_0x1159e9[_0xc319('0x30')]);_0x362cd3[_0xc319('0x31')]=_[_0xc319('0x33')](_0x362cd3[_0xc319('0x2f')],_0x362cd3[_0xc319('0x30')]);_0x36ac18[_0xc319('0x32')]=_[_0xc319('0x33')](_0x362cd3[_0xc319('0x2f')],qs[_0xc319('0x34')](_0x1159e9[_0xc319('0x30')][_0xc319('0x34')]));_0x36ac18[_0xc319('0x32')]=_0x36ac18[_0xc319('0x32')][_0xc319('0x35')]?_0x36ac18[_0xc319('0x32')]:_0x362cd3[_0xc319('0x2f')];if(_0x1159e9[_0xc319('0x30')]['includeAll']){_0x36ac18[_0xc319('0x45')]=[{'all':!![]}];}_0x36ac18=_['merge']({},_0x36ac18,_0x1159e9[_0xc319('0x3d')]);return db[_0xc319('0x2a')][_0xc319('0x46')](_0x36ac18)[_0xc319('0x23')](handleEntityNotFound(_0x2ea476,null))[_0xc319('0x23')](respondWithResult(_0x2ea476,null))['catch'](handleError(_0x2ea476,null));};exports[_0xc319('0x47')]=function(_0x1b6c95,_0x545b21){return db[_0xc319('0x2a')][_0xc319('0x47')](_0x1b6c95['body'],{})[_0xc319('0x23')](respondWithResult(_0x545b21,0xc9))['catch'](handleError(_0x545b21,null));};exports['update']=function(_0x3b2af7,_0x59afe3){if(_0x3b2af7[_0xc319('0x48')]['id']){delete _0x3b2af7[_0xc319('0x48')]['id'];}return db['Automation'][_0xc319('0x46')]({'where':{'id':_0x3b2af7['params']['id']}})[_0xc319('0x23')](handleEntityNotFound(_0x59afe3,null))[_0xc319('0x23')](saveUpdates(_0x3b2af7[_0xc319('0x48')],null))[_0xc319('0x23')](respondWithResult(_0x59afe3,null))[_0xc319('0x49')](handleError(_0x59afe3,null));};exports[_0xc319('0x4a')]=function(_0x48bc5f,_0x267bbb){return db[_0xc319('0x2a')][_0xc319('0x46')]({'where':{'id':_0x48bc5f[_0xc319('0x43')]['id']}})[_0xc319('0x23')](handleEntityNotFound(_0x267bbb,null))[_0xc319('0x23')](removeEntity(_0x267bbb,null))[_0xc319('0x49')](handleError(_0x267bbb,null));};exports[_0xc319('0x4b')]=function(_0x4d5549,_0x4cae1c,_0x40b32e){return db[_0xc319('0x4c')][_0xc319('0x46')]({'where':{'id':_0x4d5549['params']['id']}})['then'](handleEntityNotFound(_0x4cae1c,null))[_0xc319('0x23')](function(_0x2ca3cf){if(_0x2ca3cf){return _0x2ca3cf[_0xc319('0x4b')](_0x4d5549[_0xc319('0x48')][_0xc319('0x4d')],_['omit'](_0x4d5549[_0xc319('0x48')],['ids','id'])||{});}})[_0xc319('0x23')](respondWithResult(_0x4cae1c,null))[_0xc319('0x49')](handleError(_0x4cae1c,null));};exports[_0xc319('0x4e')]=function(_0x3fecd6,_0x15143d,_0x149dc7){var _0x3fa487={};var _0x32d1c6={};var _0x44cc13;var _0x45eab6;return db[_0xc319('0x2a')][_0xc319('0x4f')]({'where':{'id':_0x3fecd6[_0xc319('0x43')]['id']}})[_0xc319('0x23')](handleEntityNotFound(_0x15143d,null))[_0xc319('0x23')](function(_0x52e1f1){if(_0x52e1f1){_0x44cc13=_0x52e1f1;_0x32d1c6['model']=_[_0xc319('0x44')](db[_0xc319('0x4c')][_0xc319('0x2b')]);_0x32d1c6[_0xc319('0x30')]=_[_0xc319('0x44')](_0x3fecd6['query']);_0x32d1c6['filters']=_['intersection'](_0x32d1c6[_0xc319('0x2f')],_0x32d1c6[_0xc319('0x30')]);_0x3fa487[_0xc319('0x32')]=_['intersection'](_0x32d1c6[_0xc319('0x2f')],qs['fields'](_0x3fecd6['query'][_0xc319('0x34')]));_0x3fa487[_0xc319('0x32')]=_0x3fa487[_0xc319('0x32')][_0xc319('0x35')]?_0x3fa487['attributes']:_0x32d1c6['model'];_0x3fa487[_0xc319('0x36')]=qs[_0xc319('0x37')](_0x3fecd6[_0xc319('0x30')][_0xc319('0x37')]);_0x3fa487['where']=qs['filters'](_['pick'](_0x3fecd6['query'],_0x32d1c6[_0xc319('0x31')]));if(_0x3fecd6[_0xc319('0x30')]['filter']){_0x3fa487[_0xc319('0x3a')]=_['merge'](_0x3fa487['where'],{'$or':_[_0xc319('0x29')](_0x3fa487[_0xc319('0x32')],function(_0xc61b82){var _0x4c822a={};_0x4c822a[_0xc61b82]={'$like':'%'+_0x3fecd6[_0xc319('0x30')][_0xc319('0x39')]+'%'};return _0x4c822a;})});}_0x3fa487=_[_0xc319('0x3b')]({},_0x3fa487,_0x3fecd6[_0xc319('0x3d')]);return _0x44cc13[_0xc319('0x4e')](_0x3fa487);}})[_0xc319('0x23')](function(_0x249672){if(_0x249672){_0x45eab6=_0x249672[_0xc319('0x35')];if(!_0x3fecd6[_0xc319('0x30')][_0xc319('0x50')]('nolimit')){_0x3fa487[_0xc319('0x1d')]=qs[_0xc319('0x1d')](_0x3fecd6[_0xc319('0x30')][_0xc319('0x1d')]);_0x3fa487[_0xc319('0x1b')]=qs[_0xc319('0x1b')](_0x3fecd6['query'][_0xc319('0x1b')]);}return _0x44cc13['getConditions'](_0x3fa487);}})[_0xc319('0x23')](function(_0x212729){if(_0x212729){return _0x212729?{'count':_0x45eab6,'rows':_0x212729}:null;}})[_0xc319('0x23')](respondWithResult(_0x15143d,null))[_0xc319('0x49')](handleError(_0x15143d,null));};exports[_0xc319('0x51')]=function(_0x31ad7c,_0x2964ca,_0x2ae14c){return db[_0xc319('0x52')][_0xc319('0x46')]({'where':{'id':_0x31ad7c[_0xc319('0x43')]['id']}})[_0xc319('0x23')](handleEntityNotFound(_0x2964ca,null))['then'](function(_0x5b713b){if(_0x5b713b){return _0x5b713b[_0xc319('0x51')](_0x31ad7c[_0xc319('0x48')][_0xc319('0x4d')],_[_0xc319('0x53')](_0x31ad7c[_0xc319('0x48')],[_0xc319('0x4d'),'id'])||{});}})[_0xc319('0x23')](respondWithResult(_0x2964ca,null))['catch'](handleError(_0x2964ca,null));};exports[_0xc319('0x54')]=function(_0x580d5e,_0x1c597d,_0x348774){var _0x5a8558={};var _0x420760={};var _0x359000;var _0x1d8005;return db[_0xc319('0x2a')][_0xc319('0x4f')]({'where':{'id':_0x580d5e[_0xc319('0x43')]['id']}})[_0xc319('0x23')](handleEntityNotFound(_0x1c597d,null))[_0xc319('0x23')](function(_0x4e440e){if(_0x4e440e){_0x359000=_0x4e440e;_0x420760[_0xc319('0x2f')]=_[_0xc319('0x44')](db[_0xc319('0x52')][_0xc319('0x2b')]);_0x420760[_0xc319('0x30')]=_[_0xc319('0x44')](_0x580d5e[_0xc319('0x30')]);_0x420760['filters']=_[_0xc319('0x33')](_0x420760[_0xc319('0x2f')],_0x420760['query']);_0x5a8558['attributes']=_[_0xc319('0x33')](_0x420760[_0xc319('0x2f')],qs[_0xc319('0x34')](_0x580d5e[_0xc319('0x30')][_0xc319('0x34')]));_0x5a8558[_0xc319('0x32')]=_0x5a8558[_0xc319('0x32')]['length']?_0x5a8558[_0xc319('0x32')]:_0x420760['model'];_0x5a8558['order']=qs['sort'](_0x580d5e[_0xc319('0x30')]['sort']);_0x5a8558[_0xc319('0x3a')]=qs[_0xc319('0x31')](_['pick'](_0x580d5e[_0xc319('0x30')],_0x420760[_0xc319('0x31')]));if(_0x580d5e['query'][_0xc319('0x39')]){_0x5a8558['where']=_[_0xc319('0x3b')](_0x5a8558['where'],{'$or':_['map'](_0x5a8558[_0xc319('0x32')],function(_0xde1b2f){var _0xb93f0c={};_0xb93f0c[_0xde1b2f]={'$like':'%'+_0x580d5e[_0xc319('0x30')]['filter']+'%'};return _0xb93f0c;})});}_0x5a8558=_[_0xc319('0x3b')]({},_0x5a8558,_0x580d5e[_0xc319('0x3d')]);return _0x359000[_0xc319('0x54')](_0x5a8558);}})['then'](function(_0x1560cc){if(_0x1560cc){_0x1d8005=_0x1560cc[_0xc319('0x35')];if(!_0x580d5e[_0xc319('0x30')][_0xc319('0x50')]('nolimit')){_0x5a8558[_0xc319('0x1d')]=qs[_0xc319('0x1d')](_0x580d5e[_0xc319('0x30')][_0xc319('0x1d')]);_0x5a8558[_0xc319('0x1b')]=qs['offset'](_0x580d5e['query'][_0xc319('0x1b')]);}return _0x359000['getActions'](_0x5a8558);}})[_0xc319('0x23')](function(_0x220a1c){if(_0x220a1c){return _0x220a1c?{'count':_0x1d8005,'rows':_0x220a1c}:null;}})[_0xc319('0x23')](respondWithResult(_0x1c597d,null))[_0xc319('0x49')](handleError(_0x1c597d,null));}; \ No newline at end of file +var _0xc536=['mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','count','apply','reject','save','update','then','destroy','name','send','index','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','include','Automation','findAll','rows','catch','params','includeAll','options','create','body','find','addConditions','Condition','ids','omit','findOne','map','getConditions','addActions','Action','getActions','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x3dfedc,_0x219a28){var _0x148cd5=function(_0x212b85){while(--_0x212b85){_0x3dfedc['push'](_0x3dfedc['shift']());}};_0x148cd5(++_0x219a28);}(_0xc536,0x9a));var _0x6c53=function(_0x2945ba,_0x1a266d){_0x2945ba=_0x2945ba-0x0;var _0x25c656=_0xc536[_0x2945ba];return _0x25c656;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6c53('0x0'));var jsonpatch=require(_0x6c53('0x1'));var rp=require(_0x6c53('0x2'));var moment=require(_0x6c53('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6c53('0x4'));var util=require(_0x6c53('0x5'));var path=require('path');var sox=require(_0x6c53('0x6'));var csv=require(_0x6c53('0x7'));var ejs=require(_0x6c53('0x8'));var fs=require('fs');var fs_extra=require(_0x6c53('0x9'));var _=require(_0x6c53('0xa'));var squel=require('squel');var crypto=require(_0x6c53('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6c53('0x7'));var querystring=require('querystring');var Papa=require(_0x6c53('0xc'));var Redis=require(_0x6c53('0xd'));var authService=require(_0x6c53('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x6c53('0xf'));var hardwareService=require(_0x6c53('0x10'));var logger=require(_0x6c53('0x11'))(_0x6c53('0x12'));var utils=require(_0x6c53('0x13'));var config=require(_0x6c53('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6c53('0x15'))['db'];function respondWithStatusCode(_0x171207,_0x2436de){_0x2436de=_0x2436de||0xcc;return function(_0x5e7d59){if(_0x5e7d59){return _0x171207['sendStatus'](_0x2436de);}return _0x171207[_0x6c53('0x16')](_0x2436de)[_0x6c53('0x17')]();};}function respondWithResult(_0x36638a,_0x5def7e){_0x5def7e=_0x5def7e||0xc8;return function(_0x498853){if(_0x498853){return _0x36638a[_0x6c53('0x16')](_0x5def7e)[_0x6c53('0x18')](_0x498853);}};}function respondWithFilteredResult(_0x18b1c5,_0x5afacb){return function(_0x3eaf78){if(_0x3eaf78){var _0x161490=typeof _0x5afacb[_0x6c53('0x19')]==='undefined'&&typeof _0x5afacb['limit']==='undefined';var _0x22fa55=_0x3eaf78[_0x6c53('0x1a')];var _0xa33e6d=_0x161490?0x0:_0x5afacb['offset'];var _0xf19944=_0x161490?_0x3eaf78[_0x6c53('0x1a')]:_0x5afacb[_0x6c53('0x19')]+_0x5afacb['limit'];var _0x243342;if(_0xf19944>=_0x22fa55){_0xf19944=_0x22fa55;_0x243342=0xc8;}else{_0x243342=0xce;}_0x18b1c5[_0x6c53('0x16')](_0x243342);return _0x18b1c5['set']('Content-Range',_0xa33e6d+'-'+_0xf19944+'/'+_0x22fa55)[_0x6c53('0x18')](_0x3eaf78);}return null;};}function patchUpdates(_0xac1836){return function(_0x2c68a6){try{jsonpatch[_0x6c53('0x1b')](_0x2c68a6,_0xac1836,!![]);}catch(_0x1e9a8c){return BPromise[_0x6c53('0x1c')](_0x1e9a8c);}return _0x2c68a6[_0x6c53('0x1d')]();};}function saveUpdates(_0x48e220,_0x1e4b01){return function(_0x38ec77){if(_0x38ec77){return _0x38ec77[_0x6c53('0x1e')](_0x48e220)[_0x6c53('0x1f')](function(_0x26660f){return _0x26660f;});}return null;};}function removeEntity(_0x35fcef,_0x34e90c){return function(_0x102723){if(_0x102723){return _0x102723[_0x6c53('0x20')]()[_0x6c53('0x1f')](function(){_0x35fcef[_0x6c53('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c91e4,_0x1c34f7){return function(_0x513776){if(!_0x513776){_0x4c91e4['sendStatus'](0x194);}return _0x513776;};}function handleError(_0x507d1a,_0x28fd9c){_0x28fd9c=_0x28fd9c||0x1f4;return function(_0x3345fc){logger['error'](_0x3345fc['stack']);if(_0x3345fc[_0x6c53('0x21')]){delete _0x3345fc[_0x6c53('0x21')];}_0x507d1a['status'](_0x28fd9c)[_0x6c53('0x22')](_0x3345fc);};}exports[_0x6c53('0x23')]=function(_0x2da5ab,_0x411802){var _0x260e87={},_0x439375={},_0x2395c8={'count':0x0,'rows':[]};var _0x410da4=_['map'](db['Automation'][_0x6c53('0x24')],function(_0x39d74f){return{'name':_0x39d74f[_0x6c53('0x25')],'type':_0x39d74f['type'][_0x6c53('0x26')]};});_0x439375[_0x6c53('0x27')]=_['map'](_0x410da4,'name');_0x439375[_0x6c53('0x28')]=_[_0x6c53('0x29')](_0x2da5ab[_0x6c53('0x28')]);_0x439375[_0x6c53('0x2a')]=_['intersection'](_0x439375[_0x6c53('0x27')],_0x439375[_0x6c53('0x28')]);_0x260e87[_0x6c53('0x2b')]=_[_0x6c53('0x2c')](_0x439375[_0x6c53('0x27')],qs[_0x6c53('0x2d')](_0x2da5ab[_0x6c53('0x28')][_0x6c53('0x2d')]));_0x260e87['attributes']=_0x260e87['attributes'][_0x6c53('0x2e')]?_0x260e87['attributes']:_0x439375[_0x6c53('0x27')];if(!_0x2da5ab[_0x6c53('0x28')][_0x6c53('0x2f')](_0x6c53('0x30'))){_0x260e87[_0x6c53('0x31')]=qs[_0x6c53('0x31')](_0x2da5ab[_0x6c53('0x28')]['limit']);_0x260e87[_0x6c53('0x19')]=qs[_0x6c53('0x19')](_0x2da5ab['query'][_0x6c53('0x19')]);}_0x260e87[_0x6c53('0x32')]=qs['sort'](_0x2da5ab['query'][_0x6c53('0x33')]);_0x260e87[_0x6c53('0x34')]=qs['filters'](_[_0x6c53('0x35')](_0x2da5ab['query'],_0x439375[_0x6c53('0x2a')]),_0x410da4);if(_0x2da5ab[_0x6c53('0x28')][_0x6c53('0x36')]){_0x260e87[_0x6c53('0x34')]=_[_0x6c53('0x37')](_0x260e87[_0x6c53('0x34')],{'$or':_['map'](_0x410da4,function(_0x423275){if(_0x423275[_0x6c53('0x38')]!==_0x6c53('0x39')){var _0x4ef4ee={};_0x4ef4ee[_0x423275[_0x6c53('0x21')]]={'$like':'%'+_0x2da5ab[_0x6c53('0x28')][_0x6c53('0x36')]+'%'};return _0x4ef4ee;}})});}_0x260e87=_['merge']({},_0x260e87,_0x2da5ab['options']);var _0x116240={'where':_0x260e87[_0x6c53('0x34')]};return db['Automation'][_0x6c53('0x1a')](_0x116240)[_0x6c53('0x1f')](function(_0x234c5f){_0x2395c8[_0x6c53('0x1a')]=_0x234c5f;if(_0x2da5ab['query']['includeAll']){_0x260e87[_0x6c53('0x3a')]=[{'all':!![]}];}return db[_0x6c53('0x3b')][_0x6c53('0x3c')](_0x260e87);})[_0x6c53('0x1f')](function(_0x2e3506){_0x2395c8[_0x6c53('0x3d')]=_0x2e3506;return _0x2395c8;})['then'](respondWithFilteredResult(_0x411802,_0x260e87))[_0x6c53('0x3e')](handleError(_0x411802,null));};exports['show']=function(_0x350dc4,_0x40d1b3){var _0x4425f2={'raw':![],'where':{'id':_0x350dc4[_0x6c53('0x3f')]['id']}},_0x7202cf={};_0x7202cf[_0x6c53('0x27')]=_[_0x6c53('0x29')](db[_0x6c53('0x3b')][_0x6c53('0x24')]);_0x7202cf['query']=_[_0x6c53('0x29')](_0x350dc4['query']);_0x7202cf[_0x6c53('0x2a')]=_[_0x6c53('0x2c')](_0x7202cf[_0x6c53('0x27')],_0x7202cf['query']);_0x4425f2[_0x6c53('0x2b')]=_[_0x6c53('0x2c')](_0x7202cf[_0x6c53('0x27')],qs['fields'](_0x350dc4[_0x6c53('0x28')][_0x6c53('0x2d')]));_0x4425f2[_0x6c53('0x2b')]=_0x4425f2[_0x6c53('0x2b')]['length']?_0x4425f2[_0x6c53('0x2b')]:_0x7202cf[_0x6c53('0x27')];if(_0x350dc4['query'][_0x6c53('0x40')]){_0x4425f2[_0x6c53('0x3a')]=[{'all':!![]}];}_0x4425f2=_[_0x6c53('0x37')]({},_0x4425f2,_0x350dc4[_0x6c53('0x41')]);return db[_0x6c53('0x3b')]['find'](_0x4425f2)['then'](handleEntityNotFound(_0x40d1b3,null))[_0x6c53('0x1f')](respondWithResult(_0x40d1b3,null))[_0x6c53('0x3e')](handleError(_0x40d1b3,null));};exports[_0x6c53('0x42')]=function(_0x4a9cf8,_0x41fec1){return db[_0x6c53('0x3b')][_0x6c53('0x42')](_0x4a9cf8[_0x6c53('0x43')],{})[_0x6c53('0x1f')](respondWithResult(_0x41fec1,0xc9))['catch'](handleError(_0x41fec1,null));};exports['update']=function(_0x50809e,_0x4502e4){if(_0x50809e['body']['id']){delete _0x50809e[_0x6c53('0x43')]['id'];}return db['Automation'][_0x6c53('0x44')]({'where':{'id':_0x50809e['params']['id']}})[_0x6c53('0x1f')](handleEntityNotFound(_0x4502e4,null))['then'](saveUpdates(_0x50809e[_0x6c53('0x43')],null))[_0x6c53('0x1f')](respondWithResult(_0x4502e4,null))[_0x6c53('0x3e')](handleError(_0x4502e4,null));};exports[_0x6c53('0x20')]=function(_0x550805,_0x11ba2a){return db[_0x6c53('0x3b')]['find']({'where':{'id':_0x550805[_0x6c53('0x3f')]['id']}})[_0x6c53('0x1f')](handleEntityNotFound(_0x11ba2a,null))['then'](removeEntity(_0x11ba2a,null))[_0x6c53('0x3e')](handleError(_0x11ba2a,null));};exports[_0x6c53('0x45')]=function(_0x4d43f9,_0xe424b9,_0x55f5b1){return db[_0x6c53('0x46')][_0x6c53('0x44')]({'where':{'id':_0x4d43f9[_0x6c53('0x3f')]['id']}})[_0x6c53('0x1f')](handleEntityNotFound(_0xe424b9,null))['then'](function(_0x341e3d){if(_0x341e3d){return _0x341e3d[_0x6c53('0x45')](_0x4d43f9[_0x6c53('0x43')][_0x6c53('0x47')],_[_0x6c53('0x48')](_0x4d43f9[_0x6c53('0x43')],[_0x6c53('0x47'),'id'])||{});}})[_0x6c53('0x1f')](respondWithResult(_0xe424b9,null))[_0x6c53('0x3e')](handleError(_0xe424b9,null));};exports['getConditions']=function(_0x317bda,_0x3baa7b,_0x1db9d5){var _0x2dc6b8={};var _0x58a3b9={};var _0x3d0d6d;var _0x1a7a12;return db[_0x6c53('0x3b')][_0x6c53('0x49')]({'where':{'id':_0x317bda['params']['id']}})['then'](handleEntityNotFound(_0x3baa7b,null))['then'](function(_0x2d90cb){if(_0x2d90cb){_0x3d0d6d=_0x2d90cb;_0x58a3b9[_0x6c53('0x27')]=_[_0x6c53('0x29')](db[_0x6c53('0x46')][_0x6c53('0x24')]);_0x58a3b9[_0x6c53('0x28')]=_[_0x6c53('0x29')](_0x317bda[_0x6c53('0x28')]);_0x58a3b9['filters']=_[_0x6c53('0x2c')](_0x58a3b9[_0x6c53('0x27')],_0x58a3b9[_0x6c53('0x28')]);_0x2dc6b8[_0x6c53('0x2b')]=_[_0x6c53('0x2c')](_0x58a3b9['model'],qs[_0x6c53('0x2d')](_0x317bda['query'][_0x6c53('0x2d')]));_0x2dc6b8[_0x6c53('0x2b')]=_0x2dc6b8['attributes']['length']?_0x2dc6b8[_0x6c53('0x2b')]:_0x58a3b9[_0x6c53('0x27')];_0x2dc6b8[_0x6c53('0x32')]=qs[_0x6c53('0x33')](_0x317bda[_0x6c53('0x28')]['sort']);_0x2dc6b8[_0x6c53('0x34')]=qs[_0x6c53('0x2a')](_[_0x6c53('0x35')](_0x317bda[_0x6c53('0x28')],_0x58a3b9['filters']));if(_0x317bda['query'][_0x6c53('0x36')]){_0x2dc6b8[_0x6c53('0x34')]=_['merge'](_0x2dc6b8[_0x6c53('0x34')],{'$or':_[_0x6c53('0x4a')](_0x2dc6b8[_0x6c53('0x2b')],function(_0x19d9b1){var _0x27e9f5={};_0x27e9f5[_0x19d9b1]={'$like':'%'+_0x317bda[_0x6c53('0x28')][_0x6c53('0x36')]+'%'};return _0x27e9f5;})});}_0x2dc6b8=_[_0x6c53('0x37')]({},_0x2dc6b8,_0x317bda[_0x6c53('0x41')]);return _0x3d0d6d[_0x6c53('0x4b')](_0x2dc6b8);}})[_0x6c53('0x1f')](function(_0x521e5f){if(_0x521e5f){_0x1a7a12=_0x521e5f[_0x6c53('0x2e')];if(!_0x317bda['query'][_0x6c53('0x2f')](_0x6c53('0x30'))){_0x2dc6b8['limit']=qs[_0x6c53('0x31')](_0x317bda[_0x6c53('0x28')][_0x6c53('0x31')]);_0x2dc6b8[_0x6c53('0x19')]=qs[_0x6c53('0x19')](_0x317bda[_0x6c53('0x28')]['offset']);}return _0x3d0d6d[_0x6c53('0x4b')](_0x2dc6b8);}})['then'](function(_0x49ce7a){if(_0x49ce7a){return _0x49ce7a?{'count':_0x1a7a12,'rows':_0x49ce7a}:null;}})['then'](respondWithResult(_0x3baa7b,null))[_0x6c53('0x3e')](handleError(_0x3baa7b,null));};exports[_0x6c53('0x4c')]=function(_0x48823b,_0x62537a,_0x1ca5f1){return db[_0x6c53('0x4d')][_0x6c53('0x44')]({'where':{'id':_0x48823b[_0x6c53('0x3f')]['id']}})[_0x6c53('0x1f')](handleEntityNotFound(_0x62537a,null))[_0x6c53('0x1f')](function(_0x449b7e){if(_0x449b7e){return _0x449b7e[_0x6c53('0x4c')](_0x48823b[_0x6c53('0x43')][_0x6c53('0x47')],_[_0x6c53('0x48')](_0x48823b[_0x6c53('0x43')],[_0x6c53('0x47'),'id'])||{});}})[_0x6c53('0x1f')](respondWithResult(_0x62537a,null))[_0x6c53('0x3e')](handleError(_0x62537a,null));};exports[_0x6c53('0x4e')]=function(_0x15b6ac,_0x839e14,_0x1d0946){var _0x4544c={};var _0x295b46={};var _0x1a5c01;var _0x319bff;return db[_0x6c53('0x3b')][_0x6c53('0x49')]({'where':{'id':_0x15b6ac[_0x6c53('0x3f')]['id']}})[_0x6c53('0x1f')](handleEntityNotFound(_0x839e14,null))[_0x6c53('0x1f')](function(_0x132b16){if(_0x132b16){_0x1a5c01=_0x132b16;_0x295b46[_0x6c53('0x27')]=_[_0x6c53('0x29')](db[_0x6c53('0x4d')][_0x6c53('0x24')]);_0x295b46[_0x6c53('0x28')]=_[_0x6c53('0x29')](_0x15b6ac[_0x6c53('0x28')]);_0x295b46[_0x6c53('0x2a')]=_[_0x6c53('0x2c')](_0x295b46['model'],_0x295b46['query']);_0x4544c['attributes']=_[_0x6c53('0x2c')](_0x295b46['model'],qs[_0x6c53('0x2d')](_0x15b6ac[_0x6c53('0x28')][_0x6c53('0x2d')]));_0x4544c['attributes']=_0x4544c[_0x6c53('0x2b')]['length']?_0x4544c[_0x6c53('0x2b')]:_0x295b46[_0x6c53('0x27')];_0x4544c[_0x6c53('0x32')]=qs[_0x6c53('0x33')](_0x15b6ac[_0x6c53('0x28')][_0x6c53('0x33')]);_0x4544c[_0x6c53('0x34')]=qs[_0x6c53('0x2a')](_['pick'](_0x15b6ac['query'],_0x295b46[_0x6c53('0x2a')]));if(_0x15b6ac['query']['filter']){_0x4544c[_0x6c53('0x34')]=_[_0x6c53('0x37')](_0x4544c[_0x6c53('0x34')],{'$or':_[_0x6c53('0x4a')](_0x4544c[_0x6c53('0x2b')],function(_0x3999bf){var _0x27154d={};_0x27154d[_0x3999bf]={'$like':'%'+_0x15b6ac['query'][_0x6c53('0x36')]+'%'};return _0x27154d;})});}_0x4544c=_[_0x6c53('0x37')]({},_0x4544c,_0x15b6ac[_0x6c53('0x41')]);return _0x1a5c01['getActions'](_0x4544c);}})['then'](function(_0x500f2c){if(_0x500f2c){_0x319bff=_0x500f2c[_0x6c53('0x2e')];if(!_0x15b6ac[_0x6c53('0x28')][_0x6c53('0x2f')](_0x6c53('0x30'))){_0x4544c[_0x6c53('0x31')]=qs[_0x6c53('0x31')](_0x15b6ac[_0x6c53('0x28')][_0x6c53('0x31')]);_0x4544c['offset']=qs[_0x6c53('0x19')](_0x15b6ac[_0x6c53('0x28')][_0x6c53('0x19')]);}return _0x1a5c01[_0x6c53('0x4e')](_0x4544c);}})['then'](function(_0x4cf468){if(_0x4cf468){return _0x4cf468?{'count':_0x319bff,'rows':_0x4cf468}:null;}})[_0x6c53('0x1f')](respondWithResult(_0x839e14,null))['catch'](handleError(_0x839e14,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index bfd669b..0611398 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 _0xbcd9=['../../config/environment','./automation.attributes','exports','Automation','tools_automations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x2ab51e,_0x3077d7){var _0xf58a1e=function(_0x5910fa){while(--_0x5910fa){_0x2ab51e['push'](_0x2ab51e['shift']());}};_0xf58a1e(++_0x3077d7);}(_0xbcd9,0x1d9));var _0x9bcd=function(_0x5a63a7,_0xd00609){_0x5a63a7=_0x5a63a7-0x0;var _0x31e73c=_0xbcd9[_0x5a63a7];return _0x31e73c;};'use strict';var _=require(_0x9bcd('0x0'));var util=require(_0x9bcd('0x1'));var logger=require(_0x9bcd('0x2'))(_0x9bcd('0x3'));var moment=require(_0x9bcd('0x4'));var BPromise=require('bluebird');var rp=require(_0x9bcd('0x5'));var fs=require('fs');var path=require(_0x9bcd('0x6'));var rimraf=require(_0x9bcd('0x7'));var config=require(_0x9bcd('0x8'));var attributes=require(_0x9bcd('0x9'));module[_0x9bcd('0xa')]=function(_0x10854f,_0x436a2b){return _0x10854f['define'](_0x9bcd('0xb'),attributes,{'tableName':_0x9bcd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9acc=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash'];(function(_0x5d5499,_0x24a4f0){var _0x38ad7f=function(_0x419766){while(--_0x419766){_0x5d5499['push'](_0x5d5499['shift']());}};_0x38ad7f(++_0x24a4f0);}(_0x9acc,0xa8));var _0xc9ac=function(_0x4bf1e3,_0x22d016){_0x4bf1e3=_0x4bf1e3-0x0;var _0x533270=_0x9acc[_0x4bf1e3];return _0x533270;};'use strict';var _=require(_0xc9ac('0x0'));var util=require(_0xc9ac('0x1'));var logger=require(_0xc9ac('0x2'))('api');var moment=require(_0xc9ac('0x3'));var BPromise=require(_0xc9ac('0x4'));var rp=require(_0xc9ac('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc9ac('0x6'));var config=require(_0xc9ac('0x7'));var attributes=require(_0xc9ac('0x8'));module[_0xc9ac('0x9')]=function(_0x15dcb0,_0x5a46fe){return _0x15dcb0[_0xc9ac('0xa')](_0xc9ac('0xb'),attributes,{'tableName':_0xc9ac('0xc'),'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 ef42009..14472af 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 _0xcac3=['message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x44105a,_0xd3d69f){var _0x2d3b6d=function(_0x56192e){while(--_0x56192e){_0x44105a['push'](_0x44105a['shift']());}};_0x2d3b6d(++_0xd3d69f);}(_0xcac3,0x193));var _0x3cac=function(_0x3fcf30,_0xe3a49e){_0x3fcf30=_0x3fcf30-0x0;var _0x2ed4b0=_0xcac3[_0x3fcf30];return _0x2ed4b0;};'use strict';var _=require('lodash');var util=require(_0x3cac('0x0'));var moment=require(_0x3cac('0x1'));var BPromise=require(_0x3cac('0x2'));var rs=require(_0x3cac('0x3'));var fs=require('fs');var Redis=require(_0x3cac('0x4'));var db=require(_0x3cac('0x5'))['db'];var utils=require(_0x3cac('0x6'));var logger=require(_0x3cac('0x7'))(_0x3cac('0x8'));var config=require(_0x3cac('0x9'));var jayson=require(_0x3cac('0xa'));var client=jayson[_0x3cac('0xb')][_0x3cac('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1e2560,_0x14562c,_0x21365c){return new BPromise(function(_0x13c1b9,_0x55670d){return client[_0x3cac('0xd')](_0x1e2560,_0x21365c)[_0x3cac('0xe')](function(_0x3bcbed){logger[_0x3cac('0xf')](_0x3cac('0x10'),_0x14562c,'request\x20sent');logger[_0x3cac('0x11')](_0x3cac('0x12'),_0x14562c,_0x3cac('0x13'),JSON[_0x3cac('0x14')](_0x3bcbed));if(_0x3bcbed[_0x3cac('0x15')]){if(_0x3bcbed['error']['code']===0x1f4){logger[_0x3cac('0x15')](_0x3cac('0x10'),_0x14562c,_0x3bcbed[_0x3cac('0x15')][_0x3cac('0x16')]);return _0x55670d(_0x3bcbed[_0x3cac('0x15')][_0x3cac('0x16')]);}logger[_0x3cac('0x15')]('Automation,\x20%s,\x20%s',_0x14562c,_0x3bcbed[_0x3cac('0x15')][_0x3cac('0x16')]);return _0x13c1b9(_0x3bcbed[_0x3cac('0x15')][_0x3cac('0x16')]);}else{logger[_0x3cac('0xf')](_0x3cac('0x10'),_0x14562c,_0x3cac('0x13'));_0x13c1b9(_0x3bcbed[_0x3cac('0x17')][_0x3cac('0x16')]);}})[_0x3cac('0x18')](function(_0x4173ca){logger[_0x3cac('0x15')](_0x3cac('0x10'),_0x14562c,_0x4173ca);_0x55670d(_0x4173ca);});});} \ No newline at end of file +var _0x57c3=['rpc','jayson/promise','http','request','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4cf205,_0xb79c74){var _0x2c3942=function(_0x355b39){while(--_0x355b39){_0x4cf205['push'](_0x4cf205['shift']());}};_0x2c3942(++_0xb79c74);}(_0x57c3,0xc2));var _0x357c=function(_0x21a062,_0x4f96dd){_0x21a062=_0x21a062-0x0;var _0x105e62=_0x57c3[_0x21a062];return _0x105e62;};'use strict';var _=require(_0x357c('0x0'));var util=require(_0x357c('0x1'));var moment=require(_0x357c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x357c('0x3'))['db'];var utils=require(_0x357c('0x4'));var logger=require(_0x357c('0x5'))(_0x357c('0x6'));var config=require('../../config/environment');var jayson=require(_0x357c('0x7'));var client=jayson['client'][_0x357c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x471e56,_0x2320eb,_0x44d3ee){return new BPromise(function(_0x1fc04b,_0x1e4977){return client[_0x357c('0x9')](_0x471e56,_0x44d3ee)['then'](function(_0x5dd3dd){logger[_0x357c('0xa')](_0x357c('0xb'),_0x2320eb,_0x357c('0xc'));logger[_0x357c('0xd')](_0x357c('0xe'),_0x2320eb,_0x357c('0xc'),JSON[_0x357c('0xf')](_0x5dd3dd));if(_0x5dd3dd[_0x357c('0x10')]){if(_0x5dd3dd[_0x357c('0x10')][_0x357c('0x11')]===0x1f4){logger[_0x357c('0x10')]('Automation,\x20%s,\x20%s',_0x2320eb,_0x5dd3dd[_0x357c('0x10')][_0x357c('0x12')]);return _0x1e4977(_0x5dd3dd[_0x357c('0x10')]['message']);}logger['error'](_0x357c('0xb'),_0x2320eb,_0x5dd3dd[_0x357c('0x10')][_0x357c('0x12')]);return _0x1fc04b(_0x5dd3dd[_0x357c('0x10')][_0x357c('0x12')]);}else{logger[_0x357c('0xa')]('Automation,\x20%s,\x20%s',_0x2320eb,_0x357c('0xc'));_0x1fc04b(_0x5dd3dd[_0x357c('0x13')]['message']);}})['catch'](function(_0x105d19){logger[_0x357c('0x10')](_0x357c('0xb'),_0x2320eb,_0x105d19);_0x1e4977(_0x105d19);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 929390d..601c486 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 _0xea09=['fs-extra','../../components/auth/service','./automation.controller','get','index','/:id','isAuthenticated','show','/:id/conditions','/:id/actions','getActions','post','create','addConditions','put','update','delete','exports','path'];(function(_0x2e2662,_0x5e7547){var _0x193f57=function(_0x3f7ec0){while(--_0x3f7ec0){_0x2e2662['push'](_0x2e2662['shift']());}};_0x193f57(++_0x5e7547);}(_0xea09,0xd0));var _0x9ea0=function(_0x3f0e9b,_0x2ceb53){_0x3f0e9b=_0x3f0e9b-0x0;var _0x40eeac=_0xea09[_0x3f0e9b];return _0x40eeac;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9ea0('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x9ea0('0x1'));var auth=require(_0x9ea0('0x2'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9ea0('0x3'));router[_0x9ea0('0x4')]('/',auth['isAuthenticated'](),controller[_0x9ea0('0x5')]);router[_0x9ea0('0x4')](_0x9ea0('0x6'),auth[_0x9ea0('0x7')](),controller[_0x9ea0('0x8')]);router[_0x9ea0('0x4')](_0x9ea0('0x9'),auth[_0x9ea0('0x7')](),controller['getConditions']);router[_0x9ea0('0x4')](_0x9ea0('0xa'),auth[_0x9ea0('0x7')](),controller[_0x9ea0('0xb')]);router[_0x9ea0('0xc')]('/',auth['isAuthenticated'](),controller[_0x9ea0('0xd')]);router[_0x9ea0('0xc')](_0x9ea0('0x9'),auth['isAuthenticated'](),controller[_0x9ea0('0xe')]);router['post']('/:id/actions',auth[_0x9ea0('0x7')](),controller['addActions']);router[_0x9ea0('0xf')](_0x9ea0('0x6'),auth[_0x9ea0('0x7')](),controller[_0x9ea0('0x10')]);router[_0x9ea0('0x11')](_0x9ea0('0x6'),auth[_0x9ea0('0x7')](),controller['destroy']);module[_0x9ea0('0x12')]=router; \ No newline at end of file +var _0x6d0b=['/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','create','addConditions','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','index','get'];(function(_0x3d775c,_0x1ec3f9){var _0x5bc3a1=function(_0x214b4e){while(--_0x214b4e){_0x3d775c['push'](_0x3d775c['shift']());}};_0x5bc3a1(++_0x1ec3f9);}(_0x6d0b,0x71));var _0xb6d0=function(_0x4e6265,_0x27612b){_0x4e6265=_0x4e6265-0x0;var _0x2e4f4c=_0x6d0b[_0x4e6265];return _0x2e4f4c;};'use strict';var multer=require(_0xb6d0('0x0'));var util=require('util');var path=require(_0xb6d0('0x1'));var timeout=require('connect-timeout');var express=require(_0xb6d0('0x2'));var router=express[_0xb6d0('0x3')]();var fs_extra=require(_0xb6d0('0x4'));var auth=require(_0xb6d0('0x5'));var interaction=require(_0xb6d0('0x6'));var config=require(_0xb6d0('0x7'));var controller=require(_0xb6d0('0x8'));router['get']('/',auth[_0xb6d0('0x9')](),controller[_0xb6d0('0xa')]);router[_0xb6d0('0xb')](_0xb6d0('0xc'),auth[_0xb6d0('0x9')](),controller[_0xb6d0('0xd')]);router[_0xb6d0('0xb')](_0xb6d0('0xe'),auth[_0xb6d0('0x9')](),controller[_0xb6d0('0xf')]);router[_0xb6d0('0xb')](_0xb6d0('0x10'),auth['isAuthenticated'](),controller[_0xb6d0('0x11')]);router['post']('/',auth[_0xb6d0('0x9')](),controller[_0xb6d0('0x12')]);router['post']('/:id/conditions',auth['isAuthenticated'](),controller[_0xb6d0('0x13')]);router['post']('/:id/actions',auth['isAuthenticated'](),controller['addActions']);router[_0xb6d0('0x14')](_0xb6d0('0xc'),auth[_0xb6d0('0x9')](),controller[_0xb6d0('0x15')]);router[_0xb6d0('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xb6d0('0x17')]);module[_0xb6d0('0x18')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 3797d7b..87d0cad 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 _0x7f81=['Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','#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)','07:00-22:00,*,*,*','always','never','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC'];(function(_0x3bf999,_0x516512){var _0x4f8efb=function(_0x3b9d31){while(--_0x3b9d31){_0x3bf999['push'](_0x3bf999['shift']());}};_0x4f8efb(++_0x516512);}(_0x7f81,0xc1));var _0x17f8=function(_0xca02e,_0x3cb1e6){_0xca02e=_0xca02e-0x0;var _0x59ca1b=_0x7f81[_0xca02e];return _0x59ca1b;};'use strict';var Sequelize=require(_0x17f8('0x0'));module['exports']={'name':{'type':Sequelize[_0x17f8('0x1')],'unique':_0x17f8('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x17f8('0x3')](_0x17f8('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x17f8('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x17f8('0x5')},'limitCalls':{'type':Sequelize[_0x17f8('0x6')](0x4)[_0x17f8('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x17f8('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x17f8('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x17f8('0x6')](0x3)[_0x17f8('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x17f8('0x6')](0x3)[_0x17f8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x17f8('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x17f8('0x6')](0x5)[_0x17f8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x17f8('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x17f8('0x6')](0x3)[_0x17f8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x17f8('0xb')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x17f8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x17f8('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x17f8('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x17f8('0x6')](0x5)[_0x17f8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x17f8('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x17f8('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x17f8('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0x17f8('0x3')](_0x17f8('0xf'),_0x17f8('0x10'),_0x17f8('0x11')),'defaultValue':_0x17f8('0xf')},'dialAMDActive':{'type':Sequelize[_0x17f8('0x12')],'defaultValue':0x0,'comment':_0x17f8('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x17f8('0x6')](0x9)[_0x17f8('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x17f8('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x17f8('0x6')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x17f8('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x17f8('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x17f8('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x17f8('0x6')](0x9)[_0x17f8('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x17f8('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x17f8('0x6')](0x9)[_0x17f8('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x17f8('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x17f8('0x6')](0x9)[_0x17f8('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x17f8('0x6')](0x5)[_0x17f8('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x17f8('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x17f8('0x6')](0x9)[_0x17f8('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x17f8('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x17f8('0x3')](_0x17f8('0x1b'),_0x17f8('0x1c')),'defaultValue':_0x17f8('0x1b')},'dialPrefix':{'type':Sequelize[_0x17f8('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x17f8('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x17f8('0x1d')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x17f8('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x17f8('0x6')](0x3)[_0x17f8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x17f8('0x6')](0x5)[_0x17f8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x17f8('0x6')](0x3)[_0x17f8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x17f8('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0x17f8('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x17f8('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x17f8('0x6')](0x3)[_0x17f8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x17f8('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x17f8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x17f8('0x21')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x17f8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x17f8('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0x17f8('0x6')](0x5)[_0x17f8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x17f8('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x17f8('0x6')](0x3)[_0x17f8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x17f8('0x6')](0x5)[_0x17f8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x17f8('0x24')}}; \ No newline at end of file +var _0xdfae=['#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','INTEGER','UNSIGNED','Max\x20200\x20calls.','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)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0xdfae,0x191));var _0xedfa=function(_0x61b3ab,_0x1fc298){_0x61b3ab=_0x61b3ab-0x0;var _0x57097f=_0xdfae[_0x61b3ab];return _0x57097f;};'use strict';var Sequelize=require(_0xedfa('0x0'));module[_0xedfa('0x1')]={'name':{'type':Sequelize[_0xedfa('0x2')],'unique':_0xedfa('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xedfa('0x4')](_0xedfa('0x5')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xedfa('0x2')]},'active':{'type':Sequelize[_0xedfa('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xedfa('0x7')](0x4)[_0xedfa('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xedfa('0x9')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xedfa('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xedfa('0x7')](0x3)[_0xedfa('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xedfa('0xa')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xedfa('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xedfa('0x7')](0x5)[_0xedfa('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xedfa('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0xedfa('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xedfa('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xedfa('0x7')](0x3)[_0xedfa('0x8')],'defaultValue':0x3,'comment':_0xedfa('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xedfa('0x7')](0x5)[_0xedfa('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xedfa('0x7')](0x3)[_0xedfa('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xedfa('0xe')},'dialTimezone':{'type':Sequelize[_0xedfa('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xedfa('0x2')],'defaultValue':_0xedfa('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xedfa('0x4')](_0xedfa('0x10'),_0xedfa('0x11'),'onlyIfOpen'),'defaultValue':_0xedfa('0x10')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xedfa('0x12')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xedfa('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xedfa('0x7')](0x9)[_0xedfa('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xedfa('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xedfa('0x7')](0x9)[_0xedfa('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xedfa('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xedfa('0x7')](0x9)[_0xedfa('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xedfa('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xedfa('0x7')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xedfa('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xedfa('0x7')](0x9)[_0xedfa('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xedfa('0x7')](0x5)[_0xedfa('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xedfa('0x16')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xedfa('0x7')](0x9)[_0xedfa('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xedfa('0x17')},'dialOrderByScheduledAt':{'type':Sequelize[_0xedfa('0x4')](_0xedfa('0x18'),_0xedfa('0x19')),'defaultValue':_0xedfa('0x18')},'dialPrefix':{'type':Sequelize[_0xedfa('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xedfa('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xedfa('0x1a')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xedfa('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xedfa('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xedfa('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xedfa('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xedfa('0x7')](0x5)[_0xedfa('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xedfa('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0xedfa('0x7')](0x3)[_0xedfa('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xedfa('0x7')](0x5)[_0xedfa('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xedfa('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xedfa('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xedfa('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xedfa('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xedfa('0x20')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xedfa('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xedfa('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0xedfa('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xedfa('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xedfa('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xedfa('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xedfa('0x23')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 80b7c15..c092e12 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 _0xaf67=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','pick','CampaignId','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','phone','scheduledAt','ContactId','ListId','updatedAt','select','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','fromQuery','push','all','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','get','IvrCampaigns','UserProfileResource','destroy','sendStatus','name','send','index','map','Campaign','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','rows','show','params','length','include','options','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','clone','keys','omit','createdAt','body'];(function(_0x10627f,_0x1475b9){var _0x6bc342=function(_0x38b59d){while(--_0x38b59d){_0x10627f['push'](_0x10627f['shift']());}};_0x6bc342(++_0x1475b9);}(_0xaf67,0x149));var _0x7af6=function(_0x14480a,_0xc5e791){_0x14480a=_0x14480a-0x0;var _0x4a1a73=_0xaf67[_0x14480a];return _0x4a1a73;};'use strict';var emlformat=require(_0x7af6('0x0'));var rimraf=require(_0x7af6('0x1'));var zipdir=require(_0x7af6('0x2'));var jsonpatch=require(_0x7af6('0x3'));var rp=require(_0x7af6('0x4'));var moment=require(_0x7af6('0x5'));var BPromise=require(_0x7af6('0x6'));var Mustache=require('mustache');var util=require(_0x7af6('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7af6('0x8'));var ejs=require(_0x7af6('0x9'));var fs=require('fs');var fs_extra=require(_0x7af6('0xa'));var _=require(_0x7af6('0xb'));var squel=require(_0x7af6('0xc'));var crypto=require(_0x7af6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7af6('0xe'));var toCsv=require(_0x7af6('0x8'));var querystring=require(_0x7af6('0xf'));var Papa=require(_0x7af6('0x10'));var Redis=require(_0x7af6('0x11'));var authService=require(_0x7af6('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7af6('0x13'));var hardwareService=require(_0x7af6('0x14'));var logger=require(_0x7af6('0x15'))('api');var utils=require(_0x7af6('0x16'));var config=require(_0x7af6('0x17'));var licenseUtil=require(_0x7af6('0x18'));var db=require(_0x7af6('0x19'))['db'];function respondWithStatusCode(_0x2421bd,_0x1d00b3){_0x1d00b3=_0x1d00b3||0xcc;return function(_0x48c4d7){if(_0x48c4d7){return _0x2421bd['sendStatus'](_0x1d00b3);}return _0x2421bd['status'](_0x1d00b3)[_0x7af6('0x1a')]();};}function respondWithResult(_0x5ce7ab,_0x42e212){_0x42e212=_0x42e212||0xc8;return function(_0x535edd){if(_0x535edd){return _0x5ce7ab[_0x7af6('0x1b')](_0x42e212)['json'](_0x535edd);}};}function respondWithFilteredResult(_0x138e10,_0x5c5f07){return function(_0x2e20ff){if(_0x2e20ff){var _0x30a52a=typeof _0x5c5f07['offset']===_0x7af6('0x1c')&&typeof _0x5c5f07[_0x7af6('0x1d')]===_0x7af6('0x1c');var _0x35a4a3=_0x2e20ff[_0x7af6('0x1e')];var _0xf4f6fb=_0x30a52a?0x0:_0x5c5f07[_0x7af6('0x1f')];var _0x3abb85=_0x30a52a?_0x2e20ff[_0x7af6('0x1e')]:_0x5c5f07[_0x7af6('0x1f')]+_0x5c5f07[_0x7af6('0x1d')];var _0x337c0e;if(_0x3abb85>=_0x35a4a3){_0x3abb85=_0x35a4a3;_0x337c0e=0xc8;}else{_0x337c0e=0xce;}_0x138e10[_0x7af6('0x1b')](_0x337c0e);return _0x138e10['set'](_0x7af6('0x20'),_0xf4f6fb+'-'+_0x3abb85+'/'+_0x35a4a3)[_0x7af6('0x21')](_0x2e20ff);}return null;};}function patchUpdates(_0x3a08ab){return function(_0x2b04fd){try{jsonpatch[_0x7af6('0x22')](_0x2b04fd,_0x3a08ab,!![]);}catch(_0x55a70a){return BPromise[_0x7af6('0x23')](_0x55a70a);}return _0x2b04fd[_0x7af6('0x24')]();};}function saveUpdates(_0x1f2be0,_0x43bdd0){return function(_0x3bdeaf){if(_0x3bdeaf){return _0x3bdeaf[_0x7af6('0x25')](_0x1f2be0)[_0x7af6('0x26')](function(_0x19436e){return _0x19436e;});}return null;};}function removeEntity(_0x9f911e,_0x10705c){return function(_0x286caf){if(_0x286caf){return _0x286caf['destroy']()[_0x7af6('0x26')](function(){var _0x15c32e=_0x286caf[_0x7af6('0x27')]({'plain':!![]});var _0x2db58b=_0x7af6('0x28');return db[_0x7af6('0x29')][_0x7af6('0x2a')]({'where':{'type':_0x2db58b,'resourceId':_0x15c32e['id']}})[_0x7af6('0x26')](function(){return _0x286caf;});})[_0x7af6('0x26')](function(){_0x9f911e[_0x7af6('0x1b')](0xcc)[_0x7af6('0x1a')]();});}};}function handleEntityNotFound(_0x1efc18,_0x1bb933){return function(_0x577808){if(!_0x577808){_0x1efc18[_0x7af6('0x2b')](0x194);}return _0x577808;};}function handleError(_0x1113c5,_0x2fd951){_0x2fd951=_0x2fd951||0x1f4;return function(_0x18bde3){logger['error'](_0x18bde3['stack']);if(_0x18bde3[_0x7af6('0x2c')]){delete _0x18bde3[_0x7af6('0x2c')];}_0x1113c5[_0x7af6('0x1b')](_0x2fd951)[_0x7af6('0x2d')](_0x18bde3);};}exports[_0x7af6('0x2e')]=function(_0x392cc3,_0x154d96){var _0x2d3222={},_0x552717={},_0x942807={'count':0x0,'rows':[]};var _0xadbe8a=_[_0x7af6('0x2f')](db[_0x7af6('0x30')][_0x7af6('0x31')],function(_0xae8f7e){return{'name':_0xae8f7e[_0x7af6('0x32')],'type':_0xae8f7e[_0x7af6('0x33')]['key']};});_0x552717[_0x7af6('0x34')]=_[_0x7af6('0x2f')](_0xadbe8a,'name');_0x552717[_0x7af6('0x35')]=_['keys'](_0x392cc3['query']);_0x552717[_0x7af6('0x36')]=_['intersection'](_0x552717[_0x7af6('0x34')],_0x552717[_0x7af6('0x35')]);_0x2d3222[_0x7af6('0x37')]=_[_0x7af6('0x38')](_0x552717[_0x7af6('0x34')],qs[_0x7af6('0x39')](_0x392cc3['query'][_0x7af6('0x39')]));_0x2d3222['attributes']=_0x2d3222[_0x7af6('0x37')]['length']?_0x2d3222[_0x7af6('0x37')]:_0x552717['model'];if(!_0x392cc3[_0x7af6('0x35')][_0x7af6('0x3a')](_0x7af6('0x3b'))){_0x2d3222[_0x7af6('0x1d')]=qs[_0x7af6('0x1d')](_0x392cc3[_0x7af6('0x35')][_0x7af6('0x1d')]);_0x2d3222[_0x7af6('0x1f')]=qs[_0x7af6('0x1f')](_0x392cc3[_0x7af6('0x35')]['offset']);}_0x2d3222[_0x7af6('0x3c')]=qs['sort'](_0x392cc3['query'][_0x7af6('0x3d')]);_0x2d3222[_0x7af6('0x3e')]=qs[_0x7af6('0x36')](_['pick'](_0x392cc3['query'],_0x552717[_0x7af6('0x36')]),_0xadbe8a);if(_0x392cc3[_0x7af6('0x35')]['filter']){_0x2d3222[_0x7af6('0x3e')]=_[_0x7af6('0x3f')](_0x2d3222[_0x7af6('0x3e')],{'$or':_[_0x7af6('0x2f')](_0xadbe8a,function(_0x4aa243){if(_0x4aa243[_0x7af6('0x33')]!==_0x7af6('0x40')){var _0x2f149c={};_0x2f149c[_0x4aa243[_0x7af6('0x2c')]]={'$like':'%'+_0x392cc3[_0x7af6('0x35')][_0x7af6('0x41')]+'%'};return _0x2f149c;}})});}_0x2d3222=_[_0x7af6('0x3f')]({},_0x2d3222,_0x392cc3['options']);var _0x4084a4={'where':_0x2d3222['where']};return db['Campaign'][_0x7af6('0x1e')](_0x4084a4)[_0x7af6('0x26')](function(_0x4c80d8){_0x942807['count']=_0x4c80d8;if(_0x392cc3[_0x7af6('0x35')][_0x7af6('0x42')]){_0x2d3222['include']=[{'all':!![]}];}return db['Campaign']['findAll'](_0x2d3222);})[_0x7af6('0x26')](function(_0xe9df69){_0x942807[_0x7af6('0x43')]=_0xe9df69;return _0x942807;})[_0x7af6('0x26')](respondWithFilteredResult(_0x154d96,_0x2d3222))['catch'](handleError(_0x154d96,null));};exports[_0x7af6('0x44')]=function(_0x364264,_0x56c752){var _0x2eef90={'raw':![],'where':{'id':_0x364264[_0x7af6('0x45')]['id']}},_0x3cde8b={};_0x3cde8b[_0x7af6('0x34')]=_['keys'](db['Campaign'][_0x7af6('0x31')]);_0x3cde8b[_0x7af6('0x35')]=_['keys'](_0x364264[_0x7af6('0x35')]);_0x3cde8b[_0x7af6('0x36')]=_[_0x7af6('0x38')](_0x3cde8b['model'],_0x3cde8b[_0x7af6('0x35')]);_0x2eef90[_0x7af6('0x37')]=_[_0x7af6('0x38')](_0x3cde8b[_0x7af6('0x34')],qs[_0x7af6('0x39')](_0x364264['query']['fields']));_0x2eef90[_0x7af6('0x37')]=_0x2eef90['attributes'][_0x7af6('0x46')]?_0x2eef90[_0x7af6('0x37')]:_0x3cde8b[_0x7af6('0x34')];if(_0x364264['query'][_0x7af6('0x42')]){_0x2eef90[_0x7af6('0x47')]=[{'all':!![]}];}_0x2eef90=_[_0x7af6('0x3f')]({},_0x2eef90,_0x364264[_0x7af6('0x48')]);return db[_0x7af6('0x30')][_0x7af6('0x49')](_0x2eef90)[_0x7af6('0x26')](handleEntityNotFound(_0x56c752,null))[_0x7af6('0x26')](respondWithResult(_0x56c752,null))[_0x7af6('0x4a')](handleError(_0x56c752,null));};exports[_0x7af6('0x4b')]=function(_0x4c5ecf,_0x2ef012){return db[_0x7af6('0x30')][_0x7af6('0x4b')](_0x4c5ecf['body'],{})[_0x7af6('0x26')](function(_0x1d02e2){var _0x343e82=_0x4c5ecf[_0x7af6('0x4c')]['get']({'plain':!![]});if(!_0x343e82)throw new Error(_0x7af6('0x4d'));if(_0x343e82[_0x7af6('0x4e')]===_0x7af6('0x4c')){var _0x4a4a6d=_0x1d02e2[_0x7af6('0x27')]({'plain':!![]});var _0x28f668=_0x7af6('0x28');return db[_0x7af6('0x4f')][_0x7af6('0x49')]({'where':{'name':_0x28f668,'userProfileId':_0x343e82[_0x7af6('0x50')]},'raw':!![]})['then'](function(_0x20ee05){if(_0x20ee05&&_0x20ee05[_0x7af6('0x51')]===0x0){return db[_0x7af6('0x29')][_0x7af6('0x4b')]({'name':_0x4a4a6d['name'],'resourceId':_0x4a4a6d['id'],'type':_0x20ee05['name'],'sectionId':_0x20ee05['id']},{})[_0x7af6('0x26')](function(){return _0x1d02e2;});}else{return _0x1d02e2;}})[_0x7af6('0x4a')](function(_0x2da233){logger[_0x7af6('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2da233);throw _0x2da233;});}return _0x1d02e2;})[_0x7af6('0x26')](respondWithResult(_0x2ef012,0xc9))[_0x7af6('0x4a')](handleError(_0x2ef012,null));};exports[_0x7af6('0x53')]=function(_0x4a56ae,_0x8e1cf){var _0x55483b={'where':{'id':_0x4a56ae[_0x7af6('0x45')]['id']}},_0x2b09bc={};_0x2b09bc[_0x7af6('0x34')]=_[_0x7af6('0x54')](db[_0x7af6('0x30')]['rawAttributes']);_0x55483b[_0x7af6('0x37')]=_[_0x7af6('0x38')](_0x2b09bc[_0x7af6('0x34')],qs[_0x7af6('0x39')](_0x4a56ae[_0x7af6('0x35')][_0x7af6('0x39')]));_0x55483b['attributes']=_0x55483b[_0x7af6('0x37')]['length']?_0x55483b['attributes']:_0x2b09bc[_0x7af6('0x34')];if(_0x4a56ae[_0x7af6('0x35')][_0x7af6('0x42')]){_0x55483b[_0x7af6('0x47')]=[{'all':!![]}];}_0x55483b=_[_0x7af6('0x3f')]({},_0x55483b,_0x4a56ae[_0x7af6('0x48')]);return db['Campaign'][_0x7af6('0x49')](_0x55483b)['then'](handleEntityNotFound(_0x8e1cf,null))[_0x7af6('0x26')](function(_0x19d3dd){if(_0x19d3dd){var _0x614c8f=_0x19d3dd[_0x7af6('0x27')]({'plain':!![]});_0x614c8f=qs[_0x7af6('0x55')](_0x614c8f,['id',_0x7af6('0x56'),'updatedAt']);_0x4a56ae[_0x7af6('0x57')]=_[_0x7af6('0x55')](_0x4a56ae[_0x7af6('0x57')],['id',_0x7af6('0x56'),'updatedAt']);return db['Campaign']['create'](_[_0x7af6('0x3f')](_0x614c8f,_0x4a56ae[_0x7af6('0x57')]),{'include':_0x4a56ae['query'][_0x7af6('0x42')]?[{'all':!![]}]:undefined})[_0x7af6('0x26')](function(_0x34129b){var _0xff840a=_0x4a56ae['user'][_0x7af6('0x27')]({'plain':!![]});if(!_0xff840a)throw new Error(_0x7af6('0x4d'));if(_0xff840a['role']===_0x7af6('0x4c')){var _0x33589a=_0x34129b[_0x7af6('0x27')]({'plain':!![]});var _0x2ac67e=_0x7af6('0x28');return db['UserProfileSection'][_0x7af6('0x49')]({'where':{'name':_0x2ac67e,'userProfileId':_0xff840a[_0x7af6('0x50')]},'raw':!![]})[_0x7af6('0x26')](function(_0x53122f){if(_0x53122f&&_0x53122f[_0x7af6('0x51')]===0x0){return db[_0x7af6('0x29')]['create']({'name':_0x33589a[_0x7af6('0x2c')],'resourceId':_0x33589a['id'],'type':_0x53122f['name'],'sectionId':_0x53122f['id']},{})[_0x7af6('0x26')](function(){return _0x34129b;});}else{return _0x34129b;}})[_0x7af6('0x4a')](function(_0x2e7054){logger[_0x7af6('0x52')](_0x7af6('0x58'),_0x2e7054);throw _0x2e7054;});}return _0x34129b;});}})[_0x7af6('0x26')](respondWithResult(_0x8e1cf,0xc9))[_0x7af6('0x4a')](handleError(_0x8e1cf,null));};exports[_0x7af6('0x25')]=function(_0x5c91fe,_0x24de04){if(_0x5c91fe['body']['id']){delete _0x5c91fe[_0x7af6('0x57')]['id'];}return db['Campaign'][_0x7af6('0x49')]({'where':{'id':_0x5c91fe[_0x7af6('0x45')]['id']}})['then'](handleEntityNotFound(_0x24de04,null))[_0x7af6('0x26')](saveUpdates(_0x5c91fe[_0x7af6('0x57')],null))[_0x7af6('0x26')](respondWithResult(_0x24de04,null))[_0x7af6('0x4a')](handleError(_0x24de04,null));};exports['destroy']=function(_0x535591,_0x5709e9){return db[_0x7af6('0x30')]['find']({'where':{'id':_0x535591['params']['id']}})['then'](handleEntityNotFound(_0x5709e9,null))[_0x7af6('0x26')](removeEntity(_0x5709e9,null))['catch'](handleError(_0x5709e9,null));};exports[_0x7af6('0x59')]=function(_0x164ccc,_0x139ade,_0x5d52a8){var _0x42a6c9={'raw':!![],'where':{}};var _0x1f262c={};var _0x7e54fb={'count':0x0,'rows':[]};return db['Campaign'][_0x7af6('0x5a')]({'where':{'id':_0x164ccc[_0x7af6('0x45')]['id']}})[_0x7af6('0x26')](handleEntityNotFound(_0x139ade,null))[_0x7af6('0x26')](function(_0x269772){if(_0x269772){_0x1f262c[_0x7af6('0x34')]=_[_0x7af6('0x54')](db[_0x7af6('0x5b')][_0x7af6('0x31')]);_0x1f262c[_0x7af6('0x35')]=_[_0x7af6('0x54')](_0x164ccc[_0x7af6('0x35')]);_0x1f262c[_0x7af6('0x36')]=_[_0x7af6('0x38')](_0x1f262c[_0x7af6('0x34')],_0x1f262c['query']);_0x42a6c9['attributes']=_[_0x7af6('0x38')](_0x1f262c[_0x7af6('0x34')],qs[_0x7af6('0x39')](_0x164ccc[_0x7af6('0x35')]['fields']));_0x42a6c9[_0x7af6('0x37')]=_0x42a6c9[_0x7af6('0x37')][_0x7af6('0x46')]?_0x42a6c9[_0x7af6('0x37')]:_0x1f262c[_0x7af6('0x34')];if(!_0x164ccc[_0x7af6('0x35')][_0x7af6('0x3a')]('nolimit')){_0x42a6c9['limit']=qs[_0x7af6('0x1d')](_0x164ccc[_0x7af6('0x35')]['limit']);_0x42a6c9[_0x7af6('0x1f')]=qs[_0x7af6('0x1f')](_0x164ccc[_0x7af6('0x35')][_0x7af6('0x1f')]);}_0x42a6c9['order']=qs['sort'](_0x164ccc['query'][_0x7af6('0x3d')]);_0x42a6c9[_0x7af6('0x3e')]=qs[_0x7af6('0x36')](_[_0x7af6('0x5c')](_0x164ccc['query'],_0x1f262c[_0x7af6('0x36')]));_0x42a6c9[_0x7af6('0x3e')][_0x7af6('0x5d')]=_0x269772['id'];if(_0x164ccc[_0x7af6('0x35')][_0x7af6('0x41')]){_0x42a6c9['where']=_[_0x7af6('0x3f')](_0x42a6c9[_0x7af6('0x3e')],{'$or':_[_0x7af6('0x2f')](_0x42a6c9['attributes'],function(_0x5b1834){var _0x5b3c3f={};_0x5b3c3f[_0x5b1834]={'$like':'%'+_0x164ccc[_0x7af6('0x35')]['filter']+'%'};return _0x5b3c3f;})});}_0x42a6c9=_['merge']({},_0x42a6c9,_0x164ccc[_0x7af6('0x48')]);return db[_0x7af6('0x5b')][_0x7af6('0x1e')]({'where':_0x42a6c9[_0x7af6('0x3e')]})['then'](function(_0x1ea9fa){_0x7e54fb[_0x7af6('0x1e')]=_0x1ea9fa;if(_0x164ccc['query']['includeAll']){_0x42a6c9[_0x7af6('0x47')]=[{'all':!![]}];}return db[_0x7af6('0x5b')][_0x7af6('0x5e')](_0x42a6c9);})['then'](function(_0x31b139){_0x7e54fb[_0x7af6('0x43')]=_0x31b139;return _0x7e54fb;});}})['then'](respondWithFilteredResult(_0x139ade,_0x42a6c9))[_0x7af6('0x4a')](handleError(_0x139ade,null));};exports[_0x7af6('0x5f')]=function(_0x3a79e9,_0x3d0b55,_0x3acd73){var _0x448881={'raw':!![],'where':{}};var _0x3a135a={};var _0x2f6c06={'count':0x0,'rows':[]};return db[_0x7af6('0x30')]['findOne']({'where':{'id':_0x3a79e9['params']['id']}})[_0x7af6('0x26')](handleEntityNotFound(_0x3d0b55,null))['then'](function(_0x5db8a7){if(_0x5db8a7){_0x3a135a[_0x7af6('0x34')]=_[_0x7af6('0x54')](db[_0x7af6('0x60')][_0x7af6('0x31')]);_0x3a135a[_0x7af6('0x35')]=_[_0x7af6('0x54')](_0x3a79e9['query']);_0x3a135a[_0x7af6('0x36')]=_[_0x7af6('0x38')](_0x3a135a[_0x7af6('0x34')],_0x3a135a['query']);_0x448881['attributes']=_[_0x7af6('0x38')](_0x3a135a[_0x7af6('0x34')],qs[_0x7af6('0x39')](_0x3a79e9[_0x7af6('0x35')]['fields']));_0x448881[_0x7af6('0x37')]=_0x448881['attributes'][_0x7af6('0x46')]?_0x448881[_0x7af6('0x37')]:_0x3a135a[_0x7af6('0x34')];if(!_0x3a79e9[_0x7af6('0x35')][_0x7af6('0x3a')](_0x7af6('0x3b'))){_0x448881[_0x7af6('0x1d')]=qs[_0x7af6('0x1d')](_0x3a79e9['query'][_0x7af6('0x1d')]);_0x448881[_0x7af6('0x1f')]=qs[_0x7af6('0x1f')](_0x3a79e9['query'][_0x7af6('0x1f')]);}_0x448881[_0x7af6('0x3c')]=qs[_0x7af6('0x3d')](_0x3a79e9['query'][_0x7af6('0x3d')]);_0x448881['where']=qs[_0x7af6('0x36')](_[_0x7af6('0x5c')](_0x3a79e9[_0x7af6('0x35')],_0x3a135a[_0x7af6('0x36')]));_0x448881[_0x7af6('0x3e')][_0x7af6('0x5d')]=_0x5db8a7['id'];if(_0x3a79e9[_0x7af6('0x35')][_0x7af6('0x41')]){_0x448881[_0x7af6('0x3e')]=_[_0x7af6('0x3f')](_0x448881[_0x7af6('0x3e')],{'$or':_['map'](_0x448881['attributes'],function(_0x5311c8){var _0x13b735={};_0x13b735[_0x5311c8]={'$like':'%'+_0x3a79e9['query']['filter']+'%'};return _0x13b735;})});}_0x448881=_[_0x7af6('0x3f')]({},_0x448881,_0x3a79e9['options']);return db[_0x7af6('0x60')][_0x7af6('0x1e')]({'where':_0x448881['where']})[_0x7af6('0x26')](function(_0x149501){_0x2f6c06['count']=_0x149501;if(_0x3a79e9[_0x7af6('0x35')][_0x7af6('0x42')]){_0x448881['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x7af6('0x5e')](_0x448881);})[_0x7af6('0x26')](function(_0x2727a7){_0x2f6c06[_0x7af6('0x43')]=_0x2727a7;return _0x2f6c06;});}})[_0x7af6('0x26')](respondWithFilteredResult(_0x3d0b55,_0x448881))['catch'](handleError(_0x3d0b55,null));};exports[_0x7af6('0x61')]=function(_0x1857e1,_0x2b53fd,_0x496c48){var _0x44cc9e={'raw':!![],'where':{}};var _0x53f611={};var _0x16487f={'count':0x0,'rows':[]};return db[_0x7af6('0x30')][_0x7af6('0x5a')]({'where':{'id':_0x1857e1['params']['id']}})['then'](handleEntityNotFound(_0x2b53fd,null))[_0x7af6('0x26')](function(_0x527b1d){if(_0x527b1d){_0x53f611[_0x7af6('0x34')]=_[_0x7af6('0x54')](db['CmHopperFinal'][_0x7af6('0x31')]);_0x53f611[_0x7af6('0x35')]=_[_0x7af6('0x54')](_0x1857e1[_0x7af6('0x35')]);_0x53f611[_0x7af6('0x36')]=_[_0x7af6('0x38')](_0x53f611[_0x7af6('0x34')],_0x53f611['query']);_0x44cc9e[_0x7af6('0x37')]=_[_0x7af6('0x38')](_0x53f611[_0x7af6('0x34')],qs[_0x7af6('0x39')](_0x1857e1[_0x7af6('0x35')][_0x7af6('0x39')]));_0x44cc9e[_0x7af6('0x37')]=_0x44cc9e[_0x7af6('0x37')][_0x7af6('0x46')]?_0x44cc9e[_0x7af6('0x37')]:_0x53f611['model'];if(!_0x1857e1[_0x7af6('0x35')]['hasOwnProperty']('nolimit')){_0x44cc9e[_0x7af6('0x1d')]=qs[_0x7af6('0x1d')](_0x1857e1[_0x7af6('0x35')][_0x7af6('0x1d')]);_0x44cc9e[_0x7af6('0x1f')]=qs[_0x7af6('0x1f')](_0x1857e1[_0x7af6('0x35')][_0x7af6('0x1f')]);}_0x44cc9e[_0x7af6('0x3c')]=qs[_0x7af6('0x3d')](_0x1857e1[_0x7af6('0x35')][_0x7af6('0x3d')]);_0x44cc9e[_0x7af6('0x3e')]=qs[_0x7af6('0x36')](_['pick'](_0x1857e1[_0x7af6('0x35')],_0x53f611[_0x7af6('0x36')]));_0x44cc9e['where'][_0x7af6('0x5d')]=_0x527b1d['id'];if(_0x1857e1[_0x7af6('0x35')][_0x7af6('0x41')]){_0x44cc9e[_0x7af6('0x3e')]=_[_0x7af6('0x3f')](_0x44cc9e[_0x7af6('0x3e')],{'$or':_[_0x7af6('0x2f')](_0x44cc9e[_0x7af6('0x37')],function(_0x41a81d){var _0x226d10={};_0x226d10[_0x41a81d]={'$like':'%'+_0x1857e1['query'][_0x7af6('0x41')]+'%'};return _0x226d10;})});}_0x44cc9e=_['merge']({},_0x44cc9e,_0x1857e1['options']);return db[_0x7af6('0x62')][_0x7af6('0x1e')]({'where':_0x44cc9e[_0x7af6('0x3e')]})[_0x7af6('0x26')](function(_0x5a52e3){_0x16487f['count']=_0x5a52e3;if(_0x1857e1[_0x7af6('0x35')][_0x7af6('0x42')]){_0x44cc9e[_0x7af6('0x47')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x7af6('0x5e')](_0x44cc9e);})[_0x7af6('0x26')](function(_0x1bd5d4){_0x16487f[_0x7af6('0x43')]=_0x1bd5d4;return _0x16487f;});}})[_0x7af6('0x26')](respondWithFilteredResult(_0x2b53fd,_0x44cc9e))[_0x7af6('0x4a')](handleError(_0x2b53fd,null));};exports[_0x7af6('0x63')]=function(_0x220f3b,_0x4cc61f,_0x489388){var _0x5414a1={'raw':!![],'where':{}};var _0x22df77={};var _0x14415e={'count':0x0,'rows':[]};return db[_0x7af6('0x30')][_0x7af6('0x5a')]({'where':{'id':_0x220f3b[_0x7af6('0x45')]['id']}})[_0x7af6('0x26')](handleEntityNotFound(_0x4cc61f,null))['then'](function(_0x526416){if(_0x526416){_0x22df77[_0x7af6('0x34')]=_[_0x7af6('0x54')](db[_0x7af6('0x64')][_0x7af6('0x31')]);_0x22df77[_0x7af6('0x35')]=_[_0x7af6('0x54')](_0x220f3b[_0x7af6('0x35')]);_0x22df77[_0x7af6('0x36')]=_['intersection'](_0x22df77[_0x7af6('0x34')],_0x22df77['query']);_0x5414a1['attributes']=_[_0x7af6('0x38')](_0x22df77['model'],qs['fields'](_0x220f3b[_0x7af6('0x35')][_0x7af6('0x39')]));_0x5414a1[_0x7af6('0x37')]=_0x5414a1[_0x7af6('0x37')][_0x7af6('0x46')]?_0x5414a1['attributes']:_0x22df77[_0x7af6('0x34')];if(!_0x220f3b[_0x7af6('0x35')]['hasOwnProperty']('nolimit')){_0x5414a1[_0x7af6('0x1d')]=qs[_0x7af6('0x1d')](_0x220f3b[_0x7af6('0x35')][_0x7af6('0x1d')]);_0x5414a1[_0x7af6('0x1f')]=qs[_0x7af6('0x1f')](_0x220f3b[_0x7af6('0x35')][_0x7af6('0x1f')]);}_0x5414a1[_0x7af6('0x3c')]=qs[_0x7af6('0x3d')](_0x220f3b[_0x7af6('0x35')][_0x7af6('0x3d')]);_0x5414a1['where']=qs[_0x7af6('0x36')](_[_0x7af6('0x5c')](_0x220f3b['query'],_0x22df77[_0x7af6('0x36')]));_0x5414a1[_0x7af6('0x3e')][_0x7af6('0x5d')]=_0x526416['id'];if(_0x220f3b[_0x7af6('0x35')][_0x7af6('0x41')]){_0x5414a1[_0x7af6('0x3e')]=_[_0x7af6('0x3f')](_0x5414a1[_0x7af6('0x3e')],{'$or':_[_0x7af6('0x2f')](_0x5414a1[_0x7af6('0x37')],function(_0x554fcf){var _0x4f4b8f={};_0x4f4b8f[_0x554fcf]={'$like':'%'+_0x220f3b[_0x7af6('0x35')][_0x7af6('0x41')]+'%'};return _0x4f4b8f;})});}_0x5414a1=_['merge']({},_0x5414a1,_0x220f3b[_0x7af6('0x48')]);return db[_0x7af6('0x64')][_0x7af6('0x1e')]({'where':_0x5414a1[_0x7af6('0x3e')]})[_0x7af6('0x26')](function(_0xd43706){_0x14415e['count']=_0xd43706;if(_0x220f3b[_0x7af6('0x35')]['includeAll']){_0x5414a1[_0x7af6('0x47')]=[{'all':!![]}];}return db[_0x7af6('0x64')][_0x7af6('0x5e')](_0x5414a1);})[_0x7af6('0x26')](function(_0x43eb59){_0x14415e[_0x7af6('0x43')]=_0x43eb59;return _0x14415e;});}})[_0x7af6('0x26')](respondWithFilteredResult(_0x4cc61f,_0x5414a1))[_0x7af6('0x4a')](handleError(_0x4cc61f,null));};exports[_0x7af6('0x65')]=function(_0x371bd1,_0x1d01ac,_0x29fbb9){var _0xd1e1d2={};var _0x239b8d={};var _0x19d38b;var _0x3cccfb;return db[_0x7af6('0x30')]['findOne']({'where':{'id':_0x371bd1[_0x7af6('0x45')]['id']}})['then'](handleEntityNotFound(_0x1d01ac,null))['then'](function(_0x358175){if(_0x358175){_0x19d38b=_0x358175;_0x239b8d[_0x7af6('0x34')]=_[_0x7af6('0x54')](db[_0x7af6('0x66')]['rawAttributes']);_0x239b8d[_0x7af6('0x35')]=_[_0x7af6('0x54')](_0x371bd1[_0x7af6('0x35')]);_0x239b8d['filters']=_[_0x7af6('0x38')](_0x239b8d[_0x7af6('0x34')],_0x239b8d[_0x7af6('0x35')]);_0xd1e1d2[_0x7af6('0x37')]=_[_0x7af6('0x38')](_0x239b8d[_0x7af6('0x34')],qs['fields'](_0x371bd1[_0x7af6('0x35')][_0x7af6('0x39')]));_0xd1e1d2[_0x7af6('0x37')]=_0xd1e1d2[_0x7af6('0x37')][_0x7af6('0x46')]?_0xd1e1d2[_0x7af6('0x37')]:_0x239b8d[_0x7af6('0x34')];_0xd1e1d2[_0x7af6('0x3c')]=qs['sort'](_0x371bd1[_0x7af6('0x35')][_0x7af6('0x3d')]);_0xd1e1d2[_0x7af6('0x3e')]=qs[_0x7af6('0x36')](_[_0x7af6('0x5c')](_0x371bd1[_0x7af6('0x35')],_0x239b8d[_0x7af6('0x36')]));if(_0x371bd1[_0x7af6('0x35')]['filter']){_0xd1e1d2[_0x7af6('0x3e')]=_[_0x7af6('0x3f')](_0xd1e1d2[_0x7af6('0x3e')],{'$or':_['map'](_0xd1e1d2[_0x7af6('0x37')],function(_0x1f5f32){var _0x1dcc98={};_0x1dcc98[_0x1f5f32]={'$like':'%'+_0x371bd1['query'][_0x7af6('0x41')]+'%'};return _0x1dcc98;})});}_0xd1e1d2=_['merge']({},_0xd1e1d2,_0x371bd1[_0x7af6('0x48')]);return _0x19d38b[_0x7af6('0x65')](_0xd1e1d2);}})[_0x7af6('0x26')](function(_0x254de8){if(_0x254de8){_0x3cccfb=_0x254de8[_0x7af6('0x46')];if(!_0x371bd1[_0x7af6('0x35')][_0x7af6('0x3a')](_0x7af6('0x3b'))){_0xd1e1d2[_0x7af6('0x1d')]=qs[_0x7af6('0x1d')](_0x371bd1['query'][_0x7af6('0x1d')]);_0xd1e1d2[_0x7af6('0x1f')]=qs[_0x7af6('0x1f')](_0x371bd1[_0x7af6('0x35')]['offset']);}return _0x19d38b[_0x7af6('0x65')](_0xd1e1d2);}})[_0x7af6('0x26')](function(_0x234b39){if(_0x234b39){return _0x234b39?{'count':_0x3cccfb,'rows':_0x234b39}:null;}})[_0x7af6('0x26')](respondWithResult(_0x1d01ac,null))[_0x7af6('0x4a')](handleError(_0x1d01ac,null));};exports['addLists']=function(_0x2bba6e,_0x16186d,_0x2e5371){var _0x4727a3,_0x3af7ae;return db[_0x7af6('0x30')]['find']({'where':{'id':_0x2bba6e[_0x7af6('0x45')]['id']}})[_0x7af6('0x26')](handleEntityNotFound(_0x16186d,null))[_0x7af6('0x26')](function(_0x2b7339){if(_0x2b7339){_0x3af7ae=_0x2b7339;return _0x2b7339[_0x7af6('0x67')](_0x2bba6e[_0x7af6('0x57')]['ids'],_[_0x7af6('0x55')](_0x2bba6e[_0x7af6('0x57')],[_0x7af6('0x68'),'id'])||{});}return null;})[_0x7af6('0x69')](function(_0x210e80){var _0x115407;_0x4727a3=_0x210e80||[];var _0x3fc20b=[];if(_0x210e80){for(var _0x194de8=0x0;_0x194de8<_0x210e80[_0x7af6('0x46')];_0x194de8+=0x1){var _0x52977a=_0x210e80[_0x194de8]['get']({'plain':!![]});_0x3af7ae[_0x7af6('0x6a')]=_0x2bba6e['body'][_0x7af6('0x6a')]?_0x2bba6e[_0x7af6('0x57')][_0x7af6('0x6a')]:_0x3af7ae[_0x7af6('0x6a')];switch(_0x3af7ae[_0x7af6('0x6a')]){case _0x7af6('0x6b'):_0x115407=squel[_0x7af6('0x6c')]()[_0x7af6('0x6d')]('cm_hopper')['fromQuery']([_0x7af6('0x6e'),_0x7af6('0x6f'),_0x7af6('0x70'),_0x7af6('0x71'),'CampaignId',_0x7af6('0x56'),_0x7af6('0x72')],squel[_0x7af6('0x73')]()[_0x7af6('0x74')]('phone',_0x7af6('0x6e'))['field'](_0x7af6('0x75'),'scheduledAt')['field']('id','ContactId')[_0x7af6('0x74')](_0x52977a[_0x7af6('0x76')][_0x7af6('0x77')](),_0x7af6('0x71'))[_0x7af6('0x74')](_0x2bba6e[_0x7af6('0x45')]['id']['toString'](),_0x7af6('0x5d'))[_0x7af6('0x74')](_0x7af6('0x75'),_0x7af6('0x56'))[_0x7af6('0x74')](_0x7af6('0x75'),'updatedAt')[_0x7af6('0x78')](_0x7af6('0x79'))[_0x7af6('0x3e')](_0x7af6('0x7a'))[_0x7af6('0x3e')](_0x7af6('0x7b'),_0x52977a[_0x7af6('0x76')][_0x7af6('0x77')]())['where'](_0x7af6('0x7c'))[_0x7af6('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0x7af6('0x73')]()[_0x7af6('0x74')](_0x7af6('0x7d'))['from'](_0x7af6('0x7e'))['where'](_0x7af6('0x7f'),_0x2bba6e[_0x7af6('0x45')]['id'][_0x7af6('0x77')]()))[_0x7af6('0x3e')](_0x7af6('0x80'),squel[_0x7af6('0x73')]()[_0x7af6('0x74')](_0x7af6('0x81'))[_0x7af6('0x78')](_0x7af6('0x82'))['where']('CampaignId\x20=\x20?',_0x2bba6e[_0x7af6('0x45')]['id'][_0x7af6('0x77')]())))['toString']();break;case _0x7af6('0x83'):_0x115407=squel['insert']()[_0x7af6('0x6d')](_0x7af6('0x82'))['fromQuery'](['phone',_0x7af6('0x6f'),_0x7af6('0x70'),'ListId',_0x7af6('0x5d'),_0x7af6('0x56'),'updatedAt'],squel[_0x7af6('0x73')]()[_0x7af6('0x74')]('phone',_0x7af6('0x6e'))['field'](_0x7af6('0x75'),'scheduledAt')[_0x7af6('0x74')]('id','ContactId')[_0x7af6('0x74')](_0x52977a['CmListId'][_0x7af6('0x77')](),_0x7af6('0x71'))[_0x7af6('0x74')](_0x2bba6e[_0x7af6('0x45')]['id'][_0x7af6('0x77')](),_0x7af6('0x5d'))['field']('NOW()',_0x7af6('0x56'))[_0x7af6('0x74')]('NOW()',_0x7af6('0x72'))[_0x7af6('0x78')](_0x7af6('0x79'))['where'](_0x7af6('0x7a'))[_0x7af6('0x3e')](_0x7af6('0x7b'),_0x52977a[_0x7af6('0x76')][_0x7af6('0x77')]())['where'](_0x7af6('0x7c'))[_0x7af6('0x3e')](_0x7af6('0x80'),squel[_0x7af6('0x73')]()[_0x7af6('0x74')](_0x7af6('0x81'))[_0x7af6('0x78')](_0x7af6('0x82'))[_0x7af6('0x3e')](_0x7af6('0x7f'),_0x2bba6e['params']['id'][_0x7af6('0x77')]())))[_0x7af6('0x77')]();break;default:_0x115407=squel[_0x7af6('0x6c')]()[_0x7af6('0x6d')](_0x7af6('0x82'))[_0x7af6('0x84')]([_0x7af6('0x6e'),_0x7af6('0x6f'),_0x7af6('0x70'),_0x7af6('0x71'),_0x7af6('0x5d'),_0x7af6('0x56'),_0x7af6('0x72')],squel[_0x7af6('0x73')]()['field'](_0x7af6('0x6e'),_0x7af6('0x6e'))['field'](_0x7af6('0x75'),_0x7af6('0x6f'))['field']('id',_0x7af6('0x70'))[_0x7af6('0x74')](_0x52977a[_0x7af6('0x76')]['toString'](),_0x7af6('0x71'))[_0x7af6('0x74')](_0x2bba6e[_0x7af6('0x45')]['id'][_0x7af6('0x77')](),_0x7af6('0x5d'))[_0x7af6('0x74')]('NOW()','createdAt')[_0x7af6('0x74')](_0x7af6('0x75'),_0x7af6('0x72'))[_0x7af6('0x78')]('cm_contacts')['where'](_0x7af6('0x7a'))[_0x7af6('0x3e')](_0x7af6('0x7b'),_0x52977a[_0x7af6('0x76')][_0x7af6('0x77')]())[_0x7af6('0x3e')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x3fc20b[_0x7af6('0x85')](db['sequelize'][_0x7af6('0x35')](_0x115407));}return BPromise[_0x7af6('0x86')](_0x3fc20b);}})['then'](function(){return _0x4727a3;})[_0x7af6('0x26')](respondWithResult(_0x16186d,null))[_0x7af6('0x4a')](handleError(_0x16186d,null));};exports[_0x7af6('0x87')]=function(_0x62031f,_0x3a388c,_0x5a7202){return db['Campaign'][_0x7af6('0x49')]({'where':{'id':_0x62031f[_0x7af6('0x45')]['id']}})[_0x7af6('0x26')](handleEntityNotFound(_0x3a388c,null))[_0x7af6('0x26')](function(_0xaf258b){if(_0xaf258b){return _0xaf258b['removeLists'](_0x62031f['query'][_0x7af6('0x68')]);}})[_0x7af6('0x26')](function(_0x27c638){if(_0x27c638){return db['CmHopper'][_0x7af6('0x2a')]({'where':{'ListId':_0x62031f[_0x7af6('0x35')][_0x7af6('0x68')],'CampaignId':_0x62031f[_0x7af6('0x45')]['id']}})[_0x7af6('0x26')](function(){return _0x27c638;});}})[_0x7af6('0x26')](respondWithStatusCode(_0x3a388c,null))['catch'](handleError(_0x3a388c,null));};exports['getBlackLists']=function(_0x6f34d5,_0x13f1d6,_0x5f2fad){var _0x121c78={};var _0x11e656={};var _0x52cbfa;var _0x5a8e3;return db[_0x7af6('0x30')][_0x7af6('0x5a')]({'where':{'id':_0x6f34d5['params']['id']}})[_0x7af6('0x26')](handleEntityNotFound(_0x13f1d6,null))[_0x7af6('0x26')](function(_0x5697a0){if(_0x5697a0){_0x52cbfa=_0x5697a0;_0x11e656[_0x7af6('0x34')]=_[_0x7af6('0x54')](db['CmList'][_0x7af6('0x31')]);_0x11e656['query']=_['keys'](_0x6f34d5[_0x7af6('0x35')]);_0x11e656[_0x7af6('0x36')]=_['intersection'](_0x11e656[_0x7af6('0x34')],_0x11e656[_0x7af6('0x35')]);_0x121c78[_0x7af6('0x37')]=_[_0x7af6('0x38')](_0x11e656[_0x7af6('0x34')],qs[_0x7af6('0x39')](_0x6f34d5[_0x7af6('0x35')][_0x7af6('0x39')]));_0x121c78['attributes']=_0x121c78[_0x7af6('0x37')][_0x7af6('0x46')]?_0x121c78[_0x7af6('0x37')]:_0x11e656[_0x7af6('0x34')];_0x121c78[_0x7af6('0x3c')]=qs['sort'](_0x6f34d5[_0x7af6('0x35')][_0x7af6('0x3d')]);_0x121c78[_0x7af6('0x3e')]=qs[_0x7af6('0x36')](_['pick'](_0x6f34d5[_0x7af6('0x35')],_0x11e656['filters']));if(_0x6f34d5['query'][_0x7af6('0x41')]){_0x121c78[_0x7af6('0x3e')]=_[_0x7af6('0x3f')](_0x121c78[_0x7af6('0x3e')],{'$or':_[_0x7af6('0x2f')](_0x121c78['attributes'],function(_0x5b2113){var _0x35567b={};_0x35567b[_0x5b2113]={'$like':'%'+_0x6f34d5[_0x7af6('0x35')][_0x7af6('0x41')]+'%'};return _0x35567b;})});}_0x121c78=_[_0x7af6('0x3f')]({},_0x121c78,_0x6f34d5[_0x7af6('0x48')]);return _0x52cbfa['getBlackLists'](_0x121c78);}})[_0x7af6('0x26')](function(_0x415ac8){if(_0x415ac8){_0x5a8e3=_0x415ac8[_0x7af6('0x46')];if(!_0x6f34d5[_0x7af6('0x35')]['hasOwnProperty']('nolimit')){_0x121c78[_0x7af6('0x1d')]=qs[_0x7af6('0x1d')](_0x6f34d5[_0x7af6('0x35')][_0x7af6('0x1d')]);_0x121c78['offset']=qs[_0x7af6('0x1f')](_0x6f34d5[_0x7af6('0x35')]['offset']);}return _0x52cbfa[_0x7af6('0x88')](_0x121c78);}})[_0x7af6('0x26')](function(_0x386148){if(_0x386148){return _0x386148?{'count':_0x5a8e3,'rows':_0x386148}:null;}})[_0x7af6('0x26')](respondWithResult(_0x13f1d6,null))['catch'](handleError(_0x13f1d6,null));};exports[_0x7af6('0x89')]=function(_0x4d14a5,_0x1d3eee,_0x6cb660){var _0x1910e1,_0xf267b8;return db[_0x7af6('0x30')][_0x7af6('0x49')]({'where':{'id':_0x4d14a5[_0x7af6('0x45')]['id']}})[_0x7af6('0x26')](handleEntityNotFound(_0x1d3eee,null))[_0x7af6('0x26')](function(_0x136951){if(_0x136951){_0xf267b8=_0x136951;return _0x136951[_0x7af6('0x89')](_0x4d14a5[_0x7af6('0x57')]['ids'],_[_0x7af6('0x55')](_0x4d14a5['body'],[_0x7af6('0x68'),'id'])||{});}return null;})[_0x7af6('0x69')](function(_0x22f5a4){var _0x5271f3;_0x1910e1=_0x22f5a4||[];var _0x451097=[];if(_0x22f5a4){for(var _0x596ffa=0x0;_0x596ffa<_0x22f5a4[_0x7af6('0x46')];_0x596ffa+=0x1){var _0x22ce0b=_0x22f5a4[_0x596ffa][_0x7af6('0x27')]({'plain':!![]});_0x5271f3=squel[_0x7af6('0x6c')]()[_0x7af6('0x6d')]('cm_hopper_black')[_0x7af6('0x84')]([_0x7af6('0x6e'),_0x7af6('0x70'),_0x7af6('0x71'),'CampaignId',_0x7af6('0x56'),'updatedAt'],squel[_0x7af6('0x73')]()['field'](_0x7af6('0x6e'),_0x7af6('0x6e'))[_0x7af6('0x74')]('id',_0x7af6('0x70'))[_0x7af6('0x74')](_0x22ce0b[_0x7af6('0x76')][_0x7af6('0x77')](),'ListId')['field'](_0x4d14a5['params']['id'][_0x7af6('0x77')](),_0x7af6('0x5d'))[_0x7af6('0x74')]('NOW()',_0x7af6('0x56'))[_0x7af6('0x74')](_0x7af6('0x75'),'updatedAt')[_0x7af6('0x78')](_0x7af6('0x79'))[_0x7af6('0x3e')](_0x7af6('0x7a'))[_0x7af6('0x3e')](_0x7af6('0x7b'),_0x22ce0b[_0x7af6('0x76')][_0x7af6('0x77')]())[_0x7af6('0x3e')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x451097[_0x7af6('0x85')](db['sequelize'][_0x7af6('0x35')](_0x5271f3));}return BPromise['all'](_0x451097);}})[_0x7af6('0x26')](function(){return _0x1910e1;})['then'](respondWithResult(_0x1d3eee,null))[_0x7af6('0x4a')](handleError(_0x1d3eee,null));};exports[_0x7af6('0x8a')]=function(_0xb8032,_0x503548,_0x3bf12c){return db['Campaign'][_0x7af6('0x49')]({'where':{'id':_0xb8032['params']['id']}})[_0x7af6('0x26')](handleEntityNotFound(_0x503548,null))[_0x7af6('0x26')](function(_0x2f9f24){if(_0x2f9f24){return _0x2f9f24[_0x7af6('0x8a')](_0xb8032[_0x7af6('0x35')][_0x7af6('0x68')]);}})[_0x7af6('0x26')](function(_0x4d6a32){if(_0x4d6a32){return db['CmHopperBlack'][_0x7af6('0x2a')]({'where':{'ListId':_0xb8032[_0x7af6('0x35')]['ids'],'CampaignId':_0xb8032['params']['id']}})[_0x7af6('0x26')](function(){return _0x4d6a32;});}})[_0x7af6('0x26')](respondWithStatusCode(_0x503548,null))[_0x7af6('0x4a')](handleError(_0x503548,null));}; \ No newline at end of file +var _0xcbb8=['hasOwnProperty','order','sort','filters','where','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','fields','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','length','include','omit','createdAt','updatedAt','update','getHoppers','CmHopper','nolimit','pick','CampaignId','filter','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','field','phone','NOW()','CmListId','toString','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','into','push','removeLists','getBlackLists','addBlackLists','cm_hopper_black','cm_contacts','removeBlackLists','eml-format','rimraf','fast-json-patch','mustache','util','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','then','destroy','get','IvrCampaigns','UserProfileResource','sendStatus','error','stack','name','send','index','Campaign','rawAttributes','fieldName','model','map','keys','query','intersection','attributes'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xcbb8,0x15e));var _0x8cbb=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xcbb8[_0x4243a3];return _0x1b2a33;};'use strict';var emlformat=require(_0x8cbb('0x0'));var rimraf=require(_0x8cbb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8cbb('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8cbb('0x3'));var util=require(_0x8cbb('0x4'));var path=require('path');var sox=require(_0x8cbb('0x5'));var csv=require(_0x8cbb('0x6'));var ejs=require(_0x8cbb('0x7'));var fs=require('fs');var fs_extra=require(_0x8cbb('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8cbb('0x9'));var jsforce=require(_0x8cbb('0xa'));var deskjs=require(_0x8cbb('0xb'));var toCsv=require(_0x8cbb('0x6'));var querystring=require(_0x8cbb('0xc'));var Papa=require(_0x8cbb('0xd'));var Redis=require(_0x8cbb('0xe'));var authService=require(_0x8cbb('0xf'));var qs=require(_0x8cbb('0x10'));var as=require(_0x8cbb('0x11'));var hardwareService=require(_0x8cbb('0x12'));var logger=require(_0x8cbb('0x13'))(_0x8cbb('0x14'));var utils=require(_0x8cbb('0x15'));var config=require(_0x8cbb('0x16'));var licenseUtil=require(_0x8cbb('0x17'));var db=require(_0x8cbb('0x18'))['db'];function respondWithStatusCode(_0x2b994f,_0x17733d){_0x17733d=_0x17733d||0xcc;return function(_0x581087){if(_0x581087){return _0x2b994f['sendStatus'](_0x17733d);}return _0x2b994f[_0x8cbb('0x19')](_0x17733d)[_0x8cbb('0x1a')]();};}function respondWithResult(_0x1083c5,_0x3e2277){_0x3e2277=_0x3e2277||0xc8;return function(_0x3dc3f3){if(_0x3dc3f3){return _0x1083c5['status'](_0x3e2277)[_0x8cbb('0x1b')](_0x3dc3f3);}};}function respondWithFilteredResult(_0x1eb428,_0x21f883){return function(_0x2c6e5a){if(_0x2c6e5a){var _0x439dd8=typeof _0x21f883['offset']===_0x8cbb('0x1c')&&typeof _0x21f883[_0x8cbb('0x1d')]===_0x8cbb('0x1c');var _0x3fb08a=_0x2c6e5a[_0x8cbb('0x1e')];var _0x1dde45=_0x439dd8?0x0:_0x21f883[_0x8cbb('0x1f')];var _0x36758f=_0x439dd8?_0x2c6e5a[_0x8cbb('0x1e')]:_0x21f883['offset']+_0x21f883['limit'];var _0x221d79;if(_0x36758f>=_0x3fb08a){_0x36758f=_0x3fb08a;_0x221d79=0xc8;}else{_0x221d79=0xce;}_0x1eb428['status'](_0x221d79);return _0x1eb428[_0x8cbb('0x20')](_0x8cbb('0x21'),_0x1dde45+'-'+_0x36758f+'/'+_0x3fb08a)[_0x8cbb('0x1b')](_0x2c6e5a);}return null;};}function patchUpdates(_0x120982){return function(_0x12e13f){try{jsonpatch[_0x8cbb('0x22')](_0x12e13f,_0x120982,!![]);}catch(_0x1a3963){return BPromise['reject'](_0x1a3963);}return _0x12e13f['save']();};}function saveUpdates(_0x329fe1,_0x2baf9b){return function(_0x322e1d){if(_0x322e1d){return _0x322e1d['update'](_0x329fe1)[_0x8cbb('0x23')](function(_0x1d5c22){return _0x1d5c22;});}return null;};}function removeEntity(_0x2ce7cd,_0xb83f3e){return function(_0x2ec4ed){if(_0x2ec4ed){return _0x2ec4ed[_0x8cbb('0x24')]()[_0x8cbb('0x23')](function(){var _0x1d3ad0=_0x2ec4ed[_0x8cbb('0x25')]({'plain':!![]});var _0x4cd45e=_0x8cbb('0x26');return db[_0x8cbb('0x27')]['destroy']({'where':{'type':_0x4cd45e,'resourceId':_0x1d3ad0['id']}})['then'](function(){return _0x2ec4ed;});})['then'](function(){_0x2ce7cd['status'](0xcc)[_0x8cbb('0x1a')]();});}};}function handleEntityNotFound(_0x7a7626,_0x11f0a9){return function(_0x3eacc0){if(!_0x3eacc0){_0x7a7626[_0x8cbb('0x28')](0x194);}return _0x3eacc0;};}function handleError(_0x5217c2,_0xf45da6){_0xf45da6=_0xf45da6||0x1f4;return function(_0x35fe87){logger[_0x8cbb('0x29')](_0x35fe87[_0x8cbb('0x2a')]);if(_0x35fe87['name']){delete _0x35fe87[_0x8cbb('0x2b')];}_0x5217c2[_0x8cbb('0x19')](_0xf45da6)[_0x8cbb('0x2c')](_0x35fe87);};}exports[_0x8cbb('0x2d')]=function(_0x7c678a,_0x4aa709){var _0xe383db={},_0x4f4a61={},_0xae9d1f={'count':0x0,'rows':[]};var _0x28f026=_['map'](db[_0x8cbb('0x2e')][_0x8cbb('0x2f')],function(_0x20718f){return{'name':_0x20718f[_0x8cbb('0x30')],'type':_0x20718f['type']['key']};});_0x4f4a61[_0x8cbb('0x31')]=_[_0x8cbb('0x32')](_0x28f026,_0x8cbb('0x2b'));_0x4f4a61['query']=_[_0x8cbb('0x33')](_0x7c678a[_0x8cbb('0x34')]);_0x4f4a61['filters']=_[_0x8cbb('0x35')](_0x4f4a61[_0x8cbb('0x31')],_0x4f4a61[_0x8cbb('0x34')]);_0xe383db[_0x8cbb('0x36')]=_['intersection'](_0x4f4a61[_0x8cbb('0x31')],qs['fields'](_0x7c678a[_0x8cbb('0x34')]['fields']));_0xe383db[_0x8cbb('0x36')]=_0xe383db[_0x8cbb('0x36')]['length']?_0xe383db['attributes']:_0x4f4a61[_0x8cbb('0x31')];if(!_0x7c678a[_0x8cbb('0x34')][_0x8cbb('0x37')]('nolimit')){_0xe383db[_0x8cbb('0x1d')]=qs['limit'](_0x7c678a[_0x8cbb('0x34')][_0x8cbb('0x1d')]);_0xe383db[_0x8cbb('0x1f')]=qs[_0x8cbb('0x1f')](_0x7c678a[_0x8cbb('0x34')]['offset']);}_0xe383db[_0x8cbb('0x38')]=qs['sort'](_0x7c678a[_0x8cbb('0x34')][_0x8cbb('0x39')]);_0xe383db['where']=qs[_0x8cbb('0x3a')](_['pick'](_0x7c678a[_0x8cbb('0x34')],_0x4f4a61['filters']),_0x28f026);if(_0x7c678a[_0x8cbb('0x34')]['filter']){_0xe383db[_0x8cbb('0x3b')]=_[_0x8cbb('0x3c')](_0xe383db[_0x8cbb('0x3b')],{'$or':_['map'](_0x28f026,function(_0x2e4931){if(_0x2e4931[_0x8cbb('0x3d')]!==_0x8cbb('0x3e')){var _0x1dc5ca={};_0x1dc5ca[_0x2e4931[_0x8cbb('0x2b')]]={'$like':'%'+_0x7c678a['query']['filter']+'%'};return _0x1dc5ca;}})});}_0xe383db=_[_0x8cbb('0x3c')]({},_0xe383db,_0x7c678a[_0x8cbb('0x3f')]);var _0x35c34a={'where':_0xe383db[_0x8cbb('0x3b')]};return db[_0x8cbb('0x2e')]['count'](_0x35c34a)[_0x8cbb('0x23')](function(_0x15773f){_0xae9d1f[_0x8cbb('0x1e')]=_0x15773f;if(_0x7c678a[_0x8cbb('0x34')][_0x8cbb('0x40')]){_0xe383db['include']=[{'all':!![]}];}return db[_0x8cbb('0x2e')][_0x8cbb('0x41')](_0xe383db);})[_0x8cbb('0x23')](function(_0x246ee5){_0xae9d1f[_0x8cbb('0x42')]=_0x246ee5;return _0xae9d1f;})[_0x8cbb('0x23')](respondWithFilteredResult(_0x4aa709,_0xe383db))[_0x8cbb('0x43')](handleError(_0x4aa709,null));};exports[_0x8cbb('0x44')]=function(_0x3a092a,_0x4c84d2){var _0x263da3={'raw':![],'where':{'id':_0x3a092a[_0x8cbb('0x45')]['id']}},_0xf29097={};_0xf29097[_0x8cbb('0x31')]=_[_0x8cbb('0x33')](db[_0x8cbb('0x2e')][_0x8cbb('0x2f')]);_0xf29097[_0x8cbb('0x34')]=_[_0x8cbb('0x33')](_0x3a092a[_0x8cbb('0x34')]);_0xf29097['filters']=_[_0x8cbb('0x35')](_0xf29097[_0x8cbb('0x31')],_0xf29097[_0x8cbb('0x34')]);_0x263da3['attributes']=_[_0x8cbb('0x35')](_0xf29097[_0x8cbb('0x31')],qs[_0x8cbb('0x46')](_0x3a092a[_0x8cbb('0x34')]['fields']));_0x263da3[_0x8cbb('0x36')]=_0x263da3[_0x8cbb('0x36')]['length']?_0x263da3[_0x8cbb('0x36')]:_0xf29097[_0x8cbb('0x31')];if(_0x3a092a[_0x8cbb('0x34')][_0x8cbb('0x40')]){_0x263da3['include']=[{'all':!![]}];}_0x263da3=_[_0x8cbb('0x3c')]({},_0x263da3,_0x3a092a[_0x8cbb('0x3f')]);return db[_0x8cbb('0x2e')][_0x8cbb('0x47')](_0x263da3)[_0x8cbb('0x23')](handleEntityNotFound(_0x4c84d2,null))[_0x8cbb('0x23')](respondWithResult(_0x4c84d2,null))[_0x8cbb('0x43')](handleError(_0x4c84d2,null));};exports[_0x8cbb('0x48')]=function(_0x45e4db,_0x1b5a4c){return db[_0x8cbb('0x2e')][_0x8cbb('0x48')](_0x45e4db[_0x8cbb('0x49')],{})[_0x8cbb('0x23')](function(_0x8de3ba){var _0xcb9f12=_0x45e4db[_0x8cbb('0x4a')][_0x8cbb('0x25')]({'plain':!![]});if(!_0xcb9f12)throw new Error(_0x8cbb('0x4b'));if(_0xcb9f12[_0x8cbb('0x4c')]==='user'){var _0x1ffb31=_0x8de3ba['get']({'plain':!![]});var _0x5689a1=_0x8cbb('0x26');return db[_0x8cbb('0x4d')][_0x8cbb('0x47')]({'where':{'name':_0x5689a1,'userProfileId':_0xcb9f12[_0x8cbb('0x4e')]},'raw':!![]})[_0x8cbb('0x23')](function(_0x1aeba8){if(_0x1aeba8&&_0x1aeba8[_0x8cbb('0x4f')]===0x0){return db[_0x8cbb('0x27')]['create']({'name':_0x1ffb31[_0x8cbb('0x2b')],'resourceId':_0x1ffb31['id'],'type':_0x1aeba8['name'],'sectionId':_0x1aeba8['id']},{})['then'](function(){return _0x8de3ba;});}else{return _0x8de3ba;}})[_0x8cbb('0x43')](function(_0x353f18){logger['error'](_0x8cbb('0x50'),_0x353f18);throw _0x353f18;});}return _0x8de3ba;})['then'](respondWithResult(_0x1b5a4c,0xc9))[_0x8cbb('0x43')](handleError(_0x1b5a4c,null));};exports['clone']=function(_0x3b351b,_0x2e72b2){var _0x43b710={'where':{'id':_0x3b351b['params']['id']}},_0x4c1b62={};_0x4c1b62['model']=_[_0x8cbb('0x33')](db[_0x8cbb('0x2e')][_0x8cbb('0x2f')]);_0x43b710[_0x8cbb('0x36')]=_[_0x8cbb('0x35')](_0x4c1b62[_0x8cbb('0x31')],qs[_0x8cbb('0x46')](_0x3b351b[_0x8cbb('0x34')][_0x8cbb('0x46')]));_0x43b710[_0x8cbb('0x36')]=_0x43b710[_0x8cbb('0x36')][_0x8cbb('0x51')]?_0x43b710[_0x8cbb('0x36')]:_0x4c1b62['model'];if(_0x3b351b['query'][_0x8cbb('0x40')]){_0x43b710[_0x8cbb('0x52')]=[{'all':!![]}];}_0x43b710=_[_0x8cbb('0x3c')]({},_0x43b710,_0x3b351b['options']);return db['Campaign'][_0x8cbb('0x47')](_0x43b710)[_0x8cbb('0x23')](handleEntityNotFound(_0x2e72b2,null))[_0x8cbb('0x23')](function(_0x2dd000){if(_0x2dd000){var _0x520898=_0x2dd000[_0x8cbb('0x25')]({'plain':!![]});_0x520898=qs[_0x8cbb('0x53')](_0x520898,['id',_0x8cbb('0x54'),_0x8cbb('0x55')]);_0x3b351b[_0x8cbb('0x49')]=_[_0x8cbb('0x53')](_0x3b351b[_0x8cbb('0x49')],['id',_0x8cbb('0x54'),_0x8cbb('0x55')]);return db[_0x8cbb('0x2e')][_0x8cbb('0x48')](_[_0x8cbb('0x3c')](_0x520898,_0x3b351b[_0x8cbb('0x49')]),{'include':_0x3b351b[_0x8cbb('0x34')][_0x8cbb('0x40')]?[{'all':!![]}]:undefined})[_0x8cbb('0x23')](function(_0x58c107){var _0x121590=_0x3b351b['user'][_0x8cbb('0x25')]({'plain':!![]});if(!_0x121590)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x121590['role']===_0x8cbb('0x4a')){var _0xefae33=_0x58c107['get']({'plain':!![]});var _0x4f4f45=_0x8cbb('0x26');return db[_0x8cbb('0x4d')][_0x8cbb('0x47')]({'where':{'name':_0x4f4f45,'userProfileId':_0x121590[_0x8cbb('0x4e')]},'raw':!![]})[_0x8cbb('0x23')](function(_0x5c4527){if(_0x5c4527&&_0x5c4527['autoAssociation']===0x0){return db[_0x8cbb('0x27')][_0x8cbb('0x48')]({'name':_0xefae33['name'],'resourceId':_0xefae33['id'],'type':_0x5c4527['name'],'sectionId':_0x5c4527['id']},{})['then'](function(){return _0x58c107;});}else{return _0x58c107;}})[_0x8cbb('0x43')](function(_0x3b0e0a){logger[_0x8cbb('0x29')](_0x8cbb('0x50'),_0x3b0e0a);throw _0x3b0e0a;});}return _0x58c107;});}})[_0x8cbb('0x23')](respondWithResult(_0x2e72b2,0xc9))[_0x8cbb('0x43')](handleError(_0x2e72b2,null));};exports[_0x8cbb('0x56')]=function(_0x2916c5,_0x69332a){if(_0x2916c5['body']['id']){delete _0x2916c5[_0x8cbb('0x49')]['id'];}return db[_0x8cbb('0x2e')]['find']({'where':{'id':_0x2916c5[_0x8cbb('0x45')]['id']}})[_0x8cbb('0x23')](handleEntityNotFound(_0x69332a,null))[_0x8cbb('0x23')](saveUpdates(_0x2916c5[_0x8cbb('0x49')],null))['then'](respondWithResult(_0x69332a,null))[_0x8cbb('0x43')](handleError(_0x69332a,null));};exports[_0x8cbb('0x24')]=function(_0x3694e9,_0x357d69){return db[_0x8cbb('0x2e')][_0x8cbb('0x47')]({'where':{'id':_0x3694e9[_0x8cbb('0x45')]['id']}})[_0x8cbb('0x23')](handleEntityNotFound(_0x357d69,null))[_0x8cbb('0x23')](removeEntity(_0x357d69,null))[_0x8cbb('0x43')](handleError(_0x357d69,null));};exports[_0x8cbb('0x57')]=function(_0x2cf412,_0x4d8a8c,_0x461166){var _0x8b95af={'raw':!![],'where':{}};var _0x10fe10={};var _0x4be602={'count':0x0,'rows':[]};return db[_0x8cbb('0x2e')]['findOne']({'where':{'id':_0x2cf412['params']['id']}})[_0x8cbb('0x23')](handleEntityNotFound(_0x4d8a8c,null))[_0x8cbb('0x23')](function(_0x4c209c){if(_0x4c209c){_0x10fe10[_0x8cbb('0x31')]=_[_0x8cbb('0x33')](db[_0x8cbb('0x58')][_0x8cbb('0x2f')]);_0x10fe10[_0x8cbb('0x34')]=_['keys'](_0x2cf412['query']);_0x10fe10['filters']=_[_0x8cbb('0x35')](_0x10fe10[_0x8cbb('0x31')],_0x10fe10[_0x8cbb('0x34')]);_0x8b95af[_0x8cbb('0x36')]=_[_0x8cbb('0x35')](_0x10fe10[_0x8cbb('0x31')],qs['fields'](_0x2cf412['query'][_0x8cbb('0x46')]));_0x8b95af['attributes']=_0x8b95af[_0x8cbb('0x36')][_0x8cbb('0x51')]?_0x8b95af['attributes']:_0x10fe10['model'];if(!_0x2cf412['query'][_0x8cbb('0x37')](_0x8cbb('0x59'))){_0x8b95af[_0x8cbb('0x1d')]=qs[_0x8cbb('0x1d')](_0x2cf412[_0x8cbb('0x34')][_0x8cbb('0x1d')]);_0x8b95af[_0x8cbb('0x1f')]=qs[_0x8cbb('0x1f')](_0x2cf412[_0x8cbb('0x34')]['offset']);}_0x8b95af[_0x8cbb('0x38')]=qs['sort'](_0x2cf412['query'][_0x8cbb('0x39')]);_0x8b95af[_0x8cbb('0x3b')]=qs[_0x8cbb('0x3a')](_[_0x8cbb('0x5a')](_0x2cf412[_0x8cbb('0x34')],_0x10fe10[_0x8cbb('0x3a')]));_0x8b95af[_0x8cbb('0x3b')][_0x8cbb('0x5b')]=_0x4c209c['id'];if(_0x2cf412[_0x8cbb('0x34')][_0x8cbb('0x5c')]){_0x8b95af[_0x8cbb('0x3b')]=_[_0x8cbb('0x3c')](_0x8b95af[_0x8cbb('0x3b')],{'$or':_[_0x8cbb('0x32')](_0x8b95af[_0x8cbb('0x36')],function(_0x23c3b1){var _0x5b74a4={};_0x5b74a4[_0x23c3b1]={'$like':'%'+_0x2cf412['query']['filter']+'%'};return _0x5b74a4;})});}_0x8b95af=_[_0x8cbb('0x3c')]({},_0x8b95af,_0x2cf412['options']);return db[_0x8cbb('0x58')][_0x8cbb('0x1e')]({'where':_0x8b95af[_0x8cbb('0x3b')]})[_0x8cbb('0x23')](function(_0x2e77b5){_0x4be602[_0x8cbb('0x1e')]=_0x2e77b5;if(_0x2cf412[_0x8cbb('0x34')]['includeAll']){_0x8b95af[_0x8cbb('0x52')]=[{'all':!![]}];}return db[_0x8cbb('0x58')]['findAll'](_0x8b95af);})[_0x8cbb('0x23')](function(_0xaebf3e){_0x4be602[_0x8cbb('0x42')]=_0xaebf3e;return _0x4be602;});}})[_0x8cbb('0x23')](respondWithFilteredResult(_0x4d8a8c,_0x8b95af))[_0x8cbb('0x43')](handleError(_0x4d8a8c,null));};exports['getHopperHistories']=function(_0x2d2e6f,_0x458b84,_0x3a12c7){var _0x3af596={'raw':!![],'where':{}};var _0x39a682={};var _0x548045={'count':0x0,'rows':[]};return db[_0x8cbb('0x2e')][_0x8cbb('0x5d')]({'where':{'id':_0x2d2e6f['params']['id']}})['then'](handleEntityNotFound(_0x458b84,null))[_0x8cbb('0x23')](function(_0xabe686){if(_0xabe686){_0x39a682[_0x8cbb('0x31')]=_[_0x8cbb('0x33')](db[_0x8cbb('0x5e')][_0x8cbb('0x2f')]);_0x39a682[_0x8cbb('0x34')]=_[_0x8cbb('0x33')](_0x2d2e6f[_0x8cbb('0x34')]);_0x39a682[_0x8cbb('0x3a')]=_[_0x8cbb('0x35')](_0x39a682[_0x8cbb('0x31')],_0x39a682[_0x8cbb('0x34')]);_0x3af596[_0x8cbb('0x36')]=_[_0x8cbb('0x35')](_0x39a682['model'],qs[_0x8cbb('0x46')](_0x2d2e6f['query']['fields']));_0x3af596[_0x8cbb('0x36')]=_0x3af596[_0x8cbb('0x36')][_0x8cbb('0x51')]?_0x3af596['attributes']:_0x39a682['model'];if(!_0x2d2e6f[_0x8cbb('0x34')][_0x8cbb('0x37')](_0x8cbb('0x59'))){_0x3af596['limit']=qs[_0x8cbb('0x1d')](_0x2d2e6f[_0x8cbb('0x34')][_0x8cbb('0x1d')]);_0x3af596[_0x8cbb('0x1f')]=qs['offset'](_0x2d2e6f[_0x8cbb('0x34')]['offset']);}_0x3af596[_0x8cbb('0x38')]=qs[_0x8cbb('0x39')](_0x2d2e6f[_0x8cbb('0x34')][_0x8cbb('0x39')]);_0x3af596[_0x8cbb('0x3b')]=qs[_0x8cbb('0x3a')](_['pick'](_0x2d2e6f['query'],_0x39a682[_0x8cbb('0x3a')]));_0x3af596[_0x8cbb('0x3b')]['CampaignId']=_0xabe686['id'];if(_0x2d2e6f[_0x8cbb('0x34')][_0x8cbb('0x5c')]){_0x3af596['where']=_['merge'](_0x3af596['where'],{'$or':_['map'](_0x3af596[_0x8cbb('0x36')],function(_0x16dc85){var _0x244f74={};_0x244f74[_0x16dc85]={'$like':'%'+_0x2d2e6f[_0x8cbb('0x34')][_0x8cbb('0x5c')]+'%'};return _0x244f74;})});}_0x3af596=_[_0x8cbb('0x3c')]({},_0x3af596,_0x2d2e6f[_0x8cbb('0x3f')]);return db[_0x8cbb('0x5e')][_0x8cbb('0x1e')]({'where':_0x3af596[_0x8cbb('0x3b')]})[_0x8cbb('0x23')](function(_0x5c69f4){_0x548045['count']=_0x5c69f4;if(_0x2d2e6f[_0x8cbb('0x34')]['includeAll']){_0x3af596[_0x8cbb('0x52')]=[{'all':!![]}];}return db[_0x8cbb('0x5e')][_0x8cbb('0x41')](_0x3af596);})[_0x8cbb('0x23')](function(_0x410182){_0x548045[_0x8cbb('0x42')]=_0x410182;return _0x548045;});}})[_0x8cbb('0x23')](respondWithFilteredResult(_0x458b84,_0x3af596))[_0x8cbb('0x43')](handleError(_0x458b84,null));};exports[_0x8cbb('0x5f')]=function(_0x36cc49,_0x3808bc,_0x2b8d61){var _0x4853d3={'raw':!![],'where':{}};var _0x562fe7={};var _0x5003c8={'count':0x0,'rows':[]};return db[_0x8cbb('0x2e')]['findOne']({'where':{'id':_0x36cc49[_0x8cbb('0x45')]['id']}})[_0x8cbb('0x23')](handleEntityNotFound(_0x3808bc,null))[_0x8cbb('0x23')](function(_0x1b5b6b){if(_0x1b5b6b){_0x562fe7[_0x8cbb('0x31')]=_[_0x8cbb('0x33')](db['CmHopperFinal'][_0x8cbb('0x2f')]);_0x562fe7[_0x8cbb('0x34')]=_[_0x8cbb('0x33')](_0x36cc49[_0x8cbb('0x34')]);_0x562fe7[_0x8cbb('0x3a')]=_[_0x8cbb('0x35')](_0x562fe7[_0x8cbb('0x31')],_0x562fe7[_0x8cbb('0x34')]);_0x4853d3[_0x8cbb('0x36')]=_[_0x8cbb('0x35')](_0x562fe7['model'],qs[_0x8cbb('0x46')](_0x36cc49[_0x8cbb('0x34')][_0x8cbb('0x46')]));_0x4853d3[_0x8cbb('0x36')]=_0x4853d3[_0x8cbb('0x36')][_0x8cbb('0x51')]?_0x4853d3[_0x8cbb('0x36')]:_0x562fe7[_0x8cbb('0x31')];if(!_0x36cc49[_0x8cbb('0x34')][_0x8cbb('0x37')]('nolimit')){_0x4853d3[_0x8cbb('0x1d')]=qs['limit'](_0x36cc49[_0x8cbb('0x34')][_0x8cbb('0x1d')]);_0x4853d3[_0x8cbb('0x1f')]=qs[_0x8cbb('0x1f')](_0x36cc49[_0x8cbb('0x34')]['offset']);}_0x4853d3['order']=qs[_0x8cbb('0x39')](_0x36cc49[_0x8cbb('0x34')][_0x8cbb('0x39')]);_0x4853d3[_0x8cbb('0x3b')]=qs[_0x8cbb('0x3a')](_[_0x8cbb('0x5a')](_0x36cc49[_0x8cbb('0x34')],_0x562fe7[_0x8cbb('0x3a')]));_0x4853d3['where'][_0x8cbb('0x5b')]=_0x1b5b6b['id'];if(_0x36cc49[_0x8cbb('0x34')][_0x8cbb('0x5c')]){_0x4853d3[_0x8cbb('0x3b')]=_[_0x8cbb('0x3c')](_0x4853d3[_0x8cbb('0x3b')],{'$or':_[_0x8cbb('0x32')](_0x4853d3[_0x8cbb('0x36')],function(_0x4204b7){var _0xecdfc={};_0xecdfc[_0x4204b7]={'$like':'%'+_0x36cc49[_0x8cbb('0x34')][_0x8cbb('0x5c')]+'%'};return _0xecdfc;})});}_0x4853d3=_[_0x8cbb('0x3c')]({},_0x4853d3,_0x36cc49['options']);return db['CmHopperFinal'][_0x8cbb('0x1e')]({'where':_0x4853d3[_0x8cbb('0x3b')]})[_0x8cbb('0x23')](function(_0x4c692a){_0x5003c8['count']=_0x4c692a;if(_0x36cc49[_0x8cbb('0x34')][_0x8cbb('0x40')]){_0x4853d3[_0x8cbb('0x52')]=[{'all':!![]}];}return db[_0x8cbb('0x60')][_0x8cbb('0x41')](_0x4853d3);})['then'](function(_0x36e5f0){_0x5003c8['rows']=_0x36e5f0;return _0x5003c8;});}})[_0x8cbb('0x23')](respondWithFilteredResult(_0x3808bc,_0x4853d3))['catch'](handleError(_0x3808bc,null));};exports['getHopperBlacks']=function(_0x1cac54,_0x118845,_0x442a18){var _0x1c5ce9={'raw':!![],'where':{}};var _0x595744={};var _0x3da660={'count':0x0,'rows':[]};return db[_0x8cbb('0x2e')]['findOne']({'where':{'id':_0x1cac54['params']['id']}})[_0x8cbb('0x23')](handleEntityNotFound(_0x118845,null))[_0x8cbb('0x23')](function(_0x5e41e6){if(_0x5e41e6){_0x595744[_0x8cbb('0x31')]=_[_0x8cbb('0x33')](db['CmHopperBlack'][_0x8cbb('0x2f')]);_0x595744[_0x8cbb('0x34')]=_['keys'](_0x1cac54[_0x8cbb('0x34')]);_0x595744[_0x8cbb('0x3a')]=_['intersection'](_0x595744[_0x8cbb('0x31')],_0x595744[_0x8cbb('0x34')]);_0x1c5ce9[_0x8cbb('0x36')]=_[_0x8cbb('0x35')](_0x595744[_0x8cbb('0x31')],qs['fields'](_0x1cac54['query']['fields']));_0x1c5ce9[_0x8cbb('0x36')]=_0x1c5ce9[_0x8cbb('0x36')][_0x8cbb('0x51')]?_0x1c5ce9[_0x8cbb('0x36')]:_0x595744[_0x8cbb('0x31')];if(!_0x1cac54[_0x8cbb('0x34')][_0x8cbb('0x37')](_0x8cbb('0x59'))){_0x1c5ce9['limit']=qs[_0x8cbb('0x1d')](_0x1cac54[_0x8cbb('0x34')]['limit']);_0x1c5ce9[_0x8cbb('0x1f')]=qs['offset'](_0x1cac54[_0x8cbb('0x34')][_0x8cbb('0x1f')]);}_0x1c5ce9['order']=qs[_0x8cbb('0x39')](_0x1cac54[_0x8cbb('0x34')]['sort']);_0x1c5ce9[_0x8cbb('0x3b')]=qs[_0x8cbb('0x3a')](_[_0x8cbb('0x5a')](_0x1cac54[_0x8cbb('0x34')],_0x595744[_0x8cbb('0x3a')]));_0x1c5ce9[_0x8cbb('0x3b')][_0x8cbb('0x5b')]=_0x5e41e6['id'];if(_0x1cac54[_0x8cbb('0x34')][_0x8cbb('0x5c')]){_0x1c5ce9['where']=_[_0x8cbb('0x3c')](_0x1c5ce9[_0x8cbb('0x3b')],{'$or':_['map'](_0x1c5ce9[_0x8cbb('0x36')],function(_0x357e8e){var _0xe86f41={};_0xe86f41[_0x357e8e]={'$like':'%'+_0x1cac54['query'][_0x8cbb('0x5c')]+'%'};return _0xe86f41;})});}_0x1c5ce9=_[_0x8cbb('0x3c')]({},_0x1c5ce9,_0x1cac54[_0x8cbb('0x3f')]);return db[_0x8cbb('0x61')][_0x8cbb('0x1e')]({'where':_0x1c5ce9[_0x8cbb('0x3b')]})[_0x8cbb('0x23')](function(_0x3e6bbf){_0x3da660[_0x8cbb('0x1e')]=_0x3e6bbf;if(_0x1cac54[_0x8cbb('0x34')]['includeAll']){_0x1c5ce9[_0x8cbb('0x52')]=[{'all':!![]}];}return db[_0x8cbb('0x61')][_0x8cbb('0x41')](_0x1c5ce9);})['then'](function(_0x51fff8){_0x3da660['rows']=_0x51fff8;return _0x3da660;});}})[_0x8cbb('0x23')](respondWithFilteredResult(_0x118845,_0x1c5ce9))[_0x8cbb('0x43')](handleError(_0x118845,null));};exports[_0x8cbb('0x62')]=function(_0x1439c7,_0x5a0ac1,_0x39ad65){var _0x560a5c={};var _0x498bd9={};var _0x5be4c6;var _0x4f73ac;return db[_0x8cbb('0x2e')]['findOne']({'where':{'id':_0x1439c7['params']['id']}})[_0x8cbb('0x23')](handleEntityNotFound(_0x5a0ac1,null))['then'](function(_0x34d9f3){if(_0x34d9f3){_0x5be4c6=_0x34d9f3;_0x498bd9[_0x8cbb('0x31')]=_[_0x8cbb('0x33')](db[_0x8cbb('0x63')]['rawAttributes']);_0x498bd9[_0x8cbb('0x34')]=_[_0x8cbb('0x33')](_0x1439c7[_0x8cbb('0x34')]);_0x498bd9[_0x8cbb('0x3a')]=_[_0x8cbb('0x35')](_0x498bd9[_0x8cbb('0x31')],_0x498bd9[_0x8cbb('0x34')]);_0x560a5c[_0x8cbb('0x36')]=_['intersection'](_0x498bd9['model'],qs['fields'](_0x1439c7['query']['fields']));_0x560a5c[_0x8cbb('0x36')]=_0x560a5c[_0x8cbb('0x36')][_0x8cbb('0x51')]?_0x560a5c[_0x8cbb('0x36')]:_0x498bd9[_0x8cbb('0x31')];_0x560a5c[_0x8cbb('0x38')]=qs['sort'](_0x1439c7[_0x8cbb('0x34')]['sort']);_0x560a5c[_0x8cbb('0x3b')]=qs[_0x8cbb('0x3a')](_[_0x8cbb('0x5a')](_0x1439c7[_0x8cbb('0x34')],_0x498bd9['filters']));if(_0x1439c7[_0x8cbb('0x34')][_0x8cbb('0x5c')]){_0x560a5c[_0x8cbb('0x3b')]=_[_0x8cbb('0x3c')](_0x560a5c['where'],{'$or':_[_0x8cbb('0x32')](_0x560a5c['attributes'],function(_0x208389){var _0x18dd6d={};_0x18dd6d[_0x208389]={'$like':'%'+_0x1439c7[_0x8cbb('0x34')][_0x8cbb('0x5c')]+'%'};return _0x18dd6d;})});}_0x560a5c=_[_0x8cbb('0x3c')]({},_0x560a5c,_0x1439c7[_0x8cbb('0x3f')]);return _0x5be4c6['getLists'](_0x560a5c);}})[_0x8cbb('0x23')](function(_0x6612da){if(_0x6612da){_0x4f73ac=_0x6612da[_0x8cbb('0x51')];if(!_0x1439c7[_0x8cbb('0x34')][_0x8cbb('0x37')]('nolimit')){_0x560a5c[_0x8cbb('0x1d')]=qs[_0x8cbb('0x1d')](_0x1439c7['query'][_0x8cbb('0x1d')]);_0x560a5c[_0x8cbb('0x1f')]=qs[_0x8cbb('0x1f')](_0x1439c7[_0x8cbb('0x34')]['offset']);}return _0x5be4c6[_0x8cbb('0x62')](_0x560a5c);}})[_0x8cbb('0x23')](function(_0x3141ea){if(_0x3141ea){return _0x3141ea?{'count':_0x4f73ac,'rows':_0x3141ea}:null;}})[_0x8cbb('0x23')](respondWithResult(_0x5a0ac1,null))[_0x8cbb('0x43')](handleError(_0x5a0ac1,null));};exports[_0x8cbb('0x64')]=function(_0x461ddc,_0x30d162,_0x2c61ca){var _0x4c8c3f,_0x43f6f2;return db[_0x8cbb('0x2e')][_0x8cbb('0x47')]({'where':{'id':_0x461ddc[_0x8cbb('0x45')]['id']}})['then'](handleEntityNotFound(_0x30d162,null))[_0x8cbb('0x23')](function(_0x592013){if(_0x592013){_0x43f6f2=_0x592013;return _0x592013['addLists'](_0x461ddc[_0x8cbb('0x49')][_0x8cbb('0x65')],_[_0x8cbb('0x53')](_0x461ddc[_0x8cbb('0x49')],[_0x8cbb('0x65'),'id'])||{});}return null;})[_0x8cbb('0x66')](function(_0x3cc0a9){var _0x112907;_0x4c8c3f=_0x3cc0a9||[];var _0x139376=[];if(_0x3cc0a9){for(var _0x2ffb05=0x0;_0x2ffb05<_0x3cc0a9['length'];_0x2ffb05+=0x1){var _0x3dec72=_0x3cc0a9[_0x2ffb05][_0x8cbb('0x25')]({'plain':!![]});_0x43f6f2[_0x8cbb('0x67')]=_0x461ddc[_0x8cbb('0x49')][_0x8cbb('0x67')]?_0x461ddc[_0x8cbb('0x49')][_0x8cbb('0x67')]:_0x43f6f2[_0x8cbb('0x67')];switch(_0x43f6f2[_0x8cbb('0x67')]){case _0x8cbb('0x68'):_0x112907=squel['insert']()['into'](_0x8cbb('0x69'))[_0x8cbb('0x6a')](['phone',_0x8cbb('0x6b'),_0x8cbb('0x6c'),_0x8cbb('0x6d'),_0x8cbb('0x5b'),_0x8cbb('0x54'),_0x8cbb('0x55')],squel['select']()[_0x8cbb('0x6e')]('phone',_0x8cbb('0x6f'))[_0x8cbb('0x6e')](_0x8cbb('0x70'),_0x8cbb('0x6b'))['field']('id','ContactId')[_0x8cbb('0x6e')](_0x3dec72[_0x8cbb('0x71')]['toString'](),_0x8cbb('0x6d'))[_0x8cbb('0x6e')](_0x461ddc[_0x8cbb('0x45')]['id'][_0x8cbb('0x72')](),_0x8cbb('0x5b'))[_0x8cbb('0x6e')](_0x8cbb('0x70'),_0x8cbb('0x54'))[_0x8cbb('0x6e')](_0x8cbb('0x70'),_0x8cbb('0x55'))['from']('cm_contacts')['where'](_0x8cbb('0x73'))[_0x8cbb('0x3b')](_0x8cbb('0x74'),_0x3dec72[_0x8cbb('0x71')][_0x8cbb('0x72')]())[_0x8cbb('0x3b')](_0x8cbb('0x75'))['where'](_0x8cbb('0x76'),squel[_0x8cbb('0x77')]()['field'](_0x8cbb('0x78'))[_0x8cbb('0x79')](_0x8cbb('0x7a'))['where'](_0x8cbb('0x7b'),_0x461ddc[_0x8cbb('0x45')]['id'][_0x8cbb('0x72')]()))[_0x8cbb('0x3b')](_0x8cbb('0x76'),squel[_0x8cbb('0x77')]()[_0x8cbb('0x6e')](_0x8cbb('0x7c'))[_0x8cbb('0x79')]('cm_hopper')[_0x8cbb('0x3b')](_0x8cbb('0x7b'),_0x461ddc[_0x8cbb('0x45')]['id']['toString']())))[_0x8cbb('0x72')]();break;case _0x8cbb('0x7d'):_0x112907=squel[_0x8cbb('0x7e')]()['into'](_0x8cbb('0x69'))['fromQuery']([_0x8cbb('0x6f'),_0x8cbb('0x6b'),_0x8cbb('0x6c'),_0x8cbb('0x6d'),_0x8cbb('0x5b'),_0x8cbb('0x54'),_0x8cbb('0x55')],squel['select']()[_0x8cbb('0x6e')](_0x8cbb('0x6f'),_0x8cbb('0x6f'))[_0x8cbb('0x6e')]('NOW()',_0x8cbb('0x6b'))['field']('id',_0x8cbb('0x6c'))[_0x8cbb('0x6e')](_0x3dec72[_0x8cbb('0x71')][_0x8cbb('0x72')](),_0x8cbb('0x6d'))[_0x8cbb('0x6e')](_0x461ddc['params']['id'][_0x8cbb('0x72')](),_0x8cbb('0x5b'))[_0x8cbb('0x6e')]('NOW()',_0x8cbb('0x54'))[_0x8cbb('0x6e')](_0x8cbb('0x70'),_0x8cbb('0x55'))[_0x8cbb('0x79')]('cm_contacts')[_0x8cbb('0x3b')](_0x8cbb('0x73'))[_0x8cbb('0x3b')]('ListId\x20=\x20?',_0x3dec72[_0x8cbb('0x71')][_0x8cbb('0x72')]())[_0x8cbb('0x3b')]('phone\x20IS\x20NOT\x20NULL')[_0x8cbb('0x3b')](_0x8cbb('0x76'),squel[_0x8cbb('0x77')]()[_0x8cbb('0x6e')]('COALESCE(phone,\x27\x27)')[_0x8cbb('0x79')](_0x8cbb('0x69'))['where'](_0x8cbb('0x7b'),_0x461ddc['params']['id'][_0x8cbb('0x72')]())))[_0x8cbb('0x72')]();break;default:_0x112907=squel[_0x8cbb('0x7e')]()[_0x8cbb('0x7f')]('cm_hopper')[_0x8cbb('0x6a')]([_0x8cbb('0x6f'),_0x8cbb('0x6b'),'ContactId',_0x8cbb('0x6d'),_0x8cbb('0x5b'),_0x8cbb('0x54'),_0x8cbb('0x55')],squel[_0x8cbb('0x77')]()[_0x8cbb('0x6e')]('phone',_0x8cbb('0x6f'))[_0x8cbb('0x6e')](_0x8cbb('0x70'),_0x8cbb('0x6b'))[_0x8cbb('0x6e')]('id',_0x8cbb('0x6c'))[_0x8cbb('0x6e')](_0x3dec72['CmListId'][_0x8cbb('0x72')](),_0x8cbb('0x6d'))[_0x8cbb('0x6e')](_0x461ddc[_0x8cbb('0x45')]['id'][_0x8cbb('0x72')](),_0x8cbb('0x5b'))['field'](_0x8cbb('0x70'),'createdAt')[_0x8cbb('0x6e')](_0x8cbb('0x70'),_0x8cbb('0x55'))[_0x8cbb('0x79')]('cm_contacts')[_0x8cbb('0x3b')](_0x8cbb('0x73'))[_0x8cbb('0x3b')](_0x8cbb('0x74'),_0x3dec72['CmListId']['toString']())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x8cbb('0x72')]();}_0x139376[_0x8cbb('0x80')](db['sequelize']['query'](_0x112907));}return BPromise['all'](_0x139376);}})[_0x8cbb('0x23')](function(){return _0x4c8c3f;})[_0x8cbb('0x23')](respondWithResult(_0x30d162,null))[_0x8cbb('0x43')](handleError(_0x30d162,null));};exports[_0x8cbb('0x81')]=function(_0x4aa7f6,_0x42a05b,_0x120fb4){return db[_0x8cbb('0x2e')]['find']({'where':{'id':_0x4aa7f6[_0x8cbb('0x45')]['id']}})[_0x8cbb('0x23')](handleEntityNotFound(_0x42a05b,null))[_0x8cbb('0x23')](function(_0x1fdf42){if(_0x1fdf42){return _0x1fdf42[_0x8cbb('0x81')](_0x4aa7f6[_0x8cbb('0x34')]['ids']);}})[_0x8cbb('0x23')](function(_0x4392c6){if(_0x4392c6){return db[_0x8cbb('0x58')]['destroy']({'where':{'ListId':_0x4aa7f6[_0x8cbb('0x34')][_0x8cbb('0x65')],'CampaignId':_0x4aa7f6[_0x8cbb('0x45')]['id']}})[_0x8cbb('0x23')](function(){return _0x4392c6;});}})['then'](respondWithStatusCode(_0x42a05b,null))['catch'](handleError(_0x42a05b,null));};exports[_0x8cbb('0x82')]=function(_0x53b087,_0x58df63,_0x5be96d){var _0x3b9130={};var _0x1c1e54={};var _0x130085;var _0x30185e;return db[_0x8cbb('0x2e')]['findOne']({'where':{'id':_0x53b087[_0x8cbb('0x45')]['id']}})[_0x8cbb('0x23')](handleEntityNotFound(_0x58df63,null))[_0x8cbb('0x23')](function(_0x457b94){if(_0x457b94){_0x130085=_0x457b94;_0x1c1e54[_0x8cbb('0x31')]=_[_0x8cbb('0x33')](db['CmList'][_0x8cbb('0x2f')]);_0x1c1e54[_0x8cbb('0x34')]=_[_0x8cbb('0x33')](_0x53b087[_0x8cbb('0x34')]);_0x1c1e54[_0x8cbb('0x3a')]=_[_0x8cbb('0x35')](_0x1c1e54[_0x8cbb('0x31')],_0x1c1e54[_0x8cbb('0x34')]);_0x3b9130[_0x8cbb('0x36')]=_[_0x8cbb('0x35')](_0x1c1e54[_0x8cbb('0x31')],qs[_0x8cbb('0x46')](_0x53b087['query'][_0x8cbb('0x46')]));_0x3b9130[_0x8cbb('0x36')]=_0x3b9130[_0x8cbb('0x36')]['length']?_0x3b9130['attributes']:_0x1c1e54[_0x8cbb('0x31')];_0x3b9130['order']=qs[_0x8cbb('0x39')](_0x53b087['query'][_0x8cbb('0x39')]);_0x3b9130['where']=qs['filters'](_[_0x8cbb('0x5a')](_0x53b087[_0x8cbb('0x34')],_0x1c1e54[_0x8cbb('0x3a')]));if(_0x53b087[_0x8cbb('0x34')][_0x8cbb('0x5c')]){_0x3b9130[_0x8cbb('0x3b')]=_[_0x8cbb('0x3c')](_0x3b9130[_0x8cbb('0x3b')],{'$or':_['map'](_0x3b9130[_0x8cbb('0x36')],function(_0x1b7e80){var _0x3233ca={};_0x3233ca[_0x1b7e80]={'$like':'%'+_0x53b087[_0x8cbb('0x34')][_0x8cbb('0x5c')]+'%'};return _0x3233ca;})});}_0x3b9130=_[_0x8cbb('0x3c')]({},_0x3b9130,_0x53b087[_0x8cbb('0x3f')]);return _0x130085['getBlackLists'](_0x3b9130);}})['then'](function(_0x570872){if(_0x570872){_0x30185e=_0x570872['length'];if(!_0x53b087[_0x8cbb('0x34')][_0x8cbb('0x37')]('nolimit')){_0x3b9130[_0x8cbb('0x1d')]=qs['limit'](_0x53b087[_0x8cbb('0x34')][_0x8cbb('0x1d')]);_0x3b9130['offset']=qs[_0x8cbb('0x1f')](_0x53b087['query']['offset']);}return _0x130085[_0x8cbb('0x82')](_0x3b9130);}})['then'](function(_0x24334f){if(_0x24334f){return _0x24334f?{'count':_0x30185e,'rows':_0x24334f}:null;}})[_0x8cbb('0x23')](respondWithResult(_0x58df63,null))[_0x8cbb('0x43')](handleError(_0x58df63,null));};exports[_0x8cbb('0x83')]=function(_0x85a562,_0x3160d0,_0x56a357){var _0x31b9c9,_0x267fd9;return db[_0x8cbb('0x2e')][_0x8cbb('0x47')]({'where':{'id':_0x85a562[_0x8cbb('0x45')]['id']}})[_0x8cbb('0x23')](handleEntityNotFound(_0x3160d0,null))[_0x8cbb('0x23')](function(_0x582ffc){if(_0x582ffc){_0x267fd9=_0x582ffc;return _0x582ffc[_0x8cbb('0x83')](_0x85a562[_0x8cbb('0x49')][_0x8cbb('0x65')],_[_0x8cbb('0x53')](_0x85a562[_0x8cbb('0x49')],[_0x8cbb('0x65'),'id'])||{});}return null;})[_0x8cbb('0x66')](function(_0x558c53){var _0x79986e;_0x31b9c9=_0x558c53||[];var _0x2b3a17=[];if(_0x558c53){for(var _0x161797=0x0;_0x161797<_0x558c53['length'];_0x161797+=0x1){var _0x55599e=_0x558c53[_0x161797][_0x8cbb('0x25')]({'plain':!![]});_0x79986e=squel[_0x8cbb('0x7e')]()['into'](_0x8cbb('0x84'))[_0x8cbb('0x6a')]([_0x8cbb('0x6f'),_0x8cbb('0x6c'),_0x8cbb('0x6d'),_0x8cbb('0x5b'),_0x8cbb('0x54'),_0x8cbb('0x55')],squel['select']()[_0x8cbb('0x6e')]('phone','phone')[_0x8cbb('0x6e')]('id','ContactId')[_0x8cbb('0x6e')](_0x55599e[_0x8cbb('0x71')][_0x8cbb('0x72')](),_0x8cbb('0x6d'))[_0x8cbb('0x6e')](_0x85a562[_0x8cbb('0x45')]['id'][_0x8cbb('0x72')](),_0x8cbb('0x5b'))['field'](_0x8cbb('0x70'),'createdAt')[_0x8cbb('0x6e')]('NOW()',_0x8cbb('0x55'))[_0x8cbb('0x79')](_0x8cbb('0x85'))[_0x8cbb('0x3b')](_0x8cbb('0x73'))['where'](_0x8cbb('0x74'),_0x55599e[_0x8cbb('0x71')][_0x8cbb('0x72')]())[_0x8cbb('0x3b')](_0x8cbb('0x75')))[_0x8cbb('0x72')]();_0x2b3a17['push'](db['sequelize'][_0x8cbb('0x34')](_0x79986e));}return BPromise['all'](_0x2b3a17);}})[_0x8cbb('0x23')](function(){return _0x31b9c9;})[_0x8cbb('0x23')](respondWithResult(_0x3160d0,null))[_0x8cbb('0x43')](handleError(_0x3160d0,null));};exports[_0x8cbb('0x86')]=function(_0x59bda0,_0x5dcebf,_0x28fe94){return db[_0x8cbb('0x2e')]['find']({'where':{'id':_0x59bda0[_0x8cbb('0x45')]['id']}})[_0x8cbb('0x23')](handleEntityNotFound(_0x5dcebf,null))[_0x8cbb('0x23')](function(_0xcf56b5){if(_0xcf56b5){return _0xcf56b5['removeBlackLists'](_0x59bda0[_0x8cbb('0x34')][_0x8cbb('0x65')]);}})['then'](function(_0x3ea1f5){if(_0x3ea1f5){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x59bda0['query'][_0x8cbb('0x65')],'CampaignId':_0x59bda0[_0x8cbb('0x45')]['id']}})[_0x8cbb('0x23')](function(){return _0x3ea1f5;});}})[_0x8cbb('0x23')](respondWithStatusCode(_0x5dcebf,null))[_0x8cbb('0x43')](handleError(_0x5dcebf,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index d11090d..b9244fa 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(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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 _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 606031a..d6d949d 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 _0xd1d4=['message','result','catch','GetCampaign','findAll','options','raw','where','limit','include','map','model','attributes','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x29263f,_0x5d37df){var _0x3ce923=function(_0x1e9659){while(--_0x1e9659){_0x29263f['push'](_0x29263f['shift']());}};_0x3ce923(++_0x5d37df);}(_0xd1d4,0xfb));var _0x4d1d=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0xd1d4[_0x24259d];return _0x5a701;};'use strict';var _=require(_0x4d1d('0x0'));var util=require(_0x4d1d('0x1'));var moment=require('moment');var BPromise=require(_0x4d1d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4d1d('0x3'))['db'];var utils=require(_0x4d1d('0x4'));var logger=require(_0x4d1d('0x5'))(_0x4d1d('0x6'));var config=require(_0x4d1d('0x7'));var jayson=require(_0x4d1d('0x8'));var client=jayson[_0x4d1d('0x9')][_0x4d1d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1547d5,_0x1e0694,_0x23f6c4){return new BPromise(function(_0x54da0f,_0x4d6679){return client[_0x4d1d('0xb')](_0x1547d5,_0x23f6c4)[_0x4d1d('0xc')](function(_0x52cbbf){logger[_0x4d1d('0xd')](_0x4d1d('0xe'),_0x1e0694,_0x4d1d('0xf'));logger[_0x4d1d('0x10')](_0x4d1d('0x11'),_0x1e0694,_0x4d1d('0xf'),JSON[_0x4d1d('0x12')](_0x52cbbf));if(_0x52cbbf[_0x4d1d('0x13')]){if(_0x52cbbf[_0x4d1d('0x13')][_0x4d1d('0x14')]===0x1f4){logger[_0x4d1d('0x13')](_0x4d1d('0xe'),_0x1e0694,_0x52cbbf[_0x4d1d('0x13')]['message']);return _0x4d6679(_0x52cbbf[_0x4d1d('0x13')][_0x4d1d('0x15')]);}logger[_0x4d1d('0x13')](_0x4d1d('0xe'),_0x1e0694,_0x52cbbf['error']['message']);return _0x54da0f(_0x52cbbf[_0x4d1d('0x13')][_0x4d1d('0x15')]);}else{logger[_0x4d1d('0xd')]('Campaign,\x20%s,\x20%s',_0x1e0694,_0x4d1d('0xf'));_0x54da0f(_0x52cbbf[_0x4d1d('0x16')][_0x4d1d('0x15')]);}})[_0x4d1d('0x17')](function(_0x5d232d){logger['error']('Campaign,\x20%s,\x20%s',_0x1e0694,_0x5d232d);_0x4d6679(_0x5d232d);});});}exports[_0x4d1d('0x18')]=function(_0x83eb5a){var _0x3bea29=this;return new Promise(function(_0x38d465,_0x4fc413){return db['Campaign'][_0x4d1d('0x19')]({'raw':_0x83eb5a[_0x4d1d('0x1a')]?_0x83eb5a[_0x4d1d('0x1a')][_0x4d1d('0x1b')]===undefined?!![]:![]:!![],'where':_0x83eb5a[_0x4d1d('0x1a')]?_0x83eb5a[_0x4d1d('0x1a')][_0x4d1d('0x1c')]||null:null,'attributes':_0x83eb5a['options']?_0x83eb5a[_0x4d1d('0x1a')]['attributes']||null:null,'limit':_0x83eb5a[_0x4d1d('0x1a')]?_0x83eb5a[_0x4d1d('0x1a')][_0x4d1d('0x1d')]||null:null,'include':_0x83eb5a[_0x4d1d('0x1a')]?_0x83eb5a[_0x4d1d('0x1a')][_0x4d1d('0x1e')]?_[_0x4d1d('0x1f')](_0x83eb5a['options'][_0x4d1d('0x1e')],function(_0x43d108){return{'model':db[_0x43d108[_0x4d1d('0x20')]],'as':_0x43d108['as'],'attributes':_0x43d108[_0x4d1d('0x21')],'include':_0x43d108[_0x4d1d('0x1e')]?_['map'](_0x43d108[_0x4d1d('0x1e')],function(_0x45b17c){return{'model':db[_0x45b17c[_0x4d1d('0x20')]],'as':_0x45b17c['as'],'attributes':_0x45b17c[_0x4d1d('0x21')],'include':_0x45b17c[_0x4d1d('0x1e')]?_['map'](_0x45b17c[_0x4d1d('0x1e')],function(_0x58ac25){return{'model':db[_0x58ac25[_0x4d1d('0x20')]],'as':_0x58ac25['as'],'attributes':_0x58ac25[_0x4d1d('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4d1d('0xc')](function(_0xc33dea){logger[_0x4d1d('0xd')](_0x4d1d('0x18'),_0x83eb5a);logger['debug'](_0x4d1d('0x18'),_0x83eb5a,JSON[_0x4d1d('0x12')](_0xc33dea));_0x38d465(_0xc33dea);})[_0x4d1d('0x17')](function(_0x558888){logger[_0x4d1d('0x13')](_0x4d1d('0x18'),_0x558888['message'],_0x83eb5a);_0x4fc413(_0x3bea29[_0x4d1d('0x13')](0x1f4,_0x558888[_0x4d1d('0x15')]));});});}; \ No newline at end of file +var _0xb575=['jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','Campaign','findAll','options','raw','attributes','limit','include','map','model','GetCampaign','debug','stringify','lodash','util','bluebird','../../config/utils','../../config/logger','../../config/environment'];(function(_0x1a3e5f,_0x34c969){var _0x552d2b=function(_0x13d375){while(--_0x13d375){_0x1a3e5f['push'](_0x1a3e5f['shift']());}};_0x552d2b(++_0x34c969);}(_0xb575,0xda));var _0x5b57=function(_0x4e60d0,_0x376888){_0x4e60d0=_0x4e60d0-0x0;var _0x48049e=_0xb575[_0x4e60d0];return _0x48049e;};'use strict';var _=require(_0x5b57('0x0'));var util=require(_0x5b57('0x1'));var moment=require('moment');var BPromise=require(_0x5b57('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5b57('0x3'));var logger=require(_0x5b57('0x4'))('rpc');var config=require(_0x5b57('0x5'));var jayson=require(_0x5b57('0x6'));var client=jayson[_0x5b57('0x7')][_0x5b57('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x672beb,_0x5d223d,_0x4232d0){return new BPromise(function(_0x5dd0c7,_0x2f9789){return client[_0x5b57('0x9')](_0x672beb,_0x4232d0)[_0x5b57('0xa')](function(_0x49ce3a){logger[_0x5b57('0xb')](_0x5b57('0xc'),_0x5d223d,_0x5b57('0xd'));logger['debug'](_0x5b57('0xe'),_0x5d223d,_0x5b57('0xd'),JSON['stringify'](_0x49ce3a));if(_0x49ce3a['error']){if(_0x49ce3a[_0x5b57('0xf')][_0x5b57('0x10')]===0x1f4){logger[_0x5b57('0xf')](_0x5b57('0xc'),_0x5d223d,_0x49ce3a[_0x5b57('0xf')][_0x5b57('0x11')]);return _0x2f9789(_0x49ce3a[_0x5b57('0xf')][_0x5b57('0x11')]);}logger[_0x5b57('0xf')](_0x5b57('0xc'),_0x5d223d,_0x49ce3a['error'][_0x5b57('0x11')]);return _0x5dd0c7(_0x49ce3a[_0x5b57('0xf')][_0x5b57('0x11')]);}else{logger['info'](_0x5b57('0xc'),_0x5d223d,_0x5b57('0xd'));_0x5dd0c7(_0x49ce3a[_0x5b57('0x12')][_0x5b57('0x11')]);}})[_0x5b57('0x13')](function(_0x1e7cc0){logger[_0x5b57('0xf')](_0x5b57('0xc'),_0x5d223d,_0x1e7cc0);_0x2f9789(_0x1e7cc0);});});}exports['GetCampaign']=function(_0x336db6){var _0x1e316f=this;return new Promise(function(_0x2cb809,_0x137899){return db[_0x5b57('0x14')][_0x5b57('0x15')]({'raw':_0x336db6['options']?_0x336db6[_0x5b57('0x16')][_0x5b57('0x17')]===undefined?!![]:![]:!![],'where':_0x336db6[_0x5b57('0x16')]?_0x336db6[_0x5b57('0x16')]['where']||null:null,'attributes':_0x336db6[_0x5b57('0x16')]?_0x336db6[_0x5b57('0x16')][_0x5b57('0x18')]||null:null,'limit':_0x336db6['options']?_0x336db6[_0x5b57('0x16')][_0x5b57('0x19')]||null:null,'include':_0x336db6[_0x5b57('0x16')]?_0x336db6[_0x5b57('0x16')][_0x5b57('0x1a')]?_[_0x5b57('0x1b')](_0x336db6['options'][_0x5b57('0x1a')],function(_0x50ea5f){return{'model':db[_0x50ea5f[_0x5b57('0x1c')]],'as':_0x50ea5f['as'],'attributes':_0x50ea5f[_0x5b57('0x18')],'include':_0x50ea5f['include']?_['map'](_0x50ea5f[_0x5b57('0x1a')],function(_0x5eab3d){return{'model':db[_0x5eab3d[_0x5b57('0x1c')]],'as':_0x5eab3d['as'],'attributes':_0x5eab3d[_0x5b57('0x18')],'include':_0x5eab3d[_0x5b57('0x1a')]?_[_0x5b57('0x1b')](_0x5eab3d[_0x5b57('0x1a')],function(_0x17ac8b){return{'model':db[_0x17ac8b[_0x5b57('0x1c')]],'as':_0x17ac8b['as'],'attributes':_0x17ac8b[_0x5b57('0x18')]};}):[]};}):[]};}):[]:[]})[_0x5b57('0xa')](function(_0x31c4a5){logger[_0x5b57('0xb')](_0x5b57('0x1d'),_0x336db6);logger[_0x5b57('0x1e')](_0x5b57('0x1d'),_0x336db6,JSON[_0x5b57('0x1f')](_0x31c4a5));_0x2cb809(_0x31c4a5);})[_0x5b57('0x13')](function(_0x3e8bc6){logger['error'](_0x5b57('0x1d'),_0x3e8bc6['message'],_0x336db6);_0x137899(_0x1e316f[_0x5b57('0xf')](0x1f4,_0x3e8bc6[_0x5b57('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 16cea49..c409b85 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 _0xf438=['exports','multer','path','express','Router','../../components/interaction/service','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','post','create','/:id/clone','addLists','addBlackLists','put','delete','destroy','removeLists','removeBlackLists'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xf438,0x14b));var _0x8f43=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xf438[_0x32f7d7];return _0x133d09;};'use strict';var multer=require(_0x8f43('0x0'));var util=require('util');var path=require(_0x8f43('0x1'));var timeout=require('connect-timeout');var express=require(_0x8f43('0x2'));var router=express[_0x8f43('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8f43('0x4'));var config=require('../../config/environment');var controller=require(_0x8f43('0x5'));router[_0x8f43('0x6')]('/',auth[_0x8f43('0x7')](),controller[_0x8f43('0x8')]);router[_0x8f43('0x6')](_0x8f43('0x9'),auth[_0x8f43('0x7')](),controller[_0x8f43('0xa')]);router[_0x8f43('0x6')](_0x8f43('0xb'),auth[_0x8f43('0x7')](),controller['getHoppers']);router['get']('/:id/hopper_histories',auth[_0x8f43('0x7')](),controller[_0x8f43('0xc')]);router[_0x8f43('0x6')](_0x8f43('0xd'),auth[_0x8f43('0x7')](),controller[_0x8f43('0xe')]);router[_0x8f43('0x6')](_0x8f43('0xf'),auth[_0x8f43('0x7')](),controller[_0x8f43('0x10')]);router[_0x8f43('0x6')](_0x8f43('0x11'),auth[_0x8f43('0x7')](),controller['getLists']);router['get'](_0x8f43('0x12'),auth[_0x8f43('0x7')](),controller['getBlackLists']);router[_0x8f43('0x13')]('/',auth[_0x8f43('0x7')](),controller[_0x8f43('0x14')]);router[_0x8f43('0x13')](_0x8f43('0x15'),auth[_0x8f43('0x7')](),controller['clone']);router[_0x8f43('0x13')](_0x8f43('0x11'),auth[_0x8f43('0x7')](),controller[_0x8f43('0x16')]);router[_0x8f43('0x13')](_0x8f43('0x12'),auth[_0x8f43('0x7')](),controller[_0x8f43('0x17')]);router[_0x8f43('0x18')](_0x8f43('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x8f43('0x19')]('/:id',auth[_0x8f43('0x7')](),controller[_0x8f43('0x1a')]);router[_0x8f43('0x19')](_0x8f43('0x11'),auth['isAuthenticated'](),controller[_0x8f43('0x1b')]);router['delete'](_0x8f43('0x12'),auth[_0x8f43('0x7')](),controller[_0x8f43('0x1c')]);module[_0x8f43('0x1d')]=router; \ No newline at end of file +var _0xc5b5=['/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addLists','addBlackLists','put','update','delete','removeLists','removeBlackLists','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hopper_histories','getHopperHistories'];(function(_0x4236fa,_0x37b6a9){var _0x292b61=function(_0xfd0a6d){while(--_0xfd0a6d){_0x4236fa['push'](_0x4236fa['shift']());}};_0x292b61(++_0x37b6a9);}(_0xc5b5,0x1b2));var _0x5c5b=function(_0x35faf2,_0x56a899){_0x35faf2=_0x35faf2-0x0;var _0x113601=_0xc5b5[_0x35faf2];return _0x113601;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5c5b('0x0'));var timeout=require(_0x5c5b('0x1'));var express=require('express');var router=express[_0x5c5b('0x2')]();var fs_extra=require(_0x5c5b('0x3'));var auth=require(_0x5c5b('0x4'));var interaction=require(_0x5c5b('0x5'));var config=require('../../config/environment');var controller=require(_0x5c5b('0x6'));router[_0x5c5b('0x7')]('/',auth[_0x5c5b('0x8')](),controller[_0x5c5b('0x9')]);router[_0x5c5b('0x7')](_0x5c5b('0xa'),auth['isAuthenticated'](),controller[_0x5c5b('0xb')]);router[_0x5c5b('0x7')]('/:id/hoppers',auth[_0x5c5b('0x8')](),controller['getHoppers']);router[_0x5c5b('0x7')](_0x5c5b('0xc'),auth[_0x5c5b('0x8')](),controller[_0x5c5b('0xd')]);router['get'](_0x5c5b('0xe'),auth[_0x5c5b('0x8')](),controller[_0x5c5b('0xf')]);router['get']('/:id/hopper_black',auth['isAuthenticated'](),controller[_0x5c5b('0x10')]);router[_0x5c5b('0x7')](_0x5c5b('0x11'),auth[_0x5c5b('0x8')](),controller[_0x5c5b('0x12')]);router['get'](_0x5c5b('0x13'),auth[_0x5c5b('0x8')](),controller[_0x5c5b('0x14')]);router[_0x5c5b('0x15')]('/',auth[_0x5c5b('0x8')](),controller[_0x5c5b('0x16')]);router[_0x5c5b('0x15')](_0x5c5b('0x17'),auth[_0x5c5b('0x8')](),controller['clone']);router[_0x5c5b('0x15')](_0x5c5b('0x11'),auth[_0x5c5b('0x8')](),controller[_0x5c5b('0x18')]);router[_0x5c5b('0x15')](_0x5c5b('0x13'),auth['isAuthenticated'](),controller[_0x5c5b('0x19')]);router[_0x5c5b('0x1a')](_0x5c5b('0xa'),auth['isAuthenticated'](),controller[_0x5c5b('0x1b')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x5c5b('0x1c')](_0x5c5b('0x11'),auth[_0x5c5b('0x8')](),controller[_0x5c5b('0x1d')]);router[_0x5c5b('0x1c')]('/:id/blacklists',auth[_0x5c5b('0x8')](),controller[_0x5c5b('0x1e')]);module[_0x5c5b('0x1f')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 923d038..9c5dbf2 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 _0xf9ea=['STRING','TEXT','VIRTUAL','sequelize','exports'];(function(_0x1f73ae,_0x5e8b44){var _0x28a62a=function(_0x31bdd4){while(--_0x31bdd4){_0x1f73ae['push'](_0x1f73ae['shift']());}};_0x28a62a(++_0x5e8b44);}(_0xf9ea,0x107));var _0xaf9e=function(_0x120900,_0x1b16c7){_0x120900=_0x120900-0x0;var _0x356528=_0xf9ea[_0x120900];return _0x356528;};'use strict';var Sequelize=require(_0xaf9e('0x0'));module[_0xaf9e('0x1')]={'key':{'type':Sequelize[_0xaf9e('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xaf9e('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xaf9e('0x4')],'get':function(){return this['getDataValue']('key');}}}; \ No newline at end of file +var _0xfead=['key','exports','STRING','VIRTUAL','getDataValue'];(function(_0x1690c2,_0x47c82f){var _0x3dde51=function(_0x21f6af){while(--_0x21f6af){_0x1690c2['push'](_0x1690c2['shift']());}};_0x3dde51(++_0x47c82f);}(_0xfead,0x128));var _0xdfea=function(_0x2f84ea,_0x418e1){_0x2f84ea=_0x2f84ea-0x0;var _0x4079dd=_0xfead[_0x2f84ea];return _0x4079dd;};'use strict';var Sequelize=require('sequelize');module[_0xdfea('0x0')]={'key':{'type':Sequelize[_0xdfea('0x1')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0xdfea('0x1')]},'name':{'type':Sequelize[_0xdfea('0x2')],'get':function(){return this[_0xdfea('0x3')](_0xdfea('0x4'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index b452f84..fe7f3e7 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 _0x7e29=['UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','options','CannedAnswer','includeAll','include','findAll','rows','catch','show','params','model','fields','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x5a2f50,_0x38576d){var _0x45c2b5=function(_0x733141){while(--_0x733141){_0x5a2f50['push'](_0x5a2f50['shift']());}};_0x45c2b5(++_0x38576d);}(_0x7e29,0x174));var _0x97e2=function(_0x1ff8e9,_0x4c4d39){_0x1ff8e9=_0x1ff8e9-0x0;var _0x2ef958=_0x7e29[_0x1ff8e9];return _0x2ef958;};'use strict';var emlformat=require(_0x97e2('0x0'));var rimraf=require(_0x97e2('0x1'));var zipdir=require(_0x97e2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x97e2('0x3'));var moment=require(_0x97e2('0x4'));var BPromise=require(_0x97e2('0x5'));var Mustache=require(_0x97e2('0x6'));var util=require('util');var path=require(_0x97e2('0x7'));var sox=require(_0x97e2('0x8'));var csv=require('to-csv');var ejs=require(_0x97e2('0x9'));var fs=require('fs');var fs_extra=require(_0x97e2('0xa'));var _=require(_0x97e2('0xb'));var squel=require(_0x97e2('0xc'));var crypto=require(_0x97e2('0xd'));var jsforce=require(_0x97e2('0xe'));var deskjs=require(_0x97e2('0xf'));var toCsv=require(_0x97e2('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x97e2('0x11'));var authService=require(_0x97e2('0x12'));var qs=require(_0x97e2('0x13'));var as=require(_0x97e2('0x14'));var hardwareService=require(_0x97e2('0x15'));var logger=require(_0x97e2('0x16'))(_0x97e2('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x97e2('0x18'));var db=require(_0x97e2('0x19'))['db'];function respondWithStatusCode(_0x1fd312,_0x1231fe){_0x1231fe=_0x1231fe||0xcc;return function(_0x249a30){if(_0x249a30){return _0x1fd312['sendStatus'](_0x1231fe);}return _0x1fd312[_0x97e2('0x1a')](_0x1231fe)[_0x97e2('0x1b')]();};}function respondWithResult(_0x4fc8ca,_0x138925){_0x138925=_0x138925||0xc8;return function(_0x5828c6){if(_0x5828c6){return _0x4fc8ca[_0x97e2('0x1a')](_0x138925)['json'](_0x5828c6);}};}function respondWithFilteredResult(_0x41e7fd,_0x599943){return function(_0xe12d08){if(_0xe12d08){var _0x3d35a2=typeof _0x599943[_0x97e2('0x1c')]==='undefined'&&typeof _0x599943['limit']===_0x97e2('0x1d');var _0x5ebd30=_0xe12d08[_0x97e2('0x1e')];var _0x5c65d6=_0x3d35a2?0x0:_0x599943[_0x97e2('0x1c')];var _0x5accf2=_0x3d35a2?_0xe12d08[_0x97e2('0x1e')]:_0x599943[_0x97e2('0x1c')]+_0x599943[_0x97e2('0x1f')];var _0x5a6528;if(_0x5accf2>=_0x5ebd30){_0x5accf2=_0x5ebd30;_0x5a6528=0xc8;}else{_0x5a6528=0xce;}_0x41e7fd['status'](_0x5a6528);return _0x41e7fd[_0x97e2('0x20')](_0x97e2('0x21'),_0x5c65d6+'-'+_0x5accf2+'/'+_0x5ebd30)[_0x97e2('0x22')](_0xe12d08);}return null;};}function patchUpdates(_0x1bfe95){return function(_0x2c830c){try{jsonpatch[_0x97e2('0x23')](_0x2c830c,_0x1bfe95,!![]);}catch(_0x401c60){return BPromise[_0x97e2('0x24')](_0x401c60);}return _0x2c830c[_0x97e2('0x25')]();};}function saveUpdates(_0x43ff61,_0x2540f8){return function(_0x563182){if(_0x563182){return _0x563182[_0x97e2('0x26')](_0x43ff61)[_0x97e2('0x27')](function(_0x1343f0){return _0x1343f0;});}return null;};}function removeEntity(_0x156ca1,_0x203ba0){return function(_0x5f5c72){if(_0x5f5c72){return _0x5f5c72[_0x97e2('0x28')]()[_0x97e2('0x27')](function(){var _0x399f27=_0x5f5c72['get']({'plain':!![]});var _0x41589f='CannedAnswers';return db[_0x97e2('0x29')][_0x97e2('0x28')]({'where':{'type':_0x41589f,'resourceId':_0x399f27['id']}})[_0x97e2('0x27')](function(){return _0x5f5c72;});})[_0x97e2('0x27')](function(){_0x156ca1['status'](0xcc)[_0x97e2('0x1b')]();});}};}function handleEntityNotFound(_0x475c3c,_0x368ff3){return function(_0x2e1696){if(!_0x2e1696){_0x475c3c['sendStatus'](0x194);}return _0x2e1696;};}function handleError(_0xd51265,_0x2f8a19){_0x2f8a19=_0x2f8a19||0x1f4;return function(_0x9329c6){logger[_0x97e2('0x2a')](_0x9329c6[_0x97e2('0x2b')]);if(_0x9329c6[_0x97e2('0x2c')]){delete _0x9329c6[_0x97e2('0x2c')];}_0xd51265[_0x97e2('0x1a')](_0x2f8a19)[_0x97e2('0x2d')](_0x9329c6);};}exports[_0x97e2('0x2e')]=function(_0x16d4c4,_0x20ad73){var _0xdee2f4={},_0x2d0fa5={},_0x25e363={'count':0x0,'rows':[]};var _0x502f06=_[_0x97e2('0x2f')](db['CannedAnswer'][_0x97e2('0x30')],function(_0x351998){return{'name':_0x351998[_0x97e2('0x31')],'type':_0x351998[_0x97e2('0x32')][_0x97e2('0x33')]};});_0x2d0fa5['model']=_[_0x97e2('0x2f')](_0x502f06,_0x97e2('0x2c'));_0x2d0fa5[_0x97e2('0x34')]=_[_0x97e2('0x35')](_0x16d4c4['query']);_0x2d0fa5['filters']=_[_0x97e2('0x36')](_0x2d0fa5['model'],_0x2d0fa5[_0x97e2('0x34')]);_0xdee2f4[_0x97e2('0x37')]=_[_0x97e2('0x36')](_0x2d0fa5['model'],qs['fields'](_0x16d4c4[_0x97e2('0x34')]['fields']));_0xdee2f4[_0x97e2('0x37')]=_0xdee2f4[_0x97e2('0x37')][_0x97e2('0x38')]?_0xdee2f4[_0x97e2('0x37')]:_0x2d0fa5['model'];if(!_0x16d4c4['query'][_0x97e2('0x39')](_0x97e2('0x3a'))){_0xdee2f4['limit']=qs[_0x97e2('0x1f')](_0x16d4c4[_0x97e2('0x34')]['limit']);_0xdee2f4[_0x97e2('0x1c')]=qs[_0x97e2('0x1c')](_0x16d4c4[_0x97e2('0x34')][_0x97e2('0x1c')]);}_0xdee2f4[_0x97e2('0x3b')]=qs[_0x97e2('0x3c')](_0x16d4c4['query']['sort']);_0xdee2f4[_0x97e2('0x3d')]=qs[_0x97e2('0x3e')](_['pick'](_0x16d4c4[_0x97e2('0x34')],_0x2d0fa5[_0x97e2('0x3e')]),_0x502f06);if(_0x16d4c4['query'][_0x97e2('0x3f')]){_0xdee2f4[_0x97e2('0x3d')]=_['merge'](_0xdee2f4['where'],{'$or':[{'key':{'$like':'%'+_0x16d4c4[_0x97e2('0x34')][_0x97e2('0x3f')]+'%'}},{'value':{'$like':'%'+_0x16d4c4[_0x97e2('0x34')][_0x97e2('0x3f')]+'%'}}]});}_0xdee2f4=_['merge']({},_0xdee2f4,_0x16d4c4[_0x97e2('0x40')]);var _0x1771a3={'where':_0xdee2f4['where']};return db[_0x97e2('0x41')]['count'](_0x1771a3)[_0x97e2('0x27')](function(_0x229b49){_0x25e363['count']=_0x229b49;if(_0x16d4c4[_0x97e2('0x34')][_0x97e2('0x42')]){_0xdee2f4[_0x97e2('0x43')]=[{'all':!![]}];}return db[_0x97e2('0x41')][_0x97e2('0x44')](_0xdee2f4);})[_0x97e2('0x27')](function(_0x29807b){_0x25e363[_0x97e2('0x45')]=_0x29807b;return _0x25e363;})[_0x97e2('0x27')](respondWithFilteredResult(_0x20ad73,_0xdee2f4))[_0x97e2('0x46')](handleError(_0x20ad73,null));};exports[_0x97e2('0x47')]=function(_0x30395f,_0xce4421){var _0x9b8493={'raw':!![],'where':{'id':_0x30395f[_0x97e2('0x48')]['id']}},_0x61b7ca={};_0x61b7ca[_0x97e2('0x49')]=_[_0x97e2('0x35')](db[_0x97e2('0x41')]['rawAttributes']);_0x61b7ca[_0x97e2('0x34')]=_[_0x97e2('0x35')](_0x30395f[_0x97e2('0x34')]);_0x61b7ca['filters']=_[_0x97e2('0x36')](_0x61b7ca[_0x97e2('0x49')],_0x61b7ca[_0x97e2('0x34')]);_0x9b8493[_0x97e2('0x37')]=_[_0x97e2('0x36')](_0x61b7ca[_0x97e2('0x49')],qs['fields'](_0x30395f['query'][_0x97e2('0x4a')]));_0x9b8493['attributes']=_0x9b8493[_0x97e2('0x37')][_0x97e2('0x38')]?_0x9b8493[_0x97e2('0x37')]:_0x61b7ca[_0x97e2('0x49')];if(_0x30395f[_0x97e2('0x34')][_0x97e2('0x42')]){_0x9b8493['include']=[{'all':!![]}];}_0x9b8493=_['merge']({},_0x9b8493,_0x30395f[_0x97e2('0x40')]);return db[_0x97e2('0x41')][_0x97e2('0x4b')](_0x9b8493)[_0x97e2('0x27')](handleEntityNotFound(_0xce4421,null))[_0x97e2('0x27')](respondWithResult(_0xce4421,null))[_0x97e2('0x46')](handleError(_0xce4421,null));};exports[_0x97e2('0x26')]=function(_0x3376fc,_0x1eaa9c){if(_0x3376fc[_0x97e2('0x4c')]['id']){delete _0x3376fc[_0x97e2('0x4c')]['id'];}return db[_0x97e2('0x41')][_0x97e2('0x4b')]({'where':{'id':_0x3376fc[_0x97e2('0x48')]['id']}})['then'](handleEntityNotFound(_0x1eaa9c,null))[_0x97e2('0x27')](saveUpdates(_0x3376fc[_0x97e2('0x4c')],null))[_0x97e2('0x27')](respondWithResult(_0x1eaa9c,null))[_0x97e2('0x46')](handleError(_0x1eaa9c,null));};exports[_0x97e2('0x28')]=function(_0x4f246d,_0x42c85b){return db[_0x97e2('0x41')][_0x97e2('0x4b')]({'where':{'id':_0x4f246d[_0x97e2('0x48')]['id']}})[_0x97e2('0x27')](handleEntityNotFound(_0x42c85b,null))[_0x97e2('0x27')](removeEntity(_0x42c85b,null))[_0x97e2('0x46')](handleError(_0x42c85b,null));};exports[_0x97e2('0x4d')]=function(_0x3e8b44,_0x3a2682){var _0x16e8c6={'key':_0x3e8b44['body'][_0x97e2('0x33')]};if(_0x3e8b44['body'][_0x97e2('0x4e')]){_0x16e8c6['MailAccountId']=_0x3e8b44[_0x97e2('0x4c')][_0x97e2('0x4e')];}else if(_0x3e8b44[_0x97e2('0x4c')][_0x97e2('0x4f')]){_0x16e8c6[_0x97e2('0x4f')]=_0x3e8b44[_0x97e2('0x4c')]['SmsAccountId'];}else if(_0x3e8b44[_0x97e2('0x4c')][_0x97e2('0x50')]){_0x16e8c6[_0x97e2('0x50')]=_0x3e8b44[_0x97e2('0x4c')][_0x97e2('0x50')];}else if(_0x3e8b44[_0x97e2('0x4c')][_0x97e2('0x51')]){_0x16e8c6[_0x97e2('0x51')]=_0x3e8b44[_0x97e2('0x4c')][_0x97e2('0x51')];}return db[_0x97e2('0x41')][_0x97e2('0x4b')]({'where':_0x16e8c6})[_0x97e2('0x27')](function(_0x302ca3){if(_0x302ca3){throw new db[(_0x97e2('0x52'))][(_0x97e2('0x53'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x97e2('0x41')][_0x97e2('0x4d')](_0x3e8b44[_0x97e2('0x4c')]);})[_0x97e2('0x27')](function(_0x3fd944){var _0x3b9169=_0x3e8b44[_0x97e2('0x54')][_0x97e2('0x55')]({'plain':!![]});if(!_0x3b9169)throw new Error(_0x97e2('0x56'));if(_0x3b9169[_0x97e2('0x57')]==='user'){var _0x1f71e1=_0x3fd944['get']({'plain':!![]});return db[_0x97e2('0x58')][_0x97e2('0x4b')]({'where':{'name':'CannedAnswers','userProfileId':_0x3b9169[_0x97e2('0x59')]},'raw':!![]})['then'](function(_0x25452d){if(_0x25452d&&_0x25452d[_0x97e2('0x5a')]===0x0){return db['UserProfileResource'][_0x97e2('0x4d')]({'name':_0x1f71e1[_0x97e2('0x2c')],'resourceId':_0x1f71e1['id'],'type':_0x25452d[_0x97e2('0x2c')],'sectionId':_0x25452d['id']},{})[_0x97e2('0x27')](function(){return _0x3fd944;});}else{return _0x3fd944;}})[_0x97e2('0x46')](function(_0x13c67f){logger[_0x97e2('0x2a')](_0x97e2('0x5b'),_0x13c67f);throw _0x13c67f;});}return _0x3fd944;})[_0x97e2('0x27')](respondWithResult(_0x3a2682,0xc9))[_0x97e2('0x46')](handleError(_0x3a2682,null));}; \ No newline at end of file +var _0xbe18=['length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','count','includeAll','include','findAll','rows','catch','show','params','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','fs-extra','lodash','crypto','desk.js','to-csv','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','set','Content-Range','apply','reject','update','then','destroy','get','CannedAnswers','UserProfileResource','name','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x6d97b2,_0x3c1332){var _0x514465=function(_0x13c3ce){while(--_0x13c3ce){_0x6d97b2['push'](_0x6d97b2['shift']());}};_0x514465(++_0x3c1332);}(_0xbe18,0x1c8));var _0x8be1=function(_0x1fe7c9,_0x3a70f2){_0x1fe7c9=_0x1fe7c9-0x0;var _0x45c245=_0xbe18[_0x1fe7c9];return _0x45c245;};'use strict';var emlformat=require(_0x8be1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8be1('0x1'));var jsonpatch=require(_0x8be1('0x2'));var rp=require(_0x8be1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8be1('0x4'));var util=require(_0x8be1('0x5'));var path=require(_0x8be1('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8be1('0x7'));var fs=require('fs');var fs_extra=require(_0x8be1('0x8'));var _=require(_0x8be1('0x9'));var squel=require('squel');var crypto=require(_0x8be1('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x8be1('0xb'));var toCsv=require(_0x8be1('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8be1('0xd'));var authService=require(_0x8be1('0xe'));var qs=require(_0x8be1('0xf'));var as=require(_0x8be1('0x10'));var hardwareService=require(_0x8be1('0x11'));var logger=require(_0x8be1('0x12'))('api');var utils=require(_0x8be1('0x13'));var config=require(_0x8be1('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x8be1('0x15'))['db'];function respondWithStatusCode(_0x29d8fc,_0x436dd4){_0x436dd4=_0x436dd4||0xcc;return function(_0xa3cc68){if(_0xa3cc68){return _0x29d8fc[_0x8be1('0x16')](_0x436dd4);}return _0x29d8fc[_0x8be1('0x17')](_0x436dd4)[_0x8be1('0x18')]();};}function respondWithResult(_0x5d7934,_0x520645){_0x520645=_0x520645||0xc8;return function(_0x5a1e8b){if(_0x5a1e8b){return _0x5d7934[_0x8be1('0x17')](_0x520645)[_0x8be1('0x19')](_0x5a1e8b);}};}function respondWithFilteredResult(_0x1d9eeb,_0x57f05b){return function(_0x4f2c9d){if(_0x4f2c9d){var _0x5e44db=typeof _0x57f05b[_0x8be1('0x1a')]===_0x8be1('0x1b')&&typeof _0x57f05b[_0x8be1('0x1c')]===_0x8be1('0x1b');var _0x4ccfcd=_0x4f2c9d['count'];var _0x11d8ef=_0x5e44db?0x0:_0x57f05b[_0x8be1('0x1a')];var _0x11f103=_0x5e44db?_0x4f2c9d['count']:_0x57f05b[_0x8be1('0x1a')]+_0x57f05b['limit'];var _0x4e04e2;if(_0x11f103>=_0x4ccfcd){_0x11f103=_0x4ccfcd;_0x4e04e2=0xc8;}else{_0x4e04e2=0xce;}_0x1d9eeb['status'](_0x4e04e2);return _0x1d9eeb[_0x8be1('0x1d')](_0x8be1('0x1e'),_0x11d8ef+'-'+_0x11f103+'/'+_0x4ccfcd)[_0x8be1('0x19')](_0x4f2c9d);}return null;};}function patchUpdates(_0x4a3618){return function(_0x18d953){try{jsonpatch[_0x8be1('0x1f')](_0x18d953,_0x4a3618,!![]);}catch(_0x1e9a64){return BPromise[_0x8be1('0x20')](_0x1e9a64);}return _0x18d953['save']();};}function saveUpdates(_0x2347bc,_0x334844){return function(_0x457e49){if(_0x457e49){return _0x457e49[_0x8be1('0x21')](_0x2347bc)[_0x8be1('0x22')](function(_0x36846b){return _0x36846b;});}return null;};}function removeEntity(_0xae0726,_0x1527c2){return function(_0xecb3f6){if(_0xecb3f6){return _0xecb3f6[_0x8be1('0x23')]()[_0x8be1('0x22')](function(){var _0x38f681=_0xecb3f6[_0x8be1('0x24')]({'plain':!![]});var _0x4acf11=_0x8be1('0x25');return db[_0x8be1('0x26')][_0x8be1('0x23')]({'where':{'type':_0x4acf11,'resourceId':_0x38f681['id']}})[_0x8be1('0x22')](function(){return _0xecb3f6;});})[_0x8be1('0x22')](function(){_0xae0726['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x783cd3,_0x12ff42){return function(_0x2dc431){if(!_0x2dc431){_0x783cd3[_0x8be1('0x16')](0x194);}return _0x2dc431;};}function handleError(_0x3bb225,_0x4ff037){_0x4ff037=_0x4ff037||0x1f4;return function(_0x28021e){logger['error'](_0x28021e['stack']);if(_0x28021e['name']){delete _0x28021e[_0x8be1('0x27')];}_0x3bb225[_0x8be1('0x17')](_0x4ff037)['send'](_0x28021e);};}exports[_0x8be1('0x28')]=function(_0x4bae19,_0x390c12){var _0x297fba={},_0x3189de={},_0x80072b={'count':0x0,'rows':[]};var _0x22230d=_[_0x8be1('0x29')](db[_0x8be1('0x2a')][_0x8be1('0x2b')],function(_0x250887){return{'name':_0x250887[_0x8be1('0x2c')],'type':_0x250887[_0x8be1('0x2d')][_0x8be1('0x2e')]};});_0x3189de[_0x8be1('0x2f')]=_['map'](_0x22230d,_0x8be1('0x27'));_0x3189de[_0x8be1('0x30')]=_[_0x8be1('0x31')](_0x4bae19[_0x8be1('0x30')]);_0x3189de[_0x8be1('0x32')]=_[_0x8be1('0x33')](_0x3189de['model'],_0x3189de[_0x8be1('0x30')]);_0x297fba[_0x8be1('0x34')]=_[_0x8be1('0x33')](_0x3189de['model'],qs['fields'](_0x4bae19[_0x8be1('0x30')][_0x8be1('0x35')]));_0x297fba[_0x8be1('0x34')]=_0x297fba[_0x8be1('0x34')][_0x8be1('0x36')]?_0x297fba[_0x8be1('0x34')]:_0x3189de[_0x8be1('0x2f')];if(!_0x4bae19[_0x8be1('0x30')][_0x8be1('0x37')](_0x8be1('0x38'))){_0x297fba[_0x8be1('0x1c')]=qs[_0x8be1('0x1c')](_0x4bae19[_0x8be1('0x30')]['limit']);_0x297fba[_0x8be1('0x1a')]=qs[_0x8be1('0x1a')](_0x4bae19[_0x8be1('0x30')][_0x8be1('0x1a')]);}_0x297fba['order']=qs[_0x8be1('0x39')](_0x4bae19['query'][_0x8be1('0x39')]);_0x297fba[_0x8be1('0x3a')]=qs[_0x8be1('0x32')](_[_0x8be1('0x3b')](_0x4bae19[_0x8be1('0x30')],_0x3189de[_0x8be1('0x32')]),_0x22230d);if(_0x4bae19['query'][_0x8be1('0x3c')]){_0x297fba[_0x8be1('0x3a')]=_[_0x8be1('0x3d')](_0x297fba['where'],{'$or':[{'key':{'$like':'%'+_0x4bae19[_0x8be1('0x30')][_0x8be1('0x3c')]+'%'}},{'value':{'$like':'%'+_0x4bae19['query'][_0x8be1('0x3c')]+'%'}}]});}_0x297fba=_['merge']({},_0x297fba,_0x4bae19['options']);var _0x553c41={'where':_0x297fba['where']};return db[_0x8be1('0x2a')][_0x8be1('0x3e')](_0x553c41)[_0x8be1('0x22')](function(_0x5990ac){_0x80072b[_0x8be1('0x3e')]=_0x5990ac;if(_0x4bae19['query'][_0x8be1('0x3f')]){_0x297fba[_0x8be1('0x40')]=[{'all':!![]}];}return db[_0x8be1('0x2a')][_0x8be1('0x41')](_0x297fba);})[_0x8be1('0x22')](function(_0x5c21c2){_0x80072b[_0x8be1('0x42')]=_0x5c21c2;return _0x80072b;})[_0x8be1('0x22')](respondWithFilteredResult(_0x390c12,_0x297fba))[_0x8be1('0x43')](handleError(_0x390c12,null));};exports[_0x8be1('0x44')]=function(_0x952b48,_0x54353d){var _0x4a7da8={'raw':!![],'where':{'id':_0x952b48[_0x8be1('0x45')]['id']}},_0x4e5638={};_0x4e5638[_0x8be1('0x2f')]=_['keys'](db[_0x8be1('0x2a')][_0x8be1('0x2b')]);_0x4e5638['query']=_['keys'](_0x952b48[_0x8be1('0x30')]);_0x4e5638[_0x8be1('0x32')]=_[_0x8be1('0x33')](_0x4e5638[_0x8be1('0x2f')],_0x4e5638[_0x8be1('0x30')]);_0x4a7da8[_0x8be1('0x34')]=_['intersection'](_0x4e5638[_0x8be1('0x2f')],qs[_0x8be1('0x35')](_0x952b48[_0x8be1('0x30')]['fields']));_0x4a7da8[_0x8be1('0x34')]=_0x4a7da8[_0x8be1('0x34')][_0x8be1('0x36')]?_0x4a7da8[_0x8be1('0x34')]:_0x4e5638[_0x8be1('0x2f')];if(_0x952b48[_0x8be1('0x30')][_0x8be1('0x3f')]){_0x4a7da8[_0x8be1('0x40')]=[{'all':!![]}];}_0x4a7da8=_[_0x8be1('0x3d')]({},_0x4a7da8,_0x952b48['options']);return db['CannedAnswer'][_0x8be1('0x46')](_0x4a7da8)[_0x8be1('0x22')](handleEntityNotFound(_0x54353d,null))['then'](respondWithResult(_0x54353d,null))[_0x8be1('0x43')](handleError(_0x54353d,null));};exports[_0x8be1('0x21')]=function(_0x588972,_0xdf10e2){if(_0x588972[_0x8be1('0x47')]['id']){delete _0x588972[_0x8be1('0x47')]['id'];}return db['CannedAnswer']['find']({'where':{'id':_0x588972[_0x8be1('0x45')]['id']}})[_0x8be1('0x22')](handleEntityNotFound(_0xdf10e2,null))[_0x8be1('0x22')](saveUpdates(_0x588972[_0x8be1('0x47')],null))[_0x8be1('0x22')](respondWithResult(_0xdf10e2,null))[_0x8be1('0x43')](handleError(_0xdf10e2,null));};exports[_0x8be1('0x23')]=function(_0x325e29,_0x59b699){return db[_0x8be1('0x2a')][_0x8be1('0x46')]({'where':{'id':_0x325e29[_0x8be1('0x45')]['id']}})[_0x8be1('0x22')](handleEntityNotFound(_0x59b699,null))[_0x8be1('0x22')](removeEntity(_0x59b699,null))['catch'](handleError(_0x59b699,null));};exports['create']=function(_0x2b0583,_0xae0897){var _0xad7cf0={'key':_0x2b0583[_0x8be1('0x47')][_0x8be1('0x2e')]};if(_0x2b0583[_0x8be1('0x47')][_0x8be1('0x48')]){_0xad7cf0[_0x8be1('0x48')]=_0x2b0583[_0x8be1('0x47')][_0x8be1('0x48')];}else if(_0x2b0583['body'][_0x8be1('0x49')]){_0xad7cf0[_0x8be1('0x49')]=_0x2b0583[_0x8be1('0x47')][_0x8be1('0x49')];}else if(_0x2b0583[_0x8be1('0x47')][_0x8be1('0x4a')]){_0xad7cf0[_0x8be1('0x4a')]=_0x2b0583[_0x8be1('0x47')]['OpenchannelAccountId'];}else if(_0x2b0583[_0x8be1('0x47')][_0x8be1('0x4b')]){_0xad7cf0[_0x8be1('0x4b')]=_0x2b0583[_0x8be1('0x47')][_0x8be1('0x4b')];}return db[_0x8be1('0x2a')][_0x8be1('0x46')]({'where':_0xad7cf0})['then'](function(_0xc46a6c){if(_0xc46a6c){throw new db[(_0x8be1('0x4c'))][(_0x8be1('0x4d'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x8be1('0x2a')]['create'](_0x2b0583[_0x8be1('0x47')]);})[_0x8be1('0x22')](function(_0x8a416e){var _0x42c8be=_0x2b0583['user']['get']({'plain':!![]});if(!_0x42c8be)throw new Error(_0x8be1('0x4e'));if(_0x42c8be[_0x8be1('0x4f')]==='user'){var _0x3a9e91=_0x8a416e[_0x8be1('0x24')]({'plain':!![]});return db['UserProfileSection'][_0x8be1('0x46')]({'where':{'name':_0x8be1('0x25'),'userProfileId':_0x42c8be[_0x8be1('0x50')]},'raw':!![]})['then'](function(_0x473c16){if(_0x473c16&&_0x473c16[_0x8be1('0x51')]===0x0){return db['UserProfileResource'][_0x8be1('0x52')]({'name':_0x3a9e91[_0x8be1('0x27')],'resourceId':_0x3a9e91['id'],'type':_0x473c16[_0x8be1('0x27')],'sectionId':_0x473c16['id']},{})['then'](function(){return _0x8a416e;});}else{return _0x8a416e;}})['catch'](function(_0x174cfc){logger[_0x8be1('0x53')](_0x8be1('0x54'),_0x174cfc);throw _0x174cfc;});}return _0x8a416e;})[_0x8be1('0x22')](respondWithResult(_0xae0897,0xc9))[_0x8be1('0x43')](handleError(_0xae0897,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index ce2e1a2..4492ba4 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 _0xd5f9=['../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','request-promise','path'];(function(_0x5edf2c,_0x477e81){var _0x309540=function(_0x5aaea8){while(--_0x5aaea8){_0x5edf2c['push'](_0x5edf2c['shift']());}};_0x309540(++_0x477e81);}(_0xd5f9,0xbb));var _0x9d5f=function(_0x1c443f,_0x51319d){_0x1c443f=_0x1c443f-0x0;var _0x4a4a71=_0xd5f9[_0x1c443f];return _0x4a4a71;};'use strict';var _=require('lodash');var util=require(_0x9d5f('0x0'));var logger=require(_0x9d5f('0x1'))(_0x9d5f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9d5f('0x3'));var fs=require('fs');var path=require(_0x9d5f('0x4'));var rimraf=require('rimraf');var config=require(_0x9d5f('0x5'));var attributes=require(_0x9d5f('0x6'));module[_0x9d5f('0x7')]=function(_0x437c40,_0x4408b4){return _0x437c40['define'](_0x9d5f('0x8'),attributes,{'tableName':_0x9d5f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9d5f('0xa'),'collate':_0x9d5f('0xb')});}; \ No newline at end of file +var _0xcbbb=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x4ff391,_0x797a58){var _0x3d2f2b=function(_0x5d8bfd){while(--_0x5d8bfd){_0x4ff391['push'](_0x4ff391['shift']());}};_0x3d2f2b(++_0x797a58);}(_0xcbbb,0x1ee));var _0xbcbb=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0xcbbb[_0x5f309e];return _0x487b5e;};'use strict';var _=require(_0xbcbb('0x0'));var util=require(_0xbcbb('0x1'));var logger=require(_0xbcbb('0x2'))(_0xbcbb('0x3'));var moment=require(_0xbcbb('0x4'));var BPromise=require(_0xbcbb('0x5'));var rp=require(_0xbcbb('0x6'));var fs=require('fs');var path=require(_0xbcbb('0x7'));var rimraf=require(_0xbcbb('0x8'));var config=require(_0xbcbb('0x9'));var attributes=require(_0xbcbb('0xa'));module[_0xbcbb('0xb')]=function(_0x5d593d,_0xcefac7){return _0x5d593d['define']('CannedAnswer',attributes,{'tableName':_0xbcbb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbcbb('0xd'),'collate':_0xbcbb('0xe')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index f10412a..4cd3e64 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(_0x3e2d60,_0x3709d1){var _0x644b18=function(_0x44f3e8){while(--_0x44f3e8){_0x3e2d60['push'](_0x3e2d60['shift']());}};_0x644b18(++_0x3709d1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'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(_0x1f0392,_0x481e10){var _0x27222b=function(_0x59fb50){while(--_0x59fb50){_0x1f0392['push'](_0x1f0392['shift']());}};_0x27222b(++_0x481e10);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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 226713d..85c5b09 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 _0x5c19=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x185c73,_0x2729d3){var _0x8775cc=function(_0x2ec50e){while(--_0x2ec50e){_0x185c73['push'](_0x185c73['shift']());}};_0x8775cc(++_0x2729d3);}(_0x5c19,0x139));var _0x95c1=function(_0x84b9a1,_0x489b2a){_0x84b9a1=_0x84b9a1-0x0;var _0x5a0bf2=_0x5c19[_0x84b9a1];return _0x5a0bf2;};'use strict';var multer=require(_0x95c1('0x0'));var util=require(_0x95c1('0x1'));var path=require(_0x95c1('0x2'));var timeout=require(_0x95c1('0x3'));var express=require(_0x95c1('0x4'));var router=express[_0x95c1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x95c1('0x6'));var interaction=require(_0x95c1('0x7'));var config=require(_0x95c1('0x8'));var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0x95c1('0x9')](),controller[_0x95c1('0xa')]);router[_0x95c1('0xb')](_0x95c1('0xc'),auth['isAuthenticated'](),controller[_0x95c1('0xd')]);router[_0x95c1('0xe')]('/',auth[_0x95c1('0x9')](),controller[_0x95c1('0xf')]);router[_0x95c1('0x10')](_0x95c1('0xc'),auth[_0x95c1('0x9')](),controller[_0x95c1('0x11')]);router[_0x95c1('0x12')](_0x95c1('0xc'),auth[_0x95c1('0x9')](),controller[_0x95c1('0x13')]);module[_0x95c1('0x14')]=router; \ No newline at end of file +var _0x296a=['put','update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x2a7b8e,_0x50ffce){var _0x29b5c8=function(_0x131fe0){while(--_0x131fe0){_0x2a7b8e['push'](_0x2a7b8e['shift']());}};_0x29b5c8(++_0x50ffce);}(_0x296a,0x15a));var _0xa296=function(_0x3d998b,_0x309a28){_0x3d998b=_0x3d998b-0x0;var _0x2ba888=_0x296a[_0x3d998b];return _0x2ba888;};'use strict';var multer=require(_0xa296('0x0'));var util=require('util');var path=require(_0xa296('0x1'));var timeout=require(_0xa296('0x2'));var express=require(_0xa296('0x3'));var router=express['Router']();var fs_extra=require(_0xa296('0x4'));var auth=require(_0xa296('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa296('0x6'));var controller=require('./cannedAnswer.controller');router[_0xa296('0x7')]('/',auth[_0xa296('0x8')](),controller[_0xa296('0x9')]);router['get'](_0xa296('0xa'),auth['isAuthenticated'](),controller[_0xa296('0xb')]);router[_0xa296('0xc')]('/',auth[_0xa296('0x8')](),controller[_0xa296('0xd')]);router[_0xa296('0xe')](_0xa296('0xa'),auth[_0xa296('0x8')](),controller[_0xa296('0xf')]);router[_0xa296('0x10')]('/:id',auth[_0xa296('0x8')](),controller[_0xa296('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index a3963e9..75ee4b3 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 _0x3095=['exports','DATE','STRING','INTEGER','sequelize'];(function(_0x31dff6,_0x3b2578){var _0x3a3998=function(_0x498ee2){while(--_0x498ee2){_0x31dff6['push'](_0x31dff6['shift']());}};_0x3a3998(++_0x3b2578);}(_0x3095,0x158));var _0x5309=function(_0x3969c1,_0x522586){_0x3969c1=_0x3969c1-0x0;var _0x394313=_0x3095[_0x3969c1];return _0x394313;};'use strict';var Sequelize=require(_0x5309('0x0'));module[_0x5309('0x1')]={'calldate':{'type':Sequelize[_0x5309('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x5309('0x3')]},'dst':{'type':Sequelize[_0x5309('0x3')]},'dcontext':{'type':Sequelize[_0x5309('0x3')]},'channel':{'type':Sequelize[_0x5309('0x3')]},'dstchannel':{'type':Sequelize[_0x5309('0x3')]},'lastapp':{'type':Sequelize[_0x5309('0x3')]},'lastdata':{'type':Sequelize[_0x5309('0x3')]},'duration':{'type':Sequelize[_0x5309('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x5309('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5309('0x3')]},'amaflags':{'type':Sequelize[_0x5309('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x5309('0x3')]},'userfield':{'type':Sequelize[_0x5309('0x3')]},'uniqueid':{'type':Sequelize[_0x5309('0x3')]},'linkedid':{'type':Sequelize[_0x5309('0x3')]},'sequence':{'type':Sequelize[_0x5309('0x3')]},'peeraccount':{'type':Sequelize[_0x5309('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x5309('0x3')]}}; \ No newline at end of file +var _0xa446=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xa446,0xc6));var _0x6a44=function(_0xf263c0,_0x5b88be){_0xf263c0=_0xf263c0-0x0;var _0x50ac9c=_0xa446[_0xf263c0];return _0x50ac9c;};'use strict';var Sequelize=require(_0x6a44('0x0'));module[_0x6a44('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x6a44('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x6a44('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x6a44('0x3')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x6a44('0x3')]},'lastapp':{'type':Sequelize[_0x6a44('0x3')]},'lastdata':{'type':Sequelize[_0x6a44('0x3')]},'duration':{'type':Sequelize[_0x6a44('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x6a44('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x6a44('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x6a44('0x3')]},'userfield':{'type':Sequelize[_0x6a44('0x3')]},'uniqueid':{'type':Sequelize[_0x6a44('0x3')]},'linkedid':{'type':Sequelize[_0x6a44('0x3')]},'sequence':{'type':Sequelize[_0x6a44('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x6a44('0x3')]},'tag':{'type':Sequelize[_0x6a44('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index d9e1473..b86f397 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 _0x3c94=['then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','Cdr','includeAll','include','findAll','rows','catch','params','find','create','body','describe','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','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','Content-Range','apply','reject','save','update'];(function(_0x4aeb7c,_0x5aae92){var _0x5d9cd7=function(_0xc79947){while(--_0xc79947){_0x4aeb7c['push'](_0x4aeb7c['shift']());}};_0x5d9cd7(++_0x5aae92);}(_0x3c94,0xcd));var _0x43c9=function(_0x467cb0,_0x303070){_0x467cb0=_0x467cb0-0x0;var _0x2153f7=_0x3c94[_0x467cb0];return _0x2153f7;};'use strict';var emlformat=require(_0x43c9('0x0'));var rimraf=require(_0x43c9('0x1'));var zipdir=require(_0x43c9('0x2'));var jsonpatch=require(_0x43c9('0x3'));var rp=require(_0x43c9('0x4'));var moment=require(_0x43c9('0x5'));var BPromise=require(_0x43c9('0x6'));var Mustache=require(_0x43c9('0x7'));var util=require(_0x43c9('0x8'));var path=require(_0x43c9('0x9'));var sox=require(_0x43c9('0xa'));var csv=require(_0x43c9('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x43c9('0xc'));var _=require(_0x43c9('0xd'));var squel=require(_0x43c9('0xe'));var crypto=require(_0x43c9('0xf'));var jsforce=require(_0x43c9('0x10'));var deskjs=require(_0x43c9('0x11'));var toCsv=require(_0x43c9('0xb'));var querystring=require(_0x43c9('0x12'));var Papa=require(_0x43c9('0x13'));var Redis=require('ioredis');var authService=require(_0x43c9('0x14'));var qs=require(_0x43c9('0x15'));var as=require(_0x43c9('0x16'));var hardwareService=require(_0x43c9('0x17'));var logger=require(_0x43c9('0x18'))(_0x43c9('0x19'));var utils=require(_0x43c9('0x1a'));var config=require(_0x43c9('0x1b'));var licenseUtil=require(_0x43c9('0x1c'));var db=require(_0x43c9('0x1d'))['db'];function respondWithStatusCode(_0x62bb3b,_0x31faa1){_0x31faa1=_0x31faa1||0xcc;return function(_0x11fe24){if(_0x11fe24){return _0x62bb3b[_0x43c9('0x1e')](_0x31faa1);}return _0x62bb3b[_0x43c9('0x1f')](_0x31faa1)[_0x43c9('0x20')]();};}function respondWithResult(_0x275b2b,_0x569fa9){_0x569fa9=_0x569fa9||0xc8;return function(_0x37932f){if(_0x37932f){return _0x275b2b[_0x43c9('0x1f')](_0x569fa9)[_0x43c9('0x21')](_0x37932f);}};}function respondWithFilteredResult(_0xe02707,_0x3f908d){return function(_0x5cc1fa){if(_0x5cc1fa){var _0x549d3f=typeof _0x3f908d[_0x43c9('0x22')]===_0x43c9('0x23')&&typeof _0x3f908d[_0x43c9('0x24')]===_0x43c9('0x23');var _0x501856=_0x5cc1fa[_0x43c9('0x25')];var _0x1da149=_0x549d3f?0x0:_0x3f908d[_0x43c9('0x22')];var _0x22bf3d=_0x549d3f?_0x5cc1fa[_0x43c9('0x25')]:_0x3f908d[_0x43c9('0x22')]+_0x3f908d[_0x43c9('0x24')];var _0x1e3996;if(_0x22bf3d>=_0x501856){_0x22bf3d=_0x501856;_0x1e3996=0xc8;}else{_0x1e3996=0xce;}_0xe02707[_0x43c9('0x1f')](_0x1e3996);return _0xe02707[_0x43c9('0x26')](_0x43c9('0x27'),_0x1da149+'-'+_0x22bf3d+'/'+_0x501856)['json'](_0x5cc1fa);}return null;};}function patchUpdates(_0x39c6f1){return function(_0x772b71){try{jsonpatch[_0x43c9('0x28')](_0x772b71,_0x39c6f1,!![]);}catch(_0x4c2d7c){return BPromise[_0x43c9('0x29')](_0x4c2d7c);}return _0x772b71[_0x43c9('0x2a')]();};}function saveUpdates(_0x2ef8d9,_0x5705c6){return function(_0x28290a){if(_0x28290a){return _0x28290a[_0x43c9('0x2b')](_0x2ef8d9)[_0x43c9('0x2c')](function(_0x4d58d7){return _0x4d58d7;});}return null;};}function removeEntity(_0x4963d2,_0x2a40f4){return function(_0x3fd641){if(_0x3fd641){return _0x3fd641[_0x43c9('0x2d')]()['then'](function(){_0x4963d2[_0x43c9('0x1f')](0xcc)[_0x43c9('0x20')]();});}};}function handleEntityNotFound(_0x1e676a,_0x16fee9){return function(_0x2c69af){if(!_0x2c69af){_0x1e676a['sendStatus'](0x194);}return _0x2c69af;};}function handleError(_0x386078,_0x3b5c47){_0x3b5c47=_0x3b5c47||0x1f4;return function(_0x3910af){logger[_0x43c9('0x2e')](_0x3910af[_0x43c9('0x2f')]);if(_0x3910af[_0x43c9('0x30')]){delete _0x3910af[_0x43c9('0x30')];}_0x386078[_0x43c9('0x1f')](_0x3b5c47)[_0x43c9('0x31')](_0x3910af);};}exports[_0x43c9('0x32')]=function(_0x4eb970,_0x11e3c3){var _0x2cbfd7={},_0x15028c={},_0x519e2c={'count':0x0,'rows':[]};var _0x2c0ccc=_[_0x43c9('0x33')](db['Cdr'][_0x43c9('0x34')],function(_0x497719){return{'name':_0x497719[_0x43c9('0x35')],'type':_0x497719[_0x43c9('0x36')][_0x43c9('0x37')]};});_0x15028c[_0x43c9('0x38')]=_['map'](_0x2c0ccc,_0x43c9('0x30'));_0x15028c[_0x43c9('0x39')]=_[_0x43c9('0x3a')](_0x4eb970['query']);_0x15028c[_0x43c9('0x3b')]=_['intersection'](_0x15028c[_0x43c9('0x38')],_0x15028c[_0x43c9('0x39')]);_0x2cbfd7[_0x43c9('0x3c')]=_[_0x43c9('0x3d')](_0x15028c['model'],qs[_0x43c9('0x3e')](_0x4eb970[_0x43c9('0x39')][_0x43c9('0x3e')]));_0x2cbfd7[_0x43c9('0x3c')]=_0x2cbfd7['attributes'][_0x43c9('0x3f')]?_0x2cbfd7[_0x43c9('0x3c')]:_0x15028c[_0x43c9('0x38')];if(!_0x4eb970[_0x43c9('0x39')][_0x43c9('0x40')](_0x43c9('0x41'))){_0x2cbfd7[_0x43c9('0x24')]=qs[_0x43c9('0x24')](_0x4eb970['query'][_0x43c9('0x24')]);_0x2cbfd7[_0x43c9('0x22')]=qs[_0x43c9('0x22')](_0x4eb970[_0x43c9('0x39')][_0x43c9('0x22')]);}_0x2cbfd7[_0x43c9('0x42')]=qs[_0x43c9('0x43')](_0x4eb970[_0x43c9('0x39')][_0x43c9('0x43')]);_0x2cbfd7['where']=qs[_0x43c9('0x3b')](_['pick'](_0x4eb970[_0x43c9('0x39')],_0x15028c[_0x43c9('0x3b')]),_0x2c0ccc);if(_0x4eb970[_0x43c9('0x39')][_0x43c9('0x44')]){_0x2cbfd7[_0x43c9('0x45')]=_[_0x43c9('0x46')](_0x2cbfd7[_0x43c9('0x45')],{'$or':_[_0x43c9('0x33')](_0x2c0ccc,function(_0x518bd3){if(_0x518bd3['type']!==_0x43c9('0x47')){var _0x2d63bd={};_0x2d63bd[_0x518bd3['name']]={'$like':'%'+_0x4eb970[_0x43c9('0x39')][_0x43c9('0x44')]+'%'};return _0x2d63bd;}})});}_0x2cbfd7=_[_0x43c9('0x46')]({},_0x2cbfd7,_0x4eb970['options']);var _0xb01a6e={'where':_0x2cbfd7[_0x43c9('0x45')]};return db[_0x43c9('0x48')][_0x43c9('0x25')](_0xb01a6e)[_0x43c9('0x2c')](function(_0x39601e){_0x519e2c[_0x43c9('0x25')]=_0x39601e;if(_0x4eb970[_0x43c9('0x39')][_0x43c9('0x49')]){_0x2cbfd7[_0x43c9('0x4a')]=[{'all':!![]}];}return db[_0x43c9('0x48')][_0x43c9('0x4b')](_0x2cbfd7);})['then'](function(_0x2d5dd5){_0x519e2c[_0x43c9('0x4c')]=_0x2d5dd5;return _0x519e2c;})[_0x43c9('0x2c')](respondWithFilteredResult(_0x11e3c3,_0x2cbfd7))[_0x43c9('0x4d')](handleError(_0x11e3c3,null));};exports['show']=function(_0xff891d,_0x66cac9){var _0x5ce14f={'raw':!![],'where':{'id':_0xff891d[_0x43c9('0x4e')]['id']}},_0x2a8f7d={};_0x2a8f7d[_0x43c9('0x38')]=_[_0x43c9('0x3a')](db[_0x43c9('0x48')][_0x43c9('0x34')]);_0x2a8f7d[_0x43c9('0x39')]=_[_0x43c9('0x3a')](_0xff891d[_0x43c9('0x39')]);_0x2a8f7d['filters']=_[_0x43c9('0x3d')](_0x2a8f7d['model'],_0x2a8f7d[_0x43c9('0x39')]);_0x5ce14f[_0x43c9('0x3c')]=_[_0x43c9('0x3d')](_0x2a8f7d[_0x43c9('0x38')],qs['fields'](_0xff891d[_0x43c9('0x39')][_0x43c9('0x3e')]));_0x5ce14f['attributes']=_0x5ce14f[_0x43c9('0x3c')][_0x43c9('0x3f')]?_0x5ce14f['attributes']:_0x2a8f7d[_0x43c9('0x38')];if(_0xff891d[_0x43c9('0x39')][_0x43c9('0x49')]){_0x5ce14f['include']=[{'all':!![]}];}_0x5ce14f=_[_0x43c9('0x46')]({},_0x5ce14f,_0xff891d['options']);return db['Cdr'][_0x43c9('0x4f')](_0x5ce14f)[_0x43c9('0x2c')](handleEntityNotFound(_0x66cac9,null))[_0x43c9('0x2c')](respondWithResult(_0x66cac9,null))[_0x43c9('0x4d')](handleError(_0x66cac9,null));};exports[_0x43c9('0x50')]=function(_0x28fe5d,_0x1f966e){return db[_0x43c9('0x48')][_0x43c9('0x50')](_0x28fe5d[_0x43c9('0x51')],{})[_0x43c9('0x2c')](respondWithResult(_0x1f966e,0xc9))[_0x43c9('0x4d')](handleError(_0x1f966e,null));};exports[_0x43c9('0x2b')]=function(_0x5082e9,_0xc57086){if(_0x5082e9[_0x43c9('0x51')]['id']){delete _0x5082e9['body']['id'];}return db[_0x43c9('0x48')][_0x43c9('0x4f')]({'where':{'id':_0x5082e9[_0x43c9('0x4e')]['id']}})[_0x43c9('0x2c')](handleEntityNotFound(_0xc57086,null))[_0x43c9('0x2c')](saveUpdates(_0x5082e9[_0x43c9('0x51')],null))[_0x43c9('0x2c')](respondWithResult(_0xc57086,null))[_0x43c9('0x4d')](handleError(_0xc57086,null));};exports[_0x43c9('0x2d')]=function(_0x508b62,_0x27db89){return db[_0x43c9('0x48')][_0x43c9('0x4f')]({'where':{'id':_0x508b62[_0x43c9('0x4e')]['id']}})[_0x43c9('0x2c')](handleEntityNotFound(_0x27db89,null))[_0x43c9('0x2c')](removeEntity(_0x27db89,null))['catch'](handleError(_0x27db89,null));};exports[_0x43c9('0x52')]=function(_0x1bc3b5,_0x3aff2e){return db[_0x43c9('0x48')][_0x43c9('0x52')]()[_0x43c9('0x2c')](respondWithResult(_0x3aff2e,null))[_0x43c9('0x4d')](handleError(_0x3aff2e,null));}; \ No newline at end of file +var _0x7d9f=['util','path','sox','fs-extra','lodash','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','reject','update','then','error','stack','name','index','map','Cdr','rawAttributes','model','keys','attributes','intersection','fields','query','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','find','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x1f5e4a,_0x16111e){var _0x380da7=function(_0x49dbbb){while(--_0x49dbbb){_0x1f5e4a['push'](_0x1f5e4a['shift']());}};_0x380da7(++_0x16111e);}(_0x7d9f,0x15c));var _0xf7d9=function(_0x542149,_0x5df180){_0x542149=_0x542149-0x0;var _0x36df57=_0x7d9f[_0x542149];return _0x36df57;};'use strict';var emlformat=require(_0xf7d9('0x0'));var rimraf=require(_0xf7d9('0x1'));var zipdir=require(_0xf7d9('0x2'));var jsonpatch=require(_0xf7d9('0x3'));var rp=require(_0xf7d9('0x4'));var moment=require('moment');var BPromise=require(_0xf7d9('0x5'));var Mustache=require(_0xf7d9('0x6'));var util=require(_0xf7d9('0x7'));var path=require(_0xf7d9('0x8'));var sox=require(_0xf7d9('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf7d9('0xa'));var _=require(_0xf7d9('0xb'));var squel=require('squel');var crypto=require(_0xf7d9('0xc'));var jsforce=require(_0xf7d9('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf7d9('0xe'));var querystring=require('querystring');var Papa=require(_0xf7d9('0xf'));var Redis=require(_0xf7d9('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf7d9('0x11'));var hardwareService=require(_0xf7d9('0x12'));var logger=require(_0xf7d9('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xf7d9('0x14'));var licenseUtil=require(_0xf7d9('0x15'));var db=require(_0xf7d9('0x16'))['db'];function respondWithStatusCode(_0x35e156,_0x594dfe){_0x594dfe=_0x594dfe||0xcc;return function(_0x16e680){if(_0x16e680){return _0x35e156[_0xf7d9('0x17')](_0x594dfe);}return _0x35e156[_0xf7d9('0x18')](_0x594dfe)[_0xf7d9('0x19')]();};}function respondWithResult(_0x49f766,_0x189c82){_0x189c82=_0x189c82||0xc8;return function(_0x359843){if(_0x359843){return _0x49f766[_0xf7d9('0x18')](_0x189c82)[_0xf7d9('0x1a')](_0x359843);}};}function respondWithFilteredResult(_0x5d3029,_0x405ed4){return function(_0x22ed4a){if(_0x22ed4a){var _0x341e27=typeof _0x405ed4['offset']==='undefined'&&typeof _0x405ed4[_0xf7d9('0x1b')]===_0xf7d9('0x1c');var _0xe29103=_0x22ed4a['count'];var _0x44ebd3=_0x341e27?0x0:_0x405ed4[_0xf7d9('0x1d')];var _0x5eb7c9=_0x341e27?_0x22ed4a[_0xf7d9('0x1e')]:_0x405ed4['offset']+_0x405ed4[_0xf7d9('0x1b')];var _0x1bbc77;if(_0x5eb7c9>=_0xe29103){_0x5eb7c9=_0xe29103;_0x1bbc77=0xc8;}else{_0x1bbc77=0xce;}_0x5d3029['status'](_0x1bbc77);return _0x5d3029[_0xf7d9('0x1f')](_0xf7d9('0x20'),_0x44ebd3+'-'+_0x5eb7c9+'/'+_0xe29103)[_0xf7d9('0x1a')](_0x22ed4a);}return null;};}function patchUpdates(_0x316d54){return function(_0x165160){try{jsonpatch[_0xf7d9('0x21')](_0x165160,_0x316d54,!![]);}catch(_0xd04b9d){return BPromise[_0xf7d9('0x22')](_0xd04b9d);}return _0x165160['save']();};}function saveUpdates(_0x5e96df,_0x36b974){return function(_0x4cfe93){if(_0x4cfe93){return _0x4cfe93[_0xf7d9('0x23')](_0x5e96df)[_0xf7d9('0x24')](function(_0x574b12){return _0x574b12;});}return null;};}function removeEntity(_0x8d8e48,_0x27ba8c){return function(_0x514ffa){if(_0x514ffa){return _0x514ffa['destroy']()[_0xf7d9('0x24')](function(){_0x8d8e48[_0xf7d9('0x18')](0xcc)[_0xf7d9('0x19')]();});}};}function handleEntityNotFound(_0x595556,_0x3c0b91){return function(_0x496ab7){if(!_0x496ab7){_0x595556[_0xf7d9('0x17')](0x194);}return _0x496ab7;};}function handleError(_0x3b3ea5,_0x144ae2){_0x144ae2=_0x144ae2||0x1f4;return function(_0x5b1ea5){logger[_0xf7d9('0x25')](_0x5b1ea5[_0xf7d9('0x26')]);if(_0x5b1ea5[_0xf7d9('0x27')]){delete _0x5b1ea5[_0xf7d9('0x27')];}_0x3b3ea5[_0xf7d9('0x18')](_0x144ae2)['send'](_0x5b1ea5);};}exports[_0xf7d9('0x28')]=function(_0x3847ff,_0x2b5f17){var _0x2c04c3={},_0x508b00={},_0x20315e={'count':0x0,'rows':[]};var _0x193add=_[_0xf7d9('0x29')](db[_0xf7d9('0x2a')][_0xf7d9('0x2b')],function(_0x16318f){return{'name':_0x16318f['fieldName'],'type':_0x16318f['type']['key']};});_0x508b00[_0xf7d9('0x2c')]=_['map'](_0x193add,_0xf7d9('0x27'));_0x508b00['query']=_[_0xf7d9('0x2d')](_0x3847ff['query']);_0x508b00['filters']=_['intersection'](_0x508b00[_0xf7d9('0x2c')],_0x508b00['query']);_0x2c04c3[_0xf7d9('0x2e')]=_[_0xf7d9('0x2f')](_0x508b00[_0xf7d9('0x2c')],qs[_0xf7d9('0x30')](_0x3847ff[_0xf7d9('0x31')][_0xf7d9('0x30')]));_0x2c04c3[_0xf7d9('0x2e')]=_0x2c04c3[_0xf7d9('0x2e')]['length']?_0x2c04c3[_0xf7d9('0x2e')]:_0x508b00[_0xf7d9('0x2c')];if(!_0x3847ff['query']['hasOwnProperty'](_0xf7d9('0x32'))){_0x2c04c3[_0xf7d9('0x1b')]=qs[_0xf7d9('0x1b')](_0x3847ff['query'][_0xf7d9('0x1b')]);_0x2c04c3[_0xf7d9('0x1d')]=qs[_0xf7d9('0x1d')](_0x3847ff[_0xf7d9('0x31')][_0xf7d9('0x1d')]);}_0x2c04c3[_0xf7d9('0x33')]=qs[_0xf7d9('0x34')](_0x3847ff[_0xf7d9('0x31')][_0xf7d9('0x34')]);_0x2c04c3[_0xf7d9('0x35')]=qs[_0xf7d9('0x36')](_['pick'](_0x3847ff[_0xf7d9('0x31')],_0x508b00['filters']),_0x193add);if(_0x3847ff[_0xf7d9('0x31')][_0xf7d9('0x37')]){_0x2c04c3[_0xf7d9('0x35')]=_[_0xf7d9('0x38')](_0x2c04c3['where'],{'$or':_['map'](_0x193add,function(_0x2173e2){if(_0x2173e2['type']!==_0xf7d9('0x39')){var _0xb3723c={};_0xb3723c[_0x2173e2[_0xf7d9('0x27')]]={'$like':'%'+_0x3847ff[_0xf7d9('0x31')]['filter']+'%'};return _0xb3723c;}})});}_0x2c04c3=_['merge']({},_0x2c04c3,_0x3847ff[_0xf7d9('0x3a')]);var _0x410c72={'where':_0x2c04c3[_0xf7d9('0x35')]};return db[_0xf7d9('0x2a')]['count'](_0x410c72)[_0xf7d9('0x24')](function(_0xd6d84f){_0x20315e[_0xf7d9('0x1e')]=_0xd6d84f;if(_0x3847ff[_0xf7d9('0x31')][_0xf7d9('0x3b')]){_0x2c04c3['include']=[{'all':!![]}];}return db[_0xf7d9('0x2a')][_0xf7d9('0x3c')](_0x2c04c3);})[_0xf7d9('0x24')](function(_0x3db665){_0x20315e[_0xf7d9('0x3d')]=_0x3db665;return _0x20315e;})[_0xf7d9('0x24')](respondWithFilteredResult(_0x2b5f17,_0x2c04c3))[_0xf7d9('0x3e')](handleError(_0x2b5f17,null));};exports[_0xf7d9('0x3f')]=function(_0x40d026,_0x3d056f){var _0x2a349b={'raw':!![],'where':{'id':_0x40d026['params']['id']}},_0x46b7d4={};_0x46b7d4[_0xf7d9('0x2c')]=_[_0xf7d9('0x2d')](db['Cdr']['rawAttributes']);_0x46b7d4['query']=_[_0xf7d9('0x2d')](_0x40d026['query']);_0x46b7d4[_0xf7d9('0x36')]=_[_0xf7d9('0x2f')](_0x46b7d4[_0xf7d9('0x2c')],_0x46b7d4[_0xf7d9('0x31')]);_0x2a349b[_0xf7d9('0x2e')]=_['intersection'](_0x46b7d4[_0xf7d9('0x2c')],qs[_0xf7d9('0x30')](_0x40d026[_0xf7d9('0x31')][_0xf7d9('0x30')]));_0x2a349b[_0xf7d9('0x2e')]=_0x2a349b['attributes']['length']?_0x2a349b[_0xf7d9('0x2e')]:_0x46b7d4[_0xf7d9('0x2c')];if(_0x40d026[_0xf7d9('0x31')][_0xf7d9('0x3b')]){_0x2a349b[_0xf7d9('0x40')]=[{'all':!![]}];}_0x2a349b=_['merge']({},_0x2a349b,_0x40d026[_0xf7d9('0x3a')]);return db['Cdr'][_0xf7d9('0x41')](_0x2a349b)[_0xf7d9('0x24')](handleEntityNotFound(_0x3d056f,null))[_0xf7d9('0x24')](respondWithResult(_0x3d056f,null))[_0xf7d9('0x3e')](handleError(_0x3d056f,null));};exports[_0xf7d9('0x42')]=function(_0x1e3a53,_0x4003e9){return db[_0xf7d9('0x2a')][_0xf7d9('0x42')](_0x1e3a53[_0xf7d9('0x43')],{})[_0xf7d9('0x24')](respondWithResult(_0x4003e9,0xc9))[_0xf7d9('0x3e')](handleError(_0x4003e9,null));};exports[_0xf7d9('0x23')]=function(_0x3cdeb5,_0x50731a){if(_0x3cdeb5[_0xf7d9('0x43')]['id']){delete _0x3cdeb5[_0xf7d9('0x43')]['id'];}return db['Cdr']['find']({'where':{'id':_0x3cdeb5[_0xf7d9('0x44')]['id']}})['then'](handleEntityNotFound(_0x50731a,null))['then'](saveUpdates(_0x3cdeb5[_0xf7d9('0x43')],null))[_0xf7d9('0x24')](respondWithResult(_0x50731a,null))[_0xf7d9('0x3e')](handleError(_0x50731a,null));};exports[_0xf7d9('0x45')]=function(_0xf923e0,_0x9c3719){return db[_0xf7d9('0x2a')][_0xf7d9('0x41')]({'where':{'id':_0xf923e0[_0xf7d9('0x44')]['id']}})[_0xf7d9('0x24')](handleEntityNotFound(_0x9c3719,null))[_0xf7d9('0x24')](removeEntity(_0x9c3719,null))[_0xf7d9('0x3e')](handleError(_0x9c3719,null));};exports['describe']=function(_0x48076b,_0x42da01){return db[_0xf7d9('0x2a')][_0xf7d9('0x46')]()[_0xf7d9('0x24')](respondWithResult(_0x42da01,null))['catch'](handleError(_0x42da01,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index e0091c3..4352d74 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(_0x233cdf,_0x55b65f){var _0x4eda47=function(_0x1eee64){while(--_0x1eee64){_0x233cdf['push'](_0x233cdf['shift']());}};_0x4eda47(++_0x55b65f);}(_0x7a54,0x106));var _0x47a5=function(_0x4654dc,_0x44c2bb){_0x4654dc=_0x4654dc-0x0;var _0x104aef=_0x7a54[_0x4654dc];return _0x104aef;};'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(_0x42d952,_0x1fcf78){var _0x32696b=function(_0xde0c8d){while(--_0xde0c8d){_0x42d952['push'](_0x42d952['shift']());}};_0x32696b(++_0x1fcf78);}(_0x7a54,0x106));var _0x47a5=function(_0x2b8641,_0x37e2f0){_0x2b8641=_0x2b8641-0x0;var _0xec2ba6=_0x7a54[_0x2b8641];return _0xec2ba6;};'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 00d8bea..fdaa801 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 _0x8c5f=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x5dbb55,_0x4400f0){var _0x3967b1=function(_0x1ac6aa){while(--_0x1ac6aa){_0x5dbb55['push'](_0x5dbb55['shift']());}};_0x3967b1(++_0x4400f0);}(_0x8c5f,0x176));var _0xf8c5=function(_0x52e29c,_0x515145){_0x52e29c=_0x52e29c-0x0;var _0x5e415c=_0x8c5f[_0x52e29c];return _0x5e415c;};'use strict';var _=require('lodash');var util=require(_0xf8c5('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf8c5('0x1'));var fs=require('fs');var Redis=require(_0xf8c5('0x2'));var db=require(_0xf8c5('0x3'))['db'];var utils=require(_0xf8c5('0x4'));var logger=require(_0xf8c5('0x5'))(_0xf8c5('0x6'));var config=require(_0xf8c5('0x7'));var jayson=require(_0xf8c5('0x8'));var client=jayson[_0xf8c5('0x9')][_0xf8c5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d11fc,_0x37cb6a,_0x313167){return new BPromise(function(_0x55bedf,_0x360b9f){return client[_0xf8c5('0xb')](_0x1d11fc,_0x313167)['then'](function(_0x1c6dcc){logger[_0xf8c5('0xc')](_0xf8c5('0xd'),_0x37cb6a,_0xf8c5('0xe'));logger['debug'](_0xf8c5('0xf'),_0x37cb6a,_0xf8c5('0xe'),JSON[_0xf8c5('0x10')](_0x1c6dcc));if(_0x1c6dcc['error']){if(_0x1c6dcc[_0xf8c5('0x11')][_0xf8c5('0x12')]===0x1f4){logger[_0xf8c5('0x11')](_0xf8c5('0xd'),_0x37cb6a,_0x1c6dcc[_0xf8c5('0x11')][_0xf8c5('0x13')]);return _0x360b9f(_0x1c6dcc[_0xf8c5('0x11')]['message']);}logger[_0xf8c5('0x11')](_0xf8c5('0xd'),_0x37cb6a,_0x1c6dcc[_0xf8c5('0x11')][_0xf8c5('0x13')]);return _0x55bedf(_0x1c6dcc['error'][_0xf8c5('0x13')]);}else{logger[_0xf8c5('0xc')](_0xf8c5('0xd'),_0x37cb6a,_0xf8c5('0xe'));_0x55bedf(_0x1c6dcc[_0xf8c5('0x14')][_0xf8c5('0x13')]);}})[_0xf8c5('0x15')](function(_0x273496){logger[_0xf8c5('0x11')](_0xf8c5('0xd'),_0x37cb6a,_0x273496);_0x360b9f(_0x273496);});});} \ No newline at end of file +var _0x08d9=['then','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x16fdb3,_0xb837ab){var _0x51cf6a=function(_0x2950a2){while(--_0x2950a2){_0x16fdb3['push'](_0x16fdb3['shift']());}};_0x51cf6a(++_0xb837ab);}(_0x08d9,0xb2));var _0x908d=function(_0x5bde0e,_0x425cff){_0x5bde0e=_0x5bde0e-0x0;var _0x2c8e62=_0x08d9[_0x5bde0e];return _0x2c8e62;};'use strict';var _=require(_0x908d('0x0'));var util=require(_0x908d('0x1'));var moment=require(_0x908d('0x2'));var BPromise=require(_0x908d('0x3'));var rs=require(_0x908d('0x4'));var fs=require('fs');var Redis=require(_0x908d('0x5'));var db=require(_0x908d('0x6'))['db'];var utils=require(_0x908d('0x7'));var logger=require(_0x908d('0x8'))(_0x908d('0x9'));var config=require('../../config/environment');var jayson=require(_0x908d('0xa'));var client=jayson[_0x908d('0xb')][_0x908d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x30fe1b,_0x2f4f1b,_0x397846){return new BPromise(function(_0x20def9,_0x1a0802){return client[_0x908d('0xd')](_0x30fe1b,_0x397846)[_0x908d('0xe')](function(_0x68af12){logger[_0x908d('0xf')](_0x908d('0x10'),_0x2f4f1b,'request\x20sent');logger[_0x908d('0x11')](_0x908d('0x12'),_0x2f4f1b,'request\x20sent',JSON['stringify'](_0x68af12));if(_0x68af12[_0x908d('0x13')]){if(_0x68af12[_0x908d('0x13')][_0x908d('0x14')]===0x1f4){logger['error'](_0x908d('0x10'),_0x2f4f1b,_0x68af12['error'][_0x908d('0x15')]);return _0x1a0802(_0x68af12['error']['message']);}logger['error'](_0x908d('0x10'),_0x2f4f1b,_0x68af12[_0x908d('0x13')][_0x908d('0x15')]);return _0x20def9(_0x68af12[_0x908d('0x13')][_0x908d('0x15')]);}else{logger[_0x908d('0xf')](_0x908d('0x10'),_0x2f4f1b,_0x908d('0x16'));_0x20def9(_0x68af12['result'][_0x908d('0x15')]);}})[_0x908d('0x17')](function(_0x4cfb06){logger['error'](_0x908d('0x10'),_0x2f4f1b,_0x4cfb06);_0x1a0802(_0x4cfb06);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 314f581..1fbcdf6 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x3ff80a,_0x26baee){var _0x462cb9=function(_0x477aa7){while(--_0x477aa7){_0x3ff80a['push'](_0x3ff80a['shift']());}};_0x462cb9(++_0x26baee);}(_0xb10b,0x12a));var _0xbb10=function(_0x389a03,_0x380e6c){_0x389a03=_0x389a03-0x0;var _0xaf19ea=_0xb10b[_0x389a03];return _0xaf19ea;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x28c89b,_0x2510b3){var _0x176500=function(_0x3dfee2){while(--_0x3dfee2){_0x28c89b['push'](_0x28c89b['shift']());}};_0x176500(++_0x2510b3);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index deb6998..714f9f5 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 _0x5c84=['noop','TEXT','exports','INTEGER','STRING'];(function(_0x37ea50,_0x1c30e4){var _0x25d492=function(_0x374579){while(--_0x374579){_0x37ea50['push'](_0x37ea50['shift']());}};_0x25d492(++_0x1c30e4);}(_0x5c84,0x11a));var _0x45c8=function(_0x2b248a,_0x29f317){_0x2b248a=_0x2b248a-0x0;var _0x410cf6=_0x5c84[_0x2b248a];return _0x410cf6;};'use strict';var Sequelize=require('sequelize');module[_0x45c8('0x0')]={'priority':{'type':Sequelize[_0x45c8('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x45c8('0x2')],'allowNull':![],'defaultValue':_0x45c8('0x3')},'appdata':{'type':Sequelize[_0x45c8('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x7c28=['TEXT','*,*,*,*','sequelize','STRING','noop'];(function(_0x101802,_0x11f913){var _0x5d61ce=function(_0x4acc0){while(--_0x4acc0){_0x101802['push'](_0x101802['shift']());}};_0x5d61ce(++_0x11f913);}(_0x7c28,0x11a));var _0x87c2=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x7c28[_0x18ab2a];return _0x16dcee;};'use strict';var Sequelize=require(_0x87c2('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x87c2('0x1')],'allowNull':![],'defaultValue':_0x87c2('0x2')},'appdata':{'type':Sequelize[_0x87c2('0x3')]()},'description':{'type':Sequelize[_0x87c2('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x87c2('0x4')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 5c033f0..3d41ade 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 _0x0439=['body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','name','send','params','keys','ChatApplication','rawAttributes','query','intersection','model','attributes','fields','includeAll','include','merge','find','catch'];(function(_0x5c14f6,_0x2979d8){var _0x4949b3=function(_0xcc4206){while(--_0xcc4206){_0x5c14f6['push'](_0x5c14f6['shift']());}};_0x4949b3(++_0x2979d8);}(_0x0439,0xdd));var _0x9043=function(_0x15de6a,_0xb1b042){_0x15de6a=_0x15de6a-0x0;var _0x66bfc0=_0x0439[_0x15de6a];return _0x66bfc0;};'use strict';var emlformat=require(_0x9043('0x0'));var rimraf=require(_0x9043('0x1'));var zipdir=require(_0x9043('0x2'));var jsonpatch=require(_0x9043('0x3'));var rp=require(_0x9043('0x4'));var moment=require(_0x9043('0x5'));var BPromise=require(_0x9043('0x6'));var Mustache=require('mustache');var util=require(_0x9043('0x7'));var path=require(_0x9043('0x8'));var sox=require(_0x9043('0x9'));var csv=require('to-csv');var ejs=require(_0x9043('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9043('0xb'));var crypto=require(_0x9043('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9043('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9043('0xe'));var Papa=require(_0x9043('0xf'));var Redis=require('ioredis');var authService=require(_0x9043('0x10'));var qs=require(_0x9043('0x11'));var as=require(_0x9043('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9043('0x13'));var utils=require(_0x9043('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x9043('0x15'));var db=require(_0x9043('0x16'))['db'];function respondWithStatusCode(_0x3d8d67,_0x2bf58d){_0x2bf58d=_0x2bf58d||0xcc;return function(_0xcd2bf1){if(_0xcd2bf1){return _0x3d8d67[_0x9043('0x17')](_0x2bf58d);}return _0x3d8d67['status'](_0x2bf58d)[_0x9043('0x18')]();};}function respondWithResult(_0xf3f958,_0x48b142){_0x48b142=_0x48b142||0xc8;return function(_0x18f916){if(_0x18f916){return _0xf3f958[_0x9043('0x19')](_0x48b142)['json'](_0x18f916);}};}function respondWithFilteredResult(_0x37eca8,_0x1c2473){return function(_0x3aaee1){if(_0x3aaee1){var _0x2b3c2d=typeof _0x1c2473[_0x9043('0x1a')]===_0x9043('0x1b')&&typeof _0x1c2473[_0x9043('0x1c')]===_0x9043('0x1b');var _0x21f330=_0x3aaee1[_0x9043('0x1d')];var _0x51823a=_0x2b3c2d?0x0:_0x1c2473['offset'];var _0x47fbdc=_0x2b3c2d?_0x3aaee1[_0x9043('0x1d')]:_0x1c2473[_0x9043('0x1a')]+_0x1c2473[_0x9043('0x1c')];var _0x43bbd4;if(_0x47fbdc>=_0x21f330){_0x47fbdc=_0x21f330;_0x43bbd4=0xc8;}else{_0x43bbd4=0xce;}_0x37eca8['status'](_0x43bbd4);return _0x37eca8[_0x9043('0x1e')]('Content-Range',_0x51823a+'-'+_0x47fbdc+'/'+_0x21f330)['json'](_0x3aaee1);}return null;};}function patchUpdates(_0x161511){return function(_0x3572d5){try{jsonpatch[_0x9043('0x1f')](_0x3572d5,_0x161511,!![]);}catch(_0x820f8c){return BPromise[_0x9043('0x20')](_0x820f8c);}return _0x3572d5[_0x9043('0x21')]();};}function saveUpdates(_0x3a82b4,_0x366695){return function(_0x5a3f7a){if(_0x5a3f7a){return _0x5a3f7a[_0x9043('0x22')](_0x3a82b4)[_0x9043('0x23')](function(_0x30930c){return _0x30930c;});}return null;};}function removeEntity(_0x5506bf,_0x18727f){return function(_0x3c4fa4){if(_0x3c4fa4){return _0x3c4fa4[_0x9043('0x24')]()[_0x9043('0x23')](function(){_0x5506bf[_0x9043('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16caf2,_0xca0bb1){return function(_0x6d23af){if(!_0x6d23af){_0x16caf2[_0x9043('0x17')](0x194);}return _0x6d23af;};}function handleError(_0x2003c3,_0x13e8dd){_0x13e8dd=_0x13e8dd||0x1f4;return function(_0x5f4975){logger[_0x9043('0x25')](_0x5f4975['stack']);if(_0x5f4975[_0x9043('0x26')]){delete _0x5f4975[_0x9043('0x26')];}_0x2003c3[_0x9043('0x19')](_0x13e8dd)[_0x9043('0x27')](_0x5f4975);};}exports['show']=function(_0xc92d75,_0x2e12b1){var _0x14cf80={'raw':!![],'where':{'id':_0xc92d75[_0x9043('0x28')]['id']}},_0x228d7f={};_0x228d7f['model']=_[_0x9043('0x29')](db[_0x9043('0x2a')][_0x9043('0x2b')]);_0x228d7f['query']=_[_0x9043('0x29')](_0xc92d75[_0x9043('0x2c')]);_0x228d7f['filters']=_[_0x9043('0x2d')](_0x228d7f[_0x9043('0x2e')],_0x228d7f['query']);_0x14cf80[_0x9043('0x2f')]=_[_0x9043('0x2d')](_0x228d7f[_0x9043('0x2e')],qs[_0x9043('0x30')](_0xc92d75['query'][_0x9043('0x30')]));_0x14cf80[_0x9043('0x2f')]=_0x14cf80['attributes']['length']?_0x14cf80[_0x9043('0x2f')]:_0x228d7f[_0x9043('0x2e')];if(_0xc92d75[_0x9043('0x2c')][_0x9043('0x31')]){_0x14cf80[_0x9043('0x32')]=[{'all':!![]}];}_0x14cf80=_[_0x9043('0x33')]({},_0x14cf80,_0xc92d75['options']);return db['ChatApplication'][_0x9043('0x34')](_0x14cf80)[_0x9043('0x23')](handleEntityNotFound(_0x2e12b1,null))[_0x9043('0x23')](respondWithResult(_0x2e12b1,null))[_0x9043('0x35')](handleError(_0x2e12b1,null));};exports[_0x9043('0x22')]=function(_0x12a037,_0x2e3aeb){if(_0x12a037['body']['id']){delete _0x12a037[_0x9043('0x36')]['id'];}return db['ChatApplication'][_0x9043('0x34')]({'where':{'id':_0x12a037['params']['id']}})[_0x9043('0x23')](handleEntityNotFound(_0x2e3aeb,null))[_0x9043('0x23')](saveUpdates(_0x12a037['body'],null))['then'](respondWithResult(_0x2e3aeb,null))[_0x9043('0x35')](handleError(_0x2e3aeb,null));};exports[_0x9043('0x24')]=function(_0x307bf0,_0x22e07b){return db[_0x9043('0x2a')][_0x9043('0x34')]({'where':{'id':_0x307bf0[_0x9043('0x28')]['id']}})[_0x9043('0x23')](handleEntityNotFound(_0x22e07b,null))[_0x9043('0x23')](removeEntity(_0x22e07b,null))[_0x9043('0x35')](handleError(_0x22e07b,null));}; \ No newline at end of file +var _0xaa1b=['bluebird','mustache','to-csv','ejs','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','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','params','model','ChatApplication','query','keys','attributes','intersection','fields','length','includeAll','include','merge','options','find','body','catch','eml-format','rimraf','zip-dir','request-promise'];(function(_0x3f2635,_0x300424){var _0x55a340=function(_0x33b314){while(--_0x33b314){_0x3f2635['push'](_0x3f2635['shift']());}};_0x55a340(++_0x300424);}(_0xaa1b,0x123));var _0xbaa1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xaa1b[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xbaa1('0x0'));var rimraf=require(_0xbaa1('0x1'));var zipdir=require(_0xbaa1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbaa1('0x3'));var moment=require('moment');var BPromise=require(_0xbaa1('0x4'));var Mustache=require(_0xbaa1('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xbaa1('0x6'));var ejs=require(_0xbaa1('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbaa1('0x8'));var squel=require('squel');var crypto=require(_0xbaa1('0x9'));var jsforce=require(_0xbaa1('0xa'));var deskjs=require(_0xbaa1('0xb'));var toCsv=require(_0xbaa1('0x6'));var querystring=require(_0xbaa1('0xc'));var Papa=require(_0xbaa1('0xd'));var Redis=require('ioredis');var authService=require(_0xbaa1('0xe'));var qs=require(_0xbaa1('0xf'));var as=require(_0xbaa1('0x10'));var hardwareService=require(_0xbaa1('0x11'));var logger=require(_0xbaa1('0x12'))(_0xbaa1('0x13'));var utils=require(_0xbaa1('0x14'));var config=require(_0xbaa1('0x15'));var licenseUtil=require(_0xbaa1('0x16'));var db=require(_0xbaa1('0x17'))['db'];function respondWithStatusCode(_0x8ce72d,_0x1376c6){_0x1376c6=_0x1376c6||0xcc;return function(_0x5064a4){if(_0x5064a4){return _0x8ce72d['sendStatus'](_0x1376c6);}return _0x8ce72d['status'](_0x1376c6)['end']();};}function respondWithResult(_0x2184ab,_0x388cfd){_0x388cfd=_0x388cfd||0xc8;return function(_0x3bfbcc){if(_0x3bfbcc){return _0x2184ab[_0xbaa1('0x18')](_0x388cfd)[_0xbaa1('0x19')](_0x3bfbcc);}};}function respondWithFilteredResult(_0x2e7db5,_0x30f191){return function(_0xdbaa8b){if(_0xdbaa8b){var _0x35a3fd=typeof _0x30f191[_0xbaa1('0x1a')]===_0xbaa1('0x1b')&&typeof _0x30f191[_0xbaa1('0x1c')]===_0xbaa1('0x1b');var _0x16725c=_0xdbaa8b[_0xbaa1('0x1d')];var _0x155a16=_0x35a3fd?0x0:_0x30f191[_0xbaa1('0x1a')];var _0x200f01=_0x35a3fd?_0xdbaa8b[_0xbaa1('0x1d')]:_0x30f191['offset']+_0x30f191[_0xbaa1('0x1c')];var _0x3e3f4a;if(_0x200f01>=_0x16725c){_0x200f01=_0x16725c;_0x3e3f4a=0xc8;}else{_0x3e3f4a=0xce;}_0x2e7db5[_0xbaa1('0x18')](_0x3e3f4a);return _0x2e7db5[_0xbaa1('0x1e')](_0xbaa1('0x1f'),_0x155a16+'-'+_0x200f01+'/'+_0x16725c)[_0xbaa1('0x19')](_0xdbaa8b);}return null;};}function patchUpdates(_0x5c2115){return function(_0x1c587c){try{jsonpatch[_0xbaa1('0x20')](_0x1c587c,_0x5c2115,!![]);}catch(_0x1c38f3){return BPromise[_0xbaa1('0x21')](_0x1c38f3);}return _0x1c587c[_0xbaa1('0x22')]();};}function saveUpdates(_0x5a7d21,_0x4e4a0c){return function(_0x2b01ec){if(_0x2b01ec){return _0x2b01ec[_0xbaa1('0x23')](_0x5a7d21)[_0xbaa1('0x24')](function(_0x34946c){return _0x34946c;});}return null;};}function removeEntity(_0x117079,_0x113bbd){return function(_0x4806e7){if(_0x4806e7){return _0x4806e7[_0xbaa1('0x25')]()[_0xbaa1('0x24')](function(){_0x117079[_0xbaa1('0x18')](0xcc)[_0xbaa1('0x26')]();});}};}function handleEntityNotFound(_0x1204f4,_0x2a56ad){return function(_0x39e3ce){if(!_0x39e3ce){_0x1204f4[_0xbaa1('0x27')](0x194);}return _0x39e3ce;};}function handleError(_0x5f913f,_0x58d85d){_0x58d85d=_0x58d85d||0x1f4;return function(_0x2b80a4){logger[_0xbaa1('0x28')](_0x2b80a4[_0xbaa1('0x29')]);if(_0x2b80a4[_0xbaa1('0x2a')]){delete _0x2b80a4[_0xbaa1('0x2a')];}_0x5f913f[_0xbaa1('0x18')](_0x58d85d)['send'](_0x2b80a4);};}exports['show']=function(_0x18b6d6,_0x1e1869){var _0x270759={'raw':!![],'where':{'id':_0x18b6d6[_0xbaa1('0x2b')]['id']}},_0x48cbc0={};_0x48cbc0[_0xbaa1('0x2c')]=_['keys'](db[_0xbaa1('0x2d')]['rawAttributes']);_0x48cbc0[_0xbaa1('0x2e')]=_[_0xbaa1('0x2f')](_0x18b6d6[_0xbaa1('0x2e')]);_0x48cbc0['filters']=_['intersection'](_0x48cbc0[_0xbaa1('0x2c')],_0x48cbc0[_0xbaa1('0x2e')]);_0x270759[_0xbaa1('0x30')]=_[_0xbaa1('0x31')](_0x48cbc0[_0xbaa1('0x2c')],qs[_0xbaa1('0x32')](_0x18b6d6['query'][_0xbaa1('0x32')]));_0x270759[_0xbaa1('0x30')]=_0x270759[_0xbaa1('0x30')][_0xbaa1('0x33')]?_0x270759['attributes']:_0x48cbc0[_0xbaa1('0x2c')];if(_0x18b6d6['query'][_0xbaa1('0x34')]){_0x270759[_0xbaa1('0x35')]=[{'all':!![]}];}_0x270759=_[_0xbaa1('0x36')]({},_0x270759,_0x18b6d6[_0xbaa1('0x37')]);return db['ChatApplication'][_0xbaa1('0x38')](_0x270759)[_0xbaa1('0x24')](handleEntityNotFound(_0x1e1869,null))[_0xbaa1('0x24')](respondWithResult(_0x1e1869,null))['catch'](handleError(_0x1e1869,null));};exports[_0xbaa1('0x23')]=function(_0x446695,_0x5e093e){if(_0x446695[_0xbaa1('0x39')]['id']){delete _0x446695[_0xbaa1('0x39')]['id'];}return db[_0xbaa1('0x2d')]['find']({'where':{'id':_0x446695[_0xbaa1('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5e093e,null))['then'](saveUpdates(_0x446695[_0xbaa1('0x39')],null))['then'](respondWithResult(_0x5e093e,null))[_0xbaa1('0x3a')](handleError(_0x5e093e,null));};exports[_0xbaa1('0x25')]=function(_0x42804c,_0x4f6a48){return db[_0xbaa1('0x2d')][_0xbaa1('0x38')]({'where':{'id':_0x42804c['params']['id']}})[_0xbaa1('0x24')](handleEntityNotFound(_0x4f6a48,null))[_0xbaa1('0x24')](removeEntity(_0x4f6a48,null))[_0xbaa1('0x3a')](handleError(_0x4f6a48,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 4cceaf1..437a3ce 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 _0xed7a=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4','utf8mb4_unicode_ci'];(function(_0x5362e2,_0x40e8d3){var _0x2bafd2=function(_0x3e0b26){while(--_0x3e0b26){_0x5362e2['push'](_0x5362e2['shift']());}};_0x2bafd2(++_0x40e8d3);}(_0xed7a,0x18c));var _0xaed7=function(_0x33866d,_0x361134){_0x33866d=_0x33866d-0x0;var _0x55c804=_0xed7a[_0x33866d];return _0x55c804;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xaed7('0x0'))('api');var moment=require(_0xaed7('0x1'));var BPromise=require(_0xaed7('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaed7('0x3'));var rimraf=require(_0xaed7('0x4'));var config=require(_0xaed7('0x5'));var attributes=require(_0xaed7('0x6'));module[_0xaed7('0x7')]=function(_0x5f078,_0x3c9008){return _0x5f078[_0xaed7('0x8')](_0xaed7('0x9'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xaed7('0xa'),'collate':_0xaed7('0xb')});}; \ No newline at end of file +var _0xd2ea=['./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0xbbc90c,_0x47572a){var _0x2f4106=function(_0x1848fe){while(--_0x1848fe){_0xbbc90c['push'](_0xbbc90c['shift']());}};_0x2f4106(++_0x47572a);}(_0xd2ea,0x15f));var _0xad2e=function(_0x2fbda7,_0x430470){_0x2fbda7=_0x2fbda7-0x0;var _0x387e9d=_0xd2ea[_0x2fbda7];return _0x387e9d;};'use strict';var _=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var logger=require(_0xad2e('0x2'))(_0xad2e('0x3'));var moment=require(_0xad2e('0x4'));var BPromise=require('bluebird');var rp=require(_0xad2e('0x5'));var fs=require('fs');var path=require(_0xad2e('0x6'));var rimraf=require(_0xad2e('0x7'));var config=require(_0xad2e('0x8'));var attributes=require(_0xad2e('0x9'));module[_0xad2e('0xa')]=function(_0x29e97f,_0x592e8b){return _0x29e97f[_0xad2e('0xb')](_0xad2e('0xc'),attributes,{'tableName':_0xad2e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xad2e('0xe')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 804cbe3..4bca592 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 _0x2381=['ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','request','then','info'];(function(_0x14e9f0,_0x287f90){var _0xa63f7e=function(_0x4829d6){while(--_0x4829d6){_0x14e9f0['push'](_0x14e9f0['shift']());}};_0xa63f7e(++_0x287f90);}(_0x2381,0x1ab));var _0x1238=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x2381[_0x21549c];return _0x426cbd;};'use strict';var _=require(_0x1238('0x0'));var util=require(_0x1238('0x1'));var moment=require(_0x1238('0x2'));var BPromise=require(_0x1238('0x3'));var rs=require(_0x1238('0x4'));var fs=require('fs');var Redis=require(_0x1238('0x5'));var db=require(_0x1238('0x6'))['db'];var utils=require(_0x1238('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x1238('0x8'));var jayson=require(_0x1238('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x404563,_0x68558e,_0x22e828){return new BPromise(function(_0x46c3f4,_0x5e0727){return client[_0x1238('0xa')](_0x404563,_0x22e828)[_0x1238('0xb')](function(_0x514ae0){logger[_0x1238('0xc')]('ChatApplication,\x20%s,\x20%s',_0x68558e,'request\x20sent');logger['debug'](_0x1238('0xd'),_0x68558e,'request\x20sent',JSON[_0x1238('0xe')](_0x514ae0));if(_0x514ae0['error']){if(_0x514ae0[_0x1238('0xf')][_0x1238('0x10')]===0x1f4){logger['error'](_0x1238('0x11'),_0x68558e,_0x514ae0[_0x1238('0xf')][_0x1238('0x12')]);return _0x5e0727(_0x514ae0[_0x1238('0xf')][_0x1238('0x12')]);}logger['error'](_0x1238('0x11'),_0x68558e,_0x514ae0[_0x1238('0xf')][_0x1238('0x12')]);return _0x46c3f4(_0x514ae0[_0x1238('0xf')]['message']);}else{logger[_0x1238('0xc')](_0x1238('0x11'),_0x68558e,_0x1238('0x13'));_0x46c3f4(_0x514ae0[_0x1238('0x14')][_0x1238('0x12')]);}})[_0x1238('0x15')](function(_0x6c2ded){logger[_0x1238('0xf')](_0x1238('0x11'),_0x68558e,_0x6c2ded);_0x5e0727(_0x6c2ded);});});} \ No newline at end of file +var _0x942a=['rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','util','../../mysqldb','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x942a,0x1ca));var _0xa942=function(_0x5a7e3c,_0xdc9219){_0x5a7e3c=_0x5a7e3c-0x0;var _0x59252b=_0x942a[_0x5a7e3c];return _0x59252b;};'use strict';var _=require(_0xa942('0x0'));var util=require(_0xa942('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa942('0x2'))['db'];var utils=require(_0xa942('0x3'));var logger=require('../../config/logger')(_0xa942('0x4'));var config=require(_0xa942('0x5'));var jayson=require(_0xa942('0x6'));var client=jayson[_0xa942('0x7')][_0xa942('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x36ca8b,_0x53955f,_0x48ade5){return new BPromise(function(_0x55bd68,_0x249238){return client[_0xa942('0x9')](_0x36ca8b,_0x48ade5)['then'](function(_0x266b36){logger[_0xa942('0xa')]('ChatApplication,\x20%s,\x20%s',_0x53955f,_0xa942('0xb'));logger[_0xa942('0xc')](_0xa942('0xd'),_0x53955f,_0xa942('0xb'),JSON[_0xa942('0xe')](_0x266b36));if(_0x266b36[_0xa942('0xf')]){if(_0x266b36[_0xa942('0xf')][_0xa942('0x10')]===0x1f4){logger[_0xa942('0xf')](_0xa942('0x11'),_0x53955f,_0x266b36[_0xa942('0xf')][_0xa942('0x12')]);return _0x249238(_0x266b36[_0xa942('0xf')][_0xa942('0x12')]);}logger[_0xa942('0xf')](_0xa942('0x11'),_0x53955f,_0x266b36[_0xa942('0xf')][_0xa942('0x12')]);return _0x55bd68(_0x266b36[_0xa942('0xf')][_0xa942('0x12')]);}else{logger['info'](_0xa942('0x11'),_0x53955f,_0xa942('0xb'));_0x55bd68(_0x266b36[_0xa942('0x13')][_0xa942('0x12')]);}})[_0xa942('0x14')](function(_0x3abe36){logger[_0xa942('0xf')](_0xa942('0x11'),_0x53955f,_0x3abe36);_0x249238(_0x3abe36);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 50f48f6..d8b1d22 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 _0x0943=['delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','get','/:id','show','isAuthenticated','update'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x0943,0x172));var _0x3094=function(_0x2de8a5,_0x54863f){_0x2de8a5=_0x2de8a5-0x0;var _0x1880cd=_0x0943[_0x2de8a5];return _0x1880cd;};'use strict';var multer=require('multer');var util=require(_0x3094('0x0'));var path=require(_0x3094('0x1'));var timeout=require(_0x3094('0x2'));var express=require(_0x3094('0x3'));var router=express[_0x3094('0x4')]();var fs_extra=require(_0x3094('0x5'));var auth=require(_0x3094('0x6'));var interaction=require(_0x3094('0x7'));var config=require('../../config/environment');var controller=require(_0x3094('0x8'));router[_0x3094('0x9')](_0x3094('0xa'),auth['isAuthenticated'](),controller[_0x3094('0xb')]);router['put']('/:id',auth[_0x3094('0xc')](),controller[_0x3094('0xd')]);router[_0x3094('0xe')]('/:id',auth[_0x3094('0xc')](),controller['destroy']);module[_0x3094('0xf')]=router; \ No newline at end of file +var _0x23cc=['util','express','Router','fs-extra','../../components/interaction/service','./chatApplication.controller','put','/:id','isAuthenticated','update','delete','destroy'];(function(_0x137863,_0x25fa28){var _0x3e9639=function(_0x56300a){while(--_0x56300a){_0x137863['push'](_0x137863['shift']());}};_0x3e9639(++_0x25fa28);}(_0x23cc,0x180));var _0xc23c=function(_0x5a2389,_0x376a45){_0x5a2389=_0x5a2389-0x0;var _0xc70f4a=_0x23cc[_0x5a2389];return _0xc70f4a;};'use strict';var multer=require('multer');var util=require(_0xc23c('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc23c('0x1'));var router=express[_0xc23c('0x2')]();var fs_extra=require(_0xc23c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xc23c('0x4'));var config=require('../../config/environment');var controller=require(_0xc23c('0x5'));router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xc23c('0x6')](_0xc23c('0x7'),auth[_0xc23c('0x8')](),controller[_0xc23c('0x9')]);router[_0xc23c('0xa')]('/:id',auth[_0xc23c('0x8')](),controller[_0xc23c('0xb')]);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 4937f72..1f27ea6 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 _0x22ef=['exports','STRING','BOOLEAN'];(function(_0x3031c4,_0x2d5b56){var _0x4ea875=function(_0x2f6bc4){while(--_0x2f6bc4){_0x3031c4['push'](_0x3031c4['shift']());}};_0x4ea875(++_0x2d5b56);}(_0x22ef,0x9c));var _0xf22e=function(_0x568fe1,_0x3ef4d8){_0x568fe1=_0x568fe1-0x0;var _0x587ae2=_0x22ef[_0x568fe1];return _0x587ae2;};'use strict';var Sequelize=require('sequelize');module[_0xf22e('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf22e('0x1')]},'write':{'type':Sequelize[_0xf22e('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x59f2=['STRING'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x59f2,0xb3));var _0x259f=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x59f2[_0xd1d19a];return _0x52a79d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x259f('0x0')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index f4f2843..ae3f73a 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 _0xcfb5=['crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','sendStatus','error','stack','name','ChatGroup','fieldName','type','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','rows','show','rawAttributes','find','catch','create','body','destroy','params','getUnread','addMembers','ids','omit','getMembers','User','nolimit','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','getMessages','findOne','$gte','split','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x116b8e,_0x1da172){var _0x3a884b=function(_0x15a3fe){while(--_0x15a3fe){_0x116b8e['push'](_0x116b8e['shift']());}};_0x3a884b(++_0x1da172);}(_0xcfb5,0x164));var _0x5cfb=function(_0x4165f1,_0xe35e6b){_0x4165f1=_0x4165f1-0x0;var _0xbe88a3=_0xcfb5[_0x4165f1];return _0xbe88a3;};'use strict';var emlformat=require(_0x5cfb('0x0'));var rimraf=require(_0x5cfb('0x1'));var zipdir=require(_0x5cfb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5cfb('0x3'));var moment=require(_0x5cfb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5cfb('0x5'));var util=require(_0x5cfb('0x6'));var path=require(_0x5cfb('0x7'));var sox=require(_0x5cfb('0x8'));var csv=require(_0x5cfb('0x9'));var ejs=require(_0x5cfb('0xa'));var fs=require('fs');var fs_extra=require(_0x5cfb('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5cfb('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5cfb('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5cfb('0xe'));var qs=require(_0x5cfb('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5cfb('0x10'));var logger=require('../../config/logger')(_0x5cfb('0x11'));var utils=require(_0x5cfb('0x12'));var config=require(_0x5cfb('0x13'));var licenseUtil=require(_0x5cfb('0x14'));var db=require(_0x5cfb('0x15'))['db'];config[_0x5cfb('0x16')]=_[_0x5cfb('0x17')](config[_0x5cfb('0x16')],{'host':_0x5cfb('0x18'),'port':0x18eb});var socket=require(_0x5cfb('0x19'))(new Redis(config['redis']));require(_0x5cfb('0x1a'))[_0x5cfb('0x1b')](socket);function respondWithStatusCode(_0x1bc2c6,_0x3a5946){_0x3a5946=_0x3a5946||0xcc;return function(_0x2708a0){if(_0x2708a0){return _0x1bc2c6['sendStatus'](_0x3a5946);}return _0x1bc2c6[_0x5cfb('0x1c')](_0x3a5946)[_0x5cfb('0x1d')]();};}function respondWithResult(_0x5213fa,_0x16d903){_0x16d903=_0x16d903||0xc8;return function(_0x63f8c5){if(_0x63f8c5){return _0x5213fa['status'](_0x16d903)[_0x5cfb('0x1e')](_0x63f8c5);}};}function respondWithFilteredResult(_0x932b86,_0x5106fa){return function(_0x54dd98){if(_0x54dd98){var _0x11217a=typeof _0x5106fa[_0x5cfb('0x1f')]===_0x5cfb('0x20')&&typeof _0x5106fa[_0x5cfb('0x21')]==='undefined';var _0x536a7a=_0x54dd98[_0x5cfb('0x22')];var _0x3246bf=_0x11217a?0x0:_0x5106fa['offset'];var _0x3bea4f=_0x11217a?_0x54dd98[_0x5cfb('0x22')]:_0x5106fa['offset']+_0x5106fa['limit'];var _0x506872;if(_0x3bea4f>=_0x536a7a){_0x3bea4f=_0x536a7a;_0x506872=0xc8;}else{_0x506872=0xce;}_0x932b86[_0x5cfb('0x1c')](_0x506872);return _0x932b86[_0x5cfb('0x23')]('Content-Range',_0x3246bf+'-'+_0x3bea4f+'/'+_0x536a7a)[_0x5cfb('0x1e')](_0x54dd98);}return null;};}function patchUpdates(_0x15b499){return function(_0x52aff6){try{jsonpatch[_0x5cfb('0x24')](_0x52aff6,_0x15b499,!![]);}catch(_0x53cd40){return BPromise[_0x5cfb('0x25')](_0x53cd40);}return _0x52aff6[_0x5cfb('0x26')]();};}function saveUpdates(_0x1bc92d,_0x502147){return function(_0x2379eb){if(_0x2379eb){return _0x2379eb[_0x5cfb('0x27')](_0x1bc92d)[_0x5cfb('0x28')](function(_0x327495){return _0x327495;});}return null;};}function removeEntity(_0x35a842,_0x5c65a9){return function(_0x1e3cbb){if(_0x1e3cbb){return _0x1e3cbb['destroy']()[_0x5cfb('0x28')](function(){_0x35a842[_0x5cfb('0x1c')](0xcc)[_0x5cfb('0x1d')]();});}};}function handleEntityNotFound(_0xfc436e,_0x3603a4){return function(_0x20c8c7){if(!_0x20c8c7){_0xfc436e[_0x5cfb('0x29')](0x194);}return _0x20c8c7;};}function handleError(_0xb7903c,_0x49a3aa){_0x49a3aa=_0x49a3aa||0x1f4;return function(_0x163932){logger[_0x5cfb('0x2a')](_0x163932[_0x5cfb('0x2b')]);if(_0x163932[_0x5cfb('0x2c')]){delete _0x163932['name'];}_0xb7903c[_0x5cfb('0x1c')](_0x49a3aa)['send'](_0x163932);};}exports['index']=function(_0x51be3f,_0x5b48f9){var _0x222c1d={},_0x307008={},_0x4d7030={'count':0x0,'rows':[]};var _0x472f24=_['map'](db[_0x5cfb('0x2d')]['rawAttributes'],function(_0x5c78a3){return{'name':_0x5c78a3[_0x5cfb('0x2e')],'type':_0x5c78a3[_0x5cfb('0x2f')]['key']};});_0x307008[_0x5cfb('0x30')]=_[_0x5cfb('0x31')](_0x472f24,'name');_0x307008['query']=_[_0x5cfb('0x32')](_0x51be3f['query']);_0x307008[_0x5cfb('0x33')]=_[_0x5cfb('0x34')](_0x307008[_0x5cfb('0x30')],_0x307008[_0x5cfb('0x35')]);_0x222c1d[_0x5cfb('0x36')]=_['intersection'](_0x307008[_0x5cfb('0x30')],qs['fields'](_0x51be3f['query'][_0x5cfb('0x37')]));_0x222c1d['attributes']=_0x222c1d[_0x5cfb('0x36')][_0x5cfb('0x38')]?_0x222c1d[_0x5cfb('0x36')]:_0x307008[_0x5cfb('0x30')];if(!_0x51be3f[_0x5cfb('0x35')][_0x5cfb('0x39')]('nolimit')){_0x222c1d[_0x5cfb('0x21')]=qs[_0x5cfb('0x21')](_0x51be3f[_0x5cfb('0x35')][_0x5cfb('0x21')]);_0x222c1d['offset']=qs[_0x5cfb('0x1f')](_0x51be3f[_0x5cfb('0x35')]['offset']);}_0x222c1d[_0x5cfb('0x3a')]=qs[_0x5cfb('0x3b')](_0x51be3f[_0x5cfb('0x35')][_0x5cfb('0x3b')]);_0x222c1d[_0x5cfb('0x3c')]=qs[_0x5cfb('0x33')](_[_0x5cfb('0x3d')](_0x51be3f[_0x5cfb('0x35')],_0x307008[_0x5cfb('0x33')]),_0x472f24);if(_0x51be3f[_0x5cfb('0x35')][_0x5cfb('0x3e')]){_0x222c1d['where']=_[_0x5cfb('0x3f')](_0x222c1d[_0x5cfb('0x3c')],{'$or':_[_0x5cfb('0x31')](_0x472f24,function(_0x17c216){if(_0x17c216[_0x5cfb('0x2f')]!=='VIRTUAL'){var _0x5ba11d={};_0x5ba11d[_0x17c216[_0x5cfb('0x2c')]]={'$like':'%'+_0x51be3f[_0x5cfb('0x35')][_0x5cfb('0x3e')]+'%'};return _0x5ba11d;}})});}_0x222c1d=_[_0x5cfb('0x3f')]({},_0x222c1d,_0x51be3f[_0x5cfb('0x40')]);var _0xf0a075={'where':_0x222c1d[_0x5cfb('0x3c')]};return db[_0x5cfb('0x2d')][_0x5cfb('0x22')](_0xf0a075)[_0x5cfb('0x28')](function(_0x101d7f){_0x4d7030[_0x5cfb('0x22')]=_0x101d7f;if(_0x51be3f['query'][_0x5cfb('0x41')]){_0x222c1d[_0x5cfb('0x42')]=[{'all':!![]}];}return db[_0x5cfb('0x2d')]['findAll'](_0x222c1d);})[_0x5cfb('0x28')](function(_0x285d56){_0x4d7030[_0x5cfb('0x43')]=_0x285d56;return _0x4d7030;})[_0x5cfb('0x28')](respondWithFilteredResult(_0x5b48f9,_0x222c1d))['catch'](handleError(_0x5b48f9,null));};exports[_0x5cfb('0x44')]=function(_0x4b7e67,_0x2b44e0){var _0x3ab722={'raw':!![],'where':{'id':_0x4b7e67['params']['id']}},_0x3b8ef7={};_0x3b8ef7[_0x5cfb('0x30')]=_[_0x5cfb('0x32')](db[_0x5cfb('0x2d')][_0x5cfb('0x45')]);_0x3b8ef7[_0x5cfb('0x35')]=_[_0x5cfb('0x32')](_0x4b7e67[_0x5cfb('0x35')]);_0x3b8ef7['filters']=_[_0x5cfb('0x34')](_0x3b8ef7[_0x5cfb('0x30')],_0x3b8ef7[_0x5cfb('0x35')]);_0x3ab722[_0x5cfb('0x36')]=_[_0x5cfb('0x34')](_0x3b8ef7[_0x5cfb('0x30')],qs['fields'](_0x4b7e67[_0x5cfb('0x35')][_0x5cfb('0x37')]));_0x3ab722[_0x5cfb('0x36')]=_0x3ab722['attributes']['length']?_0x3ab722[_0x5cfb('0x36')]:_0x3b8ef7[_0x5cfb('0x30')];if(_0x4b7e67[_0x5cfb('0x35')][_0x5cfb('0x41')]){_0x3ab722['include']=[{'all':!![]}];}_0x3ab722=_[_0x5cfb('0x3f')]({},_0x3ab722,_0x4b7e67[_0x5cfb('0x40')]);return db['ChatGroup'][_0x5cfb('0x46')](_0x3ab722)[_0x5cfb('0x28')](handleEntityNotFound(_0x2b44e0,null))[_0x5cfb('0x28')](respondWithResult(_0x2b44e0,null))[_0x5cfb('0x47')](handleError(_0x2b44e0,null));};exports['create']=function(_0xbf4ef1,_0x814ac6){return db['ChatGroup'][_0x5cfb('0x48')](_0xbf4ef1['body'],{})[_0x5cfb('0x28')](respondWithResult(_0x814ac6,0xc9))['catch'](handleError(_0x814ac6,null));};exports[_0x5cfb('0x27')]=function(_0x2b5d3a,_0x3fe404){if(_0x2b5d3a[_0x5cfb('0x49')]['id']){delete _0x2b5d3a[_0x5cfb('0x49')]['id'];}return db['ChatGroup'][_0x5cfb('0x46')]({'where':{'id':_0x2b5d3a['params']['id']}})[_0x5cfb('0x28')](handleEntityNotFound(_0x3fe404,null))[_0x5cfb('0x28')](saveUpdates(_0x2b5d3a[_0x5cfb('0x49')],null))[_0x5cfb('0x28')](respondWithResult(_0x3fe404,null))[_0x5cfb('0x47')](handleError(_0x3fe404,null));};exports[_0x5cfb('0x4a')]=function(_0x2ef252,_0x45ce38){return db[_0x5cfb('0x2d')][_0x5cfb('0x46')]({'where':{'id':_0x2ef252[_0x5cfb('0x4b')]['id']}})['then'](handleEntityNotFound(_0x45ce38,null))[_0x5cfb('0x28')](removeEntity(_0x45ce38,null))[_0x5cfb('0x47')](handleError(_0x45ce38,null));};exports['describe']=function(_0x35c625,_0x25fda9){return db[_0x5cfb('0x2d')]['describe']()[_0x5cfb('0x28')](respondWithResult(_0x25fda9,null))['catch'](handleError(_0x25fda9,null));};exports[_0x5cfb('0x4c')]=function(_0x30969c,_0x30fcd0,_0xde1578){return db['ChatInternalMessage'][_0x5cfb('0x22')]({'where':{'ChatGroupId':_0x30969c['params']['id'],'ToId':_0x30969c['user']['id'],'read':![]}})['then'](function(_0x3ac972){return{'id':_['toInteger'](_0x30969c['params']['id']),'count':_0x3ac972};})[_0x5cfb('0x28')](respondWithResult(_0x30fcd0,null))[_0x5cfb('0x47')](handleError(_0x30fcd0,null));};exports[_0x5cfb('0x4d')]=function(_0x7a42d1,_0x4e5c21,_0x4c35f1){return db[_0x5cfb('0x2d')]['find']({'where':{'id':_0x7a42d1[_0x5cfb('0x4b')]['id']}})[_0x5cfb('0x28')](handleEntityNotFound(_0x4e5c21,null))[_0x5cfb('0x28')](function(_0x3b6d82){if(_0x3b6d82){return _0x3b6d82['addMembers'](_0x7a42d1['body'][_0x5cfb('0x4e')],_[_0x5cfb('0x4f')](_0x7a42d1['body'],[_0x5cfb('0x4e'),'id'])||{});}})[_0x5cfb('0x28')](respondWithResult(_0x4e5c21,null))[_0x5cfb('0x47')](handleError(_0x4e5c21,null));};exports[_0x5cfb('0x50')]=function(_0x36556f,_0x1100bc,_0x4ab85a){var _0x2642c6={};var _0x468ad8={};var _0x36899f;var _0x2972c9;return db[_0x5cfb('0x2d')]['findOne']({'where':{'id':_0x36556f[_0x5cfb('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1100bc,null))[_0x5cfb('0x28')](function(_0x3e0e76){if(_0x3e0e76){_0x36899f=_0x3e0e76;_0x468ad8[_0x5cfb('0x30')]=_['keys'](db[_0x5cfb('0x51')][_0x5cfb('0x45')]);_0x468ad8[_0x5cfb('0x35')]=_[_0x5cfb('0x32')](_0x36556f[_0x5cfb('0x35')]);_0x468ad8['filters']=_[_0x5cfb('0x34')](_0x468ad8['model'],_0x468ad8[_0x5cfb('0x35')]);_0x2642c6[_0x5cfb('0x36')]=_[_0x5cfb('0x34')](_0x468ad8[_0x5cfb('0x30')],qs[_0x5cfb('0x37')](_0x36556f[_0x5cfb('0x35')]['fields']));_0x2642c6['attributes']=_0x2642c6[_0x5cfb('0x36')]['length']?_0x2642c6[_0x5cfb('0x36')]:_0x468ad8['model'];_0x2642c6[_0x5cfb('0x3a')]=qs['sort'](_0x36556f[_0x5cfb('0x35')]['sort']);_0x2642c6[_0x5cfb('0x3c')]=qs[_0x5cfb('0x33')](_[_0x5cfb('0x3d')](_0x36556f[_0x5cfb('0x35')],_0x468ad8[_0x5cfb('0x33')]));if(_0x36556f['query'][_0x5cfb('0x3e')]){_0x2642c6[_0x5cfb('0x3c')]=_['merge'](_0x2642c6[_0x5cfb('0x3c')],{'$or':_[_0x5cfb('0x31')](_0x2642c6[_0x5cfb('0x36')],function(_0x5ef210){var _0x2519af={};_0x2519af[_0x5ef210]={'$like':'%'+_0x36556f[_0x5cfb('0x35')][_0x5cfb('0x3e')]+'%'};return _0x2519af;})});}_0x2642c6=_[_0x5cfb('0x3f')]({},_0x2642c6,_0x36556f['options']);return _0x36899f[_0x5cfb('0x50')](_0x2642c6);}})[_0x5cfb('0x28')](function(_0x149192){if(_0x149192){_0x2972c9=_0x149192[_0x5cfb('0x38')];if(!_0x36556f['query'][_0x5cfb('0x39')](_0x5cfb('0x52'))){_0x2642c6[_0x5cfb('0x21')]=qs['limit'](_0x36556f[_0x5cfb('0x35')][_0x5cfb('0x21')]);_0x2642c6[_0x5cfb('0x1f')]=qs['offset'](_0x36556f[_0x5cfb('0x35')][_0x5cfb('0x1f')]);}return _0x36899f['getMembers'](_0x2642c6);}})[_0x5cfb('0x28')](function(_0x114e44){if(_0x114e44){return _0x114e44?{'count':_0x2972c9,'rows':_0x114e44}:null;}})[_0x5cfb('0x28')](respondWithResult(_0x1100bc,null))[_0x5cfb('0x47')](handleError(_0x1100bc,null));};exports['removeMembers']=function(_0x194a6d,_0x3f643c,_0x2199ec){return db[_0x5cfb('0x2d')][_0x5cfb('0x46')]({'where':{'id':_0x194a6d[_0x5cfb('0x4b')]['id']}})[_0x5cfb('0x28')](handleEntityNotFound(_0x3f643c,null))[_0x5cfb('0x28')](function(_0xdf2248){if(_0xdf2248){return _0xdf2248[_0x5cfb('0x53')](_0x194a6d[_0x5cfb('0x35')][_0x5cfb('0x4e')]);}})[_0x5cfb('0x28')](respondWithStatusCode(_0x3f643c,null))[_0x5cfb('0x47')](handleError(_0x3f643c,null));};exports[_0x5cfb('0x54')]=function(_0x17cf90,_0x79ae9e,_0x27b144){if(_0x17cf90[_0x5cfb('0x49')]['id']){delete _0x17cf90[_0x5cfb('0x49')]['id'];}return db['ChatGroup'][_0x5cfb('0x46')]({'where':{'id':_0x17cf90[_0x5cfb('0x4b')]['id']}})[_0x5cfb('0x28')](handleEntityNotFound(_0x79ae9e,null))[_0x5cfb('0x28')](function(_0x280b32){if(_0x280b32){_0x17cf90[_0x5cfb('0x49')][_0x5cfb('0x55')]=_0x280b32['id'];return db[_0x5cfb('0x56')][_0x5cfb('0x48')](_0x17cf90[_0x5cfb('0x49')]);}})['then'](respondWithResult(_0x79ae9e,null))['catch'](handleError(_0x79ae9e,null));};exports[_0x5cfb('0x57')]=function(_0x24457e,_0x5431ed,_0x3f9342){var _0x55d682={};var _0x33ecdb={};var _0x79c8d3;var _0x865190;return db[_0x5cfb('0x2d')][_0x5cfb('0x58')]({'where':{'id':_0x24457e[_0x5cfb('0x4b')]['id']}})[_0x5cfb('0x28')](handleEntityNotFound(_0x5431ed,null))[_0x5cfb('0x28')](function(_0xf4005){if(_0xf4005){_0x79c8d3=_0xf4005;_0x33ecdb['model']=_['keys'](db[_0x5cfb('0x56')][_0x5cfb('0x45')]);_0x33ecdb[_0x5cfb('0x35')]=_[_0x5cfb('0x32')](_0x24457e[_0x5cfb('0x35')]);_0x33ecdb['filters']=_[_0x5cfb('0x34')](_0x33ecdb[_0x5cfb('0x30')],_0x33ecdb[_0x5cfb('0x35')]);_0x55d682[_0x5cfb('0x36')]=_[_0x5cfb('0x34')](_0x33ecdb[_0x5cfb('0x30')],qs[_0x5cfb('0x37')](_0x24457e['query']['fields']));_0x55d682['attributes']=_0x55d682[_0x5cfb('0x36')][_0x5cfb('0x38')]?_0x55d682[_0x5cfb('0x36')]:_0x33ecdb[_0x5cfb('0x30')];_0x55d682[_0x5cfb('0x3a')]=qs[_0x5cfb('0x3b')](_0x24457e[_0x5cfb('0x35')][_0x5cfb('0x3b')]);_0x55d682[_0x5cfb('0x3c')]=qs[_0x5cfb('0x33')](_['pick'](_0x24457e[_0x5cfb('0x35')],_0x33ecdb['filters']));if(_0x24457e[_0x5cfb('0x35')][_0x5cfb('0x3e')]){_0x55d682['where']=_['merge'](_0x55d682[_0x5cfb('0x3c')],{'$or':_['map'](_0x55d682[_0x5cfb('0x36')],function(_0x2073e6){var _0x23c61e={};_0x23c61e[_0x2073e6]={'$like':'%'+_0x24457e[_0x5cfb('0x35')]['filter']+'%'};return _0x23c61e;})});}if(_0x24457e['query'][_0x5cfb('0x59')]){var _0x1f6f01=_0x24457e[_0x5cfb('0x35')][_0x5cfb('0x59')][_0x5cfb('0x5a')](',');var _0x476d8b={};_0x476d8b[_0x1f6f01[0x0]]={'$gte':moment(_0x1f6f01[0x1])['format'](_0x5cfb('0x5b'))};_0x55d682['where']=_[_0x5cfb('0x3f')](_0x55d682[_0x5cfb('0x3c')],_0x476d8b);}_0x55d682=_['merge']({},_0x55d682,_0x24457e[_0x5cfb('0x40')]);return _0x79c8d3[_0x5cfb('0x57')](_0x55d682);}})[_0x5cfb('0x28')](function(_0x36899b){if(_0x36899b){_0x865190=_0x36899b[_0x5cfb('0x38')];if(!_0x24457e['query'][_0x5cfb('0x39')](_0x5cfb('0x52'))){_0x55d682[_0x5cfb('0x21')]=qs[_0x5cfb('0x21')](_0x24457e[_0x5cfb('0x35')][_0x5cfb('0x21')]);_0x55d682[_0x5cfb('0x1f')]=qs[_0x5cfb('0x1f')](_0x24457e['query'][_0x5cfb('0x1f')]);}return _0x79c8d3['getMessages'](_0x55d682);}})['then'](function(_0x589d18){if(_0x589d18){return _0x589d18?{'count':_0x865190,'rows':_0x589d18}:null;}})[_0x5cfb('0x28')](respondWithResult(_0x5431ed,null))['catch'](handleError(_0x5431ed,null));}; \ No newline at end of file +var _0xa186=['rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','ChatGroup','includeAll','include','findAll','show','params','options','catch','create','body','find','describe','ChatInternalMessage','user','addMembers','ids','omit','getMembers','findOne','User','fields','removeMembers','ChatGroupId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','./chatGroup.socket','register','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index'];(function(_0x38b1fe,_0x53aedb){var _0x1b3f86=function(_0x2d4112){while(--_0x2d4112){_0x38b1fe['push'](_0x38b1fe['shift']());}};_0x1b3f86(++_0x53aedb);}(_0xa186,0xf1));var _0x6a18=function(_0x4bbe48,_0x56a57a){_0x4bbe48=_0x4bbe48-0x0;var _0x279b5a=_0xa186[_0x4bbe48];return _0x279b5a;};'use strict';var emlformat=require(_0x6a18('0x0'));var rimraf=require(_0x6a18('0x1'));var zipdir=require(_0x6a18('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6a18('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6a18('0x4'));var util=require(_0x6a18('0x5'));var path=require(_0x6a18('0x6'));var sox=require(_0x6a18('0x7'));var csv=require(_0x6a18('0x8'));var ejs=require(_0x6a18('0x9'));var fs=require('fs');var fs_extra=require(_0x6a18('0xa'));var _=require(_0x6a18('0xb'));var squel=require(_0x6a18('0xc'));var crypto=require(_0x6a18('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6a18('0xe'));var toCsv=require(_0x6a18('0x8'));var querystring=require(_0x6a18('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6a18('0x10'));var qs=require(_0x6a18('0x11'));var as=require(_0x6a18('0x12'));var hardwareService=require(_0x6a18('0x13'));var logger=require(_0x6a18('0x14'))(_0x6a18('0x15'));var utils=require(_0x6a18('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6a18('0x17'))['db'];config[_0x6a18('0x18')]=_[_0x6a18('0x19')](config['redis'],{'host':_0x6a18('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6a18('0x1b'))[_0x6a18('0x1c')](socket);function respondWithStatusCode(_0x479814,_0x32a94b){_0x32a94b=_0x32a94b||0xcc;return function(_0x1de975){if(_0x1de975){return _0x479814[_0x6a18('0x1d')](_0x32a94b);}return _0x479814[_0x6a18('0x1e')](_0x32a94b)[_0x6a18('0x1f')]();};}function respondWithResult(_0x6e570e,_0x540996){_0x540996=_0x540996||0xc8;return function(_0xdd9b40){if(_0xdd9b40){return _0x6e570e['status'](_0x540996)[_0x6a18('0x20')](_0xdd9b40);}};}function respondWithFilteredResult(_0x50207e,_0x593a67){return function(_0x4c4cba){if(_0x4c4cba){var _0x296068=typeof _0x593a67[_0x6a18('0x21')]==='undefined'&&typeof _0x593a67[_0x6a18('0x22')]==='undefined';var _0x2feb5c=_0x4c4cba[_0x6a18('0x23')];var _0x3c3ab1=_0x296068?0x0:_0x593a67['offset'];var _0xfacf04=_0x296068?_0x4c4cba[_0x6a18('0x23')]:_0x593a67[_0x6a18('0x21')]+_0x593a67[_0x6a18('0x22')];var _0x5766ec;if(_0xfacf04>=_0x2feb5c){_0xfacf04=_0x2feb5c;_0x5766ec=0xc8;}else{_0x5766ec=0xce;}_0x50207e[_0x6a18('0x1e')](_0x5766ec);return _0x50207e['set'](_0x6a18('0x24'),_0x3c3ab1+'-'+_0xfacf04+'/'+_0x2feb5c)[_0x6a18('0x20')](_0x4c4cba);}return null;};}function patchUpdates(_0x4e8316){return function(_0xdd33ac){try{jsonpatch[_0x6a18('0x25')](_0xdd33ac,_0x4e8316,!![]);}catch(_0x528c46){return BPromise[_0x6a18('0x26')](_0x528c46);}return _0xdd33ac[_0x6a18('0x27')]();};}function saveUpdates(_0x43286f,_0x419f99){return function(_0x4a9e7a){if(_0x4a9e7a){return _0x4a9e7a[_0x6a18('0x28')](_0x43286f)[_0x6a18('0x29')](function(_0x4240fd){return _0x4240fd;});}return null;};}function removeEntity(_0x31042b,_0x443fdd){return function(_0x11db7c){if(_0x11db7c){return _0x11db7c[_0x6a18('0x2a')]()[_0x6a18('0x29')](function(){_0x31042b[_0x6a18('0x1e')](0xcc)[_0x6a18('0x1f')]();});}};}function handleEntityNotFound(_0x5dfad3,_0x464637){return function(_0x58b31b){if(!_0x58b31b){_0x5dfad3['sendStatus'](0x194);}return _0x58b31b;};}function handleError(_0x15a4aa,_0x194ab8){_0x194ab8=_0x194ab8||0x1f4;return function(_0x1fd0eb){logger['error'](_0x1fd0eb[_0x6a18('0x2b')]);if(_0x1fd0eb[_0x6a18('0x2c')]){delete _0x1fd0eb[_0x6a18('0x2c')];}_0x15a4aa[_0x6a18('0x1e')](_0x194ab8)[_0x6a18('0x2d')](_0x1fd0eb);};}exports[_0x6a18('0x2e')]=function(_0x560482,_0x1701bd){var _0x48a1d7={},_0x8b20f8={},_0x22c1fc={'count':0x0,'rows':[]};var _0x4f703b=_['map'](db['ChatGroup'][_0x6a18('0x2f')],function(_0x8bb678){return{'name':_0x8bb678[_0x6a18('0x30')],'type':_0x8bb678[_0x6a18('0x31')][_0x6a18('0x32')]};});_0x8b20f8[_0x6a18('0x33')]=_[_0x6a18('0x34')](_0x4f703b,_0x6a18('0x2c'));_0x8b20f8[_0x6a18('0x35')]=_[_0x6a18('0x36')](_0x560482[_0x6a18('0x35')]);_0x8b20f8['filters']=_[_0x6a18('0x37')](_0x8b20f8[_0x6a18('0x33')],_0x8b20f8[_0x6a18('0x35')]);_0x48a1d7[_0x6a18('0x38')]=_[_0x6a18('0x37')](_0x8b20f8[_0x6a18('0x33')],qs['fields'](_0x560482[_0x6a18('0x35')]['fields']));_0x48a1d7[_0x6a18('0x38')]=_0x48a1d7[_0x6a18('0x38')][_0x6a18('0x39')]?_0x48a1d7[_0x6a18('0x38')]:_0x8b20f8['model'];if(!_0x560482[_0x6a18('0x35')][_0x6a18('0x3a')](_0x6a18('0x3b'))){_0x48a1d7[_0x6a18('0x22')]=qs[_0x6a18('0x22')](_0x560482['query'][_0x6a18('0x22')]);_0x48a1d7[_0x6a18('0x21')]=qs['offset'](_0x560482[_0x6a18('0x35')]['offset']);}_0x48a1d7[_0x6a18('0x3c')]=qs[_0x6a18('0x3d')](_0x560482[_0x6a18('0x35')][_0x6a18('0x3d')]);_0x48a1d7[_0x6a18('0x3e')]=qs[_0x6a18('0x3f')](_[_0x6a18('0x40')](_0x560482['query'],_0x8b20f8['filters']),_0x4f703b);if(_0x560482['query'][_0x6a18('0x41')]){_0x48a1d7[_0x6a18('0x3e')]=_[_0x6a18('0x42')](_0x48a1d7[_0x6a18('0x3e')],{'$or':_['map'](_0x4f703b,function(_0x4f1d43){if(_0x4f1d43['type']!==_0x6a18('0x43')){var _0x172459={};_0x172459[_0x4f1d43[_0x6a18('0x2c')]]={'$like':'%'+_0x560482['query'][_0x6a18('0x41')]+'%'};return _0x172459;}})});}_0x48a1d7=_['merge']({},_0x48a1d7,_0x560482['options']);var _0x141b8a={'where':_0x48a1d7[_0x6a18('0x3e')]};return db[_0x6a18('0x44')]['count'](_0x141b8a)[_0x6a18('0x29')](function(_0x592688){_0x22c1fc['count']=_0x592688;if(_0x560482[_0x6a18('0x35')][_0x6a18('0x45')]){_0x48a1d7[_0x6a18('0x46')]=[{'all':!![]}];}return db[_0x6a18('0x44')][_0x6a18('0x47')](_0x48a1d7);})['then'](function(_0x152f5c){_0x22c1fc['rows']=_0x152f5c;return _0x22c1fc;})[_0x6a18('0x29')](respondWithFilteredResult(_0x1701bd,_0x48a1d7))['catch'](handleError(_0x1701bd,null));};exports[_0x6a18('0x48')]=function(_0x5a7382,_0xfa001f){var _0x506a06={'raw':!![],'where':{'id':_0x5a7382[_0x6a18('0x49')]['id']}},_0x389c10={};_0x389c10['model']=_[_0x6a18('0x36')](db[_0x6a18('0x44')][_0x6a18('0x2f')]);_0x389c10[_0x6a18('0x35')]=_['keys'](_0x5a7382[_0x6a18('0x35')]);_0x389c10[_0x6a18('0x3f')]=_['intersection'](_0x389c10['model'],_0x389c10[_0x6a18('0x35')]);_0x506a06[_0x6a18('0x38')]=_[_0x6a18('0x37')](_0x389c10[_0x6a18('0x33')],qs['fields'](_0x5a7382['query']['fields']));_0x506a06[_0x6a18('0x38')]=_0x506a06[_0x6a18('0x38')][_0x6a18('0x39')]?_0x506a06[_0x6a18('0x38')]:_0x389c10[_0x6a18('0x33')];if(_0x5a7382[_0x6a18('0x35')]['includeAll']){_0x506a06[_0x6a18('0x46')]=[{'all':!![]}];}_0x506a06=_[_0x6a18('0x42')]({},_0x506a06,_0x5a7382[_0x6a18('0x4a')]);return db[_0x6a18('0x44')]['find'](_0x506a06)[_0x6a18('0x29')](handleEntityNotFound(_0xfa001f,null))[_0x6a18('0x29')](respondWithResult(_0xfa001f,null))[_0x6a18('0x4b')](handleError(_0xfa001f,null));};exports[_0x6a18('0x4c')]=function(_0x19082a,_0x1efa7a){return db[_0x6a18('0x44')][_0x6a18('0x4c')](_0x19082a[_0x6a18('0x4d')],{})['then'](respondWithResult(_0x1efa7a,0xc9))['catch'](handleError(_0x1efa7a,null));};exports['update']=function(_0x5aead9,_0xc3c5f3){if(_0x5aead9[_0x6a18('0x4d')]['id']){delete _0x5aead9[_0x6a18('0x4d')]['id'];}return db[_0x6a18('0x44')]['find']({'where':{'id':_0x5aead9[_0x6a18('0x49')]['id']}})['then'](handleEntityNotFound(_0xc3c5f3,null))[_0x6a18('0x29')](saveUpdates(_0x5aead9[_0x6a18('0x4d')],null))[_0x6a18('0x29')](respondWithResult(_0xc3c5f3,null))['catch'](handleError(_0xc3c5f3,null));};exports[_0x6a18('0x2a')]=function(_0xe18c8a,_0x735183){return db['ChatGroup'][_0x6a18('0x4e')]({'where':{'id':_0xe18c8a[_0x6a18('0x49')]['id']}})[_0x6a18('0x29')](handleEntityNotFound(_0x735183,null))[_0x6a18('0x29')](removeEntity(_0x735183,null))[_0x6a18('0x4b')](handleError(_0x735183,null));};exports[_0x6a18('0x4f')]=function(_0x3021f1,_0x29112e){return db[_0x6a18('0x44')][_0x6a18('0x4f')]()[_0x6a18('0x29')](respondWithResult(_0x29112e,null))[_0x6a18('0x4b')](handleError(_0x29112e,null));};exports['getUnread']=function(_0x2e0dae,_0x38c26c,_0x5a7b70){return db[_0x6a18('0x50')]['count']({'where':{'ChatGroupId':_0x2e0dae[_0x6a18('0x49')]['id'],'ToId':_0x2e0dae[_0x6a18('0x51')]['id'],'read':![]}})[_0x6a18('0x29')](function(_0x36755f){return{'id':_['toInteger'](_0x2e0dae['params']['id']),'count':_0x36755f};})[_0x6a18('0x29')](respondWithResult(_0x38c26c,null))[_0x6a18('0x4b')](handleError(_0x38c26c,null));};exports[_0x6a18('0x52')]=function(_0xb29ad9,_0x53c2fd,_0x33f572){return db[_0x6a18('0x44')]['find']({'where':{'id':_0xb29ad9[_0x6a18('0x49')]['id']}})[_0x6a18('0x29')](handleEntityNotFound(_0x53c2fd,null))[_0x6a18('0x29')](function(_0x4d5bc3){if(_0x4d5bc3){return _0x4d5bc3[_0x6a18('0x52')](_0xb29ad9['body'][_0x6a18('0x53')],_[_0x6a18('0x54')](_0xb29ad9[_0x6a18('0x4d')],['ids','id'])||{});}})[_0x6a18('0x29')](respondWithResult(_0x53c2fd,null))[_0x6a18('0x4b')](handleError(_0x53c2fd,null));};exports[_0x6a18('0x55')]=function(_0x3833b2,_0x57f79e,_0x2ee56d){var _0x2b2726={};var _0xf82666={};var _0x58047c;var _0x49ff04;return db['ChatGroup'][_0x6a18('0x56')]({'where':{'id':_0x3833b2['params']['id']}})[_0x6a18('0x29')](handleEntityNotFound(_0x57f79e,null))['then'](function(_0x1b8799){if(_0x1b8799){_0x58047c=_0x1b8799;_0xf82666[_0x6a18('0x33')]=_['keys'](db[_0x6a18('0x57')][_0x6a18('0x2f')]);_0xf82666['query']=_[_0x6a18('0x36')](_0x3833b2['query']);_0xf82666[_0x6a18('0x3f')]=_[_0x6a18('0x37')](_0xf82666['model'],_0xf82666[_0x6a18('0x35')]);_0x2b2726[_0x6a18('0x38')]=_[_0x6a18('0x37')](_0xf82666[_0x6a18('0x33')],qs[_0x6a18('0x58')](_0x3833b2[_0x6a18('0x35')][_0x6a18('0x58')]));_0x2b2726[_0x6a18('0x38')]=_0x2b2726[_0x6a18('0x38')]['length']?_0x2b2726[_0x6a18('0x38')]:_0xf82666[_0x6a18('0x33')];_0x2b2726[_0x6a18('0x3c')]=qs['sort'](_0x3833b2[_0x6a18('0x35')][_0x6a18('0x3d')]);_0x2b2726[_0x6a18('0x3e')]=qs[_0x6a18('0x3f')](_[_0x6a18('0x40')](_0x3833b2['query'],_0xf82666[_0x6a18('0x3f')]));if(_0x3833b2[_0x6a18('0x35')][_0x6a18('0x41')]){_0x2b2726['where']=_[_0x6a18('0x42')](_0x2b2726['where'],{'$or':_[_0x6a18('0x34')](_0x2b2726[_0x6a18('0x38')],function(_0x4ce1e8){var _0xf1c1aa={};_0xf1c1aa[_0x4ce1e8]={'$like':'%'+_0x3833b2[_0x6a18('0x35')]['filter']+'%'};return _0xf1c1aa;})});}_0x2b2726=_['merge']({},_0x2b2726,_0x3833b2['options']);return _0x58047c['getMembers'](_0x2b2726);}})[_0x6a18('0x29')](function(_0x5a4324){if(_0x5a4324){_0x49ff04=_0x5a4324[_0x6a18('0x39')];if(!_0x3833b2[_0x6a18('0x35')][_0x6a18('0x3a')](_0x6a18('0x3b'))){_0x2b2726[_0x6a18('0x22')]=qs[_0x6a18('0x22')](_0x3833b2[_0x6a18('0x35')][_0x6a18('0x22')]);_0x2b2726[_0x6a18('0x21')]=qs[_0x6a18('0x21')](_0x3833b2['query'][_0x6a18('0x21')]);}return _0x58047c[_0x6a18('0x55')](_0x2b2726);}})[_0x6a18('0x29')](function(_0x2e5722){if(_0x2e5722){return _0x2e5722?{'count':_0x49ff04,'rows':_0x2e5722}:null;}})[_0x6a18('0x29')](respondWithResult(_0x57f79e,null))['catch'](handleError(_0x57f79e,null));};exports['removeMembers']=function(_0x504a2e,_0x510e62,_0x4b9aae){return db[_0x6a18('0x44')][_0x6a18('0x4e')]({'where':{'id':_0x504a2e['params']['id']}})[_0x6a18('0x29')](handleEntityNotFound(_0x510e62,null))[_0x6a18('0x29')](function(_0x4c8e7f){if(_0x4c8e7f){return _0x4c8e7f[_0x6a18('0x59')](_0x504a2e[_0x6a18('0x35')][_0x6a18('0x53')]);}})[_0x6a18('0x29')](respondWithStatusCode(_0x510e62,null))[_0x6a18('0x4b')](handleError(_0x510e62,null));};exports['addMessage']=function(_0x5bdcf8,_0x1a732a,_0x1832f2){if(_0x5bdcf8[_0x6a18('0x4d')]['id']){delete _0x5bdcf8[_0x6a18('0x4d')]['id'];}return db[_0x6a18('0x44')]['find']({'where':{'id':_0x5bdcf8[_0x6a18('0x49')]['id']}})['then'](handleEntityNotFound(_0x1a732a,null))[_0x6a18('0x29')](function(_0x3b0a13){if(_0x3b0a13){_0x5bdcf8[_0x6a18('0x4d')][_0x6a18('0x5a')]=_0x3b0a13['id'];return db['ChatInternalMessage'][_0x6a18('0x4c')](_0x5bdcf8['body']);}})[_0x6a18('0x29')](respondWithResult(_0x1a732a,null))['catch'](handleError(_0x1a732a,null));};exports['getMessages']=function(_0x3be920,_0x501e14,_0x643d2b){var _0x55288c={};var _0x5d7399={};var _0x475fe7;var _0x1255d0;return db['ChatGroup'][_0x6a18('0x56')]({'where':{'id':_0x3be920[_0x6a18('0x49')]['id']}})[_0x6a18('0x29')](handleEntityNotFound(_0x501e14,null))['then'](function(_0xba79c8){if(_0xba79c8){_0x475fe7=_0xba79c8;_0x5d7399[_0x6a18('0x33')]=_[_0x6a18('0x36')](db[_0x6a18('0x50')][_0x6a18('0x2f')]);_0x5d7399[_0x6a18('0x35')]=_[_0x6a18('0x36')](_0x3be920[_0x6a18('0x35')]);_0x5d7399[_0x6a18('0x3f')]=_['intersection'](_0x5d7399['model'],_0x5d7399[_0x6a18('0x35')]);_0x55288c[_0x6a18('0x38')]=_[_0x6a18('0x37')](_0x5d7399[_0x6a18('0x33')],qs[_0x6a18('0x58')](_0x3be920[_0x6a18('0x35')][_0x6a18('0x58')]));_0x55288c[_0x6a18('0x38')]=_0x55288c['attributes'][_0x6a18('0x39')]?_0x55288c['attributes']:_0x5d7399[_0x6a18('0x33')];_0x55288c['order']=qs[_0x6a18('0x3d')](_0x3be920[_0x6a18('0x35')][_0x6a18('0x3d')]);_0x55288c['where']=qs[_0x6a18('0x3f')](_[_0x6a18('0x40')](_0x3be920[_0x6a18('0x35')],_0x5d7399[_0x6a18('0x3f')]));if(_0x3be920[_0x6a18('0x35')][_0x6a18('0x41')]){_0x55288c['where']=_[_0x6a18('0x42')](_0x55288c[_0x6a18('0x3e')],{'$or':_[_0x6a18('0x34')](_0x55288c[_0x6a18('0x38')],function(_0x206c02){var _0x30007d={};_0x30007d[_0x206c02]={'$like':'%'+_0x3be920[_0x6a18('0x35')]['filter']+'%'};return _0x30007d;})});}if(_0x3be920['query'][_0x6a18('0x5b')]){var _0x4268a8=_0x3be920[_0x6a18('0x35')]['$gte'][_0x6a18('0x5c')](',');var _0xc22da1={};_0xc22da1[_0x4268a8[0x0]]={'$gte':moment(_0x4268a8[0x1])[_0x6a18('0x5d')](_0x6a18('0x5e'))};_0x55288c['where']=_[_0x6a18('0x42')](_0x55288c['where'],_0xc22da1);}_0x55288c=_['merge']({},_0x55288c,_0x3be920[_0x6a18('0x4a')]);return _0x475fe7['getMessages'](_0x55288c);}})[_0x6a18('0x29')](function(_0x1adafc){if(_0x1adafc){_0x1255d0=_0x1adafc[_0x6a18('0x39')];if(!_0x3be920[_0x6a18('0x35')][_0x6a18('0x3a')](_0x6a18('0x3b'))){_0x55288c['limit']=qs['limit'](_0x3be920[_0x6a18('0x35')][_0x6a18('0x22')]);_0x55288c[_0x6a18('0x21')]=qs[_0x6a18('0x21')](_0x3be920[_0x6a18('0x35')][_0x6a18('0x21')]);}return _0x475fe7[_0x6a18('0x5f')](_0x55288c);}})['then'](function(_0x5d8438){if(_0x5d8438){return _0x5d8438?{'count':_0x1255d0,'rows':_0x5d8438}:null;}})[_0x6a18('0x29')](respondWithResult(_0x501e14,null))[_0x6a18('0x4b')](handleError(_0x501e14,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 6bae507..b5aeec0 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 _0xf8cc=['events','../../mysqldb','save','remove','emit','hasOwnProperty','hook'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xf8cc,0x173));var _0xcf8c=function(_0x6cd99b,_0x3c999d){_0x6cd99b=_0x6cd99b-0x0;var _0x2a0587=_0xf8cc[_0x6cd99b];return _0x2a0587;};'use strict';var EventEmitter=require(_0xcf8c('0x0'));var ChatGroup=require(_0xcf8c('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcf8c('0x2'),'afterUpdate':'update','afterDestroy':_0xcf8c('0x3')};function emitEvent(_0x5a5e7c){return function(_0xadd1fd,_0x57a20a,_0x9dcd2f){ChatGroupEvents[_0xcf8c('0x4')](_0x5a5e7c+':'+_0xadd1fd['id'],_0xadd1fd);ChatGroupEvents[_0xcf8c('0x4')](_0x5a5e7c,_0xadd1fd);_0x9dcd2f(null);};}for(var e in events){if(events[_0xcf8c('0x5')](e)){var event=events[e];ChatGroup[_0xcf8c('0x6')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0x3af5=['setMaxListeners','save','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x470f63,_0x48d80b){var _0x4f09e2=function(_0x3aa3a4){while(--_0x3aa3a4){_0x470f63['push'](_0x470f63['shift']());}};_0x4f09e2(++_0x48d80b);}(_0x3af5,0x1d3));var _0x53af=function(_0xc6ea98,_0x1f0fe7){_0xc6ea98=_0xc6ea98-0x0;var _0x154999=_0x3af5[_0xc6ea98];return _0x154999;};'use strict';var EventEmitter=require(_0x53af('0x0'));var ChatGroup=require(_0x53af('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x53af('0x2')](0x0);var events={'afterCreate':_0x53af('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x370c3b){return function(_0x500041,_0x518926,_0x205be1){ChatGroupEvents[_0x53af('0x4')](_0x370c3b+':'+_0x500041['id'],_0x500041);ChatGroupEvents['emit'](_0x370c3b,_0x500041);_0x205be1(null);};}for(var e in events){if(events[_0x53af('0x5')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x53af('0x6')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 9f6007c..0774463 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 _0x2629=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatGroup.attributes','lodash','util'];(function(_0x53d4f7,_0x1e0f8c){var _0x339e61=function(_0x5b9f1f){while(--_0x5b9f1f){_0x53d4f7['push'](_0x53d4f7['shift']());}};_0x339e61(++_0x1e0f8c);}(_0x2629,0x1b6));var _0x9262=function(_0x479b99,_0x1e5bec){_0x479b99=_0x479b99-0x0;var _0x1e7eb7=_0x2629[_0x479b99];return _0x1e7eb7;};'use strict';var _=require(_0x9262('0x0'));var util=require(_0x9262('0x1'));var logger=require(_0x9262('0x2'))(_0x9262('0x3'));var moment=require(_0x9262('0x4'));var BPromise=require(_0x9262('0x5'));var rp=require(_0x9262('0x6'));var fs=require('fs');var path=require(_0x9262('0x7'));var rimraf=require(_0x9262('0x8'));var config=require('../../config/environment');var attributes=require(_0x9262('0x9'));module['exports']=function(_0x3bc4cc,_0x44dd2b){return _0x3bc4cc['define']('ChatGroup',attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe4dd=['../../config/logger','api','bluebird','request-promise','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util'];(function(_0x12d951,_0x249808){var _0x44de17=function(_0x182fd9){while(--_0x182fd9){_0x12d951['push'](_0x12d951['shift']());}};_0x44de17(++_0x249808);}(_0xe4dd,0x9a));var _0xde4d=function(_0x4fbb15,_0x21be0c){_0x4fbb15=_0x4fbb15-0x0;var _0x436338=_0xe4dd[_0x4fbb15];return _0x436338;};'use strict';var _=require(_0xde4d('0x0'));var util=require(_0xde4d('0x1'));var logger=require(_0xde4d('0x2'))(_0xde4d('0x3'));var moment=require('moment');var BPromise=require(_0xde4d('0x4'));var rp=require(_0xde4d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xde4d('0x6'));var attributes=require(_0xde4d('0x7'));module[_0xde4d('0x8')]=function(_0x14b8c7,_0x495f20){return _0x14b8c7[_0xde4d('0x9')](_0xde4d('0xa'),attributes,{'tableName':_0xde4d('0xb'),'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 fde5127..735eef0 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 _0x693d=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x2333d0,_0x176327){var _0x2bea4c=function(_0x4999a9){while(--_0x4999a9){_0x2333d0['push'](_0x2333d0['shift']());}};_0x2bea4c(++_0x176327);}(_0x693d,0x153));var _0xd693=function(_0x4943c3,_0x2875c7){_0x4943c3=_0x4943c3-0x0;var _0x24c59a=_0x693d[_0x4943c3];return _0x24c59a;};'use strict';var _=require(_0xd693('0x0'));var util=require(_0xd693('0x1'));var moment=require(_0xd693('0x2'));var BPromise=require(_0xd693('0x3'));var rs=require(_0xd693('0x4'));var fs=require('fs');var Redis=require(_0xd693('0x5'));var db=require(_0xd693('0x6'))['db'];var utils=require(_0xd693('0x7'));var logger=require(_0xd693('0x8'))('rpc');var config=require(_0xd693('0x9'));var jayson=require(_0xd693('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0xd693('0xb')]=_[_0xd693('0xc')](config[_0xd693('0xb')],{'host':_0xd693('0xd'),'port':0x18eb});var socket=require(_0xd693('0xe'))(new Redis(config[_0xd693('0xb')]));require(_0xd693('0xf'))[_0xd693('0x10')](socket);function respondWithRpcPromise(_0x2cb3fd,_0x13962f,_0x1c3803){return new BPromise(function(_0x6ca2a6,_0x16c16f){return client[_0xd693('0x11')](_0x2cb3fd,_0x1c3803)[_0xd693('0x12')](function(_0x3f29a2){logger[_0xd693('0x13')](_0xd693('0x14'),_0x13962f,'request\x20sent');logger['debug'](_0xd693('0x15'),_0x13962f,'request\x20sent',JSON[_0xd693('0x16')](_0x3f29a2));if(_0x3f29a2[_0xd693('0x17')]){if(_0x3f29a2[_0xd693('0x17')]['code']===0x1f4){logger['error'](_0xd693('0x14'),_0x13962f,_0x3f29a2[_0xd693('0x17')][_0xd693('0x18')]);return _0x16c16f(_0x3f29a2[_0xd693('0x17')][_0xd693('0x18')]);}logger[_0xd693('0x17')](_0xd693('0x14'),_0x13962f,_0x3f29a2[_0xd693('0x17')][_0xd693('0x18')]);return _0x6ca2a6(_0x3f29a2[_0xd693('0x17')]['message']);}else{logger[_0xd693('0x13')](_0xd693('0x14'),_0x13962f,'request\x20sent');_0x6ca2a6(_0x3f29a2[_0xd693('0x19')][_0xd693('0x18')]);}})['catch'](function(_0x1c4e0a){logger[_0xd693('0x17')]('ChatGroup,\x20%s,\x20%s',_0x13962f,_0x1c4e0a);_0x16c16f(_0x1c4e0a);});});} \ No newline at end of file +var _0x3c06=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatGroup.socket','request','request\x20sent','debug','stringify','error','code','message','ChatGroup,\x20%s,\x20%s','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x55663f,_0x31653b){var _0x261b0c=function(_0x48186b){while(--_0x48186b){_0x55663f['push'](_0x55663f['shift']());}};_0x261b0c(++_0x31653b);}(_0x3c06,0xf7));var _0x63c0=function(_0x5b492b,_0x35a35d){_0x5b492b=_0x5b492b-0x0;var _0x2de782=_0x3c06[_0x5b492b];return _0x2de782;};'use strict';var _=require(_0x63c0('0x0'));var util=require(_0x63c0('0x1'));var moment=require(_0x63c0('0x2'));var BPromise=require(_0x63c0('0x3'));var rs=require(_0x63c0('0x4'));var fs=require('fs');var Redis=require(_0x63c0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x63c0('0x6'));var logger=require(_0x63c0('0x7'))(_0x63c0('0x8'));var config=require(_0x63c0('0x9'));var jayson=require(_0x63c0('0xa'));var client=jayson[_0x63c0('0xb')][_0x63c0('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0x63c0('0xd')],{'host':_0x63c0('0xe'),'port':0x18eb});var socket=require(_0x63c0('0xf'))(new Redis(config[_0x63c0('0xd')]));require(_0x63c0('0x10'))['register'](socket);function respondWithRpcPromise(_0x5188a4,_0x20d2a7,_0x3b7eb4){return new BPromise(function(_0x792b51,_0x246bad){return client[_0x63c0('0x11')](_0x5188a4,_0x3b7eb4)['then'](function(_0x1ae320){logger['info']('ChatGroup,\x20%s,\x20%s',_0x20d2a7,_0x63c0('0x12'));logger[_0x63c0('0x13')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x20d2a7,_0x63c0('0x12'),JSON[_0x63c0('0x14')](_0x1ae320));if(_0x1ae320['error']){if(_0x1ae320[_0x63c0('0x15')][_0x63c0('0x16')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x20d2a7,_0x1ae320[_0x63c0('0x15')][_0x63c0('0x17')]);return _0x246bad(_0x1ae320[_0x63c0('0x15')][_0x63c0('0x17')]);}logger[_0x63c0('0x15')](_0x63c0('0x18'),_0x20d2a7,_0x1ae320[_0x63c0('0x15')][_0x63c0('0x17')]);return _0x792b51(_0x1ae320[_0x63c0('0x15')][_0x63c0('0x17')]);}else{logger[_0x63c0('0x19')]('ChatGroup,\x20%s,\x20%s',_0x20d2a7,_0x63c0('0x12'));_0x792b51(_0x1ae320[_0x63c0('0x1a')][_0x63c0('0x17')]);}})[_0x63c0('0x1b')](function(_0xfd51ff){logger[_0x63c0('0x15')]('ChatGroup,\x20%s,\x20%s',_0x20d2a7,_0xfd51ff);_0x246bad(_0xfd51ff);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index b556311..5d920d4 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 _0x90dd=['length','./chatGroup.events','save','update','emit'];(function(_0x3e2b35,_0x1133d9){var _0xdd49bd=function(_0x590278){while(--_0x590278){_0x3e2b35['push'](_0x3e2b35['shift']());}};_0xdd49bd(++_0x1133d9);}(_0x90dd,0x97));var _0xd90d=function(_0x3193dd,_0x216bc1){_0x3193dd=_0x3193dd-0x0;var _0x4f2679=_0x90dd[_0x3193dd];return _0x4f2679;};'use strict';var ChatGroupEvents=require(_0xd90d('0x0'));var events=[_0xd90d('0x1'),'remove',_0xd90d('0x2')];function createListener(_0x50c9b6,_0x556b0f){return function(_0x2886a5){_0x556b0f[_0xd90d('0x3')](_0x50c9b6,_0x2886a5);};}function removeListener(_0x435fbf,_0x3d593b){return function(){ChatGroupEvents['removeListener'](_0x435fbf,_0x3d593b);};}exports['register']=function(_0x1ed1f2){for(var _0x452ff0=0x0,_0x3c97bd=events[_0xd90d('0x4')];_0x452ff0<_0x3c97bd;_0x452ff0++){var _0x315ce0=events[_0x452ff0];var _0x397bfe=createListener('chatGroup:'+_0x315ce0,_0x1ed1f2);ChatGroupEvents['on'](_0x315ce0,_0x397bfe);}}; \ No newline at end of file +var _0x55bf=['chatGroup:','./chatGroup.events','save','remove','update','emit','register','length'];(function(_0x18401f,_0x57cc61){var _0x5925e5=function(_0x450cf5){while(--_0x450cf5){_0x18401f['push'](_0x18401f['shift']());}};_0x5925e5(++_0x57cc61);}(_0x55bf,0x199));var _0xf55b=function(_0x1f1584,_0x32656e){_0x1f1584=_0x1f1584-0x0;var _0x43b6fb=_0x55bf[_0x1f1584];return _0x43b6fb;};'use strict';var ChatGroupEvents=require(_0xf55b('0x0'));var events=[_0xf55b('0x1'),_0xf55b('0x2'),_0xf55b('0x3')];function createListener(_0x5e0b87,_0x36af37){return function(_0x948a83){_0x36af37[_0xf55b('0x4')](_0x5e0b87,_0x948a83);};}function removeListener(_0x360e79,_0x1e72cb){return function(){ChatGroupEvents['removeListener'](_0x360e79,_0x1e72cb);};}exports[_0xf55b('0x5')]=function(_0x189de5){for(var _0x46fbaa=0x0,_0xe58fb4=events[_0xf55b('0x6')];_0x46fbaa<_0xe58fb4;_0x46fbaa++){var _0x17fc0b=events[_0x46fbaa];var _0x476ca3=createListener(_0xf55b('0x7')+_0x17fc0b,_0x189de5);ChatGroupEvents['on'](_0x17fc0b,_0x476ca3);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index aa8955e..4cdc953 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 _0x608e=['destroy','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','show','/:id/unread','getUnread','getMembers','/:id/messages','getMessages','post','/:id/members','addMembers','addMessage','put','/:id','update'];(function(_0x417ddc,_0x26f532){var _0x2e8327=function(_0x21b777){while(--_0x21b777){_0x417ddc['push'](_0x417ddc['shift']());}};_0x2e8327(++_0x26f532);}(_0x608e,0x1a7));var _0xe608=function(_0x52b85a,_0x51f275){_0x52b85a=_0x52b85a-0x0;var _0x240508=_0x608e[_0x52b85a];return _0x240508;};'use strict';var multer=require(_0xe608('0x0'));var util=require('util');var path=require(_0xe608('0x1'));var timeout=require(_0xe608('0x2'));var express=require(_0xe608('0x3'));var router=express[_0xe608('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe608('0x5'));var interaction=require(_0xe608('0x6'));var config=require(_0xe608('0x7'));var controller=require(_0xe608('0x8'));router[_0xe608('0x9')]('/',auth[_0xe608('0xa')](),controller[_0xe608('0xb')]);router[_0xe608('0x9')](_0xe608('0xc'),auth['isAuthenticated'](),controller[_0xe608('0xd')]);router[_0xe608('0x9')]('/:id',auth[_0xe608('0xa')](),controller[_0xe608('0xe')]);router[_0xe608('0x9')](_0xe608('0xf'),auth[_0xe608('0xa')](),controller[_0xe608('0x10')]);router[_0xe608('0x9')]('/:id/members',auth[_0xe608('0xa')](),controller[_0xe608('0x11')]);router['get'](_0xe608('0x12'),auth['isAuthenticated'](),controller[_0xe608('0x13')]);router['post']('/',auth[_0xe608('0xa')](),controller['create']);router[_0xe608('0x14')](_0xe608('0x15'),auth[_0xe608('0xa')](),controller[_0xe608('0x16')]);router[_0xe608('0x14')](_0xe608('0x12'),auth[_0xe608('0xa')](),controller[_0xe608('0x17')]);router[_0xe608('0x18')](_0xe608('0x19'),auth[_0xe608('0xa')](),controller[_0xe608('0x1a')]);router['delete']('/:id',auth[_0xe608('0xa')](),controller[_0xe608('0x1b')]);router[_0xe608('0x1c')](_0xe608('0x15'),auth[_0xe608('0xa')](),controller['removeMembers']);module[_0xe608('0x1d')]=router; \ No newline at end of file +var _0x3391=['index','describe','/:id','/:id/unread','getUnread','getMembers','/:id/messages','getMessages','post','create','/:id/members','addMessage','put','update','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated'];(function(_0x1d5400,_0x567e3c){var _0x21d9fe=function(_0x23fb75){while(--_0x23fb75){_0x1d5400['push'](_0x1d5400['shift']());}};_0x21d9fe(++_0x567e3c);}(_0x3391,0x8a));var _0x1339=function(_0x295f1a,_0x456368){_0x295f1a=_0x295f1a-0x0;var _0x3e136d=_0x3391[_0x295f1a];return _0x3e136d;};'use strict';var multer=require(_0x1339('0x0'));var util=require(_0x1339('0x1'));var path=require(_0x1339('0x2'));var timeout=require(_0x1339('0x3'));var express=require(_0x1339('0x4'));var router=express[_0x1339('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1339('0x6'));var interaction=require(_0x1339('0x7'));var config=require(_0x1339('0x8'));var controller=require(_0x1339('0x9'));router[_0x1339('0xa')]('/',auth[_0x1339('0xb')](),controller[_0x1339('0xc')]);router[_0x1339('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x1339('0xd')]);router[_0x1339('0xa')](_0x1339('0xe'),auth[_0x1339('0xb')](),controller['show']);router[_0x1339('0xa')](_0x1339('0xf'),auth[_0x1339('0xb')](),controller[_0x1339('0x10')]);router[_0x1339('0xa')]('/:id/members',auth['isAuthenticated'](),controller[_0x1339('0x11')]);router[_0x1339('0xa')](_0x1339('0x12'),auth[_0x1339('0xb')](),controller[_0x1339('0x13')]);router[_0x1339('0x14')]('/',auth['isAuthenticated'](),controller[_0x1339('0x15')]);router['post'](_0x1339('0x16'),auth['isAuthenticated'](),controller['addMembers']);router['post']('/:id/messages',auth[_0x1339('0xb')](),controller[_0x1339('0x17')]);router[_0x1339('0x18')](_0x1339('0xe'),auth['isAuthenticated'](),controller[_0x1339('0x19')]);router[_0x1339('0x1a')](_0x1339('0xe'),auth[_0x1339('0xb')](),controller[_0x1339('0x1b')]);router['delete'](_0x1339('0x16'),auth[_0x1339('0xb')](),controller[_0x1339('0x1c')]);module[_0x1339('0x1d')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index bc65bff..49f4e22 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 _0x2b65=['TEXT','STRING','DATE','long','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb'];(function(_0x4cc6dd,_0x1d862a){var _0xd7d407=function(_0x4250f5){while(--_0x4250f5){_0x4cc6dd['push'](_0x4cc6dd['shift']());}};_0xd7d407(++_0x1d862a);}(_0x2b65,0x131));var _0x52b6=function(_0x1168a1,_0xa0d8c9){_0x1168a1=_0x1168a1-0x0;var _0xcc5ad8=_0x2b65[_0x1168a1];return _0xcc5ad8;};'use strict';var Sequelize=require(_0x52b6('0x0'));module[_0x52b6('0x1')]={'closed':{'type':Sequelize[_0x52b6('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x52b6('0x3')]},'ratingType':{'type':Sequelize[_0x52b6('0x4')](_0x52b6('0x5'),_0x52b6('0x6')),'defaultValue':_0x52b6('0x5')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x52b6('0x7')]},'mailTranscript':{'type':Sequelize[_0x52b6('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x52b6('0x9')]},'disposition':{'type':Sequelize[_0x52b6('0x8')]},'secondDisposition':{'type':Sequelize[_0x52b6('0x8')]},'thirdDisposition':{'type':Sequelize[_0x52b6('0x8')]},'note':{'type':Sequelize[_0x52b6('0x8')]},'browserName':{'type':Sequelize[_0x52b6('0x8')]},'browserVersion':{'type':Sequelize[_0x52b6('0x8')]},'osName':{'type':Sequelize[_0x52b6('0x8')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x52b6('0x8')]},'deviceVendor':{'type':Sequelize[_0x52b6('0x8')]},'deviceType':{'type':Sequelize[_0x52b6('0x8')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x52b6('0x8')]},'formData':{'type':Sequelize[_0x52b6('0x7')](_0x52b6('0xa'))},'read1stAt':{'type':Sequelize[_0x52b6('0x9')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x52b6('0x4')]('in',_0x52b6('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x52b6('0x8')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x52b6('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0x52b6('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x6599=['star','TEXT','DATE','STRING','long','out','exports','BOOLEAN','INTEGER','ENUM'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x6599,0xb0));var _0x9659=function(_0x5c811c,_0x313b25){_0x5c811c=_0x5c811c-0x0;var _0x5df3af=_0x6599[_0x5c811c];return _0x5df3af;};'use strict';var Sequelize=require('sequelize');module[_0x9659('0x0')]={'closed':{'type':Sequelize[_0x9659('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x9659('0x2')]},'ratingType':{'type':Sequelize[_0x9659('0x3')](_0x9659('0x4'),'thumb'),'defaultValue':_0x9659('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x9659('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x9659('0x6')]},'disposition':{'type':Sequelize[_0x9659('0x7')]},'secondDisposition':{'type':Sequelize[_0x9659('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x9659('0x7')]},'browserVersion':{'type':Sequelize[_0x9659('0x7')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x9659('0x7')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x9659('0x7')]},'deviceType':{'type':Sequelize[_0x9659('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x9659('0x7')]},'formData':{'type':Sequelize[_0x9659('0x5')](_0x9659('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x9659('0x6')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x9659('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x9659('0x7')]},'customerPort':{'type':Sequelize[_0x9659('0x7')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x9659('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 7d86d9c..dced317 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 _0x2032=['nolimit','order','sort','pick','field','color','tools_tags','select','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','o.id\x20=\x20i.UserId','chat_websites','chat_messages','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','compact','isEmpty','ChatWebsiteId','concat','createdAt','$gte','parse','where','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','role','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','toString','fields','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.lastName','c.email','Contact.phone','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','all','rows','params','keys','include','options','create','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooMetadata','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','vidaooNote','follow','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','file','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','join','root','server/files/attachments/','offline-chat/','download','close','format','transcript-%s.txt','now','pathTranscript','Messages','User','ChatWebsite','%s%d','agentAlias','customer','Visitor','website_alias','System','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','MailServerOut','Smtp','service','host','port','secure','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','getMyMessages','includeAgent','addTags','ids','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Account','Owner','mkdirSync','Chat','N.A.','closedAt','browserName','customerIp','customerPort','tail','createReadStream','pipe','views','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','socket.io-emitter','register','jayson/promise','client','http','then','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','apply','save','update','destroy','end','name','send','merge','body','contact','agent','Users','map','fullname','TagIds','forEach','Tags','index','ChatInteraction','rawAttributes','type','model','query','filters','attributes','intersection','length','hasOwnProperty'];(function(_0x16bfe4,_0x2477a){var _0x2aed01=function(_0x2d4bc3){while(--_0x2d4bc3){_0x16bfe4['push'](_0x16bfe4['shift']());}};_0x2aed01(++_0x2477a);}(_0x2032,0xd9));var _0x2203=function(_0x59f475,_0x2c9448){_0x59f475=_0x59f475-0x0;var _0x1057b4=_0x2032[_0x59f475];return _0x1057b4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x2203('0x14'));var logger=require('../../config/logger')(_0x2203('0x15'));var utils=require('../../config/utils');var config=require(_0x2203('0x16'));var licenseUtil=require(_0x2203('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2203('0x18'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0x2203('0x19')](socket);var jayson=require(_0x2203('0x1a'));var client=jayson[_0x2203('0x1b')][_0x2203('0x1c')]({'port':0x232b});var client9004=jayson[_0x2203('0x1b')][_0x2203('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x2c36e6,_0x2c085c,_0xdf9d0b,_0x3053f3){return new BPromise(function(_0x5129fb,_0x280eda){var _0x2ee127=_0x3053f3||client;return _0x2ee127['request'](_0x2c36e6,_0xdf9d0b)[_0x2203('0x1d')](function(_0x8906e1){logger['info'](_0x2203('0x1e'),_0x2c085c,'request\x20sent');logger[_0x2203('0x1f')](_0x2203('0x20'),_0x2c085c,_0x2203('0x21'),JSON[_0x2203('0x22')](_0x8906e1));if(_0x8906e1[_0x2203('0x23')]){if(_0x8906e1[_0x2203('0x23')]['code']===0x1f4){logger[_0x2203('0x23')]('ChatInteraction,\x20%s,\x20%s',_0x2c085c,_0x8906e1['error'][_0x2203('0x24')]);return _0x280eda(_0x8906e1['error'][_0x2203('0x24')]);}logger[_0x2203('0x23')]('ChatInteraction,\x20%s,\x20%s',_0x2c085c,_0x8906e1[_0x2203('0x23')]['message']);return _0x5129fb(_0x8906e1['error'][_0x2203('0x24')]);}else{logger[_0x2203('0x25')](_0x2203('0x1e'),_0x2c085c,_0x2203('0x21'));_0x5129fb(_0x8906e1[_0x2203('0x26')][_0x2203('0x24')]);}})[_0x2203('0x27')](function(_0x250349){logger['error'](_0x2203('0x1e'),_0x2c085c,_0x250349);_0x280eda(_0x250349);});});}function respondWithStatusCode(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0xcc;return function(_0x5f11bf){if(_0x5f11bf){return _0x36b958[_0x2203('0x28')](_0x39a11a);}return _0x36b958[_0x2203('0x29')](_0x39a11a)['end']();};}function respondWithResult(_0xd6e109,_0xd91f5d){_0xd91f5d=_0xd91f5d||0xc8;return function(_0x1c6a77){if(_0x1c6a77){return _0xd6e109[_0x2203('0x29')](_0xd91f5d)[_0x2203('0x2a')](_0x1c6a77);}};}function respondWithFilteredResult(_0x1df508,_0x9c53f){return function(_0x5a95c1){if(_0x5a95c1){var _0x34b8ba=typeof _0x9c53f[_0x2203('0x2b')]===_0x2203('0x2c')&&typeof _0x9c53f[_0x2203('0x2d')]==='undefined';var _0x3a8e23=_0x5a95c1[_0x2203('0x2e')];var _0x287c95=_0x34b8ba?0x0:_0x9c53f[_0x2203('0x2b')];var _0x520602=_0x34b8ba?_0x5a95c1[_0x2203('0x2e')]:_0x9c53f[_0x2203('0x2b')]+_0x9c53f['limit'];var _0x5c0157;if(_0x520602>=_0x3a8e23){_0x520602=_0x3a8e23;_0x5c0157=0xc8;}else{_0x5c0157=0xce;}_0x1df508[_0x2203('0x29')](_0x5c0157);return _0x1df508['set']('Content-Range',_0x287c95+'-'+_0x520602+'/'+_0x3a8e23)[_0x2203('0x2a')](_0x5a95c1);}return null;};}function patchUpdates(_0x464c88){return function(_0x191894){try{jsonpatch[_0x2203('0x2f')](_0x191894,_0x464c88,!![]);}catch(_0xf2801d){return BPromise['reject'](_0xf2801d);}return _0x191894[_0x2203('0x30')]();};}function saveUpdates(_0x2324c0,_0x49caec){return function(_0x2a2ee7){if(_0x2a2ee7){return _0x2a2ee7[_0x2203('0x31')](_0x2324c0)[_0x2203('0x1d')](function(_0x4187b4){return _0x4187b4;});}return null;};}function removeEntity(_0x43fee1,_0x24d138){return function(_0x29da55){if(_0x29da55){return _0x29da55[_0x2203('0x32')]()[_0x2203('0x1d')](function(){_0x43fee1['status'](0xcc)[_0x2203('0x33')]();});}};}function handleEntityNotFound(_0x347d3e,_0x56f9b2){return function(_0x54b90b){if(!_0x54b90b){_0x347d3e[_0x2203('0x28')](0x194);}return _0x54b90b;};}function handleError(_0x5e9841,_0x25cc97){_0x25cc97=_0x25cc97||0x1f4;return function(_0x3b1eeb){logger[_0x2203('0x23')](_0x3b1eeb['stack']);if(_0x3b1eeb['name']){delete _0x3b1eeb[_0x2203('0x34')];}_0x5e9841['status'](_0x25cc97)[_0x2203('0x35')](_0x3b1eeb);};}function getMustacheRender(_0x5cfe5e,_0x11451e){return Mustache['render'](_0x5cfe5e,_[_0x2203('0x36')](_0x11451e[_0x2203('0x37')],{'contact':_0x11451e[_0x2203('0x38')],'message':_0x11451e[_0x2203('0x24')],'agent':_0x11451e[_0x2203('0x39')],'interaction':_0x11451e['interaction'],'account':_0x11451e['account']}))||'';}function getInteractionUsers(_0x4c0e9e,_0x7ea79b){return new BPromise(function(_0x25a2dc,_0x323798){try{if(_0x7ea79b[_0x4c0e9e['id']]){_0x4c0e9e[_0x2203('0x3a')]=_[_0x2203('0x3b')](_0x7ea79b[_0x4c0e9e['id']],function(_0x3b250a){return{'id':_0x3b250a['id'],'fullname':_0x3b250a[_0x2203('0x3c')]};});}}catch(_0x590b4e){_0x323798(_0x590b4e);}_0x25a2dc(_0x4c0e9e);});}function getInteractionTags(_0x175945,_0x1b12c3){return new BPromise(function(_0x108fde,_0x26be74){try{if(_0x175945['TagIds']){_0x175945['Tags']=[];_0x175945[_0x2203('0x3d')]['split'](',')[_0x2203('0x3e')](function(_0x446209){_0x175945[_0x2203('0x3f')]['push'](_0x1b12c3[_0x446209]);});}delete _0x175945['TagIds'];}catch(_0x1e7ebc){_0x26be74(_0x1e7ebc);}_0x108fde(_0x175945);});}function updateChatInteraction(_0x3739f6,_0x368444,_0x1e09f3){return new BPromise(function(_0x372709,_0x1fa734){return getInteractionUsers(_0x3739f6,_0x1e09f3)['then'](function(_0x15d3b6){return getInteractionTags(_0x15d3b6,_0x368444);})[_0x2203('0x1d')](function(_0x3a866c){_0x372709(_0x3a866c);})[_0x2203('0x27')](function(_0x16b452){_0x1fa734(_0x16b452);});});}exports[_0x2203('0x40')]=function(_0x5b4842,_0x23a6e8){var _0x36b8e4={},_0x1e34a0={},_0x595281={'count':0x0,'rows':[]};var _0x2e2ca5=_[_0x2203('0x3b')](db[_0x2203('0x41')][_0x2203('0x42')],function(_0x4c3259){return{'name':_0x4c3259['fieldName'],'type':_0x4c3259[_0x2203('0x43')]['key']};});_0x1e34a0[_0x2203('0x44')]=_[_0x2203('0x3b')](_0x2e2ca5,_0x2203('0x34'));_0x1e34a0[_0x2203('0x45')]=_['keys'](_0x5b4842[_0x2203('0x45')]);_0x1e34a0[_0x2203('0x46')]=_['intersection'](_0x1e34a0[_0x2203('0x44')],_0x1e34a0[_0x2203('0x45')]);_0x36b8e4[_0x2203('0x47')]=_[_0x2203('0x48')](_0x1e34a0['model'],qs['fields'](_0x5b4842[_0x2203('0x45')]['fields']));_0x36b8e4['attributes']=_0x36b8e4[_0x2203('0x47')][_0x2203('0x49')]?_0x36b8e4[_0x2203('0x47')]:_0x1e34a0['model'];if(!_0x5b4842['query'][_0x2203('0x4a')](_0x2203('0x4b'))){_0x36b8e4[_0x2203('0x2d')]=qs[_0x2203('0x2d')](_0x5b4842[_0x2203('0x45')][_0x2203('0x2d')]);_0x36b8e4['offset']=qs[_0x2203('0x2b')](_0x5b4842['query'][_0x2203('0x2b')]);}_0x36b8e4[_0x2203('0x4c')]=qs[_0x2203('0x4d')](_0x5b4842[_0x2203('0x45')]['sort']);_0x36b8e4['where']=qs[_0x2203('0x46')](_[_0x2203('0x4e')](_0x5b4842[_0x2203('0x45')],_0x1e34a0[_0x2203('0x46')]),_0x2e2ca5);var _0x559370=[];var _0x4de47a=squel['select']()[_0x2203('0x4f')]('id')[_0x2203('0x4f')]('name')[_0x2203('0x4f')](_0x2203('0x50'))['from'](_0x2203('0x51'));var _0xb47204=squel[_0x2203('0x52')]()[_0x2203('0x4f')]('u.id')[_0x2203('0x4f')]('u.fullname')[_0x2203('0x4f')](_0x2203('0x53'))['from'](_0x2203('0x54'),'ui')[_0x2203('0x55')](_0x2203('0x56'),'u',_0x2203('0x57'));var _0x3f335a=squel[_0x2203('0x52')]()['from']('chat_interactions','i')[_0x2203('0x55')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x2203('0x55')](_0x2203('0x56'),'o',_0x2203('0x58'))['left_join'](_0x2203('0x59'),'a','a.id\x20=\x20i.ChatWebsiteId')['left_join'](_0x2203('0x5a'),'me','me.ChatInteractionId\x20=\x20i.id')['left_join']('chat_interaction_has_tags','it',_0x2203('0x5b'))[_0x2203('0x55')](_0x2203('0x51'),'t',_0x2203('0x5c'));var _0x26d3d9=squel[_0x2203('0x5d')]();var _0x2baea2=[];var _0x91f70c=squel[_0x2203('0x5d')]();var _0x216641;if(_0x5b4842[_0x2203('0x45')][_0x2203('0x5e')]){_0x216641=as['parseSearch'](_0x5b4842['query'][_0x2203('0x5e')]);var _0x43d8c0=_0x216641[_0x2203('0x5f')];for(var _0x2446be=0x0;_0x2446be<_0x216641[_0x2203('0x60')][_0x2203('0x49')];_0x2446be++){var _0x4f8b8e=_0x216641['conditions'][_0x2446be];var _0xb49120='i';var _0x34358e=_[_0x2203('0x61')](_0x2e2ca5,[_0x2203('0x34'),_0x4f8b8e[_0x2203('0x4f')]]);if(!_0x34358e){switch(_0x4f8b8e[_0x2203('0x4f')]){case _0x2203('0x62'):if(_0x4f8b8e[_0x2203('0x63')]==0x1){_0x3f335a[_0x2203('0x64')]('`'+_0x4f8b8e[_0x2203('0x4f')]+_0x2203('0x65'));}else{_0x3f335a['having']('`'+_0x4f8b8e[_0x2203('0x4f')]+_0x2203('0x66'));}break;case _0x2203('0x67'):if(_0x4f8b8e[_0x2203('0x68')]===_0x2203('0x69')){if(_0x4f8b8e[_0x2203('0x63')][_0x2203('0x6a')]('\x20')[_0x2203('0x49')]>0x1){_0x26d3d9[_0x43d8c0](_0x2203('0x6b'),qs[_0x2203('0x6c')](_0x4f8b8e[_0x2203('0x63')]),null);}else{var _0x6ea7e8='%'+_0x4f8b8e[_0x2203('0x63')]+'%';_0x26d3d9[_0x43d8c0](_0x2203('0x6d'),_0x6ea7e8,_0x6ea7e8,_0x6ea7e8);}}else{_0x34358e=_[_0x2203('0x61')](_0x2e2ca5,[_0x2203('0x34'),_0x2203('0x6e')]);_0x4f8b8e[_0x2203('0x4f')]=_0x2203('0x6e');_0xf16e1d=as[_0x2203('0x6f')](_0xb49120,_0x34358e['type'],_0x4f8b8e);_0x26d3d9[_0x43d8c0](_0xf16e1d[_0x2203('0x70')],_0xf16e1d[_0x2203('0x63')][_0x2203('0x71')],_0xf16e1d['value'][_0x2203('0x33')]);}break;case _0x2203('0x72'):var _0x1b4f96=_0x4f8b8e[_0x2203('0x63')][_0x2203('0x6a')](',')['map'](function(_0x38b077){return Number(_0x38b077);});_0x1b4f96[_0x2203('0x3e')](function(_0x1c63bf){_0x91f70c['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1c63bf+',%');});_0x2baea2=_['union'](_0x2baea2,_0x1b4f96);break;case'User':if(_0x4f8b8e['operator']==='$substring'){_0x26d3d9[_0x43d8c0](_0x2203('0x73'),'%'+_0x4f8b8e[_0x2203('0x63')]+'%',null);}else{_0x34358e=_[_0x2203('0x61')](_0x2e2ca5,[_0x2203('0x34'),_0x2203('0x74')]);_0x4f8b8e[_0x2203('0x4f')]=_0x2203('0x74');_0xf16e1d=as[_0x2203('0x6f')](_0xb49120,_0x34358e['type'],_0x4f8b8e);_0x26d3d9[_0x43d8c0](_0xf16e1d['text'],_0xf16e1d[_0x2203('0x63')][_0x2203('0x71')],_0xf16e1d[_0x2203('0x63')][_0x2203('0x33')]);}break;case _0x2203('0x37'):_0xf16e1d=as[_0x2203('0x6f')]('me',null,_0x4f8b8e);_0x26d3d9[_0x43d8c0](_0xf16e1d[_0x2203('0x70')],_0xf16e1d[_0x2203('0x63')][_0x2203('0x71')],_0xf16e1d[_0x2203('0x63')][_0x2203('0x33')]);break;}}else{var _0xf16e1d=as[_0x2203('0x6f')](_0xb49120,_0x34358e[_0x2203('0x43')],_0x4f8b8e);_0x26d3d9[_0x43d8c0](_0xf16e1d[_0x2203('0x70')],_0xf16e1d[_0x2203('0x63')][_0x2203('0x71')],_0xf16e1d[_0x2203('0x63')][_0x2203('0x33')]);}}}else{var _0x4b2e4f=_(_0x5b4842[_0x2203('0x45')])['keys']()[_0x2203('0x3b')](function(_0x55ecbb){return _[_0x2203('0x75')](_0x2e2ca5,[_0x2203('0x34'),_0x55ecbb])?_0x55ecbb:undefined;})[_0x2203('0x76')]()[_0x2203('0x63')]();if(!_[_0x2203('0x77')](_0x4b2e4f)){_0x4b2e4f[_0x2203('0x3e')](function(_0x3e1583){if(_0x3e1583===_0x2203('0x78')){_0x3f335a['where']('i.ChatWebsiteId\x20IN\x20?',[][_0x2203('0x79')](_0x5b4842[_0x2203('0x45')][_0x3e1583]));}else if(_0x3e1583===_0x2203('0x7a')){var _0x484549=JSON['parse'](_0x5b4842['query'][_0x3e1583])[_0x2203('0x7b')];var _0x2d26ba=JSON[_0x2203('0x7c')](_0x5b4842[_0x2203('0x45')][_0x3e1583])['$lte'];_0x3f335a[_0x2203('0x7d')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x484549,_0x2d26ba);}else{if(_0x5b4842[_0x2203('0x45')][_0x3e1583]===_0x2203('0x7e')){_0x3f335a[_0x2203('0x7d')]('i.'+_0x3e1583+_0x2203('0x7f'));}else{_0x3f335a[_0x2203('0x7d')]('i.'+_0x3e1583+'\x20=\x20?',_0x5b4842[_0x2203('0x45')][_0x3e1583]);}}});}if(_0x5b4842[_0x2203('0x45')][_0x2203('0x80')]){if(_0x5b4842['query'][_0x2203('0x80')]==0x1){_0x3f335a[_0x2203('0x64')](_0x2203('0x81'));}else{_0x3f335a[_0x2203('0x64')](_0x2203('0x82'));}}if(_0x5b4842[_0x2203('0x45')][_0x2203('0x83')]){_0x2baea2=_[_0x2203('0x84')](_0x5b4842[_0x2203('0x45')][_0x2203('0x83')])?_0x5b4842[_0x2203('0x45')]['tag']:new Array(_0x5b4842[_0x2203('0x45')][_0x2203('0x83')]);_0x2baea2[_0x2203('0x3e')](function(_0x2da37c){_0x91f70c['or'](_0x2203('0x85'),'%,'+_0x2da37c+',%');});}if(_0x5b4842[_0x2203('0x45')][_0x2203('0x86')]){var _0x2a5a4b=_0x5b4842[_0x2203('0x45')][_0x2203('0x86')][_0x2203('0x87')]('\x5c','\x5c\x5c')[_0x2203('0x87')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x2a5a4b)){_0x26d3d9['or']('i.id\x20LIKE\x20?',_0x2a5a4b+'%');}else{_0x26d3d9['or'](_0x2203('0x88'),qs[_0x2203('0x6c')](_0x2a5a4b))['or'](_0x2203('0x89'),_0x2a5a4b+'%');}}}_0x3f335a[_0x2203('0x7d')](_0x26d3d9);_0x3f335a[_0x2203('0x8a')]('i.id');var _0x16e518={'type':db[_0x2203('0x8b')]['QueryTypes']['SELECT'],'raw':!![]};var _0x4edac6=_0x3f335a['clone']();_0x4edac6['field'](_0x2203('0x8c'));_0x4edac6[_0x2203('0x4f')](_0x2203('0x8d'),'unreadMessages');if(_0x36b8e4['order']){_0x36b8e4['order'][_0x2203('0x3e')](function(_0x1e90c4){var _0x15d061=_0x1e90c4[0x0]===_0x2203('0x8e')?_0x1e90c4[0x0]:'i.'+_0x1e90c4[0x0];_0x3f335a[_0x2203('0x4c')](_0x15d061,_0x1e90c4[0x1]===_0x2203('0x8f')?![]:!![]);});}if(!_[_0x2203('0x77')](_0x2baea2)){_0x3f335a['having'](_0x91f70c);_0x4edac6[_0x2203('0x7d')](_0x2203('0x90'),_0x2baea2);}BPromise[_0x2203('0x91')]()[_0x2203('0x1d')](function(){if(!_0x216641){if(_0x5b4842[_0x2203('0x45')][_0x2203('0x78')])return;_0x4edac6[_0x2203('0x7d')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x3f335a[_0x2203('0x7d')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x5b4842['user'][_0x2203('0x92')]!=='agent')return;return _0x5b4842[_0x2203('0x93')][_0x2203('0x94')]({'attributes':['id'],'raw':!![]})['then'](function(_0x29d545){if(_[_0x2203('0x77')](_0x29d545)){_0x4edac6[_0x2203('0x7d')](_0x2203('0x95'));_0x3f335a[_0x2203('0x7d')](_0x2203('0x95'));}else{_0x4edac6['where'](_0x2203('0x96'),_[_0x2203('0x3b')](_0x29d545,'id'));_0x3f335a['where']('i.ChatWebsiteId\x20IN\x20?',_[_0x2203('0x3b')](_0x29d545,'id'));}});})[_0x2203('0x1d')](function(){if(_0x5b4842[_0x2203('0x93')][_0x2203('0x92')]===_0x2203('0x39')&&!_0x216641&&!_0x5b4842[_0x2203('0x45')][_0x2203('0x78')])return[];return db[_0x2203('0x97')][_0x2203('0x45')](_0x4edac6[_0x2203('0x98')](),_0x16e518);})[_0x2203('0x1d')](function(_0x413729){_0x595281[_0x2203('0x2e')]=_0x413729[_0x2203('0x49')];if(_0x595281[_0x2203('0x2e')]===0x0)return[];return db[_0x2203('0x97')]['query'](_0x4de47a['toString'](),_0x16e518)[_0x2203('0x1d')](function(_0x1295a3){_0x559370=_['keyBy'](_0x1295a3,'id');_0x16e518=_[_0x2203('0x36')](_0x16e518,{'model':db[_0x2203('0x41')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5b4842['query'][_0x2203('0x99')]){_0x36b8e4[_0x2203('0x47')]['forEach'](function(_0x21f357){_0x3f335a[_0x2203('0x4f')]('i.'+_0x21f357);});}else{_0x3f335a['field'](_0x2203('0x8d'),_0x2203('0x62'));_0x3f335a[_0x2203('0x4f')](_0x2203('0x9a'),'Account.key');_0x3f335a['field'](_0x2203('0x9b'),_0x2203('0x9c'));_0x3f335a[_0x2203('0x4f')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x3f335a[_0x2203('0x4f')](_0x2203('0x9d'));_0x3f335a[_0x2203('0x4f')]('c.firstName','Contact.firstName');_0x3f335a[_0x2203('0x4f')](_0x2203('0x9e'),'Contact.lastName');_0x3f335a[_0x2203('0x4f')](_0x2203('0x9f'),'Contact.email');_0x3f335a[_0x2203('0x4f')]('c.phone',_0x2203('0xa0'));_0x3f335a['field']('c.mobile','Contact.mobile');_0x3f335a[_0x2203('0x4f')](_0x2203('0xa1'),'Contact.fax');_0x3f335a[_0x2203('0x4f')](_0x2203('0xa2'),_0x2203('0xa3'));_0x3f335a['field'](_0x2203('0xa4'),'Owner.internal');_0x3f335a[_0x2203('0x4f')](_0x2203('0xa5'),'TagIds');}if(_0x36b8e4[_0x2203('0x2d')])_0x3f335a[_0x2203('0x2d')](_0x36b8e4['limit']);if(_0x36b8e4[_0x2203('0x2b')])_0x3f335a[_0x2203('0x2b')](_0x36b8e4[_0x2203('0x2b')]);return db[_0x2203('0x97')][_0x2203('0x45')](_0x3f335a['toString'](),_0x16e518);})[_0x2203('0x1d')](function(_0x1b5185){if(_0x1b5185[_0x2203('0x49')]>0x0)_0xb47204[_0x2203('0x7d')](_0x2203('0xa6'),_[_0x2203('0x3b')](_0x1b5185,'id'));return db['sequelize'][_0x2203('0x45')](_0xb47204[_0x2203('0x98')](),_0x16e518)['then'](function(_0x13fc7b){var _0x5e0bff=_[_0x2203('0xa7')](_0x13fc7b,_0x2203('0xa8'));var _0xc611e8=[];_0x1b5185['forEach'](function(_0xab7f0b){_0xc611e8[_0x2203('0xa9')](updateChatInteraction(_0xab7f0b,_0x559370,_0x5e0bff));});return BPromise[_0x2203('0xaa')](_0xc611e8);});});})[_0x2203('0x1d')](function(_0x2c275f){_0x595281[_0x2203('0xab')]=_0x2c275f;return _0x595281;})[_0x2203('0x1d')](respondWithFilteredResult(_0x23a6e8,_0x36b8e4))['catch'](handleError(_0x23a6e8,null));};exports['show']=function(_0x106534,_0x41eb4c){var _0x25996c={'raw':![],'where':{'id':_0x106534[_0x2203('0xac')]['id']}},_0x4e1f55={};_0x4e1f55[_0x2203('0x44')]=_[_0x2203('0xad')](db['ChatInteraction'][_0x2203('0x42')]);_0x4e1f55[_0x2203('0x45')]=_['keys'](_0x106534[_0x2203('0x45')]);_0x4e1f55['filters']=_[_0x2203('0x48')](_0x4e1f55[_0x2203('0x44')],_0x4e1f55['query']);_0x25996c[_0x2203('0x47')]=_[_0x2203('0x48')](_0x4e1f55[_0x2203('0x44')],qs[_0x2203('0x99')](_0x106534[_0x2203('0x45')][_0x2203('0x99')]));_0x25996c[_0x2203('0x47')]=_0x25996c[_0x2203('0x47')][_0x2203('0x49')]?_0x25996c[_0x2203('0x47')]:_0x4e1f55[_0x2203('0x44')];if(_0x106534[_0x2203('0x45')]['includeAll']){_0x25996c[_0x2203('0xae')]=[{'all':!![]}];}_0x25996c=_['merge']({},_0x25996c,_0x106534[_0x2203('0xaf')]);return db[_0x2203('0x41')][_0x2203('0x61')](_0x25996c)[_0x2203('0x1d')](handleEntityNotFound(_0x41eb4c,null))[_0x2203('0x1d')](respondWithResult(_0x41eb4c,null))[_0x2203('0x27')](handleError(_0x41eb4c,null));};exports[_0x2203('0xb0')]=function(_0x8f9f98,_0x36205d){return db[_0x2203('0x41')][_0x2203('0xb0')](_0x8f9f98['body'],{})[_0x2203('0x1d')](respondWithResult(_0x36205d,0xc9))['catch'](handleError(_0x36205d,null));};exports[_0x2203('0x31')]=function(_0x3deb3b,_0x6b8ea4){if(_0x3deb3b['body']['id']){delete _0x3deb3b[_0x2203('0x37')]['id'];}return db[_0x2203('0x41')][_0x2203('0x61')]({'where':{'id':_0x3deb3b[_0x2203('0xac')]['id']}})[_0x2203('0x1d')](handleEntityNotFound(_0x6b8ea4,null))['then'](saveUpdates(_0x3deb3b[_0x2203('0x37')],null))['then'](respondWithResult(_0x6b8ea4,null))[_0x2203('0x27')](handleError(_0x6b8ea4,null));};exports[_0x2203('0x32')]=function(_0x5f5270,_0x376954){return db[_0x2203('0x41')][_0x2203('0x61')]({'where':{'id':_0x5f5270[_0x2203('0xac')]['id']}})['then'](handleEntityNotFound(_0x376954,null))[_0x2203('0x1d')](removeEntity(_0x376954,null))['catch'](handleError(_0x376954,null));};exports['describe']=function(_0x4055eb,_0x95b45a){return db[_0x2203('0x41')][_0x2203('0xb1')]()[_0x2203('0x1d')](respondWithResult(_0x95b45a,null))[_0x2203('0x27')](handleError(_0x95b45a,null));};exports[_0x2203('0xb2')]=function(_0x4b6d6f,_0xb40f2b){var _0x4769ee=_0x4b6d6f[_0x2203('0xac')]['id'];var _0x492179;var _0x4fc1cc;var _0x4d6ece;return db[_0x2203('0x41')][_0x2203('0xb3')]({'where':{'id':_0x4769ee}})[_0x2203('0x1d')](function(_0x2d1ee6){_0x492179=_0x2d1ee6;return db['ChatWebsite'][_0x2203('0xb3')]({'where':{'id':_0x2d1ee6[_0x2203('0x78')]},'attributes':['id',_0x2203('0xb4'),_0x2203('0xb5'),'vidaooTopic','vidaooNote',_0x2203('0xb6')],'raw':!![]});})[_0x2203('0x1d')](function(_0x1ed416){if(_0x1ed416&&_0x1ed416['vidaooApiKey']&&_0x1ed416[_0x2203('0xb5')]){_0x4fc1cc=_0x1ed416;var _0x28bf0a={'interaction':{'id':_0x4769ee},'agent':{'id':_0x4b6d6f[_0x2203('0x93')]['id'],'name':_0x4b6d6f[_0x2203('0x93')][_0x2203('0x34')],'fullname':_0x4b6d6f[_0x2203('0x93')][_0x2203('0x3c')],'email':_0x4b6d6f['user'][_0x2203('0xb7')]},'contact':_0x4b6d6f[_0x2203('0x37')][_0x2203('0x38')],'account':_0x4b6d6f[_0x2203('0x37')][_0x2203('0xb8')]};var _0x4457c9={'rejectUnauthorized':![],'method':_0x2203('0xb9'),'url':_0x2203('0xba'),'headers':{'X-APIKEY':_0x1ed416[_0x2203('0xb4')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4b6d6f['user'][_0x2203('0xb7')]],'buttons':null,'topic':_0x4fc1cc[_0x2203('0xbb')],'note':_[_0x2203('0xbc')](_0x4fc1cc[_0x2203('0xbd')])?null:getMustacheRender(_0x4fc1cc['vidaooNote'],_0x28bf0a),'metadata':null},'redirect':_0x2203('0xbe'),'json':!![]};try{if(!_[_0x2203('0xbc')](_0x4fc1cc[_0x2203('0xb6')])){var _0x19ef05=getMustacheRender(_0x4fc1cc[_0x2203('0xb6')],_0x28bf0a);var _0x3f3062=JSON[_0x2203('0x7c')](_0x19ef05);_0x4457c9[_0x2203('0x37')][_0x2203('0xbf')]=_0x3f3062;}}catch(_0x597e49){throw new db['Sequelize'][(_0x2203('0xc0'))](_0x2203('0xc1'));}return rp(_0x4457c9);}else{throw new db[(_0x2203('0x8b'))][(_0x2203('0xc0'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x2203('0x1d')](function(_0x289cde){_0x4d6ece=_0x289cde;if(_0x4d6ece['id']){var _0x5d5e8e={'body':_0x4d6ece[_0x2203('0xc2')],'ChatWebsiteId':_0x4fc1cc['id'],'ChatInteractionId':_0x492179['id'],'direction':_0x2203('0xc3'),'UserId':_0x4b6d6f[_0x2203('0x93')]['id']};return db[_0x2203('0xc4')]['create'](_0x5d5e8e,{});}else{throw new db[(_0x2203('0x8b'))][(_0x2203('0xc0'))](_0x2203('0xc5'));}})['then'](function(){return _0x492179[_0x2203('0xc6')]({'vidaooSessionId':_0x4d6ece['id']});})[_0x2203('0x1d')](respondWithResult(_0xb40f2b,null))[_0x2203('0x27')](handleError(_0xb40f2b,null));};exports['customUpdate']=function(_0x590035,_0x207c86){if(_0x590035[_0x2203('0x37')]['id']){delete _0x590035[_0x2203('0x37')]['id'];}return db[_0x2203('0x41')]['find']({'where':{'id':_0x590035[_0x2203('0xac')]['id']},'include':[{'model':db[_0x2203('0xc7')],'as':_0x2203('0x67')}]})['then'](handleEntityNotFound(_0x207c86,null))['then'](saveUpdates(_0x590035[_0x2203('0x37')],null))[_0x2203('0x1d')](respondWithResult(_0x207c86,null))[_0x2203('0x27')](handleError(_0x207c86,null));};exports[_0x2203('0xc8')]=function(_0x401831,_0x410894,_0x2b0d0b){if(_0x401831[_0x2203('0x37')]['id']){delete _0x401831[_0x2203('0x37')]['id'];}return db[_0x2203('0x41')][_0x2203('0x61')]({'where':{'id':_0x401831['params']['id']}})[_0x2203('0x1d')](function(_0x5edebd){if(!_0x5edebd){logger[_0x2203('0x23')](_0x2203('0xc9'),_0x2203('0xc8'),0x194,_0x2203('0xca'));_0x410894[_0x2203('0x28')](0x194);}else{if(_0x5edebd['UserId']){throw new db[(_0x2203('0x8b'))][(_0x2203('0xc0'))](_0x2203('0xcb'));}}return _0x5edebd;})['then'](function(_0xe9cd8f){if(_0xe9cd8f){return _0xe9cd8f[_0x2203('0x31')]({'closed':_0x401831[_0x2203('0x37')][_0x2203('0xcc')],'disposition':_0x401831['body'][_0x2203('0xcd')]})[_0x2203('0x1d')](function(_0x4508c3){return _0x4508c3;});}})[_0x2203('0x1d')](function(_0x4e3ea8){return respondWithRpcPromise(_0x2203('0xce'),_0x2203('0xc8'),_0x401831['body'],client9004);})[_0x2203('0x1d')](respondWithResult(_0x410894,null))[_0x2203('0x27')](handleError(_0x410894,null));};exports['attachmentUpload']=function(_0x5cb5be,_0x54f1a1,_0x5d21eb){_0x5cb5be[_0x2203('0x37')]['name']=_0x5cb5be[_0x2203('0xcf')]['originalname'];_0x5cb5be['body'][_0x2203('0xd0')]=_0x5cb5be['file'][_0x2203('0xd1')];_0x5cb5be['body'][_0x2203('0x43')]=_0x5cb5be[_0x2203('0xcf')][_0x2203('0xd2')];return db[_0x2203('0xd3')][_0x2203('0xb0')](_0x5cb5be[_0x2203('0x37')])[_0x2203('0x1d')](respondWithResult(_0x54f1a1,0xc9))[_0x2203('0x27')](handleError(_0x54f1a1,null));};exports[_0x2203('0xd4')]=function(_0xabe2eb,_0x453179,_0x359968){return db['ChatInteraction'][_0x2203('0xb3')]({'where':{'id':_0xabe2eb[_0x2203('0xac')]['id']},'raw':!![]})[_0x2203('0x1d')](handleEntityNotFound(_0x453179,null))[_0x2203('0x1d')](function(_0x3d2ba9){if(_0x3d2ba9){if(_0x3d2ba9[_0x2203('0xcc')]){return _0x453179['status'](0x193)[_0x2203('0x2a')]({'status':0x193,'message':_0x2203('0xd5')});}return db[_0x2203('0xd3')][_0x2203('0xb3')]({'where':{'id':_0xabe2eb[_0x2203('0x45')][_0x2203('0xd6')]},'raw':!![]})['then'](handleEntityNotFound(_0x453179,null));}})[_0x2203('0x1d')](function(_0x5a9d4e){if(_0x5a9d4e){var _0x3217a3=_0x5a9d4e['ChatOfflineMessageId']!==null;var _0x219e9d=path[_0x2203('0xd7')](config[_0x2203('0xd8')],_0x2203('0xd9'));if(_0x3217a3){_0x219e9d=path['join'](_0x219e9d,_0x2203('0xda'));}var _0x4598cb=path[_0x2203('0xd7')](_0x219e9d,_0x5a9d4e[_0x2203('0xd0')]);return _0x453179[_0x2203('0xdb')](_0x4598cb);}})[_0x2203('0x27')](handleError(_0x453179,null));};exports[_0x2203('0xdc')]=function(_0x38fb99,_0x5bcf17){var _0x581d9f=null;var _0x5ddb1a=null;var _0x358ab1=null;var _0x5b8c97=null;if(_0x38fb99[_0x2203('0x37')]['id']){delete _0x38fb99[_0x2203('0x37')]['id'];}if(_0x38fb99['body']['mailTranscript']){_0x5b8c97=path[_0x2203('0xd7')](config[_0x2203('0xd8')],'server/files/chat/upload/',util[_0x2203('0xdd')](_0x2203('0xde'),Date[_0x2203('0xdf')]()));_0x38fb99['body'][_0x2203('0xe0')]=_0x5b8c97;}return db['ChatInteraction'][_0x2203('0x61')]({'where':{'id':_0x38fb99['params']['id']},'include':[{'model':db[_0x2203('0xc4')],'as':_0x2203('0xe1'),'include':[{'model':db[_0x2203('0xe2')],'as':_0x2203('0xe2')}]}]})['then'](handleEntityNotFound(_0x5bcf17,null))[_0x2203('0x1d')](saveUpdates(_0x38fb99['body'],null))[_0x2203('0x1d')](function(_0x5f098d){if(_0x5f098d){_0x581d9f=_0x5f098d;return db[_0x2203('0xe3')][_0x2203('0x61')]({'where':{'id':_0x581d9f[_0x2203('0x78')]}});}})[_0x2203('0x1d')](function(_0x5c2159){if(_0x5c2159){_0x358ab1=_0x5c2159;return db[_0x2203('0xc7')][_0x2203('0x61')]({'where':{'id':_0x581d9f[_0x2203('0x6e')]}});}})[_0x2203('0x1d')](function(_0x23daeb){if(_0x23daeb){_0x5ddb1a=_0x23daeb;if(_0x5b8c97){var _0x2ad175=null;for(var _0x3ca475=0x1;_0x3ca475<_0x581d9f[_0x2203('0xe1')][_0x2203('0x49')];++_0x3ca475){_0x2ad175=_0x581d9f[_0x2203('0xe1')][_0x3ca475];var _0x199849=_0x2ad175[_0x2203('0x74')]?util[_0x2203('0xdd')](_0x2203('0xe4'),_0x358ab1[_0x2203('0xe5')],_0x2ad175['UserId']):'System';var _0x4cf298=_0x38fb99[_0x2203('0x37')][_0x2203('0xe6')]||util[_0x2203('0xdd')](_0x2203('0xe4'),_0x2203('0xe7'),_0x2ad175[_0x2203('0x6e')]);switch(_0x358ab1['agentIdentifier']){case _0x2203('0xe8'):_0x199849=_0x2ad175[_0x2203('0x74')]?util['format']('%s%d',_0x358ab1[_0x2203('0xe5')],_0x2ad175['UserId']):_0x2203('0xe9');break;case _0x2203('0xea'):_0x199849=_0x2ad175['UserId']?_0x2ad175[_0x2203('0xe2')][_0x2203('0xeb')]||_0x2ad175['User'][_0x2203('0x3c')]:'System';break;case _0x2203('0xec'):_0x199849=_0x2ad175[_0x2203('0x74')]?_0x2ad175[_0x2203('0xe2')]['fullname']:_0x2203('0xe9');break;default:_0x199849=_0x2ad175[_0x2203('0x74')]?util[_0x2203('0xdd')](_0x2203('0xe4'),_0x358ab1[_0x2203('0xe5')],_0x2ad175['UserId']):_0x2203('0xe9');}var _0x20f50b=util[_0x2203('0xdd')](_0x2203('0xed'),moment(_0x2ad175['createdAt'])[_0x2203('0xdd')](_0x2203('0xee')),_0x2ad175[_0x2203('0xef')]==='in'?_0x4cf298:_0x199849,_0x2ad175[_0x2203('0x37')]);if(!_0x2ad175[_0x2203('0xf0')]){fs['appendFileSync'](_0x5b8c97,_0x20f50b);}}return db[_0x2203('0xf1')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x2203('0xf2')],'as':_0x2203('0xf3'),'raw':!![]}]});}}})[_0x2203('0x1d')](function(_0x16686c){if(_0x16686c&&_0x16686c['Smtp']&&_0x38fb99[_0x2203('0x37')]){var _0x21dfbc={'tls':{'rejectUnauthorized':![]}};if(_0x16686c[_0x2203('0xf3')][_0x2203('0xf4')]){_0x21dfbc[_0x2203('0xf4')]=_0x16686c[_0x2203('0xf3')][_0x2203('0xf4')];}else{_0x21dfbc[_0x2203('0xf5')]=_0x16686c[_0x2203('0xf3')][_0x2203('0xf5')];_0x21dfbc[_0x2203('0xf6')]=_0x16686c[_0x2203('0xf3')][_0x2203('0xf6')];_0x21dfbc[_0x2203('0xf7')]=_0x16686c[_0x2203('0xf3')][_0x2203('0xf7')];}if(_0x16686c['Smtp']['authentication']){_0x21dfbc['auth']={'user':_0x16686c[_0x2203('0xf3')][_0x2203('0x93')],'pass':_0x16686c[_0x2203('0xf3')]['pass']};}return respondWithRpcPromise(_0x2203('0xf8'),_0x2203('0xf9'),{'account':_0x21dfbc,'message':{'from':util[_0x2203('0xdd')](_0x2203('0xfa'),_0x16686c[_0x2203('0x34')],_0x16686c['email']||_0x16686c[_0x2203('0xf3')][_0x2203('0x93')]),'to':_0x38fb99[_0x2203('0x37')][_0x2203('0xfb')],'subject':_0x2203('0xfc'),'text':util['format'](_0x2203('0xfd'),_0x38fb99[_0x2203('0x37')]['mailTranscript']),'attachments':[{'path':_0x5b8c97}]}})['then'](function(){return _0x581d9f;})[_0x2203('0x27')](function(_0xfd2832){console[_0x2203('0x23')](_0xfd2832);});}else{return _0x581d9f;}})[_0x2203('0x1d')](respondWithStatusCode(_0x5bcf17,0xc8))[_0x2203('0x27')](handleError(_0x5bcf17,null));};exports[_0x2203('0xfe')]=function(_0x50d583,_0x5f01c0,_0x30df28){return db[_0x2203('0xc4')][_0x2203('0x61')]({'where':{'id':_0x50d583[_0x2203('0xac')]['id']}})['then'](handleEntityNotFound(_0x5f01c0,null))[_0x2203('0x1d')](function(_0x3fa96f){if(_0x3fa96f){return _0x3fa96f['addMessage'](_0x50d583[_0x2203('0x37')]['ids'],_[_0x2203('0xff')](_0x50d583[_0x2203('0x37')],['ids','id'])||{});}})['then'](respondWithResult(_0x5f01c0,null))[_0x2203('0x27')](handleError(_0x5f01c0,null));};exports[_0x2203('0x100')]=function(_0x4dccbf,_0x2bc31c,_0x5807ef){var _0x45a460={'raw':![],'where':{}};var _0x59eb03={};var _0x2964d7={'count':0x0,'rows':[]};return db[_0x2203('0x41')][_0x2203('0xb3')]({'where':{'id':_0x4dccbf['params']['id']}})[_0x2203('0x1d')](handleEntityNotFound(_0x2bc31c,null))[_0x2203('0x1d')](function(_0x46d93b){if(_0x46d93b){_0x59eb03[_0x2203('0x44')]=_[_0x2203('0xad')](db[_0x2203('0xc4')][_0x2203('0x42')]);_0x59eb03[_0x2203('0x45')]=_[_0x2203('0xad')](_0x4dccbf[_0x2203('0x45')]);_0x59eb03['filters']=_[_0x2203('0x48')](_0x59eb03['model'],_0x59eb03[_0x2203('0x45')]);_0x45a460[_0x2203('0x47')]=_[_0x2203('0x48')](_0x59eb03[_0x2203('0x44')],qs['fields'](_0x4dccbf['query'][_0x2203('0x99')]));_0x45a460['attributes']=_0x45a460[_0x2203('0x47')]['length']?_0x45a460[_0x2203('0x47')]:_0x59eb03['model'];if(!_0x4dccbf['query'][_0x2203('0x4a')](_0x2203('0x4b'))){_0x45a460['limit']=qs[_0x2203('0x2d')](_0x4dccbf[_0x2203('0x45')][_0x2203('0x2d')]);_0x45a460[_0x2203('0x2b')]=qs[_0x2203('0x2b')](_0x4dccbf[_0x2203('0x45')][_0x2203('0x2b')]);}_0x45a460['order']=qs[_0x2203('0x4d')](_0x4dccbf[_0x2203('0x45')][_0x2203('0x4d')]);_0x45a460[_0x2203('0x7d')]=qs[_0x2203('0x46')](_[_0x2203('0x4e')](_0x4dccbf[_0x2203('0x45')],_0x59eb03[_0x2203('0x46')]));_0x45a460[_0x2203('0x7d')][_0x2203('0xa8')]=_0x46d93b['id'];if(_0x4dccbf['query'][_0x2203('0x86')]){_0x45a460[_0x2203('0x7d')]=_[_0x2203('0x36')](_0x45a460[_0x2203('0x7d')],{'$or':_[_0x2203('0x3b')](_0x45a460[_0x2203('0x47')],function(_0x36d988){var _0x36141a={};_0x36141a[_0x36d988]={'$like':'%'+_0x4dccbf[_0x2203('0x45')][_0x2203('0x86')]+'%'};return _0x36141a;})});}if(_0x4dccbf[_0x2203('0x45')][_0x2203('0x7b')]){var _0x2c7cc8=_0x4dccbf['query'][_0x2203('0x7b')][_0x2203('0x6a')](',');var _0x481a3e={};_0x481a3e[_0x2c7cc8[0x0]]={'$gte':moment(_0x2c7cc8[0x1])[_0x2203('0xdd')](_0x2203('0x101'))};_0x45a460[_0x2203('0x7d')]=_[_0x2203('0x36')](_0x45a460[_0x2203('0x7d')],_0x481a3e);}_0x45a460=_[_0x2203('0x36')]({},_0x45a460,_0x4dccbf[_0x2203('0xaf')]);return db[_0x2203('0xc4')][_0x2203('0x2e')]({'where':_0x45a460['where']})[_0x2203('0x1d')](function(_0x2485d3){_0x2964d7[_0x2203('0x2e')]=_0x2485d3;if(_0x4dccbf[_0x2203('0x45')][_0x2203('0x102')]){_0x45a460[_0x2203('0xae')]=[{'all':!![]}];}return db[_0x2203('0xc4')][_0x2203('0x103')](_0x45a460);})['then'](function(_0xc53b76){_0x2964d7['rows']=_0xc53b76;return _0x2964d7;});}})[_0x2203('0x1d')](respondWithFilteredResult(_0x2bc31c,_0x45a460))['catch'](handleError(_0x2bc31c,null));};exports[_0x2203('0x104')]=function(_0x581c4f,_0x3c279b,_0x4031b7){var _0xa9cf5a={'where':{}},_0x135b65={},_0x3c4bc3={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x2203('0xb3')]({'where':{'id':_0x581c4f[_0x2203('0xac')]['id']}})[_0x2203('0x1d')](handleEntityNotFound(_0x3c279b,null))[_0x2203('0x1d')](function(_0x203956){if(_0x203956){_0x135b65[_0x2203('0x44')]=_[_0x2203('0xad')](db[_0x2203('0xc4')]['rawAttributes']);_0x135b65['query']=_['keys'](_0x581c4f[_0x2203('0x45')]);_0x135b65['filters']=_['intersection'](_0x135b65[_0x2203('0x44')],_0x135b65[_0x2203('0x45')]);_0xa9cf5a['attributes']=_['intersection'](_0x135b65[_0x2203('0x44')],qs[_0x2203('0x99')](_0x581c4f[_0x2203('0x45')]['fields']));_0xa9cf5a[_0x2203('0x47')]=_0xa9cf5a[_0x2203('0x47')][_0x2203('0x49')]?_0xa9cf5a[_0x2203('0x47')]:_0x135b65[_0x2203('0x44')];if(!_0x581c4f[_0x2203('0x45')]['hasOwnProperty'](_0x2203('0x4b'))){_0xa9cf5a['limit']=qs[_0x2203('0x2d')](_0x581c4f[_0x2203('0x45')][_0x2203('0x2d')]);_0xa9cf5a[_0x2203('0x2b')]=qs[_0x2203('0x2b')](_0x581c4f[_0x2203('0x45')][_0x2203('0x2b')]);}_0xa9cf5a['order']=qs[_0x2203('0x4d')](_0x581c4f[_0x2203('0x45')]['sort']);_0xa9cf5a[_0x2203('0x7d')]=qs[_0x2203('0x46')](_[_0x2203('0x4e')](_0x581c4f[_0x2203('0x45')],_0x135b65[_0x2203('0x46')]));_0xa9cf5a[_0x2203('0x7d')][_0x2203('0xa8')]=_0x203956['id'];if(_0x581c4f[_0x2203('0x45')][_0x2203('0x86')]){_0xa9cf5a[_0x2203('0x7d')]=_['merge'](_0xa9cf5a[_0x2203('0x7d')],{'$or':_[_0x2203('0x3b')](_0xa9cf5a[_0x2203('0x47')],function(_0x4a6a84){var _0x361282={};_0x361282[_0x4a6a84]={'$like':'%'+_0x581c4f[_0x2203('0x45')][_0x2203('0x86')]+'%'};return _0x361282;})});}_0xa9cf5a[_0x2203('0x7d')][_0x2203('0xf0')]=![];if(_0x581c4f[_0x2203('0x45')]['id']){_0xa9cf5a[_0x2203('0x7d')]['id']={'$gt':_0x581c4f[_0x2203('0x45')]['id']};}_0xa9cf5a=_[_0x2203('0x36')]({},_0xa9cf5a,_0x581c4f[_0x2203('0xaf')]);return db[_0x2203('0xc4')]['count']({'where':_0xa9cf5a[_0x2203('0x7d')]})[_0x2203('0x1d')](function(_0x554450){_0x3c4bc3[_0x2203('0x2e')]=_0x554450;_0xa9cf5a[_0x2203('0xae')]=[];if(_0x581c4f[_0x2203('0x45')][_0x2203('0x105')]){_0xa9cf5a[_0x2203('0xae')][_0x2203('0xa9')]({'model':db[_0x2203('0xe2')],'as':_0x2203('0xe2'),'attributes':['id',_0x2203('0x3c'),'alias']});}if(_0x581c4f[_0x2203('0x45')][_0x2203('0x102')]){_0xa9cf5a['include']=[{'all':!![]}];}return db[_0x2203('0xc4')][_0x2203('0x103')](_0xa9cf5a);})[_0x2203('0x1d')](function(_0x291aef){_0x3c4bc3[_0x2203('0xab')]=_0x291aef;return _0x3c4bc3;});}})[_0x2203('0x1d')](respondWithFilteredResult(_0x3c279b,_0xa9cf5a))[_0x2203('0x27')](handleError(_0x3c279b,null));};exports[_0x2203('0x106')]=function(_0x3e2390,_0x44d30c,_0x46c088){return db[_0x2203('0x41')][_0x2203('0x61')]({'where':{'id':_0x3e2390[_0x2203('0xac')]['id']}})[_0x2203('0x1d')](handleEntityNotFound(_0x44d30c,null))['then'](function(_0x42669a){if(_0x42669a){return _0x42669a['setTags'](_0x3e2390['body'][_0x2203('0x107')],_['omit'](_0x3e2390['body'],['ids','id'])||{})['spread'](function(){return db[_0x2203('0x72')][_0x2203('0x103')]({'attributes':['id',_0x2203('0x34'),_0x2203('0x50')],'where':{'id':_0x3e2390['body'][_0x2203('0x107')]}});})[_0x2203('0x1d')](function(_0x44ff9f){socket['emit']('chatInteractionTags:save',{'id':Number(_0x3e2390[_0x2203('0xac')]['id']),'tags':_0x44ff9f||[]});return{'id':Number(_0x3e2390[_0x2203('0xac')]['id']),'tags':_0x44ff9f||[]};});}})[_0x2203('0x1d')](respondWithResult(_0x44d30c,null))[_0x2203('0x27')](handleError(_0x44d30c,null));};exports[_0x2203('0x108')]=function(_0x2c0df7,_0xdd4efc,_0x2481f5){return db[_0x2203('0x41')][_0x2203('0x61')]({'where':{'id':_0x2c0df7[_0x2203('0xac')]['id']}})['then'](handleEntityNotFound(_0xdd4efc,null))['then'](function(_0x135655){if(_0x135655){return _0x135655[_0x2203('0x108')](_0x2c0df7[_0x2203('0x45')][_0x2203('0x107')]);}})['then'](respondWithStatusCode(_0xdd4efc,null))[_0x2203('0x27')](handleError(_0xdd4efc,null));};exports[_0x2203('0xdb')]=function(_0x4718f4,_0x5b771e){var _0x3dd02d=moment()[_0x2203('0x109')]()[_0x2203('0x98')]();var _0x552a73=path[_0x2203('0xd7')](config['root'],_0x2203('0x10a'),_0x2203('0x10b'),_0x2203('0x10c'));var _0x2111b4=path[_0x2203('0xd7')](config[_0x2203('0xd8')],_0x2203('0x10a'),_0x2203('0x10b'),_0x2203('0x10d'));var _0x20a488=path[_0x2203('0xd7')](_0x552a73,_0x3dd02d);var _0x505c2a=util[_0x2203('0xdd')](_0x2203('0x10e'),_0x4718f4[_0x2203('0xac')]['id'],_0x3dd02d);var _0x44ae18=path[_0x2203('0xd7')](_0x552a73,_0x505c2a);var _0x3fbe4c=[];_0x3fbe4c[_0x2203('0xa9')]({'model':db[_0x2203('0xe2')],'as':_0x2203('0xe2'),'attributes':['id',_0x2203('0x3c')],'raw':!![]});_0x3fbe4c[_0x2203('0xa9')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x2203('0x10f'),_0x2203('0x110')],'raw':!![]});if(_0x4718f4[_0x2203('0x45')][_0x2203('0x10d')]){_0x3fbe4c[_0x2203('0xa9')]({'model':db[_0x2203('0xd3')],'as':_0x2203('0xd3'),'raw':!![]});}var _0x10081d=[{'model':db[_0x2203('0xc4')],'as':_0x2203('0xe1'),'attributes':['id',_0x2203('0x37'),_0x2203('0x7a'),'direction','secret',_0x2203('0x80')],'include':_0x3fbe4c}];_0x10081d['push']({'model':db['ChatWebsite'],'as':_0x2203('0x111'),'attributes':['id','name']});_0x10081d[_0x2203('0xa9')]({'model':db[_0x2203('0xe2')],'as':_0x2203('0x112'),'attributes':['id',_0x2203('0x3c')]});return db[_0x2203('0x41')][_0x2203('0x61')]({'where':{'id':_0x4718f4[_0x2203('0xac')]['id']},'include':_0x10081d})[_0x2203('0x1d')](handleEntityNotFound(_0x5b771e,null))[_0x2203('0x1d')](function(_0x51dbc8){if(_0x51dbc8){var _0xd584ee=_0x51dbc8['get']({'plain':!![]});fs[_0x2203('0x113')](_0x20a488);var _0x1c36d4={'channel':_0x2203('0x114'),'account':_0xd584ee[_0x2203('0x111')][_0x2203('0x34')],'agent':_0xd584ee['Owner']?_0xd584ee[_0x2203('0x112')]['fullname']:_0x2203('0x115'),'createdAt':moment(_0xd584ee['createdAt'])['format'](_0x2203('0x101'))[_0x2203('0x98')](),'closedAt':_0xd584ee[_0x2203('0xcc')]?moment(_0xd584ee[_0x2203('0x116')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x2203('0x98')]():'','disposition':_0xd584ee[_0x2203('0xcd')],'chatInfo':{'browser':_0xd584ee[_0x2203('0x117')],'os':_0xd584ee['osName'],'referer':_0xd584ee['referer'],'customerIp':_0xd584ee[_0x2203('0x118')],'customerPort':_0xd584ee[_0x2203('0x119')]?_0xd584ee[_0x2203('0x119')]:_0x2203('0x115')},'messages':_(_0xd584ee[_0x2203('0xe1')])[_0x2203('0x11a')]()[_0x2203('0x86')]({'secret':![]})[_0x2203('0x3b')](function(_0x2fc5cf){if(_0x2fc5cf[_0x2203('0xd3')]){var _0x2097be=path['join'](_0x2111b4,_0x2fc5cf['Attachment'][_0x2203('0xd0')]);if(fs['existsSync'](_0x2097be)){fs[_0x2203('0x11b')](_0x2097be)[_0x2203('0x11c')](fs['createWriteStream'](path['join'](_0x20a488,_0x2fc5cf[_0x2203('0xd3')][_0x2203('0xd0')])));}}return{'date':moment(_0x2fc5cf[_0x2203('0x7a')])[_0x2203('0xdd')]('YYYY-MM-DD\x20HH:mm:ss')[_0x2203('0x98')](),'sender':_0x2fc5cf[_0x2203('0xef')]==='out'?_0x2fc5cf[_0x2203('0xe2')]?_0x2fc5cf['User'][_0x2203('0x3c')]:'System':_0x2fc5cf[_0x2203('0x67')][_0x2203('0x10f')]+(_0x2fc5cf[_0x2203('0x67')][_0x2203('0x110')]?'\x20'+_0x2fc5cf[_0x2203('0x67')][_0x2203('0x110')]:''),'body':_0x2fc5cf[_0x2203('0xd3')]?_0x2fc5cf['Attachment'][_0x2203('0xd0')]:_0x2fc5cf['body'],'direction':_0x2fc5cf[_0x2203('0xef')]===_0x2203('0xc3')?'A':'C','secret':_0x2fc5cf[_0x2203('0xf0')],'read':_0x2fc5cf[_0x2203('0x80')],'attachment':_0x2fc5cf[_0x2203('0xd3')]};})[_0x2203('0x63')]()};return ejs['renderFile'](path['join'](config[_0x2203('0xd8')],_0x2203('0x10a'),_0x2203('0x11d'),'downloadInteraction.ejs'),{'interaction':_0x1c36d4})[_0x2203('0x1d')](function(_0x15260f){var _0x4419a8=path[_0x2203('0xd7')](_0x20a488,_0x2203('0x11e')+_0xd584ee['id']+'-'+_0x3dd02d+_0x2203('0x11f'));var _0x2af4f6={'path':_0x4419a8,'channel':'Chat','interactionId':_0xd584ee['id']};return pdf[_0x2203('0x120')](_0x15260f,_0x2af4f6);})[_0x2203('0x1d')](function(){return new BPromise(function(_0x3e8221,_0x16ccec){zipdir(_0x20a488,{'saveTo':_0x44ae18},function(_0x7da828,_0x29846d){if(_0x7da828)return _0x16ccec(_0x7da828);return _0x3e8221(_0x29846d);});})[_0x2203('0x1d')](function(){return new BPromise(function(_0x1c3684,_0x11c1db){rimraf(_0x20a488,function(_0x447a00){if(_0x447a00)_0x11c1db(_0x447a00);return _0x1c3684();});});})[_0x2203('0x1d')](function(){return _0x5b771e['download'](_0x44ae18,_0x505c2a,function(_0x2a679c){if(_0x2a679c){console[_0x2203('0x121')](_0x2203('0x122'),_0x2a679c);}else{fs[_0x2203('0x123')](_0x44ae18);}});});});}else{return _0x5b771e[_0x2203('0x28')](0xc8);}})['catch'](handleError(_0x5b771e,null));}; \ No newline at end of file +var _0x0abf=['query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','select','field','color','from','tools_tags','user_has_chat_interactions','users','chat_interactions','left_join','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','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','having','`\x20=\x200','`\x20>\x200','Contact','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','parse','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','SELECT','clone','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','ChatInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','ui.ChatInteractionId\x20IN\x20?','groupBy','all','rows','show','includeAll','include','options','params','describe','ChatWebsite','findOne','vidaooApiKey','vidaooTopic','vidaooMetadata','vidaooEscalation','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','follow','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','create','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','file','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','server/files/attachments/','download','mailTranscript','format','transcript-%s.txt','now','User','CmContact','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','Smtp','service','host','port','secure','authentication','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','pick','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','root','attachments','lastName','Account','Owner','get','mkdirSync','Chat','N.A.','browserName','osName','referer','customerIp','customerPort','tail','existsSync','pipe','createWriteStream','firstName','views','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','json','offset','undefined','limit','count','reject','update','destroy','end','stack','name','render','merge','body','contact','agent','account','Users','map','fullname','Tags','TagIds','split','forEach','push','catch','rawAttributes','fieldName','type','key','model'];(function(_0x734794,_0x1c69ce){var _0x142844=function(_0x1b394c){while(--_0x1b394c){_0x734794['push'](_0x734794['shift']());}};_0x142844(++_0x1c69ce);}(_0x0abf,0xe8));var _0xf0ab=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0abf[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xf0ab('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf0ab('0x1'));var jsonpatch=require(_0xf0ab('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf0ab('0x3'));var Mustache=require('mustache');var util=require(_0xf0ab('0x4'));var path=require(_0xf0ab('0x5'));var sox=require(_0xf0ab('0x6'));var csv=require(_0xf0ab('0x7'));var ejs=require(_0xf0ab('0x8'));var fs=require('fs');var fs_extra=require(_0xf0ab('0x9'));var _=require(_0xf0ab('0xa'));var squel=require('squel');var crypto=require(_0xf0ab('0xb'));var jsforce=require(_0xf0ab('0xc'));var deskjs=require(_0xf0ab('0xd'));var toCsv=require(_0xf0ab('0x7'));var querystring=require('querystring');var Papa=require(_0xf0ab('0xe'));var Redis=require(_0xf0ab('0xf'));var authService=require(_0xf0ab('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xf0ab('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf0ab('0x12'))(_0xf0ab('0x13'));var utils=require(_0xf0ab('0x14'));var config=require(_0xf0ab('0x15'));var licenseUtil=require(_0xf0ab('0x16'));var db=require(_0xf0ab('0x17'))['db'];config[_0xf0ab('0x18')]=_['defaults'](config[_0xf0ab('0x18')],{'host':_0xf0ab('0x19'),'port':0x18eb});var socket=require(_0xf0ab('0x1a'))(new Redis(config[_0xf0ab('0x18')]));require(_0xf0ab('0x1b'))[_0xf0ab('0x1c')](socket);var jayson=require(_0xf0ab('0x1d'));var client=jayson[_0xf0ab('0x1e')][_0xf0ab('0x1f')]({'port':0x232b});var client9004=jayson[_0xf0ab('0x1e')][_0xf0ab('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x221bac,_0x200cf5,_0x2f4618,_0x230f40){return new BPromise(function(_0x54b0ce,_0x457465){var _0x9e3b47=_0x230f40||client;return _0x9e3b47[_0xf0ab('0x20')](_0x221bac,_0x2f4618)[_0xf0ab('0x21')](function(_0x776619){logger[_0xf0ab('0x22')](_0xf0ab('0x23'),_0x200cf5,_0xf0ab('0x24'));logger[_0xf0ab('0x25')](_0xf0ab('0x26'),_0x200cf5,_0xf0ab('0x24'),JSON[_0xf0ab('0x27')](_0x776619));if(_0x776619[_0xf0ab('0x28')]){if(_0x776619[_0xf0ab('0x28')][_0xf0ab('0x29')]===0x1f4){logger[_0xf0ab('0x28')]('ChatInteraction,\x20%s,\x20%s',_0x200cf5,_0x776619[_0xf0ab('0x28')][_0xf0ab('0x2a')]);return _0x457465(_0x776619[_0xf0ab('0x28')][_0xf0ab('0x2a')]);}logger[_0xf0ab('0x28')](_0xf0ab('0x23'),_0x200cf5,_0x776619[_0xf0ab('0x28')][_0xf0ab('0x2a')]);return _0x54b0ce(_0x776619[_0xf0ab('0x28')][_0xf0ab('0x2a')]);}else{logger[_0xf0ab('0x22')]('ChatInteraction,\x20%s,\x20%s',_0x200cf5,'request\x20sent');_0x54b0ce(_0x776619['result'][_0xf0ab('0x2a')]);}})['catch'](function(_0x3eca32){logger[_0xf0ab('0x28')]('ChatInteraction,\x20%s,\x20%s',_0x200cf5,_0x3eca32);_0x457465(_0x3eca32);});});}function respondWithStatusCode(_0x163078,_0x22671e){_0x22671e=_0x22671e||0xcc;return function(_0x10bf5f){if(_0x10bf5f){return _0x163078[_0xf0ab('0x2b')](_0x22671e);}return _0x163078[_0xf0ab('0x2c')](_0x22671e)['end']();};}function respondWithResult(_0x2d0da7,_0x574ce7){_0x574ce7=_0x574ce7||0xc8;return function(_0x55d799){if(_0x55d799){return _0x2d0da7[_0xf0ab('0x2c')](_0x574ce7)[_0xf0ab('0x2d')](_0x55d799);}};}function respondWithFilteredResult(_0x1b223d,_0x445160){return function(_0x43476c){if(_0x43476c){var _0x174052=typeof _0x445160[_0xf0ab('0x2e')]===_0xf0ab('0x2f')&&typeof _0x445160[_0xf0ab('0x30')]===_0xf0ab('0x2f');var _0x21e8ac=_0x43476c[_0xf0ab('0x31')];var _0x58cbe1=_0x174052?0x0:_0x445160[_0xf0ab('0x2e')];var _0x35973a=_0x174052?_0x43476c['count']:_0x445160['offset']+_0x445160[_0xf0ab('0x30')];var _0x1dc84e;if(_0x35973a>=_0x21e8ac){_0x35973a=_0x21e8ac;_0x1dc84e=0xc8;}else{_0x1dc84e=0xce;}_0x1b223d[_0xf0ab('0x2c')](_0x1dc84e);return _0x1b223d['set']('Content-Range',_0x58cbe1+'-'+_0x35973a+'/'+_0x21e8ac)[_0xf0ab('0x2d')](_0x43476c);}return null;};}function patchUpdates(_0x58fa03){return function(_0x1cfd52){try{jsonpatch['apply'](_0x1cfd52,_0x58fa03,!![]);}catch(_0x3f66fa){return BPromise[_0xf0ab('0x32')](_0x3f66fa);}return _0x1cfd52['save']();};}function saveUpdates(_0x56e728,_0x469f42){return function(_0x27c6f9){if(_0x27c6f9){return _0x27c6f9[_0xf0ab('0x33')](_0x56e728)[_0xf0ab('0x21')](function(_0x2519c7){return _0x2519c7;});}return null;};}function removeEntity(_0x36195d,_0x17f3b3){return function(_0xf8f0f4){if(_0xf8f0f4){return _0xf8f0f4[_0xf0ab('0x34')]()[_0xf0ab('0x21')](function(){_0x36195d[_0xf0ab('0x2c')](0xcc)[_0xf0ab('0x35')]();});}};}function handleEntityNotFound(_0x22dcfe,_0x437fdb){return function(_0x5d8443){if(!_0x5d8443){_0x22dcfe[_0xf0ab('0x2b')](0x194);}return _0x5d8443;};}function handleError(_0x45c449,_0xc575ed){_0xc575ed=_0xc575ed||0x1f4;return function(_0x5c9192){logger[_0xf0ab('0x28')](_0x5c9192[_0xf0ab('0x36')]);if(_0x5c9192[_0xf0ab('0x37')]){delete _0x5c9192['name'];}_0x45c449[_0xf0ab('0x2c')](_0xc575ed)['send'](_0x5c9192);};}function getMustacheRender(_0xda3971,_0x492d7c){return Mustache[_0xf0ab('0x38')](_0xda3971,_[_0xf0ab('0x39')](_0x492d7c[_0xf0ab('0x3a')],{'contact':_0x492d7c[_0xf0ab('0x3b')],'message':_0x492d7c[_0xf0ab('0x2a')],'agent':_0x492d7c[_0xf0ab('0x3c')],'interaction':_0x492d7c['interaction'],'account':_0x492d7c[_0xf0ab('0x3d')]}))||'';}function getInteractionUsers(_0x683d08,_0x5a6df5){return new BPromise(function(_0x207fbb,_0xce89bc){try{if(_0x5a6df5[_0x683d08['id']]){_0x683d08[_0xf0ab('0x3e')]=_[_0xf0ab('0x3f')](_0x5a6df5[_0x683d08['id']],function(_0x31fa72){return{'id':_0x31fa72['id'],'fullname':_0x31fa72[_0xf0ab('0x40')]};});}}catch(_0x28c20c){_0xce89bc(_0x28c20c);}_0x207fbb(_0x683d08);});}function getInteractionTags(_0x528d4b,_0x406a1d){return new BPromise(function(_0x4f6e93,_0x7c4629){try{if(_0x528d4b['TagIds']){_0x528d4b[_0xf0ab('0x41')]=[];_0x528d4b[_0xf0ab('0x42')][_0xf0ab('0x43')](',')[_0xf0ab('0x44')](function(_0x2b7ed5){_0x528d4b['Tags'][_0xf0ab('0x45')](_0x406a1d[_0x2b7ed5]);});}delete _0x528d4b[_0xf0ab('0x42')];}catch(_0x28e7a4){_0x7c4629(_0x28e7a4);}_0x4f6e93(_0x528d4b);});}function updateChatInteraction(_0x197955,_0x191caf,_0x17a73){return new BPromise(function(_0x45849c,_0x413f5c){return getInteractionUsers(_0x197955,_0x17a73)[_0xf0ab('0x21')](function(_0x3b214a){return getInteractionTags(_0x3b214a,_0x191caf);})[_0xf0ab('0x21')](function(_0x32ec93){_0x45849c(_0x32ec93);})[_0xf0ab('0x46')](function(_0x5e6b6b){_0x413f5c(_0x5e6b6b);});});}exports['index']=function(_0x2fc677,_0x4e6c41){var _0x1fc766={},_0x2d50c0={},_0x4bbdf6={'count':0x0,'rows':[]};var _0x8c2d2c=_[_0xf0ab('0x3f')](db['ChatInteraction'][_0xf0ab('0x47')],function(_0x29cc6a){return{'name':_0x29cc6a[_0xf0ab('0x48')],'type':_0x29cc6a[_0xf0ab('0x49')][_0xf0ab('0x4a')]};});_0x2d50c0[_0xf0ab('0x4b')]=_[_0xf0ab('0x3f')](_0x8c2d2c,_0xf0ab('0x37'));_0x2d50c0[_0xf0ab('0x4c')]=_[_0xf0ab('0x4d')](_0x2fc677[_0xf0ab('0x4c')]);_0x2d50c0[_0xf0ab('0x4e')]=_[_0xf0ab('0x4f')](_0x2d50c0[_0xf0ab('0x4b')],_0x2d50c0['query']);_0x1fc766['attributes']=_[_0xf0ab('0x4f')](_0x2d50c0['model'],qs['fields'](_0x2fc677['query'][_0xf0ab('0x50')]));_0x1fc766[_0xf0ab('0x51')]=_0x1fc766[_0xf0ab('0x51')][_0xf0ab('0x52')]?_0x1fc766[_0xf0ab('0x51')]:_0x2d50c0[_0xf0ab('0x4b')];if(!_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x53')](_0xf0ab('0x54'))){_0x1fc766[_0xf0ab('0x30')]=qs[_0xf0ab('0x30')](_0x2fc677[_0xf0ab('0x4c')]['limit']);_0x1fc766[_0xf0ab('0x2e')]=qs[_0xf0ab('0x2e')](_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x2e')]);}_0x1fc766[_0xf0ab('0x55')]=qs[_0xf0ab('0x56')](_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x56')]);_0x1fc766['where']=qs['filters'](_['pick'](_0x2fc677[_0xf0ab('0x4c')],_0x2d50c0[_0xf0ab('0x4e')]),_0x8c2d2c);var _0x577c85=[];var _0xa1a416=squel[_0xf0ab('0x57')]()['field']('id')[_0xf0ab('0x58')](_0xf0ab('0x37'))[_0xf0ab('0x58')](_0xf0ab('0x59'))[_0xf0ab('0x5a')](_0xf0ab('0x5b'));var _0x26508b=squel['select']()[_0xf0ab('0x58')]('u.id')[_0xf0ab('0x58')]('u.fullname')[_0xf0ab('0x58')]('ui.ChatInteractionId')['from'](_0xf0ab('0x5c'),'ui')['left_join'](_0xf0ab('0x5d'),'u','u.id\x20=\x20ui.UserId');var _0x2eff07=squel['select']()[_0xf0ab('0x5a')](_0xf0ab('0x5e'),'i')[_0xf0ab('0x5f')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0xf0ab('0x5d'),'o',_0xf0ab('0x60'))['left_join']('chat_websites','a',_0xf0ab('0x61'))[_0xf0ab('0x5f')](_0xf0ab('0x62'),'me',_0xf0ab('0x63'))[_0xf0ab('0x5f')](_0xf0ab('0x64'),'it',_0xf0ab('0x65'))[_0xf0ab('0x5f')](_0xf0ab('0x5b'),'t',_0xf0ab('0x66'));var _0x1e6a4e=squel['expr']();var _0x41ed17=[];var _0x5b24e3=squel[_0xf0ab('0x67')]();var _0x61d3db;if(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x68')]){_0x61d3db=as[_0xf0ab('0x69')](_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x68')]);var _0x1f11aa=_0x61d3db[_0xf0ab('0x6a')];for(var _0x180ee6=0x0;_0x180ee6<_0x61d3db['conditions'][_0xf0ab('0x52')];_0x180ee6++){var _0x2266f3=_0x61d3db[_0xf0ab('0x6b')][_0x180ee6];var _0x1d4a72='i';var _0x2232eb=_[_0xf0ab('0x6c')](_0x8c2d2c,[_0xf0ab('0x37'),_0x2266f3[_0xf0ab('0x58')]]);if(!_0x2232eb){switch(_0x2266f3[_0xf0ab('0x58')]){case'unreadMessages':if(_0x2266f3['value']==0x1){_0x2eff07[_0xf0ab('0x6d')]('`'+_0x2266f3[_0xf0ab('0x58')]+_0xf0ab('0x6e'));}else{_0x2eff07['having']('`'+_0x2266f3[_0xf0ab('0x58')]+_0xf0ab('0x6f'));}break;case _0xf0ab('0x70'):if(_0x2266f3['operator']===_0xf0ab('0x71')){if(_0x2266f3[_0xf0ab('0x72')][_0xf0ab('0x43')]('\x20')[_0xf0ab('0x52')]>0x1){_0x1e6a4e[_0x1f11aa](_0xf0ab('0x73'),qs['getFullTextValue'](_0x2266f3[_0xf0ab('0x72')]),null);}else{var _0x70b02d='%'+_0x2266f3[_0xf0ab('0x72')]+'%';_0x1e6a4e[_0x1f11aa](_0xf0ab('0x74'),_0x70b02d,_0x70b02d,_0x70b02d);}}else{_0x2232eb=_[_0xf0ab('0x6c')](_0x8c2d2c,[_0xf0ab('0x37'),_0xf0ab('0x75')]);_0x2266f3[_0xf0ab('0x58')]=_0xf0ab('0x75');_0x5154f5=as[_0xf0ab('0x76')](_0x1d4a72,_0x2232eb[_0xf0ab('0x49')],_0x2266f3);_0x1e6a4e[_0x1f11aa](_0x5154f5[_0xf0ab('0x77')],_0x5154f5[_0xf0ab('0x72')]['start'],_0x5154f5['value'][_0xf0ab('0x35')]);}break;case _0xf0ab('0x78'):var _0x325ad6=_0x2266f3['value'][_0xf0ab('0x43')](',')['map'](function(_0x1a32dc){return Number(_0x1a32dc);});_0x325ad6[_0xf0ab('0x44')](function(_0x1787e2){_0x5b24e3['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1787e2+',%');});_0x41ed17=_[_0xf0ab('0x79')](_0x41ed17,_0x325ad6);break;case'User':if(_0x2266f3['operator']===_0xf0ab('0x71')){_0x1e6a4e[_0x1f11aa](_0xf0ab('0x7a'),'%'+_0x2266f3[_0xf0ab('0x72')]+'%',null);}else{_0x2232eb=_['find'](_0x8c2d2c,[_0xf0ab('0x37'),_0xf0ab('0x7b')]);_0x2266f3[_0xf0ab('0x58')]=_0xf0ab('0x7b');_0x5154f5=as['buildExpression'](_0x1d4a72,_0x2232eb['type'],_0x2266f3);_0x1e6a4e[_0x1f11aa](_0x5154f5['text'],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x7c')],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x35')]);}break;case _0xf0ab('0x3a'):_0x5154f5=as[_0xf0ab('0x76')]('me',null,_0x2266f3);_0x1e6a4e[_0x1f11aa](_0x5154f5[_0xf0ab('0x77')],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x7c')],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x35')]);break;}}else{var _0x5154f5=as[_0xf0ab('0x76')](_0x1d4a72,_0x2232eb[_0xf0ab('0x49')],_0x2266f3);_0x1e6a4e[_0x1f11aa](_0x5154f5[_0xf0ab('0x77')],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x7c')],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x35')]);}}}else{var _0x42f067=_(_0x2fc677['query'])[_0xf0ab('0x4d')]()[_0xf0ab('0x3f')](function(_0x4c8e95){return _['some'](_0x8c2d2c,['name',_0x4c8e95])?_0x4c8e95:undefined;})[_0xf0ab('0x7d')]()[_0xf0ab('0x72')]();if(!_[_0xf0ab('0x7e')](_0x42f067)){_0x42f067[_0xf0ab('0x44')](function(_0x15aa78){if(_0x15aa78===_0xf0ab('0x7f')){_0x2eff07['where'](_0xf0ab('0x80'),[]['concat'](_0x2fc677[_0xf0ab('0x4c')][_0x15aa78]));}else if(_0x15aa78==='createdAt'){var _0x2978a9=JSON['parse'](_0x2fc677[_0xf0ab('0x4c')][_0x15aa78])['$gte'];var _0x58ca28=JSON[_0xf0ab('0x81')](_0x2fc677[_0xf0ab('0x4c')][_0x15aa78])[_0xf0ab('0x82')];_0x2eff07[_0xf0ab('0x83')](_0xf0ab('0x84'),_0x2978a9,_0x58ca28);}else{if(_0x2fc677[_0xf0ab('0x4c')][_0x15aa78]===_0xf0ab('0x85')){_0x2eff07[_0xf0ab('0x83')]('i.'+_0x15aa78+_0xf0ab('0x86'));}else{_0x2eff07[_0xf0ab('0x83')]('i.'+_0x15aa78+_0xf0ab('0x87'),_0x2fc677[_0xf0ab('0x4c')][_0x15aa78]);}}});}if(_0x2fc677[_0xf0ab('0x4c')]['read']){if(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x88')]==0x1){_0x2eff07[_0xf0ab('0x6d')](_0xf0ab('0x89'));}else{_0x2eff07[_0xf0ab('0x6d')](_0xf0ab('0x8a'));}}if(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x8b')]){_0x41ed17=_[_0xf0ab('0x8c')](_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x8b')])?_0x2fc677[_0xf0ab('0x4c')]['tag']:new Array(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x8b')]);_0x41ed17[_0xf0ab('0x44')](function(_0x2196a7){_0x5b24e3['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2196a7+',%');});}if(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x8d')]){var _0x4463cc=_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x8d')]['replace']('\x5c','\x5c\x5c')[_0xf0ab('0x8e')](/'/g,'\x27\x27');if(qs[_0xf0ab('0x8f')](_0x4463cc)){_0x1e6a4e['or']('i.id\x20LIKE\x20?',_0x4463cc+'%');}else{_0x1e6a4e['or'](_0xf0ab('0x90'),qs['getFullTextValue'](_0x4463cc))['or'](_0xf0ab('0x91'),_0x4463cc+'%');}}}_0x2eff07[_0xf0ab('0x83')](_0x1e6a4e);_0x2eff07['group'](_0xf0ab('0x92'));var _0x148a72={'type':db['Sequelize']['QueryTypes'][_0xf0ab('0x93')],'raw':!![]};var _0x58140c=_0x2eff07[_0xf0ab('0x94')]();_0x58140c[_0xf0ab('0x58')]('i.id');_0x58140c['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xf0ab('0x95'));if(_0x1fc766[_0xf0ab('0x55')]){_0x1fc766[_0xf0ab('0x55')][_0xf0ab('0x44')](function(_0x49c89f){var _0x272f9c=_0x49c89f[0x0]===_0xf0ab('0x96')?_0x49c89f[0x0]:'i.'+_0x49c89f[0x0];_0x2eff07[_0xf0ab('0x55')](_0x272f9c,_0x49c89f[0x1]===_0xf0ab('0x97')?![]:!![]);});}if(!_[_0xf0ab('0x7e')](_0x41ed17)){_0x2eff07['having'](_0x5b24e3);_0x58140c['where'](_0xf0ab('0x98'),_0x41ed17);}BPromise[_0xf0ab('0x99')]()['then'](function(){if(!_0x61d3db){if(_0x2fc677['query'][_0xf0ab('0x7f')])return;_0x58140c[_0xf0ab('0x83')](_0xf0ab('0x9a'));_0x2eff07[_0xf0ab('0x83')](_0xf0ab('0x9a'));return;}if(_0x2fc677[_0xf0ab('0x9b')][_0xf0ab('0x9c')]!==_0xf0ab('0x3c'))return;return _0x2fc677[_0xf0ab('0x9b')][_0xf0ab('0x9d')]({'attributes':['id'],'raw':!![]})[_0xf0ab('0x21')](function(_0x52eca9){if(_['isEmpty'](_0x52eca9)){_0x58140c[_0xf0ab('0x83')]('i.ChatWebsiteId\x20IS\x20NULL');_0x2eff07[_0xf0ab('0x83')](_0xf0ab('0x9e'));}else{_0x58140c[_0xf0ab('0x83')](_0xf0ab('0x80'),_['map'](_0x52eca9,'id'));_0x2eff07[_0xf0ab('0x83')](_0xf0ab('0x80'),_[_0xf0ab('0x3f')](_0x52eca9,'id'));}});})[_0xf0ab('0x21')](function(){if(_0x2fc677[_0xf0ab('0x9b')][_0xf0ab('0x9c')]===_0xf0ab('0x3c')&&!_0x61d3db&&!_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x7f')])return[];return db[_0xf0ab('0x9f')][_0xf0ab('0x4c')](_0x58140c[_0xf0ab('0xa0')](),_0x148a72);})[_0xf0ab('0x21')](function(_0x4211a1){_0x4bbdf6['count']=_0x4211a1[_0xf0ab('0x52')];if(_0x4bbdf6[_0xf0ab('0x31')]===0x0)return[];return db[_0xf0ab('0x9f')][_0xf0ab('0x4c')](_0xa1a416[_0xf0ab('0xa0')](),_0x148a72)[_0xf0ab('0x21')](function(_0x611cf7){_0x577c85=_['keyBy'](_0x611cf7,'id');_0x148a72=_['merge'](_0x148a72,{'model':db[_0xf0ab('0xa1')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x50')]){_0x1fc766['attributes'][_0xf0ab('0x44')](function(_0x405b34){_0x2eff07[_0xf0ab('0x58')]('i.'+_0x405b34);});}else{_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xa2'),'unreadMessages');_0x2eff07['field'](_0xf0ab('0xa3'),'Account.key');_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xa4'),'Account.mandatoryDisposition');_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xa5'),_0xf0ab('0x96'));_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xa6'));_0x2eff07['field'](_0xf0ab('0xa7'),_0xf0ab('0xa8'));_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xa9'),_0xf0ab('0xaa'));_0x2eff07['field'](_0xf0ab('0xab'),_0xf0ab('0xac'));_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xad'),_0xf0ab('0xae'));_0x2eff07['field'](_0xf0ab('0xaf'),_0xf0ab('0xb0'));_0x2eff07[_0xf0ab('0x58')]('c.fax',_0xf0ab('0xb1'));_0x2eff07['field'](_0xf0ab('0xb2'),_0xf0ab('0xb3'));_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xb4'),'Owner.internal');_0x2eff07[_0xf0ab('0x58')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x1fc766[_0xf0ab('0x30')])_0x2eff07['limit'](_0x1fc766['limit']);if(_0x1fc766[_0xf0ab('0x2e')])_0x2eff07[_0xf0ab('0x2e')](_0x1fc766['offset']);return db['sequelize']['query'](_0x2eff07['toString'](),_0x148a72);})[_0xf0ab('0x21')](function(_0x12d9b6){if(_0x12d9b6[_0xf0ab('0x52')]>0x0)_0x26508b[_0xf0ab('0x83')](_0xf0ab('0xb5'),_['map'](_0x12d9b6,'id'));return db[_0xf0ab('0x9f')][_0xf0ab('0x4c')](_0x26508b[_0xf0ab('0xa0')](),_0x148a72)[_0xf0ab('0x21')](function(_0x84eab9){var _0x27cd98=_[_0xf0ab('0xb6')](_0x84eab9,'ChatInteractionId');var _0x16dca7=[];_0x12d9b6[_0xf0ab('0x44')](function(_0x39633a){_0x16dca7[_0xf0ab('0x45')](updateChatInteraction(_0x39633a,_0x577c85,_0x27cd98));});return BPromise[_0xf0ab('0xb7')](_0x16dca7);});});})[_0xf0ab('0x21')](function(_0x527a4b){_0x4bbdf6[_0xf0ab('0xb8')]=_0x527a4b;return _0x4bbdf6;})[_0xf0ab('0x21')](respondWithFilteredResult(_0x4e6c41,_0x1fc766))[_0xf0ab('0x46')](handleError(_0x4e6c41,null));};exports[_0xf0ab('0xb9')]=function(_0x4ca7a3,_0x426419){var _0x395bf6={'raw':![],'where':{'id':_0x4ca7a3['params']['id']}},_0x5b7744={};_0x5b7744[_0xf0ab('0x4b')]=_[_0xf0ab('0x4d')](db[_0xf0ab('0xa1')][_0xf0ab('0x47')]);_0x5b7744[_0xf0ab('0x4c')]=_[_0xf0ab('0x4d')](_0x4ca7a3[_0xf0ab('0x4c')]);_0x5b7744[_0xf0ab('0x4e')]=_['intersection'](_0x5b7744[_0xf0ab('0x4b')],_0x5b7744['query']);_0x395bf6['attributes']=_[_0xf0ab('0x4f')](_0x5b7744[_0xf0ab('0x4b')],qs[_0xf0ab('0x50')](_0x4ca7a3[_0xf0ab('0x4c')][_0xf0ab('0x50')]));_0x395bf6[_0xf0ab('0x51')]=_0x395bf6[_0xf0ab('0x51')][_0xf0ab('0x52')]?_0x395bf6['attributes']:_0x5b7744[_0xf0ab('0x4b')];if(_0x4ca7a3[_0xf0ab('0x4c')][_0xf0ab('0xba')]){_0x395bf6[_0xf0ab('0xbb')]=[{'all':!![]}];}_0x395bf6=_[_0xf0ab('0x39')]({},_0x395bf6,_0x4ca7a3[_0xf0ab('0xbc')]);return db[_0xf0ab('0xa1')][_0xf0ab('0x6c')](_0x395bf6)[_0xf0ab('0x21')](handleEntityNotFound(_0x426419,null))[_0xf0ab('0x21')](respondWithResult(_0x426419,null))['catch'](handleError(_0x426419,null));};exports['create']=function(_0x58946c,_0x2f339d){return db['ChatInteraction']['create'](_0x58946c[_0xf0ab('0x3a')],{})[_0xf0ab('0x21')](respondWithResult(_0x2f339d,0xc9))[_0xf0ab('0x46')](handleError(_0x2f339d,null));};exports[_0xf0ab('0x33')]=function(_0xdf495,_0x55a296){if(_0xdf495[_0xf0ab('0x3a')]['id']){delete _0xdf495[_0xf0ab('0x3a')]['id'];}return db[_0xf0ab('0xa1')][_0xf0ab('0x6c')]({'where':{'id':_0xdf495[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x55a296,null))[_0xf0ab('0x21')](saveUpdates(_0xdf495[_0xf0ab('0x3a')],null))['then'](respondWithResult(_0x55a296,null))[_0xf0ab('0x46')](handleError(_0x55a296,null));};exports['destroy']=function(_0x3c1a2c,_0x17a3b6){return db['ChatInteraction'][_0xf0ab('0x6c')]({'where':{'id':_0x3c1a2c[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x17a3b6,null))[_0xf0ab('0x21')](removeEntity(_0x17a3b6,null))[_0xf0ab('0x46')](handleError(_0x17a3b6,null));};exports[_0xf0ab('0xbe')]=function(_0x1f2efa,_0x1d12fb){return db[_0xf0ab('0xa1')]['describe']()[_0xf0ab('0x21')](respondWithResult(_0x1d12fb,null))[_0xf0ab('0x46')](handleError(_0x1d12fb,null));};exports['createVidaooSession']=function(_0x35486d,_0x3f5ade){var _0x135a10=_0x35486d[_0xf0ab('0xbd')]['id'];var _0x48fc7e;var _0x5f55d2;var _0x7c7c3b;return db[_0xf0ab('0xa1')]['findOne']({'where':{'id':_0x135a10}})[_0xf0ab('0x21')](function(_0x2beaaa){_0x48fc7e=_0x2beaaa;return db[_0xf0ab('0xbf')][_0xf0ab('0xc0')]({'where':{'id':_0x2beaaa[_0xf0ab('0x7f')]},'attributes':['id',_0xf0ab('0xc1'),'vidaooEscalation',_0xf0ab('0xc2'),'vidaooNote',_0xf0ab('0xc3')],'raw':!![]});})[_0xf0ab('0x21')](function(_0x354e18){if(_0x354e18&&_0x354e18['vidaooApiKey']&&_0x354e18[_0xf0ab('0xc4')]){_0x5f55d2=_0x354e18;var _0x2068d6={'interaction':{'id':_0x135a10},'agent':{'id':_0x35486d[_0xf0ab('0x9b')]['id'],'name':_0x35486d[_0xf0ab('0x9b')][_0xf0ab('0x37')],'fullname':_0x35486d[_0xf0ab('0x9b')][_0xf0ab('0x40')],'email':_0x35486d[_0xf0ab('0x9b')][_0xf0ab('0xc5')]},'contact':_0x35486d['body']['contact'],'account':_0x35486d[_0xf0ab('0x3a')][_0xf0ab('0x3d')]};var _0x35b480={'rejectUnauthorized':![],'method':_0xf0ab('0xc6'),'url':_0xf0ab('0xc7'),'headers':{'X-APIKEY':_0x354e18[_0xf0ab('0xc1')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x35486d[_0xf0ab('0x9b')][_0xf0ab('0xc5')]],'buttons':null,'topic':_0x5f55d2[_0xf0ab('0xc2')],'note':_[_0xf0ab('0xc8')](_0x5f55d2['vidaooNote'])?null:getMustacheRender(_0x5f55d2[_0xf0ab('0xc9')],_0x2068d6),'metadata':null},'redirect':_0xf0ab('0xca'),'json':!![]};try{if(!_[_0xf0ab('0xc8')](_0x5f55d2[_0xf0ab('0xc3')])){var _0x41e2d8=getMustacheRender(_0x5f55d2[_0xf0ab('0xc3')],_0x2068d6);var _0x57f44d=JSON[_0xf0ab('0x81')](_0x41e2d8);_0x35b480[_0xf0ab('0x3a')][_0xf0ab('0xcb')]=_0x57f44d;}}catch(_0x533b37){throw new db[(_0xf0ab('0xcc'))]['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x35b480);}else{throw new db[(_0xf0ab('0xcc'))][(_0xf0ab('0xcd'))](_0xf0ab('0xce'));}})['then'](function(_0x1697ca){_0x7c7c3b=_0x1697ca;if(_0x7c7c3b['id']){var _0x15da8a={'body':_0x7c7c3b[_0xf0ab('0xcf')],'ChatWebsiteId':_0x5f55d2['id'],'ChatInteractionId':_0x48fc7e['id'],'direction':'out','UserId':_0x35486d[_0xf0ab('0x9b')]['id']};return db[_0xf0ab('0xd0')][_0xf0ab('0xd1')](_0x15da8a,{});}else{throw new db['Sequelize'][(_0xf0ab('0xcd'))](_0xf0ab('0xd2'));}})[_0xf0ab('0x21')](function(){return _0x48fc7e[_0xf0ab('0xd3')]({'vidaooSessionId':_0x7c7c3b['id']});})[_0xf0ab('0x21')](respondWithResult(_0x3f5ade,null))[_0xf0ab('0x46')](handleError(_0x3f5ade,null));};exports[_0xf0ab('0xd4')]=function(_0x115e3d,_0x2d0f9c){if(_0x115e3d[_0xf0ab('0x3a')]['id']){delete _0x115e3d[_0xf0ab('0x3a')]['id'];}return db[_0xf0ab('0xa1')][_0xf0ab('0x6c')]({'where':{'id':_0x115e3d[_0xf0ab('0xbd')]['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0xf0ab('0x21')](handleEntityNotFound(_0x2d0f9c,null))[_0xf0ab('0x21')](saveUpdates(_0x115e3d['body'],null))[_0xf0ab('0x21')](respondWithResult(_0x2d0f9c,null))['catch'](handleError(_0x2d0f9c,null));};exports[_0xf0ab('0xd5')]=function(_0x1e9768,_0x4398a3,_0x4195d9){if(_0x1e9768[_0xf0ab('0x3a')]['id']){delete _0x1e9768[_0xf0ab('0x3a')]['id'];}return db[_0xf0ab('0xa1')][_0xf0ab('0x6c')]({'where':{'id':_0x1e9768[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](function(_0x5f10a5){if(!_0x5f10a5){logger[_0xf0ab('0x28')](_0xf0ab('0xd6'),_0xf0ab('0xd5'),0x194,_0xf0ab('0xd7'));_0x4398a3[_0xf0ab('0x2b')](0x194);}else{if(_0x5f10a5[_0xf0ab('0x7b')]){throw new db['Sequelize']['ValidationError'](_0xf0ab('0xd8'));}}return _0x5f10a5;})[_0xf0ab('0x21')](function(_0x564124){if(_0x564124){return _0x564124[_0xf0ab('0x33')]({'closed':_0x1e9768[_0xf0ab('0x3a')][_0xf0ab('0xd9')],'disposition':_0x1e9768['body'][_0xf0ab('0xda')]})[_0xf0ab('0x21')](function(_0x2d9046){return _0x2d9046;});}})[_0xf0ab('0x21')](function(_0x4e5f1e){return respondWithRpcPromise(_0xf0ab('0xdb'),_0xf0ab('0xd5'),_0x1e9768[_0xf0ab('0x3a')],client9004);})['then'](respondWithResult(_0x4398a3,null))['catch'](handleError(_0x4398a3,null));};exports['attachmentUpload']=function(_0x581cb1,_0x22251d,_0x2b5993){_0x581cb1[_0xf0ab('0x3a')]['name']=_0x581cb1[_0xf0ab('0xdc')]['originalname'];_0x581cb1[_0xf0ab('0x3a')][_0xf0ab('0xdd')]=_0x581cb1[_0xf0ab('0xdc')][_0xf0ab('0xde')];_0x581cb1[_0xf0ab('0x3a')][_0xf0ab('0x49')]=_0x581cb1[_0xf0ab('0xdc')][_0xf0ab('0xdf')];return db[_0xf0ab('0xe0')][_0xf0ab('0xd1')](_0x581cb1[_0xf0ab('0x3a')])[_0xf0ab('0x21')](respondWithResult(_0x22251d,0xc9))[_0xf0ab('0x46')](handleError(_0x22251d,null));};exports[_0xf0ab('0xe1')]=function(_0x4d09bf,_0x415b9d,_0x11ed58){return db[_0xf0ab('0xa1')]['findOne']({'where':{'id':_0x4d09bf[_0xf0ab('0xbd')]['id']},'raw':!![]})[_0xf0ab('0x21')](handleEntityNotFound(_0x415b9d,null))[_0xf0ab('0x21')](function(_0x278e32){if(_0x278e32){if(_0x278e32['closed']){return _0x415b9d[_0xf0ab('0x2c')](0x193)[_0xf0ab('0x2d')]({'status':0x193,'message':_0xf0ab('0xe2')});}return db[_0xf0ab('0xe0')][_0xf0ab('0xc0')]({'where':{'id':_0x4d09bf[_0xf0ab('0x4c')][_0xf0ab('0xe3')]},'raw':!![]})[_0xf0ab('0x21')](handleEntityNotFound(_0x415b9d,null));}})['then'](function(_0xadae03){if(_0xadae03){var _0x550b00=_0xadae03[_0xf0ab('0xe4')]!==null;var _0x2bfb6a=path[_0xf0ab('0xe5')](config['root'],_0xf0ab('0xe6'));if(_0x550b00){_0x2bfb6a=path[_0xf0ab('0xe5')](_0x2bfb6a,'offline-chat/');}var _0x5d62e4=path['join'](_0x2bfb6a,_0xadae03['basename']);return _0x415b9d[_0xf0ab('0xe7')](_0x5d62e4);}})['catch'](handleError(_0x415b9d,null));};exports['close']=function(_0x3b8bbe,_0x7e24c4){var _0x2d0ea3=null;var _0x4a18ad=null;var _0x57aaae=null;var _0x2ab0be=null;if(_0x3b8bbe[_0xf0ab('0x3a')]['id']){delete _0x3b8bbe['body']['id'];}if(_0x3b8bbe[_0xf0ab('0x3a')][_0xf0ab('0xe8')]){_0x2ab0be=path['join'](config['root'],'server/files/chat/upload/',util[_0xf0ab('0xe9')](_0xf0ab('0xea'),Date[_0xf0ab('0xeb')]()));_0x3b8bbe[_0xf0ab('0x3a')]['pathTranscript']=_0x2ab0be;}return db[_0xf0ab('0xa1')][_0xf0ab('0x6c')]({'where':{'id':_0x3b8bbe['params']['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db[_0xf0ab('0xec')],'as':'User'}]}]})[_0xf0ab('0x21')](handleEntityNotFound(_0x7e24c4,null))[_0xf0ab('0x21')](saveUpdates(_0x3b8bbe[_0xf0ab('0x3a')],null))[_0xf0ab('0x21')](function(_0x116c84){if(_0x116c84){_0x2d0ea3=_0x116c84;return db[_0xf0ab('0xbf')][_0xf0ab('0x6c')]({'where':{'id':_0x2d0ea3[_0xf0ab('0x7f')]}});}})[_0xf0ab('0x21')](function(_0x1d6e15){if(_0x1d6e15){_0x57aaae=_0x1d6e15;return db[_0xf0ab('0xed')][_0xf0ab('0x6c')]({'where':{'id':_0x2d0ea3['ContactId']}});}})[_0xf0ab('0x21')](function(_0x29427c){if(_0x29427c){_0x4a18ad=_0x29427c;if(_0x2ab0be){var _0x29d4a1=null;for(var _0x50e996=0x1;_0x50e996<_0x2d0ea3['Messages'][_0xf0ab('0x52')];++_0x50e996){_0x29d4a1=_0x2d0ea3[_0xf0ab('0xee')][_0x50e996];var _0x8e04bb=_0x29d4a1[_0xf0ab('0x7b')]?util[_0xf0ab('0xe9')](_0xf0ab('0xef'),_0x57aaae[_0xf0ab('0xf0')],_0x29d4a1[_0xf0ab('0x7b')]):_0xf0ab('0xf1');var _0xc1537e=_0x3b8bbe[_0xf0ab('0x3a')][_0xf0ab('0xf2')]||util[_0xf0ab('0xe9')](_0xf0ab('0xef'),_0xf0ab('0xf3'),_0x29d4a1[_0xf0ab('0x75')]);switch(_0x57aaae[_0xf0ab('0xf4')]){case _0xf0ab('0xf5'):_0x8e04bb=_0x29d4a1[_0xf0ab('0x7b')]?util[_0xf0ab('0xe9')](_0xf0ab('0xef'),_0x57aaae['agentAlias'],_0x29d4a1[_0xf0ab('0x7b')]):'System';break;case _0xf0ab('0xf6'):_0x8e04bb=_0x29d4a1[_0xf0ab('0x7b')]?_0x29d4a1[_0xf0ab('0xec')][_0xf0ab('0xf7')]||_0x29d4a1['User'][_0xf0ab('0x40')]:'System';break;case'agent_fullname':_0x8e04bb=_0x29d4a1['UserId']?_0x29d4a1[_0xf0ab('0xec')][_0xf0ab('0x40')]:_0xf0ab('0xf1');break;default:_0x8e04bb=_0x29d4a1['UserId']?util[_0xf0ab('0xe9')](_0xf0ab('0xef'),_0x57aaae[_0xf0ab('0xf0')],_0x29d4a1[_0xf0ab('0x7b')]):_0xf0ab('0xf1');}var _0x2c39f0=util[_0xf0ab('0xe9')](_0xf0ab('0xf8'),moment(_0x29d4a1[_0xf0ab('0xf9')])[_0xf0ab('0xe9')](_0xf0ab('0xfa')),_0x29d4a1[_0xf0ab('0xfb')]==='in'?_0xc1537e:_0x8e04bb,_0x29d4a1['body']);if(!_0x29d4a1[_0xf0ab('0xfc')]){fs[_0xf0ab('0xfd')](_0x2ab0be,_0x2c39f0);}}return db[_0xf0ab('0xfe')][_0xf0ab('0xc0')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xf0ab('0xff'),'raw':!![]}]});}}})['then'](function(_0x21eb2b){if(_0x21eb2b&&_0x21eb2b['Smtp']&&_0x3b8bbe[_0xf0ab('0x3a')]){var _0x262659={'tls':{'rejectUnauthorized':![]}};if(_0x21eb2b['Smtp'][_0xf0ab('0x100')]){_0x262659[_0xf0ab('0x100')]=_0x21eb2b[_0xf0ab('0xff')][_0xf0ab('0x100')];}else{_0x262659[_0xf0ab('0x101')]=_0x21eb2b['Smtp'][_0xf0ab('0x101')];_0x262659[_0xf0ab('0x102')]=_0x21eb2b[_0xf0ab('0xff')]['port'];_0x262659['secure']=_0x21eb2b[_0xf0ab('0xff')][_0xf0ab('0x103')];}if(_0x21eb2b[_0xf0ab('0xff')][_0xf0ab('0x104')]){_0x262659['auth']={'user':_0x21eb2b['Smtp'][_0xf0ab('0x9b')],'pass':_0x21eb2b[_0xf0ab('0xff')]['pass']};}return respondWithRpcPromise('SendMail',_0xf0ab('0x105'),{'account':_0x262659,'message':{'from':util['format'](_0xf0ab('0x106'),_0x21eb2b['name'],_0x21eb2b[_0xf0ab('0xc5')]||_0x21eb2b[_0xf0ab('0xff')][_0xf0ab('0x9b')]),'to':_0x3b8bbe[_0xf0ab('0x3a')][_0xf0ab('0xe8')],'subject':_0xf0ab('0x107'),'text':util[_0xf0ab('0xe9')](_0xf0ab('0x108'),_0x3b8bbe['body'][_0xf0ab('0xe8')]),'attachments':[{'path':_0x2ab0be}]}})[_0xf0ab('0x21')](function(){return _0x2d0ea3;})[_0xf0ab('0x46')](function(_0x15f041){console[_0xf0ab('0x28')](_0x15f041);});}else{return _0x2d0ea3;}})['then'](respondWithStatusCode(_0x7e24c4,0xc8))[_0xf0ab('0x46')](handleError(_0x7e24c4,null));};exports[_0xf0ab('0x109')]=function(_0x5eda4b,_0x57a8ab,_0x3cee1d){return db[_0xf0ab('0xd0')][_0xf0ab('0x6c')]({'where':{'id':_0x5eda4b[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x57a8ab,null))[_0xf0ab('0x21')](function(_0x4dff6e){if(_0x4dff6e){return _0x4dff6e[_0xf0ab('0x109')](_0x5eda4b[_0xf0ab('0x3a')][_0xf0ab('0x10a')],_[_0xf0ab('0x10b')](_0x5eda4b[_0xf0ab('0x3a')],[_0xf0ab('0x10a'),'id'])||{});}})['then'](respondWithResult(_0x57a8ab,null))[_0xf0ab('0x46')](handleError(_0x57a8ab,null));};exports['getMessages']=function(_0x283bf5,_0x1afcea,_0x22a9f8){var _0x33dbfc={'raw':![],'where':{}};var _0x487318={};var _0x546e13={'count':0x0,'rows':[]};return db[_0xf0ab('0xa1')]['findOne']({'where':{'id':_0x283bf5[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x1afcea,null))[_0xf0ab('0x21')](function(_0xa3b903){if(_0xa3b903){_0x487318['model']=_[_0xf0ab('0x4d')](db[_0xf0ab('0xd0')][_0xf0ab('0x47')]);_0x487318[_0xf0ab('0x4c')]=_['keys'](_0x283bf5[_0xf0ab('0x4c')]);_0x487318[_0xf0ab('0x4e')]=_['intersection'](_0x487318[_0xf0ab('0x4b')],_0x487318[_0xf0ab('0x4c')]);_0x33dbfc[_0xf0ab('0x51')]=_[_0xf0ab('0x4f')](_0x487318[_0xf0ab('0x4b')],qs['fields'](_0x283bf5[_0xf0ab('0x4c')][_0xf0ab('0x50')]));_0x33dbfc[_0xf0ab('0x51')]=_0x33dbfc['attributes'][_0xf0ab('0x52')]?_0x33dbfc[_0xf0ab('0x51')]:_0x487318[_0xf0ab('0x4b')];if(!_0x283bf5[_0xf0ab('0x4c')][_0xf0ab('0x53')](_0xf0ab('0x54'))){_0x33dbfc[_0xf0ab('0x30')]=qs[_0xf0ab('0x30')](_0x283bf5[_0xf0ab('0x4c')][_0xf0ab('0x30')]);_0x33dbfc['offset']=qs['offset'](_0x283bf5[_0xf0ab('0x4c')]['offset']);}_0x33dbfc['order']=qs[_0xf0ab('0x56')](_0x283bf5[_0xf0ab('0x4c')]['sort']);_0x33dbfc[_0xf0ab('0x83')]=qs[_0xf0ab('0x4e')](_[_0xf0ab('0x10c')](_0x283bf5['query'],_0x487318[_0xf0ab('0x4e')]));_0x33dbfc['where'][_0xf0ab('0x10d')]=_0xa3b903['id'];if(_0x283bf5['query'][_0xf0ab('0x8d')]){_0x33dbfc[_0xf0ab('0x83')]=_[_0xf0ab('0x39')](_0x33dbfc['where'],{'$or':_[_0xf0ab('0x3f')](_0x33dbfc[_0xf0ab('0x51')],function(_0x2ddc1d){var _0x3cef14={};_0x3cef14[_0x2ddc1d]={'$like':'%'+_0x283bf5['query'][_0xf0ab('0x8d')]+'%'};return _0x3cef14;})});}if(_0x283bf5[_0xf0ab('0x4c')]['$gte']){var _0x38ea18=_0x283bf5[_0xf0ab('0x4c')]['$gte']['split'](',');var _0x7ee6b3={};_0x7ee6b3[_0x38ea18[0x0]]={'$gte':moment(_0x38ea18[0x1])[_0xf0ab('0xe9')](_0xf0ab('0x10e'))};_0x33dbfc['where']=_[_0xf0ab('0x39')](_0x33dbfc['where'],_0x7ee6b3);}_0x33dbfc=_[_0xf0ab('0x39')]({},_0x33dbfc,_0x283bf5['options']);return db[_0xf0ab('0xd0')]['count']({'where':_0x33dbfc['where']})['then'](function(_0x1d1451){_0x546e13['count']=_0x1d1451;if(_0x283bf5[_0xf0ab('0x4c')][_0xf0ab('0xba')]){_0x33dbfc[_0xf0ab('0xbb')]=[{'all':!![]}];}return db[_0xf0ab('0xd0')][_0xf0ab('0x10f')](_0x33dbfc);})['then'](function(_0x16a1d2){_0x546e13[_0xf0ab('0xb8')]=_0x16a1d2;return _0x546e13;});}})[_0xf0ab('0x21')](respondWithFilteredResult(_0x1afcea,_0x33dbfc))[_0xf0ab('0x46')](handleError(_0x1afcea,null));};exports[_0xf0ab('0x110')]=function(_0x4b91de,_0x3a602f,_0x47788a){var _0x3592f1={'where':{}},_0x577f13={},_0x2f99c2={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xf0ab('0xc0')]({'where':{'id':_0x4b91de[_0xf0ab('0xbd')]['id']}})['then'](handleEntityNotFound(_0x3a602f,null))['then'](function(_0x43c6b8){if(_0x43c6b8){_0x577f13['model']=_[_0xf0ab('0x4d')](db[_0xf0ab('0xd0')][_0xf0ab('0x47')]);_0x577f13[_0xf0ab('0x4c')]=_[_0xf0ab('0x4d')](_0x4b91de[_0xf0ab('0x4c')]);_0x577f13['filters']=_[_0xf0ab('0x4f')](_0x577f13[_0xf0ab('0x4b')],_0x577f13[_0xf0ab('0x4c')]);_0x3592f1[_0xf0ab('0x51')]=_[_0xf0ab('0x4f')](_0x577f13[_0xf0ab('0x4b')],qs[_0xf0ab('0x50')](_0x4b91de['query'][_0xf0ab('0x50')]));_0x3592f1[_0xf0ab('0x51')]=_0x3592f1['attributes'][_0xf0ab('0x52')]?_0x3592f1['attributes']:_0x577f13[_0xf0ab('0x4b')];if(!_0x4b91de['query']['hasOwnProperty']('nolimit')){_0x3592f1[_0xf0ab('0x30')]=qs[_0xf0ab('0x30')](_0x4b91de[_0xf0ab('0x4c')][_0xf0ab('0x30')]);_0x3592f1[_0xf0ab('0x2e')]=qs[_0xf0ab('0x2e')](_0x4b91de[_0xf0ab('0x4c')][_0xf0ab('0x2e')]);}_0x3592f1[_0xf0ab('0x55')]=qs[_0xf0ab('0x56')](_0x4b91de[_0xf0ab('0x4c')][_0xf0ab('0x56')]);_0x3592f1[_0xf0ab('0x83')]=qs[_0xf0ab('0x4e')](_[_0xf0ab('0x10c')](_0x4b91de[_0xf0ab('0x4c')],_0x577f13[_0xf0ab('0x4e')]));_0x3592f1['where'][_0xf0ab('0x10d')]=_0x43c6b8['id'];if(_0x4b91de['query'][_0xf0ab('0x8d')]){_0x3592f1['where']=_[_0xf0ab('0x39')](_0x3592f1[_0xf0ab('0x83')],{'$or':_[_0xf0ab('0x3f')](_0x3592f1['attributes'],function(_0x58f64c){var _0x5dc7d4={};_0x5dc7d4[_0x58f64c]={'$like':'%'+_0x4b91de[_0xf0ab('0x4c')][_0xf0ab('0x8d')]+'%'};return _0x5dc7d4;})});}_0x3592f1['where'][_0xf0ab('0xfc')]=![];if(_0x4b91de[_0xf0ab('0x4c')]['id']){_0x3592f1[_0xf0ab('0x83')]['id']={'$gt':_0x4b91de[_0xf0ab('0x4c')]['id']};}_0x3592f1=_['merge']({},_0x3592f1,_0x4b91de['options']);return db[_0xf0ab('0xd0')][_0xf0ab('0x31')]({'where':_0x3592f1[_0xf0ab('0x83')]})[_0xf0ab('0x21')](function(_0x2ab983){_0x2f99c2['count']=_0x2ab983;_0x3592f1[_0xf0ab('0xbb')]=[];if(_0x4b91de['query'][_0xf0ab('0x111')]){_0x3592f1[_0xf0ab('0xbb')][_0xf0ab('0x45')]({'model':db['User'],'as':_0xf0ab('0xec'),'attributes':['id',_0xf0ab('0x40'),_0xf0ab('0xf7')]});}if(_0x4b91de[_0xf0ab('0x4c')]['includeAll']){_0x3592f1[_0xf0ab('0xbb')]=[{'all':!![]}];}return db[_0xf0ab('0xd0')][_0xf0ab('0x10f')](_0x3592f1);})[_0xf0ab('0x21')](function(_0x3d70c0){_0x2f99c2[_0xf0ab('0xb8')]=_0x3d70c0;return _0x2f99c2;});}})[_0xf0ab('0x21')](respondWithFilteredResult(_0x3a602f,_0x3592f1))[_0xf0ab('0x46')](handleError(_0x3a602f,null));};exports['addTags']=function(_0x4d10af,_0x5cf4bd,_0x368523){return db['ChatInteraction'][_0xf0ab('0x6c')]({'where':{'id':_0x4d10af['params']['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x5cf4bd,null))[_0xf0ab('0x21')](function(_0x46a38a){if(_0x46a38a){return _0x46a38a[_0xf0ab('0x112')](_0x4d10af[_0xf0ab('0x3a')][_0xf0ab('0x10a')],_['omit'](_0x4d10af[_0xf0ab('0x3a')],[_0xf0ab('0x10a'),'id'])||{})[_0xf0ab('0x113')](function(){return db['Tag'][_0xf0ab('0x10f')]({'attributes':['id',_0xf0ab('0x37'),_0xf0ab('0x59')],'where':{'id':_0x4d10af[_0xf0ab('0x3a')][_0xf0ab('0x10a')]}});})[_0xf0ab('0x21')](function(_0x1df97b){socket[_0xf0ab('0x114')](_0xf0ab('0x115'),{'id':Number(_0x4d10af[_0xf0ab('0xbd')]['id']),'tags':_0x1df97b||[]});return{'id':Number(_0x4d10af[_0xf0ab('0xbd')]['id']),'tags':_0x1df97b||[]};});}})[_0xf0ab('0x21')](respondWithResult(_0x5cf4bd,null))['catch'](handleError(_0x5cf4bd,null));};exports[_0xf0ab('0x116')]=function(_0x3ca465,_0x4e379d,_0x122e66){return db['ChatInteraction'][_0xf0ab('0x6c')]({'where':{'id':_0x3ca465[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x4e379d,null))[_0xf0ab('0x21')](function(_0x5c56e0){if(_0x5c56e0){return _0x5c56e0[_0xf0ab('0x116')](_0x3ca465[_0xf0ab('0x4c')][_0xf0ab('0x10a')]);}})['then'](respondWithStatusCode(_0x4e379d,null))[_0xf0ab('0x46')](handleError(_0x4e379d,null));};exports[_0xf0ab('0xe7')]=function(_0x2baa40,_0x4ff52d){var _0x2a2fea=moment()[_0xf0ab('0x117')]()[_0xf0ab('0xa0')]();var _0x4eccbd=path['join'](config['root'],_0xf0ab('0x118'),_0xf0ab('0x119'),_0xf0ab('0x11a'));var _0x5b6475=path[_0xf0ab('0xe5')](config[_0xf0ab('0x11b')],'server',_0xf0ab('0x119'),_0xf0ab('0x11c'));var _0x595bda=path[_0xf0ab('0xe5')](_0x4eccbd,_0x2a2fea);var _0x2bd3e3=util['format']('transcript-%d-%s.zip',_0x2baa40[_0xf0ab('0xbd')]['id'],_0x2a2fea);var _0x25242e=path[_0xf0ab('0xe5')](_0x4eccbd,_0x2bd3e3);var _0x3d8794=[];_0x3d8794[_0xf0ab('0x45')]({'model':db['User'],'as':_0xf0ab('0xec'),'attributes':['id','fullname'],'raw':!![]});_0x3d8794[_0xf0ab('0x45')]({'model':db[_0xf0ab('0xed')],'as':_0xf0ab('0x70'),'attributes':['id','firstName',_0xf0ab('0x11d')],'raw':!![]});if(_0x2baa40[_0xf0ab('0x4c')][_0xf0ab('0x11c')]){_0x3d8794[_0xf0ab('0x45')]({'model':db[_0xf0ab('0xe0')],'as':'Attachment','raw':!![]});}var _0x243763=[{'model':db[_0xf0ab('0xd0')],'as':_0xf0ab('0xee'),'attributes':['id',_0xf0ab('0x3a'),'createdAt',_0xf0ab('0xfb'),_0xf0ab('0xfc'),_0xf0ab('0x88')],'include':_0x3d8794}];_0x243763['push']({'model':db[_0xf0ab('0xbf')],'as':_0xf0ab('0x11e'),'attributes':['id',_0xf0ab('0x37')]});_0x243763['push']({'model':db[_0xf0ab('0xec')],'as':_0xf0ab('0x11f'),'attributes':['id',_0xf0ab('0x40')]});return db[_0xf0ab('0xa1')]['find']({'where':{'id':_0x2baa40[_0xf0ab('0xbd')]['id']},'include':_0x243763})[_0xf0ab('0x21')](handleEntityNotFound(_0x4ff52d,null))[_0xf0ab('0x21')](function(_0x2c2e20){if(_0x2c2e20){var _0x57bd77=_0x2c2e20[_0xf0ab('0x120')]({'plain':!![]});fs[_0xf0ab('0x121')](_0x595bda);var _0x169b02={'channel':_0xf0ab('0x122'),'account':_0x57bd77[_0xf0ab('0x11e')]['name'],'agent':_0x57bd77[_0xf0ab('0x11f')]?_0x57bd77['Owner'][_0xf0ab('0x40')]:_0xf0ab('0x123'),'createdAt':moment(_0x57bd77[_0xf0ab('0xf9')])['format'](_0xf0ab('0x10e'))['toString'](),'closedAt':_0x57bd77['closed']?moment(_0x57bd77['closedAt'])[_0xf0ab('0xe9')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x57bd77[_0xf0ab('0xda')],'chatInfo':{'browser':_0x57bd77[_0xf0ab('0x124')],'os':_0x57bd77[_0xf0ab('0x125')],'referer':_0x57bd77[_0xf0ab('0x126')],'customerIp':_0x57bd77[_0xf0ab('0x127')],'customerPort':_0x57bd77['customerPort']?_0x57bd77[_0xf0ab('0x128')]:_0xf0ab('0x123')},'messages':_(_0x57bd77['Messages'])[_0xf0ab('0x129')]()[_0xf0ab('0x8d')]({'secret':![]})[_0xf0ab('0x3f')](function(_0x2aa512){if(_0x2aa512['Attachment']){var _0x26009e=path[_0xf0ab('0xe5')](_0x5b6475,_0x2aa512['Attachment'][_0xf0ab('0xdd')]);if(fs[_0xf0ab('0x12a')](_0x26009e)){fs['createReadStream'](_0x26009e)[_0xf0ab('0x12b')](fs[_0xf0ab('0x12c')](path['join'](_0x595bda,_0x2aa512[_0xf0ab('0xe0')][_0xf0ab('0xdd')])));}}return{'date':moment(_0x2aa512[_0xf0ab('0xf9')])[_0xf0ab('0xe9')](_0xf0ab('0x10e'))['toString'](),'sender':_0x2aa512[_0xf0ab('0xfb')]==='out'?_0x2aa512[_0xf0ab('0xec')]?_0x2aa512['User'][_0xf0ab('0x40')]:_0xf0ab('0xf1'):_0x2aa512[_0xf0ab('0x70')][_0xf0ab('0x12d')]+(_0x2aa512[_0xf0ab('0x70')][_0xf0ab('0x11d')]?'\x20'+_0x2aa512[_0xf0ab('0x70')]['lastName']:''),'body':_0x2aa512[_0xf0ab('0xe0')]?_0x2aa512[_0xf0ab('0xe0')][_0xf0ab('0xdd')]:_0x2aa512[_0xf0ab('0x3a')],'direction':_0x2aa512[_0xf0ab('0xfb')]==='out'?'A':'C','secret':_0x2aa512[_0xf0ab('0xfc')],'read':_0x2aa512[_0xf0ab('0x88')],'attachment':_0x2aa512[_0xf0ab('0xe0')]};})[_0xf0ab('0x72')]()};return ejs['renderFile'](path[_0xf0ab('0xe5')](config[_0xf0ab('0x11b')],_0xf0ab('0x118'),_0xf0ab('0x12e'),'downloadInteraction.ejs'),{'interaction':_0x169b02})['then'](function(_0x3ad886){var _0x3df4a2=path['join'](_0x595bda,'transcript-'+_0x57bd77['id']+'-'+_0x2a2fea+_0xf0ab('0x12f'));var _0x378d44={'path':_0x3df4a2,'channel':_0xf0ab('0x122'),'interactionId':_0x57bd77['id']};return pdf[_0xf0ab('0x130')](_0x3ad886,_0x378d44);})[_0xf0ab('0x21')](function(){return new BPromise(function(_0x1e4acb,_0x25a1eb){zipdir(_0x595bda,{'saveTo':_0x25242e},function(_0x406090,_0x414d09){if(_0x406090)return _0x25a1eb(_0x406090);return _0x1e4acb(_0x414d09);});})[_0xf0ab('0x21')](function(){return new BPromise(function(_0x235528,_0x581c80){rimraf(_0x595bda,function(_0x14332a){if(_0x14332a)_0x581c80(_0x14332a);return _0x235528();});});})[_0xf0ab('0x21')](function(){return _0x4ff52d[_0xf0ab('0xe7')](_0x25242e,_0x2bd3e3,function(_0x4f9211){if(_0x4f9211){console[_0xf0ab('0x131')](_0xf0ab('0x132'),_0x4f9211);}else{fs[_0xf0ab('0x133')](_0x25242e);}});});});}else{return _0x4ff52d['sendStatus'](0xc8);}})[_0xf0ab('0x46')](handleError(_0x4ff52d,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index df9f5a3..58e9913 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 _0xa8bb=['emit','catch','hasOwnProperty','hook','events','../../mysqldb','ChatInteraction','setMaxListeners','save','update','getUsers','setDataValue','Users','map','then','length'];(function(_0xf0bc07,_0x510ebf){var _0x1c50c2=function(_0x2e2bdf){while(--_0x2e2bdf){_0xf0bc07['push'](_0xf0bc07['shift']());}};_0x1c50c2(++_0x510ebf);}(_0xa8bb,0x124));var _0xba8b=function(_0xbec40d,_0x573009){_0xbec40d=_0xbec40d-0x0;var _0x424666=_0xa8bb[_0xbec40d];return _0x424666;};'use strict';var EventEmitter=require(_0xba8b('0x0'));var ChatInteraction=require(_0xba8b('0x1'))['db'][_0xba8b('0x2')];var ChatMessage=require(_0xba8b('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xba8b('0x3')](0x0);var events={'afterCreate':_0xba8b('0x4'),'afterUpdate':_0xba8b('0x5'),'afterDestroy':'remove'};function emitEvent(_0x230b65){return function(_0xf38122,_0x43b7ac,_0x1abc5d){_0xf38122[_0xba8b('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5c3689){_0xf38122[_0xba8b('0x7')](_0xba8b('0x8'),_0x5c3689[_0xba8b('0x9')](function(_0x10a31a){return{'id':_0x10a31a['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0xf38122['id'],'direction':'in','read':![]},'raw':!![]});})[_0xba8b('0xa')](function(_0x2a9b2a){_0xf38122[_0xba8b('0x7')]('unreadMessages',_0x2a9b2a[_0xba8b('0xb')]);ChatInteractionEvents[_0xba8b('0xc')](_0x230b65+':'+_0xf38122['id'],_0xf38122);ChatInteractionEvents[_0xba8b('0xc')](_0x230b65,_0xf38122);_0x1abc5d(null);})[_0xba8b('0xd')](_0x1abc5d(null));};}for(var e in events){if(events[_0xba8b('0xe')](e)){var event=events[e];ChatInteraction[_0xba8b('0xf')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file +var _0x1e4e=['Users','then','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','remove'];(function(_0x166e62,_0x398c3d){var _0x1b580b=function(_0x1b70f7){while(--_0x1b70f7){_0x166e62['push'](_0x166e62['shift']());}};_0x1b580b(++_0x398c3d);}(_0x1e4e,0x79));var _0xe1e4=function(_0x47318f,_0x37198e){_0x47318f=_0x47318f-0x0;var _0x5b6fe6=_0x1e4e[_0x47318f];return _0x5b6fe6;};'use strict';var EventEmitter=require(_0xe1e4('0x0'));var ChatInteraction=require(_0xe1e4('0x1'))['db'][_0xe1e4('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0xe1e4('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xe1e4('0x4')](0x0);var events={'afterCreate':_0xe1e4('0x5'),'afterUpdate':'update','afterDestroy':_0xe1e4('0x6')};function emitEvent(_0x11bd24){return function(_0x36b85a,_0x2ac7d3,_0xf27133){_0x36b85a['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x252ef7){_0x36b85a['setDataValue'](_0xe1e4('0x7'),_0x252ef7['map'](function(_0x385d30){return{'id':_0x385d30['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x36b85a['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe1e4('0x8')](function(_0x4edd13){_0x36b85a[_0xe1e4('0x9')](_0xe1e4('0xa'),_0x4edd13[_0xe1e4('0xb')]);ChatInteractionEvents[_0xe1e4('0xc')](_0x11bd24+':'+_0x36b85a['id'],_0x36b85a);ChatInteractionEvents['emit'](_0x11bd24,_0x36b85a);_0xf27133(null);})[_0xe1e4('0xd')](_0xf27133(null));};}for(var e in events){if(events[_0xe1e4('0xe')](e)){var event=events[e];ChatInteraction[_0xe1e4('0xf')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 50fc926..6725883 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 _0xadc7=['changed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','rimraf','exports','define','ChatInteraction','chat_interactions'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xadc7,0x11d));var _0x7adc=function(_0x1bec0d,_0x338db4){_0x1bec0d=_0x1bec0d-0x0;var _0x49e3e3=_0xadc7[_0x1bec0d];return _0x49e3e3;};'use strict';var _=require('lodash');var util=require(_0x7adc('0x0'));var logger=require(_0x7adc('0x1'))(_0x7adc('0x2'));var moment=require(_0x7adc('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7adc('0x4'));var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module[_0x7adc('0x5')]=function(_0x128fb3,_0x503fcb){return _0x128fb3[_0x7adc('0x6')](_0x7adc('0x7'),attributes,{'tableName':_0x7adc('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x20cd5d,_0x3f508f,_0x51ef69){if(_0x20cd5d[_0x7adc('0x9')]('closed')){_0x20cd5d['closedAt']=moment()[_0x7adc('0xa')](_0x7adc('0xb'));}_0x51ef69(null,_0x20cd5d);}},'charset':_0x7adc('0xc'),'collate':_0x7adc('0xd')});}; \ No newline at end of file +var _0x894e=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','chat_interactions','changed','closed','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci'];(function(_0x818df1,_0x59619f){var _0x21efbd=function(_0xec33f){while(--_0xec33f){_0x818df1['push'](_0x818df1['shift']());}};_0x21efbd(++_0x59619f);}(_0x894e,0x1a0));var _0xe894=function(_0x52835d,_0x47b9b3){_0x52835d=_0x52835d-0x0;var _0x5724c0=_0x894e[_0x52835d];return _0x5724c0;};'use strict';var _=require(_0xe894('0x0'));var util=require('util');var logger=require(_0xe894('0x1'))(_0xe894('0x2'));var moment=require(_0xe894('0x3'));var BPromise=require(_0xe894('0x4'));var rp=require(_0xe894('0x5'));var fs=require('fs');var path=require(_0xe894('0x6'));var rimraf=require(_0xe894('0x7'));var config=require(_0xe894('0x8'));var attributes=require('./chatInteraction.attributes');module[_0xe894('0x9')]=function(_0x40d08c,_0x360b5e){return _0x40d08c['define']('ChatInteraction',attributes,{'tableName':_0xe894('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5a69f5,_0x234662,_0xdc513b){if(_0x5a69f5[_0xe894('0xb')](_0xe894('0xc'))){_0x5a69f5['closedAt']=moment()['format'](_0xe894('0xd'));}_0xdc513b(null,_0x5a69f5);}},'charset':_0xe894('0xe'),'collate':_0xe894('0xf')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 7407949..980f889 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 _0xd7d6=['ids','AddTags','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UpdateChatInteraction','ChatInteraction','update','options','where','attributes','limit','then','debug','AddTagsToChatInteraction','find','body'];(function(_0xf1a516,_0x4b7594){var _0x6792d2=function(_0x2bbdf1){while(--_0x2bbdf1){_0xf1a516['push'](_0xf1a516['shift']());}};_0x6792d2(++_0x4b7594);}(_0xd7d6,0x113));var _0x6d7d=function(_0x57d13b,_0x52d8cb){_0x57d13b=_0x57d13b-0x0;var _0x467696=_0xd7d6[_0x57d13b];return _0x467696;};'use strict';var _=require(_0x6d7d('0x0'));var util=require(_0x6d7d('0x1'));var moment=require(_0x6d7d('0x2'));var BPromise=require('bluebird');var rs=require(_0x6d7d('0x3'));var fs=require('fs');var Redis=require(_0x6d7d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6d7d('0x5'));var logger=require(_0x6d7d('0x6'))(_0x6d7d('0x7'));var config=require(_0x6d7d('0x8'));var jayson=require(_0x6d7d('0x9'));var client=jayson['client'][_0x6d7d('0xa')]({'port':0x232a});config[_0x6d7d('0xb')]=_[_0x6d7d('0xc')](config[_0x6d7d('0xb')],{'host':_0x6d7d('0xd'),'port':0x18eb});var socket=require(_0x6d7d('0xe'))(new Redis(config['redis']));require(_0x6d7d('0xf'))[_0x6d7d('0x10')](socket);function respondWithRpcPromise(_0x1c90f4,_0xfe61f5,_0x5da825){return new BPromise(function(_0x377edc,_0x50e1c8){return client['request'](_0x1c90f4,_0x5da825)['then'](function(_0x2a4bc5){logger[_0x6d7d('0x11')](_0x6d7d('0x12'),_0xfe61f5,_0x6d7d('0x13'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0xfe61f5,'request\x20sent',JSON[_0x6d7d('0x14')](_0x2a4bc5));if(_0x2a4bc5[_0x6d7d('0x15')]){if(_0x2a4bc5[_0x6d7d('0x15')][_0x6d7d('0x16')]===0x1f4){logger[_0x6d7d('0x15')]('ChatInteraction,\x20%s,\x20%s',_0xfe61f5,_0x2a4bc5['error'][_0x6d7d('0x17')]);return _0x50e1c8(_0x2a4bc5['error'][_0x6d7d('0x17')]);}logger['error'](_0x6d7d('0x12'),_0xfe61f5,_0x2a4bc5[_0x6d7d('0x15')]['message']);return _0x377edc(_0x2a4bc5['error'][_0x6d7d('0x17')]);}else{logger[_0x6d7d('0x11')](_0x6d7d('0x12'),_0xfe61f5,'request\x20sent');_0x377edc(_0x2a4bc5['result'][_0x6d7d('0x17')]);}})[_0x6d7d('0x18')](function(_0xbb4757){logger[_0x6d7d('0x15')](_0x6d7d('0x12'),_0xfe61f5,_0xbb4757);_0x50e1c8(_0xbb4757);});});}exports[_0x6d7d('0x19')]=function(_0x4be3f8){var _0xabd781=this;return new Promise(function(_0x392116,_0x4f5d53){return db[_0x6d7d('0x1a')][_0x6d7d('0x1b')](_0x4be3f8['body'],{'raw':_0x4be3f8[_0x6d7d('0x1c')]?_0x4be3f8[_0x6d7d('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4be3f8[_0x6d7d('0x1c')]?_0x4be3f8[_0x6d7d('0x1c')][_0x6d7d('0x1d')]||null:null,'attributes':_0x4be3f8[_0x6d7d('0x1c')]?_0x4be3f8[_0x6d7d('0x1c')][_0x6d7d('0x1e')]||null:null,'limit':_0x4be3f8[_0x6d7d('0x1c')]?_0x4be3f8[_0x6d7d('0x1c')][_0x6d7d('0x1f')]||null:null})[_0x6d7d('0x20')](function(_0x38a34e){logger[_0x6d7d('0x11')](_0x6d7d('0x19'),_0x4be3f8);logger[_0x6d7d('0x21')](_0x6d7d('0x19'),_0x4be3f8,JSON['stringify'](_0x38a34e));_0x392116(_0x38a34e);})[_0x6d7d('0x18')](function(_0x5733db){logger[_0x6d7d('0x15')](_0x6d7d('0x19'),_0x5733db[_0x6d7d('0x17')],_0x4be3f8);_0x4f5d53(_0xabd781[_0x6d7d('0x15')](0x1f4,_0x5733db[_0x6d7d('0x17')]));});});};exports[_0x6d7d('0x22')]=function(_0x5d66bd){return new Promise(function(_0xcba6e7,_0x3e22ca){return db[_0x6d7d('0x1a')][_0x6d7d('0x23')]({'where':_0x5d66bd[_0x6d7d('0x1c')]?_0x5d66bd[_0x6d7d('0x1c')]['where']||null:null})[_0x6d7d('0x20')](function(_0xeb26a4){if(_0xeb26a4){return _0xeb26a4['addTags'](_0x5d66bd[_0x6d7d('0x24')]['ids'],_['omit'](_0x5d66bd[_0x6d7d('0x24')],[_0x6d7d('0x25'),'id'])||{});}})['spread'](function(_0x3d5520){logger[_0x6d7d('0x11')](_0x6d7d('0x26'),_0x5d66bd);logger[_0x6d7d('0x21')]('AddTags',_0x5d66bd,JSON[_0x6d7d('0x14')](_0x3d5520));_0xcba6e7(_0x3d5520);})[_0x6d7d('0x18')](function(_0x119879){logger['error'](_0x6d7d('0x26'),_0x119879[_0x6d7d('0x17')],_0x5d66bd);_0x3e22ca(_this['error'](0x1f4,_0x119879[_0x6d7d('0x17')]));});});}; \ No newline at end of file +var _0x6ca2=['../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./chatInteraction.socket','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ChatInteraction','update','body','options','raw','where','attributes','limit','then','UpdateChatInteraction','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x2f1d17,_0x5076aa){var _0x4b1270=function(_0x55125c){while(--_0x55125c){_0x2f1d17['push'](_0x2f1d17['shift']());}};_0x4b1270(++_0x5076aa);}(_0x6ca2,0x181));var _0x26ca=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6ca2[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x26ca('0x0'));var util=require('util');var moment=require(_0x26ca('0x1'));var BPromise=require(_0x26ca('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x26ca('0x3'))['db'];var utils=require(_0x26ca('0x4'));var logger=require(_0x26ca('0x5'))(_0x26ca('0x6'));var config=require(_0x26ca('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x26ca('0x8')][_0x26ca('0x9')]({'port':0x232a});config[_0x26ca('0xa')]=_['defaults'](config[_0x26ca('0xa')],{'host':_0x26ca('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x26ca('0xa')]));require(_0x26ca('0xc'))['register'](socket);function respondWithRpcPromise(_0x3fdf97,_0x5cc4ca,_0x47cc59){return new BPromise(function(_0x3ed7d3,_0x483c0d){return client[_0x26ca('0xd')](_0x3fdf97,_0x47cc59)['then'](function(_0x1ed7a4){logger[_0x26ca('0xe')](_0x26ca('0xf'),_0x5cc4ca,_0x26ca('0x10'));logger[_0x26ca('0x11')](_0x26ca('0x12'),_0x5cc4ca,_0x26ca('0x10'),JSON[_0x26ca('0x13')](_0x1ed7a4));if(_0x1ed7a4[_0x26ca('0x14')]){if(_0x1ed7a4['error'][_0x26ca('0x15')]===0x1f4){logger[_0x26ca('0x14')](_0x26ca('0xf'),_0x5cc4ca,_0x1ed7a4['error'][_0x26ca('0x16')]);return _0x483c0d(_0x1ed7a4[_0x26ca('0x14')][_0x26ca('0x16')]);}logger[_0x26ca('0x14')](_0x26ca('0xf'),_0x5cc4ca,_0x1ed7a4['error'][_0x26ca('0x16')]);return _0x3ed7d3(_0x1ed7a4[_0x26ca('0x14')][_0x26ca('0x16')]);}else{logger[_0x26ca('0xe')]('ChatInteraction,\x20%s,\x20%s',_0x5cc4ca,_0x26ca('0x10'));_0x3ed7d3(_0x1ed7a4['result'][_0x26ca('0x16')]);}})[_0x26ca('0x17')](function(_0xfe6879){logger[_0x26ca('0x14')](_0x26ca('0xf'),_0x5cc4ca,_0xfe6879);_0x483c0d(_0xfe6879);});});}exports['UpdateChatInteraction']=function(_0x19e856){var _0x1c25c3=this;return new Promise(function(_0x85760b,_0x7531bd){return db[_0x26ca('0x18')][_0x26ca('0x19')](_0x19e856[_0x26ca('0x1a')],{'raw':_0x19e856['options']?_0x19e856[_0x26ca('0x1b')][_0x26ca('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19e856[_0x26ca('0x1b')]?_0x19e856['options'][_0x26ca('0x1d')]||null:null,'attributes':_0x19e856['options']?_0x19e856[_0x26ca('0x1b')][_0x26ca('0x1e')]||null:null,'limit':_0x19e856[_0x26ca('0x1b')]?_0x19e856['options'][_0x26ca('0x1f')]||null:null})[_0x26ca('0x20')](function(_0x2b1260){logger[_0x26ca('0xe')](_0x26ca('0x21'),_0x19e856);logger[_0x26ca('0x11')](_0x26ca('0x21'),_0x19e856,JSON[_0x26ca('0x13')](_0x2b1260));_0x85760b(_0x2b1260);})['catch'](function(_0x1ea98d){logger[_0x26ca('0x14')]('UpdateChatInteraction',_0x1ea98d['message'],_0x19e856);_0x7531bd(_0x1c25c3[_0x26ca('0x14')](0x1f4,_0x1ea98d[_0x26ca('0x16')]));});});};exports['AddTagsToChatInteraction']=function(_0x5570a1){return new Promise(function(_0x56983d,_0x2eefa4){return db[_0x26ca('0x18')]['find']({'where':_0x5570a1[_0x26ca('0x1b')]?_0x5570a1['options'][_0x26ca('0x1d')]||null:null})[_0x26ca('0x20')](function(_0x2f3f19){if(_0x2f3f19){return _0x2f3f19[_0x26ca('0x22')](_0x5570a1[_0x26ca('0x1a')][_0x26ca('0x23')],_[_0x26ca('0x24')](_0x5570a1[_0x26ca('0x1a')],[_0x26ca('0x23'),'id'])||{});}})[_0x26ca('0x25')](function(_0x12ba78){logger['info'](_0x26ca('0x26'),_0x5570a1);logger[_0x26ca('0x11')]('AddTags',_0x5570a1,JSON[_0x26ca('0x13')](_0x12ba78));_0x56983d(_0x12ba78);})['catch'](function(_0x10c2c2){logger[_0x26ca('0x14')](_0x26ca('0x26'),_0x10c2c2[_0x26ca('0x16')],_0x5570a1);_0x2eefa4(_this['error'](0x1f4,_0x10c2c2['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 03acd19..a9c1abc 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 _0xd620=['removeListener','register','length','chatInteraction:','remove','update','emit'];(function(_0x49e271,_0x3123f7){var _0x18d416=function(_0x3d2133){while(--_0x3d2133){_0x49e271['push'](_0x49e271['shift']());}};_0x18d416(++_0x3123f7);}(_0xd620,0x1e7));var _0x0d62=function(_0x1988d9,_0x1f92d0){_0x1988d9=_0x1988d9-0x0;var _0x58a335=_0xd620[_0x1988d9];return _0x58a335;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save',_0x0d62('0x0'),_0x0d62('0x1')];function createListener(_0x171136,_0x368b55){return function(_0x45faca){_0x368b55[_0x0d62('0x2')](_0x171136,_0x45faca);};}function removeListener(_0xb1b2a3,_0x4aa8bb){return function(){ChatInteractionEvents[_0x0d62('0x3')](_0xb1b2a3,_0x4aa8bb);};}exports[_0x0d62('0x4')]=function(_0x3fce20){for(var _0x12eafb=0x0,_0x5bc358=events[_0x0d62('0x5')];_0x12eafb<_0x5bc358;_0x12eafb++){var _0x10daec=events[_0x12eafb];var _0xdd9911=createListener(_0x0d62('0x6')+_0x10daec,_0x3fce20);ChatInteractionEvents['on'](_0x10daec,_0xdd9911);}}; \ No newline at end of file +var _0xdf48=['update','emit','removeListener','length','chatInteraction:','save'];(function(_0xf168d3,_0x43dcfc){var _0x17fb54=function(_0x3d9674){while(--_0x3d9674){_0xf168d3['push'](_0xf168d3['shift']());}};_0x17fb54(++_0x43dcfc);}(_0xdf48,0x113));var _0x8df4=function(_0x494ef8,_0x4688df){_0x494ef8=_0x494ef8-0x0;var _0x39c19=_0xdf48[_0x494ef8];return _0x39c19;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x8df4('0x0'),'remove',_0x8df4('0x1')];function createListener(_0x28d63d,_0x31588b){return function(_0x1631e1){_0x31588b[_0x8df4('0x2')](_0x28d63d,_0x1631e1);};}function removeListener(_0x365985,_0x78d3d){return function(){ChatInteractionEvents[_0x8df4('0x3')](_0x365985,_0x78d3d);};}exports['register']=function(_0x20cf09){for(var _0x4e2ce8=0x0,_0x5d33b1=events[_0x8df4('0x4')];_0x4e2ce8<_0x5d33b1;_0x4e2ce8++){var _0x59b430=events[_0x4e2ce8];var _0x551af1=createListener(_0x8df4('0x5')+_0x59b430,_0x20cf09);ChatInteractionEvents['on'](_0x59b430,_0x551af1);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 44b3ffa..74ddbd9 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 _0x87e1=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/my_messages','/:id/download','post','createVidaooSession','join','server/files/attachments/','format','now','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/messages','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','/:id','tracked','chatinteraction:update','put','/:id/custom_update','customUpdate','/:id/abandon','delete','chatinteraction:destroy','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service'];(function(_0x4a6949,_0x546705){var _0x378b9c=function(_0x2f9b87){while(--_0x2f9b87){_0x4a6949['push'](_0x4a6949['shift']());}};_0x378b9c(++_0x546705);}(_0x87e1,0x187));var _0x187e=function(_0x777456,_0x57998f){_0x777456=_0x777456-0x0;var _0x5895b0=_0x87e1[_0x777456];return _0x5895b0;};'use strict';var multer=require(_0x187e('0x0'));var util=require(_0x187e('0x1'));var path=require('path');var timeout=require(_0x187e('0x2'));var express=require('express');var router=express[_0x187e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x187e('0x4'));var interaction=require(_0x187e('0x5'));var config=require(_0x187e('0x6'));var controller=require('./chatInteraction.controller');router[_0x187e('0x7')]('/',auth[_0x187e('0x8')](),controller[_0x187e('0x9')]);router[_0x187e('0x7')]('/describe',auth[_0x187e('0x8')](),controller[_0x187e('0xa')]);router[_0x187e('0x7')]('/:id',auth[_0x187e('0xb')](),controller['show']);router[_0x187e('0x7')](_0x187e('0xc'),auth[_0x187e('0xb')](),controller[_0x187e('0xd')]);router[_0x187e('0x7')]('/:id/messages',auth[_0x187e('0x8')](),controller['getMessages']);router[_0x187e('0x7')](_0x187e('0xe'),auth[_0x187e('0xb')](),controller['getMyMessages']);router[_0x187e('0x7')](_0x187e('0xf'),auth[_0x187e('0x8')](),controller['download']);router[_0x187e('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/vidaoo',auth['isAuthenticated'](),controller[_0x187e('0x11')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1b2dcf,_0x39941c,_0x262ad6){_0x262ad6(null,path[_0x187e('0x12')](config['root'],_0x187e('0x13')));},'filename':function(_0x74f6de,_0x4fd76b,_0x21441b){_0x21441b(null,util[_0x187e('0x14')]('%s-%s',Date[_0x187e('0x15')](),_0x4fd76b['originalname'][_0x187e('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x187e('0x10')](_0x187e('0x17'),upload[_0x187e('0x18')](_0x187e('0x19')),controller[_0x187e('0x1a')]);router[_0x187e('0x10')](_0x187e('0x1b'),auth[_0x187e('0xb')](),controller[_0x187e('0x1c')]);router[_0x187e('0x10')](_0x187e('0x1d'),auth[_0x187e('0x8')](),interaction['tracked'](_0x187e('0x1e'),_0x187e('0x1f')),controller[_0x187e('0x20')]);router['put'](_0x187e('0x21'),auth[_0x187e('0x8')](),interaction[_0x187e('0x22')]('chat',_0x187e('0x23')),controller['update']);router[_0x187e('0x24')](_0x187e('0x25'),controller[_0x187e('0x26')]);router[_0x187e('0x24')](_0x187e('0x27'),auth[_0x187e('0xb')](),controller['abandon']);router[_0x187e('0x24')]('/:id/close',controller['close']);router[_0x187e('0x28')](_0x187e('0x21'),auth[_0x187e('0x8')](),interaction[_0x187e('0x22')]('chat',_0x187e('0x29')),controller[_0x187e('0x2a')]);router['delete'](_0x187e('0x1d'),auth[_0x187e('0x8')](),controller['removeTags']);module[_0x187e('0x2b')]=router; \ No newline at end of file +var _0x78f8=['path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','/describe','isAuthenticated','describe','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','createVidaooSession','join','root','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','customUpdate','/:id/abandon','/:id/close','close','delete','/:id','/:id/tags','removeTags','exports','multer'];(function(_0x53c103,_0x207914){var _0x21a11a=function(_0x231268){while(--_0x231268){_0x53c103['push'](_0x53c103['shift']());}};_0x21a11a(++_0x207914);}(_0x78f8,0x17f));var _0x878f=function(_0x2082a7,_0x5ecad1){_0x2082a7=_0x2082a7-0x0;var _0x35aeb1=_0x78f8[_0x2082a7];return _0x35aeb1;};'use strict';var multer=require(_0x878f('0x0'));var util=require('util');var path=require(_0x878f('0x1'));var timeout=require('connect-timeout');var express=require(_0x878f('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x878f('0x3'));var interaction=require(_0x878f('0x4'));var config=require(_0x878f('0x5'));var controller=require(_0x878f('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x878f('0x7')](_0x878f('0x8'),auth[_0x878f('0x9')](),controller[_0x878f('0xa')]);router['get']('/:id',auth[_0x878f('0xb')](),controller['show']);router[_0x878f('0x7')]('/:id/attachment_download',auth[_0x878f('0xb')](),controller[_0x878f('0xc')]);router[_0x878f('0x7')](_0x878f('0xd'),auth[_0x878f('0x9')](),controller[_0x878f('0xe')]);router[_0x878f('0x7')](_0x878f('0xf'),auth[_0x878f('0xb')](),controller[_0x878f('0x10')]);router[_0x878f('0x7')](_0x878f('0x11'),auth[_0x878f('0x9')](),controller[_0x878f('0x12')]);router[_0x878f('0x13')]('/',auth[_0x878f('0x9')](),controller[_0x878f('0x14')]);router['post']('/:id/vidaoo',auth[_0x878f('0x9')](),controller[_0x878f('0x15')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3b001e,_0x35c629,_0x21f528){_0x21f528(null,path[_0x878f('0x16')](config[_0x878f('0x17')],'server/files/attachments/'));},'filename':function(_0x1bb7e5,_0x2c8d79,_0x123fc1){_0x123fc1(null,util[_0x878f('0x18')](_0x878f('0x19'),Date[_0x878f('0x1a')](),_0x2c8d79[_0x878f('0x1b')][_0x878f('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x878f('0x13')](_0x878f('0x1d'),upload[_0x878f('0x1e')](_0x878f('0x1f')),controller[_0x878f('0x20')]);router[_0x878f('0x13')](_0x878f('0xd'),auth[_0x878f('0xb')](),controller[_0x878f('0x21')]);router[_0x878f('0x13')]('/:id/tags',auth[_0x878f('0x9')](),interaction[_0x878f('0x22')](_0x878f('0x23'),_0x878f('0x24')),controller['addTags']);router[_0x878f('0x25')]('/:id',auth[_0x878f('0x9')](),interaction[_0x878f('0x22')](_0x878f('0x23'),_0x878f('0x26')),controller['update']);router['put']('/:id/custom_update',controller[_0x878f('0x27')]);router[_0x878f('0x25')](_0x878f('0x28'),auth[_0x878f('0xb')](),controller['abandon']);router[_0x878f('0x25')](_0x878f('0x29'),controller[_0x878f('0x2a')]);router[_0x878f('0x2b')](_0x878f('0x2c'),auth[_0x878f('0x9')](),interaction['tracked'](_0x878f('0x23'),'chatinteraction:destroy'),controller['destroy']);router[_0x878f('0x2b')](_0x878f('0x2d'),auth[_0x878f('0x9')](),controller[_0x878f('0x2e')]);module[_0x878f('0x2f')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 22838ed..88f6433 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 _0x754e=['TEXT','medium','INTEGER','sequelize'];(function(_0x2a95ae,_0x5ab7bd){var _0x38c586=function(_0x5aee1a){while(--_0x5aee1a){_0x2a95ae['push'](_0x2a95ae['shift']());}};_0x38c586(++_0x5ab7bd);}(_0x754e,0x1a7));var _0xe754=function(_0x23ea5d,_0x13922b){_0x23ea5d=_0x23ea5d-0x0;var _0x2a98a6=_0x754e[_0x23ea5d];return _0x2a98a6;};'use strict';var Sequelize=require(_0xe754('0x0'));module['exports']={'body':{'type':Sequelize[_0xe754('0x1')](_0xe754('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xe754('0x3')]}}; \ No newline at end of file +var _0x49ce=['BOOLEAN','sequelize','exports','TEXT','medium'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x49ce,0x100));var _0xe49c=function(_0x4ee881,_0x10ddc8){_0x4ee881=_0x4ee881-0x0;var _0x305f48=_0x49ce[_0x4ee881];return _0x305f48;};'use strict';var Sequelize=require(_0xe49c('0x0'));module[_0xe49c('0x1')]={'body':{'type':Sequelize[_0xe49c('0x2')](_0xe49c('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xe49c('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index cb6bd48..6a90e6e 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 _0x1fcb=['to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','sendStatus','status','end','undefined','limit','count','offset','json','apply','reject','save','update','name','send','index','map','ChatInternalMessage','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','then','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','destroy','describe','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','admin','user','role','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','agent','resourceId','push','FromId','read','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x1fcb,0x66));var _0xb1fc=function(_0x2632e9,_0x1e57e9){_0x2632e9=_0x2632e9-0x0;var _0x247e3a=_0x1fcb[_0x2632e9];return _0x247e3a;};'use strict';var emlformat=require(_0xb1fc('0x0'));var rimraf=require(_0xb1fc('0x1'));var zipdir=require(_0xb1fc('0x2'));var jsonpatch=require(_0xb1fc('0x3'));var rp=require(_0xb1fc('0x4'));var moment=require(_0xb1fc('0x5'));var BPromise=require(_0xb1fc('0x6'));var Mustache=require(_0xb1fc('0x7'));var util=require(_0xb1fc('0x8'));var path=require('path');var sox=require(_0xb1fc('0x9'));var csv=require(_0xb1fc('0xa'));var ejs=require(_0xb1fc('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb1fc('0xc'));var squel=require(_0xb1fc('0xd'));var crypto=require(_0xb1fc('0xe'));var jsforce=require(_0xb1fc('0xf'));var deskjs=require(_0xb1fc('0x10'));var toCsv=require(_0xb1fc('0xa'));var querystring=require(_0xb1fc('0x11'));var Papa=require(_0xb1fc('0x12'));var Redis=require(_0xb1fc('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xb1fc('0x14'));var as=require(_0xb1fc('0x15'));var hardwareService=require(_0xb1fc('0x16'));var logger=require('../../config/logger')(_0xb1fc('0x17'));var utils=require('../../config/utils');var config=require(_0xb1fc('0x18'));var licenseUtil=require(_0xb1fc('0x19'));var db=require(_0xb1fc('0x1a'))['db'];config[_0xb1fc('0x1b')]=_[_0xb1fc('0x1c')](config[_0xb1fc('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInternalMessage.socket')['register'](socket);function respondWithStatusCode(_0x598dd2,_0x494d27){_0x494d27=_0x494d27||0xcc;return function(_0xd1fdab){if(_0xd1fdab){return _0x598dd2[_0xb1fc('0x1d')](_0x494d27);}return _0x598dd2[_0xb1fc('0x1e')](_0x494d27)[_0xb1fc('0x1f')]();};}function respondWithResult(_0x7b018f,_0x2242b2){_0x2242b2=_0x2242b2||0xc8;return function(_0x390c9d){if(_0x390c9d){return _0x7b018f['status'](_0x2242b2)['json'](_0x390c9d);}};}function respondWithFilteredResult(_0x40569b,_0x250c56){return function(_0x21c0f6){if(_0x21c0f6){var _0x33cc31=typeof _0x250c56['offset']===_0xb1fc('0x20')&&typeof _0x250c56[_0xb1fc('0x21')]===_0xb1fc('0x20');var _0x5de3=_0x21c0f6[_0xb1fc('0x22')];var _0x5b22fc=_0x33cc31?0x0:_0x250c56[_0xb1fc('0x23')];var _0x11ea60=_0x33cc31?_0x21c0f6['count']:_0x250c56[_0xb1fc('0x23')]+_0x250c56[_0xb1fc('0x21')];var _0x598d2c;if(_0x11ea60>=_0x5de3){_0x11ea60=_0x5de3;_0x598d2c=0xc8;}else{_0x598d2c=0xce;}_0x40569b[_0xb1fc('0x1e')](_0x598d2c);return _0x40569b['set']('Content-Range',_0x5b22fc+'-'+_0x11ea60+'/'+_0x5de3)[_0xb1fc('0x24')](_0x21c0f6);}return null;};}function patchUpdates(_0x5ecde8){return function(_0x4d4af5){try{jsonpatch[_0xb1fc('0x25')](_0x4d4af5,_0x5ecde8,!![]);}catch(_0x21e38e){return BPromise[_0xb1fc('0x26')](_0x21e38e);}return _0x4d4af5[_0xb1fc('0x27')]();};}function saveUpdates(_0x38b5a4,_0x1724a8){return function(_0x35af2b){if(_0x35af2b){return _0x35af2b[_0xb1fc('0x28')](_0x38b5a4)['then'](function(_0x4bb26c){return _0x4bb26c;});}return null;};}function removeEntity(_0x5de574,_0x1087bd){return function(_0x47db3d){if(_0x47db3d){return _0x47db3d['destroy']()['then'](function(){_0x5de574[_0xb1fc('0x1e')](0xcc)[_0xb1fc('0x1f')]();});}};}function handleEntityNotFound(_0x138991,_0x3f5b62){return function(_0x199e38){if(!_0x199e38){_0x138991[_0xb1fc('0x1d')](0x194);}return _0x199e38;};}function handleError(_0x2fa189,_0x2bd0fc){_0x2bd0fc=_0x2bd0fc||0x1f4;return function(_0x1f879c){logger['error'](_0x1f879c['stack']);if(_0x1f879c['name']){delete _0x1f879c[_0xb1fc('0x29')];}_0x2fa189[_0xb1fc('0x1e')](_0x2bd0fc)[_0xb1fc('0x2a')](_0x1f879c);};}exports[_0xb1fc('0x2b')]=function(_0x4e1592,_0x4485d7){var _0x34215c={},_0x560400={},_0x53938a={'count':0x0,'rows':[]};var _0x3ac6e2=_[_0xb1fc('0x2c')](db[_0xb1fc('0x2d')]['rawAttributes'],function(_0x3fa26a){return{'name':_0x3fa26a[_0xb1fc('0x2e')],'type':_0x3fa26a[_0xb1fc('0x2f')][_0xb1fc('0x30')]};});_0x560400[_0xb1fc('0x31')]=_['map'](_0x3ac6e2,_0xb1fc('0x29'));_0x560400['query']=_[_0xb1fc('0x32')](_0x4e1592[_0xb1fc('0x33')]);_0x560400[_0xb1fc('0x34')]=_[_0xb1fc('0x35')](_0x560400[_0xb1fc('0x31')],_0x560400[_0xb1fc('0x33')]);_0x34215c[_0xb1fc('0x36')]=_[_0xb1fc('0x35')](_0x560400[_0xb1fc('0x31')],qs[_0xb1fc('0x37')](_0x4e1592[_0xb1fc('0x33')][_0xb1fc('0x37')]));_0x34215c[_0xb1fc('0x36')]=_0x34215c[_0xb1fc('0x36')][_0xb1fc('0x38')]?_0x34215c[_0xb1fc('0x36')]:_0x560400[_0xb1fc('0x31')];if(!_0x4e1592[_0xb1fc('0x33')][_0xb1fc('0x39')](_0xb1fc('0x3a'))){_0x34215c[_0xb1fc('0x21')]=qs[_0xb1fc('0x21')](_0x4e1592['query']['limit']);_0x34215c['offset']=qs['offset'](_0x4e1592[_0xb1fc('0x33')][_0xb1fc('0x23')]);}_0x34215c[_0xb1fc('0x3b')]=qs[_0xb1fc('0x3c')](_0x4e1592[_0xb1fc('0x33')][_0xb1fc('0x3c')]);_0x34215c[_0xb1fc('0x3d')]=qs[_0xb1fc('0x34')](_[_0xb1fc('0x3e')](_0x4e1592['query'],_0x560400[_0xb1fc('0x34')]),_0x3ac6e2);if(_0x4e1592[_0xb1fc('0x33')]['filter']){_0x34215c['where']=_[_0xb1fc('0x3f')](_0x34215c['where'],{'$or':_[_0xb1fc('0x2c')](_0x3ac6e2,function(_0x941c9f){if(_0x941c9f[_0xb1fc('0x2f')]!==_0xb1fc('0x40')){var _0x4b090d={};_0x4b090d[_0x941c9f[_0xb1fc('0x29')]]={'$like':'%'+_0x4e1592['query'][_0xb1fc('0x41')]+'%'};return _0x4b090d;}})});}_0x34215c=_[_0xb1fc('0x3f')]({},_0x34215c,_0x4e1592[_0xb1fc('0x42')]);var _0x1661c5={'where':_0x34215c[_0xb1fc('0x3d')]};return db[_0xb1fc('0x2d')][_0xb1fc('0x22')](_0x1661c5)[_0xb1fc('0x43')](function(_0x4c8568){_0x53938a[_0xb1fc('0x22')]=_0x4c8568;if(_0x4e1592[_0xb1fc('0x33')][_0xb1fc('0x44')]){_0x34215c[_0xb1fc('0x45')]=[{'all':!![]}];}return db[_0xb1fc('0x2d')][_0xb1fc('0x46')](_0x34215c);})[_0xb1fc('0x43')](function(_0x453b92){_0x53938a[_0xb1fc('0x47')]=_0x453b92;return _0x53938a;})[_0xb1fc('0x43')](respondWithFilteredResult(_0x4485d7,_0x34215c))[_0xb1fc('0x48')](handleError(_0x4485d7,null));};exports[_0xb1fc('0x49')]=function(_0x38720c,_0x44a1ee){var _0x32552d={'raw':!![],'where':{'id':_0x38720c[_0xb1fc('0x4a')]['id']}},_0x4fda1e={};_0x4fda1e['model']=_[_0xb1fc('0x32')](db['ChatInternalMessage'][_0xb1fc('0x4b')]);_0x4fda1e[_0xb1fc('0x33')]=_[_0xb1fc('0x32')](_0x38720c['query']);_0x4fda1e['filters']=_[_0xb1fc('0x35')](_0x4fda1e['model'],_0x4fda1e[_0xb1fc('0x33')]);_0x32552d['attributes']=_[_0xb1fc('0x35')](_0x4fda1e[_0xb1fc('0x31')],qs[_0xb1fc('0x37')](_0x38720c['query'][_0xb1fc('0x37')]));_0x32552d[_0xb1fc('0x36')]=_0x32552d['attributes'][_0xb1fc('0x38')]?_0x32552d[_0xb1fc('0x36')]:_0x4fda1e['model'];if(_0x38720c[_0xb1fc('0x33')][_0xb1fc('0x44')]){_0x32552d['include']=[{'all':!![]}];}_0x32552d=_[_0xb1fc('0x3f')]({},_0x32552d,_0x38720c[_0xb1fc('0x42')]);return db[_0xb1fc('0x2d')][_0xb1fc('0x4c')](_0x32552d)[_0xb1fc('0x43')](handleEntityNotFound(_0x44a1ee,null))[_0xb1fc('0x43')](respondWithResult(_0x44a1ee,null))[_0xb1fc('0x48')](handleError(_0x44a1ee,null));};exports[_0xb1fc('0x4d')]=function(_0x5ad168,_0x18da08){return db['ChatInternalMessage']['create'](_0x5ad168[_0xb1fc('0x4e')],{})[_0xb1fc('0x43')](respondWithResult(_0x18da08,0xc9))['catch'](handleError(_0x18da08,null));};exports['update']=function(_0x37ed80,_0x27bece){if(_0x37ed80[_0xb1fc('0x4e')]['id']){delete _0x37ed80['body']['id'];}return db[_0xb1fc('0x2d')][_0xb1fc('0x4c')]({'where':{'id':_0x37ed80[_0xb1fc('0x4a')]['id']}})[_0xb1fc('0x43')](handleEntityNotFound(_0x27bece,null))[_0xb1fc('0x43')](saveUpdates(_0x37ed80[_0xb1fc('0x4e')],null))['then'](respondWithResult(_0x27bece,null))[_0xb1fc('0x48')](handleError(_0x27bece,null));};exports[_0xb1fc('0x4f')]=function(_0x1381e6,_0x4d56eb){return db[_0xb1fc('0x2d')][_0xb1fc('0x4c')]({'where':{'id':_0x1381e6[_0xb1fc('0x4a')]['id']}})[_0xb1fc('0x43')](handleEntityNotFound(_0x4d56eb,null))[_0xb1fc('0x43')](removeEntity(_0x4d56eb,null))['catch'](handleError(_0x4d56eb,null));};exports[_0xb1fc('0x50')]=function(_0x2c0ecd,_0x56d42c){return db['ChatInternalMessage'][_0xb1fc('0x50')]()[_0xb1fc('0x43')](respondWithResult(_0x56d42c,null))[_0xb1fc('0x48')](handleError(_0x56d42c,null));};function wrapUser(_0x10feef){return function(_0x4f08d7){var _0x35c228=_0x10feef['get']({'plain':!![]});_0x35c228[_0xb1fc('0x51')]=[];if(_0x4f08d7){_0x35c228[_0xb1fc('0x52')]=_0x4f08d7[_0xb1fc('0x53')];_0x35c228['lastMessage']=_0x4f08d7;}else{_0x35c228[_0xb1fc('0x52')]=moment(0x0)[_0xb1fc('0x54')](_0xb1fc('0x55'));_0x35c228[_0xb1fc('0x56')]={};}return _0x35c228;};}exports[_0xb1fc('0x57')]=function(_0x3b2ee9,_0x90c1e0,_0x5dda0b){var _0x2bbc2b=[];return db[_0xb1fc('0x58')]['findAll']({'where':{'role':['agent',_0xb1fc('0x59'),_0xb1fc('0x5a')]},'attributes':['id','fullname',_0xb1fc('0x29'),_0xb1fc('0x5b'),'userpic','internal',_0xb1fc('0x5c'),_0xb1fc('0x5d'),_0xb1fc('0x5e'),_0xb1fc('0x5f')],'order':qs[_0xb1fc('0x3c')](_0xb1fc('0x60')),'include':[{'model':db[_0xb1fc('0x61')],'as':_0xb1fc('0x62'),'attributes':['id',_0xb1fc('0x29'),'type'],'through':{'attributes':[]}}]})[_0xb1fc('0x43')](function(_0x33c27c){if(_0x33c27c){var _0x22a198=_0x3b2ee9['user'][_0xb1fc('0x63')]({'plain':!![]});if(!_0x22a198)throw new Error(_0xb1fc('0x64'));if(_0x22a198[_0xb1fc('0x5b')]==='user'){return db[_0xb1fc('0x65')][_0xb1fc('0x4c')]({'where':{'name':_0xb1fc('0x66'),'userProfileId':_0x22a198[_0xb1fc('0x67')]},'raw':!![]})['then'](function(_0x2d8878){if(_0x2d8878){if(_0x2d8878[_0xb1fc('0x68')]===0x0){return db[_0xb1fc('0x69')]['findAll']({'where':{'sectionId':_0x2d8878['id']},'raw':!![]})[_0xb1fc('0x43')](function(_0x353b47){var _0x6853a6=[];if(_['isEmpty'](_0x353b47)){_0x6853a6=_['filter'](_0x33c27c,function(_0x305024){if(_0x305024['role']!==_0xb1fc('0x6a')){return _0x305024;}});return _0x6853a6;}else{for(var _0x44d9e7=0x0;_0x44d9e7<_0x33c27c['length'];_0x44d9e7++){var _0xa08e5d=_0x33c27c[_0x44d9e7];if(_0xa08e5d[_0xb1fc('0x5b')]===_0xb1fc('0x6a')){var _0x32d570=_[_0xb1fc('0x4c')](_0x353b47,function(_0x296c3b){return _0x296c3b[_0xb1fc('0x6b')]===_0xa08e5d['id'];});if(_0x32d570)_0x6853a6[_0xb1fc('0x6c')](_0xa08e5d);}else{_0x6853a6[_0xb1fc('0x6c')](_0xa08e5d);}}return _0x6853a6;}});}else{return _0x33c27c;}}else{var _0x1316d1=_['filter'](_0x33c27c,function(_0x1722d4){if(_0x1722d4[_0xb1fc('0x5b')]!==_0xb1fc('0x6a')){return _0x1722d4;}});return _0x1316d1;}});}else{return _0x33c27c;}}})['then'](function(_0x386e84){var _0xf58fc9=[];if(_0x386e84){_0x2bbc2b=_0x386e84;for(var _0x4ad323=0x0;_0x4ad323<_0x386e84[_0xb1fc('0x38')];_0x4ad323+=0x1){_0x2bbc2b[_0x4ad323][_0xb1fc('0x51')]=[];_0xf58fc9[_0xb1fc('0x6c')](db[_0xb1fc('0x2d')][_0xb1fc('0x4c')]({'where':{'FromId':[_0x3b2ee9[_0xb1fc('0x5a')]['id'],_0x386e84[_0x4ad323]['id']],'ToId':[_0x3b2ee9['user']['id'],_0x386e84[_0x4ad323]['id']],'ChatGroupId':null},'attributes':['id',_0xb1fc('0x53'),_0xb1fc('0x6d'),'ToId',_0xb1fc('0x6e'),_0xb1fc('0x4e')],'order':qs[_0xb1fc('0x3c')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x386e84[_0x4ad323])));}return BPromise[_0xb1fc('0x6f')](_0xf58fc9);}return[];})[_0xb1fc('0x43')](function(_0x479eec){return{'rows':_0x479eec,'count':_0x479eec['length']};})[_0xb1fc('0x43')](respondWithResult(_0x90c1e0,null))['catch'](handleError(_0x90c1e0,null));}; \ No newline at end of file +var _0x2685=['autoAssociation','UserProfileResource','resourceId','push','FromId','ToId','read','all','eml-format','rimraf','zip-dir','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','destroy','then','error','stack','name','index','ChatInternalMessage','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','catch','show','params','keys','find','create','body','update','describe','messages','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','user','fullname','userpic','internal','online','lastLoginAt','showWebBar','-online','VoiceQueue','VoiceQueues','get','role','UserProfileSection','Agents','userProfileId'];(function(_0x3b7111,_0x588944){var _0x28e1b1=function(_0x674627){while(--_0x674627){_0x3b7111['push'](_0x3b7111['shift']());}};_0x28e1b1(++_0x588944);}(_0x2685,0x78));var _0x5268=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x2685[_0x38537f];return _0x141e23;};'use strict';var emlformat=require(_0x5268('0x0'));var rimraf=require(_0x5268('0x1'));var zipdir=require(_0x5268('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5268('0x3'));var util=require(_0x5268('0x4'));var path=require(_0x5268('0x5'));var sox=require(_0x5268('0x6'));var csv=require('to-csv');var ejs=require(_0x5268('0x7'));var fs=require('fs');var fs_extra=require(_0x5268('0x8'));var _=require(_0x5268('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5268('0xa'));var deskjs=require(_0x5268('0xb'));var toCsv=require(_0x5268('0xc'));var querystring=require(_0x5268('0xd'));var Papa=require(_0x5268('0xe'));var Redis=require(_0x5268('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5268('0x10'));var as=require(_0x5268('0x11'));var hardwareService=require(_0x5268('0x12'));var logger=require(_0x5268('0x13'))(_0x5268('0x14'));var utils=require(_0x5268('0x15'));var config=require(_0x5268('0x16'));var licenseUtil=require(_0x5268('0x17'));var db=require(_0x5268('0x18'))['db'];config[_0x5268('0x19')]=_['defaults'](config[_0x5268('0x19')],{'host':_0x5268('0x1a'),'port':0x18eb});var socket=require(_0x5268('0x1b'))(new Redis(config['redis']));require(_0x5268('0x1c'))[_0x5268('0x1d')](socket);function respondWithStatusCode(_0xb4f75d,_0x4a54e8){_0x4a54e8=_0x4a54e8||0xcc;return function(_0x352a4c){if(_0x352a4c){return _0xb4f75d[_0x5268('0x1e')](_0x4a54e8);}return _0xb4f75d[_0x5268('0x1f')](_0x4a54e8)[_0x5268('0x20')]();};}function respondWithResult(_0x4a83e8,_0x3acdc0){_0x3acdc0=_0x3acdc0||0xc8;return function(_0x39a6eb){if(_0x39a6eb){return _0x4a83e8[_0x5268('0x1f')](_0x3acdc0)['json'](_0x39a6eb);}};}function respondWithFilteredResult(_0x22146a,_0x443725){return function(_0x4b769a){if(_0x4b769a){var _0x12fd6d=typeof _0x443725[_0x5268('0x21')]===_0x5268('0x22')&&typeof _0x443725[_0x5268('0x23')]==='undefined';var _0x2d3fb9=_0x4b769a[_0x5268('0x24')];var _0x4d0a0c=_0x12fd6d?0x0:_0x443725[_0x5268('0x21')];var _0x266b88=_0x12fd6d?_0x4b769a[_0x5268('0x24')]:_0x443725[_0x5268('0x21')]+_0x443725[_0x5268('0x23')];var _0x59d292;if(_0x266b88>=_0x2d3fb9){_0x266b88=_0x2d3fb9;_0x59d292=0xc8;}else{_0x59d292=0xce;}_0x22146a[_0x5268('0x1f')](_0x59d292);return _0x22146a[_0x5268('0x25')](_0x5268('0x26'),_0x4d0a0c+'-'+_0x266b88+'/'+_0x2d3fb9)[_0x5268('0x27')](_0x4b769a);}return null;};}function patchUpdates(_0x22e667){return function(_0xd7008a){try{jsonpatch['apply'](_0xd7008a,_0x22e667,!![]);}catch(_0x7e9538){return BPromise[_0x5268('0x28')](_0x7e9538);}return _0xd7008a[_0x5268('0x29')]();};}function saveUpdates(_0x5d3dd8,_0x402935){return function(_0x332352){if(_0x332352){return _0x332352['update'](_0x5d3dd8)['then'](function(_0x45e406){return _0x45e406;});}return null;};}function removeEntity(_0x5f56ad,_0x4c4362){return function(_0x2c9c5f){if(_0x2c9c5f){return _0x2c9c5f[_0x5268('0x2a')]()[_0x5268('0x2b')](function(){_0x5f56ad[_0x5268('0x1f')](0xcc)[_0x5268('0x20')]();});}};}function handleEntityNotFound(_0x29c76d,_0x32aed2){return function(_0x254c6f){if(!_0x254c6f){_0x29c76d[_0x5268('0x1e')](0x194);}return _0x254c6f;};}function handleError(_0x1922af,_0x4fd728){_0x4fd728=_0x4fd728||0x1f4;return function(_0x424e99){logger[_0x5268('0x2c')](_0x424e99[_0x5268('0x2d')]);if(_0x424e99[_0x5268('0x2e')]){delete _0x424e99[_0x5268('0x2e')];}_0x1922af[_0x5268('0x1f')](_0x4fd728)['send'](_0x424e99);};}exports[_0x5268('0x2f')]=function(_0x324317,_0x2a1b97){var _0x4a3df8={},_0x1c7844={},_0xbd4927={'count':0x0,'rows':[]};var _0x3153=_['map'](db[_0x5268('0x30')][_0x5268('0x31')],function(_0x244519){return{'name':_0x244519[_0x5268('0x32')],'type':_0x244519[_0x5268('0x33')][_0x5268('0x34')]};});_0x1c7844[_0x5268('0x35')]=_[_0x5268('0x36')](_0x3153,_0x5268('0x2e'));_0x1c7844[_0x5268('0x37')]=_['keys'](_0x324317['query']);_0x1c7844[_0x5268('0x38')]=_['intersection'](_0x1c7844['model'],_0x1c7844['query']);_0x4a3df8['attributes']=_[_0x5268('0x39')](_0x1c7844[_0x5268('0x35')],qs['fields'](_0x324317[_0x5268('0x37')][_0x5268('0x3a')]));_0x4a3df8[_0x5268('0x3b')]=_0x4a3df8[_0x5268('0x3b')][_0x5268('0x3c')]?_0x4a3df8[_0x5268('0x3b')]:_0x1c7844[_0x5268('0x35')];if(!_0x324317[_0x5268('0x37')][_0x5268('0x3d')](_0x5268('0x3e'))){_0x4a3df8[_0x5268('0x23')]=qs[_0x5268('0x23')](_0x324317[_0x5268('0x37')][_0x5268('0x23')]);_0x4a3df8[_0x5268('0x21')]=qs['offset'](_0x324317[_0x5268('0x37')][_0x5268('0x21')]);}_0x4a3df8[_0x5268('0x3f')]=qs[_0x5268('0x40')](_0x324317['query'][_0x5268('0x40')]);_0x4a3df8[_0x5268('0x41')]=qs[_0x5268('0x38')](_[_0x5268('0x42')](_0x324317['query'],_0x1c7844[_0x5268('0x38')]),_0x3153);if(_0x324317[_0x5268('0x37')][_0x5268('0x43')]){_0x4a3df8[_0x5268('0x41')]=_[_0x5268('0x44')](_0x4a3df8[_0x5268('0x41')],{'$or':_[_0x5268('0x36')](_0x3153,function(_0x3a034d){if(_0x3a034d[_0x5268('0x33')]!=='VIRTUAL'){var _0x3cb7c5={};_0x3cb7c5[_0x3a034d[_0x5268('0x2e')]]={'$like':'%'+_0x324317[_0x5268('0x37')]['filter']+'%'};return _0x3cb7c5;}})});}_0x4a3df8=_[_0x5268('0x44')]({},_0x4a3df8,_0x324317['options']);var _0x4de773={'where':_0x4a3df8[_0x5268('0x41')]};return db[_0x5268('0x30')][_0x5268('0x24')](_0x4de773)[_0x5268('0x2b')](function(_0x4a17d1){_0xbd4927[_0x5268('0x24')]=_0x4a17d1;if(_0x324317[_0x5268('0x37')][_0x5268('0x45')]){_0x4a3df8[_0x5268('0x46')]=[{'all':!![]}];}return db[_0x5268('0x30')][_0x5268('0x47')](_0x4a3df8);})[_0x5268('0x2b')](function(_0x14659d){_0xbd4927['rows']=_0x14659d;return _0xbd4927;})['then'](respondWithFilteredResult(_0x2a1b97,_0x4a3df8))[_0x5268('0x48')](handleError(_0x2a1b97,null));};exports[_0x5268('0x49')]=function(_0x2ba589,_0x386395){var _0xbd1935={'raw':!![],'where':{'id':_0x2ba589[_0x5268('0x4a')]['id']}},_0x55b54d={};_0x55b54d[_0x5268('0x35')]=_[_0x5268('0x4b')](db['ChatInternalMessage'][_0x5268('0x31')]);_0x55b54d[_0x5268('0x37')]=_['keys'](_0x2ba589[_0x5268('0x37')]);_0x55b54d[_0x5268('0x38')]=_[_0x5268('0x39')](_0x55b54d['model'],_0x55b54d[_0x5268('0x37')]);_0xbd1935[_0x5268('0x3b')]=_[_0x5268('0x39')](_0x55b54d[_0x5268('0x35')],qs['fields'](_0x2ba589[_0x5268('0x37')][_0x5268('0x3a')]));_0xbd1935[_0x5268('0x3b')]=_0xbd1935['attributes'][_0x5268('0x3c')]?_0xbd1935[_0x5268('0x3b')]:_0x55b54d[_0x5268('0x35')];if(_0x2ba589[_0x5268('0x37')][_0x5268('0x45')]){_0xbd1935[_0x5268('0x46')]=[{'all':!![]}];}_0xbd1935=_[_0x5268('0x44')]({},_0xbd1935,_0x2ba589['options']);return db[_0x5268('0x30')][_0x5268('0x4c')](_0xbd1935)['then'](handleEntityNotFound(_0x386395,null))[_0x5268('0x2b')](respondWithResult(_0x386395,null))[_0x5268('0x48')](handleError(_0x386395,null));};exports[_0x5268('0x4d')]=function(_0x37606a,_0x21740c){return db[_0x5268('0x30')]['create'](_0x37606a[_0x5268('0x4e')],{})[_0x5268('0x2b')](respondWithResult(_0x21740c,0xc9))['catch'](handleError(_0x21740c,null));};exports[_0x5268('0x4f')]=function(_0x5b5e4f,_0x2b458b){if(_0x5b5e4f[_0x5268('0x4e')]['id']){delete _0x5b5e4f[_0x5268('0x4e')]['id'];}return db['ChatInternalMessage'][_0x5268('0x4c')]({'where':{'id':_0x5b5e4f[_0x5268('0x4a')]['id']}})[_0x5268('0x2b')](handleEntityNotFound(_0x2b458b,null))[_0x5268('0x2b')](saveUpdates(_0x5b5e4f['body'],null))[_0x5268('0x2b')](respondWithResult(_0x2b458b,null))[_0x5268('0x48')](handleError(_0x2b458b,null));};exports[_0x5268('0x2a')]=function(_0x5e53b9,_0x42ed53){return db['ChatInternalMessage']['find']({'where':{'id':_0x5e53b9[_0x5268('0x4a')]['id']}})[_0x5268('0x2b')](handleEntityNotFound(_0x42ed53,null))[_0x5268('0x2b')](removeEntity(_0x42ed53,null))[_0x5268('0x48')](handleError(_0x42ed53,null));};exports['describe']=function(_0x3a6221,_0x54ac29){return db['ChatInternalMessage'][_0x5268('0x50')]()[_0x5268('0x2b')](respondWithResult(_0x54ac29,null))[_0x5268('0x48')](handleError(_0x54ac29,null));};function wrapUser(_0x45e635){return function(_0x10a9e4){var _0xef5c7=_0x45e635['get']({'plain':!![]});_0xef5c7[_0x5268('0x51')]=[];if(_0x10a9e4){_0xef5c7[_0x5268('0x52')]=_0x10a9e4[_0x5268('0x53')];_0xef5c7[_0x5268('0x54')]=_0x10a9e4;}else{_0xef5c7['lastMessageAt']=moment(0x0)['format'](_0x5268('0x55'));_0xef5c7[_0x5268('0x54')]={};}return _0xef5c7;};}exports[_0x5268('0x56')]=function(_0x2dca65,_0xea835b,_0x3f7bfe){var _0x29f517=[];return db[_0x5268('0x57')][_0x5268('0x47')]({'where':{'role':[_0x5268('0x58'),'admin',_0x5268('0x59')]},'attributes':['id',_0x5268('0x5a'),_0x5268('0x2e'),'role',_0x5268('0x5b'),_0x5268('0x5c'),_0x5268('0x5d'),_0x5268('0x5e'),'allowmessenger',_0x5268('0x5f')],'order':qs['sort'](_0x5268('0x60')),'include':[{'model':db[_0x5268('0x61')],'as':_0x5268('0x62'),'attributes':['id','name',_0x5268('0x33')],'through':{'attributes':[]}}]})[_0x5268('0x2b')](function(_0x22fa3c){if(_0x22fa3c){var _0x1f01e2=_0x2dca65[_0x5268('0x59')][_0x5268('0x63')]({'plain':!![]});if(!_0x1f01e2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1f01e2[_0x5268('0x64')]===_0x5268('0x59')){return db[_0x5268('0x65')][_0x5268('0x4c')]({'where':{'name':_0x5268('0x66'),'userProfileId':_0x1f01e2[_0x5268('0x67')]},'raw':!![]})[_0x5268('0x2b')](function(_0x2e58aa){if(_0x2e58aa){if(_0x2e58aa[_0x5268('0x68')]===0x0){return db[_0x5268('0x69')][_0x5268('0x47')]({'where':{'sectionId':_0x2e58aa['id']},'raw':!![]})['then'](function(_0x25686c){var _0x59eec0=[];if(_['isEmpty'](_0x25686c)){_0x59eec0=_['filter'](_0x22fa3c,function(_0x13efc2){if(_0x13efc2['role']!==_0x5268('0x58')){return _0x13efc2;}});return _0x59eec0;}else{for(var _0x3e3bbd=0x0;_0x3e3bbd<_0x22fa3c['length'];_0x3e3bbd++){var _0x431295=_0x22fa3c[_0x3e3bbd];if(_0x431295[_0x5268('0x64')]===_0x5268('0x58')){var _0x329174=_[_0x5268('0x4c')](_0x25686c,function(_0x32cd22){return _0x32cd22[_0x5268('0x6a')]===_0x431295['id'];});if(_0x329174)_0x59eec0[_0x5268('0x6b')](_0x431295);}else{_0x59eec0[_0x5268('0x6b')](_0x431295);}}return _0x59eec0;}});}else{return _0x22fa3c;}}else{var _0x3a942b=_['filter'](_0x22fa3c,function(_0x3eb37e){if(_0x3eb37e[_0x5268('0x64')]!==_0x5268('0x58')){return _0x3eb37e;}});return _0x3a942b;}});}else{return _0x22fa3c;}}})[_0x5268('0x2b')](function(_0x33f381){var _0x1e4c72=[];if(_0x33f381){_0x29f517=_0x33f381;for(var _0x2f8c86=0x0;_0x2f8c86<_0x33f381[_0x5268('0x3c')];_0x2f8c86+=0x1){_0x29f517[_0x2f8c86]['messages']=[];_0x1e4c72['push'](db[_0x5268('0x30')][_0x5268('0x4c')]({'where':{'FromId':[_0x2dca65[_0x5268('0x59')]['id'],_0x33f381[_0x2f8c86]['id']],'ToId':[_0x2dca65[_0x5268('0x59')]['id'],_0x33f381[_0x2f8c86]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x5268('0x6c'),_0x5268('0x6d'),_0x5268('0x6e'),_0x5268('0x4e')],'order':qs['sort']('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x33f381[_0x2f8c86])));}return BPromise[_0x5268('0x6f')](_0x1e4c72);}return[];})[_0x5268('0x2b')](function(_0x12a11c){return{'rows':_0x12a11c,'count':_0x12a11c[_0x5268('0x3c')]};})[_0x5268('0x2b')](respondWithResult(_0xea835b,null))['catch'](handleError(_0xea835b,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 7a5bd08..acfce94 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 _0xfbe8=['save','update','emit','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners'];(function(_0xcacf87,_0x3336ec){var _0x26af3b=function(_0x2a542f){while(--_0x2a542f){_0xcacf87['push'](_0xcacf87['shift']());}};_0x26af3b(++_0x3336ec);}(_0xfbe8,0x152));var _0x8fbe=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xfbe8[_0x209941];return _0x1e8729;};'use strict';var EventEmitter=require(_0x8fbe('0x0'));var ChatInternalMessage=require(_0x8fbe('0x1'))['db'][_0x8fbe('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x8fbe('0x3')](0x0);var events={'afterCreate':_0x8fbe('0x4'),'afterUpdate':_0x8fbe('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3500f5){return function(_0x29cbbb,_0x5e36bb,_0x580002){ChatInternalMessageEvents['emit'](_0x3500f5+':'+_0x29cbbb['id'],_0x29cbbb);ChatInternalMessageEvents[_0x8fbe('0x6')](_0x3500f5,_0x29cbbb);_0x580002(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x8fbe('0x7')](e,emitEvent(event));}}module[_0x8fbe('0x8')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x5a6d=['emit','hasOwnProperty','hook','exports','events','ChatInternalMessage','save','update'];(function(_0x2c15d7,_0x13eb66){var _0x461208=function(_0x4270c2){while(--_0x4270c2){_0x2c15d7['push'](_0x2c15d7['shift']());}};_0x461208(++_0x13eb66);}(_0x5a6d,0x1d4));var _0xd5a6=function(_0x315cd3,_0x5e20c1){_0x315cd3=_0x315cd3-0x0;var _0x3a31c5=_0x5a6d[_0x315cd3];return _0x3a31c5;};'use strict';var EventEmitter=require(_0xd5a6('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0xd5a6('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd5a6('0x2'),'afterUpdate':_0xd5a6('0x3'),'afterDestroy':'remove'};function emitEvent(_0x16ee2c){return function(_0x15e432,_0x2223be,_0x59826e){ChatInternalMessageEvents['emit'](_0x16ee2c+':'+_0x15e432['id'],_0x15e432);ChatInternalMessageEvents[_0xd5a6('0x4')](_0x16ee2c,_0x15e432);_0x59826e(null);};}for(var e in events){if(events[_0xd5a6('0x5')](e)){var event=events[e];ChatInternalMessage[_0xd5a6('0x6')](e,emitEvent(event));}}module[_0xd5a6('0x7')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 6247575..ed50d8e 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 _0xdad8=['define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports'];(function(_0x271a43,_0x50d1f3){var _0x56999f=function(_0x1360a5){while(--_0x1360a5){_0x271a43['push'](_0x271a43['shift']());}};_0x56999f(++_0x50d1f3);}(_0xdad8,0x112));var _0x8dad=function(_0x4281fb,_0x5aeaef){_0x4281fb=_0x4281fb-0x0;var _0x15de83=_0xdad8[_0x4281fb];return _0x15de83;};'use strict';var _=require(_0x8dad('0x0'));var util=require(_0x8dad('0x1'));var logger=require(_0x8dad('0x2'))(_0x8dad('0x3'));var moment=require(_0x8dad('0x4'));var BPromise=require(_0x8dad('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8dad('0x6'));var rimraf=require(_0x8dad('0x7'));var config=require(_0x8dad('0x8'));var attributes=require(_0x8dad('0x9'));module[_0x8dad('0xa')]=function(_0x2a6cef,_0x3b73c8){return _0x2a6cef[_0x8dad('0xb')](_0x8dad('0xc'),attributes,{'tableName':_0x8dad('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x8dad('0xe')});}; \ No newline at end of file +var _0xb5dd=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci'];(function(_0x27efcf,_0x320952){var _0xdb0237=function(_0x2a7389){while(--_0x2a7389){_0x27efcf['push'](_0x27efcf['shift']());}};_0xdb0237(++_0x320952);}(_0xb5dd,0x188));var _0xdb5d=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xb5dd[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xdb5d('0x0'));var util=require(_0xdb5d('0x1'));var logger=require(_0xdb5d('0x2'))('api');var moment=require('moment');var BPromise=require(_0xdb5d('0x3'));var rp=require(_0xdb5d('0x4'));var fs=require('fs');var path=require(_0xdb5d('0x5'));var rimraf=require(_0xdb5d('0x6'));var config=require(_0xdb5d('0x7'));var attributes=require(_0xdb5d('0x8'));module[_0xdb5d('0x9')]=function(_0x2748be,_0x36d2ed){return _0x2748be[_0xdb5d('0xa')](_0xdb5d('0xb'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdb5d('0xc'),'collate':_0xdb5d('0xd')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index adf5c56..18f55c7 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 _0x6a6c=['message','info','result','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','localhost','socket.io-emitter','redis','./chatInternalMessage.socket','register','request','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0x6a6c,0x199));var _0xc6a6=function(_0x5a54f2,_0x774ad6){_0x5a54f2=_0x5a54f2-0x0;var _0x1fffe9=_0x6a6c[_0x5a54f2];return _0x1fffe9;};'use strict';var _=require(_0xc6a6('0x0'));var util=require(_0xc6a6('0x1'));var moment=require('moment');var BPromise=require(_0xc6a6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc6a6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc6a6('0x4'));var logger=require(_0xc6a6('0x5'))(_0xc6a6('0x6'));var config=require(_0xc6a6('0x7'));var jayson=require(_0xc6a6('0x8'));var client=jayson['client'][_0xc6a6('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xc6a6('0xa'),'port':0x18eb});var socket=require(_0xc6a6('0xb'))(new Redis(config[_0xc6a6('0xc')]));require(_0xc6a6('0xd'))[_0xc6a6('0xe')](socket);function respondWithRpcPromise(_0x39ffca,_0x5c5bfe,_0x54daf3){return new BPromise(function(_0x1be190,_0x544c1c){return client[_0xc6a6('0xf')](_0x39ffca,_0x54daf3)[_0xc6a6('0x10')](function(_0x4509c4){logger['info'](_0xc6a6('0x11'),_0x5c5bfe,_0xc6a6('0x12'));logger['debug'](_0xc6a6('0x13'),_0x5c5bfe,_0xc6a6('0x12'),JSON[_0xc6a6('0x14')](_0x4509c4));if(_0x4509c4[_0xc6a6('0x15')]){if(_0x4509c4[_0xc6a6('0x15')][_0xc6a6('0x16')]===0x1f4){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x5c5bfe,_0x4509c4[_0xc6a6('0x15')][_0xc6a6('0x17')]);return _0x544c1c(_0x4509c4[_0xc6a6('0x15')]['message']);}logger[_0xc6a6('0x15')](_0xc6a6('0x11'),_0x5c5bfe,_0x4509c4[_0xc6a6('0x15')][_0xc6a6('0x17')]);return _0x1be190(_0x4509c4[_0xc6a6('0x15')][_0xc6a6('0x17')]);}else{logger[_0xc6a6('0x18')](_0xc6a6('0x11'),_0x5c5bfe,_0xc6a6('0x12'));_0x1be190(_0x4509c4[_0xc6a6('0x19')][_0xc6a6('0x17')]);}})[_0xc6a6('0x1a')](function(_0x2debbe){logger['error'](_0xc6a6('0x11'),_0x5c5bfe,_0x2debbe);_0x544c1c(_0x2debbe);});});} \ No newline at end of file +var _0xa711=['redis','defaults','register','request','then','info','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','ChatInternalMessage,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x1b37d7,_0xb98a46){var _0x2d35b6=function(_0x1ce684){while(--_0x1ce684){_0x1b37d7['push'](_0x1b37d7['shift']());}};_0x2d35b6(++_0xb98a46);}(_0xa711,0x6e));var _0x1a71=function(_0x53db5b,_0x24fd31){_0x53db5b=_0x53db5b-0x0;var _0x39b7b9=_0xa711[_0x53db5b];return _0x39b7b9;};'use strict';var _=require(_0x1a71('0x0'));var util=require(_0x1a71('0x1'));var moment=require('moment');var BPromise=require(_0x1a71('0x2'));var rs=require(_0x1a71('0x3'));var fs=require('fs');var Redis=require(_0x1a71('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1a71('0x5'));var logger=require(_0x1a71('0x6'))(_0x1a71('0x7'));var config=require(_0x1a71('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1a71('0x9')]['http']({'port':0x232a});config[_0x1a71('0xa')]=_[_0x1a71('0xb')](config[_0x1a71('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1a71('0xa')]));require('./chatInternalMessage.socket')[_0x1a71('0xc')](socket);function respondWithRpcPromise(_0x4a1285,_0x5a3a59,_0x1c272b){return new BPromise(function(_0xcda80d,_0x25432e){return client[_0x1a71('0xd')](_0x4a1285,_0x1c272b)[_0x1a71('0xe')](function(_0x5d0b5b){logger[_0x1a71('0xf')]('ChatInternalMessage,\x20%s,\x20%s',_0x5a3a59,'request\x20sent');logger[_0x1a71('0x10')](_0x1a71('0x11'),_0x5a3a59,'request\x20sent',JSON['stringify'](_0x5d0b5b));if(_0x5d0b5b['error']){if(_0x5d0b5b[_0x1a71('0x12')]['code']===0x1f4){logger[_0x1a71('0x12')](_0x1a71('0x13'),_0x5a3a59,_0x5d0b5b[_0x1a71('0x12')][_0x1a71('0x14')]);return _0x25432e(_0x5d0b5b[_0x1a71('0x12')][_0x1a71('0x14')]);}logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x5a3a59,_0x5d0b5b[_0x1a71('0x12')][_0x1a71('0x14')]);return _0xcda80d(_0x5d0b5b[_0x1a71('0x12')][_0x1a71('0x14')]);}else{logger[_0x1a71('0xf')]('ChatInternalMessage,\x20%s,\x20%s',_0x5a3a59,_0x1a71('0x15'));_0xcda80d(_0x5d0b5b[_0x1a71('0x16')][_0x1a71('0x14')]);}})[_0x1a71('0x17')](function(_0x3e5104){logger['error'](_0x1a71('0x13'),_0x5a3a59,_0x3e5104);_0x25432e(_0x3e5104);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 05ae8f6..02a790f 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 _0xf455=['chatInternalMessage:','remove','emit','removeListener'];(function(_0x32965b,_0x210925){var _0x400fca=function(_0x31c210){while(--_0x31c210){_0x32965b['push'](_0x32965b['shift']());}};_0x400fca(++_0x210925);}(_0xf455,0xa9));var _0x5f45=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf455[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save',_0x5f45('0x0'),'update'];function createListener(_0x188785,_0xf39443){return function(_0x4d09a8){_0xf39443[_0x5f45('0x1')](_0x188785,_0x4d09a8);};}function removeListener(_0xec4dc1,_0x3f2669){return function(){ChatInternalMessageEvents[_0x5f45('0x2')](_0xec4dc1,_0x3f2669);};}exports['register']=function(_0x258213){for(var _0x5aee53=0x0,_0x5241cd=events['length'];_0x5aee53<_0x5241cd;_0x5aee53++){var _0xda27b6=events[_0x5aee53];var _0x29a407=createListener(_0x5f45('0x3')+_0xda27b6,_0x258213);ChatInternalMessageEvents['on'](_0xda27b6,_0x29a407);}}; \ No newline at end of file +var _0x1054=['register','chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit','removeListener'];(function(_0x336fe2,_0x2cd93e){var _0x36d6c8=function(_0x28bb18){while(--_0x28bb18){_0x336fe2['push'](_0x336fe2['shift']());}};_0x36d6c8(++_0x2cd93e);}(_0x1054,0x10a));var _0x4105=function(_0xa041de,_0x3600e2){_0xa041de=_0xa041de-0x0;var _0x1d654c=_0x1054[_0xa041de];return _0x1d654c;};'use strict';var ChatInternalMessageEvents=require(_0x4105('0x0'));var events=[_0x4105('0x1'),_0x4105('0x2'),_0x4105('0x3')];function createListener(_0x2eedb2,_0x17a3a3){return function(_0x534ba9){_0x17a3a3[_0x4105('0x4')](_0x2eedb2,_0x534ba9);};}function removeListener(_0x3b5f88,_0x515c3a){return function(){ChatInternalMessageEvents[_0x4105('0x5')](_0x3b5f88,_0x515c3a);};}exports[_0x4105('0x6')]=function(_0x22fe0a){for(var _0x358536=0x0,_0x3e25da=events['length'];_0x358536<_0x3e25da;_0x358536++){var _0x51df3a=events[_0x358536];var _0x2fb3fe=createListener(_0x4105('0x7')+_0x51df3a,_0x22fe0a);ChatInternalMessageEvents['on'](_0x51df3a,_0x2fb3fe);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index c094d81..f5ee625 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 _0x3b6b=['show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x3b6b,0x194));var _0xb3b6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3b6b[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xb3b6('0x0'));var util=require(_0xb3b6('0x1'));var path=require('path');var timeout=require(_0xb3b6('0x2'));var express=require(_0xb3b6('0x3'));var router=express[_0xb3b6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb3b6('0x5'));var interaction=require(_0xb3b6('0x6'));var config=require('../../config/environment');var controller=require(_0xb3b6('0x7'));router[_0xb3b6('0x8')]('/',auth[_0xb3b6('0x9')](),controller[_0xb3b6('0xa')]);router[_0xb3b6('0x8')](_0xb3b6('0xb'),auth[_0xb3b6('0x9')](),controller[_0xb3b6('0xc')]);router['get']('/users',auth[_0xb3b6('0x9')](),controller['getUsers']);router[_0xb3b6('0x8')](_0xb3b6('0xd'),auth[_0xb3b6('0x9')](),controller[_0xb3b6('0xe')]);router[_0xb3b6('0xf')]('/',auth[_0xb3b6('0x9')](),controller[_0xb3b6('0x10')]);router[_0xb3b6('0x11')](_0xb3b6('0xd'),controller[_0xb3b6('0x12')]);router[_0xb3b6('0x13')](_0xb3b6('0xd'),auth[_0xb3b6('0x9')](),controller[_0xb3b6('0x14')]);module[_0xb3b6('0x15')]=router; \ No newline at end of file +var _0x5588=['../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','describe','getUsers','show','post','create','put','/:id','update','destroy','exports','multer','util','connect-timeout','Router'];(function(_0x15fce8,_0x7612b7){var _0x3f54aa=function(_0x4c1752){while(--_0x4c1752){_0x15fce8['push'](_0x15fce8['shift']());}};_0x3f54aa(++_0x7612b7);}(_0x5588,0x18b));var _0x8558=function(_0x309e3b,_0x5397fc){_0x309e3b=_0x309e3b-0x0;var _0x21351c=_0x5588[_0x309e3b];return _0x21351c;};'use strict';var multer=require(_0x8558('0x0'));var util=require(_0x8558('0x1'));var path=require('path');var timeout=require(_0x8558('0x2'));var express=require('express');var router=express[_0x8558('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8558('0x4'));var interaction=require(_0x8558('0x5'));var config=require('../../config/environment');var controller=require(_0x8558('0x6'));router[_0x8558('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8558('0x7')]('/describe',auth[_0x8558('0x8')](),controller[_0x8558('0x9')]);router[_0x8558('0x7')]('/users',auth[_0x8558('0x8')](),controller[_0x8558('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x8558('0xb')]);router[_0x8558('0xc')]('/',auth[_0x8558('0x8')](),controller[_0x8558('0xd')]);router[_0x8558('0xe')](_0x8558('0xf'),controller[_0x8558('0x10')]);router['delete'](_0x8558('0xf'),auth['isAuthenticated'](),controller[_0x8558('0x11')]);module[_0x8558('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index f79cd8e..bfae2c5 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 _0x8d05=['sequelize','exports','TEXT','medium','BOOLEAN','out','DATE','STRING'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x8d05,0xe8));var _0x58d0=function(_0x2f8431,_0x10a4b4){_0x2f8431=_0x2f8431-0x0;var _0x2640c7=_0x8d05[_0x2f8431];return _0x2640c7;};'use strict';var Sequelize=require(_0x58d0('0x0'));module[_0x58d0('0x1')]={'body':{'type':Sequelize[_0x58d0('0x2')](_0x58d0('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x58d0('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x58d0('0x5')),'defaultValue':_0x58d0('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x58d0('0x6')]},'providerName':{'type':Sequelize[_0x58d0('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xb2af=['out','DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xb2af,0xd2));var _0xfb2a=function(_0x42d2a7,_0x132483){_0x42d2a7=_0x42d2a7-0x0;var _0x2349fc=_0xb2af[_0x42d2a7];return _0x2349fc;};'use strict';var Sequelize=require(_0xfb2a('0x0'));module[_0xfb2a('0x1')]={'body':{'type':Sequelize[_0xfb2a('0x2')](_0xfb2a('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xfb2a('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xfb2a('0x5')]('in',_0xfb2a('0x6')),'defaultValue':_0xfb2a('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xfb2a('0x7')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xfb2a('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 1f4cf79..69708a4 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 _0x9d17=['get','ChatInteraction','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','User','email','event','EventManager','acceptmessage','formData','chat','ChatInteractionId','RejectMessage','rejectMessage','Sequelize','SELECT','contact','internal','interface','SIP/%s','channel','motionChannel','rejectmessage','parse','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/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./chatMessage.socket','jayson/promise','http','client','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','message','ChatMessage,\x20%s,\x20%s','result','catch','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','ChatMessage','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','include','findAll','rows','params','includeAll','options','find','create','body','describe','chat-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x9d17,0x138));var _0x79d1=function(_0x3aa7b9,_0x3a331e){_0x3aa7b9=_0x3aa7b9-0x0;var _0x44cd4a=_0x9d17[_0x3aa7b9];return _0x44cd4a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x79d1('0x0'));var zipdir=require(_0x79d1('0x1'));var jsonpatch=require(_0x79d1('0x2'));var rp=require(_0x79d1('0x3'));var moment=require(_0x79d1('0x4'));var BPromise=require(_0x79d1('0x5'));var Mustache=require(_0x79d1('0x6'));var util=require(_0x79d1('0x7'));var path=require(_0x79d1('0x8'));var sox=require(_0x79d1('0x9'));var csv=require(_0x79d1('0xa'));var ejs=require(_0x79d1('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x79d1('0xc'));var crypto=require(_0x79d1('0xd'));var jsforce=require(_0x79d1('0xe'));var deskjs=require(_0x79d1('0xf'));var toCsv=require(_0x79d1('0xa'));var querystring=require(_0x79d1('0x10'));var Papa=require(_0x79d1('0x11'));var Redis=require(_0x79d1('0x12'));var authService=require(_0x79d1('0x13'));var qs=require(_0x79d1('0x14'));var as=require(_0x79d1('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x79d1('0x16'))(_0x79d1('0x17'));var utils=require(_0x79d1('0x18'));var config=require(_0x79d1('0x19'));var licenseUtil=require(_0x79d1('0x1a'));var db=require(_0x79d1('0x1b'))['db'];config[_0x79d1('0x1c')]=_['defaults'](config[_0x79d1('0x1c')],{'host':_0x79d1('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x79d1('0x1c')]));require(_0x79d1('0x1e'))['register'](socket);var jayson=require(_0x79d1('0x1f'));var client=jayson['client'][_0x79d1('0x20')]({'port':0x232c});var client9002=jayson[_0x79d1('0x21')][_0x79d1('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x32148a,_0x2df96f,_0x4ac1f5,_0x119b4a){return new BPromise(function(_0x5344dc,_0x5950c8){var _0x3a2baa=_0x119b4a||client;return _0x3a2baa[_0x79d1('0x22')](_0x32148a,_0x4ac1f5)[_0x79d1('0x23')](function(_0x495d82){logger[_0x79d1('0x24')]('ChatMessage,\x20%s,\x20%s',_0x2df96f,_0x79d1('0x25'));logger[_0x79d1('0x26')](_0x79d1('0x27'),_0x2df96f,_0x79d1('0x25'),JSON['stringify'](_0x495d82));if(_0x495d82['error']){if(_0x495d82[_0x79d1('0x28')]['code']===0x1f4){logger[_0x79d1('0x28')]('ChatMessage,\x20%s,\x20%s',_0x2df96f,_0x495d82[_0x79d1('0x28')][_0x79d1('0x29')]);return _0x5950c8(_0x495d82[_0x79d1('0x28')][_0x79d1('0x29')]);}logger[_0x79d1('0x28')](_0x79d1('0x2a'),_0x2df96f,_0x495d82[_0x79d1('0x28')][_0x79d1('0x29')]);return _0x5344dc(_0x495d82[_0x79d1('0x28')][_0x79d1('0x29')]);}else{logger[_0x79d1('0x24')](_0x79d1('0x2a'),_0x2df96f,_0x79d1('0x25'));_0x5344dc(_0x495d82[_0x79d1('0x2b')]['message']);}})[_0x79d1('0x2c')](function(_0x480d90){logger[_0x79d1('0x28')](_0x79d1('0x2a'),_0x2df96f,_0x480d90);_0x5950c8(_0x480d90);});});}function respondWithStatusCode(_0x1ad683,_0x572fcc){_0x572fcc=_0x572fcc||0xcc;return function(_0x1dc05f){if(_0x1dc05f){return _0x1ad683[_0x79d1('0x2d')](_0x572fcc);}return _0x1ad683['status'](_0x572fcc)[_0x79d1('0x2e')]();};}function respondWithResult(_0x560901,_0x4db27d){_0x4db27d=_0x4db27d||0xc8;return function(_0x4f2762){if(_0x4f2762){return _0x560901[_0x79d1('0x2f')](_0x4db27d)[_0x79d1('0x30')](_0x4f2762);}};}function respondWithFilteredResult(_0x33ccc3,_0x3fcc2c){return function(_0x23a80e){if(_0x23a80e){var _0x36cef0=typeof _0x3fcc2c['offset']===_0x79d1('0x31')&&typeof _0x3fcc2c[_0x79d1('0x32')]==='undefined';var _0x52b64c=_0x23a80e['count'];var _0x348fbd=_0x36cef0?0x0:_0x3fcc2c['offset'];var _0x4ef041=_0x36cef0?_0x23a80e[_0x79d1('0x33')]:_0x3fcc2c[_0x79d1('0x34')]+_0x3fcc2c[_0x79d1('0x32')];var _0x2d3703;if(_0x4ef041>=_0x52b64c){_0x4ef041=_0x52b64c;_0x2d3703=0xc8;}else{_0x2d3703=0xce;}_0x33ccc3[_0x79d1('0x2f')](_0x2d3703);return _0x33ccc3['set'](_0x79d1('0x35'),_0x348fbd+'-'+_0x4ef041+'/'+_0x52b64c)['json'](_0x23a80e);}return null;};}function patchUpdates(_0x48c128){return function(_0x3e4240){try{jsonpatch[_0x79d1('0x36')](_0x3e4240,_0x48c128,!![]);}catch(_0x236857){return BPromise[_0x79d1('0x37')](_0x236857);}return _0x3e4240[_0x79d1('0x38')]();};}function saveUpdates(_0x1e51a3,_0x1a02a0){return function(_0x234708){if(_0x234708){return _0x234708[_0x79d1('0x39')](_0x1e51a3)[_0x79d1('0x23')](function(_0x2834d0){return _0x2834d0;});}return null;};}function removeEntity(_0x2743a7,_0x1dbf8f){return function(_0x55a412){if(_0x55a412){return _0x55a412[_0x79d1('0x3a')]()[_0x79d1('0x23')](function(){_0x2743a7[_0x79d1('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ab8de,_0x3fc342){return function(_0x370038){if(!_0x370038){_0x4ab8de['sendStatus'](0x194);}return _0x370038;};}function handleError(_0x173da2,_0x430c64){_0x430c64=_0x430c64||0x1f4;return function(_0x26ac46){logger[_0x79d1('0x28')](_0x26ac46[_0x79d1('0x3b')]);if(_0x26ac46['name']){delete _0x26ac46[_0x79d1('0x3c')];}_0x173da2[_0x79d1('0x2f')](_0x430c64)[_0x79d1('0x3d')](_0x26ac46);};}exports[_0x79d1('0x3e')]=function(_0x3dbbba,_0x4f1daf){var _0x578e69={},_0x4a1469={},_0x3df0f9={'count':0x0,'rows':[]};var _0x1ac767=_['map'](db[_0x79d1('0x3f')][_0x79d1('0x40')],function(_0x33bff1){return{'name':_0x33bff1[_0x79d1('0x41')],'type':_0x33bff1[_0x79d1('0x42')][_0x79d1('0x43')]};});_0x4a1469[_0x79d1('0x44')]=_[_0x79d1('0x45')](_0x1ac767,_0x79d1('0x3c'));_0x4a1469['query']=_[_0x79d1('0x46')](_0x3dbbba[_0x79d1('0x47')]);_0x4a1469['filters']=_[_0x79d1('0x48')](_0x4a1469[_0x79d1('0x44')],_0x4a1469[_0x79d1('0x47')]);_0x578e69[_0x79d1('0x49')]=_['intersection'](_0x4a1469['model'],qs['fields'](_0x3dbbba[_0x79d1('0x47')][_0x79d1('0x4a')]));_0x578e69[_0x79d1('0x49')]=_0x578e69[_0x79d1('0x49')][_0x79d1('0x4b')]?_0x578e69[_0x79d1('0x49')]:_0x4a1469[_0x79d1('0x44')];if(!_0x3dbbba[_0x79d1('0x47')][_0x79d1('0x4c')](_0x79d1('0x4d'))){_0x578e69[_0x79d1('0x32')]=qs[_0x79d1('0x32')](_0x3dbbba[_0x79d1('0x47')][_0x79d1('0x32')]);_0x578e69[_0x79d1('0x34')]=qs['offset'](_0x3dbbba[_0x79d1('0x47')][_0x79d1('0x34')]);}_0x578e69['order']=qs['sort'](_0x3dbbba['query'][_0x79d1('0x4e')]);_0x578e69[_0x79d1('0x4f')]=qs[_0x79d1('0x50')](_[_0x79d1('0x51')](_0x3dbbba[_0x79d1('0x47')],_0x4a1469[_0x79d1('0x50')]),_0x1ac767);if(_0x3dbbba[_0x79d1('0x47')][_0x79d1('0x52')]){_0x578e69[_0x79d1('0x4f')]=_[_0x79d1('0x53')](_0x578e69[_0x79d1('0x4f')],{'$or':_[_0x79d1('0x45')](_0x1ac767,function(_0x555ead){if(_0x555ead[_0x79d1('0x42')]!=='VIRTUAL'){var _0x117539={};_0x117539[_0x555ead[_0x79d1('0x3c')]]={'$like':'%'+_0x3dbbba['query'][_0x79d1('0x52')]+'%'};return _0x117539;}})});}_0x578e69=_[_0x79d1('0x53')]({},_0x578e69,_0x3dbbba['options']);var _0x4e4381={'where':_0x578e69[_0x79d1('0x4f')]};return db[_0x79d1('0x3f')]['count'](_0x4e4381)[_0x79d1('0x23')](function(_0x18a5db){_0x3df0f9[_0x79d1('0x33')]=_0x18a5db;if(_0x3dbbba[_0x79d1('0x47')]['includeAll']){_0x578e69[_0x79d1('0x54')]=[{'all':!![]}];}return db[_0x79d1('0x3f')][_0x79d1('0x55')](_0x578e69);})[_0x79d1('0x23')](function(_0x301dd5){_0x3df0f9[_0x79d1('0x56')]=_0x301dd5;return _0x3df0f9;})[_0x79d1('0x23')](respondWithFilteredResult(_0x4f1daf,_0x578e69))[_0x79d1('0x2c')](handleError(_0x4f1daf,null));};exports['show']=function(_0xf06eb7,_0xdd25cd){var _0x3d30b5={'raw':!![],'where':{'id':_0xf06eb7[_0x79d1('0x57')]['id']}},_0x129449={};_0x129449[_0x79d1('0x44')]=_[_0x79d1('0x46')](db[_0x79d1('0x3f')][_0x79d1('0x40')]);_0x129449[_0x79d1('0x47')]=_[_0x79d1('0x46')](_0xf06eb7[_0x79d1('0x47')]);_0x129449[_0x79d1('0x50')]=_[_0x79d1('0x48')](_0x129449[_0x79d1('0x44')],_0x129449[_0x79d1('0x47')]);_0x3d30b5[_0x79d1('0x49')]=_['intersection'](_0x129449['model'],qs[_0x79d1('0x4a')](_0xf06eb7[_0x79d1('0x47')]['fields']));_0x3d30b5[_0x79d1('0x49')]=_0x3d30b5[_0x79d1('0x49')][_0x79d1('0x4b')]?_0x3d30b5[_0x79d1('0x49')]:_0x129449[_0x79d1('0x44')];if(_0xf06eb7[_0x79d1('0x47')][_0x79d1('0x58')]){_0x3d30b5[_0x79d1('0x54')]=[{'all':!![]}];}_0x3d30b5=_[_0x79d1('0x53')]({},_0x3d30b5,_0xf06eb7[_0x79d1('0x59')]);return db['ChatMessage'][_0x79d1('0x5a')](_0x3d30b5)['then'](handleEntityNotFound(_0xdd25cd,null))[_0x79d1('0x23')](respondWithResult(_0xdd25cd,null))[_0x79d1('0x2c')](handleError(_0xdd25cd,null));};exports[_0x79d1('0x5b')]=function(_0x5f2e5a,_0x5411ba){return db[_0x79d1('0x3f')][_0x79d1('0x5b')](_0x5f2e5a[_0x79d1('0x5c')],{})['then'](respondWithResult(_0x5411ba,0xc9))[_0x79d1('0x2c')](handleError(_0x5411ba,null));};exports[_0x79d1('0x39')]=function(_0x59acb9,_0x2fd678){if(_0x59acb9[_0x79d1('0x5c')]['id']){delete _0x59acb9[_0x79d1('0x5c')]['id'];}return db[_0x79d1('0x3f')][_0x79d1('0x5a')]({'where':{'id':_0x59acb9['params']['id']}})[_0x79d1('0x23')](handleEntityNotFound(_0x2fd678,null))[_0x79d1('0x23')](saveUpdates(_0x59acb9[_0x79d1('0x5c')],null))[_0x79d1('0x23')](respondWithResult(_0x2fd678,null))[_0x79d1('0x2c')](handleError(_0x2fd678,null));};exports[_0x79d1('0x3a')]=function(_0x3b6d9a,_0x24d6f3){return db['ChatMessage']['find']({'where':{'id':_0x3b6d9a['params']['id']}})[_0x79d1('0x23')](handleEntityNotFound(_0x24d6f3,null))['then'](removeEntity(_0x24d6f3,null))[_0x79d1('0x2c')](handleError(_0x24d6f3,null));};exports[_0x79d1('0x5d')]=function(_0x1223cf,_0x5ab217){return db[_0x79d1('0x3f')][_0x79d1('0x5d')]()[_0x79d1('0x23')](respondWithResult(_0x5ab217,null))[_0x79d1('0x2c')](handleError(_0x5ab217,null));};var interaction_log=require('../../config/logger')(_0x79d1('0x5e'));exports[_0x79d1('0x5f')]=function(_0x35aab8,_0x5468e1,_0x4f02ea){var _0x2f1d3b={'agent':{},'channel':'chat'};if(_0x35aab8['body']['id']){delete _0x35aab8['body']['id'];}_0x35aab8[_0x79d1('0x5c')][_0x79d1('0x60')]=!![];_0x35aab8[_0x79d1('0x5c')][_0x79d1('0x61')]=moment()[_0x79d1('0x62')](_0x79d1('0x63'));_0x35aab8[_0x79d1('0x5c')][_0x79d1('0x64')]=_0x35aab8[_0x79d1('0x5c')][_0x79d1('0x64')]||_0x35aab8['user']['id'];_0x2f1d3b[_0x79d1('0x65')]['id']=_0x35aab8['body'][_0x79d1('0x64')];return db['ChatMessage'][_0x79d1('0x5a')]({'where':{'id':_0x35aab8[_0x79d1('0x57')]['id'],'UserId':null}})[_0x79d1('0x23')](handleEntityNotFound(_0x5468e1,null))[_0x79d1('0x23')](saveUpdates(_0x35aab8[_0x79d1('0x5c')],null))[_0x79d1('0x23')](function(_0xf10b2f){if(_0xf10b2f){_0x2f1d3b[_0x79d1('0x29')]=_0xf10b2f[_0x79d1('0x66')]({'plain':!![]});return db[_0x79d1('0x67')][_0x79d1('0x5a')]({'where':{'id':_0xf10b2f['ChatInteractionId']}});}return null;})[_0x79d1('0x23')](handleEntityNotFound(_0x5468e1,null))['then'](function(_0x225a48){if(_0x225a48){return _0x225a48[_0x79d1('0x39')]({'UserId':_0x35aab8['body']['UserId'],'read1stAt':_[_0x79d1('0x68')](_0x225a48[_0x79d1('0x69')])?moment()[_0x79d1('0x62')](_0x79d1('0x63')):undefined});}return null;})['then'](function(_0x15c54b){if(_0x15c54b){_0x2f1d3b[_0x79d1('0x6a')]=_0x15c54b[_0x79d1('0x66')]({'plain':!![]});interaction_log[_0x79d1('0x24')](_0x79d1('0x6b'),_0x35aab8[_0x79d1('0x6c')]['id'],_0x35aab8[_0x79d1('0x6c')][_0x79d1('0x3c')],_0x35aab8[_0x79d1('0x6c')][_0x79d1('0x6d')],_0x2f1d3b[_0x79d1('0x6a')]['id'],_0x35aab8[_0x79d1('0x5c')]?JSON[_0x79d1('0x6e')](_0x35aab8[_0x79d1('0x5c')]):_0x79d1('0x6f'));return respondWithRpcPromise(_0x79d1('0x70'),_0x79d1('0x71'),_0x2f1d3b);}return null;})[_0x79d1('0x23')](function(_0x449bea){var _0x2ac7f3=_0x79d1('0x72')+_0x449bea['message'][_0x79d1('0x73')];return db[_0x79d1('0x74')][_0x79d1('0x47')](_0x2ac7f3,{'type':db['Sequelize'][_0x79d1('0x75')]['SELECT'],'raw':!![]})['then'](function(_0x4e9b61){return _0x4e9b61;});})[_0x79d1('0x23')](function(_0x36e241){if(_0x36e241){_0x2f1d3b[_0x79d1('0x29')]['contact']=_0x36e241[0x0];if(!_0x35aab8[_0x79d1('0x5c')]['UserId'])return;return db[_0x79d1('0x76')][_0x79d1('0x5a')]({'where':{'id':_0x35aab8[_0x79d1('0x5c')][_0x79d1('0x64')],'role':_0x79d1('0x65')},'attributes':['id','name','fullname',_0x79d1('0x77'),'internal'],'raw':!![]});}return null;})[_0x79d1('0x23')](function(_0x3dab0a){if(!_0x3dab0a)return null;_0x2f1d3b[_0x79d1('0x29')]['agent']=_0x3dab0a;return _0x2f1d3b;})[_0x79d1('0x23')](function(_0x4186f4){if(_0x4186f4){if(_0x35aab8['body']['manual']){_0x2f1d3b['message']['interface']=util['format']('SIP/%s',_0x35aab8['user'][_0x79d1('0x3c')]);_0x2f1d3b[_0x79d1('0x29')]['channel']=_0x2f1d3b['channel'];_0x2f1d3b['message']['motionChannel']=_0x2f1d3b['channel'];_0x2f1d3b[_0x79d1('0x29')][_0x79d1('0x78')]=_0x79d1('0x5f');return respondWithRpcPromise(_0x79d1('0x79'),_0x79d1('0x79'),{'event':_0x79d1('0x7a'),'message':_[_0x79d1('0x53')](_0x2f1d3b[_0x79d1('0x29')],JSON['parse'](_0x2f1d3b[_0x79d1('0x6a')][_0x79d1('0x7b')]))},client9002)[_0x79d1('0x23')](function(){return _0x2f1d3b;});}return _0x2f1d3b;}return null;})[_0x79d1('0x23')](respondWithResult(_0x5468e1,null))[_0x79d1('0x2c')](handleError(_0x5468e1,null));};var interaction_log=require(_0x79d1('0x16'))(_0x79d1('0x5e'));exports[_0x79d1('0x37')]=function(_0x588849,_0x4a4a2d,_0x40739b){var _0x3f2fe6={'agent':{},'channel':_0x79d1('0x7c')};if(_0x588849[_0x79d1('0x5c')]['id']){delete _0x588849[_0x79d1('0x5c')]['id'];}_0x588849[_0x79d1('0x5c')][_0x79d1('0x64')]=_0x588849[_0x79d1('0x5c')][_0x79d1('0x64')]||_0x588849[_0x79d1('0x6c')]['id'];_0x3f2fe6[_0x79d1('0x65')]['id']=_0x588849['body'][_0x79d1('0x64')];return db[_0x79d1('0x3f')][_0x79d1('0x5a')]({'where':{'id':_0x588849[_0x79d1('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4a4a2d,null))[_0x79d1('0x23')](function(_0x593fb3){if(_0x593fb3){_0x3f2fe6[_0x79d1('0x29')]=_0x593fb3[_0x79d1('0x66')]({'plain':!![]});return db[_0x79d1('0x67')][_0x79d1('0x5a')]({'where':{'id':_0x593fb3[_0x79d1('0x7d')]}});}return null;})[_0x79d1('0x23')](handleEntityNotFound(_0x4a4a2d,null))[_0x79d1('0x23')](function(_0x3a3429){if(_0x3a3429){_0x3f2fe6[_0x79d1('0x6a')]=_0x3a3429[_0x79d1('0x66')]({'plain':!![]});interaction_log[_0x79d1('0x24')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x588849['user']['id'],_0x588849[_0x79d1('0x6c')][_0x79d1('0x3c')],_0x588849[_0x79d1('0x6c')][_0x79d1('0x6d')],_0x3f2fe6[_0x79d1('0x6a')]['id'],_0x588849[_0x79d1('0x5c')]?JSON[_0x79d1('0x6e')](_0x588849['body']):_0x79d1('0x6f'));return respondWithRpcPromise(_0x79d1('0x7e'),_0x79d1('0x7f'),_0x3f2fe6);}return null;})[_0x79d1('0x23')](function(_0x39a5d4){var _0x6a7c7c='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x39a5d4[_0x79d1('0x29')][_0x79d1('0x73')];return db[_0x79d1('0x74')][_0x79d1('0x47')](_0x6a7c7c,{'type':db[_0x79d1('0x80')]['QueryTypes'][_0x79d1('0x81')],'raw':!![]})[_0x79d1('0x23')](function(_0x5ee6bb){return _0x5ee6bb;});})[_0x79d1('0x23')](function(_0x3fdfcd){if(_0x3fdfcd){_0x3f2fe6[_0x79d1('0x29')][_0x79d1('0x82')]=_0x3fdfcd[0x0];if(!_0x588849[_0x79d1('0x5c')]['UserId'])return;return db[_0x79d1('0x76')][_0x79d1('0x5a')]({'where':{'id':_0x588849[_0x79d1('0x5c')][_0x79d1('0x64')],'role':_0x79d1('0x65')},'attributes':['id',_0x79d1('0x3c'),'fullname',_0x79d1('0x77'),_0x79d1('0x83')],'raw':!![]});}return null;})[_0x79d1('0x23')](function(_0x5a9b10){if(!_0x5a9b10)return null;_0x3f2fe6[_0x79d1('0x29')]['agent']=_0x5a9b10;return _0x3f2fe6;})[_0x79d1('0x23')](function(_0x1dac31){if(_0x1dac31){_0x1dac31[_0x79d1('0x29')][_0x79d1('0x84')]=util[_0x79d1('0x62')](_0x79d1('0x85'),_0x588849['user'][_0x79d1('0x3c')]);_0x1dac31[_0x79d1('0x29')][_0x79d1('0x86')]=_0x3f2fe6[_0x79d1('0x86')];_0x1dac31[_0x79d1('0x29')][_0x79d1('0x87')]=_0x3f2fe6[_0x79d1('0x86')];_0x1dac31[_0x79d1('0x29')]['event']=_0x79d1('0x37');respondWithRpcPromise(_0x79d1('0x79'),_0x79d1('0x79'),{'event':_0x79d1('0x88'),'message':_[_0x79d1('0x53')](_0x3f2fe6[_0x79d1('0x29')],JSON[_0x79d1('0x89')](_0x3f2fe6[_0x79d1('0x6a')][_0x79d1('0x7b')]))},client9002);return _0x3f2fe6;}return null;})[_0x79d1('0x23')](respondWithResult(_0x4a4a2d,null))[_0x79d1('0x2c')](handleError(_0x4a4a2d,null));}; \ No newline at end of file +var _0xbee3=['find','describe','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','contact','User','email','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','formData','chat-interactions','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','rejectMessage','sequelize','Sequelize','fullname','internal','rejectmessage','parse','rimraf','zip-dir','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','request','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','sendStatus','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','ChatMessage','rows','show','params','length','create','body'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0xbee3,0xae));var _0x3bee=function(_0x81d558,_0x661891){_0x81d558=_0x81d558-0x0;var _0x3ff3bc=_0xbee3[_0x81d558];return _0x3ff3bc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3bee('0x0'));var zipdir=require(_0x3bee('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3bee('0x2'));var Mustache=require(_0x3bee('0x3'));var util=require('util');var path=require(_0x3bee('0x4'));var sox=require(_0x3bee('0x5'));var csv=require(_0x3bee('0x6'));var ejs=require(_0x3bee('0x7'));var fs=require('fs');var fs_extra=require(_0x3bee('0x8'));var _=require(_0x3bee('0x9'));var squel=require(_0x3bee('0xa'));var crypto=require(_0x3bee('0xb'));var jsforce=require(_0x3bee('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3bee('0x6'));var querystring=require(_0x3bee('0xd'));var Papa=require(_0x3bee('0xe'));var Redis=require('ioredis');var authService=require(_0x3bee('0xf'));var qs=require(_0x3bee('0x10'));var as=require(_0x3bee('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3bee('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x3bee('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x3bee('0x14'))['db'];config['redis']=_[_0x3bee('0x15')](config[_0x3bee('0x16')],{'host':_0x3bee('0x17'),'port':0x18eb});var socket=require(_0x3bee('0x18'))(new Redis(config[_0x3bee('0x16')]));require(_0x3bee('0x19'))['register'](socket);var jayson=require(_0x3bee('0x1a'));var client=jayson[_0x3bee('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0x3bee('0x1b')][_0x3bee('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x4eff95,_0x5afb50,_0x42c30e,_0x1bb3ad){return new BPromise(function(_0x43eb0a,_0x3a4691){var _0x8d7fa1=_0x1bb3ad||client;return _0x8d7fa1[_0x3bee('0x1d')](_0x4eff95,_0x42c30e)['then'](function(_0x517b64){logger[_0x3bee('0x1e')]('ChatMessage,\x20%s,\x20%s',_0x5afb50,_0x3bee('0x1f'));logger[_0x3bee('0x20')](_0x3bee('0x21'),_0x5afb50,_0x3bee('0x1f'),JSON['stringify'](_0x517b64));if(_0x517b64[_0x3bee('0x22')]){if(_0x517b64[_0x3bee('0x22')][_0x3bee('0x23')]===0x1f4){logger['error'](_0x3bee('0x24'),_0x5afb50,_0x517b64[_0x3bee('0x22')][_0x3bee('0x25')]);return _0x3a4691(_0x517b64[_0x3bee('0x22')][_0x3bee('0x25')]);}logger[_0x3bee('0x22')](_0x3bee('0x24'),_0x5afb50,_0x517b64[_0x3bee('0x22')][_0x3bee('0x25')]);return _0x43eb0a(_0x517b64[_0x3bee('0x22')][_0x3bee('0x25')]);}else{logger['info'](_0x3bee('0x24'),_0x5afb50,_0x3bee('0x1f'));_0x43eb0a(_0x517b64[_0x3bee('0x26')]['message']);}})[_0x3bee('0x27')](function(_0x3bb01d){logger[_0x3bee('0x22')]('ChatMessage,\x20%s,\x20%s',_0x5afb50,_0x3bb01d);_0x3a4691(_0x3bb01d);});});}function respondWithStatusCode(_0x5c126f,_0x132021){_0x132021=_0x132021||0xcc;return function(_0x883c28){if(_0x883c28){return _0x5c126f['sendStatus'](_0x132021);}return _0x5c126f[_0x3bee('0x28')](_0x132021)[_0x3bee('0x29')]();};}function respondWithResult(_0x3ee6c0,_0x4334e5){_0x4334e5=_0x4334e5||0xc8;return function(_0x16ab4c){if(_0x16ab4c){return _0x3ee6c0['status'](_0x4334e5)['json'](_0x16ab4c);}};}function respondWithFilteredResult(_0x4c4d84,_0x274d39){return function(_0x4f68bb){if(_0x4f68bb){var _0x3c4b2a=typeof _0x274d39[_0x3bee('0x2a')]===_0x3bee('0x2b')&&typeof _0x274d39[_0x3bee('0x2c')]===_0x3bee('0x2b');var _0x103ce5=_0x4f68bb[_0x3bee('0x2d')];var _0x2d0c0f=_0x3c4b2a?0x0:_0x274d39[_0x3bee('0x2a')];var _0x3f8f00=_0x3c4b2a?_0x4f68bb['count']:_0x274d39[_0x3bee('0x2a')]+_0x274d39[_0x3bee('0x2c')];var _0x47b0ce;if(_0x3f8f00>=_0x103ce5){_0x3f8f00=_0x103ce5;_0x47b0ce=0xc8;}else{_0x47b0ce=0xce;}_0x4c4d84[_0x3bee('0x28')](_0x47b0ce);return _0x4c4d84[_0x3bee('0x2e')](_0x3bee('0x2f'),_0x2d0c0f+'-'+_0x3f8f00+'/'+_0x103ce5)[_0x3bee('0x30')](_0x4f68bb);}return null;};}function patchUpdates(_0x31964e){return function(_0x52ceed){try{jsonpatch[_0x3bee('0x31')](_0x52ceed,_0x31964e,!![]);}catch(_0x5ec237){return BPromise[_0x3bee('0x32')](_0x5ec237);}return _0x52ceed['save']();};}function saveUpdates(_0x155178,_0x5e05ee){return function(_0x103864){if(_0x103864){return _0x103864[_0x3bee('0x33')](_0x155178)[_0x3bee('0x34')](function(_0x21f710){return _0x21f710;});}return null;};}function removeEntity(_0x41dc6e,_0x5e6a91){return function(_0x196c27){if(_0x196c27){return _0x196c27[_0x3bee('0x35')]()[_0x3bee('0x34')](function(){_0x41dc6e[_0x3bee('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x259746,_0x1b5c53){return function(_0x37de75){if(!_0x37de75){_0x259746[_0x3bee('0x36')](0x194);}return _0x37de75;};}function handleError(_0x18a092,_0x11f7fa){_0x11f7fa=_0x11f7fa||0x1f4;return function(_0x3bb4a3){logger[_0x3bee('0x22')](_0x3bb4a3['stack']);if(_0x3bb4a3[_0x3bee('0x37')]){delete _0x3bb4a3['name'];}_0x18a092[_0x3bee('0x28')](_0x11f7fa)['send'](_0x3bb4a3);};}exports[_0x3bee('0x38')]=function(_0x2a988d,_0x487d69){var _0x2e4c48={},_0x477672={},_0x49cf08={'count':0x0,'rows':[]};var _0x14db5d=_[_0x3bee('0x39')](db['ChatMessage'][_0x3bee('0x3a')],function(_0x59bdd6){return{'name':_0x59bdd6[_0x3bee('0x3b')],'type':_0x59bdd6['type'][_0x3bee('0x3c')]};});_0x477672[_0x3bee('0x3d')]=_[_0x3bee('0x39')](_0x14db5d,'name');_0x477672[_0x3bee('0x3e')]=_[_0x3bee('0x3f')](_0x2a988d[_0x3bee('0x3e')]);_0x477672[_0x3bee('0x40')]=_['intersection'](_0x477672[_0x3bee('0x3d')],_0x477672[_0x3bee('0x3e')]);_0x2e4c48['attributes']=_[_0x3bee('0x41')](_0x477672[_0x3bee('0x3d')],qs[_0x3bee('0x42')](_0x2a988d[_0x3bee('0x3e')][_0x3bee('0x42')]));_0x2e4c48[_0x3bee('0x43')]=_0x2e4c48[_0x3bee('0x43')]['length']?_0x2e4c48[_0x3bee('0x43')]:_0x477672[_0x3bee('0x3d')];if(!_0x2a988d[_0x3bee('0x3e')][_0x3bee('0x44')]('nolimit')){_0x2e4c48[_0x3bee('0x2c')]=qs[_0x3bee('0x2c')](_0x2a988d[_0x3bee('0x3e')][_0x3bee('0x2c')]);_0x2e4c48[_0x3bee('0x2a')]=qs[_0x3bee('0x2a')](_0x2a988d['query']['offset']);}_0x2e4c48['order']=qs['sort'](_0x2a988d[_0x3bee('0x3e')][_0x3bee('0x45')]);_0x2e4c48[_0x3bee('0x46')]=qs[_0x3bee('0x40')](_['pick'](_0x2a988d[_0x3bee('0x3e')],_0x477672[_0x3bee('0x40')]),_0x14db5d);if(_0x2a988d[_0x3bee('0x3e')][_0x3bee('0x47')]){_0x2e4c48[_0x3bee('0x46')]=_[_0x3bee('0x48')](_0x2e4c48[_0x3bee('0x46')],{'$or':_['map'](_0x14db5d,function(_0x202ea0){if(_0x202ea0['type']!==_0x3bee('0x49')){var _0x45a10f={};_0x45a10f[_0x202ea0['name']]={'$like':'%'+_0x2a988d[_0x3bee('0x3e')][_0x3bee('0x47')]+'%'};return _0x45a10f;}})});}_0x2e4c48=_['merge']({},_0x2e4c48,_0x2a988d[_0x3bee('0x4a')]);var _0x48ba93={'where':_0x2e4c48[_0x3bee('0x46')]};return db['ChatMessage'][_0x3bee('0x2d')](_0x48ba93)[_0x3bee('0x34')](function(_0x53ae76){_0x49cf08[_0x3bee('0x2d')]=_0x53ae76;if(_0x2a988d[_0x3bee('0x3e')][_0x3bee('0x4b')]){_0x2e4c48[_0x3bee('0x4c')]=[{'all':!![]}];}return db[_0x3bee('0x4d')]['findAll'](_0x2e4c48);})[_0x3bee('0x34')](function(_0x1552f1){_0x49cf08[_0x3bee('0x4e')]=_0x1552f1;return _0x49cf08;})[_0x3bee('0x34')](respondWithFilteredResult(_0x487d69,_0x2e4c48))[_0x3bee('0x27')](handleError(_0x487d69,null));};exports[_0x3bee('0x4f')]=function(_0x33578d,_0x2280b1){var _0x50a297={'raw':!![],'where':{'id':_0x33578d[_0x3bee('0x50')]['id']}},_0x37c704={};_0x37c704['model']=_[_0x3bee('0x3f')](db[_0x3bee('0x4d')][_0x3bee('0x3a')]);_0x37c704['query']=_['keys'](_0x33578d[_0x3bee('0x3e')]);_0x37c704[_0x3bee('0x40')]=_['intersection'](_0x37c704[_0x3bee('0x3d')],_0x37c704[_0x3bee('0x3e')]);_0x50a297[_0x3bee('0x43')]=_['intersection'](_0x37c704[_0x3bee('0x3d')],qs[_0x3bee('0x42')](_0x33578d[_0x3bee('0x3e')]['fields']));_0x50a297[_0x3bee('0x43')]=_0x50a297[_0x3bee('0x43')][_0x3bee('0x51')]?_0x50a297[_0x3bee('0x43')]:_0x37c704[_0x3bee('0x3d')];if(_0x33578d[_0x3bee('0x3e')][_0x3bee('0x4b')]){_0x50a297[_0x3bee('0x4c')]=[{'all':!![]}];}_0x50a297=_['merge']({},_0x50a297,_0x33578d[_0x3bee('0x4a')]);return db[_0x3bee('0x4d')]['find'](_0x50a297)[_0x3bee('0x34')](handleEntityNotFound(_0x2280b1,null))[_0x3bee('0x34')](respondWithResult(_0x2280b1,null))['catch'](handleError(_0x2280b1,null));};exports[_0x3bee('0x52')]=function(_0x539411,_0x92a9ce){return db[_0x3bee('0x4d')][_0x3bee('0x52')](_0x539411[_0x3bee('0x53')],{})[_0x3bee('0x34')](respondWithResult(_0x92a9ce,0xc9))[_0x3bee('0x27')](handleError(_0x92a9ce,null));};exports[_0x3bee('0x33')]=function(_0x34f6ec,_0x51d41b){if(_0x34f6ec[_0x3bee('0x53')]['id']){delete _0x34f6ec[_0x3bee('0x53')]['id'];}return db[_0x3bee('0x4d')][_0x3bee('0x54')]({'where':{'id':_0x34f6ec[_0x3bee('0x50')]['id']}})['then'](handleEntityNotFound(_0x51d41b,null))['then'](saveUpdates(_0x34f6ec[_0x3bee('0x53')],null))[_0x3bee('0x34')](respondWithResult(_0x51d41b,null))[_0x3bee('0x27')](handleError(_0x51d41b,null));};exports['destroy']=function(_0x194f27,_0x1a537d){return db[_0x3bee('0x4d')]['find']({'where':{'id':_0x194f27[_0x3bee('0x50')]['id']}})[_0x3bee('0x34')](handleEntityNotFound(_0x1a537d,null))['then'](removeEntity(_0x1a537d,null))['catch'](handleError(_0x1a537d,null));};exports['describe']=function(_0x480172,_0x206041){return db[_0x3bee('0x4d')][_0x3bee('0x55')]()[_0x3bee('0x34')](respondWithResult(_0x206041,null))['catch'](handleError(_0x206041,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports['accept']=function(_0x3cd897,_0x13728e,_0x550f0c){var _0x2753e8={'agent':{},'channel':_0x3bee('0x56')};if(_0x3cd897['body']['id']){delete _0x3cd897[_0x3bee('0x53')]['id'];}_0x3cd897[_0x3bee('0x53')][_0x3bee('0x57')]=!![];_0x3cd897['body'][_0x3bee('0x58')]=moment()[_0x3bee('0x59')](_0x3bee('0x5a'));_0x3cd897['body'][_0x3bee('0x5b')]=_0x3cd897[_0x3bee('0x53')][_0x3bee('0x5b')]||_0x3cd897[_0x3bee('0x5c')]['id'];_0x2753e8[_0x3bee('0x5d')]['id']=_0x3cd897[_0x3bee('0x53')]['UserId'];return db['ChatMessage']['find']({'where':{'id':_0x3cd897[_0x3bee('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x13728e,null))['then'](saveUpdates(_0x3cd897[_0x3bee('0x53')],null))[_0x3bee('0x34')](function(_0x4b7389){if(_0x4b7389){_0x2753e8[_0x3bee('0x25')]=_0x4b7389[_0x3bee('0x5e')]({'plain':!![]});return db[_0x3bee('0x5f')][_0x3bee('0x54')]({'where':{'id':_0x4b7389[_0x3bee('0x60')]}});}return null;})[_0x3bee('0x34')](handleEntityNotFound(_0x13728e,null))[_0x3bee('0x34')](function(_0x1f3a7e){if(_0x1f3a7e){return _0x1f3a7e[_0x3bee('0x33')]({'UserId':_0x3cd897[_0x3bee('0x53')][_0x3bee('0x5b')],'read1stAt':_[_0x3bee('0x61')](_0x1f3a7e[_0x3bee('0x62')])?moment()[_0x3bee('0x59')](_0x3bee('0x5a')):undefined});}return null;})[_0x3bee('0x34')](function(_0x208212){if(_0x208212){_0x2753e8[_0x3bee('0x63')]=_0x208212[_0x3bee('0x5e')]({'plain':!![]});interaction_log[_0x3bee('0x1e')](_0x3bee('0x64'),_0x3cd897[_0x3bee('0x5c')]['id'],_0x3cd897[_0x3bee('0x5c')][_0x3bee('0x37')],_0x3cd897[_0x3bee('0x5c')]['role'],_0x2753e8[_0x3bee('0x63')]['id'],_0x3cd897['body']?JSON['stringify'](_0x3cd897['body']):_0x3bee('0x65'));return respondWithRpcPromise(_0x3bee('0x66'),_0x3bee('0x67'),_0x2753e8);}return null;})[_0x3bee('0x34')](function(_0x4bbf80){var _0x924b4f=_0x3bee('0x68')+_0x4bbf80[_0x3bee('0x25')][_0x3bee('0x69')];return db['sequelize']['query'](_0x924b4f,{'type':db['Sequelize'][_0x3bee('0x6a')]['SELECT'],'raw':!![]})['then'](function(_0x13e115){return _0x13e115;});})['then'](function(_0x285147){if(_0x285147){_0x2753e8['message'][_0x3bee('0x6b')]=_0x285147[0x0];if(!_0x3cd897[_0x3bee('0x53')]['UserId'])return;return db[_0x3bee('0x6c')][_0x3bee('0x54')]({'where':{'id':_0x3cd897[_0x3bee('0x53')][_0x3bee('0x5b')],'role':'agent'},'attributes':['id','name','fullname',_0x3bee('0x6d'),'internal'],'raw':!![]});}return null;})[_0x3bee('0x34')](function(_0x47bd12){if(!_0x47bd12)return null;_0x2753e8[_0x3bee('0x25')][_0x3bee('0x5d')]=_0x47bd12;return _0x2753e8;})[_0x3bee('0x34')](function(_0x4f7c88){if(_0x4f7c88){if(_0x3cd897['body']['manual']){_0x2753e8[_0x3bee('0x25')][_0x3bee('0x6e')]=util['format'](_0x3bee('0x6f'),_0x3cd897[_0x3bee('0x5c')][_0x3bee('0x37')]);_0x2753e8[_0x3bee('0x25')][_0x3bee('0x70')]=_0x2753e8[_0x3bee('0x70')];_0x2753e8[_0x3bee('0x25')][_0x3bee('0x71')]=_0x2753e8[_0x3bee('0x70')];_0x2753e8[_0x3bee('0x25')][_0x3bee('0x72')]=_0x3bee('0x73');return respondWithRpcPromise(_0x3bee('0x74'),'EventManager',{'event':'acceptmessage','message':_[_0x3bee('0x48')](_0x2753e8['message'],JSON['parse'](_0x2753e8['interaction'][_0x3bee('0x75')]))},client9002)[_0x3bee('0x34')](function(){return _0x2753e8;});}return _0x2753e8;}return null;})[_0x3bee('0x34')](respondWithResult(_0x13728e,null))[_0x3bee('0x27')](handleError(_0x13728e,null));};var interaction_log=require('../../config/logger')(_0x3bee('0x76'));exports['reject']=function(_0x234a87,_0x2cc272,_0x1b7a02){var _0x4935b8={'agent':{},'channel':_0x3bee('0x56')};if(_0x234a87['body']['id']){delete _0x234a87[_0x3bee('0x53')]['id'];}_0x234a87[_0x3bee('0x53')][_0x3bee('0x5b')]=_0x234a87[_0x3bee('0x53')][_0x3bee('0x5b')]||_0x234a87[_0x3bee('0x5c')]['id'];_0x4935b8[_0x3bee('0x5d')]['id']=_0x234a87[_0x3bee('0x53')]['UserId'];return db[_0x3bee('0x4d')][_0x3bee('0x54')]({'where':{'id':_0x234a87[_0x3bee('0x50')]['id'],'UserId':null}})[_0x3bee('0x34')](handleEntityNotFound(_0x2cc272,null))['then'](function(_0x15e2d2){if(_0x15e2d2){_0x4935b8['message']=_0x15e2d2[_0x3bee('0x5e')]({'plain':!![]});return db[_0x3bee('0x5f')][_0x3bee('0x54')]({'where':{'id':_0x15e2d2['ChatInteractionId']}});}return null;})[_0x3bee('0x34')](handleEntityNotFound(_0x2cc272,null))[_0x3bee('0x34')](function(_0x3ff3c8){if(_0x3ff3c8){_0x4935b8[_0x3bee('0x63')]=_0x3ff3c8[_0x3bee('0x5e')]({'plain':!![]});interaction_log[_0x3bee('0x1e')](_0x3bee('0x77'),_0x234a87[_0x3bee('0x5c')]['id'],_0x234a87[_0x3bee('0x5c')][_0x3bee('0x37')],_0x234a87[_0x3bee('0x5c')][_0x3bee('0x78')],_0x4935b8[_0x3bee('0x63')]['id'],_0x234a87[_0x3bee('0x53')]?JSON[_0x3bee('0x79')](_0x234a87[_0x3bee('0x53')]):_0x3bee('0x65'));return respondWithRpcPromise('RejectMessage',_0x3bee('0x7a'),_0x4935b8);}return null;})[_0x3bee('0x34')](function(_0x5d19e5){var _0x535e98=_0x3bee('0x68')+_0x5d19e5[_0x3bee('0x25')][_0x3bee('0x69')];return db[_0x3bee('0x7b')]['query'](_0x535e98,{'type':db[_0x3bee('0x7c')][_0x3bee('0x6a')]['SELECT'],'raw':!![]})[_0x3bee('0x34')](function(_0x3cc181){return _0x3cc181;});})['then'](function(_0x26e358){if(_0x26e358){_0x4935b8[_0x3bee('0x25')]['contact']=_0x26e358[0x0];if(!_0x234a87[_0x3bee('0x53')][_0x3bee('0x5b')])return;return db['User'][_0x3bee('0x54')]({'where':{'id':_0x234a87[_0x3bee('0x53')][_0x3bee('0x5b')],'role':'agent'},'attributes':['id',_0x3bee('0x37'),_0x3bee('0x7d'),_0x3bee('0x6d'),_0x3bee('0x7e')],'raw':!![]});}return null;})[_0x3bee('0x34')](function(_0x4c63b4){if(!_0x4c63b4)return null;_0x4935b8[_0x3bee('0x25')][_0x3bee('0x5d')]=_0x4c63b4;return _0x4935b8;})[_0x3bee('0x34')](function(_0x2310c7){if(_0x2310c7){_0x2310c7[_0x3bee('0x25')][_0x3bee('0x6e')]=util[_0x3bee('0x59')](_0x3bee('0x6f'),_0x234a87[_0x3bee('0x5c')][_0x3bee('0x37')]);_0x2310c7[_0x3bee('0x25')][_0x3bee('0x70')]=_0x4935b8[_0x3bee('0x70')];_0x2310c7[_0x3bee('0x25')][_0x3bee('0x71')]=_0x4935b8[_0x3bee('0x70')];_0x2310c7['message']['event']=_0x3bee('0x32');respondWithRpcPromise('EventManager',_0x3bee('0x74'),{'event':_0x3bee('0x7f'),'message':_[_0x3bee('0x48')](_0x4935b8[_0x3bee('0x25')],JSON[_0x3bee('0x80')](_0x4935b8[_0x3bee('0x63')][_0x3bee('0x75')]))},client9002);return _0x4935b8;}return null;})[_0x3bee('0x34')](respondWithResult(_0x2cc272,null))['catch'](handleError(_0x2cc272,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 568473f..26ffe7e 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 _0xfaf4=['../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x186ed3,_0x3ac342){var _0x31c314=function(_0x224906){while(--_0x224906){_0x186ed3['push'](_0x186ed3['shift']());}};_0x31c314(++_0x3ac342);}(_0xfaf4,0x196));var _0x4faf=function(_0x517fa1,_0x4e72b3){_0x517fa1=_0x517fa1-0x0;var _0x29b5de=_0xfaf4[_0x517fa1];return _0x29b5de;};'use strict';var EventEmitter=require(_0x4faf('0x0'));var ChatMessage=require(_0x4faf('0x1'))['db'][_0x4faf('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x4faf('0x3')](0x0);var events={'afterCreate':_0x4faf('0x4'),'afterUpdate':_0x4faf('0x5'),'afterDestroy':_0x4faf('0x6')};function emitEvent(_0x36356d){return function(_0xd20b23,_0x39044a,_0x444655){ChatMessageEvents['emit'](_0x36356d+':'+_0xd20b23['id'],_0xd20b23);ChatMessageEvents[_0x4faf('0x7')](_0x36356d,_0xd20b23);_0x444655(null);};}for(var e in events){if(events[_0x4faf('0x8')](e)){var event=events[e];ChatMessage[_0x4faf('0x9')](e,emitEvent(event));}}module[_0x4faf('0xa')]=ChatMessageEvents; \ No newline at end of file +var _0x1345=['events','../../mysqldb','ChatMessage','save','remove','emit','hook','exports'];(function(_0x5c6d39,_0x163c70){var _0x331a7a=function(_0x24329b){while(--_0x24329b){_0x5c6d39['push'](_0x5c6d39['shift']());}};_0x331a7a(++_0x163c70);}(_0x1345,0xb8));var _0x5134=function(_0x37ad1c,_0x247bd6){_0x37ad1c=_0x37ad1c-0x0;var _0xedeefb=_0x1345[_0x37ad1c];return _0xedeefb;};'use strict';var EventEmitter=require(_0x5134('0x0'));var ChatMessage=require(_0x5134('0x1'))['db'][_0x5134('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5134('0x3'),'afterUpdate':'update','afterDestroy':_0x5134('0x4')};function emitEvent(_0x2a25b1){return function(_0x4522a9,_0x47595b,_0x193081){ChatMessageEvents['emit'](_0x2a25b1+':'+_0x4522a9['id'],_0x4522a9);ChatMessageEvents[_0x5134('0x5')](_0x2a25b1,_0x4522a9);_0x193081(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x5134('0x6')](e,emitEvent(event));}}module[_0x5134('0x7')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 3c79bbf..8a99738 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 _0x9f4c=['../../config/environment','./chatMessage.attributes','define','chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x5b0394,_0x38bac6){var _0x239278=function(_0x35df0a){while(--_0x35df0a){_0x5b0394['push'](_0x5b0394['shift']());}};_0x239278(++_0x38bac6);}(_0x9f4c,0x19a));var _0xc9f4=function(_0x450f75,_0x5ec3dc){_0x450f75=_0x450f75-0x0;var _0x490eb9=_0x9f4c[_0x450f75];return _0x490eb9;};'use strict';var _=require(_0xc9f4('0x0'));var util=require('util');var logger=require(_0xc9f4('0x1'))('api');var moment=require(_0xc9f4('0x2'));var BPromise=require(_0xc9f4('0x3'));var rp=require(_0xc9f4('0x4'));var fs=require('fs');var path=require(_0xc9f4('0x5'));var rimraf=require('rimraf');var config=require(_0xc9f4('0x6'));var attributes=require(_0xc9f4('0x7'));module['exports']=function(_0x31a315,_0x3ada07){return _0x31a315[_0xc9f4('0x8')]('ChatMessage',attributes,{'tableName':_0xc9f4('0x9'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xc9f4('0xa')],'type':_0xc9f4('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2c2d63,_0x42192a,_0x42804a){var _0x421a73=_0x31a315[_0xc9f4('0xc')];var _0x87469e=_0x2c2d63[_0xc9f4('0xd')]({'plain':!![]});if(_0x87469e[_0xc9f4('0xe')][_0xc9f4('0xf')]()==='in'||_0x87469e[_0xc9f4('0xe')][_0xc9f4('0xf')]()===_0xc9f4('0x10')&&!_0x87469e[_0xc9f4('0x11')]&&!_[_0xc9f4('0x12')](_0x87469e[_0xc9f4('0x13')])){_0x421a73[_0xc9f4('0x14')]['findOne']({'where':{'id':_0x87469e['ChatInteractionId']}})['then'](function(_0x56c2b0){if(_0x56c2b0){_0x56c2b0[_0xc9f4('0x15')]({'lastMsgAt':_0x87469e[_0xc9f4('0x16')],'lastMsgDirection':_0x87469e[_0xc9f4('0xe')][_0xc9f4('0xf')]()});}})['catch'](function(_0xc95bbe){console[_0xc9f4('0x17')](_0xc95bbe);});}_0x42804a();}},'charset':_0xc9f4('0x18'),'collate':_0xc9f4('0x19')});}; \ No newline at end of file +var _0xb9a7=['then','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','chat_messages','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','ChatInteraction','findOne','ChatInteractionId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb9a7,0x66));var _0x7b9a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xb9a7[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x7b9a('0x0'));var util=require(_0x7b9a('0x1'));var logger=require(_0x7b9a('0x2'))(_0x7b9a('0x3'));var moment=require(_0x7b9a('0x4'));var BPromise=require(_0x7b9a('0x5'));var rp=require(_0x7b9a('0x6'));var fs=require('fs');var path=require(_0x7b9a('0x7'));var rimraf=require(_0x7b9a('0x8'));var config=require(_0x7b9a('0x9'));var attributes=require(_0x7b9a('0xa'));module[_0x7b9a('0xb')]=function(_0x12d6ca,_0x4a3a36){return _0x12d6ca[_0x7b9a('0xc')]('ChatMessage',attributes,{'tableName':_0x7b9a('0xd'),'paranoid':![],'indexes':[{'name':_0x7b9a('0xe'),'fields':['body'],'type':_0x7b9a('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3ca8dd,_0x2d9fdf,_0x20e42a){var _0x1cdd76=_0x12d6ca[_0x7b9a('0x10')];var _0x370083=_0x3ca8dd[_0x7b9a('0x11')]({'plain':!![]});if(_0x370083[_0x7b9a('0x12')][_0x7b9a('0x13')]()==='in'||_0x370083['direction'][_0x7b9a('0x13')]()===_0x7b9a('0x14')&&!_0x370083[_0x7b9a('0x15')]&&!_[_0x7b9a('0x16')](_0x370083['UserId'])){_0x1cdd76[_0x7b9a('0x17')][_0x7b9a('0x18')]({'where':{'id':_0x370083[_0x7b9a('0x19')]}})[_0x7b9a('0x1a')](function(_0x4fbd3a){if(_0x4fbd3a){_0x4fbd3a[_0x7b9a('0x1b')]({'lastMsgAt':_0x370083[_0x7b9a('0x1c')],'lastMsgDirection':_0x370083['direction']['toLowerCase']()});}})[_0x7b9a('0x1d')](function(_0x2445c7){console[_0x7b9a('0x1e')](_0x2445c7);});}_0x20e42a();}},'charset':'utf8mb4','collate':_0x7b9a('0x1f')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 39eff66..fc04b96 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 _0x3dce=['then','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','info','result','catch','CreateChatMessage','ChatMessage','body','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','redis','socket.io-emitter','register'];(function(_0x4c70c4,_0x963969){var _0x437865=function(_0x54e323){while(--_0x54e323){_0x4c70c4['push'](_0x4c70c4['shift']());}};_0x437865(++_0x963969);}(_0x3dce,0xc4));var _0xe3dc=function(_0x2d31f6,_0x3e5538){_0x2d31f6=_0x2d31f6-0x0;var _0x29d231=_0x3dce[_0x2d31f6];return _0x29d231;};'use strict';var _=require(_0xe3dc('0x0'));var util=require(_0xe3dc('0x1'));var moment=require(_0xe3dc('0x2'));var BPromise=require(_0xe3dc('0x3'));var rs=require(_0xe3dc('0x4'));var fs=require('fs');var Redis=require(_0xe3dc('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe3dc('0x6'));var logger=require('../../config/logger')(_0xe3dc('0x7'));var config=require('../../config/environment');var jayson=require(_0xe3dc('0x8'));var client=jayson[_0xe3dc('0x9')][_0xe3dc('0xa')]({'port':0x232a});config[_0xe3dc('0xb')]=_['defaults'](config[_0xe3dc('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xe3dc('0xc'))(new Redis(config['redis']));require('./chatMessage.socket')[_0xe3dc('0xd')](socket);function respondWithRpcPromise(_0x5cb454,_0x2328f6,_0x16aa86){return new BPromise(function(_0x409359,_0x16aae3){return client['request'](_0x5cb454,_0x16aa86)[_0xe3dc('0xe')](function(_0x3e391e){logger['info']('ChatMessage,\x20%s,\x20%s',_0x2328f6,_0xe3dc('0xf'));logger[_0xe3dc('0x10')](_0xe3dc('0x11'),_0x2328f6,_0xe3dc('0xf'),JSON[_0xe3dc('0x12')](_0x3e391e));if(_0x3e391e[_0xe3dc('0x13')]){if(_0x3e391e['error'][_0xe3dc('0x14')]===0x1f4){logger['error'](_0xe3dc('0x15'),_0x2328f6,_0x3e391e[_0xe3dc('0x13')][_0xe3dc('0x16')]);return _0x16aae3(_0x3e391e['error'][_0xe3dc('0x16')]);}logger[_0xe3dc('0x13')](_0xe3dc('0x15'),_0x2328f6,_0x3e391e[_0xe3dc('0x13')][_0xe3dc('0x16')]);return _0x409359(_0x3e391e[_0xe3dc('0x13')][_0xe3dc('0x16')]);}else{logger[_0xe3dc('0x17')](_0xe3dc('0x15'),_0x2328f6,_0xe3dc('0xf'));_0x409359(_0x3e391e[_0xe3dc('0x18')][_0xe3dc('0x16')]);}})[_0xe3dc('0x19')](function(_0x2dfdde){logger['error'](_0xe3dc('0x15'),_0x2328f6,_0x2dfdde);_0x16aae3(_0x2dfdde);});});}exports[_0xe3dc('0x1a')]=function(_0x2d0d84){var _0x1e3432=this;return new Promise(function(_0x536269,_0x3aac20){return db[_0xe3dc('0x1b')]['create'](_0x2d0d84[_0xe3dc('0x1c')],{'raw':_0x2d0d84['options']?_0x2d0d84['options'][_0xe3dc('0x1d')]===undefined?!![]:![]:!![]})[_0xe3dc('0xe')](function(_0x179b8f){logger[_0xe3dc('0x17')](_0xe3dc('0x1a'),_0x2d0d84);logger[_0xe3dc('0x10')](_0xe3dc('0x1a'),_0x2d0d84,JSON[_0xe3dc('0x12')](_0x179b8f));_0x536269(_0x179b8f);})['catch'](function(_0x13c6ed){logger['error'](_0xe3dc('0x1a'),_0x13c6ed[_0xe3dc('0x16')],_0x2d0d84);_0x3aac20(_0x1e3432['error'](0x1f4,_0x13c6ed[_0xe3dc('0x16')]));});});}; \ No newline at end of file +var _0x01be=['body','options','raw','then','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','request','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'];(function(_0x2b0661,_0xa854f4){var _0x3cdd13=function(_0x435b7d){while(--_0x435b7d){_0x2b0661['push'](_0x2b0661['shift']());}};_0x3cdd13(++_0xa854f4);}(_0x01be,0x136));var _0xe01b=function(_0x39bd7f,_0xf8d10f){_0x39bd7f=_0x39bd7f-0x0;var _0x510ccf=_0x01be[_0x39bd7f];return _0x510ccf;};'use strict';var _=require(_0xe01b('0x0'));var util=require(_0xe01b('0x1'));var moment=require(_0xe01b('0x2'));var BPromise=require(_0xe01b('0x3'));var rs=require(_0xe01b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe01b('0x5'))['db'];var utils=require(_0xe01b('0x6'));var logger=require('../../config/logger')(_0xe01b('0x7'));var config=require(_0xe01b('0x8'));var jayson=require(_0xe01b('0x9'));var client=jayson[_0xe01b('0xa')][_0xe01b('0xb')]({'port':0x232a});config[_0xe01b('0xc')]=_['defaults'](config[_0xe01b('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xe01b('0xd'))(new Redis(config[_0xe01b('0xc')]));require('./chatMessage.socket')[_0xe01b('0xe')](socket);function respondWithRpcPromise(_0x34f26a,_0x5ebafe,_0x4a7f05){return new BPromise(function(_0x2648cd,_0x10cdae){return client[_0xe01b('0xf')](_0x34f26a,_0x4a7f05)['then'](function(_0x279580){logger[_0xe01b('0x10')](_0xe01b('0x11'),_0x5ebafe,_0xe01b('0x12'));logger[_0xe01b('0x13')](_0xe01b('0x14'),_0x5ebafe,_0xe01b('0x12'),JSON[_0xe01b('0x15')](_0x279580));if(_0x279580[_0xe01b('0x16')]){if(_0x279580['error'][_0xe01b('0x17')]===0x1f4){logger[_0xe01b('0x16')](_0xe01b('0x11'),_0x5ebafe,_0x279580['error'][_0xe01b('0x18')]);return _0x10cdae(_0x279580['error'][_0xe01b('0x18')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x5ebafe,_0x279580['error'][_0xe01b('0x18')]);return _0x2648cd(_0x279580['error']['message']);}else{logger[_0xe01b('0x10')]('ChatMessage,\x20%s,\x20%s',_0x5ebafe,_0xe01b('0x12'));_0x2648cd(_0x279580[_0xe01b('0x19')][_0xe01b('0x18')]);}})[_0xe01b('0x1a')](function(_0x53ff14){logger[_0xe01b('0x16')](_0xe01b('0x11'),_0x5ebafe,_0x53ff14);_0x10cdae(_0x53ff14);});});}exports[_0xe01b('0x1b')]=function(_0x235adc){var _0x5b12d4=this;return new Promise(function(_0x5f1402,_0xc666d6){return db[_0xe01b('0x1c')][_0xe01b('0x1d')](_0x235adc[_0xe01b('0x1e')],{'raw':_0x235adc[_0xe01b('0x1f')]?_0x235adc[_0xe01b('0x1f')][_0xe01b('0x20')]===undefined?!![]:![]:!![]})[_0xe01b('0x21')](function(_0x1eeb98){logger[_0xe01b('0x10')](_0xe01b('0x1b'),_0x235adc);logger[_0xe01b('0x13')](_0xe01b('0x1b'),_0x235adc,JSON[_0xe01b('0x15')](_0x1eeb98));_0x5f1402(_0x1eeb98);})[_0xe01b('0x1a')](function(_0x1614fb){logger[_0xe01b('0x16')](_0xe01b('0x1b'),_0x1614fb[_0xe01b('0x18')],_0x235adc);_0xc666d6(_0x5b12d4[_0xe01b('0x16')](0x1f4,_0x1614fb['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 6d9c668..a145dd0 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 _0xdc97=['./chatMessage.events','save','remove','emit','removeListener','register','chatMessage:'];(function(_0x44fef1,_0x132cf4){var _0x3c3a04=function(_0x175a90){while(--_0x175a90){_0x44fef1['push'](_0x44fef1['shift']());}};_0x3c3a04(++_0x132cf4);}(_0xdc97,0x13b));var _0x7dc9=function(_0x3c6e70,_0x5a2e3f){_0x3c6e70=_0x3c6e70-0x0;var _0x2d7c5c=_0xdc97[_0x3c6e70];return _0x2d7c5c;};'use strict';var ChatMessageEvents=require(_0x7dc9('0x0'));var events=[_0x7dc9('0x1'),_0x7dc9('0x2'),'update'];function createListener(_0x2913e6,_0x4f5c88){return function(_0x228e39){_0x4f5c88[_0x7dc9('0x3')](_0x2913e6,_0x228e39);};}function removeListener(_0x478a95,_0x2a77c1){return function(){ChatMessageEvents[_0x7dc9('0x4')](_0x478a95,_0x2a77c1);};}exports[_0x7dc9('0x5')]=function(_0x3ba3ca){for(var _0x589f02=0x0,_0x2636ef=events['length'];_0x589f02<_0x2636ef;_0x589f02++){var _0x4b3229=events[_0x589f02];var _0x2ff923=createListener(_0x7dc9('0x6')+_0x4b3229,_0x3ba3ca);ChatMessageEvents['on'](_0x4b3229,_0x2ff923);}}; \ No newline at end of file +var _0x7c09=['save','remove','emit','removeListener','length','chatMessage:'];(function(_0x3c8c0a,_0x581709){var _0x401fd6=function(_0x13de2d){while(--_0x13de2d){_0x3c8c0a['push'](_0x3c8c0a['shift']());}};_0x401fd6(++_0x581709);}(_0x7c09,0x102));var _0x97c0=function(_0x3664f6,_0x231eeb){_0x3664f6=_0x3664f6-0x0;var _0x19a375=_0x7c09[_0x3664f6];return _0x19a375;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x97c0('0x0'),_0x97c0('0x1'),'update'];function createListener(_0xfbf689,_0x7d8f6f){return function(_0x2d04b9){_0x7d8f6f[_0x97c0('0x2')](_0xfbf689,_0x2d04b9);};}function removeListener(_0x12eb6d,_0x99bf54){return function(){ChatMessageEvents[_0x97c0('0x3')](_0x12eb6d,_0x99bf54);};}exports['register']=function(_0x4b2f81){for(var _0x590368=0x0,_0x46fdd9=events[_0x97c0('0x4')];_0x590368<_0x46fdd9;_0x590368++){var _0x2c19fa=events[_0x590368];var _0x109bc8=createListener(_0x97c0('0x5')+_0x2c19fa,_0x4b2f81);ChatMessageEvents['on'](_0x2c19fa,_0x109bc8);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 2c95968..795f11d 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 _0xe32d=['update','put','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./chatMessage.controller','get','index','/describe','isAuthenticated','describe','tracked','create'];(function(_0x1ed544,_0x4bb547){var _0x29412d=function(_0x239274){while(--_0x239274){_0x1ed544['push'](_0x1ed544['shift']());}};_0x29412d(++_0x4bb547);}(_0xe32d,0x1bf));var _0xde32=function(_0x44395a,_0x2063cc){_0x44395a=_0x44395a-0x0;var _0x5be0b2=_0xe32d[_0x44395a];return _0x5be0b2;};'use strict';var multer=require(_0xde32('0x0'));var util=require(_0xde32('0x1'));var path=require(_0xde32('0x2'));var timeout=require(_0xde32('0x3'));var express=require('express');var router=express[_0xde32('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xde32('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xde32('0x6'));var controller=require(_0xde32('0x7'));router[_0xde32('0x8')]('/',auth['isAuthenticated'](),controller[_0xde32('0x9')]);router[_0xde32('0x8')](_0xde32('0xa'),auth[_0xde32('0xb')](),controller[_0xde32('0xc')]);router[_0xde32('0x8')]('/:id',auth[_0xde32('0xb')](),controller['show']);router['post']('/',auth[_0xde32('0xb')](),interaction[_0xde32('0xd')]('chat','chatmessage:create'),controller[_0xde32('0xe')]);router['put']('/:id',controller[_0xde32('0xf')]);router[_0xde32('0x10')]('/:id/accept',auth[_0xde32('0xb')](),controller['accept']);router['put'](_0xde32('0x11'),auth[_0xde32('0xb')](),controller[_0xde32('0x12')]);router[_0xde32('0x13')]('/:id',auth[_0xde32('0xb')](),controller[_0xde32('0x14')]);module['exports']=router; \ No newline at end of file +var _0xb977=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','show','post','tracked','chat','chatmessage:create','create','/:id','update','put','/:id/reject','reject','destroy','multer','util','path'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xb977,0x1d8));var _0x7b97=function(_0x3c7130,_0x4abee0){_0x3c7130=_0x3c7130-0x0;var _0x477bf1=_0xb977[_0x3c7130];return _0x477bf1;};'use strict';var multer=require(_0x7b97('0x0'));var util=require(_0x7b97('0x1'));var path=require(_0x7b97('0x2'));var timeout=require(_0x7b97('0x3'));var express=require(_0x7b97('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7b97('0x5'));var interaction=require(_0x7b97('0x6'));var config=require(_0x7b97('0x7'));var controller=require(_0x7b97('0x8'));router[_0x7b97('0x9')]('/',auth[_0x7b97('0xa')](),controller[_0x7b97('0xb')]);router[_0x7b97('0x9')](_0x7b97('0xc'),auth[_0x7b97('0xa')](),controller['describe']);router[_0x7b97('0x9')]('/:id',auth[_0x7b97('0xa')](),controller[_0x7b97('0xd')]);router[_0x7b97('0xe')]('/',auth[_0x7b97('0xa')](),interaction[_0x7b97('0xf')](_0x7b97('0x10'),_0x7b97('0x11')),controller[_0x7b97('0x12')]);router['put'](_0x7b97('0x13'),controller[_0x7b97('0x14')]);router[_0x7b97('0x15')]('/:id/accept',auth[_0x7b97('0xa')](),controller['accept']);router['put'](_0x7b97('0x16'),auth[_0x7b97('0xa')](),controller[_0x7b97('0x17')]);router['delete'](_0x7b97('0x13'),auth[_0x7b97('0xa')](),controller[_0x7b97('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 c7aef96..36c3b47 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 _0x0ce5=['sequelize','exports','TEXT'];(function(_0x4e1211,_0x1c0e26){var _0x4ae887=function(_0x6e55ff){while(--_0x6e55ff){_0x4e1211['push'](_0x4e1211['shift']());}};_0x4ae887(++_0x1c0e26);}(_0x0ce5,0x150));var _0x50ce=function(_0x2da357,_0x1f9b2f){_0x2da357=_0x2da357-0x0;var _0x138fdd=_0x0ce5[_0x2da357];return _0x138fdd;};'use strict';var Sequelize=require(_0x50ce('0x0'));module[_0x50ce('0x1')]={'body':{'type':Sequelize[_0x50ce('0x2')]('medium'),'allowNull':![]}}; \ No newline at end of file +var _0x1ab0=['sequelize','exports','TEXT'];(function(_0x32447e,_0x4e3b81){var _0x3a41b0=function(_0x495e43){while(--_0x495e43){_0x32447e['push'](_0x32447e['shift']());}};_0x3a41b0(++_0x4e3b81);}(_0x1ab0,0x1dd));var _0x01ab=function(_0x260393,_0x429d84){_0x260393=_0x260393-0x0;var _0x8c9b95=_0x1ab0[_0x260393];return _0x8c9b95;};'use strict';var Sequelize=require(_0x01ab('0x0'));module[_0x01ab('0x1')]={'body':{'type':Sequelize[_0x01ab('0x2')]('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 c5eace2..537f3a9 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(_0x4f53ec,_0x5e6c21){var _0x33e536=function(_0xe7ddae){while(--_0xe7ddae){_0x4f53ec['push'](_0x4f53ec['shift']());}};_0x33e536(++_0x5e6c21);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +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(_0x2316b8,_0x4dea87){var _0x5add63=function(_0x2a5bd6){while(--_0x2a5bd6){_0x2316b8['push'](_0x2316b8['shift']());}};_0x5add63(++_0x4dea87);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 5b3e49d..54ee0af 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 _0x407d=['exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes'];(function(_0x466ee1,_0x1bdecf){var _0x242788=function(_0x2a5006){while(--_0x2a5006){_0x466ee1['push'](_0x466ee1['shift']());}};_0x242788(++_0x1bdecf);}(_0x407d,0x7d));var _0xd407=function(_0xa19de1,_0x25cbd7){_0xa19de1=_0xa19de1-0x0;var _0x205df4=_0x407d[_0xa19de1];return _0x205df4;};'use strict';var _=require(_0xd407('0x0'));var util=require(_0xd407('0x1'));var logger=require(_0xd407('0x2'))(_0xd407('0x3'));var moment=require('moment');var BPromise=require(_0xd407('0x4'));var rp=require(_0xd407('0x5'));var fs=require('fs');var path=require(_0xd407('0x6'));var rimraf=require(_0xd407('0x7'));var config=require(_0xd407('0x8'));var attributes=require(_0xd407('0x9'));module[_0xd407('0xa')]=function(_0x11f8a2,_0xd02cb){return _0x11f8a2[_0xd407('0xb')](_0xd407('0xc'),attributes,{'tableName':_0xd407('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xd407('0xe')});}; \ No newline at end of file +var _0x50d9=['bluebird','request-promise','path','rimraf','../../config/environment','exports','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','util','api','moment'];(function(_0x56b886,_0x1ff474){var _0x164baf=function(_0x575d09){while(--_0x575d09){_0x56b886['push'](_0x56b886['shift']());}};_0x164baf(++_0x1ff474);}(_0x50d9,0x1e9));var _0x950d=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x50d9[_0x580576];return _0x3f55a0;};'use strict';var _=require('lodash');var util=require(_0x950d('0x0'));var logger=require('../../config/logger')(_0x950d('0x1'));var moment=require(_0x950d('0x2'));var BPromise=require(_0x950d('0x3'));var rp=require(_0x950d('0x4'));var fs=require('fs');var path=require(_0x950d('0x5'));var rimraf=require(_0x950d('0x6'));var config=require(_0x950d('0x7'));var attributes=require('./chatOfflineMessage.attributes');module[_0x950d('0x8')]=function(_0x1a3069,_0x3a1f35){return _0x1a3069['define']('ChatOfflineMessage',attributes,{'tableName':_0x950d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x950d('0xa'),'collate':_0x950d('0xb')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 0ea47c5..3e67344 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 _0x2bd8=['info','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','ChatOfflineMessage,\x20%s,\x20%s','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x100bd5,_0x27a3ec){var _0x310341=function(_0x692a97){while(--_0x692a97){_0x100bd5['push'](_0x100bd5['shift']());}};_0x310341(++_0x27a3ec);}(_0x2bd8,0x130));var _0x82bd=function(_0x283ae6,_0x3cb1c0){_0x283ae6=_0x283ae6-0x0;var _0x3d4e2d=_0x2bd8[_0x283ae6];return _0x3d4e2d;};'use strict';var _=require(_0x82bd('0x0'));var util=require('util');var moment=require(_0x82bd('0x1'));var BPromise=require(_0x82bd('0x2'));var rs=require(_0x82bd('0x3'));var fs=require('fs');var Redis=require(_0x82bd('0x4'));var db=require(_0x82bd('0x5'))['db'];var utils=require(_0x82bd('0x6'));var logger=require(_0x82bd('0x7'))('rpc');var config=require(_0x82bd('0x8'));var jayson=require(_0x82bd('0x9'));var client=jayson[_0x82bd('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19dbb1,_0x77d7a9,_0x226f60){return new BPromise(function(_0x1f7463,_0x4dc3a6){return client[_0x82bd('0xb')](_0x19dbb1,_0x226f60)['then'](function(_0x4a9b2c){logger['info'](_0x82bd('0xc'),_0x77d7a9,'request\x20sent');logger['debug'](_0x82bd('0xd'),_0x77d7a9,'request\x20sent',JSON['stringify'](_0x4a9b2c));if(_0x4a9b2c[_0x82bd('0xe')]){if(_0x4a9b2c[_0x82bd('0xe')]['code']===0x1f4){logger[_0x82bd('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x77d7a9,_0x4a9b2c[_0x82bd('0xe')]['message']);return _0x4dc3a6(_0x4a9b2c[_0x82bd('0xe')][_0x82bd('0xf')]);}logger[_0x82bd('0xe')](_0x82bd('0xc'),_0x77d7a9,_0x4a9b2c['error'][_0x82bd('0xf')]);return _0x1f7463(_0x4a9b2c[_0x82bd('0xe')]['message']);}else{logger[_0x82bd('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x77d7a9,_0x82bd('0x11'));_0x1f7463(_0x4a9b2c[_0x82bd('0x12')][_0x82bd('0xf')]);}})[_0x82bd('0x13')](function(_0x209081){logger[_0x82bd('0xe')](_0x82bd('0xc'),_0x77d7a9,_0x209081);_0x4dc3a6(_0x209081);});});} \ No newline at end of file +var _0x28d1=['lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch'];(function(_0x2f6ce3,_0x23cd93){var _0x20cf45=function(_0x1d3462){while(--_0x1d3462){_0x2f6ce3['push'](_0x2f6ce3['shift']());}};_0x20cf45(++_0x23cd93);}(_0x28d1,0xbd));var _0x128d=function(_0x2dcea6,_0x1c428b){_0x2dcea6=_0x2dcea6-0x0;var _0x129701=_0x28d1[_0x2dcea6];return _0x129701;};'use strict';var _=require(_0x128d('0x0'));var util=require(_0x128d('0x1'));var moment=require(_0x128d('0x2'));var BPromise=require(_0x128d('0x3'));var rs=require(_0x128d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x128d('0x5'));var logger=require(_0x128d('0x6'))(_0x128d('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x128d('0x8')][_0x128d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3913e7,_0x155c80,_0xf2e2b5){return new BPromise(function(_0x1645a3,_0x464c32){return client[_0x128d('0xa')](_0x3913e7,_0xf2e2b5)[_0x128d('0xb')](function(_0x552695){logger['info'](_0x128d('0xc'),_0x155c80,_0x128d('0xd'));logger[_0x128d('0xe')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x155c80,_0x128d('0xd'),JSON[_0x128d('0xf')](_0x552695));if(_0x552695['error']){if(_0x552695[_0x128d('0x10')]['code']===0x1f4){logger[_0x128d('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x155c80,_0x552695[_0x128d('0x10')][_0x128d('0x11')]);return _0x464c32(_0x552695[_0x128d('0x10')][_0x128d('0x11')]);}logger[_0x128d('0x10')](_0x128d('0xc'),_0x155c80,_0x552695[_0x128d('0x10')][_0x128d('0x11')]);return _0x1645a3(_0x552695[_0x128d('0x10')][_0x128d('0x11')]);}else{logger[_0x128d('0x12')](_0x128d('0xc'),_0x155c80,'request\x20sent');_0x1645a3(_0x552695[_0x128d('0x13')][_0x128d('0x11')]);}})[_0x128d('0x14')](function(_0x4339df){logger[_0x128d('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x155c80,_0x4339df);_0x464c32(_0x4339df);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index ec80b0c..3c8b17f 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 _0x478f=['post','/:id','update','delete','destroy','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','isAuthenticated','describe','get','show'];(function(_0x3f6f5b,_0x3624eb){var _0x2973a5=function(_0x2e9e3f){while(--_0x2e9e3f){_0x3f6f5b['push'](_0x3f6f5b['shift']());}};_0x2973a5(++_0x3624eb);}(_0x478f,0x18b));var _0xf478=function(_0x1fb723,_0x5ad05f){_0x1fb723=_0x1fb723-0x0;var _0x320dab=_0x478f[_0x1fb723];return _0x320dab;};'use strict';var multer=require('multer');var util=require(_0xf478('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf478('0x1'));var router=express['Router']();var fs_extra=require(_0xf478('0x2'));var auth=require(_0xf478('0x3'));var interaction=require(_0xf478('0x4'));var config=require('../../config/environment');var controller=require(_0xf478('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0xf478('0x6')](),controller[_0xf478('0x7')]);router[_0xf478('0x8')]('/:id',auth[_0xf478('0x6')](),controller[_0xf478('0x9')]);router[_0xf478('0xa')]('/',auth[_0xf478('0x6')](),controller['create']);router['put'](_0xf478('0xb'),auth[_0xf478('0x6')](),controller[_0xf478('0xc')]);router[_0xf478('0xd')](_0xf478('0xb'),auth[_0xf478('0x6')](),controller[_0xf478('0xe')]);module['exports']=router; \ No newline at end of file +var _0xd1b5=['./chatOfflineMessage.controller','isAuthenticated','index','get','/describe','/:id','show','post','create','put','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x37a7c6,_0x3a84b6){var _0x539905=function(_0xa00c20){while(--_0xa00c20){_0x37a7c6['push'](_0x37a7c6['shift']());}};_0x539905(++_0x3a84b6);}(_0xd1b5,0x1d9));var _0x5d1b=function(_0x3ff556,_0x3bbeff){_0x3ff556=_0x3ff556-0x0;var _0x453a3b=_0xd1b5[_0x3ff556];return _0x453a3b;};'use strict';var multer=require(_0x5d1b('0x0'));var util=require(_0x5d1b('0x1'));var path=require(_0x5d1b('0x2'));var timeout=require(_0x5d1b('0x3'));var express=require(_0x5d1b('0x4'));var router=express[_0x5d1b('0x5')]();var fs_extra=require(_0x5d1b('0x6'));var auth=require(_0x5d1b('0x7'));var interaction=require(_0x5d1b('0x8'));var config=require(_0x5d1b('0x9'));var controller=require(_0x5d1b('0xa'));router['get']('/',auth[_0x5d1b('0xb')](),controller[_0x5d1b('0xc')]);router[_0x5d1b('0xd')](_0x5d1b('0xe'),auth['isAuthenticated'](),controller['describe']);router[_0x5d1b('0xd')](_0x5d1b('0xf'),auth['isAuthenticated'](),controller[_0x5d1b('0x10')]);router[_0x5d1b('0x11')]('/',auth[_0x5d1b('0xb')](),controller[_0x5d1b('0x12')]);router[_0x5d1b('0x13')](_0x5d1b('0xf'),auth[_0x5d1b('0xb')](),controller['update']);router['delete']('/:id',auth[_0x5d1b('0xb')](),controller[_0x5d1b('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index eea22d1..281407c 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 _0xe3b2=['STRING','mouseOver','INTEGER','sequelize','exports'];(function(_0x28fcdc,_0x17e930){var _0x80bd4c=function(_0x2c490d){while(--_0x2c490d){_0x28fcdc['push'](_0x28fcdc['shift']());}};_0x80bd4c(++_0x17e930);}(_0xe3b2,0x12f));var _0x2e3b=function(_0x402a07,_0xf894){_0x402a07=_0x402a07-0x0;var _0x49563b=_0xe3b2[_0x402a07];return _0x49563b;};'use strict';var Sequelize=require(_0x2e3b('0x0'));module[_0x2e3b('0x1')]={'name':{'type':Sequelize[_0x2e3b('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver','timeout'),'defaultValue':_0x2e3b('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x2e3b('0x4')]}}; \ No newline at end of file +var _0x50ab=['timeout','sequelize','exports','STRING','ENUM','mouseOver'];(function(_0x12e140,_0x2fa70d){var _0x33f9c3=function(_0x146117){while(--_0x146117){_0x12e140['push'](_0x12e140['shift']());}};_0x33f9c3(++_0x2fa70d);}(_0x50ab,0x19f));var _0xb50a=function(_0x53b0f8,_0x459130){_0x53b0f8=_0x53b0f8-0x0;var _0x133415=_0x50ab[_0x53b0f8];return _0x133415;};'use strict';var Sequelize=require(_0xb50a('0x0'));module[_0xb50a('0x1')]={'name':{'type':Sequelize[_0xb50a('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb50a('0x3')](_0xb50a('0x4'),_0xb50a('0x5')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xb50a('0x2')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 63f452c..d620bfa 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 _0x6c32=['limit','undefined','count','set','apply','update','then','destroy','error','send','show','params','model','keys','query','attributes','includeAll','include','merge','options','create','ChatProactiveAction','catch','body','find','eml-format','zip-dir','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset'];(function(_0x260e4b,_0x54668d){var _0x18dfba=function(_0x37b530){while(--_0x37b530){_0x260e4b['push'](_0x260e4b['shift']());}};_0x18dfba(++_0x54668d);}(_0x6c32,0xb5));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x26c3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x26c3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x26c3('0x2'));var moment=require('moment');var BPromise=require(_0x26c3('0x3'));var Mustache=require(_0x26c3('0x4'));var util=require('util');var path=require('path');var sox=require(_0x26c3('0x5'));var csv=require(_0x26c3('0x6'));var ejs=require(_0x26c3('0x7'));var fs=require('fs');var fs_extra=require(_0x26c3('0x8'));var _=require(_0x26c3('0x9'));var squel=require(_0x26c3('0xa'));var crypto=require(_0x26c3('0xb'));var jsforce=require(_0x26c3('0xc'));var deskjs=require(_0x26c3('0xd'));var toCsv=require(_0x26c3('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x26c3('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x26c3('0xf'));var as=require(_0x26c3('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x26c3('0x11'))(_0x26c3('0x12'));var utils=require(_0x26c3('0x13'));var config=require(_0x26c3('0x14'));var licenseUtil=require(_0x26c3('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41a6c2,_0x3be1d4){_0x3be1d4=_0x3be1d4||0xcc;return function(_0x3e00f4){if(_0x3e00f4){return _0x41a6c2[_0x26c3('0x16')](_0x3be1d4);}return _0x41a6c2[_0x26c3('0x17')](_0x3be1d4)[_0x26c3('0x18')]();};}function respondWithResult(_0x1a8ea5,_0x278214){_0x278214=_0x278214||0xc8;return function(_0x5443cd){if(_0x5443cd){return _0x1a8ea5['status'](_0x278214)[_0x26c3('0x19')](_0x5443cd);}};}function respondWithFilteredResult(_0xd612e7,_0xd2f9a7){return function(_0x2e8f6b){if(_0x2e8f6b){var _0xad4e1e=typeof _0xd2f9a7[_0x26c3('0x1a')]==='undefined'&&typeof _0xd2f9a7[_0x26c3('0x1b')]===_0x26c3('0x1c');var _0x4db301=_0x2e8f6b[_0x26c3('0x1d')];var _0x4de336=_0xad4e1e?0x0:_0xd2f9a7[_0x26c3('0x1a')];var _0x570b03=_0xad4e1e?_0x2e8f6b[_0x26c3('0x1d')]:_0xd2f9a7[_0x26c3('0x1a')]+_0xd2f9a7[_0x26c3('0x1b')];var _0x26ae49;if(_0x570b03>=_0x4db301){_0x570b03=_0x4db301;_0x26ae49=0xc8;}else{_0x26ae49=0xce;}_0xd612e7['status'](_0x26ae49);return _0xd612e7[_0x26c3('0x1e')]('Content-Range',_0x4de336+'-'+_0x570b03+'/'+_0x4db301)[_0x26c3('0x19')](_0x2e8f6b);}return null;};}function patchUpdates(_0x48ea4a){return function(_0x1c77e6){try{jsonpatch[_0x26c3('0x1f')](_0x1c77e6,_0x48ea4a,!![]);}catch(_0x8819f2){return BPromise['reject'](_0x8819f2);}return _0x1c77e6['save']();};}function saveUpdates(_0x524ac1,_0x25f771){return function(_0xba4076){if(_0xba4076){return _0xba4076[_0x26c3('0x20')](_0x524ac1)[_0x26c3('0x21')](function(_0x3db905){return _0x3db905;});}return null;};}function removeEntity(_0x582b5e,_0x39c6fb){return function(_0x4a5220){if(_0x4a5220){return _0x4a5220[_0x26c3('0x22')]()[_0x26c3('0x21')](function(){_0x582b5e[_0x26c3('0x17')](0xcc)[_0x26c3('0x18')]();});}};}function handleEntityNotFound(_0x3aa515,_0x37373c){return function(_0xf8aee0){if(!_0xf8aee0){_0x3aa515[_0x26c3('0x16')](0x194);}return _0xf8aee0;};}function handleError(_0xd14177,_0x3ab3d6){_0x3ab3d6=_0x3ab3d6||0x1f4;return function(_0x15380c){logger[_0x26c3('0x23')](_0x15380c['stack']);if(_0x15380c['name']){delete _0x15380c['name'];}_0xd14177[_0x26c3('0x17')](_0x3ab3d6)[_0x26c3('0x24')](_0x15380c);};}exports[_0x26c3('0x25')]=function(_0xa1cf3d,_0x31d3f4){var _0x48f0dd={'raw':!![],'where':{'id':_0xa1cf3d[_0x26c3('0x26')]['id']}},_0x3aa957={};_0x3aa957[_0x26c3('0x27')]=_[_0x26c3('0x28')](db['ChatProactiveAction']['rawAttributes']);_0x3aa957[_0x26c3('0x29')]=_[_0x26c3('0x28')](_0xa1cf3d[_0x26c3('0x29')]);_0x3aa957['filters']=_['intersection'](_0x3aa957[_0x26c3('0x27')],_0x3aa957[_0x26c3('0x29')]);_0x48f0dd[_0x26c3('0x2a')]=_['intersection'](_0x3aa957[_0x26c3('0x27')],qs['fields'](_0xa1cf3d[_0x26c3('0x29')]['fields']));_0x48f0dd[_0x26c3('0x2a')]=_0x48f0dd['attributes']['length']?_0x48f0dd[_0x26c3('0x2a')]:_0x3aa957[_0x26c3('0x27')];if(_0xa1cf3d[_0x26c3('0x29')][_0x26c3('0x2b')]){_0x48f0dd[_0x26c3('0x2c')]=[{'all':!![]}];}_0x48f0dd=_[_0x26c3('0x2d')]({},_0x48f0dd,_0xa1cf3d[_0x26c3('0x2e')]);return db['ChatProactiveAction']['find'](_0x48f0dd)[_0x26c3('0x21')](handleEntityNotFound(_0x31d3f4,null))[_0x26c3('0x21')](respondWithResult(_0x31d3f4,null))['catch'](handleError(_0x31d3f4,null));};exports[_0x26c3('0x2f')]=function(_0x2151ef,_0x618da6){return db[_0x26c3('0x30')]['create'](_0x2151ef['body'],{})['then'](respondWithResult(_0x618da6,0xc9))[_0x26c3('0x31')](handleError(_0x618da6,null));};exports[_0x26c3('0x20')]=function(_0x9af56f,_0x2307a0){if(_0x9af56f[_0x26c3('0x32')]['id']){delete _0x9af56f[_0x26c3('0x32')]['id'];}return db[_0x26c3('0x30')][_0x26c3('0x33')]({'where':{'id':_0x9af56f[_0x26c3('0x26')]['id']}})[_0x26c3('0x21')](handleEntityNotFound(_0x2307a0,null))[_0x26c3('0x21')](saveUpdates(_0x9af56f[_0x26c3('0x32')],null))[_0x26c3('0x21')](respondWithResult(_0x2307a0,null))[_0x26c3('0x31')](handleError(_0x2307a0,null));};exports[_0x26c3('0x22')]=function(_0x41af19,_0x3de84e){return db['ChatProactiveAction'][_0x26c3('0x33')]({'where':{'id':_0x41af19[_0x26c3('0x26')]['id']}})[_0x26c3('0x21')](handleEntityNotFound(_0x3de84e,null))[_0x26c3('0x21')](removeEntity(_0x3de84e,null))['catch'](handleError(_0x3de84e,null));}; \ No newline at end of file +var _0xac9d=['destroy','sendStatus','error','stack','name','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','merge','create','body','catch','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then'];(function(_0x26c8de,_0x6961c){var _0x4eafec=function(_0x3eb910){while(--_0x3eb910){_0x26c8de['push'](_0x26c8de['shift']());}};_0x4eafec(++_0x6961c);}(_0xac9d,0x14d));var _0xdac9=function(_0xb0ed0c,_0x1a1fb1){_0xb0ed0c=_0xb0ed0c-0x0;var _0x5d5356=_0xac9d[_0xb0ed0c];return _0x5d5356;};'use strict';var emlformat=require(_0xdac9('0x0'));var rimraf=require(_0xdac9('0x1'));var zipdir=require(_0xdac9('0x2'));var jsonpatch=require(_0xdac9('0x3'));var rp=require(_0xdac9('0x4'));var moment=require(_0xdac9('0x5'));var BPromise=require(_0xdac9('0x6'));var Mustache=require(_0xdac9('0x7'));var util=require('util');var path=require(_0xdac9('0x8'));var sox=require('sox');var csv=require(_0xdac9('0x9'));var ejs=require(_0xdac9('0xa'));var fs=require('fs');var fs_extra=require(_0xdac9('0xb'));var _=require(_0xdac9('0xc'));var squel=require(_0xdac9('0xd'));var crypto=require(_0xdac9('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xdac9('0xf'));var toCsv=require('to-csv');var querystring=require(_0xdac9('0x10'));var Papa=require(_0xdac9('0x11'));var Redis=require(_0xdac9('0x12'));var authService=require(_0xdac9('0x13'));var qs=require(_0xdac9('0x14'));var as=require(_0xdac9('0x15'));var hardwareService=require(_0xdac9('0x16'));var logger=require(_0xdac9('0x17'))(_0xdac9('0x18'));var utils=require('../../config/utils');var config=require(_0xdac9('0x19'));var licenseUtil=require(_0xdac9('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d8e97,_0xeddbc1){_0xeddbc1=_0xeddbc1||0xcc;return function(_0xbfe6d8){if(_0xbfe6d8){return _0x3d8e97['sendStatus'](_0xeddbc1);}return _0x3d8e97[_0xdac9('0x1b')](_0xeddbc1)[_0xdac9('0x1c')]();};}function respondWithResult(_0x9e1bf6,_0x5f0bbd){_0x5f0bbd=_0x5f0bbd||0xc8;return function(_0x5dd536){if(_0x5dd536){return _0x9e1bf6[_0xdac9('0x1b')](_0x5f0bbd)[_0xdac9('0x1d')](_0x5dd536);}};}function respondWithFilteredResult(_0x50f9fe,_0x76af7a){return function(_0x36cbe4){if(_0x36cbe4){var _0x152ea5=typeof _0x76af7a[_0xdac9('0x1e')]===_0xdac9('0x1f')&&typeof _0x76af7a[_0xdac9('0x20')]===_0xdac9('0x1f');var _0xec1016=_0x36cbe4['count'];var _0x283343=_0x152ea5?0x0:_0x76af7a[_0xdac9('0x1e')];var _0x571e07=_0x152ea5?_0x36cbe4[_0xdac9('0x21')]:_0x76af7a[_0xdac9('0x1e')]+_0x76af7a[_0xdac9('0x20')];var _0x181d11;if(_0x571e07>=_0xec1016){_0x571e07=_0xec1016;_0x181d11=0xc8;}else{_0x181d11=0xce;}_0x50f9fe['status'](_0x181d11);return _0x50f9fe['set'](_0xdac9('0x22'),_0x283343+'-'+_0x571e07+'/'+_0xec1016)[_0xdac9('0x1d')](_0x36cbe4);}return null;};}function patchUpdates(_0x2b9d91){return function(_0x395ec7){try{jsonpatch['apply'](_0x395ec7,_0x2b9d91,!![]);}catch(_0x23ee5e){return BPromise[_0xdac9('0x23')](_0x23ee5e);}return _0x395ec7[_0xdac9('0x24')]();};}function saveUpdates(_0xae680a,_0xe7bd10){return function(_0x42317c){if(_0x42317c){return _0x42317c[_0xdac9('0x25')](_0xae680a)[_0xdac9('0x26')](function(_0x419f0c){return _0x419f0c;});}return null;};}function removeEntity(_0x33de5c,_0x5a0fa2){return function(_0x2943f5){if(_0x2943f5){return _0x2943f5[_0xdac9('0x27')]()[_0xdac9('0x26')](function(){_0x33de5c[_0xdac9('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e631a,_0x5686db){return function(_0x3ce475){if(!_0x3ce475){_0x1e631a[_0xdac9('0x28')](0x194);}return _0x3ce475;};}function handleError(_0x566d8c,_0x433be9){_0x433be9=_0x433be9||0x1f4;return function(_0x5105f1){logger[_0xdac9('0x29')](_0x5105f1[_0xdac9('0x2a')]);if(_0x5105f1[_0xdac9('0x2b')]){delete _0x5105f1[_0xdac9('0x2b')];}_0x566d8c['status'](_0x433be9)['send'](_0x5105f1);};}exports[_0xdac9('0x2c')]=function(_0x170afd,_0x4fe3bd){var _0x4c4e21={'raw':!![],'where':{'id':_0x170afd[_0xdac9('0x2d')]['id']}},_0x3eed7a={};_0x3eed7a[_0xdac9('0x2e')]=_[_0xdac9('0x2f')](db[_0xdac9('0x30')][_0xdac9('0x31')]);_0x3eed7a[_0xdac9('0x32')]=_[_0xdac9('0x2f')](_0x170afd[_0xdac9('0x32')]);_0x3eed7a[_0xdac9('0x33')]=_[_0xdac9('0x34')](_0x3eed7a[_0xdac9('0x2e')],_0x3eed7a[_0xdac9('0x32')]);_0x4c4e21[_0xdac9('0x35')]=_[_0xdac9('0x34')](_0x3eed7a[_0xdac9('0x2e')],qs[_0xdac9('0x36')](_0x170afd[_0xdac9('0x32')][_0xdac9('0x36')]));_0x4c4e21[_0xdac9('0x35')]=_0x4c4e21[_0xdac9('0x35')]['length']?_0x4c4e21['attributes']:_0x3eed7a[_0xdac9('0x2e')];if(_0x170afd[_0xdac9('0x32')][_0xdac9('0x37')]){_0x4c4e21[_0xdac9('0x38')]=[{'all':!![]}];}_0x4c4e21=_[_0xdac9('0x39')]({},_0x4c4e21,_0x170afd['options']);return db[_0xdac9('0x30')]['find'](_0x4c4e21)[_0xdac9('0x26')](handleEntityNotFound(_0x4fe3bd,null))[_0xdac9('0x26')](respondWithResult(_0x4fe3bd,null))['catch'](handleError(_0x4fe3bd,null));};exports[_0xdac9('0x3a')]=function(_0x5222f8,_0x52d758){return db[_0xdac9('0x30')][_0xdac9('0x3a')](_0x5222f8[_0xdac9('0x3b')],{})[_0xdac9('0x26')](respondWithResult(_0x52d758,0xc9))[_0xdac9('0x3c')](handleError(_0x52d758,null));};exports[_0xdac9('0x25')]=function(_0x51cde6,_0x265975){if(_0x51cde6[_0xdac9('0x3b')]['id']){delete _0x51cde6['body']['id'];}return db[_0xdac9('0x30')][_0xdac9('0x3d')]({'where':{'id':_0x51cde6[_0xdac9('0x2d')]['id']}})[_0xdac9('0x26')](handleEntityNotFound(_0x265975,null))[_0xdac9('0x26')](saveUpdates(_0x51cde6[_0xdac9('0x3b')],null))[_0xdac9('0x26')](respondWithResult(_0x265975,null))['catch'](handleError(_0x265975,null));};exports[_0xdac9('0x27')]=function(_0x2f9f10,_0x238769){return db['ChatProactiveAction'][_0xdac9('0x3d')]({'where':{'id':_0x2f9f10[_0xdac9('0x2d')]['id']}})[_0xdac9('0x26')](handleEntityNotFound(_0x238769,null))[_0xdac9('0x26')](removeEntity(_0x238769,null))['catch'](handleError(_0x238769,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 7466e8a..9afc1e8 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 _0xbdac=['ChatProactiveAction','chat_proactive_actions','util','api','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x145c83,_0x57873a){var _0x4ff0c6=function(_0xf0357b){while(--_0xf0357b){_0x145c83['push'](_0x145c83['shift']());}};_0x4ff0c6(++_0x57873a);}(_0xbdac,0x8e));var _0xcbda=function(_0x199283,_0x1317b5){_0x199283=_0x199283-0x0;var _0x52fe3f=_0xbdac[_0x199283];return _0x52fe3f;};'use strict';var _=require('lodash');var util=require(_0xcbda('0x0'));var logger=require('../../config/logger')(_0xcbda('0x1'));var moment=require('moment');var BPromise=require(_0xcbda('0x2'));var rp=require(_0xcbda('0x3'));var fs=require('fs');var path=require(_0xcbda('0x4'));var rimraf=require('rimraf');var config=require(_0xcbda('0x5'));var attributes=require('./chatProactiveAction.attributes');module[_0xcbda('0x6')]=function(_0x2d664e,_0x49079c){return _0x2d664e[_0xcbda('0x7')](_0xcbda('0x8'),attributes,{'tableName':_0xcbda('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xef5a=['bluebird','request-promise','path','rimraf','../../config/environment','exports','chat_proactive_actions','util','../../config/logger','api','moment'];(function(_0x87b218,_0x254d1f){var _0x21c59b=function(_0x1504ec){while(--_0x1504ec){_0x87b218['push'](_0x87b218['shift']());}};_0x21c59b(++_0x254d1f);}(_0xef5a,0x11a));var _0xaef5=function(_0x4a9433,_0x5337cb){_0x4a9433=_0x4a9433-0x0;var _0x434947=_0xef5a[_0x4a9433];return _0x434947;};'use strict';var _=require('lodash');var util=require(_0xaef5('0x0'));var logger=require(_0xaef5('0x1'))(_0xaef5('0x2'));var moment=require(_0xaef5('0x3'));var BPromise=require(_0xaef5('0x4'));var rp=require(_0xaef5('0x5'));var fs=require('fs');var path=require(_0xaef5('0x6'));var rimraf=require(_0xaef5('0x7'));var config=require(_0xaef5('0x8'));var attributes=require('./chatProactiveAction.attributes');module[_0xaef5('0x9')]=function(_0x1047c2,_0xbbfbe5){return _0x1047c2['define']('ChatProactiveAction',attributes,{'tableName':_0xaef5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index daa7d08..ca1d7a7 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 _0x0a70=['result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','code','error','message'];(function(_0x154192,_0x2d360f){var _0x3c2792=function(_0x2e257b){while(--_0x2e257b){_0x154192['push'](_0x154192['shift']());}};_0x3c2792(++_0x2d360f);}(_0x0a70,0x151));var _0x00a7=function(_0x574b20,_0xeb0eab){_0x574b20=_0x574b20-0x0;var _0x280a02=_0x0a70[_0x574b20];return _0x280a02;};'use strict';var _=require(_0x00a7('0x0'));var util=require('util');var moment=require(_0x00a7('0x1'));var BPromise=require(_0x00a7('0x2'));var rs=require(_0x00a7('0x3'));var fs=require('fs');var Redis=require(_0x00a7('0x4'));var db=require(_0x00a7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x00a7('0x6'))(_0x00a7('0x7'));var config=require(_0x00a7('0x8'));var jayson=require(_0x00a7('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x50d8dc,_0x46e526,_0x2d6565){return new BPromise(function(_0x5373e5,_0x5acadc){return client[_0x00a7('0xa')](_0x50d8dc,_0x2d6565)[_0x00a7('0xb')](function(_0x38e5d5){logger[_0x00a7('0xc')](_0x00a7('0xd'),_0x46e526,_0x00a7('0xe'));logger[_0x00a7('0xf')](_0x00a7('0x10'),_0x46e526,_0x00a7('0xe'),JSON['stringify'](_0x38e5d5));if(_0x38e5d5['error']){if(_0x38e5d5['error'][_0x00a7('0x11')]===0x1f4){logger[_0x00a7('0x12')](_0x00a7('0xd'),_0x46e526,_0x38e5d5[_0x00a7('0x12')][_0x00a7('0x13')]);return _0x5acadc(_0x38e5d5['error'][_0x00a7('0x13')]);}logger[_0x00a7('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x46e526,_0x38e5d5[_0x00a7('0x12')][_0x00a7('0x13')]);return _0x5373e5(_0x38e5d5[_0x00a7('0x12')][_0x00a7('0x13')]);}else{logger[_0x00a7('0xc')](_0x00a7('0xd'),_0x46e526,'request\x20sent');_0x5373e5(_0x38e5d5[_0x00a7('0x14')][_0x00a7('0x13')]);}})['catch'](function(_0x4c46f6){logger[_0x00a7('0x12')](_0x00a7('0xd'),_0x46e526,_0x4c46f6);_0x5acadc(_0x4c46f6);});});} \ No newline at end of file +var _0xe790=['code','error','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s'];(function(_0x4ee6e4,_0x492c03){var _0x4ff1d8=function(_0x46f8ec){while(--_0x46f8ec){_0x4ee6e4['push'](_0x4ee6e4['shift']());}};_0x4ff1d8(++_0x492c03);}(_0xe790,0x90));var _0x0e79=function(_0x44cc5c,_0x2ab75c){_0x44cc5c=_0x44cc5c-0x0;var _0xc9061=_0xe790[_0x44cc5c];return _0xc9061;};'use strict';var _=require('lodash');var util=require(_0x0e79('0x0'));var moment=require(_0x0e79('0x1'));var BPromise=require(_0x0e79('0x2'));var rs=require(_0x0e79('0x3'));var fs=require('fs');var Redis=require(_0x0e79('0x4'));var db=require(_0x0e79('0x5'))['db'];var utils=require(_0x0e79('0x6'));var logger=require(_0x0e79('0x7'))('rpc');var config=require(_0x0e79('0x8'));var jayson=require(_0x0e79('0x9'));var client=jayson['client'][_0x0e79('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a7e30,_0x3c2e12,_0x5c3314){return new BPromise(function(_0x4e399a,_0x5a37a7){return client[_0x0e79('0xb')](_0x3a7e30,_0x5c3314)['then'](function(_0xc25700){logger[_0x0e79('0xc')](_0x0e79('0xd'),_0x3c2e12,_0x0e79('0xe'));logger['debug'](_0x0e79('0xf'),_0x3c2e12,'request\x20sent',JSON['stringify'](_0xc25700));if(_0xc25700['error']){if(_0xc25700['error'][_0x0e79('0x10')]===0x1f4){logger[_0x0e79('0x11')](_0x0e79('0xd'),_0x3c2e12,_0xc25700['error'][_0x0e79('0x12')]);return _0x5a37a7(_0xc25700[_0x0e79('0x11')][_0x0e79('0x12')]);}logger['error'](_0x0e79('0xd'),_0x3c2e12,_0xc25700['error']['message']);return _0x4e399a(_0xc25700[_0x0e79('0x11')][_0x0e79('0x12')]);}else{logger[_0x0e79('0xc')](_0x0e79('0xd'),_0x3c2e12,'request\x20sent');_0x4e399a(_0xc25700[_0x0e79('0x13')][_0x0e79('0x12')]);}})['catch'](function(_0x112ca8){logger[_0x0e79('0x11')](_0x0e79('0xd'),_0x3c2e12,_0x112ca8);_0x5a37a7(_0x112ca8);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 9b6b2c7..6041ca0 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 _0xf494=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','create','put','update','delete','exports','multer','util'];(function(_0x1efe08,_0x3dc529){var _0x5e9b2a=function(_0x43b67b){while(--_0x43b67b){_0x1efe08['push'](_0x1efe08['shift']());}};_0x5e9b2a(++_0x3dc529);}(_0xf494,0x1c6));var _0x4f49=function(_0x232162,_0x56a665){_0x232162=_0x232162-0x0;var _0x15b4c5=_0xf494[_0x232162];return _0x15b4c5;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller[_0x4f49('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4f49('0xe')]);router[_0x4f49('0xf')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller[_0x4f49('0x10')]);router[_0x4f49('0x11')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller['destroy']);module[_0x4f49('0x12')]=router; \ No newline at end of file +var _0xee14=['/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller'];(function(_0x56e9e0,_0x4c693f){var _0x319b3c=function(_0x4beb5e){while(--_0x4beb5e){_0x56e9e0['push'](_0x56e9e0['shift']());}};_0x319b3c(++_0x4c693f);}(_0xee14,0x13a));var _0x4ee1=function(_0x416b39,_0x1add02){_0x416b39=_0x416b39-0x0;var _0x20e95c=_0xee14[_0x416b39];return _0x20e95c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4ee1('0x0'));var timeout=require(_0x4ee1('0x1'));var express=require(_0x4ee1('0x2'));var router=express[_0x4ee1('0x3')]();var fs_extra=require(_0x4ee1('0x4'));var auth=require(_0x4ee1('0x5'));var interaction=require(_0x4ee1('0x6'));var config=require(_0x4ee1('0x7'));var controller=require(_0x4ee1('0x8'));router['get'](_0x4ee1('0x9'),auth['isAuthenticated'](),controller[_0x4ee1('0xa')]);router[_0x4ee1('0xb')]('/',auth[_0x4ee1('0xc')](),controller[_0x4ee1('0xd')]);router[_0x4ee1('0xe')](_0x4ee1('0x9'),auth['isAuthenticated'](),controller[_0x4ee1('0xf')]);router[_0x4ee1('0x10')]('/:id',auth[_0x4ee1('0xc')](),controller[_0x4ee1('0x11')]);module[_0x4ee1('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 1cd1801..64887c6 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 _0x18b8=['ENUM','rrmemory','beepall','INTEGER'];(function(_0x51cae7,_0x540716){var _0x36dd74=function(_0x318c06){while(--_0x318c06){_0x51cae7['push'](_0x51cae7['shift']());}};_0x36dd74(++_0x540716);}(_0x18b8,0x17b));var _0x818b=function(_0x31b334,_0x223ed0){_0x31b334=_0x31b334-0x0;var _0x16cfcc=_0x18b8[_0x31b334];return _0x16cfcc;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x818b('0x0')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x818b('0x1')](_0x818b('0x2'),_0x818b('0x3'),'roundrobin')}}; \ No newline at end of file +var _0x8d6e=['beepall','roundrobin','STRING','rrmemory'];(function(_0x356b5b,_0x148ff3){var _0x26f888=function(_0x32f1c2){while(--_0x32f1c2){_0x356b5b['push'](_0x356b5b['shift']());}};_0x26f888(++_0x148ff3);}(_0x8d6e,0x7e));var _0xe8d6=function(_0x7fc203,_0x4b525e){_0x7fc203=_0x7fc203-0x0;var _0xe1c223=_0x8d6e[_0x7fc203];return _0xe1c223;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe8d6('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xe8d6('0x1'),_0xe8d6('0x2'),_0xe8d6('0x3'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index e1d80e3..0852d21 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 _0xaa50=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','request','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','get','ChatQueues','UserProfileResource','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','options','includeAll','include','rows','params','length','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','findAll','User','findAndCountAll','UserId','updatedAt','createdAt','%s/%s','chatPause','getTeams','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','Team','select','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','clone','QueryTypes','SELECT','every','TeamId','includes','compact','removeAgents','userChatQueue:remove','addAgents','omit','getAgents','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa50,0x82));var _0x0aa5=function(_0xb61d88,_0x388bba){_0xb61d88=_0xb61d88-0x0;var _0x196a0d=_0xaa50[_0xb61d88];return _0x196a0d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0aa5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0aa5('0x1'));var rp=require(_0x0aa5('0x2'));var moment=require('moment');var BPromise=require(_0x0aa5('0x3'));var Mustache=require(_0x0aa5('0x4'));var util=require(_0x0aa5('0x5'));var path=require(_0x0aa5('0x6'));var sox=require(_0x0aa5('0x7'));var csv=require(_0x0aa5('0x8'));var ejs=require(_0x0aa5('0x9'));var fs=require('fs');var fs_extra=require(_0x0aa5('0xa'));var _=require(_0x0aa5('0xb'));var squel=require(_0x0aa5('0xc'));var crypto=require(_0x0aa5('0xd'));var jsforce=require(_0x0aa5('0xe'));var deskjs=require(_0x0aa5('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0aa5('0x10'));var Papa=require(_0x0aa5('0x11'));var Redis=require(_0x0aa5('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0aa5('0x13'));var as=require(_0x0aa5('0x14'));var hardwareService=require(_0x0aa5('0x15'));var logger=require(_0x0aa5('0x16'))(_0x0aa5('0x17'));var utils=require(_0x0aa5('0x18'));var config=require(_0x0aa5('0x19'));var licenseUtil=require(_0x0aa5('0x1a'));var db=require('../../mysqldb')['db'];config[_0x0aa5('0x1b')]=_[_0x0aa5('0x1c')](config[_0x0aa5('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x0aa5('0x1d'))(new Redis(config[_0x0aa5('0x1b')]));require(_0x0aa5('0x1e'))[_0x0aa5('0x1f')](socket);var jayson=require(_0x0aa5('0x20'));var client=jayson[_0x0aa5('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x468739,_0xc9975b,_0x4089b9,_0x2c32a8){return new BPromise(function(_0x59569c,_0x5e3d0a){var _0x302f8f=_0x2c32a8||client;return _0x302f8f[_0x0aa5('0x22')](_0x468739,_0x4089b9)['then'](function(_0x41a55d){logger['info'](_0x0aa5('0x23'),_0xc9975b,_0x0aa5('0x24'));logger[_0x0aa5('0x25')](_0x0aa5('0x26'),_0xc9975b,_0x0aa5('0x24'),JSON[_0x0aa5('0x27')](_0x41a55d));if(_0x41a55d[_0x0aa5('0x28')]){if(_0x41a55d[_0x0aa5('0x28')][_0x0aa5('0x29')]===0x1f4){logger['error'](_0x0aa5('0x23'),_0xc9975b,_0x41a55d[_0x0aa5('0x28')][_0x0aa5('0x2a')]);return _0x5e3d0a(_0x41a55d[_0x0aa5('0x28')][_0x0aa5('0x2a')]);}logger[_0x0aa5('0x28')]('ChatQueue,\x20%s,\x20%s',_0xc9975b,_0x41a55d[_0x0aa5('0x28')][_0x0aa5('0x2a')]);return _0x59569c(_0x41a55d['error']['message']);}else{logger[_0x0aa5('0x2b')]('ChatQueue,\x20%s,\x20%s',_0xc9975b,'request\x20sent');_0x59569c(_0x41a55d['result'][_0x0aa5('0x2a')]);}})[_0x0aa5('0x2c')](function(_0x1ab470){logger[_0x0aa5('0x28')](_0x0aa5('0x23'),_0xc9975b,_0x1ab470);_0x5e3d0a(_0x1ab470);});});}function respondWithStatusCode(_0x4a8d58,_0x4c33e0){_0x4c33e0=_0x4c33e0||0xcc;return function(_0x5180e4){if(_0x5180e4){return _0x4a8d58[_0x0aa5('0x2d')](_0x4c33e0);}return _0x4a8d58[_0x0aa5('0x2e')](_0x4c33e0)[_0x0aa5('0x2f')]();};}function respondWithResult(_0x33cce5,_0x154fa5){_0x154fa5=_0x154fa5||0xc8;return function(_0x301d15){if(_0x301d15){return _0x33cce5[_0x0aa5('0x2e')](_0x154fa5)[_0x0aa5('0x30')](_0x301d15);}};}function respondWithFilteredResult(_0x3194e6,_0x3a156a){return function(_0x14c853){if(_0x14c853){var _0x2a980d=typeof _0x3a156a[_0x0aa5('0x31')]===_0x0aa5('0x32')&&typeof _0x3a156a[_0x0aa5('0x33')]===_0x0aa5('0x32');var _0x5e7f22=_0x14c853[_0x0aa5('0x34')];var _0x11a3e2=_0x2a980d?0x0:_0x3a156a['offset'];var _0x4d7b5d=_0x2a980d?_0x14c853[_0x0aa5('0x34')]:_0x3a156a[_0x0aa5('0x31')]+_0x3a156a[_0x0aa5('0x33')];var _0x385d3d;if(_0x4d7b5d>=_0x5e7f22){_0x4d7b5d=_0x5e7f22;_0x385d3d=0xc8;}else{_0x385d3d=0xce;}_0x3194e6[_0x0aa5('0x2e')](_0x385d3d);return _0x3194e6[_0x0aa5('0x35')](_0x0aa5('0x36'),_0x11a3e2+'-'+_0x4d7b5d+'/'+_0x5e7f22)[_0x0aa5('0x30')](_0x14c853);}return null;};}function patchUpdates(_0x1c9425){return function(_0x25adfa){try{jsonpatch['apply'](_0x25adfa,_0x1c9425,!![]);}catch(_0x5e47f5){return BPromise[_0x0aa5('0x37')](_0x5e47f5);}return _0x25adfa[_0x0aa5('0x38')]();};}function saveUpdates(_0x193168,_0x3c6e05){return function(_0x47000a){if(_0x47000a){return _0x47000a[_0x0aa5('0x39')](_0x193168)['then'](function(_0x5a8787){return _0x5a8787;});}return null;};}function removeEntity(_0xb6d9eb,_0x28c32c){return function(_0xc92279){if(_0xc92279){return _0xc92279[_0x0aa5('0x3a')]()[_0x0aa5('0x3b')](function(){var _0x18b3a4=_0xc92279[_0x0aa5('0x3c')]({'plain':!![]});var _0xca5dcb=_0x0aa5('0x3d');return db[_0x0aa5('0x3e')][_0x0aa5('0x3a')]({'where':{'type':_0xca5dcb,'resourceId':_0x18b3a4['id']}})[_0x0aa5('0x3b')](function(){return _0xc92279;});})[_0x0aa5('0x3b')](function(){_0xb6d9eb[_0x0aa5('0x2e')](0xcc)[_0x0aa5('0x2f')]();});}};}function handleEntityNotFound(_0x36db42,_0x1ce3d8){return function(_0x41b613){if(!_0x41b613){_0x36db42[_0x0aa5('0x2d')](0x194);}return _0x41b613;};}function handleError(_0x21db59,_0x41c059){_0x41c059=_0x41c059||0x1f4;return function(_0x305a4b){logger[_0x0aa5('0x28')](_0x305a4b[_0x0aa5('0x3f')]);if(_0x305a4b['name']){delete _0x305a4b[_0x0aa5('0x40')];}_0x21db59[_0x0aa5('0x2e')](_0x41c059)[_0x0aa5('0x41')](_0x305a4b);};}exports[_0x0aa5('0x42')]=function(_0x3efc5a,_0x12664d){var _0x174f64={},_0x2f5f12={},_0x19837f={'count':0x0,'rows':[]};var _0x584a97=_[_0x0aa5('0x43')](db[_0x0aa5('0x44')][_0x0aa5('0x45')],function(_0x583c54){return{'name':_0x583c54[_0x0aa5('0x46')],'type':_0x583c54[_0x0aa5('0x47')][_0x0aa5('0x48')]};});_0x2f5f12[_0x0aa5('0x49')]=_[_0x0aa5('0x43')](_0x584a97,_0x0aa5('0x40'));_0x2f5f12[_0x0aa5('0x4a')]=_[_0x0aa5('0x4b')](_0x3efc5a[_0x0aa5('0x4a')]);_0x2f5f12['filters']=_[_0x0aa5('0x4c')](_0x2f5f12[_0x0aa5('0x49')],_0x2f5f12[_0x0aa5('0x4a')]);_0x174f64[_0x0aa5('0x4d')]=_['intersection'](_0x2f5f12[_0x0aa5('0x49')],qs['fields'](_0x3efc5a[_0x0aa5('0x4a')][_0x0aa5('0x4e')]));_0x174f64[_0x0aa5('0x4d')]=_0x174f64[_0x0aa5('0x4d')]['length']?_0x174f64['attributes']:_0x2f5f12[_0x0aa5('0x49')];if(!_0x3efc5a[_0x0aa5('0x4a')][_0x0aa5('0x4f')](_0x0aa5('0x50'))){_0x174f64[_0x0aa5('0x33')]=qs[_0x0aa5('0x33')](_0x3efc5a[_0x0aa5('0x4a')]['limit']);_0x174f64['offset']=qs[_0x0aa5('0x31')](_0x3efc5a[_0x0aa5('0x4a')]['offset']);}_0x174f64[_0x0aa5('0x51')]=qs[_0x0aa5('0x52')](_0x3efc5a[_0x0aa5('0x4a')][_0x0aa5('0x52')]);_0x174f64[_0x0aa5('0x53')]=qs[_0x0aa5('0x54')](_[_0x0aa5('0x55')](_0x3efc5a[_0x0aa5('0x4a')],_0x2f5f12[_0x0aa5('0x54')]),_0x584a97);if(_0x3efc5a[_0x0aa5('0x4a')]['filter']){_0x174f64[_0x0aa5('0x53')]=_[_0x0aa5('0x56')](_0x174f64['where'],{'$or':_[_0x0aa5('0x43')](_0x584a97,function(_0x2821d7){if(_0x2821d7[_0x0aa5('0x47')]!=='VIRTUAL'){var _0x398c6b={};_0x398c6b[_0x2821d7[_0x0aa5('0x40')]]={'$like':'%'+_0x3efc5a[_0x0aa5('0x4a')][_0x0aa5('0x57')]+'%'};return _0x398c6b;}})});}_0x174f64=_['merge']({},_0x174f64,_0x3efc5a[_0x0aa5('0x58')]);var _0x24774a={'where':_0x174f64[_0x0aa5('0x53')]};return db[_0x0aa5('0x44')]['count'](_0x24774a)[_0x0aa5('0x3b')](function(_0x1e7950){_0x19837f[_0x0aa5('0x34')]=_0x1e7950;if(_0x3efc5a[_0x0aa5('0x4a')][_0x0aa5('0x59')]){_0x174f64[_0x0aa5('0x5a')]=[{'all':!![]}];}return db[_0x0aa5('0x44')]['findAll'](_0x174f64);})[_0x0aa5('0x3b')](function(_0xe2a06f){_0x19837f[_0x0aa5('0x5b')]=_0xe2a06f;return _0x19837f;})['then'](respondWithFilteredResult(_0x12664d,_0x174f64))['catch'](handleError(_0x12664d,null));};exports['show']=function(_0x3beab4,_0x3a7078){var _0x2645d2={'raw':!![],'where':{'id':_0x3beab4[_0x0aa5('0x5c')]['id']}},_0xb8374f={};_0xb8374f[_0x0aa5('0x49')]=_[_0x0aa5('0x4b')](db[_0x0aa5('0x44')][_0x0aa5('0x45')]);_0xb8374f[_0x0aa5('0x4a')]=_[_0x0aa5('0x4b')](_0x3beab4[_0x0aa5('0x4a')]);_0xb8374f['filters']=_['intersection'](_0xb8374f[_0x0aa5('0x49')],_0xb8374f[_0x0aa5('0x4a')]);_0x2645d2[_0x0aa5('0x4d')]=_[_0x0aa5('0x4c')](_0xb8374f['model'],qs[_0x0aa5('0x4e')](_0x3beab4['query'][_0x0aa5('0x4e')]));_0x2645d2[_0x0aa5('0x4d')]=_0x2645d2[_0x0aa5('0x4d')][_0x0aa5('0x5d')]?_0x2645d2['attributes']:_0xb8374f['model'];if(_0x3beab4[_0x0aa5('0x4a')][_0x0aa5('0x59')]){_0x2645d2[_0x0aa5('0x5a')]=[{'all':!![]}];}_0x2645d2=_[_0x0aa5('0x56')]({},_0x2645d2,_0x3beab4[_0x0aa5('0x58')]);return db[_0x0aa5('0x44')][_0x0aa5('0x5e')](_0x2645d2)['then'](handleEntityNotFound(_0x3a7078,null))['then'](respondWithResult(_0x3a7078,null))[_0x0aa5('0x2c')](handleError(_0x3a7078,null));};exports['create']=function(_0x500b3f,_0x396ea6){return db[_0x0aa5('0x44')]['create'](_0x500b3f[_0x0aa5('0x5f')],{})[_0x0aa5('0x3b')](function(_0x36bf0d){var _0x4fd792=_0x500b3f['user'][_0x0aa5('0x3c')]({'plain':!![]});if(!_0x4fd792)throw new Error(_0x0aa5('0x60'));if(_0x4fd792[_0x0aa5('0x61')]===_0x0aa5('0x62')){var _0x2adba0=_0x36bf0d[_0x0aa5('0x3c')]({'plain':!![]});var _0x2ab6a4=_0x0aa5('0x3d');return db['UserProfileSection'][_0x0aa5('0x5e')]({'where':{'name':_0x2ab6a4,'userProfileId':_0x4fd792[_0x0aa5('0x63')]},'raw':!![]})['then'](function(_0x2c9f54){if(_0x2c9f54&&_0x2c9f54[_0x0aa5('0x64')]===0x0){return db[_0x0aa5('0x3e')][_0x0aa5('0x65')]({'name':_0x2adba0[_0x0aa5('0x40')],'resourceId':_0x2adba0['id'],'type':_0x2c9f54[_0x0aa5('0x40')],'sectionId':_0x2c9f54['id']},{})['then'](function(){return _0x36bf0d;});}else{return _0x36bf0d;}})['catch'](function(_0x3778eb){logger['error'](_0x0aa5('0x66'),_0x3778eb);throw _0x3778eb;});}return _0x36bf0d;})[_0x0aa5('0x3b')](respondWithResult(_0x396ea6,0xc9))[_0x0aa5('0x2c')](handleError(_0x396ea6,null));};exports['update']=function(_0xe3a41a,_0x14d9df){if(_0xe3a41a[_0x0aa5('0x5f')]['id']){delete _0xe3a41a[_0x0aa5('0x5f')]['id'];}return db[_0x0aa5('0x44')][_0x0aa5('0x5e')]({'where':{'id':_0xe3a41a[_0x0aa5('0x5c')]['id']}})[_0x0aa5('0x3b')](handleEntityNotFound(_0x14d9df,null))[_0x0aa5('0x3b')](saveUpdates(_0xe3a41a['body'],null))[_0x0aa5('0x3b')](respondWithResult(_0x14d9df,null))['catch'](handleError(_0x14d9df,null));};exports[_0x0aa5('0x3a')]=function(_0x2e026e,_0x373aa3){return db['ChatQueue'][_0x0aa5('0x5e')]({'where':{'id':_0x2e026e[_0x0aa5('0x5c')]['id']}})[_0x0aa5('0x3b')](handleEntityNotFound(_0x373aa3,null))['then'](removeEntity(_0x373aa3,null))[_0x0aa5('0x2c')](handleError(_0x373aa3,null));};exports['describe']=function(_0x48453b,_0x400c05){return db[_0x0aa5('0x44')][_0x0aa5('0x67')]()[_0x0aa5('0x3b')](respondWithResult(_0x400c05,null))[_0x0aa5('0x2c')](handleError(_0x400c05,null));};exports[_0x0aa5('0x68')]=function(_0x96a85f,_0x1c2a49,_0x55e819){var _0x4dd981={'raw':!![],'where':{}},_0x1e76be={},_0x2183cf;return db[_0x0aa5('0x44')][_0x0aa5('0x69')]({'where':{'id':_0x96a85f[_0x0aa5('0x5c')]['id']}})[_0x0aa5('0x3b')](handleEntityNotFound(_0x1c2a49,null))[_0x0aa5('0x3b')](function(_0x5aa40f){if(_0x5aa40f){_0x2183cf=_0x5aa40f[_0x0aa5('0x3c')]({'plain':!![]});_0x1e76be[_0x0aa5('0x49')]=_[_0x0aa5('0x4b')](db[_0x0aa5('0x6a')][_0x0aa5('0x45')]);_0x1e76be['query']=_[_0x0aa5('0x4b')](_0x96a85f[_0x0aa5('0x4a')]);_0x1e76be['filters']=_[_0x0aa5('0x4c')](_0x1e76be[_0x0aa5('0x49')],_0x1e76be['query']);_0x4dd981['attributes']=_[_0x0aa5('0x4c')](_0x1e76be[_0x0aa5('0x49')],qs[_0x0aa5('0x4e')](_0x96a85f[_0x0aa5('0x4a')][_0x0aa5('0x4e')]));_0x4dd981[_0x0aa5('0x4d')]=_0x4dd981[_0x0aa5('0x4d')][_0x0aa5('0x5d')]?_0x4dd981[_0x0aa5('0x4d')]:_0x1e76be[_0x0aa5('0x49')];if(!_0x96a85f['query'][_0x0aa5('0x4f')](_0x0aa5('0x50'))){_0x4dd981['limit']=qs[_0x0aa5('0x33')](_0x96a85f[_0x0aa5('0x4a')][_0x0aa5('0x33')]);_0x4dd981[_0x0aa5('0x31')]=qs[_0x0aa5('0x31')](_0x96a85f['query'][_0x0aa5('0x31')]);}_0x4dd981[_0x0aa5('0x51')]=qs[_0x0aa5('0x52')](_0x96a85f[_0x0aa5('0x4a')][_0x0aa5('0x52')]);_0x4dd981[_0x0aa5('0x53')]=qs['filters'](_[_0x0aa5('0x55')](_0x96a85f[_0x0aa5('0x4a')],_0x1e76be['filters']));_0x4dd981[_0x0aa5('0x53')]['ChatQueueId']=_0x5aa40f['id'];if(_0x96a85f[_0x0aa5('0x4a')][_0x0aa5('0x57')]){_0x4dd981[_0x0aa5('0x53')]=_[_0x0aa5('0x56')](_0x4dd981[_0x0aa5('0x53')],{'$or':_['map'](_0x4dd981[_0x0aa5('0x4d')],function(_0x3512bd){var _0x187017={};_0x187017[_0x3512bd]={'$like':'%'+_0x96a85f[_0x0aa5('0x4a')][_0x0aa5('0x57')]+'%'};return _0x187017;})});}_0x4dd981=_['merge']({},_0x4dd981,_0x96a85f[_0x0aa5('0x58')]);return db[_0x0aa5('0x6a')][_0x0aa5('0x6b')](_0x4dd981);}})[_0x0aa5('0x3b')](function(_0x119c8f){if(_0x119c8f){return db[_0x0aa5('0x6c')][_0x0aa5('0x6d')]({'where':{'id':_[_0x0aa5('0x43')](_0x119c8f,_0x0aa5('0x6e')),'role':'agent'},'attributes':['id',_0x0aa5('0x40'),'chatPause',_0x0aa5('0x6f'),_0x0aa5('0x70')]});}})[_0x0aa5('0x3b')](function(_0x4fde5c){if(_0x4fde5c){return{'count':_0x4fde5c['count'],'rows':_[_0x0aa5('0x43')](_0x4fde5c['rows'],function(_0x4e3544){return{'membername':_0x4e3544[_0x0aa5('0x40')],'UserId':_0x4e3544['id'],'queue_name':_0x2183cf[_0x0aa5('0x40')],'ChatQueueId':_0x2183cf['id'],'interface':util['format'](_0x0aa5('0x71'),'SIP',_0x4e3544['name']),'penalty':0x0,'paused':_0x4e3544[_0x0aa5('0x72')],'createdAt':_0x4e3544[_0x0aa5('0x70')],'updatedAt':_0x4e3544[_0x0aa5('0x6f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0aa5('0x3b')](respondWithFilteredResult(_0x1c2a49,_0x4dd981))['catch'](handleError(_0x1c2a49,null));};exports[_0x0aa5('0x73')]=function(_0x303d2f,_0x18ff51,_0x3d9140){var _0x277af9={};var _0x4ce04b={};var _0x3350f6;var _0x167b5d;return db[_0x0aa5('0x44')][_0x0aa5('0x69')]({'where':{'id':_0x303d2f[_0x0aa5('0x5c')]['id']}})[_0x0aa5('0x3b')](handleEntityNotFound(_0x18ff51,null))['then'](function(_0x3686f5){if(_0x3686f5){_0x3350f6=_0x3686f5;_0x4ce04b[_0x0aa5('0x49')]=_[_0x0aa5('0x4b')](db['Team'][_0x0aa5('0x45')]);_0x4ce04b[_0x0aa5('0x4a')]=_[_0x0aa5('0x4b')](_0x303d2f[_0x0aa5('0x4a')]);_0x4ce04b[_0x0aa5('0x54')]=_[_0x0aa5('0x4c')](_0x4ce04b[_0x0aa5('0x49')],_0x4ce04b[_0x0aa5('0x4a')]);_0x277af9[_0x0aa5('0x4d')]=_[_0x0aa5('0x4c')](_0x4ce04b[_0x0aa5('0x49')],qs[_0x0aa5('0x4e')](_0x303d2f['query'][_0x0aa5('0x4e')]));_0x277af9[_0x0aa5('0x4d')]=_0x277af9['attributes'][_0x0aa5('0x5d')]?_0x277af9[_0x0aa5('0x4d')]:_0x4ce04b[_0x0aa5('0x49')];_0x277af9['order']=qs[_0x0aa5('0x52')](_0x303d2f[_0x0aa5('0x4a')][_0x0aa5('0x52')]);_0x277af9[_0x0aa5('0x53')]=qs[_0x0aa5('0x54')](_[_0x0aa5('0x55')](_0x303d2f[_0x0aa5('0x4a')],_0x4ce04b['filters']));if(_0x303d2f[_0x0aa5('0x4a')][_0x0aa5('0x57')]){_0x277af9['where']=_[_0x0aa5('0x56')](_0x277af9['where'],{'$or':_[_0x0aa5('0x43')](_0x277af9[_0x0aa5('0x4d')],function(_0x5431fc){var _0x20b007={};_0x20b007[_0x5431fc]={'$like':'%'+_0x303d2f[_0x0aa5('0x4a')]['filter']+'%'};return _0x20b007;})});}_0x277af9=_['merge']({},_0x277af9,_0x303d2f[_0x0aa5('0x58')]);return _0x3350f6[_0x0aa5('0x73')](_0x277af9);}})[_0x0aa5('0x3b')](function(_0x200148){if(_0x200148){_0x167b5d=_0x200148['length'];if(!_0x303d2f['query']['hasOwnProperty'](_0x0aa5('0x50'))){_0x277af9['limit']=qs[_0x0aa5('0x33')](_0x303d2f['query'][_0x0aa5('0x33')]);_0x277af9[_0x0aa5('0x31')]=qs[_0x0aa5('0x31')](_0x303d2f[_0x0aa5('0x4a')][_0x0aa5('0x31')]);}return _0x3350f6[_0x0aa5('0x73')](_0x277af9);}})[_0x0aa5('0x3b')](function(_0x16aff6){if(_0x16aff6){return _0x16aff6?{'count':_0x167b5d,'rows':_0x16aff6}:null;}})[_0x0aa5('0x3b')](respondWithResult(_0x18ff51,null))[_0x0aa5('0x2c')](handleError(_0x18ff51,null));};exports[_0x0aa5('0x74')]=function(_0x1fc4a5,_0x285a7e,_0x40174f){var _0xb6f4ce=_0x1fc4a5[_0x0aa5('0x5f')][_0x0aa5('0x75')];return db['Team']['findAll']({'where':{'id':_0xb6f4ce},'attributes':['id'],'include':[{'model':db[_0x0aa5('0x6c')],'as':_0x0aa5('0x76'),'attributes':['id',_0x0aa5('0x40'),_0x0aa5('0x77'),'voicePause',_0x0aa5('0x78')],'raw':!![]}]})[_0x0aa5('0x3b')](function(_0xd11d0d){if(_0xd11d0d){var _0x35fab5=_[_0x0aa5('0x79')](_0xd11d0d,function(_0x4c482b){var _0x164113=_0x4c482b[_0x0aa5('0x3c')]({'plain':!![]});return _0x164113[_0x0aa5('0x76')];});return db['ChatQueue'][_0x0aa5('0x5e')]({'where':{'id':_0x1fc4a5[_0x0aa5('0x5c')]['id']}})[_0x0aa5('0x3b')](function(_0x3299ea){return db[_0x0aa5('0x7a')][_0x0aa5('0x7b')](function(_0x5e4a20){return _0x3299ea['addTeams'](_0xb6f4ce,{'transaction':_0x5e4a20})[_0x0aa5('0x3b')](function(){return BPromise['each'](_0x35fab5,function(_0x5dacb9){return db[_0x0aa5('0x6a')][_0x0aa5('0x7c')]({'where':{'UserId':_0x5dacb9['id'],'ChatQueueId':_0x1fc4a5[_0x0aa5('0x5c')]['id']},'transaction':_0x5e4a20});});})[_0x0aa5('0x3b')](function(){_0x35fab5[_0x0aa5('0x7d')](function(_0x2798e7){socket[_0x0aa5('0x7e')](_0x0aa5('0x7f'),{'UserId':_0x2798e7['id'],'ChatQueueId':_0x3299ea['id']});});});});});}})[_0x0aa5('0x3b')](respondWithStatusCode(_0x285a7e,null))[_0x0aa5('0x2c')](handleError(_0x285a7e,null));};exports[_0x0aa5('0x80')]=function(_0x4d9062,_0x5c12af,_0x10fe9c){return db[_0x0aa5('0x81')][_0x0aa5('0x6b')]({'where':{'id':_0x4d9062[_0x0aa5('0x4a')][_0x0aa5('0x75')]},'attributes':['id'],'include':[{'model':db[_0x0aa5('0x6c')],'as':_0x0aa5('0x76'),'attributes':['id'],'raw':!![]}]})[_0x0aa5('0x3b')](handleEntityNotFound(_0x5c12af,null))[_0x0aa5('0x3b')](function(_0x5c194f){var _0x47ece6=_[_0x0aa5('0x43')](_0x5c194f,'id');var _0x3f55cc=[];var _0x34efa4=[];var _0x1fe3d0=squel[_0x0aa5('0x82')]();_0x1fe3d0['field'](_0x0aa5('0x83'))[_0x0aa5('0x84')](_0x0aa5('0x85'),'tq')[_0x0aa5('0x86')](_0x0aa5('0x87'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x0aa5('0x88'),_0x4d9062[_0x0aa5('0x5c')]['id']);for(var _0xa3eef1=0x0;_0xa3eef1<_0x5c194f['length'];_0xa3eef1+=0x1){let _0x18da1e=_0x5c194f[_0xa3eef1];for(var _0x594a00=0x0;_0x594a00<_0x18da1e['Agents']['length'];_0x594a00+=0x1){let _0x1c695d=_0x18da1e['Agents'][_0x594a00];var _0x75b22d=_0x1fe3d0[_0x0aa5('0x89')]();_0x75b22d['where']('ut.UserId\x20=\x20?',_0x1c695d['id']);_0x34efa4['push'](db[_0x0aa5('0x7a')][_0x0aa5('0x4a')](_0x75b22d['toString'](),{'type':db[_0x0aa5('0x7a')][_0x0aa5('0x8a')][_0x0aa5('0x8b')]})['then'](function(_0x3aa9f0){if(_0x3aa9f0[_0x0aa5('0x5d')]===0x1){return _0x1c695d['id'];}else{var _0x36b850=_[_0x0aa5('0x8c')](_[_0x0aa5('0x43')](_0x3aa9f0,_0x0aa5('0x8d')),function(_0x23212f){return _[_0x0aa5('0x8e')](_0x47ece6,_0x23212f);});if(_0x36b850){return _0x1c695d['id'];}}}));}}return BPromise['all'](_0x34efa4)[_0x0aa5('0x3b')](function(_0x596de2){_0x3f55cc=_(_0x3f55cc)['union'](_0x596de2)[_0x0aa5('0x8f')]()['value']();return db[_0x0aa5('0x44')][_0x0aa5('0x5e')]({'where':{'id':_0x4d9062['params']['id']}})[_0x0aa5('0x3b')](function(_0x388e2d){return db['sequelize'][_0x0aa5('0x7b')](function(_0x63975e){return _0x388e2d[_0x0aa5('0x80')](_0x4d9062[_0x0aa5('0x4a')][_0x0aa5('0x75')],{'transaction':_0x63975e})[_0x0aa5('0x3b')](function(){if(!_['isEmpty'](_0x3f55cc)){return _0x388e2d[_0x0aa5('0x90')](_0x3f55cc,{'transaction':_0x63975e});}})[_0x0aa5('0x3b')](function(){_0x3f55cc[_0x0aa5('0x7d')](function(_0xe40c4f){socket['emit'](_0x0aa5('0x91'),{'UserId':_0xe40c4f,'ChatQueueId':_0x388e2d['id']});});});});});});})[_0x0aa5('0x3b')](respondWithStatusCode(_0x5c12af,null))['catch'](handleError(_0x5c12af,null));};exports[_0x0aa5('0x92')]=function(_0xde012b,_0x501383,_0x1ff0e5){return db[_0x0aa5('0x44')][_0x0aa5('0x5e')]({'where':{'id':_0xde012b[_0x0aa5('0x5c')]['id']}})[_0x0aa5('0x3b')](handleEntityNotFound(_0x501383,null))['then'](function(_0x377555){if(_0x377555){return _0x377555['addAgents'](_0xde012b[_0x0aa5('0x5f')][_0x0aa5('0x75')],_[_0x0aa5('0x93')](_0xde012b[_0x0aa5('0x5f')],['ids','id'])||{})['spread'](function(_0x20c204){for(var _0xb9360c=0x0;_0xb9360c<_0xde012b['body'][_0x0aa5('0x75')][_0x0aa5('0x5d')];_0xb9360c+=0x1){socket[_0x0aa5('0x7e')](_0x0aa5('0x7f'),{'UserId':Number(_0xde012b[_0x0aa5('0x5f')][_0x0aa5('0x75')][_0xb9360c]),'ChatQueueId':Number(_0xde012b[_0x0aa5('0x5c')]['id'])});}return _0x20c204;});}})[_0x0aa5('0x3b')](respondWithResult(_0x501383,null))['catch'](handleError(_0x501383,null));};exports[_0x0aa5('0x90')]=function(_0x43520a,_0x2a1508,_0x1a9bc2){return db[_0x0aa5('0x44')]['find']({'where':{'id':_0x43520a['params']['id']}})[_0x0aa5('0x3b')](handleEntityNotFound(_0x2a1508,null))[_0x0aa5('0x3b')](function(_0xf74766){if(_0xf74766){return _0xf74766[_0x0aa5('0x90')](_0x43520a[_0x0aa5('0x4a')][_0x0aa5('0x75')])['then'](function(){if(_['isArray'](_0x43520a['query']['ids'])){for(var _0x260665=0x0;_0x260665<_0x43520a['query']['ids']['length'];_0x260665+=0x1){socket[_0x0aa5('0x7e')](_0x0aa5('0x91'),{'UserId':Number(_0x43520a[_0x0aa5('0x4a')][_0x0aa5('0x75')][_0x260665]),'ChatQueueId':Number(_0x43520a[_0x0aa5('0x5c')]['id'])});}}else{socket[_0x0aa5('0x7e')](_0x0aa5('0x91'),{'UserId':Number(_0x43520a[_0x0aa5('0x4a')][_0x0aa5('0x75')]),'ChatQueueId':Number(_0x43520a[_0x0aa5('0x5c')]['id'])});}});}})[_0x0aa5('0x3b')](respondWithStatusCode(_0x2a1508,null))[_0x0aa5('0x2c')](handleError(_0x2a1508,null));};exports[_0x0aa5('0x94')]=function(_0x28301b,_0x453b5f,_0x381456){var _0x233648={};var _0x4a9b24={};var _0x2c9a9f;var _0x2d40b8;return db['ChatQueue'][_0x0aa5('0x69')]({'where':{'id':_0x28301b['params']['id']}})[_0x0aa5('0x3b')](handleEntityNotFound(_0x453b5f,null))[_0x0aa5('0x3b')](function(_0x457cc6){if(_0x457cc6){_0x2c9a9f=_0x457cc6;_0x4a9b24[_0x0aa5('0x49')]=_[_0x0aa5('0x4b')](db[_0x0aa5('0x6c')][_0x0aa5('0x45')]);_0x4a9b24[_0x0aa5('0x4a')]=_['keys'](_0x28301b[_0x0aa5('0x4a')]);_0x4a9b24['filters']=_['intersection'](_0x4a9b24[_0x0aa5('0x49')],_0x4a9b24[_0x0aa5('0x4a')]);_0x233648[_0x0aa5('0x4d')]=_[_0x0aa5('0x4c')](_0x4a9b24['model'],qs[_0x0aa5('0x4e')](_0x28301b[_0x0aa5('0x4a')][_0x0aa5('0x4e')]));_0x233648[_0x0aa5('0x4d')]=_0x233648[_0x0aa5('0x4d')][_0x0aa5('0x5d')]?_0x233648['attributes']:_0x4a9b24[_0x0aa5('0x49')];_0x233648[_0x0aa5('0x51')]=qs[_0x0aa5('0x52')](_0x28301b[_0x0aa5('0x4a')][_0x0aa5('0x52')]);_0x233648[_0x0aa5('0x53')]=qs[_0x0aa5('0x54')](_[_0x0aa5('0x55')](_0x28301b[_0x0aa5('0x4a')],_0x4a9b24['filters']));if(_0x28301b[_0x0aa5('0x4a')][_0x0aa5('0x57')]){_0x233648[_0x0aa5('0x53')]=_['merge'](_0x233648[_0x0aa5('0x53')],{'$or':_['map'](_0x233648[_0x0aa5('0x4d')],function(_0x4c3d23){var _0x1b3416={};_0x1b3416[_0x4c3d23]={'$like':'%'+_0x28301b[_0x0aa5('0x4a')][_0x0aa5('0x57')]+'%'};return _0x1b3416;})});}_0x233648=_['merge']({},_0x233648,_0x28301b[_0x0aa5('0x58')]);return _0x2c9a9f[_0x0aa5('0x94')](_0x233648);}})[_0x0aa5('0x3b')](function(_0x531511){if(_0x531511){_0x2d40b8=_0x531511[_0x0aa5('0x5d')];if(!_0x28301b[_0x0aa5('0x4a')][_0x0aa5('0x4f')](_0x0aa5('0x50'))){_0x233648[_0x0aa5('0x33')]=qs[_0x0aa5('0x33')](_0x28301b['query']['limit']);_0x233648['offset']=qs[_0x0aa5('0x31')](_0x28301b[_0x0aa5('0x4a')][_0x0aa5('0x31')]);}return _0x2c9a9f['getAgents'](_0x233648);}})[_0x0aa5('0x3b')](function(_0xc80098){if(_0xc80098){return _0xc80098?{'count':_0x2d40b8,'rows':_0xc80098}:null;}})[_0x0aa5('0x3b')](respondWithResult(_0x453b5f,null))[_0x0aa5('0x2c')](handleError(_0x453b5f,null));}; \ No newline at end of file +var _0xbf94=['online','voicePause','interface','flatMap','sequelize','transaction','each','userChatQueue:save','removeTeams','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','toString','QueryTypes','every','TeamId','includes','all','compact','isEmpty','removeAgents','forEach','emit','userChatQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','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','defaults','redis','localhost','./chatQueue.socket','register','client','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','get','UserProfileResource','sendStatus','stack','name','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','options','includeAll','ChatQueue','rows','show','rawAttributes','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','getMembers','findOne','nolimit','ChatQueueId','merge','UserChatQueue','findAll','User','findAndCountAll','chatPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','ids','Agents'];(function(_0x3d78ca,_0xd1826f){var _0x5c4e97=function(_0x18ef38){while(--_0x18ef38){_0x3d78ca['push'](_0x3d78ca['shift']());}};_0x5c4e97(++_0xd1826f);}(_0xbf94,0xb7));var _0x4bf9=function(_0x49cb53,_0x45fd70){_0x49cb53=_0x49cb53-0x0;var _0xa326a7=_0xbf94[_0x49cb53];return _0xa326a7;};'use strict';var emlformat=require(_0x4bf9('0x0'));var rimraf=require(_0x4bf9('0x1'));var zipdir=require(_0x4bf9('0x2'));var jsonpatch=require(_0x4bf9('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4bf9('0x4'));var util=require(_0x4bf9('0x5'));var path=require(_0x4bf9('0x6'));var sox=require(_0x4bf9('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4bf9('0x8'));var _=require(_0x4bf9('0x9'));var squel=require(_0x4bf9('0xa'));var crypto=require('crypto');var jsforce=require(_0x4bf9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x4bf9('0xc'));var querystring=require('querystring');var Papa=require(_0x4bf9('0xd'));var Redis=require(_0x4bf9('0xe'));var authService=require(_0x4bf9('0xf'));var qs=require(_0x4bf9('0x10'));var as=require(_0x4bf9('0x11'));var hardwareService=require(_0x4bf9('0x12'));var logger=require(_0x4bf9('0x13'))(_0x4bf9('0x14'));var utils=require('../../config/utils');var config=require(_0x4bf9('0x15'));var licenseUtil=require(_0x4bf9('0x16'));var db=require(_0x4bf9('0x17'))['db'];config['redis']=_[_0x4bf9('0x18')](config[_0x4bf9('0x19')],{'host':_0x4bf9('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4bf9('0x1b'))[_0x4bf9('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x4bf9('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f0964,_0xa9f26d,_0x1e6b3e,_0x263521){return new BPromise(function(_0x24b673,_0x5d0364){var _0x5a5508=_0x263521||client;return _0x5a5508['request'](_0x3f0964,_0x1e6b3e)[_0x4bf9('0x1e')](function(_0x115fc2){logger['info'](_0x4bf9('0x1f'),_0xa9f26d,_0x4bf9('0x20'));logger[_0x4bf9('0x21')](_0x4bf9('0x22'),_0xa9f26d,_0x4bf9('0x20'),JSON[_0x4bf9('0x23')](_0x115fc2));if(_0x115fc2[_0x4bf9('0x24')]){if(_0x115fc2['error']['code']===0x1f4){logger[_0x4bf9('0x24')](_0x4bf9('0x1f'),_0xa9f26d,_0x115fc2[_0x4bf9('0x24')]['message']);return _0x5d0364(_0x115fc2[_0x4bf9('0x24')][_0x4bf9('0x25')]);}logger['error'](_0x4bf9('0x1f'),_0xa9f26d,_0x115fc2[_0x4bf9('0x24')]['message']);return _0x24b673(_0x115fc2['error'][_0x4bf9('0x25')]);}else{logger[_0x4bf9('0x26')](_0x4bf9('0x1f'),_0xa9f26d,'request\x20sent');_0x24b673(_0x115fc2[_0x4bf9('0x27')][_0x4bf9('0x25')]);}})[_0x4bf9('0x28')](function(_0x1cc08f){logger[_0x4bf9('0x24')](_0x4bf9('0x1f'),_0xa9f26d,_0x1cc08f);_0x5d0364(_0x1cc08f);});});}function respondWithStatusCode(_0x203db3,_0x1b3547){_0x1b3547=_0x1b3547||0xcc;return function(_0x31cedb){if(_0x31cedb){return _0x203db3['sendStatus'](_0x1b3547);}return _0x203db3[_0x4bf9('0x29')](_0x1b3547)[_0x4bf9('0x2a')]();};}function respondWithResult(_0x25875b,_0x29ee7b){_0x29ee7b=_0x29ee7b||0xc8;return function(_0x7d5718){if(_0x7d5718){return _0x25875b[_0x4bf9('0x29')](_0x29ee7b)['json'](_0x7d5718);}};}function respondWithFilteredResult(_0x2657f4,_0x3e2ba8){return function(_0x21df76){if(_0x21df76){var _0xf870a0=typeof _0x3e2ba8[_0x4bf9('0x2b')]===_0x4bf9('0x2c')&&typeof _0x3e2ba8[_0x4bf9('0x2d')]===_0x4bf9('0x2c');var _0x1ad8ce=_0x21df76[_0x4bf9('0x2e')];var _0x1222be=_0xf870a0?0x0:_0x3e2ba8[_0x4bf9('0x2b')];var _0x4e1004=_0xf870a0?_0x21df76[_0x4bf9('0x2e')]:_0x3e2ba8['offset']+_0x3e2ba8[_0x4bf9('0x2d')];var _0x48fcee;if(_0x4e1004>=_0x1ad8ce){_0x4e1004=_0x1ad8ce;_0x48fcee=0xc8;}else{_0x48fcee=0xce;}_0x2657f4[_0x4bf9('0x29')](_0x48fcee);return _0x2657f4[_0x4bf9('0x2f')](_0x4bf9('0x30'),_0x1222be+'-'+_0x4e1004+'/'+_0x1ad8ce)[_0x4bf9('0x31')](_0x21df76);}return null;};}function patchUpdates(_0x4fba7e){return function(_0x1e2fab){try{jsonpatch[_0x4bf9('0x32')](_0x1e2fab,_0x4fba7e,!![]);}catch(_0xfea041){return BPromise[_0x4bf9('0x33')](_0xfea041);}return _0x1e2fab[_0x4bf9('0x34')]();};}function saveUpdates(_0x2a176d,_0x4857b7){return function(_0x1b16f4){if(_0x1b16f4){return _0x1b16f4['update'](_0x2a176d)[_0x4bf9('0x1e')](function(_0x43c89b){return _0x43c89b;});}return null;};}function removeEntity(_0x305653,_0x39dcae){return function(_0x37c747){if(_0x37c747){return _0x37c747[_0x4bf9('0x35')]()[_0x4bf9('0x1e')](function(){var _0x4c6164=_0x37c747[_0x4bf9('0x36')]({'plain':!![]});var _0x2b51d3='ChatQueues';return db[_0x4bf9('0x37')]['destroy']({'where':{'type':_0x2b51d3,'resourceId':_0x4c6164['id']}})[_0x4bf9('0x1e')](function(){return _0x37c747;});})[_0x4bf9('0x1e')](function(){_0x305653[_0x4bf9('0x29')](0xcc)[_0x4bf9('0x2a')]();});}};}function handleEntityNotFound(_0x471842,_0xffc1ae){return function(_0x31a887){if(!_0x31a887){_0x471842[_0x4bf9('0x38')](0x194);}return _0x31a887;};}function handleError(_0x38a2da,_0x446164){_0x446164=_0x446164||0x1f4;return function(_0x49d4b9){logger['error'](_0x49d4b9[_0x4bf9('0x39')]);if(_0x49d4b9[_0x4bf9('0x3a')]){delete _0x49d4b9[_0x4bf9('0x3a')];}_0x38a2da[_0x4bf9('0x29')](_0x446164)['send'](_0x49d4b9);};}exports[_0x4bf9('0x3b')]=function(_0x5edb85,_0x210e10){var _0x358dd0={},_0x21039b={},_0x2c9b8c={'count':0x0,'rows':[]};var _0x1870e2=_[_0x4bf9('0x3c')](db['ChatQueue']['rawAttributes'],function(_0x3ce9f9){return{'name':_0x3ce9f9[_0x4bf9('0x3d')],'type':_0x3ce9f9[_0x4bf9('0x3e')][_0x4bf9('0x3f')]};});_0x21039b[_0x4bf9('0x40')]=_[_0x4bf9('0x3c')](_0x1870e2,_0x4bf9('0x3a'));_0x21039b[_0x4bf9('0x41')]=_[_0x4bf9('0x42')](_0x5edb85[_0x4bf9('0x41')]);_0x21039b[_0x4bf9('0x43')]=_[_0x4bf9('0x44')](_0x21039b[_0x4bf9('0x40')],_0x21039b[_0x4bf9('0x41')]);_0x358dd0[_0x4bf9('0x45')]=_[_0x4bf9('0x44')](_0x21039b[_0x4bf9('0x40')],qs[_0x4bf9('0x46')](_0x5edb85[_0x4bf9('0x41')][_0x4bf9('0x46')]));_0x358dd0['attributes']=_0x358dd0[_0x4bf9('0x45')]['length']?_0x358dd0[_0x4bf9('0x45')]:_0x21039b['model'];if(!_0x5edb85['query'][_0x4bf9('0x47')]('nolimit')){_0x358dd0[_0x4bf9('0x2d')]=qs[_0x4bf9('0x2d')](_0x5edb85['query'][_0x4bf9('0x2d')]);_0x358dd0[_0x4bf9('0x2b')]=qs[_0x4bf9('0x2b')](_0x5edb85[_0x4bf9('0x41')][_0x4bf9('0x2b')]);}_0x358dd0[_0x4bf9('0x48')]=qs[_0x4bf9('0x49')](_0x5edb85[_0x4bf9('0x41')][_0x4bf9('0x49')]);_0x358dd0[_0x4bf9('0x4a')]=qs[_0x4bf9('0x43')](_[_0x4bf9('0x4b')](_0x5edb85[_0x4bf9('0x41')],_0x21039b[_0x4bf9('0x43')]),_0x1870e2);if(_0x5edb85[_0x4bf9('0x41')][_0x4bf9('0x4c')]){_0x358dd0['where']=_['merge'](_0x358dd0['where'],{'$or':_[_0x4bf9('0x3c')](_0x1870e2,function(_0x44f180){if(_0x44f180['type']!=='VIRTUAL'){var _0x577d8a={};_0x577d8a[_0x44f180[_0x4bf9('0x3a')]]={'$like':'%'+_0x5edb85[_0x4bf9('0x41')][_0x4bf9('0x4c')]+'%'};return _0x577d8a;}})});}_0x358dd0=_['merge']({},_0x358dd0,_0x5edb85[_0x4bf9('0x4d')]);var _0x529952={'where':_0x358dd0[_0x4bf9('0x4a')]};return db['ChatQueue'][_0x4bf9('0x2e')](_0x529952)[_0x4bf9('0x1e')](function(_0x5e88c0){_0x2c9b8c['count']=_0x5e88c0;if(_0x5edb85[_0x4bf9('0x41')][_0x4bf9('0x4e')]){_0x358dd0['include']=[{'all':!![]}];}return db[_0x4bf9('0x4f')]['findAll'](_0x358dd0);})[_0x4bf9('0x1e')](function(_0x1fc10a){_0x2c9b8c[_0x4bf9('0x50')]=_0x1fc10a;return _0x2c9b8c;})[_0x4bf9('0x1e')](respondWithFilteredResult(_0x210e10,_0x358dd0))[_0x4bf9('0x28')](handleError(_0x210e10,null));};exports[_0x4bf9('0x51')]=function(_0x2178e5,_0x2793ea){var _0x50e22e={'raw':!![],'where':{'id':_0x2178e5['params']['id']}},_0x19a48={};_0x19a48[_0x4bf9('0x40')]=_[_0x4bf9('0x42')](db[_0x4bf9('0x4f')][_0x4bf9('0x52')]);_0x19a48[_0x4bf9('0x41')]=_[_0x4bf9('0x42')](_0x2178e5[_0x4bf9('0x41')]);_0x19a48[_0x4bf9('0x43')]=_[_0x4bf9('0x44')](_0x19a48[_0x4bf9('0x40')],_0x19a48[_0x4bf9('0x41')]);_0x50e22e[_0x4bf9('0x45')]=_[_0x4bf9('0x44')](_0x19a48[_0x4bf9('0x40')],qs[_0x4bf9('0x46')](_0x2178e5[_0x4bf9('0x41')]['fields']));_0x50e22e['attributes']=_0x50e22e[_0x4bf9('0x45')][_0x4bf9('0x53')]?_0x50e22e[_0x4bf9('0x45')]:_0x19a48['model'];if(_0x2178e5[_0x4bf9('0x41')]['includeAll']){_0x50e22e[_0x4bf9('0x54')]=[{'all':!![]}];}_0x50e22e=_['merge']({},_0x50e22e,_0x2178e5['options']);return db['ChatQueue'][_0x4bf9('0x55')](_0x50e22e)[_0x4bf9('0x1e')](handleEntityNotFound(_0x2793ea,null))[_0x4bf9('0x1e')](respondWithResult(_0x2793ea,null))[_0x4bf9('0x28')](handleError(_0x2793ea,null));};exports[_0x4bf9('0x56')]=function(_0x23ced9,_0x1ff87e){return db[_0x4bf9('0x4f')][_0x4bf9('0x56')](_0x23ced9[_0x4bf9('0x57')],{})['then'](function(_0x47a15d){var _0x7f0977=_0x23ced9[_0x4bf9('0x58')][_0x4bf9('0x36')]({'plain':!![]});if(!_0x7f0977)throw new Error(_0x4bf9('0x59'));if(_0x7f0977[_0x4bf9('0x5a')]==='user'){var _0x2d6102=_0x47a15d['get']({'plain':!![]});var _0xf80ee6='ChatQueues';return db['UserProfileSection'][_0x4bf9('0x55')]({'where':{'name':_0xf80ee6,'userProfileId':_0x7f0977[_0x4bf9('0x5b')]},'raw':!![]})[_0x4bf9('0x1e')](function(_0x36d0af){if(_0x36d0af&&_0x36d0af[_0x4bf9('0x5c')]===0x0){return db[_0x4bf9('0x37')][_0x4bf9('0x56')]({'name':_0x2d6102['name'],'resourceId':_0x2d6102['id'],'type':_0x36d0af[_0x4bf9('0x3a')],'sectionId':_0x36d0af['id']},{})['then'](function(){return _0x47a15d;});}else{return _0x47a15d;}})[_0x4bf9('0x28')](function(_0x2ec935){logger[_0x4bf9('0x24')](_0x4bf9('0x5d'),_0x2ec935);throw _0x2ec935;});}return _0x47a15d;})[_0x4bf9('0x1e')](respondWithResult(_0x1ff87e,0xc9))[_0x4bf9('0x28')](handleError(_0x1ff87e,null));};exports[_0x4bf9('0x5e')]=function(_0x362ea9,_0x3510d7){if(_0x362ea9[_0x4bf9('0x57')]['id']){delete _0x362ea9[_0x4bf9('0x57')]['id'];}return db[_0x4bf9('0x4f')][_0x4bf9('0x55')]({'where':{'id':_0x362ea9[_0x4bf9('0x5f')]['id']}})[_0x4bf9('0x1e')](handleEntityNotFound(_0x3510d7,null))['then'](saveUpdates(_0x362ea9[_0x4bf9('0x57')],null))[_0x4bf9('0x1e')](respondWithResult(_0x3510d7,null))['catch'](handleError(_0x3510d7,null));};exports[_0x4bf9('0x35')]=function(_0x183448,_0x55ffa7){return db[_0x4bf9('0x4f')][_0x4bf9('0x55')]({'where':{'id':_0x183448[_0x4bf9('0x5f')]['id']}})['then'](handleEntityNotFound(_0x55ffa7,null))[_0x4bf9('0x1e')](removeEntity(_0x55ffa7,null))[_0x4bf9('0x28')](handleError(_0x55ffa7,null));};exports[_0x4bf9('0x60')]=function(_0x2f8aac,_0x2eb376){return db[_0x4bf9('0x4f')][_0x4bf9('0x60')]()[_0x4bf9('0x1e')](respondWithResult(_0x2eb376,null))['catch'](handleError(_0x2eb376,null));};exports[_0x4bf9('0x61')]=function(_0x390789,_0x4c158a,_0x346445){var _0xe63f6b={'raw':!![],'where':{}},_0x3fbe62={},_0x2ea187;return db[_0x4bf9('0x4f')][_0x4bf9('0x62')]({'where':{'id':_0x390789[_0x4bf9('0x5f')]['id']}})[_0x4bf9('0x1e')](handleEntityNotFound(_0x4c158a,null))[_0x4bf9('0x1e')](function(_0x2891b0){if(_0x2891b0){_0x2ea187=_0x2891b0[_0x4bf9('0x36')]({'plain':!![]});_0x3fbe62['model']=_[_0x4bf9('0x42')](db['UserChatQueue'][_0x4bf9('0x52')]);_0x3fbe62[_0x4bf9('0x41')]=_[_0x4bf9('0x42')](_0x390789[_0x4bf9('0x41')]);_0x3fbe62[_0x4bf9('0x43')]=_['intersection'](_0x3fbe62[_0x4bf9('0x40')],_0x3fbe62[_0x4bf9('0x41')]);_0xe63f6b[_0x4bf9('0x45')]=_[_0x4bf9('0x44')](_0x3fbe62[_0x4bf9('0x40')],qs['fields'](_0x390789[_0x4bf9('0x41')][_0x4bf9('0x46')]));_0xe63f6b['attributes']=_0xe63f6b[_0x4bf9('0x45')][_0x4bf9('0x53')]?_0xe63f6b['attributes']:_0x3fbe62[_0x4bf9('0x40')];if(!_0x390789[_0x4bf9('0x41')]['hasOwnProperty'](_0x4bf9('0x63'))){_0xe63f6b[_0x4bf9('0x2d')]=qs['limit'](_0x390789[_0x4bf9('0x41')][_0x4bf9('0x2d')]);_0xe63f6b[_0x4bf9('0x2b')]=qs[_0x4bf9('0x2b')](_0x390789[_0x4bf9('0x41')][_0x4bf9('0x2b')]);}_0xe63f6b['order']=qs[_0x4bf9('0x49')](_0x390789[_0x4bf9('0x41')][_0x4bf9('0x49')]);_0xe63f6b[_0x4bf9('0x4a')]=qs[_0x4bf9('0x43')](_[_0x4bf9('0x4b')](_0x390789[_0x4bf9('0x41')],_0x3fbe62[_0x4bf9('0x43')]));_0xe63f6b[_0x4bf9('0x4a')][_0x4bf9('0x64')]=_0x2891b0['id'];if(_0x390789['query'][_0x4bf9('0x4c')]){_0xe63f6b[_0x4bf9('0x4a')]=_['merge'](_0xe63f6b[_0x4bf9('0x4a')],{'$or':_[_0x4bf9('0x3c')](_0xe63f6b['attributes'],function(_0x7b3b69){var _0x561180={};_0x561180[_0x7b3b69]={'$like':'%'+_0x390789['query']['filter']+'%'};return _0x561180;})});}_0xe63f6b=_[_0x4bf9('0x65')]({},_0xe63f6b,_0x390789[_0x4bf9('0x4d')]);return db[_0x4bf9('0x66')][_0x4bf9('0x67')](_0xe63f6b);}})[_0x4bf9('0x1e')](function(_0xd32ac){if(_0xd32ac){return db[_0x4bf9('0x68')][_0x4bf9('0x69')]({'where':{'id':_[_0x4bf9('0x3c')](_0xd32ac,'UserId'),'role':'agent'},'attributes':['id',_0x4bf9('0x3a'),_0x4bf9('0x6a'),_0x4bf9('0x6b'),_0x4bf9('0x6c')]});}})[_0x4bf9('0x1e')](function(_0x47efd9){if(_0x47efd9){return{'count':_0x47efd9[_0x4bf9('0x2e')],'rows':_[_0x4bf9('0x3c')](_0x47efd9[_0x4bf9('0x50')],function(_0x1355b2){return{'membername':_0x1355b2['name'],'UserId':_0x1355b2['id'],'queue_name':_0x2ea187[_0x4bf9('0x3a')],'ChatQueueId':_0x2ea187['id'],'interface':util[_0x4bf9('0x6d')](_0x4bf9('0x6e'),'SIP',_0x1355b2['name']),'penalty':0x0,'paused':_0x1355b2[_0x4bf9('0x6a')],'createdAt':_0x1355b2[_0x4bf9('0x6c')],'updatedAt':_0x1355b2[_0x4bf9('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4bf9('0x1e')](respondWithFilteredResult(_0x4c158a,_0xe63f6b))[_0x4bf9('0x28')](handleError(_0x4c158a,null));};exports[_0x4bf9('0x6f')]=function(_0x559a17,_0x4273d8,_0x35ced3){var _0x1c985a={};var _0x1d870b={};var _0x507f03;var _0x294672;return db[_0x4bf9('0x4f')][_0x4bf9('0x62')]({'where':{'id':_0x559a17['params']['id']}})[_0x4bf9('0x1e')](handleEntityNotFound(_0x4273d8,null))[_0x4bf9('0x1e')](function(_0x50e044){if(_0x50e044){_0x507f03=_0x50e044;_0x1d870b[_0x4bf9('0x40')]=_[_0x4bf9('0x42')](db[_0x4bf9('0x70')][_0x4bf9('0x52')]);_0x1d870b['query']=_[_0x4bf9('0x42')](_0x559a17[_0x4bf9('0x41')]);_0x1d870b[_0x4bf9('0x43')]=_[_0x4bf9('0x44')](_0x1d870b[_0x4bf9('0x40')],_0x1d870b[_0x4bf9('0x41')]);_0x1c985a[_0x4bf9('0x45')]=_[_0x4bf9('0x44')](_0x1d870b[_0x4bf9('0x40')],qs[_0x4bf9('0x46')](_0x559a17[_0x4bf9('0x41')]['fields']));_0x1c985a[_0x4bf9('0x45')]=_0x1c985a[_0x4bf9('0x45')]['length']?_0x1c985a[_0x4bf9('0x45')]:_0x1d870b[_0x4bf9('0x40')];_0x1c985a[_0x4bf9('0x48')]=qs[_0x4bf9('0x49')](_0x559a17['query']['sort']);_0x1c985a[_0x4bf9('0x4a')]=qs[_0x4bf9('0x43')](_[_0x4bf9('0x4b')](_0x559a17['query'],_0x1d870b[_0x4bf9('0x43')]));if(_0x559a17[_0x4bf9('0x41')]['filter']){_0x1c985a[_0x4bf9('0x4a')]=_[_0x4bf9('0x65')](_0x1c985a[_0x4bf9('0x4a')],{'$or':_[_0x4bf9('0x3c')](_0x1c985a['attributes'],function(_0x16d12d){var _0x58e715={};_0x58e715[_0x16d12d]={'$like':'%'+_0x559a17[_0x4bf9('0x41')][_0x4bf9('0x4c')]+'%'};return _0x58e715;})});}_0x1c985a=_[_0x4bf9('0x65')]({},_0x1c985a,_0x559a17[_0x4bf9('0x4d')]);return _0x507f03[_0x4bf9('0x6f')](_0x1c985a);}})[_0x4bf9('0x1e')](function(_0x3d3ed0){if(_0x3d3ed0){_0x294672=_0x3d3ed0[_0x4bf9('0x53')];if(!_0x559a17[_0x4bf9('0x41')][_0x4bf9('0x47')](_0x4bf9('0x63'))){_0x1c985a[_0x4bf9('0x2d')]=qs[_0x4bf9('0x2d')](_0x559a17[_0x4bf9('0x41')][_0x4bf9('0x2d')]);_0x1c985a[_0x4bf9('0x2b')]=qs[_0x4bf9('0x2b')](_0x559a17['query'][_0x4bf9('0x2b')]);}return _0x507f03['getTeams'](_0x1c985a);}})[_0x4bf9('0x1e')](function(_0x163214){if(_0x163214){return _0x163214?{'count':_0x294672,'rows':_0x163214}:null;}})['then'](respondWithResult(_0x4273d8,null))[_0x4bf9('0x28')](handleError(_0x4273d8,null));};exports['addTeams']=function(_0x4f8669,_0x3ce567,_0xd18895){var _0x15015a=_0x4f8669[_0x4bf9('0x57')][_0x4bf9('0x71')];return db[_0x4bf9('0x70')][_0x4bf9('0x67')]({'where':{'id':_0x15015a},'attributes':['id'],'include':[{'model':db[_0x4bf9('0x68')],'as':_0x4bf9('0x72'),'attributes':['id',_0x4bf9('0x3a'),_0x4bf9('0x73'),_0x4bf9('0x74'),_0x4bf9('0x75')],'raw':!![]}]})[_0x4bf9('0x1e')](function(_0x2f3526){if(_0x2f3526){var _0x190826=_[_0x4bf9('0x76')](_0x2f3526,function(_0x30e3cc){var _0x2bc391=_0x30e3cc[_0x4bf9('0x36')]({'plain':!![]});return _0x2bc391[_0x4bf9('0x72')];});return db[_0x4bf9('0x4f')][_0x4bf9('0x55')]({'where':{'id':_0x4f8669[_0x4bf9('0x5f')]['id']}})[_0x4bf9('0x1e')](function(_0x1705c7){return db[_0x4bf9('0x77')][_0x4bf9('0x78')](function(_0x30c171){return _0x1705c7['addTeams'](_0x15015a,{'transaction':_0x30c171})[_0x4bf9('0x1e')](function(){return BPromise[_0x4bf9('0x79')](_0x190826,function(_0x57ad3c){return db[_0x4bf9('0x66')]['findOrCreate']({'where':{'UserId':_0x57ad3c['id'],'ChatQueueId':_0x4f8669[_0x4bf9('0x5f')]['id']},'transaction':_0x30c171});});})[_0x4bf9('0x1e')](function(){_0x190826['forEach'](function(_0x479604){socket['emit'](_0x4bf9('0x7a'),{'UserId':_0x479604['id'],'ChatQueueId':_0x1705c7['id']});});});});});}})['then'](respondWithStatusCode(_0x3ce567,null))['catch'](handleError(_0x3ce567,null));};exports[_0x4bf9('0x7b')]=function(_0x337b28,_0x5d9314,_0x132ba5){return db[_0x4bf9('0x70')]['findAll']({'where':{'id':_0x337b28[_0x4bf9('0x41')]['ids']},'attributes':['id'],'include':[{'model':db[_0x4bf9('0x68')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x4bf9('0x1e')](handleEntityNotFound(_0x5d9314,null))[_0x4bf9('0x1e')](function(_0x3aab83){var _0x274653=_[_0x4bf9('0x3c')](_0x3aab83,'id');var _0xc1264d=[];var _0x4103ef=[];var _0x49e1a7=squel['select']();_0x49e1a7['field'](_0x4bf9('0x7c'))[_0x4bf9('0x7d')](_0x4bf9('0x7e'),'tq')[_0x4bf9('0x7f')](_0x4bf9('0x80'),'ut',_0x4bf9('0x81'))['where'](_0x4bf9('0x82'),_0x337b28[_0x4bf9('0x5f')]['id']);for(var _0x42625e=0x0;_0x42625e<_0x3aab83[_0x4bf9('0x53')];_0x42625e+=0x1){let _0x15bf3a=_0x3aab83[_0x42625e];for(var _0x3f45df=0x0;_0x3f45df<_0x15bf3a[_0x4bf9('0x72')][_0x4bf9('0x53')];_0x3f45df+=0x1){let _0x3f119a=_0x15bf3a[_0x4bf9('0x72')][_0x3f45df];var _0x5a0f0d=_0x49e1a7[_0x4bf9('0x83')]();_0x5a0f0d['where']('ut.UserId\x20=\x20?',_0x3f119a['id']);_0x4103ef[_0x4bf9('0x84')](db[_0x4bf9('0x77')][_0x4bf9('0x41')](_0x5a0f0d[_0x4bf9('0x85')](),{'type':db[_0x4bf9('0x77')][_0x4bf9('0x86')]['SELECT']})[_0x4bf9('0x1e')](function(_0x1da9a2){if(_0x1da9a2[_0x4bf9('0x53')]===0x1){return _0x3f119a['id'];}else{var _0x3ebfde=_[_0x4bf9('0x87')](_[_0x4bf9('0x3c')](_0x1da9a2,_0x4bf9('0x88')),function(_0xd46b11){return _[_0x4bf9('0x89')](_0x274653,_0xd46b11);});if(_0x3ebfde){return _0x3f119a['id'];}}}));}}return BPromise[_0x4bf9('0x8a')](_0x4103ef)['then'](function(_0xa561b0){_0xc1264d=_(_0xc1264d)['union'](_0xa561b0)[_0x4bf9('0x8b')]()['value']();return db['ChatQueue'][_0x4bf9('0x55')]({'where':{'id':_0x337b28[_0x4bf9('0x5f')]['id']}})[_0x4bf9('0x1e')](function(_0x1840b9){return db[_0x4bf9('0x77')][_0x4bf9('0x78')](function(_0x2bb799){return _0x1840b9[_0x4bf9('0x7b')](_0x337b28['query'][_0x4bf9('0x71')],{'transaction':_0x2bb799})[_0x4bf9('0x1e')](function(){if(!_[_0x4bf9('0x8c')](_0xc1264d)){return _0x1840b9[_0x4bf9('0x8d')](_0xc1264d,{'transaction':_0x2bb799});}})[_0x4bf9('0x1e')](function(){_0xc1264d[_0x4bf9('0x8e')](function(_0x2ccc3f){socket[_0x4bf9('0x8f')](_0x4bf9('0x90'),{'UserId':_0x2ccc3f,'ChatQueueId':_0x1840b9['id']});});});});});});})[_0x4bf9('0x1e')](respondWithStatusCode(_0x5d9314,null))[_0x4bf9('0x28')](handleError(_0x5d9314,null));};exports['addAgents']=function(_0x4a9705,_0x3cd5c9,_0x238610){return db[_0x4bf9('0x4f')][_0x4bf9('0x55')]({'where':{'id':_0x4a9705[_0x4bf9('0x5f')]['id']}})[_0x4bf9('0x1e')](handleEntityNotFound(_0x3cd5c9,null))['then'](function(_0x5ab8fd){if(_0x5ab8fd){return _0x5ab8fd[_0x4bf9('0x91')](_0x4a9705['body'][_0x4bf9('0x71')],_[_0x4bf9('0x92')](_0x4a9705[_0x4bf9('0x57')],[_0x4bf9('0x71'),'id'])||{})[_0x4bf9('0x93')](function(_0x5a2136){for(var _0x52b074=0x0;_0x52b074<_0x4a9705[_0x4bf9('0x57')][_0x4bf9('0x71')]['length'];_0x52b074+=0x1){socket[_0x4bf9('0x8f')](_0x4bf9('0x7a'),{'UserId':Number(_0x4a9705[_0x4bf9('0x57')][_0x4bf9('0x71')][_0x52b074]),'ChatQueueId':Number(_0x4a9705[_0x4bf9('0x5f')]['id'])});}return _0x5a2136;});}})[_0x4bf9('0x1e')](respondWithResult(_0x3cd5c9,null))[_0x4bf9('0x28')](handleError(_0x3cd5c9,null));};exports[_0x4bf9('0x8d')]=function(_0x45fbed,_0x55a3f4,_0x423616){return db['ChatQueue']['find']({'where':{'id':_0x45fbed[_0x4bf9('0x5f')]['id']}})[_0x4bf9('0x1e')](handleEntityNotFound(_0x55a3f4,null))['then'](function(_0x14c9b5){if(_0x14c9b5){return _0x14c9b5[_0x4bf9('0x8d')](_0x45fbed[_0x4bf9('0x41')][_0x4bf9('0x71')])[_0x4bf9('0x1e')](function(){if(_['isArray'](_0x45fbed[_0x4bf9('0x41')]['ids'])){for(var _0x48c047=0x0;_0x48c047<_0x45fbed['query'][_0x4bf9('0x71')]['length'];_0x48c047+=0x1){socket[_0x4bf9('0x8f')]('userChatQueue:remove',{'UserId':Number(_0x45fbed[_0x4bf9('0x41')][_0x4bf9('0x71')][_0x48c047]),'ChatQueueId':Number(_0x45fbed[_0x4bf9('0x5f')]['id'])});}}else{socket[_0x4bf9('0x8f')](_0x4bf9('0x90'),{'UserId':Number(_0x45fbed[_0x4bf9('0x41')]['ids']),'ChatQueueId':Number(_0x45fbed['params']['id'])});}});}})['then'](respondWithStatusCode(_0x55a3f4,null))[_0x4bf9('0x28')](handleError(_0x55a3f4,null));};exports[_0x4bf9('0x94')]=function(_0x5acc64,_0x4953cc,_0x4a21a7){var _0x18f05e={};var _0x4fc6cc={};var _0x3a75f7;var _0x31531a;return db['ChatQueue'][_0x4bf9('0x62')]({'where':{'id':_0x5acc64['params']['id']}})[_0x4bf9('0x1e')](handleEntityNotFound(_0x4953cc,null))['then'](function(_0x35f80f){if(_0x35f80f){_0x3a75f7=_0x35f80f;_0x4fc6cc['model']=_[_0x4bf9('0x42')](db[_0x4bf9('0x68')]['rawAttributes']);_0x4fc6cc[_0x4bf9('0x41')]=_[_0x4bf9('0x42')](_0x5acc64['query']);_0x4fc6cc[_0x4bf9('0x43')]=_['intersection'](_0x4fc6cc['model'],_0x4fc6cc[_0x4bf9('0x41')]);_0x18f05e[_0x4bf9('0x45')]=_[_0x4bf9('0x44')](_0x4fc6cc['model'],qs[_0x4bf9('0x46')](_0x5acc64[_0x4bf9('0x41')]['fields']));_0x18f05e[_0x4bf9('0x45')]=_0x18f05e['attributes']['length']?_0x18f05e['attributes']:_0x4fc6cc['model'];_0x18f05e[_0x4bf9('0x48')]=qs[_0x4bf9('0x49')](_0x5acc64[_0x4bf9('0x41')][_0x4bf9('0x49')]);_0x18f05e[_0x4bf9('0x4a')]=qs[_0x4bf9('0x43')](_[_0x4bf9('0x4b')](_0x5acc64[_0x4bf9('0x41')],_0x4fc6cc[_0x4bf9('0x43')]));if(_0x5acc64[_0x4bf9('0x41')]['filter']){_0x18f05e[_0x4bf9('0x4a')]=_[_0x4bf9('0x65')](_0x18f05e['where'],{'$or':_[_0x4bf9('0x3c')](_0x18f05e[_0x4bf9('0x45')],function(_0x347062){var _0x399ad7={};_0x399ad7[_0x347062]={'$like':'%'+_0x5acc64['query']['filter']+'%'};return _0x399ad7;})});}_0x18f05e=_[_0x4bf9('0x65')]({},_0x18f05e,_0x5acc64[_0x4bf9('0x4d')]);return _0x3a75f7[_0x4bf9('0x94')](_0x18f05e);}})['then'](function(_0x5d3b35){if(_0x5d3b35){_0x31531a=_0x5d3b35[_0x4bf9('0x53')];if(!_0x5acc64[_0x4bf9('0x41')]['hasOwnProperty'](_0x4bf9('0x63'))){_0x18f05e['limit']=qs[_0x4bf9('0x2d')](_0x5acc64['query'][_0x4bf9('0x2d')]);_0x18f05e['offset']=qs[_0x4bf9('0x2b')](_0x5acc64[_0x4bf9('0x41')][_0x4bf9('0x2b')]);}return _0x3a75f7['getAgents'](_0x18f05e);}})['then'](function(_0x1c0ec4){if(_0x1c0ec4){return _0x1c0ec4?{'count':_0x31531a,'rows':_0x1c0ec4}:null;}})[_0x4bf9('0x1e')](respondWithResult(_0x4953cc,null))[_0x4bf9('0x28')](handleError(_0x4953cc,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 0dffd2b..11fd17e 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 _0x5ed2=['update','remove','emit','hasOwnProperty','hook','exports','events','ChatQueue','setMaxListeners'];(function(_0x3da744,_0x478b20){var _0x39f127=function(_0x8822ef){while(--_0x8822ef){_0x3da744['push'](_0x3da744['shift']());}};_0x39f127(++_0x478b20);}(_0x5ed2,0x114));var _0x25ed=function(_0x244a5f,_0x3652c3){_0x244a5f=_0x244a5f-0x0;var _0x115943=_0x5ed2[_0x244a5f];return _0x115943;};'use strict';var EventEmitter=require(_0x25ed('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x25ed('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x25ed('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x25ed('0x3'),'afterDestroy':_0x25ed('0x4')};function emitEvent(_0x591e52){return function(_0x1ce8d8,_0x2e6fb6,_0xbebea9){ChatQueueEvents[_0x25ed('0x5')](_0x591e52+':'+_0x1ce8d8['id'],_0x1ce8d8);ChatQueueEvents['emit'](_0x591e52,_0x1ce8d8);_0xbebea9(null);};}for(var e in events){if(events[_0x25ed('0x6')](e)){var event=events[e];ChatQueue[_0x25ed('0x7')](e,emitEvent(event));}}module[_0x25ed('0x8')]=ChatQueueEvents; \ No newline at end of file +var _0xaef9=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','update'];(function(_0x1b1d28,_0x3643ae){var _0x2e6f34=function(_0xfedc35){while(--_0xfedc35){_0x1b1d28['push'](_0x1b1d28['shift']());}};_0x2e6f34(++_0x3643ae);}(_0xaef9,0x194));var _0x9aef=function(_0x465a18,_0x5f3867){_0x465a18=_0x465a18-0x0;var _0x43c605=_0xaef9[_0x465a18];return _0x43c605;};'use strict';var EventEmitter=require(_0x9aef('0x0'));var ChatQueue=require(_0x9aef('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x9aef('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9aef('0x3'),'afterDestroy':_0x9aef('0x4')};function emitEvent(_0x460c1b){return function(_0x3afe7c,_0x181bbc,_0xd9c81a){ChatQueueEvents[_0x9aef('0x5')](_0x460c1b+':'+_0x3afe7c['id'],_0x3afe7c);ChatQueueEvents[_0x9aef('0x5')](_0x460c1b,_0x3afe7c);_0xd9c81a(null);};}for(var e in events){if(events[_0x9aef('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x9aef('0x7')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 0db7ad0..67a260c 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 _0x7682=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue'];(function(_0x421446,_0x19af26){var _0x40e2a6=function(_0x254616){while(--_0x254616){_0x421446['push'](_0x421446['shift']());}};_0x40e2a6(++_0x19af26);}(_0x7682,0x1c8));var _0x2768=function(_0x1845e0,_0x312b1c){_0x1845e0=_0x1845e0-0x0;var _0x47f865=_0x7682[_0x1845e0];return _0x47f865;};'use strict';var _=require(_0x2768('0x0'));var util=require('util');var logger=require(_0x2768('0x1'))(_0x2768('0x2'));var moment=require(_0x2768('0x3'));var BPromise=require(_0x2768('0x4'));var rp=require(_0x2768('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2768('0x6'));var config=require(_0x2768('0x7'));var attributes=require(_0x2768('0x8'));module[_0x2768('0x9')]=function(_0x59464e,_0x158805){return _0x59464e[_0x2768('0xa')](_0x2768('0xb'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0631=['api','moment','bluebird','request-promise','path','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash'];(function(_0xfbdff6,_0x2af690){var _0x4cb9be=function(_0x4022d8){while(--_0x4022d8){_0xfbdff6['push'](_0xfbdff6['shift']());}};_0x4cb9be(++_0x2af690);}(_0x0631,0x128));var _0x1063=function(_0x308a1d,_0x3d379d){_0x308a1d=_0x308a1d-0x0;var _0x5eb875=_0x0631[_0x308a1d];return _0x5eb875;};'use strict';var _=require(_0x1063('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1063('0x1'));var moment=require(_0x1063('0x2'));var BPromise=require(_0x1063('0x3'));var rp=require(_0x1063('0x4'));var fs=require('fs');var path=require(_0x1063('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1063('0x6'));module[_0x1063('0x7')]=function(_0x1a8134,_0x5bc626){return _0x1a8134[_0x1063('0x8')](_0x1063('0x9'),attributes,{'tableName':_0x1063('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index 732b63e..693f693 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 _0x91ab=['code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','model','map','find','ShowChatQueue','debug','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','redis','socket.io-emitter','./chatQueue.socket','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x12ad48,_0x342b22){var _0x50087e=function(_0x43b318){while(--_0x43b318){_0x12ad48['push'](_0x12ad48['shift']());}};_0x50087e(++_0x342b22);}(_0x91ab,0x7b));var _0xb91a=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0x91ab[_0x38a7ac];return _0x53061a;};'use strict';var _=require('lodash');var util=require(_0xb91a('0x0'));var moment=require('moment');var BPromise=require(_0xb91a('0x1'));var rs=require(_0xb91a('0x2'));var fs=require('fs');var Redis=require(_0xb91a('0x3'));var db=require(_0xb91a('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb91a('0x5'));var config=require('../../config/environment');var jayson=require(_0xb91a('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0xb91a('0x7')]=_['defaults'](config[_0xb91a('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xb91a('0x8'))(new Redis(config[_0xb91a('0x7')]));require(_0xb91a('0x9'))['register'](socket);function respondWithRpcPromise(_0x239b9b,_0x362b43,_0x469e11){return new BPromise(function(_0x2146d2,_0x3828b8){return client['request'](_0x239b9b,_0x469e11)[_0xb91a('0xa')](function(_0x527a5d){logger[_0xb91a('0xb')](_0xb91a('0xc'),_0x362b43,_0xb91a('0xd'));logger['debug'](_0xb91a('0xe'),_0x362b43,_0xb91a('0xd'),JSON[_0xb91a('0xf')](_0x527a5d));if(_0x527a5d[_0xb91a('0x10')]){if(_0x527a5d[_0xb91a('0x10')][_0xb91a('0x11')]===0x1f4){logger[_0xb91a('0x10')](_0xb91a('0xc'),_0x362b43,_0x527a5d['error']['message']);return _0x3828b8(_0x527a5d[_0xb91a('0x10')][_0xb91a('0x12')]);}logger[_0xb91a('0x10')](_0xb91a('0xc'),_0x362b43,_0x527a5d[_0xb91a('0x10')]['message']);return _0x2146d2(_0x527a5d[_0xb91a('0x10')][_0xb91a('0x12')]);}else{logger[_0xb91a('0xb')]('ChatQueue,\x20%s,\x20%s',_0x362b43,_0xb91a('0xd'));_0x2146d2(_0x527a5d[_0xb91a('0x13')][_0xb91a('0x12')]);}})[_0xb91a('0x14')](function(_0x3e7b03){logger['error'](_0xb91a('0xc'),_0x362b43,_0x3e7b03);_0x3828b8(_0x3e7b03);});});}exports[_0xb91a('0x15')]=function(_0x38f1ca){var _0x32c64c=this;return new Promise(function(_0x521234,_0x5e62b6){return db[_0xb91a('0x16')][_0xb91a('0x17')]({'raw':_0x38f1ca[_0xb91a('0x18')]?_0x38f1ca['options'][_0xb91a('0x19')]===undefined?!![]:![]:!![],'where':_0x38f1ca[_0xb91a('0x18')]?_0x38f1ca[_0xb91a('0x18')][_0xb91a('0x1a')]||null:null,'attributes':_0x38f1ca[_0xb91a('0x18')]?_0x38f1ca[_0xb91a('0x18')][_0xb91a('0x1b')]||null:null,'limit':_0x38f1ca[_0xb91a('0x18')]?_0x38f1ca[_0xb91a('0x18')][_0xb91a('0x1c')]||null:null,'include':_0x38f1ca[_0xb91a('0x18')]?_0x38f1ca['options'][_0xb91a('0x1d')]?_['map'](_0x38f1ca[_0xb91a('0x18')][_0xb91a('0x1d')],function(_0x3520af){return{'model':db[_0x3520af[_0xb91a('0x1e')]],'as':_0x3520af['as'],'attributes':_0x3520af[_0xb91a('0x1b')],'include':_0x3520af[_0xb91a('0x1d')]?_[_0xb91a('0x1f')](_0x3520af[_0xb91a('0x1d')],function(_0x374a4b){return{'model':db[_0x374a4b[_0xb91a('0x1e')]],'as':_0x374a4b['as'],'attributes':_0x374a4b[_0xb91a('0x1b')],'include':_0x374a4b[_0xb91a('0x1d')]?_[_0xb91a('0x1f')](_0x374a4b[_0xb91a('0x1d')],function(_0x2570ac){return{'model':db[_0x2570ac[_0xb91a('0x1e')]],'as':_0x2570ac['as'],'attributes':_0x2570ac[_0xb91a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb91a('0xa')](function(_0x2f60ca){logger[_0xb91a('0xb')](_0xb91a('0x15'),_0x38f1ca);logger['debug'](_0xb91a('0x15'),_0x38f1ca,JSON[_0xb91a('0xf')](_0x2f60ca));_0x521234(_0x2f60ca);})[_0xb91a('0x14')](function(_0x4c492a){logger[_0xb91a('0x10')](_0xb91a('0x15'),_0x4c492a[_0xb91a('0x12')],_0x38f1ca);_0x5e62b6(_0x32c64c[_0xb91a('0x10')](0x1f4,_0x4c492a[_0xb91a('0x12')]));});});};exports['ShowChatQueue']=function(_0x4e89fb){var _0x4128bd=this;return new Promise(function(_0x39d5c4,_0x3a463e){return db['ChatQueue'][_0xb91a('0x20')]({'raw':_0x4e89fb[_0xb91a('0x18')]?_0x4e89fb['options'][_0xb91a('0x19')]===undefined?!![]:![]:!![],'where':_0x4e89fb[_0xb91a('0x18')]?_0x4e89fb['options']['where']||null:null,'attributes':_0x4e89fb[_0xb91a('0x18')]?_0x4e89fb[_0xb91a('0x18')]['attributes']||null:null,'include':_0x4e89fb[_0xb91a('0x18')]?_0x4e89fb[_0xb91a('0x18')]['include']?_[_0xb91a('0x1f')](_0x4e89fb[_0xb91a('0x18')][_0xb91a('0x1d')],function(_0x582006){return{'model':db[_0x582006['model']],'as':_0x582006['as'],'attributes':_0x582006[_0xb91a('0x1b')],'include':_0x582006[_0xb91a('0x1d')]?_[_0xb91a('0x1f')](_0x582006[_0xb91a('0x1d')],function(_0x2ed40f){return{'model':db[_0x2ed40f[_0xb91a('0x1e')]],'as':_0x2ed40f['as'],'attributes':_0x2ed40f['attributes'],'include':_0x2ed40f[_0xb91a('0x1d')]?_[_0xb91a('0x1f')](_0x2ed40f['include'],function(_0x4a135c){return{'model':db[_0x4a135c[_0xb91a('0x1e')]],'as':_0x4a135c['as'],'attributes':_0x4a135c[_0xb91a('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d5c39){logger[_0xb91a('0xb')](_0xb91a('0x21'),_0x4e89fb);logger[_0xb91a('0x22')](_0xb91a('0x21'),_0x4e89fb,JSON[_0xb91a('0xf')](_0x2d5c39));_0x39d5c4(_0x2d5c39);})['catch'](function(_0x2466bf){logger['error'](_0xb91a('0x21'),_0x2466bf[_0xb91a('0x12')],_0x4e89fb);_0x3a463e(_0x4128bd[_0xb91a('0x10')](0x1f4,_0x2466bf[_0xb91a('0x12')]));});});}; \ No newline at end of file +var _0xa79a=['raw','where','attributes','limit','include','map','model','then','debug','find','ShowChatQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetChatQueue','ChatQueue','findAll','options'];(function(_0x5d4df5,_0x17e12a){var _0x5f033d=function(_0x387d0a){while(--_0x387d0a){_0x5d4df5['push'](_0x5d4df5['shift']());}};_0x5f033d(++_0x17e12a);}(_0xa79a,0x1df));var _0xaa79=function(_0x6923ea,_0x4b5785){_0x6923ea=_0x6923ea-0x0;var _0x37b5d1=_0xa79a[_0x6923ea];return _0x37b5d1;};'use strict';var _=require(_0xaa79('0x0'));var util=require(_0xaa79('0x1'));var moment=require(_0xaa79('0x2'));var BPromise=require(_0xaa79('0x3'));var rs=require(_0xaa79('0x4'));var fs=require('fs');var Redis=require(_0xaa79('0x5'));var db=require(_0xaa79('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xaa79('0x7'))(_0xaa79('0x8'));var config=require(_0xaa79('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xaa79('0xa')]=_[_0xaa79('0xb')](config[_0xaa79('0xa')],{'host':_0xaa79('0xc'),'port':0x18eb});var socket=require(_0xaa79('0xd'))(new Redis(config[_0xaa79('0xa')]));require(_0xaa79('0xe'))[_0xaa79('0xf')](socket);function respondWithRpcPromise(_0x5b1e44,_0x3f7ac2,_0x4dfea7){return new BPromise(function(_0x1aacca,_0x5ec753){return client['request'](_0x5b1e44,_0x4dfea7)['then'](function(_0x3065b1){logger[_0xaa79('0x10')](_0xaa79('0x11'),_0x3f7ac2,_0xaa79('0x12'));logger['debug'](_0xaa79('0x13'),_0x3f7ac2,'request\x20sent',JSON[_0xaa79('0x14')](_0x3065b1));if(_0x3065b1[_0xaa79('0x15')]){if(_0x3065b1[_0xaa79('0x15')]['code']===0x1f4){logger[_0xaa79('0x15')]('ChatQueue,\x20%s,\x20%s',_0x3f7ac2,_0x3065b1[_0xaa79('0x15')][_0xaa79('0x16')]);return _0x5ec753(_0x3065b1['error'][_0xaa79('0x16')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x3f7ac2,_0x3065b1[_0xaa79('0x15')][_0xaa79('0x16')]);return _0x1aacca(_0x3065b1[_0xaa79('0x15')][_0xaa79('0x16')]);}else{logger[_0xaa79('0x10')]('ChatQueue,\x20%s,\x20%s',_0x3f7ac2,_0xaa79('0x12'));_0x1aacca(_0x3065b1['result']['message']);}})[_0xaa79('0x17')](function(_0x306f1d){logger['error']('ChatQueue,\x20%s,\x20%s',_0x3f7ac2,_0x306f1d);_0x5ec753(_0x306f1d);});});}exports[_0xaa79('0x18')]=function(_0x363fb8){var _0x2c579e=this;return new Promise(function(_0x18f321,_0x105fec){return db[_0xaa79('0x19')][_0xaa79('0x1a')]({'raw':_0x363fb8[_0xaa79('0x1b')]?_0x363fb8['options'][_0xaa79('0x1c')]===undefined?!![]:![]:!![],'where':_0x363fb8[_0xaa79('0x1b')]?_0x363fb8['options'][_0xaa79('0x1d')]||null:null,'attributes':_0x363fb8[_0xaa79('0x1b')]?_0x363fb8[_0xaa79('0x1b')][_0xaa79('0x1e')]||null:null,'limit':_0x363fb8[_0xaa79('0x1b')]?_0x363fb8[_0xaa79('0x1b')][_0xaa79('0x1f')]||null:null,'include':_0x363fb8['options']?_0x363fb8['options'][_0xaa79('0x20')]?_[_0xaa79('0x21')](_0x363fb8[_0xaa79('0x1b')][_0xaa79('0x20')],function(_0x47cb92){return{'model':db[_0x47cb92[_0xaa79('0x22')]],'as':_0x47cb92['as'],'attributes':_0x47cb92[_0xaa79('0x1e')],'include':_0x47cb92['include']?_[_0xaa79('0x21')](_0x47cb92[_0xaa79('0x20')],function(_0x479f96){return{'model':db[_0x479f96[_0xaa79('0x22')]],'as':_0x479f96['as'],'attributes':_0x479f96[_0xaa79('0x1e')],'include':_0x479f96[_0xaa79('0x20')]?_[_0xaa79('0x21')](_0x479f96['include'],function(_0x2bf2d9){return{'model':db[_0x2bf2d9[_0xaa79('0x22')]],'as':_0x2bf2d9['as'],'attributes':_0x2bf2d9[_0xaa79('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xaa79('0x23')](function(_0x4784d3){logger[_0xaa79('0x10')]('GetChatQueue',_0x363fb8);logger[_0xaa79('0x24')](_0xaa79('0x18'),_0x363fb8,JSON[_0xaa79('0x14')](_0x4784d3));_0x18f321(_0x4784d3);})[_0xaa79('0x17')](function(_0x3fba96){logger['error'](_0xaa79('0x18'),_0x3fba96[_0xaa79('0x16')],_0x363fb8);_0x105fec(_0x2c579e[_0xaa79('0x15')](0x1f4,_0x3fba96['message']));});});};exports['ShowChatQueue']=function(_0xf49fb5){var _0x7399d7=this;return new Promise(function(_0x27eb58,_0x39dac0){return db[_0xaa79('0x19')][_0xaa79('0x25')]({'raw':_0xf49fb5[_0xaa79('0x1b')]?_0xf49fb5[_0xaa79('0x1b')][_0xaa79('0x1c')]===undefined?!![]:![]:!![],'where':_0xf49fb5[_0xaa79('0x1b')]?_0xf49fb5[_0xaa79('0x1b')]['where']||null:null,'attributes':_0xf49fb5[_0xaa79('0x1b')]?_0xf49fb5[_0xaa79('0x1b')][_0xaa79('0x1e')]||null:null,'include':_0xf49fb5[_0xaa79('0x1b')]?_0xf49fb5[_0xaa79('0x1b')][_0xaa79('0x20')]?_[_0xaa79('0x21')](_0xf49fb5[_0xaa79('0x1b')]['include'],function(_0x581b2a){return{'model':db[_0x581b2a[_0xaa79('0x22')]],'as':_0x581b2a['as'],'attributes':_0x581b2a[_0xaa79('0x1e')],'include':_0x581b2a[_0xaa79('0x20')]?_['map'](_0x581b2a[_0xaa79('0x20')],function(_0x40e8ed){return{'model':db[_0x40e8ed[_0xaa79('0x22')]],'as':_0x40e8ed['as'],'attributes':_0x40e8ed['attributes'],'include':_0x40e8ed['include']?_[_0xaa79('0x21')](_0x40e8ed['include'],function(_0x1ef57b){return{'model':db[_0x1ef57b[_0xaa79('0x22')]],'as':_0x1ef57b['as'],'attributes':_0x1ef57b[_0xaa79('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xaa79('0x23')](function(_0x25da8b){logger['info']('ShowChatQueue',_0xf49fb5);logger[_0xaa79('0x24')]('ShowChatQueue',_0xf49fb5,JSON[_0xaa79('0x14')](_0x25da8b));_0x27eb58(_0x25da8b);})[_0xaa79('0x17')](function(_0x275176){logger['error'](_0xaa79('0x26'),_0x275176[_0xaa79('0x16')],_0xf49fb5);_0x39dac0(_0x7399d7[_0xaa79('0x15')](0x1f4,_0x275176['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 879da1d..9edbca5 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 _0x80d9=['./chatQueue.events','remove','update','emit','removeListener','chatQueue:'];(function(_0x2d29e4,_0xfcc7c0){var _0x3944de=function(_0x257c54){while(--_0x257c54){_0x2d29e4['push'](_0x2d29e4['shift']());}};_0x3944de(++_0xfcc7c0);}(_0x80d9,0x15c));var _0x980d=function(_0x15f4f5,_0x402223){_0x15f4f5=_0x15f4f5-0x0;var _0x5c0462=_0x80d9[_0x15f4f5];return _0x5c0462;};'use strict';var ChatQueueEvents=require(_0x980d('0x0'));var events=['save',_0x980d('0x1'),_0x980d('0x2')];function createListener(_0xac96e5,_0x5d4b87){return function(_0x358d0a){_0x5d4b87[_0x980d('0x3')](_0xac96e5,_0x358d0a);};}function removeListener(_0x38d1b9,_0x279d93){return function(){ChatQueueEvents[_0x980d('0x4')](_0x38d1b9,_0x279d93);};}exports['register']=function(_0x4c3533){for(var _0x2fd4b9=0x0,_0x50854e=events['length'];_0x2fd4b9<_0x50854e;_0x2fd4b9++){var _0x7e96f7=events[_0x2fd4b9];var _0x758fc3=createListener(_0x980d('0x5')+_0x7e96f7,_0x4c3533);ChatQueueEvents['on'](_0x7e96f7,_0x758fc3);}}; \ No newline at end of file +var _0x4b84=['./chatQueue.events','save','emit','length'];(function(_0x5293b7,_0x63b44){var _0x4bacff=function(_0x2930fe){while(--_0x2930fe){_0x5293b7['push'](_0x5293b7['shift']());}};_0x4bacff(++_0x63b44);}(_0x4b84,0x1cc));var _0x44b8=function(_0x22c684,_0x753309){_0x22c684=_0x22c684-0x0;var _0x39fcbb=_0x4b84[_0x22c684];return _0x39fcbb;};'use strict';var ChatQueueEvents=require(_0x44b8('0x0'));var events=[_0x44b8('0x1'),'remove','update'];function createListener(_0x765943,_0x519db3){return function(_0x4b8ad8){_0x519db3[_0x44b8('0x2')](_0x765943,_0x4b8ad8);};}function removeListener(_0x31282a,_0x39ad16){return function(){ChatQueueEvents['removeListener'](_0x31282a,_0x39ad16);};}exports['register']=function(_0x55f25d){for(var _0x996a8b=0x0,_0x54274b=events[_0x44b8('0x3')];_0x996a8b<_0x54274b;_0x996a8b++){var _0x5947f7=events[_0x996a8b];var _0x3e87c5=createListener('chatQueue:'+_0x5947f7,_0x55f25d);ChatQueueEvents['on'](_0x5947f7,_0x3e87c5);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index d3aafd7..5a35f25 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 _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x253daf,_0x70a529){var _0x3dadaf=function(_0x3855b5){while(--_0x3855b5){_0x253daf['push'](_0x253daf['shift']());}};_0x3dadaf(++_0x70a529);}(_0x7217,0x19e));var _0x7721=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0x7217[_0x3a6efd];return _0x487b9a;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x4bf4d5,_0x56efd2){var _0x4cc49d=function(_0x686d07){while(--_0x686d07){_0x4bf4d5['push'](_0x4bf4d5['shift']());}};_0x4cc49d(++_0x56efd2);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 16d720d..695dc7d 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 _0x4bea=['DATE','moment','sequelize','exports','STRING'];(function(_0x1801e7,_0x140713){var _0x3a449b=function(_0x14739a){while(--_0x14739a){_0x1801e7['push'](_0x1801e7['shift']());}};_0x3a449b(++_0x140713);}(_0x4bea,0x128));var _0xa4be=function(_0x38162f,_0x1558f2){_0x38162f=_0x38162f-0x0;var _0xad645a=_0x4bea[_0x38162f];return _0xad645a;};'use strict';var moment=require(_0xa4be('0x0'));var Sequelize=require(_0xa4be('0x1'));module[_0xa4be('0x2')]={'uniqueid':{'type':Sequelize[_0xa4be('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xa4be('0x3')]},'joinAt':{'type':Sequelize[_0xa4be('0x4')]},'leaveAt':{'type':Sequelize[_0xa4be('0x4')]},'acceptAt':{'type':Sequelize[_0xa4be('0x4')]},'exitAt':{'type':Sequelize[_0xa4be('0x4')]},'reason':{'type':Sequelize[_0xa4be('0x3')]}}; \ No newline at end of file +var _0x1c28=['exports','STRING','DATE','sequelize'];(function(_0x153648,_0x1bf468){var _0x3390d1=function(_0x514397){while(--_0x514397){_0x153648['push'](_0x153648['shift']());}};_0x3390d1(++_0x1bf468);}(_0x1c28,0xfb));var _0x81c2=function(_0x224366,_0x403688){_0x224366=_0x224366-0x0;var _0x4de6d8=_0x1c28[_0x224366];return _0x4de6d8;};'use strict';var moment=require('moment');var Sequelize=require(_0x81c2('0x0'));module[_0x81c2('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x81c2('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x81c2('0x3')]},'acceptAt':{'type':Sequelize[_0x81c2('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x81c2('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 1d6fc3d..70a6b32 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 _0xd9ce=['nolimit','order','sort','where','pick','merge','includeAll','include','rows','rawAttributes','find','create','body','catch','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','reject','save','update','then','error','stack','name','send','index','map','ChatQueueReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty'];(function(_0x3c34ee,_0x3496a2){var _0x5e61db=function(_0x4712f8){while(--_0x4712f8){_0x3c34ee['push'](_0x3c34ee['shift']());}};_0x5e61db(++_0x3496a2);}(_0xd9ce,0xeb));var _0xed9c=function(_0x573a27,_0x26d295){_0x573a27=_0x573a27-0x0;var _0x49f7c0=_0xd9ce[_0x573a27];return _0x49f7c0;};'use strict';var emlformat=require(_0xed9c('0x0'));var rimraf=require(_0xed9c('0x1'));var zipdir=require(_0xed9c('0x2'));var jsonpatch=require(_0xed9c('0x3'));var rp=require(_0xed9c('0x4'));var moment=require(_0xed9c('0x5'));var BPromise=require(_0xed9c('0x6'));var Mustache=require(_0xed9c('0x7'));var util=require('util');var path=require(_0xed9c('0x8'));var sox=require(_0xed9c('0x9'));var csv=require(_0xed9c('0xa'));var ejs=require(_0xed9c('0xb'));var fs=require('fs');var fs_extra=require(_0xed9c('0xc'));var _=require(_0xed9c('0xd'));var squel=require('squel');var crypto=require(_0xed9c('0xe'));var jsforce=require(_0xed9c('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xed9c('0x10'));var Papa=require('papaparse');var Redis=require(_0xed9c('0x11'));var authService=require(_0xed9c('0x12'));var qs=require(_0xed9c('0x13'));var as=require(_0xed9c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xed9c('0x15'))(_0xed9c('0x16'));var utils=require(_0xed9c('0x17'));var config=require(_0xed9c('0x18'));var licenseUtil=require(_0xed9c('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52be22,_0x88a8f9){_0x88a8f9=_0x88a8f9||0xcc;return function(_0x2153be){if(_0x2153be){return _0x52be22[_0xed9c('0x1a')](_0x88a8f9);}return _0x52be22[_0xed9c('0x1b')](_0x88a8f9)['end']();};}function respondWithResult(_0x5a5d8d,_0x99a5ee){_0x99a5ee=_0x99a5ee||0xc8;return function(_0x50a934){if(_0x50a934){return _0x5a5d8d[_0xed9c('0x1b')](_0x99a5ee)[_0xed9c('0x1c')](_0x50a934);}};}function respondWithFilteredResult(_0x95f79,_0x3fd63e){return function(_0x737656){if(_0x737656){var _0x22a28d=typeof _0x3fd63e[_0xed9c('0x1d')]==='undefined'&&typeof _0x3fd63e[_0xed9c('0x1e')]===_0xed9c('0x1f');var _0x2d45d9=_0x737656['count'];var _0x485029=_0x22a28d?0x0:_0x3fd63e[_0xed9c('0x1d')];var _0x48b7b4=_0x22a28d?_0x737656[_0xed9c('0x20')]:_0x3fd63e[_0xed9c('0x1d')]+_0x3fd63e[_0xed9c('0x1e')];var _0x2d432e;if(_0x48b7b4>=_0x2d45d9){_0x48b7b4=_0x2d45d9;_0x2d432e=0xc8;}else{_0x2d432e=0xce;}_0x95f79[_0xed9c('0x1b')](_0x2d432e);return _0x95f79[_0xed9c('0x21')]('Content-Range',_0x485029+'-'+_0x48b7b4+'/'+_0x2d45d9)[_0xed9c('0x1c')](_0x737656);}return null;};}function patchUpdates(_0x32c67e){return function(_0x45dc96){try{jsonpatch['apply'](_0x45dc96,_0x32c67e,!![]);}catch(_0x129c5f){return BPromise[_0xed9c('0x22')](_0x129c5f);}return _0x45dc96[_0xed9c('0x23')]();};}function saveUpdates(_0xd5bac1,_0x55ef58){return function(_0x538a70){if(_0x538a70){return _0x538a70[_0xed9c('0x24')](_0xd5bac1)[_0xed9c('0x25')](function(_0xc7a92a){return _0xc7a92a;});}return null;};}function removeEntity(_0x2ae3ce,_0x1fd75d){return function(_0x340c6){if(_0x340c6){return _0x340c6['destroy']()[_0xed9c('0x25')](function(){_0x2ae3ce['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x495055,_0x4855b0){return function(_0xc02cd5){if(!_0xc02cd5){_0x495055[_0xed9c('0x1a')](0x194);}return _0xc02cd5;};}function handleError(_0x1536b3,_0x4f1a3f){_0x4f1a3f=_0x4f1a3f||0x1f4;return function(_0x2a1fac){logger[_0xed9c('0x26')](_0x2a1fac[_0xed9c('0x27')]);if(_0x2a1fac['name']){delete _0x2a1fac[_0xed9c('0x28')];}_0x1536b3[_0xed9c('0x1b')](_0x4f1a3f)[_0xed9c('0x29')](_0x2a1fac);};}exports[_0xed9c('0x2a')]=function(_0x548eab,_0x15d6e7){var _0x48dae4={},_0x42c134={},_0x438a31={'count':0x0,'rows':[]};var _0x16c27c=_[_0xed9c('0x2b')](db[_0xed9c('0x2c')]['rawAttributes'],function(_0x55d27e){return{'name':_0x55d27e[_0xed9c('0x2d')],'type':_0x55d27e[_0xed9c('0x2e')][_0xed9c('0x2f')]};});_0x42c134[_0xed9c('0x30')]=_['map'](_0x16c27c,_0xed9c('0x28'));_0x42c134[_0xed9c('0x31')]=_[_0xed9c('0x32')](_0x548eab[_0xed9c('0x31')]);_0x42c134[_0xed9c('0x33')]=_['intersection'](_0x42c134[_0xed9c('0x30')],_0x42c134['query']);_0x48dae4[_0xed9c('0x34')]=_[_0xed9c('0x35')](_0x42c134[_0xed9c('0x30')],qs[_0xed9c('0x36')](_0x548eab[_0xed9c('0x31')][_0xed9c('0x36')]));_0x48dae4[_0xed9c('0x34')]=_0x48dae4[_0xed9c('0x34')][_0xed9c('0x37')]?_0x48dae4[_0xed9c('0x34')]:_0x42c134[_0xed9c('0x30')];if(!_0x548eab[_0xed9c('0x31')][_0xed9c('0x38')](_0xed9c('0x39'))){_0x48dae4[_0xed9c('0x1e')]=qs[_0xed9c('0x1e')](_0x548eab['query'][_0xed9c('0x1e')]);_0x48dae4[_0xed9c('0x1d')]=qs[_0xed9c('0x1d')](_0x548eab[_0xed9c('0x31')]['offset']);}_0x48dae4[_0xed9c('0x3a')]=qs[_0xed9c('0x3b')](_0x548eab[_0xed9c('0x31')][_0xed9c('0x3b')]);_0x48dae4[_0xed9c('0x3c')]=qs[_0xed9c('0x33')](_[_0xed9c('0x3d')](_0x548eab[_0xed9c('0x31')],_0x42c134[_0xed9c('0x33')]),_0x16c27c);if(_0x548eab[_0xed9c('0x31')]['filter']){_0x48dae4['where']=_[_0xed9c('0x3e')](_0x48dae4[_0xed9c('0x3c')],{'$or':_[_0xed9c('0x2b')](_0x16c27c,function(_0x503b02){if(_0x503b02[_0xed9c('0x2e')]!=='VIRTUAL'){var _0x4ee934={};_0x4ee934[_0x503b02[_0xed9c('0x28')]]={'$like':'%'+_0x548eab['query']['filter']+'%'};return _0x4ee934;}})});}_0x48dae4=_[_0xed9c('0x3e')]({},_0x48dae4,_0x548eab['options']);var _0x2aef00={'where':_0x48dae4['where']};return db[_0xed9c('0x2c')]['count'](_0x2aef00)[_0xed9c('0x25')](function(_0x19e151){_0x438a31[_0xed9c('0x20')]=_0x19e151;if(_0x548eab[_0xed9c('0x31')][_0xed9c('0x3f')]){_0x48dae4[_0xed9c('0x40')]=[{'all':!![]}];}return db[_0xed9c('0x2c')]['findAll'](_0x48dae4);})[_0xed9c('0x25')](function(_0x18918f){_0x438a31[_0xed9c('0x41')]=_0x18918f;return _0x438a31;})['then'](respondWithFilteredResult(_0x15d6e7,_0x48dae4))['catch'](handleError(_0x15d6e7,null));};exports['show']=function(_0x4f07f5,_0x1c6188){var _0x46cde2={'raw':!![],'where':{'id':_0x4f07f5['params']['id']}},_0x30894d={};_0x30894d['model']=_[_0xed9c('0x32')](db[_0xed9c('0x2c')][_0xed9c('0x42')]);_0x30894d[_0xed9c('0x31')]=_[_0xed9c('0x32')](_0x4f07f5[_0xed9c('0x31')]);_0x30894d[_0xed9c('0x33')]=_[_0xed9c('0x35')](_0x30894d[_0xed9c('0x30')],_0x30894d[_0xed9c('0x31')]);_0x46cde2[_0xed9c('0x34')]=_[_0xed9c('0x35')](_0x30894d[_0xed9c('0x30')],qs['fields'](_0x4f07f5['query']['fields']));_0x46cde2['attributes']=_0x46cde2[_0xed9c('0x34')][_0xed9c('0x37')]?_0x46cde2[_0xed9c('0x34')]:_0x30894d[_0xed9c('0x30')];if(_0x4f07f5[_0xed9c('0x31')][_0xed9c('0x3f')]){_0x46cde2[_0xed9c('0x40')]=[{'all':!![]}];}_0x46cde2=_['merge']({},_0x46cde2,_0x4f07f5['options']);return db[_0xed9c('0x2c')][_0xed9c('0x43')](_0x46cde2)['then'](handleEntityNotFound(_0x1c6188,null))[_0xed9c('0x25')](respondWithResult(_0x1c6188,null))['catch'](handleError(_0x1c6188,null));};exports[_0xed9c('0x44')]=function(_0x39d420,_0xbb0ef6){return db[_0xed9c('0x2c')]['create'](_0x39d420[_0xed9c('0x45')],{})[_0xed9c('0x25')](respondWithResult(_0xbb0ef6,0xc9))[_0xed9c('0x46')](handleError(_0xbb0ef6,null));};exports[_0xed9c('0x24')]=function(_0x4b488e,_0x108c46){if(_0x4b488e['body']['id']){delete _0x4b488e['body']['id'];}return db[_0xed9c('0x2c')][_0xed9c('0x43')]({'where':{'id':_0x4b488e['params']['id']}})[_0xed9c('0x25')](handleEntityNotFound(_0x108c46,null))[_0xed9c('0x25')](saveUpdates(_0x4b488e['body'],null))[_0xed9c('0x25')](respondWithResult(_0x108c46,null))[_0xed9c('0x46')](handleError(_0x108c46,null));};exports['destroy']=function(_0x4f304a,_0x22033a){return db[_0xed9c('0x2c')][_0xed9c('0x43')]({'where':{'id':_0x4f304a[_0xed9c('0x47')]['id']}})[_0xed9c('0x25')](handleEntityNotFound(_0x22033a,null))[_0xed9c('0x25')](removeEntity(_0x22033a,null))[_0xed9c('0x46')](handleError(_0x22033a,null));};exports[_0xed9c('0x48')]=function(_0x4d0374,_0xd7ec75){return db['ChatQueueReport'][_0xed9c('0x48')]()['then'](respondWithResult(_0xd7ec75,null))['catch'](handleError(_0xd7ec75,null));}; \ No newline at end of file +var _0x374c=['../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','status','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit','order','where','pick','filter','merge','VIRTUAL','ChatQueueReport','includeAll','include','findAll','show','params','options','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x374c,0x1e3));var _0xc374=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x374c[_0x2a6809];return _0x11c371;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc374('0x0'));var zipdir=require(_0xc374('0x1'));var jsonpatch=require(_0xc374('0x2'));var rp=require(_0xc374('0x3'));var moment=require(_0xc374('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc374('0x5'));var util=require('util');var path=require(_0xc374('0x6'));var sox=require(_0xc374('0x7'));var csv=require('to-csv');var ejs=require(_0xc374('0x8'));var fs=require('fs');var fs_extra=require(_0xc374('0x9'));var _=require(_0xc374('0xa'));var squel=require(_0xc374('0xb'));var crypto=require(_0xc374('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc374('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc374('0xe'));var Redis=require(_0xc374('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc374('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc374('0x11'));var logger=require(_0xc374('0x12'))(_0xc374('0x13'));var utils=require('../../config/utils');var config=require(_0xc374('0x14'));var licenseUtil=require(_0xc374('0x15'));var db=require(_0xc374('0x16'))['db'];function respondWithStatusCode(_0x5e0f82,_0x44eba3){_0x44eba3=_0x44eba3||0xcc;return function(_0x30bde){if(_0x30bde){return _0x5e0f82[_0xc374('0x17')](_0x44eba3);}return _0x5e0f82['status'](_0x44eba3)[_0xc374('0x18')]();};}function respondWithResult(_0x47a7bf,_0xae92ab){_0xae92ab=_0xae92ab||0xc8;return function(_0x1f472b){if(_0x1f472b){return _0x47a7bf['status'](_0xae92ab)[_0xc374('0x19')](_0x1f472b);}};}function respondWithFilteredResult(_0x3f868a,_0x4109ec){return function(_0x198919){if(_0x198919){var _0x1178a1=typeof _0x4109ec[_0xc374('0x1a')]===_0xc374('0x1b')&&typeof _0x4109ec[_0xc374('0x1c')]===_0xc374('0x1b');var _0x1c3784=_0x198919[_0xc374('0x1d')];var _0x5957c5=_0x1178a1?0x0:_0x4109ec[_0xc374('0x1a')];var _0x3553bb=_0x1178a1?_0x198919[_0xc374('0x1d')]:_0x4109ec['offset']+_0x4109ec[_0xc374('0x1c')];var _0x16c7de;if(_0x3553bb>=_0x1c3784){_0x3553bb=_0x1c3784;_0x16c7de=0xc8;}else{_0x16c7de=0xce;}_0x3f868a['status'](_0x16c7de);return _0x3f868a['set'](_0xc374('0x1e'),_0x5957c5+'-'+_0x3553bb+'/'+_0x1c3784)[_0xc374('0x19')](_0x198919);}return null;};}function patchUpdates(_0x4110bf){return function(_0x2beb98){try{jsonpatch['apply'](_0x2beb98,_0x4110bf,!![]);}catch(_0xa65465){return BPromise[_0xc374('0x1f')](_0xa65465);}return _0x2beb98[_0xc374('0x20')]();};}function saveUpdates(_0x16959d,_0x3cbbad){return function(_0x33c61d){if(_0x33c61d){return _0x33c61d[_0xc374('0x21')](_0x16959d)[_0xc374('0x22')](function(_0x2b7fa6){return _0x2b7fa6;});}return null;};}function removeEntity(_0x18699e,_0x4110a5){return function(_0x5b92c6){if(_0x5b92c6){return _0x5b92c6[_0xc374('0x23')]()[_0xc374('0x22')](function(){_0x18699e[_0xc374('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x460fe1,_0x3d4fb3){return function(_0x19c668){if(!_0x19c668){_0x460fe1[_0xc374('0x17')](0x194);}return _0x19c668;};}function handleError(_0x52d69c,_0x5c6d3e){_0x5c6d3e=_0x5c6d3e||0x1f4;return function(_0x4ad849){logger[_0xc374('0x25')](_0x4ad849[_0xc374('0x26')]);if(_0x4ad849[_0xc374('0x27')]){delete _0x4ad849['name'];}_0x52d69c[_0xc374('0x24')](_0x5c6d3e)['send'](_0x4ad849);};}exports[_0xc374('0x28')]=function(_0xbd1d3d,_0x434c44){var _0x31ae09={},_0x2a87f2={},_0xb7cc5={'count':0x0,'rows':[]};var _0x10b1a0=_[_0xc374('0x29')](db['ChatQueueReport'][_0xc374('0x2a')],function(_0x48aa6f){return{'name':_0x48aa6f[_0xc374('0x2b')],'type':_0x48aa6f[_0xc374('0x2c')][_0xc374('0x2d')]};});_0x2a87f2[_0xc374('0x2e')]=_['map'](_0x10b1a0,_0xc374('0x27'));_0x2a87f2['query']=_[_0xc374('0x2f')](_0xbd1d3d[_0xc374('0x30')]);_0x2a87f2[_0xc374('0x31')]=_[_0xc374('0x32')](_0x2a87f2[_0xc374('0x2e')],_0x2a87f2[_0xc374('0x30')]);_0x31ae09[_0xc374('0x33')]=_[_0xc374('0x32')](_0x2a87f2[_0xc374('0x2e')],qs[_0xc374('0x34')](_0xbd1d3d[_0xc374('0x30')][_0xc374('0x34')]));_0x31ae09['attributes']=_0x31ae09[_0xc374('0x33')]['length']?_0x31ae09[_0xc374('0x33')]:_0x2a87f2[_0xc374('0x2e')];if(!_0xbd1d3d[_0xc374('0x30')]['hasOwnProperty'](_0xc374('0x35'))){_0x31ae09[_0xc374('0x1c')]=qs['limit'](_0xbd1d3d[_0xc374('0x30')][_0xc374('0x1c')]);_0x31ae09[_0xc374('0x1a')]=qs[_0xc374('0x1a')](_0xbd1d3d[_0xc374('0x30')][_0xc374('0x1a')]);}_0x31ae09[_0xc374('0x36')]=qs['sort'](_0xbd1d3d['query']['sort']);_0x31ae09[_0xc374('0x37')]=qs[_0xc374('0x31')](_[_0xc374('0x38')](_0xbd1d3d[_0xc374('0x30')],_0x2a87f2['filters']),_0x10b1a0);if(_0xbd1d3d[_0xc374('0x30')][_0xc374('0x39')]){_0x31ae09[_0xc374('0x37')]=_[_0xc374('0x3a')](_0x31ae09['where'],{'$or':_['map'](_0x10b1a0,function(_0x53cc84){if(_0x53cc84[_0xc374('0x2c')]!==_0xc374('0x3b')){var _0x5c4011={};_0x5c4011[_0x53cc84[_0xc374('0x27')]]={'$like':'%'+_0xbd1d3d[_0xc374('0x30')]['filter']+'%'};return _0x5c4011;}})});}_0x31ae09=_[_0xc374('0x3a')]({},_0x31ae09,_0xbd1d3d['options']);var _0x5baff8={'where':_0x31ae09[_0xc374('0x37')]};return db[_0xc374('0x3c')][_0xc374('0x1d')](_0x5baff8)[_0xc374('0x22')](function(_0x39b59f){_0xb7cc5['count']=_0x39b59f;if(_0xbd1d3d[_0xc374('0x30')][_0xc374('0x3d')]){_0x31ae09[_0xc374('0x3e')]=[{'all':!![]}];}return db[_0xc374('0x3c')][_0xc374('0x3f')](_0x31ae09);})[_0xc374('0x22')](function(_0x39225c){_0xb7cc5['rows']=_0x39225c;return _0xb7cc5;})[_0xc374('0x22')](respondWithFilteredResult(_0x434c44,_0x31ae09))['catch'](handleError(_0x434c44,null));};exports[_0xc374('0x40')]=function(_0x4f5e44,_0x59e86d){var _0x3abfe5={'raw':!![],'where':{'id':_0x4f5e44[_0xc374('0x41')]['id']}},_0xb4b71b={};_0xb4b71b['model']=_[_0xc374('0x2f')](db[_0xc374('0x3c')]['rawAttributes']);_0xb4b71b[_0xc374('0x30')]=_[_0xc374('0x2f')](_0x4f5e44[_0xc374('0x30')]);_0xb4b71b[_0xc374('0x31')]=_[_0xc374('0x32')](_0xb4b71b[_0xc374('0x2e')],_0xb4b71b[_0xc374('0x30')]);_0x3abfe5[_0xc374('0x33')]=_['intersection'](_0xb4b71b['model'],qs[_0xc374('0x34')](_0x4f5e44[_0xc374('0x30')]['fields']));_0x3abfe5[_0xc374('0x33')]=_0x3abfe5[_0xc374('0x33')]['length']?_0x3abfe5[_0xc374('0x33')]:_0xb4b71b[_0xc374('0x2e')];if(_0x4f5e44[_0xc374('0x30')][_0xc374('0x3d')]){_0x3abfe5[_0xc374('0x3e')]=[{'all':!![]}];}_0x3abfe5=_[_0xc374('0x3a')]({},_0x3abfe5,_0x4f5e44[_0xc374('0x42')]);return db[_0xc374('0x3c')][_0xc374('0x43')](_0x3abfe5)[_0xc374('0x22')](handleEntityNotFound(_0x59e86d,null))['then'](respondWithResult(_0x59e86d,null))[_0xc374('0x44')](handleError(_0x59e86d,null));};exports['create']=function(_0x45a599,_0x423d05){return db['ChatQueueReport'][_0xc374('0x45')](_0x45a599[_0xc374('0x46')],{})[_0xc374('0x22')](respondWithResult(_0x423d05,0xc9))[_0xc374('0x44')](handleError(_0x423d05,null));};exports[_0xc374('0x21')]=function(_0x549b95,_0x42d0cc){if(_0x549b95[_0xc374('0x46')]['id']){delete _0x549b95[_0xc374('0x46')]['id'];}return db['ChatQueueReport'][_0xc374('0x43')]({'where':{'id':_0x549b95['params']['id']}})[_0xc374('0x22')](handleEntityNotFound(_0x42d0cc,null))[_0xc374('0x22')](saveUpdates(_0x549b95[_0xc374('0x46')],null))['then'](respondWithResult(_0x42d0cc,null))[_0xc374('0x44')](handleError(_0x42d0cc,null));};exports['destroy']=function(_0x1cf1cf,_0x3d001b){return db[_0xc374('0x3c')][_0xc374('0x43')]({'where':{'id':_0x1cf1cf[_0xc374('0x41')]['id']}})[_0xc374('0x22')](handleEntityNotFound(_0x3d001b,null))['then'](removeEntity(_0x3d001b,null))[_0xc374('0x44')](handleError(_0x3d001b,null));};exports['describe']=function(_0x3dba84,_0x3b63e5){return db[_0xc374('0x3c')][_0xc374('0x47')]()[_0xc374('0x22')](respondWithResult(_0x3b63e5,null))['catch'](handleError(_0x3b63e5,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 81a63cc..1975d3a 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(_0x210ccc,_0x18a85a){var _0x334164=function(_0x2fd28a){while(--_0x2fd28a){_0x210ccc['push'](_0x210ccc['shift']());}};_0x334164(++_0x18a85a);}(_0xe706,0xa3));var _0x6e70=function(_0x59db34,_0x593726){_0x59db34=_0x59db34-0x0;var _0x568a53=_0xe706[_0x59db34];return _0x568a53;};'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 _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x170a9e,_0x1d569a){var _0x348728=function(_0x8eaa2e){while(--_0x8eaa2e){_0x170a9e['push'](_0x170a9e['shift']());}};_0x348728(++_0x1d569a);}(_0x757a,0xde));var _0xa757=function(_0x508fd2,_0x1d0e8e){_0x508fd2=_0x508fd2-0x0;var _0x19ecd8=_0x757a[_0x508fd2];return _0x19ecd8;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 0ca2a28..ecb30d1 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 _0xcfad=['options','raw','stringify','UpdateChatQueueReport','ChatQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','CreateChatQueueReport','create','body'];(function(_0x504499,_0x19be69){var _0xc4d005=function(_0x835316){while(--_0x835316){_0x504499['push'](_0x504499['shift']());}};_0xc4d005(++_0x19be69);}(_0xcfad,0x132));var _0xdcfa=function(_0x58c0a1,_0x507bb5){_0x58c0a1=_0x58c0a1-0x0;var _0xfadf24=_0xcfad[_0x58c0a1];return _0xfadf24;};'use strict';var _=require(_0xdcfa('0x0'));var util=require(_0xdcfa('0x1'));var moment=require(_0xdcfa('0x2'));var BPromise=require(_0xdcfa('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdcfa('0x4'));var db=require(_0xdcfa('0x5'))['db'];var utils=require(_0xdcfa('0x6'));var logger=require(_0xdcfa('0x7'))(_0xdcfa('0x8'));var config=require(_0xdcfa('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xdcfa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57344f,_0x37c534,_0xed4a12){return new BPromise(function(_0x2cb992,_0x26ee7e){return client['request'](_0x57344f,_0xed4a12)[_0xdcfa('0xb')](function(_0x3f3ab9){logger[_0xdcfa('0xc')](_0xdcfa('0xd'),_0x37c534,_0xdcfa('0xe'));logger[_0xdcfa('0xf')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x37c534,_0xdcfa('0xe'),JSON['stringify'](_0x3f3ab9));if(_0x3f3ab9[_0xdcfa('0x10')]){if(_0x3f3ab9[_0xdcfa('0x10')][_0xdcfa('0x11')]===0x1f4){logger[_0xdcfa('0x10')](_0xdcfa('0xd'),_0x37c534,_0x3f3ab9[_0xdcfa('0x10')][_0xdcfa('0x12')]);return _0x26ee7e(_0x3f3ab9[_0xdcfa('0x10')][_0xdcfa('0x12')]);}logger[_0xdcfa('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x37c534,_0x3f3ab9[_0xdcfa('0x10')][_0xdcfa('0x12')]);return _0x2cb992(_0x3f3ab9[_0xdcfa('0x10')]['message']);}else{logger[_0xdcfa('0xc')](_0xdcfa('0xd'),_0x37c534,'request\x20sent');_0x2cb992(_0x3f3ab9[_0xdcfa('0x13')][_0xdcfa('0x12')]);}})[_0xdcfa('0x14')](function(_0x414fd2){logger[_0xdcfa('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x37c534,_0x414fd2);_0x26ee7e(_0x414fd2);});});}exports[_0xdcfa('0x15')]=function(_0x344131){var _0xb8d3d=this;return new Promise(function(_0x2d74b9,_0x4e364a){return db['ChatQueueReport'][_0xdcfa('0x16')](_0x344131[_0xdcfa('0x17')],{'raw':_0x344131[_0xdcfa('0x18')]?_0x344131[_0xdcfa('0x18')][_0xdcfa('0x19')]===undefined?!![]:![]:!![]})[_0xdcfa('0xb')](function(_0x4ffe2c){logger['info']('CreateChatQueueReport',_0x344131);logger[_0xdcfa('0xf')](_0xdcfa('0x15'),_0x344131,JSON[_0xdcfa('0x1a')](_0x4ffe2c));_0x2d74b9(_0x4ffe2c);})[_0xdcfa('0x14')](function(_0x23ca22){logger[_0xdcfa('0x10')]('CreateChatQueueReport',_0x23ca22[_0xdcfa('0x12')],_0x344131);_0x4e364a(_0xb8d3d['error'](0x1f4,_0x23ca22[_0xdcfa('0x12')]));});});};exports[_0xdcfa('0x1b')]=function(_0x599265){var _0x4a5c5c=this;return new Promise(function(_0x2933a4,_0x8a02cf){return db[_0xdcfa('0x1c')][_0xdcfa('0x1d')](_0x599265['body'],{'raw':_0x599265[_0xdcfa('0x18')]?_0x599265[_0xdcfa('0x18')][_0xdcfa('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x599265[_0xdcfa('0x18')]?_0x599265[_0xdcfa('0x18')][_0xdcfa('0x1e')]||null:null,'attributes':_0x599265['options']?_0x599265[_0xdcfa('0x18')][_0xdcfa('0x1f')]||null:null,'limit':_0x599265[_0xdcfa('0x18')]?_0x599265[_0xdcfa('0x18')][_0xdcfa('0x20')]||null:null})[_0xdcfa('0xb')](function(_0x26f72f){logger['info']('UpdateChatQueueReport',_0x599265);logger[_0xdcfa('0xf')](_0xdcfa('0x1b'),_0x599265,JSON[_0xdcfa('0x1a')](_0x26f72f));_0x2933a4(_0x26f72f);})[_0xdcfa('0x14')](function(_0x3de337){logger[_0xdcfa('0x10')](_0xdcfa('0x1b'),_0x3de337[_0xdcfa('0x12')],_0x599265);_0x8a02cf(_0x4a5c5c['error'](0x1f4,_0x3de337[_0xdcfa('0x12')]));});});}; \ No newline at end of file +var _0x04fa=['catch','CreateChatQueueReport','ChatQueueReport','create','body','raw','UpdateChatQueueReport','options','where','attributes','then','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','info','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','request\x20sent'];(function(_0x618880,_0x16ab63){var _0x2ce8de=function(_0x573c5d){while(--_0x573c5d){_0x618880['push'](_0x618880['shift']());}};_0x2ce8de(++_0x16ab63);}(_0x04fa,0x119));var _0xa04f=function(_0x3d3d75,_0x593f53){_0x3d3d75=_0x3d3d75-0x0;var _0xe990a1=_0x04fa[_0x3d3d75];return _0xe990a1;};'use strict';var _=require('lodash');var util=require(_0xa04f('0x0'));var moment=require(_0xa04f('0x1'));var BPromise=require(_0xa04f('0x2'));var rs=require(_0xa04f('0x3'));var fs=require('fs');var Redis=require(_0xa04f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa04f('0x5'));var logger=require('../../config/logger')(_0xa04f('0x6'));var config=require(_0xa04f('0x7'));var jayson=require(_0xa04f('0x8'));var client=jayson['client'][_0xa04f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c521c,_0x315771,_0x56f898){return new BPromise(function(_0x303e54,_0x4a2e03){return client['request'](_0x2c521c,_0x56f898)['then'](function(_0x5ea498){logger[_0xa04f('0xa')]('ChatQueueReport,\x20%s,\x20%s',_0x315771,'request\x20sent');logger[_0xa04f('0xb')](_0xa04f('0xc'),_0x315771,'request\x20sent',JSON[_0xa04f('0xd')](_0x5ea498));if(_0x5ea498['error']){if(_0x5ea498[_0xa04f('0xe')][_0xa04f('0xf')]===0x1f4){logger['error'](_0xa04f('0x10'),_0x315771,_0x5ea498[_0xa04f('0xe')]['message']);return _0x4a2e03(_0x5ea498['error']['message']);}logger[_0xa04f('0xe')](_0xa04f('0x10'),_0x315771,_0x5ea498[_0xa04f('0xe')][_0xa04f('0x11')]);return _0x303e54(_0x5ea498[_0xa04f('0xe')][_0xa04f('0x11')]);}else{logger['info'](_0xa04f('0x10'),_0x315771,_0xa04f('0x12'));_0x303e54(_0x5ea498['result'][_0xa04f('0x11')]);}})[_0xa04f('0x13')](function(_0x505abc){logger[_0xa04f('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x315771,_0x505abc);_0x4a2e03(_0x505abc);});});}exports[_0xa04f('0x14')]=function(_0x5d59d5){var _0x3252a1=this;return new Promise(function(_0x25bb59,_0x5d9bc9){return db[_0xa04f('0x15')][_0xa04f('0x16')](_0x5d59d5[_0xa04f('0x17')],{'raw':_0x5d59d5['options']?_0x5d59d5['options'][_0xa04f('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x5d68f4){logger[_0xa04f('0xa')](_0xa04f('0x14'),_0x5d59d5);logger['debug']('CreateChatQueueReport',_0x5d59d5,JSON[_0xa04f('0xd')](_0x5d68f4));_0x25bb59(_0x5d68f4);})[_0xa04f('0x13')](function(_0x17d471){logger[_0xa04f('0xe')](_0xa04f('0x14'),_0x17d471[_0xa04f('0x11')],_0x5d59d5);_0x5d9bc9(_0x3252a1[_0xa04f('0xe')](0x1f4,_0x17d471[_0xa04f('0x11')]));});});};exports[_0xa04f('0x19')]=function(_0x3ee16d){var _0x3f6cab=this;return new Promise(function(_0x1b1dad,_0x10ae93){return db[_0xa04f('0x15')]['update'](_0x3ee16d[_0xa04f('0x17')],{'raw':_0x3ee16d[_0xa04f('0x1a')]?_0x3ee16d[_0xa04f('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ee16d['options']?_0x3ee16d[_0xa04f('0x1a')][_0xa04f('0x1b')]||null:null,'attributes':_0x3ee16d[_0xa04f('0x1a')]?_0x3ee16d['options'][_0xa04f('0x1c')]||null:null,'limit':_0x3ee16d[_0xa04f('0x1a')]?_0x3ee16d[_0xa04f('0x1a')]['limit']||null:null})[_0xa04f('0x1d')](function(_0x1c0cc5){logger[_0xa04f('0xa')](_0xa04f('0x19'),_0x3ee16d);logger[_0xa04f('0xb')](_0xa04f('0x19'),_0x3ee16d,JSON[_0xa04f('0xd')](_0x1c0cc5));_0x1b1dad(_0x1c0cc5);})['catch'](function(_0x406131){logger[_0xa04f('0xe')]('UpdateChatQueueReport',_0x406131['message'],_0x3ee16d);_0x10ae93(_0x3f6cab[_0xa04f('0xe')](0x1f4,_0x406131[_0xa04f('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 11eda1a..704ea4a 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 _0x77c1=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','create','put','update','delete','destroy'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x77c1,0x169));var _0x177c=function(_0x1b1b21,_0x2d96be){_0x1b1b21=_0x1b1b21-0x0;var _0x34c0e0=_0x77c1[_0x1b1b21];return _0x34c0e0;};'use strict';var multer=require(_0x177c('0x0'));var util=require(_0x177c('0x1'));var path=require(_0x177c('0x2'));var timeout=require(_0x177c('0x3'));var express=require(_0x177c('0x4'));var router=express[_0x177c('0x5')]();var fs_extra=require(_0x177c('0x6'));var auth=require(_0x177c('0x7'));var interaction=require(_0x177c('0x8'));var config=require(_0x177c('0x9'));var controller=require(_0x177c('0xa'));router[_0x177c('0xb')]('/',auth['isAuthenticated'](),controller[_0x177c('0xc')]);router[_0x177c('0xb')](_0x177c('0xd'),auth[_0x177c('0xe')](),controller[_0x177c('0xf')]);router['get'](_0x177c('0x10'),auth[_0x177c('0xe')](),controller[_0x177c('0x11')]);router['post']('/',auth[_0x177c('0xe')](),controller[_0x177c('0x12')]);router[_0x177c('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x177c('0x14')]);router[_0x177c('0x15')](_0x177c('0x10'),auth['isAuthenticated'](),controller[_0x177c('0x16')]);module[_0x177c('0x17')]=router; \ No newline at end of file +var _0x9ea0=['fs-extra','./chatQueueReport.controller','isAuthenticated','get','/describe','describe','/:id','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router'];(function(_0x9910ec,_0x305971){var _0x1b1c9b=function(_0x9dc0dd){while(--_0x9dc0dd){_0x9910ec['push'](_0x9910ec['shift']());}};_0x1b1c9b(++_0x305971);}(_0x9ea0,0xa6));var _0x09ea=function(_0x219407,_0x36c620){_0x219407=_0x219407-0x0;var _0x240e77=_0x9ea0[_0x219407];return _0x240e77;};'use strict';var multer=require('multer');var util=require(_0x09ea('0x0'));var path=require(_0x09ea('0x1'));var timeout=require(_0x09ea('0x2'));var express=require('express');var router=express[_0x09ea('0x3')]();var fs_extra=require(_0x09ea('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x09ea('0x5'));router['get']('/',auth[_0x09ea('0x6')](),controller['index']);router[_0x09ea('0x7')](_0x09ea('0x8'),auth['isAuthenticated'](),controller[_0x09ea('0x9')]);router[_0x09ea('0x7')](_0x09ea('0xa'),auth[_0x09ea('0x6')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x09ea('0xb')]);router[_0x09ea('0xc')](_0x09ea('0xa'),auth[_0x09ea('0x6')](),controller[_0x09ea('0xd')]);router[_0x09ea('0xe')](_0x09ea('0xa'),auth[_0x09ea('0x6')](),controller[_0x09ea('0xf')]);module[_0x09ea('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 6d9a343..c9db8cc 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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x346eb6,_0x598f57){var _0x1667b6=function(_0x4be0a1){while(--_0x4be0a1){_0x346eb6['push'](_0x346eb6['shift']());}};_0x1667b6(++_0x598f57);}(_0xedd9,0xfc));var _0x9edd=function(_0x5749b0,_0x88ef0f){_0x5749b0=_0x5749b0-0x0;var _0x10de61=_0xedd9[_0x5749b0];return _0x10de61;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file +var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x16ab1a,_0x215490){var _0x3c82e1=function(_0x189be5){while(--_0x189be5){_0x16ab1a['push'](_0x16ab1a['shift']());}};_0x3c82e1(++_0x215490);}(_0x008c,0x188));var _0xc008=function(_0x1b9cd5,_0x103dc4){_0x1b9cd5=_0x1b9cd5-0x0;var _0x4c74ca=_0x008c[_0x1b9cd5];return _0x4c74ca;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 0dbcdf7..edbe966 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 _0xfcdf=['name','send','ChatTransferReport','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','params','length','create','body','catch','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','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/utils','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack'];(function(_0x424800,_0x330b5d){var _0x2b3076=function(_0x750070){while(--_0x750070){_0x424800['push'](_0x424800['shift']());}};_0x2b3076(++_0x330b5d);}(_0xfcdf,0x1ea));var _0xffcd=function(_0x116535,_0x39b873){_0x116535=_0x116535-0x0;var _0x4974bf=_0xfcdf[_0x116535];return _0x4974bf;};'use strict';var emlformat=require(_0xffcd('0x0'));var rimraf=require(_0xffcd('0x1'));var zipdir=require(_0xffcd('0x2'));var jsonpatch=require(_0xffcd('0x3'));var rp=require(_0xffcd('0x4'));var moment=require(_0xffcd('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xffcd('0x6'));var util=require(_0xffcd('0x7'));var path=require('path');var sox=require(_0xffcd('0x8'));var csv=require(_0xffcd('0x9'));var ejs=require(_0xffcd('0xa'));var fs=require('fs');var fs_extra=require(_0xffcd('0xb'));var _=require(_0xffcd('0xc'));var squel=require(_0xffcd('0xd'));var crypto=require(_0xffcd('0xe'));var jsforce=require(_0xffcd('0xf'));var deskjs=require(_0xffcd('0x10'));var toCsv=require(_0xffcd('0x9'));var querystring=require('querystring');var Papa=require(_0xffcd('0x11'));var Redis=require(_0xffcd('0x12'));var authService=require(_0xffcd('0x13'));var qs=require(_0xffcd('0x14'));var as=require(_0xffcd('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xffcd('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xffcd('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56da0f,_0x5cd54b){_0x5cd54b=_0x5cd54b||0xcc;return function(_0x5ed470){if(_0x5ed470){return _0x56da0f[_0xffcd('0x18')](_0x5cd54b);}return _0x56da0f['status'](_0x5cd54b)[_0xffcd('0x19')]();};}function respondWithResult(_0x2d4af9,_0x16e287){_0x16e287=_0x16e287||0xc8;return function(_0x546816){if(_0x546816){return _0x2d4af9[_0xffcd('0x1a')](_0x16e287)[_0xffcd('0x1b')](_0x546816);}};}function respondWithFilteredResult(_0x23d8a6,_0x23ade8){return function(_0x2bdc8a){if(_0x2bdc8a){var _0x4929bd=typeof _0x23ade8[_0xffcd('0x1c')]===_0xffcd('0x1d')&&typeof _0x23ade8[_0xffcd('0x1e')]===_0xffcd('0x1d');var _0x1d1786=_0x2bdc8a[_0xffcd('0x1f')];var _0x4b46c=_0x4929bd?0x0:_0x23ade8[_0xffcd('0x1c')];var _0x132185=_0x4929bd?_0x2bdc8a[_0xffcd('0x1f')]:_0x23ade8[_0xffcd('0x1c')]+_0x23ade8[_0xffcd('0x1e')];var _0x1519a9;if(_0x132185>=_0x1d1786){_0x132185=_0x1d1786;_0x1519a9=0xc8;}else{_0x1519a9=0xce;}_0x23d8a6[_0xffcd('0x1a')](_0x1519a9);return _0x23d8a6[_0xffcd('0x20')](_0xffcd('0x21'),_0x4b46c+'-'+_0x132185+'/'+_0x1d1786)[_0xffcd('0x1b')](_0x2bdc8a);}return null;};}function patchUpdates(_0x3e7875){return function(_0x3e2703){try{jsonpatch[_0xffcd('0x22')](_0x3e2703,_0x3e7875,!![]);}catch(_0x1a3ca7){return BPromise[_0xffcd('0x23')](_0x1a3ca7);}return _0x3e2703[_0xffcd('0x24')]();};}function saveUpdates(_0x31c55b,_0x348217){return function(_0x30797e){if(_0x30797e){return _0x30797e[_0xffcd('0x25')](_0x31c55b)['then'](function(_0x26add5){return _0x26add5;});}return null;};}function removeEntity(_0x45794f,_0xf415e0){return function(_0x3b115d){if(_0x3b115d){return _0x3b115d[_0xffcd('0x26')]()[_0xffcd('0x27')](function(){_0x45794f['status'](0xcc)[_0xffcd('0x19')]();});}};}function handleEntityNotFound(_0x262b4a,_0x130f59){return function(_0x96231e){if(!_0x96231e){_0x262b4a[_0xffcd('0x18')](0x194);}return _0x96231e;};}function handleError(_0x225125,_0x37c809){_0x37c809=_0x37c809||0x1f4;return function(_0x161fb4){logger[_0xffcd('0x28')](_0x161fb4[_0xffcd('0x29')]);if(_0x161fb4['name']){delete _0x161fb4[_0xffcd('0x2a')];}_0x225125[_0xffcd('0x1a')](_0x37c809)[_0xffcd('0x2b')](_0x161fb4);};}exports['index']=function(_0xda9542,_0x5d0af1){var _0xe9208e={},_0x2e20b6={},_0x273982={'count':0x0,'rows':[]};var _0x1d3800=_['map'](db[_0xffcd('0x2c')][_0xffcd('0x2d')],function(_0x3b2ac1){return{'name':_0x3b2ac1[_0xffcd('0x2e')],'type':_0x3b2ac1['type'][_0xffcd('0x2f')]};});_0x2e20b6['model']=_[_0xffcd('0x30')](_0x1d3800,'name');_0x2e20b6[_0xffcd('0x31')]=_[_0xffcd('0x32')](_0xda9542[_0xffcd('0x31')]);_0x2e20b6[_0xffcd('0x33')]=_[_0xffcd('0x34')](_0x2e20b6[_0xffcd('0x35')],_0x2e20b6[_0xffcd('0x31')]);_0xe9208e[_0xffcd('0x36')]=_[_0xffcd('0x34')](_0x2e20b6[_0xffcd('0x35')],qs[_0xffcd('0x37')](_0xda9542[_0xffcd('0x31')][_0xffcd('0x37')]));_0xe9208e[_0xffcd('0x36')]=_0xe9208e[_0xffcd('0x36')]['length']?_0xe9208e[_0xffcd('0x36')]:_0x2e20b6[_0xffcd('0x35')];if(!_0xda9542[_0xffcd('0x31')][_0xffcd('0x38')](_0xffcd('0x39'))){_0xe9208e[_0xffcd('0x1e')]=qs[_0xffcd('0x1e')](_0xda9542[_0xffcd('0x31')][_0xffcd('0x1e')]);_0xe9208e['offset']=qs[_0xffcd('0x1c')](_0xda9542[_0xffcd('0x31')][_0xffcd('0x1c')]);}_0xe9208e[_0xffcd('0x3a')]=qs[_0xffcd('0x3b')](_0xda9542['query'][_0xffcd('0x3b')]);_0xe9208e[_0xffcd('0x3c')]=qs[_0xffcd('0x33')](_[_0xffcd('0x3d')](_0xda9542[_0xffcd('0x31')],_0x2e20b6[_0xffcd('0x33')]),_0x1d3800);if(_0xda9542[_0xffcd('0x31')][_0xffcd('0x3e')]){_0xe9208e['where']=_[_0xffcd('0x3f')](_0xe9208e[_0xffcd('0x3c')],{'$or':_[_0xffcd('0x30')](_0x1d3800,function(_0x2e0e7a){if(_0x2e0e7a['type']!==_0xffcd('0x40')){var _0x4b4fe3={};_0x4b4fe3[_0x2e0e7a[_0xffcd('0x2a')]]={'$like':'%'+_0xda9542[_0xffcd('0x31')]['filter']+'%'};return _0x4b4fe3;}})});}_0xe9208e=_[_0xffcd('0x3f')]({},_0xe9208e,_0xda9542[_0xffcd('0x41')]);var _0x4c30d3={'where':_0xe9208e[_0xffcd('0x3c')]};return db[_0xffcd('0x2c')]['count'](_0x4c30d3)['then'](function(_0x23d18d){_0x273982[_0xffcd('0x1f')]=_0x23d18d;if(_0xda9542[_0xffcd('0x31')][_0xffcd('0x42')]){_0xe9208e[_0xffcd('0x43')]=[{'all':!![]}];}return db[_0xffcd('0x2c')][_0xffcd('0x44')](_0xe9208e);})[_0xffcd('0x27')](function(_0x52b06b){_0x273982['rows']=_0x52b06b;return _0x273982;})['then'](respondWithFilteredResult(_0x5d0af1,_0xe9208e))['catch'](handleError(_0x5d0af1,null));};exports['show']=function(_0x51f4c9,_0x1af54e){var _0x31c980={'raw':!![],'where':{'id':_0x51f4c9[_0xffcd('0x45')]['id']}},_0x3e296b={};_0x3e296b[_0xffcd('0x35')]=_['keys'](db[_0xffcd('0x2c')][_0xffcd('0x2d')]);_0x3e296b[_0xffcd('0x31')]=_[_0xffcd('0x32')](_0x51f4c9[_0xffcd('0x31')]);_0x3e296b[_0xffcd('0x33')]=_['intersection'](_0x3e296b[_0xffcd('0x35')],_0x3e296b[_0xffcd('0x31')]);_0x31c980['attributes']=_['intersection'](_0x3e296b[_0xffcd('0x35')],qs[_0xffcd('0x37')](_0x51f4c9[_0xffcd('0x31')][_0xffcd('0x37')]));_0x31c980[_0xffcd('0x36')]=_0x31c980['attributes'][_0xffcd('0x46')]?_0x31c980[_0xffcd('0x36')]:_0x3e296b['model'];if(_0x51f4c9[_0xffcd('0x31')][_0xffcd('0x42')]){_0x31c980['include']=[{'all':!![]}];}_0x31c980=_[_0xffcd('0x3f')]({},_0x31c980,_0x51f4c9[_0xffcd('0x41')]);return db[_0xffcd('0x2c')]['find'](_0x31c980)[_0xffcd('0x27')](handleEntityNotFound(_0x1af54e,null))[_0xffcd('0x27')](respondWithResult(_0x1af54e,null))['catch'](handleError(_0x1af54e,null));};exports[_0xffcd('0x47')]=function(_0xe02fa,_0x188ca6){return db[_0xffcd('0x2c')][_0xffcd('0x47')](_0xe02fa[_0xffcd('0x48')],{})[_0xffcd('0x27')](respondWithResult(_0x188ca6,0xc9))[_0xffcd('0x49')](handleError(_0x188ca6,null));};exports[_0xffcd('0x25')]=function(_0x41d00a,_0x173d7a){if(_0x41d00a[_0xffcd('0x48')]['id']){delete _0x41d00a[_0xffcd('0x48')]['id'];}return db[_0xffcd('0x2c')][_0xffcd('0x4a')]({'where':{'id':_0x41d00a['params']['id']}})[_0xffcd('0x27')](handleEntityNotFound(_0x173d7a,null))['then'](saveUpdates(_0x41d00a[_0xffcd('0x48')],null))[_0xffcd('0x27')](respondWithResult(_0x173d7a,null))[_0xffcd('0x49')](handleError(_0x173d7a,null));};exports[_0xffcd('0x26')]=function(_0x254988,_0x5d4c40){return db['ChatTransferReport'][_0xffcd('0x4a')]({'where':{'id':_0x254988['params']['id']}})[_0xffcd('0x27')](handleEntityNotFound(_0x5d4c40,null))[_0xffcd('0x27')](removeEntity(_0x5d4c40,null))['catch'](handleError(_0x5d4c40,null));};exports[_0xffcd('0x4b')]=function(_0x54981a,_0xdb8be4){return db['ChatTransferReport'][_0xffcd('0x4b')]()[_0xffcd('0x27')](respondWithResult(_0xdb8be4,null))[_0xffcd('0x49')](handleError(_0xdb8be4,null));}; \ No newline at end of file +var _0x322c=['save','update','destroy','then','sendStatus','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','findAll','catch','length','include','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x3b77bc,_0x2c2afe){var _0x2b9427=function(_0x32cf85){while(--_0x32cf85){_0x3b77bc['push'](_0x3b77bc['shift']());}};_0x2b9427(++_0x2c2afe);}(_0x322c,0x11b));var _0xc322=function(_0x3efdeb,_0x4d5455){_0x3efdeb=_0x3efdeb-0x0;var _0x360961=_0x322c[_0x3efdeb];return _0x360961;};'use strict';var emlformat=require(_0xc322('0x0'));var rimraf=require(_0xc322('0x1'));var zipdir=require(_0xc322('0x2'));var jsonpatch=require(_0xc322('0x3'));var rp=require(_0xc322('0x4'));var moment=require('moment');var BPromise=require(_0xc322('0x5'));var Mustache=require(_0xc322('0x6'));var util=require(_0xc322('0x7'));var path=require(_0xc322('0x8'));var sox=require(_0xc322('0x9'));var csv=require('to-csv');var ejs=require(_0xc322('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc322('0xb'));var squel=require(_0xc322('0xc'));var crypto=require(_0xc322('0xd'));var jsforce=require(_0xc322('0xe'));var deskjs=require(_0xc322('0xf'));var toCsv=require(_0xc322('0x10'));var querystring=require(_0xc322('0x11'));var Papa=require(_0xc322('0x12'));var Redis=require(_0xc322('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xc322('0x14'));var as=require(_0xc322('0x15'));var hardwareService=require(_0xc322('0x16'));var logger=require('../../config/logger')(_0xc322('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc322('0x18'));var db=require(_0xc322('0x19'))['db'];function respondWithStatusCode(_0x5bfc60,_0x8a72dc){_0x8a72dc=_0x8a72dc||0xcc;return function(_0x290ad4){if(_0x290ad4){return _0x5bfc60['sendStatus'](_0x8a72dc);}return _0x5bfc60['status'](_0x8a72dc)[_0xc322('0x1a')]();};}function respondWithResult(_0x1b7fcf,_0x24293a){_0x24293a=_0x24293a||0xc8;return function(_0x12c428){if(_0x12c428){return _0x1b7fcf[_0xc322('0x1b')](_0x24293a)[_0xc322('0x1c')](_0x12c428);}};}function respondWithFilteredResult(_0x4152db,_0x36456b){return function(_0x2f2e5f){if(_0x2f2e5f){var _0x4ff175=typeof _0x36456b[_0xc322('0x1d')]===_0xc322('0x1e')&&typeof _0x36456b[_0xc322('0x1f')]===_0xc322('0x1e');var _0x5739d2=_0x2f2e5f[_0xc322('0x20')];var _0x44c530=_0x4ff175?0x0:_0x36456b[_0xc322('0x1d')];var _0x1be88e=_0x4ff175?_0x2f2e5f[_0xc322('0x20')]:_0x36456b[_0xc322('0x1d')]+_0x36456b[_0xc322('0x1f')];var _0x5b9813;if(_0x1be88e>=_0x5739d2){_0x1be88e=_0x5739d2;_0x5b9813=0xc8;}else{_0x5b9813=0xce;}_0x4152db[_0xc322('0x1b')](_0x5b9813);return _0x4152db[_0xc322('0x21')](_0xc322('0x22'),_0x44c530+'-'+_0x1be88e+'/'+_0x5739d2)[_0xc322('0x1c')](_0x2f2e5f);}return null;};}function patchUpdates(_0x41d28c){return function(_0x240de4){try{jsonpatch[_0xc322('0x23')](_0x240de4,_0x41d28c,!![]);}catch(_0xe4cdf0){return BPromise[_0xc322('0x24')](_0xe4cdf0);}return _0x240de4[_0xc322('0x25')]();};}function saveUpdates(_0x16158a,_0x32a2ca){return function(_0x3fec49){if(_0x3fec49){return _0x3fec49[_0xc322('0x26')](_0x16158a)['then'](function(_0x1aba3b){return _0x1aba3b;});}return null;};}function removeEntity(_0x34ead1,_0x5a373e){return function(_0x51fb79){if(_0x51fb79){return _0x51fb79[_0xc322('0x27')]()[_0xc322('0x28')](function(){_0x34ead1[_0xc322('0x1b')](0xcc)[_0xc322('0x1a')]();});}};}function handleEntityNotFound(_0x3098a7,_0xcf7dc8){return function(_0x12d8f9){if(!_0x12d8f9){_0x3098a7[_0xc322('0x29')](0x194);}return _0x12d8f9;};}function handleError(_0x154082,_0x5390ec){_0x5390ec=_0x5390ec||0x1f4;return function(_0x208b53){logger[_0xc322('0x2a')](_0x208b53[_0xc322('0x2b')]);if(_0x208b53[_0xc322('0x2c')]){delete _0x208b53['name'];}_0x154082[_0xc322('0x1b')](_0x5390ec)[_0xc322('0x2d')](_0x208b53);};}exports[_0xc322('0x2e')]=function(_0xb1f933,_0x5733a7){var _0x33b178={},_0x14fdfe={},_0x529854={'count':0x0,'rows':[]};var _0x590c6d=_[_0xc322('0x2f')](db[_0xc322('0x30')][_0xc322('0x31')],function(_0x301dd){return{'name':_0x301dd[_0xc322('0x32')],'type':_0x301dd['type'][_0xc322('0x33')]};});_0x14fdfe[_0xc322('0x34')]=_[_0xc322('0x2f')](_0x590c6d,_0xc322('0x2c'));_0x14fdfe['query']=_[_0xc322('0x35')](_0xb1f933['query']);_0x14fdfe[_0xc322('0x36')]=_[_0xc322('0x37')](_0x14fdfe['model'],_0x14fdfe[_0xc322('0x38')]);_0x33b178[_0xc322('0x39')]=_['intersection'](_0x14fdfe[_0xc322('0x34')],qs['fields'](_0xb1f933['query'][_0xc322('0x3a')]));_0x33b178[_0xc322('0x39')]=_0x33b178[_0xc322('0x39')]['length']?_0x33b178['attributes']:_0x14fdfe[_0xc322('0x34')];if(!_0xb1f933[_0xc322('0x38')][_0xc322('0x3b')](_0xc322('0x3c'))){_0x33b178['limit']=qs['limit'](_0xb1f933[_0xc322('0x38')][_0xc322('0x1f')]);_0x33b178[_0xc322('0x1d')]=qs[_0xc322('0x1d')](_0xb1f933[_0xc322('0x38')]['offset']);}_0x33b178[_0xc322('0x3d')]=qs[_0xc322('0x3e')](_0xb1f933[_0xc322('0x38')]['sort']);_0x33b178[_0xc322('0x3f')]=qs[_0xc322('0x36')](_[_0xc322('0x40')](_0xb1f933[_0xc322('0x38')],_0x14fdfe[_0xc322('0x36')]),_0x590c6d);if(_0xb1f933[_0xc322('0x38')]['filter']){_0x33b178[_0xc322('0x3f')]=_[_0xc322('0x41')](_0x33b178['where'],{'$or':_[_0xc322('0x2f')](_0x590c6d,function(_0x1c6ccd){if(_0x1c6ccd[_0xc322('0x42')]!==_0xc322('0x43')){var _0x5ca07d={};_0x5ca07d[_0x1c6ccd['name']]={'$like':'%'+_0xb1f933[_0xc322('0x38')][_0xc322('0x44')]+'%'};return _0x5ca07d;}})});}_0x33b178=_[_0xc322('0x41')]({},_0x33b178,_0xb1f933[_0xc322('0x45')]);var _0x8bb0a2={'where':_0x33b178[_0xc322('0x3f')]};return db[_0xc322('0x30')][_0xc322('0x20')](_0x8bb0a2)['then'](function(_0x5d2221){_0x529854[_0xc322('0x20')]=_0x5d2221;if(_0xb1f933[_0xc322('0x38')][_0xc322('0x46')]){_0x33b178['include']=[{'all':!![]}];}return db[_0xc322('0x30')][_0xc322('0x47')](_0x33b178);})['then'](function(_0x2e525b){_0x529854['rows']=_0x2e525b;return _0x529854;})[_0xc322('0x28')](respondWithFilteredResult(_0x5733a7,_0x33b178))[_0xc322('0x48')](handleError(_0x5733a7,null));};exports['show']=function(_0x2a6a5c,_0x408687){var _0xd52440={'raw':!![],'where':{'id':_0x2a6a5c['params']['id']}},_0x5f4a6b={};_0x5f4a6b[_0xc322('0x34')]=_[_0xc322('0x35')](db['ChatTransferReport'][_0xc322('0x31')]);_0x5f4a6b[_0xc322('0x38')]=_[_0xc322('0x35')](_0x2a6a5c['query']);_0x5f4a6b[_0xc322('0x36')]=_[_0xc322('0x37')](_0x5f4a6b[_0xc322('0x34')],_0x5f4a6b['query']);_0xd52440[_0xc322('0x39')]=_[_0xc322('0x37')](_0x5f4a6b[_0xc322('0x34')],qs[_0xc322('0x3a')](_0x2a6a5c['query'][_0xc322('0x3a')]));_0xd52440['attributes']=_0xd52440['attributes'][_0xc322('0x49')]?_0xd52440[_0xc322('0x39')]:_0x5f4a6b[_0xc322('0x34')];if(_0x2a6a5c['query'][_0xc322('0x46')]){_0xd52440[_0xc322('0x4a')]=[{'all':!![]}];}_0xd52440=_[_0xc322('0x41')]({},_0xd52440,_0x2a6a5c['options']);return db[_0xc322('0x30')][_0xc322('0x4b')](_0xd52440)[_0xc322('0x28')](handleEntityNotFound(_0x408687,null))[_0xc322('0x28')](respondWithResult(_0x408687,null))[_0xc322('0x48')](handleError(_0x408687,null));};exports['create']=function(_0x423eeb,_0x497b35){return db[_0xc322('0x30')][_0xc322('0x4c')](_0x423eeb[_0xc322('0x4d')],{})['then'](respondWithResult(_0x497b35,0xc9))[_0xc322('0x48')](handleError(_0x497b35,null));};exports['update']=function(_0x8429a2,_0x3304d){if(_0x8429a2[_0xc322('0x4d')]['id']){delete _0x8429a2[_0xc322('0x4d')]['id'];}return db[_0xc322('0x30')]['find']({'where':{'id':_0x8429a2['params']['id']}})[_0xc322('0x28')](handleEntityNotFound(_0x3304d,null))[_0xc322('0x28')](saveUpdates(_0x8429a2['body'],null))[_0xc322('0x28')](respondWithResult(_0x3304d,null))[_0xc322('0x48')](handleError(_0x3304d,null));};exports[_0xc322('0x27')]=function(_0x8a1a7,_0x342fa2){return db['ChatTransferReport'][_0xc322('0x4b')]({'where':{'id':_0x8a1a7[_0xc322('0x4e')]['id']}})[_0xc322('0x28')](handleEntityNotFound(_0x342fa2,null))['then'](removeEntity(_0x342fa2,null))['catch'](handleError(_0x342fa2,null));};exports[_0xc322('0x4f')]=function(_0x38f40f,_0x40e1bb){return db[_0xc322('0x30')]['describe']()[_0xc322('0x28')](respondWithResult(_0x40e1bb,null))[_0xc322('0x48')](handleError(_0x40e1bb,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index a1a6a84..fa2c807 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 _0x688b=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid','lodash'];(function(_0x4c570d,_0x3fd9bc){var _0x40dac1=function(_0x31b24c){while(--_0x31b24c){_0x4c570d['push'](_0x4c570d['shift']());}};_0x40dac1(++_0x3fd9bc);}(_0x688b,0x12b));var _0xb688=function(_0x4de586,_0x183427){_0x4de586=_0x4de586-0x0;var _0x46baf5=_0x688b[_0x4de586];return _0x46baf5;};'use strict';var _=require(_0xb688('0x0'));var util=require('util');var logger=require(_0xb688('0x1'))(_0xb688('0x2'));var moment=require(_0xb688('0x3'));var BPromise=require('bluebird');var rp=require(_0xb688('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb688('0x5'));var config=require(_0xb688('0x6'));var attributes=require(_0xb688('0x7'));module[_0xb688('0x8')]=function(_0x1263c2,_0x4f246c){return _0x1263c2[_0xb688('0x9')](_0xb688('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xb688('0xb'),'fields':[_0xb688('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9182=['bluebird','path','../../config/environment','./chatTransferReport.attributes','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x9182,0x146));var _0x2918=function(_0x2455e9,_0x1dca3a){_0x2455e9=_0x2455e9-0x0;var _0x497597=_0x9182[_0x2455e9];return _0x497597;};'use strict';var _=require(_0x2918('0x0'));var util=require(_0x2918('0x1'));var logger=require(_0x2918('0x2'))(_0x2918('0x3'));var moment=require('moment');var BPromise=require(_0x2918('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2918('0x5'));var rimraf=require('rimraf');var config=require(_0x2918('0x6'));var attributes=require(_0x2918('0x7'));module['exports']=function(_0x469040,_0x4ac3ea){return _0x469040['define'](_0x2918('0x8'),attributes,{'tableName':_0x2918('0x9'),'paranoid':![],'indexes':[{'name':_0x2918('0xa'),'fields':[_0x2918('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 543238f..fe8ac80 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 _0x6f89=['catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6f89,0x1b9));var _0x96f8=function(_0x50ae6b,_0x31be26){_0x50ae6b=_0x50ae6b-0x0;var _0x567a64=_0x6f89[_0x50ae6b];return _0x567a64;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x96f8('0x0'));var BPromise=require(_0x96f8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x96f8('0x2'));var db=require(_0x96f8('0x3'))['db'];var utils=require(_0x96f8('0x4'));var logger=require(_0x96f8('0x5'))('rpc');var config=require(_0x96f8('0x6'));var jayson=require(_0x96f8('0x7'));var client=jayson[_0x96f8('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x320a93,_0x500009,_0x425d97){return new BPromise(function(_0x28ac1b,_0x126df6){return client[_0x96f8('0x9')](_0x320a93,_0x425d97)[_0x96f8('0xa')](function(_0x49aa7c){logger[_0x96f8('0xb')](_0x96f8('0xc'),_0x500009,_0x96f8('0xd'));logger[_0x96f8('0xe')](_0x96f8('0xf'),_0x500009,_0x96f8('0xd'),JSON[_0x96f8('0x10')](_0x49aa7c));if(_0x49aa7c[_0x96f8('0x11')]){if(_0x49aa7c[_0x96f8('0x11')][_0x96f8('0x12')]===0x1f4){logger[_0x96f8('0x11')](_0x96f8('0xc'),_0x500009,_0x49aa7c['error'][_0x96f8('0x13')]);return _0x126df6(_0x49aa7c[_0x96f8('0x11')][_0x96f8('0x13')]);}logger[_0x96f8('0x11')](_0x96f8('0xc'),_0x500009,_0x49aa7c[_0x96f8('0x11')][_0x96f8('0x13')]);return _0x28ac1b(_0x49aa7c[_0x96f8('0x11')]['message']);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x500009,'request\x20sent');_0x28ac1b(_0x49aa7c[_0x96f8('0x14')]['message']);}})[_0x96f8('0x15')](function(_0x540b76){logger[_0x96f8('0x11')](_0x96f8('0xc'),_0x500009,_0x540b76);_0x126df6(_0x540b76);});});} \ No newline at end of file +var _0xb0bc=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util'];(function(_0x2118ad,_0xe8e3fd){var _0x4b5715=function(_0x399f72){while(--_0x399f72){_0x2118ad['push'](_0x2118ad['shift']());}};_0x4b5715(++_0xe8e3fd);}(_0xb0bc,0x17a));var _0xcb0b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xb0bc[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xcb0b('0x0'));var util=require(_0xcb0b('0x1'));var moment=require(_0xcb0b('0x2'));var BPromise=require('bluebird');var rs=require(_0xcb0b('0x3'));var fs=require('fs');var Redis=require(_0xcb0b('0x4'));var db=require(_0xcb0b('0x5'))['db'];var utils=require(_0xcb0b('0x6'));var logger=require('../../config/logger')(_0xcb0b('0x7'));var config=require(_0xcb0b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcb0b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24c421,_0x133184,_0x3a321e){return new BPromise(function(_0x40119a,_0x4d1680){return client['request'](_0x24c421,_0x3a321e)[_0xcb0b('0xa')](function(_0xf22231){logger['info'](_0xcb0b('0xb'),_0x133184,_0xcb0b('0xc'));logger[_0xcb0b('0xd')](_0xcb0b('0xe'),_0x133184,_0xcb0b('0xc'),JSON['stringify'](_0xf22231));if(_0xf22231[_0xcb0b('0xf')]){if(_0xf22231[_0xcb0b('0xf')][_0xcb0b('0x10')]===0x1f4){logger[_0xcb0b('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x133184,_0xf22231[_0xcb0b('0xf')]['message']);return _0x4d1680(_0xf22231['error']['message']);}logger[_0xcb0b('0xf')](_0xcb0b('0xb'),_0x133184,_0xf22231[_0xcb0b('0xf')][_0xcb0b('0x11')]);return _0x40119a(_0xf22231[_0xcb0b('0xf')][_0xcb0b('0x11')]);}else{logger['info'](_0xcb0b('0xb'),_0x133184,_0xcb0b('0xc'));_0x40119a(_0xf22231['result'][_0xcb0b('0x11')]);}})[_0xcb0b('0x12')](function(_0x1c34b0){logger[_0xcb0b('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x133184,_0x1c34b0);_0x4d1680(_0x1c34b0);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 78c6a85..54a0380 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 _0xa5a8=['create','update','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x35a779,_0x27f8fb){var _0xca723b=function(_0x298df7){while(--_0x298df7){_0x35a779['push'](_0x35a779['shift']());}};_0xca723b(++_0x27f8fb);}(_0xa5a8,0xf4));var _0x8a5a=function(_0x28ab0e,_0x11925a){_0x28ab0e=_0x28ab0e-0x0;var _0x3f8cba=_0xa5a8[_0x28ab0e];return _0x3f8cba;};'use strict';var multer=require(_0x8a5a('0x0'));var util=require(_0x8a5a('0x1'));var path=require(_0x8a5a('0x2'));var timeout=require(_0x8a5a('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8a5a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8a5a('0x5'));var config=require(_0x8a5a('0x6'));var controller=require(_0x8a5a('0x7'));router[_0x8a5a('0x8')]('/',auth[_0x8a5a('0x9')](),controller[_0x8a5a('0xa')]);router[_0x8a5a('0x8')](_0x8a5a('0xb'),auth[_0x8a5a('0x9')](),controller[_0x8a5a('0xc')]);router[_0x8a5a('0x8')](_0x8a5a('0xd'),auth[_0x8a5a('0x9')](),controller[_0x8a5a('0xe')]);router[_0x8a5a('0xf')]('/',auth[_0x8a5a('0x9')](),controller[_0x8a5a('0x10')]);router['put']('/:id',auth[_0x8a5a('0x9')](),controller[_0x8a5a('0x11')]);router['delete'](_0x8a5a('0xd'),auth['isAuthenticated'](),controller[_0x8a5a('0x12')]);module[_0x8a5a('0x13')]=router; \ No newline at end of file +var _0x4615=['../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4d4262,_0x644ce){var _0xcd1204=function(_0x58ec6f){while(--_0x58ec6f){_0x4d4262['push'](_0x4d4262['shift']());}};_0xcd1204(++_0x644ce);}(_0x4615,0xae));var _0x5461=function(_0x3d5970,_0x28f570){_0x3d5970=_0x3d5970-0x0;var _0x2284ef=_0x4615[_0x3d5970];return _0x2284ef;};'use strict';var multer=require(_0x5461('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5461('0x1'));var express=require(_0x5461('0x2'));var router=express['Router']();var fs_extra=require(_0x5461('0x3'));var auth=require(_0x5461('0x4'));var interaction=require(_0x5461('0x5'));var config=require(_0x5461('0x6'));var controller=require(_0x5461('0x7'));router[_0x5461('0x8')]('/',auth[_0x5461('0x9')](),controller['index']);router[_0x5461('0x8')](_0x5461('0xa'),auth['isAuthenticated'](),controller[_0x5461('0xb')]);router[_0x5461('0x8')](_0x5461('0xc'),auth[_0x5461('0x9')](),controller[_0x5461('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5461('0xe')]);router[_0x5461('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x5461('0x10')]);router[_0x5461('0x11')]('/:id',auth[_0x5461('0x9')](),controller[_0x5461('0x12')]);module[_0x5461('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 3aad46c..c218379 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 _0x938a=['#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','exports','STRING','email','#011F6A','#ffffff','INTEGER','ENUM','squared','Chat','Contact\x20us','BOOLEAN','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','star','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Send','bottom_right','alternate'];(function(_0x482446,_0x364e34){var _0x2d92bf=function(_0x1ff153){while(--_0x1ff153){_0x482446['push'](_0x482446['shift']());}};_0x2d92bf(++_0x364e34);}(_0x938a,0x160));var _0xa938=function(_0xcba291,_0x10e9d5){_0xcba291=_0xcba291-0x0;var _0x162274=_0x938a[_0xcba291];return _0x162274;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xa938('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xa938('0x1')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xa938('0x1')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xa938('0x2')},'mapKeyOffline':{'type':Sequelize[_0xa938('0x1')],'defaultValue':_0xa938('0x2')},'key':{'type':Sequelize[_0xa938('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xa938('0x1')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xa938('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xa938('0x1')],'allowNull':![],'defaultValue':_0xa938('0x3'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xa938('0x1')],'allowNull':![],'defaultValue':_0xa938('0x3'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xa938('0x1')],'allowNull':![],'defaultValue':_0xa938('0x4'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xa938('0x5')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xa938('0x6')]('rounded',_0xa938('0x7')),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xa938('0x1')],'defaultValue':_0xa938('0x8')},'offline_chat_button':{'type':Sequelize[_0xa938('0x1')],'defaultValue':'Send'},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xa938('0x9')},'download_transcript':{'type':Sequelize[_0xa938('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xa938('0x5')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xa938('0x1')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xa938('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xa938('0xb')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xa938('0xc')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xa938('0xd')},'noteTitle':{'type':Sequelize[_0xa938('0x1')],'defaultValue':_0xa938('0xe')},'placeholderMessage':{'type':Sequelize[_0xa938('0x1')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xa938('0x1')],'defaultValue':_0xa938('0xf')},'closingMessageButton':{'type':Sequelize[_0xa938('0x1')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xa938('0x1')],'defaultValue':_0xa938('0x10')},'conditionAgreement':{'type':Sequelize[_0xa938('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xa938('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xa938('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xa938('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xa938('0x1')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xa938('0x6')]('star','thumb'),'defaultValue':_0xa938('0x11')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xa938('0xb')],'defaultValue':function(){return JSON[_0xa938('0x12')]({'items':[{'type':_0xa938('0x13'),'variable':null,'config':{'placeholder':_0xa938('0x14'),'type':_0xa938('0x15'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xa938('0x13'),'props':{'title':_0xa938('0x2'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xa938('0x16')](_0xa938('0x17'))?JSON[_0xa938('0x18')](this[_0xa938('0x16')](_0xa938('0x17'))):{};},'set':function(_0x417a2d){return this[_0xa938('0x19')]('onlineForm',JSON[_0xa938('0x12')](_0x417a2d));}},'offlineForm':{'type':Sequelize[_0xa938('0xb')],'defaultValue':function(){return JSON[_0xa938('0x12')]({'items':[{'type':_0xa938('0x13'),'props':{'title':_0xa938('0x2'),'helpText':''},'config':{'required':!![],'placeholder':_0xa938('0x2'),'type':_0xa938('0x2')},'variable':null},{'type':'textarea','config':{'placeholder':_0xa938('0x1a')},'props':{'title':_0xa938('0x1a'),'helpText':_0xa938('0x1b')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xa938('0x1c'))?JSON['parse'](this[_0xa938('0x16')](_0xa938('0x1c'))):{};},'set':function(_0x41db19){return this['setDataValue'](_0xa938('0x1c'),JSON[_0xa938('0x12')](_0x41db19));}},'token':{'type':Sequelize[_0xa938('0x1')],'defaultValue':function(){return rs[_0xa938('0x1d')]();}},'autoclose':{'type':Sequelize[_0xa938('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xa938('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xa938('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0xa938('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xa938('0x1')]},'waitingTitle':{'type':Sequelize[_0xa938('0x1')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xa938('0x1')],'defaultValue':_0xa938('0x1e')},'offlineMessageSubject':{'type':Sequelize[_0xa938('0x1')],'defaultValue':_0xa938('0x1f')},'offlineMessageBody':{'type':Sequelize[_0xa938('0x1')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xa938('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xa938('0x1')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xa938('0x1')],'defaultValue':_0xa938('0x10')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xa938('0x20')},'enableCustomerAttachment':{'type':Sequelize[_0xa938('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xa938('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0xa938('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xa938('0x1')]},'notificationTemplate':{'type':Sequelize[_0xa938('0xb')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xa938('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa938('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xa938('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xa938('0x1')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xa938('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xa938('0x1')],'defaultValue':_0xa938('0x21')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xa938('0x1')],'defaultValue':_0xa938('0x22')},'defaultTitle':{'type':Sequelize[_0xa938('0x1')]},'customerAvatar':{'type':Sequelize[_0xa938('0xb')]},'showCustomerAvatar':{'type':Sequelize[_0xa938('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xa938('0x5')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xa938('0x1')],'allowNull':![],'defaultValue':_0xa938('0x23'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xa938('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa938('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa938('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa938('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xa938('0x1')],'defaultValue':_0xa938('0x24')},'systemAvatar':{'type':Sequelize[_0xa938('0xb')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xa938('0x25')},'mandatoryDisposition':{'type':Sequelize[_0xa938('0xa')],'defaultValue':![],'comment':_0xa938('0x26'),'set':function(_0x2fba72){if(!_0x2fba72)this[_0xa938('0x19')](_0xa938('0x27'),null);this[_0xa938('0x19')](_0xa938('0x28'),_0x2fba72);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xa938('0x1')]},'vidaooTopic':{'type':Sequelize[_0xa938('0x1')],'allowNull':![],'defaultValue':_0xa938('0x29')},'vidaooNote':{'type':Sequelize[_0xa938('0x1')],'defaultValue':function(){return _0xa938('0x2a');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x9f1a=['System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','email','Agent','#011F6A','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Send','Contact\x20us','INTEGER','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Skip','Feedback','thumb','star','input','name','text','onlineForm','parse','getDataValue','setDataValue','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','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'];(function(_0x1a0620,_0x4f40c3){var _0x475abc=function(_0x276d92){while(--_0x276d92){_0x1a0620['push'](_0x1a0620['shift']());}};_0x475abc(++_0x4f40c3);}(_0x9f1a,0xfa));var _0xa9f1=function(_0x24e7ad,_0x4d1bd9){_0x24e7ad=_0x24e7ad-0x0;var _0x4aa36c=_0x9f1a[_0x24e7ad];return _0x4aa36c;};'use strict';var Sequelize=require(_0xa9f1('0x0'));var rs=require('randomstring');module[_0xa9f1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xa9f1('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xa9f1('0x2')]},'mapKey':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':_0xa9f1('0x3')},'mapKeyOffline':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':_0xa9f1('0x3')},'key':{'type':Sequelize[_0xa9f1('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':_0xa9f1('0x4')},'customerAlias':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xa9f1('0x2')],'allowNull':![],'defaultValue':_0xa9f1('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xa9f1('0x2')],'allowNull':![],'defaultValue':_0xa9f1('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xa9f1('0x6')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xa9f1('0x7')](_0xa9f1('0x8'),_0xa9f1('0x9')),'defaultValue':_0xa9f1('0x8')},'header_online':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':_0xa9f1('0xa')},'start_chat_button':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':_0xa9f1('0xb')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xa9f1('0xc')},'download_transcript':{'type':Sequelize[_0xa9f1('0x6')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xa9f1('0xd')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xa9f1('0x6')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xa9f1('0xe')]},'closingQuestion':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':_0xa9f1('0xf')},'formSubmitFailureMessage':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':_0xa9f1('0x10')},'noteTitle':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':_0xa9f1('0x11')},'placeholderMessage':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':_0xa9f1('0x12')},'closingMessage':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xa9f1('0xb')},'skipMessageButton':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':_0xa9f1('0x13')},'conditionAgreement':{'type':Sequelize[_0xa9f1('0x6')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xa9f1('0x6')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xa9f1('0x6')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':_0xa9f1('0x14')},'ratingType':{'type':Sequelize[_0xa9f1('0x7')]('star',_0xa9f1('0x15')),'defaultValue':_0xa9f1('0x16')},'ratingStarsNumber':{'type':Sequelize[_0xa9f1('0xd')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xa9f1('0xe')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xa9f1('0x17'),'variable':null,'config':{'placeholder':_0xa9f1('0x18'),'type':_0xa9f1('0x19'),'required':!![]},'props':{'title':_0xa9f1('0x18'),'helpText':''}},{'type':_0xa9f1('0x17'),'props':{'title':_0xa9f1('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xa9f1('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xa9f1('0x1a'))?JSON[_0xa9f1('0x1b')](this[_0xa9f1('0x1c')](_0xa9f1('0x1a'))):{};},'set':function(_0x1bef70){return this[_0xa9f1('0x1d')]('onlineForm',JSON[_0xa9f1('0x1e')](_0x1bef70));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xa9f1('0x17'),'props':{'title':_0xa9f1('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xa9f1('0x3')},'variable':null},{'type':_0xa9f1('0x1f'),'config':{'placeholder':_0xa9f1('0x20')},'props':{'title':'Comments','helpText':_0xa9f1('0x21')}}],'fromKey':0x0});},'get':function(){return this['getDataValue']('offlineForm')?JSON[_0xa9f1('0x1b')](this[_0xa9f1('0x1c')](_0xa9f1('0x22'))):{};},'set':function(_0x5cdeeb){return this['setDataValue'](_0xa9f1('0x22'),JSON[_0xa9f1('0x1e')](_0x5cdeeb));}},'token':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':function(){return rs[_0xa9f1('0x23')]();}},'autoclose':{'type':Sequelize[_0xa9f1('0x6')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xa9f1('0x6')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xa9f1('0x2')]},'forwardOffline':{'type':Sequelize[_0xa9f1('0x6')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xa9f1('0x2')]},'waitingTitle':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':_0xa9f1('0x24')},'waitingMessage':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':_0xa9f1('0x25')},'offlineMessageSubject':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':_0xa9f1('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0xa9f1('0x6')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xa9f1('0x27')},'skipUnmanaged':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':_0xa9f1('0x13')},'sendUnmanaged':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':_0xa9f1('0xb')},'enableCustomerAttachment':{'type':Sequelize[_0xa9f1('0x6')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xa9f1('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xa9f1('0x28');}},'notificationSound':{'type':Sequelize[_0xa9f1('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa9f1('0x6')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xa9f1('0x6')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':_0xa9f1('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0xa9f1('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':_0xa9f1('0x2a')},'verticalAlignment':{'type':Sequelize[_0xa9f1('0xd')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xa9f1('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0xa9f1('0x6')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xa9f1('0xd')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xa9f1('0x2')],'allowNull':![],'defaultValue':_0xa9f1('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xa9f1('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa9f1('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa9f1('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xa9f1('0x2c')},'systemAvatar':{'type':Sequelize[_0xa9f1('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa9f1('0xd')],'comment':_0xa9f1('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0xa9f1('0x6')],'defaultValue':![],'comment':_0xa9f1('0x2e'),'set':function(_0x3f9bae){if(!_0x3f9bae)this['setDataValue'](_0xa9f1('0x2f'),null);this[_0xa9f1('0x1d')]('mandatoryDisposition',_0x3f9bae);}},'vidaooEscalation':{'type':Sequelize[_0xa9f1('0x6')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xa9f1('0x2')]},'vidaooTopic':{'type':Sequelize[_0xa9f1('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':function(){return _0xa9f1('0x30');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xa9f1('0x6')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xa9f1('0xe')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 6f628db..971133e 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 _0xd812=['list','orderBy','priority','customerIp','cf-connecting-ip','x-forwarded-for','first','split','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','contact','messageId','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','no\x20available\x20attributes','CompanyId','send','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','attachments','offline-chat','basename','openNewInteraction','sequelize','Attachment','bulkCreate','forwardOffline','forwardOfflineAddress','service','Smtp','host','port','secure','authentication','pass','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','originalname','mimetype','mapValues','Chat','NotifyMailAccount','notifyMail','addInteraction','omit','getInteractions','fullname','internal','Tag','tag','Command','getSnippet','timezone','iftime\x20%s','interval','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','getProactiveActions','License','increment','Intervals','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','remoteAddress','replace','alignment','verticalAlignment','color','textColor','color_button','backgroundColor','addApplications','transaction','ChatApplication','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','items','fromKey','ChatOfflineMessage','Contact','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','code','error','message','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','get','ChatWebsites','UserProfileResource','destroy','end','sendStatus','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ChatWebsiteId','getDispositions','findOne','Disposition','rows','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','filename','addAvatar','agentAvatar','file','addCustomerAvatar','addSystemAvatar','systemAvatar','join','server/files/images/logos/default_logo.svg','sitepic','getLicense','custom','existsSync','root','server/files/images/logos/','download','getAvatar','isNil','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','customerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','headers','user-agent','getResult','chat','Sequelize','ValidationError','difference','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','CmContact','Contacts','DESC','Applications','account','applications'];(function(_0x57c037,_0x3485ff){var _0x205f24=function(_0x1fab8f){while(--_0x1fab8f){_0x57c037['push'](_0x57c037['shift']());}};_0x205f24(++_0x3485ff);}(_0xd812,0x8d));var _0x2d81=function(_0x509c83,_0x511882){_0x509c83=_0x509c83-0x0;var _0x534626=_0xd812[_0x509c83];return _0x534626;};'use strict';var emlformat=require(_0x2d81('0x0'));var rimraf=require(_0x2d81('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2d81('0x2'));var rp=require(_0x2d81('0x3'));var moment=require(_0x2d81('0x4'));var BPromise=require(_0x2d81('0x5'));var Mustache=require(_0x2d81('0x6'));var util=require(_0x2d81('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2d81('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2d81('0x9'));var squel=require(_0x2d81('0xa'));var crypto=require('crypto');var jsforce=require(_0x2d81('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x2d81('0xc'));var querystring=require(_0x2d81('0xd'));var Papa=require(_0x2d81('0xe'));var Redis=require(_0x2d81('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2d81('0x10'));var logger=require('../../config/logger')(_0x2d81('0x11'));var utils=require(_0x2d81('0x12'));var config=require(_0x2d81('0x13'));var licenseUtil=require(_0x2d81('0x14'));var db=require(_0x2d81('0x15'))['db'];config['redis']=_[_0x2d81('0x16')](config[_0x2d81('0x17')],{'host':_0x2d81('0x18'),'port':0x18eb});var socket=require(_0x2d81('0x19'))(new Redis(config[_0x2d81('0x17')]));require(_0x2d81('0x1a'))[_0x2d81('0x1b')](socket);var jayson=require(_0x2d81('0x1c'));var client=jayson[_0x2d81('0x1d')][_0x2d81('0x1e')]({'port':0x232c});var client9002=jayson[_0x2d81('0x1d')]['http']({'port':0x232a});var client9003=jayson[_0x2d81('0x1d')][_0x2d81('0x1e')]({'port':0x232b});var client9001=jayson['client'][_0x2d81('0x1e')]({'port':0x2329});function respondWithRpcPromise(_0x9567b8,_0x4ee9db,_0x732e06,_0x1bb846){return new BPromise(function(_0x1bb577,_0x49b2cf){var _0x12939d=_0x1bb846||client;return _0x12939d[_0x2d81('0x1f')](_0x9567b8,_0x732e06)[_0x2d81('0x20')](function(_0x363631){logger[_0x2d81('0x21')](_0x2d81('0x22'),_0x4ee9db,_0x2d81('0x23'));logger[_0x2d81('0x24')](_0x2d81('0x25'),_0x4ee9db,_0x2d81('0x23'),JSON[_0x2d81('0x26')](_0x363631));if(_0x363631['error']){if(_0x363631['error'][_0x2d81('0x27')]===0x1f4){logger['error'](_0x2d81('0x22'),_0x4ee9db,_0x363631[_0x2d81('0x28')][_0x2d81('0x29')]);return _0x49b2cf(_0x363631[_0x2d81('0x28')][_0x2d81('0x29')]);}logger['error'](_0x2d81('0x22'),_0x4ee9db,_0x363631[_0x2d81('0x28')]['message']);return _0x1bb577(_0x363631[_0x2d81('0x28')][_0x2d81('0x29')]);}else{logger[_0x2d81('0x21')]('ChatWebsite,\x20%s,\x20%s',_0x4ee9db,_0x2d81('0x23'));_0x1bb577(_0x363631['result'][_0x2d81('0x29')]);}})['catch'](function(_0x2ec6e9){logger[_0x2d81('0x28')](_0x2d81('0x22'),_0x4ee9db,_0x2ec6e9);_0x49b2cf(_0x2ec6e9);});});}function respondWithStatusCode(_0x44cfa7,_0x33bd13){_0x33bd13=_0x33bd13||0xcc;return function(_0x142927){if(_0x142927){return _0x44cfa7['sendStatus'](_0x33bd13);}return _0x44cfa7[_0x2d81('0x2a')](_0x33bd13)['end']();};}function respondWithResult(_0x103f4b,_0x36b6d9){_0x36b6d9=_0x36b6d9||0xc8;return function(_0x43e465){if(_0x43e465){return _0x103f4b[_0x2d81('0x2a')](_0x36b6d9)[_0x2d81('0x2b')](_0x43e465);}};}function respondWithFilteredResult(_0x25f2e8,_0x46155f){return function(_0xb730b9){if(_0xb730b9){var _0x55c608=typeof _0x46155f[_0x2d81('0x2c')]===_0x2d81('0x2d')&&typeof _0x46155f['limit']===_0x2d81('0x2d');var _0x57b8e7=_0xb730b9[_0x2d81('0x2e')];var _0x3b77cc=_0x55c608?0x0:_0x46155f[_0x2d81('0x2c')];var _0x2f8d2e=_0x55c608?_0xb730b9['count']:_0x46155f['offset']+_0x46155f[_0x2d81('0x2f')];var _0x413d53;if(_0x2f8d2e>=_0x57b8e7){_0x2f8d2e=_0x57b8e7;_0x413d53=0xc8;}else{_0x413d53=0xce;}_0x25f2e8[_0x2d81('0x2a')](_0x413d53);return _0x25f2e8['set'](_0x2d81('0x30'),_0x3b77cc+'-'+_0x2f8d2e+'/'+_0x57b8e7)[_0x2d81('0x2b')](_0xb730b9);}return null;};}function patchUpdates(_0x3d0214){return function(_0x2226a5){try{jsonpatch[_0x2d81('0x31')](_0x2226a5,_0x3d0214,!![]);}catch(_0xddc43e){return BPromise[_0x2d81('0x32')](_0xddc43e);}return _0x2226a5[_0x2d81('0x33')]();};}function saveUpdates(_0x445eb9,_0xa8ca5f){return function(_0x53135e){if(_0x53135e){return _0x53135e[_0x2d81('0x34')](_0x445eb9)[_0x2d81('0x20')](function(_0x51d1d9){return _0x51d1d9;});}return null;};}function removeEntity(_0x5a1d30,_0x20b785){return function(_0x8780fe){if(_0x8780fe){return _0x8780fe['destroy']()[_0x2d81('0x20')](function(){var _0x30e384=_0x8780fe[_0x2d81('0x35')]({'plain':!![]});var _0x4a5af7=_0x2d81('0x36');return db[_0x2d81('0x37')][_0x2d81('0x38')]({'where':{'type':_0x4a5af7,'resourceId':_0x30e384['id']}})[_0x2d81('0x20')](function(){return _0x8780fe;});})[_0x2d81('0x20')](function(){_0x5a1d30[_0x2d81('0x2a')](0xcc)[_0x2d81('0x39')]();});}};}function handleEntityNotFound(_0x3d4b4b,_0x35eda1){return function(_0x2778cd){if(!_0x2778cd){_0x3d4b4b[_0x2d81('0x3a')](0x194);}return _0x2778cd;};}function handleError(_0x35b796,_0x14d22a){_0x14d22a=_0x14d22a||0x1f4;return function(_0x1206ee){logger[_0x2d81('0x28')](_0x1206ee['stack']);if(_0x1206ee[_0x2d81('0x3b')]){delete _0x1206ee[_0x2d81('0x3b')];}_0x35b796['status'](_0x14d22a)['send'](_0x1206ee);};}exports[_0x2d81('0x3c')]=function(_0x503718,_0x4492f1){var _0x13a576={'include':[{'model':db[_0x2d81('0x3d')],'as':_0x2d81('0x3e')}]},_0xa5b301={},_0x3ce239={'count':0x0,'rows':[]};var _0x248dcb=_[_0x2d81('0x3f')](db[_0x2d81('0x40')][_0x2d81('0x41')],function(_0x36e712){return{'name':_0x36e712[_0x2d81('0x42')],'type':_0x36e712[_0x2d81('0x43')][_0x2d81('0x44')]};});_0xa5b301['model']=_['map'](_0x248dcb,_0x2d81('0x3b'));_0xa5b301[_0x2d81('0x45')]=_[_0x2d81('0x46')](_0x503718[_0x2d81('0x45')]);_0xa5b301['filters']=_[_0x2d81('0x47')](_0xa5b301[_0x2d81('0x48')],_0xa5b301['query']);_0x13a576[_0x2d81('0x49')]=_[_0x2d81('0x47')](_0xa5b301['model'],qs['fields'](_0x503718[_0x2d81('0x45')][_0x2d81('0x4a')]));_0x13a576[_0x2d81('0x49')]=_0x13a576['attributes'][_0x2d81('0x4b')]?_0x13a576[_0x2d81('0x49')]:_0xa5b301[_0x2d81('0x48')];if(!_0x503718[_0x2d81('0x45')][_0x2d81('0x4c')](_0x2d81('0x4d'))){_0x13a576[_0x2d81('0x2f')]=qs[_0x2d81('0x2f')](_0x503718[_0x2d81('0x45')]['limit']);_0x13a576[_0x2d81('0x2c')]=qs[_0x2d81('0x2c')](_0x503718[_0x2d81('0x45')][_0x2d81('0x2c')]);}_0x13a576[_0x2d81('0x4e')]=qs[_0x2d81('0x4f')](_0x503718[_0x2d81('0x45')][_0x2d81('0x4f')]);_0x13a576[_0x2d81('0x50')]=qs[_0x2d81('0x51')](_[_0x2d81('0x52')](_0x503718[_0x2d81('0x45')],_0xa5b301['filters']),_0x248dcb);if(_0x503718[_0x2d81('0x45')][_0x2d81('0x53')]){_0x13a576[_0x2d81('0x50')]=_['merge'](_0x13a576[_0x2d81('0x50')],{'$or':_['map'](_0x248dcb,function(_0x37d8ea){if(_0x37d8ea[_0x2d81('0x43')]!==_0x2d81('0x54')){var _0x18fe14={};_0x18fe14[_0x37d8ea[_0x2d81('0x3b')]]={'$like':'%'+_0x503718[_0x2d81('0x45')][_0x2d81('0x53')]+'%'};return _0x18fe14;}})});}_0x13a576=_[_0x2d81('0x55')]({},_0x13a576,_0x503718[_0x2d81('0x56')]);var _0x10134c={'where':_0x13a576[_0x2d81('0x50')]};return db[_0x2d81('0x40')][_0x2d81('0x2e')](_0x10134c)[_0x2d81('0x20')](function(_0x46fc13){_0x3ce239['count']=_0x46fc13;if(_0x503718[_0x2d81('0x45')][_0x2d81('0x57')]){_0x13a576[_0x2d81('0x58')]=[{'all':!![]}];}return db[_0x2d81('0x40')][_0x2d81('0x59')](_0x13a576);})[_0x2d81('0x20')](function(_0x14afd5){_0x3ce239['rows']=_0x14afd5;return _0x3ce239;})[_0x2d81('0x20')](respondWithFilteredResult(_0x4492f1,_0x13a576))['catch'](handleError(_0x4492f1,null));};exports[_0x2d81('0x5a')]=function(_0x191a2b,_0x19f54e){var _0x322798={'raw':![],'where':{'id':_0x191a2b[_0x2d81('0x5b')]['id']},'include':[{'model':db[_0x2d81('0x3d')],'as':_0x2d81('0x3e')}]},_0xe858a3={};_0xe858a3[_0x2d81('0x48')]=_[_0x2d81('0x46')](db[_0x2d81('0x40')][_0x2d81('0x41')]);_0xe858a3['query']=_[_0x2d81('0x46')](_0x191a2b[_0x2d81('0x45')]);_0xe858a3['filters']=_[_0x2d81('0x47')](_0xe858a3['model'],_0xe858a3['query']);_0x322798[_0x2d81('0x49')]=_[_0x2d81('0x47')](_0xe858a3[_0x2d81('0x48')],qs[_0x2d81('0x4a')](_0x191a2b[_0x2d81('0x45')][_0x2d81('0x4a')]));_0x322798['attributes']=_0x322798[_0x2d81('0x49')]['length']?_0x322798[_0x2d81('0x49')]:_0xe858a3['model'];if(_0x191a2b['query'][_0x2d81('0x57')]){_0x322798[_0x2d81('0x58')]=[{'all':!![]}];}_0x322798=_[_0x2d81('0x55')]({},_0x322798,_0x191a2b[_0x2d81('0x56')]);return db[_0x2d81('0x40')][_0x2d81('0x5c')](_0x322798)[_0x2d81('0x20')](handleEntityNotFound(_0x19f54e,null))[_0x2d81('0x20')](respondWithResult(_0x19f54e,null))[_0x2d81('0x5d')](handleError(_0x19f54e,null));};exports[_0x2d81('0x5e')]=function(_0x4239e1,_0x207885){return db['ChatWebsite'][_0x2d81('0x5e')](_0x4239e1[_0x2d81('0x5f')],{})[_0x2d81('0x20')](function(_0x147077){var _0x49df9f=_0x4239e1[_0x2d81('0x60')][_0x2d81('0x35')]({'plain':!![]});if(!_0x49df9f)throw new Error(_0x2d81('0x61'));if(_0x49df9f[_0x2d81('0x62')]===_0x2d81('0x60')){var _0x33c63e=_0x147077['get']({'plain':!![]});var _0x5ac0ac=_0x2d81('0x36');return db[_0x2d81('0x63')]['find']({'where':{'name':_0x5ac0ac,'userProfileId':_0x49df9f[_0x2d81('0x64')]},'raw':!![]})[_0x2d81('0x20')](function(_0x4508a){if(_0x4508a&&_0x4508a[_0x2d81('0x65')]===0x0){return db[_0x2d81('0x37')][_0x2d81('0x5e')]({'name':_0x33c63e['name'],'resourceId':_0x33c63e['id'],'type':_0x4508a[_0x2d81('0x3b')],'sectionId':_0x4508a['id']},{})[_0x2d81('0x20')](function(){return _0x147077;});}else{return _0x147077;}})[_0x2d81('0x5d')](function(_0xa28703){logger['error'](_0x2d81('0x66'),_0xa28703);throw _0xa28703;});}return _0x147077;})[_0x2d81('0x20')](respondWithResult(_0x207885,0xc9))[_0x2d81('0x5d')](handleError(_0x207885,null));};exports[_0x2d81('0x34')]=function(_0x52fb87,_0x49a959){if(_0x52fb87['body']['id']){delete _0x52fb87[_0x2d81('0x5f')]['id'];}return db[_0x2d81('0x40')]['find']({'where':{'id':_0x52fb87[_0x2d81('0x5b')]['id']},'include':[{'model':db[_0x2d81('0x3d')],'as':_0x2d81('0x3e')}]})['then'](handleEntityNotFound(_0x49a959,null))[_0x2d81('0x20')](saveUpdates(_0x52fb87[_0x2d81('0x5f')],null))[_0x2d81('0x20')](respondWithResult(_0x49a959,null))[_0x2d81('0x5d')](handleError(_0x49a959,null));};exports[_0x2d81('0x38')]=function(_0x2a2294,_0x43831d){return db[_0x2d81('0x40')]['find']({'where':{'id':_0x2a2294[_0x2d81('0x5b')]['id']}})[_0x2d81('0x20')](handleEntityNotFound(_0x43831d,null))[_0x2d81('0x20')](removeEntity(_0x43831d,null))[_0x2d81('0x5d')](handleError(_0x43831d,null));};exports[_0x2d81('0x67')]=function(_0x127c06,_0x142bdc){return db['ChatWebsite']['describe']()[_0x2d81('0x20')](respondWithResult(_0x142bdc,null))[_0x2d81('0x5d')](handleError(_0x142bdc,null));};exports['addDisposition']=function(_0x4d2a9e,_0x401e26,_0x30f3c9){if(_0x4d2a9e[_0x2d81('0x5f')]['id']){delete _0x4d2a9e['body']['id'];}return db[_0x2d81('0x40')][_0x2d81('0x5c')]({'where':{'id':_0x4d2a9e[_0x2d81('0x5b')]['id']}})[_0x2d81('0x20')](handleEntityNotFound(_0x401e26,null))[_0x2d81('0x20')](function(_0x3e4274){if(_0x3e4274){_0x4d2a9e[_0x2d81('0x5f')][_0x2d81('0x68')]=_0x3e4274['id'];return db['Disposition']['create'](_0x4d2a9e[_0x2d81('0x5f')]);}})[_0x2d81('0x20')](respondWithResult(_0x401e26,null))['catch'](handleError(_0x401e26,null));};exports[_0x2d81('0x69')]=function(_0x28e698,_0x2c928d,_0x46bf71){var _0x18bb56={'raw':![],'where':{}};var _0x41bdbb={};var _0x30ddc2={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x2d81('0x6a')]({'where':{'id':_0x28e698[_0x2d81('0x5b')]['id']}})[_0x2d81('0x20')](handleEntityNotFound(_0x2c928d,null))[_0x2d81('0x20')](function(_0x5c1058){if(_0x5c1058){_0x41bdbb[_0x2d81('0x48')]=_[_0x2d81('0x46')](db[_0x2d81('0x6b')][_0x2d81('0x41')]);_0x41bdbb['query']=_['keys'](_0x28e698['query']);_0x41bdbb[_0x2d81('0x51')]=_[_0x2d81('0x47')](_0x41bdbb[_0x2d81('0x48')],_0x41bdbb[_0x2d81('0x45')]);_0x18bb56['attributes']=_[_0x2d81('0x47')](_0x41bdbb[_0x2d81('0x48')],qs[_0x2d81('0x4a')](_0x28e698['query'][_0x2d81('0x4a')]));_0x18bb56[_0x2d81('0x49')]=_0x18bb56[_0x2d81('0x49')]['length']?_0x18bb56[_0x2d81('0x49')]:_0x41bdbb['model'];if(!_0x28e698[_0x2d81('0x45')][_0x2d81('0x4c')](_0x2d81('0x4d'))){_0x18bb56[_0x2d81('0x2f')]=qs[_0x2d81('0x2f')](_0x28e698[_0x2d81('0x45')][_0x2d81('0x2f')]);_0x18bb56['offset']=qs[_0x2d81('0x2c')](_0x28e698[_0x2d81('0x45')][_0x2d81('0x2c')]);}_0x18bb56[_0x2d81('0x4e')]=qs[_0x2d81('0x4f')](_0x28e698[_0x2d81('0x45')][_0x2d81('0x4f')]);_0x18bb56[_0x2d81('0x50')]=qs[_0x2d81('0x51')](_['pick'](_0x28e698[_0x2d81('0x45')],_0x41bdbb['filters']));_0x18bb56[_0x2d81('0x50')][_0x2d81('0x68')]=_0x5c1058['id'];if(_0x28e698[_0x2d81('0x45')][_0x2d81('0x53')]){_0x18bb56[_0x2d81('0x50')]=_[_0x2d81('0x55')](_0x18bb56[_0x2d81('0x50')],{'$or':_[_0x2d81('0x3f')](_0x18bb56[_0x2d81('0x49')],function(_0x2833f4){var _0x4dad06={};_0x4dad06[_0x2833f4]={'$like':'%'+_0x28e698[_0x2d81('0x45')][_0x2d81('0x53')]+'%'};return _0x4dad06;})});}_0x18bb56=_[_0x2d81('0x55')]({},_0x18bb56,_0x28e698[_0x2d81('0x56')]);return db[_0x2d81('0x6b')][_0x2d81('0x2e')]({'where':_0x18bb56[_0x2d81('0x50')]})[_0x2d81('0x20')](function(_0x22fbef){_0x30ddc2[_0x2d81('0x2e')]=_0x22fbef;if(_0x28e698[_0x2d81('0x45')]['includeAll']){_0x18bb56[_0x2d81('0x58')]=[{'all':!![]}];}return db[_0x2d81('0x6b')][_0x2d81('0x59')](_0x18bb56);})[_0x2d81('0x20')](function(_0x25597a){_0x30ddc2[_0x2d81('0x6c')]=_0x25597a;return _0x30ddc2;});}})[_0x2d81('0x20')](respondWithFilteredResult(_0x2c928d,_0x18bb56))[_0x2d81('0x5d')](handleError(_0x2c928d,null));};exports[_0x2d81('0x6d')]=function(_0xc07e08,_0x1559f7,_0x248e38){return db['ChatWebsite'][_0x2d81('0x5c')]({'where':{'id':_0xc07e08[_0x2d81('0x5b')]['id']}})[_0x2d81('0x20')](handleEntityNotFound(_0x1559f7,null))[_0x2d81('0x20')](function(_0x37b49c){if(_0x37b49c){return _0x37b49c[_0x2d81('0x6d')](_0xc07e08[_0x2d81('0x45')][_0x2d81('0x6e')]);}})[_0x2d81('0x20')](respondWithStatusCode(_0x1559f7,null))[_0x2d81('0x5d')](handleError(_0x1559f7,null));};exports[_0x2d81('0x6f')]=function(_0x8fe6d6,_0x1b8a6e,_0x4cc14b){if(_0x8fe6d6[_0x2d81('0x5f')]['id']){delete _0x8fe6d6['body']['id'];}return db[_0x2d81('0x40')][_0x2d81('0x5c')]({'where':{'id':_0x8fe6d6['params']['id']}})[_0x2d81('0x20')](handleEntityNotFound(_0x1b8a6e,null))['then'](function(_0x43f448){if(_0x43f448){_0x8fe6d6[_0x2d81('0x5f')]['ChatWebsiteId']=_0x43f448['id'];return db['CannedAnswer']['create'](_0x8fe6d6[_0x2d81('0x5f')]);}})['then'](respondWithResult(_0x1b8a6e,null))[_0x2d81('0x5d')](handleError(_0x1b8a6e,null));};exports[_0x2d81('0x70')]=function(_0xb72d9e,_0x5e39c0,_0x29d2f7){var _0x2496bb={'raw':![],'where':{}};var _0xea4c47={};var _0x5df3e4={'count':0x0,'rows':[]};return db[_0x2d81('0x40')]['findOne']({'where':{'id':_0xb72d9e[_0x2d81('0x5b')]['id']}})[_0x2d81('0x20')](handleEntityNotFound(_0x5e39c0,null))[_0x2d81('0x20')](function(_0x156556){if(_0x156556){_0xea4c47[_0x2d81('0x48')]=_['keys'](db['CannedAnswer'][_0x2d81('0x41')]);_0xea4c47[_0x2d81('0x45')]=_[_0x2d81('0x46')](_0xb72d9e[_0x2d81('0x45')]);_0xea4c47['filters']=_[_0x2d81('0x47')](_0xea4c47[_0x2d81('0x48')],_0xea4c47[_0x2d81('0x45')]);_0x2496bb[_0x2d81('0x49')]=_['intersection'](_0xea4c47[_0x2d81('0x48')],qs['fields'](_0xb72d9e['query'][_0x2d81('0x4a')]));_0x2496bb['attributes']=_0x2496bb[_0x2d81('0x49')][_0x2d81('0x4b')]?_0x2496bb[_0x2d81('0x49')]:_0xea4c47[_0x2d81('0x48')];if(!_0xb72d9e[_0x2d81('0x45')][_0x2d81('0x4c')](_0x2d81('0x4d'))){_0x2496bb['limit']=qs[_0x2d81('0x2f')](_0xb72d9e[_0x2d81('0x45')]['limit']);_0x2496bb[_0x2d81('0x2c')]=qs[_0x2d81('0x2c')](_0xb72d9e[_0x2d81('0x45')]['offset']);}_0x2496bb[_0x2d81('0x4e')]=qs[_0x2d81('0x4f')](_0xb72d9e[_0x2d81('0x45')][_0x2d81('0x4f')]);_0x2496bb[_0x2d81('0x50')]=qs[_0x2d81('0x51')](_[_0x2d81('0x52')](_0xb72d9e[_0x2d81('0x45')],_0xea4c47[_0x2d81('0x51')]));_0x2496bb[_0x2d81('0x50')][_0x2d81('0x68')]=_0x156556['id'];if(_0xb72d9e[_0x2d81('0x45')][_0x2d81('0x53')]){_0x2496bb[_0x2d81('0x50')]=_['merge'](_0x2496bb[_0x2d81('0x50')],{'$or':_['map'](_0x2496bb['attributes'],function(_0x46b8bc){var _0x45a61d={};_0x45a61d[_0x46b8bc]={'$like':'%'+_0xb72d9e[_0x2d81('0x45')][_0x2d81('0x53')]+'%'};return _0x45a61d;})});}_0x2496bb=_[_0x2d81('0x55')]({},_0x2496bb,_0xb72d9e['options']);return db[_0x2d81('0x71')][_0x2d81('0x2e')]({'where':_0x2496bb[_0x2d81('0x50')]})[_0x2d81('0x20')](function(_0x495583){_0x5df3e4[_0x2d81('0x2e')]=_0x495583;if(_0xb72d9e['query'][_0x2d81('0x57')]){_0x2496bb['include']=[{'all':!![]}];}return db[_0x2d81('0x71')][_0x2d81('0x59')](_0x2496bb);})[_0x2d81('0x20')](function(_0x135c04){_0x5df3e4['rows']=_0x135c04;return _0x5df3e4;});}})[_0x2d81('0x20')](respondWithFilteredResult(_0x5e39c0,_0x2496bb))[_0x2d81('0x5d')](handleError(_0x5e39c0,null));};exports[_0x2d81('0x72')]=function(_0x3ca376,_0x5a0095,_0x53e733){return db[_0x2d81('0x40')]['find']({'where':{'id':_0x3ca376[_0x2d81('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5a0095,null))[_0x2d81('0x20')](function(_0x5418fe){if(_0x5418fe){return _0x5418fe[_0x2d81('0x72')](_0x3ca376[_0x2d81('0x45')][_0x2d81('0x6e')]);}})[_0x2d81('0x20')](respondWithStatusCode(_0x5a0095,null))[_0x2d81('0x5d')](handleError(_0x5a0095,null));};exports['addLogo']=function(_0x1ef5fc,_0x5236d9,_0x72400f){_0x1ef5fc[_0x2d81('0x5f')]['sitepic']=_0x1ef5fc['file'][_0x2d81('0x73')];return db[_0x2d81('0x40')][_0x2d81('0x5c')]({'where':{'id':_0x1ef5fc[_0x2d81('0x5b')]['id']}})[_0x2d81('0x20')](handleEntityNotFound(_0x5236d9,null))[_0x2d81('0x20')](saveUpdates(_0x1ef5fc['body'],null))[_0x2d81('0x20')](respondWithResult(_0x5236d9,null))[_0x2d81('0x5d')](handleError(_0x5236d9,null));};exports[_0x2d81('0x74')]=function(_0x4ca3fd,_0x154164,_0x3400a4){_0x4ca3fd[_0x2d81('0x5f')][_0x2d81('0x75')]=_0x4ca3fd[_0x2d81('0x76')]['filename'];return db[_0x2d81('0x40')][_0x2d81('0x5c')]({'where':{'id':_0x4ca3fd[_0x2d81('0x5b')]['id']}})[_0x2d81('0x20')](handleEntityNotFound(_0x154164,null))[_0x2d81('0x20')](saveUpdates(_0x4ca3fd[_0x2d81('0x5f')],null))['then'](respondWithResult(_0x154164,null))[_0x2d81('0x5d')](handleError(_0x154164,null));};exports[_0x2d81('0x77')]=function(_0x289aff,_0x56075d,_0x17071e){_0x289aff[_0x2d81('0x5f')]['customerAvatar']=_0x289aff[_0x2d81('0x76')]['filename'];return db['ChatWebsite']['find']({'where':{'id':_0x289aff['params']['id']}})[_0x2d81('0x20')](handleEntityNotFound(_0x56075d,null))[_0x2d81('0x20')](saveUpdates(_0x289aff[_0x2d81('0x5f')],null))['then'](respondWithResult(_0x56075d,null))[_0x2d81('0x5d')](handleError(_0x56075d,null));};exports[_0x2d81('0x78')]=function(_0x8020d0,_0x34e90a,_0x3f4f13){_0x8020d0[_0x2d81('0x5f')][_0x2d81('0x79')]=_0x8020d0[_0x2d81('0x76')][_0x2d81('0x73')];return db[_0x2d81('0x40')]['find']({'where':{'id':_0x8020d0['params']['id']}})['then'](handleEntityNotFound(_0x34e90a,null))[_0x2d81('0x20')](saveUpdates(_0x8020d0[_0x2d81('0x5f')],null))['then'](respondWithResult(_0x34e90a,null))[_0x2d81('0x5d')](handleError(_0x34e90a,null));};exports['getLogo']=function(_0x1ddbc2,_0x301737,_0x3c100f){var _0x3bd0a2=path[_0x2d81('0x7a')](config['root'],_0x2d81('0x7b'));var _0x2564b6={'where':{'id':_0x1ddbc2[_0x2d81('0x5b')]['id']},'attributes':['id',_0x2d81('0x7c')],'raw':!![]};var _0x60629=![];return require(_0x2d81('0x14'))[_0x2d81('0x7d')]()[_0x2d81('0x20')](function(_0x186b53){if(_0x186b53){_0x60629=_0x186b53[_0x2d81('0x7e')];}})[_0x2d81('0x20')](function(){return db[_0x2d81('0x40')]['find'](_0x2564b6);})[_0x2d81('0x20')](handleEntityNotFound(_0x301737,null))[_0x2d81('0x20')](function(_0x2ec360){if(_0x2ec360){if(!_['isNil'](_0x2ec360[_0x2d81('0x7c')])){if(fs[_0x2d81('0x7f')](path[_0x2d81('0x7a')](config[_0x2d81('0x80')],_0x2d81('0x81'),_0x2ec360[_0x2d81('0x7c')]))&&_0x60629){_0x3bd0a2=path[_0x2d81('0x7a')](config[_0x2d81('0x80')],_0x2d81('0x81'),_0x2ec360['sitepic']);}}return _0x301737[_0x2d81('0x82')](_0x3bd0a2);}})['catch'](handleError(_0x301737,null));};exports[_0x2d81('0x83')]=function(_0x242baa,_0x42fce3,_0x307fab){var _0x20cf9a=path[_0x2d81('0x7a')](config['root'],'server/files/images/avatars/default_avatar.png');var _0x2a6633={'where':{'id':_0x242baa['params']['id']},'attributes':['id',_0x2d81('0x75')],'raw':!![]};return db['ChatWebsite'][_0x2d81('0x5c')](_0x2a6633)[_0x2d81('0x20')](handleEntityNotFound(_0x42fce3,null))['then'](function(_0x4a7bba){if(_0x4a7bba){if(!_[_0x2d81('0x84')](_0x4a7bba[_0x2d81('0x75')])){if(fs[_0x2d81('0x7f')](path[_0x2d81('0x7a')](config['root'],_0x2d81('0x85'),_0x4a7bba[_0x2d81('0x75')]))){_0x20cf9a=path['join'](config[_0x2d81('0x80')],_0x2d81('0x85'),_0x4a7bba[_0x2d81('0x75')]);}}return _0x42fce3[_0x2d81('0x82')](_0x20cf9a);}})[_0x2d81('0x5d')](handleError(_0x42fce3,null));};exports[_0x2d81('0x86')]=function(_0x5c7ad1,_0x2c1849,_0x35c807){var _0x3441bf=path['join'](config[_0x2d81('0x80')],_0x2d81('0x87'));var _0x27d466={'where':{'id':_0x5c7ad1[_0x2d81('0x5b')]['id']},'attributes':['id','customerAvatar',_0x2d81('0x88')],'raw':!![]};return db[_0x2d81('0x40')][_0x2d81('0x5c')](_0x27d466)[_0x2d81('0x20')](handleEntityNotFound(_0x2c1849,null))[_0x2d81('0x20')](function(_0x11e75b){if(_0x11e75b){if(!_[_0x2d81('0x84')](_0x11e75b['customerAvatar'])){if(fs[_0x2d81('0x7f')](path[_0x2d81('0x7a')](config['root'],_0x2d81('0x85'),_0x11e75b[_0x2d81('0x89')]))&&_0x11e75b[_0x2d81('0x88')]){_0x3441bf=path['join'](config[_0x2d81('0x80')],'server/files/images/avatars/',_0x11e75b[_0x2d81('0x89')]);}}return _0x2c1849[_0x2d81('0x82')](_0x3441bf);}})[_0x2d81('0x5d')](handleError(_0x2c1849,null));};exports[_0x2d81('0x8a')]=function(_0x42e7ed,_0x501c9b,_0xb6445c){var _0x481093=path[_0x2d81('0x7a')](config[_0x2d81('0x80')],_0x2d81('0x8b'));var _0x58cced={'where':{'id':_0x42e7ed['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x2d81('0x40')][_0x2d81('0x5c')](_0x58cced)[_0x2d81('0x20')](handleEntityNotFound(_0x501c9b,null))['then'](function(_0x3759b4){if(_0x3759b4){if(!_[_0x2d81('0x84')](_0x3759b4[_0x2d81('0x79')])){if(fs[_0x2d81('0x7f')](path[_0x2d81('0x7a')](config[_0x2d81('0x80')],'server/files/images/avatars/',_0x3759b4[_0x2d81('0x79')]))){_0x481093=path[_0x2d81('0x7a')](config['root'],'server/files/images/avatars/',_0x3759b4[_0x2d81('0x79')]);}}return _0x501c9b[_0x2d81('0x82')](_0x481093);}})[_0x2d81('0x5d')](handleError(_0x501c9b,null));};exports[_0x2d81('0x8c')]=function(_0x10737a,_0x4d4996,_0x25739e){var _0xb16cee=require(_0x2d81('0x8d'));var _0x183cd0=new _0xb16cee();var _0x588d67=_0x183cd0['setUA'](_0x10737a[_0x2d81('0x8e')][_0x2d81('0x8f')])[_0x2d81('0x90')]();var _0x2aa0a1={'body':_0x10737a['body'],'channel':_0x2d81('0x91')};var _0x535e1d=[];var _0x10194b=[];var _0x4b8cc9={};var _0x3e9a96=![];return db['CmContact'][_0x2d81('0x67')]()[_0x2d81('0x20')](function(_0x3cb9a8){if(!_0x3cb9a8){throw new db[(_0x2d81('0x92'))][(_0x2d81('0x93'))]('no\x20available\x20attributes');}_0x535e1d=_[_0x2d81('0x94')](_['keys'](_0x3cb9a8),[_0x2d81('0x95'),_0x2d81('0x96')]);_0x10194b=_['difference'](_[_0x2d81('0x46')](_0x3cb9a8),[_0x2d81('0x95'),_0x2d81('0x96'),'CompanyId',_0x2d81('0x97')]);if(_0x10737a[_0x2d81('0x5f')]['id']){delete _0x10737a['body']['id'];}if(_[_0x2d81('0x84')](_0x10737a[_0x2d81('0x5f')][_0x2d81('0x98')])){throw new db[(_0x2d81('0x92'))]['ValidationError'](_0x2d81('0x99'));}if(_['isNil'](_0x10737a[_0x2d81('0x5f')][_0x2d81('0x5f')])||_0x10737a[_0x2d81('0x5f')]['body']===''){throw new db[(_0x2d81('0x92'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x2d81('0x84')](_0x10737a[_0x2d81('0x5f')]['mapKey'])){throw new db['Sequelize']['ValidationError'](_0x2d81('0x9a')+_0x10194b);}if(!_['includes'](_0x10194b,_0x10737a[_0x2d81('0x5f')][_0x2d81('0x9b')])){throw new db[(_0x2d81('0x92'))][(_0x2d81('0x93'))](_0x2d81('0x9c')+_0x10194b);}_0x4b8cc9[_0x10737a[_0x2d81('0x5f')][_0x2d81('0x9b')]]=_0x10737a[_0x2d81('0x5f')][_0x2d81('0x98')];})[_0x2d81('0x20')](function(){return db[_0x2d81('0x40')][_0x2d81('0x5c')]({'where':{'id':_0x10737a[_0x2d81('0x5b')]['id']},'include':[{'model':db['CmList'],'as':_0x2d81('0x9d'),'include':[{'model':db[_0x2d81('0x9e')],'as':_0x2d81('0x9f'),'where':_0x4b8cc9,'limit':0x1,'order':[[_0x2d81('0x96'),_0x2d81('0xa0')]]}]},{'model':db['ChatApplication'],'as':_0x2d81('0xa1')}]});})['then'](handleEntityNotFound(_0x4d4996,null))[_0x2d81('0x20')](function(_0x5b78bd){if(_0x5b78bd&&_0x5b78bd[_0x2d81('0x9d')]){_0x2aa0a1[_0x2d81('0xa2')]=_0x5b78bd;_0x2aa0a1[_0x2d81('0xa3')]=_0x5b78bd['Applications'];_0x2aa0a1[_0x2d81('0xa4')]=_0x5b78bd[_0x2d81('0x9d')];_0x2aa0a1[_0x2d81('0xa3')]=_[_0x2d81('0xa5')](_0x2aa0a1[_0x2d81('0xa3')],[_0x2d81('0xa6')],['asc']);if(_0x2aa0a1[_0x2d81('0xa2')]['Applications']){delete _0x2aa0a1[_0x2d81('0xa2')][_0x2d81('0xa1')];}if(_0x2aa0a1[_0x2d81('0xa2')][_0x2d81('0x9d')]&&_0x2aa0a1[_0x2d81('0xa2')]['List'][_0x2d81('0x9f')][_0x2d81('0x4b')]){return _0x2aa0a1[_0x2d81('0xa2')][_0x2d81('0x9d')]['Contacts'][0x0];}var _0x4afd09=_[_0x2d81('0x16')](_0x10737a[_0x2d81('0x5f')],{'firstName':_0x10737a['body'][_0x2d81('0x98')],'ListId':_0x5b78bd[_0x2d81('0x97')]});_0x4afd09[_0x10737a[_0x2d81('0x5f')][_0x2d81('0x9b')]]=_0x10737a[_0x2d81('0x5f')][_0x2d81('0x98')];return db[_0x2d81('0x9e')]['create'](_0x4afd09,{'fields':_0x535e1d,'raw':!![]});}})['then'](handleEntityNotFound(_0x4d4996,null))[_0x2d81('0x20')](function(_0x300cf0){_0x2aa0a1['contact']=_0x300cf0;var _0x34c5d9=_0x10737a['body'][_0x2d81('0xa7')];if(_0x10737a[_0x2d81('0x8e')]['cf-connecting-ip']){_0x34c5d9=_0x10737a[_0x2d81('0x8e')][_0x2d81('0xa8')];}else if(_0x10737a['headers'][_0x2d81('0xa9')]){_0x34c5d9=_[_0x2d81('0xaa')](_0x10737a[_0x2d81('0x8e')][_0x2d81('0xa9')][_0x2d81('0xab')](','));}if(_0x300cf0){var _0x53319c={'ContactId':_0x300cf0['id'],'ChatWebsiteId':_0x10737a[_0x2d81('0x5b')]['id'],'from':(_0x300cf0['firstName']||'')+'\x20'+(_0x300cf0[_0x2d81('0xac')]||''),'customerIp':_0x34c5d9,'customerPort':_0x10737a[_0x2d81('0x8e')][_0x2d81('0xad')]?_0x10737a[_0x2d81('0x8e')]['x-real-port']:null,'referer':_0x10737a[_0x2d81('0x5f')][_0x2d81('0xae')],'browserName':_0x588d67['browser'][_0x2d81('0x3b')]&&_0x588d67[_0x2d81('0xaf')][_0x2d81('0xb0')]?util[_0x2d81('0xb1')](_0x2d81('0xb2'),_0x588d67[_0x2d81('0xaf')]['name'],_0x588d67['browser'][_0x2d81('0xb0')]):_0x2d81('0xb3'),'browserVersion':_0x588d67[_0x2d81('0xaf')][_0x2d81('0xb0')]||_0x2d81('0xb3'),'osName':util[_0x2d81('0xb1')](_0x2d81('0xb2'),_0x588d67['os'][_0x2d81('0x3b')],_0x588d67['os'][_0x2d81('0xb0')]),'osVersion':_0x588d67['os'][_0x2d81('0xb0')],'deviceModel':_0x588d67[_0x2d81('0xb4')]['model']&&_0x588d67[_0x2d81('0xb4')]['vendor']?util[_0x2d81('0xb1')]('%s\x20%s\x20%s',_0x588d67[_0x2d81('0xb4')][_0x2d81('0x48')],_0x588d67[_0x2d81('0xb4')][_0x2d81('0xb5')],_0x588d67[_0x2d81('0xb4')]['type']):null,'deviceVendor':_0x588d67[_0x2d81('0xb4')][_0x2d81('0xb5')],'deviceType':_0x588d67['device'][_0x2d81('0x43')],'formData':JSON[_0x2d81('0x26')](_0x10737a[_0x2d81('0x5f')])};var _0x5cb44e={'ChatWebsiteId':_0x10737a[_0x2d81('0x5b')]['id'],'closed':![]};if(_0x10737a[_0x2d81('0x5f')][_0x2d81('0xb6')]){_0x5cb44e[_0x2d81('0xb6')]=_0x10737a[_0x2d81('0x5f')][_0x2d81('0xb6')];return db[_0x2d81('0xb7')][_0x2d81('0x5c')]({'where':_0x5cb44e})[_0x2d81('0x20')](function(_0x3570bc){if(_0x3570bc){return[_0x3570bc,![]];}_0x53319c['threadId']=_0x10737a[_0x2d81('0x5f')]['threadId'];_0x53319c[_0x2d81('0xb8')]=_0x10737a[_0x2d81('0x5f')][_0x2d81('0xb8')];return db[_0x2d81('0xb7')][_0x2d81('0x5e')](_0x53319c)[_0x2d81('0x20')](function(_0x5845c3){return[_0x5845c3,!![]];});});}_0x5cb44e[_0x2d81('0xb9')]=_0x300cf0['id'];if(_0x10737a[_0x2d81('0x5f')]['interaction']&&_0x10737a[_0x2d81('0x5f')]['interaction']['id']){_0x5cb44e['id']=_0x10737a[_0x2d81('0x5f')][_0x2d81('0xba')]['id'];return db[_0x2d81('0xb7')]['find']({'where':_0x5cb44e})[_0x2d81('0x20')](function(_0x4c005f){if(_0x4c005f){return[_0x4c005f,![]];}return db['ChatInteraction'][_0x2d81('0x5e')](_0x53319c)['then'](function(_0xd566ed){return[_0xd566ed,!![]];});});}return db[_0x2d81('0xb7')]['create'](_0x53319c)[_0x2d81('0x20')](function(_0x50aaf3){return[_0x50aaf3,!![]];});}})[_0x2d81('0xbb')](function(_0x93928e,_0x5efee7){if(_0x93928e){_0x3e9a96=_0x5efee7;if(!_0x5efee7){var _0x226409={'from':(_0x2aa0a1[_0x2d81('0xbc')]['firstName']||'')+'\x20'+(_0x2aa0a1[_0x2d81('0xbc')]['lastName']||'')};if(_0x10737a[_0x2d81('0x5f')][_0x2d81('0xb6')]&&_0x10737a[_0x2d81('0x5f')][_0x2d81('0xbd')]&&_0x10737a[_0x2d81('0x5f')]['threadId']!=_0x10737a['body'][_0x2d81('0xbd')]){_0x226409[_0x2d81('0xb6')]=_0x10737a[_0x2d81('0x5f')][_0x2d81('0xbd')];}return _0x93928e[_0x2d81('0x34')](_0x226409);}else{return _0x93928e;}}})['then'](function(_0x36bc01){_0x2aa0a1[_0x2d81('0xba')]=_0x36bc01[_0x2d81('0x35')]({'plain':!![]});_0x2aa0a1['interaction']['created']=_0x3e9a96;if(_0x2aa0a1[_0x2d81('0xba')]['created']){if(_0x2aa0a1[_0x2d81('0xa2')]['autoclose']){_0x2aa0a1[_0x2d81('0xa3')][_0x2d81('0xbe')]({'id':0x0,'priority':_0x2aa0a1[_0x2d81('0xa3')][_0x2d81('0x4b')]+0x1,'app':_0x2d81('0xbf'),'appdata':_0x2d81('0xc0'),'interval':_0x2d81('0xc1')});}}return db['ChatMessage'][_0x2d81('0x5e')]({'body':_0x10737a[_0x2d81('0x5f')]['body'],'ChatWebsiteId':_0x10737a[_0x2d81('0x5b')]['id'],'ChatInteractionId':_0x36bc01['id'],'direction':'in','ContactId':_0x2aa0a1[_0x2d81('0xbc')]['id'],'AttachmentId':_0x10737a['body'][_0x2d81('0xc2')]});})[_0x2d81('0x20')](function(_0x1a71a9){_0x2aa0a1[_0x2d81('0x29')]=_0x1a71a9;if(_0x2aa0a1[_0x2d81('0xba')][_0x2d81('0xc3')]){return db[_0x2d81('0xc4')][_0x2d81('0x5c')]({'attributes':['id',_0x2d81('0x3b')],'where':{'id':_0x2aa0a1['interaction'][_0x2d81('0xc3')]}})[_0x2d81('0x20')](function(_0x3a7b44){if(_0x3a7b44){_0x2aa0a1[_0x2d81('0xa3')]['unshift']({'id':0x0,'priority':0x0,'app':_0x2d81('0xc5'),'appdata':_0x3a7b44[_0x2d81('0x3b')]+','+(_0x2aa0a1[_0x2d81('0xa2')][_0x2d81('0xc6')]||0xa),'interval':'*,*,*,*'});_0x2aa0a1[_0x2d81('0xc7')]=!![];}return respondWithRpcPromise(_0x2d81('0xc8'),_0x2d81('0xc9'),_0x2aa0a1);});}return respondWithRpcPromise('Start',_0x2d81('0xc9'),_0x2aa0a1);})[_0x2d81('0x20')](function(_0xc41ded){respondWithRpcPromise('EventManager',_0x2d81('0xca'),{'event':'notify','message':_0xc41ded},client9002);return _0xc41ded;})[_0x2d81('0x20')](respondWithResult(_0x4d4996,null))[_0x2d81('0x5d')](handleError(_0x4d4996,null));};exports[_0x2d81('0xcb')]=function(_0x3a537a,_0x4d6664,_0x546771){var _0x3d1601,_0x33241c,_0x1bdf4a;var _0x3a6124=[];var _0x2c6104=[];var _0x5becae={};var _0x421d5b=_0x3a537a[_0x2d81('0xcc')]||[];var _0x2e71e2=[];var _0x33f357;return db[_0x2d81('0x9e')][_0x2d81('0x67')]()[_0x2d81('0x20')](function(_0x2ae3b9){if(!_0x2ae3b9){throw new db[(_0x2d81('0x92'))][(_0x2d81('0x93'))](_0x2d81('0xcd'));}_0x2c6104=_[_0x2d81('0x94')](_[_0x2d81('0x46')](_0x2ae3b9),[_0x2d81('0x95'),_0x2d81('0x96')]);_0x3a6124=_[_0x2d81('0x94')](_['keys'](_0x2ae3b9),['createdAt',_0x2d81('0x96'),_0x2d81('0xce'),'ListId']);if(_0x3a537a['body']['id']){delete _0x3a537a[_0x2d81('0x5f')]['id'];}if(_[_0x2d81('0x84')](_0x3a537a['body']['from'])){throw _0x4d6664[_0x2d81('0x2a')](0x1f4)[_0x2d81('0xcf')](new db[(_0x2d81('0x92'))][(_0x2d81('0x93'))](_0x2d81('0x99')));}if(_['isNil'](_0x3a537a[_0x2d81('0x5f')]['body'])||_0x3a537a['body'][_0x2d81('0x5f')]===''){throw _0x4d6664[_0x2d81('0x2a')](0x1f4)[_0x2d81('0xcf')](new db[(_0x2d81('0x92'))]['ValidationError'](_0x2d81('0xd0')));}if(_[_0x2d81('0x84')](_0x3a537a['body']['mapKeyOffline'])){throw _0x4d6664[_0x2d81('0x2a')](0x1f4)[_0x2d81('0xcf')](new db[(_0x2d81('0x92'))][(_0x2d81('0x93'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3a6124));}if(!_[_0x2d81('0xd1')](_0x3a6124,_0x3a537a[_0x2d81('0x5f')][_0x2d81('0xd2')])){throw _0x4d6664[_0x2d81('0x2a')](0x1f4)[_0x2d81('0xcf')](new db[(_0x2d81('0x92'))]['ValidationError'](_0x2d81('0xd3')+_0x3a6124));}_0x5becae[_0x3a537a[_0x2d81('0x5f')][_0x2d81('0xd2')]]=_0x3a537a[_0x2d81('0x5f')][_0x2d81('0x98')];})['then'](function(){return db[_0x2d81('0x40')][_0x2d81('0x5c')]({'where':{'id':_0x3a537a[_0x2d81('0x5b')]['id']},'include':[{'model':db[_0x2d81('0xd4')],'as':'List'},{'model':db[_0x2d81('0xd5')],'as':_0x2d81('0xd5')}]});})[_0x2d81('0x20')](handleEntityNotFound(_0x4d6664,null))[_0x2d81('0x20')](function(_0x45cf6){if(_0x45cf6&&_0x45cf6['List']){_0x33241c=_0x45cf6;var _0x53d91=_['defaults'](_0x3a537a['body'],{'firstName':_0x3a537a[_0x2d81('0x5f')][_0x2d81('0x98')],'phone':_0x3a537a[_0x2d81('0x5f')]['from'],'ListId':_0x45cf6[_0x2d81('0x97')]});_0x53d91[_0x3a537a[_0x2d81('0x5f')]['mapKeyOffline']]=_0x3a537a[_0x2d81('0x5f')][_0x2d81('0x98')];return db[_0x2d81('0x9e')][_0x2d81('0xd6')]({'where':_0x5becae,'defaults':_0x53d91});}})[_0x2d81('0xbb')](function(_0x545b1d){if(_0x545b1d){_0x1bdf4a=_0x545b1d;var _0x32b3c2=fs[_0x2d81('0xd7')](path['join'](config[_0x2d81('0x80')],_0x2d81('0xd8')),_0x2d81('0xd9'));var _0x21be80=ejs[_0x2d81('0xda')](_0x32b3c2,{'body':_[_0x2d81('0xdb')](_0x3a537a[_0x2d81('0x5f')][_0x2d81('0x5f')]),'bodyTitle':_0x33241c['offlineMessageBody']});return db['ChatOfflineMessage'][_0x2d81('0x5e')]({'body':_0x21be80,'ContactId':_0x545b1d['id'],'ChatWebsiteId':_0x33241c['id']});}})[_0x2d81('0x20')](function(_0x26983c){_0x33f357=_0x26983c;if(_0x421d5b[_0x2d81('0x4b')]){var _0x49ea93=_0x421d5b[_0x2d81('0x3f')](function(_0x456ca6){return{'name':_0x456ca6['originalname'],'basename':_0x456ca6[_0x2d81('0x73')],'type':_0x456ca6['mimetype'],'ChatOfflineMessageId':_0x26983c['id']};});_0x2e71e2=_0x49ea93[_0x2d81('0x3f')](_0x5542fb=>{var _0x2c9011={'filename':_0x5542fb[_0x2d81('0x3b')],'path':path[_0x2d81('0x7a')](config[_0x2d81('0x80')],'server',_0x2d81('0xcc'),_0x2d81('0xdc'),_0x2d81('0xdd'),_0x5542fb[_0x2d81('0xde')])};return _0x2c9011;});if(!_0x33241c[_0x2d81('0xdf')]){return db[_0x2d81('0xe0')]['transaction'](function(_0x54214d){return db[_0x2d81('0xe1')][_0x2d81('0xe2')](_0x49ea93,{'transaction':_0x54214d});});}}})[_0x2d81('0x20')](function(){if(_0x33f357){_0x3d1601=_0x33f357;return db[_0x2d81('0xd5')][_0x2d81('0x6a')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}})[_0x2d81('0x20')](function(_0x5dc144){if(_0x5dc144&&_0x5dc144['Smtp']&&_0x33241c[_0x2d81('0xe3')]&&_0x33241c[_0x2d81('0xe4')]){var _0x36bb6a={'tls':{'rejectUnauthorized':![]}};if(_0x5dc144['Smtp'][_0x2d81('0xe5')]){_0x36bb6a[_0x2d81('0xe5')]=_0x5dc144[_0x2d81('0xe6')]['service'];}else{_0x36bb6a[_0x2d81('0xe7')]=_0x5dc144[_0x2d81('0xe6')][_0x2d81('0xe7')];_0x36bb6a[_0x2d81('0xe8')]=_0x5dc144[_0x2d81('0xe6')]['port'];_0x36bb6a[_0x2d81('0xe9')]=_0x5dc144[_0x2d81('0xe6')][_0x2d81('0xe9')];}if(_0x5dc144[_0x2d81('0xe6')][_0x2d81('0xea')]){_0x36bb6a['auth']={'user':_0x5dc144[_0x2d81('0xe6')]['user'],'pass':_0x5dc144['Smtp'][_0x2d81('0xeb')]};}return respondWithRpcPromise('SendMail',_0x2d81('0xec'),{'account':_0x36bb6a,'message':{'from':util['format'](_0x2d81('0xed'),_0x5dc144[_0x2d81('0x3b')],_0x5dc144[_0x2d81('0xee')]||_0x5dc144[_0x2d81('0xe6')][_0x2d81('0x60')]),'to':_0x33241c[_0x2d81('0xe4')],'subject':_0x33241c[_0x2d81('0xef')],'html':_0x3d1601['body'],'attachments':_0x2e71e2}},client9003)['then'](function(){return _0x3d1601;})[_0x2d81('0x5d')](function(_0xf59e58){console[_0x2d81('0x28')](_0xf59e58);});}})[_0x2d81('0x20')](function(){if(_0x33241c&&_0x33241c[_0x2d81('0xdf')]&&_0x33241c[_0x2d81('0xf0')]){var _0x50e6c8=[];if(_0x421d5b[_0x2d81('0x4b')]){_0x50e6c8=_0x421d5b[_0x2d81('0x3f')](function(_0x3cffbc){return{'name':_0x3cffbc[_0x2d81('0xf1')],'basename':_0x3cffbc['filename'],'type':_0x3cffbc[_0x2d81('0xf2')],'ChatOfflineMessageId':_0x33f357['id']};});}var _0x4f35d9;if(!_['isNil'](_0x33241c['subjectOffline'])){var _0xdd73b2=_[_0x2d81('0x3f')](_0x3a537a['body'],function(_0x284144){return _0x284144;});var _0xb8deb6=_['toPairsIn'](_0xdd73b2)[0x0];var _0xfb3463=_[_0x2d81('0xf3')](_0xb8deb6,function(_0x1722f8){return _0x1722f8;});_0x4f35d9=_0xfb3463[0x1][_0x33241c['subjectOffline']];}var _0x253a3a={'from':_0x1bdf4a[_0x2d81('0xee')],'firstName':_0x1bdf4a['firstName'],'lastName':_0x1bdf4a['lastName'],'mapKey':'email','message':{'from':_0x1bdf4a[_0x2d81('0xee')],'to':_0x33241c[_0x2d81('0xd5')][_0x2d81('0xee')],'cc':'','subject':_[_0x2d81('0x84')](_0x4f35d9)?_0x33241c[_0x2d81('0xef')]:_0x4f35d9,'messageId':'','sentAt':new Date(),'attach':_0x50e6c8['length'],'attachments':_0x50e6c8,'originChannel':_0x2d81('0xf4'),'ChatWebsiteId':_0x33241c['id'],'ChatOfflineMessageId':_0x3d1601['id'],'originTo':_0x33241c[_0x2d81('0xd5')][_0x2d81('0xee')]},'body':_0x3d1601['body']};var _0x511477={'account':{'id':_0x33241c['MailAccountId']},'body':_0x253a3a,'log':_0x2d81('0xf5')};return respondWithRpcPromise(_0x2d81('0xf5'),_0x2d81('0xf6'),_0x511477,client9001)['then'](function(){return _0x3d1601;})['catch'](function(_0x1a0641){console[_0x2d81('0x28')](_0x1a0641);});}return;})['then'](function(){if(_0x3d1601){return _0x3d1601;}})[_0x2d81('0x20')](respondWithResult(_0x4d6664,null))[_0x2d81('0x5d')](function(_0xbdaa5a){console[_0x2d81('0x28')](_0x2d81('0x5d'),_0xbdaa5a);for(var _0x44bd79 of _0x421d5b){var _0x4f2c6a=path['join'](config['root'],'server',_0x2d81('0xcc'),_0x2d81('0xdc'),'offline-chat',_0x44bd79[_0x2d81('0x73')]);fs_extra['remove'](_0x4f2c6a)[_0x2d81('0x5d')](function(_0x42e284){console[_0x2d81('0x28')]('Could\x20not\x20remove\x20attachment\x20file',_0x4f2c6a,_0x42e284);});}});};exports[_0x2d81('0xf7')]=function(_0x28ab96,_0x20b5c5,_0x36e118){return db[_0x2d81('0xb7')][_0x2d81('0x5c')]({'where':{'id':_0x28ab96[_0x2d81('0x5b')]['id']}})[_0x2d81('0x20')](handleEntityNotFound(_0x20b5c5,null))['then'](function(_0x4a7339){if(_0x4a7339){return _0x4a7339[_0x2d81('0xf7')](_0x28ab96[_0x2d81('0x5f')][_0x2d81('0x6e')],_[_0x2d81('0xf8')](_0x28ab96[_0x2d81('0x5f')],[_0x2d81('0x6e'),'id'])||{});}})[_0x2d81('0x20')](respondWithResult(_0x20b5c5,null))['catch'](handleError(_0x20b5c5,null));};exports[_0x2d81('0xf9')]=function(_0x45117f,_0x125523,_0x47d6cb){var _0x2a548b={'raw':![],'where':{}};var _0x166f05={};var _0x22182a={'count':0x0,'rows':[]};return db[_0x2d81('0x40')]['findOne']({'where':{'id':_0x45117f[_0x2d81('0x5b')]['id']}})[_0x2d81('0x20')](handleEntityNotFound(_0x125523,null))[_0x2d81('0x20')](function(_0x358519){if(_0x358519){_0x166f05[_0x2d81('0x48')]=_[_0x2d81('0x46')](db[_0x2d81('0xb7')][_0x2d81('0x41')]);_0x166f05['query']=_[_0x2d81('0x46')](_0x45117f['query']);_0x166f05[_0x2d81('0x51')]=_[_0x2d81('0x47')](_0x166f05[_0x2d81('0x48')],_0x166f05[_0x2d81('0x45')]);_0x2a548b[_0x2d81('0x49')]=_[_0x2d81('0x47')](_0x166f05[_0x2d81('0x48')],qs[_0x2d81('0x4a')](_0x45117f['query'][_0x2d81('0x4a')]));_0x2a548b[_0x2d81('0x49')]=_0x2a548b[_0x2d81('0x49')][_0x2d81('0x4b')]?_0x2a548b['attributes']:_0x166f05['model'];if(!_0x45117f[_0x2d81('0x45')][_0x2d81('0x4c')](_0x2d81('0x4d'))){_0x2a548b[_0x2d81('0x2f')]=qs[_0x2d81('0x2f')](_0x45117f[_0x2d81('0x45')][_0x2d81('0x2f')]);_0x2a548b['offset']=qs['offset'](_0x45117f[_0x2d81('0x45')][_0x2d81('0x2c')]);}_0x2a548b[_0x2d81('0x4e')]=qs['sort'](_0x45117f[_0x2d81('0x45')]['sort']);_0x2a548b['where']=qs[_0x2d81('0x51')](_[_0x2d81('0x52')](_0x45117f[_0x2d81('0x45')],_0x166f05[_0x2d81('0x51')]));_0x2a548b['where'][_0x2d81('0x68')]=_0x358519['id'];if(_0x45117f[_0x2d81('0x45')][_0x2d81('0x53')]){_0x2a548b['where']=_[_0x2d81('0x55')](_0x2a548b[_0x2d81('0x50')],{'$or':_['map'](_0x2a548b[_0x2d81('0x49')],function(_0xc92724){var _0x3f21fb={};_0x3f21fb[_0xc92724]={'$like':'%'+_0x45117f['query'][_0x2d81('0x53')]+'%'};return _0x3f21fb;})});}_0x2a548b=_['merge']({},_0x2a548b,_0x45117f[_0x2d81('0x56')]);return db[_0x2d81('0xb7')][_0x2d81('0x2e')]({'where':_0x2a548b[_0x2d81('0x50')]})['then'](function(_0x958e68){_0x22182a[_0x2d81('0x2e')]=_0x958e68;if(_0x45117f['query'][_0x2d81('0x57')]){_0x2a548b[_0x2d81('0x58')]=[{'model':db[_0x2d81('0x9e')],'as':'Contact','required':![]},{'model':db[_0x2d81('0xc4')],'as':'Owner','attributes':['name',_0x2d81('0xfa'),_0x2d81('0xfb')],'required':![]},{'model':db[_0x2d81('0xfc')],'as':'Tags','attributes':['id','name','color'],'where':_0x45117f[_0x2d81('0x45')][_0x2d81('0xfd')]?{'id':_0x45117f[_0x2d81('0x45')][_0x2d81('0xfd')]}:undefined,'required':_0x45117f['query'][_0x2d81('0xfd')]?!![]:![]}];}return db[_0x2d81('0xb7')][_0x2d81('0x59')](_0x2a548b);})['then'](function(_0x4b521e){_0x22182a[_0x2d81('0x6c')]=_0x4b521e;return _0x22182a;});}})[_0x2d81('0x20')](respondWithFilteredResult(_0x125523,_0x2a548b))[_0x2d81('0x5d')](handleError(_0x125523,null));};function iftimePromise(_0x322692,_0x1d9108){return respondWithRpcPromise(_0x2d81('0xfe'),_0x2d81('0xff'),{'command':_0x1d9108[_0x2d81('0x100')]?util[_0x2d81('0xb1')]('iftime\x20%s,%s',_0x322692['interval'],_0x1d9108[_0x2d81('0x100')]):util[_0x2d81('0xb1')](_0x2d81('0x101'),_0x322692[_0x2d81('0x102')])},client9002)[_0x2d81('0x20')](function(_0x42bd09){var _0x353e56=_0x42bd09&&_0x42bd09['indexOf'](_0x2d81('0x103'))>=0x0?!![]:![];logger[_0x2d81('0x21')](_0x2d81('0x104'),_0x1d9108['id'],_0x322692['id'],_0x322692[_0x2d81('0x102')],_0x353e56?_0x2d81('0x105'):_0x2d81('0x106'),_0x1d9108['timezone']?_0x1d9108[_0x2d81('0x100')]:_0x2d81('0x107'));return _0x353e56;})['catch'](function(_0x2e6a78){logger['error'](_0x2d81('0x104'),_0x1d9108['id'],_0x322692['id'],_0x322692[_0x2d81('0x102')],util[_0x2d81('0x108')](_0x2e6a78,{'showHidden':![],'depth':null}),_0x1d9108[_0x2d81('0x100')]?_0x1d9108['timezone']:_0x2d81('0x107'));return![];});}exports[_0x2d81('0xff')]=function(_0x642d81,_0xad4805,_0x443fb0){var _0x4e293b=0x0;var _0x1fff59=0x0;var _0x4efbbb=![];var _0xebc931;var _0x59d6e1;return db[_0x2d81('0x40')][_0x2d81('0x5c')]({'where':{'id':_0x642d81[_0x2d81('0x5b')]['id']},'include':[{'model':db[_0x2d81('0x109')],'as':'Interval','include':[{'model':db[_0x2d81('0x109')],'as':'Intervals','attributes':['id',_0x2d81('0x102')],'raw':!![]}]}]})[_0x2d81('0x20')](handleEntityNotFound(_0xad4805,null))[_0x2d81('0x20')](function(_0x13a0d3){if(_0x13a0d3){_0xebc931=_0x13a0d3;return _0x13a0d3[_0x2d81('0x10a')]({'raw':!![]});}})[_0x2d81('0x20')](function(_0x47e098){if(_0xebc931){if(_0x47e098){_0x59d6e1=_0x47e098;}}return require('../../config/license/util')[_0x2d81('0x7d')]();})['then'](function(_0x5ca484){if(_0x5ca484){_0x1fff59=_0x5ca484['virtual'];_0x4efbbb=_0x5ca484[_0x2d81('0x7e')];}})[_0x2d81('0x20')](function(){return db[_0x2d81('0xb7')][_0x2d81('0x2e')]({'where':{'closed':![]}});})[_0x2d81('0x20')](function(_0x369da9){_0x4e293b=_0x369da9;if(_0x1fff59&&_0x369da9>_0x1fff59){return db[_0x2d81('0x10b')][_0x2d81('0x6a')]({'where':{'id':0x1}})[_0x2d81('0x20')](function(_0x26176a){if(_0x26176a){_0x26176a[_0x2d81('0x10c')]('chatLicenseExceeded');}});}})[_0x2d81('0x20')](function(){if(_0xebc931['Interval']&&_0xebc931[_0x2d81('0x109')][_0x2d81('0x10d')]){var _0x2a6063=[];for(var _0x158c8e=0x0;_0x158c8e<_0xebc931['Interval'][_0x2d81('0x10d')][_0x2d81('0x4b')];_0x158c8e++){var _0x41e5e1=_0xebc931[_0x2d81('0x109')][_0x2d81('0x10d')][_0x158c8e][_0x2d81('0x35')]({'plain':!![]});_0x2a6063['push'](iftimePromise(_0x41e5e1,_0xebc931));}return BPromise[_0x2d81('0x10e')](_0x2a6063)[_0x2d81('0x20')](function(_0x5207f8){return _[_0x2d81('0x10f')](_0x5207f8);});}else{return!![];}})[_0x2d81('0x20')](function(_0xc2aefe){var _0x1df6d2=fs['readFileSync'](path[_0x2d81('0x7a')](config[_0x2d81('0x80')],_0x2d81('0x110')),_0x2d81('0xd9'));var _0x369b3b={'remote':_0xebc931[_0x2d81('0x111')],'query':querystring['stringify'](_['merge'](_0xebc931[_0x2d81('0x35')]({'plain':!![]}),{'customerIp':_0x642d81[_0x2d81('0x8e')][_0x2d81('0xa9')]||_0x642d81['headers'][_0x2d81('0x112')]||_0x642d81['connection'][_0x2d81('0x113')]||_0x642d81['ip'],'referer':_0x642d81[_0x2d81('0x8e')]['referer'],'openedInteractions':_0x4e293b,'maxInteractions':_0x1fff59,'virtual':_0x4efbbb['virtual'],'online':_0xc2aefe,'custom':_0x4efbbb}))[_0x2d81('0x114')](/'/g,'\x5c\x27')};_0xad4805['send'](ejs['render'](Mustache[_0x2d81('0xda')](_0x1df6d2,_0x369b3b),{'proactiveActions':_0x59d6e1,'alignment':_0xebc931[_0x2d81('0x115')],'verticalAlignment':_0xebc931[_0x2d81('0x116')],'div_color':_0xebc931[_0x2d81('0x117')],'text_color':_0xebc931[_0x2d81('0x118')],'button_color':_0xebc931[_0x2d81('0x119')],'background_color':_0xebc931[_0x2d81('0x11a')]}));})[_0x2d81('0x5d')](handleError(_0xad4805,null));};exports[_0x2d81('0x11b')]=function(_0x16d9d0,_0x33f367,_0x405415){return db[_0x2d81('0x40')][_0x2d81('0x6a')]({'where':{'id':_0x16d9d0[_0x2d81('0x5b')]['id']}})['then'](handleEntityNotFound(_0x33f367,null))[_0x2d81('0x20')](function(_0x2ef173){if(_0x2ef173){return db[_0x2d81('0xe0')][_0x2d81('0x11c')](function(_0x117085){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x16d9d0[_0x2d81('0x5b')]['id']},'transaction':_0x117085})['then'](function(_0xb48c03){var _0x94f7a4=_[_0x2d81('0x3f')](_0x16d9d0[_0x2d81('0x5f')],function(_0x1ee1da){_0x1ee1da['ChatWebsiteId']=_0x16d9d0[_0x2d81('0x5b')]['id'];return _0x1ee1da;});return db[_0x2d81('0x11d')]['bulkCreate'](_0x94f7a4,{'transaction':_0x117085});});})[_0x2d81('0x20')](function(){return db[_0x2d81('0x11d')][_0x2d81('0x11e')]({'where':{'ChatWebsiteId':_0x16d9d0['params']['id']},'order':_0x2d81('0xa6')});});}})['then'](respondWithResult(_0x33f367,null))[_0x2d81('0x5d')](handleError(_0x33f367,null));};exports[_0x2d81('0x11f')]=function(_0x328766,_0x5afa06,_0x5aa957){var _0x1bc9f9={};var _0xc45e5f={};var _0x3589a2;var _0xd9e2;return db['ChatWebsite'][_0x2d81('0x6a')]({'where':{'id':_0x328766['params']['id']}})[_0x2d81('0x20')](handleEntityNotFound(_0x5afa06,null))[_0x2d81('0x20')](function(_0x3f3fdc){if(_0x3f3fdc){_0x3589a2=_0x3f3fdc;_0xc45e5f[_0x2d81('0x48')]=_['keys'](db[_0x2d81('0x11d')][_0x2d81('0x41')]);_0xc45e5f[_0x2d81('0x45')]=_[_0x2d81('0x46')](_0x328766[_0x2d81('0x45')]);_0xc45e5f[_0x2d81('0x51')]=_['intersection'](_0xc45e5f[_0x2d81('0x48')],_0xc45e5f[_0x2d81('0x45')]);_0x1bc9f9[_0x2d81('0x49')]=_['intersection'](_0xc45e5f[_0x2d81('0x48')],qs['fields'](_0x328766[_0x2d81('0x45')][_0x2d81('0x4a')]));_0x1bc9f9[_0x2d81('0x49')]=_0x1bc9f9[_0x2d81('0x49')][_0x2d81('0x4b')]?_0x1bc9f9['attributes']:_0xc45e5f['model'];_0x1bc9f9['order']=qs[_0x2d81('0x4f')](_0x328766[_0x2d81('0x45')][_0x2d81('0x4f')]);_0x1bc9f9[_0x2d81('0x50')]=qs[_0x2d81('0x51')](_[_0x2d81('0x52')](_0x328766[_0x2d81('0x45')],_0xc45e5f[_0x2d81('0x51')]));if(_0x328766[_0x2d81('0x45')][_0x2d81('0x53')]){_0x1bc9f9[_0x2d81('0x50')]=_[_0x2d81('0x55')](_0x1bc9f9['where'],{'$or':_[_0x2d81('0x3f')](_0x1bc9f9[_0x2d81('0x49')],function(_0x2f0c7f){var _0x4b1c62={};_0x4b1c62[_0x2f0c7f]={'$like':'%'+_0x328766[_0x2d81('0x45')]['filter']+'%'};return _0x4b1c62;})});}_0x1bc9f9=_[_0x2d81('0x55')]({},_0x1bc9f9,_0x328766['options']);return _0x3589a2['getApplications'](_0x1bc9f9);}})[_0x2d81('0x20')](function(_0x1bf89f){if(_0x1bf89f){_0xd9e2=_0x1bf89f[_0x2d81('0x4b')];if(!_0x328766[_0x2d81('0x45')][_0x2d81('0x4c')]('nolimit')){_0x1bc9f9['limit']=qs['limit'](_0x328766[_0x2d81('0x45')]['limit']);_0x1bc9f9[_0x2d81('0x2c')]=qs[_0x2d81('0x2c')](_0x328766[_0x2d81('0x45')][_0x2d81('0x2c')]);}return _0x3589a2[_0x2d81('0x11f')](_0x1bc9f9);}})[_0x2d81('0x20')](function(_0x2c80e3){if(_0x2c80e3){return _0x2c80e3?{'count':_0xd9e2,'rows':_0x2c80e3}:null;}})['then'](respondWithResult(_0x5afa06,null))[_0x2d81('0x5d')](handleError(_0x5afa06,null));};exports[_0x2d81('0x120')]=function(_0x423d09,_0x36653b,_0x5ee8d0){return db[_0x2d81('0x121')][_0x2d81('0x5c')]({'where':{'id':_0x423d09[_0x2d81('0x5b')]['id']}})[_0x2d81('0x20')](handleEntityNotFound(_0x36653b,null))[_0x2d81('0x20')](function(_0x144a89){if(_0x144a89){return _0x144a89[_0x2d81('0x120')](_0x423d09[_0x2d81('0x5f')][_0x2d81('0x6e')],_[_0x2d81('0xf8')](_0x423d09[_0x2d81('0x5f')],[_0x2d81('0x6e'),'id'])||{});}})[_0x2d81('0x20')](respondWithResult(_0x36653b,null))[_0x2d81('0x5d')](handleError(_0x36653b,null));};exports[_0x2d81('0x10a')]=function(_0x1688dd,_0x104cfb,_0xf3802e){var _0x2b068f={};var _0x4174d7={};var _0x21fb4b;var _0x5b5b07;return db[_0x2d81('0x40')][_0x2d81('0x6a')]({'where':{'id':_0x1688dd[_0x2d81('0x5b')]['id']}})[_0x2d81('0x20')](handleEntityNotFound(_0x104cfb,null))[_0x2d81('0x20')](function(_0x51de20){if(_0x51de20){_0x21fb4b=_0x51de20;_0x4174d7[_0x2d81('0x48')]=_[_0x2d81('0x46')](db[_0x2d81('0x122')][_0x2d81('0x41')]);_0x4174d7[_0x2d81('0x45')]=_['keys'](_0x1688dd[_0x2d81('0x45')]);_0x4174d7['filters']=_[_0x2d81('0x47')](_0x4174d7[_0x2d81('0x48')],_0x4174d7['query']);_0x2b068f[_0x2d81('0x49')]=_[_0x2d81('0x47')](_0x4174d7[_0x2d81('0x48')],qs[_0x2d81('0x4a')](_0x1688dd[_0x2d81('0x45')][_0x2d81('0x4a')]));_0x2b068f[_0x2d81('0x49')]=_0x2b068f[_0x2d81('0x49')][_0x2d81('0x4b')]?_0x2b068f[_0x2d81('0x49')]:_0x4174d7[_0x2d81('0x48')];_0x2b068f[_0x2d81('0x4e')]=qs['sort'](_0x1688dd['query']['sort']);_0x2b068f[_0x2d81('0x50')]=qs[_0x2d81('0x51')](_['pick'](_0x1688dd[_0x2d81('0x45')],_0x4174d7['filters']));if(_0x1688dd['query'][_0x2d81('0x53')]){_0x2b068f[_0x2d81('0x50')]=_[_0x2d81('0x55')](_0x2b068f[_0x2d81('0x50')],{'$or':_[_0x2d81('0x3f')](_0x2b068f[_0x2d81('0x49')],function(_0x4d2f34){var _0x4db9cf={};_0x4db9cf[_0x4d2f34]={'$like':'%'+_0x1688dd[_0x2d81('0x45')]['filter']+'%'};return _0x4db9cf;})});}_0x2b068f=_[_0x2d81('0x55')]({},_0x2b068f,_0x1688dd[_0x2d81('0x56')]);return _0x21fb4b[_0x2d81('0x10a')](_0x2b068f);}})[_0x2d81('0x20')](function(_0x34a5dd){if(_0x34a5dd){_0x5b5b07=_0x34a5dd['length'];if(!_0x1688dd[_0x2d81('0x45')][_0x2d81('0x4c')]('nolimit')){_0x2b068f[_0x2d81('0x2f')]=qs[_0x2d81('0x2f')](_0x1688dd['query'][_0x2d81('0x2f')]);_0x2b068f[_0x2d81('0x2c')]=qs[_0x2d81('0x2c')](_0x1688dd['query']['offset']);}return _0x21fb4b['getProactiveActions'](_0x2b068f);}})[_0x2d81('0x20')](function(_0x45b730){if(_0x45b730){return _0x45b730?{'count':_0x5b5b07,'rows':_0x45b730}:null;}})[_0x2d81('0x20')](respondWithResult(_0x104cfb,null))[_0x2d81('0x5d')](handleError(_0x104cfb,null));};exports[_0x2d81('0x123')]=function(_0x2056ca,_0x241f62,_0x237a59){var _0x1798aa=_0x2056ca['query'][_0x2d81('0x124')]===_0x2d81('0x125')?'offlineForm':'onlineForm';return db['ChatWebsite'][_0x2d81('0x5c')]({'attributes':['id',_0x1798aa],'where':{'id':_0x2056ca[_0x2d81('0x5b')]['id']}})[_0x2d81('0x20')](handleEntityNotFound(_0x241f62,null))[_0x2d81('0x20')](function(_0x3f1902){if(_0x3f1902){var _0x478df6=_0x3f1902[_0x1798aa];var _0x3f1e02=_0x478df6&&_0x478df6['items']?_0x478df6[_0x2d81('0x126')]:[];_0x241f62[_0x2d81('0xcf')]({'fromKey':_[_0x2d81('0x84')](_0x478df6[_0x2d81('0x127')])?undefined:_0x478df6[_0x2d81('0x127')],'count':_0x3f1e02[_0x2d81('0x4b')],'rows':_0x3f1e02});}})[_0x2d81('0x5d')](handleError(_0x241f62,null));};exports['getOfflineMessages']=function(_0x5dd966,_0x3b095d,_0x11f2ee){var _0x2497d4={'raw':![],'where':{}};var _0xd0b13f={};var _0x5a2ea1={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x2d81('0x6a')]({'where':{'id':_0x5dd966[_0x2d81('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3b095d,null))[_0x2d81('0x20')](function(_0x2ba5a0){if(_0x2ba5a0){_0xd0b13f[_0x2d81('0x48')]=_[_0x2d81('0x46')](db[_0x2d81('0x128')][_0x2d81('0x41')]);_0xd0b13f['query']=_['keys'](_0x5dd966[_0x2d81('0x45')]);_0xd0b13f[_0x2d81('0x51')]=_['intersection'](_0xd0b13f[_0x2d81('0x48')],_0xd0b13f[_0x2d81('0x45')]);_0x2497d4[_0x2d81('0x49')]=_['intersection'](_0xd0b13f[_0x2d81('0x48')],qs[_0x2d81('0x4a')](_0x5dd966[_0x2d81('0x45')][_0x2d81('0x4a')]));_0x2497d4['attributes']=_0x2497d4[_0x2d81('0x49')][_0x2d81('0x4b')]?_0x2497d4['attributes']:_0xd0b13f[_0x2d81('0x48')];if(!_0x5dd966['query']['hasOwnProperty']('nolimit')){_0x2497d4[_0x2d81('0x2f')]=qs[_0x2d81('0x2f')](_0x5dd966[_0x2d81('0x45')][_0x2d81('0x2f')]);_0x2497d4['offset']=qs['offset'](_0x5dd966[_0x2d81('0x45')]['offset']);}_0x2497d4[_0x2d81('0x4e')]=qs[_0x2d81('0x4f')](_0x5dd966['query']['sort']);_0x2497d4[_0x2d81('0x50')]=qs[_0x2d81('0x51')](_[_0x2d81('0x52')](_0x5dd966[_0x2d81('0x45')],_0xd0b13f[_0x2d81('0x51')]));_0x2497d4[_0x2d81('0x50')][_0x2d81('0x68')]=_0x2ba5a0['id'];if(_0x5dd966[_0x2d81('0x45')]['filter']){_0x2497d4[_0x2d81('0x50')]=_[_0x2d81('0x55')](_0x2497d4[_0x2d81('0x50')],{'$or':_[_0x2d81('0x3f')](_0x2497d4[_0x2d81('0x49')],function(_0x5a3876){var _0x289a62={};_0x289a62[_0x5a3876]={'$like':'%'+_0x5dd966['query'][_0x2d81('0x53')]+'%'};return _0x289a62;})});}_0x2497d4=_[_0x2d81('0x55')]({},_0x2497d4,_0x5dd966[_0x2d81('0x56')]);return db['ChatOfflineMessage'][_0x2d81('0x2e')]({'where':_0x2497d4[_0x2d81('0x50')]})[_0x2d81('0x20')](function(_0xd1d167){_0x5a2ea1[_0x2d81('0x2e')]=_0xd1d167;if(_0x5dd966[_0x2d81('0x45')]['includeAll']){_0x2497d4[_0x2d81('0x58')]=[{'all':!![]}];}else{_0x2497d4[_0x2d81('0x58')]=[{'model':db[_0x2d81('0x9e')],'as':_0x2d81('0x129'),'required':![]},{'model':db[_0x2d81('0xe1')],'as':_0x2d81('0x12a'),'required':![]}];}return db[_0x2d81('0x128')]['findAll'](_0x2497d4);})[_0x2d81('0x20')](function(_0x49d0c5){_0x5a2ea1[_0x2d81('0x6c')]=_0x49d0c5;return _0x5a2ea1;});}})[_0x2d81('0x20')](respondWithFilteredResult(_0x3b095d,_0x2497d4))[_0x2d81('0x5d')](handleError(_0x3b095d,null));};exports[_0x2d81('0x12b')]=function(_0x4c1374,_0x4dd5b1,_0x3dfe10){return db['ChatWebsite'][_0x2d81('0x5c')]({'where':{'id':_0x4c1374['params']['id']}})[_0x2d81('0x20')](handleEntityNotFound(_0x4dd5b1,null))[_0x2d81('0x20')](function(_0x338df3){if(_0x338df3){return _0x338df3[_0x2d81('0x12b')](_0x4c1374['body'][_0x2d81('0x6e')],_[_0x2d81('0xf8')](_0x4c1374['body'],[_0x2d81('0x6e'),'id'])||{})['spread'](function(_0x1d91c4){for(var _0x50d0ea=0x0;_0x50d0ea<_0x4c1374[_0x2d81('0x5f')][_0x2d81('0x6e')]['length'];_0x50d0ea+=0x1){socket[_0x2d81('0x12c')]('userChatWebsite:save',{'UserId':Number(_0x4c1374['body']['ids'][_0x50d0ea]),'ChatWebsiteId':Number(_0x4c1374[_0x2d81('0x5b')]['id'])});}return _0x1d91c4;});}})[_0x2d81('0x20')](respondWithResult(_0x4dd5b1,null))[_0x2d81('0x5d')](handleError(_0x4dd5b1,null));};exports[_0x2d81('0x12d')]=function(_0x7f9a8d,_0x5f2918,_0x454245){return db[_0x2d81('0x40')][_0x2d81('0x5c')]({'where':{'id':_0x7f9a8d[_0x2d81('0x5b')]['id']}})[_0x2d81('0x20')](handleEntityNotFound(_0x5f2918,null))['then'](function(_0x5cc636){if(_0x5cc636){return _0x5cc636['removeAgents'](_0x7f9a8d['query']['ids'])[_0x2d81('0x20')](function(){if(_[_0x2d81('0x12e')](_0x7f9a8d['query'][_0x2d81('0x6e')])){for(var _0x1258b0=0x0;_0x1258b0<_0x7f9a8d[_0x2d81('0x45')][_0x2d81('0x6e')]['length'];_0x1258b0+=0x1){socket[_0x2d81('0x12c')](_0x2d81('0x12f'),{'UserId':Number(_0x7f9a8d[_0x2d81('0x45')][_0x2d81('0x6e')][_0x1258b0]),'ChatWebsiteId':Number(_0x7f9a8d[_0x2d81('0x5b')]['id'])});}}else{socket['emit'](_0x2d81('0x12f'),{'UserId':Number(_0x7f9a8d[_0x2d81('0x45')]['ids']),'ChatWebsiteId':Number(_0x7f9a8d[_0x2d81('0x5b')]['id'])});}});}})[_0x2d81('0x20')](respondWithStatusCode(_0x5f2918,null))[_0x2d81('0x5d')](handleError(_0x5f2918,null));};exports['getAgents']=function(_0x3a21e6,_0x26a68f,_0x4e33b0){var _0x4be558={};var _0x28b95d={};var _0x43ec1;var _0x51c94d;return db[_0x2d81('0x40')][_0x2d81('0x6a')]({'where':{'id':_0x3a21e6[_0x2d81('0x5b')]['id']}})['then'](handleEntityNotFound(_0x26a68f,null))[_0x2d81('0x20')](function(_0x10971c){if(_0x10971c){_0x43ec1=_0x10971c;_0x28b95d[_0x2d81('0x48')]=_[_0x2d81('0x46')](db['User'][_0x2d81('0x41')]);_0x28b95d['query']=_[_0x2d81('0x46')](_0x3a21e6[_0x2d81('0x45')]);_0x28b95d[_0x2d81('0x51')]=_[_0x2d81('0x47')](_0x28b95d['model'],_0x28b95d[_0x2d81('0x45')]);_0x4be558[_0x2d81('0x49')]=_[_0x2d81('0x47')](_0x28b95d[_0x2d81('0x48')],qs[_0x2d81('0x4a')](_0x3a21e6['query'][_0x2d81('0x4a')]));_0x4be558['attributes']=_0x4be558[_0x2d81('0x49')]['length']?_0x4be558[_0x2d81('0x49')]:_0x28b95d[_0x2d81('0x48')];_0x4be558[_0x2d81('0x4e')]=qs['sort'](_0x3a21e6['query'][_0x2d81('0x4f')]);_0x4be558[_0x2d81('0x50')]=qs[_0x2d81('0x51')](_['pick'](_0x3a21e6[_0x2d81('0x45')],_0x28b95d[_0x2d81('0x51')]));if(_0x3a21e6[_0x2d81('0x45')][_0x2d81('0x53')]){_0x4be558[_0x2d81('0x50')]=_['merge'](_0x4be558[_0x2d81('0x50')],{'$or':_[_0x2d81('0x3f')](_0x4be558[_0x2d81('0x49')],function(_0x1e3cf7){var _0x4b5ca3={};_0x4b5ca3[_0x1e3cf7]={'$like':'%'+_0x3a21e6[_0x2d81('0x45')][_0x2d81('0x53')]+'%'};return _0x4b5ca3;})});}_0x4be558=_[_0x2d81('0x55')]({},_0x4be558,_0x3a21e6['options']);return _0x43ec1['getAgents'](_0x4be558);}})[_0x2d81('0x20')](function(_0x9c9179){if(_0x9c9179){_0x51c94d=_0x9c9179[_0x2d81('0x4b')];if(!_0x3a21e6[_0x2d81('0x45')][_0x2d81('0x4c')](_0x2d81('0x4d'))){_0x4be558[_0x2d81('0x2f')]=qs['limit'](_0x3a21e6['query'][_0x2d81('0x2f')]);_0x4be558[_0x2d81('0x2c')]=qs[_0x2d81('0x2c')](_0x3a21e6[_0x2d81('0x45')][_0x2d81('0x2c')]);}return _0x43ec1[_0x2d81('0x130')](_0x4be558);}})[_0x2d81('0x20')](function(_0x3dfaf2){if(_0x3dfaf2){return _0x3dfaf2?{'count':_0x51c94d,'rows':_0x3dfaf2}:null;}})[_0x2d81('0x20')](respondWithResult(_0x26a68f,null))[_0x2d81('0x5d')](handleError(_0x26a68f,null));}; \ No newline at end of file +var _0x3603=['applications','Applications','list','orderBy','asc','contact','customerIp','x-forwarded-for','first','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','notify','offline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','server','attachments','offline-chat','basename','sequelize','bulkCreate','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','auth','pass','SendMail','sendMail','email','offlineMessageSubject','MailAccountId','mimetype','toPairsIn','subjectOffline','Chat','NotifyMailAccount','notifyMail','files','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','color','tag','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','ONLINE','No\x20timezone','Interval','getProactiveActions','virtual','License','increment','chatLicenseExceeded','Intervals','all','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','alignment','textColor','backgroundColor','addApplications','transaction','ChatApplication','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','getOfflineMessages','Attachment','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','end','status','json','offset','undefined','limit','apply','reject','save','destroy','get','ChatWebsites','stack','name','send','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','options','count','include','rows','catch','show','params','Pause','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','nolimit','includeAll','findAll','removeDispositions','CannedAnswer','getAnswers','removeAnswers','ids','file','addAvatar','filename','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','sitepic','getLicense','custom','isNil','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','customerAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','describe','ValidationError','difference','createdAt','updatedAt','ListId','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','CmList','List','Contacts','account'];(function(_0x655ab,_0x3bf2e9){var _0x1c456a=function(_0x53d4dd){while(--_0x53d4dd){_0x655ab['push'](_0x655ab['shift']());}};_0x1c456a(++_0x3bf2e9);}(_0x3603,0x8e));var _0x3360=function(_0x487383,_0x5bc48e){_0x487383=_0x487383-0x0;var _0x1df6e1=_0x3603[_0x487383];return _0x1df6e1;};'use strict';var emlformat=require(_0x3360('0x0'));var rimraf=require(_0x3360('0x1'));var zipdir=require(_0x3360('0x2'));var jsonpatch=require(_0x3360('0x3'));var rp=require(_0x3360('0x4'));var moment=require(_0x3360('0x5'));var BPromise=require(_0x3360('0x6'));var Mustache=require(_0x3360('0x7'));var util=require(_0x3360('0x8'));var path=require(_0x3360('0x9'));var sox=require(_0x3360('0xa'));var csv=require('to-csv');var ejs=require(_0x3360('0xb'));var fs=require('fs');var fs_extra=require(_0x3360('0xc'));var _=require(_0x3360('0xd'));var squel=require(_0x3360('0xe'));var crypto=require('crypto');var jsforce=require(_0x3360('0xf'));var deskjs=require(_0x3360('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3360('0x11'));var authService=require(_0x3360('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3360('0x13'));var hardwareService=require(_0x3360('0x14'));var logger=require(_0x3360('0x15'))(_0x3360('0x16'));var utils=require(_0x3360('0x17'));var config=require(_0x3360('0x18'));var licenseUtil=require(_0x3360('0x19'));var db=require(_0x3360('0x1a'))['db'];config[_0x3360('0x1b')]=_[_0x3360('0x1c')](config['redis'],{'host':_0x3360('0x1d'),'port':0x18eb});var socket=require(_0x3360('0x1e'))(new Redis(config['redis']));require(_0x3360('0x1f'))[_0x3360('0x20')](socket);var jayson=require(_0x3360('0x21'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x3360('0x22')][_0x3360('0x23')]({'port':0x232a});var client9003=jayson[_0x3360('0x22')][_0x3360('0x23')]({'port':0x232b});var client9001=jayson[_0x3360('0x22')][_0x3360('0x23')]({'port':0x2329});function respondWithRpcPromise(_0x481903,_0x6665dd,_0x3dd88e,_0x1e2893){return new BPromise(function(_0x2c5478,_0x3cf19a){var _0x2e99df=_0x1e2893||client;return _0x2e99df[_0x3360('0x24')](_0x481903,_0x3dd88e)[_0x3360('0x25')](function(_0x4c523d){logger[_0x3360('0x26')](_0x3360('0x27'),_0x6665dd,_0x3360('0x28'));logger[_0x3360('0x29')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x6665dd,_0x3360('0x28'),JSON[_0x3360('0x2a')](_0x4c523d));if(_0x4c523d[_0x3360('0x2b')]){if(_0x4c523d[_0x3360('0x2b')][_0x3360('0x2c')]===0x1f4){logger[_0x3360('0x2b')]('ChatWebsite,\x20%s,\x20%s',_0x6665dd,_0x4c523d[_0x3360('0x2b')][_0x3360('0x2d')]);return _0x3cf19a(_0x4c523d[_0x3360('0x2b')][_0x3360('0x2d')]);}logger['error'](_0x3360('0x27'),_0x6665dd,_0x4c523d[_0x3360('0x2b')][_0x3360('0x2d')]);return _0x2c5478(_0x4c523d['error'][_0x3360('0x2d')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x6665dd,_0x3360('0x28'));_0x2c5478(_0x4c523d[_0x3360('0x2e')][_0x3360('0x2d')]);}})['catch'](function(_0x2271f8){logger[_0x3360('0x2b')]('ChatWebsite,\x20%s,\x20%s',_0x6665dd,_0x2271f8);_0x3cf19a(_0x2271f8);});});}function respondWithStatusCode(_0x307ded,_0x4aa468){_0x4aa468=_0x4aa468||0xcc;return function(_0x4d1da4){if(_0x4d1da4){return _0x307ded[_0x3360('0x2f')](_0x4aa468);}return _0x307ded['status'](_0x4aa468)[_0x3360('0x30')]();};}function respondWithResult(_0xe0aa13,_0x4fd634){_0x4fd634=_0x4fd634||0xc8;return function(_0x1918de){if(_0x1918de){return _0xe0aa13[_0x3360('0x31')](_0x4fd634)[_0x3360('0x32')](_0x1918de);}};}function respondWithFilteredResult(_0x3d4da3,_0x4be4bb){return function(_0x9a0c70){if(_0x9a0c70){var _0x129fdf=typeof _0x4be4bb[_0x3360('0x33')]===_0x3360('0x34')&&typeof _0x4be4bb[_0x3360('0x35')]==='undefined';var _0x3bc4c8=_0x9a0c70['count'];var _0x2b0550=_0x129fdf?0x0:_0x4be4bb[_0x3360('0x33')];var _0x2b672c=_0x129fdf?_0x9a0c70['count']:_0x4be4bb[_0x3360('0x33')]+_0x4be4bb[_0x3360('0x35')];var _0xb42aa9;if(_0x2b672c>=_0x3bc4c8){_0x2b672c=_0x3bc4c8;_0xb42aa9=0xc8;}else{_0xb42aa9=0xce;}_0x3d4da3[_0x3360('0x31')](_0xb42aa9);return _0x3d4da3['set']('Content-Range',_0x2b0550+'-'+_0x2b672c+'/'+_0x3bc4c8)[_0x3360('0x32')](_0x9a0c70);}return null;};}function patchUpdates(_0x423daf){return function(_0xb65e2e){try{jsonpatch[_0x3360('0x36')](_0xb65e2e,_0x423daf,!![]);}catch(_0x285289){return BPromise[_0x3360('0x37')](_0x285289);}return _0xb65e2e[_0x3360('0x38')]();};}function saveUpdates(_0x43f90c,_0x1c55f6){return function(_0x69a45f){if(_0x69a45f){return _0x69a45f['update'](_0x43f90c)[_0x3360('0x25')](function(_0x58dcd3){return _0x58dcd3;});}return null;};}function removeEntity(_0x576efb,_0x107da3){return function(_0x5c20ac){if(_0x5c20ac){return _0x5c20ac[_0x3360('0x39')]()[_0x3360('0x25')](function(){var _0x14bffd=_0x5c20ac[_0x3360('0x3a')]({'plain':!![]});var _0x303596=_0x3360('0x3b');return db['UserProfileResource'][_0x3360('0x39')]({'where':{'type':_0x303596,'resourceId':_0x14bffd['id']}})[_0x3360('0x25')](function(){return _0x5c20ac;});})['then'](function(){_0x576efb[_0x3360('0x31')](0xcc)[_0x3360('0x30')]();});}};}function handleEntityNotFound(_0x2edaa5,_0x14cf19){return function(_0x129c13){if(!_0x129c13){_0x2edaa5[_0x3360('0x2f')](0x194);}return _0x129c13;};}function handleError(_0x233022,_0x4fa682){_0x4fa682=_0x4fa682||0x1f4;return function(_0x3d26c4){logger[_0x3360('0x2b')](_0x3d26c4[_0x3360('0x3c')]);if(_0x3d26c4[_0x3360('0x3d')]){delete _0x3d26c4[_0x3360('0x3d')];}_0x233022['status'](_0x4fa682)[_0x3360('0x3e')](_0x3d26c4);};}exports[_0x3360('0x3f')]=function(_0x400918,_0x23747f){var _0x18a8b4={'include':[{'model':db['Pause'],'as':_0x3360('0x40')}]},_0x549adf={},_0x26d34f={'count':0x0,'rows':[]};var _0x619328=_[_0x3360('0x41')](db[_0x3360('0x42')][_0x3360('0x43')],function(_0x4745d2){return{'name':_0x4745d2['fieldName'],'type':_0x4745d2['type'][_0x3360('0x44')]};});_0x549adf[_0x3360('0x45')]=_['map'](_0x619328,'name');_0x549adf[_0x3360('0x46')]=_[_0x3360('0x47')](_0x400918[_0x3360('0x46')]);_0x549adf[_0x3360('0x48')]=_[_0x3360('0x49')](_0x549adf['model'],_0x549adf[_0x3360('0x46')]);_0x18a8b4[_0x3360('0x4a')]=_[_0x3360('0x49')](_0x549adf[_0x3360('0x45')],qs[_0x3360('0x4b')](_0x400918[_0x3360('0x46')][_0x3360('0x4b')]));_0x18a8b4[_0x3360('0x4a')]=_0x18a8b4[_0x3360('0x4a')][_0x3360('0x4c')]?_0x18a8b4[_0x3360('0x4a')]:_0x549adf['model'];if(!_0x400918[_0x3360('0x46')][_0x3360('0x4d')]('nolimit')){_0x18a8b4[_0x3360('0x35')]=qs[_0x3360('0x35')](_0x400918[_0x3360('0x46')][_0x3360('0x35')]);_0x18a8b4['offset']=qs[_0x3360('0x33')](_0x400918[_0x3360('0x46')][_0x3360('0x33')]);}_0x18a8b4[_0x3360('0x4e')]=qs['sort'](_0x400918[_0x3360('0x46')][_0x3360('0x4f')]);_0x18a8b4['where']=qs[_0x3360('0x48')](_[_0x3360('0x50')](_0x400918[_0x3360('0x46')],_0x549adf[_0x3360('0x48')]),_0x619328);if(_0x400918[_0x3360('0x46')][_0x3360('0x51')]){_0x18a8b4[_0x3360('0x52')]=_[_0x3360('0x53')](_0x18a8b4['where'],{'$or':_[_0x3360('0x41')](_0x619328,function(_0x147353){if(_0x147353[_0x3360('0x54')]!==_0x3360('0x55')){var _0x2eafb2={};_0x2eafb2[_0x147353[_0x3360('0x3d')]]={'$like':'%'+_0x400918[_0x3360('0x46')]['filter']+'%'};return _0x2eafb2;}})});}_0x18a8b4=_[_0x3360('0x53')]({},_0x18a8b4,_0x400918[_0x3360('0x56')]);var _0x41af55={'where':_0x18a8b4[_0x3360('0x52')]};return db[_0x3360('0x42')][_0x3360('0x57')](_0x41af55)[_0x3360('0x25')](function(_0x286ad7){_0x26d34f[_0x3360('0x57')]=_0x286ad7;if(_0x400918[_0x3360('0x46')]['includeAll']){_0x18a8b4[_0x3360('0x58')]=[{'all':!![]}];}return db[_0x3360('0x42')]['findAll'](_0x18a8b4);})[_0x3360('0x25')](function(_0x31186c){_0x26d34f[_0x3360('0x59')]=_0x31186c;return _0x26d34f;})[_0x3360('0x25')](respondWithFilteredResult(_0x23747f,_0x18a8b4))[_0x3360('0x5a')](handleError(_0x23747f,null));};exports[_0x3360('0x5b')]=function(_0x25e845,_0x2143be){var _0x38477e={'raw':![],'where':{'id':_0x25e845[_0x3360('0x5c')]['id']},'include':[{'model':db[_0x3360('0x5d')],'as':_0x3360('0x40')}]},_0x18de1f={};_0x18de1f['model']=_['keys'](db['ChatWebsite'][_0x3360('0x43')]);_0x18de1f[_0x3360('0x46')]=_[_0x3360('0x47')](_0x25e845[_0x3360('0x46')]);_0x18de1f['filters']=_[_0x3360('0x49')](_0x18de1f[_0x3360('0x45')],_0x18de1f['query']);_0x38477e[_0x3360('0x4a')]=_['intersection'](_0x18de1f[_0x3360('0x45')],qs[_0x3360('0x4b')](_0x25e845['query']['fields']));_0x38477e[_0x3360('0x4a')]=_0x38477e['attributes'][_0x3360('0x4c')]?_0x38477e[_0x3360('0x4a')]:_0x18de1f[_0x3360('0x45')];if(_0x25e845[_0x3360('0x46')]['includeAll']){_0x38477e[_0x3360('0x58')]=[{'all':!![]}];}_0x38477e=_[_0x3360('0x53')]({},_0x38477e,_0x25e845[_0x3360('0x56')]);return db[_0x3360('0x42')][_0x3360('0x5e')](_0x38477e)[_0x3360('0x25')](handleEntityNotFound(_0x2143be,null))[_0x3360('0x25')](respondWithResult(_0x2143be,null))['catch'](handleError(_0x2143be,null));};exports[_0x3360('0x5f')]=function(_0x2371d2,_0x5aa9a3){return db['ChatWebsite'][_0x3360('0x5f')](_0x2371d2[_0x3360('0x60')],{})[_0x3360('0x25')](function(_0x54a997){var _0x327b94=_0x2371d2['user'][_0x3360('0x3a')]({'plain':!![]});if(!_0x327b94)throw new Error(_0x3360('0x61'));if(_0x327b94[_0x3360('0x62')]===_0x3360('0x63')){var _0x4e4c52=_0x54a997[_0x3360('0x3a')]({'plain':!![]});var _0xb6908c='ChatWebsites';return db[_0x3360('0x64')][_0x3360('0x5e')]({'where':{'name':_0xb6908c,'userProfileId':_0x327b94[_0x3360('0x65')]},'raw':!![]})[_0x3360('0x25')](function(_0x346339){if(_0x346339&&_0x346339['autoAssociation']===0x0){return db[_0x3360('0x66')]['create']({'name':_0x4e4c52[_0x3360('0x3d')],'resourceId':_0x4e4c52['id'],'type':_0x346339[_0x3360('0x3d')],'sectionId':_0x346339['id']},{})['then'](function(){return _0x54a997;});}else{return _0x54a997;}})[_0x3360('0x5a')](function(_0x2fb913){logger[_0x3360('0x2b')](_0x3360('0x67'),_0x2fb913);throw _0x2fb913;});}return _0x54a997;})['then'](respondWithResult(_0x5aa9a3,0xc9))[_0x3360('0x5a')](handleError(_0x5aa9a3,null));};exports[_0x3360('0x68')]=function(_0x5beb17,_0x2f9834){if(_0x5beb17[_0x3360('0x60')]['id']){delete _0x5beb17[_0x3360('0x60')]['id'];}return db['ChatWebsite'][_0x3360('0x5e')]({'where':{'id':_0x5beb17['params']['id']},'include':[{'model':db[_0x3360('0x5d')],'as':_0x3360('0x40')}]})[_0x3360('0x25')](handleEntityNotFound(_0x2f9834,null))[_0x3360('0x25')](saveUpdates(_0x5beb17[_0x3360('0x60')],null))[_0x3360('0x25')](respondWithResult(_0x2f9834,null))[_0x3360('0x5a')](handleError(_0x2f9834,null));};exports[_0x3360('0x39')]=function(_0x57afb9,_0x500b8e){return db[_0x3360('0x42')][_0x3360('0x5e')]({'where':{'id':_0x57afb9['params']['id']}})[_0x3360('0x25')](handleEntityNotFound(_0x500b8e,null))[_0x3360('0x25')](removeEntity(_0x500b8e,null))[_0x3360('0x5a')](handleError(_0x500b8e,null));};exports['describe']=function(_0x368db2,_0x143167){return db['ChatWebsite']['describe']()[_0x3360('0x25')](respondWithResult(_0x143167,null))[_0x3360('0x5a')](handleError(_0x143167,null));};exports[_0x3360('0x69')]=function(_0x3b9c24,_0x114572,_0x286e62){if(_0x3b9c24[_0x3360('0x60')]['id']){delete _0x3b9c24['body']['id'];}return db[_0x3360('0x42')]['find']({'where':{'id':_0x3b9c24[_0x3360('0x5c')]['id']}})[_0x3360('0x25')](handleEntityNotFound(_0x114572,null))[_0x3360('0x25')](function(_0x51f975){if(_0x51f975){_0x3b9c24[_0x3360('0x60')][_0x3360('0x6a')]=_0x51f975['id'];return db[_0x3360('0x6b')][_0x3360('0x5f')](_0x3b9c24[_0x3360('0x60')]);}})['then'](respondWithResult(_0x114572,null))[_0x3360('0x5a')](handleError(_0x114572,null));};exports[_0x3360('0x6c')]=function(_0x799497,_0x4282dd,_0x8caed2){var _0x3fa7b6={'raw':![],'where':{}};var _0x37d136={};var _0x4ea58b={'count':0x0,'rows':[]};return db[_0x3360('0x42')][_0x3360('0x6d')]({'where':{'id':_0x799497[_0x3360('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4282dd,null))['then'](function(_0x3dcc7f){if(_0x3dcc7f){_0x37d136[_0x3360('0x45')]=_[_0x3360('0x47')](db[_0x3360('0x6b')]['rawAttributes']);_0x37d136['query']=_[_0x3360('0x47')](_0x799497[_0x3360('0x46')]);_0x37d136[_0x3360('0x48')]=_[_0x3360('0x49')](_0x37d136[_0x3360('0x45')],_0x37d136[_0x3360('0x46')]);_0x3fa7b6['attributes']=_['intersection'](_0x37d136['model'],qs['fields'](_0x799497[_0x3360('0x46')][_0x3360('0x4b')]));_0x3fa7b6['attributes']=_0x3fa7b6[_0x3360('0x4a')][_0x3360('0x4c')]?_0x3fa7b6[_0x3360('0x4a')]:_0x37d136[_0x3360('0x45')];if(!_0x799497[_0x3360('0x46')][_0x3360('0x4d')](_0x3360('0x6e'))){_0x3fa7b6[_0x3360('0x35')]=qs[_0x3360('0x35')](_0x799497[_0x3360('0x46')][_0x3360('0x35')]);_0x3fa7b6[_0x3360('0x33')]=qs[_0x3360('0x33')](_0x799497[_0x3360('0x46')]['offset']);}_0x3fa7b6['order']=qs[_0x3360('0x4f')](_0x799497[_0x3360('0x46')][_0x3360('0x4f')]);_0x3fa7b6[_0x3360('0x52')]=qs[_0x3360('0x48')](_[_0x3360('0x50')](_0x799497[_0x3360('0x46')],_0x37d136[_0x3360('0x48')]));_0x3fa7b6[_0x3360('0x52')][_0x3360('0x6a')]=_0x3dcc7f['id'];if(_0x799497[_0x3360('0x46')][_0x3360('0x51')]){_0x3fa7b6['where']=_[_0x3360('0x53')](_0x3fa7b6[_0x3360('0x52')],{'$or':_['map'](_0x3fa7b6[_0x3360('0x4a')],function(_0x3effcd){var _0x574c5a={};_0x574c5a[_0x3effcd]={'$like':'%'+_0x799497['query'][_0x3360('0x51')]+'%'};return _0x574c5a;})});}_0x3fa7b6=_['merge']({},_0x3fa7b6,_0x799497['options']);return db[_0x3360('0x6b')][_0x3360('0x57')]({'where':_0x3fa7b6[_0x3360('0x52')]})[_0x3360('0x25')](function(_0x3fb0a2){_0x4ea58b['count']=_0x3fb0a2;if(_0x799497['query'][_0x3360('0x6f')]){_0x3fa7b6[_0x3360('0x58')]=[{'all':!![]}];}return db[_0x3360('0x6b')][_0x3360('0x70')](_0x3fa7b6);})[_0x3360('0x25')](function(_0x3ec6c2){_0x4ea58b[_0x3360('0x59')]=_0x3ec6c2;return _0x4ea58b;});}})[_0x3360('0x25')](respondWithFilteredResult(_0x4282dd,_0x3fa7b6))[_0x3360('0x5a')](handleError(_0x4282dd,null));};exports[_0x3360('0x71')]=function(_0x5f418a,_0x282df5,_0x46408d){return db[_0x3360('0x42')][_0x3360('0x5e')]({'where':{'id':_0x5f418a[_0x3360('0x5c')]['id']}})[_0x3360('0x25')](handleEntityNotFound(_0x282df5,null))[_0x3360('0x25')](function(_0x498e66){if(_0x498e66){return _0x498e66[_0x3360('0x71')](_0x5f418a[_0x3360('0x46')]['ids']);}})[_0x3360('0x25')](respondWithStatusCode(_0x282df5,null))[_0x3360('0x5a')](handleError(_0x282df5,null));};exports['addAnswer']=function(_0x47b6f7,_0x20fe91,_0x44fae0){if(_0x47b6f7[_0x3360('0x60')]['id']){delete _0x47b6f7['body']['id'];}return db['ChatWebsite'][_0x3360('0x5e')]({'where':{'id':_0x47b6f7[_0x3360('0x5c')]['id']}})[_0x3360('0x25')](handleEntityNotFound(_0x20fe91,null))[_0x3360('0x25')](function(_0x4e8375){if(_0x4e8375){_0x47b6f7[_0x3360('0x60')]['ChatWebsiteId']=_0x4e8375['id'];return db[_0x3360('0x72')][_0x3360('0x5f')](_0x47b6f7[_0x3360('0x60')]);}})[_0x3360('0x25')](respondWithResult(_0x20fe91,null))[_0x3360('0x5a')](handleError(_0x20fe91,null));};exports[_0x3360('0x73')]=function(_0x4bbd77,_0x39c8a9,_0x408b10){var _0x4c7fcd={'raw':![],'where':{}};var _0x25c369={};var _0x27e981={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x3360('0x6d')]({'where':{'id':_0x4bbd77['params']['id']}})[_0x3360('0x25')](handleEntityNotFound(_0x39c8a9,null))[_0x3360('0x25')](function(_0x308f9c){if(_0x308f9c){_0x25c369[_0x3360('0x45')]=_[_0x3360('0x47')](db[_0x3360('0x72')][_0x3360('0x43')]);_0x25c369[_0x3360('0x46')]=_[_0x3360('0x47')](_0x4bbd77[_0x3360('0x46')]);_0x25c369[_0x3360('0x48')]=_[_0x3360('0x49')](_0x25c369['model'],_0x25c369[_0x3360('0x46')]);_0x4c7fcd[_0x3360('0x4a')]=_[_0x3360('0x49')](_0x25c369['model'],qs[_0x3360('0x4b')](_0x4bbd77['query']['fields']));_0x4c7fcd['attributes']=_0x4c7fcd[_0x3360('0x4a')]['length']?_0x4c7fcd[_0x3360('0x4a')]:_0x25c369[_0x3360('0x45')];if(!_0x4bbd77[_0x3360('0x46')][_0x3360('0x4d')](_0x3360('0x6e'))){_0x4c7fcd['limit']=qs[_0x3360('0x35')](_0x4bbd77[_0x3360('0x46')][_0x3360('0x35')]);_0x4c7fcd[_0x3360('0x33')]=qs[_0x3360('0x33')](_0x4bbd77['query']['offset']);}_0x4c7fcd[_0x3360('0x4e')]=qs['sort'](_0x4bbd77[_0x3360('0x46')][_0x3360('0x4f')]);_0x4c7fcd[_0x3360('0x52')]=qs['filters'](_[_0x3360('0x50')](_0x4bbd77[_0x3360('0x46')],_0x25c369[_0x3360('0x48')]));_0x4c7fcd[_0x3360('0x52')][_0x3360('0x6a')]=_0x308f9c['id'];if(_0x4bbd77[_0x3360('0x46')]['filter']){_0x4c7fcd['where']=_[_0x3360('0x53')](_0x4c7fcd[_0x3360('0x52')],{'$or':_[_0x3360('0x41')](_0x4c7fcd[_0x3360('0x4a')],function(_0x39ca95){var _0x5c31d6={};_0x5c31d6[_0x39ca95]={'$like':'%'+_0x4bbd77[_0x3360('0x46')][_0x3360('0x51')]+'%'};return _0x5c31d6;})});}_0x4c7fcd=_[_0x3360('0x53')]({},_0x4c7fcd,_0x4bbd77['options']);return db['CannedAnswer'][_0x3360('0x57')]({'where':_0x4c7fcd[_0x3360('0x52')]})[_0x3360('0x25')](function(_0x203d8a){_0x27e981[_0x3360('0x57')]=_0x203d8a;if(_0x4bbd77[_0x3360('0x46')]['includeAll']){_0x4c7fcd[_0x3360('0x58')]=[{'all':!![]}];}return db[_0x3360('0x72')]['findAll'](_0x4c7fcd);})['then'](function(_0x212c8a){_0x27e981['rows']=_0x212c8a;return _0x27e981;});}})[_0x3360('0x25')](respondWithFilteredResult(_0x39c8a9,_0x4c7fcd))[_0x3360('0x5a')](handleError(_0x39c8a9,null));};exports[_0x3360('0x74')]=function(_0x22a70a,_0x44767e,_0x561964){return db['ChatWebsite'][_0x3360('0x5e')]({'where':{'id':_0x22a70a[_0x3360('0x5c')]['id']}})[_0x3360('0x25')](handleEntityNotFound(_0x44767e,null))['then'](function(_0x2f6773){if(_0x2f6773){return _0x2f6773['removeAnswers'](_0x22a70a[_0x3360('0x46')][_0x3360('0x75')]);}})[_0x3360('0x25')](respondWithStatusCode(_0x44767e,null))[_0x3360('0x5a')](handleError(_0x44767e,null));};exports['addLogo']=function(_0x16a9e1,_0x49f04c,_0x4a7d5f){_0x16a9e1[_0x3360('0x60')]['sitepic']=_0x16a9e1[_0x3360('0x76')]['filename'];return db[_0x3360('0x42')][_0x3360('0x5e')]({'where':{'id':_0x16a9e1['params']['id']}})['then'](handleEntityNotFound(_0x49f04c,null))[_0x3360('0x25')](saveUpdates(_0x16a9e1[_0x3360('0x60')],null))[_0x3360('0x25')](respondWithResult(_0x49f04c,null))['catch'](handleError(_0x49f04c,null));};exports[_0x3360('0x77')]=function(_0x2d8ead,_0x13a345,_0x1e3a77){_0x2d8ead['body']['agentAvatar']=_0x2d8ead['file'][_0x3360('0x78')];return db[_0x3360('0x42')][_0x3360('0x5e')]({'where':{'id':_0x2d8ead[_0x3360('0x5c')]['id']}})['then'](handleEntityNotFound(_0x13a345,null))['then'](saveUpdates(_0x2d8ead['body'],null))['then'](respondWithResult(_0x13a345,null))[_0x3360('0x5a')](handleError(_0x13a345,null));};exports['addCustomerAvatar']=function(_0x525ee4,_0x416222,_0x38a9fe){_0x525ee4[_0x3360('0x60')]['customerAvatar']=_0x525ee4[_0x3360('0x76')][_0x3360('0x78')];return db['ChatWebsite'][_0x3360('0x5e')]({'where':{'id':_0x525ee4[_0x3360('0x5c')]['id']}})[_0x3360('0x25')](handleEntityNotFound(_0x416222,null))['then'](saveUpdates(_0x525ee4[_0x3360('0x60')],null))[_0x3360('0x25')](respondWithResult(_0x416222,null))['catch'](handleError(_0x416222,null));};exports[_0x3360('0x79')]=function(_0x344c4f,_0x36230a,_0x179fdc){_0x344c4f[_0x3360('0x60')][_0x3360('0x7a')]=_0x344c4f['file'][_0x3360('0x78')];return db[_0x3360('0x42')][_0x3360('0x5e')]({'where':{'id':_0x344c4f[_0x3360('0x5c')]['id']}})['then'](handleEntityNotFound(_0x36230a,null))[_0x3360('0x25')](saveUpdates(_0x344c4f[_0x3360('0x60')],null))[_0x3360('0x25')](respondWithResult(_0x36230a,null))[_0x3360('0x5a')](handleError(_0x36230a,null));};exports[_0x3360('0x7b')]=function(_0x58bc2b,_0x1d909e,_0x117ef1){var _0x154268=path[_0x3360('0x7c')](config['root'],_0x3360('0x7d'));var _0x3f150a={'where':{'id':_0x58bc2b[_0x3360('0x5c')]['id']},'attributes':['id',_0x3360('0x7e')],'raw':!![]};var _0x2d4f3c=![];return require('../../config/license/util')[_0x3360('0x7f')]()[_0x3360('0x25')](function(_0x1fabbc){if(_0x1fabbc){_0x2d4f3c=_0x1fabbc[_0x3360('0x80')];}})[_0x3360('0x25')](function(){return db['ChatWebsite'][_0x3360('0x5e')](_0x3f150a);})['then'](handleEntityNotFound(_0x1d909e,null))[_0x3360('0x25')](function(_0x15f604){if(_0x15f604){if(!_[_0x3360('0x81')](_0x15f604[_0x3360('0x7e')])){if(fs['existsSync'](path[_0x3360('0x7c')](config[_0x3360('0x82')],_0x3360('0x83'),_0x15f604[_0x3360('0x7e')]))&&_0x2d4f3c){_0x154268=path[_0x3360('0x7c')](config[_0x3360('0x82')],_0x3360('0x83'),_0x15f604[_0x3360('0x7e')]);}}return _0x1d909e[_0x3360('0x84')](_0x154268);}})[_0x3360('0x5a')](handleError(_0x1d909e,null));};exports[_0x3360('0x85')]=function(_0x30d8f7,_0x3f8b75,_0x1d969a){var _0x199e7d=path[_0x3360('0x7c')](config[_0x3360('0x82')],_0x3360('0x86'));var _0x17518b={'where':{'id':_0x30d8f7[_0x3360('0x5c')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x3360('0x42')][_0x3360('0x5e')](_0x17518b)[_0x3360('0x25')](handleEntityNotFound(_0x3f8b75,null))['then'](function(_0x4c586a){if(_0x4c586a){if(!_['isNil'](_0x4c586a[_0x3360('0x87')])){if(fs[_0x3360('0x88')](path[_0x3360('0x7c')](config[_0x3360('0x82')],_0x3360('0x89'),_0x4c586a[_0x3360('0x87')]))){_0x199e7d=path[_0x3360('0x7c')](config[_0x3360('0x82')],_0x3360('0x89'),_0x4c586a[_0x3360('0x87')]);}}return _0x3f8b75[_0x3360('0x84')](_0x199e7d);}})[_0x3360('0x5a')](handleError(_0x3f8b75,null));};exports[_0x3360('0x8a')]=function(_0x4b0d2a,_0x485ef5,_0x40e792){var _0x2d23c8=path[_0x3360('0x7c')](config[_0x3360('0x82')],_0x3360('0x8b'));var _0x24a362={'where':{'id':_0x4b0d2a[_0x3360('0x5c')]['id']},'attributes':['id','customerAvatar',_0x3360('0x8c')],'raw':!![]};return db[_0x3360('0x42')]['find'](_0x24a362)[_0x3360('0x25')](handleEntityNotFound(_0x485ef5,null))[_0x3360('0x25')](function(_0x16f1a2){if(_0x16f1a2){if(!_[_0x3360('0x81')](_0x16f1a2[_0x3360('0x8d')])){if(fs[_0x3360('0x88')](path[_0x3360('0x7c')](config[_0x3360('0x82')],_0x3360('0x89'),_0x16f1a2[_0x3360('0x8d')]))&&_0x16f1a2[_0x3360('0x8c')]){_0x2d23c8=path[_0x3360('0x7c')](config[_0x3360('0x82')],_0x3360('0x89'),_0x16f1a2[_0x3360('0x8d')]);}}return _0x485ef5[_0x3360('0x84')](_0x2d23c8);}})[_0x3360('0x5a')](handleError(_0x485ef5,null));};exports['getSystemAvatar']=function(_0x58edda,_0xfe94ba,_0x25bdbb){var _0x184ad1=path[_0x3360('0x7c')](config[_0x3360('0x82')],_0x3360('0x8e'));var _0x730ba8={'where':{'id':_0x58edda[_0x3360('0x5c')]['id']},'attributes':['id',_0x3360('0x7a')],'raw':!![]};return db[_0x3360('0x42')]['find'](_0x730ba8)[_0x3360('0x25')](handleEntityNotFound(_0xfe94ba,null))['then'](function(_0x2e26c5){if(_0x2e26c5){if(!_[_0x3360('0x81')](_0x2e26c5[_0x3360('0x7a')])){if(fs['existsSync'](path[_0x3360('0x7c')](config[_0x3360('0x82')],'server/files/images/avatars/',_0x2e26c5[_0x3360('0x7a')]))){_0x184ad1=path['join'](config[_0x3360('0x82')],_0x3360('0x89'),_0x2e26c5[_0x3360('0x7a')]);}}return _0xfe94ba['download'](_0x184ad1);}})[_0x3360('0x5a')](handleError(_0xfe94ba,null));};exports['notify']=function(_0x4b675f,_0x1e990d,_0x29807b){var _0x19c6a8=require(_0x3360('0x8f'));var _0x15017d=new _0x19c6a8();var _0x4d50be=_0x15017d[_0x3360('0x90')](_0x4b675f[_0x3360('0x91')][_0x3360('0x92')])[_0x3360('0x93')]();var _0x48c153={'body':_0x4b675f[_0x3360('0x60')],'channel':_0x3360('0x94')};var _0x514d09=[];var _0x253b75=[];var _0x3955dd={};var _0x14e4c3=![];return db[_0x3360('0x95')][_0x3360('0x96')]()[_0x3360('0x25')](function(_0x25489f){if(!_0x25489f){throw new db['Sequelize'][(_0x3360('0x97'))]('no\x20available\x20attributes');}_0x514d09=_[_0x3360('0x98')](_[_0x3360('0x47')](_0x25489f),[_0x3360('0x99'),_0x3360('0x9a')]);_0x253b75=_[_0x3360('0x98')](_[_0x3360('0x47')](_0x25489f),[_0x3360('0x99'),_0x3360('0x9a'),'CompanyId',_0x3360('0x9b')]);if(_0x4b675f[_0x3360('0x60')]['id']){delete _0x4b675f[_0x3360('0x60')]['id'];}if(_['isNil'](_0x4b675f['body'][_0x3360('0x9c')])){throw new db[(_0x3360('0x9d'))]['ValidationError'](_0x3360('0x9e'));}if(_['isNil'](_0x4b675f[_0x3360('0x60')][_0x3360('0x60')])||_0x4b675f[_0x3360('0x60')][_0x3360('0x60')]===''){throw new db[(_0x3360('0x9d'))][(_0x3360('0x97'))](_0x3360('0x9f'));}if(_[_0x3360('0x81')](_0x4b675f[_0x3360('0x60')]['mapKey'])){throw new db['Sequelize'][(_0x3360('0x97'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x253b75);}if(!_[_0x3360('0xa0')](_0x253b75,_0x4b675f[_0x3360('0x60')][_0x3360('0xa1')])){throw new db['Sequelize'][(_0x3360('0x97'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x253b75);}_0x3955dd[_0x4b675f['body'][_0x3360('0xa1')]]=_0x4b675f[_0x3360('0x60')][_0x3360('0x9c')];})[_0x3360('0x25')](function(){return db[_0x3360('0x42')]['find']({'where':{'id':_0x4b675f['params']['id']},'include':[{'model':db[_0x3360('0xa2')],'as':_0x3360('0xa3'),'include':[{'model':db[_0x3360('0x95')],'as':_0x3360('0xa4'),'where':_0x3955dd,'limit':0x1,'order':[[_0x3360('0x9a'),'DESC']]}]},{'model':db['ChatApplication'],'as':'Applications'}]});})[_0x3360('0x25')](handleEntityNotFound(_0x1e990d,null))[_0x3360('0x25')](function(_0x1e2fe1){if(_0x1e2fe1&&_0x1e2fe1[_0x3360('0xa3')]){_0x48c153[_0x3360('0xa5')]=_0x1e2fe1;_0x48c153[_0x3360('0xa6')]=_0x1e2fe1[_0x3360('0xa7')];_0x48c153[_0x3360('0xa8')]=_0x1e2fe1[_0x3360('0xa3')];_0x48c153[_0x3360('0xa6')]=_[_0x3360('0xa9')](_0x48c153[_0x3360('0xa6')],['priority'],[_0x3360('0xaa')]);if(_0x48c153['account'][_0x3360('0xa7')]){delete _0x48c153['account'][_0x3360('0xa7')];}if(_0x48c153['account'][_0x3360('0xa3')]&&_0x48c153[_0x3360('0xa5')][_0x3360('0xa3')][_0x3360('0xa4')][_0x3360('0x4c')]){return _0x48c153[_0x3360('0xa5')][_0x3360('0xa3')][_0x3360('0xa4')][0x0];}var _0x56fe55=_[_0x3360('0x1c')](_0x4b675f[_0x3360('0x60')],{'firstName':_0x4b675f['body'][_0x3360('0x9c')],'ListId':_0x1e2fe1[_0x3360('0x9b')]});_0x56fe55[_0x4b675f['body']['mapKey']]=_0x4b675f[_0x3360('0x60')][_0x3360('0x9c')];return db[_0x3360('0x95')][_0x3360('0x5f')](_0x56fe55,{'fields':_0x514d09,'raw':!![]});}})[_0x3360('0x25')](handleEntityNotFound(_0x1e990d,null))[_0x3360('0x25')](function(_0x52c2c3){_0x48c153[_0x3360('0xab')]=_0x52c2c3;var _0x21a1cc=_0x4b675f[_0x3360('0x60')][_0x3360('0xac')];if(_0x4b675f['headers']['cf-connecting-ip']){_0x21a1cc=_0x4b675f[_0x3360('0x91')]['cf-connecting-ip'];}else if(_0x4b675f[_0x3360('0x91')][_0x3360('0xad')]){_0x21a1cc=_[_0x3360('0xae')](_0x4b675f[_0x3360('0x91')][_0x3360('0xad')]['split'](','));}if(_0x52c2c3){var _0x48cd60={'ContactId':_0x52c2c3['id'],'ChatWebsiteId':_0x4b675f[_0x3360('0x5c')]['id'],'from':(_0x52c2c3[_0x3360('0xaf')]||'')+'\x20'+(_0x52c2c3[_0x3360('0xb0')]||''),'customerIp':_0x21a1cc,'customerPort':_0x4b675f[_0x3360('0x91')][_0x3360('0xb1')]?_0x4b675f['headers']['x-real-port']:null,'referer':_0x4b675f['body'][_0x3360('0xb2')],'browserName':_0x4d50be[_0x3360('0xb3')]['name']&&_0x4d50be['browser'][_0x3360('0xb4')]?util[_0x3360('0xb5')](_0x3360('0xb6'),_0x4d50be[_0x3360('0xb3')]['name'],_0x4d50be['browser'][_0x3360('0xb4')]):'unknown','browserVersion':_0x4d50be[_0x3360('0xb3')][_0x3360('0xb4')]||_0x3360('0xb7'),'osName':util[_0x3360('0xb5')](_0x3360('0xb6'),_0x4d50be['os']['name'],_0x4d50be['os']['version']),'osVersion':_0x4d50be['os'][_0x3360('0xb4')],'deviceModel':_0x4d50be[_0x3360('0xb8')][_0x3360('0x45')]&&_0x4d50be[_0x3360('0xb8')][_0x3360('0xb9')]?util[_0x3360('0xb5')](_0x3360('0xba'),_0x4d50be['device']['model'],_0x4d50be[_0x3360('0xb8')][_0x3360('0xb9')],_0x4d50be[_0x3360('0xb8')][_0x3360('0x54')]):null,'deviceVendor':_0x4d50be[_0x3360('0xb8')][_0x3360('0xb9')],'deviceType':_0x4d50be[_0x3360('0xb8')]['type'],'formData':JSON[_0x3360('0x2a')](_0x4b675f['body'])};var _0x9b578={'ChatWebsiteId':_0x4b675f[_0x3360('0x5c')]['id'],'closed':![]};if(_0x4b675f[_0x3360('0x60')]['threadId']){_0x9b578['threadId']=_0x4b675f['body'][_0x3360('0xbb')];return db[_0x3360('0xbc')][_0x3360('0x5e')]({'where':_0x9b578})[_0x3360('0x25')](function(_0x214ab7){if(_0x214ab7){return[_0x214ab7,![]];}_0x48cd60[_0x3360('0xbb')]=_0x4b675f['body']['threadId'];_0x48cd60[_0x3360('0xbd')]=_0x4b675f[_0x3360('0x60')][_0x3360('0xbd')];return db[_0x3360('0xbc')][_0x3360('0x5f')](_0x48cd60)['then'](function(_0x92992e){return[_0x92992e,!![]];});});}_0x9b578[_0x3360('0xbe')]=_0x52c2c3['id'];if(_0x4b675f[_0x3360('0x60')][_0x3360('0xbf')]&&_0x4b675f[_0x3360('0x60')][_0x3360('0xbf')]['id']){_0x9b578['id']=_0x4b675f[_0x3360('0x60')][_0x3360('0xbf')]['id'];return db[_0x3360('0xbc')]['find']({'where':_0x9b578})['then'](function(_0x217445){if(_0x217445){return[_0x217445,![]];}return db[_0x3360('0xbc')][_0x3360('0x5f')](_0x48cd60)[_0x3360('0x25')](function(_0x170983){return[_0x170983,!![]];});});}return db[_0x3360('0xbc')]['create'](_0x48cd60)['then'](function(_0x404bd8){return[_0x404bd8,!![]];});}})[_0x3360('0xc0')](function(_0x43cff2,_0xce9590){if(_0x43cff2){_0x14e4c3=_0xce9590;if(!_0xce9590){var _0x3e6b06={'from':(_0x48c153[_0x3360('0xab')][_0x3360('0xaf')]||'')+'\x20'+(_0x48c153['contact'][_0x3360('0xb0')]||'')};if(_0x4b675f[_0x3360('0x60')][_0x3360('0xbb')]&&_0x4b675f[_0x3360('0x60')][_0x3360('0xc1')]&&_0x4b675f['body']['threadId']!=_0x4b675f[_0x3360('0x60')][_0x3360('0xc1')]){_0x3e6b06[_0x3360('0xbb')]=_0x4b675f['body'][_0x3360('0xc1')];}return _0x43cff2[_0x3360('0x68')](_0x3e6b06);}else{return _0x43cff2;}}})[_0x3360('0x25')](function(_0x579e11){_0x48c153[_0x3360('0xbf')]=_0x579e11[_0x3360('0x3a')]({'plain':!![]});_0x48c153['interaction'][_0x3360('0xc2')]=_0x14e4c3;if(_0x48c153[_0x3360('0xbf')][_0x3360('0xc2')]){if(_0x48c153[_0x3360('0xa5')][_0x3360('0xc3')]){_0x48c153[_0x3360('0xa6')][_0x3360('0xc4')]({'id':0x0,'priority':_0x48c153[_0x3360('0xa6')][_0x3360('0x4c')]+0x1,'app':_0x3360('0xc5'),'appdata':_0x3360('0xc6'),'interval':_0x3360('0xc7')});}}return db['ChatMessage'][_0x3360('0x5f')]({'body':_0x4b675f['body'][_0x3360('0x60')],'ChatWebsiteId':_0x4b675f[_0x3360('0x5c')]['id'],'ChatInteractionId':_0x579e11['id'],'direction':'in','ContactId':_0x48c153[_0x3360('0xab')]['id'],'AttachmentId':_0x4b675f['body'][_0x3360('0xc8')]});})[_0x3360('0x25')](function(_0x2ef4bf){_0x48c153[_0x3360('0x2d')]=_0x2ef4bf;if(_0x48c153[_0x3360('0xbf')][_0x3360('0xc9')]){return db[_0x3360('0xca')]['find']({'attributes':['id',_0x3360('0x3d')],'where':{'id':_0x48c153[_0x3360('0xbf')][_0x3360('0xc9')]}})[_0x3360('0x25')](function(_0x554526){if(_0x554526){_0x48c153['applications'][_0x3360('0xcb')]({'id':0x0,'priority':0x0,'app':_0x3360('0xcc'),'appdata':_0x554526[_0x3360('0x3d')]+','+(_0x48c153[_0x3360('0xa5')][_0x3360('0xcd')]||0xa),'interval':_0x3360('0xc7')});_0x48c153[_0x3360('0xce')]=!![];}return respondWithRpcPromise('Start',_0x3360('0xcf'),_0x48c153);});}return respondWithRpcPromise(_0x3360('0xd0'),_0x3360('0xcf'),_0x48c153);})[_0x3360('0x25')](function(_0x51b1d6){respondWithRpcPromise(_0x3360('0xd1'),_0x3360('0xd1'),{'event':_0x3360('0xd2'),'message':_0x51b1d6},client9002);return _0x51b1d6;})['then'](respondWithResult(_0x1e990d,null))[_0x3360('0x5a')](handleError(_0x1e990d,null));};exports[_0x3360('0xd3')]=function(_0x28d20c,_0x3f2004,_0x576c34){var _0x4e4eff,_0x1ed81a,_0xc45de5;var _0xd54bb7=[];var _0x31c6f3=[];var _0x1bf78d={};var _0x3edb07=_0x28d20c['files']||[];var _0x6fb5bf=[];var _0x35b7d2;return db[_0x3360('0x95')][_0x3360('0x96')]()[_0x3360('0x25')](function(_0x489511){if(!_0x489511){throw new db[(_0x3360('0x9d'))][(_0x3360('0x97'))]('no\x20available\x20attributes');}_0x31c6f3=_[_0x3360('0x98')](_[_0x3360('0x47')](_0x489511),[_0x3360('0x99'),'updatedAt']);_0xd54bb7=_['difference'](_[_0x3360('0x47')](_0x489511),[_0x3360('0x99'),_0x3360('0x9a'),'CompanyId',_0x3360('0x9b')]);if(_0x28d20c['body']['id']){delete _0x28d20c['body']['id'];}if(_['isNil'](_0x28d20c[_0x3360('0x60')]['from'])){throw _0x3f2004[_0x3360('0x31')](0x1f4)[_0x3360('0x3e')](new db[(_0x3360('0x9d'))][(_0x3360('0x97'))]('from\x20is\x20mandatory'));}if(_['isNil'](_0x28d20c['body'][_0x3360('0x60')])||_0x28d20c[_0x3360('0x60')][_0x3360('0x60')]===''){throw _0x3f2004[_0x3360('0x31')](0x1f4)[_0x3360('0x3e')](new db[(_0x3360('0x9d'))][(_0x3360('0x97'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x28d20c[_0x3360('0x60')]['mapKeyOffline'])){throw _0x3f2004['status'](0x1f4)[_0x3360('0x3e')](new db['Sequelize']['ValidationError'](_0x3360('0xd4')+_0xd54bb7));}if(!_[_0x3360('0xa0')](_0xd54bb7,_0x28d20c['body'][_0x3360('0xd5')])){throw _0x3f2004['status'](0x1f4)['send'](new db[(_0x3360('0x9d'))][(_0x3360('0x97'))](_0x3360('0xd6')+_0xd54bb7));}_0x1bf78d[_0x28d20c['body'][_0x3360('0xd5')]]=_0x28d20c['body']['from'];})[_0x3360('0x25')](function(){return db[_0x3360('0x42')]['find']({'where':{'id':_0x28d20c[_0x3360('0x5c')]['id']},'include':[{'model':db[_0x3360('0xa2')],'as':_0x3360('0xa3')},{'model':db[_0x3360('0xd7')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x3f2004,null))['then'](function(_0x3d643f){if(_0x3d643f&&_0x3d643f[_0x3360('0xa3')]){_0x1ed81a=_0x3d643f;var _0x49c763=_[_0x3360('0x1c')](_0x28d20c[_0x3360('0x60')],{'firstName':_0x28d20c[_0x3360('0x60')][_0x3360('0x9c')],'phone':_0x28d20c['body'][_0x3360('0x9c')],'ListId':_0x3d643f[_0x3360('0x9b')]});_0x49c763[_0x28d20c[_0x3360('0x60')][_0x3360('0xd5')]]=_0x28d20c[_0x3360('0x60')][_0x3360('0x9c')];return db[_0x3360('0x95')]['findOrCreate']({'where':_0x1bf78d,'defaults':_0x49c763});}})[_0x3360('0xc0')](function(_0x3c3917){if(_0x3c3917){_0xc45de5=_0x3c3917;var _0x4f9006=fs[_0x3360('0xd8')](path[_0x3360('0x7c')](config['root'],'server/files/templates/chatOfflineMessage.ejs'),_0x3360('0xd9'));var _0x4079e6=ejs['render'](_0x4f9006,{'body':_[_0x3360('0xda')](_0x28d20c[_0x3360('0x60')]['body']),'bodyTitle':_0x1ed81a[_0x3360('0xdb')]});return db[_0x3360('0xdc')][_0x3360('0x5f')]({'body':_0x4079e6,'ContactId':_0x3c3917['id'],'ChatWebsiteId':_0x1ed81a['id']});}})[_0x3360('0x25')](function(_0x244ae4){_0x35b7d2=_0x244ae4;if(_0x3edb07['length']){var _0x102bc3=_0x3edb07['map'](function(_0x320a28){return{'name':_0x320a28[_0x3360('0xdd')],'basename':_0x320a28[_0x3360('0x78')],'type':_0x320a28['mimetype'],'ChatOfflineMessageId':_0x244ae4['id']};});_0x6fb5bf=_0x102bc3[_0x3360('0x41')](_0x2998a7=>{var _0x360f47={'filename':_0x2998a7[_0x3360('0x3d')],'path':path[_0x3360('0x7c')](config[_0x3360('0x82')],_0x3360('0xde'),'files',_0x3360('0xdf'),_0x3360('0xe0'),_0x2998a7[_0x3360('0xe1')])};return _0x360f47;});if(!_0x1ed81a['openNewInteraction']){return db[_0x3360('0xe2')]['transaction'](function(_0x2c5e59){return db['Attachment'][_0x3360('0xe3')](_0x102bc3,{'transaction':_0x2c5e59});});}}})[_0x3360('0x25')](function(){if(_0x35b7d2){_0x4e4eff=_0x35b7d2;return db[_0x3360('0xd7')]['findOne']({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0x3360('0xe4'),'raw':!![]}]});}})[_0x3360('0x25')](function(_0xb1717e){if(_0xb1717e&&_0xb1717e[_0x3360('0xe4')]&&_0x1ed81a[_0x3360('0xe5')]&&_0x1ed81a[_0x3360('0xe6')]){var _0x336e11={'tls':{'rejectUnauthorized':![]}};if(_0xb1717e[_0x3360('0xe4')][_0x3360('0xe7')]){_0x336e11[_0x3360('0xe7')]=_0xb1717e['Smtp']['service'];}else{_0x336e11[_0x3360('0xe8')]=_0xb1717e[_0x3360('0xe4')][_0x3360('0xe8')];_0x336e11[_0x3360('0xe9')]=_0xb1717e[_0x3360('0xe4')]['port'];_0x336e11[_0x3360('0xea')]=_0xb1717e['Smtp']['secure'];}if(_0xb1717e[_0x3360('0xe4')]['authentication']){_0x336e11[_0x3360('0xeb')]={'user':_0xb1717e['Smtp']['user'],'pass':_0xb1717e[_0x3360('0xe4')][_0x3360('0xec')]};}return respondWithRpcPromise(_0x3360('0xed'),_0x3360('0xee'),{'account':_0x336e11,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0xb1717e[_0x3360('0x3d')],_0xb1717e[_0x3360('0xef')]||_0xb1717e['Smtp'][_0x3360('0x63')]),'to':_0x1ed81a[_0x3360('0xe6')],'subject':_0x1ed81a[_0x3360('0xf0')],'html':_0x4e4eff[_0x3360('0x60')],'attachments':_0x6fb5bf}},client9003)[_0x3360('0x25')](function(){return _0x4e4eff;})['catch'](function(_0xaf9c8){console[_0x3360('0x2b')](_0xaf9c8);});}})[_0x3360('0x25')](function(){if(_0x1ed81a&&_0x1ed81a['openNewInteraction']&&_0x1ed81a[_0x3360('0xf1')]){var _0x37ca49=[];if(_0x3edb07['length']){_0x37ca49=_0x3edb07['map'](function(_0x202198){return{'name':_0x202198['originalname'],'basename':_0x202198[_0x3360('0x78')],'type':_0x202198[_0x3360('0xf2')],'ChatOfflineMessageId':_0x35b7d2['id']};});}var _0x3475ec;if(!_[_0x3360('0x81')](_0x1ed81a['subjectOffline'])){var _0x2609b9=_['map'](_0x28d20c[_0x3360('0x60')],function(_0x39675a){return _0x39675a;});var _0x559ff8=_[_0x3360('0xf3')](_0x2609b9)[0x0];var _0x44c405=_['mapValues'](_0x559ff8,function(_0x5daec9){return _0x5daec9;});_0x3475ec=_0x44c405[0x1][_0x1ed81a[_0x3360('0xf4')]];}var _0x359b23={'from':_0xc45de5['email'],'firstName':_0xc45de5[_0x3360('0xaf')],'lastName':_0xc45de5[_0x3360('0xb0')],'mapKey':'email','message':{'from':_0xc45de5[_0x3360('0xef')],'to':_0x1ed81a['MailAccount'][_0x3360('0xef')],'cc':'','subject':_[_0x3360('0x81')](_0x3475ec)?_0x1ed81a[_0x3360('0xf0')]:_0x3475ec,'messageId':'','sentAt':new Date(),'attach':_0x37ca49[_0x3360('0x4c')],'attachments':_0x37ca49,'originChannel':_0x3360('0xf5'),'ChatWebsiteId':_0x1ed81a['id'],'ChatOfflineMessageId':_0x4e4eff['id'],'originTo':_0x1ed81a['MailAccount'][_0x3360('0xef')]},'body':_0x4e4eff[_0x3360('0x60')]};var _0x24f594={'account':{'id':_0x1ed81a['MailAccountId']},'body':_0x359b23,'log':_0x3360('0xf6')};return respondWithRpcPromise(_0x3360('0xf6'),_0x3360('0xf7'),_0x24f594,client9001)[_0x3360('0x25')](function(){return _0x4e4eff;})[_0x3360('0x5a')](function(_0x332ad6){console[_0x3360('0x2b')](_0x332ad6);});}return;})[_0x3360('0x25')](function(){if(_0x4e4eff){return _0x4e4eff;}})[_0x3360('0x25')](respondWithResult(_0x3f2004,null))[_0x3360('0x5a')](function(_0x544ea7){console[_0x3360('0x2b')](_0x3360('0x5a'),_0x544ea7);for(var _0x2b8e47 of _0x3edb07){var _0x3d19da=path[_0x3360('0x7c')](config[_0x3360('0x82')],'server',_0x3360('0xf8'),_0x3360('0xdf'),'offline-chat',_0x2b8e47[_0x3360('0x78')]);fs_extra['remove'](_0x3d19da)['catch'](function(_0xcaa786){console[_0x3360('0x2b')](_0x3360('0xf9'),_0x3d19da,_0xcaa786);});}});};exports[_0x3360('0xfa')]=function(_0x44f9fa,_0x471407,_0xff0452){return db[_0x3360('0xbc')][_0x3360('0x5e')]({'where':{'id':_0x44f9fa[_0x3360('0x5c')]['id']}})['then'](handleEntityNotFound(_0x471407,null))[_0x3360('0x25')](function(_0x5a0b8e){if(_0x5a0b8e){return _0x5a0b8e[_0x3360('0xfa')](_0x44f9fa[_0x3360('0x60')][_0x3360('0x75')],_[_0x3360('0xfb')](_0x44f9fa[_0x3360('0x60')],[_0x3360('0x75'),'id'])||{});}})[_0x3360('0x25')](respondWithResult(_0x471407,null))[_0x3360('0x5a')](handleError(_0x471407,null));};exports[_0x3360('0xfc')]=function(_0x504d0e,_0x4eb3e4,_0x41c085){var _0x304fa0={'raw':![],'where':{}};var _0x320db5={};var _0x2ef208={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x504d0e[_0x3360('0x5c')]['id']}})[_0x3360('0x25')](handleEntityNotFound(_0x4eb3e4,null))[_0x3360('0x25')](function(_0x22fab0){if(_0x22fab0){_0x320db5[_0x3360('0x45')]=_[_0x3360('0x47')](db[_0x3360('0xbc')][_0x3360('0x43')]);_0x320db5[_0x3360('0x46')]=_[_0x3360('0x47')](_0x504d0e['query']);_0x320db5[_0x3360('0x48')]=_[_0x3360('0x49')](_0x320db5[_0x3360('0x45')],_0x320db5[_0x3360('0x46')]);_0x304fa0[_0x3360('0x4a')]=_[_0x3360('0x49')](_0x320db5[_0x3360('0x45')],qs['fields'](_0x504d0e[_0x3360('0x46')][_0x3360('0x4b')]));_0x304fa0[_0x3360('0x4a')]=_0x304fa0['attributes'][_0x3360('0x4c')]?_0x304fa0[_0x3360('0x4a')]:_0x320db5[_0x3360('0x45')];if(!_0x504d0e[_0x3360('0x46')][_0x3360('0x4d')](_0x3360('0x6e'))){_0x304fa0[_0x3360('0x35')]=qs['limit'](_0x504d0e[_0x3360('0x46')][_0x3360('0x35')]);_0x304fa0[_0x3360('0x33')]=qs[_0x3360('0x33')](_0x504d0e[_0x3360('0x46')]['offset']);}_0x304fa0['order']=qs['sort'](_0x504d0e[_0x3360('0x46')][_0x3360('0x4f')]);_0x304fa0[_0x3360('0x52')]=qs['filters'](_[_0x3360('0x50')](_0x504d0e[_0x3360('0x46')],_0x320db5['filters']));_0x304fa0[_0x3360('0x52')][_0x3360('0x6a')]=_0x22fab0['id'];if(_0x504d0e['query'][_0x3360('0x51')]){_0x304fa0[_0x3360('0x52')]=_[_0x3360('0x53')](_0x304fa0[_0x3360('0x52')],{'$or':_[_0x3360('0x41')](_0x304fa0[_0x3360('0x4a')],function(_0x4dd89a){var _0x3f1dbf={};_0x3f1dbf[_0x4dd89a]={'$like':'%'+_0x504d0e[_0x3360('0x46')]['filter']+'%'};return _0x3f1dbf;})});}_0x304fa0=_['merge']({},_0x304fa0,_0x504d0e[_0x3360('0x56')]);return db['ChatInteraction']['count']({'where':_0x304fa0['where']})[_0x3360('0x25')](function(_0x1460f6){_0x2ef208['count']=_0x1460f6;if(_0x504d0e['query'][_0x3360('0x6f')]){_0x304fa0[_0x3360('0x58')]=[{'model':db['CmContact'],'as':_0x3360('0xfd'),'required':![]},{'model':db[_0x3360('0xca')],'as':_0x3360('0xfe'),'attributes':[_0x3360('0x3d'),_0x3360('0xff'),_0x3360('0x100')],'required':![]},{'model':db[_0x3360('0x101')],'as':'Tags','attributes':['id',_0x3360('0x3d'),_0x3360('0x102')],'where':_0x504d0e[_0x3360('0x46')][_0x3360('0x103')]?{'id':_0x504d0e['query']['tag']}:undefined,'required':_0x504d0e['query'][_0x3360('0x103')]?!![]:![]}];}return db[_0x3360('0xbc')][_0x3360('0x70')](_0x304fa0);})[_0x3360('0x25')](function(_0x14e8fc){_0x2ef208[_0x3360('0x59')]=_0x14e8fc;return _0x2ef208;});}})[_0x3360('0x25')](respondWithFilteredResult(_0x4eb3e4,_0x304fa0))[_0x3360('0x5a')](handleError(_0x4eb3e4,null));};function iftimePromise(_0x1001ca,_0x347c30){return respondWithRpcPromise('Command',_0x3360('0x104'),{'command':_0x347c30[_0x3360('0x105')]?util[_0x3360('0xb5')](_0x3360('0x106'),_0x1001ca[_0x3360('0x107')],_0x347c30[_0x3360('0x105')]):util['format'](_0x3360('0x108'),_0x1001ca[_0x3360('0x107')])},client9002)[_0x3360('0x25')](function(_0x2bcfb8){var _0x4542d5=_0x2bcfb8&&_0x2bcfb8[_0x3360('0x109')](_0x3360('0x10a'))>=0x0?!![]:![];logger[_0x3360('0x26')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x347c30['id'],_0x1001ca['id'],_0x1001ca[_0x3360('0x107')],_0x4542d5?_0x3360('0x10b'):'OFFLINE',_0x347c30[_0x3360('0x105')]?_0x347c30[_0x3360('0x105')]:_0x3360('0x10c'));return _0x4542d5;})['catch'](function(_0x4fcf9e){logger[_0x3360('0x2b')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x347c30['id'],_0x1001ca['id'],_0x1001ca[_0x3360('0x107')],util['inspect'](_0x4fcf9e,{'showHidden':![],'depth':null}),_0x347c30[_0x3360('0x105')]?_0x347c30['timezone']:_0x3360('0x10c'));return![];});}exports[_0x3360('0x104')]=function(_0x8b34d0,_0x338869,_0x76695e){var _0x999e4c=0x0;var _0x1dad48=0x0;var _0x1aeb46=![];var _0x1ff036;var _0x1823bb;return db[_0x3360('0x42')]['find']({'where':{'id':_0x8b34d0[_0x3360('0x5c')]['id']},'include':[{'model':db[_0x3360('0x10d')],'as':_0x3360('0x10d'),'include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0x3360('0x107')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x338869,null))[_0x3360('0x25')](function(_0x52c68c){if(_0x52c68c){_0x1ff036=_0x52c68c;return _0x52c68c[_0x3360('0x10e')]({'raw':!![]});}})['then'](function(_0x147fb8){if(_0x1ff036){if(_0x147fb8){_0x1823bb=_0x147fb8;}}return require('../../config/license/util')[_0x3360('0x7f')]();})['then'](function(_0xf46d25){if(_0xf46d25){_0x1dad48=_0xf46d25[_0x3360('0x10f')];_0x1aeb46=_0xf46d25[_0x3360('0x80')];}})['then'](function(){return db[_0x3360('0xbc')][_0x3360('0x57')]({'where':{'closed':![]}});})[_0x3360('0x25')](function(_0x16dbf5){_0x999e4c=_0x16dbf5;if(_0x1dad48&&_0x16dbf5>_0x1dad48){return db[_0x3360('0x110')][_0x3360('0x6d')]({'where':{'id':0x1}})['then'](function(_0x2c9161){if(_0x2c9161){_0x2c9161[_0x3360('0x111')](_0x3360('0x112'));}});}})[_0x3360('0x25')](function(){if(_0x1ff036['Interval']&&_0x1ff036[_0x3360('0x10d')][_0x3360('0x113')]){var _0x2c2654=[];for(var _0x1eeb88=0x0;_0x1eeb88<_0x1ff036[_0x3360('0x10d')][_0x3360('0x113')][_0x3360('0x4c')];_0x1eeb88++){var _0x1b12b2=_0x1ff036['Interval']['Intervals'][_0x1eeb88][_0x3360('0x3a')]({'plain':!![]});_0x2c2654[_0x3360('0xc4')](iftimePromise(_0x1b12b2,_0x1ff036));}return BPromise[_0x3360('0x114')](_0x2c2654)[_0x3360('0x25')](function(_0x289312){return _['some'](_0x289312);});}else{return!![];}})[_0x3360('0x25')](function(_0x4f8fb8){var _0x48919d=fs[_0x3360('0xd8')](path[_0x3360('0x7c')](config[_0x3360('0x82')],_0x3360('0x115')),_0x3360('0xd9'));var _0x187768={'remote':_0x1ff036[_0x3360('0x116')],'query':querystring['stringify'](_[_0x3360('0x53')](_0x1ff036[_0x3360('0x3a')]({'plain':!![]}),{'customerIp':_0x8b34d0[_0x3360('0x91')][_0x3360('0xad')]||_0x8b34d0['headers'][_0x3360('0x117')]||_0x8b34d0[_0x3360('0x118')][_0x3360('0x119')]||_0x8b34d0['ip'],'referer':_0x8b34d0[_0x3360('0x91')]['referer'],'openedInteractions':_0x999e4c,'maxInteractions':_0x1dad48,'virtual':_0x1aeb46[_0x3360('0x10f')],'online':_0x4f8fb8,'custom':_0x1aeb46}))['replace'](/'/g,'\x5c\x27')};_0x338869['send'](ejs['render'](Mustache['render'](_0x48919d,_0x187768),{'proactiveActions':_0x1823bb,'alignment':_0x1ff036[_0x3360('0x11a')],'verticalAlignment':_0x1ff036['verticalAlignment'],'div_color':_0x1ff036[_0x3360('0x102')],'text_color':_0x1ff036[_0x3360('0x11b')],'button_color':_0x1ff036['color_button'],'background_color':_0x1ff036[_0x3360('0x11c')]}));})[_0x3360('0x5a')](handleError(_0x338869,null));};exports[_0x3360('0x11d')]=function(_0x3f0c45,_0x4543ac,_0x37c25e){return db['ChatWebsite'][_0x3360('0x6d')]({'where':{'id':_0x3f0c45['params']['id']}})[_0x3360('0x25')](handleEntityNotFound(_0x4543ac,null))['then'](function(_0xde0d64){if(_0xde0d64){return db[_0x3360('0xe2')][_0x3360('0x11e')](function(_0x3cc050){return db[_0x3360('0x11f')][_0x3360('0x39')]({'where':{'ChatWebsiteId':_0x3f0c45[_0x3360('0x5c')]['id']},'transaction':_0x3cc050})[_0x3360('0x25')](function(_0x2d354a){var _0x76cd70=_['map'](_0x3f0c45['body'],function(_0x35252a){_0x35252a[_0x3360('0x6a')]=_0x3f0c45[_0x3360('0x5c')]['id'];return _0x35252a;});return db[_0x3360('0x11f')][_0x3360('0xe3')](_0x76cd70,{'transaction':_0x3cc050});});})[_0x3360('0x25')](function(){return db[_0x3360('0x11f')][_0x3360('0x120')]({'where':{'ChatWebsiteId':_0x3f0c45[_0x3360('0x5c')]['id']},'order':'priority'});});}})[_0x3360('0x25')](respondWithResult(_0x4543ac,null))[_0x3360('0x5a')](handleError(_0x4543ac,null));};exports[_0x3360('0x121')]=function(_0x1d79c2,_0x51e1bf,_0x55859b){var _0x2e6db0={};var _0x49e625={};var _0x5b4dc7;var _0x9312f8;return db[_0x3360('0x42')]['findOne']({'where':{'id':_0x1d79c2[_0x3360('0x5c')]['id']}})['then'](handleEntityNotFound(_0x51e1bf,null))[_0x3360('0x25')](function(_0x2dbd98){if(_0x2dbd98){_0x5b4dc7=_0x2dbd98;_0x49e625['model']=_[_0x3360('0x47')](db[_0x3360('0x11f')]['rawAttributes']);_0x49e625[_0x3360('0x46')]=_[_0x3360('0x47')](_0x1d79c2[_0x3360('0x46')]);_0x49e625[_0x3360('0x48')]=_['intersection'](_0x49e625[_0x3360('0x45')],_0x49e625[_0x3360('0x46')]);_0x2e6db0['attributes']=_[_0x3360('0x49')](_0x49e625[_0x3360('0x45')],qs[_0x3360('0x4b')](_0x1d79c2['query']['fields']));_0x2e6db0[_0x3360('0x4a')]=_0x2e6db0[_0x3360('0x4a')][_0x3360('0x4c')]?_0x2e6db0[_0x3360('0x4a')]:_0x49e625[_0x3360('0x45')];_0x2e6db0[_0x3360('0x4e')]=qs[_0x3360('0x4f')](_0x1d79c2[_0x3360('0x46')][_0x3360('0x4f')]);_0x2e6db0[_0x3360('0x52')]=qs['filters'](_['pick'](_0x1d79c2['query'],_0x49e625[_0x3360('0x48')]));if(_0x1d79c2[_0x3360('0x46')]['filter']){_0x2e6db0[_0x3360('0x52')]=_[_0x3360('0x53')](_0x2e6db0[_0x3360('0x52')],{'$or':_[_0x3360('0x41')](_0x2e6db0[_0x3360('0x4a')],function(_0x4b8d5e){var _0x3faa8c={};_0x3faa8c[_0x4b8d5e]={'$like':'%'+_0x1d79c2[_0x3360('0x46')][_0x3360('0x51')]+'%'};return _0x3faa8c;})});}_0x2e6db0=_[_0x3360('0x53')]({},_0x2e6db0,_0x1d79c2['options']);return _0x5b4dc7['getApplications'](_0x2e6db0);}})[_0x3360('0x25')](function(_0x201d08){if(_0x201d08){_0x9312f8=_0x201d08[_0x3360('0x4c')];if(!_0x1d79c2[_0x3360('0x46')][_0x3360('0x4d')](_0x3360('0x6e'))){_0x2e6db0[_0x3360('0x35')]=qs[_0x3360('0x35')](_0x1d79c2[_0x3360('0x46')]['limit']);_0x2e6db0[_0x3360('0x33')]=qs[_0x3360('0x33')](_0x1d79c2['query'][_0x3360('0x33')]);}return _0x5b4dc7[_0x3360('0x121')](_0x2e6db0);}})[_0x3360('0x25')](function(_0x227b22){if(_0x227b22){return _0x227b22?{'count':_0x9312f8,'rows':_0x227b22}:null;}})[_0x3360('0x25')](respondWithResult(_0x51e1bf,null))[_0x3360('0x5a')](handleError(_0x51e1bf,null));};exports[_0x3360('0x122')]=function(_0x971e34,_0x4b185a,_0x5dfac3){return db[_0x3360('0x123')][_0x3360('0x5e')]({'where':{'id':_0x971e34[_0x3360('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4b185a,null))['then'](function(_0x5627f2){if(_0x5627f2){return _0x5627f2[_0x3360('0x122')](_0x971e34[_0x3360('0x60')]['ids'],_[_0x3360('0xfb')](_0x971e34['body'],[_0x3360('0x75'),'id'])||{});}})['then'](respondWithResult(_0x4b185a,null))['catch'](handleError(_0x4b185a,null));};exports[_0x3360('0x10e')]=function(_0x29b430,_0x20c6e9,_0x53f3a4){var _0x3b0a05={};var _0x4f1cc8={};var _0x535777;var _0x2319c3;return db[_0x3360('0x42')][_0x3360('0x6d')]({'where':{'id':_0x29b430['params']['id']}})[_0x3360('0x25')](handleEntityNotFound(_0x20c6e9,null))['then'](function(_0x54a40b){if(_0x54a40b){_0x535777=_0x54a40b;_0x4f1cc8['model']=_['keys'](db[_0x3360('0x124')][_0x3360('0x43')]);_0x4f1cc8['query']=_[_0x3360('0x47')](_0x29b430['query']);_0x4f1cc8[_0x3360('0x48')]=_[_0x3360('0x49')](_0x4f1cc8[_0x3360('0x45')],_0x4f1cc8[_0x3360('0x46')]);_0x3b0a05[_0x3360('0x4a')]=_[_0x3360('0x49')](_0x4f1cc8[_0x3360('0x45')],qs[_0x3360('0x4b')](_0x29b430[_0x3360('0x46')][_0x3360('0x4b')]));_0x3b0a05[_0x3360('0x4a')]=_0x3b0a05['attributes'][_0x3360('0x4c')]?_0x3b0a05[_0x3360('0x4a')]:_0x4f1cc8[_0x3360('0x45')];_0x3b0a05[_0x3360('0x4e')]=qs[_0x3360('0x4f')](_0x29b430[_0x3360('0x46')][_0x3360('0x4f')]);_0x3b0a05['where']=qs[_0x3360('0x48')](_[_0x3360('0x50')](_0x29b430[_0x3360('0x46')],_0x4f1cc8[_0x3360('0x48')]));if(_0x29b430[_0x3360('0x46')][_0x3360('0x51')]){_0x3b0a05[_0x3360('0x52')]=_[_0x3360('0x53')](_0x3b0a05[_0x3360('0x52')],{'$or':_['map'](_0x3b0a05[_0x3360('0x4a')],function(_0x5d2f51){var _0x475add={};_0x475add[_0x5d2f51]={'$like':'%'+_0x29b430[_0x3360('0x46')]['filter']+'%'};return _0x475add;})});}_0x3b0a05=_[_0x3360('0x53')]({},_0x3b0a05,_0x29b430[_0x3360('0x56')]);return _0x535777['getProactiveActions'](_0x3b0a05);}})['then'](function(_0x5c2f9c){if(_0x5c2f9c){_0x2319c3=_0x5c2f9c['length'];if(!_0x29b430[_0x3360('0x46')][_0x3360('0x4d')]('nolimit')){_0x3b0a05[_0x3360('0x35')]=qs['limit'](_0x29b430[_0x3360('0x46')][_0x3360('0x35')]);_0x3b0a05['offset']=qs[_0x3360('0x33')](_0x29b430[_0x3360('0x46')]['offset']);}return _0x535777[_0x3360('0x10e')](_0x3b0a05);}})[_0x3360('0x25')](function(_0x3a7cc2){if(_0x3a7cc2){return _0x3a7cc2?{'count':_0x2319c3,'rows':_0x3a7cc2}:null;}})[_0x3360('0x25')](respondWithResult(_0x20c6e9,null))['catch'](handleError(_0x20c6e9,null));};exports[_0x3360('0x125')]=function(_0x5e9738,_0x5aa6a6,_0x1eb587){var _0x49f4a6=_0x5e9738[_0x3360('0x46')][_0x3360('0x126')]===_0x3360('0x127')?'offlineForm':_0x3360('0x128');return db[_0x3360('0x42')][_0x3360('0x5e')]({'attributes':['id',_0x49f4a6],'where':{'id':_0x5e9738['params']['id']}})[_0x3360('0x25')](handleEntityNotFound(_0x5aa6a6,null))[_0x3360('0x25')](function(_0x28e3d3){if(_0x28e3d3){var _0x41f729=_0x28e3d3[_0x49f4a6];var _0xd41731=_0x41f729&&_0x41f729[_0x3360('0x129')]?_0x41f729[_0x3360('0x129')]:[];_0x5aa6a6[_0x3360('0x3e')]({'fromKey':_[_0x3360('0x81')](_0x41f729[_0x3360('0x12a')])?undefined:_0x41f729[_0x3360('0x12a')],'count':_0xd41731[_0x3360('0x4c')],'rows':_0xd41731});}})[_0x3360('0x5a')](handleError(_0x5aa6a6,null));};exports[_0x3360('0x12b')]=function(_0x170f42,_0xa6edff,_0x37ba3d){var _0x43dba4={'raw':![],'where':{}};var _0x40f595={};var _0x4f1fe6={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x3360('0x6d')]({'where':{'id':_0x170f42[_0x3360('0x5c')]['id']}})[_0x3360('0x25')](handleEntityNotFound(_0xa6edff,null))[_0x3360('0x25')](function(_0x689483){if(_0x689483){_0x40f595[_0x3360('0x45')]=_[_0x3360('0x47')](db[_0x3360('0xdc')][_0x3360('0x43')]);_0x40f595[_0x3360('0x46')]=_[_0x3360('0x47')](_0x170f42[_0x3360('0x46')]);_0x40f595[_0x3360('0x48')]=_[_0x3360('0x49')](_0x40f595[_0x3360('0x45')],_0x40f595[_0x3360('0x46')]);_0x43dba4[_0x3360('0x4a')]=_['intersection'](_0x40f595[_0x3360('0x45')],qs['fields'](_0x170f42[_0x3360('0x46')][_0x3360('0x4b')]));_0x43dba4[_0x3360('0x4a')]=_0x43dba4[_0x3360('0x4a')][_0x3360('0x4c')]?_0x43dba4['attributes']:_0x40f595[_0x3360('0x45')];if(!_0x170f42['query']['hasOwnProperty'](_0x3360('0x6e'))){_0x43dba4[_0x3360('0x35')]=qs['limit'](_0x170f42[_0x3360('0x46')][_0x3360('0x35')]);_0x43dba4[_0x3360('0x33')]=qs[_0x3360('0x33')](_0x170f42[_0x3360('0x46')][_0x3360('0x33')]);}_0x43dba4[_0x3360('0x4e')]=qs[_0x3360('0x4f')](_0x170f42[_0x3360('0x46')]['sort']);_0x43dba4[_0x3360('0x52')]=qs[_0x3360('0x48')](_[_0x3360('0x50')](_0x170f42[_0x3360('0x46')],_0x40f595['filters']));_0x43dba4[_0x3360('0x52')]['ChatWebsiteId']=_0x689483['id'];if(_0x170f42['query'][_0x3360('0x51')]){_0x43dba4[_0x3360('0x52')]=_[_0x3360('0x53')](_0x43dba4[_0x3360('0x52')],{'$or':_[_0x3360('0x41')](_0x43dba4['attributes'],function(_0x478fa5){var _0x2c6145={};_0x2c6145[_0x478fa5]={'$like':'%'+_0x170f42['query'][_0x3360('0x51')]+'%'};return _0x2c6145;})});}_0x43dba4=_[_0x3360('0x53')]({},_0x43dba4,_0x170f42[_0x3360('0x56')]);return db[_0x3360('0xdc')][_0x3360('0x57')]({'where':_0x43dba4[_0x3360('0x52')]})['then'](function(_0x1518fb){_0x4f1fe6[_0x3360('0x57')]=_0x1518fb;if(_0x170f42[_0x3360('0x46')][_0x3360('0x6f')]){_0x43dba4['include']=[{'all':!![]}];}else{_0x43dba4[_0x3360('0x58')]=[{'model':db[_0x3360('0x95')],'as':_0x3360('0xfd'),'required':![]},{'model':db[_0x3360('0x12c')],'as':_0x3360('0x12d'),'required':![]}];}return db[_0x3360('0xdc')][_0x3360('0x70')](_0x43dba4);})[_0x3360('0x25')](function(_0x2cff9f){_0x4f1fe6['rows']=_0x2cff9f;return _0x4f1fe6;});}})['then'](respondWithFilteredResult(_0xa6edff,_0x43dba4))[_0x3360('0x5a')](handleError(_0xa6edff,null));};exports['addAgents']=function(_0x27e4fd,_0x168b0d,_0x1dc5ec){return db['ChatWebsite'][_0x3360('0x5e')]({'where':{'id':_0x27e4fd[_0x3360('0x5c')]['id']}})['then'](handleEntityNotFound(_0x168b0d,null))[_0x3360('0x25')](function(_0x3cdd86){if(_0x3cdd86){return _0x3cdd86[_0x3360('0x12e')](_0x27e4fd[_0x3360('0x60')]['ids'],_[_0x3360('0xfb')](_0x27e4fd[_0x3360('0x60')],[_0x3360('0x75'),'id'])||{})[_0x3360('0xc0')](function(_0x3b4de0){for(var _0xe64181=0x0;_0xe64181<_0x27e4fd[_0x3360('0x60')]['ids']['length'];_0xe64181+=0x1){socket[_0x3360('0x12f')](_0x3360('0x130'),{'UserId':Number(_0x27e4fd['body']['ids'][_0xe64181]),'ChatWebsiteId':Number(_0x27e4fd[_0x3360('0x5c')]['id'])});}return _0x3b4de0;});}})[_0x3360('0x25')](respondWithResult(_0x168b0d,null))[_0x3360('0x5a')](handleError(_0x168b0d,null));};exports[_0x3360('0x131')]=function(_0x224e67,_0x4e6df8,_0x340a36){return db[_0x3360('0x42')][_0x3360('0x5e')]({'where':{'id':_0x224e67[_0x3360('0x5c')]['id']}})[_0x3360('0x25')](handleEntityNotFound(_0x4e6df8,null))['then'](function(_0x19b51c){if(_0x19b51c){return _0x19b51c['removeAgents'](_0x224e67['query']['ids'])[_0x3360('0x25')](function(){if(_['isArray'](_0x224e67[_0x3360('0x46')]['ids'])){for(var _0x12edd3=0x0;_0x12edd3<_0x224e67['query'][_0x3360('0x75')]['length'];_0x12edd3+=0x1){socket[_0x3360('0x12f')](_0x3360('0x132'),{'UserId':Number(_0x224e67['query'][_0x3360('0x75')][_0x12edd3]),'ChatWebsiteId':Number(_0x224e67[_0x3360('0x5c')]['id'])});}}else{socket[_0x3360('0x12f')](_0x3360('0x132'),{'UserId':Number(_0x224e67[_0x3360('0x46')][_0x3360('0x75')]),'ChatWebsiteId':Number(_0x224e67[_0x3360('0x5c')]['id'])});}});}})[_0x3360('0x25')](respondWithStatusCode(_0x4e6df8,null))['catch'](handleError(_0x4e6df8,null));};exports[_0x3360('0x133')]=function(_0x11aaa3,_0x34351b,_0x155fd1){var _0x1acc6a={};var _0x37fafd={};var _0x276db1;var _0xd2745c;return db[_0x3360('0x42')][_0x3360('0x6d')]({'where':{'id':_0x11aaa3[_0x3360('0x5c')]['id']}})['then'](handleEntityNotFound(_0x34351b,null))[_0x3360('0x25')](function(_0x322307){if(_0x322307){_0x276db1=_0x322307;_0x37fafd[_0x3360('0x45')]=_['keys'](db['User'][_0x3360('0x43')]);_0x37fafd[_0x3360('0x46')]=_[_0x3360('0x47')](_0x11aaa3[_0x3360('0x46')]);_0x37fafd[_0x3360('0x48')]=_[_0x3360('0x49')](_0x37fafd['model'],_0x37fafd[_0x3360('0x46')]);_0x1acc6a[_0x3360('0x4a')]=_[_0x3360('0x49')](_0x37fafd[_0x3360('0x45')],qs[_0x3360('0x4b')](_0x11aaa3[_0x3360('0x46')][_0x3360('0x4b')]));_0x1acc6a['attributes']=_0x1acc6a[_0x3360('0x4a')][_0x3360('0x4c')]?_0x1acc6a['attributes']:_0x37fafd[_0x3360('0x45')];_0x1acc6a['order']=qs['sort'](_0x11aaa3[_0x3360('0x46')]['sort']);_0x1acc6a[_0x3360('0x52')]=qs[_0x3360('0x48')](_[_0x3360('0x50')](_0x11aaa3[_0x3360('0x46')],_0x37fafd[_0x3360('0x48')]));if(_0x11aaa3['query'][_0x3360('0x51')]){_0x1acc6a[_0x3360('0x52')]=_[_0x3360('0x53')](_0x1acc6a[_0x3360('0x52')],{'$or':_['map'](_0x1acc6a[_0x3360('0x4a')],function(_0x3a05d1){var _0x330f46={};_0x330f46[_0x3a05d1]={'$like':'%'+_0x11aaa3[_0x3360('0x46')][_0x3360('0x51')]+'%'};return _0x330f46;})});}_0x1acc6a=_['merge']({},_0x1acc6a,_0x11aaa3['options']);return _0x276db1[_0x3360('0x133')](_0x1acc6a);}})[_0x3360('0x25')](function(_0x249b91){if(_0x249b91){_0xd2745c=_0x249b91[_0x3360('0x4c')];if(!_0x11aaa3[_0x3360('0x46')]['hasOwnProperty'](_0x3360('0x6e'))){_0x1acc6a[_0x3360('0x35')]=qs['limit'](_0x11aaa3[_0x3360('0x46')][_0x3360('0x35')]);_0x1acc6a['offset']=qs[_0x3360('0x33')](_0x11aaa3[_0x3360('0x46')][_0x3360('0x33')]);}return _0x276db1[_0x3360('0x133')](_0x1acc6a);}})[_0x3360('0x25')](function(_0x521f57){if(_0x521f57){return _0x521f57?{'count':_0xd2745c,'rows':_0x521f57}:null;}})['then'](respondWithResult(_0x34351b,null))[_0x3360('0x5a')](handleError(_0x34351b,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 93943b6..abfb9da 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 _0x8fed=['update','remove','emit','hook','exports','ChatWebsite','setMaxListeners','save'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x8fed,0xf5));var _0xd8fe=function(_0x552dc3,_0x475401){_0x552dc3=_0x552dc3-0x0;var _0x495c3a=_0x8fed[_0x552dc3];return _0x495c3a;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db'][_0xd8fe('0x0')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xd8fe('0x1')](0x0);var events={'afterCreate':_0xd8fe('0x2'),'afterUpdate':_0xd8fe('0x3'),'afterDestroy':_0xd8fe('0x4')};function emitEvent(_0x523715){return function(_0x2af646,_0x3e93f3,_0x193c5d){ChatWebsiteEvents[_0xd8fe('0x5')](_0x523715+':'+_0x2af646['id'],_0x2af646);ChatWebsiteEvents[_0xd8fe('0x5')](_0x523715,_0x2af646);_0x193c5d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xd8fe('0x6')](e,emitEvent(event));}}module[_0xd8fe('0x7')]=ChatWebsiteEvents; \ No newline at end of file +var _0xe94a=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','save','update'];(function(_0x4bb234,_0x105f9b){var _0x2f2db7=function(_0xc5c510){while(--_0xc5c510){_0x4bb234['push'](_0x4bb234['shift']());}};_0x2f2db7(++_0x105f9b);}(_0xe94a,0x1c7));var _0xae94=function(_0x26721d,_0x448ba5){_0x26721d=_0x26721d-0x0;var _0x1035c5=_0xe94a[_0x26721d];return _0x1035c5;};'use strict';var EventEmitter=require(_0xae94('0x0'));var ChatWebsite=require(_0xae94('0x1'))['db'][_0xae94('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xae94('0x3'),'afterUpdate':_0xae94('0x4'),'afterDestroy':_0xae94('0x5')};function emitEvent(_0x46e549){return function(_0x3bf666,_0xf48ae1,_0x4cf51a){ChatWebsiteEvents[_0xae94('0x6')](_0x46e549+':'+_0x3bf666['id'],_0x3bf666);ChatWebsiteEvents[_0xae94('0x6')](_0x46e549,_0x3bf666);_0x4cf51a(null);};}for(var e in events){if(events[_0xae94('0x7')](e)){var event=events[e];ChatWebsite[_0xae94('0x8')](e,emitEvent(event));}}module[_0xae94('0x9')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 8debd87..aae9c5d 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 _0x568b=['moment','path','ChatWebsite','chat_websites','lodash','util','../../config/logger'];(function(_0x29df9a,_0x42aff3){var _0x3a8e96=function(_0x70fbe7){while(--_0x70fbe7){_0x29df9a['push'](_0x29df9a['shift']());}};_0x3a8e96(++_0x42aff3);}(_0x568b,0x115));var _0xb568=function(_0x7cbc3c,_0x2bad4d){_0x7cbc3c=_0x7cbc3c-0x0;var _0x4c4433=_0x568b[_0x7cbc3c];return _0x4c4433;};'use strict';var _=require(_0xb568('0x0'));var util=require(_0xb568('0x1'));var logger=require(_0xb568('0x2'))('api');var moment=require(_0xb568('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb568('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x18a456,_0xa15704){return _0x18a456['define'](_0xb568('0x5'),attributes,{'tableName':_0xb568('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf0b5=['ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatWebsite.attributes','exports'];(function(_0x437ae5,_0x390206){var _0x3f2172=function(_0x93dc76){while(--_0x93dc76){_0x437ae5['push'](_0x437ae5['shift']());}};_0x3f2172(++_0x390206);}(_0xf0b5,0x1ca));var _0x5f0b=function(_0x325460,_0x5ef353){_0x325460=_0x325460-0x0;var _0x2beb62=_0xf0b5[_0x325460];return _0x2beb62;};'use strict';var _=require(_0x5f0b('0x0'));var util=require(_0x5f0b('0x1'));var logger=require(_0x5f0b('0x2'))(_0x5f0b('0x3'));var moment=require(_0x5f0b('0x4'));var BPromise=require('bluebird');var rp=require(_0x5f0b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5f0b('0x6'));var config=require(_0x5f0b('0x7'));var attributes=require(_0x5f0b('0x8'));module[_0x5f0b('0x9')]=function(_0x24a7ed,_0x35325a){return _0x24a7ed['define'](_0x5f0b('0xa'),attributes,{'tableName':_0x5f0b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index c9d89d7..3007260 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 _0xaf5e=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatWebsite,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x16c04e,_0x577135){var _0xebca7=function(_0x4dcd66){while(--_0x4dcd66){_0x16c04e['push'](_0x16c04e['shift']());}};_0xebca7(++_0x577135);}(_0xaf5e,0x89));var _0xeaf5=function(_0x392c66,_0x5b308a){_0x392c66=_0x392c66-0x0;var _0x34201d=_0xaf5e[_0x392c66];return _0x34201d;};'use strict';var _=require(_0xeaf5('0x0'));var util=require(_0xeaf5('0x1'));var moment=require(_0xeaf5('0x2'));var BPromise=require(_0xeaf5('0x3'));var rs=require(_0xeaf5('0x4'));var fs=require('fs');var Redis=require(_0xeaf5('0x5'));var db=require(_0xeaf5('0x6'))['db'];var utils=require(_0xeaf5('0x7'));var logger=require(_0xeaf5('0x8'))(_0xeaf5('0x9'));var config=require(_0xeaf5('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xeaf5('0xb')][_0xeaf5('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0xeaf5('0xd')],{'host':_0xeaf5('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeaf5('0xd')]));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x31b7ab,_0x3dbd4e,_0x585c58){return new BPromise(function(_0x35fbf8,_0x54187e){return client['request'](_0x31b7ab,_0x585c58)['then'](function(_0x39db65){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x3dbd4e,'request\x20sent');logger['debug'](_0xeaf5('0xf'),_0x3dbd4e,_0xeaf5('0x10'),JSON['stringify'](_0x39db65));if(_0x39db65[_0xeaf5('0x11')]){if(_0x39db65[_0xeaf5('0x11')][_0xeaf5('0x12')]===0x1f4){logger[_0xeaf5('0x11')](_0xeaf5('0x13'),_0x3dbd4e,_0x39db65['error'][_0xeaf5('0x14')]);return _0x54187e(_0x39db65[_0xeaf5('0x11')][_0xeaf5('0x14')]);}logger[_0xeaf5('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x3dbd4e,_0x39db65[_0xeaf5('0x11')][_0xeaf5('0x14')]);return _0x35fbf8(_0x39db65[_0xeaf5('0x11')]['message']);}else{logger[_0xeaf5('0x15')](_0xeaf5('0x13'),_0x3dbd4e,'request\x20sent');_0x35fbf8(_0x39db65[_0xeaf5('0x16')][_0xeaf5('0x14')]);}})[_0xeaf5('0x17')](function(_0x295fdd){logger[_0xeaf5('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x3dbd4e,_0x295fdd);_0x54187e(_0x295fdd);});});} \ No newline at end of file +var _0xe6a9=['error','code','message','result','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3ed6cb,_0x3367cd){var _0xcb52ba=function(_0x3e0d29){while(--_0x3e0d29){_0x3ed6cb['push'](_0x3ed6cb['shift']());}};_0xcb52ba(++_0x3367cd);}(_0xe6a9,0x7c));var _0x9e6a=function(_0x391e9c,_0x3b4958){_0x391e9c=_0x391e9c-0x0;var _0x1807da=_0xe6a9[_0x391e9c];return _0x1807da;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9e6a('0x0'));var BPromise=require(_0x9e6a('0x1'));var rs=require(_0x9e6a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9e6a('0x3'));var logger=require(_0x9e6a('0x4'))('rpc');var config=require(_0x9e6a('0x5'));var jayson=require(_0x9e6a('0x6'));var client=jayson[_0x9e6a('0x7')][_0x9e6a('0x8')]({'port':0x232a});config[_0x9e6a('0x9')]=_[_0x9e6a('0xa')](config[_0x9e6a('0x9')],{'host':_0x9e6a('0xb'),'port':0x18eb});var socket=require(_0x9e6a('0xc'))(new Redis(config[_0x9e6a('0x9')]));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x7f6bf3,_0x4078b7,_0x1540b3){return new BPromise(function(_0x2c3b97,_0x322c0e){return client[_0x9e6a('0xd')](_0x7f6bf3,_0x1540b3)[_0x9e6a('0xe')](function(_0xff0a1f){logger['info'](_0x9e6a('0xf'),_0x4078b7,_0x9e6a('0x10'));logger[_0x9e6a('0x11')](_0x9e6a('0x12'),_0x4078b7,_0x9e6a('0x10'),JSON[_0x9e6a('0x13')](_0xff0a1f));if(_0xff0a1f[_0x9e6a('0x14')]){if(_0xff0a1f[_0x9e6a('0x14')][_0x9e6a('0x15')]===0x1f4){logger[_0x9e6a('0x14')](_0x9e6a('0xf'),_0x4078b7,_0xff0a1f[_0x9e6a('0x14')]['message']);return _0x322c0e(_0xff0a1f[_0x9e6a('0x14')]['message']);}logger[_0x9e6a('0x14')](_0x9e6a('0xf'),_0x4078b7,_0xff0a1f[_0x9e6a('0x14')][_0x9e6a('0x16')]);return _0x2c3b97(_0xff0a1f['error'][_0x9e6a('0x16')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x4078b7,_0x9e6a('0x10'));_0x2c3b97(_0xff0a1f[_0x9e6a('0x17')]['message']);}})['catch'](function(_0x8afdb0){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x4078b7,_0x8afdb0);_0x322c0e(_0x8afdb0);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 64ec558..73d49bf 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 _0xead0=['emit','removeListener','chatWebsite:','./chatWebsite.events','save','remove','update'];(function(_0x597484,_0x199340){var _0x218e64=function(_0x390d55){while(--_0x390d55){_0x597484['push'](_0x597484['shift']());}};_0x218e64(++_0x199340);}(_0xead0,0xb9));var _0x0ead=function(_0x257841,_0x389b4d){_0x257841=_0x257841-0x0;var _0x1b87ed=_0xead0[_0x257841];return _0x1b87ed;};'use strict';var ChatWebsiteEvents=require(_0x0ead('0x0'));var events=[_0x0ead('0x1'),_0x0ead('0x2'),_0x0ead('0x3')];function createListener(_0x4ea020,_0x33f40b){return function(_0x4abf0d){_0x33f40b[_0x0ead('0x4')](_0x4ea020,_0x4abf0d);};}function removeListener(_0x4c9cab,_0x4b8dbf){return function(){ChatWebsiteEvents[_0x0ead('0x5')](_0x4c9cab,_0x4b8dbf);};}exports['register']=function(_0x50f284){for(var _0x32a62f=0x0,_0x25b50f=events['length'];_0x32a62f<_0x25b50f;_0x32a62f++){var _0x5d9ff4=events[_0x32a62f];var _0x2effe2=createListener(_0x0ead('0x6')+_0x5d9ff4,_0x50f284);ChatWebsiteEvents['on'](_0x5d9ff4,_0x2effe2);}}; \ No newline at end of file +var _0xe54f=['chatWebsite:','./chatWebsite.events','save','remove','emit','removeListener','register','length'];(function(_0x174fc8,_0x339e86){var _0x1df08c=function(_0x4dcff4){while(--_0x4dcff4){_0x174fc8['push'](_0x174fc8['shift']());}};_0x1df08c(++_0x339e86);}(_0xe54f,0x1d1));var _0xfe54=function(_0x50e593,_0x3ae998){_0x50e593=_0x50e593-0x0;var _0x3821d0=_0xe54f[_0x50e593];return _0x3821d0;};'use strict';var ChatWebsiteEvents=require(_0xfe54('0x0'));var events=[_0xfe54('0x1'),_0xfe54('0x2'),'update'];function createListener(_0x4ae8f3,_0x428f23){return function(_0x513ba4){_0x428f23[_0xfe54('0x3')](_0x4ae8f3,_0x513ba4);};}function removeListener(_0x3e137c,_0x551d68){return function(){ChatWebsiteEvents[_0xfe54('0x4')](_0x3e137c,_0x551d68);};}exports[_0xfe54('0x5')]=function(_0xf34dfe){for(var _0x4d9ff7=0x0,_0x21b0f9=events[_0xfe54('0x6')];_0x4d9ff7<_0x21b0f9;_0x4d9ff7++){var _0x40c803=events[_0x4d9ff7];var _0x489da9=createListener(_0xfe54('0x7')+_0x40c803,_0xf34dfe);ChatWebsiteEvents['on'](_0x40c803,_0x489da9);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 0b6bd6b..c59f396 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 _0xb7e9=['path','express','Router','fs-extra','../../components/auth/service','./chatWebsite.controller','get','index','/describe','isAuthenticated','describe','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','/:id/dispositions','addAnswer','diskStorage','root','server/files/images/logos/','now','originalname','file','addLogo','join','server/files/images/avatars/','format','%s-%s','single','addAvatar','addCustomerAvatar','addSystemAvatar','notify','server/files','attachments','offline-chat','ensureDir','extname','replace','/:id/interactions','addApplications','addProactiveActions','addAgents','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','exports','multer','util'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xb7e9,0x1b4));var _0x9b7e=function(_0x263b14,_0x2391ad){_0x263b14=_0x263b14-0x0;var _0x434143=_0xb7e9[_0x263b14];return _0x434143;};'use strict';var multer=require(_0x9b7e('0x0'));var util=require(_0x9b7e('0x1'));var path=require(_0x9b7e('0x2'));var timeout=require('connect-timeout');var express=require(_0x9b7e('0x3'));var router=express[_0x9b7e('0x4')]();var fs_extra=require(_0x9b7e('0x5'));var auth=require(_0x9b7e('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9b7e('0x7'));router[_0x9b7e('0x8')]('/',auth['isAuthenticated'](),controller[_0x9b7e('0x9')]);router[_0x9b7e('0x8')](_0x9b7e('0xa'),auth[_0x9b7e('0xb')](),controller[_0x9b7e('0xc')]);router[_0x9b7e('0x8')]('/:id',auth[_0x9b7e('0xb')](),controller[_0x9b7e('0xd')]);router[_0x9b7e('0x8')]('/:id/dispositions',auth[_0x9b7e('0xb')](),controller[_0x9b7e('0xe')]);router[_0x9b7e('0x8')](_0x9b7e('0xf'),auth['isAuthenticated'](),controller[_0x9b7e('0x10')]);router[_0x9b7e('0x8')](_0x9b7e('0x11'),controller[_0x9b7e('0x12')]);router[_0x9b7e('0x8')](_0x9b7e('0x13'),controller[_0x9b7e('0x14')]);router[_0x9b7e('0x8')](_0x9b7e('0x15'),controller[_0x9b7e('0x16')]);router[_0x9b7e('0x8')](_0x9b7e('0x17'),controller[_0x9b7e('0x18')]);router['get']('/:id/interactions',auth[_0x9b7e('0xb')](),controller['getInteractions']);router[_0x9b7e('0x8')](_0x9b7e('0x19'),controller[_0x9b7e('0x1a')]);router['get'](_0x9b7e('0x1b'),auth[_0x9b7e('0xb')](),controller[_0x9b7e('0x1c')]);router[_0x9b7e('0x8')](_0x9b7e('0x1d'),auth[_0x9b7e('0xb')](),controller[_0x9b7e('0x1e')]);router[_0x9b7e('0x8')](_0x9b7e('0x1f'),controller['getFields']);router[_0x9b7e('0x8')](_0x9b7e('0x20'),auth[_0x9b7e('0xb')](),controller[_0x9b7e('0x21')]);router[_0x9b7e('0x8')](_0x9b7e('0x22'),auth['isAuthenticated'](),controller[_0x9b7e('0x23')]);router[_0x9b7e('0x24')]('/',auth[_0x9b7e('0xb')](),controller['create']);router[_0x9b7e('0x24')](_0x9b7e('0x25'),auth[_0x9b7e('0xb')](),controller['addDisposition']);router[_0x9b7e('0x24')](_0x9b7e('0xf'),auth[_0x9b7e('0xb')](),controller[_0x9b7e('0x26')]);var upload=multer({'storage':multer[_0x9b7e('0x27')]({'destination':function(_0x3292db,_0x4c094a,_0x359bb1){_0x359bb1(null,path['join'](config[_0x9b7e('0x28')],_0x9b7e('0x29')));},'filename':function(_0x26e6e9,_0x122411,_0x3eefe8){_0x3eefe8(null,util['format']('%s-%s',Date[_0x9b7e('0x2a')](),_0x122411[_0x9b7e('0x2b')]));}})});router[_0x9b7e('0x24')]('/:id/logo',upload['single'](_0x9b7e('0x2c')),controller[_0x9b7e('0x2d')]);var upload=multer({'storage':multer[_0x9b7e('0x27')]({'destination':function(_0x303212,_0x5b8285,_0x39e49d){_0x39e49d(null,path[_0x9b7e('0x2e')](config[_0x9b7e('0x28')],_0x9b7e('0x2f')));},'filename':function(_0x472f66,_0xa55cb7,_0x3607ad){_0x3607ad(null,util[_0x9b7e('0x30')](_0x9b7e('0x31'),Date[_0x9b7e('0x2a')](),_0xa55cb7[_0x9b7e('0x2b')]));}})});router[_0x9b7e('0x24')](_0x9b7e('0x13'),upload[_0x9b7e('0x32')](_0x9b7e('0x2c')),controller[_0x9b7e('0x33')]);var upload=multer({'storage':multer[_0x9b7e('0x27')]({'destination':function(_0x2781e7,_0x44c780,_0x962fc3){_0x962fc3(null,path[_0x9b7e('0x2e')](config['root'],_0x9b7e('0x2f')));},'filename':function(_0x2d0926,_0x7eed52,_0x447c2e){_0x447c2e(null,util[_0x9b7e('0x30')]('%s-%s',Date[_0x9b7e('0x2a')](),_0x7eed52[_0x9b7e('0x2b')]));}})});router['post'](_0x9b7e('0x15'),upload[_0x9b7e('0x32')](_0x9b7e('0x2c')),controller[_0x9b7e('0x34')]);var upload=multer({'storage':multer[_0x9b7e('0x27')]({'destination':function(_0x250b94,_0x4b6ece,_0x1eda2c){_0x1eda2c(null,path[_0x9b7e('0x2e')](config[_0x9b7e('0x28')],'server/files/images/avatars/'));},'filename':function(_0x28b7d8,_0xe14211,_0x75fa62){_0x75fa62(null,util[_0x9b7e('0x30')](_0x9b7e('0x31'),Date[_0x9b7e('0x2a')](),_0xe14211[_0x9b7e('0x2b')]));}})});router['post'](_0x9b7e('0x17'),upload[_0x9b7e('0x32')](_0x9b7e('0x2c')),controller[_0x9b7e('0x35')]);router[_0x9b7e('0x24')]('/:id/notify',controller[_0x9b7e('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0x9b7e('0x27')]({'destination':function(_0x4df8d4,_0x1a73e6,_0x2dfd64){const _0x5906d8=path[_0x9b7e('0x2e')](config['root'],_0x9b7e('0x37'),_0x9b7e('0x38'),_0x9b7e('0x39'));fs_extra[_0x9b7e('0x3a')](_0x5906d8,function(){_0x2dfd64(null,_0x5906d8);});},'filename':function(_0x4e3971,_0x44035c,_0x3a66fd){const _0x30c371=_0x44035c['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2a0aba=path[_0x9b7e('0x3b')](_0x30c371);const _0x52dd61=Date[_0x9b7e('0x2a')]()+'-'+_0x30c371[_0x9b7e('0x3c')](_0x2a0aba,'')+_0x2a0aba;_0x3a66fd(null,_0x52dd61);}})});router[_0x9b7e('0x24')]('/:id/offline',offlineUploadMulter['any'](),controller['offline']);router[_0x9b7e('0x24')](_0x9b7e('0x3d'),auth['isAuthenticated'](),controller['addInteraction']);router[_0x9b7e('0x24')](_0x9b7e('0x1b'),auth['isAuthenticated'](),controller[_0x9b7e('0x3e')]);router['post']('/:id/proactive_actions',auth[_0x9b7e('0xb')](),controller[_0x9b7e('0x3f')]);router[_0x9b7e('0x24')](_0x9b7e('0x22'),auth[_0x9b7e('0xb')](),controller[_0x9b7e('0x40')]);router[_0x9b7e('0x41')](_0x9b7e('0x42'),auth[_0x9b7e('0xb')](),controller[_0x9b7e('0x43')]);router[_0x9b7e('0x44')](_0x9b7e('0x42'),auth[_0x9b7e('0xb')](),controller[_0x9b7e('0x45')]);router[_0x9b7e('0x44')](_0x9b7e('0x25'),auth[_0x9b7e('0xb')](),controller[_0x9b7e('0x46')]);router[_0x9b7e('0x44')](_0x9b7e('0xf'),auth[_0x9b7e('0xb')](),controller[_0x9b7e('0x47')]);router[_0x9b7e('0x44')](_0x9b7e('0x22'),auth[_0x9b7e('0xb')](),controller['removeAgents']);module[_0x9b7e('0x48')]=router; \ No newline at end of file +var _0x9076=['/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','%s-%s','originalname','single','file','addLogo','server/files/images/avatars/','now','format','/:id/customer_avatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','server/files','ensureDir','replace','/:id/offline','any','offline','addApplications','addAgents','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','index','/describe','isAuthenticated','describe','get','show','/:id/dispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields'];(function(_0x27ec97,_0x57baa9){var _0x1840ff=function(_0x111932){while(--_0x111932){_0x27ec97['push'](_0x27ec97['shift']());}};_0x1840ff(++_0x57baa9);}(_0x9076,0xab));var _0x6907=function(_0x47ae05,_0x2d57f2){_0x47ae05=_0x47ae05-0x0;var _0x2c07ea=_0x9076[_0x47ae05];return _0x2c07ea;};'use strict';var multer=require(_0x6907('0x0'));var util=require(_0x6907('0x1'));var path=require(_0x6907('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6907('0x3')]();var fs_extra=require(_0x6907('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6907('0x5'));var config=require(_0x6907('0x6'));var controller=require(_0x6907('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x6907('0x8')]);router['get'](_0x6907('0x9'),auth[_0x6907('0xa')](),controller[_0x6907('0xb')]);router[_0x6907('0xc')]('/:id',auth[_0x6907('0xa')](),controller[_0x6907('0xd')]);router[_0x6907('0xc')](_0x6907('0xe'),auth['isAuthenticated'](),controller['getDispositions']);router['get'](_0x6907('0xf'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x6907('0xc')](_0x6907('0x10'),controller[_0x6907('0x11')]);router[_0x6907('0xc')](_0x6907('0x12'),controller['getAvatar']);router[_0x6907('0xc')]('/:id/customer_avatar',controller[_0x6907('0x13')]);router[_0x6907('0xc')]('/:id/system_avatar',controller[_0x6907('0x14')]);router[_0x6907('0xc')](_0x6907('0x15'),auth[_0x6907('0xa')](),controller['getInteractions']);router[_0x6907('0xc')]('/:id/snippet',controller[_0x6907('0x16')]);router[_0x6907('0xc')](_0x6907('0x17'),auth[_0x6907('0xa')](),controller['getApplications']);router['get'](_0x6907('0x18'),auth[_0x6907('0xa')](),controller[_0x6907('0x19')]);router[_0x6907('0xc')](_0x6907('0x1a'),controller['getFields']);router['get'](_0x6907('0x1b'),auth['isAuthenticated'](),controller[_0x6907('0x1c')]);router[_0x6907('0xc')](_0x6907('0x1d'),auth[_0x6907('0xa')](),controller[_0x6907('0x1e')]);router[_0x6907('0x1f')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6907('0x1f')](_0x6907('0xe'),auth[_0x6907('0xa')](),controller[_0x6907('0x20')]);router[_0x6907('0x1f')](_0x6907('0xf'),auth['isAuthenticated'](),controller[_0x6907('0x21')]);var upload=multer({'storage':multer[_0x6907('0x22')]({'destination':function(_0x24b4ba,_0x215dd1,_0x2bca19){_0x2bca19(null,path[_0x6907('0x23')](config[_0x6907('0x24')],_0x6907('0x25')));},'filename':function(_0x1d8831,_0x554f1a,_0x59a1f8){_0x59a1f8(null,util['format'](_0x6907('0x26'),Date['now'](),_0x554f1a[_0x6907('0x27')]));}})});router[_0x6907('0x1f')](_0x6907('0x10'),upload[_0x6907('0x28')](_0x6907('0x29')),controller[_0x6907('0x2a')]);var upload=multer({'storage':multer[_0x6907('0x22')]({'destination':function(_0x38be8c,_0x3af2ec,_0x5ab5dd){_0x5ab5dd(null,path[_0x6907('0x23')](config[_0x6907('0x24')],_0x6907('0x2b')));},'filename':function(_0x20b7d0,_0x49bbf9,_0x619bff){_0x619bff(null,util['format'](_0x6907('0x26'),Date[_0x6907('0x2c')](),_0x49bbf9[_0x6907('0x27')]));}})});router[_0x6907('0x1f')](_0x6907('0x12'),upload['single']('file'),controller['addAvatar']);var upload=multer({'storage':multer[_0x6907('0x22')]({'destination':function(_0x58f10e,_0x11444f,_0x561c9d){_0x561c9d(null,path[_0x6907('0x23')](config[_0x6907('0x24')],'server/files/images/avatars/'));},'filename':function(_0x48d8fd,_0x7b3a9c,_0x399e6a){_0x399e6a(null,util[_0x6907('0x2d')]('%s-%s',Date[_0x6907('0x2c')](),_0x7b3a9c['originalname']));}})});router[_0x6907('0x1f')](_0x6907('0x2e'),upload[_0x6907('0x28')](_0x6907('0x29')),controller[_0x6907('0x2f')]);var upload=multer({'storage':multer[_0x6907('0x22')]({'destination':function(_0x1a2e49,_0x166789,_0x4d2462){_0x4d2462(null,path['join'](config[_0x6907('0x24')],'server/files/images/avatars/'));},'filename':function(_0x14c6b0,_0x2eb9ab,_0x1b8773){_0x1b8773(null,util[_0x6907('0x2d')]('%s-%s',Date[_0x6907('0x2c')](),_0x2eb9ab[_0x6907('0x27')]));}})});router[_0x6907('0x1f')](_0x6907('0x30'),upload[_0x6907('0x28')]('file'),controller[_0x6907('0x31')]);router[_0x6907('0x1f')]('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x6907('0x22')]({'destination':function(_0x540ac2,_0x37b904,_0x4f9435){const _0x5633d2=path['join'](config['root'],_0x6907('0x32'),'attachments','offline-chat');fs_extra[_0x6907('0x33')](_0x5633d2,function(){_0x4f9435(null,_0x5633d2);});},'filename':function(_0x1bbbae,_0x448051,_0xb06910){const _0x9551a5=_0x448051[_0x6907('0x27')][_0x6907('0x34')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4be33b=path['extname'](_0x9551a5);const _0x5f213c=Date[_0x6907('0x2c')]()+'-'+_0x9551a5[_0x6907('0x34')](_0x4be33b,'')+_0x4be33b;_0xb06910(null,_0x5f213c);}})});router[_0x6907('0x1f')](_0x6907('0x35'),offlineUploadMulter[_0x6907('0x36')](),controller[_0x6907('0x37')]);router['post']('/:id/interactions',auth[_0x6907('0xa')](),controller['addInteraction']);router[_0x6907('0x1f')](_0x6907('0x17'),auth[_0x6907('0xa')](),controller[_0x6907('0x38')]);router[_0x6907('0x1f')]('/:id/proactive_actions',auth['isAuthenticated'](),controller['addProactiveActions']);router[_0x6907('0x1f')](_0x6907('0x1d'),auth[_0x6907('0xa')](),controller[_0x6907('0x39')]);router[_0x6907('0x3a')](_0x6907('0x3b'),auth['isAuthenticated'](),controller[_0x6907('0x3c')]);router[_0x6907('0x3d')](_0x6907('0x3b'),auth[_0x6907('0xa')](),controller[_0x6907('0x3e')]);router['delete']('/:id/dispositions',auth[_0x6907('0xa')](),controller[_0x6907('0x3f')]);router[_0x6907('0x3d')](_0x6907('0xf'),auth[_0x6907('0xa')](),controller[_0x6907('0x40')]);router[_0x6907('0x3d')](_0x6907('0x1d'),auth[_0x6907('0xa')](),controller[_0x6907('0x41')]);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 c05978f..acb2afa 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 _0x7278=['STRING','ENUM','AmazonAWS','sequelize','exports'];(function(_0x54ab99,_0x1d7883){var _0x38948e=function(_0x12c26f){while(--_0x12c26f){_0x54ab99['push'](_0x54ab99['shift']());}};_0x38948e(++_0x1d7883);}(_0x7278,0x161));var _0x8727=function(_0x243d6b,_0x1b0cb0){_0x243d6b=_0x243d6b-0x0;var _0x483b45=_0x7278[_0x243d6b];return _0x483b45;};'use strict';var Sequelize=require(_0x8727('0x0'));module[_0x8727('0x1')]={'name':{'type':Sequelize[_0x8727('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x8727('0x3')](_0x8727('0x4'),'Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x8727('0x2')]},'data2':{'type':Sequelize[_0x8727('0x2')]}}; \ No newline at end of file +var _0x5353=['ENUM','AmazonAWS','Google','sequelize','STRING'];(function(_0x260d17,_0x41db16){var _0x11dc8d=function(_0x1f0492){while(--_0x1f0492){_0x260d17['push'](_0x260d17['shift']());}};_0x11dc8d(++_0x41db16);}(_0x5353,0x12f));var _0x3535=function(_0x3d1939,_0x1e9a55){_0x3d1939=_0x3d1939-0x0;var _0x3f944d=_0x5353[_0x3d1939];return _0x3f944d;};'use strict';var Sequelize=require(_0x3535('0x0'));module['exports']={'name':{'type':Sequelize[_0x3535('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x3535('0x2')](_0x3535('0x3'),_0x3535('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x3535('0x1')]},'data2':{'type':Sequelize[_0x3535('0x1')]}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 8601273..09db763 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 _0x2032=['body','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/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','CloudProvider','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','rows','show','params','keys','rawAttributes','includeAll','find','catch'];(function(_0x51c7b3,_0xe2c17){var _0xf1df07=function(_0x24da3a){while(--_0x24da3a){_0x51c7b3['push'](_0x51c7b3['shift']());}};_0xf1df07(++_0xe2c17);}(_0x2032,0xd9));var _0x2203=function(_0x24fbcf,_0x3e3edd){_0x24fbcf=_0x24fbcf-0x0;var _0x2584ce=_0x2032[_0x24fbcf];return _0x2584ce;};'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']=[{'all':!![]}];}return db[_0x2203('0x2c')]['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x446209){_0x34b8ba[_0x2203('0x3f')]=_0x446209;return _0x34b8ba;})['then'](respondWithFilteredResult(_0x1df508,_0x9c53f))['catch'](handleError(_0x1df508,null));};exports[_0x2203('0x40')]=function(_0x3739f6,_0x368444){var _0x1e09f3={'raw':!![],'where':{'id':_0x3739f6[_0x2203('0x41')]['id']}},_0x372709={};_0x372709['model']=_[_0x2203('0x42')](db[_0x2203('0x2c')][_0x2203('0x43')]);_0x372709[_0x2203('0x30')]=_[_0x2203('0x42')](_0x3739f6[_0x2203('0x30')]);_0x372709[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],_0x372709[_0x2203('0x30')]);_0x1e09f3['attributes']=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],qs[_0x2203('0x34')](_0x3739f6[_0x2203('0x30')]['fields']));_0x1e09f3['attributes']=_0x1e09f3[_0x2203('0x32')]['length']?_0x1e09f3[_0x2203('0x32')]:_0x372709[_0x2203('0x31')];if(_0x3739f6[_0x2203('0x30')][_0x2203('0x44')]){_0x1e09f3['include']=[{'all':!![]}];}_0x1e09f3=_[_0x2203('0x3c')]({},_0x1e09f3,_0x3739f6[_0x2203('0x3e')]);return db['CloudProvider'][_0x2203('0x45')](_0x1e09f3)[_0x2203('0x23')](handleEntityNotFound(_0x368444,null))[_0x2203('0x23')](respondWithResult(_0x368444,null))[_0x2203('0x46')](handleError(_0x368444,null));};exports['create']=function(_0x4c1a29,_0x21b8ab){return db['CloudProvider']['create'](_0x4c1a29[_0x2203('0x47')],{})[_0x2203('0x23')](respondWithResult(_0x21b8ab,0xc9))[_0x2203('0x46')](handleError(_0x21b8ab,null));};exports['update']=function(_0x4c1496,_0x131aec){if(_0x4c1496[_0x2203('0x47')]['id']){delete _0x4c1496[_0x2203('0x47')]['id'];}return db[_0x2203('0x2c')][_0x2203('0x45')]({'where':{'id':_0x4c1496[_0x2203('0x41')]['id']}})['then'](handleEntityNotFound(_0x131aec,null))[_0x2203('0x23')](saveUpdates(_0x4c1496['body'],null))[_0x2203('0x23')](respondWithResult(_0x131aec,null))[_0x2203('0x46')](handleError(_0x131aec,null));};exports[_0x2203('0x24')]=function(_0x1e49dd,_0x58b9bb){return db['CloudProvider'][_0x2203('0x45')]({'where':{'id':_0x1e49dd[_0x2203('0x41')]['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x58b9bb,null))[_0x2203('0x23')](removeEntity(_0x58b9bb,null))['catch'](handleError(_0x58b9bb,null));}; \ No newline at end of file +var _0xdb28=['error','stack','name','send','index','CloudProvider','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','body','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'];(function(_0x4641c3,_0x54dc03){var _0x4e73d1=function(_0x10d4e4){while(--_0x10d4e4){_0x4641c3['push'](_0x4641c3['shift']());}};_0x4e73d1(++_0x54dc03);}(_0xdb28,0x106));var _0x8db2=function(_0x472726,_0x38cf2d){_0x472726=_0x472726-0x0;var _0xb3be3e=_0xdb28[_0x472726];return _0xb3be3e;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'all':!![]}];}return db[_0x8db2('0x2b')][_0x8db2('0x40')](_0x21bae5);})['then'](function(_0x49a7ae){_0x3124d5[_0x8db2('0x41')]=_0x49a7ae;return _0x3124d5;})['then'](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x42')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x43')]=function(_0x313130,_0x307783){var _0xb4fe2c={'raw':!![],'where':{'id':_0x313130[_0x8db2('0x44')]['id']}},_0x30d606={};_0x30d606['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x45')]);_0x30d606[_0x8db2('0x30')]=_['keys'](_0x313130[_0x8db2('0x30')]);_0x30d606[_0x8db2('0x39')]=_[_0x8db2('0x46')](_0x30d606[_0x8db2('0x32')],_0x30d606['query']);_0xb4fe2c[_0x8db2('0x34')]=_['intersection'](_0x30d606[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x313130[_0x8db2('0x30')]['fields']));_0xb4fe2c['attributes']=_0xb4fe2c[_0x8db2('0x34')]['length']?_0xb4fe2c[_0x8db2('0x34')]:_0x30d606[_0x8db2('0x32')];if(_0x313130[_0x8db2('0x30')][_0x8db2('0x3f')]){_0xb4fe2c[_0x8db2('0x47')]=[{'all':!![]}];}_0xb4fe2c=_[_0x8db2('0x3d')]({},_0xb4fe2c,_0x313130[_0x8db2('0x3e')]);return db[_0x8db2('0x2b')][_0x8db2('0x48')](_0xb4fe2c)[_0x8db2('0x24')](handleEntityNotFound(_0x307783,null))[_0x8db2('0x24')](respondWithResult(_0x307783,null))[_0x8db2('0x42')](handleError(_0x307783,null));};exports['create']=function(_0x449109,_0x2ada52){return db[_0x8db2('0x2b')][_0x8db2('0x49')](_0x449109['body'],{})['then'](respondWithResult(_0x2ada52,0xc9))[_0x8db2('0x42')](handleError(_0x2ada52,null));};exports[_0x8db2('0x23')]=function(_0x164020,_0x4c66e5){if(_0x164020['body']['id']){delete _0x164020['body']['id'];}return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x164020[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x4c66e5,null))[_0x8db2('0x24')](saveUpdates(_0x164020[_0x8db2('0x4a')],null))[_0x8db2('0x24')](respondWithResult(_0x4c66e5,null))['catch'](handleError(_0x4c66e5,null));};exports['destroy']=function(_0x3d29bc,_0x18c6ef){return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x3d29bc[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x18c6ef,null))[_0x8db2('0x24')](removeEntity(_0x18c6ef,null))[_0x8db2('0x42')](handleError(_0x18c6ef,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 7b9b41c..6bca8d8 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 _0x8505=['util','../../config/logger','api','moment','bluebird','path','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash'];(function(_0xbe7bd5,_0xcf75e6){var _0x3f4d5d=function(_0x43ec36){while(--_0x43ec36){_0xbe7bd5['push'](_0xbe7bd5['shift']());}};_0x3f4d5d(++_0xcf75e6);}(_0x8505,0x81));var _0x5850=function(_0x1c4f6a,_0x555cbb){_0x1c4f6a=_0x1c4f6a-0x0;var _0x47552a=_0x8505[_0x1c4f6a];return _0x47552a;};'use strict';var _=require(_0x5850('0x0'));var util=require(_0x5850('0x1'));var logger=require(_0x5850('0x2'))(_0x5850('0x3'));var moment=require(_0x5850('0x4'));var BPromise=require(_0x5850('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5850('0x6'));var rimraf=require('rimraf');var config=require(_0x5850('0x7'));var attributes=require(_0x5850('0x8'));module[_0x5850('0x9')]=function(_0x5d2a47,_0x12aaca){return _0x5d2a47[_0x5850('0xa')](_0x5850('0xb'),attributes,{'tableName':_0x5850('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c93=['define','CloudProvider','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cloudProvider.attributes'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0x3c93,0x10a));var _0x33c9=function(_0x6b2baa,_0xede85a){_0x6b2baa=_0x6b2baa-0x0;var _0x2f552d=_0x3c93[_0x6b2baa];return _0x2f552d;};'use strict';var _=require(_0x33c9('0x0'));var util=require(_0x33c9('0x1'));var logger=require(_0x33c9('0x2'))(_0x33c9('0x3'));var moment=require('moment');var BPromise=require(_0x33c9('0x4'));var rp=require(_0x33c9('0x5'));var fs=require('fs');var path=require(_0x33c9('0x6'));var rimraf=require(_0x33c9('0x7'));var config=require('../../config/environment');var attributes=require(_0x33c9('0x8'));module['exports']=function(_0x5031b8,_0x2dcfcb){return _0x5031b8[_0x33c9('0x9')](_0x33c9('0xa'),attributes,{'tableName':'cloud_providers','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 a44fdc5..5ba58f8 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 _0x8383=['stringify','error','message','info','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x18fec8,_0x31d0cd){var _0x5e400c=function(_0x1f3bc0){while(--_0x1f3bc0){_0x18fec8['push'](_0x18fec8['shift']());}};_0x5e400c(++_0x31d0cd);}(_0x8383,0x98));var _0x3838=function(_0x4fec10,_0x3e5ed8){_0x4fec10=_0x4fec10-0x0;var _0x19edb3=_0x8383[_0x4fec10];return _0x19edb3;};'use strict';var _=require(_0x3838('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3838('0x1'));var rs=require(_0x3838('0x2'));var fs=require('fs');var Redis=require(_0x3838('0x3'));var db=require(_0x3838('0x4'))['db'];var utils=require(_0x3838('0x5'));var logger=require(_0x3838('0x6'))(_0x3838('0x7'));var config=require(_0x3838('0x8'));var jayson=require(_0x3838('0x9'));var client=jayson[_0x3838('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x239750,_0x235001,_0x4cf52b){return new BPromise(function(_0x2abbda,_0x5e2e42){return client[_0x3838('0xb')](_0x239750,_0x4cf52b)[_0x3838('0xc')](function(_0x340c39){logger['info'](_0x3838('0xd'),_0x235001,_0x3838('0xe'));logger[_0x3838('0xf')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x235001,_0x3838('0xe'),JSON[_0x3838('0x10')](_0x340c39));if(_0x340c39[_0x3838('0x11')]){if(_0x340c39[_0x3838('0x11')]['code']===0x1f4){logger[_0x3838('0x11')](_0x3838('0xd'),_0x235001,_0x340c39[_0x3838('0x11')]['message']);return _0x5e2e42(_0x340c39[_0x3838('0x11')]['message']);}logger[_0x3838('0x11')](_0x3838('0xd'),_0x235001,_0x340c39[_0x3838('0x11')][_0x3838('0x12')]);return _0x2abbda(_0x340c39[_0x3838('0x11')]['message']);}else{logger[_0x3838('0x13')](_0x3838('0xd'),_0x235001,_0x3838('0xe'));_0x2abbda(_0x340c39[_0x3838('0x14')][_0x3838('0x12')]);}})['catch'](function(_0x464fd9){logger[_0x3838('0x11')](_0x3838('0xd'),_0x235001,_0x464fd9);_0x5e2e42(_0x464fd9);});});} \ No newline at end of file +var _0x530f=['message','result','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','CloudProvider,\x20%s,\x20%s'];(function(_0x1b47fb,_0x3924de){var _0x2245f1=function(_0x584613){while(--_0x584613){_0x1b47fb['push'](_0x1b47fb['shift']());}};_0x2245f1(++_0x3924de);}(_0x530f,0x167));var _0xf530=function(_0x39b316,_0x3def1e){_0x39b316=_0x39b316-0x0;var _0x182ab1=_0x530f[_0x39b316];return _0x182ab1;};'use strict';var _=require('lodash');var util=require(_0xf530('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf530('0x1'));var fs=require('fs');var Redis=require(_0xf530('0x2'));var db=require(_0xf530('0x3'))['db'];var utils=require(_0xf530('0x4'));var logger=require(_0xf530('0x5'))(_0xf530('0x6'));var config=require(_0xf530('0x7'));var jayson=require(_0xf530('0x8'));var client=jayson['client'][_0xf530('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ce7f8,_0x1e8282,_0x50682f){return new BPromise(function(_0x2bbe3c,_0xf205be){return client[_0xf530('0xa')](_0x2ce7f8,_0x50682f)[_0xf530('0xb')](function(_0x4132bf){logger[_0xf530('0xc')]('CloudProvider,\x20%s,\x20%s',_0x1e8282,_0xf530('0xd'));logger[_0xf530('0xe')](_0xf530('0xf'),_0x1e8282,_0xf530('0xd'),JSON[_0xf530('0x10')](_0x4132bf));if(_0x4132bf[_0xf530('0x11')]){if(_0x4132bf['error']['code']===0x1f4){logger[_0xf530('0x11')](_0xf530('0x12'),_0x1e8282,_0x4132bf[_0xf530('0x11')][_0xf530('0x13')]);return _0xf205be(_0x4132bf[_0xf530('0x11')]['message']);}logger[_0xf530('0x11')](_0xf530('0x12'),_0x1e8282,_0x4132bf[_0xf530('0x11')][_0xf530('0x13')]);return _0x2bbe3c(_0x4132bf[_0xf530('0x11')][_0xf530('0x13')]);}else{logger[_0xf530('0xc')](_0xf530('0x12'),_0x1e8282,'request\x20sent');_0x2bbe3c(_0x4132bf[_0xf530('0x14')][_0xf530('0x13')]);}})['catch'](function(_0x32eaea){logger[_0xf530('0x11')]('CloudProvider,\x20%s,\x20%s',_0x1e8282,_0x32eaea);_0xf205be(_0x32eaea);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index cf35c52..4a4b6f0 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 _0xc256=['../../components/interaction/service','../../config/environment','./cloudProvider.controller','isAuthenticated','get','/:id','show','post','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x39677a,_0x3c1002){var _0x458d63=function(_0x9dfa5b){while(--_0x9dfa5b){_0x39677a['push'](_0x39677a['shift']());}};_0x458d63(++_0x3c1002);}(_0xc256,0xe3));var _0x6c25=function(_0x3c42f0,_0x421a98){_0x3c42f0=_0x3c42f0-0x0;var _0x2e39da=_0xc256[_0x3c42f0];return _0x2e39da;};'use strict';var multer=require(_0x6c25('0x0'));var util=require(_0x6c25('0x1'));var path=require(_0x6c25('0x2'));var timeout=require(_0x6c25('0x3'));var express=require('express');var router=express[_0x6c25('0x4')]();var fs_extra=require(_0x6c25('0x5'));var auth=require(_0x6c25('0x6'));var interaction=require(_0x6c25('0x7'));var config=require(_0x6c25('0x8'));var controller=require(_0x6c25('0x9'));router['get']('/',auth[_0x6c25('0xa')](),controller['index']);router[_0x6c25('0xb')](_0x6c25('0xc'),auth[_0x6c25('0xa')](),controller[_0x6c25('0xd')]);router[_0x6c25('0xe')]('/',auth[_0x6c25('0xa')](),controller['create']);router[_0x6c25('0xf')](_0x6c25('0xc'),auth[_0x6c25('0xa')](),controller[_0x6c25('0x10')]);router['delete'](_0x6c25('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x6c25('0x11')]=router; \ No newline at end of file +var _0x0a39=['multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id','show','create','put','destroy'];(function(_0x5b0fa4,_0x59b18d){var _0x31df63=function(_0x210bf8){while(--_0x210bf8){_0x5b0fa4['push'](_0x5b0fa4['shift']());}};_0x31df63(++_0x59b18d);}(_0x0a39,0x176));var _0x90a3=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x0a39[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0x90a3('0x0'));var util=require('util');var path=require(_0x90a3('0x1'));var timeout=require(_0x90a3('0x2'));var express=require('express');var router=express[_0x90a3('0x3')]();var fs_extra=require(_0x90a3('0x4'));var auth=require(_0x90a3('0x5'));var interaction=require(_0x90a3('0x6'));var config=require(_0x90a3('0x7'));var controller=require(_0x90a3('0x8'));router[_0x90a3('0x9')]('/',auth[_0x90a3('0xa')](),controller[_0x90a3('0xb')]);router[_0x90a3('0x9')](_0x90a3('0xc'),auth[_0x90a3('0xa')](),controller[_0x90a3('0xd')]);router['post']('/',auth[_0x90a3('0xa')](),controller[_0x90a3('0xe')]);router[_0x90a3('0xf')](_0x90a3('0xc'),auth[_0x90a3('0xa')](),controller['update']);router['delete'](_0x90a3('0xc'),auth[_0x90a3('0xa')](),controller[_0x90a3('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 0f89051..b959512 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 _0x2ad8=['name','sequelize','STRING'];(function(_0x5959c9,_0x2ed153){var _0x4ffcbc=function(_0x459b7a){while(--_0x459b7a){_0x5959c9['push'](_0x5959c9['shift']());}};_0x4ffcbc(++_0x2ed153);}(_0x2ad8,0x9d));var _0x82ad=function(_0x2565d5,_0xe6c944){_0x2565d5=_0x2565d5-0x0;var _0x1b546c=_0x2ad8[_0x2565d5];return _0x1b546c;};'use strict';var Sequelize=require(_0x82ad('0x0'));module['exports']={'name':{'type':Sequelize[_0x82ad('0x1')],'unique':_0x82ad('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x82ad('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x82ad('0x1')]},'phone':{'type':Sequelize[_0x82ad('0x1')]},'fax':{'type':Sequelize[_0x82ad('0x1')]},'type':{'type':Sequelize[_0x82ad('0x1')]},'street':{'type':Sequelize[_0x82ad('0x1')]},'postalCode':{'type':Sequelize[_0x82ad('0x1')]},'city':{'type':Sequelize[_0x82ad('0x1')]},'country':{'type':Sequelize[_0x82ad('0x1')]},'email':{'type':Sequelize[_0x82ad('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x82ad('0x1')]},'sStreet':{'type':Sequelize[_0x82ad('0x1')]},'sPostalCode':{'type':Sequelize[_0x82ad('0x1')]},'sCity':{'type':Sequelize[_0x82ad('0x1')]},'sCountry':{'type':Sequelize[_0x82ad('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc726=['sequelize','exports','STRING','name'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xc726,0x134));var _0x6c72=function(_0x3194c2,_0x807309){_0x3194c2=_0x3194c2-0x0;var _0x4c666a=_0xc726[_0x3194c2];return _0x4c666a;};'use strict';var Sequelize=require(_0x6c72('0x0'));module[_0x6c72('0x1')]={'name':{'type':Sequelize[_0x6c72('0x2')],'unique':_0x6c72('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x6c72('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x6c72('0x2')]},'phone':{'type':Sequelize[_0x6c72('0x2')]},'fax':{'type':Sequelize[_0x6c72('0x2')]},'type':{'type':Sequelize[_0x6c72('0x2')]},'street':{'type':Sequelize[_0x6c72('0x2')]},'postalCode':{'type':Sequelize[_0x6c72('0x2')]},'city':{'type':Sequelize[_0x6c72('0x2')]},'country':{'type':Sequelize[_0x6c72('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x6c72('0x2')]},'sPostalCode':{'type':Sequelize[_0x6c72('0x2')]},'sCity':{'type':Sequelize[_0x6c72('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6c72('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 5ce329f..d11d2d1 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 _0x8844=['catch','show','params','length','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addContacts','CmContact','ids','omit','getContacts','rawAttributes','order','filter','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','get','Companies','UserProfileResource','destroy','error','stack','name','send','CmCompany','describe','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','merge','map','options','includeAll','include','findAll'];(function(_0x270b63,_0x539256){var _0x9b2dc8=function(_0x1d5909){while(--_0x1d5909){_0x270b63['push'](_0x270b63['shift']());}};_0x9b2dc8(++_0x539256);}(_0x8844,0x11d));var _0x4884=function(_0x33ee4d,_0x14c274){_0x33ee4d=_0x33ee4d-0x0;var _0x1a2de6=_0x8844[_0x33ee4d];return _0x1a2de6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4884('0x0'));var jsonpatch=require(_0x4884('0x1'));var rp=require(_0x4884('0x2'));var moment=require(_0x4884('0x3'));var BPromise=require(_0x4884('0x4'));var Mustache=require(_0x4884('0x5'));var util=require(_0x4884('0x6'));var path=require('path');var sox=require(_0x4884('0x7'));var csv=require(_0x4884('0x8'));var ejs=require(_0x4884('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4884('0xa'));var squel=require(_0x4884('0xb'));var crypto=require(_0x4884('0xc'));var jsforce=require(_0x4884('0xd'));var deskjs=require(_0x4884('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4884('0xf'));var Papa=require('papaparse');var Redis=require(_0x4884('0x10'));var authService=require(_0x4884('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4884('0x12'));var hardwareService=require(_0x4884('0x13'));var logger=require(_0x4884('0x14'))(_0x4884('0x15'));var utils=require(_0x4884('0x16'));var config=require(_0x4884('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x4884('0x18'))['db'];function respondWithStatusCode(_0x84b33d,_0x3e32d5){_0x3e32d5=_0x3e32d5||0xcc;return function(_0x531d9d){if(_0x531d9d){return _0x84b33d[_0x4884('0x19')](_0x3e32d5);}return _0x84b33d[_0x4884('0x1a')](_0x3e32d5)[_0x4884('0x1b')]();};}function respondWithResult(_0x45683c,_0x1eeade){_0x1eeade=_0x1eeade||0xc8;return function(_0x4051ed){if(_0x4051ed){return _0x45683c['status'](_0x1eeade)['json'](_0x4051ed);}};}function respondWithFilteredResult(_0x7134be,_0x98163d){return function(_0x333155){if(_0x333155){var _0x462835=typeof _0x98163d[_0x4884('0x1c')]===_0x4884('0x1d')&&typeof _0x98163d[_0x4884('0x1e')]===_0x4884('0x1d');var _0x320487=_0x333155[_0x4884('0x1f')];var _0x25efdf=_0x462835?0x0:_0x98163d[_0x4884('0x1c')];var _0x57a16d=_0x462835?_0x333155['count']:_0x98163d[_0x4884('0x1c')]+_0x98163d[_0x4884('0x1e')];var _0x5d2ac5;if(_0x57a16d>=_0x320487){_0x57a16d=_0x320487;_0x5d2ac5=0xc8;}else{_0x5d2ac5=0xce;}_0x7134be[_0x4884('0x1a')](_0x5d2ac5);return _0x7134be[_0x4884('0x20')](_0x4884('0x21'),_0x25efdf+'-'+_0x57a16d+'/'+_0x320487)[_0x4884('0x22')](_0x333155);}return null;};}function patchUpdates(_0x4c265d){return function(_0x966ddd){try{jsonpatch[_0x4884('0x23')](_0x966ddd,_0x4c265d,!![]);}catch(_0x46672c){return BPromise['reject'](_0x46672c);}return _0x966ddd[_0x4884('0x24')]();};}function saveUpdates(_0x346427,_0x5352e6){return function(_0x2dce03){if(_0x2dce03){return _0x2dce03[_0x4884('0x25')](_0x346427)[_0x4884('0x26')](function(_0xe05d7b){return _0xe05d7b;});}return null;};}function removeEntity(_0x463384,_0x2409e4){return function(_0x11363d){if(_0x11363d){return _0x11363d['destroy']()[_0x4884('0x26')](function(){var _0x4ae061=_0x11363d[_0x4884('0x27')]({'plain':!![]});var _0x482709=_0x4884('0x28');return db[_0x4884('0x29')][_0x4884('0x2a')]({'where':{'type':_0x482709,'resourceId':_0x4ae061['id']}})[_0x4884('0x26')](function(){return _0x11363d;});})['then'](function(){_0x463384['status'](0xcc)[_0x4884('0x1b')]();});}};}function handleEntityNotFound(_0x1f2bf9,_0x4e8fe6){return function(_0xcb1d33){if(!_0xcb1d33){_0x1f2bf9['sendStatus'](0x194);}return _0xcb1d33;};}function handleError(_0x14a575,_0x3b397e){_0x3b397e=_0x3b397e||0x1f4;return function(_0x1ad68c){logger[_0x4884('0x2b')](_0x1ad68c[_0x4884('0x2c')]);if(_0x1ad68c[_0x4884('0x2d')]){delete _0x1ad68c[_0x4884('0x2d')];}_0x14a575[_0x4884('0x1a')](_0x3b397e)[_0x4884('0x2e')](_0x1ad68c);};}exports['index']=function(_0x29b568,_0x3cf8e6){var _0x1580a3={},_0x521cf4={},_0x2ee573={'count':0x0,'rows':[]};return db[_0x4884('0x2f')][_0x4884('0x30')]()[_0x4884('0x26')](function(_0x4a1a22){_0x521cf4[_0x4884('0x31')]=_['keys'](_0x4a1a22);_0x521cf4[_0x4884('0x32')]=_[_0x4884('0x33')](_0x29b568[_0x4884('0x32')]);_0x521cf4[_0x4884('0x34')]=_['intersection'](_0x521cf4[_0x4884('0x31')],_0x521cf4[_0x4884('0x32')]);_0x1580a3[_0x4884('0x35')]=_[_0x4884('0x36')](_0x521cf4[_0x4884('0x31')],qs[_0x4884('0x37')](_0x29b568[_0x4884('0x32')][_0x4884('0x37')]));_0x1580a3[_0x4884('0x35')]=_0x1580a3[_0x4884('0x35')]['length']?_0x1580a3['attributes']:_0x521cf4[_0x4884('0x31')];if(!_0x29b568[_0x4884('0x32')][_0x4884('0x38')](_0x4884('0x39'))){_0x1580a3[_0x4884('0x1e')]=qs[_0x4884('0x1e')](_0x29b568['query'][_0x4884('0x1e')]);_0x1580a3[_0x4884('0x1c')]=qs[_0x4884('0x1c')](_0x29b568[_0x4884('0x32')]['offset']);}_0x1580a3['order']=qs[_0x4884('0x3a')](_0x29b568[_0x4884('0x32')][_0x4884('0x3a')]);_0x1580a3[_0x4884('0x3b')]=qs[_0x4884('0x34')](_[_0x4884('0x3c')](_0x29b568['query'],_0x521cf4['filters']),_0x4a1a22);if(_0x29b568['query']['filter']){_0x1580a3[_0x4884('0x3b')]=_[_0x4884('0x3d')](_0x1580a3['where'],{'$or':_[_0x4884('0x3e')](_0x1580a3[_0x4884('0x35')],function(_0x2d1e85){var _0x3c9e0f={};_0x3c9e0f[_0x2d1e85]={'$like':'%'+_0x29b568[_0x4884('0x32')]['filter']+'%'};return _0x3c9e0f;})});}_0x1580a3=_[_0x4884('0x3d')]({},_0x1580a3,_0x29b568[_0x4884('0x3f')]);var _0x33a5ba={'where':_0x1580a3['where']};return db[_0x4884('0x2f')][_0x4884('0x1f')](_0x33a5ba)['then'](function(_0x28014f){_0x2ee573[_0x4884('0x1f')]=_0x28014f;if(_0x29b568['query'][_0x4884('0x40')]){_0x1580a3[_0x4884('0x41')]=[{'all':!![]}];}return db[_0x4884('0x2f')][_0x4884('0x42')](_0x1580a3);})[_0x4884('0x26')](function(_0x109d2a){_0x2ee573['rows']=_0x109d2a;return _0x2ee573;})[_0x4884('0x26')](respondWithFilteredResult(_0x3cf8e6,_0x1580a3))[_0x4884('0x43')](handleError(_0x3cf8e6,null));})['catch'](handleError(_0x3cf8e6,null));};exports[_0x4884('0x44')]=function(_0x428a8e,_0x45340b){var _0x223005={'raw':![],'where':{'id':_0x428a8e[_0x4884('0x45')]['id']}},_0x3a205d={};_0x3a205d[_0x4884('0x31')]=_[_0x4884('0x33')](db[_0x4884('0x2f')]['rawAttributes']);_0x3a205d[_0x4884('0x32')]=_[_0x4884('0x33')](_0x428a8e[_0x4884('0x32')]);_0x3a205d['filters']=_['intersection'](_0x3a205d[_0x4884('0x31')],_0x3a205d[_0x4884('0x32')]);_0x223005['attributes']=_[_0x4884('0x36')](_0x3a205d['model'],qs['fields'](_0x428a8e[_0x4884('0x32')]['fields']));_0x223005[_0x4884('0x35')]=_0x223005[_0x4884('0x35')][_0x4884('0x46')]?_0x223005['attributes']:_0x3a205d[_0x4884('0x31')];if(_0x428a8e[_0x4884('0x32')]['includeAll']){_0x223005[_0x4884('0x41')]=[{'all':!![]}];}_0x223005=_['merge']({},_0x223005,_0x428a8e[_0x4884('0x3f')]);return db['CmCompany'][_0x4884('0x47')](_0x223005)[_0x4884('0x26')](handleEntityNotFound(_0x45340b,null))[_0x4884('0x26')](respondWithResult(_0x45340b,null))[_0x4884('0x43')](handleError(_0x45340b,null));};exports['create']=function(_0x31f9ca,_0x1b86d7){return db[_0x4884('0x2f')]['create'](_0x31f9ca['body'],{})[_0x4884('0x26')](function(_0x4cb359){var _0x44c5b5=_0x31f9ca[_0x4884('0x48')]['get']({'plain':!![]});if(!_0x44c5b5)throw new Error(_0x4884('0x49'));if(_0x44c5b5[_0x4884('0x4a')]===_0x4884('0x48')){var _0x1da852=_0x4cb359['get']({'plain':!![]});var _0x59930a='Companies';return db[_0x4884('0x4b')]['find']({'where':{'name':_0x59930a,'userProfileId':_0x44c5b5[_0x4884('0x4c')]},'raw':!![]})[_0x4884('0x26')](function(_0x4c3271){if(_0x4c3271&&_0x4c3271['autoAssociation']===0x0){return db[_0x4884('0x29')][_0x4884('0x4d')]({'name':_0x1da852[_0x4884('0x2d')],'resourceId':_0x1da852['id'],'type':_0x4c3271[_0x4884('0x2d')],'sectionId':_0x4c3271['id']},{})[_0x4884('0x26')](function(){return _0x4cb359;});}else{return _0x4cb359;}})[_0x4884('0x43')](function(_0x56b1da){logger['error'](_0x4884('0x4e'),_0x56b1da);throw _0x56b1da;});}return _0x4cb359;})[_0x4884('0x26')](respondWithResult(_0x1b86d7,0xc9))[_0x4884('0x43')](handleError(_0x1b86d7,null));};exports[_0x4884('0x25')]=function(_0x53d93d,_0x72c38b){if(_0x53d93d[_0x4884('0x4f')]['id']){delete _0x53d93d[_0x4884('0x4f')]['id'];}return db[_0x4884('0x2f')][_0x4884('0x47')]({'where':{'id':_0x53d93d[_0x4884('0x45')]['id']}})[_0x4884('0x26')](handleEntityNotFound(_0x72c38b,null))[_0x4884('0x26')](saveUpdates(_0x53d93d[_0x4884('0x4f')],null))['then'](respondWithResult(_0x72c38b,null))[_0x4884('0x43')](handleError(_0x72c38b,null));};exports[_0x4884('0x2a')]=function(_0x2a22e0,_0x3d0bee){return db['CmCompany'][_0x4884('0x47')]({'where':{'id':_0x2a22e0['params']['id']}})[_0x4884('0x26')](handleEntityNotFound(_0x3d0bee,null))[_0x4884('0x26')](removeEntity(_0x3d0bee,null))[_0x4884('0x43')](handleError(_0x3d0bee,null));};exports[_0x4884('0x30')]=function(_0x51d7ec,_0x626726){return db[_0x4884('0x2f')]['describe']()['then'](respondWithResult(_0x626726,null))[_0x4884('0x43')](handleError(_0x626726,null));};exports[_0x4884('0x50')]=function(_0x34bff4,_0x488fb4,_0x31b1c2){return db[_0x4884('0x51')][_0x4884('0x47')]({'where':{'id':_0x34bff4[_0x4884('0x45')]['id']}})[_0x4884('0x26')](handleEntityNotFound(_0x488fb4,null))[_0x4884('0x26')](function(_0x36442f){if(_0x36442f){return _0x36442f[_0x4884('0x50')](_0x34bff4[_0x4884('0x4f')][_0x4884('0x52')],_[_0x4884('0x53')](_0x34bff4[_0x4884('0x4f')],[_0x4884('0x52'),'id'])||{});}})[_0x4884('0x26')](respondWithResult(_0x488fb4,null))[_0x4884('0x43')](handleError(_0x488fb4,null));};exports[_0x4884('0x54')]=function(_0x1e40e7,_0x36f4a8,_0x4142de){var _0x308a42={};var _0x4de367={};var _0x355861;var _0x6d26cc;return db[_0x4884('0x2f')]['findOne']({'where':{'id':_0x1e40e7['params']['id']}})[_0x4884('0x26')](handleEntityNotFound(_0x36f4a8,null))[_0x4884('0x26')](function(_0x59ec1b){if(_0x59ec1b){_0x355861=_0x59ec1b;_0x4de367[_0x4884('0x31')]=_['keys'](db[_0x4884('0x51')][_0x4884('0x55')]);_0x4de367[_0x4884('0x32')]=_[_0x4884('0x33')](_0x1e40e7[_0x4884('0x32')]);_0x4de367[_0x4884('0x34')]=_['intersection'](_0x4de367[_0x4884('0x31')],_0x4de367[_0x4884('0x32')]);_0x308a42['attributes']=_['intersection'](_0x4de367[_0x4884('0x31')],qs['fields'](_0x1e40e7['query'][_0x4884('0x37')]));_0x308a42['attributes']=_0x308a42[_0x4884('0x35')][_0x4884('0x46')]?_0x308a42[_0x4884('0x35')]:_0x4de367['model'];_0x308a42[_0x4884('0x56')]=qs['sort'](_0x1e40e7[_0x4884('0x32')][_0x4884('0x3a')]);_0x308a42[_0x4884('0x3b')]=qs[_0x4884('0x34')](_['pick'](_0x1e40e7[_0x4884('0x32')],_0x4de367[_0x4884('0x34')]));if(_0x1e40e7[_0x4884('0x32')][_0x4884('0x57')]){_0x308a42['where']=_[_0x4884('0x3d')](_0x308a42[_0x4884('0x3b')],{'$or':_[_0x4884('0x3e')](_0x308a42[_0x4884('0x35')],function(_0x289731){var _0x19a31c={};_0x19a31c[_0x289731]={'$like':'%'+_0x1e40e7[_0x4884('0x32')][_0x4884('0x57')]+'%'};return _0x19a31c;})});}_0x308a42=_[_0x4884('0x3d')]({},_0x308a42,_0x1e40e7['options']);return _0x355861[_0x4884('0x54')](_0x308a42);}})[_0x4884('0x26')](function(_0x2eff05){if(_0x2eff05){_0x6d26cc=_0x2eff05[_0x4884('0x46')];if(!_0x1e40e7[_0x4884('0x32')][_0x4884('0x38')](_0x4884('0x39'))){_0x308a42[_0x4884('0x1e')]=qs[_0x4884('0x1e')](_0x1e40e7[_0x4884('0x32')][_0x4884('0x1e')]);_0x308a42[_0x4884('0x1c')]=qs[_0x4884('0x1c')](_0x1e40e7[_0x4884('0x32')][_0x4884('0x1c')]);}return _0x355861['getContacts'](_0x308a42);}})['then'](function(_0x2830fb){if(_0x2830fb){return _0x2830fb?{'count':_0x6d26cc,'rows':_0x2830fb}:null;}})[_0x4884('0x26')](respondWithResult(_0x36f4a8,null))['catch'](handleError(_0x36f4a8,null));}; \ No newline at end of file +var _0x3509=['undefined','limit','set','apply','reject','save','then','destroy','get','Companies','UserProfileResource','end','stack','name','CmCompany','describe','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','count','includeAll','rows','catch','show','params','rawAttributes','include','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','CmContact','addContacts','ids','omit','getContacts','findOne','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset'];(function(_0xa83955,_0x842b87){var _0x39d283=function(_0x1f7c2e){while(--_0x1f7c2e){_0xa83955['push'](_0xa83955['shift']());}};_0x39d283(++_0x842b87);}(_0x3509,0x137));var _0x9350=function(_0x3ca012,_0x4cff79){_0x3ca012=_0x3ca012-0x0;var _0x1a8b78=_0x3509[_0x3ca012];return _0x1a8b78;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9350('0x0'));var zipdir=require(_0x9350('0x1'));var jsonpatch=require(_0x9350('0x2'));var rp=require(_0x9350('0x3'));var moment=require(_0x9350('0x4'));var BPromise=require(_0x9350('0x5'));var Mustache=require('mustache');var util=require(_0x9350('0x6'));var path=require(_0x9350('0x7'));var sox=require(_0x9350('0x8'));var csv=require(_0x9350('0x9'));var ejs=require(_0x9350('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9350('0xb'));var squel=require(_0x9350('0xc'));var crypto=require(_0x9350('0xd'));var jsforce=require(_0x9350('0xe'));var deskjs=require(_0x9350('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9350('0x10'));var Redis=require(_0x9350('0x11'));var authService=require(_0x9350('0x12'));var qs=require(_0x9350('0x13'));var as=require(_0x9350('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9350('0x15'))(_0x9350('0x16'));var utils=require('../../config/utils');var config=require(_0x9350('0x17'));var licenseUtil=require(_0x9350('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a2c51,_0x252cb2){_0x252cb2=_0x252cb2||0xcc;return function(_0x21f30e){if(_0x21f30e){return _0x1a2c51[_0x9350('0x19')](_0x252cb2);}return _0x1a2c51[_0x9350('0x1a')](_0x252cb2)['end']();};}function respondWithResult(_0x19d600,_0x59e0ff){_0x59e0ff=_0x59e0ff||0xc8;return function(_0x415d5c){if(_0x415d5c){return _0x19d600[_0x9350('0x1a')](_0x59e0ff)[_0x9350('0x1b')](_0x415d5c);}};}function respondWithFilteredResult(_0x43938f,_0x34324b){return function(_0x42f8bb){if(_0x42f8bb){var _0x321995=typeof _0x34324b[_0x9350('0x1c')]===_0x9350('0x1d')&&typeof _0x34324b[_0x9350('0x1e')]==='undefined';var _0xb949cf=_0x42f8bb['count'];var _0x3f5dfe=_0x321995?0x0:_0x34324b[_0x9350('0x1c')];var _0x16a8eb=_0x321995?_0x42f8bb['count']:_0x34324b[_0x9350('0x1c')]+_0x34324b[_0x9350('0x1e')];var _0x218930;if(_0x16a8eb>=_0xb949cf){_0x16a8eb=_0xb949cf;_0x218930=0xc8;}else{_0x218930=0xce;}_0x43938f[_0x9350('0x1a')](_0x218930);return _0x43938f[_0x9350('0x1f')]('Content-Range',_0x3f5dfe+'-'+_0x16a8eb+'/'+_0xb949cf)[_0x9350('0x1b')](_0x42f8bb);}return null;};}function patchUpdates(_0x512b1c){return function(_0x203d0d){try{jsonpatch[_0x9350('0x20')](_0x203d0d,_0x512b1c,!![]);}catch(_0x23828b){return BPromise[_0x9350('0x21')](_0x23828b);}return _0x203d0d[_0x9350('0x22')]();};}function saveUpdates(_0x167084,_0x4620d4){return function(_0x29ff72){if(_0x29ff72){return _0x29ff72['update'](_0x167084)[_0x9350('0x23')](function(_0xc8545e){return _0xc8545e;});}return null;};}function removeEntity(_0x4b9e35,_0x13b1a1){return function(_0x2e0a96){if(_0x2e0a96){return _0x2e0a96[_0x9350('0x24')]()['then'](function(){var _0x3971b0=_0x2e0a96[_0x9350('0x25')]({'plain':!![]});var _0x98556c=_0x9350('0x26');return db[_0x9350('0x27')][_0x9350('0x24')]({'where':{'type':_0x98556c,'resourceId':_0x3971b0['id']}})['then'](function(){return _0x2e0a96;});})[_0x9350('0x23')](function(){_0x4b9e35[_0x9350('0x1a')](0xcc)[_0x9350('0x28')]();});}};}function handleEntityNotFound(_0x5798df,_0x660492){return function(_0x5663be){if(!_0x5663be){_0x5798df['sendStatus'](0x194);}return _0x5663be;};}function handleError(_0x59c1d1,_0x471193){_0x471193=_0x471193||0x1f4;return function(_0xc545a8){logger['error'](_0xc545a8[_0x9350('0x29')]);if(_0xc545a8[_0x9350('0x2a')]){delete _0xc545a8[_0x9350('0x2a')];}_0x59c1d1[_0x9350('0x1a')](_0x471193)['send'](_0xc545a8);};}exports['index']=function(_0x319599,_0x53f37a){var _0x30f51e={},_0x553536={},_0x358424={'count':0x0,'rows':[]};return db[_0x9350('0x2b')][_0x9350('0x2c')]()[_0x9350('0x23')](function(_0x4e7d31){_0x553536[_0x9350('0x2d')]=_[_0x9350('0x2e')](_0x4e7d31);_0x553536[_0x9350('0x2f')]=_['keys'](_0x319599['query']);_0x553536[_0x9350('0x30')]=_[_0x9350('0x31')](_0x553536['model'],_0x553536[_0x9350('0x2f')]);_0x30f51e['attributes']=_[_0x9350('0x31')](_0x553536[_0x9350('0x2d')],qs[_0x9350('0x32')](_0x319599[_0x9350('0x2f')]['fields']));_0x30f51e[_0x9350('0x33')]=_0x30f51e[_0x9350('0x33')][_0x9350('0x34')]?_0x30f51e[_0x9350('0x33')]:_0x553536[_0x9350('0x2d')];if(!_0x319599[_0x9350('0x2f')][_0x9350('0x35')](_0x9350('0x36'))){_0x30f51e[_0x9350('0x1e')]=qs[_0x9350('0x1e')](_0x319599[_0x9350('0x2f')][_0x9350('0x1e')]);_0x30f51e[_0x9350('0x1c')]=qs[_0x9350('0x1c')](_0x319599[_0x9350('0x2f')]['offset']);}_0x30f51e[_0x9350('0x37')]=qs[_0x9350('0x38')](_0x319599[_0x9350('0x2f')][_0x9350('0x38')]);_0x30f51e[_0x9350('0x39')]=qs[_0x9350('0x30')](_['pick'](_0x319599[_0x9350('0x2f')],_0x553536['filters']),_0x4e7d31);if(_0x319599['query'][_0x9350('0x3a')]){_0x30f51e[_0x9350('0x39')]=_[_0x9350('0x3b')](_0x30f51e[_0x9350('0x39')],{'$or':_[_0x9350('0x3c')](_0x30f51e[_0x9350('0x33')],function(_0x425541){var _0x23b473={};_0x23b473[_0x425541]={'$like':'%'+_0x319599['query'][_0x9350('0x3a')]+'%'};return _0x23b473;})});}_0x30f51e=_[_0x9350('0x3b')]({},_0x30f51e,_0x319599['options']);var _0x2ffb01={'where':_0x30f51e[_0x9350('0x39')]};return db[_0x9350('0x2b')][_0x9350('0x3d')](_0x2ffb01)[_0x9350('0x23')](function(_0x20742c){_0x358424[_0x9350('0x3d')]=_0x20742c;if(_0x319599[_0x9350('0x2f')][_0x9350('0x3e')]){_0x30f51e['include']=[{'all':!![]}];}return db[_0x9350('0x2b')]['findAll'](_0x30f51e);})[_0x9350('0x23')](function(_0x4c3357){_0x358424[_0x9350('0x3f')]=_0x4c3357;return _0x358424;})[_0x9350('0x23')](respondWithFilteredResult(_0x53f37a,_0x30f51e))['catch'](handleError(_0x53f37a,null));})[_0x9350('0x40')](handleError(_0x53f37a,null));};exports[_0x9350('0x41')]=function(_0x3be0e6,_0x53938b){var _0x1510ed={'raw':![],'where':{'id':_0x3be0e6[_0x9350('0x42')]['id']}},_0x1dc2ae={};_0x1dc2ae[_0x9350('0x2d')]=_['keys'](db[_0x9350('0x2b')][_0x9350('0x43')]);_0x1dc2ae[_0x9350('0x2f')]=_[_0x9350('0x2e')](_0x3be0e6[_0x9350('0x2f')]);_0x1dc2ae[_0x9350('0x30')]=_[_0x9350('0x31')](_0x1dc2ae['model'],_0x1dc2ae[_0x9350('0x2f')]);_0x1510ed[_0x9350('0x33')]=_['intersection'](_0x1dc2ae[_0x9350('0x2d')],qs['fields'](_0x3be0e6['query']['fields']));_0x1510ed['attributes']=_0x1510ed[_0x9350('0x33')][_0x9350('0x34')]?_0x1510ed[_0x9350('0x33')]:_0x1dc2ae[_0x9350('0x2d')];if(_0x3be0e6[_0x9350('0x2f')][_0x9350('0x3e')]){_0x1510ed[_0x9350('0x44')]=[{'all':!![]}];}_0x1510ed=_[_0x9350('0x3b')]({},_0x1510ed,_0x3be0e6[_0x9350('0x45')]);return db['CmCompany']['find'](_0x1510ed)[_0x9350('0x23')](handleEntityNotFound(_0x53938b,null))['then'](respondWithResult(_0x53938b,null))[_0x9350('0x40')](handleError(_0x53938b,null));};exports[_0x9350('0x46')]=function(_0x4c7f73,_0x2d364a){return db[_0x9350('0x2b')]['create'](_0x4c7f73[_0x9350('0x47')],{})[_0x9350('0x23')](function(_0x3e1cd7){var _0x2d3f37=_0x4c7f73[_0x9350('0x48')][_0x9350('0x25')]({'plain':!![]});if(!_0x2d3f37)throw new Error(_0x9350('0x49'));if(_0x2d3f37[_0x9350('0x4a')]===_0x9350('0x48')){var _0x295004=_0x3e1cd7['get']({'plain':!![]});var _0x42c787=_0x9350('0x26');return db[_0x9350('0x4b')][_0x9350('0x4c')]({'where':{'name':_0x42c787,'userProfileId':_0x2d3f37[_0x9350('0x4d')]},'raw':!![]})[_0x9350('0x23')](function(_0x283f4f){if(_0x283f4f&&_0x283f4f[_0x9350('0x4e')]===0x0){return db[_0x9350('0x27')][_0x9350('0x46')]({'name':_0x295004[_0x9350('0x2a')],'resourceId':_0x295004['id'],'type':_0x283f4f[_0x9350('0x2a')],'sectionId':_0x283f4f['id']},{})[_0x9350('0x23')](function(){return _0x3e1cd7;});}else{return _0x3e1cd7;}})[_0x9350('0x40')](function(_0x3b90a2){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b90a2);throw _0x3b90a2;});}return _0x3e1cd7;})[_0x9350('0x23')](respondWithResult(_0x2d364a,0xc9))['catch'](handleError(_0x2d364a,null));};exports['update']=function(_0x1b7a1c,_0x46ffbb){if(_0x1b7a1c[_0x9350('0x47')]['id']){delete _0x1b7a1c[_0x9350('0x47')]['id'];}return db[_0x9350('0x2b')][_0x9350('0x4c')]({'where':{'id':_0x1b7a1c[_0x9350('0x42')]['id']}})[_0x9350('0x23')](handleEntityNotFound(_0x46ffbb,null))[_0x9350('0x23')](saveUpdates(_0x1b7a1c[_0x9350('0x47')],null))[_0x9350('0x23')](respondWithResult(_0x46ffbb,null))[_0x9350('0x40')](handleError(_0x46ffbb,null));};exports['destroy']=function(_0x579a78,_0xa6e822){return db[_0x9350('0x2b')][_0x9350('0x4c')]({'where':{'id':_0x579a78['params']['id']}})[_0x9350('0x23')](handleEntityNotFound(_0xa6e822,null))['then'](removeEntity(_0xa6e822,null))['catch'](handleError(_0xa6e822,null));};exports[_0x9350('0x2c')]=function(_0x5c5997,_0x441a06){return db[_0x9350('0x2b')]['describe']()['then'](respondWithResult(_0x441a06,null))['catch'](handleError(_0x441a06,null));};exports['addContacts']=function(_0x1d36f2,_0x1fa958,_0x4c52ef){return db[_0x9350('0x4f')][_0x9350('0x4c')]({'where':{'id':_0x1d36f2[_0x9350('0x42')]['id']}})[_0x9350('0x23')](handleEntityNotFound(_0x1fa958,null))[_0x9350('0x23')](function(_0x1a17f6){if(_0x1a17f6){return _0x1a17f6[_0x9350('0x50')](_0x1d36f2['body'][_0x9350('0x51')],_[_0x9350('0x52')](_0x1d36f2[_0x9350('0x47')],['ids','id'])||{});}})['then'](respondWithResult(_0x1fa958,null))[_0x9350('0x40')](handleError(_0x1fa958,null));};exports[_0x9350('0x53')]=function(_0x5657ce,_0x2442a1,_0x54c5e1){var _0x2fc7a3={};var _0x418f6e={};var _0x4f1da1;var _0x53e4eb;return db['CmCompany'][_0x9350('0x54')]({'where':{'id':_0x5657ce[_0x9350('0x42')]['id']}})[_0x9350('0x23')](handleEntityNotFound(_0x2442a1,null))[_0x9350('0x23')](function(_0x34424e){if(_0x34424e){_0x4f1da1=_0x34424e;_0x418f6e['model']=_[_0x9350('0x2e')](db[_0x9350('0x4f')][_0x9350('0x43')]);_0x418f6e[_0x9350('0x2f')]=_[_0x9350('0x2e')](_0x5657ce[_0x9350('0x2f')]);_0x418f6e[_0x9350('0x30')]=_[_0x9350('0x31')](_0x418f6e[_0x9350('0x2d')],_0x418f6e[_0x9350('0x2f')]);_0x2fc7a3['attributes']=_[_0x9350('0x31')](_0x418f6e[_0x9350('0x2d')],qs[_0x9350('0x32')](_0x5657ce[_0x9350('0x2f')][_0x9350('0x32')]));_0x2fc7a3[_0x9350('0x33')]=_0x2fc7a3[_0x9350('0x33')][_0x9350('0x34')]?_0x2fc7a3[_0x9350('0x33')]:_0x418f6e[_0x9350('0x2d')];_0x2fc7a3[_0x9350('0x37')]=qs['sort'](_0x5657ce['query'][_0x9350('0x38')]);_0x2fc7a3[_0x9350('0x39')]=qs[_0x9350('0x30')](_['pick'](_0x5657ce[_0x9350('0x2f')],_0x418f6e['filters']));if(_0x5657ce[_0x9350('0x2f')]['filter']){_0x2fc7a3[_0x9350('0x39')]=_[_0x9350('0x3b')](_0x2fc7a3[_0x9350('0x39')],{'$or':_[_0x9350('0x3c')](_0x2fc7a3['attributes'],function(_0x50723a){var _0x5bcb79={};_0x5bcb79[_0x50723a]={'$like':'%'+_0x5657ce[_0x9350('0x2f')][_0x9350('0x3a')]+'%'};return _0x5bcb79;})});}_0x2fc7a3=_[_0x9350('0x3b')]({},_0x2fc7a3,_0x5657ce[_0x9350('0x45')]);return _0x4f1da1[_0x9350('0x53')](_0x2fc7a3);}})[_0x9350('0x23')](function(_0x349094){if(_0x349094){_0x53e4eb=_0x349094[_0x9350('0x34')];if(!_0x5657ce[_0x9350('0x2f')]['hasOwnProperty'](_0x9350('0x36'))){_0x2fc7a3[_0x9350('0x1e')]=qs[_0x9350('0x1e')](_0x5657ce['query'][_0x9350('0x1e')]);_0x2fc7a3['offset']=qs[_0x9350('0x1c')](_0x5657ce[_0x9350('0x2f')][_0x9350('0x1c')]);}return _0x4f1da1['getContacts'](_0x2fc7a3);}})[_0x9350('0x23')](function(_0x2e0d2f){if(_0x2e0d2f){return _0x2e0d2f?{'count':_0x53e4eb,'rows':_0x2e0d2f}:null;}})[_0x9350('0x23')](respondWithResult(_0x2442a1,null))['catch'](handleError(_0x2442a1,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 3ae8484..4593b1d 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 _0x232d=['cm_companies','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./cmCompany.attributes','exports','CmCompany'];(function(_0x45444,_0x3b4b24){var _0x9088b3=function(_0x5dfbe6){while(--_0x5dfbe6){_0x45444['push'](_0x45444['shift']());}};_0x9088b3(++_0x3b4b24);}(_0x232d,0x1e1));var _0xd232=function(_0x2bf890,_0x533ee8){_0x2bf890=_0x2bf890-0x0;var _0x5f2f89=_0x232d[_0x2bf890];return _0x5f2f89;};'use strict';var _=require(_0xd232('0x0'));var util=require(_0xd232('0x1'));var logger=require(_0xd232('0x2'))(_0xd232('0x3'));var moment=require(_0xd232('0x4'));var BPromise=require(_0xd232('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd232('0x6'));var rimraf=require(_0xd232('0x7'));var config=require('../../config/environment');var attributes=require(_0xd232('0x8'));module[_0xd232('0x9')]=function(_0x167f0e,_0x5520ce){return _0x167f0e['define'](_0xd232('0xa'),attributes,{'tableName':_0xd232('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3090=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','define','CmCompany','lodash','util'];(function(_0xa15223,_0x3f90ee){var _0x395b9a=function(_0x4eb25b){while(--_0x4eb25b){_0xa15223['push'](_0xa15223['shift']());}};_0x395b9a(++_0x3f90ee);}(_0x3090,0x127));var _0x0309=function(_0xb6dab,_0x5bff55){_0xb6dab=_0xb6dab-0x0;var _0x1ec72d=_0x3090[_0xb6dab];return _0x1ec72d;};'use strict';var _=require(_0x0309('0x0'));var util=require(_0x0309('0x1'));var logger=require(_0x0309('0x2'))(_0x0309('0x3'));var moment=require('moment');var BPromise=require(_0x0309('0x4'));var rp=require(_0x0309('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0309('0x6'));var config=require(_0x0309('0x7'));var attributes=require('./cmCompany.attributes');module[_0x0309('0x8')]=function(_0x29745f,_0x25a1e5){return _0x29745f[_0x0309('0x9')](_0x0309('0xa'),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 8f65a3e..18b3fa4 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 _0xc7f8=['../../config/environment','jayson/promise','http','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x245e56,_0x4aaaab){var _0x3149c8=function(_0x540723){while(--_0x540723){_0x245e56['push'](_0x245e56['shift']());}};_0x3149c8(++_0x4aaaab);}(_0xc7f8,0x138));var _0x8c7f=function(_0x4b9bb9,_0x2d5534){_0x4b9bb9=_0x4b9bb9-0x0;var _0x58c9aa=_0xc7f8[_0x4b9bb9];return _0x58c9aa;};'use strict';var _=require(_0x8c7f('0x0'));var util=require(_0x8c7f('0x1'));var moment=require(_0x8c7f('0x2'));var BPromise=require(_0x8c7f('0x3'));var rs=require(_0x8c7f('0x4'));var fs=require('fs');var Redis=require(_0x8c7f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8c7f('0x6'));var logger=require('../../config/logger')(_0x8c7f('0x7'));var config=require(_0x8c7f('0x8'));var jayson=require(_0x8c7f('0x9'));var client=jayson['client'][_0x8c7f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27d98b,_0x5ac91f,_0x5eaf21){return new BPromise(function(_0x355a54,_0x41558e){return client['request'](_0x27d98b,_0x5eaf21)['then'](function(_0x4f7d05){logger[_0x8c7f('0xb')](_0x8c7f('0xc'),_0x5ac91f,'request\x20sent');logger[_0x8c7f('0xd')](_0x8c7f('0xe'),_0x5ac91f,_0x8c7f('0xf'),JSON['stringify'](_0x4f7d05));if(_0x4f7d05[_0x8c7f('0x10')]){if(_0x4f7d05['error'][_0x8c7f('0x11')]===0x1f4){logger[_0x8c7f('0x10')](_0x8c7f('0xc'),_0x5ac91f,_0x4f7d05[_0x8c7f('0x10')]['message']);return _0x41558e(_0x4f7d05[_0x8c7f('0x10')][_0x8c7f('0x12')]);}logger['error'](_0x8c7f('0xc'),_0x5ac91f,_0x4f7d05[_0x8c7f('0x10')][_0x8c7f('0x12')]);return _0x355a54(_0x4f7d05[_0x8c7f('0x10')][_0x8c7f('0x12')]);}else{logger[_0x8c7f('0xb')](_0x8c7f('0xc'),_0x5ac91f,_0x8c7f('0xf'));_0x355a54(_0x4f7d05[_0x8c7f('0x13')][_0x8c7f('0x12')]);}})['catch'](function(_0x4cc8cd){logger[_0x8c7f('0x10')](_0x8c7f('0xc'),_0x5ac91f,_0x4cc8cd);_0x41558e(_0x4cc8cd);});});} \ No newline at end of file +var _0xfd63=['code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xfd63,0xdd));var _0x3fd6=function(_0x441c73,_0x3b3205){_0x441c73=_0x441c73-0x0;var _0x221693=_0xfd63[_0x441c73];return _0x221693;};'use strict';var _=require('lodash');var util=require(_0x3fd6('0x0'));var moment=require(_0x3fd6('0x1'));var BPromise=require(_0x3fd6('0x2'));var rs=require(_0x3fd6('0x3'));var fs=require('fs');var Redis=require(_0x3fd6('0x4'));var db=require(_0x3fd6('0x5'))['db'];var utils=require(_0x3fd6('0x6'));var logger=require(_0x3fd6('0x7'))('rpc');var config=require(_0x3fd6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3fd6('0x9')][_0x3fd6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31c443,_0x4554c6,_0x3f32c8){return new BPromise(function(_0x517f29,_0x53a0f2){return client[_0x3fd6('0xb')](_0x31c443,_0x3f32c8)[_0x3fd6('0xc')](function(_0x7082c1){logger['info'](_0x3fd6('0xd'),_0x4554c6,_0x3fd6('0xe'));logger[_0x3fd6('0xf')](_0x3fd6('0x10'),_0x4554c6,_0x3fd6('0xe'),JSON[_0x3fd6('0x11')](_0x7082c1));if(_0x7082c1[_0x3fd6('0x12')]){if(_0x7082c1[_0x3fd6('0x12')][_0x3fd6('0x13')]===0x1f4){logger[_0x3fd6('0x12')](_0x3fd6('0xd'),_0x4554c6,_0x7082c1[_0x3fd6('0x12')]['message']);return _0x53a0f2(_0x7082c1['error'][_0x3fd6('0x14')]);}logger[_0x3fd6('0x12')]('CmCompany,\x20%s,\x20%s',_0x4554c6,_0x7082c1[_0x3fd6('0x12')]['message']);return _0x517f29(_0x7082c1[_0x3fd6('0x12')][_0x3fd6('0x14')]);}else{logger[_0x3fd6('0x15')](_0x3fd6('0xd'),_0x4554c6,_0x3fd6('0xe'));_0x517f29(_0x7082c1[_0x3fd6('0x16')][_0x3fd6('0x14')]);}})[_0x3fd6('0x17')](function(_0x5ca04e){logger[_0x3fd6('0x12')](_0x3fd6('0xd'),_0x4554c6,_0x5ca04e);_0x53a0f2(_0x5ca04e);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 881be58..84aac68 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 _0xf14a=['/describe','isAuthenticated','describe','show','/:id/contacts','getContacts','post','create','addContacts','put','/:id','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','index'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xf14a,0x9d));var _0xaf14=function(_0x494619,_0x18fc27){_0x494619=_0x494619-0x0;var _0x2be997=_0xf14a[_0x494619];return _0x2be997;};'use strict';var multer=require(_0xaf14('0x0'));var util=require(_0xaf14('0x1'));var path=require('path');var timeout=require(_0xaf14('0x2'));var express=require(_0xaf14('0x3'));var router=express[_0xaf14('0x4')]();var fs_extra=require(_0xaf14('0x5'));var auth=require(_0xaf14('0x6'));var interaction=require(_0xaf14('0x7'));var config=require('../../config/environment');var controller=require(_0xaf14('0x8'));router[_0xaf14('0x9')]('/',auth['isAuthenticated'](),controller[_0xaf14('0xa')]);router['get'](_0xaf14('0xb'),auth[_0xaf14('0xc')](),controller[_0xaf14('0xd')]);router[_0xaf14('0x9')]('/:id',auth[_0xaf14('0xc')](),controller[_0xaf14('0xe')]);router[_0xaf14('0x9')](_0xaf14('0xf'),auth['isAuthenticated'](),controller[_0xaf14('0x10')]);router[_0xaf14('0x11')]('/',auth[_0xaf14('0xc')](),controller[_0xaf14('0x12')]);router['post'](_0xaf14('0xf'),auth['isAuthenticated'](),controller[_0xaf14('0x13')]);router[_0xaf14('0x14')](_0xaf14('0x15'),auth[_0xaf14('0xc')](),controller['update']);router[_0xaf14('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xaf14('0x17')]);module['exports']=router; \ No newline at end of file +var _0x5ee0=['delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getContacts','create','post','/:id/contacts','addContacts'];(function(_0x150800,_0x3e8f49){var _0x4796b9=function(_0x48d5ab){while(--_0x48d5ab){_0x150800['push'](_0x150800['shift']());}};_0x4796b9(++_0x3e8f49);}(_0x5ee0,0x129));var _0x05ee=function(_0x425e96,_0x2389bd){_0x425e96=_0x425e96-0x0;var _0xe80832=_0x5ee0[_0x425e96];return _0xe80832;};'use strict';var multer=require(_0x05ee('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x05ee('0x1'));var express=require(_0x05ee('0x2'));var router=express['Router']();var fs_extra=require(_0x05ee('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x05ee('0x4'));var controller=require(_0x05ee('0x5'));router[_0x05ee('0x6')]('/',auth[_0x05ee('0x7')](),controller[_0x05ee('0x8')]);router[_0x05ee('0x6')](_0x05ee('0x9'),auth[_0x05ee('0x7')](),controller[_0x05ee('0xa')]);router[_0x05ee('0x6')](_0x05ee('0xb'),auth[_0x05ee('0x7')](),controller[_0x05ee('0xc')]);router['get']('/:id/contacts',auth['isAuthenticated'](),controller[_0x05ee('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x05ee('0xe')]);router[_0x05ee('0xf')](_0x05ee('0x10'),auth[_0x05ee('0x7')](),controller[_0x05ee('0x11')]);router['put'](_0x05ee('0xb'),auth[_0x05ee('0x7')](),controller['update']);router[_0x05ee('0x12')](_0x05ee('0xb'),auth[_0x05ee('0x7')](),controller[_0x05ee('0x13')]);module[_0x05ee('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 4d1a05f..0525786 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 _0xf518=['NOW','lodash','sequelize','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0xf2b9fa,_0x192dae){var _0x422042=function(_0x4b359e){while(--_0x4b359e){_0xf2b9fa['push'](_0xf2b9fa['shift']());}};_0x422042(++_0x192dae);}(_0xf518,0x181));var _0x8f51=function(_0x1c2f29,_0x5a2668){_0x1c2f29=_0x1c2f29-0x0;var _0x258465=_0xf518[_0x1c2f29];return _0x258465;};'use strict';var _=require(_0x8f51('0x0'));var Sequelize=require(_0x8f51('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x8f51('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x8f51('0x2')]},'postalCode':{'type':Sequelize[_0x8f51('0x2')]},'city':{'type':Sequelize[_0x8f51('0x2')]},'country':{'type':Sequelize[_0x8f51('0x2')]},'dateOfBirth':{'type':Sequelize[_0x8f51('0x2')]},'description':{'type':Sequelize[_0x8f51('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x8f51('0x2')]},'email':{'type':Sequelize[_0x8f51('0x2')]},'url':{'type':Sequelize[_0x8f51('0x2')]},'facebook':{'type':Sequelize[_0x8f51('0x2')]},'fb_data':{'type':Sequelize[_0x8f51('0x2')]},'twitter':{'type':Sequelize[_0x8f51('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x8f51('0x2')]},'line':{'type':Sequelize[_0x8f51('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x8f51('0x2')]},'UserId':{'type':Sequelize[_0x8f51('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x8f51('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x8f51('0x6')],'defaultValue':Sequelize[_0x8f51('0x7')]}}; \ No newline at end of file +var _0x5487=['INTEGER','UNSIGNED','DATE','lodash','sequelize','exports','STRING','TEXT'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x5487,0xab));var _0x7548=function(_0x5b35dc,_0x114032){_0x5b35dc=_0x5b35dc-0x0;var _0x36b398=_0x5487[_0x5b35dc];return _0x36b398;};'use strict';var _=require(_0x7548('0x0'));var Sequelize=require(_0x7548('0x1'));module[_0x7548('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x7548('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x7548('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x7548('0x3')]},'description':{'type':Sequelize[_0x7548('0x4')]},'phone':{'type':Sequelize[_0x7548('0x3')]},'mobile':{'type':Sequelize[_0x7548('0x3')]},'fax':{'type':Sequelize[_0x7548('0x3')]},'email':{'type':Sequelize[_0x7548('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x7548('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x7548('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x7548('0x3')]},'viber':{'type':Sequelize[_0x7548('0x3')]},'line':{'type':Sequelize[_0x7548('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x7548('0x3')]},'UserId':{'type':Sequelize[_0x7548('0x5')]},'priority':{'type':Sequelize[_0x7548('0x5')](0x2)[_0x7548('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x7548('0x7')],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index e532775..5685b76 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 _0xc3b2=['c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','group','c.id','QueryTypes','SELECT','DESC','having','t.id\x20IN\x20?','resolve','user','role','agent','some','getLists','sequelize','toString','keyBy','merge','c.firstName','c.lastName','c.phone','c.fax','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','describe','columnName','displayName','findAll','alias','custom','values','body','get','mergeWith','tags','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopperBlack','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ChatQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','bulkCreate','duplicates','$or','findOrCreate','spread','show','$and','omit','format','cf_%d','pickBy','table','setFields','toParam','phone','CmHopper','getTags','rawAttributes','options','setTags','ids','getHoppers','nolimit','includeAll','include','getHopperHistories','ContactId','getHopperFinals','getJscriptySessions','No\x20ListId\x20specified','binding_keys','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','filename','chmodSync','0777','child_process','fork','CompanyId','File\x20uploaded\x20correctly!','pid','upload','parse','meta','binding','stringify','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','mail','chat','fax','whatsapp','-createdAt','channel','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20createdAt\x20filter','voice','destination','callerid','endtime','note','userDisposition','userThirdDisposition','UserId','fullname','createdAt','VoiceCallReport','findAndCountAll','Account','closed','closedAt','thirdDisposition','key','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','substatus','externalUrl','threadId','startCase','Interaction','Owner','flatten','sortBy','reverse','moment','bluebird','util','path','lodash','squel','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','defaults','redis','localhost','./cmContact.socket','status','json','limit','undefined','count','offset','set','Content-Range','update','then','destroy','sendStatus','name','send','index','CmContact','keys','length','startsWith','CmCustomField','findOne','cf_','all','fieldType','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','select','field','color','tools_tags','from','cm_contacts','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','c.deletedAt\x20IS\x20NULL','expr','search','sqlOperator','conditions','find','Tag','value','split','map','forEach','union','User','and','uc.UserId\x20=\x20?','datetime','castTo','buildExpression','text','start','end','filter','isNil','Contact','push','isEmpty','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric'];(function(_0xdcfb6b,_0xbd2fb0){var _0x459656=function(_0x10d5a1){while(--_0x10d5a1){_0xdcfb6b['push'](_0xdcfb6b['shift']());}};_0x459656(++_0xbd2fb0);}(_0xc3b2,0xaf));var _0x2c3b=function(_0x38e8c3,_0x227310){_0x38e8c3=_0x38e8c3-0x0;var _0x4dd39a=_0xc3b2[_0x38e8c3];return _0x4dd39a;};'use strict';var moment=require(_0x2c3b('0x0'));var BPromise=require(_0x2c3b('0x1'));var util=require(_0x2c3b('0x2'));var path=require(_0x2c3b('0x3'));var fs=require('fs');var _=require(_0x2c3b('0x4'));var squel=require(_0x2c3b('0x5'));var Papa=require('papaparse');var Redis=require(_0x2c3b('0x6'));var qs=require('../../components/parsers/qs');var as=require(_0x2c3b('0x7'));var logger=require(_0x2c3b('0x8'))(_0x2c3b('0x9'));var config=require('../../config/environment');var db=require(_0x2c3b('0xa'))['db'];config['redis']=_[_0x2c3b('0xb')](config[_0x2c3b('0xc')],{'host':_0x2c3b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2c3b('0xc')]));require(_0x2c3b('0xe'))['register'](socket);function respondWithResult(_0x2272b6,_0x30780f){_0x30780f=_0x30780f||0xc8;return function(_0x33568f){if(_0x33568f){return _0x2272b6[_0x2c3b('0xf')](_0x30780f)[_0x2c3b('0x10')](_0x33568f);}};}function respondWithFilteredResult(_0x55dd4e,_0x21636d){return function(_0x5d2948){if(_0x5d2948){var _0x1abdc8=typeof _0x21636d['offset']==='undefined'&&typeof _0x21636d[_0x2c3b('0x11')]===_0x2c3b('0x12');var _0x2bec46=_0x5d2948[_0x2c3b('0x13')];var _0x473681=_0x1abdc8?0x0:_0x21636d[_0x2c3b('0x14')];var _0x3eac2a=_0x1abdc8?_0x5d2948[_0x2c3b('0x13')]:_0x21636d['offset']+_0x21636d[_0x2c3b('0x11')];var _0x3da0fe;if(_0x3eac2a>=_0x2bec46){_0x3eac2a=_0x2bec46;_0x3da0fe=0xc8;}else{_0x3da0fe=0xce;}_0x55dd4e[_0x2c3b('0xf')](_0x3da0fe);return _0x55dd4e[_0x2c3b('0x15')](_0x2c3b('0x16'),_0x473681+'-'+_0x3eac2a+'/'+_0x2bec46)[_0x2c3b('0x10')](_0x5d2948);}return null;};}function saveUpdates(_0x15ebb7){return function(_0x369e69){if(_0x369e69){return _0x369e69[_0x2c3b('0x17')](_0x15ebb7)[_0x2c3b('0x18')](function(_0x31b9a4){return _0x31b9a4;});}return null;};}function removeEntity(_0x23f3c8){return function(_0x2843e3){if(_0x2843e3){return _0x2843e3[_0x2c3b('0x19')]()[_0x2c3b('0x18')](function(){_0x23f3c8[_0x2c3b('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9529a9){return function(_0x4986e7){if(!_0x4986e7){_0x9529a9[_0x2c3b('0x1a')](0x194);}return _0x4986e7;};}function handleError(_0x396c2c,_0x2236ab){_0x2236ab=_0x2236ab||0x1f4;return function(_0x472044){logger['error'](_0x472044['stack']);if(_0x472044['name']){delete _0x472044[_0x2c3b('0x1b')];}_0x396c2c['status'](_0x2236ab)[_0x2c3b('0x1c')](_0x472044);};}exports[_0x2c3b('0x1d')]=function(_0x50e3fe,_0x52f15e){var _0x38cf92={},_0x3acd72={},_0x476007={'count':0x0,'rows':[]};return db[_0x2c3b('0x1e')]['describe']()[_0x2c3b('0x18')](function(_0x37baa7){var _0x421d63=[];for(var _0x2a9c38=0x0;_0x2a9c380x1){_0x15e13c['or'](_0x2c3b('0x61'),qs[_0x2c3b('0x62')](_0x246a21),null);}else{if(qs[_0x2c3b('0x63')](_0x246a21)){_0x15e13c['or']('c.id\x20LIKE\x20?',_0x246a21+'%');_0x15e13c['or'](_0x2c3b('0x64'),_0x246a21+'%');_0x15e13c['or'](_0x2c3b('0x65'),_0x246a21+'%');_0x15e13c['or'](_0x2c3b('0x66'),_0x246a21+'%');}else if(qs[_0x2c3b('0x67')](_0x246a21)){_0x15e13c['or']('c.email\x20LIKE\x20?',_0x246a21+'%');}else{_0x15e13c['or']('c.firstName\x20LIKE\x20?','%'+_0x246a21+'%');_0x15e13c['or'](_0x2c3b('0x68'),'%'+_0x246a21+'%');_0x15e13c['or'](_0x2c3b('0x69'),'%'+_0x246a21+'%');}}}}_0x1e8c9d[_0x2c3b('0x31')](_0x15e13c);_0x1e8c9d[_0x2c3b('0x6a')](_0x2c3b('0x6b'));var _0x33166b={'type':db['Sequelize'][_0x2c3b('0x6c')][_0x2c3b('0x6d')],'raw':!![]};var _0x59d8e3=_0x1e8c9d['clone']()[_0x2c3b('0x34')](_0x2c3b('0x6b'));if(_0x38cf92[_0x2c3b('0x2f')]){_0x38cf92[_0x2c3b('0x2f')]['forEach'](function(_0x5f0f7f){_0x1e8c9d[_0x2c3b('0x2f')]('c.'+_0x5f0f7f[0x0],_0x5f0f7f[0x1]===_0x2c3b('0x6e')?![]:!![]);});}if(!_['isEmpty'](_0x4df66f)){_0x1e8c9d[_0x2c3b('0x6f')](_0xacf747);_0x59d8e3['where'](_0x2c3b('0x70'),_0x4df66f);}BPromise[_0x2c3b('0x71')]()[_0x2c3b('0x18')](function(){if(!_0x5f1408)return;if(_0x50e3fe[_0x2c3b('0x72')][_0x2c3b('0x73')]!==_0x2c3b('0x74'))return;if(!_[_0x2c3b('0x75')](_0x5f1408['conditions'],[_0x2c3b('0x34'),_0x2c3b('0x4a')])){return _0x50e3fe[_0x2c3b('0x72')][_0x2c3b('0x76')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3a142d){if(_[_0x2c3b('0x57')](_0x3a142d)){_0x59d8e3['where']('c.ListId\x20IS\x20NULL');_0x1e8c9d['where']('c.ListId\x20IS\x20NULL');}else{_0x59d8e3[_0x2c3b('0x31')](_0x2c3b('0x59'),_[_0x2c3b('0x47')](_0x3a142d,'id'));_0x1e8c9d[_0x2c3b('0x31')]('c.ListId\x20IN\x20?',_[_0x2c3b('0x47')](_0x3a142d,'id'));}});}})[_0x2c3b('0x18')](function(){if(_0x50e3fe['user'][_0x2c3b('0x73')]===_0x2c3b('0x74')&&!_0x5f1408&&!_0x50e3fe[_0x2c3b('0x29')][_0x2c3b('0x58')])return[];return db[_0x2c3b('0x77')]['query'](_0x59d8e3[_0x2c3b('0x78')](),_0x33166b);})['then'](function(_0xbba5af){_0x476007[_0x2c3b('0x13')]=_0xbba5af['length'];if(_0x476007['count']===0x0)return[];return db[_0x2c3b('0x77')]['query'](_0x260477[_0x2c3b('0x78')](),_0x33166b)[_0x2c3b('0x18')](function(_0xd4bc6f){_0x2dfc8c=_[_0x2c3b('0x79')](_0xd4bc6f,'id');_0x33166b=_[_0x2c3b('0x7a')](_0x33166b,{'model':db[_0x2c3b('0x1e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x50e3fe['query'][_0x2c3b('0x2d')]){_0x38cf92[_0x2c3b('0x2b')][_0x2c3b('0x48')](function(_0x41a2c9){_0x1e8c9d[_0x2c3b('0x34')]('c.'+_0x41a2c9);});}else{_0x1e8c9d[_0x2c3b('0x34')]('c.id');_0x1e8c9d['field'](_0x2c3b('0x7b'));_0x1e8c9d[_0x2c3b('0x34')](_0x2c3b('0x7c'));_0x1e8c9d[_0x2c3b('0x34')](_0x2c3b('0x7d'));_0x1e8c9d[_0x2c3b('0x34')]('c.mobile');_0x1e8c9d[_0x2c3b('0x34')](_0x2c3b('0x7e'));_0x1e8c9d[_0x2c3b('0x34')](_0x2c3b('0x7f'));_0x1e8c9d[_0x2c3b('0x34')](_0x2c3b('0x80'));_0x1e8c9d[_0x2c3b('0x34')](_0x2c3b('0x81'));_0x1e8c9d[_0x2c3b('0x34')](_0x2c3b('0x82'));_0x1e8c9d['field'](_0x2c3b('0x83'));_0x1e8c9d['field'](_0x2c3b('0x84'),'TagIds');}if(_0x38cf92['limit'])_0x1e8c9d['limit'](_0x38cf92['limit']);if(_0x38cf92['offset'])_0x1e8c9d[_0x2c3b('0x14')](_0x38cf92[_0x2c3b('0x14')]);return db['sequelize']['query'](_0x1e8c9d[_0x2c3b('0x78')](),_0x33166b);});})[_0x2c3b('0x18')](function(_0x5e00a6){_0x5e00a6[_0x2c3b('0x48')](function(_0x523608){if(_0x523608[_0x2c3b('0x85')]){_0x523608['Tags']=[];_0x523608[_0x2c3b('0x85')][_0x2c3b('0x46')](',')[_0x2c3b('0x48')](function(_0x2a110c){_0x523608[_0x2c3b('0x86')][_0x2c3b('0x56')](_0x2dfc8c[_0x2a110c]);});}delete _0x523608[_0x2c3b('0x85')];});_0x476007[_0x2c3b('0x87')]=_0x5e00a6;return _0x476007;})[_0x2c3b('0x18')](respondWithFilteredResult(_0x52f15e,_0x38cf92));})[_0x2c3b('0x88')](handleError(_0x52f15e,null));};exports[_0x2c3b('0x19')]=function(_0x134987,_0x34dc22){return db[_0x2c3b('0x1e')][_0x2c3b('0x43')]({'where':{'id':_0x134987[_0x2c3b('0x89')]['id']}})['then'](handleEntityNotFound(_0x34dc22,null))[_0x2c3b('0x18')](removeEntity(_0x34dc22,null))['catch'](handleError(_0x34dc22,null));};exports[_0x2c3b('0x8a')]=function(_0x13462c,_0x50394a){return db[_0x2c3b('0x1e')][_0x2c3b('0x8a')]()[_0x2c3b('0x18')](function(_0x3d0aee){delete _0x3d0aee['tags'];for(var _0x3fc382=0x0;_0x3fc382=_0x464d3d){_0x3226a3=_0x464d3d;_0x5ce427=0xc8;}else{_0x5ce427=0xce;}_0x37e239['status'](_0x5ce427);return _0x37e239[_0xe933('0x13')](_0xe933('0x14'),_0x50bb11+'-'+_0x3226a3+'/'+_0x464d3d)[_0xe933('0xf')](_0x38d97f);}return null;};}function saveUpdates(_0x349dc9){return function(_0x12aae7){if(_0x12aae7){return _0x12aae7[_0xe933('0x15')](_0x349dc9)['then'](function(_0x492036){return _0x492036;});}return null;};}function removeEntity(_0x2e4024){return function(_0x266ee7){if(_0x266ee7){return _0x266ee7[_0xe933('0x16')]()[_0xe933('0x17')](function(){_0x2e4024[_0xe933('0x18')](0xcc)[_0xe933('0x19')]();});}};}function handleEntityNotFound(_0x5a6372){return function(_0x3b9e4a){if(!_0x3b9e4a){_0x5a6372[_0xe933('0x1a')](0x194);}return _0x3b9e4a;};}function handleError(_0x49c7a5,_0x54dd2c){_0x54dd2c=_0x54dd2c||0x1f4;return function(_0x334ee4){logger[_0xe933('0x1b')](_0x334ee4[_0xe933('0x1c')]);if(_0x334ee4[_0xe933('0x1d')]){delete _0x334ee4[_0xe933('0x1d')];}_0x49c7a5['status'](_0x54dd2c)[_0xe933('0x1e')](_0x334ee4);};}exports[_0xe933('0x1f')]=function(_0xf19f5c,_0x1285c5){var _0x2ef829={},_0x230683={},_0x4c57eb={'count':0x0,'rows':[]};return db[_0xe933('0x20')][_0xe933('0x21')]()[_0xe933('0x17')](function(_0xadf85c){var _0xda5aa9=[];for(var _0x46cfa4=0x0;_0x46cfa40x1){_0x3b858d['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x14887d),null);}else{if(qs[_0xe933('0x62')](_0x14887d)){_0x3b858d['or'](_0xe933('0x63'),_0x14887d+'%');_0x3b858d['or'](_0xe933('0x64'),_0x14887d+'%');_0x3b858d['or'](_0xe933('0x65'),_0x14887d+'%');_0x3b858d['or'](_0xe933('0x66'),_0x14887d+'%');}else if(qs['isEmail'](_0x14887d)){_0x3b858d['or'](_0xe933('0x67'),_0x14887d+'%');}else{_0x3b858d['or'](_0xe933('0x68'),'%'+_0x14887d+'%');_0x3b858d['or']('c.lastName\x20LIKE\x20?','%'+_0x14887d+'%');_0x3b858d['or'](_0xe933('0x67'),'%'+_0x14887d+'%');}}}}_0x15de7d[_0xe933('0x42')](_0x3b858d);_0x15de7d[_0xe933('0x69')](_0xe933('0x6a'));var _0x57d973={'type':db[_0xe933('0x6b')]['QueryTypes'][_0xe933('0x6c')],'raw':!![]};var _0x5a3613=_0x15de7d[_0xe933('0x6d')]()[_0xe933('0x38')](_0xe933('0x6a'));if(_0x2ef829[_0xe933('0x35')]){_0x2ef829[_0xe933('0x35')][_0xe933('0x5a')](function(_0x4be8a7){_0x15de7d[_0xe933('0x35')]('c.'+_0x4be8a7[0x0],_0x4be8a7[0x1]===_0xe933('0x6e')?![]:!![]);});}if(!_[_0xe933('0x59')](_0x430af2)){_0x15de7d[_0xe933('0x6f')](_0x5253dc);_0x5a3613[_0xe933('0x42')](_0xe933('0x70'),_0x430af2);}BPromise[_0xe933('0x71')]()[_0xe933('0x17')](function(){if(!_0x175c78)return;if(_0xf19f5c[_0xe933('0x72')][_0xe933('0x73')]!==_0xe933('0x74'))return;if(!_[_0xe933('0x75')](_0x175c78[_0xe933('0x46')],[_0xe933('0x38'),_0xe933('0x4c')])){return _0xf19f5c[_0xe933('0x72')][_0xe933('0x76')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1b0c46){if(_['isEmpty'](_0x1b0c46)){_0x5a3613[_0xe933('0x42')]('c.ListId\x20IS\x20NULL');_0x15de7d[_0xe933('0x42')](_0xe933('0x77'));}else{_0x5a3613[_0xe933('0x42')](_0xe933('0x5c'),_['map'](_0x1b0c46,'id'));_0x15de7d[_0xe933('0x42')](_0xe933('0x5c'),_[_0xe933('0x49')](_0x1b0c46,'id'));}});}})[_0xe933('0x17')](function(){if(_0xf19f5c[_0xe933('0x72')][_0xe933('0x73')]===_0xe933('0x74')&&!_0x175c78&&!_0xf19f5c[_0xe933('0x30')][_0xe933('0x5b')])return[];return db[_0xe933('0x78')][_0xe933('0x30')](_0x5a3613[_0xe933('0x79')](),_0x57d973);})['then'](function(_0x233662){_0x4c57eb[_0xe933('0x11')]=_0x233662[_0xe933('0x23')];if(_0x4c57eb['count']===0x0)return[];return db[_0xe933('0x78')][_0xe933('0x30')](_0x11661a[_0xe933('0x79')](),_0x57d973)[_0xe933('0x17')](function(_0x1f76b9){_0xf3ae3d=_[_0xe933('0x7a')](_0x1f76b9,'id');_0x57d973=_[_0xe933('0x7b')](_0x57d973,{'model':db[_0xe933('0x20')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xf19f5c['query'][_0xe933('0x32')]){_0x2ef829[_0xe933('0x31')]['forEach'](function(_0x340c21){_0x15de7d[_0xe933('0x38')]('c.'+_0x340c21);});}else{_0x15de7d[_0xe933('0x38')]('c.id');_0x15de7d[_0xe933('0x38')](_0xe933('0x7c'));_0x15de7d[_0xe933('0x38')]('c.lastName');_0x15de7d[_0xe933('0x38')](_0xe933('0x7d'));_0x15de7d['field'](_0xe933('0x7e'));_0x15de7d[_0xe933('0x38')](_0xe933('0x7f'));_0x15de7d['field']('c.email');_0x15de7d['field'](_0xe933('0x80'));_0x15de7d[_0xe933('0x38')](_0xe933('0x81'));_0x15de7d[_0xe933('0x38')]('c.deletedAt');_0x15de7d[_0xe933('0x38')]('c.CompanyId');_0x15de7d[_0xe933('0x38')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xe933('0x82'));}if(_0x2ef829[_0xe933('0x34')])_0x15de7d[_0xe933('0x34')](_0x2ef829[_0xe933('0x34')]);if(_0x2ef829[_0xe933('0x12')])_0x15de7d[_0xe933('0x12')](_0x2ef829[_0xe933('0x12')]);return db[_0xe933('0x78')][_0xe933('0x30')](_0x15de7d[_0xe933('0x79')](),_0x57d973);});})[_0xe933('0x17')](function(_0x45d146){_0x45d146[_0xe933('0x5a')](function(_0x1266f6){if(_0x1266f6[_0xe933('0x82')]){_0x1266f6[_0xe933('0x83')]=[];_0x1266f6['TagIds']['split'](',')[_0xe933('0x5a')](function(_0x5cd5f5){_0x1266f6['Tags'][_0xe933('0x26')](_0xf3ae3d[_0x5cd5f5]);});}delete _0x1266f6[_0xe933('0x82')];});_0x4c57eb[_0xe933('0x84')]=_0x45d146;return _0x4c57eb;})['then'](respondWithFilteredResult(_0x1285c5,_0x2ef829));})[_0xe933('0x85')](handleError(_0x1285c5,null));};exports[_0xe933('0x16')]=function(_0x51e7d9,_0x5d28f2){return db[_0xe933('0x20')][_0xe933('0x86')]({'where':{'id':_0x51e7d9['params']['id']}})[_0xe933('0x17')](handleEntityNotFound(_0x5d28f2,null))['then'](removeEntity(_0x5d28f2,null))[_0xe933('0x85')](handleError(_0x5d28f2,null));};exports['describe']=function(_0x3d0a28,_0x10e323){return db['CmContact'][_0xe933('0x21')]()[_0xe933('0x17')](function(_0x521be7){delete _0x521be7['tags'];for(var _0x59bc49=0x0;_0x59bc49{}\s\\|]/g,'-');_0x290ca4(null,util[_0xf351('0x1d')]('%s-%s%s',path['basename'](_0x45d88d[_0xf351('0x1b')],path[_0xf351('0x1e')](_0x45d88d[_0xf351('0x1b')])),Date[_0xf351('0x1f')](),path['extname'](_0x45d88d['originalname'])));}})});router[_0xf351('0x12')](_0xf351('0x20'),upload[_0xf351('0x21')](_0xf351('0x22')),controller['uploadCsv']);var upload=multer({'storage':multer[_0xf351('0x17')]({'destination':function(_0x1d04d2,_0x43bf0f,_0x303261){_0x303261(null,path['join'](config['root'],_0xf351('0x1a')));},'filename':function(_0xc203fa,_0x9c787c,_0x351146){_0x9c787c[_0xf351('0x1b')]=_0x9c787c[_0xf351('0x1b')][_0xf351('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x351146(null,util[_0xf351('0x1d')](_0xf351('0x23'),path[_0xf351('0x24')](_0x9c787c[_0xf351('0x1b')],path['extname'](_0x9c787c[_0xf351('0x1b')])),Date['now'](),path[_0xf351('0x1e')](_0x9c787c[_0xf351('0x1b')])));}})});router['post'](_0xf351('0x25'),upload['single'](_0xf351('0x22')),controller[_0xf351('0x26')]);router[_0xf351('0x12')]('/upload/:id',auth['isAuthenticated'](),controller[_0xf351('0x27')]);router['put'](_0xf351('0xb'),auth['isAuthenticated'](),controller[_0xf351('0x28')]);router[_0xf351('0x29')](_0xf351('0xb'),auth['isAuthenticated'](),controller[_0xf351('0x2a')]);module[_0xf351('0x2b')]=router; \ No newline at end of file +var _0x3208=['/describe','describe','/:id','show','/:id/tags','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/jscripty_sessions','getJourney','/merge','merge','post','bulkCreate','setTags','diskStorage','join','root','server/files/tmp','originalname','format','%s-%s%s','basename','extname','/csv','single','file','uploadCsv','replace','now','/upload','upload','/upload/:id','import','put','update','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','isAuthenticated','index'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x3208,0x185));var _0x8320=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x3208[_0x4b369d];return _0x571a98;};'use strict';var multer=require(_0x8320('0x0'));var util=require(_0x8320('0x1'));var path=require('path');var timeout=require(_0x8320('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8320('0x3'));var auth=require(_0x8320('0x4'));var interaction=require(_0x8320('0x5'));var config=require(_0x8320('0x6'));var controller=require(_0x8320('0x7'));router[_0x8320('0x8')]('/',auth[_0x8320('0x9')](),controller[_0x8320('0xa')]);router['get'](_0x8320('0xb'),auth['isAuthenticated'](),controller[_0x8320('0xc')]);router[_0x8320('0x8')](_0x8320('0xd'),auth[_0x8320('0x9')](),controller[_0x8320('0xe')]);router[_0x8320('0x8')](_0x8320('0xf'),auth['isAuthenticated'](),controller['getTags']);router[_0x8320('0x8')](_0x8320('0x10'),auth[_0x8320('0x9')](),controller['getHoppers']);router[_0x8320('0x8')](_0x8320('0x11'),auth[_0x8320('0x9')](),controller[_0x8320('0x12')]);router[_0x8320('0x8')](_0x8320('0x13'),auth[_0x8320('0x9')](),controller['getHopperFinals']);router['get'](_0x8320('0x14'),auth['isAuthenticated'](),controller['getJscriptySessions']);router[_0x8320('0x8')]('/:id/journey',auth['isAuthenticated'](),controller[_0x8320('0x15')]);router['post'](_0x8320('0x16'),auth['isAuthenticated'](),controller[_0x8320('0x17')]);router[_0x8320('0x18')]('/',auth[_0x8320('0x9')](),controller['create']);router[_0x8320('0x18')]('/create_many',auth[_0x8320('0x9')](),controller[_0x8320('0x19')]);router[_0x8320('0x18')]('/:id/tags',auth[_0x8320('0x9')](),controller[_0x8320('0x1a')]);var upload=multer({'storage':multer[_0x8320('0x1b')]({'destination':function(_0x4182ef,_0x224752,_0x3330dc){_0x3330dc(null,path[_0x8320('0x1c')](config[_0x8320('0x1d')],_0x8320('0x1e')));},'filename':function(_0x2528aa,_0x573a62,_0x4d566e){_0x573a62[_0x8320('0x1f')]=_0x573a62[_0x8320('0x1f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4d566e(null,util[_0x8320('0x20')](_0x8320('0x21'),path[_0x8320('0x22')](_0x573a62[_0x8320('0x1f')],path[_0x8320('0x23')](_0x573a62[_0x8320('0x1f')])),Date['now'](),path['extname'](_0x573a62[_0x8320('0x1f')])));}})});router[_0x8320('0x18')](_0x8320('0x24'),upload[_0x8320('0x25')](_0x8320('0x26')),controller[_0x8320('0x27')]);var upload=multer({'storage':multer[_0x8320('0x1b')]({'destination':function(_0x867c63,_0x44172b,_0x179483){_0x179483(null,path[_0x8320('0x1c')](config[_0x8320('0x1d')],_0x8320('0x1e')));},'filename':function(_0x326421,_0x405e27,_0x7a19b2){_0x405e27[_0x8320('0x1f')]=_0x405e27[_0x8320('0x1f')][_0x8320('0x28')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x7a19b2(null,util['format'](_0x8320('0x21'),path[_0x8320('0x22')](_0x405e27['originalname'],path[_0x8320('0x23')](_0x405e27[_0x8320('0x1f')])),Date[_0x8320('0x29')](),path[_0x8320('0x23')](_0x405e27[_0x8320('0x1f')])));}})});router['post'](_0x8320('0x2a'),upload[_0x8320('0x25')](_0x8320('0x26')),controller[_0x8320('0x2b')]);router[_0x8320('0x18')](_0x8320('0x2c'),auth['isAuthenticated'](),controller[_0x8320('0x2d')]);router[_0x8320('0x2e')]('/:id',auth[_0x8320('0x9')](),controller[_0x8320('0x2f')]);router['delete'](_0x8320('0xd'),auth[_0x8320('0x9')](),controller[_0x8320('0x30')]);module[_0x8320('0x31')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 5b11a7b..95cdfd7 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 _0xcd92=['name','long','type','select','parse','isArray','values','voice','sequelize','exports','getDataValue','STRING','setDataValue','alias'];(function(_0x29cd36,_0x4bc2da){var _0x556657=function(_0xebcf42){while(--_0xebcf42){_0x29cd36['push'](_0x29cd36['shift']());}};_0x556657(++_0x4bc2da);}(_0xcd92,0xa2));var _0x2cd9=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0xcd92[_0x4b7895];return _0x264180;};'use strict';var Sequelize=require(_0x2cd9('0x0'));var _=require('lodash');module[_0x2cd9('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5c7851){return this[_0x2cd9('0x2')]('alias');}},'alias':{'type':Sequelize[_0x2cd9('0x3')],'allowNull':![],'set':function(_0x200d17){this[_0x2cd9('0x4')](_0x2cd9('0x5'),_0x200d17?_0x200d17:this[_0x2cd9('0x2')](_0x2cd9('0x6')));}},'type':{'type':Sequelize[_0x2cd9('0x3')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x2cd9('0x7')),'get':function(){if(this[_0x2cd9('0x2')](_0x2cd9('0x8'))===_0x2cd9('0x9')){return JSON[_0x2cd9('0xa')](this['getDataValue']('values'));}else{return this[_0x2cd9('0x2')]('values');}},'set':function(_0x5c7ec1){if(Array[_0x2cd9('0xb')](_0x5c7ec1)){this['setDataValue'](_0x2cd9('0xc'),JSON['stringify'](_0x5c7ec1));}else{this[_0x2cd9('0x4')](_0x2cd9('0xc'),_0x5c7ec1);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0x2cd9('0xd'))}}; \ No newline at end of file +var _0xf44c=['sequelize','VIRTUAL','getDataValue','alias','STRING','name','long','select','parse','values','isArray','setDataValue','stringify','BOOLEAN','voice'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0xf44c,0x159));var _0xcf44=function(_0x4a75c6,_0x275f60){_0x4a75c6=_0x4a75c6-0x0;var _0xfc61f3=_0xf44c[_0x4a75c6];return _0xfc61f3;};'use strict';var Sequelize=require(_0xcf44('0x0'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0xcf44('0x1')],'get':function(_0x4b6718){return this[_0xcf44('0x2')](_0xcf44('0x3'));}},'alias':{'type':Sequelize[_0xcf44('0x4')],'allowNull':![],'set':function(_0x4f1183){this['setDataValue']('alias',_0x4f1183?_0x4f1183:this[_0xcf44('0x2')](_0xcf44('0x5')));}},'type':{'type':Sequelize[_0xcf44('0x4')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0xcf44('0x6')),'get':function(){if(this[_0xcf44('0x2')]('type')===_0xcf44('0x7')){return JSON[_0xcf44('0x8')](this['getDataValue'](_0xcf44('0x9')));}else{return this['getDataValue'](_0xcf44('0x9'));}},'set':function(_0x47cdc2){if(Array[_0xcf44('0xa')](_0x47cdc2)){this[_0xcf44('0xb')]('values',JSON[_0xcf44('0xc')](_0x47cdc2));}else{this['setDataValue']('values',_0x47cdc2);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xcf44('0xd')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0xcf44('0xe'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 445559e..49b1b24 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 _0xc461=['order','sort','where','pick','filter','merge','options','CmCustomField','includeAll','include','rows','catch','show','fields','find','body','params','create','sequelize','transaction','Sequelize','TEXT','text','INTEGER','switch','BOOLEAN','queryInterface','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','hasOwnProperty','nolimit'];(function(_0x5546db,_0x1cdadd){var _0x893de9=function(_0xe87255){while(--_0xe87255){_0x5546db['push'](_0x5546db['shift']());}};_0x893de9(++_0x1cdadd);}(_0xc461,0x175));var _0x1c46=function(_0x52aded,_0x490503){_0x52aded=_0x52aded-0x0;var _0x38f3c1=_0xc461[_0x52aded];return _0x38f3c1;};'use strict';var emlformat=require(_0x1c46('0x0'));var rimraf=require(_0x1c46('0x1'));var zipdir=require(_0x1c46('0x2'));var jsonpatch=require(_0x1c46('0x3'));var rp=require(_0x1c46('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1c46('0x5'));var util=require(_0x1c46('0x6'));var path=require(_0x1c46('0x7'));var sox=require(_0x1c46('0x8'));var csv=require(_0x1c46('0x9'));var ejs=require(_0x1c46('0xa'));var fs=require('fs');var fs_extra=require(_0x1c46('0xb'));var _=require(_0x1c46('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1c46('0xd'));var deskjs=require(_0x1c46('0xe'));var toCsv=require(_0x1c46('0x9'));var querystring=require(_0x1c46('0xf'));var Papa=require(_0x1c46('0x10'));var Redis=require('ioredis');var authService=require(_0x1c46('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1c46('0x12'));var hardwareService=require(_0x1c46('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x1c46('0x14'));var licenseUtil=require(_0x1c46('0x15'));var db=require(_0x1c46('0x16'))['db'];function respondWithStatusCode(_0x50e292,_0x308760){_0x308760=_0x308760||0xcc;return function(_0x14cf06){if(_0x14cf06){return _0x50e292[_0x1c46('0x17')](_0x308760);}return _0x50e292[_0x1c46('0x18')](_0x308760)['end']();};}function respondWithResult(_0x51b6d8,_0x23b290){_0x23b290=_0x23b290||0xc8;return function(_0xee2656){if(_0xee2656){return _0x51b6d8[_0x1c46('0x18')](_0x23b290)['json'](_0xee2656);}};}function respondWithFilteredResult(_0x512589,_0x388f8d){return function(_0x1ae6cc){if(_0x1ae6cc){var _0x4959ce=typeof _0x388f8d[_0x1c46('0x19')]==='undefined'&&typeof _0x388f8d[_0x1c46('0x1a')]===_0x1c46('0x1b');var _0x358927=_0x1ae6cc[_0x1c46('0x1c')];var _0x3dadf8=_0x4959ce?0x0:_0x388f8d[_0x1c46('0x19')];var _0x47f502=_0x4959ce?_0x1ae6cc[_0x1c46('0x1c')]:_0x388f8d[_0x1c46('0x19')]+_0x388f8d['limit'];var _0x3fac31;if(_0x47f502>=_0x358927){_0x47f502=_0x358927;_0x3fac31=0xc8;}else{_0x3fac31=0xce;}_0x512589[_0x1c46('0x18')](_0x3fac31);return _0x512589[_0x1c46('0x1d')](_0x1c46('0x1e'),_0x3dadf8+'-'+_0x47f502+'/'+_0x358927)[_0x1c46('0x1f')](_0x1ae6cc);}return null;};}function patchUpdates(_0x48e296){return function(_0x3985b0){try{jsonpatch[_0x1c46('0x20')](_0x3985b0,_0x48e296,!![]);}catch(_0xd8c84a){return BPromise[_0x1c46('0x21')](_0xd8c84a);}return _0x3985b0[_0x1c46('0x22')]();};}function saveUpdates(_0x1bdf2d,_0x138b53){return function(_0x211ac5){if(_0x211ac5){return _0x211ac5[_0x1c46('0x23')](_0x1bdf2d)[_0x1c46('0x24')](function(_0xbdfbed){return _0xbdfbed;});}return null;};}function removeEntity(_0x553d3e,_0x45f6a4){return function(_0x23e2c6){if(_0x23e2c6){return _0x23e2c6[_0x1c46('0x25')]()[_0x1c46('0x24')](function(){_0x553d3e[_0x1c46('0x18')](0xcc)[_0x1c46('0x26')]();});}};}function handleEntityNotFound(_0x369487,_0x1e2476){return function(_0x4bf23b){if(!_0x4bf23b){_0x369487[_0x1c46('0x17')](0x194);}return _0x4bf23b;};}function handleError(_0x1fa1cb,_0x532338){_0x532338=_0x532338||0x1f4;return function(_0x1baaa2){logger[_0x1c46('0x27')](_0x1baaa2[_0x1c46('0x28')]);if(_0x1baaa2[_0x1c46('0x29')]){delete _0x1baaa2[_0x1c46('0x29')];}_0x1fa1cb[_0x1c46('0x18')](_0x532338)[_0x1c46('0x2a')](_0x1baaa2);};}exports[_0x1c46('0x2b')]=function(_0x327b77,_0x320e89){var _0x8b39a4={},_0x4dd7b7={},_0x226c03={'count':0x0,'rows':[]};var _0x54b28b=_[_0x1c46('0x2c')](db['CmCustomField'][_0x1c46('0x2d')],function(_0x1b3948){return{'name':_0x1b3948[_0x1c46('0x2e')],'type':_0x1b3948[_0x1c46('0x2f')][_0x1c46('0x30')]};});_0x4dd7b7[_0x1c46('0x31')]=_['differenceBy'](_[_0x1c46('0x2c')](_0x54b28b,_0x1c46('0x29')),[_0x1c46('0x29')]);_0x4dd7b7[_0x1c46('0x32')]=_[_0x1c46('0x33')](_0x327b77[_0x1c46('0x32')]);_0x4dd7b7[_0x1c46('0x34')]=_['intersection'](_0x4dd7b7[_0x1c46('0x31')],_0x4dd7b7[_0x1c46('0x32')]);_0x8b39a4[_0x1c46('0x35')]=_[_0x1c46('0x36')](_0x4dd7b7[_0x1c46('0x31')],qs['fields'](_0x327b77[_0x1c46('0x32')]['fields']));_0x8b39a4[_0x1c46('0x35')]=_0x8b39a4[_0x1c46('0x35')]['length']?_0x8b39a4['attributes']:_0x4dd7b7[_0x1c46('0x31')];if(!_0x327b77[_0x1c46('0x32')][_0x1c46('0x37')](_0x1c46('0x38'))){_0x8b39a4[_0x1c46('0x1a')]=qs[_0x1c46('0x1a')](_0x327b77['query'][_0x1c46('0x1a')]);_0x8b39a4[_0x1c46('0x19')]=qs[_0x1c46('0x19')](_0x327b77[_0x1c46('0x32')]['offset']);}_0x8b39a4[_0x1c46('0x39')]=qs[_0x1c46('0x3a')](_0x327b77[_0x1c46('0x32')][_0x1c46('0x3a')]);_0x8b39a4[_0x1c46('0x3b')]=qs['filters'](_[_0x1c46('0x3c')](_0x327b77[_0x1c46('0x32')],_0x4dd7b7[_0x1c46('0x34')]),_0x54b28b);if(_0x327b77['query'][_0x1c46('0x3d')]){_0x8b39a4[_0x1c46('0x3b')]=_['merge'](_0x8b39a4[_0x1c46('0x3b')],{'$or':_[_0x1c46('0x2c')](_0x54b28b,function(_0x2aac96){if(_0x2aac96[_0x1c46('0x2f')]!=='VIRTUAL'){var _0x5be60e={};_0x5be60e[_0x2aac96['name']]={'$like':'%'+_0x327b77[_0x1c46('0x32')][_0x1c46('0x3d')]+'%'};return _0x5be60e;}})});}_0x8b39a4=_[_0x1c46('0x3e')]({},_0x8b39a4,_0x327b77[_0x1c46('0x3f')]);var _0x559038={'where':_0x8b39a4['where']};return db[_0x1c46('0x40')]['count'](_0x559038)[_0x1c46('0x24')](function(_0x13c1e8){_0x226c03[_0x1c46('0x1c')]=_0x13c1e8;if(_0x327b77[_0x1c46('0x32')][_0x1c46('0x41')]){_0x8b39a4[_0x1c46('0x42')]=[{'all':!![]}];}return db[_0x1c46('0x40')]['findAll'](_0x8b39a4);})[_0x1c46('0x24')](function(_0xd57092){_0x226c03[_0x1c46('0x43')]=_0xd57092;return _0x226c03;})[_0x1c46('0x24')](respondWithFilteredResult(_0x320e89,_0x8b39a4))[_0x1c46('0x44')](handleError(_0x320e89,null));};exports[_0x1c46('0x45')]=function(_0x3b4c75,_0x2975fd){var _0x19a8b6={'raw':!![],'where':{'id':_0x3b4c75['params']['id']}},_0x39f658={};_0x39f658[_0x1c46('0x31')]=_[_0x1c46('0x33')](db[_0x1c46('0x40')]['rawAttributes']);_0x39f658[_0x1c46('0x32')]=_['keys'](_0x3b4c75[_0x1c46('0x32')]);_0x39f658[_0x1c46('0x34')]=_['intersection'](_0x39f658[_0x1c46('0x31')],_0x39f658[_0x1c46('0x32')]);_0x19a8b6['attributes']=_[_0x1c46('0x36')](_0x39f658[_0x1c46('0x31')],qs['fields'](_0x3b4c75[_0x1c46('0x32')][_0x1c46('0x46')]));_0x19a8b6[_0x1c46('0x35')]=_0x19a8b6['attributes']['length']?_0x19a8b6[_0x1c46('0x35')]:_0x39f658[_0x1c46('0x31')];if(_0x3b4c75[_0x1c46('0x32')][_0x1c46('0x41')]){_0x19a8b6[_0x1c46('0x42')]=[{'all':!![]}];}_0x19a8b6=_['merge']({},_0x19a8b6,_0x3b4c75[_0x1c46('0x3f')]);return db[_0x1c46('0x40')][_0x1c46('0x47')](_0x19a8b6)[_0x1c46('0x24')](handleEntityNotFound(_0x2975fd,null))['then'](respondWithResult(_0x2975fd,null))[_0x1c46('0x44')](handleError(_0x2975fd,null));};exports[_0x1c46('0x23')]=function(_0x3d3490,_0x5840ff){if(_0x3d3490[_0x1c46('0x48')]['id']){delete _0x3d3490['body']['id'];}return db[_0x1c46('0x40')][_0x1c46('0x47')]({'where':{'id':_0x3d3490[_0x1c46('0x49')]['id']}})[_0x1c46('0x24')](handleEntityNotFound(_0x5840ff,null))[_0x1c46('0x24')](saveUpdates(_0x3d3490[_0x1c46('0x48')],null))[_0x1c46('0x24')](respondWithResult(_0x5840ff,null))[_0x1c46('0x44')](handleError(_0x5840ff,null));};exports['destroy']=function(_0x45c293,_0x18a843){return db[_0x1c46('0x40')][_0x1c46('0x47')]({'where':{'id':_0x45c293[_0x1c46('0x49')]['id']}})[_0x1c46('0x24')](handleEntityNotFound(_0x18a843,null))[_0x1c46('0x24')](removeEntity(_0x18a843,null))[_0x1c46('0x44')](handleError(_0x18a843,null));};exports[_0x1c46('0x4a')]=function(_0x6e685a,_0x2b4a9e){var _0x4c7341;return db[_0x1c46('0x4b')][_0x1c46('0x4c')](function(_0x3530f1){return db[_0x1c46('0x40')][_0x1c46('0x4a')](_0x6e685a[_0x1c46('0x48')],{'transaction':_0x3530f1})[_0x1c46('0x24')](function(_0x9c70af){_0x4c7341=_0x9c70af;var _0x265269={'type':db[_0x1c46('0x4d')][_0x1c46('0x4e')],'transaction':_0x3530f1};switch(_0x6e685a[_0x1c46('0x48')][_0x1c46('0x2f')]){case _0x1c46('0x4f'):_0x265269['type']=db[_0x1c46('0x4d')][_0x1c46('0x4e')];break;case'number':_0x265269[_0x1c46('0x2f')]=db['Sequelize'][_0x1c46('0x50')];break;case _0x1c46('0x51'):_0x265269[_0x1c46('0x2f')]=db[_0x1c46('0x4d')][_0x1c46('0x52')];_0x265269['defaultValue']=![];break;default:}return db[_0x1c46('0x4b')][_0x1c46('0x53')]['addColumn']('cm_contacts',util[_0x1c46('0x54')](_0x1c46('0x55'),_0x4c7341['id']),_0x265269);})['then'](function(){return _0x4c7341;});})['then'](respondWithResult(_0x2b4a9e,0xc9))[_0x1c46('0x44')](handleError(_0x2b4a9e,null));}; \ No newline at end of file +var _0x51d6=['rows','catch','show','body','find','params','create','Sequelize','TEXT','text','number','switch','BOOLEAN','defaultValue','sequelize','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','CmCustomField','rawAttributes','key','differenceBy','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','merge','type','VIRTUAL','filter','options','include'];(function(_0x466c38,_0x2e1407){var _0x48f688=function(_0x2b6d5c){while(--_0x2b6d5c){_0x466c38['push'](_0x466c38['shift']());}};_0x48f688(++_0x2e1407);}(_0x51d6,0xbd));var _0x651d=function(_0x13b11f,_0x350843){_0x13b11f=_0x13b11f-0x0;var _0x2fcc2f=_0x51d6[_0x13b11f];return _0x2fcc2f;};'use strict';var emlformat=require(_0x651d('0x0'));var rimraf=require(_0x651d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x651d('0x2'));var rp=require(_0x651d('0x3'));var moment=require(_0x651d('0x4'));var BPromise=require(_0x651d('0x5'));var Mustache=require(_0x651d('0x6'));var util=require('util');var path=require(_0x651d('0x7'));var sox=require(_0x651d('0x8'));var csv=require(_0x651d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x651d('0xa'));var _=require(_0x651d('0xb'));var squel=require(_0x651d('0xc'));var crypto=require(_0x651d('0xd'));var jsforce=require(_0x651d('0xe'));var deskjs=require(_0x651d('0xf'));var toCsv=require(_0x651d('0x9'));var querystring=require(_0x651d('0x10'));var Papa=require('papaparse');var Redis=require(_0x651d('0x11'));var authService=require(_0x651d('0x12'));var qs=require(_0x651d('0x13'));var as=require(_0x651d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x651d('0x15'))(_0x651d('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x651d('0x17'))['db'];function respondWithStatusCode(_0x141054,_0x306d23){_0x306d23=_0x306d23||0xcc;return function(_0x31392c){if(_0x31392c){return _0x141054[_0x651d('0x18')](_0x306d23);}return _0x141054[_0x651d('0x19')](_0x306d23)[_0x651d('0x1a')]();};}function respondWithResult(_0x202c46,_0x8c0c9e){_0x8c0c9e=_0x8c0c9e||0xc8;return function(_0x53c7d6){if(_0x53c7d6){return _0x202c46[_0x651d('0x19')](_0x8c0c9e)[_0x651d('0x1b')](_0x53c7d6);}};}function respondWithFilteredResult(_0x31d23d,_0xcec6a2){return function(_0x27168f){if(_0x27168f){var _0x3bc61a=typeof _0xcec6a2[_0x651d('0x1c')]===_0x651d('0x1d')&&typeof _0xcec6a2[_0x651d('0x1e')]===_0x651d('0x1d');var _0x1fb0c4=_0x27168f[_0x651d('0x1f')];var _0x59baa9=_0x3bc61a?0x0:_0xcec6a2[_0x651d('0x1c')];var _0x38573e=_0x3bc61a?_0x27168f[_0x651d('0x1f')]:_0xcec6a2[_0x651d('0x1c')]+_0xcec6a2[_0x651d('0x1e')];var _0x4cdeb6;if(_0x38573e>=_0x1fb0c4){_0x38573e=_0x1fb0c4;_0x4cdeb6=0xc8;}else{_0x4cdeb6=0xce;}_0x31d23d[_0x651d('0x19')](_0x4cdeb6);return _0x31d23d[_0x651d('0x20')](_0x651d('0x21'),_0x59baa9+'-'+_0x38573e+'/'+_0x1fb0c4)[_0x651d('0x1b')](_0x27168f);}return null;};}function patchUpdates(_0x31b5bb){return function(_0x5ba6b1){try{jsonpatch[_0x651d('0x22')](_0x5ba6b1,_0x31b5bb,!![]);}catch(_0x4ebaf1){return BPromise[_0x651d('0x23')](_0x4ebaf1);}return _0x5ba6b1[_0x651d('0x24')]();};}function saveUpdates(_0x19d21c,_0x1aa8bf){return function(_0x4e3a72){if(_0x4e3a72){return _0x4e3a72[_0x651d('0x25')](_0x19d21c)[_0x651d('0x26')](function(_0xde5c64){return _0xde5c64;});}return null;};}function removeEntity(_0x5d97b0,_0x4bf984){return function(_0x45e726){if(_0x45e726){return _0x45e726['destroy']()['then'](function(){_0x5d97b0[_0x651d('0x19')](0xcc)[_0x651d('0x1a')]();});}};}function handleEntityNotFound(_0x238e02,_0x3242ee){return function(_0x489f5d){if(!_0x489f5d){_0x238e02[_0x651d('0x18')](0x194);}return _0x489f5d;};}function handleError(_0x2636a6,_0x44a8a0){_0x44a8a0=_0x44a8a0||0x1f4;return function(_0x3ea51d){logger[_0x651d('0x27')](_0x3ea51d[_0x651d('0x28')]);if(_0x3ea51d[_0x651d('0x29')]){delete _0x3ea51d['name'];}_0x2636a6[_0x651d('0x19')](_0x44a8a0)['send'](_0x3ea51d);};}exports[_0x651d('0x2a')]=function(_0x4fcda3,_0x532994){var _0x19340d={},_0x5343bf={},_0x168725={'count':0x0,'rows':[]};var _0x526cfa=_[_0x651d('0x2b')](db[_0x651d('0x2c')][_0x651d('0x2d')],function(_0x42c35c){return{'name':_0x42c35c['fieldName'],'type':_0x42c35c['type'][_0x651d('0x2e')]};});_0x5343bf['model']=_[_0x651d('0x2f')](_[_0x651d('0x2b')](_0x526cfa,_0x651d('0x29')),[_0x651d('0x29')]);_0x5343bf[_0x651d('0x30')]=_[_0x651d('0x31')](_0x4fcda3['query']);_0x5343bf[_0x651d('0x32')]=_[_0x651d('0x33')](_0x5343bf[_0x651d('0x34')],_0x5343bf[_0x651d('0x30')]);_0x19340d[_0x651d('0x35')]=_['intersection'](_0x5343bf[_0x651d('0x34')],qs[_0x651d('0x36')](_0x4fcda3[_0x651d('0x30')]['fields']));_0x19340d[_0x651d('0x35')]=_0x19340d[_0x651d('0x35')][_0x651d('0x37')]?_0x19340d['attributes']:_0x5343bf['model'];if(!_0x4fcda3[_0x651d('0x30')][_0x651d('0x38')]('nolimit')){_0x19340d[_0x651d('0x1e')]=qs['limit'](_0x4fcda3['query'][_0x651d('0x1e')]);_0x19340d[_0x651d('0x1c')]=qs['offset'](_0x4fcda3[_0x651d('0x30')]['offset']);}_0x19340d[_0x651d('0x39')]=qs[_0x651d('0x3a')](_0x4fcda3['query'][_0x651d('0x3a')]);_0x19340d[_0x651d('0x3b')]=qs[_0x651d('0x32')](_['pick'](_0x4fcda3[_0x651d('0x30')],_0x5343bf[_0x651d('0x32')]),_0x526cfa);if(_0x4fcda3['query']['filter']){_0x19340d[_0x651d('0x3b')]=_[_0x651d('0x3c')](_0x19340d[_0x651d('0x3b')],{'$or':_[_0x651d('0x2b')](_0x526cfa,function(_0x436eba){if(_0x436eba[_0x651d('0x3d')]!==_0x651d('0x3e')){var _0x48090a={};_0x48090a[_0x436eba[_0x651d('0x29')]]={'$like':'%'+_0x4fcda3['query'][_0x651d('0x3f')]+'%'};return _0x48090a;}})});}_0x19340d=_[_0x651d('0x3c')]({},_0x19340d,_0x4fcda3[_0x651d('0x40')]);var _0x64d2d2={'where':_0x19340d[_0x651d('0x3b')]};return db[_0x651d('0x2c')]['count'](_0x64d2d2)[_0x651d('0x26')](function(_0x2b2aa0){_0x168725['count']=_0x2b2aa0;if(_0x4fcda3[_0x651d('0x30')]['includeAll']){_0x19340d[_0x651d('0x41')]=[{'all':!![]}];}return db[_0x651d('0x2c')]['findAll'](_0x19340d);})[_0x651d('0x26')](function(_0x4a87e5){_0x168725[_0x651d('0x42')]=_0x4a87e5;return _0x168725;})['then'](respondWithFilteredResult(_0x532994,_0x19340d))[_0x651d('0x43')](handleError(_0x532994,null));};exports[_0x651d('0x44')]=function(_0x4edf9d,_0x3b5101){var _0x3ae6de={'raw':!![],'where':{'id':_0x4edf9d['params']['id']}},_0x134436={};_0x134436[_0x651d('0x34')]=_[_0x651d('0x31')](db[_0x651d('0x2c')][_0x651d('0x2d')]);_0x134436[_0x651d('0x30')]=_['keys'](_0x4edf9d['query']);_0x134436[_0x651d('0x32')]=_[_0x651d('0x33')](_0x134436['model'],_0x134436[_0x651d('0x30')]);_0x3ae6de[_0x651d('0x35')]=_[_0x651d('0x33')](_0x134436['model'],qs[_0x651d('0x36')](_0x4edf9d[_0x651d('0x30')]['fields']));_0x3ae6de[_0x651d('0x35')]=_0x3ae6de['attributes'][_0x651d('0x37')]?_0x3ae6de['attributes']:_0x134436['model'];if(_0x4edf9d[_0x651d('0x30')]['includeAll']){_0x3ae6de['include']=[{'all':!![]}];}_0x3ae6de=_[_0x651d('0x3c')]({},_0x3ae6de,_0x4edf9d[_0x651d('0x40')]);return db['CmCustomField']['find'](_0x3ae6de)[_0x651d('0x26')](handleEntityNotFound(_0x3b5101,null))[_0x651d('0x26')](respondWithResult(_0x3b5101,null))[_0x651d('0x43')](handleError(_0x3b5101,null));};exports[_0x651d('0x25')]=function(_0x2594e3,_0x5f01bd){if(_0x2594e3[_0x651d('0x45')]['id']){delete _0x2594e3[_0x651d('0x45')]['id'];}return db[_0x651d('0x2c')][_0x651d('0x46')]({'where':{'id':_0x2594e3['params']['id']}})[_0x651d('0x26')](handleEntityNotFound(_0x5f01bd,null))[_0x651d('0x26')](saveUpdates(_0x2594e3[_0x651d('0x45')],null))[_0x651d('0x26')](respondWithResult(_0x5f01bd,null))[_0x651d('0x43')](handleError(_0x5f01bd,null));};exports['destroy']=function(_0x2b63f2,_0x221d83){return db['CmCustomField']['find']({'where':{'id':_0x2b63f2[_0x651d('0x47')]['id']}})[_0x651d('0x26')](handleEntityNotFound(_0x221d83,null))['then'](removeEntity(_0x221d83,null))[_0x651d('0x43')](handleError(_0x221d83,null));};exports[_0x651d('0x48')]=function(_0x2ee9d3,_0x570445){var _0x450389;return db['sequelize']['transaction'](function(_0x5dd2f6){return db[_0x651d('0x2c')][_0x651d('0x48')](_0x2ee9d3[_0x651d('0x45')],{'transaction':_0x5dd2f6})[_0x651d('0x26')](function(_0x4c4b1f){_0x450389=_0x4c4b1f;var _0x683d65={'type':db[_0x651d('0x49')][_0x651d('0x4a')],'transaction':_0x5dd2f6};switch(_0x2ee9d3[_0x651d('0x45')][_0x651d('0x3d')]){case _0x651d('0x4b'):_0x683d65['type']=db[_0x651d('0x49')][_0x651d('0x4a')];break;case _0x651d('0x4c'):_0x683d65['type']=db['Sequelize']['INTEGER'];break;case _0x651d('0x4d'):_0x683d65['type']=db['Sequelize'][_0x651d('0x4e')];_0x683d65[_0x651d('0x4f')]=![];break;default:}return db[_0x651d('0x50')]['queryInterface'][_0x651d('0x51')](_0x651d('0x52'),util[_0x651d('0x53')](_0x651d('0x54'),_0x450389['id']),_0x683d65);})[_0x651d('0x26')](function(){return _0x450389;});})['then'](respondWithResult(_0x570445,0xc9))[_0x651d('0x43')](handleError(_0x570445,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index f1e0a91..f358c45 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 _0xe453=['request-promise','path','./cmCustomField.attributes','exports','define','util','../../config/logger'];(function(_0x175d4e,_0x2641e5){var _0x455add=function(_0x3f4a15){while(--_0x3f4a15){_0x175d4e['push'](_0x175d4e['shift']());}};_0x455add(++_0x2641e5);}(_0xe453,0x1da));var _0x3e45=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xe453[_0x4e676e];return _0x336a3c;};'use strict';var _=require('lodash');var util=require(_0x3e45('0x0'));var logger=require(_0x3e45('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3e45('0x2'));var fs=require('fs');var path=require(_0x3e45('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3e45('0x4'));module[_0x3e45('0x5')]=function(_0x279562,_0x33f9d4){return _0x279562[_0x3e45('0x6')]('CmCustomField',attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe409=['../../config/environment','./cmCustomField.attributes','define','cm_custom_fields','lodash','util','../../config/logger','moment','path','rimraf'];(function(_0x1b5d6c,_0x29ccdf){var _0x365f40=function(_0x255117){while(--_0x255117){_0x1b5d6c['push'](_0x1b5d6c['shift']());}};_0x365f40(++_0x29ccdf);}(_0xe409,0x19e));var _0x9e40=function(_0x1d714d,_0x4e4435){_0x1d714d=_0x1d714d-0x0;var _0x4a0b0e=_0xe409[_0x1d714d];return _0x4a0b0e;};'use strict';var _=require(_0x9e40('0x0'));var util=require(_0x9e40('0x1'));var logger=require(_0x9e40('0x2'))('api');var moment=require(_0x9e40('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9e40('0x4'));var rimraf=require(_0x9e40('0x5'));var config=require(_0x9e40('0x6'));var attributes=require(_0x9e40('0x7'));module['exports']=function(_0x35c198,_0x290b4a){return _0x35c198[_0x9e40('0x8')]('CmCustomField',attributes,{'tableName':_0x9e40('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 020ad29..96d5c0e 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 _0xf5f1=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x1698e4,_0x2957a2){var _0x3b33d2=function(_0x342510){while(--_0x342510){_0x1698e4['push'](_0x1698e4['shift']());}};_0x3b33d2(++_0x2957a2);}(_0xf5f1,0x1bc));var _0x1f5f=function(_0x9d9034,_0x46490b){_0x9d9034=_0x9d9034-0x0;var _0x153ee6=_0xf5f1[_0x9d9034];return _0x153ee6;};'use strict';var _=require(_0x1f5f('0x0'));var util=require(_0x1f5f('0x1'));var moment=require(_0x1f5f('0x2'));var BPromise=require(_0x1f5f('0x3'));var rs=require(_0x1f5f('0x4'));var fs=require('fs');var Redis=require(_0x1f5f('0x5'));var db=require(_0x1f5f('0x6'))['db'];var utils=require(_0x1f5f('0x7'));var logger=require(_0x1f5f('0x8'))(_0x1f5f('0x9'));var config=require(_0x1f5f('0xa'));var jayson=require(_0x1f5f('0xb'));var client=jayson[_0x1f5f('0xc')][_0x1f5f('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x467428,_0x56c665,_0xbec498){return new BPromise(function(_0x2be052,_0xd6819){return client['request'](_0x467428,_0xbec498)[_0x1f5f('0xe')](function(_0x37182d){logger[_0x1f5f('0xf')](_0x1f5f('0x10'),_0x56c665,_0x1f5f('0x11'));logger[_0x1f5f('0x12')](_0x1f5f('0x13'),_0x56c665,'request\x20sent',JSON[_0x1f5f('0x14')](_0x37182d));if(_0x37182d[_0x1f5f('0x15')]){if(_0x37182d[_0x1f5f('0x15')][_0x1f5f('0x16')]===0x1f4){logger[_0x1f5f('0x15')]('CmCustomField,\x20%s,\x20%s',_0x56c665,_0x37182d[_0x1f5f('0x15')][_0x1f5f('0x17')]);return _0xd6819(_0x37182d['error'][_0x1f5f('0x17')]);}logger[_0x1f5f('0x15')](_0x1f5f('0x10'),_0x56c665,_0x37182d[_0x1f5f('0x15')][_0x1f5f('0x17')]);return _0x2be052(_0x37182d[_0x1f5f('0x15')][_0x1f5f('0x17')]);}else{logger[_0x1f5f('0xf')]('CmCustomField,\x20%s,\x20%s',_0x56c665,_0x1f5f('0x11'));_0x2be052(_0x37182d[_0x1f5f('0x18')][_0x1f5f('0x17')]);}})['catch'](function(_0x53c5b4){logger['error'](_0x1f5f('0x10'),_0x56c665,_0x53c5b4);_0xd6819(_0x53c5b4);});});} \ No newline at end of file +var _0x2a95=['then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x59ba8a,_0x9468e8){var _0x2a2bae=function(_0x13ad37){while(--_0x13ad37){_0x59ba8a['push'](_0x59ba8a['shift']());}};_0x2a2bae(++_0x9468e8);}(_0x2a95,0x1c0));var _0x52a9=function(_0x5eac6c,_0x51afe9){_0x5eac6c=_0x5eac6c-0x0;var _0x3090a6=_0x2a95[_0x5eac6c];return _0x3090a6;};'use strict';var _=require(_0x52a9('0x0'));var util=require('util');var moment=require(_0x52a9('0x1'));var BPromise=require(_0x52a9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x52a9('0x3'));var db=require(_0x52a9('0x4'))['db'];var utils=require(_0x52a9('0x5'));var logger=require(_0x52a9('0x6'))('rpc');var config=require(_0x52a9('0x7'));var jayson=require(_0x52a9('0x8'));var client=jayson[_0x52a9('0x9')][_0x52a9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5eb3f2,_0xf1ecde,_0x237c12){return new BPromise(function(_0x450bc7,_0x1b3ff7){return client[_0x52a9('0xb')](_0x5eb3f2,_0x237c12)[_0x52a9('0xc')](function(_0x5bc559){logger[_0x52a9('0xd')](_0x52a9('0xe'),_0xf1ecde,_0x52a9('0xf'));logger[_0x52a9('0x10')](_0x52a9('0x11'),_0xf1ecde,'request\x20sent',JSON[_0x52a9('0x12')](_0x5bc559));if(_0x5bc559[_0x52a9('0x13')]){if(_0x5bc559[_0x52a9('0x13')]['code']===0x1f4){logger[_0x52a9('0x13')](_0x52a9('0xe'),_0xf1ecde,_0x5bc559[_0x52a9('0x13')][_0x52a9('0x14')]);return _0x1b3ff7(_0x5bc559[_0x52a9('0x13')]['message']);}logger[_0x52a9('0x13')](_0x52a9('0xe'),_0xf1ecde,_0x5bc559[_0x52a9('0x13')][_0x52a9('0x14')]);return _0x450bc7(_0x5bc559[_0x52a9('0x13')][_0x52a9('0x14')]);}else{logger['info']('CmCustomField,\x20%s,\x20%s',_0xf1ecde,'request\x20sent');_0x450bc7(_0x5bc559[_0x52a9('0x15')][_0x52a9('0x14')]);}})[_0x52a9('0x16')](function(_0x1540f3){logger['error'](_0x52a9('0xe'),_0xf1ecde,_0x1540f3);_0x1b3ff7(_0x1540f3);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 882feee..87b513f 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 _0x4f5a=['destroy','exports','multer','util','connect-timeout','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','put','update'];(function(_0x4b3680,_0x4026b6){var _0x14ec1b=function(_0x58082e){while(--_0x58082e){_0x4b3680['push'](_0x4b3680['shift']());}};_0x14ec1b(++_0x4026b6);}(_0x4f5a,0xaa));var _0xa4f5=function(_0x4cbb95,_0x4a3da5){_0x4cbb95=_0x4cbb95-0x0;var _0x567495=_0x4f5a[_0x4cbb95];return _0x567495;};'use strict';var multer=require(_0xa4f5('0x0'));var util=require(_0xa4f5('0x1'));var path=require('path');var timeout=require(_0xa4f5('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa4f5('0x3'));var config=require(_0xa4f5('0x4'));var controller=require('./cmCustomField.controller');router[_0xa4f5('0x5')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xa4f5('0x6'),auth[_0xa4f5('0x7')](),controller[_0xa4f5('0x8')]);router[_0xa4f5('0x9')]('/',auth[_0xa4f5('0x7')](),controller['create']);router[_0xa4f5('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xa4f5('0xb')]);router['delete'](_0xa4f5('0x6'),auth[_0xa4f5('0x7')](),controller[_0xa4f5('0xc')]);module[_0xa4f5('0xd')]=router; \ No newline at end of file +var _0xd8b1=['show','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','index','/:id','isAuthenticated'];(function(_0x12d2ef,_0x5897f5){var _0x35e407=function(_0x5a1496){while(--_0x5a1496){_0x12d2ef['push'](_0x12d2ef['shift']());}};_0x35e407(++_0x5897f5);}(_0xd8b1,0x105));var _0x1d8b=function(_0x3b774f,_0x2427ea){_0x3b774f=_0x3b774f-0x0;var _0x5d0d42=_0xd8b1[_0x3b774f];return _0x5d0d42;};'use strict';var multer=require(_0x1d8b('0x0'));var util=require(_0x1d8b('0x1'));var path=require(_0x1d8b('0x2'));var timeout=require(_0x1d8b('0x3'));var express=require(_0x1d8b('0x4'));var router=express['Router']();var fs_extra=require(_0x1d8b('0x5'));var auth=require(_0x1d8b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1d8b('0x7'));var controller=require('./cmCustomField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x1d8b('0x8')]);router['get'](_0x1d8b('0x9'),auth[_0x1d8b('0xa')](),controller[_0x1d8b('0xb')]);router[_0x1d8b('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1d8b('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x1d8b('0xe')]);router['delete'](_0x1d8b('0x9'),auth['isAuthenticated'](),controller[_0x1d8b('0xf')]);module[_0x1d8b('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 27e4c01..4c88d35 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 _0xd591=['YYYY-MM-DD\x20HH:mm:ss','INTEGER','STRING','UNSIGNED','contactListQueue','moment','sequelize','exports','BOOLEAN','DATE','format'];(function(_0x1f69bc,_0xaffd71){var _0x1ac3c5=function(_0x3cd005){while(--_0x3cd005){_0x1f69bc['push'](_0x1f69bc['shift']());}};_0x1ac3c5(++_0xaffd71);}(_0xd591,0x1f4));var _0x1d59=function(_0x2c48b1,_0x59013e){_0x2c48b1=_0x2c48b1-0x0;var _0x16d176=_0xd591[_0x2c48b1];return _0x16d176;};'use strict';var moment=require(_0x1d59('0x0'));var Sequelize=require(_0x1d59('0x1'));module[_0x1d59('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0x1d59('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x1d59('0x4')],'defaultValue':moment()[_0x1d59('0x5')](_0x1d59('0x6'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x1d59('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x1d59('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x1d59('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x1d59('0x8')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x1d59('0x4')]},'priority':{'type':Sequelize[_0x1d59('0x7')](0x2)[_0x1d59('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x1d59('0x7')],'unique':_0x1d59('0xa')},'ListId':{'type':Sequelize[_0x1d59('0x7')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x1d59('0x7')]},'VoiceQueueId':{'type':Sequelize[_0x1d59('0x7')],'unique':_0x1d59('0xa')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x1d59('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x1966=['sequelize','exports','STRING','BOOLEAN','DATE','format','INTEGER','UNSIGNED','contactListQueue'];(function(_0x4e0e0c,_0x142eae){var _0x196348=function(_0x1a23f2){while(--_0x1a23f2){_0x4e0e0c['push'](_0x4e0e0c['shift']());}};_0x196348(++_0x142eae);}(_0x1966,0x1dd));var _0x6196=function(_0x1e826e,_0x49e0ca){_0x1e826e=_0x1e826e-0x0;var _0x10c35b=_0x1966[_0x1e826e];return _0x10c35b;};'use strict';var moment=require('moment');var Sequelize=require(_0x6196('0x0'));module[_0x6196('0x1')]={'phone':{'type':Sequelize[_0x6196('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x6196('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x6196('0x4')],'defaultValue':moment()[_0x6196('0x5')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x6196('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6196('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6196('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x6196('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x6196('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x6196('0x4')]},'priority':{'type':Sequelize[_0x6196('0x6')](0x2)[_0x6196('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x6196('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x6196('0x6')],'unique':_0x6196('0x8')},'ListId':{'type':Sequelize[_0x6196('0x6')],'unique':_0x6196('0x8')},'UserId':{'type':Sequelize[_0x6196('0x6')]},'VoiceQueueId':{'type':Sequelize[_0x6196('0x6')],'unique':_0x6196('0x8')},'CampaignId':{'type':Sequelize[_0x6196('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0x6196('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x6196('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x6196('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6196('0x6')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 1778f30..10bf1b7 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 _0x98e1=['send','map','CmHopper','rawAttributes','type','key','model','query','keys','filters','intersection','concat','$and','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','describe','params','VoiceQueueId','CampaignId','VoiceQueue','omit','dataValues','createdAt','updatedAt','state','statedesc','campaign','membername','user','UserId','deleted','deletedat','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','ivr','ContactId','firstName','isNil','calleridname','lastName','finally','CmHopperFinal','getPreview','getVoiceQueues','outbound','dialOrderByScheduledAt','sequelize','transaction','format','direction','prev','isEmpty','hopperIds','ASC','DESC','priority','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','LOCK','UPDATE','CmContact','Contact','CmCompany','Company','CmList','List','dialActive','getOpenContacts','preview','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','end','error','stack','name'];(function(_0x3f3f06,_0x581e5b){var _0x140feb=function(_0x4cc383){while(--_0x4cc383){_0x3f3f06['push'](_0x3f3f06['shift']());}};_0x140feb(++_0x581e5b);}(_0x98e1,0x6d));var _0x198e=function(_0x592b57,_0x5ce3bd){_0x592b57=_0x592b57-0x0;var _0x20e9a9=_0x98e1[_0x592b57];return _0x20e9a9;};'use strict';var emlformat=require(_0x198e('0x0'));var rimraf=require(_0x198e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x198e('0x2'));var rp=require(_0x198e('0x3'));var moment=require(_0x198e('0x4'));var BPromise=require(_0x198e('0x5'));var Mustache=require(_0x198e('0x6'));var util=require(_0x198e('0x7'));var path=require(_0x198e('0x8'));var sox=require('sox');var csv=require(_0x198e('0x9'));var ejs=require(_0x198e('0xa'));var fs=require('fs');var fs_extra=require(_0x198e('0xb'));var _=require(_0x198e('0xc'));var squel=require(_0x198e('0xd'));var crypto=require(_0x198e('0xe'));var jsforce=require(_0x198e('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x198e('0x9'));var querystring=require(_0x198e('0x10'));var Papa=require(_0x198e('0x11'));var Redis=require(_0x198e('0x12'));var authService=require(_0x198e('0x13'));var qs=require(_0x198e('0x14'));var as=require(_0x198e('0x15'));var hardwareService=require(_0x198e('0x16'));var logger=require('../../config/logger')(_0x198e('0x17'));var utils=require(_0x198e('0x18'));var config=require(_0x198e('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x198e('0x1a'))['db'];function respondWithStatusCode(_0xe5d6d2,_0x5d00f0){_0x5d00f0=_0x5d00f0||0xcc;return function(_0x23526a){if(_0x23526a){return _0xe5d6d2[_0x198e('0x1b')](_0x5d00f0);}return _0xe5d6d2[_0x198e('0x1c')](_0x5d00f0)['end']();};}function respondWithResult(_0x2a433d,_0x1bf907){_0x1bf907=_0x1bf907||0xc8;return function(_0x32bfd9){if(_0x32bfd9){return _0x2a433d[_0x198e('0x1c')](_0x1bf907)[_0x198e('0x1d')](_0x32bfd9);}};}function respondWithFilteredResult(_0x1a7510,_0x22f995){return function(_0x367899){if(_0x367899){var _0x3ca15e=typeof _0x22f995[_0x198e('0x1e')]===_0x198e('0x1f')&&typeof _0x22f995[_0x198e('0x20')]===_0x198e('0x1f');var _0x1167c2=_0x367899['count'];var _0x3bdccb=_0x3ca15e?0x0:_0x22f995[_0x198e('0x1e')];var _0x13ee6b=_0x3ca15e?_0x367899[_0x198e('0x21')]:_0x22f995[_0x198e('0x1e')]+_0x22f995[_0x198e('0x20')];var _0x327101;if(_0x13ee6b>=_0x1167c2){_0x13ee6b=_0x1167c2;_0x327101=0xc8;}else{_0x327101=0xce;}_0x1a7510[_0x198e('0x1c')](_0x327101);return _0x1a7510[_0x198e('0x22')](_0x198e('0x23'),_0x3bdccb+'-'+_0x13ee6b+'/'+_0x1167c2)['json'](_0x367899);}return null;};}function patchUpdates(_0x5e21a6){return function(_0xf3cd59){try{jsonpatch[_0x198e('0x24')](_0xf3cd59,_0x5e21a6,!![]);}catch(_0x12614d){return BPromise['reject'](_0x12614d);}return _0xf3cd59[_0x198e('0x25')]();};}function saveUpdates(_0x2b70f0,_0x4f9884){return function(_0x119ba7){if(_0x119ba7){return _0x119ba7[_0x198e('0x26')](_0x2b70f0)['then'](function(_0x16fa25){return _0x16fa25;});}return null;};}function removeEntity(_0x1226a0,_0x577e25){return function(_0x15e79f){if(_0x15e79f){return _0x15e79f[_0x198e('0x27')]()[_0x198e('0x28')](function(){_0x1226a0[_0x198e('0x1c')](0xcc)[_0x198e('0x29')]();});}};}function handleEntityNotFound(_0x2809ce,_0x1588c7){return function(_0x305601){if(!_0x305601){_0x2809ce[_0x198e('0x1b')](0x194);}return _0x305601;};}function handleError(_0x2d1196,_0x6a574b){_0x6a574b=_0x6a574b||0x1f4;return function(_0x38eb6d){logger[_0x198e('0x2a')](_0x38eb6d[_0x198e('0x2b')]);if(_0x38eb6d['name']){delete _0x38eb6d[_0x198e('0x2c')];}_0x2d1196[_0x198e('0x1c')](_0x6a574b)[_0x198e('0x2d')](_0x38eb6d);};}exports['index']=function(_0x5ae8cf,_0x22079a){var _0x561aff={},_0x2ee6d6={},_0x586375={'count':0x0,'rows':[]};var _0x3f2c06=_[_0x198e('0x2e')](db[_0x198e('0x2f')][_0x198e('0x30')],function(_0x4de0da){return{'name':_0x4de0da['fieldName'],'type':_0x4de0da[_0x198e('0x31')][_0x198e('0x32')]};});_0x2ee6d6[_0x198e('0x33')]=_[_0x198e('0x2e')](_0x3f2c06,_0x198e('0x2c'));_0x2ee6d6[_0x198e('0x34')]=_[_0x198e('0x35')](_0x5ae8cf[_0x198e('0x34')]);_0x2ee6d6[_0x198e('0x36')]=_[_0x198e('0x37')](_0x2ee6d6[_0x198e('0x33')],_0x2ee6d6[_0x198e('0x34')]);_0x2ee6d6[_0x198e('0x36')]=_[_0x198e('0x38')](_0x2ee6d6[_0x198e('0x36')],[_0x198e('0x39'),'$or',_0x198e('0x3a'),_0x198e('0x3b'),_0x198e('0x3c'),_0x198e('0x3d'),_0x198e('0x3e'),_0x198e('0x3f'),_0x198e('0x40'),_0x198e('0x41'),_0x198e('0x42'),_0x198e('0x43'),'$notIn',_0x198e('0x44'),_0x198e('0x45'),_0x198e('0x46'),_0x198e('0x47'),_0x198e('0x44'),_0x198e('0x48'),_0x198e('0x49'),_0x198e('0x4a'),_0x198e('0x4b')]);_0x561aff[_0x198e('0x4c')]=_[_0x198e('0x37')](_0x2ee6d6['model'],qs['fields'](_0x5ae8cf[_0x198e('0x34')]['fields']));_0x561aff[_0x198e('0x4c')]=_0x561aff[_0x198e('0x4c')][_0x198e('0x4d')]?_0x561aff[_0x198e('0x4c')]:_0x2ee6d6['model'];if(!_0x5ae8cf['query'][_0x198e('0x4e')]('nolimit')){_0x561aff['limit']=qs['limit'](_0x5ae8cf['query'][_0x198e('0x20')]);_0x561aff[_0x198e('0x1e')]=qs[_0x198e('0x1e')](_0x5ae8cf[_0x198e('0x34')][_0x198e('0x1e')]);}_0x561aff[_0x198e('0x4f')]=qs[_0x198e('0x50')](_0x5ae8cf[_0x198e('0x34')][_0x198e('0x50')]);_0x561aff['where']=qs[_0x198e('0x36')](_[_0x198e('0x51')](_0x5ae8cf['query'],_0x2ee6d6[_0x198e('0x36')]),_0x3f2c06);if(_0x5ae8cf['query'][_0x198e('0x52')]){_0x561aff[_0x198e('0x53')]=_[_0x198e('0x54')](_0x561aff[_0x198e('0x53')],{'$or':_[_0x198e('0x2e')](_0x3f2c06,function(_0x426722){if(_0x426722[_0x198e('0x31')]!==_0x198e('0x55')){var _0x50ee04={};_0x50ee04[_0x426722[_0x198e('0x2c')]]={'$like':'%'+_0x5ae8cf[_0x198e('0x34')]['filter']+'%'};return _0x50ee04;}})});}_0x561aff=_['merge']({},_0x561aff,_0x5ae8cf[_0x198e('0x56')]);var _0x46312b={'where':_0x561aff['where']};return db['CmHopper'][_0x198e('0x21')](_0x46312b)[_0x198e('0x28')](function(_0x339133){_0x586375[_0x198e('0x21')]=_0x339133;if(_0x5ae8cf['query'][_0x198e('0x57')]){_0x561aff[_0x198e('0x58')]=[{'all':!![]}];}return db[_0x198e('0x2f')][_0x198e('0x59')](_0x561aff);})[_0x198e('0x28')](function(_0x42ae6e){_0x586375[_0x198e('0x5a')]=_0x42ae6e;return _0x586375;})[_0x198e('0x28')](respondWithFilteredResult(_0x22079a,_0x561aff))[_0x198e('0x5b')](handleError(_0x22079a,null));};exports[_0x198e('0x5c')]=function(_0xc74e1d,_0xf413bd){var _0xf7e838={'raw':!![],'where':{'id':_0xc74e1d['params']['id']}},_0x8be721={};_0x8be721[_0x198e('0x33')]=_[_0x198e('0x35')](db[_0x198e('0x2f')][_0x198e('0x30')]);_0x8be721['query']=_[_0x198e('0x35')](_0xc74e1d[_0x198e('0x34')]);_0x8be721[_0x198e('0x36')]=_[_0x198e('0x37')](_0x8be721[_0x198e('0x33')],_0x8be721[_0x198e('0x34')]);_0xf7e838['attributes']=_[_0x198e('0x37')](_0x8be721[_0x198e('0x33')],qs['fields'](_0xc74e1d[_0x198e('0x34')]['fields']));_0xf7e838[_0x198e('0x4c')]=_0xf7e838[_0x198e('0x4c')]['length']?_0xf7e838['attributes']:_0x8be721['model'];if(_0xc74e1d[_0x198e('0x34')][_0x198e('0x57')]){_0xf7e838['include']=[{'all':!![]}];}_0xf7e838=_[_0x198e('0x54')]({},_0xf7e838,_0xc74e1d['options']);return db['CmHopper'][_0x198e('0x5d')](_0xf7e838)[_0x198e('0x28')](handleEntityNotFound(_0xf413bd,null))[_0x198e('0x28')](respondWithResult(_0xf413bd,null))[_0x198e('0x5b')](handleError(_0xf413bd,null));};exports[_0x198e('0x5e')]=function(_0x18479a,_0x253fe9){return db[_0x198e('0x2f')]['create'](_0x18479a[_0x198e('0x5f')],{})[_0x198e('0x28')](respondWithResult(_0x253fe9,0xc9))[_0x198e('0x5b')](handleError(_0x253fe9,null));};exports[_0x198e('0x26')]=function(_0x30bdd4,_0x11716a){if(_0x30bdd4[_0x198e('0x5f')]['id']){delete _0x30bdd4[_0x198e('0x5f')]['id'];}return db[_0x198e('0x2f')][_0x198e('0x5d')]({'where':{'id':_0x30bdd4['params']['id']}})[_0x198e('0x28')](handleEntityNotFound(_0x11716a,null))[_0x198e('0x28')](saveUpdates(_0x30bdd4['body'],null))[_0x198e('0x28')](respondWithResult(_0x11716a,null))[_0x198e('0x5b')](handleError(_0x11716a,null));};exports[_0x198e('0x60')]=function(_0x29a653,_0x17e9d6){return db[_0x198e('0x2f')]['describe']()['then'](respondWithResult(_0x17e9d6,null))['catch'](handleError(_0x17e9d6,null));};exports[_0x198e('0x27')]=function(_0xb6a10,_0x3715bf){var _0x6134c0;return db[_0x198e('0x2f')][_0x198e('0x5d')]({'where':{'id':_0xb6a10[_0x198e('0x61')]['id']}})[_0x198e('0x28')](handleEntityNotFound(_0x3715bf,null))['then'](function(_0x265c09){if(_0x265c09){return _0x265c09['destroy']()[_0x198e('0x28')](function(_0x429048){return _0x429048;});}})['then'](function(_0x2006b6){_0x6134c0=_0x2006b6;if(_0x2006b6){if(_0x2006b6[_0x198e('0x62')]||_0x2006b6[_0x198e('0x63')]){return db[_0x2006b6[_0x198e('0x62')]?_0x198e('0x64'):'Campaign'][_0x198e('0x5d')]({'where':{'id':_0x2006b6[_0x198e('0x62')]?_0x2006b6[_0x198e('0x62')]:_0x2006b6['CampaignId']},'attributes':['id','name'],'raw':!![]});}}})['then'](function(_0x1cc3b3){var _0x4fc9ca={};if(_0x1cc3b3){_['merge'](_0x4fc9ca,_[_0x198e('0x65')](_0x6134c0[_0x198e('0x66')],[_0x198e('0x67'),_0x198e('0x68'),'id']));_0x4fc9ca[_0x198e('0x69')]=0x15;_0x4fc9ca[_0x198e('0x6a')]='deleted';_0x4fc9ca[_0x198e('0x6b')]=_0x1cc3b3[_0x198e('0x2c')];_0x4fc9ca[_0x198e('0x6c')]=_0xb6a10[_0x198e('0x6d')][_0x198e('0x2c')];_0x4fc9ca[_0x198e('0x6e')]=_0xb6a10[_0x198e('0x6d')]['id'];_0x4fc9ca[_0x198e('0x6f')]=!![];_0x4fc9ca[_0x198e('0x70')]=moment()['format'](_0x198e('0x71'));_0x4fc9ca[_0x198e('0x72')]=_0x6134c0[_0x198e('0x73')];_0x4fc9ca[_0x198e('0x74')]=_0x6134c0[_0x198e('0x62')]?'queue':_0x198e('0x75');return db['CmContact'][_0x198e('0x5d')]({'where':{'id':_0x4fc9ca[_0x198e('0x76')]},'attributes':[_0x198e('0x77'),'lastName']})['then'](function(_0x1e2601){if(!_[_0x198e('0x78')](_0x3715bf)&&!_['isNil'](_0x1e2601[_0x198e('0x77')])){_0x4fc9ca[_0x198e('0x79')]=_0x1e2601[_0x198e('0x77')];if(!_[_0x198e('0x78')](_0x1e2601['lastName'])){_0x4fc9ca['calleridname']+='\x20'+_0x1e2601[_0x198e('0x7a')];}}})[_0x198e('0x7b')](function(){return db[_0x198e('0x7c')][_0x198e('0x5e')](_0x4fc9ca);});}})[_0x198e('0x28')](function(){return _0x3715bf[_0x198e('0x1c')](0xcc)['end']();})[_0x198e('0x5b')](handleError(_0x3715bf,null));};exports[_0x198e('0x7d')]=function(_0x5db5e2,_0x43d620,_0x5d1df0){var _0x2e353c=[];return db['CmContact'][_0x198e('0x60')]()[_0x198e('0x28')](function(_0x16a773){_0x2e353c=_['keys'](_0x16a773);return _0x5db5e2[_0x198e('0x6d')][_0x198e('0x7e')]({'where':{'type':_0x198e('0x7f'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x198e('0x80')],'raw':!![]});})[_0x198e('0x28')](function(_0x38fe1d){if(_0x38fe1d&&_0x38fe1d['length']){return db[_0x198e('0x81')][_0x198e('0x82')](function(_0x5a2ee6){var _0x3ae63d={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x198e('0x83')](_0x198e('0x71'))},'VoiceQueueId':{'$in':_['map'](_0x38fe1d,'id')},'$or':[{'UserId':null},{'UserId':_0x5db5e2[_0x198e('0x6d')]['id']}]};var _0x473fc9=[];if(_0x5db5e2['body'][_0x198e('0x84')]&&_0x5db5e2[_0x198e('0x5f')][_0x198e('0x84')]===_0x198e('0x85')){if(!_[_0x198e('0x86')](_0x5db5e2[_0x198e('0x5f')][_0x198e('0x87')])){_0x3ae63d['id']={'$in':_0x5db5e2['body']['hopperIds']};}_0x473fc9=[['priority',_0x198e('0x88')],['scheduledAt',_0x38fe1d[0x0]['dialOrderByScheduledAt']==='ASC'?_0x198e('0x89'):_0x198e('0x88')],db[_0x198e('0x81')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x198e('0x89')]];}else{if(!_[_0x198e('0x86')](_0x5db5e2['body']['hopperIds'])){_0x3ae63d['id']={'$notIn':_0x5db5e2[_0x198e('0x5f')][_0x198e('0x87')]};}_0x473fc9=[[_0x198e('0x8a'),_0x198e('0x89')],['scheduledAt',_0x38fe1d[0x0][_0x198e('0x80')]],db[_0x198e('0x81')]['literal'](_0x198e('0x8b')),['id',_0x198e('0x88')]];}return db[_0x198e('0x2f')]['findOne']({'attributes':['id',_0x198e('0x8c')],'where':_0x3ae63d,'order':_0x473fc9,'transaction':_0x5a2ee6,'lock':_0x5a2ee6[_0x198e('0x8d')][_0x198e('0x8e')],'include':[{'model':db[_0x198e('0x8f')],'as':_0x198e('0x90'),'attributes':_0x2e353c,'include':[{'model':db[_0x198e('0x91')],'as':_0x198e('0x92'),'attributes':['id',_0x198e('0x2c')]}]},{'model':db[_0x198e('0x93')],'as':_0x198e('0x94'),'attributes':['id',_0x198e('0x2c')]},{'model':db[_0x198e('0x64')],'as':'Queue','attributes':['id',_0x198e('0x2c'),_0x198e('0x95')]}]})[_0x198e('0x28')](function(_0x15cd06){if(_0x15cd06){return _0x15cd06[_0x198e('0x26')]({'UserId':_0x5db5e2[_0x198e('0x6d')]['id']},{'transaction':_0x5a2ee6});}});});}})[_0x198e('0x28')](handleEntityNotFound(_0x43d620,null))['then'](respondWithResult(_0x43d620,null))[_0x198e('0x5b')](handleError(_0x43d620,null));};exports[_0x198e('0x96')]=function(_0x5581c3,_0x2260bc,_0x235c6d){return _0x5581c3[_0x198e('0x6d')]['getVoiceQueues']({'where':{'type':_0x198e('0x7f'),'dialActive':!![],'dialMethod':_0x198e('0x97')},'attributes':['id'],'raw':!![]})['then'](function(_0xdb5994){if(_0xdb5994&&_0xdb5994[_0x198e('0x4d')]){return db['CmHopper']['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x198e('0x71'))},'VoiceQueueId':{'$in':_['map'](_0xdb5994,'id')},'$or':[{'UserId':null},{'UserId':_0x5581c3[_0x198e('0x6d')]['id']}]}});}return 0x0;})['then'](function(_0x127a9e){if(!_[_0x198e('0x78')](_0x127a9e)&&_['isNumber'](_0x127a9e)){return _0x2260bc[_0x198e('0x1c')](0xc8)['json']({'contacts':_0x127a9e});}else{logger['error'](_0x198e('0x98'),_0x198e('0x96'),0x194,_0x198e('0x99'));_0x2260bc[_0x198e('0x1b')](0x194);}})[_0x198e('0x5b')](handleError(_0x2260bc,null));}; \ No newline at end of file +var _0xe309=['util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','then','stack','name','send','CmHopper','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','$and','$or','$gt','$gte','$lte','$ne','$eq','$between','$notBetween','$in','$notLike','$like','$contains','$contained','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','map','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','create','body','describe','destroy','VoiceQueueId','CampaignId','omit','dataValues','updatedAt','statedesc','deleted','membername','UserId','user','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','ivr','CmContact','ContactId','firstName','isNil','calleridname','finally','CmHopperFinal','getPreview','getVoiceQueues','dialOrderByScheduledAt','sequelize','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','scheduledat','LOCK','CmCompany','Company','CmList','List','Queue','dialActive','outbound','preview','CmHopper,\x20%s,\x20%s,\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xe309,0x106));var _0x9e30=function(_0x3308ef,_0x1235e5){_0x3308ef=_0x3308ef-0x0;var _0x529f66=_0xe309[_0x3308ef];return _0x529f66;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9e30('0x0'));var zipdir=require(_0x9e30('0x1'));var jsonpatch=require(_0x9e30('0x2'));var rp=require(_0x9e30('0x3'));var moment=require(_0x9e30('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9e30('0x5'));var util=require(_0x9e30('0x6'));var path=require(_0x9e30('0x7'));var sox=require(_0x9e30('0x8'));var csv=require(_0x9e30('0x9'));var ejs=require(_0x9e30('0xa'));var fs=require('fs');var fs_extra=require(_0x9e30('0xb'));var _=require('lodash');var squel=require(_0x9e30('0xc'));var crypto=require(_0x9e30('0xd'));var jsforce=require(_0x9e30('0xe'));var deskjs=require(_0x9e30('0xf'));var toCsv=require(_0x9e30('0x9'));var querystring=require(_0x9e30('0x10'));var Papa=require('papaparse');var Redis=require(_0x9e30('0x11'));var authService=require(_0x9e30('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9e30('0x13'))(_0x9e30('0x14'));var utils=require(_0x9e30('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9e30('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe36985,_0xdb35d7){_0xdb35d7=_0xdb35d7||0xcc;return function(_0x3d4c13){if(_0x3d4c13){return _0xe36985[_0x9e30('0x17')](_0xdb35d7);}return _0xe36985[_0x9e30('0x18')](_0xdb35d7)[_0x9e30('0x19')]();};}function respondWithResult(_0x1dcf9f,_0x3cf5dc){_0x3cf5dc=_0x3cf5dc||0xc8;return function(_0x1f2f52){if(_0x1f2f52){return _0x1dcf9f[_0x9e30('0x18')](_0x3cf5dc)[_0x9e30('0x1a')](_0x1f2f52);}};}function respondWithFilteredResult(_0x141f6a,_0x1d77e2){return function(_0x3ba37e){if(_0x3ba37e){var _0x2175ea=typeof _0x1d77e2['offset']===_0x9e30('0x1b')&&typeof _0x1d77e2['limit']===_0x9e30('0x1b');var _0x461548=_0x3ba37e[_0x9e30('0x1c')];var _0xfdc813=_0x2175ea?0x0:_0x1d77e2[_0x9e30('0x1d')];var _0x2dc65e=_0x2175ea?_0x3ba37e['count']:_0x1d77e2[_0x9e30('0x1d')]+_0x1d77e2[_0x9e30('0x1e')];var _0x277784;if(_0x2dc65e>=_0x461548){_0x2dc65e=_0x461548;_0x277784=0xc8;}else{_0x277784=0xce;}_0x141f6a[_0x9e30('0x18')](_0x277784);return _0x141f6a[_0x9e30('0x1f')](_0x9e30('0x20'),_0xfdc813+'-'+_0x2dc65e+'/'+_0x461548)[_0x9e30('0x1a')](_0x3ba37e);}return null;};}function patchUpdates(_0x2d53d7){return function(_0x1af545){try{jsonpatch[_0x9e30('0x21')](_0x1af545,_0x2d53d7,!![]);}catch(_0x3f1dba){return BPromise['reject'](_0x3f1dba);}return _0x1af545[_0x9e30('0x22')]();};}function saveUpdates(_0x218d92,_0x490823){return function(_0x5f000b){if(_0x5f000b){return _0x5f000b[_0x9e30('0x23')](_0x218d92)[_0x9e30('0x24')](function(_0x5303a8){return _0x5303a8;});}return null;};}function removeEntity(_0x5a000b,_0x38996f){return function(_0x58b32b){if(_0x58b32b){return _0x58b32b['destroy']()[_0x9e30('0x24')](function(){_0x5a000b[_0x9e30('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a8a3f,_0x456935){return function(_0x2cbb5c){if(!_0x2cbb5c){_0x3a8a3f[_0x9e30('0x17')](0x194);}return _0x2cbb5c;};}function handleError(_0x20c1ca,_0x8c6522){_0x8c6522=_0x8c6522||0x1f4;return function(_0x66b329){logger['error'](_0x66b329[_0x9e30('0x25')]);if(_0x66b329[_0x9e30('0x26')]){delete _0x66b329['name'];}_0x20c1ca['status'](_0x8c6522)[_0x9e30('0x27')](_0x66b329);};}exports['index']=function(_0x527523,_0x55182b){var _0x19ae17={},_0x4d5aa1={},_0x4d51bb={'count':0x0,'rows':[]};var _0x40c3d5=_['map'](db[_0x9e30('0x28')][_0x9e30('0x29')],function(_0x20c534){return{'name':_0x20c534[_0x9e30('0x2a')],'type':_0x20c534[_0x9e30('0x2b')][_0x9e30('0x2c')]};});_0x4d5aa1['model']=_['map'](_0x40c3d5,_0x9e30('0x26'));_0x4d5aa1['query']=_[_0x9e30('0x2d')](_0x527523[_0x9e30('0x2e')]);_0x4d5aa1[_0x9e30('0x2f')]=_[_0x9e30('0x30')](_0x4d5aa1[_0x9e30('0x31')],_0x4d5aa1[_0x9e30('0x2e')]);_0x4d5aa1['filters']=_['concat'](_0x4d5aa1['filters'],[_0x9e30('0x32'),_0x9e30('0x33'),_0x9e30('0x34'),_0x9e30('0x35'),'$lt',_0x9e30('0x36'),_0x9e30('0x37'),_0x9e30('0x38'),'$not',_0x9e30('0x39'),_0x9e30('0x3a'),_0x9e30('0x3b'),'$notIn','$like',_0x9e30('0x3c'),'$iLike','$notILike',_0x9e30('0x3d'),'$overlap',_0x9e30('0x3e'),_0x9e30('0x3f'),'$any']);_0x19ae17[_0x9e30('0x40')]=_[_0x9e30('0x30')](_0x4d5aa1['model'],qs[_0x9e30('0x41')](_0x527523[_0x9e30('0x2e')][_0x9e30('0x41')]));_0x19ae17[_0x9e30('0x40')]=_0x19ae17[_0x9e30('0x40')][_0x9e30('0x42')]?_0x19ae17[_0x9e30('0x40')]:_0x4d5aa1[_0x9e30('0x31')];if(!_0x527523[_0x9e30('0x2e')][_0x9e30('0x43')]('nolimit')){_0x19ae17[_0x9e30('0x1e')]=qs[_0x9e30('0x1e')](_0x527523[_0x9e30('0x2e')][_0x9e30('0x1e')]);_0x19ae17['offset']=qs[_0x9e30('0x1d')](_0x527523[_0x9e30('0x2e')][_0x9e30('0x1d')]);}_0x19ae17[_0x9e30('0x44')]=qs[_0x9e30('0x45')](_0x527523[_0x9e30('0x2e')][_0x9e30('0x45')]);_0x19ae17['where']=qs[_0x9e30('0x2f')](_['pick'](_0x527523[_0x9e30('0x2e')],_0x4d5aa1[_0x9e30('0x2f')]),_0x40c3d5);if(_0x527523['query'][_0x9e30('0x46')]){_0x19ae17[_0x9e30('0x47')]=_[_0x9e30('0x48')](_0x19ae17['where'],{'$or':_[_0x9e30('0x49')](_0x40c3d5,function(_0x5d8d98){if(_0x5d8d98['type']!==_0x9e30('0x4a')){var _0x4470db={};_0x4470db[_0x5d8d98[_0x9e30('0x26')]]={'$like':'%'+_0x527523['query'][_0x9e30('0x46')]+'%'};return _0x4470db;}})});}_0x19ae17=_[_0x9e30('0x48')]({},_0x19ae17,_0x527523[_0x9e30('0x4b')]);var _0x5649b6={'where':_0x19ae17[_0x9e30('0x47')]};return db[_0x9e30('0x28')][_0x9e30('0x1c')](_0x5649b6)['then'](function(_0x59b59d){_0x4d51bb[_0x9e30('0x1c')]=_0x59b59d;if(_0x527523[_0x9e30('0x2e')][_0x9e30('0x4c')]){_0x19ae17['include']=[{'all':!![]}];}return db[_0x9e30('0x28')][_0x9e30('0x4d')](_0x19ae17);})[_0x9e30('0x24')](function(_0x3e6563){_0x4d51bb['rows']=_0x3e6563;return _0x4d51bb;})[_0x9e30('0x24')](respondWithFilteredResult(_0x55182b,_0x19ae17))[_0x9e30('0x4e')](handleError(_0x55182b,null));};exports[_0x9e30('0x4f')]=function(_0x2cd0a5,_0x359f82){var _0x560c0d={'raw':!![],'where':{'id':_0x2cd0a5[_0x9e30('0x50')]['id']}},_0x543c2d={};_0x543c2d[_0x9e30('0x31')]=_[_0x9e30('0x2d')](db[_0x9e30('0x28')]['rawAttributes']);_0x543c2d[_0x9e30('0x2e')]=_[_0x9e30('0x2d')](_0x2cd0a5[_0x9e30('0x2e')]);_0x543c2d['filters']=_[_0x9e30('0x30')](_0x543c2d[_0x9e30('0x31')],_0x543c2d[_0x9e30('0x2e')]);_0x560c0d['attributes']=_[_0x9e30('0x30')](_0x543c2d[_0x9e30('0x31')],qs['fields'](_0x2cd0a5['query'][_0x9e30('0x41')]));_0x560c0d[_0x9e30('0x40')]=_0x560c0d[_0x9e30('0x40')]['length']?_0x560c0d['attributes']:_0x543c2d['model'];if(_0x2cd0a5[_0x9e30('0x2e')][_0x9e30('0x4c')]){_0x560c0d[_0x9e30('0x51')]=[{'all':!![]}];}_0x560c0d=_[_0x9e30('0x48')]({},_0x560c0d,_0x2cd0a5[_0x9e30('0x4b')]);return db[_0x9e30('0x28')][_0x9e30('0x52')](_0x560c0d)[_0x9e30('0x24')](handleEntityNotFound(_0x359f82,null))[_0x9e30('0x24')](respondWithResult(_0x359f82,null))[_0x9e30('0x4e')](handleError(_0x359f82,null));};exports[_0x9e30('0x53')]=function(_0x5a1260,_0x5ce6ff){return db[_0x9e30('0x28')][_0x9e30('0x53')](_0x5a1260['body'],{})[_0x9e30('0x24')](respondWithResult(_0x5ce6ff,0xc9))['catch'](handleError(_0x5ce6ff,null));};exports[_0x9e30('0x23')]=function(_0x4d0601,_0x505cd3){if(_0x4d0601[_0x9e30('0x54')]['id']){delete _0x4d0601[_0x9e30('0x54')]['id'];}return db[_0x9e30('0x28')]['find']({'where':{'id':_0x4d0601[_0x9e30('0x50')]['id']}})[_0x9e30('0x24')](handleEntityNotFound(_0x505cd3,null))[_0x9e30('0x24')](saveUpdates(_0x4d0601[_0x9e30('0x54')],null))[_0x9e30('0x24')](respondWithResult(_0x505cd3,null))['catch'](handleError(_0x505cd3,null));};exports[_0x9e30('0x55')]=function(_0x4881f6,_0x15eb07){return db['CmHopper'][_0x9e30('0x55')]()[_0x9e30('0x24')](respondWithResult(_0x15eb07,null))[_0x9e30('0x4e')](handleError(_0x15eb07,null));};exports[_0x9e30('0x56')]=function(_0x3af1d0,_0x4bfbed){var _0x9db4c0;return db['CmHopper'][_0x9e30('0x52')]({'where':{'id':_0x3af1d0[_0x9e30('0x50')]['id']}})['then'](handleEntityNotFound(_0x4bfbed,null))[_0x9e30('0x24')](function(_0x57a233){if(_0x57a233){return _0x57a233[_0x9e30('0x56')]()[_0x9e30('0x24')](function(_0x338482){return _0x338482;});}})['then'](function(_0x322e89){_0x9db4c0=_0x322e89;if(_0x322e89){if(_0x322e89[_0x9e30('0x57')]||_0x322e89[_0x9e30('0x58')]){return db[_0x322e89[_0x9e30('0x57')]?'VoiceQueue':'Campaign'][_0x9e30('0x52')]({'where':{'id':_0x322e89[_0x9e30('0x57')]?_0x322e89[_0x9e30('0x57')]:_0x322e89[_0x9e30('0x58')]},'attributes':['id',_0x9e30('0x26')],'raw':!![]});}}})[_0x9e30('0x24')](function(_0x4f3dda){var _0x17cd49={};if(_0x4f3dda){_[_0x9e30('0x48')](_0x17cd49,_[_0x9e30('0x59')](_0x9db4c0[_0x9e30('0x5a')],['createdAt',_0x9e30('0x5b'),'id']));_0x17cd49['state']=0x15;_0x17cd49[_0x9e30('0x5c')]=_0x9e30('0x5d');_0x17cd49['campaign']=_0x4f3dda[_0x9e30('0x26')];_0x17cd49[_0x9e30('0x5e')]=_0x3af1d0['user'][_0x9e30('0x26')];_0x17cd49[_0x9e30('0x5f')]=_0x3af1d0[_0x9e30('0x60')]['id'];_0x17cd49[_0x9e30('0x5d')]=!![];_0x17cd49['deletedat']=moment()[_0x9e30('0x61')](_0x9e30('0x62'));_0x17cd49[_0x9e30('0x63')]=_0x9db4c0[_0x9e30('0x64')];_0x17cd49[_0x9e30('0x65')]=_0x9db4c0[_0x9e30('0x57')]?'queue':_0x9e30('0x66');return db[_0x9e30('0x67')]['find']({'where':{'id':_0x17cd49[_0x9e30('0x68')]},'attributes':[_0x9e30('0x69'),'lastName']})['then'](function(_0x1a2888){if(!_['isNil'](_0x4bfbed)&&!_[_0x9e30('0x6a')](_0x1a2888['firstName'])){_0x17cd49['calleridname']=_0x1a2888[_0x9e30('0x69')];if(!_['isNil'](_0x1a2888['lastName'])){_0x17cd49[_0x9e30('0x6b')]+='\x20'+_0x1a2888['lastName'];}}})[_0x9e30('0x6c')](function(){return db[_0x9e30('0x6d')]['create'](_0x17cd49);});}})['then'](function(){return _0x4bfbed[_0x9e30('0x18')](0xcc)[_0x9e30('0x19')]();})['catch'](handleError(_0x4bfbed,null));};exports[_0x9e30('0x6e')]=function(_0x52cf4f,_0x4982f2,_0x2f26da){var _0x345bd6=[];return db['CmContact'][_0x9e30('0x55')]()[_0x9e30('0x24')](function(_0x591d22){_0x345bd6=_[_0x9e30('0x2d')](_0x591d22);return _0x52cf4f[_0x9e30('0x60')][_0x9e30('0x6f')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x9e30('0x70')],'raw':!![]});})['then'](function(_0x4e4980){if(_0x4e4980&&_0x4e4980[_0x9e30('0x42')]){return db[_0x9e30('0x71')]['transaction'](function(_0x2b9f39){var _0x19f606={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x9e30('0x61')](_0x9e30('0x62'))},'VoiceQueueId':{'$in':_[_0x9e30('0x49')](_0x4e4980,'id')},'$or':[{'UserId':null},{'UserId':_0x52cf4f[_0x9e30('0x60')]['id']}]};var _0x5b7d3c=[];if(_0x52cf4f[_0x9e30('0x54')][_0x9e30('0x72')]&&_0x52cf4f[_0x9e30('0x54')][_0x9e30('0x72')]===_0x9e30('0x73')){if(!_[_0x9e30('0x74')](_0x52cf4f[_0x9e30('0x54')][_0x9e30('0x75')])){_0x19f606['id']={'$in':_0x52cf4f[_0x9e30('0x54')]['hopperIds']};}_0x5b7d3c=[[_0x9e30('0x76'),_0x9e30('0x77')],[_0x9e30('0x78'),_0x4e4980[0x0][_0x9e30('0x70')]===_0x9e30('0x77')?_0x9e30('0x79'):_0x9e30('0x77')],db['sequelize'][_0x9e30('0x7a')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x9e30('0x79')]];}else{if(!_[_0x9e30('0x74')](_0x52cf4f[_0x9e30('0x54')]['hopperIds'])){_0x19f606['id']={'$notIn':_0x52cf4f[_0x9e30('0x54')][_0x9e30('0x75')]};}_0x5b7d3c=[[_0x9e30('0x76'),'DESC'],['scheduledAt',_0x4e4980[0x0][_0x9e30('0x70')]],db[_0x9e30('0x71')][_0x9e30('0x7a')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x9e30('0x77')]];}return db[_0x9e30('0x28')]['findOne']({'attributes':['id',_0x9e30('0x7b')],'where':_0x19f606,'order':_0x5b7d3c,'transaction':_0x2b9f39,'lock':_0x2b9f39[_0x9e30('0x7c')]['UPDATE'],'include':[{'model':db[_0x9e30('0x67')],'as':'Contact','attributes':_0x345bd6,'include':[{'model':db[_0x9e30('0x7d')],'as':_0x9e30('0x7e'),'attributes':['id',_0x9e30('0x26')]}]},{'model':db[_0x9e30('0x7f')],'as':_0x9e30('0x80'),'attributes':['id',_0x9e30('0x26')]},{'model':db['VoiceQueue'],'as':_0x9e30('0x81'),'attributes':['id',_0x9e30('0x26'),_0x9e30('0x82')]}]})['then'](function(_0x44a59b){if(_0x44a59b){return _0x44a59b[_0x9e30('0x23')]({'UserId':_0x52cf4f[_0x9e30('0x60')]['id']},{'transaction':_0x2b9f39});}});});}})['then'](handleEntityNotFound(_0x4982f2,null))[_0x9e30('0x24')](respondWithResult(_0x4982f2,null))['catch'](handleError(_0x4982f2,null));};exports['getOpenContacts']=function(_0x29ee2c,_0xd872fb,_0x30df06){return _0x29ee2c['user']['getVoiceQueues']({'where':{'type':_0x9e30('0x83'),'dialActive':!![],'dialMethod':_0x9e30('0x84')},'attributes':['id'],'raw':!![]})[_0x9e30('0x24')](function(_0x4fdb13){if(_0x4fdb13&&_0x4fdb13['length']){return db[_0x9e30('0x28')][_0x9e30('0x1c')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x9e30('0x61')](_0x9e30('0x62'))},'VoiceQueueId':{'$in':_[_0x9e30('0x49')](_0x4fdb13,'id')},'$or':[{'UserId':null},{'UserId':_0x29ee2c[_0x9e30('0x60')]['id']}]}});}return 0x0;})['then'](function(_0x45c446){if(!_[_0x9e30('0x6a')](_0x45c446)&&_['isNumber'](_0x45c446)){return _0xd872fb[_0x9e30('0x18')](0xc8)[_0x9e30('0x1a')]({'contacts':_0x45c446});}else{logger['error'](_0x9e30('0x85'),'getOpenContacts',0x194,'entity\x20not\x20found');_0xd872fb[_0x9e30('0x17')](0x194);}})[_0x9e30('0x4e')](handleError(_0xd872fb,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 3ba01d4..5f8434e 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 _0x3f8a=['rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x8c1196,_0x522ccb){var _0x532422=function(_0x5a4dc1){while(--_0x5a4dc1){_0x8c1196['push'](_0x8c1196['shift']());}};_0x532422(++_0x522ccb);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x2ad405,_0x4edafb){_0x2ad405=_0x2ad405-0x0;var _0x3931bd=_0x3f8a[_0x2ad405];return _0x3931bd;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var logger=require(_0xa3f8('0x2'))(_0xa3f8('0x3'));var moment=require('moment');var BPromise=require(_0xa3f8('0x4'));var rp=require(_0xa3f8('0x5'));var fs=require('fs');var path=require(_0xa3f8('0x6'));var rimraf=require(_0xa3f8('0x7'));var config=require(_0xa3f8('0x8'));var attributes=require(_0xa3f8('0x9'));module[_0xa3f8('0xa')]=function(_0x471464,_0x1f160a){return _0x471464[_0xa3f8('0xb')](_0xa3f8('0xc'),attributes,{'tableName':_0xa3f8('0xd'),'paranoid':![],'indexes':[{'name':_0xa3f8('0xe'),'fields':[_0xa3f8('0xe')]},{'name':_0xa3f8('0xf'),'fields':[_0xa3f8('0xf')]},{'name':_0xa3f8('0x10'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0xadb5=['CmHopper','cm_hopper','scheduledat','phone','priority','util','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x14dd38,_0x1d733d){var _0x33e94f=function(_0x508386){while(--_0x508386){_0x14dd38['push'](_0x14dd38['shift']());}};_0x33e94f(++_0x1d733d);}(_0xadb5,0xad));var _0x5adb=function(_0x47efe2,_0x55eb0b){_0x47efe2=_0x47efe2-0x0;var _0x390d80=_0xadb5[_0x47efe2];return _0x390d80;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var logger=require('../../config/logger')(_0x5adb('0x1'));var moment=require(_0x5adb('0x2'));var BPromise=require(_0x5adb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5adb('0x4'));var rimraf=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var attributes=require('./cmHopper.attributes');module[_0x5adb('0x7')]=function(_0x168d89,_0x3e2555){return _0x168d89[_0x5adb('0x8')](_0x5adb('0x9'),attributes,{'tableName':_0x5adb('0xa'),'paranoid':![],'indexes':[{'name':_0x5adb('0xb'),'fields':[_0x5adb('0xb')]},{'name':_0x5adb('0xc'),'fields':[_0x5adb('0xc')]},{'name':_0x5adb('0xd'),'fields':[_0x5adb('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 6f5b18e..b6ee613 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 _0x10b3=['error','message','result','catch','GetCmHopper','CmHopper','findAll','options','attributes','include','map','model','ShowCmHopper','find','raw','where','stringify','CreateCmHopper','create','body','update','limit','UpdateCmHopper','DestroyCmHopper','destroy','GetContactDialer','CmContact','sequelize','transaction','LOCK','Contact','keys','Agent','name','voicePause','UserId','push','MoveContactManagedDialer','CmHopperFinal','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','describe','order','length','GetCmHopperPreview','util','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x10b3,0x1c6));var _0x310b=function(_0x4e80a2,_0x431ccd){_0x4e80a2=_0x4e80a2-0x0;var _0x4f7d8b=_0x10b3[_0x4e80a2];return _0x4f7d8b;};'use strict';var _=require('lodash');var util=require(_0x310b('0x0'));var moment=require('moment');var BPromise=require(_0x310b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x310b('0x2'));var db=require(_0x310b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x310b('0x4'))('rpc');var config=require(_0x310b('0x5'));var jayson=require(_0x310b('0x6'));var client=jayson[_0x310b('0x7')][_0x310b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3905be,_0x382c09,_0x51588b){return new BPromise(function(_0x508ee9,_0x23f7f8){return client['request'](_0x3905be,_0x51588b)[_0x310b('0x9')](function(_0x37d943){logger[_0x310b('0xa')](_0x310b('0xb'),_0x382c09,_0x310b('0xc'));logger[_0x310b('0xd')](_0x310b('0xe'),_0x382c09,_0x310b('0xc'),JSON['stringify'](_0x37d943));if(_0x37d943['error']){if(_0x37d943[_0x310b('0xf')]['code']===0x1f4){logger[_0x310b('0xf')](_0x310b('0xb'),_0x382c09,_0x37d943[_0x310b('0xf')][_0x310b('0x10')]);return _0x23f7f8(_0x37d943[_0x310b('0xf')]['message']);}logger[_0x310b('0xf')](_0x310b('0xb'),_0x382c09,_0x37d943[_0x310b('0xf')][_0x310b('0x10')]);return _0x508ee9(_0x37d943['error'][_0x310b('0x10')]);}else{logger['info'](_0x310b('0xb'),_0x382c09,_0x310b('0xc'));_0x508ee9(_0x37d943[_0x310b('0x11')][_0x310b('0x10')]);}})[_0x310b('0x12')](function(_0x28f0a5){logger[_0x310b('0xf')](_0x310b('0xb'),_0x382c09,_0x28f0a5);_0x23f7f8(_0x28f0a5);});});}exports[_0x310b('0x13')]=function(_0x4840df){var _0x4ba379=this;return new Promise(function(_0x393c3a,_0x22bf9b){return db[_0x310b('0x14')][_0x310b('0x15')]({'raw':_0x4840df[_0x310b('0x16')]?_0x4840df[_0x310b('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x4840df[_0x310b('0x16')]?_0x4840df['options']['where']||null:null,'attributes':_0x4840df[_0x310b('0x16')]?_0x4840df[_0x310b('0x16')][_0x310b('0x17')]||null:null,'limit':_0x4840df[_0x310b('0x16')]?_0x4840df['options']['limit']||null:null,'include':_0x4840df[_0x310b('0x16')]?_0x4840df[_0x310b('0x16')][_0x310b('0x18')]?_[_0x310b('0x19')](_0x4840df[_0x310b('0x16')][_0x310b('0x18')],function(_0x6ee244){return{'model':db[_0x6ee244[_0x310b('0x1a')]],'as':_0x6ee244['as'],'attributes':_0x6ee244[_0x310b('0x17')],'include':_0x6ee244['include']?_[_0x310b('0x19')](_0x6ee244['include'],function(_0x9c1cb8){return{'model':db[_0x9c1cb8[_0x310b('0x1a')]],'as':_0x9c1cb8['as'],'attributes':_0x9c1cb8[_0x310b('0x17')],'include':_0x9c1cb8[_0x310b('0x18')]?_['map'](_0x9c1cb8['include'],function(_0x172545){return{'model':db[_0x172545[_0x310b('0x1a')]],'as':_0x172545['as'],'attributes':_0x172545['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x380606){logger[_0x310b('0xa')](_0x310b('0x13'),_0x4840df);logger['debug'](_0x310b('0x13'),_0x4840df,JSON['stringify'](_0x380606));_0x393c3a(_0x380606);})[_0x310b('0x12')](function(_0x308814){logger[_0x310b('0xf')](_0x310b('0x13'),_0x308814[_0x310b('0x10')],_0x4840df);_0x22bf9b(_0x4ba379[_0x310b('0xf')](0x1f4,_0x308814[_0x310b('0x10')]));});});};exports[_0x310b('0x1b')]=function(_0x5d97c7){var _0x4f8839=this;return new Promise(function(_0x2ef241,_0x1e286a){return db['CmHopper'][_0x310b('0x1c')]({'raw':_0x5d97c7['options']?_0x5d97c7['options'][_0x310b('0x1d')]===undefined?!![]:![]:!![],'where':_0x5d97c7['options']?_0x5d97c7[_0x310b('0x16')][_0x310b('0x1e')]||null:null,'attributes':_0x5d97c7[_0x310b('0x16')]?_0x5d97c7[_0x310b('0x16')]['attributes']||null:null,'include':_0x5d97c7[_0x310b('0x16')]?_0x5d97c7[_0x310b('0x16')][_0x310b('0x18')]?_['map'](_0x5d97c7[_0x310b('0x16')][_0x310b('0x18')],function(_0x52b759){return{'model':db[_0x52b759['model']],'as':_0x52b759['as'],'attributes':_0x52b759['attributes'],'include':_0x52b759[_0x310b('0x18')]?_[_0x310b('0x19')](_0x52b759[_0x310b('0x18')],function(_0x3f6151){return{'model':db[_0x3f6151[_0x310b('0x1a')]],'as':_0x3f6151['as'],'attributes':_0x3f6151[_0x310b('0x17')],'include':_0x3f6151[_0x310b('0x18')]?_[_0x310b('0x19')](_0x3f6151['include'],function(_0xd2d4ee){return{'model':db[_0xd2d4ee[_0x310b('0x1a')]],'as':_0xd2d4ee['as'],'attributes':_0xd2d4ee[_0x310b('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x468c8e){logger[_0x310b('0xa')](_0x310b('0x1b'),_0x5d97c7);logger[_0x310b('0xd')](_0x310b('0x1b'),_0x5d97c7,JSON[_0x310b('0x1f')](_0x468c8e));_0x2ef241(_0x468c8e);})[_0x310b('0x12')](function(_0x13f260){logger[_0x310b('0xf')]('ShowCmHopper',_0x13f260['message'],_0x5d97c7);_0x1e286a(_0x4f8839[_0x310b('0xf')](0x1f4,_0x13f260[_0x310b('0x10')]));});});};exports[_0x310b('0x20')]=function(_0xa14a32){var _0x4682f9=this;return new Promise(function(_0x14533a,_0x4a939f){return db[_0x310b('0x14')][_0x310b('0x21')](_0xa14a32[_0x310b('0x22')],{'raw':_0xa14a32[_0x310b('0x16')]?_0xa14a32[_0x310b('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x310b('0x9')](function(_0xfb14e){logger[_0x310b('0xa')](_0x310b('0x20'),_0xa14a32);logger['debug'](_0x310b('0x20'),_0xa14a32,JSON[_0x310b('0x1f')](_0xfb14e));_0x14533a(_0xfb14e);})['catch'](function(_0x9a65cd){logger[_0x310b('0xf')]('CreateCmHopper',_0x9a65cd[_0x310b('0x10')],_0xa14a32);_0x4a939f(_0x4682f9['error'](0x1f4,_0x9a65cd['message']));});});};exports['UpdateCmHopper']=function(_0x4ebe7c){var _0x107efd=this;return new Promise(function(_0x575886,_0x9a3447){return db[_0x310b('0x14')][_0x310b('0x23')](_0x4ebe7c[_0x310b('0x22')],{'raw':_0x4ebe7c[_0x310b('0x16')]?_0x4ebe7c[_0x310b('0x16')][_0x310b('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ebe7c[_0x310b('0x16')]?_0x4ebe7c['options']['where']||null:null,'attributes':_0x4ebe7c[_0x310b('0x16')]?_0x4ebe7c['options']['attributes']||null:null,'limit':_0x4ebe7c[_0x310b('0x16')]?_0x4ebe7c[_0x310b('0x16')][_0x310b('0x24')]||null:null})[_0x310b('0x9')](function(_0xe9d7c1){logger[_0x310b('0xa')](_0x310b('0x25'),_0x4ebe7c);logger[_0x310b('0xd')](_0x310b('0x25'),_0x4ebe7c,JSON['stringify'](_0xe9d7c1));_0x575886(_0xe9d7c1);})[_0x310b('0x12')](function(_0x1ac8a5){logger[_0x310b('0xf')]('UpdateCmHopper',_0x1ac8a5[_0x310b('0x10')],_0x4ebe7c);_0x9a3447(_0x107efd[_0x310b('0xf')](0x1f4,_0x1ac8a5['message']));});});};exports[_0x310b('0x26')]=function(_0x39e442){var _0x1c9e9a=this;return new Promise(function(_0x19cdcc,_0x5dc90f){return db[_0x310b('0x14')][_0x310b('0x27')]({'where':_0x39e442[_0x310b('0x16')]?_0x39e442[_0x310b('0x16')][_0x310b('0x1e')]||null:null})[_0x310b('0x9')](function(_0x5472f4){logger['info']('DestroyCmHopper',_0x39e442);logger[_0x310b('0xd')]('DestroyCmHopper',_0x39e442,JSON[_0x310b('0x1f')](_0x5472f4));_0x19cdcc(_0x5472f4);})['catch'](function(_0xb2807f){logger[_0x310b('0xf')]('DestroyCmHopper',_0xb2807f[_0x310b('0x10')],_0x39e442);_0x5dc90f(_0x1c9e9a['error'](0x1f4,_0xb2807f[_0x310b('0x10')]));});});};exports[_0x310b('0x28')]=function(_0xb3566c){var _0xec4b6c=this;return new Promise(function(_0x18ee45,_0x457849){return db[_0x310b('0x29')]['describe']()[_0x310b('0x9')](function(_0x6e66e4){return db[_0x310b('0x2a')][_0x310b('0x2b')](function(_0x10e2ce){return db[_0x310b('0x14')][_0x310b('0x15')]({'where':_0xb3566c[_0x310b('0x16')]?_0xb3566c[_0x310b('0x16')][_0x310b('0x1e')]||null:null,'attributes':_0xb3566c[_0x310b('0x16')]?_0xb3566c[_0x310b('0x16')][_0x310b('0x17')]||null:null,'limit':_0xb3566c[_0x310b('0x16')]?_0xb3566c[_0x310b('0x16')][_0x310b('0x24')]||null:null,'order':_0xb3566c[_0x310b('0x16')]?_0xb3566c[_0x310b('0x16')]['order']||null:null,'transaction':_0x10e2ce,'lock':_0x10e2ce[_0x310b('0x2c')]['UPDATE'],'include':[{'model':db[_0x310b('0x29')],'as':_0x310b('0x2d'),'attributes':_[_0x310b('0x2e')](_0x6e66e4)},{'model':db['User'],'as':_0x310b('0x2f'),'attributes':['id',_0x310b('0x30'),_0x310b('0x31')]}]})[_0x310b('0x9')](function(_0x46367a){var _0x39e3c5=[];var _0x2a7931=[];for(var _0x25024e=0x0;_0x25024e<_0x46367a['length'];_0x25024e+=0x1){var _0x5debd8=_0x46367a[_0x25024e][_0x310b('0x32')];if(_0x5debd8===null){_0x39e3c5[_0x310b('0x33')](_0x46367a[_0x25024e][_0x310b('0x23')](_0xb3566c[_0x310b('0x22')],{'transaction':_0x10e2ce}));}else if(!_0x2a7931['includes'](_0x5debd8)){_0x2a7931[_0x310b('0x33')](_0x5debd8);_0x39e3c5[_0x310b('0x33')](_0x46367a[_0x25024e][_0x310b('0x23')](_0xb3566c['body'],{'transaction':_0x10e2ce}));}}return BPromise['all'](_0x39e3c5);});})[_0x310b('0x9')](function(_0x556839){logger['info'](_0x310b('0x28'),_0xb3566c);logger[_0x310b('0xd')](_0x310b('0x28'),_0xb3566c,JSON['stringify'](_0x556839));_0x18ee45(_0x556839);})[_0x310b('0x12')](function(_0x3161f3){logger['error'](_0x310b('0x28'),_0x3161f3[_0x310b('0x10')],_0xb3566c);_0x457849(_0xec4b6c[_0x310b('0xf')](0x1f4,_0x3161f3[_0x310b('0x10')]));});});});};exports[_0x310b('0x34')]=function(_0x5f12fa){var _0xaf3c5d=this;return new Promise(function(_0x250635,_0x2f6b0e){return db[_0x310b('0x2a')][_0x310b('0x2b')](function(_0x363f18){return db[_0x310b('0x35')][_0x310b('0x21')](_0x5f12fa['body'],{'raw':_0x5f12fa['options']?_0x5f12fa[_0x310b('0x16')][_0x310b('0x1d')]===undefined?!![]:![]:!![],'transaction':_0x363f18})[_0x310b('0x9')](function(){return db[_0x310b('0x14')]['destroy']({'where':_0x5f12fa[_0x310b('0x16')]?_0x5f12fa[_0x310b('0x16')][_0x310b('0x1e')]||null:null,'transaction':_0x363f18});});})[_0x310b('0x9')](function(_0x19e141){logger[_0x310b('0xa')](_0x310b('0x34'),_0x5f12fa);logger[_0x310b('0xd')]('MoveContactManagedDialer',_0x5f12fa,JSON[_0x310b('0x1f')](_0x19e141));_0x250635(_0x19e141);})[_0x310b('0x12')](function(_0x4434ac){logger[_0x310b('0xf')](_0x310b('0x34'),_0x4434ac['message'],_0x5f12fa);_0x2f6b0e(_0xaf3c5d[_0x310b('0xf')](0x1f4,_0x4434ac[_0x310b('0x10')]));});});};exports[_0x310b('0x36')]=function(_0x3a1610){var _0x2384e4=this;return new Promise(function(_0x10d03,_0x1dae5e){return db[_0x310b('0x14')][_0x310b('0x15')]({'raw':_0x3a1610[_0x310b('0x16')]?_0x3a1610[_0x310b('0x16')][_0x310b('0x1d')]===undefined?!![]:![]:!![],'where':_0x3a1610[_0x310b('0x16')]?_0x3a1610[_0x310b('0x16')][_0x310b('0x1e')]||null:null,'attributes':[[db[_0x310b('0x2a')]['fn'](_0x310b('0x37'),db[_0x310b('0x2a')]['fn']('IF',db[_0x310b('0x2a')][_0x310b('0x38')](_0x310b('0x39')+util[_0x310b('0x3a')](_0x310b('0x3b'),moment()[_0x310b('0x3a')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x310b('0x3c')))),_0x310b('0x3d')]]})[_0x310b('0x9')](function(_0x4accd9){logger[_0x310b('0xa')]('CountReScheduled',_0x3a1610);logger[_0x310b('0xd')](_0x310b('0x36'),_0x3a1610,JSON['stringify'](_0x4accd9));_0x10d03(_0x4accd9);})[_0x310b('0x12')](function(_0x3f27d2){logger['error']('CountReScheduled',_0x3f27d2[_0x310b('0x10')],_0x3a1610);_0x1dae5e(_0x2384e4[_0x310b('0xf')](0x1f4,_0x3f27d2[_0x310b('0x10')]));});});};exports[_0x310b('0x3e')]=function(_0x469433){var _0x521ec3=this;return new Promise(function(_0x5ec031,_0xee3b13){return db[_0x310b('0x29')][_0x310b('0x3f')]()[_0x310b('0x9')](function(_0x2f68fa){return db[_0x310b('0x2a')][_0x310b('0x2b')](function(_0x5a3c21){return db[_0x310b('0x14')][_0x310b('0x15')]({'where':_0x469433['options']?_0x469433[_0x310b('0x16')][_0x310b('0x1e')]||null:null,'attributes':_0x469433['options']?_0x469433[_0x310b('0x16')][_0x310b('0x17')]||null:null,'limit':0x1,'order':_0x469433[_0x310b('0x16')]?_0x469433[_0x310b('0x16')][_0x310b('0x40')]||null:null,'group':db['CmHopper'][_0x310b('0x32')],'transaction':_0x5a3c21,'lock':_0x5a3c21[_0x310b('0x2c')]['UPDATE'],'include':_0x469433['options']?_0x469433[_0x310b('0x16')]['include']?_[_0x310b('0x19')](_0x469433[_0x310b('0x16')]['include'],function(_0x12a5b8){return{'model':db[_0x12a5b8[_0x310b('0x1a')]],'as':_0x12a5b8['as'],'attributes':_0x12a5b8[_0x310b('0x17')],'include':_0x12a5b8[_0x310b('0x18')]?_[_0x310b('0x19')](_0x12a5b8[_0x310b('0x18')],function(_0x25179d){return{'model':db[_0x25179d[_0x310b('0x1a')]],'as':_0x25179d['as'],'attributes':_0x25179d[_0x310b('0x17')],'include':_0x25179d['include']?_[_0x310b('0x19')](_0x25179d[_0x310b('0x18')],function(_0x14613b){return{'model':db[_0x14613b[_0x310b('0x1a')]],'as':_0x14613b['as'],'attributes':_0x14613b[_0x310b('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1eeb79){var _0x309bd4=[];for(var _0x3e1c61=0x0;_0x3e1c61<_0x1eeb79[_0x310b('0x41')];_0x3e1c61+=0x1){_0x309bd4['push'](_0x1eeb79[_0x3e1c61][_0x310b('0x23')](_0x469433['body'],{'transaction':_0x5a3c21}));}return BPromise['all'](_0x309bd4);});})[_0x310b('0x9')](function(_0x462581){logger[_0x310b('0xa')](_0x310b('0x3e'),_0x469433);logger[_0x310b('0xd')]('GetContactRecallMe',_0x469433,JSON[_0x310b('0x1f')](_0x462581));_0x5ec031(_0x462581);})[_0x310b('0x12')](function(_0x55a919){logger['error'](_0x310b('0x3e'),_0x55a919['message'],_0x469433);_0xee3b13(_0x521ec3[_0x310b('0xf')](0x1f4,_0x55a919[_0x310b('0x10')]));});});});};exports[_0x310b('0x42')]=function(_0x288a47){var _0x383a04=this;return new Promise(function(_0x423c02,_0x5ca353){db[_0x310b('0x29')]['describe']()[_0x310b('0x9')](function(_0x291b5f){return db[_0x310b('0x14')][_0x310b('0x15')]({'raw':_0x288a47['options']?_0x288a47[_0x310b('0x16')][_0x310b('0x1d')]===undefined?!![]:![]:!![],'where':_0x288a47[_0x310b('0x16')]?_0x288a47[_0x310b('0x16')][_0x310b('0x1e')]||null:null,'attributes':_0x288a47[_0x310b('0x16')]?_0x288a47[_0x310b('0x16')][_0x310b('0x17')]||null:null,'limit':_0x288a47['options']?_0x288a47[_0x310b('0x16')][_0x310b('0x24')]||null:null,'include':_0x288a47[_0x310b('0x16')]?_0x288a47['options']['include']?_['map'](_0x288a47['options'][_0x310b('0x18')],function(_0x5d114b){return{'model':db[_0x5d114b[_0x310b('0x1a')]],'as':_0x5d114b['as'],'attributes':_0x5d114b['as']===_0x310b('0x2d')?_['keys'](_0x291b5f):_0x5d114b['attributes'],'include':_0x5d114b[_0x310b('0x18')]?_[_0x310b('0x19')](_0x5d114b[_0x310b('0x18')],function(_0x8e49f0){return{'model':db[_0x8e49f0[_0x310b('0x1a')]],'as':_0x8e49f0['as'],'attributes':_0x8e49f0['attributes'],'include':_0x8e49f0['include']?_[_0x310b('0x19')](_0x8e49f0[_0x310b('0x18')],function(_0x303ee4){return{'model':db[_0x303ee4[_0x310b('0x1a')]],'as':_0x303ee4['as'],'attributes':_0x303ee4[_0x310b('0x17')]};}):[]};}):[]};}):[]:[]})[_0x310b('0x9')](function(_0x5c8fdf){logger[_0x310b('0xa')](_0x310b('0x13'),_0x288a47);logger[_0x310b('0xd')](_0x310b('0x13'),_0x288a47,JSON['stringify'](_0x5c8fdf));_0x423c02(_0x5c8fdf);})[_0x310b('0x12')](function(_0x18a48e){logger[_0x310b('0xf')](_0x310b('0x13'),_0x18a48e[_0x310b('0x10')],_0x288a47);_0x5ca353(_0x383a04[_0x310b('0xf')](0x1f4,_0x18a48e['message']));});});});}; \ No newline at end of file +var _0x4e80=['length','UserId','push','all','transaction','MoveContactManagedDialer','CountReScheduled','sequelize','COUNT','literal','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','order','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','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','limit','map','include','model','attributes','ShowCmHopper','where','create','body','CreateCmHopper','UpdateCmHopper','update','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','LOCK','UPDATE','Contact','keys','name','voicePause'];(function(_0xca67ed,_0x51c523){var _0x1d43f9=function(_0x2fb29a){while(--_0x2fb29a){_0xca67ed['push'](_0xca67ed['shift']());}};_0x1d43f9(++_0x51c523);}(_0x4e80,0x115));var _0x04e8=function(_0xf231d0,_0x13c159){_0xf231d0=_0xf231d0-0x0;var _0x472a9d=_0x4e80[_0xf231d0];return _0x472a9d;};'use strict';var _=require(_0x04e8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x04e8('0x1'));var rs=require(_0x04e8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x04e8('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x04e8('0x4'))('rpc');var config=require(_0x04e8('0x5'));var jayson=require(_0x04e8('0x6'));var client=jayson['client'][_0x04e8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x330b21,_0x1bec92,_0x74535f){return new BPromise(function(_0x559c13,_0x2c99f9){return client['request'](_0x330b21,_0x74535f)[_0x04e8('0x8')](function(_0x11ec8b){logger[_0x04e8('0x9')](_0x04e8('0xa'),_0x1bec92,_0x04e8('0xb'));logger[_0x04e8('0xc')](_0x04e8('0xd'),_0x1bec92,_0x04e8('0xb'),JSON[_0x04e8('0xe')](_0x11ec8b));if(_0x11ec8b[_0x04e8('0xf')]){if(_0x11ec8b['error'][_0x04e8('0x10')]===0x1f4){logger[_0x04e8('0xf')](_0x04e8('0xa'),_0x1bec92,_0x11ec8b[_0x04e8('0xf')][_0x04e8('0x11')]);return _0x2c99f9(_0x11ec8b[_0x04e8('0xf')][_0x04e8('0x11')]);}logger[_0x04e8('0xf')](_0x04e8('0xa'),_0x1bec92,_0x11ec8b[_0x04e8('0xf')]['message']);return _0x559c13(_0x11ec8b[_0x04e8('0xf')][_0x04e8('0x11')]);}else{logger[_0x04e8('0x9')](_0x04e8('0xa'),_0x1bec92,'request\x20sent');_0x559c13(_0x11ec8b[_0x04e8('0x12')][_0x04e8('0x11')]);}})[_0x04e8('0x13')](function(_0x435097){logger[_0x04e8('0xf')](_0x04e8('0xa'),_0x1bec92,_0x435097);_0x2c99f9(_0x435097);});});}exports[_0x04e8('0x14')]=function(_0x3997a8){var _0x3e6f74=this;return new Promise(function(_0x179e80,_0x1b1bb6){return db[_0x04e8('0x15')][_0x04e8('0x16')]({'raw':_0x3997a8[_0x04e8('0x17')]?_0x3997a8[_0x04e8('0x17')][_0x04e8('0x18')]===undefined?!![]:![]:!![],'where':_0x3997a8[_0x04e8('0x17')]?_0x3997a8[_0x04e8('0x17')]['where']||null:null,'attributes':_0x3997a8[_0x04e8('0x17')]?_0x3997a8[_0x04e8('0x17')]['attributes']||null:null,'limit':_0x3997a8['options']?_0x3997a8['options'][_0x04e8('0x19')]||null:null,'include':_0x3997a8['options']?_0x3997a8[_0x04e8('0x17')]['include']?_[_0x04e8('0x1a')](_0x3997a8[_0x04e8('0x17')][_0x04e8('0x1b')],function(_0x108b3a){return{'model':db[_0x108b3a[_0x04e8('0x1c')]],'as':_0x108b3a['as'],'attributes':_0x108b3a[_0x04e8('0x1d')],'include':_0x108b3a['include']?_[_0x04e8('0x1a')](_0x108b3a['include'],function(_0x35f6f7){return{'model':db[_0x35f6f7['model']],'as':_0x35f6f7['as'],'attributes':_0x35f6f7['attributes'],'include':_0x35f6f7[_0x04e8('0x1b')]?_[_0x04e8('0x1a')](_0x35f6f7['include'],function(_0x4c5f3d){return{'model':db[_0x4c5f3d[_0x04e8('0x1c')]],'as':_0x4c5f3d['as'],'attributes':_0x4c5f3d['attributes']};}):[]};}):[]};}):[]:[]})[_0x04e8('0x8')](function(_0x464ebe){logger['info'](_0x04e8('0x14'),_0x3997a8);logger[_0x04e8('0xc')](_0x04e8('0x14'),_0x3997a8,JSON[_0x04e8('0xe')](_0x464ebe));_0x179e80(_0x464ebe);})[_0x04e8('0x13')](function(_0x1f46c6){logger[_0x04e8('0xf')](_0x04e8('0x14'),_0x1f46c6['message'],_0x3997a8);_0x1b1bb6(_0x3e6f74[_0x04e8('0xf')](0x1f4,_0x1f46c6[_0x04e8('0x11')]));});});};exports[_0x04e8('0x1e')]=function(_0x108088){var _0x40abc8=this;return new Promise(function(_0x5ef4b5,_0x4da885){return db[_0x04e8('0x15')]['find']({'raw':_0x108088[_0x04e8('0x17')]?_0x108088[_0x04e8('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x108088[_0x04e8('0x17')]?_0x108088[_0x04e8('0x17')][_0x04e8('0x1f')]||null:null,'attributes':_0x108088[_0x04e8('0x17')]?_0x108088[_0x04e8('0x17')][_0x04e8('0x1d')]||null:null,'include':_0x108088[_0x04e8('0x17')]?_0x108088[_0x04e8('0x17')][_0x04e8('0x1b')]?_[_0x04e8('0x1a')](_0x108088[_0x04e8('0x17')][_0x04e8('0x1b')],function(_0x5be7c1){return{'model':db[_0x5be7c1[_0x04e8('0x1c')]],'as':_0x5be7c1['as'],'attributes':_0x5be7c1[_0x04e8('0x1d')],'include':_0x5be7c1[_0x04e8('0x1b')]?_['map'](_0x5be7c1['include'],function(_0x1f96b4){return{'model':db[_0x1f96b4['model']],'as':_0x1f96b4['as'],'attributes':_0x1f96b4[_0x04e8('0x1d')],'include':_0x1f96b4[_0x04e8('0x1b')]?_[_0x04e8('0x1a')](_0x1f96b4[_0x04e8('0x1b')],function(_0x332139){return{'model':db[_0x332139[_0x04e8('0x1c')]],'as':_0x332139['as'],'attributes':_0x332139[_0x04e8('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x04e8('0x8')](function(_0x259424){logger[_0x04e8('0x9')](_0x04e8('0x1e'),_0x108088);logger[_0x04e8('0xc')](_0x04e8('0x1e'),_0x108088,JSON['stringify'](_0x259424));_0x5ef4b5(_0x259424);})[_0x04e8('0x13')](function(_0x2babb0){logger['error'](_0x04e8('0x1e'),_0x2babb0[_0x04e8('0x11')],_0x108088);_0x4da885(_0x40abc8[_0x04e8('0xf')](0x1f4,_0x2babb0[_0x04e8('0x11')]));});});};exports['CreateCmHopper']=function(_0x562cc6){var _0x926875=this;return new Promise(function(_0x10323d,_0x2a2450){return db[_0x04e8('0x15')][_0x04e8('0x20')](_0x562cc6[_0x04e8('0x21')],{'raw':_0x562cc6[_0x04e8('0x17')]?_0x562cc6[_0x04e8('0x17')][_0x04e8('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x231796){logger['info'](_0x04e8('0x22'),_0x562cc6);logger[_0x04e8('0xc')]('CreateCmHopper',_0x562cc6,JSON[_0x04e8('0xe')](_0x231796));_0x10323d(_0x231796);})[_0x04e8('0x13')](function(_0x50fdf7){logger[_0x04e8('0xf')](_0x04e8('0x22'),_0x50fdf7[_0x04e8('0x11')],_0x562cc6);_0x2a2450(_0x926875[_0x04e8('0xf')](0x1f4,_0x50fdf7[_0x04e8('0x11')]));});});};exports[_0x04e8('0x23')]=function(_0x517011){var _0x30baae=this;return new Promise(function(_0x416279,_0x283294){return db['CmHopper'][_0x04e8('0x24')](_0x517011[_0x04e8('0x21')],{'raw':_0x517011['options']?_0x517011[_0x04e8('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x517011[_0x04e8('0x17')]?_0x517011['options'][_0x04e8('0x1f')]||null:null,'attributes':_0x517011[_0x04e8('0x17')]?_0x517011['options']['attributes']||null:null,'limit':_0x517011[_0x04e8('0x17')]?_0x517011[_0x04e8('0x17')]['limit']||null:null})[_0x04e8('0x8')](function(_0x4b31c0){logger['info'](_0x04e8('0x23'),_0x517011);logger['debug']('UpdateCmHopper',_0x517011,JSON['stringify'](_0x4b31c0));_0x416279(_0x4b31c0);})['catch'](function(_0x3f87c1){logger[_0x04e8('0xf')](_0x04e8('0x23'),_0x3f87c1[_0x04e8('0x11')],_0x517011);_0x283294(_0x30baae[_0x04e8('0xf')](0x1f4,_0x3f87c1[_0x04e8('0x11')]));});});};exports[_0x04e8('0x25')]=function(_0x10dccd){var _0x165b06=this;return new Promise(function(_0x1c2d58,_0xada182){return db['CmHopper'][_0x04e8('0x26')]({'where':_0x10dccd[_0x04e8('0x17')]?_0x10dccd[_0x04e8('0x17')][_0x04e8('0x1f')]||null:null})[_0x04e8('0x8')](function(_0x4bed14){logger[_0x04e8('0x9')](_0x04e8('0x25'),_0x10dccd);logger[_0x04e8('0xc')](_0x04e8('0x25'),_0x10dccd,JSON[_0x04e8('0xe')](_0x4bed14));_0x1c2d58(_0x4bed14);})[_0x04e8('0x13')](function(_0xae422f){logger[_0x04e8('0xf')](_0x04e8('0x25'),_0xae422f[_0x04e8('0x11')],_0x10dccd);_0xada182(_0x165b06[_0x04e8('0xf')](0x1f4,_0xae422f[_0x04e8('0x11')]));});});};exports[_0x04e8('0x27')]=function(_0x24a758){var _0x5dfa34=this;return new Promise(function(_0x1ff789,_0x2d737c){return db[_0x04e8('0x28')][_0x04e8('0x29')]()[_0x04e8('0x8')](function(_0x1c1141){return db['sequelize']['transaction'](function(_0xa33210){return db[_0x04e8('0x15')][_0x04e8('0x16')]({'where':_0x24a758[_0x04e8('0x17')]?_0x24a758[_0x04e8('0x17')]['where']||null:null,'attributes':_0x24a758['options']?_0x24a758[_0x04e8('0x17')][_0x04e8('0x1d')]||null:null,'limit':_0x24a758[_0x04e8('0x17')]?_0x24a758[_0x04e8('0x17')][_0x04e8('0x19')]||null:null,'order':_0x24a758[_0x04e8('0x17')]?_0x24a758[_0x04e8('0x17')]['order']||null:null,'transaction':_0xa33210,'lock':_0xa33210[_0x04e8('0x2a')][_0x04e8('0x2b')],'include':[{'model':db[_0x04e8('0x28')],'as':_0x04e8('0x2c'),'attributes':_[_0x04e8('0x2d')](_0x1c1141)},{'model':db['User'],'as':'Agent','attributes':['id',_0x04e8('0x2e'),_0x04e8('0x2f')]}]})['then'](function(_0x572ae6){var _0x507e93=[];var _0x584157=[];for(var _0x362677=0x0;_0x362677<_0x572ae6[_0x04e8('0x30')];_0x362677+=0x1){var _0x3cc58e=_0x572ae6[_0x362677][_0x04e8('0x31')];if(_0x3cc58e===null){_0x507e93[_0x04e8('0x32')](_0x572ae6[_0x362677][_0x04e8('0x24')](_0x24a758[_0x04e8('0x21')],{'transaction':_0xa33210}));}else if(!_0x584157['includes'](_0x3cc58e)){_0x584157[_0x04e8('0x32')](_0x3cc58e);_0x507e93[_0x04e8('0x32')](_0x572ae6[_0x362677][_0x04e8('0x24')](_0x24a758[_0x04e8('0x21')],{'transaction':_0xa33210}));}}return BPromise[_0x04e8('0x33')](_0x507e93);});})[_0x04e8('0x8')](function(_0xfaef86){logger[_0x04e8('0x9')](_0x04e8('0x27'),_0x24a758);logger['debug']('GetContactDialer',_0x24a758,JSON[_0x04e8('0xe')](_0xfaef86));_0x1ff789(_0xfaef86);})['catch'](function(_0xefff0e){logger[_0x04e8('0xf')]('GetContactDialer',_0xefff0e['message'],_0x24a758);_0x2d737c(_0x5dfa34[_0x04e8('0xf')](0x1f4,_0xefff0e[_0x04e8('0x11')]));});});});};exports['MoveContactManagedDialer']=function(_0x425cc8){var _0x47a76d=this;return new Promise(function(_0x9c4347,_0x12d2e4){return db['sequelize'][_0x04e8('0x34')](function(_0x47960c){return db['CmHopperFinal'][_0x04e8('0x20')](_0x425cc8[_0x04e8('0x21')],{'raw':_0x425cc8[_0x04e8('0x17')]?_0x425cc8[_0x04e8('0x17')][_0x04e8('0x18')]===undefined?!![]:![]:!![],'transaction':_0x47960c})['then'](function(){return db[_0x04e8('0x15')][_0x04e8('0x26')]({'where':_0x425cc8[_0x04e8('0x17')]?_0x425cc8['options'][_0x04e8('0x1f')]||null:null,'transaction':_0x47960c});});})[_0x04e8('0x8')](function(_0x76f97a){logger[_0x04e8('0x9')]('MoveContactManagedDialer',_0x425cc8);logger[_0x04e8('0xc')](_0x04e8('0x35'),_0x425cc8,JSON[_0x04e8('0xe')](_0x76f97a));_0x9c4347(_0x76f97a);})[_0x04e8('0x13')](function(_0x30cf22){logger[_0x04e8('0xf')](_0x04e8('0x35'),_0x30cf22['message'],_0x425cc8);_0x12d2e4(_0x47a76d[_0x04e8('0xf')](0x1f4,_0x30cf22[_0x04e8('0x11')]));});});};exports[_0x04e8('0x36')]=function(_0x1488e0){var _0x401dc6=this;return new Promise(function(_0x3ff8f8,_0x22aa92){return db[_0x04e8('0x15')][_0x04e8('0x16')]({'raw':_0x1488e0['options']?_0x1488e0[_0x04e8('0x17')][_0x04e8('0x18')]===undefined?!![]:![]:!![],'where':_0x1488e0[_0x04e8('0x17')]?_0x1488e0[_0x04e8('0x17')][_0x04e8('0x1f')]||null:null,'attributes':[[db[_0x04e8('0x37')]['fn'](_0x04e8('0x38'),db[_0x04e8('0x37')]['fn']('IF',db[_0x04e8('0x37')][_0x04e8('0x39')]('`scheduledat`\x20>=\x20'+util[_0x04e8('0x3a')](_0x04e8('0x3b'),moment()[_0x04e8('0x3a')](_0x04e8('0x3c')))+_0x04e8('0x3d')))),_0x04e8('0x3e')]]})[_0x04e8('0x8')](function(_0x1ec622){logger[_0x04e8('0x9')]('CountReScheduled',_0x1488e0);logger[_0x04e8('0xc')](_0x04e8('0x36'),_0x1488e0,JSON[_0x04e8('0xe')](_0x1ec622));_0x3ff8f8(_0x1ec622);})[_0x04e8('0x13')](function(_0x59d5e8){logger['error'](_0x04e8('0x36'),_0x59d5e8[_0x04e8('0x11')],_0x1488e0);_0x22aa92(_0x401dc6[_0x04e8('0xf')](0x1f4,_0x59d5e8['message']));});});};exports[_0x04e8('0x3f')]=function(_0x387b86){var _0x5dd03d=this;return new Promise(function(_0x382db6,_0x362ed8){return db[_0x04e8('0x28')][_0x04e8('0x29')]()[_0x04e8('0x8')](function(_0x44b030){return db[_0x04e8('0x37')][_0x04e8('0x34')](function(_0x21bdd1){return db[_0x04e8('0x15')][_0x04e8('0x16')]({'where':_0x387b86[_0x04e8('0x17')]?_0x387b86[_0x04e8('0x17')]['where']||null:null,'attributes':_0x387b86['options']?_0x387b86[_0x04e8('0x17')][_0x04e8('0x1d')]||null:null,'limit':0x1,'order':_0x387b86[_0x04e8('0x17')]?_0x387b86[_0x04e8('0x17')][_0x04e8('0x40')]||null:null,'group':db[_0x04e8('0x15')][_0x04e8('0x31')],'transaction':_0x21bdd1,'lock':_0x21bdd1[_0x04e8('0x2a')][_0x04e8('0x2b')],'include':_0x387b86[_0x04e8('0x17')]?_0x387b86[_0x04e8('0x17')][_0x04e8('0x1b')]?_[_0x04e8('0x1a')](_0x387b86['options']['include'],function(_0x4b1047){return{'model':db[_0x4b1047['model']],'as':_0x4b1047['as'],'attributes':_0x4b1047[_0x04e8('0x1d')],'include':_0x4b1047[_0x04e8('0x1b')]?_['map'](_0x4b1047['include'],function(_0x633eba){return{'model':db[_0x633eba['model']],'as':_0x633eba['as'],'attributes':_0x633eba[_0x04e8('0x1d')],'include':_0x633eba[_0x04e8('0x1b')]?_[_0x04e8('0x1a')](_0x633eba[_0x04e8('0x1b')],function(_0x7d701d){return{'model':db[_0x7d701d['model']],'as':_0x7d701d['as'],'attributes':_0x7d701d[_0x04e8('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x04e8('0x8')](function(_0x8ad8a3){var _0x3dd622=[];for(var _0x3eb0f5=0x0;_0x3eb0f5<_0x8ad8a3[_0x04e8('0x30')];_0x3eb0f5+=0x1){_0x3dd622[_0x04e8('0x32')](_0x8ad8a3[_0x3eb0f5][_0x04e8('0x24')](_0x387b86[_0x04e8('0x21')],{'transaction':_0x21bdd1}));}return BPromise[_0x04e8('0x33')](_0x3dd622);});})[_0x04e8('0x8')](function(_0x49d1af){logger['info'](_0x04e8('0x3f'),_0x387b86);logger[_0x04e8('0xc')](_0x04e8('0x3f'),_0x387b86,JSON[_0x04e8('0xe')](_0x49d1af));_0x382db6(_0x49d1af);})[_0x04e8('0x13')](function(_0x5e8644){logger[_0x04e8('0xf')](_0x04e8('0x3f'),_0x5e8644[_0x04e8('0x11')],_0x387b86);_0x362ed8(_0x5dd03d[_0x04e8('0xf')](0x1f4,_0x5e8644[_0x04e8('0x11')]));});});});};exports['GetCmHopperPreview']=function(_0x48f340){var _0x2a244b=this;return new Promise(function(_0x355d40,_0x34ace7){db[_0x04e8('0x28')][_0x04e8('0x29')]()[_0x04e8('0x8')](function(_0x407cfe){return db[_0x04e8('0x15')][_0x04e8('0x16')]({'raw':_0x48f340[_0x04e8('0x17')]?_0x48f340['options'][_0x04e8('0x18')]===undefined?!![]:![]:!![],'where':_0x48f340[_0x04e8('0x17')]?_0x48f340['options'][_0x04e8('0x1f')]||null:null,'attributes':_0x48f340[_0x04e8('0x17')]?_0x48f340[_0x04e8('0x17')]['attributes']||null:null,'limit':_0x48f340[_0x04e8('0x17')]?_0x48f340[_0x04e8('0x17')][_0x04e8('0x19')]||null:null,'include':_0x48f340[_0x04e8('0x17')]?_0x48f340[_0x04e8('0x17')]['include']?_['map'](_0x48f340[_0x04e8('0x17')][_0x04e8('0x1b')],function(_0x5ba7ce){return{'model':db[_0x5ba7ce[_0x04e8('0x1c')]],'as':_0x5ba7ce['as'],'attributes':_0x5ba7ce['as']===_0x04e8('0x2c')?_[_0x04e8('0x2d')](_0x407cfe):_0x5ba7ce[_0x04e8('0x1d')],'include':_0x5ba7ce[_0x04e8('0x1b')]?_[_0x04e8('0x1a')](_0x5ba7ce[_0x04e8('0x1b')],function(_0x2a977d){return{'model':db[_0x2a977d[_0x04e8('0x1c')]],'as':_0x2a977d['as'],'attributes':_0x2a977d[_0x04e8('0x1d')],'include':_0x2a977d[_0x04e8('0x1b')]?_['map'](_0x2a977d[_0x04e8('0x1b')],function(_0x1af9c5){return{'model':db[_0x1af9c5[_0x04e8('0x1c')]],'as':_0x1af9c5['as'],'attributes':_0x1af9c5[_0x04e8('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x04e8('0x8')](function(_0x12fa88){logger[_0x04e8('0x9')](_0x04e8('0x14'),_0x48f340);logger[_0x04e8('0xc')](_0x04e8('0x14'),_0x48f340,JSON[_0x04e8('0xe')](_0x12fa88));_0x355d40(_0x12fa88);})[_0x04e8('0x13')](function(_0x427f84){logger[_0x04e8('0xf')]('GetCmHopper',_0x427f84[_0x04e8('0x11')],_0x48f340);_0x34ace7(_0x2a244b[_0x04e8('0xf')](0x1f4,_0x427f84[_0x04e8('0x11')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index ef14c10..5ed9b62 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 _0x6d5c=['../../config/environment','./cmHopper.controller','get','index','/describe','/opencontacts','isAuthenticated','getOpenContacts','/:id','show','create','/preview','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x2c1aa8,_0x3e0609){var _0x4019f5=function(_0x916eac){while(--_0x916eac){_0x2c1aa8['push'](_0x2c1aa8['shift']());}};_0x4019f5(++_0x3e0609);}(_0x6d5c,0x179));var _0xc6d5=function(_0x5c5018,_0x3a20c9){_0x5c5018=_0x5c5018-0x0;var _0x1aab19=_0x6d5c[_0x5c5018];return _0x1aab19;};'use strict';var multer=require(_0xc6d5('0x0'));var util=require(_0xc6d5('0x1'));var path=require(_0xc6d5('0x2'));var timeout=require(_0xc6d5('0x3'));var express=require('express');var router=express[_0xc6d5('0x4')]();var fs_extra=require(_0xc6d5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc6d5('0x6'));var config=require(_0xc6d5('0x7'));var controller=require(_0xc6d5('0x8'));router[_0xc6d5('0x9')]('/',auth['isAuthenticated'](),controller[_0xc6d5('0xa')]);router[_0xc6d5('0x9')](_0xc6d5('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xc6d5('0x9')](_0xc6d5('0xc'),auth[_0xc6d5('0xd')](),controller[_0xc6d5('0xe')]);router[_0xc6d5('0x9')](_0xc6d5('0xf'),auth[_0xc6d5('0xd')](),controller[_0xc6d5('0x10')]);router['post']('/',auth[_0xc6d5('0xd')](),controller[_0xc6d5('0x11')]);router['post'](_0xc6d5('0x12'),auth[_0xc6d5('0xd')](),controller['getPreview']);router[_0xc6d5('0x13')](_0xc6d5('0xf'),auth[_0xc6d5('0xd')](),controller[_0xc6d5('0x14')]);router[_0xc6d5('0x15')]('/:id',auth[_0xc6d5('0xd')](),controller[_0xc6d5('0x16')]);module[_0xc6d5('0x17')]=router; \ No newline at end of file +var _0x0c8d=['/describe','/opencontacts','isAuthenticated','getOpenContacts','/:id','post','create','/preview','getPreview','put','update','delete','destroy','exports','util','path','connect-timeout','../../components/interaction/service','../../config/environment','./cmHopper.controller','index','get'];(function(_0x1695ce,_0xfa80a6){var _0x41e575=function(_0x5d48c8){while(--_0x5d48c8){_0x1695ce['push'](_0x1695ce['shift']());}};_0x41e575(++_0xfa80a6);}(_0x0c8d,0x184));var _0xd0c8=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x0c8d[_0x199572];return _0x13cfa3;};'use strict';var multer=require('multer');var util=require(_0xd0c8('0x0'));var path=require(_0xd0c8('0x1'));var timeout=require(_0xd0c8('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd0c8('0x3'));var config=require(_0xd0c8('0x4'));var controller=require(_0xd0c8('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xd0c8('0x6')]);router[_0xd0c8('0x7')](_0xd0c8('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0xd0c8('0x7')](_0xd0c8('0x9'),auth[_0xd0c8('0xa')](),controller[_0xd0c8('0xb')]);router[_0xd0c8('0x7')](_0xd0c8('0xc'),auth[_0xd0c8('0xa')](),controller['show']);router[_0xd0c8('0xd')]('/',auth['isAuthenticated'](),controller[_0xd0c8('0xe')]);router[_0xd0c8('0xd')](_0xd0c8('0xf'),auth[_0xd0c8('0xa')](),controller[_0xd0c8('0x10')]);router[_0xd0c8('0x11')](_0xd0c8('0xc'),auth[_0xd0c8('0xa')](),controller[_0xd0c8('0x12')]);router[_0xd0c8('0x13')](_0xd0c8('0xc'),auth['isAuthenticated'](),controller[_0xd0c8('0x14')]);module[_0xd0c8('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 7f4e710..3dc87c6 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 _0x8eba=['STRING','INTEGER','contactListQueue','moment','sequelize'];(function(_0x516250,_0x3ae45a){var _0x200b71=function(_0x256c57){while(--_0x256c57){_0x516250['push'](_0x516250['shift']());}};_0x200b71(++_0x3ae45a);}(_0x8eba,0xf3));var _0xa8eb=function(_0x59616b,_0x38e534){_0x59616b=_0x59616b-0x0;var _0x5c4523=_0x8eba[_0x59616b];return _0x5c4523;};'use strict';var moment=require(_0xa8eb('0x0'));var Sequelize=require(_0xa8eb('0x1'));module['exports']={'phone':{'type':Sequelize[_0xa8eb('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xa8eb('0x3')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xa8eb('0x3')],'unique':_0xa8eb('0x4')},'VoiceQueueId':{'type':Sequelize[_0xa8eb('0x3')],'unique':_0xa8eb('0x4')}}; \ No newline at end of file +var _0x26d1=['INTEGER','contactListQueue','moment','exports','STRING'];(function(_0xd691c6,_0x22e908){var _0x249fd0=function(_0x54346a){while(--_0x54346a){_0xd691c6['push'](_0xd691c6['shift']());}};_0x249fd0(++_0x22e908);}(_0x26d1,0x8e));var _0x126d=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x26d1[_0x59ee6f];return _0x4c0979;};'use strict';var moment=require(_0x126d('0x0'));var Sequelize=require('sequelize');module[_0x126d('0x1')]={'phone':{'type':Sequelize[_0x126d('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x126d('0x3')],'unique':_0x126d('0x4')},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0x126d('0x3')],'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 974f002..8e2d896 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 _0x1777=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','index','map','CmHopperBlack','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','type','filter','merge','options','includeAll','include','findAll','rows','catch','length','body','find','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv'];(function(_0xe8bc98,_0x47d61a){var _0x2a293b=function(_0x580240){while(--_0x580240){_0xe8bc98['push'](_0xe8bc98['shift']());}};_0x2a293b(++_0x47d61a);}(_0x1777,0x168));var _0x7177=function(_0xa3f2dc,_0x4e39c2){_0xa3f2dc=_0xa3f2dc-0x0;var _0x18554b=_0x1777[_0xa3f2dc];return _0x18554b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7177('0x0'));var zipdir=require(_0x7177('0x1'));var jsonpatch=require(_0x7177('0x2'));var rp=require(_0x7177('0x3'));var moment=require('moment');var BPromise=require(_0x7177('0x4'));var Mustache=require(_0x7177('0x5'));var util=require(_0x7177('0x6'));var path=require(_0x7177('0x7'));var sox=require(_0x7177('0x8'));var csv=require(_0x7177('0x9'));var ejs=require(_0x7177('0xa'));var fs=require('fs');var fs_extra=require(_0x7177('0xb'));var _=require(_0x7177('0xc'));var squel=require(_0x7177('0xd'));var crypto=require(_0x7177('0xe'));var jsforce=require(_0x7177('0xf'));var deskjs=require(_0x7177('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7177('0x11'));var Redis=require(_0x7177('0x12'));var authService=require(_0x7177('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7177('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7177('0x15'))(_0x7177('0x16'));var utils=require(_0x7177('0x17'));var config=require(_0x7177('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x7177('0x19'))['db'];function respondWithStatusCode(_0xcc5410,_0x157dd3){_0x157dd3=_0x157dd3||0xcc;return function(_0xadaa82){if(_0xadaa82){return _0xcc5410[_0x7177('0x1a')](_0x157dd3);}return _0xcc5410['status'](_0x157dd3)[_0x7177('0x1b')]();};}function respondWithResult(_0x126163,_0x461bad){_0x461bad=_0x461bad||0xc8;return function(_0x248fdf){if(_0x248fdf){return _0x126163[_0x7177('0x1c')](_0x461bad)['json'](_0x248fdf);}};}function respondWithFilteredResult(_0x360394,_0x59373d){return function(_0xaaeb9b){if(_0xaaeb9b){var _0x340195=typeof _0x59373d[_0x7177('0x1d')]===_0x7177('0x1e')&&typeof _0x59373d[_0x7177('0x1f')]===_0x7177('0x1e');var _0x52848f=_0xaaeb9b[_0x7177('0x20')];var _0x43fec1=_0x340195?0x0:_0x59373d[_0x7177('0x1d')];var _0x3a63ed=_0x340195?_0xaaeb9b['count']:_0x59373d[_0x7177('0x1d')]+_0x59373d[_0x7177('0x1f')];var _0x52a73f;if(_0x3a63ed>=_0x52848f){_0x3a63ed=_0x52848f;_0x52a73f=0xc8;}else{_0x52a73f=0xce;}_0x360394['status'](_0x52a73f);return _0x360394['set'](_0x7177('0x21'),_0x43fec1+'-'+_0x3a63ed+'/'+_0x52848f)[_0x7177('0x22')](_0xaaeb9b);}return null;};}function patchUpdates(_0x37eeee){return function(_0x4e8790){try{jsonpatch[_0x7177('0x23')](_0x4e8790,_0x37eeee,!![]);}catch(_0x1ce612){return BPromise[_0x7177('0x24')](_0x1ce612);}return _0x4e8790['save']();};}function saveUpdates(_0x44f575,_0x268133){return function(_0x3673ca){if(_0x3673ca){return _0x3673ca[_0x7177('0x25')](_0x44f575)[_0x7177('0x26')](function(_0x2af79e){return _0x2af79e;});}return null;};}function removeEntity(_0x2d5821,_0xedc5cd){return function(_0x43f698){if(_0x43f698){return _0x43f698[_0x7177('0x27')]()['then'](function(){_0x2d5821[_0x7177('0x1c')](0xcc)[_0x7177('0x1b')]();});}};}function handleEntityNotFound(_0x567059,_0xbacf3e){return function(_0x418880){if(!_0x418880){_0x567059[_0x7177('0x1a')](0x194);}return _0x418880;};}function handleError(_0x25a7f4,_0x3c2d4d){_0x3c2d4d=_0x3c2d4d||0x1f4;return function(_0x188c36){logger[_0x7177('0x28')](_0x188c36[_0x7177('0x29')]);if(_0x188c36['name']){delete _0x188c36[_0x7177('0x2a')];}_0x25a7f4[_0x7177('0x1c')](_0x3c2d4d)['send'](_0x188c36);};}exports[_0x7177('0x2b')]=function(_0x1b652a,_0x26e252){var _0x3377e0={},_0x468a9b={},_0x25a418={'count':0x0,'rows':[]};var _0x577483=_[_0x7177('0x2c')](db[_0x7177('0x2d')][_0x7177('0x2e')],function(_0x3e7f83){return{'name':_0x3e7f83['fieldName'],'type':_0x3e7f83['type'][_0x7177('0x2f')]};});_0x468a9b[_0x7177('0x30')]=_[_0x7177('0x2c')](_0x577483,_0x7177('0x2a'));_0x468a9b[_0x7177('0x31')]=_[_0x7177('0x32')](_0x1b652a[_0x7177('0x31')]);_0x468a9b[_0x7177('0x33')]=_[_0x7177('0x34')](_0x468a9b[_0x7177('0x30')],_0x468a9b[_0x7177('0x31')]);_0x3377e0['attributes']=_['intersection'](_0x468a9b[_0x7177('0x30')],qs[_0x7177('0x35')](_0x1b652a['query'][_0x7177('0x35')]));_0x3377e0[_0x7177('0x36')]=_0x3377e0[_0x7177('0x36')]['length']?_0x3377e0['attributes']:_0x468a9b['model'];if(!_0x1b652a['query'][_0x7177('0x37')](_0x7177('0x38'))){_0x3377e0[_0x7177('0x1f')]=qs[_0x7177('0x1f')](_0x1b652a[_0x7177('0x31')][_0x7177('0x1f')]);_0x3377e0[_0x7177('0x1d')]=qs['offset'](_0x1b652a[_0x7177('0x31')]['offset']);}_0x3377e0[_0x7177('0x39')]=qs['sort'](_0x1b652a[_0x7177('0x31')][_0x7177('0x3a')]);_0x3377e0[_0x7177('0x3b')]=qs[_0x7177('0x33')](_['pick'](_0x1b652a[_0x7177('0x31')],_0x468a9b['filters']),_0x577483);if(_0x1b652a[_0x7177('0x31')]['filter']){_0x3377e0['where']=_['merge'](_0x3377e0[_0x7177('0x3b')],{'$or':_[_0x7177('0x2c')](_0x577483,function(_0x20e2d9){if(_0x20e2d9[_0x7177('0x3c')]!=='VIRTUAL'){var _0x1e4d34={};_0x1e4d34[_0x20e2d9['name']]={'$like':'%'+_0x1b652a[_0x7177('0x31')][_0x7177('0x3d')]+'%'};return _0x1e4d34;}})});}_0x3377e0=_[_0x7177('0x3e')]({},_0x3377e0,_0x1b652a[_0x7177('0x3f')]);var _0xec4fe6={'where':_0x3377e0[_0x7177('0x3b')]};return db[_0x7177('0x2d')][_0x7177('0x20')](_0xec4fe6)[_0x7177('0x26')](function(_0x2f9634){_0x25a418['count']=_0x2f9634;if(_0x1b652a[_0x7177('0x31')][_0x7177('0x40')]){_0x3377e0[_0x7177('0x41')]=[{'all':!![]}];}return db[_0x7177('0x2d')][_0x7177('0x42')](_0x3377e0);})[_0x7177('0x26')](function(_0x5e41f4){_0x25a418[_0x7177('0x43')]=_0x5e41f4;return _0x25a418;})['then'](respondWithFilteredResult(_0x26e252,_0x3377e0))[_0x7177('0x44')](handleError(_0x26e252,null));};exports['show']=function(_0x3a9ddc,_0x3bb84c){var _0x49e277={'raw':!![],'where':{'id':_0x3a9ddc['params']['id']}},_0xd8d92d={};_0xd8d92d[_0x7177('0x30')]=_['keys'](db['CmHopperBlack'][_0x7177('0x2e')]);_0xd8d92d['query']=_['keys'](_0x3a9ddc['query']);_0xd8d92d[_0x7177('0x33')]=_[_0x7177('0x34')](_0xd8d92d[_0x7177('0x30')],_0xd8d92d['query']);_0x49e277['attributes']=_[_0x7177('0x34')](_0xd8d92d[_0x7177('0x30')],qs['fields'](_0x3a9ddc[_0x7177('0x31')]['fields']));_0x49e277['attributes']=_0x49e277[_0x7177('0x36')][_0x7177('0x45')]?_0x49e277[_0x7177('0x36')]:_0xd8d92d['model'];if(_0x3a9ddc[_0x7177('0x31')][_0x7177('0x40')]){_0x49e277['include']=[{'all':!![]}];}_0x49e277=_[_0x7177('0x3e')]({},_0x49e277,_0x3a9ddc[_0x7177('0x3f')]);return db[_0x7177('0x2d')]['find'](_0x49e277)['then'](handleEntityNotFound(_0x3bb84c,null))[_0x7177('0x26')](respondWithResult(_0x3bb84c,null))[_0x7177('0x44')](handleError(_0x3bb84c,null));};exports[_0x7177('0x25')]=function(_0x1c8f7b,_0x37af0b){if(_0x1c8f7b['body']['id']){delete _0x1c8f7b[_0x7177('0x46')]['id'];}return db[_0x7177('0x2d')][_0x7177('0x47')]({'where':{'id':_0x1c8f7b[_0x7177('0x48')]['id']}})[_0x7177('0x26')](handleEntityNotFound(_0x37af0b,null))['then'](saveUpdates(_0x1c8f7b['body'],null))[_0x7177('0x26')](respondWithResult(_0x37af0b,null))[_0x7177('0x44')](handleError(_0x37af0b,null));};exports[_0x7177('0x27')]=function(_0x302d72,_0x14a167){return db[_0x7177('0x2d')][_0x7177('0x47')]({'where':{'id':_0x302d72[_0x7177('0x48')]['id']}})[_0x7177('0x26')](handleEntityNotFound(_0x14a167,null))[_0x7177('0x26')](removeEntity(_0x14a167,null))[_0x7177('0x44')](handleError(_0x14a167,null));};exports[_0x7177('0x49')]=function(_0xe8a8fc,_0x3556d8){return db[_0x7177('0x2d')][_0x7177('0x49')]()[_0x7177('0x26')](respondWithResult(_0x3556d8,null))[_0x7177('0x44')](handleError(_0x3556d8,null));}; \ No newline at end of file +var _0xccbd=['send','map','CmHopperBlack','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','includeAll','include','findAll','show','params','keys','merge','options','catch','body','find','describe','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','update','then','destroy','stack','name'];(function(_0x3d237a,_0x140c2a){var _0x24e44f=function(_0x2c743b){while(--_0x2c743b){_0x3d237a['push'](_0x3d237a['shift']());}};_0x24e44f(++_0x140c2a);}(_0xccbd,0xb2));var _0xdccb=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xccbd[_0x2e4aa2];return _0x5e6092;};'use strict';var emlformat=require(_0xdccb('0x0'));var rimraf=require(_0xdccb('0x1'));var zipdir=require(_0xdccb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xdccb('0x3'));var BPromise=require(_0xdccb('0x4'));var Mustache=require('mustache');var util=require(_0xdccb('0x5'));var path=require(_0xdccb('0x6'));var sox=require(_0xdccb('0x7'));var csv=require(_0xdccb('0x8'));var ejs=require(_0xdccb('0x9'));var fs=require('fs');var fs_extra=require(_0xdccb('0xa'));var _=require(_0xdccb('0xb'));var squel=require(_0xdccb('0xc'));var crypto=require(_0xdccb('0xd'));var jsforce=require(_0xdccb('0xe'));var deskjs=require(_0xdccb('0xf'));var toCsv=require(_0xdccb('0x8'));var querystring=require('querystring');var Papa=require(_0xdccb('0x10'));var Redis=require(_0xdccb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdccb('0x12'));var as=require(_0xdccb('0x13'));var hardwareService=require(_0xdccb('0x14'));var logger=require('../../config/logger')(_0xdccb('0x15'));var utils=require(_0xdccb('0x16'));var config=require(_0xdccb('0x17'));var licenseUtil=require(_0xdccb('0x18'));var db=require(_0xdccb('0x19'))['db'];function respondWithStatusCode(_0x3a506d,_0x426fe0){_0x426fe0=_0x426fe0||0xcc;return function(_0x5b42c9){if(_0x5b42c9){return _0x3a506d[_0xdccb('0x1a')](_0x426fe0);}return _0x3a506d[_0xdccb('0x1b')](_0x426fe0)[_0xdccb('0x1c')]();};}function respondWithResult(_0x3865df,_0x24551b){_0x24551b=_0x24551b||0xc8;return function(_0x4d8a5e){if(_0x4d8a5e){return _0x3865df[_0xdccb('0x1b')](_0x24551b)[_0xdccb('0x1d')](_0x4d8a5e);}};}function respondWithFilteredResult(_0x21b231,_0x2fdd61){return function(_0x30d531){if(_0x30d531){var _0x2836bb=typeof _0x2fdd61[_0xdccb('0x1e')]===_0xdccb('0x1f')&&typeof _0x2fdd61[_0xdccb('0x20')]===_0xdccb('0x1f');var _0x4a110e=_0x30d531[_0xdccb('0x21')];var _0x519a35=_0x2836bb?0x0:_0x2fdd61[_0xdccb('0x1e')];var _0x383c77=_0x2836bb?_0x30d531[_0xdccb('0x21')]:_0x2fdd61[_0xdccb('0x1e')]+_0x2fdd61[_0xdccb('0x20')];var _0x5a6531;if(_0x383c77>=_0x4a110e){_0x383c77=_0x4a110e;_0x5a6531=0xc8;}else{_0x5a6531=0xce;}_0x21b231['status'](_0x5a6531);return _0x21b231['set'](_0xdccb('0x22'),_0x519a35+'-'+_0x383c77+'/'+_0x4a110e)[_0xdccb('0x1d')](_0x30d531);}return null;};}function patchUpdates(_0x318bce){return function(_0x5c8ada){try{jsonpatch[_0xdccb('0x23')](_0x5c8ada,_0x318bce,!![]);}catch(_0x558ea1){return BPromise['reject'](_0x558ea1);}return _0x5c8ada['save']();};}function saveUpdates(_0x3d6747,_0xdfa0ad){return function(_0x24cbca){if(_0x24cbca){return _0x24cbca[_0xdccb('0x24')](_0x3d6747)[_0xdccb('0x25')](function(_0x5c13dd){return _0x5c13dd;});}return null;};}function removeEntity(_0xa25d1d,_0x375c5c){return function(_0x3dd864){if(_0x3dd864){return _0x3dd864[_0xdccb('0x26')]()[_0xdccb('0x25')](function(){_0xa25d1d['status'](0xcc)[_0xdccb('0x1c')]();});}};}function handleEntityNotFound(_0x1e897e,_0x231c60){return function(_0x11077f){if(!_0x11077f){_0x1e897e['sendStatus'](0x194);}return _0x11077f;};}function handleError(_0x28cfc9,_0x25d661){_0x25d661=_0x25d661||0x1f4;return function(_0x230293){logger['error'](_0x230293[_0xdccb('0x27')]);if(_0x230293['name']){delete _0x230293[_0xdccb('0x28')];}_0x28cfc9['status'](_0x25d661)[_0xdccb('0x29')](_0x230293);};}exports['index']=function(_0x3f51fa,_0x5dd0d3){var _0x139f32={},_0x2fc157={},_0x21703c={'count':0x0,'rows':[]};var _0x5ec6f8=_[_0xdccb('0x2a')](db[_0xdccb('0x2b')][_0xdccb('0x2c')],function(_0x37d8c5){return{'name':_0x37d8c5['fieldName'],'type':_0x37d8c5[_0xdccb('0x2d')][_0xdccb('0x2e')]};});_0x2fc157[_0xdccb('0x2f')]=_['map'](_0x5ec6f8,_0xdccb('0x28'));_0x2fc157[_0xdccb('0x30')]=_['keys'](_0x3f51fa[_0xdccb('0x30')]);_0x2fc157[_0xdccb('0x31')]=_[_0xdccb('0x32')](_0x2fc157['model'],_0x2fc157[_0xdccb('0x30')]);_0x139f32[_0xdccb('0x33')]=_[_0xdccb('0x32')](_0x2fc157['model'],qs[_0xdccb('0x34')](_0x3f51fa[_0xdccb('0x30')][_0xdccb('0x34')]));_0x139f32[_0xdccb('0x33')]=_0x139f32[_0xdccb('0x33')][_0xdccb('0x35')]?_0x139f32['attributes']:_0x2fc157[_0xdccb('0x2f')];if(!_0x3f51fa['query'][_0xdccb('0x36')](_0xdccb('0x37'))){_0x139f32['limit']=qs['limit'](_0x3f51fa['query'][_0xdccb('0x20')]);_0x139f32[_0xdccb('0x1e')]=qs[_0xdccb('0x1e')](_0x3f51fa[_0xdccb('0x30')][_0xdccb('0x1e')]);}_0x139f32[_0xdccb('0x38')]=qs[_0xdccb('0x39')](_0x3f51fa[_0xdccb('0x30')][_0xdccb('0x39')]);_0x139f32[_0xdccb('0x3a')]=qs[_0xdccb('0x31')](_[_0xdccb('0x3b')](_0x3f51fa[_0xdccb('0x30')],_0x2fc157[_0xdccb('0x31')]),_0x5ec6f8);if(_0x3f51fa['query'][_0xdccb('0x3c')]){_0x139f32['where']=_['merge'](_0x139f32[_0xdccb('0x3a')],{'$or':_['map'](_0x5ec6f8,function(_0x212a5a){if(_0x212a5a[_0xdccb('0x2d')]!=='VIRTUAL'){var _0x1ba313={};_0x1ba313[_0x212a5a['name']]={'$like':'%'+_0x3f51fa[_0xdccb('0x30')][_0xdccb('0x3c')]+'%'};return _0x1ba313;}})});}_0x139f32=_['merge']({},_0x139f32,_0x3f51fa['options']);var _0x1ba058={'where':_0x139f32[_0xdccb('0x3a')]};return db['CmHopperBlack'][_0xdccb('0x21')](_0x1ba058)[_0xdccb('0x25')](function(_0x10dca7){_0x21703c[_0xdccb('0x21')]=_0x10dca7;if(_0x3f51fa[_0xdccb('0x30')][_0xdccb('0x3d')]){_0x139f32[_0xdccb('0x3e')]=[{'all':!![]}];}return db[_0xdccb('0x2b')][_0xdccb('0x3f')](_0x139f32);})['then'](function(_0x4d8ea4){_0x21703c['rows']=_0x4d8ea4;return _0x21703c;})[_0xdccb('0x25')](respondWithFilteredResult(_0x5dd0d3,_0x139f32))['catch'](handleError(_0x5dd0d3,null));};exports[_0xdccb('0x40')]=function(_0x40225b,_0x351581){var _0x4de8c6={'raw':!![],'where':{'id':_0x40225b[_0xdccb('0x41')]['id']}},_0x2edd7a={};_0x2edd7a[_0xdccb('0x2f')]=_[_0xdccb('0x42')](db[_0xdccb('0x2b')]['rawAttributes']);_0x2edd7a['query']=_[_0xdccb('0x42')](_0x40225b[_0xdccb('0x30')]);_0x2edd7a[_0xdccb('0x31')]=_[_0xdccb('0x32')](_0x2edd7a[_0xdccb('0x2f')],_0x2edd7a[_0xdccb('0x30')]);_0x4de8c6[_0xdccb('0x33')]=_[_0xdccb('0x32')](_0x2edd7a[_0xdccb('0x2f')],qs[_0xdccb('0x34')](_0x40225b[_0xdccb('0x30')]['fields']));_0x4de8c6[_0xdccb('0x33')]=_0x4de8c6[_0xdccb('0x33')][_0xdccb('0x35')]?_0x4de8c6[_0xdccb('0x33')]:_0x2edd7a[_0xdccb('0x2f')];if(_0x40225b[_0xdccb('0x30')][_0xdccb('0x3d')]){_0x4de8c6[_0xdccb('0x3e')]=[{'all':!![]}];}_0x4de8c6=_[_0xdccb('0x43')]({},_0x4de8c6,_0x40225b[_0xdccb('0x44')]);return db[_0xdccb('0x2b')]['find'](_0x4de8c6)[_0xdccb('0x25')](handleEntityNotFound(_0x351581,null))['then'](respondWithResult(_0x351581,null))[_0xdccb('0x45')](handleError(_0x351581,null));};exports[_0xdccb('0x24')]=function(_0x2dfbc5,_0x48f64e){if(_0x2dfbc5[_0xdccb('0x46')]['id']){delete _0x2dfbc5[_0xdccb('0x46')]['id'];}return db[_0xdccb('0x2b')][_0xdccb('0x47')]({'where':{'id':_0x2dfbc5['params']['id']}})[_0xdccb('0x25')](handleEntityNotFound(_0x48f64e,null))['then'](saveUpdates(_0x2dfbc5['body'],null))[_0xdccb('0x25')](respondWithResult(_0x48f64e,null))[_0xdccb('0x45')](handleError(_0x48f64e,null));};exports['destroy']=function(_0x22b264,_0x371c30){return db[_0xdccb('0x2b')][_0xdccb('0x47')]({'where':{'id':_0x22b264[_0xdccb('0x41')]['id']}})[_0xdccb('0x25')](handleEntityNotFound(_0x371c30,null))[_0xdccb('0x25')](removeEntity(_0x371c30,null))[_0xdccb('0x45')](handleError(_0x371c30,null));};exports[_0xdccb('0x48')]=function(_0x237417,_0x3db9ad){return db[_0xdccb('0x2b')][_0xdccb('0x48')]()['then'](respondWithResult(_0x3db9ad,null))['catch'](handleError(_0x3db9ad,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 810892f..56143ab 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 _0x3677=['bluebird','request-promise','path','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','lodash','util','api','moment'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0x3677,0x1b8));var _0x7367=function(_0xb856a4,_0x1e3dc7){_0xb856a4=_0xb856a4-0x0;var _0x2ce5e2=_0x3677[_0xb856a4];return _0x2ce5e2;};'use strict';var _=require(_0x7367('0x0'));var util=require(_0x7367('0x1'));var logger=require('../../config/logger')(_0x7367('0x2'));var moment=require(_0x7367('0x3'));var BPromise=require(_0x7367('0x4'));var rp=require(_0x7367('0x5'));var fs=require('fs');var path=require(_0x7367('0x6'));var rimraf=require('rimraf');var config=require(_0x7367('0x7'));var attributes=require(_0x7367('0x8'));module[_0x7367('0x9')]=function(_0x10f1b3,_0x2299ce){return _0x10f1b3[_0x7367('0xa')](_0x7367('0xb'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x592f=['request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','bluebird'];(function(_0x236286,_0x333397){var _0x1a1f90=function(_0x1e12d5){while(--_0x1e12d5){_0x236286['push'](_0x236286['shift']());}};_0x1a1f90(++_0x333397);}(_0x592f,0x151));var _0xf592=function(_0x3509dd,_0x9b0970){_0x3509dd=_0x3509dd-0x0;var _0x55c374=_0x592f[_0x3509dd];return _0x55c374;};'use strict';var _=require(_0xf592('0x0'));var util=require(_0xf592('0x1'));var logger=require(_0xf592('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf592('0x3'));var rp=require(_0xf592('0x4'));var fs=require('fs');var path=require(_0xf592('0x5'));var rimraf=require(_0xf592('0x6'));var config=require(_0xf592('0x7'));var attributes=require(_0xf592('0x8'));module['exports']=function(_0xd4d485,_0x481275){return _0xd4d485['define'](_0xf592('0x9'),attributes,{'tableName':_0xf592('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 154808f..f0c3939 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 _0xd865=['client','http','request','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','error','code','message','GetCmHopperBlack','findAll','options','limit','include','map','model','attributes','info','stringify','catch','UpdateCmHopperBlack','update','body','raw','where','DestroyCmHopperBlack','destroy','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment'];(function(_0x5e67f4,_0x58bf00){var _0x30b47c=function(_0x3a8523){while(--_0x3a8523){_0x5e67f4['push'](_0x5e67f4['shift']());}};_0x30b47c(++_0x58bf00);}(_0xd865,0x118));var _0x5d86=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd865[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x5d86('0x0'));var util=require(_0x5d86('0x1'));var moment=require(_0x5d86('0x2'));var BPromise=require('bluebird');var rs=require(_0x5d86('0x3'));var fs=require('fs');var Redis=require(_0x5d86('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5d86('0x5'));var logger=require(_0x5d86('0x6'))('rpc');var config=require(_0x5d86('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5d86('0x8')][_0x5d86('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x37daca,_0x3a2e59,_0x3bcf96){return new BPromise(function(_0x59bae2,_0x4d4e14){return client[_0x5d86('0xa')](_0x37daca,_0x3bcf96)[_0x5d86('0xb')](function(_0x1488d4){logger['info'](_0x5d86('0xc'),_0x3a2e59,_0x5d86('0xd'));logger[_0x5d86('0xe')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x3a2e59,'request\x20sent',JSON['stringify'](_0x1488d4));if(_0x1488d4[_0x5d86('0xf')]){if(_0x1488d4[_0x5d86('0xf')][_0x5d86('0x10')]===0x1f4){logger[_0x5d86('0xf')]('CmHopperBlack,\x20%s,\x20%s',_0x3a2e59,_0x1488d4[_0x5d86('0xf')][_0x5d86('0x11')]);return _0x4d4e14(_0x1488d4[_0x5d86('0xf')][_0x5d86('0x11')]);}logger['error'](_0x5d86('0xc'),_0x3a2e59,_0x1488d4[_0x5d86('0xf')]['message']);return _0x59bae2(_0x1488d4[_0x5d86('0xf')][_0x5d86('0x11')]);}else{logger['info']('CmHopperBlack,\x20%s,\x20%s',_0x3a2e59,'request\x20sent');_0x59bae2(_0x1488d4['result'][_0x5d86('0x11')]);}})['catch'](function(_0x13496a){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x3a2e59,_0x13496a);_0x4d4e14(_0x13496a);});});}exports[_0x5d86('0x12')]=function(_0x2fcc0e){var _0x25c91c=this;return new Promise(function(_0x59cc25,_0x3abdac){return db['CmHopperBlack'][_0x5d86('0x13')]({'raw':_0x2fcc0e['options']?_0x2fcc0e[_0x5d86('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x2fcc0e[_0x5d86('0x14')]?_0x2fcc0e['options']['where']||null:null,'attributes':_0x2fcc0e['options']?_0x2fcc0e[_0x5d86('0x14')]['attributes']||null:null,'limit':_0x2fcc0e['options']?_0x2fcc0e[_0x5d86('0x14')][_0x5d86('0x15')]||null:null,'include':_0x2fcc0e[_0x5d86('0x14')]?_0x2fcc0e[_0x5d86('0x14')][_0x5d86('0x16')]?_[_0x5d86('0x17')](_0x2fcc0e[_0x5d86('0x14')][_0x5d86('0x16')],function(_0x1a79fa){return{'model':db[_0x1a79fa[_0x5d86('0x18')]],'as':_0x1a79fa['as'],'attributes':_0x1a79fa['attributes'],'include':_0x1a79fa[_0x5d86('0x16')]?_[_0x5d86('0x17')](_0x1a79fa['include'],function(_0x57e29f){return{'model':db[_0x57e29f[_0x5d86('0x18')]],'as':_0x57e29f['as'],'attributes':_0x57e29f[_0x5d86('0x19')],'include':_0x57e29f['include']?_[_0x5d86('0x17')](_0x57e29f['include'],function(_0x11ca2a){return{'model':db[_0x11ca2a[_0x5d86('0x18')]],'as':_0x11ca2a['as'],'attributes':_0x11ca2a[_0x5d86('0x19')]};}):[]};}):[]};}):[]:[]})[_0x5d86('0xb')](function(_0x2ca2d8){logger[_0x5d86('0x1a')](_0x5d86('0x12'),_0x2fcc0e);logger[_0x5d86('0xe')](_0x5d86('0x12'),_0x2fcc0e,JSON[_0x5d86('0x1b')](_0x2ca2d8));_0x59cc25(_0x2ca2d8);})[_0x5d86('0x1c')](function(_0x2ae38d){logger[_0x5d86('0xf')]('GetCmHopperBlack',_0x2ae38d['message'],_0x2fcc0e);_0x3abdac(_0x25c91c[_0x5d86('0xf')](0x1f4,_0x2ae38d[_0x5d86('0x11')]));});});};exports[_0x5d86('0x1d')]=function(_0x4343ea){var _0x1bf846=this;return new Promise(function(_0x35b751,_0x57e50d){return db['CmHopperBlack'][_0x5d86('0x1e')](_0x4343ea[_0x5d86('0x1f')],{'raw':_0x4343ea[_0x5d86('0x14')]?_0x4343ea[_0x5d86('0x14')][_0x5d86('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4343ea[_0x5d86('0x14')]?_0x4343ea[_0x5d86('0x14')][_0x5d86('0x21')]||null:null,'attributes':_0x4343ea[_0x5d86('0x14')]?_0x4343ea[_0x5d86('0x14')][_0x5d86('0x19')]||null:null,'limit':_0x4343ea[_0x5d86('0x14')]?_0x4343ea[_0x5d86('0x14')][_0x5d86('0x15')]||null:null})[_0x5d86('0xb')](function(_0x5ce5c2){logger[_0x5d86('0x1a')]('UpdateCmHopperBlack',_0x4343ea);logger[_0x5d86('0xe')](_0x5d86('0x1d'),_0x4343ea,JSON['stringify'](_0x5ce5c2));_0x35b751(_0x5ce5c2);})[_0x5d86('0x1c')](function(_0xa58b14){logger[_0x5d86('0xf')](_0x5d86('0x1d'),_0xa58b14[_0x5d86('0x11')],_0x4343ea);_0x57e50d(_0x1bf846['error'](0x1f4,_0xa58b14[_0x5d86('0x11')]));});});};exports[_0x5d86('0x22')]=function(_0x1f66da){var _0xa2b0eb=this;return new Promise(function(_0x2c259d,_0x529156){return db['CmHopperBlack'][_0x5d86('0x23')]({'where':_0x1f66da[_0x5d86('0x14')]?_0x1f66da['options'][_0x5d86('0x21')]||null:null})[_0x5d86('0xb')](function(_0x21dfc3){logger[_0x5d86('0x1a')](_0x5d86('0x22'),_0x1f66da);logger['debug'](_0x5d86('0x22'),_0x1f66da,JSON[_0x5d86('0x1b')](_0x21dfc3));_0x2c259d(_0x21dfc3);})[_0x5d86('0x1c')](function(_0x4d753f){logger[_0x5d86('0xf')](_0x5d86('0x22'),_0x4d753f[_0x5d86('0x11')],_0x1f66da);_0x529156(_0xa2b0eb[_0x5d86('0xf')](0x1f4,_0x4d753f[_0x5d86('0x11')]));});});}; \ No newline at end of file +var _0x02a2=['rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code','message','CmHopperBlack,\x20%s,\x20%s','info','catch','CmHopperBlack','findAll','options','where','attributes','include','map','model','GetCmHopperBlack','update','raw','limit','UpdateCmHopperBlack','DestroyCmHopperBlack','destroy','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x02a2,0x191));var _0x202a=function(_0xe8fb87,_0x597079){_0xe8fb87=_0xe8fb87-0x0;var _0x118b05=_0x02a2[_0xe8fb87];return _0x118b05;};'use strict';var _=require(_0x202a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x202a('0x1'));var rs=require(_0x202a('0x2'));var fs=require('fs');var Redis=require(_0x202a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x202a('0x4'));var logger=require(_0x202a('0x5'))(_0x202a('0x6'));var config=require(_0x202a('0x7'));var jayson=require(_0x202a('0x8'));var client=jayson[_0x202a('0x9')][_0x202a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22d3cc,_0x4b9890,_0x32364d){return new BPromise(function(_0x156627,_0x2b2fc0){return client[_0x202a('0xb')](_0x22d3cc,_0x32364d)[_0x202a('0xc')](function(_0x2478d3){logger['info']('CmHopperBlack,\x20%s,\x20%s',_0x4b9890,_0x202a('0xd'));logger[_0x202a('0xe')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x4b9890,_0x202a('0xd'),JSON[_0x202a('0xf')](_0x2478d3));if(_0x2478d3[_0x202a('0x10')]){if(_0x2478d3['error'][_0x202a('0x11')]===0x1f4){logger[_0x202a('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x4b9890,_0x2478d3['error'][_0x202a('0x12')]);return _0x2b2fc0(_0x2478d3[_0x202a('0x10')][_0x202a('0x12')]);}logger[_0x202a('0x10')](_0x202a('0x13'),_0x4b9890,_0x2478d3[_0x202a('0x10')]['message']);return _0x156627(_0x2478d3[_0x202a('0x10')][_0x202a('0x12')]);}else{logger[_0x202a('0x14')]('CmHopperBlack,\x20%s,\x20%s',_0x4b9890,_0x202a('0xd'));_0x156627(_0x2478d3['result'][_0x202a('0x12')]);}})[_0x202a('0x15')](function(_0x46eae1){logger[_0x202a('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x4b9890,_0x46eae1);_0x2b2fc0(_0x46eae1);});});}exports['GetCmHopperBlack']=function(_0x1fe522){var _0x3f306f=this;return new Promise(function(_0x381bbb,_0x583020){return db[_0x202a('0x16')][_0x202a('0x17')]({'raw':_0x1fe522[_0x202a('0x18')]?_0x1fe522[_0x202a('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1fe522['options']?_0x1fe522[_0x202a('0x18')][_0x202a('0x19')]||null:null,'attributes':_0x1fe522[_0x202a('0x18')]?_0x1fe522[_0x202a('0x18')][_0x202a('0x1a')]||null:null,'limit':_0x1fe522['options']?_0x1fe522['options']['limit']||null:null,'include':_0x1fe522[_0x202a('0x18')]?_0x1fe522[_0x202a('0x18')][_0x202a('0x1b')]?_[_0x202a('0x1c')](_0x1fe522[_0x202a('0x18')][_0x202a('0x1b')],function(_0x24a174){return{'model':db[_0x24a174['model']],'as':_0x24a174['as'],'attributes':_0x24a174[_0x202a('0x1a')],'include':_0x24a174[_0x202a('0x1b')]?_[_0x202a('0x1c')](_0x24a174['include'],function(_0x5143cb){return{'model':db[_0x5143cb['model']],'as':_0x5143cb['as'],'attributes':_0x5143cb['attributes'],'include':_0x5143cb[_0x202a('0x1b')]?_[_0x202a('0x1c')](_0x5143cb[_0x202a('0x1b')],function(_0x24d0a1){return{'model':db[_0x24d0a1[_0x202a('0x1d')]],'as':_0x24d0a1['as'],'attributes':_0x24d0a1['attributes']};}):[]};}):[]};}):[]:[]})[_0x202a('0xc')](function(_0x416993){logger[_0x202a('0x14')]('GetCmHopperBlack',_0x1fe522);logger[_0x202a('0xe')](_0x202a('0x1e'),_0x1fe522,JSON['stringify'](_0x416993));_0x381bbb(_0x416993);})[_0x202a('0x15')](function(_0x5ec506){logger[_0x202a('0x10')](_0x202a('0x1e'),_0x5ec506[_0x202a('0x12')],_0x1fe522);_0x583020(_0x3f306f[_0x202a('0x10')](0x1f4,_0x5ec506[_0x202a('0x12')]));});});};exports['UpdateCmHopperBlack']=function(_0x449475){var _0x4ed50d=this;return new Promise(function(_0x4169a9,_0x1ad9e9){return db['CmHopperBlack'][_0x202a('0x1f')](_0x449475['body'],{'raw':_0x449475[_0x202a('0x18')]?_0x449475['options'][_0x202a('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x449475[_0x202a('0x18')]?_0x449475[_0x202a('0x18')][_0x202a('0x19')]||null:null,'attributes':_0x449475[_0x202a('0x18')]?_0x449475['options'][_0x202a('0x1a')]||null:null,'limit':_0x449475[_0x202a('0x18')]?_0x449475[_0x202a('0x18')][_0x202a('0x21')]||null:null})['then'](function(_0x46aa01){logger[_0x202a('0x14')](_0x202a('0x22'),_0x449475);logger[_0x202a('0xe')](_0x202a('0x22'),_0x449475,JSON[_0x202a('0xf')](_0x46aa01));_0x4169a9(_0x46aa01);})[_0x202a('0x15')](function(_0x3cb3b3){logger[_0x202a('0x10')](_0x202a('0x22'),_0x3cb3b3['message'],_0x449475);_0x1ad9e9(_0x4ed50d[_0x202a('0x10')](0x1f4,_0x3cb3b3[_0x202a('0x12')]));});});};exports[_0x202a('0x23')]=function(_0x1063c4){var _0x24ef3c=this;return new Promise(function(_0x131b42,_0x3cb887){return db['CmHopperBlack'][_0x202a('0x24')]({'where':_0x1063c4[_0x202a('0x18')]?_0x1063c4[_0x202a('0x18')][_0x202a('0x19')]||null:null})[_0x202a('0xc')](function(_0x495316){logger['info']('DestroyCmHopperBlack',_0x1063c4);logger['debug'](_0x202a('0x23'),_0x1063c4,JSON[_0x202a('0xf')](_0x495316));_0x131b42(_0x495316);})[_0x202a('0x15')](function(_0x1de85e){logger[_0x202a('0x10')]('DestroyCmHopperBlack',_0x1de85e[_0x202a('0x12')],_0x1063c4);_0x3cb887(_0x24ef3c[_0x202a('0x10')](0x1f4,_0x1de85e[_0x202a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 01bf8c6..785555d 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 _0x4fb4=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','show','put','/:id','update','delete','destroy'];(function(_0x1890a8,_0x42a2b2){var _0x420c6d=function(_0x2baa82){while(--_0x2baa82){_0x1890a8['push'](_0x1890a8['shift']());}};_0x420c6d(++_0x42a2b2);}(_0x4fb4,0x190));var _0x44fb=function(_0xaf782e,_0x27cb93){_0xaf782e=_0xaf782e-0x0;var _0x1d2c8b=_0x4fb4[_0xaf782e];return _0x1d2c8b;};'use strict';var multer=require('multer');var util=require(_0x44fb('0x0'));var path=require(_0x44fb('0x1'));var timeout=require(_0x44fb('0x2'));var express=require(_0x44fb('0x3'));var router=express[_0x44fb('0x4')]();var fs_extra=require(_0x44fb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x44fb('0x6'));var config=require(_0x44fb('0x7'));var controller=require(_0x44fb('0x8'));router[_0x44fb('0x9')]('/',auth[_0x44fb('0xa')](),controller[_0x44fb('0xb')]);router[_0x44fb('0x9')](_0x44fb('0xc'),auth['isAuthenticated'](),controller[_0x44fb('0xd')]);router[_0x44fb('0x9')]('/:id',auth[_0x44fb('0xa')](),controller[_0x44fb('0xe')]);router[_0x44fb('0xf')](_0x44fb('0x10'),auth[_0x44fb('0xa')](),controller[_0x44fb('0x11')]);router[_0x44fb('0x12')](_0x44fb('0x10'),auth[_0x44fb('0xa')](),controller[_0x44fb('0x13')]);module['exports']=router; \ No newline at end of file +var _0xdf55=['../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id','show','delete','exports','multer','util','connect-timeout','express','fs-extra'];(function(_0x63e59d,_0x1696a7){var _0x5f4893=function(_0x351c15){while(--_0x351c15){_0x63e59d['push'](_0x63e59d['shift']());}};_0x5f4893(++_0x1696a7);}(_0xdf55,0x83));var _0x5df5=function(_0x4f8100,_0x928620){_0x4f8100=_0x4f8100-0x0;var _0x360262=_0xdf55[_0x4f8100];return _0x360262;};'use strict';var multer=require(_0x5df5('0x0'));var util=require(_0x5df5('0x1'));var path=require('path');var timeout=require(_0x5df5('0x2'));var express=require(_0x5df5('0x3'));var router=express['Router']();var fs_extra=require(_0x5df5('0x4'));var auth=require(_0x5df5('0x5'));var interaction=require(_0x5df5('0x6'));var config=require('../../config/environment');var controller=require(_0x5df5('0x7'));router[_0x5df5('0x8')]('/',auth[_0x5df5('0x9')](),controller[_0x5df5('0xa')]);router[_0x5df5('0x8')](_0x5df5('0xb'),auth[_0x5df5('0x9')](),controller[_0x5df5('0xc')]);router['get'](_0x5df5('0xd'),auth[_0x5df5('0x9')](),controller[_0x5df5('0xe')]);router['put']('/:id',auth[_0x5df5('0x9')](),controller['update']);router[_0x5df5('0xf')](_0x5df5('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x5df5('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 9d242c8..cd4a305 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 _0xfed8=['getDataValue','endtime','diff','seconds','dispositionat','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE'];(function(_0x52e7dc,_0x20c695){var _0x298883=function(_0x41bc43){while(--_0x41bc43){_0x52e7dc['push'](_0x52e7dc['shift']());}};_0x298883(++_0x20c695);}(_0xfed8,0x102));var _0x8fed=function(_0x5aed40,_0x46e37f){_0x5aed40=_0x5aed40-0x0;var _0x5aa0b4=_0xfed8[_0x5aed40];return _0x5aa0b4;};'use strict';var Sequelize=require(_0x8fed('0x0'));var moment=require(_0x8fed('0x1'));module[_0x8fed('0x2')]={'state':{'type':Sequelize[_0x8fed('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x8fed('0x4')]},'scheduledat':{'type':Sequelize[_0x8fed('0x5')]},'countbusyretry':{'type':Sequelize[_0x8fed('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x8fed('0x4')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x8fed('0x4')]},'calleridname':{'type':Sequelize[_0x8fed('0x4')]},'starttime':{'type':Sequelize[_0x8fed('0x5')]},'responsetime':{'type':Sequelize[_0x8fed('0x5')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x8fed('0x5')]},'endtime':{'type':Sequelize[_0x8fed('0x5')]},'ringtime':{'type':Sequelize[_0x8fed('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x8fed('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x8fed('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x8fed('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x8fed('0x4')]},'campaigntype':{'type':Sequelize[_0x8fed('0x4')]},'membername':{'type':Sequelize[_0x8fed('0x4')]},'reason':{'type':Sequelize[_0x8fed('0x4')]},'disposition':{'type':Sequelize[_0x8fed('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x8fed('0x4')]},'dispositionat':{'type':Sequelize[_0x8fed('0x5')],'set':function(_0x4a6301){var _0x203121=this[_0x8fed('0x6')](_0x8fed('0x7'));if(_0x203121&&_0x4a6301){this['setDataValue']('followuptime',moment(_0x4a6301)[_0x8fed('0x8')](moment(_0x203121),_0x8fed('0x9')));}return this['setDataValue'](_0x8fed('0xa'),_0x4a6301);}},'amd':{'type':Sequelize[_0x8fed('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0x8fed('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x8fed('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x8fed('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x8fed('0x5')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8fed('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x8fed('0x5')]},'deleted':{'type':Sequelize[_0x8fed('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x8fed('0x5')]},'recallme':{'type':Sequelize[_0x8fed('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x8fed('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x8fed('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x8fed('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x8fed('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x8fed('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x20c1=['setDataValue','diff','seconds','BOOLEAN','moment','exports','INTEGER','STRING','DATE','getDataValue','endtime'];(function(_0x151d9d,_0x577d53){var _0x2e75df=function(_0x37b200){while(--_0x37b200){_0x151d9d['push'](_0x151d9d['shift']());}};_0x2e75df(++_0x577d53);}(_0x20c1,0xeb));var _0x120c=function(_0x4bbd25,_0x322268){_0x4bbd25=_0x4bbd25-0x0;var _0x5d3d83=_0x20c1[_0x4bbd25];return _0x5d3d83;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x120c('0x0'));module[_0x120c('0x1')]={'state':{'type':Sequelize[_0x120c('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x120c('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x120c('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x120c('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x120c('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x120c('0x3')]},'originatecalleridname':{'type':Sequelize[_0x120c('0x3')]},'calleridnum':{'type':Sequelize[_0x120c('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x120c('0x4')]},'responsetime':{'type':Sequelize[_0x120c('0x4')]},'answertime':{'type':Sequelize[_0x120c('0x4')]},'droptime':{'type':Sequelize[_0x120c('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x120c('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x120c('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x120c('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x120c('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x120c('0x3')]},'reason':{'type':Sequelize[_0x120c('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x120c('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x120c('0x4')],'set':function(_0x57849c){var _0x23ded3=this[_0x120c('0x5')](_0x120c('0x6'));if(_0x23ded3&&_0x57849c){this[_0x120c('0x7')]('followuptime',moment(_0x57849c)[_0x120c('0x8')](moment(_0x23ded3),_0x120c('0x9')));}return this[_0x120c('0x7')]('dispositionat',_0x57849c);}},'amd':{'type':Sequelize[_0x120c('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0x120c('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x120c('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x120c('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x120c('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x120c('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x120c('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x120c('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x120c('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x120c('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 1873193..3883aad 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 _0x71ab=['json','offset','undefined','limit','count','set','reject','update','then','destroy','error','stack','name','send','index','map','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','CmHopperFinal','findAll','rows','catch','show','params','rawAttributes','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','`state`\x20=\x203,\x201,\x20null','dropContacts','VoiceQueue','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','VoiceQueueId','from','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','CampaignId','state','CampaignId\x20=\x20?','calleridnum','checkContactHopper','CmHopper','findOne','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x33690a,_0x3b73fc){var _0x16b5bd=function(_0x3a2d26){while(--_0x3a2d26){_0x33690a['push'](_0x33690a['shift']());}};_0x16b5bd(++_0x3b73fc);}(_0x71ab,0x64));var _0xb71a=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x71ab[_0x465028];return _0xb783d4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb71a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb71a('0x1'));var rp=require('request-promise');var moment=require(_0xb71a('0x2'));var BPromise=require(_0xb71a('0x3'));var Mustache=require(_0xb71a('0x4'));var util=require(_0xb71a('0x5'));var path=require(_0xb71a('0x6'));var sox=require(_0xb71a('0x7'));var csv=require(_0xb71a('0x8'));var ejs=require(_0xb71a('0x9'));var fs=require('fs');var fs_extra=require(_0xb71a('0xa'));var _=require(_0xb71a('0xb'));var squel=require(_0xb71a('0xc'));var crypto=require(_0xb71a('0xd'));var jsforce=require(_0xb71a('0xe'));var deskjs=require(_0xb71a('0xf'));var toCsv=require(_0xb71a('0x8'));var querystring=require(_0xb71a('0x10'));var Papa=require(_0xb71a('0x11'));var Redis=require(_0xb71a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb71a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb71a('0x14'));var logger=require(_0xb71a('0x15'))(_0xb71a('0x16'));var utils=require('../../config/utils');var config=require(_0xb71a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb71a('0x18'))['db'];function respondWithStatusCode(_0x50030d,_0x50b43b){_0x50b43b=_0x50b43b||0xcc;return function(_0x3346a5){if(_0x3346a5){return _0x50030d[_0xb71a('0x19')](_0x50b43b);}return _0x50030d[_0xb71a('0x1a')](_0x50b43b)[_0xb71a('0x1b')]();};}function respondWithResult(_0x483d77,_0x47ee48){_0x47ee48=_0x47ee48||0xc8;return function(_0x5364e3){if(_0x5364e3){return _0x483d77[_0xb71a('0x1a')](_0x47ee48)[_0xb71a('0x1c')](_0x5364e3);}};}function respondWithFilteredResult(_0x15252a,_0x42fc55){return function(_0x3cd0f0){if(_0x3cd0f0){var _0x1e9363=typeof _0x42fc55[_0xb71a('0x1d')]===_0xb71a('0x1e')&&typeof _0x42fc55[_0xb71a('0x1f')]==='undefined';var _0x1ca65e=_0x3cd0f0[_0xb71a('0x20')];var _0x374c8c=_0x1e9363?0x0:_0x42fc55[_0xb71a('0x1d')];var _0x2bdb61=_0x1e9363?_0x3cd0f0[_0xb71a('0x20')]:_0x42fc55[_0xb71a('0x1d')]+_0x42fc55[_0xb71a('0x1f')];var _0x20bdfe;if(_0x2bdb61>=_0x1ca65e){_0x2bdb61=_0x1ca65e;_0x20bdfe=0xc8;}else{_0x20bdfe=0xce;}_0x15252a[_0xb71a('0x1a')](_0x20bdfe);return _0x15252a[_0xb71a('0x21')]('Content-Range',_0x374c8c+'-'+_0x2bdb61+'/'+_0x1ca65e)['json'](_0x3cd0f0);}return null;};}function patchUpdates(_0x1358f2){return function(_0x578fe4){try{jsonpatch['apply'](_0x578fe4,_0x1358f2,!![]);}catch(_0x4d8871){return BPromise[_0xb71a('0x22')](_0x4d8871);}return _0x578fe4['save']();};}function saveUpdates(_0x76d6dc,_0x4227c7){return function(_0x3ac77b){if(_0x3ac77b){return _0x3ac77b[_0xb71a('0x23')](_0x76d6dc)[_0xb71a('0x24')](function(_0x14b2a1){return _0x14b2a1;});}return null;};}function removeEntity(_0x2f4fac,_0x14aac7){return function(_0x5f3f19){if(_0x5f3f19){return _0x5f3f19[_0xb71a('0x25')]()[_0xb71a('0x24')](function(){_0x2f4fac[_0xb71a('0x1a')](0xcc)[_0xb71a('0x1b')]();});}};}function handleEntityNotFound(_0x3401f7,_0x1a010d){return function(_0x20ed75){if(!_0x20ed75){_0x3401f7[_0xb71a('0x19')](0x194);}return _0x20ed75;};}function handleError(_0x31085b,_0x2a847a){_0x2a847a=_0x2a847a||0x1f4;return function(_0x45b849){logger[_0xb71a('0x26')](_0x45b849[_0xb71a('0x27')]);if(_0x45b849['name']){delete _0x45b849[_0xb71a('0x28')];}_0x31085b[_0xb71a('0x1a')](_0x2a847a)[_0xb71a('0x29')](_0x45b849);};}exports[_0xb71a('0x2a')]=function(_0x2fbd73,_0x38178c){var _0x44826e={},_0x25364c={},_0x42c086={'count':0x0,'rows':[]};var _0x421fcf=_[_0xb71a('0x2b')](db['CmHopperFinal']['rawAttributes'],function(_0x3112d3){return{'name':_0x3112d3['fieldName'],'type':_0x3112d3[_0xb71a('0x2c')][_0xb71a('0x2d')]};});_0x25364c['model']=_[_0xb71a('0x2b')](_0x421fcf,_0xb71a('0x28'));_0x25364c[_0xb71a('0x2e')]=_[_0xb71a('0x2f')](_0x2fbd73[_0xb71a('0x2e')]);_0x25364c[_0xb71a('0x30')]=_['intersection'](_0x25364c[_0xb71a('0x31')],_0x25364c[_0xb71a('0x2e')]);_0x44826e[_0xb71a('0x32')]=_[_0xb71a('0x33')](_0x25364c['model'],qs[_0xb71a('0x34')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x34')]));_0x44826e[_0xb71a('0x32')]=_0x44826e[_0xb71a('0x32')][_0xb71a('0x35')]?_0x44826e[_0xb71a('0x32')]:_0x25364c[_0xb71a('0x31')];if(!_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x36')]('nolimit')){_0x44826e['limit']=qs[_0xb71a('0x1f')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x1f')]);_0x44826e[_0xb71a('0x1d')]=qs[_0xb71a('0x1d')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x1d')]);}_0x44826e['order']=qs[_0xb71a('0x37')](_0x2fbd73['query'][_0xb71a('0x37')]);_0x44826e[_0xb71a('0x38')]=qs[_0xb71a('0x30')](_[_0xb71a('0x39')](_0x2fbd73['query'],_0x25364c[_0xb71a('0x30')]),_0x421fcf);if(_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3a')]){_0x44826e[_0xb71a('0x38')]=_[_0xb71a('0x3b')](_0x44826e[_0xb71a('0x38')],{'$or':_[_0xb71a('0x2b')](_0x421fcf,function(_0x2756b9){if(_0x2756b9[_0xb71a('0x2c')]!=='VIRTUAL'){var _0x24a3af={};_0x24a3af[_0x2756b9['name']]={'$like':'%'+_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3a')]+'%'};return _0x24a3af;}})});}_0x44826e=_[_0xb71a('0x3b')]({},_0x44826e,_0x2fbd73[_0xb71a('0x3c')]);var _0xce7b8a={'where':_0x44826e[_0xb71a('0x38')]};return db['CmHopperFinal']['count'](_0xce7b8a)['then'](function(_0x35fea9){_0x42c086['count']=_0x35fea9;if(_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3d')]){_0x44826e[_0xb71a('0x3e')]=[{'all':!![]}];}return db[_0xb71a('0x3f')][_0xb71a('0x40')](_0x44826e);})[_0xb71a('0x24')](function(_0x59530a){_0x42c086[_0xb71a('0x41')]=_0x59530a;return _0x42c086;})[_0xb71a('0x24')](respondWithFilteredResult(_0x38178c,_0x44826e))[_0xb71a('0x42')](handleError(_0x38178c,null));};exports[_0xb71a('0x43')]=function(_0x7d305,_0x2f08d2){var _0x55cbca={'raw':!![],'where':{'id':_0x7d305[_0xb71a('0x44')]['id']}},_0x2afff3={};_0x2afff3[_0xb71a('0x31')]=_[_0xb71a('0x2f')](db[_0xb71a('0x3f')][_0xb71a('0x45')]);_0x2afff3[_0xb71a('0x2e')]=_['keys'](_0x7d305['query']);_0x2afff3[_0xb71a('0x30')]=_[_0xb71a('0x33')](_0x2afff3[_0xb71a('0x31')],_0x2afff3[_0xb71a('0x2e')]);_0x55cbca['attributes']=_[_0xb71a('0x33')](_0x2afff3['model'],qs[_0xb71a('0x34')](_0x7d305[_0xb71a('0x2e')]['fields']));_0x55cbca[_0xb71a('0x32')]=_0x55cbca[_0xb71a('0x32')][_0xb71a('0x35')]?_0x55cbca[_0xb71a('0x32')]:_0x2afff3['model'];if(_0x7d305[_0xb71a('0x2e')][_0xb71a('0x3d')]){_0x55cbca[_0xb71a('0x3e')]=[{'all':!![]}];}_0x55cbca=_['merge']({},_0x55cbca,_0x7d305[_0xb71a('0x3c')]);return db[_0xb71a('0x3f')][_0xb71a('0x46')](_0x55cbca)['then'](handleEntityNotFound(_0x2f08d2,null))[_0xb71a('0x24')](respondWithResult(_0x2f08d2,null))[_0xb71a('0x42')](handleError(_0x2f08d2,null));};exports[_0xb71a('0x47')]=function(_0x1f29b7,_0x365bed){return db['CmHopperFinal'][_0xb71a('0x47')]()[_0xb71a('0x24')](respondWithResult(_0x365bed,null))[_0xb71a('0x42')](handleError(_0x365bed,null));};exports[_0xb71a('0x23')]=function(_0x489c1f,_0x48fbde){if(_0x489c1f[_0xb71a('0x48')][_0xb71a('0x49')]){delete _0x489c1f[_0xb71a('0x48')][_0xb71a('0x49')];}return db[_0xb71a('0x3f')][_0xb71a('0x46')]({'where':{'uniqueid':_0x489c1f[_0xb71a('0x44')]['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x48fbde,null))[_0xb71a('0x24')](saveUpdates(_0x489c1f[_0xb71a('0x48')],null))['then'](respondWithResult(_0x48fbde,null))[_0xb71a('0x42')](handleError(_0x48fbde,null));};exports[_0xb71a('0x4a')]=function(_0x500196,_0x1c0536,_0x58116c){return db[_0xb71a('0x3f')][_0xb71a('0x40')]({'raw':![],'where':{'VoiceQueueId':_0x500196[_0xb71a('0x44')]['id']},'attributes':[[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x4d')))),_0xb71a('0x4e')],[db['sequelize']['fn']('COUNT',db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal']('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0xb71a('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x50')))),_0xb71a('0x51')],[db['sequelize']['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x52')))),_0xb71a('0x53')],[db['sequelize']['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x54')))),'dropContacts'],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x55')))),_0xb71a('0x56')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize']['literal'](_0xb71a('0x57')))),_0xb71a('0x58')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize']['literal'](_0xb71a('0x59')))),_0xb71a('0x5a')]]})['then'](handleEntityNotFound(_0x1c0536,null))[_0xb71a('0x24')](respondWithResult(_0x1c0536,null))[_0xb71a('0x42')](handleError(_0x1c0536,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x181a9f,_0xe55672,_0x38de3a){return db[_0xb71a('0x3f')]['findAll']({'raw':![],'where':{'CampaignId':_0x181a9f[_0xb71a('0x44')]['id']},'attributes':[[db[_0xb71a('0x4b')]['fn']('COUNT',db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x4d')))),_0xb71a('0x4e')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize'][_0xb71a('0x4f')](_0xb71a('0x5b')))),'noAnswerContacts'],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x50')))),_0xb71a('0x51')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db['sequelize'][_0xb71a('0x4f')](_0xb71a('0x52')))),_0xb71a('0x53')],[db['sequelize']['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xb71a('0x5c')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x55')))),'abandonedContacts'],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize']['literal'](_0xb71a('0x57')))),_0xb71a('0x58')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize'][_0xb71a('0x4f')](_0xb71a('0x59')))),_0xb71a('0x5a')]]})[_0xb71a('0x24')](handleEntityNotFound(_0xe55672,null))[_0xb71a('0x24')](respondWithResult(_0xe55672,null))['catch'](handleError(_0xe55672,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x15b8be,_0x2dd470,_0x38a8a1){return db[_0xb71a('0x5d')][_0xb71a('0x46')]({'where':{'id':_0x15b8be[_0xb71a('0x44')]['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x2dd470,null))['then'](function(_0x45f4b2){var _0x27c15e;if(_0x45f4b2){_0x27c15e=squel['insert']()[_0xb71a('0x5e')](_0xb71a('0x5f'))[_0xb71a('0x60')](['phone',_0xb71a('0x61'),_0xb71a('0x62'),_0xb71a('0x63'),'VoiceQueueId',_0xb71a('0x64'),_0xb71a('0x65')],squel[_0xb71a('0x66')]()[_0xb71a('0x67')](_0xb71a('0x68'),_0xb71a('0x69'))[_0xb71a('0x67')](_0xb71a('0x6a'),'scheduledAt')[_0xb71a('0x67')](_0xb71a('0x6b'),_0xb71a('0x62'))[_0xb71a('0x67')](_0xb71a('0x6c'),_0xb71a('0x63'))[_0xb71a('0x67')]('ANY_VALUE(VoiceQueueId)',_0xb71a('0x6d'))['field'](_0xb71a('0x6a'),_0xb71a('0x64'))['field'](_0xb71a('0x6a'),'updatedAt')[_0xb71a('0x6e')]('cm_hopper_final')[_0xb71a('0x38')](_0xb71a('0x6f'),_0x15b8be[_0xb71a('0x44')]['id'][_0xb71a('0x70')]())['where'](_0xb71a('0x71'),_0x15b8be[_0xb71a('0x48')]['state'][_0xb71a('0x70')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xb71a('0x66')]()[_0xb71a('0x67')](_0xb71a('0x69'))['from'](_0xb71a('0x5f'))[_0xb71a('0x38')]('VoiceQueueId\x20=\x20?',_0x15b8be[_0xb71a('0x44')]['id'][_0xb71a('0x70')]()))[_0xb71a('0x38')](_0xb71a('0x72'),squel[_0xb71a('0x66')]()[_0xb71a('0x67')]('calleridnum')[_0xb71a('0x6e')](_0xb71a('0x73'))[_0xb71a('0x38')](_0xb71a('0x6f'),_0x15b8be[_0xb71a('0x44')]['id'][_0xb71a('0x70')]())['where'](_0xb71a('0x74')))[_0xb71a('0x75')]('ContactId'))[_0xb71a('0x70')]();return db[_0xb71a('0x4b')][_0xb71a('0x2e')](_0x27c15e);}return[];})['then'](respondWithResult(_0x2dd470,null))[_0xb71a('0x42')](handleError(_0x2dd470,null));};exports[_0xb71a('0x76')]=function(_0x28bc74,_0x575a0a,_0x1a658e){return db[_0xb71a('0x77')]['find']({'where':{'id':_0x28bc74[_0xb71a('0x44')]['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x575a0a,null))[_0xb71a('0x24')](function(_0x21b9b5){var _0x4abfd6;if(_0x21b9b5){_0x4abfd6=squel[_0xb71a('0x78')]()[_0xb71a('0x5e')](_0xb71a('0x5f'))[_0xb71a('0x60')](['phone',_0xb71a('0x61'),_0xb71a('0x62'),'ListId',_0xb71a('0x79'),_0xb71a('0x64'),'updatedAt'],squel[_0xb71a('0x66')]()[_0xb71a('0x67')](_0xb71a('0x68'),'phone')[_0xb71a('0x67')](_0xb71a('0x6a'),_0xb71a('0x61'))[_0xb71a('0x67')](_0xb71a('0x6b'),_0xb71a('0x62'))[_0xb71a('0x67')](_0xb71a('0x6c'),_0xb71a('0x63'))['field']('ANY_VALUE(CampaignId)',_0xb71a('0x79'))[_0xb71a('0x67')](_0xb71a('0x6a'),_0xb71a('0x64'))[_0xb71a('0x67')](_0xb71a('0x6a'),'updatedAt')[_0xb71a('0x6e')]('cm_hopper_final')[_0xb71a('0x38')]('CampaignId\x20=\x20?',_0x28bc74[_0xb71a('0x44')]['id'][_0xb71a('0x70')]())['where'](_0xb71a('0x71'),_0x28bc74[_0xb71a('0x48')][_0xb71a('0x7a')][_0xb71a('0x70')]())[_0xb71a('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')[_0xb71a('0x38')](_0xb71a('0x72'),squel['select']()[_0xb71a('0x67')](_0xb71a('0x69'))['from'](_0xb71a('0x5f'))[_0xb71a('0x38')](_0xb71a('0x7b'),_0x28bc74['params']['id'][_0xb71a('0x70')]()))[_0xb71a('0x38')](_0xb71a('0x72'),squel['select']()[_0xb71a('0x67')](_0xb71a('0x7c'))[_0xb71a('0x6e')](_0xb71a('0x73'))[_0xb71a('0x38')]('CampaignId\x20=\x20?',_0x28bc74[_0xb71a('0x44')]['id']['toString']())[_0xb71a('0x38')](_0xb71a('0x74')))[_0xb71a('0x75')]('ContactId'))['toString']();return db[_0xb71a('0x4b')][_0xb71a('0x2e')](_0x4abfd6);}return[];})[_0xb71a('0x24')](respondWithResult(_0x575a0a,null))[_0xb71a('0x42')](handleError(_0x575a0a,null));};exports[_0xb71a('0x7d')]=function(_0x18dfb3,_0x38ffc1,_0x442ec0){return db[_0xb71a('0x7e')][_0xb71a('0x7f')]({'where':{'VoiceQueueId':_0x18dfb3[_0xb71a('0x48')][_0xb71a('0x6d')],'CampaignId':_0x18dfb3[_0xb71a('0x48')][_0xb71a('0x79')],'ContactId':_0x18dfb3[_0xb71a('0x48')]['ContactId']}})[_0xb71a('0x24')](handleEntityNotFound(_0x38ffc1,null))[_0xb71a('0x24')](function(_0x243c90){if(_0x243c90){return _0x243c90;}return null;})['then'](respondWithResult(_0x38ffc1,null))['catch'](handleError(_0x38ffc1,null));}; \ No newline at end of file +var _0x2a07=['jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','error','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','catch','show','params','fields','includeAll','describe','body','uniqueid','find','findAll','sequelize','COUNT','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x2010\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','congestionContacts','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','ANY_VALUE(calleridnum)','phone','field','NOW()','scheduledAt','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','toString','Campaign','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','group','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0xdaddd0,_0x438f28){var _0x301d05=function(_0x2dead8){while(--_0x2dead8){_0xdaddd0['push'](_0xdaddd0['shift']());}};_0x301d05(++_0x438f28);}(_0x2a07,0x74));var _0x72a0=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x2a07[_0x24f31b];return _0x488401;};'use strict';var emlformat=require(_0x72a0('0x0'));var rimraf=require(_0x72a0('0x1'));var zipdir=require(_0x72a0('0x2'));var jsonpatch=require(_0x72a0('0x3'));var rp=require(_0x72a0('0x4'));var moment=require('moment');var BPromise=require(_0x72a0('0x5'));var Mustache=require(_0x72a0('0x6'));var util=require(_0x72a0('0x7'));var path=require(_0x72a0('0x8'));var sox=require(_0x72a0('0x9'));var csv=require(_0x72a0('0xa'));var ejs=require(_0x72a0('0xb'));var fs=require('fs');var fs_extra=require(_0x72a0('0xc'));var _=require(_0x72a0('0xd'));var squel=require(_0x72a0('0xe'));var crypto=require(_0x72a0('0xf'));var jsforce=require(_0x72a0('0x10'));var deskjs=require(_0x72a0('0x11'));var toCsv=require(_0x72a0('0xa'));var querystring=require(_0x72a0('0x12'));var Papa=require(_0x72a0('0x13'));var Redis=require('ioredis');var authService=require(_0x72a0('0x14'));var qs=require(_0x72a0('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x72a0('0x16'));var logger=require(_0x72a0('0x17'))(_0x72a0('0x18'));var utils=require(_0x72a0('0x19'));var config=require(_0x72a0('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x72a0('0x1b'))['db'];function respondWithStatusCode(_0x335b9f,_0x123ca4){_0x123ca4=_0x123ca4||0xcc;return function(_0xf91a82){if(_0xf91a82){return _0x335b9f[_0x72a0('0x1c')](_0x123ca4);}return _0x335b9f[_0x72a0('0x1d')](_0x123ca4)[_0x72a0('0x1e')]();};}function respondWithResult(_0x5e0b5f,_0x4930c5){_0x4930c5=_0x4930c5||0xc8;return function(_0xe103dc){if(_0xe103dc){return _0x5e0b5f[_0x72a0('0x1d')](_0x4930c5)[_0x72a0('0x1f')](_0xe103dc);}};}function respondWithFilteredResult(_0x1d1133,_0x23b001){return function(_0x3f3d62){if(_0x3f3d62){var _0x4ab55e=typeof _0x23b001[_0x72a0('0x20')]===_0x72a0('0x21')&&typeof _0x23b001[_0x72a0('0x22')]===_0x72a0('0x21');var _0x2d1e95=_0x3f3d62['count'];var _0x100d8f=_0x4ab55e?0x0:_0x23b001[_0x72a0('0x20')];var _0x131b73=_0x4ab55e?_0x3f3d62['count']:_0x23b001[_0x72a0('0x20')]+_0x23b001[_0x72a0('0x22')];var _0x30899b;if(_0x131b73>=_0x2d1e95){_0x131b73=_0x2d1e95;_0x30899b=0xc8;}else{_0x30899b=0xce;}_0x1d1133[_0x72a0('0x1d')](_0x30899b);return _0x1d1133['set'](_0x72a0('0x23'),_0x100d8f+'-'+_0x131b73+'/'+_0x2d1e95)['json'](_0x3f3d62);}return null;};}function patchUpdates(_0x3d0607){return function(_0x315413){try{jsonpatch[_0x72a0('0x24')](_0x315413,_0x3d0607,!![]);}catch(_0x5c7479){return BPromise[_0x72a0('0x25')](_0x5c7479);}return _0x315413[_0x72a0('0x26')]();};}function saveUpdates(_0x1d22d8,_0x3d1965){return function(_0x5d6145){if(_0x5d6145){return _0x5d6145[_0x72a0('0x27')](_0x1d22d8)[_0x72a0('0x28')](function(_0x1ddd54){return _0x1ddd54;});}return null;};}function removeEntity(_0x23b918,_0x3022b0){return function(_0x174b1b){if(_0x174b1b){return _0x174b1b['destroy']()['then'](function(){_0x23b918[_0x72a0('0x1d')](0xcc)[_0x72a0('0x1e')]();});}};}function handleEntityNotFound(_0x123df4,_0x1504ed){return function(_0xf5cb49){if(!_0xf5cb49){_0x123df4[_0x72a0('0x1c')](0x194);}return _0xf5cb49;};}function handleError(_0xa5bda0,_0x15922a){_0x15922a=_0x15922a||0x1f4;return function(_0xee99e2){logger[_0x72a0('0x29')](_0xee99e2['stack']);if(_0xee99e2[_0x72a0('0x2a')]){delete _0xee99e2[_0x72a0('0x2a')];}_0xa5bda0[_0x72a0('0x1d')](_0x15922a)[_0x72a0('0x2b')](_0xee99e2);};}exports[_0x72a0('0x2c')]=function(_0x177a3a,_0x432179){var _0x12eda2={},_0x23c96a={},_0x916733={'count':0x0,'rows':[]};var _0x4ba037=_[_0x72a0('0x2d')](db[_0x72a0('0x2e')][_0x72a0('0x2f')],function(_0xfbe9b3){return{'name':_0xfbe9b3[_0x72a0('0x30')],'type':_0xfbe9b3[_0x72a0('0x31')][_0x72a0('0x32')]};});_0x23c96a['model']=_[_0x72a0('0x2d')](_0x4ba037,_0x72a0('0x2a'));_0x23c96a[_0x72a0('0x33')]=_[_0x72a0('0x34')](_0x177a3a[_0x72a0('0x33')]);_0x23c96a[_0x72a0('0x35')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],_0x23c96a['query']);_0x12eda2[_0x72a0('0x38')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],qs['fields'](_0x177a3a[_0x72a0('0x33')]['fields']));_0x12eda2[_0x72a0('0x38')]=_0x12eda2[_0x72a0('0x38')][_0x72a0('0x39')]?_0x12eda2[_0x72a0('0x38')]:_0x23c96a[_0x72a0('0x37')];if(!_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3a')](_0x72a0('0x3b'))){_0x12eda2[_0x72a0('0x22')]=qs[_0x72a0('0x22')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x22')]);_0x12eda2['offset']=qs[_0x72a0('0x20')](_0x177a3a['query'][_0x72a0('0x20')]);}_0x12eda2[_0x72a0('0x3c')]=qs[_0x72a0('0x3d')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3d')]);_0x12eda2[_0x72a0('0x3e')]=qs[_0x72a0('0x35')](_[_0x72a0('0x3f')](_0x177a3a[_0x72a0('0x33')],_0x23c96a['filters']),_0x4ba037);if(_0x177a3a['query'][_0x72a0('0x40')]){_0x12eda2[_0x72a0('0x3e')]=_[_0x72a0('0x41')](_0x12eda2[_0x72a0('0x3e')],{'$or':_[_0x72a0('0x2d')](_0x4ba037,function(_0x512a06){if(_0x512a06[_0x72a0('0x31')]!==_0x72a0('0x42')){var _0x582c90={};_0x582c90[_0x512a06[_0x72a0('0x2a')]]={'$like':'%'+_0x177a3a['query']['filter']+'%'};return _0x582c90;}})});}_0x12eda2=_['merge']({},_0x12eda2,_0x177a3a[_0x72a0('0x43')]);var _0x49633b={'where':_0x12eda2[_0x72a0('0x3e')]};return db[_0x72a0('0x2e')][_0x72a0('0x44')](_0x49633b)[_0x72a0('0x28')](function(_0x4bf56e){_0x916733['count']=_0x4bf56e;if(_0x177a3a['query']['includeAll']){_0x12eda2[_0x72a0('0x45')]=[{'all':!![]}];}return db[_0x72a0('0x2e')]['findAll'](_0x12eda2);})[_0x72a0('0x28')](function(_0x35d790){_0x916733['rows']=_0x35d790;return _0x916733;})[_0x72a0('0x28')](respondWithFilteredResult(_0x432179,_0x12eda2))[_0x72a0('0x46')](handleError(_0x432179,null));};exports[_0x72a0('0x47')]=function(_0xe4abe1,_0x340153){var _0x341451={'raw':!![],'where':{'id':_0xe4abe1[_0x72a0('0x48')]['id']}},_0x50eb7f={};_0x50eb7f['model']=_[_0x72a0('0x34')](db['CmHopperFinal'][_0x72a0('0x2f')]);_0x50eb7f[_0x72a0('0x33')]=_['keys'](_0xe4abe1[_0x72a0('0x33')]);_0x50eb7f['filters']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],_0x50eb7f[_0x72a0('0x33')]);_0x341451['attributes']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],qs[_0x72a0('0x49')](_0xe4abe1['query']['fields']));_0x341451[_0x72a0('0x38')]=_0x341451['attributes'][_0x72a0('0x39')]?_0x341451[_0x72a0('0x38')]:_0x50eb7f[_0x72a0('0x37')];if(_0xe4abe1[_0x72a0('0x33')][_0x72a0('0x4a')]){_0x341451[_0x72a0('0x45')]=[{'all':!![]}];}_0x341451=_[_0x72a0('0x41')]({},_0x341451,_0xe4abe1[_0x72a0('0x43')]);return db[_0x72a0('0x2e')]['find'](_0x341451)[_0x72a0('0x28')](handleEntityNotFound(_0x340153,null))[_0x72a0('0x28')](respondWithResult(_0x340153,null))[_0x72a0('0x46')](handleError(_0x340153,null));};exports[_0x72a0('0x4b')]=function(_0x3a669d,_0x304400){return db[_0x72a0('0x2e')]['describe']()['then'](respondWithResult(_0x304400,null))[_0x72a0('0x46')](handleError(_0x304400,null));};exports[_0x72a0('0x27')]=function(_0xe38fb3,_0x3cab6a){if(_0xe38fb3[_0x72a0('0x4c')][_0x72a0('0x4d')]){delete _0xe38fb3[_0x72a0('0x4c')][_0x72a0('0x4d')];}return db[_0x72a0('0x2e')][_0x72a0('0x4e')]({'where':{'uniqueid':_0xe38fb3['params']['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x3cab6a,null))[_0x72a0('0x28')](saveUpdates(_0xe38fb3[_0x72a0('0x4c')],null))[_0x72a0('0x28')](respondWithResult(_0x3cab6a,null))[_0x72a0('0x46')](handleError(_0x3cab6a,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x143410,_0x595243,_0x4d712b){return db[_0x72a0('0x2e')][_0x72a0('0x4f')]({'raw':![],'where':{'VoiceQueueId':_0x143410[_0x72a0('0x48')]['id']},'attributes':[[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db['sequelize']['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')]('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x53')))),_0x72a0('0x54')],[db[_0x72a0('0x50')]['fn']('COUNT',db[_0x72a0('0x50')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x72a0('0x55')],[db[_0x72a0('0x50')]['fn']('COUNT',db[_0x72a0('0x50')]['fn']('IF',db['sequelize'][_0x72a0('0x52')]('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db['sequelize']['fn']('IF',db[_0x72a0('0x50')]['literal'](_0x72a0('0x56')))),'dropContacts'],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x72a0('0x57')],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x58')))),_0x72a0('0x59')],[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x5a')))),'answeringMachine']]})[_0x72a0('0x28')](handleEntityNotFound(_0x595243,null))['then'](respondWithResult(_0x595243,null))['catch'](handleError(_0x595243,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x522ee2,_0x237025,_0x4e5d05){return db[_0x72a0('0x2e')]['findAll']({'raw':![],'where':{'CampaignId':_0x522ee2[_0x72a0('0x48')]['id']},'attributes':[[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db['sequelize'][_0x72a0('0x52')](_0x72a0('0x5b')))),_0x72a0('0x5c')],[db[_0x72a0('0x50')]['fn']('COUNT',db[_0x72a0('0x50')]['fn']('IF',db['sequelize'][_0x72a0('0x52')](_0x72a0('0x53')))),_0x72a0('0x54')],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x5d')))),'busyContacts'],[db['sequelize']['fn'](_0x72a0('0x51'),db['sequelize']['fn']('IF',db[_0x72a0('0x50')]['literal'](_0x72a0('0x5e')))),_0x72a0('0x5f')],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')]['literal'](_0x72a0('0x56')))),'dropContacts'],[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db['sequelize']['fn']('IF',db[_0x72a0('0x50')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db[_0x72a0('0x50')]['fn']('COUNT',db[_0x72a0('0x50')]['fn']('IF',db['sequelize'][_0x72a0('0x52')](_0x72a0('0x58')))),_0x72a0('0x59')],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x5a')))),'answeringMachine']]})[_0x72a0('0x28')](handleEntityNotFound(_0x237025,null))[_0x72a0('0x28')](respondWithResult(_0x237025,null))[_0x72a0('0x46')](handleError(_0x237025,null));};exports[_0x72a0('0x60')]=function(_0x4f0944,_0x3dd25d,_0x647e75){return db['VoiceQueue'][_0x72a0('0x4e')]({'where':{'id':_0x4f0944['params']['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x3dd25d,null))[_0x72a0('0x28')](function(_0xb17e09){var _0x1238a3;if(_0xb17e09){_0x1238a3=squel[_0x72a0('0x61')]()[_0x72a0('0x62')](_0x72a0('0x63'))['fromQuery'](['phone','scheduledAt',_0x72a0('0x64'),_0x72a0('0x65'),_0x72a0('0x66'),_0x72a0('0x67'),_0x72a0('0x68')],squel[_0x72a0('0x69')]()['field'](_0x72a0('0x6a'),_0x72a0('0x6b'))[_0x72a0('0x6c')](_0x72a0('0x6d'),_0x72a0('0x6e'))[_0x72a0('0x6c')](_0x72a0('0x6f'),'ContactId')[_0x72a0('0x6c')](_0x72a0('0x70'),_0x72a0('0x65'))[_0x72a0('0x6c')](_0x72a0('0x71'),_0x72a0('0x66'))['field'](_0x72a0('0x6d'),'createdAt')[_0x72a0('0x6c')](_0x72a0('0x6d'),_0x72a0('0x68'))[_0x72a0('0x72')](_0x72a0('0x73'))['where'](_0x72a0('0x74'),_0x4f0944[_0x72a0('0x48')]['id']['toString']())[_0x72a0('0x3e')](_0x72a0('0x75'),_0x4f0944[_0x72a0('0x4c')][_0x72a0('0x76')]['toString']())[_0x72a0('0x3e')](_0x72a0('0x77'))[_0x72a0('0x3e')](_0x72a0('0x78'),squel[_0x72a0('0x69')]()[_0x72a0('0x6c')](_0x72a0('0x6b'))[_0x72a0('0x72')](_0x72a0('0x63'))[_0x72a0('0x3e')](_0x72a0('0x74'),_0x4f0944[_0x72a0('0x48')]['id']['toString']()))[_0x72a0('0x3e')](_0x72a0('0x78'),squel[_0x72a0('0x69')]()[_0x72a0('0x6c')](_0x72a0('0x79'))[_0x72a0('0x72')](_0x72a0('0x73'))[_0x72a0('0x3e')]('VoiceQueueId\x20=\x20?',_0x4f0944[_0x72a0('0x48')]['id']['toString']())['where'](_0x72a0('0x7a')))['group']('ContactId'))[_0x72a0('0x7b')]();return db['sequelize'][_0x72a0('0x33')](_0x1238a3);}return[];})[_0x72a0('0x28')](respondWithResult(_0x3dd25d,null))[_0x72a0('0x46')](handleError(_0x3dd25d,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x344a69,_0x179ca2,_0x3832d7){return db[_0x72a0('0x7c')][_0x72a0('0x4e')]({'where':{'id':_0x344a69['params']['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x179ca2,null))[_0x72a0('0x28')](function(_0x38736e){var _0x4f421f;if(_0x38736e){_0x4f421f=squel[_0x72a0('0x61')]()[_0x72a0('0x62')](_0x72a0('0x63'))['fromQuery']([_0x72a0('0x6b'),_0x72a0('0x6e'),_0x72a0('0x64'),_0x72a0('0x65'),_0x72a0('0x7d'),_0x72a0('0x67'),_0x72a0('0x68')],squel[_0x72a0('0x69')]()[_0x72a0('0x6c')]('ANY_VALUE(calleridnum)',_0x72a0('0x6b'))[_0x72a0('0x6c')](_0x72a0('0x6d'),_0x72a0('0x6e'))[_0x72a0('0x6c')]('ANY_VALUE(ContactId)',_0x72a0('0x64'))[_0x72a0('0x6c')](_0x72a0('0x70'),_0x72a0('0x65'))['field'](_0x72a0('0x7e'),_0x72a0('0x7d'))[_0x72a0('0x6c')]('NOW()','createdAt')[_0x72a0('0x6c')](_0x72a0('0x6d'),_0x72a0('0x68'))[_0x72a0('0x72')](_0x72a0('0x73'))['where']('CampaignId\x20=\x20?',_0x344a69['params']['id'][_0x72a0('0x7b')]())['where'](_0x72a0('0x75'),_0x344a69['body']['state']['toString']())['where'](_0x72a0('0x77'))[_0x72a0('0x3e')](_0x72a0('0x78'),squel[_0x72a0('0x69')]()['field'](_0x72a0('0x6b'))[_0x72a0('0x72')]('cm_hopper')[_0x72a0('0x3e')](_0x72a0('0x7f'),_0x344a69['params']['id'][_0x72a0('0x7b')]()))[_0x72a0('0x3e')](_0x72a0('0x78'),squel[_0x72a0('0x69')]()['field']('calleridnum')[_0x72a0('0x72')](_0x72a0('0x73'))[_0x72a0('0x3e')](_0x72a0('0x7f'),_0x344a69[_0x72a0('0x48')]['id'][_0x72a0('0x7b')]())['where']('state\x20=\x204'))[_0x72a0('0x80')](_0x72a0('0x64')))['toString']();return db[_0x72a0('0x50')][_0x72a0('0x33')](_0x4f421f);}return[];})[_0x72a0('0x28')](respondWithResult(_0x179ca2,null))[_0x72a0('0x46')](handleError(_0x179ca2,null));};exports[_0x72a0('0x81')]=function(_0x167a80,_0x7533ea,_0x56bdf5){return db[_0x72a0('0x82')][_0x72a0('0x83')]({'where':{'VoiceQueueId':_0x167a80[_0x72a0('0x4c')]['VoiceQueueId'],'CampaignId':_0x167a80[_0x72a0('0x4c')][_0x72a0('0x7d')],'ContactId':_0x167a80[_0x72a0('0x4c')][_0x72a0('0x64')]}})[_0x72a0('0x28')](handleEntityNotFound(_0x7533ea,null))['then'](function(_0xc16765){if(_0xc16765){return _0xc16765;}return null;})[_0x72a0('0x28')](respondWithResult(_0x7533ea,null))[_0x72a0('0x46')](handleError(_0x7533ea,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 6e25490..c282247 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 _0x3673=['moment','bluebird','path','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','api'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3673,0x9a));var _0x3367=function(_0x34df4a,_0x209d10){_0x34df4a=_0x34df4a-0x0;var _0x145c69=_0x3673[_0x34df4a];return _0x145c69;};'use strict';var _=require(_0x3367('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3367('0x1'));var moment=require(_0x3367('0x2'));var BPromise=require(_0x3367('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3367('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3367('0x5'));module[_0x3367('0x6')]=function(_0x501ae3,_0x2bad06){return _0x501ae3[_0x3367('0x7')](_0x3367('0x8'),attributes,{'tableName':_0x3367('0x9'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x3367('0xa')]},{'name':'uniqueid','fields':[_0x3367('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0b78=['define','cm_hopper_final','calleridnum','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports'];(function(_0xc1bc9,_0x33c932){var _0x3973f2=function(_0x386a24){while(--_0x386a24){_0xc1bc9['push'](_0xc1bc9['shift']());}};_0x3973f2(++_0x33c932);}(_0x0b78,0x1b7));var _0x80b7=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x0b78[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x80b7('0x0'));var util=require('util');var logger=require(_0x80b7('0x1'))(_0x80b7('0x2'));var moment=require(_0x80b7('0x3'));var BPromise=require(_0x80b7('0x4'));var rp=require(_0x80b7('0x5'));var fs=require('fs');var path=require(_0x80b7('0x6'));var rimraf=require(_0x80b7('0x7'));var config=require(_0x80b7('0x8'));var attributes=require(_0x80b7('0x9'));module[_0x80b7('0xa')]=function(_0x364fe7,_0x25f5f1){return _0x364fe7[_0x80b7('0xb')]('CmHopperFinal',attributes,{'tableName':_0x80b7('0xc'),'paranoid':![],'indexes':[{'name':_0x80b7('0xd'),'fields':[_0x80b7('0xd')]},{'name':_0x80b7('0xe'),'fields':[_0x80b7('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 7e82faf..72535eb 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(_0x416681,_0x5e6285){var _0x3e2410=function(_0x2945a1){while(--_0x2945a1){_0x416681['push'](_0x416681['shift']());}};_0x3e2410(++_0x5e6285);}(_0x7a54,0x106));var _0x47a5=function(_0x15faaf,_0x183df9){_0x15faaf=_0x15faaf-0x0;var _0x30f0e1=_0x7a54[_0x15faaf];return _0x30f0e1;};'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(_0x290caf,_0x40381c){var _0x1b13e6=function(_0xc292ca){while(--_0xc292ca){_0x290caf['push'](_0x290caf['shift']());}};_0x1b13e6(++_0x40381c);}(_0xb10b,0x12a));var _0xbb10=function(_0x32a81f,_0x4eee66){_0x32a81f=_0x32a81f-0x0;var _0x5b67a2=_0xb10b[_0x32a81f];return _0x5b67a2;};'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 7942c78..193259d 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 _0x04e0=['/:id','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','put','update','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x43dd52,_0x7b45a1){var _0x1b14ec=function(_0x3fcc48){while(--_0x3fcc48){_0x43dd52['push'](_0x43dd52['shift']());}};_0x1b14ec(++_0x7b45a1);}(_0x04e0,0xd2));var _0x004e=function(_0x3298c9,_0x241345){_0x3298c9=_0x3298c9-0x0;var _0x8db96=_0x04e0[_0x3298c9];return _0x8db96;};'use strict';var multer=require('multer');var util=require(_0x004e('0x0'));var path=require(_0x004e('0x1'));var timeout=require(_0x004e('0x2'));var express=require('express');var router=express[_0x004e('0x3')]();var fs_extra=require(_0x004e('0x4'));var auth=require(_0x004e('0x5'));var interaction=require(_0x004e('0x6'));var config=require(_0x004e('0x7'));var controller=require(_0x004e('0x8'));router[_0x004e('0x9')]('/',auth[_0x004e('0xa')](),controller[_0x004e('0xb')]);router[_0x004e('0x9')](_0x004e('0xc'),auth[_0x004e('0xa')](),controller[_0x004e('0xd')]);router[_0x004e('0x9')](_0x004e('0xe'),auth['isAuthenticated'](),controller[_0x004e('0xf')]);router[_0x004e('0x9')](_0x004e('0x10'),auth[_0x004e('0xa')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x004e('0x9')](_0x004e('0x11'),auth[_0x004e('0xa')](),controller[_0x004e('0x12')]);router['post'](_0x004e('0x13'),auth[_0x004e('0xa')](),controller[_0x004e('0x14')]);router[_0x004e('0x15')](_0x004e('0x16'),auth[_0x004e('0xa')](),controller[_0x004e('0x17')]);router[_0x004e('0x15')](_0x004e('0x18'),auth[_0x004e('0xa')](),controller['checkContactHopper']);router[_0x004e('0x19')](_0x004e('0xe'),auth[_0x004e('0xa')](),controller[_0x004e('0x1a')]);module[_0x004e('0x1b')]=router; \ No newline at end of file +var _0x7373=['/describe','isAuthenticated','describe','/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','/checkContactHopper','checkContactHopper','put','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperFinal.controller','get','index'];(function(_0x55ae74,_0x5e5f2b){var _0x426b4c=function(_0x4b1c19){while(--_0x4b1c19){_0x55ae74['push'](_0x55ae74['shift']());}};_0x426b4c(++_0x5e5f2b);}(_0x7373,0x1db));var _0x3737=function(_0x22854f,_0x2aac13){_0x22854f=_0x22854f-0x0;var _0xf397e0=_0x7373[_0x22854f];return _0xf397e0;};'use strict';var multer=require(_0x3737('0x0'));var util=require('util');var path=require(_0x3737('0x1'));var timeout=require(_0x3737('0x2'));var express=require(_0x3737('0x3'));var router=express[_0x3737('0x4')]();var fs_extra=require(_0x3737('0x5'));var auth=require(_0x3737('0x6'));var interaction=require(_0x3737('0x7'));var config=require('../../config/environment');var controller=require(_0x3737('0x8'));router[_0x3737('0x9')]('/',auth['isAuthenticated'](),controller[_0x3737('0xa')]);router[_0x3737('0x9')](_0x3737('0xb'),auth[_0x3737('0xc')](),controller[_0x3737('0xd')]);router['get'](_0x3737('0xe'),auth[_0x3737('0xc')](),controller['show']);router['get']('/voice/queue/countAttributes/:id',auth[_0x3737('0xc')](),controller[_0x3737('0xf')]);router[_0x3737('0x9')](_0x3737('0x10'),auth[_0x3737('0xc')](),controller[_0x3737('0x11')]);router[_0x3737('0x12')](_0x3737('0x13'),auth[_0x3737('0xc')](),controller[_0x3737('0x14')]);router['post'](_0x3737('0x15'),auth[_0x3737('0xc')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x3737('0x12')](_0x3737('0x16'),auth[_0x3737('0xc')](),controller[_0x3737('0x17')]);router[_0x3737('0x18')](_0x3737('0xe'),auth[_0x3737('0xc')](),controller[_0x3737('0x19')]);module[_0x3737('0x1a')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 517e1c3..9525660 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 _0x08d6=['BOOLEAN','exports','INTEGER','STRING','DATE'];(function(_0xf8af35,_0x175b32){var _0x3d777f=function(_0x2425ca){while(--_0x2425ca){_0xf8af35['push'](_0xf8af35['shift']());}};_0x3d777f(++_0x175b32);}(_0x08d6,0x173));var _0x608d=function(_0x3bf4f6,_0xa2bf4e){_0x3bf4f6=_0x3bf4f6-0x0;var _0x31d3a9=_0x08d6[_0x3bf4f6];return _0x31d3a9;};'use strict';var Sequelize=require('sequelize');module[_0x608d('0x0')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x608d('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x608d('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x608d('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x608d('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x608d('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x608d('0x2')]},'originatecalleridname':{'type':Sequelize[_0x608d('0x2')]},'calleridnum':{'type':Sequelize[_0x608d('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x608d('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x608d('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x608d('0x3')]},'ringtime':{'type':Sequelize[_0x608d('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x608d('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x608d('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x608d('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x608d('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x608d('0x2')]},'membername':{'type':Sequelize[_0x608d('0x2')]},'reason':{'type':Sequelize[_0x608d('0x2')]},'amd':{'type':Sequelize[_0x608d('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x608d('0x4')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x608d('0x3')]},'recallme':{'type':Sequelize[_0x608d('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x608d('0x3')]},'edited':{'type':Sequelize[_0x608d('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x608d('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x608d('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x608d('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x608d('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1d37=['sequelize','exports','INTEGER','STRING','DATE','BOOLEAN'];(function(_0x1a0d62,_0x5c9c35){var _0x240a6a=function(_0x89f8c2){while(--_0x89f8c2){_0x1a0d62['push'](_0x1a0d62['shift']());}};_0x240a6a(++_0x5c9c35);}(_0x1d37,0xa2));var _0x71d3=function(_0x4310e8,_0x3ba783){_0x4310e8=_0x4310e8-0x0;var _0x301445=_0x1d37[_0x4310e8];return _0x301445;};'use strict';var Sequelize=require(_0x71d3('0x0'));module[_0x71d3('0x1')]={'state':{'type':Sequelize[_0x71d3('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x71d3('0x3')]},'scheduledat':{'type':Sequelize[_0x71d3('0x4')]},'countbusyretry':{'type':Sequelize[_0x71d3('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x71d3('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x71d3('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x71d3('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x71d3('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x71d3('0x3')]},'calleridnum':{'type':Sequelize[_0x71d3('0x3')]},'calleridname':{'type':Sequelize[_0x71d3('0x3')]},'starttime':{'type':Sequelize[_0x71d3('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x71d3('0x4')]},'droptime':{'type':Sequelize[_0x71d3('0x4')]},'endtime':{'type':Sequelize[_0x71d3('0x4')]},'ringtime':{'type':Sequelize[_0x71d3('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x71d3('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x71d3('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x71d3('0x3')]},'campaign':{'type':Sequelize[_0x71d3('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x71d3('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x71d3('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x71d3('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x71d3('0x4')]},'edited':{'type':Sequelize[_0x71d3('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x71d3('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x71d3('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x71d3('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x71d3('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 91f6ffc..179c35a 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 _0xf762=['moment','bluebird','util','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','set','apply','update','then','destroy','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','limit','order','sort','where','pick','filter','type','VIRTUAL','includeAll','include','rows','catch','show','params','merge','options','create','body','describe','uniqueid','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xf762,0x123));var _0x2f76=function(_0x22c245,_0x39c6a3){_0x22c245=_0x22c245-0x0;var _0x3bc7c0=_0xf762[_0x22c245];return _0x3bc7c0;};'use strict';var emlformat=require(_0x2f76('0x0'));var rimraf=require(_0x2f76('0x1'));var zipdir=require(_0x2f76('0x2'));var jsonpatch=require(_0x2f76('0x3'));var rp=require(_0x2f76('0x4'));var moment=require(_0x2f76('0x5'));var BPromise=require(_0x2f76('0x6'));var Mustache=require('mustache');var util=require(_0x2f76('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2f76('0x8'));var fs=require('fs');var fs_extra=require(_0x2f76('0x9'));var _=require(_0x2f76('0xa'));var squel=require(_0x2f76('0xb'));var crypto=require(_0x2f76('0xc'));var jsforce=require(_0x2f76('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2f76('0xe'));var Papa=require(_0x2f76('0xf'));var Redis=require(_0x2f76('0x10'));var authService=require(_0x2f76('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2f76('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2f76('0x13'))(_0x2f76('0x14'));var utils=require(_0x2f76('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2f76('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e168b,_0xb83a02){_0xb83a02=_0xb83a02||0xcc;return function(_0x414227){if(_0x414227){return _0x1e168b[_0x2f76('0x17')](_0xb83a02);}return _0x1e168b[_0x2f76('0x18')](_0xb83a02)[_0x2f76('0x19')]();};}function respondWithResult(_0x163ad0,_0x4ac164){_0x4ac164=_0x4ac164||0xc8;return function(_0x53f0a6){if(_0x53f0a6){return _0x163ad0[_0x2f76('0x18')](_0x4ac164)[_0x2f76('0x1a')](_0x53f0a6);}};}function respondWithFilteredResult(_0x49bd3d,_0x49505f){return function(_0x45b7f1){if(_0x45b7f1){var _0x3efff8=typeof _0x49505f[_0x2f76('0x1b')]===_0x2f76('0x1c')&&typeof _0x49505f['limit']==='undefined';var _0x37304d=_0x45b7f1['count'];var _0x289a1c=_0x3efff8?0x0:_0x49505f[_0x2f76('0x1b')];var _0x1c86ff=_0x3efff8?_0x45b7f1[_0x2f76('0x1d')]:_0x49505f[_0x2f76('0x1b')]+_0x49505f['limit'];var _0x2ee31d;if(_0x1c86ff>=_0x37304d){_0x1c86ff=_0x37304d;_0x2ee31d=0xc8;}else{_0x2ee31d=0xce;}_0x49bd3d[_0x2f76('0x18')](_0x2ee31d);return _0x49bd3d[_0x2f76('0x1e')]('Content-Range',_0x289a1c+'-'+_0x1c86ff+'/'+_0x37304d)['json'](_0x45b7f1);}return null;};}function patchUpdates(_0x3aeccb){return function(_0x2c17d2){try{jsonpatch[_0x2f76('0x1f')](_0x2c17d2,_0x3aeccb,!![]);}catch(_0x24d886){return BPromise['reject'](_0x24d886);}return _0x2c17d2['save']();};}function saveUpdates(_0x49c549,_0x4ce7bc){return function(_0x41a686){if(_0x41a686){return _0x41a686[_0x2f76('0x20')](_0x49c549)[_0x2f76('0x21')](function(_0x308ee1){return _0x308ee1;});}return null;};}function removeEntity(_0x425779,_0x19ff8f){return function(_0x29d5f8){if(_0x29d5f8){return _0x29d5f8[_0x2f76('0x22')]()[_0x2f76('0x21')](function(){_0x425779[_0x2f76('0x18')](0xcc)[_0x2f76('0x19')]();});}};}function handleEntityNotFound(_0x1ad39e,_0x15e94d){return function(_0x2a94c7){if(!_0x2a94c7){_0x1ad39e[_0x2f76('0x17')](0x194);}return _0x2a94c7;};}function handleError(_0x8c814b,_0x113a5e){_0x113a5e=_0x113a5e||0x1f4;return function(_0x1cefd6){logger['error'](_0x1cefd6[_0x2f76('0x23')]);if(_0x1cefd6[_0x2f76('0x24')]){delete _0x1cefd6[_0x2f76('0x24')];}_0x8c814b[_0x2f76('0x18')](_0x113a5e)[_0x2f76('0x25')](_0x1cefd6);};}exports[_0x2f76('0x26')]=function(_0x6c28ba,_0x272a56){var _0x246bf7={},_0x4c8366={},_0x30a008={'count':0x0,'rows':[]};var _0x104bed=_[_0x2f76('0x27')](db[_0x2f76('0x28')][_0x2f76('0x29')],function(_0x567704){return{'name':_0x567704[_0x2f76('0x2a')],'type':_0x567704['type'][_0x2f76('0x2b')]};});_0x4c8366[_0x2f76('0x2c')]=_[_0x2f76('0x27')](_0x104bed,'name');_0x4c8366[_0x2f76('0x2d')]=_[_0x2f76('0x2e')](_0x6c28ba['query']);_0x4c8366[_0x2f76('0x2f')]=_['intersection'](_0x4c8366[_0x2f76('0x2c')],_0x4c8366['query']);_0x246bf7[_0x2f76('0x30')]=_[_0x2f76('0x31')](_0x4c8366[_0x2f76('0x2c')],qs['fields'](_0x6c28ba[_0x2f76('0x2d')][_0x2f76('0x32')]));_0x246bf7['attributes']=_0x246bf7[_0x2f76('0x30')][_0x2f76('0x33')]?_0x246bf7[_0x2f76('0x30')]:_0x4c8366[_0x2f76('0x2c')];if(!_0x6c28ba[_0x2f76('0x2d')]['hasOwnProperty'](_0x2f76('0x34'))){_0x246bf7['limit']=qs[_0x2f76('0x35')](_0x6c28ba[_0x2f76('0x2d')][_0x2f76('0x35')]);_0x246bf7[_0x2f76('0x1b')]=qs[_0x2f76('0x1b')](_0x6c28ba['query'][_0x2f76('0x1b')]);}_0x246bf7[_0x2f76('0x36')]=qs[_0x2f76('0x37')](_0x6c28ba[_0x2f76('0x2d')]['sort']);_0x246bf7[_0x2f76('0x38')]=qs[_0x2f76('0x2f')](_[_0x2f76('0x39')](_0x6c28ba[_0x2f76('0x2d')],_0x4c8366['filters']),_0x104bed);if(_0x6c28ba[_0x2f76('0x2d')][_0x2f76('0x3a')]){_0x246bf7[_0x2f76('0x38')]=_['merge'](_0x246bf7['where'],{'$or':_['map'](_0x104bed,function(_0x19047a){if(_0x19047a[_0x2f76('0x3b')]!==_0x2f76('0x3c')){var _0x1efa55={};_0x1efa55[_0x19047a[_0x2f76('0x24')]]={'$like':'%'+_0x6c28ba[_0x2f76('0x2d')][_0x2f76('0x3a')]+'%'};return _0x1efa55;}})});}_0x246bf7=_['merge']({},_0x246bf7,_0x6c28ba['options']);var _0x570149={'where':_0x246bf7[_0x2f76('0x38')]};return db[_0x2f76('0x28')][_0x2f76('0x1d')](_0x570149)[_0x2f76('0x21')](function(_0x572064){_0x30a008[_0x2f76('0x1d')]=_0x572064;if(_0x6c28ba[_0x2f76('0x2d')][_0x2f76('0x3d')]){_0x246bf7[_0x2f76('0x3e')]=[{'all':!![]}];}return db[_0x2f76('0x28')]['findAll'](_0x246bf7);})[_0x2f76('0x21')](function(_0x583744){_0x30a008[_0x2f76('0x3f')]=_0x583744;return _0x30a008;})[_0x2f76('0x21')](respondWithFilteredResult(_0x272a56,_0x246bf7))[_0x2f76('0x40')](handleError(_0x272a56,null));};exports[_0x2f76('0x41')]=function(_0x403c7e,_0x316e65){var _0x49a63f={'raw':!![],'where':{'id':_0x403c7e[_0x2f76('0x42')]['id']}},_0x3325f4={};_0x3325f4['model']=_[_0x2f76('0x2e')](db[_0x2f76('0x28')]['rawAttributes']);_0x3325f4[_0x2f76('0x2d')]=_['keys'](_0x403c7e[_0x2f76('0x2d')]);_0x3325f4[_0x2f76('0x2f')]=_[_0x2f76('0x31')](_0x3325f4[_0x2f76('0x2c')],_0x3325f4['query']);_0x49a63f[_0x2f76('0x30')]=_[_0x2f76('0x31')](_0x3325f4[_0x2f76('0x2c')],qs['fields'](_0x403c7e[_0x2f76('0x2d')][_0x2f76('0x32')]));_0x49a63f['attributes']=_0x49a63f[_0x2f76('0x30')][_0x2f76('0x33')]?_0x49a63f['attributes']:_0x3325f4[_0x2f76('0x2c')];if(_0x403c7e['query'][_0x2f76('0x3d')]){_0x49a63f['include']=[{'all':!![]}];}_0x49a63f=_[_0x2f76('0x43')]({},_0x49a63f,_0x403c7e[_0x2f76('0x44')]);return db['CmHopperHistory']['find'](_0x49a63f)[_0x2f76('0x21')](handleEntityNotFound(_0x316e65,null))['then'](respondWithResult(_0x316e65,null))[_0x2f76('0x40')](handleError(_0x316e65,null));};exports[_0x2f76('0x45')]=function(_0x4ebd15,_0x1382ce){return db['CmHopperHistory'][_0x2f76('0x45')](_0x4ebd15[_0x2f76('0x46')],{})[_0x2f76('0x21')](respondWithResult(_0x1382ce,0xc9))['catch'](handleError(_0x1382ce,null));};exports[_0x2f76('0x47')]=function(_0xbb30e,_0x1e1eba){return db[_0x2f76('0x28')][_0x2f76('0x47')]()[_0x2f76('0x21')](respondWithResult(_0x1e1eba,null))['catch'](handleError(_0x1e1eba,null));};exports[_0x2f76('0x20')]=function(_0x2077f6,_0x427ed1){if(_0x2077f6[_0x2f76('0x46')]['uniqueid']){delete _0x2077f6[_0x2f76('0x46')][_0x2f76('0x48')];}return db[_0x2f76('0x28')][_0x2f76('0x49')]({'where':{'uniqueid':_0x2077f6[_0x2f76('0x42')]['id']}})[_0x2f76('0x21')](handleEntityNotFound(_0x427ed1,null))[_0x2f76('0x21')](saveUpdates(_0x2077f6['body'],null))[_0x2f76('0x21')](respondWithResult(_0x427ed1,null))[_0x2f76('0x40')](handleError(_0x427ed1,null));}; \ No newline at end of file +var _0xda7e=['findAll','rows','catch','show','params','create','describe','body','uniqueid','find','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','error','stack','name','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include'];(function(_0x215cd2,_0x51991d){var _0x594ea3=function(_0x29c029){while(--_0x29c029){_0x215cd2['push'](_0x215cd2['shift']());}};_0x594ea3(++_0x51991d);}(_0xda7e,0xa8));var _0xeda7=function(_0x47604d,_0x15a014){_0x47604d=_0x47604d-0x0;var _0x388e4c=_0xda7e[_0x47604d];return _0x388e4c;};'use strict';var emlformat=require(_0xeda7('0x0'));var rimraf=require(_0xeda7('0x1'));var zipdir=require(_0xeda7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xeda7('0x3'));var Mustache=require(_0xeda7('0x4'));var util=require(_0xeda7('0x5'));var path=require(_0xeda7('0x6'));var sox=require(_0xeda7('0x7'));var csv=require(_0xeda7('0x8'));var ejs=require(_0xeda7('0x9'));var fs=require('fs');var fs_extra=require(_0xeda7('0xa'));var _=require(_0xeda7('0xb'));var squel=require(_0xeda7('0xc'));var crypto=require(_0xeda7('0xd'));var jsforce=require(_0xeda7('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xeda7('0xf'));var Papa=require(_0xeda7('0x10'));var Redis=require(_0xeda7('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xeda7('0x12'));var as=require(_0xeda7('0x13'));var hardwareService=require(_0xeda7('0x14'));var logger=require(_0xeda7('0x15'))(_0xeda7('0x16'));var utils=require(_0xeda7('0x17'));var config=require(_0xeda7('0x18'));var licenseUtil=require(_0xeda7('0x19'));var db=require(_0xeda7('0x1a'))['db'];function respondWithStatusCode(_0x2742ff,_0x3ba18e){_0x3ba18e=_0x3ba18e||0xcc;return function(_0x547dd1){if(_0x547dd1){return _0x2742ff[_0xeda7('0x1b')](_0x3ba18e);}return _0x2742ff['status'](_0x3ba18e)[_0xeda7('0x1c')]();};}function respondWithResult(_0x596315,_0x235363){_0x235363=_0x235363||0xc8;return function(_0xd1163d){if(_0xd1163d){return _0x596315[_0xeda7('0x1d')](_0x235363)[_0xeda7('0x1e')](_0xd1163d);}};}function respondWithFilteredResult(_0x5173be,_0x1cf8de){return function(_0x23ccd4){if(_0x23ccd4){var _0x476f88=typeof _0x1cf8de[_0xeda7('0x1f')]==='undefined'&&typeof _0x1cf8de[_0xeda7('0x20')]===_0xeda7('0x21');var _0x193d15=_0x23ccd4[_0xeda7('0x22')];var _0x35c7a9=_0x476f88?0x0:_0x1cf8de[_0xeda7('0x1f')];var _0x4213b7=_0x476f88?_0x23ccd4['count']:_0x1cf8de[_0xeda7('0x1f')]+_0x1cf8de[_0xeda7('0x20')];var _0x3967b1;if(_0x4213b7>=_0x193d15){_0x4213b7=_0x193d15;_0x3967b1=0xc8;}else{_0x3967b1=0xce;}_0x5173be[_0xeda7('0x1d')](_0x3967b1);return _0x5173be[_0xeda7('0x23')](_0xeda7('0x24'),_0x35c7a9+'-'+_0x4213b7+'/'+_0x193d15)['json'](_0x23ccd4);}return null;};}function patchUpdates(_0x3c3890){return function(_0x1d5747){try{jsonpatch[_0xeda7('0x25')](_0x1d5747,_0x3c3890,!![]);}catch(_0x5d545e){return BPromise['reject'](_0x5d545e);}return _0x1d5747[_0xeda7('0x26')]();};}function saveUpdates(_0x405b35,_0x599e5f){return function(_0x575e24){if(_0x575e24){return _0x575e24[_0xeda7('0x27')](_0x405b35)[_0xeda7('0x28')](function(_0x58ddc7){return _0x58ddc7;});}return null;};}function removeEntity(_0x19a06c,_0x3e657d){return function(_0x429dfa){if(_0x429dfa){return _0x429dfa['destroy']()['then'](function(){_0x19a06c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2199f3,_0x1ef118){return function(_0x437ee6){if(!_0x437ee6){_0x2199f3[_0xeda7('0x1b')](0x194);}return _0x437ee6;};}function handleError(_0x38fe9b,_0x43193e){_0x43193e=_0x43193e||0x1f4;return function(_0x46225a){logger[_0xeda7('0x29')](_0x46225a[_0xeda7('0x2a')]);if(_0x46225a[_0xeda7('0x2b')]){delete _0x46225a['name'];}_0x38fe9b[_0xeda7('0x1d')](_0x43193e)['send'](_0x46225a);};}exports[_0xeda7('0x2c')]=function(_0x427a6d,_0x3707a4){var _0x5a9845={},_0x43f93d={},_0x52266c={'count':0x0,'rows':[]};var _0x514d3a=_[_0xeda7('0x2d')](db[_0xeda7('0x2e')][_0xeda7('0x2f')],function(_0x2e744c){return{'name':_0x2e744c[_0xeda7('0x30')],'type':_0x2e744c[_0xeda7('0x31')][_0xeda7('0x32')]};});_0x43f93d[_0xeda7('0x33')]=_[_0xeda7('0x2d')](_0x514d3a,'name');_0x43f93d[_0xeda7('0x34')]=_[_0xeda7('0x35')](_0x427a6d[_0xeda7('0x34')]);_0x43f93d[_0xeda7('0x36')]=_[_0xeda7('0x37')](_0x43f93d[_0xeda7('0x33')],_0x43f93d[_0xeda7('0x34')]);_0x5a9845[_0xeda7('0x38')]=_[_0xeda7('0x37')](_0x43f93d['model'],qs[_0xeda7('0x39')](_0x427a6d[_0xeda7('0x34')][_0xeda7('0x39')]));_0x5a9845[_0xeda7('0x38')]=_0x5a9845[_0xeda7('0x38')][_0xeda7('0x3a')]?_0x5a9845['attributes']:_0x43f93d['model'];if(!_0x427a6d[_0xeda7('0x34')][_0xeda7('0x3b')]('nolimit')){_0x5a9845[_0xeda7('0x20')]=qs[_0xeda7('0x20')](_0x427a6d[_0xeda7('0x34')][_0xeda7('0x20')]);_0x5a9845[_0xeda7('0x1f')]=qs['offset'](_0x427a6d[_0xeda7('0x34')][_0xeda7('0x1f')]);}_0x5a9845[_0xeda7('0x3c')]=qs[_0xeda7('0x3d')](_0x427a6d[_0xeda7('0x34')][_0xeda7('0x3d')]);_0x5a9845[_0xeda7('0x3e')]=qs[_0xeda7('0x36')](_[_0xeda7('0x3f')](_0x427a6d[_0xeda7('0x34')],_0x43f93d['filters']),_0x514d3a);if(_0x427a6d['query'][_0xeda7('0x40')]){_0x5a9845['where']=_[_0xeda7('0x41')](_0x5a9845['where'],{'$or':_[_0xeda7('0x2d')](_0x514d3a,function(_0x2a4d51){if(_0x2a4d51[_0xeda7('0x31')]!=='VIRTUAL'){var _0x36c03d={};_0x36c03d[_0x2a4d51[_0xeda7('0x2b')]]={'$like':'%'+_0x427a6d[_0xeda7('0x34')][_0xeda7('0x40')]+'%'};return _0x36c03d;}})});}_0x5a9845=_[_0xeda7('0x41')]({},_0x5a9845,_0x427a6d[_0xeda7('0x42')]);var _0x4ff0ef={'where':_0x5a9845[_0xeda7('0x3e')]};return db[_0xeda7('0x2e')][_0xeda7('0x22')](_0x4ff0ef)['then'](function(_0x1ca90d){_0x52266c[_0xeda7('0x22')]=_0x1ca90d;if(_0x427a6d[_0xeda7('0x34')][_0xeda7('0x43')]){_0x5a9845[_0xeda7('0x44')]=[{'all':!![]}];}return db[_0xeda7('0x2e')][_0xeda7('0x45')](_0x5a9845);})[_0xeda7('0x28')](function(_0x3f35e6){_0x52266c[_0xeda7('0x46')]=_0x3f35e6;return _0x52266c;})[_0xeda7('0x28')](respondWithFilteredResult(_0x3707a4,_0x5a9845))[_0xeda7('0x47')](handleError(_0x3707a4,null));};exports[_0xeda7('0x48')]=function(_0x683b4c,_0x1a8255){var _0x25dd6a={'raw':!![],'where':{'id':_0x683b4c[_0xeda7('0x49')]['id']}},_0x1dcf5b={};_0x1dcf5b['model']=_['keys'](db[_0xeda7('0x2e')]['rawAttributes']);_0x1dcf5b[_0xeda7('0x34')]=_[_0xeda7('0x35')](_0x683b4c[_0xeda7('0x34')]);_0x1dcf5b[_0xeda7('0x36')]=_[_0xeda7('0x37')](_0x1dcf5b[_0xeda7('0x33')],_0x1dcf5b[_0xeda7('0x34')]);_0x25dd6a[_0xeda7('0x38')]=_[_0xeda7('0x37')](_0x1dcf5b[_0xeda7('0x33')],qs[_0xeda7('0x39')](_0x683b4c[_0xeda7('0x34')]['fields']));_0x25dd6a[_0xeda7('0x38')]=_0x25dd6a[_0xeda7('0x38')][_0xeda7('0x3a')]?_0x25dd6a[_0xeda7('0x38')]:_0x1dcf5b[_0xeda7('0x33')];if(_0x683b4c[_0xeda7('0x34')]['includeAll']){_0x25dd6a['include']=[{'all':!![]}];}_0x25dd6a=_['merge']({},_0x25dd6a,_0x683b4c[_0xeda7('0x42')]);return db[_0xeda7('0x2e')]['find'](_0x25dd6a)[_0xeda7('0x28')](handleEntityNotFound(_0x1a8255,null))[_0xeda7('0x28')](respondWithResult(_0x1a8255,null))[_0xeda7('0x47')](handleError(_0x1a8255,null));};exports[_0xeda7('0x4a')]=function(_0x24c4b8,_0x2195a5){return db[_0xeda7('0x2e')][_0xeda7('0x4a')](_0x24c4b8['body'],{})['then'](respondWithResult(_0x2195a5,0xc9))['catch'](handleError(_0x2195a5,null));};exports['describe']=function(_0x4759a2,_0x16ca63){return db['CmHopperHistory'][_0xeda7('0x4b')]()['then'](respondWithResult(_0x16ca63,null))[_0xeda7('0x47')](handleError(_0x16ca63,null));};exports[_0xeda7('0x27')]=function(_0x511205,_0x1d73a0){if(_0x511205[_0xeda7('0x4c')]['uniqueid']){delete _0x511205[_0xeda7('0x4c')][_0xeda7('0x4d')];}return db[_0xeda7('0x2e')][_0xeda7('0x4e')]({'where':{'uniqueid':_0x511205[_0xeda7('0x49')]['id']}})[_0xeda7('0x28')](handleEntityNotFound(_0x1d73a0,null))[_0xeda7('0x28')](saveUpdates(_0x511205['body'],null))[_0xeda7('0x28')](respondWithResult(_0x1d73a0,null))[_0xeda7('0x47')](handleError(_0x1d73a0,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 7940870..18e6a91 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 _0x3f35=['../../config/logger','api','moment','bluebird','request-promise','rimraf','./cmHopperHistory.attributes','define','CmHopperHistory','endtime','lodash','util'];(function(_0x594050,_0x200eb5){var _0x465eff=function(_0x1cecc6){while(--_0x1cecc6){_0x594050['push'](_0x594050['shift']());}};_0x465eff(++_0x200eb5);}(_0x3f35,0x1ae));var _0x53f3=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x3f35[_0x1a36a5];return _0x746243;};'use strict';var _=require(_0x53f3('0x0'));var util=require(_0x53f3('0x1'));var logger=require(_0x53f3('0x2'))(_0x53f3('0x3'));var moment=require(_0x53f3('0x4'));var BPromise=require(_0x53f3('0x5'));var rp=require(_0x53f3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x53f3('0x7'));var config=require('../../config/environment');var attributes=require(_0x53f3('0x8'));module['exports']=function(_0x1b84bf,_0x325130){return _0x1b84bf[_0x53f3('0x9')](_0x53f3('0xa'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x53f3('0xb'),'fields':['endtime']},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x419f=['util','../../config/logger','api','moment','bluebird','path','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x419f,0x176));var _0xf419=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x419f[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0xf419('0x0'));var util=require(_0xf419('0x1'));var logger=require(_0xf419('0x2'))(_0xf419('0x3'));var moment=require(_0xf419('0x4'));var BPromise=require(_0xf419('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf419('0x6'));var rimraf=require('rimraf');var config=require(_0xf419('0x7'));var attributes=require(_0xf419('0x8'));module[_0xf419('0x9')]=function(_0x38f2fa,_0x2d8430){return _0x38f2fa[_0xf419('0xa')](_0xf419('0xb'),attributes,{'tableName':_0xf419('0xc'),'paranoid':![],'indexes':[{'name':_0xf419('0xd'),'fields':['endtime']},{'name':_0xf419('0xe'),'fields':[_0xf419('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 902da90..ccb85e0 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 _0x6ede=['ivrAnswerCallsDay','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','info','CmHopperHistory,\x20%s,\x20%s','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','CreateCmHopperHistory','CmHopperHistory','options','raw','AvgHandleTime','findAll','sequelize','predictiveIntervalTotalCalls','COUNT','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','then','GetVoiceQueueHopperHistory','where','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x208,\x201,\x20null','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','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','name','col'];(function(_0x351739,_0x5641aa){var _0x4e35c7=function(_0x48f27a){while(--_0x48f27a){_0x351739['push'](_0x351739['shift']());}};_0x4e35c7(++_0x5641aa);}(_0x6ede,0x83));var _0xe6ed=function(_0x5e4ffa,_0x56154d){_0x5e4ffa=_0x5e4ffa-0x0;var _0x43a656=_0x6ede[_0x5e4ffa];return _0x43a656;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xe6ed('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe6ed('0x1'));var db=require(_0xe6ed('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xe6ed('0x3'))('rpc');var config=require(_0xe6ed('0x4'));var jayson=require(_0xe6ed('0x5'));var client=jayson['client'][_0xe6ed('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x389397,_0x2b58cd,_0x2d4657){return new BPromise(function(_0xdcff96,_0x3e3b6f){return client[_0xe6ed('0x7')](_0x389397,_0x2d4657)['then'](function(_0x58e859){logger[_0xe6ed('0x8')](_0xe6ed('0x9'),_0x2b58cd,'request\x20sent');logger[_0xe6ed('0xa')](_0xe6ed('0xb'),_0x2b58cd,'request\x20sent',JSON[_0xe6ed('0xc')](_0x58e859));if(_0x58e859[_0xe6ed('0xd')]){if(_0x58e859[_0xe6ed('0xd')][_0xe6ed('0xe')]===0x1f4){logger['error'](_0xe6ed('0x9'),_0x2b58cd,_0x58e859['error']['message']);return _0x3e3b6f(_0x58e859[_0xe6ed('0xd')][_0xe6ed('0xf')]);}logger[_0xe6ed('0xd')](_0xe6ed('0x9'),_0x2b58cd,_0x58e859[_0xe6ed('0xd')][_0xe6ed('0xf')]);return _0xdcff96(_0x58e859[_0xe6ed('0xd')][_0xe6ed('0xf')]);}else{logger[_0xe6ed('0x8')](_0xe6ed('0x9'),_0x2b58cd,_0xe6ed('0x10'));_0xdcff96(_0x58e859['result'][_0xe6ed('0xf')]);}})[_0xe6ed('0x11')](function(_0x49dadb){logger[_0xe6ed('0xd')](_0xe6ed('0x9'),_0x2b58cd,_0x49dadb);_0x3e3b6f(_0x49dadb);});});}exports[_0xe6ed('0x12')]=function(_0xfc7078){var _0x2dd04c=this;return new Promise(function(_0x147a8c,_0x2ebf01){return db[_0xe6ed('0x13')]['create'](_0xfc7078['body'],{'raw':_0xfc7078[_0xe6ed('0x14')]?_0xfc7078[_0xe6ed('0x14')][_0xe6ed('0x15')]===undefined?!![]:![]:!![]})['then'](function(_0x2cc077){logger['info'](_0xe6ed('0x12'),_0xfc7078);logger['debug'](_0xe6ed('0x12'),_0xfc7078,JSON['stringify'](_0x2cc077));_0x147a8c(_0x2cc077);})[_0xe6ed('0x11')](function(_0x283e71){logger['error'](_0xe6ed('0x12'),_0x283e71[_0xe6ed('0xf')],_0xfc7078);_0x2ebf01(_0x2dd04c['error'](0x1f4,_0x283e71[_0xe6ed('0xf')]));});});};exports[_0xe6ed('0x16')]=function(_0x415027){var _0x5e1aa4=this;return new Promise(function(_0x468e56,_0xf8805d){return db[_0xe6ed('0x13')][_0xe6ed('0x17')]({'raw':_0x415027['options']?_0x415027[_0xe6ed('0x14')][_0xe6ed('0x15')]===undefined?!![]:![]:!![],'where':_0x415027[_0xe6ed('0x14')]?_0x415027[_0xe6ed('0x14')]['where']||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0xe6ed('0x18')]['col']('id')),_0xe6ed('0x19')],[db[_0xe6ed('0x18')]['fn'](_0xe6ed('0x1a'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xe6ed('0x1b')))),_0xe6ed('0x1c')],[db[_0xe6ed('0x18')]['fn'](_0xe6ed('0x1a'),db[_0xe6ed('0x18')]['fn']('IF',db['sequelize'][_0xe6ed('0x1d')](_0xe6ed('0x1e')))),'predictiveIntervalDroppedCallsTimeout'],[db['sequelize']['fn'](_0xe6ed('0x1a'),db['sequelize']['fn']('IF',db['sequelize'][_0xe6ed('0x1d')](_0xe6ed('0x1f')))),_0xe6ed('0x20')],[db['sequelize']['fn'](_0xe6ed('0x21'),db['sequelize']['fn']('IF',db[_0xe6ed('0x18')][_0xe6ed('0x1d')](_0xe6ed('0x22')))),_0xe6ed('0x23')],[db[_0xe6ed('0x18')]['fn'](_0xe6ed('0x21'),db['sequelize']['fn']('IF',db[_0xe6ed('0x18')][_0xe6ed('0x1d')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0xe6ed('0x24')]]})[_0xe6ed('0x25')](function(_0x27c4ba){logger['info'](_0xe6ed('0x16'),_0x415027);logger['debug'](_0xe6ed('0x16'),_0x415027,JSON['stringify'](_0x27c4ba));_0x468e56(_0x27c4ba);})['catch'](function(_0xacd4b8){logger[_0xe6ed('0xd')](_0xe6ed('0x16'),_0xacd4b8[_0xe6ed('0xf')],_0x415027);_0xf8805d(_0x5e1aa4[_0xe6ed('0xd')](0x1f4,_0xacd4b8[_0xe6ed('0xf')]));});});};exports[_0xe6ed('0x26')]=function(_0x13388b){var _0x47a8fc=this;return new Promise(function(_0xe4a41a,_0xa5b1f0){return db[_0xe6ed('0x13')][_0xe6ed('0x17')]({'raw':_0x13388b['options']?_0x13388b['options'][_0xe6ed('0x15')]===undefined?!![]:![]:!![],'where':_0x13388b[_0xe6ed('0x14')]?_0x13388b[_0xe6ed('0x14')][_0xe6ed('0x27')]||null:null,'attributes':[[_0xe6ed('0x28'),'name'],[db[_0xe6ed('0x18')]['fn']('COUNT',db[_0xe6ed('0x18')]['fn']('IF',db[_0xe6ed('0x18')][_0xe6ed('0x1d')](_0xe6ed('0x29')))),_0xe6ed('0x2a')],[db[_0xe6ed('0x18')]['fn'](_0xe6ed('0x1a'),db[_0xe6ed('0x18')]['fn']('IF',db[_0xe6ed('0x18')]['literal'](_0xe6ed('0x2b')))),_0xe6ed('0x2c')],[db[_0xe6ed('0x18')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xe6ed('0x1d')]('`state`\x20=\x204,\x201,\x20null'))),_0xe6ed('0x2d')],[db['sequelize']['fn'](_0xe6ed('0x1a'),db[_0xe6ed('0x18')]['fn']('IF',db[_0xe6ed('0x18')][_0xe6ed('0x1d')]('`state`\x20=\x205,\x201,\x20null'))),'outboundBusyCallsDay'],[db[_0xe6ed('0x18')]['fn'](_0xe6ed('0x1a'),db[_0xe6ed('0x18')]['fn']('IF',db['sequelize']['literal'](_0xe6ed('0x2e')))),_0xe6ed('0x2f')],[db[_0xe6ed('0x18')]['fn'](_0xe6ed('0x1a'),db[_0xe6ed('0x18')]['fn']('IF',db[_0xe6ed('0x18')][_0xe6ed('0x1d')](_0xe6ed('0x30')))),'outboundDropCallsDayTimeout'],[db['sequelize']['fn'](_0xe6ed('0x1a'),db[_0xe6ed('0x18')]['fn']('IF',db['sequelize'][_0xe6ed('0x1d')](_0xe6ed('0x31')))),_0xe6ed('0x32')],[db[_0xe6ed('0x18')]['fn'](_0xe6ed('0x1a'),db[_0xe6ed('0x18')]['fn']('IF',db['sequelize'][_0xe6ed('0x1d')](_0xe6ed('0x33')))),_0xe6ed('0x34')],[db[_0xe6ed('0x18')]['fn']('COUNT',db[_0xe6ed('0x18')]['fn']('IF',db[_0xe6ed('0x18')][_0xe6ed('0x1d')](_0xe6ed('0x35')))),'outboundBlacklistCallsDay'],[db[_0xe6ed('0x18')]['fn']('COUNT',db[_0xe6ed('0x18')]['fn']('IF',db[_0xe6ed('0x18')]['literal'](_0xe6ed('0x36')))),'outboundOriginateFailureCallsDay'],[db[_0xe6ed('0x18')]['fn'](_0xe6ed('0x1a'),db[_0xe6ed('0x18')]['fn']('IF',db[_0xe6ed('0x18')]['literal'](_0xe6ed('0x37')))),_0xe6ed('0x38')],[db[_0xe6ed('0x18')]['fn'](_0xe6ed('0x1a'),db[_0xe6ed('0x18')]['fn']('IF',db[_0xe6ed('0x18')][_0xe6ed('0x1d')](_0xe6ed('0x39')))),_0xe6ed('0x3a')],[db['sequelize']['fn'](_0xe6ed('0x1a'),db['sequelize']['fn']('IF',db[_0xe6ed('0x18')]['literal'](_0xe6ed('0x3b')))),'outboundRejectCallsDay'],[db[_0xe6ed('0x18')]['fn'](_0xe6ed('0x1a'),db[_0xe6ed('0x18')]['fn']('IF',db[_0xe6ed('0x18')][_0xe6ed('0x1d')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0xe6ed('0x3c')]],'group':[_0xe6ed('0x28')]})[_0xe6ed('0x25')](function(_0x3b269d){logger[_0xe6ed('0x8')](_0xe6ed('0x26'),_0x13388b);logger[_0xe6ed('0xa')]('GetVoiceQueueHopperHistory',_0x13388b,JSON[_0xe6ed('0xc')](_0x3b269d));_0xe4a41a(_0x3b269d);})[_0xe6ed('0x11')](function(_0x52ef3a){logger[_0xe6ed('0xd')](_0xe6ed('0x26'),_0x52ef3a[_0xe6ed('0xf')],_0x13388b);_0xa5b1f0(_0x47a8fc[_0xe6ed('0xd')](0x1f4,_0x52ef3a[_0xe6ed('0xf')]));});});};exports[_0xe6ed('0x3d')]=function(_0x39db8f){var _0x2e4fa9=this;return new Promise(function(_0x392511,_0x342c3b){return db[_0xe6ed('0x13')][_0xe6ed('0x17')]({'raw':_0x39db8f['options']?_0x39db8f[_0xe6ed('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x39db8f[_0xe6ed('0x14')]?_0x39db8f['options']['where']||null:null,'attributes':[['campaign',_0xe6ed('0x3e')],[db[_0xe6ed('0x18')]['fn']('COUNT',db[_0xe6ed('0x18')][_0xe6ed('0x3f')]('id')),'ivrTotalCallsDays'],[db[_0xe6ed('0x18')]['fn'](_0xe6ed('0x1a'),db[_0xe6ed('0x18')]['fn']('IF',db[_0xe6ed('0x18')][_0xe6ed('0x1d')](_0xe6ed('0x1b')))),_0xe6ed('0x40')]],'group':[_0xe6ed('0x28')]})['then'](function(_0x4fa37c){logger['info'](_0xe6ed('0x3d'),_0x39db8f);logger[_0xe6ed('0xa')](_0xe6ed('0x3d'),_0x39db8f,JSON['stringify'](_0x4fa37c));_0x392511(_0x4fa37c);})[_0xe6ed('0x11')](function(_0x340945){logger['error'](_0xe6ed('0x3d'),_0x340945['message'],_0x39db8f);_0x342c3b(_0x2e4fa9[_0xe6ed('0xd')](0x1f4,_0x340945['message']));});});}; \ No newline at end of file +var _0xe1ee=['message','request\x20sent','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','stringify','AvgHandleTime','raw','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','findAll','name','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','campaign','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','http','then','info','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','CmHopperHistory,\x20%s,\x20%s'];(function(_0x625a7b,_0x4a31b5){var _0x103751=function(_0x272750){while(--_0x272750){_0x625a7b['push'](_0x625a7b['shift']());}};_0x103751(++_0x4a31b5);}(_0xe1ee,0x158));var _0xee1e=function(_0x1e7d80,_0x28ea35){_0x1e7d80=_0x1e7d80-0x0;var _0x1fb199=_0xe1ee[_0x1e7d80];return _0x1fb199;};'use strict';var _=require(_0xee1e('0x0'));var util=require(_0xee1e('0x1'));var moment=require('moment');var BPromise=require(_0xee1e('0x2'));var rs=require(_0xee1e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xee1e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xee1e('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xee1e('0x6'));var client=jayson[_0xee1e('0x7')][_0xee1e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3dbd99,_0x4dcff2,_0x335d60){return new BPromise(function(_0x5d549e,_0x575700){return client['request'](_0x3dbd99,_0x335d60)[_0xee1e('0x9')](function(_0x14d58b){logger[_0xee1e('0xa')]('CmHopperHistory,\x20%s,\x20%s',_0x4dcff2,'request\x20sent');logger[_0xee1e('0xb')](_0xee1e('0xc'),_0x4dcff2,'request\x20sent',JSON['stringify'](_0x14d58b));if(_0x14d58b[_0xee1e('0xd')]){if(_0x14d58b[_0xee1e('0xd')][_0xee1e('0xe')]===0x1f4){logger[_0xee1e('0xd')](_0xee1e('0xf'),_0x4dcff2,_0x14d58b['error'][_0xee1e('0x10')]);return _0x575700(_0x14d58b[_0xee1e('0xd')][_0xee1e('0x10')]);}logger[_0xee1e('0xd')](_0xee1e('0xf'),_0x4dcff2,_0x14d58b[_0xee1e('0xd')]['message']);return _0x5d549e(_0x14d58b[_0xee1e('0xd')]['message']);}else{logger[_0xee1e('0xa')]('CmHopperHistory,\x20%s,\x20%s',_0x4dcff2,_0xee1e('0x11'));_0x5d549e(_0x14d58b['result'][_0xee1e('0x10')]);}})[_0xee1e('0x12')](function(_0x3f579f){logger[_0xee1e('0xd')](_0xee1e('0xf'),_0x4dcff2,_0x3f579f);_0x575700(_0x3f579f);});});}exports[_0xee1e('0x13')]=function(_0xd6cb33){var _0x518044=this;return new Promise(function(_0x2ceeb1,_0x20c0a1){return db[_0xee1e('0x14')][_0xee1e('0x15')](_0xd6cb33[_0xee1e('0x16')],{'raw':_0xd6cb33[_0xee1e('0x17')]?_0xd6cb33[_0xee1e('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xee1e('0x9')](function(_0x21e0f5){logger['info'](_0xee1e('0x13'),_0xd6cb33);logger[_0xee1e('0xb')]('CreateCmHopperHistory',_0xd6cb33,JSON[_0xee1e('0x18')](_0x21e0f5));_0x2ceeb1(_0x21e0f5);})[_0xee1e('0x12')](function(_0x16df32){logger[_0xee1e('0xd')](_0xee1e('0x13'),_0x16df32[_0xee1e('0x10')],_0xd6cb33);_0x20c0a1(_0x518044['error'](0x1f4,_0x16df32[_0xee1e('0x10')]));});});};exports[_0xee1e('0x19')]=function(_0x2d5921){var _0x5c8d99=this;return new Promise(function(_0x1887c7,_0x17240c){return db[_0xee1e('0x14')]['findAll']({'raw':_0x2d5921['options']?_0x2d5921[_0xee1e('0x17')][_0xee1e('0x1a')]===undefined?!![]:![]:!![],'where':_0x2d5921[_0xee1e('0x17')]?_0x2d5921[_0xee1e('0x17')][_0xee1e('0x1b')]||null:null,'attributes':[[db[_0xee1e('0x1c')]['fn'](_0xee1e('0x1d'),db[_0xee1e('0x1c')][_0xee1e('0x1e')]('id')),_0xee1e('0x1f')],[db['sequelize']['fn'](_0xee1e('0x1d'),db['sequelize']['fn']('IF',db[_0xee1e('0x1c')][_0xee1e('0x20')](_0xee1e('0x21')))),'predictiveIntervalAnsweredCalls'],[db['sequelize']['fn'](_0xee1e('0x1d'),db[_0xee1e('0x1c')]['fn']('IF',db['sequelize'][_0xee1e('0x20')](_0xee1e('0x22')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0xee1e('0x1c')]['fn'](_0xee1e('0x1d'),db[_0xee1e('0x1c')]['fn']('IF',db[_0xee1e('0x1c')]['literal'](_0xee1e('0x23')))),_0xee1e('0x24')],[db[_0xee1e('0x1c')]['fn'](_0xee1e('0x25'),db[_0xee1e('0x1c')]['fn']('IF',db['sequelize'][_0xee1e('0x20')](_0xee1e('0x26')))),_0xee1e('0x27')],[db[_0xee1e('0x1c')]['fn'](_0xee1e('0x25'),db[_0xee1e('0x1c')]['fn']('IF',db['sequelize'][_0xee1e('0x20')](_0xee1e('0x28')))),_0xee1e('0x29')]]})[_0xee1e('0x9')](function(_0x4ec8e2){logger[_0xee1e('0xa')](_0xee1e('0x19'),_0x2d5921);logger['debug'](_0xee1e('0x19'),_0x2d5921,JSON[_0xee1e('0x18')](_0x4ec8e2));_0x1887c7(_0x4ec8e2);})['catch'](function(_0x5bd318){logger['error'](_0xee1e('0x19'),_0x5bd318[_0xee1e('0x10')],_0x2d5921);_0x17240c(_0x5c8d99['error'](0x1f4,_0x5bd318[_0xee1e('0x10')]));});});};exports[_0xee1e('0x2a')]=function(_0x503607){var _0x26bde2=this;return new Promise(function(_0x5eeed6,_0x1aa62e){return db[_0xee1e('0x14')][_0xee1e('0x2b')]({'raw':_0x503607[_0xee1e('0x17')]?_0x503607[_0xee1e('0x17')][_0xee1e('0x1a')]===undefined?!![]:![]:!![],'where':_0x503607['options']?_0x503607[_0xee1e('0x17')][_0xee1e('0x1b')]||null:null,'attributes':[['campaign',_0xee1e('0x2c')],[db[_0xee1e('0x1c')]['fn'](_0xee1e('0x1d'),db['sequelize']['fn']('IF',db[_0xee1e('0x1c')][_0xee1e('0x20')](_0xee1e('0x2d')))),'outboundNoSuchCallsDay'],[db['sequelize']['fn']('COUNT',db[_0xee1e('0x1c')]['fn']('IF',db[_0xee1e('0x1c')][_0xee1e('0x20')](_0xee1e('0x2e')))),_0xee1e('0x2f')],[db[_0xee1e('0x1c')]['fn'](_0xee1e('0x1d'),db[_0xee1e('0x1c')]['fn']('IF',db['sequelize'][_0xee1e('0x20')]('`state`\x20=\x204,\x201,\x20null'))),_0xee1e('0x30')],[db[_0xee1e('0x1c')]['fn']('COUNT',db[_0xee1e('0x1c')]['fn']('IF',db[_0xee1e('0x1c')][_0xee1e('0x20')](_0xee1e('0x31')))),_0xee1e('0x32')],[db[_0xee1e('0x1c')]['fn'](_0xee1e('0x1d'),db['sequelize']['fn']('IF',db['sequelize'][_0xee1e('0x20')](_0xee1e('0x33')))),'outboundCongestionCallsDay'],[db[_0xee1e('0x1c')]['fn'](_0xee1e('0x1d'),db[_0xee1e('0x1c')]['fn']('IF',db[_0xee1e('0x1c')][_0xee1e('0x20')](_0xee1e('0x34')))),_0xee1e('0x35')],[db[_0xee1e('0x1c')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xee1e('0x1c')][_0xee1e('0x20')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xee1e('0x36')],[db[_0xee1e('0x1c')]['fn'](_0xee1e('0x1d'),db['sequelize']['fn']('IF',db['sequelize'][_0xee1e('0x20')](_0xee1e('0x37')))),_0xee1e('0x38')],[db[_0xee1e('0x1c')]['fn'](_0xee1e('0x1d'),db['sequelize']['fn']('IF',db['sequelize'][_0xee1e('0x20')](_0xee1e('0x39')))),_0xee1e('0x3a')],[db[_0xee1e('0x1c')]['fn'](_0xee1e('0x1d'),db[_0xee1e('0x1c')]['fn']('IF',db[_0xee1e('0x1c')][_0xee1e('0x20')](_0xee1e('0x3b')))),_0xee1e('0x3c')],[db[_0xee1e('0x1c')]['fn'](_0xee1e('0x1d'),db['sequelize']['fn']('IF',db[_0xee1e('0x1c')][_0xee1e('0x20')](_0xee1e('0x3d')))),_0xee1e('0x3e')],[db[_0xee1e('0x1c')]['fn'](_0xee1e('0x1d'),db[_0xee1e('0x1c')]['fn']('IF',db[_0xee1e('0x1c')][_0xee1e('0x20')](_0xee1e('0x3f')))),_0xee1e('0x40')],[db[_0xee1e('0x1c')]['fn'](_0xee1e('0x1d'),db[_0xee1e('0x1c')]['fn']('IF',db['sequelize'][_0xee1e('0x20')](_0xee1e('0x41')))),_0xee1e('0x3e')],[db[_0xee1e('0x1c')]['fn'](_0xee1e('0x1d'),db[_0xee1e('0x1c')]['fn']('IF',db['sequelize'][_0xee1e('0x20')](_0xee1e('0x42')))),_0xee1e('0x43')]],'group':[_0xee1e('0x44')]})[_0xee1e('0x9')](function(_0x1fe0d9){logger[_0xee1e('0xa')]('GetVoiceQueueHopperHistory',_0x503607);logger[_0xee1e('0xb')]('GetVoiceQueueHopperHistory',_0x503607,JSON['stringify'](_0x1fe0d9));_0x5eeed6(_0x1fe0d9);})[_0xee1e('0x12')](function(_0x5bd396){logger[_0xee1e('0xd')]('GetVoiceQueueHopperHistory',_0x5bd396[_0xee1e('0x10')],_0x503607);_0x1aa62e(_0x26bde2[_0xee1e('0xd')](0x1f4,_0x5bd396['message']));});});};exports[_0xee1e('0x45')]=function(_0x39e73f){var _0x79f947=this;return new Promise(function(_0x266e07,_0x44ed17){return db[_0xee1e('0x14')][_0xee1e('0x2b')]({'raw':_0x39e73f[_0xee1e('0x17')]?_0x39e73f[_0xee1e('0x17')][_0xee1e('0x1a')]===undefined?!![]:![]:!![],'where':_0x39e73f[_0xee1e('0x17')]?_0x39e73f[_0xee1e('0x17')][_0xee1e('0x1b')]||null:null,'attributes':[[_0xee1e('0x44'),'name'],[db['sequelize']['fn'](_0xee1e('0x1d'),db[_0xee1e('0x1c')]['col']('id')),_0xee1e('0x46')],[db[_0xee1e('0x1c')]['fn'](_0xee1e('0x1d'),db[_0xee1e('0x1c')]['fn']('IF',db[_0xee1e('0x1c')][_0xee1e('0x20')](_0xee1e('0x21')))),_0xee1e('0x47')]],'group':['campaign']})[_0xee1e('0x9')](function(_0x1eb00c){logger[_0xee1e('0xa')]('GetCampaignHopperHistory',_0x39e73f);logger[_0xee1e('0xb')]('GetCampaignHopperHistory',_0x39e73f,JSON[_0xee1e('0x18')](_0x1eb00c));_0x266e07(_0x1eb00c);})[_0xee1e('0x12')](function(_0xb5e42c){logger['error']('GetCampaignHopperHistory',_0xb5e42c[_0xee1e('0x10')],_0x39e73f);_0x44ed17(_0x79f947[_0xee1e('0xd')](0x1f4,_0xb5e42c[_0xee1e('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index d1eda5e..2c71f62 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 _0x9d16=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperHistory.controller','get','isAuthenticated','/describe','/:id','show','post','put','update','exports','multer'];(function(_0x5c512d,_0x477128){var _0x52ebb4=function(_0x5add7c){while(--_0x5add7c){_0x5c512d['push'](_0x5c512d['shift']());}};_0x52ebb4(++_0x477128);}(_0x9d16,0x179));var _0x69d1=function(_0x3747ae,_0x408e61){_0x3747ae=_0x3747ae-0x0;var _0x339035=_0x9d16[_0x3747ae];return _0x339035;};'use strict';var multer=require(_0x69d1('0x0'));var util=require(_0x69d1('0x1'));var path=require(_0x69d1('0x2'));var timeout=require(_0x69d1('0x3'));var express=require(_0x69d1('0x4'));var router=express['Router']();var fs_extra=require(_0x69d1('0x5'));var auth=require(_0x69d1('0x6'));var interaction=require(_0x69d1('0x7'));var config=require('../../config/environment');var controller=require(_0x69d1('0x8'));router[_0x69d1('0x9')]('/',auth[_0x69d1('0xa')](),controller['index']);router['get'](_0x69d1('0xb'),auth[_0x69d1('0xa')](),controller['describe']);router[_0x69d1('0x9')](_0x69d1('0xc'),auth[_0x69d1('0xa')](),controller[_0x69d1('0xd')]);router[_0x69d1('0xe')]('/',auth[_0x69d1('0xa')](),controller['create']);router[_0x69d1('0xf')](_0x69d1('0xc'),auth[_0x69d1('0xa')](),controller[_0x69d1('0x10')]);module[_0x69d1('0x11')]=router; \ No newline at end of file +var _0xb66d=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated','index','/:id','post','create','update','util'];(function(_0x1b484d,_0x349431){var _0x24f38b=function(_0x1c4c9b){while(--_0x1c4c9b){_0x1b484d['push'](_0x1b484d['shift']());}};_0x24f38b(++_0x349431);}(_0xb66d,0x67));var _0xdb66=function(_0x1486e5,_0x39684f){_0x1486e5=_0x1486e5-0x0;var _0x29d89b=_0xb66d[_0x1486e5];return _0x29d89b;};'use strict';var multer=require('multer');var util=require(_0xdb66('0x0'));var path=require('path');var timeout=require(_0xdb66('0x1'));var express=require(_0xdb66('0x2'));var router=express[_0xdb66('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xdb66('0x4'));var config=require(_0xdb66('0x5'));var controller=require(_0xdb66('0x6'));router['get']('/',auth[_0xdb66('0x7')](),controller[_0xdb66('0x8')]);router['get']('/describe',auth[_0xdb66('0x7')](),controller['describe']);router['get'](_0xdb66('0x9'),auth[_0xdb66('0x7')](),controller['show']);router[_0xdb66('0xa')]('/',auth[_0xdb66('0x7')](),controller[_0xdb66('0xb')]);router['put'](_0xdb66('0x9'),auth[_0xdb66('0x7')](),controller[_0xdb66('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index ccd6b62..304b2b2 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 _0xd2bb=['STRING','exports','name'];(function(_0x387452,_0xa9cad){var _0x555b7f=function(_0x21828d){while(--_0x21828d){_0x387452['push'](_0x387452['shift']());}};_0x555b7f(++_0xa9cad);}(_0xd2bb,0x9a));var _0xbd2b=function(_0x2f881d,_0x45c685){_0x2f881d=_0x2f881d-0x0;var _0x27f630=_0xd2bb[_0x2f881d];return _0x27f630;};'use strict';var Sequelize=require('sequelize');module[_0xbd2b('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xbd2b('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xbd2b('0x2')]},'dialPrefix':{'type':Sequelize[_0xbd2b('0x2')]}}; \ No newline at end of file +var _0x4bc3=['name','STRING','sequelize','exports'];(function(_0x1f8a9b,_0x3ce8bb){var _0x4c1722=function(_0x456379){while(--_0x456379){_0x1f8a9b['push'](_0x1f8a9b['shift']());}};_0x4c1722(++_0x3ce8bb);}(_0x4bc3,0x16e));var _0x34bc=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0x4bc3[_0x9c2427];return _0x51984f;};'use strict';var Sequelize=require(_0x34bc('0x0'));module[_0x34bc('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x34bc('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x34bc('0x3')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index acdb5b7..0f5a518 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 _0x36bc=['destroy','get','Lists','UserProfileResource','error','name','send','map','CmList','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','includeAll','include','rows','catch','params','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addDisposition','ListId','Disposition','getDispositions','findOne','pick','options','removeDispositions','ids','addContacts','isArray','tags','push','each','CmContact','omit','success','dataValues','Malformed\x20request\x20syntax','CmCustomField','concat','CustomFields','cf_%d','raw','getContacts','getContactsCsv','format','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','addCustomField','transaction','addCustomFields','Sequelize','text','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cf_%s','findAndCountAll','addAgents','spread','emit','removeAgents','userCmList:remove','getAgents','User','eml-format','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/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','register','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then'];(function(_0x5adf1b,_0x27f88f){var _0x5e8269=function(_0x27d8b3){while(--_0x27d8b3){_0x5adf1b['push'](_0x5adf1b['shift']());}};_0x5e8269(++_0x27f88f);}(_0x36bc,0x18b));var _0xc36b=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x36bc[_0x2763f2];return _0x3ef471;};'use strict';var emlformat=require(_0xc36b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc36b('0x1'));var jsonpatch=require(_0xc36b('0x2'));var rp=require(_0xc36b('0x3'));var moment=require(_0xc36b('0x4'));var BPromise=require(_0xc36b('0x5'));var Mustache=require(_0xc36b('0x6'));var util=require(_0xc36b('0x7'));var path=require(_0xc36b('0x8'));var sox=require(_0xc36b('0x9'));var csv=require(_0xc36b('0xa'));var ejs=require(_0xc36b('0xb'));var fs=require('fs');var fs_extra=require(_0xc36b('0xc'));var _=require(_0xc36b('0xd'));var squel=require(_0xc36b('0xe'));var crypto=require(_0xc36b('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xc36b('0x10'));var toCsv=require('to-csv');var querystring=require(_0xc36b('0x11'));var Papa=require(_0xc36b('0x12'));var Redis=require(_0xc36b('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xc36b('0x14'));var as=require(_0xc36b('0x15'));var hardwareService=require(_0xc36b('0x16'));var logger=require(_0xc36b('0x17'))(_0xc36b('0x18'));var utils=require(_0xc36b('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xc36b('0x1a'));var db=require(_0xc36b('0x1b'))['db'];config['redis']=_['defaults'](config[_0xc36b('0x1c')],{'host':_0xc36b('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc36b('0x1c')]));require('./cmList.socket')[_0xc36b('0x1e')](socket);function respondWithStatusCode(_0x39df55,_0x228936){_0x228936=_0x228936||0xcc;return function(_0xae627a){if(_0xae627a){return _0x39df55[_0xc36b('0x1f')](_0x228936);}return _0x39df55['status'](_0x228936)[_0xc36b('0x20')]();};}function respondWithResult(_0x385ca3,_0x1fff17){_0x1fff17=_0x1fff17||0xc8;return function(_0x5874a2){if(_0x5874a2){return _0x385ca3[_0xc36b('0x21')](_0x1fff17)[_0xc36b('0x22')](_0x5874a2);}};}function respondWithFilteredResult(_0x10e2ed,_0x3c15a1){return function(_0x4fd05d){if(_0x4fd05d){var _0x3eb47b=typeof _0x3c15a1['offset']==='undefined'&&typeof _0x3c15a1[_0xc36b('0x23')]===_0xc36b('0x24');var _0x3d0d40=_0x4fd05d[_0xc36b('0x25')];var _0x2f4a94=_0x3eb47b?0x0:_0x3c15a1[_0xc36b('0x26')];var _0x4d24f5=_0x3eb47b?_0x4fd05d[_0xc36b('0x25')]:_0x3c15a1[_0xc36b('0x26')]+_0x3c15a1[_0xc36b('0x23')];var _0x1fa887;if(_0x4d24f5>=_0x3d0d40){_0x4d24f5=_0x3d0d40;_0x1fa887=0xc8;}else{_0x1fa887=0xce;}_0x10e2ed['status'](_0x1fa887);return _0x10e2ed[_0xc36b('0x27')](_0xc36b('0x28'),_0x2f4a94+'-'+_0x4d24f5+'/'+_0x3d0d40)['json'](_0x4fd05d);}return null;};}function patchUpdates(_0x1be88d){return function(_0x161490){try{jsonpatch[_0xc36b('0x29')](_0x161490,_0x1be88d,!![]);}catch(_0x23a7dc){return BPromise[_0xc36b('0x2a')](_0x23a7dc);}return _0x161490[_0xc36b('0x2b')]();};}function saveUpdates(_0x3452a4,_0x204310){return function(_0x469427){if(_0x469427){return _0x469427[_0xc36b('0x2c')](_0x3452a4)[_0xc36b('0x2d')](function(_0x282182){return _0x282182;});}return null;};}function removeEntity(_0x19d480,_0x514a66){return function(_0x367d07){if(_0x367d07){return _0x367d07[_0xc36b('0x2e')]()[_0xc36b('0x2d')](function(){var _0x49bdc9=_0x367d07[_0xc36b('0x2f')]({'plain':!![]});var _0x364d9e=_0xc36b('0x30');return db[_0xc36b('0x31')][_0xc36b('0x2e')]({'where':{'type':_0x364d9e,'resourceId':_0x49bdc9['id']}})['then'](function(){return _0x367d07;});})[_0xc36b('0x2d')](function(){_0x19d480[_0xc36b('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x551d0f,_0xabb159){return function(_0x2af97f){if(!_0x2af97f){_0x551d0f[_0xc36b('0x1f')](0x194);}return _0x2af97f;};}function handleError(_0x3c1763,_0x53796c){_0x53796c=_0x53796c||0x1f4;return function(_0x304e45){logger[_0xc36b('0x32')](_0x304e45['stack']);if(_0x304e45[_0xc36b('0x33')]){delete _0x304e45[_0xc36b('0x33')];}_0x3c1763[_0xc36b('0x21')](_0x53796c)[_0xc36b('0x34')](_0x304e45);};}exports['index']=function(_0x261040,_0x4a5e87){var _0x573db={},_0x58b7ea={},_0x305e1d={'count':0x0,'rows':[]};var _0x1833a5=_[_0xc36b('0x35')](db[_0xc36b('0x36')][_0xc36b('0x37')],function(_0x2bff01){return{'name':_0x2bff01[_0xc36b('0x38')],'type':_0x2bff01[_0xc36b('0x39')][_0xc36b('0x3a')]};});_0x58b7ea[_0xc36b('0x3b')]=_['map'](_0x1833a5,_0xc36b('0x33'));_0x58b7ea[_0xc36b('0x3c')]=_['keys'](_0x261040[_0xc36b('0x3c')]);_0x58b7ea[_0xc36b('0x3d')]=_[_0xc36b('0x3e')](_0x58b7ea[_0xc36b('0x3b')],_0x58b7ea[_0xc36b('0x3c')]);_0x573db[_0xc36b('0x3f')]=_['intersection'](_0x58b7ea['model'],qs[_0xc36b('0x40')](_0x261040[_0xc36b('0x3c')][_0xc36b('0x40')]));_0x573db['attributes']=_0x573db['attributes'][_0xc36b('0x41')]?_0x573db[_0xc36b('0x3f')]:_0x58b7ea[_0xc36b('0x3b')];if(!_0x261040[_0xc36b('0x3c')][_0xc36b('0x42')](_0xc36b('0x43'))){_0x573db[_0xc36b('0x23')]=qs[_0xc36b('0x23')](_0x261040[_0xc36b('0x3c')][_0xc36b('0x23')]);_0x573db[_0xc36b('0x26')]=qs[_0xc36b('0x26')](_0x261040[_0xc36b('0x3c')]['offset']);}_0x573db[_0xc36b('0x44')]=qs[_0xc36b('0x45')](_0x261040[_0xc36b('0x3c')][_0xc36b('0x45')]);_0x573db[_0xc36b('0x46')]=qs[_0xc36b('0x3d')](_['pick'](_0x261040[_0xc36b('0x3c')],_0x58b7ea[_0xc36b('0x3d')]),_0x1833a5);if(_0x261040['query']['filter']){_0x573db['where']=_['merge'](_0x573db['where'],{'$or':_[_0xc36b('0x35')](_0x1833a5,function(_0x455c24){if(_0x455c24['type']!==_0xc36b('0x47')){var _0x4a2c57={};_0x4a2c57[_0x455c24[_0xc36b('0x33')]]={'$like':'%'+_0x261040[_0xc36b('0x3c')][_0xc36b('0x48')]+'%'};return _0x4a2c57;}})});}_0x573db=_[_0xc36b('0x49')]({},_0x573db,_0x261040['options']);var _0x303855={'where':_0x573db[_0xc36b('0x46')]};return db[_0xc36b('0x36')][_0xc36b('0x25')](_0x303855)['then'](function(_0x5565bf){_0x305e1d[_0xc36b('0x25')]=_0x5565bf;if(_0x261040[_0xc36b('0x3c')][_0xc36b('0x4a')]){_0x573db[_0xc36b('0x4b')]=[{'all':!![]}];}return db[_0xc36b('0x36')]['findAll'](_0x573db);})['then'](function(_0x2eaf9a){_0x305e1d[_0xc36b('0x4c')]=_0x2eaf9a;return _0x305e1d;})[_0xc36b('0x2d')](respondWithFilteredResult(_0x4a5e87,_0x573db))[_0xc36b('0x4d')](handleError(_0x4a5e87,null));};exports['show']=function(_0x3fb803,_0x4a8547){var _0x4728a3={'raw':![],'where':{'id':_0x3fb803[_0xc36b('0x4e')]['id']}},_0x4e2750={};_0x4e2750['model']=_[_0xc36b('0x4f')](db[_0xc36b('0x36')]['rawAttributes']);_0x4e2750[_0xc36b('0x3c')]=_[_0xc36b('0x4f')](_0x3fb803[_0xc36b('0x3c')]);_0x4e2750[_0xc36b('0x3d')]=_[_0xc36b('0x3e')](_0x4e2750[_0xc36b('0x3b')],_0x4e2750[_0xc36b('0x3c')]);_0x4728a3[_0xc36b('0x3f')]=_[_0xc36b('0x3e')](_0x4e2750['model'],qs[_0xc36b('0x40')](_0x3fb803['query'][_0xc36b('0x40')]));_0x4728a3[_0xc36b('0x3f')]=_0x4728a3[_0xc36b('0x3f')][_0xc36b('0x41')]?_0x4728a3['attributes']:_0x4e2750[_0xc36b('0x3b')];if(_0x3fb803[_0xc36b('0x3c')][_0xc36b('0x4a')]){_0x4728a3[_0xc36b('0x4b')]=[{'all':!![]}];}_0x4728a3=_[_0xc36b('0x49')]({},_0x4728a3,_0x3fb803['options']);return db[_0xc36b('0x36')][_0xc36b('0x50')](_0x4728a3)[_0xc36b('0x2d')](handleEntityNotFound(_0x4a8547,null))[_0xc36b('0x2d')](respondWithResult(_0x4a8547,null))['catch'](handleError(_0x4a8547,null));};exports[_0xc36b('0x51')]=function(_0x4907c1,_0x51ebbe){return db[_0xc36b('0x36')]['create'](_0x4907c1['body'],{})[_0xc36b('0x2d')](function(_0x23aa07){var _0x2123af=_0x4907c1[_0xc36b('0x52')][_0xc36b('0x2f')]({'plain':!![]});if(!_0x2123af)throw new Error(_0xc36b('0x53'));if(_0x2123af[_0xc36b('0x54')]===_0xc36b('0x52')){var _0x23f5fb=_0x23aa07[_0xc36b('0x2f')]({'plain':!![]});var _0x5aee8d=_0xc36b('0x30');return db['UserProfileSection'][_0xc36b('0x50')]({'where':{'name':_0x5aee8d,'userProfileId':_0x2123af[_0xc36b('0x55')]},'raw':!![]})[_0xc36b('0x2d')](function(_0x37211a){if(_0x37211a&&_0x37211a['autoAssociation']===0x0){return db['UserProfileResource'][_0xc36b('0x51')]({'name':_0x23f5fb[_0xc36b('0x33')],'resourceId':_0x23f5fb['id'],'type':_0x37211a[_0xc36b('0x33')],'sectionId':_0x37211a['id']},{})[_0xc36b('0x2d')](function(){return _0x23aa07;});}else{return _0x23aa07;}})[_0xc36b('0x4d')](function(_0x4bf1c3){logger[_0xc36b('0x32')](_0xc36b('0x56'),_0x4bf1c3);throw _0x4bf1c3;});}return _0x23aa07;})['then'](respondWithResult(_0x51ebbe,0xc9))[_0xc36b('0x4d')](handleError(_0x51ebbe,null));};exports[_0xc36b('0x2c')]=function(_0x5e4dfc,_0x19dfe2){if(_0x5e4dfc[_0xc36b('0x57')]['id']){delete _0x5e4dfc[_0xc36b('0x57')]['id'];}return db[_0xc36b('0x36')]['find']({'where':{'id':_0x5e4dfc['params']['id']}})[_0xc36b('0x2d')](handleEntityNotFound(_0x19dfe2,null))['then'](saveUpdates(_0x5e4dfc['body'],null))[_0xc36b('0x2d')](respondWithResult(_0x19dfe2,null))[_0xc36b('0x4d')](handleError(_0x19dfe2,null));};exports[_0xc36b('0x2e')]=function(_0x34d822,_0x46fcb5){return db[_0xc36b('0x36')]['find']({'where':{'id':_0x34d822['params']['id']}})[_0xc36b('0x2d')](handleEntityNotFound(_0x46fcb5,null))[_0xc36b('0x2d')](removeEntity(_0x46fcb5,null))[_0xc36b('0x4d')](handleError(_0x46fcb5,null));};exports['describe']=function(_0xddc86f,_0x589907){return db['CmList']['describe']()[_0xc36b('0x2d')](respondWithResult(_0x589907,null))[_0xc36b('0x4d')](handleError(_0x589907,null));};exports[_0xc36b('0x58')]=function(_0x577ed8,_0x51d5b3,_0x17d8b9){if(_0x577ed8['body']['id']){delete _0x577ed8[_0xc36b('0x57')]['id'];}return db[_0xc36b('0x36')][_0xc36b('0x50')]({'where':{'id':_0x577ed8[_0xc36b('0x4e')]['id']}})['then'](handleEntityNotFound(_0x51d5b3,null))[_0xc36b('0x2d')](function(_0x4031ab){if(_0x4031ab){_0x577ed8[_0xc36b('0x57')][_0xc36b('0x59')]=_0x4031ab['id'];return db[_0xc36b('0x5a')][_0xc36b('0x51')](_0x577ed8[_0xc36b('0x57')]);}})[_0xc36b('0x2d')](respondWithResult(_0x51d5b3,null))[_0xc36b('0x4d')](handleError(_0x51d5b3,null));};exports[_0xc36b('0x5b')]=function(_0x3b1d6a,_0x101a8b,_0x48e4f0){var _0x383ffe={'raw':![],'where':{}};var _0x13605d={};var _0x49c325={'count':0x0,'rows':[]};return db[_0xc36b('0x36')][_0xc36b('0x5c')]({'where':{'id':_0x3b1d6a[_0xc36b('0x4e')]['id']}})['then'](handleEntityNotFound(_0x101a8b,null))[_0xc36b('0x2d')](function(_0x23bcf8){if(_0x23bcf8){_0x13605d[_0xc36b('0x3b')]=_[_0xc36b('0x4f')](db[_0xc36b('0x5a')][_0xc36b('0x37')]);_0x13605d['query']=_[_0xc36b('0x4f')](_0x3b1d6a[_0xc36b('0x3c')]);_0x13605d[_0xc36b('0x3d')]=_[_0xc36b('0x3e')](_0x13605d[_0xc36b('0x3b')],_0x13605d[_0xc36b('0x3c')]);_0x383ffe['attributes']=_[_0xc36b('0x3e')](_0x13605d['model'],qs[_0xc36b('0x40')](_0x3b1d6a[_0xc36b('0x3c')][_0xc36b('0x40')]));_0x383ffe[_0xc36b('0x3f')]=_0x383ffe[_0xc36b('0x3f')]['length']?_0x383ffe[_0xc36b('0x3f')]:_0x13605d[_0xc36b('0x3b')];if(!_0x3b1d6a[_0xc36b('0x3c')]['hasOwnProperty']('nolimit')){_0x383ffe[_0xc36b('0x23')]=qs[_0xc36b('0x23')](_0x3b1d6a[_0xc36b('0x3c')][_0xc36b('0x23')]);_0x383ffe[_0xc36b('0x26')]=qs[_0xc36b('0x26')](_0x3b1d6a[_0xc36b('0x3c')][_0xc36b('0x26')]);}_0x383ffe[_0xc36b('0x44')]=qs[_0xc36b('0x45')](_0x3b1d6a[_0xc36b('0x3c')][_0xc36b('0x45')]);_0x383ffe[_0xc36b('0x46')]=qs[_0xc36b('0x3d')](_[_0xc36b('0x5d')](_0x3b1d6a[_0xc36b('0x3c')],_0x13605d['filters']));_0x383ffe[_0xc36b('0x46')]['ListId']=_0x23bcf8['id'];if(_0x3b1d6a[_0xc36b('0x3c')][_0xc36b('0x48')]){_0x383ffe[_0xc36b('0x46')]=_[_0xc36b('0x49')](_0x383ffe[_0xc36b('0x46')],{'$or':_['map'](_0x383ffe[_0xc36b('0x3f')],function(_0x26087b){var _0x536f0d={};_0x536f0d[_0x26087b]={'$like':'%'+_0x3b1d6a[_0xc36b('0x3c')]['filter']+'%'};return _0x536f0d;})});}_0x383ffe=_[_0xc36b('0x49')]({},_0x383ffe,_0x3b1d6a[_0xc36b('0x5e')]);return db[_0xc36b('0x5a')]['count']({'where':_0x383ffe[_0xc36b('0x46')]})['then'](function(_0x3fd1a0){_0x49c325[_0xc36b('0x25')]=_0x3fd1a0;if(_0x3b1d6a[_0xc36b('0x3c')][_0xc36b('0x4a')]){_0x383ffe[_0xc36b('0x4b')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x383ffe);})['then'](function(_0xe7b14f){_0x49c325[_0xc36b('0x4c')]=_0xe7b14f;return _0x49c325;});}})[_0xc36b('0x2d')](respondWithFilteredResult(_0x101a8b,_0x383ffe))[_0xc36b('0x4d')](handleError(_0x101a8b,null));};exports[_0xc36b('0x5f')]=function(_0x33942a,_0x3ed8bd,_0x1fd954){return db['CmList'][_0xc36b('0x50')]({'where':{'id':_0x33942a[_0xc36b('0x4e')]['id']}})[_0xc36b('0x2d')](handleEntityNotFound(_0x3ed8bd,null))[_0xc36b('0x2d')](function(_0x107f65){if(_0x107f65){return _0x107f65[_0xc36b('0x5f')](_0x33942a[_0xc36b('0x3c')][_0xc36b('0x60')]);}})['then'](respondWithStatusCode(_0x3ed8bd,null))['catch'](handleError(_0x3ed8bd,null));};exports[_0xc36b('0x61')]=function(_0x4f8fcd,_0x439ad6,_0x163e83){return db[_0xc36b('0x36')][_0xc36b('0x50')]({'where':{'id':_0x4f8fcd[_0xc36b('0x4e')]['id']}})[_0xc36b('0x2d')](handleEntityNotFound(_0x439ad6,null))[_0xc36b('0x2d')](function(_0xe089a8){if(_0xe089a8){var _0xd11b32=[];var _0x561c17={'success':[],'errors':[]};return db['CmContact']['describe']()[_0xc36b('0x2d')](function(_0x10f31b){if(_0x4f8fcd[_0xc36b('0x57')]['tags']&&_[_0xc36b('0x62')](_0x4f8fcd[_0xc36b('0x57')][_0xc36b('0x63')])){if(_0x4f8fcd[_0xc36b('0x57')][_0xc36b('0x63')]['length']){_0x4f8fcd['body'][_0xc36b('0x63')]=_0x4f8fcd[_0xc36b('0x57')][_0xc36b('0x63')]['join'](';')+';';}else{_0x4f8fcd['body']['tags']=null;}}else{_0x4f8fcd[_0xc36b('0x57')][_0xc36b('0x63')]=null;}if(_0x4f8fcd[_0xc36b('0x57')]&&_[_0xc36b('0x62')](_0x4f8fcd['body'])){for(var _0x245a94=0x0;_0x245a94<_0x4f8fcd['body'][_0xc36b('0x41')];_0x245a94+=0x1){_0x4f8fcd[_0xc36b('0x57')][_0x245a94]['ListId']=_0x4f8fcd[_0xc36b('0x4e')]['id'];_0xd11b32[_0xc36b('0x64')](_0x4f8fcd[_0xc36b('0x57')][_0x245a94]);}return BPromise[_0xc36b('0x65')](_0xd11b32,function(_0x818d88){return db[_0xc36b('0x66')][_0xc36b('0x51')](_[_0xc36b('0x67')](_0x818d88,[_0xc36b('0x60'),'id'])||{},{'fields':_[_0xc36b('0x4f')](_0x10f31b),'raw':!![]})[_0xc36b('0x2d')](function(_0x3873f2){_0x561c17[_0xc36b('0x68')][_0xc36b('0x64')](_0x3873f2[_0xc36b('0x69')]);})[_0xc36b('0x4d')](function(_0x278851){_0x561c17['errors'][_0xc36b('0x64')]({'data':_0x818d88,'error':_0x278851['message']});});})[_0xc36b('0x2d')](function(_0x3d278e){return _0x561c17;})['catch'](function(_0x4ff441){return _0x4ff441;});}else{_0x439ad6[_0xc36b('0x21')](0x190)['json']({'message':_0xc36b('0x6a')});}});}})[_0xc36b('0x2d')](respondWithResult(_0x439ad6,null))['catch'](handleError(_0x439ad6,null));};exports['getContacts']=function(_0x233c88,_0x4f04e5,_0x2a26df){var _0xbf9eec;return db[_0xc36b('0x36')][_0xc36b('0x50')]({'where':{'id':_0x233c88[_0xc36b('0x4e')]['id']},'include':[{'model':db[_0xc36b('0x6b')],'as':'CustomFields'}]})['then'](handleEntityNotFound(_0x4f04e5,null))['then'](function(_0x138775){if(_0x138775){_0xbf9eec=_0x138775;return db[_0xc36b('0x66')][_0xc36b('0x37')];}})[_0xc36b('0x2d')](function(_0x88e9b3){if(_0x88e9b3){var _0x4a6eb0={};var _0x379caf={};_0x379caf[_0xc36b('0x3b')]=_[_0xc36b('0x6c')](_[_0xc36b('0x4f')](_0x88e9b3),_['map'](_0xbf9eec[_0xc36b('0x6d')],function(_0x26189f){return util['format'](_0xc36b('0x6e'),_0x26189f['id']);}));_0x379caf[_0xc36b('0x3c')]=_[_0xc36b('0x4f')](_0x233c88[_0xc36b('0x3c')]);_0x379caf[_0xc36b('0x3d')]=_['intersection'](_0x379caf[_0xc36b('0x3b')],_0x379caf[_0xc36b('0x3c')]);_0x4a6eb0[_0xc36b('0x3f')]=_['intersection'](_0x379caf[_0xc36b('0x3b')],qs[_0xc36b('0x40')](_0x233c88['query']['fields']));_0x4a6eb0[_0xc36b('0x3f')]=_0x4a6eb0[_0xc36b('0x3f')][_0xc36b('0x41')]?_0x4a6eb0[_0xc36b('0x3f')]:_0x379caf[_0xc36b('0x3b')];if(!_0x233c88[_0xc36b('0x3c')]['hasOwnProperty']('nolimit')){_0x4a6eb0[_0xc36b('0x23')]=qs[_0xc36b('0x23')](_0x233c88[_0xc36b('0x3c')][_0xc36b('0x23')]);_0x4a6eb0[_0xc36b('0x26')]=qs['offset'](_0x233c88[_0xc36b('0x3c')][_0xc36b('0x26')]);}_0x4a6eb0[_0xc36b('0x44')]=qs['sort'](_0x233c88[_0xc36b('0x3c')][_0xc36b('0x45')]);_0x4a6eb0[_0xc36b('0x46')]=qs[_0xc36b('0x3d')](_[_0xc36b('0x5d')](_0x233c88[_0xc36b('0x3c')],_0x379caf[_0xc36b('0x3d')]));_0x4a6eb0[_0xc36b('0x6f')]=!![];if(_0x233c88[_0xc36b('0x3c')][_0xc36b('0x48')]){_0x4a6eb0[_0xc36b('0x46')]=_[_0xc36b('0x49')](_0x4a6eb0['where'],{'$or':_[_0xc36b('0x35')](_0x4a6eb0[_0xc36b('0x3f')],function(_0x1cf3bf){var _0x197d4e={};_0x197d4e[_0x1cf3bf]={'$like':'%'+_0x233c88['query'][_0xc36b('0x48')]+'%'};return _0x197d4e;})});}_0x4a6eb0=_[_0xc36b('0x49')]({},_0x4a6eb0,_0x233c88[_0xc36b('0x5e')]);return _0xbf9eec[_0xc36b('0x70')](_0x4a6eb0);}})[_0xc36b('0x2d')](respondWithResult(_0x4f04e5,null))['catch'](handleError(_0x4f04e5,null));};exports[_0xc36b('0x71')]=function(_0x40003b,_0x449995,_0x3e0eee){var _0x49508e;return db['CmList'][_0xc36b('0x50')]({'where':{'id':_0x40003b['params']['id']},'include':[{'model':db[_0xc36b('0x6b')],'as':_0xc36b('0x6d')}]})[_0xc36b('0x2d')](handleEntityNotFound(_0x449995,null))[_0xc36b('0x2d')](function(_0x28d4c1){if(_0x28d4c1){_0x49508e=_0x28d4c1;return db[_0xc36b('0x66')][_0xc36b('0x37')];}})[_0xc36b('0x2d')](function(_0x5d6b52){if(_0x5d6b52){var _0x2a7233={};var _0x4231d3={};_0x4231d3['model']=_[_0xc36b('0x6c')](_[_0xc36b('0x4f')](_0x5d6b52),_[_0xc36b('0x35')](_0x49508e['CustomFields'],function(_0x412032){return util[_0xc36b('0x72')](_0xc36b('0x6e'),_0x412032['id']);}));_0x4231d3[_0xc36b('0x3c')]=_[_0xc36b('0x4f')](_0x40003b[_0xc36b('0x3c')]);_0x4231d3['filters']=_[_0xc36b('0x3e')](_0x4231d3[_0xc36b('0x3b')],_0x4231d3[_0xc36b('0x3c')]);_0x2a7233[_0xc36b('0x3f')]=_[_0xc36b('0x3e')](_0x4231d3[_0xc36b('0x3b')],qs[_0xc36b('0x40')](_0x40003b[_0xc36b('0x3c')][_0xc36b('0x40')]));_0x2a7233[_0xc36b('0x3f')]=_0x2a7233[_0xc36b('0x3f')][_0xc36b('0x41')]?_0x2a7233[_0xc36b('0x3f')]:_0x4231d3[_0xc36b('0x3b')];if(!_0x40003b[_0xc36b('0x3c')][_0xc36b('0x42')](_0xc36b('0x43'))){_0x2a7233[_0xc36b('0x23')]=qs['limit'](_0x40003b['query']['limit']);_0x2a7233[_0xc36b('0x26')]=qs[_0xc36b('0x26')](_0x40003b[_0xc36b('0x3c')][_0xc36b('0x26')]);}_0x2a7233[_0xc36b('0x44')]=qs[_0xc36b('0x45')](_0x40003b['query']['sort']);_0x2a7233['where']=qs[_0xc36b('0x3d')](_[_0xc36b('0x5d')](_0x40003b[_0xc36b('0x3c')],_0x4231d3['filters']));_0x2a7233[_0xc36b('0x6f')]=!![];if(_0x40003b[_0xc36b('0x3c')][_0xc36b('0x48')]){_0x2a7233['where']=_[_0xc36b('0x49')](_0x2a7233['where'],{'$or':_[_0xc36b('0x35')](_0x2a7233['attributes'],function(_0x247145){var _0xd2678e={};_0xd2678e[_0x247145]={'$like':'%'+_0x40003b[_0xc36b('0x3c')][_0xc36b('0x48')]+'%'};return _0xd2678e;})});}_0x2a7233=_[_0xc36b('0x49')]({},_0x2a7233,_0x40003b[_0xc36b('0x5e')]);return _0x49508e[_0xc36b('0x70')](_0x2a7233);}})[_0xc36b('0x2d')](function(_0x41194c){if(!_[_0xc36b('0x73')](_0x41194c)){var _0x133a45=toCsv(_0x41194c);var _0x149578=Date[_0xc36b('0x74')]();fs[_0xc36b('0x75')](util[_0xc36b('0x72')](_0xc36b('0x76'),_0x49508e['id'],_0x149578),_0x133a45);_0x449995[_0xc36b('0x77')](_0xc36b('0x78'),_0xc36b('0x79')+util[_0xc36b('0x72')]('list_%d_%s.csv',_0x49508e['id'],_0x149578));_0x449995['setHeader'](_0xc36b('0x7a'),_0xc36b('0x7b'));return _0x449995['download'](util[_0xc36b('0x72')](_0xc36b('0x76'),_0x49508e['id'],_0x149578));}else{return _0x449995[_0xc36b('0x1f')](0xcc);}})['catch'](handleError(_0x449995,null));};exports[_0xc36b('0x7c')]=function(_0x1f1b44,_0x1ee169,_0x1c5bca){var _0xe96551;delete _0x1f1b44[_0xc36b('0x57')]['id'];return db[_0xc36b('0x36')]['findOne']({'where':{'id':_0x1f1b44[_0xc36b('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1ee169,null))['then'](function(_0x2604eb){if(_0x2604eb){return db['sequelize'][_0xc36b('0x7d')](function(_0x461ebe){return db['CmCustomField']['create'](_0x1f1b44[_0xc36b('0x57')],{'transaction':_0x461ebe})[_0xc36b('0x2d')](function(_0x25b9ea){_0xe96551=_0x25b9ea;return _0x2604eb[_0xc36b('0x7e')](_0x25b9ea,{'transaction':_0x461ebe});})[_0xc36b('0x2d')](function(){var _0x2f8ab7={'type':db[_0xc36b('0x7f')]['TEXT'],'transaction':_0x461ebe};switch(_0x1f1b44[_0xc36b('0x57')][_0xc36b('0x39')]){case _0xc36b('0x80'):_0x2f8ab7['type']=db[_0xc36b('0x7f')][_0xc36b('0x81')];break;case _0xc36b('0x82'):_0x2f8ab7['type']=db[_0xc36b('0x7f')][_0xc36b('0x83')];break;case _0xc36b('0x84'):_0x2f8ab7[_0xc36b('0x39')]=db[_0xc36b('0x7f')][_0xc36b('0x85')];_0x2f8ab7[_0xc36b('0x86')]=![];break;default:}return db[_0xc36b('0x87')][_0xc36b('0x88')][_0xc36b('0x89')]('cm_contacts',util[_0xc36b('0x72')](_0xc36b('0x8a'),_0xe96551['id']),_0x2f8ab7);})[_0xc36b('0x2d')](function(){return _0xe96551;});});}})['then'](respondWithResult(_0x1ee169,null))[_0xc36b('0x4d')](handleError(_0x1ee169,null));};exports['getCustomFields']=function(_0x4030c7,_0x437626,_0x3b68c3){var _0x319a24={};var _0x2be733={};var _0x4b6c97;var _0x4f73d1;return db[_0xc36b('0x36')][_0xc36b('0x5c')]({'where':{'id':_0x4030c7[_0xc36b('0x4e')]['id']}})[_0xc36b('0x2d')](handleEntityNotFound(_0x437626,null))[_0xc36b('0x2d')](function(_0x28761f){if(_0x28761f){_0x4b6c97=_0x28761f;_0x2be733[_0xc36b('0x3b')]=_[_0xc36b('0x4f')](db[_0xc36b('0x6b')][_0xc36b('0x37')]);_0x2be733[_0xc36b('0x3c')]=_[_0xc36b('0x4f')](_0x4030c7[_0xc36b('0x3c')]);_0x2be733[_0xc36b('0x3d')]=_[_0xc36b('0x3e')](_0x2be733['model'],_0x2be733[_0xc36b('0x3c')]);_0x319a24[_0xc36b('0x3f')]=_[_0xc36b('0x3e')](_0x2be733[_0xc36b('0x3b')],qs[_0xc36b('0x40')](_0x4030c7[_0xc36b('0x3c')][_0xc36b('0x40')]));_0x319a24[_0xc36b('0x3f')]=_0x319a24[_0xc36b('0x3f')][_0xc36b('0x41')]?_0x319a24[_0xc36b('0x3f')]:_0x2be733[_0xc36b('0x3b')];_0x319a24[_0xc36b('0x44')]=qs[_0xc36b('0x45')](_0x4030c7[_0xc36b('0x3c')][_0xc36b('0x45')]);_0x319a24['where']=qs[_0xc36b('0x3d')](_[_0xc36b('0x5d')](_0x4030c7[_0xc36b('0x3c')],_0x2be733[_0xc36b('0x3d')]));_0x319a24[_0xc36b('0x46')]=_['merge'](_0x319a24[_0xc36b('0x46')],{'$or':[{'ListId':_0x28761f['id']},{'ListId':null}]});if(_0x4030c7['query'][_0xc36b('0x48')]){_0x319a24[_0xc36b('0x46')]=_['merge'](_0x319a24[_0xc36b('0x46')],{'$or':_[_0xc36b('0x35')](_0x319a24[_0xc36b('0x3f')],function(_0x5ddad2){var _0x120a58={};_0x120a58[_0x5ddad2]={'$like':'%'+_0x4030c7[_0xc36b('0x3c')]['filter']+'%'};return _0x120a58;})});}_0x319a24=_[_0xc36b('0x49')]({},_0x319a24,_0x4030c7[_0xc36b('0x5e')]);return db[_0xc36b('0x6b')][_0xc36b('0x8b')](_0x319a24);}})['then'](respondWithResult(_0x437626,null))['catch'](handleError(_0x437626,null));};exports[_0xc36b('0x8c')]=function(_0x42acef,_0x5cb90f,_0x883173){return db[_0xc36b('0x36')][_0xc36b('0x50')]({'where':{'id':_0x42acef[_0xc36b('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5cb90f,null))[_0xc36b('0x2d')](function(_0x87965f){if(_0x87965f){return _0x87965f['addAgents'](_0x42acef['body'][_0xc36b('0x60')],_[_0xc36b('0x67')](_0x42acef[_0xc36b('0x57')],['ids','id'])||{})[_0xc36b('0x8d')](function(_0x2cc50c){for(var _0x42bcd6=0x0;_0x42bcd6<_0x42acef[_0xc36b('0x57')][_0xc36b('0x60')]['length'];_0x42bcd6+=0x1){socket[_0xc36b('0x8e')]('userCmList:save',{'UserId':Number(_0x42acef['body'][_0xc36b('0x60')][_0x42bcd6]),'CmListId':Number(_0x42acef[_0xc36b('0x4e')]['id'])});}return _0x2cc50c;});}})[_0xc36b('0x2d')](respondWithResult(_0x5cb90f,null))[_0xc36b('0x4d')](handleError(_0x5cb90f,null));};exports[_0xc36b('0x8f')]=function(_0x12730c,_0x22f962,_0x3cb283){return db['CmList'][_0xc36b('0x50')]({'where':{'id':_0x12730c['params']['id']}})[_0xc36b('0x2d')](handleEntityNotFound(_0x22f962,null))['then'](function(_0x41e0fe){if(_0x41e0fe){return _0x41e0fe[_0xc36b('0x8f')](_0x12730c[_0xc36b('0x3c')][_0xc36b('0x60')])[_0xc36b('0x2d')](function(){if(_[_0xc36b('0x62')](_0x12730c[_0xc36b('0x3c')][_0xc36b('0x60')])){for(var _0x5d3af6=0x0;_0x5d3af6<_0x12730c[_0xc36b('0x3c')][_0xc36b('0x60')][_0xc36b('0x41')];_0x5d3af6+=0x1){socket['emit'](_0xc36b('0x90'),{'UserId':Number(_0x12730c[_0xc36b('0x3c')][_0xc36b('0x60')][_0x5d3af6]),'CmListId':Number(_0x12730c['params']['id'])});}}else{socket[_0xc36b('0x8e')](_0xc36b('0x90'),{'UserId':Number(_0x12730c[_0xc36b('0x3c')][_0xc36b('0x60')]),'CmListId':Number(_0x12730c['params']['id'])});}});}})['then'](respondWithStatusCode(_0x22f962,null))[_0xc36b('0x4d')](handleError(_0x22f962,null));};exports[_0xc36b('0x91')]=function(_0x4e3a72,_0x1f9348,_0x1b7e6e){var _0x310bfd={};var _0x5b7ddd={};var _0x1e3116;var _0x4a5561;return db[_0xc36b('0x36')][_0xc36b('0x5c')]({'where':{'id':_0x4e3a72[_0xc36b('0x4e')]['id']}})[_0xc36b('0x2d')](handleEntityNotFound(_0x1f9348,null))['then'](function(_0x2012d9){if(_0x2012d9){_0x1e3116=_0x2012d9;_0x5b7ddd[_0xc36b('0x3b')]=_['keys'](db[_0xc36b('0x92')]['rawAttributes']);_0x5b7ddd['query']=_[_0xc36b('0x4f')](_0x4e3a72[_0xc36b('0x3c')]);_0x5b7ddd[_0xc36b('0x3d')]=_[_0xc36b('0x3e')](_0x5b7ddd['model'],_0x5b7ddd['query']);_0x310bfd[_0xc36b('0x3f')]=_[_0xc36b('0x3e')](_0x5b7ddd['model'],qs[_0xc36b('0x40')](_0x4e3a72[_0xc36b('0x3c')][_0xc36b('0x40')]));_0x310bfd[_0xc36b('0x3f')]=_0x310bfd[_0xc36b('0x3f')][_0xc36b('0x41')]?_0x310bfd['attributes']:_0x5b7ddd[_0xc36b('0x3b')];_0x310bfd[_0xc36b('0x44')]=qs[_0xc36b('0x45')](_0x4e3a72[_0xc36b('0x3c')][_0xc36b('0x45')]);_0x310bfd[_0xc36b('0x46')]=qs[_0xc36b('0x3d')](_[_0xc36b('0x5d')](_0x4e3a72[_0xc36b('0x3c')],_0x5b7ddd[_0xc36b('0x3d')]));if(_0x4e3a72[_0xc36b('0x3c')]['filter']){_0x310bfd[_0xc36b('0x46')]=_['merge'](_0x310bfd['where'],{'$or':_[_0xc36b('0x35')](_0x310bfd[_0xc36b('0x3f')],function(_0x43f27a){var _0x3a525c={};_0x3a525c[_0x43f27a]={'$like':'%'+_0x4e3a72['query'][_0xc36b('0x48')]+'%'};return _0x3a525c;})});}_0x310bfd=_['merge']({},_0x310bfd,_0x4e3a72['options']);return _0x1e3116[_0xc36b('0x91')](_0x310bfd);}})[_0xc36b('0x2d')](function(_0x2f0dcb){if(_0x2f0dcb){_0x4a5561=_0x2f0dcb[_0xc36b('0x41')];if(!_0x4e3a72['query'][_0xc36b('0x42')]('nolimit')){_0x310bfd[_0xc36b('0x23')]=qs[_0xc36b('0x23')](_0x4e3a72[_0xc36b('0x3c')][_0xc36b('0x23')]);_0x310bfd[_0xc36b('0x26')]=qs[_0xc36b('0x26')](_0x4e3a72[_0xc36b('0x3c')]['offset']);}return _0x1e3116[_0xc36b('0x91')](_0x310bfd);}})['then'](function(_0x9213e8){if(_0x9213e8){return _0x9213e8?{'count':_0x4a5561,'rows':_0x9213e8}:null;}})['then'](respondWithResult(_0x1f9348,null))[_0xc36b('0x4d')](handleError(_0x1f9348,null));}; \ No newline at end of file +var _0x4e1c=['errors','Malformed\x20request\x20syntax','getContacts','CmCustomField','CmContact','CustomFields','cf_%d','order','raw','getContactsCsv','concat','format','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','addCustomField','sequelize','transaction','addCustomFields','Sequelize','text','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','addAgents','omit','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','update','then','destroy','get','Lists','UserProfileResource','stack','name','map','CmList','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ListId','findOne','Disposition','nolimit','findAll','removeDispositions','addContacts','isArray','tags','join','push','ids','dataValues'];(function(_0x177ffc,_0x12fe57){var _0x5de778=function(_0x3f994e){while(--_0x3f994e){_0x177ffc['push'](_0x177ffc['shift']());}};_0x5de778(++_0x12fe57);}(_0x4e1c,0x140));var _0xc4e1=function(_0x1e7701,_0x13fd0f){_0x1e7701=_0x1e7701-0x0;var _0x3ab707=_0x4e1c[_0x1e7701];return _0x3ab707;};'use strict';var emlformat=require(_0xc4e1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc4e1('0x1'));var moment=require(_0xc4e1('0x2'));var BPromise=require(_0xc4e1('0x3'));var Mustache=require(_0xc4e1('0x4'));var util=require(_0xc4e1('0x5'));var path=require(_0xc4e1('0x6'));var sox=require(_0xc4e1('0x7'));var csv=require(_0xc4e1('0x8'));var ejs=require(_0xc4e1('0x9'));var fs=require('fs');var fs_extra=require(_0xc4e1('0xa'));var _=require(_0xc4e1('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc4e1('0x8'));var querystring=require(_0xc4e1('0xc'));var Papa=require('papaparse');var Redis=require(_0xc4e1('0xd'));var authService=require(_0xc4e1('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc4e1('0xf'));var hardwareService=require(_0xc4e1('0x10'));var logger=require('../../config/logger')(_0xc4e1('0x11'));var utils=require(_0xc4e1('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xc4e1('0x13'));var db=require(_0xc4e1('0x14'))['db'];config['redis']=_['defaults'](config[_0xc4e1('0x15')],{'host':_0xc4e1('0x16'),'port':0x18eb});var socket=require(_0xc4e1('0x17'))(new Redis(config['redis']));require(_0xc4e1('0x18'))[_0xc4e1('0x19')](socket);function respondWithStatusCode(_0x3955e3,_0x531fc4){_0x531fc4=_0x531fc4||0xcc;return function(_0xbe3646){if(_0xbe3646){return _0x3955e3[_0xc4e1('0x1a')](_0x531fc4);}return _0x3955e3[_0xc4e1('0x1b')](_0x531fc4)[_0xc4e1('0x1c')]();};}function respondWithResult(_0xd4c068,_0x324d26){_0x324d26=_0x324d26||0xc8;return function(_0x407b1c){if(_0x407b1c){return _0xd4c068[_0xc4e1('0x1b')](_0x324d26)[_0xc4e1('0x1d')](_0x407b1c);}};}function respondWithFilteredResult(_0x4095a7,_0x22f246){return function(_0x236e39){if(_0x236e39){var _0x2b406f=typeof _0x22f246[_0xc4e1('0x1e')]===_0xc4e1('0x1f')&&typeof _0x22f246['limit']==='undefined';var _0x2fd5c2=_0x236e39['count'];var _0xb4e357=_0x2b406f?0x0:_0x22f246['offset'];var _0x294eb6=_0x2b406f?_0x236e39[_0xc4e1('0x20')]:_0x22f246[_0xc4e1('0x1e')]+_0x22f246[_0xc4e1('0x21')];var _0x1ed368;if(_0x294eb6>=_0x2fd5c2){_0x294eb6=_0x2fd5c2;_0x1ed368=0xc8;}else{_0x1ed368=0xce;}_0x4095a7[_0xc4e1('0x1b')](_0x1ed368);return _0x4095a7['set']('Content-Range',_0xb4e357+'-'+_0x294eb6+'/'+_0x2fd5c2)[_0xc4e1('0x1d')](_0x236e39);}return null;};}function patchUpdates(_0xfc94a1){return function(_0x40a452){try{jsonpatch[_0xc4e1('0x22')](_0x40a452,_0xfc94a1,!![]);}catch(_0xb3ca2a){return BPromise[_0xc4e1('0x23')](_0xb3ca2a);}return _0x40a452['save']();};}function saveUpdates(_0x109d23,_0x48ad68){return function(_0x4ab20c){if(_0x4ab20c){return _0x4ab20c[_0xc4e1('0x24')](_0x109d23)[_0xc4e1('0x25')](function(_0x41efa9){return _0x41efa9;});}return null;};}function removeEntity(_0x5b8719,_0x31d7f7){return function(_0x1d441e){if(_0x1d441e){return _0x1d441e[_0xc4e1('0x26')]()['then'](function(){var _0x5487a0=_0x1d441e[_0xc4e1('0x27')]({'plain':!![]});var _0x4cccb5=_0xc4e1('0x28');return db[_0xc4e1('0x29')][_0xc4e1('0x26')]({'where':{'type':_0x4cccb5,'resourceId':_0x5487a0['id']}})[_0xc4e1('0x25')](function(){return _0x1d441e;});})['then'](function(){_0x5b8719['status'](0xcc)[_0xc4e1('0x1c')]();});}};}function handleEntityNotFound(_0x1d29bd,_0xe5047c){return function(_0x589d41){if(!_0x589d41){_0x1d29bd[_0xc4e1('0x1a')](0x194);}return _0x589d41;};}function handleError(_0x2a7c2f,_0x5c4bdf){_0x5c4bdf=_0x5c4bdf||0x1f4;return function(_0x37362c){logger['error'](_0x37362c[_0xc4e1('0x2a')]);if(_0x37362c[_0xc4e1('0x2b')]){delete _0x37362c[_0xc4e1('0x2b')];}_0x2a7c2f[_0xc4e1('0x1b')](_0x5c4bdf)['send'](_0x37362c);};}exports['index']=function(_0x5096d4,_0x35ba3e){var _0x4adb5b={},_0x2022b6={},_0x2061a1={'count':0x0,'rows':[]};var _0x1a816f=_[_0xc4e1('0x2c')](db[_0xc4e1('0x2d')][_0xc4e1('0x2e')],function(_0x48326c){return{'name':_0x48326c[_0xc4e1('0x2f')],'type':_0x48326c[_0xc4e1('0x30')][_0xc4e1('0x31')]};});_0x2022b6[_0xc4e1('0x32')]=_[_0xc4e1('0x2c')](_0x1a816f,_0xc4e1('0x2b'));_0x2022b6[_0xc4e1('0x33')]=_[_0xc4e1('0x34')](_0x5096d4[_0xc4e1('0x33')]);_0x2022b6[_0xc4e1('0x35')]=_[_0xc4e1('0x36')](_0x2022b6[_0xc4e1('0x32')],_0x2022b6[_0xc4e1('0x33')]);_0x4adb5b[_0xc4e1('0x37')]=_[_0xc4e1('0x36')](_0x2022b6['model'],qs[_0xc4e1('0x38')](_0x5096d4[_0xc4e1('0x33')]['fields']));_0x4adb5b[_0xc4e1('0x37')]=_0x4adb5b[_0xc4e1('0x37')][_0xc4e1('0x39')]?_0x4adb5b[_0xc4e1('0x37')]:_0x2022b6[_0xc4e1('0x32')];if(!_0x5096d4['query'][_0xc4e1('0x3a')]('nolimit')){_0x4adb5b[_0xc4e1('0x21')]=qs[_0xc4e1('0x21')](_0x5096d4['query']['limit']);_0x4adb5b['offset']=qs[_0xc4e1('0x1e')](_0x5096d4[_0xc4e1('0x33')][_0xc4e1('0x1e')]);}_0x4adb5b['order']=qs[_0xc4e1('0x3b')](_0x5096d4[_0xc4e1('0x33')][_0xc4e1('0x3b')]);_0x4adb5b[_0xc4e1('0x3c')]=qs[_0xc4e1('0x35')](_[_0xc4e1('0x3d')](_0x5096d4['query'],_0x2022b6[_0xc4e1('0x35')]),_0x1a816f);if(_0x5096d4[_0xc4e1('0x33')][_0xc4e1('0x3e')]){_0x4adb5b[_0xc4e1('0x3c')]=_[_0xc4e1('0x3f')](_0x4adb5b[_0xc4e1('0x3c')],{'$or':_[_0xc4e1('0x2c')](_0x1a816f,function(_0x51f22d){if(_0x51f22d[_0xc4e1('0x30')]!=='VIRTUAL'){var _0x4b5331={};_0x4b5331[_0x51f22d['name']]={'$like':'%'+_0x5096d4['query'][_0xc4e1('0x3e')]+'%'};return _0x4b5331;}})});}_0x4adb5b=_[_0xc4e1('0x3f')]({},_0x4adb5b,_0x5096d4[_0xc4e1('0x40')]);var _0x2721b4={'where':_0x4adb5b[_0xc4e1('0x3c')]};return db[_0xc4e1('0x2d')][_0xc4e1('0x20')](_0x2721b4)[_0xc4e1('0x25')](function(_0x26e6fd){_0x2061a1[_0xc4e1('0x20')]=_0x26e6fd;if(_0x5096d4[_0xc4e1('0x33')][_0xc4e1('0x41')]){_0x4adb5b[_0xc4e1('0x42')]=[{'all':!![]}];}return db[_0xc4e1('0x2d')]['findAll'](_0x4adb5b);})['then'](function(_0x15db2e){_0x2061a1[_0xc4e1('0x43')]=_0x15db2e;return _0x2061a1;})[_0xc4e1('0x25')](respondWithFilteredResult(_0x35ba3e,_0x4adb5b))[_0xc4e1('0x44')](handleError(_0x35ba3e,null));};exports[_0xc4e1('0x45')]=function(_0x329b8a,_0x162527){var _0x401b5c={'raw':![],'where':{'id':_0x329b8a['params']['id']}},_0x28f0ea={};_0x28f0ea[_0xc4e1('0x32')]=_[_0xc4e1('0x34')](db[_0xc4e1('0x2d')]['rawAttributes']);_0x28f0ea[_0xc4e1('0x33')]=_[_0xc4e1('0x34')](_0x329b8a['query']);_0x28f0ea[_0xc4e1('0x35')]=_[_0xc4e1('0x36')](_0x28f0ea[_0xc4e1('0x32')],_0x28f0ea[_0xc4e1('0x33')]);_0x401b5c[_0xc4e1('0x37')]=_['intersection'](_0x28f0ea[_0xc4e1('0x32')],qs['fields'](_0x329b8a[_0xc4e1('0x33')][_0xc4e1('0x38')]));_0x401b5c[_0xc4e1('0x37')]=_0x401b5c[_0xc4e1('0x37')][_0xc4e1('0x39')]?_0x401b5c[_0xc4e1('0x37')]:_0x28f0ea[_0xc4e1('0x32')];if(_0x329b8a[_0xc4e1('0x33')][_0xc4e1('0x41')]){_0x401b5c[_0xc4e1('0x42')]=[{'all':!![]}];}_0x401b5c=_[_0xc4e1('0x3f')]({},_0x401b5c,_0x329b8a[_0xc4e1('0x40')]);return db[_0xc4e1('0x2d')][_0xc4e1('0x46')](_0x401b5c)[_0xc4e1('0x25')](handleEntityNotFound(_0x162527,null))['then'](respondWithResult(_0x162527,null))[_0xc4e1('0x44')](handleError(_0x162527,null));};exports['create']=function(_0x25fa6d,_0x2470fa){return db[_0xc4e1('0x2d')][_0xc4e1('0x47')](_0x25fa6d[_0xc4e1('0x48')],{})[_0xc4e1('0x25')](function(_0x30f9a7){var _0x28fe4f=_0x25fa6d[_0xc4e1('0x49')]['get']({'plain':!![]});if(!_0x28fe4f)throw new Error(_0xc4e1('0x4a'));if(_0x28fe4f[_0xc4e1('0x4b')]===_0xc4e1('0x49')){var _0x3312ee=_0x30f9a7['get']({'plain':!![]});var _0x47fb04=_0xc4e1('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x47fb04,'userProfileId':_0x28fe4f['userProfileId']},'raw':!![]})[_0xc4e1('0x25')](function(_0x42a077){if(_0x42a077&&_0x42a077[_0xc4e1('0x4c')]===0x0){return db[_0xc4e1('0x29')][_0xc4e1('0x47')]({'name':_0x3312ee[_0xc4e1('0x2b')],'resourceId':_0x3312ee['id'],'type':_0x42a077[_0xc4e1('0x2b')],'sectionId':_0x42a077['id']},{})[_0xc4e1('0x25')](function(){return _0x30f9a7;});}else{return _0x30f9a7;}})[_0xc4e1('0x44')](function(_0x11868b){logger['error'](_0xc4e1('0x4d'),_0x11868b);throw _0x11868b;});}return _0x30f9a7;})[_0xc4e1('0x25')](respondWithResult(_0x2470fa,0xc9))['catch'](handleError(_0x2470fa,null));};exports['update']=function(_0x3dabf0,_0x5060da){if(_0x3dabf0[_0xc4e1('0x48')]['id']){delete _0x3dabf0[_0xc4e1('0x48')]['id'];}return db['CmList']['find']({'where':{'id':_0x3dabf0[_0xc4e1('0x4e')]['id']}})[_0xc4e1('0x25')](handleEntityNotFound(_0x5060da,null))[_0xc4e1('0x25')](saveUpdates(_0x3dabf0[_0xc4e1('0x48')],null))[_0xc4e1('0x25')](respondWithResult(_0x5060da,null))[_0xc4e1('0x44')](handleError(_0x5060da,null));};exports[_0xc4e1('0x26')]=function(_0x57b02d,_0x408c37){return db[_0xc4e1('0x2d')][_0xc4e1('0x46')]({'where':{'id':_0x57b02d[_0xc4e1('0x4e')]['id']}})[_0xc4e1('0x25')](handleEntityNotFound(_0x408c37,null))[_0xc4e1('0x25')](removeEntity(_0x408c37,null))[_0xc4e1('0x44')](handleError(_0x408c37,null));};exports[_0xc4e1('0x4f')]=function(_0x383bbc,_0x58de55){return db['CmList'][_0xc4e1('0x4f')]()[_0xc4e1('0x25')](respondWithResult(_0x58de55,null))[_0xc4e1('0x44')](handleError(_0x58de55,null));};exports[_0xc4e1('0x50')]=function(_0xeb8be5,_0x9514fd,_0x15bd8a){if(_0xeb8be5[_0xc4e1('0x48')]['id']){delete _0xeb8be5[_0xc4e1('0x48')]['id'];}return db[_0xc4e1('0x2d')][_0xc4e1('0x46')]({'where':{'id':_0xeb8be5[_0xc4e1('0x4e')]['id']}})['then'](handleEntityNotFound(_0x9514fd,null))[_0xc4e1('0x25')](function(_0x42dde6){if(_0x42dde6){_0xeb8be5[_0xc4e1('0x48')][_0xc4e1('0x51')]=_0x42dde6['id'];return db['Disposition'][_0xc4e1('0x47')](_0xeb8be5[_0xc4e1('0x48')]);}})[_0xc4e1('0x25')](respondWithResult(_0x9514fd,null))[_0xc4e1('0x44')](handleError(_0x9514fd,null));};exports['getDispositions']=function(_0x54fe24,_0x609353,_0x180b01){var _0x313693={'raw':![],'where':{}};var _0x3e5642={};var _0x6a3fe6={'count':0x0,'rows':[]};return db['CmList'][_0xc4e1('0x52')]({'where':{'id':_0x54fe24['params']['id']}})['then'](handleEntityNotFound(_0x609353,null))['then'](function(_0xc546fa){if(_0xc546fa){_0x3e5642[_0xc4e1('0x32')]=_[_0xc4e1('0x34')](db[_0xc4e1('0x53')][_0xc4e1('0x2e')]);_0x3e5642[_0xc4e1('0x33')]=_['keys'](_0x54fe24[_0xc4e1('0x33')]);_0x3e5642[_0xc4e1('0x35')]=_[_0xc4e1('0x36')](_0x3e5642[_0xc4e1('0x32')],_0x3e5642['query']);_0x313693[_0xc4e1('0x37')]=_[_0xc4e1('0x36')](_0x3e5642[_0xc4e1('0x32')],qs[_0xc4e1('0x38')](_0x54fe24[_0xc4e1('0x33')][_0xc4e1('0x38')]));_0x313693['attributes']=_0x313693[_0xc4e1('0x37')][_0xc4e1('0x39')]?_0x313693[_0xc4e1('0x37')]:_0x3e5642[_0xc4e1('0x32')];if(!_0x54fe24['query'][_0xc4e1('0x3a')](_0xc4e1('0x54'))){_0x313693[_0xc4e1('0x21')]=qs[_0xc4e1('0x21')](_0x54fe24[_0xc4e1('0x33')][_0xc4e1('0x21')]);_0x313693[_0xc4e1('0x1e')]=qs['offset'](_0x54fe24[_0xc4e1('0x33')][_0xc4e1('0x1e')]);}_0x313693['order']=qs['sort'](_0x54fe24[_0xc4e1('0x33')][_0xc4e1('0x3b')]);_0x313693[_0xc4e1('0x3c')]=qs[_0xc4e1('0x35')](_[_0xc4e1('0x3d')](_0x54fe24[_0xc4e1('0x33')],_0x3e5642[_0xc4e1('0x35')]));_0x313693['where'][_0xc4e1('0x51')]=_0xc546fa['id'];if(_0x54fe24[_0xc4e1('0x33')][_0xc4e1('0x3e')]){_0x313693[_0xc4e1('0x3c')]=_[_0xc4e1('0x3f')](_0x313693[_0xc4e1('0x3c')],{'$or':_[_0xc4e1('0x2c')](_0x313693[_0xc4e1('0x37')],function(_0x2edef5){var _0x53d49b={};_0x53d49b[_0x2edef5]={'$like':'%'+_0x54fe24[_0xc4e1('0x33')][_0xc4e1('0x3e')]+'%'};return _0x53d49b;})});}_0x313693=_[_0xc4e1('0x3f')]({},_0x313693,_0x54fe24[_0xc4e1('0x40')]);return db['Disposition'][_0xc4e1('0x20')]({'where':_0x313693[_0xc4e1('0x3c')]})[_0xc4e1('0x25')](function(_0x598778){_0x6a3fe6[_0xc4e1('0x20')]=_0x598778;if(_0x54fe24['query'][_0xc4e1('0x41')]){_0x313693['include']=[{'all':!![]}];}return db['Disposition'][_0xc4e1('0x55')](_0x313693);})[_0xc4e1('0x25')](function(_0x360bd0){_0x6a3fe6[_0xc4e1('0x43')]=_0x360bd0;return _0x6a3fe6;});}})[_0xc4e1('0x25')](respondWithFilteredResult(_0x609353,_0x313693))[_0xc4e1('0x44')](handleError(_0x609353,null));};exports[_0xc4e1('0x56')]=function(_0x47dc7e,_0x83c5b5,_0x30096b){return db[_0xc4e1('0x2d')]['find']({'where':{'id':_0x47dc7e[_0xc4e1('0x4e')]['id']}})[_0xc4e1('0x25')](handleEntityNotFound(_0x83c5b5,null))[_0xc4e1('0x25')](function(_0x53abc8){if(_0x53abc8){return _0x53abc8['removeDispositions'](_0x47dc7e['query']['ids']);}})[_0xc4e1('0x25')](respondWithStatusCode(_0x83c5b5,null))[_0xc4e1('0x44')](handleError(_0x83c5b5,null));};exports[_0xc4e1('0x57')]=function(_0x141054,_0x262aa7,_0x13c156){return db[_0xc4e1('0x2d')]['find']({'where':{'id':_0x141054['params']['id']}})[_0xc4e1('0x25')](handleEntityNotFound(_0x262aa7,null))[_0xc4e1('0x25')](function(_0x2d6f1e){if(_0x2d6f1e){var _0x4a900f=[];var _0x150769={'success':[],'errors':[]};return db['CmContact'][_0xc4e1('0x4f')]()[_0xc4e1('0x25')](function(_0x1b8eba){if(_0x141054[_0xc4e1('0x48')]['tags']&&_[_0xc4e1('0x58')](_0x141054[_0xc4e1('0x48')][_0xc4e1('0x59')])){if(_0x141054['body']['tags'][_0xc4e1('0x39')]){_0x141054[_0xc4e1('0x48')][_0xc4e1('0x59')]=_0x141054['body'][_0xc4e1('0x59')][_0xc4e1('0x5a')](';')+';';}else{_0x141054[_0xc4e1('0x48')][_0xc4e1('0x59')]=null;}}else{_0x141054['body'][_0xc4e1('0x59')]=null;}if(_0x141054['body']&&_[_0xc4e1('0x58')](_0x141054[_0xc4e1('0x48')])){for(var _0x5e508e=0x0;_0x5e508e<_0x141054['body'][_0xc4e1('0x39')];_0x5e508e+=0x1){_0x141054[_0xc4e1('0x48')][_0x5e508e][_0xc4e1('0x51')]=_0x141054[_0xc4e1('0x4e')]['id'];_0x4a900f[_0xc4e1('0x5b')](_0x141054[_0xc4e1('0x48')][_0x5e508e]);}return BPromise['each'](_0x4a900f,function(_0x14f22f){return db['CmContact'][_0xc4e1('0x47')](_['omit'](_0x14f22f,[_0xc4e1('0x5c'),'id'])||{},{'fields':_[_0xc4e1('0x34')](_0x1b8eba),'raw':!![]})[_0xc4e1('0x25')](function(_0x4e203f){_0x150769['success']['push'](_0x4e203f[_0xc4e1('0x5d')]);})[_0xc4e1('0x44')](function(_0x544a39){_0x150769[_0xc4e1('0x5e')]['push']({'data':_0x14f22f,'error':_0x544a39['message']});});})[_0xc4e1('0x25')](function(_0x46b27a){return _0x150769;})[_0xc4e1('0x44')](function(_0x32e050){return _0x32e050;});}else{_0x262aa7[_0xc4e1('0x1b')](0x190)[_0xc4e1('0x1d')]({'message':_0xc4e1('0x5f')});}});}})['then'](respondWithResult(_0x262aa7,null))[_0xc4e1('0x44')](handleError(_0x262aa7,null));};exports[_0xc4e1('0x60')]=function(_0x25439c,_0x44284c,_0x5efc01){var _0x3f0edd;return db[_0xc4e1('0x2d')]['find']({'where':{'id':_0x25439c['params']['id']},'include':[{'model':db[_0xc4e1('0x61')],'as':'CustomFields'}]})[_0xc4e1('0x25')](handleEntityNotFound(_0x44284c,null))['then'](function(_0x52b192){if(_0x52b192){_0x3f0edd=_0x52b192;return db[_0xc4e1('0x62')][_0xc4e1('0x2e')];}})[_0xc4e1('0x25')](function(_0x1ad672){if(_0x1ad672){var _0x497d0f={};var _0x17e175={};_0x17e175[_0xc4e1('0x32')]=_['concat'](_[_0xc4e1('0x34')](_0x1ad672),_[_0xc4e1('0x2c')](_0x3f0edd[_0xc4e1('0x63')],function(_0x7ee25c){return util['format'](_0xc4e1('0x64'),_0x7ee25c['id']);}));_0x17e175[_0xc4e1('0x33')]=_['keys'](_0x25439c[_0xc4e1('0x33')]);_0x17e175[_0xc4e1('0x35')]=_['intersection'](_0x17e175[_0xc4e1('0x32')],_0x17e175[_0xc4e1('0x33')]);_0x497d0f['attributes']=_[_0xc4e1('0x36')](_0x17e175[_0xc4e1('0x32')],qs[_0xc4e1('0x38')](_0x25439c['query'][_0xc4e1('0x38')]));_0x497d0f[_0xc4e1('0x37')]=_0x497d0f[_0xc4e1('0x37')]['length']?_0x497d0f['attributes']:_0x17e175[_0xc4e1('0x32')];if(!_0x25439c[_0xc4e1('0x33')][_0xc4e1('0x3a')]('nolimit')){_0x497d0f[_0xc4e1('0x21')]=qs[_0xc4e1('0x21')](_0x25439c[_0xc4e1('0x33')]['limit']);_0x497d0f[_0xc4e1('0x1e')]=qs[_0xc4e1('0x1e')](_0x25439c[_0xc4e1('0x33')]['offset']);}_0x497d0f[_0xc4e1('0x65')]=qs[_0xc4e1('0x3b')](_0x25439c[_0xc4e1('0x33')][_0xc4e1('0x3b')]);_0x497d0f['where']=qs['filters'](_['pick'](_0x25439c[_0xc4e1('0x33')],_0x17e175[_0xc4e1('0x35')]));_0x497d0f[_0xc4e1('0x66')]=!![];if(_0x25439c[_0xc4e1('0x33')]['filter']){_0x497d0f[_0xc4e1('0x3c')]=_[_0xc4e1('0x3f')](_0x497d0f[_0xc4e1('0x3c')],{'$or':_['map'](_0x497d0f[_0xc4e1('0x37')],function(_0x2f826b){var _0x486216={};_0x486216[_0x2f826b]={'$like':'%'+_0x25439c['query'][_0xc4e1('0x3e')]+'%'};return _0x486216;})});}_0x497d0f=_[_0xc4e1('0x3f')]({},_0x497d0f,_0x25439c[_0xc4e1('0x40')]);return _0x3f0edd[_0xc4e1('0x60')](_0x497d0f);}})['then'](respondWithResult(_0x44284c,null))[_0xc4e1('0x44')](handleError(_0x44284c,null));};exports[_0xc4e1('0x67')]=function(_0x207e8a,_0xb5117d,_0x4a1f69){var _0x382f34;return db[_0xc4e1('0x2d')]['find']({'where':{'id':_0x207e8a['params']['id']},'include':[{'model':db[_0xc4e1('0x61')],'as':_0xc4e1('0x63')}]})[_0xc4e1('0x25')](handleEntityNotFound(_0xb5117d,null))['then'](function(_0x4bc1b8){if(_0x4bc1b8){_0x382f34=_0x4bc1b8;return db[_0xc4e1('0x62')][_0xc4e1('0x2e')];}})['then'](function(_0x52b1e7){if(_0x52b1e7){var _0x23d7cc={};var _0xfb726f={};_0xfb726f[_0xc4e1('0x32')]=_[_0xc4e1('0x68')](_[_0xc4e1('0x34')](_0x52b1e7),_[_0xc4e1('0x2c')](_0x382f34[_0xc4e1('0x63')],function(_0x22b809){return util[_0xc4e1('0x69')](_0xc4e1('0x64'),_0x22b809['id']);}));_0xfb726f['query']=_[_0xc4e1('0x34')](_0x207e8a[_0xc4e1('0x33')]);_0xfb726f[_0xc4e1('0x35')]=_['intersection'](_0xfb726f[_0xc4e1('0x32')],_0xfb726f[_0xc4e1('0x33')]);_0x23d7cc['attributes']=_[_0xc4e1('0x36')](_0xfb726f[_0xc4e1('0x32')],qs[_0xc4e1('0x38')](_0x207e8a[_0xc4e1('0x33')]['fields']));_0x23d7cc[_0xc4e1('0x37')]=_0x23d7cc[_0xc4e1('0x37')]['length']?_0x23d7cc[_0xc4e1('0x37')]:_0xfb726f[_0xc4e1('0x32')];if(!_0x207e8a[_0xc4e1('0x33')][_0xc4e1('0x3a')](_0xc4e1('0x54'))){_0x23d7cc[_0xc4e1('0x21')]=qs[_0xc4e1('0x21')](_0x207e8a[_0xc4e1('0x33')][_0xc4e1('0x21')]);_0x23d7cc[_0xc4e1('0x1e')]=qs[_0xc4e1('0x1e')](_0x207e8a[_0xc4e1('0x33')][_0xc4e1('0x1e')]);}_0x23d7cc['order']=qs[_0xc4e1('0x3b')](_0x207e8a[_0xc4e1('0x33')][_0xc4e1('0x3b')]);_0x23d7cc[_0xc4e1('0x3c')]=qs[_0xc4e1('0x35')](_[_0xc4e1('0x3d')](_0x207e8a['query'],_0xfb726f[_0xc4e1('0x35')]));_0x23d7cc[_0xc4e1('0x66')]=!![];if(_0x207e8a[_0xc4e1('0x33')][_0xc4e1('0x3e')]){_0x23d7cc[_0xc4e1('0x3c')]=_[_0xc4e1('0x3f')](_0x23d7cc['where'],{'$or':_[_0xc4e1('0x2c')](_0x23d7cc[_0xc4e1('0x37')],function(_0x5cbe36){var _0x374cea={};_0x374cea[_0x5cbe36]={'$like':'%'+_0x207e8a[_0xc4e1('0x33')][_0xc4e1('0x3e')]+'%'};return _0x374cea;})});}_0x23d7cc=_[_0xc4e1('0x3f')]({},_0x23d7cc,_0x207e8a['options']);return _0x382f34[_0xc4e1('0x60')](_0x23d7cc);}})[_0xc4e1('0x25')](function(_0x48429b){if(!_['isEmpty'](_0x48429b)){var _0x3fe3b8=toCsv(_0x48429b);var _0x2016e7=Date[_0xc4e1('0x6a')]();fs[_0xc4e1('0x6b')](util['format'](_0xc4e1('0x6c'),_0x382f34['id'],_0x2016e7),_0x3fe3b8);_0xb5117d[_0xc4e1('0x6d')](_0xc4e1('0x6e'),_0xc4e1('0x6f')+util[_0xc4e1('0x69')]('list_%d_%s.csv',_0x382f34['id'],_0x2016e7));_0xb5117d[_0xc4e1('0x6d')](_0xc4e1('0x70'),_0xc4e1('0x71'));return _0xb5117d['download'](util[_0xc4e1('0x69')](_0xc4e1('0x6c'),_0x382f34['id'],_0x2016e7));}else{return _0xb5117d[_0xc4e1('0x1a')](0xcc);}})['catch'](handleError(_0xb5117d,null));};exports[_0xc4e1('0x72')]=function(_0x2ca164,_0x477506,_0x288494){var _0x2b7683;delete _0x2ca164[_0xc4e1('0x48')]['id'];return db[_0xc4e1('0x2d')][_0xc4e1('0x52')]({'where':{'id':_0x2ca164[_0xc4e1('0x4e')]['id']}})['then'](handleEntityNotFound(_0x477506,null))['then'](function(_0x1a0e4e){if(_0x1a0e4e){return db[_0xc4e1('0x73')][_0xc4e1('0x74')](function(_0x2232fd){return db['CmCustomField']['create'](_0x2ca164[_0xc4e1('0x48')],{'transaction':_0x2232fd})[_0xc4e1('0x25')](function(_0x36f914){_0x2b7683=_0x36f914;return _0x1a0e4e[_0xc4e1('0x75')](_0x36f914,{'transaction':_0x2232fd});})[_0xc4e1('0x25')](function(){var _0x2020f2={'type':db[_0xc4e1('0x76')]['TEXT'],'transaction':_0x2232fd};switch(_0x2ca164['body'][_0xc4e1('0x30')]){case _0xc4e1('0x77'):_0x2020f2[_0xc4e1('0x30')]=db[_0xc4e1('0x76')][_0xc4e1('0x78')];break;case _0xc4e1('0x79'):_0x2020f2['type']=db[_0xc4e1('0x76')][_0xc4e1('0x7a')];break;case _0xc4e1('0x7b'):_0x2020f2[_0xc4e1('0x30')]=db[_0xc4e1('0x76')][_0xc4e1('0x7c')];_0x2020f2[_0xc4e1('0x7d')]=![];break;default:}return db[_0xc4e1('0x73')][_0xc4e1('0x7e')][_0xc4e1('0x7f')](_0xc4e1('0x80'),util[_0xc4e1('0x69')](_0xc4e1('0x81'),_0x2b7683['id']),_0x2020f2);})[_0xc4e1('0x25')](function(){return _0x2b7683;});});}})[_0xc4e1('0x25')](respondWithResult(_0x477506,null))[_0xc4e1('0x44')](handleError(_0x477506,null));};exports['getCustomFields']=function(_0x58fcf0,_0x45020a,_0x25ea35){var _0x180a82={};var _0x41bf88={};var _0x3b792f;var _0xe5e64a;return db[_0xc4e1('0x2d')][_0xc4e1('0x52')]({'where':{'id':_0x58fcf0[_0xc4e1('0x4e')]['id']}})[_0xc4e1('0x25')](handleEntityNotFound(_0x45020a,null))['then'](function(_0x563eca){if(_0x563eca){_0x3b792f=_0x563eca;_0x41bf88[_0xc4e1('0x32')]=_[_0xc4e1('0x34')](db[_0xc4e1('0x61')][_0xc4e1('0x2e')]);_0x41bf88['query']=_[_0xc4e1('0x34')](_0x58fcf0[_0xc4e1('0x33')]);_0x41bf88[_0xc4e1('0x35')]=_[_0xc4e1('0x36')](_0x41bf88[_0xc4e1('0x32')],_0x41bf88['query']);_0x180a82['attributes']=_[_0xc4e1('0x36')](_0x41bf88['model'],qs[_0xc4e1('0x38')](_0x58fcf0[_0xc4e1('0x33')][_0xc4e1('0x38')]));_0x180a82[_0xc4e1('0x37')]=_0x180a82['attributes'][_0xc4e1('0x39')]?_0x180a82['attributes']:_0x41bf88[_0xc4e1('0x32')];_0x180a82[_0xc4e1('0x65')]=qs['sort'](_0x58fcf0[_0xc4e1('0x33')][_0xc4e1('0x3b')]);_0x180a82[_0xc4e1('0x3c')]=qs[_0xc4e1('0x35')](_[_0xc4e1('0x3d')](_0x58fcf0[_0xc4e1('0x33')],_0x41bf88[_0xc4e1('0x35')]));_0x180a82[_0xc4e1('0x3c')]=_['merge'](_0x180a82['where'],{'$or':[{'ListId':_0x563eca['id']},{'ListId':null}]});if(_0x58fcf0[_0xc4e1('0x33')]['filter']){_0x180a82[_0xc4e1('0x3c')]=_[_0xc4e1('0x3f')](_0x180a82[_0xc4e1('0x3c')],{'$or':_[_0xc4e1('0x2c')](_0x180a82['attributes'],function(_0x5058fb){var _0x451dac={};_0x451dac[_0x5058fb]={'$like':'%'+_0x58fcf0[_0xc4e1('0x33')][_0xc4e1('0x3e')]+'%'};return _0x451dac;})});}_0x180a82=_[_0xc4e1('0x3f')]({},_0x180a82,_0x58fcf0[_0xc4e1('0x40')]);return db[_0xc4e1('0x61')]['findAndCountAll'](_0x180a82);}})['then'](respondWithResult(_0x45020a,null))[_0xc4e1('0x44')](handleError(_0x45020a,null));};exports[_0xc4e1('0x82')]=function(_0x2f7a75,_0xfdcea,_0x581b72){return db[_0xc4e1('0x2d')][_0xc4e1('0x46')]({'where':{'id':_0x2f7a75[_0xc4e1('0x4e')]['id']}})['then'](handleEntityNotFound(_0xfdcea,null))[_0xc4e1('0x25')](function(_0x15e526){if(_0x15e526){return _0x15e526['addAgents'](_0x2f7a75[_0xc4e1('0x48')][_0xc4e1('0x5c')],_[_0xc4e1('0x83')](_0x2f7a75['body'],['ids','id'])||{})[_0xc4e1('0x84')](function(_0x5c3a15){for(var _0x596cd5=0x0;_0x596cd5<_0x2f7a75[_0xc4e1('0x48')]['ids'][_0xc4e1('0x39')];_0x596cd5+=0x1){socket[_0xc4e1('0x85')](_0xc4e1('0x86'),{'UserId':Number(_0x2f7a75[_0xc4e1('0x48')]['ids'][_0x596cd5]),'CmListId':Number(_0x2f7a75[_0xc4e1('0x4e')]['id'])});}return _0x5c3a15;});}})[_0xc4e1('0x25')](respondWithResult(_0xfdcea,null))[_0xc4e1('0x44')](handleError(_0xfdcea,null));};exports[_0xc4e1('0x87')]=function(_0x51badd,_0x32dba0,_0x1b298d){return db[_0xc4e1('0x2d')][_0xc4e1('0x46')]({'where':{'id':_0x51badd[_0xc4e1('0x4e')]['id']}})[_0xc4e1('0x25')](handleEntityNotFound(_0x32dba0,null))[_0xc4e1('0x25')](function(_0x433794){if(_0x433794){return _0x433794['removeAgents'](_0x51badd[_0xc4e1('0x33')]['ids'])[_0xc4e1('0x25')](function(){if(_[_0xc4e1('0x58')](_0x51badd[_0xc4e1('0x33')][_0xc4e1('0x5c')])){for(var _0x4bf4d5=0x0;_0x4bf4d5<_0x51badd[_0xc4e1('0x33')][_0xc4e1('0x5c')][_0xc4e1('0x39')];_0x4bf4d5+=0x1){socket[_0xc4e1('0x85')](_0xc4e1('0x88'),{'UserId':Number(_0x51badd[_0xc4e1('0x33')][_0xc4e1('0x5c')][_0x4bf4d5]),'CmListId':Number(_0x51badd[_0xc4e1('0x4e')]['id'])});}}else{socket['emit'](_0xc4e1('0x88'),{'UserId':Number(_0x51badd[_0xc4e1('0x33')][_0xc4e1('0x5c')]),'CmListId':Number(_0x51badd[_0xc4e1('0x4e')]['id'])});}});}})[_0xc4e1('0x25')](respondWithStatusCode(_0x32dba0,null))[_0xc4e1('0x44')](handleError(_0x32dba0,null));};exports[_0xc4e1('0x89')]=function(_0xc4e08a,_0x220021,_0x556bbf){var _0x27b579={};var _0x48aa7c={};var _0x320a90;var _0x460153;return db['CmList'][_0xc4e1('0x52')]({'where':{'id':_0xc4e08a[_0xc4e1('0x4e')]['id']}})[_0xc4e1('0x25')](handleEntityNotFound(_0x220021,null))[_0xc4e1('0x25')](function(_0x23727f){if(_0x23727f){_0x320a90=_0x23727f;_0x48aa7c[_0xc4e1('0x32')]=_[_0xc4e1('0x34')](db['User'][_0xc4e1('0x2e')]);_0x48aa7c[_0xc4e1('0x33')]=_[_0xc4e1('0x34')](_0xc4e08a[_0xc4e1('0x33')]);_0x48aa7c[_0xc4e1('0x35')]=_[_0xc4e1('0x36')](_0x48aa7c['model'],_0x48aa7c['query']);_0x27b579['attributes']=_[_0xc4e1('0x36')](_0x48aa7c[_0xc4e1('0x32')],qs[_0xc4e1('0x38')](_0xc4e08a['query'][_0xc4e1('0x38')]));_0x27b579[_0xc4e1('0x37')]=_0x27b579[_0xc4e1('0x37')]['length']?_0x27b579[_0xc4e1('0x37')]:_0x48aa7c[_0xc4e1('0x32')];_0x27b579[_0xc4e1('0x65')]=qs[_0xc4e1('0x3b')](_0xc4e08a[_0xc4e1('0x33')][_0xc4e1('0x3b')]);_0x27b579[_0xc4e1('0x3c')]=qs[_0xc4e1('0x35')](_['pick'](_0xc4e08a[_0xc4e1('0x33')],_0x48aa7c[_0xc4e1('0x35')]));if(_0xc4e08a[_0xc4e1('0x33')]['filter']){_0x27b579[_0xc4e1('0x3c')]=_[_0xc4e1('0x3f')](_0x27b579['where'],{'$or':_[_0xc4e1('0x2c')](_0x27b579['attributes'],function(_0x56b92b){var _0x4980e7={};_0x4980e7[_0x56b92b]={'$like':'%'+_0xc4e08a[_0xc4e1('0x33')][_0xc4e1('0x3e')]+'%'};return _0x4980e7;})});}_0x27b579=_[_0xc4e1('0x3f')]({},_0x27b579,_0xc4e08a['options']);return _0x320a90['getAgents'](_0x27b579);}})[_0xc4e1('0x25')](function(_0x59ddf5){if(_0x59ddf5){_0x460153=_0x59ddf5[_0xc4e1('0x39')];if(!_0xc4e08a['query'][_0xc4e1('0x3a')](_0xc4e1('0x54'))){_0x27b579[_0xc4e1('0x21')]=qs[_0xc4e1('0x21')](_0xc4e08a[_0xc4e1('0x33')][_0xc4e1('0x21')]);_0x27b579[_0xc4e1('0x1e')]=qs[_0xc4e1('0x1e')](_0xc4e08a['query'][_0xc4e1('0x1e')]);}return _0x320a90[_0xc4e1('0x89')](_0x27b579);}})[_0xc4e1('0x25')](function(_0x2ef54e){if(_0x2ef54e){return _0x2ef54e?{'count':_0x460153,'rows':_0x2ef54e}:null;}})[_0xc4e1('0x25')](respondWithResult(_0x220021,null))[_0xc4e1('0x44')](handleError(_0x220021,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 4e2e818..34364eb 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x55ca,0x126));var _0xa55c=function(_0x3cc8b4,_0x33bc7d){_0x3cc8b4=_0x3cc8b4-0x0;var _0x20ff15=_0x55ca[_0x3cc8b4];return _0x20ff15;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var CmList=require(_0xa55c('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){CmListEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);CmListEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];CmList[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0x326f=['exports','events','setMaxListeners','save','update','remove','emit','hook'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x326f,0xd1));var _0xf326=function(_0x102871,_0x126630){_0x102871=_0x102871-0x0;var _0x19f015=_0x326f[_0x102871];return _0x19f015;};'use strict';var EventEmitter=require(_0xf326('0x0'));var CmList=require('../../mysqldb')['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0xf326('0x1')](0x0);var events={'afterCreate':_0xf326('0x2'),'afterUpdate':_0xf326('0x3'),'afterDestroy':_0xf326('0x4')};function emitEvent(_0x27e8d7){return function(_0x120a26,_0x9445c6,_0xf1c243){CmListEvents[_0xf326('0x5')](_0x27e8d7+':'+_0x120a26['id'],_0x120a26);CmListEvents[_0xf326('0x5')](_0x27e8d7,_0x120a26);_0xf1c243(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xf326('0x6')](e,emitEvent(event));}}module[_0xf326('0x7')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 6241eb9..be9aac5 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 _0x9c44=['request-promise','path','./cmList.attributes','define','CmList','cm_lists','../../config/logger','api','moment','bluebird'];(function(_0x131f5a,_0x445035){var _0x3f7744=function(_0x30f76e){while(--_0x30f76e){_0x131f5a['push'](_0x131f5a['shift']());}};_0x3f7744(++_0x445035);}(_0x9c44,0x178));var _0x49c4=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x9c44[_0x1caf6a];return _0x1bf493;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa74f=['cm_lists','../../config/logger','bluebird','request-promise','path','rimraf','./cmList.attributes','define','CmList'];(function(_0x16b737,_0x16d0cb){var _0x3405fa=function(_0x389d5b){while(--_0x389d5b){_0x16b737['push'](_0x16b737['shift']());}};_0x3405fa(++_0x16d0cb);}(_0xa74f,0x9a));var _0xfa74=function(_0x257a28,_0x2cd00d){_0x257a28=_0x257a28-0x0;var _0x13bccc=_0xa74f[_0x257a28];return _0x13bccc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfa74('0x0'))('api');var moment=require('moment');var BPromise=require(_0xfa74('0x1'));var rp=require(_0xfa74('0x2'));var fs=require('fs');var path=require(_0xfa74('0x3'));var rimraf=require(_0xfa74('0x4'));var config=require('../../config/environment');var attributes=require(_0xfa74('0x5'));module['exports']=function(_0x543cfe,_0x43dd2f){return _0x543cfe[_0xfa74('0x6')](_0xfa74('0x7'),attributes,{'tableName':_0xfa74('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 7870cad..dfefbf7 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 _0x99f4=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','./cmList.socket','register','request','then','info','debug','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','CmList,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird'];(function(_0x2ef44b,_0x553359){var _0x2405b9=function(_0x278290){while(--_0x278290){_0x2ef44b['push'](_0x2ef44b['shift']());}};_0x2405b9(++_0x553359);}(_0x99f4,0x176));var _0x499f=function(_0x420770,_0x3f7edf){_0x420770=_0x420770-0x0;var _0x1fe12e=_0x99f4[_0x420770];return _0x1fe12e;};'use strict';var _=require(_0x499f('0x0'));var util=require(_0x499f('0x1'));var moment=require(_0x499f('0x2'));var BPromise=require(_0x499f('0x3'));var rs=require(_0x499f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x499f('0x5'))['db'];var utils=require(_0x499f('0x6'));var logger=require(_0x499f('0x7'))(_0x499f('0x8'));var config=require(_0x499f('0x9'));var jayson=require(_0x499f('0xa'));var client=jayson['client'][_0x499f('0xb')]({'port':0x232a});config[_0x499f('0xc')]=_['defaults'](config[_0x499f('0xc')],{'host':_0x499f('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x499f('0xc')]));require(_0x499f('0xe'))[_0x499f('0xf')](socket);function respondWithRpcPromise(_0x581634,_0x52e367,_0x4d92f2){return new BPromise(function(_0x1bd8e6,_0x2ea380){return client[_0x499f('0x10')](_0x581634,_0x4d92f2)[_0x499f('0x11')](function(_0x4b0649){logger[_0x499f('0x12')]('CmList,\x20%s,\x20%s',_0x52e367,'request\x20sent');logger[_0x499f('0x13')](_0x499f('0x14'),_0x52e367,_0x499f('0x15'),JSON['stringify'](_0x4b0649));if(_0x4b0649[_0x499f('0x16')]){if(_0x4b0649[_0x499f('0x16')][_0x499f('0x17')]===0x1f4){logger[_0x499f('0x16')](_0x499f('0x18'),_0x52e367,_0x4b0649[_0x499f('0x16')][_0x499f('0x19')]);return _0x2ea380(_0x4b0649[_0x499f('0x16')]['message']);}logger[_0x499f('0x16')](_0x499f('0x18'),_0x52e367,_0x4b0649[_0x499f('0x16')]['message']);return _0x1bd8e6(_0x4b0649[_0x499f('0x16')][_0x499f('0x19')]);}else{logger[_0x499f('0x12')](_0x499f('0x18'),_0x52e367,'request\x20sent');_0x1bd8e6(_0x4b0649['result'][_0x499f('0x19')]);}})[_0x499f('0x1a')](function(_0x4d6a5d){logger[_0x499f('0x16')](_0x499f('0x18'),_0x52e367,_0x4d6a5d);_0x2ea380(_0x4d6a5d);});});} \ No newline at end of file +var _0x922f=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash'];(function(_0x392365,_0x54e90e){var _0x493d94=function(_0xaded29){while(--_0xaded29){_0x392365['push'](_0x392365['shift']());}};_0x493d94(++_0x54e90e);}(_0x922f,0x117));var _0xf922=function(_0x5d6e45,_0x47bc47){_0x5d6e45=_0x5d6e45-0x0;var _0x53a7f1=_0x922f[_0x5d6e45];return _0x53a7f1;};'use strict';var _=require(_0xf922('0x0'));var util=require(_0xf922('0x1'));var moment=require(_0xf922('0x2'));var BPromise=require(_0xf922('0x3'));var rs=require(_0xf922('0x4'));var fs=require('fs');var Redis=require(_0xf922('0x5'));var db=require(_0xf922('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf922('0x7'))(_0xf922('0x8'));var config=require('../../config/environment');var jayson=require(_0xf922('0x9'));var client=jayson[_0xf922('0xa')]['http']({'port':0x232a});config['redis']=_[_0xf922('0xb')](config[_0xf922('0xc')],{'host':_0xf922('0xd'),'port':0x18eb});var socket=require(_0xf922('0xe'))(new Redis(config[_0xf922('0xc')]));require(_0xf922('0xf'))[_0xf922('0x10')](socket);function respondWithRpcPromise(_0x75973e,_0xb5665a,_0x284bdf){return new BPromise(function(_0x4756a9,_0x173c6b){return client[_0xf922('0x11')](_0x75973e,_0x284bdf)[_0xf922('0x12')](function(_0x55a85d){logger[_0xf922('0x13')](_0xf922('0x14'),_0xb5665a,'request\x20sent');logger['debug'](_0xf922('0x15'),_0xb5665a,_0xf922('0x16'),JSON[_0xf922('0x17')](_0x55a85d));if(_0x55a85d[_0xf922('0x18')]){if(_0x55a85d[_0xf922('0x18')][_0xf922('0x19')]===0x1f4){logger[_0xf922('0x18')](_0xf922('0x14'),_0xb5665a,_0x55a85d[_0xf922('0x18')][_0xf922('0x1a')]);return _0x173c6b(_0x55a85d['error'][_0xf922('0x1a')]);}logger[_0xf922('0x18')](_0xf922('0x14'),_0xb5665a,_0x55a85d[_0xf922('0x18')][_0xf922('0x1a')]);return _0x4756a9(_0x55a85d['error'][_0xf922('0x1a')]);}else{logger[_0xf922('0x13')](_0xf922('0x14'),_0xb5665a,'request\x20sent');_0x4756a9(_0x55a85d['result'][_0xf922('0x1a')]);}})[_0xf922('0x1b')](function(_0x437768){logger[_0xf922('0x18')](_0xf922('0x14'),_0xb5665a,_0x437768);_0x173c6b(_0x437768);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index d0a1d6b..ff26792 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 _0x5c75=['length','./cmList.events','save','remove','update','removeListener'];(function(_0x2af235,_0x45f664){var _0x593c0e=function(_0x1b12d4){while(--_0x1b12d4){_0x2af235['push'](_0x2af235['shift']());}};_0x593c0e(++_0x45f664);}(_0x5c75,0xc1));var _0x55c7=function(_0x53ba51,_0x2f2321){_0x53ba51=_0x53ba51-0x0;var _0x2e776e=_0x5c75[_0x53ba51];return _0x2e776e;};'use strict';var CmListEvents=require(_0x55c7('0x0'));var events=[_0x55c7('0x1'),_0x55c7('0x2'),_0x55c7('0x3')];function createListener(_0x4c15a0,_0x452a16){return function(_0x142185){_0x452a16['emit'](_0x4c15a0,_0x142185);};}function removeListener(_0x3aec86,_0x5ae75d){return function(){CmListEvents[_0x55c7('0x4')](_0x3aec86,_0x5ae75d);};}exports['register']=function(_0x225d68){for(var _0x458510=0x0,_0x5bca30=events[_0x55c7('0x5')];_0x458510<_0x5bca30;_0x458510++){var _0x168d5b=events[_0x458510];var _0x51b9c8=createListener('cmList:'+_0x168d5b,_0x225d68);CmListEvents['on'](_0x168d5b,_0x51b9c8);}}; \ No newline at end of file +var _0xe2c8=['register','length','cmList:','./cmList.events','remove','update','removeListener'];(function(_0x5ba014,_0x51c29e){var _0x5e1971=function(_0x4168ef){while(--_0x4168ef){_0x5ba014['push'](_0x5ba014['shift']());}};_0x5e1971(++_0x51c29e);}(_0xe2c8,0x17d));var _0x8e2c=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xe2c8[_0x3511d3];return _0x5d6321;};'use strict';var CmListEvents=require(_0x8e2c('0x0'));var events=['save',_0x8e2c('0x1'),_0x8e2c('0x2')];function createListener(_0x43ac85,_0x3db327){return function(_0xeca532){_0x3db327['emit'](_0x43ac85,_0xeca532);};}function removeListener(_0x408609,_0xa75c9a){return function(){CmListEvents[_0x8e2c('0x3')](_0x408609,_0xa75c9a);};}exports[_0x8e2c('0x4')]=function(_0x3f039b){for(var _0x2ac58d=0x0,_0x8b17be=events[_0x8e2c('0x5')];_0x2ac58d<_0x8b17be;_0x2ac58d++){var _0x2b9e3e=events[_0x2ac58d];var _0x45bfc5=createListener(_0x8e2c('0x6')+_0x2b9e3e,_0x3f039b);CmListEvents['on'](_0x2b9e3e,_0x45bfc5);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 8fc3bca..e5438e0 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 _0x193f=['../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addContacts','addAgents','put','update','delete','destroy','removeDispositions','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x193f,0x12d));var _0xf193=function(_0x406e46,_0x5799cb){_0x406e46=_0x406e46-0x0;var _0x4a3742=_0x193f[_0x406e46];return _0x4a3742;};'use strict';var multer=require(_0xf193('0x0'));var util=require(_0xf193('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf193('0x2')]();var fs_extra=require(_0xf193('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf193('0x4'));var config=require(_0xf193('0x5'));var controller=require(_0xf193('0x6'));router[_0xf193('0x7')]('/',auth[_0xf193('0x8')](),controller[_0xf193('0x9')]);router[_0xf193('0x7')](_0xf193('0xa'),auth[_0xf193('0x8')](),controller[_0xf193('0xb')]);router[_0xf193('0x7')](_0xf193('0xc'),auth['isAuthenticated'](),controller[_0xf193('0xd')]);router['get'](_0xf193('0xe'),auth[_0xf193('0x8')](),controller[_0xf193('0xf')]);router['get'](_0xf193('0x10'),auth['isAuthenticated'](),controller[_0xf193('0x11')]);router['get'](_0xf193('0x12'),auth[_0xf193('0x8')](),controller[_0xf193('0x13')]);router[_0xf193('0x7')](_0xf193('0x14'),auth['isAuthenticated'](),controller[_0xf193('0x15')]);router['get'](_0xf193('0x16'),auth[_0xf193('0x8')](),controller[_0xf193('0x17')]);router[_0xf193('0x18')]('/',auth['isAuthenticated'](),controller[_0xf193('0x19')]);router[_0xf193('0x18')](_0xf193('0xe'),auth['isAuthenticated'](),controller['addDisposition']);router[_0xf193('0x18')]('/:id/contacts',auth[_0xf193('0x8')](),controller[_0xf193('0x1a')]);router[_0xf193('0x18')](_0xf193('0x14'),auth[_0xf193('0x8')](),controller['addCustomField']);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0xf193('0x1b')]);router[_0xf193('0x1c')](_0xf193('0xc'),auth['isAuthenticated'](),controller[_0xf193('0x1d')]);router[_0xf193('0x1e')](_0xf193('0xc'),auth[_0xf193('0x8')](),controller[_0xf193('0x1f')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller[_0xf193('0x20')]);router['delete'](_0xf193('0x16'),auth[_0xf193('0x8')](),controller['removeAgents']);module[_0xf193('0x21')]=router; \ No newline at end of file +var _0xc84f=['describe','/:id','show','/:id/dispositions','getDispositions','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','addDisposition','addContacts','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','util','connect-timeout','express','Router','fs-extra','../../config/environment','./cmList.controller','get','isAuthenticated'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0xc84f,0x197));var _0xfc84=function(_0x44c99e,_0x21c373){_0x44c99e=_0x44c99e-0x0;var _0x4746c2=_0xc84f[_0x44c99e];return _0x4746c2;};'use strict';var multer=require('multer');var util=require(_0xfc84('0x0'));var path=require('path');var timeout=require(_0xfc84('0x1'));var express=require(_0xfc84('0x2'));var router=express[_0xfc84('0x3')]();var fs_extra=require(_0xfc84('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfc84('0x5'));var controller=require(_0xfc84('0x6'));router[_0xfc84('0x7')]('/',auth[_0xfc84('0x8')](),controller['index']);router['get']('/describe',auth[_0xfc84('0x8')](),controller[_0xfc84('0x9')]);router['get'](_0xfc84('0xa'),auth['isAuthenticated'](),controller[_0xfc84('0xb')]);router[_0xfc84('0x7')](_0xfc84('0xc'),auth['isAuthenticated'](),controller[_0xfc84('0xd')]);router[_0xfc84('0x7')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xfc84('0xe')]);router[_0xfc84('0x7')](_0xfc84('0xf'),auth['isAuthenticated'](),controller[_0xfc84('0x10')]);router[_0xfc84('0x7')](_0xfc84('0x11'),auth[_0xfc84('0x8')](),controller[_0xfc84('0x12')]);router[_0xfc84('0x7')](_0xfc84('0x13'),auth[_0xfc84('0x8')](),controller[_0xfc84('0x14')]);router[_0xfc84('0x15')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xfc84('0xc'),auth[_0xfc84('0x8')](),controller[_0xfc84('0x16')]);router['post']('/:id/contacts',auth[_0xfc84('0x8')](),controller[_0xfc84('0x17')]);router[_0xfc84('0x15')](_0xfc84('0x11'),auth[_0xfc84('0x8')](),controller['addCustomField']);router[_0xfc84('0x15')](_0xfc84('0x13'),auth[_0xfc84('0x8')](),controller[_0xfc84('0x18')]);router[_0xfc84('0x19')]('/:id',auth[_0xfc84('0x8')](),controller[_0xfc84('0x1a')]);router[_0xfc84('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0xfc84('0x1c')]);router['delete'](_0xfc84('0xc'),auth[_0xfc84('0x8')](),controller[_0xfc84('0x1d')]);router[_0xfc84('0x1b')]('/:id/users',auth[_0xfc84('0x8')](),controller[_0xfc84('0x1e')]);module[_0xfc84('0x1f')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index ecb0aab..2530104 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 _0xd5de=['sequelize','exports','VIRTUAL','STRING'];(function(_0x12ddb2,_0x5ad61e){var _0x10b6dd=function(_0x47dd27){while(--_0x47dd27){_0x12ddb2['push'](_0x12ddb2['shift']());}};_0x10b6dd(++_0x5ad61e);}(_0xd5de,0x158));var _0xed5d=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xd5de[_0x3e5086];return _0xfeb102;};'use strict';var Sequelize=require(_0xed5d('0x0'));module[_0xed5d('0x1')]={'name':{'type':Sequelize[_0xed5d('0x2')],'get':function(_0x3c6747){return this['getDataValue']('field');}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0xed5d('0x3')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x00a4=['sequelize','exports','VIRTUAL','getDataValue','field','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x00a4,0x198));var _0x400a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x00a4[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x400a('0x0'));module[_0x400a('0x1')]={'name':{'type':Sequelize[_0x400a('0x2')],'get':function(_0x4fad0f){return this[_0x400a('0x3')](_0x400a('0x4'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x400a('0x5')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 0c00f89..e3299bf 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x716f80,_0x5467db){var _0x581d6d=function(_0x4535cd){while(--_0x4535cd){_0x716f80['push'](_0x716f80['shift']());}};_0x581d6d(++_0x5467db);}(_0x7a54,0x106));var _0x47a5=function(_0x3cf1dc,_0x26cdcb){_0x3cf1dc=_0x3cf1dc-0x0;var _0x21eadd=_0x7a54[_0x3cf1dc];return _0x21eadd;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x26fb4b,_0x5a0591){var _0x4e790f=function(_0x2b9393){while(--_0x2b9393){_0x26fb4b['push'](_0x26fb4b['shift']());}};_0x4e790f(++_0x5a0591);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 88d5f8d..4e41536 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 _0x2983=['moment','request-promise','path','./condition.attributes','exports','tools_conditions','util','../../config/logger','api'];(function(_0x2f62aa,_0x108e95){var _0x1a341f=function(_0x3aedcf){while(--_0x3aedcf){_0x2f62aa['push'](_0x2f62aa['shift']());}};_0x1a341f(++_0x108e95);}(_0x2983,0x14a));var _0x3298=function(_0x1efbba,_0x3a4ed9){_0x1efbba=_0x1efbba-0x0;var _0x14acc9=_0x2983[_0x1efbba];return _0x14acc9;};'use strict';var _=require('lodash');var util=require(_0x3298('0x0'));var logger=require(_0x3298('0x1'))(_0x3298('0x2'));var moment=require(_0x3298('0x3'));var BPromise=require('bluebird');var rp=require(_0x3298('0x4'));var fs=require('fs');var path=require(_0x3298('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3298('0x6'));module[_0x3298('0x7')]=function(_0x118f46,_0x42ffe6){return _0x118f46['define']('Condition',attributes,{'tableName':_0x3298('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2a16=['define','Condition','tools_conditions','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./condition.attributes','exports'];(function(_0x4ec54f,_0x60e104){var _0x28d59d=function(_0x964591){while(--_0x964591){_0x4ec54f['push'](_0x4ec54f['shift']());}};_0x28d59d(++_0x60e104);}(_0x2a16,0xe0));var _0x62a1=function(_0x523645,_0x45d437){_0x523645=_0x523645-0x0;var _0x5326a5=_0x2a16[_0x523645];return _0x5326a5;};'use strict';var _=require(_0x62a1('0x0'));var util=require(_0x62a1('0x1'));var logger=require(_0x62a1('0x2'))(_0x62a1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x62a1('0x4'));var fs=require('fs');var path=require(_0x62a1('0x5'));var rimraf=require(_0x62a1('0x6'));var config=require(_0x62a1('0x7'));var attributes=require(_0x62a1('0x8'));module[_0x62a1('0x9')]=function(_0x7ed0e4,_0x2ebc33){return _0x7ed0e4[_0x62a1('0xa')](_0x62a1('0xb'),attributes,{'tableName':_0x62a1('0xc'),'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 4533d47..7c91d1d 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 _0x5c2e=['Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','request','then','info'];(function(_0x5a2285,_0x3212d1){var _0x48f6ed=function(_0x322127){while(--_0x322127){_0x5a2285['push'](_0x5a2285['shift']());}};_0x48f6ed(++_0x3212d1);}(_0x5c2e,0x8d));var _0xe5c2=function(_0x16771d,_0x224c60){_0x16771d=_0x16771d-0x0;var _0x386f11=_0x5c2e[_0x16771d];return _0x386f11;};'use strict';var _=require(_0xe5c2('0x0'));var util=require(_0xe5c2('0x1'));var moment=require(_0xe5c2('0x2'));var BPromise=require(_0xe5c2('0x3'));var rs=require(_0xe5c2('0x4'));var fs=require('fs');var Redis=require(_0xe5c2('0x5'));var db=require(_0xe5c2('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe5c2('0x7'));var config=require('../../config/environment');var jayson=require(_0xe5c2('0x8'));var client=jayson[_0xe5c2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x543ed8,_0x178c68,_0x178959){return new BPromise(function(_0x257c73,_0x152888){return client[_0xe5c2('0xa')](_0x543ed8,_0x178959)[_0xe5c2('0xb')](function(_0x5e8a9f){logger[_0xe5c2('0xc')](_0xe5c2('0xd'),_0x178c68,_0xe5c2('0xe'));logger[_0xe5c2('0xf')](_0xe5c2('0x10'),_0x178c68,_0xe5c2('0xe'),JSON[_0xe5c2('0x11')](_0x5e8a9f));if(_0x5e8a9f[_0xe5c2('0x12')]){if(_0x5e8a9f[_0xe5c2('0x12')]['code']===0x1f4){logger[_0xe5c2('0x12')]('Condition,\x20%s,\x20%s',_0x178c68,_0x5e8a9f['error'][_0xe5c2('0x13')]);return _0x152888(_0x5e8a9f['error'][_0xe5c2('0x13')]);}logger[_0xe5c2('0x12')](_0xe5c2('0xd'),_0x178c68,_0x5e8a9f[_0xe5c2('0x12')][_0xe5c2('0x13')]);return _0x257c73(_0x5e8a9f[_0xe5c2('0x12')][_0xe5c2('0x13')]);}else{logger['info'](_0xe5c2('0xd'),_0x178c68,_0xe5c2('0xe'));_0x257c73(_0x5e8a9f[_0xe5c2('0x14')][_0xe5c2('0x13')]);}})[_0xe5c2('0x15')](function(_0x518e9b){logger['error'](_0xe5c2('0xd'),_0x178c68,_0x518e9b);_0x152888(_0x518e9b);});});} \ No newline at end of file +var _0x4869=['../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','Condition,\x20%s,\x20%s','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','randomstring','ioredis'];(function(_0x15354a,_0x16edaa){var _0x3a55ab=function(_0x498af8){while(--_0x498af8){_0x15354a['push'](_0x15354a['shift']());}};_0x3a55ab(++_0x16edaa);}(_0x4869,0xb1));var _0x9486=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x4869[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require(_0x9486('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9486('0x1'));var fs=require('fs');var Redis=require(_0x9486('0x2'));var db=require(_0x9486('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9486('0x4'))(_0x9486('0x5'));var config=require('../../config/environment');var jayson=require(_0x9486('0x6'));var client=jayson['client'][_0x9486('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x24bec0,_0x198c57,_0x15ef2d){return new BPromise(function(_0x570bff,_0x5ac6d1){return client[_0x9486('0x8')](_0x24bec0,_0x15ef2d)[_0x9486('0x9')](function(_0x423cf3){logger['info'](_0x9486('0xa'),_0x198c57,_0x9486('0xb'));logger['debug'](_0x9486('0xc'),_0x198c57,_0x9486('0xb'),JSON[_0x9486('0xd')](_0x423cf3));if(_0x423cf3[_0x9486('0xe')]){if(_0x423cf3['error'][_0x9486('0xf')]===0x1f4){logger[_0x9486('0xe')](_0x9486('0xa'),_0x198c57,_0x423cf3[_0x9486('0xe')][_0x9486('0x10')]);return _0x5ac6d1(_0x423cf3[_0x9486('0xe')][_0x9486('0x10')]);}logger[_0x9486('0xe')]('Condition,\x20%s,\x20%s',_0x198c57,_0x423cf3[_0x9486('0xe')][_0x9486('0x10')]);return _0x570bff(_0x423cf3[_0x9486('0xe')]['message']);}else{logger[_0x9486('0x11')]('Condition,\x20%s,\x20%s',_0x198c57,_0x9486('0xb'));_0x570bff(_0x423cf3[_0x9486('0x12')][_0x9486('0x10')]);}})[_0x9486('0x13')](function(_0x1f592c){logger[_0x9486('0xe')]('Condition,\x20%s,\x20%s',_0x198c57,_0x1f592c);_0x5ac6d1(_0x1f592c);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 179dacb..1384ca8 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 _0xd79f=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','exports','multer','util','path'];(function(_0x21c6b8,_0x16d6f6){var _0x39d474=function(_0x27dbf5){while(--_0x27dbf5){_0x21c6b8['push'](_0x21c6b8['shift']());}};_0x39d474(++_0x16d6f6);}(_0xd79f,0xdd));var _0xfd79=function(_0x5ae8ab,_0x157da3){_0x5ae8ab=_0x5ae8ab-0x0;var _0x1661db=_0xd79f[_0x5ae8ab];return _0x1661db;};'use strict';var multer=require(_0xfd79('0x0'));var util=require(_0xfd79('0x1'));var path=require(_0xfd79('0x2'));var timeout=require(_0xfd79('0x3'));var express=require('express');var router=express[_0xfd79('0x4')]();var fs_extra=require(_0xfd79('0x5'));var auth=require(_0xfd79('0x6'));var interaction=require(_0xfd79('0x7'));var config=require(_0xfd79('0x8'));var controller=require(_0xfd79('0x9'));router[_0xfd79('0xa')](_0xfd79('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xfd79('0xb'),auth[_0xfd79('0xc')](),controller['destroy']);module[_0xfd79('0xd')]=router; \ No newline at end of file +var _0x9e51=['delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./condition.controller','put','/:id','update'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x9e51,0x1d6));var _0x19e5=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x9e51[_0x1d24eb];return _0x1dc576;};'use strict';var multer=require(_0x19e5('0x0'));var util=require('util');var path=require(_0x19e5('0x1'));var timeout=require(_0x19e5('0x2'));var express=require(_0x19e5('0x3'));var router=express[_0x19e5('0x4')]();var fs_extra=require(_0x19e5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x19e5('0x6'));var config=require('../../config/environment');var controller=require(_0x19e5('0x7'));router[_0x19e5('0x8')](_0x19e5('0x9'),auth['isAuthenticated'](),controller[_0x19e5('0xa')]);router[_0x19e5('0xb')](_0x19e5('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x19e5('0xc')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 1b3e075..aa88cca 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 _0x0713=['STRING','name'];(function(_0xbb723c,_0x3d96e8){var _0x36025c=function(_0x474692){while(--_0x474692){_0xbb723c['push'](_0xbb723c['shift']());}};_0x36025c(++_0x3d96e8);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file +var _0xb7e7=['STRING','sequelize'];(function(_0x5cc8,_0x1faa02){var _0x450661=function(_0x237b05){while(--_0x237b05){_0x5cc8['push'](_0x5cc8['shift']());}};_0x450661(++_0x1faa02);}(_0xb7e7,0x121));var _0x7b7e=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xb7e7[_0x164eca];return _0x2ce562;};'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 1bab3b0..03e9710 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 _0xfa3c=['defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','CustomDashboards','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','Dashboard','includeAll','include','findAll','rows','catch','show','params','length','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','autoAssociation','clone','omit','createdAt','updatedAt','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','order','hasOwnProperty','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xfa3c,0x66));var _0xcfa3=function(_0x5d9c08,_0x68d66e){_0x5d9c08=_0x5d9c08-0x0;var _0x3d07ae=_0xfa3c[_0x5d9c08];return _0x3d07ae;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcfa3('0x0'));var zipdir=require(_0xcfa3('0x1'));var jsonpatch=require(_0xcfa3('0x2'));var rp=require(_0xcfa3('0x3'));var moment=require('moment');var BPromise=require(_0xcfa3('0x4'));var Mustache=require(_0xcfa3('0x5'));var util=require(_0xcfa3('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xcfa3('0x7'));var ejs=require(_0xcfa3('0x8'));var fs=require('fs');var fs_extra=require(_0xcfa3('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xcfa3('0xa'));var jsforce=require(_0xcfa3('0xb'));var deskjs=require(_0xcfa3('0xc'));var toCsv=require(_0xcfa3('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcfa3('0xd'));var authService=require(_0xcfa3('0xe'));var qs=require(_0xcfa3('0xf'));var as=require(_0xcfa3('0x10'));var hardwareService=require(_0xcfa3('0x11'));var logger=require(_0xcfa3('0x12'))(_0xcfa3('0x13'));var utils=require(_0xcfa3('0x14'));var config=require(_0xcfa3('0x15'));var licenseUtil=require(_0xcfa3('0x16'));var db=require(_0xcfa3('0x17'))['db'];config[_0xcfa3('0x18')]=_[_0xcfa3('0x19')](config[_0xcfa3('0x18')],{'host':_0xcfa3('0x1a'),'port':0x18eb});var socket=require(_0xcfa3('0x1b'))(new Redis(config[_0xcfa3('0x18')]));require(_0xcfa3('0x1c'))[_0xcfa3('0x1d')](socket);function respondWithStatusCode(_0x1a1e40,_0x237432){_0x237432=_0x237432||0xcc;return function(_0x24c864){if(_0x24c864){return _0x1a1e40[_0xcfa3('0x1e')](_0x237432);}return _0x1a1e40[_0xcfa3('0x1f')](_0x237432)[_0xcfa3('0x20')]();};}function respondWithResult(_0x4dde68,_0x1d21c5){_0x1d21c5=_0x1d21c5||0xc8;return function(_0x33dbb0){if(_0x33dbb0){return _0x4dde68['status'](_0x1d21c5)[_0xcfa3('0x21')](_0x33dbb0);}};}function respondWithFilteredResult(_0x29b63f,_0x3a8048){return function(_0x9d703){if(_0x9d703){var _0x42f305=typeof _0x3a8048[_0xcfa3('0x22')]===_0xcfa3('0x23')&&typeof _0x3a8048[_0xcfa3('0x24')]===_0xcfa3('0x23');var _0x191788=_0x9d703[_0xcfa3('0x25')];var _0x10b6fa=_0x42f305?0x0:_0x3a8048[_0xcfa3('0x22')];var _0x466e7a=_0x42f305?_0x9d703['count']:_0x3a8048[_0xcfa3('0x22')]+_0x3a8048['limit'];var _0x2cadc9;if(_0x466e7a>=_0x191788){_0x466e7a=_0x191788;_0x2cadc9=0xc8;}else{_0x2cadc9=0xce;}_0x29b63f[_0xcfa3('0x1f')](_0x2cadc9);return _0x29b63f[_0xcfa3('0x26')](_0xcfa3('0x27'),_0x10b6fa+'-'+_0x466e7a+'/'+_0x191788)[_0xcfa3('0x21')](_0x9d703);}return null;};}function patchUpdates(_0x1e4251){return function(_0x46eb6f){try{jsonpatch[_0xcfa3('0x28')](_0x46eb6f,_0x1e4251,!![]);}catch(_0xf8a6af){return BPromise['reject'](_0xf8a6af);}return _0x46eb6f[_0xcfa3('0x29')]();};}function saveUpdates(_0x5b6f0e,_0x2c4f1e){return function(_0x298153){if(_0x298153){return _0x298153['update'](_0x5b6f0e)[_0xcfa3('0x2a')](function(_0x3643a2){return _0x3643a2;});}return null;};}function removeEntity(_0x1f5be3,_0x44d7e6){return function(_0x4ec2bb){if(_0x4ec2bb){return _0x4ec2bb[_0xcfa3('0x2b')]()[_0xcfa3('0x2a')](function(){var _0x277016=_0x4ec2bb['get']({'plain':!![]});var _0x723761=_0xcfa3('0x2c');return db[_0xcfa3('0x2d')][_0xcfa3('0x2b')]({'where':{'type':_0x723761,'resourceId':_0x277016['id']}})[_0xcfa3('0x2a')](function(){return _0x4ec2bb;});})[_0xcfa3('0x2a')](function(){_0x1f5be3[_0xcfa3('0x1f')](0xcc)[_0xcfa3('0x20')]();});}};}function handleEntityNotFound(_0x45c752,_0x4d2cf9){return function(_0x327919){if(!_0x327919){_0x45c752[_0xcfa3('0x1e')](0x194);}return _0x327919;};}function handleError(_0x2f220e,_0x610cbf){_0x610cbf=_0x610cbf||0x1f4;return function(_0x22551e){logger[_0xcfa3('0x2e')](_0x22551e[_0xcfa3('0x2f')]);if(_0x22551e[_0xcfa3('0x30')]){delete _0x22551e[_0xcfa3('0x30')];}_0x2f220e['status'](_0x610cbf)[_0xcfa3('0x31')](_0x22551e);};}exports[_0xcfa3('0x32')]=function(_0x100eef,_0x5d0205){var _0x5f53af={},_0x3f5eab={},_0x1607f5={'count':0x0,'rows':[]};var _0x49ee6c=_[_0xcfa3('0x33')](db['Dashboard'][_0xcfa3('0x34')],function(_0x357568){return{'name':_0x357568[_0xcfa3('0x35')],'type':_0x357568[_0xcfa3('0x36')][_0xcfa3('0x37')]};});_0x3f5eab['model']=_[_0xcfa3('0x33')](_0x49ee6c,_0xcfa3('0x30'));_0x3f5eab[_0xcfa3('0x38')]=_[_0xcfa3('0x39')](_0x100eef[_0xcfa3('0x38')]);_0x3f5eab['filters']=_[_0xcfa3('0x3a')](_0x3f5eab[_0xcfa3('0x3b')],_0x3f5eab[_0xcfa3('0x38')]);_0x5f53af[_0xcfa3('0x3c')]=_[_0xcfa3('0x3a')](_0x3f5eab[_0xcfa3('0x3b')],qs[_0xcfa3('0x3d')](_0x100eef[_0xcfa3('0x38')]['fields']));_0x5f53af[_0xcfa3('0x3c')]=_0x5f53af[_0xcfa3('0x3c')]['length']?_0x5f53af['attributes']:_0x3f5eab[_0xcfa3('0x3b')];if(!_0x100eef[_0xcfa3('0x38')]['hasOwnProperty'](_0xcfa3('0x3e'))){_0x5f53af[_0xcfa3('0x24')]=qs['limit'](_0x100eef[_0xcfa3('0x38')][_0xcfa3('0x24')]);_0x5f53af[_0xcfa3('0x22')]=qs['offset'](_0x100eef[_0xcfa3('0x38')][_0xcfa3('0x22')]);}_0x5f53af['order']=qs[_0xcfa3('0x3f')](_0x100eef[_0xcfa3('0x38')]['sort']);_0x5f53af[_0xcfa3('0x40')]=qs[_0xcfa3('0x41')](_['pick'](_0x100eef[_0xcfa3('0x38')],_0x3f5eab[_0xcfa3('0x41')]),_0x49ee6c);if(_0x100eef['query'][_0xcfa3('0x42')]){_0x5f53af['where']=_[_0xcfa3('0x43')](_0x5f53af['where'],{'$or':_[_0xcfa3('0x33')](_0x49ee6c,function(_0x27b817){if(_0x27b817[_0xcfa3('0x36')]!==_0xcfa3('0x44')){var _0x33320b={};_0x33320b[_0x27b817[_0xcfa3('0x30')]]={'$like':'%'+_0x100eef[_0xcfa3('0x38')][_0xcfa3('0x42')]+'%'};return _0x33320b;}})});}_0x5f53af=_[_0xcfa3('0x43')]({},_0x5f53af,_0x100eef[_0xcfa3('0x45')]);var _0x3c94ed={'where':_0x5f53af['where']};return db[_0xcfa3('0x46')][_0xcfa3('0x25')](_0x3c94ed)[_0xcfa3('0x2a')](function(_0x108780){_0x1607f5[_0xcfa3('0x25')]=_0x108780;if(_0x100eef[_0xcfa3('0x38')][_0xcfa3('0x47')]){_0x5f53af[_0xcfa3('0x48')]=[{'all':!![]}];}return db['Dashboard'][_0xcfa3('0x49')](_0x5f53af);})['then'](function(_0x588da2){_0x1607f5[_0xcfa3('0x4a')]=_0x588da2;return _0x1607f5;})['then'](respondWithFilteredResult(_0x5d0205,_0x5f53af))[_0xcfa3('0x4b')](handleError(_0x5d0205,null));};exports[_0xcfa3('0x4c')]=function(_0x35277d,_0x38136b){var _0x5ea3d0={'raw':![],'where':{'id':_0x35277d[_0xcfa3('0x4d')]['id']}},_0x2077b1={};_0x2077b1['model']=_['keys'](db[_0xcfa3('0x46')][_0xcfa3('0x34')]);_0x2077b1['query']=_[_0xcfa3('0x39')](_0x35277d['query']);_0x2077b1['filters']=_[_0xcfa3('0x3a')](_0x2077b1[_0xcfa3('0x3b')],_0x2077b1[_0xcfa3('0x38')]);_0x5ea3d0[_0xcfa3('0x3c')]=_[_0xcfa3('0x3a')](_0x2077b1['model'],qs[_0xcfa3('0x3d')](_0x35277d[_0xcfa3('0x38')]['fields']));_0x5ea3d0[_0xcfa3('0x3c')]=_0x5ea3d0[_0xcfa3('0x3c')][_0xcfa3('0x4e')]?_0x5ea3d0[_0xcfa3('0x3c')]:_0x2077b1['model'];if(_0x35277d['query']['includeAll']){_0x5ea3d0[_0xcfa3('0x48')]=[{'all':!![]}];}_0x5ea3d0=_[_0xcfa3('0x43')]({},_0x5ea3d0,_0x35277d['options']);return db[_0xcfa3('0x46')]['find'](_0x5ea3d0)[_0xcfa3('0x2a')](handleEntityNotFound(_0x38136b,null))['then'](respondWithResult(_0x38136b,null))[_0xcfa3('0x4b')](handleError(_0x38136b,null));};exports[_0xcfa3('0x4f')]=function(_0x584838,_0x7b690b){return db['Dashboard'][_0xcfa3('0x4f')](_0x584838[_0xcfa3('0x50')],{})[_0xcfa3('0x2a')](function(_0x119e2b){var _0x2b7ef9=_0x584838['user'][_0xcfa3('0x51')]({'plain':!![]});if(!_0x2b7ef9)throw new Error(_0xcfa3('0x52'));if(_0x2b7ef9['role']===_0xcfa3('0x53')){var _0x1a835b=_0x119e2b[_0xcfa3('0x51')]({'plain':!![]});var _0xc809d4=_0xcfa3('0x2c');return db[_0xcfa3('0x54')][_0xcfa3('0x55')]({'where':{'name':_0xc809d4,'userProfileId':_0x2b7ef9['userProfileId']},'raw':!![]})[_0xcfa3('0x2a')](function(_0x1b28ab){if(_0x1b28ab&&_0x1b28ab[_0xcfa3('0x56')]===0x0){return db[_0xcfa3('0x2d')]['create']({'name':_0x1a835b[_0xcfa3('0x30')],'resourceId':_0x1a835b['id'],'type':_0x1b28ab[_0xcfa3('0x30')],'sectionId':_0x1b28ab['id']},{})[_0xcfa3('0x2a')](function(){return _0x119e2b;});}else{return _0x119e2b;}})[_0xcfa3('0x4b')](function(_0x5ab0df){logger[_0xcfa3('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5ab0df);throw _0x5ab0df;});}return _0x119e2b;})[_0xcfa3('0x2a')](respondWithResult(_0x7b690b,0xc9))['catch'](handleError(_0x7b690b,null));};exports[_0xcfa3('0x57')]=function(_0xa920f5,_0x1f21c1){var _0x1c386c={'where':{'id':_0xa920f5[_0xcfa3('0x4d')]['id']}},_0x46b6c0={};_0x46b6c0['model']=_[_0xcfa3('0x39')](db[_0xcfa3('0x46')][_0xcfa3('0x34')]);_0x1c386c[_0xcfa3('0x3c')]=_['intersection'](_0x46b6c0[_0xcfa3('0x3b')],qs[_0xcfa3('0x3d')](_0xa920f5[_0xcfa3('0x38')]['fields']));_0x1c386c['attributes']=_0x1c386c['attributes'][_0xcfa3('0x4e')]?_0x1c386c['attributes']:_0x46b6c0[_0xcfa3('0x3b')];if(_0xa920f5['query'][_0xcfa3('0x47')]){_0x1c386c[_0xcfa3('0x48')]=[{'all':!![]}];}_0x1c386c=_[_0xcfa3('0x43')]({},_0x1c386c,_0xa920f5[_0xcfa3('0x45')]);return db[_0xcfa3('0x46')][_0xcfa3('0x55')](_0x1c386c)[_0xcfa3('0x2a')](handleEntityNotFound(_0x1f21c1,null))[_0xcfa3('0x2a')](function(_0x475029){if(_0x475029){var _0x371ecf=_0x475029[_0xcfa3('0x51')]({'plain':!![]});_0x371ecf=qs[_0xcfa3('0x58')](_0x371ecf,['id',_0xcfa3('0x59'),_0xcfa3('0x5a')]);_0xa920f5[_0xcfa3('0x50')]=_[_0xcfa3('0x58')](_0xa920f5[_0xcfa3('0x50')],['id',_0xcfa3('0x59'),'updatedAt']);return db['Dashboard'][_0xcfa3('0x4f')](_[_0xcfa3('0x43')](_0x371ecf,_0xa920f5[_0xcfa3('0x50')]),{'include':_0xa920f5['query'][_0xcfa3('0x47')]?[{'all':!![]}]:undefined})[_0xcfa3('0x2a')](function(_0x49bc5a){var _0x5e5dcf=_0xa920f5[_0xcfa3('0x53')]['get']({'plain':!![]});if(!_0x5e5dcf)throw new Error(_0xcfa3('0x52'));if(_0x5e5dcf[_0xcfa3('0x5b')]===_0xcfa3('0x53')){var _0x33cb32=_0x49bc5a[_0xcfa3('0x51')]({'plain':!![]});var _0x4b2be9=_0xcfa3('0x2c');return db['UserProfileSection'][_0xcfa3('0x55')]({'where':{'name':_0x4b2be9,'userProfileId':_0x5e5dcf[_0xcfa3('0x5c')]},'raw':!![]})['then'](function(_0x489d8b){if(_0x489d8b&&_0x489d8b['autoAssociation']===0x0){return db['UserProfileResource'][_0xcfa3('0x4f')]({'name':_0x33cb32[_0xcfa3('0x30')],'resourceId':_0x33cb32['id'],'type':_0x489d8b[_0xcfa3('0x30')],'sectionId':_0x489d8b['id']},{})['then'](function(){return _0x49bc5a;});}else{return _0x49bc5a;}})[_0xcfa3('0x4b')](function(_0x4e4f3a){logger[_0xcfa3('0x2e')](_0xcfa3('0x5d'),_0x4e4f3a);throw _0x4e4f3a;});}return _0x49bc5a;});}})[_0xcfa3('0x2a')](respondWithResult(_0x1f21c1,0xc9))[_0xcfa3('0x4b')](handleError(_0x1f21c1,null));};exports['update']=function(_0x52c9e2,_0x3f55d){if(_0x52c9e2[_0xcfa3('0x50')]['id']){delete _0x52c9e2['body']['id'];}return db[_0xcfa3('0x46')][_0xcfa3('0x55')]({'where':{'id':_0x52c9e2[_0xcfa3('0x4d')]['id']}})[_0xcfa3('0x2a')](handleEntityNotFound(_0x3f55d,null))[_0xcfa3('0x2a')](saveUpdates(_0x52c9e2[_0xcfa3('0x50')],null))['then'](respondWithResult(_0x3f55d,null))[_0xcfa3('0x4b')](handleError(_0x3f55d,null));};exports[_0xcfa3('0x2b')]=function(_0x501a30,_0x495e84){return db[_0xcfa3('0x46')]['find']({'where':{'id':_0x501a30[_0xcfa3('0x4d')]['id']}})['then'](handleEntityNotFound(_0x495e84,null))[_0xcfa3('0x2a')](removeEntity(_0x495e84,null))[_0xcfa3('0x4b')](handleError(_0x495e84,null));};function widgetAttributes(_0x35963a){try{switch(_0x35963a[_0xcfa3('0x36')]){case _0xcfa3('0x5e'):return[{'name':_0xcfa3('0x5f'),'value':_0x35963a['attrUrl']||(_0x35963a['attrs']&&_0x35963a[_0xcfa3('0x60')][0x0]?_0x35963a[_0xcfa3('0x60')][0x0][_0xcfa3('0x61')]:undefined)||_0xcfa3('0x62')}];case _0xcfa3('0x63'):return[{'name':_0xcfa3('0x64'),'value':_0x35963a[_0xcfa3('0x64')]||(_0x35963a['attrs']&&_0x35963a['attrs'][0x0]?_0x35963a['attrs'][0x0][_0xcfa3('0x61')]:undefined)||''}];case'clock':return[{'name':_0xcfa3('0x65'),'value':_0x35963a[_0xcfa3('0x65')]||(_0x35963a[_0xcfa3('0x60')]&&_0x35963a[_0xcfa3('0x60')][0x0]?_0x35963a[_0xcfa3('0x60')][0x0]['value']:undefined)||_0xcfa3('0x66')},{'name':_0xcfa3('0x67'),'value':_0x35963a[_0xcfa3('0x67')]||(_0x35963a['attrs']&&_0x35963a[_0xcfa3('0x60')][0x1]?_0x35963a[_0xcfa3('0x60')][0x1][_0xcfa3('0x61')]:undefined)||_0xcfa3('0x68')},{'name':'attrFontSize','value':_0x35963a[_0xcfa3('0x69')]||(_0x35963a[_0xcfa3('0x60')]&&_0x35963a[_0xcfa3('0x60')][0x2]?_0x35963a[_0xcfa3('0x60')][0x2][_0xcfa3('0x61')]:undefined)||0xc}];case'counter':return[{'name':_0xcfa3('0x6a'),'value':_0x35963a[_0xcfa3('0x6a')]||(_0x35963a[_0xcfa3('0x60')]&&_0x35963a[_0xcfa3('0x60')][0x0]?_0x35963a[_0xcfa3('0x60')][0x0]['value']:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x35963a[_0xcfa3('0x6b')]||(_0x35963a[_0xcfa3('0x60')]&&_0x35963a['attrs'][0x1]?_0x35963a[_0xcfa3('0x60')][0x1]['value']:undefined)||[]},{'name':_0xcfa3('0x69'),'value':_0x35963a[_0xcfa3('0x69')]||(_0x35963a[_0xcfa3('0x60')]&&_0x35963a[_0xcfa3('0x60')][0x2]?_0x35963a[_0xcfa3('0x60')][0x2][_0xcfa3('0x61')]:undefined)||0x14}];case _0xcfa3('0x6c'):case _0xcfa3('0x6d'):return[{'name':_0xcfa3('0x6e'),'value':_0x35963a[_0xcfa3('0x6e')]||(_0x35963a[_0xcfa3('0x60')]&&_0x35963a[_0xcfa3('0x60')][0x0]?_0x35963a['attrs'][0x0][_0xcfa3('0x61')]:undefined)||_0xcfa3('0x6f')},{'name':_0xcfa3('0x70'),'value':_0x35963a['attrSerie2']||(_0x35963a['attrs']&&_0x35963a[_0xcfa3('0x60')][0x1]?_0x35963a[_0xcfa3('0x60')][0x1][_0xcfa3('0x61')]:undefined)||null},{'name':_0xcfa3('0x71'),'value':_0x35963a[_0xcfa3('0x71')]||(_0x35963a[_0xcfa3('0x60')]&&_0x35963a[_0xcfa3('0x60')][0x2]?_0x35963a[_0xcfa3('0x60')][0x2]['value']:undefined)||null},{'name':_0xcfa3('0x6b'),'value':_0x35963a[_0xcfa3('0x6b')]||(_0x35963a[_0xcfa3('0x60')]&&_0x35963a['attrs'][0x3]?_0x35963a[_0xcfa3('0x60')][0x3][_0xcfa3('0x61')]:undefined)||[]}];case _0xcfa3('0x72'):return[{'name':_0xcfa3('0x73'),'type':_0x35963a[_0xcfa3('0x74')]||(_0x35963a[_0xcfa3('0x60')]&&_0x35963a[_0xcfa3('0x60')][0x0]?_0x35963a[_0xcfa3('0x60')][0x0][_0xcfa3('0x36')]:undefined)||null,'value':_0x35963a['attrReport']||(_0x35963a[_0xcfa3('0x60')]&&_0x35963a[_0xcfa3('0x60')][0x0]?_0x35963a[_0xcfa3('0x60')][0x0][_0xcfa3('0x61')]:undefined)||null},{'name':_0xcfa3('0x75'),'value':_0x35963a[_0xcfa3('0x75')]||(_0x35963a['attrs']&&_0x35963a[_0xcfa3('0x60')][0x1]?_0x35963a[_0xcfa3('0x60')][0x1][_0xcfa3('0x61')]:undefined)||0x0}];default:return[];}}catch(_0x225329){logger[_0xcfa3('0x2e')](_0xcfa3('0x76'),JSON[_0xcfa3('0x77')](_0x225329));return[];}}exports[_0xcfa3('0x78')]=function(_0x27fec9,_0x3c4f5d,_0x56b87d){if(_0x27fec9[_0xcfa3('0x50')]['id']){delete _0x27fec9[_0xcfa3('0x50')]['id'];}return db[_0xcfa3('0x46')][_0xcfa3('0x55')]({'where':{'id':_0x27fec9[_0xcfa3('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3c4f5d,null))[_0xcfa3('0x2a')](function(_0x43dce2){if(_0x43dce2){_0x27fec9[_0xcfa3('0x50')][_0xcfa3('0x79')]=_0x43dce2['id'];_0x27fec9[_0xcfa3('0x50')][_0xcfa3('0x60')]=widgetAttributes(_0x27fec9[_0xcfa3('0x50')]);return db[_0xcfa3('0x7a')][_0xcfa3('0x4f')](_0x27fec9['body']);}})[_0xcfa3('0x2a')](respondWithResult(_0x3c4f5d,null))[_0xcfa3('0x4b')](handleError(_0x3c4f5d,null));};exports[_0xcfa3('0x7b')]=function(_0x129508,_0x3ea59e,_0x2b2012){var _0x315c97={};var _0x3303ef={};var _0xe388f9;var _0xfc75fe;return db[_0xcfa3('0x46')][_0xcfa3('0x7c')]({'where':{'id':_0x129508[_0xcfa3('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3ea59e,null))[_0xcfa3('0x2a')](function(_0x18a7d8){if(_0x18a7d8){_0xe388f9=_0x18a7d8;_0x3303ef[_0xcfa3('0x3b')]=_['keys'](db[_0xcfa3('0x7a')][_0xcfa3('0x34')]);_0x3303ef[_0xcfa3('0x38')]=_[_0xcfa3('0x39')](_0x129508['query']);_0x3303ef['filters']=_[_0xcfa3('0x3a')](_0x3303ef[_0xcfa3('0x3b')],_0x3303ef[_0xcfa3('0x38')]);_0x315c97[_0xcfa3('0x3c')]=_[_0xcfa3('0x3a')](_0x3303ef[_0xcfa3('0x3b')],qs[_0xcfa3('0x3d')](_0x129508[_0xcfa3('0x38')][_0xcfa3('0x3d')]));_0x315c97[_0xcfa3('0x3c')]=_0x315c97['attributes'][_0xcfa3('0x4e')]?_0x315c97[_0xcfa3('0x3c')]:_0x3303ef[_0xcfa3('0x3b')];_0x315c97[_0xcfa3('0x7d')]=qs[_0xcfa3('0x3f')](_0x129508[_0xcfa3('0x38')][_0xcfa3('0x3f')]);_0x315c97['where']=qs['filters'](_['pick'](_0x129508['query'],_0x3303ef['filters']));if(_0x129508[_0xcfa3('0x38')][_0xcfa3('0x42')]){_0x315c97[_0xcfa3('0x40')]=_[_0xcfa3('0x43')](_0x315c97[_0xcfa3('0x40')],{'$or':_[_0xcfa3('0x33')](_0x315c97['attributes'],function(_0x3b9682){var _0x39b346={};_0x39b346[_0x3b9682]={'$like':'%'+_0x129508[_0xcfa3('0x38')]['filter']+'%'};return _0x39b346;})});}_0x315c97=_[_0xcfa3('0x43')]({},_0x315c97,_0x129508['options']);return _0xe388f9[_0xcfa3('0x7b')](_0x315c97);}})['then'](function(_0x4a4330){if(_0x4a4330){_0xfc75fe=_0x4a4330[_0xcfa3('0x4e')];if(!_0x129508['query'][_0xcfa3('0x7e')]('nolimit')){_0x315c97[_0xcfa3('0x24')]=qs[_0xcfa3('0x24')](_0x129508[_0xcfa3('0x38')][_0xcfa3('0x24')]);_0x315c97['offset']=qs['offset'](_0x129508[_0xcfa3('0x38')][_0xcfa3('0x22')]);}return _0xe388f9[_0xcfa3('0x7b')](_0x315c97);}})[_0xcfa3('0x2a')](function(_0x2780cb){if(_0x2780cb){return _0x2780cb?{'count':_0xfc75fe,'rows':_0x2780cb}:null;}})[_0xcfa3('0x2a')](respondWithResult(_0x3ea59e,null))[_0xcfa3('0x4b')](handleError(_0x3ea59e,null));}; \ No newline at end of file +var _0x6654=['fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./dashboard.socket','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','get','CustomDashboards','UserProfileResource','destroy','then','error','name','send','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','filter','Dashboard','includeAll','findAll','catch','show','params','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','clone','include','find','omit','createdAt','updatedAt','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','getItems','findOne','DashboardItem','order','nolimit','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv'];(function(_0x3d16f0,_0x5df679){var _0x88fdad=function(_0x53ee29){while(--_0x53ee29){_0x3d16f0['push'](_0x3d16f0['shift']());}};_0x88fdad(++_0x5df679);}(_0x6654,0x1e3));var _0x4665=function(_0x5d5103,_0x38fc77){_0x5d5103=_0x5d5103-0x0;var _0x2faa61=_0x6654[_0x5d5103];return _0x2faa61;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4665('0x0'));var zipdir=require(_0x4665('0x1'));var jsonpatch=require(_0x4665('0x2'));var rp=require('request-promise');var moment=require(_0x4665('0x3'));var BPromise=require(_0x4665('0x4'));var Mustache=require('mustache');var util=require(_0x4665('0x5'));var path=require(_0x4665('0x6'));var sox=require(_0x4665('0x7'));var csv=require(_0x4665('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4665('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4665('0xa'));var deskjs=require(_0x4665('0xb'));var toCsv=require(_0x4665('0x8'));var querystring=require(_0x4665('0xc'));var Papa=require(_0x4665('0xd'));var Redis=require(_0x4665('0xe'));var authService=require(_0x4665('0xf'));var qs=require(_0x4665('0x10'));var as=require(_0x4665('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4665('0x12'))('api');var utils=require(_0x4665('0x13'));var config=require(_0x4665('0x14'));var licenseUtil=require(_0x4665('0x15'));var db=require(_0x4665('0x16'))['db'];config['redis']=_[_0x4665('0x17')](config[_0x4665('0x18')],{'host':_0x4665('0x19'),'port':0x18eb});var socket=require(_0x4665('0x1a'))(new Redis(config['redis']));require(_0x4665('0x1b'))['register'](socket);function respondWithStatusCode(_0xfd20ab,_0x233d96){_0x233d96=_0x233d96||0xcc;return function(_0x12ad0e){if(_0x12ad0e){return _0xfd20ab[_0x4665('0x1c')](_0x233d96);}return _0xfd20ab['status'](_0x233d96)[_0x4665('0x1d')]();};}function respondWithResult(_0x35d594,_0x1893b0){_0x1893b0=_0x1893b0||0xc8;return function(_0x1cfc1c){if(_0x1cfc1c){return _0x35d594[_0x4665('0x1e')](_0x1893b0)[_0x4665('0x1f')](_0x1cfc1c);}};}function respondWithFilteredResult(_0x126544,_0x316eb7){return function(_0x35abe8){if(_0x35abe8){var _0x298be7=typeof _0x316eb7[_0x4665('0x20')]==='undefined'&&typeof _0x316eb7[_0x4665('0x21')]===_0x4665('0x22');var _0x58dfc5=_0x35abe8[_0x4665('0x23')];var _0x48851f=_0x298be7?0x0:_0x316eb7['offset'];var _0x18aec6=_0x298be7?_0x35abe8[_0x4665('0x23')]:_0x316eb7[_0x4665('0x20')]+_0x316eb7[_0x4665('0x21')];var _0x493e89;if(_0x18aec6>=_0x58dfc5){_0x18aec6=_0x58dfc5;_0x493e89=0xc8;}else{_0x493e89=0xce;}_0x126544[_0x4665('0x1e')](_0x493e89);return _0x126544[_0x4665('0x24')](_0x4665('0x25'),_0x48851f+'-'+_0x18aec6+'/'+_0x58dfc5)[_0x4665('0x1f')](_0x35abe8);}return null;};}function patchUpdates(_0x2acffc){return function(_0x26658c){try{jsonpatch[_0x4665('0x26')](_0x26658c,_0x2acffc,!![]);}catch(_0x1c37de){return BPromise['reject'](_0x1c37de);}return _0x26658c[_0x4665('0x27')]();};}function saveUpdates(_0x1d2304,_0x5c391d){return function(_0x2f1f88){if(_0x2f1f88){return _0x2f1f88[_0x4665('0x28')](_0x1d2304)['then'](function(_0x5f1ce2){return _0x5f1ce2;});}return null;};}function removeEntity(_0x4b6b0d,_0x481e14){return function(_0x1ae2b8){if(_0x1ae2b8){return _0x1ae2b8['destroy']()['then'](function(){var _0xe5a1e2=_0x1ae2b8[_0x4665('0x29')]({'plain':!![]});var _0x307607=_0x4665('0x2a');return db[_0x4665('0x2b')][_0x4665('0x2c')]({'where':{'type':_0x307607,'resourceId':_0xe5a1e2['id']}})['then'](function(){return _0x1ae2b8;});})[_0x4665('0x2d')](function(){_0x4b6b0d[_0x4665('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bf450,_0x302a0d){return function(_0x2af6ad){if(!_0x2af6ad){_0x1bf450[_0x4665('0x1c')](0x194);}return _0x2af6ad;};}function handleError(_0x1d5547,_0x25ffe8){_0x25ffe8=_0x25ffe8||0x1f4;return function(_0x20ef2a){logger[_0x4665('0x2e')](_0x20ef2a['stack']);if(_0x20ef2a[_0x4665('0x2f')]){delete _0x20ef2a[_0x4665('0x2f')];}_0x1d5547[_0x4665('0x1e')](_0x25ffe8)[_0x4665('0x30')](_0x20ef2a);};}exports[_0x4665('0x31')]=function(_0x364688,_0x48baaf){var _0x391a5={},_0xc8d5d6={},_0x164f35={'count':0x0,'rows':[]};var _0x1eed5a=_['map'](db['Dashboard'][_0x4665('0x32')],function(_0x53f721){return{'name':_0x53f721[_0x4665('0x33')],'type':_0x53f721[_0x4665('0x34')]['key']};});_0xc8d5d6[_0x4665('0x35')]=_[_0x4665('0x36')](_0x1eed5a,_0x4665('0x2f'));_0xc8d5d6[_0x4665('0x37')]=_[_0x4665('0x38')](_0x364688[_0x4665('0x37')]);_0xc8d5d6[_0x4665('0x39')]=_[_0x4665('0x3a')](_0xc8d5d6[_0x4665('0x35')],_0xc8d5d6[_0x4665('0x37')]);_0x391a5[_0x4665('0x3b')]=_['intersection'](_0xc8d5d6[_0x4665('0x35')],qs[_0x4665('0x3c')](_0x364688[_0x4665('0x37')]['fields']));_0x391a5[_0x4665('0x3b')]=_0x391a5['attributes'][_0x4665('0x3d')]?_0x391a5[_0x4665('0x3b')]:_0xc8d5d6[_0x4665('0x35')];if(!_0x364688[_0x4665('0x37')][_0x4665('0x3e')]('nolimit')){_0x391a5[_0x4665('0x21')]=qs['limit'](_0x364688[_0x4665('0x37')]['limit']);_0x391a5[_0x4665('0x20')]=qs['offset'](_0x364688['query'][_0x4665('0x20')]);}_0x391a5['order']=qs[_0x4665('0x3f')](_0x364688[_0x4665('0x37')]['sort']);_0x391a5[_0x4665('0x40')]=qs[_0x4665('0x39')](_[_0x4665('0x41')](_0x364688['query'],_0xc8d5d6['filters']),_0x1eed5a);if(_0x364688[_0x4665('0x37')]['filter']){_0x391a5[_0x4665('0x40')]=_[_0x4665('0x42')](_0x391a5[_0x4665('0x40')],{'$or':_[_0x4665('0x36')](_0x1eed5a,function(_0x33156e){if(_0x33156e[_0x4665('0x34')]!=='VIRTUAL'){var _0x1aa609={};_0x1aa609[_0x33156e[_0x4665('0x2f')]]={'$like':'%'+_0x364688[_0x4665('0x37')][_0x4665('0x43')]+'%'};return _0x1aa609;}})});}_0x391a5=_['merge']({},_0x391a5,_0x364688['options']);var _0x488ab1={'where':_0x391a5[_0x4665('0x40')]};return db[_0x4665('0x44')][_0x4665('0x23')](_0x488ab1)['then'](function(_0x5d4052){_0x164f35['count']=_0x5d4052;if(_0x364688[_0x4665('0x37')][_0x4665('0x45')]){_0x391a5['include']=[{'all':!![]}];}return db[_0x4665('0x44')][_0x4665('0x46')](_0x391a5);})[_0x4665('0x2d')](function(_0x31d5f0){_0x164f35['rows']=_0x31d5f0;return _0x164f35;})[_0x4665('0x2d')](respondWithFilteredResult(_0x48baaf,_0x391a5))[_0x4665('0x47')](handleError(_0x48baaf,null));};exports[_0x4665('0x48')]=function(_0x236fba,_0x242994){var _0x3dbf3={'raw':![],'where':{'id':_0x236fba[_0x4665('0x49')]['id']}},_0x5360c8={};_0x5360c8['model']=_[_0x4665('0x38')](db[_0x4665('0x44')][_0x4665('0x32')]);_0x5360c8[_0x4665('0x37')]=_[_0x4665('0x38')](_0x236fba['query']);_0x5360c8[_0x4665('0x39')]=_[_0x4665('0x3a')](_0x5360c8[_0x4665('0x35')],_0x5360c8['query']);_0x3dbf3[_0x4665('0x3b')]=_['intersection'](_0x5360c8['model'],qs[_0x4665('0x3c')](_0x236fba[_0x4665('0x37')]['fields']));_0x3dbf3[_0x4665('0x3b')]=_0x3dbf3['attributes'][_0x4665('0x3d')]?_0x3dbf3['attributes']:_0x5360c8[_0x4665('0x35')];if(_0x236fba['query'][_0x4665('0x45')]){_0x3dbf3['include']=[{'all':!![]}];}_0x3dbf3=_[_0x4665('0x42')]({},_0x3dbf3,_0x236fba[_0x4665('0x4a')]);return db['Dashboard']['find'](_0x3dbf3)['then'](handleEntityNotFound(_0x242994,null))[_0x4665('0x2d')](respondWithResult(_0x242994,null))['catch'](handleError(_0x242994,null));};exports[_0x4665('0x4b')]=function(_0x11d318,_0x32f8a0){return db['Dashboard'][_0x4665('0x4b')](_0x11d318[_0x4665('0x4c')],{})[_0x4665('0x2d')](function(_0x4af210){var _0x551ac9=_0x11d318[_0x4665('0x4d')][_0x4665('0x29')]({'plain':!![]});if(!_0x551ac9)throw new Error(_0x4665('0x4e'));if(_0x551ac9[_0x4665('0x4f')]===_0x4665('0x4d')){var _0x1344f9=_0x4af210[_0x4665('0x29')]({'plain':!![]});var _0x1e7ffa=_0x4665('0x2a');return db[_0x4665('0x50')]['find']({'where':{'name':_0x1e7ffa,'userProfileId':_0x551ac9[_0x4665('0x51')]},'raw':!![]})[_0x4665('0x2d')](function(_0x15c5c4){if(_0x15c5c4&&_0x15c5c4['autoAssociation']===0x0){return db['UserProfileResource'][_0x4665('0x4b')]({'name':_0x1344f9[_0x4665('0x2f')],'resourceId':_0x1344f9['id'],'type':_0x15c5c4[_0x4665('0x2f')],'sectionId':_0x15c5c4['id']},{})[_0x4665('0x2d')](function(){return _0x4af210;});}else{return _0x4af210;}})[_0x4665('0x47')](function(_0x494a38){logger[_0x4665('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x494a38);throw _0x494a38;});}return _0x4af210;})['then'](respondWithResult(_0x32f8a0,0xc9))['catch'](handleError(_0x32f8a0,null));};exports[_0x4665('0x52')]=function(_0x35f051,_0x65b317){var _0x5286e1={'where':{'id':_0x35f051['params']['id']}},_0x54910a={};_0x54910a['model']=_[_0x4665('0x38')](db[_0x4665('0x44')][_0x4665('0x32')]);_0x5286e1['attributes']=_['intersection'](_0x54910a[_0x4665('0x35')],qs[_0x4665('0x3c')](_0x35f051[_0x4665('0x37')][_0x4665('0x3c')]));_0x5286e1[_0x4665('0x3b')]=_0x5286e1['attributes'][_0x4665('0x3d')]?_0x5286e1[_0x4665('0x3b')]:_0x54910a[_0x4665('0x35')];if(_0x35f051[_0x4665('0x37')][_0x4665('0x45')]){_0x5286e1[_0x4665('0x53')]=[{'all':!![]}];}_0x5286e1=_[_0x4665('0x42')]({},_0x5286e1,_0x35f051['options']);return db['Dashboard'][_0x4665('0x54')](_0x5286e1)[_0x4665('0x2d')](handleEntityNotFound(_0x65b317,null))[_0x4665('0x2d')](function(_0x5de22a){if(_0x5de22a){var _0x41dc16=_0x5de22a[_0x4665('0x29')]({'plain':!![]});_0x41dc16=qs[_0x4665('0x55')](_0x41dc16,['id',_0x4665('0x56'),_0x4665('0x57')]);_0x35f051['body']=_[_0x4665('0x55')](_0x35f051[_0x4665('0x4c')],['id','createdAt','updatedAt']);return db[_0x4665('0x44')]['create'](_[_0x4665('0x42')](_0x41dc16,_0x35f051[_0x4665('0x4c')]),{'include':_0x35f051[_0x4665('0x37')][_0x4665('0x45')]?[{'all':!![]}]:undefined})['then'](function(_0x2ee2eb){var _0x494bc8=_0x35f051[_0x4665('0x4d')][_0x4665('0x29')]({'plain':!![]});if(!_0x494bc8)throw new Error(_0x4665('0x4e'));if(_0x494bc8[_0x4665('0x4f')]===_0x4665('0x4d')){var _0xd116d8=_0x2ee2eb[_0x4665('0x29')]({'plain':!![]});var _0x1fdfc5=_0x4665('0x2a');return db['UserProfileSection'][_0x4665('0x54')]({'where':{'name':_0x1fdfc5,'userProfileId':_0x494bc8[_0x4665('0x51')]},'raw':!![]})['then'](function(_0x5a609c){if(_0x5a609c&&_0x5a609c[_0x4665('0x58')]===0x0){return db[_0x4665('0x2b')][_0x4665('0x4b')]({'name':_0xd116d8[_0x4665('0x2f')],'resourceId':_0xd116d8['id'],'type':_0x5a609c[_0x4665('0x2f')],'sectionId':_0x5a609c['id']},{})[_0x4665('0x2d')](function(){return _0x2ee2eb;});}else{return _0x2ee2eb;}})[_0x4665('0x47')](function(_0x4f0323){logger[_0x4665('0x2e')](_0x4665('0x59'),_0x4f0323);throw _0x4f0323;});}return _0x2ee2eb;});}})['then'](respondWithResult(_0x65b317,0xc9))[_0x4665('0x47')](handleError(_0x65b317,null));};exports[_0x4665('0x28')]=function(_0x257427,_0x7787eb){if(_0x257427[_0x4665('0x4c')]['id']){delete _0x257427[_0x4665('0x4c')]['id'];}return db[_0x4665('0x44')]['find']({'where':{'id':_0x257427['params']['id']}})[_0x4665('0x2d')](handleEntityNotFound(_0x7787eb,null))['then'](saveUpdates(_0x257427[_0x4665('0x4c')],null))[_0x4665('0x2d')](respondWithResult(_0x7787eb,null))[_0x4665('0x47')](handleError(_0x7787eb,null));};exports['destroy']=function(_0x48c26c,_0x29d410){return db[_0x4665('0x44')][_0x4665('0x54')]({'where':{'id':_0x48c26c[_0x4665('0x49')]['id']}})[_0x4665('0x2d')](handleEntityNotFound(_0x29d410,null))[_0x4665('0x2d')](removeEntity(_0x29d410,null))[_0x4665('0x47')](handleError(_0x29d410,null));};function widgetAttributes(_0x4bf490){try{switch(_0x4bf490['type']){case _0x4665('0x5a'):return[{'name':_0x4665('0x5b'),'value':_0x4bf490[_0x4665('0x5b')]||(_0x4bf490['attrs']&&_0x4bf490[_0x4665('0x5c')][0x0]?_0x4bf490[_0x4665('0x5c')][0x0][_0x4665('0x5d')]:undefined)||_0x4665('0x5e')}];case _0x4665('0x5f'):return[{'name':_0x4665('0x60'),'value':_0x4bf490[_0x4665('0x60')]||(_0x4bf490[_0x4665('0x5c')]&&_0x4bf490[_0x4665('0x5c')][0x0]?_0x4bf490[_0x4665('0x5c')][0x0][_0x4665('0x5d')]:undefined)||''}];case _0x4665('0x61'):return[{'name':_0x4665('0x62'),'value':_0x4bf490[_0x4665('0x62')]||(_0x4bf490[_0x4665('0x5c')]&&_0x4bf490[_0x4665('0x5c')][0x0]?_0x4bf490[_0x4665('0x5c')][0x0][_0x4665('0x5d')]:undefined)||_0x4665('0x63')},{'name':_0x4665('0x64'),'value':_0x4bf490[_0x4665('0x64')]||(_0x4bf490[_0x4665('0x5c')]&&_0x4bf490[_0x4665('0x5c')][0x1]?_0x4bf490[_0x4665('0x5c')][0x1]['value']:undefined)||_0x4665('0x65')},{'name':_0x4665('0x66'),'value':_0x4bf490[_0x4665('0x66')]||(_0x4bf490[_0x4665('0x5c')]&&_0x4bf490[_0x4665('0x5c')][0x2]?_0x4bf490['attrs'][0x2][_0x4665('0x5d')]:undefined)||0xc}];case _0x4665('0x67'):return[{'name':_0x4665('0x68'),'value':_0x4bf490[_0x4665('0x68')]||(_0x4bf490['attrs']&&_0x4bf490[_0x4665('0x5c')][0x0]?_0x4bf490['attrs'][0x0][_0x4665('0x5d')]:undefined)||_0x4665('0x69')},{'name':_0x4665('0x6a'),'value':_0x4bf490[_0x4665('0x6a')]||(_0x4bf490['attrs']&&_0x4bf490[_0x4665('0x5c')][0x1]?_0x4bf490['attrs'][0x1]['value']:undefined)||[]},{'name':_0x4665('0x66'),'value':_0x4bf490[_0x4665('0x66')]||(_0x4bf490[_0x4665('0x5c')]&&_0x4bf490['attrs'][0x2]?_0x4bf490[_0x4665('0x5c')][0x2]['value']:undefined)||0x14}];case _0x4665('0x6b'):case'pie-chart':return[{'name':_0x4665('0x6c'),'value':_0x4bf490[_0x4665('0x6c')]||(_0x4bf490[_0x4665('0x5c')]&&_0x4bf490['attrs'][0x0]?_0x4bf490['attrs'][0x0]['value']:undefined)||_0x4665('0x69')},{'name':_0x4665('0x6d'),'value':_0x4bf490[_0x4665('0x6d')]||(_0x4bf490['attrs']&&_0x4bf490['attrs'][0x1]?_0x4bf490['attrs'][0x1][_0x4665('0x5d')]:undefined)||null},{'name':'attrSerie3','value':_0x4bf490[_0x4665('0x6e')]||(_0x4bf490['attrs']&&_0x4bf490[_0x4665('0x5c')][0x2]?_0x4bf490[_0x4665('0x5c')][0x2]['value']:undefined)||null},{'name':_0x4665('0x6a'),'value':_0x4bf490[_0x4665('0x6a')]||(_0x4bf490[_0x4665('0x5c')]&&_0x4bf490[_0x4665('0x5c')][0x3]?_0x4bf490[_0x4665('0x5c')][0x3][_0x4665('0x5d')]:undefined)||[]}];case _0x4665('0x6f'):return[{'name':'attrReport','type':_0x4bf490['reportType']||(_0x4bf490[_0x4665('0x5c')]&&_0x4bf490['attrs'][0x0]?_0x4bf490[_0x4665('0x5c')][0x0][_0x4665('0x34')]:undefined)||null,'value':_0x4bf490[_0x4665('0x70')]||(_0x4bf490['attrs']&&_0x4bf490[_0x4665('0x5c')][0x0]?_0x4bf490[_0x4665('0x5c')][0x0][_0x4665('0x5d')]:undefined)||null},{'name':_0x4665('0x71'),'value':_0x4bf490[_0x4665('0x71')]||(_0x4bf490[_0x4665('0x5c')]&&_0x4bf490['attrs'][0x1]?_0x4bf490[_0x4665('0x5c')][0x1][_0x4665('0x5d')]:undefined)||0x0}];default:return[];}}catch(_0x2ea91a){logger[_0x4665('0x2e')](_0x4665('0x72'),JSON[_0x4665('0x73')](_0x2ea91a));return[];}}exports[_0x4665('0x74')]=function(_0x55a794,_0x25f4c6,_0x552682){if(_0x55a794[_0x4665('0x4c')]['id']){delete _0x55a794['body']['id'];}return db[_0x4665('0x44')][_0x4665('0x54')]({'where':{'id':_0x55a794['params']['id']}})[_0x4665('0x2d')](handleEntityNotFound(_0x25f4c6,null))['then'](function(_0x44975f){if(_0x44975f){_0x55a794[_0x4665('0x4c')][_0x4665('0x75')]=_0x44975f['id'];_0x55a794[_0x4665('0x4c')][_0x4665('0x5c')]=widgetAttributes(_0x55a794[_0x4665('0x4c')]);return db['DashboardItem'][_0x4665('0x4b')](_0x55a794['body']);}})[_0x4665('0x2d')](respondWithResult(_0x25f4c6,null))[_0x4665('0x47')](handleError(_0x25f4c6,null));};exports[_0x4665('0x76')]=function(_0x373271,_0x1f8061,_0x362f24){var _0x33e450={};var _0x3a6c71={};var _0x36b17e;var _0x4f8c1d;return db[_0x4665('0x44')][_0x4665('0x77')]({'where':{'id':_0x373271[_0x4665('0x49')]['id']}})[_0x4665('0x2d')](handleEntityNotFound(_0x1f8061,null))[_0x4665('0x2d')](function(_0x4c551a){if(_0x4c551a){_0x36b17e=_0x4c551a;_0x3a6c71['model']=_['keys'](db[_0x4665('0x78')][_0x4665('0x32')]);_0x3a6c71[_0x4665('0x37')]=_[_0x4665('0x38')](_0x373271[_0x4665('0x37')]);_0x3a6c71['filters']=_[_0x4665('0x3a')](_0x3a6c71[_0x4665('0x35')],_0x3a6c71['query']);_0x33e450[_0x4665('0x3b')]=_[_0x4665('0x3a')](_0x3a6c71['model'],qs[_0x4665('0x3c')](_0x373271['query'][_0x4665('0x3c')]));_0x33e450['attributes']=_0x33e450[_0x4665('0x3b')][_0x4665('0x3d')]?_0x33e450['attributes']:_0x3a6c71[_0x4665('0x35')];_0x33e450[_0x4665('0x79')]=qs[_0x4665('0x3f')](_0x373271[_0x4665('0x37')][_0x4665('0x3f')]);_0x33e450[_0x4665('0x40')]=qs[_0x4665('0x39')](_[_0x4665('0x41')](_0x373271['query'],_0x3a6c71[_0x4665('0x39')]));if(_0x373271[_0x4665('0x37')]['filter']){_0x33e450[_0x4665('0x40')]=_[_0x4665('0x42')](_0x33e450[_0x4665('0x40')],{'$or':_['map'](_0x33e450[_0x4665('0x3b')],function(_0x915b35){var _0x34fca2={};_0x34fca2[_0x915b35]={'$like':'%'+_0x373271[_0x4665('0x37')]['filter']+'%'};return _0x34fca2;})});}_0x33e450=_[_0x4665('0x42')]({},_0x33e450,_0x373271[_0x4665('0x4a')]);return _0x36b17e['getItems'](_0x33e450);}})['then'](function(_0x555c1e){if(_0x555c1e){_0x4f8c1d=_0x555c1e[_0x4665('0x3d')];if(!_0x373271[_0x4665('0x37')][_0x4665('0x3e')](_0x4665('0x7a'))){_0x33e450[_0x4665('0x21')]=qs[_0x4665('0x21')](_0x373271[_0x4665('0x37')]['limit']);_0x33e450[_0x4665('0x20')]=qs[_0x4665('0x20')](_0x373271[_0x4665('0x37')][_0x4665('0x20')]);}return _0x36b17e[_0x4665('0x76')](_0x33e450);}})[_0x4665('0x2d')](function(_0x5b9ea9){if(_0x5b9ea9){return _0x5b9ea9?{'count':_0x4f8c1d,'rows':_0x5b9ea9}:null;}})[_0x4665('0x2d')](respondWithResult(_0x1f8061,null))['catch'](handleError(_0x1f8061,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index dd4cdc4..54bab7b 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 _0xcf2e=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','Dashboard'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xcf2e,0x197));var _0xecf2=function(_0x480fc2,_0x482fba){_0x480fc2=_0x480fc2-0x0;var _0x540a95=_0xcf2e[_0x480fc2];return _0x540a95;};'use strict';var EventEmitter=require(_0xecf2('0x0'));var Dashboard=require(_0xecf2('0x1'))['db'][_0xecf2('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xecf2('0x3')](0x0);var events={'afterCreate':_0xecf2('0x4'),'afterUpdate':_0xecf2('0x5'),'afterDestroy':_0xecf2('0x6')};function emitEvent(_0x26b249){return function(_0x4306cc,_0x57f63f,_0x14a022){DashboardEvents[_0xecf2('0x7')](_0x26b249+':'+_0x4306cc['id'],_0x4306cc);DashboardEvents[_0xecf2('0x7')](_0x26b249,_0x4306cc);_0x14a022(null);};}for(var e in events){if(events[_0xecf2('0x8')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0xecf2('0x9')]=DashboardEvents; \ No newline at end of file +var _0x3e24=['../../mysqldb','Dashboard','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x34332d,_0x3bfcb7){var _0x8b9b43=function(_0x37a1c0){while(--_0x37a1c0){_0x34332d['push'](_0x34332d['shift']());}};_0x8b9b43(++_0x3bfcb7);}(_0x3e24,0x167));var _0x43e2=function(_0x4b3afb,_0x3647a8){_0x4b3afb=_0x4b3afb-0x0;var _0xbd2892=_0x3e24[_0x4b3afb];return _0xbd2892;};'use strict';var EventEmitter=require(_0x43e2('0x0'));var Dashboard=require(_0x43e2('0x1'))['db'][_0x43e2('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x43e2('0x3')](0x0);var events={'afterCreate':_0x43e2('0x4'),'afterUpdate':'update','afterDestroy':_0x43e2('0x5')};function emitEvent(_0x1ff04b){return function(_0x5d2806,_0x1dd127,_0x18629c){DashboardEvents[_0x43e2('0x6')](_0x1ff04b+':'+_0x5d2806['id'],_0x5d2806);DashboardEvents[_0x43e2('0x6')](_0x1ff04b,_0x5d2806);_0x18629c(null);};}for(var e in events){if(events[_0x43e2('0x7')](e)){var event=events[e];Dashboard[_0x43e2('0x8')](e,emitEvent(event));}}module[_0x43e2('0x9')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index da8003a..3494416 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 _0xdfe7=['util','api','request-promise','rimraf','./dashboard.attributes','define','dashboards'];(function(_0x1a2dc7,_0x12e86){var _0xa987c7=function(_0x26b086){while(--_0x26b086){_0x1a2dc7['push'](_0x1a2dc7['shift']());}};_0xa987c7(++_0x12e86);}(_0xdfe7,0x196));var _0x7dfe=function(_0x4ec6bf,_0x3a21b0){_0x4ec6bf=_0x4ec6bf-0x0;var _0x5042f4=_0xdfe7[_0x4ec6bf];return _0x5042f4;};'use strict';var _=require('lodash');var util=require(_0x7dfe('0x0'));var logger=require('../../config/logger')(_0x7dfe('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7dfe('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7dfe('0x3'));var config=require('../../config/environment');var attributes=require(_0x7dfe('0x4'));module['exports']=function(_0x38f051,_0x215721){return _0x38f051[_0x7dfe('0x5')]('Dashboard',attributes,{'tableName':_0x7dfe('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6d23=['util','../../config/logger','moment','path','rimraf','../../config/environment','./dashboard.attributes','exports','define','Dashboard','dashboards','lodash'];(function(_0x4fa5c0,_0x34e425){var _0x81da33=function(_0x26502e){while(--_0x26502e){_0x4fa5c0['push'](_0x4fa5c0['shift']());}};_0x81da33(++_0x34e425);}(_0x6d23,0x14f));var _0x36d2=function(_0x243af5,_0xa25ed9){_0x243af5=_0x243af5-0x0;var _0x508826=_0x6d23[_0x243af5];return _0x508826;};'use strict';var _=require(_0x36d2('0x0'));var util=require(_0x36d2('0x1'));var logger=require(_0x36d2('0x2'))('api');var moment=require(_0x36d2('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x36d2('0x4'));var rimraf=require(_0x36d2('0x5'));var config=require(_0x36d2('0x6'));var attributes=require(_0x36d2('0x7'));module[_0x36d2('0x8')]=function(_0x2e5975,_0x4ce629){return _0x2e5975[_0x36d2('0x9')](_0x36d2('0xa'),attributes,{'tableName':_0x36d2('0xb'),'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 de811a9..13bf11f 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 _0x1f36=['error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./dashboard.socket','then','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x18acae,_0x4ec66d){var _0x21a992=function(_0x391cb3){while(--_0x391cb3){_0x18acae['push'](_0x18acae['shift']());}};_0x21a992(++_0x4ec66d);}(_0x1f36,0x72));var _0x61f3=function(_0x107f10,_0x5529f2){_0x107f10=_0x107f10-0x0;var _0x811cab=_0x1f36[_0x107f10];return _0x811cab;};'use strict';var _=require(_0x61f3('0x0'));var util=require('util');var moment=require(_0x61f3('0x1'));var BPromise=require(_0x61f3('0x2'));var rs=require(_0x61f3('0x3'));var fs=require('fs');var Redis=require(_0x61f3('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x61f3('0x5'))(_0x61f3('0x6'));var config=require(_0x61f3('0x7'));var jayson=require(_0x61f3('0x8'));var client=jayson[_0x61f3('0x9')]['http']({'port':0x232a});config['redis']=_[_0x61f3('0xa')](config[_0x61f3('0xb')],{'host':_0x61f3('0xc'),'port':0x18eb});var socket=require(_0x61f3('0xd'))(new Redis(config[_0x61f3('0xb')]));require(_0x61f3('0xe'))['register'](socket);function respondWithRpcPromise(_0x159f12,_0x58bbbe,_0x296225){return new BPromise(function(_0x3ff339,_0x5a764f){return client['request'](_0x159f12,_0x296225)[_0x61f3('0xf')](function(_0x238149){logger['info'](_0x61f3('0x10'),_0x58bbbe,_0x61f3('0x11'));logger[_0x61f3('0x12')](_0x61f3('0x13'),_0x58bbbe,_0x61f3('0x11'),JSON[_0x61f3('0x14')](_0x238149));if(_0x238149[_0x61f3('0x15')]){if(_0x238149[_0x61f3('0x15')][_0x61f3('0x16')]===0x1f4){logger['error'](_0x61f3('0x10'),_0x58bbbe,_0x238149['error'][_0x61f3('0x17')]);return _0x5a764f(_0x238149[_0x61f3('0x15')]['message']);}logger[_0x61f3('0x15')](_0x61f3('0x10'),_0x58bbbe,_0x238149[_0x61f3('0x15')][_0x61f3('0x17')]);return _0x3ff339(_0x238149[_0x61f3('0x15')][_0x61f3('0x17')]);}else{logger[_0x61f3('0x18')]('Dashboard,\x20%s,\x20%s',_0x58bbbe,_0x61f3('0x11'));_0x3ff339(_0x238149[_0x61f3('0x19')]['message']);}})[_0x61f3('0x1a')](function(_0x4895af){logger[_0x61f3('0x15')](_0x61f3('0x10'),_0x58bbbe,_0x4895af);_0x5a764f(_0x4895af);});});} \ No newline at end of file +var _0x3a08=['Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','Dashboard,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','then','request\x20sent','debug'];(function(_0x19f866,_0xf68c27){var _0x59bf91=function(_0x315b27){while(--_0x315b27){_0x19f866['push'](_0x19f866['shift']());}};_0x59bf91(++_0xf68c27);}(_0x3a08,0x131));var _0x83a0=function(_0x1256cf,_0x359628){_0x1256cf=_0x1256cf-0x0;var _0x1d16b7=_0x3a08[_0x1256cf];return _0x1d16b7;};'use strict';var _=require(_0x83a0('0x0'));var util=require('util');var moment=require(_0x83a0('0x1'));var BPromise=require(_0x83a0('0x2'));var rs=require(_0x83a0('0x3'));var fs=require('fs');var Redis=require(_0x83a0('0x4'));var db=require(_0x83a0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x83a0('0x6'))('rpc');var config=require(_0x83a0('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x83a0('0x8')]({'port':0x232a});config[_0x83a0('0x9')]=_[_0x83a0('0xa')](config[_0x83a0('0x9')],{'host':_0x83a0('0xb'),'port':0x18eb});var socket=require(_0x83a0('0xc'))(new Redis(config[_0x83a0('0x9')]));require(_0x83a0('0xd'))[_0x83a0('0xe')](socket);function respondWithRpcPromise(_0x26d031,_0x3bfd7b,_0x2c0739){return new BPromise(function(_0x2c1ac4,_0x338313){return client[_0x83a0('0xf')](_0x26d031,_0x2c0739)[_0x83a0('0x10')](function(_0x2883e9){logger['info']('Dashboard,\x20%s,\x20%s',_0x3bfd7b,_0x83a0('0x11'));logger[_0x83a0('0x12')](_0x83a0('0x13'),_0x3bfd7b,_0x83a0('0x11'),JSON[_0x83a0('0x14')](_0x2883e9));if(_0x2883e9[_0x83a0('0x15')]){if(_0x2883e9[_0x83a0('0x15')]['code']===0x1f4){logger[_0x83a0('0x15')](_0x83a0('0x16'),_0x3bfd7b,_0x2883e9[_0x83a0('0x15')]['message']);return _0x338313(_0x2883e9[_0x83a0('0x15')]['message']);}logger['error'](_0x83a0('0x16'),_0x3bfd7b,_0x2883e9['error'][_0x83a0('0x17')]);return _0x2c1ac4(_0x2883e9[_0x83a0('0x15')]['message']);}else{logger[_0x83a0('0x18')](_0x83a0('0x16'),_0x3bfd7b,'request\x20sent');_0x2c1ac4(_0x2883e9[_0x83a0('0x19')][_0x83a0('0x17')]);}})[_0x83a0('0x1a')](function(_0x1642ae){logger[_0x83a0('0x15')](_0x83a0('0x16'),_0x3bfd7b,_0x1642ae);_0x338313(_0x1642ae);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 158d0ef..6b69e75 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 _0xaa89=['emit','removeListener','register','length','dashboard:','./dashboard.events','remove','update'];(function(_0x1ac6e5,_0x40f47f){var _0x5877dc=function(_0x99caea){while(--_0x99caea){_0x1ac6e5['push'](_0x1ac6e5['shift']());}};_0x5877dc(++_0x40f47f);}(_0xaa89,0x125));var _0x9aa8=function(_0x55e1d1,_0x3c9376){_0x55e1d1=_0x55e1d1-0x0;var _0x1165db=_0xaa89[_0x55e1d1];return _0x1165db;};'use strict';var DashboardEvents=require(_0x9aa8('0x0'));var events=['save',_0x9aa8('0x1'),_0x9aa8('0x2')];function createListener(_0x354834,_0x38353b){return function(_0x5e2033){_0x38353b[_0x9aa8('0x3')](_0x354834,_0x5e2033);};}function removeListener(_0x330665,_0x4fe08a){return function(){DashboardEvents[_0x9aa8('0x4')](_0x330665,_0x4fe08a);};}exports[_0x9aa8('0x5')]=function(_0x3c2b4b){for(var _0x2fa6ed=0x0,_0x298a96=events[_0x9aa8('0x6')];_0x2fa6ed<_0x298a96;_0x2fa6ed++){var _0x2a8fcc=events[_0x2fa6ed];var _0x110acc=createListener(_0x9aa8('0x7')+_0x2a8fcc,_0x3c2b4b);DashboardEvents['on'](_0x2a8fcc,_0x110acc);}}; \ No newline at end of file +var _0x7398=['removeListener','register','length','remove','emit'];(function(_0x1bef5b,_0x272aa4){var _0x3358ad=function(_0x2ad8e6){while(--_0x2ad8e6){_0x1bef5b['push'](_0x1bef5b['shift']());}};_0x3358ad(++_0x272aa4);}(_0x7398,0xd5));var _0x8739=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x7398[_0x4f9b18];return _0x29f20c;};'use strict';var DashboardEvents=require('./dashboard.events');var events=['save',_0x8739('0x0'),'update'];function createListener(_0x13d8c5,_0x1b97e4){return function(_0x3d14c4){_0x1b97e4[_0x8739('0x1')](_0x13d8c5,_0x3d14c4);};}function removeListener(_0x50c54f,_0x3da8e2){return function(){DashboardEvents[_0x8739('0x2')](_0x50c54f,_0x3da8e2);};}exports[_0x8739('0x3')]=function(_0x40c6c2){for(var _0x551acf=0x0,_0x22ec91=events[_0x8739('0x4')];_0x551acf<_0x22ec91;_0x551acf++){var _0x242e3b=events[_0x551acf];var _0x1fbda1=createListener('dashboard:'+_0x242e3b,_0x40c6c2);DashboardEvents['on'](_0x242e3b,_0x1fbda1);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 719ca7e..fa6b4bc 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 _0xc8de=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','index','get','/:id','isAuthenticated','show','/:id/items','post','/:id/clone','clone','addItem','put','update','delete','destroy','exports','multer'];(function(_0x152136,_0x4f14f1){var _0x20df44=function(_0x362877){while(--_0x362877){_0x152136['push'](_0x152136['shift']());}};_0x20df44(++_0x4f14f1);}(_0xc8de,0x1df));var _0xec8d=function(_0x29e745,_0xdfe5cc){_0x29e745=_0x29e745-0x0;var _0x48b36b=_0xc8de[_0x29e745];return _0x48b36b;};'use strict';var multer=require(_0xec8d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xec8d('0x1'));var express=require(_0xec8d('0x2'));var router=express[_0xec8d('0x3')]();var fs_extra=require(_0xec8d('0x4'));var auth=require(_0xec8d('0x5'));var interaction=require(_0xec8d('0x6'));var config=require(_0xec8d('0x7'));var controller=require(_0xec8d('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xec8d('0x9')]);router[_0xec8d('0xa')](_0xec8d('0xb'),auth[_0xec8d('0xc')](),controller[_0xec8d('0xd')]);router[_0xec8d('0xa')](_0xec8d('0xe'),auth['isAuthenticated'](),controller['getItems']);router[_0xec8d('0xf')]('/',auth[_0xec8d('0xc')](),controller['create']);router[_0xec8d('0xf')](_0xec8d('0x10'),auth[_0xec8d('0xc')](),controller[_0xec8d('0x11')]);router['post'](_0xec8d('0xe'),auth['isAuthenticated'](),controller[_0xec8d('0x12')]);router[_0xec8d('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xec8d('0x14')]);router[_0xec8d('0x15')](_0xec8d('0xb'),auth['isAuthenticated'](),controller[_0xec8d('0x16')]);module[_0xec8d('0x17')]=router; \ No newline at end of file +var _0x2ffc=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/items','getItems','post','create','/:id/clone','clone','put','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3f23f8,_0x2aadcd){var _0x22edc3=function(_0x37e358){while(--_0x37e358){_0x3f23f8['push'](_0x3f23f8['shift']());}};_0x22edc3(++_0x2aadcd);}(_0x2ffc,0x12e));var _0xc2ff=function(_0x4edb41,_0x15436a){_0x4edb41=_0x4edb41-0x0;var _0x2ffc8e=_0x2ffc[_0x4edb41];return _0x2ffc8e;};'use strict';var multer=require(_0xc2ff('0x0'));var util=require('util');var path=require(_0xc2ff('0x1'));var timeout=require('connect-timeout');var express=require(_0xc2ff('0x2'));var router=express[_0xc2ff('0x3')]();var fs_extra=require(_0xc2ff('0x4'));var auth=require(_0xc2ff('0x5'));var interaction=require(_0xc2ff('0x6'));var config=require(_0xc2ff('0x7'));var controller=require('./dashboard.controller');router[_0xc2ff('0x8')]('/',auth[_0xc2ff('0x9')](),controller[_0xc2ff('0xa')]);router['get'](_0xc2ff('0xb'),auth[_0xc2ff('0x9')](),controller[_0xc2ff('0xc')]);router['get'](_0xc2ff('0xd'),auth[_0xc2ff('0x9')](),controller[_0xc2ff('0xe')]);router[_0xc2ff('0xf')]('/',auth[_0xc2ff('0x9')](),controller[_0xc2ff('0x10')]);router[_0xc2ff('0xf')](_0xc2ff('0x11'),auth['isAuthenticated'](),controller[_0xc2ff('0x12')]);router['post']('/:id/items',auth['isAuthenticated'](),controller['addItem']);router[_0xc2ff('0x13')](_0xc2ff('0xb'),auth[_0xc2ff('0x9')](),controller['update']);router[_0xc2ff('0x14')](_0xc2ff('0xb'),auth['isAuthenticated'](),controller[_0xc2ff('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index a476f25..5afb88c 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 _0xafc4=['TEXT','long','setDataValue','attrs','stringify','INTEGER','sequelize','lodash','STRING'];(function(_0x119a85,_0x5e4cb0){var _0xc9e72b=function(_0x2858c3){while(--_0x2858c3){_0x119a85['push'](_0x119a85['shift']());}};_0xc9e72b(++_0x5e4cb0);}(_0xafc4,0x69));var _0x4afc=function(_0x26ed07,_0xcca240){_0x26ed07=_0x26ed07-0x0;var _0x41db35=_0xafc4[_0x26ed07];return _0x41db35;};'use strict';var Sequelize=require(_0x4afc('0x0'));var squel=require('squel');var _=require(_0x4afc('0x1'));module['exports']={'title':{'type':Sequelize[_0x4afc('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4afc('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x4afc('0x3')](_0x4afc('0x4')),'get':function(){try{return JSON['parse'](this['getDataValue']('attrs'));}catch(_0x36cb50){return[];}},'set':function(_0x471d45){try{this[_0x4afc('0x5')](_0x4afc('0x6'),JSON[_0x4afc('0x7')](_0x471d45));}catch(_0xaf053d){this['setDataValue'](_0x4afc('0x6'),JSON[_0x4afc('0x7')]([]));}}},'sizeX':{'type':Sequelize[_0x4afc('0x8')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x4afc('0x8')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x4afc('0x8')]},'col':{'type':Sequelize[_0x4afc('0x8')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x4afc('0x2')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x4afc('0x2')]},'titleFontSize':{'type':Sequelize[_0x4afc('0x8')],'defaultValue':0xc}}; \ No newline at end of file +var _0x5d17=['#ffffff','sequelize','squel','STRING','TEXT','parse','getDataValue','attrs','setDataValue','stringify','INTEGER'];(function(_0x2c534a,_0x18a19e){var _0x3f5c99=function(_0x4c085f){while(--_0x4c085f){_0x2c534a['push'](_0x2c534a['shift']());}};_0x3f5c99(++_0x18a19e);}(_0x5d17,0x114));var _0x75d1=function(_0x4d3940,_0x167a82){_0x4d3940=_0x4d3940-0x0;var _0x542862=_0x5d17[_0x4d3940];return _0x542862;};'use strict';var Sequelize=require(_0x75d1('0x0'));var squel=require(_0x75d1('0x1'));var _=require('lodash');module['exports']={'title':{'type':Sequelize[_0x75d1('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x75d1('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x75d1('0x3')]('long'),'get':function(){try{return JSON[_0x75d1('0x4')](this[_0x75d1('0x5')](_0x75d1('0x6')));}catch(_0x32bd45){return[];}},'set':function(_0x56ac0a){try{this[_0x75d1('0x7')](_0x75d1('0x6'),JSON[_0x75d1('0x8')](_0x56ac0a));}catch(_0x1ee61b){this[_0x75d1('0x7')](_0x75d1('0x6'),JSON[_0x75d1('0x8')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x75d1('0x9')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x75d1('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x75d1('0x2')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x75d1('0x2')]},'titleFontSize':{'type':Sequelize[_0x75d1('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 689da10..ca0d8af 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 _0x64b3=['widgetAttributes:\x20%s','stringify','body','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','error','stack','name','send','show','params','DashboardItem','rawAttributes','keys','query','filters','intersection','model','attributes','fields','includeAll','include','merge','options','find','catch','type','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh'];(function(_0x1abaa5,_0x5e951b){var _0x453fc3=function(_0x3ae570){while(--_0x3ae570){_0x1abaa5['push'](_0x1abaa5['shift']());}};_0x453fc3(++_0x5e951b);}(_0x64b3,0x1de));var _0x364b=function(_0x416368,_0x439ad5){_0x416368=_0x416368-0x0;var _0x5c8e61=_0x64b3[_0x416368];return _0x5c8e61;};'use strict';var emlformat=require(_0x364b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x364b('0x1'));var rp=require(_0x364b('0x2'));var moment=require(_0x364b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x364b('0x4'));var util=require(_0x364b('0x5'));var path=require(_0x364b('0x6'));var sox=require(_0x364b('0x7'));var csv=require(_0x364b('0x8'));var ejs=require(_0x364b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x364b('0xa'));var crypto=require(_0x364b('0xb'));var jsforce=require(_0x364b('0xc'));var deskjs=require(_0x364b('0xd'));var toCsv=require(_0x364b('0x8'));var querystring=require(_0x364b('0xe'));var Papa=require(_0x364b('0xf'));var Redis=require(_0x364b('0x10'));var authService=require(_0x364b('0x11'));var qs=require(_0x364b('0x12'));var as=require(_0x364b('0x13'));var hardwareService=require(_0x364b('0x14'));var logger=require(_0x364b('0x15'))(_0x364b('0x16'));var utils=require(_0x364b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x364b('0x18'));var db=require(_0x364b('0x19'))['db'];config[_0x364b('0x1a')]=_[_0x364b('0x1b')](config[_0x364b('0x1a')],{'host':_0x364b('0x1c'),'port':0x18eb});var socket=require(_0x364b('0x1d'))(new Redis(config['redis']));require(_0x364b('0x1e'))[_0x364b('0x1f')](socket);function respondWithStatusCode(_0x4558c4,_0x470ee7){_0x470ee7=_0x470ee7||0xcc;return function(_0xc320ac){if(_0xc320ac){return _0x4558c4[_0x364b('0x20')](_0x470ee7);}return _0x4558c4[_0x364b('0x21')](_0x470ee7)[_0x364b('0x22')]();};}function respondWithResult(_0x1c562b,_0x4714df){_0x4714df=_0x4714df||0xc8;return function(_0x203f1c){if(_0x203f1c){return _0x1c562b[_0x364b('0x21')](_0x4714df)[_0x364b('0x23')](_0x203f1c);}};}function respondWithFilteredResult(_0x3de089,_0x1ad421){return function(_0x531a82){if(_0x531a82){var _0x4b7f12=typeof _0x1ad421[_0x364b('0x24')]===_0x364b('0x25')&&typeof _0x1ad421[_0x364b('0x26')]===_0x364b('0x25');var _0xb17e3f=_0x531a82[_0x364b('0x27')];var _0x4f338c=_0x4b7f12?0x0:_0x1ad421[_0x364b('0x24')];var _0x102f1b=_0x4b7f12?_0x531a82['count']:_0x1ad421['offset']+_0x1ad421[_0x364b('0x26')];var _0x5c6e09;if(_0x102f1b>=_0xb17e3f){_0x102f1b=_0xb17e3f;_0x5c6e09=0xc8;}else{_0x5c6e09=0xce;}_0x3de089[_0x364b('0x21')](_0x5c6e09);return _0x3de089['set'](_0x364b('0x28'),_0x4f338c+'-'+_0x102f1b+'/'+_0xb17e3f)[_0x364b('0x23')](_0x531a82);}return null;};}function patchUpdates(_0x10052c){return function(_0x21edc6){try{jsonpatch[_0x364b('0x29')](_0x21edc6,_0x10052c,!![]);}catch(_0x3c87e8){return BPromise['reject'](_0x3c87e8);}return _0x21edc6[_0x364b('0x2a')]();};}function saveUpdates(_0x45e542,_0x1a0621){return function(_0x59a4cc){if(_0x59a4cc){return _0x59a4cc[_0x364b('0x2b')](_0x45e542)[_0x364b('0x2c')](function(_0x5fa20c){return _0x5fa20c;});}return null;};}function removeEntity(_0x292f3f,_0x52820b){return function(_0x4a4c74){if(_0x4a4c74){return _0x4a4c74['destroy']()[_0x364b('0x2c')](function(){_0x292f3f[_0x364b('0x21')](0xcc)[_0x364b('0x22')]();});}};}function handleEntityNotFound(_0x3e4a52,_0x527c78){return function(_0x4ab042){if(!_0x4ab042){_0x3e4a52['sendStatus'](0x194);}return _0x4ab042;};}function handleError(_0x599d9d,_0x507b4a){_0x507b4a=_0x507b4a||0x1f4;return function(_0x16c3aa){logger[_0x364b('0x2d')](_0x16c3aa[_0x364b('0x2e')]);if(_0x16c3aa[_0x364b('0x2f')]){delete _0x16c3aa[_0x364b('0x2f')];}_0x599d9d[_0x364b('0x21')](_0x507b4a)[_0x364b('0x30')](_0x16c3aa);};}exports[_0x364b('0x31')]=function(_0x3299d3,_0x396aab){var _0x5c53bc={'raw':![],'where':{'id':_0x3299d3[_0x364b('0x32')]['id']}},_0xf5a5af={};_0xf5a5af['model']=_['keys'](db[_0x364b('0x33')][_0x364b('0x34')]);_0xf5a5af['query']=_[_0x364b('0x35')](_0x3299d3[_0x364b('0x36')]);_0xf5a5af[_0x364b('0x37')]=_[_0x364b('0x38')](_0xf5a5af[_0x364b('0x39')],_0xf5a5af[_0x364b('0x36')]);_0x5c53bc[_0x364b('0x3a')]=_[_0x364b('0x38')](_0xf5a5af[_0x364b('0x39')],qs['fields'](_0x3299d3[_0x364b('0x36')][_0x364b('0x3b')]));_0x5c53bc[_0x364b('0x3a')]=_0x5c53bc['attributes']['length']?_0x5c53bc[_0x364b('0x3a')]:_0xf5a5af[_0x364b('0x39')];if(_0x3299d3[_0x364b('0x36')][_0x364b('0x3c')]){_0x5c53bc[_0x364b('0x3d')]=[{'all':!![]}];}_0x5c53bc=_[_0x364b('0x3e')]({},_0x5c53bc,_0x3299d3[_0x364b('0x3f')]);return db[_0x364b('0x33')][_0x364b('0x40')](_0x5c53bc)[_0x364b('0x2c')](handleEntityNotFound(_0x396aab,null))['then'](respondWithResult(_0x396aab,null))['catch'](handleError(_0x396aab,null));};exports['destroy']=function(_0x1f730c,_0x4f2a4f){return db[_0x364b('0x33')]['find']({'where':{'id':_0x1f730c[_0x364b('0x32')]['id']}})[_0x364b('0x2c')](handleEntityNotFound(_0x4f2a4f,null))[_0x364b('0x2c')](removeEntity(_0x4f2a4f,null))[_0x364b('0x41')](handleError(_0x4f2a4f,null));};function widgetAttributes(_0x5713c0){try{switch(_0x5713c0[_0x364b('0x42')]){case _0x364b('0x43'):return[{'name':'attrUrl','value':_0x5713c0[_0x364b('0x44')]||(_0x5713c0[_0x364b('0x45')]&&_0x5713c0[_0x364b('0x45')][0x0]?_0x5713c0['attrs'][0x0][_0x364b('0x46')]:undefined)||_0x364b('0x47')}];case'custom':return[{'name':_0x364b('0x48'),'value':_0x5713c0[_0x364b('0x48')]||(_0x5713c0[_0x364b('0x45')]&&_0x5713c0[_0x364b('0x45')][0x0]?_0x5713c0[_0x364b('0x45')][0x0][_0x364b('0x46')]:undefined)||''}];case _0x364b('0x49'):return[{'name':_0x364b('0x4a'),'value':_0x5713c0[_0x364b('0x4a')]||(_0x5713c0[_0x364b('0x45')]&&_0x5713c0['attrs'][0x0]?_0x5713c0[_0x364b('0x45')][0x0]['value']:undefined)||_0x364b('0x4b')},{'name':_0x364b('0x4c'),'value':_0x5713c0[_0x364b('0x4c')]||(_0x5713c0[_0x364b('0x45')]&&_0x5713c0[_0x364b('0x45')][0x1]?_0x5713c0['attrs'][0x1][_0x364b('0x46')]:undefined)||_0x364b('0x4d')},{'name':_0x364b('0x4e'),'value':_0x5713c0[_0x364b('0x4e')]||(_0x5713c0[_0x364b('0x45')]&&_0x5713c0[_0x364b('0x45')][0x2]?_0x5713c0[_0x364b('0x45')][0x2][_0x364b('0x46')]:undefined)||0xc}];case _0x364b('0x4f'):return[{'name':'attrMetric','value':_0x5713c0[_0x364b('0x50')]||(_0x5713c0[_0x364b('0x45')]&&_0x5713c0[_0x364b('0x45')][0x0]?_0x5713c0[_0x364b('0x45')][0x0][_0x364b('0x46')]:undefined)||_0x364b('0x51')},{'name':_0x364b('0x52'),'value':_0x5713c0[_0x364b('0x52')]||(_0x5713c0[_0x364b('0x45')]&&_0x5713c0['attrs'][0x1]?_0x5713c0[_0x364b('0x45')][0x1][_0x364b('0x46')]:undefined)||[]},{'name':_0x364b('0x4e'),'value':_0x5713c0[_0x364b('0x4e')]||(_0x5713c0[_0x364b('0x45')]&&_0x5713c0[_0x364b('0x45')][0x2]?_0x5713c0[_0x364b('0x45')][0x2][_0x364b('0x46')]:undefined)||0x14}];case _0x364b('0x53'):case _0x364b('0x54'):return[{'name':'attrSerie1','value':_0x5713c0[_0x364b('0x55')]||(_0x5713c0[_0x364b('0x45')]&&_0x5713c0[_0x364b('0x45')][0x0]?_0x5713c0[_0x364b('0x45')][0x0][_0x364b('0x46')]:undefined)||_0x364b('0x51')},{'name':_0x364b('0x56'),'value':_0x5713c0[_0x364b('0x56')]||(_0x5713c0[_0x364b('0x45')]&&_0x5713c0[_0x364b('0x45')][0x1]?_0x5713c0[_0x364b('0x45')][0x1][_0x364b('0x46')]:undefined)||null},{'name':_0x364b('0x57'),'value':_0x5713c0['attrSerie3']||(_0x5713c0[_0x364b('0x45')]&&_0x5713c0['attrs'][0x2]?_0x5713c0[_0x364b('0x45')][0x2][_0x364b('0x46')]:undefined)||null},{'name':_0x364b('0x52'),'value':_0x5713c0[_0x364b('0x52')]||(_0x5713c0['attrs']&&_0x5713c0[_0x364b('0x45')][0x3]?_0x5713c0[_0x364b('0x45')][0x3][_0x364b('0x46')]:undefined)||[]}];case _0x364b('0x58'):return[{'name':_0x364b('0x59'),'type':_0x5713c0[_0x364b('0x5a')]||(_0x5713c0['attrs']&&_0x5713c0[_0x364b('0x45')][0x0]?_0x5713c0[_0x364b('0x45')][0x0][_0x364b('0x42')]:undefined)||null,'value':_0x5713c0['attrReport']||(_0x5713c0[_0x364b('0x45')]&&_0x5713c0[_0x364b('0x45')][0x0]?_0x5713c0[_0x364b('0x45')][0x0][_0x364b('0x46')]:undefined)||null},{'name':_0x364b('0x5b'),'value':_0x5713c0[_0x364b('0x5b')]||(_0x5713c0['attrs']&&_0x5713c0[_0x364b('0x45')][0x1]?_0x5713c0['attrs'][0x1][_0x364b('0x46')]:undefined)||0x0}];default:return[];}}catch(_0x2ea779){logger[_0x364b('0x2d')](_0x364b('0x5c'),JSON[_0x364b('0x5d')](_0x2ea779));return[];}}exports['create']=function(_0x36e333,_0x3a0f1c){if(_0x36e333['body']){_0x36e333['body'][_0x364b('0x45')]=widgetAttributes(_0x36e333['body']);}return db[_0x364b('0x33')]['create'](_0x36e333[_0x364b('0x5e')],{})['then'](respondWithResult(_0x3a0f1c,0xc9))[_0x364b('0x41')](handleError(_0x3a0f1c,null));};exports[_0x364b('0x2b')]=function(_0x13dcd2,_0x43fe7b){if(_0x13dcd2['body']['id']){delete _0x13dcd2['body']['id'];}_0x13dcd2[_0x364b('0x5e')][_0x364b('0x45')]=widgetAttributes(_0x13dcd2[_0x364b('0x5e')]);return db[_0x364b('0x33')][_0x364b('0x40')]({'where':{'id':_0x13dcd2[_0x364b('0x32')]['id']}})[_0x364b('0x2c')](handleEntityNotFound(_0x43fe7b,null))[_0x364b('0x2c')](saveUpdates(_0x13dcd2[_0x364b('0x5e')],null))[_0x364b('0x2c')](respondWithResult(_0x43fe7b,null))[_0x364b('0x41')](handleError(_0x43fe7b,null));}; \ No newline at end of file +var _0x7a30=['save','update','then','destroy','stack','name','send','show','params','keys','DashboardItem','rawAttributes','query','filters','model','attributes','length','include','options','find','catch','type','iframe','attrUrl','attrs','value','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','error','widgetAttributes:\x20%s','stringify','create','body','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','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','reject'];(function(_0x41d126,_0x38d33e){var _0x5c0b51=function(_0x31fbb7){while(--_0x31fbb7){_0x41d126['push'](_0x41d126['shift']());}};_0x5c0b51(++_0x38d33e);}(_0x7a30,0x8c));var _0x07a3=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7a30[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x07a3('0x0'));var rimraf=require(_0x07a3('0x1'));var zipdir=require(_0x07a3('0x2'));var jsonpatch=require(_0x07a3('0x3'));var rp=require(_0x07a3('0x4'));var moment=require(_0x07a3('0x5'));var BPromise=require(_0x07a3('0x6'));var Mustache=require(_0x07a3('0x7'));var util=require('util');var path=require(_0x07a3('0x8'));var sox=require(_0x07a3('0x9'));var csv=require(_0x07a3('0xa'));var ejs=require(_0x07a3('0xb'));var fs=require('fs');var fs_extra=require(_0x07a3('0xc'));var _=require(_0x07a3('0xd'));var squel=require(_0x07a3('0xe'));var crypto=require('crypto');var jsforce=require(_0x07a3('0xf'));var deskjs=require(_0x07a3('0x10'));var toCsv=require('to-csv');var querystring=require(_0x07a3('0x11'));var Papa=require(_0x07a3('0x12'));var Redis=require('ioredis');var authService=require(_0x07a3('0x13'));var qs=require(_0x07a3('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x07a3('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x07a3('0x16'));var config=require(_0x07a3('0x17'));var licenseUtil=require(_0x07a3('0x18'));var db=require(_0x07a3('0x19'))['db'];config['redis']=_[_0x07a3('0x1a')](config[_0x07a3('0x1b')],{'host':_0x07a3('0x1c'),'port':0x18eb});var socket=require(_0x07a3('0x1d'))(new Redis(config[_0x07a3('0x1b')]));require('./dashboardItem.socket')[_0x07a3('0x1e')](socket);function respondWithStatusCode(_0x430f9a,_0x2c11a8){_0x2c11a8=_0x2c11a8||0xcc;return function(_0x36ec6b){if(_0x36ec6b){return _0x430f9a[_0x07a3('0x1f')](_0x2c11a8);}return _0x430f9a[_0x07a3('0x20')](_0x2c11a8)[_0x07a3('0x21')]();};}function respondWithResult(_0x254710,_0x394729){_0x394729=_0x394729||0xc8;return function(_0x1718fb){if(_0x1718fb){return _0x254710[_0x07a3('0x20')](_0x394729)['json'](_0x1718fb);}};}function respondWithFilteredResult(_0x7dc732,_0x1dbdd2){return function(_0x46a8b8){if(_0x46a8b8){var _0x5d8352=typeof _0x1dbdd2[_0x07a3('0x22')]==='undefined'&&typeof _0x1dbdd2[_0x07a3('0x23')]===_0x07a3('0x24');var _0x1c4db9=_0x46a8b8[_0x07a3('0x25')];var _0x5968c5=_0x5d8352?0x0:_0x1dbdd2[_0x07a3('0x22')];var _0x3bba04=_0x5d8352?_0x46a8b8[_0x07a3('0x25')]:_0x1dbdd2[_0x07a3('0x22')]+_0x1dbdd2[_0x07a3('0x23')];var _0xd7ac84;if(_0x3bba04>=_0x1c4db9){_0x3bba04=_0x1c4db9;_0xd7ac84=0xc8;}else{_0xd7ac84=0xce;}_0x7dc732[_0x07a3('0x20')](_0xd7ac84);return _0x7dc732['set'](_0x07a3('0x26'),_0x5968c5+'-'+_0x3bba04+'/'+_0x1c4db9)[_0x07a3('0x27')](_0x46a8b8);}return null;};}function patchUpdates(_0x448cf6){return function(_0x4207eb){try{jsonpatch[_0x07a3('0x28')](_0x4207eb,_0x448cf6,!![]);}catch(_0x58670b){return BPromise[_0x07a3('0x29')](_0x58670b);}return _0x4207eb[_0x07a3('0x2a')]();};}function saveUpdates(_0x388c76,_0x2b80a5){return function(_0x11e682){if(_0x11e682){return _0x11e682[_0x07a3('0x2b')](_0x388c76)[_0x07a3('0x2c')](function(_0x1be6b4){return _0x1be6b4;});}return null;};}function removeEntity(_0x3cdd31,_0x55f2bc){return function(_0x4cd156){if(_0x4cd156){return _0x4cd156[_0x07a3('0x2d')]()[_0x07a3('0x2c')](function(){_0x3cdd31[_0x07a3('0x20')](0xcc)[_0x07a3('0x21')]();});}};}function handleEntityNotFound(_0x14ea35,_0x75403e){return function(_0x2adc0b){if(!_0x2adc0b){_0x14ea35[_0x07a3('0x1f')](0x194);}return _0x2adc0b;};}function handleError(_0xbaf345,_0x2ddc52){_0x2ddc52=_0x2ddc52||0x1f4;return function(_0x22e798){logger['error'](_0x22e798[_0x07a3('0x2e')]);if(_0x22e798['name']){delete _0x22e798[_0x07a3('0x2f')];}_0xbaf345['status'](_0x2ddc52)[_0x07a3('0x30')](_0x22e798);};}exports[_0x07a3('0x31')]=function(_0x573f23,_0x51ca4f){var _0x258c5e={'raw':![],'where':{'id':_0x573f23[_0x07a3('0x32')]['id']}},_0x5e7478={};_0x5e7478['model']=_[_0x07a3('0x33')](db[_0x07a3('0x34')][_0x07a3('0x35')]);_0x5e7478[_0x07a3('0x36')]=_[_0x07a3('0x33')](_0x573f23[_0x07a3('0x36')]);_0x5e7478[_0x07a3('0x37')]=_['intersection'](_0x5e7478[_0x07a3('0x38')],_0x5e7478[_0x07a3('0x36')]);_0x258c5e['attributes']=_['intersection'](_0x5e7478[_0x07a3('0x38')],qs['fields'](_0x573f23[_0x07a3('0x36')]['fields']));_0x258c5e[_0x07a3('0x39')]=_0x258c5e[_0x07a3('0x39')][_0x07a3('0x3a')]?_0x258c5e[_0x07a3('0x39')]:_0x5e7478[_0x07a3('0x38')];if(_0x573f23[_0x07a3('0x36')]['includeAll']){_0x258c5e[_0x07a3('0x3b')]=[{'all':!![]}];}_0x258c5e=_['merge']({},_0x258c5e,_0x573f23[_0x07a3('0x3c')]);return db['DashboardItem'][_0x07a3('0x3d')](_0x258c5e)[_0x07a3('0x2c')](handleEntityNotFound(_0x51ca4f,null))[_0x07a3('0x2c')](respondWithResult(_0x51ca4f,null))['catch'](handleError(_0x51ca4f,null));};exports[_0x07a3('0x2d')]=function(_0x4da3c7,_0x42ae06){return db[_0x07a3('0x34')]['find']({'where':{'id':_0x4da3c7[_0x07a3('0x32')]['id']}})[_0x07a3('0x2c')](handleEntityNotFound(_0x42ae06,null))[_0x07a3('0x2c')](removeEntity(_0x42ae06,null))[_0x07a3('0x3e')](handleError(_0x42ae06,null));};function widgetAttributes(_0x54c32e){try{switch(_0x54c32e[_0x07a3('0x3f')]){case _0x07a3('0x40'):return[{'name':_0x07a3('0x41'),'value':_0x54c32e['attrUrl']||(_0x54c32e[_0x07a3('0x42')]&&_0x54c32e[_0x07a3('0x42')][0x0]?_0x54c32e[_0x07a3('0x42')][0x0][_0x07a3('0x43')]:undefined)||'https://'}];case'custom':return[{'name':_0x07a3('0x44'),'value':_0x54c32e[_0x07a3('0x44')]||(_0x54c32e[_0x07a3('0x42')]&&_0x54c32e[_0x07a3('0x42')][0x0]?_0x54c32e[_0x07a3('0x42')][0x0]['value']:undefined)||''}];case _0x07a3('0x45'):return[{'name':_0x07a3('0x46'),'value':_0x54c32e['attrHourFormat']||(_0x54c32e['attrs']&&_0x54c32e[_0x07a3('0x42')][0x0]?_0x54c32e[_0x07a3('0x42')][0x0][_0x07a3('0x43')]:undefined)||'HH:mm:ss'},{'name':_0x07a3('0x47'),'value':_0x54c32e[_0x07a3('0x47')]||(_0x54c32e['attrs']&&_0x54c32e['attrs'][0x1]?_0x54c32e['attrs'][0x1][_0x07a3('0x43')]:undefined)||_0x07a3('0x48')},{'name':_0x07a3('0x49'),'value':_0x54c32e['attrFontSize']||(_0x54c32e[_0x07a3('0x42')]&&_0x54c32e[_0x07a3('0x42')][0x2]?_0x54c32e[_0x07a3('0x42')][0x2][_0x07a3('0x43')]:undefined)||0xc}];case _0x07a3('0x4a'):return[{'name':_0x07a3('0x4b'),'value':_0x54c32e[_0x07a3('0x4b')]||(_0x54c32e[_0x07a3('0x42')]&&_0x54c32e[_0x07a3('0x42')][0x0]?_0x54c32e['attrs'][0x0]['value']:undefined)||_0x07a3('0x4c')},{'name':_0x07a3('0x4d'),'value':_0x54c32e[_0x07a3('0x4d')]||(_0x54c32e[_0x07a3('0x42')]&&_0x54c32e[_0x07a3('0x42')][0x1]?_0x54c32e['attrs'][0x1][_0x07a3('0x43')]:undefined)||[]},{'name':'attrFontSize','value':_0x54c32e[_0x07a3('0x49')]||(_0x54c32e[_0x07a3('0x42')]&&_0x54c32e[_0x07a3('0x42')][0x2]?_0x54c32e[_0x07a3('0x42')][0x2][_0x07a3('0x43')]:undefined)||0x14}];case _0x07a3('0x4e'):case _0x07a3('0x4f'):return[{'name':'attrSerie1','value':_0x54c32e['attrSerie1']||(_0x54c32e[_0x07a3('0x42')]&&_0x54c32e[_0x07a3('0x42')][0x0]?_0x54c32e[_0x07a3('0x42')][0x0][_0x07a3('0x43')]:undefined)||_0x07a3('0x4c')},{'name':_0x07a3('0x50'),'value':_0x54c32e[_0x07a3('0x50')]||(_0x54c32e['attrs']&&_0x54c32e[_0x07a3('0x42')][0x1]?_0x54c32e[_0x07a3('0x42')][0x1][_0x07a3('0x43')]:undefined)||null},{'name':'attrSerie3','value':_0x54c32e[_0x07a3('0x51')]||(_0x54c32e[_0x07a3('0x42')]&&_0x54c32e['attrs'][0x2]?_0x54c32e[_0x07a3('0x42')][0x2]['value']:undefined)||null},{'name':_0x07a3('0x4d'),'value':_0x54c32e['attrVoiceQueues']||(_0x54c32e[_0x07a3('0x42')]&&_0x54c32e['attrs'][0x3]?_0x54c32e[_0x07a3('0x42')][0x3][_0x07a3('0x43')]:undefined)||[]}];case _0x07a3('0x52'):return[{'name':_0x07a3('0x53'),'type':_0x54c32e[_0x07a3('0x54')]||(_0x54c32e[_0x07a3('0x42')]&&_0x54c32e[_0x07a3('0x42')][0x0]?_0x54c32e[_0x07a3('0x42')][0x0][_0x07a3('0x3f')]:undefined)||null,'value':_0x54c32e['attrReport']||(_0x54c32e[_0x07a3('0x42')]&&_0x54c32e['attrs'][0x0]?_0x54c32e['attrs'][0x0][_0x07a3('0x43')]:undefined)||null},{'name':'attrRefresh','value':_0x54c32e[_0x07a3('0x55')]||(_0x54c32e[_0x07a3('0x42')]&&_0x54c32e['attrs'][0x1]?_0x54c32e[_0x07a3('0x42')][0x1][_0x07a3('0x43')]:undefined)||0x0}];default:return[];}}catch(_0x3861da){logger[_0x07a3('0x56')](_0x07a3('0x57'),JSON[_0x07a3('0x58')](_0x3861da));return[];}}exports[_0x07a3('0x59')]=function(_0x1cc673,_0x31dfd9){if(_0x1cc673[_0x07a3('0x5a')]){_0x1cc673['body'][_0x07a3('0x42')]=widgetAttributes(_0x1cc673[_0x07a3('0x5a')]);}return db[_0x07a3('0x34')]['create'](_0x1cc673[_0x07a3('0x5a')],{})[_0x07a3('0x2c')](respondWithResult(_0x31dfd9,0xc9))[_0x07a3('0x3e')](handleError(_0x31dfd9,null));};exports[_0x07a3('0x2b')]=function(_0xcd900,_0x40e6da){if(_0xcd900[_0x07a3('0x5a')]['id']){delete _0xcd900[_0x07a3('0x5a')]['id'];}_0xcd900['body'][_0x07a3('0x42')]=widgetAttributes(_0xcd900['body']);return db[_0x07a3('0x34')][_0x07a3('0x3d')]({'where':{'id':_0xcd900[_0x07a3('0x32')]['id']}})[_0x07a3('0x2c')](handleEntityNotFound(_0x40e6da,null))['then'](saveUpdates(_0xcd900['body'],null))[_0x07a3('0x2c')](respondWithResult(_0x40e6da,null))[_0x07a3('0x3e')](handleError(_0x40e6da,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 4131290..3f10387 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 _0xb515=['events','DashboardItem','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x52e0ee,_0x52f7c1){var _0x32534c=function(_0x535d65){while(--_0x535d65){_0x52e0ee['push'](_0x52e0ee['shift']());}};_0x32534c(++_0x52f7c1);}(_0xb515,0x1b8));var _0x5b51=function(_0x27031e,_0x1eb8cd){_0x27031e=_0x27031e-0x0;var _0xfd46b3=_0xb515[_0x27031e];return _0xfd46b3;};'use strict';var EventEmitter=require(_0x5b51('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0x5b51('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x5b51('0x2')](0x0);var events={'afterCreate':_0x5b51('0x3'),'afterUpdate':_0x5b51('0x4'),'afterDestroy':_0x5b51('0x5')};function emitEvent(_0x62b8c7){return function(_0x3463fd,_0xe37d98,_0x50a6e9){DashboardItemEvents[_0x5b51('0x6')](_0x62b8c7+':'+_0x3463fd['id'],_0x3463fd);DashboardItemEvents[_0x5b51('0x6')](_0x62b8c7,_0x3463fd);_0x50a6e9(null);};}for(var e in events){if(events[_0x5b51('0x7')](e)){var event=events[e];DashboardItem[_0x5b51('0x8')](e,emitEvent(event));}}module[_0x5b51('0x9')]=DashboardItemEvents; \ No newline at end of file +var _0xdebe=['events','../../mysqldb','DashboardItem','setMaxListeners','update','emit','exports'];(function(_0x4f9617,_0x16a10a){var _0x55b7d0=function(_0x43824a){while(--_0x43824a){_0x4f9617['push'](_0x4f9617['shift']());}};_0x55b7d0(++_0x16a10a);}(_0xdebe,0x142));var _0xedeb=function(_0xb00e88,_0x315c7e){_0xb00e88=_0xb00e88-0x0;var _0x17d2f6=_0xdebe[_0xb00e88];return _0x17d2f6;};'use strict';var EventEmitter=require(_0xedeb('0x0'));var DashboardItem=require(_0xedeb('0x1'))['db'][_0xedeb('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xedeb('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xedeb('0x4'),'afterDestroy':'remove'};function emitEvent(_0x367144){return function(_0x43f70b,_0x5781ad,_0x43b7c8){DashboardItemEvents[_0xedeb('0x5')](_0x367144+':'+_0x43f70b['id'],_0x43f70b);DashboardItemEvents['emit'](_0x367144,_0x43f70b);_0x43b7c8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0xedeb('0x6')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 82ae4cd..483e3f0 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 _0x6709=['exports','define','DashboardItem','dashboard_items','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./dashboardItem.attributes'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x6709,0x12f));var _0x9670=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0x6709[_0x1573ea];return _0x51c0e2;};'use strict';var _=require('lodash');var util=require(_0x9670('0x0'));var logger=require(_0x9670('0x1'))(_0x9670('0x2'));var moment=require(_0x9670('0x3'));var BPromise=require(_0x9670('0x4'));var rp=require(_0x9670('0x5'));var fs=require('fs');var path=require(_0x9670('0x6'));var rimraf=require('rimraf');var config=require(_0x9670('0x7'));var attributes=require(_0x9670('0x8'));module[_0x9670('0x9')]=function(_0xbe2f74,_0x3004c2){return _0xbe2f74[_0x9670('0xa')](_0x9670('0xb'),attributes,{'tableName':_0x9670('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa58e=['util','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','define','dashboard_items','lodash'];(function(_0x4d467f,_0x54d2e7){var _0x521bb5=function(_0x126081){while(--_0x126081){_0x4d467f['push'](_0x4d467f['shift']());}};_0x521bb5(++_0x54d2e7);}(_0xa58e,0x1d3));var _0xea58=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xa58e[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xea58('0x0'));var util=require(_0xea58('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xea58('0x2'));var fs=require('fs');var path=require(_0xea58('0x3'));var rimraf=require(_0xea58('0x4'));var config=require(_0xea58('0x5'));var attributes=require(_0xea58('0x6'));module['exports']=function(_0x34d83f,_0x56968f){return _0x34d83f[_0xea58('0x7')]('DashboardItem',attributes,{'tableName':_0xea58('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index a4a5d84..2dfaebf 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 _0x1a99=['../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0xe73bdd,_0x6fa765){var _0xa9f84a=function(_0x44cdea){while(--_0x44cdea){_0xe73bdd['push'](_0xe73bdd['shift']());}};_0xa9f84a(++_0x6fa765);}(_0x1a99,0xdf));var _0x91a9=function(_0x39b1d8,_0xd5e4d9){_0x39b1d8=_0x39b1d8-0x0;var _0x18f8d9=_0x1a99[_0x39b1d8];return _0x18f8d9;};'use strict';var _=require(_0x91a9('0x0'));var util=require(_0x91a9('0x1'));var moment=require(_0x91a9('0x2'));var BPromise=require(_0x91a9('0x3'));var rs=require(_0x91a9('0x4'));var fs=require('fs');var Redis=require(_0x91a9('0x5'));var db=require(_0x91a9('0x6'))['db'];var utils=require(_0x91a9('0x7'));var logger=require('../../config/logger')(_0x91a9('0x8'));var config=require(_0x91a9('0x9'));var jayson=require(_0x91a9('0xa'));var client=jayson[_0x91a9('0xb')][_0x91a9('0xc')]({'port':0x232a});config[_0x91a9('0xd')]=_[_0x91a9('0xe')](config[_0x91a9('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x91a9('0xf'))(new Redis(config[_0x91a9('0xd')]));require(_0x91a9('0x10'))[_0x91a9('0x11')](socket);function respondWithRpcPromise(_0x28cfdb,_0x378668,_0x3ccfd9){return new BPromise(function(_0x3be61a,_0x2509a6){return client[_0x91a9('0x12')](_0x28cfdb,_0x3ccfd9)[_0x91a9('0x13')](function(_0x5f8975){logger[_0x91a9('0x14')](_0x91a9('0x15'),_0x378668,_0x91a9('0x16'));logger[_0x91a9('0x17')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x378668,'request\x20sent',JSON[_0x91a9('0x18')](_0x5f8975));if(_0x5f8975['error']){if(_0x5f8975['error'][_0x91a9('0x19')]===0x1f4){logger[_0x91a9('0x1a')](_0x91a9('0x15'),_0x378668,_0x5f8975['error'][_0x91a9('0x1b')]);return _0x2509a6(_0x5f8975[_0x91a9('0x1a')]['message']);}logger['error'](_0x91a9('0x15'),_0x378668,_0x5f8975[_0x91a9('0x1a')]['message']);return _0x3be61a(_0x5f8975[_0x91a9('0x1a')][_0x91a9('0x1b')]);}else{logger[_0x91a9('0x14')]('DashboardItem,\x20%s,\x20%s',_0x378668,'request\x20sent');_0x3be61a(_0x5f8975['result'][_0x91a9('0x1b')]);}})[_0x91a9('0x1c')](function(_0x222836){logger['error']('DashboardItem,\x20%s,\x20%s',_0x378668,_0x222836);_0x2509a6(_0x222836);});});} \ No newline at end of file +var _0x38c3=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x38c3,0x171));var _0x338c=function(_0x2f4f25,_0x592d31){_0x2f4f25=_0x2f4f25-0x0;var _0x6a112a=_0x38c3[_0x2f4f25];return _0x6a112a;};'use strict';var _=require(_0x338c('0x0'));var util=require(_0x338c('0x1'));var moment=require(_0x338c('0x2'));var BPromise=require('bluebird');var rs=require(_0x338c('0x3'));var fs=require('fs');var Redis=require(_0x338c('0x4'));var db=require(_0x338c('0x5'))['db'];var utils=require(_0x338c('0x6'));var logger=require(_0x338c('0x7'))(_0x338c('0x8'));var config=require(_0x338c('0x9'));var jayson=require(_0x338c('0xa'));var client=jayson[_0x338c('0xb')][_0x338c('0xc')]({'port':0x232a});config[_0x338c('0xd')]=_[_0x338c('0xe')](config['redis'],{'host':_0x338c('0xf'),'port':0x18eb});var socket=require(_0x338c('0x10'))(new Redis(config[_0x338c('0xd')]));require(_0x338c('0x11'))[_0x338c('0x12')](socket);function respondWithRpcPromise(_0x27e19b,_0x5b23f5,_0x368237){return new BPromise(function(_0x1e375c,_0x518fa4){return client[_0x338c('0x13')](_0x27e19b,_0x368237)['then'](function(_0x5b6035){logger[_0x338c('0x14')](_0x338c('0x15'),_0x5b23f5,_0x338c('0x16'));logger[_0x338c('0x17')](_0x338c('0x18'),_0x5b23f5,_0x338c('0x16'),JSON[_0x338c('0x19')](_0x5b6035));if(_0x5b6035[_0x338c('0x1a')]){if(_0x5b6035[_0x338c('0x1a')][_0x338c('0x1b')]===0x1f4){logger['error'](_0x338c('0x15'),_0x5b23f5,_0x5b6035[_0x338c('0x1a')][_0x338c('0x1c')]);return _0x518fa4(_0x5b6035[_0x338c('0x1a')][_0x338c('0x1c')]);}logger[_0x338c('0x1a')](_0x338c('0x15'),_0x5b23f5,_0x5b6035[_0x338c('0x1a')][_0x338c('0x1c')]);return _0x1e375c(_0x5b6035[_0x338c('0x1a')]['message']);}else{logger['info'](_0x338c('0x15'),_0x5b23f5,_0x338c('0x16'));_0x1e375c(_0x5b6035[_0x338c('0x1d')]['message']);}})[_0x338c('0x1e')](function(_0x1344fa){logger[_0x338c('0x1a')](_0x338c('0x15'),_0x5b23f5,_0x1344fa);_0x518fa4(_0x1344fa);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index b437bf9..a2f850e 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 _0xafcb=['./dashboardItem.events','remove','emit','removeListener','length','dashboardItem:'];(function(_0x45e468,_0x31812c){var _0x13d0d0=function(_0x355890){while(--_0x355890){_0x45e468['push'](_0x45e468['shift']());}};_0x13d0d0(++_0x31812c);}(_0xafcb,0x18c));var _0xbafc=function(_0x376783,_0x414ae7){_0x376783=_0x376783-0x0;var _0x3b2a7c=_0xafcb[_0x376783];return _0x3b2a7c;};'use strict';var DashboardItemEvents=require(_0xbafc('0x0'));var events=['save',_0xbafc('0x1'),'update'];function createListener(_0x3848b7,_0x2b7ebe){return function(_0x5a8c5f){_0x2b7ebe[_0xbafc('0x2')](_0x3848b7,_0x5a8c5f);};}function removeListener(_0x71b382,_0x1c84bb){return function(){DashboardItemEvents[_0xbafc('0x3')](_0x71b382,_0x1c84bb);};}exports['register']=function(_0x4f8a1f){for(var _0x3992ad=0x0,_0x2e7e06=events[_0xbafc('0x4')];_0x3992ad<_0x2e7e06;_0x3992ad++){var _0x21eba0=events[_0x3992ad];var _0x373199=createListener(_0xbafc('0x5')+_0x21eba0,_0x4f8a1f);DashboardItemEvents['on'](_0x21eba0,_0x373199);}}; \ No newline at end of file +var _0xd6a7=['dashboardItem:','save','remove','removeListener','register'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xd6a7,0x150));var _0x7d6a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xd6a7[_0x3ab51d];return _0x29a04e;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x7d6a('0x0'),_0x7d6a('0x1'),'update'];function createListener(_0x245687,_0x4f6cfe){return function(_0x945731){_0x4f6cfe['emit'](_0x245687,_0x945731);};}function removeListener(_0x3444a4,_0x203a98){return function(){DashboardItemEvents[_0x7d6a('0x2')](_0x3444a4,_0x203a98);};}exports[_0x7d6a('0x3')]=function(_0x4f812b){for(var _0x303220=0x0,_0x1b6b8f=events['length'];_0x303220<_0x1b6b8f;_0x303220++){var _0x114885=events[_0x303220];var _0x141f8c=createListener(_0x7d6a('0x4')+_0x114885,_0x4f812b);DashboardItemEvents['on'](_0x114885,_0x141f8c);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 55f819e..6640bb5 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 _0x055a=['post','update','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','/:id','isAuthenticated'];(function(_0x11b76d,_0xbbebb8){var _0x567ac3=function(_0x5d8929){while(--_0x5d8929){_0x11b76d['push'](_0x11b76d['shift']());}};_0x567ac3(++_0xbbebb8);}(_0x055a,0x13f));var _0xa055=function(_0x3ace0e,_0x2b70fd){_0x3ace0e=_0x3ace0e-0x0;var _0x4b91c6=_0x055a[_0x3ace0e];return _0x4b91c6;};'use strict';var multer=require('multer');var util=require(_0xa055('0x0'));var path=require('path');var timeout=require(_0xa055('0x1'));var express=require(_0xa055('0x2'));var router=express[_0xa055('0x3')]();var fs_extra=require(_0xa055('0x4'));var auth=require(_0xa055('0x5'));var interaction=require(_0xa055('0x6'));var config=require(_0xa055('0x7'));var controller=require(_0xa055('0x8'));router['get'](_0xa055('0x9'),auth[_0xa055('0xa')](),controller['show']);router[_0xa055('0xb')]('/',auth[_0xa055('0xa')](),controller['create']);router['put'](_0xa055('0x9'),auth[_0xa055('0xa')](),controller[_0xa055('0xc')]);router['delete'](_0xa055('0x9'),auth[_0xa055('0xa')](),controller[_0xa055('0xd')]);module[_0xa055('0xe')]=router; \ No newline at end of file +var _0xc3a7=['create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','isAuthenticated','show','post'];(function(_0x27d464,_0x5d3412){var _0x2d9781=function(_0x57196c){while(--_0x57196c){_0x27d464['push'](_0x27d464['shift']());}};_0x2d9781(++_0x5d3412);}(_0xc3a7,0x9f));var _0x7c3a=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xc3a7[_0x3b0731];return _0x4204d7;};'use strict';var multer=require(_0x7c3a('0x0'));var util=require('util');var path=require(_0x7c3a('0x1'));var timeout=require(_0x7c3a('0x2'));var express=require('express');var router=express[_0x7c3a('0x3')]();var fs_extra=require(_0x7c3a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7c3a('0x5'));var config=require(_0x7c3a('0x6'));var controller=require(_0x7c3a('0x7'));router[_0x7c3a('0x8')]('/:id',auth[_0x7c3a('0x9')](),controller[_0x7c3a('0xa')]);router[_0x7c3a('0xb')]('/',auth['isAuthenticated'](),controller[_0x7c3a('0xc')]);router[_0x7c3a('0xd')](_0x7c3a('0xe'),auth[_0x7c3a('0x9')](),controller[_0x7c3a('0xf')]);router[_0x7c3a('0x10')](_0x7c3a('0xe'),auth[_0x7c3a('0x9')](),controller[_0x7c3a('0x11')]);module[_0x7c3a('0x12')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index becb8a8..9621a2e 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 _0x144a=['third','sequelize','exports','STRING','ENUM','first','second'];(function(_0x519a7d,_0x48e281){var _0x1718a2=function(_0x17df59){while(--_0x17df59){_0x519a7d['push'](_0x519a7d['shift']());}};_0x1718a2(++_0x48e281);}(_0x144a,0x94));var _0xa144=function(_0x857cd,_0x3bca41){_0x857cd=_0x857cd-0x0;var _0xe2eedf=_0x144a[_0x857cd];return _0xe2eedf;};'use strict';var Sequelize=require(_0xa144('0x0'));module[_0xa144('0x1')]={'name':{'type':Sequelize[_0xa144('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0xa144('0x3')](_0xa144('0x4'),_0xa144('0x5'),_0xa144('0x6')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0xa144('0x2')]}}; \ No newline at end of file +var _0x6c44=['STRING','ENUM','first','second','third','sequelize'];(function(_0x1c263e,_0x4d4689){var _0x2b501c=function(_0x361a45){while(--_0x361a45){_0x1c263e['push'](_0x1c263e['shift']());}};_0x2b501c(++_0x4d4689);}(_0x6c44,0x15b));var _0x46c4=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0x6c44[_0x58e469];return _0x4c01c5;};'use strict';var Sequelize=require(_0x46c4('0x0'));module['exports']={'name':{'type':Sequelize[_0x46c4('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x46c4('0x2')](_0x46c4('0x3'),_0x46c4('0x4'),_0x46c4('0x5')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x46c4('0x1')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 130417f..170300b 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 _0x4aeb=['../../config/environment','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','destroy','then','get','Dispositions','UserProfileResource','error','stack','name','send','map','Disposition','rawAttributes','fieldName','type','key','query','model','attributes','intersection','length','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','include','rows','show','params','fields','options','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','lodash','squel','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'];(function(_0x3e2116,_0x4795a5){var _0x30b88b=function(_0x3a8fa9){while(--_0x3a8fa9){_0x3e2116['push'](_0x3e2116['shift']());}};_0x30b88b(++_0x4795a5);}(_0x4aeb,0x131));var _0xb4ae=function(_0x308b9d,_0x11db54){_0x308b9d=_0x308b9d-0x0;var _0x301d31=_0x4aeb[_0x308b9d];return _0x301d31;};'use strict';var emlformat=require(_0xb4ae('0x0'));var rimraf=require(_0xb4ae('0x1'));var zipdir=require(_0xb4ae('0x2'));var jsonpatch=require(_0xb4ae('0x3'));var rp=require('request-promise');var moment=require(_0xb4ae('0x4'));var BPromise=require(_0xb4ae('0x5'));var Mustache=require(_0xb4ae('0x6'));var util=require('util');var path=require(_0xb4ae('0x7'));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(_0xb4ae('0x8'));var squel=require(_0xb4ae('0x9'));var crypto=require('crypto');var jsforce=require(_0xb4ae('0xa'));var deskjs=require(_0xb4ae('0xb'));var toCsv=require(_0xb4ae('0xc'));var querystring=require(_0xb4ae('0xd'));var Papa=require(_0xb4ae('0xe'));var Redis=require(_0xb4ae('0xf'));var authService=require(_0xb4ae('0x10'));var qs=require(_0xb4ae('0x11'));var as=require(_0xb4ae('0x12'));var hardwareService=require(_0xb4ae('0x13'));var logger=require(_0xb4ae('0x14'))(_0xb4ae('0x15'));var utils=require(_0xb4ae('0x16'));var config=require(_0xb4ae('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb4ae('0x18'))['db'];function respondWithStatusCode(_0x21469a,_0x477001){_0x477001=_0x477001||0xcc;return function(_0x545b5b){if(_0x545b5b){return _0x21469a[_0xb4ae('0x19')](_0x477001);}return _0x21469a['status'](_0x477001)[_0xb4ae('0x1a')]();};}function respondWithResult(_0x56f69d,_0x52b539){_0x52b539=_0x52b539||0xc8;return function(_0x3150b0){if(_0x3150b0){return _0x56f69d['status'](_0x52b539)[_0xb4ae('0x1b')](_0x3150b0);}};}function respondWithFilteredResult(_0x14131c,_0x171e44){return function(_0xe6a6f1){if(_0xe6a6f1){var _0x33f028=typeof _0x171e44[_0xb4ae('0x1c')]==='undefined'&&typeof _0x171e44[_0xb4ae('0x1d')]===_0xb4ae('0x1e');var _0x67368e=_0xe6a6f1[_0xb4ae('0x1f')];var _0x4c8c2d=_0x33f028?0x0:_0x171e44['offset'];var _0x52d8a6=_0x33f028?_0xe6a6f1['count']:_0x171e44[_0xb4ae('0x1c')]+_0x171e44[_0xb4ae('0x1d')];var _0x25d486;if(_0x52d8a6>=_0x67368e){_0x52d8a6=_0x67368e;_0x25d486=0xc8;}else{_0x25d486=0xce;}_0x14131c[_0xb4ae('0x20')](_0x25d486);return _0x14131c[_0xb4ae('0x21')](_0xb4ae('0x22'),_0x4c8c2d+'-'+_0x52d8a6+'/'+_0x67368e)[_0xb4ae('0x1b')](_0xe6a6f1);}return null;};}function patchUpdates(_0x444dc2){return function(_0x1eebfa){try{jsonpatch[_0xb4ae('0x23')](_0x1eebfa,_0x444dc2,!![]);}catch(_0x51ea32){return BPromise[_0xb4ae('0x24')](_0x51ea32);}return _0x1eebfa['save']();};}function saveUpdates(_0x3533ce,_0x487cd5){return function(_0x136f67){if(_0x136f67){return _0x136f67['update'](_0x3533ce)['then'](function(_0x19efc5){return _0x19efc5;});}return null;};}function removeEntity(_0x44dd67,_0x19a1ba){return function(_0xdf8578){if(_0xdf8578){return _0xdf8578[_0xb4ae('0x25')]()[_0xb4ae('0x26')](function(){var _0x3b9931=_0xdf8578[_0xb4ae('0x27')]({'plain':!![]});var _0xb25074=_0xb4ae('0x28');return db[_0xb4ae('0x29')][_0xb4ae('0x25')]({'where':{'type':_0xb25074,'resourceId':_0x3b9931['id']}})[_0xb4ae('0x26')](function(){return _0xdf8578;});})[_0xb4ae('0x26')](function(){_0x44dd67['status'](0xcc)[_0xb4ae('0x1a')]();});}};}function handleEntityNotFound(_0x2fe8d3,_0x53c893){return function(_0x3126b9){if(!_0x3126b9){_0x2fe8d3['sendStatus'](0x194);}return _0x3126b9;};}function handleError(_0x164a76,_0x232fd0){_0x232fd0=_0x232fd0||0x1f4;return function(_0x1673f7){logger[_0xb4ae('0x2a')](_0x1673f7[_0xb4ae('0x2b')]);if(_0x1673f7[_0xb4ae('0x2c')]){delete _0x1673f7['name'];}_0x164a76[_0xb4ae('0x20')](_0x232fd0)[_0xb4ae('0x2d')](_0x1673f7);};}exports['index']=function(_0x272a98,_0x2f13ce){var _0x3e95f5={},_0x413092={},_0x571890={'count':0x0,'rows':[]};var _0x537bc3=_[_0xb4ae('0x2e')](db[_0xb4ae('0x2f')][_0xb4ae('0x30')],function(_0x225301){return{'name':_0x225301[_0xb4ae('0x31')],'type':_0x225301[_0xb4ae('0x32')][_0xb4ae('0x33')]};});_0x413092['model']=_['map'](_0x537bc3,_0xb4ae('0x2c'));_0x413092['query']=_['keys'](_0x272a98[_0xb4ae('0x34')]);_0x413092['filters']=_['intersection'](_0x413092[_0xb4ae('0x35')],_0x413092[_0xb4ae('0x34')]);_0x3e95f5[_0xb4ae('0x36')]=_[_0xb4ae('0x37')](_0x413092[_0xb4ae('0x35')],qs['fields'](_0x272a98[_0xb4ae('0x34')]['fields']));_0x3e95f5[_0xb4ae('0x36')]=_0x3e95f5['attributes'][_0xb4ae('0x38')]?_0x3e95f5[_0xb4ae('0x36')]:_0x413092['model'];if(!_0x272a98['query']['hasOwnProperty']('nolimit')){_0x3e95f5[_0xb4ae('0x1d')]=qs['limit'](_0x272a98[_0xb4ae('0x34')]['limit']);_0x3e95f5['offset']=qs[_0xb4ae('0x1c')](_0x272a98['query']['offset']);}_0x3e95f5[_0xb4ae('0x39')]=qs[_0xb4ae('0x3a')](_0x272a98[_0xb4ae('0x34')][_0xb4ae('0x3a')]);_0x3e95f5['where']=qs['filters'](_[_0xb4ae('0x3b')](_0x272a98['query'],_0x413092['filters']),_0x537bc3);if(_0x272a98[_0xb4ae('0x34')][_0xb4ae('0x3c')]){_0x3e95f5['where']=_[_0xb4ae('0x3d')](_0x3e95f5[_0xb4ae('0x3e')],{'$or':_['map'](_0x537bc3,function(_0x173a03){if(_0x173a03[_0xb4ae('0x32')]!==_0xb4ae('0x3f')){var _0x493875={};_0x493875[_0x173a03[_0xb4ae('0x2c')]]={'$like':'%'+_0x272a98['query'][_0xb4ae('0x3c')]+'%'};return _0x493875;}})});}_0x3e95f5=_[_0xb4ae('0x3d')]({},_0x3e95f5,_0x272a98['options']);var _0x3d1cbd={'where':_0x3e95f5[_0xb4ae('0x3e')]};return db[_0xb4ae('0x2f')][_0xb4ae('0x1f')](_0x3d1cbd)[_0xb4ae('0x26')](function(_0x5b618d){_0x571890[_0xb4ae('0x1f')]=_0x5b618d;if(_0x272a98['query'][_0xb4ae('0x40')]){_0x3e95f5[_0xb4ae('0x41')]=[{'all':!![]}];}return db[_0xb4ae('0x2f')]['findAll'](_0x3e95f5);})[_0xb4ae('0x26')](function(_0x2efcd6){_0x571890[_0xb4ae('0x42')]=_0x2efcd6;return _0x571890;})[_0xb4ae('0x26')](respondWithFilteredResult(_0x2f13ce,_0x3e95f5))['catch'](handleError(_0x2f13ce,null));};exports[_0xb4ae('0x43')]=function(_0x1e7cc4,_0x687eb4){var _0x51b301={'raw':!![],'where':{'id':_0x1e7cc4[_0xb4ae('0x44')]['id']}},_0x5cfe64={};_0x5cfe64[_0xb4ae('0x35')]=_['keys'](db[_0xb4ae('0x2f')][_0xb4ae('0x30')]);_0x5cfe64[_0xb4ae('0x34')]=_['keys'](_0x1e7cc4[_0xb4ae('0x34')]);_0x5cfe64['filters']=_['intersection'](_0x5cfe64['model'],_0x5cfe64[_0xb4ae('0x34')]);_0x51b301[_0xb4ae('0x36')]=_[_0xb4ae('0x37')](_0x5cfe64[_0xb4ae('0x35')],qs[_0xb4ae('0x45')](_0x1e7cc4['query'][_0xb4ae('0x45')]));_0x51b301[_0xb4ae('0x36')]=_0x51b301[_0xb4ae('0x36')][_0xb4ae('0x38')]?_0x51b301[_0xb4ae('0x36')]:_0x5cfe64['model'];if(_0x1e7cc4[_0xb4ae('0x34')][_0xb4ae('0x40')]){_0x51b301[_0xb4ae('0x41')]=[{'all':!![]}];}_0x51b301=_[_0xb4ae('0x3d')]({},_0x51b301,_0x1e7cc4[_0xb4ae('0x46')]);return db['Disposition'][_0xb4ae('0x47')](_0x51b301)['then'](handleEntityNotFound(_0x687eb4,null))[_0xb4ae('0x26')](respondWithResult(_0x687eb4,null))[_0xb4ae('0x48')](handleError(_0x687eb4,null));};exports[_0xb4ae('0x49')]=function(_0x181659,_0xea58ee){return db['Disposition'][_0xb4ae('0x49')](_0x181659['body'],{})['then'](function(_0x44ef35){var _0xf0eb4e=_0x181659[_0xb4ae('0x4a')][_0xb4ae('0x27')]({'plain':!![]});if(!_0xf0eb4e)throw new Error(_0xb4ae('0x4b'));if(_0xf0eb4e[_0xb4ae('0x4c')]===_0xb4ae('0x4a')){var _0x530a9c=_0x44ef35['get']({'plain':!![]});var _0x6361bc=_0xb4ae('0x28');return db[_0xb4ae('0x4d')][_0xb4ae('0x47')]({'where':{'name':_0x6361bc,'userProfileId':_0xf0eb4e['userProfileId']},'raw':!![]})[_0xb4ae('0x26')](function(_0x3fcb9d){if(_0x3fcb9d&&_0x3fcb9d[_0xb4ae('0x4e')]===0x0){return db[_0xb4ae('0x29')][_0xb4ae('0x49')]({'name':_0x530a9c['name'],'resourceId':_0x530a9c['id'],'type':_0x3fcb9d[_0xb4ae('0x2c')],'sectionId':_0x3fcb9d['id']},{})[_0xb4ae('0x26')](function(){return _0x44ef35;});}else{return _0x44ef35;}})['catch'](function(_0x3344a6){logger[_0xb4ae('0x2a')](_0xb4ae('0x4f'),_0x3344a6);throw _0x3344a6;});}return _0x44ef35;})['then'](respondWithResult(_0xea58ee,0xc9))[_0xb4ae('0x48')](handleError(_0xea58ee,null));};exports[_0xb4ae('0x50')]=function(_0x18f116,_0x5d4fc6){if(_0x18f116[_0xb4ae('0x51')]['id']){delete _0x18f116[_0xb4ae('0x51')]['id'];}return db[_0xb4ae('0x2f')][_0xb4ae('0x47')]({'where':{'id':_0x18f116[_0xb4ae('0x44')]['id']}})['then'](handleEntityNotFound(_0x5d4fc6,null))[_0xb4ae('0x26')](saveUpdates(_0x18f116[_0xb4ae('0x51')],null))['then'](respondWithResult(_0x5d4fc6,null))[_0xb4ae('0x48')](handleError(_0x5d4fc6,null));};exports[_0xb4ae('0x25')]=function(_0x5a0c81,_0x29d3d3){return db[_0xb4ae('0x2f')][_0xb4ae('0x47')]({'where':{'id':_0x5a0c81[_0xb4ae('0x44')]['id']}})[_0xb4ae('0x26')](handleEntityNotFound(_0x29d3d3,null))[_0xb4ae('0x26')](removeEntity(_0x29d3d3,null))[_0xb4ae('0x48')](handleError(_0x29d3d3,null));}; \ No newline at end of file +var _0x3004=['model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','VIRTUAL','filter','options','Disposition','include','findAll','rows','catch','show','params','includeAll','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','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','limit','set','reject','then','destroy','Dispositions','UserProfileResource','error','stack','name','map','rawAttributes','fieldName','type','key'];(function(_0x213768,_0xd622ef){var _0x108375=function(_0xcba2db){while(--_0xcba2db){_0x213768['push'](_0x213768['shift']());}};_0x108375(++_0xd622ef);}(_0x3004,0x123));var _0x4300=function(_0x1ebe90,_0x5d29fc){_0x1ebe90=_0x1ebe90-0x0;var _0x447c82=_0x3004[_0x1ebe90];return _0x447c82;};'use strict';var emlformat=require(_0x4300('0x0'));var rimraf=require(_0x4300('0x1'));var zipdir=require(_0x4300('0x2'));var jsonpatch=require(_0x4300('0x3'));var rp=require(_0x4300('0x4'));var moment=require('moment');var BPromise=require(_0x4300('0x5'));var Mustache=require(_0x4300('0x6'));var util=require('util');var path=require(_0x4300('0x7'));var sox=require('sox');var csv=require(_0x4300('0x8'));var ejs=require(_0x4300('0x9'));var fs=require('fs');var fs_extra=require(_0x4300('0xa'));var _=require('lodash');var squel=require(_0x4300('0xb'));var crypto=require('crypto');var jsforce=require(_0x4300('0xc'));var deskjs=require(_0x4300('0xd'));var toCsv=require(_0x4300('0x8'));var querystring=require(_0x4300('0xe'));var Papa=require(_0x4300('0xf'));var Redis=require(_0x4300('0x10'));var authService=require(_0x4300('0x11'));var qs=require(_0x4300('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4300('0x13'))('api');var utils=require(_0x4300('0x14'));var config=require(_0x4300('0x15'));var licenseUtil=require(_0x4300('0x16'));var db=require(_0x4300('0x17'))['db'];function respondWithStatusCode(_0x41c5af,_0x4ac1f){_0x4ac1f=_0x4ac1f||0xcc;return function(_0x3c6216){if(_0x3c6216){return _0x41c5af[_0x4300('0x18')](_0x4ac1f);}return _0x41c5af[_0x4300('0x19')](_0x4ac1f)[_0x4300('0x1a')]();};}function respondWithResult(_0x4c5cb2,_0x19bf05){_0x19bf05=_0x19bf05||0xc8;return function(_0x52758e){if(_0x52758e){return _0x4c5cb2['status'](_0x19bf05)[_0x4300('0x1b')](_0x52758e);}};}function respondWithFilteredResult(_0x173fa9,_0x2ff9f6){return function(_0x566458){if(_0x566458){var _0x39b0cc=typeof _0x2ff9f6['offset']===_0x4300('0x1c')&&typeof _0x2ff9f6['limit']===_0x4300('0x1c');var _0x28e53e=_0x566458[_0x4300('0x1d')];var _0x5a8218=_0x39b0cc?0x0:_0x2ff9f6['offset'];var _0x2acec9=_0x39b0cc?_0x566458[_0x4300('0x1d')]:_0x2ff9f6['offset']+_0x2ff9f6[_0x4300('0x1e')];var _0x319c55;if(_0x2acec9>=_0x28e53e){_0x2acec9=_0x28e53e;_0x319c55=0xc8;}else{_0x319c55=0xce;}_0x173fa9[_0x4300('0x19')](_0x319c55);return _0x173fa9[_0x4300('0x1f')]('Content-Range',_0x5a8218+'-'+_0x2acec9+'/'+_0x28e53e)[_0x4300('0x1b')](_0x566458);}return null;};}function patchUpdates(_0x1ab77b){return function(_0x2768dd){try{jsonpatch['apply'](_0x2768dd,_0x1ab77b,!![]);}catch(_0x3bf2cf){return BPromise[_0x4300('0x20')](_0x3bf2cf);}return _0x2768dd['save']();};}function saveUpdates(_0x49c607,_0x267cd4){return function(_0x56a80b){if(_0x56a80b){return _0x56a80b['update'](_0x49c607)[_0x4300('0x21')](function(_0x1bdd6a){return _0x1bdd6a;});}return null;};}function removeEntity(_0x346d83,_0x491d71){return function(_0x62e215){if(_0x62e215){return _0x62e215[_0x4300('0x22')]()[_0x4300('0x21')](function(){var _0x4f0712=_0x62e215['get']({'plain':!![]});var _0x4a61b0=_0x4300('0x23');return db[_0x4300('0x24')][_0x4300('0x22')]({'where':{'type':_0x4a61b0,'resourceId':_0x4f0712['id']}})['then'](function(){return _0x62e215;});})['then'](function(){_0x346d83['status'](0xcc)[_0x4300('0x1a')]();});}};}function handleEntityNotFound(_0x2e6ae9,_0x5480d4){return function(_0x1ce6cc){if(!_0x1ce6cc){_0x2e6ae9[_0x4300('0x18')](0x194);}return _0x1ce6cc;};}function handleError(_0x2275c7,_0x1b1007){_0x1b1007=_0x1b1007||0x1f4;return function(_0x14d4e9){logger[_0x4300('0x25')](_0x14d4e9[_0x4300('0x26')]);if(_0x14d4e9[_0x4300('0x27')]){delete _0x14d4e9['name'];}_0x2275c7['status'](_0x1b1007)['send'](_0x14d4e9);};}exports['index']=function(_0x57ead3,_0x12e602){var _0x4a3b70={},_0x1701a8={},_0x463de6={'count':0x0,'rows':[]};var _0x4c08c6=_[_0x4300('0x28')](db['Disposition'][_0x4300('0x29')],function(_0x1d7ca7){return{'name':_0x1d7ca7[_0x4300('0x2a')],'type':_0x1d7ca7[_0x4300('0x2b')][_0x4300('0x2c')]};});_0x1701a8[_0x4300('0x2d')]=_[_0x4300('0x28')](_0x4c08c6,_0x4300('0x27'));_0x1701a8['query']=_[_0x4300('0x2e')](_0x57ead3[_0x4300('0x2f')]);_0x1701a8[_0x4300('0x30')]=_[_0x4300('0x31')](_0x1701a8[_0x4300('0x2d')],_0x1701a8[_0x4300('0x2f')]);_0x4a3b70[_0x4300('0x32')]=_[_0x4300('0x31')](_0x1701a8[_0x4300('0x2d')],qs[_0x4300('0x33')](_0x57ead3['query'][_0x4300('0x33')]));_0x4a3b70['attributes']=_0x4a3b70[_0x4300('0x32')][_0x4300('0x34')]?_0x4a3b70[_0x4300('0x32')]:_0x1701a8[_0x4300('0x2d')];if(!_0x57ead3[_0x4300('0x2f')][_0x4300('0x35')](_0x4300('0x36'))){_0x4a3b70[_0x4300('0x1e')]=qs[_0x4300('0x1e')](_0x57ead3[_0x4300('0x2f')]['limit']);_0x4a3b70['offset']=qs[_0x4300('0x37')](_0x57ead3[_0x4300('0x2f')]['offset']);}_0x4a3b70[_0x4300('0x38')]=qs['sort'](_0x57ead3[_0x4300('0x2f')][_0x4300('0x39')]);_0x4a3b70[_0x4300('0x3a')]=qs[_0x4300('0x30')](_[_0x4300('0x3b')](_0x57ead3[_0x4300('0x2f')],_0x1701a8['filters']),_0x4c08c6);if(_0x57ead3[_0x4300('0x2f')]['filter']){_0x4a3b70['where']=_[_0x4300('0x3c')](_0x4a3b70[_0x4300('0x3a')],{'$or':_['map'](_0x4c08c6,function(_0x3de08f){if(_0x3de08f[_0x4300('0x2b')]!==_0x4300('0x3d')){var _0x3c5d7c={};_0x3c5d7c[_0x3de08f[_0x4300('0x27')]]={'$like':'%'+_0x57ead3['query'][_0x4300('0x3e')]+'%'};return _0x3c5d7c;}})});}_0x4a3b70=_[_0x4300('0x3c')]({},_0x4a3b70,_0x57ead3[_0x4300('0x3f')]);var _0x4cbe4f={'where':_0x4a3b70[_0x4300('0x3a')]};return db[_0x4300('0x40')][_0x4300('0x1d')](_0x4cbe4f)['then'](function(_0xfac35a){_0x463de6[_0x4300('0x1d')]=_0xfac35a;if(_0x57ead3[_0x4300('0x2f')]['includeAll']){_0x4a3b70[_0x4300('0x41')]=[{'all':!![]}];}return db['Disposition'][_0x4300('0x42')](_0x4a3b70);})[_0x4300('0x21')](function(_0xe9beab){_0x463de6[_0x4300('0x43')]=_0xe9beab;return _0x463de6;})['then'](respondWithFilteredResult(_0x12e602,_0x4a3b70))[_0x4300('0x44')](handleError(_0x12e602,null));};exports[_0x4300('0x45')]=function(_0x1b0f53,_0xdb371a){var _0xace9a2={'raw':!![],'where':{'id':_0x1b0f53[_0x4300('0x46')]['id']}},_0x5a7067={};_0x5a7067[_0x4300('0x2d')]=_[_0x4300('0x2e')](db[_0x4300('0x40')][_0x4300('0x29')]);_0x5a7067['query']=_['keys'](_0x1b0f53[_0x4300('0x2f')]);_0x5a7067[_0x4300('0x30')]=_[_0x4300('0x31')](_0x5a7067[_0x4300('0x2d')],_0x5a7067[_0x4300('0x2f')]);_0xace9a2[_0x4300('0x32')]=_[_0x4300('0x31')](_0x5a7067[_0x4300('0x2d')],qs['fields'](_0x1b0f53[_0x4300('0x2f')][_0x4300('0x33')]));_0xace9a2[_0x4300('0x32')]=_0xace9a2[_0x4300('0x32')][_0x4300('0x34')]?_0xace9a2[_0x4300('0x32')]:_0x5a7067[_0x4300('0x2d')];if(_0x1b0f53[_0x4300('0x2f')][_0x4300('0x47')]){_0xace9a2[_0x4300('0x41')]=[{'all':!![]}];}_0xace9a2=_[_0x4300('0x3c')]({},_0xace9a2,_0x1b0f53['options']);return db[_0x4300('0x40')][_0x4300('0x48')](_0xace9a2)[_0x4300('0x21')](handleEntityNotFound(_0xdb371a,null))[_0x4300('0x21')](respondWithResult(_0xdb371a,null))['catch'](handleError(_0xdb371a,null));};exports['create']=function(_0x57abd7,_0x29992a){return db['Disposition'][_0x4300('0x49')](_0x57abd7[_0x4300('0x4a')],{})[_0x4300('0x21')](function(_0x73c519){var _0x1c07d7=_0x57abd7[_0x4300('0x4b')][_0x4300('0x4c')]({'plain':!![]});if(!_0x1c07d7)throw new Error(_0x4300('0x4d'));if(_0x1c07d7[_0x4300('0x4e')]===_0x4300('0x4b')){var _0x4e0ae4=_0x73c519['get']({'plain':!![]});var _0x41d02a=_0x4300('0x23');return db[_0x4300('0x4f')][_0x4300('0x48')]({'where':{'name':_0x41d02a,'userProfileId':_0x1c07d7[_0x4300('0x50')]},'raw':!![]})['then'](function(_0x4eec11){if(_0x4eec11&&_0x4eec11[_0x4300('0x51')]===0x0){return db[_0x4300('0x24')][_0x4300('0x49')]({'name':_0x4e0ae4[_0x4300('0x27')],'resourceId':_0x4e0ae4['id'],'type':_0x4eec11['name'],'sectionId':_0x4eec11['id']},{})['then'](function(){return _0x73c519;});}else{return _0x73c519;}})[_0x4300('0x44')](function(_0x57bdba){logger[_0x4300('0x25')](_0x4300('0x52'),_0x57bdba);throw _0x57bdba;});}return _0x73c519;})[_0x4300('0x21')](respondWithResult(_0x29992a,0xc9))['catch'](handleError(_0x29992a,null));};exports[_0x4300('0x53')]=function(_0x2c1d57,_0x15a066){if(_0x2c1d57['body']['id']){delete _0x2c1d57[_0x4300('0x4a')]['id'];}return db[_0x4300('0x40')][_0x4300('0x48')]({'where':{'id':_0x2c1d57[_0x4300('0x46')]['id']}})['then'](handleEntityNotFound(_0x15a066,null))[_0x4300('0x21')](saveUpdates(_0x2c1d57[_0x4300('0x4a')],null))[_0x4300('0x21')](respondWithResult(_0x15a066,null))[_0x4300('0x44')](handleError(_0x15a066,null));};exports[_0x4300('0x22')]=function(_0x3daa1f,_0x3dcb4a){return db[_0x4300('0x40')][_0x4300('0x48')]({'where':{'id':_0x3daa1f['params']['id']}})['then'](handleEntityNotFound(_0x3dcb4a,null))['then'](removeEntity(_0x3dcb4a,null))[_0x4300('0x44')](handleError(_0x3dcb4a,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index b9a984b..87a56b1 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 _0x09b5=['rimraf','../../config/environment','./disposition.attributes','exports','define','name_voice','name','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','WhatsappAccountId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x09b5,0x7a));var _0x509b=function(_0x14b5ad,_0xa36f13){_0x14b5ad=_0x14b5ad-0x0;var _0x143b7d=_0x09b5[_0x14b5ad];return _0x143b7d;};'use strict';var _=require(_0x509b('0x0'));var util=require(_0x509b('0x1'));var logger=require(_0x509b('0x2'))(_0x509b('0x3'));var moment=require(_0x509b('0x4'));var BPromise=require(_0x509b('0x5'));var rp=require(_0x509b('0x6'));var fs=require('fs');var path=require(_0x509b('0x7'));var rimraf=require(_0x509b('0x8'));var config=require(_0x509b('0x9'));var attributes=require(_0x509b('0xa'));module[_0x509b('0xb')]=function(_0x5cdc8e,_0x130f2c){return _0x5cdc8e[_0x509b('0xc')]('Disposition',attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x509b('0xd'),'fields':[_0x509b('0xe'),'ListId']},{'unique':!![],'name':_0x509b('0xf'),'fields':['name',_0x509b('0x10')]},{'unique':!![],'name':_0x509b('0x11'),'fields':[_0x509b('0xe'),_0x509b('0x12')]},{'unique':!![],'name':_0x509b('0x13'),'fields':['name',_0x509b('0x14')]},{'unique':!![],'name':_0x509b('0x15'),'fields':[_0x509b('0xe'),_0x509b('0x16')]},{'unique':!![],'name':_0x509b('0x17'),'fields':[_0x509b('0xe'),_0x509b('0x18')]},{'unique':!![],'name':'name_whatsapp','fields':[_0x509b('0xe'),_0x509b('0x19')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8965=['name_mail','MailAccountId','name_sms','SmsAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','util','api','moment','bluebird','path','rimraf','../../config/environment','./disposition.attributes','exports','define','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId'];(function(_0x6440b9,_0xb718f1){var _0x40e827=function(_0x13b5f9){while(--_0x13b5f9){_0x6440b9['push'](_0x6440b9['shift']());}};_0x40e827(++_0xb718f1);}(_0x8965,0x1e8));var _0x5896=function(_0x3404c2,_0x3941e2){_0x3404c2=_0x3404c2-0x0;var _0x1a581d=_0x8965[_0x3404c2];return _0x1a581d;};'use strict';var _=require('lodash');var util=require(_0x5896('0x0'));var logger=require('../../config/logger')(_0x5896('0x1'));var moment=require(_0x5896('0x2'));var BPromise=require(_0x5896('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5896('0x4'));var rimraf=require(_0x5896('0x5'));var config=require(_0x5896('0x6'));var attributes=require(_0x5896('0x7'));module[_0x5896('0x8')]=function(_0x2ebefa,_0x4216d5){return _0x2ebefa[_0x5896('0x9')]('Disposition',attributes,{'tableName':_0x5896('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x5896('0xb'),'fields':[_0x5896('0xc'),_0x5896('0xd')]},{'unique':!![],'name':_0x5896('0xe'),'fields':[_0x5896('0xc'),_0x5896('0xf')]},{'unique':!![],'name':_0x5896('0x10'),'fields':[_0x5896('0xc'),_0x5896('0x11')]},{'unique':!![],'name':_0x5896('0x12'),'fields':[_0x5896('0xc'),_0x5896('0x13')]},{'unique':!![],'name':'name_fax','fields':['name','FaxAccountId']},{'unique':!![],'name':_0x5896('0x14'),'fields':['name',_0x5896('0x15')]},{'unique':!![],'name':_0x5896('0x16'),'fields':[_0x5896('0xc'),_0x5896('0x17')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 13e4f10..132bb3d 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(_0x22071f,_0x4ad335){var _0x1e6509=function(_0x2994ab){while(--_0x2994ab){_0x22071f['push'](_0x22071f['shift']());}};_0x1e6509(++_0x4ad335);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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(_0x1d1321,_0x1ff4da){var _0x55a35b=function(_0x5ad913){while(--_0x5ad913){_0x1d1321['push'](_0x1d1321['shift']());}};_0x55a35b(++_0x1ff4da);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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 d78fa2c..17f826d 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 _0x0f6d=['index','/:id','show','post','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./disposition.controller','get','isAuthenticated'];(function(_0x4bfced,_0x5c9468){var _0x170fd5=function(_0x1b3bda){while(--_0x1b3bda){_0x4bfced['push'](_0x4bfced['shift']());}};_0x170fd5(++_0x5c9468);}(_0x0f6d,0x6c));var _0xd0f6=function(_0x1aed80,_0x3ca6f6){_0x1aed80=_0x1aed80-0x0;var _0x43961e=_0x0f6d[_0x1aed80];return _0x43961e;};'use strict';var multer=require(_0xd0f6('0x0'));var util=require(_0xd0f6('0x1'));var path=require(_0xd0f6('0x2'));var timeout=require(_0xd0f6('0x3'));var express=require(_0xd0f6('0x4'));var router=express['Router']();var fs_extra=require(_0xd0f6('0x5'));var auth=require(_0xd0f6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd0f6('0x7'));var controller=require(_0xd0f6('0x8'));router[_0xd0f6('0x9')]('/',auth[_0xd0f6('0xa')](),controller[_0xd0f6('0xb')]);router[_0xd0f6('0x9')](_0xd0f6('0xc'),auth[_0xd0f6('0xa')](),controller[_0xd0f6('0xd')]);router[_0xd0f6('0xe')]('/',auth[_0xd0f6('0xa')](),controller['create']);router['put'](_0xd0f6('0xc'),auth[_0xd0f6('0xa')](),controller['update']);router[_0xd0f6('0xf')](_0xd0f6('0xc'),auth[_0xd0f6('0xa')](),controller['destroy']);module[_0xd0f6('0x10')]=router; \ No newline at end of file +var _0xaed7=['util','express','Router','../../components/auth/service','./disposition.controller','isAuthenticated','index','get','show','post','create','put','update','delete','/:id','destroy','exports'];(function(_0x21ce2c,_0x4453e7){var _0x468691=function(_0x265e61){while(--_0x265e61){_0x21ce2c['push'](_0x21ce2c['shift']());}};_0x468691(++_0x4453e7);}(_0xaed7,0x88));var _0x7aed=function(_0x243eab,_0x4b9c97){_0x243eab=_0x243eab-0x0;var _0x5044d4=_0xaed7[_0x243eab];return _0x5044d4;};'use strict';var multer=require('multer');var util=require(_0x7aed('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7aed('0x1'));var router=express[_0x7aed('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x7aed('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7aed('0x4'));router['get']('/',auth[_0x7aed('0x5')](),controller[_0x7aed('0x6')]);router[_0x7aed('0x7')]('/:id',auth[_0x7aed('0x5')](),controller[_0x7aed('0x8')]);router[_0x7aed('0x9')]('/',auth[_0x7aed('0x5')](),controller[_0x7aed('0xa')]);router[_0x7aed('0xb')]('/:id',auth[_0x7aed('0x5')](),controller[_0x7aed('0xc')]);router[_0x7aed('0xd')](_0x7aed('0xe'),auth[_0x7aed('0x5')](),controller[_0x7aed('0xf')]);module[_0x7aed('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 9a425fc..8f4a5a9 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 _0x0458=['v17,v27,v29','INTEGER','SIP','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','7200','9600','4800','12000','14400'];(function(_0x37b327,_0x47b877){var _0x184e2f=function(_0x5d692d){while(--_0x5d692d){_0x37b327['push'](_0x37b327['shift']());}};_0x184e2f(++_0x47b877);}(_0x0458,0x16b));var _0x8045=function(_0x557796,_0x439ba4){_0x557796=_0x557796-0x0;var _0x1f5397=_0x0458[_0x557796];return _0x1f5397;};'use strict';var Sequelize=require(_0x8045('0x0'));module[_0x8045('0x1')]={'name':{'type':Sequelize[_0x8045('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x8045('0x3')](_0x8045('0x4'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x8045('0x2')],'defaultValue':_0x8045('0x5')},'localstationid':{'type':Sequelize[_0x8045('0x2')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x8045('0x3')]('2400','4800',_0x8045('0x6'),_0x8045('0x7'),'12000','14400'),'defaultValue':_0x8045('0x8')},'maxrate':{'type':Sequelize['ENUM']('2400',_0x8045('0x8'),_0x8045('0x6'),_0x8045('0x7'),_0x8045('0x9'),_0x8045('0xa')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x8045('0x2')],'defaultValue':_0x8045('0xb')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x8045('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x8045('0xd'),'IAX',_0x8045('0xe'),_0x8045('0xf')),'defaultValue':_0x8045('0xd')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x8045('0x10')],'defaultValue':function(){return _0x8045('0x11');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8045('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8045('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8045('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8045('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8045('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8045('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x8045('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x8045('0x12')],'defaultValue':![],'comment':_0x8045('0x14'),'set':function(_0x2d7cb8){if(!_0x2d7cb8)this[_0x8045('0x15')]('mandatoryDispositionPauseId',null);this[_0x8045('0x15')]('mandatoryDisposition',_0x2d7cb8);}}}; \ No newline at end of file +var _0xccce=['v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','setDataValue','sequelize','STRING','yes','4800','7200','9600','12000','14400','ENUM','2400'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0xccce,0x89));var _0xeccc=function(_0x18bdb2,_0x35073d){_0x18bdb2=_0x18bdb2-0x0;var _0x127f4e=_0xccce[_0x18bdb2];return _0x127f4e;};'use strict';var Sequelize=require(_0xeccc('0x0'));module['exports']={'name':{'type':Sequelize[_0xeccc('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize['ENUM'](_0xeccc('0x2'),'no'),'defaultValue':_0xeccc('0x2')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0xeccc('0x1')],'unique':'localstationid'},'minrate':{'type':Sequelize['ENUM']('2400',_0xeccc('0x3'),_0xeccc('0x4'),_0xeccc('0x5'),_0xeccc('0x6'),_0xeccc('0x7')),'defaultValue':_0xeccc('0x3')},'maxrate':{'type':Sequelize[_0xeccc('0x8')](_0xeccc('0x9'),_0xeccc('0x3'),_0xeccc('0x4'),'9600','12000',_0xeccc('0x7')),'defaultValue':_0xeccc('0x7')},'modem':{'type':Sequelize[_0xeccc('0x1')],'defaultValue':_0xeccc('0xa')},'gateway':{'type':Sequelize[_0xeccc('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xeccc('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xeccc('0x8')](_0xeccc('0xc'),_0xeccc('0xd'),_0xeccc('0xe'),_0xeccc('0xf')),'defaultValue':_0xeccc('0xc')},'key':{'type':Sequelize[_0xeccc('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xeccc('0x10');}},'notificationSound':{'type':Sequelize[_0xeccc('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xeccc('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xeccc('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xeccc('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xeccc('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xeccc('0xb')],'allowNull':!![],'defaultValue':null,'comment':_0xeccc('0x12')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x28897f){if(!_0x28897f)this['setDataValue'](_0xeccc('0x13'),null);this[_0xeccc('0x14')]('mandatoryDisposition',_0x28897f);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index e075303..5ed1ac0 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 _0x9efd=['apply','reject','save','get','FaxAccounts','UserProfileResource','destroy','stack','name','send','index','map','FaxAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','merge','includeAll','findAll','rows','show','Pause','mandatoryDispositionPause','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','addDisposition','FaxAccountId','Disposition','rawAttributes','sort','filter','removeDispositions','addAnswer','CannedAnswer','getAnswers','findOne','pick','include','removeAnswers','ids','addInteraction','FaxInteraction','omit','getInteractions','CmContact','User','fullname','internal','Tag','Tags','tag','addApplications','sequelize','transaction','FaxApplication','priority','getApplications','from-voip-provider','exten','localstationid','system','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','modem','t38timeout','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','bulkCreate','updateAccountApplications','VoiceExtension','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','DESC','attachments','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','Contacts','defaults','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','user','spread','ContactId','dataValues','Messages','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range'];(function(_0x73925c,_0x3deeef){var _0x4675f3=function(_0x1f2cc0){while(--_0x1f2cc0){_0x73925c['push'](_0x73925c['shift']());}};_0x4675f3(++_0x3deeef);}(_0x9efd,0x90));var _0xd9ef=function(_0x4cd70f,_0x1052a9){_0x4cd70f=_0x4cd70f-0x0;var _0x40a330=_0x9efd[_0x4cd70f];return _0x40a330;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd9ef('0x0'));var zipdir=require(_0xd9ef('0x1'));var jsonpatch=require(_0xd9ef('0x2'));var rp=require(_0xd9ef('0x3'));var moment=require(_0xd9ef('0x4'));var BPromise=require(_0xd9ef('0x5'));var Mustache=require(_0xd9ef('0x6'));var util=require(_0xd9ef('0x7'));var path=require(_0xd9ef('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd9ef('0x9'));var fs=require('fs');var fs_extra=require(_0xd9ef('0xa'));var _=require(_0xd9ef('0xb'));var squel=require(_0xd9ef('0xc'));var crypto=require(_0xd9ef('0xd'));var jsforce=require(_0xd9ef('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd9ef('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd9ef('0x10'));var authService=require(_0xd9ef('0x11'));var qs=require(_0xd9ef('0x12'));var as=require(_0xd9ef('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd9ef('0x14'))(_0xd9ef('0x15'));var utils=require(_0xd9ef('0x16'));var config=require(_0xd9ef('0x17'));var licenseUtil=require(_0xd9ef('0x18'));var db=require(_0xd9ef('0x19'))['db'];config[_0xd9ef('0x1a')]=_['defaults'](config[_0xd9ef('0x1a')],{'host':_0xd9ef('0x1b'),'port':0x18eb});var socket=require(_0xd9ef('0x1c'))(new Redis(config[_0xd9ef('0x1a')]));require(_0xd9ef('0x1d'))[_0xd9ef('0x1e')](socket);var jayson=require(_0xd9ef('0x1f'));var client=jayson[_0xd9ef('0x20')][_0xd9ef('0x21')]({'port':0x232c});var client9002=jayson[_0xd9ef('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bc14b,_0x3d7849,_0x9d547f,_0x29ac4d){return new BPromise(function(_0x236a2a,_0x1504e3){var _0x41f7be=_0x29ac4d||client;return _0x41f7be[_0xd9ef('0x22')](_0x1bc14b,_0x9d547f)[_0xd9ef('0x23')](function(_0x3d2d2f){logger['info'](_0xd9ef('0x24'),_0x3d7849,_0xd9ef('0x25'));logger[_0xd9ef('0x26')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x3d7849,_0xd9ef('0x25'),JSON['stringify'](_0x3d2d2f));if(_0x3d2d2f['error']){if(_0x3d2d2f[_0xd9ef('0x27')][_0xd9ef('0x28')]===0x1f4){logger[_0xd9ef('0x27')]('FaxAccount,\x20%s,\x20%s',_0x3d7849,_0x3d2d2f[_0xd9ef('0x27')][_0xd9ef('0x29')]);return _0x1504e3(_0x3d2d2f[_0xd9ef('0x27')]['message']);}logger['error'](_0xd9ef('0x24'),_0x3d7849,_0x3d2d2f[_0xd9ef('0x27')][_0xd9ef('0x29')]);return _0x236a2a(_0x3d2d2f[_0xd9ef('0x27')][_0xd9ef('0x29')]);}else{logger[_0xd9ef('0x2a')](_0xd9ef('0x24'),_0x3d7849,'request\x20sent');_0x236a2a(_0x3d2d2f[_0xd9ef('0x2b')][_0xd9ef('0x29')]);}})[_0xd9ef('0x2c')](function(_0x5902f4){logger[_0xd9ef('0x27')](_0xd9ef('0x24'),_0x3d7849,_0x5902f4);_0x1504e3(_0x5902f4);});});}function respondWithStatusCode(_0x350d67,_0x4e6854){_0x4e6854=_0x4e6854||0xcc;return function(_0x112262){if(_0x112262){return _0x350d67[_0xd9ef('0x2d')](_0x4e6854);}return _0x350d67[_0xd9ef('0x2e')](_0x4e6854)[_0xd9ef('0x2f')]();};}function respondWithResult(_0x481dac,_0x5404f7){_0x5404f7=_0x5404f7||0xc8;return function(_0x4b8141){if(_0x4b8141){return _0x481dac[_0xd9ef('0x2e')](_0x5404f7)[_0xd9ef('0x30')](_0x4b8141);}};}function respondWithFilteredResult(_0x88a319,_0x34289d){return function(_0x27d979){if(_0x27d979){var _0x2bf005=typeof _0x34289d[_0xd9ef('0x31')]==='undefined'&&typeof _0x34289d['limit']===_0xd9ef('0x32');var _0x273f73=_0x27d979[_0xd9ef('0x33')];var _0x2c6dbf=_0x2bf005?0x0:_0x34289d[_0xd9ef('0x31')];var _0x38ca82=_0x2bf005?_0x27d979[_0xd9ef('0x33')]:_0x34289d['offset']+_0x34289d[_0xd9ef('0x34')];var _0x13c857;if(_0x38ca82>=_0x273f73){_0x38ca82=_0x273f73;_0x13c857=0xc8;}else{_0x13c857=0xce;}_0x88a319['status'](_0x13c857);return _0x88a319['set'](_0xd9ef('0x35'),_0x2c6dbf+'-'+_0x38ca82+'/'+_0x273f73)[_0xd9ef('0x30')](_0x27d979);}return null;};}function patchUpdates(_0x15e5dc){return function(_0xd1897c){try{jsonpatch[_0xd9ef('0x36')](_0xd1897c,_0x15e5dc,!![]);}catch(_0x324f6b){return BPromise[_0xd9ef('0x37')](_0x324f6b);}return _0xd1897c[_0xd9ef('0x38')]();};}function saveUpdates(_0x3df93a,_0xbd86b1){return function(_0x38a1ae){if(_0x38a1ae){return _0x38a1ae['update'](_0x3df93a)[_0xd9ef('0x23')](function(_0x30088f){return _0x30088f;});}return null;};}function removeEntity(_0x196ef7,_0x417c9b){return function(_0x2eb860){if(_0x2eb860){return _0x2eb860['destroy']()[_0xd9ef('0x23')](function(){var _0x725fa6=_0x2eb860[_0xd9ef('0x39')]({'plain':!![]});var _0x382693=_0xd9ef('0x3a');return db[_0xd9ef('0x3b')][_0xd9ef('0x3c')]({'where':{'type':_0x382693,'resourceId':_0x725fa6['id']}})['then'](function(){return _0x2eb860;});})[_0xd9ef('0x23')](function(){_0x196ef7[_0xd9ef('0x2e')](0xcc)[_0xd9ef('0x2f')]();});}};}function handleEntityNotFound(_0x36c80f,_0x530e9a){return function(_0x4fc7da){if(!_0x4fc7da){_0x36c80f[_0xd9ef('0x2d')](0x194);}return _0x4fc7da;};}function handleError(_0x54bcc4,_0x28dfde){_0x28dfde=_0x28dfde||0x1f4;return function(_0x6e83fc){logger[_0xd9ef('0x27')](_0x6e83fc[_0xd9ef('0x3d')]);if(_0x6e83fc[_0xd9ef('0x3e')]){delete _0x6e83fc[_0xd9ef('0x3e')];}_0x54bcc4[_0xd9ef('0x2e')](_0x28dfde)[_0xd9ef('0x3f')](_0x6e83fc);};}exports[_0xd9ef('0x40')]=function(_0x27ed21,_0x12479c){var _0x5ac60b={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x482011={},_0x16e652={'count':0x0,'rows':[]};var _0x3c556e=_[_0xd9ef('0x41')](db[_0xd9ef('0x42')]['rawAttributes'],function(_0x4c8714){return{'name':_0x4c8714[_0xd9ef('0x43')],'type':_0x4c8714[_0xd9ef('0x44')][_0xd9ef('0x45')]};});_0x482011[_0xd9ef('0x46')]=_['map'](_0x3c556e,'name');_0x482011[_0xd9ef('0x47')]=_[_0xd9ef('0x48')](_0x27ed21[_0xd9ef('0x47')]);_0x482011[_0xd9ef('0x49')]=_[_0xd9ef('0x4a')](_0x482011[_0xd9ef('0x46')],_0x482011['query']);_0x5ac60b[_0xd9ef('0x4b')]=_[_0xd9ef('0x4a')](_0x482011['model'],qs['fields'](_0x27ed21['query'][_0xd9ef('0x4c')]));_0x5ac60b[_0xd9ef('0x4b')]=_0x5ac60b[_0xd9ef('0x4b')][_0xd9ef('0x4d')]?_0x5ac60b[_0xd9ef('0x4b')]:_0x482011[_0xd9ef('0x46')];if(!_0x27ed21[_0xd9ef('0x47')][_0xd9ef('0x4e')](_0xd9ef('0x4f'))){_0x5ac60b['limit']=qs[_0xd9ef('0x34')](_0x27ed21[_0xd9ef('0x47')][_0xd9ef('0x34')]);_0x5ac60b[_0xd9ef('0x31')]=qs[_0xd9ef('0x31')](_0x27ed21[_0xd9ef('0x47')][_0xd9ef('0x31')]);}_0x5ac60b[_0xd9ef('0x50')]=qs['sort'](_0x27ed21[_0xd9ef('0x47')]['sort']);_0x5ac60b[_0xd9ef('0x51')]=qs[_0xd9ef('0x49')](_['pick'](_0x27ed21[_0xd9ef('0x47')],_0x482011[_0xd9ef('0x49')]),_0x3c556e);if(_0x27ed21['query']['filter']){_0x5ac60b[_0xd9ef('0x51')]=_[_0xd9ef('0x52')](_0x5ac60b[_0xd9ef('0x51')],{'$or':_[_0xd9ef('0x41')](_0x3c556e,function(_0x5f7d){if(_0x5f7d[_0xd9ef('0x44')]!=='VIRTUAL'){var _0x99739b={};_0x99739b[_0x5f7d[_0xd9ef('0x3e')]]={'$like':'%'+_0x27ed21['query']['filter']+'%'};return _0x99739b;}})});}_0x5ac60b=_[_0xd9ef('0x52')]({},_0x5ac60b,_0x27ed21['options']);var _0x4b9766={'where':_0x5ac60b[_0xd9ef('0x51')]};return db[_0xd9ef('0x42')]['count'](_0x4b9766)['then'](function(_0x20e889){_0x16e652[_0xd9ef('0x33')]=_0x20e889;if(_0x27ed21['query'][_0xd9ef('0x53')]){_0x5ac60b['include']=[{'all':!![]}];}return db[_0xd9ef('0x42')][_0xd9ef('0x54')](_0x5ac60b);})[_0xd9ef('0x23')](function(_0x246487){_0x16e652[_0xd9ef('0x55')]=_0x246487;return _0x16e652;})[_0xd9ef('0x23')](respondWithFilteredResult(_0x12479c,_0x5ac60b))[_0xd9ef('0x2c')](handleError(_0x12479c,null));};exports[_0xd9ef('0x56')]=function(_0x465c87,_0x52b9e0){var _0x117320={'raw':![],'where':{'id':_0x465c87['params']['id']},'include':[{'model':db[_0xd9ef('0x57')],'as':_0xd9ef('0x58')}]},_0x23c4ab={};_0x23c4ab['model']=_[_0xd9ef('0x48')](db['FaxAccount']['rawAttributes']);_0x23c4ab['query']=_[_0xd9ef('0x48')](_0x465c87[_0xd9ef('0x47')]);_0x23c4ab[_0xd9ef('0x49')]=_[_0xd9ef('0x4a')](_0x23c4ab[_0xd9ef('0x46')],_0x23c4ab['query']);_0x117320[_0xd9ef('0x4b')]=_[_0xd9ef('0x4a')](_0x23c4ab[_0xd9ef('0x46')],qs[_0xd9ef('0x4c')](_0x465c87[_0xd9ef('0x47')][_0xd9ef('0x4c')]));_0x117320[_0xd9ef('0x4b')]=_0x117320[_0xd9ef('0x4b')]['length']?_0x117320[_0xd9ef('0x4b')]:_0x23c4ab[_0xd9ef('0x46')];if(_0x465c87[_0xd9ef('0x47')][_0xd9ef('0x53')]){_0x117320['include']=[{'all':!![]}];}_0x117320=_[_0xd9ef('0x52')]({},_0x117320,_0x465c87[_0xd9ef('0x59')]);return db[_0xd9ef('0x42')][_0xd9ef('0x5a')](_0x117320)[_0xd9ef('0x23')](handleEntityNotFound(_0x52b9e0,null))[_0xd9ef('0x23')](respondWithResult(_0x52b9e0,null))['catch'](handleError(_0x52b9e0,null));};exports['create']=function(_0x4198ca,_0x4d73f7){return db[_0xd9ef('0x42')][_0xd9ef('0x5b')](_0x4198ca[_0xd9ef('0x5c')],{})[_0xd9ef('0x23')](function(_0x1df6f4){var _0x2a7215=_0x4198ca['user'][_0xd9ef('0x39')]({'plain':!![]});if(!_0x2a7215)throw new Error(_0xd9ef('0x5d'));if(_0x2a7215[_0xd9ef('0x5e')]==='user'){var _0x9b1398=_0x1df6f4[_0xd9ef('0x39')]({'plain':!![]});var _0x40ffdd=_0xd9ef('0x3a');return db['UserProfileSection'][_0xd9ef('0x5a')]({'where':{'name':_0x40ffdd,'userProfileId':_0x2a7215[_0xd9ef('0x5f')]},'raw':!![]})['then'](function(_0x564b8b){if(_0x564b8b&&_0x564b8b[_0xd9ef('0x60')]===0x0){return db[_0xd9ef('0x3b')][_0xd9ef('0x5b')]({'name':_0x9b1398[_0xd9ef('0x3e')],'resourceId':_0x9b1398['id'],'type':_0x564b8b[_0xd9ef('0x3e')],'sectionId':_0x564b8b['id']},{})['then'](function(){return _0x1df6f4;});}else{return _0x1df6f4;}})[_0xd9ef('0x2c')](function(_0x155b7e){logger[_0xd9ef('0x27')](_0xd9ef('0x61'),_0x155b7e);throw _0x155b7e;});}return _0x1df6f4;})[_0xd9ef('0x23')](respondWithResult(_0x4d73f7,0xc9))['catch'](handleError(_0x4d73f7,null));};exports[_0xd9ef('0x62')]=function(_0x2819d7,_0x8b0790){if(_0x2819d7[_0xd9ef('0x5c')]['id']){delete _0x2819d7[_0xd9ef('0x5c')]['id'];}return db[_0xd9ef('0x42')][_0xd9ef('0x5a')]({'where':{'id':_0x2819d7[_0xd9ef('0x63')]['id']},'include':[{'model':db[_0xd9ef('0x57')],'as':_0xd9ef('0x58')}]})[_0xd9ef('0x23')](handleEntityNotFound(_0x8b0790,null))[_0xd9ef('0x23')](saveUpdates(_0x2819d7[_0xd9ef('0x5c')],null))['then'](respondWithResult(_0x8b0790,null))['catch'](handleError(_0x8b0790,null));};exports[_0xd9ef('0x3c')]=function(_0x3a13da,_0x18402d){return db[_0xd9ef('0x42')]['find']({'where':{'id':_0x3a13da['params']['id']}})[_0xd9ef('0x23')](handleEntityNotFound(_0x18402d,null))[_0xd9ef('0x23')](removeEntity(_0x18402d,null))[_0xd9ef('0x2c')](handleError(_0x18402d,null));};exports['describe']=function(_0x71a20f,_0x3d00d0){return db[_0xd9ef('0x42')][_0xd9ef('0x64')]()[_0xd9ef('0x23')](respondWithResult(_0x3d00d0,null))[_0xd9ef('0x2c')](handleError(_0x3d00d0,null));};exports[_0xd9ef('0x65')]=function(_0x58a2c8,_0x2247b9,_0x37c475){if(_0x58a2c8[_0xd9ef('0x5c')]['id']){delete _0x58a2c8[_0xd9ef('0x5c')]['id'];}return db[_0xd9ef('0x42')]['find']({'where':{'id':_0x58a2c8['params']['id']}})['then'](handleEntityNotFound(_0x2247b9,null))[_0xd9ef('0x23')](function(_0x5cbd9c){if(_0x5cbd9c){_0x58a2c8[_0xd9ef('0x5c')][_0xd9ef('0x66')]=_0x5cbd9c['id'];return db['Disposition'][_0xd9ef('0x5b')](_0x58a2c8[_0xd9ef('0x5c')]);}})['then'](respondWithResult(_0x2247b9,null))[_0xd9ef('0x2c')](handleError(_0x2247b9,null));};exports['getDispositions']=function(_0x5338bf,_0x310d28,_0x174bb0){var _0x5698c7={'raw':![],'where':{}};var _0x13fced={};var _0x88db9a={'count':0x0,'rows':[]};return db[_0xd9ef('0x42')]['findOne']({'where':{'id':_0x5338bf[_0xd9ef('0x63')]['id']}})[_0xd9ef('0x23')](handleEntityNotFound(_0x310d28,null))[_0xd9ef('0x23')](function(_0x480051){if(_0x480051){_0x13fced['model']=_[_0xd9ef('0x48')](db[_0xd9ef('0x67')][_0xd9ef('0x68')]);_0x13fced['query']=_[_0xd9ef('0x48')](_0x5338bf['query']);_0x13fced['filters']=_[_0xd9ef('0x4a')](_0x13fced[_0xd9ef('0x46')],_0x13fced[_0xd9ef('0x47')]);_0x5698c7[_0xd9ef('0x4b')]=_[_0xd9ef('0x4a')](_0x13fced[_0xd9ef('0x46')],qs[_0xd9ef('0x4c')](_0x5338bf['query'][_0xd9ef('0x4c')]));_0x5698c7[_0xd9ef('0x4b')]=_0x5698c7[_0xd9ef('0x4b')][_0xd9ef('0x4d')]?_0x5698c7[_0xd9ef('0x4b')]:_0x13fced['model'];if(!_0x5338bf['query'][_0xd9ef('0x4e')](_0xd9ef('0x4f'))){_0x5698c7[_0xd9ef('0x34')]=qs[_0xd9ef('0x34')](_0x5338bf[_0xd9ef('0x47')][_0xd9ef('0x34')]);_0x5698c7['offset']=qs['offset'](_0x5338bf[_0xd9ef('0x47')][_0xd9ef('0x31')]);}_0x5698c7[_0xd9ef('0x50')]=qs[_0xd9ef('0x69')](_0x5338bf[_0xd9ef('0x47')][_0xd9ef('0x69')]);_0x5698c7[_0xd9ef('0x51')]=qs[_0xd9ef('0x49')](_['pick'](_0x5338bf[_0xd9ef('0x47')],_0x13fced[_0xd9ef('0x49')]));_0x5698c7[_0xd9ef('0x51')][_0xd9ef('0x66')]=_0x480051['id'];if(_0x5338bf[_0xd9ef('0x47')][_0xd9ef('0x6a')]){_0x5698c7[_0xd9ef('0x51')]=_[_0xd9ef('0x52')](_0x5698c7[_0xd9ef('0x51')],{'$or':_[_0xd9ef('0x41')](_0x5698c7[_0xd9ef('0x4b')],function(_0x5296ec){var _0x9972d={};_0x9972d[_0x5296ec]={'$like':'%'+_0x5338bf[_0xd9ef('0x47')][_0xd9ef('0x6a')]+'%'};return _0x9972d;})});}_0x5698c7=_[_0xd9ef('0x52')]({},_0x5698c7,_0x5338bf[_0xd9ef('0x59')]);return db[_0xd9ef('0x67')][_0xd9ef('0x33')]({'where':_0x5698c7[_0xd9ef('0x51')]})[_0xd9ef('0x23')](function(_0x480408){_0x88db9a[_0xd9ef('0x33')]=_0x480408;if(_0x5338bf['query']['includeAll']){_0x5698c7['include']=[{'all':!![]}];}return db['Disposition'][_0xd9ef('0x54')](_0x5698c7);})[_0xd9ef('0x23')](function(_0xbfbc89){_0x88db9a['rows']=_0xbfbc89;return _0x88db9a;});}})[_0xd9ef('0x23')](respondWithFilteredResult(_0x310d28,_0x5698c7))['catch'](handleError(_0x310d28,null));};exports[_0xd9ef('0x6b')]=function(_0x50468b,_0x2230f8,_0x319280){return db[_0xd9ef('0x42')][_0xd9ef('0x5a')]({'where':{'id':_0x50468b[_0xd9ef('0x63')]['id']}})[_0xd9ef('0x23')](handleEntityNotFound(_0x2230f8,null))['then'](function(_0x1f5206){if(_0x1f5206){return _0x1f5206[_0xd9ef('0x6b')](_0x50468b[_0xd9ef('0x47')]['ids']);}})[_0xd9ef('0x23')](respondWithStatusCode(_0x2230f8,null))[_0xd9ef('0x2c')](handleError(_0x2230f8,null));};exports[_0xd9ef('0x6c')]=function(_0x398664,_0x337a53,_0x13ee51){if(_0x398664[_0xd9ef('0x5c')]['id']){delete _0x398664['body']['id'];}return db[_0xd9ef('0x42')]['find']({'where':{'id':_0x398664[_0xd9ef('0x63')]['id']}})[_0xd9ef('0x23')](handleEntityNotFound(_0x337a53,null))[_0xd9ef('0x23')](function(_0x50e9f3){if(_0x50e9f3){_0x398664['body'][_0xd9ef('0x66')]=_0x50e9f3['id'];return db[_0xd9ef('0x6d')][_0xd9ef('0x5b')](_0x398664[_0xd9ef('0x5c')]);}})['then'](respondWithResult(_0x337a53,null))[_0xd9ef('0x2c')](handleError(_0x337a53,null));};exports[_0xd9ef('0x6e')]=function(_0x5d73aa,_0x28862b,_0x19a0c0){var _0x1b2791={'raw':![],'where':{}};var _0x16f66e={};var _0x3bb655={'count':0x0,'rows':[]};return db[_0xd9ef('0x42')][_0xd9ef('0x6f')]({'where':{'id':_0x5d73aa[_0xd9ef('0x63')]['id']}})[_0xd9ef('0x23')](handleEntityNotFound(_0x28862b,null))[_0xd9ef('0x23')](function(_0x434e01){if(_0x434e01){_0x16f66e[_0xd9ef('0x46')]=_[_0xd9ef('0x48')](db['CannedAnswer']['rawAttributes']);_0x16f66e['query']=_[_0xd9ef('0x48')](_0x5d73aa[_0xd9ef('0x47')]);_0x16f66e[_0xd9ef('0x49')]=_[_0xd9ef('0x4a')](_0x16f66e[_0xd9ef('0x46')],_0x16f66e[_0xd9ef('0x47')]);_0x1b2791['attributes']=_[_0xd9ef('0x4a')](_0x16f66e['model'],qs[_0xd9ef('0x4c')](_0x5d73aa[_0xd9ef('0x47')][_0xd9ef('0x4c')]));_0x1b2791['attributes']=_0x1b2791[_0xd9ef('0x4b')][_0xd9ef('0x4d')]?_0x1b2791[_0xd9ef('0x4b')]:_0x16f66e[_0xd9ef('0x46')];if(!_0x5d73aa[_0xd9ef('0x47')]['hasOwnProperty'](_0xd9ef('0x4f'))){_0x1b2791[_0xd9ef('0x34')]=qs[_0xd9ef('0x34')](_0x5d73aa[_0xd9ef('0x47')]['limit']);_0x1b2791['offset']=qs['offset'](_0x5d73aa[_0xd9ef('0x47')]['offset']);}_0x1b2791[_0xd9ef('0x50')]=qs['sort'](_0x5d73aa[_0xd9ef('0x47')]['sort']);_0x1b2791[_0xd9ef('0x51')]=qs[_0xd9ef('0x49')](_[_0xd9ef('0x70')](_0x5d73aa[_0xd9ef('0x47')],_0x16f66e[_0xd9ef('0x49')]));_0x1b2791[_0xd9ef('0x51')][_0xd9ef('0x66')]=_0x434e01['id'];if(_0x5d73aa[_0xd9ef('0x47')]['filter']){_0x1b2791['where']=_[_0xd9ef('0x52')](_0x1b2791[_0xd9ef('0x51')],{'$or':_[_0xd9ef('0x41')](_0x1b2791[_0xd9ef('0x4b')],function(_0x43f401){var _0x38e91b={};_0x38e91b[_0x43f401]={'$like':'%'+_0x5d73aa[_0xd9ef('0x47')][_0xd9ef('0x6a')]+'%'};return _0x38e91b;})});}_0x1b2791=_[_0xd9ef('0x52')]({},_0x1b2791,_0x5d73aa['options']);return db[_0xd9ef('0x6d')][_0xd9ef('0x33')]({'where':_0x1b2791[_0xd9ef('0x51')]})[_0xd9ef('0x23')](function(_0x4d8287){_0x3bb655[_0xd9ef('0x33')]=_0x4d8287;if(_0x5d73aa[_0xd9ef('0x47')][_0xd9ef('0x53')]){_0x1b2791[_0xd9ef('0x71')]=[{'all':!![]}];}return db[_0xd9ef('0x6d')][_0xd9ef('0x54')](_0x1b2791);})[_0xd9ef('0x23')](function(_0x4bd264){_0x3bb655[_0xd9ef('0x55')]=_0x4bd264;return _0x3bb655;});}})[_0xd9ef('0x23')](respondWithFilteredResult(_0x28862b,_0x1b2791))[_0xd9ef('0x2c')](handleError(_0x28862b,null));};exports['removeAnswers']=function(_0x15536b,_0x213d4d,_0x314aa0){return db[_0xd9ef('0x42')][_0xd9ef('0x5a')]({'where':{'id':_0x15536b['params']['id']}})[_0xd9ef('0x23')](handleEntityNotFound(_0x213d4d,null))[_0xd9ef('0x23')](function(_0x25f4c3){if(_0x25f4c3){return _0x25f4c3[_0xd9ef('0x72')](_0x15536b[_0xd9ef('0x47')][_0xd9ef('0x73')]);}})['then'](respondWithStatusCode(_0x213d4d,null))['catch'](handleError(_0x213d4d,null));};exports[_0xd9ef('0x74')]=function(_0x1b1c42,_0x40c123,_0x333adc){return db[_0xd9ef('0x75')]['find']({'where':{'id':_0x1b1c42['params']['id']}})[_0xd9ef('0x23')](handleEntityNotFound(_0x40c123,null))['then'](function(_0x99ae3){if(_0x99ae3){return _0x99ae3[_0xd9ef('0x74')](_0x1b1c42[_0xd9ef('0x5c')]['ids'],_[_0xd9ef('0x76')](_0x1b1c42[_0xd9ef('0x5c')],[_0xd9ef('0x73'),'id'])||{});}})['then'](respondWithResult(_0x40c123,null))[_0xd9ef('0x2c')](handleError(_0x40c123,null));};exports[_0xd9ef('0x77')]=function(_0x75dd2a,_0x9b5b38,_0x316d97){var _0x531d55={'raw':![],'where':{}};var _0x37813e={};var _0x7018ed={'count':0x0,'rows':[]};return db[_0xd9ef('0x42')][_0xd9ef('0x6f')]({'where':{'id':_0x75dd2a[_0xd9ef('0x63')]['id']}})['then'](handleEntityNotFound(_0x9b5b38,null))['then'](function(_0x5718e0){if(_0x5718e0){_0x37813e[_0xd9ef('0x46')]=_[_0xd9ef('0x48')](db[_0xd9ef('0x75')]['rawAttributes']);_0x37813e[_0xd9ef('0x47')]=_['keys'](_0x75dd2a['query']);_0x37813e[_0xd9ef('0x49')]=_[_0xd9ef('0x4a')](_0x37813e[_0xd9ef('0x46')],_0x37813e['query']);_0x531d55['attributes']=_[_0xd9ef('0x4a')](_0x37813e[_0xd9ef('0x46')],qs[_0xd9ef('0x4c')](_0x75dd2a[_0xd9ef('0x47')][_0xd9ef('0x4c')]));_0x531d55[_0xd9ef('0x4b')]=_0x531d55[_0xd9ef('0x4b')]['length']?_0x531d55['attributes']:_0x37813e[_0xd9ef('0x46')];if(!_0x75dd2a[_0xd9ef('0x47')][_0xd9ef('0x4e')](_0xd9ef('0x4f'))){_0x531d55[_0xd9ef('0x34')]=qs['limit'](_0x75dd2a['query'][_0xd9ef('0x34')]);_0x531d55[_0xd9ef('0x31')]=qs['offset'](_0x75dd2a[_0xd9ef('0x47')][_0xd9ef('0x31')]);}_0x531d55[_0xd9ef('0x50')]=qs[_0xd9ef('0x69')](_0x75dd2a[_0xd9ef('0x47')][_0xd9ef('0x69')]);_0x531d55['where']=qs[_0xd9ef('0x49')](_[_0xd9ef('0x70')](_0x75dd2a[_0xd9ef('0x47')],_0x37813e[_0xd9ef('0x49')]));_0x531d55[_0xd9ef('0x51')][_0xd9ef('0x66')]=_0x5718e0['id'];if(_0x75dd2a[_0xd9ef('0x47')][_0xd9ef('0x6a')]){_0x531d55[_0xd9ef('0x51')]=_[_0xd9ef('0x52')](_0x531d55[_0xd9ef('0x51')],{'$or':_[_0xd9ef('0x41')](_0x531d55[_0xd9ef('0x4b')],function(_0x2bd63b){var _0xbfbaf1={};_0xbfbaf1[_0x2bd63b]={'$like':'%'+_0x75dd2a[_0xd9ef('0x47')][_0xd9ef('0x6a')]+'%'};return _0xbfbaf1;})});}_0x531d55=_['merge']({},_0x531d55,_0x75dd2a[_0xd9ef('0x59')]);return db[_0xd9ef('0x75')][_0xd9ef('0x33')]({'where':_0x531d55[_0xd9ef('0x51')]})[_0xd9ef('0x23')](function(_0x414ebf){_0x7018ed[_0xd9ef('0x33')]=_0x414ebf;if(_0x75dd2a['query'][_0xd9ef('0x53')]){_0x531d55[_0xd9ef('0x71')]=[{'model':db[_0xd9ef('0x78')],'as':'Contact','required':![]},{'model':db[_0xd9ef('0x79')],'as':'Owner','attributes':[_0xd9ef('0x3e'),_0xd9ef('0x7a'),_0xd9ef('0x7b')],'required':![]},{'model':db[_0xd9ef('0x7c')],'as':_0xd9ef('0x7d'),'attributes':['id',_0xd9ef('0x3e'),'color'],'where':_0x75dd2a[_0xd9ef('0x47')][_0xd9ef('0x7e')]?{'id':_0x75dd2a[_0xd9ef('0x47')]['tag']}:undefined,'required':_0x75dd2a[_0xd9ef('0x47')][_0xd9ef('0x7e')]?!![]:![]}];}return db[_0xd9ef('0x75')][_0xd9ef('0x54')](_0x531d55);})[_0xd9ef('0x23')](function(_0xb6ad33){_0x7018ed[_0xd9ef('0x55')]=_0xb6ad33;return _0x7018ed;});}})['then'](respondWithFilteredResult(_0x9b5b38,_0x531d55))[_0xd9ef('0x2c')](handleError(_0x9b5b38,null));};exports[_0xd9ef('0x7f')]=function(_0x537f40,_0x16bedc,_0x4ba3ea){return db[_0xd9ef('0x42')][_0xd9ef('0x6f')]({'where':{'id':_0x537f40[_0xd9ef('0x63')]['id']}})[_0xd9ef('0x23')](handleEntityNotFound(_0x16bedc,null))[_0xd9ef('0x23')](function(_0x13277c){if(_0x13277c){return db[_0xd9ef('0x80')][_0xd9ef('0x81')](function(_0x21e577){return db[_0xd9ef('0x82')][_0xd9ef('0x3c')]({'where':{'FaxAccountId':_0x537f40['params']['id']},'transaction':_0x21e577})[_0xd9ef('0x23')](function(_0x1c22c3){var _0x6b4b10=_['map'](_0x537f40[_0xd9ef('0x5c')],function(_0x537e77){_0x537e77[_0xd9ef('0x66')]=_0x537f40[_0xd9ef('0x63')]['id'];return _0x537e77;});return db[_0xd9ef('0x82')]['bulkCreate'](_0x6b4b10,{'transaction':_0x21e577});});})[_0xd9ef('0x23')](function(){return db[_0xd9ef('0x82')]['findAndCountAll']({'where':{'FaxAccountId':_0x537f40[_0xd9ef('0x63')]['id']},'order':_0xd9ef('0x83')});});}})[_0xd9ef('0x23')](respondWithResult(_0x16bedc,null))[_0xd9ef('0x2c')](handleError(_0x16bedc,null));};exports['getApplications']=function(_0x40f3fc,_0x1ce915,_0x5ad004){var _0xf0b6c4={};var _0x1acbf2={};var _0x5e0c61;var _0x2fd071;return db[_0xd9ef('0x42')]['findOne']({'where':{'id':_0x40f3fc[_0xd9ef('0x63')]['id']}})[_0xd9ef('0x23')](handleEntityNotFound(_0x1ce915,null))['then'](function(_0x6c8a75){if(_0x6c8a75){_0x5e0c61=_0x6c8a75;_0x1acbf2[_0xd9ef('0x46')]=_[_0xd9ef('0x48')](db['FaxApplication'][_0xd9ef('0x68')]);_0x1acbf2[_0xd9ef('0x47')]=_['keys'](_0x40f3fc[_0xd9ef('0x47')]);_0x1acbf2[_0xd9ef('0x49')]=_[_0xd9ef('0x4a')](_0x1acbf2[_0xd9ef('0x46')],_0x1acbf2[_0xd9ef('0x47')]);_0xf0b6c4['attributes']=_[_0xd9ef('0x4a')](_0x1acbf2[_0xd9ef('0x46')],qs[_0xd9ef('0x4c')](_0x40f3fc[_0xd9ef('0x47')][_0xd9ef('0x4c')]));_0xf0b6c4[_0xd9ef('0x4b')]=_0xf0b6c4['attributes'][_0xd9ef('0x4d')]?_0xf0b6c4[_0xd9ef('0x4b')]:_0x1acbf2['model'];_0xf0b6c4['order']=qs[_0xd9ef('0x69')](_0x40f3fc['query'][_0xd9ef('0x69')]);_0xf0b6c4[_0xd9ef('0x51')]=qs['filters'](_[_0xd9ef('0x70')](_0x40f3fc[_0xd9ef('0x47')],_0x1acbf2[_0xd9ef('0x49')]));if(_0x40f3fc['query'][_0xd9ef('0x6a')]){_0xf0b6c4['where']=_[_0xd9ef('0x52')](_0xf0b6c4['where'],{'$or':_[_0xd9ef('0x41')](_0xf0b6c4[_0xd9ef('0x4b')],function(_0x171ace){var _0x2e1568={};_0x2e1568[_0x171ace]={'$like':'%'+_0x40f3fc[_0xd9ef('0x47')]['filter']+'%'};return _0x2e1568;})});}_0xf0b6c4=_[_0xd9ef('0x52')]({},_0xf0b6c4,_0x40f3fc[_0xd9ef('0x59')]);return _0x5e0c61[_0xd9ef('0x84')](_0xf0b6c4);}})[_0xd9ef('0x23')](function(_0x12d144){if(_0x12d144){_0x2fd071=_0x12d144['length'];if(!_0x40f3fc[_0xd9ef('0x47')]['hasOwnProperty'](_0xd9ef('0x4f'))){_0xf0b6c4['limit']=qs[_0xd9ef('0x34')](_0x40f3fc[_0xd9ef('0x47')]['limit']);_0xf0b6c4[_0xd9ef('0x31')]=qs[_0xd9ef('0x31')](_0x40f3fc[_0xd9ef('0x47')]['offset']);}return _0x5e0c61[_0xd9ef('0x84')](_0xf0b6c4);}})[_0xd9ef('0x23')](function(_0x2a7388){if(_0x2a7388){return _0x2a7388?{'count':_0x2fd071,'rows':_0x2a7388}:null;}})[_0xd9ef('0x23')](respondWithResult(_0x1ce915,null))[_0xd9ef('0x2c')](handleError(_0x1ce915,null));};function Extension(_0xb780df,_0x2f915c,_0x2c665a,_0x5e3ee5){this['context']=_0xd9ef('0x85');this[_0xd9ef('0x86')]=_0xb780df[_0xd9ef('0x87')];this['app']=_0x5e3ee5;this[_0xd9ef('0x44')]=_0xd9ef('0x88');this[_0xd9ef('0x89')]=_0xd9ef('0x8a');this[_0xd9ef('0x66')]=_0xb780df['id'];this[_0xd9ef('0x83')]=_0x2f915c;this[_0xd9ef('0x8b')]=_0x2c665a;}function createExtensionsReciveFax(_0xdc8049){var _0x51d8b7=0x1;var _0x33f330=[];_0x33f330[_0xd9ef('0x8c')](new Extension(_0xdc8049,_0x51d8b7,'',_0xd9ef('0x8d')));_0x51d8b7+=0x1;_0x33f330[_0xd9ef('0x8c')](new Extension(_0xdc8049,_0x51d8b7,_0xd9ef('0x8e'),_0xd9ef('0x8f')));_0x51d8b7+=0x1;for(var _0x24ae14 in _0xdc8049){if(_0xdc8049[_0xd9ef('0x4e')](_0x24ae14)&&(_0x24ae14===_0xd9ef('0x90')||_0x24ae14===_0xd9ef('0x87')||_0x24ae14===_0xd9ef('0x91')||_0x24ae14===_0xd9ef('0x92')||_0x24ae14===_0xd9ef('0x93')||_0x24ae14===_0xd9ef('0x94')||_0x24ae14==='minrate'||_0x24ae14===_0xd9ef('0x95')||_0x24ae14===_0xd9ef('0x96'))){_0x33f330[_0xd9ef('0x8c')](new Extension(_0xdc8049,_0x51d8b7,'FAXOPT('+_0x24ae14+')='+_0xdc8049[_0x24ae14],_0xd9ef('0x8f')));_0x51d8b7+=0x1;}}_0x33f330[_0xd9ef('0x8c')](new Extension(_0xdc8049,_0x51d8b7,'6',_0xd9ef('0x97')));_0x51d8b7+=0x1;_0x33f330[_0xd9ef('0x8c')](new Extension(_0xdc8049,_0x51d8b7,_0xd9ef('0x98'),'ReceiveFax'));_0x51d8b7=0x0;return _0x33f330;}exports[_0xd9ef('0x99')]=function(_0x5cb55c,_0x390f98,_0x450151){var _0x5c4bb7;return db[_0xd9ef('0x80')][_0xd9ef('0x81')](function(_0x273f0b){return db[_0xd9ef('0x42')][_0xd9ef('0x5b')](_0x5cb55c[_0xd9ef('0x5c')],{'transaction':_0x273f0b})['then'](function(_0x1dc709){_0x5c4bb7=_0x1dc709[_0xd9ef('0x39')]({'plain':!![]});return db['VoiceExtension'][_0xd9ef('0x9a')](createExtensionsReciveFax(_0x5c4bb7),{'transaction':_0x273f0b});});})[_0xd9ef('0x23')](function(){return _0x5c4bb7;})['then'](respondWithResult(_0x390f98,null))[_0xd9ef('0x2c')](handleError(_0x390f98,null));};exports[_0xd9ef('0x9b')]=function(_0x5c4e69,_0x531c91,_0x14debe){var _0x250140;return db[_0xd9ef('0x80')]['transaction'](function(_0x5b44b3){return db[_0xd9ef('0x42')]['update'](_0x5c4e69['body'],{'where':{'id':_0x5c4e69[_0xd9ef('0x5c')]['id']},'transaction':_0x5b44b3})[_0xd9ef('0x23')](function(_0x50f818){return db[_0xd9ef('0x9c')][_0xd9ef('0x3c')]({'where':{'FaxAccountId':_0x5c4e69['body']['id']},'transaction':_0x5b44b3})['then'](function(_0x395322){return db[_0xd9ef('0x9c')][_0xd9ef('0x9a')](createExtensionsReciveFax(_[_0xd9ef('0x76')](_0x5c4e69['body'],['tech','key',_0xd9ef('0x9d'),_0xd9ef('0x9e'),_0xd9ef('0x9f'),_0xd9ef('0xa0')])),{'transaction':_0x5b44b3});});});})[_0xd9ef('0x23')](function(){return db[_0xd9ef('0x42')][_0xd9ef('0xa1')](_0x5c4e69[_0xd9ef('0x5c')]['id']);})[_0xd9ef('0x23')](respondWithResult(_0x531c91,null))[_0xd9ef('0x2c')](handleError(_0x531c91,null));};exports[_0xd9ef('0xa2')]=function(_0xab7824,_0x587d37,_0x14c8fd){var _0x6bf9e={'raw':!![],'where':{}};var _0x3bdca0={};var _0x44e6a1={'count':0x0,'rows':[]};return db[_0xd9ef('0x42')]['findOne']({'where':{'id':_0xab7824[_0xd9ef('0x63')]['id']}})[_0xd9ef('0x23')](handleEntityNotFound(_0x587d37,null))[_0xd9ef('0x23')](function(_0x150e71){if(_0x150e71){_0x3bdca0[_0xd9ef('0x46')]=_['keys'](db[_0xd9ef('0xa3')][_0xd9ef('0x68')]);_0x3bdca0[_0xd9ef('0x47')]=_[_0xd9ef('0x48')](_0xab7824[_0xd9ef('0x47')]);_0x3bdca0['filters']=_['intersection'](_0x3bdca0['model'],_0x3bdca0[_0xd9ef('0x47')]);_0x6bf9e[_0xd9ef('0x4b')]=_[_0xd9ef('0x4a')](_0x3bdca0[_0xd9ef('0x46')],qs[_0xd9ef('0x4c')](_0xab7824[_0xd9ef('0x47')]['fields']));_0x6bf9e[_0xd9ef('0x4b')]=_0x6bf9e[_0xd9ef('0x4b')][_0xd9ef('0x4d')]?_0x6bf9e[_0xd9ef('0x4b')]:_0x3bdca0[_0xd9ef('0x46')];if(!_0xab7824[_0xd9ef('0x47')][_0xd9ef('0x4e')](_0xd9ef('0x4f'))){_0x6bf9e[_0xd9ef('0x34')]=qs[_0xd9ef('0x34')](_0xab7824[_0xd9ef('0x47')][_0xd9ef('0x34')]);_0x6bf9e[_0xd9ef('0x31')]=qs[_0xd9ef('0x31')](_0xab7824[_0xd9ef('0x47')][_0xd9ef('0x31')]);}_0x6bf9e[_0xd9ef('0x50')]=qs[_0xd9ef('0x69')](_0xab7824[_0xd9ef('0x47')][_0xd9ef('0x69')]);_0x6bf9e[_0xd9ef('0x51')]=qs[_0xd9ef('0x49')](_[_0xd9ef('0x70')](_0xab7824['query'],_0x3bdca0[_0xd9ef('0x49')]));_0x6bf9e[_0xd9ef('0x51')][_0xd9ef('0x66')]=_0x150e71['id'];if(_0xab7824[_0xd9ef('0x47')][_0xd9ef('0x6a')]){_0x6bf9e['where']=_['merge'](_0x6bf9e[_0xd9ef('0x51')],{'$or':_[_0xd9ef('0x41')](_0x6bf9e[_0xd9ef('0x4b')],function(_0x18bf4f){var _0x2ae62d={};_0x2ae62d[_0x18bf4f]={'$like':'%'+_0xab7824[_0xd9ef('0x47')][_0xd9ef('0x6a')]+'%'};return _0x2ae62d;})});}if(_0xab7824[_0xd9ef('0x47')][_0xd9ef('0xa4')]){var _0x2a1018=_0xab7824[_0xd9ef('0x47')][_0xd9ef('0xa4')][_0xd9ef('0xa5')](',');var _0x142c1e={};_0x142c1e[_0x2a1018[0x0]]={'$gte':moment(_0x2a1018[0x1])[_0xd9ef('0xa6')](_0xd9ef('0xa7'))};_0x6bf9e[_0xd9ef('0x51')]=_['merge'](_0x6bf9e[_0xd9ef('0x51')],_0x142c1e);}_0x6bf9e=_[_0xd9ef('0x52')]({},_0x6bf9e,_0xab7824[_0xd9ef('0x59')]);return db[_0xd9ef('0xa3')][_0xd9ef('0x33')]({'where':_0x6bf9e[_0xd9ef('0x51')]})[_0xd9ef('0x23')](function(_0x20eec2){_0x44e6a1['count']=_0x20eec2;if(_0xab7824[_0xd9ef('0x47')]['includeAll']){_0x6bf9e[_0xd9ef('0x71')]=[{'all':!![]}];}return db[_0xd9ef('0xa3')][_0xd9ef('0x54')](_0x6bf9e);})[_0xd9ef('0x23')](function(_0x2e10bf){_0x44e6a1[_0xd9ef('0x55')]=_0x2e10bf;return _0x44e6a1;});}})[_0xd9ef('0x23')](respondWithFilteredResult(_0x587d37,_0x6bf9e))[_0xd9ef('0x2c')](handleError(_0x587d37,null));};exports[_0xd9ef('0x3f')]=function(_0x482aed,_0x5e31f4,_0x16bd3f){var _0x5ca0fe,_0x475c61={},_0x42ee11;if(_0x482aed['body']['to']){_0x42ee11=_0x482aed[_0xd9ef('0x5c')]['to'][0x0];}return db[_0xd9ef('0x42')]['find']({'where':{'id':_0x482aed[_0xd9ef('0x63')]['id']},'include':[{'model':db[_0xd9ef('0xa8')],'as':_0xd9ef('0xa9'),'include':[{'model':db[_0xd9ef('0x78')],'as':'Contacts','where':{'fax':_0x42ee11},'limit':0x1,'order':[['updatedAt',_0xd9ef('0xaa')]]}]}]})[_0xd9ef('0x23')](handleEntityNotFound(_0x5e31f4,null))[_0xd9ef('0x23')](function(_0x59e7a6){_0x5ca0fe=_0x59e7a6;if(_0x482aed[_0xd9ef('0x5c')][_0xd9ef('0xab')]&&_0x482aed[_0xd9ef('0x5c')][_0xd9ef('0xab')][_0xd9ef('0x4d')]){for(var _0x36e884=0x0;_0x36e884<_0x482aed['body'][_0xd9ef('0xab')][_0xd9ef('0x4d')];_0x36e884+=0x1){_0x482aed[_0xd9ef('0x5c')]['attachments'][_0x36e884]={'filename':_0x482aed[_0xd9ef('0x5c')][_0xd9ef('0xab')][_0x36e884][_0xd9ef('0x3e')],'id':_0x482aed[_0xd9ef('0x5c')][_0xd9ef('0xab')][_0x36e884]['id'],'path':path['join'](config[_0xd9ef('0xac')],_0xd9ef('0xad'),_0x482aed[_0xd9ef('0x5c')][_0xd9ef('0xab')][_0x36e884][_0xd9ef('0xae')])};}}return respondWithRpcPromise(_0xd9ef('0xaf'),_0xd9ef('0xaf'),{'FaxAccountId':_[_0xd9ef('0xb0')](_0x482aed[_0xd9ef('0x63')]['id'])?undefined:_0x482aed[_0xd9ef('0x63')]['id'],'path':_[_0xd9ef('0xb0')](_0x482aed['body'][_0xd9ef('0xab')][0x0][_0xd9ef('0x8')])?undefined:_0x482aed['body'][_0xd9ef('0xab')][0x0][_0xd9ef('0x8')],'fax':_[_0xd9ef('0xb0')](_0x482aed[_0xd9ef('0x5c')]['to'][0x0])?undefined:_0x482aed['body']['to'][0x0]},client9002);})['then'](function(){if(_0x5ca0fe){if(_[_0xd9ef('0xb0')](_0x482aed['body'][_0xd9ef('0xb1')])){_0x482aed[_0xd9ef('0x5c')][_0xd9ef('0xb1')]=util[_0xd9ef('0xa6')](_0xd9ef('0xb2'),_0x5ca0fe[_0xd9ef('0x3e')],_0x5ca0fe[_0xd9ef('0xb3')]);}if(_0x5ca0fe['List']){if(_0x5ca0fe['List']['Contacts']['length']){return _0x5ca0fe['List'][_0xd9ef('0xb4')][0x0];}else{return db[_0xd9ef('0x78')][_0xd9ef('0x5b')](_[_0xd9ef('0xb5')](_0x482aed[_0xd9ef('0x5c')],{'firstName':_0x482aed['body']['to'][0x0],'phone':_0x482aed['body']['to'][0x0],'fax':_0x482aed[_0xd9ef('0x5c')]['to'][0x0],'ListId':_0x5ca0fe['ListId']}));}}else{throw new Error(_0xd9ef('0xb6'));}}else{throw new Error(_0xd9ef('0xb7'));}})[_0xd9ef('0x23')](function(_0x428646){if(_0x428646){return db[_0xd9ef('0x75')][_0xd9ef('0x5a')]({'where':{'ContactId':_0x428646['id'],'closed':![],'FaxAccountId':_0x5ca0fe['id']}})[_0xd9ef('0x23')](function(_0x389c99){if(_0x389c99){return[_0x389c99,![]];}return db['FaxInteraction']['create']({'UserId':_0x482aed['user']['id'],'ContactId':_0x428646['id'],'FaxAccountId':_0x5ca0fe['id'],'fax':_0x482aed['body']['to'][0x0],'firstMsgDirection':_0xd9ef('0xb8'),'Messages':[_['merge'](_0x482aed['body'],{'read':![],'body':_0x482aed[_0xd9ef('0x5c')][_0xd9ef('0xab')][0x0][_0xd9ef('0xb9')],'FaxAccountId':_0x5ca0fe['id'],'UserId':_0x482aed[_0xd9ef('0xba')]['id'],'ContactId':_0x428646['id'],'AttachmentId':_0x482aed['body'][_0xd9ef('0xab')][0x0]['id']})]},{'include':[{'model':db[_0xd9ef('0xa3')],'as':'Messages'}]})[_0xd9ef('0x23')](function(_0x5a170f){return[_0x5a170f,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xd9ef('0xbb')](function(_0x2c4832,_0x49c2d9){if(_0x49c2d9){return _0x2c4832;}return db[_0xd9ef('0xa3')]['create']({'direction':_0xd9ef('0xb8'),'read':![],'body':_0x482aed[_0xd9ef('0x5c')][_0xd9ef('0xab')][0x0][_0xd9ef('0xb9')],'FaxAccountId':_0x5ca0fe['id'],'FaxInteractionId':_0x2c4832['id'],'UserId':_0x482aed['user']['id'],'ContactId':_0x2c4832[_0xd9ef('0xbc')],'AttachmentId':_0x482aed[_0xd9ef('0x5c')][_0xd9ef('0xab')][0x0]['id']})[_0xd9ef('0x23')](function(_0x41cc99){_0x2c4832[_0xd9ef('0xbd')][_0xd9ef('0xbe')]=[];_0x2c4832[_0xd9ef('0xbd')]['Messages'][_0xd9ef('0x8c')](_0x41cc99['dataValues']);return _0x2c4832;});})[_0xd9ef('0x23')](function(_0x42429a){respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_['isNil'](_0x482aed[_0xd9ef('0x63')]['id'])?undefined:_0x482aed[_0xd9ef('0x63')]['id'],'path':_[_0xd9ef('0xb0')](_0x482aed[_0xd9ef('0x5c')][_0xd9ef('0xab')][0x0][_0xd9ef('0x8')])?undefined:_0x482aed[_0xd9ef('0x5c')][_0xd9ef('0xab')][0x0][_0xd9ef('0x8')],'fax':_['isNil'](_0x482aed[_0xd9ef('0x5c')]['to'][0x0])?undefined:_0x482aed['body']['to'][0x0],'AttachmentId':_0x482aed[_0xd9ef('0x5c')][_0xd9ef('0xab')][0x0]['id']},client9002)[_0xd9ef('0x23')](function(_0x20c2ac){logger[_0xd9ef('0x2a')](_0xd9ef('0xbf'),_0x20c2ac);})[_0xd9ef('0x2c')](function(_0x3b59cb){logger[_0xd9ef('0x2a')](_0xd9ef('0xbf'),_0x3b59cb);});return _0x42429a;})['then'](respondWithResult(_0x5e31f4,null))[_0xd9ef('0x2c')](handleError(_0x5e31f4,null));};exports[_0xd9ef('0xc0')]=function(_0x4e63e7,_0x41bcdc,_0x21179d){return db[_0xd9ef('0x42')][_0xd9ef('0x5a')]({'where':{'id':_0x4e63e7[_0xd9ef('0x63')]['id']}})[_0xd9ef('0x23')](handleEntityNotFound(_0x41bcdc,null))['then'](function(_0x6262e7){if(_0x6262e7){return _0x6262e7['addAgents'](_0x4e63e7[_0xd9ef('0x5c')][_0xd9ef('0x73')],_[_0xd9ef('0x76')](_0x4e63e7[_0xd9ef('0x5c')],[_0xd9ef('0x73'),'id'])||{})[_0xd9ef('0xbb')](function(_0x2665bc){for(var _0x843217=0x0;_0x843217<_0x4e63e7[_0xd9ef('0x5c')][_0xd9ef('0x73')][_0xd9ef('0x4d')];_0x843217+=0x1){socket[_0xd9ef('0xc1')]('userFaxAccount:save',{'UserId':Number(_0x4e63e7['body'][_0xd9ef('0x73')][_0x843217]),'FaxAccountId':Number(_0x4e63e7[_0xd9ef('0x63')]['id'])});}return _0x2665bc;});}})['then'](respondWithResult(_0x41bcdc,null))[_0xd9ef('0x2c')](handleError(_0x41bcdc,null));};exports[_0xd9ef('0xc2')]=function(_0x1b4874,_0x4f91c6,_0x1bca74){return db[_0xd9ef('0x42')][_0xd9ef('0x5a')]({'where':{'id':_0x1b4874[_0xd9ef('0x63')]['id']}})[_0xd9ef('0x23')](handleEntityNotFound(_0x4f91c6,null))[_0xd9ef('0x23')](function(_0x332e49){if(_0x332e49){return _0x332e49['removeAgents'](_0x1b4874[_0xd9ef('0x47')][_0xd9ef('0x73')])[_0xd9ef('0x23')](function(){if(_[_0xd9ef('0xc3')](_0x1b4874[_0xd9ef('0x47')][_0xd9ef('0x73')])){for(var _0x47cb6d=0x0;_0x47cb6d<_0x1b4874[_0xd9ef('0x47')][_0xd9ef('0x73')][_0xd9ef('0x4d')];_0x47cb6d+=0x1){socket[_0xd9ef('0xc1')]('userFaxAccount:remove',{'UserId':Number(_0x1b4874[_0xd9ef('0x47')][_0xd9ef('0x73')][_0x47cb6d]),'FaxAccountId':Number(_0x1b4874['params']['id'])});}}else{socket[_0xd9ef('0xc1')](_0xd9ef('0xc4'),{'UserId':Number(_0x1b4874[_0xd9ef('0x47')][_0xd9ef('0x73')]),'FaxAccountId':Number(_0x1b4874[_0xd9ef('0x63')]['id'])});}});}})[_0xd9ef('0x23')](respondWithStatusCode(_0x4f91c6,null))[_0xd9ef('0x2c')](handleError(_0x4f91c6,null));};exports[_0xd9ef('0xc5')]=function(_0x101fb5,_0x44c0b6,_0x23bf6b){var _0xb4626e={};var _0x1fc4b5={};var _0x31d9be;var _0x40b8c1;return db[_0xd9ef('0x42')]['findOne']({'where':{'id':_0x101fb5[_0xd9ef('0x63')]['id']}})[_0xd9ef('0x23')](handleEntityNotFound(_0x44c0b6,null))[_0xd9ef('0x23')](function(_0x2ce5d7){if(_0x2ce5d7){_0x31d9be=_0x2ce5d7;_0x1fc4b5['model']=_[_0xd9ef('0x48')](db[_0xd9ef('0x79')][_0xd9ef('0x68')]);_0x1fc4b5[_0xd9ef('0x47')]=_[_0xd9ef('0x48')](_0x101fb5[_0xd9ef('0x47')]);_0x1fc4b5[_0xd9ef('0x49')]=_[_0xd9ef('0x4a')](_0x1fc4b5['model'],_0x1fc4b5[_0xd9ef('0x47')]);_0xb4626e['attributes']=_[_0xd9ef('0x4a')](_0x1fc4b5[_0xd9ef('0x46')],qs[_0xd9ef('0x4c')](_0x101fb5[_0xd9ef('0x47')][_0xd9ef('0x4c')]));_0xb4626e[_0xd9ef('0x4b')]=_0xb4626e['attributes'][_0xd9ef('0x4d')]?_0xb4626e[_0xd9ef('0x4b')]:_0x1fc4b5[_0xd9ef('0x46')];_0xb4626e[_0xd9ef('0x50')]=qs[_0xd9ef('0x69')](_0x101fb5[_0xd9ef('0x47')][_0xd9ef('0x69')]);_0xb4626e[_0xd9ef('0x51')]=qs[_0xd9ef('0x49')](_[_0xd9ef('0x70')](_0x101fb5[_0xd9ef('0x47')],_0x1fc4b5['filters']));if(_0x101fb5[_0xd9ef('0x47')][_0xd9ef('0x6a')]){_0xb4626e['where']=_[_0xd9ef('0x52')](_0xb4626e[_0xd9ef('0x51')],{'$or':_['map'](_0xb4626e[_0xd9ef('0x4b')],function(_0x56db61){var _0x5240ac={};_0x5240ac[_0x56db61]={'$like':'%'+_0x101fb5[_0xd9ef('0x47')][_0xd9ef('0x6a')]+'%'};return _0x5240ac;})});}_0xb4626e=_[_0xd9ef('0x52')]({},_0xb4626e,_0x101fb5[_0xd9ef('0x59')]);return _0x31d9be[_0xd9ef('0xc5')](_0xb4626e);}})[_0xd9ef('0x23')](function(_0x81087b){if(_0x81087b){_0x40b8c1=_0x81087b[_0xd9ef('0x4d')];if(!_0x101fb5[_0xd9ef('0x47')][_0xd9ef('0x4e')]('nolimit')){_0xb4626e[_0xd9ef('0x34')]=qs[_0xd9ef('0x34')](_0x101fb5[_0xd9ef('0x47')][_0xd9ef('0x34')]);_0xb4626e['offset']=qs[_0xd9ef('0x31')](_0x101fb5[_0xd9ef('0x47')]['offset']);}return _0x31d9be['getAgents'](_0xb4626e);}})['then'](function(_0x5bb277){if(_0x5bb277){return _0x5bb277?{'count':_0x40b8c1,'rows':_0x5bb277}:null;}})[_0xd9ef('0x23')](respondWithResult(_0x44c0b6,null))[_0xd9ef('0x2c')](handleError(_0x44c0b6,null));}; \ No newline at end of file +var _0x8168=['request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','get','FaxAccounts','UserProfileResource','sendStatus','stack','name','send','index','mandatoryDispositionPause','map','FaxAccount','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','rows','show','Pause','length','includeAll','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','autoAssociation','params','addDisposition','FaxAccountId','Disposition','getDispositions','findAll','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','Owner','internal','Tags','color','tag','addApplications','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','from-voip-provider','exten','localstationid','app','system','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','VoiceExtension','tech','createdAt','updatedAt','TrunkId','ListId','FaxMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','CmList','List','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','format','\x22%s\x22\x20<%s>','fax','Contacts','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x2c30e1,_0x52e536){var _0x4e5584=function(_0x3c74af){while(--_0x3c74af){_0x2c30e1['push'](_0x2c30e1['shift']());}};_0x4e5584(++_0x52e536);}(_0x8168,0xc4));var _0x8816=function(_0x3869c8,_0x2ff137){_0x3869c8=_0x3869c8-0x0;var _0x4caf60=_0x8168[_0x3869c8];return _0x4caf60;};'use strict';var emlformat=require(_0x8816('0x0'));var rimraf=require(_0x8816('0x1'));var zipdir=require(_0x8816('0x2'));var jsonpatch=require(_0x8816('0x3'));var rp=require(_0x8816('0x4'));var moment=require(_0x8816('0x5'));var BPromise=require(_0x8816('0x6'));var Mustache=require(_0x8816('0x7'));var util=require('util');var path=require(_0x8816('0x8'));var sox=require(_0x8816('0x9'));var csv=require(_0x8816('0xa'));var ejs=require(_0x8816('0xb'));var fs=require('fs');var fs_extra=require(_0x8816('0xc'));var _=require(_0x8816('0xd'));var squel=require(_0x8816('0xe'));var crypto=require(_0x8816('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8816('0xa'));var querystring=require(_0x8816('0x10'));var Papa=require(_0x8816('0x11'));var Redis=require('ioredis');var authService=require(_0x8816('0x12'));var qs=require(_0x8816('0x13'));var as=require(_0x8816('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8816('0x15'))(_0x8816('0x16'));var utils=require('../../config/utils');var config=require(_0x8816('0x17'));var licenseUtil=require(_0x8816('0x18'));var db=require(_0x8816('0x19'))['db'];config[_0x8816('0x1a')]=_[_0x8816('0x1b')](config['redis'],{'host':_0x8816('0x1c'),'port':0x18eb});var socket=require(_0x8816('0x1d'))(new Redis(config[_0x8816('0x1a')]));require(_0x8816('0x1e'))[_0x8816('0x1f')](socket);var jayson=require(_0x8816('0x20'));var client=jayson[_0x8816('0x21')][_0x8816('0x22')]({'port':0x232c});var client9002=jayson[_0x8816('0x21')][_0x8816('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x10a3e2,_0x25bf7a,_0x1071b9,_0x27676a){return new BPromise(function(_0x3faf88,_0x444143){var _0x5f43e8=_0x27676a||client;return _0x5f43e8[_0x8816('0x23')](_0x10a3e2,_0x1071b9)[_0x8816('0x24')](function(_0x2a6a14){logger['info'](_0x8816('0x25'),_0x25bf7a,'request\x20sent');logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x25bf7a,_0x8816('0x26'),JSON[_0x8816('0x27')](_0x2a6a14));if(_0x2a6a14[_0x8816('0x28')]){if(_0x2a6a14[_0x8816('0x28')][_0x8816('0x29')]===0x1f4){logger['error'](_0x8816('0x25'),_0x25bf7a,_0x2a6a14[_0x8816('0x28')]['message']);return _0x444143(_0x2a6a14['error'][_0x8816('0x2a')]);}logger[_0x8816('0x28')](_0x8816('0x25'),_0x25bf7a,_0x2a6a14['error'][_0x8816('0x2a')]);return _0x3faf88(_0x2a6a14['error'][_0x8816('0x2a')]);}else{logger[_0x8816('0x2b')](_0x8816('0x25'),_0x25bf7a,'request\x20sent');_0x3faf88(_0x2a6a14[_0x8816('0x2c')][_0x8816('0x2a')]);}})[_0x8816('0x2d')](function(_0x483845){logger[_0x8816('0x28')](_0x8816('0x25'),_0x25bf7a,_0x483845);_0x444143(_0x483845);});});}function respondWithStatusCode(_0x42a76d,_0x240bac){_0x240bac=_0x240bac||0xcc;return function(_0x1e5d2d){if(_0x1e5d2d){return _0x42a76d['sendStatus'](_0x240bac);}return _0x42a76d[_0x8816('0x2e')](_0x240bac)[_0x8816('0x2f')]();};}function respondWithResult(_0x36e0bb,_0x3ea4ce){_0x3ea4ce=_0x3ea4ce||0xc8;return function(_0x528dbd){if(_0x528dbd){return _0x36e0bb['status'](_0x3ea4ce)[_0x8816('0x30')](_0x528dbd);}};}function respondWithFilteredResult(_0x553d1f,_0x54269f){return function(_0x1524a9){if(_0x1524a9){var _0x563a57=typeof _0x54269f[_0x8816('0x31')]===_0x8816('0x32')&&typeof _0x54269f[_0x8816('0x33')]==='undefined';var _0x3c4614=_0x1524a9[_0x8816('0x34')];var _0x15d830=_0x563a57?0x0:_0x54269f['offset'];var _0xbc1399=_0x563a57?_0x1524a9['count']:_0x54269f[_0x8816('0x31')]+_0x54269f[_0x8816('0x33')];var _0x26e74f;if(_0xbc1399>=_0x3c4614){_0xbc1399=_0x3c4614;_0x26e74f=0xc8;}else{_0x26e74f=0xce;}_0x553d1f[_0x8816('0x2e')](_0x26e74f);return _0x553d1f[_0x8816('0x35')](_0x8816('0x36'),_0x15d830+'-'+_0xbc1399+'/'+_0x3c4614)['json'](_0x1524a9);}return null;};}function patchUpdates(_0x5e2f57){return function(_0x5f17){try{jsonpatch[_0x8816('0x37')](_0x5f17,_0x5e2f57,!![]);}catch(_0x7432d3){return BPromise['reject'](_0x7432d3);}return _0x5f17[_0x8816('0x38')]();};}function saveUpdates(_0x59cd31,_0xb00516){return function(_0x96fc3c){if(_0x96fc3c){return _0x96fc3c[_0x8816('0x39')](_0x59cd31)[_0x8816('0x24')](function(_0x2e7132){return _0x2e7132;});}return null;};}function removeEntity(_0x30bf42,_0x53f2d1){return function(_0x16725c){if(_0x16725c){return _0x16725c[_0x8816('0x3a')]()[_0x8816('0x24')](function(){var _0x56fabb=_0x16725c[_0x8816('0x3b')]({'plain':!![]});var _0x367a11=_0x8816('0x3c');return db[_0x8816('0x3d')]['destroy']({'where':{'type':_0x367a11,'resourceId':_0x56fabb['id']}})[_0x8816('0x24')](function(){return _0x16725c;});})[_0x8816('0x24')](function(){_0x30bf42['status'](0xcc)[_0x8816('0x2f')]();});}};}function handleEntityNotFound(_0x5a12ce,_0x52f3cd){return function(_0xad8789){if(!_0xad8789){_0x5a12ce[_0x8816('0x3e')](0x194);}return _0xad8789;};}function handleError(_0x12aa43,_0x424b79){_0x424b79=_0x424b79||0x1f4;return function(_0x21a50a){logger[_0x8816('0x28')](_0x21a50a[_0x8816('0x3f')]);if(_0x21a50a[_0x8816('0x40')]){delete _0x21a50a[_0x8816('0x40')];}_0x12aa43[_0x8816('0x2e')](_0x424b79)[_0x8816('0x41')](_0x21a50a);};}exports[_0x8816('0x42')]=function(_0x4599a3,_0x17ac86){var _0x37ac85={'include':[{'model':db['Pause'],'as':_0x8816('0x43')}]},_0x2bc114={},_0x5dc527={'count':0x0,'rows':[]};var _0x2a9afd=_[_0x8816('0x44')](db[_0x8816('0x45')][_0x8816('0x46')],function(_0x24835c){return{'name':_0x24835c['fieldName'],'type':_0x24835c[_0x8816('0x47')][_0x8816('0x48')]};});_0x2bc114[_0x8816('0x49')]=_[_0x8816('0x44')](_0x2a9afd,_0x8816('0x40'));_0x2bc114[_0x8816('0x4a')]=_[_0x8816('0x4b')](_0x4599a3[_0x8816('0x4a')]);_0x2bc114['filters']=_[_0x8816('0x4c')](_0x2bc114[_0x8816('0x49')],_0x2bc114['query']);_0x37ac85['attributes']=_[_0x8816('0x4c')](_0x2bc114[_0x8816('0x49')],qs[_0x8816('0x4d')](_0x4599a3[_0x8816('0x4a')][_0x8816('0x4d')]));_0x37ac85[_0x8816('0x4e')]=_0x37ac85[_0x8816('0x4e')]['length']?_0x37ac85[_0x8816('0x4e')]:_0x2bc114[_0x8816('0x49')];if(!_0x4599a3[_0x8816('0x4a')][_0x8816('0x4f')](_0x8816('0x50'))){_0x37ac85[_0x8816('0x33')]=qs[_0x8816('0x33')](_0x4599a3[_0x8816('0x4a')][_0x8816('0x33')]);_0x37ac85[_0x8816('0x31')]=qs[_0x8816('0x31')](_0x4599a3[_0x8816('0x4a')][_0x8816('0x31')]);}_0x37ac85[_0x8816('0x51')]=qs[_0x8816('0x52')](_0x4599a3[_0x8816('0x4a')][_0x8816('0x52')]);_0x37ac85[_0x8816('0x53')]=qs[_0x8816('0x54')](_[_0x8816('0x55')](_0x4599a3['query'],_0x2bc114[_0x8816('0x54')]),_0x2a9afd);if(_0x4599a3[_0x8816('0x4a')][_0x8816('0x56')]){_0x37ac85[_0x8816('0x53')]=_[_0x8816('0x57')](_0x37ac85[_0x8816('0x53')],{'$or':_[_0x8816('0x44')](_0x2a9afd,function(_0x200c17){if(_0x200c17[_0x8816('0x47')]!==_0x8816('0x58')){var _0x1c3d23={};_0x1c3d23[_0x200c17[_0x8816('0x40')]]={'$like':'%'+_0x4599a3[_0x8816('0x4a')]['filter']+'%'};return _0x1c3d23;}})});}_0x37ac85=_['merge']({},_0x37ac85,_0x4599a3[_0x8816('0x59')]);var _0x20a4c5={'where':_0x37ac85[_0x8816('0x53')]};return db[_0x8816('0x45')]['count'](_0x20a4c5)[_0x8816('0x24')](function(_0x209bf7){_0x5dc527[_0x8816('0x34')]=_0x209bf7;if(_0x4599a3[_0x8816('0x4a')]['includeAll']){_0x37ac85[_0x8816('0x5a')]=[{'all':!![]}];}return db[_0x8816('0x45')]['findAll'](_0x37ac85);})[_0x8816('0x24')](function(_0x207433){_0x5dc527[_0x8816('0x5b')]=_0x207433;return _0x5dc527;})[_0x8816('0x24')](respondWithFilteredResult(_0x17ac86,_0x37ac85))['catch'](handleError(_0x17ac86,null));};exports[_0x8816('0x5c')]=function(_0x1dec5a,_0x547eaa){var _0x36da3a={'raw':![],'where':{'id':_0x1dec5a['params']['id']},'include':[{'model':db[_0x8816('0x5d')],'as':_0x8816('0x43')}]},_0x494eed={};_0x494eed['model']=_[_0x8816('0x4b')](db[_0x8816('0x45')]['rawAttributes']);_0x494eed[_0x8816('0x4a')]=_['keys'](_0x1dec5a['query']);_0x494eed[_0x8816('0x54')]=_[_0x8816('0x4c')](_0x494eed[_0x8816('0x49')],_0x494eed[_0x8816('0x4a')]);_0x36da3a[_0x8816('0x4e')]=_[_0x8816('0x4c')](_0x494eed[_0x8816('0x49')],qs[_0x8816('0x4d')](_0x1dec5a['query'][_0x8816('0x4d')]));_0x36da3a[_0x8816('0x4e')]=_0x36da3a[_0x8816('0x4e')][_0x8816('0x5e')]?_0x36da3a['attributes']:_0x494eed[_0x8816('0x49')];if(_0x1dec5a[_0x8816('0x4a')][_0x8816('0x5f')]){_0x36da3a[_0x8816('0x5a')]=[{'all':!![]}];}_0x36da3a=_[_0x8816('0x57')]({},_0x36da3a,_0x1dec5a[_0x8816('0x59')]);return db[_0x8816('0x45')]['find'](_0x36da3a)[_0x8816('0x24')](handleEntityNotFound(_0x547eaa,null))[_0x8816('0x24')](respondWithResult(_0x547eaa,null))[_0x8816('0x2d')](handleError(_0x547eaa,null));};exports[_0x8816('0x60')]=function(_0x8591fc,_0x77aa84){return db[_0x8816('0x45')][_0x8816('0x60')](_0x8591fc[_0x8816('0x61')],{})['then'](function(_0x40e67f){var _0x552cd6=_0x8591fc['user'][_0x8816('0x3b')]({'plain':!![]});if(!_0x552cd6)throw new Error(_0x8816('0x62'));if(_0x552cd6['role']===_0x8816('0x63')){var _0x37f5e1=_0x40e67f[_0x8816('0x3b')]({'plain':!![]});var _0xb02cad=_0x8816('0x3c');return db[_0x8816('0x64')][_0x8816('0x65')]({'where':{'name':_0xb02cad,'userProfileId':_0x552cd6[_0x8816('0x66')]},'raw':!![]})['then'](function(_0x107118){if(_0x107118&&_0x107118[_0x8816('0x67')]===0x0){return db['UserProfileResource']['create']({'name':_0x37f5e1[_0x8816('0x40')],'resourceId':_0x37f5e1['id'],'type':_0x107118['name'],'sectionId':_0x107118['id']},{})['then'](function(){return _0x40e67f;});}else{return _0x40e67f;}})[_0x8816('0x2d')](function(_0x2859f4){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2859f4);throw _0x2859f4;});}return _0x40e67f;})[_0x8816('0x24')](respondWithResult(_0x77aa84,0xc9))[_0x8816('0x2d')](handleError(_0x77aa84,null));};exports['update']=function(_0x49de89,_0x32b3fd){if(_0x49de89[_0x8816('0x61')]['id']){delete _0x49de89[_0x8816('0x61')]['id'];}return db[_0x8816('0x45')][_0x8816('0x65')]({'where':{'id':_0x49de89[_0x8816('0x68')]['id']},'include':[{'model':db[_0x8816('0x5d')],'as':_0x8816('0x43')}]})[_0x8816('0x24')](handleEntityNotFound(_0x32b3fd,null))[_0x8816('0x24')](saveUpdates(_0x49de89[_0x8816('0x61')],null))['then'](respondWithResult(_0x32b3fd,null))['catch'](handleError(_0x32b3fd,null));};exports[_0x8816('0x3a')]=function(_0x2b2130,_0x42d72a){return db['FaxAccount'][_0x8816('0x65')]({'where':{'id':_0x2b2130[_0x8816('0x68')]['id']}})['then'](handleEntityNotFound(_0x42d72a,null))[_0x8816('0x24')](removeEntity(_0x42d72a,null))[_0x8816('0x2d')](handleError(_0x42d72a,null));};exports['describe']=function(_0x444b72,_0x141f73){return db[_0x8816('0x45')]['describe']()[_0x8816('0x24')](respondWithResult(_0x141f73,null))[_0x8816('0x2d')](handleError(_0x141f73,null));};exports[_0x8816('0x69')]=function(_0x35bcd5,_0x85732e,_0x542910){if(_0x35bcd5[_0x8816('0x61')]['id']){delete _0x35bcd5[_0x8816('0x61')]['id'];}return db[_0x8816('0x45')]['find']({'where':{'id':_0x35bcd5['params']['id']}})[_0x8816('0x24')](handleEntityNotFound(_0x85732e,null))[_0x8816('0x24')](function(_0x3b52f0){if(_0x3b52f0){_0x35bcd5[_0x8816('0x61')][_0x8816('0x6a')]=_0x3b52f0['id'];return db[_0x8816('0x6b')][_0x8816('0x60')](_0x35bcd5[_0x8816('0x61')]);}})[_0x8816('0x24')](respondWithResult(_0x85732e,null))[_0x8816('0x2d')](handleError(_0x85732e,null));};exports[_0x8816('0x6c')]=function(_0x347df1,_0x365b55,_0x313041){var _0x2349ab={'raw':![],'where':{}};var _0x1a02d9={};var _0x48ad1e={'count':0x0,'rows':[]};return db[_0x8816('0x45')]['findOne']({'where':{'id':_0x347df1[_0x8816('0x68')]['id']}})['then'](handleEntityNotFound(_0x365b55,null))[_0x8816('0x24')](function(_0x25c5b9){if(_0x25c5b9){_0x1a02d9[_0x8816('0x49')]=_[_0x8816('0x4b')](db['Disposition'][_0x8816('0x46')]);_0x1a02d9['query']=_['keys'](_0x347df1[_0x8816('0x4a')]);_0x1a02d9[_0x8816('0x54')]=_[_0x8816('0x4c')](_0x1a02d9[_0x8816('0x49')],_0x1a02d9[_0x8816('0x4a')]);_0x2349ab[_0x8816('0x4e')]=_[_0x8816('0x4c')](_0x1a02d9[_0x8816('0x49')],qs[_0x8816('0x4d')](_0x347df1[_0x8816('0x4a')][_0x8816('0x4d')]));_0x2349ab[_0x8816('0x4e')]=_0x2349ab[_0x8816('0x4e')][_0x8816('0x5e')]?_0x2349ab[_0x8816('0x4e')]:_0x1a02d9[_0x8816('0x49')];if(!_0x347df1[_0x8816('0x4a')]['hasOwnProperty'](_0x8816('0x50'))){_0x2349ab[_0x8816('0x33')]=qs[_0x8816('0x33')](_0x347df1['query'][_0x8816('0x33')]);_0x2349ab['offset']=qs[_0x8816('0x31')](_0x347df1[_0x8816('0x4a')]['offset']);}_0x2349ab['order']=qs['sort'](_0x347df1[_0x8816('0x4a')]['sort']);_0x2349ab[_0x8816('0x53')]=qs[_0x8816('0x54')](_['pick'](_0x347df1[_0x8816('0x4a')],_0x1a02d9[_0x8816('0x54')]));_0x2349ab[_0x8816('0x53')][_0x8816('0x6a')]=_0x25c5b9['id'];if(_0x347df1[_0x8816('0x4a')][_0x8816('0x56')]){_0x2349ab[_0x8816('0x53')]=_['merge'](_0x2349ab['where'],{'$or':_[_0x8816('0x44')](_0x2349ab[_0x8816('0x4e')],function(_0x49c170){var _0xca6e5b={};_0xca6e5b[_0x49c170]={'$like':'%'+_0x347df1[_0x8816('0x4a')][_0x8816('0x56')]+'%'};return _0xca6e5b;})});}_0x2349ab=_['merge']({},_0x2349ab,_0x347df1[_0x8816('0x59')]);return db[_0x8816('0x6b')][_0x8816('0x34')]({'where':_0x2349ab[_0x8816('0x53')]})[_0x8816('0x24')](function(_0xf5d73){_0x48ad1e[_0x8816('0x34')]=_0xf5d73;if(_0x347df1[_0x8816('0x4a')][_0x8816('0x5f')]){_0x2349ab[_0x8816('0x5a')]=[{'all':!![]}];}return db[_0x8816('0x6b')][_0x8816('0x6d')](_0x2349ab);})['then'](function(_0xcc13a4){_0x48ad1e[_0x8816('0x5b')]=_0xcc13a4;return _0x48ad1e;});}})['then'](respondWithFilteredResult(_0x365b55,_0x2349ab))[_0x8816('0x2d')](handleError(_0x365b55,null));};exports[_0x8816('0x6e')]=function(_0x4dd08c,_0xda35cf,_0x5eb431){return db[_0x8816('0x45')][_0x8816('0x65')]({'where':{'id':_0x4dd08c[_0x8816('0x68')]['id']}})['then'](handleEntityNotFound(_0xda35cf,null))[_0x8816('0x24')](function(_0x5e6d1f){if(_0x5e6d1f){return _0x5e6d1f[_0x8816('0x6e')](_0x4dd08c[_0x8816('0x4a')][_0x8816('0x6f')]);}})[_0x8816('0x24')](respondWithStatusCode(_0xda35cf,null))[_0x8816('0x2d')](handleError(_0xda35cf,null));};exports[_0x8816('0x70')]=function(_0x2dfcf0,_0xc6bd58,_0x2af670){if(_0x2dfcf0['body']['id']){delete _0x2dfcf0['body']['id'];}return db[_0x8816('0x45')][_0x8816('0x65')]({'where':{'id':_0x2dfcf0[_0x8816('0x68')]['id']}})['then'](handleEntityNotFound(_0xc6bd58,null))['then'](function(_0x1d19ce){if(_0x1d19ce){_0x2dfcf0[_0x8816('0x61')][_0x8816('0x6a')]=_0x1d19ce['id'];return db[_0x8816('0x71')][_0x8816('0x60')](_0x2dfcf0['body']);}})[_0x8816('0x24')](respondWithResult(_0xc6bd58,null))[_0x8816('0x2d')](handleError(_0xc6bd58,null));};exports['getAnswers']=function(_0x843567,_0x53408b,_0x515bea){var _0x4d0dcd={'raw':![],'where':{}};var _0x2a1059={};var _0x1b21a8={'count':0x0,'rows':[]};return db[_0x8816('0x45')][_0x8816('0x72')]({'where':{'id':_0x843567[_0x8816('0x68')]['id']}})['then'](handleEntityNotFound(_0x53408b,null))[_0x8816('0x24')](function(_0x4ead86){if(_0x4ead86){_0x2a1059[_0x8816('0x49')]=_['keys'](db[_0x8816('0x71')][_0x8816('0x46')]);_0x2a1059['query']=_['keys'](_0x843567['query']);_0x2a1059[_0x8816('0x54')]=_['intersection'](_0x2a1059['model'],_0x2a1059[_0x8816('0x4a')]);_0x4d0dcd['attributes']=_[_0x8816('0x4c')](_0x2a1059['model'],qs['fields'](_0x843567[_0x8816('0x4a')]['fields']));_0x4d0dcd[_0x8816('0x4e')]=_0x4d0dcd[_0x8816('0x4e')][_0x8816('0x5e')]?_0x4d0dcd[_0x8816('0x4e')]:_0x2a1059['model'];if(!_0x843567['query'][_0x8816('0x4f')](_0x8816('0x50'))){_0x4d0dcd[_0x8816('0x33')]=qs['limit'](_0x843567[_0x8816('0x4a')]['limit']);_0x4d0dcd[_0x8816('0x31')]=qs[_0x8816('0x31')](_0x843567[_0x8816('0x4a')][_0x8816('0x31')]);}_0x4d0dcd[_0x8816('0x51')]=qs[_0x8816('0x52')](_0x843567[_0x8816('0x4a')][_0x8816('0x52')]);_0x4d0dcd[_0x8816('0x53')]=qs[_0x8816('0x54')](_['pick'](_0x843567[_0x8816('0x4a')],_0x2a1059[_0x8816('0x54')]));_0x4d0dcd[_0x8816('0x53')][_0x8816('0x6a')]=_0x4ead86['id'];if(_0x843567[_0x8816('0x4a')]['filter']){_0x4d0dcd[_0x8816('0x53')]=_[_0x8816('0x57')](_0x4d0dcd[_0x8816('0x53')],{'$or':_[_0x8816('0x44')](_0x4d0dcd[_0x8816('0x4e')],function(_0x4ed690){var _0xc5e86e={};_0xc5e86e[_0x4ed690]={'$like':'%'+_0x843567[_0x8816('0x4a')][_0x8816('0x56')]+'%'};return _0xc5e86e;})});}_0x4d0dcd=_['merge']({},_0x4d0dcd,_0x843567['options']);return db['CannedAnswer'][_0x8816('0x34')]({'where':_0x4d0dcd[_0x8816('0x53')]})[_0x8816('0x24')](function(_0x212b3e){_0x1b21a8[_0x8816('0x34')]=_0x212b3e;if(_0x843567['query'][_0x8816('0x5f')]){_0x4d0dcd[_0x8816('0x5a')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x4d0dcd);})[_0x8816('0x24')](function(_0x21ef4c){_0x1b21a8[_0x8816('0x5b')]=_0x21ef4c;return _0x1b21a8;});}})[_0x8816('0x24')](respondWithFilteredResult(_0x53408b,_0x4d0dcd))[_0x8816('0x2d')](handleError(_0x53408b,null));};exports[_0x8816('0x73')]=function(_0x17be59,_0x47c57a,_0x53e312){return db['FaxAccount'][_0x8816('0x65')]({'where':{'id':_0x17be59['params']['id']}})[_0x8816('0x24')](handleEntityNotFound(_0x47c57a,null))[_0x8816('0x24')](function(_0x267a97){if(_0x267a97){return _0x267a97['removeAnswers'](_0x17be59[_0x8816('0x4a')]['ids']);}})[_0x8816('0x24')](respondWithStatusCode(_0x47c57a,null))[_0x8816('0x2d')](handleError(_0x47c57a,null));};exports[_0x8816('0x74')]=function(_0x6ec47c,_0xf8523c,_0x36894d){return db[_0x8816('0x75')]['find']({'where':{'id':_0x6ec47c[_0x8816('0x68')]['id']}})[_0x8816('0x24')](handleEntityNotFound(_0xf8523c,null))[_0x8816('0x24')](function(_0x1b11a2){if(_0x1b11a2){return _0x1b11a2[_0x8816('0x74')](_0x6ec47c[_0x8816('0x61')]['ids'],_[_0x8816('0x76')](_0x6ec47c['body'],[_0x8816('0x6f'),'id'])||{});}})[_0x8816('0x24')](respondWithResult(_0xf8523c,null))[_0x8816('0x2d')](handleError(_0xf8523c,null));};exports[_0x8816('0x77')]=function(_0x292d91,_0x51e0fe,_0x2c7233){var _0x67a15f={'raw':![],'where':{}};var _0x4e55c1={};var _0x4bb5bb={'count':0x0,'rows':[]};return db['FaxAccount'][_0x8816('0x72')]({'where':{'id':_0x292d91[_0x8816('0x68')]['id']}})['then'](handleEntityNotFound(_0x51e0fe,null))[_0x8816('0x24')](function(_0x44c92c){if(_0x44c92c){_0x4e55c1['model']=_[_0x8816('0x4b')](db[_0x8816('0x75')][_0x8816('0x46')]);_0x4e55c1['query']=_[_0x8816('0x4b')](_0x292d91[_0x8816('0x4a')]);_0x4e55c1[_0x8816('0x54')]=_[_0x8816('0x4c')](_0x4e55c1[_0x8816('0x49')],_0x4e55c1[_0x8816('0x4a')]);_0x67a15f[_0x8816('0x4e')]=_[_0x8816('0x4c')](_0x4e55c1[_0x8816('0x49')],qs['fields'](_0x292d91[_0x8816('0x4a')][_0x8816('0x4d')]));_0x67a15f[_0x8816('0x4e')]=_0x67a15f[_0x8816('0x4e')][_0x8816('0x5e')]?_0x67a15f['attributes']:_0x4e55c1[_0x8816('0x49')];if(!_0x292d91[_0x8816('0x4a')][_0x8816('0x4f')](_0x8816('0x50'))){_0x67a15f['limit']=qs[_0x8816('0x33')](_0x292d91[_0x8816('0x4a')][_0x8816('0x33')]);_0x67a15f[_0x8816('0x31')]=qs[_0x8816('0x31')](_0x292d91[_0x8816('0x4a')][_0x8816('0x31')]);}_0x67a15f[_0x8816('0x51')]=qs['sort'](_0x292d91[_0x8816('0x4a')]['sort']);_0x67a15f[_0x8816('0x53')]=qs['filters'](_['pick'](_0x292d91['query'],_0x4e55c1[_0x8816('0x54')]));_0x67a15f['where']['FaxAccountId']=_0x44c92c['id'];if(_0x292d91[_0x8816('0x4a')]['filter']){_0x67a15f[_0x8816('0x53')]=_[_0x8816('0x57')](_0x67a15f[_0x8816('0x53')],{'$or':_[_0x8816('0x44')](_0x67a15f[_0x8816('0x4e')],function(_0x412a4f){var _0x530540={};_0x530540[_0x412a4f]={'$like':'%'+_0x292d91[_0x8816('0x4a')][_0x8816('0x56')]+'%'};return _0x530540;})});}_0x67a15f=_[_0x8816('0x57')]({},_0x67a15f,_0x292d91['options']);return db[_0x8816('0x75')][_0x8816('0x34')]({'where':_0x67a15f[_0x8816('0x53')]})[_0x8816('0x24')](function(_0x531b32){_0x4bb5bb[_0x8816('0x34')]=_0x531b32;if(_0x292d91[_0x8816('0x4a')][_0x8816('0x5f')]){_0x67a15f[_0x8816('0x5a')]=[{'model':db[_0x8816('0x78')],'as':_0x8816('0x79'),'required':![]},{'model':db[_0x8816('0x7a')],'as':_0x8816('0x7b'),'attributes':['name','fullname',_0x8816('0x7c')],'required':![]},{'model':db['Tag'],'as':_0x8816('0x7d'),'attributes':['id','name',_0x8816('0x7e')],'where':_0x292d91[_0x8816('0x4a')][_0x8816('0x7f')]?{'id':_0x292d91['query']['tag']}:undefined,'required':_0x292d91['query'][_0x8816('0x7f')]?!![]:![]}];}return db['FaxInteraction']['findAll'](_0x67a15f);})['then'](function(_0x519a72){_0x4bb5bb[_0x8816('0x5b')]=_0x519a72;return _0x4bb5bb;});}})[_0x8816('0x24')](respondWithFilteredResult(_0x51e0fe,_0x67a15f))[_0x8816('0x2d')](handleError(_0x51e0fe,null));};exports[_0x8816('0x80')]=function(_0x4c6e10,_0x5e152d,_0x465fc9){return db[_0x8816('0x45')][_0x8816('0x72')]({'where':{'id':_0x4c6e10[_0x8816('0x68')]['id']}})[_0x8816('0x24')](handleEntityNotFound(_0x5e152d,null))[_0x8816('0x24')](function(_0x2850e2){if(_0x2850e2){return db[_0x8816('0x81')][_0x8816('0x82')](function(_0x4960b1){return db[_0x8816('0x83')][_0x8816('0x3a')]({'where':{'FaxAccountId':_0x4c6e10[_0x8816('0x68')]['id']},'transaction':_0x4960b1})[_0x8816('0x24')](function(_0x3f91b1){var _0x54e9ea=_[_0x8816('0x44')](_0x4c6e10[_0x8816('0x61')],function(_0x48f067){_0x48f067[_0x8816('0x6a')]=_0x4c6e10[_0x8816('0x68')]['id'];return _0x48f067;});return db[_0x8816('0x83')][_0x8816('0x84')](_0x54e9ea,{'transaction':_0x4960b1});});})[_0x8816('0x24')](function(){return db['FaxApplication'][_0x8816('0x85')]({'where':{'FaxAccountId':_0x4c6e10[_0x8816('0x68')]['id']},'order':_0x8816('0x86')});});}})[_0x8816('0x24')](respondWithResult(_0x5e152d,null))[_0x8816('0x2d')](handleError(_0x5e152d,null));};exports[_0x8816('0x87')]=function(_0x42758a,_0x836ff5,_0x40159d){var _0x4f589f={};var _0x2f4286={};var _0x1c91b0;var _0x3f75ee;return db[_0x8816('0x45')][_0x8816('0x72')]({'where':{'id':_0x42758a[_0x8816('0x68')]['id']}})[_0x8816('0x24')](handleEntityNotFound(_0x836ff5,null))[_0x8816('0x24')](function(_0x2b5594){if(_0x2b5594){_0x1c91b0=_0x2b5594;_0x2f4286[_0x8816('0x49')]=_[_0x8816('0x4b')](db[_0x8816('0x83')][_0x8816('0x46')]);_0x2f4286[_0x8816('0x4a')]=_[_0x8816('0x4b')](_0x42758a[_0x8816('0x4a')]);_0x2f4286[_0x8816('0x54')]=_[_0x8816('0x4c')](_0x2f4286[_0x8816('0x49')],_0x2f4286[_0x8816('0x4a')]);_0x4f589f[_0x8816('0x4e')]=_[_0x8816('0x4c')](_0x2f4286[_0x8816('0x49')],qs[_0x8816('0x4d')](_0x42758a[_0x8816('0x4a')][_0x8816('0x4d')]));_0x4f589f['attributes']=_0x4f589f[_0x8816('0x4e')][_0x8816('0x5e')]?_0x4f589f[_0x8816('0x4e')]:_0x2f4286[_0x8816('0x49')];_0x4f589f[_0x8816('0x51')]=qs['sort'](_0x42758a[_0x8816('0x4a')][_0x8816('0x52')]);_0x4f589f[_0x8816('0x53')]=qs[_0x8816('0x54')](_[_0x8816('0x55')](_0x42758a[_0x8816('0x4a')],_0x2f4286[_0x8816('0x54')]));if(_0x42758a[_0x8816('0x4a')][_0x8816('0x56')]){_0x4f589f[_0x8816('0x53')]=_[_0x8816('0x57')](_0x4f589f[_0x8816('0x53')],{'$or':_[_0x8816('0x44')](_0x4f589f[_0x8816('0x4e')],function(_0x10829f){var _0x1ba6e8={};_0x1ba6e8[_0x10829f]={'$like':'%'+_0x42758a[_0x8816('0x4a')]['filter']+'%'};return _0x1ba6e8;})});}_0x4f589f=_[_0x8816('0x57')]({},_0x4f589f,_0x42758a[_0x8816('0x59')]);return _0x1c91b0[_0x8816('0x87')](_0x4f589f);}})['then'](function(_0x748c71){if(_0x748c71){_0x3f75ee=_0x748c71[_0x8816('0x5e')];if(!_0x42758a['query'][_0x8816('0x4f')](_0x8816('0x50'))){_0x4f589f[_0x8816('0x33')]=qs['limit'](_0x42758a['query'][_0x8816('0x33')]);_0x4f589f[_0x8816('0x31')]=qs['offset'](_0x42758a['query'][_0x8816('0x31')]);}return _0x1c91b0['getApplications'](_0x4f589f);}})[_0x8816('0x24')](function(_0x51356f){if(_0x51356f){return _0x51356f?{'count':_0x3f75ee,'rows':_0x51356f}:null;}})[_0x8816('0x24')](respondWithResult(_0x836ff5,null))[_0x8816('0x2d')](handleError(_0x836ff5,null));};function Extension(_0x1c153d,_0x2f869d,_0x13dced,_0x17d37b){this['context']=_0x8816('0x88');this[_0x8816('0x89')]=_0x1c153d[_0x8816('0x8a')];this[_0x8816('0x8b')]=_0x17d37b;this[_0x8816('0x47')]=_0x8816('0x8c');this['description']=_0x8816('0x8d');this[_0x8816('0x6a')]=_0x1c153d['id'];this[_0x8816('0x86')]=_0x2f869d;this[_0x8816('0x8e')]=_0x13dced;}function createExtensionsReciveFax(_0x434ec3){var _0x51c589=0x1;var _0x4246fa=[];_0x4246fa[_0x8816('0x8f')](new Extension(_0x434ec3,_0x51c589,'',_0x8816('0x90')));_0x51c589+=0x1;_0x4246fa[_0x8816('0x8f')](new Extension(_0x434ec3,_0x51c589,_0x8816('0x91'),_0x8816('0x92')));_0x51c589+=0x1;for(var _0x17e5e8 in _0x434ec3){if(_0x434ec3[_0x8816('0x4f')](_0x17e5e8)&&(_0x17e5e8===_0x8816('0x93')||_0x17e5e8===_0x8816('0x8a')||_0x17e5e8===_0x8816('0x94')||_0x17e5e8==='faxdetect'||_0x17e5e8===_0x8816('0x95')||_0x17e5e8===_0x8816('0x96')||_0x17e5e8===_0x8816('0x97')||_0x17e5e8===_0x8816('0x98')||_0x17e5e8===_0x8816('0x99'))){_0x4246fa['push'](new Extension(_0x434ec3,_0x51c589,_0x8816('0x9a')+_0x17e5e8+')='+_0x434ec3[_0x17e5e8],_0x8816('0x92')));_0x51c589+=0x1;}}_0x4246fa[_0x8816('0x8f')](new Extension(_0x434ec3,_0x51c589,'6',_0x8816('0x9b')));_0x51c589+=0x1;_0x4246fa[_0x8816('0x8f')](new Extension(_0x434ec3,_0x51c589,_0x8816('0x9c'),'ReceiveFax'));_0x51c589=0x0;return _0x4246fa;}exports[_0x8816('0x9d')]=function(_0x47b746,_0xf4188a,_0x1031d1){var _0x1547d3;return db[_0x8816('0x81')][_0x8816('0x82')](function(_0x5a133d){return db[_0x8816('0x45')][_0x8816('0x60')](_0x47b746[_0x8816('0x61')],{'transaction':_0x5a133d})[_0x8816('0x24')](function(_0x290164){_0x1547d3=_0x290164[_0x8816('0x3b')]({'plain':!![]});return db[_0x8816('0x9e')]['bulkCreate'](createExtensionsReciveFax(_0x1547d3),{'transaction':_0x5a133d});});})[_0x8816('0x24')](function(){return _0x1547d3;})[_0x8816('0x24')](respondWithResult(_0xf4188a,null))[_0x8816('0x2d')](handleError(_0xf4188a,null));};exports['updateAccountApplications']=function(_0x1f03eb,_0x535cc3,_0x1ba3df){var _0x2256fc;return db[_0x8816('0x81')][_0x8816('0x82')](function(_0x3c423e){return db['FaxAccount']['update'](_0x1f03eb[_0x8816('0x61')],{'where':{'id':_0x1f03eb[_0x8816('0x61')]['id']},'transaction':_0x3c423e})[_0x8816('0x24')](function(_0x474b55){return db[_0x8816('0x9e')][_0x8816('0x3a')]({'where':{'FaxAccountId':_0x1f03eb['body']['id']},'transaction':_0x3c423e})[_0x8816('0x24')](function(_0x248832){return db[_0x8816('0x9e')][_0x8816('0x84')](createExtensionsReciveFax(_[_0x8816('0x76')](_0x1f03eb[_0x8816('0x61')],[_0x8816('0x9f'),'key',_0x8816('0xa0'),_0x8816('0xa1'),_0x8816('0xa2'),_0x8816('0xa3')])),{'transaction':_0x3c423e});});});})[_0x8816('0x24')](function(){return db[_0x8816('0x45')]['findById'](_0x1f03eb[_0x8816('0x61')]['id']);})[_0x8816('0x24')](respondWithResult(_0x535cc3,null))[_0x8816('0x2d')](handleError(_0x535cc3,null));};exports['getMessages']=function(_0x52e3d8,_0xf59bd7,_0x26bd67){var _0x4ba33c={'raw':!![],'where':{}};var _0x165b90={};var _0x472434={'count':0x0,'rows':[]};return db[_0x8816('0x45')][_0x8816('0x72')]({'where':{'id':_0x52e3d8[_0x8816('0x68')]['id']}})['then'](handleEntityNotFound(_0xf59bd7,null))[_0x8816('0x24')](function(_0x21654e){if(_0x21654e){_0x165b90[_0x8816('0x49')]=_[_0x8816('0x4b')](db[_0x8816('0xa4')][_0x8816('0x46')]);_0x165b90[_0x8816('0x4a')]=_[_0x8816('0x4b')](_0x52e3d8[_0x8816('0x4a')]);_0x165b90[_0x8816('0x54')]=_[_0x8816('0x4c')](_0x165b90[_0x8816('0x49')],_0x165b90['query']);_0x4ba33c[_0x8816('0x4e')]=_[_0x8816('0x4c')](_0x165b90[_0x8816('0x49')],qs[_0x8816('0x4d')](_0x52e3d8['query'][_0x8816('0x4d')]));_0x4ba33c[_0x8816('0x4e')]=_0x4ba33c[_0x8816('0x4e')][_0x8816('0x5e')]?_0x4ba33c[_0x8816('0x4e')]:_0x165b90[_0x8816('0x49')];if(!_0x52e3d8[_0x8816('0x4a')][_0x8816('0x4f')](_0x8816('0x50'))){_0x4ba33c[_0x8816('0x33')]=qs['limit'](_0x52e3d8[_0x8816('0x4a')]['limit']);_0x4ba33c['offset']=qs['offset'](_0x52e3d8[_0x8816('0x4a')][_0x8816('0x31')]);}_0x4ba33c['order']=qs[_0x8816('0x52')](_0x52e3d8[_0x8816('0x4a')]['sort']);_0x4ba33c[_0x8816('0x53')]=qs['filters'](_[_0x8816('0x55')](_0x52e3d8['query'],_0x165b90[_0x8816('0x54')]));_0x4ba33c['where'][_0x8816('0x6a')]=_0x21654e['id'];if(_0x52e3d8['query'][_0x8816('0x56')]){_0x4ba33c[_0x8816('0x53')]=_[_0x8816('0x57')](_0x4ba33c[_0x8816('0x53')],{'$or':_[_0x8816('0x44')](_0x4ba33c[_0x8816('0x4e')],function(_0x4dd49d){var _0x2db8f1={};_0x2db8f1[_0x4dd49d]={'$like':'%'+_0x52e3d8[_0x8816('0x4a')]['filter']+'%'};return _0x2db8f1;})});}if(_0x52e3d8[_0x8816('0x4a')][_0x8816('0xa5')]){var _0x2ff7e5=_0x52e3d8[_0x8816('0x4a')]['$gte'][_0x8816('0xa6')](',');var _0x31c7d6={};_0x31c7d6[_0x2ff7e5[0x0]]={'$gte':moment(_0x2ff7e5[0x1])['format'](_0x8816('0xa7'))};_0x4ba33c['where']=_[_0x8816('0x57')](_0x4ba33c[_0x8816('0x53')],_0x31c7d6);}_0x4ba33c=_['merge']({},_0x4ba33c,_0x52e3d8['options']);return db[_0x8816('0xa4')]['count']({'where':_0x4ba33c['where']})['then'](function(_0x332d35){_0x472434['count']=_0x332d35;if(_0x52e3d8['query']['includeAll']){_0x4ba33c['include']=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x4ba33c);})['then'](function(_0x4ff7ac){_0x472434[_0x8816('0x5b')]=_0x4ff7ac;return _0x472434;});}})[_0x8816('0x24')](respondWithFilteredResult(_0xf59bd7,_0x4ba33c))['catch'](handleError(_0xf59bd7,null));};exports[_0x8816('0x41')]=function(_0x562c2d,_0x240055,_0x55fb1b){var _0x490479,_0x525e17={},_0x11898e;if(_0x562c2d[_0x8816('0x61')]['to']){_0x11898e=_0x562c2d[_0x8816('0x61')]['to'][0x0];}return db['FaxAccount'][_0x8816('0x65')]({'where':{'id':_0x562c2d[_0x8816('0x68')]['id']},'include':[{'model':db[_0x8816('0xa8')],'as':_0x8816('0xa9'),'include':[{'model':db[_0x8816('0x78')],'as':'Contacts','where':{'fax':_0x11898e},'limit':0x1,'order':[['updatedAt',_0x8816('0xaa')]]}]}]})[_0x8816('0x24')](handleEntityNotFound(_0x240055,null))[_0x8816('0x24')](function(_0x1cd6e0){_0x490479=_0x1cd6e0;if(_0x562c2d[_0x8816('0x61')][_0x8816('0xab')]&&_0x562c2d[_0x8816('0x61')]['attachments']['length']){for(var _0x451f63=0x0;_0x451f63<_0x562c2d[_0x8816('0x61')][_0x8816('0xab')][_0x8816('0x5e')];_0x451f63+=0x1){_0x562c2d['body'][_0x8816('0xab')][_0x451f63]={'filename':_0x562c2d[_0x8816('0x61')][_0x8816('0xab')][_0x451f63]['name'],'id':_0x562c2d[_0x8816('0x61')]['attachments'][_0x451f63]['id'],'path':path[_0x8816('0xac')](config[_0x8816('0xad')],_0x8816('0xae'),_0x562c2d['body'][_0x8816('0xab')][_0x451f63][_0x8816('0xaf')])};}}return respondWithRpcPromise(_0x8816('0xb0'),'CheckAfterSend',{'FaxAccountId':_['isNil'](_0x562c2d['params']['id'])?undefined:_0x562c2d['params']['id'],'path':_[_0x8816('0xb1')](_0x562c2d['body'][_0x8816('0xab')][0x0][_0x8816('0x8')])?undefined:_0x562c2d[_0x8816('0x61')][_0x8816('0xab')][0x0][_0x8816('0x8')],'fax':_['isNil'](_0x562c2d['body']['to'][0x0])?undefined:_0x562c2d[_0x8816('0x61')]['to'][0x0]},client9002);})[_0x8816('0x24')](function(){if(_0x490479){if(_[_0x8816('0xb1')](_0x562c2d[_0x8816('0x61')][_0x8816('0xb2')])){_0x562c2d[_0x8816('0x61')][_0x8816('0xb2')]=util[_0x8816('0xb3')](_0x8816('0xb4'),_0x490479[_0x8816('0x40')],_0x490479[_0x8816('0xb5')]);}if(_0x490479[_0x8816('0xa9')]){if(_0x490479[_0x8816('0xa9')][_0x8816('0xb6')]['length']){return _0x490479['List']['Contacts'][0x0];}else{return db[_0x8816('0x78')][_0x8816('0x60')](_[_0x8816('0x1b')](_0x562c2d['body'],{'firstName':_0x562c2d['body']['to'][0x0],'phone':_0x562c2d[_0x8816('0x61')]['to'][0x0],'fax':_0x562c2d[_0x8816('0x61')]['to'][0x0],'ListId':_0x490479['ListId']}));}}else{throw new Error(_0x8816('0xb7'));}}else{throw new Error(_0x8816('0xb8'));}})['then'](function(_0x2b84f7){if(_0x2b84f7){return db[_0x8816('0x75')][_0x8816('0x65')]({'where':{'ContactId':_0x2b84f7['id'],'closed':![],'FaxAccountId':_0x490479['id']}})[_0x8816('0x24')](function(_0x32d7b2){if(_0x32d7b2){return[_0x32d7b2,![]];}return db[_0x8816('0x75')][_0x8816('0x60')]({'UserId':_0x562c2d[_0x8816('0x63')]['id'],'ContactId':_0x2b84f7['id'],'FaxAccountId':_0x490479['id'],'fax':_0x562c2d[_0x8816('0x61')]['to'][0x0],'firstMsgDirection':_0x8816('0xb9'),'Messages':[_[_0x8816('0x57')](_0x562c2d[_0x8816('0x61')],{'read':![],'body':_0x562c2d[_0x8816('0x61')][_0x8816('0xab')][0x0][_0x8816('0xba')],'FaxAccountId':_0x490479['id'],'UserId':_0x562c2d[_0x8816('0x63')]['id'],'ContactId':_0x2b84f7['id'],'AttachmentId':_0x562c2d['body'][_0x8816('0xab')][0x0]['id']})]},{'include':[{'model':db[_0x8816('0xa4')],'as':_0x8816('0xbb')}]})['then'](function(_0x83890b){return[_0x83890b,!![]];});});}else{throw new Error(_0x8816('0xbc'));}})[_0x8816('0xbd')](function(_0x1d5ea3,_0x1768f2){if(_0x1768f2){return _0x1d5ea3;}return db[_0x8816('0xa4')]['create']({'direction':_0x8816('0xb9'),'read':![],'body':_0x562c2d[_0x8816('0x61')][_0x8816('0xab')][0x0][_0x8816('0xba')],'FaxAccountId':_0x490479['id'],'FaxInteractionId':_0x1d5ea3['id'],'UserId':_0x562c2d[_0x8816('0x63')]['id'],'ContactId':_0x1d5ea3[_0x8816('0xbe')],'AttachmentId':_0x562c2d['body'][_0x8816('0xab')][0x0]['id']})[_0x8816('0x24')](function(_0x2014dc){_0x1d5ea3['dataValues']['Messages']=[];_0x1d5ea3[_0x8816('0xbf')]['Messages'][_0x8816('0x8f')](_0x2014dc[_0x8816('0xbf')]);return _0x1d5ea3;});})[_0x8816('0x24')](function(_0xb9ef98){respondWithRpcPromise(_0x8816('0xc0'),_0x8816('0xc0'),{'FaxAccountId':_[_0x8816('0xb1')](_0x562c2d[_0x8816('0x68')]['id'])?undefined:_0x562c2d['params']['id'],'path':_[_0x8816('0xb1')](_0x562c2d['body'][_0x8816('0xab')][0x0][_0x8816('0x8')])?undefined:_0x562c2d[_0x8816('0x61')][_0x8816('0xab')][0x0][_0x8816('0x8')],'fax':_['isNil'](_0x562c2d['body']['to'][0x0])?undefined:_0x562c2d[_0x8816('0x61')]['to'][0x0],'AttachmentId':_0x562c2d[_0x8816('0x61')]['attachments'][0x0]['id']},client9002)[_0x8816('0x24')](function(_0x3c73e7){logger[_0x8816('0x2b')](_0x8816('0xc1'),_0x3c73e7);})[_0x8816('0x2d')](function(_0x2111a2){logger[_0x8816('0x2b')]('SendFaxRpc,\x20%s',_0x2111a2);});return _0xb9ef98;})[_0x8816('0x24')](respondWithResult(_0x240055,null))[_0x8816('0x2d')](handleError(_0x240055,null));};exports[_0x8816('0xc2')]=function(_0x38af48,_0x43838e,_0x2c1c21){return db[_0x8816('0x45')][_0x8816('0x65')]({'where':{'id':_0x38af48[_0x8816('0x68')]['id']}})[_0x8816('0x24')](handleEntityNotFound(_0x43838e,null))[_0x8816('0x24')](function(_0x88218d){if(_0x88218d){return _0x88218d['addAgents'](_0x38af48['body']['ids'],_['omit'](_0x38af48[_0x8816('0x61')],[_0x8816('0x6f'),'id'])||{})[_0x8816('0xbd')](function(_0x67772){for(var _0x29be28=0x0;_0x29be28<_0x38af48[_0x8816('0x61')]['ids'][_0x8816('0x5e')];_0x29be28+=0x1){socket[_0x8816('0xc3')](_0x8816('0xc4'),{'UserId':Number(_0x38af48[_0x8816('0x61')][_0x8816('0x6f')][_0x29be28]),'FaxAccountId':Number(_0x38af48[_0x8816('0x68')]['id'])});}return _0x67772;});}})[_0x8816('0x24')](respondWithResult(_0x43838e,null))[_0x8816('0x2d')](handleError(_0x43838e,null));};exports[_0x8816('0xc5')]=function(_0x16a3aa,_0x15f385,_0x5decb9){return db[_0x8816('0x45')][_0x8816('0x65')]({'where':{'id':_0x16a3aa[_0x8816('0x68')]['id']}})['then'](handleEntityNotFound(_0x15f385,null))['then'](function(_0x343939){if(_0x343939){return _0x343939['removeAgents'](_0x16a3aa[_0x8816('0x4a')][_0x8816('0x6f')])[_0x8816('0x24')](function(){if(_['isArray'](_0x16a3aa[_0x8816('0x4a')][_0x8816('0x6f')])){for(var _0x5d996c=0x0;_0x5d996c<_0x16a3aa[_0x8816('0x4a')][_0x8816('0x6f')][_0x8816('0x5e')];_0x5d996c+=0x1){socket['emit'](_0x8816('0xc6'),{'UserId':Number(_0x16a3aa[_0x8816('0x4a')][_0x8816('0x6f')][_0x5d996c]),'FaxAccountId':Number(_0x16a3aa[_0x8816('0x68')]['id'])});}}else{socket[_0x8816('0xc3')]('userFaxAccount:remove',{'UserId':Number(_0x16a3aa[_0x8816('0x4a')][_0x8816('0x6f')]),'FaxAccountId':Number(_0x16a3aa['params']['id'])});}});}})[_0x8816('0x24')](respondWithStatusCode(_0x15f385,null))['catch'](handleError(_0x15f385,null));};exports[_0x8816('0xc7')]=function(_0x4bd698,_0x481e55,_0x10ac42){var _0x4e5ea9={};var _0x447b77={};var _0x504bba;var _0x263805;return db[_0x8816('0x45')]['findOne']({'where':{'id':_0x4bd698[_0x8816('0x68')]['id']}})[_0x8816('0x24')](handleEntityNotFound(_0x481e55,null))[_0x8816('0x24')](function(_0x29e032){if(_0x29e032){_0x504bba=_0x29e032;_0x447b77[_0x8816('0x49')]=_[_0x8816('0x4b')](db['User']['rawAttributes']);_0x447b77[_0x8816('0x4a')]=_[_0x8816('0x4b')](_0x4bd698[_0x8816('0x4a')]);_0x447b77[_0x8816('0x54')]=_['intersection'](_0x447b77[_0x8816('0x49')],_0x447b77[_0x8816('0x4a')]);_0x4e5ea9[_0x8816('0x4e')]=_[_0x8816('0x4c')](_0x447b77['model'],qs['fields'](_0x4bd698[_0x8816('0x4a')]['fields']));_0x4e5ea9[_0x8816('0x4e')]=_0x4e5ea9['attributes'][_0x8816('0x5e')]?_0x4e5ea9[_0x8816('0x4e')]:_0x447b77[_0x8816('0x49')];_0x4e5ea9[_0x8816('0x51')]=qs[_0x8816('0x52')](_0x4bd698[_0x8816('0x4a')][_0x8816('0x52')]);_0x4e5ea9[_0x8816('0x53')]=qs[_0x8816('0x54')](_['pick'](_0x4bd698[_0x8816('0x4a')],_0x447b77['filters']));if(_0x4bd698[_0x8816('0x4a')][_0x8816('0x56')]){_0x4e5ea9[_0x8816('0x53')]=_[_0x8816('0x57')](_0x4e5ea9[_0x8816('0x53')],{'$or':_[_0x8816('0x44')](_0x4e5ea9[_0x8816('0x4e')],function(_0x39b031){var _0xe1242e={};_0xe1242e[_0x39b031]={'$like':'%'+_0x4bd698[_0x8816('0x4a')][_0x8816('0x56')]+'%'};return _0xe1242e;})});}_0x4e5ea9=_['merge']({},_0x4e5ea9,_0x4bd698[_0x8816('0x59')]);return _0x504bba[_0x8816('0xc7')](_0x4e5ea9);}})[_0x8816('0x24')](function(_0x5a6b04){if(_0x5a6b04){_0x263805=_0x5a6b04['length'];if(!_0x4bd698[_0x8816('0x4a')][_0x8816('0x4f')](_0x8816('0x50'))){_0x4e5ea9['limit']=qs[_0x8816('0x33')](_0x4bd698[_0x8816('0x4a')][_0x8816('0x33')]);_0x4e5ea9[_0x8816('0x31')]=qs[_0x8816('0x31')](_0x4bd698[_0x8816('0x4a')]['offset']);}return _0x504bba[_0x8816('0xc7')](_0x4e5ea9);}})['then'](function(_0x195039){if(_0x195039){return _0x195039?{'count':_0x263805,'rows':_0x195039}:null;}})[_0x8816('0x24')](respondWithResult(_0x481e55,null))[_0x8816('0x2d')](handleError(_0x481e55,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index bd51ed8..5b4dca4 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 _0x0413=['save','update','emit','hasOwnProperty','hook','exports','events','FaxAccount','setMaxListeners'];(function(_0x5033b2,_0x303ec1){var _0x2f16c0=function(_0x381dbf){while(--_0x381dbf){_0x5033b2['push'](_0x5033b2['shift']());}};_0x2f16c0(++_0x303ec1);}(_0x0413,0xc3));var _0x3041=function(_0x4a440b,_0xedaa5b){_0x4a440b=_0x4a440b-0x0;var _0x25c667=_0x0413[_0x4a440b];return _0x25c667;};'use strict';var EventEmitter=require(_0x3041('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0x3041('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x3041('0x2')](0x0);var events={'afterCreate':_0x3041('0x3'),'afterUpdate':_0x3041('0x4'),'afterDestroy':'remove'};function emitEvent(_0x54281d){return function(_0x6c6636,_0x443c26,_0x1086ab){FaxAccountEvents[_0x3041('0x5')](_0x54281d+':'+_0x6c6636['id'],_0x6c6636);FaxAccountEvents[_0x3041('0x5')](_0x54281d,_0x6c6636);_0x1086ab(null);};}for(var e in events){if(events[_0x3041('0x6')](e)){var event=events[e];FaxAccount[_0x3041('0x7')](e,emitEvent(event));}}module[_0x3041('0x8')]=FaxAccountEvents; \ No newline at end of file +var _0x3563=['exports','events','FaxAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x103567,_0x53fdc3){var _0x5cf64b=function(_0x2f17bd){while(--_0x2f17bd){_0x103567['push'](_0x103567['shift']());}};_0x5cf64b(++_0x53fdc3);}(_0x3563,0x17b));var _0x3356=function(_0x2c5f38,_0x1c2350){_0x2c5f38=_0x2c5f38-0x0;var _0x5db7fc=_0x3563[_0x2c5f38];return _0x5db7fc;};'use strict';var EventEmitter=require(_0x3356('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0x3356('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x3356('0x2')](0x0);var events={'afterCreate':_0x3356('0x3'),'afterUpdate':_0x3356('0x4'),'afterDestroy':_0x3356('0x5')};function emitEvent(_0x4c76a2){return function(_0x48b625,_0x41ab33,_0x5ceefc){FaxAccountEvents[_0x3356('0x6')](_0x4c76a2+':'+_0x48b625['id'],_0x48b625);FaxAccountEvents['emit'](_0x4c76a2,_0x48b625);_0x5ceefc(null);};}for(var e in events){if(events[_0x3356('0x7')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x3356('0x8')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index d5aa323..5441c9a 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 _0x0e56=['FaxAccount','fax_accounts','lodash','util','../../config/logger','bluebird','request-promise','../../config/environment','./faxAccount.attributes','exports','define'];(function(_0x32f05c,_0x273aef){var _0x4307ed=function(_0x1be4da){while(--_0x1be4da){_0x32f05c['push'](_0x32f05c['shift']());}};_0x4307ed(++_0x273aef);}(_0x0e56,0x1ba));var _0x60e5=function(_0x312962,_0x282d40){_0x312962=_0x312962-0x0;var _0x3e85d0=_0x0e56[_0x312962];return _0x3e85d0;};'use strict';var _=require(_0x60e5('0x0'));var util=require(_0x60e5('0x1'));var logger=require(_0x60e5('0x2'))('api');var moment=require('moment');var BPromise=require(_0x60e5('0x3'));var rp=require(_0x60e5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x60e5('0x5'));var attributes=require(_0x60e5('0x6'));module[_0x60e5('0x7')]=function(_0x4d22e4,_0x4e5c7e){return _0x4d22e4[_0x60e5('0x8')](_0x60e5('0x9'),attributes,{'tableName':_0x60e5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac28=['fax_accounts','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./faxAccount.attributes','define','FaxAccount'];(function(_0x36b2e2,_0x424c2f){var _0xc234a1=function(_0x3d0e06){while(--_0x3d0e06){_0x36b2e2['push'](_0x36b2e2['shift']());}};_0xc234a1(++_0x424c2f);}(_0xac28,0x14b));var _0x8ac2=function(_0x1b8e29,_0x7eccc9){_0x1b8e29=_0x1b8e29-0x0;var _0x2f54f0=_0xac28[_0x1b8e29];return _0x2f54f0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8ac2('0x0'))(_0x8ac2('0x1'));var moment=require(_0x8ac2('0x2'));var BPromise=require(_0x8ac2('0x3'));var rp=require(_0x8ac2('0x4'));var fs=require('fs');var path=require(_0x8ac2('0x5'));var rimraf=require('rimraf');var config=require(_0x8ac2('0x6'));var attributes=require(_0x8ac2('0x7'));module['exports']=function(_0x172e74,_0x3f2f41){return _0x172e74[_0x8ac2('0x8')](_0x8ac2('0x9'),attributes,{'tableName':_0x8ac2('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 c0a8e3c..be0a1b1 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 _0x6319=['options','raw','where','attributes','include','map','model','then','info','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','keys','CompanyId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','FaxAccount','account','CmList','List','DESC','FaxApplication','get','list','applications','orderBy','asc','Applications','Contacts','length','ListId','create','FaxInteraction','find','Contact\x20not\x20found','spread','autoclose','push','*,*,*,*','created','FaxMessage','ContactId','AttachmentId','UserId','User','interaction','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','request\x20sent','debug','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','GetFaxAccount','findAll'];(function(_0x2b18d8,_0x21778e){var _0x2bcce2=function(_0xc14e4b){while(--_0xc14e4b){_0x2b18d8['push'](_0x2b18d8['shift']());}};_0x2bcce2(++_0x21778e);}(_0x6319,0x9c));var _0x9631=function(_0x2a2906,_0x559f84){_0x2a2906=_0x2a2906-0x0;var _0xb00967=_0x6319[_0x2a2906];return _0xb00967;};'use strict';var _=require(_0x9631('0x0'));var util=require('util');var moment=require(_0x9631('0x1'));var BPromise=require('bluebird');var rs=require(_0x9631('0x2'));var fs=require('fs');var Redis=require(_0x9631('0x3'));var db=require(_0x9631('0x4'))['db'];var utils=require(_0x9631('0x5'));var logger=require(_0x9631('0x6'))(_0x9631('0x7'));var config=require(_0x9631('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9631('0x9')]['http']({'port':0x232c});config[_0x9631('0xa')]=_[_0x9631('0xb')](config[_0x9631('0xa')],{'host':_0x9631('0xc'),'port':0x18eb});var socket=require(_0x9631('0xd'))(new Redis(config[_0x9631('0xa')]));require(_0x9631('0xe'))[_0x9631('0xf')](socket);function respondWithRpcPromise(_0x135220,_0x51283b,_0x5c4599){return new BPromise(function(_0x40e3ac,_0x5de858){return client[_0x9631('0x10')](_0x135220,_0x5c4599)['then'](function(_0x27d175){logger['info']('FaxAccount,\x20%s,\x20%s',_0x51283b,_0x9631('0x11'));logger[_0x9631('0x12')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x51283b,_0x9631('0x11'),JSON[_0x9631('0x13')](_0x27d175));if(_0x27d175[_0x9631('0x14')]){if(_0x27d175[_0x9631('0x14')][_0x9631('0x15')]===0x1f4){logger[_0x9631('0x14')](_0x9631('0x16'),_0x51283b,_0x27d175['error'][_0x9631('0x17')]);return _0x5de858(_0x27d175[_0x9631('0x14')]['message']);}logger['error'](_0x9631('0x16'),_0x51283b,_0x27d175[_0x9631('0x14')][_0x9631('0x17')]);return _0x40e3ac(_0x27d175[_0x9631('0x14')]['message']);}else{logger['info'](_0x9631('0x16'),_0x51283b,_0x9631('0x11'));_0x40e3ac(_0x27d175[_0x9631('0x18')][_0x9631('0x17')]);}})[_0x9631('0x19')](function(_0x125b1d){logger[_0x9631('0x14')]('FaxAccount,\x20%s,\x20%s',_0x51283b,_0x125b1d);_0x5de858(_0x125b1d);});});}exports[_0x9631('0x1a')]=function(_0x4db04a){var _0x562096=this;return new Promise(function(_0x551fb5,_0x4c7c62){return db['FaxAccount'][_0x9631('0x1b')]({'raw':_0x4db04a['options']?_0x4db04a[_0x9631('0x1c')][_0x9631('0x1d')]===undefined?!![]:![]:!![],'where':_0x4db04a[_0x9631('0x1c')]?_0x4db04a[_0x9631('0x1c')][_0x9631('0x1e')]||null:null,'attributes':_0x4db04a[_0x9631('0x1c')]?_0x4db04a[_0x9631('0x1c')][_0x9631('0x1f')]||null:null,'limit':_0x4db04a[_0x9631('0x1c')]?_0x4db04a[_0x9631('0x1c')]['limit']||null:null,'include':_0x4db04a['options']?_0x4db04a[_0x9631('0x1c')][_0x9631('0x20')]?_[_0x9631('0x21')](_0x4db04a[_0x9631('0x1c')]['include'],function(_0x4c7553){return{'model':db[_0x4c7553[_0x9631('0x22')]],'as':_0x4c7553['as'],'attributes':_0x4c7553[_0x9631('0x1f')],'include':_0x4c7553[_0x9631('0x20')]?_[_0x9631('0x21')](_0x4c7553[_0x9631('0x20')],function(_0x1b675e){return{'model':db[_0x1b675e[_0x9631('0x22')]],'as':_0x1b675e['as'],'attributes':_0x1b675e[_0x9631('0x1f')],'include':_0x1b675e[_0x9631('0x20')]?_[_0x9631('0x21')](_0x1b675e['include'],function(_0x2dee32){return{'model':db[_0x2dee32[_0x9631('0x22')]],'as':_0x2dee32['as'],'attributes':_0x2dee32['attributes']};}):[]};}):[]};}):[]:[]})[_0x9631('0x23')](function(_0x6f63b){logger[_0x9631('0x24')](_0x9631('0x1a'),_0x4db04a);logger[_0x9631('0x12')]('GetFaxAccount',_0x4db04a,JSON['stringify'](_0x6f63b));_0x551fb5(_0x6f63b);})[_0x9631('0x19')](function(_0x2d1d40){logger[_0x9631('0x14')](_0x9631('0x1a'),_0x2d1d40[_0x9631('0x17')],_0x4db04a);_0x4c7c62(_0x562096[_0x9631('0x14')](0x1f4,_0x2d1d40[_0x9631('0x17')]));});});};exports[_0x9631('0x25')]=function(_0x212e0e,_0x2d746e,_0x482a53){var _0xa70dbb=this;return new Promise(function(_0x34922c,_0x3d749e){var _0x5102f5={'body':_0x212e0e[_0x9631('0x26')],'channel':_0x9631('0x27')};var _0x3bbb9f=[];var _0x15d780=[];var _0x27d467={};return db[_0x9631('0x28')][_0x9631('0x29')]()[_0x9631('0x23')](function(_0x26e13b){if(!_0x26e13b){throw new db[(_0x9631('0x2a'))][(_0x9631('0x2b'))](_0x9631('0x2c'));}_0x3bbb9f=_['difference'](_['keys'](_0x26e13b),[_0x9631('0x2d'),_0x9631('0x2e')]);_0x15d780=_['difference'](_[_0x9631('0x2f')](_0x26e13b),['createdAt',_0x9631('0x2e'),_0x9631('0x30'),'ListId']);if(_0x212e0e[_0x9631('0x26')]['id']){delete _0x212e0e[_0x9631('0x26')]['id'];}if(_[_0x9631('0x31')](_0x212e0e['body']['from'])){throw new db[(_0x9631('0x2a'))][(_0x9631('0x2b'))](_0x9631('0x32'));}if(_[_0x9631('0x31')](_0x212e0e['body'][_0x9631('0x26')])||_0x212e0e[_0x9631('0x26')][_0x9631('0x26')]===''){throw new db[(_0x9631('0x2a'))][(_0x9631('0x2b'))](_0x9631('0x33'));}if(_[_0x9631('0x31')](_0x212e0e[_0x9631('0x26')][_0x9631('0x34')])){throw new db[(_0x9631('0x2a'))][(_0x9631('0x2b'))](_0x9631('0x35')+_0x15d780);}if(!_[_0x9631('0x36')](_0x15d780,_0x212e0e['body'][_0x9631('0x34')])){throw new db[(_0x9631('0x2a'))][(_0x9631('0x2b'))](_0x9631('0x37')+_0x15d780);}_0x27d467[_0x212e0e['body'][_0x9631('0x34')]]=_0x212e0e['body'][_0x9631('0x38')];})[_0x9631('0x23')](function(){return db[_0x9631('0x39')]['find']({'where':{'id':_0x212e0e[_0x9631('0x3a')]['id']},'include':[{'model':db[_0x9631('0x3b')],'as':_0x9631('0x3c'),'include':[{'model':db[_0x9631('0x28')],'as':'Contacts','where':_0x27d467,'limit':0x1,'order':[[_0x9631('0x2e'),_0x9631('0x3d')]]}]},{'model':db[_0x9631('0x3e')],'as':'Applications'}]});})['then'](function(_0x16b1a0){if(_0x16b1a0&&_0x16b1a0[_0x9631('0x3c')]){var _0x2de1bc=_0x16b1a0[_0x9631('0x3f')]({'plain':!![]});_0x5102f5['account']=_0x2de1bc;_0x5102f5['applications']=_0x2de1bc['Applications'];_0x5102f5[_0x9631('0x40')]=_0x2de1bc['List'];_0x5102f5[_0x9631('0x41')]=_[_0x9631('0x42')](_0x5102f5['applications'],['priority'],[_0x9631('0x43')]);if(_0x5102f5[_0x9631('0x3a')][_0x9631('0x44')]){delete _0x5102f5[_0x9631('0x3a')][_0x9631('0x44')];}if(_0x5102f5[_0x9631('0x3a')]['List']&&_0x5102f5['account'][_0x9631('0x3c')][_0x9631('0x45')][_0x9631('0x46')]){return _0x5102f5[_0x9631('0x3a')][_0x9631('0x3c')][_0x9631('0x45')][0x0];}var _0x113572=_['defaults'](_0x212e0e['body'],{'firstName':_0x212e0e['body'][_0x9631('0x38')],'ListId':_0x2de1bc[_0x9631('0x47')]});_0x113572[_0x212e0e['body']['mapKey']]=_0x212e0e[_0x9631('0x26')][_0x9631('0x38')];return db['CmContact'][_0x9631('0x48')](_0x113572,{'fields':_0x3bbb9f,'raw':!![]});}})[_0x9631('0x23')](function(_0x5e79c8){_0x5102f5['contact']=_0x5e79c8;if(_0x5e79c8){var _0x507897={'ContactId':_0x5e79c8['id'],'FaxAccountId':_0x212e0e[_0x9631('0x3a')]['id'],'fax':_0x5e79c8[_0x9631('0x27')]};return db[_0x9631('0x49')][_0x9631('0x4a')]({'where':{'ContactId':_0x5e79c8['id'],'closed':![],'FaxAccountId':_0x212e0e[_0x9631('0x3a')]['id']}})['then'](function(_0x3dbde1){if(_0x3dbde1){return[_0x3dbde1,![]];}return db[_0x9631('0x49')][_0x9631('0x48')](_0x507897)[_0x9631('0x23')](function(_0x4d0d4e){return[_0x4d0d4e,!![]];});});}else{throw new Error(_0x9631('0x4b'));}})[_0x9631('0x4c')](function(_0xc1de77,_0x50303a){var _0x466d60=_0xc1de77[_0x9631('0x3f')]({'plain':!![]});if(_0x50303a){if(_0x5102f5[_0x9631('0x3a')][_0x9631('0x4d')]){_0x5102f5[_0x9631('0x41')][_0x9631('0x4e')]({'id':0x0,'priority':_0x5102f5['applications'][_0x9631('0x46')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x9631('0x4f')});}_0x466d60['created']=!![];}else{_0x466d60[_0x9631('0x50')]=![];}_0x5102f5['interaction']=_0x466d60;return db[_0x9631('0x51')][_0x9631('0x48')]({'body':_0x212e0e['body'][_0x9631('0x26')],'FaxAccountId':_0x212e0e[_0x9631('0x3a')]['id'],'FaxInteractionId':_0xc1de77['id'],'direction':'in','ContactId':_0xc1de77[_0x9631('0x52')],'AttachmentId':_0x212e0e[_0x9631('0x26')][_0x9631('0x53')]});})[_0x9631('0x23')](function(_0x4e9c14){_0x5102f5[_0x9631('0x17')]=_0x4e9c14;if(_0x5102f5['interaction'][_0x9631('0x54')]){return db[_0x9631('0x55')][_0x9631('0x4a')]({'attributes':['id','name'],'where':{'id':_0x5102f5[_0x9631('0x56')]['UserId']}})[_0x9631('0x23')](function(_0x2d02e4){if(_0x2d02e4){_0x5102f5[_0x9631('0x41')][_0x9631('0x57')]({'id':0x0,'priority':0x0,'app':_0x9631('0x58'),'appdata':_0x2d02e4['name']+','+(_0x5102f5[_0x9631('0x3a')][_0x9631('0x59')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x9631('0x5a'),_0x9631('0x5b'),_0x5102f5);});}return respondWithRpcPromise(_0x9631('0x5a'),_0x9631('0x5b'),_0x5102f5);})[_0x9631('0x23')](function(_0x3b47e1){_0x34922c(_0x3b47e1);})['catch'](function(_0x2d86b2){_0x3d749e(_0xa70dbb[_0x9631('0x14')](0x1f4,_0x2d86b2['message']));});});}; \ No newline at end of file +var _0x1be8=['Contact\x20not\x20found','spread','autoclose','push','unmanaged','*,*,*,*','interaction','FaxMessage','ContactId','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxAccount,\x20%s,\x20%s','catch','GetFaxAccount','FaxAccount','options','raw','where','attributes','limit','include','map','model','body','fax','describe','Sequelize','ValidationError','difference','keys','updatedAt','createdAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','find','account','CmList','List','CmContact','Contacts','DESC','FaxApplication','Applications','get','applications','orderBy','priority','FaxInteraction','create'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x1be8,0x119));var _0x81be=function(_0x4ad0f7,_0x1920b0){_0x4ad0f7=_0x4ad0f7-0x0;var _0x30f5c8=_0x1be8[_0x4ad0f7];return _0x30f5c8;};'use strict';var _=require(_0x81be('0x0'));var util=require(_0x81be('0x1'));var moment=require(_0x81be('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x81be('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x81be('0x4'));var logger=require(_0x81be('0x5'))(_0x81be('0x6'));var config=require(_0x81be('0x7'));var jayson=require(_0x81be('0x8'));var client=jayson['client'][_0x81be('0x9')]({'port':0x232c});config[_0x81be('0xa')]=_[_0x81be('0xb')](config[_0x81be('0xa')],{'host':_0x81be('0xc'),'port':0x18eb});var socket=require(_0x81be('0xd'))(new Redis(config[_0x81be('0xa')]));require(_0x81be('0xe'))[_0x81be('0xf')](socket);function respondWithRpcPromise(_0x5081a4,_0x5704d1,_0x5b6065){return new BPromise(function(_0x2ca43a,_0x44e5e7){return client[_0x81be('0x10')](_0x5081a4,_0x5b6065)[_0x81be('0x11')](function(_0x10c092){logger[_0x81be('0x12')]('FaxAccount,\x20%s,\x20%s',_0x5704d1,_0x81be('0x13'));logger[_0x81be('0x14')](_0x81be('0x15'),_0x5704d1,_0x81be('0x13'),JSON[_0x81be('0x16')](_0x10c092));if(_0x10c092[_0x81be('0x17')]){if(_0x10c092['error'][_0x81be('0x18')]===0x1f4){logger[_0x81be('0x17')]('FaxAccount,\x20%s,\x20%s',_0x5704d1,_0x10c092[_0x81be('0x17')][_0x81be('0x19')]);return _0x44e5e7(_0x10c092[_0x81be('0x17')][_0x81be('0x19')]);}logger[_0x81be('0x17')](_0x81be('0x1a'),_0x5704d1,_0x10c092[_0x81be('0x17')]['message']);return _0x2ca43a(_0x10c092['error'][_0x81be('0x19')]);}else{logger[_0x81be('0x12')]('FaxAccount,\x20%s,\x20%s',_0x5704d1,_0x81be('0x13'));_0x2ca43a(_0x10c092['result']['message']);}})[_0x81be('0x1b')](function(_0x3a5e94){logger[_0x81be('0x17')](_0x81be('0x1a'),_0x5704d1,_0x3a5e94);_0x44e5e7(_0x3a5e94);});});}exports[_0x81be('0x1c')]=function(_0x4df9e8){var _0x410a1c=this;return new Promise(function(_0x7ddeb2,_0x39f0ea){return db[_0x81be('0x1d')]['findAll']({'raw':_0x4df9e8['options']?_0x4df9e8[_0x81be('0x1e')][_0x81be('0x1f')]===undefined?!![]:![]:!![],'where':_0x4df9e8[_0x81be('0x1e')]?_0x4df9e8['options'][_0x81be('0x20')]||null:null,'attributes':_0x4df9e8[_0x81be('0x1e')]?_0x4df9e8[_0x81be('0x1e')][_0x81be('0x21')]||null:null,'limit':_0x4df9e8[_0x81be('0x1e')]?_0x4df9e8[_0x81be('0x1e')][_0x81be('0x22')]||null:null,'include':_0x4df9e8[_0x81be('0x1e')]?_0x4df9e8[_0x81be('0x1e')][_0x81be('0x23')]?_[_0x81be('0x24')](_0x4df9e8[_0x81be('0x1e')][_0x81be('0x23')],function(_0x41f530){return{'model':db[_0x41f530[_0x81be('0x25')]],'as':_0x41f530['as'],'attributes':_0x41f530[_0x81be('0x21')],'include':_0x41f530[_0x81be('0x23')]?_['map'](_0x41f530[_0x81be('0x23')],function(_0x3168cf){return{'model':db[_0x3168cf[_0x81be('0x25')]],'as':_0x3168cf['as'],'attributes':_0x3168cf[_0x81be('0x21')],'include':_0x3168cf[_0x81be('0x23')]?_[_0x81be('0x24')](_0x3168cf[_0x81be('0x23')],function(_0x328a94){return{'model':db[_0x328a94[_0x81be('0x25')]],'as':_0x328a94['as'],'attributes':_0x328a94[_0x81be('0x21')]};}):[]};}):[]};}):[]:[]})[_0x81be('0x11')](function(_0x92aa35){logger[_0x81be('0x12')](_0x81be('0x1c'),_0x4df9e8);logger[_0x81be('0x14')](_0x81be('0x1c'),_0x4df9e8,JSON[_0x81be('0x16')](_0x92aa35));_0x7ddeb2(_0x92aa35);})[_0x81be('0x1b')](function(_0x3b3565){logger['error'](_0x81be('0x1c'),_0x3b3565[_0x81be('0x19')],_0x4df9e8);_0x39f0ea(_0x410a1c[_0x81be('0x17')](0x1f4,_0x3b3565[_0x81be('0x19')]));});});};exports['NotifyFaxAccount']=function(_0x453e90,_0x3a2470,_0x165a0c){var _0x24145d=this;return new Promise(function(_0x566d9a,_0x4e927c){var _0x37d082={'body':_0x453e90[_0x81be('0x26')],'channel':_0x81be('0x27')};var _0x422c58=[];var _0x4a4251=[];var _0x593cb9={};return db['CmContact'][_0x81be('0x28')]()[_0x81be('0x11')](function(_0x4e0c9c){if(!_0x4e0c9c){throw new db[(_0x81be('0x29'))][(_0x81be('0x2a'))]('no\x20available\x20attributes');}_0x422c58=_[_0x81be('0x2b')](_[_0x81be('0x2c')](_0x4e0c9c),['createdAt',_0x81be('0x2d')]);_0x4a4251=_[_0x81be('0x2b')](_[_0x81be('0x2c')](_0x4e0c9c),[_0x81be('0x2e'),_0x81be('0x2d'),_0x81be('0x2f'),_0x81be('0x30')]);if(_0x453e90[_0x81be('0x26')]['id']){delete _0x453e90[_0x81be('0x26')]['id'];}if(_[_0x81be('0x31')](_0x453e90[_0x81be('0x26')][_0x81be('0x32')])){throw new db['Sequelize'][(_0x81be('0x2a'))](_0x81be('0x33'));}if(_[_0x81be('0x31')](_0x453e90['body']['body'])||_0x453e90['body'][_0x81be('0x26')]===''){throw new db[(_0x81be('0x29'))][(_0x81be('0x2a'))](_0x81be('0x34'));}if(_[_0x81be('0x31')](_0x453e90[_0x81be('0x26')]['mapKey'])){throw new db['Sequelize'][(_0x81be('0x2a'))](_0x81be('0x35')+_0x4a4251);}if(!_[_0x81be('0x36')](_0x4a4251,_0x453e90['body']['mapKey'])){throw new db[(_0x81be('0x29'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4a4251);}_0x593cb9[_0x453e90[_0x81be('0x26')][_0x81be('0x37')]]=_0x453e90[_0x81be('0x26')][_0x81be('0x32')];})[_0x81be('0x11')](function(){return db['FaxAccount'][_0x81be('0x38')]({'where':{'id':_0x453e90[_0x81be('0x39')]['id']},'include':[{'model':db[_0x81be('0x3a')],'as':_0x81be('0x3b'),'include':[{'model':db[_0x81be('0x3c')],'as':_0x81be('0x3d'),'where':_0x593cb9,'limit':0x1,'order':[[_0x81be('0x2d'),_0x81be('0x3e')]]}]},{'model':db[_0x81be('0x3f')],'as':_0x81be('0x40')}]});})['then'](function(_0x92f1e3){if(_0x92f1e3&&_0x92f1e3[_0x81be('0x3b')]){var _0xdf1f65=_0x92f1e3[_0x81be('0x41')]({'plain':!![]});_0x37d082[_0x81be('0x39')]=_0xdf1f65;_0x37d082[_0x81be('0x42')]=_0xdf1f65[_0x81be('0x40')];_0x37d082['list']=_0xdf1f65['List'];_0x37d082[_0x81be('0x42')]=_[_0x81be('0x43')](_0x37d082['applications'],[_0x81be('0x44')],['asc']);if(_0x37d082[_0x81be('0x39')]['Applications']){delete _0x37d082[_0x81be('0x39')][_0x81be('0x40')];}if(_0x37d082['account'][_0x81be('0x3b')]&&_0x37d082[_0x81be('0x39')][_0x81be('0x3b')]['Contacts']['length']){return _0x37d082[_0x81be('0x39')][_0x81be('0x3b')][_0x81be('0x3d')][0x0];}var _0x569395=_['defaults'](_0x453e90['body'],{'firstName':_0x453e90[_0x81be('0x26')][_0x81be('0x32')],'ListId':_0xdf1f65[_0x81be('0x30')]});_0x569395[_0x453e90[_0x81be('0x26')][_0x81be('0x37')]]=_0x453e90['body'][_0x81be('0x32')];return db[_0x81be('0x3c')]['create'](_0x569395,{'fields':_0x422c58,'raw':!![]});}})[_0x81be('0x11')](function(_0x4dcbe2){_0x37d082['contact']=_0x4dcbe2;if(_0x4dcbe2){var _0x435bed={'ContactId':_0x4dcbe2['id'],'FaxAccountId':_0x453e90[_0x81be('0x39')]['id'],'fax':_0x4dcbe2[_0x81be('0x27')]};return db[_0x81be('0x45')]['find']({'where':{'ContactId':_0x4dcbe2['id'],'closed':![],'FaxAccountId':_0x453e90[_0x81be('0x39')]['id']}})[_0x81be('0x11')](function(_0x43c2d8){if(_0x43c2d8){return[_0x43c2d8,![]];}return db[_0x81be('0x45')][_0x81be('0x46')](_0x435bed)[_0x81be('0x11')](function(_0x3c2c75){return[_0x3c2c75,!![]];});});}else{throw new Error(_0x81be('0x47'));}})[_0x81be('0x48')](function(_0x56052c,_0x2e0766){var _0xc30336=_0x56052c['get']({'plain':!![]});if(_0x2e0766){if(_0x37d082[_0x81be('0x39')][_0x81be('0x49')]){_0x37d082[_0x81be('0x42')][_0x81be('0x4a')]({'id':0x0,'priority':_0x37d082[_0x81be('0x42')]['length']+0x1,'app':'close','appdata':_0x81be('0x4b'),'interval':_0x81be('0x4c')});}_0xc30336['created']=!![];}else{_0xc30336['created']=![];}_0x37d082[_0x81be('0x4d')]=_0xc30336;return db[_0x81be('0x4e')][_0x81be('0x46')]({'body':_0x453e90[_0x81be('0x26')][_0x81be('0x26')],'FaxAccountId':_0x453e90[_0x81be('0x39')]['id'],'FaxInteractionId':_0x56052c['id'],'direction':'in','ContactId':_0x56052c[_0x81be('0x4f')],'AttachmentId':_0x453e90['body'][_0x81be('0x50')]});})[_0x81be('0x11')](function(_0x2de298){_0x37d082[_0x81be('0x19')]=_0x2de298;if(_0x37d082[_0x81be('0x4d')]['UserId']){return db[_0x81be('0x51')][_0x81be('0x38')]({'attributes':['id','name'],'where':{'id':_0x37d082[_0x81be('0x4d')][_0x81be('0x52')]}})[_0x81be('0x11')](function(_0x3147f6){if(_0x3147f6){_0x37d082['applications'][_0x81be('0x53')]({'id':0x0,'priority':0x0,'app':_0x81be('0x54'),'appdata':_0x3147f6['name']+','+(_0x37d082[_0x81be('0x39')][_0x81be('0x55')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x81be('0x56'),_0x81be('0x57'),_0x37d082);});}return respondWithRpcPromise('Start',_0x81be('0x57'),_0x37d082);})['then'](function(_0x2aaece){_0x566d9a(_0x2aaece);})[_0x81be('0x1b')](function(_0x1fff22){_0x4e927c(_0x24145d['error'](0x1f4,_0x1fff22[_0x81be('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index a643463..a5ce099 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 _0x5ce2=['emit','register','length','faxAccount:','./faxAccount.events','remove'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0x5ce2,0xd6));var _0x25ce=function(_0x488c16,_0x2dcab7){_0x488c16=_0x488c16-0x0;var _0x57ae25=_0x5ce2[_0x488c16];return _0x57ae25;};'use strict';var FaxAccountEvents=require(_0x25ce('0x0'));var events=['save',_0x25ce('0x1'),'update'];function createListener(_0xe6a401,_0x50b5bb){return function(_0x4c2fda){_0x50b5bb[_0x25ce('0x2')](_0xe6a401,_0x4c2fda);};}function removeListener(_0x12d5fb,_0x31be16){return function(){FaxAccountEvents['removeListener'](_0x12d5fb,_0x31be16);};}exports[_0x25ce('0x3')]=function(_0x130619){for(var _0x144d13=0x0,_0x5afde3=events[_0x25ce('0x4')];_0x144d13<_0x5afde3;_0x144d13++){var _0x5428e8=events[_0x144d13];var _0x25538d=createListener(_0x25ce('0x5')+_0x5428e8,_0x130619);FaxAccountEvents['on'](_0x5428e8,_0x25538d);}}; \ No newline at end of file +var _0xd7d5=['emit','removeListener','register','length','faxAccount:','./faxAccount.events','save','remove','update'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xd7d5,0x1c7));var _0x5d7d=function(_0x135d89,_0x297b6e){_0x135d89=_0x135d89-0x0;var _0x48727c=_0xd7d5[_0x135d89];return _0x48727c;};'use strict';var FaxAccountEvents=require(_0x5d7d('0x0'));var events=[_0x5d7d('0x1'),_0x5d7d('0x2'),_0x5d7d('0x3')];function createListener(_0x4acabf,_0x4499d1){return function(_0x35d834){_0x4499d1[_0x5d7d('0x4')](_0x4acabf,_0x35d834);};}function removeListener(_0x2230a4,_0x41c851){return function(){FaxAccountEvents[_0x5d7d('0x5')](_0x2230a4,_0x41c851);};}exports[_0x5d7d('0x6')]=function(_0x2f3c37){for(var _0x23350d=0x0,_0x1d24ac=events[_0x5d7d('0x7')];_0x23350d<_0x1d24ac;_0x23350d++){var _0x29fc66=events[_0x23350d];var _0x200165=createListener(_0x5d7d('0x8')+_0x29fc66,_0x2f3c37);FaxAccountEvents['on'](_0x29fc66,_0x200165);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 7028dc0..d0f4799 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(_0x1e77b0,_0x540871){var _0x1f8544=function(_0x2352ef){while(--_0x2352ef){_0x1e77b0['push'](_0x1e77b0['shift']());}};_0x1f8544(++_0x540871);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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(_0x215fe7,_0x541d89){var _0x5e90bd=function(_0x43e246){while(--_0x43e246){_0x215fe7['push'](_0x215fe7['shift']());}};_0x5e90bd(++_0x541d89);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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 c76cb5a..215f648 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 _0xe615=['INTEGER','STRING','TEXT','*,*,*,*','sequelize'];(function(_0x3b04f2,_0x1e54d9){var _0x2ba2b4=function(_0x50aec6){while(--_0x50aec6){_0x3b04f2['push'](_0x3b04f2['shift']());}};_0x2ba2b4(++_0x1e54d9);}(_0xe615,0x126));var _0x5e61=function(_0x1a968e,_0x3f45f4){_0x1a968e=_0x1a968e-0x0;var _0x2c7b23=_0xe615[_0x1a968e];return _0x2c7b23;};'use strict';var Sequelize=require(_0x5e61('0x0'));module['exports']={'priority':{'type':Sequelize[_0x5e61('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x5e61('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x5e61('0x3')]()},'description':{'type':Sequelize[_0x5e61('0x2')]},'interval':{'type':Sequelize[_0x5e61('0x2')],'defaultValue':_0x5e61('0x4')}}; \ No newline at end of file +var _0x37d7=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x3ff61a,_0x24ab96){var _0x558316=function(_0x2e7a93){while(--_0x2e7a93){_0x3ff61a['push'](_0x3ff61a['shift']());}};_0x558316(++_0x24ab96);}(_0x37d7,0x1e8));var _0x737d=function(_0x2040dd,_0x156a63){_0x2040dd=_0x2040dd-0x0;var _0x27688f=_0x37d7[_0x2040dd];return _0x27688f;};'use strict';var Sequelize=require(_0x737d('0x0'));module[_0x737d('0x1')]={'priority':{'type':Sequelize[_0x737d('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x737d('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x737d('0x4')]()},'description':{'type':Sequelize[_0x737d('0x3')]},'interval':{'type':Sequelize[_0x737d('0x3')],'defaultValue':_0x737d('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 623335d..eb7533e 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 _0x7359=['merge','where','options','includeAll','include','rows','catch','show','params','find','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','name','index','FaxApplication','fieldName','type','map','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','filter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7359,0xcf));var _0x9735=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0x7359[_0x373dee];return _0x46798f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9735('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9735('0x1'));var rp=require(_0x9735('0x2'));var moment=require(_0x9735('0x3'));var BPromise=require(_0x9735('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9735('0x5'));var sox=require(_0x9735('0x6'));var csv=require(_0x9735('0x7'));var ejs=require(_0x9735('0x8'));var fs=require('fs');var fs_extra=require(_0x9735('0x9'));var _=require(_0x9735('0xa'));var squel=require(_0x9735('0xb'));var crypto=require(_0x9735('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9735('0xd'));var toCsv=require(_0x9735('0x7'));var querystring=require(_0x9735('0xe'));var Papa=require(_0x9735('0xf'));var Redis=require('ioredis');var authService=require(_0x9735('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9735('0x11'));var hardwareService=require(_0x9735('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9735('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d3212,_0x45ecb7){_0x45ecb7=_0x45ecb7||0xcc;return function(_0x3c406f){if(_0x3c406f){return _0x5d3212[_0x9735('0x14')](_0x45ecb7);}return _0x5d3212[_0x9735('0x15')](_0x45ecb7)[_0x9735('0x16')]();};}function respondWithResult(_0x42bb12,_0x1653c8){_0x1653c8=_0x1653c8||0xc8;return function(_0x46abe5){if(_0x46abe5){return _0x42bb12[_0x9735('0x15')](_0x1653c8)[_0x9735('0x17')](_0x46abe5);}};}function respondWithFilteredResult(_0x338176,_0x4dbf93){return function(_0x419426){if(_0x419426){var _0x43fe94=typeof _0x4dbf93[_0x9735('0x18')]===_0x9735('0x19')&&typeof _0x4dbf93[_0x9735('0x1a')]===_0x9735('0x19');var _0x451f31=_0x419426[_0x9735('0x1b')];var _0x161739=_0x43fe94?0x0:_0x4dbf93[_0x9735('0x18')];var _0x4be57b=_0x43fe94?_0x419426['count']:_0x4dbf93[_0x9735('0x18')]+_0x4dbf93[_0x9735('0x1a')];var _0x38a48a;if(_0x4be57b>=_0x451f31){_0x4be57b=_0x451f31;_0x38a48a=0xc8;}else{_0x38a48a=0xce;}_0x338176[_0x9735('0x15')](_0x38a48a);return _0x338176[_0x9735('0x1c')]('Content-Range',_0x161739+'-'+_0x4be57b+'/'+_0x451f31)[_0x9735('0x17')](_0x419426);}return null;};}function patchUpdates(_0x591c8c){return function(_0x98c7ac){try{jsonpatch[_0x9735('0x1d')](_0x98c7ac,_0x591c8c,!![]);}catch(_0x1b7fc5){return BPromise[_0x9735('0x1e')](_0x1b7fc5);}return _0x98c7ac['save']();};}function saveUpdates(_0x39214c,_0x54d699){return function(_0x3b7221){if(_0x3b7221){return _0x3b7221[_0x9735('0x1f')](_0x39214c)[_0x9735('0x20')](function(_0x1a902e){return _0x1a902e;});}return null;};}function removeEntity(_0x12aa4,_0x174772){return function(_0x157b60){if(_0x157b60){return _0x157b60[_0x9735('0x21')]()[_0x9735('0x20')](function(){_0x12aa4[_0x9735('0x15')](0xcc)[_0x9735('0x16')]();});}};}function handleEntityNotFound(_0x4edbe5,_0x50b5a2){return function(_0x4b550c){if(!_0x4b550c){_0x4edbe5[_0x9735('0x14')](0x194);}return _0x4b550c;};}function handleError(_0x47d123,_0x2d4be0){_0x2d4be0=_0x2d4be0||0x1f4;return function(_0x2c2ddb){logger[_0x9735('0x22')](_0x2c2ddb['stack']);if(_0x2c2ddb[_0x9735('0x23')]){delete _0x2c2ddb[_0x9735('0x23')];}_0x47d123[_0x9735('0x15')](_0x2d4be0)['send'](_0x2c2ddb);};}exports[_0x9735('0x24')]=function(_0x29d723,_0x1a6e94){var _0x242074={},_0x367434={},_0x36e53b={'count':0x0,'rows':[]};var _0x31a213=_['map'](db[_0x9735('0x25')]['rawAttributes'],function(_0xd1666f){return{'name':_0xd1666f[_0x9735('0x26')],'type':_0xd1666f[_0x9735('0x27')]['key']};});_0x367434['model']=_[_0x9735('0x28')](_0x31a213,_0x9735('0x23'));_0x367434['query']=_[_0x9735('0x29')](_0x29d723[_0x9735('0x2a')]);_0x367434[_0x9735('0x2b')]=_['intersection'](_0x367434[_0x9735('0x2c')],_0x367434[_0x9735('0x2a')]);_0x242074[_0x9735('0x2d')]=_[_0x9735('0x2e')](_0x367434[_0x9735('0x2c')],qs[_0x9735('0x2f')](_0x29d723[_0x9735('0x2a')][_0x9735('0x2f')]));_0x242074[_0x9735('0x2d')]=_0x242074[_0x9735('0x2d')][_0x9735('0x30')]?_0x242074[_0x9735('0x2d')]:_0x367434[_0x9735('0x2c')];if(!_0x29d723['query'][_0x9735('0x31')]('nolimit')){_0x242074[_0x9735('0x1a')]=qs['limit'](_0x29d723[_0x9735('0x2a')][_0x9735('0x1a')]);_0x242074[_0x9735('0x18')]=qs[_0x9735('0x18')](_0x29d723[_0x9735('0x2a')][_0x9735('0x18')]);}_0x242074[_0x9735('0x32')]=qs[_0x9735('0x33')](_0x29d723['query'][_0x9735('0x33')]);_0x242074['where']=qs[_0x9735('0x2b')](_['pick'](_0x29d723[_0x9735('0x2a')],_0x367434[_0x9735('0x2b')]),_0x31a213);if(_0x29d723[_0x9735('0x2a')][_0x9735('0x34')]){_0x242074['where']=_[_0x9735('0x35')](_0x242074[_0x9735('0x36')],{'$or':_[_0x9735('0x28')](_0x31a213,function(_0x5b710d){if(_0x5b710d[_0x9735('0x27')]!=='VIRTUAL'){var _0x7853c6={};_0x7853c6[_0x5b710d[_0x9735('0x23')]]={'$like':'%'+_0x29d723[_0x9735('0x2a')][_0x9735('0x34')]+'%'};return _0x7853c6;}})});}_0x242074=_[_0x9735('0x35')]({},_0x242074,_0x29d723[_0x9735('0x37')]);var _0x13915e={'where':_0x242074['where']};return db['FaxApplication'][_0x9735('0x1b')](_0x13915e)['then'](function(_0x1e37a1){_0x36e53b[_0x9735('0x1b')]=_0x1e37a1;if(_0x29d723[_0x9735('0x2a')][_0x9735('0x38')]){_0x242074[_0x9735('0x39')]=[{'all':!![]}];}return db[_0x9735('0x25')]['findAll'](_0x242074);})[_0x9735('0x20')](function(_0x4c0d98){_0x36e53b[_0x9735('0x3a')]=_0x4c0d98;return _0x36e53b;})[_0x9735('0x20')](respondWithFilteredResult(_0x1a6e94,_0x242074))[_0x9735('0x3b')](handleError(_0x1a6e94,null));};exports[_0x9735('0x3c')]=function(_0x32515e,_0x1e922d){var _0x33165e={'raw':!![],'where':{'id':_0x32515e[_0x9735('0x3d')]['id']}},_0x39a0c8={};_0x39a0c8[_0x9735('0x2c')]=_['keys'](db['FaxApplication']['rawAttributes']);_0x39a0c8['query']=_[_0x9735('0x29')](_0x32515e[_0x9735('0x2a')]);_0x39a0c8['filters']=_[_0x9735('0x2e')](_0x39a0c8['model'],_0x39a0c8[_0x9735('0x2a')]);_0x33165e['attributes']=_[_0x9735('0x2e')](_0x39a0c8[_0x9735('0x2c')],qs[_0x9735('0x2f')](_0x32515e[_0x9735('0x2a')]['fields']));_0x33165e[_0x9735('0x2d')]=_0x33165e['attributes'][_0x9735('0x30')]?_0x33165e[_0x9735('0x2d')]:_0x39a0c8['model'];if(_0x32515e[_0x9735('0x2a')][_0x9735('0x38')]){_0x33165e[_0x9735('0x39')]=[{'all':!![]}];}_0x33165e=_[_0x9735('0x35')]({},_0x33165e,_0x32515e[_0x9735('0x37')]);return db[_0x9735('0x25')][_0x9735('0x3e')](_0x33165e)[_0x9735('0x20')](handleEntityNotFound(_0x1e922d,null))[_0x9735('0x20')](respondWithResult(_0x1e922d,null))[_0x9735('0x3b')](handleError(_0x1e922d,null));};exports[_0x9735('0x3f')]=function(_0x2692ad,_0x2e3946){return db[_0x9735('0x25')]['create'](_0x2692ad[_0x9735('0x40')],{})[_0x9735('0x20')](respondWithResult(_0x2e3946,0xc9))[_0x9735('0x3b')](handleError(_0x2e3946,null));};exports[_0x9735('0x1f')]=function(_0x1332c8,_0x325c80){if(_0x1332c8['body']['id']){delete _0x1332c8[_0x9735('0x40')]['id'];}return db['FaxApplication']['find']({'where':{'id':_0x1332c8[_0x9735('0x3d')]['id']}})[_0x9735('0x20')](handleEntityNotFound(_0x325c80,null))[_0x9735('0x20')](saveUpdates(_0x1332c8[_0x9735('0x40')],null))['then'](respondWithResult(_0x325c80,null))['catch'](handleError(_0x325c80,null));};exports[_0x9735('0x21')]=function(_0x22ec1a,_0x1fe0fd){return db['FaxApplication'][_0x9735('0x3e')]({'where':{'id':_0x22ec1a[_0x9735('0x3d')]['id']}})[_0x9735('0x20')](handleEntityNotFound(_0x1fe0fd,null))['then'](removeEntity(_0x1fe0fd,null))[_0x9735('0x3b')](handleError(_0x1fe0fd,null));}; \ No newline at end of file +var _0x21c1=['model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','options','FaxApplication','includeAll','findAll','rows','catch','show','params','body','find','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/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','json','reject','save','then','destroy','stack','name','send','index','map','rawAttributes','type','key','query','keys','intersection','attributes'];(function(_0x27b0b3,_0x1b0e02){var _0x3c6546=function(_0x42c348){while(--_0x42c348){_0x27b0b3['push'](_0x27b0b3['shift']());}};_0x3c6546(++_0x1b0e02);}(_0x21c1,0xac));var _0x121c=function(_0x39f72a,_0x20d6fb){_0x39f72a=_0x39f72a-0x0;var _0x4c8a68=_0x21c1[_0x39f72a];return _0x4c8a68;};'use strict';var emlformat=require(_0x121c('0x0'));var rimraf=require(_0x121c('0x1'));var zipdir=require(_0x121c('0x2'));var jsonpatch=require(_0x121c('0x3'));var rp=require(_0x121c('0x4'));var moment=require(_0x121c('0x5'));var BPromise=require(_0x121c('0x6'));var Mustache=require(_0x121c('0x7'));var util=require(_0x121c('0x8'));var path=require(_0x121c('0x9'));var sox=require(_0x121c('0xa'));var csv=require(_0x121c('0xb'));var ejs=require(_0x121c('0xc'));var fs=require('fs');var fs_extra=require(_0x121c('0xd'));var _=require(_0x121c('0xe'));var squel=require(_0x121c('0xf'));var crypto=require(_0x121c('0x10'));var jsforce=require(_0x121c('0x11'));var deskjs=require(_0x121c('0x12'));var toCsv=require(_0x121c('0xb'));var querystring=require(_0x121c('0x13'));var Papa=require('papaparse');var Redis=require(_0x121c('0x14'));var authService=require(_0x121c('0x15'));var qs=require(_0x121c('0x16'));var as=require(_0x121c('0x17'));var hardwareService=require(_0x121c('0x18'));var logger=require('../../config/logger')('api');var utils=require(_0x121c('0x19'));var config=require(_0x121c('0x1a'));var licenseUtil=require(_0x121c('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x201bd6,_0x547d59){_0x547d59=_0x547d59||0xcc;return function(_0x2cf5ce){if(_0x2cf5ce){return _0x201bd6[_0x121c('0x1c')](_0x547d59);}return _0x201bd6['status'](_0x547d59)[_0x121c('0x1d')]();};}function respondWithResult(_0x3d0a18,_0x47eaf7){_0x47eaf7=_0x47eaf7||0xc8;return function(_0x370f2b){if(_0x370f2b){return _0x3d0a18[_0x121c('0x1e')](_0x47eaf7)['json'](_0x370f2b);}};}function respondWithFilteredResult(_0x2ecf03,_0x404565){return function(_0x1d5a2e){if(_0x1d5a2e){var _0x5a0499=typeof _0x404565[_0x121c('0x1f')]===_0x121c('0x20')&&typeof _0x404565[_0x121c('0x21')]===_0x121c('0x20');var _0x9e1b57=_0x1d5a2e[_0x121c('0x22')];var _0x45b6b4=_0x5a0499?0x0:_0x404565[_0x121c('0x1f')];var _0x3788f9=_0x5a0499?_0x1d5a2e[_0x121c('0x22')]:_0x404565[_0x121c('0x1f')]+_0x404565[_0x121c('0x21')];var _0x898dcb;if(_0x3788f9>=_0x9e1b57){_0x3788f9=_0x9e1b57;_0x898dcb=0xc8;}else{_0x898dcb=0xce;}_0x2ecf03[_0x121c('0x1e')](_0x898dcb);return _0x2ecf03[_0x121c('0x23')]('Content-Range',_0x45b6b4+'-'+_0x3788f9+'/'+_0x9e1b57)[_0x121c('0x24')](_0x1d5a2e);}return null;};}function patchUpdates(_0x240999){return function(_0xfa639){try{jsonpatch['apply'](_0xfa639,_0x240999,!![]);}catch(_0x467438){return BPromise[_0x121c('0x25')](_0x467438);}return _0xfa639[_0x121c('0x26')]();};}function saveUpdates(_0x16a8bb,_0x548559){return function(_0x273e27){if(_0x273e27){return _0x273e27['update'](_0x16a8bb)[_0x121c('0x27')](function(_0x1638f7){return _0x1638f7;});}return null;};}function removeEntity(_0x31a99b,_0x61a05e){return function(_0x1fa974){if(_0x1fa974){return _0x1fa974[_0x121c('0x28')]()['then'](function(){_0x31a99b[_0x121c('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26c0f2,_0xa18060){return function(_0x4f8e6d){if(!_0x4f8e6d){_0x26c0f2[_0x121c('0x1c')](0x194);}return _0x4f8e6d;};}function handleError(_0x27d835,_0x4195a1){_0x4195a1=_0x4195a1||0x1f4;return function(_0x32e9ac){logger['error'](_0x32e9ac[_0x121c('0x29')]);if(_0x32e9ac[_0x121c('0x2a')]){delete _0x32e9ac[_0x121c('0x2a')];}_0x27d835[_0x121c('0x1e')](_0x4195a1)[_0x121c('0x2b')](_0x32e9ac);};}exports[_0x121c('0x2c')]=function(_0x3f6966,_0x2da161){var _0x4dcf53={},_0x426154={},_0x413b32={'count':0x0,'rows':[]};var _0x2f33f6=_[_0x121c('0x2d')](db['FaxApplication'][_0x121c('0x2e')],function(_0x3f4235){return{'name':_0x3f4235['fieldName'],'type':_0x3f4235[_0x121c('0x2f')][_0x121c('0x30')]};});_0x426154['model']=_[_0x121c('0x2d')](_0x2f33f6,_0x121c('0x2a'));_0x426154[_0x121c('0x31')]=_[_0x121c('0x32')](_0x3f6966[_0x121c('0x31')]);_0x426154['filters']=_[_0x121c('0x33')](_0x426154['model'],_0x426154[_0x121c('0x31')]);_0x4dcf53[_0x121c('0x34')]=_[_0x121c('0x33')](_0x426154[_0x121c('0x35')],qs[_0x121c('0x36')](_0x3f6966[_0x121c('0x31')][_0x121c('0x36')]));_0x4dcf53[_0x121c('0x34')]=_0x4dcf53[_0x121c('0x34')][_0x121c('0x37')]?_0x4dcf53[_0x121c('0x34')]:_0x426154[_0x121c('0x35')];if(!_0x3f6966[_0x121c('0x31')][_0x121c('0x38')](_0x121c('0x39'))){_0x4dcf53[_0x121c('0x21')]=qs[_0x121c('0x21')](_0x3f6966[_0x121c('0x31')][_0x121c('0x21')]);_0x4dcf53[_0x121c('0x1f')]=qs[_0x121c('0x1f')](_0x3f6966[_0x121c('0x31')]['offset']);}_0x4dcf53[_0x121c('0x3a')]=qs['sort'](_0x3f6966[_0x121c('0x31')][_0x121c('0x3b')]);_0x4dcf53[_0x121c('0x3c')]=qs[_0x121c('0x3d')](_[_0x121c('0x3e')](_0x3f6966[_0x121c('0x31')],_0x426154[_0x121c('0x3d')]),_0x2f33f6);if(_0x3f6966[_0x121c('0x31')]['filter']){_0x4dcf53[_0x121c('0x3c')]=_[_0x121c('0x3f')](_0x4dcf53['where'],{'$or':_[_0x121c('0x2d')](_0x2f33f6,function(_0xe40076){if(_0xe40076[_0x121c('0x2f')]!=='VIRTUAL'){var _0x1bfcd8={};_0x1bfcd8[_0xe40076[_0x121c('0x2a')]]={'$like':'%'+_0x3f6966[_0x121c('0x31')][_0x121c('0x40')]+'%'};return _0x1bfcd8;}})});}_0x4dcf53=_[_0x121c('0x3f')]({},_0x4dcf53,_0x3f6966[_0x121c('0x41')]);var _0x485564={'where':_0x4dcf53[_0x121c('0x3c')]};return db[_0x121c('0x42')][_0x121c('0x22')](_0x485564)['then'](function(_0xeb697){_0x413b32['count']=_0xeb697;if(_0x3f6966[_0x121c('0x31')][_0x121c('0x43')]){_0x4dcf53['include']=[{'all':!![]}];}return db['FaxApplication'][_0x121c('0x44')](_0x4dcf53);})['then'](function(_0x287499){_0x413b32[_0x121c('0x45')]=_0x287499;return _0x413b32;})[_0x121c('0x27')](respondWithFilteredResult(_0x2da161,_0x4dcf53))[_0x121c('0x46')](handleError(_0x2da161,null));};exports[_0x121c('0x47')]=function(_0x38916b,_0x9756c6){var _0x14cd1d={'raw':!![],'where':{'id':_0x38916b[_0x121c('0x48')]['id']}},_0x43df29={};_0x43df29['model']=_[_0x121c('0x32')](db['FaxApplication'][_0x121c('0x2e')]);_0x43df29[_0x121c('0x31')]=_[_0x121c('0x32')](_0x38916b[_0x121c('0x31')]);_0x43df29['filters']=_[_0x121c('0x33')](_0x43df29['model'],_0x43df29['query']);_0x14cd1d[_0x121c('0x34')]=_['intersection'](_0x43df29[_0x121c('0x35')],qs[_0x121c('0x36')](_0x38916b[_0x121c('0x31')][_0x121c('0x36')]));_0x14cd1d['attributes']=_0x14cd1d[_0x121c('0x34')][_0x121c('0x37')]?_0x14cd1d[_0x121c('0x34')]:_0x43df29[_0x121c('0x35')];if(_0x38916b[_0x121c('0x31')][_0x121c('0x43')]){_0x14cd1d['include']=[{'all':!![]}];}_0x14cd1d=_[_0x121c('0x3f')]({},_0x14cd1d,_0x38916b[_0x121c('0x41')]);return db[_0x121c('0x42')]['find'](_0x14cd1d)[_0x121c('0x27')](handleEntityNotFound(_0x9756c6,null))['then'](respondWithResult(_0x9756c6,null))[_0x121c('0x46')](handleError(_0x9756c6,null));};exports['create']=function(_0x180be9,_0x108771){return db[_0x121c('0x42')]['create'](_0x180be9[_0x121c('0x49')],{})[_0x121c('0x27')](respondWithResult(_0x108771,0xc9))[_0x121c('0x46')](handleError(_0x108771,null));};exports['update']=function(_0x76eda,_0x27c052){if(_0x76eda[_0x121c('0x49')]['id']){delete _0x76eda[_0x121c('0x49')]['id'];}return db[_0x121c('0x42')][_0x121c('0x4a')]({'where':{'id':_0x76eda['params']['id']}})['then'](handleEntityNotFound(_0x27c052,null))['then'](saveUpdates(_0x76eda[_0x121c('0x49')],null))[_0x121c('0x27')](respondWithResult(_0x27c052,null))[_0x121c('0x46')](handleError(_0x27c052,null));};exports[_0x121c('0x28')]=function(_0xf82a4a,_0x3fd916){return db[_0x121c('0x42')][_0x121c('0x4a')]({'where':{'id':_0xf82a4a[_0x121c('0x48')]['id']}})[_0x121c('0x27')](handleEntityNotFound(_0x3fd916,null))[_0x121c('0x27')](removeEntity(_0x3fd916,null))[_0x121c('0x46')](handleError(_0x3fd916,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 00a4810..a0014ab 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 _0xc30c=['api','moment','../../config/environment','exports','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x27bcf5,_0x236765){var _0x4ce4cf=function(_0x4864ea){while(--_0x4864ea){_0x27bcf5['push'](_0x27bcf5['shift']());}};_0x4ce4cf(++_0x236765);}(_0xc30c,0x135));var _0xcc30=function(_0x1704d5,_0x1f1740){_0x1704d5=_0x1704d5-0x0;var _0x58b71d=_0xc30c[_0x1704d5];return _0x58b71d;};'use strict';var _=require(_0xcc30('0x0'));var util=require(_0xcc30('0x1'));var logger=require(_0xcc30('0x2'))(_0xcc30('0x3'));var moment=require(_0xcc30('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcc30('0x5'));var attributes=require('./faxApplication.attributes');module[_0xcc30('0x6')]=function(_0xb3e2bc,_0x4fc9ef){return _0xb3e2bc[_0xcc30('0x7')](_0xcc30('0x8'),attributes,{'tableName':_0xcc30('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcc30('0xa'),'collate':_0xcc30('0xb')});}; \ No newline at end of file +var _0x3403=['request-promise','../../config/environment','./faxApplication.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','util','api','moment'];(function(_0x5bccd3,_0x4e2b7b){var _0x322dbc=function(_0x2f7b82){while(--_0x2f7b82){_0x5bccd3['push'](_0x5bccd3['shift']());}};_0x322dbc(++_0x4e2b7b);}(_0x3403,0xed));var _0x3340=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x3403[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require('lodash');var util=require(_0x3340('0x0'));var logger=require('../../config/logger')(_0x3340('0x1'));var moment=require(_0x3340('0x2'));var BPromise=require('bluebird');var rp=require(_0x3340('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3340('0x4'));var attributes=require(_0x3340('0x5'));module[_0x3340('0x6')]=function(_0x417ad5,_0x475ff1){return _0x417ad5[_0x3340('0x7')]('FaxApplication',attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3340('0x8'),'collate':_0x3340('0x9')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index ad68275..0462dfb 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 _0x9bef=['FaxApplication,\x20%s,\x20%s','message','result','catch','UpdateFaxApplication','FaxApplication','update','options','raw','where','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','code'];(function(_0xe1eeab,_0x40b03c){var _0x46e662=function(_0x3e7b0e){while(--_0x3e7b0e){_0xe1eeab['push'](_0xe1eeab['shift']());}};_0x46e662(++_0x40b03c);}(_0x9bef,0x133));var _0xf9be=function(_0x29d563,_0x2de46d){_0x29d563=_0x29d563-0x0;var _0x258f84=_0x9bef[_0x29d563];return _0x258f84;};'use strict';var _=require(_0xf9be('0x0'));var util=require(_0xf9be('0x1'));var moment=require('moment');var BPromise=require(_0xf9be('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf9be('0x3'));var db=require(_0xf9be('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf9be('0x5'))('rpc');var config=require(_0xf9be('0x6'));var jayson=require(_0xf9be('0x7'));var client=jayson['client'][_0xf9be('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x457a34,_0x2e324d,_0x450173){return new BPromise(function(_0x442776,_0x2d6667){return client[_0xf9be('0x9')](_0x457a34,_0x450173)[_0xf9be('0xa')](function(_0x5f1809){logger[_0xf9be('0xb')]('FaxApplication,\x20%s,\x20%s',_0x2e324d,_0xf9be('0xc'));logger[_0xf9be('0xd')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x2e324d,_0xf9be('0xc'),JSON[_0xf9be('0xe')](_0x5f1809));if(_0x5f1809[_0xf9be('0xf')]){if(_0x5f1809[_0xf9be('0xf')][_0xf9be('0x10')]===0x1f4){logger['error'](_0xf9be('0x11'),_0x2e324d,_0x5f1809[_0xf9be('0xf')][_0xf9be('0x12')]);return _0x2d6667(_0x5f1809['error'][_0xf9be('0x12')]);}logger[_0xf9be('0xf')](_0xf9be('0x11'),_0x2e324d,_0x5f1809[_0xf9be('0xf')]['message']);return _0x442776(_0x5f1809[_0xf9be('0xf')][_0xf9be('0x12')]);}else{logger[_0xf9be('0xb')](_0xf9be('0x11'),_0x2e324d,'request\x20sent');_0x442776(_0x5f1809[_0xf9be('0x13')]['message']);}})[_0xf9be('0x14')](function(_0x58cefc){logger[_0xf9be('0xf')](_0xf9be('0x11'),_0x2e324d,_0x58cefc);_0x2d6667(_0x58cefc);});});}exports[_0xf9be('0x15')]=function(_0x5b7b59){var _0x2cc1bf=this;return new Promise(function(_0x324984,_0x2a032e){return db[_0xf9be('0x16')][_0xf9be('0x17')](_0x5b7b59['body'],{'raw':_0x5b7b59[_0xf9be('0x18')]?_0x5b7b59['options'][_0xf9be('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b7b59['options']?_0x5b7b59['options'][_0xf9be('0x1a')]||null:null,'attributes':_0x5b7b59['options']?_0x5b7b59[_0xf9be('0x18')]['attributes']||null:null,'limit':_0x5b7b59[_0xf9be('0x18')]?_0x5b7b59['options']['limit']||null:null})['then'](function(_0x5189e4){logger[_0xf9be('0xb')](_0xf9be('0x15'),_0x5b7b59);logger[_0xf9be('0xd')](_0xf9be('0x15'),_0x5b7b59,JSON['stringify'](_0x5189e4));_0x324984(_0x5189e4);})[_0xf9be('0x14')](function(_0x43064c){logger[_0xf9be('0xf')](_0xf9be('0x15'),_0x43064c[_0xf9be('0x12')],_0x5b7b59);_0x2a032e(_0x2cc1bf[_0xf9be('0xf')](0x1f4,_0x43064c['message']));});});}; \ No newline at end of file +var _0x5c83=['../../config/environment','client','http','then','info','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','code','error','FaxApplication,\x20%s,\x20%s','message','result','UpdateFaxApplication','update','body','raw','options','where','attributes','limit','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x5c83,0xb2));var _0x35c8=function(_0x26a906,_0x3d135c){_0x26a906=_0x26a906-0x0;var _0x495575=_0x5c83[_0x26a906];return _0x495575;};'use strict';var _=require(_0x35c8('0x0'));var util=require(_0x35c8('0x1'));var moment=require(_0x35c8('0x2'));var BPromise=require(_0x35c8('0x3'));var rs=require(_0x35c8('0x4'));var fs=require('fs');var Redis=require(_0x35c8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x35c8('0x6'));var logger=require(_0x35c8('0x7'))('rpc');var config=require(_0x35c8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x35c8('0x9')][_0x35c8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x559284,_0x482e87,_0x1cf049){return new BPromise(function(_0x5ad7bd,_0x40ab2c){return client['request'](_0x559284,_0x1cf049)[_0x35c8('0xb')](function(_0x1bc8e4){logger[_0x35c8('0xc')]('FaxApplication,\x20%s,\x20%s',_0x482e87,_0x35c8('0xd'));logger[_0x35c8('0xe')](_0x35c8('0xf'),_0x482e87,_0x35c8('0xd'),JSON[_0x35c8('0x10')](_0x1bc8e4));if(_0x1bc8e4['error']){if(_0x1bc8e4['error'][_0x35c8('0x11')]===0x1f4){logger[_0x35c8('0x12')](_0x35c8('0x13'),_0x482e87,_0x1bc8e4['error'][_0x35c8('0x14')]);return _0x40ab2c(_0x1bc8e4[_0x35c8('0x12')][_0x35c8('0x14')]);}logger[_0x35c8('0x12')]('FaxApplication,\x20%s,\x20%s',_0x482e87,_0x1bc8e4[_0x35c8('0x12')][_0x35c8('0x14')]);return _0x5ad7bd(_0x1bc8e4[_0x35c8('0x12')][_0x35c8('0x14')]);}else{logger[_0x35c8('0xc')](_0x35c8('0x13'),_0x482e87,_0x35c8('0xd'));_0x5ad7bd(_0x1bc8e4[_0x35c8('0x15')][_0x35c8('0x14')]);}})['catch'](function(_0x3a178d){logger[_0x35c8('0x12')](_0x35c8('0x13'),_0x482e87,_0x3a178d);_0x40ab2c(_0x3a178d);});});}exports[_0x35c8('0x16')]=function(_0x3b54d0){var _0x50d2f6=this;return new Promise(function(_0x23f337,_0x81b3fd){return db['FaxApplication'][_0x35c8('0x17')](_0x3b54d0[_0x35c8('0x18')],{'raw':_0x3b54d0['options']?_0x3b54d0['options'][_0x35c8('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b54d0[_0x35c8('0x1a')]?_0x3b54d0[_0x35c8('0x1a')][_0x35c8('0x1b')]||null:null,'attributes':_0x3b54d0[_0x35c8('0x1a')]?_0x3b54d0[_0x35c8('0x1a')][_0x35c8('0x1c')]||null:null,'limit':_0x3b54d0[_0x35c8('0x1a')]?_0x3b54d0[_0x35c8('0x1a')][_0x35c8('0x1d')]||null:null})['then'](function(_0x4a33ea){logger[_0x35c8('0xc')]('UpdateFaxApplication',_0x3b54d0);logger['debug']('UpdateFaxApplication',_0x3b54d0,JSON[_0x35c8('0x10')](_0x4a33ea));_0x23f337(_0x4a33ea);})[_0x35c8('0x1e')](function(_0x1cf882){logger[_0x35c8('0x12')]('UpdateFaxApplication',_0x1cf882[_0x35c8('0x14')],_0x3b54d0);_0x81b3fd(_0x50d2f6[_0x35c8('0x12')](0x1f4,_0x1cf882[_0x35c8('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index a6a933d..255925e 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 _0xb688=['show','post','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','index','/:id','isAuthenticated'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xb688,0xcf));var _0x8b68=function(_0x20ba62,_0x539a35){_0x20ba62=_0x20ba62-0x0;var _0x4cf2d0=_0xb688[_0x20ba62];return _0x4cf2d0;};'use strict';var multer=require('multer');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var timeout=require(_0x8b68('0x2'));var express=require(_0x8b68('0x3'));var router=express[_0x8b68('0x4')]();var fs_extra=require(_0x8b68('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var controller=require(_0x8b68('0x8'));router[_0x8b68('0x9')]('/',auth['isAuthenticated'](),controller[_0x8b68('0xa')]);router['get'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xd')]);router[_0x8b68('0xe')]('/',auth[_0x8b68('0xc')](),controller[_0x8b68('0xf')]);router[_0x8b68('0x10')](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x11')]);router[_0x8b68('0x12')](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller['destroy']);module[_0x8b68('0x13')]=router; \ No newline at end of file +var _0x955f=['path','connect-timeout','express','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','destroy','exports','multer','util'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x955f,0x1eb));var _0xf955=function(_0x4467bd,_0x263abc){_0x4467bd=_0x4467bd-0x0;var _0x3ee10d=_0x955f[_0x4467bd];return _0x3ee10d;};'use strict';var multer=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var path=require(_0xf955('0x2'));var timeout=require(_0xf955('0x3'));var express=require(_0xf955('0x4'));var router=express['Router']();var fs_extra=require(_0xf955('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf955('0x6'));var controller=require('./faxApplication.controller');router[_0xf955('0x7')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0x9')]);router['get'](_0xf955('0xa'),auth[_0xf955('0x8')](),controller['show']);router[_0xf955('0xb')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0xc')]);router[_0xf955('0xd')](_0xf955('0xa'),auth[_0xf955('0x8')](),controller[_0xf955('0xe')]);router['delete'](_0xf955('0xa'),auth['isAuthenticated'](),controller[_0xf955('0xf')]);module[_0xf955('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index c14d98c..a666e72 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 _0x67ae=['STRING','ENUM','out','sequelize','exports','DATE'];(function(_0x285fde,_0x5c030b){var _0x4da868=function(_0x31ba75){while(--_0x31ba75){_0x285fde['push'](_0x285fde['shift']());}};_0x4da868(++_0x5c030b);}(_0x67ae,0x9f));var _0xe67a=function(_0x578301,_0x5d1b9c){_0x578301=_0x578301-0x0;var _0x166129=_0x67ae[_0x578301];return _0x166129;};'use strict';var Sequelize=require(_0xe67a('0x0'));module[_0xe67a('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xe67a('0x2')]},'disposition':{'type':Sequelize[_0xe67a('0x3')]},'secondDisposition':{'type':Sequelize[_0xe67a('0x3')]},'thirdDisposition':{'type':Sequelize[_0xe67a('0x3')]},'note':{'type':Sequelize[_0xe67a('0x3')]},'read1stAt':{'type':Sequelize[_0xe67a('0x2')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0xe67a('0x4')]('in',_0xe67a('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xe67a('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xe67a('0x4')]('in',_0xe67a('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xcd1b=['sequelize','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xcd1b,0xcb));var _0xbcd1=function(_0x59f318,_0x3b5bc7){_0x59f318=_0x59f318-0x0;var _0x39fb3f=_0xcd1b[_0x59f318];return _0x39fb3f;};'use strict';var Sequelize=require(_0xbcd1('0x0'));module[_0xbcd1('0x1')]={'closed':{'type':Sequelize[_0xbcd1('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbcd1('0x3')]},'disposition':{'type':Sequelize[_0xbcd1('0x4')]},'secondDisposition':{'type':Sequelize[_0xbcd1('0x4')]},'thirdDisposition':{'type':Sequelize[_0xbcd1('0x4')]},'note':{'type':Sequelize[_0xbcd1('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0xbcd1('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xbcd1('0x5')]('in',_0xbcd1('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xbcd1('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xbcd1('0x5')]('in',_0xbcd1('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index d928387..ab683ba 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 _0x6ed3=['fieldName','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','field','color','from','select','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','length','conditions','find','having','`\x20=\x200','`\x20>\x200','Contact','split','getFullTextValue','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','$substring','UserId','text','end','body','compact','FaxAccountId','i.FaxAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\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)','unreadMessages','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','role','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','agent','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','ui.FaxInteractionId\x20IN\x20?','groupBy','all','rows','show','includeAll','include','merge','options','create','params','FaxMessage','addMessage','ids','getMessages','findAll','addTags','omit','emit','faxInteractionTags:save','unix','join','root','server','files','tmp','attachments','format','push','Attachment','Messages','mkdirSync','basename','existsSync','createReadStream','createWriteStream','download','log','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','Users','map','TagIds','Tags','forEach','catch','FaxInteraction','rawAttributes'];(function(_0x17ebb6,_0x465af7){var _0x32ec22=function(_0x160ff0){while(--_0x160ff0){_0x17ebb6['push'](_0x17ebb6['shift']());}};_0x32ec22(++_0x465af7);}(_0x6ed3,0x9f));var _0x36ed=function(_0x44cf1c,_0x28dc5a){_0x44cf1c=_0x44cf1c-0x0;var _0x2293d7=_0x6ed3[_0x44cf1c];return _0x2293d7;};'use strict';var emlformat=require(_0x36ed('0x0'));var rimraf=require(_0x36ed('0x1'));var zipdir=require(_0x36ed('0x2'));var jsonpatch=require(_0x36ed('0x3'));var rp=require('request-promise');var moment=require(_0x36ed('0x4'));var BPromise=require(_0x36ed('0x5'));var Mustache=require(_0x36ed('0x6'));var util=require(_0x36ed('0x7'));var path=require(_0x36ed('0x8'));var sox=require(_0x36ed('0x9'));var csv=require(_0x36ed('0xa'));var ejs=require(_0x36ed('0xb'));var fs=require('fs');var fs_extra=require(_0x36ed('0xc'));var _=require(_0x36ed('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x36ed('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x36ed('0xa'));var querystring=require(_0x36ed('0xf'));var Papa=require('papaparse');var Redis=require(_0x36ed('0x10'));var authService=require(_0x36ed('0x11'));var qs=require(_0x36ed('0x12'));var as=require(_0x36ed('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x36ed('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x36ed('0x15'));var licenseUtil=require(_0x36ed('0x16'));var db=require('../../mysqldb')['db'];config[_0x36ed('0x17')]=_[_0x36ed('0x18')](config[_0x36ed('0x17')],{'host':_0x36ed('0x19'),'port':0x18eb});var socket=require(_0x36ed('0x1a'))(new Redis(config['redis']));require(_0x36ed('0x1b'))[_0x36ed('0x1c')](socket);function respondWithStatusCode(_0x3ab9ce,_0x3cc8fa){_0x3cc8fa=_0x3cc8fa||0xcc;return function(_0x565f56){if(_0x565f56){return _0x3ab9ce[_0x36ed('0x1d')](_0x3cc8fa);}return _0x3ab9ce[_0x36ed('0x1e')](_0x3cc8fa)['end']();};}function respondWithResult(_0x5c311d,_0x55b3cb){_0x55b3cb=_0x55b3cb||0xc8;return function(_0x1b6375){if(_0x1b6375){return _0x5c311d[_0x36ed('0x1e')](_0x55b3cb)[_0x36ed('0x1f')](_0x1b6375);}};}function respondWithFilteredResult(_0x59677b,_0x334208){return function(_0x2b621d){if(_0x2b621d){var _0x166d19=typeof _0x334208[_0x36ed('0x20')]==='undefined'&&typeof _0x334208['limit']===_0x36ed('0x21');var _0x352d7c=_0x2b621d[_0x36ed('0x22')];var _0x12c778=_0x166d19?0x0:_0x334208[_0x36ed('0x20')];var _0x29147c=_0x166d19?_0x2b621d[_0x36ed('0x22')]:_0x334208[_0x36ed('0x20')]+_0x334208[_0x36ed('0x23')];var _0x373e05;if(_0x29147c>=_0x352d7c){_0x29147c=_0x352d7c;_0x373e05=0xc8;}else{_0x373e05=0xce;}_0x59677b[_0x36ed('0x1e')](_0x373e05);return _0x59677b[_0x36ed('0x24')](_0x36ed('0x25'),_0x12c778+'-'+_0x29147c+'/'+_0x352d7c)[_0x36ed('0x1f')](_0x2b621d);}return null;};}function patchUpdates(_0x124a98){return function(_0x28435d){try{jsonpatch[_0x36ed('0x26')](_0x28435d,_0x124a98,!![]);}catch(_0x481296){return BPromise['reject'](_0x481296);}return _0x28435d[_0x36ed('0x27')]();};}function saveUpdates(_0x2b2b60,_0x52039c){return function(_0x2bdc09){if(_0x2bdc09){return _0x2bdc09[_0x36ed('0x28')](_0x2b2b60)[_0x36ed('0x29')](function(_0xd8ea5b){return _0xd8ea5b;});}return null;};}function removeEntity(_0x33abc2,_0xf5587c){return function(_0x371d73){if(_0x371d73){return _0x371d73[_0x36ed('0x2a')]()[_0x36ed('0x29')](function(){_0x33abc2[_0x36ed('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e7980,_0x5ecbb5){return function(_0x1799f3){if(!_0x1799f3){_0x3e7980['sendStatus'](0x194);}return _0x1799f3;};}function handleError(_0x47be0a,_0x2e4ad1){_0x2e4ad1=_0x2e4ad1||0x1f4;return function(_0x39bdab){logger[_0x36ed('0x2b')](_0x39bdab[_0x36ed('0x2c')]);if(_0x39bdab['name']){delete _0x39bdab[_0x36ed('0x2d')];}_0x47be0a[_0x36ed('0x1e')](_0x2e4ad1)['send'](_0x39bdab);};}function getInteractionUsers(_0x37e31d,_0x1108c1){return new BPromise(function(_0x4b0a30,_0x423ff1){try{if(_0x1108c1[_0x37e31d['id']]){_0x37e31d[_0x36ed('0x2e')]=_[_0x36ed('0x2f')](_0x1108c1[_0x37e31d['id']],function(_0x31299d){return{'id':_0x31299d['id'],'fullname':_0x31299d['fullname']};});}}catch(_0x5571b3){_0x423ff1(_0x5571b3);}_0x4b0a30(_0x37e31d);});}function getInteractionTags(_0x161a73,_0x3497ce){return new BPromise(function(_0x5a8118,_0x2d83e4){try{if(_0x161a73[_0x36ed('0x30')]){_0x161a73[_0x36ed('0x31')]=[];_0x161a73[_0x36ed('0x30')]['split'](',')[_0x36ed('0x32')](function(_0x2c057b){_0x161a73[_0x36ed('0x31')]['push'](_0x3497ce[_0x2c057b]);});}delete _0x161a73[_0x36ed('0x30')];}catch(_0x2a69e3){_0x2d83e4(_0x2a69e3);}_0x5a8118(_0x161a73);});}function updateFaxInteraction(_0x141a01,_0x44a966,_0x3eeddb){return new BPromise(function(_0x4bba39,_0x533c74){return getInteractionUsers(_0x141a01,_0x3eeddb)[_0x36ed('0x29')](function(_0x4c1265){return getInteractionTags(_0x4c1265,_0x44a966);})[_0x36ed('0x29')](function(_0x1265b5){_0x4bba39(_0x1265b5);})[_0x36ed('0x33')](function(_0x1088ab){_0x533c74(_0x1088ab);});});}exports['index']=function(_0x449faf,_0x2df7ba){var _0x3ac681={},_0x444206={},_0x499f9d={'count':0x0,'rows':[]};var _0x5d7456=_[_0x36ed('0x2f')](db[_0x36ed('0x34')][_0x36ed('0x35')],function(_0x443e6c){return{'name':_0x443e6c[_0x36ed('0x36')],'type':_0x443e6c['type']['key']};});_0x444206[_0x36ed('0x37')]=_['map'](_0x5d7456,_0x36ed('0x2d'));_0x444206['query']=_[_0x36ed('0x38')](_0x449faf[_0x36ed('0x39')]);_0x444206[_0x36ed('0x3a')]=_[_0x36ed('0x3b')](_0x444206[_0x36ed('0x37')],_0x444206[_0x36ed('0x39')]);_0x3ac681[_0x36ed('0x3c')]=_[_0x36ed('0x3b')](_0x444206[_0x36ed('0x37')],qs[_0x36ed('0x3d')](_0x449faf[_0x36ed('0x39')][_0x36ed('0x3d')]));_0x3ac681[_0x36ed('0x3c')]=_0x3ac681[_0x36ed('0x3c')]['length']?_0x3ac681[_0x36ed('0x3c')]:_0x444206[_0x36ed('0x37')];if(!_0x449faf[_0x36ed('0x39')]['hasOwnProperty'](_0x36ed('0x3e'))){_0x3ac681[_0x36ed('0x23')]=qs[_0x36ed('0x23')](_0x449faf[_0x36ed('0x39')]['limit']);_0x3ac681['offset']=qs[_0x36ed('0x20')](_0x449faf[_0x36ed('0x39')][_0x36ed('0x20')]);}_0x3ac681[_0x36ed('0x3f')]=qs[_0x36ed('0x40')](_0x449faf[_0x36ed('0x39')][_0x36ed('0x40')]);_0x3ac681[_0x36ed('0x41')]=qs[_0x36ed('0x3a')](_[_0x36ed('0x42')](_0x449faf['query'],_0x444206['filters']),_0x5d7456);var _0x4a5b6e=[];var _0x262391=squel['select']()[_0x36ed('0x43')]('id')['field']('name')[_0x36ed('0x43')](_0x36ed('0x44'))[_0x36ed('0x45')]('tools_tags');var _0x4c94d7=squel[_0x36ed('0x46')]()[_0x36ed('0x43')](_0x36ed('0x47'))[_0x36ed('0x43')](_0x36ed('0x48'))['field'](_0x36ed('0x49'))[_0x36ed('0x45')](_0x36ed('0x4a'),'ui')[_0x36ed('0x4b')](_0x36ed('0x4c'),'u','u.id\x20=\x20ui.UserId');var _0x61ac38=squel[_0x36ed('0x46')]()[_0x36ed('0x45')](_0x36ed('0x4d'),'i')[_0x36ed('0x4b')](_0x36ed('0x4e'),'c',_0x36ed('0x4f'))[_0x36ed('0x4b')](_0x36ed('0x4c'),'o','o.id\x20=\x20i.UserId')[_0x36ed('0x4b')](_0x36ed('0x50'),'a',_0x36ed('0x51'))[_0x36ed('0x4b')](_0x36ed('0x52'),'me',_0x36ed('0x53'))[_0x36ed('0x4b')]('fax_interaction_has_tags','it','it.FaxInteractionId\x20=\x20i.id')['left_join']('tools_tags','t',_0x36ed('0x54'));var _0x4e9f2b=squel[_0x36ed('0x55')]();var _0x48bd56=[];var _0x25d709=squel[_0x36ed('0x55')]();var _0x80411e;if(_0x449faf['query']['search']){_0x80411e=as[_0x36ed('0x56')](_0x449faf[_0x36ed('0x39')][_0x36ed('0x57')]);var _0x7024ee=_0x80411e[_0x36ed('0x58')];for(var _0x3c9e04=0x0;_0x3c9e04<_0x80411e['conditions'][_0x36ed('0x59')];_0x3c9e04++){var _0x36c996=_0x80411e[_0x36ed('0x5a')][_0x3c9e04];var _0xefe91c='i';var _0x4ac7e4=_[_0x36ed('0x5b')](_0x5d7456,[_0x36ed('0x2d'),_0x36c996['field']]);if(!_0x4ac7e4){switch(_0x36c996[_0x36ed('0x43')]){case'unreadMessages':if(_0x36c996['value']==0x1){_0x61ac38[_0x36ed('0x5c')]('`'+_0x36c996['field']+_0x36ed('0x5d'));}else{_0x61ac38['having']('`'+_0x36c996[_0x36ed('0x43')]+_0x36ed('0x5e'));}break;case _0x36ed('0x5f'):if(_0x36c996['operator']==='$substring'){if(_0x36c996['value'][_0x36ed('0x60')]('\x20')[_0x36ed('0x59')]>0x1){_0x4e9f2b[_0x7024ee]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x36ed('0x61')](_0x36c996[_0x36ed('0x62')]),null);}else{var _0x34dbeb='%'+_0x36c996[_0x36ed('0x62')]+'%';_0x4e9f2b[_0x7024ee](_0x36ed('0x63'),_0x34dbeb,_0x34dbeb,_0x34dbeb);}}else{_0x4ac7e4=_[_0x36ed('0x5b')](_0x5d7456,[_0x36ed('0x2d'),_0x36ed('0x64')]);_0x36c996[_0x36ed('0x43')]='ContactId';_0x38550a=as[_0x36ed('0x65')](_0xefe91c,_0x4ac7e4[_0x36ed('0x66')],_0x36c996);_0x4e9f2b[_0x7024ee](_0x38550a['text'],_0x38550a[_0x36ed('0x62')][_0x36ed('0x67')],_0x38550a['value']['end']);}break;case _0x36ed('0x68'):var _0x44a5c3=_0x36c996[_0x36ed('0x62')][_0x36ed('0x60')](',')[_0x36ed('0x2f')](function(_0x4172d8){return Number(_0x4172d8);});_0x44a5c3[_0x36ed('0x32')](function(_0x4c789b){_0x25d709['or'](_0x36ed('0x69'),'%,'+_0x4c789b+',%');});_0x48bd56=_[_0x36ed('0x6a')](_0x48bd56,_0x44a5c3);break;case _0x36ed('0x6b'):if(_0x36c996[_0x36ed('0x6c')]===_0x36ed('0x6d')){_0x4e9f2b[_0x7024ee]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x36c996[_0x36ed('0x62')]+'%',null);}else{_0x4ac7e4=_[_0x36ed('0x5b')](_0x5d7456,[_0x36ed('0x2d'),_0x36ed('0x6e')]);_0x36c996[_0x36ed('0x43')]=_0x36ed('0x6e');_0x38550a=as[_0x36ed('0x65')](_0xefe91c,_0x4ac7e4[_0x36ed('0x66')],_0x36c996);_0x4e9f2b[_0x7024ee](_0x38550a[_0x36ed('0x6f')],_0x38550a[_0x36ed('0x62')][_0x36ed('0x67')],_0x38550a[_0x36ed('0x62')][_0x36ed('0x70')]);}break;case _0x36ed('0x71'):_0x38550a=as[_0x36ed('0x65')]('me',null,_0x36c996);_0x4e9f2b[_0x7024ee](_0x38550a[_0x36ed('0x6f')],_0x38550a[_0x36ed('0x62')][_0x36ed('0x67')],_0x38550a[_0x36ed('0x62')][_0x36ed('0x70')]);break;}}else{var _0x38550a=as['buildExpression'](_0xefe91c,_0x4ac7e4[_0x36ed('0x66')],_0x36c996);_0x4e9f2b[_0x7024ee](_0x38550a['text'],_0x38550a['value'][_0x36ed('0x67')],_0x38550a['value'][_0x36ed('0x70')]);}}}else{var _0x2cf775=_(_0x449faf['query'])[_0x36ed('0x38')]()['map'](function(_0x133f1d){return _['some'](_0x5d7456,['name',_0x133f1d])?_0x133f1d:undefined;})[_0x36ed('0x72')]()['value']();if(!_['isEmpty'](_0x2cf775)){_0x2cf775['forEach'](function(_0x443d00){if(_0x443d00===_0x36ed('0x73')){_0x61ac38[_0x36ed('0x41')](_0x36ed('0x74'),[]['concat'](_0x449faf[_0x36ed('0x39')][_0x443d00]));}else if(_0x443d00===_0x36ed('0x75')){var _0x166fd0=JSON[_0x36ed('0x76')](_0x449faf[_0x36ed('0x39')][_0x443d00])[_0x36ed('0x77')];var _0x500efa=JSON[_0x36ed('0x76')](_0x449faf['query'][_0x443d00])[_0x36ed('0x78')];_0x61ac38[_0x36ed('0x41')](_0x36ed('0x79'),_0x166fd0,_0x500efa);}else{if(_0x449faf[_0x36ed('0x39')][_0x443d00]===_0x36ed('0x7a')){_0x61ac38[_0x36ed('0x41')]('i.'+_0x443d00+_0x36ed('0x7b'));}else{_0x61ac38[_0x36ed('0x41')]('i.'+_0x443d00+_0x36ed('0x7c'),_0x449faf[_0x36ed('0x39')][_0x443d00]);}}});}if(_0x449faf[_0x36ed('0x39')]['read']){if(_0x449faf[_0x36ed('0x39')]['read']==0x1){_0x61ac38['having'](_0x36ed('0x7d'));}else{_0x61ac38['having'](_0x36ed('0x7e'));}}if(_0x449faf[_0x36ed('0x39')][_0x36ed('0x7f')]){_0x48bd56=_[_0x36ed('0x80')](_0x449faf[_0x36ed('0x39')][_0x36ed('0x7f')])?_0x449faf[_0x36ed('0x39')]['tag']:new Array(_0x449faf[_0x36ed('0x39')][_0x36ed('0x7f')]);_0x48bd56[_0x36ed('0x32')](function(_0x552373){_0x25d709['or'](_0x36ed('0x69'),'%,'+_0x552373+',%');});}if(_0x449faf['query'][_0x36ed('0x81')]){var _0x1d4841=_0x449faf[_0x36ed('0x39')][_0x36ed('0x81')]['replace']('\x5c','\x5c\x5c')[_0x36ed('0x82')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x1d4841)){_0x4e9f2b['or'](_0x36ed('0x83'),_0x1d4841+'%')['or']('i.fax\x20LIKE\x20?',_0x1d4841+'%');}_0x4e9f2b['or'](_0x36ed('0x84'),_0x1d4841+'%');}}_0x61ac38[_0x36ed('0x41')](_0x4e9f2b);_0x61ac38[_0x36ed('0x85')](_0x36ed('0x86'));var _0x3a88c9={'type':db[_0x36ed('0x87')][_0x36ed('0x88')][_0x36ed('0x89')],'raw':!![]};var _0x3b971f=_0x61ac38[_0x36ed('0x8a')]();_0x3b971f[_0x36ed('0x43')](_0x36ed('0x86'));_0x3b971f[_0x36ed('0x43')](_0x36ed('0x8b'),_0x36ed('0x8c'));if(_0x3ac681[_0x36ed('0x3f')]){_0x3ac681[_0x36ed('0x3f')][_0x36ed('0x32')](function(_0x25f168){var _0x5a757e=_0x25f168[0x0]==='contactName'?_0x25f168[0x0]:'i.'+_0x25f168[0x0];_0x61ac38[_0x36ed('0x3f')](_0x5a757e,_0x25f168[0x1]===_0x36ed('0x8d')?![]:!![]);});}if(!_[_0x36ed('0x8e')](_0x48bd56)){_0x61ac38[_0x36ed('0x5c')](_0x25d709);_0x3b971f[_0x36ed('0x41')](_0x36ed('0x8f'),_0x48bd56);}BPromise[_0x36ed('0x90')]()[_0x36ed('0x29')](function(){if(!_0x80411e){if(_0x449faf[_0x36ed('0x39')][_0x36ed('0x73')])return;_0x3b971f[_0x36ed('0x41')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x61ac38[_0x36ed('0x41')](_0x36ed('0x91'));return;}if(_0x449faf['user'][_0x36ed('0x92')]!=='agent')return;return _0x449faf[_0x36ed('0x93')][_0x36ed('0x94')]({'attributes':['id'],'raw':!![]})[_0x36ed('0x29')](function(_0x271ba1){if(_['isEmpty'](_0x271ba1)){_0x3b971f['where'](_0x36ed('0x95'));_0x61ac38[_0x36ed('0x41')](_0x36ed('0x95'));}else{_0x3b971f['where'](_0x36ed('0x74'),_['map'](_0x271ba1,'id'));_0x61ac38[_0x36ed('0x41')]('i.FaxAccountId\x20IN\x20?',_[_0x36ed('0x2f')](_0x271ba1,'id'));}});})[_0x36ed('0x29')](function(){if(_0x449faf[_0x36ed('0x93')]['role']===_0x36ed('0x96')&&!_0x80411e&&!_0x449faf[_0x36ed('0x39')][_0x36ed('0x73')])return[];return db[_0x36ed('0x97')]['query'](_0x3b971f[_0x36ed('0x98')](),_0x3a88c9);})['then'](function(_0x594fe6){_0x499f9d['count']=_0x594fe6['length'];if(_0x499f9d['count']===0x0)return[];return db[_0x36ed('0x97')][_0x36ed('0x39')](_0x262391[_0x36ed('0x98')](),_0x3a88c9)[_0x36ed('0x29')](function(_0x59156b){_0x4a5b6e=_[_0x36ed('0x99')](_0x59156b,'id');_0x3a88c9=_['merge'](_0x3a88c9,{'model':db[_0x36ed('0x34')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x449faf['query'][_0x36ed('0x3d')]){_0x3ac681['attributes'][_0x36ed('0x32')](function(_0x452039){_0x61ac38[_0x36ed('0x43')]('i.'+_0x452039);});}else{_0x61ac38[_0x36ed('0x43')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x36ed('0x8c'));_0x61ac38[_0x36ed('0x43')](_0x36ed('0x9a'),_0x36ed('0x9b'));_0x61ac38[_0x36ed('0x43')](_0x36ed('0x9c'),_0x36ed('0x9d'));_0x61ac38['field'](_0x36ed('0x9e'),_0x36ed('0x9f'));_0x61ac38[_0x36ed('0x43')](_0x36ed('0xa0'));_0x61ac38[_0x36ed('0x43')]('c.firstName',_0x36ed('0xa1'));_0x61ac38[_0x36ed('0x43')]('c.lastName',_0x36ed('0xa2'));_0x61ac38[_0x36ed('0x43')](_0x36ed('0xa3'),_0x36ed('0xa4'));_0x61ac38[_0x36ed('0x43')](_0x36ed('0xa5'),_0x36ed('0xa6'));_0x61ac38[_0x36ed('0x43')](_0x36ed('0xa7'),_0x36ed('0xa8'));_0x61ac38['field'](_0x36ed('0xa9'),_0x36ed('0xaa'));_0x61ac38[_0x36ed('0x43')](_0x36ed('0xab'),_0x36ed('0xac'));_0x61ac38['field']('o.internal',_0x36ed('0xad'));_0x61ac38[_0x36ed('0x43')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x36ed('0x30'));}if(_0x3ac681[_0x36ed('0x23')])_0x61ac38[_0x36ed('0x23')](_0x3ac681[_0x36ed('0x23')]);if(_0x3ac681[_0x36ed('0x20')])_0x61ac38[_0x36ed('0x20')](_0x3ac681[_0x36ed('0x20')]);return db[_0x36ed('0x97')][_0x36ed('0x39')](_0x61ac38['toString'](),_0x3a88c9);})[_0x36ed('0x29')](function(_0x26d109){if(_0x26d109[_0x36ed('0x59')]>0x0)_0x4c94d7[_0x36ed('0x41')](_0x36ed('0xae'),_[_0x36ed('0x2f')](_0x26d109,'id'));return db['sequelize'][_0x36ed('0x39')](_0x4c94d7['toString'](),_0x3a88c9)['then'](function(_0x15a9be){var _0x5bc0f2=_[_0x36ed('0xaf')](_0x15a9be,'FaxInteractionId');var _0x324bdc=[];_0x26d109['forEach'](function(_0x15456e){_0x324bdc['push'](updateFaxInteraction(_0x15456e,_0x4a5b6e,_0x5bc0f2));});return BPromise[_0x36ed('0xb0')](_0x324bdc);});});})[_0x36ed('0x29')](function(_0x17beda){_0x499f9d[_0x36ed('0xb1')]=_0x17beda;return _0x499f9d;})[_0x36ed('0x29')](respondWithFilteredResult(_0x2df7ba,_0x3ac681))['catch'](handleError(_0x2df7ba,null));};exports[_0x36ed('0xb2')]=function(_0x42177c,_0x3408db){var _0x15c83b={'raw':![],'where':{'id':_0x42177c['params']['id']}},_0x1ffe0b={};_0x1ffe0b[_0x36ed('0x37')]=_['keys'](db[_0x36ed('0x34')][_0x36ed('0x35')]);_0x1ffe0b['query']=_[_0x36ed('0x38')](_0x42177c['query']);_0x1ffe0b[_0x36ed('0x3a')]=_['intersection'](_0x1ffe0b[_0x36ed('0x37')],_0x1ffe0b[_0x36ed('0x39')]);_0x15c83b[_0x36ed('0x3c')]=_['intersection'](_0x1ffe0b[_0x36ed('0x37')],qs['fields'](_0x42177c[_0x36ed('0x39')]['fields']));_0x15c83b['attributes']=_0x15c83b['attributes']['length']?_0x15c83b[_0x36ed('0x3c')]:_0x1ffe0b['model'];if(_0x42177c[_0x36ed('0x39')][_0x36ed('0xb3')]){_0x15c83b[_0x36ed('0xb4')]=[{'all':!![]}];}_0x15c83b=_[_0x36ed('0xb5')]({},_0x15c83b,_0x42177c[_0x36ed('0xb6')]);return db[_0x36ed('0x34')][_0x36ed('0x5b')](_0x15c83b)[_0x36ed('0x29')](handleEntityNotFound(_0x3408db,null))[_0x36ed('0x29')](respondWithResult(_0x3408db,null))[_0x36ed('0x33')](handleError(_0x3408db,null));};exports[_0x36ed('0xb7')]=function(_0x4697e0,_0x28f01a){return db['FaxInteraction'][_0x36ed('0xb7')](_0x4697e0['body'],{})[_0x36ed('0x29')](respondWithResult(_0x28f01a,0xc9))['catch'](handleError(_0x28f01a,null));};exports[_0x36ed('0x28')]=function(_0x41243b,_0x30e0bf){if(_0x41243b[_0x36ed('0x71')]['id']){delete _0x41243b[_0x36ed('0x71')]['id'];}return db[_0x36ed('0x34')][_0x36ed('0x5b')]({'where':{'id':_0x41243b[_0x36ed('0xb8')]['id']}})['then'](handleEntityNotFound(_0x30e0bf,null))['then'](saveUpdates(_0x41243b[_0x36ed('0x71')],null))[_0x36ed('0x29')](respondWithResult(_0x30e0bf,null))[_0x36ed('0x33')](handleError(_0x30e0bf,null));};exports[_0x36ed('0x2a')]=function(_0x21aaca,_0x485082){return db[_0x36ed('0x34')][_0x36ed('0x5b')]({'where':{'id':_0x21aaca[_0x36ed('0xb8')]['id']}})['then'](handleEntityNotFound(_0x485082,null))[_0x36ed('0x29')](removeEntity(_0x485082,null))['catch'](handleError(_0x485082,null));};exports['describe']=function(_0x3a8e90,_0x178d92){return db[_0x36ed('0x34')]['describe']()['then'](respondWithResult(_0x178d92,null))[_0x36ed('0x33')](handleError(_0x178d92,null));};exports['addMessage']=function(_0xecd59e,_0xc85435,_0x5a36a3){return db[_0x36ed('0xb9')]['find']({'where':{'id':_0xecd59e[_0x36ed('0xb8')]['id']}})[_0x36ed('0x29')](handleEntityNotFound(_0xc85435,null))[_0x36ed('0x29')](function(_0x54dc9a){if(_0x54dc9a){return _0x54dc9a[_0x36ed('0xba')](_0xecd59e[_0x36ed('0x71')][_0x36ed('0xbb')],_['omit'](_0xecd59e[_0x36ed('0x71')],[_0x36ed('0xbb'),'id'])||{});}})[_0x36ed('0x29')](respondWithResult(_0xc85435,null))['catch'](handleError(_0xc85435,null));};exports[_0x36ed('0xbc')]=function(_0x19d1ba,_0x42d80f,_0x1b59f7){var _0x18b730={'raw':![],'where':{}};var _0x1d3b94={};var _0x160871={'count':0x0,'rows':[]};return db[_0x36ed('0x34')]['findOne']({'where':{'id':_0x19d1ba['params']['id']}})[_0x36ed('0x29')](handleEntityNotFound(_0x42d80f,null))['then'](function(_0x26b012){if(_0x26b012){_0x1d3b94[_0x36ed('0x37')]=_['keys'](db[_0x36ed('0xb9')][_0x36ed('0x35')]);_0x1d3b94[_0x36ed('0x39')]=_['keys'](_0x19d1ba[_0x36ed('0x39')]);_0x1d3b94[_0x36ed('0x3a')]=_[_0x36ed('0x3b')](_0x1d3b94[_0x36ed('0x37')],_0x1d3b94['query']);_0x18b730[_0x36ed('0x3c')]=_[_0x36ed('0x3b')](_0x1d3b94['model'],qs[_0x36ed('0x3d')](_0x19d1ba[_0x36ed('0x39')]['fields']));_0x18b730[_0x36ed('0x3c')]=_0x18b730[_0x36ed('0x3c')][_0x36ed('0x59')]?_0x18b730[_0x36ed('0x3c')]:_0x1d3b94['model'];if(!_0x19d1ba['query']['hasOwnProperty']('nolimit')){_0x18b730['limit']=qs[_0x36ed('0x23')](_0x19d1ba['query'][_0x36ed('0x23')]);_0x18b730['offset']=qs[_0x36ed('0x20')](_0x19d1ba[_0x36ed('0x39')][_0x36ed('0x20')]);}_0x18b730[_0x36ed('0x3f')]=qs[_0x36ed('0x40')](_0x19d1ba[_0x36ed('0x39')][_0x36ed('0x40')]);_0x18b730[_0x36ed('0x41')]=qs[_0x36ed('0x3a')](_[_0x36ed('0x42')](_0x19d1ba[_0x36ed('0x39')],_0x1d3b94[_0x36ed('0x3a')]));_0x18b730[_0x36ed('0x41')]['FaxInteractionId']=_0x26b012['id'];if(_0x19d1ba[_0x36ed('0x39')]['filter']){_0x18b730[_0x36ed('0x41')]=_['merge'](_0x18b730[_0x36ed('0x41')],{'$or':_[_0x36ed('0x2f')](_0x18b730[_0x36ed('0x3c')],function(_0x132443){var _0x4930d1={};_0x4930d1[_0x132443]={'$like':'%'+_0x19d1ba[_0x36ed('0x39')][_0x36ed('0x81')]+'%'};return _0x4930d1;})});}if(_0x19d1ba[_0x36ed('0x39')][_0x36ed('0x77')]){var _0x3e830=_0x19d1ba[_0x36ed('0x39')][_0x36ed('0x77')][_0x36ed('0x60')](',');var _0x4d3aac={};_0x4d3aac[_0x3e830[0x0]]={'$gte':moment(_0x3e830[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x18b730[_0x36ed('0x41')]=_[_0x36ed('0xb5')](_0x18b730[_0x36ed('0x41')],_0x4d3aac);}_0x18b730=_[_0x36ed('0xb5')]({},_0x18b730,_0x19d1ba[_0x36ed('0xb6')]);return db[_0x36ed('0xb9')][_0x36ed('0x22')]({'where':_0x18b730[_0x36ed('0x41')]})[_0x36ed('0x29')](function(_0x56626e){_0x160871[_0x36ed('0x22')]=_0x56626e;if(_0x19d1ba[_0x36ed('0x39')][_0x36ed('0xb3')]){_0x18b730[_0x36ed('0xb4')]=[{'all':!![]}];}return db[_0x36ed('0xb9')][_0x36ed('0xbd')](_0x18b730);})[_0x36ed('0x29')](function(_0x3a49a9){_0x160871[_0x36ed('0xb1')]=_0x3a49a9;return _0x160871;});}})['then'](respondWithFilteredResult(_0x42d80f,_0x18b730))[_0x36ed('0x33')](handleError(_0x42d80f,null));};exports[_0x36ed('0xbe')]=function(_0x3e154b,_0x4a97c7,_0x45f687){return db[_0x36ed('0x34')][_0x36ed('0x5b')]({'where':{'id':_0x3e154b[_0x36ed('0xb8')]['id']}})['then'](handleEntityNotFound(_0x4a97c7,null))['then'](function(_0x2e3332){if(_0x2e3332){return _0x2e3332['setTags'](_0x3e154b['body'][_0x36ed('0xbb')],_[_0x36ed('0xbf')](_0x3e154b['body'],[_0x36ed('0xbb'),'id'])||{})['spread'](function(){return db[_0x36ed('0x68')]['findAll']({'attributes':['id',_0x36ed('0x2d'),_0x36ed('0x44')],'where':{'id':_0x3e154b[_0x36ed('0x71')]['ids']}});})[_0x36ed('0x29')](function(_0x1f5fd5){socket[_0x36ed('0xc0')](_0x36ed('0xc1'),{'id':Number(_0x3e154b[_0x36ed('0xb8')]['id']),'tags':_0x1f5fd5||[]});return{'id':Number(_0x3e154b[_0x36ed('0xb8')]['id']),'tags':_0x1f5fd5||[]};});}})[_0x36ed('0x29')](respondWithResult(_0x4a97c7,null))[_0x36ed('0x33')](handleError(_0x4a97c7,null));};exports['removeTags']=function(_0x5bf05b,_0x3984bb,_0x238a35){return db[_0x36ed('0x34')]['find']({'where':{'id':_0x5bf05b[_0x36ed('0xb8')]['id']}})[_0x36ed('0x29')](handleEntityNotFound(_0x3984bb,null))[_0x36ed('0x29')](function(_0x29508e){if(_0x29508e){return _0x29508e['removeTags'](_0x5bf05b[_0x36ed('0x39')][_0x36ed('0xbb')]);}})['then'](respondWithStatusCode(_0x3984bb,null))['catch'](handleError(_0x3984bb,null));};exports['download']=function(_0x51c3ae,_0x3daf92){var _0x344a89=moment()[_0x36ed('0xc2')]()[_0x36ed('0x98')]();var _0x3b24fb=path[_0x36ed('0xc3')](config[_0x36ed('0xc4')],_0x36ed('0xc5'),_0x36ed('0xc6'),_0x36ed('0xc7'));var _0x2d5729=path['join'](config['root'],_0x36ed('0xc5'),_0x36ed('0xc6'),_0x36ed('0xc8'));var _0xebd92e=path['join'](_0x3b24fb,_0x344a89);var _0x960183=util[_0x36ed('0xc9')]('transcript-%d-%s.zip',_0x51c3ae['params']['id'],_0x344a89);var _0x5394ca=path['join'](_0x3b24fb,_0x960183);var _0x14ad6e=[];_0x14ad6e[_0x36ed('0xca')]({'model':db[_0x36ed('0xcb')],'as':_0x36ed('0xcb'),'raw':!![]});var _0xddbc3c=[{'model':db[_0x36ed('0xb9')],'as':_0x36ed('0xcc'),'attributes':['id',_0x36ed('0x71'),_0x36ed('0x75')],'include':_0x14ad6e}];return db[_0x36ed('0x34')][_0x36ed('0x5b')]({'where':{'id':_0x51c3ae[_0x36ed('0xb8')]['id']},'include':_0xddbc3c})[_0x36ed('0x29')](handleEntityNotFound(_0x3daf92,null))[_0x36ed('0x29')](function(_0x4e22ed){if(_0x4e22ed&&_0x4e22ed[_0x36ed('0xcc')]){var _0x55c4da=_0x4e22ed['get']({'plain':!![]});fs[_0x36ed('0xcd')](_0xebd92e);for(var _0xb4f43e=0x0;_0xb4f43e<_0x55c4da['Messages'][_0x36ed('0x59')];_0xb4f43e++){var _0x458f2a=_0x55c4da[_0x36ed('0xcc')][_0xb4f43e][_0x36ed('0xcb')];if(_0x458f2a){var _0x5afe39=path[_0x36ed('0xc3')](_0x2d5729,_0x458f2a[_0x36ed('0xce')]);if(fs[_0x36ed('0xcf')](_0x5afe39)){fs[_0x36ed('0xd0')](_0x5afe39)['pipe'](fs[_0x36ed('0xd1')](path[_0x36ed('0xc3')](_0xebd92e,_0x458f2a['basename'])));}}}return BPromise[_0x36ed('0x90')]()['then'](function(){return new BPromise(function(_0x4f2c54,_0x13f801){zipdir(_0xebd92e,{'saveTo':_0x5394ca},function(_0x356a2c,_0x1574b4){if(_0x356a2c)return _0x13f801(_0x356a2c);return _0x4f2c54(_0x1574b4);});})[_0x36ed('0x29')](function(){return new BPromise(function(_0x3f457a,_0x2def7c){rimraf(_0xebd92e,function(_0x128970){if(_0x128970)_0x2def7c(_0x128970);return _0x3f457a();});});})['then'](function(){return _0x3daf92[_0x36ed('0xd2')](_0x5394ca,_0x960183,function(_0x4daa1b){if(_0x4daa1b){console[_0x36ed('0xd3')]('err',_0x4daa1b);}else{fs[_0x36ed('0xd4')](_0x5394ca);}});});});}else{return _0x3daf92['sendStatus'](0xc8);}})[_0x36ed('0x33')](handleError(_0x3daf92,null));}; \ No newline at end of file +var _0x27cf=['keys','query','filters','attributes','fields','length','order','sort','where','pick','select','field','from','tools_tags','u.id','user_has_fax_interactions','left_join','users','fax_interactions','cm_contacts','o.id\x20=\x20i.UserId','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','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','ContactId','buildExpression','text','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','UserId','start','body','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','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?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','role','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','agent','toString','keyBy','merge','Account.key','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','c.fax','o.fullname','Owner.fullname','Owner.internal','sequelize','groupBy','all','rows','catch','show','params','intersection','include','options','create','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','FaxInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','Tag','color','emit','faxInteractionTags:save','removeTags','download','join','server','files','tmp','root','attachments','Attachment','Messages','createdAt','get','basename','existsSync','createReadStream','createWriteStream','err','unlinkSync','eml-format','rimraf','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','Users','fullname','Tags','TagIds','split','push','index','map','FaxInteraction','rawAttributes','type','key','model'];(function(_0x5db684,_0x11a298){var _0x14d7ca=function(_0x5e2fe4){while(--_0x5e2fe4){_0x5db684['push'](_0x5db684['shift']());}};_0x14d7ca(++_0x11a298);}(_0x27cf,0x9b));var _0xf27c=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0x27cf[_0x1b7368];return _0x25d54c;};'use strict';var emlformat=require(_0xf27c('0x0'));var rimraf=require(_0xf27c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf27c('0x2'));var moment=require(_0xf27c('0x3'));var BPromise=require(_0xf27c('0x4'));var Mustache=require(_0xf27c('0x5'));var util=require('util');var path=require('path');var sox=require(_0xf27c('0x6'));var csv=require(_0xf27c('0x7'));var ejs=require(_0xf27c('0x8'));var fs=require('fs');var fs_extra=require(_0xf27c('0x9'));var _=require(_0xf27c('0xa'));var squel=require('squel');var crypto=require(_0xf27c('0xb'));var jsforce=require(_0xf27c('0xc'));var deskjs=require(_0xf27c('0xd'));var toCsv=require(_0xf27c('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf27c('0xe'));var authService=require(_0xf27c('0xf'));var qs=require(_0xf27c('0x10'));var as=require(_0xf27c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf27c('0x12'))('api');var utils=require(_0xf27c('0x13'));var config=require(_0xf27c('0x14'));var licenseUtil=require(_0xf27c('0x15'));var db=require('../../mysqldb')['db'];config[_0xf27c('0x16')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf27c('0x17'))(new Redis(config['redis']));require(_0xf27c('0x18'))[_0xf27c('0x19')](socket);function respondWithStatusCode(_0x1aac6a,_0x5e3275){_0x5e3275=_0x5e3275||0xcc;return function(_0x40593b){if(_0x40593b){return _0x1aac6a[_0xf27c('0x1a')](_0x5e3275);}return _0x1aac6a[_0xf27c('0x1b')](_0x5e3275)[_0xf27c('0x1c')]();};}function respondWithResult(_0x3c6faa,_0x4c756e){_0x4c756e=_0x4c756e||0xc8;return function(_0x4e7ff1){if(_0x4e7ff1){return _0x3c6faa[_0xf27c('0x1b')](_0x4c756e)[_0xf27c('0x1d')](_0x4e7ff1);}};}function respondWithFilteredResult(_0x4348ed,_0x21cf6a){return function(_0x5173ac){if(_0x5173ac){var _0x4b4329=typeof _0x21cf6a[_0xf27c('0x1e')]==='undefined'&&typeof _0x21cf6a[_0xf27c('0x1f')]==='undefined';var _0x29d3a8=_0x5173ac[_0xf27c('0x20')];var _0x4b0287=_0x4b4329?0x0:_0x21cf6a[_0xf27c('0x1e')];var _0x5f5200=_0x4b4329?_0x5173ac[_0xf27c('0x20')]:_0x21cf6a[_0xf27c('0x1e')]+_0x21cf6a[_0xf27c('0x1f')];var _0x2f1721;if(_0x5f5200>=_0x29d3a8){_0x5f5200=_0x29d3a8;_0x2f1721=0xc8;}else{_0x2f1721=0xce;}_0x4348ed[_0xf27c('0x1b')](_0x2f1721);return _0x4348ed[_0xf27c('0x21')](_0xf27c('0x22'),_0x4b0287+'-'+_0x5f5200+'/'+_0x29d3a8)[_0xf27c('0x1d')](_0x5173ac);}return null;};}function patchUpdates(_0x28d8b4){return function(_0x5a0ada){try{jsonpatch[_0xf27c('0x23')](_0x5a0ada,_0x28d8b4,!![]);}catch(_0x4bd52f){return BPromise[_0xf27c('0x24')](_0x4bd52f);}return _0x5a0ada[_0xf27c('0x25')]();};}function saveUpdates(_0xfb2215,_0x4f5f61){return function(_0x4c32fa){if(_0x4c32fa){return _0x4c32fa[_0xf27c('0x26')](_0xfb2215)[_0xf27c('0x27')](function(_0x511971){return _0x511971;});}return null;};}function removeEntity(_0x45e2df,_0xacaefb){return function(_0x12e382){if(_0x12e382){return _0x12e382[_0xf27c('0x28')]()[_0xf27c('0x27')](function(){_0x45e2df[_0xf27c('0x1b')](0xcc)[_0xf27c('0x1c')]();});}};}function handleEntityNotFound(_0x1ef2fb,_0xf05e61){return function(_0x43953d){if(!_0x43953d){_0x1ef2fb[_0xf27c('0x1a')](0x194);}return _0x43953d;};}function handleError(_0x3cfad9,_0x56ea67){_0x56ea67=_0x56ea67||0x1f4;return function(_0x3bdfae){logger[_0xf27c('0x29')](_0x3bdfae[_0xf27c('0x2a')]);if(_0x3bdfae[_0xf27c('0x2b')]){delete _0x3bdfae[_0xf27c('0x2b')];}_0x3cfad9['status'](_0x56ea67)[_0xf27c('0x2c')](_0x3bdfae);};}function getInteractionUsers(_0x17e9db,_0x15c3e0){return new BPromise(function(_0x44bcea,_0x43b06c){try{if(_0x15c3e0[_0x17e9db['id']]){_0x17e9db[_0xf27c('0x2d')]=_['map'](_0x15c3e0[_0x17e9db['id']],function(_0x37be8b){return{'id':_0x37be8b['id'],'fullname':_0x37be8b[_0xf27c('0x2e')]};});}}catch(_0x384cde){_0x43b06c(_0x384cde);}_0x44bcea(_0x17e9db);});}function getInteractionTags(_0x45b486,_0x351a45){return new BPromise(function(_0x18165d,_0x48534b){try{if(_0x45b486['TagIds']){_0x45b486[_0xf27c('0x2f')]=[];_0x45b486[_0xf27c('0x30')][_0xf27c('0x31')](',')['forEach'](function(_0x55e544){_0x45b486[_0xf27c('0x2f')][_0xf27c('0x32')](_0x351a45[_0x55e544]);});}delete _0x45b486[_0xf27c('0x30')];}catch(_0x1db0b0){_0x48534b(_0x1db0b0);}_0x18165d(_0x45b486);});}function updateFaxInteraction(_0x78df42,_0x36b212,_0x3d46fe){return new BPromise(function(_0x80b3f7,_0x2f7e26){return getInteractionUsers(_0x78df42,_0x3d46fe)[_0xf27c('0x27')](function(_0x44b7c9){return getInteractionTags(_0x44b7c9,_0x36b212);})['then'](function(_0x418182){_0x80b3f7(_0x418182);})['catch'](function(_0x129b1f){_0x2f7e26(_0x129b1f);});});}exports[_0xf27c('0x33')]=function(_0xd66bb8,_0x266a90){var _0x479528={},_0x2ed4f8={},_0x555c6b={'count':0x0,'rows':[]};var _0x102893=_[_0xf27c('0x34')](db[_0xf27c('0x35')][_0xf27c('0x36')],function(_0x28a8e3){return{'name':_0x28a8e3['fieldName'],'type':_0x28a8e3[_0xf27c('0x37')][_0xf27c('0x38')]};});_0x2ed4f8[_0xf27c('0x39')]=_[_0xf27c('0x34')](_0x102893,_0xf27c('0x2b'));_0x2ed4f8['query']=_[_0xf27c('0x3a')](_0xd66bb8[_0xf27c('0x3b')]);_0x2ed4f8[_0xf27c('0x3c')]=_['intersection'](_0x2ed4f8['model'],_0x2ed4f8[_0xf27c('0x3b')]);_0x479528[_0xf27c('0x3d')]=_['intersection'](_0x2ed4f8[_0xf27c('0x39')],qs['fields'](_0xd66bb8['query'][_0xf27c('0x3e')]));_0x479528['attributes']=_0x479528['attributes'][_0xf27c('0x3f')]?_0x479528['attributes']:_0x2ed4f8['model'];if(!_0xd66bb8[_0xf27c('0x3b')]['hasOwnProperty']('nolimit')){_0x479528['limit']=qs[_0xf27c('0x1f')](_0xd66bb8[_0xf27c('0x3b')]['limit']);_0x479528['offset']=qs['offset'](_0xd66bb8[_0xf27c('0x3b')][_0xf27c('0x1e')]);}_0x479528[_0xf27c('0x40')]=qs[_0xf27c('0x41')](_0xd66bb8[_0xf27c('0x3b')][_0xf27c('0x41')]);_0x479528[_0xf27c('0x42')]=qs['filters'](_[_0xf27c('0x43')](_0xd66bb8[_0xf27c('0x3b')],_0x2ed4f8['filters']),_0x102893);var _0x233a15=[];var _0x39b876=squel[_0xf27c('0x44')]()[_0xf27c('0x45')]('id')[_0xf27c('0x45')]('name')['field']('color')[_0xf27c('0x46')](_0xf27c('0x47'));var _0x208304=squel[_0xf27c('0x44')]()[_0xf27c('0x45')](_0xf27c('0x48'))[_0xf27c('0x45')]('u.fullname')[_0xf27c('0x45')]('ui.FaxInteractionId')[_0xf27c('0x46')](_0xf27c('0x49'),'ui')[_0xf27c('0x4a')](_0xf27c('0x4b'),'u','u.id\x20=\x20ui.UserId');var _0xc26967=squel[_0xf27c('0x44')]()['from'](_0xf27c('0x4c'),'i')[_0xf27c('0x4a')](_0xf27c('0x4d'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xf27c('0x4a')](_0xf27c('0x4b'),'o',_0xf27c('0x4e'))['left_join']('fax_accounts','a',_0xf27c('0x4f'))[_0xf27c('0x4a')](_0xf27c('0x50'),'me',_0xf27c('0x51'))[_0xf27c('0x4a')](_0xf27c('0x52'),'it',_0xf27c('0x53'))['left_join'](_0xf27c('0x47'),'t',_0xf27c('0x54'));var _0x2a18ec=squel[_0xf27c('0x55')]();var _0x420234=[];var _0x17bc14=squel[_0xf27c('0x55')]();var _0x34d3d2;if(_0xd66bb8[_0xf27c('0x3b')]['search']){_0x34d3d2=as[_0xf27c('0x56')](_0xd66bb8[_0xf27c('0x3b')]['search']);var _0x17d374=_0x34d3d2[_0xf27c('0x57')];for(var _0x462a69=0x0;_0x462a69<_0x34d3d2[_0xf27c('0x58')][_0xf27c('0x3f')];_0x462a69++){var _0x28fcf3=_0x34d3d2[_0xf27c('0x58')][_0x462a69];var _0x55944a='i';var _0x64cdae=_[_0xf27c('0x59')](_0x102893,[_0xf27c('0x2b'),_0x28fcf3[_0xf27c('0x45')]]);if(!_0x64cdae){switch(_0x28fcf3['field']){case _0xf27c('0x5a'):if(_0x28fcf3[_0xf27c('0x5b')]==0x1){_0xc26967[_0xf27c('0x5c')]('`'+_0x28fcf3[_0xf27c('0x45')]+_0xf27c('0x5d'));}else{_0xc26967[_0xf27c('0x5c')]('`'+_0x28fcf3[_0xf27c('0x45')]+_0xf27c('0x5e'));}break;case _0xf27c('0x5f'):if(_0x28fcf3[_0xf27c('0x60')]===_0xf27c('0x61')){if(_0x28fcf3[_0xf27c('0x5b')][_0xf27c('0x31')]('\x20')[_0xf27c('0x3f')]>0x1){_0x2a18ec[_0x17d374]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xf27c('0x62')](_0x28fcf3[_0xf27c('0x5b')]),null);}else{var _0x3c1bfb='%'+_0x28fcf3['value']+'%';_0x2a18ec[_0x17d374]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x3c1bfb,_0x3c1bfb,_0x3c1bfb);}}else{_0x64cdae=_[_0xf27c('0x59')](_0x102893,[_0xf27c('0x2b'),_0xf27c('0x63')]);_0x28fcf3[_0xf27c('0x45')]=_0xf27c('0x63');_0x28c912=as[_0xf27c('0x64')](_0x55944a,_0x64cdae[_0xf27c('0x37')],_0x28fcf3);_0x2a18ec[_0x17d374](_0x28c912[_0xf27c('0x65')],_0x28c912[_0xf27c('0x5b')]['start'],_0x28c912['value'][_0xf27c('0x1c')]);}break;case'Tag':var _0x1034e6=_0x28fcf3['value'][_0xf27c('0x31')](',')['map'](function(_0x5930a1){return Number(_0x5930a1);});_0x1034e6[_0xf27c('0x66')](function(_0x559400){_0x17bc14['or'](_0xf27c('0x67'),'%,'+_0x559400+',%');});_0x420234=_['union'](_0x420234,_0x1034e6);break;case _0xf27c('0x68'):if(_0x28fcf3[_0xf27c('0x60')]===_0xf27c('0x61')){_0x2a18ec[_0x17d374]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x28fcf3[_0xf27c('0x5b')]+'%',null);}else{_0x64cdae=_['find'](_0x102893,[_0xf27c('0x2b'),_0xf27c('0x69')]);_0x28fcf3[_0xf27c('0x45')]=_0xf27c('0x69');_0x28c912=as['buildExpression'](_0x55944a,_0x64cdae[_0xf27c('0x37')],_0x28fcf3);_0x2a18ec[_0x17d374](_0x28c912['text'],_0x28c912[_0xf27c('0x5b')][_0xf27c('0x6a')],_0x28c912['value'][_0xf27c('0x1c')]);}break;case _0xf27c('0x6b'):_0x28c912=as[_0xf27c('0x64')]('me',null,_0x28fcf3);_0x2a18ec[_0x17d374](_0x28c912['text'],_0x28c912[_0xf27c('0x5b')][_0xf27c('0x6a')],_0x28c912[_0xf27c('0x5b')]['end']);break;}}else{var _0x28c912=as['buildExpression'](_0x55944a,_0x64cdae[_0xf27c('0x37')],_0x28fcf3);_0x2a18ec[_0x17d374](_0x28c912[_0xf27c('0x65')],_0x28c912[_0xf27c('0x5b')]['start'],_0x28c912[_0xf27c('0x5b')][_0xf27c('0x1c')]);}}}else{var _0x5b5e60=_(_0xd66bb8[_0xf27c('0x3b')])[_0xf27c('0x3a')]()[_0xf27c('0x34')](function(_0x31ba75){return _[_0xf27c('0x6c')](_0x102893,[_0xf27c('0x2b'),_0x31ba75])?_0x31ba75:undefined;})[_0xf27c('0x6d')]()[_0xf27c('0x5b')]();if(!_[_0xf27c('0x6e')](_0x5b5e60)){_0x5b5e60[_0xf27c('0x66')](function(_0x4df506){if(_0x4df506===_0xf27c('0x6f')){_0xc26967['where'](_0xf27c('0x70'),[]['concat'](_0xd66bb8[_0xf27c('0x3b')][_0x4df506]));}else if(_0x4df506==='createdAt'){var _0x279ef7=JSON[_0xf27c('0x71')](_0xd66bb8['query'][_0x4df506])[_0xf27c('0x72')];var _0x29f8d9=JSON[_0xf27c('0x71')](_0xd66bb8[_0xf27c('0x3b')][_0x4df506])[_0xf27c('0x73')];_0xc26967[_0xf27c('0x42')](_0xf27c('0x74'),_0x279ef7,_0x29f8d9);}else{if(_0xd66bb8['query'][_0x4df506]===_0xf27c('0x75')){_0xc26967[_0xf27c('0x42')]('i.'+_0x4df506+_0xf27c('0x76'));}else{_0xc26967[_0xf27c('0x42')]('i.'+_0x4df506+_0xf27c('0x77'),_0xd66bb8['query'][_0x4df506]);}}});}if(_0xd66bb8[_0xf27c('0x3b')][_0xf27c('0x78')]){if(_0xd66bb8['query'][_0xf27c('0x78')]==0x1){_0xc26967['having'](_0xf27c('0x79'));}else{_0xc26967[_0xf27c('0x5c')](_0xf27c('0x7a'));}}if(_0xd66bb8[_0xf27c('0x3b')]['tag']){_0x420234=_[_0xf27c('0x7b')](_0xd66bb8[_0xf27c('0x3b')][_0xf27c('0x7c')])?_0xd66bb8[_0xf27c('0x3b')][_0xf27c('0x7c')]:new Array(_0xd66bb8[_0xf27c('0x3b')][_0xf27c('0x7c')]);_0x420234[_0xf27c('0x66')](function(_0x14f3e5){_0x17bc14['or'](_0xf27c('0x67'),'%,'+_0x14f3e5+',%');});}if(_0xd66bb8[_0xf27c('0x3b')][_0xf27c('0x7d')]){var _0x247ec7=_0xd66bb8[_0xf27c('0x3b')][_0xf27c('0x7d')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xf27c('0x7e')](_0x247ec7)){_0x2a18ec['or'](_0xf27c('0x7f'),_0x247ec7+'%')['or'](_0xf27c('0x80'),_0x247ec7+'%');}_0x2a18ec['or'](_0xf27c('0x81'),_0x247ec7+'%');}}_0xc26967['where'](_0x2a18ec);_0xc26967[_0xf27c('0x82')](_0xf27c('0x83'));var _0x10997d={'type':db[_0xf27c('0x84')][_0xf27c('0x85')][_0xf27c('0x86')],'raw':!![]};var _0x49b895=_0xc26967[_0xf27c('0x87')]();_0x49b895[_0xf27c('0x45')](_0xf27c('0x83'));_0x49b895[_0xf27c('0x45')](_0xf27c('0x88'),_0xf27c('0x5a'));if(_0x479528[_0xf27c('0x40')]){_0x479528[_0xf27c('0x40')]['forEach'](function(_0x3c437f){var _0x318f68=_0x3c437f[0x0]===_0xf27c('0x89')?_0x3c437f[0x0]:'i.'+_0x3c437f[0x0];_0xc26967[_0xf27c('0x40')](_0x318f68,_0x3c437f[0x1]===_0xf27c('0x8a')?![]:!![]);});}if(!_[_0xf27c('0x6e')](_0x420234)){_0xc26967[_0xf27c('0x5c')](_0x17bc14);_0x49b895[_0xf27c('0x42')](_0xf27c('0x8b'),_0x420234);}BPromise[_0xf27c('0x8c')]()[_0xf27c('0x27')](function(){if(!_0x34d3d2){if(_0xd66bb8[_0xf27c('0x3b')]['FaxAccountId'])return;_0x49b895[_0xf27c('0x42')](_0xf27c('0x8d'));_0xc26967[_0xf27c('0x42')](_0xf27c('0x8d'));return;}if(_0xd66bb8['user'][_0xf27c('0x8e')]!=='agent')return;return _0xd66bb8[_0xf27c('0x8f')][_0xf27c('0x90')]({'attributes':['id'],'raw':!![]})['then'](function(_0x120acf){if(_['isEmpty'](_0x120acf)){_0x49b895[_0xf27c('0x42')](_0xf27c('0x91'));_0xc26967[_0xf27c('0x42')](_0xf27c('0x91'));}else{_0x49b895[_0xf27c('0x42')](_0xf27c('0x70'),_[_0xf27c('0x34')](_0x120acf,'id'));_0xc26967[_0xf27c('0x42')](_0xf27c('0x70'),_['map'](_0x120acf,'id'));}});})['then'](function(){if(_0xd66bb8[_0xf27c('0x8f')]['role']===_0xf27c('0x92')&&!_0x34d3d2&&!_0xd66bb8[_0xf27c('0x3b')]['FaxAccountId'])return[];return db['sequelize']['query'](_0x49b895[_0xf27c('0x93')](),_0x10997d);})[_0xf27c('0x27')](function(_0xb8c0f){_0x555c6b[_0xf27c('0x20')]=_0xb8c0f[_0xf27c('0x3f')];if(_0x555c6b[_0xf27c('0x20')]===0x0)return[];return db['sequelize'][_0xf27c('0x3b')](_0x39b876[_0xf27c('0x93')](),_0x10997d)['then'](function(_0x59303a){_0x233a15=_[_0xf27c('0x94')](_0x59303a,'id');_0x10997d=_[_0xf27c('0x95')](_0x10997d,{'model':db[_0xf27c('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xd66bb8[_0xf27c('0x3b')][_0xf27c('0x3e')]){_0x479528[_0xf27c('0x3d')]['forEach'](function(_0x25e6c5){_0xc26967[_0xf27c('0x45')]('i.'+_0x25e6c5);});}else{_0xc26967[_0xf27c('0x45')](_0xf27c('0x88'),_0xf27c('0x5a'));_0xc26967[_0xf27c('0x45')]('a.key',_0xf27c('0x96'));_0xc26967[_0xf27c('0x45')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0xc26967[_0xf27c('0x45')](_0xf27c('0x97'),_0xf27c('0x89'));_0xc26967[_0xf27c('0x45')](_0xf27c('0x98'));_0xc26967[_0xf27c('0x45')](_0xf27c('0x99'),'Contact.firstName');_0xc26967[_0xf27c('0x45')](_0xf27c('0x9a'),_0xf27c('0x9b'));_0xc26967[_0xf27c('0x45')](_0xf27c('0x9c'),_0xf27c('0x9d'));_0xc26967[_0xf27c('0x45')]('c.phone',_0xf27c('0x9e'));_0xc26967[_0xf27c('0x45')](_0xf27c('0x9f'),'Contact.mobile');_0xc26967['field'](_0xf27c('0xa0'),'Contact.fax');_0xc26967[_0xf27c('0x45')](_0xf27c('0xa1'),_0xf27c('0xa2'));_0xc26967[_0xf27c('0x45')]('o.internal',_0xf27c('0xa3'));_0xc26967['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0xf27c('0x30'));}if(_0x479528['limit'])_0xc26967[_0xf27c('0x1f')](_0x479528['limit']);if(_0x479528[_0xf27c('0x1e')])_0xc26967[_0xf27c('0x1e')](_0x479528[_0xf27c('0x1e')]);return db[_0xf27c('0xa4')][_0xf27c('0x3b')](_0xc26967[_0xf27c('0x93')](),_0x10997d);})[_0xf27c('0x27')](function(_0x2ffa1d){if(_0x2ffa1d[_0xf27c('0x3f')]>0x0)_0x208304[_0xf27c('0x42')]('ui.FaxInteractionId\x20IN\x20?',_['map'](_0x2ffa1d,'id'));return db['sequelize'][_0xf27c('0x3b')](_0x208304[_0xf27c('0x93')](),_0x10997d)[_0xf27c('0x27')](function(_0x5c3cd4){var _0x49c904=_[_0xf27c('0xa5')](_0x5c3cd4,'FaxInteractionId');var _0x436b2d=[];_0x2ffa1d[_0xf27c('0x66')](function(_0x37f6b8){_0x436b2d[_0xf27c('0x32')](updateFaxInteraction(_0x37f6b8,_0x233a15,_0x49c904));});return BPromise[_0xf27c('0xa6')](_0x436b2d);});});})[_0xf27c('0x27')](function(_0x1d54fc){_0x555c6b[_0xf27c('0xa7')]=_0x1d54fc;return _0x555c6b;})[_0xf27c('0x27')](respondWithFilteredResult(_0x266a90,_0x479528))[_0xf27c('0xa8')](handleError(_0x266a90,null));};exports[_0xf27c('0xa9')]=function(_0x4d48d1,_0x4fa6ad){var _0x12bc70={'raw':![],'where':{'id':_0x4d48d1[_0xf27c('0xaa')]['id']}},_0x48ba12={};_0x48ba12[_0xf27c('0x39')]=_[_0xf27c('0x3a')](db[_0xf27c('0x35')]['rawAttributes']);_0x48ba12[_0xf27c('0x3b')]=_['keys'](_0x4d48d1[_0xf27c('0x3b')]);_0x48ba12[_0xf27c('0x3c')]=_[_0xf27c('0xab')](_0x48ba12['model'],_0x48ba12[_0xf27c('0x3b')]);_0x12bc70[_0xf27c('0x3d')]=_[_0xf27c('0xab')](_0x48ba12[_0xf27c('0x39')],qs[_0xf27c('0x3e')](_0x4d48d1[_0xf27c('0x3b')][_0xf27c('0x3e')]));_0x12bc70['attributes']=_0x12bc70[_0xf27c('0x3d')][_0xf27c('0x3f')]?_0x12bc70[_0xf27c('0x3d')]:_0x48ba12[_0xf27c('0x39')];if(_0x4d48d1['query']['includeAll']){_0x12bc70[_0xf27c('0xac')]=[{'all':!![]}];}_0x12bc70=_['merge']({},_0x12bc70,_0x4d48d1[_0xf27c('0xad')]);return db[_0xf27c('0x35')][_0xf27c('0x59')](_0x12bc70)[_0xf27c('0x27')](handleEntityNotFound(_0x4fa6ad,null))[_0xf27c('0x27')](respondWithResult(_0x4fa6ad,null))[_0xf27c('0xa8')](handleError(_0x4fa6ad,null));};exports[_0xf27c('0xae')]=function(_0x330e71,_0x3c7c14){return db[_0xf27c('0x35')][_0xf27c('0xae')](_0x330e71[_0xf27c('0x6b')],{})[_0xf27c('0x27')](respondWithResult(_0x3c7c14,0xc9))[_0xf27c('0xa8')](handleError(_0x3c7c14,null));};exports[_0xf27c('0x26')]=function(_0x48b107,_0x120568){if(_0x48b107[_0xf27c('0x6b')]['id']){delete _0x48b107[_0xf27c('0x6b')]['id'];}return db[_0xf27c('0x35')][_0xf27c('0x59')]({'where':{'id':_0x48b107[_0xf27c('0xaa')]['id']}})[_0xf27c('0x27')](handleEntityNotFound(_0x120568,null))[_0xf27c('0x27')](saveUpdates(_0x48b107[_0xf27c('0x6b')],null))[_0xf27c('0x27')](respondWithResult(_0x120568,null))[_0xf27c('0xa8')](handleError(_0x120568,null));};exports[_0xf27c('0x28')]=function(_0x1356a6,_0x3f245b){return db[_0xf27c('0x35')][_0xf27c('0x59')]({'where':{'id':_0x1356a6[_0xf27c('0xaa')]['id']}})[_0xf27c('0x27')](handleEntityNotFound(_0x3f245b,null))['then'](removeEntity(_0x3f245b,null))['catch'](handleError(_0x3f245b,null));};exports['describe']=function(_0x25a0bb,_0x1f1082){return db[_0xf27c('0x35')][_0xf27c('0xaf')]()[_0xf27c('0x27')](respondWithResult(_0x1f1082,null))[_0xf27c('0xa8')](handleError(_0x1f1082,null));};exports[_0xf27c('0xb0')]=function(_0x1b0f5e,_0x2c7071,_0x29bbce){return db[_0xf27c('0xb1')][_0xf27c('0x59')]({'where':{'id':_0x1b0f5e['params']['id']}})[_0xf27c('0x27')](handleEntityNotFound(_0x2c7071,null))['then'](function(_0x1390ce){if(_0x1390ce){return _0x1390ce['addMessage'](_0x1b0f5e[_0xf27c('0x6b')][_0xf27c('0xb2')],_[_0xf27c('0xb3')](_0x1b0f5e[_0xf27c('0x6b')],['ids','id'])||{});}})['then'](respondWithResult(_0x2c7071,null))[_0xf27c('0xa8')](handleError(_0x2c7071,null));};exports[_0xf27c('0xb4')]=function(_0x2d91c0,_0x18394a,_0x17bd2b){var _0x143390={'raw':![],'where':{}};var _0xf8165a={};var _0x176f12={'count':0x0,'rows':[]};return db[_0xf27c('0x35')][_0xf27c('0xb5')]({'where':{'id':_0x2d91c0['params']['id']}})[_0xf27c('0x27')](handleEntityNotFound(_0x18394a,null))['then'](function(_0x39bef5){if(_0x39bef5){_0xf8165a['model']=_['keys'](db[_0xf27c('0xb1')]['rawAttributes']);_0xf8165a[_0xf27c('0x3b')]=_[_0xf27c('0x3a')](_0x2d91c0['query']);_0xf8165a['filters']=_[_0xf27c('0xab')](_0xf8165a[_0xf27c('0x39')],_0xf8165a[_0xf27c('0x3b')]);_0x143390[_0xf27c('0x3d')]=_[_0xf27c('0xab')](_0xf8165a['model'],qs[_0xf27c('0x3e')](_0x2d91c0[_0xf27c('0x3b')][_0xf27c('0x3e')]));_0x143390[_0xf27c('0x3d')]=_0x143390[_0xf27c('0x3d')][_0xf27c('0x3f')]?_0x143390[_0xf27c('0x3d')]:_0xf8165a[_0xf27c('0x39')];if(!_0x2d91c0['query'][_0xf27c('0xb6')](_0xf27c('0xb7'))){_0x143390[_0xf27c('0x1f')]=qs[_0xf27c('0x1f')](_0x2d91c0[_0xf27c('0x3b')][_0xf27c('0x1f')]);_0x143390[_0xf27c('0x1e')]=qs[_0xf27c('0x1e')](_0x2d91c0[_0xf27c('0x3b')][_0xf27c('0x1e')]);}_0x143390[_0xf27c('0x40')]=qs[_0xf27c('0x41')](_0x2d91c0[_0xf27c('0x3b')]['sort']);_0x143390[_0xf27c('0x42')]=qs[_0xf27c('0x3c')](_['pick'](_0x2d91c0[_0xf27c('0x3b')],_0xf8165a['filters']));_0x143390[_0xf27c('0x42')][_0xf27c('0xb8')]=_0x39bef5['id'];if(_0x2d91c0['query']['filter']){_0x143390['where']=_[_0xf27c('0x95')](_0x143390[_0xf27c('0x42')],{'$or':_['map'](_0x143390['attributes'],function(_0x2c14c3){var _0x19d723={};_0x19d723[_0x2c14c3]={'$like':'%'+_0x2d91c0[_0xf27c('0x3b')]['filter']+'%'};return _0x19d723;})});}if(_0x2d91c0[_0xf27c('0x3b')][_0xf27c('0x72')]){var _0x168d6d=_0x2d91c0[_0xf27c('0x3b')]['$gte']['split'](',');var _0x418514={};_0x418514[_0x168d6d[0x0]]={'$gte':moment(_0x168d6d[0x1])[_0xf27c('0xb9')](_0xf27c('0xba'))};_0x143390[_0xf27c('0x42')]=_[_0xf27c('0x95')](_0x143390[_0xf27c('0x42')],_0x418514);}_0x143390=_[_0xf27c('0x95')]({},_0x143390,_0x2d91c0['options']);return db['FaxMessage'][_0xf27c('0x20')]({'where':_0x143390[_0xf27c('0x42')]})['then'](function(_0x5a3371){_0x176f12['count']=_0x5a3371;if(_0x2d91c0[_0xf27c('0x3b')]['includeAll']){_0x143390[_0xf27c('0xac')]=[{'all':!![]}];}return db['FaxMessage'][_0xf27c('0xbb')](_0x143390);})[_0xf27c('0x27')](function(_0x45d673){_0x176f12[_0xf27c('0xa7')]=_0x45d673;return _0x176f12;});}})[_0xf27c('0x27')](respondWithFilteredResult(_0x18394a,_0x143390))[_0xf27c('0xa8')](handleError(_0x18394a,null));};exports[_0xf27c('0xbc')]=function(_0x3ade9a,_0x59cbfe,_0x465e40){return db[_0xf27c('0x35')][_0xf27c('0x59')]({'where':{'id':_0x3ade9a[_0xf27c('0xaa')]['id']}})['then'](handleEntityNotFound(_0x59cbfe,null))['then'](function(_0x1b04f5){if(_0x1b04f5){return _0x1b04f5[_0xf27c('0xbd')](_0x3ade9a[_0xf27c('0x6b')][_0xf27c('0xb2')],_[_0xf27c('0xb3')](_0x3ade9a[_0xf27c('0x6b')],['ids','id'])||{})[_0xf27c('0xbe')](function(){return db[_0xf27c('0xbf')]['findAll']({'attributes':['id',_0xf27c('0x2b'),_0xf27c('0xc0')],'where':{'id':_0x3ade9a[_0xf27c('0x6b')][_0xf27c('0xb2')]}});})['then'](function(_0x2c5269){socket[_0xf27c('0xc1')](_0xf27c('0xc2'),{'id':Number(_0x3ade9a[_0xf27c('0xaa')]['id']),'tags':_0x2c5269||[]});return{'id':Number(_0x3ade9a[_0xf27c('0xaa')]['id']),'tags':_0x2c5269||[]};});}})[_0xf27c('0x27')](respondWithResult(_0x59cbfe,null))['catch'](handleError(_0x59cbfe,null));};exports[_0xf27c('0xc3')]=function(_0x263670,_0x3537d7,_0x38c629){return db['FaxInteraction']['find']({'where':{'id':_0x263670[_0xf27c('0xaa')]['id']}})[_0xf27c('0x27')](handleEntityNotFound(_0x3537d7,null))['then'](function(_0x735d89){if(_0x735d89){return _0x735d89['removeTags'](_0x263670[_0xf27c('0x3b')][_0xf27c('0xb2')]);}})[_0xf27c('0x27')](respondWithStatusCode(_0x3537d7,null))[_0xf27c('0xa8')](handleError(_0x3537d7,null));};exports[_0xf27c('0xc4')]=function(_0x5e97fe,_0x160b41){var _0x5d51d5=moment()['unix']()['toString']();var _0x29f72b=path[_0xf27c('0xc5')](config['root'],_0xf27c('0xc6'),_0xf27c('0xc7'),_0xf27c('0xc8'));var _0x44cd9d=path[_0xf27c('0xc5')](config[_0xf27c('0xc9')],_0xf27c('0xc6'),_0xf27c('0xc7'),_0xf27c('0xca'));var _0x1837f6=path[_0xf27c('0xc5')](_0x29f72b,_0x5d51d5);var _0x2734ae=util[_0xf27c('0xb9')]('transcript-%d-%s.zip',_0x5e97fe['params']['id'],_0x5d51d5);var _0x2badf1=path['join'](_0x29f72b,_0x2734ae);var _0x48f6c1=[];_0x48f6c1[_0xf27c('0x32')]({'model':db['Attachment'],'as':_0xf27c('0xcb'),'raw':!![]});var _0x29bca3=[{'model':db[_0xf27c('0xb1')],'as':_0xf27c('0xcc'),'attributes':['id',_0xf27c('0x6b'),_0xf27c('0xcd')],'include':_0x48f6c1}];return db['FaxInteraction']['find']({'where':{'id':_0x5e97fe[_0xf27c('0xaa')]['id']},'include':_0x29bca3})['then'](handleEntityNotFound(_0x160b41,null))[_0xf27c('0x27')](function(_0x3d609d){if(_0x3d609d&&_0x3d609d[_0xf27c('0xcc')]){var _0x4441ea=_0x3d609d[_0xf27c('0xce')]({'plain':!![]});fs['mkdirSync'](_0x1837f6);for(var _0x1fea05=0x0;_0x1fea05<_0x4441ea[_0xf27c('0xcc')]['length'];_0x1fea05++){var _0x23119c=_0x4441ea[_0xf27c('0xcc')][_0x1fea05][_0xf27c('0xcb')];if(_0x23119c){var _0x23e1fb=path[_0xf27c('0xc5')](_0x44cd9d,_0x23119c[_0xf27c('0xcf')]);if(fs[_0xf27c('0xd0')](_0x23e1fb)){fs[_0xf27c('0xd1')](_0x23e1fb)['pipe'](fs[_0xf27c('0xd2')](path['join'](_0x1837f6,_0x23119c[_0xf27c('0xcf')])));}}}return BPromise[_0xf27c('0x8c')]()[_0xf27c('0x27')](function(){return new BPromise(function(_0x2d68df,_0x35a9cb){zipdir(_0x1837f6,{'saveTo':_0x2badf1},function(_0x5c5d7b,_0x5c79b9){if(_0x5c5d7b)return _0x35a9cb(_0x5c5d7b);return _0x2d68df(_0x5c79b9);});})[_0xf27c('0x27')](function(){return new BPromise(function(_0x546680,_0x1c2aa0){rimraf(_0x1837f6,function(_0x378140){if(_0x378140)_0x1c2aa0(_0x378140);return _0x546680();});});})[_0xf27c('0x27')](function(){return _0x160b41[_0xf27c('0xc4')](_0x2badf1,_0x2734ae,function(_0x54a445){if(_0x54a445){console['log'](_0xf27c('0xd3'),_0x54a445);}else{fs[_0xf27c('0xd4')](_0x2badf1);}});});});}else{return _0x160b41[_0xf27c('0x1a')](0xc8);}})['catch'](handleError(_0x160b41,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 936ccd5..2e38d50 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 _0x26bb=['save','update','remove','Users','map','findAll','then','setDataValue','emit','catch','hasOwnProperty','FaxInteraction','FaxMessage'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x26bb,0x191));var _0xb26b=function(_0x173412,_0xd1d0de){_0x173412=_0x173412-0x0;var _0x157ea7=_0x26bb[_0x173412];return _0x157ea7;};'use strict';var EventEmitter=require('events');var FaxInteraction=require('../../mysqldb')['db'][_0xb26b('0x0')];var FaxMessage=require('../../mysqldb')['db'][_0xb26b('0x1')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb26b('0x2'),'afterUpdate':_0xb26b('0x3'),'afterDestroy':_0xb26b('0x4')};function emitEvent(_0x38b9ac){return function(_0x1c96a7,_0x360b2c,_0xa42eb9){_0x1c96a7['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x581f0e){_0x1c96a7['setDataValue'](_0xb26b('0x5'),_0x581f0e[_0xb26b('0x6')](function(_0xcbd4bc){return{'id':_0xcbd4bc['id']};}));return FaxMessage[_0xb26b('0x7')]({'where':{'FaxInteractionId':_0x1c96a7['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb26b('0x8')](function(_0x587bed){_0x1c96a7[_0xb26b('0x9')]('unreadMessages',_0x587bed['length']);FaxInteractionEvents[_0xb26b('0xa')](_0x38b9ac+':'+_0x1c96a7['id'],_0x1c96a7);FaxInteractionEvents[_0xb26b('0xa')](_0x38b9ac,_0x1c96a7);_0xa42eb9(null);})[_0xb26b('0xb')](_0xa42eb9(null));};}for(var e in events){if(events[_0xb26b('0xc')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file +var _0x2065=['update','remove','getUsers','then','setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','setMaxListeners'];(function(_0xf86c4b,_0x540f7d){var _0x562f7e=function(_0x376a71){while(--_0x376a71){_0xf86c4b['push'](_0xf86c4b['shift']());}};_0x562f7e(++_0x540f7d);}(_0x2065,0xc2));var _0x5206=function(_0x51821c,_0x3d03be){_0x51821c=_0x51821c-0x0;var _0x4f57a3=_0x2065[_0x51821c];return _0x4f57a3;};'use strict';var EventEmitter=require(_0x5206('0x0'));var FaxInteraction=require(_0x5206('0x1'))['db'][_0x5206('0x2')];var FaxMessage=require(_0x5206('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x5206('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5206('0x4'),'afterDestroy':_0x5206('0x5')};function emitEvent(_0xcdaeea){return function(_0x20ee11,_0x56ad9a,_0x466a5d){_0x20ee11[_0x5206('0x6')]({'attributes':['id'],'raw':!![]})[_0x5206('0x7')](function(_0x2a751d){_0x20ee11[_0x5206('0x8')](_0x5206('0x9'),_0x2a751d[_0x5206('0xa')](function(_0xe8794b){return{'id':_0xe8794b['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x20ee11['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5206('0x7')](function(_0x1f75da){_0x20ee11[_0x5206('0x8')](_0x5206('0xb'),_0x1f75da[_0x5206('0xc')]);FaxInteractionEvents[_0x5206('0xd')](_0xcdaeea+':'+_0x20ee11['id'],_0x20ee11);FaxInteractionEvents[_0x5206('0xd')](_0xcdaeea,_0x20ee11);_0x466a5d(null);})[_0x5206('0xe')](_0x466a5d(null));};}for(var e in events){if(events[_0x5206('0xf')](e)){var event=events[e];FaxInteraction[_0x5206('0x10')](e,emitEvent(event));}}module[_0x5206('0x11')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index f62df8a..bca5d54 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 _0x032e=['fax_interactions','changed','format','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FaxInteraction'];(function(_0x4decf9,_0x4e039b){var _0x5c390c=function(_0x57e4fc){while(--_0x57e4fc){_0x4decf9['push'](_0x4decf9['shift']());}};_0x5c390c(++_0x4e039b);}(_0x032e,0x6d));var _0xe032=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x032e[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe032('0x0'))(_0xe032('0x1'));var moment=require(_0xe032('0x2'));var BPromise=require(_0xe032('0x3'));var rp=require(_0xe032('0x4'));var fs=require('fs');var path=require(_0xe032('0x5'));var rimraf=require(_0xe032('0x6'));var config=require(_0xe032('0x7'));var attributes=require('./faxInteraction.attributes');module[_0xe032('0x8')]=function(_0x3c35a0,_0x3ba8df){return _0x3c35a0[_0xe032('0x9')](_0xe032('0xa'),attributes,{'tableName':_0xe032('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2d70fa,_0x341efc,_0x453060){if(_0x2d70fa[_0xe032('0xc')]('closed')){_0x2d70fa['closedAt']=moment()[_0xe032('0xd')](_0xe032('0xe'));}_0x453060(null,_0x2d70fa);}}});}; \ No newline at end of file +var _0xd237=['path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird'];(function(_0x54613d,_0x4b8872){var _0x11c35b=function(_0x4ca863){while(--_0x4ca863){_0x54613d['push'](_0x54613d['shift']());}};_0x11c35b(++_0x4b8872);}(_0xd237,0x12b));var _0x7d23=function(_0xb86549,_0x4fd63c){_0xb86549=_0xb86549-0x0;var _0x4853a8=_0xd237[_0xb86549];return _0x4853a8;};'use strict';var _=require(_0x7d23('0x0'));var util=require(_0x7d23('0x1'));var logger=require(_0x7d23('0x2'))(_0x7d23('0x3'));var moment=require('moment');var BPromise=require(_0x7d23('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7d23('0x5'));var rimraf=require(_0x7d23('0x6'));var config=require(_0x7d23('0x7'));var attributes=require(_0x7d23('0x8'));module[_0x7d23('0x9')]=function(_0x5f2a3e,_0x5e7bbf){return _0x5f2a3e[_0x7d23('0xa')](_0x7d23('0xb'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x397bb1,_0x39eebd,_0x1cf1a2){if(_0x397bb1[_0x7d23('0xc')](_0x7d23('0xd'))){_0x397bb1[_0x7d23('0xe')]=moment()['format'](_0x7d23('0xf'));}_0x1cf1a2(null,_0x397bb1);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index f6251ca..a0456ea 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 _0xb9ad=['body','options','debug','AddTagsToFaxInteraction','find','where','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateFaxInteraction','FaxInteraction'];(function(_0x2d442b,_0x3cd039){var _0x5b9da1=function(_0x277c6b){while(--_0x277c6b){_0x2d442b['push'](_0x2d442b['shift']());}};_0x5b9da1(++_0x3cd039);}(_0xb9ad,0x132));var _0xdb9a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb9ad[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xdb9a('0x0'));var util=require(_0xdb9a('0x1'));var moment=require(_0xdb9a('0x2'));var BPromise=require(_0xdb9a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdb9a('0x4'));var db=require(_0xdb9a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdb9a('0x6'));var config=require('../../config/environment');var jayson=require(_0xdb9a('0x7'));var client=jayson[_0xdb9a('0x8')][_0xdb9a('0x9')]({'port':0x232a});config[_0xdb9a('0xa')]=_[_0xdb9a('0xb')](config[_0xdb9a('0xa')],{'host':_0xdb9a('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdb9a('0xa')]));require('./faxInteraction.socket')[_0xdb9a('0xd')](socket);function respondWithRpcPromise(_0x3c7f96,_0x242371,_0x531c0b){return new BPromise(function(_0x1281e7,_0x5b8eaa){return client[_0xdb9a('0xe')](_0x3c7f96,_0x531c0b)[_0xdb9a('0xf')](function(_0x47046b){logger[_0xdb9a('0x10')](_0xdb9a('0x11'),_0x242371,_0xdb9a('0x12'));logger['debug'](_0xdb9a('0x13'),_0x242371,_0xdb9a('0x12'),JSON[_0xdb9a('0x14')](_0x47046b));if(_0x47046b['error']){if(_0x47046b[_0xdb9a('0x15')][_0xdb9a('0x16')]===0x1f4){logger[_0xdb9a('0x15')](_0xdb9a('0x11'),_0x242371,_0x47046b['error']['message']);return _0x5b8eaa(_0x47046b[_0xdb9a('0x15')][_0xdb9a('0x17')]);}logger[_0xdb9a('0x15')](_0xdb9a('0x11'),_0x242371,_0x47046b[_0xdb9a('0x15')][_0xdb9a('0x17')]);return _0x1281e7(_0x47046b[_0xdb9a('0x15')]['message']);}else{logger[_0xdb9a('0x10')](_0xdb9a('0x11'),_0x242371,_0xdb9a('0x12'));_0x1281e7(_0x47046b['result'][_0xdb9a('0x17')]);}})[_0xdb9a('0x18')](function(_0x5975ba){logger['error'](_0xdb9a('0x11'),_0x242371,_0x5975ba);_0x5b8eaa(_0x5975ba);});});}exports[_0xdb9a('0x19')]=function(_0xb2ed87){var _0x68ffa8=this;return new Promise(function(_0x594ac2,_0x99796a){return db[_0xdb9a('0x1a')]['update'](_0xb2ed87[_0xdb9a('0x1b')],{'raw':_0xb2ed87[_0xdb9a('0x1c')]?_0xb2ed87[_0xdb9a('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb2ed87[_0xdb9a('0x1c')]?_0xb2ed87[_0xdb9a('0x1c')]['where']||null:null,'attributes':_0xb2ed87[_0xdb9a('0x1c')]?_0xb2ed87['options']['attributes']||null:null,'limit':_0xb2ed87[_0xdb9a('0x1c')]?_0xb2ed87[_0xdb9a('0x1c')]['limit']||null:null})[_0xdb9a('0xf')](function(_0x130e07){logger['info'](_0xdb9a('0x19'),_0xb2ed87);logger[_0xdb9a('0x1d')](_0xdb9a('0x19'),_0xb2ed87,JSON[_0xdb9a('0x14')](_0x130e07));_0x594ac2(_0x130e07);})[_0xdb9a('0x18')](function(_0x324dd7){logger[_0xdb9a('0x15')](_0xdb9a('0x19'),_0x324dd7[_0xdb9a('0x17')],_0xb2ed87);_0x99796a(_0x68ffa8[_0xdb9a('0x15')](0x1f4,_0x324dd7['message']));});});};exports[_0xdb9a('0x1e')]=function(_0x47e45c){return new Promise(function(_0x32bee4,_0x35cf27){return db['FaxInteraction'][_0xdb9a('0x1f')]({'where':_0x47e45c['options']?_0x47e45c[_0xdb9a('0x1c')][_0xdb9a('0x20')]||null:null})['then'](function(_0x4559fd){if(_0x4559fd){return _0x4559fd[_0xdb9a('0x21')](_0x47e45c['body'][_0xdb9a('0x22')],_['omit'](_0x47e45c[_0xdb9a('0x1b')],[_0xdb9a('0x22'),'id'])||{});}})[_0xdb9a('0x23')](function(_0x2e1ac7){logger[_0xdb9a('0x10')](_0xdb9a('0x24'),_0x47e45c);logger[_0xdb9a('0x1d')]('AddTags',_0x47e45c,JSON[_0xdb9a('0x14')](_0x2e1ac7));_0x32bee4(_0x2e1ac7);})[_0xdb9a('0x18')](function(_0x4e294a){logger[_0xdb9a('0x15')](_0xdb9a('0x24'),_0x4e294a[_0xdb9a('0x17')],_0x47e45c);_0x35cf27(_this['error'](0x1f4,_0x4e294a[_0xdb9a('0x17')]));});});}; \ No newline at end of file +var _0x8f06=['debug','AddTagsToFaxInteraction','find','where','addTags','body','omit','spread','AddTags','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./faxInteraction.socket','register','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','UpdateFaxInteraction','FaxInteraction','update','options','raw','attributes'];(function(_0x160ff7,_0x33f2fb){var _0x3b37be=function(_0x1328b1){while(--_0x1328b1){_0x160ff7['push'](_0x160ff7['shift']());}};_0x3b37be(++_0x33f2fb);}(_0x8f06,0x1e3));var _0x68f0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x8f06[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x68f0('0x0'));var util=require(_0x68f0('0x1'));var moment=require(_0x68f0('0x2'));var BPromise=require(_0x68f0('0x3'));var rs=require(_0x68f0('0x4'));var fs=require('fs');var Redis=require(_0x68f0('0x5'));var db=require(_0x68f0('0x6'))['db'];var utils=require(_0x68f0('0x7'));var logger=require(_0x68f0('0x8'))(_0x68f0('0x9'));var config=require(_0x68f0('0xa'));var jayson=require(_0x68f0('0xb'));var client=jayson[_0x68f0('0xc')][_0x68f0('0xd')]({'port':0x232a});config['redis']=_[_0x68f0('0xe')](config[_0x68f0('0xf')],{'host':'localhost','port':0x18eb});var socket=require(_0x68f0('0x10'))(new Redis(config[_0x68f0('0xf')]));require(_0x68f0('0x11'))[_0x68f0('0x12')](socket);function respondWithRpcPromise(_0x293f5a,_0x5b7949,_0x102790){return new BPromise(function(_0x4f923b,_0x418891){return client['request'](_0x293f5a,_0x102790)[_0x68f0('0x13')](function(_0x258eb8){logger[_0x68f0('0x14')](_0x68f0('0x15'),_0x5b7949,_0x68f0('0x16'));logger['debug'](_0x68f0('0x17'),_0x5b7949,_0x68f0('0x16'),JSON[_0x68f0('0x18')](_0x258eb8));if(_0x258eb8['error']){if(_0x258eb8[_0x68f0('0x19')]['code']===0x1f4){logger['error'](_0x68f0('0x15'),_0x5b7949,_0x258eb8[_0x68f0('0x19')][_0x68f0('0x1a')]);return _0x418891(_0x258eb8['error'][_0x68f0('0x1a')]);}logger['error'](_0x68f0('0x15'),_0x5b7949,_0x258eb8['error'][_0x68f0('0x1a')]);return _0x4f923b(_0x258eb8[_0x68f0('0x19')][_0x68f0('0x1a')]);}else{logger['info'](_0x68f0('0x15'),_0x5b7949,_0x68f0('0x16'));_0x4f923b(_0x258eb8['result'][_0x68f0('0x1a')]);}})['catch'](function(_0x472d70){logger[_0x68f0('0x19')](_0x68f0('0x15'),_0x5b7949,_0x472d70);_0x418891(_0x472d70);});});}exports[_0x68f0('0x1b')]=function(_0x394344){var _0x341e8f=this;return new Promise(function(_0x5783c3,_0x212990){return db[_0x68f0('0x1c')][_0x68f0('0x1d')](_0x394344['body'],{'raw':_0x394344[_0x68f0('0x1e')]?_0x394344[_0x68f0('0x1e')][_0x68f0('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x394344['options']?_0x394344[_0x68f0('0x1e')]['where']||null:null,'attributes':_0x394344[_0x68f0('0x1e')]?_0x394344['options'][_0x68f0('0x20')]||null:null,'limit':_0x394344['options']?_0x394344['options']['limit']||null:null})['then'](function(_0x53b003){logger['info'](_0x68f0('0x1b'),_0x394344);logger[_0x68f0('0x21')](_0x68f0('0x1b'),_0x394344,JSON['stringify'](_0x53b003));_0x5783c3(_0x53b003);})['catch'](function(_0x27cdbb){logger['error'](_0x68f0('0x1b'),_0x27cdbb[_0x68f0('0x1a')],_0x394344);_0x212990(_0x341e8f[_0x68f0('0x19')](0x1f4,_0x27cdbb[_0x68f0('0x1a')]));});});};exports[_0x68f0('0x22')]=function(_0x4172e0){return new Promise(function(_0x5a5c42,_0x2d4b1f){return db[_0x68f0('0x1c')][_0x68f0('0x23')]({'where':_0x4172e0[_0x68f0('0x1e')]?_0x4172e0[_0x68f0('0x1e')][_0x68f0('0x24')]||null:null})[_0x68f0('0x13')](function(_0x5c91e8){if(_0x5c91e8){return _0x5c91e8[_0x68f0('0x25')](_0x4172e0[_0x68f0('0x26')]['ids'],_[_0x68f0('0x27')](_0x4172e0['body'],['ids','id'])||{});}})[_0x68f0('0x28')](function(_0x1c55ff){logger[_0x68f0('0x14')](_0x68f0('0x29'),_0x4172e0);logger[_0x68f0('0x21')]('AddTags',_0x4172e0,JSON[_0x68f0('0x18')](_0x1c55ff));_0x5a5c42(_0x1c55ff);})[_0x68f0('0x2a')](function(_0x4ecc05){logger[_0x68f0('0x19')](_0x68f0('0x29'),_0x4ecc05[_0x68f0('0x1a')],_0x4172e0);_0x2d4b1f(_this[_0x68f0('0x19')](0x1f4,_0x4ecc05[_0x68f0('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index cf1c4f3..7a13b35 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 _0x5b8c=['emit','removeListener','register','length','faxInteraction:','./faxInteraction.events','save','remove','update'];(function(_0x2d7afc,_0x4b5d42){var _0x13961d=function(_0x5c7973){while(--_0x5c7973){_0x2d7afc['push'](_0x2d7afc['shift']());}};_0x13961d(++_0x4b5d42);}(_0x5b8c,0xef));var _0xc5b8=function(_0x2c90c1,_0x446eda){_0x2c90c1=_0x2c90c1-0x0;var _0xcb55d4=_0x5b8c[_0x2c90c1];return _0xcb55d4;};'use strict';var FaxInteractionEvents=require(_0xc5b8('0x0'));var events=[_0xc5b8('0x1'),_0xc5b8('0x2'),_0xc5b8('0x3')];function createListener(_0x2400a9,_0xe4b0d5){return function(_0x2e387a){_0xe4b0d5[_0xc5b8('0x4')](_0x2400a9,_0x2e387a);};}function removeListener(_0x2605e3,_0x199760){return function(){FaxInteractionEvents[_0xc5b8('0x5')](_0x2605e3,_0x199760);};}exports[_0xc5b8('0x6')]=function(_0xcf31c5){for(var _0x2a09dd=0x0,_0x42d92c=events[_0xc5b8('0x7')];_0x2a09dd<_0x42d92c;_0x2a09dd++){var _0x4fee37=events[_0x2a09dd];var _0x49d6b7=createListener(_0xc5b8('0x8')+_0x4fee37,_0xcf31c5);FaxInteractionEvents['on'](_0x4fee37,_0x49d6b7);}}; \ No newline at end of file +var _0x3ba0=['update','emit','removeListener','register','length','./faxInteraction.events','remove'];(function(_0x32355d,_0xa6b12e){var _0x995a4f=function(_0xf240ac){while(--_0xf240ac){_0x32355d['push'](_0x32355d['shift']());}};_0x995a4f(++_0xa6b12e);}(_0x3ba0,0x18d));var _0x03ba=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x3ba0[_0xa464c9];return _0x3d73c4;};'use strict';var FaxInteractionEvents=require(_0x03ba('0x0'));var events=['save',_0x03ba('0x1'),_0x03ba('0x2')];function createListener(_0x2a4dcf,_0x403261){return function(_0x6ad811){_0x403261[_0x03ba('0x3')](_0x2a4dcf,_0x6ad811);};}function removeListener(_0x23c1cf,_0x2371b0){return function(){FaxInteractionEvents[_0x03ba('0x4')](_0x23c1cf,_0x2371b0);};}exports[_0x03ba('0x5')]=function(_0x1b6581){for(var _0x239db5=0x0,_0x83be5a=events[_0x03ba('0x6')];_0x239db5<_0x83be5a;_0x239db5++){var _0x3d6cf9=events[_0x239db5];var _0x2a1ede=createListener('faxInteraction:'+_0x3d6cf9,_0x1b6581);FaxInteractionEvents['on'](_0x3d6cf9,_0x2a1ede);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index e6f534c..159a210 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 _0x2070=['post','create','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','put','faxinteraction:update','update','faxinteraction:destroy','destroy','delete','removeTags','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./faxInteraction.controller','isAuthenticated','/describe','get','/:id','show','/:id/messages','getMessages','/:id/download','download'];(function(_0x5c4eca,_0xe20ecb){var _0x57f1d5=function(_0x330d83){while(--_0x330d83){_0x5c4eca['push'](_0x5c4eca['shift']());}};_0x57f1d5(++_0xe20ecb);}(_0x2070,0x1a2));var _0x0207=function(_0x2cf71f,_0x342ff8){_0x2cf71f=_0x2cf71f-0x0;var _0x13bc14=_0x2070[_0x2cf71f];return _0x13bc14;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0207('0x0'));var timeout=require(_0x0207('0x1'));var express=require(_0x0207('0x2'));var router=express['Router']();var fs_extra=require(_0x0207('0x3'));var auth=require(_0x0207('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0207('0x5'));var controller=require(_0x0207('0x6'));router['get']('/',auth[_0x0207('0x7')](),controller['index']);router['get'](_0x0207('0x8'),auth[_0x0207('0x7')](),controller['describe']);router[_0x0207('0x9')](_0x0207('0xa'),auth['isAuthenticated'](),controller[_0x0207('0xb')]);router[_0x0207('0x9')](_0x0207('0xc'),auth[_0x0207('0x7')](),controller[_0x0207('0xd')]);router[_0x0207('0x9')](_0x0207('0xe'),auth[_0x0207('0x7')](),controller[_0x0207('0xf')]);router[_0x0207('0x10')]('/',auth[_0x0207('0x7')](),controller[_0x0207('0x11')]);router[_0x0207('0x10')](_0x0207('0xc'),auth['isAuthenticated'](),controller[_0x0207('0x12')]);router['post'](_0x0207('0x13'),auth[_0x0207('0x7')](),interaction[_0x0207('0x14')](_0x0207('0x15'),_0x0207('0x16')),controller['addTags']);router[_0x0207('0x17')](_0x0207('0xa'),auth['isAuthenticated'](),interaction[_0x0207('0x14')](_0x0207('0x15'),_0x0207('0x18')),controller[_0x0207('0x19')]);router['delete'](_0x0207('0xa'),auth[_0x0207('0x7')](),interaction[_0x0207('0x14')](_0x0207('0x15'),_0x0207('0x1a')),controller[_0x0207('0x1b')]);router[_0x0207('0x1c')](_0x0207('0x13'),auth[_0x0207('0x7')](),controller[_0x0207('0x1d')]);module[_0x0207('0x1e')]=router; \ No newline at end of file +var _0xee16=['exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','/:id/tags','addTags','put','faxinteraction:update','faxinteraction:destroy','destroy','delete'];(function(_0x3a4f18,_0x1af741){var _0x4c20fc=function(_0x27115f){while(--_0x27115f){_0x3a4f18['push'](_0x3a4f18['shift']());}};_0x4c20fc(++_0x1af741);}(_0xee16,0x187));var _0x6ee1=function(_0x46451c,_0x88ddd){_0x46451c=_0x46451c-0x0;var _0x12dce4=_0xee16[_0x46451c];return _0x12dce4;};'use strict';var multer=require('multer');var util=require(_0x6ee1('0x0'));var path=require(_0x6ee1('0x1'));var timeout=require(_0x6ee1('0x2'));var express=require('express');var router=express[_0x6ee1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6ee1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6ee1('0x5'));var controller=require(_0x6ee1('0x6'));router[_0x6ee1('0x7')]('/',auth[_0x6ee1('0x8')](),controller[_0x6ee1('0x9')]);router[_0x6ee1('0x7')]('/describe',auth[_0x6ee1('0x8')](),controller[_0x6ee1('0xa')]);router[_0x6ee1('0x7')](_0x6ee1('0xb'),auth[_0x6ee1('0x8')](),controller[_0x6ee1('0xc')]);router[_0x6ee1('0x7')](_0x6ee1('0xd'),auth['isAuthenticated'](),controller[_0x6ee1('0xe')]);router[_0x6ee1('0x7')](_0x6ee1('0xf'),auth[_0x6ee1('0x8')](),controller['download']);router[_0x6ee1('0x10')]('/',auth[_0x6ee1('0x8')](),controller[_0x6ee1('0x11')]);router[_0x6ee1('0x10')](_0x6ee1('0xd'),auth[_0x6ee1('0x8')](),controller['addMessage']);router[_0x6ee1('0x10')](_0x6ee1('0x12'),auth['isAuthenticated'](),interaction['tracked']('fax','faxinteraction:addtags'),controller[_0x6ee1('0x13')]);router[_0x6ee1('0x14')]('/:id',auth['isAuthenticated'](),interaction['tracked']('fax',_0x6ee1('0x15')),controller['update']);router['delete'](_0x6ee1('0xb'),auth[_0x6ee1('0x8')](),interaction['tracked']('fax',_0x6ee1('0x16')),controller[_0x6ee1('0x17')]);router[_0x6ee1('0x18')](_0x6ee1('0x12'),auth[_0x6ee1('0x8')](),controller['removeTags']);module[_0x6ee1('0x19')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 5e3ce13..9538dae 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 _0x4bc3=['TEXT','DATE','sequelize','exports','medium','BOOLEAN','out'];(function(_0x4a5e70,_0x5e0bb2){var _0x13e545=function(_0x330f6d){while(--_0x330f6d){_0x4a5e70['push'](_0x4a5e70['shift']());}};_0x13e545(++_0x5e0bb2);}(_0x4bc3,0x16e));var _0x34bc=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0x4bc3[_0x2db12b];return _0x20990b;};'use strict';var Sequelize=require(_0x34bc('0x0'));module[_0x34bc('0x1')]={'body':{'type':Sequelize['TEXT'](_0x34bc('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x34bc('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x34bc('0x4')),'defaultValue':_0x34bc('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x34bc('0x5')],'defaultValue':null},'readAt':{'type':Sequelize[_0x34bc('0x6')]}}; \ No newline at end of file +var _0x12fd=['BOOLEAN','out','DATE','sequelize','exports','TEXT','medium'];(function(_0x35a274,_0x98b399){var _0x40d905=function(_0x5c8455){while(--_0x5c8455){_0x35a274['push'](_0x35a274['shift']());}};_0x40d905(++_0x98b399);}(_0x12fd,0x199));var _0xd12f=function(_0x13bdd8,_0x2c7754){_0x13bdd8=_0x13bdd8-0x0;var _0xe0c327=_0x12fd[_0x13bdd8];return _0xe0c327;};'use strict';var Sequelize=require(_0xd12f('0x0'));module[_0xd12f('0x1')]={'body':{'type':Sequelize[_0xd12f('0x2')](_0xd12f('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xd12f('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xd12f('0x5')),'defaultValue':_0xd12f('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xd12f('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0xd12f('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 0f5a845..3b4d27a 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 _0x333b=['internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SELECT','rejectmessage','create','CmContact','findOne','SendFax','isNil','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','AttachmentId','join','root','server','files','attachments','Attachment','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','undefined','limit','count','offset','set','json','apply','reject','save','update','destroy','stack','name','send','index','map','FaxMessage','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','params','keys','length','include','find','body','describe','fax-interactions','accept','fax','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','read1stAt','format','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','fullname','email'];(function(_0x3e6729,_0x16d4af){var _0x535bcd=function(_0x5e6c5f){while(--_0x5e6c5f){_0x3e6729['push'](_0x3e6729['shift']());}};_0x535bcd(++_0x16d4af);}(_0x333b,0x146));var _0xb333=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x333b[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0xb333('0x0'));var rimraf=require(_0xb333('0x1'));var zipdir=require(_0xb333('0x2'));var jsonpatch=require(_0xb333('0x3'));var rp=require(_0xb333('0x4'));var moment=require(_0xb333('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb333('0x6'));var path=require(_0xb333('0x7'));var sox=require(_0xb333('0x8'));var csv=require(_0xb333('0x9'));var ejs=require(_0xb333('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb333('0xb'));var squel=require('squel');var crypto=require(_0xb333('0xc'));var jsforce=require(_0xb333('0xd'));var deskjs=require(_0xb333('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb333('0xf'));var Redis=require(_0xb333('0x10'));var authService=require(_0xb333('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb333('0x12'));var hardwareService=require(_0xb333('0x13'));var logger=require(_0xb333('0x14'))('api');var utils=require(_0xb333('0x15'));var config=require(_0xb333('0x16'));var licenseUtil=require(_0xb333('0x17'));var db=require(_0xb333('0x18'))['db'];config[_0xb333('0x19')]=_[_0xb333('0x1a')](config[_0xb333('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xb333('0x1b'))(new Redis(config[_0xb333('0x19')]));require('./faxMessage.socket')[_0xb333('0x1c')](socket);var jayson=require(_0xb333('0x1d'));var client=jayson[_0xb333('0x1e')][_0xb333('0x1f')]({'port':0x232c});var client9002=jayson[_0xb333('0x1e')][_0xb333('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x5e02be,_0x242d12,_0x1bb71b,_0x1865b7){return new BPromise(function(_0x1cd501,_0x17442a){var _0x1482c0=_0x1865b7||client;return _0x1482c0['request'](_0x5e02be,_0x1bb71b)[_0xb333('0x20')](function(_0x52d4e9){logger[_0xb333('0x21')](_0xb333('0x22'),_0x242d12,_0xb333('0x23'));logger[_0xb333('0x24')](_0xb333('0x25'),_0x242d12,_0xb333('0x23'),JSON[_0xb333('0x26')](_0x52d4e9));if(_0x52d4e9[_0xb333('0x27')]){if(_0x52d4e9['error'][_0xb333('0x28')]===0x1f4){logger[_0xb333('0x27')](_0xb333('0x22'),_0x242d12,_0x52d4e9[_0xb333('0x27')]['message']);return _0x17442a(_0x52d4e9[_0xb333('0x27')][_0xb333('0x29')]);}logger[_0xb333('0x27')]('FaxMessage,\x20%s,\x20%s',_0x242d12,_0x52d4e9['error'][_0xb333('0x29')]);return _0x1cd501(_0x52d4e9[_0xb333('0x27')][_0xb333('0x29')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x242d12,'request\x20sent');_0x1cd501(_0x52d4e9[_0xb333('0x2a')][_0xb333('0x29')]);}})[_0xb333('0x2b')](function(_0x2b8025){logger['error'](_0xb333('0x22'),_0x242d12,_0x2b8025);_0x17442a(_0x2b8025);});});}function respondWithStatusCode(_0x35d533,_0x137b93){_0x137b93=_0x137b93||0xcc;return function(_0x460d86){if(_0x460d86){return _0x35d533[_0xb333('0x2c')](_0x137b93);}return _0x35d533['status'](_0x137b93)[_0xb333('0x2d')]();};}function respondWithResult(_0x4a0c77,_0x2100d2){_0x2100d2=_0x2100d2||0xc8;return function(_0x3883d9){if(_0x3883d9){return _0x4a0c77[_0xb333('0x2e')](_0x2100d2)['json'](_0x3883d9);}};}function respondWithFilteredResult(_0x3cf140,_0x1eef91){return function(_0x5c8707){if(_0x5c8707){var _0x4063a0=typeof _0x1eef91['offset']===_0xb333('0x2f')&&typeof _0x1eef91[_0xb333('0x30')]===_0xb333('0x2f');var _0x3d0935=_0x5c8707[_0xb333('0x31')];var _0x101286=_0x4063a0?0x0:_0x1eef91['offset'];var _0x441f44=_0x4063a0?_0x5c8707[_0xb333('0x31')]:_0x1eef91[_0xb333('0x32')]+_0x1eef91[_0xb333('0x30')];var _0x1acf3f;if(_0x441f44>=_0x3d0935){_0x441f44=_0x3d0935;_0x1acf3f=0xc8;}else{_0x1acf3f=0xce;}_0x3cf140[_0xb333('0x2e')](_0x1acf3f);return _0x3cf140[_0xb333('0x33')]('Content-Range',_0x101286+'-'+_0x441f44+'/'+_0x3d0935)[_0xb333('0x34')](_0x5c8707);}return null;};}function patchUpdates(_0x31fe0d){return function(_0x5784b3){try{jsonpatch[_0xb333('0x35')](_0x5784b3,_0x31fe0d,!![]);}catch(_0x56719d){return BPromise[_0xb333('0x36')](_0x56719d);}return _0x5784b3[_0xb333('0x37')]();};}function saveUpdates(_0x3d2156,_0x30a2cd){return function(_0x3b3288){if(_0x3b3288){return _0x3b3288[_0xb333('0x38')](_0x3d2156)[_0xb333('0x20')](function(_0x212676){return _0x212676;});}return null;};}function removeEntity(_0x4c18ce,_0x296f9a){return function(_0x10efaa){if(_0x10efaa){return _0x10efaa[_0xb333('0x39')]()[_0xb333('0x20')](function(){_0x4c18ce[_0xb333('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ab5c3,_0x5ef24e){return function(_0x2f226a){if(!_0x2f226a){_0x1ab5c3['sendStatus'](0x194);}return _0x2f226a;};}function handleError(_0x32aef4,_0x387364){_0x387364=_0x387364||0x1f4;return function(_0x2fef58){logger[_0xb333('0x27')](_0x2fef58[_0xb333('0x3a')]);if(_0x2fef58[_0xb333('0x3b')]){delete _0x2fef58[_0xb333('0x3b')];}_0x32aef4[_0xb333('0x2e')](_0x387364)[_0xb333('0x3c')](_0x2fef58);};}exports[_0xb333('0x3d')]=function(_0x8a6d7,_0xfc5a3f){var _0x563349={},_0x5f41bf={},_0x4506ca={'count':0x0,'rows':[]};var _0x13b1b0=_[_0xb333('0x3e')](db[_0xb333('0x3f')]['rawAttributes'],function(_0x460d45){return{'name':_0x460d45[_0xb333('0x40')],'type':_0x460d45[_0xb333('0x41')]['key']};});_0x5f41bf[_0xb333('0x42')]=_[_0xb333('0x3e')](_0x13b1b0,_0xb333('0x3b'));_0x5f41bf[_0xb333('0x43')]=_['keys'](_0x8a6d7[_0xb333('0x43')]);_0x5f41bf[_0xb333('0x44')]=_[_0xb333('0x45')](_0x5f41bf[_0xb333('0x42')],_0x5f41bf[_0xb333('0x43')]);_0x563349[_0xb333('0x46')]=_[_0xb333('0x45')](_0x5f41bf['model'],qs[_0xb333('0x47')](_0x8a6d7[_0xb333('0x43')][_0xb333('0x47')]));_0x563349[_0xb333('0x46')]=_0x563349[_0xb333('0x46')]['length']?_0x563349[_0xb333('0x46')]:_0x5f41bf[_0xb333('0x42')];if(!_0x8a6d7[_0xb333('0x43')][_0xb333('0x48')](_0xb333('0x49'))){_0x563349[_0xb333('0x30')]=qs[_0xb333('0x30')](_0x8a6d7[_0xb333('0x43')][_0xb333('0x30')]);_0x563349['offset']=qs['offset'](_0x8a6d7[_0xb333('0x43')][_0xb333('0x32')]);}_0x563349['order']=qs['sort'](_0x8a6d7[_0xb333('0x43')]['sort']);_0x563349[_0xb333('0x4a')]=qs['filters'](_[_0xb333('0x4b')](_0x8a6d7['query'],_0x5f41bf['filters']),_0x13b1b0);if(_0x8a6d7[_0xb333('0x43')][_0xb333('0x4c')]){_0x563349[_0xb333('0x4a')]=_[_0xb333('0x4d')](_0x563349[_0xb333('0x4a')],{'$or':_[_0xb333('0x3e')](_0x13b1b0,function(_0x3acc4b){if(_0x3acc4b[_0xb333('0x41')]!==_0xb333('0x4e')){var _0x52b637={};_0x52b637[_0x3acc4b['name']]={'$like':'%'+_0x8a6d7[_0xb333('0x43')]['filter']+'%'};return _0x52b637;}})});}_0x563349=_[_0xb333('0x4d')]({},_0x563349,_0x8a6d7[_0xb333('0x4f')]);var _0x1f82fc={'where':_0x563349['where']};return db[_0xb333('0x3f')]['count'](_0x1f82fc)[_0xb333('0x20')](function(_0x4ee724){_0x4506ca[_0xb333('0x31')]=_0x4ee724;if(_0x8a6d7['query'][_0xb333('0x50')]){_0x563349['include']=[{'all':!![]}];}return db[_0xb333('0x3f')]['findAll'](_0x563349);})[_0xb333('0x20')](function(_0x48af9a){_0x4506ca[_0xb333('0x51')]=_0x48af9a;return _0x4506ca;})[_0xb333('0x20')](respondWithFilteredResult(_0xfc5a3f,_0x563349))['catch'](handleError(_0xfc5a3f,null));};exports[_0xb333('0x52')]=function(_0xbfe683,_0x3e5566){var _0x20da81={'raw':!![],'where':{'id':_0xbfe683[_0xb333('0x53')]['id']}},_0x39192f={};_0x39192f[_0xb333('0x42')]=_[_0xb333('0x54')](db[_0xb333('0x3f')]['rawAttributes']);_0x39192f['query']=_[_0xb333('0x54')](_0xbfe683['query']);_0x39192f['filters']=_[_0xb333('0x45')](_0x39192f[_0xb333('0x42')],_0x39192f[_0xb333('0x43')]);_0x20da81[_0xb333('0x46')]=_['intersection'](_0x39192f[_0xb333('0x42')],qs['fields'](_0xbfe683[_0xb333('0x43')]['fields']));_0x20da81[_0xb333('0x46')]=_0x20da81['attributes'][_0xb333('0x55')]?_0x20da81['attributes']:_0x39192f[_0xb333('0x42')];if(_0xbfe683[_0xb333('0x43')][_0xb333('0x50')]){_0x20da81[_0xb333('0x56')]=[{'all':!![]}];}_0x20da81=_[_0xb333('0x4d')]({},_0x20da81,_0xbfe683[_0xb333('0x4f')]);return db[_0xb333('0x3f')][_0xb333('0x57')](_0x20da81)['then'](handleEntityNotFound(_0x3e5566,null))[_0xb333('0x20')](respondWithResult(_0x3e5566,null))[_0xb333('0x2b')](handleError(_0x3e5566,null));};exports['update']=function(_0x3be62b,_0x54c355){if(_0x3be62b[_0xb333('0x58')]['id']){delete _0x3be62b['body']['id'];}return db['FaxMessage'][_0xb333('0x57')]({'where':{'id':_0x3be62b[_0xb333('0x53')]['id']}})['then'](handleEntityNotFound(_0x54c355,null))['then'](saveUpdates(_0x3be62b[_0xb333('0x58')],null))['then'](respondWithResult(_0x54c355,null))[_0xb333('0x2b')](handleError(_0x54c355,null));};exports['destroy']=function(_0x595352,_0x3b86c5){return db[_0xb333('0x3f')][_0xb333('0x57')]({'where':{'id':_0x595352[_0xb333('0x53')]['id']}})['then'](handleEntityNotFound(_0x3b86c5,null))[_0xb333('0x20')](removeEntity(_0x3b86c5,null))[_0xb333('0x2b')](handleError(_0x3b86c5,null));};exports[_0xb333('0x59')]=function(_0x31e09f,_0x34e425){return db[_0xb333('0x3f')]['describe']()[_0xb333('0x20')](respondWithResult(_0x34e425,null))[_0xb333('0x2b')](handleError(_0x34e425,null));};var interaction_log=require('../../config/logger')(_0xb333('0x5a'));exports[_0xb333('0x5b')]=function(_0x32d5d3,_0x598951,_0x1cae49){var _0x1ad4a7={'agent':{},'channel':_0xb333('0x5c')};if(_0x32d5d3[_0xb333('0x58')]['id']){delete _0x32d5d3[_0xb333('0x58')]['id'];}_0x32d5d3[_0xb333('0x58')]['read']=!![];_0x32d5d3[_0xb333('0x58')][_0xb333('0x5d')]=moment()['format'](_0xb333('0x5e'));_0x32d5d3['body']['UserId']=_0x32d5d3['body'][_0xb333('0x5f')]||_0x32d5d3[_0xb333('0x60')]['id'];_0x1ad4a7[_0xb333('0x61')]['id']=_0x32d5d3['body'][_0xb333('0x5f')];return db['FaxMessage'][_0xb333('0x57')]({'where':{'id':_0x32d5d3[_0xb333('0x53')]['id'],'UserId':null}})[_0xb333('0x20')](handleEntityNotFound(_0x598951,null))[_0xb333('0x20')](saveUpdates(_0x32d5d3['body'],null))[_0xb333('0x20')](function(_0x32b54d){if(_0x32b54d){_0x1ad4a7[_0xb333('0x29')]=_0x32b54d[_0xb333('0x62')]({'plain':!![]});return db[_0xb333('0x63')][_0xb333('0x57')]({'where':{'id':_0x32b54d['FaxInteractionId']}});}return null;})[_0xb333('0x20')](handleEntityNotFound(_0x598951,null))['then'](function(_0x30292d){if(_0x30292d){return _0x30292d['update']({'UserId':_0x32d5d3[_0xb333('0x58')][_0xb333('0x5f')],'read1stAt':_['isNil'](_0x30292d[_0xb333('0x64')])?moment()[_0xb333('0x65')](_0xb333('0x5e')):undefined});}return null;})['then'](function(_0xd55a98){if(_0xd55a98){_0x1ad4a7[_0xb333('0x66')]=_0xd55a98[_0xb333('0x62')]({'plain':!![]});interaction_log[_0xb333('0x21')](_0xb333('0x67'),_0x32d5d3[_0xb333('0x60')]['id'],_0x32d5d3[_0xb333('0x60')][_0xb333('0x3b')],_0x32d5d3[_0xb333('0x60')][_0xb333('0x68')],_0x1ad4a7[_0xb333('0x66')]['id'],_0x32d5d3[_0xb333('0x58')]?JSON[_0xb333('0x26')](_0x32d5d3[_0xb333('0x58')]):'null');return respondWithRpcPromise(_0xb333('0x69'),_0xb333('0x6a'),_0x1ad4a7);}return null;})['then'](function(_0x5e146d){var _0x2a3015=_0xb333('0x6b')+_0x5e146d[_0xb333('0x29')][_0xb333('0x6c')];return db[_0xb333('0x6d')]['query'](_0x2a3015,{'type':db[_0xb333('0x6e')][_0xb333('0x6f')]['SELECT'],'raw':!![]})[_0xb333('0x20')](function(_0x2002f9){return _0x2002f9;});})[_0xb333('0x20')](function(_0x428d83){if(_0x428d83){_0x1ad4a7[_0xb333('0x29')][_0xb333('0x70')]=_0x428d83[0x0];if(!_0x32d5d3['body']['UserId'])return;return db['User'][_0xb333('0x57')]({'where':{'id':_0x32d5d3[_0xb333('0x58')][_0xb333('0x5f')],'role':_0xb333('0x61')},'attributes':['id',_0xb333('0x3b'),_0xb333('0x71'),_0xb333('0x72'),_0xb333('0x73')],'raw':!![]});}return null;})[_0xb333('0x20')](function(_0x28d547){if(!_0x28d547)return null;_0x1ad4a7[_0xb333('0x29')][_0xb333('0x61')]=_0x28d547;return _0x1ad4a7;})[_0xb333('0x20')](function(_0x60c2f9){if(_0x60c2f9){if(_0x32d5d3[_0xb333('0x58')][_0xb333('0x74')]){_0x1ad4a7[_0xb333('0x29')][_0xb333('0x75')]=util['format'](_0xb333('0x76'),_0x32d5d3['user'][_0xb333('0x3b')]);_0x1ad4a7[_0xb333('0x29')][_0xb333('0x77')]=_0x1ad4a7[_0xb333('0x77')];_0x1ad4a7[_0xb333('0x29')][_0xb333('0x78')]=_0x1ad4a7[_0xb333('0x77')];_0x1ad4a7[_0xb333('0x29')][_0xb333('0x79')]=_0xb333('0x5b');return respondWithRpcPromise(_0xb333('0x7a'),'EventManager',{'event':_0xb333('0x7b'),'message':_0x1ad4a7['message']},client9002)['then'](function(){return _0x1ad4a7;});}return _0x1ad4a7;}return null;})[_0xb333('0x20')](respondWithResult(_0x598951,null))['catch'](handleError(_0x598951,null));};var interaction_log=require(_0xb333('0x14'))(_0xb333('0x5a'));exports[_0xb333('0x36')]=function(_0x4ee8d7,_0x44b51b,_0x4b59e9){var _0x20c603={'agent':{},'channel':_0xb333('0x5c')};if(_0x4ee8d7[_0xb333('0x58')]['id']){delete _0x4ee8d7[_0xb333('0x58')]['id'];}_0x4ee8d7['body']['UserId']=_0x4ee8d7[_0xb333('0x58')][_0xb333('0x5f')]||_0x4ee8d7[_0xb333('0x60')]['id'];_0x20c603['agent']['id']=_0x4ee8d7['body']['UserId'];return db[_0xb333('0x3f')]['find']({'where':{'id':_0x4ee8d7[_0xb333('0x53')]['id'],'UserId':null}})[_0xb333('0x20')](handleEntityNotFound(_0x44b51b,null))[_0xb333('0x20')](function(_0x3e6bfc){if(_0x3e6bfc){_0x20c603[_0xb333('0x29')]=_0x3e6bfc[_0xb333('0x62')]({'plain':!![]});return db[_0xb333('0x63')][_0xb333('0x57')]({'where':{'id':_0x3e6bfc[_0xb333('0x7c')]}});}return null;})[_0xb333('0x20')](handleEntityNotFound(_0x44b51b,null))[_0xb333('0x20')](function(_0x217a94){if(_0x217a94){_0x20c603[_0xb333('0x66')]=_0x217a94[_0xb333('0x62')]({'plain':!![]});interaction_log[_0xb333('0x21')](_0xb333('0x7d'),_0x4ee8d7['user']['id'],_0x4ee8d7[_0xb333('0x60')][_0xb333('0x3b')],_0x4ee8d7[_0xb333('0x60')][_0xb333('0x68')],_0x20c603[_0xb333('0x66')]['id'],_0x4ee8d7[_0xb333('0x58')]?JSON[_0xb333('0x26')](_0x4ee8d7[_0xb333('0x58')]):_0xb333('0x7e'));return respondWithRpcPromise(_0xb333('0x7f'),_0xb333('0x80'),_0x20c603);}return null;})[_0xb333('0x20')](function(_0x3c4c01){var _0x422aa6=_0xb333('0x6b')+_0x3c4c01[_0xb333('0x29')][_0xb333('0x6c')];return db['sequelize'][_0xb333('0x43')](_0x422aa6,{'type':db['Sequelize'][_0xb333('0x6f')][_0xb333('0x81')],'raw':!![]})['then'](function(_0x2676df){return _0x2676df;});})['then'](function(_0x4ac9db){if(_0x4ac9db){_0x20c603['message']['contact']=_0x4ac9db[0x0];if(!_0x4ee8d7[_0xb333('0x58')]['UserId'])return;return db['User']['find']({'where':{'id':_0x4ee8d7[_0xb333('0x58')][_0xb333('0x5f')],'role':'agent'},'attributes':['id',_0xb333('0x3b'),'fullname',_0xb333('0x72'),'internal'],'raw':!![]});}return null;})[_0xb333('0x20')](function(_0x266b6b){if(!_0x266b6b)return null;_0x20c603[_0xb333('0x29')][_0xb333('0x61')]=_0x266b6b;return _0x20c603;})[_0xb333('0x20')](function(_0x324643){if(_0x324643){_0x324643[_0xb333('0x29')][_0xb333('0x75')]=util['format'](_0xb333('0x76'),_0x4ee8d7[_0xb333('0x60')][_0xb333('0x3b')]);_0x324643[_0xb333('0x29')][_0xb333('0x77')]=_0x20c603[_0xb333('0x77')];_0x324643['message'][_0xb333('0x78')]=_0x20c603[_0xb333('0x77')];_0x324643[_0xb333('0x29')][_0xb333('0x79')]=_0xb333('0x36');respondWithRpcPromise('EventManager','EventManager',{'event':_0xb333('0x82'),'message':_0x324643[_0xb333('0x29')]},client9002);return _0x20c603;}return null;})['then'](respondWithResult(_0x44b51b,null))[_0xb333('0x2b')](handleError(_0x44b51b,null));};exports[_0xb333('0x83')]=function(_0x510ba0,_0x38d337){var _0x12f884;return db[_0xb333('0x3f')]['create'](_0x510ba0[_0xb333('0x58')],{})[_0xb333('0x20')](function(_0xb8283a){_0x12f884=_0xb8283a;return db[_0xb333('0x84')][_0xb333('0x85')]({'where':{'id':_0x12f884[_0xb333('0x6c')]}});})['then'](function(_0xf7ed4e){if(_['isNil'](_0xf7ed4e)){return;}else{_0x12f884[_0xb333('0x5c')]=_0xf7ed4e[_0xb333('0x5c')];return db['Attachment'][_0xb333('0x85')]({'where':{'id':_0x12f884['AttachmentId']}});}})[_0xb333('0x20')](function(_0x2a5c20){return respondWithRpcPromise(_0xb333('0x86'),_0xb333('0x86'),{'FaxAccountId':_[_0xb333('0x87')](_0x510ba0[_0xb333('0x58')])?undefined:_0x510ba0[_0xb333('0x58')][_0xb333('0x88')],'path':_[_0xb333('0x87')](_0x2a5c20)?undefined:util['format'](_0xb333('0x89'),_0x2a5c20[_0xb333('0x8a')]),'fax':_['isNil'](_0x12f884[_0xb333('0x5c')])?undefined:_0x12f884['fax'],'AttachmentId':_0x12f884[_0xb333('0x8b')]},client9002);})['then'](respondWithResult(_0x38d337,0xc9))[_0xb333('0x2b')](handleError(_0x38d337,null));};exports['download']=function(_0x310458,_0xe4f48){var _0x4d6987=path[_0xb333('0x8c')](config[_0xb333('0x8d')],_0xb333('0x8e'),_0xb333('0x8f'),_0xb333('0x90'));return db[_0xb333('0x3f')][_0xb333('0x57')]({'where':{'id':_0x310458[_0xb333('0x53')]['id']},'include':[{'model':db[_0xb333('0x91')],'as':_0xb333('0x91')}]})[_0xb333('0x20')](handleEntityNotFound(_0xe4f48,null))[_0xb333('0x20')](function(_0x5e6d9c){if(_0x5e6d9c){return _0xe4f48[_0xb333('0x92')](path[_0xb333('0x8c')](_0x4d6987,_0x5e6d9c[_0xb333('0x91')][_0xb333('0x8a')]));}})[_0xb333('0x2b')](handleError(_0xe4f48,null));}; \ No newline at end of file +var _0xff0c=['SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','attachments','Attachment','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./faxMessage.socket','register','client','http','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','destroy','stack','name','send','index','FaxMessage','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','update','body','describe','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','agent','fullname','manual','interface','SIP/%s','channel','motionChannel','event','acceptmessage','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','contact','User','internal','EventManager','rejectmessage','create','findOne','AttachmentId'];(function(_0x5d0dde,_0x194e9a){var _0x35b3f6=function(_0x43999f){while(--_0x43999f){_0x5d0dde['push'](_0x5d0dde['shift']());}};_0x35b3f6(++_0x194e9a);}(_0xff0c,0xa0));var _0xcff0=function(_0xc0638b,_0x2fccf4){_0xc0638b=_0xc0638b-0x0;var _0xd57dfa=_0xff0c[_0xc0638b];return _0xd57dfa;};'use strict';var emlformat=require(_0xcff0('0x0'));var rimraf=require(_0xcff0('0x1'));var zipdir=require(_0xcff0('0x2'));var jsonpatch=require(_0xcff0('0x3'));var rp=require(_0xcff0('0x4'));var moment=require(_0xcff0('0x5'));var BPromise=require(_0xcff0('0x6'));var Mustache=require(_0xcff0('0x7'));var util=require(_0xcff0('0x8'));var path=require(_0xcff0('0x9'));var sox=require(_0xcff0('0xa'));var csv=require('to-csv');var ejs=require(_0xcff0('0xb'));var fs=require('fs');var fs_extra=require(_0xcff0('0xc'));var _=require(_0xcff0('0xd'));var squel=require(_0xcff0('0xe'));var crypto=require(_0xcff0('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xcff0('0x10'));var toCsv=require(_0xcff0('0x11'));var querystring=require(_0xcff0('0x12'));var Papa=require('papaparse');var Redis=require(_0xcff0('0x13'));var authService=require(_0xcff0('0x14'));var qs=require(_0xcff0('0x15'));var as=require(_0xcff0('0x16'));var hardwareService=require(_0xcff0('0x17'));var logger=require(_0xcff0('0x18'))(_0xcff0('0x19'));var utils=require('../../config/utils');var config=require(_0xcff0('0x1a'));var licenseUtil=require(_0xcff0('0x1b'));var db=require(_0xcff0('0x1c'))['db'];config[_0xcff0('0x1d')]=_[_0xcff0('0x1e')](config[_0xcff0('0x1d')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcff0('0x1d')]));require(_0xcff0('0x1f'))[_0xcff0('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0xcff0('0x21')][_0xcff0('0x22')]({'port':0x232c});var client9002=jayson['client'][_0xcff0('0x22')]({'port':0x232a});function respondWithRpcPromise(_0xcd27c3,_0x5e80ea,_0x141f6f,_0x18083a){return new BPromise(function(_0x404acb,_0x467887){var _0x427ff8=_0x18083a||client;return _0x427ff8[_0xcff0('0x23')](_0xcd27c3,_0x141f6f)[_0xcff0('0x24')](function(_0x5b236d){logger['info'](_0xcff0('0x25'),_0x5e80ea,_0xcff0('0x26'));logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x5e80ea,'request\x20sent',JSON[_0xcff0('0x27')](_0x5b236d));if(_0x5b236d[_0xcff0('0x28')]){if(_0x5b236d['error'][_0xcff0('0x29')]===0x1f4){logger[_0xcff0('0x28')](_0xcff0('0x25'),_0x5e80ea,_0x5b236d[_0xcff0('0x28')][_0xcff0('0x2a')]);return _0x467887(_0x5b236d['error'][_0xcff0('0x2a')]);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x5e80ea,_0x5b236d[_0xcff0('0x28')]['message']);return _0x404acb(_0x5b236d['error'][_0xcff0('0x2a')]);}else{logger[_0xcff0('0x2b')]('FaxMessage,\x20%s,\x20%s',_0x5e80ea,_0xcff0('0x26'));_0x404acb(_0x5b236d[_0xcff0('0x2c')]['message']);}})['catch'](function(_0x422661){logger['error'](_0xcff0('0x25'),_0x5e80ea,_0x422661);_0x467887(_0x422661);});});}function respondWithStatusCode(_0x131f9e,_0x2e33f9){_0x2e33f9=_0x2e33f9||0xcc;return function(_0x5decb9){if(_0x5decb9){return _0x131f9e[_0xcff0('0x2d')](_0x2e33f9);}return _0x131f9e['status'](_0x2e33f9)[_0xcff0('0x2e')]();};}function respondWithResult(_0x2b3694,_0x28c366){_0x28c366=_0x28c366||0xc8;return function(_0x4e0472){if(_0x4e0472){return _0x2b3694[_0xcff0('0x2f')](_0x28c366)[_0xcff0('0x30')](_0x4e0472);}};}function respondWithFilteredResult(_0xbf9cb,_0x5e8f77){return function(_0x32af95){if(_0x32af95){var _0x152bf7=typeof _0x5e8f77[_0xcff0('0x31')]==='undefined'&&typeof _0x5e8f77[_0xcff0('0x32')]===_0xcff0('0x33');var _0x5cbc46=_0x32af95[_0xcff0('0x34')];var _0xd181b9=_0x152bf7?0x0:_0x5e8f77[_0xcff0('0x31')];var _0x1b6d67=_0x152bf7?_0x32af95[_0xcff0('0x34')]:_0x5e8f77[_0xcff0('0x31')]+_0x5e8f77[_0xcff0('0x32')];var _0x68515b;if(_0x1b6d67>=_0x5cbc46){_0x1b6d67=_0x5cbc46;_0x68515b=0xc8;}else{_0x68515b=0xce;}_0xbf9cb[_0xcff0('0x2f')](_0x68515b);return _0xbf9cb[_0xcff0('0x35')](_0xcff0('0x36'),_0xd181b9+'-'+_0x1b6d67+'/'+_0x5cbc46)[_0xcff0('0x30')](_0x32af95);}return null;};}function patchUpdates(_0x34e401){return function(_0x3c519b){try{jsonpatch['apply'](_0x3c519b,_0x34e401,!![]);}catch(_0x4dd2a2){return BPromise[_0xcff0('0x37')](_0x4dd2a2);}return _0x3c519b[_0xcff0('0x38')]();};}function saveUpdates(_0x1b1d26,_0x25641f){return function(_0x23866d){if(_0x23866d){return _0x23866d['update'](_0x1b1d26)[_0xcff0('0x24')](function(_0x4a0283){return _0x4a0283;});}return null;};}function removeEntity(_0x493845,_0x4a975a){return function(_0x18ee7c){if(_0x18ee7c){return _0x18ee7c[_0xcff0('0x39')]()['then'](function(){_0x493845[_0xcff0('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x509ef1,_0x14d2ae){return function(_0x9d7e4a){if(!_0x9d7e4a){_0x509ef1[_0xcff0('0x2d')](0x194);}return _0x9d7e4a;};}function handleError(_0x729151,_0x369857){_0x369857=_0x369857||0x1f4;return function(_0x22666c){logger[_0xcff0('0x28')](_0x22666c[_0xcff0('0x3a')]);if(_0x22666c[_0xcff0('0x3b')]){delete _0x22666c[_0xcff0('0x3b')];}_0x729151[_0xcff0('0x2f')](_0x369857)[_0xcff0('0x3c')](_0x22666c);};}exports[_0xcff0('0x3d')]=function(_0x1da295,_0x15f4ae){var _0x1a8c61={},_0x53c2f2={},_0x4142f4={'count':0x0,'rows':[]};var _0x63c138=_['map'](db[_0xcff0('0x3e')][_0xcff0('0x3f')],function(_0x3ceb75){return{'name':_0x3ceb75[_0xcff0('0x40')],'type':_0x3ceb75[_0xcff0('0x41')][_0xcff0('0x42')]};});_0x53c2f2['model']=_[_0xcff0('0x43')](_0x63c138,'name');_0x53c2f2[_0xcff0('0x44')]=_[_0xcff0('0x45')](_0x1da295[_0xcff0('0x44')]);_0x53c2f2[_0xcff0('0x46')]=_[_0xcff0('0x47')](_0x53c2f2[_0xcff0('0x48')],_0x53c2f2['query']);_0x1a8c61['attributes']=_['intersection'](_0x53c2f2[_0xcff0('0x48')],qs[_0xcff0('0x49')](_0x1da295[_0xcff0('0x44')][_0xcff0('0x49')]));_0x1a8c61[_0xcff0('0x4a')]=_0x1a8c61[_0xcff0('0x4a')][_0xcff0('0x4b')]?_0x1a8c61[_0xcff0('0x4a')]:_0x53c2f2['model'];if(!_0x1da295[_0xcff0('0x44')][_0xcff0('0x4c')](_0xcff0('0x4d'))){_0x1a8c61[_0xcff0('0x32')]=qs['limit'](_0x1da295[_0xcff0('0x44')]['limit']);_0x1a8c61['offset']=qs[_0xcff0('0x31')](_0x1da295['query'][_0xcff0('0x31')]);}_0x1a8c61['order']=qs[_0xcff0('0x4e')](_0x1da295['query'][_0xcff0('0x4e')]);_0x1a8c61[_0xcff0('0x4f')]=qs['filters'](_['pick'](_0x1da295[_0xcff0('0x44')],_0x53c2f2[_0xcff0('0x46')]),_0x63c138);if(_0x1da295[_0xcff0('0x44')][_0xcff0('0x50')]){_0x1a8c61[_0xcff0('0x4f')]=_[_0xcff0('0x51')](_0x1a8c61[_0xcff0('0x4f')],{'$or':_[_0xcff0('0x43')](_0x63c138,function(_0x3a170f){if(_0x3a170f[_0xcff0('0x41')]!==_0xcff0('0x52')){var _0x486551={};_0x486551[_0x3a170f[_0xcff0('0x3b')]]={'$like':'%'+_0x1da295[_0xcff0('0x44')]['filter']+'%'};return _0x486551;}})});}_0x1a8c61=_[_0xcff0('0x51')]({},_0x1a8c61,_0x1da295[_0xcff0('0x53')]);var _0x5a9fe0={'where':_0x1a8c61[_0xcff0('0x4f')]};return db[_0xcff0('0x3e')][_0xcff0('0x34')](_0x5a9fe0)['then'](function(_0x3e07d3){_0x4142f4['count']=_0x3e07d3;if(_0x1da295[_0xcff0('0x44')][_0xcff0('0x54')]){_0x1a8c61[_0xcff0('0x55')]=[{'all':!![]}];}return db[_0xcff0('0x3e')][_0xcff0('0x56')](_0x1a8c61);})[_0xcff0('0x24')](function(_0x5c7445){_0x4142f4['rows']=_0x5c7445;return _0x4142f4;})['then'](respondWithFilteredResult(_0x15f4ae,_0x1a8c61))[_0xcff0('0x57')](handleError(_0x15f4ae,null));};exports[_0xcff0('0x58')]=function(_0x27682c,_0x376781){var _0x5ef693={'raw':!![],'where':{'id':_0x27682c[_0xcff0('0x59')]['id']}},_0x96b2e7={};_0x96b2e7['model']=_[_0xcff0('0x45')](db['FaxMessage']['rawAttributes']);_0x96b2e7['query']=_['keys'](_0x27682c[_0xcff0('0x44')]);_0x96b2e7[_0xcff0('0x46')]=_['intersection'](_0x96b2e7['model'],_0x96b2e7['query']);_0x5ef693[_0xcff0('0x4a')]=_[_0xcff0('0x47')](_0x96b2e7[_0xcff0('0x48')],qs[_0xcff0('0x49')](_0x27682c[_0xcff0('0x44')][_0xcff0('0x49')]));_0x5ef693[_0xcff0('0x4a')]=_0x5ef693['attributes'][_0xcff0('0x4b')]?_0x5ef693[_0xcff0('0x4a')]:_0x96b2e7['model'];if(_0x27682c['query'][_0xcff0('0x54')]){_0x5ef693[_0xcff0('0x55')]=[{'all':!![]}];}_0x5ef693=_[_0xcff0('0x51')]({},_0x5ef693,_0x27682c[_0xcff0('0x53')]);return db[_0xcff0('0x3e')][_0xcff0('0x5a')](_0x5ef693)[_0xcff0('0x24')](handleEntityNotFound(_0x376781,null))[_0xcff0('0x24')](respondWithResult(_0x376781,null))[_0xcff0('0x57')](handleError(_0x376781,null));};exports[_0xcff0('0x5b')]=function(_0x3eb132,_0xb1c5f3){if(_0x3eb132[_0xcff0('0x5c')]['id']){delete _0x3eb132[_0xcff0('0x5c')]['id'];}return db[_0xcff0('0x3e')][_0xcff0('0x5a')]({'where':{'id':_0x3eb132['params']['id']}})[_0xcff0('0x24')](handleEntityNotFound(_0xb1c5f3,null))[_0xcff0('0x24')](saveUpdates(_0x3eb132[_0xcff0('0x5c')],null))[_0xcff0('0x24')](respondWithResult(_0xb1c5f3,null))[_0xcff0('0x57')](handleError(_0xb1c5f3,null));};exports['destroy']=function(_0x396b26,_0x46a501){return db[_0xcff0('0x3e')][_0xcff0('0x5a')]({'where':{'id':_0x396b26['params']['id']}})[_0xcff0('0x24')](handleEntityNotFound(_0x46a501,null))['then'](removeEntity(_0x46a501,null))[_0xcff0('0x57')](handleError(_0x46a501,null));};exports[_0xcff0('0x5d')]=function(_0xb5764,_0x493606){return db[_0xcff0('0x3e')][_0xcff0('0x5d')]()['then'](respondWithResult(_0x493606,null))[_0xcff0('0x57')](handleError(_0x493606,null));};var interaction_log=require('../../config/logger')(_0xcff0('0x5e'));exports[_0xcff0('0x5f')]=function(_0x68f38c,_0x1b9256,_0x351716){var _0x4f1055={'agent':{},'channel':_0xcff0('0x60')};if(_0x68f38c[_0xcff0('0x5c')]['id']){delete _0x68f38c[_0xcff0('0x5c')]['id'];}_0x68f38c[_0xcff0('0x5c')][_0xcff0('0x61')]=!![];_0x68f38c[_0xcff0('0x5c')][_0xcff0('0x62')]=moment()[_0xcff0('0x63')](_0xcff0('0x64'));_0x68f38c[_0xcff0('0x5c')]['UserId']=_0x68f38c[_0xcff0('0x5c')][_0xcff0('0x65')]||_0x68f38c[_0xcff0('0x66')]['id'];_0x4f1055['agent']['id']=_0x68f38c[_0xcff0('0x5c')][_0xcff0('0x65')];return db[_0xcff0('0x3e')][_0xcff0('0x5a')]({'where':{'id':_0x68f38c[_0xcff0('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1b9256,null))[_0xcff0('0x24')](saveUpdates(_0x68f38c[_0xcff0('0x5c')],null))[_0xcff0('0x24')](function(_0x4018af){if(_0x4018af){_0x4f1055['message']=_0x4018af[_0xcff0('0x67')]({'plain':!![]});return db['FaxInteraction'][_0xcff0('0x5a')]({'where':{'id':_0x4018af['FaxInteractionId']}});}return null;})[_0xcff0('0x24')](handleEntityNotFound(_0x1b9256,null))[_0xcff0('0x24')](function(_0xaf968c){if(_0xaf968c){return _0xaf968c[_0xcff0('0x5b')]({'UserId':_0x68f38c[_0xcff0('0x5c')]['UserId'],'read1stAt':_[_0xcff0('0x68')](_0xaf968c[_0xcff0('0x69')])?moment()[_0xcff0('0x63')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xcff0('0x24')](function(_0x5b08f1){if(_0x5b08f1){_0x4f1055[_0xcff0('0x6a')]=_0x5b08f1[_0xcff0('0x67')]({'plain':!![]});interaction_log[_0xcff0('0x2b')](_0xcff0('0x6b'),_0x68f38c[_0xcff0('0x66')]['id'],_0x68f38c[_0xcff0('0x66')][_0xcff0('0x3b')],_0x68f38c[_0xcff0('0x66')][_0xcff0('0x6c')],_0x4f1055[_0xcff0('0x6a')]['id'],_0x68f38c[_0xcff0('0x5c')]?JSON[_0xcff0('0x27')](_0x68f38c[_0xcff0('0x5c')]):_0xcff0('0x6d'));return respondWithRpcPromise(_0xcff0('0x6e'),'acceptMessage',_0x4f1055);}return null;})[_0xcff0('0x24')](function(_0x316c42){var _0x40004b=_0xcff0('0x6f')+_0x316c42[_0xcff0('0x2a')][_0xcff0('0x70')];return db[_0xcff0('0x71')]['query'](_0x40004b,{'type':db[_0xcff0('0x72')][_0xcff0('0x73')][_0xcff0('0x74')],'raw':!![]})[_0xcff0('0x24')](function(_0x1d6f16){return _0x1d6f16;});})[_0xcff0('0x24')](function(_0x4c0121){if(_0x4c0121){_0x4f1055[_0xcff0('0x2a')]['contact']=_0x4c0121[0x0];if(!_0x68f38c[_0xcff0('0x5c')]['UserId'])return;return db['User'][_0xcff0('0x5a')]({'where':{'id':_0x68f38c[_0xcff0('0x5c')]['UserId'],'role':_0xcff0('0x75')},'attributes':['id',_0xcff0('0x3b'),_0xcff0('0x76'),'email','internal'],'raw':!![]});}return null;})[_0xcff0('0x24')](function(_0x55b28c){if(!_0x55b28c)return null;_0x4f1055[_0xcff0('0x2a')][_0xcff0('0x75')]=_0x55b28c;return _0x4f1055;})[_0xcff0('0x24')](function(_0x17eaa9){if(_0x17eaa9){if(_0x68f38c[_0xcff0('0x5c')][_0xcff0('0x77')]){_0x4f1055['message'][_0xcff0('0x78')]=util[_0xcff0('0x63')](_0xcff0('0x79'),_0x68f38c[_0xcff0('0x66')][_0xcff0('0x3b')]);_0x4f1055[_0xcff0('0x2a')][_0xcff0('0x7a')]=_0x4f1055[_0xcff0('0x7a')];_0x4f1055[_0xcff0('0x2a')][_0xcff0('0x7b')]=_0x4f1055[_0xcff0('0x7a')];_0x4f1055['message'][_0xcff0('0x7c')]=_0xcff0('0x5f');return respondWithRpcPromise('EventManager','EventManager',{'event':_0xcff0('0x7d'),'message':_0x4f1055[_0xcff0('0x2a')]},client9002)['then'](function(){return _0x4f1055;});}return _0x4f1055;}return null;})[_0xcff0('0x24')](respondWithResult(_0x1b9256,null))[_0xcff0('0x57')](handleError(_0x1b9256,null));};var interaction_log=require(_0xcff0('0x18'))(_0xcff0('0x5e'));exports[_0xcff0('0x37')]=function(_0x8a3b70,_0x3d504b,_0x255631){var _0x575da8={'agent':{},'channel':_0xcff0('0x60')};if(_0x8a3b70['body']['id']){delete _0x8a3b70[_0xcff0('0x5c')]['id'];}_0x8a3b70['body'][_0xcff0('0x65')]=_0x8a3b70[_0xcff0('0x5c')][_0xcff0('0x65')]||_0x8a3b70[_0xcff0('0x66')]['id'];_0x575da8['agent']['id']=_0x8a3b70[_0xcff0('0x5c')][_0xcff0('0x65')];return db['FaxMessage'][_0xcff0('0x5a')]({'where':{'id':_0x8a3b70[_0xcff0('0x59')]['id'],'UserId':null}})[_0xcff0('0x24')](handleEntityNotFound(_0x3d504b,null))['then'](function(_0xbc6d30){if(_0xbc6d30){_0x575da8[_0xcff0('0x2a')]=_0xbc6d30[_0xcff0('0x67')]({'plain':!![]});return db[_0xcff0('0x7e')][_0xcff0('0x5a')]({'where':{'id':_0xbc6d30['FaxInteractionId']}});}return null;})[_0xcff0('0x24')](handleEntityNotFound(_0x3d504b,null))[_0xcff0('0x24')](function(_0x58cb07){if(_0x58cb07){_0x575da8[_0xcff0('0x6a')]=_0x58cb07[_0xcff0('0x67')]({'plain':!![]});interaction_log[_0xcff0('0x2b')](_0xcff0('0x7f'),_0x8a3b70[_0xcff0('0x66')]['id'],_0x8a3b70[_0xcff0('0x66')][_0xcff0('0x3b')],_0x8a3b70[_0xcff0('0x66')]['role'],_0x575da8[_0xcff0('0x6a')]['id'],_0x8a3b70[_0xcff0('0x5c')]?JSON[_0xcff0('0x27')](_0x8a3b70[_0xcff0('0x5c')]):_0xcff0('0x6d'));return respondWithRpcPromise(_0xcff0('0x80'),_0xcff0('0x81'),_0x575da8);}return null;})[_0xcff0('0x24')](function(_0x336d5e){var _0x3509b6=_0xcff0('0x6f')+_0x336d5e[_0xcff0('0x2a')][_0xcff0('0x70')];return db[_0xcff0('0x71')][_0xcff0('0x44')](_0x3509b6,{'type':db[_0xcff0('0x72')][_0xcff0('0x73')][_0xcff0('0x74')],'raw':!![]})['then'](function(_0x4a8089){return _0x4a8089;});})[_0xcff0('0x24')](function(_0x3f1d51){if(_0x3f1d51){_0x575da8['message'][_0xcff0('0x82')]=_0x3f1d51[0x0];if(!_0x8a3b70['body'][_0xcff0('0x65')])return;return db[_0xcff0('0x83')][_0xcff0('0x5a')]({'where':{'id':_0x8a3b70[_0xcff0('0x5c')][_0xcff0('0x65')],'role':_0xcff0('0x75')},'attributes':['id',_0xcff0('0x3b'),_0xcff0('0x76'),'email',_0xcff0('0x84')],'raw':!![]});}return null;})[_0xcff0('0x24')](function(_0x14aed0){if(!_0x14aed0)return null;_0x575da8[_0xcff0('0x2a')][_0xcff0('0x75')]=_0x14aed0;return _0x575da8;})[_0xcff0('0x24')](function(_0x552634){if(_0x552634){_0x552634[_0xcff0('0x2a')][_0xcff0('0x78')]=util['format'](_0xcff0('0x79'),_0x8a3b70[_0xcff0('0x66')][_0xcff0('0x3b')]);_0x552634[_0xcff0('0x2a')][_0xcff0('0x7a')]=_0x575da8['channel'];_0x552634[_0xcff0('0x2a')][_0xcff0('0x7b')]=_0x575da8[_0xcff0('0x7a')];_0x552634[_0xcff0('0x2a')][_0xcff0('0x7c')]=_0xcff0('0x37');respondWithRpcPromise(_0xcff0('0x85'),_0xcff0('0x85'),{'event':_0xcff0('0x86'),'message':_0x552634[_0xcff0('0x2a')]},client9002);return _0x575da8;}return null;})[_0xcff0('0x24')](respondWithResult(_0x3d504b,null))[_0xcff0('0x57')](handleError(_0x3d504b,null));};exports[_0xcff0('0x87')]=function(_0x5a9844,_0x2f0773){var _0x2d804c;return db[_0xcff0('0x3e')][_0xcff0('0x87')](_0x5a9844[_0xcff0('0x5c')],{})[_0xcff0('0x24')](function(_0x8cf4f0){_0x2d804c=_0x8cf4f0;return db['CmContact'][_0xcff0('0x88')]({'where':{'id':_0x2d804c['ContactId']}});})[_0xcff0('0x24')](function(_0x17b6be){if(_[_0xcff0('0x68')](_0x17b6be)){return;}else{_0x2d804c[_0xcff0('0x60')]=_0x17b6be['fax'];return db['Attachment'][_0xcff0('0x88')]({'where':{'id':_0x2d804c[_0xcff0('0x89')]}});}})['then'](function(_0x253445){return respondWithRpcPromise(_0xcff0('0x8a'),_0xcff0('0x8a'),{'FaxAccountId':_[_0xcff0('0x68')](_0x5a9844[_0xcff0('0x5c')])?undefined:_0x5a9844[_0xcff0('0x5c')][_0xcff0('0x8b')],'path':_[_0xcff0('0x68')](_0x253445)?undefined:util[_0xcff0('0x63')](_0xcff0('0x8c'),_0x253445[_0xcff0('0x8d')]),'fax':_[_0xcff0('0x68')](_0x2d804c[_0xcff0('0x60')])?undefined:_0x2d804c[_0xcff0('0x60')],'AttachmentId':_0x2d804c[_0xcff0('0x89')]},client9002);})[_0xcff0('0x24')](respondWithResult(_0x2f0773,0xc9))[_0xcff0('0x57')](handleError(_0x2f0773,null));};exports[_0xcff0('0x8e')]=function(_0x143388,_0x44800a){var _0x3dca85=path[_0xcff0('0x8f')](config[_0xcff0('0x90')],_0xcff0('0x91'),_0xcff0('0x92'),_0xcff0('0x93'));return db[_0xcff0('0x3e')][_0xcff0('0x5a')]({'where':{'id':_0x143388[_0xcff0('0x59')]['id']},'include':[{'model':db[_0xcff0('0x94')],'as':_0xcff0('0x94')}]})[_0xcff0('0x24')](handleEntityNotFound(_0x44800a,null))[_0xcff0('0x24')](function(_0x3b0a29){if(_0x3b0a29){return _0x44800a[_0xcff0('0x8e')](path[_0xcff0('0x8f')](_0x3dca85,_0x3b0a29['Attachment'][_0xcff0('0x8d')]));}})[_0xcff0('0x57')](handleError(_0x44800a,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 7252f62..6da73ee 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 _0xa46e=['hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0xfae74c,_0x52cd4e){var _0x59be91=function(_0x5ee8e5){while(--_0x5ee8e5){_0xfae74c['push'](_0xfae74c['shift']());}};_0x59be91(++_0x52cd4e);}(_0xa46e,0x8a));var _0xea46=function(_0xc8db6b,_0x320abd){_0xc8db6b=_0xc8db6b-0x0;var _0x12cb81=_0xa46e[_0xc8db6b];return _0x12cb81;};'use strict';var EventEmitter=require(_0xea46('0x0'));var FaxMessage=require(_0xea46('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xea46('0x2')](0x0);var events={'afterCreate':_0xea46('0x3'),'afterUpdate':_0xea46('0x4'),'afterDestroy':'remove'};function emitEvent(_0x19f135){return function(_0x4b6e4a,_0x3a2209,_0x47d633){FaxMessageEvents[_0xea46('0x5')](_0x19f135+':'+_0x4b6e4a['id'],_0x4b6e4a);FaxMessageEvents['emit'](_0x19f135,_0x4b6e4a);_0x47d633(null);};}for(var e in events){if(events[_0xea46('0x6')](e)){var event=events[e];FaxMessage[_0xea46('0x7')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0xaee6=['exports','events','../../mysqldb','FaxMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x4b3edd,_0x415325){var _0x4baf90=function(_0x19e868){while(--_0x19e868){_0x4b3edd['push'](_0x4b3edd['shift']());}};_0x4baf90(++_0x415325);}(_0xaee6,0x187));var _0x6aee=function(_0xa63b6,_0x53fe44){_0xa63b6=_0xa63b6-0x0;var _0x196c5d=_0xaee6[_0xa63b6];return _0x196c5d;};'use strict';var EventEmitter=require(_0x6aee('0x0'));var FaxMessage=require(_0x6aee('0x1'))['db'][_0x6aee('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x6aee('0x3')](0x0);var events={'afterCreate':_0x6aee('0x4'),'afterUpdate':_0x6aee('0x5'),'afterDestroy':'remove'};function emitEvent(_0x46980d){return function(_0x3f11af,_0x1e23ba,_0x5e83b4){FaxMessageEvents[_0x6aee('0x6')](_0x46980d+':'+_0x3f11af['id'],_0x3f11af);FaxMessageEvents[_0x6aee('0x6')](_0x46980d,_0x3f11af);_0x5e83b4(null);};}for(var e in events){if(events[_0x6aee('0x7')](e)){var event=events[e];FaxMessage[_0x6aee('0x8')](e,emitEvent(event));}}module[_0x6aee('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 dea7032..570861e 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 _0x2f80=['direction','out','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','rimraf','./faxMessage.attributes','FaxMessage','fax_messages','fti_fax_messages','FULLTEXT','models','get','toLowerCase'];(function(_0xa1c1d5,_0x11936c){var _0x2672ee=function(_0x18f910){while(--_0x18f910){_0xa1c1d5['push'](_0xa1c1d5['shift']());}};_0x2672ee(++_0x11936c);}(_0x2f80,0x11b));var _0x02f8=function(_0x4a1aa8,_0x4fb41f){_0x4a1aa8=_0x4a1aa8-0x0;var _0x1d0481=_0x2f80[_0x4a1aa8];return _0x1d0481;};'use strict';var _=require('lodash');var util=require(_0x02f8('0x0'));var logger=require(_0x02f8('0x1'))(_0x02f8('0x2'));var moment=require(_0x02f8('0x3'));var BPromise=require('bluebird');var rp=require(_0x02f8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x02f8('0x5'));var config=require('../../config/environment');var attributes=require(_0x02f8('0x6'));module['exports']=function(_0x3fbc1e,_0x39488f){return _0x3fbc1e['define'](_0x02f8('0x7'),attributes,{'tableName':_0x02f8('0x8'),'paranoid':![],'indexes':[{'name':_0x02f8('0x9'),'fields':['body'],'type':_0x02f8('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x345e0b,_0x400f90,_0x4c1da1){var _0x43e129=_0x3fbc1e[_0x02f8('0xb')];var _0x551c79=_0x345e0b[_0x02f8('0xc')]({'plain':!![]});if(_0x551c79['direction'][_0x02f8('0xd')]()==='in'||_0x551c79[_0x02f8('0xe')]['toLowerCase']()===_0x02f8('0xf')&&!_0x551c79[_0x02f8('0x10')]&&!_[_0x02f8('0x11')](_0x551c79[_0x02f8('0x12')])){_0x43e129[_0x02f8('0x13')][_0x02f8('0x14')]({'where':{'id':_0x551c79[_0x02f8('0x15')]}})[_0x02f8('0x16')](function(_0x48ffc6){if(_0x48ffc6){_0x48ffc6[_0x02f8('0x17')]({'lastMsgAt':_0x551c79[_0x02f8('0x18')],'lastMsgDirection':_0x551c79['direction'][_0x02f8('0xd')]()});}})['catch'](function(_0x119ed7){console['error'](_0x119ed7);});}_0x4c1da1();}},'charset':_0x02f8('0x19'),'collate':_0x02f8('0x1a')});}; \ No newline at end of file +var _0xe470=['define','fax_messages','fti_fax_messages','body','models','get','toLowerCase','direction','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xe470,0x151));var _0x0e47=function(_0x8d5527,_0x585e60){_0x8d5527=_0x8d5527-0x0;var _0x32a98c=_0xe470[_0x8d5527];return _0x32a98c;};'use strict';var _=require(_0x0e47('0x0'));var util=require(_0x0e47('0x1'));var logger=require(_0x0e47('0x2'))(_0x0e47('0x3'));var moment=require(_0x0e47('0x4'));var BPromise=require('bluebird');var rp=require(_0x0e47('0x5'));var fs=require('fs');var path=require(_0x0e47('0x6'));var rimraf=require(_0x0e47('0x7'));var config=require(_0x0e47('0x8'));var attributes=require(_0x0e47('0x9'));module[_0x0e47('0xa')]=function(_0x2c0cc1,_0x28dbba){return _0x2c0cc1[_0x0e47('0xb')]('FaxMessage',attributes,{'tableName':_0x0e47('0xc'),'paranoid':![],'indexes':[{'name':_0x0e47('0xd'),'fields':[_0x0e47('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x454ee6,_0x2accfb,_0x59143){var _0x57dc21=_0x2c0cc1[_0x0e47('0xf')];var _0x15bc71=_0x454ee6[_0x0e47('0x10')]({'plain':!![]});if(_0x15bc71['direction'][_0x0e47('0x11')]()==='in'||_0x15bc71[_0x0e47('0x12')][_0x0e47('0x11')]()==='out'&&!_0x15bc71[_0x0e47('0x13')]&&!_[_0x0e47('0x14')](_0x15bc71[_0x0e47('0x15')])){_0x57dc21[_0x0e47('0x16')][_0x0e47('0x17')]({'where':{'id':_0x15bc71[_0x0e47('0x18')]}})['then'](function(_0x13ae08){if(_0x13ae08){_0x13ae08['update']({'lastMsgAt':_0x15bc71['createdAt'],'lastMsgDirection':_0x15bc71['direction'][_0x0e47('0x11')]()});}})[_0x0e47('0x19')](function(_0x526e8a){console[_0x0e47('0x1a')](_0x526e8a);});}_0x59143();}},'charset':_0x0e47('0x1b'),'collate':_0x0e47('0x1c')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 2bad845..ab00ee6 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 _0xd2ea=['../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','register','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','result','FaxMessage','create','body','options','raw','CreateFaxMessage','stringify','catch','UpdateFaxMessage','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x348450,_0x479b88){var _0x3552a0=function(_0x229bb2){while(--_0x229bb2){_0x348450['push'](_0x348450['shift']());}};_0x3552a0(++_0x479b88);}(_0xd2ea,0x15f));var _0xad2e=function(_0x2b51bf,_0x29d442){_0x2b51bf=_0x2b51bf-0x0;var _0x501c2c=_0xd2ea[_0x2b51bf];return _0x501c2c;};'use strict';var _=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var moment=require(_0xad2e('0x2'));var BPromise=require(_0xad2e('0x3'));var rs=require(_0xad2e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad2e('0x5'))['db'];var utils=require(_0xad2e('0x6'));var logger=require(_0xad2e('0x7'))(_0xad2e('0x8'));var config=require(_0xad2e('0x9'));var jayson=require(_0xad2e('0xa'));var client=jayson[_0xad2e('0xb')]['http']({'port':0x232a});config[_0xad2e('0xc')]=_[_0xad2e('0xd')](config[_0xad2e('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xad2e('0xe'))(new Redis(config[_0xad2e('0xc')]));require('./faxMessage.socket')[_0xad2e('0xf')](socket);function respondWithRpcPromise(_0x51f575,_0x430443,_0x415a41){return new BPromise(function(_0x9879f2,_0x24c5da){return client['request'](_0x51f575,_0x415a41)[_0xad2e('0x10')](function(_0x5707a5){logger[_0xad2e('0x11')](_0xad2e('0x12'),_0x430443,_0xad2e('0x13'));logger[_0xad2e('0x14')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x430443,_0xad2e('0x13'),JSON['stringify'](_0x5707a5));if(_0x5707a5[_0xad2e('0x15')]){if(_0x5707a5['error']['code']===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x430443,_0x5707a5[_0xad2e('0x15')][_0xad2e('0x16')]);return _0x24c5da(_0x5707a5[_0xad2e('0x15')][_0xad2e('0x16')]);}logger[_0xad2e('0x15')](_0xad2e('0x12'),_0x430443,_0x5707a5[_0xad2e('0x15')][_0xad2e('0x16')]);return _0x9879f2(_0x5707a5[_0xad2e('0x15')][_0xad2e('0x16')]);}else{logger[_0xad2e('0x11')](_0xad2e('0x12'),_0x430443,_0xad2e('0x13'));_0x9879f2(_0x5707a5[_0xad2e('0x17')][_0xad2e('0x16')]);}})['catch'](function(_0x245617){logger[_0xad2e('0x15')]('FaxMessage,\x20%s,\x20%s',_0x430443,_0x245617);_0x24c5da(_0x245617);});});}exports['CreateFaxMessage']=function(_0x48d8b5){var _0x4a4b2d=this;return new Promise(function(_0x18c38d,_0x293adc){return db[_0xad2e('0x18')][_0xad2e('0x19')](_0x48d8b5[_0xad2e('0x1a')],{'raw':_0x48d8b5[_0xad2e('0x1b')]?_0x48d8b5[_0xad2e('0x1b')][_0xad2e('0x1c')]===undefined?!![]:![]:!![]})[_0xad2e('0x10')](function(_0x154d54){logger[_0xad2e('0x11')](_0xad2e('0x1d'),_0x48d8b5);logger[_0xad2e('0x14')](_0xad2e('0x1d'),_0x48d8b5,JSON[_0xad2e('0x1e')](_0x154d54));_0x18c38d(_0x154d54);})[_0xad2e('0x1f')](function(_0x59630b){logger[_0xad2e('0x15')](_0xad2e('0x1d'),_0x59630b[_0xad2e('0x16')],_0x48d8b5);_0x293adc(_0x4a4b2d[_0xad2e('0x15')](0x1f4,_0x59630b[_0xad2e('0x16')]));});});};exports[_0xad2e('0x20')]=function(_0x1161d5){var _0x175055=this;return new Promise(function(_0xfd90a4,_0x50d446){return db[_0xad2e('0x18')]['update'](_0x1161d5[_0xad2e('0x1a')],{'raw':_0x1161d5[_0xad2e('0x1b')]?_0x1161d5[_0xad2e('0x1b')][_0xad2e('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1161d5[_0xad2e('0x1b')]?_0x1161d5[_0xad2e('0x1b')][_0xad2e('0x21')]||null:null,'attributes':_0x1161d5[_0xad2e('0x1b')]?_0x1161d5[_0xad2e('0x1b')][_0xad2e('0x22')]||null:null,'limit':_0x1161d5['options']?_0x1161d5[_0xad2e('0x1b')][_0xad2e('0x23')]||null:null})[_0xad2e('0x10')](function(_0x4379f4){logger[_0xad2e('0x11')](_0xad2e('0x20'),_0x1161d5);logger[_0xad2e('0x14')](_0xad2e('0x20'),_0x1161d5,JSON[_0xad2e('0x1e')](_0x4379f4));_0xfd90a4(_0x4379f4);})[_0xad2e('0x1f')](function(_0xcc4c66){logger['error'](_0xad2e('0x20'),_0xcc4c66['message'],_0x1161d5);_0x50d446(_0x175055[_0xad2e('0x15')](0x1f4,_0xcc4c66[_0xad2e('0x16')]));});});}; \ No newline at end of file +var _0x34e8=['request\x20sent','result','catch','CreateFaxMessage','FaxMessage','create','options','raw','update','body','attributes','limit','UpdateFaxMessage','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x110945,_0x2ebb53){var _0x17a79d=function(_0x2ef008){while(--_0x2ef008){_0x110945['push'](_0x110945['shift']());}};_0x17a79d(++_0x2ebb53);}(_0x34e8,0x12c));var _0x834e=function(_0x46b019,_0x5e7cb0){_0x46b019=_0x46b019-0x0;var _0x274f55=_0x34e8[_0x46b019];return _0x274f55;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});config['redis']=_[_0x834e('0xc')](config[_0x834e('0xd')],{'host':_0x834e('0xe'),'port':0x18eb});var socket=require(_0x834e('0xf'))(new Redis(config[_0x834e('0xd')]));require(_0x834e('0x10'))[_0x834e('0x11')](socket);function respondWithRpcPromise(_0x1af45a,_0x3bdda9,_0x186b3b){return new BPromise(function(_0x1e41fe,_0x36e124){return client[_0x834e('0x12')](_0x1af45a,_0x186b3b)[_0x834e('0x13')](function(_0x293514){logger[_0x834e('0x14')](_0x834e('0x15'),_0x3bdda9,'request\x20sent');logger[_0x834e('0x16')](_0x834e('0x17'),_0x3bdda9,'request\x20sent',JSON[_0x834e('0x18')](_0x293514));if(_0x293514[_0x834e('0x19')]){if(_0x293514[_0x834e('0x19')][_0x834e('0x1a')]===0x1f4){logger['error'](_0x834e('0x15'),_0x3bdda9,_0x293514[_0x834e('0x19')]['message']);return _0x36e124(_0x293514[_0x834e('0x19')]['message']);}logger[_0x834e('0x19')](_0x834e('0x15'),_0x3bdda9,_0x293514['error'][_0x834e('0x1b')]);return _0x1e41fe(_0x293514[_0x834e('0x19')][_0x834e('0x1b')]);}else{logger['info'](_0x834e('0x15'),_0x3bdda9,_0x834e('0x1c'));_0x1e41fe(_0x293514[_0x834e('0x1d')][_0x834e('0x1b')]);}})[_0x834e('0x1e')](function(_0x254677){logger[_0x834e('0x19')]('FaxMessage,\x20%s,\x20%s',_0x3bdda9,_0x254677);_0x36e124(_0x254677);});});}exports[_0x834e('0x1f')]=function(_0x1fd2c6){var _0x113ff4=this;return new Promise(function(_0x325a99,_0x4ab05d){return db[_0x834e('0x20')][_0x834e('0x21')](_0x1fd2c6['body'],{'raw':_0x1fd2c6[_0x834e('0x22')]?_0x1fd2c6[_0x834e('0x22')][_0x834e('0x23')]===undefined?!![]:![]:!![]})['then'](function(_0x4e3f48){logger[_0x834e('0x14')](_0x834e('0x1f'),_0x1fd2c6);logger['debug'](_0x834e('0x1f'),_0x1fd2c6,JSON[_0x834e('0x18')](_0x4e3f48));_0x325a99(_0x4e3f48);})['catch'](function(_0x3bc4f7){logger[_0x834e('0x19')](_0x834e('0x1f'),_0x3bc4f7['message'],_0x1fd2c6);_0x4ab05d(_0x113ff4[_0x834e('0x19')](0x1f4,_0x3bc4f7[_0x834e('0x1b')]));});});};exports['UpdateFaxMessage']=function(_0x5bef62){var _0x1e713a=this;return new Promise(function(_0x508a1d,_0x2826ec){return db[_0x834e('0x20')][_0x834e('0x24')](_0x5bef62[_0x834e('0x25')],{'raw':_0x5bef62[_0x834e('0x22')]?_0x5bef62[_0x834e('0x22')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5bef62['options']?_0x5bef62['options']['where']||null:null,'attributes':_0x5bef62[_0x834e('0x22')]?_0x5bef62[_0x834e('0x22')][_0x834e('0x26')]||null:null,'limit':_0x5bef62['options']?_0x5bef62[_0x834e('0x22')][_0x834e('0x27')]||null:null})[_0x834e('0x13')](function(_0x1e026a){logger[_0x834e('0x14')](_0x834e('0x28'),_0x5bef62);logger[_0x834e('0x16')](_0x834e('0x28'),_0x5bef62,JSON[_0x834e('0x18')](_0x1e026a));_0x508a1d(_0x1e026a);})['catch'](function(_0xef9ec2){logger['error'](_0x834e('0x28'),_0xef9ec2[_0x834e('0x1b')],_0x5bef62);_0x2826ec(_0x1e713a[_0x834e('0x19')](0x1f4,_0xef9ec2[_0x834e('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index f58d85b..04488cd 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 _0x6d83=['register','length','faxMessage:','./faxMessage.events','save','update','emit','removeListener'];(function(_0xb5d151,_0x4535bb){var _0x22fa8d=function(_0x12abad){while(--_0x12abad){_0xb5d151['push'](_0xb5d151['shift']());}};_0x22fa8d(++_0x4535bb);}(_0x6d83,0x16b));var _0x36d8=function(_0x58a4d4,_0x37208b){_0x58a4d4=_0x58a4d4-0x0;var _0x340cb5=_0x6d83[_0x58a4d4];return _0x340cb5;};'use strict';var FaxMessageEvents=require(_0x36d8('0x0'));var events=[_0x36d8('0x1'),'remove',_0x36d8('0x2')];function createListener(_0x37f637,_0x4a2049){return function(_0x450c2e){_0x4a2049[_0x36d8('0x3')](_0x37f637,_0x450c2e);};}function removeListener(_0x4ad435,_0x254843){return function(){FaxMessageEvents[_0x36d8('0x4')](_0x4ad435,_0x254843);};}exports[_0x36d8('0x5')]=function(_0x4c38a4){for(var _0x525440=0x0,_0x1156d2=events[_0x36d8('0x6')];_0x525440<_0x1156d2;_0x525440++){var _0x576e1e=events[_0x525440];var _0x2e443c=createListener(_0x36d8('0x7')+_0x576e1e,_0x4c38a4);FaxMessageEvents['on'](_0x576e1e,_0x2e443c);}}; \ No newline at end of file +var _0xed77=['faxMessage:','remove','emit','register','length'];(function(_0x15dab9,_0x2bac5e){var _0x356d97=function(_0x1f933d){while(--_0x1f933d){_0x15dab9['push'](_0x15dab9['shift']());}};_0x356d97(++_0x2bac5e);}(_0xed77,0x13c));var _0x7ed7=function(_0x2a6ba1,_0x6d173f){_0x2a6ba1=_0x2a6ba1-0x0;var _0x1b3e46=_0xed77[_0x2a6ba1];return _0x1b3e46;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=['save',_0x7ed7('0x0'),'update'];function createListener(_0x228435,_0x2dc401){return function(_0x772400){_0x2dc401[_0x7ed7('0x1')](_0x228435,_0x772400);};}function removeListener(_0x20cfa9,_0x2f219c){return function(){FaxMessageEvents['removeListener'](_0x20cfa9,_0x2f219c);};}exports[_0x7ed7('0x2')]=function(_0x19208b){for(var _0x513b0e=0x0,_0x52d42e=events[_0x7ed7('0x3')];_0x513b0e<_0x52d42e;_0x513b0e++){var _0x51bd2c=events[_0x513b0e];var _0x33693a=createListener(_0x7ed7('0x4')+_0x51bd2c,_0x19208b);FaxMessageEvents['on'](_0x51bd2c,_0x33693a);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 75e3602..edaf22f 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 _0xa75b=['get','isAuthenticated','index','/describe','show','/:id/download','download','post','tracked','fax','faxmessage:create','create','put','/:id','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller'];(function(_0x5a7484,_0x1c39c3){var _0x2e6167=function(_0x49fc7){while(--_0x49fc7){_0x5a7484['push'](_0x5a7484['shift']());}};_0x2e6167(++_0x1c39c3);}(_0xa75b,0x170));var _0xba75=function(_0x454b3c,_0x16be02){_0x454b3c=_0x454b3c-0x0;var _0x5ef04e=_0xa75b[_0x454b3c];return _0x5ef04e;};'use strict';var multer=require(_0xba75('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xba75('0x1'));var express=require(_0xba75('0x2'));var router=express[_0xba75('0x3')]();var fs_extra=require(_0xba75('0x4'));var auth=require(_0xba75('0x5'));var interaction=require(_0xba75('0x6'));var config=require(_0xba75('0x7'));var controller=require(_0xba75('0x8'));router[_0xba75('0x9')]('/',auth[_0xba75('0xa')](),controller[_0xba75('0xb')]);router[_0xba75('0x9')](_0xba75('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xba75('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xba75('0xd')]);router['get'](_0xba75('0xe'),auth[_0xba75('0xa')](),controller[_0xba75('0xf')]);router[_0xba75('0x10')]('/',auth[_0xba75('0xa')](),interaction[_0xba75('0x11')](_0xba75('0x12'),_0xba75('0x13')),controller[_0xba75('0x14')]);router[_0xba75('0x15')](_0xba75('0x16'),auth[_0xba75('0xa')](),controller['update']);router['put'](_0xba75('0x17'),auth['isAuthenticated'](),controller[_0xba75('0x18')]);router[_0xba75('0x15')](_0xba75('0x19'),auth[_0xba75('0xa')](),controller['reject']);router[_0xba75('0x1a')](_0xba75('0x16'),auth[_0xba75('0xa')](),controller[_0xba75('0x1b')]);module[_0xba75('0x1c')]=router; \ No newline at end of file +var _0x5ec6=['express','fs-extra','../../components/interaction/service','./faxMessage.controller','isAuthenticated','index','/describe','get','/:id','/:id/download','download','post','tracked','fax','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util','path'];(function(_0x43328e,_0xb9da9e){var _0x2b6ef7=function(_0x2eabf4){while(--_0x2eabf4){_0x43328e['push'](_0x43328e['shift']());}};_0x2b6ef7(++_0xb9da9e);}(_0x5ec6,0x7f));var _0x65ec=function(_0x51895f,_0x5e6fee){_0x51895f=_0x51895f-0x0;var _0x46b8bf=_0x5ec6[_0x51895f];return _0x46b8bf;};'use strict';var multer=require(_0x65ec('0x0'));var util=require(_0x65ec('0x1'));var path=require(_0x65ec('0x2'));var timeout=require('connect-timeout');var express=require(_0x65ec('0x3'));var router=express['Router']();var fs_extra=require(_0x65ec('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x65ec('0x5'));var config=require('../../config/environment');var controller=require(_0x65ec('0x6'));router['get']('/',auth[_0x65ec('0x7')](),controller[_0x65ec('0x8')]);router['get'](_0x65ec('0x9'),auth[_0x65ec('0x7')](),controller['describe']);router[_0x65ec('0xa')](_0x65ec('0xb'),auth[_0x65ec('0x7')](),controller['show']);router['get'](_0x65ec('0xc'),auth['isAuthenticated'](),controller[_0x65ec('0xd')]);router[_0x65ec('0xe')]('/',auth['isAuthenticated'](),interaction[_0x65ec('0xf')](_0x65ec('0x10'),'faxmessage:create'),controller[_0x65ec('0x11')]);router[_0x65ec('0x12')]('/:id',auth[_0x65ec('0x7')](),controller[_0x65ec('0x13')]);router[_0x65ec('0x12')](_0x65ec('0x14'),auth[_0x65ec('0x7')](),controller[_0x65ec('0x15')]);router[_0x65ec('0x12')](_0x65ec('0x16'),auth['isAuthenticated'](),controller[_0x65ec('0x17')]);router[_0x65ec('0x18')](_0x65ec('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x65ec('0x19')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index bb776fb..3b75eec 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 _0x5e61=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x4e9abb,_0x5da914){var _0xf26e53=function(_0x25f505){while(--_0x25f505){_0x4e9abb['push'](_0x4e9abb['shift']());}};_0xf26e53(++_0x5da914);}(_0x5e61,0x1e0));var _0x15e6=function(_0x2818e1,_0x1b05ef){_0x2818e1=_0x2818e1-0x0;var _0x2a29d9=_0x5e61[_0x2818e1];return _0x2a29d9;};'use strict';var Sequelize=require(_0x15e6('0x0'));module[_0x15e6('0x1')]={'name':{'type':Sequelize[_0x15e6('0x2')],'unique':_0x15e6('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x15e6('0x2')]},'timeout':{'type':Sequelize[_0x15e6('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x15e6('0x5')](_0x15e6('0x6'),_0x15e6('0x7'),_0x15e6('0x8')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x15e6('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x18d4=['STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x36a157,_0x5384e7){var _0xb144bf=function(_0x2eb714){while(--_0x2eb714){_0x36a157['push'](_0x36a157['shift']());}};_0xb144bf(++_0x5384e7);}(_0x18d4,0x19e));var _0x418d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x18d4[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x418d('0x0'));module[_0x418d('0x1')]={'name':{'type':Sequelize[_0x418d('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x418d('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x418d('0x4')](_0x418d('0x5'),_0x418d('0x6'),_0x418d('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x418d('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 0410047..15c57b3 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 _0xf660=['updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','addTeams','Team','online','voicePause','Agents','sequelize','transaction','each','findOrCreate','forEach','userFaxQueue:save','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','SELECT','TeamId','includes','all','union','compact','removeTeams','ids','isEmpty','userFaxQueue:remove','addAgents','spread','removeAgents','isArray','emit','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxQueue.socket','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','FaxQueue','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxQueues','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserFaxQueue','hasOwnProperty','FaxQueueId','User','UserId','faxPause'];(function(_0x26d5ad,_0x2f13d7){var _0x3876b9=function(_0x2822c6){while(--_0x2822c6){_0x26d5ad['push'](_0x26d5ad['shift']());}};_0x3876b9(++_0x2f13d7);}(_0xf660,0x142));var _0x0f66=function(_0x13ce0c,_0x3f2a0d){_0x13ce0c=_0x13ce0c-0x0;var _0x4388fb=_0xf660[_0x13ce0c];return _0x4388fb;};'use strict';var emlformat=require(_0x0f66('0x0'));var rimraf=require(_0x0f66('0x1'));var zipdir=require(_0x0f66('0x2'));var jsonpatch=require(_0x0f66('0x3'));var rp=require(_0x0f66('0x4'));var moment=require('moment');var BPromise=require(_0x0f66('0x5'));var Mustache=require('mustache');var util=require(_0x0f66('0x6'));var path=require(_0x0f66('0x7'));var sox=require(_0x0f66('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0f66('0x9'));var _=require(_0x0f66('0xa'));var squel=require(_0x0f66('0xb'));var crypto=require(_0x0f66('0xc'));var jsforce=require(_0x0f66('0xd'));var deskjs=require(_0x0f66('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0f66('0xf'));var Papa=require(_0x0f66('0x10'));var Redis=require(_0x0f66('0x11'));var authService=require(_0x0f66('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0f66('0x13'));var logger=require('../../config/logger')(_0x0f66('0x14'));var utils=require(_0x0f66('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0f66('0x16'));var db=require(_0x0f66('0x17'))['db'];config[_0x0f66('0x18')]=_[_0x0f66('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0f66('0x1a'))(new Redis(config[_0x0f66('0x18')]));require(_0x0f66('0x1b'))['register'](socket);function respondWithStatusCode(_0x1e7c70,_0x47d5ad){_0x47d5ad=_0x47d5ad||0xcc;return function(_0x28b72b){if(_0x28b72b){return _0x1e7c70[_0x0f66('0x1c')](_0x47d5ad);}return _0x1e7c70['status'](_0x47d5ad)[_0x0f66('0x1d')]();};}function respondWithResult(_0x2db468,_0x22c7b1){_0x22c7b1=_0x22c7b1||0xc8;return function(_0x528a5c){if(_0x528a5c){return _0x2db468[_0x0f66('0x1e')](_0x22c7b1)['json'](_0x528a5c);}};}function respondWithFilteredResult(_0xfe2848,_0x12224a){return function(_0xb0cd2b){if(_0xb0cd2b){var _0x115f5c=typeof _0x12224a[_0x0f66('0x1f')]===_0x0f66('0x20')&&typeof _0x12224a[_0x0f66('0x21')]===_0x0f66('0x20');var _0x1e6384=_0xb0cd2b[_0x0f66('0x22')];var _0x53cc5e=_0x115f5c?0x0:_0x12224a['offset'];var _0x3fe6ce=_0x115f5c?_0xb0cd2b[_0x0f66('0x22')]:_0x12224a['offset']+_0x12224a[_0x0f66('0x21')];var _0x40b230;if(_0x3fe6ce>=_0x1e6384){_0x3fe6ce=_0x1e6384;_0x40b230=0xc8;}else{_0x40b230=0xce;}_0xfe2848['status'](_0x40b230);return _0xfe2848[_0x0f66('0x23')](_0x0f66('0x24'),_0x53cc5e+'-'+_0x3fe6ce+'/'+_0x1e6384)[_0x0f66('0x25')](_0xb0cd2b);}return null;};}function patchUpdates(_0x29d46d){return function(_0x4874ac){try{jsonpatch['apply'](_0x4874ac,_0x29d46d,!![]);}catch(_0x56a87f){return BPromise[_0x0f66('0x26')](_0x56a87f);}return _0x4874ac['save']();};}function saveUpdates(_0x471ad6,_0x376c74){return function(_0x25d21c){if(_0x25d21c){return _0x25d21c['update'](_0x471ad6)[_0x0f66('0x27')](function(_0x4bea20){return _0x4bea20;});}return null;};}function removeEntity(_0x29e1d0,_0x255926){return function(_0x2c0a9a){if(_0x2c0a9a){return _0x2c0a9a['destroy']()[_0x0f66('0x27')](function(){var _0xbd76b8=_0x2c0a9a['get']({'plain':!![]});var _0x138840='FaxQueues';return db['UserProfileResource'][_0x0f66('0x28')]({'where':{'type':_0x138840,'resourceId':_0xbd76b8['id']}})[_0x0f66('0x27')](function(){return _0x2c0a9a;});})['then'](function(){_0x29e1d0[_0x0f66('0x1e')](0xcc)[_0x0f66('0x1d')]();});}};}function handleEntityNotFound(_0x55414c,_0x40f410){return function(_0x2b8614){if(!_0x2b8614){_0x55414c[_0x0f66('0x1c')](0x194);}return _0x2b8614;};}function handleError(_0x25a917,_0x52006e){_0x52006e=_0x52006e||0x1f4;return function(_0x219787){logger[_0x0f66('0x29')](_0x219787[_0x0f66('0x2a')]);if(_0x219787[_0x0f66('0x2b')]){delete _0x219787[_0x0f66('0x2b')];}_0x25a917[_0x0f66('0x1e')](_0x52006e)['send'](_0x219787);};}exports[_0x0f66('0x2c')]=function(_0x4e8b35,_0x360a88){var _0x9a1892={},_0x50f258={},_0x574d9b={'count':0x0,'rows':[]};var _0x232cd5=_[_0x0f66('0x2d')](db['FaxQueue'][_0x0f66('0x2e')],function(_0x271418){return{'name':_0x271418[_0x0f66('0x2f')],'type':_0x271418[_0x0f66('0x30')][_0x0f66('0x31')]};});_0x50f258['model']=_[_0x0f66('0x2d')](_0x232cd5,_0x0f66('0x2b'));_0x50f258['query']=_[_0x0f66('0x32')](_0x4e8b35[_0x0f66('0x33')]);_0x50f258[_0x0f66('0x34')]=_[_0x0f66('0x35')](_0x50f258[_0x0f66('0x36')],_0x50f258[_0x0f66('0x33')]);_0x9a1892['attributes']=_['intersection'](_0x50f258['model'],qs[_0x0f66('0x37')](_0x4e8b35['query'][_0x0f66('0x37')]));_0x9a1892[_0x0f66('0x38')]=_0x9a1892[_0x0f66('0x38')][_0x0f66('0x39')]?_0x9a1892[_0x0f66('0x38')]:_0x50f258[_0x0f66('0x36')];if(!_0x4e8b35[_0x0f66('0x33')]['hasOwnProperty'](_0x0f66('0x3a'))){_0x9a1892[_0x0f66('0x21')]=qs['limit'](_0x4e8b35[_0x0f66('0x33')][_0x0f66('0x21')]);_0x9a1892[_0x0f66('0x1f')]=qs['offset'](_0x4e8b35[_0x0f66('0x33')][_0x0f66('0x1f')]);}_0x9a1892[_0x0f66('0x3b')]=qs[_0x0f66('0x3c')](_0x4e8b35[_0x0f66('0x33')][_0x0f66('0x3c')]);_0x9a1892[_0x0f66('0x3d')]=qs['filters'](_[_0x0f66('0x3e')](_0x4e8b35[_0x0f66('0x33')],_0x50f258[_0x0f66('0x34')]),_0x232cd5);if(_0x4e8b35[_0x0f66('0x33')][_0x0f66('0x3f')]){_0x9a1892['where']=_[_0x0f66('0x40')](_0x9a1892[_0x0f66('0x3d')],{'$or':_['map'](_0x232cd5,function(_0x3b7ea2){if(_0x3b7ea2[_0x0f66('0x30')]!==_0x0f66('0x41')){var _0x3006b8={};_0x3006b8[_0x3b7ea2[_0x0f66('0x2b')]]={'$like':'%'+_0x4e8b35[_0x0f66('0x33')][_0x0f66('0x3f')]+'%'};return _0x3006b8;}})});}_0x9a1892=_[_0x0f66('0x40')]({},_0x9a1892,_0x4e8b35[_0x0f66('0x42')]);var _0x33de2e={'where':_0x9a1892[_0x0f66('0x3d')]};return db[_0x0f66('0x43')][_0x0f66('0x22')](_0x33de2e)[_0x0f66('0x27')](function(_0x4de9c0){_0x574d9b[_0x0f66('0x22')]=_0x4de9c0;if(_0x4e8b35['query'][_0x0f66('0x44')]){_0x9a1892['include']=[{'all':!![]}];}return db[_0x0f66('0x43')][_0x0f66('0x45')](_0x9a1892);})[_0x0f66('0x27')](function(_0x49f675){_0x574d9b[_0x0f66('0x46')]=_0x49f675;return _0x574d9b;})[_0x0f66('0x27')](respondWithFilteredResult(_0x360a88,_0x9a1892))[_0x0f66('0x47')](handleError(_0x360a88,null));};exports[_0x0f66('0x48')]=function(_0x2aefab,_0x3b380d){var _0x16cf9f={'raw':!![],'where':{'id':_0x2aefab[_0x0f66('0x49')]['id']}},_0x181d88={};_0x181d88[_0x0f66('0x36')]=_[_0x0f66('0x32')](db[_0x0f66('0x43')]['rawAttributes']);_0x181d88[_0x0f66('0x33')]=_[_0x0f66('0x32')](_0x2aefab[_0x0f66('0x33')]);_0x181d88[_0x0f66('0x34')]=_[_0x0f66('0x35')](_0x181d88['model'],_0x181d88[_0x0f66('0x33')]);_0x16cf9f['attributes']=_[_0x0f66('0x35')](_0x181d88['model'],qs[_0x0f66('0x37')](_0x2aefab['query'][_0x0f66('0x37')]));_0x16cf9f[_0x0f66('0x38')]=_0x16cf9f[_0x0f66('0x38')]['length']?_0x16cf9f[_0x0f66('0x38')]:_0x181d88[_0x0f66('0x36')];if(_0x2aefab[_0x0f66('0x33')][_0x0f66('0x44')]){_0x16cf9f[_0x0f66('0x4a')]=[{'all':!![]}];}_0x16cf9f=_[_0x0f66('0x40')]({},_0x16cf9f,_0x2aefab[_0x0f66('0x42')]);return db[_0x0f66('0x43')][_0x0f66('0x4b')](_0x16cf9f)[_0x0f66('0x27')](handleEntityNotFound(_0x3b380d,null))[_0x0f66('0x27')](respondWithResult(_0x3b380d,null))[_0x0f66('0x47')](handleError(_0x3b380d,null));};exports[_0x0f66('0x4c')]=function(_0xa5b251,_0xddafad){return db[_0x0f66('0x43')]['create'](_0xa5b251[_0x0f66('0x4d')],{})['then'](function(_0x19abf2){var _0x9ebc5c=_0xa5b251[_0x0f66('0x4e')][_0x0f66('0x4f')]({'plain':!![]});if(!_0x9ebc5c)throw new Error(_0x0f66('0x50'));if(_0x9ebc5c[_0x0f66('0x51')]===_0x0f66('0x4e')){var _0x19a166=_0x19abf2[_0x0f66('0x4f')]({'plain':!![]});var _0x3aba21=_0x0f66('0x52');return db[_0x0f66('0x53')][_0x0f66('0x4b')]({'where':{'name':_0x3aba21,'userProfileId':_0x9ebc5c['userProfileId']},'raw':!![]})['then'](function(_0xef67d9){if(_0xef67d9&&_0xef67d9[_0x0f66('0x54')]===0x0){return db[_0x0f66('0x55')]['create']({'name':_0x19a166[_0x0f66('0x2b')],'resourceId':_0x19a166['id'],'type':_0xef67d9[_0x0f66('0x2b')],'sectionId':_0xef67d9['id']},{})[_0x0f66('0x27')](function(){return _0x19abf2;});}else{return _0x19abf2;}})[_0x0f66('0x47')](function(_0x1b3443){logger[_0x0f66('0x29')](_0x0f66('0x56'),_0x1b3443);throw _0x1b3443;});}return _0x19abf2;})[_0x0f66('0x27')](respondWithResult(_0xddafad,0xc9))[_0x0f66('0x47')](handleError(_0xddafad,null));};exports['update']=function(_0x5ca400,_0xd3af9e){if(_0x5ca400[_0x0f66('0x4d')]['id']){delete _0x5ca400['body']['id'];}return db[_0x0f66('0x43')][_0x0f66('0x4b')]({'where':{'id':_0x5ca400[_0x0f66('0x49')]['id']}})[_0x0f66('0x27')](handleEntityNotFound(_0xd3af9e,null))[_0x0f66('0x27')](saveUpdates(_0x5ca400[_0x0f66('0x4d')],null))[_0x0f66('0x27')](respondWithResult(_0xd3af9e,null))[_0x0f66('0x47')](handleError(_0xd3af9e,null));};exports[_0x0f66('0x28')]=function(_0x4c0944,_0x5cedd8){return db[_0x0f66('0x43')][_0x0f66('0x4b')]({'where':{'id':_0x4c0944['params']['id']}})['then'](handleEntityNotFound(_0x5cedd8,null))[_0x0f66('0x27')](removeEntity(_0x5cedd8,null))[_0x0f66('0x47')](handleError(_0x5cedd8,null));};exports[_0x0f66('0x57')]=function(_0x9c8886,_0x2c2eca){return db[_0x0f66('0x43')][_0x0f66('0x57')]()[_0x0f66('0x27')](respondWithResult(_0x2c2eca,null))[_0x0f66('0x47')](handleError(_0x2c2eca,null));};exports[_0x0f66('0x58')]=function(_0x154c60,_0x54395f,_0x33c00e){var _0x443e41={'raw':!![],'where':{}},_0x1a1ea5={},_0x32ad91;return db[_0x0f66('0x43')]['findOne']({'where':{'id':_0x154c60[_0x0f66('0x49')]['id']}})[_0x0f66('0x27')](handleEntityNotFound(_0x54395f,null))[_0x0f66('0x27')](function(_0x47bb7a){if(_0x47bb7a){_0x32ad91=_0x47bb7a[_0x0f66('0x4f')]({'plain':!![]});_0x1a1ea5[_0x0f66('0x36')]=_[_0x0f66('0x32')](db[_0x0f66('0x59')][_0x0f66('0x2e')]);_0x1a1ea5['query']=_[_0x0f66('0x32')](_0x154c60[_0x0f66('0x33')]);_0x1a1ea5[_0x0f66('0x34')]=_[_0x0f66('0x35')](_0x1a1ea5['model'],_0x1a1ea5[_0x0f66('0x33')]);_0x443e41['attributes']=_[_0x0f66('0x35')](_0x1a1ea5['model'],qs[_0x0f66('0x37')](_0x154c60[_0x0f66('0x33')][_0x0f66('0x37')]));_0x443e41[_0x0f66('0x38')]=_0x443e41[_0x0f66('0x38')][_0x0f66('0x39')]?_0x443e41[_0x0f66('0x38')]:_0x1a1ea5[_0x0f66('0x36')];if(!_0x154c60[_0x0f66('0x33')][_0x0f66('0x5a')](_0x0f66('0x3a'))){_0x443e41[_0x0f66('0x21')]=qs['limit'](_0x154c60['query'][_0x0f66('0x21')]);_0x443e41[_0x0f66('0x1f')]=qs['offset'](_0x154c60[_0x0f66('0x33')][_0x0f66('0x1f')]);}_0x443e41[_0x0f66('0x3b')]=qs['sort'](_0x154c60['query'][_0x0f66('0x3c')]);_0x443e41[_0x0f66('0x3d')]=qs[_0x0f66('0x34')](_[_0x0f66('0x3e')](_0x154c60[_0x0f66('0x33')],_0x1a1ea5[_0x0f66('0x34')]));_0x443e41[_0x0f66('0x3d')][_0x0f66('0x5b')]=_0x47bb7a['id'];if(_0x154c60[_0x0f66('0x33')]['filter']){_0x443e41[_0x0f66('0x3d')]=_[_0x0f66('0x40')](_0x443e41[_0x0f66('0x3d')],{'$or':_[_0x0f66('0x2d')](_0x443e41[_0x0f66('0x38')],function(_0x21afc2){var _0x53a531={};_0x53a531[_0x21afc2]={'$like':'%'+_0x154c60[_0x0f66('0x33')][_0x0f66('0x3f')]+'%'};return _0x53a531;})});}_0x443e41=_[_0x0f66('0x40')]({},_0x443e41,_0x154c60[_0x0f66('0x42')]);return db['UserFaxQueue']['findAll'](_0x443e41);}})[_0x0f66('0x27')](function(_0x2ea29a){if(_0x2ea29a){return db[_0x0f66('0x5c')]['findAndCountAll']({'where':{'id':_[_0x0f66('0x2d')](_0x2ea29a,_0x0f66('0x5d')),'role':'agent'},'attributes':['id','name',_0x0f66('0x5e'),_0x0f66('0x5f'),_0x0f66('0x60')]});}})[_0x0f66('0x27')](function(_0x1503e8){if(_0x1503e8){return{'count':_0x1503e8[_0x0f66('0x22')],'rows':_[_0x0f66('0x2d')](_0x1503e8[_0x0f66('0x46')],function(_0x33862d){return{'membername':_0x33862d[_0x0f66('0x2b')],'UserId':_0x33862d['id'],'queue_name':_0x32ad91[_0x0f66('0x2b')],'FaxQueueId':_0x32ad91['id'],'interface':util[_0x0f66('0x61')](_0x0f66('0x62'),_0x0f66('0x63'),_0x33862d[_0x0f66('0x2b')]),'penalty':0x0,'paused':_0x33862d[_0x0f66('0x5e')],'createdAt':_0x33862d['createdAt'],'updatedAt':_0x33862d['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x0f66('0x27')](respondWithFilteredResult(_0x54395f,_0x443e41))[_0x0f66('0x47')](handleError(_0x54395f,null));};exports[_0x0f66('0x64')]=function(_0x144574,_0x447dd9,_0x3d00d2){var _0xd99016={};var _0x58cd9d={};var _0x5d24d2;var _0x2ab656;return db[_0x0f66('0x43')][_0x0f66('0x65')]({'where':{'id':_0x144574['params']['id']}})[_0x0f66('0x27')](handleEntityNotFound(_0x447dd9,null))[_0x0f66('0x27')](function(_0x40f1c6){if(_0x40f1c6){_0x5d24d2=_0x40f1c6;_0x58cd9d[_0x0f66('0x36')]=_[_0x0f66('0x32')](db['Team'][_0x0f66('0x2e')]);_0x58cd9d[_0x0f66('0x33')]=_[_0x0f66('0x32')](_0x144574[_0x0f66('0x33')]);_0x58cd9d[_0x0f66('0x34')]=_[_0x0f66('0x35')](_0x58cd9d[_0x0f66('0x36')],_0x58cd9d[_0x0f66('0x33')]);_0xd99016[_0x0f66('0x38')]=_[_0x0f66('0x35')](_0x58cd9d[_0x0f66('0x36')],qs[_0x0f66('0x37')](_0x144574[_0x0f66('0x33')]['fields']));_0xd99016['attributes']=_0xd99016[_0x0f66('0x38')]['length']?_0xd99016[_0x0f66('0x38')]:_0x58cd9d[_0x0f66('0x36')];_0xd99016['order']=qs[_0x0f66('0x3c')](_0x144574[_0x0f66('0x33')]['sort']);_0xd99016[_0x0f66('0x3d')]=qs[_0x0f66('0x34')](_[_0x0f66('0x3e')](_0x144574[_0x0f66('0x33')],_0x58cd9d[_0x0f66('0x34')]));if(_0x144574[_0x0f66('0x33')][_0x0f66('0x3f')]){_0xd99016[_0x0f66('0x3d')]=_['merge'](_0xd99016[_0x0f66('0x3d')],{'$or':_[_0x0f66('0x2d')](_0xd99016['attributes'],function(_0x58545b){var _0x57d0aa={};_0x57d0aa[_0x58545b]={'$like':'%'+_0x144574[_0x0f66('0x33')][_0x0f66('0x3f')]+'%'};return _0x57d0aa;})});}_0xd99016=_[_0x0f66('0x40')]({},_0xd99016,_0x144574[_0x0f66('0x42')]);return _0x5d24d2[_0x0f66('0x64')](_0xd99016);}})[_0x0f66('0x27')](function(_0x52d39b){if(_0x52d39b){_0x2ab656=_0x52d39b[_0x0f66('0x39')];if(!_0x144574[_0x0f66('0x33')]['hasOwnProperty']('nolimit')){_0xd99016['limit']=qs[_0x0f66('0x21')](_0x144574[_0x0f66('0x33')]['limit']);_0xd99016[_0x0f66('0x1f')]=qs[_0x0f66('0x1f')](_0x144574[_0x0f66('0x33')]['offset']);}return _0x5d24d2[_0x0f66('0x64')](_0xd99016);}})[_0x0f66('0x27')](function(_0x3cc2e3){if(_0x3cc2e3){return _0x3cc2e3?{'count':_0x2ab656,'rows':_0x3cc2e3}:null;}})[_0x0f66('0x27')](respondWithResult(_0x447dd9,null))[_0x0f66('0x47')](handleError(_0x447dd9,null));};exports[_0x0f66('0x66')]=function(_0x42f385,_0x338b9a,_0x2b8d75){var _0x465a71=_0x42f385[_0x0f66('0x4d')]['ids'];return db[_0x0f66('0x67')]['findAll']({'where':{'id':_0x465a71},'attributes':['id'],'include':[{'model':db[_0x0f66('0x5c')],'as':'Agents','attributes':['id','name',_0x0f66('0x68'),_0x0f66('0x69'),'interface'],'raw':!![]}]})[_0x0f66('0x27')](function(_0x221838){if(_0x221838){var _0x145dd7=_['flatMap'](_0x221838,function(_0x328fb4){var _0x48f56b=_0x328fb4[_0x0f66('0x4f')]({'plain':!![]});return _0x48f56b[_0x0f66('0x6a')];});return db[_0x0f66('0x43')]['find']({'where':{'id':_0x42f385[_0x0f66('0x49')]['id']}})[_0x0f66('0x27')](function(_0x324951){return db[_0x0f66('0x6b')][_0x0f66('0x6c')](function(_0x55f0c8){return _0x324951[_0x0f66('0x66')](_0x465a71,{'transaction':_0x55f0c8})[_0x0f66('0x27')](function(){return BPromise[_0x0f66('0x6d')](_0x145dd7,function(_0x1f3cb3){return db[_0x0f66('0x59')][_0x0f66('0x6e')]({'where':{'UserId':_0x1f3cb3['id'],'FaxQueueId':_0x42f385[_0x0f66('0x49')]['id']},'transaction':_0x55f0c8});});})['then'](function(){_0x145dd7[_0x0f66('0x6f')](function(_0x1427d3){socket['emit'](_0x0f66('0x70'),{'UserId':_0x1427d3['id'],'FaxQueueId':_0x324951['id']});});});});});}})[_0x0f66('0x27')](respondWithStatusCode(_0x338b9a,null))['catch'](handleError(_0x338b9a,null));};exports['removeTeams']=function(_0x5bb6a4,_0x36ae99,_0x11d229){return db[_0x0f66('0x67')]['findAll']({'where':{'id':_0x5bb6a4[_0x0f66('0x33')]['ids']},'attributes':['id'],'include':[{'model':db[_0x0f66('0x5c')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x36ae99,null))[_0x0f66('0x27')](function(_0x3f1304){var _0x1f9c40=_['map'](_0x3f1304,'id');var _0x451631=[];var _0x249282=[];var _0x18859e=squel['select']();_0x18859e['field'](_0x0f66('0x71'))[_0x0f66('0x72')](_0x0f66('0x73'),'tq')[_0x0f66('0x74')](_0x0f66('0x75'),'ut',_0x0f66('0x76'))['where'](_0x0f66('0x77'),_0x5bb6a4[_0x0f66('0x49')]['id']);for(var _0x5fb109=0x0;_0x5fb109<_0x3f1304[_0x0f66('0x39')];_0x5fb109+=0x1){let _0x34f915=_0x3f1304[_0x5fb109];for(var _0x5cceaf=0x0;_0x5cceaf<_0x34f915['Agents'][_0x0f66('0x39')];_0x5cceaf+=0x1){let _0x1d10dc=_0x34f915[_0x0f66('0x6a')][_0x5cceaf];var _0x3a3a30=_0x18859e['clone']();_0x3a3a30['where'](_0x0f66('0x78'),_0x1d10dc['id']);_0x249282[_0x0f66('0x79')](db[_0x0f66('0x6b')][_0x0f66('0x33')](_0x3a3a30[_0x0f66('0x7a')](),{'type':db[_0x0f66('0x6b')]['QueryTypes'][_0x0f66('0x7b')]})[_0x0f66('0x27')](function(_0x2a8b4f){if(_0x2a8b4f[_0x0f66('0x39')]===0x1){return _0x1d10dc['id'];}else{var _0x298f0a=_['every'](_[_0x0f66('0x2d')](_0x2a8b4f,_0x0f66('0x7c')),function(_0x40cb03){return _[_0x0f66('0x7d')](_0x1f9c40,_0x40cb03);});if(_0x298f0a){return _0x1d10dc['id'];}}}));}}return BPromise[_0x0f66('0x7e')](_0x249282)[_0x0f66('0x27')](function(_0x2dd57b){_0x451631=_(_0x451631)[_0x0f66('0x7f')](_0x2dd57b)[_0x0f66('0x80')]()['value']();return db[_0x0f66('0x43')][_0x0f66('0x4b')]({'where':{'id':_0x5bb6a4[_0x0f66('0x49')]['id']}})[_0x0f66('0x27')](function(_0x8b37f7){return db[_0x0f66('0x6b')][_0x0f66('0x6c')](function(_0x2407b1){return _0x8b37f7[_0x0f66('0x81')](_0x5bb6a4[_0x0f66('0x33')][_0x0f66('0x82')],{'transaction':_0x2407b1})['then'](function(){if(!_[_0x0f66('0x83')](_0x451631)){return _0x8b37f7['removeAgents'](_0x451631,{'transaction':_0x2407b1});}})[_0x0f66('0x27')](function(){_0x451631['forEach'](function(_0x28981f){socket['emit'](_0x0f66('0x84'),{'UserId':_0x28981f,'FaxQueueId':_0x8b37f7['id']});});});});});});})['then'](respondWithStatusCode(_0x36ae99,null))[_0x0f66('0x47')](handleError(_0x36ae99,null));};exports[_0x0f66('0x85')]=function(_0x11f4ff,_0x2795c5,_0x12db35){return db[_0x0f66('0x43')][_0x0f66('0x4b')]({'where':{'id':_0x11f4ff['params']['id']}})[_0x0f66('0x27')](handleEntityNotFound(_0x2795c5,null))[_0x0f66('0x27')](function(_0x4fe8f0){if(_0x4fe8f0){return _0x4fe8f0[_0x0f66('0x85')](_0x11f4ff[_0x0f66('0x4d')][_0x0f66('0x82')],_['omit'](_0x11f4ff[_0x0f66('0x4d')],['ids','id'])||{})[_0x0f66('0x86')](function(_0x453f64){for(var _0xe310dc=0x0;_0xe310dc<_0x11f4ff[_0x0f66('0x4d')][_0x0f66('0x82')]['length'];_0xe310dc+=0x1){socket['emit'](_0x0f66('0x70'),{'UserId':Number(_0x11f4ff[_0x0f66('0x4d')][_0x0f66('0x82')][_0xe310dc]),'FaxQueueId':Number(_0x11f4ff['params']['id'])});}return _0x453f64;});}})[_0x0f66('0x27')](respondWithResult(_0x2795c5,null))['catch'](handleError(_0x2795c5,null));};exports['removeAgents']=function(_0x33d894,_0x1ebae0,_0x4947e){return db['FaxQueue'][_0x0f66('0x4b')]({'where':{'id':_0x33d894['params']['id']}})[_0x0f66('0x27')](handleEntityNotFound(_0x1ebae0,null))[_0x0f66('0x27')](function(_0x3c8222){if(_0x3c8222){return _0x3c8222[_0x0f66('0x87')](_0x33d894['query'][_0x0f66('0x82')])[_0x0f66('0x27')](function(){if(_[_0x0f66('0x88')](_0x33d894['query'][_0x0f66('0x82')])){for(var _0x39912e=0x0;_0x39912e<_0x33d894[_0x0f66('0x33')][_0x0f66('0x82')][_0x0f66('0x39')];_0x39912e+=0x1){socket[_0x0f66('0x89')]('userFaxQueue:remove',{'UserId':Number(_0x33d894[_0x0f66('0x33')]['ids'][_0x39912e]),'FaxQueueId':Number(_0x33d894[_0x0f66('0x49')]['id'])});}}else{socket[_0x0f66('0x89')](_0x0f66('0x84'),{'UserId':Number(_0x33d894[_0x0f66('0x33')][_0x0f66('0x82')]),'FaxQueueId':Number(_0x33d894[_0x0f66('0x49')]['id'])});}});}})[_0x0f66('0x27')](respondWithStatusCode(_0x1ebae0,null))[_0x0f66('0x47')](handleError(_0x1ebae0,null));};exports[_0x0f66('0x8a')]=function(_0x144c83,_0x24a8ff,_0x2e00a4){var _0x15d308={};var _0x2f2cdd={};var _0x4a1729;var _0x3fdf22;return db[_0x0f66('0x43')][_0x0f66('0x65')]({'where':{'id':_0x144c83[_0x0f66('0x49')]['id']}})[_0x0f66('0x27')](handleEntityNotFound(_0x24a8ff,null))[_0x0f66('0x27')](function(_0x4b9388){if(_0x4b9388){_0x4a1729=_0x4b9388;_0x2f2cdd[_0x0f66('0x36')]=_[_0x0f66('0x32')](db[_0x0f66('0x5c')]['rawAttributes']);_0x2f2cdd[_0x0f66('0x33')]=_[_0x0f66('0x32')](_0x144c83['query']);_0x2f2cdd['filters']=_[_0x0f66('0x35')](_0x2f2cdd[_0x0f66('0x36')],_0x2f2cdd[_0x0f66('0x33')]);_0x15d308[_0x0f66('0x38')]=_[_0x0f66('0x35')](_0x2f2cdd[_0x0f66('0x36')],qs[_0x0f66('0x37')](_0x144c83['query'][_0x0f66('0x37')]));_0x15d308[_0x0f66('0x38')]=_0x15d308[_0x0f66('0x38')][_0x0f66('0x39')]?_0x15d308[_0x0f66('0x38')]:_0x2f2cdd[_0x0f66('0x36')];_0x15d308['order']=qs[_0x0f66('0x3c')](_0x144c83[_0x0f66('0x33')][_0x0f66('0x3c')]);_0x15d308[_0x0f66('0x3d')]=qs[_0x0f66('0x34')](_[_0x0f66('0x3e')](_0x144c83['query'],_0x2f2cdd[_0x0f66('0x34')]));if(_0x144c83[_0x0f66('0x33')]['filter']){_0x15d308[_0x0f66('0x3d')]=_[_0x0f66('0x40')](_0x15d308[_0x0f66('0x3d')],{'$or':_[_0x0f66('0x2d')](_0x15d308[_0x0f66('0x38')],function(_0x5b6a8c){var _0x4834e3={};_0x4834e3[_0x5b6a8c]={'$like':'%'+_0x144c83[_0x0f66('0x33')]['filter']+'%'};return _0x4834e3;})});}_0x15d308=_[_0x0f66('0x40')]({},_0x15d308,_0x144c83[_0x0f66('0x42')]);return _0x4a1729['getAgents'](_0x15d308);}})[_0x0f66('0x27')](function(_0x27089b){if(_0x27089b){_0x3fdf22=_0x27089b[_0x0f66('0x39')];if(!_0x144c83[_0x0f66('0x33')][_0x0f66('0x5a')]('nolimit')){_0x15d308['limit']=qs[_0x0f66('0x21')](_0x144c83[_0x0f66('0x33')][_0x0f66('0x21')]);_0x15d308[_0x0f66('0x1f')]=qs[_0x0f66('0x1f')](_0x144c83[_0x0f66('0x33')][_0x0f66('0x1f')]);}return _0x4a1729[_0x0f66('0x8a')](_0x15d308);}})[_0x0f66('0x27')](function(_0x4393b1){if(_0x4393b1){return _0x4393b1?{'count':_0x3fdf22,'rows':_0x4393b1}:null;}})[_0x0f66('0x27')](respondWithResult(_0x24a8ff,null))['catch'](handleError(_0x24a8ff,null));}; \ No newline at end of file +var _0xcded=['QueryTypes','SELECT','every','TeamId','all','union','compact','value','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','FaxQueues','error','stack','name','send','index','map','FaxQueue','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','sort','pick','filter','where','merge','includeAll','include','rows','catch','show','params','rawAttributes','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','describe','getMembers','findOne','UserFaxQueue','nolimit','order','FaxQueueId','findAll','agent','updatedAt','format','%s/%s','SIP','faxPause','getTeams','Team','addTeams','ids','User','Agents','voicePause','flatMap','sequelize','transaction','each','findOrCreate','emit','userFaxQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xcded,0x12e));var _0xdcde=function(_0x23f642,_0x3c8f66){_0x23f642=_0x23f642-0x0;var _0x4ba0d0=_0xcded[_0x23f642];return _0x4ba0d0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdcde('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdcde('0x1'));var rp=require(_0xdcde('0x2'));var moment=require(_0xdcde('0x3'));var BPromise=require(_0xdcde('0x4'));var Mustache=require(_0xdcde('0x5'));var util=require(_0xdcde('0x6'));var path=require(_0xdcde('0x7'));var sox=require('sox');var csv=require(_0xdcde('0x8'));var ejs=require(_0xdcde('0x9'));var fs=require('fs');var fs_extra=require(_0xdcde('0xa'));var _=require(_0xdcde('0xb'));var squel=require('squel');var crypto=require(_0xdcde('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdcde('0x8'));var querystring=require('querystring');var Papa=require(_0xdcde('0xd'));var Redis=require(_0xdcde('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xdcde('0xf'));var as=require(_0xdcde('0x10'));var hardwareService=require(_0xdcde('0x11'));var logger=require(_0xdcde('0x12'))(_0xdcde('0x13'));var utils=require(_0xdcde('0x14'));var config=require(_0xdcde('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xdcde('0x16'))['db'];config[_0xdcde('0x17')]=_[_0xdcde('0x18')](config[_0xdcde('0x17')],{'host':_0xdcde('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdcde('0x17')]));require('./faxQueue.socket')[_0xdcde('0x1a')](socket);function respondWithStatusCode(_0x510660,_0x554ab5){_0x554ab5=_0x554ab5||0xcc;return function(_0x5e2766){if(_0x5e2766){return _0x510660[_0xdcde('0x1b')](_0x554ab5);}return _0x510660[_0xdcde('0x1c')](_0x554ab5)[_0xdcde('0x1d')]();};}function respondWithResult(_0x3fa5cf,_0x5489bb){_0x5489bb=_0x5489bb||0xc8;return function(_0xd35b2a){if(_0xd35b2a){return _0x3fa5cf['status'](_0x5489bb)[_0xdcde('0x1e')](_0xd35b2a);}};}function respondWithFilteredResult(_0x41dc5f,_0x33a7f4){return function(_0x49747c){if(_0x49747c){var _0x3b227e=typeof _0x33a7f4[_0xdcde('0x1f')]===_0xdcde('0x20')&&typeof _0x33a7f4[_0xdcde('0x21')]==='undefined';var _0x2460d0=_0x49747c[_0xdcde('0x22')];var _0x4f566d=_0x3b227e?0x0:_0x33a7f4[_0xdcde('0x1f')];var _0x1bfbeb=_0x3b227e?_0x49747c[_0xdcde('0x22')]:_0x33a7f4[_0xdcde('0x1f')]+_0x33a7f4[_0xdcde('0x21')];var _0x53822d;if(_0x1bfbeb>=_0x2460d0){_0x1bfbeb=_0x2460d0;_0x53822d=0xc8;}else{_0x53822d=0xce;}_0x41dc5f[_0xdcde('0x1c')](_0x53822d);return _0x41dc5f[_0xdcde('0x23')](_0xdcde('0x24'),_0x4f566d+'-'+_0x1bfbeb+'/'+_0x2460d0)[_0xdcde('0x1e')](_0x49747c);}return null;};}function patchUpdates(_0x373ad8){return function(_0x5898f4){try{jsonpatch[_0xdcde('0x25')](_0x5898f4,_0x373ad8,!![]);}catch(_0x1f330b){return BPromise[_0xdcde('0x26')](_0x1f330b);}return _0x5898f4[_0xdcde('0x27')]();};}function saveUpdates(_0x14712d,_0x3cc8e0){return function(_0xe1ae57){if(_0xe1ae57){return _0xe1ae57[_0xdcde('0x28')](_0x14712d)[_0xdcde('0x29')](function(_0x3587e6){return _0x3587e6;});}return null;};}function removeEntity(_0x333ab3,_0x516950){return function(_0x14b052){if(_0x14b052){return _0x14b052[_0xdcde('0x2a')]()['then'](function(){var _0x1296af=_0x14b052[_0xdcde('0x2b')]({'plain':!![]});var _0x149f64=_0xdcde('0x2c');return db['UserProfileResource'][_0xdcde('0x2a')]({'where':{'type':_0x149f64,'resourceId':_0x1296af['id']}})[_0xdcde('0x29')](function(){return _0x14b052;});})[_0xdcde('0x29')](function(){_0x333ab3['status'](0xcc)[_0xdcde('0x1d')]();});}};}function handleEntityNotFound(_0x18c19e,_0x1d5286){return function(_0x5188ae){if(!_0x5188ae){_0x18c19e[_0xdcde('0x1b')](0x194);}return _0x5188ae;};}function handleError(_0x136b30,_0x59b626){_0x59b626=_0x59b626||0x1f4;return function(_0x212fad){logger[_0xdcde('0x2d')](_0x212fad[_0xdcde('0x2e')]);if(_0x212fad[_0xdcde('0x2f')]){delete _0x212fad[_0xdcde('0x2f')];}_0x136b30[_0xdcde('0x1c')](_0x59b626)[_0xdcde('0x30')](_0x212fad);};}exports[_0xdcde('0x31')]=function(_0x5ec77a,_0x365145){var _0x4cdfc5={},_0x15bcd1={},_0x214784={'count':0x0,'rows':[]};var _0x548fa5=_[_0xdcde('0x32')](db[_0xdcde('0x33')]['rawAttributes'],function(_0x18bbfa){return{'name':_0x18bbfa[_0xdcde('0x34')],'type':_0x18bbfa[_0xdcde('0x35')][_0xdcde('0x36')]};});_0x15bcd1[_0xdcde('0x37')]=_[_0xdcde('0x32')](_0x548fa5,_0xdcde('0x2f'));_0x15bcd1['query']=_[_0xdcde('0x38')](_0x5ec77a[_0xdcde('0x39')]);_0x15bcd1[_0xdcde('0x3a')]=_['intersection'](_0x15bcd1[_0xdcde('0x37')],_0x15bcd1['query']);_0x4cdfc5['attributes']=_[_0xdcde('0x3b')](_0x15bcd1['model'],qs[_0xdcde('0x3c')](_0x5ec77a[_0xdcde('0x39')][_0xdcde('0x3c')]));_0x4cdfc5[_0xdcde('0x3d')]=_0x4cdfc5[_0xdcde('0x3d')]['length']?_0x4cdfc5[_0xdcde('0x3d')]:_0x15bcd1[_0xdcde('0x37')];if(!_0x5ec77a['query'][_0xdcde('0x3e')]('nolimit')){_0x4cdfc5['limit']=qs[_0xdcde('0x21')](_0x5ec77a[_0xdcde('0x39')][_0xdcde('0x21')]);_0x4cdfc5[_0xdcde('0x1f')]=qs[_0xdcde('0x1f')](_0x5ec77a[_0xdcde('0x39')][_0xdcde('0x1f')]);}_0x4cdfc5['order']=qs[_0xdcde('0x3f')](_0x5ec77a[_0xdcde('0x39')][_0xdcde('0x3f')]);_0x4cdfc5['where']=qs['filters'](_[_0xdcde('0x40')](_0x5ec77a[_0xdcde('0x39')],_0x15bcd1[_0xdcde('0x3a')]),_0x548fa5);if(_0x5ec77a['query'][_0xdcde('0x41')]){_0x4cdfc5[_0xdcde('0x42')]=_[_0xdcde('0x43')](_0x4cdfc5[_0xdcde('0x42')],{'$or':_[_0xdcde('0x32')](_0x548fa5,function(_0x2feeb5){if(_0x2feeb5['type']!=='VIRTUAL'){var _0x3f4d21={};_0x3f4d21[_0x2feeb5[_0xdcde('0x2f')]]={'$like':'%'+_0x5ec77a[_0xdcde('0x39')]['filter']+'%'};return _0x3f4d21;}})});}_0x4cdfc5=_[_0xdcde('0x43')]({},_0x4cdfc5,_0x5ec77a['options']);var _0xfe43d2={'where':_0x4cdfc5[_0xdcde('0x42')]};return db[_0xdcde('0x33')][_0xdcde('0x22')](_0xfe43d2)[_0xdcde('0x29')](function(_0x1658db){_0x214784[_0xdcde('0x22')]=_0x1658db;if(_0x5ec77a[_0xdcde('0x39')][_0xdcde('0x44')]){_0x4cdfc5[_0xdcde('0x45')]=[{'all':!![]}];}return db[_0xdcde('0x33')]['findAll'](_0x4cdfc5);})['then'](function(_0x5d449b){_0x214784[_0xdcde('0x46')]=_0x5d449b;return _0x214784;})[_0xdcde('0x29')](respondWithFilteredResult(_0x365145,_0x4cdfc5))[_0xdcde('0x47')](handleError(_0x365145,null));};exports[_0xdcde('0x48')]=function(_0x2ae2c2,_0x11e879){var _0x273078={'raw':!![],'where':{'id':_0x2ae2c2[_0xdcde('0x49')]['id']}},_0x38a4f5={};_0x38a4f5[_0xdcde('0x37')]=_['keys'](db['FaxQueue'][_0xdcde('0x4a')]);_0x38a4f5[_0xdcde('0x39')]=_[_0xdcde('0x38')](_0x2ae2c2['query']);_0x38a4f5['filters']=_[_0xdcde('0x3b')](_0x38a4f5[_0xdcde('0x37')],_0x38a4f5[_0xdcde('0x39')]);_0x273078[_0xdcde('0x3d')]=_['intersection'](_0x38a4f5['model'],qs[_0xdcde('0x3c')](_0x2ae2c2[_0xdcde('0x39')]['fields']));_0x273078[_0xdcde('0x3d')]=_0x273078['attributes'][_0xdcde('0x4b')]?_0x273078[_0xdcde('0x3d')]:_0x38a4f5['model'];if(_0x2ae2c2[_0xdcde('0x39')]['includeAll']){_0x273078[_0xdcde('0x45')]=[{'all':!![]}];}_0x273078=_['merge']({},_0x273078,_0x2ae2c2[_0xdcde('0x4c')]);return db[_0xdcde('0x33')][_0xdcde('0x4d')](_0x273078)[_0xdcde('0x29')](handleEntityNotFound(_0x11e879,null))['then'](respondWithResult(_0x11e879,null))[_0xdcde('0x47')](handleError(_0x11e879,null));};exports[_0xdcde('0x4e')]=function(_0x23be15,_0x229442){return db[_0xdcde('0x33')][_0xdcde('0x4e')](_0x23be15[_0xdcde('0x4f')],{})[_0xdcde('0x29')](function(_0x503bb6){var _0x2452bd=_0x23be15[_0xdcde('0x50')][_0xdcde('0x2b')]({'plain':!![]});if(!_0x2452bd)throw new Error(_0xdcde('0x51'));if(_0x2452bd[_0xdcde('0x52')]==='user'){var _0x5045e0=_0x503bb6[_0xdcde('0x2b')]({'plain':!![]});var _0x217d84=_0xdcde('0x2c');return db[_0xdcde('0x53')][_0xdcde('0x4d')]({'where':{'name':_0x217d84,'userProfileId':_0x2452bd[_0xdcde('0x54')]},'raw':!![]})[_0xdcde('0x29')](function(_0x3dc3fb){if(_0x3dc3fb&&_0x3dc3fb[_0xdcde('0x55')]===0x0){return db['UserProfileResource'][_0xdcde('0x4e')]({'name':_0x5045e0[_0xdcde('0x2f')],'resourceId':_0x5045e0['id'],'type':_0x3dc3fb[_0xdcde('0x2f')],'sectionId':_0x3dc3fb['id']},{})[_0xdcde('0x29')](function(){return _0x503bb6;});}else{return _0x503bb6;}})[_0xdcde('0x47')](function(_0x3c4031){logger[_0xdcde('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3c4031);throw _0x3c4031;});}return _0x503bb6;})[_0xdcde('0x29')](respondWithResult(_0x229442,0xc9))[_0xdcde('0x47')](handleError(_0x229442,null));};exports[_0xdcde('0x28')]=function(_0x247436,_0x51c726){if(_0x247436[_0xdcde('0x4f')]['id']){delete _0x247436[_0xdcde('0x4f')]['id'];}return db[_0xdcde('0x33')][_0xdcde('0x4d')]({'where':{'id':_0x247436[_0xdcde('0x49')]['id']}})[_0xdcde('0x29')](handleEntityNotFound(_0x51c726,null))[_0xdcde('0x29')](saveUpdates(_0x247436[_0xdcde('0x4f')],null))[_0xdcde('0x29')](respondWithResult(_0x51c726,null))[_0xdcde('0x47')](handleError(_0x51c726,null));};exports[_0xdcde('0x2a')]=function(_0xf6218c,_0x45aa9f){return db[_0xdcde('0x33')]['find']({'where':{'id':_0xf6218c[_0xdcde('0x49')]['id']}})['then'](handleEntityNotFound(_0x45aa9f,null))[_0xdcde('0x29')](removeEntity(_0x45aa9f,null))[_0xdcde('0x47')](handleError(_0x45aa9f,null));};exports['describe']=function(_0x29eac7,_0x242466){return db[_0xdcde('0x33')][_0xdcde('0x56')]()[_0xdcde('0x29')](respondWithResult(_0x242466,null))[_0xdcde('0x47')](handleError(_0x242466,null));};exports[_0xdcde('0x57')]=function(_0x5e0224,_0x1186d1,_0x30de2e){var _0x8e5c1b={'raw':!![],'where':{}},_0x9be0b4={},_0x19f0be;return db[_0xdcde('0x33')][_0xdcde('0x58')]({'where':{'id':_0x5e0224[_0xdcde('0x49')]['id']}})[_0xdcde('0x29')](handleEntityNotFound(_0x1186d1,null))[_0xdcde('0x29')](function(_0x50e587){if(_0x50e587){_0x19f0be=_0x50e587[_0xdcde('0x2b')]({'plain':!![]});_0x9be0b4[_0xdcde('0x37')]=_[_0xdcde('0x38')](db[_0xdcde('0x59')]['rawAttributes']);_0x9be0b4[_0xdcde('0x39')]=_[_0xdcde('0x38')](_0x5e0224[_0xdcde('0x39')]);_0x9be0b4[_0xdcde('0x3a')]=_['intersection'](_0x9be0b4[_0xdcde('0x37')],_0x9be0b4[_0xdcde('0x39')]);_0x8e5c1b[_0xdcde('0x3d')]=_[_0xdcde('0x3b')](_0x9be0b4[_0xdcde('0x37')],qs[_0xdcde('0x3c')](_0x5e0224[_0xdcde('0x39')][_0xdcde('0x3c')]));_0x8e5c1b[_0xdcde('0x3d')]=_0x8e5c1b[_0xdcde('0x3d')][_0xdcde('0x4b')]?_0x8e5c1b[_0xdcde('0x3d')]:_0x9be0b4[_0xdcde('0x37')];if(!_0x5e0224[_0xdcde('0x39')]['hasOwnProperty'](_0xdcde('0x5a'))){_0x8e5c1b[_0xdcde('0x21')]=qs[_0xdcde('0x21')](_0x5e0224[_0xdcde('0x39')]['limit']);_0x8e5c1b['offset']=qs['offset'](_0x5e0224[_0xdcde('0x39')][_0xdcde('0x1f')]);}_0x8e5c1b[_0xdcde('0x5b')]=qs[_0xdcde('0x3f')](_0x5e0224[_0xdcde('0x39')][_0xdcde('0x3f')]);_0x8e5c1b[_0xdcde('0x42')]=qs['filters'](_['pick'](_0x5e0224['query'],_0x9be0b4[_0xdcde('0x3a')]));_0x8e5c1b[_0xdcde('0x42')][_0xdcde('0x5c')]=_0x50e587['id'];if(_0x5e0224['query'][_0xdcde('0x41')]){_0x8e5c1b['where']=_[_0xdcde('0x43')](_0x8e5c1b[_0xdcde('0x42')],{'$or':_['map'](_0x8e5c1b['attributes'],function(_0x422d55){var _0x19f90a={};_0x19f90a[_0x422d55]={'$like':'%'+_0x5e0224[_0xdcde('0x39')]['filter']+'%'};return _0x19f90a;})});}_0x8e5c1b=_['merge']({},_0x8e5c1b,_0x5e0224[_0xdcde('0x4c')]);return db['UserFaxQueue'][_0xdcde('0x5d')](_0x8e5c1b);}})[_0xdcde('0x29')](function(_0x1e493c){if(_0x1e493c){return db['User']['findAndCountAll']({'where':{'id':_[_0xdcde('0x32')](_0x1e493c,'UserId'),'role':_0xdcde('0x5e')},'attributes':['id','name','faxPause',_0xdcde('0x5f'),'createdAt']});}})[_0xdcde('0x29')](function(_0x47d9c2){if(_0x47d9c2){return{'count':_0x47d9c2[_0xdcde('0x22')],'rows':_['map'](_0x47d9c2[_0xdcde('0x46')],function(_0x2961a1){return{'membername':_0x2961a1['name'],'UserId':_0x2961a1['id'],'queue_name':_0x19f0be[_0xdcde('0x2f')],'FaxQueueId':_0x19f0be['id'],'interface':util[_0xdcde('0x60')](_0xdcde('0x61'),_0xdcde('0x62'),_0x2961a1[_0xdcde('0x2f')]),'penalty':0x0,'paused':_0x2961a1[_0xdcde('0x63')],'createdAt':_0x2961a1['createdAt'],'updatedAt':_0x2961a1[_0xdcde('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1186d1,_0x8e5c1b))[_0xdcde('0x47')](handleError(_0x1186d1,null));};exports[_0xdcde('0x64')]=function(_0x1c8c83,_0x15b95a,_0x2a54bd){var _0x5132db={};var _0x3cdbdc={};var _0x4b1c65;var _0x3ec42e;return db[_0xdcde('0x33')][_0xdcde('0x58')]({'where':{'id':_0x1c8c83[_0xdcde('0x49')]['id']}})[_0xdcde('0x29')](handleEntityNotFound(_0x15b95a,null))[_0xdcde('0x29')](function(_0x88fe8d){if(_0x88fe8d){_0x4b1c65=_0x88fe8d;_0x3cdbdc[_0xdcde('0x37')]=_['keys'](db[_0xdcde('0x65')][_0xdcde('0x4a')]);_0x3cdbdc[_0xdcde('0x39')]=_[_0xdcde('0x38')](_0x1c8c83[_0xdcde('0x39')]);_0x3cdbdc[_0xdcde('0x3a')]=_[_0xdcde('0x3b')](_0x3cdbdc['model'],_0x3cdbdc[_0xdcde('0x39')]);_0x5132db[_0xdcde('0x3d')]=_['intersection'](_0x3cdbdc[_0xdcde('0x37')],qs['fields'](_0x1c8c83[_0xdcde('0x39')]['fields']));_0x5132db[_0xdcde('0x3d')]=_0x5132db[_0xdcde('0x3d')][_0xdcde('0x4b')]?_0x5132db[_0xdcde('0x3d')]:_0x3cdbdc['model'];_0x5132db[_0xdcde('0x5b')]=qs['sort'](_0x1c8c83[_0xdcde('0x39')]['sort']);_0x5132db['where']=qs[_0xdcde('0x3a')](_[_0xdcde('0x40')](_0x1c8c83['query'],_0x3cdbdc[_0xdcde('0x3a')]));if(_0x1c8c83['query']['filter']){_0x5132db[_0xdcde('0x42')]=_[_0xdcde('0x43')](_0x5132db[_0xdcde('0x42')],{'$or':_[_0xdcde('0x32')](_0x5132db[_0xdcde('0x3d')],function(_0x5cc164){var _0x5256ed={};_0x5256ed[_0x5cc164]={'$like':'%'+_0x1c8c83[_0xdcde('0x39')][_0xdcde('0x41')]+'%'};return _0x5256ed;})});}_0x5132db=_[_0xdcde('0x43')]({},_0x5132db,_0x1c8c83[_0xdcde('0x4c')]);return _0x4b1c65[_0xdcde('0x64')](_0x5132db);}})[_0xdcde('0x29')](function(_0x31bd1b){if(_0x31bd1b){_0x3ec42e=_0x31bd1b[_0xdcde('0x4b')];if(!_0x1c8c83[_0xdcde('0x39')]['hasOwnProperty']('nolimit')){_0x5132db[_0xdcde('0x21')]=qs[_0xdcde('0x21')](_0x1c8c83[_0xdcde('0x39')]['limit']);_0x5132db[_0xdcde('0x1f')]=qs['offset'](_0x1c8c83[_0xdcde('0x39')][_0xdcde('0x1f')]);}return _0x4b1c65[_0xdcde('0x64')](_0x5132db);}})[_0xdcde('0x29')](function(_0x1317df){if(_0x1317df){return _0x1317df?{'count':_0x3ec42e,'rows':_0x1317df}:null;}})[_0xdcde('0x29')](respondWithResult(_0x15b95a,null))[_0xdcde('0x47')](handleError(_0x15b95a,null));};exports[_0xdcde('0x66')]=function(_0x45cb78,_0x126cd7,_0x3be76d){var _0x3889a9=_0x45cb78[_0xdcde('0x4f')][_0xdcde('0x67')];return db[_0xdcde('0x65')][_0xdcde('0x5d')]({'where':{'id':_0x3889a9},'attributes':['id'],'include':[{'model':db[_0xdcde('0x68')],'as':_0xdcde('0x69'),'attributes':['id',_0xdcde('0x2f'),'online',_0xdcde('0x6a'),'interface'],'raw':!![]}]})[_0xdcde('0x29')](function(_0x51b6d3){if(_0x51b6d3){var _0x4cc3f4=_[_0xdcde('0x6b')](_0x51b6d3,function(_0x85d8e6){var _0xb4e103=_0x85d8e6[_0xdcde('0x2b')]({'plain':!![]});return _0xb4e103[_0xdcde('0x69')];});return db[_0xdcde('0x33')][_0xdcde('0x4d')]({'where':{'id':_0x45cb78['params']['id']}})[_0xdcde('0x29')](function(_0x59b50c){return db[_0xdcde('0x6c')][_0xdcde('0x6d')](function(_0x4e68e6){return _0x59b50c['addTeams'](_0x3889a9,{'transaction':_0x4e68e6})[_0xdcde('0x29')](function(){return BPromise[_0xdcde('0x6e')](_0x4cc3f4,function(_0x299e90){return db['UserFaxQueue'][_0xdcde('0x6f')]({'where':{'UserId':_0x299e90['id'],'FaxQueueId':_0x45cb78[_0xdcde('0x49')]['id']},'transaction':_0x4e68e6});});})[_0xdcde('0x29')](function(){_0x4cc3f4['forEach'](function(_0x22c353){socket[_0xdcde('0x70')](_0xdcde('0x71'),{'UserId':_0x22c353['id'],'FaxQueueId':_0x59b50c['id']});});});});});}})['then'](respondWithStatusCode(_0x126cd7,null))['catch'](handleError(_0x126cd7,null));};exports[_0xdcde('0x72')]=function(_0x217427,_0x5399f6,_0x580e48){return db[_0xdcde('0x65')][_0xdcde('0x5d')]({'where':{'id':_0x217427['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xdcde('0x69'),'attributes':['id'],'raw':!![]}]})[_0xdcde('0x29')](handleEntityNotFound(_0x5399f6,null))[_0xdcde('0x29')](function(_0x4cab55){var _0x360cf9=_[_0xdcde('0x32')](_0x4cab55,'id');var _0x14bcd1=[];var _0x46f867=[];var _0x1c13c1=squel[_0xdcde('0x73')]();_0x1c13c1[_0xdcde('0x74')](_0xdcde('0x75'))[_0xdcde('0x76')](_0xdcde('0x77'),'tq')[_0xdcde('0x78')]('user_has_teams','ut',_0xdcde('0x79'))[_0xdcde('0x42')](_0xdcde('0x7a'),_0x217427[_0xdcde('0x49')]['id']);for(var _0x2f0b96=0x0;_0x2f0b96<_0x4cab55[_0xdcde('0x4b')];_0x2f0b96+=0x1){let _0x2756f0=_0x4cab55[_0x2f0b96];for(var _0x584afd=0x0;_0x584afd<_0x2756f0['Agents'][_0xdcde('0x4b')];_0x584afd+=0x1){let _0x3ca277=_0x2756f0['Agents'][_0x584afd];var _0xf4f84b=_0x1c13c1[_0xdcde('0x7b')]();_0xf4f84b[_0xdcde('0x42')](_0xdcde('0x7c'),_0x3ca277['id']);_0x46f867[_0xdcde('0x7d')](db[_0xdcde('0x6c')][_0xdcde('0x39')](_0xf4f84b[_0xdcde('0x7e')](),{'type':db[_0xdcde('0x6c')][_0xdcde('0x7f')][_0xdcde('0x80')]})[_0xdcde('0x29')](function(_0x18ca7e){if(_0x18ca7e['length']===0x1){return _0x3ca277['id'];}else{var _0x19667c=_[_0xdcde('0x81')](_['map'](_0x18ca7e,_0xdcde('0x82')),function(_0x1a199a){return _['includes'](_0x360cf9,_0x1a199a);});if(_0x19667c){return _0x3ca277['id'];}}}));}}return BPromise[_0xdcde('0x83')](_0x46f867)[_0xdcde('0x29')](function(_0x87ede1){_0x14bcd1=_(_0x14bcd1)[_0xdcde('0x84')](_0x87ede1)[_0xdcde('0x85')]()[_0xdcde('0x86')]();return db['FaxQueue']['find']({'where':{'id':_0x217427['params']['id']}})[_0xdcde('0x29')](function(_0x4ea890){return db[_0xdcde('0x6c')][_0xdcde('0x6d')](function(_0x5484f0){return _0x4ea890[_0xdcde('0x72')](_0x217427[_0xdcde('0x39')][_0xdcde('0x67')],{'transaction':_0x5484f0})[_0xdcde('0x29')](function(){if(!_[_0xdcde('0x87')](_0x14bcd1)){return _0x4ea890[_0xdcde('0x88')](_0x14bcd1,{'transaction':_0x5484f0});}})[_0xdcde('0x29')](function(){_0x14bcd1['forEach'](function(_0x47176b){socket['emit'](_0xdcde('0x89'),{'UserId':_0x47176b,'FaxQueueId':_0x4ea890['id']});});});});});});})[_0xdcde('0x29')](respondWithStatusCode(_0x5399f6,null))[_0xdcde('0x47')](handleError(_0x5399f6,null));};exports[_0xdcde('0x8a')]=function(_0x1753d1,_0x26fd80,_0x13d34f){return db[_0xdcde('0x33')][_0xdcde('0x4d')]({'where':{'id':_0x1753d1[_0xdcde('0x49')]['id']}})['then'](handleEntityNotFound(_0x26fd80,null))[_0xdcde('0x29')](function(_0x526814){if(_0x526814){return _0x526814['addAgents'](_0x1753d1['body'][_0xdcde('0x67')],_[_0xdcde('0x8b')](_0x1753d1['body'],[_0xdcde('0x67'),'id'])||{})[_0xdcde('0x8c')](function(_0x563d46){for(var _0x439e01=0x0;_0x439e01<_0x1753d1[_0xdcde('0x4f')][_0xdcde('0x67')]['length'];_0x439e01+=0x1){socket[_0xdcde('0x70')](_0xdcde('0x71'),{'UserId':Number(_0x1753d1[_0xdcde('0x4f')][_0xdcde('0x67')][_0x439e01]),'FaxQueueId':Number(_0x1753d1[_0xdcde('0x49')]['id'])});}return _0x563d46;});}})[_0xdcde('0x29')](respondWithResult(_0x26fd80,null))[_0xdcde('0x47')](handleError(_0x26fd80,null));};exports['removeAgents']=function(_0xf6fc0c,_0x153520,_0x17b317){return db['FaxQueue'][_0xdcde('0x4d')]({'where':{'id':_0xf6fc0c[_0xdcde('0x49')]['id']}})['then'](handleEntityNotFound(_0x153520,null))['then'](function(_0xbabaf4){if(_0xbabaf4){return _0xbabaf4[_0xdcde('0x88')](_0xf6fc0c[_0xdcde('0x39')][_0xdcde('0x67')])[_0xdcde('0x29')](function(){if(_[_0xdcde('0x8d')](_0xf6fc0c[_0xdcde('0x39')][_0xdcde('0x67')])){for(var _0x2fa602=0x0;_0x2fa602<_0xf6fc0c[_0xdcde('0x39')]['ids'][_0xdcde('0x4b')];_0x2fa602+=0x1){socket['emit'](_0xdcde('0x89'),{'UserId':Number(_0xf6fc0c['query']['ids'][_0x2fa602]),'FaxQueueId':Number(_0xf6fc0c[_0xdcde('0x49')]['id'])});}}else{socket[_0xdcde('0x70')](_0xdcde('0x89'),{'UserId':Number(_0xf6fc0c[_0xdcde('0x39')][_0xdcde('0x67')]),'FaxQueueId':Number(_0xf6fc0c['params']['id'])});}});}})[_0xdcde('0x29')](respondWithStatusCode(_0x153520,null))[_0xdcde('0x47')](handleError(_0x153520,null));};exports[_0xdcde('0x8e')]=function(_0x1a397d,_0x3c8e92,_0x227eb8){var _0x21b690={};var _0x3c3965={};var _0x5f4ff9;var _0x2aac67;return db['FaxQueue']['findOne']({'where':{'id':_0x1a397d[_0xdcde('0x49')]['id']}})[_0xdcde('0x29')](handleEntityNotFound(_0x3c8e92,null))[_0xdcde('0x29')](function(_0x54971c){if(_0x54971c){_0x5f4ff9=_0x54971c;_0x3c3965[_0xdcde('0x37')]=_[_0xdcde('0x38')](db['User'][_0xdcde('0x4a')]);_0x3c3965[_0xdcde('0x39')]=_[_0xdcde('0x38')](_0x1a397d[_0xdcde('0x39')]);_0x3c3965[_0xdcde('0x3a')]=_[_0xdcde('0x3b')](_0x3c3965[_0xdcde('0x37')],_0x3c3965['query']);_0x21b690[_0xdcde('0x3d')]=_[_0xdcde('0x3b')](_0x3c3965[_0xdcde('0x37')],qs['fields'](_0x1a397d['query'][_0xdcde('0x3c')]));_0x21b690[_0xdcde('0x3d')]=_0x21b690['attributes'][_0xdcde('0x4b')]?_0x21b690['attributes']:_0x3c3965[_0xdcde('0x37')];_0x21b690[_0xdcde('0x5b')]=qs[_0xdcde('0x3f')](_0x1a397d[_0xdcde('0x39')][_0xdcde('0x3f')]);_0x21b690[_0xdcde('0x42')]=qs[_0xdcde('0x3a')](_['pick'](_0x1a397d[_0xdcde('0x39')],_0x3c3965[_0xdcde('0x3a')]));if(_0x1a397d[_0xdcde('0x39')][_0xdcde('0x41')]){_0x21b690[_0xdcde('0x42')]=_[_0xdcde('0x43')](_0x21b690[_0xdcde('0x42')],{'$or':_[_0xdcde('0x32')](_0x21b690[_0xdcde('0x3d')],function(_0xaf3a47){var _0x12be43={};_0x12be43[_0xaf3a47]={'$like':'%'+_0x1a397d['query'][_0xdcde('0x41')]+'%'};return _0x12be43;})});}_0x21b690=_['merge']({},_0x21b690,_0x1a397d[_0xdcde('0x4c')]);return _0x5f4ff9['getAgents'](_0x21b690);}})[_0xdcde('0x29')](function(_0x33ef69){if(_0x33ef69){_0x2aac67=_0x33ef69[_0xdcde('0x4b')];if(!_0x1a397d['query'][_0xdcde('0x3e')]('nolimit')){_0x21b690[_0xdcde('0x21')]=qs['limit'](_0x1a397d[_0xdcde('0x39')]['limit']);_0x21b690[_0xdcde('0x1f')]=qs['offset'](_0x1a397d[_0xdcde('0x39')][_0xdcde('0x1f')]);}return _0x5f4ff9[_0xdcde('0x8e')](_0x21b690);}})['then'](function(_0x3646e2){if(_0x3646e2){return _0x3646e2?{'count':_0x2aac67,'rows':_0x3646e2}:null;}})[_0xdcde('0x29')](respondWithResult(_0x3c8e92,null))[_0xdcde('0x47')](handleError(_0x3c8e92,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 31ea41f..d592bad 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 _0xd59e=['save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','FaxQueue','setMaxListeners'];(function(_0x3ea477,_0x11f45d){var _0x1dee84=function(_0x149c31){while(--_0x149c31){_0x3ea477['push'](_0x3ea477['shift']());}};_0x1dee84(++_0x11f45d);}(_0xd59e,0xdd));var _0xed59=function(_0x3e0301,_0x5e8625){_0x3e0301=_0x3e0301-0x0;var _0x35e452=_0xd59e[_0x3e0301];return _0x35e452;};'use strict';var EventEmitter=require(_0xed59('0x0'));var FaxQueue=require(_0xed59('0x1'))['db'][_0xed59('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xed59('0x3')](0x0);var events={'afterCreate':_0xed59('0x4'),'afterUpdate':'update','afterDestroy':_0xed59('0x5')};function emitEvent(_0x51c350){return function(_0x229e6d,_0x24d485,_0x3411c6){FaxQueueEvents[_0xed59('0x6')](_0x51c350+':'+_0x229e6d['id'],_0x229e6d);FaxQueueEvents[_0xed59('0x6')](_0x51c350,_0x229e6d);_0x3411c6(null);};}for(var e in events){if(events[_0xed59('0x7')](e)){var event=events[e];FaxQueue[_0xed59('0x8')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0x6461=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxQueue','setMaxListeners','save'];(function(_0x57d13b,_0x52d8cb){var _0x467696=function(_0x153000){while(--_0x153000){_0x57d13b['push'](_0x57d13b['shift']());}};_0x467696(++_0x52d8cb);}(_0x6461,0x1d1));var _0x1646=function(_0x9938d2,_0x461cdb){_0x9938d2=_0x9938d2-0x0;var _0x1a5804=_0x6461[_0x9938d2];return _0x1a5804;};'use strict';var EventEmitter=require(_0x1646('0x0'));var FaxQueue=require(_0x1646('0x1'))['db'][_0x1646('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x1646('0x3')](0x0);var events={'afterCreate':_0x1646('0x4'),'afterUpdate':_0x1646('0x5'),'afterDestroy':'remove'};function emitEvent(_0x45580e){return function(_0x4248be,_0x380ef5,_0x1fc8c6){FaxQueueEvents[_0x1646('0x6')](_0x45580e+':'+_0x4248be['id'],_0x4248be);FaxQueueEvents[_0x1646('0x6')](_0x45580e,_0x4248be);_0x1fc8c6(null);};}for(var e in events){if(events[_0x1646('0x7')](e)){var event=events[e];FaxQueue[_0x1646('0x8')](e,emitEvent(event));}}module[_0x1646('0x9')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 7f1279f..0a20a2a 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 _0x7d41=['fax_queues','lodash','util','api','bluebird','path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue'];(function(_0x296923,_0x4d90e4){var _0x55d43c=function(_0xae2e3e){while(--_0xae2e3e){_0x296923['push'](_0x296923['shift']());}};_0x55d43c(++_0x4d90e4);}(_0x7d41,0x175));var _0x17d4=function(_0x2f0613,_0x296ec1){_0x2f0613=_0x2f0613-0x0;var _0x509cb7=_0x7d41[_0x2f0613];return _0x509cb7;};'use strict';var _=require(_0x17d4('0x0'));var util=require(_0x17d4('0x1'));var logger=require('../../config/logger')(_0x17d4('0x2'));var moment=require('moment');var BPromise=require(_0x17d4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x17d4('0x4'));var rimraf=require(_0x17d4('0x5'));var config=require(_0x17d4('0x6'));var attributes=require(_0x17d4('0x7'));module[_0x17d4('0x8')]=function(_0x217044,_0x4ebe80){return _0x217044[_0x17d4('0x9')](_0x17d4('0xa'),attributes,{'tableName':_0x17d4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa754=['path','../../config/environment','./faxQueue.attributes','exports','FaxQueue','fax_queues','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4989fe,_0x201e34){var _0x4afd24=function(_0x3bb870){while(--_0x3bb870){_0x4989fe['push'](_0x4989fe['shift']());}};_0x4afd24(++_0x201e34);}(_0xa754,0x192));var _0x4a75=function(_0x31eae6,_0x112161){_0x31eae6=_0x31eae6-0x0;var _0x192fa7=_0xa754[_0x31eae6];return _0x192fa7;};'use strict';var _=require('lodash');var util=require(_0x4a75('0x0'));var logger=require(_0x4a75('0x1'))(_0x4a75('0x2'));var moment=require(_0x4a75('0x3'));var BPromise=require(_0x4a75('0x4'));var rp=require(_0x4a75('0x5'));var fs=require('fs');var path=require(_0x4a75('0x6'));var rimraf=require('rimraf');var config=require(_0x4a75('0x7'));var attributes=require(_0x4a75('0x8'));module[_0x4a75('0x9')]=function(_0x16acda,_0x1cb64b){return _0x16acda['define'](_0x4a75('0xa'),attributes,{'tableName':_0x4a75('0xb'),'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 d3bb141..b67a2ec 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 _0xd65c=['request','then','FaxQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetFaxQueue','FaxQueue','options','raw','where','attributes','limit','include','model','map','debug','ShowFaxQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','register'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xd65c,0x96));var _0xcd65=function(_0x3950aa,_0x3b2aad){_0x3950aa=_0x3950aa-0x0;var _0x4ef637=_0xd65c[_0x3950aa];return _0x4ef637;};'use strict';var _=require(_0xcd65('0x0'));var util=require(_0xcd65('0x1'));var moment=require(_0xcd65('0x2'));var BPromise=require(_0xcd65('0x3'));var rs=require(_0xcd65('0x4'));var fs=require('fs');var Redis=require(_0xcd65('0x5'));var db=require(_0xcd65('0x6'))['db'];var utils=require(_0xcd65('0x7'));var logger=require(_0xcd65('0x8'))('rpc');var config=require(_0xcd65('0x9'));var jayson=require(_0xcd65('0xa'));var client=jayson['client'][_0xcd65('0xb')]({'port':0x232a});config['redis']=_[_0xcd65('0xc')](config[_0xcd65('0xd')],{'host':_0xcd65('0xe'),'port':0x18eb});var socket=require(_0xcd65('0xf'))(new Redis(config['redis']));require(_0xcd65('0x10'))[_0xcd65('0x11')](socket);function respondWithRpcPromise(_0x369db9,_0x2bb328,_0x57cdb0){return new BPromise(function(_0x2b92d1,_0x4f853b){return client[_0xcd65('0x12')](_0x369db9,_0x57cdb0)[_0xcd65('0x13')](function(_0x4a6ac0){logger['info'](_0xcd65('0x14'),_0x2bb328,_0xcd65('0x15'));logger['debug']('FaxQueue,\x20%s,\x20%s,\x20%s',_0x2bb328,'request\x20sent',JSON[_0xcd65('0x16')](_0x4a6ac0));if(_0x4a6ac0[_0xcd65('0x17')]){if(_0x4a6ac0[_0xcd65('0x17')][_0xcd65('0x18')]===0x1f4){logger[_0xcd65('0x17')](_0xcd65('0x14'),_0x2bb328,_0x4a6ac0[_0xcd65('0x17')][_0xcd65('0x19')]);return _0x4f853b(_0x4a6ac0[_0xcd65('0x17')][_0xcd65('0x19')]);}logger[_0xcd65('0x17')]('FaxQueue,\x20%s,\x20%s',_0x2bb328,_0x4a6ac0[_0xcd65('0x17')][_0xcd65('0x19')]);return _0x2b92d1(_0x4a6ac0[_0xcd65('0x17')][_0xcd65('0x19')]);}else{logger[_0xcd65('0x1a')](_0xcd65('0x14'),_0x2bb328,_0xcd65('0x15'));_0x2b92d1(_0x4a6ac0[_0xcd65('0x1b')][_0xcd65('0x19')]);}})[_0xcd65('0x1c')](function(_0x54381b){logger[_0xcd65('0x17')]('FaxQueue,\x20%s,\x20%s',_0x2bb328,_0x54381b);_0x4f853b(_0x54381b);});});}exports[_0xcd65('0x1d')]=function(_0xc0a3c){var _0x4a0edb=this;return new Promise(function(_0x193650,_0xe945db){return db[_0xcd65('0x1e')]['findAll']({'raw':_0xc0a3c[_0xcd65('0x1f')]?_0xc0a3c[_0xcd65('0x1f')][_0xcd65('0x20')]===undefined?!![]:![]:!![],'where':_0xc0a3c[_0xcd65('0x1f')]?_0xc0a3c[_0xcd65('0x1f')][_0xcd65('0x21')]||null:null,'attributes':_0xc0a3c[_0xcd65('0x1f')]?_0xc0a3c['options'][_0xcd65('0x22')]||null:null,'limit':_0xc0a3c['options']?_0xc0a3c[_0xcd65('0x1f')][_0xcd65('0x23')]||null:null,'include':_0xc0a3c[_0xcd65('0x1f')]?_0xc0a3c['options'][_0xcd65('0x24')]?_['map'](_0xc0a3c['options'][_0xcd65('0x24')],function(_0x10c1a6){return{'model':db[_0x10c1a6[_0xcd65('0x25')]],'as':_0x10c1a6['as'],'attributes':_0x10c1a6[_0xcd65('0x22')],'include':_0x10c1a6[_0xcd65('0x24')]?_[_0xcd65('0x26')](_0x10c1a6[_0xcd65('0x24')],function(_0x48dab3){return{'model':db[_0x48dab3['model']],'as':_0x48dab3['as'],'attributes':_0x48dab3[_0xcd65('0x22')],'include':_0x48dab3['include']?_[_0xcd65('0x26')](_0x48dab3[_0xcd65('0x24')],function(_0x3c9cf4){return{'model':db[_0x3c9cf4['model']],'as':_0x3c9cf4['as'],'attributes':_0x3c9cf4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2f6cb6){logger['info'](_0xcd65('0x1d'),_0xc0a3c);logger[_0xcd65('0x27')](_0xcd65('0x1d'),_0xc0a3c,JSON[_0xcd65('0x16')](_0x2f6cb6));_0x193650(_0x2f6cb6);})[_0xcd65('0x1c')](function(_0x361099){logger[_0xcd65('0x17')](_0xcd65('0x1d'),_0x361099['message'],_0xc0a3c);_0xe945db(_0x4a0edb[_0xcd65('0x17')](0x1f4,_0x361099['message']));});});};exports[_0xcd65('0x28')]=function(_0x4b3421){var _0xacb94b=this;return new Promise(function(_0x5f33c2,_0xa804dd){return db[_0xcd65('0x1e')][_0xcd65('0x29')]({'raw':_0x4b3421['options']?_0x4b3421[_0xcd65('0x1f')][_0xcd65('0x20')]===undefined?!![]:![]:!![],'where':_0x4b3421[_0xcd65('0x1f')]?_0x4b3421['options'][_0xcd65('0x21')]||null:null,'attributes':_0x4b3421['options']?_0x4b3421[_0xcd65('0x1f')][_0xcd65('0x22')]||null:null,'include':_0x4b3421['options']?_0x4b3421['options'][_0xcd65('0x24')]?_[_0xcd65('0x26')](_0x4b3421['options'][_0xcd65('0x24')],function(_0x19fc7d){return{'model':db[_0x19fc7d[_0xcd65('0x25')]],'as':_0x19fc7d['as'],'attributes':_0x19fc7d[_0xcd65('0x22')],'include':_0x19fc7d[_0xcd65('0x24')]?_[_0xcd65('0x26')](_0x19fc7d[_0xcd65('0x24')],function(_0x2ccd80){return{'model':db[_0x2ccd80[_0xcd65('0x25')]],'as':_0x2ccd80['as'],'attributes':_0x2ccd80['attributes'],'include':_0x2ccd80[_0xcd65('0x24')]?_[_0xcd65('0x26')](_0x2ccd80[_0xcd65('0x24')],function(_0x211077){return{'model':db[_0x211077[_0xcd65('0x25')]],'as':_0x211077['as'],'attributes':_0x211077['attributes']};}):[]};}):[]};}):[]:[]})[_0xcd65('0x13')](function(_0x2ee845){logger[_0xcd65('0x1a')]('ShowFaxQueue',_0x4b3421);logger['debug'](_0xcd65('0x28'),_0x4b3421,JSON[_0xcd65('0x16')](_0x2ee845));_0x5f33c2(_0x2ee845);})[_0xcd65('0x1c')](function(_0x3932f9){logger[_0xcd65('0x17')](_0xcd65('0x28'),_0x3932f9['message'],_0x4b3421);_0xa804dd(_0xacb94b[_0xcd65('0x17')](0x1f4,_0x3932f9[_0xcd65('0x19')]));});});}; \ No newline at end of file +var _0x9af3=['util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','FaxQueue','findAll','options','raw','attributes','limit','include','map','model','GetFaxQueue','debug','ShowFaxQueue','find','where','lodash'];(function(_0x57ae2d,_0x405530){var _0x3e5200=function(_0x4883e0){while(--_0x4883e0){_0x57ae2d['push'](_0x57ae2d['shift']());}};_0x3e5200(++_0x405530);}(_0x9af3,0x14f));var _0x39af=function(_0x4e9f60,_0xee66e5){_0x4e9f60=_0x4e9f60-0x0;var _0x444aa3=_0x9af3[_0x4e9f60];return _0x444aa3;};'use strict';var _=require(_0x39af('0x0'));var util=require(_0x39af('0x1'));var moment=require('moment');var BPromise=require(_0x39af('0x2'));var rs=require(_0x39af('0x3'));var fs=require('fs');var Redis=require(_0x39af('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x39af('0x5'));var logger=require('../../config/logger')(_0x39af('0x6'));var config=require(_0x39af('0x7'));var jayson=require(_0x39af('0x8'));var client=jayson[_0x39af('0x9')][_0x39af('0xa')]({'port':0x232a});config[_0x39af('0xb')]=_[_0x39af('0xc')](config['redis'],{'host':_0x39af('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x39af('0xb')]));require(_0x39af('0xe'))[_0x39af('0xf')](socket);function respondWithRpcPromise(_0x306261,_0xbbf7ff,_0x30db55){return new BPromise(function(_0x3b092f,_0x4c5c0a){return client[_0x39af('0x10')](_0x306261,_0x30db55)[_0x39af('0x11')](function(_0x276f54){logger[_0x39af('0x12')](_0x39af('0x13'),_0xbbf7ff,'request\x20sent');logger['debug'](_0x39af('0x14'),_0xbbf7ff,'request\x20sent',JSON[_0x39af('0x15')](_0x276f54));if(_0x276f54['error']){if(_0x276f54[_0x39af('0x16')][_0x39af('0x17')]===0x1f4){logger[_0x39af('0x16')]('FaxQueue,\x20%s,\x20%s',_0xbbf7ff,_0x276f54[_0x39af('0x16')]['message']);return _0x4c5c0a(_0x276f54[_0x39af('0x16')][_0x39af('0x18')]);}logger[_0x39af('0x16')](_0x39af('0x13'),_0xbbf7ff,_0x276f54['error'][_0x39af('0x18')]);return _0x3b092f(_0x276f54[_0x39af('0x16')][_0x39af('0x18')]);}else{logger['info'](_0x39af('0x13'),_0xbbf7ff,_0x39af('0x19'));_0x3b092f(_0x276f54[_0x39af('0x1a')][_0x39af('0x18')]);}})[_0x39af('0x1b')](function(_0x117894){logger['error'](_0x39af('0x13'),_0xbbf7ff,_0x117894);_0x4c5c0a(_0x117894);});});}exports['GetFaxQueue']=function(_0x138513){var _0x5f42a4=this;return new Promise(function(_0x10dd75,_0xd645){return db[_0x39af('0x1c')][_0x39af('0x1d')]({'raw':_0x138513[_0x39af('0x1e')]?_0x138513[_0x39af('0x1e')][_0x39af('0x1f')]===undefined?!![]:![]:!![],'where':_0x138513[_0x39af('0x1e')]?_0x138513[_0x39af('0x1e')]['where']||null:null,'attributes':_0x138513[_0x39af('0x1e')]?_0x138513['options'][_0x39af('0x20')]||null:null,'limit':_0x138513['options']?_0x138513['options'][_0x39af('0x21')]||null:null,'include':_0x138513[_0x39af('0x1e')]?_0x138513[_0x39af('0x1e')][_0x39af('0x22')]?_[_0x39af('0x23')](_0x138513[_0x39af('0x1e')][_0x39af('0x22')],function(_0x2dbd86){return{'model':db[_0x2dbd86[_0x39af('0x24')]],'as':_0x2dbd86['as'],'attributes':_0x2dbd86[_0x39af('0x20')],'include':_0x2dbd86[_0x39af('0x22')]?_['map'](_0x2dbd86['include'],function(_0x5b68d9){return{'model':db[_0x5b68d9[_0x39af('0x24')]],'as':_0x5b68d9['as'],'attributes':_0x5b68d9[_0x39af('0x20')],'include':_0x5b68d9[_0x39af('0x22')]?_['map'](_0x5b68d9[_0x39af('0x22')],function(_0x32603d){return{'model':db[_0x32603d[_0x39af('0x24')]],'as':_0x32603d['as'],'attributes':_0x32603d[_0x39af('0x20')]};}):[]};}):[]};}):[]:[]})[_0x39af('0x11')](function(_0xd97ff8){logger[_0x39af('0x12')](_0x39af('0x25'),_0x138513);logger[_0x39af('0x26')]('GetFaxQueue',_0x138513,JSON['stringify'](_0xd97ff8));_0x10dd75(_0xd97ff8);})[_0x39af('0x1b')](function(_0x562ab2){logger['error'](_0x39af('0x25'),_0x562ab2[_0x39af('0x18')],_0x138513);_0xd645(_0x5f42a4[_0x39af('0x16')](0x1f4,_0x562ab2['message']));});});};exports[_0x39af('0x27')]=function(_0x5b0a84){var _0x234cd5=this;return new Promise(function(_0x1079dc,_0x3b890c){return db['FaxQueue'][_0x39af('0x28')]({'raw':_0x5b0a84['options']?_0x5b0a84[_0x39af('0x1e')][_0x39af('0x1f')]===undefined?!![]:![]:!![],'where':_0x5b0a84[_0x39af('0x1e')]?_0x5b0a84[_0x39af('0x1e')][_0x39af('0x29')]||null:null,'attributes':_0x5b0a84['options']?_0x5b0a84['options'][_0x39af('0x20')]||null:null,'include':_0x5b0a84[_0x39af('0x1e')]?_0x5b0a84['options'][_0x39af('0x22')]?_[_0x39af('0x23')](_0x5b0a84[_0x39af('0x1e')][_0x39af('0x22')],function(_0x37d858){return{'model':db[_0x37d858[_0x39af('0x24')]],'as':_0x37d858['as'],'attributes':_0x37d858[_0x39af('0x20')],'include':_0x37d858[_0x39af('0x22')]?_[_0x39af('0x23')](_0x37d858[_0x39af('0x22')],function(_0x3548d9){return{'model':db[_0x3548d9[_0x39af('0x24')]],'as':_0x3548d9['as'],'attributes':_0x3548d9[_0x39af('0x20')],'include':_0x3548d9[_0x39af('0x22')]?_[_0x39af('0x23')](_0x3548d9[_0x39af('0x22')],function(_0x59e640){return{'model':db[_0x59e640['model']],'as':_0x59e640['as'],'attributes':_0x59e640[_0x39af('0x20')]};}):[]};}):[]};}):[]:[]})[_0x39af('0x11')](function(_0x44f6a7){logger[_0x39af('0x12')](_0x39af('0x27'),_0x5b0a84);logger['debug'](_0x39af('0x27'),_0x5b0a84,JSON[_0x39af('0x15')](_0x44f6a7));_0x1079dc(_0x44f6a7);})[_0x39af('0x1b')](function(_0xbd9a07){logger[_0x39af('0x16')]('ShowFaxQueue',_0xbd9a07[_0x39af('0x18')],_0x5b0a84);_0x3b890c(_0x234cd5[_0x39af('0x16')](0x1f4,_0xbd9a07[_0x39af('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 9626691..0b1435b 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 _0xc012=['emit','removeListener','register','length','./faxQueue.events','save','update'];(function(_0x4b6539,_0x28731f){var _0x590adb=function(_0x1671ce){while(--_0x1671ce){_0x4b6539['push'](_0x4b6539['shift']());}};_0x590adb(++_0x28731f);}(_0xc012,0x97));var _0x2c01=function(_0x208d6f,_0x576241){_0x208d6f=_0x208d6f-0x0;var _0x398bbf=_0xc012[_0x208d6f];return _0x398bbf;};'use strict';var FaxQueueEvents=require(_0x2c01('0x0'));var events=[_0x2c01('0x1'),'remove',_0x2c01('0x2')];function createListener(_0x380611,_0x1d9ab0){return function(_0x47f5e7){_0x1d9ab0[_0x2c01('0x3')](_0x380611,_0x47f5e7);};}function removeListener(_0x1c4465,_0xcd2e87){return function(){FaxQueueEvents[_0x2c01('0x4')](_0x1c4465,_0xcd2e87);};}exports[_0x2c01('0x5')]=function(_0x121886){for(var _0x1aede1=0x0,_0x3dcb89=events[_0x2c01('0x6')];_0x1aede1<_0x3dcb89;_0x1aede1++){var _0x281bf4=events[_0x1aede1];var _0x1f37ea=createListener('faxQueue:'+_0x281bf4,_0x121886);FaxQueueEvents['on'](_0x281bf4,_0x1f37ea);}}; \ No newline at end of file +var _0x3e38=['./faxQueue.events','save','update','emit','removeListener','register','length','faxQueue:'];(function(_0x108831,_0x5e4f70){var _0x4da77a=function(_0x139446){while(--_0x139446){_0x108831['push'](_0x108831['shift']());}};_0x4da77a(++_0x5e4f70);}(_0x3e38,0x68));var _0x83e3=function(_0x4f4d0e,_0x2b5535){_0x4f4d0e=_0x4f4d0e-0x0;var _0x1a8dd0=_0x3e38[_0x4f4d0e];return _0x1a8dd0;};'use strict';var FaxQueueEvents=require(_0x83e3('0x0'));var events=[_0x83e3('0x1'),'remove',_0x83e3('0x2')];function createListener(_0x4670a4,_0x35d0ee){return function(_0x47ece9){_0x35d0ee[_0x83e3('0x3')](_0x4670a4,_0x47ece9);};}function removeListener(_0x4cd376,_0x2fe3e8){return function(){FaxQueueEvents[_0x83e3('0x4')](_0x4cd376,_0x2fe3e8);};}exports[_0x83e3('0x5')]=function(_0x5cadbb){for(var _0x1a5030=0x0,_0x2f8480=events[_0x83e3('0x6')];_0x1a5030<_0x2f8480;_0x1a5030++){var _0x59a194=events[_0x1a5030];var _0x121de5=createListener(_0x83e3('0x7')+_0x59a194,_0x5cadbb);FaxQueueEvents['on'](_0x59a194,_0x121de5);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index a55225f..1fbdce7 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 _0xdbb1=['../../config/environment','./faxQueue.controller','index','get','/describe','isAuthenticated','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','delete','destroy','removeTeams','multer','express','../../components/auth/service'];(function(_0x3b57cb,_0x3a1d19){var _0x4a0dac=function(_0x13b9df){while(--_0x13b9df){_0x3b57cb['push'](_0x3b57cb['shift']());}};_0x4a0dac(++_0x3a1d19);}(_0xdbb1,0x105));var _0x1dbb=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xdbb1[_0x33032e];return _0x13316b;};'use strict';var multer=require(_0x1dbb('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1dbb('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1dbb('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x1dbb('0x3'));var controller=require(_0x1dbb('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0x1dbb('0x5')]);router[_0x1dbb('0x6')](_0x1dbb('0x7'),auth[_0x1dbb('0x8')](),controller['describe']);router[_0x1dbb('0x6')](_0x1dbb('0x9'),auth['isAuthenticated'](),controller[_0x1dbb('0xa')]);router[_0x1dbb('0x6')](_0x1dbb('0xb'),auth[_0x1dbb('0x8')](),controller[_0x1dbb('0xc')]);router[_0x1dbb('0x6')](_0x1dbb('0xd'),auth[_0x1dbb('0x8')](),controller[_0x1dbb('0xe')]);router[_0x1dbb('0x6')](_0x1dbb('0xf'),auth['isAuthenticated'](),controller[_0x1dbb('0x10')]);router[_0x1dbb('0x11')]('/',auth[_0x1dbb('0x8')](),controller[_0x1dbb('0x12')]);router['post']('/:id/teams',auth[_0x1dbb('0x8')](),controller[_0x1dbb('0x13')]);router[_0x1dbb('0x11')](_0x1dbb('0xf'),auth[_0x1dbb('0x8')](),controller['addAgents']);router[_0x1dbb('0x14')](_0x1dbb('0x9'),auth[_0x1dbb('0x8')](),controller['update']);router[_0x1dbb('0x15')](_0x1dbb('0x9'),auth['isAuthenticated'](),controller[_0x1dbb('0x16')]);router[_0x1dbb('0x15')](_0x1dbb('0xd'),auth[_0x1dbb('0x8')](),controller[_0x1dbb('0x17')]);router[_0x1dbb('0x15')](_0x1dbb('0xf'),auth[_0x1dbb('0x8')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xb016=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','/:id/members','/:id/teams','getTeams','/:id/users','post','create','/:id','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','express','fs-extra','../../components/auth/service'];(function(_0x5b0f5a,_0x229787){var _0x4c0a72=function(_0x1d6815){while(--_0x1d6815){_0x5b0f5a['push'](_0x5b0f5a['shift']());}};_0x4c0a72(++_0x229787);}(_0xb016,0x159));var _0x6b01=function(_0x24b81d,_0x3bfe61){_0x24b81d=_0x24b81d-0x0;var _0x20d9be=_0xb016[_0x24b81d];return _0x20d9be;};'use strict';var multer=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6b01('0x2'));var router=express['Router']();var fs_extra=require(_0x6b01('0x3'));var auth=require(_0x6b01('0x4'));var interaction=require(_0x6b01('0x5'));var config=require(_0x6b01('0x6'));var controller=require('./faxQueue.controller');router[_0x6b01('0x7')]('/',auth[_0x6b01('0x8')](),controller[_0x6b01('0x9')]);router['get']('/describe',auth[_0x6b01('0x8')](),controller[_0x6b01('0xa')]);router['get']('/:id',auth[_0x6b01('0x8')](),controller[_0x6b01('0xb')]);router[_0x6b01('0x7')](_0x6b01('0xc'),auth[_0x6b01('0x8')](),controller['getMembers']);router['get'](_0x6b01('0xd'),auth[_0x6b01('0x8')](),controller[_0x6b01('0xe')]);router['get'](_0x6b01('0xf'),auth['isAuthenticated'](),controller['getAgents']);router[_0x6b01('0x10')]('/',auth['isAuthenticated'](),controller[_0x6b01('0x11')]);router[_0x6b01('0x10')]('/:id/teams',auth[_0x6b01('0x8')](),controller['addTeams']);router['post']('/:id/users',auth[_0x6b01('0x8')](),controller['addAgents']);router['put'](_0x6b01('0x12'),auth[_0x6b01('0x8')](),controller[_0x6b01('0x13')]);router[_0x6b01('0x14')](_0x6b01('0x12'),auth[_0x6b01('0x8')](),controller[_0x6b01('0x15')]);router[_0x6b01('0x14')](_0x6b01('0xd'),auth[_0x6b01('0x8')](),controller[_0x6b01('0x16')]);router['delete'](_0x6b01('0xf'),auth[_0x6b01('0x8')](),controller[_0x6b01('0x17')]);module[_0x6b01('0x18')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 6c60ce8..8e203a8 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 _0xf811=['DATE','moment','STRING'];(function(_0x1ec0b1,_0x1b2c4c){var _0xb892fb=function(_0x650a99){while(--_0x650a99){_0x1ec0b1['push'](_0x1ec0b1['shift']());}};_0xb892fb(++_0x1b2c4c);}(_0xf811,0x1bd));var _0x1f81=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xf811[_0x33032e];return _0x13316b;};'use strict';var moment=require(_0x1f81('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x1f81('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x1f81('0x1')]},'joinAt':{'type':Sequelize[_0x1f81('0x2')]},'leaveAt':{'type':Sequelize[_0x1f81('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x1f81('0x2')]},'reason':{'type':Sequelize[_0x1f81('0x1')]}}; \ No newline at end of file +var _0x3339=['exports','STRING','DATE','moment','sequelize'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x3339,0x19d));var _0x9333=function(_0x2e5074,_0x4ee5ec){_0x2e5074=_0x2e5074-0x0;var _0x345dc3=_0x3339[_0x2e5074];return _0x345dc3;};'use strict';var moment=require(_0x9333('0x0'));var Sequelize=require(_0x9333('0x1'));module[_0x9333('0x2')]={'uniqueid':{'type':Sequelize[_0x9333('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x9333('0x4')]},'acceptAt':{'type':Sequelize[_0x9333('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x9333('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 4221a72..ed2366b 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 _0x9000=['model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','FaxQueueReport','includeAll','findAll','rows','catch','show','params','include','find','create','body','update','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','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','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','then','destroy','stack','name','index','map','rawAttributes','fieldName','key'];(function(_0x130210,_0x4abb54){var _0x1885a9=function(_0x46c5c4){while(--_0x46c5c4){_0x130210['push'](_0x130210['shift']());}};_0x1885a9(++_0x4abb54);}(_0x9000,0x19e));var _0x0900=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0x9000[_0x22b68a];return _0x1ac67a;};'use strict';var emlformat=require(_0x0900('0x0'));var rimraf=require(_0x0900('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0900('0x2'));var rp=require(_0x0900('0x3'));var moment=require(_0x0900('0x4'));var BPromise=require(_0x0900('0x5'));var Mustache=require(_0x0900('0x6'));var util=require(_0x0900('0x7'));var path=require(_0x0900('0x8'));var sox=require(_0x0900('0x9'));var csv=require(_0x0900('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0900('0xb'));var _=require('lodash');var squel=require(_0x0900('0xc'));var crypto=require(_0x0900('0xd'));var jsforce=require(_0x0900('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0900('0xf'));var Papa=require(_0x0900('0x10'));var Redis=require(_0x0900('0x11'));var authService=require(_0x0900('0x12'));var qs=require(_0x0900('0x13'));var as=require(_0x0900('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0900('0x15'))(_0x0900('0x16'));var utils=require(_0x0900('0x17'));var config=require(_0x0900('0x18'));var licenseUtil=require(_0x0900('0x19'));var db=require(_0x0900('0x1a'))['db'];function respondWithStatusCode(_0xe8ae24,_0x11d1b6){_0x11d1b6=_0x11d1b6||0xcc;return function(_0x3a235b){if(_0x3a235b){return _0xe8ae24[_0x0900('0x1b')](_0x11d1b6);}return _0xe8ae24['status'](_0x11d1b6)[_0x0900('0x1c')]();};}function respondWithResult(_0x183ca6,_0x4ea071){_0x4ea071=_0x4ea071||0xc8;return function(_0x52bb65){if(_0x52bb65){return _0x183ca6[_0x0900('0x1d')](_0x4ea071)['json'](_0x52bb65);}};}function respondWithFilteredResult(_0x3d58eb,_0x4f5eee){return function(_0x35dbd6){if(_0x35dbd6){var _0xb184b6=typeof _0x4f5eee[_0x0900('0x1e')]===_0x0900('0x1f')&&typeof _0x4f5eee['limit']==='undefined';var _0x2a6b91=_0x35dbd6[_0x0900('0x20')];var _0x3f09ee=_0xb184b6?0x0:_0x4f5eee[_0x0900('0x1e')];var _0x5bc7ec=_0xb184b6?_0x35dbd6[_0x0900('0x20')]:_0x4f5eee[_0x0900('0x1e')]+_0x4f5eee[_0x0900('0x21')];var _0x34968a;if(_0x5bc7ec>=_0x2a6b91){_0x5bc7ec=_0x2a6b91;_0x34968a=0xc8;}else{_0x34968a=0xce;}_0x3d58eb[_0x0900('0x1d')](_0x34968a);return _0x3d58eb[_0x0900('0x22')](_0x0900('0x23'),_0x3f09ee+'-'+_0x5bc7ec+'/'+_0x2a6b91)[_0x0900('0x24')](_0x35dbd6);}return null;};}function patchUpdates(_0x4de1d3){return function(_0x5ed4e8){try{jsonpatch[_0x0900('0x25')](_0x5ed4e8,_0x4de1d3,!![]);}catch(_0x5c54a9){return BPromise[_0x0900('0x26')](_0x5c54a9);}return _0x5ed4e8['save']();};}function saveUpdates(_0x41b74a,_0x1f3738){return function(_0x3dc6bc){if(_0x3dc6bc){return _0x3dc6bc['update'](_0x41b74a)[_0x0900('0x27')](function(_0x492a51){return _0x492a51;});}return null;};}function removeEntity(_0x2fd307,_0x369f5a){return function(_0xce8f6e){if(_0xce8f6e){return _0xce8f6e[_0x0900('0x28')]()[_0x0900('0x27')](function(){_0x2fd307[_0x0900('0x1d')](0xcc)[_0x0900('0x1c')]();});}};}function handleEntityNotFound(_0x51fe9f,_0x7b6765){return function(_0x34d63f){if(!_0x34d63f){_0x51fe9f[_0x0900('0x1b')](0x194);}return _0x34d63f;};}function handleError(_0x569856,_0x574307){_0x574307=_0x574307||0x1f4;return function(_0x51ee3a){logger['error'](_0x51ee3a[_0x0900('0x29')]);if(_0x51ee3a[_0x0900('0x2a')]){delete _0x51ee3a['name'];}_0x569856[_0x0900('0x1d')](_0x574307)['send'](_0x51ee3a);};}exports[_0x0900('0x2b')]=function(_0x13fa35,_0x2a8a71){var _0x257914={},_0x3fbd95={},_0x32afc5={'count':0x0,'rows':[]};var _0x50280f=_[_0x0900('0x2c')](db['FaxQueueReport'][_0x0900('0x2d')],function(_0x2d3ec4){return{'name':_0x2d3ec4[_0x0900('0x2e')],'type':_0x2d3ec4['type'][_0x0900('0x2f')]};});_0x3fbd95[_0x0900('0x30')]=_[_0x0900('0x2c')](_0x50280f,_0x0900('0x2a'));_0x3fbd95['query']=_[_0x0900('0x31')](_0x13fa35['query']);_0x3fbd95[_0x0900('0x32')]=_[_0x0900('0x33')](_0x3fbd95[_0x0900('0x30')],_0x3fbd95[_0x0900('0x34')]);_0x257914[_0x0900('0x35')]=_[_0x0900('0x33')](_0x3fbd95['model'],qs[_0x0900('0x36')](_0x13fa35[_0x0900('0x34')][_0x0900('0x36')]));_0x257914['attributes']=_0x257914[_0x0900('0x35')][_0x0900('0x37')]?_0x257914[_0x0900('0x35')]:_0x3fbd95[_0x0900('0x30')];if(!_0x13fa35[_0x0900('0x34')][_0x0900('0x38')](_0x0900('0x39'))){_0x257914[_0x0900('0x21')]=qs['limit'](_0x13fa35['query']['limit']);_0x257914[_0x0900('0x1e')]=qs[_0x0900('0x1e')](_0x13fa35[_0x0900('0x34')]['offset']);}_0x257914['order']=qs[_0x0900('0x3a')](_0x13fa35[_0x0900('0x34')][_0x0900('0x3a')]);_0x257914['where']=qs[_0x0900('0x32')](_[_0x0900('0x3b')](_0x13fa35[_0x0900('0x34')],_0x3fbd95[_0x0900('0x32')]),_0x50280f);if(_0x13fa35[_0x0900('0x34')][_0x0900('0x3c')]){_0x257914[_0x0900('0x3d')]=_[_0x0900('0x3e')](_0x257914[_0x0900('0x3d')],{'$or':_[_0x0900('0x2c')](_0x50280f,function(_0x565e5d){if(_0x565e5d['type']!=='VIRTUAL'){var _0x197e34={};_0x197e34[_0x565e5d[_0x0900('0x2a')]]={'$like':'%'+_0x13fa35[_0x0900('0x34')][_0x0900('0x3c')]+'%'};return _0x197e34;}})});}_0x257914=_[_0x0900('0x3e')]({},_0x257914,_0x13fa35[_0x0900('0x3f')]);var _0x345436={'where':_0x257914[_0x0900('0x3d')]};return db[_0x0900('0x40')][_0x0900('0x20')](_0x345436)[_0x0900('0x27')](function(_0x3f074a){_0x32afc5[_0x0900('0x20')]=_0x3f074a;if(_0x13fa35[_0x0900('0x34')][_0x0900('0x41')]){_0x257914['include']=[{'all':!![]}];}return db[_0x0900('0x40')][_0x0900('0x42')](_0x257914);})[_0x0900('0x27')](function(_0x36a90f){_0x32afc5[_0x0900('0x43')]=_0x36a90f;return _0x32afc5;})[_0x0900('0x27')](respondWithFilteredResult(_0x2a8a71,_0x257914))[_0x0900('0x44')](handleError(_0x2a8a71,null));};exports[_0x0900('0x45')]=function(_0x39995c,_0x96de65){var _0x26ad8f={'raw':!![],'where':{'id':_0x39995c[_0x0900('0x46')]['id']}},_0x4809cb={};_0x4809cb[_0x0900('0x30')]=_[_0x0900('0x31')](db[_0x0900('0x40')][_0x0900('0x2d')]);_0x4809cb[_0x0900('0x34')]=_['keys'](_0x39995c['query']);_0x4809cb[_0x0900('0x32')]=_[_0x0900('0x33')](_0x4809cb[_0x0900('0x30')],_0x4809cb[_0x0900('0x34')]);_0x26ad8f[_0x0900('0x35')]=_['intersection'](_0x4809cb['model'],qs[_0x0900('0x36')](_0x39995c[_0x0900('0x34')][_0x0900('0x36')]));_0x26ad8f[_0x0900('0x35')]=_0x26ad8f[_0x0900('0x35')][_0x0900('0x37')]?_0x26ad8f[_0x0900('0x35')]:_0x4809cb[_0x0900('0x30')];if(_0x39995c[_0x0900('0x34')][_0x0900('0x41')]){_0x26ad8f[_0x0900('0x47')]=[{'all':!![]}];}_0x26ad8f=_[_0x0900('0x3e')]({},_0x26ad8f,_0x39995c[_0x0900('0x3f')]);return db[_0x0900('0x40')][_0x0900('0x48')](_0x26ad8f)[_0x0900('0x27')](handleEntityNotFound(_0x96de65,null))['then'](respondWithResult(_0x96de65,null))['catch'](handleError(_0x96de65,null));};exports[_0x0900('0x49')]=function(_0x15849b,_0x11ad29){return db[_0x0900('0x40')][_0x0900('0x49')](_0x15849b[_0x0900('0x4a')],{})[_0x0900('0x27')](respondWithResult(_0x11ad29,0xc9))[_0x0900('0x44')](handleError(_0x11ad29,null));};exports[_0x0900('0x4b')]=function(_0x441417,_0x1df6a1){if(_0x441417[_0x0900('0x4a')]['id']){delete _0x441417[_0x0900('0x4a')]['id'];}return db['FaxQueueReport'][_0x0900('0x48')]({'where':{'id':_0x441417[_0x0900('0x46')]['id']}})['then'](handleEntityNotFound(_0x1df6a1,null))[_0x0900('0x27')](saveUpdates(_0x441417[_0x0900('0x4a')],null))['then'](respondWithResult(_0x1df6a1,null))[_0x0900('0x44')](handleError(_0x1df6a1,null));};exports['destroy']=function(_0x22fe67,_0x2a1390){return db[_0x0900('0x40')][_0x0900('0x48')]({'where':{'id':_0x22fe67[_0x0900('0x46')]['id']}})[_0x0900('0x27')](handleEntityNotFound(_0x2a1390,null))[_0x0900('0x27')](removeEntity(_0x2a1390,null))[_0x0900('0x44')](handleError(_0x2a1390,null));};exports[_0x0900('0x4c')]=function(_0x4fb007,_0x5c4676){return db[_0x0900('0x40')][_0x0900('0x4c')]()[_0x0900('0x27')](respondWithResult(_0x5c4676,null))[_0x0900('0x44')](handleError(_0x5c4676,null));}; \ No newline at end of file +var _0xd404=['update','then','destroy','error','stack','name','send','index','map','FaxQueueReport','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','findAll','rows','catch','params','rawAttributes','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x2504e1,_0x2aeb88){var _0x4d8b65=function(_0x2b3fca){while(--_0x2b3fca){_0x2504e1['push'](_0x2504e1['shift']());}};_0x4d8b65(++_0x2aeb88);}(_0xd404,0x15b));var _0x4d40=function(_0x115dd8,_0xd66e42){_0x115dd8=_0x115dd8-0x0;var _0x1d0477=_0xd404[_0x115dd8];return _0x1d0477;};'use strict';var emlformat=require(_0x4d40('0x0'));var rimraf=require(_0x4d40('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d40('0x2'));var rp=require(_0x4d40('0x3'));var moment=require('moment');var BPromise=require(_0x4d40('0x4'));var Mustache=require(_0x4d40('0x5'));var util=require(_0x4d40('0x6'));var path=require(_0x4d40('0x7'));var sox=require(_0x4d40('0x8'));var csv=require(_0x4d40('0x9'));var ejs=require(_0x4d40('0xa'));var fs=require('fs');var fs_extra=require(_0x4d40('0xb'));var _=require(_0x4d40('0xc'));var squel=require('squel');var crypto=require(_0x4d40('0xd'));var jsforce=require(_0x4d40('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4d40('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4d40('0xf'));var authService=require(_0x4d40('0x10'));var qs=require(_0x4d40('0x11'));var as=require(_0x4d40('0x12'));var hardwareService=require(_0x4d40('0x13'));var logger=require(_0x4d40('0x14'))(_0x4d40('0x15'));var utils=require(_0x4d40('0x16'));var config=require(_0x4d40('0x17'));var licenseUtil=require(_0x4d40('0x18'));var db=require(_0x4d40('0x19'))['db'];function respondWithStatusCode(_0x3c3b7e,_0x28e5bf){_0x28e5bf=_0x28e5bf||0xcc;return function(_0x42a621){if(_0x42a621){return _0x3c3b7e['sendStatus'](_0x28e5bf);}return _0x3c3b7e[_0x4d40('0x1a')](_0x28e5bf)[_0x4d40('0x1b')]();};}function respondWithResult(_0x3b071b,_0x2083bd){_0x2083bd=_0x2083bd||0xc8;return function(_0x477a91){if(_0x477a91){return _0x3b071b['status'](_0x2083bd)[_0x4d40('0x1c')](_0x477a91);}};}function respondWithFilteredResult(_0x4077ce,_0x20bc1b){return function(_0xcee25a){if(_0xcee25a){var _0x453857=typeof _0x20bc1b[_0x4d40('0x1d')]===_0x4d40('0x1e')&&typeof _0x20bc1b[_0x4d40('0x1f')]===_0x4d40('0x1e');var _0x4b5d23=_0xcee25a['count'];var _0x1ae5c7=_0x453857?0x0:_0x20bc1b[_0x4d40('0x1d')];var _0x4e505f=_0x453857?_0xcee25a[_0x4d40('0x20')]:_0x20bc1b[_0x4d40('0x1d')]+_0x20bc1b['limit'];var _0x36d031;if(_0x4e505f>=_0x4b5d23){_0x4e505f=_0x4b5d23;_0x36d031=0xc8;}else{_0x36d031=0xce;}_0x4077ce['status'](_0x36d031);return _0x4077ce[_0x4d40('0x21')](_0x4d40('0x22'),_0x1ae5c7+'-'+_0x4e505f+'/'+_0x4b5d23)['json'](_0xcee25a);}return null;};}function patchUpdates(_0x57c997){return function(_0x375ce0){try{jsonpatch[_0x4d40('0x23')](_0x375ce0,_0x57c997,!![]);}catch(_0x4d52ce){return BPromise[_0x4d40('0x24')](_0x4d52ce);}return _0x375ce0[_0x4d40('0x25')]();};}function saveUpdates(_0x30f058,_0x5d4c24){return function(_0x356fd6){if(_0x356fd6){return _0x356fd6[_0x4d40('0x26')](_0x30f058)[_0x4d40('0x27')](function(_0x5ca0a0){return _0x5ca0a0;});}return null;};}function removeEntity(_0x4eebc3,_0x2df33a){return function(_0x90b652){if(_0x90b652){return _0x90b652[_0x4d40('0x28')]()[_0x4d40('0x27')](function(){_0x4eebc3[_0x4d40('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xbcd540,_0x1f5e5b){return function(_0x560df8){if(!_0x560df8){_0xbcd540['sendStatus'](0x194);}return _0x560df8;};}function handleError(_0x274d44,_0x2a0c82){_0x2a0c82=_0x2a0c82||0x1f4;return function(_0x3fa83e){logger[_0x4d40('0x29')](_0x3fa83e[_0x4d40('0x2a')]);if(_0x3fa83e[_0x4d40('0x2b')]){delete _0x3fa83e[_0x4d40('0x2b')];}_0x274d44[_0x4d40('0x1a')](_0x2a0c82)[_0x4d40('0x2c')](_0x3fa83e);};}exports[_0x4d40('0x2d')]=function(_0x1c0fcf,_0x4ca431){var _0x4e4e61={},_0x52f706={},_0x158a86={'count':0x0,'rows':[]};var _0x350488=_[_0x4d40('0x2e')](db[_0x4d40('0x2f')]['rawAttributes'],function(_0x18e601){return{'name':_0x18e601[_0x4d40('0x30')],'type':_0x18e601[_0x4d40('0x31')]['key']};});_0x52f706[_0x4d40('0x32')]=_[_0x4d40('0x2e')](_0x350488,_0x4d40('0x2b'));_0x52f706[_0x4d40('0x33')]=_[_0x4d40('0x34')](_0x1c0fcf['query']);_0x52f706[_0x4d40('0x35')]=_['intersection'](_0x52f706[_0x4d40('0x32')],_0x52f706[_0x4d40('0x33')]);_0x4e4e61[_0x4d40('0x36')]=_[_0x4d40('0x37')](_0x52f706['model'],qs['fields'](_0x1c0fcf[_0x4d40('0x33')][_0x4d40('0x38')]));_0x4e4e61[_0x4d40('0x36')]=_0x4e4e61[_0x4d40('0x36')]['length']?_0x4e4e61[_0x4d40('0x36')]:_0x52f706['model'];if(!_0x1c0fcf[_0x4d40('0x33')][_0x4d40('0x39')](_0x4d40('0x3a'))){_0x4e4e61[_0x4d40('0x1f')]=qs[_0x4d40('0x1f')](_0x1c0fcf[_0x4d40('0x33')][_0x4d40('0x1f')]);_0x4e4e61[_0x4d40('0x1d')]=qs[_0x4d40('0x1d')](_0x1c0fcf[_0x4d40('0x33')]['offset']);}_0x4e4e61[_0x4d40('0x3b')]=qs[_0x4d40('0x3c')](_0x1c0fcf['query']['sort']);_0x4e4e61['where']=qs[_0x4d40('0x35')](_[_0x4d40('0x3d')](_0x1c0fcf['query'],_0x52f706[_0x4d40('0x35')]),_0x350488);if(_0x1c0fcf[_0x4d40('0x33')][_0x4d40('0x3e')]){_0x4e4e61[_0x4d40('0x3f')]=_[_0x4d40('0x40')](_0x4e4e61['where'],{'$or':_[_0x4d40('0x2e')](_0x350488,function(_0x21a4ec){if(_0x21a4ec['type']!=='VIRTUAL'){var _0x3a4924={};_0x3a4924[_0x21a4ec[_0x4d40('0x2b')]]={'$like':'%'+_0x1c0fcf['query'][_0x4d40('0x3e')]+'%'};return _0x3a4924;}})});}_0x4e4e61=_[_0x4d40('0x40')]({},_0x4e4e61,_0x1c0fcf['options']);var _0x1e8427={'where':_0x4e4e61[_0x4d40('0x3f')]};return db['FaxQueueReport'][_0x4d40('0x20')](_0x1e8427)[_0x4d40('0x27')](function(_0x4841ac){_0x158a86[_0x4d40('0x20')]=_0x4841ac;if(_0x1c0fcf['query'][_0x4d40('0x41')]){_0x4e4e61[_0x4d40('0x42')]=[{'all':!![]}];}return db[_0x4d40('0x2f')][_0x4d40('0x43')](_0x4e4e61);})[_0x4d40('0x27')](function(_0x2ef0ca){_0x158a86[_0x4d40('0x44')]=_0x2ef0ca;return _0x158a86;})[_0x4d40('0x27')](respondWithFilteredResult(_0x4ca431,_0x4e4e61))[_0x4d40('0x45')](handleError(_0x4ca431,null));};exports['show']=function(_0x250847,_0x3718a8){var _0x1c2fa8={'raw':!![],'where':{'id':_0x250847[_0x4d40('0x46')]['id']}},_0xcdde22={};_0xcdde22['model']=_[_0x4d40('0x34')](db['FaxQueueReport'][_0x4d40('0x47')]);_0xcdde22[_0x4d40('0x33')]=_[_0x4d40('0x34')](_0x250847[_0x4d40('0x33')]);_0xcdde22['filters']=_[_0x4d40('0x37')](_0xcdde22[_0x4d40('0x32')],_0xcdde22['query']);_0x1c2fa8[_0x4d40('0x36')]=_['intersection'](_0xcdde22[_0x4d40('0x32')],qs[_0x4d40('0x38')](_0x250847[_0x4d40('0x33')][_0x4d40('0x38')]));_0x1c2fa8['attributes']=_0x1c2fa8[_0x4d40('0x36')]['length']?_0x1c2fa8[_0x4d40('0x36')]:_0xcdde22[_0x4d40('0x32')];if(_0x250847[_0x4d40('0x33')][_0x4d40('0x41')]){_0x1c2fa8['include']=[{'all':!![]}];}_0x1c2fa8=_[_0x4d40('0x40')]({},_0x1c2fa8,_0x250847[_0x4d40('0x48')]);return db[_0x4d40('0x2f')][_0x4d40('0x49')](_0x1c2fa8)['then'](handleEntityNotFound(_0x3718a8,null))[_0x4d40('0x27')](respondWithResult(_0x3718a8,null))[_0x4d40('0x45')](handleError(_0x3718a8,null));};exports['create']=function(_0x200d29,_0x493d8e){return db[_0x4d40('0x2f')][_0x4d40('0x4a')](_0x200d29[_0x4d40('0x4b')],{})[_0x4d40('0x27')](respondWithResult(_0x493d8e,0xc9))[_0x4d40('0x45')](handleError(_0x493d8e,null));};exports[_0x4d40('0x26')]=function(_0x30be7b,_0x37b6bf){if(_0x30be7b[_0x4d40('0x4b')]['id']){delete _0x30be7b['body']['id'];}return db[_0x4d40('0x2f')][_0x4d40('0x49')]({'where':{'id':_0x30be7b[_0x4d40('0x46')]['id']}})[_0x4d40('0x27')](handleEntityNotFound(_0x37b6bf,null))[_0x4d40('0x27')](saveUpdates(_0x30be7b['body'],null))[_0x4d40('0x27')](respondWithResult(_0x37b6bf,null))[_0x4d40('0x45')](handleError(_0x37b6bf,null));};exports['destroy']=function(_0xdf0235,_0x48ffd7){return db[_0x4d40('0x2f')][_0x4d40('0x49')]({'where':{'id':_0xdf0235[_0x4d40('0x46')]['id']}})['then'](handleEntityNotFound(_0x48ffd7,null))[_0x4d40('0x27')](removeEntity(_0x48ffd7,null))[_0x4d40('0x45')](handleError(_0x48ffd7,null));};exports[_0x4d40('0x4c')]=function(_0x55df43,_0xd3e7cd){return db['FaxQueueReport'][_0x4d40('0x4c')]()[_0x4d40('0x27')](respondWithResult(_0xd3e7cd,null))['catch'](handleError(_0xd3e7cd,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 8c95ed2..eafc7dd 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 _0x1cb9=['api','moment','bluebird','path','rimraf','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','../../config/logger'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x1cb9,0x14e));var _0x91cb=function(_0x21a5ed,_0x1a3ca8){_0x21a5ed=_0x21a5ed-0x0;var _0x1e44d0=_0x1cb9[_0x21a5ed];return _0x1e44d0;};'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_fax_queue','paranoid':![],'indexes':[{'name':_0x91cb('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','util'];(function(_0x4664db,_0x1de672){var _0x5615b4=function(_0x54fb5a){while(--_0x54fb5a){_0x4664db['push'](_0x4664db['shift']());}};_0x5615b4(++_0x1de672);}(_0x814b,0x1a2));var _0xb814=function(_0x574159,_0x952110){_0x574159=_0x574159-0x0;var _0x5dd226=_0x814b[_0x574159];return _0x5dd226;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 69388d2..a72b2ae 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 _0xe97c=['where','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','FaxQueueReport','body','options','raw','CreateFaxQueueReport','UpdateFaxQueueReport','update'];(function(_0x2afb44,_0x249a57){var _0x15ccc2=function(_0x180748){while(--_0x180748){_0x2afb44['push'](_0x2afb44['shift']());}};_0x15ccc2(++_0x249a57);}(_0xe97c,0x118));var _0xce97=function(_0x492854,_0x20c19d){_0x492854=_0x492854-0x0;var _0x2960bb=_0xe97c[_0x492854];return _0x2960bb;};'use strict';var _=require(_0xce97('0x0'));var util=require(_0xce97('0x1'));var moment=require('moment');var BPromise=require(_0xce97('0x2'));var rs=require(_0xce97('0x3'));var fs=require('fs');var Redis=require(_0xce97('0x4'));var db=require(_0xce97('0x5'))['db'];var utils=require(_0xce97('0x6'));var logger=require('../../config/logger')(_0xce97('0x7'));var config=require(_0xce97('0x8'));var jayson=require(_0xce97('0x9'));var client=jayson[_0xce97('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ec8bd,_0x5e35b4,_0x3ee21b){return new BPromise(function(_0x1a4eae,_0x27fba1){return client[_0xce97('0xb')](_0x5ec8bd,_0x3ee21b)[_0xce97('0xc')](function(_0x344cfa){logger[_0xce97('0xd')](_0xce97('0xe'),_0x5e35b4,_0xce97('0xf'));logger[_0xce97('0x10')](_0xce97('0x11'),_0x5e35b4,_0xce97('0xf'),JSON[_0xce97('0x12')](_0x344cfa));if(_0x344cfa[_0xce97('0x13')]){if(_0x344cfa[_0xce97('0x13')]['code']===0x1f4){logger[_0xce97('0x13')](_0xce97('0xe'),_0x5e35b4,_0x344cfa['error'][_0xce97('0x14')]);return _0x27fba1(_0x344cfa['error'][_0xce97('0x14')]);}logger[_0xce97('0x13')](_0xce97('0xe'),_0x5e35b4,_0x344cfa[_0xce97('0x13')][_0xce97('0x14')]);return _0x1a4eae(_0x344cfa[_0xce97('0x13')][_0xce97('0x14')]);}else{logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x5e35b4,'request\x20sent');_0x1a4eae(_0x344cfa[_0xce97('0x15')][_0xce97('0x14')]);}})[_0xce97('0x16')](function(_0x4e4630){logger[_0xce97('0x13')](_0xce97('0xe'),_0x5e35b4,_0x4e4630);_0x27fba1(_0x4e4630);});});}exports['CreateFaxQueueReport']=function(_0x588036){var _0x2e072b=this;return new Promise(function(_0x4af6de,_0x8c2ea){return db[_0xce97('0x17')]['create'](_0x588036[_0xce97('0x18')],{'raw':_0x588036[_0xce97('0x19')]?_0x588036[_0xce97('0x19')][_0xce97('0x1a')]===undefined?!![]:![]:!![]})[_0xce97('0xc')](function(_0x4c51b8){logger[_0xce97('0xd')]('CreateFaxQueueReport',_0x588036);logger[_0xce97('0x10')](_0xce97('0x1b'),_0x588036,JSON['stringify'](_0x4c51b8));_0x4af6de(_0x4c51b8);})[_0xce97('0x16')](function(_0x2c2a85){logger['error'](_0xce97('0x1b'),_0x2c2a85[_0xce97('0x14')],_0x588036);_0x8c2ea(_0x2e072b[_0xce97('0x13')](0x1f4,_0x2c2a85['message']));});});};exports[_0xce97('0x1c')]=function(_0x5c8b0e){var _0x5a8a3e=this;return new Promise(function(_0x8817b4,_0xc435c5){return db[_0xce97('0x17')][_0xce97('0x1d')](_0x5c8b0e[_0xce97('0x18')],{'raw':_0x5c8b0e[_0xce97('0x19')]?_0x5c8b0e[_0xce97('0x19')][_0xce97('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c8b0e[_0xce97('0x19')]?_0x5c8b0e['options'][_0xce97('0x1e')]||null:null,'attributes':_0x5c8b0e[_0xce97('0x19')]?_0x5c8b0e[_0xce97('0x19')]['attributes']||null:null,'limit':_0x5c8b0e['options']?_0x5c8b0e[_0xce97('0x19')]['limit']||null:null})[_0xce97('0xc')](function(_0x14e5fc){logger[_0xce97('0xd')](_0xce97('0x1c'),_0x5c8b0e);logger[_0xce97('0x10')](_0xce97('0x1c'),_0x5c8b0e,JSON['stringify'](_0x14e5fc));_0x8817b4(_0x14e5fc);})[_0xce97('0x16')](function(_0x5c5af8){logger[_0xce97('0x13')](_0xce97('0x1c'),_0x5c5af8['message'],_0x5c8b0e);_0xc435c5(_0x5a8a3e['error'](0x1f4,_0x5c5af8[_0xce97('0x14')]));});});}; \ No newline at end of file +var _0x64eb=['FaxQueueReport','body','options','raw','catch','UpdateFaxQueueReport','update','where','attributes','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','debug','request\x20sent','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','result','CreateFaxQueueReport'];(function(_0x28a20a,_0x293a7a){var _0x3f4290=function(_0x351983){while(--_0x351983){_0x28a20a['push'](_0x28a20a['shift']());}};_0x3f4290(++_0x293a7a);}(_0x64eb,0x19c));var _0xb64e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x64eb[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xb64e('0x0'));var util=require(_0xb64e('0x1'));var moment=require('moment');var BPromise=require(_0xb64e('0x2'));var rs=require(_0xb64e('0x3'));var fs=require('fs');var Redis=require(_0xb64e('0x4'));var db=require(_0xb64e('0x5'))['db'];var utils=require(_0xb64e('0x6'));var logger=require(_0xb64e('0x7'))('rpc');var config=require(_0xb64e('0x8'));var jayson=require(_0xb64e('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x23422f,_0x2db78d,_0x4db29e){return new BPromise(function(_0x159d41,_0x204f81){return client[_0xb64e('0xa')](_0x23422f,_0x4db29e)[_0xb64e('0xb')](function(_0x48ce40){logger[_0xb64e('0xc')]('FaxQueueReport,\x20%s,\x20%s',_0x2db78d,'request\x20sent');logger[_0xb64e('0xd')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x2db78d,_0xb64e('0xe'),JSON[_0xb64e('0xf')](_0x48ce40));if(_0x48ce40[_0xb64e('0x10')]){if(_0x48ce40['error'][_0xb64e('0x11')]===0x1f4){logger[_0xb64e('0x10')](_0xb64e('0x12'),_0x2db78d,_0x48ce40[_0xb64e('0x10')][_0xb64e('0x13')]);return _0x204f81(_0x48ce40[_0xb64e('0x10')][_0xb64e('0x13')]);}logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x2db78d,_0x48ce40[_0xb64e('0x10')][_0xb64e('0x13')]);return _0x159d41(_0x48ce40['error'][_0xb64e('0x13')]);}else{logger[_0xb64e('0xc')](_0xb64e('0x12'),_0x2db78d,'request\x20sent');_0x159d41(_0x48ce40[_0xb64e('0x14')][_0xb64e('0x13')]);}})['catch'](function(_0x4c07c8){logger[_0xb64e('0x10')](_0xb64e('0x12'),_0x2db78d,_0x4c07c8);_0x204f81(_0x4c07c8);});});}exports[_0xb64e('0x15')]=function(_0xb1e034){var _0x5e5376=this;return new Promise(function(_0x789b1f,_0x4d3efe){return db[_0xb64e('0x16')]['create'](_0xb1e034[_0xb64e('0x17')],{'raw':_0xb1e034[_0xb64e('0x18')]?_0xb1e034[_0xb64e('0x18')][_0xb64e('0x19')]===undefined?!![]:![]:!![]})[_0xb64e('0xb')](function(_0xc35a16){logger['info'](_0xb64e('0x15'),_0xb1e034);logger[_0xb64e('0xd')]('CreateFaxQueueReport',_0xb1e034,JSON['stringify'](_0xc35a16));_0x789b1f(_0xc35a16);})[_0xb64e('0x1a')](function(_0x2be354){logger[_0xb64e('0x10')]('CreateFaxQueueReport',_0x2be354[_0xb64e('0x13')],_0xb1e034);_0x4d3efe(_0x5e5376[_0xb64e('0x10')](0x1f4,_0x2be354['message']));});});};exports[_0xb64e('0x1b')]=function(_0x37f311){var _0x36bc3f=this;return new Promise(function(_0x1af8a1,_0x28bb38){return db[_0xb64e('0x16')][_0xb64e('0x1c')](_0x37f311[_0xb64e('0x17')],{'raw':_0x37f311[_0xb64e('0x18')]?_0x37f311[_0xb64e('0x18')][_0xb64e('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37f311[_0xb64e('0x18')]?_0x37f311[_0xb64e('0x18')][_0xb64e('0x1d')]||null:null,'attributes':_0x37f311['options']?_0x37f311[_0xb64e('0x18')][_0xb64e('0x1e')]||null:null,'limit':_0x37f311[_0xb64e('0x18')]?_0x37f311['options']['limit']||null:null})['then'](function(_0x12223b){logger[_0xb64e('0xc')]('UpdateFaxQueueReport',_0x37f311);logger[_0xb64e('0xd')]('UpdateFaxQueueReport',_0x37f311,JSON[_0xb64e('0xf')](_0x12223b));_0x1af8a1(_0x12223b);})[_0xb64e('0x1a')](function(_0x55be0c){logger[_0xb64e('0x10')](_0xb64e('0x1b'),_0x55be0c[_0xb64e('0x13')],_0x37f311);_0x28bb38(_0x36bc3f[_0xb64e('0x10')](0x1f4,_0x55be0c[_0xb64e('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index c6268f9..63908b5 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 _0xa211=['isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','Router','../../config/environment','get'];(function(_0x2606e4,_0x3f2968){var _0x5c71b9=function(_0x180731){while(--_0x180731){_0x2606e4['push'](_0x2606e4['shift']());}};_0x5c71b9(++_0x3f2968);}(_0xa211,0x13d));var _0x1a21=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa211[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x1a21('0x0'));var util=require(_0x1a21('0x1'));var path=require(_0x1a21('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1a21('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1a21('0x4'));var controller=require('./faxQueueReport.controller');router[_0x1a21('0x5')]('/',auth[_0x1a21('0x6')](),controller[_0x1a21('0x7')]);router[_0x1a21('0x5')]('/describe',auth[_0x1a21('0x6')](),controller[_0x1a21('0x8')]);router[_0x1a21('0x5')](_0x1a21('0x9'),auth['isAuthenticated'](),controller[_0x1a21('0xa')]);router[_0x1a21('0xb')]('/',auth['isAuthenticated'](),controller[_0x1a21('0xc')]);router[_0x1a21('0xd')]('/:id',auth[_0x1a21('0x6')](),controller[_0x1a21('0xe')]);router[_0x1a21('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x1a21('0x10')]);module['exports']=router; \ No newline at end of file +var _0xc981=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id','show','create','put','update','delete','destroy','exports'];(function(_0x41ed42,_0x116eb5){var _0x35e608=function(_0x566bcb){while(--_0x566bcb){_0x41ed42['push'](_0x41ed42['shift']());}};_0x35e608(++_0x116eb5);}(_0xc981,0x8c));var _0x1c98=function(_0x3ca3b3,_0x52fb5c){_0x3ca3b3=_0x3ca3b3-0x0;var _0x482bd2=_0xc981[_0x3ca3b3];return _0x482bd2;};'use strict';var multer=require('multer');var util=require(_0x1c98('0x0'));var path=require(_0x1c98('0x1'));var timeout=require(_0x1c98('0x2'));var express=require(_0x1c98('0x3'));var router=express[_0x1c98('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1c98('0x5'));var interaction=require(_0x1c98('0x6'));var config=require(_0x1c98('0x7'));var controller=require('./faxQueueReport.controller');router[_0x1c98('0x8')]('/',auth['isAuthenticated'](),controller[_0x1c98('0x9')]);router['get']('/describe',auth[_0x1c98('0xa')](),controller[_0x1c98('0xb')]);router[_0x1c98('0x8')](_0x1c98('0xc'),auth[_0x1c98('0xa')](),controller[_0x1c98('0xd')]);router['post']('/',auth[_0x1c98('0xa')](),controller[_0x1c98('0xe')]);router[_0x1c98('0xf')](_0x1c98('0xc'),auth['isAuthenticated'](),controller[_0x1c98('0x10')]);router[_0x1c98('0x11')](_0x1c98('0xc'),auth[_0x1c98('0xa')](),controller[_0x1c98('0x12')]);module[_0x1c98('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index c392dc2..8e48405 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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x4c4f0b,_0x45825f){var _0x42e33b=function(_0x1df0f6){while(--_0x1df0f6){_0x4c4f0b['push'](_0x4c4f0b['shift']());}};_0x42e33b(++_0x45825f);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0xf3cd[_0x4bb66f];return _0xf2772f;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x4d51f8,_0x41f37d){var _0x251a66=function(_0x16df9c){while(--_0x16df9c){_0x4d51f8['push'](_0x4d51f8['shift']());}};_0x251a66(++_0x41f37d);}(_0xe706,0xa3));var _0x6e70=function(_0x1be67f,_0x2de2f3){_0x1be67f=_0x1be67f-0x0;var _0x2abef4=_0xe706[_0x1be67f];return _0x2abef4;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index dccc860..b8c429b 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 _0x6350=['to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','undefined','count','offset','limit','set','Content-Range','json','save','update','then','end','error','stack','name','send','FaxTransferReport','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','include','catch','show','includeAll','create','body','find','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js'];(function(_0x311ac9,_0x569191){var _0x3e772f=function(_0x338e8e){while(--_0x338e8e){_0x311ac9['push'](_0x311ac9['shift']());}};_0x3e772f(++_0x569191);}(_0x6350,0x115));var _0x0635=function(_0x2c079b,_0xf808fa){_0x2c079b=_0x2c079b-0x0;var _0x3b7846=_0x6350[_0x2c079b];return _0x3b7846;};'use strict';var emlformat=require(_0x0635('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0635('0x1'));var jsonpatch=require(_0x0635('0x2'));var rp=require(_0x0635('0x3'));var moment=require('moment');var BPromise=require(_0x0635('0x4'));var Mustache=require(_0x0635('0x5'));var util=require(_0x0635('0x6'));var path=require(_0x0635('0x7'));var sox=require(_0x0635('0x8'));var csv=require('to-csv');var ejs=require(_0x0635('0x9'));var fs=require('fs');var fs_extra=require(_0x0635('0xa'));var _=require(_0x0635('0xb'));var squel=require('squel');var crypto=require(_0x0635('0xc'));var jsforce=require(_0x0635('0xd'));var deskjs=require(_0x0635('0xe'));var toCsv=require(_0x0635('0xf'));var querystring=require(_0x0635('0x10'));var Papa=require(_0x0635('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0635('0x12'));var hardwareService=require(_0x0635('0x13'));var logger=require(_0x0635('0x14'))(_0x0635('0x15'));var utils=require(_0x0635('0x16'));var config=require(_0x0635('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0635('0x18'))['db'];function respondWithStatusCode(_0x27cf64,_0xe743fb){_0xe743fb=_0xe743fb||0xcc;return function(_0x3a9081){if(_0x3a9081){return _0x27cf64['sendStatus'](_0xe743fb);}return _0x27cf64[_0x0635('0x19')](_0xe743fb)['end']();};}function respondWithResult(_0x372a02,_0x54f663){_0x54f663=_0x54f663||0xc8;return function(_0x40a654){if(_0x40a654){return _0x372a02[_0x0635('0x19')](_0x54f663)['json'](_0x40a654);}};}function respondWithFilteredResult(_0x559095,_0x30913e){return function(_0x895ff2){if(_0x895ff2){var _0x36601b=typeof _0x30913e['offset']===_0x0635('0x1a')&&typeof _0x30913e['limit']===_0x0635('0x1a');var _0x2bfdd0=_0x895ff2[_0x0635('0x1b')];var _0x47b4e1=_0x36601b?0x0:_0x30913e[_0x0635('0x1c')];var _0x5328ff=_0x36601b?_0x895ff2[_0x0635('0x1b')]:_0x30913e[_0x0635('0x1c')]+_0x30913e[_0x0635('0x1d')];var _0x4c9361;if(_0x5328ff>=_0x2bfdd0){_0x5328ff=_0x2bfdd0;_0x4c9361=0xc8;}else{_0x4c9361=0xce;}_0x559095[_0x0635('0x19')](_0x4c9361);return _0x559095[_0x0635('0x1e')](_0x0635('0x1f'),_0x47b4e1+'-'+_0x5328ff+'/'+_0x2bfdd0)[_0x0635('0x20')](_0x895ff2);}return null;};}function patchUpdates(_0x476ae6){return function(_0x3c9846){try{jsonpatch['apply'](_0x3c9846,_0x476ae6,!![]);}catch(_0x29d295){return BPromise['reject'](_0x29d295);}return _0x3c9846[_0x0635('0x21')]();};}function saveUpdates(_0x448bc1,_0x3185e2){return function(_0x29af50){if(_0x29af50){return _0x29af50[_0x0635('0x22')](_0x448bc1)['then'](function(_0x24c9f7){return _0x24c9f7;});}return null;};}function removeEntity(_0x54fcda,_0x389b31){return function(_0x481dec){if(_0x481dec){return _0x481dec['destroy']()[_0x0635('0x23')](function(){_0x54fcda[_0x0635('0x19')](0xcc)[_0x0635('0x24')]();});}};}function handleEntityNotFound(_0x5c6a88,_0x37ab17){return function(_0x8eeac5){if(!_0x8eeac5){_0x5c6a88['sendStatus'](0x194);}return _0x8eeac5;};}function handleError(_0x286f51,_0x3c055a){_0x3c055a=_0x3c055a||0x1f4;return function(_0x24b64a){logger[_0x0635('0x25')](_0x24b64a[_0x0635('0x26')]);if(_0x24b64a['name']){delete _0x24b64a[_0x0635('0x27')];}_0x286f51[_0x0635('0x19')](_0x3c055a)[_0x0635('0x28')](_0x24b64a);};}exports['index']=function(_0x174a92,_0x5e7c70){var _0x31f9fc={},_0x20a99a={},_0x215a0d={'count':0x0,'rows':[]};var _0x352917=_['map'](db[_0x0635('0x29')][_0x0635('0x2a')],function(_0x146075){return{'name':_0x146075['fieldName'],'type':_0x146075['type'][_0x0635('0x2b')]};});_0x20a99a[_0x0635('0x2c')]=_['map'](_0x352917,'name');_0x20a99a['query']=_[_0x0635('0x2d')](_0x174a92[_0x0635('0x2e')]);_0x20a99a[_0x0635('0x2f')]=_[_0x0635('0x30')](_0x20a99a[_0x0635('0x2c')],_0x20a99a[_0x0635('0x2e')]);_0x31f9fc[_0x0635('0x31')]=_[_0x0635('0x30')](_0x20a99a[_0x0635('0x2c')],qs[_0x0635('0x32')](_0x174a92['query'][_0x0635('0x32')]));_0x31f9fc['attributes']=_0x31f9fc['attributes'][_0x0635('0x33')]?_0x31f9fc[_0x0635('0x31')]:_0x20a99a['model'];if(!_0x174a92['query'][_0x0635('0x34')](_0x0635('0x35'))){_0x31f9fc['limit']=qs['limit'](_0x174a92[_0x0635('0x2e')][_0x0635('0x1d')]);_0x31f9fc[_0x0635('0x1c')]=qs[_0x0635('0x1c')](_0x174a92[_0x0635('0x2e')]['offset']);}_0x31f9fc[_0x0635('0x36')]=qs[_0x0635('0x37')](_0x174a92[_0x0635('0x2e')][_0x0635('0x37')]);_0x31f9fc[_0x0635('0x38')]=qs['filters'](_[_0x0635('0x39')](_0x174a92[_0x0635('0x2e')],_0x20a99a[_0x0635('0x2f')]),_0x352917);if(_0x174a92['query'][_0x0635('0x3a')]){_0x31f9fc[_0x0635('0x38')]=_[_0x0635('0x3b')](_0x31f9fc['where'],{'$or':_[_0x0635('0x3c')](_0x352917,function(_0xed55a){if(_0xed55a[_0x0635('0x3d')]!==_0x0635('0x3e')){var _0x58984e={};_0x58984e[_0xed55a[_0x0635('0x27')]]={'$like':'%'+_0x174a92[_0x0635('0x2e')][_0x0635('0x3a')]+'%'};return _0x58984e;}})});}_0x31f9fc=_[_0x0635('0x3b')]({},_0x31f9fc,_0x174a92[_0x0635('0x3f')]);var _0x1a19e3={'where':_0x31f9fc['where']};return db[_0x0635('0x29')][_0x0635('0x1b')](_0x1a19e3)['then'](function(_0x17b941){_0x215a0d[_0x0635('0x1b')]=_0x17b941;if(_0x174a92['query']['includeAll']){_0x31f9fc[_0x0635('0x40')]=[{'all':!![]}];}return db['FaxTransferReport']['findAll'](_0x31f9fc);})[_0x0635('0x23')](function(_0xf08bac){_0x215a0d['rows']=_0xf08bac;return _0x215a0d;})[_0x0635('0x23')](respondWithFilteredResult(_0x5e7c70,_0x31f9fc))[_0x0635('0x41')](handleError(_0x5e7c70,null));};exports[_0x0635('0x42')]=function(_0x25b00d,_0x201338){var _0x5e702c={'raw':!![],'where':{'id':_0x25b00d['params']['id']}},_0x31d1c6={};_0x31d1c6[_0x0635('0x2c')]=_['keys'](db[_0x0635('0x29')][_0x0635('0x2a')]);_0x31d1c6[_0x0635('0x2e')]=_[_0x0635('0x2d')](_0x25b00d['query']);_0x31d1c6[_0x0635('0x2f')]=_[_0x0635('0x30')](_0x31d1c6[_0x0635('0x2c')],_0x31d1c6['query']);_0x5e702c[_0x0635('0x31')]=_['intersection'](_0x31d1c6[_0x0635('0x2c')],qs[_0x0635('0x32')](_0x25b00d[_0x0635('0x2e')]['fields']));_0x5e702c[_0x0635('0x31')]=_0x5e702c['attributes']['length']?_0x5e702c['attributes']:_0x31d1c6[_0x0635('0x2c')];if(_0x25b00d[_0x0635('0x2e')][_0x0635('0x43')]){_0x5e702c[_0x0635('0x40')]=[{'all':!![]}];}_0x5e702c=_[_0x0635('0x3b')]({},_0x5e702c,_0x25b00d[_0x0635('0x3f')]);return db[_0x0635('0x29')]['find'](_0x5e702c)[_0x0635('0x23')](handleEntityNotFound(_0x201338,null))[_0x0635('0x23')](respondWithResult(_0x201338,null))[_0x0635('0x41')](handleError(_0x201338,null));};exports['create']=function(_0x295b23,_0x30f45b){return db[_0x0635('0x29')][_0x0635('0x44')](_0x295b23[_0x0635('0x45')],{})['then'](respondWithResult(_0x30f45b,0xc9))[_0x0635('0x41')](handleError(_0x30f45b,null));};exports[_0x0635('0x22')]=function(_0x5cedb4,_0x4efa6d){if(_0x5cedb4[_0x0635('0x45')]['id']){delete _0x5cedb4['body']['id'];}return db[_0x0635('0x29')][_0x0635('0x46')]({'where':{'id':_0x5cedb4[_0x0635('0x47')]['id']}})['then'](handleEntityNotFound(_0x4efa6d,null))['then'](saveUpdates(_0x5cedb4[_0x0635('0x45')],null))[_0x0635('0x23')](respondWithResult(_0x4efa6d,null))[_0x0635('0x41')](handleError(_0x4efa6d,null));};exports['destroy']=function(_0x344e86,_0x73458b){return db['FaxTransferReport'][_0x0635('0x46')]({'where':{'id':_0x344e86['params']['id']}})[_0x0635('0x23')](handleEntityNotFound(_0x73458b,null))[_0x0635('0x23')](removeEntity(_0x73458b,null))[_0x0635('0x41')](handleError(_0x73458b,null));};exports[_0x0635('0x48')]=function(_0x2ef346,_0x3917ac){return db[_0x0635('0x29')][_0x0635('0x48')]()[_0x0635('0x23')](respondWithResult(_0x3917ac,null))[_0x0635('0x41')](handleError(_0x3917ac,null));}; \ No newline at end of file +var _0x4eb5=['sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','map','FaxTransferReport','rawAttributes','type','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','VIRTUAL','merge','includeAll','include','rows','params','keys','options','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4eb5,0x155));var _0x54eb=function(_0x283423,_0x9b9084){_0x283423=_0x283423-0x0;var _0x502e55=_0x4eb5[_0x283423];return _0x502e55;};'use strict';var emlformat=require(_0x54eb('0x0'));var rimraf=require(_0x54eb('0x1'));var zipdir=require(_0x54eb('0x2'));var jsonpatch=require(_0x54eb('0x3'));var rp=require('request-promise');var moment=require(_0x54eb('0x4'));var BPromise=require(_0x54eb('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x54eb('0x6'));var sox=require(_0x54eb('0x7'));var csv=require(_0x54eb('0x8'));var ejs=require(_0x54eb('0x9'));var fs=require('fs');var fs_extra=require(_0x54eb('0xa'));var _=require(_0x54eb('0xb'));var squel=require(_0x54eb('0xc'));var crypto=require(_0x54eb('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x54eb('0x8'));var querystring=require(_0x54eb('0xe'));var Papa=require(_0x54eb('0xf'));var Redis=require(_0x54eb('0x10'));var authService=require(_0x54eb('0x11'));var qs=require(_0x54eb('0x12'));var as=require(_0x54eb('0x13'));var hardwareService=require(_0x54eb('0x14'));var logger=require('../../config/logger')(_0x54eb('0x15'));var utils=require(_0x54eb('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x54eb('0x17'))['db'];function respondWithStatusCode(_0x5af5cb,_0x180032){_0x180032=_0x180032||0xcc;return function(_0x39ea6b){if(_0x39ea6b){return _0x5af5cb[_0x54eb('0x18')](_0x180032);}return _0x5af5cb[_0x54eb('0x19')](_0x180032)['end']();};}function respondWithResult(_0x2c65e0,_0x3fabc2){_0x3fabc2=_0x3fabc2||0xc8;return function(_0x2e84a3){if(_0x2e84a3){return _0x2c65e0[_0x54eb('0x19')](_0x3fabc2)[_0x54eb('0x1a')](_0x2e84a3);}};}function respondWithFilteredResult(_0x10765d,_0x4f51f1){return function(_0x4f99a9){if(_0x4f99a9){var _0x6954dc=typeof _0x4f51f1[_0x54eb('0x1b')]===_0x54eb('0x1c')&&typeof _0x4f51f1[_0x54eb('0x1d')]===_0x54eb('0x1c');var _0x184869=_0x4f99a9[_0x54eb('0x1e')];var _0x1813c8=_0x6954dc?0x0:_0x4f51f1[_0x54eb('0x1b')];var _0x365d0d=_0x6954dc?_0x4f99a9[_0x54eb('0x1e')]:_0x4f51f1[_0x54eb('0x1b')]+_0x4f51f1[_0x54eb('0x1d')];var _0x2a2b5f;if(_0x365d0d>=_0x184869){_0x365d0d=_0x184869;_0x2a2b5f=0xc8;}else{_0x2a2b5f=0xce;}_0x10765d[_0x54eb('0x19')](_0x2a2b5f);return _0x10765d[_0x54eb('0x1f')](_0x54eb('0x20'),_0x1813c8+'-'+_0x365d0d+'/'+_0x184869)[_0x54eb('0x1a')](_0x4f99a9);}return null;};}function patchUpdates(_0x9af41f){return function(_0x59a72b){try{jsonpatch[_0x54eb('0x21')](_0x59a72b,_0x9af41f,!![]);}catch(_0x4a2680){return BPromise[_0x54eb('0x22')](_0x4a2680);}return _0x59a72b[_0x54eb('0x23')]();};}function saveUpdates(_0x5846ec,_0x431f0d){return function(_0x23ad5e){if(_0x23ad5e){return _0x23ad5e[_0x54eb('0x24')](_0x5846ec)['then'](function(_0x3fb09c){return _0x3fb09c;});}return null;};}function removeEntity(_0x55e122,_0x34e406){return function(_0x44d07c){if(_0x44d07c){return _0x44d07c[_0x54eb('0x25')]()[_0x54eb('0x26')](function(){_0x55e122[_0x54eb('0x19')](0xcc)[_0x54eb('0x27')]();});}};}function handleEntityNotFound(_0x38af40,_0xbc45be){return function(_0x3fccec){if(!_0x3fccec){_0x38af40[_0x54eb('0x18')](0x194);}return _0x3fccec;};}function handleError(_0x17e276,_0x37026f){_0x37026f=_0x37026f||0x1f4;return function(_0x7b462){logger[_0x54eb('0x28')](_0x7b462[_0x54eb('0x29')]);if(_0x7b462[_0x54eb('0x2a')]){delete _0x7b462['name'];}_0x17e276[_0x54eb('0x19')](_0x37026f)[_0x54eb('0x2b')](_0x7b462);};}exports[_0x54eb('0x2c')]=function(_0x28d3d9,_0x44f068){var _0x10edc8={},_0x5d1d35={},_0x485960={'count':0x0,'rows':[]};var _0x32c85e=_[_0x54eb('0x2d')](db[_0x54eb('0x2e')][_0x54eb('0x2f')],function(_0x393b6b){return{'name':_0x393b6b['fieldName'],'type':_0x393b6b[_0x54eb('0x30')]['key']};});_0x5d1d35[_0x54eb('0x31')]=_[_0x54eb('0x2d')](_0x32c85e,_0x54eb('0x2a'));_0x5d1d35[_0x54eb('0x32')]=_['keys'](_0x28d3d9['query']);_0x5d1d35[_0x54eb('0x33')]=_['intersection'](_0x5d1d35[_0x54eb('0x31')],_0x5d1d35['query']);_0x10edc8[_0x54eb('0x34')]=_[_0x54eb('0x35')](_0x5d1d35['model'],qs[_0x54eb('0x36')](_0x28d3d9[_0x54eb('0x32')][_0x54eb('0x36')]));_0x10edc8[_0x54eb('0x34')]=_0x10edc8[_0x54eb('0x34')][_0x54eb('0x37')]?_0x10edc8['attributes']:_0x5d1d35[_0x54eb('0x31')];if(!_0x28d3d9[_0x54eb('0x32')]['hasOwnProperty'](_0x54eb('0x38'))){_0x10edc8['limit']=qs['limit'](_0x28d3d9[_0x54eb('0x32')]['limit']);_0x10edc8[_0x54eb('0x1b')]=qs['offset'](_0x28d3d9[_0x54eb('0x32')][_0x54eb('0x1b')]);}_0x10edc8[_0x54eb('0x39')]=qs[_0x54eb('0x3a')](_0x28d3d9[_0x54eb('0x32')][_0x54eb('0x3a')]);_0x10edc8[_0x54eb('0x3b')]=qs[_0x54eb('0x33')](_['pick'](_0x28d3d9[_0x54eb('0x32')],_0x5d1d35[_0x54eb('0x33')]),_0x32c85e);if(_0x28d3d9['query'][_0x54eb('0x3c')]){_0x10edc8[_0x54eb('0x3b')]=_['merge'](_0x10edc8[_0x54eb('0x3b')],{'$or':_[_0x54eb('0x2d')](_0x32c85e,function(_0x3304a3){if(_0x3304a3[_0x54eb('0x30')]!==_0x54eb('0x3d')){var _0x41b176={};_0x41b176[_0x3304a3['name']]={'$like':'%'+_0x28d3d9['query']['filter']+'%'};return _0x41b176;}})});}_0x10edc8=_[_0x54eb('0x3e')]({},_0x10edc8,_0x28d3d9['options']);var _0x4570e4={'where':_0x10edc8[_0x54eb('0x3b')]};return db['FaxTransferReport']['count'](_0x4570e4)[_0x54eb('0x26')](function(_0x228c3b){_0x485960['count']=_0x228c3b;if(_0x28d3d9['query'][_0x54eb('0x3f')]){_0x10edc8[_0x54eb('0x40')]=[{'all':!![]}];}return db[_0x54eb('0x2e')]['findAll'](_0x10edc8);})[_0x54eb('0x26')](function(_0x3ee8cd){_0x485960[_0x54eb('0x41')]=_0x3ee8cd;return _0x485960;})[_0x54eb('0x26')](respondWithFilteredResult(_0x44f068,_0x10edc8))['catch'](handleError(_0x44f068,null));};exports['show']=function(_0x2fec90,_0xf86fc0){var _0x1d6d0e={'raw':!![],'where':{'id':_0x2fec90[_0x54eb('0x42')]['id']}},_0x8b58a4={};_0x8b58a4['model']=_[_0x54eb('0x43')](db[_0x54eb('0x2e')][_0x54eb('0x2f')]);_0x8b58a4[_0x54eb('0x32')]=_[_0x54eb('0x43')](_0x2fec90['query']);_0x8b58a4['filters']=_['intersection'](_0x8b58a4[_0x54eb('0x31')],_0x8b58a4[_0x54eb('0x32')]);_0x1d6d0e['attributes']=_[_0x54eb('0x35')](_0x8b58a4[_0x54eb('0x31')],qs['fields'](_0x2fec90[_0x54eb('0x32')]['fields']));_0x1d6d0e[_0x54eb('0x34')]=_0x1d6d0e[_0x54eb('0x34')][_0x54eb('0x37')]?_0x1d6d0e[_0x54eb('0x34')]:_0x8b58a4[_0x54eb('0x31')];if(_0x2fec90[_0x54eb('0x32')][_0x54eb('0x3f')]){_0x1d6d0e[_0x54eb('0x40')]=[{'all':!![]}];}_0x1d6d0e=_[_0x54eb('0x3e')]({},_0x1d6d0e,_0x2fec90[_0x54eb('0x44')]);return db[_0x54eb('0x2e')][_0x54eb('0x45')](_0x1d6d0e)['then'](handleEntityNotFound(_0xf86fc0,null))['then'](respondWithResult(_0xf86fc0,null))['catch'](handleError(_0xf86fc0,null));};exports[_0x54eb('0x46')]=function(_0x265b04,_0x2c766b){return db[_0x54eb('0x2e')][_0x54eb('0x46')](_0x265b04[_0x54eb('0x47')],{})[_0x54eb('0x26')](respondWithResult(_0x2c766b,0xc9))[_0x54eb('0x48')](handleError(_0x2c766b,null));};exports['update']=function(_0x4315c1,_0x29ffe8){if(_0x4315c1['body']['id']){delete _0x4315c1['body']['id'];}return db[_0x54eb('0x2e')][_0x54eb('0x45')]({'where':{'id':_0x4315c1[_0x54eb('0x42')]['id']}})[_0x54eb('0x26')](handleEntityNotFound(_0x29ffe8,null))[_0x54eb('0x26')](saveUpdates(_0x4315c1[_0x54eb('0x47')],null))[_0x54eb('0x26')](respondWithResult(_0x29ffe8,null))['catch'](handleError(_0x29ffe8,null));};exports[_0x54eb('0x25')]=function(_0x3a114a,_0x1e0a0a){return db['FaxTransferReport']['find']({'where':{'id':_0x3a114a[_0x54eb('0x42')]['id']}})[_0x54eb('0x26')](handleEntityNotFound(_0x1e0a0a,null))[_0x54eb('0x26')](removeEntity(_0x1e0a0a,null))['catch'](handleError(_0x1e0a0a,null));};exports['describe']=function(_0x3bee78,_0x1b27e2){return db[_0x54eb('0x2e')]['describe']()['then'](respondWithResult(_0x1b27e2,null))['catch'](handleError(_0x1b27e2,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index bd7701b..a3c34a7 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 _0xf0ef=['rimraf','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x3b42e7,_0x36ab9e){var _0x2d6c7b=function(_0x354130){while(--_0x354130){_0x3b42e7['push'](_0x3b42e7['shift']());}};_0x2d6c7b(++_0x36ab9e);}(_0xf0ef,0x173));var _0xff0e=function(_0x183d0e,_0x1f520f){_0x183d0e=_0x183d0e-0x0;var _0x278ff8=_0xf0ef[_0x183d0e];return _0x278ff8;};'use strict';var _=require(_0xff0e('0x0'));var util=require(_0xff0e('0x1'));var logger=require(_0xff0e('0x2'))('api');var moment=require(_0xff0e('0x3'));var BPromise=require(_0xff0e('0x4'));var rp=require(_0xff0e('0x5'));var fs=require('fs');var path=require(_0xff0e('0x6'));var rimraf=require(_0xff0e('0x7'));var config=require('../../config/environment');var attributes=require(_0xff0e('0x8'));module[_0xff0e('0x9')]=function(_0x2ec250,_0x194544){return _0x2ec250[_0xff0e('0xa')](_0xff0e('0xb'),attributes,{'tableName':_0xff0e('0xc'),'paranoid':![],'indexes':[{'name':_0xff0e('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x391f=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util'];(function(_0x8e4022,_0x2c6987){var _0xcde5db=function(_0x57c2ec){while(--_0x57c2ec){_0x8e4022['push'](_0x8e4022['shift']());}};_0xcde5db(++_0x2c6987);}(_0x391f,0x10c));var _0xf391=function(_0x53f955,_0x4d8f15){_0x53f955=_0x53f955-0x0;var _0x3cd9c6=_0x391f[_0x53f955];return _0x3cd9c6;};'use strict';var _=require(_0xf391('0x0'));var util=require(_0xf391('0x1'));var logger=require(_0xf391('0x2'))(_0xf391('0x3'));var moment=require(_0xf391('0x4'));var BPromise=require(_0xf391('0x5'));var rp=require(_0xf391('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf391('0x7'));var config=require(_0xf391('0x8'));var attributes=require(_0xf391('0x9'));module[_0xf391('0xa')]=function(_0x2c9be6,_0x5885e7){return _0x2c9be6[_0xf391('0xb')](_0xf391('0xc'),attributes,{'tableName':_0xf391('0xd'),'paranoid':![],'indexes':[{'name':_0xf391('0xe'),'fields':[_0xf391('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 8c1898e..f7e4971 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 _0x5525=['util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash'];(function(_0x56647c,_0x4d76a9){var _0x48c549=function(_0x4f3f2d){while(--_0x4f3f2d){_0x56647c['push'](_0x56647c['shift']());}};_0x48c549(++_0x4d76a9);}(_0x5525,0xf1));var _0x5552=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x5525[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x5552('0x0'));var util=require(_0x5552('0x1'));var moment=require('moment');var BPromise=require(_0x5552('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5552('0x3'));var db=require(_0x5552('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5552('0x5'))(_0x5552('0x6'));var config=require(_0x5552('0x7'));var jayson=require(_0x5552('0x8'));var client=jayson[_0x5552('0x9')][_0x5552('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x825ee0,_0x1ac984,_0x422be7){return new BPromise(function(_0x42adf7,_0x367e8){return client[_0x5552('0xb')](_0x825ee0,_0x422be7)[_0x5552('0xc')](function(_0x267cbb){logger[_0x5552('0xd')](_0x5552('0xe'),_0x1ac984,_0x5552('0xf'));logger[_0x5552('0x10')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x1ac984,_0x5552('0xf'),JSON[_0x5552('0x11')](_0x267cbb));if(_0x267cbb[_0x5552('0x12')]){if(_0x267cbb['error'][_0x5552('0x13')]===0x1f4){logger[_0x5552('0x12')](_0x5552('0xe'),_0x1ac984,_0x267cbb[_0x5552('0x12')]['message']);return _0x367e8(_0x267cbb[_0x5552('0x12')]['message']);}logger['error'](_0x5552('0xe'),_0x1ac984,_0x267cbb['error'][_0x5552('0x14')]);return _0x42adf7(_0x267cbb[_0x5552('0x12')][_0x5552('0x14')]);}else{logger[_0x5552('0xd')](_0x5552('0xe'),_0x1ac984,_0x5552('0xf'));_0x42adf7(_0x267cbb['result']['message']);}})[_0x5552('0x15')](function(_0x728d05){logger['error'](_0x5552('0xe'),_0x1ac984,_0x728d05);_0x367e8(_0x728d05);});});} \ No newline at end of file +var _0xbdd8=['info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x122bec,_0x39a551){var _0x507605=function(_0x157e38){while(--_0x157e38){_0x122bec['push'](_0x122bec['shift']());}};_0x507605(++_0x39a551);}(_0xbdd8,0xb8));var _0x8bdd=function(_0x92b20f,_0x165faa){_0x92b20f=_0x92b20f-0x0;var _0x5ea366=_0xbdd8[_0x92b20f];return _0x5ea366;};'use strict';var _=require(_0x8bdd('0x0'));var util=require(_0x8bdd('0x1'));var moment=require(_0x8bdd('0x2'));var BPromise=require(_0x8bdd('0x3'));var rs=require(_0x8bdd('0x4'));var fs=require('fs');var Redis=require(_0x8bdd('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8bdd('0x6'));var logger=require(_0x8bdd('0x7'))('rpc');var config=require(_0x8bdd('0x8'));var jayson=require(_0x8bdd('0x9'));var client=jayson[_0x8bdd('0xa')][_0x8bdd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x749171,_0x2831b7,_0x52450c){return new BPromise(function(_0x4da90d,_0x575c81){return client[_0x8bdd('0xc')](_0x749171,_0x52450c)[_0x8bdd('0xd')](function(_0x3ad0e4){logger[_0x8bdd('0xe')](_0x8bdd('0xf'),_0x2831b7,_0x8bdd('0x10'));logger[_0x8bdd('0x11')](_0x8bdd('0x12'),_0x2831b7,_0x8bdd('0x10'),JSON['stringify'](_0x3ad0e4));if(_0x3ad0e4[_0x8bdd('0x13')]){if(_0x3ad0e4[_0x8bdd('0x13')]['code']===0x1f4){logger[_0x8bdd('0x13')](_0x8bdd('0xf'),_0x2831b7,_0x3ad0e4['error'][_0x8bdd('0x14')]);return _0x575c81(_0x3ad0e4[_0x8bdd('0x13')][_0x8bdd('0x14')]);}logger[_0x8bdd('0x13')](_0x8bdd('0xf'),_0x2831b7,_0x3ad0e4[_0x8bdd('0x13')][_0x8bdd('0x14')]);return _0x4da90d(_0x3ad0e4[_0x8bdd('0x13')][_0x8bdd('0x14')]);}else{logger['info'](_0x8bdd('0xf'),_0x2831b7,_0x8bdd('0x10'));_0x4da90d(_0x3ad0e4['result'][_0x8bdd('0x14')]);}})[_0x8bdd('0x15')](function(_0x23da61){logger[_0x8bdd('0x13')](_0x8bdd('0xf'),_0x2831b7,_0x23da61);_0x575c81(_0x23da61);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 29952a8..a3c00de 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 _0x04f7=['fs-extra','../../components/auth/service','../../components/interaction/service','./faxTransferReport.controller','get','isAuthenticated','/describe','/:id','show','post','update','delete','destroy','util','path','connect-timeout','express','Router'];(function(_0x40b4af,_0x4a59da){var _0x470c28=function(_0x38c9f1){while(--_0x38c9f1){_0x40b4af['push'](_0x40b4af['shift']());}};_0x470c28(++_0x4a59da);}(_0x04f7,0x199));var _0x704f=function(_0x12cf9f,_0x50cbcb){_0x12cf9f=_0x12cf9f-0x0;var _0x4079b1=_0x04f7[_0x12cf9f];return _0x4079b1;};'use strict';var multer=require('multer');var util=require(_0x704f('0x0'));var path=require(_0x704f('0x1'));var timeout=require(_0x704f('0x2'));var express=require(_0x704f('0x3'));var router=express[_0x704f('0x4')]();var fs_extra=require(_0x704f('0x5'));var auth=require(_0x704f('0x6'));var interaction=require(_0x704f('0x7'));var config=require('../../config/environment');var controller=require(_0x704f('0x8'));router[_0x704f('0x9')]('/',auth[_0x704f('0xa')](),controller['index']);router[_0x704f('0x9')](_0x704f('0xb'),auth[_0x704f('0xa')](),controller['describe']);router[_0x704f('0x9')](_0x704f('0xc'),auth[_0x704f('0xa')](),controller[_0x704f('0xd')]);router[_0x704f('0xe')]('/',auth[_0x704f('0xa')](),controller['create']);router['put'](_0x704f('0xc'),auth['isAuthenticated'](),controller[_0x704f('0xf')]);router[_0x704f('0x10')](_0x704f('0xc'),auth[_0x704f('0xa')](),controller[_0x704f('0x11')]);module['exports']=router; \ No newline at end of file +var _0xef2f=['/:id','isAuthenticated','show','post','create','put','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','/describe','describe'];(function(_0x16de68,_0x33d7ff){var _0x1c277e=function(_0x1d8549){while(--_0x1d8549){_0x16de68['push'](_0x16de68['shift']());}};_0x1c277e(++_0x33d7ff);}(_0xef2f,0x73));var _0xfef2=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xef2f[_0xf0bcac];return _0x4e4c65;};'use strict';var multer=require(_0xfef2('0x0'));var util=require(_0xfef2('0x1'));var path=require(_0xfef2('0x2'));var timeout=require(_0xfef2('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xfef2('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xfef2('0x5'));var config=require(_0xfef2('0x6'));var controller=require(_0xfef2('0x7'));router[_0xfef2('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfef2('0x8')](_0xfef2('0x9'),auth['isAuthenticated'](),controller[_0xfef2('0xa')]);router[_0xfef2('0x8')](_0xfef2('0xb'),auth[_0xfef2('0xc')](),controller[_0xfef2('0xd')]);router[_0xfef2('0xe')]('/',auth[_0xfef2('0xc')](),controller[_0xfef2('0xf')]);router[_0xfef2('0x10')](_0xfef2('0xb'),auth[_0xfef2('0xc')](),controller['update']);router['delete'](_0xfef2('0xb'),auth[_0xfef2('0xc')](),controller['destroy']);module[_0xfef2('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 515acbc..6fd0017 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 _0xbacb=['show','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields','addConfiguration','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','index','get','/:id'];(function(_0x31d685,_0x702cd9){var _0x4a0f66=function(_0x164eec){while(--_0x164eec){_0x31d685['push'](_0x31d685['shift']());}};_0x4a0f66(++_0x702cd9);}(_0xbacb,0x15b));var _0xbbac=function(_0x798c2d,_0x437fdf){_0x798c2d=_0x798c2d-0x0;var _0x19517e=_0xbacb[_0x798c2d];return _0x19517e;};'use strict';var multer=require('multer');var util=require(_0xbbac('0x0'));var path=require(_0xbbac('0x1'));var timeout=require(_0xbbac('0x2'));var express=require(_0xbbac('0x3'));var router=express[_0xbbac('0x4')]();var fs_extra=require(_0xbbac('0x5'));var auth=require(_0xbbac('0x6'));var interaction=require(_0xbbac('0x7'));var config=require(_0xbbac('0x8'));var controller=require(_0xbbac('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xbbac('0xa')]);router[_0xbbac('0xb')](_0xbbac('0xc'),auth['isAuthenticated'](),controller[_0xbbac('0xd')]);router['get'](_0xbbac('0xe'),auth[_0xbbac('0xf')](),controller[_0xbbac('0x10')]);router['get'](_0xbbac('0x11'),auth[_0xbbac('0xf')](),controller[_0xbbac('0x12')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0xbbac('0xf')](),controller[_0xbbac('0x13')]);router[_0xbbac('0x14')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xbbac('0x15')](_0xbbac('0xc'),auth['isAuthenticated'](),controller[_0xbbac('0x16')]);module[_0xbbac('0x17')]=router; \ No newline at end of file +var _0x1c19=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intDeskAccount.controller','isAuthenticated','index','get','/:id','/:id/configurations','post','addConfiguration'];(function(_0x260da4,_0x419de9){var _0x414b67=function(_0x23c50b){while(--_0x23c50b){_0x260da4['push'](_0x260da4['shift']());}};_0x414b67(++_0x419de9);}(_0x1c19,0x134));var _0x91c1=function(_0x344128,_0x9b9e88){_0x344128=_0x344128-0x0;var _0x693fae=_0x1c19[_0x344128];return _0x693fae;};'use strict';var multer=require('multer');var util=require(_0x91c1('0x0'));var path=require(_0x91c1('0x1'));var timeout=require(_0x91c1('0x2'));var express=require(_0x91c1('0x3'));var router=express[_0x91c1('0x4')]();var fs_extra=require(_0x91c1('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x91c1('0x6'));var controller=require(_0x91c1('0x7'));router['get']('/',auth[_0x91c1('0x8')](),controller[_0x91c1('0x9')]);router[_0x91c1('0xa')](_0x91c1('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x91c1('0xa')](_0x91c1('0xc'),auth[_0x91c1('0x8')](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0x91c1('0x8')](),controller['getFields']);router[_0x91c1('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x91c1('0xd')](_0x91c1('0xc'),auth[_0x91c1('0x8')](),controller[_0x91c1('0xe')]);router['put'](_0x91c1('0xb'),auth[_0x91c1('0x8')](),controller['update']);router['delete'](_0x91c1('0xb'),auth[_0x91c1('0x8')](),controller[_0x91c1('0xf')]);module[_0x91c1('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index ac21592..3e15328 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 _0xb061=['newTab','sequelize','STRING','ENUM','basic','integrationTab'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xb061,0x15d));var _0x1b06=function(_0x19af2b,_0x274ecc){_0x19af2b=_0x19af2b-0x0;var _0x1d7b79=_0xb061[_0x19af2b];return _0x1d7b79;};'use strict';var Sequelize=require(_0x1b06('0x0'));module['exports']={'name':{'type':Sequelize[_0x1b06('0x1')]},'description':{'type':Sequelize[_0x1b06('0x1')]},'username':{'type':Sequelize[_0x1b06('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x1b06('0x2')](_0x1b06('0x3')),'defaultValue':_0x1b06('0x3')},'password':{'type':Sequelize[_0x1b06('0x1')]},'consumerKey':{'type':Sequelize[_0x1b06('0x1')]},'consumerSecret':{'type':Sequelize[_0x1b06('0x1')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x1b06('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x1b06('0x4'),_0x1b06('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x22c4=['newTab','sequelize','exports','STRING','ENUM','basic','integrationTab'];(function(_0x3c63df,_0x544fd9){var _0x174e74=function(_0x24caf0){while(--_0x24caf0){_0x3c63df['push'](_0x3c63df['shift']());}};_0x174e74(++_0x544fd9);}(_0x22c4,0xcc));var _0x422c=function(_0xf35bc1,_0x510803){_0xf35bc1=_0xf35bc1-0x0;var _0xa6b162=_0x22c4[_0xf35bc1];return _0xa6b162;};'use strict';var Sequelize=require(_0x422c('0x0'));module[_0x422c('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x422c('0x2')]},'username':{'type':Sequelize[_0x422c('0x2')]},'remoteUri':{'type':Sequelize[_0x422c('0x2')]},'authType':{'type':Sequelize[_0x422c('0x3')](_0x422c('0x4')),'defaultValue':_0x422c('0x4')},'password':{'type':Sequelize[_0x422c('0x2')]},'consumerKey':{'type':Sequelize[_0x422c('0x2')]},'consumerSecret':{'type':Sequelize[_0x422c('0x2')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x422c('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x422c('0x5'),_0x422c('0x6')),'defaultValue':_0x422c('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index c8de37a..f614373 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 _0x8f32=['util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','count','set','reject','save','update','then','destroy','error','stack','name','send','map','DeskAccount','rawAttributes','type','key','keys','query','filters','intersection','attributes','model','fields','length','nolimit','limit','offset','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','include','create','body','find','getConfigurations','findOne','DeskConfiguration','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','authType','username','password','remoteUri','slice','substring','lastIndexOf','%s/custom_fields','application/json','basic','headers','Authorization','format','Basic\x20%s','%s:%s','base64','concat','_embedded','active','label','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache'];(function(_0x444a6e,_0x1ce403){var _0x35efb6=function(_0x3bc579){while(--_0x3bc579){_0x444a6e['push'](_0x444a6e['shift']());}};_0x35efb6(++_0x1ce403);}(_0x8f32,0x1b6));var _0x28f3=function(_0x1a8049,_0x400fc0){_0x1a8049=_0x1a8049-0x0;var _0x167935=_0x8f32[_0x1a8049];return _0x167935;};'use strict';var emlformat=require(_0x28f3('0x0'));var rimraf=require(_0x28f3('0x1'));var zipdir=require(_0x28f3('0x2'));var jsonpatch=require(_0x28f3('0x3'));var rp=require('request-promise');var moment=require(_0x28f3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x28f3('0x5'));var util=require(_0x28f3('0x6'));var path=require(_0x28f3('0x7'));var sox=require(_0x28f3('0x8'));var csv=require(_0x28f3('0x9'));var ejs=require(_0x28f3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x28f3('0xb'));var squel=require(_0x28f3('0xc'));var crypto=require(_0x28f3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x28f3('0xe'));var toCsv=require(_0x28f3('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x28f3('0xf'));var authService=require(_0x28f3('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x28f3('0x11'));var hardwareService=require(_0x28f3('0x12'));var logger=require(_0x28f3('0x13'))(_0x28f3('0x14'));var utils=require(_0x28f3('0x15'));var config=require(_0x28f3('0x16'));var licenseUtil=require(_0x28f3('0x17'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x87248e,_0x2fde3e){_0x2fde3e=_0x2fde3e||0xcc;return function(_0xbc8c08){if(_0xbc8c08){return _0x87248e[_0x28f3('0x18')](_0x2fde3e);}return _0x87248e['status'](_0x2fde3e)[_0x28f3('0x19')]();};}function respondWithResult(_0xc780f6,_0x44c3ff){_0x44c3ff=_0x44c3ff||0xc8;return function(_0x8e6d31){if(_0x8e6d31){return _0xc780f6[_0x28f3('0x1a')](_0x44c3ff)[_0x28f3('0x1b')](_0x8e6d31);}};}function respondWithFilteredResult(_0x13a3e0,_0x227c79){return function(_0xd3743e){if(_0xd3743e){var _0x375b3f=typeof _0x227c79['offset']===_0x28f3('0x1c')&&typeof _0x227c79['limit']===_0x28f3('0x1c');var _0x28f223=_0xd3743e['count'];var _0x598a04=_0x375b3f?0x0:_0x227c79['offset'];var _0x31a570=_0x375b3f?_0xd3743e[_0x28f3('0x1d')]:_0x227c79['offset']+_0x227c79['limit'];var _0x92e1c3;if(_0x31a570>=_0x28f223){_0x31a570=_0x28f223;_0x92e1c3=0xc8;}else{_0x92e1c3=0xce;}_0x13a3e0[_0x28f3('0x1a')](_0x92e1c3);return _0x13a3e0[_0x28f3('0x1e')]('Content-Range',_0x598a04+'-'+_0x31a570+'/'+_0x28f223)[_0x28f3('0x1b')](_0xd3743e);}return null;};}function patchUpdates(_0x1bcd18){return function(_0x1f99f8){try{jsonpatch['apply'](_0x1f99f8,_0x1bcd18,!![]);}catch(_0x3b983d){return BPromise[_0x28f3('0x1f')](_0x3b983d);}return _0x1f99f8[_0x28f3('0x20')]();};}function saveUpdates(_0x332365,_0xd9d70d){return function(_0x2af23a){if(_0x2af23a){return _0x2af23a[_0x28f3('0x21')](_0x332365)[_0x28f3('0x22')](function(_0x12c7e6){return _0x12c7e6;});}return null;};}function removeEntity(_0x503f0b,_0x531295){return function(_0x585700){if(_0x585700){return _0x585700[_0x28f3('0x23')]()[_0x28f3('0x22')](function(){_0x503f0b[_0x28f3('0x1a')](0xcc)[_0x28f3('0x19')]();});}};}function handleEntityNotFound(_0xe389e3,_0x575887){return function(_0x4ec0ed){if(!_0x4ec0ed){_0xe389e3[_0x28f3('0x18')](0x194);}return _0x4ec0ed;};}function handleError(_0x2804fa,_0x54a1f7){_0x54a1f7=_0x54a1f7||0x1f4;return function(_0x562231){logger[_0x28f3('0x24')](_0x562231[_0x28f3('0x25')]);if(_0x562231[_0x28f3('0x26')]){delete _0x562231[_0x28f3('0x26')];}_0x2804fa[_0x28f3('0x1a')](_0x54a1f7)[_0x28f3('0x27')](_0x562231);};}exports['index']=function(_0x327374,_0x204059){var _0x3e0a3a={},_0x149540={},_0x509ddd={'count':0x0,'rows':[]};var _0x57b703=_[_0x28f3('0x28')](db[_0x28f3('0x29')][_0x28f3('0x2a')],function(_0x3e1b94){return{'name':_0x3e1b94['fieldName'],'type':_0x3e1b94[_0x28f3('0x2b')][_0x28f3('0x2c')]};});_0x149540['model']=_[_0x28f3('0x28')](_0x57b703,'name');_0x149540['query']=_[_0x28f3('0x2d')](_0x327374[_0x28f3('0x2e')]);_0x149540[_0x28f3('0x2f')]=_[_0x28f3('0x30')](_0x149540['model'],_0x149540[_0x28f3('0x2e')]);_0x3e0a3a[_0x28f3('0x31')]=_['intersection'](_0x149540[_0x28f3('0x32')],qs[_0x28f3('0x33')](_0x327374['query'][_0x28f3('0x33')]));_0x3e0a3a[_0x28f3('0x31')]=_0x3e0a3a[_0x28f3('0x31')][_0x28f3('0x34')]?_0x3e0a3a['attributes']:_0x149540['model'];if(!_0x327374[_0x28f3('0x2e')]['hasOwnProperty'](_0x28f3('0x35'))){_0x3e0a3a[_0x28f3('0x36')]=qs[_0x28f3('0x36')](_0x327374[_0x28f3('0x2e')][_0x28f3('0x36')]);_0x3e0a3a[_0x28f3('0x37')]=qs['offset'](_0x327374[_0x28f3('0x2e')][_0x28f3('0x37')]);}_0x3e0a3a[_0x28f3('0x38')]=qs[_0x28f3('0x39')](_0x327374[_0x28f3('0x2e')]['sort']);_0x3e0a3a[_0x28f3('0x3a')]=qs[_0x28f3('0x2f')](_[_0x28f3('0x3b')](_0x327374[_0x28f3('0x2e')],_0x149540['filters']),_0x57b703);if(_0x327374[_0x28f3('0x2e')][_0x28f3('0x3c')]){_0x3e0a3a[_0x28f3('0x3a')]=_[_0x28f3('0x3d')](_0x3e0a3a[_0x28f3('0x3a')],{'$or':_['map'](_0x57b703,function(_0x12a228){if(_0x12a228[_0x28f3('0x2b')]!=='VIRTUAL'){var _0xc3261d={};_0xc3261d[_0x12a228[_0x28f3('0x26')]]={'$like':'%'+_0x327374[_0x28f3('0x2e')][_0x28f3('0x3c')]+'%'};return _0xc3261d;}})});}_0x3e0a3a=_[_0x28f3('0x3d')]({},_0x3e0a3a,_0x327374[_0x28f3('0x3e')]);var _0x3b5c62={'where':_0x3e0a3a[_0x28f3('0x3a')]};return db['DeskAccount'][_0x28f3('0x1d')](_0x3b5c62)[_0x28f3('0x22')](function(_0x1f8e0f){_0x509ddd[_0x28f3('0x1d')]=_0x1f8e0f;if(_0x327374[_0x28f3('0x2e')][_0x28f3('0x3f')]){_0x3e0a3a['include']=[{'all':!![]}];}return db['DeskAccount'][_0x28f3('0x40')](_0x3e0a3a);})[_0x28f3('0x22')](function(_0x12abff){_0x509ddd[_0x28f3('0x41')]=_0x12abff;return _0x509ddd;})[_0x28f3('0x22')](respondWithFilteredResult(_0x204059,_0x3e0a3a))[_0x28f3('0x42')](handleError(_0x204059,null));};exports[_0x28f3('0x43')]=function(_0x103a07,_0x1659c7){var _0xe1a047={'raw':![],'where':{'id':_0x103a07[_0x28f3('0x44')]['id']}},_0x28a63f={};_0x28a63f[_0x28f3('0x32')]=_['keys'](db[_0x28f3('0x29')][_0x28f3('0x2a')]);_0x28a63f[_0x28f3('0x2e')]=_[_0x28f3('0x2d')](_0x103a07['query']);_0x28a63f['filters']=_[_0x28f3('0x30')](_0x28a63f[_0x28f3('0x32')],_0x28a63f['query']);_0xe1a047[_0x28f3('0x31')]=_['intersection'](_0x28a63f[_0x28f3('0x32')],qs[_0x28f3('0x33')](_0x103a07[_0x28f3('0x2e')][_0x28f3('0x33')]));_0xe1a047[_0x28f3('0x31')]=_0xe1a047[_0x28f3('0x31')][_0x28f3('0x34')]?_0xe1a047[_0x28f3('0x31')]:_0x28a63f['model'];if(_0x103a07[_0x28f3('0x2e')][_0x28f3('0x3f')]){_0xe1a047[_0x28f3('0x45')]=[{'all':!![]}];}_0xe1a047=_['merge']({},_0xe1a047,_0x103a07[_0x28f3('0x3e')]);return db[_0x28f3('0x29')]['find'](_0xe1a047)[_0x28f3('0x22')](handleEntityNotFound(_0x1659c7,null))[_0x28f3('0x22')](respondWithResult(_0x1659c7,null))[_0x28f3('0x42')](handleError(_0x1659c7,null));};exports[_0x28f3('0x46')]=function(_0x5a8b3c,_0x20349f){return db[_0x28f3('0x29')][_0x28f3('0x46')](_0x5a8b3c[_0x28f3('0x47')],{})[_0x28f3('0x22')](respondWithResult(_0x20349f,0xc9))[_0x28f3('0x42')](handleError(_0x20349f,null));};exports['update']=function(_0x51ddbd,_0x511c22){if(_0x51ddbd[_0x28f3('0x47')]['id']){delete _0x51ddbd['body']['id'];}return db[_0x28f3('0x29')][_0x28f3('0x48')]({'where':{'id':_0x51ddbd['params']['id']}})[_0x28f3('0x22')](handleEntityNotFound(_0x511c22,null))[_0x28f3('0x22')](saveUpdates(_0x51ddbd[_0x28f3('0x47')],null))[_0x28f3('0x22')](respondWithResult(_0x511c22,null))[_0x28f3('0x42')](handleError(_0x511c22,null));};exports['destroy']=function(_0x29189b,_0x532feb){return db[_0x28f3('0x29')][_0x28f3('0x48')]({'where':{'id':_0x29189b[_0x28f3('0x44')]['id']}})[_0x28f3('0x22')](handleEntityNotFound(_0x532feb,null))[_0x28f3('0x22')](removeEntity(_0x532feb,null))[_0x28f3('0x42')](handleError(_0x532feb,null));};exports[_0x28f3('0x49')]=function(_0x4581f3,_0x4ee248,_0x5cb884){var _0x3e8593={};var _0x7e4b4={};var _0xcbf312;var _0x1f5d58;return db[_0x28f3('0x29')][_0x28f3('0x4a')]({'where':{'id':_0x4581f3[_0x28f3('0x44')]['id']}})[_0x28f3('0x22')](handleEntityNotFound(_0x4ee248,null))['then'](function(_0x58fd36){if(_0x58fd36){_0xcbf312=_0x58fd36;_0x7e4b4[_0x28f3('0x32')]=_[_0x28f3('0x2d')](db[_0x28f3('0x4b')][_0x28f3('0x2a')]);_0x7e4b4[_0x28f3('0x2e')]=_[_0x28f3('0x2d')](_0x4581f3[_0x28f3('0x2e')]);_0x7e4b4['filters']=_[_0x28f3('0x30')](_0x7e4b4[_0x28f3('0x32')],_0x7e4b4[_0x28f3('0x2e')]);_0x3e8593[_0x28f3('0x31')]=_['intersection'](_0x7e4b4[_0x28f3('0x32')],qs['fields'](_0x4581f3[_0x28f3('0x2e')][_0x28f3('0x33')]));_0x3e8593[_0x28f3('0x31')]=_0x3e8593[_0x28f3('0x31')][_0x28f3('0x34')]?_0x3e8593['attributes']:_0x7e4b4[_0x28f3('0x32')];_0x3e8593['order']=qs[_0x28f3('0x39')](_0x4581f3[_0x28f3('0x2e')][_0x28f3('0x39')]);_0x3e8593['where']=qs[_0x28f3('0x2f')](_[_0x28f3('0x3b')](_0x4581f3[_0x28f3('0x2e')],_0x7e4b4[_0x28f3('0x2f')]));if(_0x4581f3[_0x28f3('0x2e')][_0x28f3('0x3c')]){_0x3e8593[_0x28f3('0x3a')]=_[_0x28f3('0x3d')](_0x3e8593[_0x28f3('0x3a')],{'$or':_[_0x28f3('0x28')](_0x3e8593[_0x28f3('0x31')],function(_0xcfc912){var _0x1a64d0={};_0x1a64d0[_0xcfc912]={'$like':'%'+_0x4581f3[_0x28f3('0x2e')][_0x28f3('0x3c')]+'%'};return _0x1a64d0;})});}_0x3e8593=_['merge']({},_0x3e8593,_0x4581f3[_0x28f3('0x3e')]);return _0xcbf312[_0x28f3('0x49')](_0x3e8593);}})[_0x28f3('0x22')](function(_0x27b836){if(_0x27b836){_0x1f5d58=_0x27b836[_0x28f3('0x34')];if(!_0x4581f3[_0x28f3('0x2e')][_0x28f3('0x4c')]('nolimit')){_0x3e8593[_0x28f3('0x36')]=qs[_0x28f3('0x36')](_0x4581f3['query']['limit']);_0x3e8593[_0x28f3('0x37')]=qs['offset'](_0x4581f3[_0x28f3('0x2e')]['offset']);}return _0xcbf312[_0x28f3('0x49')](_0x3e8593);}})[_0x28f3('0x22')](function(_0x2a7938){if(_0x2a7938){return _0x2a7938?{'count':_0x1f5d58,'rows':_0x2a7938}:null;}})[_0x28f3('0x22')](respondWithResult(_0x4ee248,null))[_0x28f3('0x42')](handleError(_0x4ee248,null));};exports[_0x28f3('0x4d')]=function(_0x2f319a,_0x2c6da3,_0x239d96){if(_0x2f319a['body']['id']){delete _0x2f319a['body']['id'];}return db[_0x28f3('0x29')][_0x28f3('0x4a')]({'where':{'id':_0x2f319a[_0x28f3('0x44')]['id']}})[_0x28f3('0x22')](handleEntityNotFound(_0x2c6da3,null))['then'](function(_0x6ffa86){if(_0x6ffa86){_0x2f319a[_0x28f3('0x47')]['AccountId']=_0x6ffa86['id'];_0x2f319a[_0x28f3('0x47')][_0x28f3('0x4e')]=integrations[_0x28f3('0x4f')](_0x2f319a[_0x28f3('0x47')][_0x28f3('0x50')],_0x2f319a[_0x28f3('0x47')][_0x28f3('0x2b')]);_0x2f319a['body'][_0x28f3('0x51')]=integrations[_0x28f3('0x52')](_0x2f319a['body'][_0x28f3('0x50')],_0x2f319a[_0x28f3('0x47')][_0x28f3('0x2b')]);return db[_0x28f3('0x4b')][_0x28f3('0x46')](_0x2f319a[_0x28f3('0x47')],{'include':[{'model':db[_0x28f3('0x53')],'as':_0x28f3('0x4e')},{'model':db[_0x28f3('0x53')],'as':_0x28f3('0x51')}]});}return null;})[_0x28f3('0x22')](respondWithResult(_0x2c6da3,null))[_0x28f3('0x42')](handleError(_0x2c6da3,null));};exports[_0x28f3('0x54')]=function(_0x1e2287,_0xf57bfd,_0x402428){var _0x8b3198=[{'name':_0x28f3('0x55'),'label':_0x28f3('0x55'),'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 _0x410172='';return db[_0x28f3('0x29')][_0x28f3('0x4a')]({'where':{'id':_0x1e2287[_0x28f3('0x44')]['id']},'attributes':['id','remoteUri',_0x28f3('0x56'),_0x28f3('0x57'),_0x28f3('0x58'),'consumerKey','consumerSecret','token','tokenSecret']})[_0x28f3('0x22')](handleEntityNotFound(_0xf57bfd,null))['then'](function(_0x315e70){if(_0x315e70){_0x410172=_0x315e70[_0x28f3('0x59')];var _0x116dc0=_0x410172[_0x28f3('0x5a')](-0x1);if(_0x116dc0==='/'){_0x410172=_0x410172[_0x28f3('0x5b')](0x0,_0x410172[_0x28f3('0x5c')](_0x116dc0));}var _0x455ab5={'method':'GET','uri':util['format'](_0x28f3('0x5d'),_0x410172),'headers':{'Content-Type':_0x28f3('0x5e'),'Accept':_0x28f3('0x5e')},'json':!![]};if(_0x315e70[_0x28f3('0x56')]===_0x28f3('0x5f')){_0x455ab5[_0x28f3('0x60')][_0x28f3('0x61')]=util[_0x28f3('0x62')](_0x28f3('0x63'),new Buffer(util[_0x28f3('0x62')](_0x28f3('0x64'),_0x315e70[_0x28f3('0x57')],_0x315e70['password']))['toString'](_0x28f3('0x65')));}return rp(_0x455ab5)[_0x28f3('0x22')](function(_0x1706ed){return _0x8b3198[_0x28f3('0x66')](_[_0x28f3('0x28')](_0x1706ed[_0x28f3('0x67')]['entries'],function(_0x558eda){return{'id':_0x558eda[_0x28f3('0x26')],'name':_0x558eda['name'],'type':_0x558eda[_0x28f3('0x2b')],'active':_0x558eda[_0x28f3('0x68')],'label':_0x558eda[_0x28f3('0x69')],'custom':!![]};}));});}})['then'](function(_0x2ea249){return{'count':_0x2ea249[_0x28f3('0x34')],'rows':_0x2ea249};})['then'](respondWithResult(_0xf57bfd,null))[_0x28f3('0x42')](function(_0x15ec54){var _0x3e50f4=_0x1e2287[_0x28f3('0x2e')][_0x28f3('0x6a')]?0x1f4:_0x15ec54['statusCode']||0x1f4;logger[_0x28f3('0x24')](_0x28f3('0x6b'),_0x28f3('0x54'),_0x3e50f4,JSON[_0x28f3('0x6c')](_0x15ec54));delete _0x15ec54[_0x28f3('0x26')];if(_0x3e50f4===0x191){_0x3e50f4=0x190;}_0xf57bfd[_0x28f3('0x1a')](_0x3e50f4)['send'](_0x1e2287[_0x28f3('0x2e')][_0x28f3('0x6a')]?{'message':_0x28f3('0x6d'),'statusCode':_0x15ec54[_0x28f3('0x6e')]}:_0x15ec54);});}; \ No newline at end of file +var _0x8818=['ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','update','destroy','then','sendStatus','error','stack','name','send','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','map','VIRTUAL','filter','options','DeskAccount','includeAll','include','findAll','catch','show','rawAttributes','find','create','body','getConfigurations','findOne','params','DeskConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','getFields','priority','authType','username','password','consumerKey','consumerSecret','token','slice','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','Authorization','Basic\x20%s','%s:%s','base64','concat','_embedded','entries','active','label','test','statusCode','stringify','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv'];(function(_0x3c8a9e,_0x5505cd){var _0x4c90b9=function(_0x17b1ae){while(--_0x17b1ae){_0x3c8a9e['push'](_0x3c8a9e['shift']());}};_0x4c90b9(++_0x5505cd);}(_0x8818,0x148));var _0x8881=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x8818[_0x28947d];return _0x12d2ee;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8881('0x0'));var jsonpatch=require(_0x8881('0x1'));var rp=require(_0x8881('0x2'));var moment=require('moment');var BPromise=require(_0x8881('0x3'));var Mustache=require(_0x8881('0x4'));var util=require('util');var path=require(_0x8881('0x5'));var sox=require(_0x8881('0x6'));var csv=require(_0x8881('0x7'));var ejs=require(_0x8881('0x8'));var fs=require('fs');var fs_extra=require(_0x8881('0x9'));var _=require(_0x8881('0xa'));var squel=require(_0x8881('0xb'));var crypto=require(_0x8881('0xc'));var jsforce=require(_0x8881('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8881('0x7'));var querystring=require(_0x8881('0xe'));var Papa=require('papaparse');var Redis=require(_0x8881('0xf'));var authService=require(_0x8881('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8881('0x11'));var hardwareService=require(_0x8881('0x12'));var logger=require(_0x8881('0x13'))(_0x8881('0x14'));var utils=require(_0x8881('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8881('0x16'));var db=require(_0x8881('0x17'))['db'];var integrations=require(_0x8881('0x18'));function respondWithStatusCode(_0xc5e2d1,_0x1ddb2b){_0x1ddb2b=_0x1ddb2b||0xcc;return function(_0x110fb5){if(_0x110fb5){return _0xc5e2d1['sendStatus'](_0x1ddb2b);}return _0xc5e2d1[_0x8881('0x19')](_0x1ddb2b)[_0x8881('0x1a')]();};}function respondWithResult(_0x44bc3a,_0xbad330){_0xbad330=_0xbad330||0xc8;return function(_0x2dc2c5){if(_0x2dc2c5){return _0x44bc3a[_0x8881('0x19')](_0xbad330)[_0x8881('0x1b')](_0x2dc2c5);}};}function respondWithFilteredResult(_0x5acaf6,_0x3aecb4){return function(_0x25bb64){if(_0x25bb64){var _0x2cf8ae=typeof _0x3aecb4['offset']===_0x8881('0x1c')&&typeof _0x3aecb4['limit']===_0x8881('0x1c');var _0x35182a=_0x25bb64[_0x8881('0x1d')];var _0x51972c=_0x2cf8ae?0x0:_0x3aecb4[_0x8881('0x1e')];var _0x56bea0=_0x2cf8ae?_0x25bb64['count']:_0x3aecb4[_0x8881('0x1e')]+_0x3aecb4[_0x8881('0x1f')];var _0x15fe45;if(_0x56bea0>=_0x35182a){_0x56bea0=_0x35182a;_0x15fe45=0xc8;}else{_0x15fe45=0xce;}_0x5acaf6[_0x8881('0x19')](_0x15fe45);return _0x5acaf6[_0x8881('0x20')](_0x8881('0x21'),_0x51972c+'-'+_0x56bea0+'/'+_0x35182a)[_0x8881('0x1b')](_0x25bb64);}return null;};}function patchUpdates(_0x109cb3){return function(_0x4518de){try{jsonpatch[_0x8881('0x22')](_0x4518de,_0x109cb3,!![]);}catch(_0x47e563){return BPromise['reject'](_0x47e563);}return _0x4518de['save']();};}function saveUpdates(_0x38d357,_0x2f3903){return function(_0x4ae9c1){if(_0x4ae9c1){return _0x4ae9c1[_0x8881('0x23')](_0x38d357)['then'](function(_0x8db8c3){return _0x8db8c3;});}return null;};}function removeEntity(_0xdad700,_0x38b024){return function(_0x30b9ff){if(_0x30b9ff){return _0x30b9ff[_0x8881('0x24')]()[_0x8881('0x25')](function(){_0xdad700[_0x8881('0x19')](0xcc)[_0x8881('0x1a')]();});}};}function handleEntityNotFound(_0x10fbec,_0x7ad0af){return function(_0x138f36){if(!_0x138f36){_0x10fbec[_0x8881('0x26')](0x194);}return _0x138f36;};}function handleError(_0x3f3022,_0x9e7efe){_0x9e7efe=_0x9e7efe||0x1f4;return function(_0xccde3c){logger[_0x8881('0x27')](_0xccde3c[_0x8881('0x28')]);if(_0xccde3c[_0x8881('0x29')]){delete _0xccde3c[_0x8881('0x29')];}_0x3f3022['status'](_0x9e7efe)[_0x8881('0x2a')](_0xccde3c);};}exports['index']=function(_0x371744,_0x4d7acd){var _0x681490={},_0xa00125={},_0x518241={'count':0x0,'rows':[]};var _0x43097f=_['map'](db['DeskAccount']['rawAttributes'],function(_0x3bdfe0){return{'name':_0x3bdfe0['fieldName'],'type':_0x3bdfe0[_0x8881('0x2b')][_0x8881('0x2c')]};});_0xa00125[_0x8881('0x2d')]=_['map'](_0x43097f,'name');_0xa00125[_0x8881('0x2e')]=_[_0x8881('0x2f')](_0x371744[_0x8881('0x2e')]);_0xa00125['filters']=_[_0x8881('0x30')](_0xa00125['model'],_0xa00125[_0x8881('0x2e')]);_0x681490['attributes']=_[_0x8881('0x30')](_0xa00125[_0x8881('0x2d')],qs[_0x8881('0x31')](_0x371744['query']['fields']));_0x681490[_0x8881('0x32')]=_0x681490['attributes'][_0x8881('0x33')]?_0x681490[_0x8881('0x32')]:_0xa00125[_0x8881('0x2d')];if(!_0x371744['query'][_0x8881('0x34')](_0x8881('0x35'))){_0x681490[_0x8881('0x1f')]=qs[_0x8881('0x1f')](_0x371744[_0x8881('0x2e')][_0x8881('0x1f')]);_0x681490['offset']=qs[_0x8881('0x1e')](_0x371744[_0x8881('0x2e')]['offset']);}_0x681490[_0x8881('0x36')]=qs[_0x8881('0x37')](_0x371744[_0x8881('0x2e')]['sort']);_0x681490[_0x8881('0x38')]=qs[_0x8881('0x39')](_[_0x8881('0x3a')](_0x371744[_0x8881('0x2e')],_0xa00125[_0x8881('0x39')]),_0x43097f);if(_0x371744[_0x8881('0x2e')]['filter']){_0x681490[_0x8881('0x38')]=_[_0x8881('0x3b')](_0x681490[_0x8881('0x38')],{'$or':_[_0x8881('0x3c')](_0x43097f,function(_0x4cae01){if(_0x4cae01[_0x8881('0x2b')]!==_0x8881('0x3d')){var _0x1be31d={};_0x1be31d[_0x4cae01[_0x8881('0x29')]]={'$like':'%'+_0x371744[_0x8881('0x2e')][_0x8881('0x3e')]+'%'};return _0x1be31d;}})});}_0x681490=_[_0x8881('0x3b')]({},_0x681490,_0x371744[_0x8881('0x3f')]);var _0x58fded={'where':_0x681490[_0x8881('0x38')]};return db[_0x8881('0x40')][_0x8881('0x1d')](_0x58fded)[_0x8881('0x25')](function(_0x5c0c6b){_0x518241['count']=_0x5c0c6b;if(_0x371744[_0x8881('0x2e')][_0x8881('0x41')]){_0x681490[_0x8881('0x42')]=[{'all':!![]}];}return db['DeskAccount'][_0x8881('0x43')](_0x681490);})['then'](function(_0x218bfc){_0x518241['rows']=_0x218bfc;return _0x518241;})[_0x8881('0x25')](respondWithFilteredResult(_0x4d7acd,_0x681490))[_0x8881('0x44')](handleError(_0x4d7acd,null));};exports[_0x8881('0x45')]=function(_0x3c4273,_0x36383a){var _0x491728={'raw':![],'where':{'id':_0x3c4273['params']['id']}},_0x5272c1={};_0x5272c1['model']=_[_0x8881('0x2f')](db[_0x8881('0x40')][_0x8881('0x46')]);_0x5272c1['query']=_[_0x8881('0x2f')](_0x3c4273[_0x8881('0x2e')]);_0x5272c1[_0x8881('0x39')]=_[_0x8881('0x30')](_0x5272c1[_0x8881('0x2d')],_0x5272c1[_0x8881('0x2e')]);_0x491728['attributes']=_['intersection'](_0x5272c1[_0x8881('0x2d')],qs[_0x8881('0x31')](_0x3c4273[_0x8881('0x2e')][_0x8881('0x31')]));_0x491728[_0x8881('0x32')]=_0x491728[_0x8881('0x32')]['length']?_0x491728[_0x8881('0x32')]:_0x5272c1[_0x8881('0x2d')];if(_0x3c4273[_0x8881('0x2e')][_0x8881('0x41')]){_0x491728[_0x8881('0x42')]=[{'all':!![]}];}_0x491728=_[_0x8881('0x3b')]({},_0x491728,_0x3c4273['options']);return db[_0x8881('0x40')][_0x8881('0x47')](_0x491728)[_0x8881('0x25')](handleEntityNotFound(_0x36383a,null))[_0x8881('0x25')](respondWithResult(_0x36383a,null))[_0x8881('0x44')](handleError(_0x36383a,null));};exports[_0x8881('0x48')]=function(_0x53dd3c,_0x5335a3){return db[_0x8881('0x40')][_0x8881('0x48')](_0x53dd3c[_0x8881('0x49')],{})[_0x8881('0x25')](respondWithResult(_0x5335a3,0xc9))['catch'](handleError(_0x5335a3,null));};exports[_0x8881('0x23')]=function(_0x1dd17e,_0x1c34ac){if(_0x1dd17e[_0x8881('0x49')]['id']){delete _0x1dd17e[_0x8881('0x49')]['id'];}return db[_0x8881('0x40')][_0x8881('0x47')]({'where':{'id':_0x1dd17e['params']['id']}})[_0x8881('0x25')](handleEntityNotFound(_0x1c34ac,null))['then'](saveUpdates(_0x1dd17e[_0x8881('0x49')],null))[_0x8881('0x25')](respondWithResult(_0x1c34ac,null))['catch'](handleError(_0x1c34ac,null));};exports[_0x8881('0x24')]=function(_0x5878fd,_0x3d4a39){return db[_0x8881('0x40')][_0x8881('0x47')]({'where':{'id':_0x5878fd['params']['id']}})[_0x8881('0x25')](handleEntityNotFound(_0x3d4a39,null))[_0x8881('0x25')](removeEntity(_0x3d4a39,null))[_0x8881('0x44')](handleError(_0x3d4a39,null));};exports[_0x8881('0x4a')]=function(_0x524ce6,_0x535043,_0x162c47){var _0x1e5e20={};var _0x463349={};var _0x579f84;var _0x42737d;return db['DeskAccount'][_0x8881('0x4b')]({'where':{'id':_0x524ce6[_0x8881('0x4c')]['id']}})[_0x8881('0x25')](handleEntityNotFound(_0x535043,null))[_0x8881('0x25')](function(_0x1594f1){if(_0x1594f1){_0x579f84=_0x1594f1;_0x463349[_0x8881('0x2d')]=_[_0x8881('0x2f')](db[_0x8881('0x4d')][_0x8881('0x46')]);_0x463349['query']=_[_0x8881('0x2f')](_0x524ce6[_0x8881('0x2e')]);_0x463349['filters']=_[_0x8881('0x30')](_0x463349[_0x8881('0x2d')],_0x463349[_0x8881('0x2e')]);_0x1e5e20[_0x8881('0x32')]=_['intersection'](_0x463349[_0x8881('0x2d')],qs[_0x8881('0x31')](_0x524ce6[_0x8881('0x2e')][_0x8881('0x31')]));_0x1e5e20[_0x8881('0x32')]=_0x1e5e20[_0x8881('0x32')]['length']?_0x1e5e20[_0x8881('0x32')]:_0x463349[_0x8881('0x2d')];_0x1e5e20[_0x8881('0x36')]=qs[_0x8881('0x37')](_0x524ce6[_0x8881('0x2e')]['sort']);_0x1e5e20[_0x8881('0x38')]=qs[_0x8881('0x39')](_['pick'](_0x524ce6[_0x8881('0x2e')],_0x463349[_0x8881('0x39')]));if(_0x524ce6[_0x8881('0x2e')][_0x8881('0x3e')]){_0x1e5e20[_0x8881('0x38')]=_[_0x8881('0x3b')](_0x1e5e20[_0x8881('0x38')],{'$or':_[_0x8881('0x3c')](_0x1e5e20[_0x8881('0x32')],function(_0x1e9522){var _0x2bc7cb={};_0x2bc7cb[_0x1e9522]={'$like':'%'+_0x524ce6[_0x8881('0x2e')]['filter']+'%'};return _0x2bc7cb;})});}_0x1e5e20=_[_0x8881('0x3b')]({},_0x1e5e20,_0x524ce6[_0x8881('0x3f')]);return _0x579f84[_0x8881('0x4a')](_0x1e5e20);}})[_0x8881('0x25')](function(_0x4ad9ea){if(_0x4ad9ea){_0x42737d=_0x4ad9ea[_0x8881('0x33')];if(!_0x524ce6[_0x8881('0x2e')][_0x8881('0x34')](_0x8881('0x35'))){_0x1e5e20[_0x8881('0x1f')]=qs[_0x8881('0x1f')](_0x524ce6[_0x8881('0x2e')][_0x8881('0x1f')]);_0x1e5e20[_0x8881('0x1e')]=qs[_0x8881('0x1e')](_0x524ce6[_0x8881('0x2e')][_0x8881('0x1e')]);}return _0x579f84[_0x8881('0x4a')](_0x1e5e20);}})[_0x8881('0x25')](function(_0x3a2fbe){if(_0x3a2fbe){return _0x3a2fbe?{'count':_0x42737d,'rows':_0x3a2fbe}:null;}})[_0x8881('0x25')](respondWithResult(_0x535043,null))[_0x8881('0x44')](handleError(_0x535043,null));};exports['addConfiguration']=function(_0x1ac4bc,_0x3876fd,_0x4bfbbb){if(_0x1ac4bc[_0x8881('0x49')]['id']){delete _0x1ac4bc['body']['id'];}return db[_0x8881('0x40')][_0x8881('0x4b')]({'where':{'id':_0x1ac4bc[_0x8881('0x4c')]['id']}})[_0x8881('0x25')](handleEntityNotFound(_0x3876fd,null))[_0x8881('0x25')](function(_0x2b3453){if(_0x2b3453){_0x1ac4bc[_0x8881('0x49')][_0x8881('0x4e')]=_0x2b3453['id'];_0x1ac4bc['body'][_0x8881('0x4f')]=integrations[_0x8881('0x50')](_0x1ac4bc['body']['channel'],_0x1ac4bc[_0x8881('0x49')][_0x8881('0x2b')]);_0x1ac4bc[_0x8881('0x49')][_0x8881('0x51')]=integrations[_0x8881('0x52')](_0x1ac4bc[_0x8881('0x49')][_0x8881('0x53')],_0x1ac4bc[_0x8881('0x49')][_0x8881('0x2b')]);return db['DeskConfiguration'][_0x8881('0x48')](_0x1ac4bc[_0x8881('0x49')],{'include':[{'model':db['DeskField'],'as':_0x8881('0x4f')},{'model':db['DeskField'],'as':_0x8881('0x51')}]});}return null;})[_0x8881('0x25')](respondWithResult(_0x3876fd,null))[_0x8881('0x44')](handleError(_0x3876fd,null));};exports[_0x8881('0x54')]=function(_0x4553e0,_0x160334,_0x5b4fc3){var _0x2e551a=[{'name':_0x8881('0x55'),'label':_0x8881('0x55'),'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 _0x382517='';return db['DeskAccount']['findOne']({'where':{'id':_0x4553e0['params']['id']},'attributes':['id','remoteUri',_0x8881('0x56'),_0x8881('0x57'),_0x8881('0x58'),_0x8881('0x59'),_0x8881('0x5a'),_0x8881('0x5b'),'tokenSecret']})[_0x8881('0x25')](handleEntityNotFound(_0x160334,null))['then'](function(_0x134767){if(_0x134767){_0x382517=_0x134767['remoteUri'];var _0x830009=_0x382517[_0x8881('0x5c')](-0x1);if(_0x830009==='/'){_0x382517=_0x382517['substring'](0x0,_0x382517[_0x8881('0x5d')](_0x830009));}var _0x31e99e={'method':_0x8881('0x5e'),'uri':util[_0x8881('0x5f')](_0x8881('0x60'),_0x382517),'headers':{'Content-Type':'application/json','Accept':_0x8881('0x61')},'json':!![]};if(_0x134767[_0x8881('0x56')]===_0x8881('0x62')){_0x31e99e['headers'][_0x8881('0x63')]=util[_0x8881('0x5f')](_0x8881('0x64'),new Buffer(util[_0x8881('0x5f')](_0x8881('0x65'),_0x134767['username'],_0x134767[_0x8881('0x58')]))['toString'](_0x8881('0x66')));}return rp(_0x31e99e)[_0x8881('0x25')](function(_0x354287){return _0x2e551a[_0x8881('0x67')](_[_0x8881('0x3c')](_0x354287[_0x8881('0x68')][_0x8881('0x69')],function(_0x50a186){return{'id':_0x50a186['name'],'name':_0x50a186[_0x8881('0x29')],'type':_0x50a186[_0x8881('0x2b')],'active':_0x50a186[_0x8881('0x6a')],'label':_0x50a186[_0x8881('0x6b')],'custom':!![]};}));});}})[_0x8881('0x25')](function(_0xa8c960){return{'count':_0xa8c960[_0x8881('0x33')],'rows':_0xa8c960};})['then'](respondWithResult(_0x160334,null))[_0x8881('0x44')](function(_0x31814e){var _0x1f0ca8=_0x4553e0[_0x8881('0x2e')][_0x8881('0x6c')]?0x1f4:_0x31814e[_0x8881('0x6d')]||0x1f4;logger[_0x8881('0x27')]('getFields,\x20%s,\x20%s,\x20%s',_0x8881('0x54'),_0x1f0ca8,JSON[_0x8881('0x6e')](_0x31814e));delete _0x31814e[_0x8881('0x29')];if(_0x1f0ca8===0x191){_0x1f0ca8=0x190;}_0x160334[_0x8881('0x19')](_0x1f0ca8)[_0x8881('0x2a')](_0x4553e0['query'][_0x8881('0x6c')]?{'message':_0x8881('0x6f'),'statusCode':_0x31814e['statusCode']}:_0x31814e);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 4694919..202b4d3 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 _0x253a=['rimraf','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','int_desk_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x26e727,_0x3e65be){var _0x563800=function(_0xbcf999){while(--_0xbcf999){_0x26e727['push'](_0x26e727['shift']());}};_0x563800(++_0x3e65be);}(_0x253a,0xfd));var _0xa253=function(_0x2fcf1d,_0x29c8e2){_0x2fcf1d=_0x2fcf1d-0x0;var _0x4e2cb1=_0x253a[_0x2fcf1d];return _0x4e2cb1;};'use strict';var _=require(_0xa253('0x0'));var util=require('util');var logger=require(_0xa253('0x1'))(_0xa253('0x2'));var moment=require(_0xa253('0x3'));var BPromise=require(_0xa253('0x4'));var rp=require(_0xa253('0x5'));var fs=require('fs');var path=require(_0xa253('0x6'));var rimraf=require(_0xa253('0x7'));var config=require('../../config/environment');var attributes=require(_0xa253('0x8'));var integrations=require(_0xa253('0x9'));module[_0xa253('0xa')]=function(_0x22ea79,_0x49b98e){return _0x22ea79[_0xa253('0xb')]('DeskAccount',attributes,{'tableName':_0xa253('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4731=['rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x335a61,_0x21b879){var _0x48a02b=function(_0x2978a8){while(--_0x2978a8){_0x335a61['push'](_0x335a61['shift']());}};_0x48a02b(++_0x21b879);}(_0x4731,0x118));var _0x1473=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x4731[_0x1d24eb];return _0x1dc576;};'use strict';var _=require(_0x1473('0x0'));var util=require(_0x1473('0x1'));var logger=require(_0x1473('0x2'))('api');var moment=require(_0x1473('0x3'));var BPromise=require('bluebird');var rp=require(_0x1473('0x4'));var fs=require('fs');var path=require(_0x1473('0x5'));var rimraf=require(_0x1473('0x6'));var config=require(_0x1473('0x7'));var attributes=require(_0x1473('0x8'));var integrations=require(_0x1473('0x9'));module[_0x1473('0xa')]=function(_0x1e4f00,_0x58bd6f){return _0x1e4f00['define']('DeskAccount',attributes,{'tableName':'int_desk_accounts','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 e40175b..f705ea3 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 _0x203d=['error','message','GetDeskAccount','DeskAccount','findAll','options','raw','attributes','limit','include','map','model','catch','ShowDeskAccount','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x203d,0x7c));var _0xd203=function(_0x3e779c,_0x546ea2){_0x3e779c=_0x3e779c-0x0;var _0x22ab11=_0x203d[_0x3e779c];return _0x22ab11;};'use strict';var _=require(_0xd203('0x0'));var util=require(_0xd203('0x1'));var moment=require(_0xd203('0x2'));var BPromise=require(_0xd203('0x3'));var rs=require(_0xd203('0x4'));var fs=require('fs');var Redis=require(_0xd203('0x5'));var db=require(_0xd203('0x6'))['db'];var utils=require(_0xd203('0x7'));var logger=require(_0xd203('0x8'))('rpc');var config=require(_0xd203('0x9'));var jayson=require(_0xd203('0xa'));var client=jayson[_0xd203('0xb')][_0xd203('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2f061f,_0x5f4cf1,_0xec53d5){return new BPromise(function(_0x45adcf,_0x1a6375){return client[_0xd203('0xd')](_0x2f061f,_0xec53d5)[_0xd203('0xe')](function(_0x2fd1fb){logger[_0xd203('0xf')](_0xd203('0x10'),_0x5f4cf1,_0xd203('0x11'));logger[_0xd203('0x12')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x5f4cf1,'request\x20sent',JSON[_0xd203('0x13')](_0x2fd1fb));if(_0x2fd1fb[_0xd203('0x14')]){if(_0x2fd1fb['error']['code']===0x1f4){logger['error'](_0xd203('0x10'),_0x5f4cf1,_0x2fd1fb[_0xd203('0x14')]['message']);return _0x1a6375(_0x2fd1fb['error'][_0xd203('0x15')]);}logger[_0xd203('0x14')](_0xd203('0x10'),_0x5f4cf1,_0x2fd1fb['error'][_0xd203('0x15')]);return _0x45adcf(_0x2fd1fb[_0xd203('0x14')]['message']);}else{logger[_0xd203('0xf')](_0xd203('0x10'),_0x5f4cf1,_0xd203('0x11'));_0x45adcf(_0x2fd1fb['result']['message']);}})['catch'](function(_0x19a603){logger[_0xd203('0x14')](_0xd203('0x10'),_0x5f4cf1,_0x19a603);_0x1a6375(_0x19a603);});});}exports[_0xd203('0x16')]=function(_0x513dc4){var _0x21de85=this;return new Promise(function(_0x3c1945,_0x2c2b3f){return db[_0xd203('0x17')][_0xd203('0x18')]({'raw':_0x513dc4[_0xd203('0x19')]?_0x513dc4[_0xd203('0x19')][_0xd203('0x1a')]===undefined?!![]:![]:!![],'where':_0x513dc4['options']?_0x513dc4[_0xd203('0x19')]['where']||null:null,'attributes':_0x513dc4['options']?_0x513dc4[_0xd203('0x19')][_0xd203('0x1b')]||null:null,'limit':_0x513dc4['options']?_0x513dc4[_0xd203('0x19')][_0xd203('0x1c')]||null:null,'include':_0x513dc4[_0xd203('0x19')]?_0x513dc4[_0xd203('0x19')][_0xd203('0x1d')]?_[_0xd203('0x1e')](_0x513dc4[_0xd203('0x19')][_0xd203('0x1d')],function(_0x2403d8){return{'model':db[_0x2403d8['model']],'as':_0x2403d8['as'],'attributes':_0x2403d8[_0xd203('0x1b')],'include':_0x2403d8[_0xd203('0x1d')]?_['map'](_0x2403d8['include'],function(_0x4fab22){return{'model':db[_0x4fab22[_0xd203('0x1f')]],'as':_0x4fab22['as'],'attributes':_0x4fab22[_0xd203('0x1b')],'include':_0x4fab22['include']?_[_0xd203('0x1e')](_0x4fab22[_0xd203('0x1d')],function(_0xc9ab46){return{'model':db[_0xc9ab46[_0xd203('0x1f')]],'as':_0xc9ab46['as'],'attributes':_0xc9ab46['attributes']};}):[]};}):[]};}):[]:[]})[_0xd203('0xe')](function(_0x3cbeb9){logger[_0xd203('0xf')](_0xd203('0x16'),_0x513dc4);logger[_0xd203('0x12')](_0xd203('0x16'),_0x513dc4,JSON[_0xd203('0x13')](_0x3cbeb9));_0x3c1945(_0x3cbeb9);})[_0xd203('0x20')](function(_0x3a282c){logger['error'](_0xd203('0x16'),_0x3a282c[_0xd203('0x15')],_0x513dc4);_0x2c2b3f(_0x21de85[_0xd203('0x14')](0x1f4,_0x3a282c[_0xd203('0x15')]));});});};exports[_0xd203('0x21')]=function(_0x54d381){var _0x4a77e8=this;return new Promise(function(_0x2c93f7,_0xb7ec67){return db[_0xd203('0x17')][_0xd203('0x22')]({'raw':_0x54d381[_0xd203('0x19')]?_0x54d381['options'][_0xd203('0x1a')]===undefined?!![]:![]:!![],'where':_0x54d381[_0xd203('0x19')]?_0x54d381['options'][_0xd203('0x23')]||null:null,'attributes':_0x54d381['options']?_0x54d381['options'][_0xd203('0x1b')]||null:null,'include':_0x54d381['options']?_0x54d381['options'][_0xd203('0x1d')]?_[_0xd203('0x1e')](_0x54d381['options'][_0xd203('0x1d')],function(_0x4025a4){return{'model':db[_0x4025a4[_0xd203('0x1f')]],'as':_0x4025a4['as'],'attributes':_0x4025a4['attributes'],'include':_0x4025a4[_0xd203('0x1d')]?_[_0xd203('0x1e')](_0x4025a4[_0xd203('0x1d')],function(_0x142d07){return{'model':db[_0x142d07[_0xd203('0x1f')]],'as':_0x142d07['as'],'attributes':_0x142d07[_0xd203('0x1b')],'include':_0x142d07['include']?_[_0xd203('0x1e')](_0x142d07[_0xd203('0x1d')],function(_0x56770d){return{'model':db[_0x56770d[_0xd203('0x1f')]],'as':_0x56770d['as'],'attributes':_0x56770d[_0xd203('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd203('0xe')](function(_0x139f05){logger[_0xd203('0xf')](_0xd203('0x21'),_0x54d381);logger[_0xd203('0x12')](_0xd203('0x21'),_0x54d381,JSON[_0xd203('0x13')](_0x139f05));_0x2c93f7(_0x139f05);})[_0xd203('0x20')](function(_0x4d5df2){logger[_0xd203('0x14')]('ShowDeskAccount',_0x4d5df2[_0xd203('0x15')],_0x54d381);_0xb7ec67(_0x4a77e8[_0xd203('0x14')](0x1f4,_0x4d5df2[_0xd203('0x15')]));});});}; \ No newline at end of file +var _0x9b92=['include','map','model','ShowDeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetDeskAccount','DeskAccount','options','raw','attributes','limit'];(function(_0x35bd6c,_0x585087){var _0x2f421d=function(_0x42ae70){while(--_0x42ae70){_0x35bd6c['push'](_0x35bd6c['shift']());}};_0x2f421d(++_0x585087);}(_0x9b92,0xdd));var _0x29b9=function(_0x94e04c,_0x5752e3){_0x94e04c=_0x94e04c-0x0;var _0x3f9f6d=_0x9b92[_0x94e04c];return _0x3f9f6d;};'use strict';var _=require(_0x29b9('0x0'));var util=require(_0x29b9('0x1'));var moment=require(_0x29b9('0x2'));var BPromise=require(_0x29b9('0x3'));var rs=require(_0x29b9('0x4'));var fs=require('fs');var Redis=require(_0x29b9('0x5'));var db=require(_0x29b9('0x6'))['db'];var utils=require(_0x29b9('0x7'));var logger=require(_0x29b9('0x8'))(_0x29b9('0x9'));var config=require(_0x29b9('0xa'));var jayson=require(_0x29b9('0xb'));var client=jayson['client'][_0x29b9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x10c82b,_0x210590,_0x48d5c6){return new BPromise(function(_0x8a809,_0x5ad157){return client[_0x29b9('0xd')](_0x10c82b,_0x48d5c6)[_0x29b9('0xe')](function(_0x2d0c24){logger[_0x29b9('0xf')](_0x29b9('0x10'),_0x210590,'request\x20sent');logger[_0x29b9('0x11')](_0x29b9('0x12'),_0x210590,_0x29b9('0x13'),JSON[_0x29b9('0x14')](_0x2d0c24));if(_0x2d0c24['error']){if(_0x2d0c24['error']['code']===0x1f4){logger[_0x29b9('0x15')]('DeskAccount,\x20%s,\x20%s',_0x210590,_0x2d0c24[_0x29b9('0x15')][_0x29b9('0x16')]);return _0x5ad157(_0x2d0c24[_0x29b9('0x15')][_0x29b9('0x16')]);}logger[_0x29b9('0x15')](_0x29b9('0x10'),_0x210590,_0x2d0c24[_0x29b9('0x15')][_0x29b9('0x16')]);return _0x8a809(_0x2d0c24[_0x29b9('0x15')]['message']);}else{logger['info'](_0x29b9('0x10'),_0x210590,_0x29b9('0x13'));_0x8a809(_0x2d0c24[_0x29b9('0x17')][_0x29b9('0x16')]);}})[_0x29b9('0x18')](function(_0x15bc1b){logger[_0x29b9('0x15')](_0x29b9('0x10'),_0x210590,_0x15bc1b);_0x5ad157(_0x15bc1b);});});}exports[_0x29b9('0x19')]=function(_0x2828e8){var _0x21cff8=this;return new Promise(function(_0x56c0e6,_0x40b20a){return db[_0x29b9('0x1a')]['findAll']({'raw':_0x2828e8[_0x29b9('0x1b')]?_0x2828e8[_0x29b9('0x1b')][_0x29b9('0x1c')]===undefined?!![]:![]:!![],'where':_0x2828e8[_0x29b9('0x1b')]?_0x2828e8[_0x29b9('0x1b')]['where']||null:null,'attributes':_0x2828e8[_0x29b9('0x1b')]?_0x2828e8[_0x29b9('0x1b')][_0x29b9('0x1d')]||null:null,'limit':_0x2828e8['options']?_0x2828e8[_0x29b9('0x1b')][_0x29b9('0x1e')]||null:null,'include':_0x2828e8[_0x29b9('0x1b')]?_0x2828e8[_0x29b9('0x1b')][_0x29b9('0x1f')]?_[_0x29b9('0x20')](_0x2828e8[_0x29b9('0x1b')]['include'],function(_0x5c8f1e){return{'model':db[_0x5c8f1e[_0x29b9('0x21')]],'as':_0x5c8f1e['as'],'attributes':_0x5c8f1e[_0x29b9('0x1d')],'include':_0x5c8f1e['include']?_[_0x29b9('0x20')](_0x5c8f1e[_0x29b9('0x1f')],function(_0x182078){return{'model':db[_0x182078['model']],'as':_0x182078['as'],'attributes':_0x182078[_0x29b9('0x1d')],'include':_0x182078[_0x29b9('0x1f')]?_[_0x29b9('0x20')](_0x182078[_0x29b9('0x1f')],function(_0x49422c){return{'model':db[_0x49422c['model']],'as':_0x49422c['as'],'attributes':_0x49422c[_0x29b9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x29b9('0xe')](function(_0x15c122){logger[_0x29b9('0xf')]('GetDeskAccount',_0x2828e8);logger[_0x29b9('0x11')](_0x29b9('0x19'),_0x2828e8,JSON[_0x29b9('0x14')](_0x15c122));_0x56c0e6(_0x15c122);})[_0x29b9('0x18')](function(_0x5b4ac6){logger['error'](_0x29b9('0x19'),_0x5b4ac6['message'],_0x2828e8);_0x40b20a(_0x21cff8['error'](0x1f4,_0x5b4ac6[_0x29b9('0x16')]));});});};exports[_0x29b9('0x22')]=function(_0x59f1a7){var _0x1b06fd=this;return new Promise(function(_0x5e6484,_0x4379e2){return db[_0x29b9('0x1a')][_0x29b9('0x23')]({'raw':_0x59f1a7['options']?_0x59f1a7['options'][_0x29b9('0x1c')]===undefined?!![]:![]:!![],'where':_0x59f1a7[_0x29b9('0x1b')]?_0x59f1a7['options']['where']||null:null,'attributes':_0x59f1a7[_0x29b9('0x1b')]?_0x59f1a7[_0x29b9('0x1b')]['attributes']||null:null,'include':_0x59f1a7[_0x29b9('0x1b')]?_0x59f1a7[_0x29b9('0x1b')]['include']?_[_0x29b9('0x20')](_0x59f1a7[_0x29b9('0x1b')][_0x29b9('0x1f')],function(_0x14d6b0){return{'model':db[_0x14d6b0[_0x29b9('0x21')]],'as':_0x14d6b0['as'],'attributes':_0x14d6b0['attributes'],'include':_0x14d6b0[_0x29b9('0x1f')]?_[_0x29b9('0x20')](_0x14d6b0[_0x29b9('0x1f')],function(_0x5a53b1){return{'model':db[_0x5a53b1[_0x29b9('0x21')]],'as':_0x5a53b1['as'],'attributes':_0x5a53b1[_0x29b9('0x1d')],'include':_0x5a53b1[_0x29b9('0x1f')]?_[_0x29b9('0x20')](_0x5a53b1[_0x29b9('0x1f')],function(_0x884164){return{'model':db[_0x884164[_0x29b9('0x21')]],'as':_0x884164['as'],'attributes':_0x884164[_0x29b9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x29b9('0xe')](function(_0x56cc43){logger['info'](_0x29b9('0x22'),_0x59f1a7);logger[_0x29b9('0x11')]('ShowDeskAccount',_0x59f1a7,JSON[_0x29b9('0x14')](_0x56cc43));_0x5e6484(_0x56cc43);})[_0x29b9('0x18')](function(_0x45e433){logger[_0x29b9('0x15')](_0x29b9('0x22'),_0x45e433[_0x29b9('0x16')],_0x59f1a7);_0x4379e2(_0x1b06fd[_0x29b9('0x15')](0x1f4,_0x45e433[_0x29b9('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index a651e81..ff5cfe7 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 _0x3e74=['show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','/:id/tags','setTags','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x3485a2,_0x1886fb){var _0x368894=function(_0x5d4b89){while(--_0x5d4b89){_0x3485a2['push'](_0x3485a2['shift']());}};_0x368894(++_0x1886fb);}(_0x3e74,0x175));var _0x43e7=function(_0x5cc7fe,_0x4ce90e){_0x5cc7fe=_0x5cc7fe-0x0;var _0x2005dc=_0x3e74[_0x5cc7fe];return _0x2005dc;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/subjects',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/tags',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0x13'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router['put']('/:id',auth[_0x43e7('0x8')](),controller[_0x43e7('0x15')]);router[_0x43e7('0x16')](_0x43e7('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x43e7('0x17')]=router; \ No newline at end of file +var _0x9957=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x168374,_0x3f4156){var _0x406865=function(_0x42e8e2){while(--_0x42e8e2){_0x168374['push'](_0x168374['shift']());}};_0x406865(++_0x3f4156);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/fields',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/descriptions',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller['destroy']);module[_0x7995('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index b9a619e..3afc95a 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 _0x17f8=['exports','STRING','sequelize'];(function(_0x5f5cce,_0x138cc5){var _0x705ecf=function(_0x28bc5d){while(--_0x28bc5d){_0x5f5cce['push'](_0x5f5cce['shift']());}};_0x705ecf(++_0x138cc5);}(_0x17f8,0x1a3));var _0x817f=function(_0x1b1604,_0x368535){_0x1b1604=_0x1b1604-0x0;var _0x57918d=_0x17f8[_0x1b1604];return _0x57918d;};'use strict';var Sequelize=require(_0x817f('0x0'));module[_0x817f('0x1')]={'name':{'type':Sequelize[_0x817f('0x2')]},'description':{'type':Sequelize[_0x817f('0x2')]}}; \ No newline at end of file +var _0x5b1e=['sequelize','STRING'];(function(_0xd8768,_0x3fedcb){var _0x46228f=function(_0x65a836){while(--_0x65a836){_0xd8768['push'](_0xd8768['shift']());}};_0x46228f(++_0x3fedcb);}(_0x5b1e,0x1bc));var _0xe5b1=function(_0x2b82b0,_0x5b5ec1){_0x2b82b0=_0x2b82b0-0x0;var _0x47483d=_0x5b1e[_0x2b82b0];return _0x47483d;};'use strict';var Sequelize=require(_0xe5b1('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe5b1('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 9e1a7d3..53ac312 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 _0x3065=['../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','Content-Range','save','update','then','error','stack','name','send','map','DeskConfiguration','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','sort','where','VIRTUAL','filter','options','include','findAll','catch','includeAll','find','create','body','params','destroy','getFields','findOne','pick','merge','nolimit','DeskField','order','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x507e98,_0x502efd){var _0x3da036=function(_0x769608){while(--_0x769608){_0x507e98['push'](_0x507e98['shift']());}};_0x3da036(++_0x502efd);}(_0x3065,0x90));var _0x5306=function(_0x3c27eb,_0x47d0f6){_0x3c27eb=_0x3c27eb-0x0;var _0x96a586=_0x3065[_0x3c27eb];return _0x96a586;};'use strict';var emlformat=require(_0x5306('0x0'));var rimraf=require(_0x5306('0x1'));var zipdir=require(_0x5306('0x2'));var jsonpatch=require(_0x5306('0x3'));var rp=require(_0x5306('0x4'));var moment=require(_0x5306('0x5'));var BPromise=require(_0x5306('0x6'));var Mustache=require(_0x5306('0x7'));var util=require('util');var path=require(_0x5306('0x8'));var sox=require('sox');var csv=require(_0x5306('0x9'));var ejs=require(_0x5306('0xa'));var fs=require('fs');var fs_extra=require(_0x5306('0xb'));var _=require(_0x5306('0xc'));var squel=require(_0x5306('0xd'));var crypto=require(_0x5306('0xe'));var jsforce=require(_0x5306('0xf'));var deskjs=require(_0x5306('0x10'));var toCsv=require('to-csv');var querystring=require(_0x5306('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5306('0x12'));var as=require(_0x5306('0x13'));var hardwareService=require(_0x5306('0x14'));var logger=require(_0x5306('0x15'))(_0x5306('0x16'));var utils=require('../../config/utils');var config=require(_0x5306('0x17'));var licenseUtil=require(_0x5306('0x18'));var db=require(_0x5306('0x19'))['db'];function respondWithStatusCode(_0x3313ca,_0xf9b97){_0xf9b97=_0xf9b97||0xcc;return function(_0x86468c){if(_0x86468c){return _0x3313ca[_0x5306('0x1a')](_0xf9b97);}return _0x3313ca['status'](_0xf9b97)[_0x5306('0x1b')]();};}function respondWithResult(_0xaa9e9e,_0x4d64b8){_0x4d64b8=_0x4d64b8||0xc8;return function(_0x40d0c8){if(_0x40d0c8){return _0xaa9e9e[_0x5306('0x1c')](_0x4d64b8)[_0x5306('0x1d')](_0x40d0c8);}};}function respondWithFilteredResult(_0x3f5767,_0x565825){return function(_0x463ec9){if(_0x463ec9){var _0x151ab4=typeof _0x565825[_0x5306('0x1e')]===_0x5306('0x1f')&&typeof _0x565825['limit']===_0x5306('0x1f');var _0x348e0d=_0x463ec9[_0x5306('0x20')];var _0x2c3c69=_0x151ab4?0x0:_0x565825[_0x5306('0x1e')];var _0x4e4d0d=_0x151ab4?_0x463ec9[_0x5306('0x20')]:_0x565825[_0x5306('0x1e')]+_0x565825['limit'];var _0xc4f09a;if(_0x4e4d0d>=_0x348e0d){_0x4e4d0d=_0x348e0d;_0xc4f09a=0xc8;}else{_0xc4f09a=0xce;}_0x3f5767[_0x5306('0x1c')](_0xc4f09a);return _0x3f5767['set'](_0x5306('0x21'),_0x2c3c69+'-'+_0x4e4d0d+'/'+_0x348e0d)[_0x5306('0x1d')](_0x463ec9);}return null;};}function patchUpdates(_0x1516db){return function(_0x2a42ee){try{jsonpatch['apply'](_0x2a42ee,_0x1516db,!![]);}catch(_0x27a92e){return BPromise['reject'](_0x27a92e);}return _0x2a42ee[_0x5306('0x22')]();};}function saveUpdates(_0xd261bc,_0x4ee522){return function(_0x36507d){if(_0x36507d){return _0x36507d[_0x5306('0x23')](_0xd261bc)[_0x5306('0x24')](function(_0xf92aad){return _0xf92aad;});}return null;};}function removeEntity(_0xc35cfc,_0x37b7e6){return function(_0x3691af){if(_0x3691af){return _0x3691af['destroy']()[_0x5306('0x24')](function(){_0xc35cfc[_0x5306('0x1c')](0xcc)[_0x5306('0x1b')]();});}};}function handleEntityNotFound(_0x4a74d5,_0x35d34f){return function(_0x5767e9){if(!_0x5767e9){_0x4a74d5[_0x5306('0x1a')](0x194);}return _0x5767e9;};}function handleError(_0x231ab8,_0x490d60){_0x490d60=_0x490d60||0x1f4;return function(_0x20fb80){logger[_0x5306('0x25')](_0x20fb80[_0x5306('0x26')]);if(_0x20fb80[_0x5306('0x27')]){delete _0x20fb80[_0x5306('0x27')];}_0x231ab8[_0x5306('0x1c')](_0x490d60)[_0x5306('0x28')](_0x20fb80);};}exports['index']=function(_0xb9f3a2,_0x2b2f7a){var _0x120bc7={},_0x49ae55={},_0xc45275={'count':0x0,'rows':[]};var _0x1eab8f=_[_0x5306('0x29')](db[_0x5306('0x2a')][_0x5306('0x2b')],function(_0x1e6453){return{'name':_0x1e6453[_0x5306('0x2c')],'type':_0x1e6453[_0x5306('0x2d')][_0x5306('0x2e')]};});_0x49ae55[_0x5306('0x2f')]=_[_0x5306('0x29')](_0x1eab8f,'name');_0x49ae55['query']=_[_0x5306('0x30')](_0xb9f3a2[_0x5306('0x31')]);_0x49ae55[_0x5306('0x32')]=_[_0x5306('0x33')](_0x49ae55['model'],_0x49ae55[_0x5306('0x31')]);_0x120bc7['attributes']=_[_0x5306('0x33')](_0x49ae55[_0x5306('0x2f')],qs[_0x5306('0x34')](_0xb9f3a2[_0x5306('0x31')][_0x5306('0x34')]));_0x120bc7[_0x5306('0x35')]=_0x120bc7['attributes'][_0x5306('0x36')]?_0x120bc7[_0x5306('0x35')]:_0x49ae55[_0x5306('0x2f')];if(!_0xb9f3a2[_0x5306('0x31')][_0x5306('0x37')]('nolimit')){_0x120bc7[_0x5306('0x38')]=qs[_0x5306('0x38')](_0xb9f3a2['query'][_0x5306('0x38')]);_0x120bc7[_0x5306('0x1e')]=qs[_0x5306('0x1e')](_0xb9f3a2[_0x5306('0x31')]['offset']);}_0x120bc7['order']=qs[_0x5306('0x39')](_0xb9f3a2[_0x5306('0x31')]['sort']);_0x120bc7[_0x5306('0x3a')]=qs[_0x5306('0x32')](_['pick'](_0xb9f3a2['query'],_0x49ae55[_0x5306('0x32')]),_0x1eab8f);if(_0xb9f3a2[_0x5306('0x31')]['filter']){_0x120bc7['where']=_['merge'](_0x120bc7['where'],{'$or':_[_0x5306('0x29')](_0x1eab8f,function(_0x57a235){if(_0x57a235[_0x5306('0x2d')]!==_0x5306('0x3b')){var _0x2b46f2={};_0x2b46f2[_0x57a235[_0x5306('0x27')]]={'$like':'%'+_0xb9f3a2[_0x5306('0x31')][_0x5306('0x3c')]+'%'};return _0x2b46f2;}})});}_0x120bc7=_['merge']({},_0x120bc7,_0xb9f3a2[_0x5306('0x3d')]);var _0x3a1290={'where':_0x120bc7['where']};return db[_0x5306('0x2a')]['count'](_0x3a1290)['then'](function(_0x41a635){_0xc45275[_0x5306('0x20')]=_0x41a635;if(_0xb9f3a2[_0x5306('0x31')]['includeAll']){_0x120bc7[_0x5306('0x3e')]=[{'all':!![]}];}return db[_0x5306('0x2a')][_0x5306('0x3f')](_0x120bc7);})[_0x5306('0x24')](function(_0x16e38e){_0xc45275['rows']=_0x16e38e;return _0xc45275;})['then'](respondWithFilteredResult(_0x2b2f7a,_0x120bc7))[_0x5306('0x40')](handleError(_0x2b2f7a,null));};exports['show']=function(_0x3e43fe,_0x517ca1){var _0x306f3c={'raw':![],'where':{'id':_0x3e43fe['params']['id']}},_0x4613bd={};_0x4613bd[_0x5306('0x2f')]=_[_0x5306('0x30')](db['DeskConfiguration'][_0x5306('0x2b')]);_0x4613bd[_0x5306('0x31')]=_[_0x5306('0x30')](_0x3e43fe[_0x5306('0x31')]);_0x4613bd['filters']=_['intersection'](_0x4613bd[_0x5306('0x2f')],_0x4613bd[_0x5306('0x31')]);_0x306f3c[_0x5306('0x35')]=_[_0x5306('0x33')](_0x4613bd[_0x5306('0x2f')],qs[_0x5306('0x34')](_0x3e43fe[_0x5306('0x31')][_0x5306('0x34')]));_0x306f3c['attributes']=_0x306f3c[_0x5306('0x35')][_0x5306('0x36')]?_0x306f3c[_0x5306('0x35')]:_0x4613bd[_0x5306('0x2f')];if(_0x3e43fe[_0x5306('0x31')][_0x5306('0x41')]){_0x306f3c['include']=[{'all':!![]}];}_0x306f3c=_['merge']({},_0x306f3c,_0x3e43fe['options']);return db[_0x5306('0x2a')][_0x5306('0x42')](_0x306f3c)[_0x5306('0x24')](handleEntityNotFound(_0x517ca1,null))[_0x5306('0x24')](respondWithResult(_0x517ca1,null))[_0x5306('0x40')](handleError(_0x517ca1,null));};exports[_0x5306('0x43')]=function(_0x2100af,_0x332807){return db[_0x5306('0x2a')][_0x5306('0x43')](_0x2100af['body'],{})[_0x5306('0x24')](respondWithResult(_0x332807,0xc9))[_0x5306('0x40')](handleError(_0x332807,null));};exports[_0x5306('0x23')]=function(_0x2fec5e,_0x3584bc){if(_0x2fec5e[_0x5306('0x44')]['id']){delete _0x2fec5e[_0x5306('0x44')]['id'];}return db[_0x5306('0x2a')][_0x5306('0x42')]({'where':{'id':_0x2fec5e[_0x5306('0x45')]['id']}})[_0x5306('0x24')](handleEntityNotFound(_0x3584bc,null))[_0x5306('0x24')](saveUpdates(_0x2fec5e['body'],null))[_0x5306('0x24')](respondWithResult(_0x3584bc,null))[_0x5306('0x40')](handleError(_0x3584bc,null));};exports[_0x5306('0x46')]=function(_0x5dbeda,_0x42f3a3){return db[_0x5306('0x2a')][_0x5306('0x42')]({'where':{'id':_0x5dbeda['params']['id']}})[_0x5306('0x24')](handleEntityNotFound(_0x42f3a3,null))['then'](removeEntity(_0x42f3a3,null))[_0x5306('0x40')](handleError(_0x42f3a3,null));};exports[_0x5306('0x47')]=function(_0x10f53c,_0x435a35,_0x2b5781){var _0x2f15d3={};var _0x9b7a27={};var _0x16a6d8;var _0x5ad30c;return db['DeskConfiguration'][_0x5306('0x48')]({'where':{'id':_0x10f53c[_0x5306('0x45')]['id']}})[_0x5306('0x24')](handleEntityNotFound(_0x435a35,null))[_0x5306('0x24')](function(_0x40dd22){if(_0x40dd22){_0x16a6d8=_0x40dd22;_0x9b7a27[_0x5306('0x2f')]=_[_0x5306('0x30')](db['DeskField'][_0x5306('0x2b')]);_0x9b7a27[_0x5306('0x31')]=_['keys'](_0x10f53c[_0x5306('0x31')]);_0x9b7a27[_0x5306('0x32')]=_['intersection'](_0x9b7a27['model'],_0x9b7a27[_0x5306('0x31')]);_0x2f15d3[_0x5306('0x35')]=_[_0x5306('0x33')](_0x9b7a27['model'],qs[_0x5306('0x34')](_0x10f53c['query'][_0x5306('0x34')]));_0x2f15d3[_0x5306('0x35')]=_0x2f15d3['attributes'][_0x5306('0x36')]?_0x2f15d3[_0x5306('0x35')]:_0x9b7a27[_0x5306('0x2f')];_0x2f15d3['order']=qs[_0x5306('0x39')](_0x10f53c[_0x5306('0x31')][_0x5306('0x39')]);_0x2f15d3['where']=qs[_0x5306('0x32')](_[_0x5306('0x49')](_0x10f53c[_0x5306('0x31')],_0x9b7a27[_0x5306('0x32')]));if(_0x10f53c[_0x5306('0x31')]['filter']){_0x2f15d3['where']=_[_0x5306('0x4a')](_0x2f15d3[_0x5306('0x3a')],{'$or':_[_0x5306('0x29')](_0x2f15d3[_0x5306('0x35')],function(_0x3cc943){var _0x19803d={};_0x19803d[_0x3cc943]={'$like':'%'+_0x10f53c[_0x5306('0x31')][_0x5306('0x3c')]+'%'};return _0x19803d;})});}_0x2f15d3=_[_0x5306('0x4a')]({},_0x2f15d3,_0x10f53c['options']);return _0x16a6d8['getFields'](_0x2f15d3);}})[_0x5306('0x24')](function(_0x54f8e){if(_0x54f8e){_0x5ad30c=_0x54f8e[_0x5306('0x36')];if(!_0x10f53c[_0x5306('0x31')][_0x5306('0x37')](_0x5306('0x4b'))){_0x2f15d3[_0x5306('0x38')]=qs['limit'](_0x10f53c[_0x5306('0x31')][_0x5306('0x38')]);_0x2f15d3[_0x5306('0x1e')]=qs['offset'](_0x10f53c['query']['offset']);}return _0x16a6d8[_0x5306('0x47')](_0x2f15d3);}})['then'](function(_0x5c01c9){if(_0x5c01c9){return _0x5c01c9?{'count':_0x5ad30c,'rows':_0x5c01c9}:null;}})['then'](respondWithResult(_0x435a35,null))['catch'](handleError(_0x435a35,null));};exports['getSubjects']=function(_0x1fe9ff,_0x4567f5,_0x45d894){var _0x5dbb33={};var _0x5c11eb={};var _0x876b43;var _0xbaccaf;return db[_0x5306('0x2a')][_0x5306('0x48')]({'where':{'id':_0x1fe9ff['params']['id']}})['then'](handleEntityNotFound(_0x4567f5,null))[_0x5306('0x24')](function(_0x190358){if(_0x190358){_0x876b43=_0x190358;_0x5c11eb[_0x5306('0x2f')]=_['keys'](db[_0x5306('0x4c')][_0x5306('0x2b')]);_0x5c11eb[_0x5306('0x31')]=_[_0x5306('0x30')](_0x1fe9ff['query']);_0x5c11eb[_0x5306('0x32')]=_[_0x5306('0x33')](_0x5c11eb['model'],_0x5c11eb[_0x5306('0x31')]);_0x5dbb33[_0x5306('0x35')]=_['intersection'](_0x5c11eb[_0x5306('0x2f')],qs[_0x5306('0x34')](_0x1fe9ff[_0x5306('0x31')][_0x5306('0x34')]));_0x5dbb33[_0x5306('0x35')]=_0x5dbb33[_0x5306('0x35')]['length']?_0x5dbb33[_0x5306('0x35')]:_0x5c11eb[_0x5306('0x2f')];_0x5dbb33[_0x5306('0x4d')]=qs['sort'](_0x1fe9ff[_0x5306('0x31')][_0x5306('0x39')]);_0x5dbb33[_0x5306('0x3a')]=qs[_0x5306('0x32')](_['pick'](_0x1fe9ff[_0x5306('0x31')],_0x5c11eb['filters']));if(_0x1fe9ff[_0x5306('0x31')][_0x5306('0x3c')]){_0x5dbb33[_0x5306('0x3a')]=_[_0x5306('0x4a')](_0x5dbb33[_0x5306('0x3a')],{'$or':_[_0x5306('0x29')](_0x5dbb33[_0x5306('0x35')],function(_0x5a26cf){var _0x695a35={};_0x695a35[_0x5a26cf]={'$like':'%'+_0x1fe9ff['query'][_0x5306('0x3c')]+'%'};return _0x695a35;})});}_0x5dbb33=_[_0x5306('0x4a')]({},_0x5dbb33,_0x1fe9ff[_0x5306('0x3d')]);return _0x876b43[_0x5306('0x4e')](_0x5dbb33);}})[_0x5306('0x24')](function(_0x109ad6){if(_0x109ad6){_0xbaccaf=_0x109ad6[_0x5306('0x36')];if(!_0x1fe9ff[_0x5306('0x31')][_0x5306('0x37')](_0x5306('0x4b'))){_0x5dbb33[_0x5306('0x38')]=qs[_0x5306('0x38')](_0x1fe9ff['query']['limit']);_0x5dbb33[_0x5306('0x1e')]=qs[_0x5306('0x1e')](_0x1fe9ff[_0x5306('0x31')][_0x5306('0x1e')]);}return _0x876b43[_0x5306('0x4e')](_0x5dbb33);}})[_0x5306('0x24')](function(_0x1c61fa){if(_0x1c61fa){return _0x1c61fa?{'count':_0xbaccaf,'rows':_0x1c61fa}:null;}})[_0x5306('0x24')](respondWithResult(_0x4567f5,null))['catch'](handleError(_0x4567f5,null));};exports['getDescriptions']=function(_0x4ff35f,_0xf5cc73,_0x4846b0){var _0x5ea33b={};var _0x5585bb={};var _0x468334;var _0x543df3;return db['DeskConfiguration']['findOne']({'where':{'id':_0x4ff35f['params']['id']}})[_0x5306('0x24')](handleEntityNotFound(_0xf5cc73,null))['then'](function(_0x639243){if(_0x639243){_0x468334=_0x639243;_0x5585bb[_0x5306('0x2f')]=_[_0x5306('0x30')](db[_0x5306('0x4c')][_0x5306('0x2b')]);_0x5585bb[_0x5306('0x31')]=_[_0x5306('0x30')](_0x4ff35f[_0x5306('0x31')]);_0x5585bb[_0x5306('0x32')]=_[_0x5306('0x33')](_0x5585bb[_0x5306('0x2f')],_0x5585bb[_0x5306('0x31')]);_0x5ea33b[_0x5306('0x35')]=_['intersection'](_0x5585bb[_0x5306('0x2f')],qs['fields'](_0x4ff35f[_0x5306('0x31')]['fields']));_0x5ea33b[_0x5306('0x35')]=_0x5ea33b[_0x5306('0x35')][_0x5306('0x36')]?_0x5ea33b[_0x5306('0x35')]:_0x5585bb['model'];_0x5ea33b[_0x5306('0x4d')]=qs[_0x5306('0x39')](_0x4ff35f[_0x5306('0x31')][_0x5306('0x39')]);_0x5ea33b[_0x5306('0x3a')]=qs[_0x5306('0x32')](_[_0x5306('0x49')](_0x4ff35f[_0x5306('0x31')],_0x5585bb[_0x5306('0x32')]));if(_0x4ff35f[_0x5306('0x31')]['filter']){_0x5ea33b[_0x5306('0x3a')]=_['merge'](_0x5ea33b[_0x5306('0x3a')],{'$or':_[_0x5306('0x29')](_0x5ea33b[_0x5306('0x35')],function(_0x20e973){var _0x167efc={};_0x167efc[_0x20e973]={'$like':'%'+_0x4ff35f[_0x5306('0x31')][_0x5306('0x3c')]+'%'};return _0x167efc;})});}_0x5ea33b=_['merge']({},_0x5ea33b,_0x4ff35f[_0x5306('0x3d')]);return _0x468334['getDescriptions'](_0x5ea33b);}})['then'](function(_0x3e20d4){if(_0x3e20d4){_0x543df3=_0x3e20d4['length'];if(!_0x4ff35f[_0x5306('0x31')][_0x5306('0x37')]('nolimit')){_0x5ea33b[_0x5306('0x38')]=qs[_0x5306('0x38')](_0x4ff35f[_0x5306('0x31')]['limit']);_0x5ea33b['offset']=qs['offset'](_0x4ff35f[_0x5306('0x31')][_0x5306('0x1e')]);}return _0x468334[_0x5306('0x4f')](_0x5ea33b);}})[_0x5306('0x24')](function(_0x9ad752){if(_0x9ad752){return _0x9ad752?{'count':_0x543df3,'rows':_0x9ad752}:null;}})[_0x5306('0x24')](respondWithResult(_0xf5cc73,null))[_0x5306('0x40')](handleError(_0xf5cc73,null));};exports[_0x5306('0x50')]=function(_0x4ea723,_0x5b4e06,_0x220ead){var _0x2b50b3={};var _0xe25be0={};var _0xbb2f7b;var _0x5bcc0a;return db[_0x5306('0x2a')]['findOne']({'where':{'id':_0x4ea723[_0x5306('0x45')]['id']}})[_0x5306('0x24')](handleEntityNotFound(_0x5b4e06,null))[_0x5306('0x24')](function(_0x2050e3){if(_0x2050e3){_0xbb2f7b=_0x2050e3;_0xe25be0[_0x5306('0x2f')]=_[_0x5306('0x30')](db[_0x5306('0x51')][_0x5306('0x2b')]);_0xe25be0['query']=_[_0x5306('0x30')](_0x4ea723[_0x5306('0x31')]);_0xe25be0[_0x5306('0x32')]=_[_0x5306('0x33')](_0xe25be0[_0x5306('0x2f')],_0xe25be0['query']);_0x2b50b3[_0x5306('0x35')]=_['intersection'](_0xe25be0[_0x5306('0x2f')],qs[_0x5306('0x34')](_0x4ea723[_0x5306('0x31')][_0x5306('0x34')]));_0x2b50b3[_0x5306('0x35')]=_0x2b50b3['attributes'][_0x5306('0x36')]?_0x2b50b3[_0x5306('0x35')]:_0xe25be0['model'];_0x2b50b3[_0x5306('0x4d')]=qs['sort'](_0x4ea723[_0x5306('0x31')][_0x5306('0x39')]);_0x2b50b3[_0x5306('0x3a')]=qs[_0x5306('0x32')](_[_0x5306('0x49')](_0x4ea723[_0x5306('0x31')],_0xe25be0[_0x5306('0x32')]));if(_0x4ea723[_0x5306('0x31')][_0x5306('0x3c')]){_0x2b50b3[_0x5306('0x3a')]=_[_0x5306('0x4a')](_0x2b50b3[_0x5306('0x3a')],{'$or':_[_0x5306('0x29')](_0x2b50b3['attributes'],function(_0x42ad7a){var _0x5ae489={};_0x5ae489[_0x42ad7a]={'$like':'%'+_0x4ea723[_0x5306('0x31')][_0x5306('0x3c')]+'%'};return _0x5ae489;})});}_0x2b50b3=_[_0x5306('0x4a')]({},_0x2b50b3,_0x4ea723[_0x5306('0x3d')]);return _0xbb2f7b['getTags'](_0x2b50b3);}})[_0x5306('0x24')](function(_0x352e45){if(_0x352e45){_0x5bcc0a=_0x352e45[_0x5306('0x36')];if(!_0x4ea723[_0x5306('0x31')][_0x5306('0x37')]('nolimit')){_0x2b50b3[_0x5306('0x38')]=qs[_0x5306('0x38')](_0x4ea723[_0x5306('0x31')][_0x5306('0x38')]);_0x2b50b3[_0x5306('0x1e')]=qs[_0x5306('0x1e')](_0x4ea723[_0x5306('0x31')]['offset']);}return _0xbb2f7b[_0x5306('0x50')](_0x2b50b3);}})[_0x5306('0x24')](function(_0x107b53){if(_0x107b53){return _0x107b53?{'count':_0x5bcc0a,'rows':_0x107b53}:null;}})[_0x5306('0x24')](respondWithResult(_0x5b4e06,null))[_0x5306('0x40')](handleError(_0x5b4e06,null));};exports[_0x5306('0x52')]=function(_0x413ceb,_0xd02f72,_0x17a5f1){if(_0x413ceb[_0x5306('0x44')]['id']){delete _0x413ceb['body']['id'];}return db['DeskConfiguration'][_0x5306('0x48')]({'where':{'id':_0x413ceb['params']['id']}})[_0x5306('0x24')](handleEntityNotFound(_0xd02f72,null))[_0x5306('0x24')](function(_0x9978eb){if(_0x9978eb){return _0x9978eb[_0x5306('0x52')](_0x413ceb['body'][_0x5306('0x53')]||[]);}return null;})[_0x5306('0x24')](respondWithResult(_0xd02f72,null))[_0x5306('0x40')](handleError(_0xd02f72,null));}; \ No newline at end of file +var _0x0f85=['squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','sendStatus','name','send','index','map','fieldName','key','keys','query','filters','model','attributes','intersection','fields','length','order','sort','where','pick','merge','VIRTUAL','filter','options','DeskConfiguration','findAll','rows','catch','show','rawAttributes','includeAll','include','find','create','body','params','DeskField','getFields','hasOwnProperty','nolimit','findOne','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','moment','mustache','util','to-csv','ejs','fs-extra','lodash'];(function(_0x2cee71,_0x1cf994){var _0x4da250=function(_0x295baf){while(--_0x295baf){_0x2cee71['push'](_0x2cee71['shift']());}};_0x4da250(++_0x1cf994);}(_0x0f85,0x186));var _0x50f8=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x0f85[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0x50f8('0x0'));var rimraf=require(_0x50f8('0x1'));var zipdir=require(_0x50f8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x50f8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x50f8('0x4'));var util=require(_0x50f8('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x50f8('0x6'));var ejs=require(_0x50f8('0x7'));var fs=require('fs');var fs_extra=require(_0x50f8('0x8'));var _=require(_0x50f8('0x9'));var squel=require(_0x50f8('0xa'));var crypto=require(_0x50f8('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x50f8('0xc'));var Papa=require(_0x50f8('0xd'));var Redis=require(_0x50f8('0xe'));var authService=require(_0x50f8('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x50f8('0x10'));var hardwareService=require(_0x50f8('0x11'));var logger=require(_0x50f8('0x12'))('api');var utils=require(_0x50f8('0x13'));var config=require(_0x50f8('0x14'));var licenseUtil=require(_0x50f8('0x15'));var db=require(_0x50f8('0x16'))['db'];function respondWithStatusCode(_0x992918,_0x135964){_0x135964=_0x135964||0xcc;return function(_0x1a3455){if(_0x1a3455){return _0x992918['sendStatus'](_0x135964);}return _0x992918[_0x50f8('0x17')](_0x135964)[_0x50f8('0x18')]();};}function respondWithResult(_0x4a017b,_0x53767a){_0x53767a=_0x53767a||0xc8;return function(_0x8f5e8){if(_0x8f5e8){return _0x4a017b['status'](_0x53767a)[_0x50f8('0x19')](_0x8f5e8);}};}function respondWithFilteredResult(_0x2a411d,_0x2aab17){return function(_0x20340b){if(_0x20340b){var _0x45b249=typeof _0x2aab17[_0x50f8('0x1a')]===_0x50f8('0x1b')&&typeof _0x2aab17[_0x50f8('0x1c')]===_0x50f8('0x1b');var _0x28c4f6=_0x20340b[_0x50f8('0x1d')];var _0x4eb46e=_0x45b249?0x0:_0x2aab17['offset'];var _0x357c5d=_0x45b249?_0x20340b[_0x50f8('0x1d')]:_0x2aab17[_0x50f8('0x1a')]+_0x2aab17[_0x50f8('0x1c')];var _0x455d89;if(_0x357c5d>=_0x28c4f6){_0x357c5d=_0x28c4f6;_0x455d89=0xc8;}else{_0x455d89=0xce;}_0x2a411d[_0x50f8('0x17')](_0x455d89);return _0x2a411d[_0x50f8('0x1e')](_0x50f8('0x1f'),_0x4eb46e+'-'+_0x357c5d+'/'+_0x28c4f6)[_0x50f8('0x19')](_0x20340b);}return null;};}function patchUpdates(_0xc775ab){return function(_0x35ad95){try{jsonpatch[_0x50f8('0x20')](_0x35ad95,_0xc775ab,!![]);}catch(_0xac21c0){return BPromise['reject'](_0xac21c0);}return _0x35ad95['save']();};}function saveUpdates(_0x168d9f,_0x8da00c){return function(_0x4dc4eb){if(_0x4dc4eb){return _0x4dc4eb['update'](_0x168d9f)[_0x50f8('0x21')](function(_0x473ba5){return _0x473ba5;});}return null;};}function removeEntity(_0x5b086d,_0x524918){return function(_0x6ede21){if(_0x6ede21){return _0x6ede21[_0x50f8('0x22')]()[_0x50f8('0x21')](function(){_0x5b086d[_0x50f8('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xed5ee1,_0x566bdf){return function(_0x5f4c06){if(!_0x5f4c06){_0xed5ee1[_0x50f8('0x23')](0x194);}return _0x5f4c06;};}function handleError(_0x2166ad,_0x38e0db){_0x38e0db=_0x38e0db||0x1f4;return function(_0x3fef8f){logger['error'](_0x3fef8f['stack']);if(_0x3fef8f[_0x50f8('0x24')]){delete _0x3fef8f[_0x50f8('0x24')];}_0x2166ad[_0x50f8('0x17')](_0x38e0db)[_0x50f8('0x25')](_0x3fef8f);};}exports[_0x50f8('0x26')]=function(_0x1593bc,_0x13f40b){var _0x2f7d78={},_0x3775ce={},_0x4bd428={'count':0x0,'rows':[]};var _0x5a884e=_[_0x50f8('0x27')](db['DeskConfiguration']['rawAttributes'],function(_0x482cb5){return{'name':_0x482cb5[_0x50f8('0x28')],'type':_0x482cb5['type'][_0x50f8('0x29')]};});_0x3775ce['model']=_[_0x50f8('0x27')](_0x5a884e,_0x50f8('0x24'));_0x3775ce['query']=_[_0x50f8('0x2a')](_0x1593bc[_0x50f8('0x2b')]);_0x3775ce[_0x50f8('0x2c')]=_['intersection'](_0x3775ce[_0x50f8('0x2d')],_0x3775ce['query']);_0x2f7d78[_0x50f8('0x2e')]=_[_0x50f8('0x2f')](_0x3775ce[_0x50f8('0x2d')],qs[_0x50f8('0x30')](_0x1593bc[_0x50f8('0x2b')][_0x50f8('0x30')]));_0x2f7d78['attributes']=_0x2f7d78[_0x50f8('0x2e')][_0x50f8('0x31')]?_0x2f7d78[_0x50f8('0x2e')]:_0x3775ce[_0x50f8('0x2d')];if(!_0x1593bc[_0x50f8('0x2b')]['hasOwnProperty']('nolimit')){_0x2f7d78[_0x50f8('0x1c')]=qs[_0x50f8('0x1c')](_0x1593bc['query'][_0x50f8('0x1c')]);_0x2f7d78['offset']=qs[_0x50f8('0x1a')](_0x1593bc[_0x50f8('0x2b')][_0x50f8('0x1a')]);}_0x2f7d78[_0x50f8('0x32')]=qs[_0x50f8('0x33')](_0x1593bc[_0x50f8('0x2b')][_0x50f8('0x33')]);_0x2f7d78[_0x50f8('0x34')]=qs[_0x50f8('0x2c')](_[_0x50f8('0x35')](_0x1593bc[_0x50f8('0x2b')],_0x3775ce['filters']),_0x5a884e);if(_0x1593bc['query']['filter']){_0x2f7d78[_0x50f8('0x34')]=_[_0x50f8('0x36')](_0x2f7d78[_0x50f8('0x34')],{'$or':_[_0x50f8('0x27')](_0x5a884e,function(_0x19eb81){if(_0x19eb81['type']!==_0x50f8('0x37')){var _0x588261={};_0x588261[_0x19eb81[_0x50f8('0x24')]]={'$like':'%'+_0x1593bc[_0x50f8('0x2b')][_0x50f8('0x38')]+'%'};return _0x588261;}})});}_0x2f7d78=_[_0x50f8('0x36')]({},_0x2f7d78,_0x1593bc[_0x50f8('0x39')]);var _0x3c2fe6={'where':_0x2f7d78[_0x50f8('0x34')]};return db[_0x50f8('0x3a')][_0x50f8('0x1d')](_0x3c2fe6)[_0x50f8('0x21')](function(_0x45b634){_0x4bd428[_0x50f8('0x1d')]=_0x45b634;if(_0x1593bc['query']['includeAll']){_0x2f7d78['include']=[{'all':!![]}];}return db[_0x50f8('0x3a')][_0x50f8('0x3b')](_0x2f7d78);})['then'](function(_0x51ceca){_0x4bd428[_0x50f8('0x3c')]=_0x51ceca;return _0x4bd428;})[_0x50f8('0x21')](respondWithFilteredResult(_0x13f40b,_0x2f7d78))[_0x50f8('0x3d')](handleError(_0x13f40b,null));};exports[_0x50f8('0x3e')]=function(_0x5a8b23,_0x16bff0){var _0x4ab369={'raw':![],'where':{'id':_0x5a8b23['params']['id']}},_0x323949={};_0x323949[_0x50f8('0x2d')]=_['keys'](db[_0x50f8('0x3a')][_0x50f8('0x3f')]);_0x323949[_0x50f8('0x2b')]=_[_0x50f8('0x2a')](_0x5a8b23[_0x50f8('0x2b')]);_0x323949[_0x50f8('0x2c')]=_[_0x50f8('0x2f')](_0x323949[_0x50f8('0x2d')],_0x323949[_0x50f8('0x2b')]);_0x4ab369[_0x50f8('0x2e')]=_['intersection'](_0x323949[_0x50f8('0x2d')],qs[_0x50f8('0x30')](_0x5a8b23[_0x50f8('0x2b')][_0x50f8('0x30')]));_0x4ab369['attributes']=_0x4ab369['attributes'][_0x50f8('0x31')]?_0x4ab369[_0x50f8('0x2e')]:_0x323949[_0x50f8('0x2d')];if(_0x5a8b23[_0x50f8('0x2b')][_0x50f8('0x40')]){_0x4ab369[_0x50f8('0x41')]=[{'all':!![]}];}_0x4ab369=_[_0x50f8('0x36')]({},_0x4ab369,_0x5a8b23[_0x50f8('0x39')]);return db['DeskConfiguration'][_0x50f8('0x42')](_0x4ab369)[_0x50f8('0x21')](handleEntityNotFound(_0x16bff0,null))[_0x50f8('0x21')](respondWithResult(_0x16bff0,null))[_0x50f8('0x3d')](handleError(_0x16bff0,null));};exports[_0x50f8('0x43')]=function(_0x362633,_0x377e01){return db[_0x50f8('0x3a')][_0x50f8('0x43')](_0x362633[_0x50f8('0x44')],{})[_0x50f8('0x21')](respondWithResult(_0x377e01,0xc9))[_0x50f8('0x3d')](handleError(_0x377e01,null));};exports['update']=function(_0x1cca51,_0xfb7112){if(_0x1cca51[_0x50f8('0x44')]['id']){delete _0x1cca51[_0x50f8('0x44')]['id'];}return db[_0x50f8('0x3a')]['find']({'where':{'id':_0x1cca51[_0x50f8('0x45')]['id']}})[_0x50f8('0x21')](handleEntityNotFound(_0xfb7112,null))[_0x50f8('0x21')](saveUpdates(_0x1cca51[_0x50f8('0x44')],null))['then'](respondWithResult(_0xfb7112,null))[_0x50f8('0x3d')](handleError(_0xfb7112,null));};exports[_0x50f8('0x22')]=function(_0x1307ae,_0xe97ea0){return db['DeskConfiguration'][_0x50f8('0x42')]({'where':{'id':_0x1307ae['params']['id']}})[_0x50f8('0x21')](handleEntityNotFound(_0xe97ea0,null))[_0x50f8('0x21')](removeEntity(_0xe97ea0,null))[_0x50f8('0x3d')](handleError(_0xe97ea0,null));};exports['getFields']=function(_0x2d6c25,_0x5c5862,_0x3ba389){var _0x117488={};var _0x49047e={};var _0x2f7e40;var _0x31caf7;return db[_0x50f8('0x3a')]['findOne']({'where':{'id':_0x2d6c25[_0x50f8('0x45')]['id']}})[_0x50f8('0x21')](handleEntityNotFound(_0x5c5862,null))['then'](function(_0x12e0a9){if(_0x12e0a9){_0x2f7e40=_0x12e0a9;_0x49047e[_0x50f8('0x2d')]=_[_0x50f8('0x2a')](db[_0x50f8('0x46')][_0x50f8('0x3f')]);_0x49047e[_0x50f8('0x2b')]=_['keys'](_0x2d6c25[_0x50f8('0x2b')]);_0x49047e[_0x50f8('0x2c')]=_[_0x50f8('0x2f')](_0x49047e[_0x50f8('0x2d')],_0x49047e[_0x50f8('0x2b')]);_0x117488['attributes']=_[_0x50f8('0x2f')](_0x49047e[_0x50f8('0x2d')],qs[_0x50f8('0x30')](_0x2d6c25[_0x50f8('0x2b')]['fields']));_0x117488[_0x50f8('0x2e')]=_0x117488[_0x50f8('0x2e')]['length']?_0x117488[_0x50f8('0x2e')]:_0x49047e[_0x50f8('0x2d')];_0x117488[_0x50f8('0x32')]=qs['sort'](_0x2d6c25[_0x50f8('0x2b')][_0x50f8('0x33')]);_0x117488['where']=qs[_0x50f8('0x2c')](_[_0x50f8('0x35')](_0x2d6c25[_0x50f8('0x2b')],_0x49047e[_0x50f8('0x2c')]));if(_0x2d6c25[_0x50f8('0x2b')][_0x50f8('0x38')]){_0x117488[_0x50f8('0x34')]=_['merge'](_0x117488[_0x50f8('0x34')],{'$or':_[_0x50f8('0x27')](_0x117488[_0x50f8('0x2e')],function(_0x5ef56d){var _0x4d11de={};_0x4d11de[_0x5ef56d]={'$like':'%'+_0x2d6c25[_0x50f8('0x2b')][_0x50f8('0x38')]+'%'};return _0x4d11de;})});}_0x117488=_[_0x50f8('0x36')]({},_0x117488,_0x2d6c25[_0x50f8('0x39')]);return _0x2f7e40[_0x50f8('0x47')](_0x117488);}})[_0x50f8('0x21')](function(_0x31987e){if(_0x31987e){_0x31caf7=_0x31987e['length'];if(!_0x2d6c25[_0x50f8('0x2b')][_0x50f8('0x48')](_0x50f8('0x49'))){_0x117488['limit']=qs[_0x50f8('0x1c')](_0x2d6c25[_0x50f8('0x2b')][_0x50f8('0x1c')]);_0x117488[_0x50f8('0x1a')]=qs[_0x50f8('0x1a')](_0x2d6c25[_0x50f8('0x2b')][_0x50f8('0x1a')]);}return _0x2f7e40[_0x50f8('0x47')](_0x117488);}})[_0x50f8('0x21')](function(_0x570bce){if(_0x570bce){return _0x570bce?{'count':_0x31caf7,'rows':_0x570bce}:null;}})[_0x50f8('0x21')](respondWithResult(_0x5c5862,null))[_0x50f8('0x3d')](handleError(_0x5c5862,null));};exports['getSubjects']=function(_0x188b0e,_0x41f4a2,_0x540e17){var _0x3e5caf={};var _0x1f1a15={};var _0x461d01;var _0x296021;return db[_0x50f8('0x3a')][_0x50f8('0x4a')]({'where':{'id':_0x188b0e[_0x50f8('0x45')]['id']}})[_0x50f8('0x21')](handleEntityNotFound(_0x41f4a2,null))[_0x50f8('0x21')](function(_0x56515c){if(_0x56515c){_0x461d01=_0x56515c;_0x1f1a15[_0x50f8('0x2d')]=_[_0x50f8('0x2a')](db['DeskField'][_0x50f8('0x3f')]);_0x1f1a15[_0x50f8('0x2b')]=_[_0x50f8('0x2a')](_0x188b0e[_0x50f8('0x2b')]);_0x1f1a15[_0x50f8('0x2c')]=_['intersection'](_0x1f1a15[_0x50f8('0x2d')],_0x1f1a15['query']);_0x3e5caf['attributes']=_['intersection'](_0x1f1a15['model'],qs[_0x50f8('0x30')](_0x188b0e[_0x50f8('0x2b')][_0x50f8('0x30')]));_0x3e5caf[_0x50f8('0x2e')]=_0x3e5caf['attributes'][_0x50f8('0x31')]?_0x3e5caf['attributes']:_0x1f1a15[_0x50f8('0x2d')];_0x3e5caf[_0x50f8('0x32')]=qs['sort'](_0x188b0e[_0x50f8('0x2b')]['sort']);_0x3e5caf[_0x50f8('0x34')]=qs['filters'](_[_0x50f8('0x35')](_0x188b0e['query'],_0x1f1a15[_0x50f8('0x2c')]));if(_0x188b0e['query'][_0x50f8('0x38')]){_0x3e5caf['where']=_['merge'](_0x3e5caf[_0x50f8('0x34')],{'$or':_[_0x50f8('0x27')](_0x3e5caf['attributes'],function(_0x5969f3){var _0x56147f={};_0x56147f[_0x5969f3]={'$like':'%'+_0x188b0e[_0x50f8('0x2b')][_0x50f8('0x38')]+'%'};return _0x56147f;})});}_0x3e5caf=_['merge']({},_0x3e5caf,_0x188b0e[_0x50f8('0x39')]);return _0x461d01[_0x50f8('0x4b')](_0x3e5caf);}})['then'](function(_0x38563d){if(_0x38563d){_0x296021=_0x38563d[_0x50f8('0x31')];if(!_0x188b0e[_0x50f8('0x2b')][_0x50f8('0x48')]('nolimit')){_0x3e5caf['limit']=qs[_0x50f8('0x1c')](_0x188b0e[_0x50f8('0x2b')]['limit']);_0x3e5caf[_0x50f8('0x1a')]=qs[_0x50f8('0x1a')](_0x188b0e[_0x50f8('0x2b')][_0x50f8('0x1a')]);}return _0x461d01[_0x50f8('0x4b')](_0x3e5caf);}})[_0x50f8('0x21')](function(_0x2c890f){if(_0x2c890f){return _0x2c890f?{'count':_0x296021,'rows':_0x2c890f}:null;}})[_0x50f8('0x21')](respondWithResult(_0x41f4a2,null))['catch'](handleError(_0x41f4a2,null));};exports[_0x50f8('0x4c')]=function(_0x2b3256,_0x568fa1,_0xf2aba2){var _0x153e90={};var _0x33859a={};var _0x7bda58;var _0x24edab;return db['DeskConfiguration'][_0x50f8('0x4a')]({'where':{'id':_0x2b3256[_0x50f8('0x45')]['id']}})[_0x50f8('0x21')](handleEntityNotFound(_0x568fa1,null))[_0x50f8('0x21')](function(_0x4c032a){if(_0x4c032a){_0x7bda58=_0x4c032a;_0x33859a[_0x50f8('0x2d')]=_['keys'](db[_0x50f8('0x46')][_0x50f8('0x3f')]);_0x33859a[_0x50f8('0x2b')]=_[_0x50f8('0x2a')](_0x2b3256['query']);_0x33859a[_0x50f8('0x2c')]=_[_0x50f8('0x2f')](_0x33859a['model'],_0x33859a[_0x50f8('0x2b')]);_0x153e90[_0x50f8('0x2e')]=_[_0x50f8('0x2f')](_0x33859a[_0x50f8('0x2d')],qs[_0x50f8('0x30')](_0x2b3256[_0x50f8('0x2b')][_0x50f8('0x30')]));_0x153e90[_0x50f8('0x2e')]=_0x153e90['attributes'][_0x50f8('0x31')]?_0x153e90[_0x50f8('0x2e')]:_0x33859a['model'];_0x153e90[_0x50f8('0x32')]=qs[_0x50f8('0x33')](_0x2b3256[_0x50f8('0x2b')][_0x50f8('0x33')]);_0x153e90['where']=qs['filters'](_['pick'](_0x2b3256['query'],_0x33859a['filters']));if(_0x2b3256[_0x50f8('0x2b')][_0x50f8('0x38')]){_0x153e90[_0x50f8('0x34')]=_[_0x50f8('0x36')](_0x153e90['where'],{'$or':_[_0x50f8('0x27')](_0x153e90[_0x50f8('0x2e')],function(_0x5ec7e3){var _0x49d354={};_0x49d354[_0x5ec7e3]={'$like':'%'+_0x2b3256[_0x50f8('0x2b')]['filter']+'%'};return _0x49d354;})});}_0x153e90=_[_0x50f8('0x36')]({},_0x153e90,_0x2b3256['options']);return _0x7bda58[_0x50f8('0x4c')](_0x153e90);}})[_0x50f8('0x21')](function(_0x3673a1){if(_0x3673a1){_0x24edab=_0x3673a1['length'];if(!_0x2b3256[_0x50f8('0x2b')][_0x50f8('0x48')](_0x50f8('0x49'))){_0x153e90[_0x50f8('0x1c')]=qs['limit'](_0x2b3256[_0x50f8('0x2b')][_0x50f8('0x1c')]);_0x153e90[_0x50f8('0x1a')]=qs[_0x50f8('0x1a')](_0x2b3256['query'][_0x50f8('0x1a')]);}return _0x7bda58[_0x50f8('0x4c')](_0x153e90);}})[_0x50f8('0x21')](function(_0x1c11bf){if(_0x1c11bf){return _0x1c11bf?{'count':_0x24edab,'rows':_0x1c11bf}:null;}})[_0x50f8('0x21')](respondWithResult(_0x568fa1,null))[_0x50f8('0x3d')](handleError(_0x568fa1,null));};exports[_0x50f8('0x4d')]=function(_0xdac624,_0x3b58a5,_0x260289){var _0x35c038={};var _0x406a7f={};var _0x4ed5a6;var _0x3543e5;return db['DeskConfiguration'][_0x50f8('0x4a')]({'where':{'id':_0xdac624[_0x50f8('0x45')]['id']}})[_0x50f8('0x21')](handleEntityNotFound(_0x3b58a5,null))[_0x50f8('0x21')](function(_0x27ab66){if(_0x27ab66){_0x4ed5a6=_0x27ab66;_0x406a7f[_0x50f8('0x2d')]=_[_0x50f8('0x2a')](db['Tag'][_0x50f8('0x3f')]);_0x406a7f[_0x50f8('0x2b')]=_[_0x50f8('0x2a')](_0xdac624[_0x50f8('0x2b')]);_0x406a7f[_0x50f8('0x2c')]=_['intersection'](_0x406a7f['model'],_0x406a7f['query']);_0x35c038[_0x50f8('0x2e')]=_['intersection'](_0x406a7f[_0x50f8('0x2d')],qs[_0x50f8('0x30')](_0xdac624[_0x50f8('0x2b')][_0x50f8('0x30')]));_0x35c038[_0x50f8('0x2e')]=_0x35c038[_0x50f8('0x2e')][_0x50f8('0x31')]?_0x35c038[_0x50f8('0x2e')]:_0x406a7f['model'];_0x35c038[_0x50f8('0x32')]=qs[_0x50f8('0x33')](_0xdac624['query'][_0x50f8('0x33')]);_0x35c038[_0x50f8('0x34')]=qs[_0x50f8('0x2c')](_[_0x50f8('0x35')](_0xdac624[_0x50f8('0x2b')],_0x406a7f[_0x50f8('0x2c')]));if(_0xdac624[_0x50f8('0x2b')][_0x50f8('0x38')]){_0x35c038['where']=_['merge'](_0x35c038[_0x50f8('0x34')],{'$or':_[_0x50f8('0x27')](_0x35c038[_0x50f8('0x2e')],function(_0x2717aa){var _0x355eb5={};_0x355eb5[_0x2717aa]={'$like':'%'+_0xdac624[_0x50f8('0x2b')]['filter']+'%'};return _0x355eb5;})});}_0x35c038=_['merge']({},_0x35c038,_0xdac624[_0x50f8('0x39')]);return _0x4ed5a6[_0x50f8('0x4d')](_0x35c038);}})['then'](function(_0x45b993){if(_0x45b993){_0x3543e5=_0x45b993[_0x50f8('0x31')];if(!_0xdac624[_0x50f8('0x2b')][_0x50f8('0x48')](_0x50f8('0x49'))){_0x35c038[_0x50f8('0x1c')]=qs['limit'](_0xdac624[_0x50f8('0x2b')][_0x50f8('0x1c')]);_0x35c038[_0x50f8('0x1a')]=qs[_0x50f8('0x1a')](_0xdac624['query'][_0x50f8('0x1a')]);}return _0x4ed5a6['getTags'](_0x35c038);}})['then'](function(_0x8fd9fe){if(_0x8fd9fe){return _0x8fd9fe?{'count':_0x3543e5,'rows':_0x8fd9fe}:null;}})[_0x50f8('0x21')](respondWithResult(_0x3b58a5,null))[_0x50f8('0x3d')](handleError(_0x3b58a5,null));};exports[_0x50f8('0x4e')]=function(_0x384d37,_0x870a92,_0x28539f){if(_0x384d37[_0x50f8('0x44')]['id']){delete _0x384d37[_0x50f8('0x44')]['id'];}return db['DeskConfiguration'][_0x50f8('0x4a')]({'where':{'id':_0x384d37[_0x50f8('0x45')]['id']}})[_0x50f8('0x21')](handleEntityNotFound(_0x870a92,null))['then'](function(_0x10c6d7){if(_0x10c6d7){return _0x10c6d7[_0x50f8('0x4e')](_0x384d37['body'][_0x50f8('0x4f')]||[]);}return null;})[_0x50f8('0x21')](respondWithResult(_0x870a92,null))['catch'](handleError(_0x870a92,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index f9c259f..7115aa3 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 _0x7812=['request-promise','path','rimraf','../../config/environment','exports','define','DeskConfiguration','int_desk_configurations','util','../../config/logger','api','moment','bluebird'];(function(_0x473b3a,_0x4889de){var _0x557b97=function(_0x2c454f){while(--_0x2c454f){_0x473b3a['push'](_0x473b3a['shift']());}};_0x557b97(++_0x4889de);}(_0x7812,0x174));var _0x2781=function(_0x632bb3,_0x35f4fe){_0x632bb3=_0x632bb3-0x0;var _0x5875ec=_0x7812[_0x632bb3];return _0x5875ec;};'use strict';var _=require('lodash');var util=require(_0x2781('0x0'));var logger=require(_0x2781('0x1'))(_0x2781('0x2'));var moment=require(_0x2781('0x3'));var BPromise=require(_0x2781('0x4'));var rp=require(_0x2781('0x5'));var fs=require('fs');var path=require(_0x2781('0x6'));var rimraf=require(_0x2781('0x7'));var config=require(_0x2781('0x8'));var attributes=require('./intDeskConfiguration.attributes');module[_0x2781('0x9')]=function(_0x219c3b,_0x41d73a){return _0x219c3b[_0x2781('0xa')](_0x2781('0xb'),attributes,{'tableName':_0x2781('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x883e=['./intDeskConfiguration.attributes','define','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x10acc2,_0x381818){var _0x5159f0=function(_0x272676){while(--_0x272676){_0x10acc2['push'](_0x10acc2['shift']());}};_0x5159f0(++_0x381818);}(_0x883e,0xd0));var _0xe883=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x883e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe883('0x0'));var util=require(_0xe883('0x1'));var logger=require(_0xe883('0x2'))('api');var moment=require(_0xe883('0x3'));var BPromise=require(_0xe883('0x4'));var rp=require(_0xe883('0x5'));var fs=require('fs');var path=require(_0xe883('0x6'));var rimraf=require(_0xe883('0x7'));var config=require('../../config/environment');var attributes=require(_0xe883('0x8'));module['exports']=function(_0xfc9a5f,_0x2acbf0){return _0xfc9a5f[_0xe883('0x9')](_0xe883('0xa'),attributes,{'tableName':_0xe883('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 08468fa..c8b319b 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 _0x8066=['info','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','http','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x7e8918,_0x5b77fd){var _0x29146c=function(_0x5e0dfd){while(--_0x5e0dfd){_0x7e8918['push'](_0x7e8918['shift']());}};_0x29146c(++_0x5b77fd);}(_0x8066,0x192));var _0x6806=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0x8066[_0x20ef64];return _0x3707d8;};'use strict';var _=require(_0x6806('0x0'));var util=require(_0x6806('0x1'));var moment=require(_0x6806('0x2'));var BPromise=require(_0x6806('0x3'));var rs=require(_0x6806('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6806('0x5'))('rpc');var config=require(_0x6806('0x6'));var jayson=require(_0x6806('0x7'));var client=jayson[_0x6806('0x8')][_0x6806('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59f807,_0x599d5a,_0x3d20e6){return new BPromise(function(_0x2ebd42,_0xa6b57b){return client['request'](_0x59f807,_0x3d20e6)[_0x6806('0xa')](function(_0x3e4936){logger['info'](_0x6806('0xb'),_0x599d5a,_0x6806('0xc'));logger[_0x6806('0xd')](_0x6806('0xe'),_0x599d5a,'request\x20sent',JSON[_0x6806('0xf')](_0x3e4936));if(_0x3e4936[_0x6806('0x10')]){if(_0x3e4936['error']['code']===0x1f4){logger['error'](_0x6806('0xb'),_0x599d5a,_0x3e4936['error']['message']);return _0xa6b57b(_0x3e4936[_0x6806('0x10')][_0x6806('0x11')]);}logger[_0x6806('0x10')](_0x6806('0xb'),_0x599d5a,_0x3e4936['error'][_0x6806('0x11')]);return _0x2ebd42(_0x3e4936[_0x6806('0x10')][_0x6806('0x11')]);}else{logger[_0x6806('0x12')](_0x6806('0xb'),_0x599d5a,_0x6806('0xc'));_0x2ebd42(_0x3e4936[_0x6806('0x13')]['message']);}})[_0x6806('0x14')](function(_0x246c78){logger[_0x6806('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x599d5a,_0x246c78);_0xa6b57b(_0x246c78);});});} \ No newline at end of file +var _0x7b77=['debug','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent'];(function(_0x3d27fb,_0x233f87){var _0x4d097b=function(_0x5a9828){while(--_0x5a9828){_0x3d27fb['push'](_0x3d27fb['shift']());}};_0x4d097b(++_0x233f87);}(_0x7b77,0x179));var _0x77b7=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x7b77[_0x2dadb9];return _0x2f0097;};'use strict';var _=require(_0x77b7('0x0'));var util=require(_0x77b7('0x1'));var moment=require(_0x77b7('0x2'));var BPromise=require(_0x77b7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x77b7('0x4'));var db=require(_0x77b7('0x5'))['db'];var utils=require(_0x77b7('0x6'));var logger=require('../../config/logger')(_0x77b7('0x7'));var config=require(_0x77b7('0x8'));var jayson=require(_0x77b7('0x9'));var client=jayson[_0x77b7('0xa')][_0x77b7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe3c16b,_0x5c9387,_0x39d8e4){return new BPromise(function(_0x32b8ab,_0x33d439){return client['request'](_0xe3c16b,_0x39d8e4)[_0x77b7('0xc')](function(_0x4cfd3f){logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x5c9387,_0x77b7('0xd'));logger[_0x77b7('0xe')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5c9387,_0x77b7('0xd'),JSON[_0x77b7('0xf')](_0x4cfd3f));if(_0x4cfd3f[_0x77b7('0x10')]){if(_0x4cfd3f[_0x77b7('0x10')][_0x77b7('0x11')]===0x1f4){logger[_0x77b7('0x10')](_0x77b7('0x12'),_0x5c9387,_0x4cfd3f['error'][_0x77b7('0x13')]);return _0x33d439(_0x4cfd3f[_0x77b7('0x10')]['message']);}logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x5c9387,_0x4cfd3f[_0x77b7('0x10')][_0x77b7('0x13')]);return _0x32b8ab(_0x4cfd3f[_0x77b7('0x10')][_0x77b7('0x13')]);}else{logger[_0x77b7('0x14')](_0x77b7('0x12'),_0x5c9387,'request\x20sent');_0x32b8ab(_0x4cfd3f[_0x77b7('0x15')][_0x77b7('0x13')]);}})[_0x77b7('0x16')](function(_0x2060df){logger[_0x77b7('0x10')](_0x77b7('0x12'),_0x5c9387,_0x2060df);_0x33d439(_0x2060df);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 8b70fbf..4254061 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 _0xdec0=['multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intDeskField.controller','get','index','show','post','isAuthenticated','create','put','/:id','update','destroy','exports'];(function(_0x4de976,_0x1d3321){var _0x3aaebb=function(_0x136f03){while(--_0x136f03){_0x4de976['push'](_0x4de976['shift']());}};_0x3aaebb(++_0x1d3321);}(_0xdec0,0xab));var _0x0dec=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xdec0[_0x102e37];return _0x35a07c;};'use strict';var multer=require(_0x0dec('0x0'));var util=require('util');var path=require(_0x0dec('0x1'));var timeout=require(_0x0dec('0x2'));var express=require(_0x0dec('0x3'));var router=express[_0x0dec('0x4')]();var fs_extra=require(_0x0dec('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0dec('0x6'));var config=require('../../config/environment');var controller=require(_0x0dec('0x7'));router[_0x0dec('0x8')]('/',auth['isAuthenticated'](),controller[_0x0dec('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x0dec('0xa')]);router[_0x0dec('0xb')]('/',auth[_0x0dec('0xc')](),controller[_0x0dec('0xd')]);router[_0x0dec('0xe')](_0x0dec('0xf'),auth[_0x0dec('0xc')](),controller[_0x0dec('0x10')]);router['delete'](_0x0dec('0xf'),auth['isAuthenticated'](),controller[_0x0dec('0x11')]);module[_0x0dec('0x12')]=router; \ No newline at end of file +var _0xe421=['post','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','show'];(function(_0x4fc371,_0x242d20){var _0x2870ac=function(_0x5158f8){while(--_0x5158f8){_0x4fc371['push'](_0x4fc371['shift']());}};_0x2870ac(++_0x242d20);}(_0xe421,0x10f));var _0x1e42=function(_0x10fce1,_0x38c702){_0x10fce1=_0x10fce1-0x0;var _0x4f5c25=_0xe421[_0x10fce1];return _0x4f5c25;};'use strict';var multer=require(_0x1e42('0x0'));var util=require(_0x1e42('0x1'));var path=require('path');var timeout=require(_0x1e42('0x2'));var express=require(_0x1e42('0x3'));var router=express[_0x1e42('0x4')]();var fs_extra=require(_0x1e42('0x5'));var auth=require(_0x1e42('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1e42('0x7'));var controller=require(_0x1e42('0x8'));router[_0x1e42('0x9')]('/',auth[_0x1e42('0xa')](),controller[_0x1e42('0xb')]);router[_0x1e42('0x9')](_0x1e42('0xc'),auth[_0x1e42('0xa')](),controller[_0x1e42('0xd')]);router[_0x1e42('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x1e42('0xc'),auth[_0x1e42('0xa')](),controller[_0x1e42('0xf')]);router[_0x1e42('0x10')](_0x1e42('0xc'),auth[_0x1e42('0xa')](),controller[_0x1e42('0x11')]);module[_0x1e42('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 48cd79c..61d90b4 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 _0xf2e5=['keyValue','picklist','STRING','exports','ENUM','string','variable','customVariable'];(function(_0xec1289,_0x4fa82b){var _0x3e223c=function(_0x9752ec){while(--_0x9752ec){_0xec1289['push'](_0xec1289['shift']());}};_0x3e223c(++_0x4fa82b);}(_0xf2e5,0x14b));var _0x5f2e=function(_0xb19de0,_0x28572e){_0xb19de0=_0xb19de0-0x0;var _0x4d39ec=_0xf2e5[_0xb19de0];return _0x4d39ec;};'use strict';var Sequelize=require('sequelize');module[_0x5f2e('0x0')]={'type':{'type':Sequelize[_0x5f2e('0x1')](_0x5f2e('0x2'),_0x5f2e('0x3'),_0x5f2e('0x4'),_0x5f2e('0x5'),_0x5f2e('0x6')),'defaultValue':_0x5f2e('0x2')},'content':{'type':Sequelize[_0x5f2e('0x7')]},'key':{'type':Sequelize[_0x5f2e('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x5f2e('0x2'),_0x5f2e('0x3'),_0x5f2e('0x4'))},'keyContent':{'type':Sequelize[_0x5f2e('0x7')]},'idField':{'type':Sequelize[_0x5f2e('0x7')]},'nameField':{'type':Sequelize[_0x5f2e('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xde5f=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xde5f,0xfc));var _0xfde5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xde5f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xfde5('0x0'));module[_0xfde5('0x1')]={'type':{'type':Sequelize[_0xfde5('0x2')](_0xfde5('0x3'),_0xfde5('0x4'),_0xfde5('0x5'),_0xfde5('0x6'),_0xfde5('0x7')),'defaultValue':_0xfde5('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xfde5('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0xfde5('0x3'),_0xfde5('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xfde5('0x8')]},'idField':{'type':Sequelize[_0xfde5('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index ce155de..178ff16 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 _0x0763=['crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','send','DeskField','rawAttributes','fieldName','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x43cc69,_0x401eea){var _0xde43ae=function(_0x43608f){while(--_0x43608f){_0x43cc69['push'](_0x43cc69['shift']());}};_0xde43ae(++_0x401eea);}(_0x0763,0x87));var _0x3076=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x0763[_0x2e4aa2];return _0x5e6092;};'use strict';var emlformat=require(_0x3076('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3076('0x1'));var jsonpatch=require(_0x3076('0x2'));var rp=require('request-promise');var moment=require(_0x3076('0x3'));var BPromise=require(_0x3076('0x4'));var Mustache=require(_0x3076('0x5'));var util=require(_0x3076('0x6'));var path=require('path');var sox=require(_0x3076('0x7'));var csv=require(_0x3076('0x8'));var ejs=require(_0x3076('0x9'));var fs=require('fs');var fs_extra=require(_0x3076('0xa'));var _=require(_0x3076('0xb'));var squel=require(_0x3076('0xc'));var crypto=require(_0x3076('0xd'));var jsforce=require(_0x3076('0xe'));var deskjs=require(_0x3076('0xf'));var toCsv=require(_0x3076('0x8'));var querystring=require('querystring');var Papa=require(_0x3076('0x10'));var Redis=require(_0x3076('0x11'));var authService=require(_0x3076('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3076('0x13'));var logger=require(_0x3076('0x14'))(_0x3076('0x15'));var utils=require(_0x3076('0x16'));var config=require(_0x3076('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3076('0x18'))['db'];function respondWithStatusCode(_0x209fc0,_0x2fe9d1){_0x2fe9d1=_0x2fe9d1||0xcc;return function(_0xc917fd){if(_0xc917fd){return _0x209fc0[_0x3076('0x19')](_0x2fe9d1);}return _0x209fc0[_0x3076('0x1a')](_0x2fe9d1)[_0x3076('0x1b')]();};}function respondWithResult(_0x3a6f74,_0x54ff6a){_0x54ff6a=_0x54ff6a||0xc8;return function(_0x5542c7){if(_0x5542c7){return _0x3a6f74[_0x3076('0x1a')](_0x54ff6a)[_0x3076('0x1c')](_0x5542c7);}};}function respondWithFilteredResult(_0x3bc84d,_0x1b2256){return function(_0x5a2088){if(_0x5a2088){var _0x5bf9ec=typeof _0x1b2256[_0x3076('0x1d')]===_0x3076('0x1e')&&typeof _0x1b2256[_0x3076('0x1f')]===_0x3076('0x1e');var _0x3d56fe=_0x5a2088[_0x3076('0x20')];var _0x21c242=_0x5bf9ec?0x0:_0x1b2256[_0x3076('0x1d')];var _0x1880b8=_0x5bf9ec?_0x5a2088[_0x3076('0x20')]:_0x1b2256[_0x3076('0x1d')]+_0x1b2256[_0x3076('0x1f')];var _0x4e441d;if(_0x1880b8>=_0x3d56fe){_0x1880b8=_0x3d56fe;_0x4e441d=0xc8;}else{_0x4e441d=0xce;}_0x3bc84d[_0x3076('0x1a')](_0x4e441d);return _0x3bc84d[_0x3076('0x21')]('Content-Range',_0x21c242+'-'+_0x1880b8+'/'+_0x3d56fe)[_0x3076('0x1c')](_0x5a2088);}return null;};}function patchUpdates(_0x50f366){return function(_0x34c831){try{jsonpatch[_0x3076('0x22')](_0x34c831,_0x50f366,!![]);}catch(_0x1f8914){return BPromise['reject'](_0x1f8914);}return _0x34c831[_0x3076('0x23')]();};}function saveUpdates(_0x250cc4,_0x2398f4){return function(_0x9b4bec){if(_0x9b4bec){return _0x9b4bec[_0x3076('0x24')](_0x250cc4)[_0x3076('0x25')](function(_0x1a2131){return _0x1a2131;});}return null;};}function removeEntity(_0xa975bc,_0x195606){return function(_0x39a33c){if(_0x39a33c){return _0x39a33c['destroy']()[_0x3076('0x25')](function(){_0xa975bc['status'](0xcc)[_0x3076('0x1b')]();});}};}function handleEntityNotFound(_0x4f4bdc,_0x53b45d){return function(_0x41ecf4){if(!_0x41ecf4){_0x4f4bdc[_0x3076('0x19')](0x194);}return _0x41ecf4;};}function handleError(_0x2f0848,_0x1b169b){_0x1b169b=_0x1b169b||0x1f4;return function(_0x28d834){logger[_0x3076('0x26')](_0x28d834[_0x3076('0x27')]);if(_0x28d834[_0x3076('0x28')]){delete _0x28d834[_0x3076('0x28')];}_0x2f0848[_0x3076('0x1a')](_0x1b169b)[_0x3076('0x29')](_0x28d834);};}exports['index']=function(_0x181591,_0x45805e){var _0x32bdbd={},_0x5af88e={},_0x330365={'count':0x0,'rows':[]};var _0x332a3b=_['map'](db[_0x3076('0x2a')][_0x3076('0x2b')],function(_0x5480eb){return{'name':_0x5480eb[_0x3076('0x2c')],'type':_0x5480eb['type']['key']};});_0x5af88e[_0x3076('0x2d')]=_[_0x3076('0x2e')](_0x332a3b,_0x3076('0x28'));_0x5af88e['query']=_[_0x3076('0x2f')](_0x181591[_0x3076('0x30')]);_0x5af88e[_0x3076('0x31')]=_[_0x3076('0x32')](_0x5af88e['model'],_0x5af88e[_0x3076('0x30')]);_0x32bdbd[_0x3076('0x33')]=_[_0x3076('0x32')](_0x5af88e[_0x3076('0x2d')],qs[_0x3076('0x34')](_0x181591['query'][_0x3076('0x34')]));_0x32bdbd[_0x3076('0x33')]=_0x32bdbd[_0x3076('0x33')][_0x3076('0x35')]?_0x32bdbd[_0x3076('0x33')]:_0x5af88e[_0x3076('0x2d')];if(!_0x181591['query'][_0x3076('0x36')]('nolimit')){_0x32bdbd[_0x3076('0x1f')]=qs[_0x3076('0x1f')](_0x181591[_0x3076('0x30')][_0x3076('0x1f')]);_0x32bdbd[_0x3076('0x1d')]=qs[_0x3076('0x1d')](_0x181591[_0x3076('0x30')][_0x3076('0x1d')]);}_0x32bdbd[_0x3076('0x37')]=qs[_0x3076('0x38')](_0x181591[_0x3076('0x30')][_0x3076('0x38')]);_0x32bdbd[_0x3076('0x39')]=qs[_0x3076('0x31')](_[_0x3076('0x3a')](_0x181591[_0x3076('0x30')],_0x5af88e[_0x3076('0x31')]),_0x332a3b);if(_0x181591[_0x3076('0x30')][_0x3076('0x3b')]){_0x32bdbd[_0x3076('0x39')]=_[_0x3076('0x3c')](_0x32bdbd[_0x3076('0x39')],{'$or':_[_0x3076('0x2e')](_0x332a3b,function(_0x852954){if(_0x852954[_0x3076('0x3d')]!==_0x3076('0x3e')){var _0x45ac78={};_0x45ac78[_0x852954['name']]={'$like':'%'+_0x181591[_0x3076('0x30')][_0x3076('0x3b')]+'%'};return _0x45ac78;}})});}_0x32bdbd=_[_0x3076('0x3c')]({},_0x32bdbd,_0x181591[_0x3076('0x3f')]);var _0x5b794a={'where':_0x32bdbd[_0x3076('0x39')]};return db[_0x3076('0x2a')][_0x3076('0x20')](_0x5b794a)[_0x3076('0x25')](function(_0x1d400c){_0x330365['count']=_0x1d400c;if(_0x181591[_0x3076('0x30')][_0x3076('0x40')]){_0x32bdbd[_0x3076('0x41')]=[{'all':!![]}];}return db[_0x3076('0x2a')]['findAll'](_0x32bdbd);})[_0x3076('0x25')](function(_0x526ad1){_0x330365[_0x3076('0x42')]=_0x526ad1;return _0x330365;})[_0x3076('0x25')](respondWithFilteredResult(_0x45805e,_0x32bdbd))[_0x3076('0x43')](handleError(_0x45805e,null));};exports[_0x3076('0x44')]=function(_0x3475f7,_0x2f4479){var _0x5b6d81={'raw':!![],'where':{'id':_0x3475f7[_0x3076('0x45')]['id']}},_0x5e0820={};_0x5e0820[_0x3076('0x2d')]=_['keys'](db['DeskField'][_0x3076('0x2b')]);_0x5e0820[_0x3076('0x30')]=_[_0x3076('0x2f')](_0x3475f7[_0x3076('0x30')]);_0x5e0820['filters']=_[_0x3076('0x32')](_0x5e0820[_0x3076('0x2d')],_0x5e0820[_0x3076('0x30')]);_0x5b6d81['attributes']=_[_0x3076('0x32')](_0x5e0820[_0x3076('0x2d')],qs['fields'](_0x3475f7['query']['fields']));_0x5b6d81['attributes']=_0x5b6d81[_0x3076('0x33')]['length']?_0x5b6d81[_0x3076('0x33')]:_0x5e0820['model'];if(_0x3475f7['query'][_0x3076('0x40')]){_0x5b6d81[_0x3076('0x41')]=[{'all':!![]}];}_0x5b6d81=_[_0x3076('0x3c')]({},_0x5b6d81,_0x3475f7[_0x3076('0x3f')]);return db[_0x3076('0x2a')][_0x3076('0x46')](_0x5b6d81)[_0x3076('0x25')](handleEntityNotFound(_0x2f4479,null))[_0x3076('0x25')](respondWithResult(_0x2f4479,null))[_0x3076('0x43')](handleError(_0x2f4479,null));};exports[_0x3076('0x47')]=function(_0x36970c,_0x46fdf0){return db['DeskField'][_0x3076('0x47')](_0x36970c['body'],{})[_0x3076('0x25')](respondWithResult(_0x46fdf0,0xc9))[_0x3076('0x43')](handleError(_0x46fdf0,null));};exports['update']=function(_0x5a7b95,_0x431a9e){if(_0x5a7b95[_0x3076('0x48')]['id']){delete _0x5a7b95[_0x3076('0x48')]['id'];}return db[_0x3076('0x2a')]['find']({'where':{'id':_0x5a7b95[_0x3076('0x45')]['id']}})[_0x3076('0x25')](handleEntityNotFound(_0x431a9e,null))['then'](saveUpdates(_0x5a7b95[_0x3076('0x48')],null))['then'](respondWithResult(_0x431a9e,null))['catch'](handleError(_0x431a9e,null));};exports[_0x3076('0x49')]=function(_0x6e5a16,_0x1c985d){return db[_0x3076('0x2a')][_0x3076('0x46')]({'where':{'id':_0x6e5a16[_0x3076('0x45')]['id']}})[_0x3076('0x25')](handleEntityNotFound(_0x1c985d,null))['then'](removeEntity(_0x1c985d,null))[_0x3076('0x43')](handleError(_0x1c985d,null));}; \ No newline at end of file +var _0x644f=['../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','then','destroy','error','name','index','DeskField','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','params','create','body','update','find','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x5d5f3b,_0x135fed){var _0x3d805d=function(_0x219149){while(--_0x219149){_0x5d5f3b['push'](_0x5d5f3b['shift']());}};_0x3d805d(++_0x135fed);}(_0x644f,0xc2));var _0xf644=function(_0x43e4b3,_0x1444de){_0x43e4b3=_0x43e4b3-0x0;var _0x10c655=_0x644f[_0x43e4b3];return _0x10c655;};'use strict';var emlformat=require(_0xf644('0x0'));var rimraf=require(_0xf644('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf644('0x2'));var moment=require(_0xf644('0x3'));var BPromise=require(_0xf644('0x4'));var Mustache=require(_0xf644('0x5'));var util=require(_0xf644('0x6'));var path=require(_0xf644('0x7'));var sox=require(_0xf644('0x8'));var csv=require(_0xf644('0x9'));var ejs=require(_0xf644('0xa'));var fs=require('fs');var fs_extra=require(_0xf644('0xb'));var _=require(_0xf644('0xc'));var squel=require(_0xf644('0xd'));var crypto=require('crypto');var jsforce=require(_0xf644('0xe'));var deskjs=require(_0xf644('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf644('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf644('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf644('0x12'));var hardwareService=require(_0xf644('0x13'));var logger=require('../../config/logger')(_0xf644('0x14'));var utils=require(_0xf644('0x15'));var config=require(_0xf644('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf644('0x17'))['db'];function respondWithStatusCode(_0x301425,_0x516f19){_0x516f19=_0x516f19||0xcc;return function(_0x3678c9){if(_0x3678c9){return _0x301425[_0xf644('0x18')](_0x516f19);}return _0x301425['status'](_0x516f19)[_0xf644('0x19')]();};}function respondWithResult(_0x53497c,_0x228cf7){_0x228cf7=_0x228cf7||0xc8;return function(_0x14d787){if(_0x14d787){return _0x53497c['status'](_0x228cf7)[_0xf644('0x1a')](_0x14d787);}};}function respondWithFilteredResult(_0xc0182,_0x52f74a){return function(_0x5b0b81){if(_0x5b0b81){var _0x4c197b=typeof _0x52f74a['offset']===_0xf644('0x1b')&&typeof _0x52f74a[_0xf644('0x1c')]===_0xf644('0x1b');var _0x329bb9=_0x5b0b81['count'];var _0x5bd03c=_0x4c197b?0x0:_0x52f74a[_0xf644('0x1d')];var _0x4650b5=_0x4c197b?_0x5b0b81[_0xf644('0x1e')]:_0x52f74a[_0xf644('0x1d')]+_0x52f74a['limit'];var _0x4beeb0;if(_0x4650b5>=_0x329bb9){_0x4650b5=_0x329bb9;_0x4beeb0=0xc8;}else{_0x4beeb0=0xce;}_0xc0182[_0xf644('0x1f')](_0x4beeb0);return _0xc0182[_0xf644('0x20')](_0xf644('0x21'),_0x5bd03c+'-'+_0x4650b5+'/'+_0x329bb9)[_0xf644('0x1a')](_0x5b0b81);}return null;};}function patchUpdates(_0x29f81a){return function(_0x2bc954){try{jsonpatch[_0xf644('0x22')](_0x2bc954,_0x29f81a,!![]);}catch(_0x20c0fb){return BPromise['reject'](_0x20c0fb);}return _0x2bc954[_0xf644('0x23')]();};}function saveUpdates(_0x1c36b4,_0x2180c6){return function(_0x9f426c){if(_0x9f426c){return _0x9f426c['update'](_0x1c36b4)[_0xf644('0x24')](function(_0x3b863f){return _0x3b863f;});}return null;};}function removeEntity(_0x42b88b,_0x17b2c6){return function(_0xc2a8fc){if(_0xc2a8fc){return _0xc2a8fc[_0xf644('0x25')]()[_0xf644('0x24')](function(){_0x42b88b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x22febe,_0x41b6a1){return function(_0xaeb4b){if(!_0xaeb4b){_0x22febe[_0xf644('0x18')](0x194);}return _0xaeb4b;};}function handleError(_0x329a02,_0x20d683){_0x20d683=_0x20d683||0x1f4;return function(_0x2b2882){logger[_0xf644('0x26')](_0x2b2882['stack']);if(_0x2b2882[_0xf644('0x27')]){delete _0x2b2882[_0xf644('0x27')];}_0x329a02['status'](_0x20d683)['send'](_0x2b2882);};}exports[_0xf644('0x28')]=function(_0x31343f,_0x16c745){var _0x3881e3={},_0x2bcb20={},_0x1ef501={'count':0x0,'rows':[]};var _0x2b9413=_['map'](db[_0xf644('0x29')][_0xf644('0x2a')],function(_0x4ad5ac){return{'name':_0x4ad5ac['fieldName'],'type':_0x4ad5ac[_0xf644('0x2b')][_0xf644('0x2c')]};});_0x2bcb20[_0xf644('0x2d')]=_[_0xf644('0x2e')](_0x2b9413,_0xf644('0x27'));_0x2bcb20[_0xf644('0x2f')]=_[_0xf644('0x30')](_0x31343f[_0xf644('0x2f')]);_0x2bcb20[_0xf644('0x31')]=_[_0xf644('0x32')](_0x2bcb20['model'],_0x2bcb20['query']);_0x3881e3[_0xf644('0x33')]=_[_0xf644('0x32')](_0x2bcb20[_0xf644('0x2d')],qs[_0xf644('0x34')](_0x31343f[_0xf644('0x2f')][_0xf644('0x34')]));_0x3881e3[_0xf644('0x33')]=_0x3881e3['attributes'][_0xf644('0x35')]?_0x3881e3['attributes']:_0x2bcb20['model'];if(!_0x31343f[_0xf644('0x2f')][_0xf644('0x36')](_0xf644('0x37'))){_0x3881e3['limit']=qs['limit'](_0x31343f[_0xf644('0x2f')][_0xf644('0x1c')]);_0x3881e3[_0xf644('0x1d')]=qs['offset'](_0x31343f[_0xf644('0x2f')][_0xf644('0x1d')]);}_0x3881e3['order']=qs[_0xf644('0x38')](_0x31343f[_0xf644('0x2f')][_0xf644('0x38')]);_0x3881e3[_0xf644('0x39')]=qs[_0xf644('0x31')](_[_0xf644('0x3a')](_0x31343f['query'],_0x2bcb20[_0xf644('0x31')]),_0x2b9413);if(_0x31343f['query'][_0xf644('0x3b')]){_0x3881e3[_0xf644('0x39')]=_[_0xf644('0x3c')](_0x3881e3[_0xf644('0x39')],{'$or':_[_0xf644('0x2e')](_0x2b9413,function(_0x60bec){if(_0x60bec['type']!==_0xf644('0x3d')){var _0x2b8781={};_0x2b8781[_0x60bec[_0xf644('0x27')]]={'$like':'%'+_0x31343f['query']['filter']+'%'};return _0x2b8781;}})});}_0x3881e3=_[_0xf644('0x3c')]({},_0x3881e3,_0x31343f[_0xf644('0x3e')]);var _0x11d879={'where':_0x3881e3[_0xf644('0x39')]};return db['DeskField'][_0xf644('0x1e')](_0x11d879)['then'](function(_0x10b861){_0x1ef501['count']=_0x10b861;if(_0x31343f[_0xf644('0x2f')][_0xf644('0x3f')]){_0x3881e3[_0xf644('0x40')]=[{'all':!![]}];}return db[_0xf644('0x29')]['findAll'](_0x3881e3);})[_0xf644('0x24')](function(_0x266bf4){_0x1ef501['rows']=_0x266bf4;return _0x1ef501;})[_0xf644('0x24')](respondWithFilteredResult(_0x16c745,_0x3881e3))[_0xf644('0x41')](handleError(_0x16c745,null));};exports['show']=function(_0x101f71,_0x5c2187){var _0x3f73c7={'raw':!![],'where':{'id':_0x101f71[_0xf644('0x42')]['id']}},_0x322f84={};_0x322f84[_0xf644('0x2d')]=_[_0xf644('0x30')](db['DeskField'][_0xf644('0x2a')]);_0x322f84[_0xf644('0x2f')]=_[_0xf644('0x30')](_0x101f71[_0xf644('0x2f')]);_0x322f84[_0xf644('0x31')]=_['intersection'](_0x322f84[_0xf644('0x2d')],_0x322f84[_0xf644('0x2f')]);_0x3f73c7[_0xf644('0x33')]=_['intersection'](_0x322f84[_0xf644('0x2d')],qs[_0xf644('0x34')](_0x101f71[_0xf644('0x2f')][_0xf644('0x34')]));_0x3f73c7['attributes']=_0x3f73c7['attributes'][_0xf644('0x35')]?_0x3f73c7[_0xf644('0x33')]:_0x322f84[_0xf644('0x2d')];if(_0x101f71[_0xf644('0x2f')]['includeAll']){_0x3f73c7['include']=[{'all':!![]}];}_0x3f73c7=_[_0xf644('0x3c')]({},_0x3f73c7,_0x101f71[_0xf644('0x3e')]);return db[_0xf644('0x29')]['find'](_0x3f73c7)[_0xf644('0x24')](handleEntityNotFound(_0x5c2187,null))[_0xf644('0x24')](respondWithResult(_0x5c2187,null))[_0xf644('0x41')](handleError(_0x5c2187,null));};exports[_0xf644('0x43')]=function(_0x184f30,_0x3a224b){return db[_0xf644('0x29')][_0xf644('0x43')](_0x184f30[_0xf644('0x44')],{})['then'](respondWithResult(_0x3a224b,0xc9))[_0xf644('0x41')](handleError(_0x3a224b,null));};exports[_0xf644('0x45')]=function(_0x1756bc,_0x212a99){if(_0x1756bc[_0xf644('0x44')]['id']){delete _0x1756bc[_0xf644('0x44')]['id'];}return db[_0xf644('0x29')]['find']({'where':{'id':_0x1756bc[_0xf644('0x42')]['id']}})[_0xf644('0x24')](handleEntityNotFound(_0x212a99,null))['then'](saveUpdates(_0x1756bc['body'],null))['then'](respondWithResult(_0x212a99,null))[_0xf644('0x41')](handleError(_0x212a99,null));};exports['destroy']=function(_0x3f1a46,_0x3df93f){return db['DeskField'][_0xf644('0x46')]({'where':{'id':_0x3f1a46[_0xf644('0x42')]['id']}})[_0xf644('0x24')](handleEntityNotFound(_0x3df93f,null))[_0xf644('0x24')](removeEntity(_0x3df93f,null))[_0xf644('0x41')](handleError(_0x3df93f,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index d8fcc01..cb7595d 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 _0xa39a=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','define','int_desk_fields','idField'];(function(_0x124ca2,_0x5d5659){var _0x329cda=function(_0x2bf26d){while(--_0x2bf26d){_0x124ca2['push'](_0x124ca2['shift']());}};_0x329cda(++_0x5d5659);}(_0xa39a,0xbe));var _0xaa39=function(_0x58af15,_0x3e27da){_0x58af15=_0x58af15-0x0;var _0x3917ff=_0xa39a[_0x58af15];return _0x3917ff;};'use strict';var _=require('lodash');var util=require(_0xaa39('0x0'));var logger=require(_0xaa39('0x1'))(_0xaa39('0x2'));var moment=require('moment');var BPromise=require(_0xaa39('0x3'));var rp=require(_0xaa39('0x4'));var fs=require('fs');var path=require(_0xaa39('0x5'));var rimraf=require(_0xaa39('0x6'));var config=require('../../config/environment');var attributes=require('./intDeskField.attributes');module['exports']=function(_0x47c5af,_0xf3d353){return _0x47c5af[_0xaa39('0x7')]('DeskField',attributes,{'tableName':_0xaa39('0x8'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0xaa39('0x9'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9d7c=['int_desk_fields','desk_unique_index','idField','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intDeskField.attributes','exports','define'];(function(_0x5369ab,_0x6fb335){var _0x306ea5=function(_0x5dd32f){while(--_0x5dd32f){_0x5369ab['push'](_0x5369ab['shift']());}};_0x306ea5(++_0x6fb335);}(_0x9d7c,0x1bf));var _0xc9d7=function(_0x527c39,_0x3ea2a6){_0x527c39=_0x527c39-0x0;var _0x3f4dd6=_0x9d7c[_0x527c39];return _0x3f4dd6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc9d7('0x0'))(_0xc9d7('0x1'));var moment=require(_0xc9d7('0x2'));var BPromise=require(_0xc9d7('0x3'));var rp=require(_0xc9d7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc9d7('0x5'));var attributes=require(_0xc9d7('0x6'));module[_0xc9d7('0x7')]=function(_0x2827d6,_0x5af21b){return _0x2827d6[_0xc9d7('0x8')]('DeskField',attributes,{'tableName':_0xc9d7('0x9'),'paranoid':![],'indexes':[{'name':_0xc9d7('0xa'),'fields':[_0xc9d7('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 9138514..f1535cb 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 _0x536a=['rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskField,\x20%s,\x20%s','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x536a,0x1b3));var _0xa536=function(_0x3a951d,_0x42148c){_0x3a951d=_0x3a951d-0x0;var _0x23d6ea=_0x536a[_0x3a951d];return _0x23d6ea;};'use strict';var _=require(_0xa536('0x0'));var util=require('util');var moment=require(_0xa536('0x1'));var BPromise=require('bluebird');var rs=require(_0xa536('0x2'));var fs=require('fs');var Redis=require(_0xa536('0x3'));var db=require(_0xa536('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa536('0x5'))(_0xa536('0x6'));var config=require(_0xa536('0x7'));var jayson=require(_0xa536('0x8'));var client=jayson['client'][_0xa536('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5cf1f0,_0x4241b7,_0x3f8297){return new BPromise(function(_0xf038a6,_0x2838fd){return client['request'](_0x5cf1f0,_0x3f8297)[_0xa536('0xa')](function(_0x3885cd){logger[_0xa536('0xb')]('DeskField,\x20%s,\x20%s',_0x4241b7,_0xa536('0xc'));logger[_0xa536('0xd')](_0xa536('0xe'),_0x4241b7,_0xa536('0xc'),JSON[_0xa536('0xf')](_0x3885cd));if(_0x3885cd[_0xa536('0x10')]){if(_0x3885cd[_0xa536('0x10')][_0xa536('0x11')]===0x1f4){logger['error'](_0xa536('0x12'),_0x4241b7,_0x3885cd[_0xa536('0x10')][_0xa536('0x13')]);return _0x2838fd(_0x3885cd[_0xa536('0x10')][_0xa536('0x13')]);}logger['error'](_0xa536('0x12'),_0x4241b7,_0x3885cd[_0xa536('0x10')]['message']);return _0xf038a6(_0x3885cd['error'][_0xa536('0x13')]);}else{logger[_0xa536('0xb')](_0xa536('0x12'),_0x4241b7,_0xa536('0xc'));_0xf038a6(_0x3885cd['result']['message']);}})[_0xa536('0x14')](function(_0x477424){logger[_0xa536('0x10')](_0xa536('0x12'),_0x4241b7,_0x477424);_0x2838fd(_0x477424);});});} \ No newline at end of file +var _0x0e5b=['DeskField,\x20%s,\x20%s','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','stringify','code','error'];(function(_0x2700da,_0x35e578){var _0xab08c7=function(_0x522715){while(--_0x522715){_0x2700da['push'](_0x2700da['shift']());}};_0xab08c7(++_0x35e578);}(_0x0e5b,0x97));var _0xb0e5=function(_0x18b10f,_0x2b59b8){_0x18b10f=_0x18b10f-0x0;var _0x3026ef=_0x0e5b[_0x18b10f];return _0x3026ef;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb0e5('0x0'));var BPromise=require('bluebird');var rs=require(_0xb0e5('0x1'));var fs=require('fs');var Redis=require(_0xb0e5('0x2'));var db=require(_0xb0e5('0x3'))['db'];var utils=require(_0xb0e5('0x4'));var logger=require(_0xb0e5('0x5'))(_0xb0e5('0x6'));var config=require(_0xb0e5('0x7'));var jayson=require(_0xb0e5('0x8'));var client=jayson[_0xb0e5('0x9')][_0xb0e5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ba97a,_0x5c6078,_0x15d469){return new BPromise(function(_0x367a69,_0x4da6a6){return client[_0xb0e5('0xb')](_0x2ba97a,_0x15d469)['then'](function(_0x196608){logger[_0xb0e5('0xc')]('DeskField,\x20%s,\x20%s',_0x5c6078,_0xb0e5('0xd'));logger['debug']('DeskField,\x20%s,\x20%s,\x20%s',_0x5c6078,_0xb0e5('0xd'),JSON[_0xb0e5('0xe')](_0x196608));if(_0x196608['error']){if(_0x196608['error'][_0xb0e5('0xf')]===0x1f4){logger[_0xb0e5('0x10')](_0xb0e5('0x11'),_0x5c6078,_0x196608[_0xb0e5('0x10')]['message']);return _0x4da6a6(_0x196608[_0xb0e5('0x10')]['message']);}logger[_0xb0e5('0x10')](_0xb0e5('0x11'),_0x5c6078,_0x196608[_0xb0e5('0x10')]['message']);return _0x367a69(_0x196608[_0xb0e5('0x10')][_0xb0e5('0x12')]);}else{logger[_0xb0e5('0xc')](_0xb0e5('0x11'),_0x5c6078,_0xb0e5('0xd'));_0x367a69(_0x196608[_0xb0e5('0x13')][_0xb0e5('0x12')]);}})[_0xb0e5('0x14')](function(_0x54fe4d){logger[_0xb0e5('0x10')](_0xb0e5('0x11'),_0x5c6078,_0x54fe4d);_0x4da6a6(_0x54fe4d);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 6d55f52..83d896e 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 _0x68d5=['../../components/interaction/service','./intDynamics365Account.controller','get','isAuthenticated','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x3ad5fc,_0x4f9b93){var _0x380070=function(_0x23a447){while(--_0x23a447){_0x3ad5fc['push'](_0x3ad5fc['shift']());}};_0x380070(++_0x4f9b93);}(_0x68d5,0xc1));var _0x568d=function(_0x4284b8,_0x2b18b5){_0x4284b8=_0x4284b8-0x0;var _0x128b09=_0x68d5[_0x4284b8];return _0x128b09;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x568d('0x0'));var timeout=require(_0x568d('0x1'));var express=require(_0x568d('0x2'));var router=express['Router']();var fs_extra=require(_0x568d('0x3'));var auth=require(_0x568d('0x4'));var interaction=require(_0x568d('0x5'));var config=require('../../config/environment');var controller=require(_0x568d('0x6'));router[_0x568d('0x7')]('/',auth[_0x568d('0x8')](),controller['index']);router[_0x568d('0x7')]('/:id',auth[_0x568d('0x8')](),controller[_0x568d('0x9')]);router[_0x568d('0x7')](_0x568d('0xa'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x568d('0x7')](_0x568d('0xb'),auth[_0x568d('0x8')](),controller[_0x568d('0xc')]);router[_0x568d('0xd')]('/',auth[_0x568d('0x8')](),controller[_0x568d('0xe')]);router[_0x568d('0xd')](_0x568d('0xa'),auth[_0x568d('0x8')](),controller[_0x568d('0xf')]);router[_0x568d('0x10')](_0x568d('0x11'),auth[_0x568d('0x8')](),controller[_0x568d('0x12')]);router[_0x568d('0x13')](_0x568d('0x11'),auth[_0x568d('0x8')](),controller[_0x568d('0x14')]);module[_0x568d('0x15')]=router; \ No newline at end of file +var _0x9d01=['getConfigurations','/:id/fields','create','post','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','/:id/configurations'];(function(_0x1f77be,_0x1ea03c){var _0x349b38=function(_0x4dc45f){while(--_0x4dc45f){_0x1f77be['push'](_0x1f77be['shift']());}};_0x349b38(++_0x1ea03c);}(_0x9d01,0xf9));var _0x19d0=function(_0x5aaf20,_0x38dc01){_0x5aaf20=_0x5aaf20-0x0;var _0x5a8c39=_0x9d01[_0x5aaf20];return _0x5a8c39;};'use strict';var multer=require(_0x19d0('0x0'));var util=require(_0x19d0('0x1'));var path=require(_0x19d0('0x2'));var timeout=require(_0x19d0('0x3'));var express=require(_0x19d0('0x4'));var router=express[_0x19d0('0x5')]();var fs_extra=require(_0x19d0('0x6'));var auth=require(_0x19d0('0x7'));var interaction=require(_0x19d0('0x8'));var config=require('../../config/environment');var controller=require(_0x19d0('0x9'));router[_0x19d0('0xa')]('/',auth[_0x19d0('0xb')](),controller[_0x19d0('0xc')]);router[_0x19d0('0xa')](_0x19d0('0xd'),auth[_0x19d0('0xb')](),controller['show']);router[_0x19d0('0xa')](_0x19d0('0xe'),auth['isAuthenticated'](),controller[_0x19d0('0xf')]);router['get'](_0x19d0('0x10'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0x19d0('0xb')](),controller[_0x19d0('0x11')]);router[_0x19d0('0x12')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router[_0x19d0('0x13')](_0x19d0('0xd'),auth['isAuthenticated'](),controller[_0x19d0('0x14')]);router[_0x19d0('0x15')](_0x19d0('0xd'),auth['isAuthenticated'](),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 9092ed0..f8d73ad 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 _0x1e20=['exports','STRING'];(function(_0x35fb79,_0x47f0dc){var _0x1f6764=function(_0x219ad9){while(--_0x219ad9){_0x35fb79['push'](_0x35fb79['shift']());}};_0x1f6764(++_0x47f0dc);}(_0x1e20,0x1ac));var _0x01e2=function(_0x334f27,_0x52c047){_0x334f27=_0x334f27-0x0;var _0x27abba=_0x1e20[_0x334f27];return _0x27abba;};'use strict';var Sequelize=require('sequelize');module[_0x01e2('0x0')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x01e2('0x1')]},'remoteUri':{'type':Sequelize[_0x01e2('0x1')]},'tenantId':{'type':Sequelize[_0x01e2('0x1')]},'clientId':{'type':Sequelize[_0x01e2('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x01e2('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x126d=['STRING','sequelize','exports'];(function(_0xe66f5a,_0x20056b){var _0x9f6f71=function(_0x85f64b){while(--_0x85f64b){_0xe66f5a['push'](_0xe66f5a['shift']());}};_0x9f6f71(++_0x20056b);}(_0x126d,0xc7));var _0xd126=function(_0x464aa2,_0x22e33f){_0x464aa2=_0x464aa2-0x0;var _0x5e7021=_0x126d[_0x464aa2];return _0x5e7021;};'use strict';var Sequelize=require(_0xd126('0x0'));module[_0xd126('0x1')]={'name':{'type':Sequelize[_0xd126('0x2')]},'username':{'type':Sequelize[_0xd126('0x2')]},'password':{'type':Sequelize[_0xd126('0x2')]},'remoteUri':{'type':Sequelize[_0xd126('0x2')]},'tenantId':{'type':Sequelize[_0xd126('0x2')]},'clientId':{'type':Sequelize[_0xd126('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xd126('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd126('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 0481413..499272d 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 _0x8fed=['password','tenantId','clientId','clientSecret','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','/oauth2/token','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','GET',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','BooleanAttributeMetadata','DoubleAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName','TrueOption','true','EntityDefinitions(',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','json','undefined','set','apply','reject','save','then','destroy','error','stack','name','send','index','map','Dynamics365Account','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','update','getConfigurations','filters','order','findOne','AccountId','Subjects','getSubjects','Descriptions','channel','Dynamics365Configuration','getFields','ticketType','PhoneCall','title','description','customerid','subject','phonenumber','directioncode','phonecall_activity_parties','accountidyominame','actualserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyname','createdbyyominame','createdonbehalfbyname','customeridname','customeridtype','customeridyominame','emailaddress','entityimage_timestamp','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridname','owneridtype','prioritycodename','productidname','productserialnumber','resolveby','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','ticketnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','username'];(function(_0x5a7f64,_0x347d57){var _0x3d30f1=function(_0x4bd1d6){while(--_0x4bd1d6){_0x5a7f64['push'](_0x5a7f64['shift']());}};_0x3d30f1(++_0x347d57);}(_0x8fed,0xf5));var _0xd8fe=function(_0xccd294,_0x1991b0){_0xccd294=_0xccd294-0x0;var _0x4cd885=_0x8fed[_0xccd294];return _0x4cd885;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd8fe('0x0'));var jsonpatch=require(_0xd8fe('0x1'));var rp=require(_0xd8fe('0x2'));var moment=require(_0xd8fe('0x3'));var BPromise=require(_0xd8fe('0x4'));var Mustache=require('mustache');var util=require(_0xd8fe('0x5'));var path=require(_0xd8fe('0x6'));var sox=require(_0xd8fe('0x7'));var csv=require(_0xd8fe('0x8'));var ejs=require(_0xd8fe('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd8fe('0xa'));var squel=require(_0xd8fe('0xb'));var crypto=require(_0xd8fe('0xc'));var jsforce=require(_0xd8fe('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd8fe('0x8'));var querystring=require('querystring');var Papa=require(_0xd8fe('0xe'));var Redis=require(_0xd8fe('0xf'));var authService=require(_0xd8fe('0x10'));var qs=require(_0xd8fe('0x11'));var as=require(_0xd8fe('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd8fe('0x13'))(_0xd8fe('0x14'));var utils=require(_0xd8fe('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd8fe('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0xd8fe('0x17'));function respondWithStatusCode(_0x44de03,_0x2a977d){_0x2a977d=_0x2a977d||0xcc;return function(_0x2c2d9b){if(_0x2c2d9b){return _0x44de03[_0xd8fe('0x18')](_0x2a977d);}return _0x44de03['status'](_0x2a977d)[_0xd8fe('0x19')]();};}function respondWithResult(_0x21e1ea,_0x51bdf5){_0x51bdf5=_0x51bdf5||0xc8;return function(_0x1acfeb){if(_0x1acfeb){return _0x21e1ea[_0xd8fe('0x1a')](_0x51bdf5)[_0xd8fe('0x1b')](_0x1acfeb);}};}function respondWithFilteredResult(_0x415609,_0x237de6){return function(_0xf5ca56){if(_0xf5ca56){var _0x44b0a0=typeof _0x237de6['offset']===_0xd8fe('0x1c')&&typeof _0x237de6['limit']===_0xd8fe('0x1c');var _0x17daae=_0xf5ca56['count'];var _0x31a5d7=_0x44b0a0?0x0:_0x237de6['offset'];var _0x52a8b6=_0x44b0a0?_0xf5ca56['count']:_0x237de6['offset']+_0x237de6['limit'];var _0x3d8b94;if(_0x52a8b6>=_0x17daae){_0x52a8b6=_0x17daae;_0x3d8b94=0xc8;}else{_0x3d8b94=0xce;}_0x415609['status'](_0x3d8b94);return _0x415609[_0xd8fe('0x1d')]('Content-Range',_0x31a5d7+'-'+_0x52a8b6+'/'+_0x17daae)[_0xd8fe('0x1b')](_0xf5ca56);}return null;};}function patchUpdates(_0x58d2d2){return function(_0x334909){try{jsonpatch[_0xd8fe('0x1e')](_0x334909,_0x58d2d2,!![]);}catch(_0x20a675){return BPromise[_0xd8fe('0x1f')](_0x20a675);}return _0x334909[_0xd8fe('0x20')]();};}function saveUpdates(_0x37dab0,_0x108b9c){return function(_0x29e481){if(_0x29e481){return _0x29e481['update'](_0x37dab0)[_0xd8fe('0x21')](function(_0x189dfa){return _0x189dfa;});}return null;};}function removeEntity(_0x19d4d1,_0x2fc0be){return function(_0x55019a){if(_0x55019a){return _0x55019a[_0xd8fe('0x22')]()[_0xd8fe('0x21')](function(){_0x19d4d1[_0xd8fe('0x1a')](0xcc)[_0xd8fe('0x19')]();});}};}function handleEntityNotFound(_0x107d0c,_0x76d22){return function(_0x57f86f){if(!_0x57f86f){_0x107d0c['sendStatus'](0x194);}return _0x57f86f;};}function handleError(_0x43a02d,_0x22ef87){_0x22ef87=_0x22ef87||0x1f4;return function(_0x5ac471){logger[_0xd8fe('0x23')](_0x5ac471[_0xd8fe('0x24')]);if(_0x5ac471[_0xd8fe('0x25')]){delete _0x5ac471[_0xd8fe('0x25')];}_0x43a02d[_0xd8fe('0x1a')](_0x22ef87)[_0xd8fe('0x26')](_0x5ac471);};}exports[_0xd8fe('0x27')]=function(_0x398bc2,_0x472507){var _0x2c2767={},_0x147336={},_0x50ca47={'count':0x0,'rows':[]};var _0x220d9a=_[_0xd8fe('0x28')](db[_0xd8fe('0x29')]['rawAttributes'],function(_0x2df5a8){return{'name':_0x2df5a8[_0xd8fe('0x2a')],'type':_0x2df5a8[_0xd8fe('0x2b')][_0xd8fe('0x2c')]};});_0x147336[_0xd8fe('0x2d')]=_[_0xd8fe('0x28')](_0x220d9a,_0xd8fe('0x25'));_0x147336[_0xd8fe('0x2e')]=_[_0xd8fe('0x2f')](_0x398bc2[_0xd8fe('0x2e')]);_0x147336['filters']=_[_0xd8fe('0x30')](_0x147336[_0xd8fe('0x2d')],_0x147336[_0xd8fe('0x2e')]);_0x2c2767[_0xd8fe('0x31')]=_[_0xd8fe('0x30')](_0x147336[_0xd8fe('0x2d')],qs[_0xd8fe('0x32')](_0x398bc2['query'][_0xd8fe('0x32')]));_0x2c2767[_0xd8fe('0x31')]=_0x2c2767[_0xd8fe('0x31')][_0xd8fe('0x33')]?_0x2c2767[_0xd8fe('0x31')]:_0x147336[_0xd8fe('0x2d')];if(!_0x398bc2[_0xd8fe('0x2e')][_0xd8fe('0x34')](_0xd8fe('0x35'))){_0x2c2767[_0xd8fe('0x36')]=qs[_0xd8fe('0x36')](_0x398bc2['query'][_0xd8fe('0x36')]);_0x2c2767[_0xd8fe('0x37')]=qs[_0xd8fe('0x37')](_0x398bc2[_0xd8fe('0x2e')][_0xd8fe('0x37')]);}_0x2c2767['order']=qs['sort'](_0x398bc2[_0xd8fe('0x2e')][_0xd8fe('0x38')]);_0x2c2767[_0xd8fe('0x39')]=qs['filters'](_[_0xd8fe('0x3a')](_0x398bc2[_0xd8fe('0x2e')],_0x147336['filters']),_0x220d9a);if(_0x398bc2[_0xd8fe('0x2e')][_0xd8fe('0x3b')]){_0x2c2767['where']=_[_0xd8fe('0x3c')](_0x2c2767['where'],{'$or':_[_0xd8fe('0x28')](_0x220d9a,function(_0x4d2d15){if(_0x4d2d15['type']!==_0xd8fe('0x3d')){var _0x394825={};_0x394825[_0x4d2d15[_0xd8fe('0x25')]]={'$like':'%'+_0x398bc2['query'][_0xd8fe('0x3b')]+'%'};return _0x394825;}})});}_0x2c2767=_[_0xd8fe('0x3c')]({},_0x2c2767,_0x398bc2['options']);var _0x24f5eb={'where':_0x2c2767[_0xd8fe('0x39')]};return db[_0xd8fe('0x29')][_0xd8fe('0x3e')](_0x24f5eb)[_0xd8fe('0x21')](function(_0x2f989a){_0x50ca47['count']=_0x2f989a;if(_0x398bc2['query'][_0xd8fe('0x3f')]){_0x2c2767[_0xd8fe('0x40')]=[{'all':!![]}];}return db[_0xd8fe('0x29')][_0xd8fe('0x41')](_0x2c2767);})[_0xd8fe('0x21')](function(_0xbbfd19){_0x50ca47[_0xd8fe('0x42')]=_0xbbfd19;return _0x50ca47;})[_0xd8fe('0x21')](respondWithFilteredResult(_0x472507,_0x2c2767))[_0xd8fe('0x43')](handleError(_0x472507,null));};exports[_0xd8fe('0x44')]=function(_0x3472c2,_0x3fa43f){var _0x30e8cd={'raw':![],'where':{'id':_0x3472c2[_0xd8fe('0x45')]['id']}},_0x1b74bf={};_0x1b74bf[_0xd8fe('0x2d')]=_[_0xd8fe('0x2f')](db[_0xd8fe('0x29')][_0xd8fe('0x46')]);_0x1b74bf[_0xd8fe('0x2e')]=_[_0xd8fe('0x2f')](_0x3472c2[_0xd8fe('0x2e')]);_0x1b74bf['filters']=_['intersection'](_0x1b74bf[_0xd8fe('0x2d')],_0x1b74bf[_0xd8fe('0x2e')]);_0x30e8cd[_0xd8fe('0x31')]=_[_0xd8fe('0x30')](_0x1b74bf['model'],qs[_0xd8fe('0x32')](_0x3472c2[_0xd8fe('0x2e')][_0xd8fe('0x32')]));_0x30e8cd[_0xd8fe('0x31')]=_0x30e8cd[_0xd8fe('0x31')]['length']?_0x30e8cd[_0xd8fe('0x31')]:_0x1b74bf['model'];if(_0x3472c2['query']['includeAll']){_0x30e8cd[_0xd8fe('0x40')]=[{'all':!![]}];}_0x30e8cd=_[_0xd8fe('0x3c')]({},_0x30e8cd,_0x3472c2['options']);return db[_0xd8fe('0x29')][_0xd8fe('0x47')](_0x30e8cd)[_0xd8fe('0x21')](handleEntityNotFound(_0x3fa43f,null))['then'](respondWithResult(_0x3fa43f,null))[_0xd8fe('0x43')](handleError(_0x3fa43f,null));};exports[_0xd8fe('0x48')]=function(_0x1df430,_0x4207cb){return db[_0xd8fe('0x29')]['create'](_0x1df430[_0xd8fe('0x49')],{})[_0xd8fe('0x21')](respondWithResult(_0x4207cb,0xc9))[_0xd8fe('0x43')](handleError(_0x4207cb,null));};exports[_0xd8fe('0x4a')]=function(_0x4939c2,_0x44e539){if(_0x4939c2[_0xd8fe('0x49')]['id']){delete _0x4939c2[_0xd8fe('0x49')]['id'];}return db[_0xd8fe('0x29')][_0xd8fe('0x47')]({'where':{'id':_0x4939c2[_0xd8fe('0x45')]['id']}})['then'](handleEntityNotFound(_0x44e539,null))[_0xd8fe('0x21')](saveUpdates(_0x4939c2[_0xd8fe('0x49')],null))[_0xd8fe('0x21')](respondWithResult(_0x44e539,null))[_0xd8fe('0x43')](handleError(_0x44e539,null));};exports[_0xd8fe('0x22')]=function(_0x37dc43,_0x25367c){return db['Dynamics365Account']['find']({'where':{'id':_0x37dc43[_0xd8fe('0x45')]['id']}})[_0xd8fe('0x21')](handleEntityNotFound(_0x25367c,null))[_0xd8fe('0x21')](removeEntity(_0x25367c,null))[_0xd8fe('0x43')](handleError(_0x25367c,null));};exports[_0xd8fe('0x4b')]=function(_0x1d4d13,_0x5c830e,_0x351eb3){var _0x4a72ff={};var _0x5bdd1f={};var _0x346a0d;var _0xbad98a;return db[_0xd8fe('0x29')]['findOne']({'where':{'id':_0x1d4d13['params']['id']}})[_0xd8fe('0x21')](handleEntityNotFound(_0x5c830e,null))['then'](function(_0x914ee8){if(_0x914ee8){_0x346a0d=_0x914ee8;_0x5bdd1f[_0xd8fe('0x2d')]=_['keys'](db['Dynamics365Configuration'][_0xd8fe('0x46')]);_0x5bdd1f[_0xd8fe('0x2e')]=_[_0xd8fe('0x2f')](_0x1d4d13[_0xd8fe('0x2e')]);_0x5bdd1f[_0xd8fe('0x4c')]=_['intersection'](_0x5bdd1f['model'],_0x5bdd1f['query']);_0x4a72ff['attributes']=_['intersection'](_0x5bdd1f[_0xd8fe('0x2d')],qs[_0xd8fe('0x32')](_0x1d4d13[_0xd8fe('0x2e')][_0xd8fe('0x32')]));_0x4a72ff['attributes']=_0x4a72ff[_0xd8fe('0x31')][_0xd8fe('0x33')]?_0x4a72ff[_0xd8fe('0x31')]:_0x5bdd1f[_0xd8fe('0x2d')];_0x4a72ff[_0xd8fe('0x4d')]=qs[_0xd8fe('0x38')](_0x1d4d13['query']['sort']);_0x4a72ff[_0xd8fe('0x39')]=qs[_0xd8fe('0x4c')](_[_0xd8fe('0x3a')](_0x1d4d13[_0xd8fe('0x2e')],_0x5bdd1f[_0xd8fe('0x4c')]));if(_0x1d4d13[_0xd8fe('0x2e')][_0xd8fe('0x3b')]){_0x4a72ff[_0xd8fe('0x39')]=_[_0xd8fe('0x3c')](_0x4a72ff['where'],{'$or':_[_0xd8fe('0x28')](_0x4a72ff[_0xd8fe('0x31')],function(_0x575a00){var _0x316436={};_0x316436[_0x575a00]={'$like':'%'+_0x1d4d13[_0xd8fe('0x2e')]['filter']+'%'};return _0x316436;})});}_0x4a72ff=_[_0xd8fe('0x3c')]({},_0x4a72ff,_0x1d4d13['options']);return _0x346a0d[_0xd8fe('0x4b')](_0x4a72ff);}})[_0xd8fe('0x21')](function(_0xe31e32){if(_0xe31e32){_0xbad98a=_0xe31e32[_0xd8fe('0x33')];if(!_0x1d4d13[_0xd8fe('0x2e')]['hasOwnProperty'](_0xd8fe('0x35'))){_0x4a72ff[_0xd8fe('0x36')]=qs[_0xd8fe('0x36')](_0x1d4d13[_0xd8fe('0x2e')][_0xd8fe('0x36')]);_0x4a72ff['offset']=qs[_0xd8fe('0x37')](_0x1d4d13[_0xd8fe('0x2e')]['offset']);}return _0x346a0d[_0xd8fe('0x4b')](_0x4a72ff);}})[_0xd8fe('0x21')](function(_0x48ddda){if(_0x48ddda){return _0x48ddda?{'count':_0xbad98a,'rows':_0x48ddda}:null;}})[_0xd8fe('0x21')](respondWithResult(_0x5c830e,null))[_0xd8fe('0x43')](handleError(_0x5c830e,null));};exports['addConfiguration']=function(_0x4f4d0f,_0x198b41,_0x5f2641){if(_0x4f4d0f[_0xd8fe('0x49')]['id']){delete _0x4f4d0f[_0xd8fe('0x49')]['id'];}return db[_0xd8fe('0x29')][_0xd8fe('0x4e')]({'where':{'id':_0x4f4d0f[_0xd8fe('0x45')]['id']}})[_0xd8fe('0x21')](handleEntityNotFound(_0x198b41,null))[_0xd8fe('0x21')](function(_0x45b02f){if(_0x45b02f){_0x4f4d0f[_0xd8fe('0x49')][_0xd8fe('0x4f')]=_0x45b02f['id'];_0x4f4d0f[_0xd8fe('0x49')][_0xd8fe('0x50')]=integrations[_0xd8fe('0x51')](_0x4f4d0f[_0xd8fe('0x49')]['channel'],_0x4f4d0f['body'][_0xd8fe('0x2b')]);_0x4f4d0f['body'][_0xd8fe('0x52')]=integrations['getDescriptions'](_0x4f4d0f[_0xd8fe('0x49')][_0xd8fe('0x53')],_0x4f4d0f['body'][_0xd8fe('0x2b')]);return db[_0xd8fe('0x54')][_0xd8fe('0x48')](_0x4f4d0f[_0xd8fe('0x49')],{'include':[{'model':db['Dynamics365Field'],'as':'Subjects'},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})[_0xd8fe('0x21')](respondWithResult(_0x198b41,null))[_0xd8fe('0x43')](handleError(_0x198b41,null));};exports[_0xd8fe('0x55')]=function(_0x1a4d15,_0xb5c3fa,_0x44ee83){var _0x39a605=_0x1a4d15[_0xd8fe('0x2e')][_0xd8fe('0x56')];var _0x33dc5c=_0x39a605==='incident'?'Incident':_0xd8fe('0x57');var _0x40629c='';var _0x2978d1='';var _0xac5fa5='';var _0x4952d1='';var _0x23bbed='';var _0x50b605='';var _0x300574='';var _0x3e30e8='';var _0x545d16=[_0xd8fe('0x58'),_0xd8fe('0x59'),_0xd8fe('0x5a'),'ownerid','caseorigincode',_0xd8fe('0x5b'),_0xd8fe('0x5c'),'regardingobjectid',_0xd8fe('0x5d'),_0xd8fe('0x5e')];var _0x4c43fd=['accountidname',_0xd8fe('0x5f'),_0xd8fe('0x60'),'billedserviceunits',_0xd8fe('0x61'),_0xd8fe('0x62'),'contractdetailidname',_0xd8fe('0x63'),_0xd8fe('0x64'),'createdbyexternalpartyyominame','createdbyname',_0xd8fe('0x65'),'createdon',_0xd8fe('0x66'),'createdonbehalfbyyominame',_0xd8fe('0x67'),_0xd8fe('0x68'),_0xd8fe('0x69'),_0xd8fe('0x6a'),'entitlementidname',_0xd8fe('0x6b'),'entityimage_url','escalatedon',_0xd8fe('0x6c'),_0xd8fe('0x6d'),_0xd8fe('0x6e'),_0xd8fe('0x6f'),_0xd8fe('0x70'),'kbarticleidname',_0xd8fe('0x71'),'masteridname',_0xd8fe('0x72'),_0xd8fe('0x73'),_0xd8fe('0x74'),_0xd8fe('0x75'),_0xd8fe('0x76'),'modifiedonbehalfbyname',_0xd8fe('0x77'),_0xd8fe('0x78'),_0xd8fe('0x79'),_0xd8fe('0x7a'),_0xd8fe('0x7b'),'overriddencreatedon',_0xd8fe('0x7c'),_0xd8fe('0x7d'),'owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame',_0xd8fe('0x7e'),_0xd8fe('0x7f'),_0xd8fe('0x80'),_0xd8fe('0x81'),'resolvebykpiidname','responseby','responsiblecontactidname',_0xd8fe('0x82'),_0xd8fe('0x83'),_0xd8fe('0x84'),_0xd8fe('0x85'),_0xd8fe('0x86'),_0xd8fe('0x87'),_0xd8fe('0x88'),'subjectidname',_0xd8fe('0x89'),'timezoneruleversionnumber',_0xd8fe('0x8a'),_0xd8fe('0x8b'),_0xd8fe('0x8c'),'versionnumber'];var _0x4c693d=_0x545d16[_0xd8fe('0x8d')](_0x4c43fd);return db[_0xd8fe('0x29')][_0xd8fe('0x4e')]({'where':{'id':_0x1a4d15[_0xd8fe('0x45')]['id']},'attributes':['id',_0xd8fe('0x8e'),_0xd8fe('0x8f'),'remoteUri',_0xd8fe('0x90'),_0xd8fe('0x91'),_0xd8fe('0x92')]})['then'](handleEntityNotFound(_0xb5c3fa,null))[_0xd8fe('0x21')](function(_0x16cff7){if(_0x16cff7){_0x3e30e8=_0x16cff7['remoteUri'];var _0x478999=_0x3e30e8[_0xd8fe('0x93')](-0x1);if(_0x478999==='/'){_0x3e30e8=_0x3e30e8[_0xd8fe('0x94')](0x0,_0x3e30e8[_0xd8fe('0x95')](_0x478999));}_0x300574=util[_0xd8fe('0x96')](_0xd8fe('0x97'),_0x3e30e8);var _0x3c5f18={'method':_0xd8fe('0x98'),'uri':'https://login.microsoftonline.com/'+_0x16cff7[_0xd8fe('0x90')]+_0xd8fe('0x99'),'form':{'client_id':_0x16cff7['clientId'],'resource':_0x3e30e8,'username':_0x16cff7[_0xd8fe('0x8e')],'password':_0x16cff7[_0xd8fe('0x8f')],'grant_type':_0xd8fe('0x8f'),'client_secret':_0x16cff7['clientSecret']},'json':!![]};return rp(_0x3c5f18);}})[_0xd8fe('0x21')](function(_0x4037d7){_0x50b605=_0x4037d7[_0xd8fe('0x9a')];var _0x24eb5e={'method':'GET','uri':encodeURI(_0x300574+_0xd8fe('0x9b')+_0x33dc5c+'\x27'),'headers':{'Authorization':_0xd8fe('0x9c')+_0x50b605,'If-None-Match':null,'OData-Version':_0xd8fe('0x9d')},'json':!![]};return rp(_0x24eb5e);})['then'](function(_0x3a2fac){var _0xab63f7=_0x3a2fac[_0xd8fe('0x9e')][0x0];var _0x3c50f7=_0xab63f7[_0xd8fe('0x9f')];var _0x5a506d={'method':_0xd8fe('0xa0'),'uri':_0x300574+'EntityDefinitions('+_0x3c50f7+_0xd8fe('0xa1'),'headers':{'Authorization':_0xd8fe('0x9c')+_0x50b605,'If-None-Match':null,'OData-Version':_0xd8fe('0x9d')},'json':!![]};return rp(_0x5a506d);})[_0xd8fe('0x21')](function(_0x310f5f){_0x40629c=_0x310f5f;_0x2978d1=_0x40629c[_0xd8fe('0xa2')];_0x2978d1=_[_0xd8fe('0xa3')](_0x2978d1,function(_0x1b34d7){return!_0x4c693d[_0xd8fe('0xa4')](_0x1b34d7[_0xd8fe('0xa5')]);});var _0x5eda3f=[];var _0x3b9d60=[];_0x2978d1[_0xd8fe('0xa6')](function(_0x51f99d){if(_0x51f99d[_0xd8fe('0xa7')]){var _0x5bb42b=_0x51f99d['@odata.type'][_0xd8fe('0x94')](_0x51f99d[_0xd8fe('0xa7')][_0xd8fe('0x95')]('.')+0x1);if(_0x5bb42b===_0xd8fe('0xa8')){_0x5eda3f[_0xd8fe('0xa9')](getSelectList(_0x300574,_0x39a605,_0x3b9d60,_0x40629c['MetadataId'],_0x51f99d['MetadataId'],_0x50b605));}}});return Promise[_0xd8fe('0xaa')](_0x5eda3f);})[_0xd8fe('0x21')](function(_0xe79f56){_0xac5fa5=_0xe79f56[0x0];var _0x43ce45=[];var _0x26a034=[];_0x2978d1[_0xd8fe('0xa6')](function(_0x58be9c){if(!_['isNil'](_0x58be9c[_0xd8fe('0xa7')])){var _0x14831d=_0x58be9c[_0xd8fe('0xa7')][_0xd8fe('0x94')](_0x58be9c[_0xd8fe('0xa7')][_0xd8fe('0x95')]('.')+0x1);if(_0x14831d===_0xd8fe('0xab')){_0x43ce45[_0xd8fe('0xa9')](getBooleanList(_0x300574,_0x39a605,_0x26a034,_0x40629c[_0xd8fe('0x9f')],_0x58be9c['MetadataId'],_0x50b605));}}});return Promise['all'](_0x43ce45);})['then'](function(_0x296ef6){_0x4952d1=_0x296ef6[0x0];var _0x568d66=[];var _0x4d93a1=[];_0x2978d1[_0xd8fe('0xa6')](function(_0x497557){if(_0x497557[_0xd8fe('0xa7')]){var _0x5ae0da=_0x497557[_0xd8fe('0xa7')][_0xd8fe('0x94')](_0x497557[_0xd8fe('0xa7')][_0xd8fe('0x95')]('.')+0x1);if(_0x5ae0da==='StringAttributeMetadata'||_0x5ae0da===_0xd8fe('0xac')||_0x5ae0da==='BigIntAttributeMetadata'||_0x5ae0da==='IntegerAttributeMetadata'||_0x5ae0da===_0xd8fe('0xad')||_0x5ae0da===_0xd8fe('0xae')||_0x5ae0da===_0xd8fe('0xaf')||_0x5ae0da==='EntityNameAttributeMetadata'||_0x5ae0da==='StateAttributeMetadata'||_0x5ae0da===_0xd8fe('0xb0')){_0x568d66[_0xd8fe('0xa9')](getInputList(_0x300574,_0x39a605,_0x5ae0da,_0x4d93a1,_0x40629c[_0xd8fe('0x9f')],_0x497557['MetadataId'],_0x50b605));}}});return Promise[_0xd8fe('0xaa')](_0x568d66);})[_0xd8fe('0x21')](function(_0x286458){_0x23bbed=_0x286458[0x0];var _0x4be1ce=_0xac5fa5['concat'](_0x4952d1)[_0xd8fe('0x8d')](_0x23bbed);var _0x60e48c={'count':_0x4be1ce[_0xd8fe('0x33')],'rows':_0x4be1ce};return _0x60e48c;})[_0xd8fe('0x21')](respondWithResult(_0xb5c3fa,null))[_0xd8fe('0x43')](function(_0x559631){var _0x134206=_0x1a4d15[_0xd8fe('0x2e')][_0xd8fe('0xb1')]?0x1f4:_0x559631[_0xd8fe('0xb2')]||0x1f4;logger['error'](_0x559631[_0xd8fe('0x24')]);delete _0x559631[_0xd8fe('0x25')];if(_0x134206===0x191){_0x134206=0x190;}_0xb5c3fa['status'](_0x134206)[_0xd8fe('0x26')](_0x1a4d15['query'][_0xd8fe('0xb1')]?{'message':_0xd8fe('0xb3'),'statusCode':_0x559631['statusCode']}:_0x559631);});};function getSelectList(_0x3b1285,_0x2970bd,_0x18520f,_0xdfa507,_0x344df6,_0x468b5e){var _0x11618d={'method':_0xd8fe('0xa0'),'uri':_0x3b1285+'EntityDefinitions('+_0xdfa507+_0xd8fe('0xb4')+_0x344df6+_0xd8fe('0xb5')+_0xd8fe('0xb6'),'headers':{'Authorization':'Bearer\x20'+_0x468b5e,'If-None-Match':null,'OData-Version':_0xd8fe('0x9d')},'json':!![]};return rp(_0x11618d)['then'](function(_0x220582){var _0x1bc329=[];var _0x395b19=_0x220582[_0xd8fe('0xb7')][_0xd8fe('0xb8')];_0x395b19['forEach'](function(_0x3f389e){_0x1bc329['push']({'name':_0x3f389e[_0xd8fe('0xb9')][_0xd8fe('0xba')][_0xd8fe('0xb9')],'value':String(_0x3f389e[_0xd8fe('0xbb')])});});var _0x1a2166={'id':_0x2970bd+'_'+_0x220582[_0xd8fe('0xa5')],'name':_0x220582[_0xd8fe('0xbc')][_0xd8fe('0xba')][_0xd8fe('0xb9')],'custom':![],'options':_0x1bc329};_0x18520f[_0xd8fe('0xa9')](_0x1a2166);return _0x18520f;});}function getBooleanList(_0x240280,_0x382e83,_0x110aa3,_0x23875a,_0x5a3241,_0x3c6325){var _0x50c2c8={'method':_0xd8fe('0xa0'),'uri':_0x240280+'EntityDefinitions('+_0x23875a+_0xd8fe('0xb4')+_0x5a3241+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0xd8fe('0x9c')+_0x3c6325,'If-None-Match':null,'OData-Version':_0xd8fe('0x9d')},'json':!![]};return rp(_0x50c2c8)[_0xd8fe('0x21')](function(_0x593917){var _0xb10e22=[];_0xb10e22[_0xd8fe('0xa9')]({'name':_0x593917[_0xd8fe('0xb7')][_0xd8fe('0xbd')][_0xd8fe('0xb9')]['UserLocalizedLabel']['Label'],'value':_0xd8fe('0xbe')},{'name':_0x593917[_0xd8fe('0xb7')]['FalseOption']['Label'][_0xd8fe('0xba')][_0xd8fe('0xb9')],'value':'false'});var _0xaf4305={'id':_0x382e83+'_'+_0x593917['LogicalName'],'name':_0x593917[_0xd8fe('0xbc')]['UserLocalizedLabel'][_0xd8fe('0xb9')],'custom':![],'options':_0xb10e22};_0x110aa3[_0xd8fe('0xa9')](_0xaf4305);return _0x110aa3;});}function getInputList(_0x24d005,_0x5a0c91,_0x4a35e9,_0x1c9963,_0x54652a,_0x423d4c,_0x3f30d0){var _0x39b54b={'method':_0xd8fe('0xa0'),'uri':_0x24d005+_0xd8fe('0xbf')+_0x54652a+')/Attributes('+_0x423d4c+_0xd8fe('0xc0')+_0x4a35e9+_0xd8fe('0xc1'),'headers':{'Authorization':_0xd8fe('0x9c')+_0x3f30d0,'If-None-Match':null,'OData-Version':_0xd8fe('0x9d')},'json':!![]};return rp(_0x39b54b)[_0xd8fe('0x21')](function(_0x4d4944){var _0x383e20={'id':_0x5a0c91+'_'+_0x4d4944[_0xd8fe('0xa5')],'name':_0x4d4944[_0xd8fe('0xbc')][_0xd8fe('0xba')]?_0x4d4944[_0xd8fe('0xbc')][_0xd8fe('0xba')][_0xd8fe('0xb9')]:_0x4d4944['LogicalName'],'custom':![],'options':[]};_0x1c9963['push'](_0x383e20);return _0x1c9963;});} \ No newline at end of file +var _0xb790=[')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','includes','LogicalName','forEach','@odata.type','substring','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','UserLocalizedLabel','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','rimraf','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','update','then','error','stack','name','send','index','Dynamics365Account','rawAttributes','type','model','map','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','keys','options','catch','create','body','find','params','findOne','Dynamics365Configuration','order','AccountId','Subjects','getSubjects','channel','Descriptions','Dynamics365Field','getFields','PhoneCall','title','customerid','ownerid','caseorigincode','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','followupby','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','socialprofileidname','statecode','statuscode','subjectidname','transactioncurrencyidname','versionnumber','concat','username','password','clientId','slice','lastIndexOf','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','clientSecret','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','MetadataId'];(function(_0x9a2110,_0x3b8d2f){var _0x201fcd=function(_0x185068){while(--_0x185068){_0x9a2110['push'](_0x9a2110['shift']());}};_0x201fcd(++_0x3b8d2f);}(_0xb790,0xe5));var _0x0b79=function(_0x109946,_0x3494b7){_0x109946=_0x109946-0x0;var _0x4ed20b=_0xb790[_0x109946];return _0x4ed20b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0b79('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0b79('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0b79('0x2'));var path=require(_0x0b79('0x3'));var sox=require('sox');var csv=require(_0x0b79('0x4'));var ejs=require(_0x0b79('0x5'));var fs=require('fs');var fs_extra=require(_0x0b79('0x6'));var _=require(_0x0b79('0x7'));var squel=require(_0x0b79('0x8'));var crypto=require(_0x0b79('0x9'));var jsforce=require(_0x0b79('0xa'));var deskjs=require(_0x0b79('0xb'));var toCsv=require(_0x0b79('0x4'));var querystring=require(_0x0b79('0xc'));var Papa=require(_0x0b79('0xd'));var Redis=require(_0x0b79('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0b79('0xf'));var hardwareService=require(_0x0b79('0x10'));var logger=require(_0x0b79('0x11'))(_0x0b79('0x12'));var utils=require(_0x0b79('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0b79('0x14'));var db=require(_0x0b79('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x44c94c,_0x1c0a61){_0x1c0a61=_0x1c0a61||0xcc;return function(_0x439e12){if(_0x439e12){return _0x44c94c[_0x0b79('0x16')](_0x1c0a61);}return _0x44c94c['status'](_0x1c0a61)[_0x0b79('0x17')]();};}function respondWithResult(_0x4681e4,_0x162522){_0x162522=_0x162522||0xc8;return function(_0x39551a){if(_0x39551a){return _0x4681e4['status'](_0x162522)[_0x0b79('0x18')](_0x39551a);}};}function respondWithFilteredResult(_0x44f4f7,_0x5bf09b){return function(_0x1820fa){if(_0x1820fa){var _0x23d5c3=typeof _0x5bf09b[_0x0b79('0x19')]===_0x0b79('0x1a')&&typeof _0x5bf09b[_0x0b79('0x1b')]===_0x0b79('0x1a');var _0x4f4754=_0x1820fa[_0x0b79('0x1c')];var _0x55bc36=_0x23d5c3?0x0:_0x5bf09b['offset'];var _0x4e7614=_0x23d5c3?_0x1820fa[_0x0b79('0x1c')]:_0x5bf09b[_0x0b79('0x19')]+_0x5bf09b[_0x0b79('0x1b')];var _0x5579dd;if(_0x4e7614>=_0x4f4754){_0x4e7614=_0x4f4754;_0x5579dd=0xc8;}else{_0x5579dd=0xce;}_0x44f4f7[_0x0b79('0x1d')](_0x5579dd);return _0x44f4f7['set'](_0x0b79('0x1e'),_0x55bc36+'-'+_0x4e7614+'/'+_0x4f4754)[_0x0b79('0x18')](_0x1820fa);}return null;};}function patchUpdates(_0x8482ad){return function(_0x5b630c){try{jsonpatch[_0x0b79('0x1f')](_0x5b630c,_0x8482ad,!![]);}catch(_0x330027){return BPromise[_0x0b79('0x20')](_0x330027);}return _0x5b630c['save']();};}function saveUpdates(_0xa836a8,_0x58901a){return function(_0x5bd229){if(_0x5bd229){return _0x5bd229[_0x0b79('0x21')](_0xa836a8)['then'](function(_0x80fbe9){return _0x80fbe9;});}return null;};}function removeEntity(_0x235a7f,_0x3a04d3){return function(_0x136734){if(_0x136734){return _0x136734['destroy']()[_0x0b79('0x22')](function(){_0x235a7f[_0x0b79('0x1d')](0xcc)[_0x0b79('0x17')]();});}};}function handleEntityNotFound(_0x553ed1,_0x143ca2){return function(_0x316866){if(!_0x316866){_0x553ed1[_0x0b79('0x16')](0x194);}return _0x316866;};}function handleError(_0x4a2f93,_0x39b034){_0x39b034=_0x39b034||0x1f4;return function(_0x18a2ea){logger[_0x0b79('0x23')](_0x18a2ea[_0x0b79('0x24')]);if(_0x18a2ea[_0x0b79('0x25')]){delete _0x18a2ea['name'];}_0x4a2f93[_0x0b79('0x1d')](_0x39b034)[_0x0b79('0x26')](_0x18a2ea);};}exports[_0x0b79('0x27')]=function(_0x365ea4,_0x48756d){var _0x47cdf2={},_0x10f10c={},_0x5595fd={'count':0x0,'rows':[]};var _0x2f0639=_['map'](db[_0x0b79('0x28')][_0x0b79('0x29')],function(_0x19971a){return{'name':_0x19971a['fieldName'],'type':_0x19971a[_0x0b79('0x2a')]['key']};});_0x10f10c[_0x0b79('0x2b')]=_[_0x0b79('0x2c')](_0x2f0639,_0x0b79('0x25'));_0x10f10c['query']=_['keys'](_0x365ea4[_0x0b79('0x2d')]);_0x10f10c[_0x0b79('0x2e')]=_[_0x0b79('0x2f')](_0x10f10c[_0x0b79('0x2b')],_0x10f10c[_0x0b79('0x2d')]);_0x47cdf2[_0x0b79('0x30')]=_[_0x0b79('0x2f')](_0x10f10c[_0x0b79('0x2b')],qs[_0x0b79('0x31')](_0x365ea4[_0x0b79('0x2d')][_0x0b79('0x31')]));_0x47cdf2[_0x0b79('0x30')]=_0x47cdf2[_0x0b79('0x30')][_0x0b79('0x32')]?_0x47cdf2[_0x0b79('0x30')]:_0x10f10c[_0x0b79('0x2b')];if(!_0x365ea4['query']['hasOwnProperty'](_0x0b79('0x33'))){_0x47cdf2[_0x0b79('0x1b')]=qs[_0x0b79('0x1b')](_0x365ea4[_0x0b79('0x2d')][_0x0b79('0x1b')]);_0x47cdf2[_0x0b79('0x19')]=qs[_0x0b79('0x19')](_0x365ea4[_0x0b79('0x2d')][_0x0b79('0x19')]);}_0x47cdf2['order']=qs[_0x0b79('0x34')](_0x365ea4[_0x0b79('0x2d')]['sort']);_0x47cdf2[_0x0b79('0x35')]=qs[_0x0b79('0x2e')](_[_0x0b79('0x36')](_0x365ea4[_0x0b79('0x2d')],_0x10f10c[_0x0b79('0x2e')]),_0x2f0639);if(_0x365ea4[_0x0b79('0x2d')]['filter']){_0x47cdf2[_0x0b79('0x35')]=_[_0x0b79('0x37')](_0x47cdf2[_0x0b79('0x35')],{'$or':_[_0x0b79('0x2c')](_0x2f0639,function(_0x221ce3){if(_0x221ce3['type']!==_0x0b79('0x38')){var _0x5b8d0b={};_0x5b8d0b[_0x221ce3[_0x0b79('0x25')]]={'$like':'%'+_0x365ea4[_0x0b79('0x2d')][_0x0b79('0x39')]+'%'};return _0x5b8d0b;}})});}_0x47cdf2=_['merge']({},_0x47cdf2,_0x365ea4['options']);var _0x564884={'where':_0x47cdf2[_0x0b79('0x35')]};return db['Dynamics365Account'][_0x0b79('0x1c')](_0x564884)[_0x0b79('0x22')](function(_0x293a33){_0x5595fd[_0x0b79('0x1c')]=_0x293a33;if(_0x365ea4[_0x0b79('0x2d')][_0x0b79('0x3a')]){_0x47cdf2[_0x0b79('0x3b')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x0b79('0x3c')](_0x47cdf2);})[_0x0b79('0x22')](function(_0x6f2200){_0x5595fd[_0x0b79('0x3d')]=_0x6f2200;return _0x5595fd;})[_0x0b79('0x22')](respondWithFilteredResult(_0x48756d,_0x47cdf2))['catch'](handleError(_0x48756d,null));};exports[_0x0b79('0x3e')]=function(_0x2b9f9f,_0x47f9e8){var _0x1a8e38={'raw':![],'where':{'id':_0x2b9f9f['params']['id']}},_0xb74c93={};_0xb74c93['model']=_[_0x0b79('0x3f')](db[_0x0b79('0x28')][_0x0b79('0x29')]);_0xb74c93[_0x0b79('0x2d')]=_['keys'](_0x2b9f9f[_0x0b79('0x2d')]);_0xb74c93[_0x0b79('0x2e')]=_[_0x0b79('0x2f')](_0xb74c93['model'],_0xb74c93[_0x0b79('0x2d')]);_0x1a8e38[_0x0b79('0x30')]=_[_0x0b79('0x2f')](_0xb74c93[_0x0b79('0x2b')],qs[_0x0b79('0x31')](_0x2b9f9f[_0x0b79('0x2d')][_0x0b79('0x31')]));_0x1a8e38[_0x0b79('0x30')]=_0x1a8e38[_0x0b79('0x30')][_0x0b79('0x32')]?_0x1a8e38[_0x0b79('0x30')]:_0xb74c93['model'];if(_0x2b9f9f['query'][_0x0b79('0x3a')]){_0x1a8e38[_0x0b79('0x3b')]=[{'all':!![]}];}_0x1a8e38=_[_0x0b79('0x37')]({},_0x1a8e38,_0x2b9f9f[_0x0b79('0x40')]);return db[_0x0b79('0x28')]['find'](_0x1a8e38)[_0x0b79('0x22')](handleEntityNotFound(_0x47f9e8,null))['then'](respondWithResult(_0x47f9e8,null))[_0x0b79('0x41')](handleError(_0x47f9e8,null));};exports[_0x0b79('0x42')]=function(_0x358bce,_0x25f719){return db[_0x0b79('0x28')][_0x0b79('0x42')](_0x358bce[_0x0b79('0x43')],{})[_0x0b79('0x22')](respondWithResult(_0x25f719,0xc9))[_0x0b79('0x41')](handleError(_0x25f719,null));};exports[_0x0b79('0x21')]=function(_0x362aa4,_0x21dc25){if(_0x362aa4[_0x0b79('0x43')]['id']){delete _0x362aa4[_0x0b79('0x43')]['id'];}return db[_0x0b79('0x28')][_0x0b79('0x44')]({'where':{'id':_0x362aa4['params']['id']}})[_0x0b79('0x22')](handleEntityNotFound(_0x21dc25,null))['then'](saveUpdates(_0x362aa4[_0x0b79('0x43')],null))[_0x0b79('0x22')](respondWithResult(_0x21dc25,null))[_0x0b79('0x41')](handleError(_0x21dc25,null));};exports['destroy']=function(_0x4172b9,_0x1862c4){return db[_0x0b79('0x28')][_0x0b79('0x44')]({'where':{'id':_0x4172b9[_0x0b79('0x45')]['id']}})[_0x0b79('0x22')](handleEntityNotFound(_0x1862c4,null))[_0x0b79('0x22')](removeEntity(_0x1862c4,null))[_0x0b79('0x41')](handleError(_0x1862c4,null));};exports['getConfigurations']=function(_0x1a6f6a,_0x472051,_0x17d0db){var _0x278d42={};var _0x7b9f57={};var _0x46eb9e;var _0x2309be;return db[_0x0b79('0x28')][_0x0b79('0x46')]({'where':{'id':_0x1a6f6a['params']['id']}})[_0x0b79('0x22')](handleEntityNotFound(_0x472051,null))['then'](function(_0x1616fa){if(_0x1616fa){_0x46eb9e=_0x1616fa;_0x7b9f57[_0x0b79('0x2b')]=_['keys'](db[_0x0b79('0x47')][_0x0b79('0x29')]);_0x7b9f57[_0x0b79('0x2d')]=_[_0x0b79('0x3f')](_0x1a6f6a[_0x0b79('0x2d')]);_0x7b9f57[_0x0b79('0x2e')]=_['intersection'](_0x7b9f57['model'],_0x7b9f57[_0x0b79('0x2d')]);_0x278d42[_0x0b79('0x30')]=_[_0x0b79('0x2f')](_0x7b9f57[_0x0b79('0x2b')],qs[_0x0b79('0x31')](_0x1a6f6a[_0x0b79('0x2d')][_0x0b79('0x31')]));_0x278d42[_0x0b79('0x30')]=_0x278d42[_0x0b79('0x30')][_0x0b79('0x32')]?_0x278d42['attributes']:_0x7b9f57[_0x0b79('0x2b')];_0x278d42[_0x0b79('0x48')]=qs[_0x0b79('0x34')](_0x1a6f6a[_0x0b79('0x2d')]['sort']);_0x278d42[_0x0b79('0x35')]=qs[_0x0b79('0x2e')](_[_0x0b79('0x36')](_0x1a6f6a[_0x0b79('0x2d')],_0x7b9f57[_0x0b79('0x2e')]));if(_0x1a6f6a[_0x0b79('0x2d')][_0x0b79('0x39')]){_0x278d42[_0x0b79('0x35')]=_[_0x0b79('0x37')](_0x278d42[_0x0b79('0x35')],{'$or':_[_0x0b79('0x2c')](_0x278d42[_0x0b79('0x30')],function(_0x2abb67){var _0x4416af={};_0x4416af[_0x2abb67]={'$like':'%'+_0x1a6f6a[_0x0b79('0x2d')][_0x0b79('0x39')]+'%'};return _0x4416af;})});}_0x278d42=_['merge']({},_0x278d42,_0x1a6f6a['options']);return _0x46eb9e['getConfigurations'](_0x278d42);}})[_0x0b79('0x22')](function(_0xdf3b19){if(_0xdf3b19){_0x2309be=_0xdf3b19['length'];if(!_0x1a6f6a[_0x0b79('0x2d')]['hasOwnProperty']('nolimit')){_0x278d42[_0x0b79('0x1b')]=qs['limit'](_0x1a6f6a[_0x0b79('0x2d')][_0x0b79('0x1b')]);_0x278d42[_0x0b79('0x19')]=qs[_0x0b79('0x19')](_0x1a6f6a[_0x0b79('0x2d')][_0x0b79('0x19')]);}return _0x46eb9e['getConfigurations'](_0x278d42);}})['then'](function(_0x32aee1){if(_0x32aee1){return _0x32aee1?{'count':_0x2309be,'rows':_0x32aee1}:null;}})[_0x0b79('0x22')](respondWithResult(_0x472051,null))['catch'](handleError(_0x472051,null));};exports['addConfiguration']=function(_0x52acb9,_0x92fa34,_0x4922b1){if(_0x52acb9[_0x0b79('0x43')]['id']){delete _0x52acb9[_0x0b79('0x43')]['id'];}return db[_0x0b79('0x28')][_0x0b79('0x46')]({'where':{'id':_0x52acb9[_0x0b79('0x45')]['id']}})[_0x0b79('0x22')](handleEntityNotFound(_0x92fa34,null))[_0x0b79('0x22')](function(_0x8ecdc9){if(_0x8ecdc9){_0x52acb9['body'][_0x0b79('0x49')]=_0x8ecdc9['id'];_0x52acb9[_0x0b79('0x43')][_0x0b79('0x4a')]=integrations[_0x0b79('0x4b')](_0x52acb9[_0x0b79('0x43')][_0x0b79('0x4c')],_0x52acb9['body']['type']);_0x52acb9[_0x0b79('0x43')][_0x0b79('0x4d')]=integrations['getDescriptions'](_0x52acb9[_0x0b79('0x43')][_0x0b79('0x4c')],_0x52acb9[_0x0b79('0x43')][_0x0b79('0x2a')]);return db[_0x0b79('0x47')][_0x0b79('0x42')](_0x52acb9[_0x0b79('0x43')],{'include':[{'model':db[_0x0b79('0x4e')],'as':_0x0b79('0x4a')},{'model':db[_0x0b79('0x4e')],'as':'Descriptions'}]});}return null;})[_0x0b79('0x22')](respondWithResult(_0x92fa34,null))[_0x0b79('0x41')](handleError(_0x92fa34,null));};exports[_0x0b79('0x4f')]=function(_0x21ee3b,_0x30c29c,_0x4d4bb3){var _0x1e8278=_0x21ee3b[_0x0b79('0x2d')]['ticketType'];var _0x4e7c7b=_0x1e8278==='incident'?'Incident':_0x0b79('0x50');var _0x26fc79='';var _0x5c8a1d='';var _0x3c15f4='';var _0x4e5ef4='';var _0x3a69fb='';var _0x253f93='';var _0x1d3cd7='';var _0xa5920f='';var _0x2e216d=[_0x0b79('0x51'),'description',_0x0b79('0x52'),_0x0b79('0x53'),_0x0b79('0x54'),'subject',_0x0b79('0x55'),_0x0b79('0x56'),_0x0b79('0x57'),_0x0b79('0x58')];var _0x570b45=[_0x0b79('0x59'),_0x0b79('0x5a'),'actualserviceunits',_0x0b79('0x5b'),_0x0b79('0x5c'),_0x0b79('0x5d'),_0x0b79('0x5e'),_0x0b79('0x5f'),_0x0b79('0x60'),'createdbyexternalpartyyominame','createdbyname',_0x0b79('0x61'),_0x0b79('0x62'),_0x0b79('0x63'),_0x0b79('0x64'),_0x0b79('0x65'),_0x0b79('0x66'),_0x0b79('0x67'),_0x0b79('0x68'),_0x0b79('0x69'),_0x0b79('0x6a'),_0x0b79('0x6b'),_0x0b79('0x6c'),_0x0b79('0x6d'),'firstresponsebykpiidname',_0x0b79('0x6e'),'importsequencenumber','influencescore',_0x0b79('0x6f'),_0x0b79('0x70'),'masteridname',_0x0b79('0x71'),_0x0b79('0x72'),'modifiedbyname',_0x0b79('0x73'),_0x0b79('0x74'),'modifiedonbehalfbyname',_0x0b79('0x75'),_0x0b79('0x76'),_0x0b79('0x77'),_0x0b79('0x78'),'onholdtime',_0x0b79('0x79'),_0x0b79('0x7a'),_0x0b79('0x7b'),'owneridyominame',_0x0b79('0x7c'),_0x0b79('0x7d'),_0x0b79('0x7e'),_0x0b79('0x7f'),_0x0b79('0x80'),_0x0b79('0x81'),_0x0b79('0x82'),_0x0b79('0x83'),_0x0b79('0x84'),_0x0b79('0x85'),_0x0b79('0x86'),_0x0b79('0x87'),'slainvokedidname','slaname',_0x0b79('0x88'),_0x0b79('0x89'),_0x0b79('0x8a'),_0x0b79('0x8b'),'ticketnumber','timezoneruleversionnumber',_0x0b79('0x8c'),'traversedpath','utcconversiontimezonecode',_0x0b79('0x8d')];var _0x4bf810=_0x2e216d[_0x0b79('0x8e')](_0x570b45);return db[_0x0b79('0x28')][_0x0b79('0x46')]({'where':{'id':_0x21ee3b[_0x0b79('0x45')]['id']},'attributes':['id',_0x0b79('0x8f'),_0x0b79('0x90'),'remoteUri','tenantId',_0x0b79('0x91'),'clientSecret']})[_0x0b79('0x22')](handleEntityNotFound(_0x30c29c,null))[_0x0b79('0x22')](function(_0x411a9f){if(_0x411a9f){_0xa5920f=_0x411a9f['remoteUri'];var _0x2662d2=_0xa5920f[_0x0b79('0x92')](-0x1);if(_0x2662d2==='/'){_0xa5920f=_0xa5920f['substring'](0x0,_0xa5920f[_0x0b79('0x93')](_0x2662d2));}_0x1d3cd7=util['format'](_0x0b79('0x94'),_0xa5920f);var _0x46b7a7={'method':_0x0b79('0x95'),'uri':_0x0b79('0x96')+_0x411a9f[_0x0b79('0x97')]+_0x0b79('0x98'),'form':{'client_id':_0x411a9f[_0x0b79('0x91')],'resource':_0xa5920f,'username':_0x411a9f[_0x0b79('0x8f')],'password':_0x411a9f['password'],'grant_type':_0x0b79('0x90'),'client_secret':_0x411a9f[_0x0b79('0x99')]},'json':!![]};return rp(_0x46b7a7);}})[_0x0b79('0x22')](function(_0x131c38){_0x253f93=_0x131c38['access_token'];var _0x3f360e={'method':_0x0b79('0x9a'),'uri':encodeURI(_0x1d3cd7+_0x0b79('0x9b')+_0x4e7c7b+'\x27'),'headers':{'Authorization':_0x0b79('0x9c')+_0x253f93,'If-None-Match':null,'OData-Version':_0x0b79('0x9d')},'json':!![]};return rp(_0x3f360e);})[_0x0b79('0x22')](function(_0x1261a2){var _0x530def=_0x1261a2['value'][0x0];var _0x4c5956=_0x530def[_0x0b79('0x9e')];var _0x39b1a2={'method':'GET','uri':_0x1d3cd7+'EntityDefinitions('+_0x4c5956+_0x0b79('0x9f'),'headers':{'Authorization':'Bearer\x20'+_0x253f93,'If-None-Match':null,'OData-Version':_0x0b79('0x9d')},'json':!![]};return rp(_0x39b1a2);})[_0x0b79('0x22')](function(_0x59a5bc){_0x26fc79=_0x59a5bc;_0x5c8a1d=_0x26fc79[_0x0b79('0xa0')];_0x5c8a1d=_['remove'](_0x5c8a1d,function(_0x12b003){return!_0x4bf810[_0x0b79('0xa1')](_0x12b003[_0x0b79('0xa2')]);});var _0x427131=[];var _0x19da21=[];_0x5c8a1d[_0x0b79('0xa3')](function(_0x42e594){if(_0x42e594[_0x0b79('0xa4')]){var _0x21225a=_0x42e594[_0x0b79('0xa4')][_0x0b79('0xa5')](_0x42e594[_0x0b79('0xa4')]['lastIndexOf']('.')+0x1);if(_0x21225a==='PicklistAttributeMetadata'){_0x427131[_0x0b79('0xa6')](getSelectList(_0x1d3cd7,_0x1e8278,_0x19da21,_0x26fc79[_0x0b79('0x9e')],_0x42e594[_0x0b79('0x9e')],_0x253f93));}}});return Promise[_0x0b79('0xa7')](_0x427131);})['then'](function(_0x5a58eb){_0x3c15f4=_0x5a58eb[0x0];var _0x901f06=[];var _0x559f13=[];_0x5c8a1d['forEach'](function(_0x1ccf84){if(!_[_0x0b79('0xa8')](_0x1ccf84[_0x0b79('0xa4')])){var _0x502b33=_0x1ccf84['@odata.type'][_0x0b79('0xa5')](_0x1ccf84['@odata.type'][_0x0b79('0x93')]('.')+0x1);if(_0x502b33===_0x0b79('0xa9')){_0x901f06[_0x0b79('0xa6')](getBooleanList(_0x1d3cd7,_0x1e8278,_0x559f13,_0x26fc79[_0x0b79('0x9e')],_0x1ccf84[_0x0b79('0x9e')],_0x253f93));}}});return Promise['all'](_0x901f06);})[_0x0b79('0x22')](function(_0x347724){_0x4e5ef4=_0x347724[0x0];var _0x452ac=[];var _0x4bbdf9=[];_0x5c8a1d[_0x0b79('0xa3')](function(_0x129fce){if(_0x129fce[_0x0b79('0xa4')]){var _0x54a8e5=_0x129fce['@odata.type']['substring'](_0x129fce[_0x0b79('0xa4')][_0x0b79('0x93')]('.')+0x1);if(_0x54a8e5===_0x0b79('0xaa')||_0x54a8e5==='DoubleAttributeMetadata'||_0x54a8e5==='BigIntAttributeMetadata'||_0x54a8e5===_0x0b79('0xab')||_0x54a8e5==='MemoAttributeMetadata'||_0x54a8e5===_0x0b79('0xac')||_0x54a8e5===_0x0b79('0xad')||_0x54a8e5===_0x0b79('0xae')||_0x54a8e5==='StateAttributeMetadata'||_0x54a8e5===_0x0b79('0xaf')){_0x452ac['push'](getInputList(_0x1d3cd7,_0x1e8278,_0x54a8e5,_0x4bbdf9,_0x26fc79['MetadataId'],_0x129fce['MetadataId'],_0x253f93));}}});return Promise[_0x0b79('0xa7')](_0x452ac);})[_0x0b79('0x22')](function(_0x5234be){_0x3a69fb=_0x5234be[0x0];var _0x57cb37=_0x3c15f4[_0x0b79('0x8e')](_0x4e5ef4)[_0x0b79('0x8e')](_0x3a69fb);var _0x45ff53={'count':_0x57cb37['length'],'rows':_0x57cb37};return _0x45ff53;})[_0x0b79('0x22')](respondWithResult(_0x30c29c,null))['catch'](function(_0x1f56a6){var _0x131d18=_0x21ee3b[_0x0b79('0x2d')][_0x0b79('0xb0')]?0x1f4:_0x1f56a6[_0x0b79('0xb1')]||0x1f4;logger[_0x0b79('0x23')](_0x1f56a6['stack']);delete _0x1f56a6[_0x0b79('0x25')];if(_0x131d18===0x191){_0x131d18=0x190;}_0x30c29c[_0x0b79('0x1d')](_0x131d18)[_0x0b79('0x26')](_0x21ee3b[_0x0b79('0x2d')][_0x0b79('0xb0')]?{'message':_0x0b79('0xb2'),'statusCode':_0x1f56a6[_0x0b79('0xb1')]}:_0x1f56a6);});};function getSelectList(_0x49414d,_0x2f157b,_0x1bad80,_0x5ed3b3,_0x3d3b5c,_0x309ab9){var _0x4ec192={'method':_0x0b79('0x9a'),'uri':_0x49414d+_0x0b79('0xb3')+_0x5ed3b3+_0x0b79('0xb4')+_0x3d3b5c+_0x0b79('0xb5')+_0x0b79('0xb6'),'headers':{'Authorization':_0x0b79('0x9c')+_0x309ab9,'If-None-Match':null,'OData-Version':_0x0b79('0x9d')},'json':!![]};return rp(_0x4ec192)[_0x0b79('0x22')](function(_0x1b294d){var _0x1d7f69=[];var _0x181ebf=_0x1b294d['OptionSet'][_0x0b79('0xb7')];_0x181ebf[_0x0b79('0xa3')](function(_0x2a50dc){_0x1d7f69['push']({'name':_0x2a50dc[_0x0b79('0xb8')][_0x0b79('0xb9')]['Label'],'value':String(_0x2a50dc['Value'])});});var _0x38ddaa={'id':_0x2f157b+'_'+_0x1b294d[_0x0b79('0xa2')],'name':_0x1b294d[_0x0b79('0xba')]['UserLocalizedLabel'][_0x0b79('0xb8')],'custom':![],'options':_0x1d7f69};_0x1bad80[_0x0b79('0xa6')](_0x38ddaa);return _0x1bad80;});}function getBooleanList(_0x3e228c,_0x467bcf,_0x201d96,_0x19d668,_0x3b0107,_0x415f32){var _0x123c70={'method':_0x0b79('0x9a'),'uri':_0x3e228c+_0x0b79('0xb3')+_0x19d668+_0x0b79('0xb4')+_0x3b0107+_0x0b79('0xbb'),'headers':{'Authorization':_0x0b79('0x9c')+_0x415f32,'If-None-Match':null,'OData-Version':_0x0b79('0x9d')},'json':!![]};return rp(_0x123c70)['then'](function(_0xa34638){var _0x475264=[];_0x475264[_0x0b79('0xa6')]({'name':_0xa34638[_0x0b79('0xbc')][_0x0b79('0xbd')][_0x0b79('0xb8')][_0x0b79('0xb9')]['Label'],'value':_0x0b79('0xbe')},{'name':_0xa34638[_0x0b79('0xbc')][_0x0b79('0xbf')][_0x0b79('0xb8')][_0x0b79('0xb9')][_0x0b79('0xb8')],'value':_0x0b79('0xc0')});var _0x3a34c9={'id':_0x467bcf+'_'+_0xa34638[_0x0b79('0xa2')],'name':_0xa34638['DisplayName'][_0x0b79('0xb9')][_0x0b79('0xb8')],'custom':![],'options':_0x475264};_0x201d96[_0x0b79('0xa6')](_0x3a34c9);return _0x201d96;});}function getInputList(_0x2eebce,_0x449d0b,_0x523e8f,_0xa0dfef,_0x42e7e7,_0x30a3ba,_0x483e50){var _0x3b8b8d={'method':_0x0b79('0x9a'),'uri':_0x2eebce+_0x0b79('0xb3')+_0x42e7e7+_0x0b79('0xb4')+_0x30a3ba+_0x0b79('0xc1')+_0x523e8f+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x0b79('0x9c')+_0x483e50,'If-None-Match':null,'OData-Version':_0x0b79('0x9d')},'json':!![]};return rp(_0x3b8b8d)[_0x0b79('0x22')](function(_0xa4bbfa){var _0x31077c={'id':_0x449d0b+'_'+_0xa4bbfa[_0x0b79('0xa2')],'name':_0xa4bbfa[_0x0b79('0xba')][_0x0b79('0xb9')]?_0xa4bbfa['DisplayName'][_0x0b79('0xb9')]['Label']:_0xa4bbfa[_0x0b79('0xa2')],'custom':![],'options':[]};_0xa0dfef[_0x0b79('0xa6')](_0x31077c);return _0xa0dfef;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 4be8d1c..3998ae6 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 _0xb7e7=['int_dynamics365_accounts','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','define'];(function(_0x106529,_0x42f63c){var _0x543168=function(_0x1a4cb8){while(--_0x1a4cb8){_0x106529['push'](_0x106529['shift']());}};_0x543168(++_0x42f63c);}(_0xb7e7,0x121));var _0x7b7e=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xb7e7[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x333fa4,_0x372bde){return _0x333fa4[_0x7b7e('0x7')]('Dynamics365Account',attributes,{'tableName':_0x7b7e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x263551,_0x28e61e){var _0x5b9876=function(_0xafc9fa){while(--_0xafc9fa){_0x263551['push'](_0x263551['shift']());}};_0x5b9876(++_0x28e61e);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index c4e35a3..0123b3e 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 _0x81b7=['request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','Dynamics365Account','findAll','options','limit','include','map','model','attributes','GetDynamics365Account','ShowDynamics365Account','raw','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','Dynamics365Account,\x20%s,\x20%s'];(function(_0x33a48e,_0x5174b3){var _0xa8cf54=function(_0x7c8a1){while(--_0x7c8a1){_0x33a48e['push'](_0x33a48e['shift']());}};_0xa8cf54(++_0x5174b3);}(_0x81b7,0x146));var _0x781b=function(_0x230029,_0x36279c){_0x230029=_0x230029-0x0;var _0x40026f=_0x81b7[_0x230029];return _0x40026f;};'use strict';var _=require(_0x781b('0x0'));var util=require('util');var moment=require(_0x781b('0x1'));var BPromise=require('bluebird');var rs=require(_0x781b('0x2'));var fs=require('fs');var Redis=require(_0x781b('0x3'));var db=require(_0x781b('0x4'))['db'];var utils=require(_0x781b('0x5'));var logger=require(_0x781b('0x6'))(_0x781b('0x7'));var config=require(_0x781b('0x8'));var jayson=require(_0x781b('0x9'));var client=jayson[_0x781b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa9ca67,_0x71f1,_0x1cec17){return new BPromise(function(_0xed5801,_0x5d9e91){return client[_0x781b('0xb')](_0xa9ca67,_0x1cec17)[_0x781b('0xc')](function(_0x3a33f6){logger['info'](_0x781b('0xd'),_0x71f1,_0x781b('0xe'));logger[_0x781b('0xf')](_0x781b('0x10'),_0x71f1,_0x781b('0xe'),JSON[_0x781b('0x11')](_0x3a33f6));if(_0x3a33f6[_0x781b('0x12')]){if(_0x3a33f6['error'][_0x781b('0x13')]===0x1f4){logger['error'](_0x781b('0xd'),_0x71f1,_0x3a33f6[_0x781b('0x12')]['message']);return _0x5d9e91(_0x3a33f6[_0x781b('0x12')][_0x781b('0x14')]);}logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x71f1,_0x3a33f6['error']['message']);return _0xed5801(_0x3a33f6[_0x781b('0x12')][_0x781b('0x14')]);}else{logger[_0x781b('0x15')](_0x781b('0xd'),_0x71f1,_0x781b('0xe'));_0xed5801(_0x3a33f6['result'][_0x781b('0x14')]);}})[_0x781b('0x16')](function(_0x1c8202){logger[_0x781b('0x12')](_0x781b('0xd'),_0x71f1,_0x1c8202);_0x5d9e91(_0x1c8202);});});}exports['GetDynamics365Account']=function(_0x4a5f6e){var _0x7e9c6d=this;return new Promise(function(_0x153df3,_0x59330d){return db[_0x781b('0x17')][_0x781b('0x18')]({'raw':_0x4a5f6e['options']?_0x4a5f6e[_0x781b('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4a5f6e[_0x781b('0x19')]?_0x4a5f6e[_0x781b('0x19')]['where']||null:null,'attributes':_0x4a5f6e[_0x781b('0x19')]?_0x4a5f6e['options']['attributes']||null:null,'limit':_0x4a5f6e[_0x781b('0x19')]?_0x4a5f6e['options'][_0x781b('0x1a')]||null:null,'include':_0x4a5f6e[_0x781b('0x19')]?_0x4a5f6e[_0x781b('0x19')][_0x781b('0x1b')]?_[_0x781b('0x1c')](_0x4a5f6e[_0x781b('0x19')][_0x781b('0x1b')],function(_0x2b1e8b){return{'model':db[_0x2b1e8b[_0x781b('0x1d')]],'as':_0x2b1e8b['as'],'attributes':_0x2b1e8b[_0x781b('0x1e')],'include':_0x2b1e8b[_0x781b('0x1b')]?_[_0x781b('0x1c')](_0x2b1e8b[_0x781b('0x1b')],function(_0x52b0b8){return{'model':db[_0x52b0b8['model']],'as':_0x52b0b8['as'],'attributes':_0x52b0b8[_0x781b('0x1e')],'include':_0x52b0b8['include']?_[_0x781b('0x1c')](_0x52b0b8['include'],function(_0x4af382){return{'model':db[_0x4af382[_0x781b('0x1d')]],'as':_0x4af382['as'],'attributes':_0x4af382['attributes']};}):[]};}):[]};}):[]:[]})[_0x781b('0xc')](function(_0x153e08){logger[_0x781b('0x15')](_0x781b('0x1f'),_0x4a5f6e);logger[_0x781b('0xf')](_0x781b('0x1f'),_0x4a5f6e,JSON[_0x781b('0x11')](_0x153e08));_0x153df3(_0x153e08);})['catch'](function(_0x4b546d){logger[_0x781b('0x12')](_0x781b('0x1f'),_0x4b546d[_0x781b('0x14')],_0x4a5f6e);_0x59330d(_0x7e9c6d[_0x781b('0x12')](0x1f4,_0x4b546d[_0x781b('0x14')]));});});};exports[_0x781b('0x20')]=function(_0x166247){var _0x37d18a=this;return new Promise(function(_0x38848e,_0x5c4c0f){return db['Dynamics365Account']['find']({'raw':_0x166247[_0x781b('0x19')]?_0x166247['options'][_0x781b('0x21')]===undefined?!![]:![]:!![],'where':_0x166247['options']?_0x166247[_0x781b('0x19')]['where']||null:null,'attributes':_0x166247['options']?_0x166247[_0x781b('0x19')][_0x781b('0x1e')]||null:null,'include':_0x166247[_0x781b('0x19')]?_0x166247[_0x781b('0x19')][_0x781b('0x1b')]?_[_0x781b('0x1c')](_0x166247[_0x781b('0x19')][_0x781b('0x1b')],function(_0x28adc8){return{'model':db[_0x28adc8[_0x781b('0x1d')]],'as':_0x28adc8['as'],'attributes':_0x28adc8[_0x781b('0x1e')],'include':_0x28adc8[_0x781b('0x1b')]?_['map'](_0x28adc8['include'],function(_0xe290e6){return{'model':db[_0xe290e6[_0x781b('0x1d')]],'as':_0xe290e6['as'],'attributes':_0xe290e6[_0x781b('0x1e')],'include':_0xe290e6['include']?_[_0x781b('0x1c')](_0xe290e6[_0x781b('0x1b')],function(_0x1296fc){return{'model':db[_0x1296fc[_0x781b('0x1d')]],'as':_0x1296fc['as'],'attributes':_0x1296fc['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xe9d680){logger[_0x781b('0x15')](_0x781b('0x20'),_0x166247);logger['debug']('ShowDynamics365Account',_0x166247,JSON[_0x781b('0x11')](_0xe9d680));_0x38848e(_0xe9d680);})[_0x781b('0x16')](function(_0x4b6731){logger['error'](_0x781b('0x20'),_0x4b6731[_0x781b('0x14')],_0x166247);_0x5c4c0f(_0x37d18a['error'](0x1f4,_0x4b6731['message']));});});}; \ No newline at end of file +var _0x61f9=['util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','attributes','limit','include','map','model','then','ShowDynamics365Account','find','stringify'];(function(_0x353d59,_0xbc0e8e){var _0x59d50f=function(_0x397865){while(--_0x397865){_0x353d59['push'](_0x353d59['shift']());}};_0x59d50f(++_0xbc0e8e);}(_0x61f9,0x1d1));var _0x961f=function(_0x582ec4,_0x1e3475){_0x582ec4=_0x582ec4-0x0;var _0x5d7b1b=_0x61f9[_0x582ec4];return _0x5d7b1b;};'use strict';var _=require('lodash');var util=require(_0x961f('0x0'));var moment=require('moment');var BPromise=require(_0x961f('0x1'));var rs=require(_0x961f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x961f('0x3'));var logger=require(_0x961f('0x4'))(_0x961f('0x5'));var config=require(_0x961f('0x6'));var jayson=require(_0x961f('0x7'));var client=jayson['client'][_0x961f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x535dc5,_0x38b0f4,_0x49f8ae){return new BPromise(function(_0x1868b1,_0x25442a){return client['request'](_0x535dc5,_0x49f8ae)['then'](function(_0x462896){logger[_0x961f('0x9')](_0x961f('0xa'),_0x38b0f4,_0x961f('0xb'));logger['debug']('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x38b0f4,'request\x20sent',JSON['stringify'](_0x462896));if(_0x462896[_0x961f('0xc')]){if(_0x462896[_0x961f('0xc')][_0x961f('0xd')]===0x1f4){logger[_0x961f('0xc')](_0x961f('0xa'),_0x38b0f4,_0x462896[_0x961f('0xc')][_0x961f('0xe')]);return _0x25442a(_0x462896[_0x961f('0xc')]['message']);}logger[_0x961f('0xc')](_0x961f('0xa'),_0x38b0f4,_0x462896[_0x961f('0xc')][_0x961f('0xe')]);return _0x1868b1(_0x462896[_0x961f('0xc')][_0x961f('0xe')]);}else{logger[_0x961f('0x9')](_0x961f('0xa'),_0x38b0f4,_0x961f('0xb'));_0x1868b1(_0x462896[_0x961f('0xf')][_0x961f('0xe')]);}})[_0x961f('0x10')](function(_0x2a1f2e){logger[_0x961f('0xc')]('Dynamics365Account,\x20%s,\x20%s',_0x38b0f4,_0x2a1f2e);_0x25442a(_0x2a1f2e);});});}exports[_0x961f('0x11')]=function(_0x4e9d39){var _0x1c63ea=this;return new Promise(function(_0x3f9d7b,_0x4353f3){return db[_0x961f('0x12')][_0x961f('0x13')]({'raw':_0x4e9d39['options']?_0x4e9d39[_0x961f('0x14')][_0x961f('0x15')]===undefined?!![]:![]:!![],'where':_0x4e9d39[_0x961f('0x14')]?_0x4e9d39[_0x961f('0x14')]['where']||null:null,'attributes':_0x4e9d39['options']?_0x4e9d39[_0x961f('0x14')][_0x961f('0x16')]||null:null,'limit':_0x4e9d39[_0x961f('0x14')]?_0x4e9d39[_0x961f('0x14')][_0x961f('0x17')]||null:null,'include':_0x4e9d39[_0x961f('0x14')]?_0x4e9d39[_0x961f('0x14')][_0x961f('0x18')]?_[_0x961f('0x19')](_0x4e9d39['options'][_0x961f('0x18')],function(_0x2d02bb){return{'model':db[_0x2d02bb[_0x961f('0x1a')]],'as':_0x2d02bb['as'],'attributes':_0x2d02bb[_0x961f('0x16')],'include':_0x2d02bb[_0x961f('0x18')]?_[_0x961f('0x19')](_0x2d02bb[_0x961f('0x18')],function(_0x382588){return{'model':db[_0x382588[_0x961f('0x1a')]],'as':_0x382588['as'],'attributes':_0x382588[_0x961f('0x16')],'include':_0x382588['include']?_[_0x961f('0x19')](_0x382588[_0x961f('0x18')],function(_0x4841ea){return{'model':db[_0x4841ea[_0x961f('0x1a')]],'as':_0x4841ea['as'],'attributes':_0x4841ea[_0x961f('0x16')]};}):[]};}):[]};}):[]:[]})[_0x961f('0x1b')](function(_0x5aaf6a){logger[_0x961f('0x9')](_0x961f('0x11'),_0x4e9d39);logger['debug'](_0x961f('0x11'),_0x4e9d39,JSON['stringify'](_0x5aaf6a));_0x3f9d7b(_0x5aaf6a);})['catch'](function(_0x4079f2){logger['error'](_0x961f('0x11'),_0x4079f2[_0x961f('0xe')],_0x4e9d39);_0x4353f3(_0x1c63ea[_0x961f('0xc')](0x1f4,_0x4079f2[_0x961f('0xe')]));});});};exports[_0x961f('0x1c')]=function(_0x1dedbd){var _0x1041d4=this;return new Promise(function(_0x41d44b,_0x59e899){return db['Dynamics365Account'][_0x961f('0x1d')]({'raw':_0x1dedbd[_0x961f('0x14')]?_0x1dedbd[_0x961f('0x14')][_0x961f('0x15')]===undefined?!![]:![]:!![],'where':_0x1dedbd[_0x961f('0x14')]?_0x1dedbd[_0x961f('0x14')]['where']||null:null,'attributes':_0x1dedbd[_0x961f('0x14')]?_0x1dedbd[_0x961f('0x14')][_0x961f('0x16')]||null:null,'include':_0x1dedbd[_0x961f('0x14')]?_0x1dedbd['options']['include']?_[_0x961f('0x19')](_0x1dedbd[_0x961f('0x14')][_0x961f('0x18')],function(_0x2a07be){return{'model':db[_0x2a07be[_0x961f('0x1a')]],'as':_0x2a07be['as'],'attributes':_0x2a07be['attributes'],'include':_0x2a07be[_0x961f('0x18')]?_[_0x961f('0x19')](_0x2a07be[_0x961f('0x18')],function(_0x49a333){return{'model':db[_0x49a333[_0x961f('0x1a')]],'as':_0x49a333['as'],'attributes':_0x49a333[_0x961f('0x16')],'include':_0x49a333[_0x961f('0x18')]?_['map'](_0x49a333[_0x961f('0x18')],function(_0x22a864){return{'model':db[_0x22a864['model']],'as':_0x22a864['as'],'attributes':_0x22a864[_0x961f('0x16')]};}):[]};}):[]};}):[]:[]})[_0x961f('0x1b')](function(_0xc0abc5){logger[_0x961f('0x9')](_0x961f('0x1c'),_0x1dedbd);logger['debug']('ShowDynamics365Account',_0x1dedbd,JSON[_0x961f('0x1e')](_0xc0abc5));_0x41d44b(_0xc0abc5);})[_0x961f('0x10')](function(_0x1827e0){logger['error'](_0x961f('0x1c'),_0x1827e0[_0x961f('0xe')],_0x1dedbd);_0x59e899(_0x1041d4[_0x961f('0xc')](0x1f4,_0x1827e0[_0x961f('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index d91be86..60392ad 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 _0x9b87=['post','create','put','/:id','delete','destroy','exports','multer','util','express','Router','../../config/environment','get','isAuthenticated','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x4b4e74,_0x3aea3f){var _0xc88567=function(_0x187b53){while(--_0x187b53){_0x4b4e74['push'](_0x4b4e74['shift']());}};_0xc88567(++_0x3aea3f);}(_0x9b87,0x7f));var _0x79b8=function(_0x161b9e,_0x4f5a86){_0x161b9e=_0x161b9e-0x0;var _0x35922d=_0x9b87[_0x161b9e];return _0x35922d;};'use strict';var multer=require(_0x79b8('0x0'));var util=require(_0x79b8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x79b8('0x2'));var router=express[_0x79b8('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x79b8('0x4'));var controller=require('./intDynamics365Configuration.controller');router[_0x79b8('0x5')]('/',auth[_0x79b8('0x6')](),controller['index']);router[_0x79b8('0x5')]('/:id',auth[_0x79b8('0x6')](),controller['show']);router['get'](_0x79b8('0x7'),auth['isAuthenticated'](),controller[_0x79b8('0x8')]);router[_0x79b8('0x5')](_0x79b8('0x9'),auth[_0x79b8('0x6')](),controller[_0x79b8('0xa')]);router[_0x79b8('0x5')](_0x79b8('0xb'),auth[_0x79b8('0x6')](),controller[_0x79b8('0xc')]);router[_0x79b8('0xd')]('/',auth[_0x79b8('0x6')](),controller[_0x79b8('0xe')]);router[_0x79b8('0xf')](_0x79b8('0x10'),auth['isAuthenticated'](),controller['update']);router[_0x79b8('0x11')](_0x79b8('0x10'),auth[_0x79b8('0x6')](),controller[_0x79b8('0x12')]);module[_0x79b8('0x13')]=router; \ No newline at end of file +var _0xd276=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Configuration.controller','get','index','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','post','create','put','/:id','update','exports','multer'];(function(_0x31c796,_0x2e3c7f){var _0x128356=function(_0x35534a){while(--_0x35534a){_0x31c796['push'](_0x31c796['shift']());}};_0x128356(++_0x2e3c7f);}(_0xd276,0xfc));var _0x6d27=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xd276[_0x1ddedd];return _0xa3e1ac;};'use strict';var multer=require(_0x6d27('0x0'));var util=require(_0x6d27('0x1'));var path=require(_0x6d27('0x2'));var timeout=require(_0x6d27('0x3'));var express=require('express');var router=express[_0x6d27('0x4')]();var fs_extra=require(_0x6d27('0x5'));var auth=require(_0x6d27('0x6'));var interaction=require(_0x6d27('0x7'));var config=require('../../config/environment');var controller=require(_0x6d27('0x8'));router[_0x6d27('0x9')]('/',auth['isAuthenticated'](),controller[_0x6d27('0xa')]);router[_0x6d27('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x6d27('0xb')]);router[_0x6d27('0x9')](_0x6d27('0xc'),auth[_0x6d27('0xd')](),controller[_0x6d27('0xe')]);router[_0x6d27('0x9')](_0x6d27('0xf'),auth[_0x6d27('0xd')](),controller[_0x6d27('0x10')]);router[_0x6d27('0x9')]('/:id/descriptions',auth[_0x6d27('0xd')](),controller['getDescriptions']);router[_0x6d27('0x11')]('/',auth[_0x6d27('0xd')](),controller[_0x6d27('0x12')]);router[_0x6d27('0x13')](_0x6d27('0x14'),auth[_0x6d27('0xd')](),controller[_0x6d27('0x15')]);router['delete']('/:id',auth[_0x6d27('0xd')](),controller['destroy']);module[_0x6d27('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 41acb4d..1599ec4 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 _0x4812=['incident','phonecall','sequelize','STRING','ENUM'];(function(_0x37efa1,_0x2d5fc3){var _0x148331=function(_0x597671){while(--_0x597671){_0x37efa1['push'](_0x37efa1['shift']());}};_0x148331(++_0x2d5fc3);}(_0x4812,0x7f));var _0x2481=function(_0x2262d6,_0x15f1b9){_0x2262d6=_0x2262d6-0x0;var _0x385b3a=_0x4812[_0x2262d6];return _0x385b3a;};'use strict';var Sequelize=require(_0x2481('0x0'));module['exports']={'name':{'type':Sequelize[_0x2481('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x2481('0x2')](_0x2481('0x3'),_0x2481('0x4')),'defaultValue':_0x2481('0x3')}}; \ No newline at end of file +var _0xa3cc=['ENUM','incident','sequelize','exports','STRING'];(function(_0x113a96,_0x47d645){var _0x5cce26=function(_0x1bcf21){while(--_0x1bcf21){_0x113a96['push'](_0x113a96['shift']());}};_0x5cce26(++_0x47d645);}(_0xa3cc,0x1dd));var _0xca3c=function(_0x448b76,_0x382e4e){_0x448b76=_0x448b76-0x0;var _0x40b35b=_0xa3cc[_0x448b76];return _0x40b35b;};'use strict';var Sequelize=require(_0xca3c('0x0'));module[_0xca3c('0x1')]={'name':{'type':Sequelize[_0xca3c('0x2')]},'description':{'type':Sequelize[_0xca3c('0x2')]},'ticketType':{'type':Sequelize[_0xca3c('0x3')]('incident','phonecall'),'defaultValue':_0xca3c('0x4')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 3038bc2..fecb9cd 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 _0x02b5=['limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','Dynamics365Configuration','includeAll','include','findAll','find','catch','create','body','params','getFields','findOne','Dynamics365Field','options','getSubjects','getDescriptions','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json'];(function(_0x5eb9da,_0x410348){var _0x585cca=function(_0x1f8254){while(--_0x1f8254){_0x5eb9da['push'](_0x5eb9da['shift']());}};_0x585cca(++_0x410348);}(_0x02b5,0x17e));var _0x502b=function(_0x255d8c,_0x48223a){_0x255d8c=_0x255d8c-0x0;var _0x150cf3=_0x02b5[_0x255d8c];return _0x150cf3;};'use strict';var emlformat=require(_0x502b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x502b('0x1'));var rp=require('request-promise');var moment=require(_0x502b('0x2'));var BPromise=require(_0x502b('0x3'));var Mustache=require(_0x502b('0x4'));var util=require(_0x502b('0x5'));var path=require(_0x502b('0x6'));var sox=require(_0x502b('0x7'));var csv=require(_0x502b('0x8'));var ejs=require(_0x502b('0x9'));var fs=require('fs');var fs_extra=require(_0x502b('0xa'));var _=require(_0x502b('0xb'));var squel=require(_0x502b('0xc'));var crypto=require(_0x502b('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x502b('0x8'));var querystring=require(_0x502b('0xe'));var Papa=require('papaparse');var Redis=require(_0x502b('0xf'));var authService=require(_0x502b('0x10'));var qs=require(_0x502b('0x11'));var as=require(_0x502b('0x12'));var hardwareService=require(_0x502b('0x13'));var logger=require('../../config/logger')(_0x502b('0x14'));var utils=require(_0x502b('0x15'));var config=require(_0x502b('0x16'));var licenseUtil=require(_0x502b('0x17'));var db=require(_0x502b('0x18'))['db'];function respondWithStatusCode(_0x43285c,_0x59735c){_0x59735c=_0x59735c||0xcc;return function(_0x5c9d98){if(_0x5c9d98){return _0x43285c['sendStatus'](_0x59735c);}return _0x43285c[_0x502b('0x19')](_0x59735c)[_0x502b('0x1a')]();};}function respondWithResult(_0x24aa64,_0x5f4b29){_0x5f4b29=_0x5f4b29||0xc8;return function(_0x524b06){if(_0x524b06){return _0x24aa64[_0x502b('0x19')](_0x5f4b29)[_0x502b('0x1b')](_0x524b06);}};}function respondWithFilteredResult(_0x3bbb2d,_0x56a394){return function(_0x4ed89b){if(_0x4ed89b){var _0x4cb064=typeof _0x56a394['offset']==='undefined'&&typeof _0x56a394[_0x502b('0x1c')]===_0x502b('0x1d');var _0x1b03c3=_0x4ed89b[_0x502b('0x1e')];var _0x2052c5=_0x4cb064?0x0:_0x56a394[_0x502b('0x1f')];var _0x381066=_0x4cb064?_0x4ed89b[_0x502b('0x1e')]:_0x56a394[_0x502b('0x1f')]+_0x56a394[_0x502b('0x1c')];var _0x1802a3;if(_0x381066>=_0x1b03c3){_0x381066=_0x1b03c3;_0x1802a3=0xc8;}else{_0x1802a3=0xce;}_0x3bbb2d['status'](_0x1802a3);return _0x3bbb2d[_0x502b('0x20')](_0x502b('0x21'),_0x2052c5+'-'+_0x381066+'/'+_0x1b03c3)[_0x502b('0x1b')](_0x4ed89b);}return null;};}function patchUpdates(_0x547b36){return function(_0x311748){try{jsonpatch[_0x502b('0x22')](_0x311748,_0x547b36,!![]);}catch(_0xbc9da0){return BPromise[_0x502b('0x23')](_0xbc9da0);}return _0x311748[_0x502b('0x24')]();};}function saveUpdates(_0xe79d39,_0x596c89){return function(_0x55298f){if(_0x55298f){return _0x55298f[_0x502b('0x25')](_0xe79d39)[_0x502b('0x26')](function(_0xe32a6a){return _0xe32a6a;});}return null;};}function removeEntity(_0x46a16f,_0x132af5){return function(_0x111c6a){if(_0x111c6a){return _0x111c6a[_0x502b('0x27')]()[_0x502b('0x26')](function(){_0x46a16f[_0x502b('0x19')](0xcc)[_0x502b('0x1a')]();});}};}function handleEntityNotFound(_0x2923c9,_0x23f324){return function(_0x58a496){if(!_0x58a496){_0x2923c9['sendStatus'](0x194);}return _0x58a496;};}function handleError(_0x4c42be,_0x56a663){_0x56a663=_0x56a663||0x1f4;return function(_0x232078){logger[_0x502b('0x28')](_0x232078[_0x502b('0x29')]);if(_0x232078[_0x502b('0x2a')]){delete _0x232078[_0x502b('0x2a')];}_0x4c42be[_0x502b('0x19')](_0x56a663)[_0x502b('0x2b')](_0x232078);};}exports[_0x502b('0x2c')]=function(_0x1e334c,_0x25779d){var _0x492055={},_0x2b59b5={},_0x1d7f10={'count':0x0,'rows':[]};var _0x35b453=_['map'](db['Dynamics365Configuration'][_0x502b('0x2d')],function(_0x28d425){return{'name':_0x28d425[_0x502b('0x2e')],'type':_0x28d425['type'][_0x502b('0x2f')]};});_0x2b59b5[_0x502b('0x30')]=_[_0x502b('0x31')](_0x35b453,_0x502b('0x2a'));_0x2b59b5['query']=_[_0x502b('0x32')](_0x1e334c[_0x502b('0x33')]);_0x2b59b5['filters']=_[_0x502b('0x34')](_0x2b59b5[_0x502b('0x30')],_0x2b59b5['query']);_0x492055[_0x502b('0x35')]=_['intersection'](_0x2b59b5['model'],qs[_0x502b('0x36')](_0x1e334c[_0x502b('0x33')]['fields']));_0x492055[_0x502b('0x35')]=_0x492055[_0x502b('0x35')][_0x502b('0x37')]?_0x492055[_0x502b('0x35')]:_0x2b59b5[_0x502b('0x30')];if(!_0x1e334c[_0x502b('0x33')][_0x502b('0x38')](_0x502b('0x39'))){_0x492055['limit']=qs[_0x502b('0x1c')](_0x1e334c[_0x502b('0x33')][_0x502b('0x1c')]);_0x492055[_0x502b('0x1f')]=qs['offset'](_0x1e334c[_0x502b('0x33')][_0x502b('0x1f')]);}_0x492055[_0x502b('0x3a')]=qs[_0x502b('0x3b')](_0x1e334c['query']['sort']);_0x492055[_0x502b('0x3c')]=qs[_0x502b('0x3d')](_[_0x502b('0x3e')](_0x1e334c[_0x502b('0x33')],_0x2b59b5[_0x502b('0x3d')]),_0x35b453);if(_0x1e334c[_0x502b('0x33')][_0x502b('0x3f')]){_0x492055[_0x502b('0x3c')]=_['merge'](_0x492055[_0x502b('0x3c')],{'$or':_[_0x502b('0x31')](_0x35b453,function(_0x58b2ca){if(_0x58b2ca[_0x502b('0x40')]!==_0x502b('0x41')){var _0x1c4696={};_0x1c4696[_0x58b2ca[_0x502b('0x2a')]]={'$like':'%'+_0x1e334c[_0x502b('0x33')][_0x502b('0x3f')]+'%'};return _0x1c4696;}})});}_0x492055=_[_0x502b('0x42')]({},_0x492055,_0x1e334c['options']);var _0x561f6b={'where':_0x492055[_0x502b('0x3c')]};return db[_0x502b('0x43')][_0x502b('0x1e')](_0x561f6b)[_0x502b('0x26')](function(_0x1aafa5){_0x1d7f10['count']=_0x1aafa5;if(_0x1e334c[_0x502b('0x33')][_0x502b('0x44')]){_0x492055[_0x502b('0x45')]=[{'all':!![]}];}return db[_0x502b('0x43')][_0x502b('0x46')](_0x492055);})[_0x502b('0x26')](function(_0x2b088b){_0x1d7f10['rows']=_0x2b088b;return _0x1d7f10;})['then'](respondWithFilteredResult(_0x25779d,_0x492055))['catch'](handleError(_0x25779d,null));};exports['show']=function(_0x3a5f0f,_0x58038d){var _0xe61cc2={'raw':![],'where':{'id':_0x3a5f0f['params']['id']}},_0x1a1904={};_0x1a1904[_0x502b('0x30')]=_[_0x502b('0x32')](db[_0x502b('0x43')]['rawAttributes']);_0x1a1904['query']=_[_0x502b('0x32')](_0x3a5f0f['query']);_0x1a1904[_0x502b('0x3d')]=_[_0x502b('0x34')](_0x1a1904['model'],_0x1a1904['query']);_0xe61cc2[_0x502b('0x35')]=_['intersection'](_0x1a1904[_0x502b('0x30')],qs[_0x502b('0x36')](_0x3a5f0f[_0x502b('0x33')]['fields']));_0xe61cc2[_0x502b('0x35')]=_0xe61cc2[_0x502b('0x35')][_0x502b('0x37')]?_0xe61cc2[_0x502b('0x35')]:_0x1a1904[_0x502b('0x30')];if(_0x3a5f0f[_0x502b('0x33')][_0x502b('0x44')]){_0xe61cc2['include']=[{'all':!![]}];}_0xe61cc2=_[_0x502b('0x42')]({},_0xe61cc2,_0x3a5f0f['options']);return db[_0x502b('0x43')][_0x502b('0x47')](_0xe61cc2)[_0x502b('0x26')](handleEntityNotFound(_0x58038d,null))[_0x502b('0x26')](respondWithResult(_0x58038d,null))[_0x502b('0x48')](handleError(_0x58038d,null));};exports['create']=function(_0x41dcfc,_0x4e8de8){return db['Dynamics365Configuration'][_0x502b('0x49')](_0x41dcfc['body'],{})[_0x502b('0x26')](respondWithResult(_0x4e8de8,0xc9))[_0x502b('0x48')](handleError(_0x4e8de8,null));};exports['update']=function(_0x25dd5e,_0x57517f){if(_0x25dd5e[_0x502b('0x4a')]['id']){delete _0x25dd5e[_0x502b('0x4a')]['id'];}return db[_0x502b('0x43')]['find']({'where':{'id':_0x25dd5e[_0x502b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x57517f,null))[_0x502b('0x26')](saveUpdates(_0x25dd5e['body'],null))['then'](respondWithResult(_0x57517f,null))[_0x502b('0x48')](handleError(_0x57517f,null));};exports[_0x502b('0x27')]=function(_0xfd4017,_0x35f3be){return db[_0x502b('0x43')][_0x502b('0x47')]({'where':{'id':_0xfd4017[_0x502b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x35f3be,null))['then'](removeEntity(_0x35f3be,null))[_0x502b('0x48')](handleError(_0x35f3be,null));};exports[_0x502b('0x4c')]=function(_0xdd7f19,_0x982d3c,_0x2b30cf){var _0x1eb69b={};var _0xfad1f7={};var _0x34595d;var _0x4a8c9c;return db[_0x502b('0x43')][_0x502b('0x4d')]({'where':{'id':_0xdd7f19[_0x502b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x982d3c,null))[_0x502b('0x26')](function(_0x2fc303){if(_0x2fc303){_0x34595d=_0x2fc303;_0xfad1f7[_0x502b('0x30')]=_[_0x502b('0x32')](db[_0x502b('0x4e')][_0x502b('0x2d')]);_0xfad1f7[_0x502b('0x33')]=_[_0x502b('0x32')](_0xdd7f19[_0x502b('0x33')]);_0xfad1f7[_0x502b('0x3d')]=_['intersection'](_0xfad1f7[_0x502b('0x30')],_0xfad1f7[_0x502b('0x33')]);_0x1eb69b[_0x502b('0x35')]=_[_0x502b('0x34')](_0xfad1f7[_0x502b('0x30')],qs['fields'](_0xdd7f19['query'][_0x502b('0x36')]));_0x1eb69b[_0x502b('0x35')]=_0x1eb69b['attributes'][_0x502b('0x37')]?_0x1eb69b['attributes']:_0xfad1f7[_0x502b('0x30')];_0x1eb69b['order']=qs[_0x502b('0x3b')](_0xdd7f19[_0x502b('0x33')][_0x502b('0x3b')]);_0x1eb69b[_0x502b('0x3c')]=qs[_0x502b('0x3d')](_['pick'](_0xdd7f19['query'],_0xfad1f7[_0x502b('0x3d')]));if(_0xdd7f19[_0x502b('0x33')][_0x502b('0x3f')]){_0x1eb69b[_0x502b('0x3c')]=_[_0x502b('0x42')](_0x1eb69b[_0x502b('0x3c')],{'$or':_['map'](_0x1eb69b[_0x502b('0x35')],function(_0x34b5e7){var _0x4a8bc3={};_0x4a8bc3[_0x34b5e7]={'$like':'%'+_0xdd7f19[_0x502b('0x33')]['filter']+'%'};return _0x4a8bc3;})});}_0x1eb69b=_[_0x502b('0x42')]({},_0x1eb69b,_0xdd7f19['options']);return _0x34595d['getFields'](_0x1eb69b);}})[_0x502b('0x26')](function(_0x248c08){if(_0x248c08){_0x4a8c9c=_0x248c08['length'];if(!_0xdd7f19[_0x502b('0x33')][_0x502b('0x38')](_0x502b('0x39'))){_0x1eb69b['limit']=qs[_0x502b('0x1c')](_0xdd7f19[_0x502b('0x33')][_0x502b('0x1c')]);_0x1eb69b['offset']=qs[_0x502b('0x1f')](_0xdd7f19[_0x502b('0x33')]['offset']);}return _0x34595d['getFields'](_0x1eb69b);}})[_0x502b('0x26')](function(_0x8a5f67){if(_0x8a5f67){return _0x8a5f67?{'count':_0x4a8c9c,'rows':_0x8a5f67}:null;}})[_0x502b('0x26')](respondWithResult(_0x982d3c,null))[_0x502b('0x48')](handleError(_0x982d3c,null));};exports['getSubjects']=function(_0x54a076,_0x1f1df0,_0x1e06f8){var _0x12e295={};var _0x1e5851={};var _0x51c1a8;var _0x5b5cde;return db['Dynamics365Configuration'][_0x502b('0x4d')]({'where':{'id':_0x54a076[_0x502b('0x4b')]['id']}})[_0x502b('0x26')](handleEntityNotFound(_0x1f1df0,null))[_0x502b('0x26')](function(_0xc48e7e){if(_0xc48e7e){_0x51c1a8=_0xc48e7e;_0x1e5851[_0x502b('0x30')]=_[_0x502b('0x32')](db['Dynamics365Field']['rawAttributes']);_0x1e5851['query']=_[_0x502b('0x32')](_0x54a076[_0x502b('0x33')]);_0x1e5851[_0x502b('0x3d')]=_['intersection'](_0x1e5851[_0x502b('0x30')],_0x1e5851[_0x502b('0x33')]);_0x12e295[_0x502b('0x35')]=_['intersection'](_0x1e5851[_0x502b('0x30')],qs[_0x502b('0x36')](_0x54a076[_0x502b('0x33')][_0x502b('0x36')]));_0x12e295[_0x502b('0x35')]=_0x12e295[_0x502b('0x35')][_0x502b('0x37')]?_0x12e295[_0x502b('0x35')]:_0x1e5851[_0x502b('0x30')];_0x12e295[_0x502b('0x3a')]=qs[_0x502b('0x3b')](_0x54a076[_0x502b('0x33')][_0x502b('0x3b')]);_0x12e295[_0x502b('0x3c')]=qs[_0x502b('0x3d')](_[_0x502b('0x3e')](_0x54a076[_0x502b('0x33')],_0x1e5851[_0x502b('0x3d')]));if(_0x54a076[_0x502b('0x33')][_0x502b('0x3f')]){_0x12e295[_0x502b('0x3c')]=_[_0x502b('0x42')](_0x12e295[_0x502b('0x3c')],{'$or':_[_0x502b('0x31')](_0x12e295[_0x502b('0x35')],function(_0x560c95){var _0x2f5b53={};_0x2f5b53[_0x560c95]={'$like':'%'+_0x54a076['query']['filter']+'%'};return _0x2f5b53;})});}_0x12e295=_[_0x502b('0x42')]({},_0x12e295,_0x54a076[_0x502b('0x4f')]);return _0x51c1a8['getSubjects'](_0x12e295);}})['then'](function(_0x44f9c1){if(_0x44f9c1){_0x5b5cde=_0x44f9c1[_0x502b('0x37')];if(!_0x54a076['query']['hasOwnProperty'](_0x502b('0x39'))){_0x12e295[_0x502b('0x1c')]=qs[_0x502b('0x1c')](_0x54a076['query']['limit']);_0x12e295[_0x502b('0x1f')]=qs[_0x502b('0x1f')](_0x54a076[_0x502b('0x33')][_0x502b('0x1f')]);}return _0x51c1a8[_0x502b('0x50')](_0x12e295);}})[_0x502b('0x26')](function(_0x49a9bc){if(_0x49a9bc){return _0x49a9bc?{'count':_0x5b5cde,'rows':_0x49a9bc}:null;}})[_0x502b('0x26')](respondWithResult(_0x1f1df0,null))[_0x502b('0x48')](handleError(_0x1f1df0,null));};exports[_0x502b('0x51')]=function(_0x43d512,_0x43a595,_0x528548){var _0x52786c={};var _0x2f41d6={};var _0x529247;var _0x44e33f;return db['Dynamics365Configuration'][_0x502b('0x4d')]({'where':{'id':_0x43d512['params']['id']}})[_0x502b('0x26')](handleEntityNotFound(_0x43a595,null))['then'](function(_0x25b78d){if(_0x25b78d){_0x529247=_0x25b78d;_0x2f41d6[_0x502b('0x30')]=_[_0x502b('0x32')](db[_0x502b('0x4e')][_0x502b('0x2d')]);_0x2f41d6[_0x502b('0x33')]=_[_0x502b('0x32')](_0x43d512[_0x502b('0x33')]);_0x2f41d6[_0x502b('0x3d')]=_['intersection'](_0x2f41d6[_0x502b('0x30')],_0x2f41d6['query']);_0x52786c[_0x502b('0x35')]=_[_0x502b('0x34')](_0x2f41d6[_0x502b('0x30')],qs[_0x502b('0x36')](_0x43d512[_0x502b('0x33')][_0x502b('0x36')]));_0x52786c[_0x502b('0x35')]=_0x52786c[_0x502b('0x35')][_0x502b('0x37')]?_0x52786c[_0x502b('0x35')]:_0x2f41d6[_0x502b('0x30')];_0x52786c['order']=qs[_0x502b('0x3b')](_0x43d512[_0x502b('0x33')][_0x502b('0x3b')]);_0x52786c['where']=qs['filters'](_['pick'](_0x43d512['query'],_0x2f41d6[_0x502b('0x3d')]));if(_0x43d512[_0x502b('0x33')][_0x502b('0x3f')]){_0x52786c[_0x502b('0x3c')]=_[_0x502b('0x42')](_0x52786c[_0x502b('0x3c')],{'$or':_[_0x502b('0x31')](_0x52786c[_0x502b('0x35')],function(_0x14ed79){var _0x351fd8={};_0x351fd8[_0x14ed79]={'$like':'%'+_0x43d512[_0x502b('0x33')]['filter']+'%'};return _0x351fd8;})});}_0x52786c=_[_0x502b('0x42')]({},_0x52786c,_0x43d512[_0x502b('0x4f')]);return _0x529247[_0x502b('0x51')](_0x52786c);}})[_0x502b('0x26')](function(_0x7c4dad){if(_0x7c4dad){_0x44e33f=_0x7c4dad[_0x502b('0x37')];if(!_0x43d512[_0x502b('0x33')][_0x502b('0x38')]('nolimit')){_0x52786c[_0x502b('0x1c')]=qs['limit'](_0x43d512[_0x502b('0x33')]['limit']);_0x52786c[_0x502b('0x1f')]=qs[_0x502b('0x1f')](_0x43d512[_0x502b('0x33')]['offset']);}return _0x529247[_0x502b('0x51')](_0x52786c);}})[_0x502b('0x26')](function(_0x13ead4){if(_0x13ead4){return _0x13ead4?{'count':_0x44e33f,'rows':_0x13ead4}:null;}})[_0x502b('0x26')](respondWithResult(_0x43a595,null))[_0x502b('0x48')](handleError(_0x43a595,null));}; \ No newline at end of file +var _0x847a=['../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','filter','merge','VIRTUAL','options','Dynamics365Configuration','includeAll','include','findAll','rows','catch','show','params','find','create','body','getFields','findOne','Dynamics365Field','length','hasOwnProperty','getSubjects','nolimit','getDescriptions','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis'];(function(_0x1ac120,_0x3e7e45){var _0x19b703=function(_0x5f32cb){while(--_0x5f32cb){_0x1ac120['push'](_0x1ac120['shift']());}};_0x19b703(++_0x3e7e45);}(_0x847a,0x8f));var _0xa847=function(_0x4833cf,_0x2d22a3){_0x4833cf=_0x4833cf-0x0;var _0x4cea7f=_0x847a[_0x4833cf];return _0x4cea7f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa847('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa847('0x1'));var rp=require(_0xa847('0x2'));var moment=require('moment');var BPromise=require(_0xa847('0x3'));var Mustache=require(_0xa847('0x4'));var util=require(_0xa847('0x5'));var path=require(_0xa847('0x6'));var sox=require(_0xa847('0x7'));var csv=require(_0xa847('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa847('0x9'));var _=require(_0xa847('0xa'));var squel=require(_0xa847('0xb'));var crypto=require(_0xa847('0xc'));var jsforce=require(_0xa847('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa847('0xe'));var Papa=require(_0xa847('0xf'));var Redis=require(_0xa847('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa847('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa847('0x12'))(_0xa847('0x13'));var utils=require(_0xa847('0x14'));var config=require(_0xa847('0x15'));var licenseUtil=require(_0xa847('0x16'));var db=require(_0xa847('0x17'))['db'];function respondWithStatusCode(_0x35a658,_0x255415){_0x255415=_0x255415||0xcc;return function(_0x10ccaf){if(_0x10ccaf){return _0x35a658[_0xa847('0x18')](_0x255415);}return _0x35a658[_0xa847('0x19')](_0x255415)['end']();};}function respondWithResult(_0x28670c,_0x38dcd0){_0x38dcd0=_0x38dcd0||0xc8;return function(_0x1af371){if(_0x1af371){return _0x28670c[_0xa847('0x19')](_0x38dcd0)[_0xa847('0x1a')](_0x1af371);}};}function respondWithFilteredResult(_0x1cfe06,_0x2ce256){return function(_0x1ee6db){if(_0x1ee6db){var _0x222133=typeof _0x2ce256[_0xa847('0x1b')]===_0xa847('0x1c')&&typeof _0x2ce256['limit']===_0xa847('0x1c');var _0x279c68=_0x1ee6db[_0xa847('0x1d')];var _0x5ac103=_0x222133?0x0:_0x2ce256['offset'];var _0x5592e0=_0x222133?_0x1ee6db['count']:_0x2ce256[_0xa847('0x1b')]+_0x2ce256[_0xa847('0x1e')];var _0x50a63d;if(_0x5592e0>=_0x279c68){_0x5592e0=_0x279c68;_0x50a63d=0xc8;}else{_0x50a63d=0xce;}_0x1cfe06[_0xa847('0x19')](_0x50a63d);return _0x1cfe06['set'](_0xa847('0x1f'),_0x5ac103+'-'+_0x5592e0+'/'+_0x279c68)['json'](_0x1ee6db);}return null;};}function patchUpdates(_0x2e474d){return function(_0x4a5dd6){try{jsonpatch[_0xa847('0x20')](_0x4a5dd6,_0x2e474d,!![]);}catch(_0x5b0529){return BPromise[_0xa847('0x21')](_0x5b0529);}return _0x4a5dd6[_0xa847('0x22')]();};}function saveUpdates(_0x4df40f,_0x41d08c){return function(_0x40e045){if(_0x40e045){return _0x40e045[_0xa847('0x23')](_0x4df40f)[_0xa847('0x24')](function(_0x341051){return _0x341051;});}return null;};}function removeEntity(_0x5944f5,_0x4c631a){return function(_0x4e0140){if(_0x4e0140){return _0x4e0140[_0xa847('0x25')]()[_0xa847('0x24')](function(){_0x5944f5[_0xa847('0x19')](0xcc)[_0xa847('0x26')]();});}};}function handleEntityNotFound(_0x236829,_0x588f0a){return function(_0x347654){if(!_0x347654){_0x236829['sendStatus'](0x194);}return _0x347654;};}function handleError(_0x41e6d8,_0x1fa00c){_0x1fa00c=_0x1fa00c||0x1f4;return function(_0x3e7680){logger[_0xa847('0x27')](_0x3e7680[_0xa847('0x28')]);if(_0x3e7680[_0xa847('0x29')]){delete _0x3e7680['name'];}_0x41e6d8[_0xa847('0x19')](_0x1fa00c)['send'](_0x3e7680);};}exports[_0xa847('0x2a')]=function(_0x2534f3,_0x1c0bd4){var _0x50fdbb={},_0x5dfe1a={},_0x389808={'count':0x0,'rows':[]};var _0x3b1b30=_[_0xa847('0x2b')](db['Dynamics365Configuration'][_0xa847('0x2c')],function(_0x427469){return{'name':_0x427469['fieldName'],'type':_0x427469[_0xa847('0x2d')]['key']};});_0x5dfe1a[_0xa847('0x2e')]=_[_0xa847('0x2b')](_0x3b1b30,_0xa847('0x29'));_0x5dfe1a[_0xa847('0x2f')]=_[_0xa847('0x30')](_0x2534f3[_0xa847('0x2f')]);_0x5dfe1a[_0xa847('0x31')]=_[_0xa847('0x32')](_0x5dfe1a[_0xa847('0x2e')],_0x5dfe1a['query']);_0x50fdbb[_0xa847('0x33')]=_[_0xa847('0x32')](_0x5dfe1a[_0xa847('0x2e')],qs[_0xa847('0x34')](_0x2534f3[_0xa847('0x2f')][_0xa847('0x34')]));_0x50fdbb[_0xa847('0x33')]=_0x50fdbb[_0xa847('0x33')]['length']?_0x50fdbb[_0xa847('0x33')]:_0x5dfe1a[_0xa847('0x2e')];if(!_0x2534f3[_0xa847('0x2f')]['hasOwnProperty']('nolimit')){_0x50fdbb[_0xa847('0x1e')]=qs[_0xa847('0x1e')](_0x2534f3[_0xa847('0x2f')]['limit']);_0x50fdbb['offset']=qs[_0xa847('0x1b')](_0x2534f3[_0xa847('0x2f')][_0xa847('0x1b')]);}_0x50fdbb[_0xa847('0x35')]=qs[_0xa847('0x36')](_0x2534f3[_0xa847('0x2f')][_0xa847('0x36')]);_0x50fdbb[_0xa847('0x37')]=qs[_0xa847('0x31')](_[_0xa847('0x38')](_0x2534f3[_0xa847('0x2f')],_0x5dfe1a[_0xa847('0x31')]),_0x3b1b30);if(_0x2534f3['query'][_0xa847('0x39')]){_0x50fdbb[_0xa847('0x37')]=_[_0xa847('0x3a')](_0x50fdbb[_0xa847('0x37')],{'$or':_['map'](_0x3b1b30,function(_0x4c49f4){if(_0x4c49f4[_0xa847('0x2d')]!==_0xa847('0x3b')){var _0x1fc925={};_0x1fc925[_0x4c49f4[_0xa847('0x29')]]={'$like':'%'+_0x2534f3[_0xa847('0x2f')][_0xa847('0x39')]+'%'};return _0x1fc925;}})});}_0x50fdbb=_['merge']({},_0x50fdbb,_0x2534f3[_0xa847('0x3c')]);var _0x5763b2={'where':_0x50fdbb['where']};return db[_0xa847('0x3d')][_0xa847('0x1d')](_0x5763b2)[_0xa847('0x24')](function(_0x1f50da){_0x389808[_0xa847('0x1d')]=_0x1f50da;if(_0x2534f3['query'][_0xa847('0x3e')]){_0x50fdbb[_0xa847('0x3f')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0xa847('0x40')](_0x50fdbb);})[_0xa847('0x24')](function(_0x5121e4){_0x389808[_0xa847('0x41')]=_0x5121e4;return _0x389808;})[_0xa847('0x24')](respondWithFilteredResult(_0x1c0bd4,_0x50fdbb))[_0xa847('0x42')](handleError(_0x1c0bd4,null));};exports[_0xa847('0x43')]=function(_0x1cd157,_0x1de382){var _0x22d8b4={'raw':![],'where':{'id':_0x1cd157[_0xa847('0x44')]['id']}},_0x5b2288={};_0x5b2288[_0xa847('0x2e')]=_[_0xa847('0x30')](db[_0xa847('0x3d')][_0xa847('0x2c')]);_0x5b2288[_0xa847('0x2f')]=_[_0xa847('0x30')](_0x1cd157[_0xa847('0x2f')]);_0x5b2288[_0xa847('0x31')]=_[_0xa847('0x32')](_0x5b2288['model'],_0x5b2288['query']);_0x22d8b4[_0xa847('0x33')]=_[_0xa847('0x32')](_0x5b2288[_0xa847('0x2e')],qs[_0xa847('0x34')](_0x1cd157[_0xa847('0x2f')][_0xa847('0x34')]));_0x22d8b4[_0xa847('0x33')]=_0x22d8b4[_0xa847('0x33')]['length']?_0x22d8b4[_0xa847('0x33')]:_0x5b2288[_0xa847('0x2e')];if(_0x1cd157[_0xa847('0x2f')][_0xa847('0x3e')]){_0x22d8b4[_0xa847('0x3f')]=[{'all':!![]}];}_0x22d8b4=_['merge']({},_0x22d8b4,_0x1cd157['options']);return db[_0xa847('0x3d')][_0xa847('0x45')](_0x22d8b4)[_0xa847('0x24')](handleEntityNotFound(_0x1de382,null))[_0xa847('0x24')](respondWithResult(_0x1de382,null))[_0xa847('0x42')](handleError(_0x1de382,null));};exports[_0xa847('0x46')]=function(_0x38b1a4,_0x1127ef){return db[_0xa847('0x3d')]['create'](_0x38b1a4[_0xa847('0x47')],{})[_0xa847('0x24')](respondWithResult(_0x1127ef,0xc9))[_0xa847('0x42')](handleError(_0x1127ef,null));};exports[_0xa847('0x23')]=function(_0x1c3ad1,_0x1cda13){if(_0x1c3ad1[_0xa847('0x47')]['id']){delete _0x1c3ad1[_0xa847('0x47')]['id'];}return db['Dynamics365Configuration'][_0xa847('0x45')]({'where':{'id':_0x1c3ad1[_0xa847('0x44')]['id']}})['then'](handleEntityNotFound(_0x1cda13,null))[_0xa847('0x24')](saveUpdates(_0x1c3ad1['body'],null))[_0xa847('0x24')](respondWithResult(_0x1cda13,null))[_0xa847('0x42')](handleError(_0x1cda13,null));};exports[_0xa847('0x25')]=function(_0x151f9f,_0x1f6113){return db[_0xa847('0x3d')]['find']({'where':{'id':_0x151f9f[_0xa847('0x44')]['id']}})[_0xa847('0x24')](handleEntityNotFound(_0x1f6113,null))[_0xa847('0x24')](removeEntity(_0x1f6113,null))[_0xa847('0x42')](handleError(_0x1f6113,null));};exports[_0xa847('0x48')]=function(_0xadeb28,_0x5a78f8,_0x4290a3){var _0x3d8907={};var _0x216fbd={};var _0xee7572;var _0x1c30d6;return db['Dynamics365Configuration'][_0xa847('0x49')]({'where':{'id':_0xadeb28['params']['id']}})[_0xa847('0x24')](handleEntityNotFound(_0x5a78f8,null))[_0xa847('0x24')](function(_0x18b09b){if(_0x18b09b){_0xee7572=_0x18b09b;_0x216fbd['model']=_[_0xa847('0x30')](db[_0xa847('0x4a')][_0xa847('0x2c')]);_0x216fbd[_0xa847('0x2f')]=_[_0xa847('0x30')](_0xadeb28['query']);_0x216fbd[_0xa847('0x31')]=_[_0xa847('0x32')](_0x216fbd['model'],_0x216fbd[_0xa847('0x2f')]);_0x3d8907[_0xa847('0x33')]=_[_0xa847('0x32')](_0x216fbd[_0xa847('0x2e')],qs[_0xa847('0x34')](_0xadeb28[_0xa847('0x2f')]['fields']));_0x3d8907[_0xa847('0x33')]=_0x3d8907['attributes'][_0xa847('0x4b')]?_0x3d8907[_0xa847('0x33')]:_0x216fbd[_0xa847('0x2e')];_0x3d8907[_0xa847('0x35')]=qs[_0xa847('0x36')](_0xadeb28[_0xa847('0x2f')]['sort']);_0x3d8907[_0xa847('0x37')]=qs[_0xa847('0x31')](_[_0xa847('0x38')](_0xadeb28[_0xa847('0x2f')],_0x216fbd[_0xa847('0x31')]));if(_0xadeb28[_0xa847('0x2f')][_0xa847('0x39')]){_0x3d8907['where']=_['merge'](_0x3d8907[_0xa847('0x37')],{'$or':_[_0xa847('0x2b')](_0x3d8907['attributes'],function(_0x3d0e13){var _0x164852={};_0x164852[_0x3d0e13]={'$like':'%'+_0xadeb28[_0xa847('0x2f')][_0xa847('0x39')]+'%'};return _0x164852;})});}_0x3d8907=_[_0xa847('0x3a')]({},_0x3d8907,_0xadeb28[_0xa847('0x3c')]);return _0xee7572['getFields'](_0x3d8907);}})[_0xa847('0x24')](function(_0x34681e){if(_0x34681e){_0x1c30d6=_0x34681e[_0xa847('0x4b')];if(!_0xadeb28[_0xa847('0x2f')][_0xa847('0x4c')]('nolimit')){_0x3d8907[_0xa847('0x1e')]=qs[_0xa847('0x1e')](_0xadeb28['query'][_0xa847('0x1e')]);_0x3d8907[_0xa847('0x1b')]=qs['offset'](_0xadeb28[_0xa847('0x2f')][_0xa847('0x1b')]);}return _0xee7572['getFields'](_0x3d8907);}})[_0xa847('0x24')](function(_0x53b860){if(_0x53b860){return _0x53b860?{'count':_0x1c30d6,'rows':_0x53b860}:null;}})['then'](respondWithResult(_0x5a78f8,null))['catch'](handleError(_0x5a78f8,null));};exports[_0xa847('0x4d')]=function(_0x234386,_0x24bd06,_0xcab256){var _0x242eb5={};var _0x2d3d05={};var _0x1cfc35;var _0x4e6d08;return db[_0xa847('0x3d')][_0xa847('0x49')]({'where':{'id':_0x234386['params']['id']}})['then'](handleEntityNotFound(_0x24bd06,null))[_0xa847('0x24')](function(_0x2a5ec0){if(_0x2a5ec0){_0x1cfc35=_0x2a5ec0;_0x2d3d05[_0xa847('0x2e')]=_[_0xa847('0x30')](db[_0xa847('0x4a')][_0xa847('0x2c')]);_0x2d3d05[_0xa847('0x2f')]=_[_0xa847('0x30')](_0x234386['query']);_0x2d3d05[_0xa847('0x31')]=_['intersection'](_0x2d3d05['model'],_0x2d3d05[_0xa847('0x2f')]);_0x242eb5[_0xa847('0x33')]=_[_0xa847('0x32')](_0x2d3d05[_0xa847('0x2e')],qs['fields'](_0x234386[_0xa847('0x2f')][_0xa847('0x34')]));_0x242eb5[_0xa847('0x33')]=_0x242eb5[_0xa847('0x33')]['length']?_0x242eb5[_0xa847('0x33')]:_0x2d3d05[_0xa847('0x2e')];_0x242eb5[_0xa847('0x35')]=qs['sort'](_0x234386[_0xa847('0x2f')][_0xa847('0x36')]);_0x242eb5[_0xa847('0x37')]=qs['filters'](_['pick'](_0x234386[_0xa847('0x2f')],_0x2d3d05['filters']));if(_0x234386[_0xa847('0x2f')][_0xa847('0x39')]){_0x242eb5[_0xa847('0x37')]=_[_0xa847('0x3a')](_0x242eb5[_0xa847('0x37')],{'$or':_['map'](_0x242eb5[_0xa847('0x33')],function(_0x427c4f){var _0x4f21fa={};_0x4f21fa[_0x427c4f]={'$like':'%'+_0x234386[_0xa847('0x2f')][_0xa847('0x39')]+'%'};return _0x4f21fa;})});}_0x242eb5=_[_0xa847('0x3a')]({},_0x242eb5,_0x234386[_0xa847('0x3c')]);return _0x1cfc35[_0xa847('0x4d')](_0x242eb5);}})[_0xa847('0x24')](function(_0x35e71e){if(_0x35e71e){_0x4e6d08=_0x35e71e[_0xa847('0x4b')];if(!_0x234386[_0xa847('0x2f')]['hasOwnProperty'](_0xa847('0x4e'))){_0x242eb5['limit']=qs[_0xa847('0x1e')](_0x234386[_0xa847('0x2f')][_0xa847('0x1e')]);_0x242eb5['offset']=qs[_0xa847('0x1b')](_0x234386[_0xa847('0x2f')]['offset']);}return _0x1cfc35[_0xa847('0x4d')](_0x242eb5);}})['then'](function(_0x5e2127){if(_0x5e2127){return _0x5e2127?{'count':_0x4e6d08,'rows':_0x5e2127}:null;}})[_0xa847('0x24')](respondWithResult(_0x24bd06,null))['catch'](handleError(_0x24bd06,null));};exports[_0xa847('0x4f')]=function(_0x4d05ef,_0x205abe,_0x1243de){var _0x4e6617={};var _0x24ff65={};var _0xccd14f;var _0x47fc01;return db[_0xa847('0x3d')][_0xa847('0x49')]({'where':{'id':_0x4d05ef[_0xa847('0x44')]['id']}})[_0xa847('0x24')](handleEntityNotFound(_0x205abe,null))[_0xa847('0x24')](function(_0x5c483e){if(_0x5c483e){_0xccd14f=_0x5c483e;_0x24ff65[_0xa847('0x2e')]=_[_0xa847('0x30')](db[_0xa847('0x4a')][_0xa847('0x2c')]);_0x24ff65['query']=_[_0xa847('0x30')](_0x4d05ef[_0xa847('0x2f')]);_0x24ff65[_0xa847('0x31')]=_[_0xa847('0x32')](_0x24ff65[_0xa847('0x2e')],_0x24ff65[_0xa847('0x2f')]);_0x4e6617[_0xa847('0x33')]=_[_0xa847('0x32')](_0x24ff65[_0xa847('0x2e')],qs['fields'](_0x4d05ef[_0xa847('0x2f')][_0xa847('0x34')]));_0x4e6617[_0xa847('0x33')]=_0x4e6617[_0xa847('0x33')][_0xa847('0x4b')]?_0x4e6617[_0xa847('0x33')]:_0x24ff65[_0xa847('0x2e')];_0x4e6617[_0xa847('0x35')]=qs[_0xa847('0x36')](_0x4d05ef[_0xa847('0x2f')]['sort']);_0x4e6617[_0xa847('0x37')]=qs[_0xa847('0x31')](_[_0xa847('0x38')](_0x4d05ef[_0xa847('0x2f')],_0x24ff65[_0xa847('0x31')]));if(_0x4d05ef[_0xa847('0x2f')][_0xa847('0x39')]){_0x4e6617[_0xa847('0x37')]=_[_0xa847('0x3a')](_0x4e6617[_0xa847('0x37')],{'$or':_['map'](_0x4e6617[_0xa847('0x33')],function(_0x27b4f3){var _0x14cbd0={};_0x14cbd0[_0x27b4f3]={'$like':'%'+_0x4d05ef[_0xa847('0x2f')]['filter']+'%'};return _0x14cbd0;})});}_0x4e6617=_[_0xa847('0x3a')]({},_0x4e6617,_0x4d05ef[_0xa847('0x3c')]);return _0xccd14f[_0xa847('0x4f')](_0x4e6617);}})[_0xa847('0x24')](function(_0x5887ad){if(_0x5887ad){_0x47fc01=_0x5887ad[_0xa847('0x4b')];if(!_0x4d05ef[_0xa847('0x2f')][_0xa847('0x4c')](_0xa847('0x4e'))){_0x4e6617[_0xa847('0x1e')]=qs[_0xa847('0x1e')](_0x4d05ef[_0xa847('0x2f')][_0xa847('0x1e')]);_0x4e6617[_0xa847('0x1b')]=qs['offset'](_0x4d05ef[_0xa847('0x2f')][_0xa847('0x1b')]);}return _0xccd14f[_0xa847('0x4f')](_0x4e6617);}})[_0xa847('0x24')](function(_0x571eb4){if(_0x571eb4){return _0x571eb4?{'count':_0x47fc01,'rows':_0x571eb4}:null;}})[_0xa847('0x24')](respondWithResult(_0x205abe,null))[_0xa847('0x42')](handleError(_0x205abe,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index c1158d6..571abb0 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 _0x6f0d=['./intDynamics365Configuration.attributes','define','Dynamics365Configuration','int_dynamics365_configurations','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x98e868,_0x1da8ec){_0x98e868=_0x98e868-0x0;var _0x885b32=_0x6f0d[_0x98e868];return _0x885b32;};'use strict';var _=require('lodash');var util=require(_0xd6f0('0x0'));var logger=require(_0xd6f0('0x1'))(_0xd6f0('0x2'));var moment=require(_0xd6f0('0x3'));var BPromise=require('bluebird');var rp=require(_0xd6f0('0x4'));var fs=require('fs');var path=require(_0xd6f0('0x5'));var rimraf=require(_0xd6f0('0x6'));var config=require(_0xd6f0('0x7'));var attributes=require(_0xd6f0('0x8'));module['exports']=function(_0x2d2ce6,_0x4a8b0c){return _0x2d2ce6[_0xd6f0('0x9')](_0xd6f0('0xa'),attributes,{'tableName':_0xd6f0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34e8=['int_dynamics365_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration'];(function(_0x3a898d,_0x595cc1){var _0xc9372=function(_0x4eb05e){while(--_0x4eb05e){_0x3a898d['push'](_0x3a898d['shift']());}};_0xc9372(++_0x595cc1);}(_0x34e8,0x12c));var _0x834e=function(_0x1201e7,_0xd9e0e0){_0x1201e7=_0x1201e7-0x0;var _0x2f810a=_0x34e8[_0x1201e7];return _0x2f810a;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 1046169..146adf1 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 _0x17f5=['rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x37e886,_0x17d0ad){var _0x57c5cd=function(_0x2692a3){while(--_0x2692a3){_0x37e886['push'](_0x37e886['shift']());}};_0x57c5cd(++_0x17d0ad);}(_0x17f5,0x83));var _0x517f=function(_0x24c0e0,_0x470d39){_0x24c0e0=_0x24c0e0-0x0;var _0xffb8e2=_0x17f5[_0x24c0e0];return _0xffb8e2;};'use strict';var _=require(_0x517f('0x0'));var util=require(_0x517f('0x1'));var moment=require('moment');var BPromise=require(_0x517f('0x2'));var rs=require(_0x517f('0x3'));var fs=require('fs');var Redis=require(_0x517f('0x4'));var db=require(_0x517f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x517f('0x6'))(_0x517f('0x7'));var config=require(_0x517f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x517f('0x9')][_0x517f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9aca5e,_0x1162c2,_0x53e36f){return new BPromise(function(_0x5b40b1,_0x384099){return client[_0x517f('0xb')](_0x9aca5e,_0x53e36f)[_0x517f('0xc')](function(_0x37929f){logger[_0x517f('0xd')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1162c2,_0x517f('0xe'));logger[_0x517f('0xf')](_0x517f('0x10'),_0x1162c2,_0x517f('0xe'),JSON['stringify'](_0x37929f));if(_0x37929f['error']){if(_0x37929f[_0x517f('0x11')][_0x517f('0x12')]===0x1f4){logger['error'](_0x517f('0x13'),_0x1162c2,_0x37929f['error'][_0x517f('0x14')]);return _0x384099(_0x37929f[_0x517f('0x11')][_0x517f('0x14')]);}logger[_0x517f('0x11')](_0x517f('0x13'),_0x1162c2,_0x37929f[_0x517f('0x11')]['message']);return _0x5b40b1(_0x37929f[_0x517f('0x11')]['message']);}else{logger['info'](_0x517f('0x13'),_0x1162c2,_0x517f('0xe'));_0x5b40b1(_0x37929f[_0x517f('0x15')][_0x517f('0x14')]);}})[_0x517f('0x16')](function(_0x239608){logger[_0x517f('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1162c2,_0x239608);_0x384099(_0x239608);});});} \ No newline at end of file +var _0x3622=['info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x1881ac,_0x57ecf4){var _0x3b966e=function(_0x134036){while(--_0x134036){_0x1881ac['push'](_0x1881ac['shift']());}};_0x3b966e(++_0x57ecf4);}(_0x3622,0x161));var _0x2362=function(_0x367e5b,_0x5721e4){_0x367e5b=_0x367e5b-0x0;var _0x4b909e=_0x3622[_0x367e5b];return _0x4b909e;};'use strict';var _=require(_0x2362('0x0'));var util=require(_0x2362('0x1'));var moment=require(_0x2362('0x2'));var BPromise=require(_0x2362('0x3'));var rs=require(_0x2362('0x4'));var fs=require('fs');var Redis=require(_0x2362('0x5'));var db=require(_0x2362('0x6'))['db'];var utils=require(_0x2362('0x7'));var logger=require(_0x2362('0x8'))('rpc');var config=require(_0x2362('0x9'));var jayson=require(_0x2362('0xa'));var client=jayson[_0x2362('0xb')][_0x2362('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4eeffc,_0xb7d800,_0xde8634){return new BPromise(function(_0x32de7b,_0x534fb0){return client[_0x2362('0xd')](_0x4eeffc,_0xde8634)[_0x2362('0xe')](function(_0x5b315a){logger['info'](_0x2362('0xf'),_0xb7d800,_0x2362('0x10'));logger[_0x2362('0x11')](_0x2362('0x12'),_0xb7d800,'request\x20sent',JSON['stringify'](_0x5b315a));if(_0x5b315a['error']){if(_0x5b315a[_0x2362('0x13')][_0x2362('0x14')]===0x1f4){logger[_0x2362('0x13')](_0x2362('0xf'),_0xb7d800,_0x5b315a[_0x2362('0x13')][_0x2362('0x15')]);return _0x534fb0(_0x5b315a['error'][_0x2362('0x15')]);}logger[_0x2362('0x13')](_0x2362('0xf'),_0xb7d800,_0x5b315a['error']['message']);return _0x32de7b(_0x5b315a[_0x2362('0x13')]['message']);}else{logger[_0x2362('0x16')](_0x2362('0xf'),_0xb7d800,_0x2362('0x10'));_0x32de7b(_0x5b315a[_0x2362('0x17')]['message']);}})[_0x2362('0x18')](function(_0x571dc2){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0xb7d800,_0x571dc2);_0x534fb0(_0x571dc2);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index eaaf34c..2e561ff 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 _0x018c=['delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','/:id','show','post','isAuthenticated','create','put','update'];(function(_0x5adb18,_0x222326){var _0x420c98=function(_0x146b7b){while(--_0x146b7b){_0x5adb18['push'](_0x5adb18['shift']());}};_0x420c98(++_0x222326);}(_0x018c,0x1b2));var _0xc018=function(_0x1693b6,_0x3b59c3){_0x1693b6=_0x1693b6-0x0;var _0x5e83c8=_0x018c[_0x1693b6];return _0x5e83c8;};'use strict';var multer=require(_0xc018('0x0'));var util=require(_0xc018('0x1'));var path=require(_0xc018('0x2'));var timeout=require(_0xc018('0x3'));var express=require('express');var router=express[_0xc018('0x4')]();var fs_extra=require(_0xc018('0x5'));var auth=require(_0xc018('0x6'));var interaction=require(_0xc018('0x7'));var config=require('../../config/environment');var controller=require('./intDynamics365Field.controller');router[_0xc018('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xc018('0x9'),auth['isAuthenticated'](),controller[_0xc018('0xa')]);router[_0xc018('0xb')]('/',auth[_0xc018('0xc')](),controller[_0xc018('0xd')]);router[_0xc018('0xe')](_0xc018('0x9'),auth['isAuthenticated'](),controller[_0xc018('0xf')]);router[_0xc018('0x10')](_0xc018('0x9'),auth[_0xc018('0xc')](),controller['destroy']);module[_0xc018('0x11')]=router; \ No newline at end of file +var _0xc24e=['fs-extra','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x42e13d,_0x4205c5){var _0x58d783=function(_0x4ab959){while(--_0x4ab959){_0x42e13d['push'](_0x42e13d['shift']());}};_0x58d783(++_0x4205c5);}(_0xc24e,0x104));var _0xec24=function(_0x15c92a,_0xf7c6d6){_0x15c92a=_0x15c92a-0x0;var _0x4700f6=_0xc24e[_0x15c92a];return _0x4700f6;};'use strict';var multer=require(_0xec24('0x0'));var util=require(_0xec24('0x1'));var path=require(_0xec24('0x2'));var timeout=require(_0xec24('0x3'));var express=require(_0xec24('0x4'));var router=express[_0xec24('0x5')]();var fs_extra=require(_0xec24('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xec24('0x7'));var config=require('../../config/environment');var controller=require('./intDynamics365Field.controller');router[_0xec24('0x8')]('/',auth[_0xec24('0x9')](),controller[_0xec24('0xa')]);router[_0xec24('0x8')](_0xec24('0xb'),auth[_0xec24('0x9')](),controller[_0xec24('0xc')]);router[_0xec24('0xd')]('/',auth[_0xec24('0x9')](),controller[_0xec24('0xe')]);router[_0xec24('0xf')](_0xec24('0xb'),auth[_0xec24('0x9')](),controller[_0xec24('0x10')]);router['delete'](_0xec24('0xb'),auth[_0xec24('0x9')](),controller[_0xec24('0x11')]);module[_0xec24('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 878656f..69d6f90 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 _0x496c=['picklist','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','string','variable','keyValue'];(function(_0xc9132c,_0x283e7d){var _0x4a9536=function(_0x52fa4b){while(--_0x52fa4b){_0xc9132c['push'](_0xc9132c['shift']());}};_0x4a9536(++_0x283e7d);}(_0x496c,0x90));var _0xc496=function(_0x3a9181,_0x29b1bf){_0x3a9181=_0x3a9181-0x0;var _0x536baf=_0x496c[_0x3a9181];return _0x536baf;};'use strict';var Sequelize=require(_0xc496('0x0'));module[_0xc496('0x1')]={'type':{'type':Sequelize[_0xc496('0x2')](_0xc496('0x3'),_0xc496('0x4'),'customVariable',_0xc496('0x5'),_0xc496('0x6')),'defaultValue':_0xc496('0x3')},'content':{'type':Sequelize[_0xc496('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xc496('0x3'),_0xc496('0x4'),_0xc496('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xc496('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xc496('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc496('0x7')]}}; \ No newline at end of file +var _0x7592=['customVariable','keyValue','picklist','STRING','variable','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x2cbb2e,_0x227b71){var _0x5b3d29=function(_0x21ed57){while(--_0x21ed57){_0x2cbb2e['push'](_0x2cbb2e['shift']());}};_0x5b3d29(++_0x227b71);}(_0x7592,0x1dc));var _0x2759=function(_0x2f32c4,_0x2597ba){_0x2f32c4=_0x2f32c4-0x0;var _0x95b5dc=_0x7592[_0x2f32c4];return _0x95b5dc;};'use strict';var Sequelize=require(_0x2759('0x0'));module[_0x2759('0x1')]={'type':{'type':Sequelize[_0x2759('0x2')](_0x2759('0x3'),'variable',_0x2759('0x4'),_0x2759('0x5'),_0x2759('0x6')),'defaultValue':_0x2759('0x3')},'content':{'type':Sequelize[_0x2759('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x2759('0x2')]('string',_0x2759('0x8'),_0x2759('0x4'))},'keyContent':{'type':Sequelize[_0x2759('0x7')]},'idField':{'type':Sequelize[_0x2759('0x7')]},'nameField':{'type':Sequelize[_0x2759('0x7')]},'customField':{'type':Sequelize[_0x2759('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2759('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 0136f2e..8bb9769 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 _0x4566=['update','find','eml-format','rimraf','zip-dir','request-promise','bluebird','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/environment','../../config/license/util','sendStatus','status','json','undefined','limit','offset','count','Content-Range','reject','save','destroy','end','stack','name','index','map','Dynamics365Field','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','then','includeAll','findAll','rows','params','intersection','include','options','catch','create','body'];(function(_0x31ec99,_0x23a6d0){var _0x586649=function(_0x4205be){while(--_0x4205be){_0x31ec99['push'](_0x31ec99['shift']());}};_0x586649(++_0x23a6d0);}(_0x4566,0x174));var _0x6456=function(_0x1c2696,_0x5dc35c){_0x1c2696=_0x1c2696-0x0;var _0x2cd023=_0x4566[_0x1c2696];return _0x2cd023;};'use strict';var emlformat=require(_0x6456('0x0'));var rimraf=require(_0x6456('0x1'));var zipdir=require(_0x6456('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6456('0x3'));var moment=require('moment');var BPromise=require(_0x6456('0x4'));var Mustache=require(_0x6456('0x5'));var util=require(_0x6456('0x6'));var path=require('path');var sox=require(_0x6456('0x7'));var csv=require(_0x6456('0x8'));var ejs=require(_0x6456('0x9'));var fs=require('fs');var fs_extra=require(_0x6456('0xa'));var _=require(_0x6456('0xb'));var squel=require(_0x6456('0xc'));var crypto=require('crypto');var jsforce=require(_0x6456('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6456('0xe'));var Redis=require(_0x6456('0xf'));var authService=require(_0x6456('0x10'));var qs=require(_0x6456('0x11'));var as=require(_0x6456('0x12'));var hardwareService=require(_0x6456('0x13'));var logger=require(_0x6456('0x14'))(_0x6456('0x15'));var utils=require('../../config/utils');var config=require(_0x6456('0x16'));var licenseUtil=require(_0x6456('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5902f6,_0x4cf250){_0x4cf250=_0x4cf250||0xcc;return function(_0x29abda){if(_0x29abda){return _0x5902f6[_0x6456('0x18')](_0x4cf250);}return _0x5902f6[_0x6456('0x19')](_0x4cf250)['end']();};}function respondWithResult(_0x549057,_0x4122af){_0x4122af=_0x4122af||0xc8;return function(_0x4f6976){if(_0x4f6976){return _0x549057[_0x6456('0x19')](_0x4122af)[_0x6456('0x1a')](_0x4f6976);}};}function respondWithFilteredResult(_0x1c37ca,_0x2d1777){return function(_0x366184){if(_0x366184){var _0x35f536=typeof _0x2d1777['offset']===_0x6456('0x1b')&&typeof _0x2d1777[_0x6456('0x1c')]===_0x6456('0x1b');var _0x1820a0=_0x366184['count'];var _0xdeb228=_0x35f536?0x0:_0x2d1777[_0x6456('0x1d')];var _0x4c52d0=_0x35f536?_0x366184[_0x6456('0x1e')]:_0x2d1777[_0x6456('0x1d')]+_0x2d1777[_0x6456('0x1c')];var _0x242d2a;if(_0x4c52d0>=_0x1820a0){_0x4c52d0=_0x1820a0;_0x242d2a=0xc8;}else{_0x242d2a=0xce;}_0x1c37ca[_0x6456('0x19')](_0x242d2a);return _0x1c37ca['set'](_0x6456('0x1f'),_0xdeb228+'-'+_0x4c52d0+'/'+_0x1820a0)[_0x6456('0x1a')](_0x366184);}return null;};}function patchUpdates(_0x3e3360){return function(_0x4265a6){try{jsonpatch['apply'](_0x4265a6,_0x3e3360,!![]);}catch(_0x32ed1b){return BPromise[_0x6456('0x20')](_0x32ed1b);}return _0x4265a6[_0x6456('0x21')]();};}function saveUpdates(_0x93007a,_0x3eb026){return function(_0x4eb3cf){if(_0x4eb3cf){return _0x4eb3cf['update'](_0x93007a)['then'](function(_0x10b63e){return _0x10b63e;});}return null;};}function removeEntity(_0x4561b0,_0xe2dcb2){return function(_0xd3d338){if(_0xd3d338){return _0xd3d338[_0x6456('0x22')]()['then'](function(){_0x4561b0['status'](0xcc)[_0x6456('0x23')]();});}};}function handleEntityNotFound(_0x590ea1,_0x321b4f){return function(_0x199d11){if(!_0x199d11){_0x590ea1[_0x6456('0x18')](0x194);}return _0x199d11;};}function handleError(_0x1e4f4b,_0x2aea48){_0x2aea48=_0x2aea48||0x1f4;return function(_0x406982){logger['error'](_0x406982[_0x6456('0x24')]);if(_0x406982[_0x6456('0x25')]){delete _0x406982[_0x6456('0x25')];}_0x1e4f4b['status'](_0x2aea48)['send'](_0x406982);};}exports[_0x6456('0x26')]=function(_0x31f84e,_0x580663){var _0x2e63e2={},_0x422514={},_0x420195={'count':0x0,'rows':[]};var _0x316fa5=_[_0x6456('0x27')](db[_0x6456('0x28')][_0x6456('0x29')],function(_0x50fdb5){return{'name':_0x50fdb5[_0x6456('0x2a')],'type':_0x50fdb5['type'][_0x6456('0x2b')]};});_0x422514[_0x6456('0x2c')]=_[_0x6456('0x27')](_0x316fa5,_0x6456('0x25'));_0x422514[_0x6456('0x2d')]=_[_0x6456('0x2e')](_0x31f84e[_0x6456('0x2d')]);_0x422514[_0x6456('0x2f')]=_['intersection'](_0x422514[_0x6456('0x2c')],_0x422514[_0x6456('0x2d')]);_0x2e63e2[_0x6456('0x30')]=_['intersection'](_0x422514[_0x6456('0x2c')],qs[_0x6456('0x31')](_0x31f84e['query'][_0x6456('0x31')]));_0x2e63e2[_0x6456('0x30')]=_0x2e63e2['attributes'][_0x6456('0x32')]?_0x2e63e2[_0x6456('0x30')]:_0x422514['model'];if(!_0x31f84e[_0x6456('0x2d')][_0x6456('0x33')](_0x6456('0x34'))){_0x2e63e2[_0x6456('0x1c')]=qs[_0x6456('0x1c')](_0x31f84e[_0x6456('0x2d')][_0x6456('0x1c')]);_0x2e63e2[_0x6456('0x1d')]=qs[_0x6456('0x1d')](_0x31f84e['query']['offset']);}_0x2e63e2[_0x6456('0x35')]=qs['sort'](_0x31f84e[_0x6456('0x2d')][_0x6456('0x36')]);_0x2e63e2[_0x6456('0x37')]=qs[_0x6456('0x2f')](_[_0x6456('0x38')](_0x31f84e[_0x6456('0x2d')],_0x422514[_0x6456('0x2f')]),_0x316fa5);if(_0x31f84e[_0x6456('0x2d')][_0x6456('0x39')]){_0x2e63e2[_0x6456('0x37')]=_[_0x6456('0x3a')](_0x2e63e2['where'],{'$or':_['map'](_0x316fa5,function(_0x5d7b56){if(_0x5d7b56[_0x6456('0x3b')]!==_0x6456('0x3c')){var _0x42ecb0={};_0x42ecb0[_0x5d7b56[_0x6456('0x25')]]={'$like':'%'+_0x31f84e[_0x6456('0x2d')][_0x6456('0x39')]+'%'};return _0x42ecb0;}})});}_0x2e63e2=_[_0x6456('0x3a')]({},_0x2e63e2,_0x31f84e['options']);var _0x32e54c={'where':_0x2e63e2[_0x6456('0x37')]};return db['Dynamics365Field'][_0x6456('0x1e')](_0x32e54c)[_0x6456('0x3d')](function(_0x3f47a7){_0x420195[_0x6456('0x1e')]=_0x3f47a7;if(_0x31f84e[_0x6456('0x2d')][_0x6456('0x3e')]){_0x2e63e2['include']=[{'all':!![]}];}return db[_0x6456('0x28')][_0x6456('0x3f')](_0x2e63e2);})[_0x6456('0x3d')](function(_0xd87b45){_0x420195[_0x6456('0x40')]=_0xd87b45;return _0x420195;})[_0x6456('0x3d')](respondWithFilteredResult(_0x580663,_0x2e63e2))['catch'](handleError(_0x580663,null));};exports['show']=function(_0x909cde,_0x24f91d){var _0x6f4a94={'raw':!![],'where':{'id':_0x909cde[_0x6456('0x41')]['id']}},_0x3b4b21={};_0x3b4b21['model']=_[_0x6456('0x2e')](db[_0x6456('0x28')][_0x6456('0x29')]);_0x3b4b21['query']=_[_0x6456('0x2e')](_0x909cde[_0x6456('0x2d')]);_0x3b4b21['filters']=_[_0x6456('0x42')](_0x3b4b21[_0x6456('0x2c')],_0x3b4b21[_0x6456('0x2d')]);_0x6f4a94[_0x6456('0x30')]=_[_0x6456('0x42')](_0x3b4b21[_0x6456('0x2c')],qs[_0x6456('0x31')](_0x909cde['query'][_0x6456('0x31')]));_0x6f4a94[_0x6456('0x30')]=_0x6f4a94[_0x6456('0x30')]['length']?_0x6f4a94[_0x6456('0x30')]:_0x3b4b21[_0x6456('0x2c')];if(_0x909cde['query'][_0x6456('0x3e')]){_0x6f4a94[_0x6456('0x43')]=[{'all':!![]}];}_0x6f4a94=_['merge']({},_0x6f4a94,_0x909cde[_0x6456('0x44')]);return db[_0x6456('0x28')]['find'](_0x6f4a94)['then'](handleEntityNotFound(_0x24f91d,null))['then'](respondWithResult(_0x24f91d,null))[_0x6456('0x45')](handleError(_0x24f91d,null));};exports[_0x6456('0x46')]=function(_0x1c5fc8,_0x1368a1){return db[_0x6456('0x28')][_0x6456('0x46')](_0x1c5fc8[_0x6456('0x47')],{})[_0x6456('0x3d')](respondWithResult(_0x1368a1,0xc9))[_0x6456('0x45')](handleError(_0x1368a1,null));};exports[_0x6456('0x48')]=function(_0x1631b5,_0x55f81f){if(_0x1631b5[_0x6456('0x47')]['id']){delete _0x1631b5[_0x6456('0x47')]['id'];}return db[_0x6456('0x28')][_0x6456('0x49')]({'where':{'id':_0x1631b5[_0x6456('0x41')]['id']}})[_0x6456('0x3d')](handleEntityNotFound(_0x55f81f,null))[_0x6456('0x3d')](saveUpdates(_0x1631b5[_0x6456('0x47')],null))['then'](respondWithResult(_0x55f81f,null))[_0x6456('0x45')](handleError(_0x55f81f,null));};exports[_0x6456('0x22')]=function(_0x3e1d6f,_0x2cdeeb){return db[_0x6456('0x28')][_0x6456('0x49')]({'where':{'id':_0x3e1d6f[_0x6456('0x41')]['id']}})['then'](handleEntityNotFound(_0x2cdeeb,null))[_0x6456('0x3d')](removeEntity(_0x2cdeeb,null))[_0x6456('0x45')](handleError(_0x2cdeeb,null));}; \ No newline at end of file +var _0xf73f=['query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','filters','pick','filter','merge','VIRTUAL','options','Dynamics365Field','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','save','update','then','error','stack','name','send','rawAttributes','fieldName','type','key','model','map'];(function(_0x1ca9e9,_0x1c4391){var _0x309f3c=function(_0x5ab318){while(--_0x5ab318){_0x1ca9e9['push'](_0x1ca9e9['shift']());}};_0x309f3c(++_0x1c4391);}(_0xf73f,0x1dd));var _0xff73=function(_0x3cf915,_0x38a9a0){_0x3cf915=_0x3cf915-0x0;var _0x12ee40=_0xf73f[_0x3cf915];return _0x12ee40;};'use strict';var emlformat=require(_0xff73('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xff73('0x1'));var jsonpatch=require(_0xff73('0x2'));var rp=require(_0xff73('0x3'));var moment=require(_0xff73('0x4'));var BPromise=require(_0xff73('0x5'));var Mustache=require(_0xff73('0x6'));var util=require(_0xff73('0x7'));var path=require(_0xff73('0x8'));var sox=require(_0xff73('0x9'));var csv=require('to-csv');var ejs=require(_0xff73('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xff73('0xb'));var crypto=require(_0xff73('0xc'));var jsforce=require(_0xff73('0xd'));var deskjs=require(_0xff73('0xe'));var toCsv=require(_0xff73('0xf'));var querystring=require(_0xff73('0x10'));var Papa=require('papaparse');var Redis=require(_0xff73('0x11'));var authService=require(_0xff73('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xff73('0x13'));var hardwareService=require(_0xff73('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xff73('0x15'));var config=require(_0xff73('0x16'));var licenseUtil=require(_0xff73('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x449ebd,_0x209145){_0x209145=_0x209145||0xcc;return function(_0x2d8e0f){if(_0x2d8e0f){return _0x449ebd[_0xff73('0x18')](_0x209145);}return _0x449ebd[_0xff73('0x19')](_0x209145)[_0xff73('0x1a')]();};}function respondWithResult(_0x4d655f,_0x27f1e1){_0x27f1e1=_0x27f1e1||0xc8;return function(_0x137ae5){if(_0x137ae5){return _0x4d655f[_0xff73('0x19')](_0x27f1e1)['json'](_0x137ae5);}};}function respondWithFilteredResult(_0x358cc5,_0x5e1329){return function(_0x408213){if(_0x408213){var _0x4c50f8=typeof _0x5e1329[_0xff73('0x1b')]==='undefined'&&typeof _0x5e1329[_0xff73('0x1c')]===_0xff73('0x1d');var _0x559191=_0x408213[_0xff73('0x1e')];var _0x3e1d1f=_0x4c50f8?0x0:_0x5e1329[_0xff73('0x1b')];var _0x423fd2=_0x4c50f8?_0x408213[_0xff73('0x1e')]:_0x5e1329[_0xff73('0x1b')]+_0x5e1329['limit'];var _0x3ca9d8;if(_0x423fd2>=_0x559191){_0x423fd2=_0x559191;_0x3ca9d8=0xc8;}else{_0x3ca9d8=0xce;}_0x358cc5[_0xff73('0x19')](_0x3ca9d8);return _0x358cc5[_0xff73('0x1f')]('Content-Range',_0x3e1d1f+'-'+_0x423fd2+'/'+_0x559191)[_0xff73('0x20')](_0x408213);}return null;};}function patchUpdates(_0x554538){return function(_0x1236a3){try{jsonpatch[_0xff73('0x21')](_0x1236a3,_0x554538,!![]);}catch(_0x4da06a){return BPromise[_0xff73('0x22')](_0x4da06a);}return _0x1236a3[_0xff73('0x23')]();};}function saveUpdates(_0x12b599,_0x260eea){return function(_0x118969){if(_0x118969){return _0x118969[_0xff73('0x24')](_0x12b599)[_0xff73('0x25')](function(_0x559669){return _0x559669;});}return null;};}function removeEntity(_0x5065e6,_0x459b4b){return function(_0x79d167){if(_0x79d167){return _0x79d167['destroy']()[_0xff73('0x25')](function(){_0x5065e6[_0xff73('0x19')](0xcc)[_0xff73('0x1a')]();});}};}function handleEntityNotFound(_0x1cb221,_0xb76bde){return function(_0x188d0b){if(!_0x188d0b){_0x1cb221['sendStatus'](0x194);}return _0x188d0b;};}function handleError(_0x311a8d,_0x5842e6){_0x5842e6=_0x5842e6||0x1f4;return function(_0x2a3ba3){logger[_0xff73('0x26')](_0x2a3ba3[_0xff73('0x27')]);if(_0x2a3ba3[_0xff73('0x28')]){delete _0x2a3ba3['name'];}_0x311a8d['status'](_0x5842e6)[_0xff73('0x29')](_0x2a3ba3);};}exports['index']=function(_0x42a549,_0x55f6e1){var _0x2d272b={},_0x1101f1={},_0x5c3ed0={'count':0x0,'rows':[]};var _0x5c1d8a=_['map'](db['Dynamics365Field'][_0xff73('0x2a')],function(_0x22afec){return{'name':_0x22afec[_0xff73('0x2b')],'type':_0x22afec[_0xff73('0x2c')][_0xff73('0x2d')]};});_0x1101f1[_0xff73('0x2e')]=_[_0xff73('0x2f')](_0x5c1d8a,_0xff73('0x28'));_0x1101f1[_0xff73('0x30')]=_[_0xff73('0x31')](_0x42a549[_0xff73('0x30')]);_0x1101f1['filters']=_[_0xff73('0x32')](_0x1101f1[_0xff73('0x2e')],_0x1101f1[_0xff73('0x30')]);_0x2d272b['attributes']=_['intersection'](_0x1101f1[_0xff73('0x2e')],qs[_0xff73('0x33')](_0x42a549[_0xff73('0x30')]['fields']));_0x2d272b[_0xff73('0x34')]=_0x2d272b[_0xff73('0x34')][_0xff73('0x35')]?_0x2d272b[_0xff73('0x34')]:_0x1101f1[_0xff73('0x2e')];if(!_0x42a549[_0xff73('0x30')][_0xff73('0x36')](_0xff73('0x37'))){_0x2d272b[_0xff73('0x1c')]=qs[_0xff73('0x1c')](_0x42a549[_0xff73('0x30')][_0xff73('0x1c')]);_0x2d272b[_0xff73('0x1b')]=qs[_0xff73('0x1b')](_0x42a549[_0xff73('0x30')][_0xff73('0x1b')]);}_0x2d272b['order']=qs['sort'](_0x42a549[_0xff73('0x30')]['sort']);_0x2d272b[_0xff73('0x38')]=qs[_0xff73('0x39')](_[_0xff73('0x3a')](_0x42a549[_0xff73('0x30')],_0x1101f1[_0xff73('0x39')]),_0x5c1d8a);if(_0x42a549['query'][_0xff73('0x3b')]){_0x2d272b[_0xff73('0x38')]=_[_0xff73('0x3c')](_0x2d272b[_0xff73('0x38')],{'$or':_[_0xff73('0x2f')](_0x5c1d8a,function(_0x3f237){if(_0x3f237['type']!==_0xff73('0x3d')){var _0x3188a3={};_0x3188a3[_0x3f237['name']]={'$like':'%'+_0x42a549['query'][_0xff73('0x3b')]+'%'};return _0x3188a3;}})});}_0x2d272b=_[_0xff73('0x3c')]({},_0x2d272b,_0x42a549[_0xff73('0x3e')]);var _0x398969={'where':_0x2d272b['where']};return db[_0xff73('0x3f')]['count'](_0x398969)[_0xff73('0x25')](function(_0x3c2441){_0x5c3ed0['count']=_0x3c2441;if(_0x42a549[_0xff73('0x30')][_0xff73('0x40')]){_0x2d272b[_0xff73('0x41')]=[{'all':!![]}];}return db['Dynamics365Field'][_0xff73('0x42')](_0x2d272b);})[_0xff73('0x25')](function(_0x341aa3){_0x5c3ed0[_0xff73('0x43')]=_0x341aa3;return _0x5c3ed0;})[_0xff73('0x25')](respondWithFilteredResult(_0x55f6e1,_0x2d272b))[_0xff73('0x44')](handleError(_0x55f6e1,null));};exports[_0xff73('0x45')]=function(_0x489887,_0x3d4fdd){var _0x26a86c={'raw':!![],'where':{'id':_0x489887[_0xff73('0x46')]['id']}},_0x40b85a={};_0x40b85a[_0xff73('0x2e')]=_[_0xff73('0x31')](db[_0xff73('0x3f')]['rawAttributes']);_0x40b85a[_0xff73('0x30')]=_['keys'](_0x489887[_0xff73('0x30')]);_0x40b85a[_0xff73('0x39')]=_['intersection'](_0x40b85a['model'],_0x40b85a[_0xff73('0x30')]);_0x26a86c[_0xff73('0x34')]=_[_0xff73('0x32')](_0x40b85a[_0xff73('0x2e')],qs[_0xff73('0x33')](_0x489887['query'][_0xff73('0x33')]));_0x26a86c['attributes']=_0x26a86c['attributes']['length']?_0x26a86c[_0xff73('0x34')]:_0x40b85a[_0xff73('0x2e')];if(_0x489887[_0xff73('0x30')]['includeAll']){_0x26a86c['include']=[{'all':!![]}];}_0x26a86c=_[_0xff73('0x3c')]({},_0x26a86c,_0x489887[_0xff73('0x3e')]);return db['Dynamics365Field'][_0xff73('0x47')](_0x26a86c)[_0xff73('0x25')](handleEntityNotFound(_0x3d4fdd,null))[_0xff73('0x25')](respondWithResult(_0x3d4fdd,null))[_0xff73('0x44')](handleError(_0x3d4fdd,null));};exports['create']=function(_0x32b3fe,_0x445ca2){return db['Dynamics365Field'][_0xff73('0x48')](_0x32b3fe[_0xff73('0x49')],{})['then'](respondWithResult(_0x445ca2,0xc9))[_0xff73('0x44')](handleError(_0x445ca2,null));};exports[_0xff73('0x24')]=function(_0x5959fd,_0x544ed2){if(_0x5959fd[_0xff73('0x49')]['id']){delete _0x5959fd[_0xff73('0x49')]['id'];}return db[_0xff73('0x3f')][_0xff73('0x47')]({'where':{'id':_0x5959fd['params']['id']}})[_0xff73('0x25')](handleEntityNotFound(_0x544ed2,null))[_0xff73('0x25')](saveUpdates(_0x5959fd[_0xff73('0x49')],null))[_0xff73('0x25')](respondWithResult(_0x544ed2,null))[_0xff73('0x44')](handleError(_0x544ed2,null));};exports[_0xff73('0x4a')]=function(_0x1cfdf2,_0x1ed97f){return db['Dynamics365Field']['find']({'where':{'id':_0x1cfdf2[_0xff73('0x46')]['id']}})['then'](handleEntityNotFound(_0x1ed97f,null))[_0xff73('0x25')](removeEntity(_0x1ed97f,null))[_0xff73('0x44')](handleError(_0x1ed97f,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 86e4a05..c3f158e 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 _0xdd5b=['moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x4aac81,_0x458d94){var _0xc0bc3b=function(_0x4a4050){while(--_0x4a4050){_0x4aac81['push'](_0x4aac81['shift']());}};_0xc0bc3b(++_0x458d94);}(_0xdd5b,0x9c));var _0xbdd5=function(_0x24918e,_0x3998e5){_0x24918e=_0x24918e-0x0;var _0x6101e5=_0xdd5b[_0x24918e];return _0x6101e5;};'use strict';var _=require(_0xbdd5('0x0'));var util=require(_0xbdd5('0x1'));var logger=require(_0xbdd5('0x2'))(_0xbdd5('0x3'));var moment=require(_0xbdd5('0x4'));var BPromise=require('bluebird');var rp=require(_0xbdd5('0x5'));var fs=require('fs');var path=require(_0xbdd5('0x6'));var rimraf=require(_0xbdd5('0x7'));var config=require(_0xbdd5('0x8'));var attributes=require(_0xbdd5('0x9'));module[_0xbdd5('0xa')]=function(_0xf1147,_0x1c3519){return _0xf1147['define'](_0xbdd5('0xb'),attributes,{'tableName':_0xbdd5('0xc'),'paranoid':![],'indexes':[{'name':_0xbdd5('0xd'),'fields':[_0xbdd5('0xe'),_0xbdd5('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a24=['path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x4d8057,_0x90ef33){var _0x572caf=function(_0x3f64b0){while(--_0x3f64b0){_0x4d8057['push'](_0x4d8057['shift']());}};_0x572caf(++_0x90ef33);}(_0x7a24,0x171));var _0x47a2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7a24[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x47a2('0x0'));var util=require(_0x47a2('0x1'));var logger=require(_0x47a2('0x2'))(_0x47a2('0x3'));var moment=require('moment');var BPromise=require(_0x47a2('0x4'));var rp=require(_0x47a2('0x5'));var fs=require('fs');var path=require(_0x47a2('0x6'));var rimraf=require(_0x47a2('0x7'));var config=require(_0x47a2('0x8'));var attributes=require(_0x47a2('0x9'));module[_0x47a2('0xa')]=function(_0x3ffc84,_0x211c00){return _0x3ffc84[_0x47a2('0xb')](_0x47a2('0xc'),attributes,{'tableName':_0x47a2('0xd'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':['idField',_0x47a2('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 6d71dd8..ce94cb3 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 _0xc103=['ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','info','Dynamics365Field,\x20%s,\x20%s','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','util','moment','randomstring'];(function(_0x3e063d,_0x277161){var _0x4c97d3=function(_0x21cea3){while(--_0x21cea3){_0x3e063d['push'](_0x3e063d['shift']());}};_0x4c97d3(++_0x277161);}(_0xc103,0x166));var _0x3c10=function(_0x4a7767,_0x46a70b){_0x4a7767=_0x4a7767-0x0;var _0x1ef8f7=_0xc103[_0x4a7767];return _0x1ef8f7;};'use strict';var _=require('lodash');var util=require(_0x3c10('0x0'));var moment=require(_0x3c10('0x1'));var BPromise=require('bluebird');var rs=require(_0x3c10('0x2'));var fs=require('fs');var Redis=require(_0x3c10('0x3'));var db=require(_0x3c10('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3c10('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3c10('0x6'));var client=jayson[_0x3c10('0x7')][_0x3c10('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26bc48,_0x49d6d7,_0x2bbe12){return new BPromise(function(_0x3ac854,_0x357cb1){return client[_0x3c10('0x9')](_0x26bc48,_0x2bbe12)['then'](function(_0x616d78){logger[_0x3c10('0xa')](_0x3c10('0xb'),_0x49d6d7,'request\x20sent');logger[_0x3c10('0xc')](_0x3c10('0xd'),_0x49d6d7,_0x3c10('0xe'),JSON['stringify'](_0x616d78));if(_0x616d78[_0x3c10('0xf')]){if(_0x616d78[_0x3c10('0xf')]['code']===0x1f4){logger[_0x3c10('0xf')](_0x3c10('0xb'),_0x49d6d7,_0x616d78[_0x3c10('0xf')][_0x3c10('0x10')]);return _0x357cb1(_0x616d78['error'][_0x3c10('0x10')]);}logger[_0x3c10('0xf')](_0x3c10('0xb'),_0x49d6d7,_0x616d78[_0x3c10('0xf')]['message']);return _0x3ac854(_0x616d78[_0x3c10('0xf')]['message']);}else{logger[_0x3c10('0xa')](_0x3c10('0xb'),_0x49d6d7,'request\x20sent');_0x3ac854(_0x616d78[_0x3c10('0x11')][_0x3c10('0x10')]);}})[_0x3c10('0x12')](function(_0x489958){logger[_0x3c10('0xf')](_0x3c10('0xb'),_0x49d6d7,_0x489958);_0x357cb1(_0x489958);});});} \ No newline at end of file +var _0x75f4=['request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s'];(function(_0x3b36e7,_0x4602a2){var _0x3a13e3=function(_0x14795f){while(--_0x14795f){_0x3b36e7['push'](_0x3b36e7['shift']());}};_0x3a13e3(++_0x4602a2);}(_0x75f4,0x68));var _0x475f=function(_0x352d28,_0x444033){_0x352d28=_0x352d28-0x0;var _0x387d7e=_0x75f4[_0x352d28];return _0x387d7e;};'use strict';var _=require(_0x475f('0x0'));var util=require(_0x475f('0x1'));var moment=require(_0x475f('0x2'));var BPromise=require(_0x475f('0x3'));var rs=require(_0x475f('0x4'));var fs=require('fs');var Redis=require(_0x475f('0x5'));var db=require(_0x475f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x475f('0x7'))(_0x475f('0x8'));var config=require(_0x475f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x475f('0xa')][_0x475f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x312f53,_0x402e0c,_0x371e9f){return new BPromise(function(_0x5ccc57,_0x107cca){return client[_0x475f('0xc')](_0x312f53,_0x371e9f)[_0x475f('0xd')](function(_0x538b41){logger[_0x475f('0xe')](_0x475f('0xf'),_0x402e0c,_0x475f('0x10'));logger[_0x475f('0x11')](_0x475f('0x12'),_0x402e0c,'request\x20sent',JSON[_0x475f('0x13')](_0x538b41));if(_0x538b41[_0x475f('0x14')]){if(_0x538b41['error']['code']===0x1f4){logger[_0x475f('0x14')](_0x475f('0xf'),_0x402e0c,_0x538b41[_0x475f('0x14')]['message']);return _0x107cca(_0x538b41[_0x475f('0x14')][_0x475f('0x15')]);}logger[_0x475f('0x14')](_0x475f('0xf'),_0x402e0c,_0x538b41['error'][_0x475f('0x15')]);return _0x5ccc57(_0x538b41[_0x475f('0x14')][_0x475f('0x15')]);}else{logger[_0x475f('0xe')]('Dynamics365Field,\x20%s,\x20%s',_0x402e0c,_0x475f('0x10'));_0x5ccc57(_0x538b41[_0x475f('0x16')]['message']);}})[_0x475f('0x17')](function(_0xb1216d){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x402e0c,_0xb1216d);_0x107cca(_0xb1216d);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index b704e74..70f0a72 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 _0x803a=['getFields','post','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x7c1a77,_0x1cefe3){var _0x3496d7=function(_0x306bb5){while(--_0x306bb5){_0x7c1a77['push'](_0x7c1a77['shift']());}};_0x3496d7(++_0x1cefe3);}(_0x803a,0x134));var _0xa803=function(_0x4c988f,_0x2bfd64){_0x4c988f=_0x4c988f-0x0;var _0x52a66f=_0x803a[_0x4c988f];return _0x52a66f;};'use strict';var multer=require('multer');var util=require(_0xa803('0x0'));var path=require(_0xa803('0x1'));var timeout=require(_0xa803('0x2'));var express=require('express');var router=express[_0xa803('0x3')]();var fs_extra=require(_0xa803('0x4'));var auth=require(_0xa803('0x5'));var interaction=require(_0xa803('0x6'));var config=require(_0xa803('0x7'));var controller=require('./intFreshdeskAccount.controller');router[_0xa803('0x8')]('/',auth['isAuthenticated'](),controller[_0xa803('0x9')]);router[_0xa803('0x8')]('/:id',auth[_0xa803('0xa')](),controller['show']);router['get'](_0xa803('0xb'),auth[_0xa803('0xa')](),controller[_0xa803('0xc')]);router[_0xa803('0x8')](_0xa803('0xd'),auth['isAuthenticated'](),controller[_0xa803('0xe')]);router[_0xa803('0xf')]('/',auth[_0xa803('0xa')](),controller[_0xa803('0x10')]);router['post'](_0xa803('0xb'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xa803('0x11')](_0xa803('0x12'),auth[_0xa803('0xa')](),controller[_0xa803('0x13')]);router[_0xa803('0x14')](_0xa803('0x12'),auth[_0xa803('0xa')](),controller[_0xa803('0x15')]);module[_0xa803('0x16')]=router; \ No newline at end of file +var _0x20d0=['getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations'];(function(_0x3600f5,_0x4911e6){var _0x351e54=function(_0x2f92a7){while(--_0x2f92a7){_0x3600f5['push'](_0x3600f5['shift']());}};_0x351e54(++_0x4911e6);}(_0x20d0,0x10e));var _0x020d=function(_0x2abc3d,_0x48edca){_0x2abc3d=_0x2abc3d-0x0;var _0x252745=_0x20d0[_0x2abc3d];return _0x252745;};'use strict';var multer=require(_0x020d('0x0'));var util=require(_0x020d('0x1'));var path=require(_0x020d('0x2'));var timeout=require(_0x020d('0x3'));var express=require(_0x020d('0x4'));var router=express[_0x020d('0x5')]();var fs_extra=require(_0x020d('0x6'));var auth=require(_0x020d('0x7'));var interaction=require(_0x020d('0x8'));var config=require(_0x020d('0x9'));var controller=require(_0x020d('0xa'));router[_0x020d('0xb')]('/',auth[_0x020d('0xc')](),controller[_0x020d('0xd')]);router[_0x020d('0xb')]('/:id',auth[_0x020d('0xc')](),controller[_0x020d('0xe')]);router[_0x020d('0xb')](_0x020d('0xf'),auth[_0x020d('0xc')](),controller[_0x020d('0x10')]);router['get'](_0x020d('0x11'),auth['isAuthenticated'](),controller[_0x020d('0x12')]);router[_0x020d('0x13')]('/',auth[_0x020d('0xc')](),controller[_0x020d('0x14')]);router['post'](_0x020d('0xf'),auth[_0x020d('0xc')](),controller[_0x020d('0x15')]);router[_0x020d('0x16')]('/:id',auth[_0x020d('0xc')](),controller[_0x020d('0x17')]);router[_0x020d('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x020d('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index c46dc45..8768325 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 _0x2a07=['sequelize','exports','STRING','remoteUri'];(function(_0x3be82c,_0x3307d7){var _0x40d25a=function(_0x582dda){while(--_0x582dda){_0x3be82c['push'](_0x3be82c['shift']());}};_0x40d25a(++_0x3307d7);}(_0x2a07,0x74));var _0x72a0=function(_0xa14d8c,_0x14759b){_0xa14d8c=_0xa14d8c-0x0;var _0x3facda=_0x2a07[_0xa14d8c];return _0x3facda;};'use strict';var Sequelize=require(_0x72a0('0x0'));module[_0x72a0('0x1')]={'name':{'type':Sequelize[_0x72a0('0x2')]},'description':{'type':Sequelize[_0x72a0('0x2')]},'username':{'type':Sequelize[_0x72a0('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x72a0('0x2')]},'remoteUri':{'type':Sequelize[_0x72a0('0x2')],'unique':_0x72a0('0x3')},'serverUrl':{'type':Sequelize[_0x72a0('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xf4f4=['exports','STRING','username','sequelize'];(function(_0x3fba41,_0x39825c){var _0x12e6a2=function(_0x5dda68){while(--_0x5dda68){_0x3fba41['push'](_0x3fba41['shift']());}};_0x12e6a2(++_0x39825c);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x11045d,_0x14910b){_0x11045d=_0x11045d-0x0;var _0x38a685=_0xf4f4[_0x11045d];return _0x38a685;};'use strict';var Sequelize=require(_0x4f4f('0x0'));module[_0x4f4f('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4f4f('0x2')]},'username':{'type':Sequelize[_0x4f4f('0x2')],'unique':_0x4f4f('0x3')},'apiKey':{'type':Sequelize[_0x4f4f('0x2')]},'remoteUri':{'type':Sequelize[_0x4f4f('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x4f4f('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 95846db..54d2c10 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 _0x63c6=['query','intersection','model','attributes','fields','nolimit','sort','filters','pick','filter','where','merge','options','includeAll','include','rows','catch','show','params','keys','length','find','create','body','getConfigurations','findOne','FreshdeskConfiguration','order','hasOwnProperty','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','apiKey','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','agent','description','priority','group','source','ticket_type','company','remove','includes','default','custom_dropdown','name','label','choices','test','error','getFields,\x20%s,\x20%s,\x20%s','stringify','send','statusCode','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','stack','index','FreshdeskAccount','rawAttributes','fieldName','type','key','map'];(function(_0x2ce9c3,_0x20a165){var _0x109b3a=function(_0xfd90e2){while(--_0xfd90e2){_0x2ce9c3['push'](_0x2ce9c3['shift']());}};_0x109b3a(++_0x20a165);}(_0x63c6,0xbb));var _0x663c=function(_0x23a4e1,_0x116d26){_0x23a4e1=_0x23a4e1-0x0;var _0x526847=_0x63c6[_0x23a4e1];return _0x526847;};'use strict';var emlformat=require(_0x663c('0x0'));var rimraf=require(_0x663c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x663c('0x2'));var moment=require(_0x663c('0x3'));var BPromise=require(_0x663c('0x4'));var Mustache=require(_0x663c('0x5'));var util=require(_0x663c('0x6'));var path=require(_0x663c('0x7'));var sox=require(_0x663c('0x8'));var csv=require(_0x663c('0x9'));var ejs=require(_0x663c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x663c('0xb'));var squel=require(_0x663c('0xc'));var crypto=require(_0x663c('0xd'));var jsforce=require(_0x663c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x663c('0x9'));var querystring=require('querystring');var Papa=require(_0x663c('0xf'));var Redis=require('ioredis');var authService=require(_0x663c('0x10'));var qs=require(_0x663c('0x11'));var as=require(_0x663c('0x12'));var hardwareService=require(_0x663c('0x13'));var logger=require(_0x663c('0x14'))(_0x663c('0x15'));var utils=require(_0x663c('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x663c('0x17'))['db'];var integrations=require(_0x663c('0x18'));function respondWithStatusCode(_0x588da1,_0x20038d){_0x20038d=_0x20038d||0xcc;return function(_0x1ae7de){if(_0x1ae7de){return _0x588da1[_0x663c('0x19')](_0x20038d);}return _0x588da1[_0x663c('0x1a')](_0x20038d)['end']();};}function respondWithResult(_0xa119a1,_0x165454){_0x165454=_0x165454||0xc8;return function(_0x5688eb){if(_0x5688eb){return _0xa119a1[_0x663c('0x1a')](_0x165454)['json'](_0x5688eb);}};}function respondWithFilteredResult(_0x44ffaa,_0xb1e1bf){return function(_0x2a7b0d){if(_0x2a7b0d){var _0x14cb89=typeof _0xb1e1bf[_0x663c('0x1b')]===_0x663c('0x1c')&&typeof _0xb1e1bf[_0x663c('0x1d')]===_0x663c('0x1c');var _0x31895b=_0x2a7b0d[_0x663c('0x1e')];var _0x517f70=_0x14cb89?0x0:_0xb1e1bf[_0x663c('0x1b')];var _0x33f149=_0x14cb89?_0x2a7b0d[_0x663c('0x1e')]:_0xb1e1bf['offset']+_0xb1e1bf[_0x663c('0x1d')];var _0x469019;if(_0x33f149>=_0x31895b){_0x33f149=_0x31895b;_0x469019=0xc8;}else{_0x469019=0xce;}_0x44ffaa[_0x663c('0x1a')](_0x469019);return _0x44ffaa[_0x663c('0x1f')](_0x663c('0x20'),_0x517f70+'-'+_0x33f149+'/'+_0x31895b)['json'](_0x2a7b0d);}return null;};}function patchUpdates(_0xcf6ced){return function(_0x7c353a){try{jsonpatch[_0x663c('0x21')](_0x7c353a,_0xcf6ced,!![]);}catch(_0x42703e){return BPromise['reject'](_0x42703e);}return _0x7c353a['save']();};}function saveUpdates(_0x2ac148,_0x34135d){return function(_0x2f2bf0){if(_0x2f2bf0){return _0x2f2bf0[_0x663c('0x22')](_0x2ac148)[_0x663c('0x23')](function(_0x53986f){return _0x53986f;});}return null;};}function removeEntity(_0x4984dc,_0x4b7213){return function(_0x2587a5){if(_0x2587a5){return _0x2587a5[_0x663c('0x24')]()[_0x663c('0x23')](function(){_0x4984dc[_0x663c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd82689,_0x417181){return function(_0x1c433d){if(!_0x1c433d){_0xd82689[_0x663c('0x19')](0x194);}return _0x1c433d;};}function handleError(_0x3581a3,_0x5a56cd){_0x5a56cd=_0x5a56cd||0x1f4;return function(_0x34fc73){logger['error'](_0x34fc73[_0x663c('0x25')]);if(_0x34fc73['name']){delete _0x34fc73['name'];}_0x3581a3[_0x663c('0x1a')](_0x5a56cd)['send'](_0x34fc73);};}exports[_0x663c('0x26')]=function(_0x274a2a,_0x30ff6f){var _0x46d722={},_0x1ab262={},_0x109d6b={'count':0x0,'rows':[]};var _0x12d6ce=_['map'](db[_0x663c('0x27')][_0x663c('0x28')],function(_0x43ad67){return{'name':_0x43ad67[_0x663c('0x29')],'type':_0x43ad67[_0x663c('0x2a')][_0x663c('0x2b')]};});_0x1ab262['model']=_[_0x663c('0x2c')](_0x12d6ce,'name');_0x1ab262[_0x663c('0x2d')]=_['keys'](_0x274a2a['query']);_0x1ab262['filters']=_[_0x663c('0x2e')](_0x1ab262[_0x663c('0x2f')],_0x1ab262['query']);_0x46d722[_0x663c('0x30')]=_[_0x663c('0x2e')](_0x1ab262['model'],qs[_0x663c('0x31')](_0x274a2a[_0x663c('0x2d')][_0x663c('0x31')]));_0x46d722[_0x663c('0x30')]=_0x46d722[_0x663c('0x30')]['length']?_0x46d722[_0x663c('0x30')]:_0x1ab262[_0x663c('0x2f')];if(!_0x274a2a[_0x663c('0x2d')]['hasOwnProperty'](_0x663c('0x32'))){_0x46d722[_0x663c('0x1d')]=qs[_0x663c('0x1d')](_0x274a2a[_0x663c('0x2d')]['limit']);_0x46d722[_0x663c('0x1b')]=qs[_0x663c('0x1b')](_0x274a2a[_0x663c('0x2d')][_0x663c('0x1b')]);}_0x46d722['order']=qs['sort'](_0x274a2a[_0x663c('0x2d')][_0x663c('0x33')]);_0x46d722['where']=qs[_0x663c('0x34')](_[_0x663c('0x35')](_0x274a2a[_0x663c('0x2d')],_0x1ab262[_0x663c('0x34')]),_0x12d6ce);if(_0x274a2a['query'][_0x663c('0x36')]){_0x46d722[_0x663c('0x37')]=_['merge'](_0x46d722['where'],{'$or':_[_0x663c('0x2c')](_0x12d6ce,function(_0x3342f){if(_0x3342f[_0x663c('0x2a')]!=='VIRTUAL'){var _0x51b931={};_0x51b931[_0x3342f['name']]={'$like':'%'+_0x274a2a[_0x663c('0x2d')]['filter']+'%'};return _0x51b931;}})});}_0x46d722=_[_0x663c('0x38')]({},_0x46d722,_0x274a2a[_0x663c('0x39')]);var _0xcc88ba={'where':_0x46d722['where']};return db[_0x663c('0x27')][_0x663c('0x1e')](_0xcc88ba)[_0x663c('0x23')](function(_0x31117b){_0x109d6b['count']=_0x31117b;if(_0x274a2a[_0x663c('0x2d')][_0x663c('0x3a')]){_0x46d722[_0x663c('0x3b')]=[{'all':!![]}];}return db[_0x663c('0x27')]['findAll'](_0x46d722);})[_0x663c('0x23')](function(_0x43974f){_0x109d6b[_0x663c('0x3c')]=_0x43974f;return _0x109d6b;})['then'](respondWithFilteredResult(_0x30ff6f,_0x46d722))[_0x663c('0x3d')](handleError(_0x30ff6f,null));};exports[_0x663c('0x3e')]=function(_0x92bab2,_0x52c0ba){var _0x14f55f={'raw':![],'where':{'id':_0x92bab2[_0x663c('0x3f')]['id']}},_0x48e371={};_0x48e371['model']=_[_0x663c('0x40')](db[_0x663c('0x27')][_0x663c('0x28')]);_0x48e371['query']=_[_0x663c('0x40')](_0x92bab2[_0x663c('0x2d')]);_0x48e371[_0x663c('0x34')]=_['intersection'](_0x48e371[_0x663c('0x2f')],_0x48e371['query']);_0x14f55f[_0x663c('0x30')]=_[_0x663c('0x2e')](_0x48e371[_0x663c('0x2f')],qs['fields'](_0x92bab2[_0x663c('0x2d')][_0x663c('0x31')]));_0x14f55f[_0x663c('0x30')]=_0x14f55f[_0x663c('0x30')][_0x663c('0x41')]?_0x14f55f[_0x663c('0x30')]:_0x48e371[_0x663c('0x2f')];if(_0x92bab2[_0x663c('0x2d')][_0x663c('0x3a')]){_0x14f55f['include']=[{'all':!![]}];}_0x14f55f=_[_0x663c('0x38')]({},_0x14f55f,_0x92bab2[_0x663c('0x39')]);return db[_0x663c('0x27')][_0x663c('0x42')](_0x14f55f)[_0x663c('0x23')](handleEntityNotFound(_0x52c0ba,null))[_0x663c('0x23')](respondWithResult(_0x52c0ba,null))[_0x663c('0x3d')](handleError(_0x52c0ba,null));};exports['create']=function(_0x1d2960,_0x39e53){return db[_0x663c('0x27')][_0x663c('0x43')](_0x1d2960[_0x663c('0x44')],{})[_0x663c('0x23')](respondWithResult(_0x39e53,0xc9))['catch'](handleError(_0x39e53,null));};exports[_0x663c('0x22')]=function(_0x685df3,_0x3ae509){if(_0x685df3['body']['id']){delete _0x685df3[_0x663c('0x44')]['id'];}return db['FreshdeskAccount'][_0x663c('0x42')]({'where':{'id':_0x685df3[_0x663c('0x3f')]['id']}})[_0x663c('0x23')](handleEntityNotFound(_0x3ae509,null))[_0x663c('0x23')](saveUpdates(_0x685df3['body'],null))['then'](respondWithResult(_0x3ae509,null))[_0x663c('0x3d')](handleError(_0x3ae509,null));};exports[_0x663c('0x24')]=function(_0x3cca38,_0x3d8c62){return db[_0x663c('0x27')][_0x663c('0x42')]({'where':{'id':_0x3cca38[_0x663c('0x3f')]['id']}})[_0x663c('0x23')](handleEntityNotFound(_0x3d8c62,null))[_0x663c('0x23')](removeEntity(_0x3d8c62,null))[_0x663c('0x3d')](handleError(_0x3d8c62,null));};exports[_0x663c('0x45')]=function(_0x43b88b,_0x52954f,_0x508fc7){var _0x15034f={};var _0x1f9495={};var _0x527b08;var _0x44794d;return db[_0x663c('0x27')][_0x663c('0x46')]({'where':{'id':_0x43b88b['params']['id']}})['then'](handleEntityNotFound(_0x52954f,null))['then'](function(_0x4d26e5){if(_0x4d26e5){_0x527b08=_0x4d26e5;_0x1f9495[_0x663c('0x2f')]=_['keys'](db[_0x663c('0x47')][_0x663c('0x28')]);_0x1f9495['query']=_[_0x663c('0x40')](_0x43b88b[_0x663c('0x2d')]);_0x1f9495['filters']=_['intersection'](_0x1f9495[_0x663c('0x2f')],_0x1f9495['query']);_0x15034f[_0x663c('0x30')]=_[_0x663c('0x2e')](_0x1f9495['model'],qs[_0x663c('0x31')](_0x43b88b[_0x663c('0x2d')][_0x663c('0x31')]));_0x15034f[_0x663c('0x30')]=_0x15034f[_0x663c('0x30')][_0x663c('0x41')]?_0x15034f[_0x663c('0x30')]:_0x1f9495[_0x663c('0x2f')];_0x15034f[_0x663c('0x48')]=qs[_0x663c('0x33')](_0x43b88b[_0x663c('0x2d')][_0x663c('0x33')]);_0x15034f[_0x663c('0x37')]=qs[_0x663c('0x34')](_['pick'](_0x43b88b['query'],_0x1f9495[_0x663c('0x34')]));if(_0x43b88b[_0x663c('0x2d')]['filter']){_0x15034f[_0x663c('0x37')]=_[_0x663c('0x38')](_0x15034f[_0x663c('0x37')],{'$or':_[_0x663c('0x2c')](_0x15034f['attributes'],function(_0x24973f){var _0x574642={};_0x574642[_0x24973f]={'$like':'%'+_0x43b88b['query'][_0x663c('0x36')]+'%'};return _0x574642;})});}_0x15034f=_[_0x663c('0x38')]({},_0x15034f,_0x43b88b[_0x663c('0x39')]);return _0x527b08['getConfigurations'](_0x15034f);}})[_0x663c('0x23')](function(_0x4050c5){if(_0x4050c5){_0x44794d=_0x4050c5[_0x663c('0x41')];if(!_0x43b88b[_0x663c('0x2d')][_0x663c('0x49')](_0x663c('0x32'))){_0x15034f[_0x663c('0x1d')]=qs[_0x663c('0x1d')](_0x43b88b[_0x663c('0x2d')][_0x663c('0x1d')]);_0x15034f[_0x663c('0x1b')]=qs['offset'](_0x43b88b[_0x663c('0x2d')][_0x663c('0x1b')]);}return _0x527b08[_0x663c('0x45')](_0x15034f);}})[_0x663c('0x23')](function(_0x1b8208){if(_0x1b8208){return _0x1b8208?{'count':_0x44794d,'rows':_0x1b8208}:null;}})['then'](respondWithResult(_0x52954f,null))[_0x663c('0x3d')](handleError(_0x52954f,null));};exports['addConfiguration']=function(_0x5380e3,_0x455ea3,_0x4b5b31){if(_0x5380e3['body']['id']){delete _0x5380e3[_0x663c('0x44')]['id'];}return db[_0x663c('0x27')]['findOne']({'where':{'id':_0x5380e3[_0x663c('0x3f')]['id']}})[_0x663c('0x23')](handleEntityNotFound(_0x455ea3,null))['then'](function(_0x5034d7){if(_0x5034d7){_0x5380e3[_0x663c('0x44')][_0x663c('0x4a')]=_0x5034d7['id'];_0x5380e3[_0x663c('0x44')][_0x663c('0x4b')]=integrations[_0x663c('0x4c')](_0x5380e3[_0x663c('0x44')][_0x663c('0x4d')],_0x5380e3['body'][_0x663c('0x2a')]);_0x5380e3['body'][_0x663c('0x4e')]=integrations[_0x663c('0x4f')](_0x5380e3[_0x663c('0x44')]['channel'],_0x5380e3[_0x663c('0x44')][_0x663c('0x2a')]);return db[_0x663c('0x47')][_0x663c('0x43')](_0x5380e3[_0x663c('0x44')],{'include':[{'model':db[_0x663c('0x50')],'as':_0x663c('0x4b')},{'model':db[_0x663c('0x50')],'as':_0x663c('0x4e')}]});}return null;})[_0x663c('0x23')](respondWithResult(_0x455ea3,null))[_0x663c('0x3d')](handleError(_0x455ea3,null));};exports[_0x663c('0x51')]=function(_0x38efea,_0x1747c4,_0xe58aa2){var _0x59513d='';return db[_0x663c('0x27')][_0x663c('0x46')]({'where':{'id':_0x38efea[_0x663c('0x3f')]['id']},'attributes':['id','remoteUri',_0x663c('0x52')]})['then'](handleEntityNotFound(_0x1747c4,null))[_0x663c('0x23')](function(_0x596a59){if(_0x596a59){_0x59513d=_0x596a59[_0x663c('0x53')];var _0x5cf440=_0x59513d[_0x663c('0x54')](-0x1);if(_0x5cf440==='/'){_0x59513d=_0x59513d[_0x663c('0x55')](0x0,_0x59513d[_0x663c('0x56')](_0x5cf440));}return rp({'method':_0x663c('0x57'),'uri':util[_0x663c('0x58')](_0x663c('0x59'),_0x59513d,_0x663c('0x5a')),'headers':{'Authorization':util[_0x663c('0x58')](_0x663c('0x5b'),new Buffer(util['format'](_0x663c('0x5c'),_0x596a59['apiKey']))[_0x663c('0x5d')](_0x663c('0x5e')))},'json':!![]});}})[_0x663c('0x23')](function(_0x4a643c){if(_0x4a643c){var _0x1af33e=[_0x663c('0x5f'),'subject',_0x663c('0x60'),_0x663c('0x61'),'status',_0x663c('0x62'),_0x663c('0x63'),_0x663c('0x64'),_0x663c('0x65'),_0x663c('0x63'),_0x663c('0x66')];_[_0x663c('0x67')](_0x4a643c,function(_0x321527){return _0x1af33e[_0x663c('0x68')](_0x321527['name'])||!_0x321527[_0x663c('0x69')]&&_0x321527[_0x663c('0x2a')]!=='custom_text'&&_0x321527[_0x663c('0x2a')]!==_0x663c('0x6a');});return{'count':_0x4a643c[_0x663c('0x41')],'rows':_[_0x663c('0x2c')](_0x4a643c,function(_0x4f46fb){return{'id':_0x4f46fb[_0x663c('0x6b')],'name':_0x4f46fb[_0x663c('0x6c')],'custom':!_0x4f46fb[_0x663c('0x69')],'options':_0x4f46fb[_0x663c('0x6d')]?_['map'](_0x4f46fb[_0x663c('0x6d')],function(_0x3e8921){return{'name':_['capitalize'](_0x3e8921),'value':_0x3e8921};}):[]};})};}})['then'](respondWithResult(_0x1747c4,null))[_0x663c('0x3d')](function(_0x5475f3){var _0x32191e=_0x38efea[_0x663c('0x2d')][_0x663c('0x6e')]?0x1f4:_0x5475f3['statusCode']||0x1f4;logger[_0x663c('0x6f')](_0x663c('0x70'),'getFields',_0x32191e,JSON[_0x663c('0x71')](_0x5475f3));delete _0x5475f3['name'];if(_0x32191e===0x191){_0x32191e=0x190;}_0x1747c4[_0x663c('0x1a')](_0x32191e)[_0x663c('0x72')](_0x38efea[_0x663c('0x2d')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x5475f3[_0x663c('0x73')]}:_0x5475f3);});}; \ No newline at end of file +var _0xce25=['key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','update','findOne','FreshdeskConfiguration','order','getConfigurations','addConfiguration','AccountId','getSubjects','channel','Descriptions','FreshdeskField','getFields','remoteUri','slice','substring','lastIndexOf','GET','api/v2/ticket_fields','format','%s:X','apiKey','toString','base64','requester','agent','description','group','source','includes','default','custom_text','custom_dropdown','label','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','zip-dir','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xce25,0x196));var _0x5ce2=function(_0x4d36a4,_0x303dd0){_0x4d36a4=_0x4d36a4-0x0;var _0x8d4548=_0xce25[_0x4d36a4];return _0x8d4548;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5ce2('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5ce2('0x1'));var Mustache=require(_0x5ce2('0x2'));var util=require('util');var path=require(_0x5ce2('0x3'));var sox=require(_0x5ce2('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5ce2('0x5'));var _=require(_0x5ce2('0x6'));var squel=require(_0x5ce2('0x7'));var crypto=require(_0x5ce2('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x5ce2('0x9'));var toCsv=require(_0x5ce2('0xa'));var querystring=require(_0x5ce2('0xb'));var Papa=require('papaparse');var Redis=require(_0x5ce2('0xc'));var authService=require(_0x5ce2('0xd'));var qs=require(_0x5ce2('0xe'));var as=require(_0x5ce2('0xf'));var hardwareService=require(_0x5ce2('0x10'));var logger=require(_0x5ce2('0x11'))('api');var utils=require(_0x5ce2('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x5ce2('0x13'));var db=require(_0x5ce2('0x14'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x496c1e,_0x595d33){_0x595d33=_0x595d33||0xcc;return function(_0x550fb3){if(_0x550fb3){return _0x496c1e[_0x5ce2('0x15')](_0x595d33);}return _0x496c1e['status'](_0x595d33)['end']();};}function respondWithResult(_0x3a69ec,_0x56bd1b){_0x56bd1b=_0x56bd1b||0xc8;return function(_0x9316be){if(_0x9316be){return _0x3a69ec[_0x5ce2('0x16')](_0x56bd1b)[_0x5ce2('0x17')](_0x9316be);}};}function respondWithFilteredResult(_0x53e047,_0x36a2a5){return function(_0x2727c7){if(_0x2727c7){var _0x11f60a=typeof _0x36a2a5['offset']==='undefined'&&typeof _0x36a2a5[_0x5ce2('0x18')]===_0x5ce2('0x19');var _0x2890f0=_0x2727c7['count'];var _0x19915d=_0x11f60a?0x0:_0x36a2a5[_0x5ce2('0x1a')];var _0x3dd57a=_0x11f60a?_0x2727c7[_0x5ce2('0x1b')]:_0x36a2a5[_0x5ce2('0x1a')]+_0x36a2a5[_0x5ce2('0x18')];var _0x3b3eea;if(_0x3dd57a>=_0x2890f0){_0x3dd57a=_0x2890f0;_0x3b3eea=0xc8;}else{_0x3b3eea=0xce;}_0x53e047[_0x5ce2('0x16')](_0x3b3eea);return _0x53e047[_0x5ce2('0x1c')](_0x5ce2('0x1d'),_0x19915d+'-'+_0x3dd57a+'/'+_0x2890f0)[_0x5ce2('0x17')](_0x2727c7);}return null;};}function patchUpdates(_0x2d32c9){return function(_0xc9644){try{jsonpatch[_0x5ce2('0x1e')](_0xc9644,_0x2d32c9,!![]);}catch(_0x1c2841){return BPromise[_0x5ce2('0x1f')](_0x1c2841);}return _0xc9644[_0x5ce2('0x20')]();};}function saveUpdates(_0x28899f,_0x350fd9){return function(_0x587abb){if(_0x587abb){return _0x587abb['update'](_0x28899f)[_0x5ce2('0x21')](function(_0x2e9675){return _0x2e9675;});}return null;};}function removeEntity(_0x3440b5,_0x4f27aa){return function(_0x49054a){if(_0x49054a){return _0x49054a[_0x5ce2('0x22')]()[_0x5ce2('0x21')](function(){_0x3440b5['status'](0xcc)[_0x5ce2('0x23')]();});}};}function handleEntityNotFound(_0x3ab8c8,_0x25accf){return function(_0x2198aa){if(!_0x2198aa){_0x3ab8c8[_0x5ce2('0x15')](0x194);}return _0x2198aa;};}function handleError(_0x208448,_0x3a4bb9){_0x3a4bb9=_0x3a4bb9||0x1f4;return function(_0x19e637){logger[_0x5ce2('0x24')](_0x19e637[_0x5ce2('0x25')]);if(_0x19e637[_0x5ce2('0x26')]){delete _0x19e637[_0x5ce2('0x26')];}_0x208448[_0x5ce2('0x16')](_0x3a4bb9)[_0x5ce2('0x27')](_0x19e637);};}exports[_0x5ce2('0x28')]=function(_0x3ee0cd,_0x33d83c){var _0x2898ae={},_0x444d56={},_0x127a83={'count':0x0,'rows':[]};var _0x17e9ba=_[_0x5ce2('0x29')](db[_0x5ce2('0x2a')][_0x5ce2('0x2b')],function(_0x26332f){return{'name':_0x26332f[_0x5ce2('0x2c')],'type':_0x26332f[_0x5ce2('0x2d')][_0x5ce2('0x2e')]};});_0x444d56[_0x5ce2('0x2f')]=_[_0x5ce2('0x29')](_0x17e9ba,_0x5ce2('0x26'));_0x444d56[_0x5ce2('0x30')]=_['keys'](_0x3ee0cd[_0x5ce2('0x30')]);_0x444d56[_0x5ce2('0x31')]=_[_0x5ce2('0x32')](_0x444d56['model'],_0x444d56['query']);_0x2898ae[_0x5ce2('0x33')]=_[_0x5ce2('0x32')](_0x444d56[_0x5ce2('0x2f')],qs['fields'](_0x3ee0cd['query'][_0x5ce2('0x34')]));_0x2898ae[_0x5ce2('0x33')]=_0x2898ae['attributes'][_0x5ce2('0x35')]?_0x2898ae[_0x5ce2('0x33')]:_0x444d56[_0x5ce2('0x2f')];if(!_0x3ee0cd[_0x5ce2('0x30')][_0x5ce2('0x36')](_0x5ce2('0x37'))){_0x2898ae[_0x5ce2('0x18')]=qs[_0x5ce2('0x18')](_0x3ee0cd[_0x5ce2('0x30')][_0x5ce2('0x18')]);_0x2898ae[_0x5ce2('0x1a')]=qs['offset'](_0x3ee0cd['query']['offset']);}_0x2898ae['order']=qs[_0x5ce2('0x38')](_0x3ee0cd[_0x5ce2('0x30')][_0x5ce2('0x38')]);_0x2898ae[_0x5ce2('0x39')]=qs[_0x5ce2('0x31')](_[_0x5ce2('0x3a')](_0x3ee0cd[_0x5ce2('0x30')],_0x444d56[_0x5ce2('0x31')]),_0x17e9ba);if(_0x3ee0cd[_0x5ce2('0x30')][_0x5ce2('0x3b')]){_0x2898ae[_0x5ce2('0x39')]=_[_0x5ce2('0x3c')](_0x2898ae['where'],{'$or':_[_0x5ce2('0x29')](_0x17e9ba,function(_0x389fdc){if(_0x389fdc['type']!==_0x5ce2('0x3d')){var _0x3f2a07={};_0x3f2a07[_0x389fdc[_0x5ce2('0x26')]]={'$like':'%'+_0x3ee0cd[_0x5ce2('0x30')]['filter']+'%'};return _0x3f2a07;}})});}_0x2898ae=_[_0x5ce2('0x3c')]({},_0x2898ae,_0x3ee0cd[_0x5ce2('0x3e')]);var _0x338edc={'where':_0x2898ae[_0x5ce2('0x39')]};return db[_0x5ce2('0x2a')][_0x5ce2('0x1b')](_0x338edc)['then'](function(_0x2b82ae){_0x127a83[_0x5ce2('0x1b')]=_0x2b82ae;if(_0x3ee0cd['query'][_0x5ce2('0x3f')]){_0x2898ae[_0x5ce2('0x40')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0x5ce2('0x41')](_0x2898ae);})[_0x5ce2('0x21')](function(_0x206656){_0x127a83[_0x5ce2('0x42')]=_0x206656;return _0x127a83;})[_0x5ce2('0x21')](respondWithFilteredResult(_0x33d83c,_0x2898ae))[_0x5ce2('0x43')](handleError(_0x33d83c,null));};exports[_0x5ce2('0x44')]=function(_0x370e3e,_0x3fde76){var _0x49a759={'raw':![],'where':{'id':_0x370e3e[_0x5ce2('0x45')]['id']}},_0xf652b4={};_0xf652b4['model']=_[_0x5ce2('0x46')](db['FreshdeskAccount'][_0x5ce2('0x2b')]);_0xf652b4[_0x5ce2('0x30')]=_[_0x5ce2('0x46')](_0x370e3e[_0x5ce2('0x30')]);_0xf652b4[_0x5ce2('0x31')]=_[_0x5ce2('0x32')](_0xf652b4[_0x5ce2('0x2f')],_0xf652b4['query']);_0x49a759[_0x5ce2('0x33')]=_[_0x5ce2('0x32')](_0xf652b4[_0x5ce2('0x2f')],qs[_0x5ce2('0x34')](_0x370e3e['query'][_0x5ce2('0x34')]));_0x49a759[_0x5ce2('0x33')]=_0x49a759[_0x5ce2('0x33')][_0x5ce2('0x35')]?_0x49a759['attributes']:_0xf652b4[_0x5ce2('0x2f')];if(_0x370e3e[_0x5ce2('0x30')][_0x5ce2('0x3f')]){_0x49a759[_0x5ce2('0x40')]=[{'all':!![]}];}_0x49a759=_['merge']({},_0x49a759,_0x370e3e[_0x5ce2('0x3e')]);return db[_0x5ce2('0x2a')][_0x5ce2('0x47')](_0x49a759)[_0x5ce2('0x21')](handleEntityNotFound(_0x3fde76,null))[_0x5ce2('0x21')](respondWithResult(_0x3fde76,null))['catch'](handleError(_0x3fde76,null));};exports[_0x5ce2('0x48')]=function(_0x2fe4d4,_0xdae367){return db[_0x5ce2('0x2a')][_0x5ce2('0x48')](_0x2fe4d4[_0x5ce2('0x49')],{})[_0x5ce2('0x21')](respondWithResult(_0xdae367,0xc9))[_0x5ce2('0x43')](handleError(_0xdae367,null));};exports[_0x5ce2('0x4a')]=function(_0x215d5,_0x47c22b){if(_0x215d5[_0x5ce2('0x49')]['id']){delete _0x215d5[_0x5ce2('0x49')]['id'];}return db[_0x5ce2('0x2a')]['find']({'where':{'id':_0x215d5[_0x5ce2('0x45')]['id']}})['then'](handleEntityNotFound(_0x47c22b,null))[_0x5ce2('0x21')](saveUpdates(_0x215d5['body'],null))[_0x5ce2('0x21')](respondWithResult(_0x47c22b,null))['catch'](handleError(_0x47c22b,null));};exports['destroy']=function(_0x4ae957,_0x3d9fd4){return db[_0x5ce2('0x2a')][_0x5ce2('0x47')]({'where':{'id':_0x4ae957[_0x5ce2('0x45')]['id']}})[_0x5ce2('0x21')](handleEntityNotFound(_0x3d9fd4,null))[_0x5ce2('0x21')](removeEntity(_0x3d9fd4,null))[_0x5ce2('0x43')](handleError(_0x3d9fd4,null));};exports['getConfigurations']=function(_0x51944a,_0x582c4b,_0x4f9b2f){var _0x361867={};var _0x49f7e6={};var _0x1d9eed;var _0x296ea8;return db[_0x5ce2('0x2a')][_0x5ce2('0x4b')]({'where':{'id':_0x51944a['params']['id']}})[_0x5ce2('0x21')](handleEntityNotFound(_0x582c4b,null))[_0x5ce2('0x21')](function(_0x187b74){if(_0x187b74){_0x1d9eed=_0x187b74;_0x49f7e6[_0x5ce2('0x2f')]=_[_0x5ce2('0x46')](db[_0x5ce2('0x4c')][_0x5ce2('0x2b')]);_0x49f7e6['query']=_[_0x5ce2('0x46')](_0x51944a[_0x5ce2('0x30')]);_0x49f7e6[_0x5ce2('0x31')]=_[_0x5ce2('0x32')](_0x49f7e6['model'],_0x49f7e6[_0x5ce2('0x30')]);_0x361867[_0x5ce2('0x33')]=_['intersection'](_0x49f7e6[_0x5ce2('0x2f')],qs[_0x5ce2('0x34')](_0x51944a[_0x5ce2('0x30')][_0x5ce2('0x34')]));_0x361867[_0x5ce2('0x33')]=_0x361867[_0x5ce2('0x33')][_0x5ce2('0x35')]?_0x361867[_0x5ce2('0x33')]:_0x49f7e6[_0x5ce2('0x2f')];_0x361867[_0x5ce2('0x4d')]=qs['sort'](_0x51944a[_0x5ce2('0x30')]['sort']);_0x361867[_0x5ce2('0x39')]=qs[_0x5ce2('0x31')](_[_0x5ce2('0x3a')](_0x51944a['query'],_0x49f7e6[_0x5ce2('0x31')]));if(_0x51944a['query']['filter']){_0x361867[_0x5ce2('0x39')]=_[_0x5ce2('0x3c')](_0x361867[_0x5ce2('0x39')],{'$or':_['map'](_0x361867[_0x5ce2('0x33')],function(_0x14c084){var _0xcae51f={};_0xcae51f[_0x14c084]={'$like':'%'+_0x51944a[_0x5ce2('0x30')][_0x5ce2('0x3b')]+'%'};return _0xcae51f;})});}_0x361867=_['merge']({},_0x361867,_0x51944a[_0x5ce2('0x3e')]);return _0x1d9eed[_0x5ce2('0x4e')](_0x361867);}})[_0x5ce2('0x21')](function(_0x2dd112){if(_0x2dd112){_0x296ea8=_0x2dd112[_0x5ce2('0x35')];if(!_0x51944a[_0x5ce2('0x30')][_0x5ce2('0x36')](_0x5ce2('0x37'))){_0x361867[_0x5ce2('0x18')]=qs['limit'](_0x51944a['query'][_0x5ce2('0x18')]);_0x361867[_0x5ce2('0x1a')]=qs['offset'](_0x51944a['query'][_0x5ce2('0x1a')]);}return _0x1d9eed[_0x5ce2('0x4e')](_0x361867);}})[_0x5ce2('0x21')](function(_0x58e990){if(_0x58e990){return _0x58e990?{'count':_0x296ea8,'rows':_0x58e990}:null;}})['then'](respondWithResult(_0x582c4b,null))[_0x5ce2('0x43')](handleError(_0x582c4b,null));};exports[_0x5ce2('0x4f')]=function(_0x3f8deb,_0x1fe0a2,_0x2268d8){if(_0x3f8deb[_0x5ce2('0x49')]['id']){delete _0x3f8deb[_0x5ce2('0x49')]['id'];}return db[_0x5ce2('0x2a')][_0x5ce2('0x4b')]({'where':{'id':_0x3f8deb['params']['id']}})['then'](handleEntityNotFound(_0x1fe0a2,null))[_0x5ce2('0x21')](function(_0x423799){if(_0x423799){_0x3f8deb[_0x5ce2('0x49')][_0x5ce2('0x50')]=_0x423799['id'];_0x3f8deb[_0x5ce2('0x49')]['Subjects']=integrations[_0x5ce2('0x51')](_0x3f8deb[_0x5ce2('0x49')][_0x5ce2('0x52')],_0x3f8deb[_0x5ce2('0x49')][_0x5ce2('0x2d')]);_0x3f8deb[_0x5ce2('0x49')][_0x5ce2('0x53')]=integrations['getDescriptions'](_0x3f8deb[_0x5ce2('0x49')][_0x5ce2('0x52')],_0x3f8deb['body'][_0x5ce2('0x2d')]);return db[_0x5ce2('0x4c')][_0x5ce2('0x48')](_0x3f8deb[_0x5ce2('0x49')],{'include':[{'model':db[_0x5ce2('0x54')],'as':'Subjects'},{'model':db[_0x5ce2('0x54')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x1fe0a2,null))[_0x5ce2('0x43')](handleError(_0x1fe0a2,null));};exports[_0x5ce2('0x55')]=function(_0x46bd13,_0x1ae5ae,_0xacc9b9){var _0x2549ea='';return db[_0x5ce2('0x2a')][_0x5ce2('0x4b')]({'where':{'id':_0x46bd13[_0x5ce2('0x45')]['id']},'attributes':['id',_0x5ce2('0x56'),'apiKey']})[_0x5ce2('0x21')](handleEntityNotFound(_0x1ae5ae,null))[_0x5ce2('0x21')](function(_0x590943){if(_0x590943){_0x2549ea=_0x590943[_0x5ce2('0x56')];var _0x543636=_0x2549ea[_0x5ce2('0x57')](-0x1);if(_0x543636==='/'){_0x2549ea=_0x2549ea[_0x5ce2('0x58')](0x0,_0x2549ea[_0x5ce2('0x59')](_0x543636));}return rp({'method':_0x5ce2('0x5a'),'uri':util['format']('%s/%s',_0x2549ea,_0x5ce2('0x5b')),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x5ce2('0x5c')](_0x5ce2('0x5d'),_0x590943[_0x5ce2('0x5e')]))[_0x5ce2('0x5f')](_0x5ce2('0x60')))},'json':!![]});}})[_0x5ce2('0x21')](function(_0x5132d7){if(_0x5132d7){var _0x1ee889=[_0x5ce2('0x61'),'subject',_0x5ce2('0x62'),_0x5ce2('0x63'),_0x5ce2('0x16'),'priority',_0x5ce2('0x64'),_0x5ce2('0x65'),'ticket_type','group','company'];_['remove'](_0x5132d7,function(_0x27aaef){return _0x1ee889[_0x5ce2('0x66')](_0x27aaef[_0x5ce2('0x26')])||!_0x27aaef[_0x5ce2('0x67')]&&_0x27aaef[_0x5ce2('0x2d')]!==_0x5ce2('0x68')&&_0x27aaef['type']!==_0x5ce2('0x69');});return{'count':_0x5132d7['length'],'rows':_[_0x5ce2('0x29')](_0x5132d7,function(_0x28e691){return{'id':_0x28e691[_0x5ce2('0x26')],'name':_0x28e691[_0x5ce2('0x6a')],'custom':!_0x28e691['default'],'options':_0x28e691[_0x5ce2('0x6b')]?_[_0x5ce2('0x29')](_0x28e691['choices'],function(_0x216e46){return{'name':_['capitalize'](_0x216e46),'value':_0x216e46};}):[]};})};}})[_0x5ce2('0x21')](respondWithResult(_0x1ae5ae,null))['catch'](function(_0x37249c){var _0x544a6a=_0x46bd13[_0x5ce2('0x30')][_0x5ce2('0x6c')]?0x1f4:_0x37249c[_0x5ce2('0x6d')]||0x1f4;logger[_0x5ce2('0x24')](_0x5ce2('0x6e'),'getFields',_0x544a6a,JSON[_0x5ce2('0x6f')](_0x37249c));delete _0x37249c[_0x5ce2('0x26')];if(_0x544a6a===0x191){_0x544a6a=0x190;}_0x1ae5ae[_0x5ce2('0x16')](_0x544a6a)[_0x5ce2('0x27')](_0x46bd13['query'][_0x5ce2('0x6c')]?{'message':_0x5ce2('0x70'),'statusCode':_0x37249c['statusCode']}:_0x37249c);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 22227fb..876833e 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 _0x3b30=['moment','bluebird','request-promise','path','../../config/environment','../../components/integrations/configuration','exports','FreshdeskAccount','int_freshdesk_accounts','lodash','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3b30,0xc9));var _0x03b3=function(_0x48fc28,_0x3dfa74){_0x48fc28=_0x48fc28-0x0;var _0x3a531b=_0x3b30[_0x48fc28];return _0x3a531b;};'use strict';var _=require(_0x03b3('0x0'));var util=require('util');var logger=require(_0x03b3('0x1'))(_0x03b3('0x2'));var moment=require(_0x03b3('0x3'));var BPromise=require(_0x03b3('0x4'));var rp=require(_0x03b3('0x5'));var fs=require('fs');var path=require(_0x03b3('0x6'));var rimraf=require('rimraf');var config=require(_0x03b3('0x7'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x03b3('0x8'));module[_0x03b3('0x9')]=function(_0x2e8e82,_0x14692d){return _0x2e8e82['define'](_0x03b3('0xa'),attributes,{'tableName':_0x03b3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x77cf=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','FreshdeskAccount','int_freshdesk_accounts','lodash','util','moment'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x77cf,0x131));var _0xf77c=function(_0x1c813e,_0x1641bf){_0x1c813e=_0x1c813e-0x0;var _0x10aec3=_0x77cf[_0x1c813e];return _0x10aec3;};'use strict';var _=require(_0xf77c('0x0'));var util=require(_0xf77c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf77c('0x2'));var BPromise=require(_0xf77c('0x3'));var rp=require(_0xf77c('0x4'));var fs=require('fs');var path=require(_0xf77c('0x5'));var rimraf=require(_0xf77c('0x6'));var config=require(_0xf77c('0x7'));var attributes=require(_0xf77c('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x255b0b,_0x22bfc3){return _0x255b0b['define'](_0xf77c('0x9'),attributes,{'tableName':_0xf77c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index f5d2533..69fbb3e 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 _0xe6ce=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','attributes','limit','include','map','model','where','ShowFreshdeskAccount'];(function(_0xdb031a,_0x22dd8e){var _0x44c2d5=function(_0x3085d0){while(--_0x3085d0){_0xdb031a['push'](_0xdb031a['shift']());}};_0x44c2d5(++_0x22dd8e);}(_0xe6ce,0xe7));var _0xee6c=function(_0x1797a8,_0x20ddaf){_0x1797a8=_0x1797a8-0x0;var _0x3d8758=_0xe6ce[_0x1797a8];return _0x3d8758;};'use strict';var _=require('lodash');var util=require(_0xee6c('0x0'));var moment=require('moment');var BPromise=require(_0xee6c('0x1'));var rs=require(_0xee6c('0x2'));var fs=require('fs');var Redis=require(_0xee6c('0x3'));var db=require(_0xee6c('0x4'))['db'];var utils=require(_0xee6c('0x5'));var logger=require('../../config/logger')(_0xee6c('0x6'));var config=require(_0xee6c('0x7'));var jayson=require(_0xee6c('0x8'));var client=jayson['client'][_0xee6c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23386a,_0x213126,_0x17db70){return new BPromise(function(_0x57edb2,_0x32e017){return client[_0xee6c('0xa')](_0x23386a,_0x17db70)[_0xee6c('0xb')](function(_0x479436){logger[_0xee6c('0xc')](_0xee6c('0xd'),_0x213126,_0xee6c('0xe'));logger[_0xee6c('0xf')](_0xee6c('0x10'),_0x213126,_0xee6c('0xe'),JSON[_0xee6c('0x11')](_0x479436));if(_0x479436[_0xee6c('0x12')]){if(_0x479436['error']['code']===0x1f4){logger['error'](_0xee6c('0xd'),_0x213126,_0x479436[_0xee6c('0x12')][_0xee6c('0x13')]);return _0x32e017(_0x479436[_0xee6c('0x12')][_0xee6c('0x13')]);}logger[_0xee6c('0x12')](_0xee6c('0xd'),_0x213126,_0x479436[_0xee6c('0x12')]['message']);return _0x57edb2(_0x479436[_0xee6c('0x12')][_0xee6c('0x13')]);}else{logger[_0xee6c('0xc')](_0xee6c('0xd'),_0x213126,_0xee6c('0xe'));_0x57edb2(_0x479436['result'][_0xee6c('0x13')]);}})[_0xee6c('0x14')](function(_0x515a32){logger[_0xee6c('0x12')](_0xee6c('0xd'),_0x213126,_0x515a32);_0x32e017(_0x515a32);});});}exports[_0xee6c('0x15')]=function(_0x23e22c){var _0x1e7813=this;return new Promise(function(_0xf38777,_0x115aba){return db[_0xee6c('0x16')][_0xee6c('0x17')]({'raw':_0x23e22c[_0xee6c('0x18')]?_0x23e22c[_0xee6c('0x18')][_0xee6c('0x19')]===undefined?!![]:![]:!![],'where':_0x23e22c[_0xee6c('0x18')]?_0x23e22c[_0xee6c('0x18')]['where']||null:null,'attributes':_0x23e22c['options']?_0x23e22c[_0xee6c('0x18')][_0xee6c('0x1a')]||null:null,'limit':_0x23e22c[_0xee6c('0x18')]?_0x23e22c[_0xee6c('0x18')][_0xee6c('0x1b')]||null:null,'include':_0x23e22c[_0xee6c('0x18')]?_0x23e22c['options'][_0xee6c('0x1c')]?_[_0xee6c('0x1d')](_0x23e22c[_0xee6c('0x18')][_0xee6c('0x1c')],function(_0x592784){return{'model':db[_0x592784[_0xee6c('0x1e')]],'as':_0x592784['as'],'attributes':_0x592784[_0xee6c('0x1a')],'include':_0x592784[_0xee6c('0x1c')]?_[_0xee6c('0x1d')](_0x592784[_0xee6c('0x1c')],function(_0x3ddc42){return{'model':db[_0x3ddc42[_0xee6c('0x1e')]],'as':_0x3ddc42['as'],'attributes':_0x3ddc42[_0xee6c('0x1a')],'include':_0x3ddc42[_0xee6c('0x1c')]?_[_0xee6c('0x1d')](_0x3ddc42[_0xee6c('0x1c')],function(_0x31149c){return{'model':db[_0x31149c[_0xee6c('0x1e')]],'as':_0x31149c['as'],'attributes':_0x31149c['attributes']};}):[]};}):[]};}):[]:[]})[_0xee6c('0xb')](function(_0xbe47de){logger[_0xee6c('0xc')](_0xee6c('0x15'),_0x23e22c);logger[_0xee6c('0xf')](_0xee6c('0x15'),_0x23e22c,JSON['stringify'](_0xbe47de));_0xf38777(_0xbe47de);})[_0xee6c('0x14')](function(_0x95a527){logger[_0xee6c('0x12')]('GetFreshdeskAccount',_0x95a527[_0xee6c('0x13')],_0x23e22c);_0x115aba(_0x1e7813['error'](0x1f4,_0x95a527['message']));});});};exports['ShowFreshdeskAccount']=function(_0x364a1f){var _0x384f98=this;return new Promise(function(_0x2d11ad,_0x388e40){return db['FreshdeskAccount']['find']({'raw':_0x364a1f[_0xee6c('0x18')]?_0x364a1f[_0xee6c('0x18')][_0xee6c('0x19')]===undefined?!![]:![]:!![],'where':_0x364a1f['options']?_0x364a1f[_0xee6c('0x18')][_0xee6c('0x1f')]||null:null,'attributes':_0x364a1f['options']?_0x364a1f[_0xee6c('0x18')][_0xee6c('0x1a')]||null:null,'include':_0x364a1f[_0xee6c('0x18')]?_0x364a1f[_0xee6c('0x18')][_0xee6c('0x1c')]?_[_0xee6c('0x1d')](_0x364a1f['options'][_0xee6c('0x1c')],function(_0xa61923){return{'model':db[_0xa61923['model']],'as':_0xa61923['as'],'attributes':_0xa61923[_0xee6c('0x1a')],'include':_0xa61923['include']?_[_0xee6c('0x1d')](_0xa61923[_0xee6c('0x1c')],function(_0x349b19){return{'model':db[_0x349b19[_0xee6c('0x1e')]],'as':_0x349b19['as'],'attributes':_0x349b19['attributes'],'include':_0x349b19[_0xee6c('0x1c')]?_[_0xee6c('0x1d')](_0x349b19[_0xee6c('0x1c')],function(_0x1992df){return{'model':db[_0x1992df[_0xee6c('0x1e')]],'as':_0x1992df['as'],'attributes':_0x1992df['attributes']};}):[]};}):[]};}):[]:[]})[_0xee6c('0xb')](function(_0x37d7f9){logger['info']('ShowFreshdeskAccount',_0x364a1f);logger[_0xee6c('0xf')]('ShowFreshdeskAccount',_0x364a1f,JSON[_0xee6c('0x11')](_0x37d7f9));_0x2d11ad(_0x37d7f9);})['catch'](function(_0x44880c){logger['error'](_0xee6c('0x20'),_0x44880c['message'],_0x364a1f);_0x388e40(_0x384f98[_0xee6c('0x12')](0x1f4,_0x44880c[_0xee6c('0x13')]));});});}; \ No newline at end of file +var _0x83f3=['raw','where','attributes','limit','include','map','model','find','ShowFreshdeskAccount','lodash','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options'];(function(_0x39c280,_0xfb1879){var _0x67324f=function(_0x382448){while(--_0x382448){_0x39c280['push'](_0x39c280['shift']());}};_0x67324f(++_0xfb1879);}(_0x83f3,0x15d));var _0x383f=function(_0x38e8a3,_0x29a164){_0x38e8a3=_0x38e8a3-0x0;var _0x1253fb=_0x83f3[_0x38e8a3];return _0x1253fb;};'use strict';var _=require(_0x383f('0x0'));var util=require(_0x383f('0x1'));var moment=require(_0x383f('0x2'));var BPromise=require(_0x383f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x383f('0x4'));var logger=require(_0x383f('0x5'))('rpc');var config=require(_0x383f('0x6'));var jayson=require(_0x383f('0x7'));var client=jayson[_0x383f('0x8')][_0x383f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3253f3,_0x460484,_0x1a6458){return new BPromise(function(_0x121839,_0x5e480d){return client['request'](_0x3253f3,_0x1a6458)[_0x383f('0xa')](function(_0x4a9b31){logger[_0x383f('0xb')](_0x383f('0xc'),_0x460484,_0x383f('0xd'));logger[_0x383f('0xe')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x460484,_0x383f('0xd'),JSON[_0x383f('0xf')](_0x4a9b31));if(_0x4a9b31[_0x383f('0x10')]){if(_0x4a9b31[_0x383f('0x10')][_0x383f('0x11')]===0x1f4){logger[_0x383f('0x10')](_0x383f('0xc'),_0x460484,_0x4a9b31['error'][_0x383f('0x12')]);return _0x5e480d(_0x4a9b31['error'][_0x383f('0x12')]);}logger['error'](_0x383f('0xc'),_0x460484,_0x4a9b31[_0x383f('0x10')]['message']);return _0x121839(_0x4a9b31[_0x383f('0x10')]['message']);}else{logger[_0x383f('0xb')]('FreshdeskAccount,\x20%s,\x20%s',_0x460484,'request\x20sent');_0x121839(_0x4a9b31[_0x383f('0x13')][_0x383f('0x12')]);}})[_0x383f('0x14')](function(_0x31c431){logger[_0x383f('0x10')](_0x383f('0xc'),_0x460484,_0x31c431);_0x5e480d(_0x31c431);});});}exports[_0x383f('0x15')]=function(_0x3a6f6c){var _0x30c15a=this;return new Promise(function(_0x14df4b,_0x5e4d16){return db[_0x383f('0x16')][_0x383f('0x17')]({'raw':_0x3a6f6c[_0x383f('0x18')]?_0x3a6f6c[_0x383f('0x18')][_0x383f('0x19')]===undefined?!![]:![]:!![],'where':_0x3a6f6c[_0x383f('0x18')]?_0x3a6f6c[_0x383f('0x18')][_0x383f('0x1a')]||null:null,'attributes':_0x3a6f6c[_0x383f('0x18')]?_0x3a6f6c[_0x383f('0x18')][_0x383f('0x1b')]||null:null,'limit':_0x3a6f6c[_0x383f('0x18')]?_0x3a6f6c['options'][_0x383f('0x1c')]||null:null,'include':_0x3a6f6c['options']?_0x3a6f6c[_0x383f('0x18')][_0x383f('0x1d')]?_[_0x383f('0x1e')](_0x3a6f6c['options']['include'],function(_0x437835){return{'model':db[_0x437835[_0x383f('0x1f')]],'as':_0x437835['as'],'attributes':_0x437835[_0x383f('0x1b')],'include':_0x437835[_0x383f('0x1d')]?_[_0x383f('0x1e')](_0x437835[_0x383f('0x1d')],function(_0x26260a){return{'model':db[_0x26260a['model']],'as':_0x26260a['as'],'attributes':_0x26260a[_0x383f('0x1b')],'include':_0x26260a[_0x383f('0x1d')]?_['map'](_0x26260a[_0x383f('0x1d')],function(_0x48e467){return{'model':db[_0x48e467[_0x383f('0x1f')]],'as':_0x48e467['as'],'attributes':_0x48e467[_0x383f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x383f('0xa')](function(_0x14d01f){logger['info']('GetFreshdeskAccount',_0x3a6f6c);logger[_0x383f('0xe')](_0x383f('0x15'),_0x3a6f6c,JSON[_0x383f('0xf')](_0x14d01f));_0x14df4b(_0x14d01f);})[_0x383f('0x14')](function(_0x55da9a){logger[_0x383f('0x10')](_0x383f('0x15'),_0x55da9a[_0x383f('0x12')],_0x3a6f6c);_0x5e4d16(_0x30c15a[_0x383f('0x10')](0x1f4,_0x55da9a[_0x383f('0x12')]));});});};exports['ShowFreshdeskAccount']=function(_0x550275){var _0x5b83ab=this;return new Promise(function(_0x2229d8,_0x525669){return db['FreshdeskAccount'][_0x383f('0x20')]({'raw':_0x550275[_0x383f('0x18')]?_0x550275['options']['raw']===undefined?!![]:![]:!![],'where':_0x550275[_0x383f('0x18')]?_0x550275[_0x383f('0x18')][_0x383f('0x1a')]||null:null,'attributes':_0x550275[_0x383f('0x18')]?_0x550275[_0x383f('0x18')][_0x383f('0x1b')]||null:null,'include':_0x550275[_0x383f('0x18')]?_0x550275[_0x383f('0x18')][_0x383f('0x1d')]?_[_0x383f('0x1e')](_0x550275[_0x383f('0x18')][_0x383f('0x1d')],function(_0x59452c){return{'model':db[_0x59452c[_0x383f('0x1f')]],'as':_0x59452c['as'],'attributes':_0x59452c[_0x383f('0x1b')],'include':_0x59452c['include']?_[_0x383f('0x1e')](_0x59452c[_0x383f('0x1d')],function(_0x324f20){return{'model':db[_0x324f20[_0x383f('0x1f')]],'as':_0x324f20['as'],'attributes':_0x324f20[_0x383f('0x1b')],'include':_0x324f20[_0x383f('0x1d')]?_[_0x383f('0x1e')](_0x324f20[_0x383f('0x1d')],function(_0x271bcb){return{'model':db[_0x271bcb[_0x383f('0x1f')]],'as':_0x271bcb['as'],'attributes':_0x271bcb['attributes']};}):[]};}):[]};}):[]:[]})[_0x383f('0xa')](function(_0x456a00){logger['info'](_0x383f('0x21'),_0x550275);logger[_0x383f('0xe')](_0x383f('0x21'),_0x550275,JSON['stringify'](_0x456a00));_0x2229d8(_0x456a00);})['catch'](function(_0x4a697d){logger[_0x383f('0x10')]('ShowFreshdeskAccount',_0x4a697d[_0x383f('0x12')],_0x550275);_0x525669(_0x5b83ab['error'](0x1f4,_0x4a697d['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 15d357c..39e1d2d 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 _0x6de1=['/:id/subjects','/:id/descriptions','getDescriptions','create','/:id/tags','setTags','put','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields'];(function(_0x46655f,_0x54fafc){var _0x5d9cb6=function(_0x1189c0){while(--_0x1189c0){_0x46655f['push'](_0x46655f['shift']());}};_0x5d9cb6(++_0x54fafc);}(_0x6de1,0x112));var _0x16de=function(_0x4557dc,_0x3687b2){_0x4557dc=_0x4557dc-0x0;var _0x1377aa=_0x6de1[_0x4557dc];return _0x1377aa;};'use strict';var multer=require(_0x16de('0x0'));var util=require(_0x16de('0x1'));var path=require('path');var timeout=require(_0x16de('0x2'));var express=require(_0x16de('0x3'));var router=express[_0x16de('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x16de('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x16de('0x6'));var controller=require(_0x16de('0x7'));router[_0x16de('0x8')]('/',auth[_0x16de('0x9')](),controller['index']);router[_0x16de('0x8')](_0x16de('0xa'),auth[_0x16de('0x9')](),controller[_0x16de('0xb')]);router[_0x16de('0x8')](_0x16de('0xc'),auth[_0x16de('0x9')](),controller[_0x16de('0xd')]);router[_0x16de('0x8')](_0x16de('0xe'),auth[_0x16de('0x9')](),controller['getSubjects']);router[_0x16de('0x8')](_0x16de('0xf'),auth[_0x16de('0x9')](),controller[_0x16de('0x10')]);router[_0x16de('0x8')]('/:id/tags',auth[_0x16de('0x9')](),controller['getTags']);router['post']('/',auth['isAuthenticated'](),controller[_0x16de('0x11')]);router['post'](_0x16de('0x12'),auth[_0x16de('0x9')](),controller[_0x16de('0x13')]);router[_0x16de('0x14')](_0x16de('0xa'),auth[_0x16de('0x9')](),controller[_0x16de('0x15')]);router['delete'](_0x16de('0xa'),auth['isAuthenticated'](),controller[_0x16de('0x16')]);module[_0x16de('0x17')]=router; \ No newline at end of file +var _0x9d01=['/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','setTags','put','update','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated','index','get','/:id','show'];(function(_0x3c6b7d,_0x5f0d90){var _0x1d3ed2=function(_0x1a8f35){while(--_0x1a8f35){_0x3c6b7d['push'](_0x3c6b7d['shift']());}};_0x1d3ed2(++_0x5f0d90);}(_0x9d01,0x1d3));var _0x19d0=function(_0x119474,_0x28b89a){_0x119474=_0x119474-0x0;var _0x4970db=_0x9d01[_0x119474];return _0x4970db;};'use strict';var multer=require('multer');var util=require(_0x19d0('0x0'));var path=require(_0x19d0('0x1'));var timeout=require(_0x19d0('0x2'));var express=require(_0x19d0('0x3'));var router=express['Router']();var fs_extra=require(_0x19d0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x19d0('0x5'));var config=require(_0x19d0('0x6'));var controller=require(_0x19d0('0x7'));router['get']('/',auth[_0x19d0('0x8')](),controller[_0x19d0('0x9')]);router[_0x19d0('0xa')](_0x19d0('0xb'),auth[_0x19d0('0x8')](),controller[_0x19d0('0xc')]);router[_0x19d0('0xa')](_0x19d0('0xd'),auth[_0x19d0('0x8')](),controller[_0x19d0('0xe')]);router[_0x19d0('0xa')]('/:id/subjects',auth[_0x19d0('0x8')](),controller[_0x19d0('0xf')]);router[_0x19d0('0xa')](_0x19d0('0x10'),auth['isAuthenticated'](),controller[_0x19d0('0x11')]);router['get'](_0x19d0('0x12'),auth[_0x19d0('0x8')](),controller['getTags']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/tags',auth[_0x19d0('0x8')](),controller[_0x19d0('0x13')]);router[_0x19d0('0x14')](_0x19d0('0xb'),auth[_0x19d0('0x8')](),controller[_0x19d0('0x15')]);router[_0x19d0('0x16')](_0x19d0('0xb'),auth[_0x19d0('0x8')](),controller['destroy']);module[_0x19d0('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 9ef20f1..8a0e9e9 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 _0x7cb1=['STRING','sequelize'];(function(_0x363369,_0x4d2619){var _0x2b6a76=function(_0x58c52a){while(--_0x58c52a){_0x363369['push'](_0x363369['shift']());}};_0x2b6a76(++_0x4d2619);}(_0x7cb1,0x15b));var _0x17cb=function(_0x1c57e3,_0x35397f){_0x1c57e3=_0x1c57e3-0x0;var _0x5c0c7f=_0x7cb1[_0x1c57e3];return _0x5c0c7f;};'use strict';var Sequelize=require(_0x17cb('0x0'));module['exports']={'name':{'type':Sequelize[_0x17cb('0x1')]},'description':{'type':Sequelize[_0x17cb('0x1')]}}; \ No newline at end of file +var _0x5147=['STRING','sequelize'];(function(_0x37dcb5,_0x49d0ad){var _0x3c83ae=function(_0x57dcf3){while(--_0x57dcf3){_0x37dcb5['push'](_0x37dcb5['shift']());}};_0x3c83ae(++_0x49d0ad);}(_0x5147,0x16d));var _0x7514=function(_0x3df6d3,_0x592bc5){_0x3df6d3=_0x3df6d3-0x0;var _0x1e3b78=_0x5147[_0x3df6d3];return _0x1e3b78;};'use strict';var Sequelize=require(_0x7514('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7514('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index aa17ed9..200b52c 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 _0x5bc1=['request-promise','bluebird','mustache','sox','ejs','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','end','error','stack','name','index','FreshdeskConfiguration','rawAttributes','fieldName','key','model','map','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','create','body','find','destroy','getFields','findOne','FreshdeskField','pick','order','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir'];(function(_0x1e3cc6,_0x45597a){var _0x228db0=function(_0x37812b){while(--_0x37812b){_0x1e3cc6['push'](_0x1e3cc6['shift']());}};_0x228db0(++_0x45597a);}(_0x5bc1,0xa1));var _0x15bc=function(_0x2c4a45,_0x8836e3){_0x2c4a45=_0x2c4a45-0x0;var _0x51c36e=_0x5bc1[_0x2c4a45];return _0x51c36e;};'use strict';var emlformat=require(_0x15bc('0x0'));var rimraf=require(_0x15bc('0x1'));var zipdir=require(_0x15bc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x15bc('0x3'));var moment=require('moment');var BPromise=require(_0x15bc('0x4'));var Mustache=require(_0x15bc('0x5'));var util=require('util');var path=require('path');var sox=require(_0x15bc('0x6'));var csv=require('to-csv');var ejs=require(_0x15bc('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x15bc('0x8'));var crypto=require(_0x15bc('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x15bc('0xa'));var toCsv=require(_0x15bc('0xb'));var querystring=require(_0x15bc('0xc'));var Papa=require(_0x15bc('0xd'));var Redis=require(_0x15bc('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x15bc('0xf'));var as=require(_0x15bc('0x10'));var hardwareService=require(_0x15bc('0x11'));var logger=require('../../config/logger')(_0x15bc('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x15bc('0x13'));var db=require(_0x15bc('0x14'))['db'];function respondWithStatusCode(_0x2935ae,_0x1dbc9b){_0x1dbc9b=_0x1dbc9b||0xcc;return function(_0x420421){if(_0x420421){return _0x2935ae[_0x15bc('0x15')](_0x1dbc9b);}return _0x2935ae[_0x15bc('0x16')](_0x1dbc9b)['end']();};}function respondWithResult(_0x59262c,_0x165840){_0x165840=_0x165840||0xc8;return function(_0x4c5e96){if(_0x4c5e96){return _0x59262c[_0x15bc('0x16')](_0x165840)[_0x15bc('0x17')](_0x4c5e96);}};}function respondWithFilteredResult(_0x24d0bf,_0x57b4d5){return function(_0x244990){if(_0x244990){var _0x5a4d7b=typeof _0x57b4d5[_0x15bc('0x18')]===_0x15bc('0x19')&&typeof _0x57b4d5[_0x15bc('0x1a')]===_0x15bc('0x19');var _0x4c6a76=_0x244990[_0x15bc('0x1b')];var _0xb36d38=_0x5a4d7b?0x0:_0x57b4d5[_0x15bc('0x18')];var _0x27de78=_0x5a4d7b?_0x244990[_0x15bc('0x1b')]:_0x57b4d5[_0x15bc('0x18')]+_0x57b4d5[_0x15bc('0x1a')];var _0x425e1b;if(_0x27de78>=_0x4c6a76){_0x27de78=_0x4c6a76;_0x425e1b=0xc8;}else{_0x425e1b=0xce;}_0x24d0bf[_0x15bc('0x16')](_0x425e1b);return _0x24d0bf[_0x15bc('0x1c')]('Content-Range',_0xb36d38+'-'+_0x27de78+'/'+_0x4c6a76)[_0x15bc('0x17')](_0x244990);}return null;};}function patchUpdates(_0x35ce2c){return function(_0x525934){try{jsonpatch[_0x15bc('0x1d')](_0x525934,_0x35ce2c,!![]);}catch(_0x39e377){return BPromise[_0x15bc('0x1e')](_0x39e377);}return _0x525934[_0x15bc('0x1f')]();};}function saveUpdates(_0x19a70f,_0x10b097){return function(_0x2e5480){if(_0x2e5480){return _0x2e5480[_0x15bc('0x20')](_0x19a70f)[_0x15bc('0x21')](function(_0x4cca62){return _0x4cca62;});}return null;};}function removeEntity(_0x343c6b,_0x47f3fd){return function(_0x4707ec){if(_0x4707ec){return _0x4707ec['destroy']()['then'](function(){_0x343c6b[_0x15bc('0x16')](0xcc)[_0x15bc('0x22')]();});}};}function handleEntityNotFound(_0x4b94d1,_0x5729a2){return function(_0x48df55){if(!_0x48df55){_0x4b94d1[_0x15bc('0x15')](0x194);}return _0x48df55;};}function handleError(_0xee68b7,_0x5a17f3){_0x5a17f3=_0x5a17f3||0x1f4;return function(_0x453de3){logger[_0x15bc('0x23')](_0x453de3[_0x15bc('0x24')]);if(_0x453de3['name']){delete _0x453de3[_0x15bc('0x25')];}_0xee68b7['status'](_0x5a17f3)['send'](_0x453de3);};}exports[_0x15bc('0x26')]=function(_0x286a10,_0x531690){var _0x2338da={},_0x2cf3c9={},_0x2aac56={'count':0x0,'rows':[]};var _0x377d4a=_['map'](db[_0x15bc('0x27')][_0x15bc('0x28')],function(_0x1094e3){return{'name':_0x1094e3[_0x15bc('0x29')],'type':_0x1094e3['type'][_0x15bc('0x2a')]};});_0x2cf3c9[_0x15bc('0x2b')]=_[_0x15bc('0x2c')](_0x377d4a,_0x15bc('0x25'));_0x2cf3c9['query']=_[_0x15bc('0x2d')](_0x286a10['query']);_0x2cf3c9['filters']=_['intersection'](_0x2cf3c9[_0x15bc('0x2b')],_0x2cf3c9[_0x15bc('0x2e')]);_0x2338da['attributes']=_[_0x15bc('0x2f')](_0x2cf3c9[_0x15bc('0x2b')],qs[_0x15bc('0x30')](_0x286a10[_0x15bc('0x2e')][_0x15bc('0x30')]));_0x2338da[_0x15bc('0x31')]=_0x2338da[_0x15bc('0x31')][_0x15bc('0x32')]?_0x2338da[_0x15bc('0x31')]:_0x2cf3c9[_0x15bc('0x2b')];if(!_0x286a10[_0x15bc('0x2e')][_0x15bc('0x33')](_0x15bc('0x34'))){_0x2338da[_0x15bc('0x1a')]=qs[_0x15bc('0x1a')](_0x286a10[_0x15bc('0x2e')][_0x15bc('0x1a')]);_0x2338da['offset']=qs['offset'](_0x286a10[_0x15bc('0x2e')][_0x15bc('0x18')]);}_0x2338da['order']=qs['sort'](_0x286a10[_0x15bc('0x2e')][_0x15bc('0x35')]);_0x2338da[_0x15bc('0x36')]=qs['filters'](_['pick'](_0x286a10[_0x15bc('0x2e')],_0x2cf3c9[_0x15bc('0x37')]),_0x377d4a);if(_0x286a10[_0x15bc('0x2e')]['filter']){_0x2338da[_0x15bc('0x36')]=_[_0x15bc('0x38')](_0x2338da[_0x15bc('0x36')],{'$or':_['map'](_0x377d4a,function(_0x4658c7){if(_0x4658c7[_0x15bc('0x39')]!==_0x15bc('0x3a')){var _0x2e02dd={};_0x2e02dd[_0x4658c7[_0x15bc('0x25')]]={'$like':'%'+_0x286a10[_0x15bc('0x2e')][_0x15bc('0x3b')]+'%'};return _0x2e02dd;}})});}_0x2338da=_[_0x15bc('0x38')]({},_0x2338da,_0x286a10[_0x15bc('0x3c')]);var _0x5f5d56={'where':_0x2338da[_0x15bc('0x36')]};return db['FreshdeskConfiguration'][_0x15bc('0x1b')](_0x5f5d56)[_0x15bc('0x21')](function(_0x2cc58b){_0x2aac56['count']=_0x2cc58b;if(_0x286a10[_0x15bc('0x2e')][_0x15bc('0x3d')]){_0x2338da[_0x15bc('0x3e')]=[{'all':!![]}];}return db[_0x15bc('0x27')][_0x15bc('0x3f')](_0x2338da);})[_0x15bc('0x21')](function(_0xbca20b){_0x2aac56[_0x15bc('0x40')]=_0xbca20b;return _0x2aac56;})['then'](respondWithFilteredResult(_0x531690,_0x2338da))[_0x15bc('0x41')](handleError(_0x531690,null));};exports['show']=function(_0x2c094e,_0x247ef1){var _0x4457a0={'raw':![],'where':{'id':_0x2c094e[_0x15bc('0x42')]['id']}},_0x4c411e={};_0x4c411e[_0x15bc('0x2b')]=_['keys'](db['FreshdeskConfiguration']['rawAttributes']);_0x4c411e[_0x15bc('0x2e')]=_[_0x15bc('0x2d')](_0x2c094e['query']);_0x4c411e[_0x15bc('0x37')]=_[_0x15bc('0x2f')](_0x4c411e[_0x15bc('0x2b')],_0x4c411e[_0x15bc('0x2e')]);_0x4457a0[_0x15bc('0x31')]=_[_0x15bc('0x2f')](_0x4c411e['model'],qs[_0x15bc('0x30')](_0x2c094e[_0x15bc('0x2e')][_0x15bc('0x30')]));_0x4457a0['attributes']=_0x4457a0[_0x15bc('0x31')]['length']?_0x4457a0[_0x15bc('0x31')]:_0x4c411e[_0x15bc('0x2b')];if(_0x2c094e[_0x15bc('0x2e')][_0x15bc('0x3d')]){_0x4457a0['include']=[{'all':!![]}];}_0x4457a0=_['merge']({},_0x4457a0,_0x2c094e[_0x15bc('0x3c')]);return db[_0x15bc('0x27')]['find'](_0x4457a0)[_0x15bc('0x21')](handleEntityNotFound(_0x247ef1,null))[_0x15bc('0x21')](respondWithResult(_0x247ef1,null))[_0x15bc('0x41')](handleError(_0x247ef1,null));};exports[_0x15bc('0x43')]=function(_0xb06e1f,_0x1d1f91){return db[_0x15bc('0x27')]['create'](_0xb06e1f[_0x15bc('0x44')],{})[_0x15bc('0x21')](respondWithResult(_0x1d1f91,0xc9))['catch'](handleError(_0x1d1f91,null));};exports['update']=function(_0xab1ee,_0x10a8a6){if(_0xab1ee[_0x15bc('0x44')]['id']){delete _0xab1ee[_0x15bc('0x44')]['id'];}return db['FreshdeskConfiguration'][_0x15bc('0x45')]({'where':{'id':_0xab1ee['params']['id']}})[_0x15bc('0x21')](handleEntityNotFound(_0x10a8a6,null))[_0x15bc('0x21')](saveUpdates(_0xab1ee[_0x15bc('0x44')],null))[_0x15bc('0x21')](respondWithResult(_0x10a8a6,null))[_0x15bc('0x41')](handleError(_0x10a8a6,null));};exports[_0x15bc('0x46')]=function(_0xa739fe,_0x1165e2){return db[_0x15bc('0x27')][_0x15bc('0x45')]({'where':{'id':_0xa739fe[_0x15bc('0x42')]['id']}})[_0x15bc('0x21')](handleEntityNotFound(_0x1165e2,null))[_0x15bc('0x21')](removeEntity(_0x1165e2,null))[_0x15bc('0x41')](handleError(_0x1165e2,null));};exports[_0x15bc('0x47')]=function(_0x5b9589,_0xf7d73c,_0x2b8a85){var _0x2fe53d={};var _0x57c69b={};var _0x443b61;var _0x54f21d;return db[_0x15bc('0x27')][_0x15bc('0x48')]({'where':{'id':_0x5b9589[_0x15bc('0x42')]['id']}})[_0x15bc('0x21')](handleEntityNotFound(_0xf7d73c,null))[_0x15bc('0x21')](function(_0x500c8c){if(_0x500c8c){_0x443b61=_0x500c8c;_0x57c69b['model']=_[_0x15bc('0x2d')](db[_0x15bc('0x49')][_0x15bc('0x28')]);_0x57c69b[_0x15bc('0x2e')]=_[_0x15bc('0x2d')](_0x5b9589[_0x15bc('0x2e')]);_0x57c69b[_0x15bc('0x37')]=_[_0x15bc('0x2f')](_0x57c69b[_0x15bc('0x2b')],_0x57c69b[_0x15bc('0x2e')]);_0x2fe53d[_0x15bc('0x31')]=_[_0x15bc('0x2f')](_0x57c69b[_0x15bc('0x2b')],qs[_0x15bc('0x30')](_0x5b9589[_0x15bc('0x2e')]['fields']));_0x2fe53d['attributes']=_0x2fe53d[_0x15bc('0x31')]['length']?_0x2fe53d['attributes']:_0x57c69b[_0x15bc('0x2b')];_0x2fe53d['order']=qs[_0x15bc('0x35')](_0x5b9589[_0x15bc('0x2e')][_0x15bc('0x35')]);_0x2fe53d['where']=qs['filters'](_[_0x15bc('0x4a')](_0x5b9589[_0x15bc('0x2e')],_0x57c69b[_0x15bc('0x37')]));if(_0x5b9589['query'][_0x15bc('0x3b')]){_0x2fe53d[_0x15bc('0x36')]=_[_0x15bc('0x38')](_0x2fe53d[_0x15bc('0x36')],{'$or':_[_0x15bc('0x2c')](_0x2fe53d[_0x15bc('0x31')],function(_0x18e8ac){var _0x33cbf6={};_0x33cbf6[_0x18e8ac]={'$like':'%'+_0x5b9589[_0x15bc('0x2e')]['filter']+'%'};return _0x33cbf6;})});}_0x2fe53d=_['merge']({},_0x2fe53d,_0x5b9589[_0x15bc('0x3c')]);return _0x443b61[_0x15bc('0x47')](_0x2fe53d);}})[_0x15bc('0x21')](function(_0x439058){if(_0x439058){_0x54f21d=_0x439058[_0x15bc('0x32')];if(!_0x5b9589[_0x15bc('0x2e')][_0x15bc('0x33')](_0x15bc('0x34'))){_0x2fe53d[_0x15bc('0x1a')]=qs[_0x15bc('0x1a')](_0x5b9589[_0x15bc('0x2e')][_0x15bc('0x1a')]);_0x2fe53d[_0x15bc('0x18')]=qs['offset'](_0x5b9589[_0x15bc('0x2e')][_0x15bc('0x18')]);}return _0x443b61[_0x15bc('0x47')](_0x2fe53d);}})['then'](function(_0x48bdd8){if(_0x48bdd8){return _0x48bdd8?{'count':_0x54f21d,'rows':_0x48bdd8}:null;}})[_0x15bc('0x21')](respondWithResult(_0xf7d73c,null))[_0x15bc('0x41')](handleError(_0xf7d73c,null));};exports['getSubjects']=function(_0x52fbaf,_0x443569,_0x3d4f76){var _0x1fcf9a={};var _0x2be7a4={};var _0x3ebffb;var _0x3bbf13;return db[_0x15bc('0x27')][_0x15bc('0x48')]({'where':{'id':_0x52fbaf[_0x15bc('0x42')]['id']}})['then'](handleEntityNotFound(_0x443569,null))[_0x15bc('0x21')](function(_0x3e3b17){if(_0x3e3b17){_0x3ebffb=_0x3e3b17;_0x2be7a4[_0x15bc('0x2b')]=_[_0x15bc('0x2d')](db[_0x15bc('0x49')]['rawAttributes']);_0x2be7a4[_0x15bc('0x2e')]=_[_0x15bc('0x2d')](_0x52fbaf[_0x15bc('0x2e')]);_0x2be7a4['filters']=_[_0x15bc('0x2f')](_0x2be7a4[_0x15bc('0x2b')],_0x2be7a4[_0x15bc('0x2e')]);_0x1fcf9a[_0x15bc('0x31')]=_['intersection'](_0x2be7a4[_0x15bc('0x2b')],qs[_0x15bc('0x30')](_0x52fbaf[_0x15bc('0x2e')]['fields']));_0x1fcf9a['attributes']=_0x1fcf9a[_0x15bc('0x31')][_0x15bc('0x32')]?_0x1fcf9a[_0x15bc('0x31')]:_0x2be7a4[_0x15bc('0x2b')];_0x1fcf9a[_0x15bc('0x4b')]=qs[_0x15bc('0x35')](_0x52fbaf[_0x15bc('0x2e')][_0x15bc('0x35')]);_0x1fcf9a[_0x15bc('0x36')]=qs[_0x15bc('0x37')](_['pick'](_0x52fbaf[_0x15bc('0x2e')],_0x2be7a4[_0x15bc('0x37')]));if(_0x52fbaf[_0x15bc('0x2e')][_0x15bc('0x3b')]){_0x1fcf9a[_0x15bc('0x36')]=_['merge'](_0x1fcf9a['where'],{'$or':_[_0x15bc('0x2c')](_0x1fcf9a[_0x15bc('0x31')],function(_0x4fb9f8){var _0x57b76a={};_0x57b76a[_0x4fb9f8]={'$like':'%'+_0x52fbaf[_0x15bc('0x2e')][_0x15bc('0x3b')]+'%'};return _0x57b76a;})});}_0x1fcf9a=_[_0x15bc('0x38')]({},_0x1fcf9a,_0x52fbaf['options']);return _0x3ebffb[_0x15bc('0x4c')](_0x1fcf9a);}})[_0x15bc('0x21')](function(_0x404dde){if(_0x404dde){_0x3bbf13=_0x404dde[_0x15bc('0x32')];if(!_0x52fbaf['query'][_0x15bc('0x33')](_0x15bc('0x34'))){_0x1fcf9a['limit']=qs[_0x15bc('0x1a')](_0x52fbaf[_0x15bc('0x2e')][_0x15bc('0x1a')]);_0x1fcf9a['offset']=qs[_0x15bc('0x18')](_0x52fbaf[_0x15bc('0x2e')][_0x15bc('0x18')]);}return _0x3ebffb['getSubjects'](_0x1fcf9a);}})[_0x15bc('0x21')](function(_0x2ad08e){if(_0x2ad08e){return _0x2ad08e?{'count':_0x3bbf13,'rows':_0x2ad08e}:null;}})['then'](respondWithResult(_0x443569,null))[_0x15bc('0x41')](handleError(_0x443569,null));};exports[_0x15bc('0x4d')]=function(_0x1593f1,_0x2bdb1,_0x112dbb){var _0x3dff06={};var _0x2408bd={};var _0x3793b5;var _0x50991d;return db['FreshdeskConfiguration'][_0x15bc('0x48')]({'where':{'id':_0x1593f1[_0x15bc('0x42')]['id']}})['then'](handleEntityNotFound(_0x2bdb1,null))[_0x15bc('0x21')](function(_0x122411){if(_0x122411){_0x3793b5=_0x122411;_0x2408bd[_0x15bc('0x2b')]=_[_0x15bc('0x2d')](db[_0x15bc('0x49')][_0x15bc('0x28')]);_0x2408bd[_0x15bc('0x2e')]=_[_0x15bc('0x2d')](_0x1593f1[_0x15bc('0x2e')]);_0x2408bd['filters']=_[_0x15bc('0x2f')](_0x2408bd[_0x15bc('0x2b')],_0x2408bd['query']);_0x3dff06[_0x15bc('0x31')]=_[_0x15bc('0x2f')](_0x2408bd[_0x15bc('0x2b')],qs[_0x15bc('0x30')](_0x1593f1[_0x15bc('0x2e')][_0x15bc('0x30')]));_0x3dff06[_0x15bc('0x31')]=_0x3dff06['attributes'][_0x15bc('0x32')]?_0x3dff06[_0x15bc('0x31')]:_0x2408bd['model'];_0x3dff06['order']=qs[_0x15bc('0x35')](_0x1593f1[_0x15bc('0x2e')]['sort']);_0x3dff06[_0x15bc('0x36')]=qs[_0x15bc('0x37')](_[_0x15bc('0x4a')](_0x1593f1[_0x15bc('0x2e')],_0x2408bd[_0x15bc('0x37')]));if(_0x1593f1[_0x15bc('0x2e')][_0x15bc('0x3b')]){_0x3dff06[_0x15bc('0x36')]=_[_0x15bc('0x38')](_0x3dff06['where'],{'$or':_['map'](_0x3dff06[_0x15bc('0x31')],function(_0x3b6078){var _0x47b588={};_0x47b588[_0x3b6078]={'$like':'%'+_0x1593f1[_0x15bc('0x2e')]['filter']+'%'};return _0x47b588;})});}_0x3dff06=_[_0x15bc('0x38')]({},_0x3dff06,_0x1593f1[_0x15bc('0x3c')]);return _0x3793b5[_0x15bc('0x4d')](_0x3dff06);}})['then'](function(_0x46357b){if(_0x46357b){_0x50991d=_0x46357b[_0x15bc('0x32')];if(!_0x1593f1[_0x15bc('0x2e')][_0x15bc('0x33')]('nolimit')){_0x3dff06[_0x15bc('0x1a')]=qs['limit'](_0x1593f1['query'][_0x15bc('0x1a')]);_0x3dff06[_0x15bc('0x18')]=qs[_0x15bc('0x18')](_0x1593f1[_0x15bc('0x2e')][_0x15bc('0x18')]);}return _0x3793b5[_0x15bc('0x4d')](_0x3dff06);}})[_0x15bc('0x21')](function(_0x35b1a3){if(_0x35b1a3){return _0x35b1a3?{'count':_0x50991d,'rows':_0x35b1a3}:null;}})[_0x15bc('0x21')](respondWithResult(_0x2bdb1,null))[_0x15bc('0x41')](handleError(_0x2bdb1,null));};exports[_0x15bc('0x4e')]=function(_0x41f3ec,_0x2c1071,_0x2aa6db){var _0x2fc90e={};var _0x26f426={};var _0x5a420f;var _0x13b4f8;return db[_0x15bc('0x27')]['findOne']({'where':{'id':_0x41f3ec[_0x15bc('0x42')]['id']}})['then'](handleEntityNotFound(_0x2c1071,null))[_0x15bc('0x21')](function(_0x426ec0){if(_0x426ec0){_0x5a420f=_0x426ec0;_0x26f426[_0x15bc('0x2b')]=_['keys'](db[_0x15bc('0x4f')][_0x15bc('0x28')]);_0x26f426[_0x15bc('0x2e')]=_[_0x15bc('0x2d')](_0x41f3ec[_0x15bc('0x2e')]);_0x26f426['filters']=_[_0x15bc('0x2f')](_0x26f426[_0x15bc('0x2b')],_0x26f426[_0x15bc('0x2e')]);_0x2fc90e[_0x15bc('0x31')]=_['intersection'](_0x26f426[_0x15bc('0x2b')],qs[_0x15bc('0x30')](_0x41f3ec[_0x15bc('0x2e')][_0x15bc('0x30')]));_0x2fc90e[_0x15bc('0x31')]=_0x2fc90e['attributes'][_0x15bc('0x32')]?_0x2fc90e[_0x15bc('0x31')]:_0x26f426[_0x15bc('0x2b')];_0x2fc90e[_0x15bc('0x4b')]=qs[_0x15bc('0x35')](_0x41f3ec[_0x15bc('0x2e')][_0x15bc('0x35')]);_0x2fc90e['where']=qs[_0x15bc('0x37')](_['pick'](_0x41f3ec['query'],_0x26f426[_0x15bc('0x37')]));if(_0x41f3ec[_0x15bc('0x2e')]['filter']){_0x2fc90e[_0x15bc('0x36')]=_[_0x15bc('0x38')](_0x2fc90e['where'],{'$or':_['map'](_0x2fc90e[_0x15bc('0x31')],function(_0x3f5292){var _0x1599e2={};_0x1599e2[_0x3f5292]={'$like':'%'+_0x41f3ec[_0x15bc('0x2e')][_0x15bc('0x3b')]+'%'};return _0x1599e2;})});}_0x2fc90e=_[_0x15bc('0x38')]({},_0x2fc90e,_0x41f3ec[_0x15bc('0x3c')]);return _0x5a420f['getTags'](_0x2fc90e);}})[_0x15bc('0x21')](function(_0x9f8d8d){if(_0x9f8d8d){_0x13b4f8=_0x9f8d8d[_0x15bc('0x32')];if(!_0x41f3ec[_0x15bc('0x2e')][_0x15bc('0x33')](_0x15bc('0x34'))){_0x2fc90e[_0x15bc('0x1a')]=qs[_0x15bc('0x1a')](_0x41f3ec[_0x15bc('0x2e')][_0x15bc('0x1a')]);_0x2fc90e[_0x15bc('0x18')]=qs[_0x15bc('0x18')](_0x41f3ec['query']['offset']);}return _0x5a420f[_0x15bc('0x4e')](_0x2fc90e);}})[_0x15bc('0x21')](function(_0x2b5e7c){if(_0x2b5e7c){return _0x2b5e7c?{'count':_0x13b4f8,'rows':_0x2b5e7c}:null;}})[_0x15bc('0x21')](respondWithResult(_0x2c1071,null))[_0x15bc('0x41')](handleError(_0x2c1071,null));};exports[_0x15bc('0x50')]=function(_0x38efbd,_0x3a48ae,_0x32c266){if(_0x38efbd[_0x15bc('0x44')]['id']){delete _0x38efbd[_0x15bc('0x44')]['id'];}return db['FreshdeskConfiguration'][_0x15bc('0x48')]({'where':{'id':_0x38efbd[_0x15bc('0x42')]['id']}})['then'](handleEntityNotFound(_0x3a48ae,null))['then'](function(_0x2c4071){if(_0x2c4071){return _0x2c4071[_0x15bc('0x50')](_0x38efbd['body'][_0x15bc('0x51')]||[]);}return null;})[_0x15bc('0x21')](respondWithResult(_0x3a48ae,null))[_0x15bc('0x41')](handleError(_0x3a48ae,null));}; \ No newline at end of file +var _0x385c=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','destroy','sendStatus','error','stack','name','send','FreshdeskConfiguration','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','length','order','sort','where','pick','filter','merge','options','rows','params','fields','includeAll','include','find','catch','create','body','findOne','FreshdeskField','rawAttributes','getFields','hasOwnProperty','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','ids','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis'];(function(_0x1bd323,_0x1c16ab){var _0x13097b=function(_0x4cc5de){while(--_0x4cc5de){_0x1bd323['push'](_0x1bd323['shift']());}};_0x13097b(++_0x1c16ab);}(_0x385c,0x1e2));var _0xc385=function(_0x1331aa,_0x1da8fd){_0x1331aa=_0x1331aa-0x0;var _0x2c441b=_0x385c[_0x1331aa];return _0x2c441b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc385('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc385('0x1'));var rp=require(_0xc385('0x2'));var moment=require(_0xc385('0x3'));var BPromise=require(_0xc385('0x4'));var Mustache=require(_0xc385('0x5'));var util=require('util');var path=require('path');var sox=require(_0xc385('0x6'));var csv=require(_0xc385('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc385('0x8'));var _=require(_0xc385('0x9'));var squel=require(_0xc385('0xa'));var crypto=require(_0xc385('0xb'));var jsforce=require(_0xc385('0xc'));var deskjs=require(_0xc385('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc385('0xe'));var Redis=require(_0xc385('0xf'));var authService=require(_0xc385('0x10'));var qs=require(_0xc385('0x11'));var as=require(_0xc385('0x12'));var hardwareService=require(_0xc385('0x13'));var logger=require('../../config/logger')(_0xc385('0x14'));var utils=require(_0xc385('0x15'));var config=require(_0xc385('0x16'));var licenseUtil=require(_0xc385('0x17'));var db=require(_0xc385('0x18'))['db'];function respondWithStatusCode(_0x49bb3f,_0x528409){_0x528409=_0x528409||0xcc;return function(_0x307367){if(_0x307367){return _0x49bb3f['sendStatus'](_0x528409);}return _0x49bb3f[_0xc385('0x19')](_0x528409)[_0xc385('0x1a')]();};}function respondWithResult(_0x3d34ac,_0x489ef2){_0x489ef2=_0x489ef2||0xc8;return function(_0x1cd604){if(_0x1cd604){return _0x3d34ac[_0xc385('0x19')](_0x489ef2)[_0xc385('0x1b')](_0x1cd604);}};}function respondWithFilteredResult(_0x5d0936,_0x385628){return function(_0x4a9c60){if(_0x4a9c60){var _0x1136e=typeof _0x385628[_0xc385('0x1c')]==='undefined'&&typeof _0x385628[_0xc385('0x1d')]===_0xc385('0x1e');var _0x9cac77=_0x4a9c60[_0xc385('0x1f')];var _0x47bc1e=_0x1136e?0x0:_0x385628[_0xc385('0x1c')];var _0x533530=_0x1136e?_0x4a9c60[_0xc385('0x1f')]:_0x385628[_0xc385('0x1c')]+_0x385628[_0xc385('0x1d')];var _0x6aeff9;if(_0x533530>=_0x9cac77){_0x533530=_0x9cac77;_0x6aeff9=0xc8;}else{_0x6aeff9=0xce;}_0x5d0936[_0xc385('0x19')](_0x6aeff9);return _0x5d0936[_0xc385('0x20')](_0xc385('0x21'),_0x47bc1e+'-'+_0x533530+'/'+_0x9cac77)[_0xc385('0x1b')](_0x4a9c60);}return null;};}function patchUpdates(_0x173b5c){return function(_0x1fb0ef){try{jsonpatch['apply'](_0x1fb0ef,_0x173b5c,!![]);}catch(_0x2d4469){return BPromise[_0xc385('0x22')](_0x2d4469);}return _0x1fb0ef[_0xc385('0x23')]();};}function saveUpdates(_0x48533c,_0x567fc1){return function(_0x317ed7){if(_0x317ed7){return _0x317ed7['update'](_0x48533c)[_0xc385('0x24')](function(_0x22c052){return _0x22c052;});}return null;};}function removeEntity(_0x2ab7b5,_0x29bd58){return function(_0x1a3297){if(_0x1a3297){return _0x1a3297[_0xc385('0x25')]()[_0xc385('0x24')](function(){_0x2ab7b5['status'](0xcc)[_0xc385('0x1a')]();});}};}function handleEntityNotFound(_0x4a9202,_0x2fca2c){return function(_0x103287){if(!_0x103287){_0x4a9202[_0xc385('0x26')](0x194);}return _0x103287;};}function handleError(_0x143b88,_0x1c2cad){_0x1c2cad=_0x1c2cad||0x1f4;return function(_0x2bfb6b){logger[_0xc385('0x27')](_0x2bfb6b[_0xc385('0x28')]);if(_0x2bfb6b[_0xc385('0x29')]){delete _0x2bfb6b['name'];}_0x143b88['status'](_0x1c2cad)[_0xc385('0x2a')](_0x2bfb6b);};}exports['index']=function(_0x51127e,_0x432d8b){var _0x46b688={},_0x223d7={},_0x330d8a={'count':0x0,'rows':[]};var _0x519111=_['map'](db[_0xc385('0x2b')]['rawAttributes'],function(_0x25c5f3){return{'name':_0x25c5f3[_0xc385('0x2c')],'type':_0x25c5f3[_0xc385('0x2d')][_0xc385('0x2e')]};});_0x223d7[_0xc385('0x2f')]=_[_0xc385('0x30')](_0x519111,'name');_0x223d7[_0xc385('0x31')]=_[_0xc385('0x32')](_0x51127e[_0xc385('0x31')]);_0x223d7[_0xc385('0x33')]=_[_0xc385('0x34')](_0x223d7[_0xc385('0x2f')],_0x223d7[_0xc385('0x31')]);_0x46b688[_0xc385('0x35')]=_[_0xc385('0x34')](_0x223d7[_0xc385('0x2f')],qs['fields'](_0x51127e[_0xc385('0x31')]['fields']));_0x46b688[_0xc385('0x35')]=_0x46b688[_0xc385('0x35')][_0xc385('0x36')]?_0x46b688[_0xc385('0x35')]:_0x223d7[_0xc385('0x2f')];if(!_0x51127e[_0xc385('0x31')]['hasOwnProperty']('nolimit')){_0x46b688[_0xc385('0x1d')]=qs['limit'](_0x51127e['query']['limit']);_0x46b688['offset']=qs[_0xc385('0x1c')](_0x51127e['query']['offset']);}_0x46b688[_0xc385('0x37')]=qs[_0xc385('0x38')](_0x51127e[_0xc385('0x31')][_0xc385('0x38')]);_0x46b688[_0xc385('0x39')]=qs[_0xc385('0x33')](_[_0xc385('0x3a')](_0x51127e[_0xc385('0x31')],_0x223d7['filters']),_0x519111);if(_0x51127e['query'][_0xc385('0x3b')]){_0x46b688[_0xc385('0x39')]=_[_0xc385('0x3c')](_0x46b688[_0xc385('0x39')],{'$or':_[_0xc385('0x30')](_0x519111,function(_0x123627){if(_0x123627[_0xc385('0x2d')]!=='VIRTUAL'){var _0x198d73={};_0x198d73[_0x123627[_0xc385('0x29')]]={'$like':'%'+_0x51127e[_0xc385('0x31')][_0xc385('0x3b')]+'%'};return _0x198d73;}})});}_0x46b688=_[_0xc385('0x3c')]({},_0x46b688,_0x51127e[_0xc385('0x3d')]);var _0x42fc87={'where':_0x46b688[_0xc385('0x39')]};return db[_0xc385('0x2b')]['count'](_0x42fc87)[_0xc385('0x24')](function(_0x44f23f){_0x330d8a[_0xc385('0x1f')]=_0x44f23f;if(_0x51127e[_0xc385('0x31')]['includeAll']){_0x46b688['include']=[{'all':!![]}];}return db[_0xc385('0x2b')]['findAll'](_0x46b688);})[_0xc385('0x24')](function(_0x46eb4d){_0x330d8a[_0xc385('0x3e')]=_0x46eb4d;return _0x330d8a;})[_0xc385('0x24')](respondWithFilteredResult(_0x432d8b,_0x46b688))['catch'](handleError(_0x432d8b,null));};exports['show']=function(_0x4d69ee,_0x3146b2){var _0x3da23a={'raw':![],'where':{'id':_0x4d69ee[_0xc385('0x3f')]['id']}},_0x2e7dcf={};_0x2e7dcf['model']=_[_0xc385('0x32')](db[_0xc385('0x2b')]['rawAttributes']);_0x2e7dcf[_0xc385('0x31')]=_[_0xc385('0x32')](_0x4d69ee[_0xc385('0x31')]);_0x2e7dcf['filters']=_[_0xc385('0x34')](_0x2e7dcf[_0xc385('0x2f')],_0x2e7dcf['query']);_0x3da23a['attributes']=_[_0xc385('0x34')](_0x2e7dcf[_0xc385('0x2f')],qs['fields'](_0x4d69ee[_0xc385('0x31')][_0xc385('0x40')]));_0x3da23a[_0xc385('0x35')]=_0x3da23a[_0xc385('0x35')]['length']?_0x3da23a[_0xc385('0x35')]:_0x2e7dcf['model'];if(_0x4d69ee['query'][_0xc385('0x41')]){_0x3da23a[_0xc385('0x42')]=[{'all':!![]}];}_0x3da23a=_['merge']({},_0x3da23a,_0x4d69ee[_0xc385('0x3d')]);return db[_0xc385('0x2b')][_0xc385('0x43')](_0x3da23a)[_0xc385('0x24')](handleEntityNotFound(_0x3146b2,null))[_0xc385('0x24')](respondWithResult(_0x3146b2,null))[_0xc385('0x44')](handleError(_0x3146b2,null));};exports[_0xc385('0x45')]=function(_0x25c413,_0x1f797e){return db[_0xc385('0x2b')]['create'](_0x25c413[_0xc385('0x46')],{})[_0xc385('0x24')](respondWithResult(_0x1f797e,0xc9))[_0xc385('0x44')](handleError(_0x1f797e,null));};exports['update']=function(_0x4d32f7,_0x99bc){if(_0x4d32f7[_0xc385('0x46')]['id']){delete _0x4d32f7[_0xc385('0x46')]['id'];}return db[_0xc385('0x2b')][_0xc385('0x43')]({'where':{'id':_0x4d32f7[_0xc385('0x3f')]['id']}})[_0xc385('0x24')](handleEntityNotFound(_0x99bc,null))[_0xc385('0x24')](saveUpdates(_0x4d32f7[_0xc385('0x46')],null))[_0xc385('0x24')](respondWithResult(_0x99bc,null))[_0xc385('0x44')](handleError(_0x99bc,null));};exports[_0xc385('0x25')]=function(_0xbdb5b0,_0xcd58d8){return db[_0xc385('0x2b')][_0xc385('0x43')]({'where':{'id':_0xbdb5b0[_0xc385('0x3f')]['id']}})[_0xc385('0x24')](handleEntityNotFound(_0xcd58d8,null))['then'](removeEntity(_0xcd58d8,null))[_0xc385('0x44')](handleError(_0xcd58d8,null));};exports['getFields']=function(_0x148087,_0x5802f9,_0x17d6d2){var _0xfd833f={};var _0x1fcd9e={};var _0x57c23f;var _0x6aa749;return db[_0xc385('0x2b')][_0xc385('0x47')]({'where':{'id':_0x148087[_0xc385('0x3f')]['id']}})[_0xc385('0x24')](handleEntityNotFound(_0x5802f9,null))[_0xc385('0x24')](function(_0x189c1d){if(_0x189c1d){_0x57c23f=_0x189c1d;_0x1fcd9e['model']=_[_0xc385('0x32')](db[_0xc385('0x48')][_0xc385('0x49')]);_0x1fcd9e[_0xc385('0x31')]=_[_0xc385('0x32')](_0x148087[_0xc385('0x31')]);_0x1fcd9e[_0xc385('0x33')]=_['intersection'](_0x1fcd9e['model'],_0x1fcd9e['query']);_0xfd833f[_0xc385('0x35')]=_['intersection'](_0x1fcd9e[_0xc385('0x2f')],qs[_0xc385('0x40')](_0x148087['query']['fields']));_0xfd833f[_0xc385('0x35')]=_0xfd833f[_0xc385('0x35')][_0xc385('0x36')]?_0xfd833f['attributes']:_0x1fcd9e['model'];_0xfd833f[_0xc385('0x37')]=qs[_0xc385('0x38')](_0x148087[_0xc385('0x31')]['sort']);_0xfd833f[_0xc385('0x39')]=qs[_0xc385('0x33')](_[_0xc385('0x3a')](_0x148087[_0xc385('0x31')],_0x1fcd9e[_0xc385('0x33')]));if(_0x148087[_0xc385('0x31')][_0xc385('0x3b')]){_0xfd833f['where']=_[_0xc385('0x3c')](_0xfd833f[_0xc385('0x39')],{'$or':_[_0xc385('0x30')](_0xfd833f[_0xc385('0x35')],function(_0x4d8520){var _0x2fbbf0={};_0x2fbbf0[_0x4d8520]={'$like':'%'+_0x148087[_0xc385('0x31')][_0xc385('0x3b')]+'%'};return _0x2fbbf0;})});}_0xfd833f=_[_0xc385('0x3c')]({},_0xfd833f,_0x148087[_0xc385('0x3d')]);return _0x57c23f[_0xc385('0x4a')](_0xfd833f);}})[_0xc385('0x24')](function(_0x4595f0){if(_0x4595f0){_0x6aa749=_0x4595f0['length'];if(!_0x148087[_0xc385('0x31')][_0xc385('0x4b')](_0xc385('0x4c'))){_0xfd833f[_0xc385('0x1d')]=qs[_0xc385('0x1d')](_0x148087['query']['limit']);_0xfd833f[_0xc385('0x1c')]=qs['offset'](_0x148087[_0xc385('0x31')][_0xc385('0x1c')]);}return _0x57c23f[_0xc385('0x4a')](_0xfd833f);}})[_0xc385('0x24')](function(_0x214635){if(_0x214635){return _0x214635?{'count':_0x6aa749,'rows':_0x214635}:null;}})['then'](respondWithResult(_0x5802f9,null))[_0xc385('0x44')](handleError(_0x5802f9,null));};exports[_0xc385('0x4d')]=function(_0x4ca349,_0xfc0e97,_0x20f6fc){var _0x38801c={};var _0x53dcd7={};var _0x5117ec;var _0x3b93e1;return db[_0xc385('0x2b')][_0xc385('0x47')]({'where':{'id':_0x4ca349[_0xc385('0x3f')]['id']}})[_0xc385('0x24')](handleEntityNotFound(_0xfc0e97,null))['then'](function(_0x59438c){if(_0x59438c){_0x5117ec=_0x59438c;_0x53dcd7[_0xc385('0x2f')]=_[_0xc385('0x32')](db[_0xc385('0x48')][_0xc385('0x49')]);_0x53dcd7['query']=_['keys'](_0x4ca349[_0xc385('0x31')]);_0x53dcd7[_0xc385('0x33')]=_[_0xc385('0x34')](_0x53dcd7[_0xc385('0x2f')],_0x53dcd7[_0xc385('0x31')]);_0x38801c[_0xc385('0x35')]=_['intersection'](_0x53dcd7[_0xc385('0x2f')],qs[_0xc385('0x40')](_0x4ca349[_0xc385('0x31')][_0xc385('0x40')]));_0x38801c[_0xc385('0x35')]=_0x38801c[_0xc385('0x35')]['length']?_0x38801c[_0xc385('0x35')]:_0x53dcd7['model'];_0x38801c[_0xc385('0x37')]=qs[_0xc385('0x38')](_0x4ca349[_0xc385('0x31')][_0xc385('0x38')]);_0x38801c[_0xc385('0x39')]=qs['filters'](_[_0xc385('0x3a')](_0x4ca349['query'],_0x53dcd7[_0xc385('0x33')]));if(_0x4ca349[_0xc385('0x31')][_0xc385('0x3b')]){_0x38801c[_0xc385('0x39')]=_[_0xc385('0x3c')](_0x38801c[_0xc385('0x39')],{'$or':_[_0xc385('0x30')](_0x38801c['attributes'],function(_0x38b7af){var _0x1da7c9={};_0x1da7c9[_0x38b7af]={'$like':'%'+_0x4ca349[_0xc385('0x31')][_0xc385('0x3b')]+'%'};return _0x1da7c9;})});}_0x38801c=_[_0xc385('0x3c')]({},_0x38801c,_0x4ca349[_0xc385('0x3d')]);return _0x5117ec['getSubjects'](_0x38801c);}})[_0xc385('0x24')](function(_0x24cc12){if(_0x24cc12){_0x3b93e1=_0x24cc12[_0xc385('0x36')];if(!_0x4ca349[_0xc385('0x31')]['hasOwnProperty'](_0xc385('0x4c'))){_0x38801c[_0xc385('0x1d')]=qs[_0xc385('0x1d')](_0x4ca349[_0xc385('0x31')][_0xc385('0x1d')]);_0x38801c[_0xc385('0x1c')]=qs[_0xc385('0x1c')](_0x4ca349[_0xc385('0x31')][_0xc385('0x1c')]);}return _0x5117ec[_0xc385('0x4d')](_0x38801c);}})['then'](function(_0xa4ea67){if(_0xa4ea67){return _0xa4ea67?{'count':_0x3b93e1,'rows':_0xa4ea67}:null;}})[_0xc385('0x24')](respondWithResult(_0xfc0e97,null))[_0xc385('0x44')](handleError(_0xfc0e97,null));};exports[_0xc385('0x4e')]=function(_0x24e186,_0x5e535f,_0x564d3c){var _0x32ea14={};var _0x3aafe9={};var _0x1d0c95;var _0x328dd9;return db[_0xc385('0x2b')][_0xc385('0x47')]({'where':{'id':_0x24e186[_0xc385('0x3f')]['id']}})[_0xc385('0x24')](handleEntityNotFound(_0x5e535f,null))[_0xc385('0x24')](function(_0xfa205b){if(_0xfa205b){_0x1d0c95=_0xfa205b;_0x3aafe9[_0xc385('0x2f')]=_[_0xc385('0x32')](db[_0xc385('0x48')][_0xc385('0x49')]);_0x3aafe9['query']=_[_0xc385('0x32')](_0x24e186[_0xc385('0x31')]);_0x3aafe9['filters']=_[_0xc385('0x34')](_0x3aafe9[_0xc385('0x2f')],_0x3aafe9[_0xc385('0x31')]);_0x32ea14[_0xc385('0x35')]=_[_0xc385('0x34')](_0x3aafe9[_0xc385('0x2f')],qs[_0xc385('0x40')](_0x24e186[_0xc385('0x31')][_0xc385('0x40')]));_0x32ea14[_0xc385('0x35')]=_0x32ea14[_0xc385('0x35')][_0xc385('0x36')]?_0x32ea14['attributes']:_0x3aafe9[_0xc385('0x2f')];_0x32ea14[_0xc385('0x37')]=qs['sort'](_0x24e186[_0xc385('0x31')][_0xc385('0x38')]);_0x32ea14[_0xc385('0x39')]=qs[_0xc385('0x33')](_[_0xc385('0x3a')](_0x24e186['query'],_0x3aafe9['filters']));if(_0x24e186['query'][_0xc385('0x3b')]){_0x32ea14[_0xc385('0x39')]=_[_0xc385('0x3c')](_0x32ea14[_0xc385('0x39')],{'$or':_[_0xc385('0x30')](_0x32ea14['attributes'],function(_0x44aaaa){var _0x64cbd={};_0x64cbd[_0x44aaaa]={'$like':'%'+_0x24e186[_0xc385('0x31')]['filter']+'%'};return _0x64cbd;})});}_0x32ea14=_['merge']({},_0x32ea14,_0x24e186[_0xc385('0x3d')]);return _0x1d0c95[_0xc385('0x4e')](_0x32ea14);}})[_0xc385('0x24')](function(_0x494e2e){if(_0x494e2e){_0x328dd9=_0x494e2e[_0xc385('0x36')];if(!_0x24e186[_0xc385('0x31')][_0xc385('0x4b')](_0xc385('0x4c'))){_0x32ea14[_0xc385('0x1d')]=qs['limit'](_0x24e186['query'][_0xc385('0x1d')]);_0x32ea14['offset']=qs[_0xc385('0x1c')](_0x24e186[_0xc385('0x31')]['offset']);}return _0x1d0c95[_0xc385('0x4e')](_0x32ea14);}})[_0xc385('0x24')](function(_0x57cdd2){if(_0x57cdd2){return _0x57cdd2?{'count':_0x328dd9,'rows':_0x57cdd2}:null;}})[_0xc385('0x24')](respondWithResult(_0x5e535f,null))[_0xc385('0x44')](handleError(_0x5e535f,null));};exports[_0xc385('0x4f')]=function(_0x112bd7,_0x145757,_0x4e0dae){var _0x1f5bdb={};var _0x2ca091={};var _0x249518;var _0x2d8be3;return db[_0xc385('0x2b')][_0xc385('0x47')]({'where':{'id':_0x112bd7[_0xc385('0x3f')]['id']}})[_0xc385('0x24')](handleEntityNotFound(_0x145757,null))[_0xc385('0x24')](function(_0x55f90f){if(_0x55f90f){_0x249518=_0x55f90f;_0x2ca091['model']=_[_0xc385('0x32')](db[_0xc385('0x50')][_0xc385('0x49')]);_0x2ca091[_0xc385('0x31')]=_['keys'](_0x112bd7[_0xc385('0x31')]);_0x2ca091[_0xc385('0x33')]=_[_0xc385('0x34')](_0x2ca091[_0xc385('0x2f')],_0x2ca091[_0xc385('0x31')]);_0x1f5bdb[_0xc385('0x35')]=_[_0xc385('0x34')](_0x2ca091[_0xc385('0x2f')],qs[_0xc385('0x40')](_0x112bd7['query'][_0xc385('0x40')]));_0x1f5bdb['attributes']=_0x1f5bdb[_0xc385('0x35')]['length']?_0x1f5bdb[_0xc385('0x35')]:_0x2ca091[_0xc385('0x2f')];_0x1f5bdb[_0xc385('0x37')]=qs[_0xc385('0x38')](_0x112bd7[_0xc385('0x31')]['sort']);_0x1f5bdb[_0xc385('0x39')]=qs[_0xc385('0x33')](_['pick'](_0x112bd7[_0xc385('0x31')],_0x2ca091['filters']));if(_0x112bd7['query'][_0xc385('0x3b')]){_0x1f5bdb[_0xc385('0x39')]=_[_0xc385('0x3c')](_0x1f5bdb[_0xc385('0x39')],{'$or':_[_0xc385('0x30')](_0x1f5bdb[_0xc385('0x35')],function(_0x1ae322){var _0x4d02f1={};_0x4d02f1[_0x1ae322]={'$like':'%'+_0x112bd7[_0xc385('0x31')][_0xc385('0x3b')]+'%'};return _0x4d02f1;})});}_0x1f5bdb=_[_0xc385('0x3c')]({},_0x1f5bdb,_0x112bd7[_0xc385('0x3d')]);return _0x249518[_0xc385('0x4f')](_0x1f5bdb);}})[_0xc385('0x24')](function(_0x4b6a20){if(_0x4b6a20){_0x2d8be3=_0x4b6a20[_0xc385('0x36')];if(!_0x112bd7[_0xc385('0x31')]['hasOwnProperty']('nolimit')){_0x1f5bdb['limit']=qs[_0xc385('0x1d')](_0x112bd7['query']['limit']);_0x1f5bdb[_0xc385('0x1c')]=qs[_0xc385('0x1c')](_0x112bd7[_0xc385('0x31')]['offset']);}return _0x249518[_0xc385('0x4f')](_0x1f5bdb);}})[_0xc385('0x24')](function(_0x674196){if(_0x674196){return _0x674196?{'count':_0x2d8be3,'rows':_0x674196}:null;}})[_0xc385('0x24')](respondWithResult(_0x145757,null))[_0xc385('0x44')](handleError(_0x145757,null));};exports[_0xc385('0x51')]=function(_0x3da669,_0x2ae95e,_0x17cb90){if(_0x3da669[_0xc385('0x46')]['id']){delete _0x3da669[_0xc385('0x46')]['id'];}return db[_0xc385('0x2b')]['findOne']({'where':{'id':_0x3da669[_0xc385('0x3f')]['id']}})[_0xc385('0x24')](handleEntityNotFound(_0x2ae95e,null))[_0xc385('0x24')](function(_0x29715f){if(_0x29715f){return _0x29715f[_0xc385('0x51')](_0x3da669[_0xc385('0x46')][_0xc385('0x52')]||[]);}return null;})[_0xc385('0x24')](respondWithResult(_0x2ae95e,null))[_0xc385('0x44')](handleError(_0x2ae95e,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 80d91ae..b5f731d 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 _0x0958=['FreshdeskConfiguration','int_freshdesk_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x40d67c,_0x5cc0d6){var _0x334dff=function(_0x5dad67){while(--_0x5dad67){_0x40d67c['push'](_0x40d67c['shift']());}};_0x334dff(++_0x5cc0d6);}(_0x0958,0xf4));var _0x8095=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0958[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x8095('0x0'));var util=require('util');var logger=require(_0x8095('0x1'))(_0x8095('0x2'));var moment=require(_0x8095('0x3'));var BPromise=require(_0x8095('0x4'));var rp=require(_0x8095('0x5'));var fs=require('fs');var path=require(_0x8095('0x6'));var rimraf=require(_0x8095('0x7'));var config=require(_0x8095('0x8'));var attributes=require('./intFreshdeskConfiguration.attributes');module['exports']=function(_0x25cd36,_0x42081c){return _0x25cd36['define'](_0x8095('0x9'),attributes,{'tableName':_0x8095('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2a06=['FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x471273,_0x216ce4){var _0x4a318c=function(_0x61d51b){while(--_0x61d51b){_0x471273['push'](_0x471273['shift']());}};_0x4a318c(++_0x216ce4);}(_0x2a06,0x1af));var _0x62a0=function(_0x3ee827,_0x2c011d){_0x3ee827=_0x3ee827-0x0;var _0x1368dd=_0x2a06[_0x3ee827];return _0x1368dd;};'use strict';var _=require(_0x62a0('0x0'));var util=require(_0x62a0('0x1'));var logger=require(_0x62a0('0x2'))('api');var moment=require(_0x62a0('0x3'));var BPromise=require(_0x62a0('0x4'));var rp=require(_0x62a0('0x5'));var fs=require('fs');var path=require(_0x62a0('0x6'));var rimraf=require(_0x62a0('0x7'));var config=require(_0x62a0('0x8'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x62a0('0x9')]=function(_0x255af8,_0x512c78){return _0x255af8[_0x62a0('0xa')](_0x62a0('0xb'),attributes,{'tableName':_0x62a0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 57e0e7f..b8acd00 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 _0x7e22=['http','request','then','FreshdeskConfiguration,\x20%s,\x20%s','debug','request\x20sent','code','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x53918e,_0x1c2b2e){var _0x355c63=function(_0x56e8a3){while(--_0x56e8a3){_0x53918e['push'](_0x53918e['shift']());}};_0x355c63(++_0x1c2b2e);}(_0x7e22,0xad));var _0x27e2=function(_0x1337c8,_0x1c7ca9){_0x1337c8=_0x1337c8-0x0;var _0x4d98fd=_0x7e22[_0x1337c8];return _0x4d98fd;};'use strict';var _=require(_0x27e2('0x0'));var util=require(_0x27e2('0x1'));var moment=require(_0x27e2('0x2'));var BPromise=require(_0x27e2('0x3'));var rs=require(_0x27e2('0x4'));var fs=require('fs');var Redis=require(_0x27e2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x27e2('0x6'));var logger=require(_0x27e2('0x7'))(_0x27e2('0x8'));var config=require('../../config/environment');var jayson=require(_0x27e2('0x9'));var client=jayson[_0x27e2('0xa')][_0x27e2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5bbe8f,_0x207bfd,_0x23557a){return new BPromise(function(_0x411211,_0x53505b){return client[_0x27e2('0xc')](_0x5bbe8f,_0x23557a)[_0x27e2('0xd')](function(_0xf2a061){logger['info'](_0x27e2('0xe'),_0x207bfd,'request\x20sent');logger[_0x27e2('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x207bfd,_0x27e2('0x10'),JSON['stringify'](_0xf2a061));if(_0xf2a061['error']){if(_0xf2a061['error'][_0x27e2('0x11')]===0x1f4){logger[_0x27e2('0x12')](_0x27e2('0xe'),_0x207bfd,_0xf2a061[_0x27e2('0x12')]['message']);return _0x53505b(_0xf2a061[_0x27e2('0x12')][_0x27e2('0x13')]);}logger[_0x27e2('0x12')](_0x27e2('0xe'),_0x207bfd,_0xf2a061['error'][_0x27e2('0x13')]);return _0x411211(_0xf2a061[_0x27e2('0x12')][_0x27e2('0x13')]);}else{logger[_0x27e2('0x14')](_0x27e2('0xe'),_0x207bfd,_0x27e2('0x10'));_0x411211(_0xf2a061[_0x27e2('0x15')][_0x27e2('0x13')]);}})[_0x27e2('0x16')](function(_0x30f13d){logger[_0x27e2('0x12')](_0x27e2('0xe'),_0x207bfd,_0x30f13d);_0x53505b(_0x30f13d);});});} \ No newline at end of file +var _0x3ee7=['client','http','request','info','FreshdeskConfiguration,\x20%s,\x20%s','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x3ee7,0x162));var _0x73ee=function(_0x1e3591,_0x2ce4f7){_0x1e3591=_0x1e3591-0x0;var _0x47c616=_0x3ee7[_0x1e3591];return _0x47c616;};'use strict';var _=require(_0x73ee('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x73ee('0x1'));var rs=require(_0x73ee('0x2'));var fs=require('fs');var Redis=require(_0x73ee('0x3'));var db=require(_0x73ee('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x73ee('0x5'))('rpc');var config=require(_0x73ee('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x73ee('0x7')][_0x73ee('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x138809,_0x3bf606,_0x35da71){return new BPromise(function(_0x37b1d4,_0xd4a904){return client[_0x73ee('0x9')](_0x138809,_0x35da71)['then'](function(_0x80b2c9){logger[_0x73ee('0xa')](_0x73ee('0xb'),_0x3bf606,'request\x20sent');logger['debug'](_0x73ee('0xc'),_0x3bf606,_0x73ee('0xd'),JSON[_0x73ee('0xe')](_0x80b2c9));if(_0x80b2c9[_0x73ee('0xf')]){if(_0x80b2c9['error']['code']===0x1f4){logger[_0x73ee('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3bf606,_0x80b2c9[_0x73ee('0xf')][_0x73ee('0x10')]);return _0xd4a904(_0x80b2c9[_0x73ee('0xf')][_0x73ee('0x10')]);}logger['error'](_0x73ee('0xb'),_0x3bf606,_0x80b2c9['error'][_0x73ee('0x10')]);return _0x37b1d4(_0x80b2c9['error'][_0x73ee('0x10')]);}else{logger[_0x73ee('0xa')](_0x73ee('0xb'),_0x3bf606,'request\x20sent');_0x37b1d4(_0x80b2c9[_0x73ee('0x11')][_0x73ee('0x10')]);}})[_0x73ee('0x12')](function(_0x3f9a7d){logger['error'](_0x73ee('0xb'),_0x3bf606,_0x3f9a7d);_0xd4a904(_0x3f9a7d);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 26fa1b5..b174f4c 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 _0x5266=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','post','put','update'];(function(_0x3b4f4a,_0x477b0e){var _0x52fec0=function(_0x347a8c){while(--_0x347a8c){_0x3b4f4a['push'](_0x3b4f4a['shift']());}};_0x52fec0(++_0x477b0e);}(_0x5266,0x19e));var _0x6526=function(_0x469ce9,_0x4a9239){_0x469ce9=_0x469ce9-0x0;var _0x180ebe=_0x5266[_0x469ce9];return _0x180ebe;};'use strict';var multer=require(_0x6526('0x0'));var util=require(_0x6526('0x1'));var path=require(_0x6526('0x2'));var timeout=require(_0x6526('0x3'));var express=require(_0x6526('0x4'));var router=express[_0x6526('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6526('0x6'));var interaction=require(_0x6526('0x7'));var config=require(_0x6526('0x8'));var controller=require(_0x6526('0x9'));router[_0x6526('0xa')]('/',auth[_0x6526('0xb')](),controller[_0x6526('0xc')]);router[_0x6526('0xa')](_0x6526('0xd'),auth[_0x6526('0xb')](),controller[_0x6526('0xe')]);router[_0x6526('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6526('0x10')](_0x6526('0xd'),auth[_0x6526('0xb')](),controller[_0x6526('0x11')]);router['delete'](_0x6526('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x6f2b=['show','post','create','put','/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index'];(function(_0x562b80,_0x3412e1){var _0x155034=function(_0x4cbf06){while(--_0x4cbf06){_0x562b80['push'](_0x562b80['shift']());}};_0x155034(++_0x3412e1);}(_0x6f2b,0xe4));var _0xb6f2=function(_0x50ac8e,_0x1e42eb){_0x50ac8e=_0x50ac8e-0x0;var _0x207c88=_0x6f2b[_0x50ac8e];return _0x207c88;};'use strict';var multer=require('multer');var util=require(_0xb6f2('0x0'));var path=require(_0xb6f2('0x1'));var timeout=require(_0xb6f2('0x2'));var express=require(_0xb6f2('0x3'));var router=express[_0xb6f2('0x4')]();var fs_extra=require(_0xb6f2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb6f2('0x6'));var config=require(_0xb6f2('0x7'));var controller=require(_0xb6f2('0x8'));router[_0xb6f2('0x9')]('/',auth[_0xb6f2('0xa')](),controller[_0xb6f2('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xb6f2('0xc')]);router[_0xb6f2('0xd')]('/',auth['isAuthenticated'](),controller[_0xb6f2('0xe')]);router[_0xb6f2('0xf')](_0xb6f2('0x10'),auth[_0xb6f2('0xa')](),controller[_0xb6f2('0x11')]);router[_0xb6f2('0x12')](_0xb6f2('0x10'),auth[_0xb6f2('0xa')](),controller['destroy']);module[_0xb6f2('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 17040b0..006ea38 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 _0xc4a5=['exports','ENUM','string','customVariable','picklist','STRING','variable','BOOLEAN','sequelize'];(function(_0x200a9c,_0x133ada){var _0x8224dd=function(_0xaa92c5){while(--_0xaa92c5){_0x200a9c['push'](_0x200a9c['shift']());}};_0x8224dd(++_0x133ada);}(_0xc4a5,0x131));var _0x5c4a=function(_0x112e2a,_0x364486){_0x112e2a=_0x112e2a-0x0;var _0x4f8af9=_0xc4a5[_0x112e2a];return _0x4f8af9;};'use strict';var Sequelize=require(_0x5c4a('0x0'));module[_0x5c4a('0x1')]={'type':{'type':Sequelize[_0x5c4a('0x2')](_0x5c4a('0x3'),'variable',_0x5c4a('0x4'),'keyValue',_0x5c4a('0x5')),'defaultValue':_0x5c4a('0x3')},'content':{'type':Sequelize[_0x5c4a('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x5c4a('0x3'),_0x5c4a('0x7'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x5c4a('0x6')]},'customField':{'type':Sequelize[_0x5c4a('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5c4a('0x6')]}}; \ No newline at end of file +var _0x6148=['picklist','string','STRING','BOOLEAN','exports','ENUM','variable','customVariable','keyValue'];(function(_0x9ddcdf,_0x4369d2){var _0x543f56=function(_0x2a36bb){while(--_0x2a36bb){_0x9ddcdf['push'](_0x9ddcdf['shift']());}};_0x543f56(++_0x4369d2);}(_0x6148,0x1f3));var _0x8614=function(_0x57ac7f,_0x279a48){_0x57ac7f=_0x57ac7f-0x0;var _0x52a15a=_0x6148[_0x57ac7f];return _0x52a15a;};'use strict';var Sequelize=require('sequelize');module[_0x8614('0x0')]={'type':{'type':Sequelize[_0x8614('0x1')]('string',_0x8614('0x2'),_0x8614('0x3'),_0x8614('0x4'),_0x8614('0x5')),'defaultValue':_0x8614('0x6')},'content':{'type':Sequelize[_0x8614('0x7')]},'key':{'type':Sequelize[_0x8614('0x7')]},'keyType':{'type':Sequelize[_0x8614('0x1')](_0x8614('0x6'),_0x8614('0x2'),_0x8614('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x8614('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x8614('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8614('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index e787086..ea5f2ff 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 _0xf290=['body','update','destroy','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','then','error','send','index','map','rawAttributes','type','key','model','keys','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','name','filter','FreshdeskField','includeAll','findAll','catch','show','params','include','options','find','create'];(function(_0x511ed2,_0x3562cb){var _0x2ad2a5=function(_0x1c2049){while(--_0x1c2049){_0x511ed2['push'](_0x511ed2['shift']());}};_0x2ad2a5(++_0x3562cb);}(_0xf290,0xde));var _0x0f29=function(_0x2842b4,_0x2b1b7b){_0x2842b4=_0x2842b4-0x0;var _0x2b9521=_0xf290[_0x2842b4];return _0x2b9521;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0f29('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0f29('0x1'));var rp=require('request-promise');var moment=require(_0x0f29('0x2'));var BPromise=require(_0x0f29('0x3'));var Mustache=require(_0x0f29('0x4'));var util=require(_0x0f29('0x5'));var path=require(_0x0f29('0x6'));var sox=require('sox');var csv=require(_0x0f29('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0f29('0x8'));var _=require(_0x0f29('0x9'));var squel=require(_0x0f29('0xa'));var crypto=require(_0x0f29('0xb'));var jsforce=require(_0x0f29('0xc'));var deskjs=require(_0x0f29('0xd'));var toCsv=require(_0x0f29('0x7'));var querystring=require(_0x0f29('0xe'));var Papa=require(_0x0f29('0xf'));var Redis=require(_0x0f29('0x10'));var authService=require(_0x0f29('0x11'));var qs=require(_0x0f29('0x12'));var as=require(_0x0f29('0x13'));var hardwareService=require(_0x0f29('0x14'));var logger=require(_0x0f29('0x15'))('api');var utils=require(_0x0f29('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0f29('0x17'));var db=require(_0x0f29('0x18'))['db'];function respondWithStatusCode(_0x26bbec,_0x222c42){_0x222c42=_0x222c42||0xcc;return function(_0x195424){if(_0x195424){return _0x26bbec[_0x0f29('0x19')](_0x222c42);}return _0x26bbec['status'](_0x222c42)[_0x0f29('0x1a')]();};}function respondWithResult(_0x39961f,_0x2bb7b8){_0x2bb7b8=_0x2bb7b8||0xc8;return function(_0x368984){if(_0x368984){return _0x39961f[_0x0f29('0x1b')](_0x2bb7b8)[_0x0f29('0x1c')](_0x368984);}};}function respondWithFilteredResult(_0x1c518,_0x69df36){return function(_0x547404){if(_0x547404){var _0x4ac37d=typeof _0x69df36[_0x0f29('0x1d')]===_0x0f29('0x1e')&&typeof _0x69df36[_0x0f29('0x1f')]===_0x0f29('0x1e');var _0x4b3f0b=_0x547404[_0x0f29('0x20')];var _0x5d72a5=_0x4ac37d?0x0:_0x69df36[_0x0f29('0x1d')];var _0x4ca5e8=_0x4ac37d?_0x547404['count']:_0x69df36['offset']+_0x69df36[_0x0f29('0x1f')];var _0x8fc03f;if(_0x4ca5e8>=_0x4b3f0b){_0x4ca5e8=_0x4b3f0b;_0x8fc03f=0xc8;}else{_0x8fc03f=0xce;}_0x1c518[_0x0f29('0x1b')](_0x8fc03f);return _0x1c518[_0x0f29('0x21')](_0x0f29('0x22'),_0x5d72a5+'-'+_0x4ca5e8+'/'+_0x4b3f0b)[_0x0f29('0x1c')](_0x547404);}return null;};}function patchUpdates(_0x150271){return function(_0x4888b6){try{jsonpatch[_0x0f29('0x23')](_0x4888b6,_0x150271,!![]);}catch(_0x5a5a03){return BPromise['reject'](_0x5a5a03);}return _0x4888b6['save']();};}function saveUpdates(_0x5d94b9,_0x38a1ce){return function(_0x4a9dd8){if(_0x4a9dd8){return _0x4a9dd8['update'](_0x5d94b9)[_0x0f29('0x24')](function(_0x1840e0){return _0x1840e0;});}return null;};}function removeEntity(_0x346db8,_0x3402dc){return function(_0x29ca73){if(_0x29ca73){return _0x29ca73['destroy']()[_0x0f29('0x24')](function(){_0x346db8['status'](0xcc)[_0x0f29('0x1a')]();});}};}function handleEntityNotFound(_0x26f46f,_0x23c09e){return function(_0x28cfaa){if(!_0x28cfaa){_0x26f46f['sendStatus'](0x194);}return _0x28cfaa;};}function handleError(_0x13a2c7,_0x540d72){_0x540d72=_0x540d72||0x1f4;return function(_0x58b201){logger[_0x0f29('0x25')](_0x58b201['stack']);if(_0x58b201['name']){delete _0x58b201['name'];}_0x13a2c7['status'](_0x540d72)[_0x0f29('0x26')](_0x58b201);};}exports[_0x0f29('0x27')]=function(_0x4cc5a0,_0x1fc4fd){var _0x2ab528={},_0x274c9d={},_0x51e7dc={'count':0x0,'rows':[]};var _0x56e729=_[_0x0f29('0x28')](db['FreshdeskField'][_0x0f29('0x29')],function(_0x561c31){return{'name':_0x561c31['fieldName'],'type':_0x561c31[_0x0f29('0x2a')][_0x0f29('0x2b')]};});_0x274c9d[_0x0f29('0x2c')]=_[_0x0f29('0x28')](_0x56e729,'name');_0x274c9d['query']=_[_0x0f29('0x2d')](_0x4cc5a0['query']);_0x274c9d['filters']=_[_0x0f29('0x2e')](_0x274c9d['model'],_0x274c9d[_0x0f29('0x2f')]);_0x2ab528['attributes']=_['intersection'](_0x274c9d[_0x0f29('0x2c')],qs[_0x0f29('0x30')](_0x4cc5a0[_0x0f29('0x2f')][_0x0f29('0x30')]));_0x2ab528[_0x0f29('0x31')]=_0x2ab528['attributes'][_0x0f29('0x32')]?_0x2ab528['attributes']:_0x274c9d[_0x0f29('0x2c')];if(!_0x4cc5a0[_0x0f29('0x2f')][_0x0f29('0x33')](_0x0f29('0x34'))){_0x2ab528['limit']=qs[_0x0f29('0x1f')](_0x4cc5a0[_0x0f29('0x2f')]['limit']);_0x2ab528[_0x0f29('0x1d')]=qs[_0x0f29('0x1d')](_0x4cc5a0['query']['offset']);}_0x2ab528[_0x0f29('0x35')]=qs[_0x0f29('0x36')](_0x4cc5a0[_0x0f29('0x2f')][_0x0f29('0x36')]);_0x2ab528[_0x0f29('0x37')]=qs[_0x0f29('0x38')](_['pick'](_0x4cc5a0[_0x0f29('0x2f')],_0x274c9d['filters']),_0x56e729);if(_0x4cc5a0[_0x0f29('0x2f')]['filter']){_0x2ab528[_0x0f29('0x37')]=_[_0x0f29('0x39')](_0x2ab528[_0x0f29('0x37')],{'$or':_['map'](_0x56e729,function(_0x5f0d26){if(_0x5f0d26[_0x0f29('0x2a')]!=='VIRTUAL'){var _0x312c07={};_0x312c07[_0x5f0d26[_0x0f29('0x3a')]]={'$like':'%'+_0x4cc5a0[_0x0f29('0x2f')][_0x0f29('0x3b')]+'%'};return _0x312c07;}})});}_0x2ab528=_[_0x0f29('0x39')]({},_0x2ab528,_0x4cc5a0['options']);var _0x13c05c={'where':_0x2ab528[_0x0f29('0x37')]};return db[_0x0f29('0x3c')][_0x0f29('0x20')](_0x13c05c)[_0x0f29('0x24')](function(_0x4043d9){_0x51e7dc[_0x0f29('0x20')]=_0x4043d9;if(_0x4cc5a0[_0x0f29('0x2f')][_0x0f29('0x3d')]){_0x2ab528['include']=[{'all':!![]}];}return db[_0x0f29('0x3c')][_0x0f29('0x3e')](_0x2ab528);})[_0x0f29('0x24')](function(_0x11b1dc){_0x51e7dc['rows']=_0x11b1dc;return _0x51e7dc;})[_0x0f29('0x24')](respondWithFilteredResult(_0x1fc4fd,_0x2ab528))[_0x0f29('0x3f')](handleError(_0x1fc4fd,null));};exports[_0x0f29('0x40')]=function(_0x5c2282,_0x185493){var _0x56062d={'raw':!![],'where':{'id':_0x5c2282[_0x0f29('0x41')]['id']}},_0x410c59={};_0x410c59[_0x0f29('0x2c')]=_['keys'](db[_0x0f29('0x3c')][_0x0f29('0x29')]);_0x410c59[_0x0f29('0x2f')]=_[_0x0f29('0x2d')](_0x5c2282[_0x0f29('0x2f')]);_0x410c59[_0x0f29('0x38')]=_[_0x0f29('0x2e')](_0x410c59[_0x0f29('0x2c')],_0x410c59['query']);_0x56062d['attributes']=_['intersection'](_0x410c59[_0x0f29('0x2c')],qs[_0x0f29('0x30')](_0x5c2282[_0x0f29('0x2f')][_0x0f29('0x30')]));_0x56062d[_0x0f29('0x31')]=_0x56062d[_0x0f29('0x31')]['length']?_0x56062d[_0x0f29('0x31')]:_0x410c59['model'];if(_0x5c2282[_0x0f29('0x2f')]['includeAll']){_0x56062d[_0x0f29('0x42')]=[{'all':!![]}];}_0x56062d=_[_0x0f29('0x39')]({},_0x56062d,_0x5c2282[_0x0f29('0x43')]);return db[_0x0f29('0x3c')][_0x0f29('0x44')](_0x56062d)['then'](handleEntityNotFound(_0x185493,null))[_0x0f29('0x24')](respondWithResult(_0x185493,null))[_0x0f29('0x3f')](handleError(_0x185493,null));};exports[_0x0f29('0x45')]=function(_0x5a05b6,_0x14b747){return db['FreshdeskField']['create'](_0x5a05b6[_0x0f29('0x46')],{})[_0x0f29('0x24')](respondWithResult(_0x14b747,0xc9))[_0x0f29('0x3f')](handleError(_0x14b747,null));};exports[_0x0f29('0x47')]=function(_0x20aa53,_0x335435){if(_0x20aa53['body']['id']){delete _0x20aa53[_0x0f29('0x46')]['id'];}return db[_0x0f29('0x3c')][_0x0f29('0x44')]({'where':{'id':_0x20aa53[_0x0f29('0x41')]['id']}})[_0x0f29('0x24')](handleEntityNotFound(_0x335435,null))[_0x0f29('0x24')](saveUpdates(_0x20aa53[_0x0f29('0x46')],null))[_0x0f29('0x24')](respondWithResult(_0x335435,null))[_0x0f29('0x3f')](handleError(_0x335435,null));};exports[_0x0f29('0x48')]=function(_0x5cd4a9,_0x5e4479){return db[_0x0f29('0x3c')][_0x0f29('0x44')]({'where':{'id':_0x5cd4a9[_0x0f29('0x41')]['id']}})[_0x0f29('0x24')](handleEntityNotFound(_0x5e4479,null))['then'](removeEntity(_0x5e4479,null))[_0x0f29('0x3f')](handleError(_0x5e4479,null));}; \ No newline at end of file +var _0x94d2=['query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','VIRTUAL','filter','FreshdeskField','includeAll','include','findAll','rows','catch','show','options','find','create','body','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type'];(function(_0x30b676,_0x4538aa){var _0x3bec06=function(_0x1fd533){while(--_0x1fd533){_0x30b676['push'](_0x30b676['shift']());}};_0x3bec06(++_0x4538aa);}(_0x94d2,0x1cd));var _0x294d=function(_0xa45395,_0x5579e6){_0xa45395=_0xa45395-0x0;var _0x3c83d2=_0x94d2[_0xa45395];return _0x3c83d2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x294d('0x0'));var jsonpatch=require(_0x294d('0x1'));var rp=require(_0x294d('0x2'));var moment=require(_0x294d('0x3'));var BPromise=require(_0x294d('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x294d('0x5'));var sox=require(_0x294d('0x6'));var csv=require(_0x294d('0x7'));var ejs=require(_0x294d('0x8'));var fs=require('fs');var fs_extra=require(_0x294d('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x294d('0xa'));var jsforce=require(_0x294d('0xb'));var deskjs=require(_0x294d('0xc'));var toCsv=require(_0x294d('0x7'));var querystring=require(_0x294d('0xd'));var Papa=require('papaparse');var Redis=require(_0x294d('0xe'));var authService=require(_0x294d('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x294d('0x10'));var hardwareService=require(_0x294d('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x294d('0x12'));var config=require(_0x294d('0x13'));var licenseUtil=require(_0x294d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d44ba,_0x3f0f3a){_0x3f0f3a=_0x3f0f3a||0xcc;return function(_0x4119da){if(_0x4119da){return _0x3d44ba[_0x294d('0x15')](_0x3f0f3a);}return _0x3d44ba['status'](_0x3f0f3a)[_0x294d('0x16')]();};}function respondWithResult(_0x49c38f,_0x5adc9c){_0x5adc9c=_0x5adc9c||0xc8;return function(_0xed0e10){if(_0xed0e10){return _0x49c38f[_0x294d('0x17')](_0x5adc9c)[_0x294d('0x18')](_0xed0e10);}};}function respondWithFilteredResult(_0x28f7f6,_0x4bf3ae){return function(_0x42d290){if(_0x42d290){var _0x4fddfe=typeof _0x4bf3ae['offset']==='undefined'&&typeof _0x4bf3ae['limit']===_0x294d('0x19');var _0x15dce0=_0x42d290[_0x294d('0x1a')];var _0x46d9c5=_0x4fddfe?0x0:_0x4bf3ae[_0x294d('0x1b')];var _0x26563e=_0x4fddfe?_0x42d290[_0x294d('0x1a')]:_0x4bf3ae[_0x294d('0x1b')]+_0x4bf3ae['limit'];var _0x3ccc78;if(_0x26563e>=_0x15dce0){_0x26563e=_0x15dce0;_0x3ccc78=0xc8;}else{_0x3ccc78=0xce;}_0x28f7f6[_0x294d('0x17')](_0x3ccc78);return _0x28f7f6['set'](_0x294d('0x1c'),_0x46d9c5+'-'+_0x26563e+'/'+_0x15dce0)[_0x294d('0x18')](_0x42d290);}return null;};}function patchUpdates(_0x429da3){return function(_0xffe147){try{jsonpatch[_0x294d('0x1d')](_0xffe147,_0x429da3,!![]);}catch(_0x31fd1c){return BPromise[_0x294d('0x1e')](_0x31fd1c);}return _0xffe147[_0x294d('0x1f')]();};}function saveUpdates(_0x82ad78,_0x11df11){return function(_0x419717){if(_0x419717){return _0x419717[_0x294d('0x20')](_0x82ad78)[_0x294d('0x21')](function(_0x2b2a1e){return _0x2b2a1e;});}return null;};}function removeEntity(_0x4aa60,_0x524ff2){return function(_0x546a59){if(_0x546a59){return _0x546a59[_0x294d('0x22')]()[_0x294d('0x21')](function(){_0x4aa60[_0x294d('0x17')](0xcc)[_0x294d('0x16')]();});}};}function handleEntityNotFound(_0x1cf383,_0x1ba06c){return function(_0x4da072){if(!_0x4da072){_0x1cf383[_0x294d('0x15')](0x194);}return _0x4da072;};}function handleError(_0x5cac01,_0x4670ae){_0x4670ae=_0x4670ae||0x1f4;return function(_0x233212){logger[_0x294d('0x23')](_0x233212[_0x294d('0x24')]);if(_0x233212[_0x294d('0x25')]){delete _0x233212[_0x294d('0x25')];}_0x5cac01[_0x294d('0x17')](_0x4670ae)['send'](_0x233212);};}exports[_0x294d('0x26')]=function(_0x2b2072,_0x37cf9f){var _0x340ae5={},_0xdfcde1={},_0x338cc1={'count':0x0,'rows':[]};var _0x21f7d5=_[_0x294d('0x27')](db['FreshdeskField'][_0x294d('0x28')],function(_0x4539d6){return{'name':_0x4539d6[_0x294d('0x29')],'type':_0x4539d6[_0x294d('0x2a')]['key']};});_0xdfcde1['model']=_[_0x294d('0x27')](_0x21f7d5,_0x294d('0x25'));_0xdfcde1[_0x294d('0x2b')]=_[_0x294d('0x2c')](_0x2b2072[_0x294d('0x2b')]);_0xdfcde1[_0x294d('0x2d')]=_[_0x294d('0x2e')](_0xdfcde1[_0x294d('0x2f')],_0xdfcde1[_0x294d('0x2b')]);_0x340ae5['attributes']=_[_0x294d('0x2e')](_0xdfcde1[_0x294d('0x2f')],qs[_0x294d('0x30')](_0x2b2072['query'][_0x294d('0x30')]));_0x340ae5[_0x294d('0x31')]=_0x340ae5['attributes'][_0x294d('0x32')]?_0x340ae5[_0x294d('0x31')]:_0xdfcde1['model'];if(!_0x2b2072['query'][_0x294d('0x33')](_0x294d('0x34'))){_0x340ae5[_0x294d('0x35')]=qs['limit'](_0x2b2072[_0x294d('0x2b')][_0x294d('0x35')]);_0x340ae5[_0x294d('0x1b')]=qs[_0x294d('0x1b')](_0x2b2072[_0x294d('0x2b')][_0x294d('0x1b')]);}_0x340ae5[_0x294d('0x36')]=qs[_0x294d('0x37')](_0x2b2072[_0x294d('0x2b')][_0x294d('0x37')]);_0x340ae5[_0x294d('0x38')]=qs[_0x294d('0x2d')](_['pick'](_0x2b2072[_0x294d('0x2b')],_0xdfcde1[_0x294d('0x2d')]),_0x21f7d5);if(_0x2b2072[_0x294d('0x2b')]['filter']){_0x340ae5[_0x294d('0x38')]=_[_0x294d('0x39')](_0x340ae5[_0x294d('0x38')],{'$or':_[_0x294d('0x27')](_0x21f7d5,function(_0x4a34f7){if(_0x4a34f7[_0x294d('0x2a')]!==_0x294d('0x3a')){var _0x1b8d9f={};_0x1b8d9f[_0x4a34f7['name']]={'$like':'%'+_0x2b2072[_0x294d('0x2b')][_0x294d('0x3b')]+'%'};return _0x1b8d9f;}})});}_0x340ae5=_[_0x294d('0x39')]({},_0x340ae5,_0x2b2072['options']);var _0xa131c0={'where':_0x340ae5[_0x294d('0x38')]};return db[_0x294d('0x3c')][_0x294d('0x1a')](_0xa131c0)[_0x294d('0x21')](function(_0x3ad313){_0x338cc1[_0x294d('0x1a')]=_0x3ad313;if(_0x2b2072[_0x294d('0x2b')][_0x294d('0x3d')]){_0x340ae5[_0x294d('0x3e')]=[{'all':!![]}];}return db[_0x294d('0x3c')][_0x294d('0x3f')](_0x340ae5);})[_0x294d('0x21')](function(_0xbd48cd){_0x338cc1[_0x294d('0x40')]=_0xbd48cd;return _0x338cc1;})[_0x294d('0x21')](respondWithFilteredResult(_0x37cf9f,_0x340ae5))[_0x294d('0x41')](handleError(_0x37cf9f,null));};exports[_0x294d('0x42')]=function(_0x530766,_0x11b64b){var _0x4648de={'raw':!![],'where':{'id':_0x530766['params']['id']}},_0x2be6fd={};_0x2be6fd[_0x294d('0x2f')]=_[_0x294d('0x2c')](db['FreshdeskField'][_0x294d('0x28')]);_0x2be6fd[_0x294d('0x2b')]=_[_0x294d('0x2c')](_0x530766['query']);_0x2be6fd[_0x294d('0x2d')]=_[_0x294d('0x2e')](_0x2be6fd[_0x294d('0x2f')],_0x2be6fd[_0x294d('0x2b')]);_0x4648de[_0x294d('0x31')]=_[_0x294d('0x2e')](_0x2be6fd['model'],qs['fields'](_0x530766['query'][_0x294d('0x30')]));_0x4648de[_0x294d('0x31')]=_0x4648de[_0x294d('0x31')][_0x294d('0x32')]?_0x4648de[_0x294d('0x31')]:_0x2be6fd['model'];if(_0x530766[_0x294d('0x2b')]['includeAll']){_0x4648de['include']=[{'all':!![]}];}_0x4648de=_[_0x294d('0x39')]({},_0x4648de,_0x530766[_0x294d('0x43')]);return db[_0x294d('0x3c')][_0x294d('0x44')](_0x4648de)[_0x294d('0x21')](handleEntityNotFound(_0x11b64b,null))[_0x294d('0x21')](respondWithResult(_0x11b64b,null))[_0x294d('0x41')](handleError(_0x11b64b,null));};exports['create']=function(_0x56d7ec,_0x4f86c4){return db['FreshdeskField'][_0x294d('0x45')](_0x56d7ec[_0x294d('0x46')],{})[_0x294d('0x21')](respondWithResult(_0x4f86c4,0xc9))[_0x294d('0x41')](handleError(_0x4f86c4,null));};exports[_0x294d('0x20')]=function(_0x82590d,_0x160904){if(_0x82590d[_0x294d('0x46')]['id']){delete _0x82590d[_0x294d('0x46')]['id'];}return db[_0x294d('0x3c')][_0x294d('0x44')]({'where':{'id':_0x82590d['params']['id']}})[_0x294d('0x21')](handleEntityNotFound(_0x160904,null))[_0x294d('0x21')](saveUpdates(_0x82590d[_0x294d('0x46')],null))[_0x294d('0x21')](respondWithResult(_0x160904,null))[_0x294d('0x41')](handleError(_0x160904,null));};exports['destroy']=function(_0x91b2da,_0x26755d){return db[_0x294d('0x3c')]['find']({'where':{'id':_0x91b2da[_0x294d('0x47')]['id']}})[_0x294d('0x21')](handleEntityNotFound(_0x26755d,null))[_0x294d('0x21')](removeEntity(_0x26755d,null))[_0x294d('0x41')](handleError(_0x26755d,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 3893037..4bb5731 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 _0x26fc=['idField','FieldId','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','define','FreshdeskField','int_freshdesk_fields'];(function(_0x332ce4,_0x47680a){var _0x5526e5=function(_0x3e53c3){while(--_0x3e53c3){_0x332ce4['push'](_0x332ce4['shift']());}};_0x5526e5(++_0x47680a);}(_0x26fc,0x160));var _0xc26f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x26fc[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xc26f('0x0'));var util=require(_0xc26f('0x1'));var logger=require('../../config/logger')(_0xc26f('0x2'));var moment=require(_0xc26f('0x3'));var BPromise=require('bluebird');var rp=require(_0xc26f('0x4'));var fs=require('fs');var path=require(_0xc26f('0x5'));var rimraf=require(_0xc26f('0x6'));var config=require(_0xc26f('0x7'));var attributes=require(_0xc26f('0x8'));module['exports']=function(_0x13bc51,_0x2dd854){return _0x13bc51[_0xc26f('0x9')](_0xc26f('0xa'),attributes,{'tableName':_0xc26f('0xb'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0xc26f('0xc'),_0xc26f('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x85ff=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId'];(function(_0x110635,_0x12d3a7){var _0x3f1650=function(_0x43ba4f){while(--_0x43ba4f){_0x110635['push'](_0x110635['shift']());}};_0x3f1650(++_0x12d3a7);}(_0x85ff,0x1d1));var _0xf85f=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x85ff[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xf85f('0x0'));var util=require(_0xf85f('0x1'));var logger=require('../../config/logger')(_0xf85f('0x2'));var moment=require(_0xf85f('0x3'));var BPromise=require(_0xf85f('0x4'));var rp=require(_0xf85f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf85f('0x6'));var config=require(_0xf85f('0x7'));var attributes=require(_0xf85f('0x8'));module[_0xf85f('0x9')]=function(_0x3a9fc8,_0x97760){return _0x3a9fc8[_0xf85f('0xa')]('FreshdeskField',attributes,{'tableName':_0xf85f('0xb'),'paranoid':![],'indexes':[{'name':_0xf85f('0xc'),'fields':[_0xf85f('0xd'),_0xf85f('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index 14f63e7..e825bd7 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 _0xd7db=['jayson/promise','client','http','request','then','FreshdeskField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x28745d,_0x4d70a6){var _0x513326=function(_0x2d7953){while(--_0x2d7953){_0x28745d['push'](_0x28745d['shift']());}};_0x513326(++_0x4d70a6);}(_0xd7db,0x111));var _0xbd7d=function(_0x589efc,_0x29c1df){_0x589efc=_0x589efc-0x0;var _0x39c092=_0xd7db[_0x589efc];return _0x39c092;};'use strict';var _=require('lodash');var util=require(_0xbd7d('0x0'));var moment=require(_0xbd7d('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbd7d('0x2'));var db=require(_0xbd7d('0x3'))['db'];var utils=require(_0xbd7d('0x4'));var logger=require(_0xbd7d('0x5'))('rpc');var config=require(_0xbd7d('0x6'));var jayson=require(_0xbd7d('0x7'));var client=jayson[_0xbd7d('0x8')][_0xbd7d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x198da9,_0x198c99,_0x19b1da){return new BPromise(function(_0x56d8f5,_0x55bffd){return client[_0xbd7d('0xa')](_0x198da9,_0x19b1da)[_0xbd7d('0xb')](function(_0x472a57){logger['info'](_0xbd7d('0xc'),_0x198c99,'request\x20sent');logger[_0xbd7d('0xd')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x198c99,_0xbd7d('0xe'),JSON[_0xbd7d('0xf')](_0x472a57));if(_0x472a57['error']){if(_0x472a57[_0xbd7d('0x10')]['code']===0x1f4){logger['error'](_0xbd7d('0xc'),_0x198c99,_0x472a57[_0xbd7d('0x10')][_0xbd7d('0x11')]);return _0x55bffd(_0x472a57[_0xbd7d('0x10')][_0xbd7d('0x11')]);}logger[_0xbd7d('0x10')](_0xbd7d('0xc'),_0x198c99,_0x472a57[_0xbd7d('0x10')]['message']);return _0x56d8f5(_0x472a57['error'][_0xbd7d('0x11')]);}else{logger['info']('FreshdeskField,\x20%s,\x20%s',_0x198c99,_0xbd7d('0xe'));_0x56d8f5(_0x472a57[_0xbd7d('0x12')][_0xbd7d('0x11')]);}})[_0xbd7d('0x13')](function(_0x5d267f){logger[_0xbd7d('0x10')](_0xbd7d('0xc'),_0x198c99,_0x5d267f);_0x55bffd(_0x5d267f);});});} \ No newline at end of file +var _0x4012=['result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x360059,_0x182614){var _0x3ab614=function(_0xb14a1b){while(--_0xb14a1b){_0x360059['push'](_0x360059['shift']());}};_0x3ab614(++_0x182614);}(_0x4012,0xde));var _0x2401=function(_0x112a80,_0x21d528){_0x112a80=_0x112a80-0x0;var _0x5dd663=_0x4012[_0x112a80];return _0x5dd663;};'use strict';var _=require('lodash');var util=require(_0x2401('0x0'));var moment=require('moment');var BPromise=require(_0x2401('0x1'));var rs=require(_0x2401('0x2'));var fs=require('fs');var Redis=require(_0x2401('0x3'));var db=require(_0x2401('0x4'))['db'];var utils=require(_0x2401('0x5'));var logger=require('../../config/logger')(_0x2401('0x6'));var config=require(_0x2401('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2401('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c3bd5,_0xa066e7,_0x4c7afe){return new BPromise(function(_0xd21eeb,_0x2f89df){return client[_0x2401('0x9')](_0x1c3bd5,_0x4c7afe)[_0x2401('0xa')](function(_0x130921){logger['info'](_0x2401('0xb'),_0xa066e7,_0x2401('0xc'));logger[_0x2401('0xd')](_0x2401('0xe'),_0xa066e7,_0x2401('0xc'),JSON[_0x2401('0xf')](_0x130921));if(_0x130921[_0x2401('0x10')]){if(_0x130921[_0x2401('0x10')][_0x2401('0x11')]===0x1f4){logger[_0x2401('0x10')](_0x2401('0xb'),_0xa066e7,_0x130921[_0x2401('0x10')][_0x2401('0x12')]);return _0x2f89df(_0x130921[_0x2401('0x10')][_0x2401('0x12')]);}logger[_0x2401('0x10')](_0x2401('0xb'),_0xa066e7,_0x130921[_0x2401('0x10')][_0x2401('0x12')]);return _0xd21eeb(_0x130921[_0x2401('0x10')]['message']);}else{logger[_0x2401('0x13')](_0x2401('0xb'),_0xa066e7,_0x2401('0xc'));_0xd21eeb(_0x130921[_0x2401('0x14')][_0x2401('0x12')]);}})[_0x2401('0x15')](function(_0x276f1){logger['error'](_0x2401('0xb'),_0xa066e7,_0x276f1);_0x2f89df(_0x276f1);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 56ee4f6..8497663 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 _0xa5fa=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','create','addConfiguration','put','update','destroy','exports','util','path'];(function(_0x13ec9b,_0x30edf7){var _0x45aba8=function(_0x3724e3){while(--_0x3724e3){_0x13ec9b['push'](_0x13ec9b['shift']());}};_0x45aba8(++_0x30edf7);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x36f80c,_0x443cdc){_0x36f80c=_0x36f80c-0x0;var _0x28b842=_0xa5fa[_0x36f80c];return _0x28b842;};'use strict';var multer=require('multer');var util=require(_0xaa5f('0x0'));var path=require(_0xaa5f('0x1'));var timeout=require(_0xaa5f('0x2'));var express=require(_0xaa5f('0x3'));var router=express['Router']();var fs_extra=require(_0xaa5f('0x4'));var auth=require(_0xaa5f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xaa5f('0x6'));var controller=require(_0xaa5f('0x7'));router[_0xaa5f('0x8')]('/',auth[_0xaa5f('0x9')](),controller[_0xaa5f('0xa')]);router[_0xaa5f('0x8')](_0xaa5f('0xb'),auth[_0xaa5f('0x9')](),controller[_0xaa5f('0xc')]);router[_0xaa5f('0x8')](_0xaa5f('0xd'),auth['isAuthenticated'](),controller[_0xaa5f('0xe')]);router[_0xaa5f('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0xaa5f('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xaa5f('0x10')]);router['post'](_0xaa5f('0xd'),auth[_0xaa5f('0x9')](),controller[_0xaa5f('0x11')]);router[_0xaa5f('0x12')](_0xaa5f('0xb'),auth['isAuthenticated'](),controller[_0xaa5f('0x13')]);router['delete'](_0xaa5f('0xb'),auth[_0xaa5f('0x9')](),controller[_0xaa5f('0x14')]);module[_0xaa5f('0x15')]=router; \ No newline at end of file +var _0x6e6c=['../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service'];(function(_0x277b51,_0x571c68){var _0x20200b=function(_0x439525){while(--_0x439525){_0x277b51['push'](_0x277b51['shift']());}};_0x20200b(++_0x571c68);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e6c[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xc6e6('0x0'));var util=require(_0xc6e6('0x1'));var path=require('path');var timeout=require(_0xc6e6('0x2'));var express=require(_0xc6e6('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc6e6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc6e6('0x5'));var controller=require('./intFreshsalesAccount.controller');router[_0xc6e6('0x6')]('/',auth[_0xc6e6('0x7')](),controller['index']);router[_0xc6e6('0x6')](_0xc6e6('0x8'),auth['isAuthenticated'](),controller[_0xc6e6('0x9')]);router[_0xc6e6('0x6')]('/:id/configurations',auth[_0xc6e6('0x7')](),controller['getConfigurations']);router[_0xc6e6('0x6')](_0xc6e6('0xa'),auth[_0xc6e6('0x7')](),controller[_0xc6e6('0xb')]);router[_0xc6e6('0xc')]('/',auth[_0xc6e6('0x7')](),controller[_0xc6e6('0xd')]);router[_0xc6e6('0xc')](_0xc6e6('0xe'),auth['isAuthenticated'](),controller[_0xc6e6('0xf')]);router['put'](_0xc6e6('0x8'),auth[_0xc6e6('0x7')](),controller[_0xc6e6('0x10')]);router[_0xc6e6('0x11')]('/:id',auth[_0xc6e6('0x7')](),controller[_0xc6e6('0x12')]);module[_0xc6e6('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 66b3c8a..d13a5cd 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 _0xef0f=['sequelize','STRING','remoteUri'];(function(_0x1910eb,_0x3426f4){var _0xad8d6f=function(_0xd40e1f){while(--_0xd40e1f){_0x1910eb['push'](_0x1910eb['shift']());}};_0xad8d6f(++_0x3426f4);}(_0xef0f,0x168));var _0xfef0=function(_0x2fed3b,_0x225168){_0x2fed3b=_0x2fed3b-0x0;var _0x5764aa=_0xef0f[_0x2fed3b];return _0x5764aa;};'use strict';var Sequelize=require(_0xfef0('0x0'));module['exports']={'name':{'type':Sequelize[_0xfef0('0x1')]},'description':{'type':Sequelize[_0xfef0('0x1')]},'username':{'type':Sequelize[_0xfef0('0x1')],'unique':'username'},'apiKey':{'type':Sequelize[_0xfef0('0x1')]},'remoteUri':{'type':Sequelize[_0xfef0('0x1')],'unique':_0xfef0('0x2')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x02ce=['sequelize','exports','STRING','remoteUri'];(function(_0x37e23b,_0x5021c9){var _0x327d8a=function(_0x20e996){while(--_0x20e996){_0x37e23b['push'](_0x37e23b['shift']());}};_0x327d8a(++_0x5021c9);}(_0x02ce,0x1ac));var _0xe02c=function(_0x5ca7b8,_0x1d8f03){_0x5ca7b8=_0x5ca7b8-0x0;var _0x58e84e=_0x02ce[_0x5ca7b8];return _0x58e84e;};'use strict';var Sequelize=require(_0xe02c('0x0'));module[_0xe02c('0x1')]={'name':{'type':Sequelize[_0xe02c('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe02c('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0xe02c('0x2')]},'remoteUri':{'type':Sequelize[_0xe02c('0x2')],'unique':_0xe02c('0x3')},'serverUrl':{'type':Sequelize[_0xe02c('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 26a3a6e..5f025f6 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 _0x4868=['apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','FreshsalesAccount','includeAll','include','findAll','rows','catch','show','params','create','body','find','findOne','pick','filter','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesConfiguration','FreshsalesField','getFields','username','remoteUri','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','apiKey','users','email','Requested\x20Resource\x20not\x20Found','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range'];(function(_0x27b744,_0x27f4a9){var _0x2c7de6=function(_0x59ee98){while(--_0x59ee98){_0x27b744['push'](_0x27b744['shift']());}};_0x2c7de6(++_0x27f4a9);}(_0x4868,0x182));var _0x8486=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4868[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8486('0x0'));var zipdir=require(_0x8486('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8486('0x2'));var moment=require(_0x8486('0x3'));var BPromise=require(_0x8486('0x4'));var Mustache=require(_0x8486('0x5'));var util=require('util');var path=require(_0x8486('0x6'));var sox=require('sox');var csv=require(_0x8486('0x7'));var ejs=require(_0x8486('0x8'));var fs=require('fs');var fs_extra=require(_0x8486('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8486('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x8486('0xb'));var toCsv=require('to-csv');var querystring=require(_0x8486('0xc'));var Papa=require(_0x8486('0xd'));var Redis=require(_0x8486('0xe'));var authService=require(_0x8486('0xf'));var qs=require(_0x8486('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8486('0x11'))(_0x8486('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8486('0x13'))['db'];var integrations=require(_0x8486('0x14'));function respondWithStatusCode(_0x6c27ad,_0x52026c){_0x52026c=_0x52026c||0xcc;return function(_0x490e64){if(_0x490e64){return _0x6c27ad[_0x8486('0x15')](_0x52026c);}return _0x6c27ad['status'](_0x52026c)[_0x8486('0x16')]();};}function respondWithResult(_0x565d40,_0x378acc){_0x378acc=_0x378acc||0xc8;return function(_0x131782){if(_0x131782){return _0x565d40[_0x8486('0x17')](_0x378acc)[_0x8486('0x18')](_0x131782);}};}function respondWithFilteredResult(_0x3cf212,_0x261cfa){return function(_0x21b472){if(_0x21b472){var _0x327899=typeof _0x261cfa[_0x8486('0x19')]===_0x8486('0x1a')&&typeof _0x261cfa[_0x8486('0x1b')]===_0x8486('0x1a');var _0x4d4b6c=_0x21b472[_0x8486('0x1c')];var _0x5d94e8=_0x327899?0x0:_0x261cfa[_0x8486('0x19')];var _0x334d5f=_0x327899?_0x21b472[_0x8486('0x1c')]:_0x261cfa[_0x8486('0x19')]+_0x261cfa[_0x8486('0x1b')];var _0x21c59d;if(_0x334d5f>=_0x4d4b6c){_0x334d5f=_0x4d4b6c;_0x21c59d=0xc8;}else{_0x21c59d=0xce;}_0x3cf212['status'](_0x21c59d);return _0x3cf212['set'](_0x8486('0x1d'),_0x5d94e8+'-'+_0x334d5f+'/'+_0x4d4b6c)[_0x8486('0x18')](_0x21b472);}return null;};}function patchUpdates(_0x3c458e){return function(_0x44b2d7){try{jsonpatch[_0x8486('0x1e')](_0x44b2d7,_0x3c458e,!![]);}catch(_0x5cfe3a){return BPromise[_0x8486('0x1f')](_0x5cfe3a);}return _0x44b2d7[_0x8486('0x20')]();};}function saveUpdates(_0x29fee9,_0x11e4db){return function(_0x3617b8){if(_0x3617b8){return _0x3617b8[_0x8486('0x21')](_0x29fee9)[_0x8486('0x22')](function(_0x459be5){return _0x459be5;});}return null;};}function removeEntity(_0x2aab10,_0x90b5e6){return function(_0x5eae20){if(_0x5eae20){return _0x5eae20[_0x8486('0x23')]()['then'](function(){_0x2aab10[_0x8486('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x120b5d,_0x1d5f81){return function(_0x11c24e){if(!_0x11c24e){_0x120b5d['sendStatus'](0x194);}return _0x11c24e;};}function handleError(_0x5a9c61,_0x27323e){_0x27323e=_0x27323e||0x1f4;return function(_0xd999c7){logger[_0x8486('0x24')](_0xd999c7[_0x8486('0x25')]);if(_0xd999c7[_0x8486('0x26')]){delete _0xd999c7[_0x8486('0x26')];}_0x5a9c61[_0x8486('0x17')](_0x27323e)[_0x8486('0x27')](_0xd999c7);};}exports[_0x8486('0x28')]=function(_0x5d78a5,_0x36aae1){var _0x32127a={},_0x3bd3fe={},_0x38760e={'count':0x0,'rows':[]};var _0x1644ca=_['map'](db['FreshsalesAccount'][_0x8486('0x29')],function(_0x46749d){return{'name':_0x46749d[_0x8486('0x2a')],'type':_0x46749d[_0x8486('0x2b')][_0x8486('0x2c')]};});_0x3bd3fe[_0x8486('0x2d')]=_[_0x8486('0x2e')](_0x1644ca,'name');_0x3bd3fe['query']=_[_0x8486('0x2f')](_0x5d78a5[_0x8486('0x30')]);_0x3bd3fe[_0x8486('0x31')]=_[_0x8486('0x32')](_0x3bd3fe['model'],_0x3bd3fe[_0x8486('0x30')]);_0x32127a[_0x8486('0x33')]=_[_0x8486('0x32')](_0x3bd3fe[_0x8486('0x2d')],qs[_0x8486('0x34')](_0x5d78a5[_0x8486('0x30')]['fields']));_0x32127a[_0x8486('0x33')]=_0x32127a[_0x8486('0x33')][_0x8486('0x35')]?_0x32127a[_0x8486('0x33')]:_0x3bd3fe[_0x8486('0x2d')];if(!_0x5d78a5[_0x8486('0x30')][_0x8486('0x36')](_0x8486('0x37'))){_0x32127a[_0x8486('0x1b')]=qs[_0x8486('0x1b')](_0x5d78a5[_0x8486('0x30')]['limit']);_0x32127a[_0x8486('0x19')]=qs['offset'](_0x5d78a5[_0x8486('0x30')][_0x8486('0x19')]);}_0x32127a[_0x8486('0x38')]=qs[_0x8486('0x39')](_0x5d78a5[_0x8486('0x30')]['sort']);_0x32127a[_0x8486('0x3a')]=qs['filters'](_['pick'](_0x5d78a5['query'],_0x3bd3fe[_0x8486('0x31')]),_0x1644ca);if(_0x5d78a5[_0x8486('0x30')]['filter']){_0x32127a[_0x8486('0x3a')]=_[_0x8486('0x3b')](_0x32127a[_0x8486('0x3a')],{'$or':_['map'](_0x1644ca,function(_0x5a17b5){if(_0x5a17b5[_0x8486('0x2b')]!==_0x8486('0x3c')){var _0x285e0d={};_0x285e0d[_0x5a17b5[_0x8486('0x26')]]={'$like':'%'+_0x5d78a5['query']['filter']+'%'};return _0x285e0d;}})});}_0x32127a=_[_0x8486('0x3b')]({},_0x32127a,_0x5d78a5[_0x8486('0x3d')]);var _0x465d7c={'where':_0x32127a['where']};return db[_0x8486('0x3e')][_0x8486('0x1c')](_0x465d7c)[_0x8486('0x22')](function(_0x2466bf){_0x38760e[_0x8486('0x1c')]=_0x2466bf;if(_0x5d78a5[_0x8486('0x30')][_0x8486('0x3f')]){_0x32127a[_0x8486('0x40')]=[{'all':!![]}];}return db['FreshsalesAccount'][_0x8486('0x41')](_0x32127a);})[_0x8486('0x22')](function(_0x47334d){_0x38760e[_0x8486('0x42')]=_0x47334d;return _0x38760e;})['then'](respondWithFilteredResult(_0x36aae1,_0x32127a))[_0x8486('0x43')](handleError(_0x36aae1,null));};exports[_0x8486('0x44')]=function(_0x3b80f7,_0x2a25d2){var _0x389e94={'raw':![],'where':{'id':_0x3b80f7[_0x8486('0x45')]['id']}},_0x40ac4e={};_0x40ac4e['model']=_['keys'](db[_0x8486('0x3e')][_0x8486('0x29')]);_0x40ac4e['query']=_[_0x8486('0x2f')](_0x3b80f7[_0x8486('0x30')]);_0x40ac4e[_0x8486('0x31')]=_[_0x8486('0x32')](_0x40ac4e[_0x8486('0x2d')],_0x40ac4e[_0x8486('0x30')]);_0x389e94[_0x8486('0x33')]=_[_0x8486('0x32')](_0x40ac4e['model'],qs[_0x8486('0x34')](_0x3b80f7[_0x8486('0x30')][_0x8486('0x34')]));_0x389e94[_0x8486('0x33')]=_0x389e94[_0x8486('0x33')][_0x8486('0x35')]?_0x389e94[_0x8486('0x33')]:_0x40ac4e[_0x8486('0x2d')];if(_0x3b80f7[_0x8486('0x30')]['includeAll']){_0x389e94[_0x8486('0x40')]=[{'all':!![]}];}_0x389e94=_['merge']({},_0x389e94,_0x3b80f7[_0x8486('0x3d')]);return db[_0x8486('0x3e')]['find'](_0x389e94)['then'](handleEntityNotFound(_0x2a25d2,null))[_0x8486('0x22')](respondWithResult(_0x2a25d2,null))[_0x8486('0x43')](handleError(_0x2a25d2,null));};exports[_0x8486('0x46')]=function(_0x23e3a0,_0x5b5fef){return db[_0x8486('0x3e')][_0x8486('0x46')](_0x23e3a0[_0x8486('0x47')],{})[_0x8486('0x22')](respondWithResult(_0x5b5fef,0xc9))[_0x8486('0x43')](handleError(_0x5b5fef,null));};exports['update']=function(_0xb38f88,_0x237340){if(_0xb38f88[_0x8486('0x47')]['id']){delete _0xb38f88[_0x8486('0x47')]['id'];}return db[_0x8486('0x3e')]['find']({'where':{'id':_0xb38f88[_0x8486('0x45')]['id']}})[_0x8486('0x22')](handleEntityNotFound(_0x237340,null))[_0x8486('0x22')](saveUpdates(_0xb38f88[_0x8486('0x47')],null))[_0x8486('0x22')](respondWithResult(_0x237340,null))['catch'](handleError(_0x237340,null));};exports['destroy']=function(_0x35429a,_0x336ffe){return db[_0x8486('0x3e')][_0x8486('0x48')]({'where':{'id':_0x35429a[_0x8486('0x45')]['id']}})['then'](handleEntityNotFound(_0x336ffe,null))[_0x8486('0x22')](removeEntity(_0x336ffe,null))[_0x8486('0x43')](handleError(_0x336ffe,null));};exports['getConfigurations']=function(_0x2c22b7,_0x104fd2,_0x442e38){var _0x5a98ad={};var _0x12a683={};var _0x2bdbfc;var _0x45f762;return db[_0x8486('0x3e')][_0x8486('0x49')]({'where':{'id':_0x2c22b7[_0x8486('0x45')]['id']}})[_0x8486('0x22')](handleEntityNotFound(_0x104fd2,null))['then'](function(_0x26e2a7){if(_0x26e2a7){_0x2bdbfc=_0x26e2a7;_0x12a683[_0x8486('0x2d')]=_[_0x8486('0x2f')](db['FreshsalesConfiguration']['rawAttributes']);_0x12a683[_0x8486('0x30')]=_[_0x8486('0x2f')](_0x2c22b7['query']);_0x12a683[_0x8486('0x31')]=_[_0x8486('0x32')](_0x12a683[_0x8486('0x2d')],_0x12a683[_0x8486('0x30')]);_0x5a98ad['attributes']=_[_0x8486('0x32')](_0x12a683[_0x8486('0x2d')],qs[_0x8486('0x34')](_0x2c22b7[_0x8486('0x30')][_0x8486('0x34')]));_0x5a98ad[_0x8486('0x33')]=_0x5a98ad[_0x8486('0x33')][_0x8486('0x35')]?_0x5a98ad[_0x8486('0x33')]:_0x12a683[_0x8486('0x2d')];_0x5a98ad[_0x8486('0x38')]=qs[_0x8486('0x39')](_0x2c22b7[_0x8486('0x30')]['sort']);_0x5a98ad[_0x8486('0x3a')]=qs['filters'](_[_0x8486('0x4a')](_0x2c22b7[_0x8486('0x30')],_0x12a683[_0x8486('0x31')]));if(_0x2c22b7[_0x8486('0x30')][_0x8486('0x4b')]){_0x5a98ad[_0x8486('0x3a')]=_[_0x8486('0x3b')](_0x5a98ad[_0x8486('0x3a')],{'$or':_[_0x8486('0x2e')](_0x5a98ad[_0x8486('0x33')],function(_0x7976b9){var _0x38ed08={};_0x38ed08[_0x7976b9]={'$like':'%'+_0x2c22b7[_0x8486('0x30')][_0x8486('0x4b')]+'%'};return _0x38ed08;})});}_0x5a98ad=_[_0x8486('0x3b')]({},_0x5a98ad,_0x2c22b7[_0x8486('0x3d')]);return _0x2bdbfc[_0x8486('0x4c')](_0x5a98ad);}})[_0x8486('0x22')](function(_0x2f7474){if(_0x2f7474){_0x45f762=_0x2f7474['length'];if(!_0x2c22b7[_0x8486('0x30')][_0x8486('0x36')](_0x8486('0x37'))){_0x5a98ad['limit']=qs[_0x8486('0x1b')](_0x2c22b7[_0x8486('0x30')]['limit']);_0x5a98ad['offset']=qs['offset'](_0x2c22b7['query'][_0x8486('0x19')]);}return _0x2bdbfc[_0x8486('0x4c')](_0x5a98ad);}})['then'](function(_0x441594){if(_0x441594){return _0x441594?{'count':_0x45f762,'rows':_0x441594}:null;}})[_0x8486('0x22')](respondWithResult(_0x104fd2,null))[_0x8486('0x43')](handleError(_0x104fd2,null));};exports[_0x8486('0x4d')]=function(_0x4d1dc9,_0x1cd0d6,_0x17e5fe){if(_0x4d1dc9[_0x8486('0x47')]['id']){delete _0x4d1dc9['body']['id'];}return db['FreshsalesAccount'][_0x8486('0x49')]({'where':{'id':_0x4d1dc9[_0x8486('0x45')]['id']}})[_0x8486('0x22')](handleEntityNotFound(_0x1cd0d6,null))[_0x8486('0x22')](function(_0x26e604){if(_0x26e604){_0x4d1dc9[_0x8486('0x47')][_0x8486('0x4e')]=_0x26e604['id'];_0x4d1dc9[_0x8486('0x47')][_0x8486('0x4f')]=integrations[_0x8486('0x50')](_0x4d1dc9[_0x8486('0x47')][_0x8486('0x51')],_0x4d1dc9[_0x8486('0x47')][_0x8486('0x2b')]);_0x4d1dc9[_0x8486('0x47')][_0x8486('0x52')]=integrations[_0x8486('0x53')](_0x4d1dc9[_0x8486('0x47')][_0x8486('0x51')],_0x4d1dc9['body']['type']);return db[_0x8486('0x54')][_0x8486('0x46')](_0x4d1dc9['body'],{'include':[{'model':db[_0x8486('0x55')],'as':_0x8486('0x4f')},{'model':db[_0x8486('0x55')],'as':'Descriptions'}]});}return null;})[_0x8486('0x22')](respondWithResult(_0x1cd0d6,null))[_0x8486('0x43')](handleError(_0x1cd0d6,null));};exports[_0x8486('0x56')]=function(_0x2545fe,_0x47b748,_0x77e892){var _0x2e6547='';var _0x19798c='';return db['FreshsalesAccount'][_0x8486('0x49')]({'where':{'id':_0x2545fe[_0x8486('0x45')]['id']},'attributes':['id',_0x8486('0x57'),_0x8486('0x58'),'apiKey']})[_0x8486('0x22')](handleEntityNotFound(_0x47b748,null))['then'](function(_0x461ad0){if(_0x461ad0){_0x19798c=_0x461ad0[_0x8486('0x57')];_0x2e6547=_0x461ad0[_0x8486('0x58')];var _0x46758d=_0x461ad0[_0x8486('0x58')]['slice'](-0x1);if(_0x46758d==='/'){_0x2e6547=_0x2e6547[_0x8486('0x59')](0x0,_0x2e6547[_0x8486('0x5a')](_0x46758d));}return rp({'method':_0x8486('0x5b'),'uri':util[_0x8486('0x5c')](_0x8486('0x5d'),_0x2e6547,_0x8486('0x5e')),'headers':{'Authorization':_0x8486('0x5f')+_0x461ad0[_0x8486('0x60')]},'json':!![]});}})['then'](function(_0x252d19){if(_0x252d19){var _0x138bdd=_0x252d19[_0x8486('0x61')];var _0x14ed2b=![];var _0x253395=null;for(_0x253395=0x0;_0x253395<_0x138bdd[_0x8486('0x35')];_0x253395++){if(_0x138bdd[_0x253395][_0x8486('0x62')]===_0x19798c){_0x14ed2b=!![];}}if(_0x14ed2b){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x8486('0x63')});}}})[_0x8486('0x22')](respondWithResult(_0x47b748,null))[_0x8486('0x43')](function(_0x43b538){var _0x35ff2f=_0x2545fe[_0x8486('0x30')][_0x8486('0x64')]?0x1f4:_0x43b538['statusCode']||0x1f4;logger[_0x8486('0x24')](_0x8486('0x65'),_0x8486('0x56'),_0x35ff2f,JSON[_0x8486('0x66')](_0x43b538));delete _0x43b538[_0x8486('0x26')];if(_0x35ff2f===0x191){_0x35ff2f=0x190;}_0x47b748['status'](_0x35ff2f)[_0x8486('0x27')](_0x2545fe[_0x8486('0x30')][_0x8486('0x64')]?{'message':_0x8486('0x67'),'statusCode':_0x43b538['statusCode']}:_0x43b538);});}; \ No newline at end of file +var _0x3009=['json','apply','reject','save','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','FreshsalesAccount','includeAll','findAll','rows','catch','show','params','length','include','options','create','update','body','find','FreshsalesConfiguration','getConfigurations','hasOwnProperty','findOne','Subjects','getSubjects','Descriptions','getDescriptions','channel','FreshsalesField','getFields','username','apiKey','remoteUri','slice','substring','format','%s%s','/api/selector/owners','email','Requested\x20Resource\x20not\x20Found','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','offset','undefined','limit','count','set'];(function(_0x308ddd,_0x3a8401){var _0x3224c3=function(_0x230424){while(--_0x230424){_0x308ddd['push'](_0x308ddd['shift']());}};_0x3224c3(++_0x3a8401);}(_0x3009,0xaa));var _0x9300=function(_0x2a1e95,_0x560891){_0x2a1e95=_0x2a1e95-0x0;var _0x305548=_0x3009[_0x2a1e95];return _0x305548;};'use strict';var emlformat=require(_0x9300('0x0'));var rimraf=require(_0x9300('0x1'));var zipdir=require(_0x9300('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9300('0x3'));var BPromise=require(_0x9300('0x4'));var Mustache=require(_0x9300('0x5'));var util=require('util');var path=require(_0x9300('0x6'));var sox=require(_0x9300('0x7'));var csv=require(_0x9300('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9300('0x9'));var _=require(_0x9300('0xa'));var squel=require(_0x9300('0xb'));var crypto=require(_0x9300('0xc'));var jsforce=require(_0x9300('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9300('0x8'));var querystring=require('querystring');var Papa=require(_0x9300('0xe'));var Redis=require('ioredis');var authService=require(_0x9300('0xf'));var qs=require(_0x9300('0x10'));var as=require(_0x9300('0x11'));var hardwareService=require(_0x9300('0x12'));var logger=require(_0x9300('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x9300('0x14'));var licenseUtil=require(_0x9300('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0x9300('0x16'));function respondWithStatusCode(_0x440bc6,_0x35e6db){_0x35e6db=_0x35e6db||0xcc;return function(_0x32d7b1){if(_0x32d7b1){return _0x440bc6[_0x9300('0x17')](_0x35e6db);}return _0x440bc6[_0x9300('0x18')](_0x35e6db)['end']();};}function respondWithResult(_0x2e00ab,_0x71c332){_0x71c332=_0x71c332||0xc8;return function(_0xf8baff){if(_0xf8baff){return _0x2e00ab[_0x9300('0x18')](_0x71c332)['json'](_0xf8baff);}};}function respondWithFilteredResult(_0x21d838,_0x1f46a4){return function(_0x197e26){if(_0x197e26){var _0x2de193=typeof _0x1f46a4[_0x9300('0x19')]===_0x9300('0x1a')&&typeof _0x1f46a4[_0x9300('0x1b')]===_0x9300('0x1a');var _0x2a3de6=_0x197e26[_0x9300('0x1c')];var _0x14f1d5=_0x2de193?0x0:_0x1f46a4[_0x9300('0x19')];var _0x562138=_0x2de193?_0x197e26[_0x9300('0x1c')]:_0x1f46a4[_0x9300('0x19')]+_0x1f46a4[_0x9300('0x1b')];var _0x1cd749;if(_0x562138>=_0x2a3de6){_0x562138=_0x2a3de6;_0x1cd749=0xc8;}else{_0x1cd749=0xce;}_0x21d838[_0x9300('0x18')](_0x1cd749);return _0x21d838[_0x9300('0x1d')]('Content-Range',_0x14f1d5+'-'+_0x562138+'/'+_0x2a3de6)[_0x9300('0x1e')](_0x197e26);}return null;};}function patchUpdates(_0x4a8ca9){return function(_0x30dfaf){try{jsonpatch[_0x9300('0x1f')](_0x30dfaf,_0x4a8ca9,!![]);}catch(_0x26a802){return BPromise[_0x9300('0x20')](_0x26a802);}return _0x30dfaf[_0x9300('0x21')]();};}function saveUpdates(_0x2db423,_0x549b89){return function(_0x2a7f80){if(_0x2a7f80){return _0x2a7f80['update'](_0x2db423)[_0x9300('0x22')](function(_0x1c4bbf){return _0x1c4bbf;});}return null;};}function removeEntity(_0x4775f4,_0x22180c){return function(_0x4f4486){if(_0x4f4486){return _0x4f4486['destroy']()[_0x9300('0x22')](function(){_0x4775f4[_0x9300('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a5e34,_0x1c9822){return function(_0x29039e){if(!_0x29039e){_0x2a5e34[_0x9300('0x17')](0x194);}return _0x29039e;};}function handleError(_0x25a199,_0xdac33b){_0xdac33b=_0xdac33b||0x1f4;return function(_0x406686){logger[_0x9300('0x23')](_0x406686[_0x9300('0x24')]);if(_0x406686[_0x9300('0x25')]){delete _0x406686[_0x9300('0x25')];}_0x25a199[_0x9300('0x18')](_0xdac33b)[_0x9300('0x26')](_0x406686);};}exports[_0x9300('0x27')]=function(_0x2233fb,_0x1ae0dc){var _0x1b56b={},_0x5de0b9={},_0x52e07a={'count':0x0,'rows':[]};var _0x5f43f9=_[_0x9300('0x28')](db['FreshsalesAccount'][_0x9300('0x29')],function(_0x120c35){return{'name':_0x120c35[_0x9300('0x2a')],'type':_0x120c35[_0x9300('0x2b')][_0x9300('0x2c')]};});_0x5de0b9[_0x9300('0x2d')]=_[_0x9300('0x28')](_0x5f43f9,'name');_0x5de0b9[_0x9300('0x2e')]=_[_0x9300('0x2f')](_0x2233fb['query']);_0x5de0b9[_0x9300('0x30')]=_['intersection'](_0x5de0b9[_0x9300('0x2d')],_0x5de0b9[_0x9300('0x2e')]);_0x1b56b[_0x9300('0x31')]=_[_0x9300('0x32')](_0x5de0b9[_0x9300('0x2d')],qs[_0x9300('0x33')](_0x2233fb[_0x9300('0x2e')]['fields']));_0x1b56b[_0x9300('0x31')]=_0x1b56b[_0x9300('0x31')]['length']?_0x1b56b[_0x9300('0x31')]:_0x5de0b9[_0x9300('0x2d')];if(!_0x2233fb[_0x9300('0x2e')]['hasOwnProperty'](_0x9300('0x34'))){_0x1b56b[_0x9300('0x1b')]=qs['limit'](_0x2233fb['query'][_0x9300('0x1b')]);_0x1b56b[_0x9300('0x19')]=qs['offset'](_0x2233fb[_0x9300('0x2e')][_0x9300('0x19')]);}_0x1b56b[_0x9300('0x35')]=qs[_0x9300('0x36')](_0x2233fb[_0x9300('0x2e')][_0x9300('0x36')]);_0x1b56b['where']=qs[_0x9300('0x30')](_[_0x9300('0x37')](_0x2233fb[_0x9300('0x2e')],_0x5de0b9['filters']),_0x5f43f9);if(_0x2233fb[_0x9300('0x2e')][_0x9300('0x38')]){_0x1b56b[_0x9300('0x39')]=_[_0x9300('0x3a')](_0x1b56b[_0x9300('0x39')],{'$or':_['map'](_0x5f43f9,function(_0x221bec){if(_0x221bec[_0x9300('0x2b')]!==_0x9300('0x3b')){var _0x26d008={};_0x26d008[_0x221bec[_0x9300('0x25')]]={'$like':'%'+_0x2233fb[_0x9300('0x2e')]['filter']+'%'};return _0x26d008;}})});}_0x1b56b=_[_0x9300('0x3a')]({},_0x1b56b,_0x2233fb['options']);var _0x38cc30={'where':_0x1b56b[_0x9300('0x39')]};return db[_0x9300('0x3c')][_0x9300('0x1c')](_0x38cc30)[_0x9300('0x22')](function(_0x114bcf){_0x52e07a['count']=_0x114bcf;if(_0x2233fb[_0x9300('0x2e')][_0x9300('0x3d')]){_0x1b56b['include']=[{'all':!![]}];}return db[_0x9300('0x3c')][_0x9300('0x3e')](_0x1b56b);})['then'](function(_0x159ba1){_0x52e07a[_0x9300('0x3f')]=_0x159ba1;return _0x52e07a;})[_0x9300('0x22')](respondWithFilteredResult(_0x1ae0dc,_0x1b56b))[_0x9300('0x40')](handleError(_0x1ae0dc,null));};exports[_0x9300('0x41')]=function(_0x460b4d,_0x1eb860){var _0x38a66b={'raw':![],'where':{'id':_0x460b4d[_0x9300('0x42')]['id']}},_0x69e70b={};_0x69e70b[_0x9300('0x2d')]=_[_0x9300('0x2f')](db[_0x9300('0x3c')][_0x9300('0x29')]);_0x69e70b['query']=_[_0x9300('0x2f')](_0x460b4d[_0x9300('0x2e')]);_0x69e70b['filters']=_[_0x9300('0x32')](_0x69e70b[_0x9300('0x2d')],_0x69e70b[_0x9300('0x2e')]);_0x38a66b['attributes']=_['intersection'](_0x69e70b[_0x9300('0x2d')],qs['fields'](_0x460b4d['query'][_0x9300('0x33')]));_0x38a66b[_0x9300('0x31')]=_0x38a66b[_0x9300('0x31')][_0x9300('0x43')]?_0x38a66b['attributes']:_0x69e70b[_0x9300('0x2d')];if(_0x460b4d[_0x9300('0x2e')][_0x9300('0x3d')]){_0x38a66b[_0x9300('0x44')]=[{'all':!![]}];}_0x38a66b=_['merge']({},_0x38a66b,_0x460b4d[_0x9300('0x45')]);return db[_0x9300('0x3c')]['find'](_0x38a66b)[_0x9300('0x22')](handleEntityNotFound(_0x1eb860,null))[_0x9300('0x22')](respondWithResult(_0x1eb860,null))[_0x9300('0x40')](handleError(_0x1eb860,null));};exports[_0x9300('0x46')]=function(_0x5f51da,_0x397085){return db[_0x9300('0x3c')][_0x9300('0x46')](_0x5f51da['body'],{})['then'](respondWithResult(_0x397085,0xc9))[_0x9300('0x40')](handleError(_0x397085,null));};exports[_0x9300('0x47')]=function(_0x3f4931,_0x3ebd0a){if(_0x3f4931[_0x9300('0x48')]['id']){delete _0x3f4931[_0x9300('0x48')]['id'];}return db[_0x9300('0x3c')][_0x9300('0x49')]({'where':{'id':_0x3f4931['params']['id']}})[_0x9300('0x22')](handleEntityNotFound(_0x3ebd0a,null))[_0x9300('0x22')](saveUpdates(_0x3f4931['body'],null))[_0x9300('0x22')](respondWithResult(_0x3ebd0a,null))['catch'](handleError(_0x3ebd0a,null));};exports['destroy']=function(_0x555b79,_0x578882){return db['FreshsalesAccount']['find']({'where':{'id':_0x555b79[_0x9300('0x42')]['id']}})['then'](handleEntityNotFound(_0x578882,null))[_0x9300('0x22')](removeEntity(_0x578882,null))[_0x9300('0x40')](handleError(_0x578882,null));};exports['getConfigurations']=function(_0x42cf1f,_0x542db1,_0x3fea29){var _0x5c23b8={};var _0x20ff5b={};var _0x30a13d;var _0x5ac677;return db[_0x9300('0x3c')]['findOne']({'where':{'id':_0x42cf1f[_0x9300('0x42')]['id']}})[_0x9300('0x22')](handleEntityNotFound(_0x542db1,null))[_0x9300('0x22')](function(_0x29472e){if(_0x29472e){_0x30a13d=_0x29472e;_0x20ff5b[_0x9300('0x2d')]=_['keys'](db[_0x9300('0x4a')][_0x9300('0x29')]);_0x20ff5b[_0x9300('0x2e')]=_[_0x9300('0x2f')](_0x42cf1f[_0x9300('0x2e')]);_0x20ff5b['filters']=_[_0x9300('0x32')](_0x20ff5b[_0x9300('0x2d')],_0x20ff5b['query']);_0x5c23b8['attributes']=_[_0x9300('0x32')](_0x20ff5b['model'],qs[_0x9300('0x33')](_0x42cf1f[_0x9300('0x2e')][_0x9300('0x33')]));_0x5c23b8[_0x9300('0x31')]=_0x5c23b8[_0x9300('0x31')][_0x9300('0x43')]?_0x5c23b8[_0x9300('0x31')]:_0x20ff5b['model'];_0x5c23b8[_0x9300('0x35')]=qs[_0x9300('0x36')](_0x42cf1f[_0x9300('0x2e')][_0x9300('0x36')]);_0x5c23b8[_0x9300('0x39')]=qs[_0x9300('0x30')](_[_0x9300('0x37')](_0x42cf1f[_0x9300('0x2e')],_0x20ff5b[_0x9300('0x30')]));if(_0x42cf1f['query'][_0x9300('0x38')]){_0x5c23b8['where']=_[_0x9300('0x3a')](_0x5c23b8[_0x9300('0x39')],{'$or':_[_0x9300('0x28')](_0x5c23b8[_0x9300('0x31')],function(_0x1c0b44){var _0x3e7d21={};_0x3e7d21[_0x1c0b44]={'$like':'%'+_0x42cf1f[_0x9300('0x2e')][_0x9300('0x38')]+'%'};return _0x3e7d21;})});}_0x5c23b8=_['merge']({},_0x5c23b8,_0x42cf1f[_0x9300('0x45')]);return _0x30a13d[_0x9300('0x4b')](_0x5c23b8);}})[_0x9300('0x22')](function(_0x55970f){if(_0x55970f){_0x5ac677=_0x55970f[_0x9300('0x43')];if(!_0x42cf1f['query'][_0x9300('0x4c')](_0x9300('0x34'))){_0x5c23b8[_0x9300('0x1b')]=qs[_0x9300('0x1b')](_0x42cf1f['query'][_0x9300('0x1b')]);_0x5c23b8[_0x9300('0x19')]=qs[_0x9300('0x19')](_0x42cf1f[_0x9300('0x2e')][_0x9300('0x19')]);}return _0x30a13d[_0x9300('0x4b')](_0x5c23b8);}})[_0x9300('0x22')](function(_0x263344){if(_0x263344){return _0x263344?{'count':_0x5ac677,'rows':_0x263344}:null;}})[_0x9300('0x22')](respondWithResult(_0x542db1,null))[_0x9300('0x40')](handleError(_0x542db1,null));};exports['addConfiguration']=function(_0x25403d,_0x4b137c,_0x4ab7ef){if(_0x25403d[_0x9300('0x48')]['id']){delete _0x25403d[_0x9300('0x48')]['id'];}return db['FreshsalesAccount'][_0x9300('0x4d')]({'where':{'id':_0x25403d['params']['id']}})[_0x9300('0x22')](handleEntityNotFound(_0x4b137c,null))[_0x9300('0x22')](function(_0x5c414e){if(_0x5c414e){_0x25403d[_0x9300('0x48')]['AccountId']=_0x5c414e['id'];_0x25403d[_0x9300('0x48')][_0x9300('0x4e')]=integrations[_0x9300('0x4f')](_0x25403d[_0x9300('0x48')]['channel'],_0x25403d[_0x9300('0x48')]['type']);_0x25403d[_0x9300('0x48')][_0x9300('0x50')]=integrations[_0x9300('0x51')](_0x25403d[_0x9300('0x48')][_0x9300('0x52')],_0x25403d[_0x9300('0x48')][_0x9300('0x2b')]);return db[_0x9300('0x4a')][_0x9300('0x46')](_0x25403d[_0x9300('0x48')],{'include':[{'model':db[_0x9300('0x53')],'as':_0x9300('0x4e')},{'model':db['FreshsalesField'],'as':_0x9300('0x50')}]});}return null;})['then'](respondWithResult(_0x4b137c,null))[_0x9300('0x40')](handleError(_0x4b137c,null));};exports[_0x9300('0x54')]=function(_0x49bb1c,_0x4795e3,_0x522ea9){var _0x356234='';var _0x48e660='';return db[_0x9300('0x3c')][_0x9300('0x4d')]({'where':{'id':_0x49bb1c[_0x9300('0x42')]['id']},'attributes':['id',_0x9300('0x55'),'remoteUri',_0x9300('0x56')]})[_0x9300('0x22')](handleEntityNotFound(_0x4795e3,null))['then'](function(_0x5339da){if(_0x5339da){_0x48e660=_0x5339da['username'];_0x356234=_0x5339da[_0x9300('0x57')];var _0x801810=_0x5339da[_0x9300('0x57')][_0x9300('0x58')](-0x1);if(_0x801810==='/'){_0x356234=_0x356234[_0x9300('0x59')](0x0,_0x356234['lastIndexOf'](_0x801810));}return rp({'method':'GET','uri':util[_0x9300('0x5a')](_0x9300('0x5b'),_0x356234,_0x9300('0x5c')),'headers':{'Authorization':'Token\x20token='+_0x5339da[_0x9300('0x56')]},'json':!![]});}})[_0x9300('0x22')](function(_0x2f1a82){if(_0x2f1a82){var _0x5b2b60=_0x2f1a82['users'];var _0x5affc5=![];var _0x3f8e0=null;for(_0x3f8e0=0x0;_0x3f8e0<_0x5b2b60[_0x9300('0x43')];_0x3f8e0++){if(_0x5b2b60[_0x3f8e0][_0x9300('0x5d')]===_0x48e660){_0x5affc5=!![];}}if(_0x5affc5){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x9300('0x5e')});}}})['then'](respondWithResult(_0x4795e3,null))[_0x9300('0x40')](function(_0x155f94){var _0x11d463=_0x49bb1c['query']['test']?0x1f4:_0x155f94[_0x9300('0x5f')]||0x1f4;logger[_0x9300('0x23')](_0x9300('0x60'),_0x9300('0x54'),_0x11d463,JSON[_0x9300('0x61')](_0x155f94));delete _0x155f94['name'];if(_0x11d463===0x191){_0x11d463=0x190;}_0x4795e3[_0x9300('0x18')](_0x11d463)[_0x9300('0x26')](_0x49bb1c['query'][_0x9300('0x62')]?{'message':_0x9300('0x63'),'statusCode':_0x155f94[_0x9300('0x5f')]}:_0x155f94);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 52c12de..1ac078d 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 _0xe2fe=['define','int_freshsales_accounts','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports'];(function(_0x2eb6d7,_0x5975bf){var _0x50cd04=function(_0x1e13c5){while(--_0x1e13c5){_0x2eb6d7['push'](_0x2eb6d7['shift']());}};_0x50cd04(++_0x5975bf);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xee2f('0x1'));var moment=require('moment');var BPromise=require(_0xee2f('0x2'));var rp=require(_0xee2f('0x3'));var fs=require('fs');var path=require(_0xee2f('0x4'));var rimraf=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0xee2f('0x7'));module[_0xee2f('0x8')]=function(_0x49926b,_0x1533a0){return _0x49926b[_0xee2f('0x9')]('FreshsalesAccount',attributes,{'tableName':_0xee2f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x77d4=['../../components/integrations/configuration','exports','int_freshsales_accounts','util','api','bluebird','request-promise','../../config/environment','./intFreshsalesAccount.attributes'];(function(_0x33b206,_0x49bc99){var _0x34e151=function(_0x6d3c7){while(--_0x6d3c7){_0x33b206['push'](_0x33b206['shift']());}};_0x34e151(++_0x49bc99);}(_0x77d4,0x108));var _0x477d=function(_0x4e3961,_0x4aaaf3){_0x4e3961=_0x4e3961-0x0;var _0x1720ee=_0x77d4[_0x4e3961];return _0x1720ee;};'use strict';var _=require('lodash');var util=require(_0x477d('0x0'));var logger=require('../../config/logger')(_0x477d('0x1'));var moment=require('moment');var BPromise=require(_0x477d('0x2'));var rp=require(_0x477d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x477d('0x4'));var attributes=require(_0x477d('0x5'));var integrations=require(_0x477d('0x6'));module[_0x477d('0x7')]=function(_0x2545e5,_0x45ca2d){return _0x2545e5['define']('FreshsalesAccount',attributes,{'tableName':_0x477d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 7494828..978c466 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 _0xe3da=['then','GetFreshsalesAccount','catch','ShowFreshsalesAccount','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','FreshsalesAccount','findAll','options','raw','attributes','limit','include','map','model'];(function(_0x245d65,_0xe6ae06){var _0xd651af=function(_0xc48dfc){while(--_0xc48dfc){_0x245d65['push'](_0x245d65['shift']());}};_0xd651af(++_0xe6ae06);}(_0xe3da,0x1cd));var _0xae3d=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe3da[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var moment=require(_0xae3d('0x2'));var BPromise=require(_0xae3d('0x3'));var rs=require(_0xae3d('0x4'));var fs=require('fs');var Redis=require(_0xae3d('0x5'));var db=require(_0xae3d('0x6'))['db'];var utils=require(_0xae3d('0x7'));var logger=require(_0xae3d('0x8'))(_0xae3d('0x9'));var config=require(_0xae3d('0xa'));var jayson=require(_0xae3d('0xb'));var client=jayson[_0xae3d('0xc')][_0xae3d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x476579,_0x33c089,_0x583b98){return new BPromise(function(_0x2a5c45,_0x3d6650){return client['request'](_0x476579,_0x583b98)['then'](function(_0x459592){logger[_0xae3d('0xe')](_0xae3d('0xf'),_0x33c089,_0xae3d('0x10'));logger[_0xae3d('0x11')](_0xae3d('0x12'),_0x33c089,'request\x20sent',JSON[_0xae3d('0x13')](_0x459592));if(_0x459592['error']){if(_0x459592[_0xae3d('0x14')][_0xae3d('0x15')]===0x1f4){logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0x459592['error'][_0xae3d('0x16')]);return _0x3d6650(_0x459592[_0xae3d('0x14')][_0xae3d('0x16')]);}logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0x459592[_0xae3d('0x14')][_0xae3d('0x16')]);return _0x2a5c45(_0x459592['error'][_0xae3d('0x16')]);}else{logger[_0xae3d('0xe')](_0xae3d('0xf'),_0x33c089,_0xae3d('0x10'));_0x2a5c45(_0x459592[_0xae3d('0x17')][_0xae3d('0x16')]);}})['catch'](function(_0xe925fd){logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0xe925fd);_0x3d6650(_0xe925fd);});});}exports['GetFreshsalesAccount']=function(_0x3f8cf9){var _0x4cbe4e=this;return new Promise(function(_0x558e42,_0x4d931d){return db[_0xae3d('0x18')][_0xae3d('0x19')]({'raw':_0x3f8cf9[_0xae3d('0x1a')]?_0x3f8cf9[_0xae3d('0x1a')][_0xae3d('0x1b')]===undefined?!![]:![]:!![],'where':_0x3f8cf9['options']?_0x3f8cf9[_0xae3d('0x1a')]['where']||null:null,'attributes':_0x3f8cf9[_0xae3d('0x1a')]?_0x3f8cf9[_0xae3d('0x1a')][_0xae3d('0x1c')]||null:null,'limit':_0x3f8cf9[_0xae3d('0x1a')]?_0x3f8cf9[_0xae3d('0x1a')][_0xae3d('0x1d')]||null:null,'include':_0x3f8cf9[_0xae3d('0x1a')]?_0x3f8cf9[_0xae3d('0x1a')][_0xae3d('0x1e')]?_[_0xae3d('0x1f')](_0x3f8cf9[_0xae3d('0x1a')][_0xae3d('0x1e')],function(_0x37f5ff){return{'model':db[_0x37f5ff[_0xae3d('0x20')]],'as':_0x37f5ff['as'],'attributes':_0x37f5ff[_0xae3d('0x1c')],'include':_0x37f5ff[_0xae3d('0x1e')]?_[_0xae3d('0x1f')](_0x37f5ff[_0xae3d('0x1e')],function(_0x2131e9){return{'model':db[_0x2131e9[_0xae3d('0x20')]],'as':_0x2131e9['as'],'attributes':_0x2131e9['attributes'],'include':_0x2131e9[_0xae3d('0x1e')]?_[_0xae3d('0x1f')](_0x2131e9[_0xae3d('0x1e')],function(_0x52df0f){return{'model':db[_0x52df0f[_0xae3d('0x20')]],'as':_0x52df0f['as'],'attributes':_0x52df0f[_0xae3d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xae3d('0x21')](function(_0x54c1e1){logger['info'](_0xae3d('0x22'),_0x3f8cf9);logger[_0xae3d('0x11')](_0xae3d('0x22'),_0x3f8cf9,JSON[_0xae3d('0x13')](_0x54c1e1));_0x558e42(_0x54c1e1);})[_0xae3d('0x23')](function(_0x561371){logger[_0xae3d('0x14')](_0xae3d('0x22'),_0x561371['message'],_0x3f8cf9);_0x4d931d(_0x4cbe4e[_0xae3d('0x14')](0x1f4,_0x561371[_0xae3d('0x16')]));});});};exports[_0xae3d('0x24')]=function(_0x46f484){var _0x432c04=this;return new Promise(function(_0x6ef13c,_0x5356d4){return db['FreshsalesAccount']['find']({'raw':_0x46f484[_0xae3d('0x1a')]?_0x46f484[_0xae3d('0x1a')][_0xae3d('0x1b')]===undefined?!![]:![]:!![],'where':_0x46f484[_0xae3d('0x1a')]?_0x46f484['options'][_0xae3d('0x25')]||null:null,'attributes':_0x46f484[_0xae3d('0x1a')]?_0x46f484[_0xae3d('0x1a')][_0xae3d('0x1c')]||null:null,'include':_0x46f484[_0xae3d('0x1a')]?_0x46f484[_0xae3d('0x1a')][_0xae3d('0x1e')]?_['map'](_0x46f484[_0xae3d('0x1a')]['include'],function(_0x55aae4){return{'model':db[_0x55aae4[_0xae3d('0x20')]],'as':_0x55aae4['as'],'attributes':_0x55aae4['attributes'],'include':_0x55aae4[_0xae3d('0x1e')]?_['map'](_0x55aae4['include'],function(_0x1a28b5){return{'model':db[_0x1a28b5[_0xae3d('0x20')]],'as':_0x1a28b5['as'],'attributes':_0x1a28b5[_0xae3d('0x1c')],'include':_0x1a28b5['include']?_[_0xae3d('0x1f')](_0x1a28b5['include'],function(_0xce647f){return{'model':db[_0xce647f[_0xae3d('0x20')]],'as':_0xce647f['as'],'attributes':_0xce647f[_0xae3d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xae3d('0x21')](function(_0x18c469){logger[_0xae3d('0xe')](_0xae3d('0x24'),_0x46f484);logger[_0xae3d('0x11')](_0xae3d('0x24'),_0x46f484,JSON[_0xae3d('0x13')](_0x18c469));_0x6ef13c(_0x18c469);})[_0xae3d('0x23')](function(_0x5543ee){logger['error'](_0xae3d('0x24'),_0x5543ee['message'],_0x46f484);_0x5356d4(_0x432c04[_0xae3d('0x14')](0x1f4,_0x5543ee[_0xae3d('0x16')]));});});}; \ No newline at end of file +var _0x4137=['stringify','error','code','FreshsalesAccount,\x20%s,\x20%s','message','GetFreshsalesAccount','findAll','options','raw','where','attributes','limit','include','model','map','then','catch','ShowFreshsalesAccount','FreshsalesAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s'];(function(_0x517681,_0x105c7c){var _0x336a36=function(_0x50b071){while(--_0x50b071){_0x517681['push'](_0x517681['shift']());}};_0x336a36(++_0x105c7c);}(_0x4137,0xf8));var _0x7413=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x4137[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var moment=require(_0x7413('0x2'));var BPromise=require(_0x7413('0x3'));var rs=require(_0x7413('0x4'));var fs=require('fs');var Redis=require(_0x7413('0x5'));var db=require(_0x7413('0x6'))['db'];var utils=require(_0x7413('0x7'));var logger=require(_0x7413('0x8'))(_0x7413('0x9'));var config=require(_0x7413('0xa'));var jayson=require(_0x7413('0xb'));var client=jayson['client'][_0x7413('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x188d89,_0x5b39ac,_0x15af0d){return new BPromise(function(_0x5f4cd0,_0x3236ec){return client[_0x7413('0xd')](_0x188d89,_0x15af0d)['then'](function(_0x422bf5){logger[_0x7413('0xe')]('FreshsalesAccount,\x20%s,\x20%s',_0x5b39ac,_0x7413('0xf'));logger[_0x7413('0x10')](_0x7413('0x11'),_0x5b39ac,_0x7413('0xf'),JSON[_0x7413('0x12')](_0x422bf5));if(_0x422bf5['error']){if(_0x422bf5[_0x7413('0x13')][_0x7413('0x14')]===0x1f4){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);return _0x3236ec(_0x422bf5['error']['message']);}logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')]['message']);return _0x5f4cd0(_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);}else{logger['info'](_0x7413('0x15'),_0x5b39ac,'request\x20sent');_0x5f4cd0(_0x422bf5['result'][_0x7413('0x16')]);}})['catch'](function(_0x195c72){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x195c72);_0x3236ec(_0x195c72);});});}exports[_0x7413('0x17')]=function(_0x19157f){var _0x12a01e=this;return new Promise(function(_0x2a3417,_0x26dafe){return db['FreshsalesAccount'][_0x7413('0x18')]({'raw':_0x19157f[_0x7413('0x19')]?_0x19157f[_0x7413('0x19')][_0x7413('0x1a')]===undefined?!![]:![]:!![],'where':_0x19157f['options']?_0x19157f[_0x7413('0x19')][_0x7413('0x1b')]||null:null,'attributes':_0x19157f[_0x7413('0x19')]?_0x19157f[_0x7413('0x19')][_0x7413('0x1c')]||null:null,'limit':_0x19157f[_0x7413('0x19')]?_0x19157f[_0x7413('0x19')][_0x7413('0x1d')]||null:null,'include':_0x19157f['options']?_0x19157f['options'][_0x7413('0x1e')]?_['map'](_0x19157f[_0x7413('0x19')][_0x7413('0x1e')],function(_0x3b0c81){return{'model':db[_0x3b0c81[_0x7413('0x1f')]],'as':_0x3b0c81['as'],'attributes':_0x3b0c81[_0x7413('0x1c')],'include':_0x3b0c81[_0x7413('0x1e')]?_[_0x7413('0x20')](_0x3b0c81[_0x7413('0x1e')],function(_0x1d455b){return{'model':db[_0x1d455b['model']],'as':_0x1d455b['as'],'attributes':_0x1d455b['attributes'],'include':_0x1d455b[_0x7413('0x1e')]?_['map'](_0x1d455b[_0x7413('0x1e')],function(_0x71cbb4){return{'model':db[_0x71cbb4[_0x7413('0x1f')]],'as':_0x71cbb4['as'],'attributes':_0x71cbb4['attributes']};}):[]};}):[]};}):[]:[]})[_0x7413('0x21')](function(_0x896552){logger[_0x7413('0xe')](_0x7413('0x17'),_0x19157f);logger[_0x7413('0x10')](_0x7413('0x17'),_0x19157f,JSON['stringify'](_0x896552));_0x2a3417(_0x896552);})[_0x7413('0x22')](function(_0x4ed662){logger[_0x7413('0x13')](_0x7413('0x17'),_0x4ed662[_0x7413('0x16')],_0x19157f);_0x26dafe(_0x12a01e[_0x7413('0x13')](0x1f4,_0x4ed662[_0x7413('0x16')]));});});};exports[_0x7413('0x23')]=function(_0x5bb3ea){var _0x1ffb6f=this;return new Promise(function(_0x17c342,_0x39db32){return db[_0x7413('0x24')][_0x7413('0x25')]({'raw':_0x5bb3ea[_0x7413('0x19')]?_0x5bb3ea[_0x7413('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5bb3ea[_0x7413('0x19')]?_0x5bb3ea[_0x7413('0x19')][_0x7413('0x1b')]||null:null,'attributes':_0x5bb3ea[_0x7413('0x19')]?_0x5bb3ea[_0x7413('0x19')]['attributes']||null:null,'include':_0x5bb3ea[_0x7413('0x19')]?_0x5bb3ea['options'][_0x7413('0x1e')]?_[_0x7413('0x20')](_0x5bb3ea[_0x7413('0x19')]['include'],function(_0xe6b096){return{'model':db[_0xe6b096['model']],'as':_0xe6b096['as'],'attributes':_0xe6b096[_0x7413('0x1c')],'include':_0xe6b096[_0x7413('0x1e')]?_['map'](_0xe6b096['include'],function(_0x440bfe){return{'model':db[_0x440bfe[_0x7413('0x1f')]],'as':_0x440bfe['as'],'attributes':_0x440bfe[_0x7413('0x1c')],'include':_0x440bfe['include']?_['map'](_0x440bfe[_0x7413('0x1e')],function(_0x5a92ab){return{'model':db[_0x5a92ab['model']],'as':_0x5a92ab['as'],'attributes':_0x5a92ab[_0x7413('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3ad12d){logger[_0x7413('0xe')](_0x7413('0x23'),_0x5bb3ea);logger[_0x7413('0x10')](_0x7413('0x23'),_0x5bb3ea,JSON['stringify'](_0x3ad12d));_0x17c342(_0x3ad12d);})[_0x7413('0x22')](function(_0x8dc047){logger[_0x7413('0x13')](_0x7413('0x23'),_0x8dc047[_0x7413('0x16')],_0x5bb3ea);_0x39db32(_0x1ffb6f[_0x7413('0x13')](0x1f4,_0x8dc047[_0x7413('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index b2a26e7..5d8da0c 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 _0xc848=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x21f3c3,_0x42e32c){var _0x15957=function(_0x271f01){while(--_0x271f01){_0x21f3c3['push'](_0x21f3c3['shift']());}};_0x15957(++_0x42e32c);}(_0xc848,0x95));var _0x8c84=function(_0x291d79,_0x512974){_0x291d79=_0x291d79-0x0;var _0x22b0e6=_0xc848[_0x291d79];return _0x22b0e6;};'use strict';var multer=require(_0x8c84('0x0'));var util=require(_0x8c84('0x1'));var path=require(_0x8c84('0x2'));var timeout=require(_0x8c84('0x3'));var express=require(_0x8c84('0x4'));var router=express[_0x8c84('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8c84('0x6'));var interaction=require(_0x8c84('0x7'));var config=require(_0x8c84('0x8'));var controller=require(_0x8c84('0x9'));router[_0x8c84('0xa')]('/',auth[_0x8c84('0xb')](),controller[_0x8c84('0xc')]);router[_0x8c84('0xa')](_0x8c84('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x8c84('0xa')](_0x8c84('0xe'),auth[_0x8c84('0xb')](),controller[_0x8c84('0xf')]);router[_0x8c84('0xa')](_0x8c84('0x10'),auth['isAuthenticated'](),controller[_0x8c84('0x11')]);router['get']('/:id/fields',auth[_0x8c84('0xb')](),controller['getFields']);router['post']('/',auth[_0x8c84('0xb')](),controller['create']);router['put']('/:id',auth[_0x8c84('0xb')](),controller[_0x8c84('0x12')]);router[_0x8c84('0x13')](_0x8c84('0xd'),auth[_0x8c84('0xb')](),controller[_0x8c84('0x14')]);module[_0x8c84('0x15')]=router; \ No newline at end of file +var _0x5bd6=['get','/:id','show','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesConfiguration.controller','isAuthenticated','index'];(function(_0x202b8e,_0xd9f859){var _0x3beb83=function(_0xefda90){while(--_0xefda90){_0x202b8e['push'](_0x202b8e['shift']());}};_0x3beb83(++_0xd9f859);}(_0x5bd6,0xfd));var _0x65bd=function(_0x271537,_0x8b7b3b){_0x271537=_0x271537-0x0;var _0x19dc22=_0x5bd6[_0x271537];return _0x19dc22;};'use strict';var multer=require(_0x65bd('0x0'));var util=require(_0x65bd('0x1'));var path=require(_0x65bd('0x2'));var timeout=require('connect-timeout');var express=require(_0x65bd('0x3'));var router=express[_0x65bd('0x4')]();var fs_extra=require(_0x65bd('0x5'));var auth=require(_0x65bd('0x6'));var interaction=require(_0x65bd('0x7'));var config=require('../../config/environment');var controller=require(_0x65bd('0x8'));router['get']('/',auth[_0x65bd('0x9')](),controller[_0x65bd('0xa')]);router[_0x65bd('0xb')](_0x65bd('0xc'),auth[_0x65bd('0x9')](),controller[_0x65bd('0xd')]);router[_0x65bd('0xb')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x65bd('0xe')]);router[_0x65bd('0xb')](_0x65bd('0xf'),auth[_0x65bd('0x9')](),controller[_0x65bd('0x10')]);router[_0x65bd('0xb')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0x65bd('0x9')](),controller[_0x65bd('0x11')]);router[_0x65bd('0x12')](_0x65bd('0xc'),auth[_0x65bd('0x9')](),controller[_0x65bd('0x13')]);router[_0x65bd('0x14')](_0x65bd('0xc'),auth[_0x65bd('0x9')](),controller[_0x65bd('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 8b49a0e..dcd0c91 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 _0x681a=['exports'];(function(_0x1ad87c,_0x5c8ccb){var _0xf557cf=function(_0xdd281a){while(--_0xdd281a){_0x1ad87c['push'](_0x1ad87c['shift']());}};_0xf557cf(++_0x5c8ccb);}(_0x681a,0x196));var _0xa681=function(_0x53fe97,_0x544271){_0x53fe97=_0x53fe97-0x0;var _0x5c49a2=_0x681a[_0x53fe97];return _0x5c49a2;};'use strict';var Sequelize=require('sequelize');module[_0xa681('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfefd=['exports','STRING','sequelize'];(function(_0x1bab58,_0x393c11){var _0xdc323b=function(_0x3e125f){while(--_0x3e125f){_0x1bab58['push'](_0x1bab58['shift']());}};_0xdc323b(++_0x393c11);}(_0xfefd,0x128));var _0xdfef=function(_0x888385,_0x9cdc66){_0x888385=_0x888385-0x0;var _0x22d5c2=_0xfefd[_0x888385];return _0x22d5c2;};'use strict';var Sequelize=require(_0xdfef('0x0'));module[_0xdfef('0x1')]={'name':{'type':Sequelize[_0xdfef('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index f4ccc0c..cedb140 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 _0x393a=['end','offset','limit','undefined','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','count','includeAll','findAll','rows','show','keys','include','find','create','body','catch','params','findOne','FreshsalesField','getSubjects','getDescriptions','getFields','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/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x393a,0x89));var _0xa393=function(_0x46390e,_0x39d20f){_0x46390e=_0x46390e-0x0;var _0x4db91c=_0x393a[_0x46390e];return _0x4db91c;};'use strict';var emlformat=require(_0xa393('0x0'));var rimraf=require(_0xa393('0x1'));var zipdir=require(_0xa393('0x2'));var jsonpatch=require(_0xa393('0x3'));var rp=require('request-promise');var moment=require(_0xa393('0x4'));var BPromise=require(_0xa393('0x5'));var Mustache=require(_0xa393('0x6'));var util=require(_0xa393('0x7'));var path=require(_0xa393('0x8'));var sox=require(_0xa393('0x9'));var csv=require(_0xa393('0xa'));var ejs=require(_0xa393('0xb'));var fs=require('fs');var fs_extra=require(_0xa393('0xc'));var _=require('lodash');var squel=require(_0xa393('0xd'));var crypto=require(_0xa393('0xe'));var jsforce=require(_0xa393('0xf'));var deskjs=require(_0xa393('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa393('0x11'));var Papa=require('papaparse');var Redis=require(_0xa393('0x12'));var authService=require(_0xa393('0x13'));var qs=require(_0xa393('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa393('0x15'));var logger=require(_0xa393('0x16'))('api');var utils=require(_0xa393('0x17'));var config=require(_0xa393('0x18'));var licenseUtil=require(_0xa393('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x292ae,_0x1311cc){_0x1311cc=_0x1311cc||0xcc;return function(_0x5844f2){if(_0x5844f2){return _0x292ae['sendStatus'](_0x1311cc);}return _0x292ae[_0xa393('0x1a')](_0x1311cc)[_0xa393('0x1b')]();};}function respondWithResult(_0x43f6e0,_0x5a697a){_0x5a697a=_0x5a697a||0xc8;return function(_0x3567eb){if(_0x3567eb){return _0x43f6e0[_0xa393('0x1a')](_0x5a697a)['json'](_0x3567eb);}};}function respondWithFilteredResult(_0x353ff2,_0x53ba0e){return function(_0x1e8b9b){if(_0x1e8b9b){var _0x2e1f9f=typeof _0x53ba0e[_0xa393('0x1c')]==='undefined'&&typeof _0x53ba0e[_0xa393('0x1d')]===_0xa393('0x1e');var _0x25bedd=_0x1e8b9b['count'];var _0x44aa29=_0x2e1f9f?0x0:_0x53ba0e['offset'];var _0x101512=_0x2e1f9f?_0x1e8b9b['count']:_0x53ba0e[_0xa393('0x1c')]+_0x53ba0e[_0xa393('0x1d')];var _0x14c325;if(_0x101512>=_0x25bedd){_0x101512=_0x25bedd;_0x14c325=0xc8;}else{_0x14c325=0xce;}_0x353ff2[_0xa393('0x1a')](_0x14c325);return _0x353ff2['set'](_0xa393('0x1f'),_0x44aa29+'-'+_0x101512+'/'+_0x25bedd)[_0xa393('0x20')](_0x1e8b9b);}return null;};}function patchUpdates(_0x3cc66a){return function(_0x20a6fb){try{jsonpatch[_0xa393('0x21')](_0x20a6fb,_0x3cc66a,!![]);}catch(_0x5485ac){return BPromise[_0xa393('0x22')](_0x5485ac);}return _0x20a6fb[_0xa393('0x23')]();};}function saveUpdates(_0xb999d0,_0x23df1b){return function(_0x3f51d6){if(_0x3f51d6){return _0x3f51d6[_0xa393('0x24')](_0xb999d0)[_0xa393('0x25')](function(_0x301d9b){return _0x301d9b;});}return null;};}function removeEntity(_0x138574,_0x50ce20){return function(_0x5da987){if(_0x5da987){return _0x5da987[_0xa393('0x26')]()[_0xa393('0x25')](function(){_0x138574['status'](0xcc)[_0xa393('0x1b')]();});}};}function handleEntityNotFound(_0x229651,_0x1a5d16){return function(_0x11db51){if(!_0x11db51){_0x229651['sendStatus'](0x194);}return _0x11db51;};}function handleError(_0x2245e4,_0x14d25b){_0x14d25b=_0x14d25b||0x1f4;return function(_0x2d4219){logger[_0xa393('0x27')](_0x2d4219[_0xa393('0x28')]);if(_0x2d4219[_0xa393('0x29')]){delete _0x2d4219[_0xa393('0x29')];}_0x2245e4['status'](_0x14d25b)[_0xa393('0x2a')](_0x2d4219);};}exports['index']=function(_0x6ea780,_0x45bc2b){var _0x313268={},_0x5b70a2={},_0x1a2108={'count':0x0,'rows':[]};var _0x54af4e=_[_0xa393('0x2b')](db[_0xa393('0x2c')][_0xa393('0x2d')],function(_0x274d13){return{'name':_0x274d13[_0xa393('0x2e')],'type':_0x274d13[_0xa393('0x2f')][_0xa393('0x30')]};});_0x5b70a2[_0xa393('0x31')]=_[_0xa393('0x2b')](_0x54af4e,'name');_0x5b70a2[_0xa393('0x32')]=_['keys'](_0x6ea780[_0xa393('0x32')]);_0x5b70a2['filters']=_[_0xa393('0x33')](_0x5b70a2['model'],_0x5b70a2[_0xa393('0x32')]);_0x313268['attributes']=_[_0xa393('0x33')](_0x5b70a2[_0xa393('0x31')],qs[_0xa393('0x34')](_0x6ea780[_0xa393('0x32')][_0xa393('0x34')]));_0x313268['attributes']=_0x313268[_0xa393('0x35')][_0xa393('0x36')]?_0x313268[_0xa393('0x35')]:_0x5b70a2[_0xa393('0x31')];if(!_0x6ea780[_0xa393('0x32')][_0xa393('0x37')](_0xa393('0x38'))){_0x313268[_0xa393('0x1d')]=qs[_0xa393('0x1d')](_0x6ea780[_0xa393('0x32')][_0xa393('0x1d')]);_0x313268[_0xa393('0x1c')]=qs[_0xa393('0x1c')](_0x6ea780[_0xa393('0x32')]['offset']);}_0x313268[_0xa393('0x39')]=qs['sort'](_0x6ea780[_0xa393('0x32')][_0xa393('0x3a')]);_0x313268[_0xa393('0x3b')]=qs[_0xa393('0x3c')](_[_0xa393('0x3d')](_0x6ea780[_0xa393('0x32')],_0x5b70a2[_0xa393('0x3c')]),_0x54af4e);if(_0x6ea780[_0xa393('0x32')][_0xa393('0x3e')]){_0x313268[_0xa393('0x3b')]=_[_0xa393('0x3f')](_0x313268[_0xa393('0x3b')],{'$or':_[_0xa393('0x2b')](_0x54af4e,function(_0x2e18ad){if(_0x2e18ad[_0xa393('0x2f')]!=='VIRTUAL'){var _0xb98078={};_0xb98078[_0x2e18ad[_0xa393('0x29')]]={'$like':'%'+_0x6ea780[_0xa393('0x32')][_0xa393('0x3e')]+'%'};return _0xb98078;}})});}_0x313268=_[_0xa393('0x3f')]({},_0x313268,_0x6ea780[_0xa393('0x40')]);var _0x19d60a={'where':_0x313268[_0xa393('0x3b')]};return db[_0xa393('0x2c')][_0xa393('0x41')](_0x19d60a)[_0xa393('0x25')](function(_0x32bfd7){_0x1a2108[_0xa393('0x41')]=_0x32bfd7;if(_0x6ea780[_0xa393('0x32')][_0xa393('0x42')]){_0x313268['include']=[{'all':!![]}];}return db[_0xa393('0x2c')][_0xa393('0x43')](_0x313268);})[_0xa393('0x25')](function(_0x27eda3){_0x1a2108[_0xa393('0x44')]=_0x27eda3;return _0x1a2108;})[_0xa393('0x25')](respondWithFilteredResult(_0x45bc2b,_0x313268))['catch'](handleError(_0x45bc2b,null));};exports[_0xa393('0x45')]=function(_0x59c36d,_0xbc858b){var _0x2406f7={'raw':![],'where':{'id':_0x59c36d['params']['id']}},_0x2a0fef={};_0x2a0fef[_0xa393('0x31')]=_[_0xa393('0x46')](db['FreshsalesConfiguration'][_0xa393('0x2d')]);_0x2a0fef[_0xa393('0x32')]=_[_0xa393('0x46')](_0x59c36d[_0xa393('0x32')]);_0x2a0fef[_0xa393('0x3c')]=_[_0xa393('0x33')](_0x2a0fef['model'],_0x2a0fef[_0xa393('0x32')]);_0x2406f7[_0xa393('0x35')]=_[_0xa393('0x33')](_0x2a0fef['model'],qs['fields'](_0x59c36d['query'][_0xa393('0x34')]));_0x2406f7['attributes']=_0x2406f7[_0xa393('0x35')][_0xa393('0x36')]?_0x2406f7[_0xa393('0x35')]:_0x2a0fef[_0xa393('0x31')];if(_0x59c36d[_0xa393('0x32')]['includeAll']){_0x2406f7[_0xa393('0x47')]=[{'all':!![]}];}_0x2406f7=_['merge']({},_0x2406f7,_0x59c36d[_0xa393('0x40')]);return db[_0xa393('0x2c')][_0xa393('0x48')](_0x2406f7)['then'](handleEntityNotFound(_0xbc858b,null))[_0xa393('0x25')](respondWithResult(_0xbc858b,null))['catch'](handleError(_0xbc858b,null));};exports[_0xa393('0x49')]=function(_0x4618aa,_0x5e5b94){return db[_0xa393('0x2c')][_0xa393('0x49')](_0x4618aa[_0xa393('0x4a')],{})[_0xa393('0x25')](respondWithResult(_0x5e5b94,0xc9))[_0xa393('0x4b')](handleError(_0x5e5b94,null));};exports[_0xa393('0x24')]=function(_0x251f41,_0xc36015){if(_0x251f41[_0xa393('0x4a')]['id']){delete _0x251f41[_0xa393('0x4a')]['id'];}return db[_0xa393('0x2c')][_0xa393('0x48')]({'where':{'id':_0x251f41[_0xa393('0x4c')]['id']}})[_0xa393('0x25')](handleEntityNotFound(_0xc36015,null))[_0xa393('0x25')](saveUpdates(_0x251f41['body'],null))[_0xa393('0x25')](respondWithResult(_0xc36015,null))[_0xa393('0x4b')](handleError(_0xc36015,null));};exports['destroy']=function(_0x4d10ef,_0x2c3523){return db[_0xa393('0x2c')][_0xa393('0x48')]({'where':{'id':_0x4d10ef[_0xa393('0x4c')]['id']}})[_0xa393('0x25')](handleEntityNotFound(_0x2c3523,null))[_0xa393('0x25')](removeEntity(_0x2c3523,null))[_0xa393('0x4b')](handleError(_0x2c3523,null));};exports['getSubjects']=function(_0x2083f1,_0x52f463,_0xa9361f){var _0xd4d553={};var _0x370e6a={};var _0x3bad08;var _0x50ff4b;return db[_0xa393('0x2c')][_0xa393('0x4d')]({'where':{'id':_0x2083f1['params']['id']}})['then'](handleEntityNotFound(_0x52f463,null))[_0xa393('0x25')](function(_0x53a9d7){if(_0x53a9d7){_0x3bad08=_0x53a9d7;_0x370e6a[_0xa393('0x31')]=_['keys'](db[_0xa393('0x4e')]['rawAttributes']);_0x370e6a['query']=_[_0xa393('0x46')](_0x2083f1[_0xa393('0x32')]);_0x370e6a['filters']=_[_0xa393('0x33')](_0x370e6a['model'],_0x370e6a[_0xa393('0x32')]);_0xd4d553[_0xa393('0x35')]=_[_0xa393('0x33')](_0x370e6a[_0xa393('0x31')],qs[_0xa393('0x34')](_0x2083f1['query'][_0xa393('0x34')]));_0xd4d553[_0xa393('0x35')]=_0xd4d553['attributes']['length']?_0xd4d553['attributes']:_0x370e6a[_0xa393('0x31')];_0xd4d553[_0xa393('0x39')]=qs['sort'](_0x2083f1[_0xa393('0x32')][_0xa393('0x3a')]);_0xd4d553['where']=qs[_0xa393('0x3c')](_[_0xa393('0x3d')](_0x2083f1['query'],_0x370e6a[_0xa393('0x3c')]));if(_0x2083f1['query'][_0xa393('0x3e')]){_0xd4d553[_0xa393('0x3b')]=_[_0xa393('0x3f')](_0xd4d553[_0xa393('0x3b')],{'$or':_['map'](_0xd4d553[_0xa393('0x35')],function(_0xc6af6){var _0x523001={};_0x523001[_0xc6af6]={'$like':'%'+_0x2083f1['query'][_0xa393('0x3e')]+'%'};return _0x523001;})});}_0xd4d553=_[_0xa393('0x3f')]({},_0xd4d553,_0x2083f1[_0xa393('0x40')]);return _0x3bad08[_0xa393('0x4f')](_0xd4d553);}})[_0xa393('0x25')](function(_0x5b033a){if(_0x5b033a){_0x50ff4b=_0x5b033a[_0xa393('0x36')];if(!_0x2083f1[_0xa393('0x32')]['hasOwnProperty'](_0xa393('0x38'))){_0xd4d553[_0xa393('0x1d')]=qs[_0xa393('0x1d')](_0x2083f1['query']['limit']);_0xd4d553[_0xa393('0x1c')]=qs[_0xa393('0x1c')](_0x2083f1[_0xa393('0x32')][_0xa393('0x1c')]);}return _0x3bad08[_0xa393('0x4f')](_0xd4d553);}})[_0xa393('0x25')](function(_0x5db12b){if(_0x5db12b){return _0x5db12b?{'count':_0x50ff4b,'rows':_0x5db12b}:null;}})[_0xa393('0x25')](respondWithResult(_0x52f463,null))[_0xa393('0x4b')](handleError(_0x52f463,null));};exports[_0xa393('0x50')]=function(_0x154a8a,_0x3fcb94,_0x2e81d0){var _0x59cc47={};var _0x33b84a={};var _0x1e0113;var _0x2b9426;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x154a8a['params']['id']}})['then'](handleEntityNotFound(_0x3fcb94,null))[_0xa393('0x25')](function(_0x674fc5){if(_0x674fc5){_0x1e0113=_0x674fc5;_0x33b84a[_0xa393('0x31')]=_['keys'](db[_0xa393('0x4e')][_0xa393('0x2d')]);_0x33b84a[_0xa393('0x32')]=_[_0xa393('0x46')](_0x154a8a[_0xa393('0x32')]);_0x33b84a['filters']=_[_0xa393('0x33')](_0x33b84a[_0xa393('0x31')],_0x33b84a[_0xa393('0x32')]);_0x59cc47[_0xa393('0x35')]=_['intersection'](_0x33b84a[_0xa393('0x31')],qs['fields'](_0x154a8a[_0xa393('0x32')][_0xa393('0x34')]));_0x59cc47['attributes']=_0x59cc47['attributes'][_0xa393('0x36')]?_0x59cc47['attributes']:_0x33b84a[_0xa393('0x31')];_0x59cc47[_0xa393('0x39')]=qs[_0xa393('0x3a')](_0x154a8a[_0xa393('0x32')][_0xa393('0x3a')]);_0x59cc47[_0xa393('0x3b')]=qs[_0xa393('0x3c')](_[_0xa393('0x3d')](_0x154a8a[_0xa393('0x32')],_0x33b84a['filters']));if(_0x154a8a['query'][_0xa393('0x3e')]){_0x59cc47[_0xa393('0x3b')]=_[_0xa393('0x3f')](_0x59cc47[_0xa393('0x3b')],{'$or':_['map'](_0x59cc47[_0xa393('0x35')],function(_0x43286f){var _0x4121ef={};_0x4121ef[_0x43286f]={'$like':'%'+_0x154a8a[_0xa393('0x32')][_0xa393('0x3e')]+'%'};return _0x4121ef;})});}_0x59cc47=_[_0xa393('0x3f')]({},_0x59cc47,_0x154a8a[_0xa393('0x40')]);return _0x1e0113['getDescriptions'](_0x59cc47);}})[_0xa393('0x25')](function(_0x5b77fd){if(_0x5b77fd){_0x2b9426=_0x5b77fd[_0xa393('0x36')];if(!_0x154a8a['query'][_0xa393('0x37')](_0xa393('0x38'))){_0x59cc47['limit']=qs['limit'](_0x154a8a[_0xa393('0x32')][_0xa393('0x1d')]);_0x59cc47[_0xa393('0x1c')]=qs[_0xa393('0x1c')](_0x154a8a['query'][_0xa393('0x1c')]);}return _0x1e0113[_0xa393('0x50')](_0x59cc47);}})[_0xa393('0x25')](function(_0x5a54c1){if(_0x5a54c1){return _0x5a54c1?{'count':_0x2b9426,'rows':_0x5a54c1}:null;}})[_0xa393('0x25')](respondWithResult(_0x3fcb94,null))[_0xa393('0x4b')](handleError(_0x3fcb94,null));};exports[_0xa393('0x51')]=function(_0x59e26a,_0x4df96a,_0x3df239){var _0x4cac2e={};var _0x47d709={};var _0x122f79;var _0xe74d57;return db[_0xa393('0x2c')]['findOne']({'where':{'id':_0x59e26a[_0xa393('0x4c')]['id']}})[_0xa393('0x25')](handleEntityNotFound(_0x4df96a,null))['then'](function(_0x4d1e4f){if(_0x4d1e4f){_0x122f79=_0x4d1e4f;_0x47d709[_0xa393('0x31')]=_[_0xa393('0x46')](db[_0xa393('0x4e')][_0xa393('0x2d')]);_0x47d709[_0xa393('0x32')]=_[_0xa393('0x46')](_0x59e26a[_0xa393('0x32')]);_0x47d709[_0xa393('0x3c')]=_[_0xa393('0x33')](_0x47d709[_0xa393('0x31')],_0x47d709[_0xa393('0x32')]);_0x4cac2e[_0xa393('0x35')]=_[_0xa393('0x33')](_0x47d709[_0xa393('0x31')],qs[_0xa393('0x34')](_0x59e26a[_0xa393('0x32')][_0xa393('0x34')]));_0x4cac2e[_0xa393('0x35')]=_0x4cac2e[_0xa393('0x35')]['length']?_0x4cac2e[_0xa393('0x35')]:_0x47d709[_0xa393('0x31')];_0x4cac2e[_0xa393('0x39')]=qs[_0xa393('0x3a')](_0x59e26a[_0xa393('0x32')]['sort']);_0x4cac2e['where']=qs[_0xa393('0x3c')](_[_0xa393('0x3d')](_0x59e26a[_0xa393('0x32')],_0x47d709['filters']));if(_0x59e26a[_0xa393('0x32')][_0xa393('0x3e')]){_0x4cac2e[_0xa393('0x3b')]=_[_0xa393('0x3f')](_0x4cac2e['where'],{'$or':_[_0xa393('0x2b')](_0x4cac2e['attributes'],function(_0x4b6e43){var _0x100ff9={};_0x100ff9[_0x4b6e43]={'$like':'%'+_0x59e26a['query']['filter']+'%'};return _0x100ff9;})});}_0x4cac2e=_[_0xa393('0x3f')]({},_0x4cac2e,_0x59e26a[_0xa393('0x40')]);return _0x122f79[_0xa393('0x51')](_0x4cac2e);}})[_0xa393('0x25')](function(_0x26fd88){if(_0x26fd88){_0xe74d57=_0x26fd88['length'];if(!_0x59e26a[_0xa393('0x32')]['hasOwnProperty'](_0xa393('0x38'))){_0x4cac2e[_0xa393('0x1d')]=qs[_0xa393('0x1d')](_0x59e26a[_0xa393('0x32')][_0xa393('0x1d')]);_0x4cac2e[_0xa393('0x1c')]=qs[_0xa393('0x1c')](_0x59e26a[_0xa393('0x32')][_0xa393('0x1c')]);}return _0x122f79[_0xa393('0x51')](_0x4cac2e);}})['then'](function(_0x20a4c5){if(_0x20a4c5){return _0x20a4c5?{'count':_0xe74d57,'rows':_0x20a4c5}:null;}})[_0xa393('0x25')](respondWithResult(_0x4df96a,null))[_0xa393('0x4b')](handleError(_0x4df96a,null));}; \ No newline at end of file +var _0x3050=['where','merge','filter','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','update','destroy','findOne','getSubjects','FreshsalesField','getDescriptions','getFields','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','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','reject','save','then','end','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x3050,0x69));var _0x0305=function(_0x23e8a2,_0x42cf10){_0x23e8a2=_0x23e8a2-0x0;var _0x3d9fe4=_0x3050[_0x23e8a2];return _0x3d9fe4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0305('0x0'));var zipdir=require(_0x0305('0x1'));var jsonpatch=require(_0x0305('0x2'));var rp=require(_0x0305('0x3'));var moment=require(_0x0305('0x4'));var BPromise=require(_0x0305('0x5'));var Mustache=require(_0x0305('0x6'));var util=require(_0x0305('0x7'));var path=require(_0x0305('0x8'));var sox=require(_0x0305('0x9'));var csv=require(_0x0305('0xa'));var ejs=require(_0x0305('0xb'));var fs=require('fs');var fs_extra=require(_0x0305('0xc'));var _=require(_0x0305('0xd'));var squel=require(_0x0305('0xe'));var crypto=require(_0x0305('0xf'));var jsforce=require(_0x0305('0x10'));var deskjs=require(_0x0305('0x11'));var toCsv=require('to-csv');var querystring=require(_0x0305('0x12'));var Papa=require(_0x0305('0x13'));var Redis=require(_0x0305('0x14'));var authService=require(_0x0305('0x15'));var qs=require(_0x0305('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0305('0x17'));var logger=require(_0x0305('0x18'))(_0x0305('0x19'));var utils=require(_0x0305('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0305('0x1b'))['db'];function respondWithStatusCode(_0x3b3a7d,_0x41b72b){_0x41b72b=_0x41b72b||0xcc;return function(_0x1e80aa){if(_0x1e80aa){return _0x3b3a7d[_0x0305('0x1c')](_0x41b72b);}return _0x3b3a7d['status'](_0x41b72b)['end']();};}function respondWithResult(_0x19f635,_0x35c86f){_0x35c86f=_0x35c86f||0xc8;return function(_0x15b294){if(_0x15b294){return _0x19f635[_0x0305('0x1d')](_0x35c86f)['json'](_0x15b294);}};}function respondWithFilteredResult(_0x260be1,_0x380319){return function(_0x397571){if(_0x397571){var _0x5ae5eb=typeof _0x380319['offset']===_0x0305('0x1e')&&typeof _0x380319[_0x0305('0x1f')]==='undefined';var _0x1df8d4=_0x397571[_0x0305('0x20')];var _0x552e82=_0x5ae5eb?0x0:_0x380319[_0x0305('0x21')];var _0x49d92e=_0x5ae5eb?_0x397571[_0x0305('0x20')]:_0x380319['offset']+_0x380319['limit'];var _0x48f447;if(_0x49d92e>=_0x1df8d4){_0x49d92e=_0x1df8d4;_0x48f447=0xc8;}else{_0x48f447=0xce;}_0x260be1[_0x0305('0x1d')](_0x48f447);return _0x260be1[_0x0305('0x22')](_0x0305('0x23'),_0x552e82+'-'+_0x49d92e+'/'+_0x1df8d4)[_0x0305('0x24')](_0x397571);}return null;};}function patchUpdates(_0x1aa36c){return function(_0x16bd42){try{jsonpatch['apply'](_0x16bd42,_0x1aa36c,!![]);}catch(_0x5dda51){return BPromise[_0x0305('0x25')](_0x5dda51);}return _0x16bd42[_0x0305('0x26')]();};}function saveUpdates(_0x29e919,_0x276d34){return function(_0x45f107){if(_0x45f107){return _0x45f107['update'](_0x29e919)[_0x0305('0x27')](function(_0x51410a){return _0x51410a;});}return null;};}function removeEntity(_0x1c8b4a,_0x21939a){return function(_0x516da2){if(_0x516da2){return _0x516da2['destroy']()[_0x0305('0x27')](function(){_0x1c8b4a[_0x0305('0x1d')](0xcc)[_0x0305('0x28')]();});}};}function handleEntityNotFound(_0x58affd,_0x4bb03b){return function(_0x1ee02c){if(!_0x1ee02c){_0x58affd['sendStatus'](0x194);}return _0x1ee02c;};}function handleError(_0x4bbd05,_0x391495){_0x391495=_0x391495||0x1f4;return function(_0xd46c9c){logger['error'](_0xd46c9c[_0x0305('0x29')]);if(_0xd46c9c[_0x0305('0x2a')]){delete _0xd46c9c[_0x0305('0x2a')];}_0x4bbd05['status'](_0x391495)[_0x0305('0x2b')](_0xd46c9c);};}exports[_0x0305('0x2c')]=function(_0x23c994,_0x5ba8a0){var _0x34cc11={},_0x48e581={},_0x5a2623={'count':0x0,'rows':[]};var _0x1998a2=_[_0x0305('0x2d')](db[_0x0305('0x2e')][_0x0305('0x2f')],function(_0x20c844){return{'name':_0x20c844['fieldName'],'type':_0x20c844[_0x0305('0x30')][_0x0305('0x31')]};});_0x48e581[_0x0305('0x32')]=_[_0x0305('0x2d')](_0x1998a2,_0x0305('0x2a'));_0x48e581[_0x0305('0x33')]=_[_0x0305('0x34')](_0x23c994[_0x0305('0x33')]);_0x48e581[_0x0305('0x35')]=_['intersection'](_0x48e581[_0x0305('0x32')],_0x48e581[_0x0305('0x33')]);_0x34cc11[_0x0305('0x36')]=_[_0x0305('0x37')](_0x48e581['model'],qs[_0x0305('0x38')](_0x23c994[_0x0305('0x33')]['fields']));_0x34cc11[_0x0305('0x36')]=_0x34cc11[_0x0305('0x36')][_0x0305('0x39')]?_0x34cc11[_0x0305('0x36')]:_0x48e581['model'];if(!_0x23c994[_0x0305('0x33')][_0x0305('0x3a')](_0x0305('0x3b'))){_0x34cc11['limit']=qs[_0x0305('0x1f')](_0x23c994['query'][_0x0305('0x1f')]);_0x34cc11[_0x0305('0x21')]=qs[_0x0305('0x21')](_0x23c994[_0x0305('0x33')][_0x0305('0x21')]);}_0x34cc11[_0x0305('0x3c')]=qs['sort'](_0x23c994['query'][_0x0305('0x3d')]);_0x34cc11['where']=qs['filters'](_[_0x0305('0x3e')](_0x23c994[_0x0305('0x33')],_0x48e581[_0x0305('0x35')]),_0x1998a2);if(_0x23c994[_0x0305('0x33')]['filter']){_0x34cc11[_0x0305('0x3f')]=_[_0x0305('0x40')](_0x34cc11[_0x0305('0x3f')],{'$or':_[_0x0305('0x2d')](_0x1998a2,function(_0x31136b){if(_0x31136b[_0x0305('0x30')]!=='VIRTUAL'){var _0x52b99c={};_0x52b99c[_0x31136b['name']]={'$like':'%'+_0x23c994[_0x0305('0x33')][_0x0305('0x41')]+'%'};return _0x52b99c;}})});}_0x34cc11=_[_0x0305('0x40')]({},_0x34cc11,_0x23c994[_0x0305('0x42')]);var _0x460dd4={'where':_0x34cc11[_0x0305('0x3f')]};return db[_0x0305('0x2e')][_0x0305('0x20')](_0x460dd4)[_0x0305('0x27')](function(_0x73fffc){_0x5a2623['count']=_0x73fffc;if(_0x23c994['query']['includeAll']){_0x34cc11[_0x0305('0x43')]=[{'all':!![]}];}return db[_0x0305('0x2e')][_0x0305('0x44')](_0x34cc11);})['then'](function(_0x58d5f2){_0x5a2623[_0x0305('0x45')]=_0x58d5f2;return _0x5a2623;})[_0x0305('0x27')](respondWithFilteredResult(_0x5ba8a0,_0x34cc11))[_0x0305('0x46')](handleError(_0x5ba8a0,null));};exports[_0x0305('0x47')]=function(_0x4754b8,_0x369a37){var _0x576e14={'raw':![],'where':{'id':_0x4754b8[_0x0305('0x48')]['id']}},_0x37aacc={};_0x37aacc['model']=_['keys'](db['FreshsalesConfiguration'][_0x0305('0x2f')]);_0x37aacc[_0x0305('0x33')]=_['keys'](_0x4754b8[_0x0305('0x33')]);_0x37aacc[_0x0305('0x35')]=_[_0x0305('0x37')](_0x37aacc[_0x0305('0x32')],_0x37aacc['query']);_0x576e14['attributes']=_[_0x0305('0x37')](_0x37aacc[_0x0305('0x32')],qs['fields'](_0x4754b8[_0x0305('0x33')]['fields']));_0x576e14['attributes']=_0x576e14['attributes']['length']?_0x576e14[_0x0305('0x36')]:_0x37aacc[_0x0305('0x32')];if(_0x4754b8[_0x0305('0x33')][_0x0305('0x49')]){_0x576e14[_0x0305('0x43')]=[{'all':!![]}];}_0x576e14=_[_0x0305('0x40')]({},_0x576e14,_0x4754b8[_0x0305('0x42')]);return db[_0x0305('0x2e')][_0x0305('0x4a')](_0x576e14)[_0x0305('0x27')](handleEntityNotFound(_0x369a37,null))[_0x0305('0x27')](respondWithResult(_0x369a37,null))[_0x0305('0x46')](handleError(_0x369a37,null));};exports[_0x0305('0x4b')]=function(_0x17d5bb,_0x94cde0){return db[_0x0305('0x2e')]['create'](_0x17d5bb[_0x0305('0x4c')],{})[_0x0305('0x27')](respondWithResult(_0x94cde0,0xc9))[_0x0305('0x46')](handleError(_0x94cde0,null));};exports[_0x0305('0x4d')]=function(_0x586eea,_0x4a09af){if(_0x586eea['body']['id']){delete _0x586eea[_0x0305('0x4c')]['id'];}return db[_0x0305('0x2e')]['find']({'where':{'id':_0x586eea[_0x0305('0x48')]['id']}})[_0x0305('0x27')](handleEntityNotFound(_0x4a09af,null))[_0x0305('0x27')](saveUpdates(_0x586eea[_0x0305('0x4c')],null))[_0x0305('0x27')](respondWithResult(_0x4a09af,null))[_0x0305('0x46')](handleError(_0x4a09af,null));};exports[_0x0305('0x4e')]=function(_0x4bc286,_0x31c4ce){return db['FreshsalesConfiguration'][_0x0305('0x4a')]({'where':{'id':_0x4bc286[_0x0305('0x48')]['id']}})[_0x0305('0x27')](handleEntityNotFound(_0x31c4ce,null))[_0x0305('0x27')](removeEntity(_0x31c4ce,null))['catch'](handleError(_0x31c4ce,null));};exports['getSubjects']=function(_0x5b67d4,_0x30ef64,_0x1d350d){var _0x14340d={};var _0x50b7cb={};var _0x2c19aa;var _0x11d71b;return db[_0x0305('0x2e')][_0x0305('0x4f')]({'where':{'id':_0x5b67d4[_0x0305('0x48')]['id']}})['then'](handleEntityNotFound(_0x30ef64,null))[_0x0305('0x27')](function(_0x489c84){if(_0x489c84){_0x2c19aa=_0x489c84;_0x50b7cb[_0x0305('0x32')]=_['keys'](db['FreshsalesField'][_0x0305('0x2f')]);_0x50b7cb['query']=_['keys'](_0x5b67d4['query']);_0x50b7cb[_0x0305('0x35')]=_[_0x0305('0x37')](_0x50b7cb[_0x0305('0x32')],_0x50b7cb[_0x0305('0x33')]);_0x14340d[_0x0305('0x36')]=_['intersection'](_0x50b7cb['model'],qs[_0x0305('0x38')](_0x5b67d4[_0x0305('0x33')][_0x0305('0x38')]));_0x14340d[_0x0305('0x36')]=_0x14340d[_0x0305('0x36')][_0x0305('0x39')]?_0x14340d['attributes']:_0x50b7cb[_0x0305('0x32')];_0x14340d[_0x0305('0x3c')]=qs['sort'](_0x5b67d4[_0x0305('0x33')][_0x0305('0x3d')]);_0x14340d[_0x0305('0x3f')]=qs[_0x0305('0x35')](_[_0x0305('0x3e')](_0x5b67d4['query'],_0x50b7cb[_0x0305('0x35')]));if(_0x5b67d4[_0x0305('0x33')][_0x0305('0x41')]){_0x14340d[_0x0305('0x3f')]=_[_0x0305('0x40')](_0x14340d[_0x0305('0x3f')],{'$or':_[_0x0305('0x2d')](_0x14340d[_0x0305('0x36')],function(_0x418cc3){var _0x578c33={};_0x578c33[_0x418cc3]={'$like':'%'+_0x5b67d4[_0x0305('0x33')][_0x0305('0x41')]+'%'};return _0x578c33;})});}_0x14340d=_[_0x0305('0x40')]({},_0x14340d,_0x5b67d4['options']);return _0x2c19aa['getSubjects'](_0x14340d);}})[_0x0305('0x27')](function(_0x384f48){if(_0x384f48){_0x11d71b=_0x384f48[_0x0305('0x39')];if(!_0x5b67d4[_0x0305('0x33')][_0x0305('0x3a')](_0x0305('0x3b'))){_0x14340d[_0x0305('0x1f')]=qs[_0x0305('0x1f')](_0x5b67d4[_0x0305('0x33')][_0x0305('0x1f')]);_0x14340d[_0x0305('0x21')]=qs[_0x0305('0x21')](_0x5b67d4[_0x0305('0x33')][_0x0305('0x21')]);}return _0x2c19aa[_0x0305('0x50')](_0x14340d);}})[_0x0305('0x27')](function(_0x31dd67){if(_0x31dd67){return _0x31dd67?{'count':_0x11d71b,'rows':_0x31dd67}:null;}})[_0x0305('0x27')](respondWithResult(_0x30ef64,null))[_0x0305('0x46')](handleError(_0x30ef64,null));};exports['getDescriptions']=function(_0x45faff,_0xb8218e,_0x75579b){var _0xc1e76={};var _0x3b3bce={};var _0x11cb83;var _0x4a48f;return db['FreshsalesConfiguration'][_0x0305('0x4f')]({'where':{'id':_0x45faff[_0x0305('0x48')]['id']}})[_0x0305('0x27')](handleEntityNotFound(_0xb8218e,null))[_0x0305('0x27')](function(_0x5b6984){if(_0x5b6984){_0x11cb83=_0x5b6984;_0x3b3bce[_0x0305('0x32')]=_['keys'](db[_0x0305('0x51')][_0x0305('0x2f')]);_0x3b3bce[_0x0305('0x33')]=_[_0x0305('0x34')](_0x45faff[_0x0305('0x33')]);_0x3b3bce['filters']=_[_0x0305('0x37')](_0x3b3bce['model'],_0x3b3bce['query']);_0xc1e76[_0x0305('0x36')]=_[_0x0305('0x37')](_0x3b3bce['model'],qs[_0x0305('0x38')](_0x45faff[_0x0305('0x33')][_0x0305('0x38')]));_0xc1e76[_0x0305('0x36')]=_0xc1e76[_0x0305('0x36')][_0x0305('0x39')]?_0xc1e76[_0x0305('0x36')]:_0x3b3bce[_0x0305('0x32')];_0xc1e76[_0x0305('0x3c')]=qs['sort'](_0x45faff[_0x0305('0x33')][_0x0305('0x3d')]);_0xc1e76[_0x0305('0x3f')]=qs[_0x0305('0x35')](_['pick'](_0x45faff['query'],_0x3b3bce['filters']));if(_0x45faff[_0x0305('0x33')][_0x0305('0x41')]){_0xc1e76['where']=_['merge'](_0xc1e76[_0x0305('0x3f')],{'$or':_['map'](_0xc1e76[_0x0305('0x36')],function(_0x5221a5){var _0x45319d={};_0x45319d[_0x5221a5]={'$like':'%'+_0x45faff[_0x0305('0x33')][_0x0305('0x41')]+'%'};return _0x45319d;})});}_0xc1e76=_[_0x0305('0x40')]({},_0xc1e76,_0x45faff[_0x0305('0x42')]);return _0x11cb83[_0x0305('0x52')](_0xc1e76);}})[_0x0305('0x27')](function(_0x5f1465){if(_0x5f1465){_0x4a48f=_0x5f1465[_0x0305('0x39')];if(!_0x45faff['query'][_0x0305('0x3a')]('nolimit')){_0xc1e76[_0x0305('0x1f')]=qs[_0x0305('0x1f')](_0x45faff[_0x0305('0x33')][_0x0305('0x1f')]);_0xc1e76[_0x0305('0x21')]=qs[_0x0305('0x21')](_0x45faff[_0x0305('0x33')]['offset']);}return _0x11cb83['getDescriptions'](_0xc1e76);}})['then'](function(_0x3ab6e7){if(_0x3ab6e7){return _0x3ab6e7?{'count':_0x4a48f,'rows':_0x3ab6e7}:null;}})[_0x0305('0x27')](respondWithResult(_0xb8218e,null))[_0x0305('0x46')](handleError(_0xb8218e,null));};exports[_0x0305('0x53')]=function(_0x2109b1,_0x135513,_0x5f1dd9){var _0x3b34ae={};var _0x192711={};var _0x4543a9;var _0x5053d7;return db[_0x0305('0x2e')][_0x0305('0x4f')]({'where':{'id':_0x2109b1[_0x0305('0x48')]['id']}})[_0x0305('0x27')](handleEntityNotFound(_0x135513,null))['then'](function(_0x1d24ec){if(_0x1d24ec){_0x4543a9=_0x1d24ec;_0x192711['model']=_[_0x0305('0x34')](db[_0x0305('0x51')][_0x0305('0x2f')]);_0x192711[_0x0305('0x33')]=_['keys'](_0x2109b1[_0x0305('0x33')]);_0x192711[_0x0305('0x35')]=_[_0x0305('0x37')](_0x192711[_0x0305('0x32')],_0x192711['query']);_0x3b34ae[_0x0305('0x36')]=_[_0x0305('0x37')](_0x192711[_0x0305('0x32')],qs[_0x0305('0x38')](_0x2109b1[_0x0305('0x33')]['fields']));_0x3b34ae[_0x0305('0x36')]=_0x3b34ae[_0x0305('0x36')]['length']?_0x3b34ae[_0x0305('0x36')]:_0x192711[_0x0305('0x32')];_0x3b34ae['order']=qs[_0x0305('0x3d')](_0x2109b1[_0x0305('0x33')][_0x0305('0x3d')]);_0x3b34ae[_0x0305('0x3f')]=qs['filters'](_['pick'](_0x2109b1[_0x0305('0x33')],_0x192711[_0x0305('0x35')]));if(_0x2109b1[_0x0305('0x33')][_0x0305('0x41')]){_0x3b34ae['where']=_[_0x0305('0x40')](_0x3b34ae['where'],{'$or':_['map'](_0x3b34ae['attributes'],function(_0xb2484c){var _0x16ce70={};_0x16ce70[_0xb2484c]={'$like':'%'+_0x2109b1[_0x0305('0x33')][_0x0305('0x41')]+'%'};return _0x16ce70;})});}_0x3b34ae=_[_0x0305('0x40')]({},_0x3b34ae,_0x2109b1[_0x0305('0x42')]);return _0x4543a9['getFields'](_0x3b34ae);}})[_0x0305('0x27')](function(_0x21ec66){if(_0x21ec66){_0x5053d7=_0x21ec66[_0x0305('0x39')];if(!_0x2109b1[_0x0305('0x33')][_0x0305('0x3a')](_0x0305('0x3b'))){_0x3b34ae[_0x0305('0x1f')]=qs[_0x0305('0x1f')](_0x2109b1['query']['limit']);_0x3b34ae[_0x0305('0x21')]=qs[_0x0305('0x21')](_0x2109b1[_0x0305('0x33')][_0x0305('0x21')]);}return _0x4543a9['getFields'](_0x3b34ae);}})[_0x0305('0x27')](function(_0x4eafcf){if(_0x4eafcf){return _0x4eafcf?{'count':_0x5053d7,'rows':_0x4eafcf}:null;}})['then'](respondWithResult(_0x135513,null))[_0x0305('0x46')](handleError(_0x135513,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 4211e13..487ddeb 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 _0x3f97=['int_freshsales_configurations','lodash','api','moment','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','define','FreshsalesConfiguration'];(function(_0x4ba925,_0x5e3d76){var _0x1a8189=function(_0x5ce32a){while(--_0x5ce32a){_0x4ba925['push'](_0x4ba925['shift']());}};_0x1a8189(++_0x5e3d76);}(_0x3f97,0x90));var _0x73f9=function(_0x21671c,_0x1fdbec){_0x21671c=_0x21671c-0x0;var _0x138093=_0x3f97[_0x21671c];return _0x138093;};'use strict';var _=require(_0x73f9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x73f9('0x1'));var moment=require(_0x73f9('0x2'));var BPromise=require('bluebird');var rp=require(_0x73f9('0x3'));var fs=require('fs');var path=require(_0x73f9('0x4'));var rimraf=require(_0x73f9('0x5'));var config=require(_0x73f9('0x6'));var attributes=require(_0x73f9('0x7'));module['exports']=function(_0x3ba19d,_0x572bfa){return _0x3ba19d[_0x73f9('0x8')](_0x73f9('0x9'),attributes,{'tableName':_0x73f9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd176=['../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','lodash','util','../../config/logger','moment','rimraf'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xd176,0x1b4));var _0x6d17=function(_0x503950,_0x5022eb){_0x503950=_0x503950-0x0;var _0x1657a9=_0xd176[_0x503950];return _0x1657a9;};'use strict';var _=require(_0x6d17('0x0'));var util=require(_0x6d17('0x1'));var logger=require(_0x6d17('0x2'))('api');var moment=require(_0x6d17('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6d17('0x4'));var config=require(_0x6d17('0x5'));var attributes=require(_0x6d17('0x6'));module[_0x6d17('0x7')]=function(_0x5fe125,_0xedfd87){return _0x5fe125[_0x6d17('0x8')]('FreshsalesConfiguration',attributes,{'tableName':'int_freshsales_configurations','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 d25226b..80704ba 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 _0xaff3=['bluebird','../../mysqldb','../../config/utils','jayson/promise','client','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','util','moment'];(function(_0xbf9234,_0xd2cf7f){var _0x24d12c=function(_0x7d3158){while(--_0x7d3158){_0xbf9234['push'](_0xbf9234['shift']());}};_0x24d12c(++_0xd2cf7f);}(_0xaff3,0x1ae));var _0x3aff=function(_0x51ce07,_0x1fbfa7){_0x51ce07=_0x51ce07-0x0;var _0x51dfc0=_0xaff3[_0x51ce07];return _0x51dfc0;};'use strict';var _=require('lodash');var util=require(_0x3aff('0x0'));var moment=require(_0x3aff('0x1'));var BPromise=require(_0x3aff('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3aff('0x3'))['db'];var utils=require(_0x3aff('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x3aff('0x5'));var client=jayson[_0x3aff('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c3e7f,_0x5ccb3b,_0x16439f){return new BPromise(function(_0x2481ec,_0x139225){return client['request'](_0x2c3e7f,_0x16439f)['then'](function(_0x745b87){logger[_0x3aff('0x7')](_0x3aff('0x8'),_0x5ccb3b,_0x3aff('0x9'));logger[_0x3aff('0xa')](_0x3aff('0xb'),_0x5ccb3b,'request\x20sent',JSON[_0x3aff('0xc')](_0x745b87));if(_0x745b87['error']){if(_0x745b87['error'][_0x3aff('0xd')]===0x1f4){logger[_0x3aff('0xe')](_0x3aff('0x8'),_0x5ccb3b,_0x745b87[_0x3aff('0xe')][_0x3aff('0xf')]);return _0x139225(_0x745b87[_0x3aff('0xe')][_0x3aff('0xf')]);}logger[_0x3aff('0xe')](_0x3aff('0x8'),_0x5ccb3b,_0x745b87[_0x3aff('0xe')][_0x3aff('0xf')]);return _0x2481ec(_0x745b87['error']['message']);}else{logger[_0x3aff('0x7')](_0x3aff('0x8'),_0x5ccb3b,_0x3aff('0x9'));_0x2481ec(_0x745b87['result']['message']);}})['catch'](function(_0x1dd4fa){logger[_0x3aff('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x5ccb3b,_0x1dd4fa);_0x139225(_0x1dd4fa);});});} \ No newline at end of file +var _0x0af5=['request\x20sent','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','catch','lodash','util','bluebird','../../config/utils','../../config/environment','client','http','info','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x47a468,_0x333c10){var _0x1306ed=function(_0x59cbfe){while(--_0x59cbfe){_0x47a468['push'](_0x47a468['shift']());}};_0x1306ed(++_0x333c10);}(_0x0af5,0xd6));var _0x50af=function(_0x1a11d8,_0x4ae6e8){_0x1a11d8=_0x1a11d8-0x0;var _0x2100ce=_0x0af5[_0x1a11d8];return _0x2100ce;};'use strict';var _=require(_0x50af('0x0'));var util=require(_0x50af('0x1'));var moment=require('moment');var BPromise=require(_0x50af('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x50af('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x50af('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x50af('0x5')][_0x50af('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x14e40b,_0x4c94f9,_0x1616a3){return new BPromise(function(_0x170c5d,_0x5ee4f9){return client['request'](_0x14e40b,_0x1616a3)['then'](function(_0x5a603d){logger[_0x50af('0x7')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x4c94f9,'request\x20sent');logger[_0x50af('0x8')](_0x50af('0x9'),_0x4c94f9,_0x50af('0xa'),JSON['stringify'](_0x5a603d));if(_0x5a603d[_0x50af('0xb')]){if(_0x5a603d['error'][_0x50af('0xc')]===0x1f4){logger[_0x50af('0xb')](_0x50af('0xd'),_0x4c94f9,_0x5a603d[_0x50af('0xb')][_0x50af('0xe')]);return _0x5ee4f9(_0x5a603d[_0x50af('0xb')][_0x50af('0xe')]);}logger['error'](_0x50af('0xd'),_0x4c94f9,_0x5a603d[_0x50af('0xb')][_0x50af('0xe')]);return _0x170c5d(_0x5a603d['error']['message']);}else{logger[_0x50af('0x7')](_0x50af('0xd'),_0x4c94f9,_0x50af('0xa'));_0x170c5d(_0x5a603d['result']['message']);}})[_0x50af('0xf')](function(_0x565dd6){logger[_0x50af('0xb')](_0x50af('0xd'),_0x4c94f9,_0x565dd6);_0x5ee4f9(_0x565dd6);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index f6f1155..548a6fc 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 _0x261b=['./intFreshsalesField.controller','isAuthenticated','index','get','/:id','show','post','create','update','delete','multer','util','fs-extra','../../components/interaction/service'];(function(_0x2e7b95,_0x36bd6c){var _0x28ba37=function(_0x318c29){while(--_0x318c29){_0x2e7b95['push'](_0x2e7b95['shift']());}};_0x28ba37(++_0x36bd6c);}(_0x261b,0x15a));var _0xb261=function(_0x24461c,_0x142b2f){_0x24461c=_0x24461c-0x0;var _0x4d7e9f=_0x261b[_0x24461c];return _0x4d7e9f;};'use strict';var multer=require(_0xb261('0x0'));var util=require(_0xb261('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xb261('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xb261('0x3'));var config=require('../../config/environment');var controller=require(_0xb261('0x4'));router['get']('/',auth[_0xb261('0x5')](),controller[_0xb261('0x6')]);router[_0xb261('0x7')](_0xb261('0x8'),auth['isAuthenticated'](),controller[_0xb261('0x9')]);router[_0xb261('0xa')]('/',auth[_0xb261('0x5')](),controller[_0xb261('0xb')]);router['put'](_0xb261('0x8'),auth[_0xb261('0x5')](),controller[_0xb261('0xc')]);router[_0xb261('0xd')](_0xb261('0x8'),auth[_0xb261('0x5')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x0a12=['index','create','put','/:id','update','delete','destroy','exports','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x0a12,0xb8));var _0x20a1=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0x0a12[_0x3305de];return _0x3b5a84;};'use strict';var multer=require('multer');var util=require(_0x20a1('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x20a1('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x20a1('0x2'));var interaction=require(_0x20a1('0x3'));var config=require(_0x20a1('0x4'));var controller=require(_0x20a1('0x5'));router[_0x20a1('0x6')]('/',auth[_0x20a1('0x7')](),controller[_0x20a1('0x8')]);router['get']('/:id',auth[_0x20a1('0x7')](),controller['show']);router['post']('/',auth[_0x20a1('0x7')](),controller[_0x20a1('0x9')]);router[_0x20a1('0xa')](_0x20a1('0xb'),auth[_0x20a1('0x7')](),controller[_0x20a1('0xc')]);router[_0x20a1('0xd')]('/:id',auth[_0x20a1('0x7')](),controller[_0x20a1('0xe')]);module[_0x20a1('0xf')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index a4338a6..652003c 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 _0x7aa1=['STRING','variable','BOOLEAN','exports','ENUM','string','customVariable','keyValue'];(function(_0x21d56f,_0x1dcc84){var _0x489ec7=function(_0x48babc){while(--_0x48babc){_0x21d56f['push'](_0x21d56f['shift']());}};_0x489ec7(++_0x1dcc84);}(_0x7aa1,0xbb));var _0x17aa=function(_0x377335,_0x49587b){_0x377335=_0x377335-0x0;var _0x39ef3f=_0x7aa1[_0x377335];return _0x39ef3f;};'use strict';var Sequelize=require('sequelize');module[_0x17aa('0x0')]={'type':{'type':Sequelize[_0x17aa('0x1')](_0x17aa('0x2'),'variable',_0x17aa('0x3'),_0x17aa('0x4'),'picklist'),'defaultValue':_0x17aa('0x2')},'content':{'type':Sequelize[_0x17aa('0x5')]},'key':{'type':Sequelize[_0x17aa('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x17aa('0x2'),_0x17aa('0x6'),_0x17aa('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x17aa('0x5')]},'nameField':{'type':Sequelize[_0x17aa('0x5')]},'customField':{'type':Sequelize[_0x17aa('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x17aa('0x5')]}}; \ No newline at end of file +var _0xa06c=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','sequelize','exports'];(function(_0x5c5198,_0x2fccc3){var _0x6f1f5f=function(_0x4adb0d){while(--_0x4adb0d){_0x5c5198['push'](_0x5c5198['shift']());}};_0x6f1f5f(++_0x2fccc3);}(_0xa06c,0x1d2));var _0xca06=function(_0x453d7c,_0x118408){_0x453d7c=_0x453d7c-0x0;var _0x4193a5=_0xa06c[_0x453d7c];return _0x4193a5;};'use strict';var Sequelize=require(_0xca06('0x0'));module[_0xca06('0x1')]={'type':{'type':Sequelize[_0xca06('0x2')](_0xca06('0x3'),_0xca06('0x4'),_0xca06('0x5'),_0xca06('0x6'),_0xca06('0x7')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xca06('0x2')]('string',_0xca06('0x4'),_0xca06('0x5'))},'keyContent':{'type':Sequelize[_0xca06('0x8')]},'idField':{'type':Sequelize[_0xca06('0x8')]},'nameField':{'type':Sequelize[_0xca06('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xca06('0x8')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index f879537..8532caf 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 _0x8d92=['attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','length','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','map','FreshsalesField','rawAttributes','fieldName','key','model','query','keys','filters','intersection'];(function(_0x4ce683,_0x3145ca){var _0xc4192b=function(_0x5291b8){while(--_0x5291b8){_0x4ce683['push'](_0x4ce683['shift']());}};_0xc4192b(++_0x3145ca);}(_0x8d92,0xb3));var _0x28d9=function(_0x1b8bda,_0x43ad31){_0x1b8bda=_0x1b8bda-0x0;var _0x1f7050=_0x8d92[_0x1b8bda];return _0x1f7050;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x28d9('0x0'));var zipdir=require(_0x28d9('0x1'));var jsonpatch=require(_0x28d9('0x2'));var rp=require(_0x28d9('0x3'));var moment=require(_0x28d9('0x4'));var BPromise=require(_0x28d9('0x5'));var Mustache=require(_0x28d9('0x6'));var util=require('util');var path=require(_0x28d9('0x7'));var sox=require('sox');var csv=require(_0x28d9('0x8'));var ejs=require(_0x28d9('0x9'));var fs=require('fs');var fs_extra=require(_0x28d9('0xa'));var _=require(_0x28d9('0xb'));var squel=require(_0x28d9('0xc'));var crypto=require(_0x28d9('0xd'));var jsforce=require(_0x28d9('0xe'));var deskjs=require(_0x28d9('0xf'));var toCsv=require(_0x28d9('0x8'));var querystring=require(_0x28d9('0x10'));var Papa=require(_0x28d9('0x11'));var Redis=require(_0x28d9('0x12'));var authService=require(_0x28d9('0x13'));var qs=require(_0x28d9('0x14'));var as=require(_0x28d9('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x28d9('0x16'))(_0x28d9('0x17'));var utils=require(_0x28d9('0x18'));var config=require(_0x28d9('0x19'));var licenseUtil=require(_0x28d9('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc8d341,_0x2c89e1){_0x2c89e1=_0x2c89e1||0xcc;return function(_0x5c6ff9){if(_0x5c6ff9){return _0xc8d341[_0x28d9('0x1b')](_0x2c89e1);}return _0xc8d341['status'](_0x2c89e1)[_0x28d9('0x1c')]();};}function respondWithResult(_0x13b0a9,_0x568f83){_0x568f83=_0x568f83||0xc8;return function(_0x492787){if(_0x492787){return _0x13b0a9[_0x28d9('0x1d')](_0x568f83)[_0x28d9('0x1e')](_0x492787);}};}function respondWithFilteredResult(_0x3639be,_0x4f599f){return function(_0x5b84ef){if(_0x5b84ef){var _0x478698=typeof _0x4f599f[_0x28d9('0x1f')]===_0x28d9('0x20')&&typeof _0x4f599f[_0x28d9('0x21')]===_0x28d9('0x20');var _0x26c8bd=_0x5b84ef[_0x28d9('0x22')];var _0x5f4cc7=_0x478698?0x0:_0x4f599f[_0x28d9('0x1f')];var _0x491169=_0x478698?_0x5b84ef[_0x28d9('0x22')]:_0x4f599f[_0x28d9('0x1f')]+_0x4f599f[_0x28d9('0x21')];var _0x46be72;if(_0x491169>=_0x26c8bd){_0x491169=_0x26c8bd;_0x46be72=0xc8;}else{_0x46be72=0xce;}_0x3639be[_0x28d9('0x1d')](_0x46be72);return _0x3639be[_0x28d9('0x23')](_0x28d9('0x24'),_0x5f4cc7+'-'+_0x491169+'/'+_0x26c8bd)[_0x28d9('0x1e')](_0x5b84ef);}return null;};}function patchUpdates(_0x2046ea){return function(_0x1060c3){try{jsonpatch[_0x28d9('0x25')](_0x1060c3,_0x2046ea,!![]);}catch(_0x115183){return BPromise[_0x28d9('0x26')](_0x115183);}return _0x1060c3[_0x28d9('0x27')]();};}function saveUpdates(_0x334aab,_0x395561){return function(_0x172642){if(_0x172642){return _0x172642[_0x28d9('0x28')](_0x334aab)[_0x28d9('0x29')](function(_0x18e1ca){return _0x18e1ca;});}return null;};}function removeEntity(_0x2aff15,_0x1ad4af){return function(_0x43d1d6){if(_0x43d1d6){return _0x43d1d6['destroy']()[_0x28d9('0x29')](function(){_0x2aff15[_0x28d9('0x1d')](0xcc)[_0x28d9('0x1c')]();});}};}function handleEntityNotFound(_0x572d32,_0x48c8c3){return function(_0x55d7b3){if(!_0x55d7b3){_0x572d32[_0x28d9('0x1b')](0x194);}return _0x55d7b3;};}function handleError(_0x1341a9,_0x5ed3f5){_0x5ed3f5=_0x5ed3f5||0x1f4;return function(_0x11ab68){logger[_0x28d9('0x2a')](_0x11ab68[_0x28d9('0x2b')]);if(_0x11ab68[_0x28d9('0x2c')]){delete _0x11ab68[_0x28d9('0x2c')];}_0x1341a9[_0x28d9('0x1d')](_0x5ed3f5)['send'](_0x11ab68);};}exports['index']=function(_0x23d72f,_0x4ada6c){var _0xc196b0={},_0xb4b108={},_0x11f113={'count':0x0,'rows':[]};var _0x22e349=_[_0x28d9('0x2d')](db[_0x28d9('0x2e')][_0x28d9('0x2f')],function(_0x37604d){return{'name':_0x37604d[_0x28d9('0x30')],'type':_0x37604d['type'][_0x28d9('0x31')]};});_0xb4b108[_0x28d9('0x32')]=_[_0x28d9('0x2d')](_0x22e349,_0x28d9('0x2c'));_0xb4b108[_0x28d9('0x33')]=_[_0x28d9('0x34')](_0x23d72f[_0x28d9('0x33')]);_0xb4b108[_0x28d9('0x35')]=_[_0x28d9('0x36')](_0xb4b108['model'],_0xb4b108[_0x28d9('0x33')]);_0xc196b0[_0x28d9('0x37')]=_[_0x28d9('0x36')](_0xb4b108[_0x28d9('0x32')],qs[_0x28d9('0x38')](_0x23d72f[_0x28d9('0x33')]['fields']));_0xc196b0[_0x28d9('0x37')]=_0xc196b0[_0x28d9('0x37')]['length']?_0xc196b0[_0x28d9('0x37')]:_0xb4b108[_0x28d9('0x32')];if(!_0x23d72f[_0x28d9('0x33')][_0x28d9('0x39')](_0x28d9('0x3a'))){_0xc196b0[_0x28d9('0x21')]=qs[_0x28d9('0x21')](_0x23d72f[_0x28d9('0x33')][_0x28d9('0x21')]);_0xc196b0[_0x28d9('0x1f')]=qs[_0x28d9('0x1f')](_0x23d72f[_0x28d9('0x33')]['offset']);}_0xc196b0[_0x28d9('0x3b')]=qs[_0x28d9('0x3c')](_0x23d72f[_0x28d9('0x33')][_0x28d9('0x3c')]);_0xc196b0[_0x28d9('0x3d')]=qs[_0x28d9('0x35')](_[_0x28d9('0x3e')](_0x23d72f[_0x28d9('0x33')],_0xb4b108['filters']),_0x22e349);if(_0x23d72f['query']['filter']){_0xc196b0['where']=_[_0x28d9('0x3f')](_0xc196b0[_0x28d9('0x3d')],{'$or':_[_0x28d9('0x2d')](_0x22e349,function(_0x1bdb9d){if(_0x1bdb9d[_0x28d9('0x40')]!==_0x28d9('0x41')){var _0x5bbcca={};_0x5bbcca[_0x1bdb9d[_0x28d9('0x2c')]]={'$like':'%'+_0x23d72f['query'][_0x28d9('0x42')]+'%'};return _0x5bbcca;}})});}_0xc196b0=_[_0x28d9('0x3f')]({},_0xc196b0,_0x23d72f[_0x28d9('0x43')]);var _0x488429={'where':_0xc196b0[_0x28d9('0x3d')]};return db[_0x28d9('0x2e')][_0x28d9('0x22')](_0x488429)[_0x28d9('0x29')](function(_0x3c41a6){_0x11f113['count']=_0x3c41a6;if(_0x23d72f[_0x28d9('0x33')][_0x28d9('0x44')]){_0xc196b0[_0x28d9('0x45')]=[{'all':!![]}];}return db['FreshsalesField']['findAll'](_0xc196b0);})[_0x28d9('0x29')](function(_0x5b7ef7){_0x11f113[_0x28d9('0x46')]=_0x5b7ef7;return _0x11f113;})[_0x28d9('0x29')](respondWithFilteredResult(_0x4ada6c,_0xc196b0))[_0x28d9('0x47')](handleError(_0x4ada6c,null));};exports[_0x28d9('0x48')]=function(_0x348ac4,_0x4d8dfb){var _0x34225c={'raw':!![],'where':{'id':_0x348ac4[_0x28d9('0x49')]['id']}},_0x822526={};_0x822526['model']=_['keys'](db[_0x28d9('0x2e')][_0x28d9('0x2f')]);_0x822526[_0x28d9('0x33')]=_[_0x28d9('0x34')](_0x348ac4['query']);_0x822526[_0x28d9('0x35')]=_['intersection'](_0x822526[_0x28d9('0x32')],_0x822526[_0x28d9('0x33')]);_0x34225c[_0x28d9('0x37')]=_['intersection'](_0x822526[_0x28d9('0x32')],qs[_0x28d9('0x38')](_0x348ac4[_0x28d9('0x33')][_0x28d9('0x38')]));_0x34225c[_0x28d9('0x37')]=_0x34225c[_0x28d9('0x37')][_0x28d9('0x4a')]?_0x34225c[_0x28d9('0x37')]:_0x822526[_0x28d9('0x32')];if(_0x348ac4[_0x28d9('0x33')][_0x28d9('0x44')]){_0x34225c[_0x28d9('0x45')]=[{'all':!![]}];}_0x34225c=_[_0x28d9('0x3f')]({},_0x34225c,_0x348ac4[_0x28d9('0x43')]);return db[_0x28d9('0x2e')]['find'](_0x34225c)[_0x28d9('0x29')](handleEntityNotFound(_0x4d8dfb,null))['then'](respondWithResult(_0x4d8dfb,null))[_0x28d9('0x47')](handleError(_0x4d8dfb,null));};exports[_0x28d9('0x4b')]=function(_0x682017,_0x34b11d){return db[_0x28d9('0x2e')][_0x28d9('0x4b')](_0x682017[_0x28d9('0x4c')],{})[_0x28d9('0x29')](respondWithResult(_0x34b11d,0xc9))['catch'](handleError(_0x34b11d,null));};exports[_0x28d9('0x28')]=function(_0x109308,_0x19eaea){if(_0x109308[_0x28d9('0x4c')]['id']){delete _0x109308[_0x28d9('0x4c')]['id'];}return db[_0x28d9('0x2e')][_0x28d9('0x4d')]({'where':{'id':_0x109308[_0x28d9('0x49')]['id']}})[_0x28d9('0x29')](handleEntityNotFound(_0x19eaea,null))[_0x28d9('0x29')](saveUpdates(_0x109308[_0x28d9('0x4c')],null))[_0x28d9('0x29')](respondWithResult(_0x19eaea,null))[_0x28d9('0x47')](handleError(_0x19eaea,null));};exports['destroy']=function(_0x52657c,_0x520cee){return db['FreshsalesField'][_0x28d9('0x4d')]({'where':{'id':_0x52657c[_0x28d9('0x49')]['id']}})[_0x28d9('0x29')](handleEntityNotFound(_0x520cee,null))[_0x28d9('0x29')](removeEntity(_0x520cee,null))['catch'](handleError(_0x520cee,null));}; \ No newline at end of file +var _0x5c6c=['merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','FreshsalesField','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0x5c6c,0x197));var _0xc5c6=function(_0xf7a192,_0x35ada8){_0xf7a192=_0xf7a192-0x0;var _0x3985e5=_0x5c6c[_0xf7a192];return _0x3985e5;};'use strict';var emlformat=require(_0xc5c6('0x0'));var rimraf=require(_0xc5c6('0x1'));var zipdir=require(_0xc5c6('0x2'));var jsonpatch=require(_0xc5c6('0x3'));var rp=require(_0xc5c6('0x4'));var moment=require(_0xc5c6('0x5'));var BPromise=require(_0xc5c6('0x6'));var Mustache=require(_0xc5c6('0x7'));var util=require(_0xc5c6('0x8'));var path=require(_0xc5c6('0x9'));var sox=require(_0xc5c6('0xa'));var csv=require(_0xc5c6('0xb'));var ejs=require(_0xc5c6('0xc'));var fs=require('fs');var fs_extra=require(_0xc5c6('0xd'));var _=require(_0xc5c6('0xe'));var squel=require(_0xc5c6('0xf'));var crypto=require(_0xc5c6('0x10'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc5c6('0xb'));var querystring=require(_0xc5c6('0x11'));var Papa=require(_0xc5c6('0x12'));var Redis=require(_0xc5c6('0x13'));var authService=require(_0xc5c6('0x14'));var qs=require(_0xc5c6('0x15'));var as=require(_0xc5c6('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc5c6('0x17'))('api');var utils=require(_0xc5c6('0x18'));var config=require(_0xc5c6('0x19'));var licenseUtil=require(_0xc5c6('0x1a'));var db=require(_0xc5c6('0x1b'))['db'];function respondWithStatusCode(_0xff873d,_0x53c1d4){_0x53c1d4=_0x53c1d4||0xcc;return function(_0x5da8b0){if(_0x5da8b0){return _0xff873d[_0xc5c6('0x1c')](_0x53c1d4);}return _0xff873d[_0xc5c6('0x1d')](_0x53c1d4)[_0xc5c6('0x1e')]();};}function respondWithResult(_0x5d843c,_0x4026a7){_0x4026a7=_0x4026a7||0xc8;return function(_0x1245fd){if(_0x1245fd){return _0x5d843c['status'](_0x4026a7)[_0xc5c6('0x1f')](_0x1245fd);}};}function respondWithFilteredResult(_0x12682c,_0x156b4c){return function(_0x43f5f3){if(_0x43f5f3){var _0x25addc=typeof _0x156b4c[_0xc5c6('0x20')]===_0xc5c6('0x21')&&typeof _0x156b4c[_0xc5c6('0x22')]==='undefined';var _0x4ea732=_0x43f5f3[_0xc5c6('0x23')];var _0x2609a2=_0x25addc?0x0:_0x156b4c[_0xc5c6('0x20')];var _0x85f40b=_0x25addc?_0x43f5f3['count']:_0x156b4c['offset']+_0x156b4c[_0xc5c6('0x22')];var _0x87c1e0;if(_0x85f40b>=_0x4ea732){_0x85f40b=_0x4ea732;_0x87c1e0=0xc8;}else{_0x87c1e0=0xce;}_0x12682c['status'](_0x87c1e0);return _0x12682c[_0xc5c6('0x24')](_0xc5c6('0x25'),_0x2609a2+'-'+_0x85f40b+'/'+_0x4ea732)[_0xc5c6('0x1f')](_0x43f5f3);}return null;};}function patchUpdates(_0x1054cd){return function(_0x47de68){try{jsonpatch[_0xc5c6('0x26')](_0x47de68,_0x1054cd,!![]);}catch(_0x36eccb){return BPromise[_0xc5c6('0x27')](_0x36eccb);}return _0x47de68[_0xc5c6('0x28')]();};}function saveUpdates(_0x509fba,_0x583f48){return function(_0x47098a){if(_0x47098a){return _0x47098a[_0xc5c6('0x29')](_0x509fba)[_0xc5c6('0x2a')](function(_0x555faa){return _0x555faa;});}return null;};}function removeEntity(_0x5b8e6d,_0x18311a){return function(_0x125795){if(_0x125795){return _0x125795[_0xc5c6('0x2b')]()[_0xc5c6('0x2a')](function(){_0x5b8e6d[_0xc5c6('0x1d')](0xcc)[_0xc5c6('0x1e')]();});}};}function handleEntityNotFound(_0x52968f,_0x3f888f){return function(_0x11fc27){if(!_0x11fc27){_0x52968f[_0xc5c6('0x1c')](0x194);}return _0x11fc27;};}function handleError(_0x488169,_0x4e3840){_0x4e3840=_0x4e3840||0x1f4;return function(_0x4e47bc){logger[_0xc5c6('0x2c')](_0x4e47bc[_0xc5c6('0x2d')]);if(_0x4e47bc[_0xc5c6('0x2e')]){delete _0x4e47bc[_0xc5c6('0x2e')];}_0x488169[_0xc5c6('0x1d')](_0x4e3840)[_0xc5c6('0x2f')](_0x4e47bc);};}exports['index']=function(_0x56a925,_0x4a5061){var _0x3d6c48={},_0x2841ff={},_0x28b191={'count':0x0,'rows':[]};var _0x3704ad=_[_0xc5c6('0x30')](db[_0xc5c6('0x31')][_0xc5c6('0x32')],function(_0x11c4e4){return{'name':_0x11c4e4['fieldName'],'type':_0x11c4e4[_0xc5c6('0x33')][_0xc5c6('0x34')]};});_0x2841ff[_0xc5c6('0x35')]=_[_0xc5c6('0x30')](_0x3704ad,_0xc5c6('0x2e'));_0x2841ff[_0xc5c6('0x36')]=_[_0xc5c6('0x37')](_0x56a925['query']);_0x2841ff[_0xc5c6('0x38')]=_['intersection'](_0x2841ff['model'],_0x2841ff[_0xc5c6('0x36')]);_0x3d6c48[_0xc5c6('0x39')]=_[_0xc5c6('0x3a')](_0x2841ff[_0xc5c6('0x35')],qs[_0xc5c6('0x3b')](_0x56a925[_0xc5c6('0x36')]['fields']));_0x3d6c48['attributes']=_0x3d6c48['attributes'][_0xc5c6('0x3c')]?_0x3d6c48[_0xc5c6('0x39')]:_0x2841ff[_0xc5c6('0x35')];if(!_0x56a925['query'][_0xc5c6('0x3d')](_0xc5c6('0x3e'))){_0x3d6c48[_0xc5c6('0x22')]=qs[_0xc5c6('0x22')](_0x56a925[_0xc5c6('0x36')]['limit']);_0x3d6c48[_0xc5c6('0x20')]=qs[_0xc5c6('0x20')](_0x56a925[_0xc5c6('0x36')][_0xc5c6('0x20')]);}_0x3d6c48['order']=qs[_0xc5c6('0x3f')](_0x56a925[_0xc5c6('0x36')][_0xc5c6('0x3f')]);_0x3d6c48['where']=qs[_0xc5c6('0x38')](_[_0xc5c6('0x40')](_0x56a925[_0xc5c6('0x36')],_0x2841ff[_0xc5c6('0x38')]),_0x3704ad);if(_0x56a925['query'][_0xc5c6('0x41')]){_0x3d6c48[_0xc5c6('0x42')]=_[_0xc5c6('0x43')](_0x3d6c48[_0xc5c6('0x42')],{'$or':_[_0xc5c6('0x30')](_0x3704ad,function(_0x3e0d14){if(_0x3e0d14['type']!==_0xc5c6('0x44')){var _0x25ca6e={};_0x25ca6e[_0x3e0d14[_0xc5c6('0x2e')]]={'$like':'%'+_0x56a925[_0xc5c6('0x36')][_0xc5c6('0x41')]+'%'};return _0x25ca6e;}})});}_0x3d6c48=_[_0xc5c6('0x43')]({},_0x3d6c48,_0x56a925[_0xc5c6('0x45')]);var _0x14e948={'where':_0x3d6c48[_0xc5c6('0x42')]};return db[_0xc5c6('0x31')][_0xc5c6('0x23')](_0x14e948)[_0xc5c6('0x2a')](function(_0x2899ca){_0x28b191[_0xc5c6('0x23')]=_0x2899ca;if(_0x56a925[_0xc5c6('0x36')]['includeAll']){_0x3d6c48[_0xc5c6('0x46')]=[{'all':!![]}];}return db[_0xc5c6('0x31')][_0xc5c6('0x47')](_0x3d6c48);})['then'](function(_0x1385c5){_0x28b191['rows']=_0x1385c5;return _0x28b191;})['then'](respondWithFilteredResult(_0x4a5061,_0x3d6c48))[_0xc5c6('0x48')](handleError(_0x4a5061,null));};exports[_0xc5c6('0x49')]=function(_0x236fcb,_0x276c30){var _0x290701={'raw':!![],'where':{'id':_0x236fcb[_0xc5c6('0x4a')]['id']}},_0x13339a={};_0x13339a[_0xc5c6('0x35')]=_[_0xc5c6('0x37')](db[_0xc5c6('0x31')][_0xc5c6('0x32')]);_0x13339a['query']=_[_0xc5c6('0x37')](_0x236fcb[_0xc5c6('0x36')]);_0x13339a[_0xc5c6('0x38')]=_[_0xc5c6('0x3a')](_0x13339a['model'],_0x13339a[_0xc5c6('0x36')]);_0x290701[_0xc5c6('0x39')]=_['intersection'](_0x13339a[_0xc5c6('0x35')],qs[_0xc5c6('0x3b')](_0x236fcb['query'][_0xc5c6('0x3b')]));_0x290701[_0xc5c6('0x39')]=_0x290701['attributes'][_0xc5c6('0x3c')]?_0x290701['attributes']:_0x13339a[_0xc5c6('0x35')];if(_0x236fcb['query'][_0xc5c6('0x4b')]){_0x290701[_0xc5c6('0x46')]=[{'all':!![]}];}_0x290701=_['merge']({},_0x290701,_0x236fcb[_0xc5c6('0x45')]);return db['FreshsalesField'][_0xc5c6('0x4c')](_0x290701)[_0xc5c6('0x2a')](handleEntityNotFound(_0x276c30,null))[_0xc5c6('0x2a')](respondWithResult(_0x276c30,null))[_0xc5c6('0x48')](handleError(_0x276c30,null));};exports[_0xc5c6('0x4d')]=function(_0x5c2094,_0x3d1cc1){return db[_0xc5c6('0x31')]['create'](_0x5c2094[_0xc5c6('0x4e')],{})[_0xc5c6('0x2a')](respondWithResult(_0x3d1cc1,0xc9))[_0xc5c6('0x48')](handleError(_0x3d1cc1,null));};exports['update']=function(_0x5cd723,_0x539c62){if(_0x5cd723['body']['id']){delete _0x5cd723[_0xc5c6('0x4e')]['id'];}return db['FreshsalesField'][_0xc5c6('0x4c')]({'where':{'id':_0x5cd723[_0xc5c6('0x4a')]['id']}})[_0xc5c6('0x2a')](handleEntityNotFound(_0x539c62,null))[_0xc5c6('0x2a')](saveUpdates(_0x5cd723[_0xc5c6('0x4e')],null))[_0xc5c6('0x2a')](respondWithResult(_0x539c62,null))['catch'](handleError(_0x539c62,null));};exports[_0xc5c6('0x2b')]=function(_0x3fe81c,_0x3631c9){return db['FreshsalesField']['find']({'where':{'id':_0x3fe81c[_0xc5c6('0x4a')]['id']}})[_0xc5c6('0x2a')](handleEntityNotFound(_0x3631c9,null))[_0xc5c6('0x2a')](removeEntity(_0x3631c9,null))[_0xc5c6('0x48')](handleError(_0x3631c9,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 5310695..7761acc 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 _0xa30a=['define','FreshsalesField','int_freshsales_fields','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes'];(function(_0x20a85c,_0x4c60c6){var _0x47fb42=function(_0x90acd1){while(--_0x90acd1){_0x20a85c['push'](_0x20a85c['shift']());}};_0x47fb42(++_0x4c60c6);}(_0xa30a,0xd7));var _0xaa30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa30a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xaa30('0x0'));var util=require(_0xaa30('0x1'));var logger=require(_0xaa30('0x2'))('api');var moment=require(_0xaa30('0x3'));var BPromise=require(_0xaa30('0x4'));var rp=require(_0xaa30('0x5'));var fs=require('fs');var path=require(_0xaa30('0x6'));var rimraf=require(_0xaa30('0x7'));var config=require(_0xaa30('0x8'));var attributes=require(_0xaa30('0x9'));module['exports']=function(_0x347cd5,_0x4efe89){return _0x347cd5[_0xaa30('0xa')](_0xaa30('0xb'),attributes,{'tableName':_0xaa30('0xc'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0xaa30('0xd'),_0xaa30('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xab40=['path','rimraf','../../config/environment','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','lodash','util','bluebird','request-promise'];(function(_0x5b1952,_0x40527a){var _0x4f08d8=function(_0x4d91bf){while(--_0x4d91bf){_0x5b1952['push'](_0x5b1952['shift']());}};_0x4f08d8(++_0x40527a);}(_0xab40,0xcd));var _0x0ab4=function(_0x36ab31,_0x59e080){_0x36ab31=_0x36ab31-0x0;var _0x32f471=_0xab40[_0x36ab31];return _0x32f471;};'use strict';var _=require(_0x0ab4('0x0'));var util=require(_0x0ab4('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0ab4('0x2'));var rp=require(_0x0ab4('0x3'));var fs=require('fs');var path=require(_0x0ab4('0x4'));var rimraf=require(_0x0ab4('0x5'));var config=require(_0x0ab4('0x6'));var attributes=require('./intFreshsalesField.attributes');module['exports']=function(_0x28b17a,_0x4ba9d2){return _0x28b17a[_0x0ab4('0x7')](_0x0ab4('0x8'),attributes,{'tableName':_0x0ab4('0x9'),'paranoid':![],'indexes':[{'name':_0x0ab4('0xa'),'fields':['idField','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 53ce38a..179033f 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 _0x4819=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','FreshsalesField,\x20%s,\x20%s','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','util','moment'];(function(_0x19cc4e,_0x150d46){var _0x3f6361=function(_0x5988e4){while(--_0x5988e4){_0x19cc4e['push'](_0x19cc4e['shift']());}};_0x3f6361(++_0x150d46);}(_0x4819,0xcd));var _0x9481=function(_0x741427,_0x21fe4c){_0x741427=_0x741427-0x0;var _0x5e0a59=_0x4819[_0x741427];return _0x5e0a59;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var moment=require(_0x9481('0x1'));var BPromise=require(_0x9481('0x2'));var rs=require(_0x9481('0x3'));var fs=require('fs');var Redis=require(_0x9481('0x4'));var db=require(_0x9481('0x5'))['db'];var utils=require(_0x9481('0x6'));var logger=require(_0x9481('0x7'))(_0x9481('0x8'));var config=require(_0x9481('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9481('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54cc78,_0x14e05a,_0x6c6a08){return new BPromise(function(_0x27c033,_0x3278ff){return client[_0x9481('0xb')](_0x54cc78,_0x6c6a08)['then'](function(_0x1818cf){logger['info'](_0x9481('0xc'),_0x14e05a,'request\x20sent');logger[_0x9481('0xd')](_0x9481('0xe'),_0x14e05a,_0x9481('0xf'),JSON[_0x9481('0x10')](_0x1818cf));if(_0x1818cf[_0x9481('0x11')]){if(_0x1818cf[_0x9481('0x11')][_0x9481('0x12')]===0x1f4){logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x1818cf['error']['message']);return _0x3278ff(_0x1818cf[_0x9481('0x11')][_0x9481('0x13')]);}logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x1818cf[_0x9481('0x11')][_0x9481('0x13')]);return _0x27c033(_0x1818cf[_0x9481('0x11')]['message']);}else{logger[_0x9481('0x14')](_0x9481('0xc'),_0x14e05a,'request\x20sent');_0x27c033(_0x1818cf[_0x9481('0x15')]['message']);}})[_0x9481('0x16')](function(_0x7a2ac8){logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x7a2ac8);_0x3278ff(_0x7a2ac8);});});} \ No newline at end of file +var _0x3f8a=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x56dd81,_0x11a149){_0x56dd81=_0x56dd81-0x0;var _0x5605a9=_0x3f8a[_0x56dd81];return _0x5605a9;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var moment=require(_0xa3f8('0x2'));var BPromise=require(_0xa3f8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa3f8('0x4'));var db=require(_0xa3f8('0x5'))['db'];var utils=require(_0xa3f8('0x6'));var logger=require(_0xa3f8('0x7'))(_0xa3f8('0x8'));var config=require(_0xa3f8('0x9'));var jayson=require(_0xa3f8('0xa'));var client=jayson[_0xa3f8('0xb')][_0xa3f8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf895d9,_0xcfea5,_0x268332){return new BPromise(function(_0x2faf2e,_0x2448de){return client[_0xa3f8('0xd')](_0xf895d9,_0x268332)[_0xa3f8('0xe')](function(_0xcdb0d4){logger['info'](_0xa3f8('0xf'),_0xcfea5,_0xa3f8('0x10'));logger[_0xa3f8('0x11')](_0xa3f8('0x12'),_0xcfea5,'request\x20sent',JSON[_0xa3f8('0x13')](_0xcdb0d4));if(_0xcdb0d4[_0xa3f8('0x14')]){if(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x15')]===0x1f4){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);return _0x2448de(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4['error'][_0xa3f8('0x16')]);return _0x2faf2e(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}else{logger[_0xa3f8('0x17')]('FreshsalesField,\x20%s,\x20%s',_0xcfea5,_0xa3f8('0x10'));_0x2faf2e(_0xcdb0d4[_0xa3f8('0x18')][_0xa3f8('0x16')]);}})[_0xa3f8('0x19')](function(_0x45ef64){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0x45ef64);_0x2448de(_0x45ef64);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 97d4d46..262311e 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x44df94,_0x38f9b5){var _0x4906ed=function(_0x5f2e6c){while(--_0x5f2e6c){_0x44df94['push'](_0x44df94['shift']());}};_0x4906ed(++_0x38f9b5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x263c90,_0x51f8bf){var _0x34a66e=function(_0x15c8ed){while(--_0x15c8ed){_0x263c90['push'](_0x263c90['shift']());}};_0x34a66e(++_0x51f8bf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/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 76cb3b1..231fcd3 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 _0xdafc=['integrationTab','newTab','sequelize','STRING'];(function(_0x28121e,_0x1badeb){var _0x5a5c48=function(_0xce1489){while(--_0xce1489){_0x28121e['push'](_0x28121e['shift']());}};_0x5a5c48(++_0x1badeb);}(_0xdafc,0x1a6));var _0xcdaf=function(_0x313817,_0x241e7e){_0x313817=_0x313817-0x0;var _0x13de11=_0xdafc[_0x313817];return _0x13de11;};'use strict';var Sequelize=require(_0xcdaf('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xcdaf('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'remoteUri':{'type':Sequelize[_0xcdaf('0x1')]},'password':{'type':Sequelize[_0xcdaf('0x1')]},'clientId':{'type':Sequelize[_0xcdaf('0x1')]},'clientSecret':{'type':Sequelize[_0xcdaf('0x1')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xcdaf('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xcdaf('0x2'),_0xcdaf('0x3')),'defaultValue':_0xcdaf('0x2')}}; \ No newline at end of file +var _0x753c=['exports','STRING','username','ENUM','integrationTab','newTab'];(function(_0x422f88,_0x40fcd1){var _0x1189c1=function(_0x570a31){while(--_0x570a31){_0x422f88['push'](_0x422f88['shift']());}};_0x1189c1(++_0x40fcd1);}(_0x753c,0x96));var _0xc753=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x753c[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require('sequelize');module[_0xc753('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc753('0x1')]},'username':{'type':Sequelize[_0xc753('0x1')],'unique':_0xc753('0x2')},'remoteUri':{'type':Sequelize[_0xc753('0x1')]},'password':{'type':Sequelize[_0xc753('0x1')]},'clientId':{'type':Sequelize[_0xc753('0x1')]},'clientSecret':{'type':Sequelize[_0xc753('0x1')]},'securityToken':{'type':Sequelize[_0xc753('0x1')]},'serverUrl':{'type':Sequelize[_0xc753('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xc753('0x3')](_0xc753('0x4'),_0xc753('0x5')),'defaultValue':_0xc753('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 69e8961..68d38ff 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 _0x21ba=['SalesforceConfiguration','SalesforceField','getFields','Task','clientId','username','password','securityToken','remoteUri','slice','lastIndexOf','Connection','clientSecret','login','concat','isNil','sobject','describe','OwnerId','ActivityDate','Subject','Description','string','int','boolean','email','textarea','phone','remove','includes','label','picklistValues','value','True','true','False','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','ejs','crypto','desk.js','to-csv','querystring','ioredis','../../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','limit','undefined','count','offset','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','find','create','body','update','getConfigurations','findOne','options','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions'];(function(_0x12dba2,_0x35e075){var _0x5b2daa=function(_0x2a9bca){while(--_0x2a9bca){_0x12dba2['push'](_0x12dba2['shift']());}};_0x5b2daa(++_0x35e075);}(_0x21ba,0xa4));var _0xa21b=function(_0x3f26fd,_0x3d1314){_0x3f26fd=_0x3f26fd-0x0;var _0xb78083=_0x21ba[_0x3f26fd];return _0xb78083;};'use strict';var emlformat=require(_0xa21b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa21b('0x1'));var jsonpatch=require(_0xa21b('0x2'));var rp=require(_0xa21b('0x3'));var moment=require('moment');var BPromise=require(_0xa21b('0x4'));var Mustache=require(_0xa21b('0x5'));var util=require(_0xa21b('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa21b('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa21b('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xa21b('0x9'));var toCsv=require(_0xa21b('0xa'));var querystring=require(_0xa21b('0xb'));var Papa=require('papaparse');var Redis=require(_0xa21b('0xc'));var authService=require(_0xa21b('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xa21b('0xe'));var hardwareService=require(_0xa21b('0xf'));var logger=require('../../config/logger')(_0xa21b('0x10'));var utils=require(_0xa21b('0x11'));var config=require(_0xa21b('0x12'));var licenseUtil=require(_0xa21b('0x13'));var db=require(_0xa21b('0x14'))['db'];var integrations=require(_0xa21b('0x15'));function respondWithStatusCode(_0x20845f,_0x33dc5e){_0x33dc5e=_0x33dc5e||0xcc;return function(_0x539ae9){if(_0x539ae9){return _0x20845f[_0xa21b('0x16')](_0x33dc5e);}return _0x20845f[_0xa21b('0x17')](_0x33dc5e)[_0xa21b('0x18')]();};}function respondWithResult(_0x53dfb8,_0x4be3f6){_0x4be3f6=_0x4be3f6||0xc8;return function(_0x58dd8b){if(_0x58dd8b){return _0x53dfb8[_0xa21b('0x17')](_0x4be3f6)[_0xa21b('0x19')](_0x58dd8b);}};}function respondWithFilteredResult(_0x3c8d1e,_0x2eae56){return function(_0x4cd8f6){if(_0x4cd8f6){var _0x22ee89=typeof _0x2eae56['offset']==='undefined'&&typeof _0x2eae56[_0xa21b('0x1a')]===_0xa21b('0x1b');var _0x200310=_0x4cd8f6[_0xa21b('0x1c')];var _0xd957ea=_0x22ee89?0x0:_0x2eae56[_0xa21b('0x1d')];var _0xa53d2b=_0x22ee89?_0x4cd8f6['count']:_0x2eae56[_0xa21b('0x1d')]+_0x2eae56[_0xa21b('0x1a')];var _0x3528c8;if(_0xa53d2b>=_0x200310){_0xa53d2b=_0x200310;_0x3528c8=0xc8;}else{_0x3528c8=0xce;}_0x3c8d1e[_0xa21b('0x17')](_0x3528c8);return _0x3c8d1e[_0xa21b('0x1e')](_0xa21b('0x1f'),_0xd957ea+'-'+_0xa53d2b+'/'+_0x200310)[_0xa21b('0x19')](_0x4cd8f6);}return null;};}function patchUpdates(_0x5c993e){return function(_0x56f82d){try{jsonpatch[_0xa21b('0x20')](_0x56f82d,_0x5c993e,!![]);}catch(_0x3abd79){return BPromise[_0xa21b('0x21')](_0x3abd79);}return _0x56f82d['save']();};}function saveUpdates(_0x753cc1,_0x534d36){return function(_0x1f6043){if(_0x1f6043){return _0x1f6043['update'](_0x753cc1)[_0xa21b('0x22')](function(_0xc7f2a9){return _0xc7f2a9;});}return null;};}function removeEntity(_0x5546,_0x47e67a){return function(_0x4ce2d){if(_0x4ce2d){return _0x4ce2d[_0xa21b('0x23')]()[_0xa21b('0x22')](function(){_0x5546[_0xa21b('0x17')](0xcc)[_0xa21b('0x18')]();});}};}function handleEntityNotFound(_0x55a9b3,_0x4fa9ef){return function(_0x3ae1d7){if(!_0x3ae1d7){_0x55a9b3[_0xa21b('0x16')](0x194);}return _0x3ae1d7;};}function handleError(_0x1eaed8,_0x535fe3){_0x535fe3=_0x535fe3||0x1f4;return function(_0x242929){logger[_0xa21b('0x24')](_0x242929[_0xa21b('0x25')]);if(_0x242929['name']){delete _0x242929[_0xa21b('0x26')];}_0x1eaed8[_0xa21b('0x17')](_0x535fe3)[_0xa21b('0x27')](_0x242929);};}exports[_0xa21b('0x28')]=function(_0x398098,_0x2d635f){var _0x53dfee={},_0x1ee019={},_0x33493f={'count':0x0,'rows':[]};var _0x5ea109=_[_0xa21b('0x29')](db[_0xa21b('0x2a')][_0xa21b('0x2b')],function(_0x48d303){return{'name':_0x48d303[_0xa21b('0x2c')],'type':_0x48d303[_0xa21b('0x2d')][_0xa21b('0x2e')]};});_0x1ee019['model']=_['map'](_0x5ea109,_0xa21b('0x26'));_0x1ee019[_0xa21b('0x2f')]=_[_0xa21b('0x30')](_0x398098[_0xa21b('0x2f')]);_0x1ee019[_0xa21b('0x31')]=_[_0xa21b('0x32')](_0x1ee019[_0xa21b('0x33')],_0x1ee019[_0xa21b('0x2f')]);_0x53dfee[_0xa21b('0x34')]=_[_0xa21b('0x32')](_0x1ee019[_0xa21b('0x33')],qs[_0xa21b('0x35')](_0x398098[_0xa21b('0x2f')][_0xa21b('0x35')]));_0x53dfee['attributes']=_0x53dfee[_0xa21b('0x34')][_0xa21b('0x36')]?_0x53dfee[_0xa21b('0x34')]:_0x1ee019[_0xa21b('0x33')];if(!_0x398098[_0xa21b('0x2f')][_0xa21b('0x37')](_0xa21b('0x38'))){_0x53dfee[_0xa21b('0x1a')]=qs['limit'](_0x398098[_0xa21b('0x2f')][_0xa21b('0x1a')]);_0x53dfee[_0xa21b('0x1d')]=qs[_0xa21b('0x1d')](_0x398098[_0xa21b('0x2f')]['offset']);}_0x53dfee[_0xa21b('0x39')]=qs[_0xa21b('0x3a')](_0x398098['query']['sort']);_0x53dfee[_0xa21b('0x3b')]=qs[_0xa21b('0x31')](_[_0xa21b('0x3c')](_0x398098['query'],_0x1ee019[_0xa21b('0x31')]),_0x5ea109);if(_0x398098[_0xa21b('0x2f')][_0xa21b('0x3d')]){_0x53dfee[_0xa21b('0x3b')]=_[_0xa21b('0x3e')](_0x53dfee[_0xa21b('0x3b')],{'$or':_[_0xa21b('0x29')](_0x5ea109,function(_0x4305bc){if(_0x4305bc[_0xa21b('0x2d')]!==_0xa21b('0x3f')){var _0x4ea289={};_0x4ea289[_0x4305bc[_0xa21b('0x26')]]={'$like':'%'+_0x398098['query']['filter']+'%'};return _0x4ea289;}})});}_0x53dfee=_[_0xa21b('0x3e')]({},_0x53dfee,_0x398098['options']);var _0x3fa225={'where':_0x53dfee['where']};return db[_0xa21b('0x2a')][_0xa21b('0x1c')](_0x3fa225)['then'](function(_0x2dd0d2){_0x33493f[_0xa21b('0x1c')]=_0x2dd0d2;if(_0x398098[_0xa21b('0x2f')][_0xa21b('0x40')]){_0x53dfee[_0xa21b('0x41')]=[{'all':!![]}];}return db[_0xa21b('0x2a')][_0xa21b('0x42')](_0x53dfee);})[_0xa21b('0x22')](function(_0x5ccaef){_0x33493f['rows']=_0x5ccaef;return _0x33493f;})[_0xa21b('0x22')](respondWithFilteredResult(_0x2d635f,_0x53dfee))[_0xa21b('0x43')](handleError(_0x2d635f,null));};exports[_0xa21b('0x44')]=function(_0x7f7834,_0x583f83){var _0x2a1c35={'raw':![],'where':{'id':_0x7f7834[_0xa21b('0x45')]['id']}},_0x401abe={};_0x401abe[_0xa21b('0x33')]=_[_0xa21b('0x30')](db[_0xa21b('0x2a')][_0xa21b('0x2b')]);_0x401abe['query']=_[_0xa21b('0x30')](_0x7f7834['query']);_0x401abe[_0xa21b('0x31')]=_[_0xa21b('0x32')](_0x401abe['model'],_0x401abe['query']);_0x2a1c35[_0xa21b('0x34')]=_[_0xa21b('0x32')](_0x401abe[_0xa21b('0x33')],qs['fields'](_0x7f7834[_0xa21b('0x2f')][_0xa21b('0x35')]));_0x2a1c35['attributes']=_0x2a1c35['attributes'][_0xa21b('0x36')]?_0x2a1c35['attributes']:_0x401abe[_0xa21b('0x33')];if(_0x7f7834[_0xa21b('0x2f')][_0xa21b('0x40')]){_0x2a1c35['include']=[{'all':!![]}];}_0x2a1c35=_[_0xa21b('0x3e')]({},_0x2a1c35,_0x7f7834['options']);return db['SalesforceAccount'][_0xa21b('0x46')](_0x2a1c35)[_0xa21b('0x22')](handleEntityNotFound(_0x583f83,null))[_0xa21b('0x22')](respondWithResult(_0x583f83,null))['catch'](handleError(_0x583f83,null));};exports[_0xa21b('0x47')]=function(_0x5f34d0,_0x3b5758){return db['SalesforceAccount'][_0xa21b('0x47')](_0x5f34d0[_0xa21b('0x48')],{})['then'](respondWithResult(_0x3b5758,0xc9))[_0xa21b('0x43')](handleError(_0x3b5758,null));};exports[_0xa21b('0x49')]=function(_0x3d5ed4,_0x558748){if(_0x3d5ed4[_0xa21b('0x48')]['id']){delete _0x3d5ed4[_0xa21b('0x48')]['id'];}return db['SalesforceAccount'][_0xa21b('0x46')]({'where':{'id':_0x3d5ed4[_0xa21b('0x45')]['id']}})[_0xa21b('0x22')](handleEntityNotFound(_0x558748,null))['then'](saveUpdates(_0x3d5ed4[_0xa21b('0x48')],null))[_0xa21b('0x22')](respondWithResult(_0x558748,null))['catch'](handleError(_0x558748,null));};exports[_0xa21b('0x23')]=function(_0x2ea94b,_0x477ab2){return db[_0xa21b('0x2a')]['find']({'where':{'id':_0x2ea94b[_0xa21b('0x45')]['id']}})[_0xa21b('0x22')](handleEntityNotFound(_0x477ab2,null))[_0xa21b('0x22')](removeEntity(_0x477ab2,null))[_0xa21b('0x43')](handleError(_0x477ab2,null));};exports[_0xa21b('0x4a')]=function(_0x4dce54,_0x5bad18,_0x4475e5){var _0x1a1276={};var _0x4ec974={};var _0x23f91a;var _0x5361f8;return db[_0xa21b('0x2a')][_0xa21b('0x4b')]({'where':{'id':_0x4dce54['params']['id']}})[_0xa21b('0x22')](handleEntityNotFound(_0x5bad18,null))['then'](function(_0xda4e52){if(_0xda4e52){_0x23f91a=_0xda4e52;_0x4ec974[_0xa21b('0x33')]=_[_0xa21b('0x30')](db['SalesforceConfiguration'][_0xa21b('0x2b')]);_0x4ec974[_0xa21b('0x2f')]=_[_0xa21b('0x30')](_0x4dce54['query']);_0x4ec974['filters']=_[_0xa21b('0x32')](_0x4ec974[_0xa21b('0x33')],_0x4ec974[_0xa21b('0x2f')]);_0x1a1276[_0xa21b('0x34')]=_['intersection'](_0x4ec974[_0xa21b('0x33')],qs[_0xa21b('0x35')](_0x4dce54[_0xa21b('0x2f')][_0xa21b('0x35')]));_0x1a1276[_0xa21b('0x34')]=_0x1a1276[_0xa21b('0x34')][_0xa21b('0x36')]?_0x1a1276['attributes']:_0x4ec974[_0xa21b('0x33')];_0x1a1276[_0xa21b('0x39')]=qs['sort'](_0x4dce54['query'][_0xa21b('0x3a')]);_0x1a1276[_0xa21b('0x3b')]=qs[_0xa21b('0x31')](_[_0xa21b('0x3c')](_0x4dce54[_0xa21b('0x2f')],_0x4ec974[_0xa21b('0x31')]));if(_0x4dce54[_0xa21b('0x2f')][_0xa21b('0x3d')]){_0x1a1276['where']=_[_0xa21b('0x3e')](_0x1a1276[_0xa21b('0x3b')],{'$or':_[_0xa21b('0x29')](_0x1a1276[_0xa21b('0x34')],function(_0x449009){var _0x48d9bb={};_0x48d9bb[_0x449009]={'$like':'%'+_0x4dce54[_0xa21b('0x2f')][_0xa21b('0x3d')]+'%'};return _0x48d9bb;})});}_0x1a1276=_['merge']({},_0x1a1276,_0x4dce54[_0xa21b('0x4c')]);return _0x23f91a['getConfigurations'](_0x1a1276);}})[_0xa21b('0x22')](function(_0x392daa){if(_0x392daa){_0x5361f8=_0x392daa[_0xa21b('0x36')];if(!_0x4dce54[_0xa21b('0x2f')]['hasOwnProperty'](_0xa21b('0x38'))){_0x1a1276[_0xa21b('0x1a')]=qs['limit'](_0x4dce54[_0xa21b('0x2f')][_0xa21b('0x1a')]);_0x1a1276[_0xa21b('0x1d')]=qs[_0xa21b('0x1d')](_0x4dce54['query'][_0xa21b('0x1d')]);}return _0x23f91a[_0xa21b('0x4a')](_0x1a1276);}})[_0xa21b('0x22')](function(_0x2bcdcc){if(_0x2bcdcc){return _0x2bcdcc?{'count':_0x5361f8,'rows':_0x2bcdcc}:null;}})[_0xa21b('0x22')](respondWithResult(_0x5bad18,null))[_0xa21b('0x43')](handleError(_0x5bad18,null));};exports[_0xa21b('0x4d')]=function(_0xc2ece7,_0x504c8b,_0x3c2e44){if(_0xc2ece7[_0xa21b('0x48')]['id']){delete _0xc2ece7[_0xa21b('0x48')]['id'];}return db[_0xa21b('0x2a')]['findOne']({'where':{'id':_0xc2ece7[_0xa21b('0x45')]['id']}})[_0xa21b('0x22')](handleEntityNotFound(_0x504c8b,null))[_0xa21b('0x22')](function(_0x4ea6ab){if(_0x4ea6ab){_0xc2ece7[_0xa21b('0x48')][_0xa21b('0x4e')]=_0x4ea6ab['id'];_0xc2ece7[_0xa21b('0x48')][_0xa21b('0x4f')]=integrations[_0xa21b('0x50')](_0xc2ece7[_0xa21b('0x48')][_0xa21b('0x51')],_0xc2ece7[_0xa21b('0x48')][_0xa21b('0x2d')]);_0xc2ece7['body'][_0xa21b('0x52')]=integrations[_0xa21b('0x53')](_0xc2ece7[_0xa21b('0x48')][_0xa21b('0x51')],_0xc2ece7[_0xa21b('0x48')][_0xa21b('0x2d')]);return db[_0xa21b('0x54')][_0xa21b('0x47')](_0xc2ece7[_0xa21b('0x48')],{'include':[{'model':db[_0xa21b('0x55')],'as':'Subjects'},{'model':db[_0xa21b('0x55')],'as':'Descriptions'}]});}return null;})[_0xa21b('0x22')](respondWithResult(_0x504c8b,null))[_0xa21b('0x43')](handleError(_0x504c8b,null));};exports[_0xa21b('0x56')]=function(_0xc57221,_0x54f5c8,_0x3704fc){var _0x3db683;var _0x15a493='';var _0x1e7c0b=_0xa21b('0x57');return db['SalesforceAccount'][_0xa21b('0x4b')]({'where':{'id':_0xc57221[_0xa21b('0x45')]['id']},'attributes':['id','remoteUri',_0xa21b('0x58'),'clientSecret',_0xa21b('0x59'),_0xa21b('0x5a'),_0xa21b('0x5b')]})[_0xa21b('0x22')](handleEntityNotFound(_0x54f5c8,null))[_0xa21b('0x22')](function(_0x133836){if(_0x133836){_0x15a493=_0x133836[_0xa21b('0x5c')];var _0x3be8ad=_0x15a493[_0xa21b('0x5d')](-0x1);if(_0x3be8ad==='/'){_0x15a493=_0x15a493['substring'](0x0,_0x15a493[_0xa21b('0x5e')](_0x3be8ad));}_0x3db683=new jsforce[(_0xa21b('0x5f'))]({'oauth2':{'loginUrl':_0x15a493,'clientId':_0x133836['clientId'],'clientSecret':_0x133836[_0xa21b('0x60')]}});return _0x3db683[_0xa21b('0x61')](_0x133836['username'],_0x133836[_0xa21b('0x5a')][_0xa21b('0x62')](_0x133836['securityToken']));}})['then'](function(_0x2faa26){if(_0x2faa26){if(!_[_0xa21b('0x63')](_0xc57221[_0xa21b('0x2f')]['ticketType'])){_0x1e7c0b=_0xc57221['query']['ticketType'];}return _0x3db683[_0xa21b('0x64')](_0x1e7c0b)[_0xa21b('0x65')]();}})[_0xa21b('0x22')](function(_0x1cfb71){var _0x195b1e=[_0xa21b('0x66'),_0xa21b('0x67'),'IsReminderSet','IsRecurrence',_0xa21b('0x68'),_0xa21b('0x69')];var _0x2e3fc2=[_0xa21b('0x6a'),_0xa21b('0x6b'),'picklist',_0xa21b('0x6c'),_0xa21b('0x6d'),_0xa21b('0x6e'),_0xa21b('0x6f')];if(_0x1cfb71){_[_0xa21b('0x70')](_0x1cfb71[_0xa21b('0x35')],function(_0x23e487){return _0x195b1e[_0xa21b('0x71')](_0x23e487[_0xa21b('0x26')])||!_0x2e3fc2['includes'](_0x23e487[_0xa21b('0x2d')]);});return{'count':_0x1cfb71['fields'][_0xa21b('0x36')],'rows':_[_0xa21b('0x29')](_0x1cfb71['fields'],function(_0x4021ff){return{'id':_0x4021ff['name'],'name':_0x4021ff[_0xa21b('0x72')],'custom':_0x4021ff['custom'],'options':_0x4021ff['picklistValues'][_0xa21b('0x36')]>0x0?_[_0xa21b('0x29')](_0x4021ff[_0xa21b('0x73')],function(_0x22c077){return{'name':_0x22c077[_0xa21b('0x72')],'value':_0x22c077[_0xa21b('0x74')]};}):_0x4021ff[_0xa21b('0x2d')]==_0xa21b('0x6c')?[{'name':_0xa21b('0x75'),'value':_0xa21b('0x76')},{'name':_0xa21b('0x77'),'value':'false'}]:[]};})};}})[_0xa21b('0x22')](respondWithResult(_0x54f5c8,null))[_0xa21b('0x43')](function(_0x37becf){var _0x4f2dae=_0xc57221[_0xa21b('0x2f')][_0xa21b('0x78')]?0x1f4:_0x37becf[_0xa21b('0x79')]||0x1f4;logger[_0xa21b('0x24')](_0xa21b('0x7a'),_0xa21b('0x56'),_0x4f2dae,JSON['stringify'](_0x37becf));delete _0x37becf['name'];if(_0x4f2dae===0x191){_0x4f2dae=0x190;}_0x54f5c8[_0xa21b('0x17')](_0x4f2dae)[_0xa21b('0x27')](_0xc57221[_0xa21b('0x2f')][_0xa21b('0x78')]?{'message':_0xa21b('0x7b'),'statusCode':_0x37becf[_0xa21b('0x79')]}:_0x37becf);});}; \ No newline at end of file +var _0x9ec0=['zip-dir','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','SalesforceAccount','rawAttributes','type','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','create','body','find','getConfigurations','SalesforceConfiguration','order','addConfiguration','findOne','AccountId','channel','Descriptions','getDescriptions','SalesforceField','Subjects','getFields','Task','remoteUri','clientId','username','password','slice','substring','clientSecret','login','concat','securityToken','isNil','ticketType','describe','OwnerId','IsRecurrence','Subject','string','picklist','boolean','email','textarea','remove','includes','custom','picklistValues','label','True','false','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf'];(function(_0x31172e,_0xa59e5){var _0x414ada=function(_0x37ede4){while(--_0x37ede4){_0x31172e['push'](_0x31172e['shift']());}};_0x414ada(++_0xa59e5);}(_0x9ec0,0x73));var _0x09ec=function(_0x479131,_0x2828f4){_0x479131=_0x479131-0x0;var _0x28e996=_0x9ec0[_0x479131];return _0x28e996;};'use strict';var emlformat=require(_0x09ec('0x0'));var rimraf=require(_0x09ec('0x1'));var zipdir=require(_0x09ec('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x09ec('0x3'));var moment=require(_0x09ec('0x4'));var BPromise=require(_0x09ec('0x5'));var Mustache=require('mustache');var util=require(_0x09ec('0x6'));var path=require('path');var sox=require(_0x09ec('0x7'));var csv=require(_0x09ec('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x09ec('0x9'));var _=require(_0x09ec('0xa'));var squel=require('squel');var crypto=require(_0x09ec('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x09ec('0xc'));var toCsv=require(_0x09ec('0x8'));var querystring=require(_0x09ec('0xd'));var Papa=require(_0x09ec('0xe'));var Redis=require(_0x09ec('0xf'));var authService=require(_0x09ec('0x10'));var qs=require(_0x09ec('0x11'));var as=require(_0x09ec('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x09ec('0x13'));var utils=require('../../config/utils');var config=require(_0x09ec('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x09ec('0x15'))['db'];var integrations=require(_0x09ec('0x16'));function respondWithStatusCode(_0x106560,_0x5ae8e1){_0x5ae8e1=_0x5ae8e1||0xcc;return function(_0x4bd15d){if(_0x4bd15d){return _0x106560[_0x09ec('0x17')](_0x5ae8e1);}return _0x106560['status'](_0x5ae8e1)[_0x09ec('0x18')]();};}function respondWithResult(_0x5e0b9d,_0x39e333){_0x39e333=_0x39e333||0xc8;return function(_0x56cf2b){if(_0x56cf2b){return _0x5e0b9d[_0x09ec('0x19')](_0x39e333)[_0x09ec('0x1a')](_0x56cf2b);}};}function respondWithFilteredResult(_0x1e3be7,_0x2e063d){return function(_0x333c28){if(_0x333c28){var _0xa1fd12=typeof _0x2e063d[_0x09ec('0x1b')]==='undefined'&&typeof _0x2e063d[_0x09ec('0x1c')]===_0x09ec('0x1d');var _0x23204a=_0x333c28[_0x09ec('0x1e')];var _0x451a00=_0xa1fd12?0x0:_0x2e063d['offset'];var _0xe5b274=_0xa1fd12?_0x333c28['count']:_0x2e063d[_0x09ec('0x1b')]+_0x2e063d['limit'];var _0x98bef9;if(_0xe5b274>=_0x23204a){_0xe5b274=_0x23204a;_0x98bef9=0xc8;}else{_0x98bef9=0xce;}_0x1e3be7[_0x09ec('0x19')](_0x98bef9);return _0x1e3be7['set'](_0x09ec('0x1f'),_0x451a00+'-'+_0xe5b274+'/'+_0x23204a)[_0x09ec('0x1a')](_0x333c28);}return null;};}function patchUpdates(_0x3af441){return function(_0x32f2c3){try{jsonpatch[_0x09ec('0x20')](_0x32f2c3,_0x3af441,!![]);}catch(_0x22cb41){return BPromise[_0x09ec('0x21')](_0x22cb41);}return _0x32f2c3[_0x09ec('0x22')]();};}function saveUpdates(_0x1f37f1,_0x40ab11){return function(_0x2cd423){if(_0x2cd423){return _0x2cd423[_0x09ec('0x23')](_0x1f37f1)[_0x09ec('0x24')](function(_0x2f565a){return _0x2f565a;});}return null;};}function removeEntity(_0x3a8af0,_0x38d8b0){return function(_0x507d7b){if(_0x507d7b){return _0x507d7b[_0x09ec('0x25')]()[_0x09ec('0x24')](function(){_0x3a8af0[_0x09ec('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x471620,_0x13e685){return function(_0x254ebf){if(!_0x254ebf){_0x471620['sendStatus'](0x194);}return _0x254ebf;};}function handleError(_0x52c80c,_0xa34854){_0xa34854=_0xa34854||0x1f4;return function(_0xdd163a){logger['error'](_0xdd163a['stack']);if(_0xdd163a[_0x09ec('0x26')]){delete _0xdd163a[_0x09ec('0x26')];}_0x52c80c[_0x09ec('0x19')](_0xa34854)[_0x09ec('0x27')](_0xdd163a);};}exports[_0x09ec('0x28')]=function(_0x45f794,_0x1f79db){var _0x2cebdb={},_0x540a25={},_0x367a88={'count':0x0,'rows':[]};var _0x1a5535=_[_0x09ec('0x29')](db[_0x09ec('0x2a')][_0x09ec('0x2b')],function(_0x3d41c4){return{'name':_0x3d41c4['fieldName'],'type':_0x3d41c4[_0x09ec('0x2c')][_0x09ec('0x2d')]};});_0x540a25['model']=_[_0x09ec('0x29')](_0x1a5535,_0x09ec('0x26'));_0x540a25[_0x09ec('0x2e')]=_[_0x09ec('0x2f')](_0x45f794['query']);_0x540a25[_0x09ec('0x30')]=_[_0x09ec('0x31')](_0x540a25['model'],_0x540a25[_0x09ec('0x2e')]);_0x2cebdb[_0x09ec('0x32')]=_['intersection'](_0x540a25['model'],qs['fields'](_0x45f794[_0x09ec('0x2e')][_0x09ec('0x33')]));_0x2cebdb[_0x09ec('0x32')]=_0x2cebdb['attributes'][_0x09ec('0x34')]?_0x2cebdb[_0x09ec('0x32')]:_0x540a25[_0x09ec('0x35')];if(!_0x45f794[_0x09ec('0x2e')][_0x09ec('0x36')](_0x09ec('0x37'))){_0x2cebdb['limit']=qs[_0x09ec('0x1c')](_0x45f794[_0x09ec('0x2e')]['limit']);_0x2cebdb[_0x09ec('0x1b')]=qs[_0x09ec('0x1b')](_0x45f794['query'][_0x09ec('0x1b')]);}_0x2cebdb['order']=qs['sort'](_0x45f794['query'][_0x09ec('0x38')]);_0x2cebdb[_0x09ec('0x39')]=qs['filters'](_[_0x09ec('0x3a')](_0x45f794[_0x09ec('0x2e')],_0x540a25[_0x09ec('0x30')]),_0x1a5535);if(_0x45f794[_0x09ec('0x2e')][_0x09ec('0x3b')]){_0x2cebdb[_0x09ec('0x39')]=_['merge'](_0x2cebdb[_0x09ec('0x39')],{'$or':_[_0x09ec('0x29')](_0x1a5535,function(_0x260abf){if(_0x260abf[_0x09ec('0x2c')]!=='VIRTUAL'){var _0x7bb25a={};_0x7bb25a[_0x260abf['name']]={'$like':'%'+_0x45f794[_0x09ec('0x2e')][_0x09ec('0x3b')]+'%'};return _0x7bb25a;}})});}_0x2cebdb=_[_0x09ec('0x3c')]({},_0x2cebdb,_0x45f794[_0x09ec('0x3d')]);var _0x366ec7={'where':_0x2cebdb[_0x09ec('0x39')]};return db[_0x09ec('0x2a')]['count'](_0x366ec7)[_0x09ec('0x24')](function(_0x47d4e1){_0x367a88[_0x09ec('0x1e')]=_0x47d4e1;if(_0x45f794[_0x09ec('0x2e')][_0x09ec('0x3e')]){_0x2cebdb[_0x09ec('0x3f')]=[{'all':!![]}];}return db[_0x09ec('0x2a')][_0x09ec('0x40')](_0x2cebdb);})[_0x09ec('0x24')](function(_0x28781d){_0x367a88[_0x09ec('0x41')]=_0x28781d;return _0x367a88;})[_0x09ec('0x24')](respondWithFilteredResult(_0x1f79db,_0x2cebdb))[_0x09ec('0x42')](handleError(_0x1f79db,null));};exports['show']=function(_0x22922d,_0x11a10d){var _0x50c1ff={'raw':![],'where':{'id':_0x22922d[_0x09ec('0x43')]['id']}},_0xbf7df8={};_0xbf7df8[_0x09ec('0x35')]=_[_0x09ec('0x2f')](db[_0x09ec('0x2a')][_0x09ec('0x2b')]);_0xbf7df8[_0x09ec('0x2e')]=_['keys'](_0x22922d[_0x09ec('0x2e')]);_0xbf7df8[_0x09ec('0x30')]=_[_0x09ec('0x31')](_0xbf7df8[_0x09ec('0x35')],_0xbf7df8['query']);_0x50c1ff['attributes']=_[_0x09ec('0x31')](_0xbf7df8[_0x09ec('0x35')],qs[_0x09ec('0x33')](_0x22922d[_0x09ec('0x2e')][_0x09ec('0x33')]));_0x50c1ff[_0x09ec('0x32')]=_0x50c1ff['attributes'][_0x09ec('0x34')]?_0x50c1ff[_0x09ec('0x32')]:_0xbf7df8[_0x09ec('0x35')];if(_0x22922d['query']['includeAll']){_0x50c1ff[_0x09ec('0x3f')]=[{'all':!![]}];}_0x50c1ff=_[_0x09ec('0x3c')]({},_0x50c1ff,_0x22922d[_0x09ec('0x3d')]);return db[_0x09ec('0x2a')]['find'](_0x50c1ff)[_0x09ec('0x24')](handleEntityNotFound(_0x11a10d,null))[_0x09ec('0x24')](respondWithResult(_0x11a10d,null))[_0x09ec('0x42')](handleError(_0x11a10d,null));};exports[_0x09ec('0x44')]=function(_0x12b0c5,_0x148dbf){return db[_0x09ec('0x2a')][_0x09ec('0x44')](_0x12b0c5[_0x09ec('0x45')],{})[_0x09ec('0x24')](respondWithResult(_0x148dbf,0xc9))[_0x09ec('0x42')](handleError(_0x148dbf,null));};exports[_0x09ec('0x23')]=function(_0x379117,_0x26b5c7){if(_0x379117[_0x09ec('0x45')]['id']){delete _0x379117['body']['id'];}return db[_0x09ec('0x2a')][_0x09ec('0x46')]({'where':{'id':_0x379117[_0x09ec('0x43')]['id']}})['then'](handleEntityNotFound(_0x26b5c7,null))[_0x09ec('0x24')](saveUpdates(_0x379117[_0x09ec('0x45')],null))[_0x09ec('0x24')](respondWithResult(_0x26b5c7,null))[_0x09ec('0x42')](handleError(_0x26b5c7,null));};exports[_0x09ec('0x25')]=function(_0x572101,_0x5c24ad){return db[_0x09ec('0x2a')]['find']({'where':{'id':_0x572101[_0x09ec('0x43')]['id']}})[_0x09ec('0x24')](handleEntityNotFound(_0x5c24ad,null))[_0x09ec('0x24')](removeEntity(_0x5c24ad,null))['catch'](handleError(_0x5c24ad,null));};exports[_0x09ec('0x47')]=function(_0x25a01e,_0x59eb0c,_0x142dcd){var _0xf65199={};var _0x1899fc={};var _0x25cae7;var _0x304a51;return db[_0x09ec('0x2a')]['findOne']({'where':{'id':_0x25a01e[_0x09ec('0x43')]['id']}})[_0x09ec('0x24')](handleEntityNotFound(_0x59eb0c,null))[_0x09ec('0x24')](function(_0x52a3b1){if(_0x52a3b1){_0x25cae7=_0x52a3b1;_0x1899fc['model']=_[_0x09ec('0x2f')](db[_0x09ec('0x48')][_0x09ec('0x2b')]);_0x1899fc[_0x09ec('0x2e')]=_['keys'](_0x25a01e[_0x09ec('0x2e')]);_0x1899fc[_0x09ec('0x30')]=_['intersection'](_0x1899fc[_0x09ec('0x35')],_0x1899fc[_0x09ec('0x2e')]);_0xf65199['attributes']=_['intersection'](_0x1899fc[_0x09ec('0x35')],qs[_0x09ec('0x33')](_0x25a01e['query'][_0x09ec('0x33')]));_0xf65199[_0x09ec('0x32')]=_0xf65199[_0x09ec('0x32')]['length']?_0xf65199[_0x09ec('0x32')]:_0x1899fc['model'];_0xf65199[_0x09ec('0x49')]=qs[_0x09ec('0x38')](_0x25a01e[_0x09ec('0x2e')][_0x09ec('0x38')]);_0xf65199[_0x09ec('0x39')]=qs['filters'](_[_0x09ec('0x3a')](_0x25a01e[_0x09ec('0x2e')],_0x1899fc['filters']));if(_0x25a01e[_0x09ec('0x2e')][_0x09ec('0x3b')]){_0xf65199[_0x09ec('0x39')]=_[_0x09ec('0x3c')](_0xf65199[_0x09ec('0x39')],{'$or':_['map'](_0xf65199['attributes'],function(_0x7381bc){var _0xaffd62={};_0xaffd62[_0x7381bc]={'$like':'%'+_0x25a01e[_0x09ec('0x2e')][_0x09ec('0x3b')]+'%'};return _0xaffd62;})});}_0xf65199=_[_0x09ec('0x3c')]({},_0xf65199,_0x25a01e[_0x09ec('0x3d')]);return _0x25cae7['getConfigurations'](_0xf65199);}})[_0x09ec('0x24')](function(_0x32359a){if(_0x32359a){_0x304a51=_0x32359a[_0x09ec('0x34')];if(!_0x25a01e[_0x09ec('0x2e')]['hasOwnProperty']('nolimit')){_0xf65199[_0x09ec('0x1c')]=qs[_0x09ec('0x1c')](_0x25a01e[_0x09ec('0x2e')][_0x09ec('0x1c')]);_0xf65199[_0x09ec('0x1b')]=qs[_0x09ec('0x1b')](_0x25a01e['query'][_0x09ec('0x1b')]);}return _0x25cae7['getConfigurations'](_0xf65199);}})[_0x09ec('0x24')](function(_0xf7d440){if(_0xf7d440){return _0xf7d440?{'count':_0x304a51,'rows':_0xf7d440}:null;}})['then'](respondWithResult(_0x59eb0c,null))[_0x09ec('0x42')](handleError(_0x59eb0c,null));};exports[_0x09ec('0x4a')]=function(_0x50a89c,_0x49f0e8,_0xea580d){if(_0x50a89c['body']['id']){delete _0x50a89c[_0x09ec('0x45')]['id'];}return db['SalesforceAccount'][_0x09ec('0x4b')]({'where':{'id':_0x50a89c[_0x09ec('0x43')]['id']}})['then'](handleEntityNotFound(_0x49f0e8,null))[_0x09ec('0x24')](function(_0x348efb){if(_0x348efb){_0x50a89c['body'][_0x09ec('0x4c')]=_0x348efb['id'];_0x50a89c[_0x09ec('0x45')]['Subjects']=integrations['getSubjects'](_0x50a89c[_0x09ec('0x45')][_0x09ec('0x4d')],_0x50a89c[_0x09ec('0x45')][_0x09ec('0x2c')]);_0x50a89c[_0x09ec('0x45')][_0x09ec('0x4e')]=integrations[_0x09ec('0x4f')](_0x50a89c[_0x09ec('0x45')][_0x09ec('0x4d')],_0x50a89c[_0x09ec('0x45')][_0x09ec('0x2c')]);return db[_0x09ec('0x48')][_0x09ec('0x44')](_0x50a89c['body'],{'include':[{'model':db[_0x09ec('0x50')],'as':_0x09ec('0x51')},{'model':db[_0x09ec('0x50')],'as':'Descriptions'}]});}return null;})[_0x09ec('0x24')](respondWithResult(_0x49f0e8,null))[_0x09ec('0x42')](handleError(_0x49f0e8,null));};exports[_0x09ec('0x52')]=function(_0x34bcf1,_0x71f827,_0x2765db){var _0x27d248;var _0x2bc3bd='';var _0x1bdf7a=_0x09ec('0x53');return db[_0x09ec('0x2a')]['findOne']({'where':{'id':_0x34bcf1['params']['id']},'attributes':['id',_0x09ec('0x54'),_0x09ec('0x55'),'clientSecret',_0x09ec('0x56'),_0x09ec('0x57'),'securityToken']})['then'](handleEntityNotFound(_0x71f827,null))['then'](function(_0x24857c){if(_0x24857c){_0x2bc3bd=_0x24857c[_0x09ec('0x54')];var _0x4f8230=_0x2bc3bd[_0x09ec('0x58')](-0x1);if(_0x4f8230==='/'){_0x2bc3bd=_0x2bc3bd[_0x09ec('0x59')](0x0,_0x2bc3bd['lastIndexOf'](_0x4f8230));}_0x27d248=new jsforce['Connection']({'oauth2':{'loginUrl':_0x2bc3bd,'clientId':_0x24857c[_0x09ec('0x55')],'clientSecret':_0x24857c[_0x09ec('0x5a')]}});return _0x27d248[_0x09ec('0x5b')](_0x24857c['username'],_0x24857c['password'][_0x09ec('0x5c')](_0x24857c[_0x09ec('0x5d')]));}})[_0x09ec('0x24')](function(_0x2581ff){if(_0x2581ff){if(!_[_0x09ec('0x5e')](_0x34bcf1[_0x09ec('0x2e')][_0x09ec('0x5f')])){_0x1bdf7a=_0x34bcf1[_0x09ec('0x2e')][_0x09ec('0x5f')];}return _0x27d248['sobject'](_0x1bdf7a)[_0x09ec('0x60')]();}})['then'](function(_0x16ade1){var _0x255ec9=[_0x09ec('0x61'),'ActivityDate','IsReminderSet',_0x09ec('0x62'),_0x09ec('0x63'),'Description'];var _0x2fac6c=[_0x09ec('0x64'),'int',_0x09ec('0x65'),_0x09ec('0x66'),_0x09ec('0x67'),_0x09ec('0x68'),'phone'];if(_0x16ade1){_[_0x09ec('0x69')](_0x16ade1[_0x09ec('0x33')],function(_0x25a7d3){return _0x255ec9[_0x09ec('0x6a')](_0x25a7d3['name'])||!_0x2fac6c[_0x09ec('0x6a')](_0x25a7d3[_0x09ec('0x2c')]);});return{'count':_0x16ade1[_0x09ec('0x33')]['length'],'rows':_[_0x09ec('0x29')](_0x16ade1[_0x09ec('0x33')],function(_0x793e3b){return{'id':_0x793e3b[_0x09ec('0x26')],'name':_0x793e3b['label'],'custom':_0x793e3b[_0x09ec('0x6b')],'options':_0x793e3b[_0x09ec('0x6c')][_0x09ec('0x34')]>0x0?_[_0x09ec('0x29')](_0x793e3b[_0x09ec('0x6c')],function(_0x307dc2){return{'name':_0x307dc2[_0x09ec('0x6d')],'value':_0x307dc2['value']};}):_0x793e3b[_0x09ec('0x2c')]==_0x09ec('0x66')?[{'name':_0x09ec('0x6e'),'value':'true'},{'name':'False','value':_0x09ec('0x6f')}]:[]};})};}})['then'](respondWithResult(_0x71f827,null))[_0x09ec('0x42')](function(_0x41954a){var _0x4c5d68=_0x34bcf1[_0x09ec('0x2e')][_0x09ec('0x70')]?0x1f4:_0x41954a[_0x09ec('0x71')]||0x1f4;logger[_0x09ec('0x72')](_0x09ec('0x73'),_0x09ec('0x52'),_0x4c5d68,JSON[_0x09ec('0x74')](_0x41954a));delete _0x41954a[_0x09ec('0x26')];if(_0x4c5d68===0x191){_0x4c5d68=0x190;}_0x71f827[_0x09ec('0x19')](_0x4c5d68)['send'](_0x34bcf1[_0x09ec('0x2e')][_0x09ec('0x70')]?{'message':'Wrong\x20credentials','statusCode':_0x41954a[_0x09ec('0x71')]}:_0x41954a);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index d3fc460..808e7cc 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 _0xe17c=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','int_salesforce_accounts'];(function(_0x4b05be,_0xa0a5d8){var _0x11fb9d=function(_0x3fa90d){while(--_0x3fa90d){_0x4b05be['push'](_0x4b05be['shift']());}};_0x11fb9d(++_0xa0a5d8);}(_0xe17c,0x8f));var _0xce17=function(_0x3273b4,_0x27758b){_0x3273b4=_0x3273b4-0x0;var _0x35d0bf=_0xe17c[_0x3273b4];return _0x35d0bf;};'use strict';var _=require('lodash');var util=require(_0xce17('0x0'));var logger=require('../../config/logger')(_0xce17('0x1'));var moment=require(_0xce17('0x2'));var BPromise=require(_0xce17('0x3'));var rp=require(_0xce17('0x4'));var fs=require('fs');var path=require(_0xce17('0x5'));var rimraf=require(_0xce17('0x6'));var config=require(_0xce17('0x7'));var attributes=require(_0xce17('0x8'));var integrations=require(_0xce17('0x9'));module[_0xce17('0xa')]=function(_0x5bfef9,_0x44202f){return _0x5bfef9[_0xce17('0xb')]('SalesforceAccount',attributes,{'tableName':_0xce17('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3cc5=['SalesforceAccount','int_salesforce_accounts','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x3cc5,0x91));var _0x53cc=function(_0x356898,_0x46610f){_0x356898=_0x356898-0x0;var _0x365c65=_0x3cc5[_0x356898];return _0x365c65;};'use strict';var _=require('lodash');var util=require(_0x53cc('0x0'));var logger=require(_0x53cc('0x1'))(_0x53cc('0x2'));var moment=require('moment');var BPromise=require(_0x53cc('0x3'));var rp=require(_0x53cc('0x4'));var fs=require('fs');var path=require(_0x53cc('0x5'));var rimraf=require(_0x53cc('0x6'));var config=require(_0x53cc('0x7'));var attributes=require(_0x53cc('0x8'));var integrations=require(_0x53cc('0x9'));module[_0x53cc('0xa')]=function(_0x40dc3,_0x5a6dc8){return _0x40dc3['define'](_0x53cc('0xb'),attributes,{'tableName':_0x53cc('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 a489322..1468b84 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 _0xb9a7=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','message','SalesforceAccount','findAll','raw','options','where','attributes','limit','include','map','model','GetSalesforceAccount','stringify','catch','ShowSalesforceAccount','find'];(function(_0x1bb812,_0x23eacc){var _0x372adb=function(_0x5ad456){while(--_0x5ad456){_0x1bb812['push'](_0x1bb812['shift']());}};_0x372adb(++_0x23eacc);}(_0xb9a7,0x172));var _0x7b9a=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xb9a7[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0x7b9a('0x0'));var util=require('util');var moment=require(_0x7b9a('0x1'));var BPromise=require(_0x7b9a('0x2'));var rs=require(_0x7b9a('0x3'));var fs=require('fs');var Redis=require(_0x7b9a('0x4'));var db=require(_0x7b9a('0x5'))['db'];var utils=require(_0x7b9a('0x6'));var logger=require(_0x7b9a('0x7'))(_0x7b9a('0x8'));var config=require(_0x7b9a('0x9'));var jayson=require(_0x7b9a('0xa'));var client=jayson[_0x7b9a('0xb')][_0x7b9a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2d45e4,_0x40f43d,_0x2bd0a6){return new BPromise(function(_0x1f2c5e,_0x5a0e8b){return client[_0x7b9a('0xd')](_0x2d45e4,_0x2bd0a6)[_0x7b9a('0xe')](function(_0x147628){logger[_0x7b9a('0xf')](_0x7b9a('0x10'),_0x40f43d,_0x7b9a('0x11'));logger[_0x7b9a('0x12')](_0x7b9a('0x13'),_0x40f43d,_0x7b9a('0x11'),JSON['stringify'](_0x147628));if(_0x147628[_0x7b9a('0x14')]){if(_0x147628['error']['code']===0x1f4){logger[_0x7b9a('0x14')](_0x7b9a('0x10'),_0x40f43d,_0x147628[_0x7b9a('0x14')][_0x7b9a('0x15')]);return _0x5a0e8b(_0x147628[_0x7b9a('0x14')][_0x7b9a('0x15')]);}logger[_0x7b9a('0x14')](_0x7b9a('0x10'),_0x40f43d,_0x147628['error']['message']);return _0x1f2c5e(_0x147628['error'][_0x7b9a('0x15')]);}else{logger[_0x7b9a('0xf')](_0x7b9a('0x10'),_0x40f43d,_0x7b9a('0x11'));_0x1f2c5e(_0x147628['result'][_0x7b9a('0x15')]);}})['catch'](function(_0x405172){logger[_0x7b9a('0x14')](_0x7b9a('0x10'),_0x40f43d,_0x405172);_0x5a0e8b(_0x405172);});});}exports['GetSalesforceAccount']=function(_0xa8d93d){var _0x3c610d=this;return new Promise(function(_0x52b8ea,_0x4f8ab7){return db[_0x7b9a('0x16')][_0x7b9a('0x17')]({'raw':_0xa8d93d['options']?_0xa8d93d['options'][_0x7b9a('0x18')]===undefined?!![]:![]:!![],'where':_0xa8d93d[_0x7b9a('0x19')]?_0xa8d93d[_0x7b9a('0x19')][_0x7b9a('0x1a')]||null:null,'attributes':_0xa8d93d[_0x7b9a('0x19')]?_0xa8d93d['options'][_0x7b9a('0x1b')]||null:null,'limit':_0xa8d93d['options']?_0xa8d93d[_0x7b9a('0x19')][_0x7b9a('0x1c')]||null:null,'include':_0xa8d93d[_0x7b9a('0x19')]?_0xa8d93d[_0x7b9a('0x19')][_0x7b9a('0x1d')]?_[_0x7b9a('0x1e')](_0xa8d93d['options'][_0x7b9a('0x1d')],function(_0x5c9794){return{'model':db[_0x5c9794[_0x7b9a('0x1f')]],'as':_0x5c9794['as'],'attributes':_0x5c9794[_0x7b9a('0x1b')],'include':_0x5c9794[_0x7b9a('0x1d')]?_[_0x7b9a('0x1e')](_0x5c9794[_0x7b9a('0x1d')],function(_0x28e724){return{'model':db[_0x28e724[_0x7b9a('0x1f')]],'as':_0x28e724['as'],'attributes':_0x28e724[_0x7b9a('0x1b')],'include':_0x28e724[_0x7b9a('0x1d')]?_[_0x7b9a('0x1e')](_0x28e724[_0x7b9a('0x1d')],function(_0x365373){return{'model':db[_0x365373[_0x7b9a('0x1f')]],'as':_0x365373['as'],'attributes':_0x365373[_0x7b9a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7b9a('0xe')](function(_0x6e37f){logger[_0x7b9a('0xf')](_0x7b9a('0x20'),_0xa8d93d);logger[_0x7b9a('0x12')]('GetSalesforceAccount',_0xa8d93d,JSON[_0x7b9a('0x21')](_0x6e37f));_0x52b8ea(_0x6e37f);})[_0x7b9a('0x22')](function(_0x2f1de2){logger[_0x7b9a('0x14')](_0x7b9a('0x20'),_0x2f1de2['message'],_0xa8d93d);_0x4f8ab7(_0x3c610d['error'](0x1f4,_0x2f1de2[_0x7b9a('0x15')]));});});};exports[_0x7b9a('0x23')]=function(_0x108140){var _0x4ac90b=this;return new Promise(function(_0x4405d5,_0x261d73){return db[_0x7b9a('0x16')][_0x7b9a('0x24')]({'raw':_0x108140[_0x7b9a('0x19')]?_0x108140[_0x7b9a('0x19')][_0x7b9a('0x18')]===undefined?!![]:![]:!![],'where':_0x108140['options']?_0x108140[_0x7b9a('0x19')][_0x7b9a('0x1a')]||null:null,'attributes':_0x108140[_0x7b9a('0x19')]?_0x108140['options'][_0x7b9a('0x1b')]||null:null,'include':_0x108140['options']?_0x108140['options'][_0x7b9a('0x1d')]?_[_0x7b9a('0x1e')](_0x108140[_0x7b9a('0x19')][_0x7b9a('0x1d')],function(_0x1cbf42){return{'model':db[_0x1cbf42[_0x7b9a('0x1f')]],'as':_0x1cbf42['as'],'attributes':_0x1cbf42[_0x7b9a('0x1b')],'include':_0x1cbf42['include']?_[_0x7b9a('0x1e')](_0x1cbf42[_0x7b9a('0x1d')],function(_0x249846){return{'model':db[_0x249846[_0x7b9a('0x1f')]],'as':_0x249846['as'],'attributes':_0x249846[_0x7b9a('0x1b')],'include':_0x249846['include']?_['map'](_0x249846[_0x7b9a('0x1d')],function(_0x5448a8){return{'model':db[_0x5448a8[_0x7b9a('0x1f')]],'as':_0x5448a8['as'],'attributes':_0x5448a8[_0x7b9a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7b9a('0xe')](function(_0x5f6d69){logger[_0x7b9a('0xf')](_0x7b9a('0x23'),_0x108140);logger[_0x7b9a('0x12')](_0x7b9a('0x23'),_0x108140,JSON[_0x7b9a('0x21')](_0x5f6d69));_0x4405d5(_0x5f6d69);})[_0x7b9a('0x22')](function(_0x158675){logger[_0x7b9a('0x14')](_0x7b9a('0x23'),_0x158675[_0x7b9a('0x15')],_0x108140);_0x261d73(_0x4ac90b[_0x7b9a('0x14')](0x1f4,_0x158675['message']));});});}; \ No newline at end of file +var _0xa217=['GetSalesforceAccount','stringify','ShowSalesforceAccount','SalesforceAccount','find','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','http','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','findAll','options','raw','where','attributes','map','model','include'];(function(_0x2fee96,_0x2f735d){var _0x2e6ad1=function(_0x2c55ad){while(--_0x2c55ad){_0x2fee96['push'](_0x2fee96['shift']());}};_0x2e6ad1(++_0x2f735d);}(_0xa217,0xc5));var _0x7a21=function(_0x419c0c,_0x2598ad){_0x419c0c=_0x419c0c-0x0;var _0x391694=_0xa217[_0x419c0c];return _0x391694;};'use strict';var _=require(_0x7a21('0x0'));var util=require('util');var moment=require(_0x7a21('0x1'));var BPromise=require('bluebird');var rs=require(_0x7a21('0x2'));var fs=require('fs');var Redis=require(_0x7a21('0x3'));var db=require(_0x7a21('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7a21('0x5'))('rpc');var config=require(_0x7a21('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7a21('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x33490e,_0x569c4d,_0x405313){return new BPromise(function(_0x386169,_0x6fad66){return client['request'](_0x33490e,_0x405313)[_0x7a21('0x8')](function(_0x184f0c){logger[_0x7a21('0x9')](_0x7a21('0xa'),_0x569c4d,_0x7a21('0xb'));logger[_0x7a21('0xc')](_0x7a21('0xd'),_0x569c4d,_0x7a21('0xb'),JSON['stringify'](_0x184f0c));if(_0x184f0c[_0x7a21('0xe')]){if(_0x184f0c[_0x7a21('0xe')][_0x7a21('0xf')]===0x1f4){logger[_0x7a21('0xe')](_0x7a21('0xa'),_0x569c4d,_0x184f0c[_0x7a21('0xe')][_0x7a21('0x10')]);return _0x6fad66(_0x184f0c[_0x7a21('0xe')]['message']);}logger[_0x7a21('0xe')](_0x7a21('0xa'),_0x569c4d,_0x184f0c['error'][_0x7a21('0x10')]);return _0x386169(_0x184f0c['error'][_0x7a21('0x10')]);}else{logger[_0x7a21('0x9')](_0x7a21('0xa'),_0x569c4d,'request\x20sent');_0x386169(_0x184f0c[_0x7a21('0x11')][_0x7a21('0x10')]);}})[_0x7a21('0x12')](function(_0xdfe12b){logger[_0x7a21('0xe')]('SalesforceAccount,\x20%s,\x20%s',_0x569c4d,_0xdfe12b);_0x6fad66(_0xdfe12b);});});}exports['GetSalesforceAccount']=function(_0x532848){var _0x38467b=this;return new Promise(function(_0x28d84f,_0x52e547){return db['SalesforceAccount'][_0x7a21('0x13')]({'raw':_0x532848[_0x7a21('0x14')]?_0x532848[_0x7a21('0x14')][_0x7a21('0x15')]===undefined?!![]:![]:!![],'where':_0x532848['options']?_0x532848[_0x7a21('0x14')][_0x7a21('0x16')]||null:null,'attributes':_0x532848['options']?_0x532848['options'][_0x7a21('0x17')]||null:null,'limit':_0x532848['options']?_0x532848[_0x7a21('0x14')]['limit']||null:null,'include':_0x532848[_0x7a21('0x14')]?_0x532848['options']['include']?_[_0x7a21('0x18')](_0x532848[_0x7a21('0x14')]['include'],function(_0x3f6451){return{'model':db[_0x3f6451[_0x7a21('0x19')]],'as':_0x3f6451['as'],'attributes':_0x3f6451[_0x7a21('0x17')],'include':_0x3f6451[_0x7a21('0x1a')]?_[_0x7a21('0x18')](_0x3f6451[_0x7a21('0x1a')],function(_0x139894){return{'model':db[_0x139894[_0x7a21('0x19')]],'as':_0x139894['as'],'attributes':_0x139894[_0x7a21('0x17')],'include':_0x139894[_0x7a21('0x1a')]?_[_0x7a21('0x18')](_0x139894['include'],function(_0x31b14e){return{'model':db[_0x31b14e['model']],'as':_0x31b14e['as'],'attributes':_0x31b14e[_0x7a21('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf4ce97){logger[_0x7a21('0x9')](_0x7a21('0x1b'),_0x532848);logger['debug']('GetSalesforceAccount',_0x532848,JSON[_0x7a21('0x1c')](_0xf4ce97));_0x28d84f(_0xf4ce97);})[_0x7a21('0x12')](function(_0x3785e2){logger[_0x7a21('0xe')](_0x7a21('0x1b'),_0x3785e2['message'],_0x532848);_0x52e547(_0x38467b[_0x7a21('0xe')](0x1f4,_0x3785e2[_0x7a21('0x10')]));});});};exports[_0x7a21('0x1d')]=function(_0x1ca71e){var _0x231e6d=this;return new Promise(function(_0x410f40,_0x2c1a37){return db[_0x7a21('0x1e')][_0x7a21('0x1f')]({'raw':_0x1ca71e[_0x7a21('0x14')]?_0x1ca71e[_0x7a21('0x14')][_0x7a21('0x15')]===undefined?!![]:![]:!![],'where':_0x1ca71e[_0x7a21('0x14')]?_0x1ca71e[_0x7a21('0x14')][_0x7a21('0x16')]||null:null,'attributes':_0x1ca71e[_0x7a21('0x14')]?_0x1ca71e[_0x7a21('0x14')]['attributes']||null:null,'include':_0x1ca71e[_0x7a21('0x14')]?_0x1ca71e[_0x7a21('0x14')][_0x7a21('0x1a')]?_[_0x7a21('0x18')](_0x1ca71e[_0x7a21('0x14')]['include'],function(_0x3ef1eb){return{'model':db[_0x3ef1eb['model']],'as':_0x3ef1eb['as'],'attributes':_0x3ef1eb[_0x7a21('0x17')],'include':_0x3ef1eb[_0x7a21('0x1a')]?_[_0x7a21('0x18')](_0x3ef1eb[_0x7a21('0x1a')],function(_0xc89f8c){return{'model':db[_0xc89f8c['model']],'as':_0xc89f8c['as'],'attributes':_0xc89f8c['attributes'],'include':_0xc89f8c[_0x7a21('0x1a')]?_['map'](_0xc89f8c['include'],function(_0x452240){return{'model':db[_0x452240[_0x7a21('0x19')]],'as':_0x452240['as'],'attributes':_0x452240[_0x7a21('0x17')]};}):[]};}):[]};}):[]:[]})[_0x7a21('0x8')](function(_0x16f490){logger['info'](_0x7a21('0x1d'),_0x1ca71e);logger['debug'](_0x7a21('0x1d'),_0x1ca71e,JSON[_0x7a21('0x1c')](_0x16f490));_0x410f40(_0x16f490);})[_0x7a21('0x12')](function(_0x3acadf){logger[_0x7a21('0xe')]('ShowSalesforceAccount',_0x3acadf[_0x7a21('0x10')],_0x1ca71e);_0x2c1a37(_0x231e6d[_0x7a21('0xe')](0x1f4,_0x3acadf[_0x7a21('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index da33f39..2a2b560 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','exports','multer','util','path'];(function(_0x41bd1d,_0x4bdc9d){var _0x57092c=function(_0x281b56){while(--_0x281b56){_0x41bd1d['push'](_0x41bd1d['shift']());}};_0x57092c(++_0x4bdc9d);}(_0x2ef3,0xba));var _0x32ef=function(_0x481dcd,_0x1b279f){_0x481dcd=_0x481dcd-0x0;var _0x265dc5=_0x2ef3[_0x481dcd];return _0x265dc5;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0x9')](_0x32ef('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x32ef('0x9')](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);router['post']('/',auth[_0x32ef('0xb')](),controller['create']);router[_0x32ef('0x12')]('/:id',auth[_0x32ef('0xb')](),controller[_0x32ef('0x13')]);router['delete']('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x14')]=router; \ No newline at end of file +var _0x5f2f=['Router','fs-extra','../../components/auth/service','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x699a09,_0x5bc65f){var _0x296b80=function(_0x2d3af9){while(--_0x2d3af9){_0x699a09['push'](_0x699a09['shift']());}};_0x296b80(++_0x5bc65f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1016f1,_0x3ff80f){_0x1016f1=_0x1016f1-0x0;var _0x34765b=_0x5f2f[_0x1016f1];return _0x34765b;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x9')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x11')]);router['get']('/:id/descriptions',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x12')]);router['post']('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x13')]);router[_0xf5f2('0x14')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x15')]);router['delete'](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x16')]);module[_0xf5f2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 692ab3f..257aa42 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 _0x6137=['Task','contact','lead','contact_lead','nothing','sequelize','STRING','ENUM','Case'];(function(_0x10852d,_0x4cdcc6){var _0x13a8d6=function(_0x2ece16){while(--_0x2ece16){_0x10852d['push'](_0x10852d['shift']());}};_0x13a8d6(++_0x4cdcc6);}(_0x6137,0x11c));var _0x7613=function(_0x39c72a,_0x4be754){_0x39c72a=_0x39c72a-0x0;var _0x5732bd=_0x6137[_0x39c72a];return _0x5732bd;};'use strict';var Sequelize=require(_0x7613('0x0'));module['exports']={'name':{'type':Sequelize[_0x7613('0x1')]},'description':{'type':Sequelize[_0x7613('0x1')]},'ticketType':{'type':Sequelize[_0x7613('0x2')]('Task',_0x7613('0x3')),'defaultValue':_0x7613('0x4')},'moduleSearch':{'type':Sequelize[_0x7613('0x2')]('contact_lead',_0x7613('0x5'),_0x7613('0x6'),'account_contact_lead','account'),'defaultValue':_0x7613('0x7')},'moduleCreate':{'type':Sequelize[_0x7613('0x2')](_0x7613('0x8'),_0x7613('0x5'),_0x7613('0x6'),'account'),'defaultValue':_0x7613('0x6')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x7613('0x1')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x10f2=['contact','contact_lead','account','lead','sequelize','exports','STRING','ENUM','Task'];(function(_0x29bfda,_0x30ad24){var _0x3f3db5=function(_0x238405){while(--_0x238405){_0x29bfda['push'](_0x29bfda['shift']());}};_0x3f3db5(++_0x30ad24);}(_0x10f2,0xc1));var _0x210f=function(_0x83f2b1,_0x4f2f1a){_0x83f2b1=_0x83f2b1-0x0;var _0x5cd177=_0x10f2[_0x83f2b1];return _0x5cd177;};'use strict';var Sequelize=require(_0x210f('0x0'));module[_0x210f('0x1')]={'name':{'type':Sequelize[_0x210f('0x2')]},'description':{'type':Sequelize[_0x210f('0x2')]},'ticketType':{'type':Sequelize[_0x210f('0x3')](_0x210f('0x4'),'Case'),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead',_0x210f('0x5'),'lead','account_contact_lead','account'),'defaultValue':_0x210f('0x6')},'moduleCreate':{'type':Sequelize[_0x210f('0x3')]('nothing','contact','lead',_0x210f('0x7')),'defaultValue':_0x210f('0x8')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x210f('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x210f('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x210f('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 1a4b445..c14e7ee 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 _0xb1ac=['mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','order','sort','where','merge','includeAll','include','findAll','catch','show','params','length','find','create','body','update','findOne','filter','options','getFields','hasOwnProperty','nolimit','getSubjects','getDescriptions','SalesforceField','pick','rimraf','zip-dir','moment','bluebird'];(function(_0x4e7f3f,_0x5c57da){var _0x441fd2=function(_0x177c74){while(--_0x177c74){_0x4e7f3f['push'](_0x4e7f3f['shift']());}};_0x441fd2(++_0x5c57da);}(_0xb1ac,0x134));var _0xcb1a=function(_0x23d8c3,_0x355adf){_0x23d8c3=_0x23d8c3-0x0;var _0x1f7a35=_0xb1ac[_0x23d8c3];return _0x1f7a35;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcb1a('0x0'));var zipdir=require(_0xcb1a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcb1a('0x2'));var BPromise=require(_0xcb1a('0x3'));var Mustache=require(_0xcb1a('0x4'));var util=require(_0xcb1a('0x5'));var path=require(_0xcb1a('0x6'));var sox=require(_0xcb1a('0x7'));var csv=require(_0xcb1a('0x8'));var ejs=require(_0xcb1a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcb1a('0xa'));var squel=require(_0xcb1a('0xb'));var crypto=require(_0xcb1a('0xc'));var jsforce=require(_0xcb1a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xcb1a('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xcb1a('0xe'));var qs=require(_0xcb1a('0xf'));var as=require(_0xcb1a('0x10'));var hardwareService=require(_0xcb1a('0x11'));var logger=require(_0xcb1a('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xcb1a('0x13'));var licenseUtil=require(_0xcb1a('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x39534d,_0x53c002){_0x53c002=_0x53c002||0xcc;return function(_0x1f68eb){if(_0x1f68eb){return _0x39534d[_0xcb1a('0x15')](_0x53c002);}return _0x39534d['status'](_0x53c002)['end']();};}function respondWithResult(_0x2ab05d,_0x1621d7){_0x1621d7=_0x1621d7||0xc8;return function(_0x55339f){if(_0x55339f){return _0x2ab05d[_0xcb1a('0x16')](_0x1621d7)[_0xcb1a('0x17')](_0x55339f);}};}function respondWithFilteredResult(_0x353bdb,_0x566fa3){return function(_0x1c47a7){if(_0x1c47a7){var _0x971453=typeof _0x566fa3[_0xcb1a('0x18')]===_0xcb1a('0x19')&&typeof _0x566fa3[_0xcb1a('0x1a')]==='undefined';var _0x25741c=_0x1c47a7[_0xcb1a('0x1b')];var _0x49b1a7=_0x971453?0x0:_0x566fa3['offset'];var _0x4b2f3e=_0x971453?_0x1c47a7['count']:_0x566fa3[_0xcb1a('0x18')]+_0x566fa3[_0xcb1a('0x1a')];var _0x100da7;if(_0x4b2f3e>=_0x25741c){_0x4b2f3e=_0x25741c;_0x100da7=0xc8;}else{_0x100da7=0xce;}_0x353bdb[_0xcb1a('0x16')](_0x100da7);return _0x353bdb['set'](_0xcb1a('0x1c'),_0x49b1a7+'-'+_0x4b2f3e+'/'+_0x25741c)['json'](_0x1c47a7);}return null;};}function patchUpdates(_0x2ef5a2){return function(_0x51a028){try{jsonpatch[_0xcb1a('0x1d')](_0x51a028,_0x2ef5a2,!![]);}catch(_0x5d66e7){return BPromise[_0xcb1a('0x1e')](_0x5d66e7);}return _0x51a028[_0xcb1a('0x1f')]();};}function saveUpdates(_0x41ba72,_0x775882){return function(_0x525ce9){if(_0x525ce9){return _0x525ce9['update'](_0x41ba72)[_0xcb1a('0x20')](function(_0x1bad52){return _0x1bad52;});}return null;};}function removeEntity(_0x5a4feb,_0x2f84d0){return function(_0x2a40cd){if(_0x2a40cd){return _0x2a40cd[_0xcb1a('0x21')]()[_0xcb1a('0x20')](function(){_0x5a4feb[_0xcb1a('0x16')](0xcc)[_0xcb1a('0x22')]();});}};}function handleEntityNotFound(_0xaead70,_0x38665b){return function(_0x1872a8){if(!_0x1872a8){_0xaead70[_0xcb1a('0x15')](0x194);}return _0x1872a8;};}function handleError(_0x3b4c75,_0xb9664f){_0xb9664f=_0xb9664f||0x1f4;return function(_0x16289a){logger[_0xcb1a('0x23')](_0x16289a[_0xcb1a('0x24')]);if(_0x16289a['name']){delete _0x16289a[_0xcb1a('0x25')];}_0x3b4c75[_0xcb1a('0x16')](_0xb9664f)[_0xcb1a('0x26')](_0x16289a);};}exports[_0xcb1a('0x27')]=function(_0x1b8e52,_0x5741f2){var _0x45034e={},_0x4a2305={},_0x1849b4={'count':0x0,'rows':[]};var _0x5a394b=_[_0xcb1a('0x28')](db[_0xcb1a('0x29')][_0xcb1a('0x2a')],function(_0x19f24a){return{'name':_0x19f24a[_0xcb1a('0x2b')],'type':_0x19f24a[_0xcb1a('0x2c')][_0xcb1a('0x2d')]};});_0x4a2305['model']=_['map'](_0x5a394b,'name');_0x4a2305['query']=_[_0xcb1a('0x2e')](_0x1b8e52['query']);_0x4a2305[_0xcb1a('0x2f')]=_[_0xcb1a('0x30')](_0x4a2305[_0xcb1a('0x31')],_0x4a2305[_0xcb1a('0x32')]);_0x45034e[_0xcb1a('0x33')]=_[_0xcb1a('0x30')](_0x4a2305[_0xcb1a('0x31')],qs['fields'](_0x1b8e52['query'][_0xcb1a('0x34')]));_0x45034e['attributes']=_0x45034e[_0xcb1a('0x33')]['length']?_0x45034e[_0xcb1a('0x33')]:_0x4a2305[_0xcb1a('0x31')];if(!_0x1b8e52[_0xcb1a('0x32')]['hasOwnProperty']('nolimit')){_0x45034e['limit']=qs[_0xcb1a('0x1a')](_0x1b8e52[_0xcb1a('0x32')][_0xcb1a('0x1a')]);_0x45034e[_0xcb1a('0x18')]=qs[_0xcb1a('0x18')](_0x1b8e52[_0xcb1a('0x32')][_0xcb1a('0x18')]);}_0x45034e[_0xcb1a('0x35')]=qs[_0xcb1a('0x36')](_0x1b8e52['query'][_0xcb1a('0x36')]);_0x45034e[_0xcb1a('0x37')]=qs[_0xcb1a('0x2f')](_['pick'](_0x1b8e52[_0xcb1a('0x32')],_0x4a2305[_0xcb1a('0x2f')]),_0x5a394b);if(_0x1b8e52[_0xcb1a('0x32')]['filter']){_0x45034e[_0xcb1a('0x37')]=_[_0xcb1a('0x38')](_0x45034e['where'],{'$or':_[_0xcb1a('0x28')](_0x5a394b,function(_0x35038d){if(_0x35038d[_0xcb1a('0x2c')]!=='VIRTUAL'){var _0x140540={};_0x140540[_0x35038d[_0xcb1a('0x25')]]={'$like':'%'+_0x1b8e52[_0xcb1a('0x32')]['filter']+'%'};return _0x140540;}})});}_0x45034e=_[_0xcb1a('0x38')]({},_0x45034e,_0x1b8e52['options']);var _0x3ba0c4={'where':_0x45034e['where']};return db[_0xcb1a('0x29')][_0xcb1a('0x1b')](_0x3ba0c4)['then'](function(_0x41127d){_0x1849b4[_0xcb1a('0x1b')]=_0x41127d;if(_0x1b8e52['query'][_0xcb1a('0x39')]){_0x45034e[_0xcb1a('0x3a')]=[{'all':!![]}];}return db[_0xcb1a('0x29')][_0xcb1a('0x3b')](_0x45034e);})['then'](function(_0x23a399){_0x1849b4['rows']=_0x23a399;return _0x1849b4;})[_0xcb1a('0x20')](respondWithFilteredResult(_0x5741f2,_0x45034e))[_0xcb1a('0x3c')](handleError(_0x5741f2,null));};exports[_0xcb1a('0x3d')]=function(_0x3f03f6,_0x172ca0){var _0x159890={'raw':![],'where':{'id':_0x3f03f6[_0xcb1a('0x3e')]['id']}},_0xe778f8={};_0xe778f8[_0xcb1a('0x31')]=_[_0xcb1a('0x2e')](db['SalesforceConfiguration'][_0xcb1a('0x2a')]);_0xe778f8[_0xcb1a('0x32')]=_[_0xcb1a('0x2e')](_0x3f03f6['query']);_0xe778f8[_0xcb1a('0x2f')]=_[_0xcb1a('0x30')](_0xe778f8[_0xcb1a('0x31')],_0xe778f8['query']);_0x159890[_0xcb1a('0x33')]=_['intersection'](_0xe778f8['model'],qs[_0xcb1a('0x34')](_0x3f03f6['query'][_0xcb1a('0x34')]));_0x159890[_0xcb1a('0x33')]=_0x159890[_0xcb1a('0x33')][_0xcb1a('0x3f')]?_0x159890[_0xcb1a('0x33')]:_0xe778f8[_0xcb1a('0x31')];if(_0x3f03f6[_0xcb1a('0x32')][_0xcb1a('0x39')]){_0x159890[_0xcb1a('0x3a')]=[{'all':!![]}];}_0x159890=_[_0xcb1a('0x38')]({},_0x159890,_0x3f03f6['options']);return db[_0xcb1a('0x29')][_0xcb1a('0x40')](_0x159890)[_0xcb1a('0x20')](handleEntityNotFound(_0x172ca0,null))[_0xcb1a('0x20')](respondWithResult(_0x172ca0,null))[_0xcb1a('0x3c')](handleError(_0x172ca0,null));};exports[_0xcb1a('0x41')]=function(_0x3f6d88,_0x78fc3c){return db[_0xcb1a('0x29')][_0xcb1a('0x41')](_0x3f6d88[_0xcb1a('0x42')],{})[_0xcb1a('0x20')](respondWithResult(_0x78fc3c,0xc9))['catch'](handleError(_0x78fc3c,null));};exports[_0xcb1a('0x43')]=function(_0x53477e,_0xb47c9d){if(_0x53477e[_0xcb1a('0x42')]['id']){delete _0x53477e[_0xcb1a('0x42')]['id'];}return db[_0xcb1a('0x29')]['find']({'where':{'id':_0x53477e[_0xcb1a('0x3e')]['id']}})[_0xcb1a('0x20')](handleEntityNotFound(_0xb47c9d,null))[_0xcb1a('0x20')](saveUpdates(_0x53477e[_0xcb1a('0x42')],null))[_0xcb1a('0x20')](respondWithResult(_0xb47c9d,null))[_0xcb1a('0x3c')](handleError(_0xb47c9d,null));};exports[_0xcb1a('0x21')]=function(_0x694341,_0xb2d24){return db['SalesforceConfiguration']['find']({'where':{'id':_0x694341[_0xcb1a('0x3e')]['id']}})[_0xcb1a('0x20')](handleEntityNotFound(_0xb2d24,null))[_0xcb1a('0x20')](removeEntity(_0xb2d24,null))['catch'](handleError(_0xb2d24,null));};exports['getFields']=function(_0x5d8f90,_0x5d8ec2,_0x2b853f){var _0x2d6493={};var _0x368177={};var _0x454fe2;var _0x28e0fe;return db[_0xcb1a('0x29')][_0xcb1a('0x44')]({'where':{'id':_0x5d8f90['params']['id']}})[_0xcb1a('0x20')](handleEntityNotFound(_0x5d8ec2,null))[_0xcb1a('0x20')](function(_0xb0bcc6){if(_0xb0bcc6){_0x454fe2=_0xb0bcc6;_0x368177[_0xcb1a('0x31')]=_[_0xcb1a('0x2e')](db['SalesforceField'][_0xcb1a('0x2a')]);_0x368177['query']=_[_0xcb1a('0x2e')](_0x5d8f90[_0xcb1a('0x32')]);_0x368177[_0xcb1a('0x2f')]=_[_0xcb1a('0x30')](_0x368177[_0xcb1a('0x31')],_0x368177[_0xcb1a('0x32')]);_0x2d6493[_0xcb1a('0x33')]=_[_0xcb1a('0x30')](_0x368177[_0xcb1a('0x31')],qs[_0xcb1a('0x34')](_0x5d8f90['query'][_0xcb1a('0x34')]));_0x2d6493['attributes']=_0x2d6493[_0xcb1a('0x33')][_0xcb1a('0x3f')]?_0x2d6493[_0xcb1a('0x33')]:_0x368177[_0xcb1a('0x31')];_0x2d6493[_0xcb1a('0x35')]=qs['sort'](_0x5d8f90[_0xcb1a('0x32')]['sort']);_0x2d6493[_0xcb1a('0x37')]=qs['filters'](_['pick'](_0x5d8f90[_0xcb1a('0x32')],_0x368177[_0xcb1a('0x2f')]));if(_0x5d8f90['query'][_0xcb1a('0x45')]){_0x2d6493[_0xcb1a('0x37')]=_[_0xcb1a('0x38')](_0x2d6493[_0xcb1a('0x37')],{'$or':_[_0xcb1a('0x28')](_0x2d6493[_0xcb1a('0x33')],function(_0x5d9af8){var _0x445542={};_0x445542[_0x5d9af8]={'$like':'%'+_0x5d8f90[_0xcb1a('0x32')][_0xcb1a('0x45')]+'%'};return _0x445542;})});}_0x2d6493=_[_0xcb1a('0x38')]({},_0x2d6493,_0x5d8f90[_0xcb1a('0x46')]);return _0x454fe2[_0xcb1a('0x47')](_0x2d6493);}})[_0xcb1a('0x20')](function(_0x17d373){if(_0x17d373){_0x28e0fe=_0x17d373[_0xcb1a('0x3f')];if(!_0x5d8f90['query'][_0xcb1a('0x48')](_0xcb1a('0x49'))){_0x2d6493[_0xcb1a('0x1a')]=qs[_0xcb1a('0x1a')](_0x5d8f90[_0xcb1a('0x32')]['limit']);_0x2d6493[_0xcb1a('0x18')]=qs[_0xcb1a('0x18')](_0x5d8f90['query'][_0xcb1a('0x18')]);}return _0x454fe2[_0xcb1a('0x47')](_0x2d6493);}})[_0xcb1a('0x20')](function(_0x10e220){if(_0x10e220){return _0x10e220?{'count':_0x28e0fe,'rows':_0x10e220}:null;}})['then'](respondWithResult(_0x5d8ec2,null))[_0xcb1a('0x3c')](handleError(_0x5d8ec2,null));};exports[_0xcb1a('0x4a')]=function(_0x67080a,_0x5abb0b,_0x18f04b){var _0x5a23a3={};var _0x128ddd={};var _0x35159b;var _0x417702;return db['SalesforceConfiguration'][_0xcb1a('0x44')]({'where':{'id':_0x67080a[_0xcb1a('0x3e')]['id']}})[_0xcb1a('0x20')](handleEntityNotFound(_0x5abb0b,null))[_0xcb1a('0x20')](function(_0x34e6f9){if(_0x34e6f9){_0x35159b=_0x34e6f9;_0x128ddd['model']=_[_0xcb1a('0x2e')](db['SalesforceField'][_0xcb1a('0x2a')]);_0x128ddd['query']=_['keys'](_0x67080a['query']);_0x128ddd[_0xcb1a('0x2f')]=_['intersection'](_0x128ddd[_0xcb1a('0x31')],_0x128ddd[_0xcb1a('0x32')]);_0x5a23a3[_0xcb1a('0x33')]=_[_0xcb1a('0x30')](_0x128ddd['model'],qs[_0xcb1a('0x34')](_0x67080a['query'][_0xcb1a('0x34')]));_0x5a23a3[_0xcb1a('0x33')]=_0x5a23a3[_0xcb1a('0x33')][_0xcb1a('0x3f')]?_0x5a23a3['attributes']:_0x128ddd[_0xcb1a('0x31')];_0x5a23a3['order']=qs['sort'](_0x67080a[_0xcb1a('0x32')][_0xcb1a('0x36')]);_0x5a23a3[_0xcb1a('0x37')]=qs[_0xcb1a('0x2f')](_['pick'](_0x67080a['query'],_0x128ddd[_0xcb1a('0x2f')]));if(_0x67080a[_0xcb1a('0x32')][_0xcb1a('0x45')]){_0x5a23a3[_0xcb1a('0x37')]=_['merge'](_0x5a23a3[_0xcb1a('0x37')],{'$or':_[_0xcb1a('0x28')](_0x5a23a3[_0xcb1a('0x33')],function(_0x345ebb){var _0x53c6b7={};_0x53c6b7[_0x345ebb]={'$like':'%'+_0x67080a['query'][_0xcb1a('0x45')]+'%'};return _0x53c6b7;})});}_0x5a23a3=_[_0xcb1a('0x38')]({},_0x5a23a3,_0x67080a[_0xcb1a('0x46')]);return _0x35159b[_0xcb1a('0x4a')](_0x5a23a3);}})[_0xcb1a('0x20')](function(_0x5cc001){if(_0x5cc001){_0x417702=_0x5cc001[_0xcb1a('0x3f')];if(!_0x67080a['query']['hasOwnProperty'](_0xcb1a('0x49'))){_0x5a23a3[_0xcb1a('0x1a')]=qs[_0xcb1a('0x1a')](_0x67080a[_0xcb1a('0x32')]['limit']);_0x5a23a3['offset']=qs[_0xcb1a('0x18')](_0x67080a['query'][_0xcb1a('0x18')]);}return _0x35159b[_0xcb1a('0x4a')](_0x5a23a3);}})[_0xcb1a('0x20')](function(_0x98a075){if(_0x98a075){return _0x98a075?{'count':_0x417702,'rows':_0x98a075}:null;}})[_0xcb1a('0x20')](respondWithResult(_0x5abb0b,null))[_0xcb1a('0x3c')](handleError(_0x5abb0b,null));};exports[_0xcb1a('0x4b')]=function(_0x15b79d,_0x37f645,_0x149f9f){var _0x543cf8={};var _0x558e08={};var _0x41082d;var _0x217511;return db[_0xcb1a('0x29')][_0xcb1a('0x44')]({'where':{'id':_0x15b79d[_0xcb1a('0x3e')]['id']}})[_0xcb1a('0x20')](handleEntityNotFound(_0x37f645,null))[_0xcb1a('0x20')](function(_0x3012d9){if(_0x3012d9){_0x41082d=_0x3012d9;_0x558e08[_0xcb1a('0x31')]=_['keys'](db[_0xcb1a('0x4c')][_0xcb1a('0x2a')]);_0x558e08[_0xcb1a('0x32')]=_[_0xcb1a('0x2e')](_0x15b79d[_0xcb1a('0x32')]);_0x558e08[_0xcb1a('0x2f')]=_[_0xcb1a('0x30')](_0x558e08[_0xcb1a('0x31')],_0x558e08[_0xcb1a('0x32')]);_0x543cf8['attributes']=_[_0xcb1a('0x30')](_0x558e08[_0xcb1a('0x31')],qs[_0xcb1a('0x34')](_0x15b79d[_0xcb1a('0x32')][_0xcb1a('0x34')]));_0x543cf8[_0xcb1a('0x33')]=_0x543cf8['attributes']['length']?_0x543cf8[_0xcb1a('0x33')]:_0x558e08['model'];_0x543cf8[_0xcb1a('0x35')]=qs[_0xcb1a('0x36')](_0x15b79d[_0xcb1a('0x32')][_0xcb1a('0x36')]);_0x543cf8[_0xcb1a('0x37')]=qs[_0xcb1a('0x2f')](_[_0xcb1a('0x4d')](_0x15b79d[_0xcb1a('0x32')],_0x558e08[_0xcb1a('0x2f')]));if(_0x15b79d['query'][_0xcb1a('0x45')]){_0x543cf8[_0xcb1a('0x37')]=_['merge'](_0x543cf8[_0xcb1a('0x37')],{'$or':_[_0xcb1a('0x28')](_0x543cf8[_0xcb1a('0x33')],function(_0x570bee){var _0x50be16={};_0x50be16[_0x570bee]={'$like':'%'+_0x15b79d[_0xcb1a('0x32')][_0xcb1a('0x45')]+'%'};return _0x50be16;})});}_0x543cf8=_[_0xcb1a('0x38')]({},_0x543cf8,_0x15b79d['options']);return _0x41082d[_0xcb1a('0x4b')](_0x543cf8);}})['then'](function(_0x106b25){if(_0x106b25){_0x217511=_0x106b25[_0xcb1a('0x3f')];if(!_0x15b79d[_0xcb1a('0x32')][_0xcb1a('0x48')](_0xcb1a('0x49'))){_0x543cf8['limit']=qs[_0xcb1a('0x1a')](_0x15b79d[_0xcb1a('0x32')][_0xcb1a('0x1a')]);_0x543cf8[_0xcb1a('0x18')]=qs[_0xcb1a('0x18')](_0x15b79d[_0xcb1a('0x32')]['offset']);}return _0x41082d[_0xcb1a('0x4b')](_0x543cf8);}})['then'](function(_0x4fcf74){if(_0x4fcf74){return _0x4fcf74?{'count':_0x217511,'rows':_0x4fcf74}:null;}})[_0xcb1a('0x20')](respondWithResult(_0x37f645,null))[_0xcb1a('0x3c')](handleError(_0x37f645,null));}; \ No newline at end of file +var _0x36f4=['include','findAll','rows','catch','show','params','create','body','find','getFields','findOne','SalesforceField','getSubjects','options','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','lodash','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','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','SalesforceConfiguration','includeAll'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x36f4,0xb3));var _0x436f=function(_0x39135b,_0x187955){_0x39135b=_0x39135b-0x0;var _0x1f6a1d=_0x36f4[_0x39135b];return _0x1f6a1d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x436f('0x0'));var zipdir=require(_0x436f('0x1'));var jsonpatch=require(_0x436f('0x2'));var rp=require(_0x436f('0x3'));var moment=require(_0x436f('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x436f('0x5'));var path=require(_0x436f('0x6'));var sox=require(_0x436f('0x7'));var csv=require(_0x436f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x436f('0x9'));var squel=require('squel');var crypto=require(_0x436f('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x436f('0xb'));var toCsv=require(_0x436f('0x8'));var querystring=require(_0x436f('0xc'));var Papa=require(_0x436f('0xd'));var Redis=require(_0x436f('0xe'));var authService=require(_0x436f('0xf'));var qs=require(_0x436f('0x10'));var as=require(_0x436f('0x11'));var hardwareService=require(_0x436f('0x12'));var logger=require(_0x436f('0x13'))('api');var utils=require(_0x436f('0x14'));var config=require(_0x436f('0x15'));var licenseUtil=require(_0x436f('0x16'));var db=require(_0x436f('0x17'))['db'];function respondWithStatusCode(_0x20d34f,_0x16b6a5){_0x16b6a5=_0x16b6a5||0xcc;return function(_0x446509){if(_0x446509){return _0x20d34f[_0x436f('0x18')](_0x16b6a5);}return _0x20d34f[_0x436f('0x19')](_0x16b6a5)[_0x436f('0x1a')]();};}function respondWithResult(_0x5d6ea4,_0x4d9508){_0x4d9508=_0x4d9508||0xc8;return function(_0x7fdfc5){if(_0x7fdfc5){return _0x5d6ea4[_0x436f('0x19')](_0x4d9508)[_0x436f('0x1b')](_0x7fdfc5);}};}function respondWithFilteredResult(_0x21c73d,_0x496b96){return function(_0x5d3feb){if(_0x5d3feb){var _0x1bee9f=typeof _0x496b96['offset']===_0x436f('0x1c')&&typeof _0x496b96['limit']===_0x436f('0x1c');var _0x30b4c8=_0x5d3feb[_0x436f('0x1d')];var _0x3185a7=_0x1bee9f?0x0:_0x496b96[_0x436f('0x1e')];var _0x29399c=_0x1bee9f?_0x5d3feb[_0x436f('0x1d')]:_0x496b96[_0x436f('0x1e')]+_0x496b96['limit'];var _0x217238;if(_0x29399c>=_0x30b4c8){_0x29399c=_0x30b4c8;_0x217238=0xc8;}else{_0x217238=0xce;}_0x21c73d[_0x436f('0x19')](_0x217238);return _0x21c73d[_0x436f('0x1f')](_0x436f('0x20'),_0x3185a7+'-'+_0x29399c+'/'+_0x30b4c8)[_0x436f('0x1b')](_0x5d3feb);}return null;};}function patchUpdates(_0x14b3aa){return function(_0x3ba805){try{jsonpatch['apply'](_0x3ba805,_0x14b3aa,!![]);}catch(_0x226fef){return BPromise[_0x436f('0x21')](_0x226fef);}return _0x3ba805[_0x436f('0x22')]();};}function saveUpdates(_0x1e5ef4,_0x2a5f7e){return function(_0x449c22){if(_0x449c22){return _0x449c22[_0x436f('0x23')](_0x1e5ef4)[_0x436f('0x24')](function(_0x4c8173){return _0x4c8173;});}return null;};}function removeEntity(_0x30e64a,_0x48b8fd){return function(_0x392705){if(_0x392705){return _0x392705[_0x436f('0x25')]()[_0x436f('0x24')](function(){_0x30e64a[_0x436f('0x19')](0xcc)[_0x436f('0x1a')]();});}};}function handleEntityNotFound(_0x3db4c3,_0x380de8){return function(_0x37ea9a){if(!_0x37ea9a){_0x3db4c3[_0x436f('0x18')](0x194);}return _0x37ea9a;};}function handleError(_0x41faf6,_0x463539){_0x463539=_0x463539||0x1f4;return function(_0x5aadb9){logger[_0x436f('0x26')](_0x5aadb9['stack']);if(_0x5aadb9[_0x436f('0x27')]){delete _0x5aadb9[_0x436f('0x27')];}_0x41faf6[_0x436f('0x19')](_0x463539)[_0x436f('0x28')](_0x5aadb9);};}exports[_0x436f('0x29')]=function(_0x11cc89,_0xd40a8b){var _0x5a04a3={},_0x4b4fa1={},_0x31567a={'count':0x0,'rows':[]};var _0x2df471=_['map'](db['SalesforceConfiguration'][_0x436f('0x2a')],function(_0x475ed2){return{'name':_0x475ed2[_0x436f('0x2b')],'type':_0x475ed2[_0x436f('0x2c')][_0x436f('0x2d')]};});_0x4b4fa1[_0x436f('0x2e')]=_[_0x436f('0x2f')](_0x2df471,_0x436f('0x27'));_0x4b4fa1[_0x436f('0x30')]=_[_0x436f('0x31')](_0x11cc89[_0x436f('0x30')]);_0x4b4fa1[_0x436f('0x32')]=_[_0x436f('0x33')](_0x4b4fa1[_0x436f('0x2e')],_0x4b4fa1[_0x436f('0x30')]);_0x5a04a3['attributes']=_['intersection'](_0x4b4fa1[_0x436f('0x2e')],qs[_0x436f('0x34')](_0x11cc89[_0x436f('0x30')]['fields']));_0x5a04a3[_0x436f('0x35')]=_0x5a04a3[_0x436f('0x35')][_0x436f('0x36')]?_0x5a04a3[_0x436f('0x35')]:_0x4b4fa1[_0x436f('0x2e')];if(!_0x11cc89['query'][_0x436f('0x37')](_0x436f('0x38'))){_0x5a04a3[_0x436f('0x39')]=qs[_0x436f('0x39')](_0x11cc89[_0x436f('0x30')][_0x436f('0x39')]);_0x5a04a3['offset']=qs['offset'](_0x11cc89[_0x436f('0x30')][_0x436f('0x1e')]);}_0x5a04a3[_0x436f('0x3a')]=qs[_0x436f('0x3b')](_0x11cc89[_0x436f('0x30')]['sort']);_0x5a04a3[_0x436f('0x3c')]=qs[_0x436f('0x32')](_[_0x436f('0x3d')](_0x11cc89['query'],_0x4b4fa1['filters']),_0x2df471);if(_0x11cc89[_0x436f('0x30')][_0x436f('0x3e')]){_0x5a04a3[_0x436f('0x3c')]=_[_0x436f('0x3f')](_0x5a04a3[_0x436f('0x3c')],{'$or':_['map'](_0x2df471,function(_0x185485){if(_0x185485[_0x436f('0x2c')]!==_0x436f('0x40')){var _0x3836e5={};_0x3836e5[_0x185485[_0x436f('0x27')]]={'$like':'%'+_0x11cc89[_0x436f('0x30')]['filter']+'%'};return _0x3836e5;}})});}_0x5a04a3=_[_0x436f('0x3f')]({},_0x5a04a3,_0x11cc89['options']);var _0xf926c8={'where':_0x5a04a3[_0x436f('0x3c')]};return db[_0x436f('0x41')]['count'](_0xf926c8)[_0x436f('0x24')](function(_0x352942){_0x31567a['count']=_0x352942;if(_0x11cc89['query'][_0x436f('0x42')]){_0x5a04a3[_0x436f('0x43')]=[{'all':!![]}];}return db[_0x436f('0x41')][_0x436f('0x44')](_0x5a04a3);})[_0x436f('0x24')](function(_0x212547){_0x31567a[_0x436f('0x45')]=_0x212547;return _0x31567a;})[_0x436f('0x24')](respondWithFilteredResult(_0xd40a8b,_0x5a04a3))[_0x436f('0x46')](handleError(_0xd40a8b,null));};exports[_0x436f('0x47')]=function(_0x665663,_0x370fb4){var _0x2754f9={'raw':![],'where':{'id':_0x665663[_0x436f('0x48')]['id']}},_0x353c23={};_0x353c23['model']=_[_0x436f('0x31')](db[_0x436f('0x41')][_0x436f('0x2a')]);_0x353c23[_0x436f('0x30')]=_['keys'](_0x665663[_0x436f('0x30')]);_0x353c23[_0x436f('0x32')]=_[_0x436f('0x33')](_0x353c23[_0x436f('0x2e')],_0x353c23[_0x436f('0x30')]);_0x2754f9[_0x436f('0x35')]=_['intersection'](_0x353c23['model'],qs[_0x436f('0x34')](_0x665663[_0x436f('0x30')][_0x436f('0x34')]));_0x2754f9['attributes']=_0x2754f9[_0x436f('0x35')][_0x436f('0x36')]?_0x2754f9[_0x436f('0x35')]:_0x353c23['model'];if(_0x665663[_0x436f('0x30')][_0x436f('0x42')]){_0x2754f9[_0x436f('0x43')]=[{'all':!![]}];}_0x2754f9=_['merge']({},_0x2754f9,_0x665663['options']);return db['SalesforceConfiguration']['find'](_0x2754f9)['then'](handleEntityNotFound(_0x370fb4,null))[_0x436f('0x24')](respondWithResult(_0x370fb4,null))['catch'](handleError(_0x370fb4,null));};exports[_0x436f('0x49')]=function(_0x27b7f8,_0x2c31c1){return db[_0x436f('0x41')]['create'](_0x27b7f8[_0x436f('0x4a')],{})['then'](respondWithResult(_0x2c31c1,0xc9))['catch'](handleError(_0x2c31c1,null));};exports[_0x436f('0x23')]=function(_0x5033a8,_0x4c681a){if(_0x5033a8[_0x436f('0x4a')]['id']){delete _0x5033a8[_0x436f('0x4a')]['id'];}return db[_0x436f('0x41')][_0x436f('0x4b')]({'where':{'id':_0x5033a8[_0x436f('0x48')]['id']}})[_0x436f('0x24')](handleEntityNotFound(_0x4c681a,null))[_0x436f('0x24')](saveUpdates(_0x5033a8[_0x436f('0x4a')],null))['then'](respondWithResult(_0x4c681a,null))[_0x436f('0x46')](handleError(_0x4c681a,null));};exports['destroy']=function(_0x55817c,_0x11b9bd){return db['SalesforceConfiguration'][_0x436f('0x4b')]({'where':{'id':_0x55817c[_0x436f('0x48')]['id']}})[_0x436f('0x24')](handleEntityNotFound(_0x11b9bd,null))[_0x436f('0x24')](removeEntity(_0x11b9bd,null))[_0x436f('0x46')](handleError(_0x11b9bd,null));};exports[_0x436f('0x4c')]=function(_0x76aa7,_0x1e63e2,_0x177fb6){var _0x305f52={};var _0x44a8bf={};var _0x53a98b;var _0x10fe89;return db['SalesforceConfiguration'][_0x436f('0x4d')]({'where':{'id':_0x76aa7[_0x436f('0x48')]['id']}})['then'](handleEntityNotFound(_0x1e63e2,null))[_0x436f('0x24')](function(_0x1111d2){if(_0x1111d2){_0x53a98b=_0x1111d2;_0x44a8bf[_0x436f('0x2e')]=_['keys'](db[_0x436f('0x4e')][_0x436f('0x2a')]);_0x44a8bf[_0x436f('0x30')]=_['keys'](_0x76aa7[_0x436f('0x30')]);_0x44a8bf[_0x436f('0x32')]=_[_0x436f('0x33')](_0x44a8bf[_0x436f('0x2e')],_0x44a8bf['query']);_0x305f52[_0x436f('0x35')]=_[_0x436f('0x33')](_0x44a8bf[_0x436f('0x2e')],qs[_0x436f('0x34')](_0x76aa7['query'][_0x436f('0x34')]));_0x305f52['attributes']=_0x305f52[_0x436f('0x35')][_0x436f('0x36')]?_0x305f52[_0x436f('0x35')]:_0x44a8bf[_0x436f('0x2e')];_0x305f52[_0x436f('0x3a')]=qs[_0x436f('0x3b')](_0x76aa7[_0x436f('0x30')][_0x436f('0x3b')]);_0x305f52[_0x436f('0x3c')]=qs[_0x436f('0x32')](_[_0x436f('0x3d')](_0x76aa7[_0x436f('0x30')],_0x44a8bf['filters']));if(_0x76aa7[_0x436f('0x30')][_0x436f('0x3e')]){_0x305f52[_0x436f('0x3c')]=_[_0x436f('0x3f')](_0x305f52[_0x436f('0x3c')],{'$or':_[_0x436f('0x2f')](_0x305f52[_0x436f('0x35')],function(_0x5794b3){var _0x2ffae2={};_0x2ffae2[_0x5794b3]={'$like':'%'+_0x76aa7[_0x436f('0x30')][_0x436f('0x3e')]+'%'};return _0x2ffae2;})});}_0x305f52=_['merge']({},_0x305f52,_0x76aa7['options']);return _0x53a98b[_0x436f('0x4c')](_0x305f52);}})[_0x436f('0x24')](function(_0x50c48b){if(_0x50c48b){_0x10fe89=_0x50c48b['length'];if(!_0x76aa7[_0x436f('0x30')][_0x436f('0x37')](_0x436f('0x38'))){_0x305f52['limit']=qs['limit'](_0x76aa7[_0x436f('0x30')][_0x436f('0x39')]);_0x305f52[_0x436f('0x1e')]=qs['offset'](_0x76aa7[_0x436f('0x30')][_0x436f('0x1e')]);}return _0x53a98b[_0x436f('0x4c')](_0x305f52);}})['then'](function(_0x2df5ec){if(_0x2df5ec){return _0x2df5ec?{'count':_0x10fe89,'rows':_0x2df5ec}:null;}})[_0x436f('0x24')](respondWithResult(_0x1e63e2,null))[_0x436f('0x46')](handleError(_0x1e63e2,null));};exports[_0x436f('0x4f')]=function(_0x464aff,_0x3e983d,_0x499e16){var _0x3fdc3b={};var _0x33bc04={};var _0x2180cc;var _0x1be093;return db[_0x436f('0x41')][_0x436f('0x4d')]({'where':{'id':_0x464aff[_0x436f('0x48')]['id']}})[_0x436f('0x24')](handleEntityNotFound(_0x3e983d,null))['then'](function(_0x180db3){if(_0x180db3){_0x2180cc=_0x180db3;_0x33bc04[_0x436f('0x2e')]=_[_0x436f('0x31')](db['SalesforceField'][_0x436f('0x2a')]);_0x33bc04[_0x436f('0x30')]=_[_0x436f('0x31')](_0x464aff[_0x436f('0x30')]);_0x33bc04[_0x436f('0x32')]=_['intersection'](_0x33bc04[_0x436f('0x2e')],_0x33bc04['query']);_0x3fdc3b['attributes']=_[_0x436f('0x33')](_0x33bc04[_0x436f('0x2e')],qs[_0x436f('0x34')](_0x464aff[_0x436f('0x30')][_0x436f('0x34')]));_0x3fdc3b[_0x436f('0x35')]=_0x3fdc3b[_0x436f('0x35')]['length']?_0x3fdc3b[_0x436f('0x35')]:_0x33bc04[_0x436f('0x2e')];_0x3fdc3b[_0x436f('0x3a')]=qs['sort'](_0x464aff[_0x436f('0x30')][_0x436f('0x3b')]);_0x3fdc3b['where']=qs[_0x436f('0x32')](_[_0x436f('0x3d')](_0x464aff[_0x436f('0x30')],_0x33bc04[_0x436f('0x32')]));if(_0x464aff[_0x436f('0x30')][_0x436f('0x3e')]){_0x3fdc3b[_0x436f('0x3c')]=_[_0x436f('0x3f')](_0x3fdc3b[_0x436f('0x3c')],{'$or':_['map'](_0x3fdc3b[_0x436f('0x35')],function(_0xca9e48){var _0x3c2e7f={};_0x3c2e7f[_0xca9e48]={'$like':'%'+_0x464aff[_0x436f('0x30')][_0x436f('0x3e')]+'%'};return _0x3c2e7f;})});}_0x3fdc3b=_[_0x436f('0x3f')]({},_0x3fdc3b,_0x464aff[_0x436f('0x50')]);return _0x2180cc['getSubjects'](_0x3fdc3b);}})[_0x436f('0x24')](function(_0x52c82c){if(_0x52c82c){_0x1be093=_0x52c82c[_0x436f('0x36')];if(!_0x464aff[_0x436f('0x30')][_0x436f('0x37')](_0x436f('0x38'))){_0x3fdc3b[_0x436f('0x39')]=qs['limit'](_0x464aff[_0x436f('0x30')][_0x436f('0x39')]);_0x3fdc3b[_0x436f('0x1e')]=qs[_0x436f('0x1e')](_0x464aff['query']['offset']);}return _0x2180cc[_0x436f('0x4f')](_0x3fdc3b);}})['then'](function(_0x5280d2){if(_0x5280d2){return _0x5280d2?{'count':_0x1be093,'rows':_0x5280d2}:null;}})[_0x436f('0x24')](respondWithResult(_0x3e983d,null))[_0x436f('0x46')](handleError(_0x3e983d,null));};exports[_0x436f('0x51')]=function(_0x39ed87,_0x35c1f6,_0x20589e){var _0x431bad={};var _0x572a74={};var _0x53b852;var _0x2f73d3;return db[_0x436f('0x41')][_0x436f('0x4d')]({'where':{'id':_0x39ed87[_0x436f('0x48')]['id']}})[_0x436f('0x24')](handleEntityNotFound(_0x35c1f6,null))[_0x436f('0x24')](function(_0x1f8e66){if(_0x1f8e66){_0x53b852=_0x1f8e66;_0x572a74[_0x436f('0x2e')]=_[_0x436f('0x31')](db[_0x436f('0x4e')][_0x436f('0x2a')]);_0x572a74[_0x436f('0x30')]=_[_0x436f('0x31')](_0x39ed87[_0x436f('0x30')]);_0x572a74[_0x436f('0x32')]=_[_0x436f('0x33')](_0x572a74[_0x436f('0x2e')],_0x572a74[_0x436f('0x30')]);_0x431bad[_0x436f('0x35')]=_[_0x436f('0x33')](_0x572a74['model'],qs[_0x436f('0x34')](_0x39ed87['query'][_0x436f('0x34')]));_0x431bad[_0x436f('0x35')]=_0x431bad[_0x436f('0x35')][_0x436f('0x36')]?_0x431bad[_0x436f('0x35')]:_0x572a74['model'];_0x431bad[_0x436f('0x3a')]=qs[_0x436f('0x3b')](_0x39ed87[_0x436f('0x30')]['sort']);_0x431bad['where']=qs['filters'](_['pick'](_0x39ed87['query'],_0x572a74[_0x436f('0x32')]));if(_0x39ed87[_0x436f('0x30')][_0x436f('0x3e')]){_0x431bad[_0x436f('0x3c')]=_[_0x436f('0x3f')](_0x431bad[_0x436f('0x3c')],{'$or':_['map'](_0x431bad[_0x436f('0x35')],function(_0x256140){var _0x4902a5={};_0x4902a5[_0x256140]={'$like':'%'+_0x39ed87['query'][_0x436f('0x3e')]+'%'};return _0x4902a5;})});}_0x431bad=_[_0x436f('0x3f')]({},_0x431bad,_0x39ed87[_0x436f('0x50')]);return _0x53b852[_0x436f('0x51')](_0x431bad);}})[_0x436f('0x24')](function(_0x27aae1){if(_0x27aae1){_0x2f73d3=_0x27aae1[_0x436f('0x36')];if(!_0x39ed87[_0x436f('0x30')][_0x436f('0x37')](_0x436f('0x38'))){_0x431bad[_0x436f('0x39')]=qs['limit'](_0x39ed87[_0x436f('0x30')][_0x436f('0x39')]);_0x431bad[_0x436f('0x1e')]=qs[_0x436f('0x1e')](_0x39ed87[_0x436f('0x30')]['offset']);}return _0x53b852['getDescriptions'](_0x431bad);}})[_0x436f('0x24')](function(_0x5c979b){if(_0x5c979b){return _0x5c979b?{'count':_0x2f73d3,'rows':_0x5c979b}:null;}})[_0x436f('0x24')](respondWithResult(_0x35c1f6,null))[_0x436f('0x46')](handleError(_0x35c1f6,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index f2dfd08..7142bba 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 _0xe680=['api','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','define','SalesforceConfiguration','int_salesforce_configurations','util','../../config/logger'];(function(_0x414166,_0x5e87f3){var _0x373505=function(_0x1cd5b1){while(--_0x1cd5b1){_0x414166['push'](_0x414166['shift']());}};_0x373505(++_0x5e87f3);}(_0xe680,0xcf));var _0x0e68=function(_0x5ecbe8,_0x42522f){_0x5ecbe8=_0x5ecbe8-0x0;var _0x1c6e21=_0xe680[_0x5ecbe8];return _0x1c6e21;};'use strict';var _=require('lodash');var util=require(_0x0e68('0x0'));var logger=require(_0x0e68('0x1'))(_0x0e68('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0e68('0x3'));var fs=require('fs');var path=require(_0x0e68('0x4'));var rimraf=require(_0x0e68('0x5'));var config=require(_0x0e68('0x6'));var attributes=require(_0x0e68('0x7'));module['exports']=function(_0x5f4a66,_0x10d930){return _0x5f4a66[_0x0e68('0x8')](_0x0e68('0x9'),attributes,{'tableName':_0x0e68('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2333=['exports','SalesforceConfiguration','int_salesforce_configurations','lodash','../../config/logger','api','request-promise','rimraf','../../config/environment'];(function(_0x4a3b65,_0x40f089){var _0x3b193d=function(_0x39cf79){while(--_0x39cf79){_0x4a3b65['push'](_0x4a3b65['shift']());}};_0x3b193d(++_0x40f089);}(_0x2333,0x174));var _0x3233=function(_0x36f998,_0x31eb60){_0x36f998=_0x36f998-0x0;var _0x3f75eb=_0x2333[_0x36f998];return _0x3f75eb;};'use strict';var _=require(_0x3233('0x0'));var util=require('util');var logger=require(_0x3233('0x1'))(_0x3233('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3233('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3233('0x4'));var config=require(_0x3233('0x5'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0x3233('0x6')]=function(_0x3fa6f0,_0x3ed8dd){return _0x3fa6f0['define'](_0x3233('0x7'),attributes,{'tableName':_0x3233('0x8'),'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 0db4dd7..d952f0b 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 _0xaeff=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','moment','bluebird','randomstring'];(function(_0x2c45dd,_0x33c52c){var _0x1d2714=function(_0x3bc65e){while(--_0x3bc65e){_0x2c45dd['push'](_0x2c45dd['shift']());}};_0x1d2714(++_0x33c52c);}(_0xaeff,0x150));var _0xfaef=function(_0x4a0370,_0x46a3cd){_0x4a0370=_0x4a0370-0x0;var _0x3fc752=_0xaeff[_0x4a0370];return _0x3fc752;};'use strict';var _=require(_0xfaef('0x0'));var util=require('util');var moment=require(_0xfaef('0x1'));var BPromise=require(_0xfaef('0x2'));var rs=require(_0xfaef('0x3'));var fs=require('fs');var Redis=require(_0xfaef('0x4'));var db=require(_0xfaef('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfaef('0x6'))(_0xfaef('0x7'));var config=require(_0xfaef('0x8'));var jayson=require(_0xfaef('0x9'));var client=jayson[_0xfaef('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4419bd,_0x51c50f,_0x2fd762){return new BPromise(function(_0x15bb4e,_0x441320){return client['request'](_0x4419bd,_0x2fd762)[_0xfaef('0xb')](function(_0x4339de){logger[_0xfaef('0xc')](_0xfaef('0xd'),_0x51c50f,'request\x20sent');logger['debug']('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x51c50f,_0xfaef('0xe'),JSON[_0xfaef('0xf')](_0x4339de));if(_0x4339de[_0xfaef('0x10')]){if(_0x4339de[_0xfaef('0x10')][_0xfaef('0x11')]===0x1f4){logger['error'](_0xfaef('0xd'),_0x51c50f,_0x4339de[_0xfaef('0x10')][_0xfaef('0x12')]);return _0x441320(_0x4339de['error']['message']);}logger[_0xfaef('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x51c50f,_0x4339de[_0xfaef('0x10')]['message']);return _0x15bb4e(_0x4339de[_0xfaef('0x10')][_0xfaef('0x12')]);}else{logger[_0xfaef('0xc')](_0xfaef('0xd'),_0x51c50f,_0xfaef('0xe'));_0x15bb4e(_0x4339de[_0xfaef('0x13')][_0xfaef('0x12')]);}})['catch'](function(_0x317443){logger[_0xfaef('0x10')](_0xfaef('0xd'),_0x51c50f,_0x317443);_0x441320(_0x317443);});});} \ No newline at end of file +var _0x4111=['../../config/utils','rpc','../../config/environment','http','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','bluebird','ioredis','../../mysqldb'];(function(_0xc1fac2,_0x725358){var _0x1a31f8=function(_0x22e4f3){while(--_0x22e4f3){_0xc1fac2['push'](_0xc1fac2['shift']());}};_0x1a31f8(++_0x725358);}(_0x4111,0x199));var _0x1411=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4111[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x1411('0x0'));var util=require(_0x1411('0x1'));var moment=require('moment');var BPromise=require(_0x1411('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1411('0x3'));var db=require(_0x1411('0x4'))['db'];var utils=require(_0x1411('0x5'));var logger=require('../../config/logger')(_0x1411('0x6'));var config=require(_0x1411('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1411('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x16a63e,_0x14be28,_0xcf2071){return new BPromise(function(_0x5e35d5,_0x3b88f9){return client['request'](_0x16a63e,_0xcf2071)[_0x1411('0x9')](function(_0x4e80b6){logger[_0x1411('0xa')](_0x1411('0xb'),_0x14be28,_0x1411('0xc'));logger['debug']('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x14be28,_0x1411('0xc'),JSON[_0x1411('0xd')](_0x4e80b6));if(_0x4e80b6[_0x1411('0xe')]){if(_0x4e80b6[_0x1411('0xe')][_0x1411('0xf')]===0x1f4){logger[_0x1411('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x14be28,_0x4e80b6[_0x1411('0xe')][_0x1411('0x10')]);return _0x3b88f9(_0x4e80b6['error'][_0x1411('0x10')]);}logger[_0x1411('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x14be28,_0x4e80b6[_0x1411('0xe')][_0x1411('0x10')]);return _0x5e35d5(_0x4e80b6[_0x1411('0xe')][_0x1411('0x10')]);}else{logger[_0x1411('0xa')]('SalesforceConfiguration,\x20%s,\x20%s',_0x14be28,_0x1411('0xc'));_0x5e35d5(_0x4e80b6[_0x1411('0x11')][_0x1411('0x10')]);}})['catch'](function(_0x424b09){logger[_0x1411('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x14be28,_0x424b09);_0x3b88f9(_0x424b09);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index e80f85a..2601842 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 _0x07bf=['express','fs-extra','../../components/auth/service','../../config/environment','./intSalesforceField.controller','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0x07bf,0xe0));var _0xf07b=function(_0x1557d5,_0x4ae2db){_0x1557d5=_0x1557d5-0x0;var _0xa3c2f8=_0x07bf[_0x1557d5];return _0xa3c2f8;};'use strict';var multer=require(_0xf07b('0x0'));var util=require(_0xf07b('0x1'));var path=require(_0xf07b('0x2'));var timeout=require(_0xf07b('0x3'));var express=require(_0xf07b('0x4'));var router=express['Router']();var fs_extra=require(_0xf07b('0x5'));var auth=require(_0xf07b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf07b('0x7'));var controller=require(_0xf07b('0x8'));router['get']('/',auth[_0xf07b('0x9')](),controller[_0xf07b('0xa')]);router['get'](_0xf07b('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xf07b('0xc')]('/',auth[_0xf07b('0x9')](),controller[_0xf07b('0xd')]);router[_0xf07b('0xe')](_0xf07b('0xb'),auth['isAuthenticated'](),controller[_0xf07b('0xf')]);router[_0xf07b('0x10')](_0xf07b('0xb'),auth[_0xf07b('0x9')](),controller[_0xf07b('0x11')]);module[_0xf07b('0x12')]=router; \ No newline at end of file +var _0xc89c=['put','update','destroy','exports','multer','path','express','Router','fs-extra','index','get','/:id','post','isAuthenticated'];(function(_0xd45367,_0xfbb0ac){var _0x484e51=function(_0xbdf1fb){while(--_0xbdf1fb){_0xd45367['push'](_0xd45367['shift']());}};_0x484e51(++_0xfbb0ac);}(_0xc89c,0xd6));var _0xcc89=function(_0x2c8fc0,_0x4e2011){_0x2c8fc0=_0x2c8fc0-0x0;var _0x4cd140=_0xc89c[_0x2c8fc0];return _0x4cd140;};'use strict';var multer=require(_0xcc89('0x0'));var util=require('util');var path=require(_0xcc89('0x1'));var timeout=require('connect-timeout');var express=require(_0xcc89('0x2'));var router=express[_0xcc89('0x3')]();var fs_extra=require(_0xcc89('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intSalesforceField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xcc89('0x5')]);router[_0xcc89('0x6')](_0xcc89('0x7'),auth['isAuthenticated'](),controller['show']);router[_0xcc89('0x8')]('/',auth[_0xcc89('0x9')](),controller['create']);router[_0xcc89('0xa')](_0xcc89('0x7'),auth[_0xcc89('0x9')](),controller[_0xcc89('0xb')]);router['delete'](_0xcc89('0x7'),auth[_0xcc89('0x9')](),controller[_0xcc89('0xc')]);module[_0xcc89('0xd')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 82b1c06..b15372e 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 _0x81c7=['variable','STRING','customVariable','sequelize','exports','ENUM','string'];(function(_0x54d54c,_0x5bca8d){var _0x14de9f=function(_0x1736e1){while(--_0x1736e1){_0x54d54c['push'](_0x54d54c['shift']());}};_0x14de9f(++_0x5bca8d);}(_0x81c7,0x1ed));var _0x781c=function(_0xa1fd2a,_0xe0ca01){_0xa1fd2a=_0xa1fd2a-0x0;var _0x39c6e7=_0x81c7[_0xa1fd2a];return _0x39c6e7;};'use strict';var Sequelize=require(_0x781c('0x0'));module[_0x781c('0x1')]={'type':{'type':Sequelize[_0x781c('0x2')](_0x781c('0x3'),_0x781c('0x4'),'customVariable','keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x781c('0x5')]},'key':{'type':Sequelize[_0x781c('0x5')]},'keyType':{'type':Sequelize[_0x781c('0x2')]('string',_0x781c('0x4'),_0x781c('0x6'))},'keyContent':{'type':Sequelize[_0x781c('0x5')]},'idField':{'type':Sequelize[_0x781c('0x5')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x675f=['ENUM','string','variable','customVariable','picklist','STRING','sequelize','exports'];(function(_0x175f31,_0x2410d8){var _0xd810c2=function(_0x3b54c8){while(--_0x3b54c8){_0x175f31['push'](_0x175f31['shift']());}};_0xd810c2(++_0x2410d8);}(_0x675f,0x1b6));var _0xf675=function(_0x3e6577,_0x33a147){_0x3e6577=_0x3e6577-0x0;var _0x146358=_0x675f[_0x3e6577];return _0x146358;};'use strict';var Sequelize=require(_0xf675('0x0'));module[_0xf675('0x1')]={'type':{'type':Sequelize[_0xf675('0x2')](_0xf675('0x3'),_0xf675('0x4'),_0xf675('0x5'),'keyValue',_0xf675('0x6')),'defaultValue':_0xf675('0x3')},'content':{'type':Sequelize[_0xf675('0x7')]},'key':{'type':Sequelize[_0xf675('0x7')]},'keyType':{'type':Sequelize[_0xf675('0x2')](_0xf675('0x3'),_0xf675('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xf675('0x7')]},'idField':{'type':Sequelize[_0xf675('0x7')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 6f8a0d3..e9d94bb 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 _0x217d=['keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','include','findAll','rows','show','params','rawAttributes','length','find','catch','create','body','destroy','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','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','limit','count','Content-Range','reject','save','update','then','stack','index','map','SalesforceField','key','model','name','query'];(function(_0x8e9de9,_0x1d1c58){var _0x502720=function(_0xa60d3f){while(--_0xa60d3f){_0x8e9de9['push'](_0x8e9de9['shift']());}};_0x502720(++_0x1d1c58);}(_0x217d,0x179));var _0xd217=function(_0x21ebe9,_0x49686f){_0x21ebe9=_0x21ebe9-0x0;var _0x4af893=_0x217d[_0x21ebe9];return _0x4af893;};'use strict';var emlformat=require(_0xd217('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd217('0x1'));var jsonpatch=require(_0xd217('0x2'));var rp=require(_0xd217('0x3'));var moment=require(_0xd217('0x4'));var BPromise=require(_0xd217('0x5'));var Mustache=require(_0xd217('0x6'));var util=require(_0xd217('0x7'));var path=require(_0xd217('0x8'));var sox=require(_0xd217('0x9'));var csv=require(_0xd217('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd217('0xb'));var _=require(_0xd217('0xc'));var squel=require(_0xd217('0xd'));var crypto=require(_0xd217('0xe'));var jsforce=require(_0xd217('0xf'));var deskjs=require(_0xd217('0x10'));var toCsv=require(_0xd217('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd217('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd217('0x12'));var hardwareService=require(_0xd217('0x13'));var logger=require(_0xd217('0x14'))(_0xd217('0x15'));var utils=require(_0xd217('0x16'));var config=require(_0xd217('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x116ff0,_0x5f0850){_0x5f0850=_0x5f0850||0xcc;return function(_0x249767){if(_0x249767){return _0x116ff0['sendStatus'](_0x5f0850);}return _0x116ff0[_0xd217('0x18')](_0x5f0850)[_0xd217('0x19')]();};}function respondWithResult(_0x41d9b7,_0x2b2acc){_0x2b2acc=_0x2b2acc||0xc8;return function(_0x24da00){if(_0x24da00){return _0x41d9b7[_0xd217('0x18')](_0x2b2acc)[_0xd217('0x1a')](_0x24da00);}};}function respondWithFilteredResult(_0x9a96aa,_0x3f5492){return function(_0x57bb49){if(_0x57bb49){var _0x2548ab=typeof _0x3f5492[_0xd217('0x1b')]==='undefined'&&typeof _0x3f5492[_0xd217('0x1c')]==='undefined';var _0x45021c=_0x57bb49['count'];var _0x8441e2=_0x2548ab?0x0:_0x3f5492['offset'];var _0x4ea61e=_0x2548ab?_0x57bb49[_0xd217('0x1d')]:_0x3f5492[_0xd217('0x1b')]+_0x3f5492[_0xd217('0x1c')];var _0x3b0ddf;if(_0x4ea61e>=_0x45021c){_0x4ea61e=_0x45021c;_0x3b0ddf=0xc8;}else{_0x3b0ddf=0xce;}_0x9a96aa[_0xd217('0x18')](_0x3b0ddf);return _0x9a96aa['set'](_0xd217('0x1e'),_0x8441e2+'-'+_0x4ea61e+'/'+_0x45021c)[_0xd217('0x1a')](_0x57bb49);}return null;};}function patchUpdates(_0x42b6af){return function(_0x6d9b88){try{jsonpatch['apply'](_0x6d9b88,_0x42b6af,!![]);}catch(_0x5c9058){return BPromise[_0xd217('0x1f')](_0x5c9058);}return _0x6d9b88[_0xd217('0x20')]();};}function saveUpdates(_0x35ae0c,_0x3cf9b5){return function(_0x1b5ba0){if(_0x1b5ba0){return _0x1b5ba0[_0xd217('0x21')](_0x35ae0c)[_0xd217('0x22')](function(_0x337a99){return _0x337a99;});}return null;};}function removeEntity(_0x38a0cf,_0x384266){return function(_0x1cce26){if(_0x1cce26){return _0x1cce26['destroy']()['then'](function(){_0x38a0cf[_0xd217('0x18')](0xcc)[_0xd217('0x19')]();});}};}function handleEntityNotFound(_0x245e2b,_0x27b78f){return function(_0x526922){if(!_0x526922){_0x245e2b['sendStatus'](0x194);}return _0x526922;};}function handleError(_0x3d61a9,_0x372519){_0x372519=_0x372519||0x1f4;return function(_0x451fcf){logger['error'](_0x451fcf[_0xd217('0x23')]);if(_0x451fcf['name']){delete _0x451fcf['name'];}_0x3d61a9[_0xd217('0x18')](_0x372519)['send'](_0x451fcf);};}exports[_0xd217('0x24')]=function(_0x2c8780,_0x4af480){var _0x29a1b7={},_0x312bef={},_0x51962a={'count':0x0,'rows':[]};var _0x4cb5a3=_[_0xd217('0x25')](db[_0xd217('0x26')]['rawAttributes'],function(_0xc82edc){return{'name':_0xc82edc['fieldName'],'type':_0xc82edc['type'][_0xd217('0x27')]};});_0x312bef[_0xd217('0x28')]=_[_0xd217('0x25')](_0x4cb5a3,_0xd217('0x29'));_0x312bef[_0xd217('0x2a')]=_[_0xd217('0x2b')](_0x2c8780['query']);_0x312bef[_0xd217('0x2c')]=_[_0xd217('0x2d')](_0x312bef[_0xd217('0x28')],_0x312bef[_0xd217('0x2a')]);_0x29a1b7['attributes']=_['intersection'](_0x312bef[_0xd217('0x28')],qs[_0xd217('0x2e')](_0x2c8780[_0xd217('0x2a')]['fields']));_0x29a1b7[_0xd217('0x2f')]=_0x29a1b7['attributes']['length']?_0x29a1b7[_0xd217('0x2f')]:_0x312bef['model'];if(!_0x2c8780[_0xd217('0x2a')][_0xd217('0x30')](_0xd217('0x31'))){_0x29a1b7[_0xd217('0x1c')]=qs[_0xd217('0x1c')](_0x2c8780[_0xd217('0x2a')][_0xd217('0x1c')]);_0x29a1b7[_0xd217('0x1b')]=qs[_0xd217('0x1b')](_0x2c8780[_0xd217('0x2a')]['offset']);}_0x29a1b7[_0xd217('0x32')]=qs[_0xd217('0x33')](_0x2c8780[_0xd217('0x2a')][_0xd217('0x33')]);_0x29a1b7[_0xd217('0x34')]=qs['filters'](_[_0xd217('0x35')](_0x2c8780[_0xd217('0x2a')],_0x312bef[_0xd217('0x2c')]),_0x4cb5a3);if(_0x2c8780[_0xd217('0x2a')][_0xd217('0x36')]){_0x29a1b7[_0xd217('0x34')]=_[_0xd217('0x37')](_0x29a1b7[_0xd217('0x34')],{'$or':_['map'](_0x4cb5a3,function(_0x5649f1){if(_0x5649f1[_0xd217('0x38')]!==_0xd217('0x39')){var _0x19d5f6={};_0x19d5f6[_0x5649f1['name']]={'$like':'%'+_0x2c8780[_0xd217('0x2a')][_0xd217('0x36')]+'%'};return _0x19d5f6;}})});}_0x29a1b7=_['merge']({},_0x29a1b7,_0x2c8780['options']);var _0xb6f52b={'where':_0x29a1b7[_0xd217('0x34')]};return db[_0xd217('0x26')][_0xd217('0x1d')](_0xb6f52b)[_0xd217('0x22')](function(_0x3cc391){_0x51962a[_0xd217('0x1d')]=_0x3cc391;if(_0x2c8780[_0xd217('0x2a')]['includeAll']){_0x29a1b7[_0xd217('0x3a')]=[{'all':!![]}];}return db[_0xd217('0x26')][_0xd217('0x3b')](_0x29a1b7);})['then'](function(_0x5c5e3f){_0x51962a[_0xd217('0x3c')]=_0x5c5e3f;return _0x51962a;})[_0xd217('0x22')](respondWithFilteredResult(_0x4af480,_0x29a1b7))['catch'](handleError(_0x4af480,null));};exports[_0xd217('0x3d')]=function(_0x8c179f,_0x312261){var _0x31179a={'raw':!![],'where':{'id':_0x8c179f[_0xd217('0x3e')]['id']}},_0x3f6a23={};_0x3f6a23['model']=_[_0xd217('0x2b')](db['SalesforceField'][_0xd217('0x3f')]);_0x3f6a23[_0xd217('0x2a')]=_[_0xd217('0x2b')](_0x8c179f[_0xd217('0x2a')]);_0x3f6a23[_0xd217('0x2c')]=_['intersection'](_0x3f6a23[_0xd217('0x28')],_0x3f6a23[_0xd217('0x2a')]);_0x31179a[_0xd217('0x2f')]=_[_0xd217('0x2d')](_0x3f6a23['model'],qs['fields'](_0x8c179f[_0xd217('0x2a')][_0xd217('0x2e')]));_0x31179a[_0xd217('0x2f')]=_0x31179a[_0xd217('0x2f')][_0xd217('0x40')]?_0x31179a[_0xd217('0x2f')]:_0x3f6a23[_0xd217('0x28')];if(_0x8c179f['query']['includeAll']){_0x31179a[_0xd217('0x3a')]=[{'all':!![]}];}_0x31179a=_[_0xd217('0x37')]({},_0x31179a,_0x8c179f['options']);return db[_0xd217('0x26')][_0xd217('0x41')](_0x31179a)[_0xd217('0x22')](handleEntityNotFound(_0x312261,null))[_0xd217('0x22')](respondWithResult(_0x312261,null))[_0xd217('0x42')](handleError(_0x312261,null));};exports[_0xd217('0x43')]=function(_0x4cbaf2,_0xef42a1){return db[_0xd217('0x26')]['create'](_0x4cbaf2['body'],{})[_0xd217('0x22')](respondWithResult(_0xef42a1,0xc9))[_0xd217('0x42')](handleError(_0xef42a1,null));};exports['update']=function(_0x571edd,_0x4f4570){if(_0x571edd['body']['id']){delete _0x571edd[_0xd217('0x44')]['id'];}return db[_0xd217('0x26')]['find']({'where':{'id':_0x571edd['params']['id']}})[_0xd217('0x22')](handleEntityNotFound(_0x4f4570,null))['then'](saveUpdates(_0x571edd[_0xd217('0x44')],null))[_0xd217('0x22')](respondWithResult(_0x4f4570,null))[_0xd217('0x42')](handleError(_0x4f4570,null));};exports[_0xd217('0x45')]=function(_0x50ce53,_0x124d71){return db['SalesforceField'][_0xd217('0x41')]({'where':{'id':_0x50ce53['params']['id']}})[_0xd217('0x22')](handleEntityNotFound(_0x124d71,null))['then'](removeEntity(_0x124d71,null))['catch'](handleError(_0x124d71,null));}; \ No newline at end of file +var _0x4e1d=['name','send','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','filter','SalesforceField','findAll','rows','catch','show','params','includeAll','include','options','create','update','body','find','rimraf','moment','bluebird','mustache','util','path','sox','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','then','destroy','end','error','stack'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4e1d,0x1c6));var _0xd4e1=function(_0x12b1b7,_0x27b852){_0x12b1b7=_0x12b1b7-0x0;var _0xac0bfb=_0x4e1d[_0x12b1b7];return _0xac0bfb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd4e1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd4e1('0x1'));var BPromise=require(_0xd4e1('0x2'));var Mustache=require(_0xd4e1('0x3'));var util=require(_0xd4e1('0x4'));var path=require(_0xd4e1('0x5'));var sox=require(_0xd4e1('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd4e1('0x7'));var squel=require(_0xd4e1('0x8'));var crypto=require('crypto');var jsforce=require(_0xd4e1('0x9'));var deskjs=require(_0xd4e1('0xa'));var toCsv=require(_0xd4e1('0xb'));var querystring=require('querystring');var Papa=require(_0xd4e1('0xc'));var Redis=require(_0xd4e1('0xd'));var authService=require(_0xd4e1('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xd4e1('0xf'));var hardwareService=require(_0xd4e1('0x10'));var logger=require(_0xd4e1('0x11'))('api');var utils=require(_0xd4e1('0x12'));var config=require(_0xd4e1('0x13'));var licenseUtil=require(_0xd4e1('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x476f37,_0x18c5f){_0x18c5f=_0x18c5f||0xcc;return function(_0x8956c5){if(_0x8956c5){return _0x476f37[_0xd4e1('0x15')](_0x18c5f);}return _0x476f37[_0xd4e1('0x16')](_0x18c5f)['end']();};}function respondWithResult(_0x32340e,_0x178580){_0x178580=_0x178580||0xc8;return function(_0x5bcc18){if(_0x5bcc18){return _0x32340e[_0xd4e1('0x16')](_0x178580)[_0xd4e1('0x17')](_0x5bcc18);}};}function respondWithFilteredResult(_0x4abc13,_0x182444){return function(_0x4a8fbd){if(_0x4a8fbd){var _0x328455=typeof _0x182444[_0xd4e1('0x18')]===_0xd4e1('0x19')&&typeof _0x182444[_0xd4e1('0x1a')]==='undefined';var _0x4fdda7=_0x4a8fbd['count'];var _0x26dc50=_0x328455?0x0:_0x182444[_0xd4e1('0x18')];var _0x538e5b=_0x328455?_0x4a8fbd[_0xd4e1('0x1b')]:_0x182444[_0xd4e1('0x18')]+_0x182444[_0xd4e1('0x1a')];var _0x3680af;if(_0x538e5b>=_0x4fdda7){_0x538e5b=_0x4fdda7;_0x3680af=0xc8;}else{_0x3680af=0xce;}_0x4abc13[_0xd4e1('0x16')](_0x3680af);return _0x4abc13[_0xd4e1('0x1c')]('Content-Range',_0x26dc50+'-'+_0x538e5b+'/'+_0x4fdda7)['json'](_0x4a8fbd);}return null;};}function patchUpdates(_0x490d0c){return function(_0x23b890){try{jsonpatch[_0xd4e1('0x1d')](_0x23b890,_0x490d0c,!![]);}catch(_0x3aab){return BPromise['reject'](_0x3aab);}return _0x23b890[_0xd4e1('0x1e')]();};}function saveUpdates(_0x41b8bd,_0x1bb36b){return function(_0x3eeac5){if(_0x3eeac5){return _0x3eeac5['update'](_0x41b8bd)[_0xd4e1('0x1f')](function(_0x226d2d){return _0x226d2d;});}return null;};}function removeEntity(_0x2251f9,_0xd3204){return function(_0x52f4f2){if(_0x52f4f2){return _0x52f4f2[_0xd4e1('0x20')]()[_0xd4e1('0x1f')](function(){_0x2251f9[_0xd4e1('0x16')](0xcc)[_0xd4e1('0x21')]();});}};}function handleEntityNotFound(_0x4ada48,_0x33dcb2){return function(_0x1a836d){if(!_0x1a836d){_0x4ada48[_0xd4e1('0x15')](0x194);}return _0x1a836d;};}function handleError(_0x1c6b96,_0x2b8a6e){_0x2b8a6e=_0x2b8a6e||0x1f4;return function(_0x18e5b3){logger[_0xd4e1('0x22')](_0x18e5b3[_0xd4e1('0x23')]);if(_0x18e5b3['name']){delete _0x18e5b3[_0xd4e1('0x24')];}_0x1c6b96[_0xd4e1('0x16')](_0x2b8a6e)[_0xd4e1('0x25')](_0x18e5b3);};}exports['index']=function(_0xd64430,_0x1bed52){var _0x9d4e96={},_0x1bd87a={},_0x271996={'count':0x0,'rows':[]};var _0x3b67b9=_['map'](db['SalesforceField'][_0xd4e1('0x26')],function(_0x534bd3){return{'name':_0x534bd3[_0xd4e1('0x27')],'type':_0x534bd3[_0xd4e1('0x28')]['key']};});_0x1bd87a[_0xd4e1('0x29')]=_[_0xd4e1('0x2a')](_0x3b67b9,_0xd4e1('0x24'));_0x1bd87a[_0xd4e1('0x2b')]=_[_0xd4e1('0x2c')](_0xd64430['query']);_0x1bd87a['filters']=_[_0xd4e1('0x2d')](_0x1bd87a['model'],_0x1bd87a[_0xd4e1('0x2b')]);_0x9d4e96[_0xd4e1('0x2e')]=_['intersection'](_0x1bd87a[_0xd4e1('0x29')],qs[_0xd4e1('0x2f')](_0xd64430[_0xd4e1('0x2b')][_0xd4e1('0x2f')]));_0x9d4e96[_0xd4e1('0x2e')]=_0x9d4e96[_0xd4e1('0x2e')][_0xd4e1('0x30')]?_0x9d4e96[_0xd4e1('0x2e')]:_0x1bd87a[_0xd4e1('0x29')];if(!_0xd64430[_0xd4e1('0x2b')][_0xd4e1('0x31')](_0xd4e1('0x32'))){_0x9d4e96[_0xd4e1('0x1a')]=qs[_0xd4e1('0x1a')](_0xd64430[_0xd4e1('0x2b')][_0xd4e1('0x1a')]);_0x9d4e96[_0xd4e1('0x18')]=qs[_0xd4e1('0x18')](_0xd64430[_0xd4e1('0x2b')][_0xd4e1('0x18')]);}_0x9d4e96['order']=qs[_0xd4e1('0x33')](_0xd64430['query'][_0xd4e1('0x33')]);_0x9d4e96[_0xd4e1('0x34')]=qs[_0xd4e1('0x35')](_[_0xd4e1('0x36')](_0xd64430[_0xd4e1('0x2b')],_0x1bd87a[_0xd4e1('0x35')]),_0x3b67b9);if(_0xd64430[_0xd4e1('0x2b')]['filter']){_0x9d4e96[_0xd4e1('0x34')]=_[_0xd4e1('0x37')](_0x9d4e96[_0xd4e1('0x34')],{'$or':_['map'](_0x3b67b9,function(_0x30b392){if(_0x30b392[_0xd4e1('0x28')]!=='VIRTUAL'){var _0x3cdb2d={};_0x3cdb2d[_0x30b392[_0xd4e1('0x24')]]={'$like':'%'+_0xd64430[_0xd4e1('0x2b')][_0xd4e1('0x38')]+'%'};return _0x3cdb2d;}})});}_0x9d4e96=_[_0xd4e1('0x37')]({},_0x9d4e96,_0xd64430['options']);var _0x323e4c={'where':_0x9d4e96[_0xd4e1('0x34')]};return db[_0xd4e1('0x39')]['count'](_0x323e4c)[_0xd4e1('0x1f')](function(_0xb9a4ff){_0x271996[_0xd4e1('0x1b')]=_0xb9a4ff;if(_0xd64430[_0xd4e1('0x2b')]['includeAll']){_0x9d4e96['include']=[{'all':!![]}];}return db[_0xd4e1('0x39')][_0xd4e1('0x3a')](_0x9d4e96);})['then'](function(_0x403501){_0x271996[_0xd4e1('0x3b')]=_0x403501;return _0x271996;})[_0xd4e1('0x1f')](respondWithFilteredResult(_0x1bed52,_0x9d4e96))[_0xd4e1('0x3c')](handleError(_0x1bed52,null));};exports[_0xd4e1('0x3d')]=function(_0x105431,_0x5ac4aa){var _0x446aaa={'raw':!![],'where':{'id':_0x105431[_0xd4e1('0x3e')]['id']}},_0x43354a={};_0x43354a['model']=_[_0xd4e1('0x2c')](db[_0xd4e1('0x39')][_0xd4e1('0x26')]);_0x43354a[_0xd4e1('0x2b')]=_[_0xd4e1('0x2c')](_0x105431[_0xd4e1('0x2b')]);_0x43354a['filters']=_[_0xd4e1('0x2d')](_0x43354a[_0xd4e1('0x29')],_0x43354a[_0xd4e1('0x2b')]);_0x446aaa[_0xd4e1('0x2e')]=_[_0xd4e1('0x2d')](_0x43354a[_0xd4e1('0x29')],qs[_0xd4e1('0x2f')](_0x105431[_0xd4e1('0x2b')][_0xd4e1('0x2f')]));_0x446aaa[_0xd4e1('0x2e')]=_0x446aaa['attributes'][_0xd4e1('0x30')]?_0x446aaa[_0xd4e1('0x2e')]:_0x43354a[_0xd4e1('0x29')];if(_0x105431['query'][_0xd4e1('0x3f')]){_0x446aaa[_0xd4e1('0x40')]=[{'all':!![]}];}_0x446aaa=_['merge']({},_0x446aaa,_0x105431[_0xd4e1('0x41')]);return db[_0xd4e1('0x39')]['find'](_0x446aaa)['then'](handleEntityNotFound(_0x5ac4aa,null))[_0xd4e1('0x1f')](respondWithResult(_0x5ac4aa,null))[_0xd4e1('0x3c')](handleError(_0x5ac4aa,null));};exports[_0xd4e1('0x42')]=function(_0x332b7,_0x5cdb62){return db[_0xd4e1('0x39')]['create'](_0x332b7['body'],{})[_0xd4e1('0x1f')](respondWithResult(_0x5cdb62,0xc9))[_0xd4e1('0x3c')](handleError(_0x5cdb62,null));};exports[_0xd4e1('0x43')]=function(_0x309ff9,_0x258915){if(_0x309ff9[_0xd4e1('0x44')]['id']){delete _0x309ff9[_0xd4e1('0x44')]['id'];}return db[_0xd4e1('0x39')]['find']({'where':{'id':_0x309ff9[_0xd4e1('0x3e')]['id']}})[_0xd4e1('0x1f')](handleEntityNotFound(_0x258915,null))[_0xd4e1('0x1f')](saveUpdates(_0x309ff9[_0xd4e1('0x44')],null))[_0xd4e1('0x1f')](respondWithResult(_0x258915,null))['catch'](handleError(_0x258915,null));};exports['destroy']=function(_0x5499ec,_0x2d470f){return db['SalesforceField'][_0xd4e1('0x45')]({'where':{'id':_0x5499ec['params']['id']}})[_0xd4e1('0x1f')](handleEntityNotFound(_0x2d470f,null))[_0xd4e1('0x1f')](removeEntity(_0x2d470f,null))[_0xd4e1('0x3c')](handleError(_0x2d470f,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 1364fe3..2469eb7 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 _0x4ef7=['./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x5cd2ab,_0x2d162b){var _0x4663db=function(_0x54a66d){while(--_0x54a66d){_0x5cd2ab['push'](_0x5cd2ab['shift']());}};_0x4663db(++_0x2d162b);}(_0x4ef7,0x198));var _0x74ef=function(_0x5ccc13,_0x5d7a5c){_0x5ccc13=_0x5ccc13-0x0;var _0xf888c6=_0x4ef7[_0x5ccc13];return _0xf888c6;};'use strict';var _=require(_0x74ef('0x0'));var util=require(_0x74ef('0x1'));var logger=require(_0x74ef('0x2'))('api');var moment=require(_0x74ef('0x3'));var BPromise=require(_0x74ef('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x74ef('0x5'));var rimraf=require(_0x74ef('0x6'));var config=require(_0x74ef('0x7'));var attributes=require(_0x74ef('0x8'));module[_0x74ef('0x9')]=function(_0x406c2f,_0x2fa67a){return _0x406c2f[_0x74ef('0xa')](_0x74ef('0xb'),attributes,{'tableName':_0x74ef('0xc'),'paranoid':![],'indexes':[{'name':_0x74ef('0xd'),'fields':[_0x74ef('0xe'),_0x74ef('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf109=['rimraf','../../config/environment','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise'];(function(_0xbc284b,_0x532dfe){var _0x4dca6a=function(_0x300fe5){while(--_0x300fe5){_0xbc284b['push'](_0xbc284b['shift']());}};_0x4dca6a(++_0x532dfe);}(_0xf109,0xf9));var _0x9f10=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0xf109[_0x35885a];return _0xe86249;};'use strict';var _=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var logger=require('../../config/logger')(_0x9f10('0x2'));var moment=require(_0x9f10('0x3'));var BPromise=require(_0x9f10('0x4'));var rp=require(_0x9f10('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9f10('0x6'));var config=require(_0x9f10('0x7'));var attributes=require('./intSalesforceField.attributes');module[_0x9f10('0x8')]=function(_0x4f8539,_0x23a365){return _0x4f8539[_0x9f10('0x9')](_0x9f10('0xa'),attributes,{'tableName':_0x9f10('0xb'),'paranoid':![],'indexes':[{'name':_0x9f10('0xc'),'fields':[_0x9f10('0xd'),_0x9f10('0xe')],'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 de6792a..ab44843 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 _0xa036=['then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x21dedc,_0x1468f6){var _0x3968bc=function(_0x5434e4){while(--_0x5434e4){_0x21dedc['push'](_0x21dedc['shift']());}};_0x3968bc(++_0x1468f6);}(_0xa036,0xa5));var _0x6a03=function(_0x5e3c35,_0x9a1910){_0x5e3c35=_0x5e3c35-0x0;var _0x29a597=_0xa036[_0x5e3c35];return _0x29a597;};'use strict';var _=require(_0x6a03('0x0'));var util=require(_0x6a03('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6a03('0x2'));var fs=require('fs');var Redis=require(_0x6a03('0x3'));var db=require(_0x6a03('0x4'))['db'];var utils=require(_0x6a03('0x5'));var logger=require(_0x6a03('0x6'))(_0x6a03('0x7'));var config=require('../../config/environment');var jayson=require(_0x6a03('0x8'));var client=jayson[_0x6a03('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24b2e5,_0x338874,_0xf0706f){return new BPromise(function(_0x4b937e,_0x555ca0){return client[_0x6a03('0xa')](_0x24b2e5,_0xf0706f)[_0x6a03('0xb')](function(_0x1093e7){logger[_0x6a03('0xc')](_0x6a03('0xd'),_0x338874,_0x6a03('0xe'));logger[_0x6a03('0xf')](_0x6a03('0x10'),_0x338874,'request\x20sent',JSON['stringify'](_0x1093e7));if(_0x1093e7[_0x6a03('0x11')]){if(_0x1093e7[_0x6a03('0x11')][_0x6a03('0x12')]===0x1f4){logger[_0x6a03('0x11')](_0x6a03('0xd'),_0x338874,_0x1093e7[_0x6a03('0x11')][_0x6a03('0x13')]);return _0x555ca0(_0x1093e7[_0x6a03('0x11')]['message']);}logger[_0x6a03('0x11')](_0x6a03('0xd'),_0x338874,_0x1093e7[_0x6a03('0x11')][_0x6a03('0x13')]);return _0x4b937e(_0x1093e7[_0x6a03('0x11')][_0x6a03('0x13')]);}else{logger[_0x6a03('0xc')](_0x6a03('0xd'),_0x338874,_0x6a03('0xe'));_0x4b937e(_0x1093e7[_0x6a03('0x14')][_0x6a03('0x13')]);}})[_0x6a03('0x15')](function(_0x37d134){logger[_0x6a03('0x11')]('SalesforceField,\x20%s,\x20%s',_0x338874,_0x37d134);_0x555ca0(_0x37d134);});});} \ No newline at end of file +var _0x42b1=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x357dfe,_0x67923e){var _0x227a62=function(_0x106efb){while(--_0x106efb){_0x357dfe['push'](_0x357dfe['shift']());}};_0x227a62(++_0x67923e);}(_0x42b1,0xa2));var _0x142b=function(_0x596791,_0x36c285){_0x596791=_0x596791-0x0;var _0x3f4bb8=_0x42b1[_0x596791];return _0x3f4bb8;};'use strict';var _=require(_0x142b('0x0'));var util=require('util');var moment=require(_0x142b('0x1'));var BPromise=require(_0x142b('0x2'));var rs=require(_0x142b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x142b('0x4'))['db'];var utils=require(_0x142b('0x5'));var logger=require(_0x142b('0x6'))(_0x142b('0x7'));var config=require(_0x142b('0x8'));var jayson=require(_0x142b('0x9'));var client=jayson[_0x142b('0xa')][_0x142b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c5147,_0xd4643,_0x328955){return new BPromise(function(_0x1dc5ef,_0x414fab){return client[_0x142b('0xc')](_0x3c5147,_0x328955)[_0x142b('0xd')](function(_0x480f8d){logger['info'](_0x142b('0xe'),_0xd4643,_0x142b('0xf'));logger[_0x142b('0x10')](_0x142b('0x11'),_0xd4643,_0x142b('0xf'),JSON[_0x142b('0x12')](_0x480f8d));if(_0x480f8d[_0x142b('0x13')]){if(_0x480f8d[_0x142b('0x13')]['code']===0x1f4){logger[_0x142b('0x13')]('SalesforceField,\x20%s,\x20%s',_0xd4643,_0x480f8d[_0x142b('0x13')][_0x142b('0x14')]);return _0x414fab(_0x480f8d[_0x142b('0x13')][_0x142b('0x14')]);}logger['error'](_0x142b('0xe'),_0xd4643,_0x480f8d[_0x142b('0x13')]['message']);return _0x1dc5ef(_0x480f8d[_0x142b('0x13')]['message']);}else{logger[_0x142b('0x15')](_0x142b('0xe'),_0xd4643,_0x142b('0xf'));_0x1dc5ef(_0x480f8d[_0x142b('0x16')]['message']);}})[_0x142b('0x17')](function(_0xeff8f7){logger[_0x142b('0x13')]('SalesforceField,\x20%s,\x20%s',_0xd4643,_0xeff8f7);_0x414fab(_0xeff8f7);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index cbcd6a8..0e95649 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 _0xc29b=['exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete'];(function(_0x4b1032,_0x36952e){var _0x5a1d55=function(_0x282e9b){while(--_0x282e9b){_0x4b1032['push'](_0x4b1032['shift']());}};_0x5a1d55(++_0x36952e);}(_0xc29b,0x12d));var _0xbc29=function(_0x18cafb,_0x59456a){_0x18cafb=_0x18cafb-0x0;var _0x50369c=_0xc29b[_0x18cafb];return _0x50369c;};'use strict';var multer=require(_0xbc29('0x0'));var util=require(_0xbc29('0x1'));var path=require(_0xbc29('0x2'));var timeout=require('connect-timeout');var express=require(_0xbc29('0x3'));var router=express[_0xbc29('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbc29('0x5'));var interaction=require(_0xbc29('0x6'));var config=require(_0xbc29('0x7'));var controller=require(_0xbc29('0x8'));router[_0xbc29('0x9')]('/',auth[_0xbc29('0xa')](),controller[_0xbc29('0xb')]);router[_0xbc29('0x9')](_0xbc29('0xc'),auth[_0xbc29('0xa')](),controller[_0xbc29('0xd')]);router[_0xbc29('0x9')](_0xbc29('0xe'),auth[_0xbc29('0xa')](),controller[_0xbc29('0xf')]);router[_0xbc29('0x9')](_0xbc29('0x10'),auth[_0xbc29('0xa')](),controller[_0xbc29('0x11')]);router[_0xbc29('0x12')]('/',auth['isAuthenticated'](),controller[_0xbc29('0x13')]);router[_0xbc29('0x12')](_0xbc29('0xe'),auth[_0xbc29('0xa')](),controller[_0xbc29('0x14')]);router[_0xbc29('0x15')](_0xbc29('0xc'),auth['isAuthenticated'](),controller[_0xbc29('0x16')]);router[_0xbc29('0x17')](_0xbc29('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xbc29('0x18')]=router; \ No newline at end of file +var _0x9715=['index','/:id','show','/:id/configurations','/:id/fields','getFields','post','isAuthenticated','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get'];(function(_0x3a86e1,_0xabf7e3){var _0x562367=function(_0xb993d8){while(--_0xb993d8){_0x3a86e1['push'](_0x3a86e1['shift']());}};_0x562367(++_0xabf7e3);}(_0x9715,0x15f));var _0x5971=function(_0x3c1f0c,_0x46282f){_0x3c1f0c=_0x3c1f0c-0x0;var _0x439f8d=_0x9715[_0x3c1f0c];return _0x439f8d;};'use strict';var multer=require(_0x5971('0x0'));var util=require(_0x5971('0x1'));var path=require(_0x5971('0x2'));var timeout=require(_0x5971('0x3'));var express=require(_0x5971('0x4'));var router=express[_0x5971('0x5')]();var fs_extra=require(_0x5971('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5971('0x7'));var controller=require('./intServicenowAccount.controller');router[_0x5971('0x8')]('/',auth['isAuthenticated'](),controller[_0x5971('0x9')]);router['get'](_0x5971('0xa'),auth['isAuthenticated'](),controller[_0x5971('0xb')]);router[_0x5971('0x8')](_0x5971('0xc'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x5971('0x8')](_0x5971('0xd'),auth['isAuthenticated'](),controller[_0x5971('0xe')]);router[_0x5971('0xf')]('/',auth[_0x5971('0x10')](),controller['create']);router[_0x5971('0xf')](_0x5971('0xc'),auth['isAuthenticated'](),controller['addConfiguration']);router['put']('/:id',auth[_0x5971('0x10')](),controller[_0x5971('0x11')]);router[_0x5971('0x12')](_0x5971('0xa'),auth[_0x5971('0x10')](),controller['destroy']);module[_0x5971('0x13')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index bfe5103..dd87639 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 _0x6e3b=['remoteUri','sequelize','STRING','username'];(function(_0xf144e3,_0x4563a0){var _0x5d8b1d=function(_0x1d2218){while(--_0x1d2218){_0xf144e3['push'](_0xf144e3['shift']());}};_0x5d8b1d(++_0x4563a0);}(_0x6e3b,0xe1));var _0xb6e3=function(_0x45e6ac,_0xe34840){_0x45e6ac=_0x45e6ac-0x0;var _0x4fba8d=_0x6e3b[_0x45e6ac];return _0x4fba8d;};'use strict';var Sequelize=require(_0xb6e3('0x0'));module['exports']={'name':{'type':Sequelize[_0xb6e3('0x1')]},'description':{'type':Sequelize[_0xb6e3('0x1')]},'username':{'type':Sequelize[_0xb6e3('0x1')],'unique':_0xb6e3('0x2')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xb6e3('0x1')]},'remoteUri':{'type':Sequelize[_0xb6e3('0x1')],'unique':_0xb6e3('0x3')},'serverUrl':{'type':Sequelize[_0xb6e3('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xefbc=['exports','STRING'];(function(_0x26b8b5,_0xf5c2c1){var _0x2150a9=function(_0x1ca1be){while(--_0x1ca1be){_0x26b8b5['push'](_0x26b8b5['shift']());}};_0x2150a9(++_0xf5c2c1);}(_0xefbc,0x182));var _0xcefb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xefbc[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xcefb('0x0')]={'name':{'type':Sequelize[_0xcefb('0x1')]},'description':{'type':Sequelize[_0xcefb('0x1')]},'username':{'type':Sequelize[_0xcefb('0x1')],'unique':'username'},'password':{'type':Sequelize[_0xcefb('0x1')]},'email':{'type':Sequelize[_0xcefb('0x1')]},'remoteUri':{'type':Sequelize[_0xcefb('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xcefb('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index e7219f2..67f249e 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 _0xb1d5=['findOne','ServicenowConfiguration','pick','filter','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','close_code','notify','incident_state','category','parent','caused_by','watch_list','upon_reject','child_incidents','approval_history','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','time_worked','expected_start','opened_at','business_duration','group_list','work_end','resolved_at','caller_id','work_notes','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','reopened_by','problem_id','company','reassignment_count','severity','sla_due','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','location','username','remoteUri','slice','substring','%s/api/now/doc/table/schema/','format','%s/api/now/table/','password','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','includes','forEach','internalType','label','push','all','assign','remove','concat','ServiceNow\x20error:\x20','statusCode','test','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','then','destroy','stack','name','send','rawAttributes','fieldName','type','model','map','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','options','ServicenowAccount','include','findAll','catch','show','includeAll','find','create','update','body','params','getConfigurations'];(function(_0x3d2438,_0x2e7922){var _0xd18de5=function(_0xe8a130){while(--_0xe8a130){_0x3d2438['push'](_0x3d2438['shift']());}};_0xd18de5(++_0x2e7922);}(_0xb1d5,0x127));var _0x5b1d=function(_0x4c8fec,_0x2fbf97){_0x4c8fec=_0x4c8fec-0x0;var _0x32ba89=_0xb1d5[_0x4c8fec];return _0x32ba89;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5b1d('0x0'));var zipdir=require(_0x5b1d('0x1'));var jsonpatch=require(_0x5b1d('0x2'));var rp=require(_0x5b1d('0x3'));var moment=require(_0x5b1d('0x4'));var BPromise=require(_0x5b1d('0x5'));var Mustache=require(_0x5b1d('0x6'));var util=require(_0x5b1d('0x7'));var path=require('path');var sox=require(_0x5b1d('0x8'));var csv=require(_0x5b1d('0x9'));var ejs=require(_0x5b1d('0xa'));var fs=require('fs');var fs_extra=require(_0x5b1d('0xb'));var _=require(_0x5b1d('0xc'));var squel=require(_0x5b1d('0xd'));var crypto=require(_0x5b1d('0xe'));var jsforce=require(_0x5b1d('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x5b1d('0x9'));var querystring=require(_0x5b1d('0x10'));var Papa=require(_0x5b1d('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5b1d('0x12'));var as=require(_0x5b1d('0x13'));var hardwareService=require(_0x5b1d('0x14'));var logger=require(_0x5b1d('0x15'))('api');var utils=require(_0x5b1d('0x16'));var config=require(_0x5b1d('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5b1d('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3e3dfc,_0x449eb9){_0x449eb9=_0x449eb9||0xcc;return function(_0x53008e){if(_0x53008e){return _0x3e3dfc[_0x5b1d('0x19')](_0x449eb9);}return _0x3e3dfc[_0x5b1d('0x1a')](_0x449eb9)[_0x5b1d('0x1b')]();};}function respondWithResult(_0x46448d,_0xca1808){_0xca1808=_0xca1808||0xc8;return function(_0x3b1972){if(_0x3b1972){return _0x46448d[_0x5b1d('0x1a')](_0xca1808)[_0x5b1d('0x1c')](_0x3b1972);}};}function respondWithFilteredResult(_0x1f31c0,_0x2a5884){return function(_0xe38482){if(_0xe38482){var _0x5bc642=typeof _0x2a5884['offset']===_0x5b1d('0x1d')&&typeof _0x2a5884[_0x5b1d('0x1e')]===_0x5b1d('0x1d');var _0x267cc1=_0xe38482[_0x5b1d('0x1f')];var _0x3da02d=_0x5bc642?0x0:_0x2a5884[_0x5b1d('0x20')];var _0x26d477=_0x5bc642?_0xe38482[_0x5b1d('0x1f')]:_0x2a5884['offset']+_0x2a5884[_0x5b1d('0x1e')];var _0x1128a2;if(_0x26d477>=_0x267cc1){_0x26d477=_0x267cc1;_0x1128a2=0xc8;}else{_0x1128a2=0xce;}_0x1f31c0[_0x5b1d('0x1a')](_0x1128a2);return _0x1f31c0[_0x5b1d('0x21')]('Content-Range',_0x3da02d+'-'+_0x26d477+'/'+_0x267cc1)[_0x5b1d('0x1c')](_0xe38482);}return null;};}function patchUpdates(_0x26013e){return function(_0x7bf2c8){try{jsonpatch[_0x5b1d('0x22')](_0x7bf2c8,_0x26013e,!![]);}catch(_0x1a0cc4){return BPromise[_0x5b1d('0x23')](_0x1a0cc4);}return _0x7bf2c8['save']();};}function saveUpdates(_0x1c3ae3,_0x4f85d7){return function(_0x18b477){if(_0x18b477){return _0x18b477['update'](_0x1c3ae3)[_0x5b1d('0x24')](function(_0x1e49c1){return _0x1e49c1;});}return null;};}function removeEntity(_0x12bd53,_0x154d94){return function(_0x4b4035){if(_0x4b4035){return _0x4b4035[_0x5b1d('0x25')]()['then'](function(){_0x12bd53[_0x5b1d('0x1a')](0xcc)[_0x5b1d('0x1b')]();});}};}function handleEntityNotFound(_0x5f66aa,_0x164f45){return function(_0x125f3a){if(!_0x125f3a){_0x5f66aa[_0x5b1d('0x19')](0x194);}return _0x125f3a;};}function handleError(_0x5f0a0c,_0x53783){_0x53783=_0x53783||0x1f4;return function(_0x213036){logger['error'](_0x213036[_0x5b1d('0x26')]);if(_0x213036[_0x5b1d('0x27')]){delete _0x213036[_0x5b1d('0x27')];}_0x5f0a0c['status'](_0x53783)[_0x5b1d('0x28')](_0x213036);};}exports['index']=function(_0x549b14,_0x4e27ff){var _0x57d1bb={},_0x1d0d42={},_0x383035={'count':0x0,'rows':[]};var _0x2332ef=_['map'](db['ServicenowAccount'][_0x5b1d('0x29')],function(_0x57e158){return{'name':_0x57e158[_0x5b1d('0x2a')],'type':_0x57e158[_0x5b1d('0x2b')]['key']};});_0x1d0d42[_0x5b1d('0x2c')]=_[_0x5b1d('0x2d')](_0x2332ef,'name');_0x1d0d42['query']=_[_0x5b1d('0x2e')](_0x549b14[_0x5b1d('0x2f')]);_0x1d0d42['filters']=_['intersection'](_0x1d0d42[_0x5b1d('0x2c')],_0x1d0d42[_0x5b1d('0x2f')]);_0x57d1bb[_0x5b1d('0x30')]=_[_0x5b1d('0x31')](_0x1d0d42[_0x5b1d('0x2c')],qs[_0x5b1d('0x32')](_0x549b14[_0x5b1d('0x2f')][_0x5b1d('0x32')]));_0x57d1bb['attributes']=_0x57d1bb['attributes'][_0x5b1d('0x33')]?_0x57d1bb[_0x5b1d('0x30')]:_0x1d0d42[_0x5b1d('0x2c')];if(!_0x549b14[_0x5b1d('0x2f')][_0x5b1d('0x34')](_0x5b1d('0x35'))){_0x57d1bb[_0x5b1d('0x1e')]=qs['limit'](_0x549b14[_0x5b1d('0x2f')][_0x5b1d('0x1e')]);_0x57d1bb[_0x5b1d('0x20')]=qs[_0x5b1d('0x20')](_0x549b14[_0x5b1d('0x2f')][_0x5b1d('0x20')]);}_0x57d1bb[_0x5b1d('0x36')]=qs[_0x5b1d('0x37')](_0x549b14[_0x5b1d('0x2f')][_0x5b1d('0x37')]);_0x57d1bb[_0x5b1d('0x38')]=qs['filters'](_['pick'](_0x549b14[_0x5b1d('0x2f')],_0x1d0d42[_0x5b1d('0x39')]),_0x2332ef);if(_0x549b14[_0x5b1d('0x2f')]['filter']){_0x57d1bb[_0x5b1d('0x38')]=_[_0x5b1d('0x3a')](_0x57d1bb['where'],{'$or':_[_0x5b1d('0x2d')](_0x2332ef,function(_0xd3141c){if(_0xd3141c['type']!==_0x5b1d('0x3b')){var _0x495b1f={};_0x495b1f[_0xd3141c['name']]={'$like':'%'+_0x549b14[_0x5b1d('0x2f')]['filter']+'%'};return _0x495b1f;}})});}_0x57d1bb=_[_0x5b1d('0x3a')]({},_0x57d1bb,_0x549b14[_0x5b1d('0x3c')]);var _0x2bf4d6={'where':_0x57d1bb[_0x5b1d('0x38')]};return db[_0x5b1d('0x3d')][_0x5b1d('0x1f')](_0x2bf4d6)[_0x5b1d('0x24')](function(_0x4964e6){_0x383035[_0x5b1d('0x1f')]=_0x4964e6;if(_0x549b14[_0x5b1d('0x2f')]['includeAll']){_0x57d1bb[_0x5b1d('0x3e')]=[{'all':!![]}];}return db['ServicenowAccount'][_0x5b1d('0x3f')](_0x57d1bb);})['then'](function(_0x1d6058){_0x383035['rows']=_0x1d6058;return _0x383035;})[_0x5b1d('0x24')](respondWithFilteredResult(_0x4e27ff,_0x57d1bb))[_0x5b1d('0x40')](handleError(_0x4e27ff,null));};exports[_0x5b1d('0x41')]=function(_0x160606,_0x1ba546){var _0x2bd990={'raw':![],'where':{'id':_0x160606['params']['id']}},_0xf49bef={};_0xf49bef[_0x5b1d('0x2c')]=_[_0x5b1d('0x2e')](db[_0x5b1d('0x3d')][_0x5b1d('0x29')]);_0xf49bef[_0x5b1d('0x2f')]=_[_0x5b1d('0x2e')](_0x160606[_0x5b1d('0x2f')]);_0xf49bef['filters']=_[_0x5b1d('0x31')](_0xf49bef[_0x5b1d('0x2c')],_0xf49bef[_0x5b1d('0x2f')]);_0x2bd990['attributes']=_[_0x5b1d('0x31')](_0xf49bef[_0x5b1d('0x2c')],qs[_0x5b1d('0x32')](_0x160606[_0x5b1d('0x2f')][_0x5b1d('0x32')]));_0x2bd990['attributes']=_0x2bd990[_0x5b1d('0x30')][_0x5b1d('0x33')]?_0x2bd990['attributes']:_0xf49bef[_0x5b1d('0x2c')];if(_0x160606[_0x5b1d('0x2f')][_0x5b1d('0x42')]){_0x2bd990[_0x5b1d('0x3e')]=[{'all':!![]}];}_0x2bd990=_[_0x5b1d('0x3a')]({},_0x2bd990,_0x160606['options']);return db[_0x5b1d('0x3d')][_0x5b1d('0x43')](_0x2bd990)[_0x5b1d('0x24')](handleEntityNotFound(_0x1ba546,null))['then'](respondWithResult(_0x1ba546,null))['catch'](handleError(_0x1ba546,null));};exports[_0x5b1d('0x44')]=function(_0x177000,_0x1bfd12){return db[_0x5b1d('0x3d')][_0x5b1d('0x44')](_0x177000['body'],{})[_0x5b1d('0x24')](respondWithResult(_0x1bfd12,0xc9))[_0x5b1d('0x40')](handleError(_0x1bfd12,null));};exports[_0x5b1d('0x45')]=function(_0x203d2d,_0x32a600){if(_0x203d2d['body']['id']){delete _0x203d2d[_0x5b1d('0x46')]['id'];}return db['ServicenowAccount'][_0x5b1d('0x43')]({'where':{'id':_0x203d2d[_0x5b1d('0x47')]['id']}})[_0x5b1d('0x24')](handleEntityNotFound(_0x32a600,null))[_0x5b1d('0x24')](saveUpdates(_0x203d2d[_0x5b1d('0x46')],null))['then'](respondWithResult(_0x32a600,null))[_0x5b1d('0x40')](handleError(_0x32a600,null));};exports['destroy']=function(_0x5dc16b,_0x26b1f5){return db['ServicenowAccount'][_0x5b1d('0x43')]({'where':{'id':_0x5dc16b[_0x5b1d('0x47')]['id']}})[_0x5b1d('0x24')](handleEntityNotFound(_0x26b1f5,null))['then'](removeEntity(_0x26b1f5,null))['catch'](handleError(_0x26b1f5,null));};exports[_0x5b1d('0x48')]=function(_0x5081fb,_0x21de21,_0x5d0f99){var _0x1f1c4a={};var _0xddebd3={};var _0x5fd488;var _0x3fa15b;return db[_0x5b1d('0x3d')][_0x5b1d('0x49')]({'where':{'id':_0x5081fb[_0x5b1d('0x47')]['id']}})[_0x5b1d('0x24')](handleEntityNotFound(_0x21de21,null))['then'](function(_0x112150){if(_0x112150){_0x5fd488=_0x112150;_0xddebd3[_0x5b1d('0x2c')]=_[_0x5b1d('0x2e')](db[_0x5b1d('0x4a')][_0x5b1d('0x29')]);_0xddebd3['query']=_[_0x5b1d('0x2e')](_0x5081fb[_0x5b1d('0x2f')]);_0xddebd3[_0x5b1d('0x39')]=_[_0x5b1d('0x31')](_0xddebd3['model'],_0xddebd3['query']);_0x1f1c4a[_0x5b1d('0x30')]=_[_0x5b1d('0x31')](_0xddebd3[_0x5b1d('0x2c')],qs[_0x5b1d('0x32')](_0x5081fb[_0x5b1d('0x2f')][_0x5b1d('0x32')]));_0x1f1c4a[_0x5b1d('0x30')]=_0x1f1c4a[_0x5b1d('0x30')][_0x5b1d('0x33')]?_0x1f1c4a[_0x5b1d('0x30')]:_0xddebd3['model'];_0x1f1c4a[_0x5b1d('0x36')]=qs['sort'](_0x5081fb[_0x5b1d('0x2f')][_0x5b1d('0x37')]);_0x1f1c4a['where']=qs[_0x5b1d('0x39')](_[_0x5b1d('0x4b')](_0x5081fb[_0x5b1d('0x2f')],_0xddebd3['filters']));if(_0x5081fb[_0x5b1d('0x2f')][_0x5b1d('0x4c')]){_0x1f1c4a[_0x5b1d('0x38')]=_[_0x5b1d('0x3a')](_0x1f1c4a[_0x5b1d('0x38')],{'$or':_[_0x5b1d('0x2d')](_0x1f1c4a[_0x5b1d('0x30')],function(_0xaae34){var _0x3b79a0={};_0x3b79a0[_0xaae34]={'$like':'%'+_0x5081fb[_0x5b1d('0x2f')]['filter']+'%'};return _0x3b79a0;})});}_0x1f1c4a=_[_0x5b1d('0x3a')]({},_0x1f1c4a,_0x5081fb['options']);return _0x5fd488['getConfigurations'](_0x1f1c4a);}})['then'](function(_0x22dc01){if(_0x22dc01){_0x3fa15b=_0x22dc01['length'];if(!_0x5081fb[_0x5b1d('0x2f')][_0x5b1d('0x34')](_0x5b1d('0x35'))){_0x1f1c4a[_0x5b1d('0x1e')]=qs[_0x5b1d('0x1e')](_0x5081fb['query']['limit']);_0x1f1c4a[_0x5b1d('0x20')]=qs['offset'](_0x5081fb['query'][_0x5b1d('0x20')]);}return _0x5fd488[_0x5b1d('0x48')](_0x1f1c4a);}})['then'](function(_0x2446fc){if(_0x2446fc){return _0x2446fc?{'count':_0x3fa15b,'rows':_0x2446fc}:null;}})[_0x5b1d('0x24')](respondWithResult(_0x21de21,null))[_0x5b1d('0x40')](handleError(_0x21de21,null));};exports[_0x5b1d('0x4d')]=function(_0x17810d,_0x41b96b,_0x2eec18){if(_0x17810d[_0x5b1d('0x46')]['id']){delete _0x17810d['body']['id'];}return db[_0x5b1d('0x3d')][_0x5b1d('0x49')]({'where':{'id':_0x17810d[_0x5b1d('0x47')]['id']}})[_0x5b1d('0x24')](handleEntityNotFound(_0x41b96b,null))[_0x5b1d('0x24')](function(_0x248532){if(_0x248532){_0x17810d[_0x5b1d('0x46')][_0x5b1d('0x4e')]=_0x248532['id'];_0x17810d[_0x5b1d('0x46')][_0x5b1d('0x4f')]=integrations[_0x5b1d('0x50')](_0x17810d[_0x5b1d('0x46')][_0x5b1d('0x51')],_0x17810d[_0x5b1d('0x46')]['type']);_0x17810d[_0x5b1d('0x46')][_0x5b1d('0x52')]=integrations[_0x5b1d('0x53')](_0x17810d['body']['channel'],_0x17810d[_0x5b1d('0x46')][_0x5b1d('0x2b')]);return db[_0x5b1d('0x4a')][_0x5b1d('0x44')](_0x17810d[_0x5b1d('0x46')],{'include':[{'model':db[_0x5b1d('0x54')],'as':_0x5b1d('0x4f')},{'model':db['ServicenowField'],'as':_0x5b1d('0x52')}]});}return null;})[_0x5b1d('0x24')](respondWithResult(_0x41b96b,null))[_0x5b1d('0x40')](handleError(_0x41b96b,null));};exports[_0x5b1d('0x55')]=function(_0x500f18,_0x4baf90,_0x5db9a4){var _0x4eadac=[_0x5b1d('0x56'),_0x5b1d('0x57'),_0x5b1d('0x58'),'subcategory',_0x5b1d('0x59'),_0x5b1d('0x5a'),_0x5b1d('0x5b'),'severity',_0x5b1d('0x5c')];var _0x4f4cbf=[_0x5b1d('0x5d'),_0x5b1d('0x56'),_0x5b1d('0x5e'),_0x5b1d('0x5f'),_0x5b1d('0x60'),'sys_updated_on',_0x5b1d('0x61'),_0x5b1d('0x57'),_0x5b1d('0x62'),'number',_0x5b1d('0x63'),_0x5b1d('0x64'),_0x5b1d('0x65'),_0x5b1d('0x66'),_0x5b1d('0x67'),_0x5b1d('0x68'),'state',_0x5b1d('0x69'),'knowledge','order',_0x5b1d('0x6a'),_0x5b1d('0x6b'),_0x5b1d('0x6c'),_0x5b1d('0x6d'),_0x5b1d('0x6e'),_0x5b1d('0x6f'),_0x5b1d('0x70'),_0x5b1d('0x71'),_0x5b1d('0x72'),'sys_domain_path','rfc',_0x5b1d('0x73'),_0x5b1d('0x74'),_0x5b1d('0x75'),_0x5b1d('0x76'),_0x5b1d('0x77'),_0x5b1d('0x78'),'reopened_time',_0x5b1d('0x79'),_0x5b1d('0x7a'),'approval_set','subcategory',_0x5b1d('0x7b'),'short_description','close_code',_0x5b1d('0x7c'),_0x5b1d('0x7d'),_0x5b1d('0x7e'),_0x5b1d('0x7f'),_0x5b1d('0x80'),_0x5b1d('0x81'),_0x5b1d('0x82'),_0x5b1d('0x83'),'notify',_0x5b1d('0x84'),_0x5b1d('0x85'),_0x5b1d('0x86'),_0x5b1d('0x87'),_0x5b1d('0x88'),_0x5b1d('0x89'),'contact_type',_0x5b1d('0x8a'),_0x5b1d('0x5b'),'urgency',_0x5b1d('0x8b'),_0x5b1d('0x8c'),_0x5b1d('0x8d'),'activity_due','assigned_to',_0x5b1d('0x8e'),'comments',_0x5b1d('0x8f'),'approval','comments_and_work_notes',_0x5b1d('0x90'),_0x5b1d('0x91'),_0x5b1d('0x92'),_0x5b1d('0x93'),_0x5b1d('0x94'),_0x5b1d('0x95'),'correlation_id',_0x5b1d('0x96'),_0x5b1d('0x5c')];var _0x14c317='';var _0x90a081='';var _0x5e47ca=[];var _0x4eca73='';var _0x2e4eff='';var _0x539946=[];var _0x559b5e='';var _0x1ac807='';var _0xa1110f={};var _0x4d6d10='';return db[_0x5b1d('0x3d')]['findOne']({'where':{'id':_0x500f18[_0x5b1d('0x47')]['id']},'attributes':['id',_0x5b1d('0x97'),'password','email',_0x5b1d('0x98'),'serverUrl']})[_0x5b1d('0x24')](handleEntityNotFound(_0x4baf90,null))[_0x5b1d('0x24')](function(_0x1687d5){if(_0x1687d5){_0x4d6d10=_0x1687d5[_0x5b1d('0x98')];var _0x58f26b=_0x4d6d10[_0x5b1d('0x99')](-0x1);if(_0x58f26b==='/'){_0x4d6d10=_0x4d6d10[_0x5b1d('0x9a')](0x0,_0x4d6d10['lastIndexOf'](_0x58f26b));}_0x1ac807=util['format'](_0x5b1d('0x9b'),_0x4d6d10);_0x559b5e=util[_0x5b1d('0x9c')](_0x5b1d('0x9d'),_0x4d6d10);_0xa1110f={'user':_0x1687d5[_0x5b1d('0x97')],'pass':_0x1687d5[_0x5b1d('0x9e')]};var _0x5148d2={'method':_0x5b1d('0x9f'),'uri':_0x1ac807+_0x5b1d('0xa0'),'auth':_0xa1110f,'json':!![]};return rp(_0x5148d2);}})[_0x5b1d('0x24')](function(_0x2bbba0){if(_0x2bbba0['result'][_0x5b1d('0x33')]>0x0){_0x14c317=_0x2bbba0[_0x5b1d('0xa1')];}console[_0x5b1d('0xa2')](_0x5b1d('0xa3'),_0x14c317);_0x539946=[];_0x90a081=Object['assign']([],_0x14c317);_['remove'](_0x90a081,function(_0x3f0622){return!_0x4eadac[_0x5b1d('0xa4')](_0x3f0622[_0x5b1d('0x27')]);});_0x90a081[_0x5b1d('0xa5')](function(_0x2e0fdc){var _0x1972e3=createFieldObject(_0x559b5e,_0xa1110f,_0x2e0fdc[_0x5b1d('0xa6')],_0x2e0fdc[_0x5b1d('0x27')],_0x2e0fdc[_0x5b1d('0xa7')],![]);_0x539946[_0x5b1d('0xa8')](_0x1972e3);});return Promise[_0x5b1d('0xa9')](_0x539946);})[_0x5b1d('0x24')](function(_0x41a355){_0x5e47ca=_0x41a355;_0x4eca73=Object[_0x5b1d('0xaa')]([],_0x14c317);console[_0x5b1d('0xa2')]('TCL:\x20_object',_0x14c317);_[_0x5b1d('0xab')](_0x4eca73,function(_0x19aada){return _0x4f4cbf['includes'](_0x19aada[_0x5b1d('0x27')]);});console['log']('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x4eca73);_0x539946=[];_0x4eca73[_0x5b1d('0xa5')](function(_0x1f9459){var _0x4a449c=createFieldObject(_0x559b5e,_0xa1110f,_0x1f9459[_0x5b1d('0xa6')],_0x1f9459[_0x5b1d('0x27')],_0x1f9459[_0x5b1d('0xa7')],!![]);_0x539946[_0x5b1d('0xa8')](_0x4a449c);});return Promise['all'](_0x539946);})[_0x5b1d('0x24')](function(_0x1e7cb6){_0x2e4eff=_0x1e7cb6;var _0x4ee51a=_0x5e47ca[_0x5b1d('0xac')](_0x2e4eff);return{'count':_0x4ee51a[_0x5b1d('0x33')],'rows':_0x4ee51a};})[_0x5b1d('0x24')](respondWithResult(_0x4baf90,null))['catch'](function(_0x45b96e){console[_0x5b1d('0xa2')](_0x5b1d('0xad')+_0x45b96e);var _0x508887=_0x500f18[_0x5b1d('0x2f')]['test']?0x1f4:_0x45b96e[_0x5b1d('0xae')]||0x1f4;logger['error'](_0x45b96e[_0x5b1d('0x26')]);delete _0x45b96e[_0x5b1d('0x27')];if(_0x508887===0x191){_0x508887=0x190;}_0x4baf90['status'](_0x508887)['send'](_0x500f18[_0x5b1d('0x2f')][_0x5b1d('0xaf')]?{'message':'Wrong\x20credentials','statusCode':_0x45b96e[_0x5b1d('0xae')]}:_0x45b96e);});};function createFieldObject(_0x507869,_0x548d26,_0xbb6558,_0x541d09,_0xe23152,_0x303fab){return new Promise(function(_0x27c756,_0x1cc447){var _0x6b9ca={'id':_0x541d09,'name':_0xe23152,'custom':_0x303fab};if(_0xbb6558===_0x5b1d('0xb0')){_0x6b9ca[_0x5b1d('0x3c')]=[{'name':_0x5b1d('0xb1'),'value':_0x5b1d('0xb2')},{'name':_0x5b1d('0xb3'),'value':_0x5b1d('0xb4')}];_0x27c756(_0x6b9ca);}else{var _0xb8f384={'method':_0x5b1d('0x9f'),'uri':_0x507869+_0x5b1d('0xb5')+_0x541d09,'auth':_0x548d26,'json':!![]};return rp(_0xb8f384)['then'](function(_0x2f9cbf){var _0x41237a=[];if(_0x2f9cbf[_0x5b1d('0xa1')][_0x5b1d('0x33')]>0x0){_0x2f9cbf[_0x5b1d('0xa1')][_0x5b1d('0xa5')](function(_0x201e57){if(_0x201e57[_0x5b1d('0xb6')]===_0x5b1d('0xb4')){var _0x12369e={'name':_0x201e57[_0x5b1d('0xa7')],'value':_0x201e57[_0x5b1d('0xb7')]};_0x41237a[_0x5b1d('0xa8')](_0x12369e);}});}_0x6b9ca[_0x5b1d('0x3c')]=_0x41237a;if(_0x6b9ca[_0x5b1d('0x3c')]['length']>0x0){_0x27c756(_0x6b9ca);}else{if(_0x303fab==![]){_0x27c756();}else{_0x27c756(_0x6b9ca);}}});}});} \ No newline at end of file +var _0xd03c=['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','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send','map','ServicenowAccount','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','pick','type','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','find','create','body','params','getConfigurations','findOne','ServicenowConfiguration','order','sort','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ServicenowField','Descriptions','getFields','made_sla','knowledge','subcategory','notify','incident_state','severity','category','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','hold_reason','approval_history','resolved_by','opened_by','user_input','state','closed_at','cmdb_ci','impact','active','work_notes_list','sys_domain_path','time_worked','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','close_code','correlation_display','delivery_task','work_start','assignment_group','business_stc','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','correlation_id','location','password','remoteUri','serverUrl','slice','lastIndexOf','format','username','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','push','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','all','concat','ServiceNow\x20error:\x20','test','statusCode','error','Wrong\x20credentials','True','False','false','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0x386306,_0x1363c9){var _0xcb23d=function(_0x1fc525){while(--_0x1fc525){_0x386306['push'](_0x386306['shift']());}};_0xcb23d(++_0x1363c9);}(_0xd03c,0xb3));var _0xcd03=function(_0xb7934c,_0x327c4a){_0xb7934c=_0xb7934c-0x0;var _0x194641=_0xd03c[_0xb7934c];return _0x194641;};'use strict';var emlformat=require(_0xcd03('0x0'));var rimraf=require(_0xcd03('0x1'));var zipdir=require(_0xcd03('0x2'));var jsonpatch=require(_0xcd03('0x3'));var rp=require(_0xcd03('0x4'));var moment=require(_0xcd03('0x5'));var BPromise=require(_0xcd03('0x6'));var Mustache=require('mustache');var util=require(_0xcd03('0x7'));var path=require(_0xcd03('0x8'));var sox=require(_0xcd03('0x9'));var csv=require(_0xcd03('0xa'));var ejs=require(_0xcd03('0xb'));var fs=require('fs');var fs_extra=require(_0xcd03('0xc'));var _=require(_0xcd03('0xd'));var squel=require(_0xcd03('0xe'));var crypto=require(_0xcd03('0xf'));var jsforce=require(_0xcd03('0x10'));var deskjs=require(_0xcd03('0x11'));var toCsv=require(_0xcd03('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcd03('0x12'));var authService=require(_0xcd03('0x13'));var qs=require(_0xcd03('0x14'));var as=require(_0xcd03('0x15'));var hardwareService=require(_0xcd03('0x16'));var logger=require('../../config/logger')(_0xcd03('0x17'));var utils=require(_0xcd03('0x18'));var config=require(_0xcd03('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xcd03('0x1a'))['db'];var integrations=require(_0xcd03('0x1b'));function respondWithStatusCode(_0x2e4feb,_0x389f83){_0x389f83=_0x389f83||0xcc;return function(_0x96a2fb){if(_0x96a2fb){return _0x2e4feb[_0xcd03('0x1c')](_0x389f83);}return _0x2e4feb[_0xcd03('0x1d')](_0x389f83)[_0xcd03('0x1e')]();};}function respondWithResult(_0x1def10,_0x5c7784){_0x5c7784=_0x5c7784||0xc8;return function(_0x4f637c){if(_0x4f637c){return _0x1def10['status'](_0x5c7784)[_0xcd03('0x1f')](_0x4f637c);}};}function respondWithFilteredResult(_0x22c481,_0x5eec0a){return function(_0x5b110d){if(_0x5b110d){var _0x508a59=typeof _0x5eec0a[_0xcd03('0x20')]===_0xcd03('0x21')&&typeof _0x5eec0a[_0xcd03('0x22')]===_0xcd03('0x21');var _0x235699=_0x5b110d['count'];var _0x2a376c=_0x508a59?0x0:_0x5eec0a[_0xcd03('0x20')];var _0x457fce=_0x508a59?_0x5b110d['count']:_0x5eec0a[_0xcd03('0x20')]+_0x5eec0a[_0xcd03('0x22')];var _0x3b8c45;if(_0x457fce>=_0x235699){_0x457fce=_0x235699;_0x3b8c45=0xc8;}else{_0x3b8c45=0xce;}_0x22c481[_0xcd03('0x1d')](_0x3b8c45);return _0x22c481[_0xcd03('0x23')](_0xcd03('0x24'),_0x2a376c+'-'+_0x457fce+'/'+_0x235699)[_0xcd03('0x1f')](_0x5b110d);}return null;};}function patchUpdates(_0x2fc355){return function(_0x3df1cd){try{jsonpatch[_0xcd03('0x25')](_0x3df1cd,_0x2fc355,!![]);}catch(_0x145f00){return BPromise['reject'](_0x145f00);}return _0x3df1cd[_0xcd03('0x26')]();};}function saveUpdates(_0x520419,_0x3f96cd){return function(_0xa3c9ae){if(_0xa3c9ae){return _0xa3c9ae[_0xcd03('0x27')](_0x520419)[_0xcd03('0x28')](function(_0x547e71){return _0x547e71;});}return null;};}function removeEntity(_0x5b1031,_0x3f23de){return function(_0x4ed756){if(_0x4ed756){return _0x4ed756[_0xcd03('0x29')]()['then'](function(){_0x5b1031[_0xcd03('0x1d')](0xcc)[_0xcd03('0x1e')]();});}};}function handleEntityNotFound(_0x44ba6b,_0x1721ad){return function(_0x49dded){if(!_0x49dded){_0x44ba6b[_0xcd03('0x1c')](0x194);}return _0x49dded;};}function handleError(_0x3aa2a1,_0x508d1d){_0x508d1d=_0x508d1d||0x1f4;return function(_0x19e3e5){logger['error'](_0x19e3e5[_0xcd03('0x2a')]);if(_0x19e3e5[_0xcd03('0x2b')]){delete _0x19e3e5[_0xcd03('0x2b')];}_0x3aa2a1[_0xcd03('0x1d')](_0x508d1d)[_0xcd03('0x2c')](_0x19e3e5);};}exports['index']=function(_0x2064aa,_0x1a64df){var _0x150ce9={},_0x40ce4e={},_0x4028a6={'count':0x0,'rows':[]};var _0x5f09fb=_[_0xcd03('0x2d')](db[_0xcd03('0x2e')][_0xcd03('0x2f')],function(_0x139d13){return{'name':_0x139d13[_0xcd03('0x30')],'type':_0x139d13['type']['key']};});_0x40ce4e[_0xcd03('0x31')]=_[_0xcd03('0x2d')](_0x5f09fb,_0xcd03('0x2b'));_0x40ce4e[_0xcd03('0x32')]=_[_0xcd03('0x33')](_0x2064aa['query']);_0x40ce4e[_0xcd03('0x34')]=_[_0xcd03('0x35')](_0x40ce4e[_0xcd03('0x31')],_0x40ce4e['query']);_0x150ce9[_0xcd03('0x36')]=_[_0xcd03('0x35')](_0x40ce4e['model'],qs[_0xcd03('0x37')](_0x2064aa[_0xcd03('0x32')][_0xcd03('0x37')]));_0x150ce9[_0xcd03('0x36')]=_0x150ce9['attributes'][_0xcd03('0x38')]?_0x150ce9[_0xcd03('0x36')]:_0x40ce4e[_0xcd03('0x31')];if(!_0x2064aa[_0xcd03('0x32')][_0xcd03('0x39')](_0xcd03('0x3a'))){_0x150ce9['limit']=qs[_0xcd03('0x22')](_0x2064aa[_0xcd03('0x32')][_0xcd03('0x22')]);_0x150ce9[_0xcd03('0x20')]=qs[_0xcd03('0x20')](_0x2064aa[_0xcd03('0x32')][_0xcd03('0x20')]);}_0x150ce9['order']=qs['sort'](_0x2064aa[_0xcd03('0x32')]['sort']);_0x150ce9[_0xcd03('0x3b')]=qs[_0xcd03('0x34')](_[_0xcd03('0x3c')](_0x2064aa[_0xcd03('0x32')],_0x40ce4e[_0xcd03('0x34')]),_0x5f09fb);if(_0x2064aa[_0xcd03('0x32')]['filter']){_0x150ce9['where']=_['merge'](_0x150ce9[_0xcd03('0x3b')],{'$or':_[_0xcd03('0x2d')](_0x5f09fb,function(_0xa94bc){if(_0xa94bc[_0xcd03('0x3d')]!=='VIRTUAL'){var _0xf2bb87={};_0xf2bb87[_0xa94bc[_0xcd03('0x2b')]]={'$like':'%'+_0x2064aa[_0xcd03('0x32')][_0xcd03('0x3e')]+'%'};return _0xf2bb87;}})});}_0x150ce9=_[_0xcd03('0x3f')]({},_0x150ce9,_0x2064aa[_0xcd03('0x40')]);var _0x13dee4={'where':_0x150ce9[_0xcd03('0x3b')]};return db['ServicenowAccount'][_0xcd03('0x41')](_0x13dee4)['then'](function(_0x1335a7){_0x4028a6[_0xcd03('0x41')]=_0x1335a7;if(_0x2064aa[_0xcd03('0x32')][_0xcd03('0x42')]){_0x150ce9[_0xcd03('0x43')]=[{'all':!![]}];}return db['ServicenowAccount'][_0xcd03('0x44')](_0x150ce9);})[_0xcd03('0x28')](function(_0xeda48e){_0x4028a6[_0xcd03('0x45')]=_0xeda48e;return _0x4028a6;})['then'](respondWithFilteredResult(_0x1a64df,_0x150ce9))[_0xcd03('0x46')](handleError(_0x1a64df,null));};exports[_0xcd03('0x47')]=function(_0x591a65,_0x5b54c1){var _0x1a768f={'raw':![],'where':{'id':_0x591a65['params']['id']}},_0x71a765={};_0x71a765[_0xcd03('0x31')]=_[_0xcd03('0x33')](db[_0xcd03('0x2e')][_0xcd03('0x2f')]);_0x71a765[_0xcd03('0x32')]=_[_0xcd03('0x33')](_0x591a65[_0xcd03('0x32')]);_0x71a765['filters']=_[_0xcd03('0x35')](_0x71a765[_0xcd03('0x31')],_0x71a765[_0xcd03('0x32')]);_0x1a768f[_0xcd03('0x36')]=_['intersection'](_0x71a765[_0xcd03('0x31')],qs[_0xcd03('0x37')](_0x591a65[_0xcd03('0x32')][_0xcd03('0x37')]));_0x1a768f[_0xcd03('0x36')]=_0x1a768f[_0xcd03('0x36')][_0xcd03('0x38')]?_0x1a768f['attributes']:_0x71a765[_0xcd03('0x31')];if(_0x591a65['query'][_0xcd03('0x42')]){_0x1a768f[_0xcd03('0x43')]=[{'all':!![]}];}_0x1a768f=_[_0xcd03('0x3f')]({},_0x1a768f,_0x591a65[_0xcd03('0x40')]);return db[_0xcd03('0x2e')][_0xcd03('0x48')](_0x1a768f)['then'](handleEntityNotFound(_0x5b54c1,null))['then'](respondWithResult(_0x5b54c1,null))[_0xcd03('0x46')](handleError(_0x5b54c1,null));};exports['create']=function(_0x17c575,_0x22278a){return db[_0xcd03('0x2e')][_0xcd03('0x49')](_0x17c575[_0xcd03('0x4a')],{})[_0xcd03('0x28')](respondWithResult(_0x22278a,0xc9))[_0xcd03('0x46')](handleError(_0x22278a,null));};exports[_0xcd03('0x27')]=function(_0x8e6fdf,_0x1d1b03){if(_0x8e6fdf['body']['id']){delete _0x8e6fdf[_0xcd03('0x4a')]['id'];}return db['ServicenowAccount'][_0xcd03('0x48')]({'where':{'id':_0x8e6fdf['params']['id']}})['then'](handleEntityNotFound(_0x1d1b03,null))[_0xcd03('0x28')](saveUpdates(_0x8e6fdf[_0xcd03('0x4a')],null))['then'](respondWithResult(_0x1d1b03,null))[_0xcd03('0x46')](handleError(_0x1d1b03,null));};exports['destroy']=function(_0x14d8d7,_0x3245c5){return db['ServicenowAccount'][_0xcd03('0x48')]({'where':{'id':_0x14d8d7[_0xcd03('0x4b')]['id']}})[_0xcd03('0x28')](handleEntityNotFound(_0x3245c5,null))[_0xcd03('0x28')](removeEntity(_0x3245c5,null))[_0xcd03('0x46')](handleError(_0x3245c5,null));};exports[_0xcd03('0x4c')]=function(_0x37350d,_0x44f9ce,_0x56eb86){var _0x472591={};var _0x8a947d={};var _0x1d7d46;var _0x3c5334;return db[_0xcd03('0x2e')][_0xcd03('0x4d')]({'where':{'id':_0x37350d['params']['id']}})[_0xcd03('0x28')](handleEntityNotFound(_0x44f9ce,null))['then'](function(_0x173f70){if(_0x173f70){_0x1d7d46=_0x173f70;_0x8a947d[_0xcd03('0x31')]=_[_0xcd03('0x33')](db[_0xcd03('0x4e')][_0xcd03('0x2f')]);_0x8a947d[_0xcd03('0x32')]=_[_0xcd03('0x33')](_0x37350d['query']);_0x8a947d[_0xcd03('0x34')]=_[_0xcd03('0x35')](_0x8a947d[_0xcd03('0x31')],_0x8a947d[_0xcd03('0x32')]);_0x472591[_0xcd03('0x36')]=_['intersection'](_0x8a947d[_0xcd03('0x31')],qs[_0xcd03('0x37')](_0x37350d[_0xcd03('0x32')][_0xcd03('0x37')]));_0x472591[_0xcd03('0x36')]=_0x472591[_0xcd03('0x36')][_0xcd03('0x38')]?_0x472591[_0xcd03('0x36')]:_0x8a947d[_0xcd03('0x31')];_0x472591[_0xcd03('0x4f')]=qs[_0xcd03('0x50')](_0x37350d[_0xcd03('0x32')][_0xcd03('0x50')]);_0x472591[_0xcd03('0x3b')]=qs['filters'](_['pick'](_0x37350d['query'],_0x8a947d[_0xcd03('0x34')]));if(_0x37350d[_0xcd03('0x32')][_0xcd03('0x3e')]){_0x472591['where']=_[_0xcd03('0x3f')](_0x472591[_0xcd03('0x3b')],{'$or':_[_0xcd03('0x2d')](_0x472591[_0xcd03('0x36')],function(_0x46ff3e){var _0x9a8213={};_0x9a8213[_0x46ff3e]={'$like':'%'+_0x37350d[_0xcd03('0x32')][_0xcd03('0x3e')]+'%'};return _0x9a8213;})});}_0x472591=_[_0xcd03('0x3f')]({},_0x472591,_0x37350d[_0xcd03('0x40')]);return _0x1d7d46['getConfigurations'](_0x472591);}})[_0xcd03('0x28')](function(_0x2164a5){if(_0x2164a5){_0x3c5334=_0x2164a5[_0xcd03('0x38')];if(!_0x37350d[_0xcd03('0x32')][_0xcd03('0x39')](_0xcd03('0x3a'))){_0x472591[_0xcd03('0x22')]=qs[_0xcd03('0x22')](_0x37350d[_0xcd03('0x32')]['limit']);_0x472591['offset']=qs['offset'](_0x37350d[_0xcd03('0x32')][_0xcd03('0x20')]);}return _0x1d7d46[_0xcd03('0x4c')](_0x472591);}})[_0xcd03('0x28')](function(_0x3fd12){if(_0x3fd12){return _0x3fd12?{'count':_0x3c5334,'rows':_0x3fd12}:null;}})[_0xcd03('0x28')](respondWithResult(_0x44f9ce,null))[_0xcd03('0x46')](handleError(_0x44f9ce,null));};exports[_0xcd03('0x51')]=function(_0x3921a5,_0x30a63d,_0x10671e){if(_0x3921a5[_0xcd03('0x4a')]['id']){delete _0x3921a5[_0xcd03('0x4a')]['id'];}return db[_0xcd03('0x2e')][_0xcd03('0x4d')]({'where':{'id':_0x3921a5[_0xcd03('0x4b')]['id']}})['then'](handleEntityNotFound(_0x30a63d,null))[_0xcd03('0x28')](function(_0x52c223){if(_0x52c223){_0x3921a5[_0xcd03('0x4a')][_0xcd03('0x52')]=_0x52c223['id'];_0x3921a5[_0xcd03('0x4a')][_0xcd03('0x53')]=integrations[_0xcd03('0x54')](_0x3921a5[_0xcd03('0x4a')][_0xcd03('0x55')],_0x3921a5[_0xcd03('0x4a')][_0xcd03('0x3d')]);_0x3921a5[_0xcd03('0x4a')]['Descriptions']=integrations[_0xcd03('0x56')](_0x3921a5[_0xcd03('0x4a')][_0xcd03('0x55')],_0x3921a5[_0xcd03('0x4a')][_0xcd03('0x3d')]);return db[_0xcd03('0x4e')][_0xcd03('0x49')](_0x3921a5[_0xcd03('0x4a')],{'include':[{'model':db[_0xcd03('0x57')],'as':_0xcd03('0x53')},{'model':db['ServicenowField'],'as':_0xcd03('0x58')}]});}return null;})['then'](respondWithResult(_0x30a63d,null))['catch'](handleError(_0x30a63d,null));};exports[_0xcd03('0x59')]=function(_0x1aabcd,_0x83f203,_0x2ef1c4){var _0x3ae2ce=[_0xcd03('0x5a'),'hold_reason',_0xcd03('0x5b'),_0xcd03('0x5c'),'close_code',_0xcd03('0x5d'),_0xcd03('0x5e'),_0xcd03('0x5f'),_0xcd03('0x60')];var _0x11c36d=['parent','made_sla',_0xcd03('0x61'),_0xcd03('0x62'),_0xcd03('0x63'),_0xcd03('0x64'),_0xcd03('0x65'),_0xcd03('0x66'),_0xcd03('0x67'),'number',_0xcd03('0x68'),'sys_updated_by',_0xcd03('0x69'),_0xcd03('0x6a'),'sys_created_on','sys_domain',_0xcd03('0x6b'),'sys_created_by',_0xcd03('0x5b'),_0xcd03('0x4f'),'calendar_stc',_0xcd03('0x6c'),_0xcd03('0x6d'),'delivery_plan',_0xcd03('0x6e'),_0xcd03('0x6f'),_0xcd03('0x70'),'business_service','priority',_0xcd03('0x71'),'rfc',_0xcd03('0x72'),'expected_start','opened_at','business_duration',_0xcd03('0x73'),_0xcd03('0x74'),_0xcd03('0x75'),_0xcd03('0x76'),_0xcd03('0x77'),_0xcd03('0x78'),_0xcd03('0x5c'),_0xcd03('0x79'),_0xcd03('0x7a'),_0xcd03('0x7b'),_0xcd03('0x7c'),_0xcd03('0x7d'),_0xcd03('0x7e'),_0xcd03('0x7f'),_0xcd03('0x80'),'additional_assignee_list',_0xcd03('0x81'),_0xcd03('0x82'),_0xcd03('0x5d'),_0xcd03('0x83'),_0xcd03('0x84'),_0xcd03('0x85'),_0xcd03('0x86'),_0xcd03('0x87'),_0xcd03('0x88'),_0xcd03('0x89'),'reopened_by',_0xcd03('0x5e'),_0xcd03('0x8a'),_0xcd03('0x8b'),_0xcd03('0x8c'),_0xcd03('0x8d'),_0xcd03('0x8e'),_0xcd03('0x8f'),_0xcd03('0x5f'),_0xcd03('0x90'),_0xcd03('0x91'),_0xcd03('0x92'),_0xcd03('0x93'),_0xcd03('0x94'),_0xcd03('0x95'),_0xcd03('0x96'),_0xcd03('0x97'),_0xcd03('0x98'),'upon_approval',_0xcd03('0x99'),_0xcd03('0x9a'),'category'];var _0x58cbf8='';var _0x6c881f='';var _0x404d95=[];var _0x3b92bd='';var _0x45b224='';var _0x550499=[];var _0x10c793='';var _0x23ea7b='';var _0xc47b0a={};var _0x27091d='';return db[_0xcd03('0x2e')]['findOne']({'where':{'id':_0x1aabcd[_0xcd03('0x4b')]['id']},'attributes':['id','username',_0xcd03('0x9b'),'email',_0xcd03('0x9c'),_0xcd03('0x9d')]})['then'](handleEntityNotFound(_0x83f203,null))[_0xcd03('0x28')](function(_0x4c8190){if(_0x4c8190){_0x27091d=_0x4c8190['remoteUri'];var _0x190faa=_0x27091d[_0xcd03('0x9e')](-0x1);if(_0x190faa==='/'){_0x27091d=_0x27091d['substring'](0x0,_0x27091d[_0xcd03('0x9f')](_0x190faa));}_0x23ea7b=util['format']('%s/api/now/doc/table/schema/',_0x27091d);_0x10c793=util[_0xcd03('0xa0')]('%s/api/now/table/',_0x27091d);_0xc47b0a={'user':_0x4c8190[_0xcd03('0xa1')],'pass':_0x4c8190['password']};var _0x481d48={'method':'GET','uri':_0x23ea7b+_0xcd03('0xa2'),'auth':_0xc47b0a,'json':!![]};return rp(_0x481d48);}})[_0xcd03('0x28')](function(_0x4b42f9){if(_0x4b42f9['result'][_0xcd03('0x38')]>0x0){_0x58cbf8=_0x4b42f9[_0xcd03('0xa3')];}console[_0xcd03('0xa4')](_0xcd03('0xa5'),_0x58cbf8);_0x550499=[];_0x6c881f=Object[_0xcd03('0xa6')]([],_0x58cbf8);_[_0xcd03('0xa7')](_0x6c881f,function(_0x547fa1){return!_0x3ae2ce[_0xcd03('0xa8')](_0x547fa1[_0xcd03('0x2b')]);});_0x6c881f[_0xcd03('0xa9')](function(_0x5d54fb){var _0x28fd53=createFieldObject(_0x10c793,_0xc47b0a,_0x5d54fb[_0xcd03('0xaa')],_0x5d54fb[_0xcd03('0x2b')],_0x5d54fb['label'],![]);_0x550499[_0xcd03('0xab')](_0x28fd53);});return Promise['all'](_0x550499);})[_0xcd03('0x28')](function(_0x2e0860){_0x404d95=_0x2e0860;_0x3b92bd=Object[_0xcd03('0xa6')]([],_0x58cbf8);console[_0xcd03('0xa4')](_0xcd03('0xac'),_0x58cbf8);_[_0xcd03('0xa7')](_0x3b92bd,function(_0xbfff74){return _0x11c36d['includes'](_0xbfff74[_0xcd03('0x2b')]);});console[_0xcd03('0xa4')](_0xcd03('0xad'),_0x3b92bd);_0x550499=[];_0x3b92bd['forEach'](function(_0x345303){var _0x300887=createFieldObject(_0x10c793,_0xc47b0a,_0x345303['internalType'],_0x345303[_0xcd03('0x2b')],_0x345303[_0xcd03('0xae')],!![]);_0x550499['push'](_0x300887);});return Promise[_0xcd03('0xaf')](_0x550499);})[_0xcd03('0x28')](function(_0x53bf13){_0x45b224=_0x53bf13;var _0x208efd=_0x404d95[_0xcd03('0xb0')](_0x45b224);return{'count':_0x208efd[_0xcd03('0x38')],'rows':_0x208efd};})[_0xcd03('0x28')](respondWithResult(_0x83f203,null))[_0xcd03('0x46')](function(_0xd564e0){console[_0xcd03('0xa4')](_0xcd03('0xb1')+_0xd564e0);var _0x572559=_0x1aabcd[_0xcd03('0x32')][_0xcd03('0xb2')]?0x1f4:_0xd564e0[_0xcd03('0xb3')]||0x1f4;logger[_0xcd03('0xb4')](_0xd564e0['stack']);delete _0xd564e0[_0xcd03('0x2b')];if(_0x572559===0x191){_0x572559=0x190;}_0x83f203[_0xcd03('0x1d')](_0x572559)['send'](_0x1aabcd[_0xcd03('0x32')][_0xcd03('0xb2')]?{'message':_0xcd03('0xb5'),'statusCode':_0xd564e0[_0xcd03('0xb3')]}:_0xd564e0);});};function createFieldObject(_0x5d100c,_0x2048af,_0xd03f08,_0x4ca6c3,_0x71cdc0,_0x285d58){return new Promise(function(_0x3be860,_0x2c1aa0){var _0x4ab247={'id':_0x4ca6c3,'name':_0x71cdc0,'custom':_0x285d58};if(_0xd03f08==='boolean'){_0x4ab247[_0xcd03('0x40')]=[{'name':_0xcd03('0xb6'),'value':'true'},{'name':_0xcd03('0xb7'),'value':_0xcd03('0xb8')}];_0x3be860(_0x4ab247);}else{var _0x2a561b={'method':'GET','uri':_0x5d100c+'sys_choice?sysparm_query=name=incident^element='+_0x4ca6c3,'auth':_0x2048af,'json':!![]};return rp(_0x2a561b)['then'](function(_0x59f5ea){var _0x55a19d=[];if(_0x59f5ea['result'][_0xcd03('0x38')]>0x0){_0x59f5ea[_0xcd03('0xa3')][_0xcd03('0xa9')](function(_0x2947f5){if(_0x2947f5[_0xcd03('0xb9')]==='false'){var _0x81761={'name':_0x2947f5['label'],'value':_0x2947f5[_0xcd03('0xba')]};_0x55a19d[_0xcd03('0xab')](_0x81761);}});}_0x4ab247[_0xcd03('0x40')]=_0x55a19d;if(_0x4ab247[_0xcd03('0x40')][_0xcd03('0x38')]>0x0){_0x3be860(_0x4ab247);}else{if(_0x285d58==![]){_0x3be860();}else{_0x3be860(_0x4ab247);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index e7aba2d..6bbd57c 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 _0x90b1=['define','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x90b1,0x1bb));var _0x190b=function(_0x3917d3,_0xab2510){_0x3917d3=_0x3917d3-0x0;var _0x36b6fa=_0x90b1[_0x3917d3];return _0x36b6fa;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var logger=require(_0x190b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x190b('0x3'));var rp=require(_0x190b('0x4'));var fs=require('fs');var path=require(_0x190b('0x5'));var rimraf=require(_0x190b('0x6'));var config=require('../../config/environment');var attributes=require('./intServicenowAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x27ff8c,_0x34a689){return _0x27ff8c[_0x190b('0x7')](_0x190b('0x8'),attributes,{'tableName':_0x190b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd51=['./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','lodash','../../config/logger','api','moment','bluebird'];(function(_0x414cef,_0x391211){var _0x2c3ac4=function(_0x7b95d8){while(--_0x7b95d8){_0x414cef['push'](_0x414cef['shift']());}};_0x2c3ac4(++_0x391211);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x3b5351,_0x20ea82){_0x3b5351=_0x3b5351-0x0;var _0x30d24e=_0xbd51[_0x3b5351];return _0x30d24e;};'use strict';var _=require(_0x1bd5('0x0'));var util=require('util');var logger=require(_0x1bd5('0x1'))(_0x1bd5('0x2'));var moment=require(_0x1bd5('0x3'));var BPromise=require(_0x1bd5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1bd5('0x5'));var integrations=require(_0x1bd5('0x6'));module[_0x1bd5('0x7')]=function(_0x59ddfb,_0x29abea){return _0x59ddfb[_0x1bd5('0x8')](_0x1bd5('0x9'),attributes,{'tableName':_0x1bd5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 4bd3bba..79b0149 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 _0xcf14=['then','info','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','ServicenowAccount','findAll','options','where','attributes','limit','include','map','model','GetServicenowAccount','raw','ShowServicenowAccount','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x28378d,_0x6edb46){var _0x312e0d=function(_0x929c97){while(--_0x929c97){_0x28378d['push'](_0x28378d['shift']());}};_0x312e0d(++_0x6edb46);}(_0xcf14,0x10c));var _0x4cf1=function(_0x6dbea6,_0x1222c3){_0x6dbea6=_0x6dbea6-0x0;var _0x45a269=_0xcf14[_0x6dbea6];return _0x45a269;};'use strict';var _=require(_0x4cf1('0x0'));var util=require('util');var moment=require(_0x4cf1('0x1'));var BPromise=require(_0x4cf1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4cf1('0x3'));var db=require(_0x4cf1('0x4'))['db'];var utils=require(_0x4cf1('0x5'));var logger=require(_0x4cf1('0x6'))(_0x4cf1('0x7'));var config=require(_0x4cf1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4cf1('0x9')][_0x4cf1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4308a8,_0x38ff20,_0x4e09a0){return new BPromise(function(_0x766afa,_0x1e639d){return client[_0x4cf1('0xb')](_0x4308a8,_0x4e09a0)[_0x4cf1('0xc')](function(_0x2be64c){logger[_0x4cf1('0xd')](_0x4cf1('0xe'),_0x38ff20,'request\x20sent');logger[_0x4cf1('0xf')](_0x4cf1('0x10'),_0x38ff20,_0x4cf1('0x11'),JSON[_0x4cf1('0x12')](_0x2be64c));if(_0x2be64c['error']){if(_0x2be64c[_0x4cf1('0x13')]['code']===0x1f4){logger[_0x4cf1('0x13')]('ServicenowAccount,\x20%s,\x20%s',_0x38ff20,_0x2be64c[_0x4cf1('0x13')][_0x4cf1('0x14')]);return _0x1e639d(_0x2be64c['error'][_0x4cf1('0x14')]);}logger['error'](_0x4cf1('0xe'),_0x38ff20,_0x2be64c['error']['message']);return _0x766afa(_0x2be64c['error']['message']);}else{logger[_0x4cf1('0xd')](_0x4cf1('0xe'),_0x38ff20,_0x4cf1('0x11'));_0x766afa(_0x2be64c[_0x4cf1('0x15')][_0x4cf1('0x14')]);}})[_0x4cf1('0x16')](function(_0x1cef15){logger[_0x4cf1('0x13')](_0x4cf1('0xe'),_0x38ff20,_0x1cef15);_0x1e639d(_0x1cef15);});});}exports['GetServicenowAccount']=function(_0x458554){var _0x502d5e=this;return new Promise(function(_0x182396,_0x26fbdd){return db[_0x4cf1('0x17')][_0x4cf1('0x18')]({'raw':_0x458554[_0x4cf1('0x19')]?_0x458554[_0x4cf1('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x458554[_0x4cf1('0x19')]?_0x458554['options'][_0x4cf1('0x1a')]||null:null,'attributes':_0x458554['options']?_0x458554[_0x4cf1('0x19')][_0x4cf1('0x1b')]||null:null,'limit':_0x458554[_0x4cf1('0x19')]?_0x458554['options'][_0x4cf1('0x1c')]||null:null,'include':_0x458554['options']?_0x458554['options'][_0x4cf1('0x1d')]?_[_0x4cf1('0x1e')](_0x458554[_0x4cf1('0x19')][_0x4cf1('0x1d')],function(_0x5821f9){return{'model':db[_0x5821f9['model']],'as':_0x5821f9['as'],'attributes':_0x5821f9['attributes'],'include':_0x5821f9[_0x4cf1('0x1d')]?_['map'](_0x5821f9[_0x4cf1('0x1d')],function(_0x529dc6){return{'model':db[_0x529dc6[_0x4cf1('0x1f')]],'as':_0x529dc6['as'],'attributes':_0x529dc6[_0x4cf1('0x1b')],'include':_0x529dc6[_0x4cf1('0x1d')]?_[_0x4cf1('0x1e')](_0x529dc6[_0x4cf1('0x1d')],function(_0x5aa0b2){return{'model':db[_0x5aa0b2[_0x4cf1('0x1f')]],'as':_0x5aa0b2['as'],'attributes':_0x5aa0b2[_0x4cf1('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4cf1('0xc')](function(_0xa11870){logger[_0x4cf1('0xd')](_0x4cf1('0x20'),_0x458554);logger[_0x4cf1('0xf')](_0x4cf1('0x20'),_0x458554,JSON['stringify'](_0xa11870));_0x182396(_0xa11870);})[_0x4cf1('0x16')](function(_0x21b479){logger[_0x4cf1('0x13')]('GetServicenowAccount',_0x21b479['message'],_0x458554);_0x26fbdd(_0x502d5e[_0x4cf1('0x13')](0x1f4,_0x21b479[_0x4cf1('0x14')]));});});};exports['ShowServicenowAccount']=function(_0x4ee9e9){var _0x3c43d=this;return new Promise(function(_0x1b432f,_0x3eea4d){return db[_0x4cf1('0x17')]['find']({'raw':_0x4ee9e9[_0x4cf1('0x19')]?_0x4ee9e9[_0x4cf1('0x19')][_0x4cf1('0x21')]===undefined?!![]:![]:!![],'where':_0x4ee9e9['options']?_0x4ee9e9[_0x4cf1('0x19')][_0x4cf1('0x1a')]||null:null,'attributes':_0x4ee9e9[_0x4cf1('0x19')]?_0x4ee9e9['options'][_0x4cf1('0x1b')]||null:null,'include':_0x4ee9e9[_0x4cf1('0x19')]?_0x4ee9e9[_0x4cf1('0x19')][_0x4cf1('0x1d')]?_[_0x4cf1('0x1e')](_0x4ee9e9[_0x4cf1('0x19')][_0x4cf1('0x1d')],function(_0x3f82d7){return{'model':db[_0x3f82d7[_0x4cf1('0x1f')]],'as':_0x3f82d7['as'],'attributes':_0x3f82d7['attributes'],'include':_0x3f82d7['include']?_[_0x4cf1('0x1e')](_0x3f82d7['include'],function(_0x371a1a){return{'model':db[_0x371a1a['model']],'as':_0x371a1a['as'],'attributes':_0x371a1a[_0x4cf1('0x1b')],'include':_0x371a1a[_0x4cf1('0x1d')]?_[_0x4cf1('0x1e')](_0x371a1a[_0x4cf1('0x1d')],function(_0x331361){return{'model':db[_0x331361['model']],'as':_0x331361['as'],'attributes':_0x331361[_0x4cf1('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x133ce1){logger[_0x4cf1('0xd')](_0x4cf1('0x22'),_0x4ee9e9);logger[_0x4cf1('0xf')](_0x4cf1('0x22'),_0x4ee9e9,JSON[_0x4cf1('0x12')](_0x133ce1));_0x1b432f(_0x133ce1);})[_0x4cf1('0x16')](function(_0x33486f){logger['error'](_0x4cf1('0x22'),_0x33486f[_0x4cf1('0x14')],_0x4ee9e9);_0x3eea4d(_0x3c43d[_0x4cf1('0x13')](0x1f4,_0x33486f['message']));});});}; \ No newline at end of file +var _0x3b38=['info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','ServicenowAccount','findAll','options','attributes','limit','include','model','map','GetServicenowAccount','ShowServicenowAccount','find','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x411631,_0x5cc5c3){var _0x490190=function(_0x19148d){while(--_0x19148d){_0x411631['push'](_0x411631['shift']());}};_0x490190(++_0x5cc5c3);}(_0x3b38,0x125));var _0x83b3=function(_0x3de5fc,_0x1fe70a){_0x3de5fc=_0x3de5fc-0x0;var _0x1b5f88=_0x3b38[_0x3de5fc];return _0x1b5f88;};'use strict';var _=require(_0x83b3('0x0'));var util=require(_0x83b3('0x1'));var moment=require('moment');var BPromise=require(_0x83b3('0x2'));var rs=require(_0x83b3('0x3'));var fs=require('fs');var Redis=require(_0x83b3('0x4'));var db=require(_0x83b3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x83b3('0x6'))(_0x83b3('0x7'));var config=require(_0x83b3('0x8'));var jayson=require(_0x83b3('0x9'));var client=jayson['client'][_0x83b3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x185d3a,_0x3473c6,_0x472af9){return new BPromise(function(_0x7b5e5a,_0x418dc3){return client[_0x83b3('0xb')](_0x185d3a,_0x472af9)[_0x83b3('0xc')](function(_0x5cd994){logger[_0x83b3('0xd')](_0x83b3('0xe'),_0x3473c6,_0x83b3('0xf'));logger[_0x83b3('0x10')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x3473c6,'request\x20sent',JSON[_0x83b3('0x11')](_0x5cd994));if(_0x5cd994['error']){if(_0x5cd994[_0x83b3('0x12')][_0x83b3('0x13')]===0x1f4){logger[_0x83b3('0x12')](_0x83b3('0xe'),_0x3473c6,_0x5cd994[_0x83b3('0x12')][_0x83b3('0x14')]);return _0x418dc3(_0x5cd994[_0x83b3('0x12')][_0x83b3('0x14')]);}logger['error'](_0x83b3('0xe'),_0x3473c6,_0x5cd994['error']['message']);return _0x7b5e5a(_0x5cd994[_0x83b3('0x12')][_0x83b3('0x14')]);}else{logger[_0x83b3('0xd')](_0x83b3('0xe'),_0x3473c6,_0x83b3('0xf'));_0x7b5e5a(_0x5cd994['result'][_0x83b3('0x14')]);}})[_0x83b3('0x15')](function(_0x409fde){logger['error'](_0x83b3('0xe'),_0x3473c6,_0x409fde);_0x418dc3(_0x409fde);});});}exports['GetServicenowAccount']=function(_0x611002){var _0x5e0542=this;return new Promise(function(_0x5e68b8,_0x1ce339){return db[_0x83b3('0x16')][_0x83b3('0x17')]({'raw':_0x611002[_0x83b3('0x18')]?_0x611002[_0x83b3('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x611002[_0x83b3('0x18')]?_0x611002[_0x83b3('0x18')]['where']||null:null,'attributes':_0x611002[_0x83b3('0x18')]?_0x611002[_0x83b3('0x18')][_0x83b3('0x19')]||null:null,'limit':_0x611002[_0x83b3('0x18')]?_0x611002['options'][_0x83b3('0x1a')]||null:null,'include':_0x611002[_0x83b3('0x18')]?_0x611002[_0x83b3('0x18')][_0x83b3('0x1b')]?_['map'](_0x611002[_0x83b3('0x18')][_0x83b3('0x1b')],function(_0x1b8e32){return{'model':db[_0x1b8e32[_0x83b3('0x1c')]],'as':_0x1b8e32['as'],'attributes':_0x1b8e32[_0x83b3('0x19')],'include':_0x1b8e32[_0x83b3('0x1b')]?_[_0x83b3('0x1d')](_0x1b8e32[_0x83b3('0x1b')],function(_0x5dbcbd){return{'model':db[_0x5dbcbd[_0x83b3('0x1c')]],'as':_0x5dbcbd['as'],'attributes':_0x5dbcbd[_0x83b3('0x19')],'include':_0x5dbcbd[_0x83b3('0x1b')]?_[_0x83b3('0x1d')](_0x5dbcbd[_0x83b3('0x1b')],function(_0x1f9553){return{'model':db[_0x1f9553[_0x83b3('0x1c')]],'as':_0x1f9553['as'],'attributes':_0x1f9553['attributes']};}):[]};}):[]};}):[]:[]})[_0x83b3('0xc')](function(_0x48cff9){logger['info'](_0x83b3('0x1e'),_0x611002);logger[_0x83b3('0x10')](_0x83b3('0x1e'),_0x611002,JSON[_0x83b3('0x11')](_0x48cff9));_0x5e68b8(_0x48cff9);})[_0x83b3('0x15')](function(_0x684eb3){logger['error'](_0x83b3('0x1e'),_0x684eb3[_0x83b3('0x14')],_0x611002);_0x1ce339(_0x5e0542[_0x83b3('0x12')](0x1f4,_0x684eb3['message']));});});};exports[_0x83b3('0x1f')]=function(_0x136763){var _0xeb1449=this;return new Promise(function(_0x2e94da,_0x483db7){return db[_0x83b3('0x16')][_0x83b3('0x20')]({'raw':_0x136763[_0x83b3('0x18')]?_0x136763[_0x83b3('0x18')][_0x83b3('0x21')]===undefined?!![]:![]:!![],'where':_0x136763[_0x83b3('0x18')]?_0x136763[_0x83b3('0x18')]['where']||null:null,'attributes':_0x136763[_0x83b3('0x18')]?_0x136763['options'][_0x83b3('0x19')]||null:null,'include':_0x136763[_0x83b3('0x18')]?_0x136763['options']['include']?_['map'](_0x136763[_0x83b3('0x18')][_0x83b3('0x1b')],function(_0x518211){return{'model':db[_0x518211[_0x83b3('0x1c')]],'as':_0x518211['as'],'attributes':_0x518211[_0x83b3('0x19')],'include':_0x518211[_0x83b3('0x1b')]?_[_0x83b3('0x1d')](_0x518211['include'],function(_0x2a676f){return{'model':db[_0x2a676f[_0x83b3('0x1c')]],'as':_0x2a676f['as'],'attributes':_0x2a676f['attributes'],'include':_0x2a676f[_0x83b3('0x1b')]?_['map'](_0x2a676f['include'],function(_0x2aa1ef){return{'model':db[_0x2aa1ef[_0x83b3('0x1c')]],'as':_0x2aa1ef['as'],'attributes':_0x2aa1ef[_0x83b3('0x19')]};}):[]};}):[]};}):[]:[]})[_0x83b3('0xc')](function(_0x26dd93){logger[_0x83b3('0xd')](_0x83b3('0x1f'),_0x136763);logger[_0x83b3('0x10')](_0x83b3('0x1f'),_0x136763,JSON['stringify'](_0x26dd93));_0x2e94da(_0x26dd93);})[_0x83b3('0x15')](function(_0x1ab929){logger[_0x83b3('0x12')]('ShowServicenowAccount',_0x1ab929[_0x83b3('0x14')],_0x136763);_0x483db7(_0xeb1449['error'](0x1f4,_0x1ab929[_0x83b3('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 4b13a8a..c935e28 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 _0x28e6=['get','isAuthenticated','/:id','show','getFields','/:id/subjects','/:id/descriptions','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intServicenowConfiguration.controller'];(function(_0x4acfd2,_0x5b9374){var _0x12afbe=function(_0x5bc178){while(--_0x5bc178){_0x4acfd2['push'](_0x4acfd2['shift']());}};_0x12afbe(++_0x5b9374);}(_0x28e6,0x1d7));var _0x628e=function(_0x40d01a,_0x53bbaf){_0x40d01a=_0x40d01a-0x0;var _0x193b00=_0x28e6[_0x40d01a];return _0x193b00;};'use strict';var multer=require(_0x628e('0x0'));var util=require('util');var path=require(_0x628e('0x1'));var timeout=require(_0x628e('0x2'));var express=require(_0x628e('0x3'));var router=express[_0x628e('0x4')]();var fs_extra=require(_0x628e('0x5'));var auth=require(_0x628e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x628e('0x7'));var controller=require(_0x628e('0x8'));router[_0x628e('0x9')]('/',auth[_0x628e('0xa')](),controller['index']);router[_0x628e('0x9')](_0x628e('0xb'),auth['isAuthenticated'](),controller[_0x628e('0xc')]);router[_0x628e('0x9')]('/:id/fields',auth[_0x628e('0xa')](),controller[_0x628e('0xd')]);router[_0x628e('0x9')](_0x628e('0xe'),auth[_0x628e('0xa')](),controller['getSubjects']);router[_0x628e('0x9')](_0x628e('0xf'),auth[_0x628e('0xa')](),controller['getDescriptions']);router['post']('/',auth[_0x628e('0xa')](),controller['create']);router[_0x628e('0x10')](_0x628e('0xb'),auth[_0x628e('0xa')](),controller['update']);router[_0x628e('0x11')](_0x628e('0xb'),auth['isAuthenticated'](),controller[_0x628e('0x12')]);module[_0x628e('0x13')]=router; \ No newline at end of file +var _0xdd93=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','getDescriptions','put','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service'];(function(_0x18beac,_0x5cbcb2){var _0x592b90=function(_0x59598c){while(--_0x59598c){_0x18beac['push'](_0x18beac['shift']());}};_0x592b90(++_0x5cbcb2);}(_0xdd93,0xcd));var _0x3dd9=function(_0x5b3dcc,_0x1d052e){_0x5b3dcc=_0x5b3dcc-0x0;var _0x3c0a03=_0xdd93[_0x5b3dcc];return _0x3c0a03;};'use strict';var multer=require('multer');var util=require(_0x3dd9('0x0'));var path=require(_0x3dd9('0x1'));var timeout=require('connect-timeout');var express=require(_0x3dd9('0x2'));var router=express[_0x3dd9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3dd9('0x4'));var interaction=require(_0x3dd9('0x5'));var config=require(_0x3dd9('0x6'));var controller=require('./intServicenowConfiguration.controller');router[_0x3dd9('0x7')]('/',auth[_0x3dd9('0x8')](),controller[_0x3dd9('0x9')]);router[_0x3dd9('0x7')](_0x3dd9('0xa'),auth['isAuthenticated'](),controller[_0x3dd9('0xb')]);router['get']('/:id/fields',auth[_0x3dd9('0x8')](),controller[_0x3dd9('0xc')]);router[_0x3dd9('0x7')](_0x3dd9('0xd'),auth[_0x3dd9('0x8')](),controller[_0x3dd9('0xe')]);router['get']('/:id/descriptions',auth[_0x3dd9('0x8')](),controller[_0x3dd9('0xf')]);router['post']('/',auth[_0x3dd9('0x8')](),controller['create']);router[_0x3dd9('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x3dd9('0x11')]);router[_0x3dd9('0x12')](_0x3dd9('0xa'),auth[_0x3dd9('0x8')](),controller[_0x3dd9('0x13')]);module[_0x3dd9('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 4ac6f27..c641d1f 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 _0x96f3=['STRING','sequelize','exports'];(function(_0x3a93ca,_0x5d3c54){var _0x44d100=function(_0x114a7e){while(--_0x114a7e){_0x3a93ca['push'](_0x3a93ca['shift']());}};_0x44d100(++_0x5d3c54);}(_0x96f3,0x157));var _0x396f=function(_0x59a627,_0x22a0e8){_0x59a627=_0x59a627-0x0;var _0x471f6d=_0x96f3[_0x59a627];return _0x471f6d;};'use strict';var Sequelize=require(_0x396f('0x0'));module[_0x396f('0x1')]={'name':{'type':Sequelize[_0x396f('0x2')]},'description':{'type':Sequelize[_0x396f('0x2')]}}; \ No newline at end of file +var _0x993c=['exports','STRING'];(function(_0x47c169,_0xef525){var _0xeffa1e=function(_0x4cfbf3){while(--_0x4cfbf3){_0x47c169['push'](_0x47c169['shift']());}};_0xeffa1e(++_0xef525);}(_0x993c,0xfc));var _0xc993=function(_0x4c14c7,_0x5008b6){_0x4c14c7=_0x4c14c7-0x0;var _0x557f9a=_0x993c[_0x4c14c7];return _0x557f9a;};'use strict';var Sequelize=require('sequelize');module[_0xc993('0x0')]={'name':{'type':Sequelize[_0xc993('0x1')]},'description':{'type':Sequelize[_0xc993('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 1a2b685..e7d72eb 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 _0x95a3=['filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','query','merge','type','VIRTUAL','filter','options','include','catch','show','includeAll','find','params','getFields','ServicenowField','getSubjects','findOne','order','getDescriptions','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','key','keys'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x95a3,0xbd));var _0x395a=function(_0xc47b76,_0x2e65f5){_0xc47b76=_0xc47b76-0x0;var _0x2aa932=_0x95a3[_0xc47b76];return _0x2aa932;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x395a('0x0'));var zipdir=require(_0x395a('0x1'));var jsonpatch=require(_0x395a('0x2'));var rp=require('request-promise');var moment=require(_0x395a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x395a('0x4'));var util=require(_0x395a('0x5'));var path=require(_0x395a('0x6'));var sox=require(_0x395a('0x7'));var csv=require(_0x395a('0x8'));var ejs=require(_0x395a('0x9'));var fs=require('fs');var fs_extra=require(_0x395a('0xa'));var _=require(_0x395a('0xb'));var squel=require(_0x395a('0xc'));var crypto=require(_0x395a('0xd'));var jsforce=require(_0x395a('0xe'));var deskjs=require(_0x395a('0xf'));var toCsv=require('to-csv');var querystring=require(_0x395a('0x10'));var Papa=require(_0x395a('0x11'));var Redis=require(_0x395a('0x12'));var authService=require(_0x395a('0x13'));var qs=require(_0x395a('0x14'));var as=require(_0x395a('0x15'));var hardwareService=require(_0x395a('0x16'));var logger=require(_0x395a('0x17'))(_0x395a('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x395a('0x19'));var db=require(_0x395a('0x1a'))['db'];function respondWithStatusCode(_0x5485c0,_0x50faee){_0x50faee=_0x50faee||0xcc;return function(_0xf10f92){if(_0xf10f92){return _0x5485c0['sendStatus'](_0x50faee);}return _0x5485c0[_0x395a('0x1b')](_0x50faee)[_0x395a('0x1c')]();};}function respondWithResult(_0x200761,_0x25908e){_0x25908e=_0x25908e||0xc8;return function(_0x362f0c){if(_0x362f0c){return _0x200761[_0x395a('0x1b')](_0x25908e)[_0x395a('0x1d')](_0x362f0c);}};}function respondWithFilteredResult(_0x4e27cf,_0x467d9d){return function(_0x375df1){if(_0x375df1){var _0x19b3b5=typeof _0x467d9d['offset']===_0x395a('0x1e')&&typeof _0x467d9d[_0x395a('0x1f')]==='undefined';var _0xbf14e2=_0x375df1[_0x395a('0x20')];var _0x51a37b=_0x19b3b5?0x0:_0x467d9d[_0x395a('0x21')];var _0x49f62b=_0x19b3b5?_0x375df1['count']:_0x467d9d[_0x395a('0x21')]+_0x467d9d[_0x395a('0x1f')];var _0xc4300f;if(_0x49f62b>=_0xbf14e2){_0x49f62b=_0xbf14e2;_0xc4300f=0xc8;}else{_0xc4300f=0xce;}_0x4e27cf[_0x395a('0x1b')](_0xc4300f);return _0x4e27cf['set'](_0x395a('0x22'),_0x51a37b+'-'+_0x49f62b+'/'+_0xbf14e2)[_0x395a('0x1d')](_0x375df1);}return null;};}function patchUpdates(_0x45ab04){return function(_0x427736){try{jsonpatch[_0x395a('0x23')](_0x427736,_0x45ab04,!![]);}catch(_0x532f71){return BPromise['reject'](_0x532f71);}return _0x427736[_0x395a('0x24')]();};}function saveUpdates(_0xdb4cba,_0x1a3fa8){return function(_0x3a5849){if(_0x3a5849){return _0x3a5849[_0x395a('0x25')](_0xdb4cba)[_0x395a('0x26')](function(_0x50adb9){return _0x50adb9;});}return null;};}function removeEntity(_0x5e3478,_0x39d9d0){return function(_0x40b0b2){if(_0x40b0b2){return _0x40b0b2[_0x395a('0x27')]()[_0x395a('0x26')](function(){_0x5e3478['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x44e035,_0x56e125){return function(_0x9d0b5d){if(!_0x9d0b5d){_0x44e035[_0x395a('0x28')](0x194);}return _0x9d0b5d;};}function handleError(_0x219385,_0x482b52){_0x482b52=_0x482b52||0x1f4;return function(_0x321dee){logger[_0x395a('0x29')](_0x321dee[_0x395a('0x2a')]);if(_0x321dee[_0x395a('0x2b')]){delete _0x321dee['name'];}_0x219385[_0x395a('0x1b')](_0x482b52)[_0x395a('0x2c')](_0x321dee);};}exports[_0x395a('0x2d')]=function(_0x3394ea,_0x311f60){var _0x38ede2={},_0x341939={},_0x2f179f={'count':0x0,'rows':[]};var _0x1391ea=_[_0x395a('0x2e')](db[_0x395a('0x2f')][_0x395a('0x30')],function(_0x35bb5b){return{'name':_0x35bb5b['fieldName'],'type':_0x35bb5b['type'][_0x395a('0x31')]};});_0x341939['model']=_['map'](_0x1391ea,_0x395a('0x2b'));_0x341939['query']=_[_0x395a('0x32')](_0x3394ea['query']);_0x341939[_0x395a('0x33')]=_[_0x395a('0x34')](_0x341939['model'],_0x341939['query']);_0x38ede2['attributes']=_[_0x395a('0x34')](_0x341939[_0x395a('0x35')],qs[_0x395a('0x36')](_0x3394ea['query']['fields']));_0x38ede2[_0x395a('0x37')]=_0x38ede2[_0x395a('0x37')][_0x395a('0x38')]?_0x38ede2['attributes']:_0x341939['model'];if(!_0x3394ea['query'][_0x395a('0x39')](_0x395a('0x3a'))){_0x38ede2[_0x395a('0x1f')]=qs['limit'](_0x3394ea['query'][_0x395a('0x1f')]);_0x38ede2[_0x395a('0x21')]=qs[_0x395a('0x21')](_0x3394ea['query'][_0x395a('0x21')]);}_0x38ede2['order']=qs[_0x395a('0x3b')](_0x3394ea['query'][_0x395a('0x3b')]);_0x38ede2[_0x395a('0x3c')]=qs[_0x395a('0x33')](_[_0x395a('0x3d')](_0x3394ea[_0x395a('0x3e')],_0x341939[_0x395a('0x33')]),_0x1391ea);if(_0x3394ea[_0x395a('0x3e')]['filter']){_0x38ede2[_0x395a('0x3c')]=_[_0x395a('0x3f')](_0x38ede2['where'],{'$or':_[_0x395a('0x2e')](_0x1391ea,function(_0x420cca){if(_0x420cca[_0x395a('0x40')]!==_0x395a('0x41')){var _0x643c43={};_0x643c43[_0x420cca[_0x395a('0x2b')]]={'$like':'%'+_0x3394ea['query'][_0x395a('0x42')]+'%'};return _0x643c43;}})});}_0x38ede2=_[_0x395a('0x3f')]({},_0x38ede2,_0x3394ea[_0x395a('0x43')]);var _0x338190={'where':_0x38ede2[_0x395a('0x3c')]};return db[_0x395a('0x2f')][_0x395a('0x20')](_0x338190)['then'](function(_0x48d152){_0x2f179f[_0x395a('0x20')]=_0x48d152;if(_0x3394ea[_0x395a('0x3e')]['includeAll']){_0x38ede2[_0x395a('0x44')]=[{'all':!![]}];}return db[_0x395a('0x2f')]['findAll'](_0x38ede2);})['then'](function(_0x57f24b){_0x2f179f['rows']=_0x57f24b;return _0x2f179f;})[_0x395a('0x26')](respondWithFilteredResult(_0x311f60,_0x38ede2))[_0x395a('0x45')](handleError(_0x311f60,null));};exports[_0x395a('0x46')]=function(_0x134fb0,_0x529c51){var _0x425fa9={'raw':![],'where':{'id':_0x134fb0['params']['id']}},_0xef306c={};_0xef306c['model']=_[_0x395a('0x32')](db[_0x395a('0x2f')][_0x395a('0x30')]);_0xef306c[_0x395a('0x3e')]=_['keys'](_0x134fb0[_0x395a('0x3e')]);_0xef306c[_0x395a('0x33')]=_[_0x395a('0x34')](_0xef306c[_0x395a('0x35')],_0xef306c['query']);_0x425fa9[_0x395a('0x37')]=_['intersection'](_0xef306c['model'],qs[_0x395a('0x36')](_0x134fb0[_0x395a('0x3e')][_0x395a('0x36')]));_0x425fa9['attributes']=_0x425fa9['attributes'][_0x395a('0x38')]?_0x425fa9[_0x395a('0x37')]:_0xef306c['model'];if(_0x134fb0[_0x395a('0x3e')][_0x395a('0x47')]){_0x425fa9[_0x395a('0x44')]=[{'all':!![]}];}_0x425fa9=_['merge']({},_0x425fa9,_0x134fb0[_0x395a('0x43')]);return db[_0x395a('0x2f')]['find'](_0x425fa9)[_0x395a('0x26')](handleEntityNotFound(_0x529c51,null))[_0x395a('0x26')](respondWithResult(_0x529c51,null))[_0x395a('0x45')](handleError(_0x529c51,null));};exports['create']=function(_0x114dc7,_0x1b21e4){return db['ServicenowConfiguration']['create'](_0x114dc7['body'],{})[_0x395a('0x26')](respondWithResult(_0x1b21e4,0xc9))[_0x395a('0x45')](handleError(_0x1b21e4,null));};exports[_0x395a('0x25')]=function(_0x101681,_0x14e74){if(_0x101681['body']['id']){delete _0x101681['body']['id'];}return db[_0x395a('0x2f')][_0x395a('0x48')]({'where':{'id':_0x101681[_0x395a('0x49')]['id']}})[_0x395a('0x26')](handleEntityNotFound(_0x14e74,null))[_0x395a('0x26')](saveUpdates(_0x101681['body'],null))[_0x395a('0x26')](respondWithResult(_0x14e74,null))[_0x395a('0x45')](handleError(_0x14e74,null));};exports[_0x395a('0x27')]=function(_0x4d93b8,_0x12facf){return db[_0x395a('0x2f')]['find']({'where':{'id':_0x4d93b8['params']['id']}})[_0x395a('0x26')](handleEntityNotFound(_0x12facf,null))[_0x395a('0x26')](removeEntity(_0x12facf,null))[_0x395a('0x45')](handleError(_0x12facf,null));};exports[_0x395a('0x4a')]=function(_0x594909,_0x1281e9,_0x449825){var _0x53599b={};var _0x5cbcc6={};var _0x45e382;var _0x26a9b5;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x594909[_0x395a('0x49')]['id']}})[_0x395a('0x26')](handleEntityNotFound(_0x1281e9,null))[_0x395a('0x26')](function(_0x4d1bfb){if(_0x4d1bfb){_0x45e382=_0x4d1bfb;_0x5cbcc6['model']=_[_0x395a('0x32')](db[_0x395a('0x4b')]['rawAttributes']);_0x5cbcc6['query']=_[_0x395a('0x32')](_0x594909['query']);_0x5cbcc6['filters']=_[_0x395a('0x34')](_0x5cbcc6[_0x395a('0x35')],_0x5cbcc6[_0x395a('0x3e')]);_0x53599b['attributes']=_[_0x395a('0x34')](_0x5cbcc6[_0x395a('0x35')],qs[_0x395a('0x36')](_0x594909[_0x395a('0x3e')]['fields']));_0x53599b[_0x395a('0x37')]=_0x53599b['attributes'][_0x395a('0x38')]?_0x53599b[_0x395a('0x37')]:_0x5cbcc6['model'];_0x53599b['order']=qs[_0x395a('0x3b')](_0x594909[_0x395a('0x3e')]['sort']);_0x53599b['where']=qs['filters'](_['pick'](_0x594909[_0x395a('0x3e')],_0x5cbcc6[_0x395a('0x33')]));if(_0x594909[_0x395a('0x3e')][_0x395a('0x42')]){_0x53599b[_0x395a('0x3c')]=_[_0x395a('0x3f')](_0x53599b[_0x395a('0x3c')],{'$or':_['map'](_0x53599b['attributes'],function(_0x363d84){var _0x401966={};_0x401966[_0x363d84]={'$like':'%'+_0x594909[_0x395a('0x3e')][_0x395a('0x42')]+'%'};return _0x401966;})});}_0x53599b=_[_0x395a('0x3f')]({},_0x53599b,_0x594909['options']);return _0x45e382[_0x395a('0x4a')](_0x53599b);}})[_0x395a('0x26')](function(_0x3ab0a7){if(_0x3ab0a7){_0x26a9b5=_0x3ab0a7['length'];if(!_0x594909[_0x395a('0x3e')]['hasOwnProperty'](_0x395a('0x3a'))){_0x53599b[_0x395a('0x1f')]=qs['limit'](_0x594909[_0x395a('0x3e')][_0x395a('0x1f')]);_0x53599b['offset']=qs[_0x395a('0x21')](_0x594909['query'][_0x395a('0x21')]);}return _0x45e382['getFields'](_0x53599b);}})[_0x395a('0x26')](function(_0x1cd33c){if(_0x1cd33c){return _0x1cd33c?{'count':_0x26a9b5,'rows':_0x1cd33c}:null;}})['then'](respondWithResult(_0x1281e9,null))[_0x395a('0x45')](handleError(_0x1281e9,null));};exports[_0x395a('0x4c')]=function(_0xcd2bcc,_0xda7cd6,_0x3fb93f){var _0x20a262={};var _0x11066e={};var _0x5d9f70;var _0x4c7883;return db[_0x395a('0x2f')][_0x395a('0x4d')]({'where':{'id':_0xcd2bcc['params']['id']}})[_0x395a('0x26')](handleEntityNotFound(_0xda7cd6,null))[_0x395a('0x26')](function(_0x2f5747){if(_0x2f5747){_0x5d9f70=_0x2f5747;_0x11066e[_0x395a('0x35')]=_[_0x395a('0x32')](db['ServicenowField']['rawAttributes']);_0x11066e[_0x395a('0x3e')]=_[_0x395a('0x32')](_0xcd2bcc['query']);_0x11066e[_0x395a('0x33')]=_[_0x395a('0x34')](_0x11066e[_0x395a('0x35')],_0x11066e[_0x395a('0x3e')]);_0x20a262[_0x395a('0x37')]=_[_0x395a('0x34')](_0x11066e[_0x395a('0x35')],qs[_0x395a('0x36')](_0xcd2bcc['query'][_0x395a('0x36')]));_0x20a262[_0x395a('0x37')]=_0x20a262[_0x395a('0x37')]['length']?_0x20a262[_0x395a('0x37')]:_0x11066e[_0x395a('0x35')];_0x20a262[_0x395a('0x4e')]=qs['sort'](_0xcd2bcc[_0x395a('0x3e')][_0x395a('0x3b')]);_0x20a262['where']=qs[_0x395a('0x33')](_['pick'](_0xcd2bcc[_0x395a('0x3e')],_0x11066e['filters']));if(_0xcd2bcc[_0x395a('0x3e')][_0x395a('0x42')]){_0x20a262['where']=_[_0x395a('0x3f')](_0x20a262[_0x395a('0x3c')],{'$or':_[_0x395a('0x2e')](_0x20a262['attributes'],function(_0x5d9b66){var _0x53cd40={};_0x53cd40[_0x5d9b66]={'$like':'%'+_0xcd2bcc[_0x395a('0x3e')][_0x395a('0x42')]+'%'};return _0x53cd40;})});}_0x20a262=_[_0x395a('0x3f')]({},_0x20a262,_0xcd2bcc[_0x395a('0x43')]);return _0x5d9f70[_0x395a('0x4c')](_0x20a262);}})[_0x395a('0x26')](function(_0x19c1d0){if(_0x19c1d0){_0x4c7883=_0x19c1d0[_0x395a('0x38')];if(!_0xcd2bcc[_0x395a('0x3e')]['hasOwnProperty'](_0x395a('0x3a'))){_0x20a262[_0x395a('0x1f')]=qs[_0x395a('0x1f')](_0xcd2bcc[_0x395a('0x3e')]['limit']);_0x20a262[_0x395a('0x21')]=qs['offset'](_0xcd2bcc[_0x395a('0x3e')][_0x395a('0x21')]);}return _0x5d9f70[_0x395a('0x4c')](_0x20a262);}})[_0x395a('0x26')](function(_0x5c5572){if(_0x5c5572){return _0x5c5572?{'count':_0x4c7883,'rows':_0x5c5572}:null;}})[_0x395a('0x26')](respondWithResult(_0xda7cd6,null))[_0x395a('0x45')](handleError(_0xda7cd6,null));};exports[_0x395a('0x4f')]=function(_0xe96e5c,_0x11f176,_0x33b9d4){var _0x199ffb={};var _0x24cf33={};var _0x4be987;var _0x46db7d;return db[_0x395a('0x2f')]['findOne']({'where':{'id':_0xe96e5c['params']['id']}})['then'](handleEntityNotFound(_0x11f176,null))[_0x395a('0x26')](function(_0x5107f6){if(_0x5107f6){_0x4be987=_0x5107f6;_0x24cf33['model']=_[_0x395a('0x32')](db[_0x395a('0x4b')][_0x395a('0x30')]);_0x24cf33[_0x395a('0x3e')]=_['keys'](_0xe96e5c[_0x395a('0x3e')]);_0x24cf33[_0x395a('0x33')]=_['intersection'](_0x24cf33[_0x395a('0x35')],_0x24cf33[_0x395a('0x3e')]);_0x199ffb[_0x395a('0x37')]=_[_0x395a('0x34')](_0x24cf33['model'],qs[_0x395a('0x36')](_0xe96e5c['query'][_0x395a('0x36')]));_0x199ffb[_0x395a('0x37')]=_0x199ffb['attributes'][_0x395a('0x38')]?_0x199ffb[_0x395a('0x37')]:_0x24cf33['model'];_0x199ffb[_0x395a('0x4e')]=qs[_0x395a('0x3b')](_0xe96e5c['query']['sort']);_0x199ffb[_0x395a('0x3c')]=qs[_0x395a('0x33')](_[_0x395a('0x3d')](_0xe96e5c['query'],_0x24cf33[_0x395a('0x33')]));if(_0xe96e5c['query'][_0x395a('0x42')]){_0x199ffb['where']=_[_0x395a('0x3f')](_0x199ffb['where'],{'$or':_[_0x395a('0x2e')](_0x199ffb[_0x395a('0x37')],function(_0x43bd3c){var _0x2dbd24={};_0x2dbd24[_0x43bd3c]={'$like':'%'+_0xe96e5c[_0x395a('0x3e')][_0x395a('0x42')]+'%'};return _0x2dbd24;})});}_0x199ffb=_[_0x395a('0x3f')]({},_0x199ffb,_0xe96e5c[_0x395a('0x43')]);return _0x4be987[_0x395a('0x4f')](_0x199ffb);}})[_0x395a('0x26')](function(_0x48ecc2){if(_0x48ecc2){_0x46db7d=_0x48ecc2[_0x395a('0x38')];if(!_0xe96e5c[_0x395a('0x3e')]['hasOwnProperty'](_0x395a('0x3a'))){_0x199ffb[_0x395a('0x1f')]=qs['limit'](_0xe96e5c[_0x395a('0x3e')]['limit']);_0x199ffb[_0x395a('0x21')]=qs[_0x395a('0x21')](_0xe96e5c[_0x395a('0x3e')][_0x395a('0x21')]);}return _0x4be987['getDescriptions'](_0x199ffb);}})['then'](function(_0x23c331){if(_0x23c331){return _0x23c331?{'count':_0x46db7d,'rows':_0x23c331}:null;}})['then'](respondWithResult(_0x11f176,null))[_0x395a('0x45')](handleError(_0x11f176,null));}; \ No newline at end of file +var _0x3a15=['to-csv','ejs','fs-extra','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','sendStatus','status','json','offset','limit','undefined','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','type','VIRTUAL','filter','merge','count','includeAll','findAll','catch','show','params','include','options','find','create','body','getFields','findOne','ServicenowField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x3b9232,_0x268ee7){var _0x4eee34=function(_0x1a3e72){while(--_0x1a3e72){_0x3b9232['push'](_0x3b9232['shift']());}};_0x4eee34(++_0x268ee7);}(_0x3a15,0x155));var _0x53a1=function(_0x3f2e37,_0x49729a){_0x3f2e37=_0x3f2e37-0x0;var _0x1a468e=_0x3a15[_0x3f2e37];return _0x1a468e;};'use strict';var emlformat=require(_0x53a1('0x0'));var rimraf=require(_0x53a1('0x1'));var zipdir=require(_0x53a1('0x2'));var jsonpatch=require(_0x53a1('0x3'));var rp=require(_0x53a1('0x4'));var moment=require(_0x53a1('0x5'));var BPromise=require(_0x53a1('0x6'));var Mustache=require(_0x53a1('0x7'));var util=require(_0x53a1('0x8'));var path=require(_0x53a1('0x9'));var sox=require(_0x53a1('0xa'));var csv=require(_0x53a1('0xb'));var ejs=require(_0x53a1('0xc'));var fs=require('fs');var fs_extra=require(_0x53a1('0xd'));var _=require(_0x53a1('0xe'));var squel=require(_0x53a1('0xf'));var crypto=require(_0x53a1('0x10'));var jsforce=require(_0x53a1('0x11'));var deskjs=require(_0x53a1('0x12'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x53a1('0x13'));var Redis=require(_0x53a1('0x14'));var authService=require(_0x53a1('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x53a1('0x16'));var hardwareService=require(_0x53a1('0x17'));var logger=require(_0x53a1('0x18'))(_0x53a1('0x19'));var utils=require(_0x53a1('0x1a'));var config=require(_0x53a1('0x1b'));var licenseUtil=require(_0x53a1('0x1c'));var db=require(_0x53a1('0x1d'))['db'];function respondWithStatusCode(_0x20c3f1,_0x39f46d){_0x39f46d=_0x39f46d||0xcc;return function(_0x59b06d){if(_0x59b06d){return _0x20c3f1[_0x53a1('0x1e')](_0x39f46d);}return _0x20c3f1[_0x53a1('0x1f')](_0x39f46d)['end']();};}function respondWithResult(_0x2d5a47,_0x3f1435){_0x3f1435=_0x3f1435||0xc8;return function(_0x2215d8){if(_0x2215d8){return _0x2d5a47[_0x53a1('0x1f')](_0x3f1435)[_0x53a1('0x20')](_0x2215d8);}};}function respondWithFilteredResult(_0x486cd0,_0x510d2b){return function(_0x47007d){if(_0x47007d){var _0x198d42=typeof _0x510d2b[_0x53a1('0x21')]==='undefined'&&typeof _0x510d2b[_0x53a1('0x22')]===_0x53a1('0x23');var _0x2f8000=_0x47007d['count'];var _0x294f42=_0x198d42?0x0:_0x510d2b[_0x53a1('0x21')];var _0x62e5d4=_0x198d42?_0x47007d['count']:_0x510d2b[_0x53a1('0x21')]+_0x510d2b[_0x53a1('0x22')];var _0x259bc2;if(_0x62e5d4>=_0x2f8000){_0x62e5d4=_0x2f8000;_0x259bc2=0xc8;}else{_0x259bc2=0xce;}_0x486cd0[_0x53a1('0x1f')](_0x259bc2);return _0x486cd0[_0x53a1('0x24')](_0x53a1('0x25'),_0x294f42+'-'+_0x62e5d4+'/'+_0x2f8000)[_0x53a1('0x20')](_0x47007d);}return null;};}function patchUpdates(_0x1826f1){return function(_0x18ac55){try{jsonpatch['apply'](_0x18ac55,_0x1826f1,!![]);}catch(_0xce53f0){return BPromise[_0x53a1('0x26')](_0xce53f0);}return _0x18ac55[_0x53a1('0x27')]();};}function saveUpdates(_0x352fa2,_0x33d8da){return function(_0x7f9e20){if(_0x7f9e20){return _0x7f9e20[_0x53a1('0x28')](_0x352fa2)[_0x53a1('0x29')](function(_0x5430c3){return _0x5430c3;});}return null;};}function removeEntity(_0x328dff,_0x309663){return function(_0x23108a){if(_0x23108a){return _0x23108a[_0x53a1('0x2a')]()[_0x53a1('0x29')](function(){_0x328dff[_0x53a1('0x1f')](0xcc)[_0x53a1('0x2b')]();});}};}function handleEntityNotFound(_0x1df4b8,_0x5cd628){return function(_0x37a971){if(!_0x37a971){_0x1df4b8[_0x53a1('0x1e')](0x194);}return _0x37a971;};}function handleError(_0x4ae88f,_0x28769e){_0x28769e=_0x28769e||0x1f4;return function(_0x305406){logger[_0x53a1('0x2c')](_0x305406[_0x53a1('0x2d')]);if(_0x305406['name']){delete _0x305406[_0x53a1('0x2e')];}_0x4ae88f[_0x53a1('0x1f')](_0x28769e)[_0x53a1('0x2f')](_0x305406);};}exports[_0x53a1('0x30')]=function(_0x54afe1,_0x223dc1){var _0x46dd7f={},_0x383cfd={},_0x11dae4={'count':0x0,'rows':[]};var _0x284886=_[_0x53a1('0x31')](db[_0x53a1('0x32')][_0x53a1('0x33')],function(_0x281a16){return{'name':_0x281a16[_0x53a1('0x34')],'type':_0x281a16['type'][_0x53a1('0x35')]};});_0x383cfd[_0x53a1('0x36')]=_['map'](_0x284886,_0x53a1('0x2e'));_0x383cfd[_0x53a1('0x37')]=_[_0x53a1('0x38')](_0x54afe1[_0x53a1('0x37')]);_0x383cfd['filters']=_[_0x53a1('0x39')](_0x383cfd[_0x53a1('0x36')],_0x383cfd[_0x53a1('0x37')]);_0x46dd7f[_0x53a1('0x3a')]=_[_0x53a1('0x39')](_0x383cfd[_0x53a1('0x36')],qs[_0x53a1('0x3b')](_0x54afe1[_0x53a1('0x37')]['fields']));_0x46dd7f[_0x53a1('0x3a')]=_0x46dd7f['attributes'][_0x53a1('0x3c')]?_0x46dd7f['attributes']:_0x383cfd[_0x53a1('0x36')];if(!_0x54afe1[_0x53a1('0x37')][_0x53a1('0x3d')](_0x53a1('0x3e'))){_0x46dd7f[_0x53a1('0x22')]=qs['limit'](_0x54afe1[_0x53a1('0x37')][_0x53a1('0x22')]);_0x46dd7f['offset']=qs['offset'](_0x54afe1[_0x53a1('0x37')]['offset']);}_0x46dd7f[_0x53a1('0x3f')]=qs[_0x53a1('0x40')](_0x54afe1['query']['sort']);_0x46dd7f[_0x53a1('0x41')]=qs[_0x53a1('0x42')](_[_0x53a1('0x43')](_0x54afe1['query'],_0x383cfd[_0x53a1('0x42')]),_0x284886);if(_0x54afe1[_0x53a1('0x37')]['filter']){_0x46dd7f['where']=_['merge'](_0x46dd7f[_0x53a1('0x41')],{'$or':_[_0x53a1('0x31')](_0x284886,function(_0x3bc284){if(_0x3bc284[_0x53a1('0x44')]!==_0x53a1('0x45')){var _0x515606={};_0x515606[_0x3bc284[_0x53a1('0x2e')]]={'$like':'%'+_0x54afe1[_0x53a1('0x37')][_0x53a1('0x46')]+'%'};return _0x515606;}})});}_0x46dd7f=_[_0x53a1('0x47')]({},_0x46dd7f,_0x54afe1['options']);var _0x576ff0={'where':_0x46dd7f[_0x53a1('0x41')]};return db[_0x53a1('0x32')][_0x53a1('0x48')](_0x576ff0)[_0x53a1('0x29')](function(_0x58a909){_0x11dae4[_0x53a1('0x48')]=_0x58a909;if(_0x54afe1['query'][_0x53a1('0x49')]){_0x46dd7f['include']=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x53a1('0x4a')](_0x46dd7f);})[_0x53a1('0x29')](function(_0x32c890){_0x11dae4['rows']=_0x32c890;return _0x11dae4;})[_0x53a1('0x29')](respondWithFilteredResult(_0x223dc1,_0x46dd7f))[_0x53a1('0x4b')](handleError(_0x223dc1,null));};exports[_0x53a1('0x4c')]=function(_0x21fc41,_0x487632){var _0x186279={'raw':![],'where':{'id':_0x21fc41[_0x53a1('0x4d')]['id']}},_0x2893ed={};_0x2893ed['model']=_[_0x53a1('0x38')](db[_0x53a1('0x32')][_0x53a1('0x33')]);_0x2893ed[_0x53a1('0x37')]=_[_0x53a1('0x38')](_0x21fc41['query']);_0x2893ed[_0x53a1('0x42')]=_[_0x53a1('0x39')](_0x2893ed[_0x53a1('0x36')],_0x2893ed['query']);_0x186279[_0x53a1('0x3a')]=_[_0x53a1('0x39')](_0x2893ed[_0x53a1('0x36')],qs[_0x53a1('0x3b')](_0x21fc41['query'][_0x53a1('0x3b')]));_0x186279['attributes']=_0x186279['attributes'][_0x53a1('0x3c')]?_0x186279[_0x53a1('0x3a')]:_0x2893ed['model'];if(_0x21fc41['query'][_0x53a1('0x49')]){_0x186279[_0x53a1('0x4e')]=[{'all':!![]}];}_0x186279=_[_0x53a1('0x47')]({},_0x186279,_0x21fc41[_0x53a1('0x4f')]);return db[_0x53a1('0x32')][_0x53a1('0x50')](_0x186279)['then'](handleEntityNotFound(_0x487632,null))['then'](respondWithResult(_0x487632,null))[_0x53a1('0x4b')](handleError(_0x487632,null));};exports[_0x53a1('0x51')]=function(_0x297fde,_0x2509de){return db[_0x53a1('0x32')]['create'](_0x297fde[_0x53a1('0x52')],{})['then'](respondWithResult(_0x2509de,0xc9))[_0x53a1('0x4b')](handleError(_0x2509de,null));};exports[_0x53a1('0x28')]=function(_0x5a45f9,_0x125bbc){if(_0x5a45f9['body']['id']){delete _0x5a45f9[_0x53a1('0x52')]['id'];}return db[_0x53a1('0x32')][_0x53a1('0x50')]({'where':{'id':_0x5a45f9[_0x53a1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x125bbc,null))['then'](saveUpdates(_0x5a45f9[_0x53a1('0x52')],null))[_0x53a1('0x29')](respondWithResult(_0x125bbc,null))[_0x53a1('0x4b')](handleError(_0x125bbc,null));};exports['destroy']=function(_0x1bd590,_0x1c83db){return db[_0x53a1('0x32')][_0x53a1('0x50')]({'where':{'id':_0x1bd590['params']['id']}})[_0x53a1('0x29')](handleEntityNotFound(_0x1c83db,null))[_0x53a1('0x29')](removeEntity(_0x1c83db,null))[_0x53a1('0x4b')](handleError(_0x1c83db,null));};exports[_0x53a1('0x53')]=function(_0x5c6ff9,_0x295021,_0x4c7a64){var _0x11c028={};var _0x2eeb24={};var _0x1219be;var _0x3c9a25;return db[_0x53a1('0x32')][_0x53a1('0x54')]({'where':{'id':_0x5c6ff9[_0x53a1('0x4d')]['id']}})[_0x53a1('0x29')](handleEntityNotFound(_0x295021,null))[_0x53a1('0x29')](function(_0x2cdee8){if(_0x2cdee8){_0x1219be=_0x2cdee8;_0x2eeb24[_0x53a1('0x36')]=_[_0x53a1('0x38')](db[_0x53a1('0x55')][_0x53a1('0x33')]);_0x2eeb24[_0x53a1('0x37')]=_[_0x53a1('0x38')](_0x5c6ff9['query']);_0x2eeb24[_0x53a1('0x42')]=_[_0x53a1('0x39')](_0x2eeb24['model'],_0x2eeb24[_0x53a1('0x37')]);_0x11c028[_0x53a1('0x3a')]=_[_0x53a1('0x39')](_0x2eeb24[_0x53a1('0x36')],qs['fields'](_0x5c6ff9['query'][_0x53a1('0x3b')]));_0x11c028[_0x53a1('0x3a')]=_0x11c028[_0x53a1('0x3a')][_0x53a1('0x3c')]?_0x11c028[_0x53a1('0x3a')]:_0x2eeb24[_0x53a1('0x36')];_0x11c028[_0x53a1('0x3f')]=qs[_0x53a1('0x40')](_0x5c6ff9[_0x53a1('0x37')][_0x53a1('0x40')]);_0x11c028[_0x53a1('0x41')]=qs[_0x53a1('0x42')](_[_0x53a1('0x43')](_0x5c6ff9[_0x53a1('0x37')],_0x2eeb24[_0x53a1('0x42')]));if(_0x5c6ff9['query'][_0x53a1('0x46')]){_0x11c028['where']=_[_0x53a1('0x47')](_0x11c028[_0x53a1('0x41')],{'$or':_[_0x53a1('0x31')](_0x11c028[_0x53a1('0x3a')],function(_0x56f2ab){var _0x286b8b={};_0x286b8b[_0x56f2ab]={'$like':'%'+_0x5c6ff9['query']['filter']+'%'};return _0x286b8b;})});}_0x11c028=_[_0x53a1('0x47')]({},_0x11c028,_0x5c6ff9[_0x53a1('0x4f')]);return _0x1219be[_0x53a1('0x53')](_0x11c028);}})[_0x53a1('0x29')](function(_0x24c833){if(_0x24c833){_0x3c9a25=_0x24c833[_0x53a1('0x3c')];if(!_0x5c6ff9[_0x53a1('0x37')]['hasOwnProperty'](_0x53a1('0x3e'))){_0x11c028[_0x53a1('0x22')]=qs[_0x53a1('0x22')](_0x5c6ff9[_0x53a1('0x37')]['limit']);_0x11c028[_0x53a1('0x21')]=qs[_0x53a1('0x21')](_0x5c6ff9[_0x53a1('0x37')]['offset']);}return _0x1219be[_0x53a1('0x53')](_0x11c028);}})[_0x53a1('0x29')](function(_0x402af1){if(_0x402af1){return _0x402af1?{'count':_0x3c9a25,'rows':_0x402af1}:null;}})[_0x53a1('0x29')](respondWithResult(_0x295021,null))[_0x53a1('0x4b')](handleError(_0x295021,null));};exports[_0x53a1('0x56')]=function(_0x5d382b,_0x48ca05,_0x2bcd69){var _0x1a3915={};var _0x504608={};var _0xfb1e71;var _0x2ca648;return db[_0x53a1('0x32')][_0x53a1('0x54')]({'where':{'id':_0x5d382b[_0x53a1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x48ca05,null))[_0x53a1('0x29')](function(_0x229ad3){if(_0x229ad3){_0xfb1e71=_0x229ad3;_0x504608[_0x53a1('0x36')]=_[_0x53a1('0x38')](db[_0x53a1('0x55')][_0x53a1('0x33')]);_0x504608[_0x53a1('0x37')]=_[_0x53a1('0x38')](_0x5d382b[_0x53a1('0x37')]);_0x504608[_0x53a1('0x42')]=_[_0x53a1('0x39')](_0x504608[_0x53a1('0x36')],_0x504608[_0x53a1('0x37')]);_0x1a3915[_0x53a1('0x3a')]=_[_0x53a1('0x39')](_0x504608[_0x53a1('0x36')],qs['fields'](_0x5d382b['query']['fields']));_0x1a3915[_0x53a1('0x3a')]=_0x1a3915['attributes'][_0x53a1('0x3c')]?_0x1a3915[_0x53a1('0x3a')]:_0x504608[_0x53a1('0x36')];_0x1a3915[_0x53a1('0x3f')]=qs[_0x53a1('0x40')](_0x5d382b[_0x53a1('0x37')][_0x53a1('0x40')]);_0x1a3915[_0x53a1('0x41')]=qs[_0x53a1('0x42')](_[_0x53a1('0x43')](_0x5d382b[_0x53a1('0x37')],_0x504608['filters']));if(_0x5d382b[_0x53a1('0x37')][_0x53a1('0x46')]){_0x1a3915[_0x53a1('0x41')]=_['merge'](_0x1a3915[_0x53a1('0x41')],{'$or':_[_0x53a1('0x31')](_0x1a3915[_0x53a1('0x3a')],function(_0x70a6c9){var _0x55a135={};_0x55a135[_0x70a6c9]={'$like':'%'+_0x5d382b[_0x53a1('0x37')][_0x53a1('0x46')]+'%'};return _0x55a135;})});}_0x1a3915=_[_0x53a1('0x47')]({},_0x1a3915,_0x5d382b[_0x53a1('0x4f')]);return _0xfb1e71[_0x53a1('0x56')](_0x1a3915);}})[_0x53a1('0x29')](function(_0x1097bc){if(_0x1097bc){_0x2ca648=_0x1097bc[_0x53a1('0x3c')];if(!_0x5d382b['query']['hasOwnProperty'](_0x53a1('0x3e'))){_0x1a3915[_0x53a1('0x22')]=qs[_0x53a1('0x22')](_0x5d382b[_0x53a1('0x37')][_0x53a1('0x22')]);_0x1a3915[_0x53a1('0x21')]=qs[_0x53a1('0x21')](_0x5d382b[_0x53a1('0x37')]['offset']);}return _0xfb1e71[_0x53a1('0x56')](_0x1a3915);}})[_0x53a1('0x29')](function(_0x598df6){if(_0x598df6){return _0x598df6?{'count':_0x2ca648,'rows':_0x598df6}:null;}})[_0x53a1('0x29')](respondWithResult(_0x48ca05,null))['catch'](handleError(_0x48ca05,null));};exports[_0x53a1('0x57')]=function(_0xf93dea,_0xc7c769,_0x546088){var _0x53639d={};var _0x552381={};var _0x3519be;var _0x128266;return db[_0x53a1('0x32')]['findOne']({'where':{'id':_0xf93dea[_0x53a1('0x4d')]['id']}})[_0x53a1('0x29')](handleEntityNotFound(_0xc7c769,null))[_0x53a1('0x29')](function(_0x594b5a){if(_0x594b5a){_0x3519be=_0x594b5a;_0x552381['model']=_[_0x53a1('0x38')](db[_0x53a1('0x55')]['rawAttributes']);_0x552381[_0x53a1('0x37')]=_[_0x53a1('0x38')](_0xf93dea['query']);_0x552381['filters']=_['intersection'](_0x552381[_0x53a1('0x36')],_0x552381[_0x53a1('0x37')]);_0x53639d[_0x53a1('0x3a')]=_[_0x53a1('0x39')](_0x552381[_0x53a1('0x36')],qs[_0x53a1('0x3b')](_0xf93dea[_0x53a1('0x37')][_0x53a1('0x3b')]));_0x53639d[_0x53a1('0x3a')]=_0x53639d[_0x53a1('0x3a')][_0x53a1('0x3c')]?_0x53639d[_0x53a1('0x3a')]:_0x552381['model'];_0x53639d[_0x53a1('0x3f')]=qs[_0x53a1('0x40')](_0xf93dea[_0x53a1('0x37')]['sort']);_0x53639d['where']=qs[_0x53a1('0x42')](_['pick'](_0xf93dea['query'],_0x552381['filters']));if(_0xf93dea[_0x53a1('0x37')][_0x53a1('0x46')]){_0x53639d['where']=_[_0x53a1('0x47')](_0x53639d[_0x53a1('0x41')],{'$or':_[_0x53a1('0x31')](_0x53639d[_0x53a1('0x3a')],function(_0x4e1d02){var _0x2c4de7={};_0x2c4de7[_0x4e1d02]={'$like':'%'+_0xf93dea[_0x53a1('0x37')][_0x53a1('0x46')]+'%'};return _0x2c4de7;})});}_0x53639d=_[_0x53a1('0x47')]({},_0x53639d,_0xf93dea['options']);return _0x3519be[_0x53a1('0x57')](_0x53639d);}})['then'](function(_0x47ff1f){if(_0x47ff1f){_0x128266=_0x47ff1f[_0x53a1('0x3c')];if(!_0xf93dea[_0x53a1('0x37')]['hasOwnProperty'](_0x53a1('0x3e'))){_0x53639d[_0x53a1('0x22')]=qs[_0x53a1('0x22')](_0xf93dea[_0x53a1('0x37')][_0x53a1('0x22')]);_0x53639d['offset']=qs[_0x53a1('0x21')](_0xf93dea[_0x53a1('0x37')][_0x53a1('0x21')]);}return _0x3519be[_0x53a1('0x57')](_0x53639d);}})[_0x53a1('0x29')](function(_0x9ea25e){if(_0x9ea25e){return _0x9ea25e?{'count':_0x128266,'rows':_0x9ea25e}:null;}})[_0x53a1('0x29')](respondWithResult(_0xc7c769,null))[_0x53a1('0x4b')](handleError(_0xc7c769,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index b8807ba..d08a8df 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 _0x676c=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ServicenowConfiguration'];(function(_0x41da6,_0x42431b){var _0x282340=function(_0x3481f2){while(--_0x3481f2){_0x41da6['push'](_0x41da6['shift']());}};_0x282340(++_0x42431b);}(_0x676c,0x198));var _0xc676=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x676c[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xc676('0x0'));var util=require(_0xc676('0x1'));var logger=require(_0xc676('0x2'))('api');var moment=require(_0xc676('0x3'));var BPromise=require(_0xc676('0x4'));var rp=require(_0xc676('0x5'));var fs=require('fs');var path=require(_0xc676('0x6'));var rimraf=require(_0xc676('0x7'));var config=require(_0xc676('0x8'));var attributes=require('./intServicenowConfiguration.attributes');module[_0xc676('0x9')]=function(_0x228e07,_0x13c5a7){return _0x228e07[_0xc676('0xa')](_0xc676('0xb'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x19c3=['bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','define','ServicenowConfiguration','int_servicenow_configurations','lodash','../../config/logger','api'];(function(_0x48961c,_0x280e9d){var _0x1d895d=function(_0x248ffa){while(--_0x248ffa){_0x48961c['push'](_0x48961c['shift']());}};_0x1d895d(++_0x280e9d);}(_0x19c3,0xf9));var _0x319c=function(_0x5e7572,_0x38b2c6){_0x5e7572=_0x5e7572-0x0;var _0x199427=_0x19c3[_0x5e7572];return _0x199427;};'use strict';var _=require(_0x319c('0x0'));var util=require('util');var logger=require(_0x319c('0x1'))(_0x319c('0x2'));var moment=require('moment');var BPromise=require(_0x319c('0x3'));var rp=require(_0x319c('0x4'));var fs=require('fs');var path=require(_0x319c('0x5'));var rimraf=require(_0x319c('0x6'));var config=require(_0x319c('0x7'));var attributes=require(_0x319c('0x8'));module['exports']=function(_0x20f77e,_0x53a1de){return _0x20f77e[_0x319c('0x9')](_0x319c('0xa'),attributes,{'tableName':_0x319c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index 09db212..7f93ec5 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 _0xfaf3=['ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','then','info'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0xfaf3,0x118));var _0x3faf=function(_0x21a71f,_0x13a4a7){_0x21a71f=_0x21a71f-0x0;var _0x1afa63=_0xfaf3[_0x21a71f];return _0x1afa63;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x3faf('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3faf('0x1'));var db=require(_0x3faf('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x3faf('0x3'))(_0x3faf('0x4'));var config=require(_0x3faf('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3faf('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x41eb8e,_0x12cc3a,_0x1120d6){return new BPromise(function(_0xe406f3,_0x545776){return client['request'](_0x41eb8e,_0x1120d6)[_0x3faf('0x7')](function(_0xb01373){logger[_0x3faf('0x8')](_0x3faf('0x9'),_0x12cc3a,_0x3faf('0xa'));logger[_0x3faf('0xb')](_0x3faf('0xc'),_0x12cc3a,_0x3faf('0xa'),JSON[_0x3faf('0xd')](_0xb01373));if(_0xb01373['error']){if(_0xb01373[_0x3faf('0xe')]['code']===0x1f4){logger[_0x3faf('0xe')](_0x3faf('0x9'),_0x12cc3a,_0xb01373['error'][_0x3faf('0xf')]);return _0x545776(_0xb01373[_0x3faf('0xe')][_0x3faf('0xf')]);}logger[_0x3faf('0xe')](_0x3faf('0x9'),_0x12cc3a,_0xb01373['error'][_0x3faf('0xf')]);return _0xe406f3(_0xb01373[_0x3faf('0xe')][_0x3faf('0xf')]);}else{logger[_0x3faf('0x8')](_0x3faf('0x9'),_0x12cc3a,_0x3faf('0xa'));_0xe406f3(_0xb01373['result'][_0x3faf('0xf')]);}})[_0x3faf('0x10')](function(_0x5631b7){logger['error'](_0x3faf('0x9'),_0x12cc3a,_0x5631b7);_0x545776(_0x5631b7);});});} \ No newline at end of file +var _0x7b84=['util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7b84,0x167));var _0x47b8=function(_0xe2eb40,_0x141a90){_0xe2eb40=_0xe2eb40-0x0;var _0xe84acc=_0x7b84[_0xe2eb40];return _0xe84acc;};'use strict';var _=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var moment=require(_0x47b8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x47b8('0x3'));var db=require(_0x47b8('0x4'))['db'];var utils=require(_0x47b8('0x5'));var logger=require(_0x47b8('0x6'))(_0x47b8('0x7'));var config=require(_0x47b8('0x8'));var jayson=require(_0x47b8('0x9'));var client=jayson[_0x47b8('0xa')][_0x47b8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30c35b,_0x81b22f,_0x1ae3b6){return new BPromise(function(_0x129a65,_0x6ad89){return client[_0x47b8('0xc')](_0x30c35b,_0x1ae3b6)[_0x47b8('0xd')](function(_0x46267c){logger[_0x47b8('0xe')](_0x47b8('0xf'),_0x81b22f,'request\x20sent');logger['debug'](_0x47b8('0x10'),_0x81b22f,_0x47b8('0x11'),JSON[_0x47b8('0x12')](_0x46267c));if(_0x46267c[_0x47b8('0x13')]){if(_0x46267c['error'][_0x47b8('0x14')]===0x1f4){logger[_0x47b8('0x13')]('ServicenowConfiguration,\x20%s,\x20%s',_0x81b22f,_0x46267c[_0x47b8('0x13')][_0x47b8('0x15')]);return _0x6ad89(_0x46267c[_0x47b8('0x13')][_0x47b8('0x15')]);}logger[_0x47b8('0x13')]('ServicenowConfiguration,\x20%s,\x20%s',_0x81b22f,_0x46267c['error'][_0x47b8('0x15')]);return _0x129a65(_0x46267c['error'][_0x47b8('0x15')]);}else{logger[_0x47b8('0xe')](_0x47b8('0xf'),_0x81b22f,_0x47b8('0x11'));_0x129a65(_0x46267c[_0x47b8('0x16')][_0x47b8('0x15')]);}})[_0x47b8('0x17')](function(_0x35bb3a){logger[_0x47b8('0x13')]('ServicenowConfiguration,\x20%s,\x20%s',_0x81b22f,_0x35bb3a);_0x6ad89(_0x35bb3a);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index fe16c7f..f0b363c 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 _0x25ac=['./intServicenowField.controller','get','isAuthenticated','index','show','post','create','put','update','delete','/:id','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x45b374,_0x20dccb){var _0x24fc74=function(_0x357eaf){while(--_0x357eaf){_0x45b374['push'](_0x45b374['shift']());}};_0x24fc74(++_0x20dccb);}(_0x25ac,0x125));var _0xc25a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x25ac[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc25a('0x0'));var util=require('util');var path=require(_0xc25a('0x1'));var timeout=require(_0xc25a('0x2'));var express=require(_0xc25a('0x3'));var router=express['Router']();var fs_extra=require(_0xc25a('0x4'));var auth=require(_0xc25a('0x5'));var interaction=require(_0xc25a('0x6'));var config=require('../../config/environment');var controller=require(_0xc25a('0x7'));router[_0xc25a('0x8')]('/',auth[_0xc25a('0x9')](),controller[_0xc25a('0xa')]);router[_0xc25a('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xc25a('0xb')]);router[_0xc25a('0xc')]('/',auth[_0xc25a('0x9')](),controller[_0xc25a('0xd')]);router[_0xc25a('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xc25a('0xf')]);router[_0xc25a('0x10')](_0xc25a('0x11'),auth[_0xc25a('0x9')](),controller[_0xc25a('0x12')]);module[_0xc25a('0x13')]=router; \ No newline at end of file +var _0xc3e3=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','/:id','show','post','create','put','delete','destroy','multer','path','connect-timeout','express'];(function(_0x21fa3c,_0x2d1a9f){var _0x5b0404=function(_0x4c7f5a){while(--_0x4c7f5a){_0x21fa3c['push'](_0x21fa3c['shift']());}};_0x5b0404(++_0x2d1a9f);}(_0xc3e3,0x68));var _0x3c3e=function(_0x378830,_0xb532d7){_0x378830=_0x378830-0x0;var _0x4e4348=_0xc3e3[_0x378830];return _0x4e4348;};'use strict';var multer=require(_0x3c3e('0x0'));var util=require('util');var path=require(_0x3c3e('0x1'));var timeout=require(_0x3c3e('0x2'));var express=require(_0x3c3e('0x3'));var router=express['Router']();var fs_extra=require(_0x3c3e('0x4'));var auth=require(_0x3c3e('0x5'));var interaction=require(_0x3c3e('0x6'));var config=require(_0x3c3e('0x7'));var controller=require(_0x3c3e('0x8'));router[_0x3c3e('0x9')]('/',auth[_0x3c3e('0xa')](),controller['index']);router['get'](_0x3c3e('0xb'),auth[_0x3c3e('0xa')](),controller[_0x3c3e('0xc')]);router[_0x3c3e('0xd')]('/',auth[_0x3c3e('0xa')](),controller[_0x3c3e('0xe')]);router[_0x3c3e('0xf')](_0x3c3e('0xb'),auth[_0x3c3e('0xa')](),controller['update']);router[_0x3c3e('0x10')](_0x3c3e('0xb'),auth[_0x3c3e('0xa')](),controller[_0x3c3e('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 1f9e3b5..6456601 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 _0xa8ea=['BOOLEAN','sequelize','string','variable','customVariable','keyValue','STRING'];(function(_0x1b9cf1,_0x171c8e){var _0x5c2fd3=function(_0x5e687b){while(--_0x5e687b){_0x1b9cf1['push'](_0x1b9cf1['shift']());}};_0x5c2fd3(++_0x171c8e);}(_0xa8ea,0x1e4));var _0xaa8e=function(_0x2623ad,_0x5ea41d){_0x2623ad=_0x2623ad-0x0;var _0x16f1d5=_0xa8ea[_0x2623ad];return _0x16f1d5;};'use strict';var Sequelize=require(_0xaa8e('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xaa8e('0x1'),_0xaa8e('0x2'),_0xaa8e('0x3'),_0xaa8e('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xaa8e('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xaa8e('0x1'),_0xaa8e('0x2'),_0xaa8e('0x3'))},'keyContent':{'type':Sequelize[_0xaa8e('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xaa8e('0x5')]},'customField':{'type':Sequelize[_0xaa8e('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa08b=['variable','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN','sequelize','string'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xa08b,0x1e4));var _0xba08=function(_0x230c53,_0x488a8a){_0x230c53=_0x230c53-0x0;var _0x397074=_0xa08b[_0x230c53];return _0x397074;};'use strict';var Sequelize=require(_0xba08('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xba08('0x1'),_0xba08('0x2'),_0xba08('0x3'),_0xba08('0x4'),_0xba08('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xba08('0x6')]},'key':{'type':Sequelize[_0xba08('0x6')]},'keyType':{'type':Sequelize[_0xba08('0x7')](_0xba08('0x1'),_0xba08('0x2'),_0xba08('0x3'))},'keyContent':{'type':Sequelize[_0xba08('0x6')]},'idField':{'type':Sequelize[_0xba08('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xba08('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xba08('0x6')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 43d8bb2..0f00993 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 _0x04eb=['filter','ServicenowField','includeAll','include','findAll','rows','catch','show','params','keys','options','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge'];(function(_0x3b4af6,_0x1072a7){var _0x3ddbbc=function(_0x2bbd9f){while(--_0x2bbd9f){_0x3b4af6['push'](_0x3b4af6['shift']());}};_0x3ddbbc(++_0x1072a7);}(_0x04eb,0xa0));var _0xb04e=function(_0x525936,_0xc871fa){_0x525936=_0x525936-0x0;var _0x544a89=_0x04eb[_0x525936];return _0x544a89;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb04e('0x0'));var zipdir=require(_0xb04e('0x1'));var jsonpatch=require(_0xb04e('0x2'));var rp=require(_0xb04e('0x3'));var moment=require('moment');var BPromise=require(_0xb04e('0x4'));var Mustache=require(_0xb04e('0x5'));var util=require(_0xb04e('0x6'));var path=require('path');var sox=require(_0xb04e('0x7'));var csv=require(_0xb04e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb04e('0x9'));var _=require(_0xb04e('0xa'));var squel=require('squel');var crypto=require(_0xb04e('0xb'));var jsforce=require(_0xb04e('0xc'));var deskjs=require(_0xb04e('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb04e('0xe'));var Redis=require(_0xb04e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb04e('0x10'));var as=require(_0xb04e('0x11'));var hardwareService=require(_0xb04e('0x12'));var logger=require('../../config/logger')(_0xb04e('0x13'));var utils=require(_0xb04e('0x14'));var config=require(_0xb04e('0x15'));var licenseUtil=require(_0xb04e('0x16'));var db=require(_0xb04e('0x17'))['db'];function respondWithStatusCode(_0x55592e,_0x4a435d){_0x4a435d=_0x4a435d||0xcc;return function(_0x2632ae){if(_0x2632ae){return _0x55592e['sendStatus'](_0x4a435d);}return _0x55592e[_0xb04e('0x18')](_0x4a435d)[_0xb04e('0x19')]();};}function respondWithResult(_0x1a614a,_0x7b219c){_0x7b219c=_0x7b219c||0xc8;return function(_0x340a4b){if(_0x340a4b){return _0x1a614a['status'](_0x7b219c)[_0xb04e('0x1a')](_0x340a4b);}};}function respondWithFilteredResult(_0x40b405,_0x1f7489){return function(_0x43766d){if(_0x43766d){var _0x1b816d=typeof _0x1f7489[_0xb04e('0x1b')]==='undefined'&&typeof _0x1f7489[_0xb04e('0x1c')]===_0xb04e('0x1d');var _0x27e690=_0x43766d[_0xb04e('0x1e')];var _0x3efc69=_0x1b816d?0x0:_0x1f7489[_0xb04e('0x1b')];var _0x52e07f=_0x1b816d?_0x43766d['count']:_0x1f7489['offset']+_0x1f7489[_0xb04e('0x1c')];var _0x285d0f;if(_0x52e07f>=_0x27e690){_0x52e07f=_0x27e690;_0x285d0f=0xc8;}else{_0x285d0f=0xce;}_0x40b405[_0xb04e('0x18')](_0x285d0f);return _0x40b405[_0xb04e('0x1f')](_0xb04e('0x20'),_0x3efc69+'-'+_0x52e07f+'/'+_0x27e690)[_0xb04e('0x1a')](_0x43766d);}return null;};}function patchUpdates(_0x2c4184){return function(_0x4304e8){try{jsonpatch[_0xb04e('0x21')](_0x4304e8,_0x2c4184,!![]);}catch(_0x8caebe){return BPromise['reject'](_0x8caebe);}return _0x4304e8['save']();};}function saveUpdates(_0xc42253,_0x2a5317){return function(_0xd4b670){if(_0xd4b670){return _0xd4b670[_0xb04e('0x22')](_0xc42253)[_0xb04e('0x23')](function(_0x3d8223){return _0x3d8223;});}return null;};}function removeEntity(_0x2df2eb,_0x21de2e){return function(_0x468202){if(_0x468202){return _0x468202['destroy']()[_0xb04e('0x23')](function(){_0x2df2eb[_0xb04e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x100fa3,_0x5967e8){return function(_0x3c4a0f){if(!_0x3c4a0f){_0x100fa3['sendStatus'](0x194);}return _0x3c4a0f;};}function handleError(_0x342cd3,_0x3e7906){_0x3e7906=_0x3e7906||0x1f4;return function(_0x5d8612){logger['error'](_0x5d8612[_0xb04e('0x24')]);if(_0x5d8612[_0xb04e('0x25')]){delete _0x5d8612['name'];}_0x342cd3[_0xb04e('0x18')](_0x3e7906)[_0xb04e('0x26')](_0x5d8612);};}exports[_0xb04e('0x27')]=function(_0x1fc32d,_0x39e594){var _0xa3410f={},_0x826365={},_0x955dc2={'count':0x0,'rows':[]};var _0x13e187=_[_0xb04e('0x28')](db['ServicenowField'][_0xb04e('0x29')],function(_0x10dc5a){return{'name':_0x10dc5a[_0xb04e('0x2a')],'type':_0x10dc5a[_0xb04e('0x2b')][_0xb04e('0x2c')]};});_0x826365['model']=_[_0xb04e('0x28')](_0x13e187,_0xb04e('0x25'));_0x826365[_0xb04e('0x2d')]=_['keys'](_0x1fc32d['query']);_0x826365[_0xb04e('0x2e')]=_[_0xb04e('0x2f')](_0x826365['model'],_0x826365[_0xb04e('0x2d')]);_0xa3410f[_0xb04e('0x30')]=_[_0xb04e('0x2f')](_0x826365[_0xb04e('0x31')],qs[_0xb04e('0x32')](_0x1fc32d['query']['fields']));_0xa3410f[_0xb04e('0x30')]=_0xa3410f[_0xb04e('0x30')][_0xb04e('0x33')]?_0xa3410f[_0xb04e('0x30')]:_0x826365['model'];if(!_0x1fc32d[_0xb04e('0x2d')][_0xb04e('0x34')](_0xb04e('0x35'))){_0xa3410f[_0xb04e('0x1c')]=qs[_0xb04e('0x1c')](_0x1fc32d[_0xb04e('0x2d')][_0xb04e('0x1c')]);_0xa3410f[_0xb04e('0x1b')]=qs[_0xb04e('0x1b')](_0x1fc32d[_0xb04e('0x2d')][_0xb04e('0x1b')]);}_0xa3410f[_0xb04e('0x36')]=qs[_0xb04e('0x37')](_0x1fc32d['query'][_0xb04e('0x37')]);_0xa3410f['where']=qs['filters'](_[_0xb04e('0x38')](_0x1fc32d['query'],_0x826365[_0xb04e('0x2e')]),_0x13e187);if(_0x1fc32d[_0xb04e('0x2d')]['filter']){_0xa3410f[_0xb04e('0x39')]=_[_0xb04e('0x3a')](_0xa3410f[_0xb04e('0x39')],{'$or':_['map'](_0x13e187,function(_0x1c4dea){if(_0x1c4dea[_0xb04e('0x2b')]!=='VIRTUAL'){var _0x3c7a85={};_0x3c7a85[_0x1c4dea[_0xb04e('0x25')]]={'$like':'%'+_0x1fc32d[_0xb04e('0x2d')][_0xb04e('0x3b')]+'%'};return _0x3c7a85;}})});}_0xa3410f=_[_0xb04e('0x3a')]({},_0xa3410f,_0x1fc32d['options']);var _0x3f7ca2={'where':_0xa3410f[_0xb04e('0x39')]};return db[_0xb04e('0x3c')][_0xb04e('0x1e')](_0x3f7ca2)[_0xb04e('0x23')](function(_0x1817bb){_0x955dc2['count']=_0x1817bb;if(_0x1fc32d[_0xb04e('0x2d')][_0xb04e('0x3d')]){_0xa3410f[_0xb04e('0x3e')]=[{'all':!![]}];}return db[_0xb04e('0x3c')][_0xb04e('0x3f')](_0xa3410f);})[_0xb04e('0x23')](function(_0x7d06a){_0x955dc2[_0xb04e('0x40')]=_0x7d06a;return _0x955dc2;})[_0xb04e('0x23')](respondWithFilteredResult(_0x39e594,_0xa3410f))[_0xb04e('0x41')](handleError(_0x39e594,null));};exports[_0xb04e('0x42')]=function(_0x518755,_0x453af9){var _0x4f48a9={'raw':!![],'where':{'id':_0x518755[_0xb04e('0x43')]['id']}},_0x85266f={};_0x85266f[_0xb04e('0x31')]=_[_0xb04e('0x44')](db[_0xb04e('0x3c')][_0xb04e('0x29')]);_0x85266f[_0xb04e('0x2d')]=_[_0xb04e('0x44')](_0x518755[_0xb04e('0x2d')]);_0x85266f[_0xb04e('0x2e')]=_['intersection'](_0x85266f[_0xb04e('0x31')],_0x85266f[_0xb04e('0x2d')]);_0x4f48a9[_0xb04e('0x30')]=_[_0xb04e('0x2f')](_0x85266f[_0xb04e('0x31')],qs[_0xb04e('0x32')](_0x518755[_0xb04e('0x2d')][_0xb04e('0x32')]));_0x4f48a9[_0xb04e('0x30')]=_0x4f48a9[_0xb04e('0x30')][_0xb04e('0x33')]?_0x4f48a9[_0xb04e('0x30')]:_0x85266f[_0xb04e('0x31')];if(_0x518755['query'][_0xb04e('0x3d')]){_0x4f48a9[_0xb04e('0x3e')]=[{'all':!![]}];}_0x4f48a9=_['merge']({},_0x4f48a9,_0x518755[_0xb04e('0x45')]);return db[_0xb04e('0x3c')]['find'](_0x4f48a9)[_0xb04e('0x23')](handleEntityNotFound(_0x453af9,null))['then'](respondWithResult(_0x453af9,null))['catch'](handleError(_0x453af9,null));};exports[_0xb04e('0x46')]=function(_0x3189a5,_0x189382){return db[_0xb04e('0x3c')][_0xb04e('0x46')](_0x3189a5['body'],{})[_0xb04e('0x23')](respondWithResult(_0x189382,0xc9))['catch'](handleError(_0x189382,null));};exports['update']=function(_0x4fb63c,_0xfce854){if(_0x4fb63c[_0xb04e('0x47')]['id']){delete _0x4fb63c[_0xb04e('0x47')]['id'];}return db['ServicenowField']['find']({'where':{'id':_0x4fb63c['params']['id']}})[_0xb04e('0x23')](handleEntityNotFound(_0xfce854,null))[_0xb04e('0x23')](saveUpdates(_0x4fb63c[_0xb04e('0x47')],null))[_0xb04e('0x23')](respondWithResult(_0xfce854,null))['catch'](handleError(_0xfce854,null));};exports['destroy']=function(_0x5647db,_0x61e4a0){return db[_0xb04e('0x3c')][_0xb04e('0x48')]({'where':{'id':_0x5647db['params']['id']}})[_0xb04e('0x23')](handleEntityNotFound(_0x61e4a0,null))[_0xb04e('0x23')](removeEntity(_0x61e4a0,null))[_0xb04e('0x41')](handleError(_0x61e4a0,null));}; \ No newline at end of file +var _0xa708=['nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','name','send','index','map','ServicenowField','fieldName','type','query','keys','intersection','model','attributes','fields','length'];(function(_0x280875,_0x137bcb){var _0x74acfe=function(_0x3b599f){while(--_0x3b599f){_0x280875['push'](_0x280875['shift']());}};_0x74acfe(++_0x137bcb);}(_0xa708,0xf0));var _0x8a70=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa708[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x8a70('0x0'));var rimraf=require(_0x8a70('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8a70('0x2'));var rp=require(_0x8a70('0x3'));var moment=require(_0x8a70('0x4'));var BPromise=require(_0x8a70('0x5'));var Mustache=require('mustache');var util=require(_0x8a70('0x6'));var path=require(_0x8a70('0x7'));var sox=require('sox');var csv=require(_0x8a70('0x8'));var ejs=require(_0x8a70('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8a70('0xa'));var deskjs=require(_0x8a70('0xb'));var toCsv=require(_0x8a70('0x8'));var querystring=require(_0x8a70('0xc'));var Papa=require(_0x8a70('0xd'));var Redis=require(_0x8a70('0xe'));var authService=require(_0x8a70('0xf'));var qs=require(_0x8a70('0x10'));var as=require(_0x8a70('0x11'));var hardwareService=require(_0x8a70('0x12'));var logger=require('../../config/logger')(_0x8a70('0x13'));var utils=require('../../config/utils');var config=require(_0x8a70('0x14'));var licenseUtil=require(_0x8a70('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17a247,_0x4fa636){_0x4fa636=_0x4fa636||0xcc;return function(_0x77ceef){if(_0x77ceef){return _0x17a247['sendStatus'](_0x4fa636);}return _0x17a247['status'](_0x4fa636)[_0x8a70('0x16')]();};}function respondWithResult(_0x58fe43,_0x172ec0){_0x172ec0=_0x172ec0||0xc8;return function(_0x8f7a6c){if(_0x8f7a6c){return _0x58fe43[_0x8a70('0x17')](_0x172ec0)[_0x8a70('0x18')](_0x8f7a6c);}};}function respondWithFilteredResult(_0x574fcd,_0x162a9b){return function(_0xab5e94){if(_0xab5e94){var _0x3b1c7e=typeof _0x162a9b[_0x8a70('0x19')]===_0x8a70('0x1a')&&typeof _0x162a9b[_0x8a70('0x1b')]===_0x8a70('0x1a');var _0x1c1285=_0xab5e94[_0x8a70('0x1c')];var _0x2e0769=_0x3b1c7e?0x0:_0x162a9b[_0x8a70('0x19')];var _0x34d80e=_0x3b1c7e?_0xab5e94['count']:_0x162a9b[_0x8a70('0x19')]+_0x162a9b[_0x8a70('0x1b')];var _0x3ebb3e;if(_0x34d80e>=_0x1c1285){_0x34d80e=_0x1c1285;_0x3ebb3e=0xc8;}else{_0x3ebb3e=0xce;}_0x574fcd[_0x8a70('0x17')](_0x3ebb3e);return _0x574fcd[_0x8a70('0x1d')](_0x8a70('0x1e'),_0x2e0769+'-'+_0x34d80e+'/'+_0x1c1285)['json'](_0xab5e94);}return null;};}function patchUpdates(_0x38fd30){return function(_0x4b02b6){try{jsonpatch[_0x8a70('0x1f')](_0x4b02b6,_0x38fd30,!![]);}catch(_0x1d1b11){return BPromise[_0x8a70('0x20')](_0x1d1b11);}return _0x4b02b6[_0x8a70('0x21')]();};}function saveUpdates(_0x426612,_0x3bfed8){return function(_0xad3fac){if(_0xad3fac){return _0xad3fac[_0x8a70('0x22')](_0x426612)[_0x8a70('0x23')](function(_0x31c6ea){return _0x31c6ea;});}return null;};}function removeEntity(_0x1200d3,_0x1af250){return function(_0x3da2ad){if(_0x3da2ad){return _0x3da2ad['destroy']()[_0x8a70('0x23')](function(){_0x1200d3[_0x8a70('0x17')](0xcc)[_0x8a70('0x16')]();});}};}function handleEntityNotFound(_0x395479,_0x4f013f){return function(_0x47586f){if(!_0x47586f){_0x395479[_0x8a70('0x24')](0x194);}return _0x47586f;};}function handleError(_0x25215f,_0x169013){_0x169013=_0x169013||0x1f4;return function(_0x61392c){logger[_0x8a70('0x25')](_0x61392c['stack']);if(_0x61392c[_0x8a70('0x26')]){delete _0x61392c[_0x8a70('0x26')];}_0x25215f['status'](_0x169013)[_0x8a70('0x27')](_0x61392c);};}exports[_0x8a70('0x28')]=function(_0x5b9c60,_0x5d5170){var _0x47f005={},_0x174717={},_0x18a694={'count':0x0,'rows':[]};var _0x23ec77=_[_0x8a70('0x29')](db[_0x8a70('0x2a')]['rawAttributes'],function(_0x755038){return{'name':_0x755038[_0x8a70('0x2b')],'type':_0x755038[_0x8a70('0x2c')]['key']};});_0x174717['model']=_[_0x8a70('0x29')](_0x23ec77,'name');_0x174717[_0x8a70('0x2d')]=_[_0x8a70('0x2e')](_0x5b9c60[_0x8a70('0x2d')]);_0x174717['filters']=_[_0x8a70('0x2f')](_0x174717[_0x8a70('0x30')],_0x174717['query']);_0x47f005[_0x8a70('0x31')]=_[_0x8a70('0x2f')](_0x174717[_0x8a70('0x30')],qs[_0x8a70('0x32')](_0x5b9c60['query'][_0x8a70('0x32')]));_0x47f005[_0x8a70('0x31')]=_0x47f005[_0x8a70('0x31')][_0x8a70('0x33')]?_0x47f005['attributes']:_0x174717[_0x8a70('0x30')];if(!_0x5b9c60['query']['hasOwnProperty'](_0x8a70('0x34'))){_0x47f005[_0x8a70('0x1b')]=qs[_0x8a70('0x1b')](_0x5b9c60[_0x8a70('0x2d')][_0x8a70('0x1b')]);_0x47f005[_0x8a70('0x19')]=qs[_0x8a70('0x19')](_0x5b9c60['query'][_0x8a70('0x19')]);}_0x47f005[_0x8a70('0x35')]=qs[_0x8a70('0x36')](_0x5b9c60['query'][_0x8a70('0x36')]);_0x47f005[_0x8a70('0x37')]=qs[_0x8a70('0x38')](_[_0x8a70('0x39')](_0x5b9c60[_0x8a70('0x2d')],_0x174717[_0x8a70('0x38')]),_0x23ec77);if(_0x5b9c60[_0x8a70('0x2d')][_0x8a70('0x3a')]){_0x47f005[_0x8a70('0x37')]=_['merge'](_0x47f005['where'],{'$or':_[_0x8a70('0x29')](_0x23ec77,function(_0x41137e){if(_0x41137e[_0x8a70('0x2c')]!==_0x8a70('0x3b')){var _0x5d92ea={};_0x5d92ea[_0x41137e['name']]={'$like':'%'+_0x5b9c60['query'][_0x8a70('0x3a')]+'%'};return _0x5d92ea;}})});}_0x47f005=_[_0x8a70('0x3c')]({},_0x47f005,_0x5b9c60[_0x8a70('0x3d')]);var _0x2c8f9f={'where':_0x47f005[_0x8a70('0x37')]};return db[_0x8a70('0x2a')][_0x8a70('0x1c')](_0x2c8f9f)['then'](function(_0x5a4641){_0x18a694['count']=_0x5a4641;if(_0x5b9c60['query'][_0x8a70('0x3e')]){_0x47f005[_0x8a70('0x3f')]=[{'all':!![]}];}return db[_0x8a70('0x2a')][_0x8a70('0x40')](_0x47f005);})[_0x8a70('0x23')](function(_0x39a971){_0x18a694['rows']=_0x39a971;return _0x18a694;})[_0x8a70('0x23')](respondWithFilteredResult(_0x5d5170,_0x47f005))[_0x8a70('0x41')](handleError(_0x5d5170,null));};exports[_0x8a70('0x42')]=function(_0x3c463e,_0x346184){var _0x2ed234={'raw':!![],'where':{'id':_0x3c463e[_0x8a70('0x43')]['id']}},_0x1babf4={};_0x1babf4[_0x8a70('0x30')]=_['keys'](db[_0x8a70('0x2a')][_0x8a70('0x44')]);_0x1babf4[_0x8a70('0x2d')]=_['keys'](_0x3c463e[_0x8a70('0x2d')]);_0x1babf4[_0x8a70('0x38')]=_[_0x8a70('0x2f')](_0x1babf4['model'],_0x1babf4[_0x8a70('0x2d')]);_0x2ed234[_0x8a70('0x31')]=_[_0x8a70('0x2f')](_0x1babf4[_0x8a70('0x30')],qs[_0x8a70('0x32')](_0x3c463e[_0x8a70('0x2d')][_0x8a70('0x32')]));_0x2ed234[_0x8a70('0x31')]=_0x2ed234[_0x8a70('0x31')][_0x8a70('0x33')]?_0x2ed234['attributes']:_0x1babf4['model'];if(_0x3c463e[_0x8a70('0x2d')][_0x8a70('0x3e')]){_0x2ed234[_0x8a70('0x3f')]=[{'all':!![]}];}_0x2ed234=_[_0x8a70('0x3c')]({},_0x2ed234,_0x3c463e[_0x8a70('0x3d')]);return db['ServicenowField'][_0x8a70('0x45')](_0x2ed234)[_0x8a70('0x23')](handleEntityNotFound(_0x346184,null))[_0x8a70('0x23')](respondWithResult(_0x346184,null))[_0x8a70('0x41')](handleError(_0x346184,null));};exports[_0x8a70('0x46')]=function(_0x39095a,_0x27a26e){return db[_0x8a70('0x2a')][_0x8a70('0x46')](_0x39095a[_0x8a70('0x47')],{})[_0x8a70('0x23')](respondWithResult(_0x27a26e,0xc9))[_0x8a70('0x41')](handleError(_0x27a26e,null));};exports[_0x8a70('0x22')]=function(_0x568324,_0x53859c){if(_0x568324[_0x8a70('0x47')]['id']){delete _0x568324[_0x8a70('0x47')]['id'];}return db[_0x8a70('0x2a')]['find']({'where':{'id':_0x568324['params']['id']}})['then'](handleEntityNotFound(_0x53859c,null))['then'](saveUpdates(_0x568324[_0x8a70('0x47')],null))[_0x8a70('0x23')](respondWithResult(_0x53859c,null))[_0x8a70('0x41')](handleError(_0x53859c,null));};exports[_0x8a70('0x48')]=function(_0x4305f4,_0x30288c){return db['ServicenowField'][_0x8a70('0x45')]({'where':{'id':_0x4305f4[_0x8a70('0x43')]['id']}})[_0x8a70('0x23')](handleEntityNotFound(_0x30288c,null))['then'](removeEntity(_0x30288c,null))['catch'](handleError(_0x30288c,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 4c062c5..dab219a 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 _0x0ce5=['idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowField.attributes','define','ServicenowField','int_servicenow_fields'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0x0ce5,0x9c));var _0x50ce=function(_0x11bc0f,_0x373666){_0x11bc0f=_0x11bc0f-0x0;var _0x3ab0d1=_0x0ce5[_0x11bc0f];return _0x3ab0d1;};'use strict';var _=require(_0x50ce('0x0'));var util=require(_0x50ce('0x1'));var logger=require(_0x50ce('0x2'))('api');var moment=require(_0x50ce('0x3'));var BPromise=require(_0x50ce('0x4'));var rp=require(_0x50ce('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x50ce('0x6'));var config=require(_0x50ce('0x7'));var attributes=require(_0x50ce('0x8'));module['exports']=function(_0x552c42,_0x3ad86f){return _0x552c42[_0x50ce('0x9')](_0x50ce('0xa'),attributes,{'tableName':_0x50ce('0xb'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x50ce('0xc'),_0x50ce('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x89bc=['api','moment','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','idField','lodash','util','../../config/logger'];(function(_0x30d74b,_0x4e619f){var _0x5c13e5=function(_0x449d8){while(--_0x449d8){_0x30d74b['push'](_0x30d74b['shift']());}};_0x5c13e5(++_0x4e619f);}(_0x89bc,0x1ec));var _0xc89b=function(_0x399d76,_0xdc4493){_0x399d76=_0x399d76-0x0;var _0x3b19a1=_0x89bc[_0x399d76];return _0x3b19a1;};'use strict';var _=require(_0xc89b('0x0'));var util=require(_0xc89b('0x1'));var logger=require(_0xc89b('0x2'))(_0xc89b('0x3'));var moment=require(_0xc89b('0x4'));var BPromise=require('bluebird');var rp=require(_0xc89b('0x5'));var fs=require('fs');var path=require(_0xc89b('0x6'));var rimraf=require(_0xc89b('0x7'));var config=require(_0xc89b('0x8'));var attributes=require(_0xc89b('0x9'));module[_0xc89b('0xa')]=function(_0x4019bc,_0xbc4286){return _0x4019bc[_0xc89b('0xb')](_0xc89b('0xc'),attributes,{'tableName':_0xc89b('0xd'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0xc89b('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index c251119..5b55e42 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 _0xa9e0=['http','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\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(_0x264aa8,_0x1870da){var _0x55c9e9=function(_0x499ce0){while(--_0x499ce0){_0x264aa8['push'](_0x264aa8['shift']());}};_0x55c9e9(++_0x1870da);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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 _0xe706=['http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xc875a,_0x4600fa){var _0x405cce=function(_0x41e4ca){while(--_0x41e4ca){_0xc875a['push'](_0xc875a['shift']());}};_0x405cce(++_0x4600fa);}(_0xe706,0xa3));var _0x6e70=function(_0x59cda9,_0x47d4c4){_0x59cda9=_0x59cda9-0x0;var _0x26c18f=_0xe706[_0x59cda9];return _0x26c18f;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('ServicenowField,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('ServicenowField,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index b2301b8..9b82f11 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x209e50,_0x4ddc6e){var _0x32349a=function(_0x1d501e){while(--_0x1d501e){_0x209e50['push'](_0x209e50['shift']());}};_0x32349a(++_0x4ddc6e);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +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(_0x26b6d6,_0x52b01e){var _0x415253=function(_0x406bb3){while(--_0x406bb3){_0x26b6d6['push'](_0x26b6d6['shift']());}};_0x415253(++_0x52b01e);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index eee0b2f..02681e6 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(_0x155dd6,_0x46ebf6){var _0x2af8a8=function(_0x5a1b6e){while(--_0x5a1b6e){_0x155dd6['push'](_0x155dd6['shift']());}};_0x2af8a8(++_0x46ebf6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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(_0x3993cb,_0x286f55){var _0x11fdbb=function(_0x211ace){while(--_0x211ace){_0x3993cb['push'](_0x3993cb['shift']());}};_0x11fdbb(++_0x286f55);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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 0683607..ce334d3 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 _0xe096=['api','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','error','stack','name','send','SugarcrmAccount','fieldName','type','key','map','query','filters','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','attributes','find','create','catch','body','destroy','getConfigurations','findOne','SugarcrmConfiguration','addConfiguration','channel','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','%s%s','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','format','/service/v4_1/rest.php','get_module_fields','Calls','module_fields','includes','values','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','crypto','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x4acb11,_0x37ca67){var _0xab520d=function(_0x5ec50d){while(--_0x5ec50d){_0x4acb11['push'](_0x4acb11['shift']());}};_0xab520d(++_0x37ca67);}(_0xe096,0x13c));var _0x6e09=function(_0x3bd52b,_0xbbc735){_0x3bd52b=_0x3bd52b-0x0;var _0x1e5b89=_0xe096[_0x3bd52b];return _0x1e5b89;};'use strict';var emlformat=require(_0x6e09('0x0'));var rimraf=require(_0x6e09('0x1'));var zipdir=require(_0x6e09('0x2'));var jsonpatch=require(_0x6e09('0x3'));var rp=require(_0x6e09('0x4'));var moment=require(_0x6e09('0x5'));var BPromise=require(_0x6e09('0x6'));var Mustache=require(_0x6e09('0x7'));var util=require(_0x6e09('0x8'));var path=require(_0x6e09('0x9'));var sox=require(_0x6e09('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6e09('0xb'));var squel=require('squel');var crypto=require(_0x6e09('0xc'));var jsforce=require(_0x6e09('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6e09('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6e09('0xf'));var as=require(_0x6e09('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6e09('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6e09('0x12'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x180e2a,_0x124266){_0x124266=_0x124266||0xcc;return function(_0x1d85d3){if(_0x1d85d3){return _0x180e2a['sendStatus'](_0x124266);}return _0x180e2a[_0x6e09('0x13')](_0x124266)[_0x6e09('0x14')]();};}function respondWithResult(_0x4d260a,_0x50c3e7){_0x50c3e7=_0x50c3e7||0xc8;return function(_0x2a1d61){if(_0x2a1d61){return _0x4d260a['status'](_0x50c3e7)['json'](_0x2a1d61);}};}function respondWithFilteredResult(_0x53e6d1,_0x410bb1){return function(_0x1f0d2b){if(_0x1f0d2b){var _0x538882=typeof _0x410bb1[_0x6e09('0x15')]===_0x6e09('0x16')&&typeof _0x410bb1[_0x6e09('0x17')]===_0x6e09('0x16');var _0x5910cb=_0x1f0d2b[_0x6e09('0x18')];var _0x29e46b=_0x538882?0x0:_0x410bb1[_0x6e09('0x15')];var _0x352928=_0x538882?_0x1f0d2b[_0x6e09('0x18')]:_0x410bb1[_0x6e09('0x15')]+_0x410bb1[_0x6e09('0x17')];var _0x5af7c0;if(_0x352928>=_0x5910cb){_0x352928=_0x5910cb;_0x5af7c0=0xc8;}else{_0x5af7c0=0xce;}_0x53e6d1[_0x6e09('0x13')](_0x5af7c0);return _0x53e6d1[_0x6e09('0x19')](_0x6e09('0x1a'),_0x29e46b+'-'+_0x352928+'/'+_0x5910cb)[_0x6e09('0x1b')](_0x1f0d2b);}return null;};}function patchUpdates(_0xcac0d9){return function(_0x167438){try{jsonpatch['apply'](_0x167438,_0xcac0d9,!![]);}catch(_0x2bb0bd){return BPromise[_0x6e09('0x1c')](_0x2bb0bd);}return _0x167438[_0x6e09('0x1d')]();};}function saveUpdates(_0x3a0205,_0x14e208){return function(_0x5868c2){if(_0x5868c2){return _0x5868c2[_0x6e09('0x1e')](_0x3a0205)[_0x6e09('0x1f')](function(_0x41bb2a){return _0x41bb2a;});}return null;};}function removeEntity(_0x45c6a1,_0x45fc55){return function(_0x2fb56b){if(_0x2fb56b){return _0x2fb56b['destroy']()['then'](function(){_0x45c6a1[_0x6e09('0x13')](0xcc)[_0x6e09('0x14')]();});}};}function handleEntityNotFound(_0x58599d,_0x4c7011){return function(_0x30c37e){if(!_0x30c37e){_0x58599d['sendStatus'](0x194);}return _0x30c37e;};}function handleError(_0x24b777,_0x8f8e17){_0x8f8e17=_0x8f8e17||0x1f4;return function(_0x2b30dc){logger[_0x6e09('0x20')](_0x2b30dc[_0x6e09('0x21')]);if(_0x2b30dc[_0x6e09('0x22')]){delete _0x2b30dc[_0x6e09('0x22')];}_0x24b777[_0x6e09('0x13')](_0x8f8e17)[_0x6e09('0x23')](_0x2b30dc);};}exports['index']=function(_0x4cf3a5,_0x1a3bcc){var _0x1c92bc={},_0x2b989b={},_0x3cedc1={'count':0x0,'rows':[]};var _0x320d03=_['map'](db[_0x6e09('0x24')]['rawAttributes'],function(_0x4dfd44){return{'name':_0x4dfd44[_0x6e09('0x25')],'type':_0x4dfd44[_0x6e09('0x26')][_0x6e09('0x27')]};});_0x2b989b['model']=_[_0x6e09('0x28')](_0x320d03,_0x6e09('0x22'));_0x2b989b[_0x6e09('0x29')]=_['keys'](_0x4cf3a5[_0x6e09('0x29')]);_0x2b989b[_0x6e09('0x2a')]=_[_0x6e09('0x2b')](_0x2b989b['model'],_0x2b989b['query']);_0x1c92bc['attributes']=_[_0x6e09('0x2b')](_0x2b989b[_0x6e09('0x2c')],qs[_0x6e09('0x2d')](_0x4cf3a5['query'][_0x6e09('0x2d')]));_0x1c92bc['attributes']=_0x1c92bc['attributes'][_0x6e09('0x2e')]?_0x1c92bc['attributes']:_0x2b989b[_0x6e09('0x2c')];if(!_0x4cf3a5[_0x6e09('0x29')][_0x6e09('0x2f')](_0x6e09('0x30'))){_0x1c92bc[_0x6e09('0x17')]=qs[_0x6e09('0x17')](_0x4cf3a5[_0x6e09('0x29')][_0x6e09('0x17')]);_0x1c92bc[_0x6e09('0x15')]=qs[_0x6e09('0x15')](_0x4cf3a5[_0x6e09('0x29')][_0x6e09('0x15')]);}_0x1c92bc[_0x6e09('0x31')]=qs[_0x6e09('0x32')](_0x4cf3a5[_0x6e09('0x29')]['sort']);_0x1c92bc['where']=qs[_0x6e09('0x2a')](_[_0x6e09('0x33')](_0x4cf3a5[_0x6e09('0x29')],_0x2b989b[_0x6e09('0x2a')]),_0x320d03);if(_0x4cf3a5[_0x6e09('0x29')][_0x6e09('0x34')]){_0x1c92bc[_0x6e09('0x35')]=_[_0x6e09('0x36')](_0x1c92bc[_0x6e09('0x35')],{'$or':_[_0x6e09('0x28')](_0x320d03,function(_0x181754){if(_0x181754[_0x6e09('0x26')]!=='VIRTUAL'){var _0x3f6006={};_0x3f6006[_0x181754['name']]={'$like':'%'+_0x4cf3a5[_0x6e09('0x29')][_0x6e09('0x34')]+'%'};return _0x3f6006;}})});}_0x1c92bc=_[_0x6e09('0x36')]({},_0x1c92bc,_0x4cf3a5[_0x6e09('0x37')]);var _0x51cf6f={'where':_0x1c92bc['where']};return db[_0x6e09('0x24')][_0x6e09('0x18')](_0x51cf6f)['then'](function(_0x5a977c){_0x3cedc1[_0x6e09('0x18')]=_0x5a977c;if(_0x4cf3a5[_0x6e09('0x29')][_0x6e09('0x38')]){_0x1c92bc[_0x6e09('0x39')]=[{'all':!![]}];}return db[_0x6e09('0x24')][_0x6e09('0x3a')](_0x1c92bc);})[_0x6e09('0x1f')](function(_0x5bc5e0){_0x3cedc1[_0x6e09('0x3b')]=_0x5bc5e0;return _0x3cedc1;})['then'](respondWithFilteredResult(_0x1a3bcc,_0x1c92bc))['catch'](handleError(_0x1a3bcc,null));};exports[_0x6e09('0x3c')]=function(_0x405f6e,_0x56cfb6){var _0x1a6488={'raw':![],'where':{'id':_0x405f6e[_0x6e09('0x3d')]['id']}},_0x4c10e4={};_0x4c10e4['model']=_[_0x6e09('0x3e')](db[_0x6e09('0x24')][_0x6e09('0x3f')]);_0x4c10e4[_0x6e09('0x29')]=_[_0x6e09('0x3e')](_0x405f6e['query']);_0x4c10e4[_0x6e09('0x2a')]=_['intersection'](_0x4c10e4[_0x6e09('0x2c')],_0x4c10e4[_0x6e09('0x29')]);_0x1a6488[_0x6e09('0x40')]=_[_0x6e09('0x2b')](_0x4c10e4[_0x6e09('0x2c')],qs['fields'](_0x405f6e[_0x6e09('0x29')][_0x6e09('0x2d')]));_0x1a6488['attributes']=_0x1a6488['attributes'][_0x6e09('0x2e')]?_0x1a6488['attributes']:_0x4c10e4[_0x6e09('0x2c')];if(_0x405f6e[_0x6e09('0x29')][_0x6e09('0x38')]){_0x1a6488['include']=[{'all':!![]}];}_0x1a6488=_['merge']({},_0x1a6488,_0x405f6e['options']);return db[_0x6e09('0x24')][_0x6e09('0x41')](_0x1a6488)[_0x6e09('0x1f')](handleEntityNotFound(_0x56cfb6,null))['then'](respondWithResult(_0x56cfb6,null))['catch'](handleError(_0x56cfb6,null));};exports[_0x6e09('0x42')]=function(_0x5723b6,_0x2eae20){return db[_0x6e09('0x24')][_0x6e09('0x42')](_0x5723b6['body'],{})['then'](respondWithResult(_0x2eae20,0xc9))[_0x6e09('0x43')](handleError(_0x2eae20,null));};exports[_0x6e09('0x1e')]=function(_0x401c4b,_0x43425b){if(_0x401c4b[_0x6e09('0x44')]['id']){delete _0x401c4b[_0x6e09('0x44')]['id'];}return db[_0x6e09('0x24')]['find']({'where':{'id':_0x401c4b[_0x6e09('0x3d')]['id']}})[_0x6e09('0x1f')](handleEntityNotFound(_0x43425b,null))['then'](saveUpdates(_0x401c4b[_0x6e09('0x44')],null))[_0x6e09('0x1f')](respondWithResult(_0x43425b,null))[_0x6e09('0x43')](handleError(_0x43425b,null));};exports[_0x6e09('0x45')]=function(_0x274981,_0x3394da){return db[_0x6e09('0x24')][_0x6e09('0x41')]({'where':{'id':_0x274981[_0x6e09('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3394da,null))[_0x6e09('0x1f')](removeEntity(_0x3394da,null))[_0x6e09('0x43')](handleError(_0x3394da,null));};exports[_0x6e09('0x46')]=function(_0x488991,_0xb88dd5,_0x9473e7){var _0x35245b={};var _0x22ac30={};var _0x2e6597;var _0x3e8c07;return db[_0x6e09('0x24')][_0x6e09('0x47')]({'where':{'id':_0x488991[_0x6e09('0x3d')]['id']}})['then'](handleEntityNotFound(_0xb88dd5,null))[_0x6e09('0x1f')](function(_0x231c60){if(_0x231c60){_0x2e6597=_0x231c60;_0x22ac30[_0x6e09('0x2c')]=_['keys'](db[_0x6e09('0x48')][_0x6e09('0x3f')]);_0x22ac30[_0x6e09('0x29')]=_['keys'](_0x488991[_0x6e09('0x29')]);_0x22ac30['filters']=_[_0x6e09('0x2b')](_0x22ac30['model'],_0x22ac30[_0x6e09('0x29')]);_0x35245b[_0x6e09('0x40')]=_[_0x6e09('0x2b')](_0x22ac30[_0x6e09('0x2c')],qs[_0x6e09('0x2d')](_0x488991[_0x6e09('0x29')][_0x6e09('0x2d')]));_0x35245b[_0x6e09('0x40')]=_0x35245b[_0x6e09('0x40')]['length']?_0x35245b['attributes']:_0x22ac30[_0x6e09('0x2c')];_0x35245b[_0x6e09('0x31')]=qs[_0x6e09('0x32')](_0x488991['query'][_0x6e09('0x32')]);_0x35245b['where']=qs[_0x6e09('0x2a')](_[_0x6e09('0x33')](_0x488991['query'],_0x22ac30[_0x6e09('0x2a')]));if(_0x488991['query'][_0x6e09('0x34')]){_0x35245b[_0x6e09('0x35')]=_[_0x6e09('0x36')](_0x35245b[_0x6e09('0x35')],{'$or':_['map'](_0x35245b[_0x6e09('0x40')],function(_0x37a172){var _0x252064={};_0x252064[_0x37a172]={'$like':'%'+_0x488991[_0x6e09('0x29')][_0x6e09('0x34')]+'%'};return _0x252064;})});}_0x35245b=_[_0x6e09('0x36')]({},_0x35245b,_0x488991[_0x6e09('0x37')]);return _0x2e6597[_0x6e09('0x46')](_0x35245b);}})['then'](function(_0x180004){if(_0x180004){_0x3e8c07=_0x180004[_0x6e09('0x2e')];if(!_0x488991[_0x6e09('0x29')][_0x6e09('0x2f')](_0x6e09('0x30'))){_0x35245b['limit']=qs['limit'](_0x488991[_0x6e09('0x29')][_0x6e09('0x17')]);_0x35245b[_0x6e09('0x15')]=qs[_0x6e09('0x15')](_0x488991[_0x6e09('0x29')][_0x6e09('0x15')]);}return _0x2e6597['getConfigurations'](_0x35245b);}})['then'](function(_0x3d2bb3){if(_0x3d2bb3){return _0x3d2bb3?{'count':_0x3e8c07,'rows':_0x3d2bb3}:null;}})[_0x6e09('0x1f')](respondWithResult(_0xb88dd5,null))['catch'](handleError(_0xb88dd5,null));};exports[_0x6e09('0x49')]=function(_0x1b366e,_0x27c4e1,_0x199c77){if(_0x1b366e[_0x6e09('0x44')]['id']){delete _0x1b366e['body']['id'];}return db[_0x6e09('0x24')][_0x6e09('0x47')]({'where':{'id':_0x1b366e[_0x6e09('0x3d')]['id']}})[_0x6e09('0x1f')](handleEntityNotFound(_0x27c4e1,null))[_0x6e09('0x1f')](function(_0x5240bf){if(_0x5240bf){_0x1b366e[_0x6e09('0x44')]['AccountId']=_0x5240bf['id'];_0x1b366e['body']['Subjects']=integrations['getSubjects'](_0x1b366e[_0x6e09('0x44')]['channel'],_0x1b366e[_0x6e09('0x44')][_0x6e09('0x26')]);_0x1b366e['body']['Descriptions']=integrations['getDescriptions'](_0x1b366e[_0x6e09('0x44')][_0x6e09('0x4a')],_0x1b366e['body'][_0x6e09('0x26')]);return db[_0x6e09('0x48')]['create'](_0x1b366e[_0x6e09('0x44')],{'include':[{'model':db[_0x6e09('0x4b')],'as':'Subjects'},{'model':db[_0x6e09('0x4b')],'as':'Descriptions'}]});}return null;})[_0x6e09('0x1f')](respondWithResult(_0x27c4e1,null))[_0x6e09('0x43')](handleError(_0x27c4e1,null));};exports[_0x6e09('0x4c')]=function(_0x10c475,_0x21a154,_0x478215){var _0x457253='';var _0x2918c5=['id',_0x6e09('0x22'),_0x6e09('0x4d'),_0x6e09('0x4e'),_0x6e09('0x4f'),_0x6e09('0x50'),'duration_hours','duration_minutes',_0x6e09('0x51'),_0x6e09('0x52'),_0x6e09('0x53'),_0x6e09('0x54')];return db[_0x6e09('0x24')][_0x6e09('0x47')]({'where':{'id':_0x10c475[_0x6e09('0x3d')]['id']},'attributes':['id',_0x6e09('0x55'),_0x6e09('0x56'),_0x6e09('0x57')]})[_0x6e09('0x1f')](handleEntityNotFound(_0x21a154,null))['then'](function(_0x38212e){if(_0x38212e){_0x457253=_0x38212e[_0x6e09('0x57')];var _0x2ae043=_0x457253[_0x6e09('0x58')](-0x1);if(_0x2ae043==='/'){_0x457253=_0x457253[_0x6e09('0x59')](0x0,_0x457253[_0x6e09('0x5a')](_0x2ae043));}return rp({'method':_0x6e09('0x5b'),'uri':util['format'](_0x6e09('0x5c'),_0x457253,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x6e09('0x5d'),'input_type':_0x6e09('0x5e'),'response_type':_0x6e09('0x5e'),'rest_data':JSON[_0x6e09('0x5f')]({'user_auth':{'user_name':_0x38212e[_0x6e09('0x55')],'password':_0x38212e['password'],'encryption':_0x6e09('0x60')},'application':_0x6e09('0x61')})}});}})[_0x6e09('0x1f')](function(_0x41bf5c){if(_0x41bf5c&&_0x41bf5c[_0x6e09('0x22')]!==_0x6e09('0x62')&&_0x41bf5c[_0x6e09('0x22')]!=='Password\x20Expired'){return rp({'method':_0x6e09('0x5b'),'uri':util[_0x6e09('0x63')](_0x6e09('0x5c'),_0x457253,_0x6e09('0x64')),'json':!![],'form':{'method':_0x6e09('0x65'),'input_type':'JSON','response_type':_0x6e09('0x5e'),'rest_data':JSON[_0x6e09('0x5f')]({'session':_0x41bf5c['id'],'module_name':_0x6e09('0x66')})}})[_0x6e09('0x1f')](function(_0x29199f){if(_0x29199f){var _0x198f2b=_['values'](_0x29199f[_0x6e09('0x67')]);_['remove'](_0x198f2b,function(_0x509e3f){return _0x2918c5[_0x6e09('0x68')](_0x509e3f['name']);});return{'count':_0x198f2b[_0x6e09('0x2e')],'rows':_[_0x6e09('0x28')](_0x198f2b,function(_0x10596f){return{'id':_0x10596f[_0x6e09('0x22')],'name':_0x10596f['label'],'custom':_['endsWith'](_0x10596f[_0x6e09('0x22')],'_c')?!![]:![],'options':_0x10596f[_0x6e09('0x37')]?_[_0x6e09('0x28')](_[_0x6e09('0x69')](_0x10596f[_0x6e09('0x37')]),function(_0x5337a9){return{'name':_0x5337a9[_0x6e09('0x6a')],'value':_0x5337a9[_0x6e09('0x22')]};}):[]};})};}})[_0x6e09('0x1f')](respondWithResult(_0x21a154,null))['catch'](function(_0x3f8f84){var _0x48b92a=_0x10c475[_0x6e09('0x29')][_0x6e09('0x6b')]?0x1f4:_0x3f8f84[_0x6e09('0x6c')]||0x1f4;logger[_0x6e09('0x20')](_0x6e09('0x6d'),_0x6e09('0x4c'),_0x48b92a,JSON[_0x6e09('0x5f')](_0x3f8f84));delete _0x3f8f84[_0x6e09('0x22')];if(_0x48b92a===0x191){_0x48b92a=0x190;}_0x21a154[_0x6e09('0x13')](_0x48b92a)[_0x6e09('0x23')](_0x10c475['query'][_0x6e09('0x6b')]?{'message':_0x6e09('0x6e'),'statusCode':_0x3f8f84[_0x6e09('0x6c')]}:_0x3f8f84);});}else{var _0x154230=0x1f4;_0x21a154[_0x6e09('0x13')](_0x154230)[_0x6e09('0x23')]({'message':_0x6e09('0x6e'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x7f2d=['status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','SugarcrmAccount','fieldName','type','key','model','query','filters','intersection','fields','attributes','nolimit','order','sort','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','rawAttributes','includeAll','find','create','body','findOne','SugarcrmConfiguration','length','pick','filter','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','created_by','description','date_start','duration_hours','duration_minutes','parent_name','password','remoteUri','substring','POST','format','%s%s','/service/v4_1/rest.php','JSON','username','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','stringify','Calls','values','module_fields','remove','includes','label','endsWith','value','test','statusCode','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','to-csv','ejs','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/license/util','../../mysqldb','sendStatus'];(function(_0x346ddd,_0x5939a2){var _0x500a63=function(_0x24d7c1){while(--_0x24d7c1){_0x346ddd['push'](_0x346ddd['shift']());}};_0x500a63(++_0x5939a2);}(_0x7f2d,0x157));var _0xd7f2=function(_0x302170,_0x82effd){_0x302170=_0x302170-0x0;var _0x3497c1=_0x7f2d[_0x302170];return _0x3497c1;};'use strict';var emlformat=require(_0xd7f2('0x0'));var rimraf=require(_0xd7f2('0x1'));var zipdir=require(_0xd7f2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd7f2('0x3'));var moment=require(_0xd7f2('0x4'));var BPromise=require(_0xd7f2('0x5'));var Mustache=require('mustache');var util=require(_0xd7f2('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xd7f2('0x7'));var ejs=require(_0xd7f2('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd7f2('0x9'));var squel=require(_0xd7f2('0xa'));var crypto=require(_0xd7f2('0xb'));var jsforce=require(_0xd7f2('0xc'));var deskjs=require(_0xd7f2('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd7f2('0xe'));var Papa=require('papaparse');var Redis=require(_0xd7f2('0xf'));var authService=require(_0xd7f2('0x10'));var qs=require(_0xd7f2('0x11'));var as=require(_0xd7f2('0x12'));var hardwareService=require(_0xd7f2('0x13'));var logger=require(_0xd7f2('0x14'))(_0xd7f2('0x15'));var utils=require(_0xd7f2('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd7f2('0x17'));var db=require(_0xd7f2('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x264c0b,_0x4a7460){_0x4a7460=_0x4a7460||0xcc;return function(_0x5e9625){if(_0x5e9625){return _0x264c0b[_0xd7f2('0x19')](_0x4a7460);}return _0x264c0b[_0xd7f2('0x1a')](_0x4a7460)['end']();};}function respondWithResult(_0xf2eb89,_0x4471bf){_0x4471bf=_0x4471bf||0xc8;return function(_0x1e9228){if(_0x1e9228){return _0xf2eb89[_0xd7f2('0x1a')](_0x4471bf)['json'](_0x1e9228);}};}function respondWithFilteredResult(_0x3ad748,_0x4f2eab){return function(_0x511f98){if(_0x511f98){var _0x105b01=typeof _0x4f2eab[_0xd7f2('0x1b')]===_0xd7f2('0x1c')&&typeof _0x4f2eab['limit']==='undefined';var _0x2d0711=_0x511f98['count'];var _0x2f7d48=_0x105b01?0x0:_0x4f2eab[_0xd7f2('0x1b')];var _0x91ffbc=_0x105b01?_0x511f98[_0xd7f2('0x1d')]:_0x4f2eab['offset']+_0x4f2eab[_0xd7f2('0x1e')];var _0x43c8fb;if(_0x91ffbc>=_0x2d0711){_0x91ffbc=_0x2d0711;_0x43c8fb=0xc8;}else{_0x43c8fb=0xce;}_0x3ad748['status'](_0x43c8fb);return _0x3ad748[_0xd7f2('0x1f')](_0xd7f2('0x20'),_0x2f7d48+'-'+_0x91ffbc+'/'+_0x2d0711)[_0xd7f2('0x21')](_0x511f98);}return null;};}function patchUpdates(_0x543792){return function(_0x2d67d2){try{jsonpatch[_0xd7f2('0x22')](_0x2d67d2,_0x543792,!![]);}catch(_0x1cfe35){return BPromise[_0xd7f2('0x23')](_0x1cfe35);}return _0x2d67d2[_0xd7f2('0x24')]();};}function saveUpdates(_0x5a1a74,_0x5e4cc1){return function(_0x5ab93b){if(_0x5ab93b){return _0x5ab93b[_0xd7f2('0x25')](_0x5a1a74)[_0xd7f2('0x26')](function(_0x1128de){return _0x1128de;});}return null;};}function removeEntity(_0x29a127,_0x5e6966){return function(_0x1acdeb){if(_0x1acdeb){return _0x1acdeb[_0xd7f2('0x27')]()[_0xd7f2('0x26')](function(){_0x29a127[_0xd7f2('0x1a')](0xcc)[_0xd7f2('0x28')]();});}};}function handleEntityNotFound(_0x23e4e1,_0xc90d82){return function(_0x5bb068){if(!_0x5bb068){_0x23e4e1[_0xd7f2('0x19')](0x194);}return _0x5bb068;};}function handleError(_0x246aec,_0x362a6d){_0x362a6d=_0x362a6d||0x1f4;return function(_0x5ac22e){logger[_0xd7f2('0x29')](_0x5ac22e[_0xd7f2('0x2a')]);if(_0x5ac22e['name']){delete _0x5ac22e[_0xd7f2('0x2b')];}_0x246aec[_0xd7f2('0x1a')](_0x362a6d)[_0xd7f2('0x2c')](_0x5ac22e);};}exports[_0xd7f2('0x2d')]=function(_0x1caa4e,_0x7a0c4a){var _0x5cb12f={},_0x670fa9={},_0x28b09d={'count':0x0,'rows':[]};var _0x52886e=_[_0xd7f2('0x2e')](db[_0xd7f2('0x2f')]['rawAttributes'],function(_0x230f0f){return{'name':_0x230f0f[_0xd7f2('0x30')],'type':_0x230f0f[_0xd7f2('0x31')][_0xd7f2('0x32')]};});_0x670fa9[_0xd7f2('0x33')]=_[_0xd7f2('0x2e')](_0x52886e,_0xd7f2('0x2b'));_0x670fa9[_0xd7f2('0x34')]=_['keys'](_0x1caa4e[_0xd7f2('0x34')]);_0x670fa9[_0xd7f2('0x35')]=_[_0xd7f2('0x36')](_0x670fa9[_0xd7f2('0x33')],_0x670fa9[_0xd7f2('0x34')]);_0x5cb12f['attributes']=_[_0xd7f2('0x36')](_0x670fa9[_0xd7f2('0x33')],qs['fields'](_0x1caa4e[_0xd7f2('0x34')][_0xd7f2('0x37')]));_0x5cb12f[_0xd7f2('0x38')]=_0x5cb12f[_0xd7f2('0x38')]['length']?_0x5cb12f[_0xd7f2('0x38')]:_0x670fa9['model'];if(!_0x1caa4e[_0xd7f2('0x34')]['hasOwnProperty'](_0xd7f2('0x39'))){_0x5cb12f[_0xd7f2('0x1e')]=qs[_0xd7f2('0x1e')](_0x1caa4e['query'][_0xd7f2('0x1e')]);_0x5cb12f[_0xd7f2('0x1b')]=qs[_0xd7f2('0x1b')](_0x1caa4e[_0xd7f2('0x34')]['offset']);}_0x5cb12f[_0xd7f2('0x3a')]=qs[_0xd7f2('0x3b')](_0x1caa4e[_0xd7f2('0x34')][_0xd7f2('0x3b')]);_0x5cb12f[_0xd7f2('0x3c')]=qs['filters'](_['pick'](_0x1caa4e[_0xd7f2('0x34')],_0x670fa9[_0xd7f2('0x35')]),_0x52886e);if(_0x1caa4e['query']['filter']){_0x5cb12f[_0xd7f2('0x3c')]=_[_0xd7f2('0x3d')](_0x5cb12f[_0xd7f2('0x3c')],{'$or':_[_0xd7f2('0x2e')](_0x52886e,function(_0x2c76e7){if(_0x2c76e7[_0xd7f2('0x31')]!==_0xd7f2('0x3e')){var _0x55c481={};_0x55c481[_0x2c76e7[_0xd7f2('0x2b')]]={'$like':'%'+_0x1caa4e[_0xd7f2('0x34')]['filter']+'%'};return _0x55c481;}})});}_0x5cb12f=_[_0xd7f2('0x3d')]({},_0x5cb12f,_0x1caa4e[_0xd7f2('0x3f')]);var _0x57f6bb={'where':_0x5cb12f[_0xd7f2('0x3c')]};return db[_0xd7f2('0x2f')][_0xd7f2('0x1d')](_0x57f6bb)[_0xd7f2('0x26')](function(_0x3ce874){_0x28b09d['count']=_0x3ce874;if(_0x1caa4e['query']['includeAll']){_0x5cb12f[_0xd7f2('0x40')]=[{'all':!![]}];}return db[_0xd7f2('0x2f')][_0xd7f2('0x41')](_0x5cb12f);})['then'](function(_0x557428){_0x28b09d[_0xd7f2('0x42')]=_0x557428;return _0x28b09d;})[_0xd7f2('0x26')](respondWithFilteredResult(_0x7a0c4a,_0x5cb12f))[_0xd7f2('0x43')](handleError(_0x7a0c4a,null));};exports[_0xd7f2('0x44')]=function(_0x4d1069,_0x366f07){var _0x36a7e3={'raw':![],'where':{'id':_0x4d1069[_0xd7f2('0x45')]['id']}},_0x3d87e2={};_0x3d87e2[_0xd7f2('0x33')]=_[_0xd7f2('0x46')](db[_0xd7f2('0x2f')][_0xd7f2('0x47')]);_0x3d87e2[_0xd7f2('0x34')]=_[_0xd7f2('0x46')](_0x4d1069[_0xd7f2('0x34')]);_0x3d87e2[_0xd7f2('0x35')]=_[_0xd7f2('0x36')](_0x3d87e2[_0xd7f2('0x33')],_0x3d87e2[_0xd7f2('0x34')]);_0x36a7e3[_0xd7f2('0x38')]=_['intersection'](_0x3d87e2[_0xd7f2('0x33')],qs[_0xd7f2('0x37')](_0x4d1069[_0xd7f2('0x34')]['fields']));_0x36a7e3[_0xd7f2('0x38')]=_0x36a7e3[_0xd7f2('0x38')]['length']?_0x36a7e3['attributes']:_0x3d87e2[_0xd7f2('0x33')];if(_0x4d1069[_0xd7f2('0x34')][_0xd7f2('0x48')]){_0x36a7e3[_0xd7f2('0x40')]=[{'all':!![]}];}_0x36a7e3=_[_0xd7f2('0x3d')]({},_0x36a7e3,_0x4d1069[_0xd7f2('0x3f')]);return db['SugarcrmAccount'][_0xd7f2('0x49')](_0x36a7e3)[_0xd7f2('0x26')](handleEntityNotFound(_0x366f07,null))[_0xd7f2('0x26')](respondWithResult(_0x366f07,null))[_0xd7f2('0x43')](handleError(_0x366f07,null));};exports[_0xd7f2('0x4a')]=function(_0x2119a6,_0x39aac8){return db['SugarcrmAccount'][_0xd7f2('0x4a')](_0x2119a6[_0xd7f2('0x4b')],{})[_0xd7f2('0x26')](respondWithResult(_0x39aac8,0xc9))[_0xd7f2('0x43')](handleError(_0x39aac8,null));};exports[_0xd7f2('0x25')]=function(_0xc42bdd,_0x17cb55){if(_0xc42bdd[_0xd7f2('0x4b')]['id']){delete _0xc42bdd[_0xd7f2('0x4b')]['id'];}return db[_0xd7f2('0x2f')]['find']({'where':{'id':_0xc42bdd['params']['id']}})[_0xd7f2('0x26')](handleEntityNotFound(_0x17cb55,null))[_0xd7f2('0x26')](saveUpdates(_0xc42bdd[_0xd7f2('0x4b')],null))[_0xd7f2('0x26')](respondWithResult(_0x17cb55,null))[_0xd7f2('0x43')](handleError(_0x17cb55,null));};exports[_0xd7f2('0x27')]=function(_0x2f390c,_0x6bd870){return db['SugarcrmAccount']['find']({'where':{'id':_0x2f390c['params']['id']}})['then'](handleEntityNotFound(_0x6bd870,null))[_0xd7f2('0x26')](removeEntity(_0x6bd870,null))[_0xd7f2('0x43')](handleError(_0x6bd870,null));};exports['getConfigurations']=function(_0xa2725e,_0x5c7473,_0xfc04a8){var _0x35b0a2={};var _0xe5a24c={};var _0x114d6e;var _0x565042;return db[_0xd7f2('0x2f')][_0xd7f2('0x4c')]({'where':{'id':_0xa2725e['params']['id']}})[_0xd7f2('0x26')](handleEntityNotFound(_0x5c7473,null))[_0xd7f2('0x26')](function(_0x2ac3f9){if(_0x2ac3f9){_0x114d6e=_0x2ac3f9;_0xe5a24c[_0xd7f2('0x33')]=_[_0xd7f2('0x46')](db[_0xd7f2('0x4d')][_0xd7f2('0x47')]);_0xe5a24c[_0xd7f2('0x34')]=_[_0xd7f2('0x46')](_0xa2725e[_0xd7f2('0x34')]);_0xe5a24c['filters']=_[_0xd7f2('0x36')](_0xe5a24c[_0xd7f2('0x33')],_0xe5a24c[_0xd7f2('0x34')]);_0x35b0a2[_0xd7f2('0x38')]=_[_0xd7f2('0x36')](_0xe5a24c[_0xd7f2('0x33')],qs[_0xd7f2('0x37')](_0xa2725e[_0xd7f2('0x34')]['fields']));_0x35b0a2['attributes']=_0x35b0a2[_0xd7f2('0x38')][_0xd7f2('0x4e')]?_0x35b0a2['attributes']:_0xe5a24c[_0xd7f2('0x33')];_0x35b0a2[_0xd7f2('0x3a')]=qs['sort'](_0xa2725e[_0xd7f2('0x34')][_0xd7f2('0x3b')]);_0x35b0a2[_0xd7f2('0x3c')]=qs[_0xd7f2('0x35')](_[_0xd7f2('0x4f')](_0xa2725e[_0xd7f2('0x34')],_0xe5a24c[_0xd7f2('0x35')]));if(_0xa2725e[_0xd7f2('0x34')]['filter']){_0x35b0a2['where']=_[_0xd7f2('0x3d')](_0x35b0a2[_0xd7f2('0x3c')],{'$or':_[_0xd7f2('0x2e')](_0x35b0a2['attributes'],function(_0x30ebdb){var _0x1e8a8e={};_0x1e8a8e[_0x30ebdb]={'$like':'%'+_0xa2725e['query'][_0xd7f2('0x50')]+'%'};return _0x1e8a8e;})});}_0x35b0a2=_[_0xd7f2('0x3d')]({},_0x35b0a2,_0xa2725e[_0xd7f2('0x3f')]);return _0x114d6e['getConfigurations'](_0x35b0a2);}})[_0xd7f2('0x26')](function(_0x3402d3){if(_0x3402d3){_0x565042=_0x3402d3['length'];if(!_0xa2725e[_0xd7f2('0x34')][_0xd7f2('0x51')](_0xd7f2('0x39'))){_0x35b0a2[_0xd7f2('0x1e')]=qs[_0xd7f2('0x1e')](_0xa2725e[_0xd7f2('0x34')][_0xd7f2('0x1e')]);_0x35b0a2['offset']=qs[_0xd7f2('0x1b')](_0xa2725e[_0xd7f2('0x34')][_0xd7f2('0x1b')]);}return _0x114d6e['getConfigurations'](_0x35b0a2);}})[_0xd7f2('0x26')](function(_0x2a94bb){if(_0x2a94bb){return _0x2a94bb?{'count':_0x565042,'rows':_0x2a94bb}:null;}})['then'](respondWithResult(_0x5c7473,null))[_0xd7f2('0x43')](handleError(_0x5c7473,null));};exports[_0xd7f2('0x52')]=function(_0x5b9711,_0x4e6f96,_0x265450){if(_0x5b9711[_0xd7f2('0x4b')]['id']){delete _0x5b9711[_0xd7f2('0x4b')]['id'];}return db[_0xd7f2('0x2f')]['findOne']({'where':{'id':_0x5b9711[_0xd7f2('0x45')]['id']}})['then'](handleEntityNotFound(_0x4e6f96,null))[_0xd7f2('0x26')](function(_0x267691){if(_0x267691){_0x5b9711['body'][_0xd7f2('0x53')]=_0x267691['id'];_0x5b9711[_0xd7f2('0x4b')][_0xd7f2('0x54')]=integrations[_0xd7f2('0x55')](_0x5b9711[_0xd7f2('0x4b')][_0xd7f2('0x56')],_0x5b9711[_0xd7f2('0x4b')]['type']);_0x5b9711[_0xd7f2('0x4b')][_0xd7f2('0x57')]=integrations[_0xd7f2('0x58')](_0x5b9711[_0xd7f2('0x4b')][_0xd7f2('0x56')],_0x5b9711['body'][_0xd7f2('0x31')]);return db[_0xd7f2('0x4d')][_0xd7f2('0x4a')](_0x5b9711[_0xd7f2('0x4b')],{'include':[{'model':db[_0xd7f2('0x59')],'as':'Subjects'},{'model':db['SugarcrmField'],'as':_0xd7f2('0x57')}]});}return null;})[_0xd7f2('0x26')](respondWithResult(_0x4e6f96,null))[_0xd7f2('0x43')](handleError(_0x4e6f96,null));};exports[_0xd7f2('0x5a')]=function(_0xac9529,_0x2ee5ce,_0x517096){var _0x3c88a9='';var _0x34887c=['id',_0xd7f2('0x2b'),'assigned_user_id',_0xd7f2('0x5b'),_0xd7f2('0x5c'),_0xd7f2('0x5d'),_0xd7f2('0x5e'),_0xd7f2('0x5f'),'parent_id','parent_type',_0xd7f2('0x60'),'direction'];return db[_0xd7f2('0x2f')][_0xd7f2('0x4c')]({'where':{'id':_0xac9529[_0xd7f2('0x45')]['id']},'attributes':['id','username',_0xd7f2('0x61'),_0xd7f2('0x62')]})[_0xd7f2('0x26')](handleEntityNotFound(_0x2ee5ce,null))[_0xd7f2('0x26')](function(_0xcb4505){if(_0xcb4505){_0x3c88a9=_0xcb4505[_0xd7f2('0x62')];var _0x297463=_0x3c88a9['slice'](-0x1);if(_0x297463==='/'){_0x3c88a9=_0x3c88a9[_0xd7f2('0x63')](0x0,_0x3c88a9['lastIndexOf'](_0x297463));}return rp({'method':_0xd7f2('0x64'),'uri':util[_0xd7f2('0x65')](_0xd7f2('0x66'),_0x3c88a9,_0xd7f2('0x67')),'json':!![],'form':{'method':'login','input_type':_0xd7f2('0x68'),'response_type':_0xd7f2('0x68'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0xcb4505[_0xd7f2('0x69')],'password':_0xcb4505[_0xd7f2('0x61')],'encryption':_0xd7f2('0x6a')},'application':_0xd7f2('0x6b')})}});}})[_0xd7f2('0x26')](function(_0x4c79de){if(_0x4c79de&&_0x4c79de[_0xd7f2('0x2b')]!==_0xd7f2('0x6c')&&_0x4c79de[_0xd7f2('0x2b')]!==_0xd7f2('0x6d')){return rp({'method':'POST','uri':util[_0xd7f2('0x65')](_0xd7f2('0x66'),_0x3c88a9,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xd7f2('0x6e'),'input_type':_0xd7f2('0x68'),'response_type':_0xd7f2('0x68'),'rest_data':JSON[_0xd7f2('0x6f')]({'session':_0x4c79de['id'],'module_name':_0xd7f2('0x70')})}})[_0xd7f2('0x26')](function(_0x295fe5){if(_0x295fe5){var _0x4974e7=_[_0xd7f2('0x71')](_0x295fe5[_0xd7f2('0x72')]);_[_0xd7f2('0x73')](_0x4974e7,function(_0x28002a){return _0x34887c[_0xd7f2('0x74')](_0x28002a[_0xd7f2('0x2b')]);});return{'count':_0x4974e7['length'],'rows':_['map'](_0x4974e7,function(_0x4e8a55){return{'id':_0x4e8a55[_0xd7f2('0x2b')],'name':_0x4e8a55[_0xd7f2('0x75')],'custom':_[_0xd7f2('0x76')](_0x4e8a55['name'],'_c')?!![]:![],'options':_0x4e8a55[_0xd7f2('0x3f')]?_['map'](_[_0xd7f2('0x71')](_0x4e8a55[_0xd7f2('0x3f')]),function(_0x328bec){return{'name':_0x328bec[_0xd7f2('0x77')],'value':_0x328bec[_0xd7f2('0x2b')]};}):[]};})};}})[_0xd7f2('0x26')](respondWithResult(_0x2ee5ce,null))[_0xd7f2('0x43')](function(_0x5b0fab){var _0x444828=_0xac9529[_0xd7f2('0x34')][_0xd7f2('0x78')]?0x1f4:_0x5b0fab[_0xd7f2('0x79')]||0x1f4;logger[_0xd7f2('0x29')]('getFields,\x20%s,\x20%s,\x20%s',_0xd7f2('0x5a'),_0x444828,JSON['stringify'](_0x5b0fab));delete _0x5b0fab['name'];if(_0x444828===0x191){_0x444828=0x190;}_0x2ee5ce[_0xd7f2('0x1a')](_0x444828)['send'](_0xac9529[_0xd7f2('0x34')][_0xd7f2('0x78')]?{'message':_0xd7f2('0x7a'),'statusCode':_0x5b0fab[_0xd7f2('0x79')]}:_0x5b0fab);});}else{var _0x8f7b52=0x1f4;_0x2ee5ce[_0xd7f2('0x1a')](_0x8f7b52)[_0xd7f2('0x2c')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index 6621d71..5dc9f9f 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 _0xca2c=['../../config/environment','./intSugarcrmAccount.attributes','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','path','rimraf'];(function(_0x2fdee1,_0x466858){var _0x2c5533=function(_0x1f34de){while(--_0x1f34de){_0x2fdee1['push'](_0x2fdee1['shift']());}};_0x2c5533(++_0x466858);}(_0xca2c,0x19b));var _0xcca2=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xca2c[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xcca2('0x0'));var util=require(_0xcca2('0x1'));var logger=require(_0xcca2('0x2'))(_0xcca2('0x3'));var moment=require(_0xcca2('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcca2('0x5'));var rimraf=require(_0xcca2('0x6'));var config=require(_0xcca2('0x7'));var attributes=require(_0xcca2('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x1c1d16,_0x262353){return _0x1c1d16['define'](_0xcca2('0x9'),attributes,{'tableName':_0xcca2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb01=['int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x44e417,_0x5a32f5){var _0x41456c=function(_0x2949fc){while(--_0x2949fc){_0x44e417['push'](_0x44e417['shift']());}};_0x41456c(++_0x5a32f5);}(_0xdb01,0x16d));var _0x1db0=function(_0x2ace72,_0x814809){_0x2ace72=_0x2ace72-0x0;var _0x33d102=_0xdb01[_0x2ace72];return _0x33d102;};'use strict';var _=require(_0x1db0('0x0'));var util=require(_0x1db0('0x1'));var logger=require(_0x1db0('0x2'))(_0x1db0('0x3'));var moment=require(_0x1db0('0x4'));var BPromise=require(_0x1db0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1db0('0x6'));var rimraf=require(_0x1db0('0x7'));var config=require(_0x1db0('0x8'));var attributes=require(_0x1db0('0x9'));var integrations=require(_0x1db0('0xa'));module[_0x1db0('0xb')]=function(_0x8c7d5d,_0x168ac5){return _0x8c7d5d[_0x1db0('0xc')]('SugarcrmAccount',attributes,{'tableName':_0x1db0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 183f58f..475c91a 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 _0x15d4=['stringify','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','options','raw','where','attributes','limit','map','include','model','then','ShowSugarcrmAccount','find','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s'];(function(_0x465723,_0x53b8e5){var _0x392934=function(_0x47bd5c){while(--_0x47bd5c){_0x465723['push'](_0x465723['shift']());}};_0x392934(++_0x53b8e5);}(_0x15d4,0x1b7));var _0x415d=function(_0x1bd13a,_0xbfaeb6){_0x1bd13a=_0x1bd13a-0x0;var _0x4bc8fe=_0x15d4[_0x1bd13a];return _0x4bc8fe;};'use strict';var _=require(_0x415d('0x0'));var util=require(_0x415d('0x1'));var moment=require(_0x415d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x415d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x415d('0x4'));var logger=require(_0x415d('0x5'))(_0x415d('0x6'));var config=require(_0x415d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x415d('0x8')][_0x415d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35536f,_0x14af82,_0x51da1b){return new BPromise(function(_0x4f342c,_0xf80a04){return client[_0x415d('0xa')](_0x35536f,_0x51da1b)['then'](function(_0x20f685){logger[_0x415d('0xb')](_0x415d('0xc'),_0x14af82,_0x415d('0xd'));logger[_0x415d('0xe')](_0x415d('0xf'),_0x14af82,_0x415d('0xd'),JSON[_0x415d('0x10')](_0x20f685));if(_0x20f685['error']){if(_0x20f685[_0x415d('0x11')][_0x415d('0x12')]===0x1f4){logger[_0x415d('0x11')](_0x415d('0xc'),_0x14af82,_0x20f685['error'][_0x415d('0x13')]);return _0xf80a04(_0x20f685[_0x415d('0x11')][_0x415d('0x13')]);}logger[_0x415d('0x11')](_0x415d('0xc'),_0x14af82,_0x20f685[_0x415d('0x11')][_0x415d('0x13')]);return _0x4f342c(_0x20f685['error'][_0x415d('0x13')]);}else{logger[_0x415d('0xb')](_0x415d('0xc'),_0x14af82,_0x415d('0xd'));_0x4f342c(_0x20f685[_0x415d('0x14')][_0x415d('0x13')]);}})[_0x415d('0x15')](function(_0x1caef0){logger[_0x415d('0x11')]('SugarcrmAccount,\x20%s,\x20%s',_0x14af82,_0x1caef0);_0xf80a04(_0x1caef0);});});}exports[_0x415d('0x16')]=function(_0x26cfb6){var _0x394090=this;return new Promise(function(_0x58d692,_0x4b575b){return db[_0x415d('0x17')]['findAll']({'raw':_0x26cfb6['options']?_0x26cfb6[_0x415d('0x18')][_0x415d('0x19')]===undefined?!![]:![]:!![],'where':_0x26cfb6[_0x415d('0x18')]?_0x26cfb6[_0x415d('0x18')][_0x415d('0x1a')]||null:null,'attributes':_0x26cfb6['options']?_0x26cfb6[_0x415d('0x18')][_0x415d('0x1b')]||null:null,'limit':_0x26cfb6[_0x415d('0x18')]?_0x26cfb6[_0x415d('0x18')][_0x415d('0x1c')]||null:null,'include':_0x26cfb6[_0x415d('0x18')]?_0x26cfb6[_0x415d('0x18')]['include']?_[_0x415d('0x1d')](_0x26cfb6[_0x415d('0x18')][_0x415d('0x1e')],function(_0x7fbd01){return{'model':db[_0x7fbd01[_0x415d('0x1f')]],'as':_0x7fbd01['as'],'attributes':_0x7fbd01['attributes'],'include':_0x7fbd01[_0x415d('0x1e')]?_[_0x415d('0x1d')](_0x7fbd01[_0x415d('0x1e')],function(_0x56f487){return{'model':db[_0x56f487[_0x415d('0x1f')]],'as':_0x56f487['as'],'attributes':_0x56f487['attributes'],'include':_0x56f487[_0x415d('0x1e')]?_[_0x415d('0x1d')](_0x56f487[_0x415d('0x1e')],function(_0x44d301){return{'model':db[_0x44d301['model']],'as':_0x44d301['as'],'attributes':_0x44d301[_0x415d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x415d('0x20')](function(_0x492fef){logger[_0x415d('0xb')](_0x415d('0x16'),_0x26cfb6);logger[_0x415d('0xe')]('GetSugarcrmAccount',_0x26cfb6,JSON[_0x415d('0x10')](_0x492fef));_0x58d692(_0x492fef);})[_0x415d('0x15')](function(_0x355952){logger['error'](_0x415d('0x16'),_0x355952[_0x415d('0x13')],_0x26cfb6);_0x4b575b(_0x394090[_0x415d('0x11')](0x1f4,_0x355952[_0x415d('0x13')]));});});};exports[_0x415d('0x21')]=function(_0x1df59b){var _0x43b9b7=this;return new Promise(function(_0x9a59bc,_0xf7c800){return db['SugarcrmAccount'][_0x415d('0x22')]({'raw':_0x1df59b[_0x415d('0x18')]?_0x1df59b[_0x415d('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1df59b[_0x415d('0x18')]?_0x1df59b[_0x415d('0x18')]['where']||null:null,'attributes':_0x1df59b['options']?_0x1df59b[_0x415d('0x18')][_0x415d('0x1b')]||null:null,'include':_0x1df59b[_0x415d('0x18')]?_0x1df59b['options'][_0x415d('0x1e')]?_[_0x415d('0x1d')](_0x1df59b[_0x415d('0x18')][_0x415d('0x1e')],function(_0x518830){return{'model':db[_0x518830[_0x415d('0x1f')]],'as':_0x518830['as'],'attributes':_0x518830[_0x415d('0x1b')],'include':_0x518830[_0x415d('0x1e')]?_[_0x415d('0x1d')](_0x518830[_0x415d('0x1e')],function(_0x210c58){return{'model':db[_0x210c58[_0x415d('0x1f')]],'as':_0x210c58['as'],'attributes':_0x210c58['attributes'],'include':_0x210c58[_0x415d('0x1e')]?_['map'](_0x210c58['include'],function(_0x1344cf){return{'model':db[_0x1344cf[_0x415d('0x1f')]],'as':_0x1344cf['as'],'attributes':_0x1344cf[_0x415d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x415d('0x20')](function(_0xa2d7e5){logger[_0x415d('0xb')](_0x415d('0x21'),_0x1df59b);logger['debug'](_0x415d('0x21'),_0x1df59b,JSON[_0x415d('0x10')](_0xa2d7e5));_0x9a59bc(_0xa2d7e5);})[_0x415d('0x15')](function(_0x4508cb){logger[_0x415d('0x11')](_0x415d('0x21'),_0x4508cb['message'],_0x1df59b);_0xf7c800(_0x43b9b7['error'](0x1f4,_0x4508cb['message']));});});}; \ No newline at end of file +var _0x675a=['result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','attributes','include','map','model','debug','ShowSugarcrmAccount','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SugarcrmAccount,\x20%s,\x20%s','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x675a,0x199));var _0xa675=function(_0x27438b,_0x978ecd){_0x27438b=_0x27438b-0x0;var _0xec6b=_0x675a[_0x27438b];return _0xec6b;};'use strict';var _=require(_0xa675('0x0'));var util=require(_0xa675('0x1'));var moment=require('moment');var BPromise=require(_0xa675('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa675('0x3'));var db=require(_0xa675('0x4'))['db'];var utils=require(_0xa675('0x5'));var logger=require(_0xa675('0x6'))(_0xa675('0x7'));var config=require('../../config/environment');var jayson=require(_0xa675('0x8'));var client=jayson[_0xa675('0x9')][_0xa675('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc37642,_0x244607,_0x1cbf1c){return new BPromise(function(_0x290a03,_0x4cf774){return client[_0xa675('0xb')](_0xc37642,_0x1cbf1c)[_0xa675('0xc')](function(_0x4b2a3b){logger[_0xa675('0xd')]('SugarcrmAccount,\x20%s,\x20%s',_0x244607,'request\x20sent');logger['debug'](_0xa675('0xe'),_0x244607,_0xa675('0xf'),JSON[_0xa675('0x10')](_0x4b2a3b));if(_0x4b2a3b['error']){if(_0x4b2a3b[_0xa675('0x11')]['code']===0x1f4){logger[_0xa675('0x11')](_0xa675('0x12'),_0x244607,_0x4b2a3b[_0xa675('0x11')][_0xa675('0x13')]);return _0x4cf774(_0x4b2a3b[_0xa675('0x11')]['message']);}logger['error'](_0xa675('0x12'),_0x244607,_0x4b2a3b['error'][_0xa675('0x13')]);return _0x290a03(_0x4b2a3b[_0xa675('0x11')][_0xa675('0x13')]);}else{logger[_0xa675('0xd')](_0xa675('0x12'),_0x244607,_0xa675('0xf'));_0x290a03(_0x4b2a3b[_0xa675('0x14')][_0xa675('0x13')]);}})[_0xa675('0x15')](function(_0x1bba48){logger[_0xa675('0x11')]('SugarcrmAccount,\x20%s,\x20%s',_0x244607,_0x1bba48);_0x4cf774(_0x1bba48);});});}exports[_0xa675('0x16')]=function(_0x1bbc79){var _0x3b6bd6=this;return new Promise(function(_0x80dd7c,_0x1dee02){return db[_0xa675('0x17')][_0xa675('0x18')]({'raw':_0x1bbc79[_0xa675('0x19')]?_0x1bbc79[_0xa675('0x19')][_0xa675('0x1a')]===undefined?!![]:![]:!![],'where':_0x1bbc79[_0xa675('0x19')]?_0x1bbc79[_0xa675('0x19')]['where']||null:null,'attributes':_0x1bbc79[_0xa675('0x19')]?_0x1bbc79[_0xa675('0x19')][_0xa675('0x1b')]||null:null,'limit':_0x1bbc79[_0xa675('0x19')]?_0x1bbc79[_0xa675('0x19')]['limit']||null:null,'include':_0x1bbc79[_0xa675('0x19')]?_0x1bbc79[_0xa675('0x19')][_0xa675('0x1c')]?_[_0xa675('0x1d')](_0x1bbc79[_0xa675('0x19')][_0xa675('0x1c')],function(_0x1a55ca){return{'model':db[_0x1a55ca['model']],'as':_0x1a55ca['as'],'attributes':_0x1a55ca[_0xa675('0x1b')],'include':_0x1a55ca[_0xa675('0x1c')]?_[_0xa675('0x1d')](_0x1a55ca['include'],function(_0x428586){return{'model':db[_0x428586[_0xa675('0x1e')]],'as':_0x428586['as'],'attributes':_0x428586[_0xa675('0x1b')],'include':_0x428586[_0xa675('0x1c')]?_[_0xa675('0x1d')](_0x428586['include'],function(_0x5a4554){return{'model':db[_0x5a4554['model']],'as':_0x5a4554['as'],'attributes':_0x5a4554['attributes']};}):[]};}):[]};}):[]:[]})[_0xa675('0xc')](function(_0x257977){logger[_0xa675('0xd')](_0xa675('0x16'),_0x1bbc79);logger[_0xa675('0x1f')](_0xa675('0x16'),_0x1bbc79,JSON['stringify'](_0x257977));_0x80dd7c(_0x257977);})[_0xa675('0x15')](function(_0x1b1993){logger['error']('GetSugarcrmAccount',_0x1b1993['message'],_0x1bbc79);_0x1dee02(_0x3b6bd6[_0xa675('0x11')](0x1f4,_0x1b1993['message']));});});};exports[_0xa675('0x20')]=function(_0x1683ca){var _0x21753f=this;return new Promise(function(_0x3ca5cd,_0x13004c){return db[_0xa675('0x17')]['find']({'raw':_0x1683ca[_0xa675('0x19')]?_0x1683ca[_0xa675('0x19')][_0xa675('0x1a')]===undefined?!![]:![]:!![],'where':_0x1683ca[_0xa675('0x19')]?_0x1683ca[_0xa675('0x19')]['where']||null:null,'attributes':_0x1683ca['options']?_0x1683ca[_0xa675('0x19')][_0xa675('0x1b')]||null:null,'include':_0x1683ca[_0xa675('0x19')]?_0x1683ca['options'][_0xa675('0x1c')]?_[_0xa675('0x1d')](_0x1683ca[_0xa675('0x19')][_0xa675('0x1c')],function(_0xb8a4dc){return{'model':db[_0xb8a4dc[_0xa675('0x1e')]],'as':_0xb8a4dc['as'],'attributes':_0xb8a4dc[_0xa675('0x1b')],'include':_0xb8a4dc[_0xa675('0x1c')]?_[_0xa675('0x1d')](_0xb8a4dc[_0xa675('0x1c')],function(_0x1ef067){return{'model':db[_0x1ef067[_0xa675('0x1e')]],'as':_0x1ef067['as'],'attributes':_0x1ef067[_0xa675('0x1b')],'include':_0x1ef067['include']?_[_0xa675('0x1d')](_0x1ef067['include'],function(_0x27723a){return{'model':db[_0x27723a['model']],'as':_0x27723a['as'],'attributes':_0x27723a[_0xa675('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa675('0xc')](function(_0x40ebe6){logger[_0xa675('0xd')](_0xa675('0x20'),_0x1683ca);logger[_0xa675('0x1f')](_0xa675('0x20'),_0x1683ca,JSON[_0xa675('0x10')](_0x40ebe6));_0x3ca5cd(_0x40ebe6);})[_0xa675('0x15')](function(_0x5d15ae){logger['error'](_0xa675('0x20'),_0x5d15ae[_0xa675('0x13')],_0x1683ca);_0x13004c(_0x21753f[_0xa675('0x11')](0x1f4,_0x5d15ae['message']));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 13c7eda..895be74 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 _0x3b0a=['getSubjects','/:id/descriptions','getDescriptions','post','/:id','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields'];(function(_0x5d55e3,_0x191cab){var _0x480c1d=function(_0x3e22a6){while(--_0x3e22a6){_0x5d55e3['push'](_0x5d55e3['shift']());}};_0x480c1d(++_0x191cab);}(_0x3b0a,0x1be));var _0xa3b0=function(_0xeb6df0,_0x5c8a20){_0xeb6df0=_0xeb6df0-0x0;var _0x1014e4=_0x3b0a[_0xeb6df0];return _0x1014e4;};'use strict';var multer=require(_0xa3b0('0x0'));var util=require(_0xa3b0('0x1'));var path=require(_0xa3b0('0x2'));var timeout=require('connect-timeout');var express=require(_0xa3b0('0x3'));var router=express[_0xa3b0('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa3b0('0x5'));var config=require(_0xa3b0('0x6'));var controller=require(_0xa3b0('0x7'));router[_0xa3b0('0x8')]('/',auth[_0xa3b0('0x9')](),controller[_0xa3b0('0xa')]);router[_0xa3b0('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xa3b0('0xb')]);router[_0xa3b0('0x8')](_0xa3b0('0xc'),auth[_0xa3b0('0x9')](),controller[_0xa3b0('0xd')]);router['get']('/:id/subjects',auth[_0xa3b0('0x9')](),controller[_0xa3b0('0xe')]);router[_0xa3b0('0x8')](_0xa3b0('0xf'),auth[_0xa3b0('0x9')](),controller[_0xa3b0('0x10')]);router[_0xa3b0('0x11')]('/',auth[_0xa3b0('0x9')](),controller['create']);router['put'](_0xa3b0('0x12'),auth[_0xa3b0('0x9')](),controller['update']);router['delete'](_0xa3b0('0x12'),auth['isAuthenticated'](),controller['destroy']);module[_0xa3b0('0x13')]=router; \ No newline at end of file +var _0x87c6=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','update','destroy','multer','util','connect-timeout','express'];(function(_0x445c98,_0x132bf7){var _0x2fe913=function(_0x32e864){while(--_0x32e864){_0x445c98['push'](_0x445c98['shift']());}};_0x2fe913(++_0x132bf7);}(_0x87c6,0x104));var _0x687c=function(_0x478c25,_0x35cf71){_0x478c25=_0x478c25-0x0;var _0x638553=_0x87c6[_0x478c25];return _0x638553;};'use strict';var multer=require(_0x687c('0x0'));var util=require(_0x687c('0x1'));var path=require('path');var timeout=require(_0x687c('0x2'));var express=require(_0x687c('0x3'));var router=express[_0x687c('0x4')]();var fs_extra=require(_0x687c('0x5'));var auth=require(_0x687c('0x6'));var interaction=require(_0x687c('0x7'));var config=require(_0x687c('0x8'));var controller=require(_0x687c('0x9'));router[_0x687c('0xa')]('/',auth[_0x687c('0xb')](),controller[_0x687c('0xc')]);router['get'](_0x687c('0xd'),auth[_0x687c('0xb')](),controller[_0x687c('0xe')]);router[_0x687c('0xa')](_0x687c('0xf'),auth[_0x687c('0xb')](),controller[_0x687c('0x10')]);router['get'](_0x687c('0x11'),auth[_0x687c('0xb')](),controller[_0x687c('0x12')]);router[_0x687c('0xa')]('/:id/descriptions',auth[_0x687c('0xb')](),controller[_0x687c('0x13')]);router[_0x687c('0x14')]('/',auth[_0x687c('0xb')](),controller[_0x687c('0x15')]);router['put'](_0x687c('0xd'),auth[_0x687c('0xb')](),controller[_0x687c('0x16')]);router['delete']('/:id',auth[_0x687c('0xb')](),controller[_0x687c('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 777d2ba..5572e01 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 _0xee50=['exports','STRING'];(function(_0x5641f8,_0x3db978){var _0x3311b6=function(_0x562694){while(--_0x562694){_0x5641f8['push'](_0x5641f8['shift']());}};_0x3311b6(++_0x3db978);}(_0xee50,0x1a6));var _0x0ee5=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xee50[_0x3511d3];return _0x5d6321;};'use strict';var Sequelize=require('sequelize');module[_0x0ee5('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0ee5('0x1')]}}; \ No newline at end of file +var _0x9b51=['sequelize','exports','STRING'];(function(_0x4d4150,_0x457770){var _0x2fff47=function(_0x3bf624){while(--_0x3bf624){_0x4d4150['push'](_0x4d4150['shift']());}};_0x2fff47(++_0x457770);}(_0x9b51,0x1c5));var _0x19b5=function(_0x3959f2,_0x80ed23){_0x3959f2=_0x3959f2-0x0;var _0x4e68d7=_0x9b51[_0x3959f2];return _0x4e68d7;};'use strict';var Sequelize=require(_0x19b5('0x0'));module[_0x19b5('0x1')]={'name':{'type':Sequelize[_0x19b5('0x2')]},'description':{'type':Sequelize[_0x19b5('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index eeaadbb..09405be 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 _0xdcce=['catch','show','params','rawAttributes','include','find','create','body','update','destroy','getFields','findOne','SugarcrmField','getSubjects','pick','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','sendStatus','end','offset','limit','undefined','count','status','set','Content-Range','json','reject','save','then','error','stack','name','send','index','SugarcrmConfiguration','fieldName','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','includeAll','findAll','rows'];(function(_0x2a3de3,_0x5eb367){var _0x101538=function(_0x2910e5){while(--_0x2910e5){_0x2a3de3['push'](_0x2a3de3['shift']());}};_0x101538(++_0x5eb367);}(_0xdcce,0xfd));var _0xedcc=function(_0x1a7742,_0x4a4ff4){_0x1a7742=_0x1a7742-0x0;var _0x3ca023=_0xdcce[_0x1a7742];return _0x3ca023;};'use strict';var emlformat=require(_0xedcc('0x0'));var rimraf=require(_0xedcc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xedcc('0x2'));var rp=require(_0xedcc('0x3'));var moment=require(_0xedcc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xedcc('0x5'));var util=require(_0xedcc('0x6'));var path=require(_0xedcc('0x7'));var sox=require('sox');var csv=require(_0xedcc('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xedcc('0x9'));var _=require(_0xedcc('0xa'));var squel=require('squel');var crypto=require(_0xedcc('0xb'));var jsforce=require(_0xedcc('0xc'));var deskjs=require(_0xedcc('0xd'));var toCsv=require(_0xedcc('0x8'));var querystring=require(_0xedcc('0xe'));var Papa=require(_0xedcc('0xf'));var Redis=require(_0xedcc('0x10'));var authService=require(_0xedcc('0x11'));var qs=require(_0xedcc('0x12'));var as=require(_0xedcc('0x13'));var hardwareService=require(_0xedcc('0x14'));var logger=require(_0xedcc('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xedcc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2afdf7,_0x2758ba){_0x2758ba=_0x2758ba||0xcc;return function(_0x255648){if(_0x255648){return _0x2afdf7[_0xedcc('0x17')](_0x2758ba);}return _0x2afdf7['status'](_0x2758ba)[_0xedcc('0x18')]();};}function respondWithResult(_0xfaa640,_0x5dd64f){_0x5dd64f=_0x5dd64f||0xc8;return function(_0x3513da){if(_0x3513da){return _0xfaa640['status'](_0x5dd64f)['json'](_0x3513da);}};}function respondWithFilteredResult(_0x3e1646,_0x2fc73e){return function(_0x5d3676){if(_0x5d3676){var _0x148a21=typeof _0x2fc73e[_0xedcc('0x19')]==='undefined'&&typeof _0x2fc73e[_0xedcc('0x1a')]===_0xedcc('0x1b');var _0x1c852f=_0x5d3676[_0xedcc('0x1c')];var _0x2bbb92=_0x148a21?0x0:_0x2fc73e[_0xedcc('0x19')];var _0x1d4a3a=_0x148a21?_0x5d3676[_0xedcc('0x1c')]:_0x2fc73e[_0xedcc('0x19')]+_0x2fc73e[_0xedcc('0x1a')];var _0x3d0c37;if(_0x1d4a3a>=_0x1c852f){_0x1d4a3a=_0x1c852f;_0x3d0c37=0xc8;}else{_0x3d0c37=0xce;}_0x3e1646[_0xedcc('0x1d')](_0x3d0c37);return _0x3e1646[_0xedcc('0x1e')](_0xedcc('0x1f'),_0x2bbb92+'-'+_0x1d4a3a+'/'+_0x1c852f)[_0xedcc('0x20')](_0x5d3676);}return null;};}function patchUpdates(_0xefe0f2){return function(_0x28443a){try{jsonpatch['apply'](_0x28443a,_0xefe0f2,!![]);}catch(_0x3533ab){return BPromise[_0xedcc('0x21')](_0x3533ab);}return _0x28443a[_0xedcc('0x22')]();};}function saveUpdates(_0x183988,_0x345213){return function(_0x52296a){if(_0x52296a){return _0x52296a['update'](_0x183988)[_0xedcc('0x23')](function(_0x5a3a00){return _0x5a3a00;});}return null;};}function removeEntity(_0x400374,_0x1a5654){return function(_0x3db39d){if(_0x3db39d){return _0x3db39d['destroy']()[_0xedcc('0x23')](function(){_0x400374[_0xedcc('0x1d')](0xcc)[_0xedcc('0x18')]();});}};}function handleEntityNotFound(_0x2ebebe,_0x3c77f2){return function(_0x489fde){if(!_0x489fde){_0x2ebebe[_0xedcc('0x17')](0x194);}return _0x489fde;};}function handleError(_0x5f4542,_0x2e0474){_0x2e0474=_0x2e0474||0x1f4;return function(_0x2b4317){logger[_0xedcc('0x24')](_0x2b4317[_0xedcc('0x25')]);if(_0x2b4317[_0xedcc('0x26')]){delete _0x2b4317[_0xedcc('0x26')];}_0x5f4542['status'](_0x2e0474)[_0xedcc('0x27')](_0x2b4317);};}exports[_0xedcc('0x28')]=function(_0x18ce37,_0x9ece64){var _0xead953={},_0x459ced={},_0x3fcdd7={'count':0x0,'rows':[]};var _0x2063cc=_['map'](db[_0xedcc('0x29')]['rawAttributes'],function(_0x49db21){return{'name':_0x49db21[_0xedcc('0x2a')],'type':_0x49db21['type']['key']};});_0x459ced['model']=_[_0xedcc('0x2b')](_0x2063cc,'name');_0x459ced[_0xedcc('0x2c')]=_[_0xedcc('0x2d')](_0x18ce37[_0xedcc('0x2c')]);_0x459ced[_0xedcc('0x2e')]=_[_0xedcc('0x2f')](_0x459ced[_0xedcc('0x30')],_0x459ced['query']);_0xead953['attributes']=_[_0xedcc('0x2f')](_0x459ced[_0xedcc('0x30')],qs['fields'](_0x18ce37[_0xedcc('0x2c')][_0xedcc('0x31')]));_0xead953[_0xedcc('0x32')]=_0xead953[_0xedcc('0x32')][_0xedcc('0x33')]?_0xead953[_0xedcc('0x32')]:_0x459ced[_0xedcc('0x30')];if(!_0x18ce37[_0xedcc('0x2c')][_0xedcc('0x34')](_0xedcc('0x35'))){_0xead953[_0xedcc('0x1a')]=qs[_0xedcc('0x1a')](_0x18ce37['query'][_0xedcc('0x1a')]);_0xead953[_0xedcc('0x19')]=qs[_0xedcc('0x19')](_0x18ce37['query']['offset']);}_0xead953[_0xedcc('0x36')]=qs[_0xedcc('0x37')](_0x18ce37['query'][_0xedcc('0x37')]);_0xead953['where']=qs[_0xedcc('0x2e')](_['pick'](_0x18ce37[_0xedcc('0x2c')],_0x459ced['filters']),_0x2063cc);if(_0x18ce37[_0xedcc('0x2c')][_0xedcc('0x38')]){_0xead953[_0xedcc('0x39')]=_[_0xedcc('0x3a')](_0xead953[_0xedcc('0x39')],{'$or':_[_0xedcc('0x2b')](_0x2063cc,function(_0x1e984f){if(_0x1e984f['type']!=='VIRTUAL'){var _0x354f19={};_0x354f19[_0x1e984f[_0xedcc('0x26')]]={'$like':'%'+_0x18ce37['query'][_0xedcc('0x38')]+'%'};return _0x354f19;}})});}_0xead953=_[_0xedcc('0x3a')]({},_0xead953,_0x18ce37[_0xedcc('0x3b')]);var _0x59eb3d={'where':_0xead953[_0xedcc('0x39')]};return db[_0xedcc('0x29')][_0xedcc('0x1c')](_0x59eb3d)[_0xedcc('0x23')](function(_0x20834b){_0x3fcdd7[_0xedcc('0x1c')]=_0x20834b;if(_0x18ce37[_0xedcc('0x2c')][_0xedcc('0x3c')]){_0xead953['include']=[{'all':!![]}];}return db[_0xedcc('0x29')][_0xedcc('0x3d')](_0xead953);})['then'](function(_0x5b2cd7){_0x3fcdd7[_0xedcc('0x3e')]=_0x5b2cd7;return _0x3fcdd7;})[_0xedcc('0x23')](respondWithFilteredResult(_0x9ece64,_0xead953))[_0xedcc('0x3f')](handleError(_0x9ece64,null));};exports[_0xedcc('0x40')]=function(_0x54bf4b,_0x5eaf3e){var _0x3b643f={'raw':![],'where':{'id':_0x54bf4b[_0xedcc('0x41')]['id']}},_0x1b86fa={};_0x1b86fa['model']=_[_0xedcc('0x2d')](db['SugarcrmConfiguration'][_0xedcc('0x42')]);_0x1b86fa[_0xedcc('0x2c')]=_[_0xedcc('0x2d')](_0x54bf4b[_0xedcc('0x2c')]);_0x1b86fa['filters']=_[_0xedcc('0x2f')](_0x1b86fa['model'],_0x1b86fa[_0xedcc('0x2c')]);_0x3b643f[_0xedcc('0x32')]=_[_0xedcc('0x2f')](_0x1b86fa['model'],qs['fields'](_0x54bf4b[_0xedcc('0x2c')][_0xedcc('0x31')]));_0x3b643f[_0xedcc('0x32')]=_0x3b643f[_0xedcc('0x32')][_0xedcc('0x33')]?_0x3b643f[_0xedcc('0x32')]:_0x1b86fa['model'];if(_0x54bf4b[_0xedcc('0x2c')][_0xedcc('0x3c')]){_0x3b643f[_0xedcc('0x43')]=[{'all':!![]}];}_0x3b643f=_[_0xedcc('0x3a')]({},_0x3b643f,_0x54bf4b[_0xedcc('0x3b')]);return db['SugarcrmConfiguration'][_0xedcc('0x44')](_0x3b643f)['then'](handleEntityNotFound(_0x5eaf3e,null))['then'](respondWithResult(_0x5eaf3e,null))[_0xedcc('0x3f')](handleError(_0x5eaf3e,null));};exports[_0xedcc('0x45')]=function(_0x3ef009,_0x50b12b){return db[_0xedcc('0x29')]['create'](_0x3ef009[_0xedcc('0x46')],{})[_0xedcc('0x23')](respondWithResult(_0x50b12b,0xc9))['catch'](handleError(_0x50b12b,null));};exports[_0xedcc('0x47')]=function(_0x3ffb73,_0xe84e42){if(_0x3ffb73[_0xedcc('0x46')]['id']){delete _0x3ffb73[_0xedcc('0x46')]['id'];}return db['SugarcrmConfiguration']['find']({'where':{'id':_0x3ffb73[_0xedcc('0x41')]['id']}})['then'](handleEntityNotFound(_0xe84e42,null))[_0xedcc('0x23')](saveUpdates(_0x3ffb73[_0xedcc('0x46')],null))['then'](respondWithResult(_0xe84e42,null))[_0xedcc('0x3f')](handleError(_0xe84e42,null));};exports[_0xedcc('0x48')]=function(_0x3cfbc0,_0x24e9d0){return db[_0xedcc('0x29')][_0xedcc('0x44')]({'where':{'id':_0x3cfbc0[_0xedcc('0x41')]['id']}})['then'](handleEntityNotFound(_0x24e9d0,null))['then'](removeEntity(_0x24e9d0,null))['catch'](handleError(_0x24e9d0,null));};exports[_0xedcc('0x49')]=function(_0x35c974,_0x43dade,_0x390085){var _0xadecc2={};var _0x4efc57={};var _0x5f0480;var _0x541709;return db[_0xedcc('0x29')][_0xedcc('0x4a')]({'where':{'id':_0x35c974[_0xedcc('0x41')]['id']}})[_0xedcc('0x23')](handleEntityNotFound(_0x43dade,null))[_0xedcc('0x23')](function(_0x871b50){if(_0x871b50){_0x5f0480=_0x871b50;_0x4efc57[_0xedcc('0x30')]=_['keys'](db[_0xedcc('0x4b')]['rawAttributes']);_0x4efc57[_0xedcc('0x2c')]=_[_0xedcc('0x2d')](_0x35c974[_0xedcc('0x2c')]);_0x4efc57[_0xedcc('0x2e')]=_['intersection'](_0x4efc57[_0xedcc('0x30')],_0x4efc57[_0xedcc('0x2c')]);_0xadecc2[_0xedcc('0x32')]=_[_0xedcc('0x2f')](_0x4efc57['model'],qs[_0xedcc('0x31')](_0x35c974[_0xedcc('0x2c')][_0xedcc('0x31')]));_0xadecc2[_0xedcc('0x32')]=_0xadecc2[_0xedcc('0x32')]['length']?_0xadecc2[_0xedcc('0x32')]:_0x4efc57[_0xedcc('0x30')];_0xadecc2[_0xedcc('0x36')]=qs[_0xedcc('0x37')](_0x35c974[_0xedcc('0x2c')]['sort']);_0xadecc2['where']=qs[_0xedcc('0x2e')](_['pick'](_0x35c974[_0xedcc('0x2c')],_0x4efc57[_0xedcc('0x2e')]));if(_0x35c974['query'][_0xedcc('0x38')]){_0xadecc2['where']=_['merge'](_0xadecc2[_0xedcc('0x39')],{'$or':_['map'](_0xadecc2[_0xedcc('0x32')],function(_0x4a6fca){var _0x2233e5={};_0x2233e5[_0x4a6fca]={'$like':'%'+_0x35c974[_0xedcc('0x2c')][_0xedcc('0x38')]+'%'};return _0x2233e5;})});}_0xadecc2=_[_0xedcc('0x3a')]({},_0xadecc2,_0x35c974[_0xedcc('0x3b')]);return _0x5f0480[_0xedcc('0x49')](_0xadecc2);}})[_0xedcc('0x23')](function(_0x38c015){if(_0x38c015){_0x541709=_0x38c015[_0xedcc('0x33')];if(!_0x35c974[_0xedcc('0x2c')][_0xedcc('0x34')]('nolimit')){_0xadecc2[_0xedcc('0x1a')]=qs[_0xedcc('0x1a')](_0x35c974[_0xedcc('0x2c')][_0xedcc('0x1a')]);_0xadecc2[_0xedcc('0x19')]=qs[_0xedcc('0x19')](_0x35c974[_0xedcc('0x2c')][_0xedcc('0x19')]);}return _0x5f0480[_0xedcc('0x49')](_0xadecc2);}})[_0xedcc('0x23')](function(_0x4b9661){if(_0x4b9661){return _0x4b9661?{'count':_0x541709,'rows':_0x4b9661}:null;}})[_0xedcc('0x23')](respondWithResult(_0x43dade,null))[_0xedcc('0x3f')](handleError(_0x43dade,null));};exports[_0xedcc('0x4c')]=function(_0x479770,_0x27c9c7,_0x51f54c){var _0x2f5cde={};var _0x14b008={};var _0x3b3c4e;var _0x19b857;return db[_0xedcc('0x29')][_0xedcc('0x4a')]({'where':{'id':_0x479770[_0xedcc('0x41')]['id']}})[_0xedcc('0x23')](handleEntityNotFound(_0x27c9c7,null))[_0xedcc('0x23')](function(_0x46ad6f){if(_0x46ad6f){_0x3b3c4e=_0x46ad6f;_0x14b008[_0xedcc('0x30')]=_['keys'](db[_0xedcc('0x4b')][_0xedcc('0x42')]);_0x14b008[_0xedcc('0x2c')]=_[_0xedcc('0x2d')](_0x479770[_0xedcc('0x2c')]);_0x14b008['filters']=_[_0xedcc('0x2f')](_0x14b008[_0xedcc('0x30')],_0x14b008[_0xedcc('0x2c')]);_0x2f5cde[_0xedcc('0x32')]=_['intersection'](_0x14b008[_0xedcc('0x30')],qs[_0xedcc('0x31')](_0x479770[_0xedcc('0x2c')]['fields']));_0x2f5cde[_0xedcc('0x32')]=_0x2f5cde['attributes'][_0xedcc('0x33')]?_0x2f5cde['attributes']:_0x14b008['model'];_0x2f5cde['order']=qs[_0xedcc('0x37')](_0x479770[_0xedcc('0x2c')][_0xedcc('0x37')]);_0x2f5cde['where']=qs['filters'](_[_0xedcc('0x4d')](_0x479770[_0xedcc('0x2c')],_0x14b008[_0xedcc('0x2e')]));if(_0x479770[_0xedcc('0x2c')][_0xedcc('0x38')]){_0x2f5cde[_0xedcc('0x39')]=_[_0xedcc('0x3a')](_0x2f5cde[_0xedcc('0x39')],{'$or':_[_0xedcc('0x2b')](_0x2f5cde[_0xedcc('0x32')],function(_0x22c674){var _0x99ac06={};_0x99ac06[_0x22c674]={'$like':'%'+_0x479770['query'][_0xedcc('0x38')]+'%'};return _0x99ac06;})});}_0x2f5cde=_[_0xedcc('0x3a')]({},_0x2f5cde,_0x479770[_0xedcc('0x3b')]);return _0x3b3c4e['getSubjects'](_0x2f5cde);}})[_0xedcc('0x23')](function(_0x249062){if(_0x249062){_0x19b857=_0x249062[_0xedcc('0x33')];if(!_0x479770['query'][_0xedcc('0x34')](_0xedcc('0x35'))){_0x2f5cde[_0xedcc('0x1a')]=qs[_0xedcc('0x1a')](_0x479770[_0xedcc('0x2c')][_0xedcc('0x1a')]);_0x2f5cde[_0xedcc('0x19')]=qs[_0xedcc('0x19')](_0x479770['query']['offset']);}return _0x3b3c4e[_0xedcc('0x4c')](_0x2f5cde);}})[_0xedcc('0x23')](function(_0x49b01c){if(_0x49b01c){return _0x49b01c?{'count':_0x19b857,'rows':_0x49b01c}:null;}})[_0xedcc('0x23')](respondWithResult(_0x27c9c7,null))['catch'](handleError(_0x27c9c7,null));};exports[_0xedcc('0x4e')]=function(_0x2de92c,_0xdbb4ed,_0x28ba3a){var _0x12166f={};var _0x3fc7f2={};var _0x74ce39;var _0x245539;return db[_0xedcc('0x29')]['findOne']({'where':{'id':_0x2de92c[_0xedcc('0x41')]['id']}})[_0xedcc('0x23')](handleEntityNotFound(_0xdbb4ed,null))[_0xedcc('0x23')](function(_0x41081e){if(_0x41081e){_0x74ce39=_0x41081e;_0x3fc7f2[_0xedcc('0x30')]=_[_0xedcc('0x2d')](db[_0xedcc('0x4b')]['rawAttributes']);_0x3fc7f2[_0xedcc('0x2c')]=_['keys'](_0x2de92c[_0xedcc('0x2c')]);_0x3fc7f2['filters']=_[_0xedcc('0x2f')](_0x3fc7f2[_0xedcc('0x30')],_0x3fc7f2['query']);_0x12166f[_0xedcc('0x32')]=_[_0xedcc('0x2f')](_0x3fc7f2[_0xedcc('0x30')],qs[_0xedcc('0x31')](_0x2de92c[_0xedcc('0x2c')][_0xedcc('0x31')]));_0x12166f['attributes']=_0x12166f[_0xedcc('0x32')][_0xedcc('0x33')]?_0x12166f['attributes']:_0x3fc7f2[_0xedcc('0x30')];_0x12166f[_0xedcc('0x36')]=qs[_0xedcc('0x37')](_0x2de92c[_0xedcc('0x2c')]['sort']);_0x12166f[_0xedcc('0x39')]=qs['filters'](_[_0xedcc('0x4d')](_0x2de92c[_0xedcc('0x2c')],_0x3fc7f2[_0xedcc('0x2e')]));if(_0x2de92c[_0xedcc('0x2c')][_0xedcc('0x38')]){_0x12166f[_0xedcc('0x39')]=_[_0xedcc('0x3a')](_0x12166f['where'],{'$or':_['map'](_0x12166f[_0xedcc('0x32')],function(_0x566a36){var _0x24f434={};_0x24f434[_0x566a36]={'$like':'%'+_0x2de92c[_0xedcc('0x2c')]['filter']+'%'};return _0x24f434;})});}_0x12166f=_[_0xedcc('0x3a')]({},_0x12166f,_0x2de92c['options']);return _0x74ce39[_0xedcc('0x4e')](_0x12166f);}})['then'](function(_0x3ac1b7){if(_0x3ac1b7){_0x245539=_0x3ac1b7[_0xedcc('0x33')];if(!_0x2de92c[_0xedcc('0x2c')][_0xedcc('0x34')](_0xedcc('0x35'))){_0x12166f[_0xedcc('0x1a')]=qs[_0xedcc('0x1a')](_0x2de92c[_0xedcc('0x2c')][_0xedcc('0x1a')]);_0x12166f[_0xedcc('0x19')]=qs[_0xedcc('0x19')](_0x2de92c[_0xedcc('0x2c')][_0xedcc('0x19')]);}return _0x74ce39[_0xedcc('0x4e')](_0x12166f);}})[_0xedcc('0x23')](function(_0x2ae98e){if(_0x2ae98e){return _0x2ae98e?{'count':_0x245539,'rows':_0x2ae98e}:null;}})[_0xedcc('0x23')](respondWithResult(_0xdbb4ed,null))[_0xedcc('0x3f')](handleError(_0xdbb4ed,null));}; \ No newline at end of file +var _0xa981=['desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','apply','save','update','destroy','then','end','sendStatus','error','stack','name','send','index','map','SugarcrmConfiguration','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','create','body','find','findOne','getFields','getSubjects','getDescriptions','SugarcrmField','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto'];(function(_0x1932fe,_0x2ed263){var _0x49c8b2=function(_0x564358){while(--_0x564358){_0x1932fe['push'](_0x1932fe['shift']());}};_0x49c8b2(++_0x2ed263);}(_0xa981,0x13b));var _0x1a98=function(_0x5ea7a8,_0x257068){_0x5ea7a8=_0x5ea7a8-0x0;var _0x1b2e3a=_0xa981[_0x5ea7a8];return _0x1b2e3a;};'use strict';var emlformat=require(_0x1a98('0x0'));var rimraf=require(_0x1a98('0x1'));var zipdir=require(_0x1a98('0x2'));var jsonpatch=require(_0x1a98('0x3'));var rp=require(_0x1a98('0x4'));var moment=require(_0x1a98('0x5'));var BPromise=require(_0x1a98('0x6'));var Mustache=require(_0x1a98('0x7'));var util=require('util');var path=require(_0x1a98('0x8'));var sox=require('sox');var csv=require(_0x1a98('0x9'));var ejs=require(_0x1a98('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1a98('0xb'));var crypto=require(_0x1a98('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1a98('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1a98('0xe'));var Redis=require(_0x1a98('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1a98('0x10'));var as=require(_0x1a98('0x11'));var hardwareService=require(_0x1a98('0x12'));var logger=require(_0x1a98('0x13'))(_0x1a98('0x14'));var utils=require(_0x1a98('0x15'));var config=require(_0x1a98('0x16'));var licenseUtil=require(_0x1a98('0x17'));var db=require(_0x1a98('0x18'))['db'];function respondWithStatusCode(_0x687947,_0x459ffb){_0x459ffb=_0x459ffb||0xcc;return function(_0x22f5fb){if(_0x22f5fb){return _0x687947['sendStatus'](_0x459ffb);}return _0x687947[_0x1a98('0x19')](_0x459ffb)['end']();};}function respondWithResult(_0x15a823,_0x10be1c){_0x10be1c=_0x10be1c||0xc8;return function(_0x52b652){if(_0x52b652){return _0x15a823['status'](_0x10be1c)[_0x1a98('0x1a')](_0x52b652);}};}function respondWithFilteredResult(_0x7f0605,_0x553981){return function(_0xbdcc3e){if(_0xbdcc3e){var _0x10995e=typeof _0x553981[_0x1a98('0x1b')]===_0x1a98('0x1c')&&typeof _0x553981[_0x1a98('0x1d')]===_0x1a98('0x1c');var _0x2758da=_0xbdcc3e[_0x1a98('0x1e')];var _0x4df19e=_0x10995e?0x0:_0x553981[_0x1a98('0x1b')];var _0x1cc4e3=_0x10995e?_0xbdcc3e[_0x1a98('0x1e')]:_0x553981[_0x1a98('0x1b')]+_0x553981[_0x1a98('0x1d')];var _0x5acd92;if(_0x1cc4e3>=_0x2758da){_0x1cc4e3=_0x2758da;_0x5acd92=0xc8;}else{_0x5acd92=0xce;}_0x7f0605['status'](_0x5acd92);return _0x7f0605['set']('Content-Range',_0x4df19e+'-'+_0x1cc4e3+'/'+_0x2758da)[_0x1a98('0x1a')](_0xbdcc3e);}return null;};}function patchUpdates(_0x14c6a8){return function(_0x34edb5){try{jsonpatch[_0x1a98('0x1f')](_0x34edb5,_0x14c6a8,!![]);}catch(_0x3a1eb4){return BPromise['reject'](_0x3a1eb4);}return _0x34edb5[_0x1a98('0x20')]();};}function saveUpdates(_0x4b81f2,_0x201dc4){return function(_0x111dfd){if(_0x111dfd){return _0x111dfd[_0x1a98('0x21')](_0x4b81f2)['then'](function(_0x31c85f){return _0x31c85f;});}return null;};}function removeEntity(_0x259c68,_0x5609a1){return function(_0x4d8cf9){if(_0x4d8cf9){return _0x4d8cf9[_0x1a98('0x22')]()[_0x1a98('0x23')](function(){_0x259c68[_0x1a98('0x19')](0xcc)[_0x1a98('0x24')]();});}};}function handleEntityNotFound(_0x4392dc,_0x2e4d75){return function(_0x388da1){if(!_0x388da1){_0x4392dc[_0x1a98('0x25')](0x194);}return _0x388da1;};}function handleError(_0x322fcf,_0x445a18){_0x445a18=_0x445a18||0x1f4;return function(_0x3d6f24){logger[_0x1a98('0x26')](_0x3d6f24[_0x1a98('0x27')]);if(_0x3d6f24[_0x1a98('0x28')]){delete _0x3d6f24[_0x1a98('0x28')];}_0x322fcf[_0x1a98('0x19')](_0x445a18)[_0x1a98('0x29')](_0x3d6f24);};}exports[_0x1a98('0x2a')]=function(_0x4f834a,_0x57660f){var _0x5d5bd4={},_0x4cfd9d={},_0xdec4c5={'count':0x0,'rows':[]};var _0x119055=_[_0x1a98('0x2b')](db[_0x1a98('0x2c')]['rawAttributes'],function(_0x600db1){return{'name':_0x600db1[_0x1a98('0x2d')],'type':_0x600db1[_0x1a98('0x2e')][_0x1a98('0x2f')]};});_0x4cfd9d[_0x1a98('0x30')]=_[_0x1a98('0x2b')](_0x119055,'name');_0x4cfd9d['query']=_[_0x1a98('0x31')](_0x4f834a[_0x1a98('0x32')]);_0x4cfd9d[_0x1a98('0x33')]=_[_0x1a98('0x34')](_0x4cfd9d[_0x1a98('0x30')],_0x4cfd9d['query']);_0x5d5bd4[_0x1a98('0x35')]=_[_0x1a98('0x34')](_0x4cfd9d[_0x1a98('0x30')],qs[_0x1a98('0x36')](_0x4f834a['query']['fields']));_0x5d5bd4[_0x1a98('0x35')]=_0x5d5bd4[_0x1a98('0x35')][_0x1a98('0x37')]?_0x5d5bd4[_0x1a98('0x35')]:_0x4cfd9d[_0x1a98('0x30')];if(!_0x4f834a[_0x1a98('0x32')][_0x1a98('0x38')](_0x1a98('0x39'))){_0x5d5bd4[_0x1a98('0x1d')]=qs[_0x1a98('0x1d')](_0x4f834a[_0x1a98('0x32')][_0x1a98('0x1d')]);_0x5d5bd4['offset']=qs['offset'](_0x4f834a['query'][_0x1a98('0x1b')]);}_0x5d5bd4[_0x1a98('0x3a')]=qs[_0x1a98('0x3b')](_0x4f834a[_0x1a98('0x32')]['sort']);_0x5d5bd4[_0x1a98('0x3c')]=qs[_0x1a98('0x33')](_[_0x1a98('0x3d')](_0x4f834a['query'],_0x4cfd9d[_0x1a98('0x33')]),_0x119055);if(_0x4f834a['query'][_0x1a98('0x3e')]){_0x5d5bd4[_0x1a98('0x3c')]=_[_0x1a98('0x3f')](_0x5d5bd4[_0x1a98('0x3c')],{'$or':_[_0x1a98('0x2b')](_0x119055,function(_0x1058e4){if(_0x1058e4[_0x1a98('0x2e')]!==_0x1a98('0x40')){var _0x43d6bd={};_0x43d6bd[_0x1058e4[_0x1a98('0x28')]]={'$like':'%'+_0x4f834a[_0x1a98('0x32')]['filter']+'%'};return _0x43d6bd;}})});}_0x5d5bd4=_[_0x1a98('0x3f')]({},_0x5d5bd4,_0x4f834a['options']);var _0x44c64c={'where':_0x5d5bd4[_0x1a98('0x3c')]};return db[_0x1a98('0x2c')][_0x1a98('0x1e')](_0x44c64c)[_0x1a98('0x23')](function(_0x3e8c94){_0xdec4c5[_0x1a98('0x1e')]=_0x3e8c94;if(_0x4f834a['query'][_0x1a98('0x41')]){_0x5d5bd4[_0x1a98('0x42')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x1a98('0x43')](_0x5d5bd4);})['then'](function(_0x4e24b0){_0xdec4c5[_0x1a98('0x44')]=_0x4e24b0;return _0xdec4c5;})['then'](respondWithFilteredResult(_0x57660f,_0x5d5bd4))[_0x1a98('0x45')](handleError(_0x57660f,null));};exports[_0x1a98('0x46')]=function(_0x2df9b9,_0xf575ba){var _0x96c968={'raw':![],'where':{'id':_0x2df9b9[_0x1a98('0x47')]['id']}},_0x13e88d={};_0x13e88d[_0x1a98('0x30')]=_[_0x1a98('0x31')](db[_0x1a98('0x2c')][_0x1a98('0x48')]);_0x13e88d[_0x1a98('0x32')]=_['keys'](_0x2df9b9[_0x1a98('0x32')]);_0x13e88d[_0x1a98('0x33')]=_[_0x1a98('0x34')](_0x13e88d['model'],_0x13e88d[_0x1a98('0x32')]);_0x96c968[_0x1a98('0x35')]=_[_0x1a98('0x34')](_0x13e88d['model'],qs[_0x1a98('0x36')](_0x2df9b9['query']['fields']));_0x96c968['attributes']=_0x96c968[_0x1a98('0x35')][_0x1a98('0x37')]?_0x96c968[_0x1a98('0x35')]:_0x13e88d[_0x1a98('0x30')];if(_0x2df9b9['query'][_0x1a98('0x41')]){_0x96c968['include']=[{'all':!![]}];}_0x96c968=_[_0x1a98('0x3f')]({},_0x96c968,_0x2df9b9[_0x1a98('0x49')]);return db['SugarcrmConfiguration']['find'](_0x96c968)[_0x1a98('0x23')](handleEntityNotFound(_0xf575ba,null))['then'](respondWithResult(_0xf575ba,null))[_0x1a98('0x45')](handleError(_0xf575ba,null));};exports[_0x1a98('0x4a')]=function(_0x4e2636,_0x46a282){return db[_0x1a98('0x2c')][_0x1a98('0x4a')](_0x4e2636[_0x1a98('0x4b')],{})[_0x1a98('0x23')](respondWithResult(_0x46a282,0xc9))['catch'](handleError(_0x46a282,null));};exports[_0x1a98('0x21')]=function(_0x421f92,_0x15dcd3){if(_0x421f92['body']['id']){delete _0x421f92[_0x1a98('0x4b')]['id'];}return db['SugarcrmConfiguration'][_0x1a98('0x4c')]({'where':{'id':_0x421f92[_0x1a98('0x47')]['id']}})[_0x1a98('0x23')](handleEntityNotFound(_0x15dcd3,null))['then'](saveUpdates(_0x421f92[_0x1a98('0x4b')],null))[_0x1a98('0x23')](respondWithResult(_0x15dcd3,null))[_0x1a98('0x45')](handleError(_0x15dcd3,null));};exports[_0x1a98('0x22')]=function(_0x15dbde,_0x57ca59){return db[_0x1a98('0x2c')][_0x1a98('0x4c')]({'where':{'id':_0x15dbde[_0x1a98('0x47')]['id']}})[_0x1a98('0x23')](handleEntityNotFound(_0x57ca59,null))[_0x1a98('0x23')](removeEntity(_0x57ca59,null))[_0x1a98('0x45')](handleError(_0x57ca59,null));};exports['getFields']=function(_0x51dc25,_0xd43693,_0x10a8aa){var _0x3b46ea={};var _0x257fc4={};var _0x1071a8;var _0x426e3a;return db['SugarcrmConfiguration'][_0x1a98('0x4d')]({'where':{'id':_0x51dc25[_0x1a98('0x47')]['id']}})[_0x1a98('0x23')](handleEntityNotFound(_0xd43693,null))[_0x1a98('0x23')](function(_0x4f24c6){if(_0x4f24c6){_0x1071a8=_0x4f24c6;_0x257fc4[_0x1a98('0x30')]=_['keys'](db['SugarcrmField'][_0x1a98('0x48')]);_0x257fc4[_0x1a98('0x32')]=_[_0x1a98('0x31')](_0x51dc25[_0x1a98('0x32')]);_0x257fc4[_0x1a98('0x33')]=_[_0x1a98('0x34')](_0x257fc4[_0x1a98('0x30')],_0x257fc4[_0x1a98('0x32')]);_0x3b46ea[_0x1a98('0x35')]=_[_0x1a98('0x34')](_0x257fc4[_0x1a98('0x30')],qs[_0x1a98('0x36')](_0x51dc25[_0x1a98('0x32')][_0x1a98('0x36')]));_0x3b46ea[_0x1a98('0x35')]=_0x3b46ea['attributes']['length']?_0x3b46ea[_0x1a98('0x35')]:_0x257fc4['model'];_0x3b46ea[_0x1a98('0x3a')]=qs[_0x1a98('0x3b')](_0x51dc25[_0x1a98('0x32')][_0x1a98('0x3b')]);_0x3b46ea[_0x1a98('0x3c')]=qs['filters'](_[_0x1a98('0x3d')](_0x51dc25[_0x1a98('0x32')],_0x257fc4['filters']));if(_0x51dc25[_0x1a98('0x32')]['filter']){_0x3b46ea[_0x1a98('0x3c')]=_[_0x1a98('0x3f')](_0x3b46ea[_0x1a98('0x3c')],{'$or':_[_0x1a98('0x2b')](_0x3b46ea[_0x1a98('0x35')],function(_0x2e412e){var _0x494a30={};_0x494a30[_0x2e412e]={'$like':'%'+_0x51dc25['query'][_0x1a98('0x3e')]+'%'};return _0x494a30;})});}_0x3b46ea=_[_0x1a98('0x3f')]({},_0x3b46ea,_0x51dc25[_0x1a98('0x49')]);return _0x1071a8[_0x1a98('0x4e')](_0x3b46ea);}})[_0x1a98('0x23')](function(_0x1e031e){if(_0x1e031e){_0x426e3a=_0x1e031e[_0x1a98('0x37')];if(!_0x51dc25[_0x1a98('0x32')]['hasOwnProperty'](_0x1a98('0x39'))){_0x3b46ea[_0x1a98('0x1d')]=qs[_0x1a98('0x1d')](_0x51dc25[_0x1a98('0x32')][_0x1a98('0x1d')]);_0x3b46ea[_0x1a98('0x1b')]=qs[_0x1a98('0x1b')](_0x51dc25[_0x1a98('0x32')][_0x1a98('0x1b')]);}return _0x1071a8[_0x1a98('0x4e')](_0x3b46ea);}})[_0x1a98('0x23')](function(_0x37b30a){if(_0x37b30a){return _0x37b30a?{'count':_0x426e3a,'rows':_0x37b30a}:null;}})[_0x1a98('0x23')](respondWithResult(_0xd43693,null))[_0x1a98('0x45')](handleError(_0xd43693,null));};exports[_0x1a98('0x4f')]=function(_0x472550,_0x339769,_0x51f23d){var _0x2ffe6d={};var _0x11a5a5={};var _0x559b16;var _0x3601e7;return db[_0x1a98('0x2c')][_0x1a98('0x4d')]({'where':{'id':_0x472550['params']['id']}})['then'](handleEntityNotFound(_0x339769,null))[_0x1a98('0x23')](function(_0x29cbac){if(_0x29cbac){_0x559b16=_0x29cbac;_0x11a5a5[_0x1a98('0x30')]=_[_0x1a98('0x31')](db['SugarcrmField'][_0x1a98('0x48')]);_0x11a5a5[_0x1a98('0x32')]=_['keys'](_0x472550['query']);_0x11a5a5[_0x1a98('0x33')]=_[_0x1a98('0x34')](_0x11a5a5[_0x1a98('0x30')],_0x11a5a5[_0x1a98('0x32')]);_0x2ffe6d['attributes']=_[_0x1a98('0x34')](_0x11a5a5[_0x1a98('0x30')],qs[_0x1a98('0x36')](_0x472550[_0x1a98('0x32')]['fields']));_0x2ffe6d[_0x1a98('0x35')]=_0x2ffe6d[_0x1a98('0x35')][_0x1a98('0x37')]?_0x2ffe6d[_0x1a98('0x35')]:_0x11a5a5[_0x1a98('0x30')];_0x2ffe6d[_0x1a98('0x3a')]=qs['sort'](_0x472550[_0x1a98('0x32')][_0x1a98('0x3b')]);_0x2ffe6d[_0x1a98('0x3c')]=qs[_0x1a98('0x33')](_[_0x1a98('0x3d')](_0x472550[_0x1a98('0x32')],_0x11a5a5[_0x1a98('0x33')]));if(_0x472550[_0x1a98('0x32')][_0x1a98('0x3e')]){_0x2ffe6d[_0x1a98('0x3c')]=_[_0x1a98('0x3f')](_0x2ffe6d['where'],{'$or':_['map'](_0x2ffe6d[_0x1a98('0x35')],function(_0x95a577){var _0x235482={};_0x235482[_0x95a577]={'$like':'%'+_0x472550[_0x1a98('0x32')][_0x1a98('0x3e')]+'%'};return _0x235482;})});}_0x2ffe6d=_[_0x1a98('0x3f')]({},_0x2ffe6d,_0x472550[_0x1a98('0x49')]);return _0x559b16['getSubjects'](_0x2ffe6d);}})[_0x1a98('0x23')](function(_0x276e33){if(_0x276e33){_0x3601e7=_0x276e33['length'];if(!_0x472550[_0x1a98('0x32')][_0x1a98('0x38')](_0x1a98('0x39'))){_0x2ffe6d[_0x1a98('0x1d')]=qs[_0x1a98('0x1d')](_0x472550[_0x1a98('0x32')][_0x1a98('0x1d')]);_0x2ffe6d[_0x1a98('0x1b')]=qs['offset'](_0x472550[_0x1a98('0x32')][_0x1a98('0x1b')]);}return _0x559b16[_0x1a98('0x4f')](_0x2ffe6d);}})[_0x1a98('0x23')](function(_0x209ea9){if(_0x209ea9){return _0x209ea9?{'count':_0x3601e7,'rows':_0x209ea9}:null;}})[_0x1a98('0x23')](respondWithResult(_0x339769,null))[_0x1a98('0x45')](handleError(_0x339769,null));};exports[_0x1a98('0x50')]=function(_0x36b76a,_0x23b046,_0x7f239a){var _0x32cf60={};var _0x3d2e69={};var _0x270d04;var _0x5b9799;return db[_0x1a98('0x2c')]['findOne']({'where':{'id':_0x36b76a[_0x1a98('0x47')]['id']}})[_0x1a98('0x23')](handleEntityNotFound(_0x23b046,null))[_0x1a98('0x23')](function(_0x421987){if(_0x421987){_0x270d04=_0x421987;_0x3d2e69[_0x1a98('0x30')]=_['keys'](db[_0x1a98('0x51')][_0x1a98('0x48')]);_0x3d2e69['query']=_[_0x1a98('0x31')](_0x36b76a[_0x1a98('0x32')]);_0x3d2e69['filters']=_[_0x1a98('0x34')](_0x3d2e69['model'],_0x3d2e69[_0x1a98('0x32')]);_0x32cf60[_0x1a98('0x35')]=_[_0x1a98('0x34')](_0x3d2e69[_0x1a98('0x30')],qs[_0x1a98('0x36')](_0x36b76a[_0x1a98('0x32')]['fields']));_0x32cf60[_0x1a98('0x35')]=_0x32cf60['attributes'][_0x1a98('0x37')]?_0x32cf60[_0x1a98('0x35')]:_0x3d2e69[_0x1a98('0x30')];_0x32cf60['order']=qs[_0x1a98('0x3b')](_0x36b76a[_0x1a98('0x32')][_0x1a98('0x3b')]);_0x32cf60['where']=qs[_0x1a98('0x33')](_[_0x1a98('0x3d')](_0x36b76a['query'],_0x3d2e69[_0x1a98('0x33')]));if(_0x36b76a[_0x1a98('0x32')][_0x1a98('0x3e')]){_0x32cf60['where']=_[_0x1a98('0x3f')](_0x32cf60[_0x1a98('0x3c')],{'$or':_[_0x1a98('0x2b')](_0x32cf60[_0x1a98('0x35')],function(_0x2ef9fe){var _0x5e6a55={};_0x5e6a55[_0x2ef9fe]={'$like':'%'+_0x36b76a[_0x1a98('0x32')][_0x1a98('0x3e')]+'%'};return _0x5e6a55;})});}_0x32cf60=_[_0x1a98('0x3f')]({},_0x32cf60,_0x36b76a[_0x1a98('0x49')]);return _0x270d04[_0x1a98('0x50')](_0x32cf60);}})[_0x1a98('0x23')](function(_0x5c5b5c){if(_0x5c5b5c){_0x5b9799=_0x5c5b5c[_0x1a98('0x37')];if(!_0x36b76a[_0x1a98('0x32')][_0x1a98('0x38')](_0x1a98('0x39'))){_0x32cf60[_0x1a98('0x1d')]=qs[_0x1a98('0x1d')](_0x36b76a[_0x1a98('0x32')][_0x1a98('0x1d')]);_0x32cf60['offset']=qs[_0x1a98('0x1b')](_0x36b76a[_0x1a98('0x32')][_0x1a98('0x1b')]);}return _0x270d04[_0x1a98('0x50')](_0x32cf60);}})[_0x1a98('0x23')](function(_0x357692){if(_0x357692){return _0x357692?{'count':_0x5b9799,'rows':_0x357692}:null;}})[_0x1a98('0x23')](respondWithResult(_0x23b046,null))[_0x1a98('0x45')](handleError(_0x23b046,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index aebafc1..db48165 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 _0x2cbf=['api','moment','bluebird','../../config/environment','./intSugarcrmConfiguration.attributes','define','SugarcrmConfiguration','int_sugarcrm_configurations','util'];(function(_0x5585f5,_0x167771){var _0x3439c9=function(_0x207c3f){while(--_0x207c3f){_0x5585f5['push'](_0x5585f5['shift']());}};_0x3439c9(++_0x167771);}(_0x2cbf,0x1ee));var _0xf2cb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2cbf[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xf2cb('0x0'));var logger=require('../../config/logger')(_0xf2cb('0x1'));var moment=require(_0xf2cb('0x2'));var BPromise=require(_0xf2cb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf2cb('0x4'));var attributes=require(_0xf2cb('0x5'));module['exports']=function(_0x231684,_0xac30cc){return _0x231684[_0xf2cb('0x6')](_0xf2cb('0x7'),attributes,{'tableName':_0xf2cb('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8788=['int_sugarcrm_configurations','util','api','moment','bluebird','path','../../config/environment','define'];(function(_0x55b12c,_0x3cb64c){var _0x533da6=function(_0xfc808d){while(--_0xfc808d){_0x55b12c['push'](_0x55b12c['shift']());}};_0x533da6(++_0x3cb64c);}(_0x8788,0x169));var _0x8878=function(_0x8dc04d,_0xaa7559){_0x8dc04d=_0x8dc04d-0x0;var _0x2f5f28=_0x8788[_0x8dc04d];return _0x2f5f28;};'use strict';var _=require('lodash');var util=require(_0x8878('0x0'));var logger=require('../../config/logger')(_0x8878('0x1'));var moment=require(_0x8878('0x2'));var BPromise=require(_0x8878('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8878('0x4'));var rimraf=require('rimraf');var config=require(_0x8878('0x5'));var attributes=require('./intSugarcrmConfiguration.attributes');module['exports']=function(_0x96d06f,_0x46d602){return _0x96d06f[_0x8878('0x6')]('SugarcrmConfiguration',attributes,{'tableName':_0x8878('0x7'),'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 ff58d98..7604f33 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 _0xee44=['bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x571a17,_0x63fb3d){var _0x3ef337=function(_0x12096b){while(--_0x12096b){_0x571a17['push'](_0x571a17['shift']());}};_0x3ef337(++_0x63fb3d);}(_0xee44,0xbd));var _0x4ee4=function(_0x1572b4,_0x5b737c){_0x1572b4=_0x1572b4-0x0;var _0x1fb071=_0xee44[_0x1572b4];return _0x1fb071;};'use strict';var _=require(_0x4ee4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4ee4('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4ee4('0x2'))['db'];var utils=require(_0x4ee4('0x3'));var logger=require('../../config/logger')(_0x4ee4('0x4'));var config=require(_0x4ee4('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x4ee4('0x6')][_0x4ee4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x538fc3,_0xc20545,_0x3a30ef){return new BPromise(function(_0x3bae4d,_0x454252){return client[_0x4ee4('0x8')](_0x538fc3,_0x3a30ef)[_0x4ee4('0x9')](function(_0x4d7ff4){logger[_0x4ee4('0xa')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xc20545,_0x4ee4('0xb'));logger['debug']('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0xc20545,_0x4ee4('0xb'),JSON[_0x4ee4('0xc')](_0x4d7ff4));if(_0x4d7ff4[_0x4ee4('0xd')]){if(_0x4d7ff4[_0x4ee4('0xd')][_0x4ee4('0xe')]===0x1f4){logger['error'](_0x4ee4('0xf'),_0xc20545,_0x4d7ff4[_0x4ee4('0xd')][_0x4ee4('0x10')]);return _0x454252(_0x4d7ff4[_0x4ee4('0xd')]['message']);}logger[_0x4ee4('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xc20545,_0x4d7ff4['error'][_0x4ee4('0x10')]);return _0x3bae4d(_0x4d7ff4[_0x4ee4('0xd')][_0x4ee4('0x10')]);}else{logger[_0x4ee4('0xa')](_0x4ee4('0xf'),_0xc20545,_0x4ee4('0xb'));_0x3bae4d(_0x4d7ff4[_0x4ee4('0x11')][_0x4ee4('0x10')]);}})[_0x4ee4('0x12')](function(_0x4388a3){logger[_0x4ee4('0xd')](_0x4ee4('0xf'),_0xc20545,_0x4388a3);_0x454252(_0x4388a3);});});} \ No newline at end of file +var _0xd8ec=['info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x804aa7,_0x5252d1){var _0x4e148f=function(_0x9a9238){while(--_0x9a9238){_0x804aa7['push'](_0x804aa7['shift']());}};_0x4e148f(++_0x5252d1);}(_0xd8ec,0x1c4));var _0xcd8e=function(_0x43d66d,_0x3c2c83){_0x43d66d=_0x43d66d-0x0;var _0x3cb9e2=_0xd8ec[_0x43d66d];return _0x3cb9e2;};'use strict';var _=require('lodash');var util=require(_0xcd8e('0x0'));var moment=require(_0xcd8e('0x1'));var BPromise=require(_0xcd8e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcd8e('0x3'))(_0xcd8e('0x4'));var config=require(_0xcd8e('0x5'));var jayson=require(_0xcd8e('0x6'));var client=jayson[_0xcd8e('0x7')][_0xcd8e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f318f,_0xda646,_0xd01d1e){return new BPromise(function(_0x3861af,_0x31606d){return client['request'](_0x3f318f,_0xd01d1e)[_0xcd8e('0x9')](function(_0x16d94d){logger[_0xcd8e('0xa')](_0xcd8e('0xb'),_0xda646,_0xcd8e('0xc'));logger[_0xcd8e('0xd')](_0xcd8e('0xe'),_0xda646,_0xcd8e('0xc'),JSON[_0xcd8e('0xf')](_0x16d94d));if(_0x16d94d[_0xcd8e('0x10')]){if(_0x16d94d[_0xcd8e('0x10')][_0xcd8e('0x11')]===0x1f4){logger[_0xcd8e('0x10')](_0xcd8e('0xb'),_0xda646,_0x16d94d[_0xcd8e('0x10')][_0xcd8e('0x12')]);return _0x31606d(_0x16d94d[_0xcd8e('0x10')][_0xcd8e('0x12')]);}logger['error'](_0xcd8e('0xb'),_0xda646,_0x16d94d[_0xcd8e('0x10')][_0xcd8e('0x12')]);return _0x3861af(_0x16d94d[_0xcd8e('0x10')][_0xcd8e('0x12')]);}else{logger[_0xcd8e('0xa')](_0xcd8e('0xb'),_0xda646,_0xcd8e('0xc'));_0x3861af(_0x16d94d[_0xcd8e('0x13')][_0xcd8e('0x12')]);}})[_0xcd8e('0x14')](function(_0x3c9a6a){logger['error'](_0xcd8e('0xb'),_0xda646,_0x3c9a6a);_0x31606d(_0x3c9a6a);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 73bd533..c53bfb8 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 _0xfed3=['delete','exports','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','post','create','put','/:id','update'];(function(_0x404deb,_0x700f79){var _0x41b21e=function(_0x52eb51){while(--_0x52eb51){_0x404deb['push'](_0x404deb['shift']());}};_0x41b21e(++_0x700f79);}(_0xfed3,0x1de));var _0x3fed=function(_0x119cd8,_0x556b73){_0x119cd8=_0x119cd8-0x0;var _0x7072a3=_0xfed3[_0x119cd8];return _0x7072a3;};'use strict';var multer=require(_0x3fed('0x0'));var util=require('util');var path=require(_0x3fed('0x1'));var timeout=require(_0x3fed('0x2'));var express=require(_0x3fed('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3fed('0x4'));var config=require(_0x3fed('0x5'));var controller=require(_0x3fed('0x6'));router[_0x3fed('0x7')]('/',auth[_0x3fed('0x8')](),controller[_0x3fed('0x9')]);router[_0x3fed('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x3fed('0xa')]('/',auth[_0x3fed('0x8')](),controller[_0x3fed('0xb')]);router[_0x3fed('0xc')](_0x3fed('0xd'),auth['isAuthenticated'](),controller[_0x3fed('0xe')]);router[_0x3fed('0xf')](_0x3fed('0xd'),auth[_0x3fed('0x8')](),controller['destroy']);module[_0x3fed('0x10')]=router; \ No newline at end of file +var _0xaa17=['get','/:id','show','post','isAuthenticated','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller'];(function(_0x2d1b20,_0x456025){var _0x14f5d1=function(_0x14775a){while(--_0x14775a){_0x2d1b20['push'](_0x2d1b20['shift']());}};_0x14f5d1(++_0x456025);}(_0xaa17,0x135));var _0x7aa1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaa17[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7aa1('0x0'));var util=require(_0x7aa1('0x1'));var path=require(_0x7aa1('0x2'));var timeout=require(_0x7aa1('0x3'));var express=require(_0x7aa1('0x4'));var router=express[_0x7aa1('0x5')]();var fs_extra=require(_0x7aa1('0x6'));var auth=require(_0x7aa1('0x7'));var interaction=require(_0x7aa1('0x8'));var config=require(_0x7aa1('0x9'));var controller=require(_0x7aa1('0xa'));router[_0x7aa1('0xb')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x7aa1('0xc'),auth['isAuthenticated'](),controller[_0x7aa1('0xd')]);router[_0x7aa1('0xe')]('/',auth[_0x7aa1('0xf')](),controller['create']);router[_0x7aa1('0x10')]('/:id',auth[_0x7aa1('0xf')](),controller[_0x7aa1('0x11')]);router['delete'](_0x7aa1('0xc'),auth[_0x7aa1('0xf')](),controller[_0x7aa1('0x12')]);module[_0x7aa1('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index ac40856..adc4e49 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 _0xe09f=['keyValue','STRING','exports','ENUM','string','variable','customVariable'];(function(_0x3b1b23,_0x21bccd){var _0x1efc85=function(_0x102a95){while(--_0x102a95){_0x3b1b23['push'](_0x3b1b23['shift']());}};_0x1efc85(++_0x21bccd);}(_0xe09f,0xb8));var _0xfe09=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xe09f[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require('sequelize');module[_0xfe09('0x0')]={'type':{'type':Sequelize[_0xfe09('0x1')](_0xfe09('0x2'),_0xfe09('0x3'),_0xfe09('0x4'),_0xfe09('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xfe09('0x6')]},'key':{'type':Sequelize[_0xfe09('0x6')]},'keyType':{'type':Sequelize[_0xfe09('0x1')]('string',_0xfe09('0x3'),_0xfe09('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xfe09('0x6')]},'nameField':{'type':Sequelize[_0xfe09('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfe09('0x6')]}}; \ No newline at end of file +var _0x7da1=['variable','keyValue','picklist','STRING','string','customVariable','sequelize','exports','ENUM'];(function(_0x2170b1,_0x5c99e9){var _0x4be2c3=function(_0x790566){while(--_0x790566){_0x2170b1['push'](_0x2170b1['shift']());}};_0x4be2c3(++_0x5c99e9);}(_0x7da1,0x177));var _0x17da=function(_0x38966c,_0x1f8b84){_0x38966c=_0x38966c-0x0;var _0x569f45=_0x7da1[_0x38966c];return _0x569f45;};'use strict';var Sequelize=require(_0x17da('0x0'));module[_0x17da('0x1')]={'type':{'type':Sequelize[_0x17da('0x2')]('string',_0x17da('0x3'),'customVariable',_0x17da('0x4'),_0x17da('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x17da('0x6')]},'key':{'type':Sequelize[_0x17da('0x6')]},'keyType':{'type':Sequelize[_0x17da('0x2')](_0x17da('0x7'),_0x17da('0x3'),_0x17da('0x8'))},'keyContent':{'type':Sequelize[_0x17da('0x6')]},'idField':{'type':Sequelize[_0x17da('0x6')]},'nameField':{'type':Sequelize[_0x17da('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x17da('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index a69d0da..ddd7200 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 _0xcc67=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','send','index','SugarcrmField','rawAttributes','fieldName','type','model','map','name','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','options','find','create','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','squel','jsforce','desk.js'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xcc67,0x1aa));var _0x7cc6=function(_0xea9bd4,_0x88623){_0xea9bd4=_0xea9bd4-0x0;var _0x54cb56=_0xcc67[_0xea9bd4];return _0x54cb56;};'use strict';var emlformat=require(_0x7cc6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7cc6('0x1'));var jsonpatch=require(_0x7cc6('0x2'));var rp=require(_0x7cc6('0x3'));var moment=require(_0x7cc6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7cc6('0x5'));var path=require(_0x7cc6('0x6'));var sox=require('sox');var csv=require(_0x7cc6('0x7'));var ejs=require(_0x7cc6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7cc6('0x9'));var crypto=require('crypto');var jsforce=require(_0x7cc6('0xa'));var deskjs=require(_0x7cc6('0xb'));var toCsv=require(_0x7cc6('0x7'));var querystring=require(_0x7cc6('0xc'));var Papa=require(_0x7cc6('0xd'));var Redis=require(_0x7cc6('0xe'));var authService=require(_0x7cc6('0xf'));var qs=require(_0x7cc6('0x10'));var as=require(_0x7cc6('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7cc6('0x12'))(_0x7cc6('0x13'));var utils=require(_0x7cc6('0x14'));var config=require(_0x7cc6('0x15'));var licenseUtil=require(_0x7cc6('0x16'));var db=require(_0x7cc6('0x17'))['db'];function respondWithStatusCode(_0x58fb6f,_0x5738ef){_0x5738ef=_0x5738ef||0xcc;return function(_0x188c14){if(_0x188c14){return _0x58fb6f['sendStatus'](_0x5738ef);}return _0x58fb6f[_0x7cc6('0x18')](_0x5738ef)[_0x7cc6('0x19')]();};}function respondWithResult(_0xc1cef2,_0x2ad8e3){_0x2ad8e3=_0x2ad8e3||0xc8;return function(_0x286d6a){if(_0x286d6a){return _0xc1cef2[_0x7cc6('0x18')](_0x2ad8e3)[_0x7cc6('0x1a')](_0x286d6a);}};}function respondWithFilteredResult(_0x548d64,_0x2a1066){return function(_0x44b9dd){if(_0x44b9dd){var _0x1559e2=typeof _0x2a1066[_0x7cc6('0x1b')]===_0x7cc6('0x1c')&&typeof _0x2a1066[_0x7cc6('0x1d')]===_0x7cc6('0x1c');var _0x1709f6=_0x44b9dd[_0x7cc6('0x1e')];var _0x19b98d=_0x1559e2?0x0:_0x2a1066[_0x7cc6('0x1b')];var _0x2c900e=_0x1559e2?_0x44b9dd[_0x7cc6('0x1e')]:_0x2a1066[_0x7cc6('0x1b')]+_0x2a1066['limit'];var _0x5176c7;if(_0x2c900e>=_0x1709f6){_0x2c900e=_0x1709f6;_0x5176c7=0xc8;}else{_0x5176c7=0xce;}_0x548d64[_0x7cc6('0x18')](_0x5176c7);return _0x548d64[_0x7cc6('0x1f')](_0x7cc6('0x20'),_0x19b98d+'-'+_0x2c900e+'/'+_0x1709f6)[_0x7cc6('0x1a')](_0x44b9dd);}return null;};}function patchUpdates(_0x1d4b22){return function(_0x3a2807){try{jsonpatch[_0x7cc6('0x21')](_0x3a2807,_0x1d4b22,!![]);}catch(_0x312a27){return BPromise[_0x7cc6('0x22')](_0x312a27);}return _0x3a2807[_0x7cc6('0x23')]();};}function saveUpdates(_0x322430,_0x49ca5f){return function(_0x3be1cd){if(_0x3be1cd){return _0x3be1cd[_0x7cc6('0x24')](_0x322430)[_0x7cc6('0x25')](function(_0x294623){return _0x294623;});}return null;};}function removeEntity(_0x285575,_0x394635){return function(_0x5a6618){if(_0x5a6618){return _0x5a6618[_0x7cc6('0x26')]()[_0x7cc6('0x25')](function(){_0x285575[_0x7cc6('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29faff,_0x2ce450){return function(_0x226620){if(!_0x226620){_0x29faff[_0x7cc6('0x27')](0x194);}return _0x226620;};}function handleError(_0x47e9a7,_0xfc7ae3){_0xfc7ae3=_0xfc7ae3||0x1f4;return function(_0x4b61e0){logger['error'](_0x4b61e0[_0x7cc6('0x28')]);if(_0x4b61e0['name']){delete _0x4b61e0['name'];}_0x47e9a7[_0x7cc6('0x18')](_0xfc7ae3)[_0x7cc6('0x29')](_0x4b61e0);};}exports[_0x7cc6('0x2a')]=function(_0x367f28,_0x407748){var _0x298f40={},_0x5187e5={},_0x446486={'count':0x0,'rows':[]};var _0x104f7d=_['map'](db[_0x7cc6('0x2b')][_0x7cc6('0x2c')],function(_0x117292){return{'name':_0x117292[_0x7cc6('0x2d')],'type':_0x117292[_0x7cc6('0x2e')]['key']};});_0x5187e5[_0x7cc6('0x2f')]=_[_0x7cc6('0x30')](_0x104f7d,_0x7cc6('0x31'));_0x5187e5[_0x7cc6('0x32')]=_[_0x7cc6('0x33')](_0x367f28[_0x7cc6('0x32')]);_0x5187e5[_0x7cc6('0x34')]=_[_0x7cc6('0x35')](_0x5187e5[_0x7cc6('0x2f')],_0x5187e5[_0x7cc6('0x32')]);_0x298f40['attributes']=_['intersection'](_0x5187e5[_0x7cc6('0x2f')],qs[_0x7cc6('0x36')](_0x367f28[_0x7cc6('0x32')][_0x7cc6('0x36')]));_0x298f40['attributes']=_0x298f40[_0x7cc6('0x37')][_0x7cc6('0x38')]?_0x298f40[_0x7cc6('0x37')]:_0x5187e5[_0x7cc6('0x2f')];if(!_0x367f28[_0x7cc6('0x32')]['hasOwnProperty']('nolimit')){_0x298f40[_0x7cc6('0x1d')]=qs[_0x7cc6('0x1d')](_0x367f28['query'][_0x7cc6('0x1d')]);_0x298f40['offset']=qs[_0x7cc6('0x1b')](_0x367f28[_0x7cc6('0x32')]['offset']);}_0x298f40[_0x7cc6('0x39')]=qs[_0x7cc6('0x3a')](_0x367f28[_0x7cc6('0x32')][_0x7cc6('0x3a')]);_0x298f40[_0x7cc6('0x3b')]=qs['filters'](_[_0x7cc6('0x3c')](_0x367f28[_0x7cc6('0x32')],_0x5187e5[_0x7cc6('0x34')]),_0x104f7d);if(_0x367f28['query'][_0x7cc6('0x3d')]){_0x298f40[_0x7cc6('0x3b')]=_[_0x7cc6('0x3e')](_0x298f40[_0x7cc6('0x3b')],{'$or':_['map'](_0x104f7d,function(_0x24acc0){if(_0x24acc0[_0x7cc6('0x2e')]!==_0x7cc6('0x3f')){var _0x3a18e2={};_0x3a18e2[_0x24acc0[_0x7cc6('0x31')]]={'$like':'%'+_0x367f28[_0x7cc6('0x32')][_0x7cc6('0x3d')]+'%'};return _0x3a18e2;}})});}_0x298f40=_['merge']({},_0x298f40,_0x367f28['options']);var _0x4972a3={'where':_0x298f40['where']};return db['SugarcrmField'][_0x7cc6('0x1e')](_0x4972a3)[_0x7cc6('0x25')](function(_0x7d0375){_0x446486[_0x7cc6('0x1e')]=_0x7d0375;if(_0x367f28[_0x7cc6('0x32')][_0x7cc6('0x40')]){_0x298f40['include']=[{'all':!![]}];}return db[_0x7cc6('0x2b')][_0x7cc6('0x41')](_0x298f40);})['then'](function(_0x159936){_0x446486[_0x7cc6('0x42')]=_0x159936;return _0x446486;})[_0x7cc6('0x25')](respondWithFilteredResult(_0x407748,_0x298f40))[_0x7cc6('0x43')](handleError(_0x407748,null));};exports[_0x7cc6('0x44')]=function(_0x36f5a5,_0x4c39d7){var _0x3c20c4={'raw':!![],'where':{'id':_0x36f5a5[_0x7cc6('0x45')]['id']}},_0x306e4b={};_0x306e4b[_0x7cc6('0x2f')]=_[_0x7cc6('0x33')](db[_0x7cc6('0x2b')]['rawAttributes']);_0x306e4b[_0x7cc6('0x32')]=_['keys'](_0x36f5a5[_0x7cc6('0x32')]);_0x306e4b[_0x7cc6('0x34')]=_[_0x7cc6('0x35')](_0x306e4b[_0x7cc6('0x2f')],_0x306e4b[_0x7cc6('0x32')]);_0x3c20c4['attributes']=_[_0x7cc6('0x35')](_0x306e4b[_0x7cc6('0x2f')],qs[_0x7cc6('0x36')](_0x36f5a5['query'][_0x7cc6('0x36')]));_0x3c20c4[_0x7cc6('0x37')]=_0x3c20c4[_0x7cc6('0x37')][_0x7cc6('0x38')]?_0x3c20c4[_0x7cc6('0x37')]:_0x306e4b[_0x7cc6('0x2f')];if(_0x36f5a5[_0x7cc6('0x32')]['includeAll']){_0x3c20c4['include']=[{'all':!![]}];}_0x3c20c4=_['merge']({},_0x3c20c4,_0x36f5a5[_0x7cc6('0x46')]);return db[_0x7cc6('0x2b')][_0x7cc6('0x47')](_0x3c20c4)[_0x7cc6('0x25')](handleEntityNotFound(_0x4c39d7,null))[_0x7cc6('0x25')](respondWithResult(_0x4c39d7,null))['catch'](handleError(_0x4c39d7,null));};exports[_0x7cc6('0x48')]=function(_0x3a7724,_0x1b4227){return db[_0x7cc6('0x2b')][_0x7cc6('0x48')](_0x3a7724['body'],{})[_0x7cc6('0x25')](respondWithResult(_0x1b4227,0xc9))[_0x7cc6('0x43')](handleError(_0x1b4227,null));};exports['update']=function(_0x3fd4e4,_0x1a7d62){if(_0x3fd4e4['body']['id']){delete _0x3fd4e4['body']['id'];}return db['SugarcrmField'][_0x7cc6('0x47')]({'where':{'id':_0x3fd4e4[_0x7cc6('0x45')]['id']}})[_0x7cc6('0x25')](handleEntityNotFound(_0x1a7d62,null))[_0x7cc6('0x25')](saveUpdates(_0x3fd4e4['body'],null))[_0x7cc6('0x25')](respondWithResult(_0x1a7d62,null))[_0x7cc6('0x43')](handleError(_0x1a7d62,null));};exports[_0x7cc6('0x26')]=function(_0x592428,_0xf74bb5){return db[_0x7cc6('0x2b')][_0x7cc6('0x47')]({'where':{'id':_0x592428[_0x7cc6('0x45')]['id']}})[_0x7cc6('0x25')](handleEntityNotFound(_0xf74bb5,null))['then'](removeEntity(_0xf74bb5,null))[_0x7cc6('0x43')](handleError(_0xf74bb5,null));}; \ No newline at end of file +var _0x06c0=['update','then','error','stack','name','send','index','map','SugarcrmField','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','eml-format','rimraf','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x3d1f57,_0x43582e){var _0x38bc5f=function(_0x4b49c0){while(--_0x4b49c0){_0x3d1f57['push'](_0x3d1f57['shift']());}};_0x38bc5f(++_0x43582e);}(_0x06c0,0x115));var _0x006c=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0x06c0[_0x34bc30];return _0x5706de;};'use strict';var emlformat=require(_0x006c('0x0'));var rimraf=require(_0x006c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x006c('0x2'));var moment=require(_0x006c('0x3'));var BPromise=require(_0x006c('0x4'));var Mustache=require('mustache');var util=require(_0x006c('0x5'));var path=require(_0x006c('0x6'));var sox=require('sox');var csv=require(_0x006c('0x7'));var ejs=require(_0x006c('0x8'));var fs=require('fs');var fs_extra=require(_0x006c('0x9'));var _=require(_0x006c('0xa'));var squel=require(_0x006c('0xb'));var crypto=require(_0x006c('0xc'));var jsforce=require(_0x006c('0xd'));var deskjs=require(_0x006c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x006c('0xf'));var Papa=require(_0x006c('0x10'));var Redis=require(_0x006c('0x11'));var authService=require(_0x006c('0x12'));var qs=require(_0x006c('0x13'));var as=require(_0x006c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x006c('0x15'))(_0x006c('0x16'));var utils=require(_0x006c('0x17'));var config=require(_0x006c('0x18'));var licenseUtil=require(_0x006c('0x19'));var db=require(_0x006c('0x1a'))['db'];function respondWithStatusCode(_0x166015,_0x3e684e){_0x3e684e=_0x3e684e||0xcc;return function(_0x5d4a32){if(_0x5d4a32){return _0x166015[_0x006c('0x1b')](_0x3e684e);}return _0x166015[_0x006c('0x1c')](_0x3e684e)[_0x006c('0x1d')]();};}function respondWithResult(_0x37e2d8,_0x622f85){_0x622f85=_0x622f85||0xc8;return function(_0x5d9149){if(_0x5d9149){return _0x37e2d8['status'](_0x622f85)[_0x006c('0x1e')](_0x5d9149);}};}function respondWithFilteredResult(_0x230bf1,_0x4e2f5e){return function(_0x3f3517){if(_0x3f3517){var _0x3950a8=typeof _0x4e2f5e[_0x006c('0x1f')]===_0x006c('0x20')&&typeof _0x4e2f5e[_0x006c('0x21')]===_0x006c('0x20');var _0x292ae0=_0x3f3517[_0x006c('0x22')];var _0x9bd37d=_0x3950a8?0x0:_0x4e2f5e['offset'];var _0x340816=_0x3950a8?_0x3f3517[_0x006c('0x22')]:_0x4e2f5e[_0x006c('0x1f')]+_0x4e2f5e[_0x006c('0x21')];var _0x30b01d;if(_0x340816>=_0x292ae0){_0x340816=_0x292ae0;_0x30b01d=0xc8;}else{_0x30b01d=0xce;}_0x230bf1[_0x006c('0x1c')](_0x30b01d);return _0x230bf1[_0x006c('0x23')](_0x006c('0x24'),_0x9bd37d+'-'+_0x340816+'/'+_0x292ae0)['json'](_0x3f3517);}return null;};}function patchUpdates(_0x59af7e){return function(_0x238545){try{jsonpatch[_0x006c('0x25')](_0x238545,_0x59af7e,!![]);}catch(_0x4625cb){return BPromise[_0x006c('0x26')](_0x4625cb);}return _0x238545['save']();};}function saveUpdates(_0x194164,_0x59b2ff){return function(_0x1f6a43){if(_0x1f6a43){return _0x1f6a43[_0x006c('0x27')](_0x194164)['then'](function(_0x4b4e67){return _0x4b4e67;});}return null;};}function removeEntity(_0xa67424,_0x3439d4){return function(_0x2cb93d){if(_0x2cb93d){return _0x2cb93d['destroy']()[_0x006c('0x28')](function(){_0xa67424[_0x006c('0x1c')](0xcc)[_0x006c('0x1d')]();});}};}function handleEntityNotFound(_0x20f5c3,_0x2a4a18){return function(_0x3e1923){if(!_0x3e1923){_0x20f5c3[_0x006c('0x1b')](0x194);}return _0x3e1923;};}function handleError(_0x14600f,_0x40e666){_0x40e666=_0x40e666||0x1f4;return function(_0x1d3ebd){logger[_0x006c('0x29')](_0x1d3ebd[_0x006c('0x2a')]);if(_0x1d3ebd['name']){delete _0x1d3ebd[_0x006c('0x2b')];}_0x14600f[_0x006c('0x1c')](_0x40e666)[_0x006c('0x2c')](_0x1d3ebd);};}exports[_0x006c('0x2d')]=function(_0x7d1148,_0x49d096){var _0x1c4013={},_0x47ae51={},_0x4645a5={'count':0x0,'rows':[]};var _0xbd73d0=_[_0x006c('0x2e')](db[_0x006c('0x2f')][_0x006c('0x30')],function(_0x320054){return{'name':_0x320054[_0x006c('0x31')],'type':_0x320054['type'][_0x006c('0x32')]};});_0x47ae51[_0x006c('0x33')]=_['map'](_0xbd73d0,_0x006c('0x2b'));_0x47ae51[_0x006c('0x34')]=_[_0x006c('0x35')](_0x7d1148[_0x006c('0x34')]);_0x47ae51['filters']=_[_0x006c('0x36')](_0x47ae51[_0x006c('0x33')],_0x47ae51[_0x006c('0x34')]);_0x1c4013['attributes']=_[_0x006c('0x36')](_0x47ae51[_0x006c('0x33')],qs[_0x006c('0x37')](_0x7d1148['query'][_0x006c('0x37')]));_0x1c4013[_0x006c('0x38')]=_0x1c4013['attributes'][_0x006c('0x39')]?_0x1c4013[_0x006c('0x38')]:_0x47ae51['model'];if(!_0x7d1148[_0x006c('0x34')][_0x006c('0x3a')](_0x006c('0x3b'))){_0x1c4013[_0x006c('0x21')]=qs['limit'](_0x7d1148['query']['limit']);_0x1c4013[_0x006c('0x1f')]=qs[_0x006c('0x1f')](_0x7d1148[_0x006c('0x34')][_0x006c('0x1f')]);}_0x1c4013[_0x006c('0x3c')]=qs['sort'](_0x7d1148['query']['sort']);_0x1c4013[_0x006c('0x3d')]=qs[_0x006c('0x3e')](_[_0x006c('0x3f')](_0x7d1148['query'],_0x47ae51[_0x006c('0x3e')]),_0xbd73d0);if(_0x7d1148[_0x006c('0x34')][_0x006c('0x40')]){_0x1c4013[_0x006c('0x3d')]=_[_0x006c('0x41')](_0x1c4013[_0x006c('0x3d')],{'$or':_['map'](_0xbd73d0,function(_0x3652f3){if(_0x3652f3[_0x006c('0x42')]!==_0x006c('0x43')){var _0x1b8e01={};_0x1b8e01[_0x3652f3[_0x006c('0x2b')]]={'$like':'%'+_0x7d1148[_0x006c('0x34')][_0x006c('0x40')]+'%'};return _0x1b8e01;}})});}_0x1c4013=_['merge']({},_0x1c4013,_0x7d1148[_0x006c('0x44')]);var _0x33ca24={'where':_0x1c4013[_0x006c('0x3d')]};return db[_0x006c('0x2f')][_0x006c('0x22')](_0x33ca24)[_0x006c('0x28')](function(_0x4e5feb){_0x4645a5[_0x006c('0x22')]=_0x4e5feb;if(_0x7d1148[_0x006c('0x34')][_0x006c('0x45')]){_0x1c4013[_0x006c('0x46')]=[{'all':!![]}];}return db['SugarcrmField'][_0x006c('0x47')](_0x1c4013);})['then'](function(_0x2c33d8){_0x4645a5[_0x006c('0x48')]=_0x2c33d8;return _0x4645a5;})['then'](respondWithFilteredResult(_0x49d096,_0x1c4013))[_0x006c('0x49')](handleError(_0x49d096,null));};exports['show']=function(_0x5b67ba,_0x4f8e6c){var _0x152941={'raw':!![],'where':{'id':_0x5b67ba[_0x006c('0x4a')]['id']}},_0x1046d2={};_0x1046d2[_0x006c('0x33')]=_['keys'](db['SugarcrmField'][_0x006c('0x30')]);_0x1046d2['query']=_[_0x006c('0x35')](_0x5b67ba[_0x006c('0x34')]);_0x1046d2['filters']=_['intersection'](_0x1046d2[_0x006c('0x33')],_0x1046d2[_0x006c('0x34')]);_0x152941[_0x006c('0x38')]=_[_0x006c('0x36')](_0x1046d2[_0x006c('0x33')],qs['fields'](_0x5b67ba[_0x006c('0x34')][_0x006c('0x37')]));_0x152941[_0x006c('0x38')]=_0x152941[_0x006c('0x38')][_0x006c('0x39')]?_0x152941[_0x006c('0x38')]:_0x1046d2['model'];if(_0x5b67ba[_0x006c('0x34')][_0x006c('0x45')]){_0x152941[_0x006c('0x46')]=[{'all':!![]}];}_0x152941=_[_0x006c('0x41')]({},_0x152941,_0x5b67ba[_0x006c('0x44')]);return db[_0x006c('0x2f')][_0x006c('0x4b')](_0x152941)[_0x006c('0x28')](handleEntityNotFound(_0x4f8e6c,null))[_0x006c('0x28')](respondWithResult(_0x4f8e6c,null))[_0x006c('0x49')](handleError(_0x4f8e6c,null));};exports[_0x006c('0x4c')]=function(_0x21ca93,_0x285048){return db['SugarcrmField'][_0x006c('0x4c')](_0x21ca93[_0x006c('0x4d')],{})[_0x006c('0x28')](respondWithResult(_0x285048,0xc9))[_0x006c('0x49')](handleError(_0x285048,null));};exports[_0x006c('0x27')]=function(_0x103d1f,_0x354aff){if(_0x103d1f[_0x006c('0x4d')]['id']){delete _0x103d1f[_0x006c('0x4d')]['id'];}return db[_0x006c('0x2f')][_0x006c('0x4b')]({'where':{'id':_0x103d1f[_0x006c('0x4a')]['id']}})[_0x006c('0x28')](handleEntityNotFound(_0x354aff,null))[_0x006c('0x28')](saveUpdates(_0x103d1f['body'],null))['then'](respondWithResult(_0x354aff,null))['catch'](handleError(_0x354aff,null));};exports[_0x006c('0x4e')]=function(_0x482fe7,_0x32a529){return db[_0x006c('0x2f')][_0x006c('0x4b')]({'where':{'id':_0x482fe7[_0x006c('0x4a')]['id']}})[_0x006c('0x28')](handleEntityNotFound(_0x32a529,null))['then'](removeEntity(_0x32a529,null))[_0x006c('0x49')](handleError(_0x32a529,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index bbf4d31..102c7d4 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 _0x002a=['FieldId','lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x002a,0xf1));var _0xa002=function(_0x4b6737,_0x704994){_0x4b6737=_0x4b6737-0x0;var _0x585e6c=_0x002a[_0x4b6737];return _0x585e6c;};'use strict';var _=require(_0xa002('0x0'));var util=require(_0xa002('0x1'));var logger=require(_0xa002('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa002('0x3'));var rp=require(_0xa002('0x4'));var fs=require('fs');var path=require(_0xa002('0x5'));var rimraf=require('rimraf');var config=require(_0xa002('0x6'));var attributes=require(_0xa002('0x7'));module[_0xa002('0x8')]=function(_0x216ed7,_0x39a75f){return _0x216ed7[_0xa002('0x9')](_0xa002('0xa'),attributes,{'tableName':_0xa002('0xb'),'paranoid':![],'indexes':[{'name':_0xa002('0xc'),'fields':[_0xa002('0xd'),_0xa002('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a27=['../../config/environment','./intSugarcrmField.attributes','exports','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','FieldId','lodash','util','api','moment','rimraf'];(function(_0x347b61,_0x4e69bc){var _0x254aa7=function(_0x480a5f){while(--_0x480a5f){_0x347b61['push'](_0x347b61['shift']());}};_0x254aa7(++_0x4e69bc);}(_0x7a27,0x103));var _0x77a2=function(_0x123260,_0x2a4db0){_0x123260=_0x123260-0x0;var _0x4ff8b0=_0x7a27[_0x123260];return _0x4ff8b0;};'use strict';var _=require(_0x77a2('0x0'));var util=require(_0x77a2('0x1'));var logger=require('../../config/logger')(_0x77a2('0x2'));var moment=require(_0x77a2('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x77a2('0x4'));var config=require(_0x77a2('0x5'));var attributes=require(_0x77a2('0x6'));module[_0x77a2('0x7')]=function(_0x9a79d6,_0x74a3d1){return _0x9a79d6['define'](_0x77a2('0x8'),attributes,{'tableName':_0x77a2('0x9'),'paranoid':![],'indexes':[{'name':_0x77a2('0xa'),'fields':['idField',_0x77a2('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 31bc003..e3884a9 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 _0xa088=['request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','then','info','SugarcrmField,\x20%s,\x20%s'];(function(_0x32c0e5,_0x5c5239){var _0x36d643=function(_0x4ed044){while(--_0x4ed044){_0x32c0e5['push'](_0x32c0e5['shift']());}};_0x36d643(++_0x5c5239);}(_0xa088,0x196));var _0x8a08=function(_0x418854,_0x11ef81){_0x418854=_0x418854-0x0;var _0x19d804=_0xa088[_0x418854];return _0x19d804;};'use strict';var _=require(_0x8a08('0x0'));var util=require(_0x8a08('0x1'));var moment=require(_0x8a08('0x2'));var BPromise=require('bluebird');var rs=require(_0x8a08('0x3'));var fs=require('fs');var Redis=require(_0x8a08('0x4'));var db=require(_0x8a08('0x5'))['db'];var utils=require(_0x8a08('0x6'));var logger=require(_0x8a08('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8a08('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xbf659e,_0x312b2c,_0x4832f8){return new BPromise(function(_0x33763d,_0x25f37f){return client['request'](_0xbf659e,_0x4832f8)[_0x8a08('0x9')](function(_0x497a36){logger[_0x8a08('0xa')](_0x8a08('0xb'),_0x312b2c,_0x8a08('0xc'));logger['debug'](_0x8a08('0xd'),_0x312b2c,_0x8a08('0xc'),JSON[_0x8a08('0xe')](_0x497a36));if(_0x497a36[_0x8a08('0xf')]){if(_0x497a36['error'][_0x8a08('0x10')]===0x1f4){logger[_0x8a08('0xf')](_0x8a08('0xb'),_0x312b2c,_0x497a36['error'][_0x8a08('0x11')]);return _0x25f37f(_0x497a36[_0x8a08('0xf')]['message']);}logger[_0x8a08('0xf')](_0x8a08('0xb'),_0x312b2c,_0x497a36[_0x8a08('0xf')]['message']);return _0x33763d(_0x497a36[_0x8a08('0xf')]['message']);}else{logger[_0x8a08('0xa')](_0x8a08('0xb'),_0x312b2c,_0x8a08('0xc'));_0x33763d(_0x497a36['result'][_0x8a08('0x11')]);}})[_0x8a08('0x12')](function(_0x42ddac){logger[_0x8a08('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x312b2c,_0x42ddac);_0x25f37f(_0x42ddac);});});} \ No newline at end of file +var _0x6342=['error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x501959,_0x4fc0ae){var _0x895a9=function(_0x2f5669){while(--_0x2f5669){_0x501959['push'](_0x501959['shift']());}};_0x895a9(++_0x4fc0ae);}(_0x6342,0xa6));var _0x2634=function(_0x8bf471,_0x2e9da0){_0x8bf471=_0x8bf471-0x0;var _0x3d93d7=_0x6342[_0x8bf471];return _0x3d93d7;};'use strict';var _=require('lodash');var util=require(_0x2634('0x0'));var moment=require(_0x2634('0x1'));var BPromise=require(_0x2634('0x2'));var rs=require(_0x2634('0x3'));var fs=require('fs');var Redis=require(_0x2634('0x4'));var db=require(_0x2634('0x5'))['db'];var utils=require(_0x2634('0x6'));var logger=require(_0x2634('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2634('0x8'));var client=jayson[_0x2634('0x9')][_0x2634('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c92a3,_0x3296b5,_0xb88068){return new BPromise(function(_0x557b3c,_0x42530e){return client['request'](_0x5c92a3,_0xb88068)[_0x2634('0xb')](function(_0x2f6cc8){logger[_0x2634('0xc')](_0x2634('0xd'),_0x3296b5,_0x2634('0xe'));logger[_0x2634('0xf')](_0x2634('0x10'),_0x3296b5,'request\x20sent',JSON[_0x2634('0x11')](_0x2f6cc8));if(_0x2f6cc8[_0x2634('0x12')]){if(_0x2f6cc8[_0x2634('0x12')][_0x2634('0x13')]===0x1f4){logger[_0x2634('0x12')](_0x2634('0xd'),_0x3296b5,_0x2f6cc8[_0x2634('0x12')][_0x2634('0x14')]);return _0x42530e(_0x2f6cc8[_0x2634('0x12')][_0x2634('0x14')]);}logger['error']('SugarcrmField,\x20%s,\x20%s',_0x3296b5,_0x2f6cc8[_0x2634('0x12')]['message']);return _0x557b3c(_0x2f6cc8[_0x2634('0x12')]['message']);}else{logger[_0x2634('0xc')](_0x2634('0xd'),_0x3296b5,_0x2634('0xe'));_0x557b3c(_0x2f6cc8[_0x2634('0x15')][_0x2634('0x14')]);}})[_0x2634('0x16')](function(_0x38829d){logger[_0x2634('0x12')](_0x2634('0xd'),_0x3296b5,_0x38829d);_0x42530e(_0x38829d);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 28f7398..7020e5b 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 _0x5bbb=['create','post','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','index','isAuthenticated','show','get','/:id/configurations','getConfigurations','getFields'];(function(_0x4e1baa,_0x590507){var _0x525457=function(_0x5e86c6){while(--_0x5e86c6){_0x4e1baa['push'](_0x4e1baa['shift']());}};_0x525457(++_0x590507);}(_0x5bbb,0x132));var _0xb5bb=function(_0x2682f1,_0x3fa0c9){_0x2682f1=_0x2682f1-0x0;var _0x53f215=_0x5bbb[_0x2682f1];return _0x53f215;};'use strict';var multer=require(_0xb5bb('0x0'));var util=require(_0xb5bb('0x1'));var path=require(_0xb5bb('0x2'));var timeout=require(_0xb5bb('0x3'));var express=require(_0xb5bb('0x4'));var router=express[_0xb5bb('0x5')]();var fs_extra=require(_0xb5bb('0x6'));var auth=require(_0xb5bb('0x7'));var interaction=require(_0xb5bb('0x8'));var config=require(_0xb5bb('0x9'));var controller=require(_0xb5bb('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0xb5bb('0xb')]);router['get']('/:id',auth[_0xb5bb('0xc')](),controller[_0xb5bb('0xd')]);router[_0xb5bb('0xe')](_0xb5bb('0xf'),auth['isAuthenticated'](),controller[_0xb5bb('0x10')]);router['get']('/:id/fields',auth[_0xb5bb('0xc')](),controller[_0xb5bb('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb5bb('0x12')]);router[_0xb5bb('0x13')](_0xb5bb('0xf'),auth['isAuthenticated'](),controller[_0xb5bb('0x14')]);router[_0xb5bb('0x15')](_0xb5bb('0x16'),auth['isAuthenticated'](),controller[_0xb5bb('0x17')]);router[_0xb5bb('0x18')](_0xb5bb('0x16'),auth['isAuthenticated'](),controller[_0xb5bb('0x19')]);module[_0xb5bb('0x1a')]=router; \ No newline at end of file +var _0xf6c1=['connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','create','post','addConfiguration','update','delete','destroy','exports','path'];(function(_0x574205,_0x880478){var _0x460fa0=function(_0x103d1d){while(--_0x103d1d){_0x574205['push'](_0x574205['shift']());}};_0x460fa0(++_0x880478);}(_0xf6c1,0x99));var _0x1f6c=function(_0x38c672,_0x36d51e){_0x38c672=_0x38c672-0x0;var _0x32f551=_0xf6c1[_0x38c672];return _0x32f551;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1f6c('0x0'));var timeout=require(_0x1f6c('0x1'));var express=require(_0x1f6c('0x2'));var router=express['Router']();var fs_extra=require(_0x1f6c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x1f6c('0x4'));var config=require(_0x1f6c('0x5'));var controller=require(_0x1f6c('0x6'));router[_0x1f6c('0x7')]('/',auth[_0x1f6c('0x8')](),controller[_0x1f6c('0x9')]);router['get'](_0x1f6c('0xa'),auth[_0x1f6c('0x8')](),controller[_0x1f6c('0xb')]);router[_0x1f6c('0x7')](_0x1f6c('0xc'),auth[_0x1f6c('0x8')](),controller[_0x1f6c('0xd')]);router[_0x1f6c('0x7')](_0x1f6c('0xe'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0x1f6c('0x8')](),controller[_0x1f6c('0xf')]);router[_0x1f6c('0x10')](_0x1f6c('0xc'),auth[_0x1f6c('0x8')](),controller[_0x1f6c('0x11')]);router['put'](_0x1f6c('0xa'),auth[_0x1f6c('0x8')](),controller[_0x1f6c('0x12')]);router[_0x1f6c('0x13')](_0x1f6c('0xa'),auth[_0x1f6c('0x8')](),controller[_0x1f6c('0x14')]);module[_0x1f6c('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 49e1945..ae92c25 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 _0x15ca=['HelpDesk','sequelize','exports','STRING'];(function(_0x39f532,_0x27b526){var _0x442459=function(_0x4f0e6a){while(--_0x4f0e6a){_0x39f532['push'](_0x39f532['shift']());}};_0x442459(++_0x27b526);}(_0x15ca,0xd5));var _0xa15c=function(_0x364ff1,_0x555bac){_0x364ff1=_0x364ff1-0x0;var _0xc250cd=_0x15ca[_0x364ff1];return _0xc250cd;};'use strict';var Sequelize=require(_0xa15c('0x0'));module[_0xa15c('0x1')]={'name':{'type':Sequelize[_0xa15c('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa15c('0x2')]},'username':{'type':Sequelize[_0xa15c('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa15c('0x3')},'remoteUri':{'type':Sequelize[_0xa15c('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x10a9=['exports','STRING','HelpDesk','sequelize'];(function(_0x141f74,_0x420286){var _0x3a462f=function(_0x4e0c27){while(--_0x4e0c27){_0x141f74['push'](_0x141f74['shift']());}};_0x3a462f(++_0x420286);}(_0x10a9,0x113));var _0x910a=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x10a9[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x910a('0x0'));module[_0x910a('0x1')]={'name':{'type':Sequelize[_0x910a('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x910a('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x910a('0x2')],'allowNull':![],'defaultValue':_0x910a('0x3')},'remoteUri':{'type':Sequelize[_0x910a('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x910a('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x910a('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 51195cb..a0ac5e1 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 _0x4203=['where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','VtigerConfiguration','pick','nolimit','addConfiguration','Subjects','getSubjects','channel','getDescriptions','VtigerField','md5','description','moduleName','remoteUri','serverUrl','accessKey','username','slice','substring','format','%s/webservice.php','GET','POST','login','result','token','success','describe','sessionName','autogenerated','reference','owner','remove','false','picklist','picklistValues','label','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','save','update','then','destroy','error','stack','name','send','index','map','VtigerAccount','rawAttributes','model','query','keys','intersection','fields','attributes','length','order','sort'];(function(_0xd7b0a4,_0x53c7d3){var _0x184e9e=function(_0x325bbd){while(--_0x325bbd){_0xd7b0a4['push'](_0xd7b0a4['shift']());}};_0x184e9e(++_0x53c7d3);}(_0x4203,0x19c));var _0x3420=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0x4203[_0x5d80de];return _0x1c7556;};'use strict';var emlformat=require(_0x3420('0x0'));var rimraf=require(_0x3420('0x1'));var zipdir=require(_0x3420('0x2'));var jsonpatch=require(_0x3420('0x3'));var rp=require(_0x3420('0x4'));var moment=require(_0x3420('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3420('0x6'));var util=require(_0x3420('0x7'));var path=require(_0x3420('0x8'));var sox=require(_0x3420('0x9'));var csv=require('to-csv');var ejs=require(_0x3420('0xa'));var fs=require('fs');var fs_extra=require(_0x3420('0xb'));var _=require(_0x3420('0xc'));var squel=require(_0x3420('0xd'));var crypto=require(_0x3420('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3420('0xf'));var querystring=require(_0x3420('0x10'));var Papa=require(_0x3420('0x11'));var Redis=require(_0x3420('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3420('0x13'));var as=require(_0x3420('0x14'));var hardwareService=require(_0x3420('0x15'));var logger=require('../../config/logger')(_0x3420('0x16'));var utils=require('../../config/utils');var config=require(_0x3420('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3420('0x18'))['db'];var integrations=require(_0x3420('0x19'));function respondWithStatusCode(_0x342760,_0x18ea97){_0x18ea97=_0x18ea97||0xcc;return function(_0x1518e0){if(_0x1518e0){return _0x342760[_0x3420('0x1a')](_0x18ea97);}return _0x342760[_0x3420('0x1b')](_0x18ea97)[_0x3420('0x1c')]();};}function respondWithResult(_0x3e0031,_0x5e63b5){_0x5e63b5=_0x5e63b5||0xc8;return function(_0xd3529b){if(_0xd3529b){return _0x3e0031[_0x3420('0x1b')](_0x5e63b5)[_0x3420('0x1d')](_0xd3529b);}};}function respondWithFilteredResult(_0x58815d,_0x11262b){return function(_0x2b0034){if(_0x2b0034){var _0x3e82d6=typeof _0x11262b[_0x3420('0x1e')]===_0x3420('0x1f')&&typeof _0x11262b['limit']===_0x3420('0x1f');var _0x14c77f=_0x2b0034[_0x3420('0x20')];var _0x4ba929=_0x3e82d6?0x0:_0x11262b[_0x3420('0x1e')];var _0x3aba3f=_0x3e82d6?_0x2b0034[_0x3420('0x20')]:_0x11262b[_0x3420('0x1e')]+_0x11262b[_0x3420('0x21')];var _0x5e21a9;if(_0x3aba3f>=_0x14c77f){_0x3aba3f=_0x14c77f;_0x5e21a9=0xc8;}else{_0x5e21a9=0xce;}_0x58815d['status'](_0x5e21a9);return _0x58815d['set'](_0x3420('0x22'),_0x4ba929+'-'+_0x3aba3f+'/'+_0x14c77f)['json'](_0x2b0034);}return null;};}function patchUpdates(_0x4b508e){return function(_0x377fd9){try{jsonpatch['apply'](_0x377fd9,_0x4b508e,!![]);}catch(_0x3541ef){return BPromise['reject'](_0x3541ef);}return _0x377fd9[_0x3420('0x23')]();};}function saveUpdates(_0x360d71,_0x3ed9db){return function(_0x58d501){if(_0x58d501){return _0x58d501[_0x3420('0x24')](_0x360d71)[_0x3420('0x25')](function(_0x5f36a7){return _0x5f36a7;});}return null;};}function removeEntity(_0x9a4896,_0x13e588){return function(_0x16659a){if(_0x16659a){return _0x16659a[_0x3420('0x26')]()[_0x3420('0x25')](function(){_0x9a4896[_0x3420('0x1b')](0xcc)[_0x3420('0x1c')]();});}};}function handleEntityNotFound(_0x3dc191,_0x20d90c){return function(_0x22e161){if(!_0x22e161){_0x3dc191['sendStatus'](0x194);}return _0x22e161;};}function handleError(_0x3fe797,_0x46b011){_0x46b011=_0x46b011||0x1f4;return function(_0x3145f8){logger[_0x3420('0x27')](_0x3145f8[_0x3420('0x28')]);if(_0x3145f8[_0x3420('0x29')]){delete _0x3145f8[_0x3420('0x29')];}_0x3fe797[_0x3420('0x1b')](_0x46b011)[_0x3420('0x2a')](_0x3145f8);};}exports[_0x3420('0x2b')]=function(_0x58f840,_0x2ddfd5){var _0x32d735={},_0xce1f76={},_0x2176ae={'count':0x0,'rows':[]};var _0x3fa77d=_[_0x3420('0x2c')](db[_0x3420('0x2d')][_0x3420('0x2e')],function(_0x4ba0de){return{'name':_0x4ba0de['fieldName'],'type':_0x4ba0de['type']['key']};});_0xce1f76[_0x3420('0x2f')]=_[_0x3420('0x2c')](_0x3fa77d,_0x3420('0x29'));_0xce1f76[_0x3420('0x30')]=_[_0x3420('0x31')](_0x58f840[_0x3420('0x30')]);_0xce1f76['filters']=_[_0x3420('0x32')](_0xce1f76[_0x3420('0x2f')],_0xce1f76['query']);_0x32d735['attributes']=_[_0x3420('0x32')](_0xce1f76['model'],qs[_0x3420('0x33')](_0x58f840[_0x3420('0x30')]['fields']));_0x32d735[_0x3420('0x34')]=_0x32d735['attributes'][_0x3420('0x35')]?_0x32d735[_0x3420('0x34')]:_0xce1f76[_0x3420('0x2f')];if(!_0x58f840['query']['hasOwnProperty']('nolimit')){_0x32d735['limit']=qs['limit'](_0x58f840[_0x3420('0x30')][_0x3420('0x21')]);_0x32d735[_0x3420('0x1e')]=qs[_0x3420('0x1e')](_0x58f840['query'][_0x3420('0x1e')]);}_0x32d735[_0x3420('0x36')]=qs['sort'](_0x58f840[_0x3420('0x30')][_0x3420('0x37')]);_0x32d735[_0x3420('0x38')]=qs[_0x3420('0x39')](_['pick'](_0x58f840[_0x3420('0x30')],_0xce1f76[_0x3420('0x39')]),_0x3fa77d);if(_0x58f840[_0x3420('0x30')][_0x3420('0x3a')]){_0x32d735[_0x3420('0x38')]=_[_0x3420('0x3b')](_0x32d735[_0x3420('0x38')],{'$or':_[_0x3420('0x2c')](_0x3fa77d,function(_0xccc8aa){if(_0xccc8aa[_0x3420('0x3c')]!==_0x3420('0x3d')){var _0x32b658={};_0x32b658[_0xccc8aa['name']]={'$like':'%'+_0x58f840[_0x3420('0x30')]['filter']+'%'};return _0x32b658;}})});}_0x32d735=_['merge']({},_0x32d735,_0x58f840[_0x3420('0x3e')]);var _0x56717f={'where':_0x32d735[_0x3420('0x38')]};return db[_0x3420('0x2d')][_0x3420('0x20')](_0x56717f)[_0x3420('0x25')](function(_0x52c4e8){_0x2176ae[_0x3420('0x20')]=_0x52c4e8;if(_0x58f840[_0x3420('0x30')][_0x3420('0x3f')]){_0x32d735[_0x3420('0x40')]=[{'all':!![]}];}return db[_0x3420('0x2d')][_0x3420('0x41')](_0x32d735);})['then'](function(_0x45d774){_0x2176ae[_0x3420('0x42')]=_0x45d774;return _0x2176ae;})[_0x3420('0x25')](respondWithFilteredResult(_0x2ddfd5,_0x32d735))[_0x3420('0x43')](handleError(_0x2ddfd5,null));};exports[_0x3420('0x44')]=function(_0x1f101d,_0x2ae70a){var _0x5df3f9={'raw':![],'where':{'id':_0x1f101d[_0x3420('0x45')]['id']}},_0x26c634={};_0x26c634[_0x3420('0x2f')]=_[_0x3420('0x31')](db[_0x3420('0x2d')][_0x3420('0x2e')]);_0x26c634[_0x3420('0x30')]=_['keys'](_0x1f101d[_0x3420('0x30')]);_0x26c634[_0x3420('0x39')]=_[_0x3420('0x32')](_0x26c634[_0x3420('0x2f')],_0x26c634[_0x3420('0x30')]);_0x5df3f9['attributes']=_['intersection'](_0x26c634['model'],qs['fields'](_0x1f101d[_0x3420('0x30')][_0x3420('0x33')]));_0x5df3f9[_0x3420('0x34')]=_0x5df3f9[_0x3420('0x34')][_0x3420('0x35')]?_0x5df3f9[_0x3420('0x34')]:_0x26c634[_0x3420('0x2f')];if(_0x1f101d[_0x3420('0x30')]['includeAll']){_0x5df3f9[_0x3420('0x40')]=[{'all':!![]}];}_0x5df3f9=_[_0x3420('0x3b')]({},_0x5df3f9,_0x1f101d[_0x3420('0x3e')]);return db[_0x3420('0x2d')][_0x3420('0x46')](_0x5df3f9)[_0x3420('0x25')](handleEntityNotFound(_0x2ae70a,null))[_0x3420('0x25')](respondWithResult(_0x2ae70a,null))[_0x3420('0x43')](handleError(_0x2ae70a,null));};exports[_0x3420('0x47')]=function(_0x3cc029,_0x1b18f1){return db[_0x3420('0x2d')][_0x3420('0x47')](_0x3cc029[_0x3420('0x48')],{})['then'](respondWithResult(_0x1b18f1,0xc9))['catch'](handleError(_0x1b18f1,null));};exports[_0x3420('0x24')]=function(_0xbf4eb0,_0x2ecdef){if(_0xbf4eb0[_0x3420('0x48')]['id']){delete _0xbf4eb0[_0x3420('0x48')]['id'];}return db[_0x3420('0x2d')]['find']({'where':{'id':_0xbf4eb0['params']['id']}})['then'](handleEntityNotFound(_0x2ecdef,null))[_0x3420('0x25')](saveUpdates(_0xbf4eb0[_0x3420('0x48')],null))[_0x3420('0x25')](respondWithResult(_0x2ecdef,null))[_0x3420('0x43')](handleError(_0x2ecdef,null));};exports[_0x3420('0x26')]=function(_0x17e120,_0x5a7e94){return db[_0x3420('0x2d')]['find']({'where':{'id':_0x17e120[_0x3420('0x45')]['id']}})[_0x3420('0x25')](handleEntityNotFound(_0x5a7e94,null))[_0x3420('0x25')](removeEntity(_0x5a7e94,null))[_0x3420('0x43')](handleError(_0x5a7e94,null));};exports[_0x3420('0x49')]=function(_0x34253e,_0xe9be57,_0x2a2a22){var _0x77bcb1={};var _0x8a625c={};var _0x5ef70e;var _0x18f057;return db[_0x3420('0x2d')][_0x3420('0x4a')]({'where':{'id':_0x34253e[_0x3420('0x45')]['id']}})[_0x3420('0x25')](handleEntityNotFound(_0xe9be57,null))[_0x3420('0x25')](function(_0x4bc142){if(_0x4bc142){_0x5ef70e=_0x4bc142;_0x8a625c[_0x3420('0x2f')]=_['keys'](db[_0x3420('0x4b')]['rawAttributes']);_0x8a625c['query']=_[_0x3420('0x31')](_0x34253e['query']);_0x8a625c[_0x3420('0x39')]=_[_0x3420('0x32')](_0x8a625c[_0x3420('0x2f')],_0x8a625c[_0x3420('0x30')]);_0x77bcb1[_0x3420('0x34')]=_[_0x3420('0x32')](_0x8a625c[_0x3420('0x2f')],qs[_0x3420('0x33')](_0x34253e[_0x3420('0x30')][_0x3420('0x33')]));_0x77bcb1[_0x3420('0x34')]=_0x77bcb1[_0x3420('0x34')]['length']?_0x77bcb1[_0x3420('0x34')]:_0x8a625c[_0x3420('0x2f')];_0x77bcb1[_0x3420('0x36')]=qs[_0x3420('0x37')](_0x34253e['query']['sort']);_0x77bcb1[_0x3420('0x38')]=qs[_0x3420('0x39')](_[_0x3420('0x4c')](_0x34253e[_0x3420('0x30')],_0x8a625c[_0x3420('0x39')]));if(_0x34253e[_0x3420('0x30')][_0x3420('0x3a')]){_0x77bcb1[_0x3420('0x38')]=_['merge'](_0x77bcb1[_0x3420('0x38')],{'$or':_[_0x3420('0x2c')](_0x77bcb1[_0x3420('0x34')],function(_0x5640f7){var _0x5dd00f={};_0x5dd00f[_0x5640f7]={'$like':'%'+_0x34253e[_0x3420('0x30')][_0x3420('0x3a')]+'%'};return _0x5dd00f;})});}_0x77bcb1=_[_0x3420('0x3b')]({},_0x77bcb1,_0x34253e[_0x3420('0x3e')]);return _0x5ef70e[_0x3420('0x49')](_0x77bcb1);}})[_0x3420('0x25')](function(_0x4a7575){if(_0x4a7575){_0x18f057=_0x4a7575[_0x3420('0x35')];if(!_0x34253e['query']['hasOwnProperty'](_0x3420('0x4d'))){_0x77bcb1[_0x3420('0x21')]=qs[_0x3420('0x21')](_0x34253e[_0x3420('0x30')][_0x3420('0x21')]);_0x77bcb1[_0x3420('0x1e')]=qs[_0x3420('0x1e')](_0x34253e[_0x3420('0x30')][_0x3420('0x1e')]);}return _0x5ef70e[_0x3420('0x49')](_0x77bcb1);}})[_0x3420('0x25')](function(_0x34b55b){if(_0x34b55b){return _0x34b55b?{'count':_0x18f057,'rows':_0x34b55b}:null;}})['then'](respondWithResult(_0xe9be57,null))['catch'](handleError(_0xe9be57,null));};exports[_0x3420('0x4e')]=function(_0x311403,_0x54dc41,_0x1eb92a){if(_0x311403[_0x3420('0x48')]['id']){delete _0x311403[_0x3420('0x48')]['id'];}return db[_0x3420('0x2d')][_0x3420('0x4a')]({'where':{'id':_0x311403[_0x3420('0x45')]['id']}})['then'](handleEntityNotFound(_0x54dc41,null))[_0x3420('0x25')](function(_0x42938d){if(_0x42938d){_0x311403['body']['AccountId']=_0x42938d['id'];_0x311403['body'][_0x3420('0x4f')]=integrations[_0x3420('0x50')](_0x311403[_0x3420('0x48')][_0x3420('0x51')],_0x311403[_0x3420('0x48')][_0x3420('0x3c')]);_0x311403[_0x3420('0x48')]['Descriptions']=integrations[_0x3420('0x52')](_0x311403[_0x3420('0x48')][_0x3420('0x51')],_0x311403['body'][_0x3420('0x3c')]);return db['VtigerConfiguration']['create'](_0x311403[_0x3420('0x48')],{'include':[{'model':db['VtigerField'],'as':'Subjects'},{'model':db[_0x3420('0x53')],'as':'Descriptions'}]});}return null;})[_0x3420('0x25')](respondWithResult(_0x54dc41,null))['catch'](handleError(_0x54dc41,null));};var md5=require(_0x3420('0x54'));exports['getFields']=function(_0x28d64a,_0x2adc51,_0x5aae84){var _0x39c7cb=null;var _0x166d43=null;var _0x3847b0=null;var _0x2eb4dc=null;var _0x124709='';return db[_0x3420('0x2d')][_0x3420('0x4a')]({'where':{'id':_0x28d64a[_0x3420('0x45')]['id']},'attributes':['id','name','username',_0x3420('0x55'),_0x3420('0x56'),_0x3420('0x57'),_0x3420('0x58'),_0x3420('0x59')]})[_0x3420('0x25')](handleEntityNotFound(_0x2adc51,null))[_0x3420('0x25')](function(_0x40b331){if(_0x40b331){_0x39c7cb=_0x40b331[_0x3420('0x5a')];_0x166d43=_0x40b331['accessKey'];_0x3847b0=_0x40b331[_0x3420('0x56')];_0x124709=_0x40b331[_0x3420('0x57')];var _0x5d8028=_0x124709[_0x3420('0x5b')](-0x1);if(_0x5d8028==='/'){_0x124709=_0x124709[_0x3420('0x5c')](0x0,_0x124709['lastIndexOf'](_0x5d8028));}_0x2eb4dc=util[_0x3420('0x5d')](_0x3420('0x5e'),_0x124709);var _0x312241={'method':_0x3420('0x5f'),'uri':_0x2eb4dc,'qs':{'operation':'getchallenge','username':_0x40b331[_0x3420('0x5a')]},'json':!![]};return rp(_0x312241);}})[_0x3420('0x25')](function(_0xa74888){if(_0xa74888['success']){var _0x329005={'method':_0x3420('0x60'),'uri':_0x2eb4dc,'form':{'operation':_0x3420('0x61'),'username':_0x39c7cb,'accessKey':md5(_0xa74888[_0x3420('0x62')][_0x3420('0x63')]+_0x166d43)},'json':!![]};return rp(_0x329005);}})[_0x3420('0x25')](function(_0x355775){if(_0x355775[_0x3420('0x64')]){var _0x363631={'method':_0x3420('0x5f'),'uri':_0x2eb4dc,'qs':{'operation':_0x3420('0x65'),'username':_0x39c7cb,'sessionName':_0x355775[_0x3420('0x62')][_0x3420('0x66')],'elementType':_0x3847b0},'json':!![]};return rp(_0x363631);}})['then'](function(_0x3f5f2b){if(_0x3f5f2b['success']){var _0x3a0b9f=[_0x3420('0x67'),_0x3420('0x68'),_0x3420('0x69')];_['remove'](_0x3f5f2b[_0x3420('0x62')][_0x3420('0x33')],function(_0xce53d0){return _0x3a0b9f['includes'](_0xce53d0[_0x3420('0x3c')]['name']);});_[_0x3420('0x6a')](_0x3f5f2b['result'][_0x3420('0x33')],function(_0x59035b){return _0x59035b['editable']===_0x3420('0x6b');});return{'count':_0x3f5f2b['result'][_0x3420('0x33')][_0x3420('0x35')],'rows':_[_0x3420('0x2c')](_0x3f5f2b[_0x3420('0x62')][_0x3420('0x33')],function(_0x4639b7){return{'id':_0x4639b7[_0x3420('0x29')],'name':_0x4639b7['label'],'custom':_['startsWith'](_0x4639b7['name'],'cf_')?!![]:![],'options':_0x4639b7[_0x3420('0x3c')]['name']===_0x3420('0x6c')&&_0x4639b7['type'][_0x3420('0x6d')][_0x3420('0x35')]>0x0?_['map'](_0x4639b7[_0x3420('0x3c')]['picklistValues'],function(_0x5cebf7){return{'name':_0x5cebf7[_0x3420('0x6e')],'value':_0x5cebf7[_0x3420('0x6f')]};}):[]};})};}})[_0x3420('0x25')](respondWithResult(_0x2adc51,null))[_0x3420('0x43')](function(_0x14f13d){console['log']('vTiger\x20error:\x20'+_0x14f13d);var _0x4cdd49=_0x28d64a[_0x3420('0x30')][_0x3420('0x70')]?0x1f4:_0x14f13d[_0x3420('0x71')]||0x1f4;logger['error'](_0x3420('0x72'),_0x3420('0x73'),_0x4cdd49,JSON['stringify'](_0x14f13d));delete _0x14f13d[_0x3420('0x29')];if(_0x4cdd49===0x191){_0x4cdd49=0x190;}_0x2adc51[_0x3420('0x1b')](_0x4cdd49)['send'](_0x28d64a[_0x3420('0x30')][_0x3420('0x70')]?{'message':_0x3420('0x74'),'statusCode':_0x14f13d['statusCode']}:_0x14f13d);});}; \ No newline at end of file +var _0xf79c=['describe','result','autogenerated','owner','remove','includes','editable','false','label','startsWith','cf_','picklist','picklistValues','value','vTiger\x20error:\x20','test','statusCode','error','stringify','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','set','apply','reject','update','then','destroy','name','send','index','map','VtigerAccount','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','merge','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','getConfigurations','findOne','VtigerConfiguration','pick','options','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','Descriptions','VtigerField','getFields','username','description','moduleName','serverUrl','accessKey','remoteUri','substring','lastIndexOf','format','%s/webservice.php','getchallenge','success','POST','login','token','GET'];(function(_0x1e13be,_0x5ee235){var _0x1c4f47=function(_0x1d1099){while(--_0x1d1099){_0x1e13be['push'](_0x1e13be['shift']());}};_0x1c4f47(++_0x5ee235);}(_0xf79c,0xfb));var _0xcf79=function(_0x5565bf,_0x262624){_0x5565bf=_0x5565bf-0x0;var _0x23b593=_0xf79c[_0x5565bf];return _0x23b593;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcf79('0x0'));var jsonpatch=require(_0xcf79('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xcf79('0x2'));var Mustache=require(_0xcf79('0x3'));var util=require(_0xcf79('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xcf79('0x5'));var ejs=require(_0xcf79('0x6'));var fs=require('fs');var fs_extra=require(_0xcf79('0x7'));var _=require(_0xcf79('0x8'));var squel=require('squel');var crypto=require(_0xcf79('0x9'));var jsforce=require(_0xcf79('0xa'));var deskjs=require(_0xcf79('0xb'));var toCsv=require(_0xcf79('0x5'));var querystring=require('querystring');var Papa=require(_0xcf79('0xc'));var Redis=require(_0xcf79('0xd'));var authService=require(_0xcf79('0xe'));var qs=require(_0xcf79('0xf'));var as=require(_0xcf79('0x10'));var hardwareService=require(_0xcf79('0x11'));var logger=require('../../config/logger')(_0xcf79('0x12'));var utils=require(_0xcf79('0x13'));var config=require(_0xcf79('0x14'));var licenseUtil=require(_0xcf79('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xcf79('0x16'));function respondWithStatusCode(_0x61cc80,_0x4713af){_0x4713af=_0x4713af||0xcc;return function(_0x6a69a2){if(_0x6a69a2){return _0x61cc80[_0xcf79('0x17')](_0x4713af);}return _0x61cc80['status'](_0x4713af)[_0xcf79('0x18')]();};}function respondWithResult(_0x14a0a4,_0x29540a){_0x29540a=_0x29540a||0xc8;return function(_0x76a7c0){if(_0x76a7c0){return _0x14a0a4[_0xcf79('0x19')](_0x29540a)[_0xcf79('0x1a')](_0x76a7c0);}};}function respondWithFilteredResult(_0x5038c9,_0x32c8f9){return function(_0x130697){if(_0x130697){var _0x2b1a24=typeof _0x32c8f9[_0xcf79('0x1b')]===_0xcf79('0x1c')&&typeof _0x32c8f9[_0xcf79('0x1d')]===_0xcf79('0x1c');var _0x1e5b94=_0x130697['count'];var _0x50defe=_0x2b1a24?0x0:_0x32c8f9[_0xcf79('0x1b')];var _0x2f86a4=_0x2b1a24?_0x130697['count']:_0x32c8f9[_0xcf79('0x1b')]+_0x32c8f9[_0xcf79('0x1d')];var _0x348d1e;if(_0x2f86a4>=_0x1e5b94){_0x2f86a4=_0x1e5b94;_0x348d1e=0xc8;}else{_0x348d1e=0xce;}_0x5038c9['status'](_0x348d1e);return _0x5038c9[_0xcf79('0x1e')]('Content-Range',_0x50defe+'-'+_0x2f86a4+'/'+_0x1e5b94)[_0xcf79('0x1a')](_0x130697);}return null;};}function patchUpdates(_0x348780){return function(_0x25d543){try{jsonpatch[_0xcf79('0x1f')](_0x25d543,_0x348780,!![]);}catch(_0x4fa7b5){return BPromise[_0xcf79('0x20')](_0x4fa7b5);}return _0x25d543['save']();};}function saveUpdates(_0x14ed8a,_0x1dd1a2){return function(_0x183ce6){if(_0x183ce6){return _0x183ce6[_0xcf79('0x21')](_0x14ed8a)[_0xcf79('0x22')](function(_0x4e36b7){return _0x4e36b7;});}return null;};}function removeEntity(_0x45dfe8,_0x34dd83){return function(_0x2f6d73){if(_0x2f6d73){return _0x2f6d73[_0xcf79('0x23')]()[_0xcf79('0x22')](function(){_0x45dfe8[_0xcf79('0x19')](0xcc)[_0xcf79('0x18')]();});}};}function handleEntityNotFound(_0x2b97f9,_0x200e79){return function(_0xffc7a0){if(!_0xffc7a0){_0x2b97f9[_0xcf79('0x17')](0x194);}return _0xffc7a0;};}function handleError(_0x44ccda,_0x12bc36){_0x12bc36=_0x12bc36||0x1f4;return function(_0x356bbb){logger['error'](_0x356bbb['stack']);if(_0x356bbb['name']){delete _0x356bbb[_0xcf79('0x24')];}_0x44ccda[_0xcf79('0x19')](_0x12bc36)[_0xcf79('0x25')](_0x356bbb);};}exports[_0xcf79('0x26')]=function(_0x26f0f5,_0x3e9fee){var _0x155936={},_0x10ee39={},_0x1a520e={'count':0x0,'rows':[]};var _0x2fb596=_[_0xcf79('0x27')](db[_0xcf79('0x28')][_0xcf79('0x29')],function(_0xe726f){return{'name':_0xe726f['fieldName'],'type':_0xe726f[_0xcf79('0x2a')][_0xcf79('0x2b')]};});_0x10ee39['model']=_[_0xcf79('0x27')](_0x2fb596,'name');_0x10ee39[_0xcf79('0x2c')]=_['keys'](_0x26f0f5[_0xcf79('0x2c')]);_0x10ee39[_0xcf79('0x2d')]=_[_0xcf79('0x2e')](_0x10ee39[_0xcf79('0x2f')],_0x10ee39[_0xcf79('0x2c')]);_0x155936[_0xcf79('0x30')]=_[_0xcf79('0x2e')](_0x10ee39[_0xcf79('0x2f')],qs['fields'](_0x26f0f5[_0xcf79('0x2c')][_0xcf79('0x31')]));_0x155936[_0xcf79('0x30')]=_0x155936[_0xcf79('0x30')][_0xcf79('0x32')]?_0x155936['attributes']:_0x10ee39[_0xcf79('0x2f')];if(!_0x26f0f5[_0xcf79('0x2c')]['hasOwnProperty'](_0xcf79('0x33'))){_0x155936[_0xcf79('0x1d')]=qs[_0xcf79('0x1d')](_0x26f0f5['query'][_0xcf79('0x1d')]);_0x155936[_0xcf79('0x1b')]=qs[_0xcf79('0x1b')](_0x26f0f5[_0xcf79('0x2c')][_0xcf79('0x1b')]);}_0x155936[_0xcf79('0x34')]=qs['sort'](_0x26f0f5[_0xcf79('0x2c')][_0xcf79('0x35')]);_0x155936[_0xcf79('0x36')]=qs[_0xcf79('0x2d')](_['pick'](_0x26f0f5['query'],_0x10ee39[_0xcf79('0x2d')]),_0x2fb596);if(_0x26f0f5[_0xcf79('0x2c')][_0xcf79('0x37')]){_0x155936['where']=_[_0xcf79('0x38')](_0x155936[_0xcf79('0x36')],{'$or':_[_0xcf79('0x27')](_0x2fb596,function(_0x4010fc){if(_0x4010fc[_0xcf79('0x2a')]!=='VIRTUAL'){var _0x27ca69={};_0x27ca69[_0x4010fc[_0xcf79('0x24')]]={'$like':'%'+_0x26f0f5[_0xcf79('0x2c')][_0xcf79('0x37')]+'%'};return _0x27ca69;}})});}_0x155936=_[_0xcf79('0x38')]({},_0x155936,_0x26f0f5['options']);var _0x47739f={'where':_0x155936['where']};return db[_0xcf79('0x28')]['count'](_0x47739f)['then'](function(_0x124a07){_0x1a520e['count']=_0x124a07;if(_0x26f0f5[_0xcf79('0x2c')][_0xcf79('0x39')]){_0x155936['include']=[{'all':!![]}];}return db[_0xcf79('0x28')][_0xcf79('0x3a')](_0x155936);})[_0xcf79('0x22')](function(_0x2ad74c){_0x1a520e[_0xcf79('0x3b')]=_0x2ad74c;return _0x1a520e;})[_0xcf79('0x22')](respondWithFilteredResult(_0x3e9fee,_0x155936))[_0xcf79('0x3c')](handleError(_0x3e9fee,null));};exports[_0xcf79('0x3d')]=function(_0x567e3e,_0x34059d){var _0x3c4ae6={'raw':![],'where':{'id':_0x567e3e[_0xcf79('0x3e')]['id']}},_0x3a5422={};_0x3a5422[_0xcf79('0x2f')]=_[_0xcf79('0x3f')](db[_0xcf79('0x28')][_0xcf79('0x29')]);_0x3a5422[_0xcf79('0x2c')]=_[_0xcf79('0x3f')](_0x567e3e['query']);_0x3a5422[_0xcf79('0x2d')]=_[_0xcf79('0x2e')](_0x3a5422['model'],_0x3a5422['query']);_0x3c4ae6[_0xcf79('0x30')]=_[_0xcf79('0x2e')](_0x3a5422[_0xcf79('0x2f')],qs[_0xcf79('0x31')](_0x567e3e[_0xcf79('0x2c')]['fields']));_0x3c4ae6[_0xcf79('0x30')]=_0x3c4ae6[_0xcf79('0x30')][_0xcf79('0x32')]?_0x3c4ae6[_0xcf79('0x30')]:_0x3a5422['model'];if(_0x567e3e[_0xcf79('0x2c')][_0xcf79('0x39')]){_0x3c4ae6[_0xcf79('0x40')]=[{'all':!![]}];}_0x3c4ae6=_['merge']({},_0x3c4ae6,_0x567e3e['options']);return db[_0xcf79('0x28')][_0xcf79('0x41')](_0x3c4ae6)['then'](handleEntityNotFound(_0x34059d,null))[_0xcf79('0x22')](respondWithResult(_0x34059d,null))[_0xcf79('0x3c')](handleError(_0x34059d,null));};exports[_0xcf79('0x42')]=function(_0x9d82c7,_0x6edc25){return db['VtigerAccount']['create'](_0x9d82c7[_0xcf79('0x43')],{})[_0xcf79('0x22')](respondWithResult(_0x6edc25,0xc9))['catch'](handleError(_0x6edc25,null));};exports[_0xcf79('0x21')]=function(_0x416847,_0x3f6bda){if(_0x416847[_0xcf79('0x43')]['id']){delete _0x416847[_0xcf79('0x43')]['id'];}return db[_0xcf79('0x28')][_0xcf79('0x41')]({'where':{'id':_0x416847[_0xcf79('0x3e')]['id']}})[_0xcf79('0x22')](handleEntityNotFound(_0x3f6bda,null))[_0xcf79('0x22')](saveUpdates(_0x416847[_0xcf79('0x43')],null))[_0xcf79('0x22')](respondWithResult(_0x3f6bda,null))['catch'](handleError(_0x3f6bda,null));};exports[_0xcf79('0x23')]=function(_0x44118d,_0x4f2da3){return db[_0xcf79('0x28')][_0xcf79('0x41')]({'where':{'id':_0x44118d[_0xcf79('0x3e')]['id']}})[_0xcf79('0x22')](handleEntityNotFound(_0x4f2da3,null))[_0xcf79('0x22')](removeEntity(_0x4f2da3,null))[_0xcf79('0x3c')](handleError(_0x4f2da3,null));};exports[_0xcf79('0x44')]=function(_0x373ecc,_0x38b16b,_0x3bf977){var _0xa9befe={};var _0x3781c8={};var _0x46721d;var _0x590543;return db['VtigerAccount'][_0xcf79('0x45')]({'where':{'id':_0x373ecc[_0xcf79('0x3e')]['id']}})['then'](handleEntityNotFound(_0x38b16b,null))[_0xcf79('0x22')](function(_0x460e10){if(_0x460e10){_0x46721d=_0x460e10;_0x3781c8[_0xcf79('0x2f')]=_[_0xcf79('0x3f')](db[_0xcf79('0x46')][_0xcf79('0x29')]);_0x3781c8[_0xcf79('0x2c')]=_['keys'](_0x373ecc[_0xcf79('0x2c')]);_0x3781c8['filters']=_[_0xcf79('0x2e')](_0x3781c8['model'],_0x3781c8[_0xcf79('0x2c')]);_0xa9befe[_0xcf79('0x30')]=_['intersection'](_0x3781c8['model'],qs['fields'](_0x373ecc[_0xcf79('0x2c')]['fields']));_0xa9befe[_0xcf79('0x30')]=_0xa9befe[_0xcf79('0x30')]['length']?_0xa9befe[_0xcf79('0x30')]:_0x3781c8['model'];_0xa9befe[_0xcf79('0x34')]=qs[_0xcf79('0x35')](_0x373ecc[_0xcf79('0x2c')][_0xcf79('0x35')]);_0xa9befe[_0xcf79('0x36')]=qs['filters'](_[_0xcf79('0x47')](_0x373ecc[_0xcf79('0x2c')],_0x3781c8[_0xcf79('0x2d')]));if(_0x373ecc[_0xcf79('0x2c')][_0xcf79('0x37')]){_0xa9befe[_0xcf79('0x36')]=_['merge'](_0xa9befe['where'],{'$or':_[_0xcf79('0x27')](_0xa9befe['attributes'],function(_0x22e365){var _0x21091d={};_0x21091d[_0x22e365]={'$like':'%'+_0x373ecc[_0xcf79('0x2c')][_0xcf79('0x37')]+'%'};return _0x21091d;})});}_0xa9befe=_[_0xcf79('0x38')]({},_0xa9befe,_0x373ecc[_0xcf79('0x48')]);return _0x46721d['getConfigurations'](_0xa9befe);}})['then'](function(_0x20067e){if(_0x20067e){_0x590543=_0x20067e['length'];if(!_0x373ecc[_0xcf79('0x2c')][_0xcf79('0x49')]('nolimit')){_0xa9befe[_0xcf79('0x1d')]=qs['limit'](_0x373ecc['query']['limit']);_0xa9befe[_0xcf79('0x1b')]=qs['offset'](_0x373ecc['query'][_0xcf79('0x1b')]);}return _0x46721d['getConfigurations'](_0xa9befe);}})['then'](function(_0x7c984b){if(_0x7c984b){return _0x7c984b?{'count':_0x590543,'rows':_0x7c984b}:null;}})[_0xcf79('0x22')](respondWithResult(_0x38b16b,null))['catch'](handleError(_0x38b16b,null));};exports[_0xcf79('0x4a')]=function(_0x4a2fa1,_0x38c6cd,_0x3de39f){if(_0x4a2fa1[_0xcf79('0x43')]['id']){delete _0x4a2fa1[_0xcf79('0x43')]['id'];}return db[_0xcf79('0x28')][_0xcf79('0x45')]({'where':{'id':_0x4a2fa1[_0xcf79('0x3e')]['id']}})[_0xcf79('0x22')](handleEntityNotFound(_0x38c6cd,null))[_0xcf79('0x22')](function(_0x49e37b){if(_0x49e37b){_0x4a2fa1[_0xcf79('0x43')]['AccountId']=_0x49e37b['id'];_0x4a2fa1[_0xcf79('0x43')][_0xcf79('0x4b')]=integrations[_0xcf79('0x4c')](_0x4a2fa1['body'][_0xcf79('0x4d')],_0x4a2fa1[_0xcf79('0x43')][_0xcf79('0x2a')]);_0x4a2fa1[_0xcf79('0x43')][_0xcf79('0x4e')]=integrations['getDescriptions'](_0x4a2fa1['body'][_0xcf79('0x4d')],_0x4a2fa1[_0xcf79('0x43')][_0xcf79('0x2a')]);return db[_0xcf79('0x46')][_0xcf79('0x42')](_0x4a2fa1['body'],{'include':[{'model':db[_0xcf79('0x4f')],'as':'Subjects'},{'model':db['VtigerField'],'as':_0xcf79('0x4e')}]});}return null;})[_0xcf79('0x22')](respondWithResult(_0x38c6cd,null))['catch'](handleError(_0x38c6cd,null));};var md5=require('md5');exports[_0xcf79('0x50')]=function(_0x4b0d7d,_0x34223b,_0x4229b9){var _0x50e3b6=null;var _0x40e33f=null;var _0x167b96=null;var _0x2f2e99=null;var _0x3292f4='';return db[_0xcf79('0x28')][_0xcf79('0x45')]({'where':{'id':_0x4b0d7d[_0xcf79('0x3e')]['id']},'attributes':['id','name',_0xcf79('0x51'),_0xcf79('0x52'),_0xcf79('0x53'),'remoteUri',_0xcf79('0x54'),_0xcf79('0x55')]})['then'](handleEntityNotFound(_0x34223b,null))[_0xcf79('0x22')](function(_0x49102d){if(_0x49102d){_0x50e3b6=_0x49102d['username'];_0x40e33f=_0x49102d[_0xcf79('0x55')];_0x167b96=_0x49102d[_0xcf79('0x53')];_0x3292f4=_0x49102d[_0xcf79('0x56')];var _0x4fc36e=_0x3292f4['slice'](-0x1);if(_0x4fc36e==='/'){_0x3292f4=_0x3292f4[_0xcf79('0x57')](0x0,_0x3292f4[_0xcf79('0x58')](_0x4fc36e));}_0x2f2e99=util[_0xcf79('0x59')](_0xcf79('0x5a'),_0x3292f4);var _0x391b75={'method':'GET','uri':_0x2f2e99,'qs':{'operation':_0xcf79('0x5b'),'username':_0x49102d[_0xcf79('0x51')]},'json':!![]};return rp(_0x391b75);}})[_0xcf79('0x22')](function(_0x5696ff){if(_0x5696ff[_0xcf79('0x5c')]){var _0x9dd574={'method':_0xcf79('0x5d'),'uri':_0x2f2e99,'form':{'operation':_0xcf79('0x5e'),'username':_0x50e3b6,'accessKey':md5(_0x5696ff['result'][_0xcf79('0x5f')]+_0x40e33f)},'json':!![]};return rp(_0x9dd574);}})[_0xcf79('0x22')](function(_0x217462){if(_0x217462[_0xcf79('0x5c')]){var _0x1a8e2d={'method':_0xcf79('0x60'),'uri':_0x2f2e99,'qs':{'operation':_0xcf79('0x61'),'username':_0x50e3b6,'sessionName':_0x217462[_0xcf79('0x62')]['sessionName'],'elementType':_0x167b96},'json':!![]};return rp(_0x1a8e2d);}})[_0xcf79('0x22')](function(_0x431dfb){if(_0x431dfb[_0xcf79('0x5c')]){var _0x1fd083=[_0xcf79('0x63'),'reference',_0xcf79('0x64')];_[_0xcf79('0x65')](_0x431dfb['result'][_0xcf79('0x31')],function(_0x54087f){return _0x1fd083[_0xcf79('0x66')](_0x54087f[_0xcf79('0x2a')][_0xcf79('0x24')]);});_['remove'](_0x431dfb[_0xcf79('0x62')][_0xcf79('0x31')],function(_0x42a615){return _0x42a615[_0xcf79('0x67')]===_0xcf79('0x68');});return{'count':_0x431dfb[_0xcf79('0x62')][_0xcf79('0x31')][_0xcf79('0x32')],'rows':_['map'](_0x431dfb[_0xcf79('0x62')][_0xcf79('0x31')],function(_0x3b7ae0){return{'id':_0x3b7ae0[_0xcf79('0x24')],'name':_0x3b7ae0[_0xcf79('0x69')],'custom':_[_0xcf79('0x6a')](_0x3b7ae0[_0xcf79('0x24')],_0xcf79('0x6b'))?!![]:![],'options':_0x3b7ae0['type'][_0xcf79('0x24')]===_0xcf79('0x6c')&&_0x3b7ae0[_0xcf79('0x2a')][_0xcf79('0x6d')][_0xcf79('0x32')]>0x0?_[_0xcf79('0x27')](_0x3b7ae0[_0xcf79('0x2a')][_0xcf79('0x6d')],function(_0x281293){return{'name':_0x281293[_0xcf79('0x69')],'value':_0x281293[_0xcf79('0x6e')]};}):[]};})};}})[_0xcf79('0x22')](respondWithResult(_0x34223b,null))[_0xcf79('0x3c')](function(_0x61feda){console['log'](_0xcf79('0x6f')+_0x61feda);var _0x5ce340=_0x4b0d7d[_0xcf79('0x2c')][_0xcf79('0x70')]?0x1f4:_0x61feda[_0xcf79('0x71')]||0x1f4;logger[_0xcf79('0x72')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x5ce340,JSON[_0xcf79('0x73')](_0x61feda));delete _0x61feda['name'];if(_0x5ce340===0x191){_0x5ce340=0x190;}_0x34223b['status'](_0x5ce340)[_0xcf79('0x25')](_0x4b0d7d[_0xcf79('0x2c')][_0xcf79('0x70')]?{'message':'Wrong\x20credentials','statusCode':_0x61feda[_0xcf79('0x71')]}:_0x61feda);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 36134fa..038895b 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 _0xee77=['define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xee77,0xe3));var _0x7ee7=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xee77[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require(_0x7ee7('0x0'));var util=require(_0x7ee7('0x1'));var logger=require(_0x7ee7('0x2'))(_0x7ee7('0x3'));var moment=require(_0x7ee7('0x4'));var BPromise=require('bluebird');var rp=require(_0x7ee7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7ee7('0x6'));var config=require(_0x7ee7('0x7'));var attributes=require(_0x7ee7('0x8'));var integrations=require(_0x7ee7('0x9'));module[_0x7ee7('0xa')]=function(_0x280594,_0x119256){return _0x280594[_0x7ee7('0xb')](_0x7ee7('0xc'),attributes,{'tableName':_0x7ee7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x028a=['path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','define','VtigerAccount','int_vtiger_accounts','util','../../config/logger','api','bluebird','request-promise'];(function(_0x88c0ba,_0x332814){var _0x5af3bc=function(_0x325e13){while(--_0x325e13){_0x88c0ba['push'](_0x88c0ba['shift']());}};_0x5af3bc(++_0x332814);}(_0x028a,0x1b5));var _0xa028=function(_0x56bd3c,_0x5cc83c){_0x56bd3c=_0x56bd3c-0x0;var _0x2c52bb=_0x028a[_0x56bd3c];return _0x2c52bb;};'use strict';var _=require('lodash');var util=require(_0xa028('0x0'));var logger=require(_0xa028('0x1'))(_0xa028('0x2'));var moment=require('moment');var BPromise=require(_0xa028('0x3'));var rp=require(_0xa028('0x4'));var fs=require('fs');var path=require(_0xa028('0x5'));var rimraf=require(_0xa028('0x6'));var config=require(_0xa028('0x7'));var attributes=require(_0xa028('0x8'));var integrations=require(_0xa028('0x9'));module['exports']=function(_0x499cbb,_0x31ed94){return _0x499cbb[_0xa028('0xa')](_0xa028('0xb'),attributes,{'tableName':_0xa028('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index c1adb41..8ae679c 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 _0xd87e=['stringify','error','code','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','map','include','model','attributes','ShowVtigerAccount','find','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s'];(function(_0x10b137,_0x10ed9a){var _0x234d80=function(_0x2da9e2){while(--_0x2da9e2){_0x10b137['push'](_0x10b137['shift']());}};_0x234d80(++_0x10ed9a);}(_0xd87e,0x1bf));var _0xed87=function(_0x57deb0,_0xcfa42){_0x57deb0=_0x57deb0-0x0;var _0x21941a=_0xd87e[_0x57deb0];return _0x21941a;};'use strict';var _=require(_0xed87('0x0'));var util=require(_0xed87('0x1'));var moment=require('moment');var BPromise=require(_0xed87('0x2'));var rs=require(_0xed87('0x3'));var fs=require('fs');var Redis=require(_0xed87('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xed87('0x5'));var logger=require('../../config/logger')(_0xed87('0x6'));var config=require(_0xed87('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xed87('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5da793,_0xa33c67,_0x42fef6){return new BPromise(function(_0x33e1c1,_0x2f348a){return client['request'](_0x5da793,_0x42fef6)[_0xed87('0x9')](function(_0x3dce4b){logger[_0xed87('0xa')](_0xed87('0xb'),_0xa33c67,_0xed87('0xc'));logger[_0xed87('0xd')](_0xed87('0xe'),_0xa33c67,'request\x20sent',JSON[_0xed87('0xf')](_0x3dce4b));if(_0x3dce4b[_0xed87('0x10')]){if(_0x3dce4b['error'][_0xed87('0x11')]===0x1f4){logger[_0xed87('0x10')]('VtigerAccount,\x20%s,\x20%s',_0xa33c67,_0x3dce4b['error'][_0xed87('0x12')]);return _0x2f348a(_0x3dce4b[_0xed87('0x10')][_0xed87('0x12')]);}logger[_0xed87('0x10')](_0xed87('0xb'),_0xa33c67,_0x3dce4b[_0xed87('0x10')]['message']);return _0x33e1c1(_0x3dce4b[_0xed87('0x10')][_0xed87('0x12')]);}else{logger[_0xed87('0xa')](_0xed87('0xb'),_0xa33c67,_0xed87('0xc'));_0x33e1c1(_0x3dce4b[_0xed87('0x13')][_0xed87('0x12')]);}})[_0xed87('0x14')](function(_0x385859){logger['error'](_0xed87('0xb'),_0xa33c67,_0x385859);_0x2f348a(_0x385859);});});}exports[_0xed87('0x15')]=function(_0x2c386a){var _0xfb8a44=this;return new Promise(function(_0x5f4076,_0x211085){return db[_0xed87('0x16')][_0xed87('0x17')]({'raw':_0x2c386a[_0xed87('0x18')]?_0x2c386a[_0xed87('0x18')][_0xed87('0x19')]===undefined?!![]:![]:!![],'where':_0x2c386a[_0xed87('0x18')]?_0x2c386a[_0xed87('0x18')][_0xed87('0x1a')]||null:null,'attributes':_0x2c386a['options']?_0x2c386a['options']['attributes']||null:null,'limit':_0x2c386a['options']?_0x2c386a[_0xed87('0x18')]['limit']||null:null,'include':_0x2c386a[_0xed87('0x18')]?_0x2c386a[_0xed87('0x18')]['include']?_[_0xed87('0x1b')](_0x2c386a['options'][_0xed87('0x1c')],function(_0x24962e){return{'model':db[_0x24962e[_0xed87('0x1d')]],'as':_0x24962e['as'],'attributes':_0x24962e[_0xed87('0x1e')],'include':_0x24962e[_0xed87('0x1c')]?_['map'](_0x24962e[_0xed87('0x1c')],function(_0x3c22b7){return{'model':db[_0x3c22b7[_0xed87('0x1d')]],'as':_0x3c22b7['as'],'attributes':_0x3c22b7[_0xed87('0x1e')],'include':_0x3c22b7[_0xed87('0x1c')]?_[_0xed87('0x1b')](_0x3c22b7[_0xed87('0x1c')],function(_0x4735b3){return{'model':db[_0x4735b3[_0xed87('0x1d')]],'as':_0x4735b3['as'],'attributes':_0x4735b3[_0xed87('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xed87('0x9')](function(_0x341a35){logger[_0xed87('0xa')](_0xed87('0x15'),_0x2c386a);logger['debug'](_0xed87('0x15'),_0x2c386a,JSON[_0xed87('0xf')](_0x341a35));_0x5f4076(_0x341a35);})['catch'](function(_0x3dff74){logger[_0xed87('0x10')](_0xed87('0x15'),_0x3dff74['message'],_0x2c386a);_0x211085(_0xfb8a44['error'](0x1f4,_0x3dff74[_0xed87('0x12')]));});});};exports[_0xed87('0x1f')]=function(_0x21ab8a){var _0x549a19=this;return new Promise(function(_0x37d45a,_0x3b87e3){return db[_0xed87('0x16')][_0xed87('0x20')]({'raw':_0x21ab8a[_0xed87('0x18')]?_0x21ab8a[_0xed87('0x18')][_0xed87('0x19')]===undefined?!![]:![]:!![],'where':_0x21ab8a[_0xed87('0x18')]?_0x21ab8a[_0xed87('0x18')]['where']||null:null,'attributes':_0x21ab8a[_0xed87('0x18')]?_0x21ab8a[_0xed87('0x18')]['attributes']||null:null,'include':_0x21ab8a[_0xed87('0x18')]?_0x21ab8a['options'][_0xed87('0x1c')]?_[_0xed87('0x1b')](_0x21ab8a[_0xed87('0x18')][_0xed87('0x1c')],function(_0x103b34){return{'model':db[_0x103b34[_0xed87('0x1d')]],'as':_0x103b34['as'],'attributes':_0x103b34[_0xed87('0x1e')],'include':_0x103b34[_0xed87('0x1c')]?_[_0xed87('0x1b')](_0x103b34[_0xed87('0x1c')],function(_0x35c9aa){return{'model':db[_0x35c9aa['model']],'as':_0x35c9aa['as'],'attributes':_0x35c9aa[_0xed87('0x1e')],'include':_0x35c9aa[_0xed87('0x1c')]?_['map'](_0x35c9aa[_0xed87('0x1c')],function(_0x54f6cb){return{'model':db[_0x54f6cb[_0xed87('0x1d')]],'as':_0x54f6cb['as'],'attributes':_0x54f6cb[_0xed87('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x443090){logger[_0xed87('0xa')](_0xed87('0x1f'),_0x21ab8a);logger[_0xed87('0xd')](_0xed87('0x1f'),_0x21ab8a,JSON['stringify'](_0x443090));_0x37d45a(_0x443090);})[_0xed87('0x14')](function(_0x525a11){logger[_0xed87('0x10')]('ShowVtigerAccount',_0x525a11[_0xed87('0x12')],_0x21ab8a);_0x3b87e3(_0x549a19[_0xed87('0x10')](0x1f4,_0x525a11[_0xed87('0x12')]));});});}; \ No newline at end of file +var _0xed3c=['catch','VtigerAccount','findAll','options','raw','where','limit','include','map','model','attributes','GetVtigerAccount','ShowVtigerAccount','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xed3c,0x1a6));var _0xced3=function(_0x1938f4,_0x5c0c98){_0x1938f4=_0x1938f4-0x0;var _0x37f4db=_0xed3c[_0x1938f4];return _0x37f4db;};'use strict';var _=require(_0xced3('0x0'));var util=require(_0xced3('0x1'));var moment=require(_0xced3('0x2'));var BPromise=require(_0xced3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xced3('0x4'));var db=require(_0xced3('0x5'))['db'];var utils=require(_0xced3('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xced3('0x7'));var jayson=require(_0xced3('0x8'));var client=jayson[_0xced3('0x9')][_0xced3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4795cd,_0x510164,_0x5ca701){return new BPromise(function(_0x851bd3,_0x5f2f90){return client['request'](_0x4795cd,_0x5ca701)['then'](function(_0x19a727){logger[_0xced3('0xb')](_0xced3('0xc'),_0x510164,_0xced3('0xd'));logger[_0xced3('0xe')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x510164,_0xced3('0xd'),JSON[_0xced3('0xf')](_0x19a727));if(_0x19a727[_0xced3('0x10')]){if(_0x19a727['error'][_0xced3('0x11')]===0x1f4){logger[_0xced3('0x10')](_0xced3('0xc'),_0x510164,_0x19a727[_0xced3('0x10')][_0xced3('0x12')]);return _0x5f2f90(_0x19a727[_0xced3('0x10')][_0xced3('0x12')]);}logger['error'](_0xced3('0xc'),_0x510164,_0x19a727['error'][_0xced3('0x12')]);return _0x851bd3(_0x19a727[_0xced3('0x10')][_0xced3('0x12')]);}else{logger[_0xced3('0xb')]('VtigerAccount,\x20%s,\x20%s',_0x510164,_0xced3('0xd'));_0x851bd3(_0x19a727[_0xced3('0x13')]['message']);}})[_0xced3('0x14')](function(_0x37e2d5){logger[_0xced3('0x10')](_0xced3('0xc'),_0x510164,_0x37e2d5);_0x5f2f90(_0x37e2d5);});});}exports['GetVtigerAccount']=function(_0x4569af){var _0x4a3afe=this;return new Promise(function(_0x353580,_0x4480a6){return db[_0xced3('0x15')][_0xced3('0x16')]({'raw':_0x4569af[_0xced3('0x17')]?_0x4569af[_0xced3('0x17')][_0xced3('0x18')]===undefined?!![]:![]:!![],'where':_0x4569af[_0xced3('0x17')]?_0x4569af[_0xced3('0x17')][_0xced3('0x19')]||null:null,'attributes':_0x4569af[_0xced3('0x17')]?_0x4569af['options']['attributes']||null:null,'limit':_0x4569af['options']?_0x4569af[_0xced3('0x17')][_0xced3('0x1a')]||null:null,'include':_0x4569af[_0xced3('0x17')]?_0x4569af['options'][_0xced3('0x1b')]?_[_0xced3('0x1c')](_0x4569af['options']['include'],function(_0x3adf14){return{'model':db[_0x3adf14[_0xced3('0x1d')]],'as':_0x3adf14['as'],'attributes':_0x3adf14[_0xced3('0x1e')],'include':_0x3adf14[_0xced3('0x1b')]?_['map'](_0x3adf14[_0xced3('0x1b')],function(_0x23f92b){return{'model':db[_0x23f92b['model']],'as':_0x23f92b['as'],'attributes':_0x23f92b[_0xced3('0x1e')],'include':_0x23f92b['include']?_[_0xced3('0x1c')](_0x23f92b[_0xced3('0x1b')],function(_0x3b728d){return{'model':db[_0x3b728d[_0xced3('0x1d')]],'as':_0x3b728d['as'],'attributes':_0x3b728d[_0xced3('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5454c0){logger[_0xced3('0xb')]('GetVtigerAccount',_0x4569af);logger[_0xced3('0xe')](_0xced3('0x1f'),_0x4569af,JSON['stringify'](_0x5454c0));_0x353580(_0x5454c0);})[_0xced3('0x14')](function(_0x4024fa){logger[_0xced3('0x10')](_0xced3('0x1f'),_0x4024fa[_0xced3('0x12')],_0x4569af);_0x4480a6(_0x4a3afe[_0xced3('0x10')](0x1f4,_0x4024fa[_0xced3('0x12')]));});});};exports[_0xced3('0x20')]=function(_0x116cc7){var _0x559b8e=this;return new Promise(function(_0xa78899,_0x1b8baa){return db[_0xced3('0x15')][_0xced3('0x21')]({'raw':_0x116cc7[_0xced3('0x17')]?_0x116cc7[_0xced3('0x17')][_0xced3('0x18')]===undefined?!![]:![]:!![],'where':_0x116cc7[_0xced3('0x17')]?_0x116cc7[_0xced3('0x17')][_0xced3('0x19')]||null:null,'attributes':_0x116cc7[_0xced3('0x17')]?_0x116cc7[_0xced3('0x17')][_0xced3('0x1e')]||null:null,'include':_0x116cc7[_0xced3('0x17')]?_0x116cc7[_0xced3('0x17')][_0xced3('0x1b')]?_[_0xced3('0x1c')](_0x116cc7[_0xced3('0x17')][_0xced3('0x1b')],function(_0xcd0fe3){return{'model':db[_0xcd0fe3[_0xced3('0x1d')]],'as':_0xcd0fe3['as'],'attributes':_0xcd0fe3['attributes'],'include':_0xcd0fe3[_0xced3('0x1b')]?_['map'](_0xcd0fe3[_0xced3('0x1b')],function(_0x28f674){return{'model':db[_0x28f674[_0xced3('0x1d')]],'as':_0x28f674['as'],'attributes':_0x28f674[_0xced3('0x1e')],'include':_0x28f674[_0xced3('0x1b')]?_[_0xced3('0x1c')](_0x28f674[_0xced3('0x1b')],function(_0x340be1){return{'model':db[_0x340be1[_0xced3('0x1d')]],'as':_0x340be1['as'],'attributes':_0x340be1[_0xced3('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x342c11){logger[_0xced3('0xb')]('ShowVtigerAccount',_0x116cc7);logger[_0xced3('0xe')](_0xced3('0x20'),_0x116cc7,JSON[_0xced3('0xf')](_0x342c11));_0xa78899(_0x342c11);})['catch'](function(_0x59c3aa){logger[_0xced3('0x10')]('ShowVtigerAccount',_0x59c3aa[_0xced3('0x12')],_0x116cc7);_0x1b8baa(_0x559b8e[_0xced3('0x10')](0x1f4,_0x59c3aa['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 471fb3c..f644a77 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 _0xe1b1=['index','/:id','show','getFields','get','/:id/subjects','getSubjects','getDescriptions','create','put','update','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','isAuthenticated'];(function(_0x25df80,_0xa2aec5){var _0x17b6d0=function(_0x446155){while(--_0x446155){_0x25df80['push'](_0x25df80['shift']());}};_0x17b6d0(++_0xa2aec5);}(_0xe1b1,0x137));var _0x1e1b=function(_0x195e50,_0x57b5a8){_0x195e50=_0x195e50-0x0;var _0x51d35e=_0xe1b1[_0x195e50];return _0x51d35e;};'use strict';var multer=require('multer');var util=require(_0x1e1b('0x0'));var path=require(_0x1e1b('0x1'));var timeout=require(_0x1e1b('0x2'));var express=require(_0x1e1b('0x3'));var router=express[_0x1e1b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1e1b('0x5'));var config=require(_0x1e1b('0x6'));var controller=require(_0x1e1b('0x7'));router['get']('/',auth[_0x1e1b('0x8')](),controller[_0x1e1b('0x9')]);router['get'](_0x1e1b('0xa'),auth[_0x1e1b('0x8')](),controller[_0x1e1b('0xb')]);router['get']('/:id/fields',auth[_0x1e1b('0x8')](),controller[_0x1e1b('0xc')]);router[_0x1e1b('0xd')](_0x1e1b('0xe'),auth[_0x1e1b('0x8')](),controller[_0x1e1b('0xf')]);router[_0x1e1b('0xd')]('/:id/descriptions',auth[_0x1e1b('0x8')](),controller[_0x1e1b('0x10')]);router['post']('/',auth[_0x1e1b('0x8')](),controller[_0x1e1b('0x11')]);router[_0x1e1b('0x12')](_0x1e1b('0xa'),auth[_0x1e1b('0x8')](),controller[_0x1e1b('0x13')]);router['delete'](_0x1e1b('0xa'),auth[_0x1e1b('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x3e1c=['Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x165ca9,_0x36e359){var _0x25f49a=function(_0x3da5e5){while(--_0x3da5e5){_0x165ca9['push'](_0x165ca9['shift']());}};_0x25f49a(++_0x36e359);}(_0x3e1c,0xeb));var _0xc3e1=function(_0x37b454,_0x4e5678){_0x37b454=_0x37b454-0x0;var _0x30c2a2=_0x3e1c[_0x37b454];return _0x30c2a2;};'use strict';var multer=require(_0xc3e1('0x0'));var util=require(_0xc3e1('0x1'));var path=require(_0xc3e1('0x2'));var timeout=require(_0xc3e1('0x3'));var express=require(_0xc3e1('0x4'));var router=express[_0xc3e1('0x5')]();var fs_extra=require(_0xc3e1('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xc3e1('0x7'));var config=require(_0xc3e1('0x8'));var controller=require(_0xc3e1('0x9'));router[_0xc3e1('0xa')]('/',auth[_0xc3e1('0xb')](),controller[_0xc3e1('0xc')]);router[_0xc3e1('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc3e1('0xd')]);router['get'](_0xc3e1('0xe'),auth[_0xc3e1('0xb')](),controller[_0xc3e1('0xf')]);router['get'](_0xc3e1('0x10'),auth[_0xc3e1('0xb')](),controller['getSubjects']);router[_0xc3e1('0xa')](_0xc3e1('0x11'),auth[_0xc3e1('0xb')](),controller['getDescriptions']);router[_0xc3e1('0x12')]('/',auth[_0xc3e1('0xb')](),controller[_0xc3e1('0x13')]);router[_0xc3e1('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xc3e1('0x15')]);router[_0xc3e1('0x16')]('/:id',auth[_0xc3e1('0xb')](),controller[_0xc3e1('0x17')]);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 32baf82..3e1c3c4 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 _0x4e6e=['STRING','sequelize','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4e6e,0x178));var _0xe4e6=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0x4e6e[_0x47fd36];return _0x21a0fc;};'use strict';var Sequelize=require(_0xe4e6('0x0'));module[_0xe4e6('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe4e6('0x2')]}}; \ No newline at end of file +var _0x6608=['exports','STRING','sequelize'];(function(_0x195812,_0x2b2bc6){var _0x4c34bf=function(_0x15070c){while(--_0x15070c){_0x195812['push'](_0x195812['shift']());}};_0x4c34bf(++_0x2b2bc6);}(_0x6608,0xad));var _0x8660=function(_0x17cbbd,_0x3f9d58){_0x17cbbd=_0x17cbbd-0x0;var _0x4c63eb=_0x6608[_0x17cbbd];return _0x4c63eb;};'use strict';var Sequelize=require(_0x8660('0x0'));module[_0x8660('0x1')]={'name':{'type':Sequelize[_0x8660('0x2')]},'description':{'type':Sequelize[_0x8660('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 404e212..c70e459 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 _0x7da1=['name','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','params','length','find','catch','create','body','getFields','findOne','VtigerField','getSubjects','getDescriptions','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','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','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack'];(function(_0x2cdaf8,_0x415a17){var _0xf1b64b=function(_0x587f9e){while(--_0x587f9e){_0x2cdaf8['push'](_0x2cdaf8['shift']());}};_0xf1b64b(++_0x415a17);}(_0x7da1,0x1bb));var _0x17da=function(_0x3bbc37,_0x5e52f0){_0x3bbc37=_0x3bbc37-0x0;var _0x36d4e5=_0x7da1[_0x3bbc37];return _0x36d4e5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x17da('0x0'));var jsonpatch=require(_0x17da('0x1'));var rp=require(_0x17da('0x2'));var moment=require(_0x17da('0x3'));var BPromise=require(_0x17da('0x4'));var Mustache=require('mustache');var util=require(_0x17da('0x5'));var path=require(_0x17da('0x6'));var sox=require(_0x17da('0x7'));var csv=require('to-csv');var ejs=require(_0x17da('0x8'));var fs=require('fs');var fs_extra=require(_0x17da('0x9'));var _=require(_0x17da('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x17da('0xb'));var deskjs=require(_0x17da('0xc'));var toCsv=require(_0x17da('0xd'));var querystring=require(_0x17da('0xe'));var Papa=require(_0x17da('0xf'));var Redis=require('ioredis');var authService=require(_0x17da('0x10'));var qs=require(_0x17da('0x11'));var as=require(_0x17da('0x12'));var hardwareService=require(_0x17da('0x13'));var logger=require(_0x17da('0x14'))(_0x17da('0x15'));var utils=require(_0x17da('0x16'));var config=require(_0x17da('0x17'));var licenseUtil=require(_0x17da('0x18'));var db=require(_0x17da('0x19'))['db'];function respondWithStatusCode(_0xbe9f3f,_0x4cab4b){_0x4cab4b=_0x4cab4b||0xcc;return function(_0x20c1ad){if(_0x20c1ad){return _0xbe9f3f['sendStatus'](_0x4cab4b);}return _0xbe9f3f[_0x17da('0x1a')](_0x4cab4b)[_0x17da('0x1b')]();};}function respondWithResult(_0x5895de,_0x109066){_0x109066=_0x109066||0xc8;return function(_0x362e2a){if(_0x362e2a){return _0x5895de[_0x17da('0x1a')](_0x109066)[_0x17da('0x1c')](_0x362e2a);}};}function respondWithFilteredResult(_0x48d712,_0x39398e){return function(_0x35344e){if(_0x35344e){var _0x29e99e=typeof _0x39398e['offset']===_0x17da('0x1d')&&typeof _0x39398e[_0x17da('0x1e')]===_0x17da('0x1d');var _0x28d0ab=_0x35344e['count'];var _0x16f785=_0x29e99e?0x0:_0x39398e[_0x17da('0x1f')];var _0x1293e5=_0x29e99e?_0x35344e[_0x17da('0x20')]:_0x39398e[_0x17da('0x1f')]+_0x39398e[_0x17da('0x1e')];var _0x453a0a;if(_0x1293e5>=_0x28d0ab){_0x1293e5=_0x28d0ab;_0x453a0a=0xc8;}else{_0x453a0a=0xce;}_0x48d712[_0x17da('0x1a')](_0x453a0a);return _0x48d712[_0x17da('0x21')](_0x17da('0x22'),_0x16f785+'-'+_0x1293e5+'/'+_0x28d0ab)[_0x17da('0x1c')](_0x35344e);}return null;};}function patchUpdates(_0x31c36c){return function(_0x183f60){try{jsonpatch[_0x17da('0x23')](_0x183f60,_0x31c36c,!![]);}catch(_0x33eda4){return BPromise[_0x17da('0x24')](_0x33eda4);}return _0x183f60[_0x17da('0x25')]();};}function saveUpdates(_0x3104a5,_0x1f920c){return function(_0x4f21b5){if(_0x4f21b5){return _0x4f21b5[_0x17da('0x26')](_0x3104a5)['then'](function(_0x2c6724){return _0x2c6724;});}return null;};}function removeEntity(_0x4414ae,_0x4eee47){return function(_0x4f7a73){if(_0x4f7a73){return _0x4f7a73['destroy']()[_0x17da('0x27')](function(){_0x4414ae[_0x17da('0x1a')](0xcc)[_0x17da('0x1b')]();});}};}function handleEntityNotFound(_0x1baa7a,_0x56de51){return function(_0x27c907){if(!_0x27c907){_0x1baa7a[_0x17da('0x28')](0x194);}return _0x27c907;};}function handleError(_0x2d63b1,_0x62697c){_0x62697c=_0x62697c||0x1f4;return function(_0x557755){logger[_0x17da('0x29')](_0x557755[_0x17da('0x2a')]);if(_0x557755[_0x17da('0x2b')]){delete _0x557755[_0x17da('0x2b')];}_0x2d63b1['status'](_0x62697c)['send'](_0x557755);};}exports[_0x17da('0x2c')]=function(_0x2a6b67,_0x276ae1){var _0x473538={},_0x763850={},_0x58823e={'count':0x0,'rows':[]};var _0x44be58=_[_0x17da('0x2d')](db[_0x17da('0x2e')][_0x17da('0x2f')],function(_0x15a55c){return{'name':_0x15a55c[_0x17da('0x30')],'type':_0x15a55c[_0x17da('0x31')][_0x17da('0x32')]};});_0x763850[_0x17da('0x33')]=_['map'](_0x44be58,_0x17da('0x2b'));_0x763850['query']=_[_0x17da('0x34')](_0x2a6b67[_0x17da('0x35')]);_0x763850[_0x17da('0x36')]=_[_0x17da('0x37')](_0x763850[_0x17da('0x33')],_0x763850[_0x17da('0x35')]);_0x473538[_0x17da('0x38')]=_[_0x17da('0x37')](_0x763850['model'],qs[_0x17da('0x39')](_0x2a6b67[_0x17da('0x35')]['fields']));_0x473538[_0x17da('0x38')]=_0x473538[_0x17da('0x38')]['length']?_0x473538[_0x17da('0x38')]:_0x763850['model'];if(!_0x2a6b67['query'][_0x17da('0x3a')](_0x17da('0x3b'))){_0x473538[_0x17da('0x1e')]=qs['limit'](_0x2a6b67[_0x17da('0x35')]['limit']);_0x473538[_0x17da('0x1f')]=qs[_0x17da('0x1f')](_0x2a6b67[_0x17da('0x35')][_0x17da('0x1f')]);}_0x473538[_0x17da('0x3c')]=qs[_0x17da('0x3d')](_0x2a6b67[_0x17da('0x35')]['sort']);_0x473538[_0x17da('0x3e')]=qs[_0x17da('0x36')](_[_0x17da('0x3f')](_0x2a6b67[_0x17da('0x35')],_0x763850['filters']),_0x44be58);if(_0x2a6b67[_0x17da('0x35')][_0x17da('0x40')]){_0x473538[_0x17da('0x3e')]=_[_0x17da('0x41')](_0x473538['where'],{'$or':_['map'](_0x44be58,function(_0xc41d12){if(_0xc41d12[_0x17da('0x31')]!=='VIRTUAL'){var _0x5b0fe4={};_0x5b0fe4[_0xc41d12[_0x17da('0x2b')]]={'$like':'%'+_0x2a6b67[_0x17da('0x35')]['filter']+'%'};return _0x5b0fe4;}})});}_0x473538=_[_0x17da('0x41')]({},_0x473538,_0x2a6b67[_0x17da('0x42')]);var _0x24d495={'where':_0x473538[_0x17da('0x3e')]};return db['VtigerConfiguration']['count'](_0x24d495)[_0x17da('0x27')](function(_0x238f49){_0x58823e[_0x17da('0x20')]=_0x238f49;if(_0x2a6b67[_0x17da('0x35')][_0x17da('0x43')]){_0x473538['include']=[{'all':!![]}];}return db[_0x17da('0x2e')][_0x17da('0x44')](_0x473538);})[_0x17da('0x27')](function(_0x255251){_0x58823e[_0x17da('0x45')]=_0x255251;return _0x58823e;})[_0x17da('0x27')](respondWithFilteredResult(_0x276ae1,_0x473538))['catch'](handleError(_0x276ae1,null));};exports['show']=function(_0x51eb04,_0xcc5c2e){var _0x57cd95={'raw':![],'where':{'id':_0x51eb04[_0x17da('0x46')]['id']}},_0xbf220d={};_0xbf220d[_0x17da('0x33')]=_[_0x17da('0x34')](db[_0x17da('0x2e')][_0x17da('0x2f')]);_0xbf220d[_0x17da('0x35')]=_[_0x17da('0x34')](_0x51eb04[_0x17da('0x35')]);_0xbf220d['filters']=_[_0x17da('0x37')](_0xbf220d['model'],_0xbf220d[_0x17da('0x35')]);_0x57cd95[_0x17da('0x38')]=_[_0x17da('0x37')](_0xbf220d[_0x17da('0x33')],qs[_0x17da('0x39')](_0x51eb04['query']['fields']));_0x57cd95[_0x17da('0x38')]=_0x57cd95['attributes'][_0x17da('0x47')]?_0x57cd95['attributes']:_0xbf220d[_0x17da('0x33')];if(_0x51eb04[_0x17da('0x35')][_0x17da('0x43')]){_0x57cd95['include']=[{'all':!![]}];}_0x57cd95=_[_0x17da('0x41')]({},_0x57cd95,_0x51eb04['options']);return db['VtigerConfiguration'][_0x17da('0x48')](_0x57cd95)[_0x17da('0x27')](handleEntityNotFound(_0xcc5c2e,null))[_0x17da('0x27')](respondWithResult(_0xcc5c2e,null))[_0x17da('0x49')](handleError(_0xcc5c2e,null));};exports[_0x17da('0x4a')]=function(_0x137e41,_0x3c3214){return db[_0x17da('0x2e')][_0x17da('0x4a')](_0x137e41[_0x17da('0x4b')],{})[_0x17da('0x27')](respondWithResult(_0x3c3214,0xc9))[_0x17da('0x49')](handleError(_0x3c3214,null));};exports[_0x17da('0x26')]=function(_0x533020,_0x1918a0){if(_0x533020[_0x17da('0x4b')]['id']){delete _0x533020[_0x17da('0x4b')]['id'];}return db['VtigerConfiguration'][_0x17da('0x48')]({'where':{'id':_0x533020[_0x17da('0x46')]['id']}})[_0x17da('0x27')](handleEntityNotFound(_0x1918a0,null))[_0x17da('0x27')](saveUpdates(_0x533020[_0x17da('0x4b')],null))[_0x17da('0x27')](respondWithResult(_0x1918a0,null))[_0x17da('0x49')](handleError(_0x1918a0,null));};exports['destroy']=function(_0x585867,_0x2dbfa7){return db[_0x17da('0x2e')][_0x17da('0x48')]({'where':{'id':_0x585867[_0x17da('0x46')]['id']}})[_0x17da('0x27')](handleEntityNotFound(_0x2dbfa7,null))[_0x17da('0x27')](removeEntity(_0x2dbfa7,null))[_0x17da('0x49')](handleError(_0x2dbfa7,null));};exports[_0x17da('0x4c')]=function(_0x15ad77,_0x78c30e,_0xef79db){var _0x47ec9d={};var _0x2c95da={};var _0x3e7f27;var _0x2a7bee;return db[_0x17da('0x2e')][_0x17da('0x4d')]({'where':{'id':_0x15ad77[_0x17da('0x46')]['id']}})[_0x17da('0x27')](handleEntityNotFound(_0x78c30e,null))[_0x17da('0x27')](function(_0x26c46a){if(_0x26c46a){_0x3e7f27=_0x26c46a;_0x2c95da[_0x17da('0x33')]=_[_0x17da('0x34')](db[_0x17da('0x4e')][_0x17da('0x2f')]);_0x2c95da['query']=_[_0x17da('0x34')](_0x15ad77[_0x17da('0x35')]);_0x2c95da[_0x17da('0x36')]=_[_0x17da('0x37')](_0x2c95da[_0x17da('0x33')],_0x2c95da[_0x17da('0x35')]);_0x47ec9d[_0x17da('0x38')]=_['intersection'](_0x2c95da['model'],qs['fields'](_0x15ad77['query'][_0x17da('0x39')]));_0x47ec9d[_0x17da('0x38')]=_0x47ec9d[_0x17da('0x38')][_0x17da('0x47')]?_0x47ec9d[_0x17da('0x38')]:_0x2c95da['model'];_0x47ec9d[_0x17da('0x3c')]=qs[_0x17da('0x3d')](_0x15ad77[_0x17da('0x35')]['sort']);_0x47ec9d[_0x17da('0x3e')]=qs['filters'](_[_0x17da('0x3f')](_0x15ad77[_0x17da('0x35')],_0x2c95da[_0x17da('0x36')]));if(_0x15ad77[_0x17da('0x35')][_0x17da('0x40')]){_0x47ec9d[_0x17da('0x3e')]=_[_0x17da('0x41')](_0x47ec9d[_0x17da('0x3e')],{'$or':_[_0x17da('0x2d')](_0x47ec9d[_0x17da('0x38')],function(_0x44b7b7){var _0x2db529={};_0x2db529[_0x44b7b7]={'$like':'%'+_0x15ad77['query'][_0x17da('0x40')]+'%'};return _0x2db529;})});}_0x47ec9d=_['merge']({},_0x47ec9d,_0x15ad77[_0x17da('0x42')]);return _0x3e7f27[_0x17da('0x4c')](_0x47ec9d);}})[_0x17da('0x27')](function(_0xb2b39d){if(_0xb2b39d){_0x2a7bee=_0xb2b39d['length'];if(!_0x15ad77['query'][_0x17da('0x3a')]('nolimit')){_0x47ec9d[_0x17da('0x1e')]=qs[_0x17da('0x1e')](_0x15ad77[_0x17da('0x35')][_0x17da('0x1e')]);_0x47ec9d[_0x17da('0x1f')]=qs['offset'](_0x15ad77['query'][_0x17da('0x1f')]);}return _0x3e7f27[_0x17da('0x4c')](_0x47ec9d);}})[_0x17da('0x27')](function(_0xf13912){if(_0xf13912){return _0xf13912?{'count':_0x2a7bee,'rows':_0xf13912}:null;}})[_0x17da('0x27')](respondWithResult(_0x78c30e,null))['catch'](handleError(_0x78c30e,null));};exports['getSubjects']=function(_0x319932,_0x4ea333,_0x204972){var _0x573b6d={};var _0x5b6ab0={};var _0x415937;var _0x15ea78;return db['VtigerConfiguration'][_0x17da('0x4d')]({'where':{'id':_0x319932[_0x17da('0x46')]['id']}})[_0x17da('0x27')](handleEntityNotFound(_0x4ea333,null))['then'](function(_0xa95596){if(_0xa95596){_0x415937=_0xa95596;_0x5b6ab0[_0x17da('0x33')]=_[_0x17da('0x34')](db['VtigerField'][_0x17da('0x2f')]);_0x5b6ab0['query']=_[_0x17da('0x34')](_0x319932[_0x17da('0x35')]);_0x5b6ab0[_0x17da('0x36')]=_['intersection'](_0x5b6ab0['model'],_0x5b6ab0['query']);_0x573b6d[_0x17da('0x38')]=_[_0x17da('0x37')](_0x5b6ab0[_0x17da('0x33')],qs[_0x17da('0x39')](_0x319932['query']['fields']));_0x573b6d[_0x17da('0x38')]=_0x573b6d[_0x17da('0x38')][_0x17da('0x47')]?_0x573b6d[_0x17da('0x38')]:_0x5b6ab0[_0x17da('0x33')];_0x573b6d[_0x17da('0x3c')]=qs[_0x17da('0x3d')](_0x319932[_0x17da('0x35')][_0x17da('0x3d')]);_0x573b6d[_0x17da('0x3e')]=qs[_0x17da('0x36')](_[_0x17da('0x3f')](_0x319932[_0x17da('0x35')],_0x5b6ab0['filters']));if(_0x319932['query'][_0x17da('0x40')]){_0x573b6d[_0x17da('0x3e')]=_[_0x17da('0x41')](_0x573b6d['where'],{'$or':_[_0x17da('0x2d')](_0x573b6d[_0x17da('0x38')],function(_0x2fb585){var _0x21ad83={};_0x21ad83[_0x2fb585]={'$like':'%'+_0x319932[_0x17da('0x35')][_0x17da('0x40')]+'%'};return _0x21ad83;})});}_0x573b6d=_[_0x17da('0x41')]({},_0x573b6d,_0x319932[_0x17da('0x42')]);return _0x415937[_0x17da('0x4f')](_0x573b6d);}})[_0x17da('0x27')](function(_0x2f48e7){if(_0x2f48e7){_0x15ea78=_0x2f48e7[_0x17da('0x47')];if(!_0x319932[_0x17da('0x35')][_0x17da('0x3a')](_0x17da('0x3b'))){_0x573b6d[_0x17da('0x1e')]=qs['limit'](_0x319932[_0x17da('0x35')][_0x17da('0x1e')]);_0x573b6d[_0x17da('0x1f')]=qs[_0x17da('0x1f')](_0x319932[_0x17da('0x35')][_0x17da('0x1f')]);}return _0x415937[_0x17da('0x4f')](_0x573b6d);}})[_0x17da('0x27')](function(_0x1e77cb){if(_0x1e77cb){return _0x1e77cb?{'count':_0x15ea78,'rows':_0x1e77cb}:null;}})[_0x17da('0x27')](respondWithResult(_0x4ea333,null))[_0x17da('0x49')](handleError(_0x4ea333,null));};exports['getDescriptions']=function(_0x3ff9bf,_0x237080,_0x2b9174){var _0x4e1028={};var _0xca51e8={};var _0x27c34e;var _0xc6ecd;return db[_0x17da('0x2e')][_0x17da('0x4d')]({'where':{'id':_0x3ff9bf[_0x17da('0x46')]['id']}})[_0x17da('0x27')](handleEntityNotFound(_0x237080,null))[_0x17da('0x27')](function(_0x3af03e){if(_0x3af03e){_0x27c34e=_0x3af03e;_0xca51e8[_0x17da('0x33')]=_[_0x17da('0x34')](db[_0x17da('0x4e')][_0x17da('0x2f')]);_0xca51e8[_0x17da('0x35')]=_[_0x17da('0x34')](_0x3ff9bf['query']);_0xca51e8[_0x17da('0x36')]=_['intersection'](_0xca51e8[_0x17da('0x33')],_0xca51e8['query']);_0x4e1028[_0x17da('0x38')]=_['intersection'](_0xca51e8[_0x17da('0x33')],qs[_0x17da('0x39')](_0x3ff9bf['query'][_0x17da('0x39')]));_0x4e1028[_0x17da('0x38')]=_0x4e1028[_0x17da('0x38')]['length']?_0x4e1028[_0x17da('0x38')]:_0xca51e8[_0x17da('0x33')];_0x4e1028[_0x17da('0x3c')]=qs[_0x17da('0x3d')](_0x3ff9bf[_0x17da('0x35')][_0x17da('0x3d')]);_0x4e1028['where']=qs['filters'](_[_0x17da('0x3f')](_0x3ff9bf[_0x17da('0x35')],_0xca51e8[_0x17da('0x36')]));if(_0x3ff9bf[_0x17da('0x35')][_0x17da('0x40')]){_0x4e1028[_0x17da('0x3e')]=_[_0x17da('0x41')](_0x4e1028[_0x17da('0x3e')],{'$or':_[_0x17da('0x2d')](_0x4e1028[_0x17da('0x38')],function(_0x51c923){var _0x44abad={};_0x44abad[_0x51c923]={'$like':'%'+_0x3ff9bf['query'][_0x17da('0x40')]+'%'};return _0x44abad;})});}_0x4e1028=_[_0x17da('0x41')]({},_0x4e1028,_0x3ff9bf[_0x17da('0x42')]);return _0x27c34e[_0x17da('0x50')](_0x4e1028);}})[_0x17da('0x27')](function(_0x18a30f){if(_0x18a30f){_0xc6ecd=_0x18a30f[_0x17da('0x47')];if(!_0x3ff9bf[_0x17da('0x35')]['hasOwnProperty']('nolimit')){_0x4e1028[_0x17da('0x1e')]=qs[_0x17da('0x1e')](_0x3ff9bf['query'][_0x17da('0x1e')]);_0x4e1028[_0x17da('0x1f')]=qs[_0x17da('0x1f')](_0x3ff9bf[_0x17da('0x35')][_0x17da('0x1f')]);}return _0x27c34e[_0x17da('0x50')](_0x4e1028);}})[_0x17da('0x27')](function(_0x413c3a){if(_0x413c3a){return _0x413c3a?{'count':_0xc6ecd,'rows':_0x413c3a}:null;}})[_0x17da('0x27')](respondWithResult(_0x237080,null))['catch'](handleError(_0x237080,null));}; \ No newline at end of file +var _0x1dbd=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','VtigerConfiguration','rawAttributes','type','key','map','query','keys','attributes','intersection','fields','model','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','getFields','findOne','VtigerField','hasOwnProperty','getSubjects','length','getDescriptions','nolimit','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv'];(function(_0x438f65,_0x50ad4b){var _0x5dad47=function(_0x18fe8b){while(--_0x18fe8b){_0x438f65['push'](_0x438f65['shift']());}};_0x5dad47(++_0x50ad4b);}(_0x1dbd,0x1d7));var _0xd1db=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1dbd[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd1db('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd1db('0x1'));var rp=require(_0xd1db('0x2'));var moment=require(_0xd1db('0x3'));var BPromise=require(_0xd1db('0x4'));var Mustache=require(_0xd1db('0x5'));var util=require('util');var path=require(_0xd1db('0x6'));var sox=require(_0xd1db('0x7'));var csv=require(_0xd1db('0x8'));var ejs=require(_0xd1db('0x9'));var fs=require('fs');var fs_extra=require(_0xd1db('0xa'));var _=require(_0xd1db('0xb'));var squel=require(_0xd1db('0xc'));var crypto=require(_0xd1db('0xd'));var jsforce=require(_0xd1db('0xe'));var deskjs=require(_0xd1db('0xf'));var toCsv=require(_0xd1db('0x8'));var querystring=require('querystring');var Papa=require(_0xd1db('0x10'));var Redis=require(_0xd1db('0x11'));var authService=require(_0xd1db('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd1db('0x13'));var hardwareService=require(_0xd1db('0x14'));var logger=require(_0xd1db('0x15'))(_0xd1db('0x16'));var utils=require(_0xd1db('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd1db('0x18'))['db'];function respondWithStatusCode(_0x3c21b9,_0x25f760){_0x25f760=_0x25f760||0xcc;return function(_0xe1df23){if(_0xe1df23){return _0x3c21b9[_0xd1db('0x19')](_0x25f760);}return _0x3c21b9[_0xd1db('0x1a')](_0x25f760)[_0xd1db('0x1b')]();};}function respondWithResult(_0x118595,_0x1b934c){_0x1b934c=_0x1b934c||0xc8;return function(_0x521fa4){if(_0x521fa4){return _0x118595[_0xd1db('0x1a')](_0x1b934c)[_0xd1db('0x1c')](_0x521fa4);}};}function respondWithFilteredResult(_0xd2376e,_0x20c6dc){return function(_0x2d178f){if(_0x2d178f){var _0x2c13c9=typeof _0x20c6dc[_0xd1db('0x1d')]==='undefined'&&typeof _0x20c6dc[_0xd1db('0x1e')]==='undefined';var _0x15373c=_0x2d178f['count'];var _0x4884fa=_0x2c13c9?0x0:_0x20c6dc['offset'];var _0x30c83b=_0x2c13c9?_0x2d178f[_0xd1db('0x1f')]:_0x20c6dc[_0xd1db('0x1d')]+_0x20c6dc[_0xd1db('0x1e')];var _0x3e3c2a;if(_0x30c83b>=_0x15373c){_0x30c83b=_0x15373c;_0x3e3c2a=0xc8;}else{_0x3e3c2a=0xce;}_0xd2376e[_0xd1db('0x1a')](_0x3e3c2a);return _0xd2376e[_0xd1db('0x20')](_0xd1db('0x21'),_0x4884fa+'-'+_0x30c83b+'/'+_0x15373c)[_0xd1db('0x1c')](_0x2d178f);}return null;};}function patchUpdates(_0x22e38e){return function(_0x590f69){try{jsonpatch[_0xd1db('0x22')](_0x590f69,_0x22e38e,!![]);}catch(_0x305d50){return BPromise['reject'](_0x305d50);}return _0x590f69[_0xd1db('0x23')]();};}function saveUpdates(_0x1cf397,_0x1a2b50){return function(_0x379c72){if(_0x379c72){return _0x379c72[_0xd1db('0x24')](_0x1cf397)[_0xd1db('0x25')](function(_0x255d6a){return _0x255d6a;});}return null;};}function removeEntity(_0x2d2722,_0x235b68){return function(_0x36e045){if(_0x36e045){return _0x36e045['destroy']()[_0xd1db('0x25')](function(){_0x2d2722[_0xd1db('0x1a')](0xcc)[_0xd1db('0x1b')]();});}};}function handleEntityNotFound(_0x40103e,_0x2d6c17){return function(_0x3d39b8){if(!_0x3d39b8){_0x40103e[_0xd1db('0x19')](0x194);}return _0x3d39b8;};}function handleError(_0x367559,_0x2bb167){_0x2bb167=_0x2bb167||0x1f4;return function(_0x13883d){logger[_0xd1db('0x26')](_0x13883d[_0xd1db('0x27')]);if(_0x13883d[_0xd1db('0x28')]){delete _0x13883d[_0xd1db('0x28')];}_0x367559[_0xd1db('0x1a')](_0x2bb167)[_0xd1db('0x29')](_0x13883d);};}exports[_0xd1db('0x2a')]=function(_0x41aaa5,_0x24af55){var _0x5a6fb4={},_0xd4d1f4={},_0x446da7={'count':0x0,'rows':[]};var _0x33a91c=_['map'](db[_0xd1db('0x2b')][_0xd1db('0x2c')],function(_0x29e984){return{'name':_0x29e984['fieldName'],'type':_0x29e984[_0xd1db('0x2d')][_0xd1db('0x2e')]};});_0xd4d1f4['model']=_[_0xd1db('0x2f')](_0x33a91c,_0xd1db('0x28'));_0xd4d1f4[_0xd1db('0x30')]=_[_0xd1db('0x31')](_0x41aaa5[_0xd1db('0x30')]);_0xd4d1f4['filters']=_['intersection'](_0xd4d1f4['model'],_0xd4d1f4[_0xd1db('0x30')]);_0x5a6fb4[_0xd1db('0x32')]=_[_0xd1db('0x33')](_0xd4d1f4['model'],qs[_0xd1db('0x34')](_0x41aaa5['query'][_0xd1db('0x34')]));_0x5a6fb4[_0xd1db('0x32')]=_0x5a6fb4[_0xd1db('0x32')]['length']?_0x5a6fb4['attributes']:_0xd4d1f4[_0xd1db('0x35')];if(!_0x41aaa5['query']['hasOwnProperty']('nolimit')){_0x5a6fb4['limit']=qs[_0xd1db('0x1e')](_0x41aaa5[_0xd1db('0x30')][_0xd1db('0x1e')]);_0x5a6fb4[_0xd1db('0x1d')]=qs[_0xd1db('0x1d')](_0x41aaa5['query']['offset']);}_0x5a6fb4[_0xd1db('0x36')]=qs['sort'](_0x41aaa5['query'][_0xd1db('0x37')]);_0x5a6fb4['where']=qs[_0xd1db('0x38')](_[_0xd1db('0x39')](_0x41aaa5[_0xd1db('0x30')],_0xd4d1f4[_0xd1db('0x38')]),_0x33a91c);if(_0x41aaa5['query'][_0xd1db('0x3a')]){_0x5a6fb4[_0xd1db('0x3b')]=_[_0xd1db('0x3c')](_0x5a6fb4[_0xd1db('0x3b')],{'$or':_[_0xd1db('0x2f')](_0x33a91c,function(_0x6b3720){if(_0x6b3720[_0xd1db('0x2d')]!==_0xd1db('0x3d')){var _0x1f7117={};_0x1f7117[_0x6b3720['name']]={'$like':'%'+_0x41aaa5[_0xd1db('0x30')]['filter']+'%'};return _0x1f7117;}})});}_0x5a6fb4=_['merge']({},_0x5a6fb4,_0x41aaa5[_0xd1db('0x3e')]);var _0x1b2672={'where':_0x5a6fb4['where']};return db[_0xd1db('0x2b')]['count'](_0x1b2672)['then'](function(_0x4438d8){_0x446da7[_0xd1db('0x1f')]=_0x4438d8;if(_0x41aaa5[_0xd1db('0x30')][_0xd1db('0x3f')]){_0x5a6fb4[_0xd1db('0x40')]=[{'all':!![]}];}return db[_0xd1db('0x2b')][_0xd1db('0x41')](_0x5a6fb4);})[_0xd1db('0x25')](function(_0x1c4cab){_0x446da7[_0xd1db('0x42')]=_0x1c4cab;return _0x446da7;})[_0xd1db('0x25')](respondWithFilteredResult(_0x24af55,_0x5a6fb4))[_0xd1db('0x43')](handleError(_0x24af55,null));};exports['show']=function(_0x123fd5,_0x2e0bdd){var _0x1375da={'raw':![],'where':{'id':_0x123fd5[_0xd1db('0x44')]['id']}},_0xc847cc={};_0xc847cc[_0xd1db('0x35')]=_[_0xd1db('0x31')](db[_0xd1db('0x2b')][_0xd1db('0x2c')]);_0xc847cc[_0xd1db('0x30')]=_[_0xd1db('0x31')](_0x123fd5[_0xd1db('0x30')]);_0xc847cc[_0xd1db('0x38')]=_['intersection'](_0xc847cc[_0xd1db('0x35')],_0xc847cc[_0xd1db('0x30')]);_0x1375da[_0xd1db('0x32')]=_['intersection'](_0xc847cc[_0xd1db('0x35')],qs[_0xd1db('0x34')](_0x123fd5[_0xd1db('0x30')][_0xd1db('0x34')]));_0x1375da[_0xd1db('0x32')]=_0x1375da['attributes']['length']?_0x1375da[_0xd1db('0x32')]:_0xc847cc['model'];if(_0x123fd5['query'][_0xd1db('0x3f')]){_0x1375da['include']=[{'all':!![]}];}_0x1375da=_['merge']({},_0x1375da,_0x123fd5[_0xd1db('0x3e')]);return db[_0xd1db('0x2b')][_0xd1db('0x45')](_0x1375da)[_0xd1db('0x25')](handleEntityNotFound(_0x2e0bdd,null))[_0xd1db('0x25')](respondWithResult(_0x2e0bdd,null))[_0xd1db('0x43')](handleError(_0x2e0bdd,null));};exports[_0xd1db('0x46')]=function(_0x200837,_0x5db8df){return db[_0xd1db('0x2b')][_0xd1db('0x46')](_0x200837[_0xd1db('0x47')],{})[_0xd1db('0x25')](respondWithResult(_0x5db8df,0xc9))['catch'](handleError(_0x5db8df,null));};exports['update']=function(_0x43efa4,_0x57e9c7){if(_0x43efa4['body']['id']){delete _0x43efa4['body']['id'];}return db[_0xd1db('0x2b')]['find']({'where':{'id':_0x43efa4[_0xd1db('0x44')]['id']}})[_0xd1db('0x25')](handleEntityNotFound(_0x57e9c7,null))[_0xd1db('0x25')](saveUpdates(_0x43efa4['body'],null))[_0xd1db('0x25')](respondWithResult(_0x57e9c7,null))[_0xd1db('0x43')](handleError(_0x57e9c7,null));};exports['destroy']=function(_0x43a288,_0x96d25d){return db[_0xd1db('0x2b')][_0xd1db('0x45')]({'where':{'id':_0x43a288[_0xd1db('0x44')]['id']}})[_0xd1db('0x25')](handleEntityNotFound(_0x96d25d,null))[_0xd1db('0x25')](removeEntity(_0x96d25d,null))[_0xd1db('0x43')](handleError(_0x96d25d,null));};exports[_0xd1db('0x48')]=function(_0x2db47a,_0x328e1b,_0x17b772){var _0x20b8c3={};var _0x35143a={};var _0x49af79;var _0x4ec630;return db['VtigerConfiguration'][_0xd1db('0x49')]({'where':{'id':_0x2db47a[_0xd1db('0x44')]['id']}})['then'](handleEntityNotFound(_0x328e1b,null))[_0xd1db('0x25')](function(_0x164e42){if(_0x164e42){_0x49af79=_0x164e42;_0x35143a['model']=_[_0xd1db('0x31')](db[_0xd1db('0x4a')][_0xd1db('0x2c')]);_0x35143a['query']=_[_0xd1db('0x31')](_0x2db47a[_0xd1db('0x30')]);_0x35143a[_0xd1db('0x38')]=_[_0xd1db('0x33')](_0x35143a[_0xd1db('0x35')],_0x35143a['query']);_0x20b8c3['attributes']=_[_0xd1db('0x33')](_0x35143a[_0xd1db('0x35')],qs[_0xd1db('0x34')](_0x2db47a[_0xd1db('0x30')]['fields']));_0x20b8c3[_0xd1db('0x32')]=_0x20b8c3[_0xd1db('0x32')]['length']?_0x20b8c3[_0xd1db('0x32')]:_0x35143a[_0xd1db('0x35')];_0x20b8c3[_0xd1db('0x36')]=qs['sort'](_0x2db47a[_0xd1db('0x30')][_0xd1db('0x37')]);_0x20b8c3[_0xd1db('0x3b')]=qs[_0xd1db('0x38')](_[_0xd1db('0x39')](_0x2db47a['query'],_0x35143a[_0xd1db('0x38')]));if(_0x2db47a[_0xd1db('0x30')]['filter']){_0x20b8c3[_0xd1db('0x3b')]=_[_0xd1db('0x3c')](_0x20b8c3[_0xd1db('0x3b')],{'$or':_[_0xd1db('0x2f')](_0x20b8c3[_0xd1db('0x32')],function(_0x69b161){var _0x132a46={};_0x132a46[_0x69b161]={'$like':'%'+_0x2db47a[_0xd1db('0x30')][_0xd1db('0x3a')]+'%'};return _0x132a46;})});}_0x20b8c3=_['merge']({},_0x20b8c3,_0x2db47a[_0xd1db('0x3e')]);return _0x49af79['getFields'](_0x20b8c3);}})[_0xd1db('0x25')](function(_0x117a65){if(_0x117a65){_0x4ec630=_0x117a65['length'];if(!_0x2db47a['query'][_0xd1db('0x4b')]('nolimit')){_0x20b8c3[_0xd1db('0x1e')]=qs['limit'](_0x2db47a[_0xd1db('0x30')][_0xd1db('0x1e')]);_0x20b8c3[_0xd1db('0x1d')]=qs[_0xd1db('0x1d')](_0x2db47a['query'][_0xd1db('0x1d')]);}return _0x49af79[_0xd1db('0x48')](_0x20b8c3);}})[_0xd1db('0x25')](function(_0x11447a){if(_0x11447a){return _0x11447a?{'count':_0x4ec630,'rows':_0x11447a}:null;}})['then'](respondWithResult(_0x328e1b,null))[_0xd1db('0x43')](handleError(_0x328e1b,null));};exports[_0xd1db('0x4c')]=function(_0x54d126,_0xee16bd,_0x511dbb){var _0x543ad3={};var _0x19634b={};var _0x49ce0d;var _0x246a86;return db[_0xd1db('0x2b')]['findOne']({'where':{'id':_0x54d126['params']['id']}})[_0xd1db('0x25')](handleEntityNotFound(_0xee16bd,null))[_0xd1db('0x25')](function(_0x10cb25){if(_0x10cb25){_0x49ce0d=_0x10cb25;_0x19634b['model']=_[_0xd1db('0x31')](db['VtigerField'][_0xd1db('0x2c')]);_0x19634b[_0xd1db('0x30')]=_[_0xd1db('0x31')](_0x54d126[_0xd1db('0x30')]);_0x19634b['filters']=_['intersection'](_0x19634b['model'],_0x19634b['query']);_0x543ad3[_0xd1db('0x32')]=_[_0xd1db('0x33')](_0x19634b[_0xd1db('0x35')],qs[_0xd1db('0x34')](_0x54d126['query'][_0xd1db('0x34')]));_0x543ad3[_0xd1db('0x32')]=_0x543ad3[_0xd1db('0x32')][_0xd1db('0x4d')]?_0x543ad3['attributes']:_0x19634b[_0xd1db('0x35')];_0x543ad3[_0xd1db('0x36')]=qs[_0xd1db('0x37')](_0x54d126[_0xd1db('0x30')][_0xd1db('0x37')]);_0x543ad3[_0xd1db('0x3b')]=qs['filters'](_[_0xd1db('0x39')](_0x54d126['query'],_0x19634b[_0xd1db('0x38')]));if(_0x54d126['query'][_0xd1db('0x3a')]){_0x543ad3[_0xd1db('0x3b')]=_[_0xd1db('0x3c')](_0x543ad3[_0xd1db('0x3b')],{'$or':_[_0xd1db('0x2f')](_0x543ad3[_0xd1db('0x32')],function(_0x3d1180){var _0x3d9989={};_0x3d9989[_0x3d1180]={'$like':'%'+_0x54d126['query'][_0xd1db('0x3a')]+'%'};return _0x3d9989;})});}_0x543ad3=_[_0xd1db('0x3c')]({},_0x543ad3,_0x54d126[_0xd1db('0x3e')]);return _0x49ce0d[_0xd1db('0x4c')](_0x543ad3);}})['then'](function(_0x53e290){if(_0x53e290){_0x246a86=_0x53e290[_0xd1db('0x4d')];if(!_0x54d126['query'][_0xd1db('0x4b')]('nolimit')){_0x543ad3[_0xd1db('0x1e')]=qs['limit'](_0x54d126[_0xd1db('0x30')][_0xd1db('0x1e')]);_0x543ad3[_0xd1db('0x1d')]=qs[_0xd1db('0x1d')](_0x54d126[_0xd1db('0x30')][_0xd1db('0x1d')]);}return _0x49ce0d[_0xd1db('0x4c')](_0x543ad3);}})[_0xd1db('0x25')](function(_0x166808){if(_0x166808){return _0x166808?{'count':_0x246a86,'rows':_0x166808}:null;}})['then'](respondWithResult(_0xee16bd,null))[_0xd1db('0x43')](handleError(_0xee16bd,null));};exports[_0xd1db('0x4e')]=function(_0x4e1561,_0x58ecf5,_0x455538){var _0x5c85d7={};var _0x85fa89={};var _0x277cd8;var _0x34b0bc;return db[_0xd1db('0x2b')][_0xd1db('0x49')]({'where':{'id':_0x4e1561[_0xd1db('0x44')]['id']}})['then'](handleEntityNotFound(_0x58ecf5,null))[_0xd1db('0x25')](function(_0x32df30){if(_0x32df30){_0x277cd8=_0x32df30;_0x85fa89[_0xd1db('0x35')]=_[_0xd1db('0x31')](db[_0xd1db('0x4a')][_0xd1db('0x2c')]);_0x85fa89[_0xd1db('0x30')]=_[_0xd1db('0x31')](_0x4e1561[_0xd1db('0x30')]);_0x85fa89[_0xd1db('0x38')]=_[_0xd1db('0x33')](_0x85fa89[_0xd1db('0x35')],_0x85fa89[_0xd1db('0x30')]);_0x5c85d7['attributes']=_[_0xd1db('0x33')](_0x85fa89['model'],qs[_0xd1db('0x34')](_0x4e1561[_0xd1db('0x30')][_0xd1db('0x34')]));_0x5c85d7[_0xd1db('0x32')]=_0x5c85d7['attributes'][_0xd1db('0x4d')]?_0x5c85d7[_0xd1db('0x32')]:_0x85fa89[_0xd1db('0x35')];_0x5c85d7[_0xd1db('0x36')]=qs[_0xd1db('0x37')](_0x4e1561['query'][_0xd1db('0x37')]);_0x5c85d7[_0xd1db('0x3b')]=qs[_0xd1db('0x38')](_[_0xd1db('0x39')](_0x4e1561[_0xd1db('0x30')],_0x85fa89[_0xd1db('0x38')]));if(_0x4e1561[_0xd1db('0x30')][_0xd1db('0x3a')]){_0x5c85d7[_0xd1db('0x3b')]=_[_0xd1db('0x3c')](_0x5c85d7[_0xd1db('0x3b')],{'$or':_[_0xd1db('0x2f')](_0x5c85d7[_0xd1db('0x32')],function(_0x1c45ca){var _0x2cae9c={};_0x2cae9c[_0x1c45ca]={'$like':'%'+_0x4e1561['query'][_0xd1db('0x3a')]+'%'};return _0x2cae9c;})});}_0x5c85d7=_[_0xd1db('0x3c')]({},_0x5c85d7,_0x4e1561[_0xd1db('0x3e')]);return _0x277cd8[_0xd1db('0x4e')](_0x5c85d7);}})[_0xd1db('0x25')](function(_0x2d6b55){if(_0x2d6b55){_0x34b0bc=_0x2d6b55['length'];if(!_0x4e1561[_0xd1db('0x30')]['hasOwnProperty'](_0xd1db('0x4f'))){_0x5c85d7[_0xd1db('0x1e')]=qs[_0xd1db('0x1e')](_0x4e1561['query'][_0xd1db('0x1e')]);_0x5c85d7['offset']=qs[_0xd1db('0x1d')](_0x4e1561[_0xd1db('0x30')][_0xd1db('0x1d')]);}return _0x277cd8[_0xd1db('0x4e')](_0x5c85d7);}})[_0xd1db('0x25')](function(_0x1f8268){if(_0x1f8268){return _0x1f8268?{'count':_0x34b0bc,'rows':_0x1f8268}:null;}})[_0xd1db('0x25')](respondWithResult(_0x58ecf5,null))['catch'](handleError(_0x58ecf5,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index ad93d61..ee96ec7 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 _0x6423=['bluebird','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','util','../../config/logger'];(function(_0x421496,_0x17d147){var _0x175280=function(_0x195250){while(--_0x195250){_0x421496['push'](_0x421496['shift']());}};_0x175280(++_0x17d147);}(_0x6423,0x1d4));var _0x3642=function(_0x3edee9,_0x54405f){_0x3edee9=_0x3edee9-0x0;var _0x6a7808=_0x6423[_0x3edee9];return _0x6a7808;};'use strict';var _=require('lodash');var util=require(_0x3642('0x0'));var logger=require(_0x3642('0x1'))('api');var moment=require('moment');var BPromise=require(_0x3642('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3642('0x3'));var config=require(_0x3642('0x4'));var attributes=require(_0x3642('0x5'));module[_0x3642('0x6')]=function(_0x5ac402,_0x20e990){return _0x5ac402[_0x3642('0x7')](_0x3642('0x8'),attributes,{'tableName':_0x3642('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3a56=['lodash','../../config/logger','api','request-promise','rimraf','./intVtigerConfiguration.attributes','define','int_vtiger_configurations'];(function(_0x46a671,_0x758e9a){var _0x526d75=function(_0xde3640){while(--_0xde3640){_0x46a671['push'](_0x46a671['shift']());}};_0x526d75(++_0x758e9a);}(_0x3a56,0x90));var _0x63a5=function(_0x21c6b8,_0x16d6f6){_0x21c6b8=_0x21c6b8-0x0;var _0x39d474=_0x3a56[_0x21c6b8];return _0x39d474;};'use strict';var _=require(_0x63a5('0x0'));var util=require('util');var logger=require(_0x63a5('0x1'))(_0x63a5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x63a5('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x63a5('0x4'));var config=require('../../config/environment');var attributes=require(_0x63a5('0x5'));module['exports']=function(_0x3d3498,_0xeebeeb){return _0x3d3498[_0x63a5('0x6')]('VtigerConfiguration',attributes,{'tableName':_0x63a5('0x7'),'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 df79e99..a5e54a6 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 _0xd06b=['rpc','../../config/environment','client','request','then','info','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','VtigerConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger'];(function(_0x3f6164,_0xa85996){var _0x33a14c=function(_0x5cd4d4){while(--_0x5cd4d4){_0x3f6164['push'](_0x3f6164['shift']());}};_0x33a14c(++_0xa85996);}(_0xd06b,0x14a));var _0xbd06=function(_0x30e50e,_0xd0aaae){_0x30e50e=_0x30e50e-0x0;var _0x253ae6=_0xd06b[_0x30e50e];return _0x253ae6;};'use strict';var _=require(_0xbd06('0x0'));var util=require(_0xbd06('0x1'));var moment=require(_0xbd06('0x2'));var BPromise=require(_0xbd06('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbd06('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbd06('0x5'))(_0xbd06('0x6'));var config=require(_0xbd06('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xbd06('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x42c9eb,_0x4ec6e0,_0x57c03b){return new BPromise(function(_0xcc75db,_0xc86b32){return client[_0xbd06('0x9')](_0x42c9eb,_0x57c03b)[_0xbd06('0xa')](function(_0x57bd55){logger[_0xbd06('0xb')]('VtigerConfiguration,\x20%s,\x20%s',_0x4ec6e0,'request\x20sent');logger[_0xbd06('0xc')](_0xbd06('0xd'),_0x4ec6e0,_0xbd06('0xe'),JSON['stringify'](_0x57bd55));if(_0x57bd55[_0xbd06('0xf')]){if(_0x57bd55[_0xbd06('0xf')][_0xbd06('0x10')]===0x1f4){logger[_0xbd06('0xf')](_0xbd06('0x11'),_0x4ec6e0,_0x57bd55['error'][_0xbd06('0x12')]);return _0xc86b32(_0x57bd55[_0xbd06('0xf')][_0xbd06('0x12')]);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x4ec6e0,_0x57bd55[_0xbd06('0xf')][_0xbd06('0x12')]);return _0xcc75db(_0x57bd55[_0xbd06('0xf')]['message']);}else{logger[_0xbd06('0xb')](_0xbd06('0x11'),_0x4ec6e0,_0xbd06('0xe'));_0xcc75db(_0x57bd55[_0xbd06('0x13')]['message']);}})[_0xbd06('0x14')](function(_0x19ec0b){logger[_0xbd06('0xf')](_0xbd06('0x11'),_0x4ec6e0,_0x19ec0b);_0xc86b32(_0x19ec0b);});});} \ No newline at end of file +var _0x7fcd=['result','catch','lodash','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','http','then','info','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','VtigerConfiguration,\x20%s,\x20%s','message','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7fcd,0x17e));var _0xd7fc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7fcd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd7fc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd7fc('0x1'));var rs=require(_0xd7fc('0x2'));var fs=require('fs');var Redis=require(_0xd7fc('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd7fc('0x4'));var config=require(_0xd7fc('0x5'));var jayson=require(_0xd7fc('0x6'));var client=jayson['client'][_0xd7fc('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3c56ca,_0x198d11,_0x2a5984){return new BPromise(function(_0x1cb36e,_0x53ebca){return client['request'](_0x3c56ca,_0x2a5984)[_0xd7fc('0x8')](function(_0x4af13d){logger[_0xd7fc('0x9')]('VtigerConfiguration,\x20%s,\x20%s',_0x198d11,'request\x20sent');logger[_0xd7fc('0xa')](_0xd7fc('0xb'),_0x198d11,'request\x20sent',JSON['stringify'](_0x4af13d));if(_0x4af13d[_0xd7fc('0xc')]){if(_0x4af13d['error'][_0xd7fc('0xd')]===0x1f4){logger[_0xd7fc('0xc')](_0xd7fc('0xe'),_0x198d11,_0x4af13d['error']['message']);return _0x53ebca(_0x4af13d[_0xd7fc('0xc')][_0xd7fc('0xf')]);}logger[_0xd7fc('0xc')]('VtigerConfiguration,\x20%s,\x20%s',_0x198d11,_0x4af13d[_0xd7fc('0xc')]['message']);return _0x1cb36e(_0x4af13d['error']['message']);}else{logger[_0xd7fc('0x9')]('VtigerConfiguration,\x20%s,\x20%s',_0x198d11,_0xd7fc('0x10'));_0x1cb36e(_0x4af13d[_0xd7fc('0x11')]['message']);}})[_0xd7fc('0x12')](function(_0x22664e){logger[_0xd7fc('0xc')](_0xd7fc('0xe'),_0x198d11,_0x22664e);_0x53ebca(_0x22664e);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index d9d3daa..0b93405 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 _0x0e7b=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','/:id','show','post','create','put','delete','destroy','exports'];(function(_0x180b9a,_0x5747cf){var _0x26588c=function(_0x590edc){while(--_0x590edc){_0x180b9a['push'](_0x180b9a['shift']());}};_0x26588c(++_0x5747cf);}(_0x0e7b,0x1a4));var _0xb0e7=function(_0x5dd800,_0x299c29){_0x5dd800=_0x5dd800-0x0;var _0x5c34e0=_0x0e7b[_0x5dd800];return _0x5c34e0;};'use strict';var multer=require(_0xb0e7('0x0'));var util=require(_0xb0e7('0x1'));var path=require(_0xb0e7('0x2'));var timeout=require(_0xb0e7('0x3'));var express=require(_0xb0e7('0x4'));var router=express[_0xb0e7('0x5')]();var fs_extra=require(_0xb0e7('0x6'));var auth=require(_0xb0e7('0x7'));var interaction=require(_0xb0e7('0x8'));var config=require(_0xb0e7('0x9'));var controller=require(_0xb0e7('0xa'));router[_0xb0e7('0xb')]('/',auth[_0xb0e7('0xc')](),controller['index']);router['get'](_0xb0e7('0xd'),auth['isAuthenticated'](),controller[_0xb0e7('0xe')]);router[_0xb0e7('0xf')]('/',auth[_0xb0e7('0xc')](),controller[_0xb0e7('0x10')]);router[_0xb0e7('0x11')](_0xb0e7('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xb0e7('0x12')](_0xb0e7('0xd'),auth[_0xb0e7('0xc')](),controller[_0xb0e7('0x13')]);module[_0xb0e7('0x14')]=router; \ No newline at end of file +var _0x2b0a=['post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x417558,_0x5475ce){var _0x1d74df=function(_0x555b54){while(--_0x555b54){_0x417558['push'](_0x417558['shift']());}};_0x1d74df(++_0x5475ce);}(_0x2b0a,0xb1));var _0xa2b0=function(_0x360ca2,_0x42aec7){_0x360ca2=_0x360ca2-0x0;var _0x4b18e3=_0x2b0a[_0x360ca2];return _0x4b18e3;};'use strict';var multer=require(_0xa2b0('0x0'));var util=require(_0xa2b0('0x1'));var path=require(_0xa2b0('0x2'));var timeout=require(_0xa2b0('0x3'));var express=require(_0xa2b0('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa2b0('0x5'));var interaction=require(_0xa2b0('0x6'));var config=require(_0xa2b0('0x7'));var controller=require('./intVtigerField.controller');router[_0xa2b0('0x8')]('/',auth[_0xa2b0('0x9')](),controller[_0xa2b0('0xa')]);router[_0xa2b0('0x8')](_0xa2b0('0xb'),auth[_0xa2b0('0x9')](),controller[_0xa2b0('0xc')]);router[_0xa2b0('0xd')]('/',auth[_0xa2b0('0x9')](),controller[_0xa2b0('0xe')]);router['put'](_0xa2b0('0xb'),auth[_0xa2b0('0x9')](),controller[_0xa2b0('0xf')]);router[_0xa2b0('0x10')](_0xa2b0('0xb'),auth[_0xa2b0('0x9')](),controller[_0xa2b0('0x11')]);module[_0xa2b0('0x12')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index d30ea77..f983441 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 _0x0f95=['string','STRING','variable','BOOLEAN','sequelize','exports','ENUM','customVariable','picklist'];(function(_0x334eeb,_0x251035){var _0x1c2240=function(_0x7d3a99){while(--_0x7d3a99){_0x334eeb['push'](_0x334eeb['shift']());}};_0x1c2240(++_0x251035);}(_0x0f95,0x67));var _0x50f9=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x0f95[_0x45bf86];return _0x1f02b7;};'use strict';var Sequelize=require(_0x50f9('0x0'));module[_0x50f9('0x1')]={'type':{'type':Sequelize[_0x50f9('0x2')]('string','variable',_0x50f9('0x3'),'keyValue',_0x50f9('0x4')),'defaultValue':_0x50f9('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x50f9('0x6')]},'keyType':{'type':Sequelize[_0x50f9('0x2')]('string',_0x50f9('0x7'),_0x50f9('0x3'))},'keyContent':{'type':Sequelize[_0x50f9('0x6')]},'idField':{'type':Sequelize[_0x50f9('0x6')]},'nameField':{'type':Sequelize[_0x50f9('0x6')]},'customField':{'type':Sequelize[_0x50f9('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x50f9('0x6')]}}; \ No newline at end of file +var _0x03f9=['ENUM','string','customVariable','STRING','variable','BOOLEAN','sequelize'];(function(_0x52e7ee,_0x34a838){var _0x2520b3=function(_0x26b4c5){while(--_0x26b4c5){_0x52e7ee['push'](_0x52e7ee['shift']());}};_0x2520b3(++_0x34a838);}(_0x03f9,0x1b8));var _0x903f=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x03f9[_0x3054be];return _0x3df150;};'use strict';var Sequelize=require(_0x903f('0x0'));module['exports']={'type':{'type':Sequelize[_0x903f('0x1')](_0x903f('0x2'),'variable',_0x903f('0x3'),'keyValue','picklist'),'defaultValue':_0x903f('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x903f('0x4')]},'keyType':{'type':Sequelize[_0x903f('0x1')]('string',_0x903f('0x5'),_0x903f('0x3'))},'keyContent':{'type':Sequelize[_0x903f('0x4')]},'idField':{'type':Sequelize[_0x903f('0x4')]},'nameField':{'type':Sequelize[_0x903f('0x4')]},'customField':{'type':Sequelize[_0x903f('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x903f('0x4')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 3f79675..9e4faf3 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 _0xe210=['request-promise','mustache','util','path','to-csv','ejs','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','reject','save','update','then','destroy','error','stack','name','map','VtigerField','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','options','count','includeAll','include','rows','catch','rawAttributes','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x13137e,_0x29c0f3){var _0x346261=function(_0x8c7d4f){while(--_0x8c7d4f){_0x13137e['push'](_0x13137e['shift']());}};_0x346261(++_0x29c0f3);}(_0xe210,0x17c));var _0x0e21=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0xe210[_0x2f1762];return _0x8ab21;};'use strict';var emlformat=require(_0x0e21('0x0'));var rimraf=require(_0x0e21('0x1'));var zipdir=require(_0x0e21('0x2'));var jsonpatch=require(_0x0e21('0x3'));var rp=require(_0x0e21('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0e21('0x5'));var util=require(_0x0e21('0x6'));var path=require(_0x0e21('0x7'));var sox=require('sox');var csv=require(_0x0e21('0x8'));var ejs=require(_0x0e21('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0e21('0xa'));var squel=require(_0x0e21('0xb'));var crypto=require(_0x0e21('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0e21('0x8'));var querystring=require(_0x0e21('0xd'));var Papa=require('papaparse');var Redis=require(_0x0e21('0xe'));var authService=require(_0x0e21('0xf'));var qs=require(_0x0e21('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0e21('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0e21('0x12'));var db=require(_0x0e21('0x13'))['db'];function respondWithStatusCode(_0x33563f,_0x3ba19b){_0x3ba19b=_0x3ba19b||0xcc;return function(_0x3b1e88){if(_0x3b1e88){return _0x33563f[_0x0e21('0x14')](_0x3ba19b);}return _0x33563f['status'](_0x3ba19b)[_0x0e21('0x15')]();};}function respondWithResult(_0x19fbd2,_0x30a134){_0x30a134=_0x30a134||0xc8;return function(_0x15bfc1){if(_0x15bfc1){return _0x19fbd2[_0x0e21('0x16')](_0x30a134)[_0x0e21('0x17')](_0x15bfc1);}};}function respondWithFilteredResult(_0x13e5f1,_0x2c1ff6){return function(_0x375324){if(_0x375324){var _0x3d40bf=typeof _0x2c1ff6['offset']===_0x0e21('0x18')&&typeof _0x2c1ff6[_0x0e21('0x19')]===_0x0e21('0x18');var _0x34bc84=_0x375324['count'];var _0x5d6c1d=_0x3d40bf?0x0:_0x2c1ff6[_0x0e21('0x1a')];var _0x3b7f7d=_0x3d40bf?_0x375324['count']:_0x2c1ff6['offset']+_0x2c1ff6[_0x0e21('0x19')];var _0x1d8529;if(_0x3b7f7d>=_0x34bc84){_0x3b7f7d=_0x34bc84;_0x1d8529=0xc8;}else{_0x1d8529=0xce;}_0x13e5f1[_0x0e21('0x16')](_0x1d8529);return _0x13e5f1['set']('Content-Range',_0x5d6c1d+'-'+_0x3b7f7d+'/'+_0x34bc84)[_0x0e21('0x17')](_0x375324);}return null;};}function patchUpdates(_0x1e987a){return function(_0x52acff){try{jsonpatch['apply'](_0x52acff,_0x1e987a,!![]);}catch(_0x51079f){return BPromise[_0x0e21('0x1b')](_0x51079f);}return _0x52acff[_0x0e21('0x1c')]();};}function saveUpdates(_0x4bea9f,_0x5bde23){return function(_0x27f811){if(_0x27f811){return _0x27f811[_0x0e21('0x1d')](_0x4bea9f)[_0x0e21('0x1e')](function(_0xa98a54){return _0xa98a54;});}return null;};}function removeEntity(_0x369892,_0x2dd9de){return function(_0x338a50){if(_0x338a50){return _0x338a50[_0x0e21('0x1f')]()[_0x0e21('0x1e')](function(){_0x369892[_0x0e21('0x16')](0xcc)[_0x0e21('0x15')]();});}};}function handleEntityNotFound(_0x38b78a,_0x42b3c0){return function(_0x363262){if(!_0x363262){_0x38b78a['sendStatus'](0x194);}return _0x363262;};}function handleError(_0x5b4184,_0x438fb8){_0x438fb8=_0x438fb8||0x1f4;return function(_0x3c5634){logger[_0x0e21('0x20')](_0x3c5634[_0x0e21('0x21')]);if(_0x3c5634[_0x0e21('0x22')]){delete _0x3c5634[_0x0e21('0x22')];}_0x5b4184[_0x0e21('0x16')](_0x438fb8)['send'](_0x3c5634);};}exports['index']=function(_0x407e8f,_0x4e10e5){var _0x4c4456={},_0x11ef61={},_0xabb218={'count':0x0,'rows':[]};var _0x1abab1=_[_0x0e21('0x23')](db[_0x0e21('0x24')]['rawAttributes'],function(_0x54c00b){return{'name':_0x54c00b[_0x0e21('0x25')],'type':_0x54c00b[_0x0e21('0x26')]['key']};});_0x11ef61[_0x0e21('0x27')]=_[_0x0e21('0x23')](_0x1abab1,_0x0e21('0x22'));_0x11ef61[_0x0e21('0x28')]=_[_0x0e21('0x29')](_0x407e8f[_0x0e21('0x28')]);_0x11ef61[_0x0e21('0x2a')]=_[_0x0e21('0x2b')](_0x11ef61[_0x0e21('0x27')],_0x11ef61[_0x0e21('0x28')]);_0x4c4456[_0x0e21('0x2c')]=_[_0x0e21('0x2b')](_0x11ef61[_0x0e21('0x27')],qs['fields'](_0x407e8f[_0x0e21('0x28')][_0x0e21('0x2d')]));_0x4c4456[_0x0e21('0x2c')]=_0x4c4456[_0x0e21('0x2c')][_0x0e21('0x2e')]?_0x4c4456['attributes']:_0x11ef61['model'];if(!_0x407e8f[_0x0e21('0x28')][_0x0e21('0x2f')]('nolimit')){_0x4c4456[_0x0e21('0x19')]=qs[_0x0e21('0x19')](_0x407e8f[_0x0e21('0x28')]['limit']);_0x4c4456[_0x0e21('0x1a')]=qs['offset'](_0x407e8f[_0x0e21('0x28')][_0x0e21('0x1a')]);}_0x4c4456['order']=qs['sort'](_0x407e8f[_0x0e21('0x28')][_0x0e21('0x30')]);_0x4c4456['where']=qs[_0x0e21('0x2a')](_[_0x0e21('0x31')](_0x407e8f[_0x0e21('0x28')],_0x11ef61['filters']),_0x1abab1);if(_0x407e8f['query'][_0x0e21('0x32')]){_0x4c4456[_0x0e21('0x33')]=_[_0x0e21('0x34')](_0x4c4456[_0x0e21('0x33')],{'$or':_['map'](_0x1abab1,function(_0x434fe7){if(_0x434fe7[_0x0e21('0x26')]!=='VIRTUAL'){var _0x59956f={};_0x59956f[_0x434fe7[_0x0e21('0x22')]]={'$like':'%'+_0x407e8f[_0x0e21('0x28')][_0x0e21('0x32')]+'%'};return _0x59956f;}})});}_0x4c4456=_[_0x0e21('0x34')]({},_0x4c4456,_0x407e8f[_0x0e21('0x35')]);var _0x4969d4={'where':_0x4c4456[_0x0e21('0x33')]};return db[_0x0e21('0x24')][_0x0e21('0x36')](_0x4969d4)['then'](function(_0x5882c0){_0xabb218['count']=_0x5882c0;if(_0x407e8f['query'][_0x0e21('0x37')]){_0x4c4456[_0x0e21('0x38')]=[{'all':!![]}];}return db['VtigerField']['findAll'](_0x4c4456);})['then'](function(_0x27f600){_0xabb218[_0x0e21('0x39')]=_0x27f600;return _0xabb218;})[_0x0e21('0x1e')](respondWithFilteredResult(_0x4e10e5,_0x4c4456))[_0x0e21('0x3a')](handleError(_0x4e10e5,null));};exports['show']=function(_0x9da34b,_0x2fbe6b){var _0x227b32={'raw':!![],'where':{'id':_0x9da34b['params']['id']}},_0x4c22aa={};_0x4c22aa['model']=_[_0x0e21('0x29')](db['VtigerField'][_0x0e21('0x3b')]);_0x4c22aa[_0x0e21('0x28')]=_[_0x0e21('0x29')](_0x9da34b[_0x0e21('0x28')]);_0x4c22aa[_0x0e21('0x2a')]=_[_0x0e21('0x2b')](_0x4c22aa[_0x0e21('0x27')],_0x4c22aa[_0x0e21('0x28')]);_0x227b32[_0x0e21('0x2c')]=_[_0x0e21('0x2b')](_0x4c22aa['model'],qs[_0x0e21('0x2d')](_0x9da34b[_0x0e21('0x28')][_0x0e21('0x2d')]));_0x227b32[_0x0e21('0x2c')]=_0x227b32[_0x0e21('0x2c')][_0x0e21('0x2e')]?_0x227b32['attributes']:_0x4c22aa[_0x0e21('0x27')];if(_0x9da34b[_0x0e21('0x28')][_0x0e21('0x37')]){_0x227b32['include']=[{'all':!![]}];}_0x227b32=_[_0x0e21('0x34')]({},_0x227b32,_0x9da34b[_0x0e21('0x35')]);return db[_0x0e21('0x24')][_0x0e21('0x3c')](_0x227b32)[_0x0e21('0x1e')](handleEntityNotFound(_0x2fbe6b,null))[_0x0e21('0x1e')](respondWithResult(_0x2fbe6b,null))[_0x0e21('0x3a')](handleError(_0x2fbe6b,null));};exports['create']=function(_0x574fa4,_0x5b2b3f){return db['VtigerField'][_0x0e21('0x3d')](_0x574fa4[_0x0e21('0x3e')],{})[_0x0e21('0x1e')](respondWithResult(_0x5b2b3f,0xc9))[_0x0e21('0x3a')](handleError(_0x5b2b3f,null));};exports[_0x0e21('0x1d')]=function(_0x4174ee,_0x3a136d){if(_0x4174ee['body']['id']){delete _0x4174ee[_0x0e21('0x3e')]['id'];}return db[_0x0e21('0x24')][_0x0e21('0x3c')]({'where':{'id':_0x4174ee[_0x0e21('0x3f')]['id']}})[_0x0e21('0x1e')](handleEntityNotFound(_0x3a136d,null))['then'](saveUpdates(_0x4174ee[_0x0e21('0x3e')],null))[_0x0e21('0x1e')](respondWithResult(_0x3a136d,null))[_0x0e21('0x3a')](handleError(_0x3a136d,null));};exports[_0x0e21('0x1f')]=function(_0x1907a2,_0x5ad554){return db[_0x0e21('0x24')][_0x0e21('0x3c')]({'where':{'id':_0x1907a2[_0x0e21('0x3f')]['id']}})[_0x0e21('0x1e')](handleEntityNotFound(_0x5ad554,null))[_0x0e21('0x1e')](removeEntity(_0x5ad554,null))[_0x0e21('0x3a')](handleError(_0x5ad554,null));}; \ No newline at end of file +var _0x5ab2=['hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','options','count','include','findAll','rows','show','params','keys','length','includeAll','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','undefined','offset','set','apply','reject','save','update','destroy','then','end','error','stack','name','send','VtigerField','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes'];(function(_0x115805,_0x2c5271){var _0x4ece77=function(_0x29e3c7){while(--_0x29e3c7){_0x115805['push'](_0x115805['shift']());}};_0x4ece77(++_0x2c5271);}(_0x5ab2,0x146));var _0x25ab=function(_0x1e8740,_0x4e0c8e){_0x1e8740=_0x1e8740-0x0;var _0x57d2a9=_0x5ab2[_0x1e8740];return _0x57d2a9;};'use strict';var emlformat=require(_0x25ab('0x0'));var rimraf=require(_0x25ab('0x1'));var zipdir=require(_0x25ab('0x2'));var jsonpatch=require(_0x25ab('0x3'));var rp=require(_0x25ab('0x4'));var moment=require(_0x25ab('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x25ab('0x6'));var util=require(_0x25ab('0x7'));var path=require(_0x25ab('0x8'));var sox=require('sox');var csv=require(_0x25ab('0x9'));var ejs=require(_0x25ab('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x25ab('0xb'));var squel=require(_0x25ab('0xc'));var crypto=require(_0x25ab('0xd'));var jsforce=require(_0x25ab('0xe'));var deskjs=require(_0x25ab('0xf'));var toCsv=require(_0x25ab('0x9'));var querystring=require(_0x25ab('0x10'));var Papa=require(_0x25ab('0x11'));var Redis=require(_0x25ab('0x12'));var authService=require(_0x25ab('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x25ab('0x14'));var hardwareService=require(_0x25ab('0x15'));var logger=require(_0x25ab('0x16'))(_0x25ab('0x17'));var utils=require(_0x25ab('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2eaa61,_0x44e49d){_0x44e49d=_0x44e49d||0xcc;return function(_0x39bdae){if(_0x39bdae){return _0x2eaa61[_0x25ab('0x19')](_0x44e49d);}return _0x2eaa61[_0x25ab('0x1a')](_0x44e49d)['end']();};}function respondWithResult(_0x4acc9b,_0xa16ee7){_0xa16ee7=_0xa16ee7||0xc8;return function(_0x10a3bf){if(_0x10a3bf){return _0x4acc9b[_0x25ab('0x1a')](_0xa16ee7)[_0x25ab('0x1b')](_0x10a3bf);}};}function respondWithFilteredResult(_0x2823d1,_0x453329){return function(_0x1ba219){if(_0x1ba219){var _0x99df94=typeof _0x453329['offset']===_0x25ab('0x1c')&&typeof _0x453329['limit']===_0x25ab('0x1c');var _0x12780d=_0x1ba219['count'];var _0x3a96d1=_0x99df94?0x0:_0x453329[_0x25ab('0x1d')];var _0x18ffd9=_0x99df94?_0x1ba219['count']:_0x453329[_0x25ab('0x1d')]+_0x453329['limit'];var _0x1b23fe;if(_0x18ffd9>=_0x12780d){_0x18ffd9=_0x12780d;_0x1b23fe=0xc8;}else{_0x1b23fe=0xce;}_0x2823d1[_0x25ab('0x1a')](_0x1b23fe);return _0x2823d1[_0x25ab('0x1e')]('Content-Range',_0x3a96d1+'-'+_0x18ffd9+'/'+_0x12780d)[_0x25ab('0x1b')](_0x1ba219);}return null;};}function patchUpdates(_0x5e5e4e){return function(_0x36ac33){try{jsonpatch[_0x25ab('0x1f')](_0x36ac33,_0x5e5e4e,!![]);}catch(_0x1f5e8f){return BPromise[_0x25ab('0x20')](_0x1f5e8f);}return _0x36ac33[_0x25ab('0x21')]();};}function saveUpdates(_0x109762,_0x153d3a){return function(_0x12913f){if(_0x12913f){return _0x12913f[_0x25ab('0x22')](_0x109762)['then'](function(_0xcd0b59){return _0xcd0b59;});}return null;};}function removeEntity(_0x1d1bf6,_0x53f413){return function(_0x207934){if(_0x207934){return _0x207934[_0x25ab('0x23')]()[_0x25ab('0x24')](function(){_0x1d1bf6['status'](0xcc)[_0x25ab('0x25')]();});}};}function handleEntityNotFound(_0xe7250b,_0x1aea54){return function(_0x597acb){if(!_0x597acb){_0xe7250b[_0x25ab('0x19')](0x194);}return _0x597acb;};}function handleError(_0x125fe0,_0x3769c7){_0x3769c7=_0x3769c7||0x1f4;return function(_0x2426f8){logger[_0x25ab('0x26')](_0x2426f8[_0x25ab('0x27')]);if(_0x2426f8[_0x25ab('0x28')]){delete _0x2426f8['name'];}_0x125fe0[_0x25ab('0x1a')](_0x3769c7)[_0x25ab('0x29')](_0x2426f8);};}exports['index']=function(_0x459a13,_0x11455b){var _0x4ef5c3={},_0x3c8b2c={},_0x2a7992={'count':0x0,'rows':[]};var _0x40df31=_['map'](db[_0x25ab('0x2a')][_0x25ab('0x2b')],function(_0x3503ab){return{'name':_0x3503ab[_0x25ab('0x2c')],'type':_0x3503ab[_0x25ab('0x2d')][_0x25ab('0x2e')]};});_0x3c8b2c[_0x25ab('0x2f')]=_[_0x25ab('0x30')](_0x40df31,'name');_0x3c8b2c[_0x25ab('0x31')]=_['keys'](_0x459a13[_0x25ab('0x31')]);_0x3c8b2c[_0x25ab('0x32')]=_[_0x25ab('0x33')](_0x3c8b2c[_0x25ab('0x2f')],_0x3c8b2c[_0x25ab('0x31')]);_0x4ef5c3['attributes']=_['intersection'](_0x3c8b2c[_0x25ab('0x2f')],qs[_0x25ab('0x34')](_0x459a13[_0x25ab('0x31')]['fields']));_0x4ef5c3[_0x25ab('0x35')]=_0x4ef5c3[_0x25ab('0x35')]['length']?_0x4ef5c3[_0x25ab('0x35')]:_0x3c8b2c['model'];if(!_0x459a13[_0x25ab('0x31')][_0x25ab('0x36')](_0x25ab('0x37'))){_0x4ef5c3['limit']=qs[_0x25ab('0x38')](_0x459a13[_0x25ab('0x31')][_0x25ab('0x38')]);_0x4ef5c3[_0x25ab('0x1d')]=qs[_0x25ab('0x1d')](_0x459a13['query'][_0x25ab('0x1d')]);}_0x4ef5c3[_0x25ab('0x39')]=qs['sort'](_0x459a13[_0x25ab('0x31')][_0x25ab('0x3a')]);_0x4ef5c3[_0x25ab('0x3b')]=qs[_0x25ab('0x32')](_['pick'](_0x459a13['query'],_0x3c8b2c['filters']),_0x40df31);if(_0x459a13['query'][_0x25ab('0x3c')]){_0x4ef5c3[_0x25ab('0x3b')]=_[_0x25ab('0x3d')](_0x4ef5c3[_0x25ab('0x3b')],{'$or':_[_0x25ab('0x30')](_0x40df31,function(_0x4e404c){if(_0x4e404c[_0x25ab('0x2d')]!=='VIRTUAL'){var _0x50a6f9={};_0x50a6f9[_0x4e404c['name']]={'$like':'%'+_0x459a13[_0x25ab('0x31')][_0x25ab('0x3c')]+'%'};return _0x50a6f9;}})});}_0x4ef5c3=_['merge']({},_0x4ef5c3,_0x459a13[_0x25ab('0x3e')]);var _0xb2b483={'where':_0x4ef5c3[_0x25ab('0x3b')]};return db[_0x25ab('0x2a')][_0x25ab('0x3f')](_0xb2b483)[_0x25ab('0x24')](function(_0x29c05e){_0x2a7992[_0x25ab('0x3f')]=_0x29c05e;if(_0x459a13[_0x25ab('0x31')]['includeAll']){_0x4ef5c3[_0x25ab('0x40')]=[{'all':!![]}];}return db[_0x25ab('0x2a')][_0x25ab('0x41')](_0x4ef5c3);})[_0x25ab('0x24')](function(_0x417fcd){_0x2a7992[_0x25ab('0x42')]=_0x417fcd;return _0x2a7992;})[_0x25ab('0x24')](respondWithFilteredResult(_0x11455b,_0x4ef5c3))['catch'](handleError(_0x11455b,null));};exports[_0x25ab('0x43')]=function(_0x44aba7,_0x3c38b8){var _0x4f874d={'raw':!![],'where':{'id':_0x44aba7[_0x25ab('0x44')]['id']}},_0x16cde7={};_0x16cde7[_0x25ab('0x2f')]=_[_0x25ab('0x45')](db['VtigerField'][_0x25ab('0x2b')]);_0x16cde7[_0x25ab('0x31')]=_[_0x25ab('0x45')](_0x44aba7[_0x25ab('0x31')]);_0x16cde7['filters']=_[_0x25ab('0x33')](_0x16cde7[_0x25ab('0x2f')],_0x16cde7[_0x25ab('0x31')]);_0x4f874d[_0x25ab('0x35')]=_[_0x25ab('0x33')](_0x16cde7[_0x25ab('0x2f')],qs[_0x25ab('0x34')](_0x44aba7['query'][_0x25ab('0x34')]));_0x4f874d['attributes']=_0x4f874d['attributes'][_0x25ab('0x46')]?_0x4f874d['attributes']:_0x16cde7[_0x25ab('0x2f')];if(_0x44aba7[_0x25ab('0x31')][_0x25ab('0x47')]){_0x4f874d[_0x25ab('0x40')]=[{'all':!![]}];}_0x4f874d=_['merge']({},_0x4f874d,_0x44aba7[_0x25ab('0x3e')]);return db[_0x25ab('0x2a')][_0x25ab('0x48')](_0x4f874d)[_0x25ab('0x24')](handleEntityNotFound(_0x3c38b8,null))[_0x25ab('0x24')](respondWithResult(_0x3c38b8,null))[_0x25ab('0x49')](handleError(_0x3c38b8,null));};exports[_0x25ab('0x4a')]=function(_0x4a7a24,_0x201ef8){return db[_0x25ab('0x2a')][_0x25ab('0x4a')](_0x4a7a24[_0x25ab('0x4b')],{})[_0x25ab('0x24')](respondWithResult(_0x201ef8,0xc9))[_0x25ab('0x49')](handleError(_0x201ef8,null));};exports[_0x25ab('0x22')]=function(_0x180088,_0x2ace9d){if(_0x180088['body']['id']){delete _0x180088[_0x25ab('0x4b')]['id'];}return db[_0x25ab('0x2a')][_0x25ab('0x48')]({'where':{'id':_0x180088[_0x25ab('0x44')]['id']}})['then'](handleEntityNotFound(_0x2ace9d,null))[_0x25ab('0x24')](saveUpdates(_0x180088[_0x25ab('0x4b')],null))[_0x25ab('0x24')](respondWithResult(_0x2ace9d,null))[_0x25ab('0x49')](handleError(_0x2ace9d,null));};exports[_0x25ab('0x23')]=function(_0x3289bc,_0x304fbe){return db[_0x25ab('0x2a')][_0x25ab('0x48')]({'where':{'id':_0x3289bc[_0x25ab('0x44')]['id']}})[_0x25ab('0x24')](handleEntityNotFound(_0x304fbe,null))['then'](removeEntity(_0x304fbe,null))['catch'](handleError(_0x304fbe,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 75dc38e..902588e 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 _0xb607=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./intVtigerField.attributes','exports','define','int_vtiger_fields','vtiger_unique_index','FieldId'];(function(_0x15d3cf,_0x27a215){var _0x115836=function(_0x1b0bf5){while(--_0x1b0bf5){_0x15d3cf['push'](_0x15d3cf['shift']());}};_0x115836(++_0x27a215);}(_0xb607,0x134));var _0x7b60=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xb607[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0x7b60('0x0'));var util=require(_0x7b60('0x1'));var logger=require(_0x7b60('0x2'))(_0x7b60('0x3'));var moment=require(_0x7b60('0x4'));var BPromise=require('bluebird');var rp=require(_0x7b60('0x5'));var fs=require('fs');var path=require(_0x7b60('0x6'));var rimraf=require(_0x7b60('0x7'));var config=require('../../config/environment');var attributes=require(_0x7b60('0x8'));module[_0x7b60('0x9')]=function(_0xe031a7,_0x28d95c){return _0xe031a7[_0x7b60('0xa')]('VtigerField',attributes,{'tableName':_0x7b60('0xb'),'paranoid':![],'indexes':[{'name':_0x7b60('0xc'),'fields':['idField',_0x7b60('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc6a5=['idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','exports','define','int_vtiger_fields','vtiger_unique_index'];(function(_0x2bc8ca,_0x38576d){var _0x19d471=function(_0x141b76){while(--_0x141b76){_0x2bc8ca['push'](_0x2bc8ca['shift']());}};_0x19d471(++_0x38576d);}(_0xc6a5,0xe2));var _0x5c6a=function(_0x1783e3,_0x839348){_0x1783e3=_0x1783e3-0x0;var _0x12d2aa=_0xc6a5[_0x1783e3];return _0x12d2aa;};'use strict';var _=require(_0x5c6a('0x0'));var util=require(_0x5c6a('0x1'));var logger=require(_0x5c6a('0x2'))(_0x5c6a('0x3'));var moment=require(_0x5c6a('0x4'));var BPromise=require(_0x5c6a('0x5'));var rp=require(_0x5c6a('0x6'));var fs=require('fs');var path=require(_0x5c6a('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intVtigerField.attributes');module[_0x5c6a('0x8')]=function(_0x47a119,_0x4beb8e){return _0x47a119[_0x5c6a('0x9')]('VtigerField',attributes,{'tableName':_0x5c6a('0xa'),'paranoid':![],'indexes':[{'name':_0x5c6a('0xb'),'fields':[_0x5c6a('0xc'),_0x5c6a('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 dab09fb..0429a89 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 _0xfddb=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','debug','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VtigerField,\x20%s,\x20%s','message','info','catch'];(function(_0x46c464,_0x5ba0d9){var _0x7e00ea=function(_0x6ea63c){while(--_0x6ea63c){_0x46c464['push'](_0x46c464['shift']());}};_0x7e00ea(++_0x5ba0d9);}(_0xfddb,0x1b8));var _0xbfdd=function(_0x25824e,_0x1962e9){_0x25824e=_0x25824e-0x0;var _0x3ca06d=_0xfddb[_0x25824e];return _0x3ca06d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbfdd('0x0'));var BPromise=require(_0xbfdd('0x1'));var rs=require(_0xbfdd('0x2'));var fs=require('fs');var Redis=require(_0xbfdd('0x3'));var db=require(_0xbfdd('0x4'))['db'];var utils=require(_0xbfdd('0x5'));var logger=require(_0xbfdd('0x6'))('rpc');var config=require(_0xbfdd('0x7'));var jayson=require(_0xbfdd('0x8'));var client=jayson[_0xbfdd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56d698,_0x47ad40,_0x47d06a){return new BPromise(function(_0x2d51c7,_0x455d9b){return client[_0xbfdd('0xa')](_0x56d698,_0x47d06a)[_0xbfdd('0xb')](function(_0x18b4c2){logger['info']('VtigerField,\x20%s,\x20%s',_0x47ad40,'request\x20sent');logger[_0xbfdd('0xc')](_0xbfdd('0xd'),_0x47ad40,_0xbfdd('0xe'),JSON[_0xbfdd('0xf')](_0x18b4c2));if(_0x18b4c2['error']){if(_0x18b4c2[_0xbfdd('0x10')][_0xbfdd('0x11')]===0x1f4){logger[_0xbfdd('0x10')](_0xbfdd('0x12'),_0x47ad40,_0x18b4c2['error'][_0xbfdd('0x13')]);return _0x455d9b(_0x18b4c2['error'][_0xbfdd('0x13')]);}logger[_0xbfdd('0x10')]('VtigerField,\x20%s,\x20%s',_0x47ad40,_0x18b4c2[_0xbfdd('0x10')][_0xbfdd('0x13')]);return _0x2d51c7(_0x18b4c2['error'][_0xbfdd('0x13')]);}else{logger[_0xbfdd('0x14')]('VtigerField,\x20%s,\x20%s',_0x47ad40,_0xbfdd('0xe'));_0x2d51c7(_0x18b4c2['result'][_0xbfdd('0x13')]);}})[_0xbfdd('0x15')](function(_0x4475a1){logger['error'](_0xbfdd('0x12'),_0x47ad40,_0x4475a1);_0x455d9b(_0x4475a1);});});} \ No newline at end of file +var _0x6f2e=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x469bce,_0x9b72){var _0x489a35=function(_0x532357){while(--_0x532357){_0x469bce['push'](_0x469bce['shift']());}};_0x489a35(++_0x9b72);}(_0x6f2e,0xb1));var _0xe6f2=function(_0x3676ee,_0x5df798){_0x3676ee=_0x3676ee-0x0;var _0x66ec17=_0x6f2e[_0x3676ee];return _0x66ec17;};'use strict';var _=require('lodash');var util=require(_0xe6f2('0x0'));var moment=require(_0xe6f2('0x1'));var BPromise=require(_0xe6f2('0x2'));var rs=require(_0xe6f2('0x3'));var fs=require('fs');var Redis=require(_0xe6f2('0x4'));var db=require(_0xe6f2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe6f2('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe6f2('0x7'));var client=jayson[_0xe6f2('0x8')][_0xe6f2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d20bf,_0x13b324,_0x406826){return new BPromise(function(_0x178afa,_0x21c18a){return client[_0xe6f2('0xa')](_0x2d20bf,_0x406826)[_0xe6f2('0xb')](function(_0x5bfa1e){logger[_0xe6f2('0xc')](_0xe6f2('0xd'),_0x13b324,_0xe6f2('0xe'));logger[_0xe6f2('0xf')](_0xe6f2('0x10'),_0x13b324,'request\x20sent',JSON[_0xe6f2('0x11')](_0x5bfa1e));if(_0x5bfa1e[_0xe6f2('0x12')]){if(_0x5bfa1e[_0xe6f2('0x12')]['code']===0x1f4){logger[_0xe6f2('0x12')](_0xe6f2('0xd'),_0x13b324,_0x5bfa1e['error']['message']);return _0x21c18a(_0x5bfa1e[_0xe6f2('0x12')]['message']);}logger[_0xe6f2('0x12')]('VtigerField,\x20%s,\x20%s',_0x13b324,_0x5bfa1e[_0xe6f2('0x12')][_0xe6f2('0x13')]);return _0x178afa(_0x5bfa1e[_0xe6f2('0x12')][_0xe6f2('0x13')]);}else{logger[_0xe6f2('0xc')]('VtigerField,\x20%s,\x20%s',_0x13b324,_0xe6f2('0xe'));_0x178afa(_0x5bfa1e[_0xe6f2('0x14')][_0xe6f2('0x13')]);}})[_0xe6f2('0x15')](function(_0x59120d){logger[_0xe6f2('0x12')](_0xe6f2('0xd'),_0x13b324,_0x59120d);_0x21c18a(_0x59120d);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index e634fa6..7ef6e6f 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 _0xc0f4=['get','index','show','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0xc0f4,0x16e));var _0x4c0f=function(_0x58703a,_0x599c7c){_0x58703a=_0x58703a-0x0;var _0x138d61=_0xc0f4[_0x58703a];return _0x138d61;};'use strict';var multer=require(_0x4c0f('0x0'));var util=require(_0x4c0f('0x1'));var path=require(_0x4c0f('0x2'));var timeout=require(_0x4c0f('0x3'));var express=require(_0x4c0f('0x4'));var router=express['Router']();var fs_extra=require(_0x4c0f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4c0f('0x6'));var config=require(_0x4c0f('0x7'));var controller=require(_0x4c0f('0x8'));router[_0x4c0f('0x9')]('/',auth['isAuthenticated'](),controller[_0x4c0f('0xa')]);router[_0x4c0f('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x4c0f('0xb')]);router[_0x4c0f('0x9')](_0x4c0f('0xc'),auth[_0x4c0f('0xd')](),controller[_0x4c0f('0xe')]);router['get'](_0x4c0f('0xf'),auth[_0x4c0f('0xd')](),controller[_0x4c0f('0x10')]);router[_0x4c0f('0x11')]('/',auth[_0x4c0f('0xd')](),controller[_0x4c0f('0x12')]);router['post'](_0x4c0f('0xc'),auth[_0x4c0f('0xd')](),controller[_0x4c0f('0x13')]);router['put'](_0x4c0f('0x14'),auth['isAuthenticated'](),controller[_0x4c0f('0x15')]);router[_0x4c0f('0x16')](_0x4c0f('0x14'),auth[_0x4c0f('0xd')](),controller[_0x4c0f('0x17')]);module[_0x4c0f('0x18')]=router; \ No newline at end of file +var _0xb540=['getConfigurations','/:id/fields','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','/:id/configurations'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xb540,0x179));var _0x0b54=function(_0x362158,_0x917ac5){_0x362158=_0x362158-0x0;var _0x1691e7=_0xb540[_0x362158];return _0x1691e7;};'use strict';var multer=require(_0x0b54('0x0'));var util=require(_0x0b54('0x1'));var path=require(_0x0b54('0x2'));var timeout=require(_0x0b54('0x3'));var express=require(_0x0b54('0x4'));var router=express[_0x0b54('0x5')]();var fs_extra=require(_0x0b54('0x6'));var auth=require(_0x0b54('0x7'));var interaction=require(_0x0b54('0x8'));var config=require(_0x0b54('0x9'));var controller=require(_0x0b54('0xa'));router[_0x0b54('0xb')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x0b54('0xc')](),controller['show']);router[_0x0b54('0xb')](_0x0b54('0xd'),auth[_0x0b54('0xc')](),controller[_0x0b54('0xe')]);router[_0x0b54('0xb')](_0x0b54('0xf'),auth[_0x0b54('0xc')](),controller['getFields']);router[_0x0b54('0x10')]('/',auth[_0x0b54('0xc')](),controller[_0x0b54('0x11')]);router[_0x0b54('0x10')](_0x0b54('0xd'),auth[_0x0b54('0xc')](),controller['addConfiguration']);router[_0x0b54('0x12')](_0x0b54('0x13'),auth['isAuthenticated'](),controller[_0x0b54('0x14')]);router[_0x0b54('0x15')](_0x0b54('0x13'),auth['isAuthenticated'](),controller[_0x0b54('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 13a6a27..f997bce 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 _0xc1c6=['integrationTab','newTab','sequelize','exports','STRING','password','ENUM'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x2641c7,_0x472b9e){_0x2641c7=_0x2641c7-0x0;var _0xf734cf=_0xc1c6[_0x2641c7];return _0xf734cf;};'use strict';var Sequelize=require(_0x6c1c('0x0'));module[_0x6c1c('0x1')]={'name':{'type':Sequelize[_0x6c1c('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x6c1c('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x6c1c('0x2')]},'token':{'type':Sequelize[_0x6c1c('0x2')]},'remoteUri':{'type':Sequelize[_0x6c1c('0x2')],'unique':'remoteUri'},'authType':{'type':Sequelize['ENUM'](_0x6c1c('0x3'),'token'),'defaultValue':_0x6c1c('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6c1c('0x4')](_0x6c1c('0x5'),_0x6c1c('0x6')),'defaultValue':_0x6c1c('0x5')}}; \ No newline at end of file +var _0x8af6=['newTab','sequelize','exports','STRING','username','remoteUri','password','ENUM','integrationTab'];(function(_0x53790d,_0x3ee974){var _0x554d2f=function(_0x1bf8e6){while(--_0x1bf8e6){_0x53790d['push'](_0x53790d['shift']());}};_0x554d2f(++_0x3ee974);}(_0x8af6,0x76));var _0x68af=function(_0x3aab6a,_0x44298c){_0x3aab6a=_0x3aab6a-0x0;var _0x4f47d2=_0x8af6[_0x3aab6a];return _0x4f47d2;};'use strict';var Sequelize=require(_0x68af('0x0'));module[_0x68af('0x1')]={'name':{'type':Sequelize[_0x68af('0x2')]},'description':{'type':Sequelize[_0x68af('0x2')]},'username':{'type':Sequelize[_0x68af('0x2')],'unique':_0x68af('0x3')},'password':{'type':Sequelize[_0x68af('0x2')]},'token':{'type':Sequelize[_0x68af('0x2')]},'remoteUri':{'type':Sequelize[_0x68af('0x2')],'unique':_0x68af('0x4')},'authType':{'type':Sequelize['ENUM'](_0x68af('0x5'),'token'),'defaultValue':_0x68af('0x5')},'serverUrl':{'type':Sequelize[_0x68af('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x68af('0x6')](_0x68af('0x7'),_0x68af('0x8')),'defaultValue':_0x68af('0x7')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index e42eb59..8a2e5f0 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 _0x282b=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','end','offset','undefined','count','limit','status','set','Content-Range','json','apply','reject','update','then','stack','name','index','ZendeskAccount','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','destroy','getConfigurations','findOne','ZendeskConfiguration','map','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','channel','Descriptions','ZendeskField','getFields','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','%s/%s','ticket_fields','headers','format','Basic\x20%s','%s/token:%s','toString','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials'];(function(_0x3cc07c,_0x279f95){var _0x5d7dee=function(_0x25c0c7){while(--_0x25c0c7){_0x3cc07c['push'](_0x3cc07c['shift']());}};_0x5d7dee(++_0x279f95);}(_0x282b,0xec));var _0xb282=function(_0x2c5366,_0x46aa8a){_0x2c5366=_0x2c5366-0x0;var _0x4667b8=_0x282b[_0x2c5366];return _0x4667b8;};'use strict';var emlformat=require(_0xb282('0x0'));var rimraf=require(_0xb282('0x1'));var zipdir=require(_0xb282('0x2'));var jsonpatch=require(_0xb282('0x3'));var rp=require(_0xb282('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb282('0x5'));var util=require('util');var path=require(_0xb282('0x6'));var sox=require(_0xb282('0x7'));var csv=require(_0xb282('0x8'));var ejs=require(_0xb282('0x9'));var fs=require('fs');var fs_extra=require(_0xb282('0xa'));var _=require(_0xb282('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb282('0xc'));var deskjs=require(_0xb282('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb282('0xe'));var Papa=require(_0xb282('0xf'));var Redis=require(_0xb282('0x10'));var authService=require(_0xb282('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb282('0x12'));var logger=require(_0xb282('0x13'))(_0xb282('0x14'));var utils=require(_0xb282('0x15'));var config=require(_0xb282('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xb282('0x17'));function respondWithStatusCode(_0xc08746,_0x40d7b8){_0x40d7b8=_0x40d7b8||0xcc;return function(_0x9e9072){if(_0x9e9072){return _0xc08746[_0xb282('0x18')](_0x40d7b8);}return _0xc08746['status'](_0x40d7b8)[_0xb282('0x19')]();};}function respondWithResult(_0x5adf7f,_0xe1d53){_0xe1d53=_0xe1d53||0xc8;return function(_0x211862){if(_0x211862){return _0x5adf7f['status'](_0xe1d53)['json'](_0x211862);}};}function respondWithFilteredResult(_0x5bc7c3,_0x13cea1){return function(_0x350676){if(_0x350676){var _0x7c20df=typeof _0x13cea1[_0xb282('0x1a')]===_0xb282('0x1b')&&typeof _0x13cea1['limit']===_0xb282('0x1b');var _0x5519bf=_0x350676[_0xb282('0x1c')];var _0x45b070=_0x7c20df?0x0:_0x13cea1[_0xb282('0x1a')];var _0x492d20=_0x7c20df?_0x350676['count']:_0x13cea1[_0xb282('0x1a')]+_0x13cea1[_0xb282('0x1d')];var _0x599f9e;if(_0x492d20>=_0x5519bf){_0x492d20=_0x5519bf;_0x599f9e=0xc8;}else{_0x599f9e=0xce;}_0x5bc7c3[_0xb282('0x1e')](_0x599f9e);return _0x5bc7c3[_0xb282('0x1f')](_0xb282('0x20'),_0x45b070+'-'+_0x492d20+'/'+_0x5519bf)[_0xb282('0x21')](_0x350676);}return null;};}function patchUpdates(_0x1c3084){return function(_0x533147){try{jsonpatch[_0xb282('0x22')](_0x533147,_0x1c3084,!![]);}catch(_0x16a656){return BPromise[_0xb282('0x23')](_0x16a656);}return _0x533147['save']();};}function saveUpdates(_0x437d66,_0x2a7ef8){return function(_0x3c55ad){if(_0x3c55ad){return _0x3c55ad[_0xb282('0x24')](_0x437d66)[_0xb282('0x25')](function(_0x56645f){return _0x56645f;});}return null;};}function removeEntity(_0x4d624f,_0x360f15){return function(_0x3c7f1f){if(_0x3c7f1f){return _0x3c7f1f['destroy']()['then'](function(){_0x4d624f[_0xb282('0x1e')](0xcc)[_0xb282('0x19')]();});}};}function handleEntityNotFound(_0x3451e5,_0x3c4018){return function(_0x211cc1){if(!_0x211cc1){_0x3451e5[_0xb282('0x18')](0x194);}return _0x211cc1;};}function handleError(_0x5b1d3d,_0xa0d7fb){_0xa0d7fb=_0xa0d7fb||0x1f4;return function(_0x42015c){logger['error'](_0x42015c[_0xb282('0x26')]);if(_0x42015c[_0xb282('0x27')]){delete _0x42015c[_0xb282('0x27')];}_0x5b1d3d[_0xb282('0x1e')](_0xa0d7fb)['send'](_0x42015c);};}exports[_0xb282('0x28')]=function(_0x1fb89f,_0xe337b8){var _0x433ad5={},_0x4cee93={},_0xfddd2e={'count':0x0,'rows':[]};var _0x22f657=_['map'](db[_0xb282('0x29')][_0xb282('0x2a')],function(_0x3eb294){return{'name':_0x3eb294[_0xb282('0x2b')],'type':_0x3eb294[_0xb282('0x2c')]['key']};});_0x4cee93[_0xb282('0x2d')]=_['map'](_0x22f657,_0xb282('0x27'));_0x4cee93[_0xb282('0x2e')]=_[_0xb282('0x2f')](_0x1fb89f['query']);_0x4cee93[_0xb282('0x30')]=_['intersection'](_0x4cee93[_0xb282('0x2d')],_0x4cee93[_0xb282('0x2e')]);_0x433ad5[_0xb282('0x31')]=_[_0xb282('0x32')](_0x4cee93[_0xb282('0x2d')],qs[_0xb282('0x33')](_0x1fb89f['query'][_0xb282('0x33')]));_0x433ad5[_0xb282('0x31')]=_0x433ad5['attributes']['length']?_0x433ad5[_0xb282('0x31')]:_0x4cee93[_0xb282('0x2d')];if(!_0x1fb89f[_0xb282('0x2e')]['hasOwnProperty']('nolimit')){_0x433ad5['limit']=qs[_0xb282('0x1d')](_0x1fb89f[_0xb282('0x2e')][_0xb282('0x1d')]);_0x433ad5[_0xb282('0x1a')]=qs[_0xb282('0x1a')](_0x1fb89f[_0xb282('0x2e')][_0xb282('0x1a')]);}_0x433ad5['order']=qs[_0xb282('0x34')](_0x1fb89f['query'][_0xb282('0x34')]);_0x433ad5[_0xb282('0x35')]=qs[_0xb282('0x30')](_['pick'](_0x1fb89f[_0xb282('0x2e')],_0x4cee93['filters']),_0x22f657);if(_0x1fb89f[_0xb282('0x2e')][_0xb282('0x36')]){_0x433ad5[_0xb282('0x35')]=_[_0xb282('0x37')](_0x433ad5['where'],{'$or':_['map'](_0x22f657,function(_0x397fa1){if(_0x397fa1[_0xb282('0x2c')]!==_0xb282('0x38')){var _0x20d56c={};_0x20d56c[_0x397fa1['name']]={'$like':'%'+_0x1fb89f[_0xb282('0x2e')]['filter']+'%'};return _0x20d56c;}})});}_0x433ad5=_[_0xb282('0x37')]({},_0x433ad5,_0x1fb89f[_0xb282('0x39')]);var _0x482ff9={'where':_0x433ad5[_0xb282('0x35')]};return db[_0xb282('0x29')][_0xb282('0x1c')](_0x482ff9)[_0xb282('0x25')](function(_0x3c1e6c){_0xfddd2e[_0xb282('0x1c')]=_0x3c1e6c;if(_0x1fb89f[_0xb282('0x2e')][_0xb282('0x3a')]){_0x433ad5[_0xb282('0x3b')]=[{'all':!![]}];}return db[_0xb282('0x29')][_0xb282('0x3c')](_0x433ad5);})[_0xb282('0x25')](function(_0x1caff0){_0xfddd2e[_0xb282('0x3d')]=_0x1caff0;return _0xfddd2e;})[_0xb282('0x25')](respondWithFilteredResult(_0xe337b8,_0x433ad5))[_0xb282('0x3e')](handleError(_0xe337b8,null));};exports[_0xb282('0x3f')]=function(_0x7332d2,_0x573da7){var _0x310ad1={'raw':![],'where':{'id':_0x7332d2[_0xb282('0x40')]['id']}},_0x58109a={};_0x58109a[_0xb282('0x2d')]=_[_0xb282('0x2f')](db[_0xb282('0x29')][_0xb282('0x2a')]);_0x58109a[_0xb282('0x2e')]=_['keys'](_0x7332d2['query']);_0x58109a[_0xb282('0x30')]=_['intersection'](_0x58109a[_0xb282('0x2d')],_0x58109a[_0xb282('0x2e')]);_0x310ad1['attributes']=_[_0xb282('0x32')](_0x58109a[_0xb282('0x2d')],qs[_0xb282('0x33')](_0x7332d2['query']['fields']));_0x310ad1[_0xb282('0x31')]=_0x310ad1['attributes'][_0xb282('0x41')]?_0x310ad1[_0xb282('0x31')]:_0x58109a[_0xb282('0x2d')];if(_0x7332d2[_0xb282('0x2e')][_0xb282('0x3a')]){_0x310ad1[_0xb282('0x3b')]=[{'all':!![]}];}_0x310ad1=_['merge']({},_0x310ad1,_0x7332d2[_0xb282('0x39')]);return db[_0xb282('0x29')][_0xb282('0x42')](_0x310ad1)['then'](handleEntityNotFound(_0x573da7,null))[_0xb282('0x25')](respondWithResult(_0x573da7,null))['catch'](handleError(_0x573da7,null));};exports[_0xb282('0x43')]=function(_0x4b0822,_0x1bf51c){return db['ZendeskAccount']['create'](_0x4b0822['body'],{})[_0xb282('0x25')](respondWithResult(_0x1bf51c,0xc9))[_0xb282('0x3e')](handleError(_0x1bf51c,null));};exports[_0xb282('0x24')]=function(_0x7a5aa4,_0x4a2d0e){if(_0x7a5aa4['body']['id']){delete _0x7a5aa4['body']['id'];}return db[_0xb282('0x29')][_0xb282('0x42')]({'where':{'id':_0x7a5aa4[_0xb282('0x40')]['id']}})[_0xb282('0x25')](handleEntityNotFound(_0x4a2d0e,null))['then'](saveUpdates(_0x7a5aa4[_0xb282('0x44')],null))[_0xb282('0x25')](respondWithResult(_0x4a2d0e,null))['catch'](handleError(_0x4a2d0e,null));};exports[_0xb282('0x45')]=function(_0x9f4d79,_0x16f66b){return db[_0xb282('0x29')][_0xb282('0x42')]({'where':{'id':_0x9f4d79['params']['id']}})[_0xb282('0x25')](handleEntityNotFound(_0x16f66b,null))[_0xb282('0x25')](removeEntity(_0x16f66b,null))[_0xb282('0x3e')](handleError(_0x16f66b,null));};exports[_0xb282('0x46')]=function(_0x308aa8,_0x112d4d,_0x4cde65){var _0x87d777={};var _0x574653={};var _0x4554f1;var _0x1e6ade;return db['ZendeskAccount'][_0xb282('0x47')]({'where':{'id':_0x308aa8[_0xb282('0x40')]['id']}})[_0xb282('0x25')](handleEntityNotFound(_0x112d4d,null))['then'](function(_0x51cbb0){if(_0x51cbb0){_0x4554f1=_0x51cbb0;_0x574653[_0xb282('0x2d')]=_[_0xb282('0x2f')](db[_0xb282('0x48')]['rawAttributes']);_0x574653[_0xb282('0x2e')]=_['keys'](_0x308aa8[_0xb282('0x2e')]);_0x574653[_0xb282('0x30')]=_['intersection'](_0x574653[_0xb282('0x2d')],_0x574653['query']);_0x87d777[_0xb282('0x31')]=_[_0xb282('0x32')](_0x574653[_0xb282('0x2d')],qs[_0xb282('0x33')](_0x308aa8[_0xb282('0x2e')][_0xb282('0x33')]));_0x87d777['attributes']=_0x87d777[_0xb282('0x31')]['length']?_0x87d777[_0xb282('0x31')]:_0x574653[_0xb282('0x2d')];_0x87d777['order']=qs['sort'](_0x308aa8[_0xb282('0x2e')][_0xb282('0x34')]);_0x87d777[_0xb282('0x35')]=qs['filters'](_['pick'](_0x308aa8[_0xb282('0x2e')],_0x574653[_0xb282('0x30')]));if(_0x308aa8[_0xb282('0x2e')]['filter']){_0x87d777[_0xb282('0x35')]=_['merge'](_0x87d777[_0xb282('0x35')],{'$or':_[_0xb282('0x49')](_0x87d777[_0xb282('0x31')],function(_0x27bac8){var _0x178b6a={};_0x178b6a[_0x27bac8]={'$like':'%'+_0x308aa8[_0xb282('0x2e')][_0xb282('0x36')]+'%'};return _0x178b6a;})});}_0x87d777=_['merge']({},_0x87d777,_0x308aa8[_0xb282('0x39')]);return _0x4554f1[_0xb282('0x46')](_0x87d777);}})[_0xb282('0x25')](function(_0x58116b){if(_0x58116b){_0x1e6ade=_0x58116b['length'];if(!_0x308aa8[_0xb282('0x2e')][_0xb282('0x4a')](_0xb282('0x4b'))){_0x87d777['limit']=qs['limit'](_0x308aa8[_0xb282('0x2e')][_0xb282('0x1d')]);_0x87d777['offset']=qs[_0xb282('0x1a')](_0x308aa8[_0xb282('0x2e')][_0xb282('0x1a')]);}return _0x4554f1['getConfigurations'](_0x87d777);}})[_0xb282('0x25')](function(_0x2fb4e4){if(_0x2fb4e4){return _0x2fb4e4?{'count':_0x1e6ade,'rows':_0x2fb4e4}:null;}})['then'](respondWithResult(_0x112d4d,null))[_0xb282('0x3e')](handleError(_0x112d4d,null));};exports[_0xb282('0x4c')]=function(_0x33b5ec,_0x26c9a6,_0x4ea7a6){if(_0x33b5ec['body']['id']){delete _0x33b5ec[_0xb282('0x44')]['id'];}return db[_0xb282('0x29')]['findOne']({'where':{'id':_0x33b5ec[_0xb282('0x40')]['id']}})[_0xb282('0x25')](handleEntityNotFound(_0x26c9a6,null))[_0xb282('0x25')](function(_0x364b77){if(_0x364b77){_0x33b5ec[_0xb282('0x44')][_0xb282('0x4d')]=_0x364b77['id'];_0x33b5ec[_0xb282('0x44')][_0xb282('0x4e')]=integrations['getSubjects'](_0x33b5ec[_0xb282('0x44')][_0xb282('0x4f')],_0x33b5ec[_0xb282('0x44')]['type']);_0x33b5ec[_0xb282('0x44')][_0xb282('0x50')]=integrations['getDescriptions'](_0x33b5ec['body'][_0xb282('0x4f')],_0x33b5ec[_0xb282('0x44')][_0xb282('0x2c')]);return db[_0xb282('0x48')][_0xb282('0x43')](_0x33b5ec[_0xb282('0x44')],{'include':[{'model':db[_0xb282('0x51')],'as':_0xb282('0x4e')},{'model':db[_0xb282('0x51')],'as':_0xb282('0x50')}]});}return null;})[_0xb282('0x25')](respondWithResult(_0x26c9a6,null))[_0xb282('0x3e')](handleError(_0x26c9a6,null));};exports[_0xb282('0x52')]=function(_0x2eae62,_0x3c1579,_0x3a87ce){var _0x4ccef5='';return db[_0xb282('0x29')][_0xb282('0x47')]({'where':{'id':_0x2eae62[_0xb282('0x40')]['id']},'attributes':['id',_0xb282('0x53'),_0xb282('0x54'),_0xb282('0x55'),_0xb282('0x56'),_0xb282('0x57')]})[_0xb282('0x25')](handleEntityNotFound(_0x3c1579,null))[_0xb282('0x25')](function(_0x21b3f6){if(_0x21b3f6){_0x4ccef5=_0x21b3f6['remoteUri'];var _0x10bed7=_0x4ccef5[_0xb282('0x58')](-0x1);if(_0x10bed7==='/'){_0x4ccef5=_0x4ccef5[_0xb282('0x59')](0x0,_0x4ccef5[_0xb282('0x5a')](_0x10bed7));}var _0x1e5c3a={'method':'GET','uri':util['format'](_0xb282('0x5b'),_0x4ccef5,_0xb282('0x5c')),'json':!![]};switch(_0x21b3f6[_0xb282('0x56')]){case _0xb282('0x54'):_0x1e5c3a[_0xb282('0x5d')]={'Authorization':util[_0xb282('0x5e')](_0xb282('0x5f'),new Buffer(util['format']('%s:%s',_0x21b3f6[_0xb282('0x53')],_0x21b3f6[_0xb282('0x54')]))['toString']('base64'))};break;case _0xb282('0x55'):_0x1e5c3a[_0xb282('0x5d')]={'Authorization':util[_0xb282('0x5e')](_0xb282('0x5f'),new Buffer(util[_0xb282('0x5e')](_0xb282('0x60'),_0x21b3f6[_0xb282('0x53')],_0x21b3f6['token']))[_0xb282('0x61')](_0xb282('0x62')))};break;default:throw new db[(_0xb282('0x63'))][(_0xb282('0x64'))](_0xb282('0x65'));}return rp(_0x1e5c3a);}})[_0xb282('0x25')](function(_0x11f255){if(_0x11f255){var _0x3c37e0=[_0xb282('0x66'),_0xb282('0x67'),'group',_0xb282('0x68')];_[_0xb282('0x69')](_0x11f255[_0xb282('0x5c')],function(_0x227e66){return _0x3c37e0[_0xb282('0x6a')](_0x227e66[_0xb282('0x2c')]);});return{'count':_0x11f255[_0xb282('0x5c')][_0xb282('0x41')],'rows':_['map'](_0x11f255[_0xb282('0x5c')],function(_0x400f2a){return{'id':_0x400f2a['id'],'name':_0x400f2a[_0xb282('0x6b')]>0x7?_0x400f2a[_0xb282('0x6c')]:_0x400f2a[_0xb282('0x2c')],'custom':_0x400f2a[_0xb282('0x6b')]>0x7?!![]:![],'options':_0x400f2a['system_field_options']?_0x400f2a[_0xb282('0x6d')]:_0x400f2a[_0xb282('0x6e')]?_0x400f2a[_0xb282('0x6e')]:[]};})};}})['then'](respondWithResult(_0x3c1579,null))[_0xb282('0x3e')](function(_0x28677e){var _0x4e894e=_0x2eae62[_0xb282('0x2e')][_0xb282('0x6f')]?0x1f4:_0x28677e[_0xb282('0x70')]||0x1f4;logger[_0xb282('0x71')](_0xb282('0x72'),_0xb282('0x52'),_0x4e894e,JSON[_0xb282('0x73')](_0x28677e));delete _0x28677e['name'];if(_0x4e894e===0x191){_0x4e894e=0x190;}_0x3c1579['status'](_0x4e894e)[_0xb282('0x74')](_0x2eae62['query'][_0xb282('0x6f')]?{'message':_0xb282('0x75'),'statusCode':_0x28677e[_0xb282('0x70')]}:_0x28677e);});}; \ No newline at end of file +var _0xdb94=['query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','find','create','body','params','destroy','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','getSubjects','channel','getDescriptions','ZendeskField','Descriptions','getFields','password','authType','remoteUri','slice','substring','%s/%s','ticket_fields','format','%s:%s','username','toString','base64','token','Basic\x20%s','Sequelize','includes','position','title','system_field_options','custom_field_options','test','statusCode','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','end','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','ZendeskAccount','rawAttributes','fieldName','key','model'];(function(_0x4d7d33,_0x575510){var _0x19407b=function(_0x24a723){while(--_0x24a723){_0x4d7d33['push'](_0x4d7d33['shift']());}};_0x19407b(++_0x575510);}(_0xdb94,0xab));var _0x4db9=function(_0x4270a7,_0x21a575){_0x4270a7=_0x4270a7-0x0;var _0x1e4821=_0xdb94[_0x4270a7];return _0x1e4821;};'use strict';var emlformat=require(_0x4db9('0x0'));var rimraf=require(_0x4db9('0x1'));var zipdir=require(_0x4db9('0x2'));var jsonpatch=require(_0x4db9('0x3'));var rp=require(_0x4db9('0x4'));var moment=require('moment');var BPromise=require(_0x4db9('0x5'));var Mustache=require(_0x4db9('0x6'));var util=require('util');var path=require('path');var sox=require(_0x4db9('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4db9('0x8'));var _=require('lodash');var squel=require(_0x4db9('0x9'));var crypto=require('crypto');var jsforce=require(_0x4db9('0xa'));var deskjs=require(_0x4db9('0xb'));var toCsv=require(_0x4db9('0xc'));var querystring=require(_0x4db9('0xd'));var Papa=require(_0x4db9('0xe'));var Redis=require(_0x4db9('0xf'));var authService=require(_0x4db9('0x10'));var qs=require(_0x4db9('0x11'));var as=require(_0x4db9('0x12'));var hardwareService=require(_0x4db9('0x13'));var logger=require(_0x4db9('0x14'))('api');var utils=require(_0x4db9('0x15'));var config=require(_0x4db9('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x4db9('0x17'));function respondWithStatusCode(_0x5e644c,_0x571685){_0x571685=_0x571685||0xcc;return function(_0x34fc7d){if(_0x34fc7d){return _0x5e644c[_0x4db9('0x18')](_0x571685);}return _0x5e644c['status'](_0x571685)[_0x4db9('0x19')]();};}function respondWithResult(_0x1f9638,_0x452896){_0x452896=_0x452896||0xc8;return function(_0x22667c){if(_0x22667c){return _0x1f9638['status'](_0x452896)['json'](_0x22667c);}};}function respondWithFilteredResult(_0x102274,_0x34de1a){return function(_0x4a037f){if(_0x4a037f){var _0xadc104=typeof _0x34de1a[_0x4db9('0x1a')]==='undefined'&&typeof _0x34de1a['limit']===_0x4db9('0x1b');var _0x143b88=_0x4a037f[_0x4db9('0x1c')];var _0xa693c4=_0xadc104?0x0:_0x34de1a[_0x4db9('0x1a')];var _0x55494a=_0xadc104?_0x4a037f[_0x4db9('0x1c')]:_0x34de1a[_0x4db9('0x1a')]+_0x34de1a[_0x4db9('0x1d')];var _0x5e3b36;if(_0x55494a>=_0x143b88){_0x55494a=_0x143b88;_0x5e3b36=0xc8;}else{_0x5e3b36=0xce;}_0x102274[_0x4db9('0x1e')](_0x5e3b36);return _0x102274[_0x4db9('0x1f')](_0x4db9('0x20'),_0xa693c4+'-'+_0x55494a+'/'+_0x143b88)['json'](_0x4a037f);}return null;};}function patchUpdates(_0x46b522){return function(_0x2e8f95){try{jsonpatch[_0x4db9('0x21')](_0x2e8f95,_0x46b522,!![]);}catch(_0x46fc3d){return BPromise[_0x4db9('0x22')](_0x46fc3d);}return _0x2e8f95[_0x4db9('0x23')]();};}function saveUpdates(_0x3585d5,_0x5aef3b){return function(_0x4ceb0c){if(_0x4ceb0c){return _0x4ceb0c[_0x4db9('0x24')](_0x3585d5)[_0x4db9('0x25')](function(_0x319475){return _0x319475;});}return null;};}function removeEntity(_0x4aaa84,_0x213daa){return function(_0xdac966){if(_0xdac966){return _0xdac966['destroy']()[_0x4db9('0x25')](function(){_0x4aaa84[_0x4db9('0x1e')](0xcc)[_0x4db9('0x19')]();});}};}function handleEntityNotFound(_0x4dbb1b,_0x3c8237){return function(_0xd250c5){if(!_0xd250c5){_0x4dbb1b[_0x4db9('0x18')](0x194);}return _0xd250c5;};}function handleError(_0x2d330e,_0x3f9f7e){_0x3f9f7e=_0x3f9f7e||0x1f4;return function(_0x385e22){logger[_0x4db9('0x26')](_0x385e22[_0x4db9('0x27')]);if(_0x385e22[_0x4db9('0x28')]){delete _0x385e22[_0x4db9('0x28')];}_0x2d330e[_0x4db9('0x1e')](_0x3f9f7e)[_0x4db9('0x29')](_0x385e22);};}exports[_0x4db9('0x2a')]=function(_0x20f133,_0x583861){var _0x5031fe={},_0x3951b2={},_0x331279={'count':0x0,'rows':[]};var _0x119371=_[_0x4db9('0x2b')](db[_0x4db9('0x2c')][_0x4db9('0x2d')],function(_0x4dc946){return{'name':_0x4dc946[_0x4db9('0x2e')],'type':_0x4dc946['type'][_0x4db9('0x2f')]};});_0x3951b2[_0x4db9('0x30')]=_[_0x4db9('0x2b')](_0x119371,_0x4db9('0x28'));_0x3951b2[_0x4db9('0x31')]=_['keys'](_0x20f133['query']);_0x3951b2[_0x4db9('0x32')]=_['intersection'](_0x3951b2[_0x4db9('0x30')],_0x3951b2[_0x4db9('0x31')]);_0x5031fe['attributes']=_[_0x4db9('0x33')](_0x3951b2[_0x4db9('0x30')],qs[_0x4db9('0x34')](_0x20f133['query'][_0x4db9('0x34')]));_0x5031fe['attributes']=_0x5031fe[_0x4db9('0x35')][_0x4db9('0x36')]?_0x5031fe[_0x4db9('0x35')]:_0x3951b2['model'];if(!_0x20f133['query'][_0x4db9('0x37')](_0x4db9('0x38'))){_0x5031fe[_0x4db9('0x1d')]=qs[_0x4db9('0x1d')](_0x20f133[_0x4db9('0x31')][_0x4db9('0x1d')]);_0x5031fe[_0x4db9('0x1a')]=qs[_0x4db9('0x1a')](_0x20f133[_0x4db9('0x31')]['offset']);}_0x5031fe[_0x4db9('0x39')]=qs[_0x4db9('0x3a')](_0x20f133[_0x4db9('0x31')][_0x4db9('0x3a')]);_0x5031fe['where']=qs[_0x4db9('0x32')](_[_0x4db9('0x3b')](_0x20f133[_0x4db9('0x31')],_0x3951b2['filters']),_0x119371);if(_0x20f133[_0x4db9('0x31')][_0x4db9('0x3c')]){_0x5031fe[_0x4db9('0x3d')]=_[_0x4db9('0x3e')](_0x5031fe['where'],{'$or':_['map'](_0x119371,function(_0x41da52){if(_0x41da52[_0x4db9('0x3f')]!==_0x4db9('0x40')){var _0x8bc540={};_0x8bc540[_0x41da52[_0x4db9('0x28')]]={'$like':'%'+_0x20f133['query'][_0x4db9('0x3c')]+'%'};return _0x8bc540;}})});}_0x5031fe=_[_0x4db9('0x3e')]({},_0x5031fe,_0x20f133[_0x4db9('0x41')]);var _0x367c4c={'where':_0x5031fe[_0x4db9('0x3d')]};return db['ZendeskAccount'][_0x4db9('0x1c')](_0x367c4c)[_0x4db9('0x25')](function(_0x38a727){_0x331279['count']=_0x38a727;if(_0x20f133[_0x4db9('0x31')][_0x4db9('0x42')]){_0x5031fe[_0x4db9('0x43')]=[{'all':!![]}];}return db[_0x4db9('0x2c')][_0x4db9('0x44')](_0x5031fe);})[_0x4db9('0x25')](function(_0x412aab){_0x331279[_0x4db9('0x45')]=_0x412aab;return _0x331279;})[_0x4db9('0x25')](respondWithFilteredResult(_0x583861,_0x5031fe))[_0x4db9('0x46')](handleError(_0x583861,null));};exports['show']=function(_0x56bd68,_0x48aaf5){var _0x22a021={'raw':![],'where':{'id':_0x56bd68['params']['id']}},_0x28a3ef={};_0x28a3ef[_0x4db9('0x30')]=_[_0x4db9('0x47')](db['ZendeskAccount']['rawAttributes']);_0x28a3ef[_0x4db9('0x31')]=_['keys'](_0x56bd68[_0x4db9('0x31')]);_0x28a3ef[_0x4db9('0x32')]=_['intersection'](_0x28a3ef[_0x4db9('0x30')],_0x28a3ef[_0x4db9('0x31')]);_0x22a021['attributes']=_[_0x4db9('0x33')](_0x28a3ef[_0x4db9('0x30')],qs[_0x4db9('0x34')](_0x56bd68['query']['fields']));_0x22a021[_0x4db9('0x35')]=_0x22a021[_0x4db9('0x35')][_0x4db9('0x36')]?_0x22a021[_0x4db9('0x35')]:_0x28a3ef[_0x4db9('0x30')];if(_0x56bd68[_0x4db9('0x31')][_0x4db9('0x42')]){_0x22a021[_0x4db9('0x43')]=[{'all':!![]}];}_0x22a021=_[_0x4db9('0x3e')]({},_0x22a021,_0x56bd68[_0x4db9('0x41')]);return db[_0x4db9('0x2c')][_0x4db9('0x48')](_0x22a021)[_0x4db9('0x25')](handleEntityNotFound(_0x48aaf5,null))['then'](respondWithResult(_0x48aaf5,null))[_0x4db9('0x46')](handleError(_0x48aaf5,null));};exports[_0x4db9('0x49')]=function(_0x3852f0,_0xba27c0){return db[_0x4db9('0x2c')][_0x4db9('0x49')](_0x3852f0[_0x4db9('0x4a')],{})[_0x4db9('0x25')](respondWithResult(_0xba27c0,0xc9))[_0x4db9('0x46')](handleError(_0xba27c0,null));};exports[_0x4db9('0x24')]=function(_0x10dccb,_0x49ea0c){if(_0x10dccb['body']['id']){delete _0x10dccb[_0x4db9('0x4a')]['id'];}return db[_0x4db9('0x2c')][_0x4db9('0x48')]({'where':{'id':_0x10dccb[_0x4db9('0x4b')]['id']}})[_0x4db9('0x25')](handleEntityNotFound(_0x49ea0c,null))[_0x4db9('0x25')](saveUpdates(_0x10dccb[_0x4db9('0x4a')],null))[_0x4db9('0x25')](respondWithResult(_0x49ea0c,null))['catch'](handleError(_0x49ea0c,null));};exports[_0x4db9('0x4c')]=function(_0xcb832e,_0x121225){return db[_0x4db9('0x2c')][_0x4db9('0x48')]({'where':{'id':_0xcb832e[_0x4db9('0x4b')]['id']}})[_0x4db9('0x25')](handleEntityNotFound(_0x121225,null))[_0x4db9('0x25')](removeEntity(_0x121225,null))['catch'](handleError(_0x121225,null));};exports[_0x4db9('0x4d')]=function(_0xd6701a,_0x216696,_0x3a1f0e){var _0x15486f={};var _0x2d7fa2={};var _0x4e88c2;var _0x188663;return db['ZendeskAccount'][_0x4db9('0x4e')]({'where':{'id':_0xd6701a['params']['id']}})['then'](handleEntityNotFound(_0x216696,null))[_0x4db9('0x25')](function(_0x5996f2){if(_0x5996f2){_0x4e88c2=_0x5996f2;_0x2d7fa2[_0x4db9('0x30')]=_[_0x4db9('0x47')](db[_0x4db9('0x4f')][_0x4db9('0x2d')]);_0x2d7fa2['query']=_[_0x4db9('0x47')](_0xd6701a['query']);_0x2d7fa2[_0x4db9('0x32')]=_[_0x4db9('0x33')](_0x2d7fa2['model'],_0x2d7fa2[_0x4db9('0x31')]);_0x15486f['attributes']=_[_0x4db9('0x33')](_0x2d7fa2[_0x4db9('0x30')],qs[_0x4db9('0x34')](_0xd6701a[_0x4db9('0x31')][_0x4db9('0x34')]));_0x15486f[_0x4db9('0x35')]=_0x15486f[_0x4db9('0x35')][_0x4db9('0x36')]?_0x15486f[_0x4db9('0x35')]:_0x2d7fa2[_0x4db9('0x30')];_0x15486f[_0x4db9('0x39')]=qs[_0x4db9('0x3a')](_0xd6701a[_0x4db9('0x31')][_0x4db9('0x3a')]);_0x15486f[_0x4db9('0x3d')]=qs['filters'](_[_0x4db9('0x3b')](_0xd6701a[_0x4db9('0x31')],_0x2d7fa2['filters']));if(_0xd6701a[_0x4db9('0x31')][_0x4db9('0x3c')]){_0x15486f[_0x4db9('0x3d')]=_[_0x4db9('0x3e')](_0x15486f[_0x4db9('0x3d')],{'$or':_[_0x4db9('0x2b')](_0x15486f[_0x4db9('0x35')],function(_0x355083){var _0x215538={};_0x215538[_0x355083]={'$like':'%'+_0xd6701a['query']['filter']+'%'};return _0x215538;})});}_0x15486f=_[_0x4db9('0x3e')]({},_0x15486f,_0xd6701a[_0x4db9('0x41')]);return _0x4e88c2[_0x4db9('0x4d')](_0x15486f);}})[_0x4db9('0x25')](function(_0x35e822){if(_0x35e822){_0x188663=_0x35e822[_0x4db9('0x36')];if(!_0xd6701a[_0x4db9('0x31')][_0x4db9('0x37')](_0x4db9('0x38'))){_0x15486f[_0x4db9('0x1d')]=qs['limit'](_0xd6701a[_0x4db9('0x31')]['limit']);_0x15486f['offset']=qs['offset'](_0xd6701a['query'][_0x4db9('0x1a')]);}return _0x4e88c2['getConfigurations'](_0x15486f);}})['then'](function(_0x7aea3a){if(_0x7aea3a){return _0x7aea3a?{'count':_0x188663,'rows':_0x7aea3a}:null;}})[_0x4db9('0x25')](respondWithResult(_0x216696,null))[_0x4db9('0x46')](handleError(_0x216696,null));};exports[_0x4db9('0x50')]=function(_0x2d91d9,_0x3e833d,_0xaea8ff){if(_0x2d91d9[_0x4db9('0x4a')]['id']){delete _0x2d91d9[_0x4db9('0x4a')]['id'];}return db[_0x4db9('0x2c')][_0x4db9('0x4e')]({'where':{'id':_0x2d91d9[_0x4db9('0x4b')]['id']}})[_0x4db9('0x25')](handleEntityNotFound(_0x3e833d,null))[_0x4db9('0x25')](function(_0xd84c6c){if(_0xd84c6c){_0x2d91d9[_0x4db9('0x4a')]['AccountId']=_0xd84c6c['id'];_0x2d91d9['body']['Subjects']=integrations[_0x4db9('0x51')](_0x2d91d9['body'][_0x4db9('0x52')],_0x2d91d9[_0x4db9('0x4a')][_0x4db9('0x3f')]);_0x2d91d9['body']['Descriptions']=integrations[_0x4db9('0x53')](_0x2d91d9['body'][_0x4db9('0x52')],_0x2d91d9[_0x4db9('0x4a')][_0x4db9('0x3f')]);return db[_0x4db9('0x4f')][_0x4db9('0x49')](_0x2d91d9['body'],{'include':[{'model':db[_0x4db9('0x54')],'as':'Subjects'},{'model':db[_0x4db9('0x54')],'as':_0x4db9('0x55')}]});}return null;})[_0x4db9('0x25')](respondWithResult(_0x3e833d,null))[_0x4db9('0x46')](handleError(_0x3e833d,null));};exports[_0x4db9('0x56')]=function(_0x543d35,_0x524d82,_0x3901b5){var _0xd8a34='';return db['ZendeskAccount']['findOne']({'where':{'id':_0x543d35[_0x4db9('0x4b')]['id']},'attributes':['id','username',_0x4db9('0x57'),'token',_0x4db9('0x58'),_0x4db9('0x59')]})['then'](handleEntityNotFound(_0x524d82,null))['then'](function(_0x3de95c){if(_0x3de95c){_0xd8a34=_0x3de95c[_0x4db9('0x59')];var _0x294111=_0xd8a34[_0x4db9('0x5a')](-0x1);if(_0x294111==='/'){_0xd8a34=_0xd8a34[_0x4db9('0x5b')](0x0,_0xd8a34['lastIndexOf'](_0x294111));}var _0x593497={'method':'GET','uri':util['format'](_0x4db9('0x5c'),_0xd8a34,_0x4db9('0x5d')),'json':!![]};switch(_0x3de95c[_0x4db9('0x58')]){case _0x4db9('0x57'):_0x593497['headers']={'Authorization':util[_0x4db9('0x5e')]('Basic\x20%s',new Buffer(util[_0x4db9('0x5e')](_0x4db9('0x5f'),_0x3de95c[_0x4db9('0x60')],_0x3de95c[_0x4db9('0x57')]))[_0x4db9('0x61')](_0x4db9('0x62')))};break;case _0x4db9('0x63'):_0x593497['headers']={'Authorization':util[_0x4db9('0x5e')](_0x4db9('0x64'),new Buffer(util[_0x4db9('0x5e')]('%s/token:%s',_0x3de95c[_0x4db9('0x60')],_0x3de95c[_0x4db9('0x63')]))['toString']('base64'))};break;default:throw new db[(_0x4db9('0x65'))]['ValidationError']('Unknown\x20authentication\x20type');}return rp(_0x593497);}})[_0x4db9('0x25')](function(_0x30ba05){if(_0x30ba05){var _0x190e38=['subject','description','group','assignee'];_['remove'](_0x30ba05[_0x4db9('0x5d')],function(_0x3f4cb6){return _0x190e38[_0x4db9('0x66')](_0x3f4cb6[_0x4db9('0x3f')]);});return{'count':_0x30ba05[_0x4db9('0x5d')][_0x4db9('0x36')],'rows':_[_0x4db9('0x2b')](_0x30ba05[_0x4db9('0x5d')],function(_0x4c5be0){return{'id':_0x4c5be0['id'],'name':_0x4c5be0[_0x4db9('0x67')]>0x7?_0x4c5be0[_0x4db9('0x68')]:_0x4c5be0[_0x4db9('0x3f')],'custom':_0x4c5be0[_0x4db9('0x67')]>0x7?!![]:![],'options':_0x4c5be0[_0x4db9('0x69')]?_0x4c5be0[_0x4db9('0x69')]:_0x4c5be0[_0x4db9('0x6a')]?_0x4c5be0[_0x4db9('0x6a')]:[]};})};}})['then'](respondWithResult(_0x524d82,null))[_0x4db9('0x46')](function(_0x4a7e8b){var _0x17bbcb=_0x543d35[_0x4db9('0x31')][_0x4db9('0x6b')]?0x1f4:_0x4a7e8b[_0x4db9('0x6c')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x4db9('0x56'),_0x17bbcb,JSON['stringify'](_0x4a7e8b));delete _0x4a7e8b[_0x4db9('0x28')];if(_0x17bbcb===0x191){_0x17bbcb=0x190;}_0x524d82[_0x4db9('0x1e')](_0x17bbcb)[_0x4db9('0x29')](_0x543d35[_0x4db9('0x31')][_0x4db9('0x6b')]?{'message':_0x4db9('0x6d'),'statusCode':_0x4a7e8b[_0x4db9('0x6c')]}:_0x4a7e8b);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index aef89a4..079548b 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 _0x2df7=['lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intZendeskAccount.attributes','exports','define','ZendeskAccount','int_zendesk_accounts'];(function(_0x4569fd,_0x4f2e82){var _0x10fca7=function(_0x3a969d){while(--_0x3a969d){_0x4569fd['push'](_0x4569fd['shift']());}};_0x10fca7(++_0x4f2e82);}(_0x2df7,0xd0));var _0x72df=function(_0x1e2ea4,_0x579b33){_0x1e2ea4=_0x1e2ea4-0x0;var _0x4a873c=_0x2df7[_0x1e2ea4];return _0x4a873c;};'use strict';var _=require(_0x72df('0x0'));var util=require(_0x72df('0x1'));var logger=require(_0x72df('0x2'))(_0x72df('0x3'));var moment=require('moment');var BPromise=require(_0x72df('0x4'));var rp=require(_0x72df('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x72df('0x6'));var config=require(_0x72df('0x7'));var attributes=require(_0x72df('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x72df('0x9')]=function(_0x5a6713,_0x1b25f0){return _0x5a6713[_0x72df('0xa')](_0x72df('0xb'),attributes,{'tableName':_0x72df('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1cbe=['int_zendesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','ZendeskAccount'];(function(_0x39867f,_0x7336c1){var _0x3f1542=function(_0x37f502){while(--_0x37f502){_0x39867f['push'](_0x39867f['shift']());}};_0x3f1542(++_0x7336c1);}(_0x1cbe,0x109));var _0xe1cb=function(_0x22ecfe,_0x195b50){_0x22ecfe=_0x22ecfe-0x0;var _0x196366=_0x1cbe[_0x22ecfe];return _0x196366;};'use strict';var _=require(_0xe1cb('0x0'));var util=require(_0xe1cb('0x1'));var logger=require(_0xe1cb('0x2'))(_0xe1cb('0x3'));var moment=require(_0xe1cb('0x4'));var BPromise=require(_0xe1cb('0x5'));var rp=require(_0xe1cb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe1cb('0x7'));var config=require('../../config/environment');var attributes=require('./intZendeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xe1cb('0x8')]=function(_0x560deb,_0x190b0f){return _0x560deb['define'](_0xe1cb('0x9'),attributes,{'tableName':_0xe1cb('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 ca616f4..8f20655 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 _0xaae1=['GetZendeskAccount','ZendeskAccount','options','attributes','limit','map','include','model','ShowZendeskAccount','find','raw','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch'];(function(_0x33b259,_0x2036be){var _0xf95548=function(_0x5b3424){while(--_0x5b3424){_0x33b259['push'](_0x33b259['shift']());}};_0xf95548(++_0x2036be);}(_0xaae1,0x10b));var _0x1aae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaae1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x1aae('0x0'));var moment=require(_0x1aae('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1aae('0x2'));var db=require(_0x1aae('0x3'))['db'];var utils=require(_0x1aae('0x4'));var logger=require(_0x1aae('0x5'))(_0x1aae('0x6'));var config=require(_0x1aae('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1aae('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x390119,_0x4de064,_0x46d2a0){return new BPromise(function(_0xb40c75,_0x3931ee){return client[_0x1aae('0x9')](_0x390119,_0x46d2a0)[_0x1aae('0xa')](function(_0x135b47){logger['info'](_0x1aae('0xb'),_0x4de064,'request\x20sent');logger[_0x1aae('0xc')](_0x1aae('0xd'),_0x4de064,_0x1aae('0xe'),JSON[_0x1aae('0xf')](_0x135b47));if(_0x135b47['error']){if(_0x135b47[_0x1aae('0x10')]['code']===0x1f4){logger[_0x1aae('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x4de064,_0x135b47[_0x1aae('0x10')]['message']);return _0x3931ee(_0x135b47[_0x1aae('0x10')]['message']);}logger[_0x1aae('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x4de064,_0x135b47[_0x1aae('0x10')][_0x1aae('0x11')]);return _0xb40c75(_0x135b47[_0x1aae('0x10')][_0x1aae('0x11')]);}else{logger[_0x1aae('0x12')](_0x1aae('0xb'),_0x4de064,_0x1aae('0xe'));_0xb40c75(_0x135b47[_0x1aae('0x13')]['message']);}})[_0x1aae('0x14')](function(_0x130701){logger[_0x1aae('0x10')](_0x1aae('0xb'),_0x4de064,_0x130701);_0x3931ee(_0x130701);});});}exports[_0x1aae('0x15')]=function(_0x5f4295){var _0x2e1b53=this;return new Promise(function(_0x292e01,_0x46494f){return db[_0x1aae('0x16')]['findAll']({'raw':_0x5f4295[_0x1aae('0x17')]?_0x5f4295[_0x1aae('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x5f4295['options']?_0x5f4295[_0x1aae('0x17')]['where']||null:null,'attributes':_0x5f4295[_0x1aae('0x17')]?_0x5f4295[_0x1aae('0x17')][_0x1aae('0x18')]||null:null,'limit':_0x5f4295[_0x1aae('0x17')]?_0x5f4295[_0x1aae('0x17')][_0x1aae('0x19')]||null:null,'include':_0x5f4295[_0x1aae('0x17')]?_0x5f4295['options']['include']?_[_0x1aae('0x1a')](_0x5f4295['options'][_0x1aae('0x1b')],function(_0x43426f){return{'model':db[_0x43426f['model']],'as':_0x43426f['as'],'attributes':_0x43426f['attributes'],'include':_0x43426f['include']?_['map'](_0x43426f[_0x1aae('0x1b')],function(_0x1c779c){return{'model':db[_0x1c779c[_0x1aae('0x1c')]],'as':_0x1c779c['as'],'attributes':_0x1c779c['attributes'],'include':_0x1c779c[_0x1aae('0x1b')]?_['map'](_0x1c779c[_0x1aae('0x1b')],function(_0x132683){return{'model':db[_0x132683[_0x1aae('0x1c')]],'as':_0x132683['as'],'attributes':_0x132683[_0x1aae('0x18')]};}):[]};}):[]};}):[]:[]})[_0x1aae('0xa')](function(_0x56e5fc){logger[_0x1aae('0x12')](_0x1aae('0x15'),_0x5f4295);logger[_0x1aae('0xc')](_0x1aae('0x15'),_0x5f4295,JSON['stringify'](_0x56e5fc));_0x292e01(_0x56e5fc);})[_0x1aae('0x14')](function(_0x381ad9){logger[_0x1aae('0x10')]('GetZendeskAccount',_0x381ad9[_0x1aae('0x11')],_0x5f4295);_0x46494f(_0x2e1b53[_0x1aae('0x10')](0x1f4,_0x381ad9[_0x1aae('0x11')]));});});};exports[_0x1aae('0x1d')]=function(_0xe72344){var _0x25c45a=this;return new Promise(function(_0x58462a,_0x13564d){return db['ZendeskAccount'][_0x1aae('0x1e')]({'raw':_0xe72344['options']?_0xe72344[_0x1aae('0x17')][_0x1aae('0x1f')]===undefined?!![]:![]:!![],'where':_0xe72344[_0x1aae('0x17')]?_0xe72344[_0x1aae('0x17')]['where']||null:null,'attributes':_0xe72344[_0x1aae('0x17')]?_0xe72344[_0x1aae('0x17')][_0x1aae('0x18')]||null:null,'include':_0xe72344[_0x1aae('0x17')]?_0xe72344[_0x1aae('0x17')]['include']?_[_0x1aae('0x1a')](_0xe72344['options'][_0x1aae('0x1b')],function(_0x473ee6){return{'model':db[_0x473ee6['model']],'as':_0x473ee6['as'],'attributes':_0x473ee6[_0x1aae('0x18')],'include':_0x473ee6[_0x1aae('0x1b')]?_[_0x1aae('0x1a')](_0x473ee6[_0x1aae('0x1b')],function(_0xee4b51){return{'model':db[_0xee4b51[_0x1aae('0x1c')]],'as':_0xee4b51['as'],'attributes':_0xee4b51[_0x1aae('0x18')],'include':_0xee4b51[_0x1aae('0x1b')]?_[_0x1aae('0x1a')](_0xee4b51[_0x1aae('0x1b')],function(_0x2026f0){return{'model':db[_0x2026f0[_0x1aae('0x1c')]],'as':_0x2026f0['as'],'attributes':_0x2026f0[_0x1aae('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45e517){logger['info'](_0x1aae('0x1d'),_0xe72344);logger[_0x1aae('0xc')](_0x1aae('0x1d'),_0xe72344,JSON['stringify'](_0x45e517));_0x58462a(_0x45e517);})[_0x1aae('0x14')](function(_0x31f50b){logger[_0x1aae('0x10')](_0x1aae('0x1d'),_0x31f50b[_0x1aae('0x11')],_0xe72344);_0x13564d(_0x25c45a[_0x1aae('0x10')](0x1f4,_0x31f50b[_0x1aae('0x11')]));});});}; \ No newline at end of file +var _0xe826=['debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','message','result','GetZendeskAccount','findAll','options','raw','where','attributes','limit','include','model','stringify','ShowZendeskAccount','find','map','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xe826,0x14e));var _0x6e82=function(_0x34532b,_0x5a61e){_0x34532b=_0x34532b-0x0;var _0x560ef4=_0xe826[_0x34532b];return _0x560ef4;};'use strict';var _=require(_0x6e82('0x0'));var util=require(_0x6e82('0x1'));var moment=require(_0x6e82('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e82('0x3'));var fs=require('fs');var Redis=require(_0x6e82('0x4'));var db=require(_0x6e82('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6e82('0x6'))(_0x6e82('0x7'));var config=require(_0x6e82('0x8'));var jayson=require(_0x6e82('0x9'));var client=jayson[_0x6e82('0xa')][_0x6e82('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x14df8f,_0x30d952,_0x41e9b0){return new BPromise(function(_0x3ebce2,_0x18c7d2){return client['request'](_0x14df8f,_0x41e9b0)[_0x6e82('0xc')](function(_0x1fc4d2){logger[_0x6e82('0xd')](_0x6e82('0xe'),_0x30d952,_0x6e82('0xf'));logger[_0x6e82('0x10')](_0x6e82('0x11'),_0x30d952,_0x6e82('0xf'),JSON['stringify'](_0x1fc4d2));if(_0x1fc4d2[_0x6e82('0x12')]){if(_0x1fc4d2[_0x6e82('0x12')]['code']===0x1f4){logger[_0x6e82('0x12')](_0x6e82('0xe'),_0x30d952,_0x1fc4d2[_0x6e82('0x12')]['message']);return _0x18c7d2(_0x1fc4d2[_0x6e82('0x12')][_0x6e82('0x13')]);}logger[_0x6e82('0x12')](_0x6e82('0xe'),_0x30d952,_0x1fc4d2['error'][_0x6e82('0x13')]);return _0x3ebce2(_0x1fc4d2['error'][_0x6e82('0x13')]);}else{logger['info'](_0x6e82('0xe'),_0x30d952,_0x6e82('0xf'));_0x3ebce2(_0x1fc4d2[_0x6e82('0x14')]['message']);}})['catch'](function(_0x4c1f9a){logger[_0x6e82('0x12')](_0x6e82('0xe'),_0x30d952,_0x4c1f9a);_0x18c7d2(_0x4c1f9a);});});}exports[_0x6e82('0x15')]=function(_0x5b468a){var _0x2f4a48=this;return new Promise(function(_0x46217c,_0x4496fe){return db['ZendeskAccount'][_0x6e82('0x16')]({'raw':_0x5b468a[_0x6e82('0x17')]?_0x5b468a[_0x6e82('0x17')][_0x6e82('0x18')]===undefined?!![]:![]:!![],'where':_0x5b468a[_0x6e82('0x17')]?_0x5b468a[_0x6e82('0x17')][_0x6e82('0x19')]||null:null,'attributes':_0x5b468a[_0x6e82('0x17')]?_0x5b468a[_0x6e82('0x17')][_0x6e82('0x1a')]||null:null,'limit':_0x5b468a['options']?_0x5b468a['options'][_0x6e82('0x1b')]||null:null,'include':_0x5b468a['options']?_0x5b468a[_0x6e82('0x17')][_0x6e82('0x1c')]?_['map'](_0x5b468a[_0x6e82('0x17')]['include'],function(_0x350d2f){return{'model':db[_0x350d2f[_0x6e82('0x1d')]],'as':_0x350d2f['as'],'attributes':_0x350d2f[_0x6e82('0x1a')],'include':_0x350d2f[_0x6e82('0x1c')]?_['map'](_0x350d2f[_0x6e82('0x1c')],function(_0x18d693){return{'model':db[_0x18d693['model']],'as':_0x18d693['as'],'attributes':_0x18d693['attributes'],'include':_0x18d693[_0x6e82('0x1c')]?_['map'](_0x18d693[_0x6e82('0x1c')],function(_0x44af19){return{'model':db[_0x44af19[_0x6e82('0x1d')]],'as':_0x44af19['as'],'attributes':_0x44af19['attributes']};}):[]};}):[]};}):[]:[]})[_0x6e82('0xc')](function(_0x33609f){logger[_0x6e82('0xd')](_0x6e82('0x15'),_0x5b468a);logger[_0x6e82('0x10')](_0x6e82('0x15'),_0x5b468a,JSON[_0x6e82('0x1e')](_0x33609f));_0x46217c(_0x33609f);})['catch'](function(_0x2928fa){logger['error'](_0x6e82('0x15'),_0x2928fa[_0x6e82('0x13')],_0x5b468a);_0x4496fe(_0x2f4a48[_0x6e82('0x12')](0x1f4,_0x2928fa['message']));});});};exports[_0x6e82('0x1f')]=function(_0x1aaecb){var _0xa8d8de=this;return new Promise(function(_0x2940c5,_0x5bef14){return db['ZendeskAccount'][_0x6e82('0x20')]({'raw':_0x1aaecb[_0x6e82('0x17')]?_0x1aaecb['options']['raw']===undefined?!![]:![]:!![],'where':_0x1aaecb[_0x6e82('0x17')]?_0x1aaecb[_0x6e82('0x17')][_0x6e82('0x19')]||null:null,'attributes':_0x1aaecb[_0x6e82('0x17')]?_0x1aaecb[_0x6e82('0x17')][_0x6e82('0x1a')]||null:null,'include':_0x1aaecb['options']?_0x1aaecb[_0x6e82('0x17')][_0x6e82('0x1c')]?_['map'](_0x1aaecb[_0x6e82('0x17')]['include'],function(_0x282a34){return{'model':db[_0x282a34[_0x6e82('0x1d')]],'as':_0x282a34['as'],'attributes':_0x282a34['attributes'],'include':_0x282a34[_0x6e82('0x1c')]?_['map'](_0x282a34['include'],function(_0x378dad){return{'model':db[_0x378dad[_0x6e82('0x1d')]],'as':_0x378dad['as'],'attributes':_0x378dad['attributes'],'include':_0x378dad[_0x6e82('0x1c')]?_[_0x6e82('0x21')](_0x378dad[_0x6e82('0x1c')],function(_0x31095a){return{'model':db[_0x31095a[_0x6e82('0x1d')]],'as':_0x31095a['as'],'attributes':_0x31095a[_0x6e82('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x6e82('0xc')](function(_0x4b68ba){logger[_0x6e82('0xd')](_0x6e82('0x1f'),_0x1aaecb);logger[_0x6e82('0x10')](_0x6e82('0x1f'),_0x1aaecb,JSON['stringify'](_0x4b68ba));_0x2940c5(_0x4b68ba);})[_0x6e82('0x22')](function(_0x4321dd){logger[_0x6e82('0x12')](_0x6e82('0x1f'),_0x4321dd[_0x6e82('0x13')],_0x1aaecb);_0x5bef14(_0xa8d8de[_0x6e82('0x12')](0x1f4,_0x4321dd[_0x6e82('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index c1d7d11..092ecb6 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 _0xe5b5=['../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3c7b42,_0x2752c5){var _0x1233e0=function(_0x4a4596){while(--_0x4a4596){_0x3c7b42['push'](_0x3c7b42['shift']());}};_0x1233e0(++_0x2752c5);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x3cb152,_0x57eb54){_0x3cb152=_0x3cb152-0x0;var _0x4f54c3=_0xe5b5[_0x3cb152];return _0x4f54c3;};'use strict';var multer=require(_0x5e5b('0x0'));var util=require(_0x5e5b('0x1'));var path=require(_0x5e5b('0x2'));var timeout=require(_0x5e5b('0x3'));var express=require(_0x5e5b('0x4'));var router=express[_0x5e5b('0x5')]();var fs_extra=require(_0x5e5b('0x6'));var auth=require(_0x5e5b('0x7'));var interaction=require(_0x5e5b('0x8'));var config=require(_0x5e5b('0x9'));var controller=require(_0x5e5b('0xa'));router[_0x5e5b('0xb')]('/',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0xd')]);router[_0x5e5b('0xb')](_0x5e5b('0xe'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0xf')]);router[_0x5e5b('0xb')](_0x5e5b('0x10'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x11')]);router[_0x5e5b('0xb')]('/:id/subjects',auth[_0x5e5b('0xc')](),controller['getSubjects']);router[_0x5e5b('0xb')](_0x5e5b('0x12'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x13')]);router['get']('/:id/tags',auth['isAuthenticated'](),controller[_0x5e5b('0x14')]);router[_0x5e5b('0x15')]('/',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x16')]);router[_0x5e5b('0x15')](_0x5e5b('0x17'),auth[_0x5e5b('0xc')](),controller['setTags']);router[_0x5e5b('0x18')](_0x5e5b('0xe'),auth['isAuthenticated'](),controller[_0x5e5b('0x19')]);router['delete']('/:id',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x1a')]);module[_0x5e5b('0x1b')]=router; \ No newline at end of file +var _0x4483=['getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','setTags','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects'];(function(_0xee3051,_0xbe4f18){var _0x139e81=function(_0xac81c3){while(--_0xac81c3){_0xee3051['push'](_0xee3051['shift']());}};_0x139e81(++_0xbe4f18);}(_0x4483,0x1a3));var _0x3448=function(_0x49c3f0,_0x4bb280){_0x49c3f0=_0x49c3f0-0x0;var _0x25689e=_0x4483[_0x49c3f0];return _0x25689e;};'use strict';var multer=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var path=require(_0x3448('0x2'));var timeout=require('connect-timeout');var express=require(_0x3448('0x3'));var router=express[_0x3448('0x4')]();var fs_extra=require(_0x3448('0x5'));var auth=require(_0x3448('0x6'));var interaction=require(_0x3448('0x7'));var config=require('../../config/environment');var controller=require(_0x3448('0x8'));router[_0x3448('0x9')]('/',auth[_0x3448('0xa')](),controller[_0x3448('0xb')]);router[_0x3448('0x9')](_0x3448('0xc'),auth[_0x3448('0xa')](),controller[_0x3448('0xd')]);router['get']('/:id/fields',auth[_0x3448('0xa')](),controller[_0x3448('0xe')]);router[_0x3448('0x9')](_0x3448('0xf'),auth[_0x3448('0xa')](),controller[_0x3448('0x10')]);router[_0x3448('0x9')](_0x3448('0x11'),auth[_0x3448('0xa')](),controller[_0x3448('0x12')]);router[_0x3448('0x9')]('/:id/tags',auth['isAuthenticated'](),controller[_0x3448('0x13')]);router[_0x3448('0x14')]('/',auth['isAuthenticated'](),controller[_0x3448('0x15')]);router[_0x3448('0x14')](_0x3448('0x16'),auth['isAuthenticated'](),controller[_0x3448('0x17')]);router[_0x3448('0x18')]('/:id',auth[_0x3448('0xa')](),controller[_0x3448('0x19')]);router[_0x3448('0x1a')]('/:id',auth[_0x3448('0xa')](),controller[_0x3448('0x1b')]);module[_0x3448('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 88b5c1c..71e95aa 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 _0x8a96=['sequelize','exports','STRING'];(function(_0x15f958,_0x562815){var _0x161a42=function(_0x337135){while(--_0x337135){_0x15f958['push'](_0x15f958['shift']());}};_0x161a42(++_0x562815);}(_0x8a96,0xf9));var _0x68a9=function(_0x3b22e9,_0x354406){_0x3b22e9=_0x3b22e9-0x0;var _0x230314=_0x8a96[_0x3b22e9];return _0x230314;};'use strict';var Sequelize=require(_0x68a9('0x0'));module[_0x68a9('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x68a9('0x2')]}}; \ No newline at end of file +var _0xbf23=['exports','STRING','sequelize'];(function(_0x25a9b7,_0x2e0a9a){var _0x451897=function(_0x56c3d4){while(--_0x56c3d4){_0x25a9b7['push'](_0x25a9b7['shift']());}};_0x451897(++_0x2e0a9a);}(_0xbf23,0x18e));var _0x3bf2=function(_0x1722bf,_0x2fa7f4){_0x1722bf=_0x1722bf-0x0;var _0x58c607=_0xbf23[_0x1722bf];return _0x58c607;};'use strict';var Sequelize=require(_0x3bf2('0x0'));module[_0x3bf2('0x1')]={'name':{'type':Sequelize[_0x3bf2('0x2')]},'description':{'type':Sequelize[_0x3bf2('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 2225c5c..e81f0ff 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 _0x8327=['key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','merge','options','includeAll','ZendeskConfiguration','findAll','rows','show','length','find','catch','create','body','update','params','getFields','findOne','ZendeskField','sort','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','apply','reject','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type'];(function(_0x19ac90,_0x554f04){var _0x4b9d7d=function(_0x3efc03){while(--_0x3efc03){_0x19ac90['push'](_0x19ac90['shift']());}};_0x4b9d7d(++_0x554f04);}(_0x8327,0x78));var _0x7832=function(_0x2dd2ee,_0x2a1575){_0x2dd2ee=_0x2dd2ee-0x0;var _0x3d3b35=_0x8327[_0x2dd2ee];return _0x3d3b35;};'use strict';var emlformat=require(_0x7832('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7832('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7832('0x2'));var moment=require(_0x7832('0x3'));var BPromise=require(_0x7832('0x4'));var Mustache=require(_0x7832('0x5'));var util=require(_0x7832('0x6'));var path=require(_0x7832('0x7'));var sox=require(_0x7832('0x8'));var csv=require(_0x7832('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7832('0xa'));var _=require('lodash');var squel=require(_0x7832('0xb'));var crypto=require(_0x7832('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7832('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7832('0xe'));var Papa=require('papaparse');var Redis=require(_0x7832('0xf'));var authService=require(_0x7832('0x10'));var qs=require(_0x7832('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7832('0x12'))('api');var utils=require(_0x7832('0x13'));var config=require(_0x7832('0x14'));var licenseUtil=require(_0x7832('0x15'));var db=require(_0x7832('0x16'))['db'];function respondWithStatusCode(_0x4b7549,_0x212993){_0x212993=_0x212993||0xcc;return function(_0x576669){if(_0x576669){return _0x4b7549['sendStatus'](_0x212993);}return _0x4b7549[_0x7832('0x17')](_0x212993)[_0x7832('0x18')]();};}function respondWithResult(_0x442a18,_0x270324){_0x270324=_0x270324||0xc8;return function(_0x4fcfed){if(_0x4fcfed){return _0x442a18[_0x7832('0x17')](_0x270324)['json'](_0x4fcfed);}};}function respondWithFilteredResult(_0x32ada8,_0x2e107a){return function(_0x393c23){if(_0x393c23){var _0x578244=typeof _0x2e107a[_0x7832('0x19')]===_0x7832('0x1a')&&typeof _0x2e107a['limit']===_0x7832('0x1a');var _0x234ca9=_0x393c23['count'];var _0x3b1341=_0x578244?0x0:_0x2e107a[_0x7832('0x19')];var _0x4ddfe1=_0x578244?_0x393c23[_0x7832('0x1b')]:_0x2e107a[_0x7832('0x19')]+_0x2e107a[_0x7832('0x1c')];var _0x259197;if(_0x4ddfe1>=_0x234ca9){_0x4ddfe1=_0x234ca9;_0x259197=0xc8;}else{_0x259197=0xce;}_0x32ada8['status'](_0x259197);return _0x32ada8[_0x7832('0x1d')]('Content-Range',_0x3b1341+'-'+_0x4ddfe1+'/'+_0x234ca9)['json'](_0x393c23);}return null;};}function patchUpdates(_0x3dde7a){return function(_0x53118a){try{jsonpatch[_0x7832('0x1e')](_0x53118a,_0x3dde7a,!![]);}catch(_0x575cfc){return BPromise[_0x7832('0x1f')](_0x575cfc);}return _0x53118a['save']();};}function saveUpdates(_0x4e8328,_0x552e47){return function(_0x4dd781){if(_0x4dd781){return _0x4dd781['update'](_0x4e8328)[_0x7832('0x20')](function(_0x3a8a71){return _0x3a8a71;});}return null;};}function removeEntity(_0x13d72b,_0x4185ed){return function(_0x788ab5){if(_0x788ab5){return _0x788ab5[_0x7832('0x21')]()[_0x7832('0x20')](function(){_0x13d72b[_0x7832('0x17')](0xcc)[_0x7832('0x18')]();});}};}function handleEntityNotFound(_0x4cc982,_0x9fcbbd){return function(_0x201e65){if(!_0x201e65){_0x4cc982['sendStatus'](0x194);}return _0x201e65;};}function handleError(_0x4bedbc,_0x575788){_0x575788=_0x575788||0x1f4;return function(_0x4b98fc){logger[_0x7832('0x22')](_0x4b98fc[_0x7832('0x23')]);if(_0x4b98fc[_0x7832('0x24')]){delete _0x4b98fc[_0x7832('0x24')];}_0x4bedbc[_0x7832('0x17')](_0x575788)[_0x7832('0x25')](_0x4b98fc);};}exports['index']=function(_0x153265,_0x5b82ef){var _0x248895={},_0x1e45db={},_0x3644ec={'count':0x0,'rows':[]};var _0x45e8fb=_[_0x7832('0x26')](db['ZendeskConfiguration'][_0x7832('0x27')],function(_0x2eed29){return{'name':_0x2eed29[_0x7832('0x28')],'type':_0x2eed29[_0x7832('0x29')][_0x7832('0x2a')]};});_0x1e45db[_0x7832('0x2b')]=_[_0x7832('0x26')](_0x45e8fb,_0x7832('0x24'));_0x1e45db[_0x7832('0x2c')]=_[_0x7832('0x2d')](_0x153265['query']);_0x1e45db[_0x7832('0x2e')]=_[_0x7832('0x2f')](_0x1e45db['model'],_0x1e45db[_0x7832('0x2c')]);_0x248895[_0x7832('0x30')]=_['intersection'](_0x1e45db[_0x7832('0x2b')],qs[_0x7832('0x31')](_0x153265['query'][_0x7832('0x31')]));_0x248895[_0x7832('0x30')]=_0x248895[_0x7832('0x30')]['length']?_0x248895[_0x7832('0x30')]:_0x1e45db[_0x7832('0x2b')];if(!_0x153265[_0x7832('0x2c')][_0x7832('0x32')](_0x7832('0x33'))){_0x248895[_0x7832('0x1c')]=qs[_0x7832('0x1c')](_0x153265[_0x7832('0x2c')][_0x7832('0x1c')]);_0x248895[_0x7832('0x19')]=qs[_0x7832('0x19')](_0x153265[_0x7832('0x2c')][_0x7832('0x19')]);}_0x248895[_0x7832('0x34')]=qs['sort'](_0x153265[_0x7832('0x2c')]['sort']);_0x248895[_0x7832('0x35')]=qs['filters'](_[_0x7832('0x36')](_0x153265[_0x7832('0x2c')],_0x1e45db[_0x7832('0x2e')]),_0x45e8fb);if(_0x153265[_0x7832('0x2c')][_0x7832('0x37')]){_0x248895[_0x7832('0x35')]=_['merge'](_0x248895[_0x7832('0x35')],{'$or':_[_0x7832('0x26')](_0x45e8fb,function(_0x4c417e){if(_0x4c417e[_0x7832('0x29')]!==_0x7832('0x38')){var _0x180ded={};_0x180ded[_0x4c417e[_0x7832('0x24')]]={'$like':'%'+_0x153265[_0x7832('0x2c')][_0x7832('0x37')]+'%'};return _0x180ded;}})});}_0x248895=_[_0x7832('0x39')]({},_0x248895,_0x153265[_0x7832('0x3a')]);var _0x49631b={'where':_0x248895[_0x7832('0x35')]};return db['ZendeskConfiguration'][_0x7832('0x1b')](_0x49631b)[_0x7832('0x20')](function(_0x300409){_0x3644ec[_0x7832('0x1b')]=_0x300409;if(_0x153265[_0x7832('0x2c')][_0x7832('0x3b')]){_0x248895['include']=[{'all':!![]}];}return db[_0x7832('0x3c')][_0x7832('0x3d')](_0x248895);})['then'](function(_0x4d42ef){_0x3644ec[_0x7832('0x3e')]=_0x4d42ef;return _0x3644ec;})[_0x7832('0x20')](respondWithFilteredResult(_0x5b82ef,_0x248895))['catch'](handleError(_0x5b82ef,null));};exports[_0x7832('0x3f')]=function(_0x3d015c,_0x18c1fc){var _0x39015={'raw':![],'where':{'id':_0x3d015c['params']['id']}},_0x4ee859={};_0x4ee859[_0x7832('0x2b')]=_[_0x7832('0x2d')](db[_0x7832('0x3c')][_0x7832('0x27')]);_0x4ee859[_0x7832('0x2c')]=_['keys'](_0x3d015c[_0x7832('0x2c')]);_0x4ee859['filters']=_[_0x7832('0x2f')](_0x4ee859[_0x7832('0x2b')],_0x4ee859[_0x7832('0x2c')]);_0x39015[_0x7832('0x30')]=_[_0x7832('0x2f')](_0x4ee859['model'],qs[_0x7832('0x31')](_0x3d015c[_0x7832('0x2c')][_0x7832('0x31')]));_0x39015[_0x7832('0x30')]=_0x39015[_0x7832('0x30')][_0x7832('0x40')]?_0x39015[_0x7832('0x30')]:_0x4ee859[_0x7832('0x2b')];if(_0x3d015c['query'][_0x7832('0x3b')]){_0x39015['include']=[{'all':!![]}];}_0x39015=_[_0x7832('0x39')]({},_0x39015,_0x3d015c[_0x7832('0x3a')]);return db[_0x7832('0x3c')][_0x7832('0x41')](_0x39015)[_0x7832('0x20')](handleEntityNotFound(_0x18c1fc,null))[_0x7832('0x20')](respondWithResult(_0x18c1fc,null))[_0x7832('0x42')](handleError(_0x18c1fc,null));};exports['create']=function(_0x3400ed,_0x28c6dc){return db[_0x7832('0x3c')][_0x7832('0x43')](_0x3400ed[_0x7832('0x44')],{})['then'](respondWithResult(_0x28c6dc,0xc9))['catch'](handleError(_0x28c6dc,null));};exports[_0x7832('0x45')]=function(_0x311112,_0x45ebec){if(_0x311112['body']['id']){delete _0x311112[_0x7832('0x44')]['id'];}return db[_0x7832('0x3c')]['find']({'where':{'id':_0x311112[_0x7832('0x46')]['id']}})[_0x7832('0x20')](handleEntityNotFound(_0x45ebec,null))[_0x7832('0x20')](saveUpdates(_0x311112[_0x7832('0x44')],null))[_0x7832('0x20')](respondWithResult(_0x45ebec,null))[_0x7832('0x42')](handleError(_0x45ebec,null));};exports[_0x7832('0x21')]=function(_0x4d8824,_0xa2aac2){return db[_0x7832('0x3c')][_0x7832('0x41')]({'where':{'id':_0x4d8824[_0x7832('0x46')]['id']}})['then'](handleEntityNotFound(_0xa2aac2,null))[_0x7832('0x20')](removeEntity(_0xa2aac2,null))[_0x7832('0x42')](handleError(_0xa2aac2,null));};exports[_0x7832('0x47')]=function(_0x12d0f9,_0x7b9cbd,_0x3fe20d){var _0x408013={};var _0x49a59e={};var _0x2fb3a5;var _0x8735dc;return db[_0x7832('0x3c')][_0x7832('0x48')]({'where':{'id':_0x12d0f9['params']['id']}})[_0x7832('0x20')](handleEntityNotFound(_0x7b9cbd,null))[_0x7832('0x20')](function(_0x2c6598){if(_0x2c6598){_0x2fb3a5=_0x2c6598;_0x49a59e[_0x7832('0x2b')]=_[_0x7832('0x2d')](db[_0x7832('0x49')][_0x7832('0x27')]);_0x49a59e[_0x7832('0x2c')]=_[_0x7832('0x2d')](_0x12d0f9['query']);_0x49a59e[_0x7832('0x2e')]=_[_0x7832('0x2f')](_0x49a59e[_0x7832('0x2b')],_0x49a59e[_0x7832('0x2c')]);_0x408013[_0x7832('0x30')]=_[_0x7832('0x2f')](_0x49a59e[_0x7832('0x2b')],qs[_0x7832('0x31')](_0x12d0f9[_0x7832('0x2c')][_0x7832('0x31')]));_0x408013[_0x7832('0x30')]=_0x408013[_0x7832('0x30')]['length']?_0x408013[_0x7832('0x30')]:_0x49a59e[_0x7832('0x2b')];_0x408013[_0x7832('0x34')]=qs[_0x7832('0x4a')](_0x12d0f9[_0x7832('0x2c')][_0x7832('0x4a')]);_0x408013['where']=qs[_0x7832('0x2e')](_[_0x7832('0x36')](_0x12d0f9[_0x7832('0x2c')],_0x49a59e[_0x7832('0x2e')]));if(_0x12d0f9['query'][_0x7832('0x37')]){_0x408013[_0x7832('0x35')]=_[_0x7832('0x39')](_0x408013[_0x7832('0x35')],{'$or':_['map'](_0x408013[_0x7832('0x30')],function(_0x21ee57){var _0x403c06={};_0x403c06[_0x21ee57]={'$like':'%'+_0x12d0f9[_0x7832('0x2c')][_0x7832('0x37')]+'%'};return _0x403c06;})});}_0x408013=_[_0x7832('0x39')]({},_0x408013,_0x12d0f9[_0x7832('0x3a')]);return _0x2fb3a5[_0x7832('0x47')](_0x408013);}})[_0x7832('0x20')](function(_0x11eed8){if(_0x11eed8){_0x8735dc=_0x11eed8[_0x7832('0x40')];if(!_0x12d0f9['query'][_0x7832('0x32')](_0x7832('0x33'))){_0x408013[_0x7832('0x1c')]=qs[_0x7832('0x1c')](_0x12d0f9[_0x7832('0x2c')]['limit']);_0x408013['offset']=qs[_0x7832('0x19')](_0x12d0f9[_0x7832('0x2c')][_0x7832('0x19')]);}return _0x2fb3a5[_0x7832('0x47')](_0x408013);}})['then'](function(_0x5e0847){if(_0x5e0847){return _0x5e0847?{'count':_0x8735dc,'rows':_0x5e0847}:null;}})[_0x7832('0x20')](respondWithResult(_0x7b9cbd,null))[_0x7832('0x42')](handleError(_0x7b9cbd,null));};exports['getSubjects']=function(_0x35d1f7,_0x14ece2,_0x539c1c){var _0x20873d={};var _0x3b9af1={};var _0x149e02;var _0x234e8c;return db['ZendeskConfiguration'][_0x7832('0x48')]({'where':{'id':_0x35d1f7[_0x7832('0x46')]['id']}})[_0x7832('0x20')](handleEntityNotFound(_0x14ece2,null))[_0x7832('0x20')](function(_0x4bf889){if(_0x4bf889){_0x149e02=_0x4bf889;_0x3b9af1[_0x7832('0x2b')]=_[_0x7832('0x2d')](db[_0x7832('0x49')]['rawAttributes']);_0x3b9af1[_0x7832('0x2c')]=_[_0x7832('0x2d')](_0x35d1f7[_0x7832('0x2c')]);_0x3b9af1[_0x7832('0x2e')]=_[_0x7832('0x2f')](_0x3b9af1[_0x7832('0x2b')],_0x3b9af1[_0x7832('0x2c')]);_0x20873d['attributes']=_[_0x7832('0x2f')](_0x3b9af1[_0x7832('0x2b')],qs[_0x7832('0x31')](_0x35d1f7[_0x7832('0x2c')][_0x7832('0x31')]));_0x20873d['attributes']=_0x20873d['attributes'][_0x7832('0x40')]?_0x20873d[_0x7832('0x30')]:_0x3b9af1[_0x7832('0x2b')];_0x20873d[_0x7832('0x34')]=qs[_0x7832('0x4a')](_0x35d1f7['query'][_0x7832('0x4a')]);_0x20873d[_0x7832('0x35')]=qs[_0x7832('0x2e')](_[_0x7832('0x36')](_0x35d1f7[_0x7832('0x2c')],_0x3b9af1[_0x7832('0x2e')]));if(_0x35d1f7[_0x7832('0x2c')][_0x7832('0x37')]){_0x20873d[_0x7832('0x35')]=_[_0x7832('0x39')](_0x20873d[_0x7832('0x35')],{'$or':_[_0x7832('0x26')](_0x20873d['attributes'],function(_0x16bd7a){var _0x34451b={};_0x34451b[_0x16bd7a]={'$like':'%'+_0x35d1f7[_0x7832('0x2c')][_0x7832('0x37')]+'%'};return _0x34451b;})});}_0x20873d=_['merge']({},_0x20873d,_0x35d1f7[_0x7832('0x3a')]);return _0x149e02[_0x7832('0x4b')](_0x20873d);}})[_0x7832('0x20')](function(_0x506d12){if(_0x506d12){_0x234e8c=_0x506d12[_0x7832('0x40')];if(!_0x35d1f7[_0x7832('0x2c')][_0x7832('0x32')](_0x7832('0x33'))){_0x20873d[_0x7832('0x1c')]=qs[_0x7832('0x1c')](_0x35d1f7[_0x7832('0x2c')][_0x7832('0x1c')]);_0x20873d['offset']=qs['offset'](_0x35d1f7['query'][_0x7832('0x19')]);}return _0x149e02[_0x7832('0x4b')](_0x20873d);}})[_0x7832('0x20')](function(_0xdb5431){if(_0xdb5431){return _0xdb5431?{'count':_0x234e8c,'rows':_0xdb5431}:null;}})['then'](respondWithResult(_0x14ece2,null))[_0x7832('0x42')](handleError(_0x14ece2,null));};exports[_0x7832('0x4c')]=function(_0x1ed41d,_0x3b578e,_0x194111){var _0x3c186c={};var _0x17c470={};var _0x51a735;var _0x4bc218;return db[_0x7832('0x3c')][_0x7832('0x48')]({'where':{'id':_0x1ed41d[_0x7832('0x46')]['id']}})[_0x7832('0x20')](handleEntityNotFound(_0x3b578e,null))['then'](function(_0x35e90d){if(_0x35e90d){_0x51a735=_0x35e90d;_0x17c470[_0x7832('0x2b')]=_['keys'](db[_0x7832('0x49')][_0x7832('0x27')]);_0x17c470['query']=_[_0x7832('0x2d')](_0x1ed41d[_0x7832('0x2c')]);_0x17c470[_0x7832('0x2e')]=_[_0x7832('0x2f')](_0x17c470['model'],_0x17c470['query']);_0x3c186c[_0x7832('0x30')]=_[_0x7832('0x2f')](_0x17c470[_0x7832('0x2b')],qs[_0x7832('0x31')](_0x1ed41d['query'][_0x7832('0x31')]));_0x3c186c['attributes']=_0x3c186c[_0x7832('0x30')][_0x7832('0x40')]?_0x3c186c['attributes']:_0x17c470[_0x7832('0x2b')];_0x3c186c[_0x7832('0x34')]=qs['sort'](_0x1ed41d[_0x7832('0x2c')][_0x7832('0x4a')]);_0x3c186c[_0x7832('0x35')]=qs[_0x7832('0x2e')](_[_0x7832('0x36')](_0x1ed41d[_0x7832('0x2c')],_0x17c470['filters']));if(_0x1ed41d[_0x7832('0x2c')]['filter']){_0x3c186c['where']=_[_0x7832('0x39')](_0x3c186c[_0x7832('0x35')],{'$or':_['map'](_0x3c186c[_0x7832('0x30')],function(_0x11e96d){var _0x157182={};_0x157182[_0x11e96d]={'$like':'%'+_0x1ed41d[_0x7832('0x2c')][_0x7832('0x37')]+'%'};return _0x157182;})});}_0x3c186c=_['merge']({},_0x3c186c,_0x1ed41d[_0x7832('0x3a')]);return _0x51a735['getDescriptions'](_0x3c186c);}})[_0x7832('0x20')](function(_0x22c4de){if(_0x22c4de){_0x4bc218=_0x22c4de[_0x7832('0x40')];if(!_0x1ed41d[_0x7832('0x2c')][_0x7832('0x32')]('nolimit')){_0x3c186c[_0x7832('0x1c')]=qs[_0x7832('0x1c')](_0x1ed41d[_0x7832('0x2c')]['limit']);_0x3c186c[_0x7832('0x19')]=qs[_0x7832('0x19')](_0x1ed41d['query']['offset']);}return _0x51a735[_0x7832('0x4c')](_0x3c186c);}})['then'](function(_0x20dd8a){if(_0x20dd8a){return _0x20dd8a?{'count':_0x4bc218,'rows':_0x20dd8a}:null;}})[_0x7832('0x20')](respondWithResult(_0x3b578e,null))[_0x7832('0x42')](handleError(_0x3b578e,null));};exports[_0x7832('0x4d')]=function(_0x98e29e,_0x210a9e,_0x33b600){var _0x90cdfd={};var _0x36f395={};var _0x4f30eb;var _0x152451;return db[_0x7832('0x3c')][_0x7832('0x48')]({'where':{'id':_0x98e29e[_0x7832('0x46')]['id']}})[_0x7832('0x20')](handleEntityNotFound(_0x210a9e,null))[_0x7832('0x20')](function(_0x454a90){if(_0x454a90){_0x4f30eb=_0x454a90;_0x36f395[_0x7832('0x2b')]=_[_0x7832('0x2d')](db[_0x7832('0x4e')][_0x7832('0x27')]);_0x36f395['query']=_[_0x7832('0x2d')](_0x98e29e[_0x7832('0x2c')]);_0x36f395[_0x7832('0x2e')]=_[_0x7832('0x2f')](_0x36f395[_0x7832('0x2b')],_0x36f395['query']);_0x90cdfd[_0x7832('0x30')]=_[_0x7832('0x2f')](_0x36f395['model'],qs[_0x7832('0x31')](_0x98e29e[_0x7832('0x2c')][_0x7832('0x31')]));_0x90cdfd['attributes']=_0x90cdfd[_0x7832('0x30')][_0x7832('0x40')]?_0x90cdfd['attributes']:_0x36f395['model'];_0x90cdfd['order']=qs[_0x7832('0x4a')](_0x98e29e[_0x7832('0x2c')]['sort']);_0x90cdfd[_0x7832('0x35')]=qs[_0x7832('0x2e')](_[_0x7832('0x36')](_0x98e29e['query'],_0x36f395[_0x7832('0x2e')]));if(_0x98e29e[_0x7832('0x2c')][_0x7832('0x37')]){_0x90cdfd[_0x7832('0x35')]=_[_0x7832('0x39')](_0x90cdfd[_0x7832('0x35')],{'$or':_['map'](_0x90cdfd[_0x7832('0x30')],function(_0x43673f){var _0x400915={};_0x400915[_0x43673f]={'$like':'%'+_0x98e29e['query']['filter']+'%'};return _0x400915;})});}_0x90cdfd=_['merge']({},_0x90cdfd,_0x98e29e['options']);return _0x4f30eb[_0x7832('0x4d')](_0x90cdfd);}})[_0x7832('0x20')](function(_0x1893c7){if(_0x1893c7){_0x152451=_0x1893c7[_0x7832('0x40')];if(!_0x98e29e['query']['hasOwnProperty'](_0x7832('0x33'))){_0x90cdfd[_0x7832('0x1c')]=qs['limit'](_0x98e29e[_0x7832('0x2c')][_0x7832('0x1c')]);_0x90cdfd[_0x7832('0x19')]=qs[_0x7832('0x19')](_0x98e29e[_0x7832('0x2c')][_0x7832('0x19')]);}return _0x4f30eb[_0x7832('0x4d')](_0x90cdfd);}})[_0x7832('0x20')](function(_0x2a2057){if(_0x2a2057){return _0x2a2057?{'count':_0x152451,'rows':_0x2a2057}:null;}})['then'](respondWithResult(_0x210a9e,null))[_0x7832('0x42')](handleError(_0x210a9e,null));};exports[_0x7832('0x4f')]=function(_0xa63b51,_0x5af05d,_0x1ccc4b){if(_0xa63b51['body']['id']){delete _0xa63b51[_0x7832('0x44')]['id'];}return db['ZendeskConfiguration'][_0x7832('0x48')]({'where':{'id':_0xa63b51[_0x7832('0x46')]['id']}})['then'](handleEntityNotFound(_0x5af05d,null))[_0x7832('0x20')](function(_0x221923){if(_0x221923){return _0x221923[_0x7832('0x4f')](_0xa63b51[_0x7832('0x44')][_0x7832('0x50')]||[]);}return null;})[_0x7832('0x20')](respondWithResult(_0x5af05d,null))[_0x7832('0x42')](handleError(_0x5af05d,null));}; \ No newline at end of file +var _0x6083=['fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','findAll','catch','show','params','create','body','find','getFields','pick','getSubjects','findOne','ZendeskField','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','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','apply','reject','save','update','then','error','stack','name','index','ZendeskConfiguration','rawAttributes'];(function(_0x1faaa1,_0x1568dd){var _0x994ec=function(_0x298ef4){while(--_0x298ef4){_0x1faaa1['push'](_0x1faaa1['shift']());}};_0x994ec(++_0x1568dd);}(_0x6083,0x1b5));var _0x3608=function(_0x50244b,_0x1421dd){_0x50244b=_0x50244b-0x0;var _0x426eba=_0x6083[_0x50244b];return _0x426eba;};'use strict';var emlformat=require(_0x3608('0x0'));var rimraf=require(_0x3608('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3608('0x2'));var moment=require(_0x3608('0x3'));var BPromise=require(_0x3608('0x4'));var Mustache=require(_0x3608('0x5'));var util=require(_0x3608('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x3608('0x7'));var ejs=require(_0x3608('0x8'));var fs=require('fs');var fs_extra=require(_0x3608('0x9'));var _=require(_0x3608('0xa'));var squel=require(_0x3608('0xb'));var crypto=require('crypto');var jsforce=require(_0x3608('0xc'));var deskjs=require(_0x3608('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3608('0xe'));var Papa=require(_0x3608('0xf'));var Redis=require('ioredis');var authService=require(_0x3608('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3608('0x11'));var hardwareService=require(_0x3608('0x12'));var logger=require(_0x3608('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x3608('0x14'));var licenseUtil=require(_0x3608('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e98c4,_0x241170){_0x241170=_0x241170||0xcc;return function(_0x37c863){if(_0x37c863){return _0x4e98c4[_0x3608('0x16')](_0x241170);}return _0x4e98c4[_0x3608('0x17')](_0x241170)[_0x3608('0x18')]();};}function respondWithResult(_0x418add,_0x220226){_0x220226=_0x220226||0xc8;return function(_0xb8cc21){if(_0xb8cc21){return _0x418add['status'](_0x220226)[_0x3608('0x19')](_0xb8cc21);}};}function respondWithFilteredResult(_0x2cc96d,_0x21b737){return function(_0x88d0a2){if(_0x88d0a2){var _0x3967a3=typeof _0x21b737[_0x3608('0x1a')]===_0x3608('0x1b')&&typeof _0x21b737[_0x3608('0x1c')]==='undefined';var _0x345a07=_0x88d0a2[_0x3608('0x1d')];var _0x1cd586=_0x3967a3?0x0:_0x21b737[_0x3608('0x1a')];var _0x233ec4=_0x3967a3?_0x88d0a2['count']:_0x21b737['offset']+_0x21b737[_0x3608('0x1c')];var _0x148f15;if(_0x233ec4>=_0x345a07){_0x233ec4=_0x345a07;_0x148f15=0xc8;}else{_0x148f15=0xce;}_0x2cc96d[_0x3608('0x17')](_0x148f15);return _0x2cc96d[_0x3608('0x1e')](_0x3608('0x1f'),_0x1cd586+'-'+_0x233ec4+'/'+_0x345a07)[_0x3608('0x19')](_0x88d0a2);}return null;};}function patchUpdates(_0x1ee79d){return function(_0x4c4f4f){try{jsonpatch[_0x3608('0x20')](_0x4c4f4f,_0x1ee79d,!![]);}catch(_0xb343a7){return BPromise[_0x3608('0x21')](_0xb343a7);}return _0x4c4f4f[_0x3608('0x22')]();};}function saveUpdates(_0x1edb75,_0x3bce25){return function(_0x23e47b){if(_0x23e47b){return _0x23e47b[_0x3608('0x23')](_0x1edb75)['then'](function(_0x20432f){return _0x20432f;});}return null;};}function removeEntity(_0x2dc53a,_0x3c3de1){return function(_0x23c81e){if(_0x23c81e){return _0x23c81e['destroy']()[_0x3608('0x24')](function(){_0x2dc53a[_0x3608('0x17')](0xcc)[_0x3608('0x18')]();});}};}function handleEntityNotFound(_0x4bbaa5,_0x5aaf69){return function(_0x10237c){if(!_0x10237c){_0x4bbaa5[_0x3608('0x16')](0x194);}return _0x10237c;};}function handleError(_0x3b5baa,_0x19bc7e){_0x19bc7e=_0x19bc7e||0x1f4;return function(_0x9f63dc){logger[_0x3608('0x25')](_0x9f63dc[_0x3608('0x26')]);if(_0x9f63dc[_0x3608('0x27')]){delete _0x9f63dc['name'];}_0x3b5baa[_0x3608('0x17')](_0x19bc7e)['send'](_0x9f63dc);};}exports[_0x3608('0x28')]=function(_0x2394f1,_0x44f4a1){var _0x5899ef={},_0x5733e7={},_0x5b007e={'count':0x0,'rows':[]};var _0x245801=_['map'](db[_0x3608('0x29')][_0x3608('0x2a')],function(_0x53f3f3){return{'name':_0x53f3f3[_0x3608('0x2b')],'type':_0x53f3f3[_0x3608('0x2c')]['key']};});_0x5733e7[_0x3608('0x2d')]=_[_0x3608('0x2e')](_0x245801,_0x3608('0x27'));_0x5733e7[_0x3608('0x2f')]=_[_0x3608('0x30')](_0x2394f1['query']);_0x5733e7[_0x3608('0x31')]=_[_0x3608('0x32')](_0x5733e7[_0x3608('0x2d')],_0x5733e7[_0x3608('0x2f')]);_0x5899ef['attributes']=_[_0x3608('0x32')](_0x5733e7[_0x3608('0x2d')],qs['fields'](_0x2394f1['query'][_0x3608('0x33')]));_0x5899ef['attributes']=_0x5899ef[_0x3608('0x34')][_0x3608('0x35')]?_0x5899ef[_0x3608('0x34')]:_0x5733e7[_0x3608('0x2d')];if(!_0x2394f1[_0x3608('0x2f')][_0x3608('0x36')](_0x3608('0x37'))){_0x5899ef[_0x3608('0x1c')]=qs[_0x3608('0x1c')](_0x2394f1[_0x3608('0x2f')]['limit']);_0x5899ef[_0x3608('0x1a')]=qs[_0x3608('0x1a')](_0x2394f1[_0x3608('0x2f')]['offset']);}_0x5899ef[_0x3608('0x38')]=qs[_0x3608('0x39')](_0x2394f1[_0x3608('0x2f')][_0x3608('0x39')]);_0x5899ef[_0x3608('0x3a')]=qs[_0x3608('0x31')](_['pick'](_0x2394f1[_0x3608('0x2f')],_0x5733e7[_0x3608('0x31')]),_0x245801);if(_0x2394f1[_0x3608('0x2f')][_0x3608('0x3b')]){_0x5899ef[_0x3608('0x3a')]=_[_0x3608('0x3c')](_0x5899ef[_0x3608('0x3a')],{'$or':_['map'](_0x245801,function(_0x169990){if(_0x169990[_0x3608('0x2c')]!=='VIRTUAL'){var _0x3de4f8={};_0x3de4f8[_0x169990[_0x3608('0x27')]]={'$like':'%'+_0x2394f1[_0x3608('0x2f')][_0x3608('0x3b')]+'%'};return _0x3de4f8;}})});}_0x5899ef=_[_0x3608('0x3c')]({},_0x5899ef,_0x2394f1[_0x3608('0x3d')]);var _0x152db4={'where':_0x5899ef['where']};return db[_0x3608('0x29')][_0x3608('0x1d')](_0x152db4)[_0x3608('0x24')](function(_0x106fa5){_0x5b007e[_0x3608('0x1d')]=_0x106fa5;if(_0x2394f1[_0x3608('0x2f')]['includeAll']){_0x5899ef[_0x3608('0x3e')]=[{'all':!![]}];}return db[_0x3608('0x29')][_0x3608('0x3f')](_0x5899ef);})[_0x3608('0x24')](function(_0x2ebcf4){_0x5b007e['rows']=_0x2ebcf4;return _0x5b007e;})[_0x3608('0x24')](respondWithFilteredResult(_0x44f4a1,_0x5899ef))[_0x3608('0x40')](handleError(_0x44f4a1,null));};exports[_0x3608('0x41')]=function(_0x16196a,_0x56ed1d){var _0x4e6e9d={'raw':![],'where':{'id':_0x16196a[_0x3608('0x42')]['id']}},_0x390100={};_0x390100[_0x3608('0x2d')]=_['keys'](db[_0x3608('0x29')]['rawAttributes']);_0x390100[_0x3608('0x2f')]=_[_0x3608('0x30')](_0x16196a[_0x3608('0x2f')]);_0x390100[_0x3608('0x31')]=_[_0x3608('0x32')](_0x390100[_0x3608('0x2d')],_0x390100[_0x3608('0x2f')]);_0x4e6e9d['attributes']=_[_0x3608('0x32')](_0x390100[_0x3608('0x2d')],qs[_0x3608('0x33')](_0x16196a['query'][_0x3608('0x33')]));_0x4e6e9d[_0x3608('0x34')]=_0x4e6e9d[_0x3608('0x34')][_0x3608('0x35')]?_0x4e6e9d[_0x3608('0x34')]:_0x390100['model'];if(_0x16196a[_0x3608('0x2f')]['includeAll']){_0x4e6e9d[_0x3608('0x3e')]=[{'all':!![]}];}_0x4e6e9d=_[_0x3608('0x3c')]({},_0x4e6e9d,_0x16196a[_0x3608('0x3d')]);return db[_0x3608('0x29')]['find'](_0x4e6e9d)[_0x3608('0x24')](handleEntityNotFound(_0x56ed1d,null))[_0x3608('0x24')](respondWithResult(_0x56ed1d,null))[_0x3608('0x40')](handleError(_0x56ed1d,null));};exports[_0x3608('0x43')]=function(_0x5afb3a,_0x42f081){return db[_0x3608('0x29')]['create'](_0x5afb3a[_0x3608('0x44')],{})[_0x3608('0x24')](respondWithResult(_0x42f081,0xc9))[_0x3608('0x40')](handleError(_0x42f081,null));};exports[_0x3608('0x23')]=function(_0x3c6fa7,_0x5deaa7){if(_0x3c6fa7[_0x3608('0x44')]['id']){delete _0x3c6fa7[_0x3608('0x44')]['id'];}return db[_0x3608('0x29')][_0x3608('0x45')]({'where':{'id':_0x3c6fa7[_0x3608('0x42')]['id']}})[_0x3608('0x24')](handleEntityNotFound(_0x5deaa7,null))[_0x3608('0x24')](saveUpdates(_0x3c6fa7[_0x3608('0x44')],null))['then'](respondWithResult(_0x5deaa7,null))[_0x3608('0x40')](handleError(_0x5deaa7,null));};exports['destroy']=function(_0x22c521,_0xc0229d){return db[_0x3608('0x29')][_0x3608('0x45')]({'where':{'id':_0x22c521[_0x3608('0x42')]['id']}})[_0x3608('0x24')](handleEntityNotFound(_0xc0229d,null))[_0x3608('0x24')](removeEntity(_0xc0229d,null))[_0x3608('0x40')](handleError(_0xc0229d,null));};exports[_0x3608('0x46')]=function(_0x3780df,_0x1941b5,_0x38b92f){var _0x938bae={};var _0xe0f03b={};var _0x1cbfa4;var _0x36ef39;return db[_0x3608('0x29')]['findOne']({'where':{'id':_0x3780df[_0x3608('0x42')]['id']}})[_0x3608('0x24')](handleEntityNotFound(_0x1941b5,null))[_0x3608('0x24')](function(_0x2f228a){if(_0x2f228a){_0x1cbfa4=_0x2f228a;_0xe0f03b[_0x3608('0x2d')]=_[_0x3608('0x30')](db['ZendeskField'][_0x3608('0x2a')]);_0xe0f03b[_0x3608('0x2f')]=_[_0x3608('0x30')](_0x3780df[_0x3608('0x2f')]);_0xe0f03b[_0x3608('0x31')]=_['intersection'](_0xe0f03b[_0x3608('0x2d')],_0xe0f03b[_0x3608('0x2f')]);_0x938bae['attributes']=_[_0x3608('0x32')](_0xe0f03b[_0x3608('0x2d')],qs[_0x3608('0x33')](_0x3780df[_0x3608('0x2f')][_0x3608('0x33')]));_0x938bae['attributes']=_0x938bae['attributes'][_0x3608('0x35')]?_0x938bae[_0x3608('0x34')]:_0xe0f03b[_0x3608('0x2d')];_0x938bae['order']=qs[_0x3608('0x39')](_0x3780df[_0x3608('0x2f')][_0x3608('0x39')]);_0x938bae['where']=qs[_0x3608('0x31')](_[_0x3608('0x47')](_0x3780df['query'],_0xe0f03b[_0x3608('0x31')]));if(_0x3780df[_0x3608('0x2f')][_0x3608('0x3b')]){_0x938bae[_0x3608('0x3a')]=_['merge'](_0x938bae[_0x3608('0x3a')],{'$or':_[_0x3608('0x2e')](_0x938bae[_0x3608('0x34')],function(_0x4ce4dc){var _0x564440={};_0x564440[_0x4ce4dc]={'$like':'%'+_0x3780df[_0x3608('0x2f')][_0x3608('0x3b')]+'%'};return _0x564440;})});}_0x938bae=_['merge']({},_0x938bae,_0x3780df[_0x3608('0x3d')]);return _0x1cbfa4['getFields'](_0x938bae);}})[_0x3608('0x24')](function(_0x1f3305){if(_0x1f3305){_0x36ef39=_0x1f3305[_0x3608('0x35')];if(!_0x3780df[_0x3608('0x2f')]['hasOwnProperty'](_0x3608('0x37'))){_0x938bae[_0x3608('0x1c')]=qs[_0x3608('0x1c')](_0x3780df[_0x3608('0x2f')]['limit']);_0x938bae[_0x3608('0x1a')]=qs[_0x3608('0x1a')](_0x3780df[_0x3608('0x2f')][_0x3608('0x1a')]);}return _0x1cbfa4['getFields'](_0x938bae);}})[_0x3608('0x24')](function(_0x2f0b3e){if(_0x2f0b3e){return _0x2f0b3e?{'count':_0x36ef39,'rows':_0x2f0b3e}:null;}})[_0x3608('0x24')](respondWithResult(_0x1941b5,null))[_0x3608('0x40')](handleError(_0x1941b5,null));};exports[_0x3608('0x48')]=function(_0x26159b,_0x9343ec,_0x49b6d8){var _0x429295={};var _0x2f4992={};var _0x5dfac1;var _0x37f4ba;return db[_0x3608('0x29')][_0x3608('0x49')]({'where':{'id':_0x26159b['params']['id']}})['then'](handleEntityNotFound(_0x9343ec,null))[_0x3608('0x24')](function(_0x4b34bd){if(_0x4b34bd){_0x5dfac1=_0x4b34bd;_0x2f4992['model']=_[_0x3608('0x30')](db[_0x3608('0x4a')][_0x3608('0x2a')]);_0x2f4992[_0x3608('0x2f')]=_[_0x3608('0x30')](_0x26159b[_0x3608('0x2f')]);_0x2f4992[_0x3608('0x31')]=_[_0x3608('0x32')](_0x2f4992[_0x3608('0x2d')],_0x2f4992[_0x3608('0x2f')]);_0x429295[_0x3608('0x34')]=_[_0x3608('0x32')](_0x2f4992[_0x3608('0x2d')],qs[_0x3608('0x33')](_0x26159b['query']['fields']));_0x429295[_0x3608('0x34')]=_0x429295[_0x3608('0x34')][_0x3608('0x35')]?_0x429295[_0x3608('0x34')]:_0x2f4992[_0x3608('0x2d')];_0x429295['order']=qs[_0x3608('0x39')](_0x26159b[_0x3608('0x2f')][_0x3608('0x39')]);_0x429295[_0x3608('0x3a')]=qs[_0x3608('0x31')](_[_0x3608('0x47')](_0x26159b[_0x3608('0x2f')],_0x2f4992['filters']));if(_0x26159b['query'][_0x3608('0x3b')]){_0x429295[_0x3608('0x3a')]=_[_0x3608('0x3c')](_0x429295[_0x3608('0x3a')],{'$or':_[_0x3608('0x2e')](_0x429295[_0x3608('0x34')],function(_0x3968d9){var _0x33aa9c={};_0x33aa9c[_0x3968d9]={'$like':'%'+_0x26159b[_0x3608('0x2f')]['filter']+'%'};return _0x33aa9c;})});}_0x429295=_[_0x3608('0x3c')]({},_0x429295,_0x26159b['options']);return _0x5dfac1[_0x3608('0x48')](_0x429295);}})[_0x3608('0x24')](function(_0x338fdb){if(_0x338fdb){_0x37f4ba=_0x338fdb['length'];if(!_0x26159b[_0x3608('0x2f')]['hasOwnProperty'](_0x3608('0x37'))){_0x429295['limit']=qs[_0x3608('0x1c')](_0x26159b['query'][_0x3608('0x1c')]);_0x429295[_0x3608('0x1a')]=qs[_0x3608('0x1a')](_0x26159b[_0x3608('0x2f')]['offset']);}return _0x5dfac1['getSubjects'](_0x429295);}})[_0x3608('0x24')](function(_0x4cbeb1){if(_0x4cbeb1){return _0x4cbeb1?{'count':_0x37f4ba,'rows':_0x4cbeb1}:null;}})[_0x3608('0x24')](respondWithResult(_0x9343ec,null))[_0x3608('0x40')](handleError(_0x9343ec,null));};exports[_0x3608('0x4b')]=function(_0x1e678f,_0x437b7a,_0x1c8918){var _0x1e0fc2={};var _0x547607={};var _0x3b72c9;var _0x45a26b;return db[_0x3608('0x29')][_0x3608('0x49')]({'where':{'id':_0x1e678f['params']['id']}})[_0x3608('0x24')](handleEntityNotFound(_0x437b7a,null))[_0x3608('0x24')](function(_0x404bb8){if(_0x404bb8){_0x3b72c9=_0x404bb8;_0x547607[_0x3608('0x2d')]=_[_0x3608('0x30')](db[_0x3608('0x4a')][_0x3608('0x2a')]);_0x547607['query']=_[_0x3608('0x30')](_0x1e678f[_0x3608('0x2f')]);_0x547607[_0x3608('0x31')]=_[_0x3608('0x32')](_0x547607[_0x3608('0x2d')],_0x547607[_0x3608('0x2f')]);_0x1e0fc2[_0x3608('0x34')]=_[_0x3608('0x32')](_0x547607['model'],qs[_0x3608('0x33')](_0x1e678f['query']['fields']));_0x1e0fc2[_0x3608('0x34')]=_0x1e0fc2['attributes']['length']?_0x1e0fc2['attributes']:_0x547607[_0x3608('0x2d')];_0x1e0fc2['order']=qs[_0x3608('0x39')](_0x1e678f[_0x3608('0x2f')][_0x3608('0x39')]);_0x1e0fc2[_0x3608('0x3a')]=qs[_0x3608('0x31')](_[_0x3608('0x47')](_0x1e678f[_0x3608('0x2f')],_0x547607[_0x3608('0x31')]));if(_0x1e678f[_0x3608('0x2f')]['filter']){_0x1e0fc2[_0x3608('0x3a')]=_[_0x3608('0x3c')](_0x1e0fc2['where'],{'$or':_[_0x3608('0x2e')](_0x1e0fc2[_0x3608('0x34')],function(_0x7c6259){var _0x5d0e7c={};_0x5d0e7c[_0x7c6259]={'$like':'%'+_0x1e678f[_0x3608('0x2f')][_0x3608('0x3b')]+'%'};return _0x5d0e7c;})});}_0x1e0fc2=_['merge']({},_0x1e0fc2,_0x1e678f[_0x3608('0x3d')]);return _0x3b72c9[_0x3608('0x4b')](_0x1e0fc2);}})[_0x3608('0x24')](function(_0x264a57){if(_0x264a57){_0x45a26b=_0x264a57['length'];if(!_0x1e678f['query']['hasOwnProperty']('nolimit')){_0x1e0fc2[_0x3608('0x1c')]=qs[_0x3608('0x1c')](_0x1e678f[_0x3608('0x2f')][_0x3608('0x1c')]);_0x1e0fc2['offset']=qs[_0x3608('0x1a')](_0x1e678f[_0x3608('0x2f')][_0x3608('0x1a')]);}return _0x3b72c9[_0x3608('0x4b')](_0x1e0fc2);}})[_0x3608('0x24')](function(_0x360c7f){if(_0x360c7f){return _0x360c7f?{'count':_0x45a26b,'rows':_0x360c7f}:null;}})['then'](respondWithResult(_0x437b7a,null))['catch'](handleError(_0x437b7a,null));};exports['getTags']=function(_0x8eaf37,_0x1c7e60,_0x68bbb){var _0x546abb={};var _0x19fd65={};var _0x59b3c5;var _0x333d5b;return db[_0x3608('0x29')][_0x3608('0x49')]({'where':{'id':_0x8eaf37[_0x3608('0x42')]['id']}})['then'](handleEntityNotFound(_0x1c7e60,null))['then'](function(_0x169468){if(_0x169468){_0x59b3c5=_0x169468;_0x19fd65[_0x3608('0x2d')]=_['keys'](db[_0x3608('0x4c')]['rawAttributes']);_0x19fd65[_0x3608('0x2f')]=_[_0x3608('0x30')](_0x8eaf37[_0x3608('0x2f')]);_0x19fd65[_0x3608('0x31')]=_[_0x3608('0x32')](_0x19fd65['model'],_0x19fd65['query']);_0x546abb[_0x3608('0x34')]=_['intersection'](_0x19fd65['model'],qs[_0x3608('0x33')](_0x8eaf37[_0x3608('0x2f')][_0x3608('0x33')]));_0x546abb[_0x3608('0x34')]=_0x546abb['attributes']['length']?_0x546abb['attributes']:_0x19fd65[_0x3608('0x2d')];_0x546abb['order']=qs[_0x3608('0x39')](_0x8eaf37[_0x3608('0x2f')][_0x3608('0x39')]);_0x546abb[_0x3608('0x3a')]=qs[_0x3608('0x31')](_[_0x3608('0x47')](_0x8eaf37[_0x3608('0x2f')],_0x19fd65['filters']));if(_0x8eaf37[_0x3608('0x2f')]['filter']){_0x546abb[_0x3608('0x3a')]=_[_0x3608('0x3c')](_0x546abb[_0x3608('0x3a')],{'$or':_['map'](_0x546abb[_0x3608('0x34')],function(_0x52209a){var _0x372cdd={};_0x372cdd[_0x52209a]={'$like':'%'+_0x8eaf37[_0x3608('0x2f')][_0x3608('0x3b')]+'%'};return _0x372cdd;})});}_0x546abb=_[_0x3608('0x3c')]({},_0x546abb,_0x8eaf37[_0x3608('0x3d')]);return _0x59b3c5['getTags'](_0x546abb);}})[_0x3608('0x24')](function(_0x56b9cc){if(_0x56b9cc){_0x333d5b=_0x56b9cc[_0x3608('0x35')];if(!_0x8eaf37[_0x3608('0x2f')][_0x3608('0x36')](_0x3608('0x37'))){_0x546abb[_0x3608('0x1c')]=qs[_0x3608('0x1c')](_0x8eaf37[_0x3608('0x2f')]['limit']);_0x546abb[_0x3608('0x1a')]=qs[_0x3608('0x1a')](_0x8eaf37['query'][_0x3608('0x1a')]);}return _0x59b3c5[_0x3608('0x4d')](_0x546abb);}})[_0x3608('0x24')](function(_0x31808e){if(_0x31808e){return _0x31808e?{'count':_0x333d5b,'rows':_0x31808e}:null;}})[_0x3608('0x24')](respondWithResult(_0x1c7e60,null))[_0x3608('0x40')](handleError(_0x1c7e60,null));};exports[_0x3608('0x4e')]=function(_0x1c4909,_0x37b1da,_0x2d4d7e){if(_0x1c4909['body']['id']){delete _0x1c4909[_0x3608('0x44')]['id'];}return db[_0x3608('0x29')]['findOne']({'where':{'id':_0x1c4909[_0x3608('0x42')]['id']}})['then'](handleEntityNotFound(_0x37b1da,null))[_0x3608('0x24')](function(_0x35e637){if(_0x35e637){return _0x35e637[_0x3608('0x4e')](_0x1c4909['body'][_0x3608('0x4f')]||[]);}return null;})[_0x3608('0x24')](respondWithResult(_0x37b1da,null))['catch'](handleError(_0x37b1da,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 8fe70ea..84a7560 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 _0x236c=['../../config/environment','./intZendeskConfiguration.attributes','exports','ZendeskConfiguration','int_zendesk_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x52cc57,_0x556302){var _0x11bcd7=function(_0x11ad99){while(--_0x11ad99){_0x52cc57['push'](_0x52cc57['shift']());}};_0x11bcd7(++_0x556302);}(_0x236c,0x155));var _0xc236=function(_0x18b4fa,_0x8f5df){_0x18b4fa=_0x18b4fa-0x0;var _0x302000=_0x236c[_0x18b4fa];return _0x302000;};'use strict';var _=require(_0xc236('0x0'));var util=require('util');var logger=require(_0xc236('0x1'))(_0xc236('0x2'));var moment=require(_0xc236('0x3'));var BPromise=require(_0xc236('0x4'));var rp=require(_0xc236('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc236('0x6'));var config=require(_0xc236('0x7'));var attributes=require(_0xc236('0x8'));module[_0xc236('0x9')]=function(_0x23d3cc,_0x461c3a){return _0x23d3cc['define'](_0xc236('0xa'),attributes,{'tableName':_0xc236('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x93e9=['moment','bluebird','request-promise','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api'];(function(_0x8fc976,_0x4a8b06){var _0x5c4f9d=function(_0x4170e7){while(--_0x4170e7){_0x8fc976['push'](_0x8fc976['shift']());}};_0x5c4f9d(++_0x4a8b06);}(_0x93e9,0xcc));var _0x993e=function(_0x29c530,_0x28b04b){_0x29c530=_0x29c530-0x0;var _0x567205=_0x93e9[_0x29c530];return _0x567205;};'use strict';var _=require(_0x993e('0x0'));var util=require(_0x993e('0x1'));var logger=require(_0x993e('0x2'))(_0x993e('0x3'));var moment=require(_0x993e('0x4'));var BPromise=require(_0x993e('0x5'));var rp=require(_0x993e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x993e('0x7'));var attributes=require(_0x993e('0x8'));module[_0x993e('0x9')]=function(_0x45f52e,_0x1da414){return _0x45f52e[_0x993e('0xa')](_0x993e('0xb'),attributes,{'tableName':_0x993e('0xc'),'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 e89dc05..06990f4 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 _0x71a6=['result','catch','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x7a693,_0x1e5144){var _0x38dc11=function(_0x1f00d3){while(--_0x1f00d3){_0x7a693['push'](_0x7a693['shift']());}};_0x38dc11(++_0x1e5144);}(_0x71a6,0xd1));var _0x671a=function(_0x3b56c0,_0xe100d8){_0x3b56c0=_0x3b56c0-0x0;var _0x377efe=_0x71a6[_0x3b56c0];return _0x377efe;};'use strict';var _=require(_0x671a('0x0'));var util=require(_0x671a('0x1'));var moment=require('moment');var BPromise=require(_0x671a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x671a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x671a('0x4'))(_0x671a('0x5'));var config=require(_0x671a('0x6'));var jayson=require(_0x671a('0x7'));var client=jayson[_0x671a('0x8')][_0x671a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b2b17,_0x163cd7,_0x163f2c){return new BPromise(function(_0x4a2983,_0x16372b){return client[_0x671a('0xa')](_0x1b2b17,_0x163f2c)[_0x671a('0xb')](function(_0x2b8f59){logger[_0x671a('0xc')](_0x671a('0xd'),_0x163cd7,'request\x20sent');logger[_0x671a('0xe')](_0x671a('0xf'),_0x163cd7,_0x671a('0x10'),JSON[_0x671a('0x11')](_0x2b8f59));if(_0x2b8f59[_0x671a('0x12')]){if(_0x2b8f59['error'][_0x671a('0x13')]===0x1f4){logger[_0x671a('0x12')](_0x671a('0xd'),_0x163cd7,_0x2b8f59['error'][_0x671a('0x14')]);return _0x16372b(_0x2b8f59[_0x671a('0x12')][_0x671a('0x14')]);}logger[_0x671a('0x12')](_0x671a('0xd'),_0x163cd7,_0x2b8f59[_0x671a('0x12')][_0x671a('0x14')]);return _0x4a2983(_0x2b8f59[_0x671a('0x12')][_0x671a('0x14')]);}else{logger[_0x671a('0xc')](_0x671a('0xd'),_0x163cd7,_0x671a('0x10'));_0x4a2983(_0x2b8f59[_0x671a('0x15')][_0x671a('0x14')]);}})[_0x671a('0x16')](function(_0x58ace2){logger[_0x671a('0x12')](_0x671a('0xd'),_0x163cd7,_0x58ace2);_0x16372b(_0x58ace2);});});} \ No newline at end of file +var _0x7d16=['moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x461d7a,_0x555a95){var _0x43905e=function(_0x27c578){while(--_0x27c578){_0x461d7a['push'](_0x461d7a['shift']());}};_0x43905e(++_0x555a95);}(_0x7d16,0x1e2));var _0x67d1=function(_0x2489f2,_0x4189ce){_0x2489f2=_0x2489f2-0x0;var _0x3af61b=_0x7d16[_0x2489f2];return _0x3af61b;};'use strict';var _=require(_0x67d1('0x0'));var util=require(_0x67d1('0x1'));var moment=require(_0x67d1('0x2'));var BPromise=require(_0x67d1('0x3'));var rs=require(_0x67d1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x67d1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x67d1('0x6'))(_0x67d1('0x7'));var config=require(_0x67d1('0x8'));var jayson=require(_0x67d1('0x9'));var client=jayson[_0x67d1('0xa')][_0x67d1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3bd16f,_0x29f17b,_0x43b899){return new BPromise(function(_0x1ceb55,_0x91c6fe){return client[_0x67d1('0xc')](_0x3bd16f,_0x43b899)[_0x67d1('0xd')](function(_0xb493cb){logger[_0x67d1('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0x29f17b,_0x67d1('0xf'));logger['debug']('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x29f17b,_0x67d1('0xf'),JSON[_0x67d1('0x10')](_0xb493cb));if(_0xb493cb[_0x67d1('0x11')]){if(_0xb493cb[_0x67d1('0x11')]['code']===0x1f4){logger[_0x67d1('0x11')](_0x67d1('0x12'),_0x29f17b,_0xb493cb[_0x67d1('0x11')][_0x67d1('0x13')]);return _0x91c6fe(_0xb493cb[_0x67d1('0x11')]['message']);}logger['error'](_0x67d1('0x12'),_0x29f17b,_0xb493cb[_0x67d1('0x11')][_0x67d1('0x13')]);return _0x1ceb55(_0xb493cb[_0x67d1('0x11')][_0x67d1('0x13')]);}else{logger[_0x67d1('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0x29f17b,_0x67d1('0xf'));_0x1ceb55(_0xb493cb[_0x67d1('0x14')][_0x67d1('0x13')]);}})[_0x67d1('0x15')](function(_0x5e23e7){logger[_0x67d1('0x11')](_0x67d1('0x12'),_0x29f17b,_0x5e23e7);_0x91c6fe(_0x5e23e7);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 27f7b06..c59e474 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 _0x509c=['update','exports','multer','util','path','connect-timeout','express','fs-extra','./intZendeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x3287f4,_0x131a75){var _0x4f6d7e=function(_0x431e12){while(--_0x431e12){_0x3287f4['push'](_0x3287f4['shift']());}};_0x4f6d7e(++_0x131a75);}(_0x509c,0x189));var _0xc509=function(_0x43d895,_0x4b61b9){_0x43d895=_0x43d895-0x0;var _0x156002=_0x509c[_0x43d895];return _0x156002;};'use strict';var multer=require(_0xc509('0x0'));var util=require(_0xc509('0x1'));var path=require(_0xc509('0x2'));var timeout=require(_0xc509('0x3'));var express=require(_0xc509('0x4'));var router=express['Router']();var fs_extra=require(_0xc509('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc509('0x6'));router[_0xc509('0x7')]('/',auth[_0xc509('0x8')](),controller[_0xc509('0x9')]);router[_0xc509('0x7')](_0xc509('0xa'),auth[_0xc509('0x8')](),controller[_0xc509('0xb')]);router[_0xc509('0xc')]('/',auth[_0xc509('0x8')](),controller[_0xc509('0xd')]);router[_0xc509('0xe')]('/:id',auth[_0xc509('0x8')](),controller[_0xc509('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xc509('0x10')]=router; \ No newline at end of file +var _0xc839=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','put','delete','path','express','fs-extra'];(function(_0x32e306,_0x5f17e7){var _0x431a42=function(_0x430b05){while(--_0x430b05){_0x32e306['push'](_0x32e306['shift']());}};_0x431a42(++_0x5f17e7);}(_0xc839,0x1eb));var _0x9c83=function(_0x19a86e,_0x4ddc85){_0x19a86e=_0x19a86e-0x0;var _0x56837e=_0xc839[_0x19a86e];return _0x56837e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9c83('0x0'));var timeout=require('connect-timeout');var express=require(_0x9c83('0x1'));var router=express['Router']();var fs_extra=require(_0x9c83('0x2'));var auth=require(_0x9c83('0x3'));var interaction=require(_0x9c83('0x4'));var config=require(_0x9c83('0x5'));var controller=require('./intZendeskField.controller');router[_0x9c83('0x6')]('/',auth[_0x9c83('0x7')](),controller['index']);router[_0x9c83('0x6')](_0x9c83('0x8'),auth[_0x9c83('0x7')](),controller[_0x9c83('0x9')]);router[_0x9c83('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9c83('0xb')](_0x9c83('0x8'),auth[_0x9c83('0x7')](),controller['update']);router[_0x9c83('0xc')](_0x9c83('0x8'),auth[_0x9c83('0x7')](),controller['destroy']);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 0e1afba..88d38b6 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 _0x4972=['exports','ENUM','string','variable','customVariable','picklist','STRING','BOOLEAN','sequelize'];(function(_0x4c0c6b,_0x524d36){var _0xf8b86c=function(_0xb633de){while(--_0xb633de){_0x4c0c6b['push'](_0x4c0c6b['shift']());}};_0xf8b86c(++_0x524d36);}(_0x4972,0x7d));var _0x2497=function(_0x190d49,_0x4a26f8){_0x190d49=_0x190d49-0x0;var _0x37998a=_0x4972[_0x190d49];return _0x37998a;};'use strict';var Sequelize=require(_0x2497('0x0'));module[_0x2497('0x1')]={'type':{'type':Sequelize[_0x2497('0x2')](_0x2497('0x3'),_0x2497('0x4'),_0x2497('0x5'),'keyValue',_0x2497('0x6')),'defaultValue':_0x2497('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x2497('0x7')]},'keyType':{'type':Sequelize[_0x2497('0x2')](_0x2497('0x3'),_0x2497('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x2497('0x7')]},'idField':{'type':Sequelize[_0x2497('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x2497('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2497('0x7')]}}; \ No newline at end of file +var _0xa8fe=['STRING','BOOLEAN','sequelize','exports','ENUM','string','customVariable','keyValue','picklist'];(function(_0x4688f3,_0x36fa36){var _0x3cb0b9=function(_0x50daea){while(--_0x50daea){_0x4688f3['push'](_0x4688f3['shift']());}};_0x3cb0b9(++_0x36fa36);}(_0xa8fe,0xf5));var _0xea8f=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xa8fe[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0xea8f('0x0'));module[_0xea8f('0x1')]={'type':{'type':Sequelize[_0xea8f('0x2')](_0xea8f('0x3'),'variable',_0xea8f('0x4'),_0xea8f('0x5'),_0xea8f('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xea8f('0x7')]},'key':{'type':Sequelize[_0xea8f('0x7')]},'keyType':{'type':Sequelize[_0xea8f('0x2')](_0xea8f('0x3'),'variable',_0xea8f('0x4'))},'keyContent':{'type':Sequelize[_0xea8f('0x7')]},'idField':{'type':Sequelize[_0xea8f('0x7')]},'nameField':{'type':Sequelize[_0xea8f('0x7')]},'customField':{'type':Sequelize[_0xea8f('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xea8f('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index ac82499..141df69 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 _0x684c=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','count','offset','limit','set','Content-Range','apply','reject','error','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','query','intersection','model','fields','attributes','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','params','find','body','update','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox'];(function(_0x4f9b9e,_0xd6c41e){var _0x4b8e84=function(_0x56cbec){while(--_0x56cbec){_0x4f9b9e['push'](_0x4f9b9e['shift']());}};_0x4b8e84(++_0xd6c41e);}(_0x684c,0x1b3));var _0xc684=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x684c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc684('0x0'));var rimraf=require(_0xc684('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc684('0x2'));var rp=require(_0xc684('0x3'));var moment=require(_0xc684('0x4'));var BPromise=require(_0xc684('0x5'));var Mustache=require(_0xc684('0x6'));var util=require('util');var path=require(_0xc684('0x7'));var sox=require(_0xc684('0x8'));var csv=require(_0xc684('0x9'));var ejs=require(_0xc684('0xa'));var fs=require('fs');var fs_extra=require(_0xc684('0xb'));var _=require(_0xc684('0xc'));var squel=require(_0xc684('0xd'));var crypto=require(_0xc684('0xe'));var jsforce=require(_0xc684('0xf'));var deskjs=require(_0xc684('0x10'));var toCsv=require(_0xc684('0x9'));var querystring=require(_0xc684('0x11'));var Papa=require(_0xc684('0x12'));var Redis=require(_0xc684('0x13'));var authService=require(_0xc684('0x14'));var qs=require(_0xc684('0x15'));var as=require(_0xc684('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc684('0x17'))(_0xc684('0x18'));var utils=require(_0xc684('0x19'));var config=require(_0xc684('0x1a'));var licenseUtil=require(_0xc684('0x1b'));var db=require(_0xc684('0x1c'))['db'];function respondWithStatusCode(_0x4f3ff9,_0x3004a6){_0x3004a6=_0x3004a6||0xcc;return function(_0x10cc25){if(_0x10cc25){return _0x4f3ff9['sendStatus'](_0x3004a6);}return _0x4f3ff9['status'](_0x3004a6)[_0xc684('0x1d')]();};}function respondWithResult(_0x34cfd7,_0x32d5da){_0x32d5da=_0x32d5da||0xc8;return function(_0x2ad4f1){if(_0x2ad4f1){return _0x34cfd7[_0xc684('0x1e')](_0x32d5da)[_0xc684('0x1f')](_0x2ad4f1);}};}function respondWithFilteredResult(_0x4f26f7,_0x56d76f){return function(_0x43235d){if(_0x43235d){var _0x599c93=typeof _0x56d76f['offset']==='undefined'&&typeof _0x56d76f['limit']==='undefined';var _0x264cb5=_0x43235d[_0xc684('0x20')];var _0x3b6f5e=_0x599c93?0x0:_0x56d76f[_0xc684('0x21')];var _0x1c3af5=_0x599c93?_0x43235d['count']:_0x56d76f[_0xc684('0x21')]+_0x56d76f[_0xc684('0x22')];var _0x4afdd0;if(_0x1c3af5>=_0x264cb5){_0x1c3af5=_0x264cb5;_0x4afdd0=0xc8;}else{_0x4afdd0=0xce;}_0x4f26f7[_0xc684('0x1e')](_0x4afdd0);return _0x4f26f7[_0xc684('0x23')](_0xc684('0x24'),_0x3b6f5e+'-'+_0x1c3af5+'/'+_0x264cb5)['json'](_0x43235d);}return null;};}function patchUpdates(_0x62c4e5){return function(_0x11a159){try{jsonpatch[_0xc684('0x25')](_0x11a159,_0x62c4e5,!![]);}catch(_0xe7aadb){return BPromise[_0xc684('0x26')](_0xe7aadb);}return _0x11a159['save']();};}function saveUpdates(_0x13d43f,_0x39f39a){return function(_0x1fb8b0){if(_0x1fb8b0){return _0x1fb8b0['update'](_0x13d43f)['then'](function(_0x5a7b2e){return _0x5a7b2e;});}return null;};}function removeEntity(_0x41162b,_0x15ce5d){return function(_0xd2a943){if(_0xd2a943){return _0xd2a943['destroy']()['then'](function(){_0x41162b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x27c7cc,_0x321a88){return function(_0x236f02){if(!_0x236f02){_0x27c7cc['sendStatus'](0x194);}return _0x236f02;};}function handleError(_0x32cc56,_0x4dbf22){_0x4dbf22=_0x4dbf22||0x1f4;return function(_0x125d55){logger[_0xc684('0x27')](_0x125d55[_0xc684('0x28')]);if(_0x125d55['name']){delete _0x125d55[_0xc684('0x29')];}_0x32cc56['status'](_0x4dbf22)[_0xc684('0x2a')](_0x125d55);};}exports[_0xc684('0x2b')]=function(_0x210dcd,_0x9fdc2c){var _0x5df482={},_0xc0f77b={},_0x2710c1={'count':0x0,'rows':[]};var _0x28a48a=_[_0xc684('0x2c')](db[_0xc684('0x2d')][_0xc684('0x2e')],function(_0x10db0d){return{'name':_0x10db0d[_0xc684('0x2f')],'type':_0x10db0d['type']['key']};});_0xc0f77b['model']=_[_0xc684('0x2c')](_0x28a48a,_0xc684('0x29'));_0xc0f77b['query']=_['keys'](_0x210dcd[_0xc684('0x30')]);_0xc0f77b['filters']=_[_0xc684('0x31')](_0xc0f77b[_0xc684('0x32')],_0xc0f77b[_0xc684('0x30')]);_0x5df482['attributes']=_['intersection'](_0xc0f77b[_0xc684('0x32')],qs[_0xc684('0x33')](_0x210dcd['query']['fields']));_0x5df482[_0xc684('0x34')]=_0x5df482[_0xc684('0x34')][_0xc684('0x35')]?_0x5df482[_0xc684('0x34')]:_0xc0f77b[_0xc684('0x32')];if(!_0x210dcd[_0xc684('0x30')]['hasOwnProperty'](_0xc684('0x36'))){_0x5df482['limit']=qs['limit'](_0x210dcd[_0xc684('0x30')][_0xc684('0x22')]);_0x5df482['offset']=qs['offset'](_0x210dcd[_0xc684('0x30')][_0xc684('0x21')]);}_0x5df482[_0xc684('0x37')]=qs[_0xc684('0x38')](_0x210dcd[_0xc684('0x30')]['sort']);_0x5df482[_0xc684('0x39')]=qs[_0xc684('0x3a')](_['pick'](_0x210dcd['query'],_0xc0f77b[_0xc684('0x3a')]),_0x28a48a);if(_0x210dcd[_0xc684('0x30')][_0xc684('0x3b')]){_0x5df482[_0xc684('0x39')]=_[_0xc684('0x3c')](_0x5df482[_0xc684('0x39')],{'$or':_[_0xc684('0x2c')](_0x28a48a,function(_0x4889ad){if(_0x4889ad['type']!==_0xc684('0x3d')){var _0x1a863f={};_0x1a863f[_0x4889ad['name']]={'$like':'%'+_0x210dcd['query']['filter']+'%'};return _0x1a863f;}})});}_0x5df482=_[_0xc684('0x3c')]({},_0x5df482,_0x210dcd[_0xc684('0x3e')]);var _0xb1be5c={'where':_0x5df482[_0xc684('0x39')]};return db[_0xc684('0x2d')]['count'](_0xb1be5c)[_0xc684('0x3f')](function(_0x5b44eb){_0x2710c1[_0xc684('0x20')]=_0x5b44eb;if(_0x210dcd[_0xc684('0x30')][_0xc684('0x40')]){_0x5df482[_0xc684('0x41')]=[{'all':!![]}];}return db['ZendeskField'][_0xc684('0x42')](_0x5df482);})[_0xc684('0x3f')](function(_0xd9eae7){_0x2710c1[_0xc684('0x43')]=_0xd9eae7;return _0x2710c1;})[_0xc684('0x3f')](respondWithFilteredResult(_0x9fdc2c,_0x5df482))[_0xc684('0x44')](handleError(_0x9fdc2c,null));};exports['show']=function(_0x2b3aa7,_0x5aa42f){var _0x566c61={'raw':!![],'where':{'id':_0x2b3aa7[_0xc684('0x45')]['id']}},_0x46c6ad={};_0x46c6ad[_0xc684('0x32')]=_['keys'](db['ZendeskField']['rawAttributes']);_0x46c6ad['query']=_['keys'](_0x2b3aa7[_0xc684('0x30')]);_0x46c6ad[_0xc684('0x3a')]=_[_0xc684('0x31')](_0x46c6ad['model'],_0x46c6ad[_0xc684('0x30')]);_0x566c61['attributes']=_[_0xc684('0x31')](_0x46c6ad['model'],qs[_0xc684('0x33')](_0x2b3aa7[_0xc684('0x30')][_0xc684('0x33')]));_0x566c61[_0xc684('0x34')]=_0x566c61[_0xc684('0x34')]['length']?_0x566c61[_0xc684('0x34')]:_0x46c6ad[_0xc684('0x32')];if(_0x2b3aa7[_0xc684('0x30')][_0xc684('0x40')]){_0x566c61[_0xc684('0x41')]=[{'all':!![]}];}_0x566c61=_[_0xc684('0x3c')]({},_0x566c61,_0x2b3aa7[_0xc684('0x3e')]);return db[_0xc684('0x2d')][_0xc684('0x46')](_0x566c61)['then'](handleEntityNotFound(_0x5aa42f,null))[_0xc684('0x3f')](respondWithResult(_0x5aa42f,null))[_0xc684('0x44')](handleError(_0x5aa42f,null));};exports['create']=function(_0x30abd0,_0x4fb1d5){return db[_0xc684('0x2d')]['create'](_0x30abd0[_0xc684('0x47')],{})[_0xc684('0x3f')](respondWithResult(_0x4fb1d5,0xc9))[_0xc684('0x44')](handleError(_0x4fb1d5,null));};exports[_0xc684('0x48')]=function(_0x1bfd8d,_0x1fde57){if(_0x1bfd8d[_0xc684('0x47')]['id']){delete _0x1bfd8d[_0xc684('0x47')]['id'];}return db[_0xc684('0x2d')][_0xc684('0x46')]({'where':{'id':_0x1bfd8d['params']['id']}})[_0xc684('0x3f')](handleEntityNotFound(_0x1fde57,null))[_0xc684('0x3f')](saveUpdates(_0x1bfd8d['body'],null))['then'](respondWithResult(_0x1fde57,null))['catch'](handleError(_0x1fde57,null));};exports[_0xc684('0x49')]=function(_0x1304a2,_0x5439ae){return db[_0xc684('0x2d')][_0xc684('0x46')]({'where':{'id':_0x1304a2[_0xc684('0x45')]['id']}})['then'](handleEntityNotFound(_0x5439ae,null))[_0xc684('0x3f')](removeEntity(_0x5439ae,null))[_0xc684('0x44')](handleError(_0x5439ae,null));}; \ No newline at end of file +var _0x5ffd=['params','catch','destroy','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','json','save','update','then','error','stack','name','send','index','map','ZendeskField','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','keys','rawAttributes','create','body'];(function(_0xc2869e,_0x105457){var _0x243be2=function(_0x4876b6){while(--_0x4876b6){_0xc2869e['push'](_0xc2869e['shift']());}};_0x243be2(++_0x105457);}(_0x5ffd,0xdf));var _0xd5ff=function(_0xee93b,_0x43cdca){_0xee93b=_0xee93b-0x0;var _0x4405e6=_0x5ffd[_0xee93b];return _0x4405e6;};'use strict';var emlformat=require(_0xd5ff('0x0'));var rimraf=require(_0xd5ff('0x1'));var zipdir=require(_0xd5ff('0x2'));var jsonpatch=require(_0xd5ff('0x3'));var rp=require(_0xd5ff('0x4'));var moment=require(_0xd5ff('0x5'));var BPromise=require(_0xd5ff('0x6'));var Mustache=require(_0xd5ff('0x7'));var util=require(_0xd5ff('0x8'));var path=require(_0xd5ff('0x9'));var sox=require(_0xd5ff('0xa'));var csv=require('to-csv');var ejs=require(_0xd5ff('0xb'));var fs=require('fs');var fs_extra=require(_0xd5ff('0xc'));var _=require(_0xd5ff('0xd'));var squel=require('squel');var crypto=require(_0xd5ff('0xe'));var jsforce=require(_0xd5ff('0xf'));var deskjs=require(_0xd5ff('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd5ff('0x11'));var authService=require(_0xd5ff('0x12'));var qs=require(_0xd5ff('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd5ff('0x14'));var logger=require('../../config/logger')(_0xd5ff('0x15'));var utils=require('../../config/utils');var config=require(_0xd5ff('0x16'));var licenseUtil=require(_0xd5ff('0x17'));var db=require(_0xd5ff('0x18'))['db'];function respondWithStatusCode(_0x2761cc,_0x4b706b){_0x4b706b=_0x4b706b||0xcc;return function(_0x3d8d58){if(_0x3d8d58){return _0x2761cc[_0xd5ff('0x19')](_0x4b706b);}return _0x2761cc[_0xd5ff('0x1a')](_0x4b706b)[_0xd5ff('0x1b')]();};}function respondWithResult(_0x27bb1c,_0x517eab){_0x517eab=_0x517eab||0xc8;return function(_0x476796){if(_0x476796){return _0x27bb1c[_0xd5ff('0x1a')](_0x517eab)['json'](_0x476796);}};}function respondWithFilteredResult(_0x422721,_0x3509f6){return function(_0x421f64){if(_0x421f64){var _0x59fcca=typeof _0x3509f6[_0xd5ff('0x1c')]===_0xd5ff('0x1d')&&typeof _0x3509f6['limit']===_0xd5ff('0x1d');var _0x396ccf=_0x421f64[_0xd5ff('0x1e')];var _0x531c86=_0x59fcca?0x0:_0x3509f6['offset'];var _0x14ddf5=_0x59fcca?_0x421f64[_0xd5ff('0x1e')]:_0x3509f6[_0xd5ff('0x1c')]+_0x3509f6[_0xd5ff('0x1f')];var _0x5319cc;if(_0x14ddf5>=_0x396ccf){_0x14ddf5=_0x396ccf;_0x5319cc=0xc8;}else{_0x5319cc=0xce;}_0x422721['status'](_0x5319cc);return _0x422721[_0xd5ff('0x20')]('Content-Range',_0x531c86+'-'+_0x14ddf5+'/'+_0x396ccf)[_0xd5ff('0x21')](_0x421f64);}return null;};}function patchUpdates(_0x513a20){return function(_0x357736){try{jsonpatch['apply'](_0x357736,_0x513a20,!![]);}catch(_0x48feb7){return BPromise['reject'](_0x48feb7);}return _0x357736[_0xd5ff('0x22')]();};}function saveUpdates(_0x24bb2,_0x103f9a){return function(_0x770c51){if(_0x770c51){return _0x770c51[_0xd5ff('0x23')](_0x24bb2)['then'](function(_0x3555d7){return _0x3555d7;});}return null;};}function removeEntity(_0x323d09,_0x16e7ca){return function(_0x3e462b){if(_0x3e462b){return _0x3e462b['destroy']()[_0xd5ff('0x24')](function(){_0x323d09['status'](0xcc)[_0xd5ff('0x1b')]();});}};}function handleEntityNotFound(_0x2603c9,_0x15071e){return function(_0x1556bc){if(!_0x1556bc){_0x2603c9['sendStatus'](0x194);}return _0x1556bc;};}function handleError(_0x2174ae,_0x21a811){_0x21a811=_0x21a811||0x1f4;return function(_0x2e1601){logger[_0xd5ff('0x25')](_0x2e1601[_0xd5ff('0x26')]);if(_0x2e1601[_0xd5ff('0x27')]){delete _0x2e1601[_0xd5ff('0x27')];}_0x2174ae[_0xd5ff('0x1a')](_0x21a811)[_0xd5ff('0x28')](_0x2e1601);};}exports[_0xd5ff('0x29')]=function(_0xfb2705,_0x5857f8){var _0x5a4de7={},_0xee5c5b={},_0x4cb91d={'count':0x0,'rows':[]};var _0x1c89c4=_[_0xd5ff('0x2a')](db[_0xd5ff('0x2b')]['rawAttributes'],function(_0x51a65f){return{'name':_0x51a65f[_0xd5ff('0x2c')],'type':_0x51a65f[_0xd5ff('0x2d')]['key']};});_0xee5c5b[_0xd5ff('0x2e')]=_['map'](_0x1c89c4,_0xd5ff('0x27'));_0xee5c5b[_0xd5ff('0x2f')]=_['keys'](_0xfb2705[_0xd5ff('0x2f')]);_0xee5c5b['filters']=_[_0xd5ff('0x30')](_0xee5c5b[_0xd5ff('0x2e')],_0xee5c5b['query']);_0x5a4de7[_0xd5ff('0x31')]=_['intersection'](_0xee5c5b[_0xd5ff('0x2e')],qs['fields'](_0xfb2705[_0xd5ff('0x2f')][_0xd5ff('0x32')]));_0x5a4de7['attributes']=_0x5a4de7[_0xd5ff('0x31')][_0xd5ff('0x33')]?_0x5a4de7[_0xd5ff('0x31')]:_0xee5c5b[_0xd5ff('0x2e')];if(!_0xfb2705[_0xd5ff('0x2f')][_0xd5ff('0x34')](_0xd5ff('0x35'))){_0x5a4de7[_0xd5ff('0x1f')]=qs[_0xd5ff('0x1f')](_0xfb2705[_0xd5ff('0x2f')][_0xd5ff('0x1f')]);_0x5a4de7['offset']=qs[_0xd5ff('0x1c')](_0xfb2705[_0xd5ff('0x2f')][_0xd5ff('0x1c')]);}_0x5a4de7['order']=qs[_0xd5ff('0x36')](_0xfb2705[_0xd5ff('0x2f')][_0xd5ff('0x36')]);_0x5a4de7[_0xd5ff('0x37')]=qs[_0xd5ff('0x38')](_['pick'](_0xfb2705[_0xd5ff('0x2f')],_0xee5c5b['filters']),_0x1c89c4);if(_0xfb2705[_0xd5ff('0x2f')]['filter']){_0x5a4de7[_0xd5ff('0x37')]=_['merge'](_0x5a4de7[_0xd5ff('0x37')],{'$or':_[_0xd5ff('0x2a')](_0x1c89c4,function(_0x58be45){if(_0x58be45['type']!==_0xd5ff('0x39')){var _0x55629b={};_0x55629b[_0x58be45[_0xd5ff('0x27')]]={'$like':'%'+_0xfb2705[_0xd5ff('0x2f')]['filter']+'%'};return _0x55629b;}})});}_0x5a4de7=_[_0xd5ff('0x3a')]({},_0x5a4de7,_0xfb2705[_0xd5ff('0x3b')]);var _0x29735b={'where':_0x5a4de7[_0xd5ff('0x37')]};return db[_0xd5ff('0x2b')]['count'](_0x29735b)[_0xd5ff('0x24')](function(_0x3b554e){_0x4cb91d[_0xd5ff('0x1e')]=_0x3b554e;if(_0xfb2705[_0xd5ff('0x2f')][_0xd5ff('0x3c')]){_0x5a4de7[_0xd5ff('0x3d')]=[{'all':!![]}];}return db[_0xd5ff('0x2b')][_0xd5ff('0x3e')](_0x5a4de7);})['then'](function(_0x28a131){_0x4cb91d[_0xd5ff('0x3f')]=_0x28a131;return _0x4cb91d;})[_0xd5ff('0x24')](respondWithFilteredResult(_0x5857f8,_0x5a4de7))['catch'](handleError(_0x5857f8,null));};exports[_0xd5ff('0x40')]=function(_0x146277,_0x1d33dc){var _0x3892ff={'raw':!![],'where':{'id':_0x146277['params']['id']}},_0x3e1e9c={};_0x3e1e9c[_0xd5ff('0x2e')]=_[_0xd5ff('0x41')](db[_0xd5ff('0x2b')][_0xd5ff('0x42')]);_0x3e1e9c[_0xd5ff('0x2f')]=_[_0xd5ff('0x41')](_0x146277[_0xd5ff('0x2f')]);_0x3e1e9c['filters']=_['intersection'](_0x3e1e9c['model'],_0x3e1e9c['query']);_0x3892ff[_0xd5ff('0x31')]=_[_0xd5ff('0x30')](_0x3e1e9c[_0xd5ff('0x2e')],qs[_0xd5ff('0x32')](_0x146277['query']['fields']));_0x3892ff[_0xd5ff('0x31')]=_0x3892ff['attributes'][_0xd5ff('0x33')]?_0x3892ff[_0xd5ff('0x31')]:_0x3e1e9c[_0xd5ff('0x2e')];if(_0x146277[_0xd5ff('0x2f')][_0xd5ff('0x3c')]){_0x3892ff[_0xd5ff('0x3d')]=[{'all':!![]}];}_0x3892ff=_[_0xd5ff('0x3a')]({},_0x3892ff,_0x146277[_0xd5ff('0x3b')]);return db['ZendeskField']['find'](_0x3892ff)[_0xd5ff('0x24')](handleEntityNotFound(_0x1d33dc,null))[_0xd5ff('0x24')](respondWithResult(_0x1d33dc,null))['catch'](handleError(_0x1d33dc,null));};exports[_0xd5ff('0x43')]=function(_0x4e223a,_0x153f5d){return db[_0xd5ff('0x2b')][_0xd5ff('0x43')](_0x4e223a['body'],{})[_0xd5ff('0x24')](respondWithResult(_0x153f5d,0xc9))['catch'](handleError(_0x153f5d,null));};exports[_0xd5ff('0x23')]=function(_0x19a7fe,_0x9358c8){if(_0x19a7fe['body']['id']){delete _0x19a7fe[_0xd5ff('0x44')]['id'];}return db[_0xd5ff('0x2b')]['find']({'where':{'id':_0x19a7fe[_0xd5ff('0x45')]['id']}})[_0xd5ff('0x24')](handleEntityNotFound(_0x9358c8,null))[_0xd5ff('0x24')](saveUpdates(_0x19a7fe[_0xd5ff('0x44')],null))[_0xd5ff('0x24')](respondWithResult(_0x9358c8,null))[_0xd5ff('0x46')](handleError(_0x9358c8,null));};exports[_0xd5ff('0x47')]=function(_0x14fca0,_0x303f45){return db[_0xd5ff('0x2b')][_0xd5ff('0x48')]({'where':{'id':_0x14fca0[_0xd5ff('0x45')]['id']}})['then'](handleEntityNotFound(_0x303f45,null))[_0xd5ff('0x24')](removeEntity(_0x303f45,null))[_0xd5ff('0x46')](handleError(_0x303f45,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 46f2abe..5bf343c 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 _0xdf15=['util','../../config/logger','api','bluebird','rimraf','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','idField','FieldId','lodash'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xdf15,0x185));var _0x5df1=function(_0x445602,_0x27e4ec){_0x445602=_0x445602-0x0;var _0x514341=_0xdf15[_0x445602];return _0x514341;};'use strict';var _=require(_0x5df1('0x0'));var util=require(_0x5df1('0x1'));var logger=require(_0x5df1('0x2'))(_0x5df1('0x3'));var moment=require('moment');var BPromise=require(_0x5df1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5df1('0x5'));var config=require('../../config/environment');var attributes=require(_0x5df1('0x6'));module[_0x5df1('0x7')]=function(_0x1d147f,_0x3b5ab8){return _0x1d147f[_0x5df1('0x8')](_0x5df1('0x9'),attributes,{'tableName':_0x5df1('0xa'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0x5df1('0xb'),_0x5df1('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x445f=['exports','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes'];(function(_0x5de9ef,_0x44f1b6){var _0x2bd196=function(_0x1e67a2){while(--_0x1e67a2){_0x5de9ef['push'](_0x5de9ef['shift']());}};_0x2bd196(++_0x44f1b6);}(_0x445f,0x1b8));var _0xf445=function(_0x5833a5,_0x1c05f9){_0x5833a5=_0x5833a5-0x0;var _0x2f4e5b=_0x445f[_0x5833a5];return _0x2f4e5b;};'use strict';var _=require(_0xf445('0x0'));var util=require(_0xf445('0x1'));var logger=require(_0xf445('0x2'))(_0xf445('0x3'));var moment=require(_0xf445('0x4'));var BPromise=require('bluebird');var rp=require(_0xf445('0x5'));var fs=require('fs');var path=require(_0xf445('0x6'));var rimraf=require(_0xf445('0x7'));var config=require(_0xf445('0x8'));var attributes=require(_0xf445('0x9'));module[_0xf445('0xa')]=function(_0x413450,_0x3e0849){return _0x413450['define'](_0xf445('0xb'),attributes,{'tableName':_0xf445('0xc'),'paranoid':![],'indexes':[{'name':_0xf445('0xd'),'fields':[_0xf445('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index b1ae9dd..269465f 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 _0x2ff3=['moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util'];(function(_0x1cd674,_0x8d3638){var _0x27928f=function(_0x5e3c70){while(--_0x5e3c70){_0x1cd674['push'](_0x1cd674['shift']());}};_0x27928f(++_0x8d3638);}(_0x2ff3,0xbc));var _0x32ff=function(_0xcb96a,_0x2efcbb){_0xcb96a=_0xcb96a-0x0;var _0x302e2a=_0x2ff3[_0xcb96a];return _0x302e2a;};'use strict';var _=require('lodash');var util=require(_0x32ff('0x0'));var moment=require(_0x32ff('0x1'));var BPromise=require(_0x32ff('0x2'));var rs=require(_0x32ff('0x3'));var fs=require('fs');var Redis=require(_0x32ff('0x4'));var db=require(_0x32ff('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x32ff('0x6'));var config=require(_0x32ff('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x32ff('0x8')][_0x32ff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b418e,_0x1fd349,_0x47a9f5){return new BPromise(function(_0x223d63,_0x45c20c){return client[_0x32ff('0xa')](_0x5b418e,_0x47a9f5)['then'](function(_0x7f9462){logger[_0x32ff('0xb')](_0x32ff('0xc'),_0x1fd349,_0x32ff('0xd'));logger[_0x32ff('0xe')](_0x32ff('0xf'),_0x1fd349,_0x32ff('0xd'),JSON[_0x32ff('0x10')](_0x7f9462));if(_0x7f9462[_0x32ff('0x11')]){if(_0x7f9462[_0x32ff('0x11')]['code']===0x1f4){logger['error']('ZendeskField,\x20%s,\x20%s',_0x1fd349,_0x7f9462[_0x32ff('0x11')][_0x32ff('0x12')]);return _0x45c20c(_0x7f9462[_0x32ff('0x11')]['message']);}logger[_0x32ff('0x11')](_0x32ff('0xc'),_0x1fd349,_0x7f9462[_0x32ff('0x11')][_0x32ff('0x12')]);return _0x223d63(_0x7f9462[_0x32ff('0x11')][_0x32ff('0x12')]);}else{logger['info']('ZendeskField,\x20%s,\x20%s',_0x1fd349,_0x32ff('0xd'));_0x223d63(_0x7f9462[_0x32ff('0x13')][_0x32ff('0x12')]);}})[_0x32ff('0x14')](function(_0x48aa8a){logger['error'](_0x32ff('0xc'),_0x1fd349,_0x48aa8a);_0x45c20c(_0x48aa8a);});});} \ No newline at end of file +var _0xa016=['catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','ZendeskField,\x20%s,\x20%s','message','result'];(function(_0xcb0eb2,_0x3906bf){var _0xbab9b8=function(_0x24fa8a){while(--_0x24fa8a){_0xcb0eb2['push'](_0xcb0eb2['shift']());}};_0xbab9b8(++_0x3906bf);}(_0xa016,0xc7));var _0x6a01=function(_0x39c8b4,_0x2d3464){_0x39c8b4=_0x39c8b4-0x0;var _0x54af79=_0xa016[_0x39c8b4];return _0x54af79;};'use strict';var _=require(_0x6a01('0x0'));var util=require(_0x6a01('0x1'));var moment=require('moment');var BPromise=require(_0x6a01('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6a01('0x3'));var db=require(_0x6a01('0x4'))['db'];var utils=require(_0x6a01('0x5'));var logger=require(_0x6a01('0x6'))(_0x6a01('0x7'));var config=require('../../config/environment');var jayson=require(_0x6a01('0x8'));var client=jayson['client'][_0x6a01('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x203c93,_0x4b4276,_0x1758ee){return new BPromise(function(_0x121aaa,_0x22c938){return client[_0x6a01('0xa')](_0x203c93,_0x1758ee)[_0x6a01('0xb')](function(_0x5ebf8e){logger[_0x6a01('0xc')]('ZendeskField,\x20%s,\x20%s',_0x4b4276,_0x6a01('0xd'));logger[_0x6a01('0xe')](_0x6a01('0xf'),_0x4b4276,_0x6a01('0xd'),JSON['stringify'](_0x5ebf8e));if(_0x5ebf8e[_0x6a01('0x10')]){if(_0x5ebf8e[_0x6a01('0x10')][_0x6a01('0x11')]===0x1f4){logger[_0x6a01('0x10')](_0x6a01('0x12'),_0x4b4276,_0x5ebf8e[_0x6a01('0x10')][_0x6a01('0x13')]);return _0x22c938(_0x5ebf8e[_0x6a01('0x10')][_0x6a01('0x13')]);}logger[_0x6a01('0x10')]('ZendeskField,\x20%s,\x20%s',_0x4b4276,_0x5ebf8e[_0x6a01('0x10')][_0x6a01('0x13')]);return _0x121aaa(_0x5ebf8e[_0x6a01('0x10')]['message']);}else{logger[_0x6a01('0xc')](_0x6a01('0x12'),_0x4b4276,_0x6a01('0xd'));_0x121aaa(_0x5ebf8e[_0x6a01('0x14')][_0x6a01('0x13')]);}})[_0x6a01('0x15')](function(_0x2c8261){logger[_0x6a01('0x10')](_0x6a01('0x12'),_0x4b4276,_0x2c8261);_0x22c938(_0x2c8261);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 54db887..65e6d4d 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 _0x7858=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','/:id','show','getConfigurations','/:id/fields','getFields','post','/:id/configurations','addConfiguration','put','delete','destroy','exports','util','connect-timeout'];(function(_0x427e7a,_0x541057){var _0x1e8668=function(_0x5dc156){while(--_0x5dc156){_0x427e7a['push'](_0x427e7a['shift']());}};_0x1e8668(++_0x541057);}(_0x7858,0x132));var _0x8785=function(_0x558510,_0x3ed721){_0x558510=_0x558510-0x0;var _0xba0225=_0x7858[_0x558510];return _0xba0225;};'use strict';var multer=require('multer');var util=require(_0x8785('0x0'));var path=require('path');var timeout=require(_0x8785('0x1'));var express=require(_0x8785('0x2'));var router=express[_0x8785('0x3')]();var fs_extra=require(_0x8785('0x4'));var auth=require(_0x8785('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8785('0x6'));var controller=require(_0x8785('0x7'));router[_0x8785('0x8')]('/',auth[_0x8785('0x9')](),controller['index']);router[_0x8785('0x8')](_0x8785('0xa'),auth[_0x8785('0x9')](),controller[_0x8785('0xb')]);router[_0x8785('0x8')]('/:id/configurations',auth[_0x8785('0x9')](),controller[_0x8785('0xc')]);router['get'](_0x8785('0xd'),auth['isAuthenticated'](),controller[_0x8785('0xe')]);router[_0x8785('0xf')]('/',auth[_0x8785('0x9')](),controller['create']);router[_0x8785('0xf')](_0x8785('0x10'),auth[_0x8785('0x9')](),controller[_0x8785('0x11')]);router[_0x8785('0x12')](_0x8785('0xa'),auth[_0x8785('0x9')](),controller['update']);router[_0x8785('0x13')](_0x8785('0xa'),auth['isAuthenticated'](),controller[_0x8785('0x14')]);module[_0x8785('0x15')]=router; \ No newline at end of file +var _0xfec2=['/:id/fields','post','addConfiguration','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','/:id','getConfigurations'];(function(_0x59b2cd,_0x2c7556){var _0x3c63b5=function(_0x3bec2e){while(--_0x3bec2e){_0x59b2cd['push'](_0x59b2cd['shift']());}};_0x3c63b5(++_0x2c7556);}(_0xfec2,0x193));var _0x2fec=function(_0x163172,_0x341012){_0x163172=_0x163172-0x0;var _0x4099f7=_0xfec2[_0x163172];return _0x4099f7;};'use strict';var multer=require(_0x2fec('0x0'));var util=require(_0x2fec('0x1'));var path=require(_0x2fec('0x2'));var timeout=require(_0x2fec('0x3'));var express=require(_0x2fec('0x4'));var router=express[_0x2fec('0x5')]();var fs_extra=require(_0x2fec('0x6'));var auth=require(_0x2fec('0x7'));var interaction=require(_0x2fec('0x8'));var config=require(_0x2fec('0x9'));var controller=require(_0x2fec('0xa'));router[_0x2fec('0xb')]('/',auth[_0x2fec('0xc')](),controller['index']);router[_0x2fec('0xb')](_0x2fec('0xd'),auth[_0x2fec('0xc')](),controller['show']);router[_0x2fec('0xb')]('/:id/configurations',auth[_0x2fec('0xc')](),controller[_0x2fec('0xe')]);router[_0x2fec('0xb')](_0x2fec('0xf'),auth[_0x2fec('0xc')](),controller['getFields']);router[_0x2fec('0x10')]('/',auth[_0x2fec('0xc')](),controller['create']);router[_0x2fec('0x10')]('/:id/configurations',auth[_0x2fec('0xc')](),controller[_0x2fec('0x11')]);router[_0x2fec('0x12')](_0x2fec('0xd'),auth[_0x2fec('0xc')](),controller['update']);router[_0x2fec('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x2fec('0x14')]);module[_0x2fec('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 887f201..8368167 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 _0xd0bb=['exports','STRING','sequelize'];(function(_0x1155bb,_0x578a0c){var _0x2ac9af=function(_0x44df0c){while(--_0x44df0c){_0x1155bb['push'](_0x1155bb['shift']());}};_0x2ac9af(++_0x578a0c);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0xa8ccab,_0x4d7cae){_0xa8ccab=_0xa8ccab-0x0;var _0x570d5f=_0xd0bb[_0xa8ccab];return _0x570d5f;};'use strict';var Sequelize=require(_0xbd0b('0x0'));module[_0xbd0b('0x1')]={'name':{'type':Sequelize[_0xbd0b('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xbd0b('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xbd0b('0x2')]},'clientSecret':{'type':Sequelize[_0xbd0b('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'code':{'type':Sequelize[_0xbd0b('0x2')]},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4c4e=['sequelize','STRING'];(function(_0x7675b9,_0x56b807){var _0x3256db=function(_0xb67f7a){while(--_0xb67f7a){_0x7675b9['push'](_0x7675b9['shift']());}};_0x3256db(++_0x56b807);}(_0x4c4e,0x152));var _0xe4c4=function(_0xe275e8,_0x5dcf6c){_0xe275e8=_0xe275e8-0x0;var _0x2d3584=_0x4c4e[_0xe275e8];return _0x2d3584;};'use strict';var Sequelize=require(_0xe4c4('0x0'));module['exports']={'name':{'type':Sequelize[_0xe4c4('0x1')]},'description':{'type':Sequelize[_0xe4c4('0x1')]},'host':{'type':Sequelize[_0xe4c4('0x1')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xe4c4('0x1')]},'clientSecret':{'type':Sequelize[_0xe4c4('0x1')]},'serverUrl':{'type':Sequelize[_0xe4c4('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0xe4c4('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 64ddbcf..a8d76d3 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 _0xe7fb=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','ZohoAccount','rawAttributes','fieldName','type','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','where','merge','filter','options','includeAll','findAll','rows','catch','show','params','include','create','body','find','findOne','ZohoConfiguration','nolimit','getConfigurations','AccountId','Subjects','getSubjects','channel','getDescriptions','ZohoField','Descriptions','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','zone','code','com','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','request-promise'];(function(_0xb3a153,_0x50cc02){var _0x518593=function(_0x1b71aa){while(--_0x1b71aa){_0xb3a153['push'](_0xb3a153['shift']());}};_0x518593(++_0x50cc02);}(_0xe7fb,0x82));var _0xbe7f=function(_0x5a7280,_0x1d3e29){_0x5a7280=_0x5a7280-0x0;var _0x428a82=_0xe7fb[_0x5a7280];return _0x428a82;};'use strict';var emlformat=require(_0xbe7f('0x0'));var rimraf=require(_0xbe7f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbe7f('0x2'));var moment=require('moment');var BPromise=require(_0xbe7f('0x3'));var Mustache=require(_0xbe7f('0x4'));var util=require(_0xbe7f('0x5'));var path=require(_0xbe7f('0x6'));var sox=require(_0xbe7f('0x7'));var csv=require(_0xbe7f('0x8'));var ejs=require(_0xbe7f('0x9'));var fs=require('fs');var fs_extra=require(_0xbe7f('0xa'));var _=require(_0xbe7f('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbe7f('0xc'));var deskjs=require(_0xbe7f('0xd'));var toCsv=require('to-csv');var querystring=require(_0xbe7f('0xe'));var Papa=require('papaparse');var Redis=require(_0xbe7f('0xf'));var authService=require(_0xbe7f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xbe7f('0x11'));var hardwareService=require(_0xbe7f('0x12'));var logger=require(_0xbe7f('0x13'))('api');var utils=require(_0xbe7f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xbe7f('0x15'));var db=require(_0xbe7f('0x16'))['db'];var integrations=require(_0xbe7f('0x17'));function respondWithStatusCode(_0xa041d9,_0x187d17){_0x187d17=_0x187d17||0xcc;return function(_0x243033){if(_0x243033){return _0xa041d9[_0xbe7f('0x18')](_0x187d17);}return _0xa041d9[_0xbe7f('0x19')](_0x187d17)[_0xbe7f('0x1a')]();};}function respondWithResult(_0x21a185,_0x153273){_0x153273=_0x153273||0xc8;return function(_0x34446d){if(_0x34446d){return _0x21a185[_0xbe7f('0x19')](_0x153273)[_0xbe7f('0x1b')](_0x34446d);}};}function respondWithFilteredResult(_0xf4cc4e,_0x516332){return function(_0x4b8666){if(_0x4b8666){var _0x283d7a=typeof _0x516332['offset']===_0xbe7f('0x1c')&&typeof _0x516332['limit']===_0xbe7f('0x1c');var _0x2ed58a=_0x4b8666[_0xbe7f('0x1d')];var _0x6f6de8=_0x283d7a?0x0:_0x516332[_0xbe7f('0x1e')];var _0x1cf2df=_0x283d7a?_0x4b8666[_0xbe7f('0x1d')]:_0x516332[_0xbe7f('0x1e')]+_0x516332[_0xbe7f('0x1f')];var _0x2a5a9d;if(_0x1cf2df>=_0x2ed58a){_0x1cf2df=_0x2ed58a;_0x2a5a9d=0xc8;}else{_0x2a5a9d=0xce;}_0xf4cc4e[_0xbe7f('0x19')](_0x2a5a9d);return _0xf4cc4e['set'](_0xbe7f('0x20'),_0x6f6de8+'-'+_0x1cf2df+'/'+_0x2ed58a)[_0xbe7f('0x1b')](_0x4b8666);}return null;};}function patchUpdates(_0x22bbfe){return function(_0x11ae6c){try{jsonpatch[_0xbe7f('0x21')](_0x11ae6c,_0x22bbfe,!![]);}catch(_0x16470c){return BPromise[_0xbe7f('0x22')](_0x16470c);}return _0x11ae6c[_0xbe7f('0x23')]();};}function saveUpdates(_0x47cabd,_0x24641c){return function(_0x2ad0ad){if(_0x2ad0ad){return _0x2ad0ad[_0xbe7f('0x24')](_0x47cabd)['then'](function(_0x2ad816){return _0x2ad816;});}return null;};}function removeEntity(_0x4d51ed,_0x26a83b){return function(_0x4d5eb9){if(_0x4d5eb9){return _0x4d5eb9[_0xbe7f('0x25')]()[_0xbe7f('0x26')](function(){_0x4d51ed[_0xbe7f('0x19')](0xcc)[_0xbe7f('0x1a')]();});}};}function handleEntityNotFound(_0x157745,_0x2692ad){return function(_0x5a16fb){if(!_0x5a16fb){_0x157745[_0xbe7f('0x18')](0x194);}return _0x5a16fb;};}function handleError(_0x472b9b,_0xf5c3a7){_0xf5c3a7=_0xf5c3a7||0x1f4;return function(_0x46a945){logger[_0xbe7f('0x27')](_0x46a945[_0xbe7f('0x28')]);if(_0x46a945[_0xbe7f('0x29')]){delete _0x46a945[_0xbe7f('0x29')];}_0x472b9b['status'](_0xf5c3a7)[_0xbe7f('0x2a')](_0x46a945);};}exports[_0xbe7f('0x2b')]=function(_0x5e0001,_0x52ad2e){var _0x3920ba={},_0x42d135={},_0x53bac9={'count':0x0,'rows':[]};var _0x14f0b2=_['map'](db[_0xbe7f('0x2c')][_0xbe7f('0x2d')],function(_0x39ee15){return{'name':_0x39ee15[_0xbe7f('0x2e')],'type':_0x39ee15[_0xbe7f('0x2f')]['key']};});_0x42d135[_0xbe7f('0x30')]=_[_0xbe7f('0x31')](_0x14f0b2,_0xbe7f('0x29'));_0x42d135['query']=_[_0xbe7f('0x32')](_0x5e0001[_0xbe7f('0x33')]);_0x42d135['filters']=_[_0xbe7f('0x34')](_0x42d135['model'],_0x42d135['query']);_0x3920ba[_0xbe7f('0x35')]=_[_0xbe7f('0x34')](_0x42d135[_0xbe7f('0x30')],qs['fields'](_0x5e0001['query'][_0xbe7f('0x36')]));_0x3920ba['attributes']=_0x3920ba[_0xbe7f('0x35')][_0xbe7f('0x37')]?_0x3920ba[_0xbe7f('0x35')]:_0x42d135[_0xbe7f('0x30')];if(!_0x5e0001['query'][_0xbe7f('0x38')]('nolimit')){_0x3920ba[_0xbe7f('0x1f')]=qs['limit'](_0x5e0001[_0xbe7f('0x33')]['limit']);_0x3920ba['offset']=qs[_0xbe7f('0x1e')](_0x5e0001['query'][_0xbe7f('0x1e')]);}_0x3920ba[_0xbe7f('0x39')]=qs[_0xbe7f('0x3a')](_0x5e0001[_0xbe7f('0x33')][_0xbe7f('0x3a')]);_0x3920ba['where']=qs[_0xbe7f('0x3b')](_[_0xbe7f('0x3c')](_0x5e0001[_0xbe7f('0x33')],_0x42d135[_0xbe7f('0x3b')]),_0x14f0b2);if(_0x5e0001[_0xbe7f('0x33')]['filter']){_0x3920ba[_0xbe7f('0x3d')]=_[_0xbe7f('0x3e')](_0x3920ba[_0xbe7f('0x3d')],{'$or':_[_0xbe7f('0x31')](_0x14f0b2,function(_0x260f00){if(_0x260f00[_0xbe7f('0x2f')]!=='VIRTUAL'){var _0x313aa5={};_0x313aa5[_0x260f00[_0xbe7f('0x29')]]={'$like':'%'+_0x5e0001[_0xbe7f('0x33')][_0xbe7f('0x3f')]+'%'};return _0x313aa5;}})});}_0x3920ba=_['merge']({},_0x3920ba,_0x5e0001[_0xbe7f('0x40')]);var _0x320154={'where':_0x3920ba[_0xbe7f('0x3d')]};return db[_0xbe7f('0x2c')][_0xbe7f('0x1d')](_0x320154)['then'](function(_0x2fef57){_0x53bac9['count']=_0x2fef57;if(_0x5e0001['query'][_0xbe7f('0x41')]){_0x3920ba['include']=[{'all':!![]}];}return db['ZohoAccount'][_0xbe7f('0x42')](_0x3920ba);})[_0xbe7f('0x26')](function(_0x4cb919){_0x53bac9[_0xbe7f('0x43')]=_0x4cb919;return _0x53bac9;})[_0xbe7f('0x26')](respondWithFilteredResult(_0x52ad2e,_0x3920ba))[_0xbe7f('0x44')](handleError(_0x52ad2e,null));};exports[_0xbe7f('0x45')]=function(_0x69f381,_0x448336){var _0x22ac22={'raw':![],'where':{'id':_0x69f381[_0xbe7f('0x46')]['id']}},_0x154822={};_0x154822[_0xbe7f('0x30')]=_[_0xbe7f('0x32')](db[_0xbe7f('0x2c')][_0xbe7f('0x2d')]);_0x154822[_0xbe7f('0x33')]=_[_0xbe7f('0x32')](_0x69f381[_0xbe7f('0x33')]);_0x154822[_0xbe7f('0x3b')]=_[_0xbe7f('0x34')](_0x154822[_0xbe7f('0x30')],_0x154822[_0xbe7f('0x33')]);_0x22ac22[_0xbe7f('0x35')]=_['intersection'](_0x154822[_0xbe7f('0x30')],qs[_0xbe7f('0x36')](_0x69f381[_0xbe7f('0x33')][_0xbe7f('0x36')]));_0x22ac22[_0xbe7f('0x35')]=_0x22ac22[_0xbe7f('0x35')][_0xbe7f('0x37')]?_0x22ac22[_0xbe7f('0x35')]:_0x154822[_0xbe7f('0x30')];if(_0x69f381[_0xbe7f('0x33')][_0xbe7f('0x41')]){_0x22ac22[_0xbe7f('0x47')]=[{'all':!![]}];}_0x22ac22=_[_0xbe7f('0x3e')]({},_0x22ac22,_0x69f381['options']);return db[_0xbe7f('0x2c')]['find'](_0x22ac22)[_0xbe7f('0x26')](handleEntityNotFound(_0x448336,null))[_0xbe7f('0x26')](respondWithResult(_0x448336,null))['catch'](handleError(_0x448336,null));};exports[_0xbe7f('0x48')]=function(_0x4de4fb,_0x5410d6){return db[_0xbe7f('0x2c')]['create'](_0x4de4fb[_0xbe7f('0x49')],{})['then'](respondWithResult(_0x5410d6,0xc9))[_0xbe7f('0x44')](handleError(_0x5410d6,null));};exports[_0xbe7f('0x24')]=function(_0x184630,_0x19860d){if(_0x184630['body']['id']){delete _0x184630[_0xbe7f('0x49')]['id'];}return db[_0xbe7f('0x2c')][_0xbe7f('0x4a')]({'where':{'id':_0x184630['params']['id']}})[_0xbe7f('0x26')](handleEntityNotFound(_0x19860d,null))[_0xbe7f('0x26')](saveUpdates(_0x184630[_0xbe7f('0x49')],null))[_0xbe7f('0x26')](respondWithResult(_0x19860d,null))[_0xbe7f('0x44')](handleError(_0x19860d,null));};exports[_0xbe7f('0x25')]=function(_0x322a05,_0x1bae1f){return db[_0xbe7f('0x2c')]['find']({'where':{'id':_0x322a05['params']['id']}})[_0xbe7f('0x26')](handleEntityNotFound(_0x1bae1f,null))['then'](removeEntity(_0x1bae1f,null))[_0xbe7f('0x44')](handleError(_0x1bae1f,null));};exports['getConfigurations']=function(_0x14d43d,_0x5f27a3,_0x3df0af){var _0x3399ed={};var _0x23f034={};var _0x4839f6;var _0x346c7f;return db[_0xbe7f('0x2c')][_0xbe7f('0x4b')]({'where':{'id':_0x14d43d['params']['id']}})[_0xbe7f('0x26')](handleEntityNotFound(_0x5f27a3,null))['then'](function(_0x5613b8){if(_0x5613b8){_0x4839f6=_0x5613b8;_0x23f034[_0xbe7f('0x30')]=_['keys'](db[_0xbe7f('0x4c')][_0xbe7f('0x2d')]);_0x23f034[_0xbe7f('0x33')]=_[_0xbe7f('0x32')](_0x14d43d[_0xbe7f('0x33')]);_0x23f034[_0xbe7f('0x3b')]=_[_0xbe7f('0x34')](_0x23f034[_0xbe7f('0x30')],_0x23f034['query']);_0x3399ed[_0xbe7f('0x35')]=_['intersection'](_0x23f034['model'],qs[_0xbe7f('0x36')](_0x14d43d['query']['fields']));_0x3399ed['attributes']=_0x3399ed[_0xbe7f('0x35')]['length']?_0x3399ed[_0xbe7f('0x35')]:_0x23f034[_0xbe7f('0x30')];_0x3399ed[_0xbe7f('0x39')]=qs[_0xbe7f('0x3a')](_0x14d43d[_0xbe7f('0x33')][_0xbe7f('0x3a')]);_0x3399ed['where']=qs[_0xbe7f('0x3b')](_[_0xbe7f('0x3c')](_0x14d43d[_0xbe7f('0x33')],_0x23f034[_0xbe7f('0x3b')]));if(_0x14d43d[_0xbe7f('0x33')][_0xbe7f('0x3f')]){_0x3399ed[_0xbe7f('0x3d')]=_['merge'](_0x3399ed[_0xbe7f('0x3d')],{'$or':_[_0xbe7f('0x31')](_0x3399ed['attributes'],function(_0x24c613){var _0x494fe7={};_0x494fe7[_0x24c613]={'$like':'%'+_0x14d43d['query'][_0xbe7f('0x3f')]+'%'};return _0x494fe7;})});}_0x3399ed=_[_0xbe7f('0x3e')]({},_0x3399ed,_0x14d43d[_0xbe7f('0x40')]);return _0x4839f6['getConfigurations'](_0x3399ed);}})[_0xbe7f('0x26')](function(_0x7276b4){if(_0x7276b4){_0x346c7f=_0x7276b4[_0xbe7f('0x37')];if(!_0x14d43d[_0xbe7f('0x33')][_0xbe7f('0x38')](_0xbe7f('0x4d'))){_0x3399ed[_0xbe7f('0x1f')]=qs[_0xbe7f('0x1f')](_0x14d43d[_0xbe7f('0x33')][_0xbe7f('0x1f')]);_0x3399ed['offset']=qs[_0xbe7f('0x1e')](_0x14d43d[_0xbe7f('0x33')][_0xbe7f('0x1e')]);}return _0x4839f6[_0xbe7f('0x4e')](_0x3399ed);}})[_0xbe7f('0x26')](function(_0x3d3692){if(_0x3d3692){return _0x3d3692?{'count':_0x346c7f,'rows':_0x3d3692}:null;}})[_0xbe7f('0x26')](respondWithResult(_0x5f27a3,null))['catch'](handleError(_0x5f27a3,null));};exports['addConfiguration']=function(_0x52dd3b,_0x5becf7,_0x316736){if(_0x52dd3b[_0xbe7f('0x49')]['id']){delete _0x52dd3b[_0xbe7f('0x49')]['id'];}return db[_0xbe7f('0x2c')][_0xbe7f('0x4b')]({'where':{'id':_0x52dd3b[_0xbe7f('0x46')]['id']}})['then'](handleEntityNotFound(_0x5becf7,null))['then'](function(_0x44198a){if(_0x44198a){_0x52dd3b[_0xbe7f('0x49')][_0xbe7f('0x4f')]=_0x44198a['id'];_0x52dd3b['body'][_0xbe7f('0x50')]=integrations[_0xbe7f('0x51')](_0x52dd3b['body'][_0xbe7f('0x52')],_0x52dd3b['body'][_0xbe7f('0x2f')]);_0x52dd3b[_0xbe7f('0x49')]['Descriptions']=integrations[_0xbe7f('0x53')](_0x52dd3b[_0xbe7f('0x49')]['channel'],_0x52dd3b['body'][_0xbe7f('0x2f')]);return db[_0xbe7f('0x4c')][_0xbe7f('0x48')](_0x52dd3b[_0xbe7f('0x49')],{'include':[{'model':db[_0xbe7f('0x54')],'as':_0xbe7f('0x50')},{'model':db[_0xbe7f('0x54')],'as':_0xbe7f('0x55')}]});}return null;})[_0xbe7f('0x26')](respondWithResult(_0x5becf7,null))['catch'](handleError(_0x5becf7,null));};function getAccessToken(_0x24bbd7){return new Promise(function(_0x5a4803,_0x4e827d){var _0x13ecfe;switch(_0x24bbd7['zone']){case'US':_0x13ecfe=_0xbe7f('0x56');break;case'AU':_0x13ecfe=_0xbe7f('0x57');break;case'EU':_0x13ecfe=_0xbe7f('0x58');break;case'IN':_0x13ecfe=_0xbe7f('0x59');break;case'CN':_0x13ecfe=_0xbe7f('0x5a');break;default:_0x13ecfe='https://accounts.zoho.eu';break;}var _0x294835={'method':'POST','uri':_0x13ecfe+_0xbe7f('0x5b'),'qs':{'refresh_token':_0x24bbd7[_0xbe7f('0x5c')],'client_id':_0x24bbd7[_0xbe7f('0x5d')],'client_secret':_0x24bbd7[_0xbe7f('0x5e')],'grant_type':_0xbe7f('0x5f')},'json':!![]};return rp(_0x294835)[_0xbe7f('0x26')](function(_0x1ed4dd){if(_0x1ed4dd[_0xbe7f('0x60')]){_0x5a4803(_0x1ed4dd[_0xbe7f('0x60')]);}else{_0x4e827d(_0xbe7f('0x61'));}})[_0xbe7f('0x44')](function(_0x24db54){_0x4e827d(_0x24db54);});});}exports['getFields']=function(_0x96c39e,_0x441b56,_0x5c342d){var _0x3e2585,_0x28d482,_0x5dd6c2,_0x5937ae,_0xd25aaf;return db[_0xbe7f('0x2c')]['findOne']({'where':{'id':_0x96c39e['params']['id']},'attributes':['id',_0xbe7f('0x62'),_0xbe7f('0x63'),_0xbe7f('0x5d'),_0xbe7f('0x5e'),'serverUrl',_0xbe7f('0x64'),_0xbe7f('0x5c')]})[_0xbe7f('0x26')](handleEntityNotFound(_0x441b56,null))[_0xbe7f('0x26')](function(_0x5a3d08){_0xd25aaf=_0x5a3d08;_0x3e2585=_0xd25aaf['host'];_0x28d482=_0x3e2585==='zoho.eu'?'eu':_0xbe7f('0x65');_0x5dd6c2=_0xd25aaf['serverUrl'];var _0x3312ca=_0x5dd6c2['slice'](-0x1);if(_0x3312ca==='/'||_0x3312ca==='\x5c'||_0x3312ca===':'){_0x5dd6c2=_0x5dd6c2[_0xbe7f('0x66')](0x0,_0x5dd6c2['lastIndexOf'](_0x3312ca));}if(!_0xd25aaf['refreshToken']){throw new Error(_0xbe7f('0x67'));}return getAccessToken(_0xd25aaf);})['then'](function(_0x223bbf){if(_0x223bbf){return rp({'method':_0xbe7f('0x68'),'uri':util[_0xbe7f('0x69')](_0xbe7f('0x6a'),_0x28d482),'qs':{'module':_0xbe7f('0x6b')},'headers':{'Authorization':_0xbe7f('0x6c')+_0x223bbf},'json':!![]});}})[_0xbe7f('0x26')](function(_0x2c1f08){if(_0x2c1f08){if(_0x2c1f08[_0xbe7f('0x6d')]&&_0x2c1f08[_0xbe7f('0x6d')][_0xbe7f('0x27')]){throw new Error(_0x2c1f08[_0xbe7f('0x6d')]['error'][_0xbe7f('0x6e')]);}var _0x1196f7=[];var _0x264a6c=[];var _0xca4bfb=[_0xbe7f('0x6f'),_0xbe7f('0x70'),_0xbe7f('0x71'),'WhoId',_0xbe7f('0x72'),_0xbe7f('0x73'),_0xbe7f('0x74'),_0xbe7f('0x75')];_0x264a6c=_[_0xbe7f('0x76')](_0x2c1f08['fields'],function(_0x1e301d){return _0xca4bfb[_0xbe7f('0x77')](_0x1e301d[_0xbe7f('0x78')]);});for(var _0x4510c0=0x0;_0x4510c0<_0x264a6c[_0xbe7f('0x37')];_0x4510c0++){if(_0x264a6c[_0x4510c0][_0xbe7f('0x79')]===![]){_0x1196f7[_0xbe7f('0x7a')]({'id':_0x264a6c[_0x4510c0]['id'],'name':_0x264a6c[_0x4510c0][_0xbe7f('0x7b')],'custom':_0x264a6c[_0x4510c0][_0xbe7f('0x7c')],'options':_0x264a6c[_0x4510c0][_0xbe7f('0x7d')]===_0xbe7f('0x7e')&&_0x264a6c[_0x4510c0][_0xbe7f('0x7f')]['length']>-0x1?_['map'](_0x264a6c[_0x4510c0][_0xbe7f('0x7f')],function(_0x4e8df3){return{'name':_0x4e8df3,'value':_0x4e8df3};}):[]});}}return{'count':_0x1196f7[_0xbe7f('0x37')],'rows':_0x1196f7};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x441b56,null))[_0xbe7f('0x44')](function(_0x2c57f9){var _0x575750=_0x96c39e[_0xbe7f('0x33')][_0xbe7f('0x80')]?0x1f4:_0x2c57f9[_0xbe7f('0x81')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xbe7f('0x82'),_0x575750,JSON[_0xbe7f('0x83')](_0x2c57f9));delete _0x2c57f9[_0xbe7f('0x29')];if(_0x575750===0x191){_0x575750=0x190;}_0x441b56[_0xbe7f('0x19')](_0x575750)['send'](_0x96c39e[_0xbe7f('0x33')][_0xbe7f('0x80')]?{'message':_0xbe7f('0x84'),'statusCode':_0x2c57f9[_0xbe7f('0x81')]}:_0x2c57f9);});}; \ No newline at end of file +var _0xa646=['merge','include','rows','catch','params','options','create','body','find','findOne','ZohoConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','zone','code','zoho.eu','com','serverUrl','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','update','destroy','then','error','stack','name','send','index','ZohoAccount','rawAttributes','fieldName','type','key','model','map','keys','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','where','VIRTUAL'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa646,0xc7));var _0x6a64=function(_0x51cc45,_0x909fb0){_0x51cc45=_0x51cc45-0x0;var _0x412d9e=_0xa646[_0x51cc45];return _0x412d9e;};'use strict';var emlformat=require(_0x6a64('0x0'));var rimraf=require(_0x6a64('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6a64('0x2'));var rp=require(_0x6a64('0x3'));var moment=require(_0x6a64('0x4'));var BPromise=require(_0x6a64('0x5'));var Mustache=require(_0x6a64('0x6'));var util=require(_0x6a64('0x7'));var path=require(_0x6a64('0x8'));var sox=require(_0x6a64('0x9'));var csv=require(_0x6a64('0xa'));var ejs=require(_0x6a64('0xb'));var fs=require('fs');var fs_extra=require(_0x6a64('0xc'));var _=require('lodash');var squel=require(_0x6a64('0xd'));var crypto=require('crypto');var jsforce=require(_0x6a64('0xe'));var deskjs=require(_0x6a64('0xf'));var toCsv=require(_0x6a64('0xa'));var querystring=require(_0x6a64('0x10'));var Papa=require(_0x6a64('0x11'));var Redis=require(_0x6a64('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6a64('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6a64('0x14'));var logger=require(_0x6a64('0x15'))(_0x6a64('0x16'));var utils=require(_0x6a64('0x17'));var config=require(_0x6a64('0x18'));var licenseUtil=require(_0x6a64('0x19'));var db=require(_0x6a64('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1f2e22,_0x5ed0b0){_0x5ed0b0=_0x5ed0b0||0xcc;return function(_0x7ba368){if(_0x7ba368){return _0x1f2e22[_0x6a64('0x1b')](_0x5ed0b0);}return _0x1f2e22['status'](_0x5ed0b0)[_0x6a64('0x1c')]();};}function respondWithResult(_0x3d3c5a,_0x3d6c2b){_0x3d6c2b=_0x3d6c2b||0xc8;return function(_0x3fd505){if(_0x3fd505){return _0x3d3c5a[_0x6a64('0x1d')](_0x3d6c2b)[_0x6a64('0x1e')](_0x3fd505);}};}function respondWithFilteredResult(_0x593133,_0x5249f9){return function(_0x5db172){if(_0x5db172){var _0xccec85=typeof _0x5249f9[_0x6a64('0x1f')]===_0x6a64('0x20')&&typeof _0x5249f9['limit']===_0x6a64('0x20');var _0x1f48e6=_0x5db172[_0x6a64('0x21')];var _0xe84374=_0xccec85?0x0:_0x5249f9['offset'];var _0x20c5d5=_0xccec85?_0x5db172['count']:_0x5249f9[_0x6a64('0x1f')]+_0x5249f9[_0x6a64('0x22')];var _0x331971;if(_0x20c5d5>=_0x1f48e6){_0x20c5d5=_0x1f48e6;_0x331971=0xc8;}else{_0x331971=0xce;}_0x593133['status'](_0x331971);return _0x593133[_0x6a64('0x23')]('Content-Range',_0xe84374+'-'+_0x20c5d5+'/'+_0x1f48e6)[_0x6a64('0x1e')](_0x5db172);}return null;};}function patchUpdates(_0x2fc063){return function(_0x2f199a){try{jsonpatch[_0x6a64('0x24')](_0x2f199a,_0x2fc063,!![]);}catch(_0xfbc373){return BPromise['reject'](_0xfbc373);}return _0x2f199a['save']();};}function saveUpdates(_0x3d7b9c,_0x265637){return function(_0x1e4bd5){if(_0x1e4bd5){return _0x1e4bd5[_0x6a64('0x25')](_0x3d7b9c)['then'](function(_0x1a8df6){return _0x1a8df6;});}return null;};}function removeEntity(_0x915d4c,_0x2e6d5d){return function(_0x17eabc){if(_0x17eabc){return _0x17eabc[_0x6a64('0x26')]()[_0x6a64('0x27')](function(){_0x915d4c[_0x6a64('0x1d')](0xcc)[_0x6a64('0x1c')]();});}};}function handleEntityNotFound(_0xc4dda8,_0x1bb651){return function(_0x422d4f){if(!_0x422d4f){_0xc4dda8[_0x6a64('0x1b')](0x194);}return _0x422d4f;};}function handleError(_0x367000,_0x68c8f){_0x68c8f=_0x68c8f||0x1f4;return function(_0x2573f9){logger[_0x6a64('0x28')](_0x2573f9[_0x6a64('0x29')]);if(_0x2573f9[_0x6a64('0x2a')]){delete _0x2573f9[_0x6a64('0x2a')];}_0x367000[_0x6a64('0x1d')](_0x68c8f)[_0x6a64('0x2b')](_0x2573f9);};}exports[_0x6a64('0x2c')]=function(_0x5ae5c5,_0x58eb39){var _0x2fbecb={},_0x780142={},_0xcc3113={'count':0x0,'rows':[]};var _0x50e981=_['map'](db[_0x6a64('0x2d')][_0x6a64('0x2e')],function(_0x1dcf52){return{'name':_0x1dcf52[_0x6a64('0x2f')],'type':_0x1dcf52[_0x6a64('0x30')][_0x6a64('0x31')]};});_0x780142[_0x6a64('0x32')]=_[_0x6a64('0x33')](_0x50e981,'name');_0x780142['query']=_[_0x6a64('0x34')](_0x5ae5c5['query']);_0x780142['filters']=_[_0x6a64('0x35')](_0x780142[_0x6a64('0x32')],_0x780142[_0x6a64('0x36')]);_0x2fbecb[_0x6a64('0x37')]=_[_0x6a64('0x35')](_0x780142[_0x6a64('0x32')],qs[_0x6a64('0x38')](_0x5ae5c5[_0x6a64('0x36')][_0x6a64('0x38')]));_0x2fbecb[_0x6a64('0x37')]=_0x2fbecb[_0x6a64('0x37')][_0x6a64('0x39')]?_0x2fbecb[_0x6a64('0x37')]:_0x780142[_0x6a64('0x32')];if(!_0x5ae5c5[_0x6a64('0x36')][_0x6a64('0x3a')]('nolimit')){_0x2fbecb[_0x6a64('0x22')]=qs['limit'](_0x5ae5c5['query'][_0x6a64('0x22')]);_0x2fbecb['offset']=qs[_0x6a64('0x1f')](_0x5ae5c5[_0x6a64('0x36')][_0x6a64('0x1f')]);}_0x2fbecb[_0x6a64('0x3b')]=qs[_0x6a64('0x3c')](_0x5ae5c5['query'][_0x6a64('0x3c')]);_0x2fbecb['where']=qs[_0x6a64('0x3d')](_['pick'](_0x5ae5c5[_0x6a64('0x36')],_0x780142[_0x6a64('0x3d')]),_0x50e981);if(_0x5ae5c5['query'][_0x6a64('0x3e')]){_0x2fbecb[_0x6a64('0x3f')]=_['merge'](_0x2fbecb[_0x6a64('0x3f')],{'$or':_['map'](_0x50e981,function(_0x1f2557){if(_0x1f2557[_0x6a64('0x30')]!==_0x6a64('0x40')){var _0x5992f2={};_0x5992f2[_0x1f2557[_0x6a64('0x2a')]]={'$like':'%'+_0x5ae5c5[_0x6a64('0x36')][_0x6a64('0x3e')]+'%'};return _0x5992f2;}})});}_0x2fbecb=_[_0x6a64('0x41')]({},_0x2fbecb,_0x5ae5c5['options']);var _0x58c67a={'where':_0x2fbecb['where']};return db['ZohoAccount'][_0x6a64('0x21')](_0x58c67a)[_0x6a64('0x27')](function(_0x10f253){_0xcc3113['count']=_0x10f253;if(_0x5ae5c5[_0x6a64('0x36')]['includeAll']){_0x2fbecb[_0x6a64('0x42')]=[{'all':!![]}];}return db[_0x6a64('0x2d')]['findAll'](_0x2fbecb);})[_0x6a64('0x27')](function(_0x1eaef3){_0xcc3113[_0x6a64('0x43')]=_0x1eaef3;return _0xcc3113;})['then'](respondWithFilteredResult(_0x58eb39,_0x2fbecb))[_0x6a64('0x44')](handleError(_0x58eb39,null));};exports['show']=function(_0x36698a,_0x401afd){var _0x4127c8={'raw':![],'where':{'id':_0x36698a[_0x6a64('0x45')]['id']}},_0x30e0c4={};_0x30e0c4['model']=_['keys'](db['ZohoAccount']['rawAttributes']);_0x30e0c4[_0x6a64('0x36')]=_['keys'](_0x36698a[_0x6a64('0x36')]);_0x30e0c4['filters']=_[_0x6a64('0x35')](_0x30e0c4[_0x6a64('0x32')],_0x30e0c4['query']);_0x4127c8[_0x6a64('0x37')]=_[_0x6a64('0x35')](_0x30e0c4['model'],qs[_0x6a64('0x38')](_0x36698a[_0x6a64('0x36')][_0x6a64('0x38')]));_0x4127c8[_0x6a64('0x37')]=_0x4127c8[_0x6a64('0x37')]['length']?_0x4127c8[_0x6a64('0x37')]:_0x30e0c4['model'];if(_0x36698a['query']['includeAll']){_0x4127c8[_0x6a64('0x42')]=[{'all':!![]}];}_0x4127c8=_[_0x6a64('0x41')]({},_0x4127c8,_0x36698a[_0x6a64('0x46')]);return db['ZohoAccount']['find'](_0x4127c8)[_0x6a64('0x27')](handleEntityNotFound(_0x401afd,null))[_0x6a64('0x27')](respondWithResult(_0x401afd,null))[_0x6a64('0x44')](handleError(_0x401afd,null));};exports[_0x6a64('0x47')]=function(_0x84568b,_0x454302){return db[_0x6a64('0x2d')]['create'](_0x84568b[_0x6a64('0x48')],{})[_0x6a64('0x27')](respondWithResult(_0x454302,0xc9))[_0x6a64('0x44')](handleError(_0x454302,null));};exports[_0x6a64('0x25')]=function(_0x10957e,_0x2836a4){if(_0x10957e[_0x6a64('0x48')]['id']){delete _0x10957e['body']['id'];}return db[_0x6a64('0x2d')][_0x6a64('0x49')]({'where':{'id':_0x10957e[_0x6a64('0x45')]['id']}})[_0x6a64('0x27')](handleEntityNotFound(_0x2836a4,null))[_0x6a64('0x27')](saveUpdates(_0x10957e[_0x6a64('0x48')],null))['then'](respondWithResult(_0x2836a4,null))[_0x6a64('0x44')](handleError(_0x2836a4,null));};exports[_0x6a64('0x26')]=function(_0x58074e,_0x4090d0){return db['ZohoAccount'][_0x6a64('0x49')]({'where':{'id':_0x58074e['params']['id']}})[_0x6a64('0x27')](handleEntityNotFound(_0x4090d0,null))['then'](removeEntity(_0x4090d0,null))[_0x6a64('0x44')](handleError(_0x4090d0,null));};exports['getConfigurations']=function(_0x2c56eb,_0x13b5fa,_0x481aa0){var _0x4be240={};var _0x22b191={};var _0x2b1cc9;var _0x23e704;return db[_0x6a64('0x2d')][_0x6a64('0x4a')]({'where':{'id':_0x2c56eb[_0x6a64('0x45')]['id']}})[_0x6a64('0x27')](handleEntityNotFound(_0x13b5fa,null))[_0x6a64('0x27')](function(_0x11768a){if(_0x11768a){_0x2b1cc9=_0x11768a;_0x22b191[_0x6a64('0x32')]=_[_0x6a64('0x34')](db[_0x6a64('0x4b')]['rawAttributes']);_0x22b191[_0x6a64('0x36')]=_[_0x6a64('0x34')](_0x2c56eb[_0x6a64('0x36')]);_0x22b191['filters']=_[_0x6a64('0x35')](_0x22b191[_0x6a64('0x32')],_0x22b191[_0x6a64('0x36')]);_0x4be240[_0x6a64('0x37')]=_[_0x6a64('0x35')](_0x22b191['model'],qs['fields'](_0x2c56eb['query'][_0x6a64('0x38')]));_0x4be240['attributes']=_0x4be240[_0x6a64('0x37')][_0x6a64('0x39')]?_0x4be240[_0x6a64('0x37')]:_0x22b191['model'];_0x4be240[_0x6a64('0x3b')]=qs[_0x6a64('0x3c')](_0x2c56eb[_0x6a64('0x36')][_0x6a64('0x3c')]);_0x4be240[_0x6a64('0x3f')]=qs[_0x6a64('0x3d')](_['pick'](_0x2c56eb[_0x6a64('0x36')],_0x22b191['filters']));if(_0x2c56eb[_0x6a64('0x36')][_0x6a64('0x3e')]){_0x4be240['where']=_[_0x6a64('0x41')](_0x4be240[_0x6a64('0x3f')],{'$or':_[_0x6a64('0x33')](_0x4be240['attributes'],function(_0x271bf6){var _0x5d97f5={};_0x5d97f5[_0x271bf6]={'$like':'%'+_0x2c56eb['query']['filter']+'%'};return _0x5d97f5;})});}_0x4be240=_[_0x6a64('0x41')]({},_0x4be240,_0x2c56eb[_0x6a64('0x46')]);return _0x2b1cc9[_0x6a64('0x4c')](_0x4be240);}})[_0x6a64('0x27')](function(_0x51309e){if(_0x51309e){_0x23e704=_0x51309e['length'];if(!_0x2c56eb[_0x6a64('0x36')][_0x6a64('0x3a')]('nolimit')){_0x4be240['limit']=qs['limit'](_0x2c56eb['query'][_0x6a64('0x22')]);_0x4be240[_0x6a64('0x1f')]=qs[_0x6a64('0x1f')](_0x2c56eb[_0x6a64('0x36')][_0x6a64('0x1f')]);}return _0x2b1cc9[_0x6a64('0x4c')](_0x4be240);}})[_0x6a64('0x27')](function(_0x5dd69a){if(_0x5dd69a){return _0x5dd69a?{'count':_0x23e704,'rows':_0x5dd69a}:null;}})['then'](respondWithResult(_0x13b5fa,null))[_0x6a64('0x44')](handleError(_0x13b5fa,null));};exports[_0x6a64('0x4d')]=function(_0x311a64,_0x51c542,_0x512ecc){if(_0x311a64[_0x6a64('0x48')]['id']){delete _0x311a64[_0x6a64('0x48')]['id'];}return db[_0x6a64('0x2d')][_0x6a64('0x4a')]({'where':{'id':_0x311a64['params']['id']}})[_0x6a64('0x27')](handleEntityNotFound(_0x51c542,null))[_0x6a64('0x27')](function(_0xea53fe){if(_0xea53fe){_0x311a64[_0x6a64('0x48')][_0x6a64('0x4e')]=_0xea53fe['id'];_0x311a64[_0x6a64('0x48')][_0x6a64('0x4f')]=integrations[_0x6a64('0x50')](_0x311a64['body'][_0x6a64('0x51')],_0x311a64['body'][_0x6a64('0x30')]);_0x311a64[_0x6a64('0x48')][_0x6a64('0x52')]=integrations[_0x6a64('0x53')](_0x311a64[_0x6a64('0x48')][_0x6a64('0x51')],_0x311a64['body'][_0x6a64('0x30')]);return db[_0x6a64('0x4b')]['create'](_0x311a64[_0x6a64('0x48')],{'include':[{'model':db['ZohoField'],'as':_0x6a64('0x4f')},{'model':db['ZohoField'],'as':_0x6a64('0x52')}]});}return null;})[_0x6a64('0x27')](respondWithResult(_0x51c542,null))[_0x6a64('0x44')](handleError(_0x51c542,null));};function getAccessToken(_0x3d33b8){return new Promise(function(_0x3512b3,_0x2959a2){var _0x375673;switch(_0x3d33b8['zone']){case'US':_0x375673=_0x6a64('0x54');break;case'AU':_0x375673='https://accounts.zoho.com.au';break;case'EU':_0x375673=_0x6a64('0x55');break;case'IN':_0x375673=_0x6a64('0x56');break;case'CN':_0x375673=_0x6a64('0x57');break;default:_0x375673=_0x6a64('0x55');break;}var _0xf6f168={'method':'POST','uri':_0x375673+'/oauth/v2/token','qs':{'refresh_token':_0x3d33b8[_0x6a64('0x58')],'client_id':_0x3d33b8[_0x6a64('0x59')],'client_secret':_0x3d33b8[_0x6a64('0x5a')],'grant_type':_0x6a64('0x5b')},'json':!![]};return rp(_0xf6f168)[_0x6a64('0x27')](function(_0x45763e){if(_0x45763e[_0x6a64('0x5c')]){_0x3512b3(_0x45763e[_0x6a64('0x5c')]);}else{_0x2959a2(_0x6a64('0x5d'));}})[_0x6a64('0x44')](function(_0x41c53e){_0x2959a2(_0x41c53e);});});}exports[_0x6a64('0x5e')]=function(_0x5e2eb8,_0x1c439c,_0x2ab643){var _0x79309a,_0x5a0e1f,_0x55d070,_0x471fbc,_0x259fd4;return db[_0x6a64('0x2d')][_0x6a64('0x4a')]({'where':{'id':_0x5e2eb8[_0x6a64('0x45')]['id']},'attributes':['id',_0x6a64('0x5f'),_0x6a64('0x60'),_0x6a64('0x59'),_0x6a64('0x5a'),'serverUrl',_0x6a64('0x61'),'refreshToken']})[_0x6a64('0x27')](handleEntityNotFound(_0x1c439c,null))[_0x6a64('0x27')](function(_0x369c32){_0x259fd4=_0x369c32;_0x79309a=_0x259fd4[_0x6a64('0x5f')];_0x5a0e1f=_0x79309a===_0x6a64('0x62')?'eu':_0x6a64('0x63');_0x55d070=_0x259fd4[_0x6a64('0x64')];var _0x4273ea=_0x55d070[_0x6a64('0x65')](-0x1);if(_0x4273ea==='/'||_0x4273ea==='\x5c'||_0x4273ea===':'){_0x55d070=_0x55d070[_0x6a64('0x66')](0x0,_0x55d070[_0x6a64('0x67')](_0x4273ea));}if(!_0x259fd4[_0x6a64('0x58')]){throw new Error(_0x6a64('0x68'));}return getAccessToken(_0x259fd4);})['then'](function(_0x425878){if(_0x425878){return rp({'method':_0x6a64('0x69'),'uri':util[_0x6a64('0x6a')](_0x6a64('0x6b'),_0x5a0e1f),'qs':{'module':_0x6a64('0x6c')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x425878},'json':!![]});}})['then'](function(_0x2a1e43){if(_0x2a1e43){if(_0x2a1e43[_0x6a64('0x6d')]&&_0x2a1e43[_0x6a64('0x6d')][_0x6a64('0x28')]){throw new Error(_0x2a1e43[_0x6a64('0x6d')][_0x6a64('0x28')][_0x6a64('0x6e')]);}var _0x262356=[];var _0x41f590=[];var _0x5c1986=[_0x6a64('0x6f'),_0x6a64('0x70'),_0x6a64('0x71'),_0x6a64('0x72'),_0x6a64('0x73'),_0x6a64('0x74'),_0x6a64('0x75'),_0x6a64('0x76')];_0x41f590=_[_0x6a64('0x77')](_0x2a1e43[_0x6a64('0x38')],function(_0x13e836){return _0x5c1986[_0x6a64('0x78')](_0x13e836[_0x6a64('0x79')]);});for(var _0x3df577=0x0;_0x3df577<_0x41f590[_0x6a64('0x39')];_0x3df577++){if(_0x41f590[_0x3df577][_0x6a64('0x7a')]===![]){_0x262356['push']({'id':_0x41f590[_0x3df577]['id'],'name':_0x41f590[_0x3df577][_0x6a64('0x7b')],'custom':_0x41f590[_0x3df577][_0x6a64('0x7c')],'options':_0x41f590[_0x3df577][_0x6a64('0x7d')]===_0x6a64('0x7e')&&_0x41f590[_0x3df577][_0x6a64('0x7f')][_0x6a64('0x39')]>-0x1?_[_0x6a64('0x33')](_0x41f590[_0x3df577][_0x6a64('0x7f')],function(_0x31f10d){return{'name':_0x31f10d,'value':_0x31f10d};}):[]});}}return{'count':_0x262356[_0x6a64('0x39')],'rows':_0x262356};}else{return{'count':0x0,'rows':[]};}})[_0x6a64('0x27')](respondWithResult(_0x1c439c,null))['catch'](function(_0x28c766){var _0xff14a8=_0x5e2eb8[_0x6a64('0x36')][_0x6a64('0x80')]?0x1f4:_0x28c766[_0x6a64('0x81')]||0x1f4;logger[_0x6a64('0x28')](_0x6a64('0x82'),_0x6a64('0x5e'),_0xff14a8,JSON['stringify'](_0x28c766));delete _0x28c766['name'];if(_0xff14a8===0x191){_0xff14a8=0x190;}_0x1c439c[_0x6a64('0x1d')](_0xff14a8)['send'](_0x5e2eb8[_0x6a64('0x36')][_0x6a64('0x80')]?{'message':_0x6a64('0x83'),'statusCode':_0x28c766[_0x6a64('0x81')]}:_0x28c766);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index d1b61bd..816fcb5 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 _0x0d56=['ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','format','inspect','host','https://accounts.zoho.com.cn','POST','/oauth/v2/token','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','catch','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','code','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.eu','authorization_code','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken'];(function(_0x4c321c,_0x3e9da0){var _0x25accb=function(_0x21bf7a){while(--_0x21bf7a){_0x4c321c['push'](_0x4c321c['shift']());}};_0x25accb(++_0x3e9da0);}(_0x0d56,0xe2));var _0x60d5=function(_0x452a27,_0x5a2b48){_0x452a27=_0x452a27-0x0;var _0x385c7b=_0x0d56[_0x452a27];return _0x385c7b;};'use strict';var _=require(_0x60d5('0x0'));var util=require(_0x60d5('0x1'));var logger=require(_0x60d5('0x2'))(_0x60d5('0x3'));var moment=require(_0x60d5('0x4'));var BPromise=require(_0x60d5('0x5'));var rp=require(_0x60d5('0x6'));var fs=require('fs');var path=require(_0x60d5('0x7'));var rimraf=require(_0x60d5('0x8'));var config=require('../../config/environment');var attributes=require(_0x60d5('0x9'));var integrations=require(_0x60d5('0xa'));module['exports']=function(_0x1396bb,_0x4f8ed6){return _0x1396bb[_0x60d5('0xb')](_0x60d5('0xc'),attributes,{'tableName':_0x60d5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4aea01,_0x57dac0,_0x9fd5cf){if(_0x4aea01[_0x60d5('0xe')](_0x60d5('0xf'))||_0x4aea01[_0x60d5('0xe')](_0x60d5('0x10'))||_0x4aea01[_0x60d5('0xe')](_0x60d5('0x11'))||_0x4aea01[_0x60d5('0xe')](_0x60d5('0x12'))||_0x4aea01[_0x60d5('0xe')](_0x60d5('0x13'))||_0x4aea01['changed']('host')){var _0x360e8b,_0x1bdbe2;_0x360e8b=_0x4aea01[_0x60d5('0x10')];var _0x13a4fb=_0x360e8b[_0x60d5('0x14')](-0x1);if(_0x13a4fb==='/'||_0x13a4fb==='\x5c'||_0x13a4fb===':'){_0x360e8b=_0x360e8b[_0x60d5('0x15')](0x0,_0x360e8b[_0x60d5('0x16')](_0x13a4fb));}switch(_0x4aea01[_0x60d5('0xf')]){case'US':_0x1bdbe2=_0x60d5('0x17');break;case'AU':_0x1bdbe2='https://accounts.zoho.com.au';break;case'IN':_0x1bdbe2=_0x60d5('0x18');break;case'CN':_0x1bdbe2='https://accounts.zoho.com.cn';break;default:_0x1bdbe2=_0x60d5('0x19');break;}var _0x5d82a2={'method':'POST','uri':_0x1bdbe2+'/oauth/v2/token','form':{'grant_type':_0x60d5('0x1a'),'client_id':_0x4aea01[_0x60d5('0x11')],'client_secret':_0x4aea01[_0x60d5('0x12')],'redirect_uri':_0x4aea01[_0x60d5('0x10')],'code':_0x4aea01['code']},'headers':{'Content-Type':_0x60d5('0x1b')}};return rp(_0x5d82a2)[_0x60d5('0x1c')](function(_0x2a6da7){var _0x574644=JSON[_0x60d5('0x1d')](_0x2a6da7);if(_0x574644[_0x60d5('0x1e')]){_0x4aea01[_0x60d5('0x1f')]=_0x574644[_0x60d5('0x1e')];logger['info'](util['format'](_0x60d5('0x20'),_0x4aea01[_0x60d5('0x21')],_0x4aea01['id']));}else{logger[_0x60d5('0x22')](util[_0x60d5('0x23')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4aea01[_0x60d5('0x21')],_0x4aea01['id']),util[_0x60d5('0x24')](_0x574644,{'showHidden':![],'depth':null}));}return _0x9fd5cf(null,_0x57dac0);})['catch'](function(_0x28cfbb){logger[_0x60d5('0x22')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4aea01[_0x60d5('0x21')],_0x4aea01['id']),util[_0x60d5('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x9fd5cf(_0x28cfbb);});}else{return _0x9fd5cf(null,_0x57dac0);}},'beforeUpdate':function(_0x5a6f65,_0x522275,_0x7f9a2c){if(_0x5a6f65['changed']('zone')||_0x5a6f65[_0x60d5('0xe')](_0x60d5('0x10'))||_0x5a6f65[_0x60d5('0xe')](_0x60d5('0x11'))||_0x5a6f65[_0x60d5('0xe')](_0x60d5('0x12'))||_0x5a6f65[_0x60d5('0xe')]('code')||_0x5a6f65[_0x60d5('0xe')](_0x60d5('0x25'))){var _0x45dad8,_0x24eef3;_0x45dad8=_0x5a6f65['serverUrl'];var _0xc649e=_0x45dad8[_0x60d5('0x14')](-0x1);if(_0xc649e==='/'||_0xc649e==='\x5c'||_0xc649e===':'){_0x45dad8=_0x45dad8[_0x60d5('0x15')](0x0,_0x45dad8[_0x60d5('0x16')](_0xc649e));}switch(_0x5a6f65[_0x60d5('0xf')]){case'US':_0x24eef3=_0x60d5('0x17');break;case'AU':_0x24eef3='https://accounts.zoho.com.au';break;case'IN':_0x24eef3=_0x60d5('0x18');break;case'CN':_0x24eef3=_0x60d5('0x26');break;default:_0x24eef3=_0x60d5('0x19');break;}var _0x527541={'method':_0x60d5('0x27'),'uri':_0x24eef3+_0x60d5('0x28'),'form':{'grant_type':_0x60d5('0x1a'),'client_id':_0x5a6f65['clientId'],'client_secret':_0x5a6f65[_0x60d5('0x12')],'redirect_uri':_0x5a6f65['serverUrl'],'code':_0x5a6f65[_0x60d5('0x13')]},'headers':{'Content-Type':_0x60d5('0x1b')}};return rp(_0x527541)['then'](function(_0x337c17){var _0x55f690=JSON[_0x60d5('0x1d')](_0x337c17);if(_0x55f690['refresh_token']){_0x5a6f65[_0x60d5('0x1f')]=_0x55f690[_0x60d5('0x1e')];logger['info'](util[_0x60d5('0x23')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5a6f65[_0x60d5('0x21')],_0x5a6f65['id']));}else{logger[_0x60d5('0x22')](util[_0x60d5('0x23')](_0x60d5('0x29'),_0x5a6f65[_0x60d5('0x21')],_0x5a6f65['id']),util[_0x60d5('0x24')](_0x55f690,{'showHidden':![],'depth':null}));}return _0x7f9a2c(null,_0x522275);})[_0x60d5('0x2a')](function(_0x559386){logger[_0x60d5('0x22')](util[_0x60d5('0x23')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5a6f65[_0x60d5('0x21')],_0x5a6f65['id']),util[_0x60d5('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x7f9a2c(_0x559386);});}else{return _0x7f9a2c(null,_0x522275);}}}});}; \ No newline at end of file +var _0xaa0a=['inspect','zone','code','slice','https://accounts.zoho.com','parse','refreshToken','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','catch','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','ZohoAccount','int_zoho_accounts','changed','clientId','clientSecret','host','serverUrl','substring','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','authorization_code','application/x-www-form-urlencoded','then','refresh_token','format','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d'];(function(_0x5873f6,_0x32ad29){var _0x1da8ea=function(_0x32d5be){while(--_0x32d5be){_0x5873f6['push'](_0x5873f6['shift']());}};_0x1da8ea(++_0x32ad29);}(_0xaa0a,0x100));var _0xaaa0=function(_0x3266d4,_0xf3a96e){_0x3266d4=_0x3266d4-0x0;var _0x2b2e38=_0xaa0a[_0x3266d4];return _0x2b2e38;};'use strict';var _=require(_0xaaa0('0x0'));var util=require(_0xaaa0('0x1'));var logger=require(_0xaaa0('0x2'))('api');var moment=require(_0xaaa0('0x3'));var BPromise=require(_0xaaa0('0x4'));var rp=require(_0xaaa0('0x5'));var fs=require('fs');var path=require(_0xaaa0('0x6'));var rimraf=require(_0xaaa0('0x7'));var config=require('../../config/environment');var attributes=require('./intZohoAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xaaa0('0x8')]=function(_0x3dc198,_0x3609e4){return _0x3dc198['define'](_0xaaa0('0x9'),attributes,{'tableName':_0xaaa0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x27851e,_0x4942dc,_0x757b60){if(_0x27851e[_0xaaa0('0xb')]('zone')||_0x27851e[_0xaaa0('0xb')]('serverUrl')||_0x27851e['changed'](_0xaaa0('0xc'))||_0x27851e[_0xaaa0('0xb')](_0xaaa0('0xd'))||_0x27851e[_0xaaa0('0xb')]('code')||_0x27851e['changed'](_0xaaa0('0xe'))){var _0xa936d3,_0x28ed88;_0xa936d3=_0x27851e[_0xaaa0('0xf')];var _0x2307c1=_0xa936d3['slice'](-0x1);if(_0x2307c1==='/'||_0x2307c1==='\x5c'||_0x2307c1===':'){_0xa936d3=_0xa936d3[_0xaaa0('0x10')](0x0,_0xa936d3[_0xaaa0('0x11')](_0x2307c1));}switch(_0x27851e['zone']){case'US':_0x28ed88='https://accounts.zoho.com';break;case'AU':_0x28ed88=_0xaaa0('0x12');break;case'IN':_0x28ed88=_0xaaa0('0x13');break;case'CN':_0x28ed88=_0xaaa0('0x14');break;default:_0x28ed88=_0xaaa0('0x15');break;}var _0x4a70d2={'method':_0xaaa0('0x16'),'uri':_0x28ed88+'/oauth/v2/token','form':{'grant_type':_0xaaa0('0x17'),'client_id':_0x27851e['clientId'],'client_secret':_0x27851e[_0xaaa0('0xd')],'redirect_uri':_0x27851e['serverUrl'],'code':_0x27851e['code']},'headers':{'Content-Type':_0xaaa0('0x18')}};return rp(_0x4a70d2)[_0xaaa0('0x19')](function(_0x3da33c){var _0x2d723d=JSON['parse'](_0x3da33c);if(_0x2d723d[_0xaaa0('0x1a')]){_0x27851e['refreshToken']=_0x2d723d[_0xaaa0('0x1a')];logger['info'](util[_0xaaa0('0x1b')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x27851e[_0xaaa0('0x1c')],_0x27851e['id']));}else{logger[_0xaaa0('0x1d')](util[_0xaaa0('0x1b')](_0xaaa0('0x1e'),_0x27851e[_0xaaa0('0x1c')],_0x27851e['id']),util[_0xaaa0('0x1f')](_0x2d723d,{'showHidden':![],'depth':null}));}return _0x757b60(null,_0x4942dc);})['catch'](function(_0x2ca15b){logger[_0xaaa0('0x1d')](util['format'](_0xaaa0('0x1e'),_0x27851e[_0xaaa0('0x1c')],_0x27851e['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x757b60(_0x2ca15b);});}else{return _0x757b60(null,_0x4942dc);}},'beforeUpdate':function(_0x554b8d,_0x3673ef,_0x205ed6){if(_0x554b8d[_0xaaa0('0xb')](_0xaaa0('0x20'))||_0x554b8d[_0xaaa0('0xb')](_0xaaa0('0xf'))||_0x554b8d[_0xaaa0('0xb')](_0xaaa0('0xc'))||_0x554b8d[_0xaaa0('0xb')](_0xaaa0('0xd'))||_0x554b8d['changed'](_0xaaa0('0x21'))||_0x554b8d[_0xaaa0('0xb')](_0xaaa0('0xe'))){var _0x24372d,_0x510afd;_0x24372d=_0x554b8d[_0xaaa0('0xf')];var _0x4b67f7=_0x24372d[_0xaaa0('0x22')](-0x1);if(_0x4b67f7==='/'||_0x4b67f7==='\x5c'||_0x4b67f7===':'){_0x24372d=_0x24372d['substring'](0x0,_0x24372d['lastIndexOf'](_0x4b67f7));}switch(_0x554b8d[_0xaaa0('0x20')]){case'US':_0x510afd=_0xaaa0('0x23');break;case'AU':_0x510afd=_0xaaa0('0x12');break;case'IN':_0x510afd=_0xaaa0('0x13');break;case'CN':_0x510afd=_0xaaa0('0x14');break;default:_0x510afd='https://accounts.zoho.eu';break;}var _0x344220={'method':_0xaaa0('0x16'),'uri':_0x510afd+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0x554b8d[_0xaaa0('0xc')],'client_secret':_0x554b8d[_0xaaa0('0xd')],'redirect_uri':_0x554b8d['serverUrl'],'code':_0x554b8d[_0xaaa0('0x21')]},'headers':{'Content-Type':_0xaaa0('0x18')}};return rp(_0x344220)[_0xaaa0('0x19')](function(_0x785848){var _0x4d63fa=JSON[_0xaaa0('0x24')](_0x785848);if(_0x4d63fa[_0xaaa0('0x1a')]){_0x554b8d[_0xaaa0('0x25')]=_0x4d63fa[_0xaaa0('0x1a')];logger[_0xaaa0('0x26')](util[_0xaaa0('0x1b')](_0xaaa0('0x27'),_0x554b8d[_0xaaa0('0x1c')],_0x554b8d['id']));}else{logger[_0xaaa0('0x1d')](util['format'](_0xaaa0('0x1e'),_0x554b8d[_0xaaa0('0x1c')],_0x554b8d['id']),util[_0xaaa0('0x1f')](_0x4d63fa,{'showHidden':![],'depth':null}));}return _0x205ed6(null,_0x3673ef);})[_0xaaa0('0x28')](function(_0x2d3c55){logger['error'](util['format'](_0xaaa0('0x1e'),_0x554b8d[_0xaaa0('0x1c')],_0x554b8d['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x205ed6(_0x2d3c55);});}else{return _0x205ed6(null,_0x3673ef);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 2b2e63b..dedfd3f 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 _0xe77c=['request','then','info','ZohoAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetZohoAccount','findAll','options','raw','where','limit','include','map','model','attributes','ShowZohoAccount','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http'];(function(_0x355b92,_0x2ff02d){var _0x35dbab=function(_0x391976){while(--_0x391976){_0x355b92['push'](_0x355b92['shift']());}};_0x35dbab(++_0x2ff02d);}(_0xe77c,0x176));var _0xce77=function(_0x5e4ecd,_0x54f6e3){_0x5e4ecd=_0x5e4ecd-0x0;var _0x2b2c16=_0xe77c[_0x5e4ecd];return _0x2b2c16;};'use strict';var _=require(_0xce77('0x0'));var util=require(_0xce77('0x1'));var moment=require(_0xce77('0x2'));var BPromise=require('bluebird');var rs=require(_0xce77('0x3'));var fs=require('fs');var Redis=require(_0xce77('0x4'));var db=require(_0xce77('0x5'))['db'];var utils=require(_0xce77('0x6'));var logger=require(_0xce77('0x7'))(_0xce77('0x8'));var config=require(_0xce77('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xce77('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51fe6b,_0x3a9d5d,_0x30b78b){return new BPromise(function(_0x3e85c9,_0x5492f7){return client[_0xce77('0xb')](_0x51fe6b,_0x30b78b)[_0xce77('0xc')](function(_0x82cc7e){logger[_0xce77('0xd')](_0xce77('0xe'),_0x3a9d5d,'request\x20sent');logger[_0xce77('0xf')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x3a9d5d,_0xce77('0x10'),JSON[_0xce77('0x11')](_0x82cc7e));if(_0x82cc7e[_0xce77('0x12')]){if(_0x82cc7e['error'][_0xce77('0x13')]===0x1f4){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x3a9d5d,_0x82cc7e['error']['message']);return _0x5492f7(_0x82cc7e[_0xce77('0x12')]['message']);}logger[_0xce77('0x12')](_0xce77('0xe'),_0x3a9d5d,_0x82cc7e[_0xce77('0x12')][_0xce77('0x14')]);return _0x3e85c9(_0x82cc7e[_0xce77('0x12')][_0xce77('0x14')]);}else{logger['info'](_0xce77('0xe'),_0x3a9d5d,'request\x20sent');_0x3e85c9(_0x82cc7e[_0xce77('0x15')][_0xce77('0x14')]);}})[_0xce77('0x16')](function(_0x5503c8){logger[_0xce77('0x12')](_0xce77('0xe'),_0x3a9d5d,_0x5503c8);_0x5492f7(_0x5503c8);});});}exports[_0xce77('0x17')]=function(_0x1caf50){var _0x40ec0b=this;return new Promise(function(_0x4ddd2c,_0x3262a3){return db['ZohoAccount'][_0xce77('0x18')]({'raw':_0x1caf50[_0xce77('0x19')]?_0x1caf50[_0xce77('0x19')][_0xce77('0x1a')]===undefined?!![]:![]:!![],'where':_0x1caf50['options']?_0x1caf50[_0xce77('0x19')][_0xce77('0x1b')]||null:null,'attributes':_0x1caf50[_0xce77('0x19')]?_0x1caf50[_0xce77('0x19')]['attributes']||null:null,'limit':_0x1caf50[_0xce77('0x19')]?_0x1caf50['options'][_0xce77('0x1c')]||null:null,'include':_0x1caf50[_0xce77('0x19')]?_0x1caf50['options'][_0xce77('0x1d')]?_[_0xce77('0x1e')](_0x1caf50['options'][_0xce77('0x1d')],function(_0x261a11){return{'model':db[_0x261a11[_0xce77('0x1f')]],'as':_0x261a11['as'],'attributes':_0x261a11['attributes'],'include':_0x261a11['include']?_[_0xce77('0x1e')](_0x261a11[_0xce77('0x1d')],function(_0x223511){return{'model':db[_0x223511[_0xce77('0x1f')]],'as':_0x223511['as'],'attributes':_0x223511['attributes'],'include':_0x223511['include']?_[_0xce77('0x1e')](_0x223511[_0xce77('0x1d')],function(_0xa9b7cf){return{'model':db[_0xa9b7cf[_0xce77('0x1f')]],'as':_0xa9b7cf['as'],'attributes':_0xa9b7cf[_0xce77('0x20')]};}):[]};}):[]};}):[]:[]})[_0xce77('0xc')](function(_0x166745){logger['info'](_0xce77('0x17'),_0x1caf50);logger[_0xce77('0xf')](_0xce77('0x17'),_0x1caf50,JSON[_0xce77('0x11')](_0x166745));_0x4ddd2c(_0x166745);})['catch'](function(_0x3e4a40){logger[_0xce77('0x12')](_0xce77('0x17'),_0x3e4a40[_0xce77('0x14')],_0x1caf50);_0x3262a3(_0x40ec0b['error'](0x1f4,_0x3e4a40[_0xce77('0x14')]));});});};exports[_0xce77('0x21')]=function(_0xd18f28){var _0x189f74=this;return new Promise(function(_0x1720e2,_0x495f08){return db['ZohoAccount'][_0xce77('0x22')]({'raw':_0xd18f28['options']?_0xd18f28[_0xce77('0x19')][_0xce77('0x1a')]===undefined?!![]:![]:!![],'where':_0xd18f28['options']?_0xd18f28[_0xce77('0x19')][_0xce77('0x1b')]||null:null,'attributes':_0xd18f28['options']?_0xd18f28['options']['attributes']||null:null,'include':_0xd18f28[_0xce77('0x19')]?_0xd18f28['options'][_0xce77('0x1d')]?_[_0xce77('0x1e')](_0xd18f28[_0xce77('0x19')][_0xce77('0x1d')],function(_0x51a6c3){return{'model':db[_0x51a6c3[_0xce77('0x1f')]],'as':_0x51a6c3['as'],'attributes':_0x51a6c3[_0xce77('0x20')],'include':_0x51a6c3[_0xce77('0x1d')]?_[_0xce77('0x1e')](_0x51a6c3[_0xce77('0x1d')],function(_0x219920){return{'model':db[_0x219920['model']],'as':_0x219920['as'],'attributes':_0x219920[_0xce77('0x20')],'include':_0x219920['include']?_[_0xce77('0x1e')](_0x219920[_0xce77('0x1d')],function(_0x3cf6c1){return{'model':db[_0x3cf6c1[_0xce77('0x1f')]],'as':_0x3cf6c1['as'],'attributes':_0x3cf6c1[_0xce77('0x20')]};}):[]};}):[]};}):[]:[]})[_0xce77('0xc')](function(_0x108376){logger[_0xce77('0xd')](_0xce77('0x21'),_0xd18f28);logger[_0xce77('0xf')](_0xce77('0x21'),_0xd18f28,JSON[_0xce77('0x11')](_0x108376));_0x1720e2(_0x108376);})['catch'](function(_0x3912a0){logger[_0xce77('0x12')]('ShowZohoAccount',_0x3912a0[_0xce77('0x14')],_0xd18f28);_0x495f08(_0x189f74[_0xce77('0x12')](0x1f4,_0x3912a0[_0xce77('0x14')]));});});}; \ No newline at end of file +var _0x4d68=['randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetZohoAccount','ZohoAccount','findAll','options','limit','include','attributes','map','model','ShowZohoAccount','find','raw','then','lodash','util','moment','bluebird'];(function(_0xe402c4,_0x2b8ed5){var _0x5b0ef7=function(_0xbe0a8d){while(--_0xbe0a8d){_0xe402c4['push'](_0xe402c4['shift']());}};_0x5b0ef7(++_0x2b8ed5);}(_0x4d68,0x1c3));var _0x84d6=function(_0x528497,_0x147e87){_0x528497=_0x528497-0x0;var _0x392d59=_0x4d68[_0x528497];return _0x392d59;};'use strict';var _=require(_0x84d6('0x0'));var util=require(_0x84d6('0x1'));var moment=require(_0x84d6('0x2'));var BPromise=require(_0x84d6('0x3'));var rs=require(_0x84d6('0x4'));var fs=require('fs');var Redis=require(_0x84d6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x84d6('0x6'));var logger=require('../../config/logger')(_0x84d6('0x7'));var config=require('../../config/environment');var jayson=require(_0x84d6('0x8'));var client=jayson[_0x84d6('0x9')][_0x84d6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x539e34,_0x561dd8,_0x218daf){return new BPromise(function(_0xa64ed3,_0x260859){return client[_0x84d6('0xb')](_0x539e34,_0x218daf)['then'](function(_0x411c7f){logger['info'](_0x84d6('0xc'),_0x561dd8,_0x84d6('0xd'));logger[_0x84d6('0xe')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x561dd8,'request\x20sent',JSON[_0x84d6('0xf')](_0x411c7f));if(_0x411c7f['error']){if(_0x411c7f[_0x84d6('0x10')][_0x84d6('0x11')]===0x1f4){logger[_0x84d6('0x10')](_0x84d6('0xc'),_0x561dd8,_0x411c7f[_0x84d6('0x10')]['message']);return _0x260859(_0x411c7f[_0x84d6('0x10')]['message']);}logger[_0x84d6('0x10')](_0x84d6('0xc'),_0x561dd8,_0x411c7f[_0x84d6('0x10')][_0x84d6('0x12')]);return _0xa64ed3(_0x411c7f[_0x84d6('0x10')][_0x84d6('0x12')]);}else{logger[_0x84d6('0x13')]('ZohoAccount,\x20%s,\x20%s',_0x561dd8,_0x84d6('0xd'));_0xa64ed3(_0x411c7f[_0x84d6('0x14')][_0x84d6('0x12')]);}})[_0x84d6('0x15')](function(_0x385e2b){logger['error'](_0x84d6('0xc'),_0x561dd8,_0x385e2b);_0x260859(_0x385e2b);});});}exports[_0x84d6('0x16')]=function(_0x579aa8){var _0x1bd84a=this;return new Promise(function(_0x47a884,_0x309f26){return db[_0x84d6('0x17')][_0x84d6('0x18')]({'raw':_0x579aa8[_0x84d6('0x19')]?_0x579aa8[_0x84d6('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x579aa8[_0x84d6('0x19')]?_0x579aa8[_0x84d6('0x19')]['where']||null:null,'attributes':_0x579aa8['options']?_0x579aa8[_0x84d6('0x19')]['attributes']||null:null,'limit':_0x579aa8['options']?_0x579aa8[_0x84d6('0x19')][_0x84d6('0x1a')]||null:null,'include':_0x579aa8[_0x84d6('0x19')]?_0x579aa8['options'][_0x84d6('0x1b')]?_['map'](_0x579aa8['options'][_0x84d6('0x1b')],function(_0x1b86f2){return{'model':db[_0x1b86f2['model']],'as':_0x1b86f2['as'],'attributes':_0x1b86f2[_0x84d6('0x1c')],'include':_0x1b86f2[_0x84d6('0x1b')]?_[_0x84d6('0x1d')](_0x1b86f2[_0x84d6('0x1b')],function(_0x5deaa5){return{'model':db[_0x5deaa5[_0x84d6('0x1e')]],'as':_0x5deaa5['as'],'attributes':_0x5deaa5['attributes'],'include':_0x5deaa5[_0x84d6('0x1b')]?_[_0x84d6('0x1d')](_0x5deaa5['include'],function(_0x500a81){return{'model':db[_0x500a81[_0x84d6('0x1e')]],'as':_0x500a81['as'],'attributes':_0x500a81['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x14eec8){logger['info'](_0x84d6('0x16'),_0x579aa8);logger['debug'](_0x84d6('0x16'),_0x579aa8,JSON[_0x84d6('0xf')](_0x14eec8));_0x47a884(_0x14eec8);})[_0x84d6('0x15')](function(_0x37adf9){logger[_0x84d6('0x10')](_0x84d6('0x16'),_0x37adf9[_0x84d6('0x12')],_0x579aa8);_0x309f26(_0x1bd84a[_0x84d6('0x10')](0x1f4,_0x37adf9[_0x84d6('0x12')]));});});};exports[_0x84d6('0x1f')]=function(_0x20c27b){var _0x1fa278=this;return new Promise(function(_0x56bc23,_0x2f60f1){return db[_0x84d6('0x17')][_0x84d6('0x20')]({'raw':_0x20c27b[_0x84d6('0x19')]?_0x20c27b[_0x84d6('0x19')][_0x84d6('0x21')]===undefined?!![]:![]:!![],'where':_0x20c27b[_0x84d6('0x19')]?_0x20c27b[_0x84d6('0x19')]['where']||null:null,'attributes':_0x20c27b[_0x84d6('0x19')]?_0x20c27b['options'][_0x84d6('0x1c')]||null:null,'include':_0x20c27b[_0x84d6('0x19')]?_0x20c27b['options'][_0x84d6('0x1b')]?_[_0x84d6('0x1d')](_0x20c27b['options'][_0x84d6('0x1b')],function(_0x6c3a2a){return{'model':db[_0x6c3a2a[_0x84d6('0x1e')]],'as':_0x6c3a2a['as'],'attributes':_0x6c3a2a[_0x84d6('0x1c')],'include':_0x6c3a2a[_0x84d6('0x1b')]?_['map'](_0x6c3a2a[_0x84d6('0x1b')],function(_0xf8d313){return{'model':db[_0xf8d313[_0x84d6('0x1e')]],'as':_0xf8d313['as'],'attributes':_0xf8d313['attributes'],'include':_0xf8d313[_0x84d6('0x1b')]?_['map'](_0xf8d313[_0x84d6('0x1b')],function(_0x525b56){return{'model':db[_0x525b56['model']],'as':_0x525b56['as'],'attributes':_0x525b56[_0x84d6('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x84d6('0x22')](function(_0x45b55f){logger['info'](_0x84d6('0x1f'),_0x20c27b);logger[_0x84d6('0xe')](_0x84d6('0x1f'),_0x20c27b,JSON['stringify'](_0x45b55f));_0x56bc23(_0x45b55f);})['catch'](function(_0x531a49){logger[_0x84d6('0x10')](_0x84d6('0x1f'),_0x531a49[_0x84d6('0x12')],_0x20c27b);_0x2f60f1(_0x1fa278[_0x84d6('0x10')](0x1f4,_0x531a49[_0x84d6('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 3b1d404..9f04f39 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 _0x7af6=['/:id/fields','isAuthenticated','getFields','/:id/subjects','/:id/descriptions','getDescriptions','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intZohoConfiguration.controller','get','/:id','show'];(function(_0x2bf6ae,_0x339ef3){var _0x2c10f1=function(_0x5e3059){while(--_0x5e3059){_0x2bf6ae['push'](_0x2bf6ae['shift']());}};_0x2c10f1(++_0x339ef3);}(_0x7af6,0x72));var _0x67af=function(_0x308182,_0x5c805a){_0x308182=_0x308182-0x0;var _0x423e4c=_0x7af6[_0x308182];return _0x423e4c;};'use strict';var multer=require(_0x67af('0x0'));var util=require(_0x67af('0x1'));var path=require(_0x67af('0x2'));var timeout=require(_0x67af('0x3'));var express=require(_0x67af('0x4'));var router=express[_0x67af('0x5')]();var fs_extra=require(_0x67af('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x67af('0x7'));var config=require('../../config/environment');var controller=require(_0x67af('0x8'));router[_0x67af('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x67af('0x9')](_0x67af('0xa'),auth['isAuthenticated'](),controller[_0x67af('0xb')]);router[_0x67af('0x9')](_0x67af('0xc'),auth[_0x67af('0xd')](),controller[_0x67af('0xe')]);router[_0x67af('0x9')](_0x67af('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x67af('0x9')](_0x67af('0x10'),auth['isAuthenticated'](),controller[_0x67af('0x11')]);router['post']('/',auth[_0x67af('0xd')](),controller['create']);router['put'](_0x67af('0xa'),auth[_0x67af('0xd')](),controller[_0x67af('0x12')]);router[_0x67af('0x13')]('/:id',auth[_0x67af('0xd')](),controller['destroy']);module[_0x67af('0x14')]=router; \ No newline at end of file +var _0x8761=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy'];(function(_0x272f27,_0x2ad9cd){var _0x121e7a=function(_0x2f5838){while(--_0x2f5838){_0x272f27['push'](_0x272f27['shift']());}};_0x121e7a(++_0x2ad9cd);}(_0x8761,0xb7));var _0x1876=function(_0x394699,_0x2292e6){_0x394699=_0x394699-0x0;var _0x275359=_0x8761[_0x394699];return _0x275359;};'use strict';var multer=require(_0x1876('0x0'));var util=require(_0x1876('0x1'));var path=require('path');var timeout=require(_0x1876('0x2'));var express=require(_0x1876('0x3'));var router=express[_0x1876('0x4')]();var fs_extra=require(_0x1876('0x5'));var auth=require(_0x1876('0x6'));var interaction=require(_0x1876('0x7'));var config=require(_0x1876('0x8'));var controller=require(_0x1876('0x9'));router['get']('/',auth[_0x1876('0xa')](),controller[_0x1876('0xb')]);router[_0x1876('0xc')](_0x1876('0xd'),auth[_0x1876('0xa')](),controller[_0x1876('0xe')]);router['get'](_0x1876('0xf'),auth[_0x1876('0xa')](),controller[_0x1876('0x10')]);router[_0x1876('0xc')]('/:id/subjects',auth[_0x1876('0xa')](),controller[_0x1876('0x11')]);router[_0x1876('0xc')](_0x1876('0x12'),auth['isAuthenticated'](),controller[_0x1876('0x13')]);router[_0x1876('0x14')]('/',auth[_0x1876('0xa')](),controller['create']);router[_0x1876('0x15')](_0x1876('0xd'),auth[_0x1876('0xa')](),controller[_0x1876('0x16')]);router[_0x1876('0x17')](_0x1876('0xd'),auth[_0x1876('0xa')](),controller[_0x1876('0x18')]);module[_0x1876('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 22e6bef..c487127 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 _0x910b=['exports','STRING','ENUM','lead','contact','nothing','contact_lead','sequelize'];(function(_0x323a88,_0x37a065){var _0x5cab3d=function(_0x433062){while(--_0x433062){_0x323a88['push'](_0x323a88['shift']());}};_0x5cab3d(++_0x37a065);}(_0x910b,0x1a7));var _0xb910=function(_0x263bff,_0x28aff9){_0x263bff=_0x263bff-0x0;var _0x5dfe74=_0x910b[_0x263bff];return _0x5dfe74;};'use strict';var Sequelize=require(_0xb910('0x0'));module[_0xb910('0x1')]={'name':{'type':Sequelize[_0xb910('0x2')]},'moduleCreate':{'type':Sequelize[_0xb910('0x3')](_0xb910('0x4'),_0xb910('0x5'),_0xb910('0x6')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0xb910('0x3')](_0xb910('0x7'),'contact',_0xb910('0x4')),'defaultValue':_0xb910('0x7')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2498=['sequelize','exports','STRING','ENUM','lead','contact','contact_lead'];(function(_0x471257,_0x1b872c){var _0x464acb=function(_0x2102e5){while(--_0x2102e5){_0x471257['push'](_0x471257['shift']());}};_0x464acb(++_0x1b872c);}(_0x2498,0x1a4));var _0x8249=function(_0x289f76,_0x42163e){_0x289f76=_0x289f76-0x0;var _0x5af847=_0x2498[_0x289f76];return _0x5af847;};'use strict';var Sequelize=require(_0x8249('0x0'));module[_0x8249('0x1')]={'name':{'type':Sequelize[_0x8249('0x2')]},'moduleCreate':{'type':Sequelize[_0x8249('0x3')](_0x8249('0x4'),_0x8249('0x5'),'nothing'),'defaultValue':_0x8249('0x4')},'moduleSearch':{'type':Sequelize[_0x8249('0x3')](_0x8249('0x6'),_0x8249('0x5'),_0x8249('0x4')),'defaultValue':_0x8249('0x6')},'description':{'type':Sequelize[_0x8249('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index f8af977..eff14c4 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 _0xe93b=['desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','error','stack','name','send','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','then','catch','params','find','create','body','update','destroy','getFields','hasOwnProperty','getSubjects','findOne','ZohoField','getDescriptions','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xe93b,0xe1));var _0xbe93=function(_0x1e4fcc,_0xc60569){_0x1e4fcc=_0x1e4fcc-0x0;var _0x5c4d6e=_0xe93b[_0x1e4fcc];return _0x5c4d6e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbe93('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbe93('0x1'));var rp=require(_0xbe93('0x2'));var moment=require('moment');var BPromise=require(_0xbe93('0x3'));var Mustache=require(_0xbe93('0x4'));var util=require(_0xbe93('0x5'));var path=require(_0xbe93('0x6'));var sox=require(_0xbe93('0x7'));var csv=require(_0xbe93('0x8'));var ejs=require(_0xbe93('0x9'));var fs=require('fs');var fs_extra=require(_0xbe93('0xa'));var _=require(_0xbe93('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbe93('0xc'));var toCsv=require('to-csv');var querystring=require(_0xbe93('0xd'));var Papa=require(_0xbe93('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbe93('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe93('0x10'));var logger=require(_0xbe93('0x11'))(_0xbe93('0x12'));var utils=require(_0xbe93('0x13'));var config=require(_0xbe93('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xbe93('0x15'))['db'];function respondWithStatusCode(_0x305a60,_0x839629){_0x839629=_0x839629||0xcc;return function(_0x115379){if(_0x115379){return _0x305a60[_0xbe93('0x16')](_0x839629);}return _0x305a60['status'](_0x839629)[_0xbe93('0x17')]();};}function respondWithResult(_0x5baa48,_0x55d16f){_0x55d16f=_0x55d16f||0xc8;return function(_0x280fe7){if(_0x280fe7){return _0x5baa48['status'](_0x55d16f)[_0xbe93('0x18')](_0x280fe7);}};}function respondWithFilteredResult(_0x4c68be,_0x53b95c){return function(_0x215b3d){if(_0x215b3d){var _0x3ab4d4=typeof _0x53b95c[_0xbe93('0x19')]===_0xbe93('0x1a')&&typeof _0x53b95c[_0xbe93('0x1b')]===_0xbe93('0x1a');var _0x10adfe=_0x215b3d[_0xbe93('0x1c')];var _0x4ba3e6=_0x3ab4d4?0x0:_0x53b95c['offset'];var _0x40124e=_0x3ab4d4?_0x215b3d[_0xbe93('0x1c')]:_0x53b95c[_0xbe93('0x19')]+_0x53b95c[_0xbe93('0x1b')];var _0x5e8be9;if(_0x40124e>=_0x10adfe){_0x40124e=_0x10adfe;_0x5e8be9=0xc8;}else{_0x5e8be9=0xce;}_0x4c68be[_0xbe93('0x1d')](_0x5e8be9);return _0x4c68be[_0xbe93('0x1e')](_0xbe93('0x1f'),_0x4ba3e6+'-'+_0x40124e+'/'+_0x10adfe)[_0xbe93('0x18')](_0x215b3d);}return null;};}function patchUpdates(_0x13a40f){return function(_0x30e882){try{jsonpatch[_0xbe93('0x20')](_0x30e882,_0x13a40f,!![]);}catch(_0x3f42a4){return BPromise[_0xbe93('0x21')](_0x3f42a4);}return _0x30e882[_0xbe93('0x22')]();};}function saveUpdates(_0x272ab2,_0x5d9388){return function(_0x343432){if(_0x343432){return _0x343432['update'](_0x272ab2)['then'](function(_0x3cf9f5){return _0x3cf9f5;});}return null;};}function removeEntity(_0x513075,_0x2891d2){return function(_0x4b7d48){if(_0x4b7d48){return _0x4b7d48['destroy']()['then'](function(){_0x513075[_0xbe93('0x1d')](0xcc)[_0xbe93('0x17')]();});}};}function handleEntityNotFound(_0x924f38,_0x2dd2d7){return function(_0x3ea4f7){if(!_0x3ea4f7){_0x924f38[_0xbe93('0x16')](0x194);}return _0x3ea4f7;};}function handleError(_0x285120,_0x41039e){_0x41039e=_0x41039e||0x1f4;return function(_0x5b39b1){logger[_0xbe93('0x23')](_0x5b39b1[_0xbe93('0x24')]);if(_0x5b39b1[_0xbe93('0x25')]){delete _0x5b39b1[_0xbe93('0x25')];}_0x285120[_0xbe93('0x1d')](_0x41039e)[_0xbe93('0x26')](_0x5b39b1);};}exports['index']=function(_0x113d85,_0x59b23f){var _0x4d0c3f={},_0x10cdf7={},_0x2d681c={'count':0x0,'rows':[]};var _0x1b4aa9=_[_0xbe93('0x27')](db[_0xbe93('0x28')][_0xbe93('0x29')],function(_0x4884f6){return{'name':_0x4884f6[_0xbe93('0x2a')],'type':_0x4884f6[_0xbe93('0x2b')][_0xbe93('0x2c')]};});_0x10cdf7[_0xbe93('0x2d')]=_[_0xbe93('0x27')](_0x1b4aa9,_0xbe93('0x25'));_0x10cdf7[_0xbe93('0x2e')]=_[_0xbe93('0x2f')](_0x113d85[_0xbe93('0x2e')]);_0x10cdf7[_0xbe93('0x30')]=_[_0xbe93('0x31')](_0x10cdf7[_0xbe93('0x2d')],_0x10cdf7[_0xbe93('0x2e')]);_0x4d0c3f[_0xbe93('0x32')]=_[_0xbe93('0x31')](_0x10cdf7['model'],qs[_0xbe93('0x33')](_0x113d85[_0xbe93('0x2e')][_0xbe93('0x33')]));_0x4d0c3f[_0xbe93('0x32')]=_0x4d0c3f['attributes'][_0xbe93('0x34')]?_0x4d0c3f[_0xbe93('0x32')]:_0x10cdf7['model'];if(!_0x113d85[_0xbe93('0x2e')]['hasOwnProperty'](_0xbe93('0x35'))){_0x4d0c3f[_0xbe93('0x1b')]=qs[_0xbe93('0x1b')](_0x113d85[_0xbe93('0x2e')][_0xbe93('0x1b')]);_0x4d0c3f[_0xbe93('0x19')]=qs[_0xbe93('0x19')](_0x113d85['query'][_0xbe93('0x19')]);}_0x4d0c3f[_0xbe93('0x36')]=qs[_0xbe93('0x37')](_0x113d85[_0xbe93('0x2e')][_0xbe93('0x37')]);_0x4d0c3f[_0xbe93('0x38')]=qs[_0xbe93('0x30')](_[_0xbe93('0x39')](_0x113d85[_0xbe93('0x2e')],_0x10cdf7[_0xbe93('0x30')]),_0x1b4aa9);if(_0x113d85[_0xbe93('0x2e')][_0xbe93('0x3a')]){_0x4d0c3f['where']=_[_0xbe93('0x3b')](_0x4d0c3f[_0xbe93('0x38')],{'$or':_[_0xbe93('0x27')](_0x1b4aa9,function(_0x3a3320){if(_0x3a3320[_0xbe93('0x2b')]!==_0xbe93('0x3c')){var _0x457fae={};_0x457fae[_0x3a3320[_0xbe93('0x25')]]={'$like':'%'+_0x113d85[_0xbe93('0x2e')]['filter']+'%'};return _0x457fae;}})});}_0x4d0c3f=_[_0xbe93('0x3b')]({},_0x4d0c3f,_0x113d85[_0xbe93('0x3d')]);var _0xb03147={'where':_0x4d0c3f[_0xbe93('0x38')]};return db['ZohoConfiguration'][_0xbe93('0x1c')](_0xb03147)['then'](function(_0x3aa8f9){_0x2d681c['count']=_0x3aa8f9;if(_0x113d85['query'][_0xbe93('0x3e')]){_0x4d0c3f[_0xbe93('0x3f')]=[{'all':!![]}];}return db[_0xbe93('0x28')]['findAll'](_0x4d0c3f);})['then'](function(_0x14ef06){_0x2d681c[_0xbe93('0x40')]=_0x14ef06;return _0x2d681c;})[_0xbe93('0x41')](respondWithFilteredResult(_0x59b23f,_0x4d0c3f))[_0xbe93('0x42')](handleError(_0x59b23f,null));};exports['show']=function(_0x163597,_0x2fbd38){var _0x514a63={'raw':![],'where':{'id':_0x163597[_0xbe93('0x43')]['id']}},_0x479eb9={};_0x479eb9[_0xbe93('0x2d')]=_[_0xbe93('0x2f')](db[_0xbe93('0x28')][_0xbe93('0x29')]);_0x479eb9['query']=_[_0xbe93('0x2f')](_0x163597[_0xbe93('0x2e')]);_0x479eb9[_0xbe93('0x30')]=_[_0xbe93('0x31')](_0x479eb9[_0xbe93('0x2d')],_0x479eb9['query']);_0x514a63['attributes']=_[_0xbe93('0x31')](_0x479eb9[_0xbe93('0x2d')],qs[_0xbe93('0x33')](_0x163597[_0xbe93('0x2e')]['fields']));_0x514a63[_0xbe93('0x32')]=_0x514a63[_0xbe93('0x32')]['length']?_0x514a63[_0xbe93('0x32')]:_0x479eb9[_0xbe93('0x2d')];if(_0x163597[_0xbe93('0x2e')][_0xbe93('0x3e')]){_0x514a63[_0xbe93('0x3f')]=[{'all':!![]}];}_0x514a63=_[_0xbe93('0x3b')]({},_0x514a63,_0x163597[_0xbe93('0x3d')]);return db[_0xbe93('0x28')][_0xbe93('0x44')](_0x514a63)['then'](handleEntityNotFound(_0x2fbd38,null))[_0xbe93('0x41')](respondWithResult(_0x2fbd38,null))[_0xbe93('0x42')](handleError(_0x2fbd38,null));};exports[_0xbe93('0x45')]=function(_0x32a411,_0x345e93){return db[_0xbe93('0x28')][_0xbe93('0x45')](_0x32a411[_0xbe93('0x46')],{})['then'](respondWithResult(_0x345e93,0xc9))['catch'](handleError(_0x345e93,null));};exports[_0xbe93('0x47')]=function(_0x1864ad,_0x4cbbf9){if(_0x1864ad[_0xbe93('0x46')]['id']){delete _0x1864ad['body']['id'];}return db[_0xbe93('0x28')][_0xbe93('0x44')]({'where':{'id':_0x1864ad[_0xbe93('0x43')]['id']}})[_0xbe93('0x41')](handleEntityNotFound(_0x4cbbf9,null))[_0xbe93('0x41')](saveUpdates(_0x1864ad[_0xbe93('0x46')],null))['then'](respondWithResult(_0x4cbbf9,null))[_0xbe93('0x42')](handleError(_0x4cbbf9,null));};exports[_0xbe93('0x48')]=function(_0x4e0dd0,_0x446b30){return db['ZohoConfiguration'][_0xbe93('0x44')]({'where':{'id':_0x4e0dd0[_0xbe93('0x43')]['id']}})[_0xbe93('0x41')](handleEntityNotFound(_0x446b30,null))[_0xbe93('0x41')](removeEntity(_0x446b30,null))[_0xbe93('0x42')](handleError(_0x446b30,null));};exports['getFields']=function(_0x4cf1c2,_0x121563,_0x2adaa1){var _0x41d0c7={};var _0x26e1a={};var _0x50080e;var _0x157bcf;return db[_0xbe93('0x28')]['findOne']({'where':{'id':_0x4cf1c2['params']['id']}})[_0xbe93('0x41')](handleEntityNotFound(_0x121563,null))[_0xbe93('0x41')](function(_0x447870){if(_0x447870){_0x50080e=_0x447870;_0x26e1a[_0xbe93('0x2d')]=_[_0xbe93('0x2f')](db['ZohoField'][_0xbe93('0x29')]);_0x26e1a[_0xbe93('0x2e')]=_[_0xbe93('0x2f')](_0x4cf1c2['query']);_0x26e1a[_0xbe93('0x30')]=_[_0xbe93('0x31')](_0x26e1a[_0xbe93('0x2d')],_0x26e1a[_0xbe93('0x2e')]);_0x41d0c7[_0xbe93('0x32')]=_[_0xbe93('0x31')](_0x26e1a['model'],qs['fields'](_0x4cf1c2[_0xbe93('0x2e')]['fields']));_0x41d0c7[_0xbe93('0x32')]=_0x41d0c7['attributes'][_0xbe93('0x34')]?_0x41d0c7[_0xbe93('0x32')]:_0x26e1a[_0xbe93('0x2d')];_0x41d0c7[_0xbe93('0x36')]=qs[_0xbe93('0x37')](_0x4cf1c2[_0xbe93('0x2e')][_0xbe93('0x37')]);_0x41d0c7['where']=qs[_0xbe93('0x30')](_[_0xbe93('0x39')](_0x4cf1c2[_0xbe93('0x2e')],_0x26e1a[_0xbe93('0x30')]));if(_0x4cf1c2[_0xbe93('0x2e')][_0xbe93('0x3a')]){_0x41d0c7[_0xbe93('0x38')]=_['merge'](_0x41d0c7[_0xbe93('0x38')],{'$or':_[_0xbe93('0x27')](_0x41d0c7[_0xbe93('0x32')],function(_0x5933d0){var _0x1f4596={};_0x1f4596[_0x5933d0]={'$like':'%'+_0x4cf1c2['query'][_0xbe93('0x3a')]+'%'};return _0x1f4596;})});}_0x41d0c7=_[_0xbe93('0x3b')]({},_0x41d0c7,_0x4cf1c2[_0xbe93('0x3d')]);return _0x50080e[_0xbe93('0x49')](_0x41d0c7);}})[_0xbe93('0x41')](function(_0xe05c5e){if(_0xe05c5e){_0x157bcf=_0xe05c5e['length'];if(!_0x4cf1c2[_0xbe93('0x2e')][_0xbe93('0x4a')](_0xbe93('0x35'))){_0x41d0c7['limit']=qs[_0xbe93('0x1b')](_0x4cf1c2[_0xbe93('0x2e')][_0xbe93('0x1b')]);_0x41d0c7['offset']=qs['offset'](_0x4cf1c2[_0xbe93('0x2e')][_0xbe93('0x19')]);}return _0x50080e['getFields'](_0x41d0c7);}})[_0xbe93('0x41')](function(_0x5eb613){if(_0x5eb613){return _0x5eb613?{'count':_0x157bcf,'rows':_0x5eb613}:null;}})[_0xbe93('0x41')](respondWithResult(_0x121563,null))[_0xbe93('0x42')](handleError(_0x121563,null));};exports[_0xbe93('0x4b')]=function(_0x2d275b,_0x290afc,_0x4236cc){var _0x1fb972={};var _0x3bbaf8={};var _0x2b0afe;var _0x567726;return db[_0xbe93('0x28')][_0xbe93('0x4c')]({'where':{'id':_0x2d275b[_0xbe93('0x43')]['id']}})[_0xbe93('0x41')](handleEntityNotFound(_0x290afc,null))['then'](function(_0x27168b){if(_0x27168b){_0x2b0afe=_0x27168b;_0x3bbaf8[_0xbe93('0x2d')]=_[_0xbe93('0x2f')](db[_0xbe93('0x4d')][_0xbe93('0x29')]);_0x3bbaf8[_0xbe93('0x2e')]=_[_0xbe93('0x2f')](_0x2d275b[_0xbe93('0x2e')]);_0x3bbaf8[_0xbe93('0x30')]=_[_0xbe93('0x31')](_0x3bbaf8[_0xbe93('0x2d')],_0x3bbaf8[_0xbe93('0x2e')]);_0x1fb972[_0xbe93('0x32')]=_[_0xbe93('0x31')](_0x3bbaf8[_0xbe93('0x2d')],qs['fields'](_0x2d275b[_0xbe93('0x2e')][_0xbe93('0x33')]));_0x1fb972['attributes']=_0x1fb972[_0xbe93('0x32')][_0xbe93('0x34')]?_0x1fb972['attributes']:_0x3bbaf8[_0xbe93('0x2d')];_0x1fb972[_0xbe93('0x36')]=qs[_0xbe93('0x37')](_0x2d275b[_0xbe93('0x2e')][_0xbe93('0x37')]);_0x1fb972['where']=qs[_0xbe93('0x30')](_[_0xbe93('0x39')](_0x2d275b[_0xbe93('0x2e')],_0x3bbaf8['filters']));if(_0x2d275b[_0xbe93('0x2e')][_0xbe93('0x3a')]){_0x1fb972[_0xbe93('0x38')]=_[_0xbe93('0x3b')](_0x1fb972[_0xbe93('0x38')],{'$or':_[_0xbe93('0x27')](_0x1fb972[_0xbe93('0x32')],function(_0x8e77b2){var _0x49dcbb={};_0x49dcbb[_0x8e77b2]={'$like':'%'+_0x2d275b[_0xbe93('0x2e')]['filter']+'%'};return _0x49dcbb;})});}_0x1fb972=_[_0xbe93('0x3b')]({},_0x1fb972,_0x2d275b[_0xbe93('0x3d')]);return _0x2b0afe[_0xbe93('0x4b')](_0x1fb972);}})[_0xbe93('0x41')](function(_0x250e63){if(_0x250e63){_0x567726=_0x250e63['length'];if(!_0x2d275b[_0xbe93('0x2e')]['hasOwnProperty']('nolimit')){_0x1fb972[_0xbe93('0x1b')]=qs[_0xbe93('0x1b')](_0x2d275b[_0xbe93('0x2e')][_0xbe93('0x1b')]);_0x1fb972['offset']=qs[_0xbe93('0x19')](_0x2d275b[_0xbe93('0x2e')][_0xbe93('0x19')]);}return _0x2b0afe[_0xbe93('0x4b')](_0x1fb972);}})[_0xbe93('0x41')](function(_0x4068a0){if(_0x4068a0){return _0x4068a0?{'count':_0x567726,'rows':_0x4068a0}:null;}})[_0xbe93('0x41')](respondWithResult(_0x290afc,null))[_0xbe93('0x42')](handleError(_0x290afc,null));};exports['getDescriptions']=function(_0x5744f4,_0x329d1c,_0x1cf772){var _0x261185={};var _0x1b382d={};var _0x135594;var _0xcdb05c;return db[_0xbe93('0x28')][_0xbe93('0x4c')]({'where':{'id':_0x5744f4['params']['id']}})[_0xbe93('0x41')](handleEntityNotFound(_0x329d1c,null))[_0xbe93('0x41')](function(_0x21580e){if(_0x21580e){_0x135594=_0x21580e;_0x1b382d[_0xbe93('0x2d')]=_[_0xbe93('0x2f')](db[_0xbe93('0x4d')][_0xbe93('0x29')]);_0x1b382d[_0xbe93('0x2e')]=_[_0xbe93('0x2f')](_0x5744f4[_0xbe93('0x2e')]);_0x1b382d[_0xbe93('0x30')]=_['intersection'](_0x1b382d[_0xbe93('0x2d')],_0x1b382d[_0xbe93('0x2e')]);_0x261185[_0xbe93('0x32')]=_[_0xbe93('0x31')](_0x1b382d[_0xbe93('0x2d')],qs[_0xbe93('0x33')](_0x5744f4['query'][_0xbe93('0x33')]));_0x261185['attributes']=_0x261185[_0xbe93('0x32')]['length']?_0x261185[_0xbe93('0x32')]:_0x1b382d[_0xbe93('0x2d')];_0x261185[_0xbe93('0x36')]=qs['sort'](_0x5744f4[_0xbe93('0x2e')][_0xbe93('0x37')]);_0x261185[_0xbe93('0x38')]=qs[_0xbe93('0x30')](_[_0xbe93('0x39')](_0x5744f4[_0xbe93('0x2e')],_0x1b382d['filters']));if(_0x5744f4[_0xbe93('0x2e')][_0xbe93('0x3a')]){_0x261185[_0xbe93('0x38')]=_[_0xbe93('0x3b')](_0x261185[_0xbe93('0x38')],{'$or':_[_0xbe93('0x27')](_0x261185[_0xbe93('0x32')],function(_0x27a919){var _0x63f47f={};_0x63f47f[_0x27a919]={'$like':'%'+_0x5744f4[_0xbe93('0x2e')][_0xbe93('0x3a')]+'%'};return _0x63f47f;})});}_0x261185=_[_0xbe93('0x3b')]({},_0x261185,_0x5744f4[_0xbe93('0x3d')]);return _0x135594[_0xbe93('0x4e')](_0x261185);}})[_0xbe93('0x41')](function(_0x1b1eb5){if(_0x1b1eb5){_0xcdb05c=_0x1b1eb5['length'];if(!_0x5744f4[_0xbe93('0x2e')]['hasOwnProperty'](_0xbe93('0x35'))){_0x261185[_0xbe93('0x1b')]=qs[_0xbe93('0x1b')](_0x5744f4[_0xbe93('0x2e')][_0xbe93('0x1b')]);_0x261185[_0xbe93('0x19')]=qs[_0xbe93('0x19')](_0x5744f4[_0xbe93('0x2e')][_0xbe93('0x19')]);}return _0x135594[_0xbe93('0x4e')](_0x261185);}})[_0xbe93('0x41')](function(_0x1b71ef){if(_0x1b71ef){return _0x1b71ef?{'count':_0xcdb05c,'rows':_0x1b71ef}:null;}})[_0xbe93('0x41')](respondWithResult(_0x329d1c,null))[_0xbe93('0x42')](handleError(_0x329d1c,null));}; \ No newline at end of file +var _0x614f=['count','offset','set','Content-Range','apply','then','destroy','end','error','name','send','map','ZohoConfiguration','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','findAll','catch','params','rawAttributes','includeAll','include','find','create','body','update','getFields','hasOwnProperty','getSubjects','ZohoField','getDescriptions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x614f,0xd5));var _0xf614=function(_0x2fc491,_0xd072c5){_0x2fc491=_0x2fc491-0x0;var _0x461a07=_0x614f[_0x2fc491];return _0x461a07;};'use strict';var emlformat=require(_0xf614('0x0'));var rimraf=require(_0xf614('0x1'));var zipdir=require(_0xf614('0x2'));var jsonpatch=require(_0xf614('0x3'));var rp=require(_0xf614('0x4'));var moment=require(_0xf614('0x5'));var BPromise=require(_0xf614('0x6'));var Mustache=require(_0xf614('0x7'));var util=require(_0xf614('0x8'));var path=require(_0xf614('0x9'));var sox=require(_0xf614('0xa'));var csv=require(_0xf614('0xb'));var ejs=require(_0xf614('0xc'));var fs=require('fs');var fs_extra=require(_0xf614('0xd'));var _=require('lodash');var squel=require(_0xf614('0xe'));var crypto=require(_0xf614('0xf'));var jsforce=require(_0xf614('0x10'));var deskjs=require(_0xf614('0x11'));var toCsv=require(_0xf614('0xb'));var querystring=require(_0xf614('0x12'));var Papa=require(_0xf614('0x13'));var Redis=require('ioredis');var authService=require(_0xf614('0x14'));var qs=require(_0xf614('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf614('0x16'));var logger=require(_0xf614('0x17'))(_0xf614('0x18'));var utils=require(_0xf614('0x19'));var config=require(_0xf614('0x1a'));var licenseUtil=require(_0xf614('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x249022,_0x1f0754){_0x1f0754=_0x1f0754||0xcc;return function(_0x3e9091){if(_0x3e9091){return _0x249022[_0xf614('0x1c')](_0x1f0754);}return _0x249022[_0xf614('0x1d')](_0x1f0754)['end']();};}function respondWithResult(_0xb3f74c,_0x424e44){_0x424e44=_0x424e44||0xc8;return function(_0x3d143f){if(_0x3d143f){return _0xb3f74c[_0xf614('0x1d')](_0x424e44)[_0xf614('0x1e')](_0x3d143f);}};}function respondWithFilteredResult(_0x1cd12d,_0x3558a8){return function(_0xb97853){if(_0xb97853){var _0x4d306f=typeof _0x3558a8['offset']===_0xf614('0x1f')&&typeof _0x3558a8[_0xf614('0x20')]===_0xf614('0x1f');var _0x287e38=_0xb97853[_0xf614('0x21')];var _0x38a71b=_0x4d306f?0x0:_0x3558a8[_0xf614('0x22')];var _0xf95032=_0x4d306f?_0xb97853[_0xf614('0x21')]:_0x3558a8[_0xf614('0x22')]+_0x3558a8['limit'];var _0x5c7843;if(_0xf95032>=_0x287e38){_0xf95032=_0x287e38;_0x5c7843=0xc8;}else{_0x5c7843=0xce;}_0x1cd12d[_0xf614('0x1d')](_0x5c7843);return _0x1cd12d[_0xf614('0x23')](_0xf614('0x24'),_0x38a71b+'-'+_0xf95032+'/'+_0x287e38)[_0xf614('0x1e')](_0xb97853);}return null;};}function patchUpdates(_0x429b68){return function(_0x5a8a6c){try{jsonpatch[_0xf614('0x25')](_0x5a8a6c,_0x429b68,!![]);}catch(_0x30095c){return BPromise['reject'](_0x30095c);}return _0x5a8a6c['save']();};}function saveUpdates(_0x55c18b,_0x1121f6){return function(_0xafbd8d){if(_0xafbd8d){return _0xafbd8d['update'](_0x55c18b)[_0xf614('0x26')](function(_0x127707){return _0x127707;});}return null;};}function removeEntity(_0x1ea59a,_0x278fdf){return function(_0x571624){if(_0x571624){return _0x571624[_0xf614('0x27')]()[_0xf614('0x26')](function(){_0x1ea59a['status'](0xcc)[_0xf614('0x28')]();});}};}function handleEntityNotFound(_0x943b4d,_0x1fe8d){return function(_0x288820){if(!_0x288820){_0x943b4d[_0xf614('0x1c')](0x194);}return _0x288820;};}function handleError(_0x37fecd,_0xaf98a3){_0xaf98a3=_0xaf98a3||0x1f4;return function(_0x2e0b8e){logger[_0xf614('0x29')](_0x2e0b8e['stack']);if(_0x2e0b8e[_0xf614('0x2a')]){delete _0x2e0b8e[_0xf614('0x2a')];}_0x37fecd[_0xf614('0x1d')](_0xaf98a3)[_0xf614('0x2b')](_0x2e0b8e);};}exports['index']=function(_0x4ec155,_0x3ee14c){var _0x332ec8={},_0x2bb7bd={},_0x164449={'count':0x0,'rows':[]};var _0x478071=_[_0xf614('0x2c')](db[_0xf614('0x2d')]['rawAttributes'],function(_0x1a8621){return{'name':_0x1a8621[_0xf614('0x2e')],'type':_0x1a8621[_0xf614('0x2f')][_0xf614('0x30')]};});_0x2bb7bd[_0xf614('0x31')]=_[_0xf614('0x2c')](_0x478071,'name');_0x2bb7bd[_0xf614('0x32')]=_[_0xf614('0x33')](_0x4ec155[_0xf614('0x32')]);_0x2bb7bd[_0xf614('0x34')]=_['intersection'](_0x2bb7bd[_0xf614('0x31')],_0x2bb7bd[_0xf614('0x32')]);_0x332ec8[_0xf614('0x35')]=_[_0xf614('0x36')](_0x2bb7bd[_0xf614('0x31')],qs[_0xf614('0x37')](_0x4ec155[_0xf614('0x32')][_0xf614('0x37')]));_0x332ec8[_0xf614('0x35')]=_0x332ec8[_0xf614('0x35')][_0xf614('0x38')]?_0x332ec8[_0xf614('0x35')]:_0x2bb7bd[_0xf614('0x31')];if(!_0x4ec155[_0xf614('0x32')]['hasOwnProperty'](_0xf614('0x39'))){_0x332ec8[_0xf614('0x20')]=qs['limit'](_0x4ec155[_0xf614('0x32')][_0xf614('0x20')]);_0x332ec8[_0xf614('0x22')]=qs['offset'](_0x4ec155[_0xf614('0x32')]['offset']);}_0x332ec8[_0xf614('0x3a')]=qs['sort'](_0x4ec155['query'][_0xf614('0x3b')]);_0x332ec8[_0xf614('0x3c')]=qs[_0xf614('0x34')](_[_0xf614('0x3d')](_0x4ec155[_0xf614('0x32')],_0x2bb7bd['filters']),_0x478071);if(_0x4ec155[_0xf614('0x32')]['filter']){_0x332ec8[_0xf614('0x3c')]=_[_0xf614('0x3e')](_0x332ec8[_0xf614('0x3c')],{'$or':_[_0xf614('0x2c')](_0x478071,function(_0x5dd2c1){if(_0x5dd2c1[_0xf614('0x2f')]!==_0xf614('0x3f')){var _0x3c53c9={};_0x3c53c9[_0x5dd2c1[_0xf614('0x2a')]]={'$like':'%'+_0x4ec155[_0xf614('0x32')][_0xf614('0x40')]+'%'};return _0x3c53c9;}})});}_0x332ec8=_[_0xf614('0x3e')]({},_0x332ec8,_0x4ec155[_0xf614('0x41')]);var _0x4ac631={'where':_0x332ec8['where']};return db['ZohoConfiguration']['count'](_0x4ac631)[_0xf614('0x26')](function(_0x4c5f6e){_0x164449[_0xf614('0x21')]=_0x4c5f6e;if(_0x4ec155[_0xf614('0x32')]['includeAll']){_0x332ec8['include']=[{'all':!![]}];}return db['ZohoConfiguration'][_0xf614('0x42')](_0x332ec8);})[_0xf614('0x26')](function(_0x5641d2){_0x164449['rows']=_0x5641d2;return _0x164449;})[_0xf614('0x26')](respondWithFilteredResult(_0x3ee14c,_0x332ec8))[_0xf614('0x43')](handleError(_0x3ee14c,null));};exports['show']=function(_0x2134f6,_0x5c2a7f){var _0x17748b={'raw':![],'where':{'id':_0x2134f6[_0xf614('0x44')]['id']}},_0x310e7b={};_0x310e7b[_0xf614('0x31')]=_[_0xf614('0x33')](db[_0xf614('0x2d')][_0xf614('0x45')]);_0x310e7b[_0xf614('0x32')]=_['keys'](_0x2134f6[_0xf614('0x32')]);_0x310e7b[_0xf614('0x34')]=_['intersection'](_0x310e7b[_0xf614('0x31')],_0x310e7b['query']);_0x17748b[_0xf614('0x35')]=_[_0xf614('0x36')](_0x310e7b['model'],qs[_0xf614('0x37')](_0x2134f6['query'][_0xf614('0x37')]));_0x17748b[_0xf614('0x35')]=_0x17748b[_0xf614('0x35')][_0xf614('0x38')]?_0x17748b[_0xf614('0x35')]:_0x310e7b['model'];if(_0x2134f6[_0xf614('0x32')][_0xf614('0x46')]){_0x17748b[_0xf614('0x47')]=[{'all':!![]}];}_0x17748b=_[_0xf614('0x3e')]({},_0x17748b,_0x2134f6[_0xf614('0x41')]);return db[_0xf614('0x2d')][_0xf614('0x48')](_0x17748b)['then'](handleEntityNotFound(_0x5c2a7f,null))[_0xf614('0x26')](respondWithResult(_0x5c2a7f,null))[_0xf614('0x43')](handleError(_0x5c2a7f,null));};exports[_0xf614('0x49')]=function(_0x7ddc36,_0x42ae10){return db[_0xf614('0x2d')][_0xf614('0x49')](_0x7ddc36[_0xf614('0x4a')],{})[_0xf614('0x26')](respondWithResult(_0x42ae10,0xc9))[_0xf614('0x43')](handleError(_0x42ae10,null));};exports[_0xf614('0x4b')]=function(_0x27706c,_0x5cefc7){if(_0x27706c[_0xf614('0x4a')]['id']){delete _0x27706c[_0xf614('0x4a')]['id'];}return db[_0xf614('0x2d')][_0xf614('0x48')]({'where':{'id':_0x27706c[_0xf614('0x44')]['id']}})[_0xf614('0x26')](handleEntityNotFound(_0x5cefc7,null))[_0xf614('0x26')](saveUpdates(_0x27706c[_0xf614('0x4a')],null))['then'](respondWithResult(_0x5cefc7,null))['catch'](handleError(_0x5cefc7,null));};exports[_0xf614('0x27')]=function(_0x4048f3,_0x53c379){return db['ZohoConfiguration'][_0xf614('0x48')]({'where':{'id':_0x4048f3[_0xf614('0x44')]['id']}})[_0xf614('0x26')](handleEntityNotFound(_0x53c379,null))[_0xf614('0x26')](removeEntity(_0x53c379,null))[_0xf614('0x43')](handleError(_0x53c379,null));};exports['getFields']=function(_0x503b97,_0x45c22d,_0x2f0413){var _0x9b2cb2={};var _0x6076e9={};var _0x4ef607;var _0x42c349;return db[_0xf614('0x2d')]['findOne']({'where':{'id':_0x503b97[_0xf614('0x44')]['id']}})['then'](handleEntityNotFound(_0x45c22d,null))[_0xf614('0x26')](function(_0x232a92){if(_0x232a92){_0x4ef607=_0x232a92;_0x6076e9[_0xf614('0x31')]=_['keys'](db['ZohoField'][_0xf614('0x45')]);_0x6076e9[_0xf614('0x32')]=_[_0xf614('0x33')](_0x503b97['query']);_0x6076e9['filters']=_[_0xf614('0x36')](_0x6076e9['model'],_0x6076e9[_0xf614('0x32')]);_0x9b2cb2[_0xf614('0x35')]=_[_0xf614('0x36')](_0x6076e9['model'],qs[_0xf614('0x37')](_0x503b97[_0xf614('0x32')][_0xf614('0x37')]));_0x9b2cb2[_0xf614('0x35')]=_0x9b2cb2[_0xf614('0x35')]['length']?_0x9b2cb2[_0xf614('0x35')]:_0x6076e9[_0xf614('0x31')];_0x9b2cb2[_0xf614('0x3a')]=qs[_0xf614('0x3b')](_0x503b97[_0xf614('0x32')][_0xf614('0x3b')]);_0x9b2cb2[_0xf614('0x3c')]=qs['filters'](_['pick'](_0x503b97[_0xf614('0x32')],_0x6076e9[_0xf614('0x34')]));if(_0x503b97['query'][_0xf614('0x40')]){_0x9b2cb2[_0xf614('0x3c')]=_[_0xf614('0x3e')](_0x9b2cb2[_0xf614('0x3c')],{'$or':_[_0xf614('0x2c')](_0x9b2cb2[_0xf614('0x35')],function(_0xd4d378){var _0x320873={};_0x320873[_0xd4d378]={'$like':'%'+_0x503b97[_0xf614('0x32')][_0xf614('0x40')]+'%'};return _0x320873;})});}_0x9b2cb2=_[_0xf614('0x3e')]({},_0x9b2cb2,_0x503b97[_0xf614('0x41')]);return _0x4ef607[_0xf614('0x4c')](_0x9b2cb2);}})[_0xf614('0x26')](function(_0x467530){if(_0x467530){_0x42c349=_0x467530[_0xf614('0x38')];if(!_0x503b97['query'][_0xf614('0x4d')](_0xf614('0x39'))){_0x9b2cb2[_0xf614('0x20')]=qs[_0xf614('0x20')](_0x503b97[_0xf614('0x32')]['limit']);_0x9b2cb2['offset']=qs[_0xf614('0x22')](_0x503b97[_0xf614('0x32')][_0xf614('0x22')]);}return _0x4ef607[_0xf614('0x4c')](_0x9b2cb2);}})['then'](function(_0x6952ad){if(_0x6952ad){return _0x6952ad?{'count':_0x42c349,'rows':_0x6952ad}:null;}})[_0xf614('0x26')](respondWithResult(_0x45c22d,null))[_0xf614('0x43')](handleError(_0x45c22d,null));};exports[_0xf614('0x4e')]=function(_0x273f91,_0x411d3e,_0x1b0bc3){var _0x41c73d={};var _0x3c3c86={};var _0x26ee72;var _0x5b69aa;return db[_0xf614('0x2d')]['findOne']({'where':{'id':_0x273f91[_0xf614('0x44')]['id']}})[_0xf614('0x26')](handleEntityNotFound(_0x411d3e,null))[_0xf614('0x26')](function(_0x2eb219){if(_0x2eb219){_0x26ee72=_0x2eb219;_0x3c3c86['model']=_[_0xf614('0x33')](db[_0xf614('0x4f')]['rawAttributes']);_0x3c3c86[_0xf614('0x32')]=_[_0xf614('0x33')](_0x273f91['query']);_0x3c3c86[_0xf614('0x34')]=_[_0xf614('0x36')](_0x3c3c86[_0xf614('0x31')],_0x3c3c86['query']);_0x41c73d[_0xf614('0x35')]=_['intersection'](_0x3c3c86['model'],qs[_0xf614('0x37')](_0x273f91['query']['fields']));_0x41c73d[_0xf614('0x35')]=_0x41c73d[_0xf614('0x35')][_0xf614('0x38')]?_0x41c73d[_0xf614('0x35')]:_0x3c3c86[_0xf614('0x31')];_0x41c73d[_0xf614('0x3a')]=qs['sort'](_0x273f91['query'][_0xf614('0x3b')]);_0x41c73d[_0xf614('0x3c')]=qs['filters'](_[_0xf614('0x3d')](_0x273f91[_0xf614('0x32')],_0x3c3c86['filters']));if(_0x273f91[_0xf614('0x32')][_0xf614('0x40')]){_0x41c73d[_0xf614('0x3c')]=_['merge'](_0x41c73d[_0xf614('0x3c')],{'$or':_[_0xf614('0x2c')](_0x41c73d[_0xf614('0x35')],function(_0x50cfa6){var _0x4b2feb={};_0x4b2feb[_0x50cfa6]={'$like':'%'+_0x273f91[_0xf614('0x32')][_0xf614('0x40')]+'%'};return _0x4b2feb;})});}_0x41c73d=_['merge']({},_0x41c73d,_0x273f91[_0xf614('0x41')]);return _0x26ee72['getSubjects'](_0x41c73d);}})[_0xf614('0x26')](function(_0x46b036){if(_0x46b036){_0x5b69aa=_0x46b036['length'];if(!_0x273f91[_0xf614('0x32')]['hasOwnProperty']('nolimit')){_0x41c73d[_0xf614('0x20')]=qs[_0xf614('0x20')](_0x273f91[_0xf614('0x32')][_0xf614('0x20')]);_0x41c73d['offset']=qs[_0xf614('0x22')](_0x273f91['query']['offset']);}return _0x26ee72[_0xf614('0x4e')](_0x41c73d);}})['then'](function(_0x20fe82){if(_0x20fe82){return _0x20fe82?{'count':_0x5b69aa,'rows':_0x20fe82}:null;}})[_0xf614('0x26')](respondWithResult(_0x411d3e,null))[_0xf614('0x43')](handleError(_0x411d3e,null));};exports[_0xf614('0x50')]=function(_0x565361,_0x2a5231,_0x23aaa6){var _0x30af10={};var _0x6f2595={};var _0xbae5af;var _0x494d55;return db['ZohoConfiguration'][_0xf614('0x51')]({'where':{'id':_0x565361[_0xf614('0x44')]['id']}})[_0xf614('0x26')](handleEntityNotFound(_0x2a5231,null))[_0xf614('0x26')](function(_0x1dbdbf){if(_0x1dbdbf){_0xbae5af=_0x1dbdbf;_0x6f2595['model']=_['keys'](db[_0xf614('0x4f')][_0xf614('0x45')]);_0x6f2595[_0xf614('0x32')]=_[_0xf614('0x33')](_0x565361[_0xf614('0x32')]);_0x6f2595[_0xf614('0x34')]=_[_0xf614('0x36')](_0x6f2595['model'],_0x6f2595[_0xf614('0x32')]);_0x30af10[_0xf614('0x35')]=_[_0xf614('0x36')](_0x6f2595[_0xf614('0x31')],qs['fields'](_0x565361[_0xf614('0x32')][_0xf614('0x37')]));_0x30af10[_0xf614('0x35')]=_0x30af10[_0xf614('0x35')][_0xf614('0x38')]?_0x30af10[_0xf614('0x35')]:_0x6f2595[_0xf614('0x31')];_0x30af10[_0xf614('0x3a')]=qs[_0xf614('0x3b')](_0x565361['query'][_0xf614('0x3b')]);_0x30af10['where']=qs[_0xf614('0x34')](_[_0xf614('0x3d')](_0x565361['query'],_0x6f2595['filters']));if(_0x565361[_0xf614('0x32')][_0xf614('0x40')]){_0x30af10[_0xf614('0x3c')]=_[_0xf614('0x3e')](_0x30af10[_0xf614('0x3c')],{'$or':_['map'](_0x30af10['attributes'],function(_0x19c86e){var _0x6fa673={};_0x6fa673[_0x19c86e]={'$like':'%'+_0x565361[_0xf614('0x32')][_0xf614('0x40')]+'%'};return _0x6fa673;})});}_0x30af10=_[_0xf614('0x3e')]({},_0x30af10,_0x565361[_0xf614('0x41')]);return _0xbae5af[_0xf614('0x50')](_0x30af10);}})[_0xf614('0x26')](function(_0x32b450){if(_0x32b450){_0x494d55=_0x32b450['length'];if(!_0x565361[_0xf614('0x32')][_0xf614('0x4d')]('nolimit')){_0x30af10['limit']=qs['limit'](_0x565361[_0xf614('0x32')][_0xf614('0x20')]);_0x30af10[_0xf614('0x22')]=qs['offset'](_0x565361[_0xf614('0x32')][_0xf614('0x22')]);}return _0xbae5af['getDescriptions'](_0x30af10);}})[_0xf614('0x26')](function(_0x14b143){if(_0x14b143){return _0x14b143?{'count':_0x494d55,'rows':_0x14b143}:null;}})[_0xf614('0x26')](respondWithResult(_0x2a5231,null))['catch'](handleError(_0x2a5231,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 96e54fe..09ba84b 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 _0x5e57=['path','./intZohoConfiguration.attributes','exports','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5c6b70,_0x140052){var _0x40453b=function(_0x42b9e8){while(--_0x42b9e8){_0x5c6b70['push'](_0x5c6b70['shift']());}};_0x40453b(++_0x140052);}(_0x5e57,0x1a7));var _0x75e5=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5e57[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x75e5('0x0'));var util=require(_0x75e5('0x1'));var logger=require(_0x75e5('0x2'))(_0x75e5('0x3'));var moment=require(_0x75e5('0x4'));var BPromise=require(_0x75e5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x75e5('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x75e5('0x7'));module[_0x75e5('0x8')]=function(_0x1914b2,_0x26873e){return _0x1914b2['define'](_0x75e5('0x9'),attributes,{'tableName':_0x75e5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3ab0=['bluebird','request-promise','rimraf','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','api','moment'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x3ab0,0x1eb));var _0x03ab=function(_0x469a16,_0x14f570){_0x469a16=_0x469a16-0x0;var _0x4785ab=_0x3ab0[_0x469a16];return _0x4785ab;};'use strict';var _=require(_0x03ab('0x0'));var util=require(_0x03ab('0x1'));var logger=require('../../config/logger')(_0x03ab('0x2'));var moment=require(_0x03ab('0x3'));var BPromise=require(_0x03ab('0x4'));var rp=require(_0x03ab('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x03ab('0x6'));var config=require('../../config/environment');var attributes=require('./intZohoConfiguration.attributes');module[_0x03ab('0x7')]=function(_0x18b378,_0x1b17fe){return _0x18b378[_0x03ab('0x8')](_0x03ab('0x9'),attributes,{'tableName':_0x03ab('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 be71e29..fbf1eb1 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 _0xe6aa=['then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','message','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x1fb212,_0x56f0c3){var _0x4564d9=function(_0x4af92a){while(--_0x4af92a){_0x1fb212['push'](_0x1fb212['shift']());}};_0x4564d9(++_0x56f0c3);}(_0xe6aa,0x16d));var _0xae6a=function(_0x40b6a5,_0x9a0b9a){_0x40b6a5=_0x40b6a5-0x0;var _0x2be645=_0xe6aa[_0x40b6a5];return _0x2be645;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xae6a('0x0'));var BPromise=require(_0xae6a('0x1'));var rs=require(_0xae6a('0x2'));var fs=require('fs');var Redis=require(_0xae6a('0x3'));var db=require(_0xae6a('0x4'))['db'];var utils=require(_0xae6a('0x5'));var logger=require(_0xae6a('0x6'))(_0xae6a('0x7'));var config=require(_0xae6a('0x8'));var jayson=require(_0xae6a('0x9'));var client=jayson[_0xae6a('0xa')][_0xae6a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d35cf,_0x4d918f,_0x59be8f){return new BPromise(function(_0x1648f3,_0x1500ea){return client[_0xae6a('0xc')](_0x5d35cf,_0x59be8f)[_0xae6a('0xd')](function(_0x5da325){logger[_0xae6a('0xe')](_0xae6a('0xf'),_0x4d918f,_0xae6a('0x10'));logger[_0xae6a('0x11')](_0xae6a('0x12'),_0x4d918f,'request\x20sent',JSON['stringify'](_0x5da325));if(_0x5da325[_0xae6a('0x13')]){if(_0x5da325[_0xae6a('0x13')]['code']===0x1f4){logger[_0xae6a('0x13')](_0xae6a('0xf'),_0x4d918f,_0x5da325[_0xae6a('0x13')][_0xae6a('0x14')]);return _0x1500ea(_0x5da325['error'][_0xae6a('0x14')]);}logger[_0xae6a('0x13')](_0xae6a('0xf'),_0x4d918f,_0x5da325['error'][_0xae6a('0x14')]);return _0x1648f3(_0x5da325[_0xae6a('0x13')][_0xae6a('0x14')]);}else{logger['info'](_0xae6a('0xf'),_0x4d918f,'request\x20sent');_0x1648f3(_0x5da325['result']['message']);}})['catch'](function(_0x74e4e4){logger['error'](_0xae6a('0xf'),_0x4d918f,_0x74e4e4);_0x1500ea(_0x74e4e4);});});} \ No newline at end of file +var _0xc064=['request\x20sent','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ZohoConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x297d90,_0x27666f){var _0xb673c2=function(_0x3e1a14){while(--_0x3e1a14){_0x297d90['push'](_0x297d90['shift']());}};_0xb673c2(++_0x27666f);}(_0xc064,0x1ab));var _0x4c06=function(_0x1f37f4,_0x3f7786){_0x1f37f4=_0x1f37f4-0x0;var _0x40acfb=_0xc064[_0x1f37f4];return _0x40acfb;};'use strict';var _=require(_0x4c06('0x0'));var util=require(_0x4c06('0x1'));var moment=require(_0x4c06('0x2'));var BPromise=require('bluebird');var rs=require(_0x4c06('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4c06('0x4'))(_0x4c06('0x5'));var config=require(_0x4c06('0x6'));var jayson=require(_0x4c06('0x7'));var client=jayson[_0x4c06('0x8')][_0x4c06('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d15b8,_0x5889e2,_0xbea186){return new BPromise(function(_0x39bdd0,_0x47bb41){return client[_0x4c06('0xa')](_0x3d15b8,_0xbea186)[_0x4c06('0xb')](function(_0x188f3f){logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x5889e2,'request\x20sent');logger['debug'](_0x4c06('0xc'),_0x5889e2,_0x4c06('0xd'),JSON[_0x4c06('0xe')](_0x188f3f));if(_0x188f3f[_0x4c06('0xf')]){if(_0x188f3f[_0x4c06('0xf')][_0x4c06('0x10')]===0x1f4){logger['error'](_0x4c06('0x11'),_0x5889e2,_0x188f3f['error'][_0x4c06('0x12')]);return _0x47bb41(_0x188f3f[_0x4c06('0xf')][_0x4c06('0x12')]);}logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x5889e2,_0x188f3f['error']['message']);return _0x39bdd0(_0x188f3f[_0x4c06('0xf')][_0x4c06('0x12')]);}else{logger['info'](_0x4c06('0x11'),_0x5889e2,_0x4c06('0xd'));_0x39bdd0(_0x188f3f['result'][_0x4c06('0x12')]);}})[_0x4c06('0x13')](function(_0x4a9f92){logger[_0x4c06('0xf')](_0x4c06('0x11'),_0x5889e2,_0x4a9f92);_0x47bb41(_0x4a9f92);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index e16a7e3..9ece6b9 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 _0x2208=['update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','put'];(function(_0x57f40a,_0x2f2884){var _0x3f6236=function(_0x3b7505){while(--_0x3b7505){_0x57f40a['push'](_0x57f40a['shift']());}};_0x3f6236(++_0x2f2884);}(_0x2208,0xb7));var _0x8220=function(_0x5535ee,_0x1758f2){_0x5535ee=_0x5535ee-0x0;var _0x1ebc73=_0x2208[_0x5535ee];return _0x1ebc73;};'use strict';var multer=require(_0x8220('0x0'));var util=require(_0x8220('0x1'));var path=require(_0x8220('0x2'));var timeout=require(_0x8220('0x3'));var express=require(_0x8220('0x4'));var router=express[_0x8220('0x5')]();var fs_extra=require(_0x8220('0x6'));var auth=require(_0x8220('0x7'));var interaction=require(_0x8220('0x8'));var config=require(_0x8220('0x9'));var controller=require('./intZohoField.controller');router[_0x8220('0xa')]('/',auth[_0x8220('0xb')](),controller[_0x8220('0xc')]);router['get'](_0x8220('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x8220('0xb')](),controller['create']);router[_0x8220('0xe')](_0x8220('0xd'),auth[_0x8220('0xb')](),controller[_0x8220('0xf')]);router[_0x8220('0x10')](_0x8220('0xd'),auth[_0x8220('0xb')](),controller['destroy']);module[_0x8220('0x11')]=router; \ No newline at end of file +var _0xcc89=['show','create','update','delete','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoField.controller','isAuthenticated','index','/:id'];(function(_0x2d9342,_0x16a510){var _0x2237d5=function(_0x13d5b3){while(--_0x13d5b3){_0x2d9342['push'](_0x2d9342['shift']());}};_0x2237d5(++_0x16a510);}(_0xcc89,0x12a));var _0x9cc8=function(_0x1ecd04,_0x55bd8c){_0x1ecd04=_0x1ecd04-0x0;var _0x224282=_0xcc89[_0x1ecd04];return _0x224282;};'use strict';var multer=require('multer');var util=require(_0x9cc8('0x0'));var path=require(_0x9cc8('0x1'));var timeout=require('connect-timeout');var express=require(_0x9cc8('0x2'));var router=express['Router']();var fs_extra=require(_0x9cc8('0x3'));var auth=require(_0x9cc8('0x4'));var interaction=require(_0x9cc8('0x5'));var config=require('../../config/environment');var controller=require(_0x9cc8('0x6'));router['get']('/',auth[_0x9cc8('0x7')](),controller[_0x9cc8('0x8')]);router['get'](_0x9cc8('0x9'),auth[_0x9cc8('0x7')](),controller[_0x9cc8('0xa')]);router['post']('/',auth[_0x9cc8('0x7')](),controller[_0x9cc8('0xb')]);router['put'](_0x9cc8('0x9'),auth[_0x9cc8('0x7')](),controller[_0x9cc8('0xc')]);router[_0x9cc8('0xd')](_0x9cc8('0x9'),auth[_0x9cc8('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 52d564b..dc0594d 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 _0x67d5=['picklist','STRING','BOOLEAN','sequelize','exports','string','variable','customVariable','keyValue'];(function(_0x324905,_0xda4364){var _0x178a4a=function(_0x4154aa){while(--_0x4154aa){_0x324905['push'](_0x324905['shift']());}};_0x178a4a(++_0xda4364);}(_0x67d5,0x1a1));var _0x567d=function(_0x5385bb,_0x2fa3c6){_0x5385bb=_0x5385bb-0x0;var _0x1acb9b=_0x67d5[_0x5385bb];return _0x1acb9b;};'use strict';var Sequelize=require(_0x567d('0x0'));module[_0x567d('0x1')]={'type':{'type':Sequelize['ENUM'](_0x567d('0x2'),_0x567d('0x3'),_0x567d('0x4'),_0x567d('0x5'),_0x567d('0x6')),'defaultValue':_0x567d('0x2')},'content':{'type':Sequelize[_0x567d('0x7')]},'key':{'type':Sequelize[_0x567d('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x567d('0x2'),_0x567d('0x3'),_0x567d('0x4'))},'keyContent':{'type':Sequelize[_0x567d('0x7')]},'idField':{'type':Sequelize[_0x567d('0x7')]},'nameField':{'type':Sequelize[_0x567d('0x7')]},'customField':{'type':Sequelize[_0x567d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x567d('0x7')]}}; \ No newline at end of file +var _0xfb42=['exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x149ed7,_0x548ab5){var _0x5bfe42=function(_0x42c2c2){while(--_0x42c2c2){_0x149ed7['push'](_0x149ed7['shift']());}};_0x5bfe42(++_0x548ab5);}(_0xfb42,0x90));var _0x2fb4=function(_0x126264,_0x6eb855){_0x126264=_0x126264-0x0;var _0x5774ae=_0xfb42[_0x126264];return _0x5774ae;};'use strict';var Sequelize=require('sequelize');module[_0x2fb4('0x0')]={'type':{'type':Sequelize[_0x2fb4('0x1')](_0x2fb4('0x2'),_0x2fb4('0x3'),_0x2fb4('0x4'),_0x2fb4('0x5'),_0x2fb4('0x6')),'defaultValue':_0x2fb4('0x2')},'content':{'type':Sequelize[_0x2fb4('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x2fb4('0x1')]('string','variable',_0x2fb4('0x4'))},'keyContent':{'type':Sequelize[_0x2fb4('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x2fb4('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2fb4('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 792612a..5be7613 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 _0xedf3=['include','findAll','catch','show','create','body','find','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','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','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','destroy','sendStatus','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ZohoField','includeAll'];(function(_0x2af333,_0x54f43f){var _0x1f22a5=function(_0x15ff1b){while(--_0x15ff1b){_0x2af333['push'](_0x2af333['shift']());}};_0x1f22a5(++_0x54f43f);}(_0xedf3,0x17a));var _0x3edf=function(_0x516927,_0xb4aad0){_0x516927=_0x516927-0x0;var _0x30749b=_0xedf3[_0x516927];return _0x30749b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3edf('0x0'));var zipdir=require(_0x3edf('0x1'));var jsonpatch=require(_0x3edf('0x2'));var rp=require(_0x3edf('0x3'));var moment=require(_0x3edf('0x4'));var BPromise=require(_0x3edf('0x5'));var Mustache=require('mustache');var util=require(_0x3edf('0x6'));var path=require(_0x3edf('0x7'));var sox=require(_0x3edf('0x8'));var csv=require(_0x3edf('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3edf('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3edf('0xb'));var jsforce=require(_0x3edf('0xc'));var deskjs=require(_0x3edf('0xd'));var toCsv=require(_0x3edf('0x9'));var querystring=require(_0x3edf('0xe'));var Papa=require(_0x3edf('0xf'));var Redis=require(_0x3edf('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3edf('0x11'));var as=require(_0x3edf('0x12'));var hardwareService=require(_0x3edf('0x13'));var logger=require(_0x3edf('0x14'))(_0x3edf('0x15'));var utils=require(_0x3edf('0x16'));var config=require(_0x3edf('0x17'));var licenseUtil=require(_0x3edf('0x18'));var db=require(_0x3edf('0x19'))['db'];function respondWithStatusCode(_0x5e0fea,_0x58662d){_0x58662d=_0x58662d||0xcc;return function(_0x1b7829){if(_0x1b7829){return _0x5e0fea['sendStatus'](_0x58662d);}return _0x5e0fea[_0x3edf('0x1a')](_0x58662d)[_0x3edf('0x1b')]();};}function respondWithResult(_0x5c9c75,_0x2467fb){_0x2467fb=_0x2467fb||0xc8;return function(_0x221edb){if(_0x221edb){return _0x5c9c75['status'](_0x2467fb)[_0x3edf('0x1c')](_0x221edb);}};}function respondWithFilteredResult(_0x3836f0,_0x414d26){return function(_0x45cc40){if(_0x45cc40){var _0x31874e=typeof _0x414d26[_0x3edf('0x1d')]==='undefined'&&typeof _0x414d26[_0x3edf('0x1e')]===_0x3edf('0x1f');var _0x1b3378=_0x45cc40[_0x3edf('0x20')];var _0x48edf9=_0x31874e?0x0:_0x414d26[_0x3edf('0x1d')];var _0x1dc476=_0x31874e?_0x45cc40['count']:_0x414d26[_0x3edf('0x1d')]+_0x414d26[_0x3edf('0x1e')];var _0x2d18b2;if(_0x1dc476>=_0x1b3378){_0x1dc476=_0x1b3378;_0x2d18b2=0xc8;}else{_0x2d18b2=0xce;}_0x3836f0[_0x3edf('0x1a')](_0x2d18b2);return _0x3836f0[_0x3edf('0x21')](_0x3edf('0x22'),_0x48edf9+'-'+_0x1dc476+'/'+_0x1b3378)['json'](_0x45cc40);}return null;};}function patchUpdates(_0x894ea7){return function(_0x4adba8){try{jsonpatch[_0x3edf('0x23')](_0x4adba8,_0x894ea7,!![]);}catch(_0x1353d0){return BPromise['reject'](_0x1353d0);}return _0x4adba8[_0x3edf('0x24')]();};}function saveUpdates(_0x2cbae7,_0x5c64e0){return function(_0xfd0087){if(_0xfd0087){return _0xfd0087['update'](_0x2cbae7)[_0x3edf('0x25')](function(_0x3ca576){return _0x3ca576;});}return null;};}function removeEntity(_0xda8732,_0x1b9dc7){return function(_0x4a717b){if(_0x4a717b){return _0x4a717b[_0x3edf('0x26')]()[_0x3edf('0x25')](function(){_0xda8732['status'](0xcc)[_0x3edf('0x1b')]();});}};}function handleEntityNotFound(_0x4182d6,_0x193c91){return function(_0x2ba895){if(!_0x2ba895){_0x4182d6[_0x3edf('0x27')](0x194);}return _0x2ba895;};}function handleError(_0x51ff46,_0x5b3392){_0x5b3392=_0x5b3392||0x1f4;return function(_0xda8de2){logger['error'](_0xda8de2['stack']);if(_0xda8de2[_0x3edf('0x28')]){delete _0xda8de2['name'];}_0x51ff46[_0x3edf('0x1a')](_0x5b3392)[_0x3edf('0x29')](_0xda8de2);};}exports[_0x3edf('0x2a')]=function(_0x4fb2fe,_0x53d360){var _0x429e4e={},_0x561951={},_0x593f8b={'count':0x0,'rows':[]};var _0x2b9949=_[_0x3edf('0x2b')](db['ZohoField'][_0x3edf('0x2c')],function(_0x582da3){return{'name':_0x582da3['fieldName'],'type':_0x582da3[_0x3edf('0x2d')]['key']};});_0x561951[_0x3edf('0x2e')]=_['map'](_0x2b9949,_0x3edf('0x28'));_0x561951[_0x3edf('0x2f')]=_[_0x3edf('0x30')](_0x4fb2fe['query']);_0x561951[_0x3edf('0x31')]=_['intersection'](_0x561951[_0x3edf('0x2e')],_0x561951[_0x3edf('0x2f')]);_0x429e4e['attributes']=_[_0x3edf('0x32')](_0x561951[_0x3edf('0x2e')],qs['fields'](_0x4fb2fe[_0x3edf('0x2f')][_0x3edf('0x33')]));_0x429e4e[_0x3edf('0x34')]=_0x429e4e[_0x3edf('0x34')][_0x3edf('0x35')]?_0x429e4e[_0x3edf('0x34')]:_0x561951[_0x3edf('0x2e')];if(!_0x4fb2fe[_0x3edf('0x2f')][_0x3edf('0x36')](_0x3edf('0x37'))){_0x429e4e['limit']=qs[_0x3edf('0x1e')](_0x4fb2fe['query'][_0x3edf('0x1e')]);_0x429e4e[_0x3edf('0x1d')]=qs[_0x3edf('0x1d')](_0x4fb2fe['query'][_0x3edf('0x1d')]);}_0x429e4e[_0x3edf('0x38')]=qs[_0x3edf('0x39')](_0x4fb2fe[_0x3edf('0x2f')][_0x3edf('0x39')]);_0x429e4e[_0x3edf('0x3a')]=qs[_0x3edf('0x31')](_[_0x3edf('0x3b')](_0x4fb2fe[_0x3edf('0x2f')],_0x561951[_0x3edf('0x31')]),_0x2b9949);if(_0x4fb2fe[_0x3edf('0x2f')][_0x3edf('0x3c')]){_0x429e4e[_0x3edf('0x3a')]=_[_0x3edf('0x3d')](_0x429e4e[_0x3edf('0x3a')],{'$or':_[_0x3edf('0x2b')](_0x2b9949,function(_0x515ad0){if(_0x515ad0[_0x3edf('0x2d')]!==_0x3edf('0x3e')){var _0x54edb0={};_0x54edb0[_0x515ad0[_0x3edf('0x28')]]={'$like':'%'+_0x4fb2fe['query'][_0x3edf('0x3c')]+'%'};return _0x54edb0;}})});}_0x429e4e=_[_0x3edf('0x3d')]({},_0x429e4e,_0x4fb2fe[_0x3edf('0x3f')]);var _0x14872a={'where':_0x429e4e[_0x3edf('0x3a')]};return db[_0x3edf('0x40')][_0x3edf('0x20')](_0x14872a)[_0x3edf('0x25')](function(_0x24dc66){_0x593f8b['count']=_0x24dc66;if(_0x4fb2fe[_0x3edf('0x2f')][_0x3edf('0x41')]){_0x429e4e[_0x3edf('0x42')]=[{'all':!![]}];}return db[_0x3edf('0x40')][_0x3edf('0x43')](_0x429e4e);})[_0x3edf('0x25')](function(_0x1372fe){_0x593f8b['rows']=_0x1372fe;return _0x593f8b;})[_0x3edf('0x25')](respondWithFilteredResult(_0x53d360,_0x429e4e))[_0x3edf('0x44')](handleError(_0x53d360,null));};exports[_0x3edf('0x45')]=function(_0x1009fe,_0x1c161a){var _0xcb4038={'raw':!![],'where':{'id':_0x1009fe['params']['id']}},_0x1a779b={};_0x1a779b[_0x3edf('0x2e')]=_[_0x3edf('0x30')](db[_0x3edf('0x40')][_0x3edf('0x2c')]);_0x1a779b[_0x3edf('0x2f')]=_[_0x3edf('0x30')](_0x1009fe['query']);_0x1a779b['filters']=_[_0x3edf('0x32')](_0x1a779b['model'],_0x1a779b[_0x3edf('0x2f')]);_0xcb4038[_0x3edf('0x34')]=_['intersection'](_0x1a779b[_0x3edf('0x2e')],qs[_0x3edf('0x33')](_0x1009fe[_0x3edf('0x2f')][_0x3edf('0x33')]));_0xcb4038[_0x3edf('0x34')]=_0xcb4038['attributes'][_0x3edf('0x35')]?_0xcb4038[_0x3edf('0x34')]:_0x1a779b[_0x3edf('0x2e')];if(_0x1009fe['query'][_0x3edf('0x41')]){_0xcb4038[_0x3edf('0x42')]=[{'all':!![]}];}_0xcb4038=_['merge']({},_0xcb4038,_0x1009fe[_0x3edf('0x3f')]);return db[_0x3edf('0x40')]['find'](_0xcb4038)[_0x3edf('0x25')](handleEntityNotFound(_0x1c161a,null))[_0x3edf('0x25')](respondWithResult(_0x1c161a,null))[_0x3edf('0x44')](handleError(_0x1c161a,null));};exports[_0x3edf('0x46')]=function(_0x2c5cab,_0x5beb8b){return db[_0x3edf('0x40')][_0x3edf('0x46')](_0x2c5cab['body'],{})[_0x3edf('0x25')](respondWithResult(_0x5beb8b,0xc9))[_0x3edf('0x44')](handleError(_0x5beb8b,null));};exports['update']=function(_0x125702,_0x7783c2){if(_0x125702[_0x3edf('0x47')]['id']){delete _0x125702[_0x3edf('0x47')]['id'];}return db[_0x3edf('0x40')][_0x3edf('0x48')]({'where':{'id':_0x125702['params']['id']}})[_0x3edf('0x25')](handleEntityNotFound(_0x7783c2,null))[_0x3edf('0x25')](saveUpdates(_0x125702[_0x3edf('0x47')],null))[_0x3edf('0x25')](respondWithResult(_0x7783c2,null))[_0x3edf('0x44')](handleError(_0x7783c2,null));};exports['destroy']=function(_0x50469d,_0x5a0c1e){return db[_0x3edf('0x40')][_0x3edf('0x48')]({'where':{'id':_0x50469d[_0x3edf('0x49')]['id']}})[_0x3edf('0x25')](handleEntityNotFound(_0x5a0c1e,null))['then'](removeEntity(_0x5a0c1e,null))['catch'](handleError(_0x5a0c1e,null));}; \ No newline at end of file +var _0x6b39=['stack','send','index','map','ZohoField','rawAttributes','fieldName','type','key','model','name','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','options','rows','catch','show','params','length','includeAll','include','find','create','body','destroy','fast-json-patch','moment','bluebird','mustache','util','ejs','fs-extra','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','error'];(function(_0x48a2de,_0xc061f3){var _0x2c305f=function(_0x2ea7ea){while(--_0x2ea7ea){_0x48a2de['push'](_0x48a2de['shift']());}};_0x2c305f(++_0xc061f3);}(_0x6b39,0x1cf));var _0x96b3=function(_0x37f8ad,_0x5c3a37){_0x37f8ad=_0x37f8ad-0x0;var _0x12bd86=_0x6b39[_0x37f8ad];return _0x12bd86;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x96b3('0x0'));var rp=require('request-promise');var moment=require(_0x96b3('0x1'));var BPromise=require(_0x96b3('0x2'));var Mustache=require(_0x96b3('0x3'));var util=require(_0x96b3('0x4'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x96b3('0x5'));var fs=require('fs');var fs_extra=require(_0x96b3('0x6'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x96b3('0x7'));var deskjs=require('desk.js');var toCsv=require(_0x96b3('0x8'));var querystring=require(_0x96b3('0x9'));var Papa=require(_0x96b3('0xa'));var Redis=require(_0x96b3('0xb'));var authService=require(_0x96b3('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x96b3('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x96b3('0xe'))(_0x96b3('0xf'));var utils=require(_0x96b3('0x10'));var config=require(_0x96b3('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xbb050d,_0x42e868){_0x42e868=_0x42e868||0xcc;return function(_0x309215){if(_0x309215){return _0xbb050d[_0x96b3('0x12')](_0x42e868);}return _0xbb050d[_0x96b3('0x13')](_0x42e868)[_0x96b3('0x14')]();};}function respondWithResult(_0x30f59d,_0x27690c){_0x27690c=_0x27690c||0xc8;return function(_0x391c42){if(_0x391c42){return _0x30f59d[_0x96b3('0x13')](_0x27690c)['json'](_0x391c42);}};}function respondWithFilteredResult(_0x3b966f,_0x1dd250){return function(_0x444329){if(_0x444329){var _0xd77a93=typeof _0x1dd250[_0x96b3('0x15')]===_0x96b3('0x16')&&typeof _0x1dd250[_0x96b3('0x17')]==='undefined';var _0x1e662c=_0x444329[_0x96b3('0x18')];var _0x4bb23c=_0xd77a93?0x0:_0x1dd250[_0x96b3('0x15')];var _0x22b167=_0xd77a93?_0x444329['count']:_0x1dd250['offset']+_0x1dd250[_0x96b3('0x17')];var _0xde5ea;if(_0x22b167>=_0x1e662c){_0x22b167=_0x1e662c;_0xde5ea=0xc8;}else{_0xde5ea=0xce;}_0x3b966f['status'](_0xde5ea);return _0x3b966f[_0x96b3('0x19')](_0x96b3('0x1a'),_0x4bb23c+'-'+_0x22b167+'/'+_0x1e662c)[_0x96b3('0x1b')](_0x444329);}return null;};}function patchUpdates(_0x363dd4){return function(_0x3a7427){try{jsonpatch[_0x96b3('0x1c')](_0x3a7427,_0x363dd4,!![]);}catch(_0x29f22f){return BPromise[_0x96b3('0x1d')](_0x29f22f);}return _0x3a7427[_0x96b3('0x1e')]();};}function saveUpdates(_0x1da2b8,_0x4ccb38){return function(_0x58dfdc){if(_0x58dfdc){return _0x58dfdc[_0x96b3('0x1f')](_0x1da2b8)[_0x96b3('0x20')](function(_0x5b8184){return _0x5b8184;});}return null;};}function removeEntity(_0x3566b9,_0x4052ed){return function(_0x3f2390){if(_0x3f2390){return _0x3f2390['destroy']()['then'](function(){_0x3566b9['status'](0xcc)[_0x96b3('0x14')]();});}};}function handleEntityNotFound(_0x10c99e,_0xf2b602){return function(_0x609c35){if(!_0x609c35){_0x10c99e[_0x96b3('0x12')](0x194);}return _0x609c35;};}function handleError(_0x5b18ec,_0x224d88){_0x224d88=_0x224d88||0x1f4;return function(_0x380622){logger[_0x96b3('0x21')](_0x380622[_0x96b3('0x22')]);if(_0x380622['name']){delete _0x380622['name'];}_0x5b18ec['status'](_0x224d88)[_0x96b3('0x23')](_0x380622);};}exports[_0x96b3('0x24')]=function(_0x117309,_0x52af64){var _0x467364={},_0x4ad135={},_0x3d7d6a={'count':0x0,'rows':[]};var _0xd36f75=_[_0x96b3('0x25')](db[_0x96b3('0x26')][_0x96b3('0x27')],function(_0x2d5cb8){return{'name':_0x2d5cb8[_0x96b3('0x28')],'type':_0x2d5cb8[_0x96b3('0x29')][_0x96b3('0x2a')]};});_0x4ad135[_0x96b3('0x2b')]=_[_0x96b3('0x25')](_0xd36f75,_0x96b3('0x2c'));_0x4ad135['query']=_[_0x96b3('0x2d')](_0x117309[_0x96b3('0x2e')]);_0x4ad135[_0x96b3('0x2f')]=_['intersection'](_0x4ad135[_0x96b3('0x2b')],_0x4ad135[_0x96b3('0x2e')]);_0x467364[_0x96b3('0x30')]=_[_0x96b3('0x31')](_0x4ad135[_0x96b3('0x2b')],qs[_0x96b3('0x32')](_0x117309['query'][_0x96b3('0x32')]));_0x467364[_0x96b3('0x30')]=_0x467364[_0x96b3('0x30')]['length']?_0x467364[_0x96b3('0x30')]:_0x4ad135['model'];if(!_0x117309[_0x96b3('0x2e')][_0x96b3('0x33')](_0x96b3('0x34'))){_0x467364[_0x96b3('0x17')]=qs[_0x96b3('0x17')](_0x117309[_0x96b3('0x2e')][_0x96b3('0x17')]);_0x467364[_0x96b3('0x15')]=qs[_0x96b3('0x15')](_0x117309[_0x96b3('0x2e')][_0x96b3('0x15')]);}_0x467364[_0x96b3('0x35')]=qs[_0x96b3('0x36')](_0x117309[_0x96b3('0x2e')][_0x96b3('0x36')]);_0x467364['where']=qs[_0x96b3('0x2f')](_['pick'](_0x117309['query'],_0x4ad135['filters']),_0xd36f75);if(_0x117309[_0x96b3('0x2e')][_0x96b3('0x37')]){_0x467364[_0x96b3('0x38')]=_['merge'](_0x467364[_0x96b3('0x38')],{'$or':_[_0x96b3('0x25')](_0xd36f75,function(_0x486602){if(_0x486602['type']!==_0x96b3('0x39')){var _0x4e81f5={};_0x4e81f5[_0x486602[_0x96b3('0x2c')]]={'$like':'%'+_0x117309[_0x96b3('0x2e')][_0x96b3('0x37')]+'%'};return _0x4e81f5;}})});}_0x467364=_[_0x96b3('0x3a')]({},_0x467364,_0x117309[_0x96b3('0x3b')]);var _0x347072={'where':_0x467364[_0x96b3('0x38')]};return db['ZohoField'][_0x96b3('0x18')](_0x347072)[_0x96b3('0x20')](function(_0x13ad99){_0x3d7d6a[_0x96b3('0x18')]=_0x13ad99;if(_0x117309['query']['includeAll']){_0x467364['include']=[{'all':!![]}];}return db['ZohoField']['findAll'](_0x467364);})['then'](function(_0x225162){_0x3d7d6a[_0x96b3('0x3c')]=_0x225162;return _0x3d7d6a;})[_0x96b3('0x20')](respondWithFilteredResult(_0x52af64,_0x467364))[_0x96b3('0x3d')](handleError(_0x52af64,null));};exports[_0x96b3('0x3e')]=function(_0x244020,_0x32d4de){var _0x266493={'raw':!![],'where':{'id':_0x244020[_0x96b3('0x3f')]['id']}},_0x12e00d={};_0x12e00d[_0x96b3('0x2b')]=_[_0x96b3('0x2d')](db[_0x96b3('0x26')]['rawAttributes']);_0x12e00d[_0x96b3('0x2e')]=_[_0x96b3('0x2d')](_0x244020[_0x96b3('0x2e')]);_0x12e00d['filters']=_[_0x96b3('0x31')](_0x12e00d[_0x96b3('0x2b')],_0x12e00d[_0x96b3('0x2e')]);_0x266493[_0x96b3('0x30')]=_[_0x96b3('0x31')](_0x12e00d[_0x96b3('0x2b')],qs[_0x96b3('0x32')](_0x244020[_0x96b3('0x2e')][_0x96b3('0x32')]));_0x266493[_0x96b3('0x30')]=_0x266493['attributes'][_0x96b3('0x40')]?_0x266493['attributes']:_0x12e00d[_0x96b3('0x2b')];if(_0x244020[_0x96b3('0x2e')][_0x96b3('0x41')]){_0x266493[_0x96b3('0x42')]=[{'all':!![]}];}_0x266493=_[_0x96b3('0x3a')]({},_0x266493,_0x244020[_0x96b3('0x3b')]);return db[_0x96b3('0x26')][_0x96b3('0x43')](_0x266493)['then'](handleEntityNotFound(_0x32d4de,null))[_0x96b3('0x20')](respondWithResult(_0x32d4de,null))[_0x96b3('0x3d')](handleError(_0x32d4de,null));};exports[_0x96b3('0x44')]=function(_0x335a57,_0x30dc58){return db[_0x96b3('0x26')][_0x96b3('0x44')](_0x335a57[_0x96b3('0x45')],{})[_0x96b3('0x20')](respondWithResult(_0x30dc58,0xc9))[_0x96b3('0x3d')](handleError(_0x30dc58,null));};exports[_0x96b3('0x1f')]=function(_0x289348,_0x6ef584){if(_0x289348[_0x96b3('0x45')]['id']){delete _0x289348['body']['id'];}return db[_0x96b3('0x26')]['find']({'where':{'id':_0x289348[_0x96b3('0x3f')]['id']}})['then'](handleEntityNotFound(_0x6ef584,null))['then'](saveUpdates(_0x289348[_0x96b3('0x45')],null))[_0x96b3('0x20')](respondWithResult(_0x6ef584,null))[_0x96b3('0x3d')](handleError(_0x6ef584,null));};exports[_0x96b3('0x46')]=function(_0x591000,_0x2561bc){return db[_0x96b3('0x26')]['find']({'where':{'id':_0x591000[_0x96b3('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2561bc,null))['then'](removeEntity(_0x2561bc,null))[_0x96b3('0x3d')](handleError(_0x2561bc,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 5ed390e..feaadce 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 _0x8aad=['request-promise','../../config/environment','define','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','api','bluebird'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x8aad,0x146));var _0xd8aa=function(_0x3802a5,_0x3db0db){_0x3802a5=_0x3802a5-0x0;var _0x3fce1d=_0x8aad[_0x3802a5];return _0x3fce1d;};'use strict';var _=require(_0xd8aa('0x0'));var util=require(_0xd8aa('0x1'));var logger=require('../../config/logger')(_0xd8aa('0x2'));var moment=require('moment');var BPromise=require(_0xd8aa('0x3'));var rp=require(_0xd8aa('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd8aa('0x5'));var attributes=require('./intZohoField.attributes');module['exports']=function(_0x16b648,_0x43ddeb){return _0x16b648[_0xd8aa('0x6')]('ZohoField',attributes,{'tableName':_0xd8aa('0x7'),'paranoid':![],'indexes':[{'name':_0xd8aa('0x8'),'fields':[_0xd8aa('0x9'),_0xd8aa('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdb28=['../../config/environment','exports','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x1c839c,_0x3f80e4){var _0x2a912c=function(_0x256c47){while(--_0x256c47){_0x1c839c['push'](_0x1c839c['shift']());}};_0x2a912c(++_0x3f80e4);}(_0xdb28,0x106));var _0x8db2=function(_0x8e1bbd,_0x2a58ee){_0x8e1bbd=_0x8e1bbd-0x0;var _0x2d5768=_0xdb28[_0x8e1bbd];return _0x2d5768;};'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('./intZohoField.attributes');module[_0x8db2('0x9')]=function(_0x1d2dd3,_0x5f42ee){return _0x1d2dd3['define'](_0x8db2('0xa'),attributes,{'tableName':_0x8db2('0xb'),'paranoid':![],'indexes':[{'name':_0x8db2('0xc'),'fields':[_0x8db2('0xd'),_0x8db2('0xe')],'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 501a3b7..fd485fd 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 _0x119b=['result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoField,\x20%s,\x20%s','message'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x119b,0xbf));var _0xb119=function(_0x246148,_0x1358ee){_0x246148=_0x246148-0x0;var _0x453d94=_0x119b[_0x246148];return _0x453d94;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb119('0x0'));var BPromise=require(_0xb119('0x1'));var rs=require(_0xb119('0x2'));var fs=require('fs');var Redis=require(_0xb119('0x3'));var db=require(_0xb119('0x4'))['db'];var utils=require(_0xb119('0x5'));var logger=require(_0xb119('0x6'))(_0xb119('0x7'));var config=require('../../config/environment');var jayson=require(_0xb119('0x8'));var client=jayson['client'][_0xb119('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x554456,_0x51bf1b,_0xd1167c){return new BPromise(function(_0x5b39f9,_0x5541e9){return client['request'](_0x554456,_0xd1167c)[_0xb119('0xa')](function(_0x314a4b){logger[_0xb119('0xb')]('ZohoField,\x20%s,\x20%s',_0x51bf1b,_0xb119('0xc'));logger['debug'](_0xb119('0xd'),_0x51bf1b,_0xb119('0xc'),JSON[_0xb119('0xe')](_0x314a4b));if(_0x314a4b[_0xb119('0xf')]){if(_0x314a4b[_0xb119('0xf')][_0xb119('0x10')]===0x1f4){logger['error'](_0xb119('0x11'),_0x51bf1b,_0x314a4b[_0xb119('0xf')][_0xb119('0x12')]);return _0x5541e9(_0x314a4b[_0xb119('0xf')]['message']);}logger[_0xb119('0xf')](_0xb119('0x11'),_0x51bf1b,_0x314a4b['error'][_0xb119('0x12')]);return _0x5b39f9(_0x314a4b['error'][_0xb119('0x12')]);}else{logger[_0xb119('0xb')](_0xb119('0x11'),_0x51bf1b,_0xb119('0xc'));_0x5b39f9(_0x314a4b[_0xb119('0x13')][_0xb119('0x12')]);}})[_0xb119('0x14')](function(_0x10cfa3){logger[_0xb119('0xf')](_0xb119('0x11'),_0x51bf1b,_0x10cfa3);_0x5541e9(_0x10cfa3);});});} \ No newline at end of file +var _0xa47b=['info','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','error','ZohoField,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x2f80f7,_0xaa774c){var _0x198a88=function(_0x33820e){while(--_0x33820e){_0x2f80f7['push'](_0x2f80f7['shift']());}};_0x198a88(++_0xaa774c);}(_0xa47b,0x99));var _0xba47=function(_0x5d40e7,_0x40df86){_0x5d40e7=_0x5d40e7-0x0;var _0x26c408=_0xa47b[_0x5d40e7];return _0x26c408;};'use strict';var _=require(_0xba47('0x0'));var util=require('util');var moment=require(_0xba47('0x1'));var BPromise=require(_0xba47('0x2'));var rs=require(_0xba47('0x3'));var fs=require('fs');var Redis=require(_0xba47('0x4'));var db=require(_0xba47('0x5'))['db'];var utils=require(_0xba47('0x6'));var logger=require(_0xba47('0x7'))(_0xba47('0x8'));var config=require(_0xba47('0x9'));var jayson=require(_0xba47('0xa'));var client=jayson[_0xba47('0xb')][_0xba47('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5b0ee2,_0x1badae,_0x5f0081){return new BPromise(function(_0xe755f7,_0x1f4e1b){return client[_0xba47('0xd')](_0x5b0ee2,_0x5f0081)[_0xba47('0xe')](function(_0x21ed17){logger[_0xba47('0xf')]('ZohoField,\x20%s,\x20%s',_0x1badae,_0xba47('0x10'));logger[_0xba47('0x11')](_0xba47('0x12'),_0x1badae,_0xba47('0x10'),JSON['stringify'](_0x21ed17));if(_0x21ed17[_0xba47('0x13')]){if(_0x21ed17[_0xba47('0x13')]['code']===0x1f4){logger['error'](_0xba47('0x14'),_0x1badae,_0x21ed17['error'][_0xba47('0x15')]);return _0x1f4e1b(_0x21ed17[_0xba47('0x13')][_0xba47('0x15')]);}logger[_0xba47('0x13')]('ZohoField,\x20%s,\x20%s',_0x1badae,_0x21ed17[_0xba47('0x13')][_0xba47('0x15')]);return _0xe755f7(_0x21ed17[_0xba47('0x13')]['message']);}else{logger[_0xba47('0xf')](_0xba47('0x14'),_0x1badae,_0xba47('0x10'));_0xe755f7(_0x21ed17[_0xba47('0x16')][_0xba47('0x15')]);}})[_0xba47('0x17')](function(_0x450975){logger[_0xba47('0x13')](_0xba47('0x14'),_0x1badae,_0x450975);_0x1f4e1b(_0x450975);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index bc2ef4a..2770730 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x556f29,_0x1ffa15){var _0x24d242=function(_0x595ec1){while(--_0x595ec1){_0x556f29['push'](_0x556f29['shift']());}};_0x24d242(++_0x1ffa15);}(_0x70e0,0x17b));var _0x070e=function(_0x3a8a3c,_0x49b2d7){_0x3a8a3c=_0x3a8a3c-0x0;var _0x31a8c1=_0x70e0[_0x3a8a3c];return _0x31a8c1;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x48fcb1,_0x4317bd){var _0x3ec22a=function(_0x10dfb5){while(--_0x10dfb5){_0x48fcb1['push'](_0x48fcb1['shift']());}};_0x3ec22a(++_0x4317bd);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 65ec4c9..d4d7759 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 _0xb866=['BOOLEAN','sequelize','STRING','unique_name_and_version','app.js','INTEGER'];(function(_0xaefd60,_0x4d682e){var _0x228406=function(_0x5ad42b){while(--_0x5ad42b){_0xaefd60['push'](_0xaefd60['shift']());}};_0x228406(++_0x4d682e);}(_0xb866,0x103));var _0x6b86=function(_0x392d42,_0x43a057){_0x392d42=_0x392d42-0x0;var _0x26b3d6=_0xb866[_0x392d42];return _0x26b3d6;};'use strict';var Sequelize=require(_0x6b86('0x0'));module['exports']={'name':{'type':Sequelize[_0x6b86('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x6b86('0x1')],'allowNull':![],'unique':_0x6b86('0x2')},'main':{'type':Sequelize[_0x6b86('0x1')],'defaultValue':_0x6b86('0x3')},'filename':{'type':Sequelize[_0x6b86('0x1')]},'path':{'type':Sequelize[_0x6b86('0x1')]},'type':{'type':Sequelize[_0x6b86('0x1')]},'size':{'type':Sequelize[_0x6b86('0x4')]},'active':{'type':Sequelize[_0x6b86('0x5')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x6b86('0x1')]},'state':{'type':Sequelize[_0x6b86('0x1')],'unique':'state'},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x6b86('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0xe7a3=['app.js','BOOLEAN','state','exports','unique_name_and_version','STRING'];(function(_0x3e4002,_0x39d440){var _0x315278=function(_0x1e7aa2){while(--_0x1e7aa2){_0x3e4002['push'](_0x3e4002['shift']());}};_0x315278(++_0x39d440);}(_0xe7a3,0x1bf));var _0x3e7a=function(_0x426a60,_0x337d7a){_0x426a60=_0x426a60-0x0;var _0x324bd3=_0xe7a3[_0x426a60];return _0x324bd3;};'use strict';var Sequelize=require('sequelize');module[_0x3e7a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3e7a('0x1')},'version':{'type':Sequelize[_0x3e7a('0x2')],'allowNull':![],'unique':_0x3e7a('0x1')},'main':{'type':Sequelize[_0x3e7a('0x2')],'defaultValue':_0x3e7a('0x3')},'filename':{'type':Sequelize[_0x3e7a('0x2')]},'path':{'type':Sequelize[_0x3e7a('0x2')]},'type':{'type':Sequelize[_0x3e7a('0x2')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x3e7a('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0x3e7a('0x2')]},'logo':{'type':Sequelize[_0x3e7a('0x2')]},'state':{'type':Sequelize[_0x3e7a('0x2')],'unique':_0x3e7a('0x5')},'description':{'type':Sequelize[_0x3e7a('0x2')]},'title':{'type':Sequelize[_0x3e7a('0x2')]},'remoteUri':{'type':Sequelize[_0x3e7a('0x2')]},'link':{'type':Sequelize[_0x3e7a('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index d591074..daf2711 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 _0x5f2f=['end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','Integration','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','findAll','rows','catch','keys','find','body','params','destroy','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','sendStatus'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x5f2f,0x73));var _0xf5f2=function(_0xca7903,_0x31160e){_0xca7903=_0xca7903-0x0;var _0x9ae08a=_0x5f2f[_0xca7903];return _0x9ae08a;};'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'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'all':!![]}];}return db[_0xf5f2('0x29')][_0xf5f2('0x3e')](_0x22c826);})[_0xf5f2('0x24')](function(_0x574f24){_0x11c771[_0xf5f2('0x3f')]=_0x574f24;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x40')](handleError(_0x53cb96,null));};exports['show']=function(_0x509dbc,_0x59eb00){var _0x76d21b={'raw':![],'where':{'id':_0x509dbc['params']['id']}},_0x2ad13c={};_0x2ad13c[_0xf5f2('0x31')]=_[_0xf5f2('0x41')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x2ad13c[_0xf5f2('0x2e')]=_[_0xf5f2('0x41')](_0x509dbc[_0xf5f2('0x2e')]);_0x2ad13c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],_0x2ad13c[_0xf5f2('0x2e')]);_0x76d21b[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],qs['fields'](_0x509dbc[_0xf5f2('0x2e')]['fields']));_0x76d21b[_0xf5f2('0x32')]=_0x76d21b[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x76d21b[_0xf5f2('0x32')]:_0x2ad13c[_0xf5f2('0x31')];if(_0x509dbc[_0xf5f2('0x2e')]['includeAll']){_0x76d21b[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x76d21b=_[_0xf5f2('0x39')]({},_0x76d21b,_0x509dbc[_0xf5f2('0x3b')]);return db[_0xf5f2('0x29')][_0xf5f2('0x42')](_0x76d21b)[_0xf5f2('0x24')](handleEntityNotFound(_0x59eb00,null))[_0xf5f2('0x24')](respondWithResult(_0x59eb00,null))[_0xf5f2('0x40')](handleError(_0x59eb00,null));};exports['create']=function(_0x35dece,_0x33ec29){return db[_0xf5f2('0x29')]['create'](_0x35dece[_0xf5f2('0x43')],{})[_0xf5f2('0x24')](respondWithResult(_0x33ec29,0xc9))[_0xf5f2('0x40')](handleError(_0x33ec29,null));};exports['update']=function(_0x57a7cb,_0x7bb942){if(_0x57a7cb[_0xf5f2('0x43')]['id']){delete _0x57a7cb['body']['id'];}return db[_0xf5f2('0x29')]['find']({'where':{'id':_0x57a7cb[_0xf5f2('0x44')]['id']}})['then'](handleEntityNotFound(_0x7bb942,null))[_0xf5f2('0x24')](saveUpdates(_0x57a7cb['body'],null))[_0xf5f2('0x24')](respondWithResult(_0x7bb942,null))[_0xf5f2('0x40')](handleError(_0x7bb942,null));};exports[_0xf5f2('0x45')]=function(_0x11a083,_0x4fa738){return db[_0xf5f2('0x29')][_0xf5f2('0x42')]({'where':{'id':_0x11a083['params']['id']}})['then'](handleEntityNotFound(_0x4fa738,null))[_0xf5f2('0x24')](removeEntity(_0x4fa738,null))[_0xf5f2('0x40')](handleError(_0x4fa738,null));}; \ No newline at end of file +var _0x4888=['lodash','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','limit','undefined','count','set','apply','reject','save','then','sendStatus','error','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','Integration','includeAll','include','rows','catch','params','options','create','body','update','find','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra'];(function(_0x146edd,_0x2be255){var _0x46079b=function(_0x20ad8c){while(--_0x20ad8c){_0x146edd['push'](_0x146edd['shift']());}};_0x46079b(++_0x2be255);}(_0x4888,0x198));var _0x8488=function(_0x22aabe,_0x1667d4){_0x22aabe=_0x22aabe-0x0;var _0x7ae05=_0x4888[_0x22aabe];return _0x7ae05;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8488('0x0'));var zipdir=require(_0x8488('0x1'));var jsonpatch=require(_0x8488('0x2'));var rp=require(_0x8488('0x3'));var moment=require(_0x8488('0x4'));var BPromise=require(_0x8488('0x5'));var Mustache=require(_0x8488('0x6'));var util=require('util');var path=require(_0x8488('0x7'));var sox=require(_0x8488('0x8'));var csv=require(_0x8488('0x9'));var ejs=require(_0x8488('0xa'));var fs=require('fs');var fs_extra=require(_0x8488('0xb'));var _=require(_0x8488('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8488('0x9'));var querystring=require(_0x8488('0xd'));var Papa=require('papaparse');var Redis=require(_0x8488('0xe'));var authService=require(_0x8488('0xf'));var qs=require(_0x8488('0x10'));var as=require(_0x8488('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8488('0x12'))(_0x8488('0x13'));var utils=require(_0x8488('0x14'));var config=require(_0x8488('0x15'));var licenseUtil=require(_0x8488('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14462e,_0x3d1f7a){_0x3d1f7a=_0x3d1f7a||0xcc;return function(_0x58f83d){if(_0x58f83d){return _0x14462e['sendStatus'](_0x3d1f7a);}return _0x14462e[_0x8488('0x17')](_0x3d1f7a)['end']();};}function respondWithResult(_0x214083,_0x4e94fc){_0x4e94fc=_0x4e94fc||0xc8;return function(_0x5161a3){if(_0x5161a3){return _0x214083[_0x8488('0x17')](_0x4e94fc)[_0x8488('0x18')](_0x5161a3);}};}function respondWithFilteredResult(_0x5700b,_0x2bcb7c){return function(_0x3b3cfa){if(_0x3b3cfa){var _0x8d3b3d=typeof _0x2bcb7c[_0x8488('0x19')]==='undefined'&&typeof _0x2bcb7c[_0x8488('0x1a')]===_0x8488('0x1b');var _0x3edfe4=_0x3b3cfa[_0x8488('0x1c')];var _0x60ae2f=_0x8d3b3d?0x0:_0x2bcb7c[_0x8488('0x19')];var _0x1aedb1=_0x8d3b3d?_0x3b3cfa[_0x8488('0x1c')]:_0x2bcb7c[_0x8488('0x19')]+_0x2bcb7c[_0x8488('0x1a')];var _0x10bfd6;if(_0x1aedb1>=_0x3edfe4){_0x1aedb1=_0x3edfe4;_0x10bfd6=0xc8;}else{_0x10bfd6=0xce;}_0x5700b[_0x8488('0x17')](_0x10bfd6);return _0x5700b[_0x8488('0x1d')]('Content-Range',_0x60ae2f+'-'+_0x1aedb1+'/'+_0x3edfe4)['json'](_0x3b3cfa);}return null;};}function patchUpdates(_0x340d6b){return function(_0x12d40f){try{jsonpatch[_0x8488('0x1e')](_0x12d40f,_0x340d6b,!![]);}catch(_0x3c9fc2){return BPromise[_0x8488('0x1f')](_0x3c9fc2);}return _0x12d40f[_0x8488('0x20')]();};}function saveUpdates(_0x43b672,_0x3c078c){return function(_0x39dd43){if(_0x39dd43){return _0x39dd43['update'](_0x43b672)[_0x8488('0x21')](function(_0x4e07e1){return _0x4e07e1;});}return null;};}function removeEntity(_0x140b0b,_0x1361a6){return function(_0x290b33){if(_0x290b33){return _0x290b33['destroy']()['then'](function(){_0x140b0b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x472624,_0x51fe30){return function(_0x58057a){if(!_0x58057a){_0x472624[_0x8488('0x22')](0x194);}return _0x58057a;};}function handleError(_0x2f350a,_0x2b3c97){_0x2b3c97=_0x2b3c97||0x1f4;return function(_0x6ebee0){logger[_0x8488('0x23')](_0x6ebee0['stack']);if(_0x6ebee0[_0x8488('0x24')]){delete _0x6ebee0[_0x8488('0x24')];}_0x2f350a[_0x8488('0x17')](_0x2b3c97)[_0x8488('0x25')](_0x6ebee0);};}exports[_0x8488('0x26')]=function(_0x27f5cf,_0x2c15ff){var _0x296b6c={},_0x368f9c={},_0x1d9317={'count':0x0,'rows':[]};var _0x888b24=_['map'](db['Integration']['rawAttributes'],function(_0x292fe8){return{'name':_0x292fe8[_0x8488('0x27')],'type':_0x292fe8[_0x8488('0x28')][_0x8488('0x29')]};});_0x368f9c[_0x8488('0x2a')]=_[_0x8488('0x2b')](_0x888b24,'name');_0x368f9c[_0x8488('0x2c')]=_[_0x8488('0x2d')](_0x27f5cf[_0x8488('0x2c')]);_0x368f9c[_0x8488('0x2e')]=_[_0x8488('0x2f')](_0x368f9c['model'],_0x368f9c[_0x8488('0x2c')]);_0x296b6c[_0x8488('0x30')]=_['intersection'](_0x368f9c[_0x8488('0x2a')],qs[_0x8488('0x31')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x31')]));_0x296b6c[_0x8488('0x30')]=_0x296b6c['attributes'][_0x8488('0x32')]?_0x296b6c[_0x8488('0x30')]:_0x368f9c[_0x8488('0x2a')];if(!_0x27f5cf['query'][_0x8488('0x33')]('nolimit')){_0x296b6c[_0x8488('0x1a')]=qs[_0x8488('0x1a')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x1a')]);_0x296b6c['offset']=qs[_0x8488('0x19')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x19')]);}_0x296b6c['order']=qs[_0x8488('0x34')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x34')]);_0x296b6c[_0x8488('0x35')]=qs[_0x8488('0x2e')](_[_0x8488('0x36')](_0x27f5cf[_0x8488('0x2c')],_0x368f9c[_0x8488('0x2e')]),_0x888b24);if(_0x27f5cf[_0x8488('0x2c')][_0x8488('0x37')]){_0x296b6c[_0x8488('0x35')]=_['merge'](_0x296b6c['where'],{'$or':_[_0x8488('0x2b')](_0x888b24,function(_0x36c17a){if(_0x36c17a[_0x8488('0x28')]!==_0x8488('0x38')){var _0x2d9fa1={};_0x2d9fa1[_0x36c17a[_0x8488('0x24')]]={'$like':'%'+_0x27f5cf[_0x8488('0x2c')][_0x8488('0x37')]+'%'};return _0x2d9fa1;}})});}_0x296b6c=_[_0x8488('0x39')]({},_0x296b6c,_0x27f5cf['options']);var _0xf5a0a0={'where':_0x296b6c[_0x8488('0x35')]};return db[_0x8488('0x3a')]['count'](_0xf5a0a0)[_0x8488('0x21')](function(_0xa50c4b){_0x1d9317[_0x8488('0x1c')]=_0xa50c4b;if(_0x27f5cf[_0x8488('0x2c')][_0x8488('0x3b')]){_0x296b6c[_0x8488('0x3c')]=[{'all':!![]}];}return db[_0x8488('0x3a')]['findAll'](_0x296b6c);})[_0x8488('0x21')](function(_0x1c33a1){_0x1d9317[_0x8488('0x3d')]=_0x1c33a1;return _0x1d9317;})['then'](respondWithFilteredResult(_0x2c15ff,_0x296b6c))[_0x8488('0x3e')](handleError(_0x2c15ff,null));};exports['show']=function(_0x40ee7e,_0x34b11b){var _0x5cbd11={'raw':![],'where':{'id':_0x40ee7e[_0x8488('0x3f')]['id']}},_0x22a3f3={};_0x22a3f3[_0x8488('0x2a')]=_[_0x8488('0x2d')](db[_0x8488('0x3a')]['rawAttributes']);_0x22a3f3[_0x8488('0x2c')]=_['keys'](_0x40ee7e[_0x8488('0x2c')]);_0x22a3f3[_0x8488('0x2e')]=_[_0x8488('0x2f')](_0x22a3f3[_0x8488('0x2a')],_0x22a3f3[_0x8488('0x2c')]);_0x5cbd11[_0x8488('0x30')]=_[_0x8488('0x2f')](_0x22a3f3[_0x8488('0x2a')],qs[_0x8488('0x31')](_0x40ee7e[_0x8488('0x2c')][_0x8488('0x31')]));_0x5cbd11[_0x8488('0x30')]=_0x5cbd11[_0x8488('0x30')][_0x8488('0x32')]?_0x5cbd11[_0x8488('0x30')]:_0x22a3f3[_0x8488('0x2a')];if(_0x40ee7e[_0x8488('0x2c')]['includeAll']){_0x5cbd11[_0x8488('0x3c')]=[{'all':!![]}];}_0x5cbd11=_[_0x8488('0x39')]({},_0x5cbd11,_0x40ee7e[_0x8488('0x40')]);return db[_0x8488('0x3a')]['find'](_0x5cbd11)[_0x8488('0x21')](handleEntityNotFound(_0x34b11b,null))[_0x8488('0x21')](respondWithResult(_0x34b11b,null))[_0x8488('0x3e')](handleError(_0x34b11b,null));};exports[_0x8488('0x41')]=function(_0x52042c,_0x1f0516){return db[_0x8488('0x3a')][_0x8488('0x41')](_0x52042c[_0x8488('0x42')],{})[_0x8488('0x21')](respondWithResult(_0x1f0516,0xc9))[_0x8488('0x3e')](handleError(_0x1f0516,null));};exports[_0x8488('0x43')]=function(_0x299d8e,_0x1bc2e1){if(_0x299d8e[_0x8488('0x42')]['id']){delete _0x299d8e[_0x8488('0x42')]['id'];}return db[_0x8488('0x3a')][_0x8488('0x44')]({'where':{'id':_0x299d8e['params']['id']}})['then'](handleEntityNotFound(_0x1bc2e1,null))[_0x8488('0x21')](saveUpdates(_0x299d8e[_0x8488('0x42')],null))[_0x8488('0x21')](respondWithResult(_0x1bc2e1,null))[_0x8488('0x3e')](handleError(_0x1bc2e1,null));};exports[_0x8488('0x45')]=function(_0x22d22c,_0x25f2dc){return db[_0x8488('0x3a')][_0x8488('0x44')]({'where':{'id':_0x22d22c['params']['id']}})[_0x8488('0x21')](handleEntityNotFound(_0x25f2dc,null))[_0x8488('0x21')](removeEntity(_0x25f2dc,null))['catch'](handleError(_0x25f2dc,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 213157b..b7bb117 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 _0xf32e=['rimraf','../../config/environment','./integration.attributes','Integration','integrations','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x55a559,_0x397150){var _0x5738db=function(_0x3be623){while(--_0x3be623){_0x55a559['push'](_0x55a559['shift']());}};_0x5738db(++_0x397150);}(_0xf32e,0x186));var _0xef32=function(_0x414686,_0x12d781){_0x414686=_0x414686-0x0;var _0x2120ef=_0xf32e[_0x414686];return _0x2120ef;};'use strict';var _=require(_0xef32('0x0'));var util=require(_0xef32('0x1'));var logger=require(_0xef32('0x2'))(_0xef32('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xef32('0x4'));var fs=require('fs');var path=require(_0xef32('0x5'));var rimraf=require(_0xef32('0x6'));var config=require(_0xef32('0x7'));var attributes=require(_0xef32('0x8'));module['exports']=function(_0x3389f0,_0x523c71){return _0x3389f0['define'](_0xef32('0x9'),attributes,{'tableName':_0xef32('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3ec7=['integrations','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./integration.attributes','exports','define','Integration'];(function(_0x7d244c,_0x6fe6c1){var _0x1107ad=function(_0x333aea){while(--_0x333aea){_0x7d244c['push'](_0x7d244c['shift']());}};_0x1107ad(++_0x6fe6c1);}(_0x3ec7,0x1e2));var _0x73ec=function(_0x178f9f,_0xff3a22){_0x178f9f=_0x178f9f-0x0;var _0x175457=_0x3ec7[_0x178f9f];return _0x175457;};'use strict';var _=require('lodash');var util=require(_0x73ec('0x0'));var logger=require(_0x73ec('0x1'))(_0x73ec('0x2'));var moment=require(_0x73ec('0x3'));var BPromise=require('bluebird');var rp=require(_0x73ec('0x4'));var fs=require('fs');var path=require(_0x73ec('0x5'));var rimraf=require(_0x73ec('0x6'));var config=require(_0x73ec('0x7'));var attributes=require(_0x73ec('0x8'));module[_0x73ec('0x9')]=function(_0x4b8bc9,_0x356a19){return _0x4b8bc9[_0x73ec('0xa')](_0x73ec('0xb'),attributes,{'tableName':_0x73ec('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 06a0bd4..dc92167 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 _0x1967=['then','info','Integration,\x20%s,\x20%s','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x1967,0x173));var _0x7196=function(_0x40f109,_0x5a5c7b){_0x40f109=_0x40f109-0x0;var _0x3046ab=_0x1967[_0x40f109];return _0x3046ab;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var moment=require(_0x7196('0x1'));var BPromise=require(_0x7196('0x2'));var rs=require(_0x7196('0x3'));var fs=require('fs');var Redis=require(_0x7196('0x4'));var db=require(_0x7196('0x5'))['db'];var utils=require(_0x7196('0x6'));var logger=require(_0x7196('0x7'))(_0x7196('0x8'));var config=require(_0x7196('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7196('0xa')][_0x7196('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x194746,_0x40e0af,_0x266a6e){return new BPromise(function(_0xad78a,_0x510c72){return client[_0x7196('0xc')](_0x194746,_0x266a6e)[_0x7196('0xd')](function(_0x3f846e){logger[_0x7196('0xe')](_0x7196('0xf'),_0x40e0af,'request\x20sent');logger['debug'](_0x7196('0x10'),_0x40e0af,_0x7196('0x11'),JSON[_0x7196('0x12')](_0x3f846e));if(_0x3f846e[_0x7196('0x13')]){if(_0x3f846e[_0x7196('0x13')][_0x7196('0x14')]===0x1f4){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0x510c72(_0x3f846e[_0x7196('0x13')]['message']);}logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0xad78a(_0x3f846e['error'][_0x7196('0x15')]);}else{logger['info'](_0x7196('0xf'),_0x40e0af,_0x7196('0x11'));_0xad78a(_0x3f846e[_0x7196('0x16')][_0x7196('0x15')]);}})[_0x7196('0x17')](function(_0x2e3e0e){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x2e3e0e);_0x510c72(_0x2e3e0e);});});} \ No newline at end of file +var _0x2542=['info','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x875dc1,_0x580b7f){var _0x2077ae=function(_0x28c708){while(--_0x28c708){_0x875dc1['push'](_0x875dc1['shift']());}};_0x2077ae(++_0x580b7f);}(_0x2542,0x169));var _0x2254=function(_0x414f96,_0x396f5f){_0x414f96=_0x414f96-0x0;var _0x431985=_0x2542[_0x414f96];return _0x431985;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var moment=require(_0x2254('0x2'));var BPromise=require(_0x2254('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2254('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2254('0x5'));var logger=require(_0x2254('0x6'))(_0x2254('0x7'));var config=require(_0x2254('0x8'));var jayson=require(_0x2254('0x9'));var client=jayson['client'][_0x2254('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe8ca50,_0x2ee7ee,_0x3c45ec){return new BPromise(function(_0x1637ad,_0x477b47){return client[_0x2254('0xb')](_0xe8ca50,_0x3c45ec)[_0x2254('0xc')](function(_0xb395da){logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,'request\x20sent');logger[_0x2254('0xf')](_0x2254('0x10'),_0x2ee7ee,_0x2254('0x11'),JSON[_0x2254('0x12')](_0xb395da));if(_0xb395da['error']){if(_0xb395da['error'][_0x2254('0x13')]===0x1f4){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);return _0x477b47(_0xb395da[_0x2254('0x14')]['message']);}logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da['error'][_0x2254('0x15')]);return _0x1637ad(_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);}else{logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,_0x2254('0x11'));_0x1637ad(_0xb395da['result'][_0x2254('0x15')]);}})['catch'](function(_0x327d6d){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0x327d6d);_0x477b47(_0x327d6d);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 24782d6..8f9f843 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 _0xd943=['show','post','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','describe'];(function(_0x4a4922,_0x82cb8f){var _0x55a8c6=function(_0x59712e){while(--_0x59712e){_0x4a4922['push'](_0x4a4922['shift']());}};_0x55a8c6(++_0x82cb8f);}(_0xd943,0x15d));var _0x3d94=function(_0x550ec5,_0x2d6fcf){_0x550ec5=_0x550ec5-0x0;var _0x12f3fa=_0xd943[_0x550ec5];return _0x12f3fa;};'use strict';var multer=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var path=require(_0x3d94('0x2'));var timeout=require(_0x3d94('0x3'));var express=require('express');var router=express[_0x3d94('0x4')]();var fs_extra=require(_0x3d94('0x5'));var auth=require(_0x3d94('0x6'));var interaction=require(_0x3d94('0x7'));var config=require(_0x3d94('0x8'));var controller=require('./integrationReport.controller');router['get']('/',auth[_0x3d94('0x9')](),controller['index']);router['get']('/describe',auth[_0x3d94('0x9')](),controller[_0x3d94('0xa')]);router['get']('/:id',auth[_0x3d94('0x9')](),controller[_0x3d94('0xb')]);router[_0x3d94('0xc')]('/',auth['isAuthenticated'](),controller[_0x3d94('0xd')]);router['put'](_0x3d94('0xe'),auth[_0x3d94('0x9')](),controller['update']);router[_0x3d94('0xf')](_0x3d94('0xe'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x10')]);module[_0x3d94('0x11')]=router; \ No newline at end of file +var _0x1a85=['../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service'];(function(_0x161b60,_0x539e02){var _0x4fffdd=function(_0x195d78){while(--_0x195d78){_0x161b60['push'](_0x161b60['shift']());}};_0x4fffdd(++_0x539e02);}(_0x1a85,0x178));var _0x51a8=function(_0x297c55,_0x34fa75){_0x297c55=_0x297c55-0x0;var _0x120389=_0x1a85[_0x297c55];return _0x120389;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x51a8('0x0'));var timeout=require(_0x51a8('0x1'));var express=require(_0x51a8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x51a8('0x3'));var interaction=require(_0x51a8('0x4'));var config=require(_0x51a8('0x5'));var controller=require('./integrationReport.controller');router[_0x51a8('0x6')]('/',auth['isAuthenticated'](),controller[_0x51a8('0x7')]);router['get'](_0x51a8('0x8'),auth[_0x51a8('0x9')](),controller['describe']);router[_0x51a8('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x51a8('0xa')]);router[_0x51a8('0xb')]('/',auth[_0x51a8('0x9')](),controller[_0x51a8('0xc')]);router[_0x51a8('0xd')](_0x51a8('0xe'),auth[_0x51a8('0x9')](),controller[_0x51a8('0xf')]);router[_0x51a8('0x10')](_0x51a8('0xe'),auth[_0x51a8('0x9')](),controller[_0x51a8('0x11')]);module[_0x51a8('0x12')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 06c6794..2ce9af0 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 _0x2824=['INTEGER','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize','exports','STRING','DATE'];(function(_0x336480,_0x1e5c46){var _0x3be962=function(_0x16c2a3){while(--_0x16c2a3){_0x336480['push'](_0x336480['shift']());}};_0x3be962(++_0x1e5c46);}(_0x2824,0x140));var _0x4282=function(_0x5d979a,_0x2089ec){_0x5d979a=_0x5d979a-0x0;var _0x350436=_0x2824[_0x5d979a];return _0x350436;};'use strict';var Sequelize=require(_0x4282('0x0'));module[_0x4282('0x1')]={'integration':{'type':Sequelize[_0x4282('0x2')]},'eventChannel':{'type':Sequelize[_0x4282('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x4282('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x4282('0x2')]},'uniqueid':{'type':Sequelize[_0x4282('0x2')]},'calleridnum':{'type':Sequelize[_0x4282('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x4282('0x2')]},'interface':{'type':Sequelize[_0x4282('0x2')]},'membername':{'type':Sequelize[_0x4282('0x2')]},'agentcalledAt':{'type':Sequelize[_0x4282('0x3')]},'agentconnectAt':{'type':Sequelize[_0x4282('0x3')]},'holdtime':{'type':Sequelize[_0x4282('0x4')]},'agentcomplete':{'type':Sequelize[_0x4282('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x4282('0x3')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x4282('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x4282('0x4')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x4282('0x3')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x4282('0x2')]},'channel':{'type':Sequelize[_0x4282('0x2')]},'channelstate':{'type':Sequelize[_0x4282('0x4')]},'channelstatedesc':{'type':Sequelize[_0x4282('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x4282('0x2')]},'language':{'type':Sequelize[_0x4282('0x2')]},'accountcode':{'type':Sequelize[_0x4282('0x2')]},'context':{'type':Sequelize[_0x4282('0x2')]},'exten':{'type':Sequelize[_0x4282('0x2')]},'priority':{'type':Sequelize[_0x4282('0x2')]},'destchannel':{'type':Sequelize[_0x4282('0x2')]},'destchannelstate':{'type':Sequelize[_0x4282('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x4282('0x2')]},'destcalleridname':{'type':Sequelize[_0x4282('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x4282('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x4282('0x2')]},'destlanguage':{'type':Sequelize[_0x4282('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x4282('0x2')]},'destexten':{'type':Sequelize[_0x4282('0x2')]},'destpriority':{'type':Sequelize[_0x4282('0x2')]},'destuniqueid':{'type':Sequelize[_0x4282('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x4282('0x6')]},'text':{'type':Sequelize[_0x4282('0x6')]},'status':{'type':Sequelize[_0x4282('0x7')](_0x4282('0x8'),_0x4282('0x9'),_0x4282('0xa'),_0x4282('0xb'))},'url':{'type':Sequelize[_0x4282('0x2')]},'app':{'type':Sequelize[_0x4282('0x2')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x4282('0x4')]}}; \ No newline at end of file +var _0xafdc=['sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','SENT','RECEIVED'];(function(_0x1057a9,_0x30ac5d){var _0x1cc6a9=function(_0x411779){while(--_0x411779){_0x1057a9['push'](_0x1057a9['shift']());}};_0x1cc6a9(++_0x30ac5d);}(_0xafdc,0x18c));var _0xcafd=function(_0x3b7ee5,_0x16d7a2){_0x3b7ee5=_0x3b7ee5-0x0;var _0x3b6e15=_0xafdc[_0x3b7ee5];return _0x3b6e15;};'use strict';var Sequelize=require(_0xcafd('0x0'));module[_0xcafd('0x1')]={'integration':{'type':Sequelize[_0xcafd('0x2')]},'eventChannel':{'type':Sequelize[_0xcafd('0x2')]},'exitStatus':{'type':Sequelize[_0xcafd('0x2')]},'ticketId':{'type':Sequelize[_0xcafd('0x2')]},'integrationId':{'type':Sequelize[_0xcafd('0x3')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xcafd('0x2')]},'calleridnum':{'type':Sequelize[_0xcafd('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xcafd('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xcafd('0x2')]},'agentcalledAt':{'type':Sequelize[_0xcafd('0x4')]},'agentconnectAt':{'type':Sequelize[_0xcafd('0x4')]},'holdtime':{'type':Sequelize[_0xcafd('0x3')]},'agentcomplete':{'type':Sequelize[_0xcafd('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xcafd('0x4')]},'talktime':{'type':Sequelize[_0xcafd('0x3')]},'agentacw':{'type':Sequelize[_0xcafd('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xcafd('0x3')]},'reason':{'type':Sequelize[_0xcafd('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xcafd('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xcafd('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xcafd('0x4')]},'lastevent':{'type':Sequelize[_0xcafd('0x2')]},'channel':{'type':Sequelize[_0xcafd('0x2')]},'channelstate':{'type':Sequelize[_0xcafd('0x3')]},'channelstatedesc':{'type':Sequelize[_0xcafd('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xcafd('0x2')]},'context':{'type':Sequelize[_0xcafd('0x2')]},'exten':{'type':Sequelize[_0xcafd('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xcafd('0x2')]},'destchannelstate':{'type':Sequelize[_0xcafd('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xcafd('0x2')]},'destcalleridnum':{'type':Sequelize[_0xcafd('0x2')]},'destcalleridname':{'type':Sequelize[_0xcafd('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xcafd('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xcafd('0x2')]},'destlanguage':{'type':Sequelize[_0xcafd('0x2')]},'destaccountcode':{'type':Sequelize[_0xcafd('0x2')]},'destcontext':{'type':Sequelize[_0xcafd('0x2')]},'destexten':{'type':Sequelize[_0xcafd('0x2')]},'destpriority':{'type':Sequelize[_0xcafd('0x2')]},'destuniqueid':{'type':Sequelize[_0xcafd('0x2')]},'messageId':{'type':Sequelize[_0xcafd('0x2')]},'inReplyTo':{'type':Sequelize[_0xcafd('0x2')]},'subject':{'type':Sequelize[_0xcafd('0x2')]},'from':{'type':Sequelize[_0xcafd('0x2')]},'to':{'type':Sequelize[_0xcafd('0x2')]},'cc':{'type':Sequelize[_0xcafd('0x2')]},'attachment':{'type':Sequelize[_0xcafd('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0xcafd('0x6')]},'status':{'type':Sequelize['ENUM'](_0xcafd('0x7'),'SENDING',_0xcafd('0x8'),'FAILED')},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0xcafd('0x2')]},'appdata':{'type':Sequelize[_0xcafd('0x2')]},'projectId':{'type':Sequelize[_0xcafd('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 6e1c806..6fd85fb 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 _0xedde=['../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','update','then','end','sendStatus','error','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','include','findAll','catch','show','params','includeAll','options','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x1a2673,_0x48fc24){var _0x3f6ce6=function(_0x2c5053){while(--_0x2c5053){_0x1a2673['push'](_0x1a2673['shift']());}};_0x3f6ce6(++_0x48fc24);}(_0xedde,0x165));var _0xeedd=function(_0x1fc100,_0x8c7770){_0x1fc100=_0x1fc100-0x0;var _0x409a4b=_0xedde[_0x1fc100];return _0x409a4b;};'use strict';var emlformat=require(_0xeedd('0x0'));var rimraf=require(_0xeedd('0x1'));var zipdir=require(_0xeedd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xeedd('0x3'));var moment=require('moment');var BPromise=require(_0xeedd('0x4'));var Mustache=require(_0xeedd('0x5'));var util=require('util');var path=require(_0xeedd('0x6'));var sox=require(_0xeedd('0x7'));var csv=require('to-csv');var ejs=require(_0xeedd('0x8'));var fs=require('fs');var fs_extra=require(_0xeedd('0x9'));var _=require(_0xeedd('0xa'));var squel=require(_0xeedd('0xb'));var crypto=require('crypto');var jsforce=require(_0xeedd('0xc'));var deskjs=require(_0xeedd('0xd'));var toCsv=require('to-csv');var querystring=require(_0xeedd('0xe'));var Papa=require(_0xeedd('0xf'));var Redis=require(_0xeedd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xeedd('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeedd('0x12'));var logger=require('../../config/logger')(_0xeedd('0x13'));var utils=require(_0xeedd('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xeedd('0x15'));var db=require(_0xeedd('0x16'))['db'];function respondWithStatusCode(_0x3506d1,_0x138739){_0x138739=_0x138739||0xcc;return function(_0x323859){if(_0x323859){return _0x3506d1['sendStatus'](_0x138739);}return _0x3506d1[_0xeedd('0x17')](_0x138739)['end']();};}function respondWithResult(_0x5a4c70,_0x285689){_0x285689=_0x285689||0xc8;return function(_0x524764){if(_0x524764){return _0x5a4c70[_0xeedd('0x17')](_0x285689)[_0xeedd('0x18')](_0x524764);}};}function respondWithFilteredResult(_0x97ccd0,_0x31a2f3){return function(_0x483ef8){if(_0x483ef8){var _0x39873f=typeof _0x31a2f3['offset']==='undefined'&&typeof _0x31a2f3[_0xeedd('0x19')]===_0xeedd('0x1a');var _0xbe3e60=_0x483ef8[_0xeedd('0x1b')];var _0x3c14b6=_0x39873f?0x0:_0x31a2f3[_0xeedd('0x1c')];var _0x5ef42b=_0x39873f?_0x483ef8[_0xeedd('0x1b')]:_0x31a2f3[_0xeedd('0x1c')]+_0x31a2f3[_0xeedd('0x19')];var _0x15c97e;if(_0x5ef42b>=_0xbe3e60){_0x5ef42b=_0xbe3e60;_0x15c97e=0xc8;}else{_0x15c97e=0xce;}_0x97ccd0[_0xeedd('0x17')](_0x15c97e);return _0x97ccd0[_0xeedd('0x1d')](_0xeedd('0x1e'),_0x3c14b6+'-'+_0x5ef42b+'/'+_0xbe3e60)[_0xeedd('0x18')](_0x483ef8);}return null;};}function patchUpdates(_0xa66bf7){return function(_0x3becc3){try{jsonpatch[_0xeedd('0x1f')](_0x3becc3,_0xa66bf7,!![]);}catch(_0x4d3b87){return BPromise[_0xeedd('0x20')](_0x4d3b87);}return _0x3becc3['save']();};}function saveUpdates(_0x318666,_0x30d493){return function(_0x1bf820){if(_0x1bf820){return _0x1bf820[_0xeedd('0x21')](_0x318666)[_0xeedd('0x22')](function(_0x1ba339){return _0x1ba339;});}return null;};}function removeEntity(_0x425f38,_0x1416ea){return function(_0x1e7ddf){if(_0x1e7ddf){return _0x1e7ddf['destroy']()[_0xeedd('0x22')](function(){_0x425f38[_0xeedd('0x17')](0xcc)[_0xeedd('0x23')]();});}};}function handleEntityNotFound(_0x322f3e,_0x20c708){return function(_0x534674){if(!_0x534674){_0x322f3e[_0xeedd('0x24')](0x194);}return _0x534674;};}function handleError(_0x16a32,_0x1873d7){_0x1873d7=_0x1873d7||0x1f4;return function(_0x474b63){logger[_0xeedd('0x25')](_0x474b63[_0xeedd('0x26')]);if(_0x474b63[_0xeedd('0x27')]){delete _0x474b63[_0xeedd('0x27')];}_0x16a32[_0xeedd('0x17')](_0x1873d7)[_0xeedd('0x28')](_0x474b63);};}exports[_0xeedd('0x29')]=function(_0x5ec6ad,_0x40d505){var _0x272702={},_0x19e261={},_0x4095a4={'count':0x0,'rows':[]};var _0x2110bb=_[_0xeedd('0x2a')](db[_0xeedd('0x2b')][_0xeedd('0x2c')],function(_0x14530d){return{'name':_0x14530d[_0xeedd('0x2d')],'type':_0x14530d[_0xeedd('0x2e')][_0xeedd('0x2f')]};});_0x19e261[_0xeedd('0x30')]=_[_0xeedd('0x2a')](_0x2110bb,_0xeedd('0x27'));_0x19e261['query']=_[_0xeedd('0x31')](_0x5ec6ad['query']);_0x19e261['filters']=_[_0xeedd('0x32')](_0x19e261[_0xeedd('0x30')],_0x19e261[_0xeedd('0x33')]);_0x272702[_0xeedd('0x34')]=_[_0xeedd('0x32')](_0x19e261[_0xeedd('0x30')],qs[_0xeedd('0x35')](_0x5ec6ad[_0xeedd('0x33')][_0xeedd('0x35')]));_0x272702[_0xeedd('0x34')]=_0x272702[_0xeedd('0x34')][_0xeedd('0x36')]?_0x272702['attributes']:_0x19e261[_0xeedd('0x30')];if(!_0x5ec6ad[_0xeedd('0x33')][_0xeedd('0x37')](_0xeedd('0x38'))){_0x272702[_0xeedd('0x19')]=qs[_0xeedd('0x19')](_0x5ec6ad[_0xeedd('0x33')]['limit']);_0x272702[_0xeedd('0x1c')]=qs['offset'](_0x5ec6ad[_0xeedd('0x33')][_0xeedd('0x1c')]);}_0x272702[_0xeedd('0x39')]=qs[_0xeedd('0x3a')](_0x5ec6ad['query'][_0xeedd('0x3a')]);_0x272702['where']=qs[_0xeedd('0x3b')](_['pick'](_0x5ec6ad['query'],_0x19e261['filters']),_0x2110bb);if(_0x5ec6ad[_0xeedd('0x33')][_0xeedd('0x3c')]){_0x272702[_0xeedd('0x3d')]=_[_0xeedd('0x3e')](_0x272702[_0xeedd('0x3d')],{'$or':_[_0xeedd('0x2a')](_0x2110bb,function(_0x26d5f4){if(_0x26d5f4[_0xeedd('0x2e')]!==_0xeedd('0x3f')){var _0x2f3154={};_0x2f3154[_0x26d5f4[_0xeedd('0x27')]]={'$like':'%'+_0x5ec6ad[_0xeedd('0x33')][_0xeedd('0x3c')]+'%'};return _0x2f3154;}})});}_0x272702=_['merge']({},_0x272702,_0x5ec6ad['options']);var _0x5ac2e9={'where':_0x272702[_0xeedd('0x3d')]};return db[_0xeedd('0x2b')]['count'](_0x5ac2e9)['then'](function(_0x3c2d98){_0x4095a4[_0xeedd('0x1b')]=_0x3c2d98;if(_0x5ec6ad['query']['includeAll']){_0x272702[_0xeedd('0x40')]=[{'all':!![]}];}return db['IntegrationReport'][_0xeedd('0x41')](_0x272702);})[_0xeedd('0x22')](function(_0x36eb31){_0x4095a4['rows']=_0x36eb31;return _0x4095a4;})[_0xeedd('0x22')](respondWithFilteredResult(_0x40d505,_0x272702))[_0xeedd('0x42')](handleError(_0x40d505,null));};exports[_0xeedd('0x43')]=function(_0x1711f2,_0x1e11fc){var _0x4d8b53={'raw':![],'where':{'id':_0x1711f2[_0xeedd('0x44')]['id']}},_0x3ccb67={};_0x3ccb67[_0xeedd('0x30')]=_['keys'](db[_0xeedd('0x2b')][_0xeedd('0x2c')]);_0x3ccb67['query']=_['keys'](_0x1711f2['query']);_0x3ccb67[_0xeedd('0x3b')]=_['intersection'](_0x3ccb67['model'],_0x3ccb67['query']);_0x4d8b53['attributes']=_[_0xeedd('0x32')](_0x3ccb67[_0xeedd('0x30')],qs[_0xeedd('0x35')](_0x1711f2[_0xeedd('0x33')][_0xeedd('0x35')]));_0x4d8b53[_0xeedd('0x34')]=_0x4d8b53['attributes'][_0xeedd('0x36')]?_0x4d8b53[_0xeedd('0x34')]:_0x3ccb67[_0xeedd('0x30')];if(_0x1711f2[_0xeedd('0x33')][_0xeedd('0x45')]){_0x4d8b53['include']=[{'all':!![]}];}_0x4d8b53=_[_0xeedd('0x3e')]({},_0x4d8b53,_0x1711f2[_0xeedd('0x46')]);return db['IntegrationReport']['find'](_0x4d8b53)['then'](handleEntityNotFound(_0x1e11fc,null))[_0xeedd('0x22')](respondWithResult(_0x1e11fc,null))[_0xeedd('0x42')](handleError(_0x1e11fc,null));};exports[_0xeedd('0x47')]=function(_0x35857f,_0x1dd14f){return db[_0xeedd('0x2b')]['create'](_0x35857f[_0xeedd('0x48')],{})[_0xeedd('0x22')](respondWithResult(_0x1dd14f,0xc9))[_0xeedd('0x42')](handleError(_0x1dd14f,null));};exports[_0xeedd('0x21')]=function(_0x38e09a,_0x4737ca){if(_0x38e09a[_0xeedd('0x48')]['id']){delete _0x38e09a[_0xeedd('0x48')]['id'];}return db[_0xeedd('0x2b')][_0xeedd('0x49')]({'where':{'id':_0x38e09a[_0xeedd('0x44')]['id']}})[_0xeedd('0x22')](handleEntityNotFound(_0x4737ca,null))[_0xeedd('0x22')](saveUpdates(_0x38e09a[_0xeedd('0x48')],null))[_0xeedd('0x22')](respondWithResult(_0x4737ca,null))['catch'](handleError(_0x4737ca,null));};exports['destroy']=function(_0x20f8fb,_0x2f01c9){return db['IntegrationReport'][_0xeedd('0x49')]({'where':{'id':_0x20f8fb[_0xeedd('0x44')]['id']}})[_0xeedd('0x22')](handleEntityNotFound(_0x2f01c9,null))[_0xeedd('0x22')](removeEntity(_0x2f01c9,null))['catch'](handleError(_0x2f01c9,null));};exports['describe']=function(_0x4fcf5c,_0x4904d7){return db[_0xeedd('0x2b')][_0xeedd('0x4a')]()['then'](respondWithResult(_0x4904d7,null))[_0xeedd('0x42')](handleError(_0x4904d7,null));}; \ No newline at end of file +var _0x31e3=['json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','map','IntegrationReport','fieldName','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','keys','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x31e3,0x1c8));var _0x331e=function(_0x2cb236,_0x257fcf){_0x2cb236=_0x2cb236-0x0;var _0x480032=_0x31e3[_0x2cb236];return _0x480032;};'use strict';var emlformat=require(_0x331e('0x0'));var rimraf=require(_0x331e('0x1'));var zipdir=require(_0x331e('0x2'));var jsonpatch=require(_0x331e('0x3'));var rp=require(_0x331e('0x4'));var moment=require('moment');var BPromise=require(_0x331e('0x5'));var Mustache=require(_0x331e('0x6'));var util=require(_0x331e('0x7'));var path=require(_0x331e('0x8'));var sox=require(_0x331e('0x9'));var csv=require(_0x331e('0xa'));var ejs=require(_0x331e('0xb'));var fs=require('fs');var fs_extra=require(_0x331e('0xc'));var _=require(_0x331e('0xd'));var squel=require('squel');var crypto=require(_0x331e('0xe'));var jsforce=require(_0x331e('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x331e('0xa'));var querystring=require(_0x331e('0x10'));var Papa=require(_0x331e('0x11'));var Redis=require(_0x331e('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x331e('0x13'));var as=require(_0x331e('0x14'));var hardwareService=require(_0x331e('0x15'));var logger=require(_0x331e('0x16'))(_0x331e('0x17'));var utils=require(_0x331e('0x18'));var config=require(_0x331e('0x19'));var licenseUtil=require(_0x331e('0x1a'));var db=require(_0x331e('0x1b'))['db'];function respondWithStatusCode(_0x2972cb,_0x513ead){_0x513ead=_0x513ead||0xcc;return function(_0x248463){if(_0x248463){return _0x2972cb['sendStatus'](_0x513ead);}return _0x2972cb[_0x331e('0x1c')](_0x513ead)[_0x331e('0x1d')]();};}function respondWithResult(_0xde0057,_0x546079){_0x546079=_0x546079||0xc8;return function(_0x35e2d4){if(_0x35e2d4){return _0xde0057['status'](_0x546079)[_0x331e('0x1e')](_0x35e2d4);}};}function respondWithFilteredResult(_0x4f284c,_0x1d658c){return function(_0x47662f){if(_0x47662f){var _0x5d8303=typeof _0x1d658c[_0x331e('0x1f')]==='undefined'&&typeof _0x1d658c[_0x331e('0x20')]===_0x331e('0x21');var _0x164971=_0x47662f[_0x331e('0x22')];var _0x5149a2=_0x5d8303?0x0:_0x1d658c[_0x331e('0x1f')];var _0x332e36=_0x5d8303?_0x47662f[_0x331e('0x22')]:_0x1d658c[_0x331e('0x1f')]+_0x1d658c[_0x331e('0x20')];var _0x41d621;if(_0x332e36>=_0x164971){_0x332e36=_0x164971;_0x41d621=0xc8;}else{_0x41d621=0xce;}_0x4f284c[_0x331e('0x1c')](_0x41d621);return _0x4f284c[_0x331e('0x23')](_0x331e('0x24'),_0x5149a2+'-'+_0x332e36+'/'+_0x164971)[_0x331e('0x1e')](_0x47662f);}return null;};}function patchUpdates(_0x2d4515){return function(_0x2fc41d){try{jsonpatch[_0x331e('0x25')](_0x2fc41d,_0x2d4515,!![]);}catch(_0x3c6d59){return BPromise[_0x331e('0x26')](_0x3c6d59);}return _0x2fc41d[_0x331e('0x27')]();};}function saveUpdates(_0x14df81,_0x9c657){return function(_0x444fe8){if(_0x444fe8){return _0x444fe8[_0x331e('0x28')](_0x14df81)['then'](function(_0x3f4e62){return _0x3f4e62;});}return null;};}function removeEntity(_0x45ff0f,_0x1d0184){return function(_0x4c3773){if(_0x4c3773){return _0x4c3773[_0x331e('0x29')]()[_0x331e('0x2a')](function(){_0x45ff0f[_0x331e('0x1c')](0xcc)[_0x331e('0x1d')]();});}};}function handleEntityNotFound(_0x20c0b8,_0xa08c4f){return function(_0x1aded0){if(!_0x1aded0){_0x20c0b8[_0x331e('0x2b')](0x194);}return _0x1aded0;};}function handleError(_0x5590a9,_0x23d7ae){_0x23d7ae=_0x23d7ae||0x1f4;return function(_0x4919cf){logger[_0x331e('0x2c')](_0x4919cf[_0x331e('0x2d')]);if(_0x4919cf[_0x331e('0x2e')]){delete _0x4919cf[_0x331e('0x2e')];}_0x5590a9[_0x331e('0x1c')](_0x23d7ae)[_0x331e('0x2f')](_0x4919cf);};}exports['index']=function(_0x47a43d,_0x37ae2e){var _0x2ad31c={},_0xd9472b={},_0x4462b7={'count':0x0,'rows':[]};var _0x55fe07=_[_0x331e('0x30')](db[_0x331e('0x31')]['rawAttributes'],function(_0xc8c2a3){return{'name':_0xc8c2a3[_0x331e('0x32')],'type':_0xc8c2a3['type'][_0x331e('0x33')]};});_0xd9472b['model']=_['map'](_0x55fe07,'name');_0xd9472b[_0x331e('0x34')]=_['keys'](_0x47a43d['query']);_0xd9472b[_0x331e('0x35')]=_[_0x331e('0x36')](_0xd9472b[_0x331e('0x37')],_0xd9472b[_0x331e('0x34')]);_0x2ad31c['attributes']=_[_0x331e('0x36')](_0xd9472b[_0x331e('0x37')],qs[_0x331e('0x38')](_0x47a43d[_0x331e('0x34')]['fields']));_0x2ad31c[_0x331e('0x39')]=_0x2ad31c[_0x331e('0x39')][_0x331e('0x3a')]?_0x2ad31c[_0x331e('0x39')]:_0xd9472b[_0x331e('0x37')];if(!_0x47a43d['query'][_0x331e('0x3b')]('nolimit')){_0x2ad31c['limit']=qs[_0x331e('0x20')](_0x47a43d[_0x331e('0x34')][_0x331e('0x20')]);_0x2ad31c[_0x331e('0x1f')]=qs[_0x331e('0x1f')](_0x47a43d['query'][_0x331e('0x1f')]);}_0x2ad31c[_0x331e('0x3c')]=qs[_0x331e('0x3d')](_0x47a43d[_0x331e('0x34')]['sort']);_0x2ad31c[_0x331e('0x3e')]=qs[_0x331e('0x35')](_[_0x331e('0x3f')](_0x47a43d[_0x331e('0x34')],_0xd9472b[_0x331e('0x35')]),_0x55fe07);if(_0x47a43d[_0x331e('0x34')][_0x331e('0x40')]){_0x2ad31c[_0x331e('0x3e')]=_[_0x331e('0x41')](_0x2ad31c['where'],{'$or':_['map'](_0x55fe07,function(_0x330c0c){if(_0x330c0c['type']!==_0x331e('0x42')){var _0x2e8757={};_0x2e8757[_0x330c0c['name']]={'$like':'%'+_0x47a43d['query'][_0x331e('0x40')]+'%'};return _0x2e8757;}})});}_0x2ad31c=_[_0x331e('0x41')]({},_0x2ad31c,_0x47a43d[_0x331e('0x43')]);var _0x4bc387={'where':_0x2ad31c['where']};return db[_0x331e('0x31')]['count'](_0x4bc387)['then'](function(_0x49ee99){_0x4462b7[_0x331e('0x22')]=_0x49ee99;if(_0x47a43d[_0x331e('0x34')]['includeAll']){_0x2ad31c[_0x331e('0x44')]=[{'all':!![]}];}return db['IntegrationReport'][_0x331e('0x45')](_0x2ad31c);})[_0x331e('0x2a')](function(_0x3742fb){_0x4462b7[_0x331e('0x46')]=_0x3742fb;return _0x4462b7;})[_0x331e('0x2a')](respondWithFilteredResult(_0x37ae2e,_0x2ad31c))[_0x331e('0x47')](handleError(_0x37ae2e,null));};exports[_0x331e('0x48')]=function(_0x303ec8,_0x844799){var _0x4cad7c={'raw':![],'where':{'id':_0x303ec8[_0x331e('0x49')]['id']}},_0x21b1d7={};_0x21b1d7['model']=_['keys'](db['IntegrationReport'][_0x331e('0x4a')]);_0x21b1d7[_0x331e('0x34')]=_[_0x331e('0x4b')](_0x303ec8['query']);_0x21b1d7[_0x331e('0x35')]=_[_0x331e('0x36')](_0x21b1d7[_0x331e('0x37')],_0x21b1d7[_0x331e('0x34')]);_0x4cad7c[_0x331e('0x39')]=_[_0x331e('0x36')](_0x21b1d7[_0x331e('0x37')],qs[_0x331e('0x38')](_0x303ec8[_0x331e('0x34')][_0x331e('0x38')]));_0x4cad7c[_0x331e('0x39')]=_0x4cad7c[_0x331e('0x39')][_0x331e('0x3a')]?_0x4cad7c['attributes']:_0x21b1d7[_0x331e('0x37')];if(_0x303ec8[_0x331e('0x34')][_0x331e('0x4c')]){_0x4cad7c['include']=[{'all':!![]}];}_0x4cad7c=_['merge']({},_0x4cad7c,_0x303ec8[_0x331e('0x43')]);return db[_0x331e('0x31')][_0x331e('0x4d')](_0x4cad7c)['then'](handleEntityNotFound(_0x844799,null))[_0x331e('0x2a')](respondWithResult(_0x844799,null))[_0x331e('0x47')](handleError(_0x844799,null));};exports[_0x331e('0x4e')]=function(_0x2b33b9,_0x581abf){return db[_0x331e('0x31')][_0x331e('0x4e')](_0x2b33b9[_0x331e('0x4f')],{})[_0x331e('0x2a')](respondWithResult(_0x581abf,0xc9))[_0x331e('0x47')](handleError(_0x581abf,null));};exports[_0x331e('0x28')]=function(_0x5814aa,_0x274383){if(_0x5814aa[_0x331e('0x4f')]['id']){delete _0x5814aa[_0x331e('0x4f')]['id'];}return db['IntegrationReport'][_0x331e('0x4d')]({'where':{'id':_0x5814aa['params']['id']}})['then'](handleEntityNotFound(_0x274383,null))['then'](saveUpdates(_0x5814aa[_0x331e('0x4f')],null))[_0x331e('0x2a')](respondWithResult(_0x274383,null))[_0x331e('0x47')](handleError(_0x274383,null));};exports[_0x331e('0x29')]=function(_0x11b8d4,_0x4c7566){return db[_0x331e('0x31')][_0x331e('0x4d')]({'where':{'id':_0x11b8d4[_0x331e('0x49')]['id']}})['then'](handleEntityNotFound(_0x4c7566,null))['then'](removeEntity(_0x4c7566,null))[_0x331e('0x47')](handleError(_0x4c7566,null));};exports[_0x331e('0x50')]=function(_0xf164e7,_0x3ff05f){return db['IntegrationReport'][_0x331e('0x50')]()[_0x331e('0x2a')](respondWithResult(_0x3ff05f,null))[_0x331e('0x47')](handleError(_0x3ff05f,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 83ddcc0..5157114 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 _0xccff=['../../config/logger','api','moment','request-promise','path','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','lodash','util'];(function(_0x169bc6,_0x36ea15){var _0x3d6f41=function(_0x2711be){while(--_0x2711be){_0x169bc6['push'](_0x169bc6['shift']());}};_0x3d6f41(++_0x36ea15);}(_0xccff,0x196));var _0xfccf=function(_0x4a9a17,_0x273a09){_0x4a9a17=_0x4a9a17-0x0;var _0x30e831=_0xccff[_0x4a9a17];return _0x30e831;};'use strict';var _=require(_0xfccf('0x0'));var util=require(_0xfccf('0x1'));var logger=require(_0xfccf('0x2'))(_0xfccf('0x3'));var moment=require(_0xfccf('0x4'));var BPromise=require('bluebird');var rp=require(_0xfccf('0x5'));var fs=require('fs');var path=require(_0xfccf('0x6'));var rimraf=require('rimraf');var config=require(_0xfccf('0x7'));var attributes=require(_0xfccf('0x8'));module[_0xfccf('0x9')]=function(_0x3f68e1,_0x25d7a2){return _0x3f68e1[_0xfccf('0xa')](_0xfccf('0xb'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x45b0=['define','IntegrationReport','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports'];(function(_0x5e6c43,_0x132a12){var _0x23d90e=function(_0x279b49){while(--_0x279b49){_0x5e6c43['push'](_0x5e6c43['shift']());}};_0x23d90e(++_0x132a12);}(_0x45b0,0x1a2));var _0x045b=function(_0x5892b2,_0xeb5018){_0x5892b2=_0x5892b2-0x0;var _0x3d7ed1=_0x45b0[_0x5892b2];return _0x3d7ed1;};'use strict';var _=require(_0x045b('0x0'));var util=require(_0x045b('0x1'));var logger=require('../../config/logger')(_0x045b('0x2'));var moment=require(_0x045b('0x3'));var BPromise=require(_0x045b('0x4'));var rp=require(_0x045b('0x5'));var fs=require('fs');var path=require(_0x045b('0x6'));var rimraf=require(_0x045b('0x7'));var config=require(_0x045b('0x8'));var attributes=require(_0x045b('0x9'));module[_0x045b('0xa')]=function(_0x308858,_0x106ce0){return _0x308858[_0x045b('0xb')](_0x045b('0xc'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index f2c3b48..dcb0000 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 _0x6d38=['request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x380c43,_0x2ae950){var _0x2b79df=function(_0x1592d2){while(--_0x1592d2){_0x380c43['push'](_0x380c43['shift']());}};_0x2b79df(++_0x2ae950);}(_0x6d38,0x1ef));var _0x86d3=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x6d38[_0x297fd3];return _0x2af381;};'use strict';var _=require('lodash');var util=require(_0x86d3('0x0'));var moment=require(_0x86d3('0x1'));var BPromise=require(_0x86d3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86d3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x86d3('0x4'))(_0x86d3('0x5'));var config=require(_0x86d3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x86d3('0x7')][_0x86d3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33d4aa,_0x2eaa15,_0x47e654){return new BPromise(function(_0x552b07,_0x2aea31){return client[_0x86d3('0x9')](_0x33d4aa,_0x47e654)[_0x86d3('0xa')](function(_0x499640){logger['info'](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));logger['debug']('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x2eaa15,_0x86d3('0xc'),JSON[_0x86d3('0xd')](_0x499640));if(_0x499640['error']){if(_0x499640[_0x86d3('0xe')]['code']===0x1f4){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);return _0x2aea31(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640['error'][_0x86d3('0xf')]);return _0x552b07(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}else{logger[_0x86d3('0x10')](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));_0x552b07(_0x499640[_0x86d3('0x11')][_0x86d3('0xf')]);}})['catch'](function(_0x2d5ba9){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x2d5ba9);_0x2aea31(_0x2d5ba9);});});} \ No newline at end of file +var _0x2675=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','randomstring','ioredis'];(function(_0x23c901,_0x2e5c70){var _0x2b02ce=function(_0x3772db){while(--_0x3772db){_0x23c901['push'](_0x23c901['shift']());}};_0x2b02ce(++_0x2e5c70);}(_0x2675,0x75));var _0x5267=function(_0x53625f,_0x368a6a){_0x53625f=_0x53625f-0x0;var _0x5aa604=_0x2675[_0x53625f];return _0x5aa604;};'use strict';var _=require(_0x5267('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5267('0x1'));var fs=require('fs');var Redis=require(_0x5267('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5267('0x3'));var logger=require(_0x5267('0x4'))('rpc');var config=require(_0x5267('0x5'));var jayson=require(_0x5267('0x6'));var client=jayson[_0x5267('0x7')][_0x5267('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x20f065,_0xc56cd5,_0x527c16){return new BPromise(function(_0x9e0a27,_0x46bfdf){return client['request'](_0x20f065,_0x527c16)[_0x5267('0x9')](function(_0x5d6645){logger[_0x5267('0xa')](_0x5267('0xb'),_0xc56cd5,_0x5267('0xc'));logger['debug'](_0x5267('0xd'),_0xc56cd5,'request\x20sent',JSON[_0x5267('0xe')](_0x5d6645));if(_0x5d6645['error']){if(_0x5d6645[_0x5267('0xf')][_0x5267('0x10')]===0x1f4){logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);return _0x46bfdf(_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);}logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);return _0x9e0a27(_0x5d6645[_0x5267('0xf')]['message']);}else{logger['info'](_0x5267('0xb'),_0xc56cd5,_0x5267('0xc'));_0x9e0a27(_0x5d6645[_0x5267('0x12')][_0x5267('0x11')]);}})[_0x5267('0x13')](function(_0x27e5c6){logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x27e5c6);_0x46bfdf(_0x27e5c6);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index e664dd6..af39532 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 _0x8dbd=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','delete','multer','util','connect-timeout','express','Router'];(function(_0x20447b,_0x375c27){var _0x5c31d8=function(_0x34a11a){while(--_0x34a11a){_0x20447b['push'](_0x20447b['shift']());}};_0x5c31d8(++_0x375c27);}(_0x8dbd,0x159));var _0xd8db=function(_0x2a567b,_0x186f57){_0x2a567b=_0x2a567b-0x0;var _0x2fd216=_0x8dbd[_0x2a567b];return _0x2fd216;};'use strict';var multer=require(_0xd8db('0x0'));var util=require(_0xd8db('0x1'));var path=require('path');var timeout=require(_0xd8db('0x2'));var express=require(_0xd8db('0x3'));var router=express[_0xd8db('0x4')]();var fs_extra=require(_0xd8db('0x5'));var auth=require(_0xd8db('0x6'));var interaction=require(_0xd8db('0x7'));var config=require(_0xd8db('0x8'));var controller=require(_0xd8db('0x9'));router[_0xd8db('0xa')]('/',auth[_0xd8db('0xb')](),controller[_0xd8db('0xc')]);router[_0xd8db('0xa')](_0xd8db('0xd'),auth[_0xd8db('0xb')](),controller[_0xd8db('0xe')]);router[_0xd8db('0xa')](_0xd8db('0xf'),auth['isAuthenticated'](),controller[_0xd8db('0x10')]);router[_0xd8db('0x11')]('/',auth[_0xd8db('0xb')](),controller[_0xd8db('0x12')]);router[_0xd8db('0x11')](_0xd8db('0xf'),auth[_0xd8db('0xb')](),controller[_0xd8db('0x13')]);router[_0xd8db('0x11')](_0xd8db('0x14'),auth['isAuthenticated'](),controller[_0xd8db('0x15')]);router[_0xd8db('0x16')](_0xd8db('0xd'),auth[_0xd8db('0xb')](),controller[_0xd8db('0x17')]);router[_0xd8db('0x18')](_0xd8db('0xd'),auth[_0xd8db('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5fed=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','getIntervals','post','create','/:id/sub_intervals','addInterval','/:id/sub_intervals/create_many','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x104377,_0x54b94c){var _0x1fac22=function(_0xfd1f7f){while(--_0xfd1f7f){_0x104377['push'](_0x104377['shift']());}};_0x1fac22(++_0x54b94c);}(_0x5fed,0xed));var _0xd5fe=function(_0x280a2e,_0x244c6f){_0x280a2e=_0x280a2e-0x0;var _0x286f67=_0x5fed[_0x280a2e];return _0x286f67;};'use strict';var multer=require(_0xd5fe('0x0'));var util=require(_0xd5fe('0x1'));var path=require(_0xd5fe('0x2'));var timeout=require(_0xd5fe('0x3'));var express=require(_0xd5fe('0x4'));var router=express[_0xd5fe('0x5')]();var fs_extra=require(_0xd5fe('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd5fe('0x7'));var config=require(_0xd5fe('0x8'));var controller=require('./interval.controller');router[_0xd5fe('0x9')]('/',auth[_0xd5fe('0xa')](),controller[_0xd5fe('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xd5fe('0xc')]);router[_0xd5fe('0x9')]('/:id/sub_intervals',auth[_0xd5fe('0xa')](),controller[_0xd5fe('0xd')]);router[_0xd5fe('0xe')]('/',auth['isAuthenticated'](),controller[_0xd5fe('0xf')]);router[_0xd5fe('0xe')](_0xd5fe('0x10'),auth[_0xd5fe('0xa')](),controller[_0xd5fe('0x11')]);router[_0xd5fe('0xe')](_0xd5fe('0x12'),auth[_0xd5fe('0xa')](),controller['addIntervals']);router['put'](_0xd5fe('0x13'),auth[_0xd5fe('0xa')](),controller[_0xd5fe('0x14')]);router[_0xd5fe('0x15')](_0xd5fe('0x13'),auth[_0xd5fe('0xa')](),controller[_0xd5fe('0x16')]);module[_0xd5fe('0x17')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 76eebb5..4f95fdb 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 _0xda23=['sequelize','exports','STRING'];(function(_0x117b82,_0x13554b){var _0x3a8975=function(_0x54d531){while(--_0x54d531){_0x117b82['push'](_0x117b82['shift']());}};_0x3a8975(++_0x13554b);}(_0xda23,0x1d7));var _0x3da2=function(_0x2a18b7,_0x5041c8){_0x2a18b7=_0x2a18b7-0x0;var _0x45e74e=_0xda23[_0x2a18b7];return _0x45e74e;};'use strict';var Sequelize=require(_0x3da2('0x0'));module[_0x3da2('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3da2('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xa073=['STRING','sequelize','exports'];(function(_0x332308,_0x530040){var _0x4a15b2=function(_0x3c09bc){while(--_0x3c09bc){_0x332308['push'](_0x332308['shift']());}};_0x4a15b2(++_0x530040);}(_0xa073,0xdc));var _0x3a07=function(_0xc074a4,_0x29b618){_0xc074a4=_0xc074a4-0x0;var _0x19a114=_0xa073[_0xc074a4];return _0x19a114;};'use strict';var Sequelize=require(_0x3a07('0x0'));module[_0x3a07('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3a07('0x2')]},'interval':{'type':Sequelize[_0x3a07('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 4e4d015..8e8dd3d 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 _0xde55=['show','fields','include','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','addInterval','IntervalId','findOne','keys','hasOwnProperty','addIntervals','bulkCreate','eml-format','rimraf','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','Intervals','UserProfileResource','error','stack','send','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','Interval','includeAll','findAll','catch'];(function(_0x2e2a8c,_0x930962){var _0x23fdd2=function(_0xe39d0c){while(--_0xe39d0c){_0x2e2a8c['push'](_0x2e2a8c['shift']());}};_0x23fdd2(++_0x930962);}(_0xde55,0x1f2));var _0x5de5=function(_0x97c406,_0x25da4e){_0x97c406=_0x97c406-0x0;var _0x1cded3=_0xde55[_0x97c406];return _0x1cded3;};'use strict';var emlformat=require(_0x5de5('0x0'));var rimraf=require(_0x5de5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5de5('0x2'));var rp=require(_0x5de5('0x3'));var moment=require(_0x5de5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x5de5('0x5'));var sox=require(_0x5de5('0x6'));var csv=require(_0x5de5('0x7'));var ejs=require(_0x5de5('0x8'));var fs=require('fs');var fs_extra=require(_0x5de5('0x9'));var _=require(_0x5de5('0xa'));var squel=require(_0x5de5('0xb'));var crypto=require(_0x5de5('0xc'));var jsforce=require(_0x5de5('0xd'));var deskjs=require(_0x5de5('0xe'));var toCsv=require(_0x5de5('0x7'));var querystring=require(_0x5de5('0xf'));var Papa=require(_0x5de5('0x10'));var Redis=require(_0x5de5('0x11'));var authService=require(_0x5de5('0x12'));var qs=require(_0x5de5('0x13'));var as=require(_0x5de5('0x14'));var hardwareService=require(_0x5de5('0x15'));var logger=require(_0x5de5('0x16'))(_0x5de5('0x17'));var utils=require(_0x5de5('0x18'));var config=require(_0x5de5('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x5de5('0x1a'))['db'];var extensions=require(_0x5de5('0x1b'));function respondWithStatusCode(_0x1a251e,_0x12dab1){_0x12dab1=_0x12dab1||0xcc;return function(_0xd3630a){if(_0xd3630a){return _0x1a251e[_0x5de5('0x1c')](_0x12dab1);}return _0x1a251e[_0x5de5('0x1d')](_0x12dab1)[_0x5de5('0x1e')]();};}function respondWithResult(_0xce759d,_0x17f2c3){_0x17f2c3=_0x17f2c3||0xc8;return function(_0x1eb150){if(_0x1eb150){return _0xce759d[_0x5de5('0x1d')](_0x17f2c3)[_0x5de5('0x1f')](_0x1eb150);}};}function respondWithFilteredResult(_0x4007f1,_0x4739de){return function(_0x3cc412){if(_0x3cc412){var _0x17f45f=typeof _0x4739de[_0x5de5('0x20')]===_0x5de5('0x21')&&typeof _0x4739de[_0x5de5('0x22')]==='undefined';var _0x40a59d=_0x3cc412['count'];var _0x5d22f4=_0x17f45f?0x0:_0x4739de['offset'];var _0x3da5f8=_0x17f45f?_0x3cc412[_0x5de5('0x23')]:_0x4739de['offset']+_0x4739de[_0x5de5('0x22')];var _0x1d9e8f;if(_0x3da5f8>=_0x40a59d){_0x3da5f8=_0x40a59d;_0x1d9e8f=0xc8;}else{_0x1d9e8f=0xce;}_0x4007f1[_0x5de5('0x1d')](_0x1d9e8f);return _0x4007f1[_0x5de5('0x24')](_0x5de5('0x25'),_0x5d22f4+'-'+_0x3da5f8+'/'+_0x40a59d)[_0x5de5('0x1f')](_0x3cc412);}return null;};}function patchUpdates(_0xde1f5d){return function(_0x5f23ad){try{jsonpatch[_0x5de5('0x26')](_0x5f23ad,_0xde1f5d,!![]);}catch(_0x889053){return BPromise[_0x5de5('0x27')](_0x889053);}return _0x5f23ad[_0x5de5('0x28')]();};}function saveUpdates(_0x167a0c,_0x340549){return function(_0x540a3f){if(_0x540a3f){return _0x540a3f['update'](_0x167a0c)[_0x5de5('0x29')](function(_0x53a335){return _0x53a335;});}return null;};}function removeEntity(_0x10849f,_0x1a57b2){return function(_0x125bcb){if(_0x125bcb){return _0x125bcb[_0x5de5('0x2a')]()['then'](function(){var _0x3a0010=_0x125bcb[_0x5de5('0x2b')]({'plain':!![]});var _0xcd1899=_0x5de5('0x2c');return db[_0x5de5('0x2d')][_0x5de5('0x2a')]({'where':{'type':_0xcd1899,'resourceId':_0x3a0010['id']}})[_0x5de5('0x29')](function(){return _0x125bcb;});})['then'](function(){_0x10849f[_0x5de5('0x1d')](0xcc)[_0x5de5('0x1e')]();});}};}function handleEntityNotFound(_0x220c18,_0x27f70a){return function(_0x342b82){if(!_0x342b82){_0x220c18['sendStatus'](0x194);}return _0x342b82;};}function handleError(_0x410856,_0x2adfe3){_0x2adfe3=_0x2adfe3||0x1f4;return function(_0x57aa11){logger[_0x5de5('0x2e')](_0x57aa11[_0x5de5('0x2f')]);if(_0x57aa11['name']){delete _0x57aa11['name'];}_0x410856[_0x5de5('0x1d')](_0x2adfe3)[_0x5de5('0x30')](_0x57aa11);};}exports['index']=function(_0x5065ea,_0x4ec008){var _0x330bfb={},_0x4e4d9d={},_0x167c28={'count':0x0,'rows':[]};var _0x9a8f1b=_[_0x5de5('0x31')](db['Interval'][_0x5de5('0x32')],function(_0x3543ee){return{'name':_0x3543ee[_0x5de5('0x33')],'type':_0x3543ee[_0x5de5('0x34')][_0x5de5('0x35')]};});_0x4e4d9d['model']=_['map'](_0x9a8f1b,'name');_0x4e4d9d['query']=_['keys'](_0x5065ea[_0x5de5('0x36')]);_0x4e4d9d[_0x5de5('0x37')]=_[_0x5de5('0x38')](_0x4e4d9d[_0x5de5('0x39')],_0x4e4d9d[_0x5de5('0x36')]);_0x330bfb[_0x5de5('0x3a')]=_['intersection'](_0x4e4d9d[_0x5de5('0x39')],qs['fields'](_0x5065ea[_0x5de5('0x36')]['fields']));_0x330bfb[_0x5de5('0x3a')]=_0x330bfb['attributes'][_0x5de5('0x3b')]?_0x330bfb[_0x5de5('0x3a')]:_0x4e4d9d[_0x5de5('0x39')];if(!_0x5065ea[_0x5de5('0x36')]['hasOwnProperty'](_0x5de5('0x3c'))){_0x330bfb['limit']=qs[_0x5de5('0x22')](_0x5065ea[_0x5de5('0x36')][_0x5de5('0x22')]);_0x330bfb[_0x5de5('0x20')]=qs[_0x5de5('0x20')](_0x5065ea[_0x5de5('0x36')][_0x5de5('0x20')]);}_0x330bfb[_0x5de5('0x3d')]=qs['sort'](_0x5065ea[_0x5de5('0x36')][_0x5de5('0x3e')]);_0x330bfb['where']=qs[_0x5de5('0x37')](_[_0x5de5('0x3f')](_0x5065ea[_0x5de5('0x36')],_0x4e4d9d[_0x5de5('0x37')]),_0x9a8f1b);if(_0x5065ea[_0x5de5('0x36')][_0x5de5('0x40')]){_0x330bfb[_0x5de5('0x41')]=_[_0x5de5('0x42')](_0x330bfb[_0x5de5('0x41')],{'$or':_['map'](_0x9a8f1b,function(_0x1c6fbb){if(_0x1c6fbb['type']!==_0x5de5('0x43')){var _0x1e90c7={};_0x1e90c7[_0x1c6fbb['name']]={'$like':'%'+_0x5065ea['query'][_0x5de5('0x40')]+'%'};return _0x1e90c7;}})});}_0x330bfb=_['merge']({},_0x330bfb,_0x5065ea['options']);var _0x38bb55={'where':_0x330bfb[_0x5de5('0x41')]};return db[_0x5de5('0x44')][_0x5de5('0x23')](_0x38bb55)[_0x5de5('0x29')](function(_0x3b21c1){_0x167c28[_0x5de5('0x23')]=_0x3b21c1;if(_0x5065ea[_0x5de5('0x36')][_0x5de5('0x45')]){_0x330bfb['include']=[{'all':!![]}];}return db[_0x5de5('0x44')][_0x5de5('0x46')](_0x330bfb);})['then'](function(_0x195b07){_0x167c28['rows']=_0x195b07;return _0x167c28;})[_0x5de5('0x29')](respondWithFilteredResult(_0x4ec008,_0x330bfb))[_0x5de5('0x47')](handleError(_0x4ec008,null));};exports[_0x5de5('0x48')]=function(_0xc51d7c,_0x1bcb4e){var _0x496a87={'raw':!![],'where':{'id':_0xc51d7c['params']['id']}},_0xef29de={};_0xef29de[_0x5de5('0x39')]=_['keys'](db['Interval'][_0x5de5('0x32')]);_0xef29de[_0x5de5('0x36')]=_['keys'](_0xc51d7c[_0x5de5('0x36')]);_0xef29de[_0x5de5('0x37')]=_[_0x5de5('0x38')](_0xef29de[_0x5de5('0x39')],_0xef29de['query']);_0x496a87[_0x5de5('0x3a')]=_[_0x5de5('0x38')](_0xef29de[_0x5de5('0x39')],qs['fields'](_0xc51d7c[_0x5de5('0x36')][_0x5de5('0x49')]));_0x496a87[_0x5de5('0x3a')]=_0x496a87[_0x5de5('0x3a')][_0x5de5('0x3b')]?_0x496a87['attributes']:_0xef29de[_0x5de5('0x39')];if(_0xc51d7c[_0x5de5('0x36')][_0x5de5('0x45')]){_0x496a87[_0x5de5('0x4a')]=[{'all':!![]}];}_0x496a87=_[_0x5de5('0x42')]({},_0x496a87,_0xc51d7c[_0x5de5('0x4b')]);return db[_0x5de5('0x44')]['find'](_0x496a87)['then'](handleEntityNotFound(_0x1bcb4e,null))[_0x5de5('0x29')](respondWithResult(_0x1bcb4e,null))[_0x5de5('0x47')](handleError(_0x1bcb4e,null));};exports[_0x5de5('0x4c')]=function(_0x361dbb,_0x45b2be){return db['Interval'][_0x5de5('0x4c')](_0x361dbb['body'],{})[_0x5de5('0x29')](function(_0x34ec29){var _0x46d2d3=_0x361dbb[_0x5de5('0x4d')][_0x5de5('0x2b')]({'plain':!![]});if(!_0x46d2d3)throw new Error(_0x5de5('0x4e'));if(_0x46d2d3[_0x5de5('0x4f')]==='user'){var _0x9aa1ab=_0x34ec29[_0x5de5('0x2b')]({'plain':!![]});var _0x597b98=_0x5de5('0x2c');return db[_0x5de5('0x50')][_0x5de5('0x51')]({'where':{'name':_0x597b98,'userProfileId':_0x46d2d3['userProfileId']},'raw':!![]})[_0x5de5('0x29')](function(_0x42cc0e){if(_0x42cc0e&&_0x42cc0e[_0x5de5('0x52')]===0x0){return db[_0x5de5('0x2d')][_0x5de5('0x4c')]({'name':_0x9aa1ab[_0x5de5('0x53')],'resourceId':_0x9aa1ab['id'],'type':_0x42cc0e[_0x5de5('0x53')],'sectionId':_0x42cc0e['id']},{})[_0x5de5('0x29')](function(){return _0x34ec29;});}else{return _0x34ec29;}})[_0x5de5('0x47')](function(_0x3cfac7){logger[_0x5de5('0x2e')](_0x5de5('0x54'),_0x3cfac7);throw _0x3cfac7;});}return _0x34ec29;})[_0x5de5('0x29')](respondWithResult(_0x45b2be,0xc9))[_0x5de5('0x47')](handleError(_0x45b2be,null));};exports[_0x5de5('0x55')]=function(_0x5a9687,_0x163230){if(_0x5a9687[_0x5de5('0x56')]['id']){delete _0x5a9687[_0x5de5('0x56')]['id'];}return db[_0x5de5('0x44')]['find']({'where':{'id':_0x5a9687['params']['id']}})[_0x5de5('0x29')](handleEntityNotFound(_0x163230,null))[_0x5de5('0x29')](saveUpdates(_0x5a9687[_0x5de5('0x56')],null))['then'](respondWithResult(_0x163230,null))[_0x5de5('0x47')](handleError(_0x163230,null));};exports[_0x5de5('0x2a')]=function(_0xbfd962,_0x4bacee){return db[_0x5de5('0x44')]['find']({'where':{'id':_0xbfd962[_0x5de5('0x57')]['id']}})[_0x5de5('0x29')](handleEntityNotFound(_0x4bacee,null))['then'](removeEntity(_0x4bacee,null))[_0x5de5('0x47')](handleError(_0x4bacee,null));};exports[_0x5de5('0x58')]=function(_0x59e181,_0x1b9901,_0x570f3a){if(_0x59e181[_0x5de5('0x56')]['id']){delete _0x59e181[_0x5de5('0x56')]['id'];}return db['Interval'][_0x5de5('0x51')]({'where':{'id':_0x59e181[_0x5de5('0x57')]['id']}})[_0x5de5('0x29')](handleEntityNotFound(_0x1b9901,null))[_0x5de5('0x29')](function(_0x577f57){if(_0x577f57){_0x59e181['body'][_0x5de5('0x59')]=_0x577f57['id'];return db[_0x5de5('0x44')]['create'](_0x59e181['body']);}})[_0x5de5('0x29')](respondWithResult(_0x1b9901,null))['catch'](handleError(_0x1b9901,null));};exports['getIntervals']=function(_0x16f069,_0x44911b,_0x2c6dbb){var _0x2928fb={};var _0x26a228={};var _0x234e06;var _0x4dfc29;return db[_0x5de5('0x44')][_0x5de5('0x5a')]({'where':{'id':_0x16f069[_0x5de5('0x57')]['id']}})[_0x5de5('0x29')](handleEntityNotFound(_0x44911b,null))[_0x5de5('0x29')](function(_0x2c9b83){if(_0x2c9b83){_0x234e06=_0x2c9b83;_0x26a228[_0x5de5('0x39')]=_[_0x5de5('0x5b')](db[_0x5de5('0x44')]['rawAttributes']);_0x26a228[_0x5de5('0x36')]=_[_0x5de5('0x5b')](_0x16f069['query']);_0x26a228[_0x5de5('0x37')]=_[_0x5de5('0x38')](_0x26a228[_0x5de5('0x39')],_0x26a228[_0x5de5('0x36')]);_0x2928fb[_0x5de5('0x3a')]=_[_0x5de5('0x38')](_0x26a228['model'],qs[_0x5de5('0x49')](_0x16f069[_0x5de5('0x36')]['fields']));_0x2928fb[_0x5de5('0x3a')]=_0x2928fb['attributes']['length']?_0x2928fb[_0x5de5('0x3a')]:_0x26a228[_0x5de5('0x39')];_0x2928fb[_0x5de5('0x3d')]=qs[_0x5de5('0x3e')](_0x16f069[_0x5de5('0x36')][_0x5de5('0x3e')]);_0x2928fb[_0x5de5('0x41')]=qs[_0x5de5('0x37')](_[_0x5de5('0x3f')](_0x16f069['query'],_0x26a228[_0x5de5('0x37')]));if(_0x16f069[_0x5de5('0x36')][_0x5de5('0x40')]){_0x2928fb[_0x5de5('0x41')]=_[_0x5de5('0x42')](_0x2928fb['where'],{'$or':_['map'](_0x2928fb[_0x5de5('0x3a')],function(_0x5f3c81){var _0x5f0fe1={};_0x5f0fe1[_0x5f3c81]={'$like':'%'+_0x16f069['query'][_0x5de5('0x40')]+'%'};return _0x5f0fe1;})});}_0x2928fb=_[_0x5de5('0x42')]({},_0x2928fb,_0x16f069[_0x5de5('0x4b')]);return _0x234e06['getIntervals'](_0x2928fb);}})[_0x5de5('0x29')](function(_0x3c1f1e){if(_0x3c1f1e){_0x4dfc29=_0x3c1f1e['length'];if(!_0x16f069[_0x5de5('0x36')][_0x5de5('0x5c')](_0x5de5('0x3c'))){_0x2928fb[_0x5de5('0x22')]=qs['limit'](_0x16f069[_0x5de5('0x36')][_0x5de5('0x22')]);_0x2928fb['offset']=qs[_0x5de5('0x20')](_0x16f069['query'][_0x5de5('0x20')]);}return _0x234e06['getIntervals'](_0x2928fb);}})['then'](function(_0x39a59b){if(_0x39a59b){return _0x39a59b?{'count':_0x4dfc29,'rows':_0x39a59b}:null;}})[_0x5de5('0x29')](respondWithResult(_0x44911b,null))[_0x5de5('0x47')](handleError(_0x44911b,null));};exports[_0x5de5('0x5d')]=function(_0x2bc0c6,_0x246a8e,_0x5a3e4f){return db[_0x5de5('0x44')][_0x5de5('0x5a')]({'where':{'id':_0x2bc0c6['params']['id']}})[_0x5de5('0x29')](handleEntityNotFound(_0x246a8e,null))[_0x5de5('0x29')](function(_0x2c9d2b){if(_0x2c9d2b){return db['sequelize']['transaction'](function(_0x32bb36){return db[_0x5de5('0x44')][_0x5de5('0x2a')]({'where':{'IntervalId':_0x2bc0c6[_0x5de5('0x57')]['id']},'transaction':_0x32bb36})[_0x5de5('0x29')](function(_0x5a879e){var _0x57e1be=_[_0x5de5('0x31')](_0x2bc0c6[_0x5de5('0x56')],function(_0x11e992){delete _0x11e992['id'];_0x11e992[_0x5de5('0x59')]=_0x2bc0c6['params']['id'];return _0x11e992;});return db[_0x5de5('0x44')][_0x5de5('0x5e')](_0x57e1be,{'transaction':_0x32bb36});});})['then'](function(){return db[_0x5de5('0x44')][_0x5de5('0x46')]({'where':{'IntervalId':_0x2bc0c6[_0x5de5('0x57')]['id']}});});}})[_0x5de5('0x29')](respondWithResult(_0x246a8e,null))[_0x5de5('0x47')](handleError(_0x246a8e,null));}; \ No newline at end of file +var _0xea5f=['get','UserProfileResource','error','stack','name','index','map','Interval','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','show','params','options','catch','create','body','user','role','Intervals','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','getIntervals','findOne','addIntervals','transaction','IntervalId','bulkCreate','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','save','update','then','destroy'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xea5f,0x90));var _0xfea5=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xea5f[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfea5('0x0'));var zipdir=require(_0xfea5('0x1'));var jsonpatch=require(_0xfea5('0x2'));var rp=require(_0xfea5('0x3'));var moment=require(_0xfea5('0x4'));var BPromise=require(_0xfea5('0x5'));var Mustache=require(_0xfea5('0x6'));var util=require(_0xfea5('0x7'));var path=require(_0xfea5('0x8'));var sox=require(_0xfea5('0x9'));var csv=require('to-csv');var ejs=require(_0xfea5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfea5('0xb'));var squel=require(_0xfea5('0xc'));var crypto=require(_0xfea5('0xd'));var jsforce=require(_0xfea5('0xe'));var deskjs=require(_0xfea5('0xf'));var toCsv=require(_0xfea5('0x10'));var querystring=require(_0xfea5('0x11'));var Papa=require('papaparse');var Redis=require(_0xfea5('0x12'));var authService=require(_0xfea5('0x13'));var qs=require(_0xfea5('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xfea5('0x15'))(_0xfea5('0x16'));var utils=require(_0xfea5('0x17'));var config=require(_0xfea5('0x18'));var licenseUtil=require(_0xfea5('0x19'));var db=require(_0xfea5('0x1a'))['db'];var extensions=require(_0xfea5('0x1b'));function respondWithStatusCode(_0xc9f59a,_0x216e63){_0x216e63=_0x216e63||0xcc;return function(_0x143d29){if(_0x143d29){return _0xc9f59a[_0xfea5('0x1c')](_0x216e63);}return _0xc9f59a['status'](_0x216e63)[_0xfea5('0x1d')]();};}function respondWithResult(_0x472323,_0x56e6e5){_0x56e6e5=_0x56e6e5||0xc8;return function(_0x137831){if(_0x137831){return _0x472323['status'](_0x56e6e5)[_0xfea5('0x1e')](_0x137831);}};}function respondWithFilteredResult(_0x1ae97a,_0x378631){return function(_0xb87c00){if(_0xb87c00){var _0x4d9b9d=typeof _0x378631[_0xfea5('0x1f')]==='undefined'&&typeof _0x378631['limit']===_0xfea5('0x20');var _0x75599f=_0xb87c00[_0xfea5('0x21')];var _0x502493=_0x4d9b9d?0x0:_0x378631['offset'];var _0x33e407=_0x4d9b9d?_0xb87c00['count']:_0x378631[_0xfea5('0x1f')]+_0x378631[_0xfea5('0x22')];var _0x4966ad;if(_0x33e407>=_0x75599f){_0x33e407=_0x75599f;_0x4966ad=0xc8;}else{_0x4966ad=0xce;}_0x1ae97a[_0xfea5('0x23')](_0x4966ad);return _0x1ae97a[_0xfea5('0x24')](_0xfea5('0x25'),_0x502493+'-'+_0x33e407+'/'+_0x75599f)[_0xfea5('0x1e')](_0xb87c00);}return null;};}function patchUpdates(_0x15cc12){return function(_0x1d7464){try{jsonpatch['apply'](_0x1d7464,_0x15cc12,!![]);}catch(_0x197d6f){return BPromise['reject'](_0x197d6f);}return _0x1d7464[_0xfea5('0x26')]();};}function saveUpdates(_0x4bd5d2,_0x3b5a7d){return function(_0x3f96c5){if(_0x3f96c5){return _0x3f96c5[_0xfea5('0x27')](_0x4bd5d2)[_0xfea5('0x28')](function(_0x29c5fb){return _0x29c5fb;});}return null;};}function removeEntity(_0x12c8e4,_0x310adb){return function(_0x2160df){if(_0x2160df){return _0x2160df[_0xfea5('0x29')]()[_0xfea5('0x28')](function(){var _0x35aeec=_0x2160df[_0xfea5('0x2a')]({'plain':!![]});var _0x1a7345='Intervals';return db[_0xfea5('0x2b')][_0xfea5('0x29')]({'where':{'type':_0x1a7345,'resourceId':_0x35aeec['id']}})[_0xfea5('0x28')](function(){return _0x2160df;});})[_0xfea5('0x28')](function(){_0x12c8e4[_0xfea5('0x23')](0xcc)[_0xfea5('0x1d')]();});}};}function handleEntityNotFound(_0x588365,_0xaa7a5e){return function(_0x55f2a0){if(!_0x55f2a0){_0x588365[_0xfea5('0x1c')](0x194);}return _0x55f2a0;};}function handleError(_0x5e128e,_0x2da0a3){_0x2da0a3=_0x2da0a3||0x1f4;return function(_0x98d649){logger[_0xfea5('0x2c')](_0x98d649[_0xfea5('0x2d')]);if(_0x98d649['name']){delete _0x98d649[_0xfea5('0x2e')];}_0x5e128e[_0xfea5('0x23')](_0x2da0a3)['send'](_0x98d649);};}exports[_0xfea5('0x2f')]=function(_0x5a4ecb,_0x1a03f1){var _0x442a53={},_0x51d360={},_0x140301={'count':0x0,'rows':[]};var _0x7471de=_[_0xfea5('0x30')](db[_0xfea5('0x31')][_0xfea5('0x32')],function(_0x4a1101){return{'name':_0x4a1101['fieldName'],'type':_0x4a1101[_0xfea5('0x33')][_0xfea5('0x34')]};});_0x51d360[_0xfea5('0x35')]=_[_0xfea5('0x30')](_0x7471de,_0xfea5('0x2e'));_0x51d360[_0xfea5('0x36')]=_[_0xfea5('0x37')](_0x5a4ecb[_0xfea5('0x36')]);_0x51d360[_0xfea5('0x38')]=_[_0xfea5('0x39')](_0x51d360[_0xfea5('0x35')],_0x51d360[_0xfea5('0x36')]);_0x442a53[_0xfea5('0x3a')]=_[_0xfea5('0x39')](_0x51d360[_0xfea5('0x35')],qs[_0xfea5('0x3b')](_0x5a4ecb[_0xfea5('0x36')][_0xfea5('0x3b')]));_0x442a53[_0xfea5('0x3a')]=_0x442a53[_0xfea5('0x3a')][_0xfea5('0x3c')]?_0x442a53[_0xfea5('0x3a')]:_0x51d360[_0xfea5('0x35')];if(!_0x5a4ecb[_0xfea5('0x36')][_0xfea5('0x3d')](_0xfea5('0x3e'))){_0x442a53[_0xfea5('0x22')]=qs[_0xfea5('0x22')](_0x5a4ecb[_0xfea5('0x36')]['limit']);_0x442a53[_0xfea5('0x1f')]=qs['offset'](_0x5a4ecb[_0xfea5('0x36')][_0xfea5('0x1f')]);}_0x442a53[_0xfea5('0x3f')]=qs[_0xfea5('0x40')](_0x5a4ecb[_0xfea5('0x36')][_0xfea5('0x40')]);_0x442a53[_0xfea5('0x41')]=qs['filters'](_[_0xfea5('0x42')](_0x5a4ecb[_0xfea5('0x36')],_0x51d360[_0xfea5('0x38')]),_0x7471de);if(_0x5a4ecb[_0xfea5('0x36')]['filter']){_0x442a53['where']=_[_0xfea5('0x43')](_0x442a53[_0xfea5('0x41')],{'$or':_['map'](_0x7471de,function(_0x772079){if(_0x772079[_0xfea5('0x33')]!==_0xfea5('0x44')){var _0x51d52c={};_0x51d52c[_0x772079['name']]={'$like':'%'+_0x5a4ecb[_0xfea5('0x36')][_0xfea5('0x45')]+'%'};return _0x51d52c;}})});}_0x442a53=_[_0xfea5('0x43')]({},_0x442a53,_0x5a4ecb['options']);var _0x10f29c={'where':_0x442a53[_0xfea5('0x41')]};return db[_0xfea5('0x31')]['count'](_0x10f29c)[_0xfea5('0x28')](function(_0x296668){_0x140301[_0xfea5('0x21')]=_0x296668;if(_0x5a4ecb[_0xfea5('0x36')][_0xfea5('0x46')]){_0x442a53[_0xfea5('0x47')]=[{'all':!![]}];}return db['Interval'][_0xfea5('0x48')](_0x442a53);})[_0xfea5('0x28')](function(_0x5b7f0a){_0x140301['rows']=_0x5b7f0a;return _0x140301;})[_0xfea5('0x28')](respondWithFilteredResult(_0x1a03f1,_0x442a53))['catch'](handleError(_0x1a03f1,null));};exports[_0xfea5('0x49')]=function(_0x4bb6e3,_0x1ac4f3){var _0x3165cc={'raw':!![],'where':{'id':_0x4bb6e3[_0xfea5('0x4a')]['id']}},_0x52d2a5={};_0x52d2a5[_0xfea5('0x35')]=_[_0xfea5('0x37')](db[_0xfea5('0x31')][_0xfea5('0x32')]);_0x52d2a5['query']=_[_0xfea5('0x37')](_0x4bb6e3['query']);_0x52d2a5[_0xfea5('0x38')]=_['intersection'](_0x52d2a5[_0xfea5('0x35')],_0x52d2a5[_0xfea5('0x36')]);_0x3165cc['attributes']=_[_0xfea5('0x39')](_0x52d2a5[_0xfea5('0x35')],qs[_0xfea5('0x3b')](_0x4bb6e3[_0xfea5('0x36')][_0xfea5('0x3b')]));_0x3165cc[_0xfea5('0x3a')]=_0x3165cc[_0xfea5('0x3a')][_0xfea5('0x3c')]?_0x3165cc['attributes']:_0x52d2a5['model'];if(_0x4bb6e3[_0xfea5('0x36')]['includeAll']){_0x3165cc['include']=[{'all':!![]}];}_0x3165cc=_[_0xfea5('0x43')]({},_0x3165cc,_0x4bb6e3[_0xfea5('0x4b')]);return db['Interval']['find'](_0x3165cc)['then'](handleEntityNotFound(_0x1ac4f3,null))['then'](respondWithResult(_0x1ac4f3,null))[_0xfea5('0x4c')](handleError(_0x1ac4f3,null));};exports[_0xfea5('0x4d')]=function(_0x3149b7,_0x29af27){return db[_0xfea5('0x31')][_0xfea5('0x4d')](_0x3149b7[_0xfea5('0x4e')],{})[_0xfea5('0x28')](function(_0x144041){var _0x27c751=_0x3149b7[_0xfea5('0x4f')][_0xfea5('0x2a')]({'plain':!![]});if(!_0x27c751)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x27c751[_0xfea5('0x50')]===_0xfea5('0x4f')){var _0x152412=_0x144041[_0xfea5('0x2a')]({'plain':!![]});var _0x3b2069=_0xfea5('0x51');return db['UserProfileSection'][_0xfea5('0x52')]({'where':{'name':_0x3b2069,'userProfileId':_0x27c751[_0xfea5('0x53')]},'raw':!![]})[_0xfea5('0x28')](function(_0xc724fc){if(_0xc724fc&&_0xc724fc[_0xfea5('0x54')]===0x0){return db[_0xfea5('0x2b')]['create']({'name':_0x152412[_0xfea5('0x2e')],'resourceId':_0x152412['id'],'type':_0xc724fc['name'],'sectionId':_0xc724fc['id']},{})[_0xfea5('0x28')](function(){return _0x144041;});}else{return _0x144041;}})[_0xfea5('0x4c')](function(_0x4bc1e5){logger[_0xfea5('0x2c')](_0xfea5('0x55'),_0x4bc1e5);throw _0x4bc1e5;});}return _0x144041;})['then'](respondWithResult(_0x29af27,0xc9))[_0xfea5('0x4c')](handleError(_0x29af27,null));};exports[_0xfea5('0x27')]=function(_0x5b8988,_0x44a727){if(_0x5b8988[_0xfea5('0x4e')]['id']){delete _0x5b8988[_0xfea5('0x4e')]['id'];}return db[_0xfea5('0x31')][_0xfea5('0x52')]({'where':{'id':_0x5b8988[_0xfea5('0x4a')]['id']}})[_0xfea5('0x28')](handleEntityNotFound(_0x44a727,null))['then'](saveUpdates(_0x5b8988[_0xfea5('0x4e')],null))[_0xfea5('0x28')](respondWithResult(_0x44a727,null))[_0xfea5('0x4c')](handleError(_0x44a727,null));};exports['destroy']=function(_0x25fee3,_0x2fc54e){return db['Interval'][_0xfea5('0x52')]({'where':{'id':_0x25fee3['params']['id']}})[_0xfea5('0x28')](handleEntityNotFound(_0x2fc54e,null))['then'](removeEntity(_0x2fc54e,null))[_0xfea5('0x4c')](handleError(_0x2fc54e,null));};exports[_0xfea5('0x56')]=function(_0x159c03,_0x5442c2,_0x3671a7){if(_0x159c03['body']['id']){delete _0x159c03[_0xfea5('0x4e')]['id'];}return db[_0xfea5('0x31')][_0xfea5('0x52')]({'where':{'id':_0x159c03[_0xfea5('0x4a')]['id']}})[_0xfea5('0x28')](handleEntityNotFound(_0x5442c2,null))[_0xfea5('0x28')](function(_0x30ab66){if(_0x30ab66){_0x159c03[_0xfea5('0x4e')]['IntervalId']=_0x30ab66['id'];return db[_0xfea5('0x31')][_0xfea5('0x4d')](_0x159c03[_0xfea5('0x4e')]);}})['then'](respondWithResult(_0x5442c2,null))[_0xfea5('0x4c')](handleError(_0x5442c2,null));};exports[_0xfea5('0x57')]=function(_0x5bb208,_0x453e4b,_0x52f4a5){var _0x4900cb={};var _0x51b398={};var _0x2e6dc;var _0x3bbdd2;return db[_0xfea5('0x31')][_0xfea5('0x58')]({'where':{'id':_0x5bb208['params']['id']}})[_0xfea5('0x28')](handleEntityNotFound(_0x453e4b,null))[_0xfea5('0x28')](function(_0x477876){if(_0x477876){_0x2e6dc=_0x477876;_0x51b398['model']=_[_0xfea5('0x37')](db['Interval'][_0xfea5('0x32')]);_0x51b398['query']=_['keys'](_0x5bb208['query']);_0x51b398[_0xfea5('0x38')]=_[_0xfea5('0x39')](_0x51b398[_0xfea5('0x35')],_0x51b398[_0xfea5('0x36')]);_0x4900cb[_0xfea5('0x3a')]=_[_0xfea5('0x39')](_0x51b398['model'],qs['fields'](_0x5bb208['query'][_0xfea5('0x3b')]));_0x4900cb[_0xfea5('0x3a')]=_0x4900cb[_0xfea5('0x3a')][_0xfea5('0x3c')]?_0x4900cb[_0xfea5('0x3a')]:_0x51b398[_0xfea5('0x35')];_0x4900cb[_0xfea5('0x3f')]=qs[_0xfea5('0x40')](_0x5bb208[_0xfea5('0x36')][_0xfea5('0x40')]);_0x4900cb[_0xfea5('0x41')]=qs['filters'](_[_0xfea5('0x42')](_0x5bb208[_0xfea5('0x36')],_0x51b398[_0xfea5('0x38')]));if(_0x5bb208['query'][_0xfea5('0x45')]){_0x4900cb[_0xfea5('0x41')]=_[_0xfea5('0x43')](_0x4900cb[_0xfea5('0x41')],{'$or':_['map'](_0x4900cb[_0xfea5('0x3a')],function(_0x281369){var _0x53ed43={};_0x53ed43[_0x281369]={'$like':'%'+_0x5bb208[_0xfea5('0x36')]['filter']+'%'};return _0x53ed43;})});}_0x4900cb=_[_0xfea5('0x43')]({},_0x4900cb,_0x5bb208[_0xfea5('0x4b')]);return _0x2e6dc[_0xfea5('0x57')](_0x4900cb);}})[_0xfea5('0x28')](function(_0x5c1edd){if(_0x5c1edd){_0x3bbdd2=_0x5c1edd[_0xfea5('0x3c')];if(!_0x5bb208[_0xfea5('0x36')][_0xfea5('0x3d')](_0xfea5('0x3e'))){_0x4900cb['limit']=qs['limit'](_0x5bb208[_0xfea5('0x36')][_0xfea5('0x22')]);_0x4900cb[_0xfea5('0x1f')]=qs[_0xfea5('0x1f')](_0x5bb208[_0xfea5('0x36')]['offset']);}return _0x2e6dc[_0xfea5('0x57')](_0x4900cb);}})['then'](function(_0x20519a){if(_0x20519a){return _0x20519a?{'count':_0x3bbdd2,'rows':_0x20519a}:null;}})[_0xfea5('0x28')](respondWithResult(_0x453e4b,null))[_0xfea5('0x4c')](handleError(_0x453e4b,null));};exports[_0xfea5('0x59')]=function(_0x5e1aa7,_0x2e5942,_0x180948){return db[_0xfea5('0x31')]['findOne']({'where':{'id':_0x5e1aa7['params']['id']}})[_0xfea5('0x28')](handleEntityNotFound(_0x2e5942,null))[_0xfea5('0x28')](function(_0x10c78f){if(_0x10c78f){return db['sequelize'][_0xfea5('0x5a')](function(_0x2dd4fb){return db['Interval'][_0xfea5('0x29')]({'where':{'IntervalId':_0x5e1aa7[_0xfea5('0x4a')]['id']},'transaction':_0x2dd4fb})[_0xfea5('0x28')](function(_0x153f7a){var _0x28b657=_[_0xfea5('0x30')](_0x5e1aa7['body'],function(_0x3607cf){delete _0x3607cf['id'];_0x3607cf[_0xfea5('0x5b')]=_0x5e1aa7[_0xfea5('0x4a')]['id'];return _0x3607cf;});return db['Interval'][_0xfea5('0x5c')](_0x28b657,{'transaction':_0x2dd4fb});});})['then'](function(){return db[_0xfea5('0x31')][_0xfea5('0x48')]({'where':{'IntervalId':_0x5e1aa7[_0xfea5('0x4a')]['id']}});});}})[_0xfea5('0x28')](respondWithResult(_0x2e5942,null))[_0xfea5('0x4c')](handleError(_0x2e5942,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index a20d090..26174fe 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 _0xa9ad=['./interval.attributes','exports','define','Interval','rewrite','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xa9ad,0xeb));var _0xda9a=function(_0x163e04,_0xd7dffa){_0x163e04=_0x163e04-0x0;var _0x5041f6=_0xa9ad[_0x163e04];return _0x5041f6;};'use strict';var _=require(_0xda9a('0x0'));var util=require(_0xda9a('0x1'));var logger=require(_0xda9a('0x2'))('api');var moment=require('moment');var BPromise=require(_0xda9a('0x3'));var rp=require(_0xda9a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xda9a('0x5'));var extensions=require('../../components/extensions/rewrite');module[_0xda9a('0x6')]=function(_0x3c30c9,_0x142e0d){return _0x3c30c9[_0xda9a('0x7')](_0xda9a('0x8'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4387a6,_0x4a7ec4){extensions[_0xda9a('0x9')](_0x3c30c9,_0x4387a6);},'afterBulkCreate':function(_0x38c43e,_0x42433a,_0x4ae151){_0x4ae151();extensions['rewrite'](_0x3c30c9,_0x38c43e[0x0]);},'afterUpdate':function(_0x337b7e,_0x16efaf){extensions[_0xda9a('0x9')](_0x3c30c9,_0x337b7e);},'afterDestroy':function(_0x3e06a3,_0x5cf23a){extensions[_0xda9a('0x9')](_0x3c30c9,_0x3e06a3);}}});}; \ No newline at end of file +var _0xd50e=['util','../../config/logger','api','moment','request-promise','path','rimraf','./interval.attributes','exports','define','tools_intervals','rewrite'];(function(_0x5a4707,_0x1bade0){var _0x23db91=function(_0x2eb9b7){while(--_0x2eb9b7){_0x5a4707['push'](_0x5a4707['shift']());}};_0x23db91(++_0x1bade0);}(_0xd50e,0x120));var _0xed50=function(_0x2be08e,_0x3283fc){_0x2be08e=_0x2be08e-0x0;var _0x269ffc=_0xd50e[_0x2be08e];return _0x269ffc;};'use strict';var _=require('lodash');var util=require(_0xed50('0x0'));var logger=require(_0xed50('0x1'))(_0xed50('0x2'));var moment=require(_0xed50('0x3'));var BPromise=require('bluebird');var rp=require(_0xed50('0x4'));var fs=require('fs');var path=require(_0xed50('0x5'));var rimraf=require(_0xed50('0x6'));var config=require('../../config/environment');var attributes=require(_0xed50('0x7'));var extensions=require('../../components/extensions/rewrite');module[_0xed50('0x8')]=function(_0x4590a6,_0x5f321b){return _0x4590a6[_0xed50('0x9')]('Interval',attributes,{'tableName':_0xed50('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5f1d74,_0x12c94f){extensions['rewrite'](_0x4590a6,_0x5f1d74);},'afterBulkCreate':function(_0x27f19d,_0x986e1,_0x4088f){_0x4088f();extensions[_0xed50('0xb')](_0x4590a6,_0x27f19d[0x0]);},'afterUpdate':function(_0x4cfffa,_0x1d9773){extensions['rewrite'](_0x4590a6,_0x4cfffa);},'afterDestroy':function(_0x42939d,_0x5e4ac2){extensions['rewrite'](_0x4590a6,_0x42939d);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index c935ee0..cd44794 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(_0x4b9978,_0x58eb71){var _0x42f0e5=function(_0x4ff5dc){while(--_0x4ff5dc){_0x4b9978['push'](_0x4b9978['shift']());}};_0x42f0e5(++_0x58eb71);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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(_0x5a7d41,_0x4447e2){var _0x98d8fa=function(_0x2ce1cf){while(--_0x2ce1cf){_0x5a7d41['push'](_0x5a7d41['shift']());}};_0x98d8fa(++_0x4447e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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 df80949..d60a47d 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 _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x20bacb,_0x3bc615){var _0xe13f80=function(_0x5f1962){while(--_0x5f1962){_0x20bacb['push'](_0x20bacb['shift']());}};_0xe13f80(++_0x3bc615);}(_0xadb5,0xad));var _0x5adb=function(_0x48b107,_0x37b9b7){_0x48b107=_0x48b107-0x0;var _0x356269=_0xadb5[_0x48b107];return _0x356269;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router; \ No newline at end of file +var _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x583e1c,_0x473848){var _0x4a21b4=function(_0x3a974c){while(--_0x3a974c){_0x583e1c['push'](_0x583e1c['shift']());}};_0x4a21b4(++_0x473848);}(_0x2ef3,0xba));var _0x32ef=function(_0x34f478,_0x3ca318){_0x34f478=_0x34f478-0x0;var _0x2f3174=_0x2ef3[_0x34f478];return _0x2f3174;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['send']);module[_0x32ef('0x6')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index ecc2d7d..6d97842 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 _0x11d9=['name','customfield_11504','customfield_10102','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','data','statusCode','json','parse','error','status','write','end','openIssue','send','body','headers','x-forwarded-for','remoteAddress','connection','socket','https','api','support','3eAmWpBVP0','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','customfield_11500','email','customfield_11501','oldToken','fields','customfield_11502','customfield_11503'];(function(_0x5e20a9,_0x3e6d59){var _0x20fbd1=function(_0x58e608){while(--_0x58e608){_0x5e20a9['push'](_0x5e20a9['shift']());}};_0x20fbd1(++_0x3e6d59);}(_0x11d9,0x130));var _0x911d=function(_0x22a281,_0xe1ded6){_0x22a281=_0x22a281-0x0;var _0x40cebe=_0x11d9[_0x22a281];return _0x40cebe;};'use strict';var BPromise=require('bluebird');var https=require(_0x911d('0x0'));var logger=require('../../config/logger')(_0x911d('0x1'));var USERNAME=_0x911d('0x2');var PASSWORD=_0x911d('0x3');function openIssue(_0xa93a9e,_0xf1cc39){var _0x3e4b89={'fields':{'project':{'key':_0xa93a9e['key']||'MOTGUI'},'summary':(_0xa93a9e[_0x911d('0x4')]||_0x911d('0x5'))+_0x911d('0x6')+_0xa93a9e['ip'],'description':_0xa93a9e[_0x911d('0x7')]||JSON[_0x911d('0x8')](_0xa93a9e),'issuetype':{'name':_0xa93a9e[_0x911d('0x9')]||_0x911d('0xa')}}};_0x3e4b89['fields'][_0x911d('0xb')]=_0xa93a9e[_0x911d('0xc')];_0x3e4b89['fields'][_0x911d('0xd')]=_0xa93a9e[_0x911d('0xe')];_0x3e4b89[_0x911d('0xf')][_0x911d('0x10')]=_0xa93a9e['newToken'];_0x3e4b89[_0x911d('0xf')][_0x911d('0x11')]=_0xa93a9e[_0x911d('0x12')];_0x3e4b89[_0x911d('0xf')][_0x911d('0x13')]=_0xa93a9e['reason'];_0x3e4b89[_0x911d('0xf')][_0x911d('0x14')]=_0xa93a9e['ip'];var _0x45653c={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x911d('0x15'),'method':_0x911d('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0x911d('0x17'),'Authorization':_0x911d('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0x911d('0x19')](_0x911d('0x1a'))}};var _0x26c258=JSON[_0x911d('0x8')](_0x3e4b89);var _0x4ea19f=https[_0x911d('0x1b')](_0x45653c,function(_0x25b5e5){_0x25b5e5[_0x911d('0x1c')](_0x911d('0x1d'));var _0x3ae36c='';_0x25b5e5['on'](_0x911d('0x1e'),function(_0x280948){_0x3ae36c+=_0x280948;});_0x25b5e5['on']('end',function(){if(_0xf1cc39){return _0xf1cc39['status'](_0x25b5e5[_0x911d('0x1f')])[_0x911d('0x20')](JSON[_0x911d('0x21')](_0x3ae36c));}});});_0x4ea19f['on'](_0x911d('0x22'),function(_0x15c88e){if(_0xf1cc39){return _0xf1cc39[_0x911d('0x23')](0x1f4)[_0x911d('0x20')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':'api.jira'}]});}});_0x4ea19f[_0x911d('0x24')](_0x26c258);_0x4ea19f[_0x911d('0x25')]();}exports[_0x911d('0x26')]=openIssue;exports[_0x911d('0x27')]=function(_0x285600,_0x53cc5e){_0x285600[_0x911d('0x28')]['ip']=_0x285600[_0x911d('0x29')][_0x911d('0x2a')]||_0x285600['connection'][_0x911d('0x2b')]||_0x285600['socket']['remoteAddress']||_0x285600[_0x911d('0x2c')][_0x911d('0x2d')][_0x911d('0x2b')];return openIssue(_0x285600[_0x911d('0x28')],_0x53cc5e);}; \ No newline at end of file +var _0x3c21=['parse','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','\x20from\x20','issuetype','Bug','fields','customfield_11500','customfield_11501','oldToken','customfield_11504','track.xcallymotion.com','POST','application/json','Basic\x20','toString','base64','stringify','request','setEncoding','utf8','end','status','statusCode','json'];(function(_0x1b637b,_0x18155b){var _0x456ee3=function(_0x59ac87){while(--_0x59ac87){_0x1b637b['push'](_0x1b637b['shift']());}};_0x456ee3(++_0x18155b);}(_0x3c21,0x1cd));var _0x13c2=function(_0x4fb35e,_0x5db0b3){_0x4fb35e=_0x4fb35e-0x0;var _0x3eec86=_0x3c21[_0x4fb35e];return _0x3eec86;};'use strict';var BPromise=require(_0x13c2('0x0'));var https=require(_0x13c2('0x1'));var logger=require(_0x13c2('0x2'))(_0x13c2('0x3'));var USERNAME=_0x13c2('0x4');var PASSWORD=_0x13c2('0x5');function openIssue(_0x4acb93,_0x4903f3){var _0x102eb1={'fields':{'project':{'key':_0x4acb93[_0x13c2('0x6')]||_0x13c2('0x7')},'summary':(_0x4acb93[_0x13c2('0x8')]||'Report')+_0x13c2('0x9')+_0x4acb93['ip'],'description':_0x4acb93['description']||JSON['stringify'](_0x4acb93),'issuetype':{'name':_0x4acb93[_0x13c2('0xa')]||_0x13c2('0xb')}}};_0x102eb1[_0x13c2('0xc')][_0x13c2('0xd')]=_0x4acb93['email'];_0x102eb1[_0x13c2('0xc')][_0x13c2('0xe')]=_0x4acb93[_0x13c2('0xf')];_0x102eb1[_0x13c2('0xc')]['customfield_11502']=_0x4acb93['newToken'];_0x102eb1[_0x13c2('0xc')]['customfield_11503']=_0x4acb93['name'];_0x102eb1[_0x13c2('0xc')][_0x13c2('0x10')]=_0x4acb93['reason'];_0x102eb1[_0x13c2('0xc')]['customfield_10102']=_0x4acb93['ip'];var _0x19c95d={'host':_0x13c2('0x11'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x13c2('0x12'),'timeout':0x4e20,'headers':{'Content-Type':_0x13c2('0x13'),'Authorization':_0x13c2('0x14')+new Buffer(USERNAME+':'+PASSWORD)[_0x13c2('0x15')](_0x13c2('0x16'))}};var _0x647b7c=JSON[_0x13c2('0x17')](_0x102eb1);var _0x382b57=https[_0x13c2('0x18')](_0x19c95d,function(_0x2285a5){_0x2285a5[_0x13c2('0x19')](_0x13c2('0x1a'));var _0x17234f='';_0x2285a5['on']('data',function(_0x5095f1){_0x17234f+=_0x5095f1;});_0x2285a5['on'](_0x13c2('0x1b'),function(){if(_0x4903f3){return _0x4903f3[_0x13c2('0x1c')](_0x2285a5[_0x13c2('0x1d')])[_0x13c2('0x1e')](JSON[_0x13c2('0x1f')](_0x17234f));}});});_0x382b57['on']('error',function(_0x2626d2){if(_0x4903f3){return _0x4903f3[_0x13c2('0x1c')](0x1f4)['json']({'errors':[{'message':_0x13c2('0x20'),'type':'api.jira'}]});}});_0x382b57['write'](_0x647b7c);_0x382b57[_0x13c2('0x1b')]();}exports[_0x13c2('0x21')]=openIssue;exports[_0x13c2('0x22')]=function(_0xa32e17,_0x393c74){_0xa32e17[_0x13c2('0x23')]['ip']=_0xa32e17[_0x13c2('0x24')][_0x13c2('0x25')]||_0xa32e17[_0x13c2('0x26')]['remoteAddress']||_0xa32e17['socket'][_0x13c2('0x27')]||_0xa32e17[_0x13c2('0x26')][_0x13c2('0x28')]['remoteAddress'];return openIssue(_0xa32e17[_0x13c2('0x23')],_0x393c74);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index c58daca..29f3e4f 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 _0xb58b=['get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./jscriptyAnswerReport.controller'];(function(_0xa46e8c,_0xe8d449){var _0x1b854b=function(_0x401cbd){while(--_0x401cbd){_0xa46e8c['push'](_0xa46e8c['shift']());}};_0x1b854b(++_0xe8d449);}(_0xb58b,0x1f1));var _0xbb58=function(_0x4ca536,_0x57c8de){_0x4ca536=_0x4ca536-0x0;var _0x3bd35f=_0xb58b[_0x4ca536];return _0x3bd35f;};'use strict';var multer=require('multer');var util=require(_0xbb58('0x0'));var path=require(_0xbb58('0x1'));var timeout=require(_0xbb58('0x2'));var express=require('express');var router=express[_0xbb58('0x3')]();var fs_extra=require(_0xbb58('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbb58('0x5'));var config=require('../../config/environment');var controller=require(_0xbb58('0x6'));router[_0xbb58('0x7')]('/',auth[_0xbb58('0x8')](),controller['index']);router[_0xbb58('0x7')](_0xbb58('0x9'),auth[_0xbb58('0x8')](),controller[_0xbb58('0xa')]);router[_0xbb58('0x7')](_0xbb58('0xb'),auth[_0xbb58('0x8')](),controller[_0xbb58('0xc')]);router[_0xbb58('0xd')]('/',auth[_0xbb58('0x8')](),controller[_0xbb58('0xe')]);router['put'](_0xbb58('0xb'),auth['isAuthenticated'](),controller[_0xbb58('0xf')]);router[_0xbb58('0x10')](_0xbb58('0xb'),auth[_0xbb58('0x8')](),controller['destroy']);module[_0xbb58('0x11')]=router; \ No newline at end of file +var _0xb821=['../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','create','put','update','delete','destroy','exports','util','path','Router','../../components/interaction/service'];(function(_0x26a43d,_0x5311d4){var _0xccbea9=function(_0x170195){while(--_0x170195){_0x26a43d['push'](_0x26a43d['shift']());}};_0xccbea9(++_0x5311d4);}(_0xb821,0xa7));var _0x1b82=function(_0x3e8a42,_0x571c1c){_0x3e8a42=_0x3e8a42-0x0;var _0x2e30f6=_0xb821[_0x3e8a42];return _0x2e30f6;};'use strict';var multer=require('multer');var util=require(_0x1b82('0x0'));var path=require(_0x1b82('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1b82('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1b82('0x3'));var config=require(_0x1b82('0x4'));var controller=require(_0x1b82('0x5'));router[_0x1b82('0x6')]('/',auth['isAuthenticated'](),controller[_0x1b82('0x7')]);router[_0x1b82('0x6')](_0x1b82('0x8'),auth[_0x1b82('0x9')](),controller[_0x1b82('0xa')]);router[_0x1b82('0x6')](_0x1b82('0xb'),auth[_0x1b82('0x9')](),controller[_0x1b82('0xc')]);router['post']('/',auth[_0x1b82('0x9')](),controller[_0x1b82('0xd')]);router[_0x1b82('0xe')](_0x1b82('0xb'),auth[_0x1b82('0x9')](),controller[_0x1b82('0xf')]);router[_0x1b82('0x10')](_0x1b82('0xb'),auth['isAuthenticated'](),controller[_0x1b82('0x11')]);module[_0x1b82('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index bcbeb54..5cc14e3 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(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x7a54,0x106));var _0x47a5=function(_0x25390b,_0x293c86){_0x25390b=_0x25390b-0x0;var _0x13f7c2=_0x7a54[_0x25390b];return _0x13f7c2;};'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(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x7a54,0x106));var _0x47a5=function(_0x5ac84a,_0x44f6d3){_0x5ac84a=_0x5ac84a-0x0;var _0x55e1fa=_0x7a54[_0x5ac84a];return _0x55e1fa;};'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 42ba1bf..9a34dba 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 _0x3eea=['length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','keys','intersection','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields'];(function(_0xdd2bfa,_0x5bd304){var _0x55397e=function(_0x196f7d){while(--_0x196f7d){_0xdd2bfa['push'](_0xdd2bfa['shift']());}};_0x55397e(++_0x5bd304);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x53e3ea,_0x231ab1){_0x53e3ea=_0x53e3ea-0x0;var _0xfd0bd3=_0x3eea[_0x53e3ea];return _0xfd0bd3;};'use strict';var emlformat=require(_0xa3ee('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa3ee('0x1'));var jsonpatch=require(_0xa3ee('0x2'));var rp=require(_0xa3ee('0x3'));var moment=require(_0xa3ee('0x4'));var BPromise=require(_0xa3ee('0x5'));var Mustache=require(_0xa3ee('0x6'));var util=require(_0xa3ee('0x7'));var path=require(_0xa3ee('0x8'));var sox=require(_0xa3ee('0x9'));var csv=require(_0xa3ee('0xa'));var ejs=require(_0xa3ee('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa3ee('0xc'));var crypto=require('crypto');var jsforce=require(_0xa3ee('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa3ee('0xa'));var querystring=require('querystring');var Papa=require(_0xa3ee('0xe'));var Redis=require('ioredis');var authService=require(_0xa3ee('0xf'));var qs=require(_0xa3ee('0x10'));var as=require(_0xa3ee('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa3ee('0x12'))(_0xa3ee('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa3ee('0x14'));var db=require(_0xa3ee('0x15'))['db'];function respondWithStatusCode(_0x403518,_0x4363d1){_0x4363d1=_0x4363d1||0xcc;return function(_0x594c88){if(_0x594c88){return _0x403518[_0xa3ee('0x16')](_0x4363d1);}return _0x403518['status'](_0x4363d1)[_0xa3ee('0x17')]();};}function respondWithResult(_0x20535f,_0x2c34cf){_0x2c34cf=_0x2c34cf||0xc8;return function(_0x150e20){if(_0x150e20){return _0x20535f['status'](_0x2c34cf)[_0xa3ee('0x18')](_0x150e20);}};}function respondWithFilteredResult(_0x23df7d,_0x5da681){return function(_0x5358aa){if(_0x5358aa){var _0x4b2c66=typeof _0x5da681[_0xa3ee('0x19')]===_0xa3ee('0x1a')&&typeof _0x5da681[_0xa3ee('0x1b')]===_0xa3ee('0x1a');var _0x4cc8bb=_0x5358aa[_0xa3ee('0x1c')];var _0x40ffdb=_0x4b2c66?0x0:_0x5da681[_0xa3ee('0x19')];var _0x299b1e=_0x4b2c66?_0x5358aa[_0xa3ee('0x1c')]:_0x5da681['offset']+_0x5da681[_0xa3ee('0x1b')];var _0x18b738;if(_0x299b1e>=_0x4cc8bb){_0x299b1e=_0x4cc8bb;_0x18b738=0xc8;}else{_0x18b738=0xce;}_0x23df7d[_0xa3ee('0x1d')](_0x18b738);return _0x23df7d[_0xa3ee('0x1e')](_0xa3ee('0x1f'),_0x40ffdb+'-'+_0x299b1e+'/'+_0x4cc8bb)[_0xa3ee('0x18')](_0x5358aa);}return null;};}function patchUpdates(_0x4f8c56){return function(_0x3f5d70){try{jsonpatch[_0xa3ee('0x20')](_0x3f5d70,_0x4f8c56,!![]);}catch(_0x4b8445){return BPromise[_0xa3ee('0x21')](_0x4b8445);}return _0x3f5d70['save']();};}function saveUpdates(_0x2fab5,_0x29df43){return function(_0x1d3022){if(_0x1d3022){return _0x1d3022[_0xa3ee('0x22')](_0x2fab5)[_0xa3ee('0x23')](function(_0x47108f){return _0x47108f;});}return null;};}function removeEntity(_0x3ce61b,_0x12108e){return function(_0x5ae0a1){if(_0x5ae0a1){return _0x5ae0a1[_0xa3ee('0x24')]()['then'](function(){_0x3ce61b[_0xa3ee('0x1d')](0xcc)[_0xa3ee('0x17')]();});}};}function handleEntityNotFound(_0x157071,_0x1fe4b4){return function(_0x2c48db){if(!_0x2c48db){_0x157071['sendStatus'](0x194);}return _0x2c48db;};}function handleError(_0x3c68f9,_0x1b766e){_0x1b766e=_0x1b766e||0x1f4;return function(_0x146493){logger[_0xa3ee('0x25')](_0x146493[_0xa3ee('0x26')]);if(_0x146493[_0xa3ee('0x27')]){delete _0x146493[_0xa3ee('0x27')];}_0x3c68f9[_0xa3ee('0x1d')](_0x1b766e)[_0xa3ee('0x28')](_0x146493);};}exports[_0xa3ee('0x29')]=function(_0x59c6f9,_0x5ba571){var _0x4abf49={},_0x78e581={},_0x481358={'count':0x0,'rows':[]};var _0x3fa094=_[_0xa3ee('0x2a')](db[_0xa3ee('0x2b')][_0xa3ee('0x2c')],function(_0x26b222){return{'name':_0x26b222[_0xa3ee('0x2d')],'type':_0x26b222[_0xa3ee('0x2e')][_0xa3ee('0x2f')]};});_0x78e581[_0xa3ee('0x30')]=_[_0xa3ee('0x2a')](_0x3fa094,'name');_0x78e581[_0xa3ee('0x31')]=_['keys'](_0x59c6f9[_0xa3ee('0x31')]);_0x78e581[_0xa3ee('0x32')]=_['intersection'](_0x78e581[_0xa3ee('0x30')],_0x78e581['query']);_0x4abf49[_0xa3ee('0x33')]=_['intersection'](_0x78e581[_0xa3ee('0x30')],qs[_0xa3ee('0x34')](_0x59c6f9[_0xa3ee('0x31')][_0xa3ee('0x34')]));_0x4abf49[_0xa3ee('0x33')]=_0x4abf49['attributes'][_0xa3ee('0x35')]?_0x4abf49[_0xa3ee('0x33')]:_0x78e581[_0xa3ee('0x30')];if(!_0x59c6f9['query'][_0xa3ee('0x36')]('nolimit')){_0x4abf49[_0xa3ee('0x1b')]=qs['limit'](_0x59c6f9[_0xa3ee('0x31')]['limit']);_0x4abf49[_0xa3ee('0x19')]=qs[_0xa3ee('0x19')](_0x59c6f9[_0xa3ee('0x31')][_0xa3ee('0x19')]);}_0x4abf49[_0xa3ee('0x37')]=qs[_0xa3ee('0x38')](_0x59c6f9[_0xa3ee('0x31')][_0xa3ee('0x38')]);_0x4abf49[_0xa3ee('0x39')]=qs[_0xa3ee('0x32')](_[_0xa3ee('0x3a')](_0x59c6f9[_0xa3ee('0x31')],_0x78e581[_0xa3ee('0x32')]),_0x3fa094);if(_0x59c6f9['query'][_0xa3ee('0x3b')]){_0x4abf49[_0xa3ee('0x39')]=_[_0xa3ee('0x3c')](_0x4abf49[_0xa3ee('0x39')],{'$or':_['map'](_0x3fa094,function(_0x257627){if(_0x257627[_0xa3ee('0x2e')]!==_0xa3ee('0x3d')){var _0x5b95e3={};_0x5b95e3[_0x257627[_0xa3ee('0x27')]]={'$like':'%'+_0x59c6f9[_0xa3ee('0x31')]['filter']+'%'};return _0x5b95e3;}})});}_0x4abf49=_[_0xa3ee('0x3c')]({},_0x4abf49,_0x59c6f9[_0xa3ee('0x3e')]);var _0x4ef99a={'where':_0x4abf49[_0xa3ee('0x39')]};return db[_0xa3ee('0x2b')][_0xa3ee('0x1c')](_0x4ef99a)[_0xa3ee('0x23')](function(_0x1f0023){_0x481358[_0xa3ee('0x1c')]=_0x1f0023;if(_0x59c6f9[_0xa3ee('0x31')][_0xa3ee('0x3f')]){_0x4abf49[_0xa3ee('0x40')]=[{'all':!![]}];}return db[_0xa3ee('0x2b')][_0xa3ee('0x41')](_0x4abf49);})['then'](function(_0x5aa4b3){_0x481358['rows']=_0x5aa4b3;return _0x481358;})[_0xa3ee('0x23')](respondWithFilteredResult(_0x5ba571,_0x4abf49))[_0xa3ee('0x42')](handleError(_0x5ba571,null));};exports['show']=function(_0xca106f,_0x425f69){var _0x279834={'raw':!![],'where':{'id':_0xca106f[_0xa3ee('0x43')]['id']}},_0x55f47f={};_0x55f47f['model']=_[_0xa3ee('0x44')](db[_0xa3ee('0x2b')][_0xa3ee('0x2c')]);_0x55f47f[_0xa3ee('0x31')]=_[_0xa3ee('0x44')](_0xca106f[_0xa3ee('0x31')]);_0x55f47f[_0xa3ee('0x32')]=_[_0xa3ee('0x45')](_0x55f47f[_0xa3ee('0x30')],_0x55f47f[_0xa3ee('0x31')]);_0x279834[_0xa3ee('0x33')]=_[_0xa3ee('0x45')](_0x55f47f[_0xa3ee('0x30')],qs[_0xa3ee('0x34')](_0xca106f[_0xa3ee('0x31')][_0xa3ee('0x34')]));_0x279834[_0xa3ee('0x33')]=_0x279834[_0xa3ee('0x33')]['length']?_0x279834[_0xa3ee('0x33')]:_0x55f47f[_0xa3ee('0x30')];if(_0xca106f[_0xa3ee('0x31')][_0xa3ee('0x3f')]){_0x279834['include']=[{'all':!![]}];}_0x279834=_[_0xa3ee('0x3c')]({},_0x279834,_0xca106f['options']);return db[_0xa3ee('0x2b')][_0xa3ee('0x46')](_0x279834)[_0xa3ee('0x23')](handleEntityNotFound(_0x425f69,null))[_0xa3ee('0x23')](respondWithResult(_0x425f69,null))[_0xa3ee('0x42')](handleError(_0x425f69,null));};exports[_0xa3ee('0x47')]=function(_0xd723ad,_0xbb0148){return db[_0xa3ee('0x2b')][_0xa3ee('0x47')](_0xd723ad['body'],{})[_0xa3ee('0x23')](respondWithResult(_0xbb0148,0xc9))['catch'](handleError(_0xbb0148,null));};exports['update']=function(_0xaad29c,_0x2f7171){if(_0xaad29c[_0xa3ee('0x48')]['id']){delete _0xaad29c[_0xa3ee('0x48')]['id'];}return db[_0xa3ee('0x2b')][_0xa3ee('0x46')]({'where':{'id':_0xaad29c[_0xa3ee('0x43')]['id']}})['then'](handleEntityNotFound(_0x2f7171,null))[_0xa3ee('0x23')](saveUpdates(_0xaad29c[_0xa3ee('0x48')],null))['then'](respondWithResult(_0x2f7171,null))[_0xa3ee('0x42')](handleError(_0x2f7171,null));};exports[_0xa3ee('0x24')]=function(_0x2f1db4,_0x5ec981){return db['JscriptyAnswerReport'][_0xa3ee('0x46')]({'where':{'id':_0x2f1db4[_0xa3ee('0x43')]['id']}})[_0xa3ee('0x23')](handleEntityNotFound(_0x5ec981,null))[_0xa3ee('0x23')](removeEntity(_0x5ec981,null))[_0xa3ee('0x42')](handleError(_0x5ec981,null));};exports['describe']=function(_0x55678e,_0x15b55e){return db[_0xa3ee('0x2b')]['describe']()[_0xa3ee('0x23')](respondWithResult(_0x15b55e,null))[_0xa3ee('0x42')](handleError(_0x15b55e,null));}; \ No newline at end of file +var _0x6bac=['destroy','end','error','name','send','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filters','filter','merge','JscriptyAnswerReport','count','includeAll','include','findAll','catch','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','limit','set','apply','reject','save','update','then'];(function(_0x1c22ca,_0x62e3f2){var _0x3a73e1=function(_0x1f639b){while(--_0x1f639b){_0x1c22ca['push'](_0x1c22ca['shift']());}};_0x3a73e1(++_0x62e3f2);}(_0x6bac,0xa5));var _0xc6ba=function(_0x10cd1f,_0x16f96e){_0x10cd1f=_0x10cd1f-0x0;var _0x3282fd=_0x6bac[_0x10cd1f];return _0x3282fd;};'use strict';var emlformat=require(_0xc6ba('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc6ba('0x1'));var jsonpatch=require(_0xc6ba('0x2'));var rp=require(_0xc6ba('0x3'));var moment=require(_0xc6ba('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xc6ba('0x5'));var sox=require(_0xc6ba('0x6'));var csv=require('to-csv');var ejs=require(_0xc6ba('0x7'));var fs=require('fs');var fs_extra=require(_0xc6ba('0x8'));var _=require(_0xc6ba('0x9'));var squel=require(_0xc6ba('0xa'));var crypto=require(_0xc6ba('0xb'));var jsforce=require(_0xc6ba('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc6ba('0xd'));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(_0xc6ba('0xe'));var logger=require(_0xc6ba('0xf'))(_0xc6ba('0x10'));var utils=require(_0xc6ba('0x11'));var config=require(_0xc6ba('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e7642,_0x2cfa3d){_0x2cfa3d=_0x2cfa3d||0xcc;return function(_0x31def2){if(_0x31def2){return _0x3e7642[_0xc6ba('0x13')](_0x2cfa3d);}return _0x3e7642[_0xc6ba('0x14')](_0x2cfa3d)['end']();};}function respondWithResult(_0x498aa1,_0x595561){_0x595561=_0x595561||0xc8;return function(_0x2f6e76){if(_0x2f6e76){return _0x498aa1[_0xc6ba('0x14')](_0x595561)[_0xc6ba('0x15')](_0x2f6e76);}};}function respondWithFilteredResult(_0x342007,_0x425cec){return function(_0x29f0b7){if(_0x29f0b7){var _0x1be8ef=typeof _0x425cec[_0xc6ba('0x16')]==='undefined'&&typeof _0x425cec['limit']==='undefined';var _0x488fb4=_0x29f0b7['count'];var _0x494d17=_0x1be8ef?0x0:_0x425cec[_0xc6ba('0x16')];var _0x15a135=_0x1be8ef?_0x29f0b7['count']:_0x425cec['offset']+_0x425cec[_0xc6ba('0x17')];var _0x5d1f4e;if(_0x15a135>=_0x488fb4){_0x15a135=_0x488fb4;_0x5d1f4e=0xc8;}else{_0x5d1f4e=0xce;}_0x342007[_0xc6ba('0x14')](_0x5d1f4e);return _0x342007[_0xc6ba('0x18')]('Content-Range',_0x494d17+'-'+_0x15a135+'/'+_0x488fb4)[_0xc6ba('0x15')](_0x29f0b7);}return null;};}function patchUpdates(_0x362f68){return function(_0x4a463e){try{jsonpatch[_0xc6ba('0x19')](_0x4a463e,_0x362f68,!![]);}catch(_0x459dfa){return BPromise[_0xc6ba('0x1a')](_0x459dfa);}return _0x4a463e[_0xc6ba('0x1b')]();};}function saveUpdates(_0x28f8ba,_0x3f7082){return function(_0xc2de63){if(_0xc2de63){return _0xc2de63[_0xc6ba('0x1c')](_0x28f8ba)[_0xc6ba('0x1d')](function(_0x3c7edd){return _0x3c7edd;});}return null;};}function removeEntity(_0x280ab0,_0xf326f9){return function(_0x4a2082){if(_0x4a2082){return _0x4a2082[_0xc6ba('0x1e')]()[_0xc6ba('0x1d')](function(){_0x280ab0['status'](0xcc)[_0xc6ba('0x1f')]();});}};}function handleEntityNotFound(_0x29a175,_0x2946f0){return function(_0xcfb503){if(!_0xcfb503){_0x29a175[_0xc6ba('0x13')](0x194);}return _0xcfb503;};}function handleError(_0x3b5ed7,_0x47998c){_0x47998c=_0x47998c||0x1f4;return function(_0x447407){logger[_0xc6ba('0x20')](_0x447407['stack']);if(_0x447407[_0xc6ba('0x21')]){delete _0x447407[_0xc6ba('0x21')];}_0x3b5ed7['status'](_0x47998c)[_0xc6ba('0x22')](_0x447407);};}exports['index']=function(_0x3fea76,_0x2dd085){var _0x111ce4={},_0x393d4d={},_0x5ac5dd={'count':0x0,'rows':[]};var _0x4fe380=_[_0xc6ba('0x23')](db['JscriptyAnswerReport'][_0xc6ba('0x24')],function(_0x5d5ebe){return{'name':_0x5d5ebe[_0xc6ba('0x25')],'type':_0x5d5ebe[_0xc6ba('0x26')]['key']};});_0x393d4d[_0xc6ba('0x27')]=_[_0xc6ba('0x23')](_0x4fe380,_0xc6ba('0x21'));_0x393d4d[_0xc6ba('0x28')]=_[_0xc6ba('0x29')](_0x3fea76[_0xc6ba('0x28')]);_0x393d4d['filters']=_[_0xc6ba('0x2a')](_0x393d4d[_0xc6ba('0x27')],_0x393d4d['query']);_0x111ce4[_0xc6ba('0x2b')]=_[_0xc6ba('0x2a')](_0x393d4d['model'],qs[_0xc6ba('0x2c')](_0x3fea76[_0xc6ba('0x28')]['fields']));_0x111ce4[_0xc6ba('0x2b')]=_0x111ce4[_0xc6ba('0x2b')][_0xc6ba('0x2d')]?_0x111ce4[_0xc6ba('0x2b')]:_0x393d4d[_0xc6ba('0x27')];if(!_0x3fea76[_0xc6ba('0x28')]['hasOwnProperty'](_0xc6ba('0x2e'))){_0x111ce4[_0xc6ba('0x17')]=qs[_0xc6ba('0x17')](_0x3fea76[_0xc6ba('0x28')][_0xc6ba('0x17')]);_0x111ce4[_0xc6ba('0x16')]=qs[_0xc6ba('0x16')](_0x3fea76[_0xc6ba('0x28')][_0xc6ba('0x16')]);}_0x111ce4[_0xc6ba('0x2f')]=qs[_0xc6ba('0x30')](_0x3fea76[_0xc6ba('0x28')][_0xc6ba('0x30')]);_0x111ce4[_0xc6ba('0x31')]=qs['filters'](_[_0xc6ba('0x32')](_0x3fea76[_0xc6ba('0x28')],_0x393d4d[_0xc6ba('0x33')]),_0x4fe380);if(_0x3fea76['query'][_0xc6ba('0x34')]){_0x111ce4['where']=_[_0xc6ba('0x35')](_0x111ce4['where'],{'$or':_[_0xc6ba('0x23')](_0x4fe380,function(_0x57d2fb){if(_0x57d2fb[_0xc6ba('0x26')]!=='VIRTUAL'){var _0x4d92cf={};_0x4d92cf[_0x57d2fb[_0xc6ba('0x21')]]={'$like':'%'+_0x3fea76[_0xc6ba('0x28')][_0xc6ba('0x34')]+'%'};return _0x4d92cf;}})});}_0x111ce4=_[_0xc6ba('0x35')]({},_0x111ce4,_0x3fea76['options']);var _0x2f8c39={'where':_0x111ce4[_0xc6ba('0x31')]};return db[_0xc6ba('0x36')][_0xc6ba('0x37')](_0x2f8c39)[_0xc6ba('0x1d')](function(_0x3273f4){_0x5ac5dd[_0xc6ba('0x37')]=_0x3273f4;if(_0x3fea76['query'][_0xc6ba('0x38')]){_0x111ce4[_0xc6ba('0x39')]=[{'all':!![]}];}return db[_0xc6ba('0x36')][_0xc6ba('0x3a')](_0x111ce4);})[_0xc6ba('0x1d')](function(_0x4985f8){_0x5ac5dd['rows']=_0x4985f8;return _0x5ac5dd;})[_0xc6ba('0x1d')](respondWithFilteredResult(_0x2dd085,_0x111ce4))[_0xc6ba('0x3b')](handleError(_0x2dd085,null));};exports['show']=function(_0x2d3d5a,_0x23e2d1){var _0x35f1fc={'raw':!![],'where':{'id':_0x2d3d5a[_0xc6ba('0x3c')]['id']}},_0x279d89={};_0x279d89[_0xc6ba('0x27')]=_['keys'](db['JscriptyAnswerReport'][_0xc6ba('0x24')]);_0x279d89[_0xc6ba('0x28')]=_[_0xc6ba('0x29')](_0x2d3d5a['query']);_0x279d89['filters']=_[_0xc6ba('0x2a')](_0x279d89[_0xc6ba('0x27')],_0x279d89[_0xc6ba('0x28')]);_0x35f1fc[_0xc6ba('0x2b')]=_[_0xc6ba('0x2a')](_0x279d89['model'],qs[_0xc6ba('0x2c')](_0x2d3d5a[_0xc6ba('0x28')][_0xc6ba('0x2c')]));_0x35f1fc[_0xc6ba('0x2b')]=_0x35f1fc[_0xc6ba('0x2b')][_0xc6ba('0x2d')]?_0x35f1fc[_0xc6ba('0x2b')]:_0x279d89[_0xc6ba('0x27')];if(_0x2d3d5a['query'][_0xc6ba('0x38')]){_0x35f1fc[_0xc6ba('0x39')]=[{'all':!![]}];}_0x35f1fc=_[_0xc6ba('0x35')]({},_0x35f1fc,_0x2d3d5a['options']);return db[_0xc6ba('0x36')][_0xc6ba('0x3d')](_0x35f1fc)[_0xc6ba('0x1d')](handleEntityNotFound(_0x23e2d1,null))['then'](respondWithResult(_0x23e2d1,null))['catch'](handleError(_0x23e2d1,null));};exports[_0xc6ba('0x3e')]=function(_0xe4747e,_0x56add1){return db[_0xc6ba('0x36')][_0xc6ba('0x3e')](_0xe4747e[_0xc6ba('0x3f')],{})[_0xc6ba('0x1d')](respondWithResult(_0x56add1,0xc9))[_0xc6ba('0x3b')](handleError(_0x56add1,null));};exports[_0xc6ba('0x1c')]=function(_0x36e159,_0x283dac){if(_0x36e159['body']['id']){delete _0x36e159[_0xc6ba('0x3f')]['id'];}return db['JscriptyAnswerReport'][_0xc6ba('0x3d')]({'where':{'id':_0x36e159[_0xc6ba('0x3c')]['id']}})[_0xc6ba('0x1d')](handleEntityNotFound(_0x283dac,null))[_0xc6ba('0x1d')](saveUpdates(_0x36e159[_0xc6ba('0x3f')],null))['then'](respondWithResult(_0x283dac,null))['catch'](handleError(_0x283dac,null));};exports['destroy']=function(_0x47a4ee,_0x2c71f7){return db['JscriptyAnswerReport'][_0xc6ba('0x3d')]({'where':{'id':_0x47a4ee[_0xc6ba('0x3c')]['id']}})[_0xc6ba('0x1d')](handleEntityNotFound(_0x2c71f7,null))[_0xc6ba('0x1d')](removeEntity(_0x2c71f7,null))['catch'](handleError(_0x2c71f7,null));};exports['describe']=function(_0x121fa6,_0x2ab774){return db['JscriptyAnswerReport'][_0xc6ba('0x40')]()[_0xc6ba('0x1d')](respondWithResult(_0x2ab774,null))[_0xc6ba('0x3b')](handleError(_0x2ab774,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 58e8518..91d4032 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 _0x3ee6=['define','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports'];(function(_0x5ab92d,_0x470d2f){var _0x225c20=function(_0x47ddee){while(--_0x47ddee){_0x5ab92d['push'](_0x5ab92d['shift']());}};_0x225c20(++_0x470d2f);}(_0x3ee6,0x11f));var _0x63ee=function(_0xc6683d,_0x3c8804){_0xc6683d=_0xc6683d-0x0;var _0x2e397c=_0x3ee6[_0xc6683d];return _0x2e397c;};'use strict';var _=require(_0x63ee('0x0'));var util=require('util');var logger=require(_0x63ee('0x1'))(_0x63ee('0x2'));var moment=require(_0x63ee('0x3'));var BPromise=require('bluebird');var rp=require(_0x63ee('0x4'));var fs=require('fs');var path=require(_0x63ee('0x5'));var rimraf=require(_0x63ee('0x6'));var config=require(_0x63ee('0x7'));var attributes=require(_0x63ee('0x8'));module[_0x63ee('0x9')]=function(_0x1b5a9b,_0x3741a0){return _0x1b5a9b[_0x63ee('0xa')]('JscriptyAnswerReport',attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x533e=['rimraf','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x124eb9,_0x1fb931){var _0x5c10b8=function(_0x36e6b2){while(--_0x36e6b2){_0x124eb9['push'](_0x124eb9['shift']());}};_0x5c10b8(++_0x1fb931);}(_0x533e,0x19d));var _0xe533=function(_0x3d021c,_0x1d5398){_0x3d021c=_0x3d021c-0x0;var _0xf527c9=_0x533e[_0x3d021c];return _0xf527c9;};'use strict';var _=require(_0xe533('0x0'));var util=require('util');var logger=require(_0xe533('0x1'))(_0xe533('0x2'));var moment=require('moment');var BPromise=require(_0xe533('0x3'));var rp=require(_0xe533('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe533('0x5'));var config=require('../../config/environment');var attributes=require(_0xe533('0x6'));module[_0xe533('0x7')]=function(_0x4619bf,_0x5d1311){return _0x4619bf[_0xe533('0x8')](_0xe533('0x9'),attributes,{'tableName':_0xe533('0xa'),'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 4430e7f..c8bdc93 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 _0x4d69=['catch','util','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x2287c3,_0x2b34e2){var _0x448916=function(_0x25b23a){while(--_0x25b23a){_0x2287c3['push'](_0x2287c3['shift']());}};_0x448916(++_0x2b34e2);}(_0x4d69,0x99));var _0x94d6=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0x4d69[_0x62c958];return _0x57ec61;};'use strict';var _=require('lodash');var util=require(_0x94d6('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x94d6('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x94d6('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x94d6('0x3'))(_0x94d6('0x4'));var config=require(_0x94d6('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x94d6('0x6')][_0x94d6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x7b6cc5,_0x1f7839,_0x2564f1){return new BPromise(function(_0x4ba25f,_0x1faa1b){return client[_0x94d6('0x8')](_0x7b6cc5,_0x2564f1)[_0x94d6('0x9')](function(_0x56b103){logger[_0x94d6('0xa')](_0x94d6('0xb'),_0x1f7839,'request\x20sent');logger[_0x94d6('0xc')](_0x94d6('0xd'),_0x1f7839,'request\x20sent',JSON['stringify'](_0x56b103));if(_0x56b103['error']){if(_0x56b103[_0x94d6('0xe')][_0x94d6('0xf')]===0x1f4){logger['error'](_0x94d6('0xb'),_0x1f7839,_0x56b103[_0x94d6('0xe')][_0x94d6('0x10')]);return _0x1faa1b(_0x56b103[_0x94d6('0xe')][_0x94d6('0x10')]);}logger[_0x94d6('0xe')](_0x94d6('0xb'),_0x1f7839,_0x56b103[_0x94d6('0xe')][_0x94d6('0x10')]);return _0x4ba25f(_0x56b103[_0x94d6('0xe')]['message']);}else{logger[_0x94d6('0xa')](_0x94d6('0xb'),_0x1f7839,'request\x20sent');_0x4ba25f(_0x56b103[_0x94d6('0x11')][_0x94d6('0x10')]);}})[_0x94d6('0x12')](function(_0x154d43){logger[_0x94d6('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x1f7839,_0x154d43);_0x1faa1b(_0x154d43);});});} \ No newline at end of file +var _0x5ae9=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','stringify','error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x47bd3e,_0x2a54d9){var _0x22b740=function(_0x2f7353){while(--_0x2f7353){_0x47bd3e['push'](_0x47bd3e['shift']());}};_0x22b740(++_0x2a54d9);}(_0x5ae9,0x1de));var _0x95ae=function(_0x42676f,_0x4c3299){_0x42676f=_0x42676f-0x0;var _0x2b884e=_0x5ae9[_0x42676f];return _0x2b884e;};'use strict';var _=require(_0x95ae('0x0'));var util=require(_0x95ae('0x1'));var moment=require(_0x95ae('0x2'));var BPromise=require(_0x95ae('0x3'));var rs=require(_0x95ae('0x4'));var fs=require('fs');var Redis=require(_0x95ae('0x5'));var db=require(_0x95ae('0x6'))['db'];var utils=require(_0x95ae('0x7'));var logger=require('../../config/logger')(_0x95ae('0x8'));var config=require(_0x95ae('0x9'));var jayson=require(_0x95ae('0xa'));var client=jayson[_0x95ae('0xb')][_0x95ae('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xa2f1a5,_0x2094ba,_0x4ed097){return new BPromise(function(_0x10c50b,_0x522181){return client['request'](_0xa2f1a5,_0x4ed097)[_0x95ae('0xd')](function(_0x442a9a){logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x2094ba,_0x95ae('0xe'));logger['debug']('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x2094ba,_0x95ae('0xe'),JSON[_0x95ae('0xf')](_0x442a9a));if(_0x442a9a[_0x95ae('0x10')]){if(_0x442a9a[_0x95ae('0x10')][_0x95ae('0x11')]===0x1f4){logger[_0x95ae('0x10')](_0x95ae('0x12'),_0x2094ba,_0x442a9a[_0x95ae('0x10')][_0x95ae('0x13')]);return _0x522181(_0x442a9a['error'][_0x95ae('0x13')]);}logger[_0x95ae('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x2094ba,_0x442a9a[_0x95ae('0x10')]['message']);return _0x10c50b(_0x442a9a['error'][_0x95ae('0x13')]);}else{logger['info'](_0x95ae('0x12'),_0x2094ba,_0x95ae('0xe'));_0x10c50b(_0x442a9a[_0x95ae('0x14')][_0x95ae('0x13')]);}})[_0x95ae('0x15')](function(_0x72584b){logger['error'](_0x95ae('0x12'),_0x2094ba,_0x72584b);_0x522181(_0x72584b);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 990484a..5aa6d56 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 _0x147b=['delete','destroy','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','isAuthenticated','index','/:id','show','get','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','post','create','/:id/clone','clone','put','update'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x147b,0x1bc));var _0xb147=function(_0x54bd6b,_0x4cc82e){_0x54bd6b=_0x54bd6b-0x0;var _0x25f308=_0x147b[_0x54bd6b];return _0x25f308;};'use strict';var multer=require(_0xb147('0x0'));var util=require(_0xb147('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb147('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb147('0x3'));var interaction=require(_0xb147('0x4'));var config=require(_0xb147('0x5'));var controller=require(_0xb147('0x6'));router['get']('/',auth[_0xb147('0x7')](),controller[_0xb147('0x8')]);router['get'](_0xb147('0x9'),auth[_0xb147('0x7')](),controller[_0xb147('0xa')]);router[_0xb147('0xb')](_0xb147('0xc'),auth['isAuthenticated'](),controller[_0xb147('0xd')]);router[_0xb147('0xb')](_0xb147('0xe'),auth['isAuthenticated'](),controller[_0xb147('0xf')]);router[_0xb147('0xb')](_0xb147('0x10'),auth[_0xb147('0x7')](),timeout(_0xb147('0x11')),controller['getSummary']);router[_0xb147('0x12')]('/',auth[_0xb147('0x7')](),controller[_0xb147('0x13')]);router[_0xb147('0x12')](_0xb147('0x14'),auth['isAuthenticated'](),controller[_0xb147('0x15')]);router[_0xb147('0x16')](_0xb147('0x9'),auth[_0xb147('0x7')](),controller[_0xb147('0x17')]);router[_0xb147('0x18')]('/:id',auth[_0xb147('0x7')](),controller[_0xb147('0x19')]);module['exports']=router; \ No newline at end of file +var _0x9038=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/sessions','getAnswers','30s','post','create','/:id/clone','clone','put','update','delete','exports','multer','util','path'];(function(_0x543b6a,_0x40f6ae){var _0x2c2372=function(_0x10f2ed){while(--_0x10f2ed){_0x543b6a['push'](_0x543b6a['shift']());}};_0x2c2372(++_0x40f6ae);}(_0x9038,0x174));var _0x8903=function(_0x3a6e53,_0x184193){_0x3a6e53=_0x3a6e53-0x0;var _0x5c2354=_0x9038[_0x3a6e53];return _0x5c2354;};'use strict';var multer=require(_0x8903('0x0'));var util=require(_0x8903('0x1'));var path=require(_0x8903('0x2'));var timeout=require(_0x8903('0x3'));var express=require(_0x8903('0x4'));var router=express['Router']();var fs_extra=require(_0x8903('0x5'));var auth=require(_0x8903('0x6'));var interaction=require(_0x8903('0x7'));var config=require(_0x8903('0x8'));var controller=require('./jscriptyProject.controller');router['get']('/',auth[_0x8903('0x9')](),controller[_0x8903('0xa')]);router[_0x8903('0xb')](_0x8903('0xc'),auth[_0x8903('0x9')](),controller[_0x8903('0xd')]);router[_0x8903('0xb')](_0x8903('0xe'),auth[_0x8903('0x9')](),controller['getSessions']);router['get']('/:id/answers',auth['isAuthenticated'](),controller[_0x8903('0xf')]);router['get']('/:id/summary',auth[_0x8903('0x9')](),timeout(_0x8903('0x10')),controller['getSummary']);router[_0x8903('0x11')]('/',auth[_0x8903('0x9')](),controller[_0x8903('0x12')]);router[_0x8903('0x11')](_0x8903('0x13'),auth['isAuthenticated'](),controller[_0x8903('0x14')]);router[_0x8903('0x15')]('/:id',auth[_0x8903('0x9')](),controller[_0x8903('0x16')]);router[_0x8903('0x17')]('/:id',auth[_0x8903('0x9')](),controller['destroy']);module[_0x8903('0x18')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 6cf61df..cbb71fc 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 _0xfa32=['formData','stringify','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','util','exports','STRING','name','long','isObjectLike','setDataValue'];(function(_0x18e52b,_0x1fae35){var _0x3d3062=function(_0x133b14){while(--_0x133b14){_0x18e52b['push'](_0x18e52b['shift']());}};_0x3d3062(++_0x1fae35);}(_0xfa32,0xf7));var _0x2fa3=function(_0x246741,_0x24bd43){_0x246741=_0x246741-0x0;var _0x1a9b3a=_0xfa32[_0x246741];return _0x1a9b3a;};'use strict';var Sequelize=require(_0x2fa3('0x0'));var _=require('lodash');var util=require(_0x2fa3('0x1'));module[_0x2fa3('0x2')]={'name':{'type':Sequelize[_0x2fa3('0x3')],'unique':_0x2fa3('0x4')},'description':{'type':Sequelize[_0x2fa3('0x3')]},'formData':{'type':Sequelize['TEXT'](_0x2fa3('0x5')),'set':function(_0x253730){if(_[_0x2fa3('0x6')](_0x253730)){this[_0x2fa3('0x7')](_0x2fa3('0x8'),JSON[_0x2fa3('0x9')](_0x253730));}else if(_['isString'](_0x253730)){this[_0x2fa3('0x7')](_0x2fa3('0x8'),_0x253730);}else{this[_0x2fa3('0x7')](_0x2fa3('0x8'),util[_0x2fa3('0xa')](_0x2fa3('0xb'),this[_0x2fa3('0xc')]('name')||'',this[_0x2fa3('0xc')](_0x2fa3('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x2fa3('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x2fa3('0xe')],'defaultValue':![]}}; \ No newline at end of file +var _0x5dff=['isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','sequelize','lodash','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','formData'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x5dff,0x138));var _0xf5df=function(_0xa7fb1f,_0x1c49bc){_0xa7fb1f=_0xa7fb1f-0x0;var _0x32e057=_0x5dff[_0xa7fb1f];return _0x32e057;};'use strict';var Sequelize=require(_0xf5df('0x0'));var _=require(_0xf5df('0x1'));var util=require('util');module[_0xf5df('0x2')]={'name':{'type':Sequelize[_0xf5df('0x3')],'unique':_0xf5df('0x4')},'description':{'type':Sequelize[_0xf5df('0x3')]},'formData':{'type':Sequelize[_0xf5df('0x5')](_0xf5df('0x6')),'set':function(_0x1e37ee){if(_[_0xf5df('0x7')](_0x1e37ee)){this[_0xf5df('0x8')](_0xf5df('0x9'),JSON['stringify'](_0x1e37ee));}else if(_[_0xf5df('0xa')](_0x1e37ee)){this[_0xf5df('0x8')](_0xf5df('0x9'),_0x1e37ee);}else{this['setDataValue'](_0xf5df('0x9'),util[_0xf5df('0xb')](_0xf5df('0xc'),this[_0xf5df('0xd')](_0xf5df('0x4'))||'',this['getDataValue']('description')||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 6b0b080..ed5aef9 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 _0x707d=['catch','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','omit','updatedAt','getSessions','findOne','sort','ProjectId','filter','JscriptySessionReport','rows','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','-createdAt','question','format','questionId','answer','push','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','attachment;\x20filename=','setHeader','Content-type','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','get','Projects','UserProfileResource','then','end','error','stack','name','send','index','map','fieldName','key','model','query','filters','attributes','hasOwnProperty','nolimit','order','pick','merge','where','type','VIRTUAL','options','includeAll','include','JscriptyProject','findAll','show','params','keys','rawAttributes','intersection','fields','length','find'];(function(_0x3725e9,_0x815cdf){var _0x1631e6=function(_0x44331b){while(--_0x44331b){_0x3725e9['push'](_0x3725e9['shift']());}};_0x1631e6(++_0x815cdf);}(_0x707d,0x18b));var _0xd707=function(_0xcad8d5,_0x2a227e){_0xcad8d5=_0xcad8d5-0x0;var _0x145e3e=_0x707d[_0xcad8d5];return _0x145e3e;};'use strict';var emlformat=require(_0xd707('0x0'));var rimraf=require(_0xd707('0x1'));var zipdir=require(_0xd707('0x2'));var jsonpatch=require(_0xd707('0x3'));var rp=require(_0xd707('0x4'));var moment=require(_0xd707('0x5'));var BPromise=require(_0xd707('0x6'));var Mustache=require('mustache');var util=require(_0xd707('0x7'));var path=require(_0xd707('0x8'));var sox=require(_0xd707('0x9'));var csv=require(_0xd707('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd707('0xb'));var _=require(_0xd707('0xc'));var squel=require('squel');var crypto=require(_0xd707('0xd'));var jsforce=require(_0xd707('0xe'));var deskjs=require(_0xd707('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd707('0x10'));var Papa=require(_0xd707('0x11'));var Redis=require('ioredis');var authService=require(_0xd707('0x12'));var qs=require(_0xd707('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd707('0x14'))(_0xd707('0x15'));var utils=require(_0xd707('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd707('0x17'));var db=require(_0xd707('0x18'))['db'];function respondWithStatusCode(_0x2acd1d,_0x5c8366){_0x5c8366=_0x5c8366||0xcc;return function(_0x552d8b){if(_0x552d8b){return _0x2acd1d[_0xd707('0x19')](_0x5c8366);}return _0x2acd1d[_0xd707('0x1a')](_0x5c8366)['end']();};}function respondWithResult(_0x1717a3,_0x1efc13){_0x1efc13=_0x1efc13||0xc8;return function(_0x55207e){if(_0x55207e){return _0x1717a3[_0xd707('0x1a')](_0x1efc13)[_0xd707('0x1b')](_0x55207e);}};}function respondWithFilteredResult(_0x4ef57a,_0x4f5e4e){return function(_0x8d4e1c){if(_0x8d4e1c){var _0x49ec72=typeof _0x4f5e4e[_0xd707('0x1c')]===_0xd707('0x1d')&&typeof _0x4f5e4e['limit']===_0xd707('0x1d');var _0x172e70=_0x8d4e1c[_0xd707('0x1e')];var _0x118835=_0x49ec72?0x0:_0x4f5e4e[_0xd707('0x1c')];var _0x19f35a=_0x49ec72?_0x8d4e1c['count']:_0x4f5e4e['offset']+_0x4f5e4e[_0xd707('0x1f')];var _0x5df778;if(_0x19f35a>=_0x172e70){_0x19f35a=_0x172e70;_0x5df778=0xc8;}else{_0x5df778=0xce;}_0x4ef57a[_0xd707('0x1a')](_0x5df778);return _0x4ef57a[_0xd707('0x20')](_0xd707('0x21'),_0x118835+'-'+_0x19f35a+'/'+_0x172e70)['json'](_0x8d4e1c);}return null;};}function patchUpdates(_0x5f152e){return function(_0x101877){try{jsonpatch[_0xd707('0x22')](_0x101877,_0x5f152e,!![]);}catch(_0x1b62e2){return BPromise[_0xd707('0x23')](_0x1b62e2);}return _0x101877[_0xd707('0x24')]();};}function saveUpdates(_0x10eda7,_0x45c504){return function(_0x529583){if(_0x529583){return _0x529583[_0xd707('0x25')](_0x10eda7)['then'](function(_0x34b0ac){return _0x34b0ac;});}return null;};}function removeEntity(_0x4ec0c3,_0x3a4fa2){return function(_0x2eaade){if(_0x2eaade){return _0x2eaade[_0xd707('0x26')]()['then'](function(){var _0xef6093=_0x2eaade[_0xd707('0x27')]({'plain':!![]});var _0x57be13=_0xd707('0x28');return db[_0xd707('0x29')][_0xd707('0x26')]({'where':{'type':_0x57be13,'resourceId':_0xef6093['id']}})[_0xd707('0x2a')](function(){return _0x2eaade;});})[_0xd707('0x2a')](function(){_0x4ec0c3[_0xd707('0x1a')](0xcc)[_0xd707('0x2b')]();});}};}function handleEntityNotFound(_0x3330e6,_0x3feb7f){return function(_0x1f752e){if(!_0x1f752e){_0x3330e6[_0xd707('0x19')](0x194);}return _0x1f752e;};}function handleError(_0x53d5db,_0x2c0750){_0x2c0750=_0x2c0750||0x1f4;return function(_0x340b79){logger[_0xd707('0x2c')](_0x340b79[_0xd707('0x2d')]);if(_0x340b79[_0xd707('0x2e')]){delete _0x340b79['name'];}_0x53d5db[_0xd707('0x1a')](_0x2c0750)[_0xd707('0x2f')](_0x340b79);};}exports[_0xd707('0x30')]=function(_0x3f4d27,_0x3ed13a){var _0xd340a={},_0x4b6769={},_0x2db6c6={'count':0x0,'rows':[]};var _0x94486d=_[_0xd707('0x31')](db['JscriptyProject']['rawAttributes'],function(_0x40eef5){return{'name':_0x40eef5[_0xd707('0x32')],'type':_0x40eef5['type'][_0xd707('0x33')]};});_0x4b6769[_0xd707('0x34')]=_[_0xd707('0x31')](_0x94486d,_0xd707('0x2e'));_0x4b6769['query']=_['keys'](_0x3f4d27[_0xd707('0x35')]);_0x4b6769[_0xd707('0x36')]=_['intersection'](_0x4b6769[_0xd707('0x34')],_0x4b6769[_0xd707('0x35')]);_0xd340a['attributes']=_['intersection'](_0x4b6769[_0xd707('0x34')],qs['fields'](_0x3f4d27[_0xd707('0x35')]['fields']));_0xd340a[_0xd707('0x37')]=_0xd340a[_0xd707('0x37')]['length']?_0xd340a[_0xd707('0x37')]:_0x4b6769[_0xd707('0x34')];if(!_0x3f4d27[_0xd707('0x35')][_0xd707('0x38')](_0xd707('0x39'))){_0xd340a[_0xd707('0x1f')]=qs['limit'](_0x3f4d27[_0xd707('0x35')][_0xd707('0x1f')]);_0xd340a[_0xd707('0x1c')]=qs[_0xd707('0x1c')](_0x3f4d27[_0xd707('0x35')][_0xd707('0x1c')]);}_0xd340a[_0xd707('0x3a')]=qs['sort'](_0x3f4d27['query']['sort']);_0xd340a['where']=qs[_0xd707('0x36')](_[_0xd707('0x3b')](_0x3f4d27[_0xd707('0x35')],_0x4b6769[_0xd707('0x36')]),_0x94486d);if(_0x3f4d27[_0xd707('0x35')]['filter']){_0xd340a['where']=_[_0xd707('0x3c')](_0xd340a[_0xd707('0x3d')],{'$or':_[_0xd707('0x31')](_0x94486d,function(_0x418d07){if(_0x418d07[_0xd707('0x3e')]!==_0xd707('0x3f')){var _0x41d53a={};_0x41d53a[_0x418d07['name']]={'$like':'%'+_0x3f4d27[_0xd707('0x35')]['filter']+'%'};return _0x41d53a;}})});}_0xd340a=_[_0xd707('0x3c')]({},_0xd340a,_0x3f4d27[_0xd707('0x40')]);var _0x320ee4={'where':_0xd340a[_0xd707('0x3d')]};return db['JscriptyProject'][_0xd707('0x1e')](_0x320ee4)[_0xd707('0x2a')](function(_0x19deb2){_0x2db6c6[_0xd707('0x1e')]=_0x19deb2;if(_0x3f4d27[_0xd707('0x35')][_0xd707('0x41')]){_0xd340a[_0xd707('0x42')]=[{'all':!![]}];}return db[_0xd707('0x43')][_0xd707('0x44')](_0xd340a);})[_0xd707('0x2a')](function(_0x420c95){_0x2db6c6['rows']=_0x420c95;return _0x2db6c6;})[_0xd707('0x2a')](respondWithFilteredResult(_0x3ed13a,_0xd340a))['catch'](handleError(_0x3ed13a,null));};exports[_0xd707('0x45')]=function(_0x468bf0,_0x56f230){var _0x5182e2={'raw':![],'where':{'id':_0x468bf0[_0xd707('0x46')]['id']}},_0x48744e={};_0x48744e[_0xd707('0x34')]=_[_0xd707('0x47')](db[_0xd707('0x43')][_0xd707('0x48')]);_0x48744e['query']=_['keys'](_0x468bf0[_0xd707('0x35')]);_0x48744e[_0xd707('0x36')]=_[_0xd707('0x49')](_0x48744e[_0xd707('0x34')],_0x48744e['query']);_0x5182e2[_0xd707('0x37')]=_[_0xd707('0x49')](_0x48744e[_0xd707('0x34')],qs[_0xd707('0x4a')](_0x468bf0[_0xd707('0x35')][_0xd707('0x4a')]));_0x5182e2[_0xd707('0x37')]=_0x5182e2[_0xd707('0x37')][_0xd707('0x4b')]?_0x5182e2['attributes']:_0x48744e[_0xd707('0x34')];if(_0x468bf0[_0xd707('0x35')][_0xd707('0x41')]){_0x5182e2['include']=[{'all':!![]}];}_0x5182e2=_[_0xd707('0x3c')]({},_0x5182e2,_0x468bf0['options']);return db['JscriptyProject'][_0xd707('0x4c')](_0x5182e2)['then'](handleEntityNotFound(_0x56f230,null))[_0xd707('0x2a')](respondWithResult(_0x56f230,null))[_0xd707('0x4d')](handleError(_0x56f230,null));};exports['create']=function(_0x3f9145,_0x4109a2){return db['JscriptyProject'][_0xd707('0x4e')](_0x3f9145[_0xd707('0x4f')],{})[_0xd707('0x2a')](function(_0x325b01){var _0x132302=_0x3f9145[_0xd707('0x50')][_0xd707('0x27')]({'plain':!![]});if(!_0x132302)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x132302[_0xd707('0x51')]===_0xd707('0x50')){var _0x1ecd51=_0x325b01[_0xd707('0x27')]({'plain':!![]});var _0x3a4817=_0xd707('0x28');return db['UserProfileSection'][_0xd707('0x4c')]({'where':{'name':_0x3a4817,'userProfileId':_0x132302[_0xd707('0x52')]},'raw':!![]})[_0xd707('0x2a')](function(_0x481a34){if(_0x481a34&&_0x481a34[_0xd707('0x53')]===0x0){return db['UserProfileResource'][_0xd707('0x4e')]({'name':_0x1ecd51[_0xd707('0x2e')],'resourceId':_0x1ecd51['id'],'type':_0x481a34['name'],'sectionId':_0x481a34['id']},{})[_0xd707('0x2a')](function(){return _0x325b01;});}else{return _0x325b01;}})[_0xd707('0x4d')](function(_0x56d431){logger[_0xd707('0x2c')](_0xd707('0x54'),_0x56d431);throw _0x56d431;});}return _0x325b01;})[_0xd707('0x2a')](respondWithResult(_0x4109a2,0xc9))['catch'](handleError(_0x4109a2,null));};exports[_0xd707('0x55')]=function(_0x6b780d,_0x15a53a){var _0xbf4822={'where':{'id':_0x6b780d['params']['id']}},_0x3d1de1={};_0x3d1de1[_0xd707('0x34')]=_[_0xd707('0x47')](db[_0xd707('0x43')]['rawAttributes']);_0xbf4822[_0xd707('0x37')]=_['intersection'](_0x3d1de1[_0xd707('0x34')],qs[_0xd707('0x4a')](_0x6b780d[_0xd707('0x35')][_0xd707('0x4a')]));_0xbf4822[_0xd707('0x37')]=_0xbf4822[_0xd707('0x37')][_0xd707('0x4b')]?_0xbf4822[_0xd707('0x37')]:_0x3d1de1[_0xd707('0x34')];if(_0x6b780d[_0xd707('0x35')][_0xd707('0x41')]){_0xbf4822[_0xd707('0x42')]=[{'all':!![]}];}_0xbf4822=_['merge']({},_0xbf4822,_0x6b780d[_0xd707('0x40')]);return db[_0xd707('0x43')]['find'](_0xbf4822)[_0xd707('0x2a')](handleEntityNotFound(_0x15a53a,null))[_0xd707('0x2a')](function(_0x409dbf){if(_0x409dbf){var _0x5604a7=_0x409dbf['get']({'plain':!![]});_0x5604a7=qs['omit'](_0x5604a7,['id',_0xd707('0x56'),'updatedAt']);_0x6b780d[_0xd707('0x4f')]=_[_0xd707('0x57')](_0x6b780d[_0xd707('0x4f')],['id',_0xd707('0x56'),_0xd707('0x58')]);return db['JscriptyProject']['create'](_[_0xd707('0x3c')](_0x5604a7,_0x6b780d[_0xd707('0x4f')]),{'include':_0x6b780d['query'][_0xd707('0x41')]?[{'all':!![]}]:undefined})['then'](function(_0x49da8){var _0x3e3946=_0x6b780d[_0xd707('0x50')][_0xd707('0x27')]({'plain':!![]});if(!_0x3e3946)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e3946[_0xd707('0x51')]===_0xd707('0x50')){var _0x34c187=_0x49da8[_0xd707('0x27')]({'plain':!![]});var _0x2d8c99=_0xd707('0x28');return db['UserProfileSection'][_0xd707('0x4c')]({'where':{'name':_0x2d8c99,'userProfileId':_0x3e3946[_0xd707('0x52')]},'raw':!![]})[_0xd707('0x2a')](function(_0x50c950){if(_0x50c950&&_0x50c950[_0xd707('0x53')]===0x0){return db[_0xd707('0x29')]['create']({'name':_0x34c187[_0xd707('0x2e')],'resourceId':_0x34c187['id'],'type':_0x50c950[_0xd707('0x2e')],'sectionId':_0x50c950['id']},{})['then'](function(){return _0x49da8;});}else{return _0x49da8;}})['catch'](function(_0xecd0b){logger[_0xd707('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xecd0b);throw _0xecd0b;});}return _0x49da8;});}})['then'](respondWithResult(_0x15a53a,0xc9))[_0xd707('0x4d')](handleError(_0x15a53a,null));};exports[_0xd707('0x25')]=function(_0x44adb7,_0xd32a4e){if(_0x44adb7[_0xd707('0x4f')]['id']){delete _0x44adb7['body']['id'];}return db[_0xd707('0x43')][_0xd707('0x4c')]({'where':{'id':_0x44adb7['params']['id']}})[_0xd707('0x2a')](handleEntityNotFound(_0xd32a4e,null))[_0xd707('0x2a')](saveUpdates(_0x44adb7[_0xd707('0x4f')],null))[_0xd707('0x2a')](respondWithResult(_0xd32a4e,null))['catch'](handleError(_0xd32a4e,null));};exports[_0xd707('0x26')]=function(_0x477d97,_0x39f6fe){return db['JscriptyProject'][_0xd707('0x4c')]({'where':{'id':_0x477d97['params']['id']}})['then'](handleEntityNotFound(_0x39f6fe,null))['then'](removeEntity(_0x39f6fe,null))[_0xd707('0x4d')](handleError(_0x39f6fe,null));};exports[_0xd707('0x59')]=function(_0xa99005,_0x1b57f6,_0x4a59d9){var _0x51ff0b={'raw':!![],'where':{}};var _0x189185={};var _0x10b62d={'count':0x0,'rows':[]};return db[_0xd707('0x43')][_0xd707('0x5a')]({'where':{'id':_0xa99005[_0xd707('0x46')]['id']}})[_0xd707('0x2a')](handleEntityNotFound(_0x1b57f6,null))['then'](function(_0x424948){if(_0x424948){_0x189185['model']=_['keys'](db['JscriptySessionReport'][_0xd707('0x48')]);_0x189185['query']=_[_0xd707('0x47')](_0xa99005[_0xd707('0x35')]);_0x189185[_0xd707('0x36')]=_[_0xd707('0x49')](_0x189185[_0xd707('0x34')],_0x189185[_0xd707('0x35')]);_0x51ff0b[_0xd707('0x37')]=_[_0xd707('0x49')](_0x189185[_0xd707('0x34')],qs[_0xd707('0x4a')](_0xa99005[_0xd707('0x35')][_0xd707('0x4a')]));_0x51ff0b[_0xd707('0x37')]=_0x51ff0b['attributes'][_0xd707('0x4b')]?_0x51ff0b[_0xd707('0x37')]:_0x189185['model'];if(!_0xa99005[_0xd707('0x35')][_0xd707('0x38')](_0xd707('0x39'))){_0x51ff0b[_0xd707('0x1f')]=qs['limit'](_0xa99005[_0xd707('0x35')][_0xd707('0x1f')]);_0x51ff0b[_0xd707('0x1c')]=qs['offset'](_0xa99005['query']['offset']);}_0x51ff0b[_0xd707('0x3a')]=qs[_0xd707('0x5b')](_0xa99005[_0xd707('0x35')][_0xd707('0x5b')]);_0x51ff0b[_0xd707('0x3d')]=qs[_0xd707('0x36')](_[_0xd707('0x3b')](_0xa99005[_0xd707('0x35')],_0x189185[_0xd707('0x36')]));_0x51ff0b[_0xd707('0x3d')][_0xd707('0x5c')]=_0x424948['id'];if(_0xa99005[_0xd707('0x35')][_0xd707('0x5d')]){_0x51ff0b[_0xd707('0x3d')]=_[_0xd707('0x3c')](_0x51ff0b[_0xd707('0x3d')],{'$or':_['map'](_0x51ff0b[_0xd707('0x37')],function(_0x3c5ac5){var _0x405859={};_0x405859[_0x3c5ac5]={'$like':'%'+_0xa99005[_0xd707('0x35')][_0xd707('0x5d')]+'%'};return _0x405859;})});}_0x51ff0b=_['merge']({},_0x51ff0b,_0xa99005[_0xd707('0x40')]);return db['JscriptySessionReport']['count']({'where':_0x51ff0b[_0xd707('0x3d')]})[_0xd707('0x2a')](function(_0x10d627){_0x10b62d['count']=_0x10d627;if(_0xa99005['query']['includeAll']){_0x51ff0b[_0xd707('0x42')]=[{'all':!![]}];}return db[_0xd707('0x5e')][_0xd707('0x44')](_0x51ff0b);})[_0xd707('0x2a')](function(_0x3b39ce){_0x10b62d[_0xd707('0x5f')]=_0x3b39ce;return _0x10b62d;});}})['then'](respondWithFilteredResult(_0x1b57f6,_0x51ff0b))['catch'](handleError(_0x1b57f6,null));};exports[_0xd707('0x60')]=function(_0x4a369d,_0x1c0f99,_0x4de75c){var _0x3a9b8e={'raw':!![],'where':{}};var _0x4f9ece={};var _0x3535d3={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xd707('0x5a')]({'where':{'id':_0x4a369d[_0xd707('0x46')]['id']}})[_0xd707('0x2a')](handleEntityNotFound(_0x1c0f99,null))[_0xd707('0x2a')](function(_0x47d71e){if(_0x47d71e){_0x4f9ece[_0xd707('0x34')]=_['keys'](db[_0xd707('0x61')][_0xd707('0x48')]);_0x4f9ece[_0xd707('0x35')]=_[_0xd707('0x47')](_0x4a369d[_0xd707('0x35')]);_0x4f9ece[_0xd707('0x36')]=_['intersection'](_0x4f9ece[_0xd707('0x34')],_0x4f9ece[_0xd707('0x35')]);_0x3a9b8e[_0xd707('0x37')]=_[_0xd707('0x49')](_0x4f9ece['model'],qs[_0xd707('0x4a')](_0x4a369d['query']['fields']));_0x3a9b8e[_0xd707('0x37')]=_0x3a9b8e['attributes'][_0xd707('0x4b')]?_0x3a9b8e[_0xd707('0x37')]:_0x4f9ece['model'];if(!_0x4a369d[_0xd707('0x35')]['hasOwnProperty'](_0xd707('0x39'))){_0x3a9b8e[_0xd707('0x1f')]=qs[_0xd707('0x1f')](_0x4a369d[_0xd707('0x35')][_0xd707('0x1f')]);_0x3a9b8e[_0xd707('0x1c')]=qs[_0xd707('0x1c')](_0x4a369d[_0xd707('0x35')]['offset']);}_0x3a9b8e[_0xd707('0x3a')]=qs['sort'](_0x4a369d[_0xd707('0x35')][_0xd707('0x5b')]);_0x3a9b8e[_0xd707('0x3d')]=qs['filters'](_[_0xd707('0x3b')](_0x4a369d[_0xd707('0x35')],_0x4f9ece[_0xd707('0x36')]));_0x3a9b8e[_0xd707('0x3d')][_0xd707('0x5c')]=_0x47d71e['id'];if(_0x4a369d['query'][_0xd707('0x5d')]){_0x3a9b8e[_0xd707('0x3d')]=_[_0xd707('0x3c')](_0x3a9b8e[_0xd707('0x3d')],{'$or':_['map'](_0x3a9b8e[_0xd707('0x37')],function(_0x35aa05){var _0x34199a={};_0x34199a[_0x35aa05]={'$like':'%'+_0x4a369d[_0xd707('0x35')][_0xd707('0x5d')]+'%'};return _0x34199a;})});}_0x3a9b8e=_[_0xd707('0x3c')]({},_0x3a9b8e,_0x4a369d['options']);return db[_0xd707('0x61')][_0xd707('0x1e')]({'where':_0x3a9b8e['where']})[_0xd707('0x2a')](function(_0x3413d4){_0x3535d3[_0xd707('0x1e')]=_0x3413d4;if(_0x4a369d[_0xd707('0x35')][_0xd707('0x41')]){_0x3a9b8e['include']=[{'all':!![]}];}return db[_0xd707('0x61')][_0xd707('0x44')](_0x3a9b8e);})[_0xd707('0x2a')](function(_0x51d956){_0x3535d3['rows']=_0x51d956;return _0x3535d3;});}})[_0xd707('0x2a')](respondWithFilteredResult(_0x1c0f99,_0x3a9b8e))[_0xd707('0x4d')](handleError(_0x1c0f99,null));};function char(_0x4443ee){return _0xd707('0x62')===typeof _0x4443ee?String[_0xd707('0x63')]['apply'](null,arguments):_0x4443ee;}function needsEncapsulation(_0x5662dc){return!!_0x5662dc&&(_0x5662dc[_0xd707('0x64')]()[_0xd707('0x65')](char(0xd))>=0x0||_0x5662dc[_0xd707('0x64')]()[_0xd707('0x65')](char(0xa))>=0x0||_0x5662dc[_0xd707('0x64')]()[_0xd707('0x65')](char(0x2c))>=0x0||_0x5662dc[_0xd707('0x64')]()[_0xd707('0x65')](char(0x22))>=0x0);}function encapsulate(_0x6d6a77){var _0x24356a=char(0x22),_0x43d62a='\x5c'+char(0x22),_0x357289=_0x6d6a77[_0xd707('0x64')]()[_0xd707('0x66')](new RegExp(_0x24356a,'g'),_0x43d62a);return _0x24356a+_0x357289+_0x24356a;}exports[_0xd707('0x67')]=function(_0x300944,_0x49b118,_0xffd78){var _0x52947b,_0x55e489;var _0x556526={'where':{'ProjectId':_0x300944[_0xd707('0x46')]['id']}};if(_0x300944[_0xd707('0x35')][_0xd707('0x68')]){_0x556526['where'][_0xd707('0x69')]=JSON['parse'](_0x300944[_0xd707('0x35')]['startTime']);}return db['JscriptySessionReport']['findAll'](_0x556526)[_0xd707('0x2a')](handleEntityNotFound(_0x49b118,null))[_0xd707('0x2a')](function(_0x24bb01){if(_0x24bb01){_0x52947b=_0x24bb01;return db['JscriptyQuestionReport'][_0xd707('0x44')]({'where':{'SessionId':{'$in':_[_0xd707('0x31')](_0x52947b,'id')},'ProjectId':_0x300944['params']['id']},'order':_0xd707('0x6a')});}})['then'](handleEntityNotFound(_0x49b118,null))[_0xd707('0x2a')](function(_0x536600){if(_0x536600){_0x55e489=_0x536600;var _0x58d1fa={};for(var _0x32b8d0=0x0,_0x4a191e=_0x55e489[_0xd707('0x4b')];_0x32b8d0<_0x4a191e;_0x32b8d0++){if(!_0x58d1fa[_0xd707('0x38')](_0x55e489[_0x32b8d0]['questionId'])){_0x58d1fa[_0x55e489[_0x32b8d0]['questionId']]=needsEncapsulation(_0x55e489[_0x32b8d0][_0xd707('0x6b')])?encapsulate(_0x55e489[_0x32b8d0][_0xd707('0x6b')]):_0x55e489[_0x32b8d0]['question'];}}var _0x216328=[],_0x25ef89={};for(var _0x2b8de1=0x0,_0x9c312a=_0x52947b[_0xd707('0x4b')];_0x2b8de1<_0x9c312a;_0x2b8de1++){_0x25ef89={'ProjectId':_0x300944[_0xd707('0x46')]['id'],'SessionId':_0x52947b[_0x2b8de1]['id'],'StartTime':moment(_0x52947b[_0x2b8de1][_0xd707('0x69')])[_0xd707('0x6c')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x31acba=0x0,_0x470e8d=_0x55e489[_0xd707('0x4b')];_0x31acba<_0x470e8d;_0x31acba++){if(_0x55e489[_0x31acba]['SessionId']==_0x52947b[_0x2b8de1]['id']&&_0x58d1fa[_0xd707('0x38')](_0x55e489[_0x31acba]['questionId'])){_0x25ef89[_0x58d1fa[_0x55e489[_0x31acba][_0xd707('0x6d')]]]=_0x55e489[_0x31acba][_0xd707('0x6e')];}}for(var _0x4a2537 in _0x58d1fa){if(!_0x25ef89['hasOwnProperty'](_0x58d1fa[_0x4a2537])){_0x25ef89[_0x58d1fa[_0x4a2537]]=null;}}_0x216328[_0xd707('0x6f')](_0x25ef89);}return _0x216328;}})[_0xd707('0x2a')](function(_0x25c6f9){if(!_['isEmpty'](_0x25c6f9)){var _0x4b8f39=toCsv(_0x25c6f9);var _0x59c308=Date['now']();fs[_0xd707('0x70')](util[_0xd707('0x6c')](_0xd707('0x71'),_0x300944['params']['id'],_0x59c308),_0x4b8f39);_0x49b118['setHeader']('Content-disposition',_0xd707('0x72')+util[_0xd707('0x6c')]('Jscripty_Project_%d_Summary_%s.csv',_0x300944[_0xd707('0x46')]['id'],_0x59c308));_0x49b118[_0xd707('0x73')](_0xd707('0x74'),'text/csv');return _0x49b118[_0xd707('0x75')](util[_0xd707('0x6c')](_0xd707('0x71'),_0x300944[_0xd707('0x46')]['id'],_0x59c308));}else{return _0x49b118[_0xd707('0x19')](0xcc);}})[_0xd707('0x4d')](handleError(_0x49b118,null));}; \ No newline at end of file +var _0xd004=['findOne','JscriptySessionReport','ProjectId','rows','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','to-csv','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','keys','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','where','VIRTUAL','filter','merge','options','include','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Projects','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','includeAll','omit','createdAt','update'];(function(_0x3ee2d2,_0x468998){var _0x5c49ee=function(_0x1872f3){while(--_0x1872f3){_0x3ee2d2['push'](_0x3ee2d2['shift']());}};_0x5c49ee(++_0x468998);}(_0xd004,0x181));var _0x4d00=function(_0x273fd1,_0x388bbe){_0x273fd1=_0x273fd1-0x0;var _0x5d3dbf=_0xd004[_0x273fd1];return _0x5d3dbf;};'use strict';var emlformat=require(_0x4d00('0x0'));var rimraf=require(_0x4d00('0x1'));var zipdir=require(_0x4d00('0x2'));var jsonpatch=require(_0x4d00('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4d00('0x4'));var Mustache=require(_0x4d00('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x4d00('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4d00('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4d00('0x8'));var deskjs=require(_0x4d00('0x9'));var toCsv=require(_0x4d00('0x6'));var querystring=require(_0x4d00('0xa'));var Papa=require(_0x4d00('0xb'));var Redis=require('ioredis');var authService=require(_0x4d00('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x4d00('0xd'));var hardwareService=require(_0x4d00('0xe'));var logger=require('../../config/logger')(_0x4d00('0xf'));var utils=require(_0x4d00('0x10'));var config=require(_0x4d00('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3eaeac,_0x38ff0e){_0x38ff0e=_0x38ff0e||0xcc;return function(_0x47726e){if(_0x47726e){return _0x3eaeac[_0x4d00('0x12')](_0x38ff0e);}return _0x3eaeac['status'](_0x38ff0e)[_0x4d00('0x13')]();};}function respondWithResult(_0x39d68c,_0x5124c3){_0x5124c3=_0x5124c3||0xc8;return function(_0x588c31){if(_0x588c31){return _0x39d68c['status'](_0x5124c3)[_0x4d00('0x14')](_0x588c31);}};}function respondWithFilteredResult(_0x233de3,_0x30f3f4){return function(_0x58d56a){if(_0x58d56a){var _0x433a7b=typeof _0x30f3f4[_0x4d00('0x15')]===_0x4d00('0x16')&&typeof _0x30f3f4[_0x4d00('0x17')]===_0x4d00('0x16');var _0x433b1b=_0x58d56a[_0x4d00('0x18')];var _0x398a08=_0x433a7b?0x0:_0x30f3f4[_0x4d00('0x15')];var _0x2bf553=_0x433a7b?_0x58d56a[_0x4d00('0x18')]:_0x30f3f4[_0x4d00('0x15')]+_0x30f3f4[_0x4d00('0x17')];var _0x827890;if(_0x2bf553>=_0x433b1b){_0x2bf553=_0x433b1b;_0x827890=0xc8;}else{_0x827890=0xce;}_0x233de3[_0x4d00('0x19')](_0x827890);return _0x233de3[_0x4d00('0x1a')](_0x4d00('0x1b'),_0x398a08+'-'+_0x2bf553+'/'+_0x433b1b)['json'](_0x58d56a);}return null;};}function patchUpdates(_0x522066){return function(_0x17877b){try{jsonpatch[_0x4d00('0x1c')](_0x17877b,_0x522066,!![]);}catch(_0x38b460){return BPromise[_0x4d00('0x1d')](_0x38b460);}return _0x17877b[_0x4d00('0x1e')]();};}function saveUpdates(_0x102213,_0x58c7c7){return function(_0x4bf02e){if(_0x4bf02e){return _0x4bf02e['update'](_0x102213)[_0x4d00('0x1f')](function(_0xf70e8e){return _0xf70e8e;});}return null;};}function removeEntity(_0x2a2c74,_0x32a910){return function(_0x3e3d7f){if(_0x3e3d7f){return _0x3e3d7f[_0x4d00('0x20')]()[_0x4d00('0x1f')](function(){var _0x38b95e=_0x3e3d7f[_0x4d00('0x21')]({'plain':!![]});var _0x1a4553='Projects';return db[_0x4d00('0x22')][_0x4d00('0x20')]({'where':{'type':_0x1a4553,'resourceId':_0x38b95e['id']}})['then'](function(){return _0x3e3d7f;});})[_0x4d00('0x1f')](function(){_0x2a2c74[_0x4d00('0x19')](0xcc)[_0x4d00('0x13')]();});}};}function handleEntityNotFound(_0x3640ab,_0x6b106c){return function(_0x6df58c){if(!_0x6df58c){_0x3640ab[_0x4d00('0x12')](0x194);}return _0x6df58c;};}function handleError(_0x29a045,_0x85a5dd){_0x85a5dd=_0x85a5dd||0x1f4;return function(_0x7ae64d){logger['error'](_0x7ae64d['stack']);if(_0x7ae64d[_0x4d00('0x23')]){delete _0x7ae64d[_0x4d00('0x23')];}_0x29a045[_0x4d00('0x19')](_0x85a5dd)[_0x4d00('0x24')](_0x7ae64d);};}exports[_0x4d00('0x25')]=function(_0x1de92d,_0x703ce1){var _0x1b7adf={},_0x2649c2={},_0x461b6a={'count':0x0,'rows':[]};var _0x16e714=_[_0x4d00('0x26')](db[_0x4d00('0x27')][_0x4d00('0x28')],function(_0x4f4e9a){return{'name':_0x4f4e9a[_0x4d00('0x29')],'type':_0x4f4e9a[_0x4d00('0x2a')]['key']};});_0x2649c2['model']=_['map'](_0x16e714,_0x4d00('0x23'));_0x2649c2['query']=_[_0x4d00('0x2b')](_0x1de92d[_0x4d00('0x2c')]);_0x2649c2['filters']=_[_0x4d00('0x2d')](_0x2649c2['model'],_0x2649c2[_0x4d00('0x2c')]);_0x1b7adf[_0x4d00('0x2e')]=_[_0x4d00('0x2d')](_0x2649c2[_0x4d00('0x2f')],qs[_0x4d00('0x30')](_0x1de92d[_0x4d00('0x2c')]['fields']));_0x1b7adf['attributes']=_0x1b7adf[_0x4d00('0x2e')][_0x4d00('0x31')]?_0x1b7adf['attributes']:_0x2649c2['model'];if(!_0x1de92d['query'][_0x4d00('0x32')](_0x4d00('0x33'))){_0x1b7adf[_0x4d00('0x17')]=qs[_0x4d00('0x17')](_0x1de92d['query'][_0x4d00('0x17')]);_0x1b7adf['offset']=qs[_0x4d00('0x15')](_0x1de92d[_0x4d00('0x2c')][_0x4d00('0x15')]);}_0x1b7adf[_0x4d00('0x34')]=qs['sort'](_0x1de92d[_0x4d00('0x2c')][_0x4d00('0x35')]);_0x1b7adf['where']=qs['filters'](_[_0x4d00('0x36')](_0x1de92d[_0x4d00('0x2c')],_0x2649c2[_0x4d00('0x37')]),_0x16e714);if(_0x1de92d['query']['filter']){_0x1b7adf[_0x4d00('0x38')]=_['merge'](_0x1b7adf[_0x4d00('0x38')],{'$or':_[_0x4d00('0x26')](_0x16e714,function(_0x248d0e){if(_0x248d0e[_0x4d00('0x2a')]!==_0x4d00('0x39')){var _0x5291ed={};_0x5291ed[_0x248d0e['name']]={'$like':'%'+_0x1de92d['query'][_0x4d00('0x3a')]+'%'};return _0x5291ed;}})});}_0x1b7adf=_[_0x4d00('0x3b')]({},_0x1b7adf,_0x1de92d[_0x4d00('0x3c')]);var _0xdaebc8={'where':_0x1b7adf[_0x4d00('0x38')]};return db[_0x4d00('0x27')][_0x4d00('0x18')](_0xdaebc8)[_0x4d00('0x1f')](function(_0x341ee7){_0x461b6a[_0x4d00('0x18')]=_0x341ee7;if(_0x1de92d[_0x4d00('0x2c')]['includeAll']){_0x1b7adf[_0x4d00('0x3d')]=[{'all':!![]}];}return db[_0x4d00('0x27')][_0x4d00('0x3e')](_0x1b7adf);})['then'](function(_0x2162cc){_0x461b6a['rows']=_0x2162cc;return _0x461b6a;})[_0x4d00('0x1f')](respondWithFilteredResult(_0x703ce1,_0x1b7adf))[_0x4d00('0x3f')](handleError(_0x703ce1,null));};exports[_0x4d00('0x40')]=function(_0x3b08f5,_0x140864){var _0x30143f={'raw':![],'where':{'id':_0x3b08f5[_0x4d00('0x41')]['id']}},_0x4be1b2={};_0x4be1b2[_0x4d00('0x2f')]=_[_0x4d00('0x2b')](db[_0x4d00('0x27')][_0x4d00('0x28')]);_0x4be1b2[_0x4d00('0x2c')]=_['keys'](_0x3b08f5[_0x4d00('0x2c')]);_0x4be1b2[_0x4d00('0x37')]=_[_0x4d00('0x2d')](_0x4be1b2[_0x4d00('0x2f')],_0x4be1b2[_0x4d00('0x2c')]);_0x30143f[_0x4d00('0x2e')]=_[_0x4d00('0x2d')](_0x4be1b2[_0x4d00('0x2f')],qs['fields'](_0x3b08f5[_0x4d00('0x2c')][_0x4d00('0x30')]));_0x30143f[_0x4d00('0x2e')]=_0x30143f['attributes'][_0x4d00('0x31')]?_0x30143f[_0x4d00('0x2e')]:_0x4be1b2['model'];if(_0x3b08f5[_0x4d00('0x2c')]['includeAll']){_0x30143f[_0x4d00('0x3d')]=[{'all':!![]}];}_0x30143f=_[_0x4d00('0x3b')]({},_0x30143f,_0x3b08f5['options']);return db['JscriptyProject'][_0x4d00('0x42')](_0x30143f)[_0x4d00('0x1f')](handleEntityNotFound(_0x140864,null))[_0x4d00('0x1f')](respondWithResult(_0x140864,null))[_0x4d00('0x3f')](handleError(_0x140864,null));};exports[_0x4d00('0x43')]=function(_0x316136,_0x5b29e5){return db['JscriptyProject']['create'](_0x316136[_0x4d00('0x44')],{})[_0x4d00('0x1f')](function(_0x5ed0d2){var _0x13bf4f=_0x316136[_0x4d00('0x45')][_0x4d00('0x21')]({'plain':!![]});if(!_0x13bf4f)throw new Error(_0x4d00('0x46'));if(_0x13bf4f[_0x4d00('0x47')]===_0x4d00('0x45')){var _0x3ee807=_0x5ed0d2[_0x4d00('0x21')]({'plain':!![]});var _0x8cf582=_0x4d00('0x48');return db[_0x4d00('0x49')][_0x4d00('0x42')]({'where':{'name':_0x8cf582,'userProfileId':_0x13bf4f[_0x4d00('0x4a')]},'raw':!![]})['then'](function(_0x3110d9){if(_0x3110d9&&_0x3110d9[_0x4d00('0x4b')]===0x0){return db[_0x4d00('0x22')]['create']({'name':_0x3ee807[_0x4d00('0x23')],'resourceId':_0x3ee807['id'],'type':_0x3110d9[_0x4d00('0x23')],'sectionId':_0x3110d9['id']},{})['then'](function(){return _0x5ed0d2;});}else{return _0x5ed0d2;}})[_0x4d00('0x3f')](function(_0x533bcb){logger[_0x4d00('0x4c')](_0x4d00('0x4d'),_0x533bcb);throw _0x533bcb;});}return _0x5ed0d2;})[_0x4d00('0x1f')](respondWithResult(_0x5b29e5,0xc9))[_0x4d00('0x3f')](handleError(_0x5b29e5,null));};exports[_0x4d00('0x4e')]=function(_0x1a6943,_0xffb7b2){var _0x671e6d={'where':{'id':_0x1a6943[_0x4d00('0x41')]['id']}},_0x42959b={};_0x42959b['model']=_[_0x4d00('0x2b')](db[_0x4d00('0x27')]['rawAttributes']);_0x671e6d[_0x4d00('0x2e')]=_[_0x4d00('0x2d')](_0x42959b['model'],qs['fields'](_0x1a6943[_0x4d00('0x2c')][_0x4d00('0x30')]));_0x671e6d[_0x4d00('0x2e')]=_0x671e6d[_0x4d00('0x2e')][_0x4d00('0x31')]?_0x671e6d[_0x4d00('0x2e')]:_0x42959b['model'];if(_0x1a6943[_0x4d00('0x2c')][_0x4d00('0x4f')]){_0x671e6d[_0x4d00('0x3d')]=[{'all':!![]}];}_0x671e6d=_['merge']({},_0x671e6d,_0x1a6943[_0x4d00('0x3c')]);return db[_0x4d00('0x27')]['find'](_0x671e6d)[_0x4d00('0x1f')](handleEntityNotFound(_0xffb7b2,null))[_0x4d00('0x1f')](function(_0x4eb78c){if(_0x4eb78c){var _0x3ae133=_0x4eb78c[_0x4d00('0x21')]({'plain':!![]});_0x3ae133=qs['omit'](_0x3ae133,['id','createdAt','updatedAt']);_0x1a6943[_0x4d00('0x44')]=_[_0x4d00('0x50')](_0x1a6943[_0x4d00('0x44')],['id',_0x4d00('0x51'),'updatedAt']);return db[_0x4d00('0x27')]['create'](_[_0x4d00('0x3b')](_0x3ae133,_0x1a6943[_0x4d00('0x44')]),{'include':_0x1a6943[_0x4d00('0x2c')][_0x4d00('0x4f')]?[{'all':!![]}]:undefined})[_0x4d00('0x1f')](function(_0x5710f6){var _0x1756df=_0x1a6943[_0x4d00('0x45')][_0x4d00('0x21')]({'plain':!![]});if(!_0x1756df)throw new Error(_0x4d00('0x46'));if(_0x1756df[_0x4d00('0x47')]===_0x4d00('0x45')){var _0x5df86b=_0x5710f6[_0x4d00('0x21')]({'plain':!![]});var _0x2f206d=_0x4d00('0x48');return db['UserProfileSection'][_0x4d00('0x42')]({'where':{'name':_0x2f206d,'userProfileId':_0x1756df[_0x4d00('0x4a')]},'raw':!![]})[_0x4d00('0x1f')](function(_0x95567d){if(_0x95567d&&_0x95567d['autoAssociation']===0x0){return db[_0x4d00('0x22')]['create']({'name':_0x5df86b[_0x4d00('0x23')],'resourceId':_0x5df86b['id'],'type':_0x95567d[_0x4d00('0x23')],'sectionId':_0x95567d['id']},{})[_0x4d00('0x1f')](function(){return _0x5710f6;});}else{return _0x5710f6;}})['catch'](function(_0x15aeeb){logger[_0x4d00('0x4c')](_0x4d00('0x4d'),_0x15aeeb);throw _0x15aeeb;});}return _0x5710f6;});}})[_0x4d00('0x1f')](respondWithResult(_0xffb7b2,0xc9))[_0x4d00('0x3f')](handleError(_0xffb7b2,null));};exports[_0x4d00('0x52')]=function(_0x271fac,_0x843471){if(_0x271fac[_0x4d00('0x44')]['id']){delete _0x271fac['body']['id'];}return db[_0x4d00('0x27')]['find']({'where':{'id':_0x271fac['params']['id']}})[_0x4d00('0x1f')](handleEntityNotFound(_0x843471,null))['then'](saveUpdates(_0x271fac[_0x4d00('0x44')],null))['then'](respondWithResult(_0x843471,null))[_0x4d00('0x3f')](handleError(_0x843471,null));};exports[_0x4d00('0x20')]=function(_0x1065b5,_0x4c6958){return db[_0x4d00('0x27')][_0x4d00('0x42')]({'where':{'id':_0x1065b5[_0x4d00('0x41')]['id']}})[_0x4d00('0x1f')](handleEntityNotFound(_0x4c6958,null))['then'](removeEntity(_0x4c6958,null))[_0x4d00('0x3f')](handleError(_0x4c6958,null));};exports['getSessions']=function(_0x456eaa,_0x5e2ee2,_0x1a7a64){var _0x539790={'raw':!![],'where':{}};var _0x3aa893={};var _0x1cfb25={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x4d00('0x53')]({'where':{'id':_0x456eaa[_0x4d00('0x41')]['id']}})[_0x4d00('0x1f')](handleEntityNotFound(_0x5e2ee2,null))[_0x4d00('0x1f')](function(_0xb12a37){if(_0xb12a37){_0x3aa893[_0x4d00('0x2f')]=_[_0x4d00('0x2b')](db[_0x4d00('0x54')][_0x4d00('0x28')]);_0x3aa893[_0x4d00('0x2c')]=_[_0x4d00('0x2b')](_0x456eaa[_0x4d00('0x2c')]);_0x3aa893['filters']=_[_0x4d00('0x2d')](_0x3aa893[_0x4d00('0x2f')],_0x3aa893[_0x4d00('0x2c')]);_0x539790[_0x4d00('0x2e')]=_['intersection'](_0x3aa893[_0x4d00('0x2f')],qs[_0x4d00('0x30')](_0x456eaa[_0x4d00('0x2c')][_0x4d00('0x30')]));_0x539790[_0x4d00('0x2e')]=_0x539790[_0x4d00('0x2e')][_0x4d00('0x31')]?_0x539790[_0x4d00('0x2e')]:_0x3aa893[_0x4d00('0x2f')];if(!_0x456eaa[_0x4d00('0x2c')]['hasOwnProperty'](_0x4d00('0x33'))){_0x539790['limit']=qs['limit'](_0x456eaa[_0x4d00('0x2c')][_0x4d00('0x17')]);_0x539790[_0x4d00('0x15')]=qs[_0x4d00('0x15')](_0x456eaa[_0x4d00('0x2c')]['offset']);}_0x539790[_0x4d00('0x34')]=qs[_0x4d00('0x35')](_0x456eaa[_0x4d00('0x2c')][_0x4d00('0x35')]);_0x539790[_0x4d00('0x38')]=qs['filters'](_[_0x4d00('0x36')](_0x456eaa[_0x4d00('0x2c')],_0x3aa893['filters']));_0x539790[_0x4d00('0x38')][_0x4d00('0x55')]=_0xb12a37['id'];if(_0x456eaa['query'][_0x4d00('0x3a')]){_0x539790['where']=_[_0x4d00('0x3b')](_0x539790['where'],{'$or':_[_0x4d00('0x26')](_0x539790[_0x4d00('0x2e')],function(_0x32b109){var _0x13b511={};_0x13b511[_0x32b109]={'$like':'%'+_0x456eaa['query'][_0x4d00('0x3a')]+'%'};return _0x13b511;})});}_0x539790=_[_0x4d00('0x3b')]({},_0x539790,_0x456eaa['options']);return db['JscriptySessionReport'][_0x4d00('0x18')]({'where':_0x539790[_0x4d00('0x38')]})['then'](function(_0x2add61){_0x1cfb25[_0x4d00('0x18')]=_0x2add61;if(_0x456eaa[_0x4d00('0x2c')][_0x4d00('0x4f')]){_0x539790[_0x4d00('0x3d')]=[{'all':!![]}];}return db[_0x4d00('0x54')][_0x4d00('0x3e')](_0x539790);})[_0x4d00('0x1f')](function(_0x1473a3){_0x1cfb25[_0x4d00('0x56')]=_0x1473a3;return _0x1cfb25;});}})[_0x4d00('0x1f')](respondWithFilteredResult(_0x5e2ee2,_0x539790))[_0x4d00('0x3f')](handleError(_0x5e2ee2,null));};exports[_0x4d00('0x57')]=function(_0x5a6da4,_0x446039,_0x3a64c5){var _0x4f3e2c={'raw':!![],'where':{}};var _0x5a2a74={};var _0x4f2791={'count':0x0,'rows':[]};return db[_0x4d00('0x27')]['findOne']({'where':{'id':_0x5a6da4['params']['id']}})[_0x4d00('0x1f')](handleEntityNotFound(_0x446039,null))[_0x4d00('0x1f')](function(_0x14df34){if(_0x14df34){_0x5a2a74[_0x4d00('0x2f')]=_[_0x4d00('0x2b')](db[_0x4d00('0x58')][_0x4d00('0x28')]);_0x5a2a74[_0x4d00('0x2c')]=_['keys'](_0x5a6da4[_0x4d00('0x2c')]);_0x5a2a74[_0x4d00('0x37')]=_[_0x4d00('0x2d')](_0x5a2a74[_0x4d00('0x2f')],_0x5a2a74[_0x4d00('0x2c')]);_0x4f3e2c[_0x4d00('0x2e')]=_['intersection'](_0x5a2a74[_0x4d00('0x2f')],qs[_0x4d00('0x30')](_0x5a6da4[_0x4d00('0x2c')][_0x4d00('0x30')]));_0x4f3e2c[_0x4d00('0x2e')]=_0x4f3e2c['attributes'][_0x4d00('0x31')]?_0x4f3e2c[_0x4d00('0x2e')]:_0x5a2a74[_0x4d00('0x2f')];if(!_0x5a6da4['query']['hasOwnProperty'](_0x4d00('0x33'))){_0x4f3e2c[_0x4d00('0x17')]=qs['limit'](_0x5a6da4[_0x4d00('0x2c')][_0x4d00('0x17')]);_0x4f3e2c[_0x4d00('0x15')]=qs['offset'](_0x5a6da4['query'][_0x4d00('0x15')]);}_0x4f3e2c[_0x4d00('0x34')]=qs[_0x4d00('0x35')](_0x5a6da4[_0x4d00('0x2c')][_0x4d00('0x35')]);_0x4f3e2c[_0x4d00('0x38')]=qs[_0x4d00('0x37')](_[_0x4d00('0x36')](_0x5a6da4[_0x4d00('0x2c')],_0x5a2a74[_0x4d00('0x37')]));_0x4f3e2c[_0x4d00('0x38')]['ProjectId']=_0x14df34['id'];if(_0x5a6da4[_0x4d00('0x2c')][_0x4d00('0x3a')]){_0x4f3e2c[_0x4d00('0x38')]=_[_0x4d00('0x3b')](_0x4f3e2c[_0x4d00('0x38')],{'$or':_[_0x4d00('0x26')](_0x4f3e2c[_0x4d00('0x2e')],function(_0x2c99c4){var _0x52b938={};_0x52b938[_0x2c99c4]={'$like':'%'+_0x5a6da4[_0x4d00('0x2c')][_0x4d00('0x3a')]+'%'};return _0x52b938;})});}_0x4f3e2c=_[_0x4d00('0x3b')]({},_0x4f3e2c,_0x5a6da4[_0x4d00('0x3c')]);return db[_0x4d00('0x58')][_0x4d00('0x18')]({'where':_0x4f3e2c[_0x4d00('0x38')]})[_0x4d00('0x1f')](function(_0xfc9e0f){_0x4f2791['count']=_0xfc9e0f;if(_0x5a6da4[_0x4d00('0x2c')][_0x4d00('0x4f')]){_0x4f3e2c[_0x4d00('0x3d')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x4d00('0x3e')](_0x4f3e2c);})[_0x4d00('0x1f')](function(_0x213554){_0x4f2791[_0x4d00('0x56')]=_0x213554;return _0x4f2791;});}})['then'](respondWithFilteredResult(_0x446039,_0x4f3e2c))[_0x4d00('0x3f')](handleError(_0x446039,null));};function char(_0x106dc1){return _0x4d00('0x59')===typeof _0x106dc1?String[_0x4d00('0x5a')][_0x4d00('0x1c')](null,arguments):_0x106dc1;}function needsEncapsulation(_0x515ae6){return!!_0x515ae6&&(_0x515ae6[_0x4d00('0x5b')]()[_0x4d00('0x5c')](char(0xd))>=0x0||_0x515ae6[_0x4d00('0x5b')]()['indexOf'](char(0xa))>=0x0||_0x515ae6[_0x4d00('0x5b')]()['indexOf'](char(0x2c))>=0x0||_0x515ae6[_0x4d00('0x5b')]()[_0x4d00('0x5c')](char(0x22))>=0x0);}function encapsulate(_0x547f65){var _0x366e32=char(0x22),_0x3822a0='\x5c'+char(0x22),_0x9bac0b=_0x547f65[_0x4d00('0x5b')]()[_0x4d00('0x5d')](new RegExp(_0x366e32,'g'),_0x3822a0);return _0x366e32+_0x9bac0b+_0x366e32;}exports['getSummary']=function(_0x325dc5,_0x40a8c4,_0x95d9aa){var _0x5914c5,_0x162170;var _0x535a02={'where':{'ProjectId':_0x325dc5[_0x4d00('0x41')]['id']}};if(_0x325dc5[_0x4d00('0x2c')][_0x4d00('0x5e')]){_0x535a02[_0x4d00('0x38')][_0x4d00('0x5f')]=JSON[_0x4d00('0x60')](_0x325dc5[_0x4d00('0x2c')][_0x4d00('0x5e')]);}return db[_0x4d00('0x54')][_0x4d00('0x3e')](_0x535a02)[_0x4d00('0x1f')](handleEntityNotFound(_0x40a8c4,null))[_0x4d00('0x1f')](function(_0x6780df){if(_0x6780df){_0x5914c5=_0x6780df;return db[_0x4d00('0x61')][_0x4d00('0x3e')]({'where':{'SessionId':{'$in':_[_0x4d00('0x26')](_0x5914c5,'id')},'ProjectId':_0x325dc5[_0x4d00('0x41')]['id']},'order':_0x4d00('0x62')});}})[_0x4d00('0x1f')](handleEntityNotFound(_0x40a8c4,null))[_0x4d00('0x1f')](function(_0x1cf577){if(_0x1cf577){_0x162170=_0x1cf577;var _0x499ce4={};for(var _0x4e801c=0x0,_0x3beeeb=_0x162170['length'];_0x4e801c<_0x3beeeb;_0x4e801c++){if(!_0x499ce4['hasOwnProperty'](_0x162170[_0x4e801c]['questionId'])){_0x499ce4[_0x162170[_0x4e801c][_0x4d00('0x63')]]=needsEncapsulation(_0x162170[_0x4e801c]['question'])?encapsulate(_0x162170[_0x4e801c][_0x4d00('0x64')]):_0x162170[_0x4e801c][_0x4d00('0x64')];}}var _0x1f5e4c=[],_0x594397={};for(var _0x34eda6=0x0,_0x50a2fb=_0x5914c5['length'];_0x34eda6<_0x50a2fb;_0x34eda6++){_0x594397={'ProjectId':_0x325dc5[_0x4d00('0x41')]['id'],'SessionId':_0x5914c5[_0x34eda6]['id'],'StartTime':moment(_0x5914c5[_0x34eda6][_0x4d00('0x5f')])[_0x4d00('0x65')](_0x4d00('0x66'))};for(var _0x4af27b=0x0,_0x26a803=_0x162170[_0x4d00('0x31')];_0x4af27b<_0x26a803;_0x4af27b++){if(_0x162170[_0x4af27b][_0x4d00('0x67')]==_0x5914c5[_0x34eda6]['id']&&_0x499ce4[_0x4d00('0x32')](_0x162170[_0x4af27b]['questionId'])){_0x594397[_0x499ce4[_0x162170[_0x4af27b][_0x4d00('0x63')]]]=_0x162170[_0x4af27b][_0x4d00('0x68')];}}for(var _0x74dce4 in _0x499ce4){if(!_0x594397[_0x4d00('0x32')](_0x499ce4[_0x74dce4])){_0x594397[_0x499ce4[_0x74dce4]]=null;}}_0x1f5e4c[_0x4d00('0x69')](_0x594397);}return _0x1f5e4c;}})[_0x4d00('0x1f')](function(_0x597aff){if(!_[_0x4d00('0x6a')](_0x597aff)){var _0x80c016=toCsv(_0x597aff);var _0x4b933a=Date[_0x4d00('0x6b')]();fs[_0x4d00('0x6c')](util[_0x4d00('0x65')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x325dc5[_0x4d00('0x41')]['id'],_0x4b933a),_0x80c016);_0x40a8c4[_0x4d00('0x6d')](_0x4d00('0x6e'),_0x4d00('0x6f')+util[_0x4d00('0x65')](_0x4d00('0x70'),_0x325dc5[_0x4d00('0x41')]['id'],_0x4b933a));_0x40a8c4[_0x4d00('0x6d')](_0x4d00('0x71'),_0x4d00('0x72'));return _0x40a8c4[_0x4d00('0x73')](util[_0x4d00('0x65')](_0x4d00('0x74'),_0x325dc5[_0x4d00('0x41')]['id'],_0x4b933a));}else{return _0x40a8c4['sendStatus'](0xcc);}})[_0x4d00('0x3f')](handleError(_0x40a8c4,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index e04109f..06f171e 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 _0x56a4=['./jscriptyProject.attributes','exports','jscripty_projects','lodash','util','api','moment','path','rimraf','../../config/environment'];(function(_0x3b7b13,_0x170789){var _0x3b5148=function(_0x2ebf81){while(--_0x2ebf81){_0x3b7b13['push'](_0x3b7b13['shift']());}};_0x3b5148(++_0x170789);}(_0x56a4,0x11b));var _0x456a=function(_0xfd7cb3,_0x7f7744){_0xfd7cb3=_0xfd7cb3-0x0;var _0x4a7f70=_0x56a4[_0xfd7cb3];return _0x4a7f70;};'use strict';var _=require(_0x456a('0x0'));var util=require(_0x456a('0x1'));var logger=require('../../config/logger')(_0x456a('0x2'));var moment=require(_0x456a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x456a('0x4'));var rimraf=require(_0x456a('0x5'));var config=require(_0x456a('0x6'));var attributes=require(_0x456a('0x7'));module[_0x456a('0x8')]=function(_0x4b8eec,_0x3b0145){return _0x4b8eec['define']('JscriptyProject',attributes,{'tableName':_0x456a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x41d9=['../../config/environment','exports','define','jscripty_projects','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x15f6a4,_0x133a91){var _0x1e403f=function(_0x327596){while(--_0x327596){_0x15f6a4['push'](_0x15f6a4['shift']());}};_0x1e403f(++_0x133a91);}(_0x41d9,0x13c));var _0x941d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41d9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x941d('0x0'));var util=require(_0x941d('0x1'));var logger=require(_0x941d('0x2'))(_0x941d('0x3'));var moment=require(_0x941d('0x4'));var BPromise=require(_0x941d('0x5'));var rp=require(_0x941d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x941d('0x7'));var config=require(_0x941d('0x8'));var attributes=require('./jscriptyProject.attributes');module[_0x941d('0x9')]=function(_0x19dd41,_0x56e384){return _0x19dd41[_0x941d('0xa')]('JscriptyProject',attributes,{'tableName':_0x941d('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 39fb1a9..a6a0213 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 _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s'];(function(_0x3033f5,_0x11d8f4){var _0x57a7f5=function(_0x2a6e50){while(--_0x2a6e50){_0x3033f5['push'](_0x3033f5['shift']());}};_0x57a7f5(++_0x11d8f4);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x44a64f,_0x38475c){_0x44a64f=_0x44a64f-0x0;var _0x52024b=_0xcb91[_0x44a64f];return _0x52024b;};'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')]('JscriptyProject,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file +var _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptyProject,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x5e7cdf,_0xdeff97){var _0x1ab319=function(_0x37b2ed){while(--_0x37b2ed){_0x5e7cdf['push'](_0x5e7cdf['shift']());}};_0x1ab319(++_0xdeff97);}(_0xb43b,0x1b2));var _0xbb43=function(_0xda3748,_0x5b2a30){_0xda3748=_0xda3748-0x0;var _0x569eb1=_0xb43b[_0xda3748];return _0x569eb1;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 03a8c1c..367d2e3 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 _0x4342=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','create','put','delete','destroy','multer','util'];(function(_0x250d30,_0x47671e){var _0x55326a=function(_0xde3c2){while(--_0xde3c2){_0x250d30['push'](_0x250d30['shift']());}};_0x55326a(++_0x47671e);}(_0x4342,0x1a2));var _0x2434=function(_0x349915,_0x124261){_0x349915=_0x349915-0x0;var _0x8be4f3=_0x4342[_0x349915];return _0x8be4f3;};'use strict';var multer=require(_0x2434('0x0'));var util=require(_0x2434('0x1'));var path=require('path');var timeout=require(_0x2434('0x2'));var express=require(_0x2434('0x3'));var router=express[_0x2434('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2434('0x5'));var interaction=require(_0x2434('0x6'));var config=require(_0x2434('0x7'));var controller=require(_0x2434('0x8'));router['get']('/',auth[_0x2434('0x9')](),controller[_0x2434('0xa')]);router[_0x2434('0xb')](_0x2434('0xc'),auth[_0x2434('0x9')](),controller[_0x2434('0xd')]);router['get'](_0x2434('0xe'),auth['isAuthenticated'](),controller[_0x2434('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2434('0x10')]);router[_0x2434('0x11')](_0x2434('0xe'),auth[_0x2434('0x9')](),controller['update']);router[_0x2434('0x12')]('/:id',auth[_0x2434('0x9')](),controller[_0x2434('0x13')]);module['exports']=router; \ No newline at end of file +var _0x5d73=['delete','/:id','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','create','put','update'];(function(_0x83b36f,_0x36f797){var _0x3a2c15=function(_0x5d2788){while(--_0x5d2788){_0x83b36f['push'](_0x83b36f['shift']());}};_0x3a2c15(++_0x36f797);}(_0x5d73,0x1a2));var _0x35d7=function(_0xdb7f0b,_0x5dafae){_0xdb7f0b=_0xdb7f0b-0x0;var _0x279d9e=_0x5d73[_0xdb7f0b];return _0x279d9e;};'use strict';var multer=require('multer');var util=require(_0x35d7('0x0'));var path=require(_0x35d7('0x1'));var timeout=require('connect-timeout');var express=require(_0x35d7('0x2'));var router=express[_0x35d7('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x35d7('0x4'));var interaction=require(_0x35d7('0x5'));var config=require('../../config/environment');var controller=require(_0x35d7('0x6'));router[_0x35d7('0x7')]('/',auth[_0x35d7('0x8')](),controller[_0x35d7('0x9')]);router[_0x35d7('0x7')](_0x35d7('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x35d7('0x7')]('/:id',auth[_0x35d7('0x8')](),controller['show']);router['post']('/',auth[_0x35d7('0x8')](),controller[_0x35d7('0xb')]);router[_0x35d7('0xc')]('/:id',auth[_0x35d7('0x8')](),controller[_0x35d7('0xd')]);router[_0x35d7('0xe')](_0x35d7('0xf'),auth[_0x35d7('0x8')](),controller[_0x35d7('0x10')]);module[_0x35d7('0x11')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 0cf6546..da2d8fb 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(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x7a54,0x106));var _0x47a5=function(_0x404ac5,_0x26177c){_0x404ac5=_0x404ac5-0x0;var _0x29db65=_0x7a54[_0x404ac5];return _0x29db65;};'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(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x7a54,0x106));var _0x47a5=function(_0x63b26d,_0x4e8967){_0x63b26d=_0x63b26d-0x0;var _0x20ae62=_0x7a54[_0x63b26d];return _0x20ae62;};'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 e405e6f..2cd3613 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 _0x66b1=['sendStatus','end','offset','limit','undefined','count','status','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','map','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','JscriptyQuestionReport','length','find','create','body','describe','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','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x137eb5,_0x432213){var _0x42b524=function(_0x3b1ed9){while(--_0x3b1ed9){_0x137eb5['push'](_0x137eb5['shift']());}};_0x42b524(++_0x432213);}(_0x66b1,0xce));var _0x166b=function(_0x18e101,_0x9f0cec){_0x18e101=_0x18e101-0x0;var _0x28ed5d=_0x66b1[_0x18e101];return _0x28ed5d;};'use strict';var emlformat=require(_0x166b('0x0'));var rimraf=require(_0x166b('0x1'));var zipdir=require(_0x166b('0x2'));var jsonpatch=require(_0x166b('0x3'));var rp=require(_0x166b('0x4'));var moment=require(_0x166b('0x5'));var BPromise=require(_0x166b('0x6'));var Mustache=require(_0x166b('0x7'));var util=require(_0x166b('0x8'));var path=require(_0x166b('0x9'));var sox=require(_0x166b('0xa'));var csv=require(_0x166b('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x166b('0xc'));var _=require(_0x166b('0xd'));var squel=require(_0x166b('0xe'));var crypto=require(_0x166b('0xf'));var jsforce=require(_0x166b('0x10'));var deskjs=require(_0x166b('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x166b('0x12'));var Redis=require(_0x166b('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x166b('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x166b('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x166b('0x16'));var licenseUtil=require(_0x166b('0x17'));var db=require(_0x166b('0x18'))['db'];function respondWithStatusCode(_0x145652,_0x1bb175){_0x1bb175=_0x1bb175||0xcc;return function(_0x415a81){if(_0x415a81){return _0x145652[_0x166b('0x19')](_0x1bb175);}return _0x145652['status'](_0x1bb175)[_0x166b('0x1a')]();};}function respondWithResult(_0xcf81f5,_0x2797e5){_0x2797e5=_0x2797e5||0xc8;return function(_0x1b37cf){if(_0x1b37cf){return _0xcf81f5['status'](_0x2797e5)['json'](_0x1b37cf);}};}function respondWithFilteredResult(_0x40281e,_0x205ac9){return function(_0x4b2e8e){if(_0x4b2e8e){var _0x3a1537=typeof _0x205ac9[_0x166b('0x1b')]==='undefined'&&typeof _0x205ac9[_0x166b('0x1c')]===_0x166b('0x1d');var _0x27b461=_0x4b2e8e[_0x166b('0x1e')];var _0x4afc62=_0x3a1537?0x0:_0x205ac9[_0x166b('0x1b')];var _0x2a13e4=_0x3a1537?_0x4b2e8e['count']:_0x205ac9[_0x166b('0x1b')]+_0x205ac9[_0x166b('0x1c')];var _0x4b6fc;if(_0x2a13e4>=_0x27b461){_0x2a13e4=_0x27b461;_0x4b6fc=0xc8;}else{_0x4b6fc=0xce;}_0x40281e[_0x166b('0x1f')](_0x4b6fc);return _0x40281e[_0x166b('0x20')]('Content-Range',_0x4afc62+'-'+_0x2a13e4+'/'+_0x27b461)[_0x166b('0x21')](_0x4b2e8e);}return null;};}function patchUpdates(_0x53612d){return function(_0x215ecf){try{jsonpatch[_0x166b('0x22')](_0x215ecf,_0x53612d,!![]);}catch(_0x307c87){return BPromise[_0x166b('0x23')](_0x307c87);}return _0x215ecf[_0x166b('0x24')]();};}function saveUpdates(_0x1d8a23,_0x528b3b){return function(_0x73baae){if(_0x73baae){return _0x73baae[_0x166b('0x25')](_0x1d8a23)[_0x166b('0x26')](function(_0x20fb10){return _0x20fb10;});}return null;};}function removeEntity(_0x230b74,_0x4f96a3){return function(_0x6c5e11){if(_0x6c5e11){return _0x6c5e11[_0x166b('0x27')]()[_0x166b('0x26')](function(){_0x230b74[_0x166b('0x1f')](0xcc)[_0x166b('0x1a')]();});}};}function handleEntityNotFound(_0x191529,_0x3005fd){return function(_0x5e08a9){if(!_0x5e08a9){_0x191529['sendStatus'](0x194);}return _0x5e08a9;};}function handleError(_0x628e17,_0xe3d34b){_0xe3d34b=_0xe3d34b||0x1f4;return function(_0xbe2710){logger[_0x166b('0x28')](_0xbe2710[_0x166b('0x29')]);if(_0xbe2710[_0x166b('0x2a')]){delete _0xbe2710[_0x166b('0x2a')];}_0x628e17[_0x166b('0x1f')](_0xe3d34b)[_0x166b('0x2b')](_0xbe2710);};}exports['index']=function(_0xebf10d,_0x12089f){var _0x183fcd={},_0x185061={},_0x4e002f={'count':0x0,'rows':[]};var _0xb8411a=_[_0x166b('0x2c')](db['JscriptyQuestionReport']['rawAttributes'],function(_0x307a83){return{'name':_0x307a83[_0x166b('0x2d')],'type':_0x307a83[_0x166b('0x2e')][_0x166b('0x2f')]};});_0x185061[_0x166b('0x30')]=_[_0x166b('0x2c')](_0xb8411a,_0x166b('0x2a'));_0x185061[_0x166b('0x31')]=_[_0x166b('0x32')](_0xebf10d[_0x166b('0x31')]);_0x185061['filters']=_['intersection'](_0x185061[_0x166b('0x30')],_0x185061['query']);_0x183fcd['attributes']=_[_0x166b('0x33')](_0x185061[_0x166b('0x30')],qs['fields'](_0xebf10d[_0x166b('0x31')][_0x166b('0x34')]));_0x183fcd[_0x166b('0x35')]=_0x183fcd[_0x166b('0x35')]['length']?_0x183fcd[_0x166b('0x35')]:_0x185061[_0x166b('0x30')];if(!_0xebf10d['query'][_0x166b('0x36')](_0x166b('0x37'))){_0x183fcd[_0x166b('0x1c')]=qs['limit'](_0xebf10d[_0x166b('0x31')]['limit']);_0x183fcd[_0x166b('0x1b')]=qs[_0x166b('0x1b')](_0xebf10d[_0x166b('0x31')][_0x166b('0x1b')]);}_0x183fcd[_0x166b('0x38')]=qs[_0x166b('0x39')](_0xebf10d[_0x166b('0x31')][_0x166b('0x39')]);_0x183fcd[_0x166b('0x3a')]=qs['filters'](_[_0x166b('0x3b')](_0xebf10d['query'],_0x185061[_0x166b('0x3c')]),_0xb8411a);if(_0xebf10d['query'][_0x166b('0x3d')]){_0x183fcd[_0x166b('0x3a')]=_[_0x166b('0x3e')](_0x183fcd[_0x166b('0x3a')],{'$or':_[_0x166b('0x2c')](_0xb8411a,function(_0xb9dd78){if(_0xb9dd78[_0x166b('0x2e')]!==_0x166b('0x3f')){var _0x20009f={};_0x20009f[_0xb9dd78[_0x166b('0x2a')]]={'$like':'%'+_0xebf10d[_0x166b('0x31')][_0x166b('0x3d')]+'%'};return _0x20009f;}})});}_0x183fcd=_[_0x166b('0x3e')]({},_0x183fcd,_0xebf10d[_0x166b('0x40')]);var _0x2f64ae={'where':_0x183fcd['where']};return db['JscriptyQuestionReport']['count'](_0x2f64ae)['then'](function(_0x5b9cac){_0x4e002f[_0x166b('0x1e')]=_0x5b9cac;if(_0xebf10d[_0x166b('0x31')][_0x166b('0x41')]){_0x183fcd[_0x166b('0x42')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x166b('0x43')](_0x183fcd);})[_0x166b('0x26')](function(_0x41852b){_0x4e002f['rows']=_0x41852b;return _0x4e002f;})['then'](respondWithFilteredResult(_0x12089f,_0x183fcd))[_0x166b('0x44')](handleError(_0x12089f,null));};exports[_0x166b('0x45')]=function(_0xe5620f,_0x2a04eb){var _0x309daf={'raw':!![],'where':{'id':_0xe5620f[_0x166b('0x46')]['id']}},_0x13e4fa={};_0x13e4fa['model']=_['keys'](db[_0x166b('0x47')]['rawAttributes']);_0x13e4fa[_0x166b('0x31')]=_[_0x166b('0x32')](_0xe5620f[_0x166b('0x31')]);_0x13e4fa[_0x166b('0x3c')]=_['intersection'](_0x13e4fa[_0x166b('0x30')],_0x13e4fa[_0x166b('0x31')]);_0x309daf[_0x166b('0x35')]=_[_0x166b('0x33')](_0x13e4fa[_0x166b('0x30')],qs[_0x166b('0x34')](_0xe5620f[_0x166b('0x31')][_0x166b('0x34')]));_0x309daf[_0x166b('0x35')]=_0x309daf[_0x166b('0x35')][_0x166b('0x48')]?_0x309daf[_0x166b('0x35')]:_0x13e4fa['model'];if(_0xe5620f[_0x166b('0x31')][_0x166b('0x41')]){_0x309daf[_0x166b('0x42')]=[{'all':!![]}];}_0x309daf=_[_0x166b('0x3e')]({},_0x309daf,_0xe5620f[_0x166b('0x40')]);return db[_0x166b('0x47')][_0x166b('0x49')](_0x309daf)[_0x166b('0x26')](handleEntityNotFound(_0x2a04eb,null))[_0x166b('0x26')](respondWithResult(_0x2a04eb,null))[_0x166b('0x44')](handleError(_0x2a04eb,null));};exports['create']=function(_0x473224,_0x1e4d12){return db[_0x166b('0x47')][_0x166b('0x4a')](_0x473224['body'],{})[_0x166b('0x26')](respondWithResult(_0x1e4d12,0xc9))[_0x166b('0x44')](handleError(_0x1e4d12,null));};exports['update']=function(_0x1578b2,_0x2ccc2c){if(_0x1578b2[_0x166b('0x4b')]['id']){delete _0x1578b2[_0x166b('0x4b')]['id'];}return db['JscriptyQuestionReport'][_0x166b('0x49')]({'where':{'id':_0x1578b2[_0x166b('0x46')]['id']}})['then'](handleEntityNotFound(_0x2ccc2c,null))[_0x166b('0x26')](saveUpdates(_0x1578b2[_0x166b('0x4b')],null))[_0x166b('0x26')](respondWithResult(_0x2ccc2c,null))['catch'](handleError(_0x2ccc2c,null));};exports['destroy']=function(_0xe923a1,_0x468f05){return db[_0x166b('0x47')][_0x166b('0x49')]({'where':{'id':_0xe923a1[_0x166b('0x46')]['id']}})['then'](handleEntityNotFound(_0x468f05,null))['then'](removeEntity(_0x468f05,null))[_0x166b('0x44')](handleError(_0x468f05,null));};exports[_0x166b('0x4c')]=function(_0x19ebd3,_0x46009d){return db[_0x166b('0x47')][_0x166b('0x4c')]()[_0x166b('0x26')](respondWithResult(_0x46009d,null))[_0x166b('0x44')](handleError(_0x46009d,null));}; \ No newline at end of file +var _0x00e5=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','count','Content-Range','apply','save','update','destroy','then','end','sendStatus','error','stack','name','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','JscriptyQuestionReport','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','eml-format','rimraf','zip-dir'];(function(_0x2eb03e,_0x78c7b0){var _0x30773c=function(_0x55c6dc){while(--_0x55c6dc){_0x2eb03e['push'](_0x2eb03e['shift']());}};_0x30773c(++_0x78c7b0);}(_0x00e5,0x8d));var _0x500e=function(_0x3f637c,_0x2f6cc0){_0x3f637c=_0x3f637c-0x0;var _0xfae5d9=_0x00e5[_0x3f637c];return _0xfae5d9;};'use strict';var emlformat=require(_0x500e('0x0'));var rimraf=require(_0x500e('0x1'));var zipdir=require(_0x500e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x500e('0x3'));var moment=require(_0x500e('0x4'));var BPromise=require(_0x500e('0x5'));var Mustache=require(_0x500e('0x6'));var util=require(_0x500e('0x7'));var path=require(_0x500e('0x8'));var sox=require(_0x500e('0x9'));var csv=require(_0x500e('0xa'));var ejs=require(_0x500e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x500e('0xc'));var crypto=require(_0x500e('0xd'));var jsforce=require(_0x500e('0xe'));var deskjs=require(_0x500e('0xf'));var toCsv=require(_0x500e('0xa'));var querystring=require(_0x500e('0x10'));var Papa=require('papaparse');var Redis=require(_0x500e('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x500e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x500e('0x13'));var utils=require('../../config/utils');var config=require(_0x500e('0x14'));var licenseUtil=require(_0x500e('0x15'));var db=require(_0x500e('0x16'))['db'];function respondWithStatusCode(_0x3845d0,_0x30a261){_0x30a261=_0x30a261||0xcc;return function(_0x1f0efb){if(_0x1f0efb){return _0x3845d0['sendStatus'](_0x30a261);}return _0x3845d0[_0x500e('0x17')](_0x30a261)['end']();};}function respondWithResult(_0x380bf1,_0x3fe113){_0x3fe113=_0x3fe113||0xc8;return function(_0x36c9b8){if(_0x36c9b8){return _0x380bf1[_0x500e('0x17')](_0x3fe113)[_0x500e('0x18')](_0x36c9b8);}};}function respondWithFilteredResult(_0x118beb,_0xd06cb1){return function(_0x17016a){if(_0x17016a){var _0x3275b1=typeof _0xd06cb1[_0x500e('0x19')]==='undefined'&&typeof _0xd06cb1[_0x500e('0x1a')]==='undefined';var _0x2d621d=_0x17016a['count'];var _0x5b7362=_0x3275b1?0x0:_0xd06cb1[_0x500e('0x19')];var _0x2f256c=_0x3275b1?_0x17016a[_0x500e('0x1b')]:_0xd06cb1[_0x500e('0x19')]+_0xd06cb1[_0x500e('0x1a')];var _0x455053;if(_0x2f256c>=_0x2d621d){_0x2f256c=_0x2d621d;_0x455053=0xc8;}else{_0x455053=0xce;}_0x118beb[_0x500e('0x17')](_0x455053);return _0x118beb['set'](_0x500e('0x1c'),_0x5b7362+'-'+_0x2f256c+'/'+_0x2d621d)['json'](_0x17016a);}return null;};}function patchUpdates(_0x101731){return function(_0x36e69c){try{jsonpatch[_0x500e('0x1d')](_0x36e69c,_0x101731,!![]);}catch(_0x14866a){return BPromise['reject'](_0x14866a);}return _0x36e69c[_0x500e('0x1e')]();};}function saveUpdates(_0x2cb7b5,_0x484664){return function(_0x366b17){if(_0x366b17){return _0x366b17[_0x500e('0x1f')](_0x2cb7b5)['then'](function(_0x3ed53f){return _0x3ed53f;});}return null;};}function removeEntity(_0x280999,_0x1fa28b){return function(_0x40028f){if(_0x40028f){return _0x40028f[_0x500e('0x20')]()[_0x500e('0x21')](function(){_0x280999[_0x500e('0x17')](0xcc)[_0x500e('0x22')]();});}};}function handleEntityNotFound(_0x562591,_0x1346a3){return function(_0x57ae48){if(!_0x57ae48){_0x562591[_0x500e('0x23')](0x194);}return _0x57ae48;};}function handleError(_0x4b8d4c,_0x3dc7ce){_0x3dc7ce=_0x3dc7ce||0x1f4;return function(_0x4ca271){logger[_0x500e('0x24')](_0x4ca271[_0x500e('0x25')]);if(_0x4ca271[_0x500e('0x26')]){delete _0x4ca271[_0x500e('0x26')];}_0x4b8d4c['status'](_0x3dc7ce)['send'](_0x4ca271);};}exports[_0x500e('0x27')]=function(_0x413170,_0x5c07ae){var _0x48d7ed={},_0x3d6ed5={},_0x1dfe4={'count':0x0,'rows':[]};var _0x10ecf4=_[_0x500e('0x28')](db['JscriptyQuestionReport']['rawAttributes'],function(_0x339bfd){return{'name':_0x339bfd[_0x500e('0x29')],'type':_0x339bfd[_0x500e('0x2a')][_0x500e('0x2b')]};});_0x3d6ed5[_0x500e('0x2c')]=_[_0x500e('0x28')](_0x10ecf4,'name');_0x3d6ed5[_0x500e('0x2d')]=_[_0x500e('0x2e')](_0x413170['query']);_0x3d6ed5[_0x500e('0x2f')]=_[_0x500e('0x30')](_0x3d6ed5[_0x500e('0x2c')],_0x3d6ed5[_0x500e('0x2d')]);_0x48d7ed['attributes']=_['intersection'](_0x3d6ed5[_0x500e('0x2c')],qs[_0x500e('0x31')](_0x413170['query']['fields']));_0x48d7ed[_0x500e('0x32')]=_0x48d7ed[_0x500e('0x32')][_0x500e('0x33')]?_0x48d7ed['attributes']:_0x3d6ed5['model'];if(!_0x413170[_0x500e('0x2d')][_0x500e('0x34')](_0x500e('0x35'))){_0x48d7ed[_0x500e('0x1a')]=qs[_0x500e('0x1a')](_0x413170['query'][_0x500e('0x1a')]);_0x48d7ed['offset']=qs[_0x500e('0x19')](_0x413170[_0x500e('0x2d')][_0x500e('0x19')]);}_0x48d7ed[_0x500e('0x36')]=qs[_0x500e('0x37')](_0x413170[_0x500e('0x2d')]['sort']);_0x48d7ed[_0x500e('0x38')]=qs[_0x500e('0x2f')](_[_0x500e('0x39')](_0x413170[_0x500e('0x2d')],_0x3d6ed5[_0x500e('0x2f')]),_0x10ecf4);if(_0x413170[_0x500e('0x2d')][_0x500e('0x3a')]){_0x48d7ed[_0x500e('0x38')]=_[_0x500e('0x3b')](_0x48d7ed['where'],{'$or':_[_0x500e('0x28')](_0x10ecf4,function(_0x59ed54){if(_0x59ed54['type']!=='VIRTUAL'){var _0xf0855a={};_0xf0855a[_0x59ed54[_0x500e('0x26')]]={'$like':'%'+_0x413170[_0x500e('0x2d')][_0x500e('0x3a')]+'%'};return _0xf0855a;}})});}_0x48d7ed=_[_0x500e('0x3b')]({},_0x48d7ed,_0x413170['options']);var _0x189f49={'where':_0x48d7ed[_0x500e('0x38')]};return db[_0x500e('0x3c')][_0x500e('0x1b')](_0x189f49)[_0x500e('0x21')](function(_0x280e57){_0x1dfe4[_0x500e('0x1b')]=_0x280e57;if(_0x413170[_0x500e('0x2d')][_0x500e('0x3d')]){_0x48d7ed[_0x500e('0x3e')]=[{'all':!![]}];}return db[_0x500e('0x3c')][_0x500e('0x3f')](_0x48d7ed);})['then'](function(_0x109627){_0x1dfe4[_0x500e('0x40')]=_0x109627;return _0x1dfe4;})[_0x500e('0x21')](respondWithFilteredResult(_0x5c07ae,_0x48d7ed))[_0x500e('0x41')](handleError(_0x5c07ae,null));};exports[_0x500e('0x42')]=function(_0x68712d,_0x310f19){var _0x1c3673={'raw':!![],'where':{'id':_0x68712d[_0x500e('0x43')]['id']}},_0x72332f={};_0x72332f[_0x500e('0x2c')]=_[_0x500e('0x2e')](db[_0x500e('0x3c')]['rawAttributes']);_0x72332f[_0x500e('0x2d')]=_['keys'](_0x68712d[_0x500e('0x2d')]);_0x72332f[_0x500e('0x2f')]=_[_0x500e('0x30')](_0x72332f[_0x500e('0x2c')],_0x72332f[_0x500e('0x2d')]);_0x1c3673[_0x500e('0x32')]=_[_0x500e('0x30')](_0x72332f[_0x500e('0x2c')],qs[_0x500e('0x31')](_0x68712d['query'][_0x500e('0x31')]));_0x1c3673['attributes']=_0x1c3673[_0x500e('0x32')][_0x500e('0x33')]?_0x1c3673[_0x500e('0x32')]:_0x72332f[_0x500e('0x2c')];if(_0x68712d[_0x500e('0x2d')]['includeAll']){_0x1c3673[_0x500e('0x3e')]=[{'all':!![]}];}_0x1c3673=_[_0x500e('0x3b')]({},_0x1c3673,_0x68712d['options']);return db[_0x500e('0x3c')]['find'](_0x1c3673)['then'](handleEntityNotFound(_0x310f19,null))[_0x500e('0x21')](respondWithResult(_0x310f19,null))[_0x500e('0x41')](handleError(_0x310f19,null));};exports[_0x500e('0x44')]=function(_0x43d2e0,_0x563957){return db[_0x500e('0x3c')][_0x500e('0x44')](_0x43d2e0[_0x500e('0x45')],{})['then'](respondWithResult(_0x563957,0xc9))[_0x500e('0x41')](handleError(_0x563957,null));};exports[_0x500e('0x1f')]=function(_0x4f1bf8,_0x1fdb75){if(_0x4f1bf8[_0x500e('0x45')]['id']){delete _0x4f1bf8[_0x500e('0x45')]['id'];}return db[_0x500e('0x3c')][_0x500e('0x46')]({'where':{'id':_0x4f1bf8[_0x500e('0x43')]['id']}})[_0x500e('0x21')](handleEntityNotFound(_0x1fdb75,null))[_0x500e('0x21')](saveUpdates(_0x4f1bf8['body'],null))[_0x500e('0x21')](respondWithResult(_0x1fdb75,null))['catch'](handleError(_0x1fdb75,null));};exports['destroy']=function(_0x3a658d,_0x13e01a){return db[_0x500e('0x3c')][_0x500e('0x46')]({'where':{'id':_0x3a658d[_0x500e('0x43')]['id']}})[_0x500e('0x21')](handleEntityNotFound(_0x13e01a,null))[_0x500e('0x21')](removeEntity(_0x13e01a,null))[_0x500e('0x41')](handleError(_0x13e01a,null));};exports[_0x500e('0x47')]=function(_0x421251,_0x199c2a){return db[_0x500e('0x3c')][_0x500e('0x47')]()['then'](respondWithResult(_0x199c2a,null))[_0x500e('0x41')](handleError(_0x199c2a,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index a53fa5f..3248fbb 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 _0xaf16=['request-promise','path','./jscriptyQuestionReport.attributes','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','api','moment','bluebird'];(function(_0x310793,_0x26e9ee){var _0x59c37e=function(_0x471ef7){while(--_0x471ef7){_0x310793['push'](_0x310793['shift']());}};_0x59c37e(++_0x26e9ee);}(_0xaf16,0xed));var _0x6af1=function(_0x58a4fe,_0x11d439){_0x58a4fe=_0x58a4fe-0x0;var _0x697de2=_0xaf16[_0x58a4fe];return _0x697de2;};'use strict';var _=require(_0x6af1('0x0'));var util=require(_0x6af1('0x1'));var logger=require('../../config/logger')(_0x6af1('0x2'));var moment=require(_0x6af1('0x3'));var BPromise=require(_0x6af1('0x4'));var rp=require(_0x6af1('0x5'));var fs=require('fs');var path=require(_0x6af1('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6af1('0x7'));module['exports']=function(_0x8eccf9,_0x4b5a4d){return _0x8eccf9[_0x6af1('0x8')](_0x6af1('0x9'),attributes,{'tableName':_0x6af1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x90ac=['../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','moment','bluebird','request-promise','rimraf'];(function(_0x1ce800,_0xc790de){var _0x34c576=function(_0x2998cd){while(--_0x2998cd){_0x1ce800['push'](_0x1ce800['shift']());}};_0x34c576(++_0xc790de);}(_0x90ac,0x15b));var _0xc90a=function(_0x3c4171,_0x18c1bb){_0x3c4171=_0x3c4171-0x0;var _0x1afa85=_0x90ac[_0x3c4171];return _0x1afa85;};'use strict';var _=require(_0xc90a('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xc90a('0x1'));var BPromise=require(_0xc90a('0x2'));var rp=require(_0xc90a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc90a('0x4'));var config=require(_0xc90a('0x5'));var attributes=require(_0xc90a('0x6'));module[_0xc90a('0x7')]=function(_0x10ec13,_0x2b341d){return _0x10ec13[_0xc90a('0x8')](_0xc90a('0x9'),attributes,{'tableName':_0xc90a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 1e284fb..37e2f12 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 _0xaa64=['../../config/logger','../../config/environment','jayson/promise','then','info','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x4286ad,_0x5a99ed){var _0x4382d3=function(_0xdc43a8){while(--_0xdc43a8){_0x4286ad['push'](_0x4286ad['shift']());}};_0x4382d3(++_0x5a99ed);}(_0xaa64,0xe0));var _0x4aa6=function(_0x1a6422,_0x18db7a){_0x1a6422=_0x1a6422-0x0;var _0x3a9818=_0xaa64[_0x1a6422];return _0x3a9818;};'use strict';var _=require(_0x4aa6('0x0'));var util=require(_0x4aa6('0x1'));var moment=require(_0x4aa6('0x2'));var BPromise=require(_0x4aa6('0x3'));var rs=require(_0x4aa6('0x4'));var fs=require('fs');var Redis=require(_0x4aa6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4aa6('0x6'));var logger=require(_0x4aa6('0x7'))('rpc');var config=require(_0x4aa6('0x8'));var jayson=require(_0x4aa6('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x20d198,_0x156bc7,_0x5badaf){return new BPromise(function(_0x392f81,_0x1c0c1a){return client['request'](_0x20d198,_0x5badaf)[_0x4aa6('0xa')](function(_0x599375){logger[_0x4aa6('0xb')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x156bc7,_0x4aa6('0xc'));logger[_0x4aa6('0xd')](_0x4aa6('0xe'),_0x156bc7,_0x4aa6('0xc'),JSON[_0x4aa6('0xf')](_0x599375));if(_0x599375[_0x4aa6('0x10')]){if(_0x599375['error'][_0x4aa6('0x11')]===0x1f4){logger['error'](_0x4aa6('0x12'),_0x156bc7,_0x599375['error'][_0x4aa6('0x13')]);return _0x1c0c1a(_0x599375[_0x4aa6('0x10')]['message']);}logger[_0x4aa6('0x10')](_0x4aa6('0x12'),_0x156bc7,_0x599375['error']['message']);return _0x392f81(_0x599375[_0x4aa6('0x10')][_0x4aa6('0x13')]);}else{logger[_0x4aa6('0xb')](_0x4aa6('0x12'),_0x156bc7,_0x4aa6('0xc'));_0x392f81(_0x599375[_0x4aa6('0x14')][_0x4aa6('0x13')]);}})['catch'](function(_0x770423){logger[_0x4aa6('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x156bc7,_0x770423);_0x1c0c1a(_0x770423);});});} \ No newline at end of file +var _0xedc7=['request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2cfe01,_0x7b24ea){var _0x1faa10=function(_0x2e30e0){while(--_0x2e30e0){_0x2cfe01['push'](_0x2cfe01['shift']());}};_0x1faa10(++_0x7b24ea);}(_0xedc7,0x1c4));var _0x7edc=function(_0x4bb689,_0x9741eb){_0x4bb689=_0x4bb689-0x0;var _0x4cd033=_0xedc7[_0x4bb689];return _0x4cd033;};'use strict';var _=require(_0x7edc('0x0'));var util=require(_0x7edc('0x1'));var moment=require(_0x7edc('0x2'));var BPromise=require(_0x7edc('0x3'));var rs=require(_0x7edc('0x4'));var fs=require('fs');var Redis=require(_0x7edc('0x5'));var db=require(_0x7edc('0x6'))['db'];var utils=require(_0x7edc('0x7'));var logger=require(_0x7edc('0x8'))(_0x7edc('0x9'));var config=require(_0x7edc('0xa'));var jayson=require(_0x7edc('0xb'));var client=jayson[_0x7edc('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45b73f,_0x2587ee,_0x35370f){return new BPromise(function(_0x515102,_0x53c413){return client[_0x7edc('0xd')](_0x45b73f,_0x35370f)[_0x7edc('0xe')](function(_0x4513f7){logger[_0x7edc('0xf')](_0x7edc('0x10'),_0x2587ee,'request\x20sent');logger[_0x7edc('0x11')](_0x7edc('0x12'),_0x2587ee,'request\x20sent',JSON[_0x7edc('0x13')](_0x4513f7));if(_0x4513f7[_0x7edc('0x14')]){if(_0x4513f7[_0x7edc('0x14')][_0x7edc('0x15')]===0x1f4){logger[_0x7edc('0x14')](_0x7edc('0x10'),_0x2587ee,_0x4513f7[_0x7edc('0x14')][_0x7edc('0x16')]);return _0x53c413(_0x4513f7['error']['message']);}logger['error'](_0x7edc('0x10'),_0x2587ee,_0x4513f7[_0x7edc('0x14')][_0x7edc('0x16')]);return _0x515102(_0x4513f7['error'][_0x7edc('0x16')]);}else{logger['info'](_0x7edc('0x10'),_0x2587ee,_0x7edc('0x17'));_0x515102(_0x4513f7['result'][_0x7edc('0x16')]);}})[_0x7edc('0x18')](function(_0x185fcd){logger[_0x7edc('0x14')](_0x7edc('0x10'),_0x2587ee,_0x185fcd);_0x53c413(_0x185fcd);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 69147d1..d25b1ac 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 _0x553e=['./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','show','/:id/questions','getQuestions','post','create','put','/:id','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x58834c,_0x39d243){var _0x1c5888=function(_0x5ee3a4){while(--_0x5ee3a4){_0x58834c['push'](_0x58834c['shift']());}};_0x1c5888(++_0x39d243);}(_0x553e,0x1bf));var _0xe553=function(_0x13bbaa,_0x492b0f){_0x13bbaa=_0x13bbaa-0x0;var _0x1c0e3c=_0x553e[_0x13bbaa];return _0x1c0e3c;};'use strict';var multer=require(_0xe553('0x0'));var util=require(_0xe553('0x1'));var path=require(_0xe553('0x2'));var timeout=require(_0xe553('0x3'));var express=require(_0xe553('0x4'));var router=express['Router']();var fs_extra=require(_0xe553('0x5'));var auth=require(_0xe553('0x6'));var interaction=require(_0xe553('0x7'));var config=require(_0xe553('0x8'));var controller=require(_0xe553('0x9'));router[_0xe553('0xa')]('/',auth[_0xe553('0xb')](),controller[_0xe553('0xc')]);router[_0xe553('0xa')](_0xe553('0xd'),auth['isAuthenticated'](),controller[_0xe553('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xe553('0xf')]);router[_0xe553('0xa')](_0xe553('0x10'),auth[_0xe553('0xb')](),controller[_0xe553('0x11')]);router[_0xe553('0x12')]('/',auth[_0xe553('0xb')](),controller[_0xe553('0x13')]);router[_0xe553('0x14')](_0xe553('0x15'),auth['isAuthenticated'](),controller['update']);router[_0xe553('0x16')]('/:id',auth[_0xe553('0xb')](),controller['destroy']);module[_0xe553('0x17')]=router; \ No newline at end of file +var _0x2e56=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','show','/:id/questions','getQuestions','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout'];(function(_0x51308d,_0x42cf02){var _0x37cde8=function(_0x527de4){while(--_0x527de4){_0x51308d['push'](_0x51308d['shift']());}};_0x37cde8(++_0x42cf02);}(_0x2e56,0x92));var _0x62e5=function(_0x2efe86,_0x4b6c3f){_0x2efe86=_0x2efe86-0x0;var _0x48e01c=_0x2e56[_0x2efe86];return _0x48e01c;};'use strict';var multer=require(_0x62e5('0x0'));var util=require(_0x62e5('0x1'));var path=require(_0x62e5('0x2'));var timeout=require(_0x62e5('0x3'));var express=require(_0x62e5('0x4'));var router=express[_0x62e5('0x5')]();var fs_extra=require(_0x62e5('0x6'));var auth=require(_0x62e5('0x7'));var interaction=require(_0x62e5('0x8'));var config=require(_0x62e5('0x9'));var controller=require(_0x62e5('0xa'));router[_0x62e5('0xb')]('/',auth[_0x62e5('0xc')](),controller[_0x62e5('0xd')]);router[_0x62e5('0xb')](_0x62e5('0xe'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x62e5('0xf')]);router['get'](_0x62e5('0x10'),auth[_0x62e5('0xc')](),controller[_0x62e5('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x62e5('0x12')]);router[_0x62e5('0x13')]('/:id',auth[_0x62e5('0xc')](),controller[_0x62e5('0x14')]);router[_0x62e5('0x15')](_0x62e5('0x16'),auth['isAuthenticated'](),controller[_0x62e5('0x17')]);module[_0x62e5('0x18')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index ac0c777..df040fd 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 _0x2e17=['moment','sequelize','DATE','setDataValue','starttime','endtime','format','STRING'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0x2e17,0x98));var _0x72e1=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x2e17[_0x4b2863];return _0x567d67;};'use strict';var moment=require(_0x72e1('0x0'));var Sequelize=require(_0x72e1('0x1'));module['exports']={'starttime':{'type':Sequelize[_0x72e1('0x2')],'set':function(_0x4ac975){this[_0x72e1('0x3')](_0x72e1('0x4'),_0x4ac975);this['setDataValue'](_0x72e1('0x5'),moment()[_0x72e1('0x6')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x72e1('0x2')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x72e1('0x7')]},'queue':{'type':Sequelize[_0x72e1('0x7')]},'uniqueid':{'type':Sequelize[_0x72e1('0x7')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xb838=['BOOLEAN','moment','sequelize','exports','DATE','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING'];(function(_0x5a93b9,_0x120370){var _0x478ecb=function(_0x439c96){while(--_0x439c96){_0x5a93b9['push'](_0x5a93b9['shift']());}};_0x478ecb(++_0x120370);}(_0xb838,0x14b));var _0x8b83=function(_0xb75783,_0x4966e5){_0xb75783=_0xb75783-0x0;var _0x538881=_0xb838[_0xb75783];return _0x538881;};'use strict';var moment=require(_0x8b83('0x0'));var Sequelize=require(_0x8b83('0x1'));module[_0x8b83('0x2')]={'starttime':{'type':Sequelize[_0x8b83('0x3')],'set':function(_0x35fb99){this[_0x8b83('0x4')](_0x8b83('0x5'),_0x35fb99);this[_0x8b83('0x4')](_0x8b83('0x6'),moment()[_0x8b83('0x7')](_0x8b83('0x8')));}},'endtime':{'type':Sequelize[_0x8b83('0x3')]},'membername':{'type':Sequelize[_0x8b83('0x9')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x8b83('0x9')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x8b83('0x9')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x8b83('0xa')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 23b0ede..e82d5ba 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 _0x70be=['api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','JscriptySessionReport','find','create','body','destroy','describe','findOne','JscriptyQuestionReport','hasOwnProperty','SessionId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger'];(function(_0x69473,_0x1cbe33){var _0x50bff3=function(_0x241d54){while(--_0x241d54){_0x69473['push'](_0x69473['shift']());}};_0x50bff3(++_0x1cbe33);}(_0x70be,0x17c));var _0xe70b=function(_0x266328,_0x4ad34d){_0x266328=_0x266328-0x0;var _0x412d2a=_0x70be[_0x266328];return _0x412d2a;};'use strict';var emlformat=require(_0xe70b('0x0'));var rimraf=require(_0xe70b('0x1'));var zipdir=require(_0xe70b('0x2'));var jsonpatch=require(_0xe70b('0x3'));var rp=require(_0xe70b('0x4'));var moment=require('moment');var BPromise=require(_0xe70b('0x5'));var Mustache=require('mustache');var util=require(_0xe70b('0x6'));var path=require(_0xe70b('0x7'));var sox=require(_0xe70b('0x8'));var csv=require('to-csv');var ejs=require(_0xe70b('0x9'));var fs=require('fs');var fs_extra=require(_0xe70b('0xa'));var _=require(_0xe70b('0xb'));var squel=require(_0xe70b('0xc'));var crypto=require(_0xe70b('0xd'));var jsforce=require(_0xe70b('0xe'));var deskjs=require(_0xe70b('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe70b('0x10'));var Papa=require(_0xe70b('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe70b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe70b('0x13'))(_0xe70b('0x14'));var utils=require('../../config/utils');var config=require(_0xe70b('0x15'));var licenseUtil=require(_0xe70b('0x16'));var db=require(_0xe70b('0x17'))['db'];function respondWithStatusCode(_0x38f3e9,_0x4d2e01){_0x4d2e01=_0x4d2e01||0xcc;return function(_0x256d2d){if(_0x256d2d){return _0x38f3e9[_0xe70b('0x18')](_0x4d2e01);}return _0x38f3e9[_0xe70b('0x19')](_0x4d2e01)['end']();};}function respondWithResult(_0x59c14f,_0x597642){_0x597642=_0x597642||0xc8;return function(_0x29dd81){if(_0x29dd81){return _0x59c14f[_0xe70b('0x19')](_0x597642)[_0xe70b('0x1a')](_0x29dd81);}};}function respondWithFilteredResult(_0xd01a7e,_0x267ff1){return function(_0x149549){if(_0x149549){var _0x493ef4=typeof _0x267ff1['offset']===_0xe70b('0x1b')&&typeof _0x267ff1[_0xe70b('0x1c')]==='undefined';var _0x3c5072=_0x149549['count'];var _0x506c89=_0x493ef4?0x0:_0x267ff1[_0xe70b('0x1d')];var _0x48e6a2=_0x493ef4?_0x149549[_0xe70b('0x1e')]:_0x267ff1['offset']+_0x267ff1['limit'];var _0x1188dd;if(_0x48e6a2>=_0x3c5072){_0x48e6a2=_0x3c5072;_0x1188dd=0xc8;}else{_0x1188dd=0xce;}_0xd01a7e['status'](_0x1188dd);return _0xd01a7e[_0xe70b('0x1f')](_0xe70b('0x20'),_0x506c89+'-'+_0x48e6a2+'/'+_0x3c5072)[_0xe70b('0x1a')](_0x149549);}return null;};}function patchUpdates(_0x22afdc){return function(_0x5ed24b){try{jsonpatch[_0xe70b('0x21')](_0x5ed24b,_0x22afdc,!![]);}catch(_0x2861b9){return BPromise[_0xe70b('0x22')](_0x2861b9);}return _0x5ed24b[_0xe70b('0x23')]();};}function saveUpdates(_0x2308a3,_0x36d12c){return function(_0x7395a1){if(_0x7395a1){return _0x7395a1[_0xe70b('0x24')](_0x2308a3)[_0xe70b('0x25')](function(_0x5a2e86){return _0x5a2e86;});}return null;};}function removeEntity(_0x8499d4,_0x840b6){return function(_0x344122){if(_0x344122){return _0x344122['destroy']()[_0xe70b('0x25')](function(){_0x8499d4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x377d24,_0x4329ef){return function(_0x139f45){if(!_0x139f45){_0x377d24[_0xe70b('0x18')](0x194);}return _0x139f45;};}function handleError(_0x24dbf7,_0x29f49f){_0x29f49f=_0x29f49f||0x1f4;return function(_0x2d33a7){logger[_0xe70b('0x26')](_0x2d33a7[_0xe70b('0x27')]);if(_0x2d33a7[_0xe70b('0x28')]){delete _0x2d33a7['name'];}_0x24dbf7[_0xe70b('0x19')](_0x29f49f)[_0xe70b('0x29')](_0x2d33a7);};}exports['index']=function(_0x4a30cd,_0x5bf7ad){var _0x164dd5={},_0x1dbb7c={},_0x371212={'count':0x0,'rows':[]};var _0x12255c=_['map'](db['JscriptySessionReport'][_0xe70b('0x2a')],function(_0x4451ca){return{'name':_0x4451ca[_0xe70b('0x2b')],'type':_0x4451ca[_0xe70b('0x2c')][_0xe70b('0x2d')]};});_0x1dbb7c[_0xe70b('0x2e')]=_[_0xe70b('0x2f')](_0x12255c,_0xe70b('0x28'));_0x1dbb7c['query']=_[_0xe70b('0x30')](_0x4a30cd[_0xe70b('0x31')]);_0x1dbb7c[_0xe70b('0x32')]=_[_0xe70b('0x33')](_0x1dbb7c[_0xe70b('0x2e')],_0x1dbb7c['query']);_0x164dd5[_0xe70b('0x34')]=_[_0xe70b('0x33')](_0x1dbb7c['model'],qs[_0xe70b('0x35')](_0x4a30cd[_0xe70b('0x31')][_0xe70b('0x35')]));_0x164dd5['attributes']=_0x164dd5['attributes'][_0xe70b('0x36')]?_0x164dd5[_0xe70b('0x34')]:_0x1dbb7c[_0xe70b('0x2e')];if(!_0x4a30cd[_0xe70b('0x31')]['hasOwnProperty'](_0xe70b('0x37'))){_0x164dd5[_0xe70b('0x1c')]=qs[_0xe70b('0x1c')](_0x4a30cd[_0xe70b('0x31')][_0xe70b('0x1c')]);_0x164dd5[_0xe70b('0x1d')]=qs[_0xe70b('0x1d')](_0x4a30cd[_0xe70b('0x31')][_0xe70b('0x1d')]);}_0x164dd5[_0xe70b('0x38')]=qs[_0xe70b('0x39')](_0x4a30cd[_0xe70b('0x31')][_0xe70b('0x39')]);_0x164dd5[_0xe70b('0x3a')]=qs[_0xe70b('0x32')](_[_0xe70b('0x3b')](_0x4a30cd[_0xe70b('0x31')],_0x1dbb7c['filters']),_0x12255c);if(_0x4a30cd[_0xe70b('0x31')][_0xe70b('0x3c')]){_0x164dd5[_0xe70b('0x3a')]=_[_0xe70b('0x3d')](_0x164dd5[_0xe70b('0x3a')],{'$or':_[_0xe70b('0x2f')](_0x12255c,function(_0x51a434){if(_0x51a434['type']!==_0xe70b('0x3e')){var _0x5b34c3={};_0x5b34c3[_0x51a434['name']]={'$like':'%'+_0x4a30cd[_0xe70b('0x31')][_0xe70b('0x3c')]+'%'};return _0x5b34c3;}})});}_0x164dd5=_['merge']({},_0x164dd5,_0x4a30cd['options']);var _0x5ecf08={'where':_0x164dd5[_0xe70b('0x3a')]};return db['JscriptySessionReport'][_0xe70b('0x1e')](_0x5ecf08)[_0xe70b('0x25')](function(_0x140774){_0x371212['count']=_0x140774;if(_0x4a30cd[_0xe70b('0x31')][_0xe70b('0x3f')]){_0x164dd5[_0xe70b('0x40')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0xe70b('0x41')](_0x164dd5);})[_0xe70b('0x25')](function(_0x42cff3){_0x371212[_0xe70b('0x42')]=_0x42cff3;return _0x371212;})[_0xe70b('0x25')](respondWithFilteredResult(_0x5bf7ad,_0x164dd5))[_0xe70b('0x43')](handleError(_0x5bf7ad,null));};exports[_0xe70b('0x44')]=function(_0x5e12a4,_0x5c4bec){var _0x1b9e75={'raw':!![],'where':{'id':_0x5e12a4[_0xe70b('0x45')]['id']}},_0x56163d={};_0x56163d['model']=_[_0xe70b('0x30')](db[_0xe70b('0x46')]['rawAttributes']);_0x56163d[_0xe70b('0x31')]=_['keys'](_0x5e12a4[_0xe70b('0x31')]);_0x56163d[_0xe70b('0x32')]=_['intersection'](_0x56163d[_0xe70b('0x2e')],_0x56163d[_0xe70b('0x31')]);_0x1b9e75['attributes']=_['intersection'](_0x56163d[_0xe70b('0x2e')],qs['fields'](_0x5e12a4[_0xe70b('0x31')][_0xe70b('0x35')]));_0x1b9e75[_0xe70b('0x34')]=_0x1b9e75[_0xe70b('0x34')]['length']?_0x1b9e75[_0xe70b('0x34')]:_0x56163d[_0xe70b('0x2e')];if(_0x5e12a4[_0xe70b('0x31')][_0xe70b('0x3f')]){_0x1b9e75[_0xe70b('0x40')]=[{'all':!![]}];}_0x1b9e75=_[_0xe70b('0x3d')]({},_0x1b9e75,_0x5e12a4['options']);return db[_0xe70b('0x46')][_0xe70b('0x47')](_0x1b9e75)[_0xe70b('0x25')](handleEntityNotFound(_0x5c4bec,null))[_0xe70b('0x25')](respondWithResult(_0x5c4bec,null))[_0xe70b('0x43')](handleError(_0x5c4bec,null));};exports[_0xe70b('0x48')]=function(_0x5561bc,_0xa2d92b){return db[_0xe70b('0x46')][_0xe70b('0x48')](_0x5561bc[_0xe70b('0x49')],{})[_0xe70b('0x25')](respondWithResult(_0xa2d92b,0xc9))[_0xe70b('0x43')](handleError(_0xa2d92b,null));};exports['update']=function(_0x2e9251,_0x2d9c0d){if(_0x2e9251['body']['id']){delete _0x2e9251['body']['id'];}return db[_0xe70b('0x46')][_0xe70b('0x47')]({'where':{'id':_0x2e9251[_0xe70b('0x45')]['id']}})['then'](handleEntityNotFound(_0x2d9c0d,null))[_0xe70b('0x25')](saveUpdates(_0x2e9251[_0xe70b('0x49')],null))[_0xe70b('0x25')](respondWithResult(_0x2d9c0d,null))['catch'](handleError(_0x2d9c0d,null));};exports[_0xe70b('0x4a')]=function(_0x46352f,_0x16c3c6){return db['JscriptySessionReport']['find']({'where':{'id':_0x46352f[_0xe70b('0x45')]['id']}})[_0xe70b('0x25')](handleEntityNotFound(_0x16c3c6,null))[_0xe70b('0x25')](removeEntity(_0x16c3c6,null))['catch'](handleError(_0x16c3c6,null));};exports[_0xe70b('0x4b')]=function(_0x23b32c,_0x54dbb3){return db[_0xe70b('0x46')][_0xe70b('0x4b')]()[_0xe70b('0x25')](respondWithResult(_0x54dbb3,null))['catch'](handleError(_0x54dbb3,null));};exports['getQuestions']=function(_0x182515,_0x4ced82,_0x4b74dd){var _0x1fb123={'raw':!![],'where':{}};var _0x4ca788={};var _0x3c31f7={'count':0x0,'rows':[]};return db[_0xe70b('0x46')][_0xe70b('0x4c')]({'where':{'id':_0x182515[_0xe70b('0x45')]['id']}})[_0xe70b('0x25')](handleEntityNotFound(_0x4ced82,null))[_0xe70b('0x25')](function(_0x2480b1){if(_0x2480b1){_0x4ca788[_0xe70b('0x2e')]=_[_0xe70b('0x30')](db[_0xe70b('0x4d')][_0xe70b('0x2a')]);_0x4ca788['query']=_[_0xe70b('0x30')](_0x182515[_0xe70b('0x31')]);_0x4ca788[_0xe70b('0x32')]=_[_0xe70b('0x33')](_0x4ca788[_0xe70b('0x2e')],_0x4ca788[_0xe70b('0x31')]);_0x1fb123[_0xe70b('0x34')]=_[_0xe70b('0x33')](_0x4ca788[_0xe70b('0x2e')],qs[_0xe70b('0x35')](_0x182515[_0xe70b('0x31')][_0xe70b('0x35')]));_0x1fb123[_0xe70b('0x34')]=_0x1fb123[_0xe70b('0x34')][_0xe70b('0x36')]?_0x1fb123[_0xe70b('0x34')]:_0x4ca788[_0xe70b('0x2e')];if(!_0x182515[_0xe70b('0x31')][_0xe70b('0x4e')](_0xe70b('0x37'))){_0x1fb123['limit']=qs[_0xe70b('0x1c')](_0x182515['query'][_0xe70b('0x1c')]);_0x1fb123[_0xe70b('0x1d')]=qs[_0xe70b('0x1d')](_0x182515[_0xe70b('0x31')][_0xe70b('0x1d')]);}_0x1fb123[_0xe70b('0x38')]=qs[_0xe70b('0x39')](_0x182515[_0xe70b('0x31')][_0xe70b('0x39')]);_0x1fb123[_0xe70b('0x3a')]=qs[_0xe70b('0x32')](_[_0xe70b('0x3b')](_0x182515[_0xe70b('0x31')],_0x4ca788['filters']));_0x1fb123[_0xe70b('0x3a')][_0xe70b('0x4f')]=_0x2480b1['id'];if(_0x182515[_0xe70b('0x31')][_0xe70b('0x3c')]){_0x1fb123[_0xe70b('0x3a')]=_[_0xe70b('0x3d')](_0x1fb123[_0xe70b('0x3a')],{'$or':_[_0xe70b('0x2f')](_0x1fb123[_0xe70b('0x34')],function(_0x44a0c6){var _0x2513c5={};_0x2513c5[_0x44a0c6]={'$like':'%'+_0x182515[_0xe70b('0x31')]['filter']+'%'};return _0x2513c5;})});}_0x1fb123=_['merge']({},_0x1fb123,_0x182515['options']);return db[_0xe70b('0x4d')][_0xe70b('0x1e')]({'where':_0x1fb123[_0xe70b('0x3a')]})['then'](function(_0x1f131c){_0x3c31f7['count']=_0x1f131c;if(_0x182515[_0xe70b('0x31')]['includeAll']){_0x1fb123['include']=[{'all':!![]}];}return db[_0xe70b('0x4d')][_0xe70b('0x41')](_0x1fb123);})[_0xe70b('0x25')](function(_0x147283){_0x3c31f7['rows']=_0x147283;return _0x3c31f7;});}})[_0xe70b('0x25')](respondWithFilteredResult(_0x4ced82,_0x1fb123))['catch'](handleError(_0x4ced82,null));}; \ No newline at end of file +var _0x6f11=['catch','show','params','keys','include','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','hasOwnProperty','SessionId','filter','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','error','name','index','rawAttributes','fieldName','type','key','model','map','query','attributes','intersection','fields','length','nolimit','sort','filters','pick','merge','where','options','JscriptySessionReport','includeAll','rows'];(function(_0x2e76a7,_0x23871a){var _0x454cde=function(_0x51724d){while(--_0x51724d){_0x2e76a7['push'](_0x2e76a7['shift']());}};_0x454cde(++_0x23871a);}(_0x6f11,0x1e9));var _0x16f1=function(_0xa517f5,_0xb4b21a){_0xa517f5=_0xa517f5-0x0;var _0x1c8c60=_0x6f11[_0xa517f5];return _0x1c8c60;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x16f1('0x0'));var zipdir=require(_0x16f1('0x1'));var jsonpatch=require(_0x16f1('0x2'));var rp=require('request-promise');var moment=require(_0x16f1('0x3'));var BPromise=require(_0x16f1('0x4'));var Mustache=require('mustache');var util=require(_0x16f1('0x5'));var path=require(_0x16f1('0x6'));var sox=require('sox');var csv=require(_0x16f1('0x7'));var ejs=require(_0x16f1('0x8'));var fs=require('fs');var fs_extra=require(_0x16f1('0x9'));var _=require('lodash');var squel=require(_0x16f1('0xa'));var crypto=require(_0x16f1('0xb'));var jsforce=require(_0x16f1('0xc'));var deskjs=require(_0x16f1('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x16f1('0xe'));var Redis=require(_0x16f1('0xf'));var authService=require(_0x16f1('0x10'));var qs=require(_0x16f1('0x11'));var as=require(_0x16f1('0x12'));var hardwareService=require(_0x16f1('0x13'));var logger=require(_0x16f1('0x14'))(_0x16f1('0x15'));var utils=require(_0x16f1('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x16f1('0x17'));var db=require(_0x16f1('0x18'))['db'];function respondWithStatusCode(_0x2ea47e,_0x36aace){_0x36aace=_0x36aace||0xcc;return function(_0x1458ea){if(_0x1458ea){return _0x2ea47e[_0x16f1('0x19')](_0x36aace);}return _0x2ea47e[_0x16f1('0x1a')](_0x36aace)[_0x16f1('0x1b')]();};}function respondWithResult(_0x4d6fdc,_0x410680){_0x410680=_0x410680||0xc8;return function(_0x2cb5fe){if(_0x2cb5fe){return _0x4d6fdc[_0x16f1('0x1a')](_0x410680)[_0x16f1('0x1c')](_0x2cb5fe);}};}function respondWithFilteredResult(_0x47bee2,_0x5f0b69){return function(_0x1c9cca){if(_0x1c9cca){var _0xecef0a=typeof _0x5f0b69[_0x16f1('0x1d')]===_0x16f1('0x1e')&&typeof _0x5f0b69[_0x16f1('0x1f')]===_0x16f1('0x1e');var _0x87006c=_0x1c9cca[_0x16f1('0x20')];var _0x3df24c=_0xecef0a?0x0:_0x5f0b69[_0x16f1('0x1d')];var _0x5cc921=_0xecef0a?_0x1c9cca['count']:_0x5f0b69['offset']+_0x5f0b69[_0x16f1('0x1f')];var _0x3f93e9;if(_0x5cc921>=_0x87006c){_0x5cc921=_0x87006c;_0x3f93e9=0xc8;}else{_0x3f93e9=0xce;}_0x47bee2['status'](_0x3f93e9);return _0x47bee2[_0x16f1('0x21')](_0x16f1('0x22'),_0x3df24c+'-'+_0x5cc921+'/'+_0x87006c)['json'](_0x1c9cca);}return null;};}function patchUpdates(_0x154163){return function(_0x4145e7){try{jsonpatch[_0x16f1('0x23')](_0x4145e7,_0x154163,!![]);}catch(_0x44516a){return BPromise[_0x16f1('0x24')](_0x44516a);}return _0x4145e7['save']();};}function saveUpdates(_0x1ae9ef,_0x503aa8){return function(_0x569eed){if(_0x569eed){return _0x569eed[_0x16f1('0x25')](_0x1ae9ef)['then'](function(_0x1d7493){return _0x1d7493;});}return null;};}function removeEntity(_0x5a00af,_0x102070){return function(_0x541b39){if(_0x541b39){return _0x541b39[_0x16f1('0x26')]()[_0x16f1('0x27')](function(){_0x5a00af[_0x16f1('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x573111,_0x18fa82){return function(_0x5689ff){if(!_0x5689ff){_0x573111['sendStatus'](0x194);}return _0x5689ff;};}function handleError(_0x36626d,_0xc5f6fc){_0xc5f6fc=_0xc5f6fc||0x1f4;return function(_0x587d2a){logger[_0x16f1('0x28')](_0x587d2a['stack']);if(_0x587d2a['name']){delete _0x587d2a[_0x16f1('0x29')];}_0x36626d[_0x16f1('0x1a')](_0xc5f6fc)['send'](_0x587d2a);};}exports[_0x16f1('0x2a')]=function(_0x1de0ea,_0x5d7dc0){var _0x2a18cc={},_0xf7b585={},_0x5b6e85={'count':0x0,'rows':[]};var _0x284ee7=_['map'](db['JscriptySessionReport'][_0x16f1('0x2b')],function(_0x3e4f2a){return{'name':_0x3e4f2a[_0x16f1('0x2c')],'type':_0x3e4f2a[_0x16f1('0x2d')][_0x16f1('0x2e')]};});_0xf7b585[_0x16f1('0x2f')]=_[_0x16f1('0x30')](_0x284ee7,_0x16f1('0x29'));_0xf7b585[_0x16f1('0x31')]=_['keys'](_0x1de0ea[_0x16f1('0x31')]);_0xf7b585['filters']=_['intersection'](_0xf7b585['model'],_0xf7b585[_0x16f1('0x31')]);_0x2a18cc[_0x16f1('0x32')]=_[_0x16f1('0x33')](_0xf7b585['model'],qs[_0x16f1('0x34')](_0x1de0ea[_0x16f1('0x31')][_0x16f1('0x34')]));_0x2a18cc[_0x16f1('0x32')]=_0x2a18cc[_0x16f1('0x32')][_0x16f1('0x35')]?_0x2a18cc[_0x16f1('0x32')]:_0xf7b585[_0x16f1('0x2f')];if(!_0x1de0ea[_0x16f1('0x31')]['hasOwnProperty'](_0x16f1('0x36'))){_0x2a18cc[_0x16f1('0x1f')]=qs[_0x16f1('0x1f')](_0x1de0ea[_0x16f1('0x31')][_0x16f1('0x1f')]);_0x2a18cc[_0x16f1('0x1d')]=qs['offset'](_0x1de0ea['query'][_0x16f1('0x1d')]);}_0x2a18cc['order']=qs[_0x16f1('0x37')](_0x1de0ea[_0x16f1('0x31')][_0x16f1('0x37')]);_0x2a18cc['where']=qs[_0x16f1('0x38')](_[_0x16f1('0x39')](_0x1de0ea['query'],_0xf7b585[_0x16f1('0x38')]),_0x284ee7);if(_0x1de0ea[_0x16f1('0x31')]['filter']){_0x2a18cc['where']=_[_0x16f1('0x3a')](_0x2a18cc[_0x16f1('0x3b')],{'$or':_['map'](_0x284ee7,function(_0x27a664){if(_0x27a664['type']!=='VIRTUAL'){var _0x2f85d9={};_0x2f85d9[_0x27a664['name']]={'$like':'%'+_0x1de0ea['query']['filter']+'%'};return _0x2f85d9;}})});}_0x2a18cc=_['merge']({},_0x2a18cc,_0x1de0ea[_0x16f1('0x3c')]);var _0x69551={'where':_0x2a18cc[_0x16f1('0x3b')]};return db[_0x16f1('0x3d')][_0x16f1('0x20')](_0x69551)['then'](function(_0x65e39b){_0x5b6e85[_0x16f1('0x20')]=_0x65e39b;if(_0x1de0ea[_0x16f1('0x31')][_0x16f1('0x3e')]){_0x2a18cc['include']=[{'all':!![]}];}return db[_0x16f1('0x3d')]['findAll'](_0x2a18cc);})[_0x16f1('0x27')](function(_0x474652){_0x5b6e85[_0x16f1('0x3f')]=_0x474652;return _0x5b6e85;})[_0x16f1('0x27')](respondWithFilteredResult(_0x5d7dc0,_0x2a18cc))[_0x16f1('0x40')](handleError(_0x5d7dc0,null));};exports[_0x16f1('0x41')]=function(_0x5b7632,_0x10ceda){var _0xe335f9={'raw':!![],'where':{'id':_0x5b7632[_0x16f1('0x42')]['id']}},_0x590f5c={};_0x590f5c['model']=_[_0x16f1('0x43')](db['JscriptySessionReport'][_0x16f1('0x2b')]);_0x590f5c[_0x16f1('0x31')]=_['keys'](_0x5b7632[_0x16f1('0x31')]);_0x590f5c[_0x16f1('0x38')]=_['intersection'](_0x590f5c['model'],_0x590f5c[_0x16f1('0x31')]);_0xe335f9[_0x16f1('0x32')]=_['intersection'](_0x590f5c['model'],qs[_0x16f1('0x34')](_0x5b7632[_0x16f1('0x31')][_0x16f1('0x34')]));_0xe335f9[_0x16f1('0x32')]=_0xe335f9[_0x16f1('0x32')][_0x16f1('0x35')]?_0xe335f9[_0x16f1('0x32')]:_0x590f5c[_0x16f1('0x2f')];if(_0x5b7632['query']['includeAll']){_0xe335f9[_0x16f1('0x44')]=[{'all':!![]}];}_0xe335f9=_['merge']({},_0xe335f9,_0x5b7632[_0x16f1('0x3c')]);return db[_0x16f1('0x3d')][_0x16f1('0x45')](_0xe335f9)['then'](handleEntityNotFound(_0x10ceda,null))[_0x16f1('0x27')](respondWithResult(_0x10ceda,null))[_0x16f1('0x40')](handleError(_0x10ceda,null));};exports[_0x16f1('0x46')]=function(_0x327b86,_0x4a8daa){return db['JscriptySessionReport'][_0x16f1('0x46')](_0x327b86[_0x16f1('0x47')],{})['then'](respondWithResult(_0x4a8daa,0xc9))[_0x16f1('0x40')](handleError(_0x4a8daa,null));};exports[_0x16f1('0x25')]=function(_0x449de8,_0x47e93b){if(_0x449de8[_0x16f1('0x47')]['id']){delete _0x449de8[_0x16f1('0x47')]['id'];}return db['JscriptySessionReport'][_0x16f1('0x45')]({'where':{'id':_0x449de8[_0x16f1('0x42')]['id']}})['then'](handleEntityNotFound(_0x47e93b,null))[_0x16f1('0x27')](saveUpdates(_0x449de8[_0x16f1('0x47')],null))[_0x16f1('0x27')](respondWithResult(_0x47e93b,null))[_0x16f1('0x40')](handleError(_0x47e93b,null));};exports[_0x16f1('0x26')]=function(_0x1c4255,_0x17afda){return db['JscriptySessionReport'][_0x16f1('0x45')]({'where':{'id':_0x1c4255[_0x16f1('0x42')]['id']}})[_0x16f1('0x27')](handleEntityNotFound(_0x17afda,null))[_0x16f1('0x27')](removeEntity(_0x17afda,null))[_0x16f1('0x40')](handleError(_0x17afda,null));};exports[_0x16f1('0x48')]=function(_0x5a4d61,_0x2538d6){return db[_0x16f1('0x3d')]['describe']()[_0x16f1('0x27')](respondWithResult(_0x2538d6,null))[_0x16f1('0x40')](handleError(_0x2538d6,null));};exports[_0x16f1('0x49')]=function(_0x1a34d6,_0xd2ce33,_0x3d498d){var _0x340b78={'raw':!![],'where':{}};var _0x78bf99={};var _0x27b2c5={'count':0x0,'rows':[]};return db[_0x16f1('0x3d')][_0x16f1('0x4a')]({'where':{'id':_0x1a34d6[_0x16f1('0x42')]['id']}})[_0x16f1('0x27')](handleEntityNotFound(_0xd2ce33,null))[_0x16f1('0x27')](function(_0x3463f3){if(_0x3463f3){_0x78bf99['model']=_[_0x16f1('0x43')](db[_0x16f1('0x4b')][_0x16f1('0x2b')]);_0x78bf99[_0x16f1('0x31')]=_[_0x16f1('0x43')](_0x1a34d6[_0x16f1('0x31')]);_0x78bf99[_0x16f1('0x38')]=_[_0x16f1('0x33')](_0x78bf99[_0x16f1('0x2f')],_0x78bf99[_0x16f1('0x31')]);_0x340b78[_0x16f1('0x32')]=_[_0x16f1('0x33')](_0x78bf99[_0x16f1('0x2f')],qs[_0x16f1('0x34')](_0x1a34d6[_0x16f1('0x31')][_0x16f1('0x34')]));_0x340b78[_0x16f1('0x32')]=_0x340b78[_0x16f1('0x32')][_0x16f1('0x35')]?_0x340b78['attributes']:_0x78bf99[_0x16f1('0x2f')];if(!_0x1a34d6[_0x16f1('0x31')][_0x16f1('0x4c')]('nolimit')){_0x340b78[_0x16f1('0x1f')]=qs[_0x16f1('0x1f')](_0x1a34d6['query'][_0x16f1('0x1f')]);_0x340b78[_0x16f1('0x1d')]=qs[_0x16f1('0x1d')](_0x1a34d6[_0x16f1('0x31')][_0x16f1('0x1d')]);}_0x340b78['order']=qs[_0x16f1('0x37')](_0x1a34d6['query'][_0x16f1('0x37')]);_0x340b78[_0x16f1('0x3b')]=qs[_0x16f1('0x38')](_[_0x16f1('0x39')](_0x1a34d6[_0x16f1('0x31')],_0x78bf99[_0x16f1('0x38')]));_0x340b78['where'][_0x16f1('0x4d')]=_0x3463f3['id'];if(_0x1a34d6[_0x16f1('0x31')][_0x16f1('0x4e')]){_0x340b78[_0x16f1('0x3b')]=_['merge'](_0x340b78[_0x16f1('0x3b')],{'$or':_[_0x16f1('0x30')](_0x340b78[_0x16f1('0x32')],function(_0x109c57){var _0x4cd8d3={};_0x4cd8d3[_0x109c57]={'$like':'%'+_0x1a34d6[_0x16f1('0x31')][_0x16f1('0x4e')]+'%'};return _0x4cd8d3;})});}_0x340b78=_[_0x16f1('0x3a')]({},_0x340b78,_0x1a34d6[_0x16f1('0x3c')]);return db[_0x16f1('0x4b')]['count']({'where':_0x340b78[_0x16f1('0x3b')]})[_0x16f1('0x27')](function(_0x383187){_0x27b2c5['count']=_0x383187;if(_0x1a34d6[_0x16f1('0x31')][_0x16f1('0x3e')]){_0x340b78[_0x16f1('0x44')]=[{'all':!![]}];}return db[_0x16f1('0x4b')]['findAll'](_0x340b78);})[_0x16f1('0x27')](function(_0x535bdf){_0x27b2c5[_0x16f1('0x3f')]=_0x535bdf;return _0x27b2c5;});}})[_0x16f1('0x27')](respondWithFilteredResult(_0xd2ce33,_0x340b78))[_0x16f1('0x40')](handleError(_0xd2ce33,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 2b4a8cc..38cdbec 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 _0xbd51=['exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','../../config/logger','api','moment','bluebird','./jscriptySessionReport.attributes'];(function(_0x43344c,_0x33341c){var _0x95cd49=function(_0x1c0399){while(--_0x1c0399){_0x43344c['push'](_0x43344c['shift']());}};_0x95cd49(++_0x33341c);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x35a833,_0x550e33){_0x35a833=_0x35a833-0x0;var _0x58d38e=_0xbd51[_0x35a833];return _0x58d38e;};'use strict';var _=require(_0x1bd5('0x0'));var util=require('util');var logger=require(_0x1bd5('0x1'))(_0x1bd5('0x2'));var moment=require(_0x1bd5('0x3'));var BPromise=require(_0x1bd5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1bd5('0x5'));module[_0x1bd5('0x6')]=function(_0x43e6b6,_0x59ddfb){return _0x43e6b6[_0x1bd5('0x7')](_0x1bd5('0x8'),attributes,{'tableName':_0x1bd5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe015=['lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','report_jscripty_sessions'];(function(_0x4fa43c,_0xf2f8fc){var _0x5bc7ac=function(_0x158b18){while(--_0x158b18){_0x4fa43c['push'](_0x4fa43c['shift']());}};_0x5bc7ac(++_0xf2f8fc);}(_0xe015,0x13b));var _0x5e01=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xe015[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0x5e01('0x0'));var util=require(_0x5e01('0x1'));var logger=require(_0x5e01('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5e01('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5e01('0x4'));var rimraf=require(_0x5e01('0x5'));var config=require(_0x5e01('0x6'));var attributes=require(_0x5e01('0x7'));module['exports']=function(_0x1814cb,_0x3d2da2){return _0x1814cb['define']('JscriptySessionReport',attributes,{'tableName':_0x5e01('0x8'),'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 e5d6b05..8fcde04 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 _0xd943=['info','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','JscriptySessionReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then'];(function(_0x416d31,_0x7ef3f7){var _0x1fbe6c=function(_0x388327){while(--_0x388327){_0x416d31['push'](_0x416d31['shift']());}};_0x1fbe6c(++_0x7ef3f7);}(_0xd943,0x15d));var _0x3d94=function(_0x250fc2,_0x4c756a){_0x250fc2=_0x250fc2-0x0;var _0x11c2d0=_0xd943[_0x250fc2];return _0x11c2d0;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var moment=require(_0x3d94('0x2'));var BPromise=require(_0x3d94('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d94('0x4'));var db=require(_0x3d94('0x5'))['db'];var utils=require(_0x3d94('0x6'));var logger=require(_0x3d94('0x7'))(_0x3d94('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3d94('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54e81f,_0x4d29e7,_0x20f4d1){return new BPromise(function(_0x35d36a,_0x5244c3){return client['request'](_0x54e81f,_0x20f4d1)[_0x3d94('0xa')](function(_0x27e381){logger[_0x3d94('0xb')]('JscriptySessionReport,\x20%s,\x20%s',_0x4d29e7,_0x3d94('0xc'));logger['debug'](_0x3d94('0xd'),_0x4d29e7,_0x3d94('0xc'),JSON['stringify'](_0x27e381));if(_0x27e381[_0x3d94('0xe')]){if(_0x27e381[_0x3d94('0xe')][_0x3d94('0xf')]===0x1f4){logger[_0x3d94('0xe')](_0x3d94('0x10'),_0x4d29e7,_0x27e381['error'][_0x3d94('0x11')]);return _0x5244c3(_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);}logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);return _0x35d36a(_0x27e381['error'][_0x3d94('0x11')]);}else{logger[_0x3d94('0xb')](_0x3d94('0x10'),_0x4d29e7,_0x3d94('0xc'));_0x35d36a(_0x27e381[_0x3d94('0x12')][_0x3d94('0x11')]);}})[_0x3d94('0x13')](function(_0x9893cb){logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x9893cb);_0x5244c3(_0x9893cb);});});} \ No newline at end of file +var _0x1261=['then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x8245c3,_0x5efc3d){var _0x3adb44=function(_0x3616d){while(--_0x3616d){_0x8245c3['push'](_0x8245c3['shift']());}};_0x3adb44(++_0x5efc3d);}(_0x1261,0x144));var _0x1126=function(_0x5a709c,_0x1e6cfe){_0x5a709c=_0x5a709c-0x0;var _0x719025=_0x1261[_0x5a709c];return _0x719025;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('JscriptySessionReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index b6135d6..2249324 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 _0x5a2a=['../../components/interaction/service','./license.controller','get','index','/:id','update','exports','multer','util','path','connect-timeout','../../components/auth/service'];(function(_0x4e1600,_0x32bb32){var _0x1fe593=function(_0x476393){while(--_0x476393){_0x4e1600['push'](_0x4e1600['shift']());}};_0x1fe593(++_0x32bb32);}(_0x5a2a,0x1c3));var _0xa5a2=function(_0xe82152,_0x3ff567){_0xe82152=_0xe82152-0x0;var _0x348fbe=_0x5a2a[_0xe82152];return _0x348fbe;};'use strict';var multer=require(_0xa5a2('0x0'));var util=require(_0xa5a2('0x1'));var path=require(_0xa5a2('0x2'));var timeout=require(_0xa5a2('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa5a2('0x4'));var interaction=require(_0xa5a2('0x5'));var config=require('../../config/environment');var controller=require(_0xa5a2('0x6'));router[_0xa5a2('0x7')]('/',controller[_0xa5a2('0x8')]);router['put'](_0xa5a2('0x9'),auth['isAuthenticated'](),controller[_0xa5a2('0xa')]);module[_0xa5a2('0xb')]=router; \ No newline at end of file +var _0xfa12=['exports','multer','util','path','Router','fs-extra','../../config/environment','./license.controller','get','put','isAuthenticated','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfa12,0x1bd));var _0x2fa1=function(_0xb95095,_0xad32dd){_0xb95095=_0xb95095-0x0;var _0x38e16b=_0xfa12[_0xb95095];return _0x38e16b;};'use strict';var multer=require(_0x2fa1('0x0'));var util=require(_0x2fa1('0x1'));var path=require(_0x2fa1('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2fa1('0x3')]();var fs_extra=require(_0x2fa1('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2fa1('0x5'));var controller=require(_0x2fa1('0x6'));router[_0x2fa1('0x7')]('/',controller['index']);router[_0x2fa1('0x8')]('/:id',auth[_0x2fa1('0x9')](),controller[_0x2fa1('0xa')]);module[_0x2fa1('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 4746b24..a799525 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 _0x2bb1=['INTEGER','sequelize','exports','STRING'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0x2bb1,0x185));var _0x12bb=function(_0x137c8f,_0x57b17d){_0x137c8f=_0x137c8f-0x0;var _0x478421=_0x2bb1[_0x137c8f];return _0x478421;};'use strict';var Sequelize=require(_0x12bb('0x0'));module[_0x12bb('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0x12bb('0x2')]},'data2':{'type':Sequelize[_0x12bb('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x12bb('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa576=['INTEGER','sequelize','STRING'];(function(_0x5769e1,_0x57029a){var _0xa63053=function(_0x49feb1){while(--_0x49feb1){_0x5769e1['push'](_0x5769e1['shift']());}};_0xa63053(++_0x57029a);}(_0xa576,0x106));var _0x6a57=function(_0x4631f3,_0x30f039){_0x4631f3=_0x4631f3-0x0;var _0x48beb5=_0xa576[_0x4631f3];return _0x48beb5;};'use strict';var Sequelize=require(_0x6a57('0x0'));module['exports']={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x6a57('0x1')]},'chatLicenseExceeded':{'type':Sequelize[_0x6a57('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 3c263f2..c1a61fb 100644 --- a/server/api/license/license.controller.js +++ b/server/api/license/license.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0295=['demo','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','name','send','../../config/license/util','model','keys','rawAttributes','query','filters','intersection','attributes','fields','merge','options','catch','body','License','find','checkLicense','key'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x0295,0x1f0));var _0x5029=function(_0x2e2d89,_0x4bb615){_0x2e2d89=_0x2e2d89-0x0;var _0x3aba90=_0x0295[_0x2e2d89];return _0x3aba90;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];function respondWithStatusCode(_0x2442b2,_0x4cced9){_0x4cced9=_0x4cced9||0xcc;return function(_0x4fa22d){if(_0x4fa22d){return _0x2442b2['sendStatus'](_0x4cced9);}return _0x2442b2['status'](_0x4cced9)[_0x5029('0x15')]();};}function respondWithResult(_0x2e0369,_0x12c237){_0x12c237=_0x12c237||0xc8;return function(_0x434630){if(_0x434630){return _0x2e0369[_0x5029('0x16')](_0x12c237)[_0x5029('0x17')](_0x434630);}};}function respondWithFilteredResult(_0xe278b7,_0x317c20){return function(_0x10bf55){if(_0x10bf55){var _0x326923=typeof _0x317c20[_0x5029('0x18')]===_0x5029('0x19')&&typeof _0x317c20[_0x5029('0x1a')]===_0x5029('0x19');var _0x343918=_0x10bf55['count'];var _0x1ed567=_0x326923?0x0:_0x317c20[_0x5029('0x18')];var _0x35de81=_0x326923?_0x10bf55[_0x5029('0x1b')]:_0x317c20[_0x5029('0x18')]+_0x317c20[_0x5029('0x1a')];var _0xaba461;if(_0x35de81>=_0x343918){_0x35de81=_0x343918;_0xaba461=0xc8;}else{_0xaba461=0xce;}_0xe278b7['status'](_0xaba461);return _0xe278b7[_0x5029('0x1c')]('Content-Range',_0x1ed567+'-'+_0x35de81+'/'+_0x343918)[_0x5029('0x17')](_0x10bf55);}return null;};}function patchUpdates(_0x8a414c){return function(_0x2710aa){try{jsonpatch[_0x5029('0x1d')](_0x2710aa,_0x8a414c,!![]);}catch(_0x4b5854){return BPromise['reject'](_0x4b5854);}return _0x2710aa[_0x5029('0x1e')]();};}function saveUpdates(_0x4a49b6,_0x3f657d){return function(_0x853a34){if(_0x853a34){return _0x853a34[_0x5029('0x1f')](_0x4a49b6)[_0x5029('0x20')](function(_0x16bd22){return _0x16bd22;});}return null;};}function removeEntity(_0x3a3e52,_0x125c26){return function(_0x356dac){if(_0x356dac){return _0x356dac[_0x5029('0x21')]()['then'](function(){_0x3a3e52['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x588d90,_0x45666c){return function(_0x51093c){if(!_0x51093c){_0x588d90['sendStatus'](0x194);}return _0x51093c;};}function handleError(_0x181da0,_0x1e7e61){_0x1e7e61=_0x1e7e61||0x1f4;return function(_0x36d810){logger['error'](_0x36d810[_0x5029('0x22')]);if(_0x36d810[_0x5029('0x23')]){delete _0x36d810['name'];}_0x181da0[_0x5029('0x16')](_0x1e7e61)[_0x5029('0x24')](_0x36d810);};}var utilLicense=require(_0x5029('0x25'));exports['index']=function(_0x32da06,_0x251f99){var _0xe5313e={'raw':!![],'where':{'id':0x1}},_0x4b6f92={};_0x4b6f92[_0x5029('0x26')]=_[_0x5029('0x27')](db['License'][_0x5029('0x28')]);_0x4b6f92[_0x5029('0x29')]=_[_0x5029('0x27')](_0x32da06[_0x5029('0x29')]);_0x4b6f92[_0x5029('0x2a')]=_[_0x5029('0x2b')](_0x4b6f92[_0x5029('0x26')],_0x4b6f92[_0x5029('0x29')]);_0xe5313e[_0x5029('0x2c')]=_[_0x5029('0x2b')](_0x4b6f92[_0x5029('0x26')],qs[_0x5029('0x2d')](_0x32da06['query'][_0x5029('0x2d')]));_0xe5313e['attributes']=_0xe5313e[_0x5029('0x2c')]['length']?_0xe5313e['attributes']:_0x4b6f92[_0x5029('0x26')];_0xe5313e=_[_0x5029('0x2e')]({},_0xe5313e,_0x32da06[_0x5029('0x2f')]);return utilLicense['getLicense'](_0xe5313e)[_0x5029('0x20')](respondWithResult(_0x251f99,null))[_0x5029('0x30')](handleError(_0x251f99,null));};exports[_0x5029('0x1f')]=function(_0x29c59a,_0x1bb896){if(_0x29c59a[_0x5029('0x31')]['id']){delete _0x29c59a[_0x5029('0x31')]['id'];}return db[_0x5029('0x32')][_0x5029('0x33')]({'where':{'id':_0x29c59a['params']['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x1bb896,null))[_0x5029('0x20')](function(_0xc110e8){var _0x1b3817=_0xc110e8['get']({'plain':!![]});return utilLicense[_0x5029('0x34')](_0x1b3817,_0x29c59a[_0x5029('0x31')][_0x5029('0x35')]);})['then'](function(_0x4904cc){if(!_0x4904cc[_0x5029('0x36')]){return saveUpdates(_0x29c59a[_0x5029('0x31')],null);}return _0x4904cc;})['then'](respondWithResult(_0x1bb896,null))['catch'](handleError(_0x1bb896,null));}; \ No newline at end of file +var _0xf494=['fields','length','merge','options','getLicense','body','License','find','params','get','key','demo','catch','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','undefined','limit','count','set','apply','save','update','then','error','stack','name','../../config/license/util','index','model','rawAttributes','query','keys','filters','intersection','attributes'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xf494,0x1c6));var _0x4f49=function(_0x2870a6,_0xd2d6e3){_0x2870a6=_0x2870a6-0x0;var _0x4114ba=_0xf494[_0x2870a6];return _0x4114ba;};'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'];function respondWithStatusCode(_0x12527d,_0x4bf89f){_0x4bf89f=_0x4bf89f||0xcc;return function(_0x1e1c37){if(_0x1e1c37){return _0x12527d[_0x4f49('0x19')](_0x4bf89f);}return _0x12527d[_0x4f49('0x1a')](_0x4bf89f)[_0x4f49('0x1b')]();};}function respondWithResult(_0x1a0f1e,_0x2f0131){_0x2f0131=_0x2f0131||0xc8;return function(_0xfdb477){if(_0xfdb477){return _0x1a0f1e['status'](_0x2f0131)[_0x4f49('0x1c')](_0xfdb477);}};}function respondWithFilteredResult(_0x1f2d0d,_0x415e83){return function(_0x5878f4){if(_0x5878f4){var _0x5bdfaf=typeof _0x415e83[_0x4f49('0x1d')]===_0x4f49('0x1e')&&typeof _0x415e83[_0x4f49('0x1f')]==='undefined';var _0x1dccfd=_0x5878f4[_0x4f49('0x20')];var _0x4e85df=_0x5bdfaf?0x0:_0x415e83['offset'];var _0x5bb23b=_0x5bdfaf?_0x5878f4['count']:_0x415e83['offset']+_0x415e83[_0x4f49('0x1f')];var _0x1834f4;if(_0x5bb23b>=_0x1dccfd){_0x5bb23b=_0x1dccfd;_0x1834f4=0xc8;}else{_0x1834f4=0xce;}_0x1f2d0d[_0x4f49('0x1a')](_0x1834f4);return _0x1f2d0d[_0x4f49('0x21')]('Content-Range',_0x4e85df+'-'+_0x5bb23b+'/'+_0x1dccfd)[_0x4f49('0x1c')](_0x5878f4);}return null;};}function patchUpdates(_0x2aed27){return function(_0x197a49){try{jsonpatch[_0x4f49('0x22')](_0x197a49,_0x2aed27,!![]);}catch(_0xea82f8){return BPromise['reject'](_0xea82f8);}return _0x197a49[_0x4f49('0x23')]();};}function saveUpdates(_0x357446,_0x3ae590){return function(_0x53b57d){if(_0x53b57d){return _0x53b57d[_0x4f49('0x24')](_0x357446)[_0x4f49('0x25')](function(_0x32ca7b){return _0x32ca7b;});}return null;};}function removeEntity(_0x43c458,_0x9d30aa){return function(_0x36187b){if(_0x36187b){return _0x36187b['destroy']()['then'](function(){_0x43c458[_0x4f49('0x1a')](0xcc)[_0x4f49('0x1b')]();});}};}function handleEntityNotFound(_0x4fedbb,_0x408552){return function(_0x2c1519){if(!_0x2c1519){_0x4fedbb[_0x4f49('0x19')](0x194);}return _0x2c1519;};}function handleError(_0x525950,_0xc54070){_0xc54070=_0xc54070||0x1f4;return function(_0x2eed1c){logger[_0x4f49('0x26')](_0x2eed1c[_0x4f49('0x27')]);if(_0x2eed1c[_0x4f49('0x28')]){delete _0x2eed1c[_0x4f49('0x28')];}_0x525950['status'](_0xc54070)['send'](_0x2eed1c);};}var utilLicense=require(_0x4f49('0x29'));exports[_0x4f49('0x2a')]=function(_0x605c91,_0x560050){var _0x3cbfbd={'raw':!![],'where':{'id':0x1}},_0x206203={};_0x206203[_0x4f49('0x2b')]=_['keys'](db['License'][_0x4f49('0x2c')]);_0x206203[_0x4f49('0x2d')]=_[_0x4f49('0x2e')](_0x605c91['query']);_0x206203[_0x4f49('0x2f')]=_[_0x4f49('0x30')](_0x206203[_0x4f49('0x2b')],_0x206203[_0x4f49('0x2d')]);_0x3cbfbd[_0x4f49('0x31')]=_[_0x4f49('0x30')](_0x206203[_0x4f49('0x2b')],qs[_0x4f49('0x32')](_0x605c91[_0x4f49('0x2d')][_0x4f49('0x32')]));_0x3cbfbd[_0x4f49('0x31')]=_0x3cbfbd[_0x4f49('0x31')][_0x4f49('0x33')]?_0x3cbfbd[_0x4f49('0x31')]:_0x206203[_0x4f49('0x2b')];_0x3cbfbd=_[_0x4f49('0x34')]({},_0x3cbfbd,_0x605c91[_0x4f49('0x35')]);return utilLicense[_0x4f49('0x36')](_0x3cbfbd)[_0x4f49('0x25')](respondWithResult(_0x560050,null))['catch'](handleError(_0x560050,null));};exports[_0x4f49('0x24')]=function(_0x46b7ba,_0x24f568){if(_0x46b7ba[_0x4f49('0x37')]['id']){delete _0x46b7ba[_0x4f49('0x37')]['id'];}return db[_0x4f49('0x38')][_0x4f49('0x39')]({'where':{'id':_0x46b7ba[_0x4f49('0x3a')]['id']}})[_0x4f49('0x25')](handleEntityNotFound(_0x24f568,null))[_0x4f49('0x25')](function(_0x44e6a0){var _0x343365=_0x44e6a0[_0x4f49('0x3b')]({'plain':!![]});return utilLicense['checkLicense'](_0x343365,_0x46b7ba[_0x4f49('0x37')][_0x4f49('0x3c')]);})[_0x4f49('0x25')](function(_0x26014f){if(!_0x26014f[_0x4f49('0x3d')]){return saveUpdates(_0x46b7ba[_0x4f49('0x37')],null);}return _0x26014f;})[_0x4f49('0x25')](respondWithResult(_0x24f568,null))[_0x4f49('0x3e')](handleError(_0x24f568,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 0c80139..a73fb44 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 _0xe8ff=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./license.attributes','exports','define','License','lodash'];(function(_0x3cb81f,_0x450ae2){var _0x495dad=function(_0x3f29f4){while(--_0x3f29f4){_0x3cb81f['push'](_0x3cb81f['shift']());}};_0x495dad(++_0x450ae2);}(_0xe8ff,0x1df));var _0xfe8f=function(_0x2023e1,_0xeca985){_0x2023e1=_0x2023e1-0x0;var _0x1fe133=_0xe8ff[_0x2023e1];return _0x1fe133;};'use strict';var _=require(_0xfe8f('0x0'));var util=require(_0xfe8f('0x1'));var logger=require(_0xfe8f('0x2'))(_0xfe8f('0x3'));var moment=require(_0xfe8f('0x4'));var BPromise=require(_0xfe8f('0x5'));var rp=require(_0xfe8f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfe8f('0x7'));var config=require('../../config/environment');var attributes=require(_0xfe8f('0x8'));module[_0xfe8f('0x9')]=function(_0x417492,_0x7b0c11){return _0x417492[_0xfe8f('0xa')](_0xfe8f('0xb'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7584=['define','License','license','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x58dfe6,_0x110bde){var _0x4933e5=function(_0xca86a5){while(--_0xca86a5){_0x58dfe6['push'](_0x58dfe6['shift']());}};_0x4933e5(++_0x110bde);}(_0x7584,0xb7));var _0x4758=function(_0x3e5457,_0x342cc){_0x3e5457=_0x3e5457-0x0;var _0x3120cc=_0x7584[_0x3e5457];return _0x3120cc;};'use strict';var _=require(_0x4758('0x0'));var util=require(_0x4758('0x1'));var logger=require(_0x4758('0x2'))(_0x4758('0x3'));var moment=require('moment');var BPromise=require(_0x4758('0x4'));var rp=require(_0x4758('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4758('0x6'));var config=require(_0x4758('0x7'));var attributes=require('./license.attributes');module[_0x4758('0x8')]=function(_0x1e187a,_0xa99191){return _0x1e187a[_0x4758('0x9')](_0x4758('0xa'),attributes,{'tableName':_0x4758('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 74e8339..cff0d5a 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 _0xf19b=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x27e36d,_0x32dc6a){var _0x5e77e8=function(_0x3807b4){while(--_0x3807b4){_0x27e36d['push'](_0x27e36d['shift']());}};_0x5e77e8(++_0x32dc6a);}(_0xf19b,0x192));var _0xbf19=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0xf19b[_0xd1d19a];return _0x52a79d;};'use strict';var _=require(_0xbf19('0x0'));var util=require(_0xbf19('0x1'));var moment=require('moment');var BPromise=require(_0xbf19('0x2'));var rs=require(_0xbf19('0x3'));var fs=require('fs');var Redis=require(_0xbf19('0x4'));var db=require(_0xbf19('0x5'))['db'];var utils=require(_0xbf19('0x6'));var logger=require(_0xbf19('0x7'))(_0xbf19('0x8'));var config=require(_0xbf19('0x9'));var jayson=require(_0xbf19('0xa'));var client=jayson[_0xbf19('0xb')][_0xbf19('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x44869e,_0x1df4bf,_0x1b6526){return new BPromise(function(_0x1e71f7,_0x38c199){return client[_0xbf19('0xd')](_0x44869e,_0x1b6526)['then'](function(_0x1ea646){logger['info'](_0xbf19('0xe'),_0x1df4bf,_0xbf19('0xf'));logger[_0xbf19('0x10')](_0xbf19('0x11'),_0x1df4bf,_0xbf19('0xf'),JSON['stringify'](_0x1ea646));if(_0x1ea646['error']){if(_0x1ea646['error'][_0xbf19('0x12')]===0x1f4){logger[_0xbf19('0x13')](_0xbf19('0xe'),_0x1df4bf,_0x1ea646[_0xbf19('0x13')]['message']);return _0x38c199(_0x1ea646[_0xbf19('0x13')]['message']);}logger[_0xbf19('0x13')](_0xbf19('0xe'),_0x1df4bf,_0x1ea646[_0xbf19('0x13')]['message']);return _0x1e71f7(_0x1ea646[_0xbf19('0x13')][_0xbf19('0x14')]);}else{logger[_0xbf19('0x15')](_0xbf19('0xe'),_0x1df4bf,'request\x20sent');_0x1e71f7(_0x1ea646[_0xbf19('0x16')]['message']);}})[_0xbf19('0x17')](function(_0x1c26d8){logger[_0xbf19('0x13')](_0xbf19('0xe'),_0x1df4bf,_0x1c26d8);_0x38c199(_0x1c26d8);});});} \ No newline at end of file +var _0x29f3=['request','info','License,\x20%s,\x20%s','debug','error','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x433f54,_0x371b89){var _0x1010cb=function(_0x3f8d81){while(--_0x3f8d81){_0x433f54['push'](_0x433f54['shift']());}};_0x1010cb(++_0x371b89);}(_0x29f3,0x16f));var _0x329f=function(_0x259f68,_0x6f74bc){_0x259f68=_0x259f68-0x0;var _0xf005eb=_0x29f3[_0x259f68];return _0xf005eb;};'use strict';var _=require(_0x329f('0x0'));var util=require(_0x329f('0x1'));var moment=require(_0x329f('0x2'));var BPromise=require('bluebird');var rs=require(_0x329f('0x3'));var fs=require('fs');var Redis=require(_0x329f('0x4'));var db=require(_0x329f('0x5'))['db'];var utils=require(_0x329f('0x6'));var logger=require(_0x329f('0x7'))(_0x329f('0x8'));var config=require(_0x329f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x329f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x468cf2,_0x375176,_0x89c6fa){return new BPromise(function(_0x21a9e0,_0x3e1908){return client[_0x329f('0xb')](_0x468cf2,_0x89c6fa)['then'](function(_0x4c5dbc){logger[_0x329f('0xc')](_0x329f('0xd'),_0x375176,'request\x20sent');logger[_0x329f('0xe')]('License,\x20%s,\x20%s,\x20%s',_0x375176,'request\x20sent',JSON['stringify'](_0x4c5dbc));if(_0x4c5dbc[_0x329f('0xf')]){if(_0x4c5dbc['error']['code']===0x1f4){logger[_0x329f('0xf')](_0x329f('0xd'),_0x375176,_0x4c5dbc[_0x329f('0xf')]['message']);return _0x3e1908(_0x4c5dbc[_0x329f('0xf')]['message']);}logger[_0x329f('0xf')]('License,\x20%s,\x20%s',_0x375176,_0x4c5dbc[_0x329f('0xf')][_0x329f('0x10')]);return _0x21a9e0(_0x4c5dbc[_0x329f('0xf')]['message']);}else{logger[_0x329f('0xc')](_0x329f('0xd'),_0x375176,'request\x20sent');_0x21a9e0(_0x4c5dbc[_0x329f('0x11')][_0x329f('0x10')]);}})['catch'](function(_0x9ded0){logger[_0x329f('0xf')](_0x329f('0xd'),_0x375176,_0x9ded0);_0x3e1908(_0x9ded0);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index bde6619..ada74d0 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 _0x9022=['destroy','removeAgents','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./mailAccount.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','addDisposition','post','addAnswer','create','addImap','addInteraction','/:id/applications','/:id/send','send','addAgents','put','update','delete','removeDispositions','removeImap'];(function(_0x49296c,_0x14f891){var _0x3f0d68=function(_0x530aae){while(--_0x530aae){_0x49296c['push'](_0x49296c['shift']());}};_0x3f0d68(++_0x14f891);}(_0x9022,0xc2));var _0x2902=function(_0xc916a3,_0x2b600c){_0xc916a3=_0xc916a3-0x0;var _0x15ae95=_0x9022[_0xc916a3];return _0x15ae95;};'use strict';var multer=require(_0x2902('0x0'));var util=require(_0x2902('0x1'));var path=require(_0x2902('0x2'));var timeout=require(_0x2902('0x3'));var express=require(_0x2902('0x4'));var router=express['Router']();var fs_extra=require(_0x2902('0x5'));var auth=require(_0x2902('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2902('0x7'));var controller=require(_0x2902('0x8'));router[_0x2902('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2902('0x9')](_0x2902('0xa'),auth[_0x2902('0xb')](),controller[_0x2902('0xc')]);router[_0x2902('0x9')](_0x2902('0xd'),auth[_0x2902('0xb')](),controller[_0x2902('0xe')]);router[_0x2902('0x9')](_0x2902('0xf'),auth[_0x2902('0xb')](),controller['getDispositions']);router[_0x2902('0x9')](_0x2902('0x10'),auth[_0x2902('0xb')](),controller[_0x2902('0x11')]);router[_0x2902('0x9')](_0x2902('0x12'),auth['isAuthenticated'](),controller[_0x2902('0x13')]);router[_0x2902('0x9')](_0x2902('0x14'),auth[_0x2902('0xb')](),controller[_0x2902('0x15')]);router[_0x2902('0x9')](_0x2902('0x16'),auth[_0x2902('0xb')](),controller[_0x2902('0x17')]);router[_0x2902('0x9')]('/:id/applications',auth[_0x2902('0xb')](),controller[_0x2902('0x18')]);router[_0x2902('0x9')](_0x2902('0x19'),auth[_0x2902('0xb')](),controller[_0x2902('0x1a')]);router[_0x2902('0x9')](_0x2902('0x1b'),auth[_0x2902('0xb')](),controller[_0x2902('0x1c')]);router[_0x2902('0x9')](_0x2902('0x1d'),auth[_0x2902('0xb')](),controller[_0x2902('0x1e')]);router['post']('/:id/dispositions',auth[_0x2902('0xb')](),controller[_0x2902('0x1f')]);router[_0x2902('0x20')](_0x2902('0x10'),auth[_0x2902('0xb')](),controller[_0x2902('0x21')]);router[_0x2902('0x20')]('/',auth[_0x2902('0xb')](),controller[_0x2902('0x22')]);router['post']('/:id/in_servers',auth['isAuthenticated'](),controller[_0x2902('0x23')]);router[_0x2902('0x20')](_0x2902('0x14'),auth[_0x2902('0xb')](),controller['addSmtp']);router['post']('/:id/interactions',auth['isAuthenticated'](),controller[_0x2902('0x24')]);router['post'](_0x2902('0x25'),auth[_0x2902('0xb')](),controller['addApplications']);router['post'](_0x2902('0x26'),auth[_0x2902('0xb')](),controller[_0x2902('0x27')]);router[_0x2902('0x20')](_0x2902('0x1d'),auth[_0x2902('0xb')](),controller[_0x2902('0x28')]);router[_0x2902('0x29')](_0x2902('0xd'),auth[_0x2902('0xb')](),controller[_0x2902('0x2a')]);router[_0x2902('0x2b')]('/:id/dispositions',auth[_0x2902('0xb')](),controller[_0x2902('0x2c')]);router[_0x2902('0x2b')]('/:id/canned_answers',auth[_0x2902('0xb')](),controller['removeAnswers']);router[_0x2902('0x2b')](_0x2902('0x12'),auth[_0x2902('0xb')](),controller[_0x2902('0x2d')]);router[_0x2902('0x2b')](_0x2902('0x14'),auth[_0x2902('0xb')](),controller['removeSmtp']);router[_0x2902('0x2b')](_0x2902('0xd'),auth[_0x2902('0xb')](),controller[_0x2902('0x2e')]);router[_0x2902('0x2b')](_0x2902('0x1d'),auth['isAuthenticated'](),controller[_0x2902('0x2f')]);module['exports']=router; \ No newline at end of file +var _0xcfbc=['show','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','getMessages','verifySmtp','/:id/users','getAgents','post','/:id/dispositions','addDisposition','addAnswer','create','addImap','addSmtp','addInteraction','addApplications','send','addAgents','put','delete','removeSmtp','removeAgents','exports','util','path','express','Router','fs-extra','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x59855f,_0x48b8a7){var _0x3d2d25=function(_0x5a053c){while(--_0x5a053c){_0x59855f['push'](_0x59855f['shift']());}};_0x3d2d25(++_0x48b8a7);}(_0xcfbc,0x75));var _0xccfb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcfbc[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0xccfb('0x0'));var path=require(_0xccfb('0x1'));var timeout=require('connect-timeout');var express=require(_0xccfb('0x2'));var router=express[_0xccfb('0x3')]();var fs_extra=require(_0xccfb('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xccfb('0x5'));var controller=require(_0xccfb('0x6'));router[_0xccfb('0x7')]('/',auth[_0xccfb('0x8')](),controller[_0xccfb('0x9')]);router[_0xccfb('0x7')](_0xccfb('0xa'),auth[_0xccfb('0x8')](),controller['describe']);router[_0xccfb('0x7')](_0xccfb('0xb'),auth[_0xccfb('0x8')](),controller[_0xccfb('0xc')]);router[_0xccfb('0x7')]('/:id/dispositions',auth[_0xccfb('0x8')](),controller['getDispositions']);router[_0xccfb('0x7')](_0xccfb('0xd'),auth[_0xccfb('0x8')](),controller[_0xccfb('0xe')]);router[_0xccfb('0x7')](_0xccfb('0xf'),auth[_0xccfb('0x8')](),controller[_0xccfb('0x10')]);router[_0xccfb('0x7')](_0xccfb('0x11'),auth[_0xccfb('0x8')](),controller[_0xccfb('0x12')]);router['get'](_0xccfb('0x13'),auth[_0xccfb('0x8')](),controller[_0xccfb('0x14')]);router[_0xccfb('0x7')](_0xccfb('0x15'),auth[_0xccfb('0x8')](),controller[_0xccfb('0x16')]);router[_0xccfb('0x7')]('/:id/messages',auth[_0xccfb('0x8')](),controller[_0xccfb('0x17')]);router[_0xccfb('0x7')]('/:id/verify',auth[_0xccfb('0x8')](),controller[_0xccfb('0x18')]);router['get'](_0xccfb('0x19'),auth['isAuthenticated'](),controller[_0xccfb('0x1a')]);router[_0xccfb('0x1b')](_0xccfb('0x1c'),auth[_0xccfb('0x8')](),controller[_0xccfb('0x1d')]);router[_0xccfb('0x1b')](_0xccfb('0xd'),auth[_0xccfb('0x8')](),controller[_0xccfb('0x1e')]);router[_0xccfb('0x1b')]('/',auth[_0xccfb('0x8')](),controller[_0xccfb('0x1f')]);router[_0xccfb('0x1b')](_0xccfb('0xf'),auth[_0xccfb('0x8')](),controller[_0xccfb('0x20')]);router[_0xccfb('0x1b')](_0xccfb('0x11'),auth[_0xccfb('0x8')](),controller[_0xccfb('0x21')]);router[_0xccfb('0x1b')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xccfb('0x22')]);router['post'](_0xccfb('0x15'),auth[_0xccfb('0x8')](),controller[_0xccfb('0x23')]);router[_0xccfb('0x1b')]('/:id/send',auth[_0xccfb('0x8')](),controller[_0xccfb('0x24')]);router[_0xccfb('0x1b')](_0xccfb('0x19'),auth[_0xccfb('0x8')](),controller[_0xccfb('0x25')]);router[_0xccfb('0x26')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xccfb('0x27')](_0xccfb('0x1c'),auth[_0xccfb('0x8')](),controller['removeDispositions']);router[_0xccfb('0x27')](_0xccfb('0xd'),auth[_0xccfb('0x8')](),controller['removeAnswers']);router[_0xccfb('0x27')](_0xccfb('0xf'),auth[_0xccfb('0x8')](),controller['removeImap']);router[_0xccfb('0x27')](_0xccfb('0x11'),auth[_0xccfb('0x8')](),controller[_0xccfb('0x28')]);router['delete'](_0xccfb('0xb'),auth[_0xccfb('0x8')](),controller['destroy']);router['delete'](_0xccfb('0x19'),auth[_0xccfb('0x8')](),controller[_0xccfb('0x29')]);module[_0xccfb('0x2a')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index addb675..158f313 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 _0x37cc=['BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING'];(function(_0xfc65a3,_0x198909){var _0x3382ee=function(_0x28984e){while(--_0x28984e){_0xfc65a3['push'](_0xfc65a3['shift']());}};_0x3382ee(++_0x198909);}(_0x37cc,0x185));var _0xc37c=function(_0x9102d5,_0x59930f){_0x9102d5=_0x9102d5-0x0;var _0x48fcbe=_0x37cc[_0x9102d5];return _0x48fcbe;};'use strict';var Sequelize=require(_0xc37c('0x0'));module[_0xc37c('0x1')]={'description':{'type':Sequelize[_0xc37c('0x2')]},'name':{'type':Sequelize[_0xc37c('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xc37c('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xc37c('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0xc37c('0x4')]},'markAsUnread':{'type':Sequelize[_0xc37c('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xc37c('0x2')],'allowNull':![],'defaultValue':_0xc37c('0x5')},'fontSize':{'type':Sequelize[_0xc37c('0x6')](0x2)[_0xc37c('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xc37c('0x4')],'defaultValue':function(){return _0xc37c('0x8');}},'notificationSound':{'type':Sequelize[_0xc37c('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc37c('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc37c('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc37c('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc37c('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc37c('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xc37c('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xc37c('0x3')],'defaultValue':![],'comment':_0xc37c('0xa'),'set':function(_0x262372){if(!_0x262372)this[_0xc37c('0xb')](_0xc37c('0xc'),null);this[_0xc37c('0xb')](_0xc37c('0xd'),_0x262372);}}}; \ No newline at end of file +var _0xf987=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED'];(function(_0x6080d0,_0x2b9b56){var _0x45cdce=function(_0x426818){while(--_0x426818){_0x6080d0['push'](_0x6080d0['shift']());}};_0x45cdce(++_0x2b9b56);}(_0xf987,0x18a));var _0x7f98=function(_0x2331b3,_0xb26fd1){_0x2331b3=_0x2331b3-0x0;var _0x3e5b15=_0xf987[_0x2331b3];return _0x3e5b15;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x7f98('0x0')]},'name':{'type':Sequelize[_0x7f98('0x0')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x7f98('0x0')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x7f98('0x1')],'defaultValue':!![]},'key':{'type':Sequelize[_0x7f98('0x0')],'allowNull':![]},'template':{'type':Sequelize[_0x7f98('0x2')]},'markAsUnread':{'type':Sequelize[_0x7f98('0x1')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x7f98('0x0')],'allowNull':![],'defaultValue':_0x7f98('0x3')},'fontSize':{'type':Sequelize[_0x7f98('0x4')](0x2)[_0x7f98('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x7f98('0x2')],'defaultValue':function(){return _0x7f98('0x6');}},'notificationSound':{'type':Sequelize[_0x7f98('0x1')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7f98('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7f98('0x1')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7f98('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7f98('0x1')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7f98('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x7f98('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2b425d){if(!_0x2b425d)this[_0x7f98('0x8')](_0x7f98('0x9'),null);this[_0x7f98('0x8')]('mandatoryDisposition',_0x2b425d);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 61b9d85..2f4eb56 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 _0xc0f5=['YYYY-MM-DD\x20HH:mm:ss','MailMessage','CmList','List','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','join','server/files/attachments','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','defaults','messageId','subject','out','Interaction','Messages','VerifySmtp','verifySmtp','Sequelize','ValidationError','addAgents','omit','spread','userMailAccount:save','removeAgents','isArray','emit','userMailAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','html-to-text','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailAccount.socket','jayson/promise','client','http','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','get','MailAccounts','UserProfileResource','stack','name','send','index','MailServerIn','MailServerOut','Smtp','mandatoryDispositionPause','MailAccount','rawAttributes','type','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','include','findAll','rows','catch','show','Imap','options','body','find','params','describe','addDisposition','MailAccountId','Disposition','getDispositions','findOne','pick','includeAll','removeDispositions','ids','addAnswer','CannedAnswer','create','getAnswers','removeAnswers','email','ListId','isNil','active','cservice','cauthentication','user','password','pass','cpassword','authentication','host','port','service','cuser','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','setSmtp','addInteraction','MailInteraction','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','sequelize','transaction','MailApplication','destroy','bulkCreate','priority','getApplications','$gte','split','format'];(function(_0x363489,_0x361c85){var _0xf1d783=function(_0x5d2cbc){while(--_0x5d2cbc){_0x363489['push'](_0x363489['shift']());}};_0xf1d783(++_0x361c85);}(_0xc0f5,0x1b1));var _0x5c0f=function(_0x1c24ae,_0x49ab3c){_0x1c24ae=_0x1c24ae-0x0;var _0x204dbd=_0xc0f5[_0x1c24ae];return _0x204dbd;};'use strict';var emlformat=require(_0x5c0f('0x0'));var rimraf=require(_0x5c0f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5c0f('0x2'));var rp=require('request-promise');var moment=require(_0x5c0f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5c0f('0x4'));var util=require(_0x5c0f('0x5'));var path=require(_0x5c0f('0x6'));var sox=require(_0x5c0f('0x7'));var csv=require(_0x5c0f('0x8'));var ejs=require(_0x5c0f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5c0f('0xa'));var squel=require(_0x5c0f('0xb'));var crypto=require(_0x5c0f('0xc'));var jsforce=require(_0x5c0f('0xd'));var deskjs=require(_0x5c0f('0xe'));var toCsv=require(_0x5c0f('0x8'));var querystring=require(_0x5c0f('0xf'));var Papa=require(_0x5c0f('0x10'));var htmlToText=require(_0x5c0f('0x11'));var juice=require(_0x5c0f('0x12'));var Redis=require(_0x5c0f('0x13'));var authService=require(_0x5c0f('0x14'));var qs=require(_0x5c0f('0x15'));var as=require(_0x5c0f('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5c0f('0x17'))('api');var utils=require(_0x5c0f('0x18'));var config=require(_0x5c0f('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x5c0f('0x1a'))['db'];config['redis']=_['defaults'](config[_0x5c0f('0x1b')],{'host':_0x5c0f('0x1c'),'port':0x18eb});var socket=require(_0x5c0f('0x1d'))(new Redis(config['redis']));require(_0x5c0f('0x1e'))['register'](socket);var jayson=require(_0x5c0f('0x1f'));var client=jayson[_0x5c0f('0x20')][_0x5c0f('0x21')]({'port':0x232b});function respondWithRpcPromise(_0x16d1b3,_0x37caa4,_0x1788a3,_0x5176a0){return new BPromise(function(_0x1f5b6a,_0x333f51){var _0x59f1e7=_0x5176a0||client;return _0x59f1e7[_0x5c0f('0x22')](_0x16d1b3,_0x1788a3)[_0x5c0f('0x23')](function(_0x210889){logger['info'](_0x5c0f('0x24'),_0x37caa4,_0x5c0f('0x25'));logger[_0x5c0f('0x26')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x37caa4,_0x5c0f('0x25'),JSON[_0x5c0f('0x27')](_0x210889));if(_0x210889[_0x5c0f('0x28')]){if(_0x210889[_0x5c0f('0x28')][_0x5c0f('0x29')]===0x1f4){logger[_0x5c0f('0x28')](_0x5c0f('0x24'),_0x37caa4,_0x210889[_0x5c0f('0x28')]['message']);return _0x333f51(_0x210889[_0x5c0f('0x28')][_0x5c0f('0x2a')]);}logger[_0x5c0f('0x28')](_0x5c0f('0x24'),_0x37caa4,_0x210889['error'][_0x5c0f('0x2a')]);return _0x1f5b6a(_0x210889['error'][_0x5c0f('0x2a')]);}else{logger['info'](_0x5c0f('0x24'),_0x37caa4,_0x5c0f('0x25'));_0x1f5b6a(_0x210889[_0x5c0f('0x2b')][_0x5c0f('0x2a')]);}})['catch'](function(_0x1f2fc4){logger[_0x5c0f('0x28')]('MailAccount,\x20%s,\x20%s',_0x37caa4,_0x1f2fc4);_0x333f51(_0x1f2fc4);});});}function respondWithStatusCode(_0x199857,_0x5624be){_0x5624be=_0x5624be||0xcc;return function(_0x281ec7){if(_0x281ec7){return _0x199857[_0x5c0f('0x2c')](_0x5624be);}return _0x199857['status'](_0x5624be)[_0x5c0f('0x2d')]();};}function respondWithResult(_0x22d5b7,_0x5cb97c){_0x5cb97c=_0x5cb97c||0xc8;return function(_0x1830bd){if(_0x1830bd){return _0x22d5b7[_0x5c0f('0x2e')](_0x5cb97c)[_0x5c0f('0x2f')](_0x1830bd);}};}function respondWithFilteredResult(_0x93532b,_0x48332b){return function(_0x33d03e){if(_0x33d03e){var _0x294c24=typeof _0x48332b[_0x5c0f('0x30')]===_0x5c0f('0x31')&&typeof _0x48332b[_0x5c0f('0x32')]===_0x5c0f('0x31');var _0x73502d=_0x33d03e[_0x5c0f('0x33')];var _0x78ad8f=_0x294c24?0x0:_0x48332b[_0x5c0f('0x30')];var _0x5b7faf=_0x294c24?_0x33d03e[_0x5c0f('0x33')]:_0x48332b['offset']+_0x48332b[_0x5c0f('0x32')];var _0x4f9b96;if(_0x5b7faf>=_0x73502d){_0x5b7faf=_0x73502d;_0x4f9b96=0xc8;}else{_0x4f9b96=0xce;}_0x93532b[_0x5c0f('0x2e')](_0x4f9b96);return _0x93532b[_0x5c0f('0x34')](_0x5c0f('0x35'),_0x78ad8f+'-'+_0x5b7faf+'/'+_0x73502d)['json'](_0x33d03e);}return null;};}function patchUpdates(_0x503d0b){return function(_0x29955a){try{jsonpatch[_0x5c0f('0x36')](_0x29955a,_0x503d0b,!![]);}catch(_0x4bc570){return BPromise['reject'](_0x4bc570);}return _0x29955a[_0x5c0f('0x37')]();};}function saveUpdates(_0x2bd12a,_0x4b8c77){return function(_0x524385){if(_0x524385){return _0x524385[_0x5c0f('0x38')](_0x2bd12a)[_0x5c0f('0x23')](function(_0x16d004){return _0x16d004;});}return null;};}function removeEntity(_0x5b4b1d,_0x27b5de){return function(_0x544f34){if(_0x544f34){return _0x544f34['destroy']()[_0x5c0f('0x23')](function(){var _0x43a191=_0x544f34[_0x5c0f('0x39')]({'plain':!![]});var _0x53c9b3=_0x5c0f('0x3a');return db[_0x5c0f('0x3b')]['destroy']({'where':{'type':_0x53c9b3,'resourceId':_0x43a191['id']}})['then'](function(){return _0x544f34;});})[_0x5c0f('0x23')](function(){_0x5b4b1d[_0x5c0f('0x2e')](0xcc)[_0x5c0f('0x2d')]();});}};}function handleEntityNotFound(_0x1dc024,_0x233e9c){return function(_0x462aa9){if(!_0x462aa9){_0x1dc024[_0x5c0f('0x2c')](0x194);}return _0x462aa9;};}function handleError(_0x55e043,_0x17e292){_0x17e292=_0x17e292||0x1f4;return function(_0x4de25c){logger[_0x5c0f('0x28')](_0x4de25c[_0x5c0f('0x3c')]);if(_0x4de25c[_0x5c0f('0x3d')]){delete _0x4de25c['name'];}_0x55e043[_0x5c0f('0x2e')](_0x17e292)[_0x5c0f('0x3e')](_0x4de25c);};}exports[_0x5c0f('0x3f')]=function(_0x171b2a,_0x1088e2){var _0x3dc564={'include':[{'model':db[_0x5c0f('0x40')],'as':'Imap'},{'model':db[_0x5c0f('0x41')],'as':_0x5c0f('0x42')},{'model':db['Pause'],'as':_0x5c0f('0x43')}]},_0x1706b9={},_0x1f2627={'count':0x0,'rows':[]};var _0x4d665a=_['map'](db[_0x5c0f('0x44')][_0x5c0f('0x45')],function(_0x29ffde){return{'name':_0x29ffde['fieldName'],'type':_0x29ffde[_0x5c0f('0x46')]['key']};});_0x1706b9[_0x5c0f('0x47')]=_[_0x5c0f('0x48')](_0x4d665a,_0x5c0f('0x3d'));_0x1706b9[_0x5c0f('0x49')]=_[_0x5c0f('0x4a')](_0x171b2a[_0x5c0f('0x49')]);_0x1706b9['filters']=_[_0x5c0f('0x4b')](_0x1706b9[_0x5c0f('0x47')],_0x1706b9['query']);_0x3dc564[_0x5c0f('0x4c')]=_[_0x5c0f('0x4b')](_0x1706b9[_0x5c0f('0x47')],qs[_0x5c0f('0x4d')](_0x171b2a[_0x5c0f('0x49')][_0x5c0f('0x4d')]));_0x3dc564[_0x5c0f('0x4c')]=_0x3dc564[_0x5c0f('0x4c')][_0x5c0f('0x4e')]?_0x3dc564[_0x5c0f('0x4c')]:_0x1706b9[_0x5c0f('0x47')];if(!_0x171b2a['query'][_0x5c0f('0x4f')](_0x5c0f('0x50'))){_0x3dc564['limit']=qs[_0x5c0f('0x32')](_0x171b2a[_0x5c0f('0x49')]['limit']);_0x3dc564[_0x5c0f('0x30')]=qs[_0x5c0f('0x30')](_0x171b2a['query'][_0x5c0f('0x30')]);}_0x3dc564[_0x5c0f('0x51')]=qs[_0x5c0f('0x52')](_0x171b2a[_0x5c0f('0x49')][_0x5c0f('0x52')]);_0x3dc564[_0x5c0f('0x53')]=qs[_0x5c0f('0x54')](_['pick'](_0x171b2a['query'],_0x1706b9[_0x5c0f('0x54')]),_0x4d665a);if(_0x171b2a[_0x5c0f('0x49')][_0x5c0f('0x55')]){_0x3dc564['where']=_[_0x5c0f('0x56')](_0x3dc564[_0x5c0f('0x53')],{'$or':_['map'](_0x4d665a,function(_0x346095){if(_0x346095[_0x5c0f('0x46')]!=='VIRTUAL'){var _0x1a1b8b={};_0x1a1b8b[_0x346095[_0x5c0f('0x3d')]]={'$like':'%'+_0x171b2a[_0x5c0f('0x49')]['filter']+'%'};return _0x1a1b8b;}})});}_0x3dc564=_[_0x5c0f('0x56')]({},_0x3dc564,_0x171b2a['options']);var _0x34926d={'where':_0x3dc564[_0x5c0f('0x53')]};return db['MailAccount'][_0x5c0f('0x33')](_0x34926d)['then'](function(_0x86aaa5){_0x1f2627[_0x5c0f('0x33')]=_0x86aaa5;if(_0x171b2a[_0x5c0f('0x49')]['includeAll']){_0x3dc564[_0x5c0f('0x57')]=[{'all':!![]}];}return db['MailAccount'][_0x5c0f('0x58')](_0x3dc564);})[_0x5c0f('0x23')](function(_0x25d802){_0x1f2627[_0x5c0f('0x59')]=_0x25d802;return _0x1f2627;})['then'](respondWithFilteredResult(_0x1088e2,_0x3dc564))[_0x5c0f('0x5a')](handleError(_0x1088e2,null));};exports[_0x5c0f('0x5b')]=function(_0x5ec352,_0x2f3fce){var _0x315418={'raw':![],'where':{'id':_0x5ec352['params']['id']},'include':[{'model':db[_0x5c0f('0x40')],'as':_0x5c0f('0x5c')},{'model':db[_0x5c0f('0x41')],'as':_0x5c0f('0x42')},{'model':db['Pause'],'as':_0x5c0f('0x43')}]},_0x1ad068={};_0x1ad068['model']=_[_0x5c0f('0x4a')](db[_0x5c0f('0x44')][_0x5c0f('0x45')]);_0x1ad068[_0x5c0f('0x49')]=_['keys'](_0x5ec352[_0x5c0f('0x49')]);_0x1ad068['filters']=_[_0x5c0f('0x4b')](_0x1ad068[_0x5c0f('0x47')],_0x1ad068['query']);_0x315418[_0x5c0f('0x4c')]=_[_0x5c0f('0x4b')](_0x1ad068['model'],qs[_0x5c0f('0x4d')](_0x5ec352[_0x5c0f('0x49')]['fields']));_0x315418[_0x5c0f('0x4c')]=_0x315418[_0x5c0f('0x4c')][_0x5c0f('0x4e')]?_0x315418[_0x5c0f('0x4c')]:_0x1ad068[_0x5c0f('0x47')];if(_0x5ec352[_0x5c0f('0x49')]['includeAll']){_0x315418[_0x5c0f('0x57')]=[{'all':!![]}];}_0x315418=_['merge']({},_0x315418,_0x5ec352[_0x5c0f('0x5d')]);return db[_0x5c0f('0x44')]['find'](_0x315418)[_0x5c0f('0x23')](handleEntityNotFound(_0x2f3fce,null))['then'](respondWithResult(_0x2f3fce,null))[_0x5c0f('0x5a')](handleError(_0x2f3fce,null));};exports['update']=function(_0x18e25d,_0x529ce3){if(_0x18e25d[_0x5c0f('0x5e')]['id']){delete _0x18e25d[_0x5c0f('0x5e')]['id'];}return db[_0x5c0f('0x44')][_0x5c0f('0x5f')]({'where':{'id':_0x18e25d[_0x5c0f('0x60')]['id']},'include':[{'model':db[_0x5c0f('0x40')],'as':_0x5c0f('0x5c')},{'model':db[_0x5c0f('0x41')],'as':_0x5c0f('0x42')},{'model':db['Pause'],'as':_0x5c0f('0x43')}]})['then'](handleEntityNotFound(_0x529ce3,null))[_0x5c0f('0x23')](saveUpdates(_0x18e25d[_0x5c0f('0x5e')],null))[_0x5c0f('0x23')](function(_0x58fe66){if(_0x58fe66&&_0x18e25d[_0x5c0f('0x5e')]['Imap']){return db['MailServerIn'][_0x5c0f('0x38')](_0x18e25d[_0x5c0f('0x5e')]['Imap'],{'where':{'MailAccountId':_0x58fe66['id']}})[_0x5c0f('0x23')](function(){return _0x58fe66;});}return _0x58fe66;})[_0x5c0f('0x23')](function(_0x2f463c){if(_0x2f463c&&_0x18e25d['body'][_0x5c0f('0x42')]){return db[_0x5c0f('0x41')]['update'](_0x18e25d[_0x5c0f('0x5e')][_0x5c0f('0x42')],{'where':{'MailAccountId':_0x2f463c['id']}})['then'](function(){return _0x2f463c;});}return _0x2f463c;})[_0x5c0f('0x23')](respondWithResult(_0x529ce3,null))[_0x5c0f('0x5a')](handleError(_0x529ce3,null));};exports[_0x5c0f('0x61')]=function(_0x20581a,_0x2b4127){return db[_0x5c0f('0x44')][_0x5c0f('0x61')]()[_0x5c0f('0x23')](respondWithResult(_0x2b4127,null))['catch'](handleError(_0x2b4127,null));};exports[_0x5c0f('0x62')]=function(_0x1f16f0,_0x4c70a3,_0x33baee){if(_0x1f16f0[_0x5c0f('0x5e')]['id']){delete _0x1f16f0[_0x5c0f('0x5e')]['id'];}return db[_0x5c0f('0x44')][_0x5c0f('0x5f')]({'where':{'id':_0x1f16f0['params']['id']}})[_0x5c0f('0x23')](handleEntityNotFound(_0x4c70a3,null))[_0x5c0f('0x23')](function(_0x24712b){if(_0x24712b){_0x1f16f0[_0x5c0f('0x5e')][_0x5c0f('0x63')]=_0x24712b['id'];return db[_0x5c0f('0x64')]['create'](_0x1f16f0['body']);}})[_0x5c0f('0x23')](respondWithResult(_0x4c70a3,null))[_0x5c0f('0x5a')](handleError(_0x4c70a3,null));};exports[_0x5c0f('0x65')]=function(_0x1570df,_0x551dd2,_0x764e8f){var _0x3678c8={'raw':![],'where':{}};var _0x1e8001={};var _0x3588de={'count':0x0,'rows':[]};return db[_0x5c0f('0x44')][_0x5c0f('0x66')]({'where':{'id':_0x1570df[_0x5c0f('0x60')]['id']}})[_0x5c0f('0x23')](handleEntityNotFound(_0x551dd2,null))['then'](function(_0x15056e){if(_0x15056e){_0x1e8001[_0x5c0f('0x47')]=_[_0x5c0f('0x4a')](db[_0x5c0f('0x64')][_0x5c0f('0x45')]);_0x1e8001['query']=_['keys'](_0x1570df[_0x5c0f('0x49')]);_0x1e8001[_0x5c0f('0x54')]=_['intersection'](_0x1e8001[_0x5c0f('0x47')],_0x1e8001[_0x5c0f('0x49')]);_0x3678c8['attributes']=_[_0x5c0f('0x4b')](_0x1e8001['model'],qs[_0x5c0f('0x4d')](_0x1570df[_0x5c0f('0x49')]['fields']));_0x3678c8[_0x5c0f('0x4c')]=_0x3678c8['attributes'][_0x5c0f('0x4e')]?_0x3678c8[_0x5c0f('0x4c')]:_0x1e8001[_0x5c0f('0x47')];if(!_0x1570df[_0x5c0f('0x49')][_0x5c0f('0x4f')](_0x5c0f('0x50'))){_0x3678c8[_0x5c0f('0x32')]=qs[_0x5c0f('0x32')](_0x1570df[_0x5c0f('0x49')][_0x5c0f('0x32')]);_0x3678c8[_0x5c0f('0x30')]=qs[_0x5c0f('0x30')](_0x1570df['query'][_0x5c0f('0x30')]);}_0x3678c8['order']=qs[_0x5c0f('0x52')](_0x1570df['query'][_0x5c0f('0x52')]);_0x3678c8[_0x5c0f('0x53')]=qs[_0x5c0f('0x54')](_[_0x5c0f('0x67')](_0x1570df[_0x5c0f('0x49')],_0x1e8001[_0x5c0f('0x54')]));_0x3678c8[_0x5c0f('0x53')]['MailAccountId']=_0x15056e['id'];if(_0x1570df[_0x5c0f('0x49')][_0x5c0f('0x55')]){_0x3678c8[_0x5c0f('0x53')]=_[_0x5c0f('0x56')](_0x3678c8['where'],{'$or':_['map'](_0x3678c8[_0x5c0f('0x4c')],function(_0x4af9ca){var _0x155e2e={};_0x155e2e[_0x4af9ca]={'$like':'%'+_0x1570df[_0x5c0f('0x49')][_0x5c0f('0x55')]+'%'};return _0x155e2e;})});}_0x3678c8=_[_0x5c0f('0x56')]({},_0x3678c8,_0x1570df[_0x5c0f('0x5d')]);return db[_0x5c0f('0x64')][_0x5c0f('0x33')]({'where':_0x3678c8[_0x5c0f('0x53')]})[_0x5c0f('0x23')](function(_0x721bbb){_0x3588de[_0x5c0f('0x33')]=_0x721bbb;if(_0x1570df[_0x5c0f('0x49')][_0x5c0f('0x68')]){_0x3678c8[_0x5c0f('0x57')]=[{'all':!![]}];}return db['Disposition'][_0x5c0f('0x58')](_0x3678c8);})[_0x5c0f('0x23')](function(_0x3f3c8d){_0x3588de[_0x5c0f('0x59')]=_0x3f3c8d;return _0x3588de;});}})[_0x5c0f('0x23')](respondWithFilteredResult(_0x551dd2,_0x3678c8))[_0x5c0f('0x5a')](handleError(_0x551dd2,null));};exports[_0x5c0f('0x69')]=function(_0x39cf7c,_0x3be97f,_0x3ba176){return db[_0x5c0f('0x44')][_0x5c0f('0x5f')]({'where':{'id':_0x39cf7c[_0x5c0f('0x60')]['id']}})[_0x5c0f('0x23')](handleEntityNotFound(_0x3be97f,null))['then'](function(_0x24410a){if(_0x24410a){return _0x24410a[_0x5c0f('0x69')](_0x39cf7c['query'][_0x5c0f('0x6a')]);}})[_0x5c0f('0x23')](respondWithStatusCode(_0x3be97f,null))[_0x5c0f('0x5a')](handleError(_0x3be97f,null));};exports[_0x5c0f('0x6b')]=function(_0x19de75,_0x4adbdb,_0x5a6adc){if(_0x19de75[_0x5c0f('0x5e')]['id']){delete _0x19de75[_0x5c0f('0x5e')]['id'];}return db['MailAccount'][_0x5c0f('0x5f')]({'where':{'id':_0x19de75[_0x5c0f('0x60')]['id']}})[_0x5c0f('0x23')](handleEntityNotFound(_0x4adbdb,null))[_0x5c0f('0x23')](function(_0x2b3f8b){if(_0x2b3f8b){_0x19de75[_0x5c0f('0x5e')]['MailAccountId']=_0x2b3f8b['id'];return db[_0x5c0f('0x6c')][_0x5c0f('0x6d')](_0x19de75[_0x5c0f('0x5e')]);}})[_0x5c0f('0x23')](respondWithResult(_0x4adbdb,null))['catch'](handleError(_0x4adbdb,null));};exports[_0x5c0f('0x6e')]=function(_0x78ac0,_0x36deab,_0x1e68b7){var _0xf56f50={'raw':![],'where':{}};var _0x286ef0={};var _0x449e83={'count':0x0,'rows':[]};return db['MailAccount'][_0x5c0f('0x66')]({'where':{'id':_0x78ac0['params']['id']}})[_0x5c0f('0x23')](handleEntityNotFound(_0x36deab,null))[_0x5c0f('0x23')](function(_0x437d00){if(_0x437d00){_0x286ef0[_0x5c0f('0x47')]=_[_0x5c0f('0x4a')](db['CannedAnswer'][_0x5c0f('0x45')]);_0x286ef0[_0x5c0f('0x49')]=_['keys'](_0x78ac0[_0x5c0f('0x49')]);_0x286ef0[_0x5c0f('0x54')]=_[_0x5c0f('0x4b')](_0x286ef0[_0x5c0f('0x47')],_0x286ef0['query']);_0xf56f50[_0x5c0f('0x4c')]=_[_0x5c0f('0x4b')](_0x286ef0['model'],qs['fields'](_0x78ac0[_0x5c0f('0x49')]['fields']));_0xf56f50[_0x5c0f('0x4c')]=_0xf56f50[_0x5c0f('0x4c')][_0x5c0f('0x4e')]?_0xf56f50[_0x5c0f('0x4c')]:_0x286ef0['model'];if(!_0x78ac0[_0x5c0f('0x49')][_0x5c0f('0x4f')](_0x5c0f('0x50'))){_0xf56f50[_0x5c0f('0x32')]=qs[_0x5c0f('0x32')](_0x78ac0[_0x5c0f('0x49')][_0x5c0f('0x32')]);_0xf56f50['offset']=qs['offset'](_0x78ac0[_0x5c0f('0x49')][_0x5c0f('0x30')]);}_0xf56f50['order']=qs['sort'](_0x78ac0[_0x5c0f('0x49')][_0x5c0f('0x52')]);_0xf56f50['where']=qs[_0x5c0f('0x54')](_[_0x5c0f('0x67')](_0x78ac0[_0x5c0f('0x49')],_0x286ef0['filters']));_0xf56f50[_0x5c0f('0x53')][_0x5c0f('0x63')]=_0x437d00['id'];if(_0x78ac0['query'][_0x5c0f('0x55')]){_0xf56f50['where']=_[_0x5c0f('0x56')](_0xf56f50[_0x5c0f('0x53')],{'$or':_[_0x5c0f('0x48')](_0xf56f50[_0x5c0f('0x4c')],function(_0xf5fdf7){var _0x279a8b={};_0x279a8b[_0xf5fdf7]={'$like':'%'+_0x78ac0[_0x5c0f('0x49')]['filter']+'%'};return _0x279a8b;})});}_0xf56f50=_[_0x5c0f('0x56')]({},_0xf56f50,_0x78ac0[_0x5c0f('0x5d')]);return db[_0x5c0f('0x6c')][_0x5c0f('0x33')]({'where':_0xf56f50[_0x5c0f('0x53')]})[_0x5c0f('0x23')](function(_0x1e7bb0){_0x449e83[_0x5c0f('0x33')]=_0x1e7bb0;if(_0x78ac0['query']['includeAll']){_0xf56f50[_0x5c0f('0x57')]=[{'all':!![]}];}return db[_0x5c0f('0x6c')][_0x5c0f('0x58')](_0xf56f50);})[_0x5c0f('0x23')](function(_0x361a87){_0x449e83[_0x5c0f('0x59')]=_0x361a87;return _0x449e83;});}})['then'](respondWithFilteredResult(_0x36deab,_0xf56f50))[_0x5c0f('0x5a')](handleError(_0x36deab,null));};exports['removeAnswers']=function(_0x18f815,_0x392fbc,_0x1842c5){return db[_0x5c0f('0x44')][_0x5c0f('0x5f')]({'where':{'id':_0x18f815[_0x5c0f('0x60')]['id']}})[_0x5c0f('0x23')](handleEntityNotFound(_0x392fbc,null))[_0x5c0f('0x23')](function(_0x530501){if(_0x530501){return _0x530501[_0x5c0f('0x6f')](_0x18f815['query'][_0x5c0f('0x6a')]);}})[_0x5c0f('0x23')](respondWithStatusCode(_0x392fbc,null))[_0x5c0f('0x5a')](handleError(_0x392fbc,null));};exports[_0x5c0f('0x6d')]=function(_0x45858c,_0x3423c8){var _0x36a0a2={'name':_0x45858c[_0x5c0f('0x5e')][_0x5c0f('0x3d')],'key':_0x45858c[_0x5c0f('0x5e')]['key'],'email':_0x45858c[_0x5c0f('0x5e')][_0x5c0f('0x70')],'ListId':_0x45858c[_0x5c0f('0x5e')][_0x5c0f('0x71')],'active':!_[_0x5c0f('0x72')](_0x45858c[_0x5c0f('0x5e')][_0x5c0f('0x73')])?_0x45858c[_0x5c0f('0x5e')]['active']:!![],'description':_0x45858c['body']['description']||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x45858c[_0x5c0f('0x5e')][_0x5c0f('0x74')])){if(_0x45858c[_0x5c0f('0x5e')][_0x5c0f('0x75')]){_0x36a0a2[_0x5c0f('0x5c')][_0x5c0f('0x76')]=_0x36a0a2[_0x5c0f('0x42')][_0x5c0f('0x76')]=_0x45858c[_0x5c0f('0x5e')]['cuser'];_0x36a0a2['Imap'][_0x5c0f('0x77')]=_0x36a0a2[_0x5c0f('0x42')][_0x5c0f('0x78')]=_0x45858c[_0x5c0f('0x5e')][_0x5c0f('0x79')];}else{_0x36a0a2[_0x5c0f('0x5c')][_0x5c0f('0x7a')]=_0x36a0a2[_0x5c0f('0x42')][_0x5c0f('0x7a')]=![];}_0x36a0a2[_0x5c0f('0x5c')][_0x5c0f('0x7b')]=_0x45858c[_0x5c0f('0x5e')]['Imap']['host'];_0x36a0a2[_0x5c0f('0x5c')][_0x5c0f('0x7c')]=_0x45858c[_0x5c0f('0x5e')][_0x5c0f('0x5c')][_0x5c0f('0x7c')];_0x36a0a2[_0x5c0f('0x42')]['host']=_0x45858c[_0x5c0f('0x5e')][_0x5c0f('0x42')][_0x5c0f('0x7b')];_0x36a0a2['Smtp'][_0x5c0f('0x7c')]=_0x45858c[_0x5c0f('0x5e')]['Smtp'][_0x5c0f('0x7c')];}else{_0x36a0a2[_0x5c0f('0x5c')][_0x5c0f('0x7d')]=_0x36a0a2[_0x5c0f('0x42')][_0x5c0f('0x7d')]=_0x45858c[_0x5c0f('0x5e')][_0x5c0f('0x74')];_0x36a0a2[_0x5c0f('0x5c')][_0x5c0f('0x76')]=_0x36a0a2[_0x5c0f('0x42')][_0x5c0f('0x76')]=_0x45858c[_0x5c0f('0x5e')][_0x5c0f('0x7e')];_0x36a0a2[_0x5c0f('0x5c')][_0x5c0f('0x77')]=_0x36a0a2[_0x5c0f('0x42')][_0x5c0f('0x78')]=_0x45858c[_0x5c0f('0x5e')]['cpassword'];}return db[_0x5c0f('0x44')]['create'](_0x36a0a2,{'include':[{'model':db[_0x5c0f('0x41')],'as':_0x5c0f('0x42')},{'model':db[_0x5c0f('0x40')],'as':'Imap'}]})[_0x5c0f('0x23')](function(_0x45ed21){var _0x531aac=_0x45858c[_0x5c0f('0x76')][_0x5c0f('0x39')]({'plain':!![]});if(!_0x531aac)throw new Error(_0x5c0f('0x7f'));if(_0x531aac[_0x5c0f('0x80')]==='user'){var _0x190e75=_0x45ed21[_0x5c0f('0x39')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x5c0f('0x3a'),'userProfileId':_0x531aac[_0x5c0f('0x81')]},'raw':!![]})[_0x5c0f('0x23')](function(_0x382acb){if(_0x382acb&&_0x382acb['autoAssociation']===0x0){return db[_0x5c0f('0x3b')]['create']({'name':_0x190e75[_0x5c0f('0x3d')],'resourceId':_0x190e75['id'],'type':_0x382acb[_0x5c0f('0x3d')],'sectionId':_0x382acb['id']},{})[_0x5c0f('0x23')](function(){return _0x45ed21;});}else{return _0x45ed21;}})[_0x5c0f('0x5a')](function(_0x494a7b){logger[_0x5c0f('0x28')](_0x5c0f('0x82'),_0x494a7b);throw _0x494a7b;});}return _0x45ed21;})[_0x5c0f('0x23')](respondWithResult(_0x3423c8,0xc9))[_0x5c0f('0x5a')](handleError(_0x3423c8,null));};exports[_0x5c0f('0x83')]=function(_0x7c0751,_0x5f5b10,_0x25b31a){return db[_0x5c0f('0x44')][_0x5c0f('0x66')]({'where':{'id':_0x7c0751[_0x5c0f('0x60')]['id']}})[_0x5c0f('0x23')](handleEntityNotFound(_0x5f5b10,null))[_0x5c0f('0x23')](function(_0x4a6ccb){if(_0x4a6ccb){return _0x4a6ccb[_0x5c0f('0x83')]();}return null;})[_0x5c0f('0x23')](respondWithResult(_0x5f5b10,null))['catch'](handleError(_0x5f5b10,null));};exports[_0x5c0f('0x84')]=function(_0x147ca4,_0xe97ff6,_0x5eb837){if(_0x147ca4[_0x5c0f('0x5e')]['id']){delete _0x147ca4[_0x5c0f('0x5e')]['id'];}return db[_0x5c0f('0x44')]['find']({'where':{'id':_0x147ca4[_0x5c0f('0x60')]['id']}})[_0x5c0f('0x23')](handleEntityNotFound(_0xe97ff6,null))[_0x5c0f('0x23')](function(_0x16eb9c){if(_0x16eb9c){_0x147ca4[_0x5c0f('0x5e')][_0x5c0f('0x63')]=_0x16eb9c['id'];return db['MailServerIn'][_0x5c0f('0x6d')](_0x147ca4['body']);}})[_0x5c0f('0x23')](respondWithResult(_0xe97ff6,null))[_0x5c0f('0x5a')](handleError(_0xe97ff6,null));};exports[_0x5c0f('0x85')]=function(_0x566e11,_0x5a0cba,_0xcb617e){return db[_0x5c0f('0x44')][_0x5c0f('0x66')]({'where':{'id':_0x566e11[_0x5c0f('0x60')]['id']}})[_0x5c0f('0x23')](handleEntityNotFound(_0x5a0cba,null))[_0x5c0f('0x23')](function(_0x1226b3){if(_0x1226b3){return _0x1226b3[_0x5c0f('0x86')](null);}return null;})['then'](respondWithStatusCode(_0x5a0cba,null))[_0x5c0f('0x5a')](handleError(_0x5a0cba,null));};exports['getSmtp']=function(_0xb51820,_0x295af9,_0x2447d3){return db['MailAccount'][_0x5c0f('0x66')]({'where':{'id':_0xb51820[_0x5c0f('0x60')]['id']}})[_0x5c0f('0x23')](handleEntityNotFound(_0x295af9,null))[_0x5c0f('0x23')](function(_0x504dba){if(_0x504dba){return _0x504dba[_0x5c0f('0x87')]();}return null;})[_0x5c0f('0x23')](respondWithResult(_0x295af9,null))[_0x5c0f('0x5a')](handleError(_0x295af9,null));};exports[_0x5c0f('0x88')]=function(_0x27945f,_0x2b1fbd,_0x1703f2){if(_0x27945f[_0x5c0f('0x5e')]['id']){delete _0x27945f[_0x5c0f('0x5e')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x27945f[_0x5c0f('0x60')]['id']}})[_0x5c0f('0x23')](handleEntityNotFound(_0x2b1fbd,null))['then'](function(_0x50074f){if(_0x50074f){_0x27945f[_0x5c0f('0x5e')][_0x5c0f('0x63')]=_0x50074f['id'];return db[_0x5c0f('0x41')][_0x5c0f('0x6d')](_0x27945f[_0x5c0f('0x5e')]);}})[_0x5c0f('0x23')](respondWithResult(_0x2b1fbd,null))[_0x5c0f('0x5a')](handleError(_0x2b1fbd,null));};exports['removeSmtp']=function(_0x56ada7,_0x2a61dc,_0x324fa0){return db[_0x5c0f('0x44')][_0x5c0f('0x66')]({'where':{'id':_0x56ada7['params']['id']}})[_0x5c0f('0x23')](handleEntityNotFound(_0x2a61dc,null))[_0x5c0f('0x23')](function(_0x46b788){if(_0x46b788){return _0x46b788[_0x5c0f('0x89')](null);}return null;})[_0x5c0f('0x23')](respondWithStatusCode(_0x2a61dc,null))[_0x5c0f('0x5a')](handleError(_0x2a61dc,null));};exports[_0x5c0f('0x8a')]=function(_0x4c2d1c,_0x260082,_0x9fe735){return db[_0x5c0f('0x8b')]['find']({'where':{'id':_0x4c2d1c['params']['id']}})[_0x5c0f('0x23')](handleEntityNotFound(_0x260082,null))[_0x5c0f('0x23')](function(_0x3da762){if(_0x3da762){return _0x3da762[_0x5c0f('0x8a')](_0x4c2d1c[_0x5c0f('0x5e')][_0x5c0f('0x6a')],_['omit'](_0x4c2d1c[_0x5c0f('0x5e')],['ids','id'])||{});}})[_0x5c0f('0x23')](respondWithResult(_0x260082,null))[_0x5c0f('0x5a')](handleError(_0x260082,null));};exports[_0x5c0f('0x8c')]=function(_0x28afa4,_0x2aadbe,_0x1917ef){var _0x2282a3={'raw':![],'where':{}};var _0x2e1161={};var _0x36e88b={'count':0x0,'rows':[]};return db[_0x5c0f('0x44')]['findOne']({'where':{'id':_0x28afa4[_0x5c0f('0x60')]['id']}})[_0x5c0f('0x23')](handleEntityNotFound(_0x2aadbe,null))['then'](function(_0x48e9d3){if(_0x48e9d3){_0x2e1161[_0x5c0f('0x47')]=_[_0x5c0f('0x4a')](db[_0x5c0f('0x8b')][_0x5c0f('0x45')]);_0x2e1161[_0x5c0f('0x49')]=_[_0x5c0f('0x4a')](_0x28afa4[_0x5c0f('0x49')]);_0x2e1161[_0x5c0f('0x54')]=_['intersection'](_0x2e1161[_0x5c0f('0x47')],_0x2e1161[_0x5c0f('0x49')]);_0x2282a3[_0x5c0f('0x4c')]=_[_0x5c0f('0x4b')](_0x2e1161[_0x5c0f('0x47')],qs[_0x5c0f('0x4d')](_0x28afa4[_0x5c0f('0x49')][_0x5c0f('0x4d')]));_0x2282a3[_0x5c0f('0x4c')]=_0x2282a3[_0x5c0f('0x4c')]['length']?_0x2282a3[_0x5c0f('0x4c')]:_0x2e1161['model'];if(!_0x28afa4['query'][_0x5c0f('0x4f')](_0x5c0f('0x50'))){_0x2282a3[_0x5c0f('0x32')]=qs['limit'](_0x28afa4[_0x5c0f('0x49')][_0x5c0f('0x32')]);_0x2282a3[_0x5c0f('0x30')]=qs['offset'](_0x28afa4[_0x5c0f('0x49')][_0x5c0f('0x30')]);}_0x2282a3['order']=qs[_0x5c0f('0x52')](_0x28afa4['query'][_0x5c0f('0x52')]);_0x2282a3[_0x5c0f('0x53')]=qs['filters'](_[_0x5c0f('0x67')](_0x28afa4[_0x5c0f('0x49')],_0x2e1161['filters']));_0x2282a3[_0x5c0f('0x53')][_0x5c0f('0x63')]=_0x48e9d3['id'];if(_0x28afa4[_0x5c0f('0x49')][_0x5c0f('0x55')]){_0x2282a3['where']=_[_0x5c0f('0x56')](_0x2282a3[_0x5c0f('0x53')],{'$or':_[_0x5c0f('0x48')](_0x2282a3[_0x5c0f('0x4c')],function(_0x52f5fb){var _0x1b265d={};_0x1b265d[_0x52f5fb]={'$like':'%'+_0x28afa4[_0x5c0f('0x49')][_0x5c0f('0x55')]+'%'};return _0x1b265d;})});}_0x2282a3=_[_0x5c0f('0x56')]({},_0x2282a3,_0x28afa4['options']);return db[_0x5c0f('0x8b')][_0x5c0f('0x33')]({'where':_0x2282a3[_0x5c0f('0x53')]})[_0x5c0f('0x23')](function(_0x2fad02){_0x36e88b[_0x5c0f('0x33')]=_0x2fad02;if(_0x28afa4[_0x5c0f('0x49')]['includeAll']){_0x2282a3[_0x5c0f('0x57')]=[{'model':db[_0x5c0f('0x8d')],'as':_0x5c0f('0x8e'),'required':![]},{'model':db[_0x5c0f('0x8f')],'as':_0x5c0f('0x90'),'attributes':[_0x5c0f('0x3d'),_0x5c0f('0x91'),_0x5c0f('0x92')],'required':![]},{'model':db[_0x5c0f('0x93')],'as':_0x5c0f('0x94'),'attributes':['id',_0x5c0f('0x3d'),_0x5c0f('0x95')],'where':_0x28afa4[_0x5c0f('0x49')][_0x5c0f('0x96')]?{'id':_0x28afa4[_0x5c0f('0x49')][_0x5c0f('0x96')]}:undefined,'required':_0x28afa4[_0x5c0f('0x49')]['tag']?!![]:![]}];}return db[_0x5c0f('0x8b')]['findAll'](_0x2282a3);})[_0x5c0f('0x23')](function(_0x316c1e){_0x36e88b[_0x5c0f('0x59')]=_0x316c1e;return _0x36e88b;});}})[_0x5c0f('0x23')](respondWithFilteredResult(_0x2aadbe,_0x2282a3))['catch'](handleError(_0x2aadbe,null));};exports['addApplications']=function(_0xea8a3b,_0x3ffa22,_0x5ecb32){return db[_0x5c0f('0x44')][_0x5c0f('0x66')]({'where':{'id':_0xea8a3b[_0x5c0f('0x60')]['id']}})[_0x5c0f('0x23')](handleEntityNotFound(_0x3ffa22,null))[_0x5c0f('0x23')](function(_0x461d3f){if(_0x461d3f){return db[_0x5c0f('0x97')][_0x5c0f('0x98')](function(_0x33bb54){return db[_0x5c0f('0x99')][_0x5c0f('0x9a')]({'where':{'MailAccountId':_0xea8a3b[_0x5c0f('0x60')]['id']},'transaction':_0x33bb54})[_0x5c0f('0x23')](function(_0x168a94){var _0xd21a05=_['map'](_0xea8a3b[_0x5c0f('0x5e')],function(_0x487894){_0x487894[_0x5c0f('0x63')]=_0xea8a3b['params']['id'];return _0x487894;});return db[_0x5c0f('0x99')][_0x5c0f('0x9b')](_0xd21a05,{'transaction':_0x33bb54});});})[_0x5c0f('0x23')](function(){return db[_0x5c0f('0x99')]['findAndCountAll']({'where':{'MailAccountId':_0xea8a3b['params']['id']},'order':_0x5c0f('0x9c')});});}})['then'](respondWithResult(_0x3ffa22,null))[_0x5c0f('0x5a')](handleError(_0x3ffa22,null));};exports[_0x5c0f('0x9d')]=function(_0x22d417,_0x3ebbfe,_0x3be123){var _0x5dfe93={};var _0x1b2929={};var _0x3a2c7c;var _0x187511;return db[_0x5c0f('0x44')][_0x5c0f('0x66')]({'where':{'id':_0x22d417[_0x5c0f('0x60')]['id']}})[_0x5c0f('0x23')](handleEntityNotFound(_0x3ebbfe,null))[_0x5c0f('0x23')](function(_0x2c90ca){if(_0x2c90ca){_0x3a2c7c=_0x2c90ca;_0x1b2929[_0x5c0f('0x47')]=_[_0x5c0f('0x4a')](db[_0x5c0f('0x99')][_0x5c0f('0x45')]);_0x1b2929['query']=_['keys'](_0x22d417[_0x5c0f('0x49')]);_0x1b2929['filters']=_[_0x5c0f('0x4b')](_0x1b2929[_0x5c0f('0x47')],_0x1b2929[_0x5c0f('0x49')]);_0x5dfe93[_0x5c0f('0x4c')]=_[_0x5c0f('0x4b')](_0x1b2929[_0x5c0f('0x47')],qs['fields'](_0x22d417[_0x5c0f('0x49')]['fields']));_0x5dfe93[_0x5c0f('0x4c')]=_0x5dfe93[_0x5c0f('0x4c')]['length']?_0x5dfe93['attributes']:_0x1b2929['model'];_0x5dfe93[_0x5c0f('0x51')]=qs[_0x5c0f('0x52')](_0x22d417[_0x5c0f('0x49')]['sort']);_0x5dfe93['where']=qs[_0x5c0f('0x54')](_[_0x5c0f('0x67')](_0x22d417[_0x5c0f('0x49')],_0x1b2929[_0x5c0f('0x54')]));if(_0x22d417[_0x5c0f('0x49')][_0x5c0f('0x55')]){_0x5dfe93[_0x5c0f('0x53')]=_['merge'](_0x5dfe93[_0x5c0f('0x53')],{'$or':_[_0x5c0f('0x48')](_0x5dfe93[_0x5c0f('0x4c')],function(_0x523503){var _0x4b5685={};_0x4b5685[_0x523503]={'$like':'%'+_0x22d417[_0x5c0f('0x49')][_0x5c0f('0x55')]+'%'};return _0x4b5685;})});}_0x5dfe93=_[_0x5c0f('0x56')]({},_0x5dfe93,_0x22d417[_0x5c0f('0x5d')]);return _0x3a2c7c[_0x5c0f('0x9d')](_0x5dfe93);}})[_0x5c0f('0x23')](function(_0x4e5f7c){if(_0x4e5f7c){_0x187511=_0x4e5f7c[_0x5c0f('0x4e')];if(!_0x22d417[_0x5c0f('0x49')][_0x5c0f('0x4f')](_0x5c0f('0x50'))){_0x5dfe93['limit']=qs[_0x5c0f('0x32')](_0x22d417[_0x5c0f('0x49')][_0x5c0f('0x32')]);_0x5dfe93[_0x5c0f('0x30')]=qs['offset'](_0x22d417[_0x5c0f('0x49')][_0x5c0f('0x30')]);}return _0x3a2c7c[_0x5c0f('0x9d')](_0x5dfe93);}})[_0x5c0f('0x23')](function(_0x57d75e){if(_0x57d75e){return _0x57d75e?{'count':_0x187511,'rows':_0x57d75e}:null;}})[_0x5c0f('0x23')](respondWithResult(_0x3ebbfe,null))[_0x5c0f('0x5a')](handleError(_0x3ebbfe,null));};exports['getMessages']=function(_0x2c3365,_0x27e59c,_0x4f9971){var _0x4e87f8={'raw':!![],'where':{}};var _0x4fe10b={};var _0x24ed7c={'count':0x0,'rows':[]};return db[_0x5c0f('0x44')]['findOne']({'where':{'id':_0x2c3365['params']['id']}})[_0x5c0f('0x23')](handleEntityNotFound(_0x27e59c,null))[_0x5c0f('0x23')](function(_0x37ba66){if(_0x37ba66){_0x4fe10b[_0x5c0f('0x47')]=_['keys'](db['MailMessage'][_0x5c0f('0x45')]);_0x4fe10b[_0x5c0f('0x49')]=_[_0x5c0f('0x4a')](_0x2c3365[_0x5c0f('0x49')]);_0x4fe10b[_0x5c0f('0x54')]=_[_0x5c0f('0x4b')](_0x4fe10b['model'],_0x4fe10b[_0x5c0f('0x49')]);_0x4e87f8['attributes']=_[_0x5c0f('0x4b')](_0x4fe10b['model'],qs[_0x5c0f('0x4d')](_0x2c3365[_0x5c0f('0x49')][_0x5c0f('0x4d')]));_0x4e87f8[_0x5c0f('0x4c')]=_0x4e87f8[_0x5c0f('0x4c')][_0x5c0f('0x4e')]?_0x4e87f8[_0x5c0f('0x4c')]:_0x4fe10b[_0x5c0f('0x47')];if(!_0x2c3365['query'][_0x5c0f('0x4f')](_0x5c0f('0x50'))){_0x4e87f8[_0x5c0f('0x32')]=qs[_0x5c0f('0x32')](_0x2c3365['query'][_0x5c0f('0x32')]);_0x4e87f8[_0x5c0f('0x30')]=qs[_0x5c0f('0x30')](_0x2c3365[_0x5c0f('0x49')][_0x5c0f('0x30')]);}_0x4e87f8[_0x5c0f('0x51')]=qs[_0x5c0f('0x52')](_0x2c3365[_0x5c0f('0x49')][_0x5c0f('0x52')]);_0x4e87f8[_0x5c0f('0x53')]=qs[_0x5c0f('0x54')](_[_0x5c0f('0x67')](_0x2c3365['query'],_0x4fe10b[_0x5c0f('0x54')]));_0x4e87f8[_0x5c0f('0x53')][_0x5c0f('0x63')]=_0x37ba66['id'];if(_0x2c3365[_0x5c0f('0x49')][_0x5c0f('0x55')]){_0x4e87f8[_0x5c0f('0x53')]=_[_0x5c0f('0x56')](_0x4e87f8[_0x5c0f('0x53')],{'$or':_[_0x5c0f('0x48')](_0x4e87f8[_0x5c0f('0x4c')],function(_0x1c2f4d){var _0xe30299={};_0xe30299[_0x1c2f4d]={'$like':'%'+_0x2c3365[_0x5c0f('0x49')][_0x5c0f('0x55')]+'%'};return _0xe30299;})});}if(_0x2c3365[_0x5c0f('0x49')]['$gte']){var _0x1f2948=_0x2c3365[_0x5c0f('0x49')][_0x5c0f('0x9e')][_0x5c0f('0x9f')](',');var _0x1471a6={};_0x1471a6[_0x1f2948[0x0]]={'$gte':moment(_0x1f2948[0x1])[_0x5c0f('0xa0')](_0x5c0f('0xa1'))};_0x4e87f8[_0x5c0f('0x53')]=_[_0x5c0f('0x56')](_0x4e87f8[_0x5c0f('0x53')],_0x1471a6);}_0x4e87f8=_['merge']({},_0x4e87f8,_0x2c3365[_0x5c0f('0x5d')]);return db[_0x5c0f('0xa2')][_0x5c0f('0x33')]({'where':_0x4e87f8[_0x5c0f('0x53')]})['then'](function(_0x40ea52){_0x24ed7c['count']=_0x40ea52;if(_0x2c3365[_0x5c0f('0x49')]['includeAll']){_0x4e87f8[_0x5c0f('0x57')]=[{'all':!![]}];}return db[_0x5c0f('0xa2')]['findAll'](_0x4e87f8);})[_0x5c0f('0x23')](function(_0x1cab23){if(_0x2c3365[_0x5c0f('0x49')]['inlineCss']==='true'){for(var _0x545fac=0x0;_0x545fac<_0x1cab23[_0x5c0f('0x4e')];_0x545fac++){_0x1cab23[_0x545fac]['body']=juice(_0x1cab23[_0x545fac][_0x5c0f('0x5e')]);}}_0x24ed7c['rows']=_0x1cab23;return _0x24ed7c;});}})['then'](respondWithFilteredResult(_0x27e59c,_0x4e87f8))['catch'](handleError(_0x27e59c,null));};exports[_0x5c0f('0x3e')]=function(_0x3a1c28,_0x3ce262,_0x56142c){var _0xca1618,_0x3b118a={},_0x125c8f;if(_0x3a1c28[_0x5c0f('0x5e')]['to']){_0x125c8f=_0x3a1c28[_0x5c0f('0x5e')]['to'][_0x5c0f('0x9f')](',')[0x0];}return db['MailAccount']['find']({'where':{'id':_0x3a1c28['params']['id']},'include':[{'model':db[_0x5c0f('0xa3')],'as':_0x5c0f('0xa4'),'include':[{'model':db[_0x5c0f('0x8d')],'as':_0x5c0f('0xa5'),'where':{'email':_0x125c8f},'limit':0x1,'order':[[_0x5c0f('0xa6'),_0x5c0f('0xa7')]]}]},{'model':db['MailServerOut'],'as':_0x5c0f('0x42'),'raw':!![]}]})['then'](handleEntityNotFound(_0x3ce262,null))[_0x5c0f('0x23')](function(_0x35aa9e){if(_0x35aa9e){_0xca1618=_0x35aa9e;if(_0x35aa9e[_0x5c0f('0x42')]){if(_[_0x5c0f('0x72')](_0x3a1c28['body']['from'])){_0x3a1c28[_0x5c0f('0x5e')][_0x5c0f('0xa8')]=util['format'](_0x5c0f('0xa9'),_0x35aa9e[_0x5c0f('0x3d')],_0x35aa9e['email']||_0x35aa9e['Smtp'][_0x5c0f('0x76')]);}if(_0x3a1c28[_0x5c0f('0x5e')][_0x5c0f('0xaa')]&&_0x3a1c28[_0x5c0f('0x5e')][_0x5c0f('0xaa')][_0x5c0f('0x4e')]){for(var _0x42edee=0x0;_0x42edee<_0x3a1c28[_0x5c0f('0x5e')][_0x5c0f('0xaa')]['length'];_0x42edee+=0x1){_0x3a1c28[_0x5c0f('0x5e')][_0x5c0f('0xaa')][_0x42edee]={'filename':_0x3a1c28[_0x5c0f('0x5e')][_0x5c0f('0xaa')][_0x42edee][_0x5c0f('0x3d')],'path':path[_0x5c0f('0xab')](config['root'],_0x5c0f('0xac'),_0x3a1c28[_0x5c0f('0x5e')]['attachments'][_0x42edee][_0x5c0f('0xad')])};}}var _0x1c545b={'tls':{'rejectUnauthorized':![]}};if(_[_0x5c0f('0x72')](_0x35aa9e[_0x5c0f('0x42')][_0x5c0f('0x7d')])){if(_0x35aa9e[_0x5c0f('0x42')][_0x5c0f('0x7a')]){_0x1c545b[_0x5c0f('0xae')]={'user':_0x35aa9e[_0x5c0f('0x42')][_0x5c0f('0x76')],'pass':_0x35aa9e['Smtp']['pass']};}_0x1c545b[_0x5c0f('0x7b')]=_0x35aa9e[_0x5c0f('0x42')][_0x5c0f('0x7b')];_0x1c545b[_0x5c0f('0x7c')]=_0x35aa9e['Smtp']['port'];_0x1c545b[_0x5c0f('0xaf')]=_0x35aa9e[_0x5c0f('0x42')]['secure'];}else{_0x1c545b[_0x5c0f('0x7d')]=_0x35aa9e[_0x5c0f('0x42')][_0x5c0f('0x7d')];_0x1c545b[_0x5c0f('0xae')]={'user':_0x35aa9e[_0x5c0f('0x42')]['user'],'pass':_0x35aa9e[_0x5c0f('0x42')]['pass']};}return respondWithRpcPromise(_0x5c0f('0xb0'),_0x5c0f('0xb1'),{'account':_0x1c545b,'message':_0x3a1c28[_0x5c0f('0x5e')]});}else{throw new Error(_0x5c0f('0xb2'));}}})['then'](function(_0x2752fa){if(_0x2752fa){_0x3b118a=_0x2752fa;if(_0xca1618[_0x5c0f('0xa4')]){if(_0xca1618[_0x5c0f('0xa4')][_0x5c0f('0xa5')][_0x5c0f('0x4e')]){return _0xca1618['List']['Contacts'][0x0];}else{return db['CmContact'][_0x5c0f('0x6d')](_[_0x5c0f('0xb3')](_0x3a1c28[_0x5c0f('0x5e')],{'firstName':_0x3a1c28[_0x5c0f('0x5e')]['to'],'email':_0x3a1c28[_0x5c0f('0x5e')]['to'],'phone':_0x3a1c28[_0x5c0f('0x5e')]['to'],'ListId':_0xca1618[_0x5c0f('0x71')]}));}}else{throw new Error(_0x5c0f('0xb2'));}}})[_0x5c0f('0x23')](function(_0x5f3cfb){if(_0x5f3cfb){var _0x529775={'UserId':_0x3a1c28['user']['id'],'ContactId':_0x5f3cfb['id'],'MailAccountId':_0xca1618['id'],'inReplyTo':_0x3b118a[_0x5c0f('0xb4')],'to':_0x3a1c28['body'][_0x5c0f('0xa8')],'cc':_0x3a1c28[_0x5c0f('0x5e')]['cc'],'subject':_0x3a1c28[_0x5c0f('0x5e')][_0x5c0f('0xb5')],'attach':_0x3a1c28['body']['attach'],'firstMsgDirection':_0x5c0f('0xb6'),'lastMsgAt':moment()[_0x5c0f('0xa0')](_0x5c0f('0xa1')),'lastMsgDirection':'out','Messages':[_[_0x5c0f('0x56')](_0x3a1c28[_0x5c0f('0x5e')],{'messageId':_0x3b118a[_0x5c0f('0xb4')],'sentAt':moment()[_0x5c0f('0xa0')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0xca1618['id'],'UserId':_0x3a1c28[_0x5c0f('0x76')]['id'],'ContactId':_0x5f3cfb['id']})]};if(_0x3a1c28[_0x5c0f('0x5e')][_0x5c0f('0xb7')]){_0x529775=_['merge'](_0x529775,_0x3a1c28[_0x5c0f('0x5e')][_0x5c0f('0xb7')]);}return db[_0x5c0f('0x8b')]['create'](_0x529775,{'include':[{'model':db[_0x5c0f('0xa2')],'as':_0x5c0f('0xb8')}]});}})[_0x5c0f('0x23')](respondWithResult(_0x3ce262,null))[_0x5c0f('0x5a')](handleError(_0x3ce262,null));};exports['verifySmtp']=function(_0x12bb7f,_0x222d40,_0x2bd8ce){return db['MailAccount'][_0x5c0f('0x5f')]({'where':{'id':_0x12bb7f['params']['id']},'include':[{'model':db[_0x5c0f('0x41')],'as':_0x5c0f('0x42'),'raw':!![]}]})[_0x5c0f('0x23')](handleEntityNotFound(_0x222d40,null))['then'](function(_0x20a4ca){if(_0x20a4ca&&_0x20a4ca['Smtp']){var _0x42b244={'id':_0x20a4ca['id'],'tls':{'rejectUnauthorized':![]}};if(_0x20a4ca[_0x5c0f('0x42')][_0x5c0f('0x7d')]){_0x42b244[_0x5c0f('0x7d')]=_0x20a4ca[_0x5c0f('0x42')][_0x5c0f('0x7d')];}else{_0x42b244[_0x5c0f('0x7b')]=_0x20a4ca[_0x5c0f('0x42')][_0x5c0f('0x7b')];_0x42b244[_0x5c0f('0x7c')]=_0x20a4ca[_0x5c0f('0x42')][_0x5c0f('0x7c')];_0x42b244['secure']=_0x20a4ca[_0x5c0f('0x42')][_0x5c0f('0xaf')];}if(_0x20a4ca[_0x5c0f('0x42')]['authentication']){_0x42b244[_0x5c0f('0xae')]={'user':_0x20a4ca[_0x5c0f('0x42')]['user'],'pass':_0x20a4ca['Smtp']['pass']};}return respondWithRpcPromise(_0x5c0f('0xb9'),_0x5c0f('0xba'),{'account':_0x42b244});}})['then'](respondWithResult(_0x222d40,null))[_0x5c0f('0x5a')](handleError(_0x222d40,null));};exports[_0x5c0f('0x9a')]=function(_0x5dba56,_0x7a7238){return db[_0x5c0f('0x44')][_0x5c0f('0x5f')]({'where':{'id':_0x5dba56['params']['id']}})['then'](handleEntityNotFound(_0x7a7238,null))['then'](function(_0x58d571){if(_0x58d571&&_0x58d571['service']){throw new db[(_0x5c0f('0xbb'))][(_0x5c0f('0xbc'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x58d571;})[_0x5c0f('0x23')](removeEntity(_0x7a7238,null))['catch'](handleError(_0x7a7238,null));};exports['addAgents']=function(_0x270bdd,_0x2368e2,_0x1c2872){return db[_0x5c0f('0x44')][_0x5c0f('0x5f')]({'where':{'id':_0x270bdd[_0x5c0f('0x60')]['id']}})[_0x5c0f('0x23')](handleEntityNotFound(_0x2368e2,null))['then'](function(_0x503686){if(_0x503686){return _0x503686[_0x5c0f('0xbd')](_0x270bdd['body'][_0x5c0f('0x6a')],_[_0x5c0f('0xbe')](_0x270bdd['body'],[_0x5c0f('0x6a'),'id'])||{})[_0x5c0f('0xbf')](function(_0x17c916){for(var _0x555152=0x0;_0x555152<_0x270bdd[_0x5c0f('0x5e')][_0x5c0f('0x6a')][_0x5c0f('0x4e')];_0x555152+=0x1){socket['emit'](_0x5c0f('0xc0'),{'UserId':Number(_0x270bdd['body'][_0x5c0f('0x6a')][_0x555152]),'MailAccountId':Number(_0x270bdd[_0x5c0f('0x60')]['id'])});}return _0x17c916;});}})[_0x5c0f('0x23')](respondWithResult(_0x2368e2,null))['catch'](handleError(_0x2368e2,null));};exports[_0x5c0f('0xc1')]=function(_0x441322,_0x3d1bde,_0x59ecbb){return db[_0x5c0f('0x44')][_0x5c0f('0x5f')]({'where':{'id':_0x441322['params']['id']}})[_0x5c0f('0x23')](handleEntityNotFound(_0x3d1bde,null))[_0x5c0f('0x23')](function(_0x420baa){if(_0x420baa){return _0x420baa['removeAgents'](_0x441322[_0x5c0f('0x49')][_0x5c0f('0x6a')])[_0x5c0f('0x23')](function(){if(_[_0x5c0f('0xc2')](_0x441322['query'][_0x5c0f('0x6a')])){for(var _0x1882cc=0x0;_0x1882cc<_0x441322[_0x5c0f('0x49')]['ids'][_0x5c0f('0x4e')];_0x1882cc+=0x1){socket[_0x5c0f('0xc3')](_0x5c0f('0xc4'),{'UserId':Number(_0x441322[_0x5c0f('0x49')][_0x5c0f('0x6a')][_0x1882cc]),'MailAccountId':Number(_0x441322[_0x5c0f('0x60')]['id'])});}}else{socket[_0x5c0f('0xc3')]('userMailAccount:remove',{'UserId':Number(_0x441322[_0x5c0f('0x49')][_0x5c0f('0x6a')]),'MailAccountId':Number(_0x441322[_0x5c0f('0x60')]['id'])});}});}})[_0x5c0f('0x23')](respondWithStatusCode(_0x3d1bde,null))[_0x5c0f('0x5a')](handleError(_0x3d1bde,null));};exports[_0x5c0f('0xc5')]=function(_0x340ee4,_0x46e97c,_0x19cc2e){var _0x8a63c1={};var _0x57eb9a={};var _0x57c199;var _0x6dfe2c;return db['MailAccount'][_0x5c0f('0x66')]({'where':{'id':_0x340ee4['params']['id']}})[_0x5c0f('0x23')](handleEntityNotFound(_0x46e97c,null))[_0x5c0f('0x23')](function(_0x334e46){if(_0x334e46){_0x57c199=_0x334e46;_0x57eb9a[_0x5c0f('0x47')]=_[_0x5c0f('0x4a')](db['User'][_0x5c0f('0x45')]);_0x57eb9a[_0x5c0f('0x49')]=_[_0x5c0f('0x4a')](_0x340ee4['query']);_0x57eb9a['filters']=_['intersection'](_0x57eb9a[_0x5c0f('0x47')],_0x57eb9a[_0x5c0f('0x49')]);_0x8a63c1[_0x5c0f('0x4c')]=_[_0x5c0f('0x4b')](_0x57eb9a[_0x5c0f('0x47')],qs[_0x5c0f('0x4d')](_0x340ee4[_0x5c0f('0x49')][_0x5c0f('0x4d')]));_0x8a63c1['attributes']=_0x8a63c1[_0x5c0f('0x4c')][_0x5c0f('0x4e')]?_0x8a63c1['attributes']:_0x57eb9a[_0x5c0f('0x47')];_0x8a63c1[_0x5c0f('0x51')]=qs[_0x5c0f('0x52')](_0x340ee4[_0x5c0f('0x49')][_0x5c0f('0x52')]);_0x8a63c1[_0x5c0f('0x53')]=qs[_0x5c0f('0x54')](_[_0x5c0f('0x67')](_0x340ee4[_0x5c0f('0x49')],_0x57eb9a[_0x5c0f('0x54')]));if(_0x340ee4['query']['filter']){_0x8a63c1[_0x5c0f('0x53')]=_[_0x5c0f('0x56')](_0x8a63c1[_0x5c0f('0x53')],{'$or':_[_0x5c0f('0x48')](_0x8a63c1[_0x5c0f('0x4c')],function(_0x417aa8){var _0xcac89d={};_0xcac89d[_0x417aa8]={'$like':'%'+_0x340ee4[_0x5c0f('0x49')]['filter']+'%'};return _0xcac89d;})});}_0x8a63c1=_[_0x5c0f('0x56')]({},_0x8a63c1,_0x340ee4[_0x5c0f('0x5d')]);return _0x57c199[_0x5c0f('0xc5')](_0x8a63c1);}})[_0x5c0f('0x23')](function(_0x472647){if(_0x472647){_0x6dfe2c=_0x472647[_0x5c0f('0x4e')];if(!_0x340ee4[_0x5c0f('0x49')]['hasOwnProperty'](_0x5c0f('0x50'))){_0x8a63c1['limit']=qs[_0x5c0f('0x32')](_0x340ee4[_0x5c0f('0x49')][_0x5c0f('0x32')]);_0x8a63c1[_0x5c0f('0x30')]=qs['offset'](_0x340ee4[_0x5c0f('0x49')][_0x5c0f('0x30')]);}return _0x57c199[_0x5c0f('0xc5')](_0x8a63c1);}})['then'](function(_0x134b6d){if(_0x134b6d){return _0x134b6d?{'count':_0x6dfe2c,'rows':_0x134b6d}:null;}})[_0x5c0f('0x23')](respondWithResult(_0x46e97c,null))[_0x5c0f('0x5a')](handleError(_0x46e97c,null));}; \ No newline at end of file +var _0x220b=['papaparse','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','redis','jayson/promise','http','request','then','info','request\x20sent','stringify','error','MailAccount,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','get','MailAccounts','UserProfileResource','stack','send','index','MailServerIn','Imap','Smtp','map','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','MailAccount','includeAll','include','findAll','show','params','MailServerOut','Pause','rawAttributes','find','mandatoryDispositionPause','body','describe','addDisposition','MailAccountId','Disposition','pick','rows','removeDispositions','ids','addAnswer','CannedAnswer','create','getAnswers','findOne','removeAnswers','name','key','email','ListId','active','description','cservice','cauthentication','user','password','pass','authentication','host','port','service','cuser','cpassword','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','setImap','getSmtp','setSmtp','MailInteraction','CmContact','User','Owner','fullname','internal','Tags','color','tag','addApplications','sequelize','transaction','MailApplication','priority','getApplications','$gte','split','format','MailMessage','inlineCss','CmList','updatedAt','DESC','from','attachments','join','root','server/files/attachments','basename','secure','List\x20not\x20found','List','Contacts','defaults','messageId','subject','attach','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','verifySmtp','auth','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','squel','crypto','jsforce','desk.js'];(function(_0x5347e3,_0x20d2be){var _0x227474=function(_0xd43102){while(--_0xd43102){_0x5347e3['push'](_0x5347e3['shift']());}};_0x227474(++_0x20d2be);}(_0x220b,0xad));var _0xb220=function(_0xbc346f,_0x3db5c0){_0xbc346f=_0xbc346f-0x0;var _0x9f9260=_0x220b[_0xbc346f];return _0x9f9260;};'use strict';var emlformat=require(_0xb220('0x0'));var rimraf=require(_0xb220('0x1'));var zipdir=require(_0xb220('0x2'));var jsonpatch=require(_0xb220('0x3'));var rp=require(_0xb220('0x4'));var moment=require(_0xb220('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb220('0x6'));var util=require('util');var path=require('path');var sox=require(_0xb220('0x7'));var csv=require(_0xb220('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb220('0x9'));var crypto=require(_0xb220('0xa'));var jsforce=require(_0xb220('0xb'));var deskjs=require(_0xb220('0xc'));var toCsv=require(_0xb220('0x8'));var querystring=require('querystring');var Papa=require(_0xb220('0xd'));var htmlToText=require(_0xb220('0xe'));var juice=require('juice');var Redis=require(_0xb220('0xf'));var authService=require(_0xb220('0x10'));var qs=require(_0xb220('0x11'));var as=require(_0xb220('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb220('0x13'));var utils=require(_0xb220('0x14'));var config=require(_0xb220('0x15'));var licenseUtil=require(_0xb220('0x16'));var db=require(_0xb220('0x17'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb220('0x18'))(new Redis(config[_0xb220('0x19')]));require('./mailAccount.socket')['register'](socket);var jayson=require(_0xb220('0x1a'));var client=jayson['client'][_0xb220('0x1b')]({'port':0x232b});function respondWithRpcPromise(_0x282981,_0x27ecd5,_0x51e550,_0x47d70b){return new BPromise(function(_0x5cb5bc,_0x38ac2b){var _0x56b168=_0x47d70b||client;return _0x56b168[_0xb220('0x1c')](_0x282981,_0x51e550)[_0xb220('0x1d')](function(_0x2ecc79){logger[_0xb220('0x1e')]('MailAccount,\x20%s,\x20%s',_0x27ecd5,'request\x20sent');logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x27ecd5,_0xb220('0x1f'),JSON[_0xb220('0x20')](_0x2ecc79));if(_0x2ecc79['error']){if(_0x2ecc79[_0xb220('0x21')]['code']===0x1f4){logger[_0xb220('0x21')](_0xb220('0x22'),_0x27ecd5,_0x2ecc79[_0xb220('0x21')][_0xb220('0x23')]);return _0x38ac2b(_0x2ecc79[_0xb220('0x21')]['message']);}logger['error'](_0xb220('0x22'),_0x27ecd5,_0x2ecc79['error']['message']);return _0x5cb5bc(_0x2ecc79[_0xb220('0x21')][_0xb220('0x23')]);}else{logger[_0xb220('0x1e')](_0xb220('0x22'),_0x27ecd5,_0xb220('0x1f'));_0x5cb5bc(_0x2ecc79['result'][_0xb220('0x23')]);}})[_0xb220('0x24')](function(_0x3a2312){logger[_0xb220('0x21')]('MailAccount,\x20%s,\x20%s',_0x27ecd5,_0x3a2312);_0x38ac2b(_0x3a2312);});});}function respondWithStatusCode(_0x1ee855,_0x4c7e9b){_0x4c7e9b=_0x4c7e9b||0xcc;return function(_0x3e9107){if(_0x3e9107){return _0x1ee855[_0xb220('0x25')](_0x4c7e9b);}return _0x1ee855[_0xb220('0x26')](_0x4c7e9b)[_0xb220('0x27')]();};}function respondWithResult(_0x185c4b,_0x64714e){_0x64714e=_0x64714e||0xc8;return function(_0x2d9d61){if(_0x2d9d61){return _0x185c4b[_0xb220('0x26')](_0x64714e)[_0xb220('0x28')](_0x2d9d61);}};}function respondWithFilteredResult(_0xb0fc1,_0x51e1ac){return function(_0x35f330){if(_0x35f330){var _0x2c9195=typeof _0x51e1ac[_0xb220('0x29')]===_0xb220('0x2a')&&typeof _0x51e1ac[_0xb220('0x2b')]==='undefined';var _0x37bd8c=_0x35f330[_0xb220('0x2c')];var _0x2f285c=_0x2c9195?0x0:_0x51e1ac[_0xb220('0x29')];var _0xa74712=_0x2c9195?_0x35f330[_0xb220('0x2c')]:_0x51e1ac[_0xb220('0x29')]+_0x51e1ac[_0xb220('0x2b')];var _0x7fa12f;if(_0xa74712>=_0x37bd8c){_0xa74712=_0x37bd8c;_0x7fa12f=0xc8;}else{_0x7fa12f=0xce;}_0xb0fc1['status'](_0x7fa12f);return _0xb0fc1['set'](_0xb220('0x2d'),_0x2f285c+'-'+_0xa74712+'/'+_0x37bd8c)[_0xb220('0x28')](_0x35f330);}return null;};}function patchUpdates(_0x112a83){return function(_0xbe6e6){try{jsonpatch[_0xb220('0x2e')](_0xbe6e6,_0x112a83,!![]);}catch(_0x444f79){return BPromise[_0xb220('0x2f')](_0x444f79);}return _0xbe6e6[_0xb220('0x30')]();};}function saveUpdates(_0x2d7746,_0x5da3d8){return function(_0x51fc9a){if(_0x51fc9a){return _0x51fc9a[_0xb220('0x31')](_0x2d7746)[_0xb220('0x1d')](function(_0x32fce2){return _0x32fce2;});}return null;};}function removeEntity(_0x1e8c4f,_0x4a1d90){return function(_0x710270){if(_0x710270){return _0x710270[_0xb220('0x32')]()[_0xb220('0x1d')](function(){var _0x11ecaa=_0x710270[_0xb220('0x33')]({'plain':!![]});var _0x35da90=_0xb220('0x34');return db[_0xb220('0x35')][_0xb220('0x32')]({'where':{'type':_0x35da90,'resourceId':_0x11ecaa['id']}})[_0xb220('0x1d')](function(){return _0x710270;});})[_0xb220('0x1d')](function(){_0x1e8c4f[_0xb220('0x26')](0xcc)[_0xb220('0x27')]();});}};}function handleEntityNotFound(_0x565eca,_0x3ef812){return function(_0x1e7703){if(!_0x1e7703){_0x565eca['sendStatus'](0x194);}return _0x1e7703;};}function handleError(_0x3b3daa,_0x5391cd){_0x5391cd=_0x5391cd||0x1f4;return function(_0x256002){logger['error'](_0x256002[_0xb220('0x36')]);if(_0x256002['name']){delete _0x256002['name'];}_0x3b3daa['status'](_0x5391cd)[_0xb220('0x37')](_0x256002);};}exports[_0xb220('0x38')]=function(_0x2a3a54,_0x5c927f){var _0x5d5fab={'include':[{'model':db[_0xb220('0x39')],'as':_0xb220('0x3a')},{'model':db['MailServerOut'],'as':_0xb220('0x3b')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x18bc83={},_0x454b68={'count':0x0,'rows':[]};var _0x5e0441=_[_0xb220('0x3c')](db['MailAccount']['rawAttributes'],function(_0x5442f4){return{'name':_0x5442f4['fieldName'],'type':_0x5442f4[_0xb220('0x3d')]['key']};});_0x18bc83[_0xb220('0x3e')]=_['map'](_0x5e0441,'name');_0x18bc83[_0xb220('0x3f')]=_[_0xb220('0x40')](_0x2a3a54[_0xb220('0x3f')]);_0x18bc83[_0xb220('0x41')]=_[_0xb220('0x42')](_0x18bc83['model'],_0x18bc83[_0xb220('0x3f')]);_0x5d5fab[_0xb220('0x43')]=_[_0xb220('0x42')](_0x18bc83['model'],qs[_0xb220('0x44')](_0x2a3a54[_0xb220('0x3f')][_0xb220('0x44')]));_0x5d5fab['attributes']=_0x5d5fab[_0xb220('0x43')][_0xb220('0x45')]?_0x5d5fab[_0xb220('0x43')]:_0x18bc83['model'];if(!_0x2a3a54[_0xb220('0x3f')][_0xb220('0x46')](_0xb220('0x47'))){_0x5d5fab['limit']=qs[_0xb220('0x2b')](_0x2a3a54[_0xb220('0x3f')][_0xb220('0x2b')]);_0x5d5fab[_0xb220('0x29')]=qs[_0xb220('0x29')](_0x2a3a54['query'][_0xb220('0x29')]);}_0x5d5fab[_0xb220('0x48')]=qs[_0xb220('0x49')](_0x2a3a54[_0xb220('0x3f')][_0xb220('0x49')]);_0x5d5fab[_0xb220('0x4a')]=qs[_0xb220('0x41')](_['pick'](_0x2a3a54[_0xb220('0x3f')],_0x18bc83[_0xb220('0x41')]),_0x5e0441);if(_0x2a3a54[_0xb220('0x3f')][_0xb220('0x4b')]){_0x5d5fab[_0xb220('0x4a')]=_[_0xb220('0x4c')](_0x5d5fab[_0xb220('0x4a')],{'$or':_[_0xb220('0x3c')](_0x5e0441,function(_0x57753a){if(_0x57753a[_0xb220('0x3d')]!==_0xb220('0x4d')){var _0x4aa2e2={};_0x4aa2e2[_0x57753a['name']]={'$like':'%'+_0x2a3a54[_0xb220('0x3f')]['filter']+'%'};return _0x4aa2e2;}})});}_0x5d5fab=_['merge']({},_0x5d5fab,_0x2a3a54[_0xb220('0x4e')]);var _0x5c1202={'where':_0x5d5fab[_0xb220('0x4a')]};return db[_0xb220('0x4f')][_0xb220('0x2c')](_0x5c1202)['then'](function(_0x258e79){_0x454b68[_0xb220('0x2c')]=_0x258e79;if(_0x2a3a54[_0xb220('0x3f')][_0xb220('0x50')]){_0x5d5fab[_0xb220('0x51')]=[{'all':!![]}];}return db[_0xb220('0x4f')][_0xb220('0x52')](_0x5d5fab);})[_0xb220('0x1d')](function(_0x379545){_0x454b68['rows']=_0x379545;return _0x454b68;})[_0xb220('0x1d')](respondWithFilteredResult(_0x5c927f,_0x5d5fab))['catch'](handleError(_0x5c927f,null));};exports[_0xb220('0x53')]=function(_0x43ac95,_0x7b6983){var _0x2c7b4f={'raw':![],'where':{'id':_0x43ac95[_0xb220('0x54')]['id']},'include':[{'model':db[_0xb220('0x39')],'as':'Imap'},{'model':db[_0xb220('0x55')],'as':'Smtp'},{'model':db[_0xb220('0x56')],'as':'mandatoryDispositionPause'}]},_0x3ae611={};_0x3ae611[_0xb220('0x3e')]=_[_0xb220('0x40')](db['MailAccount'][_0xb220('0x57')]);_0x3ae611[_0xb220('0x3f')]=_['keys'](_0x43ac95['query']);_0x3ae611[_0xb220('0x41')]=_[_0xb220('0x42')](_0x3ae611[_0xb220('0x3e')],_0x3ae611['query']);_0x2c7b4f[_0xb220('0x43')]=_[_0xb220('0x42')](_0x3ae611['model'],qs[_0xb220('0x44')](_0x43ac95[_0xb220('0x3f')][_0xb220('0x44')]));_0x2c7b4f[_0xb220('0x43')]=_0x2c7b4f['attributes'][_0xb220('0x45')]?_0x2c7b4f[_0xb220('0x43')]:_0x3ae611[_0xb220('0x3e')];if(_0x43ac95[_0xb220('0x3f')][_0xb220('0x50')]){_0x2c7b4f[_0xb220('0x51')]=[{'all':!![]}];}_0x2c7b4f=_[_0xb220('0x4c')]({},_0x2c7b4f,_0x43ac95[_0xb220('0x4e')]);return db[_0xb220('0x4f')]['find'](_0x2c7b4f)[_0xb220('0x1d')](handleEntityNotFound(_0x7b6983,null))[_0xb220('0x1d')](respondWithResult(_0x7b6983,null))['catch'](handleError(_0x7b6983,null));};exports[_0xb220('0x31')]=function(_0x1ec7f5,_0x5ebf18){if(_0x1ec7f5['body']['id']){delete _0x1ec7f5['body']['id'];}return db[_0xb220('0x4f')][_0xb220('0x58')]({'where':{'id':_0x1ec7f5[_0xb220('0x54')]['id']},'include':[{'model':db[_0xb220('0x39')],'as':'Imap'},{'model':db[_0xb220('0x55')],'as':_0xb220('0x3b')},{'model':db['Pause'],'as':_0xb220('0x59')}]})['then'](handleEntityNotFound(_0x5ebf18,null))[_0xb220('0x1d')](saveUpdates(_0x1ec7f5['body'],null))[_0xb220('0x1d')](function(_0x1e30df){if(_0x1e30df&&_0x1ec7f5['body']['Imap']){return db['MailServerIn'][_0xb220('0x31')](_0x1ec7f5[_0xb220('0x5a')][_0xb220('0x3a')],{'where':{'MailAccountId':_0x1e30df['id']}})[_0xb220('0x1d')](function(){return _0x1e30df;});}return _0x1e30df;})[_0xb220('0x1d')](function(_0x388f16){if(_0x388f16&&_0x1ec7f5['body'][_0xb220('0x3b')]){return db['MailServerOut'][_0xb220('0x31')](_0x1ec7f5[_0xb220('0x5a')][_0xb220('0x3b')],{'where':{'MailAccountId':_0x388f16['id']}})['then'](function(){return _0x388f16;});}return _0x388f16;})[_0xb220('0x1d')](respondWithResult(_0x5ebf18,null))[_0xb220('0x24')](handleError(_0x5ebf18,null));};exports[_0xb220('0x5b')]=function(_0x23766b,_0x288125){return db[_0xb220('0x4f')][_0xb220('0x5b')]()[_0xb220('0x1d')](respondWithResult(_0x288125,null))[_0xb220('0x24')](handleError(_0x288125,null));};exports[_0xb220('0x5c')]=function(_0x11f755,_0x1e9b24,_0x4256f6){if(_0x11f755['body']['id']){delete _0x11f755[_0xb220('0x5a')]['id'];}return db[_0xb220('0x4f')]['find']({'where':{'id':_0x11f755[_0xb220('0x54')]['id']}})['then'](handleEntityNotFound(_0x1e9b24,null))[_0xb220('0x1d')](function(_0x1f6161){if(_0x1f6161){_0x11f755[_0xb220('0x5a')][_0xb220('0x5d')]=_0x1f6161['id'];return db[_0xb220('0x5e')]['create'](_0x11f755[_0xb220('0x5a')]);}})[_0xb220('0x1d')](respondWithResult(_0x1e9b24,null))[_0xb220('0x24')](handleError(_0x1e9b24,null));};exports['getDispositions']=function(_0x1988dc,_0x40dc2a,_0x6c6d72){var _0x13a6bf={'raw':![],'where':{}};var _0x54727a={};var _0x1706dc={'count':0x0,'rows':[]};return db[_0xb220('0x4f')]['findOne']({'where':{'id':_0x1988dc[_0xb220('0x54')]['id']}})[_0xb220('0x1d')](handleEntityNotFound(_0x40dc2a,null))['then'](function(_0x171b6b){if(_0x171b6b){_0x54727a[_0xb220('0x3e')]=_[_0xb220('0x40')](db[_0xb220('0x5e')][_0xb220('0x57')]);_0x54727a['query']=_[_0xb220('0x40')](_0x1988dc[_0xb220('0x3f')]);_0x54727a[_0xb220('0x41')]=_['intersection'](_0x54727a[_0xb220('0x3e')],_0x54727a[_0xb220('0x3f')]);_0x13a6bf[_0xb220('0x43')]=_[_0xb220('0x42')](_0x54727a['model'],qs['fields'](_0x1988dc['query'][_0xb220('0x44')]));_0x13a6bf[_0xb220('0x43')]=_0x13a6bf['attributes'][_0xb220('0x45')]?_0x13a6bf[_0xb220('0x43')]:_0x54727a[_0xb220('0x3e')];if(!_0x1988dc[_0xb220('0x3f')]['hasOwnProperty']('nolimit')){_0x13a6bf[_0xb220('0x2b')]=qs['limit'](_0x1988dc[_0xb220('0x3f')][_0xb220('0x2b')]);_0x13a6bf[_0xb220('0x29')]=qs[_0xb220('0x29')](_0x1988dc[_0xb220('0x3f')]['offset']);}_0x13a6bf[_0xb220('0x48')]=qs[_0xb220('0x49')](_0x1988dc['query']['sort']);_0x13a6bf[_0xb220('0x4a')]=qs[_0xb220('0x41')](_[_0xb220('0x5f')](_0x1988dc[_0xb220('0x3f')],_0x54727a[_0xb220('0x41')]));_0x13a6bf[_0xb220('0x4a')][_0xb220('0x5d')]=_0x171b6b['id'];if(_0x1988dc['query']['filter']){_0x13a6bf[_0xb220('0x4a')]=_['merge'](_0x13a6bf[_0xb220('0x4a')],{'$or':_[_0xb220('0x3c')](_0x13a6bf[_0xb220('0x43')],function(_0x9bf8af){var _0x37f61e={};_0x37f61e[_0x9bf8af]={'$like':'%'+_0x1988dc[_0xb220('0x3f')][_0xb220('0x4b')]+'%'};return _0x37f61e;})});}_0x13a6bf=_[_0xb220('0x4c')]({},_0x13a6bf,_0x1988dc[_0xb220('0x4e')]);return db[_0xb220('0x5e')][_0xb220('0x2c')]({'where':_0x13a6bf[_0xb220('0x4a')]})[_0xb220('0x1d')](function(_0x4f5276){_0x1706dc[_0xb220('0x2c')]=_0x4f5276;if(_0x1988dc[_0xb220('0x3f')][_0xb220('0x50')]){_0x13a6bf[_0xb220('0x51')]=[{'all':!![]}];}return db[_0xb220('0x5e')]['findAll'](_0x13a6bf);})[_0xb220('0x1d')](function(_0x3f74e0){_0x1706dc[_0xb220('0x60')]=_0x3f74e0;return _0x1706dc;});}})[_0xb220('0x1d')](respondWithFilteredResult(_0x40dc2a,_0x13a6bf))[_0xb220('0x24')](handleError(_0x40dc2a,null));};exports[_0xb220('0x61')]=function(_0x2c0e21,_0x4f6a54,_0x1fb187){return db[_0xb220('0x4f')][_0xb220('0x58')]({'where':{'id':_0x2c0e21['params']['id']}})[_0xb220('0x1d')](handleEntityNotFound(_0x4f6a54,null))[_0xb220('0x1d')](function(_0x49d8ff){if(_0x49d8ff){return _0x49d8ff[_0xb220('0x61')](_0x2c0e21[_0xb220('0x3f')][_0xb220('0x62')]);}})['then'](respondWithStatusCode(_0x4f6a54,null))[_0xb220('0x24')](handleError(_0x4f6a54,null));};exports[_0xb220('0x63')]=function(_0x3b2e12,_0x5be81b,_0x1677b5){if(_0x3b2e12[_0xb220('0x5a')]['id']){delete _0x3b2e12[_0xb220('0x5a')]['id'];}return db[_0xb220('0x4f')][_0xb220('0x58')]({'where':{'id':_0x3b2e12[_0xb220('0x54')]['id']}})[_0xb220('0x1d')](handleEntityNotFound(_0x5be81b,null))[_0xb220('0x1d')](function(_0x14e4f7){if(_0x14e4f7){_0x3b2e12[_0xb220('0x5a')][_0xb220('0x5d')]=_0x14e4f7['id'];return db[_0xb220('0x64')][_0xb220('0x65')](_0x3b2e12[_0xb220('0x5a')]);}})[_0xb220('0x1d')](respondWithResult(_0x5be81b,null))[_0xb220('0x24')](handleError(_0x5be81b,null));};exports[_0xb220('0x66')]=function(_0x2e762c,_0x33b28d,_0x2f1aed){var _0xad42d={'raw':![],'where':{}};var _0x16e0c2={};var _0x5c0c25={'count':0x0,'rows':[]};return db['MailAccount'][_0xb220('0x67')]({'where':{'id':_0x2e762c['params']['id']}})['then'](handleEntityNotFound(_0x33b28d,null))[_0xb220('0x1d')](function(_0x372a63){if(_0x372a63){_0x16e0c2[_0xb220('0x3e')]=_[_0xb220('0x40')](db['CannedAnswer'][_0xb220('0x57')]);_0x16e0c2[_0xb220('0x3f')]=_[_0xb220('0x40')](_0x2e762c['query']);_0x16e0c2[_0xb220('0x41')]=_[_0xb220('0x42')](_0x16e0c2[_0xb220('0x3e')],_0x16e0c2[_0xb220('0x3f')]);_0xad42d[_0xb220('0x43')]=_[_0xb220('0x42')](_0x16e0c2[_0xb220('0x3e')],qs[_0xb220('0x44')](_0x2e762c['query'][_0xb220('0x44')]));_0xad42d[_0xb220('0x43')]=_0xad42d[_0xb220('0x43')]['length']?_0xad42d[_0xb220('0x43')]:_0x16e0c2['model'];if(!_0x2e762c[_0xb220('0x3f')][_0xb220('0x46')](_0xb220('0x47'))){_0xad42d[_0xb220('0x2b')]=qs[_0xb220('0x2b')](_0x2e762c[_0xb220('0x3f')][_0xb220('0x2b')]);_0xad42d[_0xb220('0x29')]=qs[_0xb220('0x29')](_0x2e762c[_0xb220('0x3f')][_0xb220('0x29')]);}_0xad42d[_0xb220('0x48')]=qs['sort'](_0x2e762c['query']['sort']);_0xad42d[_0xb220('0x4a')]=qs['filters'](_[_0xb220('0x5f')](_0x2e762c[_0xb220('0x3f')],_0x16e0c2[_0xb220('0x41')]));_0xad42d['where'][_0xb220('0x5d')]=_0x372a63['id'];if(_0x2e762c[_0xb220('0x3f')][_0xb220('0x4b')]){_0xad42d[_0xb220('0x4a')]=_[_0xb220('0x4c')](_0xad42d[_0xb220('0x4a')],{'$or':_['map'](_0xad42d[_0xb220('0x43')],function(_0x466a2b){var _0x2c66fb={};_0x2c66fb[_0x466a2b]={'$like':'%'+_0x2e762c[_0xb220('0x3f')]['filter']+'%'};return _0x2c66fb;})});}_0xad42d=_[_0xb220('0x4c')]({},_0xad42d,_0x2e762c[_0xb220('0x4e')]);return db['CannedAnswer'][_0xb220('0x2c')]({'where':_0xad42d[_0xb220('0x4a')]})[_0xb220('0x1d')](function(_0x3c77f0){_0x5c0c25[_0xb220('0x2c')]=_0x3c77f0;if(_0x2e762c[_0xb220('0x3f')][_0xb220('0x50')]){_0xad42d[_0xb220('0x51')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0xad42d);})[_0xb220('0x1d')](function(_0x212f33){_0x5c0c25['rows']=_0x212f33;return _0x5c0c25;});}})[_0xb220('0x1d')](respondWithFilteredResult(_0x33b28d,_0xad42d))[_0xb220('0x24')](handleError(_0x33b28d,null));};exports[_0xb220('0x68')]=function(_0x572251,_0x305e9c,_0x23a5e6){return db['MailAccount'][_0xb220('0x58')]({'where':{'id':_0x572251[_0xb220('0x54')]['id']}})[_0xb220('0x1d')](handleEntityNotFound(_0x305e9c,null))[_0xb220('0x1d')](function(_0x53ce85){if(_0x53ce85){return _0x53ce85[_0xb220('0x68')](_0x572251[_0xb220('0x3f')][_0xb220('0x62')]);}})[_0xb220('0x1d')](respondWithStatusCode(_0x305e9c,null))[_0xb220('0x24')](handleError(_0x305e9c,null));};exports[_0xb220('0x65')]=function(_0x580650,_0x445a81){var _0xff055b={'name':_0x580650[_0xb220('0x5a')][_0xb220('0x69')],'key':_0x580650['body'][_0xb220('0x6a')],'email':_0x580650['body'][_0xb220('0x6b')],'ListId':_0x580650[_0xb220('0x5a')][_0xb220('0x6c')],'active':!_['isNil'](_0x580650[_0xb220('0x5a')]['active'])?_0x580650['body'][_0xb220('0x6d')]:!![],'description':_0x580650[_0xb220('0x5a')][_0xb220('0x6e')]||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x580650[_0xb220('0x5a')][_0xb220('0x6f')])){if(_0x580650[_0xb220('0x5a')][_0xb220('0x70')]){_0xff055b['Imap'][_0xb220('0x71')]=_0xff055b[_0xb220('0x3b')][_0xb220('0x71')]=_0x580650['body']['cuser'];_0xff055b['Imap'][_0xb220('0x72')]=_0xff055b[_0xb220('0x3b')][_0xb220('0x73')]=_0x580650[_0xb220('0x5a')]['cpassword'];}else{_0xff055b[_0xb220('0x3a')][_0xb220('0x74')]=_0xff055b[_0xb220('0x3b')][_0xb220('0x74')]=![];}_0xff055b[_0xb220('0x3a')][_0xb220('0x75')]=_0x580650['body'][_0xb220('0x3a')][_0xb220('0x75')];_0xff055b[_0xb220('0x3a')][_0xb220('0x76')]=_0x580650['body'][_0xb220('0x3a')]['port'];_0xff055b[_0xb220('0x3b')][_0xb220('0x75')]=_0x580650[_0xb220('0x5a')][_0xb220('0x3b')][_0xb220('0x75')];_0xff055b['Smtp'][_0xb220('0x76')]=_0x580650[_0xb220('0x5a')][_0xb220('0x3b')][_0xb220('0x76')];}else{_0xff055b['Imap'][_0xb220('0x77')]=_0xff055b[_0xb220('0x3b')][_0xb220('0x77')]=_0x580650[_0xb220('0x5a')][_0xb220('0x6f')];_0xff055b[_0xb220('0x3a')]['user']=_0xff055b['Smtp'][_0xb220('0x71')]=_0x580650['body'][_0xb220('0x78')];_0xff055b['Imap']['password']=_0xff055b[_0xb220('0x3b')][_0xb220('0x73')]=_0x580650['body'][_0xb220('0x79')];}return db['MailAccount'][_0xb220('0x65')](_0xff055b,{'include':[{'model':db[_0xb220('0x55')],'as':_0xb220('0x3b')},{'model':db[_0xb220('0x39')],'as':_0xb220('0x3a')}]})[_0xb220('0x1d')](function(_0x4ab2ea){var _0x27fc20=_0x580650[_0xb220('0x71')][_0xb220('0x33')]({'plain':!![]});if(!_0x27fc20)throw new Error(_0xb220('0x7a'));if(_0x27fc20[_0xb220('0x7b')]===_0xb220('0x71')){var _0x4c1b14=_0x4ab2ea['get']({'plain':!![]});return db[_0xb220('0x7c')][_0xb220('0x58')]({'where':{'name':'MailAccounts','userProfileId':_0x27fc20[_0xb220('0x7d')]},'raw':!![]})[_0xb220('0x1d')](function(_0x3b8d08){if(_0x3b8d08&&_0x3b8d08[_0xb220('0x7e')]===0x0){return db['UserProfileResource']['create']({'name':_0x4c1b14[_0xb220('0x69')],'resourceId':_0x4c1b14['id'],'type':_0x3b8d08['name'],'sectionId':_0x3b8d08['id']},{})[_0xb220('0x1d')](function(){return _0x4ab2ea;});}else{return _0x4ab2ea;}})[_0xb220('0x24')](function(_0x14914e){logger[_0xb220('0x21')](_0xb220('0x7f'),_0x14914e);throw _0x14914e;});}return _0x4ab2ea;})[_0xb220('0x1d')](respondWithResult(_0x445a81,0xc9))[_0xb220('0x24')](handleError(_0x445a81,null));};exports[_0xb220('0x80')]=function(_0x265932,_0x14c7ff,_0x1eb789){return db[_0xb220('0x4f')]['findOne']({'where':{'id':_0x265932['params']['id']}})['then'](handleEntityNotFound(_0x14c7ff,null))[_0xb220('0x1d')](function(_0x5b5e9d){if(_0x5b5e9d){return _0x5b5e9d[_0xb220('0x80')]();}return null;})[_0xb220('0x1d')](respondWithResult(_0x14c7ff,null))[_0xb220('0x24')](handleError(_0x14c7ff,null));};exports[_0xb220('0x81')]=function(_0x2c6bcf,_0x1a24e3,_0x456596){if(_0x2c6bcf[_0xb220('0x5a')]['id']){delete _0x2c6bcf[_0xb220('0x5a')]['id'];}return db[_0xb220('0x4f')][_0xb220('0x58')]({'where':{'id':_0x2c6bcf[_0xb220('0x54')]['id']}})[_0xb220('0x1d')](handleEntityNotFound(_0x1a24e3,null))[_0xb220('0x1d')](function(_0x34b8e4){if(_0x34b8e4){_0x2c6bcf['body'][_0xb220('0x5d')]=_0x34b8e4['id'];return db[_0xb220('0x39')][_0xb220('0x65')](_0x2c6bcf[_0xb220('0x5a')]);}})[_0xb220('0x1d')](respondWithResult(_0x1a24e3,null))[_0xb220('0x24')](handleError(_0x1a24e3,null));};exports['removeImap']=function(_0x5f21b0,_0x46f6bc,_0x35c4c3){return db[_0xb220('0x4f')][_0xb220('0x67')]({'where':{'id':_0x5f21b0[_0xb220('0x54')]['id']}})[_0xb220('0x1d')](handleEntityNotFound(_0x46f6bc,null))[_0xb220('0x1d')](function(_0xf4d54d){if(_0xf4d54d){return _0xf4d54d[_0xb220('0x82')](null);}return null;})[_0xb220('0x1d')](respondWithStatusCode(_0x46f6bc,null))[_0xb220('0x24')](handleError(_0x46f6bc,null));};exports[_0xb220('0x83')]=function(_0x17c60b,_0x686f01,_0x611566){return db['MailAccount'][_0xb220('0x67')]({'where':{'id':_0x17c60b['params']['id']}})[_0xb220('0x1d')](handleEntityNotFound(_0x686f01,null))[_0xb220('0x1d')](function(_0x806352){if(_0x806352){return _0x806352[_0xb220('0x83')]();}return null;})['then'](respondWithResult(_0x686f01,null))[_0xb220('0x24')](handleError(_0x686f01,null));};exports['addSmtp']=function(_0x2bb8fe,_0x3a534a,_0x41ee03){if(_0x2bb8fe[_0xb220('0x5a')]['id']){delete _0x2bb8fe[_0xb220('0x5a')]['id'];}return db[_0xb220('0x4f')][_0xb220('0x58')]({'where':{'id':_0x2bb8fe['params']['id']}})[_0xb220('0x1d')](handleEntityNotFound(_0x3a534a,null))[_0xb220('0x1d')](function(_0x400947){if(_0x400947){_0x2bb8fe['body'][_0xb220('0x5d')]=_0x400947['id'];return db[_0xb220('0x55')][_0xb220('0x65')](_0x2bb8fe[_0xb220('0x5a')]);}})[_0xb220('0x1d')](respondWithResult(_0x3a534a,null))[_0xb220('0x24')](handleError(_0x3a534a,null));};exports['removeSmtp']=function(_0x4060c9,_0x320b9b,_0x2b0795){return db['MailAccount'][_0xb220('0x67')]({'where':{'id':_0x4060c9['params']['id']}})['then'](handleEntityNotFound(_0x320b9b,null))[_0xb220('0x1d')](function(_0x2eef5b){if(_0x2eef5b){return _0x2eef5b[_0xb220('0x84')](null);}return null;})[_0xb220('0x1d')](respondWithStatusCode(_0x320b9b,null))['catch'](handleError(_0x320b9b,null));};exports['addInteraction']=function(_0x39693f,_0x2882c8,_0xa347cb){return db['MailInteraction'][_0xb220('0x58')]({'where':{'id':_0x39693f[_0xb220('0x54')]['id']}})[_0xb220('0x1d')](handleEntityNotFound(_0x2882c8,null))['then'](function(_0x4554f2){if(_0x4554f2){return _0x4554f2['addInteraction'](_0x39693f[_0xb220('0x5a')][_0xb220('0x62')],_['omit'](_0x39693f[_0xb220('0x5a')],['ids','id'])||{});}})[_0xb220('0x1d')](respondWithResult(_0x2882c8,null))[_0xb220('0x24')](handleError(_0x2882c8,null));};exports['getInteractions']=function(_0x5a70ef,_0x3044c2,_0x493ebf){var _0x50988a={'raw':![],'where':{}};var _0x20d384={};var _0x370202={'count':0x0,'rows':[]};return db[_0xb220('0x4f')][_0xb220('0x67')]({'where':{'id':_0x5a70ef[_0xb220('0x54')]['id']}})[_0xb220('0x1d')](handleEntityNotFound(_0x3044c2,null))[_0xb220('0x1d')](function(_0x1a62a2){if(_0x1a62a2){_0x20d384[_0xb220('0x3e')]=_[_0xb220('0x40')](db[_0xb220('0x85')][_0xb220('0x57')]);_0x20d384[_0xb220('0x3f')]=_['keys'](_0x5a70ef[_0xb220('0x3f')]);_0x20d384[_0xb220('0x41')]=_[_0xb220('0x42')](_0x20d384[_0xb220('0x3e')],_0x20d384['query']);_0x50988a[_0xb220('0x43')]=_[_0xb220('0x42')](_0x20d384[_0xb220('0x3e')],qs['fields'](_0x5a70ef[_0xb220('0x3f')][_0xb220('0x44')]));_0x50988a['attributes']=_0x50988a['attributes']['length']?_0x50988a['attributes']:_0x20d384['model'];if(!_0x5a70ef[_0xb220('0x3f')][_0xb220('0x46')](_0xb220('0x47'))){_0x50988a[_0xb220('0x2b')]=qs[_0xb220('0x2b')](_0x5a70ef[_0xb220('0x3f')][_0xb220('0x2b')]);_0x50988a[_0xb220('0x29')]=qs[_0xb220('0x29')](_0x5a70ef[_0xb220('0x3f')][_0xb220('0x29')]);}_0x50988a['order']=qs[_0xb220('0x49')](_0x5a70ef[_0xb220('0x3f')]['sort']);_0x50988a[_0xb220('0x4a')]=qs[_0xb220('0x41')](_[_0xb220('0x5f')](_0x5a70ef[_0xb220('0x3f')],_0x20d384['filters']));_0x50988a[_0xb220('0x4a')]['MailAccountId']=_0x1a62a2['id'];if(_0x5a70ef['query'][_0xb220('0x4b')]){_0x50988a[_0xb220('0x4a')]=_[_0xb220('0x4c')](_0x50988a[_0xb220('0x4a')],{'$or':_[_0xb220('0x3c')](_0x50988a[_0xb220('0x43')],function(_0x3b4a36){var _0x36ed05={};_0x36ed05[_0x3b4a36]={'$like':'%'+_0x5a70ef['query'][_0xb220('0x4b')]+'%'};return _0x36ed05;})});}_0x50988a=_[_0xb220('0x4c')]({},_0x50988a,_0x5a70ef['options']);return db[_0xb220('0x85')][_0xb220('0x2c')]({'where':_0x50988a['where']})[_0xb220('0x1d')](function(_0x402481){_0x370202['count']=_0x402481;if(_0x5a70ef[_0xb220('0x3f')][_0xb220('0x50')]){_0x50988a[_0xb220('0x51')]=[{'model':db[_0xb220('0x86')],'as':'Contact','required':![]},{'model':db[_0xb220('0x87')],'as':_0xb220('0x88'),'attributes':['name',_0xb220('0x89'),_0xb220('0x8a')],'required':![]},{'model':db['Tag'],'as':_0xb220('0x8b'),'attributes':['id',_0xb220('0x69'),_0xb220('0x8c')],'where':_0x5a70ef[_0xb220('0x3f')][_0xb220('0x8d')]?{'id':_0x5a70ef[_0xb220('0x3f')][_0xb220('0x8d')]}:undefined,'required':_0x5a70ef[_0xb220('0x3f')][_0xb220('0x8d')]?!![]:![]}];}return db['MailInteraction']['findAll'](_0x50988a);})['then'](function(_0x59885d){_0x370202['rows']=_0x59885d;return _0x370202;});}})[_0xb220('0x1d')](respondWithFilteredResult(_0x3044c2,_0x50988a))[_0xb220('0x24')](handleError(_0x3044c2,null));};exports[_0xb220('0x8e')]=function(_0xf90c10,_0x4a48ca,_0x1acc58){return db[_0xb220('0x4f')]['findOne']({'where':{'id':_0xf90c10[_0xb220('0x54')]['id']}})[_0xb220('0x1d')](handleEntityNotFound(_0x4a48ca,null))['then'](function(_0x4e50c4){if(_0x4e50c4){return db[_0xb220('0x8f')][_0xb220('0x90')](function(_0x1ec56a){return db[_0xb220('0x91')]['destroy']({'where':{'MailAccountId':_0xf90c10['params']['id']},'transaction':_0x1ec56a})[_0xb220('0x1d')](function(_0xc91fdf){var _0x435572=_[_0xb220('0x3c')](_0xf90c10['body'],function(_0x4c527f){_0x4c527f[_0xb220('0x5d')]=_0xf90c10[_0xb220('0x54')]['id'];return _0x4c527f;});return db[_0xb220('0x91')]['bulkCreate'](_0x435572,{'transaction':_0x1ec56a});});})[_0xb220('0x1d')](function(){return db[_0xb220('0x91')]['findAndCountAll']({'where':{'MailAccountId':_0xf90c10[_0xb220('0x54')]['id']},'order':_0xb220('0x92')});});}})[_0xb220('0x1d')](respondWithResult(_0x4a48ca,null))[_0xb220('0x24')](handleError(_0x4a48ca,null));};exports[_0xb220('0x93')]=function(_0x170da1,_0x395fee,_0x42d23a){var _0x182113={};var _0x36b058={};var _0x4608bf;var _0x23d13f;return db[_0xb220('0x4f')][_0xb220('0x67')]({'where':{'id':_0x170da1[_0xb220('0x54')]['id']}})[_0xb220('0x1d')](handleEntityNotFound(_0x395fee,null))[_0xb220('0x1d')](function(_0x5b1c07){if(_0x5b1c07){_0x4608bf=_0x5b1c07;_0x36b058[_0xb220('0x3e')]=_[_0xb220('0x40')](db[_0xb220('0x91')][_0xb220('0x57')]);_0x36b058[_0xb220('0x3f')]=_[_0xb220('0x40')](_0x170da1[_0xb220('0x3f')]);_0x36b058['filters']=_[_0xb220('0x42')](_0x36b058[_0xb220('0x3e')],_0x36b058[_0xb220('0x3f')]);_0x182113['attributes']=_[_0xb220('0x42')](_0x36b058[_0xb220('0x3e')],qs['fields'](_0x170da1['query'][_0xb220('0x44')]));_0x182113['attributes']=_0x182113[_0xb220('0x43')][_0xb220('0x45')]?_0x182113[_0xb220('0x43')]:_0x36b058[_0xb220('0x3e')];_0x182113[_0xb220('0x48')]=qs[_0xb220('0x49')](_0x170da1['query'][_0xb220('0x49')]);_0x182113['where']=qs[_0xb220('0x41')](_['pick'](_0x170da1['query'],_0x36b058[_0xb220('0x41')]));if(_0x170da1[_0xb220('0x3f')][_0xb220('0x4b')]){_0x182113['where']=_['merge'](_0x182113[_0xb220('0x4a')],{'$or':_[_0xb220('0x3c')](_0x182113[_0xb220('0x43')],function(_0x40bf21){var _0x383057={};_0x383057[_0x40bf21]={'$like':'%'+_0x170da1[_0xb220('0x3f')][_0xb220('0x4b')]+'%'};return _0x383057;})});}_0x182113=_['merge']({},_0x182113,_0x170da1['options']);return _0x4608bf[_0xb220('0x93')](_0x182113);}})[_0xb220('0x1d')](function(_0x315e6b){if(_0x315e6b){_0x23d13f=_0x315e6b[_0xb220('0x45')];if(!_0x170da1['query'][_0xb220('0x46')]('nolimit')){_0x182113['limit']=qs[_0xb220('0x2b')](_0x170da1[_0xb220('0x3f')][_0xb220('0x2b')]);_0x182113[_0xb220('0x29')]=qs['offset'](_0x170da1['query'][_0xb220('0x29')]);}return _0x4608bf[_0xb220('0x93')](_0x182113);}})[_0xb220('0x1d')](function(_0x4c471d){if(_0x4c471d){return _0x4c471d?{'count':_0x23d13f,'rows':_0x4c471d}:null;}})['then'](respondWithResult(_0x395fee,null))[_0xb220('0x24')](handleError(_0x395fee,null));};exports['getMessages']=function(_0x1692ec,_0x30b3a8,_0xd3a767){var _0x54d419={'raw':!![],'where':{}};var _0x49d315={};var _0x4f56f3={'count':0x0,'rows':[]};return db['MailAccount'][_0xb220('0x67')]({'where':{'id':_0x1692ec[_0xb220('0x54')]['id']}})[_0xb220('0x1d')](handleEntityNotFound(_0x30b3a8,null))[_0xb220('0x1d')](function(_0x4cd6df){if(_0x4cd6df){_0x49d315['model']=_[_0xb220('0x40')](db['MailMessage'][_0xb220('0x57')]);_0x49d315[_0xb220('0x3f')]=_['keys'](_0x1692ec['query']);_0x49d315[_0xb220('0x41')]=_[_0xb220('0x42')](_0x49d315['model'],_0x49d315[_0xb220('0x3f')]);_0x54d419[_0xb220('0x43')]=_[_0xb220('0x42')](_0x49d315[_0xb220('0x3e')],qs[_0xb220('0x44')](_0x1692ec[_0xb220('0x3f')][_0xb220('0x44')]));_0x54d419[_0xb220('0x43')]=_0x54d419[_0xb220('0x43')][_0xb220('0x45')]?_0x54d419[_0xb220('0x43')]:_0x49d315[_0xb220('0x3e')];if(!_0x1692ec[_0xb220('0x3f')][_0xb220('0x46')](_0xb220('0x47'))){_0x54d419[_0xb220('0x2b')]=qs[_0xb220('0x2b')](_0x1692ec[_0xb220('0x3f')][_0xb220('0x2b')]);_0x54d419[_0xb220('0x29')]=qs[_0xb220('0x29')](_0x1692ec[_0xb220('0x3f')][_0xb220('0x29')]);}_0x54d419[_0xb220('0x48')]=qs['sort'](_0x1692ec[_0xb220('0x3f')]['sort']);_0x54d419[_0xb220('0x4a')]=qs[_0xb220('0x41')](_[_0xb220('0x5f')](_0x1692ec[_0xb220('0x3f')],_0x49d315[_0xb220('0x41')]));_0x54d419[_0xb220('0x4a')][_0xb220('0x5d')]=_0x4cd6df['id'];if(_0x1692ec[_0xb220('0x3f')][_0xb220('0x4b')]){_0x54d419['where']=_[_0xb220('0x4c')](_0x54d419['where'],{'$or':_[_0xb220('0x3c')](_0x54d419[_0xb220('0x43')],function(_0x4bb24c){var _0x6a382b={};_0x6a382b[_0x4bb24c]={'$like':'%'+_0x1692ec[_0xb220('0x3f')][_0xb220('0x4b')]+'%'};return _0x6a382b;})});}if(_0x1692ec[_0xb220('0x3f')][_0xb220('0x94')]){var _0x4d8dd9=_0x1692ec['query'][_0xb220('0x94')][_0xb220('0x95')](',');var _0x491a1d={};_0x491a1d[_0x4d8dd9[0x0]]={'$gte':moment(_0x4d8dd9[0x1])[_0xb220('0x96')]('YYYY-MM-DD\x20HH:mm:ss')};_0x54d419[_0xb220('0x4a')]=_[_0xb220('0x4c')](_0x54d419[_0xb220('0x4a')],_0x491a1d);}_0x54d419=_[_0xb220('0x4c')]({},_0x54d419,_0x1692ec[_0xb220('0x4e')]);return db[_0xb220('0x97')]['count']({'where':_0x54d419['where']})[_0xb220('0x1d')](function(_0x2c214c){_0x4f56f3[_0xb220('0x2c')]=_0x2c214c;if(_0x1692ec[_0xb220('0x3f')][_0xb220('0x50')]){_0x54d419[_0xb220('0x51')]=[{'all':!![]}];}return db[_0xb220('0x97')][_0xb220('0x52')](_0x54d419);})[_0xb220('0x1d')](function(_0x2edd30){if(_0x1692ec['query'][_0xb220('0x98')]==='true'){for(var _0x37e023=0x0;_0x37e023<_0x2edd30[_0xb220('0x45')];_0x37e023++){_0x2edd30[_0x37e023]['body']=juice(_0x2edd30[_0x37e023][_0xb220('0x5a')]);}}_0x4f56f3['rows']=_0x2edd30;return _0x4f56f3;});}})[_0xb220('0x1d')](respondWithFilteredResult(_0x30b3a8,_0x54d419))[_0xb220('0x24')](handleError(_0x30b3a8,null));};exports[_0xb220('0x37')]=function(_0x3ddf7b,_0x1660dd,_0x2a3c59){var _0xf55af0,_0x143315={},_0x284864;if(_0x3ddf7b[_0xb220('0x5a')]['to']){_0x284864=_0x3ddf7b['body']['to']['split'](',')[0x0];}return db[_0xb220('0x4f')][_0xb220('0x58')]({'where':{'id':_0x3ddf7b[_0xb220('0x54')]['id']},'include':[{'model':db[_0xb220('0x99')],'as':'List','include':[{'model':db[_0xb220('0x86')],'as':'Contacts','where':{'email':_0x284864},'limit':0x1,'order':[[_0xb220('0x9a'),_0xb220('0x9b')]]}]},{'model':db[_0xb220('0x55')],'as':_0xb220('0x3b'),'raw':!![]}]})[_0xb220('0x1d')](handleEntityNotFound(_0x1660dd,null))[_0xb220('0x1d')](function(_0x1c5ae5){if(_0x1c5ae5){_0xf55af0=_0x1c5ae5;if(_0x1c5ae5[_0xb220('0x3b')]){if(_['isNil'](_0x3ddf7b[_0xb220('0x5a')]['from'])){_0x3ddf7b[_0xb220('0x5a')][_0xb220('0x9c')]=util[_0xb220('0x96')]('%s\x20<%s>',_0x1c5ae5[_0xb220('0x69')],_0x1c5ae5[_0xb220('0x6b')]||_0x1c5ae5[_0xb220('0x3b')][_0xb220('0x71')]);}if(_0x3ddf7b[_0xb220('0x5a')]['attachments']&&_0x3ddf7b['body']['attachments'][_0xb220('0x45')]){for(var _0x2b5ee3=0x0;_0x2b5ee3<_0x3ddf7b[_0xb220('0x5a')]['attachments']['length'];_0x2b5ee3+=0x1){_0x3ddf7b[_0xb220('0x5a')][_0xb220('0x9d')][_0x2b5ee3]={'filename':_0x3ddf7b[_0xb220('0x5a')]['attachments'][_0x2b5ee3][_0xb220('0x69')],'path':path[_0xb220('0x9e')](config[_0xb220('0x9f')],_0xb220('0xa0'),_0x3ddf7b[_0xb220('0x5a')][_0xb220('0x9d')][_0x2b5ee3][_0xb220('0xa1')])};}}var _0xe3bc43={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x1c5ae5[_0xb220('0x3b')][_0xb220('0x77')])){if(_0x1c5ae5['Smtp'][_0xb220('0x74')]){_0xe3bc43['auth']={'user':_0x1c5ae5['Smtp'][_0xb220('0x71')],'pass':_0x1c5ae5[_0xb220('0x3b')][_0xb220('0x73')]};}_0xe3bc43[_0xb220('0x75')]=_0x1c5ae5['Smtp'][_0xb220('0x75')];_0xe3bc43['port']=_0x1c5ae5['Smtp'][_0xb220('0x76')];_0xe3bc43['secure']=_0x1c5ae5[_0xb220('0x3b')][_0xb220('0xa2')];}else{_0xe3bc43[_0xb220('0x77')]=_0x1c5ae5[_0xb220('0x3b')][_0xb220('0x77')];_0xe3bc43['auth']={'user':_0x1c5ae5[_0xb220('0x3b')][_0xb220('0x71')],'pass':_0x1c5ae5[_0xb220('0x3b')]['pass']};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0xe3bc43,'message':_0x3ddf7b[_0xb220('0x5a')]});}else{throw new Error(_0xb220('0xa3'));}}})[_0xb220('0x1d')](function(_0x542c80){if(_0x542c80){_0x143315=_0x542c80;if(_0xf55af0[_0xb220('0xa4')]){if(_0xf55af0[_0xb220('0xa4')][_0xb220('0xa5')][_0xb220('0x45')]){return _0xf55af0['List'][_0xb220('0xa5')][0x0];}else{return db['CmContact']['create'](_[_0xb220('0xa6')](_0x3ddf7b[_0xb220('0x5a')],{'firstName':_0x3ddf7b['body']['to'],'email':_0x3ddf7b[_0xb220('0x5a')]['to'],'phone':_0x3ddf7b[_0xb220('0x5a')]['to'],'ListId':_0xf55af0[_0xb220('0x6c')]}));}}else{throw new Error(_0xb220('0xa3'));}}})[_0xb220('0x1d')](function(_0x5affc6){if(_0x5affc6){var _0x15e5ea={'UserId':_0x3ddf7b[_0xb220('0x71')]['id'],'ContactId':_0x5affc6['id'],'MailAccountId':_0xf55af0['id'],'inReplyTo':_0x143315[_0xb220('0xa7')],'to':_0x3ddf7b[_0xb220('0x5a')][_0xb220('0x9c')],'cc':_0x3ddf7b[_0xb220('0x5a')]['cc'],'subject':_0x3ddf7b['body'][_0xb220('0xa8')],'attach':_0x3ddf7b[_0xb220('0x5a')][_0xb220('0xa9')],'firstMsgDirection':_0xb220('0xaa'),'lastMsgAt':moment()['format'](_0xb220('0xab')),'lastMsgDirection':_0xb220('0xaa'),'Messages':[_[_0xb220('0x4c')](_0x3ddf7b[_0xb220('0x5a')],{'messageId':_0x143315[_0xb220('0xa7')],'sentAt':moment()['format'](_0xb220('0xab')),'read':!![],'MailAccountId':_0xf55af0['id'],'UserId':_0x3ddf7b[_0xb220('0x71')]['id'],'ContactId':_0x5affc6['id']})]};if(_0x3ddf7b[_0xb220('0x5a')]['Interaction']){_0x15e5ea=_[_0xb220('0x4c')](_0x15e5ea,_0x3ddf7b[_0xb220('0x5a')][_0xb220('0xac')]);}return db[_0xb220('0x85')]['create'](_0x15e5ea,{'include':[{'model':db[_0xb220('0x97')],'as':'Messages'}]});}})[_0xb220('0x1d')](respondWithResult(_0x1660dd,null))['catch'](handleError(_0x1660dd,null));};exports[_0xb220('0xad')]=function(_0x4cd25b,_0x1d5927,_0x42fbd1){return db['MailAccount'][_0xb220('0x58')]({'where':{'id':_0x4cd25b['params']['id']},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})[_0xb220('0x1d')](handleEntityNotFound(_0x1d5927,null))[_0xb220('0x1d')](function(_0x3478ee){if(_0x3478ee&&_0x3478ee[_0xb220('0x3b')]){var _0x57bdad={'id':_0x3478ee['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3478ee[_0xb220('0x3b')][_0xb220('0x77')]){_0x57bdad[_0xb220('0x77')]=_0x3478ee[_0xb220('0x3b')][_0xb220('0x77')];}else{_0x57bdad[_0xb220('0x75')]=_0x3478ee['Smtp'][_0xb220('0x75')];_0x57bdad[_0xb220('0x76')]=_0x3478ee[_0xb220('0x3b')]['port'];_0x57bdad[_0xb220('0xa2')]=_0x3478ee[_0xb220('0x3b')]['secure'];}if(_0x3478ee[_0xb220('0x3b')][_0xb220('0x74')]){_0x57bdad[_0xb220('0xae')]={'user':_0x3478ee[_0xb220('0x3b')][_0xb220('0x71')],'pass':_0x3478ee[_0xb220('0x3b')][_0xb220('0x73')]};}return respondWithRpcPromise('VerifySmtp',_0xb220('0xad'),{'account':_0x57bdad});}})[_0xb220('0x1d')](respondWithResult(_0x1d5927,null))[_0xb220('0x24')](handleError(_0x1d5927,null));};exports['destroy']=function(_0x4134c7,_0x26462d){return db[_0xb220('0x4f')][_0xb220('0x58')]({'where':{'id':_0x4134c7['params']['id']}})[_0xb220('0x1d')](handleEntityNotFound(_0x26462d,null))[_0xb220('0x1d')](function(_0x460f14){if(_0x460f14&&_0x460f14[_0xb220('0x77')]){throw new db[(_0xb220('0xaf'))][(_0xb220('0xb0'))](_0xb220('0xb1'));}return _0x460f14;})[_0xb220('0x1d')](removeEntity(_0x26462d,null))[_0xb220('0x24')](handleError(_0x26462d,null));};exports[_0xb220('0xb2')]=function(_0x27ceeb,_0xd0c06f,_0x3f945f){return db[_0xb220('0x4f')]['find']({'where':{'id':_0x27ceeb[_0xb220('0x54')]['id']}})[_0xb220('0x1d')](handleEntityNotFound(_0xd0c06f,null))[_0xb220('0x1d')](function(_0x4c1abe){if(_0x4c1abe){return _0x4c1abe[_0xb220('0xb2')](_0x27ceeb['body'][_0xb220('0x62')],_[_0xb220('0xb3')](_0x27ceeb[_0xb220('0x5a')],[_0xb220('0x62'),'id'])||{})[_0xb220('0xb4')](function(_0x26e738){for(var _0x2fe76f=0x0;_0x2fe76f<_0x27ceeb[_0xb220('0x5a')][_0xb220('0x62')]['length'];_0x2fe76f+=0x1){socket[_0xb220('0xb5')](_0xb220('0xb6'),{'UserId':Number(_0x27ceeb['body'][_0xb220('0x62')][_0x2fe76f]),'MailAccountId':Number(_0x27ceeb[_0xb220('0x54')]['id'])});}return _0x26e738;});}})[_0xb220('0x1d')](respondWithResult(_0xd0c06f,null))['catch'](handleError(_0xd0c06f,null));};exports['removeAgents']=function(_0x51a54f,_0x4d3d49,_0x50505d){return db[_0xb220('0x4f')]['find']({'where':{'id':_0x51a54f[_0xb220('0x54')]['id']}})[_0xb220('0x1d')](handleEntityNotFound(_0x4d3d49,null))['then'](function(_0x4097c8){if(_0x4097c8){return _0x4097c8[_0xb220('0xb7')](_0x51a54f[_0xb220('0x3f')][_0xb220('0x62')])[_0xb220('0x1d')](function(){if(_['isArray'](_0x51a54f['query'][_0xb220('0x62')])){for(var _0x3fb55f=0x0;_0x3fb55f<_0x51a54f[_0xb220('0x3f')][_0xb220('0x62')][_0xb220('0x45')];_0x3fb55f+=0x1){socket['emit'](_0xb220('0xb8'),{'UserId':Number(_0x51a54f[_0xb220('0x3f')][_0xb220('0x62')][_0x3fb55f]),'MailAccountId':Number(_0x51a54f[_0xb220('0x54')]['id'])});}}else{socket[_0xb220('0xb5')](_0xb220('0xb8'),{'UserId':Number(_0x51a54f[_0xb220('0x3f')][_0xb220('0x62')]),'MailAccountId':Number(_0x51a54f['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4d3d49,null))[_0xb220('0x24')](handleError(_0x4d3d49,null));};exports['getAgents']=function(_0x3f11e1,_0x15b2a8,_0x758a3c){var _0x3fa8f6={};var _0x146d16={};var _0x1a230d;var _0x3495ee;return db[_0xb220('0x4f')][_0xb220('0x67')]({'where':{'id':_0x3f11e1[_0xb220('0x54')]['id']}})[_0xb220('0x1d')](handleEntityNotFound(_0x15b2a8,null))[_0xb220('0x1d')](function(_0x22c8c6){if(_0x22c8c6){_0x1a230d=_0x22c8c6;_0x146d16[_0xb220('0x3e')]=_[_0xb220('0x40')](db[_0xb220('0x87')]['rawAttributes']);_0x146d16[_0xb220('0x3f')]=_[_0xb220('0x40')](_0x3f11e1[_0xb220('0x3f')]);_0x146d16['filters']=_['intersection'](_0x146d16[_0xb220('0x3e')],_0x146d16[_0xb220('0x3f')]);_0x3fa8f6[_0xb220('0x43')]=_['intersection'](_0x146d16[_0xb220('0x3e')],qs[_0xb220('0x44')](_0x3f11e1[_0xb220('0x3f')][_0xb220('0x44')]));_0x3fa8f6['attributes']=_0x3fa8f6['attributes'][_0xb220('0x45')]?_0x3fa8f6[_0xb220('0x43')]:_0x146d16[_0xb220('0x3e')];_0x3fa8f6[_0xb220('0x48')]=qs[_0xb220('0x49')](_0x3f11e1[_0xb220('0x3f')][_0xb220('0x49')]);_0x3fa8f6[_0xb220('0x4a')]=qs[_0xb220('0x41')](_['pick'](_0x3f11e1[_0xb220('0x3f')],_0x146d16[_0xb220('0x41')]));if(_0x3f11e1['query'][_0xb220('0x4b')]){_0x3fa8f6[_0xb220('0x4a')]=_[_0xb220('0x4c')](_0x3fa8f6[_0xb220('0x4a')],{'$or':_[_0xb220('0x3c')](_0x3fa8f6[_0xb220('0x43')],function(_0x30aa5a){var _0x45f9ea={};_0x45f9ea[_0x30aa5a]={'$like':'%'+_0x3f11e1[_0xb220('0x3f')][_0xb220('0x4b')]+'%'};return _0x45f9ea;})});}_0x3fa8f6=_[_0xb220('0x4c')]({},_0x3fa8f6,_0x3f11e1[_0xb220('0x4e')]);return _0x1a230d[_0xb220('0xb9')](_0x3fa8f6);}})[_0xb220('0x1d')](function(_0x10f82c){if(_0x10f82c){_0x3495ee=_0x10f82c[_0xb220('0x45')];if(!_0x3f11e1[_0xb220('0x3f')][_0xb220('0x46')]('nolimit')){_0x3fa8f6[_0xb220('0x2b')]=qs[_0xb220('0x2b')](_0x3f11e1[_0xb220('0x3f')]['limit']);_0x3fa8f6['offset']=qs[_0xb220('0x29')](_0x3f11e1[_0xb220('0x3f')][_0xb220('0x29')]);}return _0x1a230d[_0xb220('0xb9')](_0x3fa8f6);}})[_0xb220('0x1d')](function(_0x17a5c7){if(_0x17a5c7){return _0x17a5c7?{'count':_0x3495ee,'rows':_0x17a5c7}:null;}})[_0xb220('0x1d')](respondWithResult(_0x15b2a8,null))[_0xb220('0x24')](handleError(_0x15b2a8,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index b77d06d..6e4dbdf 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 _0xc962=['remove','emit','hasOwnProperty','hook','exports','events','save','update'];(function(_0x3b9350,_0x5f54ec){var _0x1d8c89=function(_0x1c9a8c){while(--_0x1c9a8c){_0x3b9350['push'](_0x3b9350['shift']());}};_0x1d8c89(++_0x5f54ec);}(_0xc962,0x6d));var _0x2c96=function(_0x18bbe2,_0x16134c){_0x18bbe2=_0x18bbe2-0x0;var _0x405657=_0xc962[_0x18bbe2];return _0x405657;};'use strict';var EventEmitter=require(_0x2c96('0x0'));var MailAccount=require('../../mysqldb')['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2c96('0x1'),'afterUpdate':_0x2c96('0x2'),'afterDestroy':_0x2c96('0x3')};function emitEvent(_0x1a1faf){return function(_0x305702,_0x83568f,_0x451d99){MailAccountEvents[_0x2c96('0x4')](_0x1a1faf+':'+_0x305702['id'],_0x305702);MailAccountEvents['emit'](_0x1a1faf,_0x305702);_0x451d99(null);};}for(var e in events){if(events[_0x2c96('0x5')](e)){var event=events[e];MailAccount[_0x2c96('0x6')](e,emitEvent(event));}}module[_0x2c96('0x7')]=MailAccountEvents; \ No newline at end of file +var _0xe585=['exports','events','MailAccount','save','update','remove','emit','hasOwnProperty','hook'];(function(_0xbf698b,_0x2bfdfb){var _0x250e0d=function(_0x27febe){while(--_0x27febe){_0xbf698b['push'](_0xbf698b['shift']());}};_0x250e0d(++_0x2bfdfb);}(_0xe585,0x9a));var _0x5e58=function(_0x41f878,_0x33db90){_0x41f878=_0x41f878-0x0;var _0x38c421=_0xe585[_0x41f878];return _0x38c421;};'use strict';var EventEmitter=require(_0x5e58('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x5e58('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5e58('0x2'),'afterUpdate':_0x5e58('0x3'),'afterDestroy':_0x5e58('0x4')};function emitEvent(_0xa30ab8){return function(_0x2bb284,_0x12797c,_0xa1e973){MailAccountEvents['emit'](_0xa30ab8+':'+_0x2bb284['id'],_0x2bb284);MailAccountEvents[_0x5e58('0x5')](_0xa30ab8,_0x2bb284);_0xa1e973(null);};}for(var e in events){if(events[_0x5e58('0x6')](e)){var event=events[e];MailAccount[_0x5e58('0x7')](e,emitEvent(event));}}module[_0x5e58('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 93ac23a..cf6a2a2 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 _0xba32=['request-promise','path','rimraf','../../config/environment','./mailAccount.attributes','define','MailAccount','mail_accounts','lodash','../../config/logger','api'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xba32,0x126));var _0x2ba3=function(_0x455e82,_0x522f6f){_0x455e82=_0x455e82-0x0;var _0x2d0520=_0xba32[_0x455e82];return _0x2d0520;};'use strict';var _=require(_0x2ba3('0x0'));var util=require('util');var logger=require(_0x2ba3('0x1'))(_0x2ba3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2ba3('0x3'));var fs=require('fs');var path=require(_0x2ba3('0x4'));var rimraf=require(_0x2ba3('0x5'));var config=require(_0x2ba3('0x6'));var attributes=require(_0x2ba3('0x7'));module['exports']=function(_0x425c42,_0x3fb693){return _0x425c42[_0x2ba3('0x8')](_0x2ba3('0x9'),attributes,{'tableName':_0x2ba3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a94=['exports','define','MailAccount','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./mailAccount.attributes'];(function(_0x1655bb,_0x5a82ae){var _0x5e2020=function(_0x1ccfb4){while(--_0x1ccfb4){_0x1655bb['push'](_0x1655bb['shift']());}};_0x5e2020(++_0x5a82ae);}(_0x7a94,0x1d1));var _0x47a9=function(_0x4b86c9,_0x5d2422){_0x4b86c9=_0x4b86c9-0x0;var _0x4991a3=_0x7a94[_0x4b86c9];return _0x4991a3;};'use strict';var _=require('lodash');var util=require(_0x47a9('0x0'));var logger=require(_0x47a9('0x1'))('api');var moment=require(_0x47a9('0x2'));var BPromise=require(_0x47a9('0x3'));var rp=require(_0x47a9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x47a9('0x5'));var config=require(_0x47a9('0x6'));var attributes=require(_0x47a9('0x7'));module[_0x47a9('0x8')]=function(_0x1fbacf,_0x5073f9){return _0x1fbacf[_0x47a9('0x9')](_0x47a9('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 bb7e323..b26504d 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 _0x4325=['include','map','model','debug','stringify','ShowMailAccount','body','mail','difference','keys','CmContact','rawAttributes','updatedAt','ListId','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','find','account','List','Contacts','Smtp','get','omit','Applications','applications','list','orderBy','priority','autoclose','push','close','*,*,*,*','length','create','List\x20not\x20found','messageId','generate','subject','attach','format','MailInteraction','MailMessage','Messages','inReplyTo','spread','update','YYYY-MM-DD\x20HH:mm:ss','interaction','created','contact','attachments','originTo','originCc','bcc','ChatWebsiteId','originChannel','Email','Attachment','Attachments','User','name','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','error','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit'];(function(_0x5a15f5,_0x13bf89){var _0x174ff1=function(_0x4ddb53){while(--_0x4ddb53){_0x5a15f5['push'](_0x5a15f5['shift']());}};_0x174ff1(++_0x13bf89);}(_0x4325,0x180));var _0x5432=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x4325[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x5432('0x0'));var util=require(_0x5432('0x1'));var moment=require(_0x5432('0x2'));var BPromise=require(_0x5432('0x3'));var rs=require(_0x5432('0x4'));var fs=require('fs');var Redis=require(_0x5432('0x5'));var db=require(_0x5432('0x6'))['db'];var utils=require(_0x5432('0x7'));var logger=require(_0x5432('0x8'))('rpc');var config=require(_0x5432('0x9'));var jayson=require(_0x5432('0xa'));var client=jayson[_0x5432('0xb')][_0x5432('0xc')]({'port':0x232c});config[_0x5432('0xd')]=_[_0x5432('0xe')](config[_0x5432('0xd')],{'host':_0x5432('0xf'),'port':0x18eb});var socket=require(_0x5432('0x10'))(new Redis(config[_0x5432('0xd')]));require(_0x5432('0x11'))[_0x5432('0x12')](socket);function respondWithRpcPromise(_0x39d538,_0x285b94,_0x240b33){return new BPromise(function(_0xd707e3,_0x19cc71){return client[_0x5432('0x13')](_0x39d538,_0x240b33)[_0x5432('0x14')](function(_0x2cf576){logger[_0x5432('0x15')](_0x5432('0x16'),_0x285b94,_0x5432('0x17'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x285b94,'request\x20sent',JSON['stringify'](_0x2cf576));if(_0x2cf576[_0x5432('0x18')]){if(_0x2cf576['error']['code']===0x1f4){logger['error'](_0x5432('0x16'),_0x285b94,_0x2cf576['error'][_0x5432('0x19')]);return _0x19cc71(_0x2cf576[_0x5432('0x18')][_0x5432('0x19')]);}logger['error'](_0x5432('0x16'),_0x285b94,_0x2cf576[_0x5432('0x18')][_0x5432('0x19')]);return _0xd707e3(_0x2cf576[_0x5432('0x18')]['message']);}else{logger[_0x5432('0x15')](_0x5432('0x16'),_0x285b94,_0x5432('0x17'));_0xd707e3(_0x2cf576[_0x5432('0x1a')][_0x5432('0x19')]);}})[_0x5432('0x1b')](function(_0x23be4b){logger[_0x5432('0x18')]('MailAccount,\x20%s,\x20%s',_0x285b94,_0x23be4b);_0x19cc71(_0x23be4b);});});}exports[_0x5432('0x1c')]=function(_0x21ba18){var _0x3ab779=this;return new Promise(function(_0x4827fe,_0x5795b5){return db[_0x5432('0x1d')][_0x5432('0x1e')]({'raw':_0x21ba18[_0x5432('0x1f')]?_0x21ba18[_0x5432('0x1f')][_0x5432('0x20')]===undefined?!![]:![]:!![],'where':_0x21ba18[_0x5432('0x1f')]?_0x21ba18[_0x5432('0x1f')][_0x5432('0x21')]||null:null,'attributes':_0x21ba18['options']?_0x21ba18[_0x5432('0x1f')][_0x5432('0x22')]||null:null,'limit':_0x21ba18[_0x5432('0x1f')]?_0x21ba18[_0x5432('0x1f')][_0x5432('0x23')]||null:null,'include':_0x21ba18[_0x5432('0x1f')]?_0x21ba18[_0x5432('0x1f')][_0x5432('0x24')]?_['map'](_0x21ba18['options']['include'],function(_0x50ecf2){return{'model':db[_0x50ecf2['model']],'as':_0x50ecf2['as'],'attributes':_0x50ecf2[_0x5432('0x22')],'include':_0x50ecf2['include']?_[_0x5432('0x25')](_0x50ecf2[_0x5432('0x24')],function(_0x365750){return{'model':db[_0x365750[_0x5432('0x26')]],'as':_0x365750['as'],'attributes':_0x365750[_0x5432('0x22')],'include':_0x365750[_0x5432('0x24')]?_['map'](_0x365750[_0x5432('0x24')],function(_0xd5a562){return{'model':db[_0xd5a562['model']],'as':_0xd5a562['as'],'attributes':_0xd5a562[_0x5432('0x22')]};}):[]};}):[]};}):[]:[]})[_0x5432('0x14')](function(_0x3f6c1e){logger[_0x5432('0x15')](_0x5432('0x1c'),_0x21ba18);logger[_0x5432('0x27')]('GetMailAccount',_0x21ba18,JSON[_0x5432('0x28')](_0x3f6c1e));_0x4827fe(_0x3f6c1e);})[_0x5432('0x1b')](function(_0x8d70f2){logger[_0x5432('0x18')](_0x5432('0x1c'),_0x8d70f2['message'],_0x21ba18);_0x5795b5(_0x3ab779[_0x5432('0x18')](0x1f4,_0x8d70f2['message']));});});};exports[_0x5432('0x29')]=function(_0x41156f){var _0x1fa6ce=this;return new Promise(function(_0x3822fd,_0x2c5939){return db[_0x5432('0x1d')]['find']({'raw':_0x41156f[_0x5432('0x1f')]?_0x41156f['options'][_0x5432('0x20')]===undefined?!![]:![]:!![],'where':_0x41156f[_0x5432('0x1f')]?_0x41156f[_0x5432('0x1f')][_0x5432('0x21')]||null:null,'attributes':_0x41156f[_0x5432('0x1f')]?_0x41156f[_0x5432('0x1f')][_0x5432('0x22')]||null:null,'include':_0x41156f[_0x5432('0x1f')]?_0x41156f[_0x5432('0x1f')]['include']?_['map'](_0x41156f[_0x5432('0x1f')][_0x5432('0x24')],function(_0x5e9bdf){return{'model':db[_0x5e9bdf[_0x5432('0x26')]],'as':_0x5e9bdf['as'],'attributes':_0x5e9bdf[_0x5432('0x22')],'include':_0x5e9bdf[_0x5432('0x24')]?_[_0x5432('0x25')](_0x5e9bdf[_0x5432('0x24')],function(_0x241607){return{'model':db[_0x241607[_0x5432('0x26')]],'as':_0x241607['as'],'attributes':_0x241607['attributes'],'include':_0x241607['include']?_['map'](_0x241607[_0x5432('0x24')],function(_0x5a8803){return{'model':db[_0x5a8803[_0x5432('0x26')]],'as':_0x5a8803['as'],'attributes':_0x5a8803[_0x5432('0x22')]};}):[]};}):[]};}):[]:[]})[_0x5432('0x14')](function(_0x1577fa){logger['info'](_0x5432('0x29'),_0x41156f);logger[_0x5432('0x27')]('ShowMailAccount',_0x41156f,JSON[_0x5432('0x28')](_0x1577fa));_0x3822fd(_0x1577fa);})[_0x5432('0x1b')](function(_0x27091a){logger[_0x5432('0x18')](_0x5432('0x29'),_0x27091a[_0x5432('0x19')],_0x41156f);_0x2c5939(_0x1fa6ce[_0x5432('0x18')](0x1f4,_0x27091a[_0x5432('0x19')]));});});};exports['NotifyMailAccount']=function(_0x985bc6){var _0x11ad09=this;return new Promise(function(_0x5d4da0,_0x2f57c9){var _0x5488ff={'body':_0x985bc6[_0x5432('0x2a')],'channel':_0x5432('0x2b')};var _0x5228aa=_[_0x5432('0x2c')](_[_0x5432('0x2d')](db[_0x5432('0x2e')][_0x5432('0x2f')]),['createdAt',_0x5432('0x30'),'CompanyId',_0x5432('0x31')]);var _0x1c5112=![];if(_0x985bc6['body']['id']){delete _0x985bc6[_0x5432('0x2a')]['id'];}if(_[_0x5432('0x32')](_0x985bc6['body']['from'])){return _0x2f57c9(_0x11ad09['error'](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x5432('0x32')](_0x985bc6[_0x5432('0x2a')]['body'])||_0x985bc6[_0x5432('0x2a')]['body']===''){return _0x2f57c9(_0x11ad09[_0x5432('0x18')](0x1f4,_0x5432('0x33')));}if(_[_0x5432('0x32')](_0x985bc6[_0x5432('0x2a')]['mapKey'])){return _0x2f57c9(_0x11ad09[_0x5432('0x18')](0x1f4,_0x5432('0x34')+_0x5228aa));}if(!_['includes'](_0x5228aa,_0x985bc6['body'][_0x5432('0x35')])){return _0x2f57c9(_0x11ad09[_0x5432('0x18')](0x1f4,_0x5432('0x36')+_0x5228aa));}var _0x112cdb={};_0x112cdb[_0x985bc6[_0x5432('0x2a')][_0x5432('0x35')]]=_0x985bc6[_0x5432('0x2a')][_0x5432('0x37')];return db['MailAccount'][_0x5432('0x38')]({'where':{'id':_0x985bc6[_0x5432('0x39')]['id']},'include':[{'model':db['CmList'],'as':_0x5432('0x3a'),'include':[{'model':db[_0x5432('0x2e')],'as':_0x5432('0x3b'),'where':_0x112cdb,'limit':0x1,'order':[[_0x5432('0x30'),'DESC']]}]},{'model':db['MailApplication'],'as':'Applications'},{'model':db['MailServerOut'],'as':_0x5432('0x3c')}]})[_0x5432('0x14')](function(_0x13f483){if(_0x13f483&&_0x13f483[_0x5432('0x3a')]){var _0x299f61=_0x13f483[_0x5432('0x3d')]({'plain':!![]});_0x5488ff['account']=_[_0x5432('0x3e')](_0x299f61,[_0x5432('0x3f'),_0x5432('0x3a')]);_0x5488ff[_0x5432('0x40')]=_0x299f61['Applications'];_0x5488ff[_0x5432('0x41')]=_0x299f61['List'];_0x5488ff[_0x5432('0x40')]=_[_0x5432('0x42')](_0x5488ff[_0x5432('0x40')],[_0x5432('0x43')],['asc']);if(_0x5488ff['account']&&_0x5488ff[_0x5432('0x39')][_0x5432('0x44')]){_0x5488ff[_0x5432('0x40')][_0x5432('0x45')]({'id':0x0,'priority':_0x5488ff['applications']['length']+0x1,'app':_0x5432('0x46'),'appdata':_0x5432('0x44'),'interval':_0x5432('0x47')});}if(_0x5488ff[_0x5432('0x39')][_0x5432('0x3f')]){delete _0x5488ff[_0x5432('0x39')][_0x5432('0x3f')];}if(_0x5488ff[_0x5432('0x39')]['List']){delete _0x5488ff[_0x5432('0x39')][_0x5432('0x3a')];}if(_0x299f61[_0x5432('0x3a')][_0x5432('0x3b')][_0x5432('0x48')]){return _0x299f61[_0x5432('0x3a')]['Contacts'][0x0];}var _0x599dd7=_[_0x5432('0xe')](_0x985bc6[_0x5432('0x2a')],{'firstName':_0x985bc6[_0x5432('0x2a')][_0x5432('0x37')],'ListId':_0x299f61[_0x5432('0x31')]});_0x599dd7[_0x985bc6[_0x5432('0x2a')][_0x5432('0x35')]]=_0x985bc6[_0x5432('0x2a')][_0x5432('0x37')];return db['CmContact'][_0x5432('0x49')](_0x599dd7);}else{throw new Error(_0x5432('0x4a'));}})[_0x5432('0x14')](function(_0x247a71){_0x5488ff['contact']=_0x247a71;if(_0x247a71){if(!_0x985bc6['body'][_0x5432('0x19')][_0x5432('0x4b')]){_0x985bc6['body'][_0x5432('0x19')][_0x5432('0x4b')]=rs[_0x5432('0x4c')]()+'\x20'+_0x985bc6[_0x5432('0x2a')][_0x5432('0x19')][_0x5432('0x37')];}var _0x517d96={'ContactId':_0x247a71['id'],'MailAccountId':_0x985bc6[_0x5432('0x39')]['id'],'inReplyTo':_0x985bc6[_0x5432('0x2a')][_0x5432('0x19')][_0x5432('0x4b')],'to':_0x985bc6[_0x5432('0x2a')][_0x5432('0x19')][_0x5432('0x37')],'cc':_0x985bc6['body'][_0x5432('0x19')]['cc'],'subject':_0x985bc6[_0x5432('0x2a')][_0x5432('0x19')][_0x5432('0x4d')],'attach':_0x985bc6[_0x5432('0x2a')][_0x5432('0x19')][_0x5432('0x4e')],'lastMsgAt':moment()[_0x5432('0x4f')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x5432('0x50')][_0x5432('0x38')]({'where':{'closed':![],'MailAccountId':_0x985bc6['account']['id']},'include':[{'model':db[_0x5432('0x51')],'as':_0x5432('0x52'),'attributes':[_0x5432('0x4b')],'where':{'messageId':_0x985bc6['body']['message'][_0x5432('0x53')]}}]})[_0x5432('0x14')](function(_0x571559){if(_0x571559){return[_0x571559,![]];}return db[_0x5432('0x50')][_0x5432('0x49')](_0x517d96)['then'](function(_0x44b461){return[_0x44b461,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x5432('0x54')](function(_0x1fef98,_0x2e6e31){if(_0x1fef98){_0x1c5112=_0x2e6e31;if(!_0x2e6e31){return _0x1fef98[_0x5432('0x55')]({'inReplyTo':_0x985bc6[_0x5432('0x2a')][_0x5432('0x19')]['messageId'],'to':_0x985bc6[_0x5432('0x2a')][_0x5432('0x19')][_0x5432('0x37')],'cc':_0x985bc6[_0x5432('0x2a')][_0x5432('0x19')]['cc'],'subject':_0x985bc6['body']['message'][_0x5432('0x4d')],'attach':_0x1fef98[_0x5432('0x4e')]?_0x1fef98[_0x5432('0x4e')]:_0x985bc6['body'][_0x5432('0x19')][_0x5432('0x4e')],'substatus':null,'substatusAt':moment()[_0x5432('0x4f')](_0x5432('0x56')),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x1fef98;}}})[_0x5432('0x14')](function(_0x4f8482){_0x5488ff[_0x5432('0x57')]=_0x4f8482[_0x5432('0x3d')]({'plain':!![]});_0x5488ff[_0x5432('0x57')][_0x5432('0x58')]=_0x1c5112;return db[_0x5432('0x51')][_0x5432('0x49')]({'body':_0x985bc6['body'][_0x5432('0x2a')],'MailAccountId':_0x985bc6[_0x5432('0x39')]['id'],'MailInteractionId':_0x4f8482['id'],'direction':'in','ContactId':_0x5488ff[_0x5432('0x59')]['id'],'messageId':_0x985bc6[_0x5432('0x2a')][_0x5432('0x19')][_0x5432('0x4b')],'from':_0x985bc6[_0x5432('0x2a')][_0x5432('0x19')][_0x5432('0x37')],'to':_0x985bc6[_0x5432('0x2a')][_0x5432('0x19')]['to'],'cc':_0x985bc6[_0x5432('0x2a')]['message']['cc'],'subject':_0x985bc6[_0x5432('0x2a')][_0x5432('0x19')]['subject'],'attach':_0x985bc6[_0x5432('0x2a')][_0x5432('0x19')]['attach'],'Attachments':_0x985bc6[_0x5432('0x2a')][_0x5432('0x19')][_0x5432('0x5a')],'originTo':_0x985bc6[_0x5432('0x2a')][_0x5432('0x19')][_0x5432('0x5b')],'originCc':_0x985bc6[_0x5432('0x2a')][_0x5432('0x19')][_0x5432('0x5c')],'bcc':_0x985bc6['body'][_0x5432('0x19')][_0x5432('0x5d')],'ChatWebsiteId':_0x985bc6['body']['message'][_0x5432('0x5e')]||null,'originChannel':_0x985bc6[_0x5432('0x2a')][_0x5432('0x19')][_0x5432('0x5f')]||_0x5432('0x60'),'ChatOfflineMessageId':_0x985bc6[_0x5432('0x2a')][_0x5432('0x19')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x5432('0x61')],'as':_0x5432('0x62')}]});})[_0x5432('0x14')](function(_0x51339c){_0x5488ff['message']=_0x51339c;if(_0x5488ff[_0x5432('0x57')]['UserId']){return db[_0x5432('0x63')][_0x5432('0x38')]({'attributes':['id',_0x5432('0x64')],'where':{'id':_0x5488ff['interaction']['UserId']}})[_0x5432('0x14')](function(_0x575b42){if(_0x575b42){_0x5488ff[_0x5432('0x40')]['unshift']({'id':0x0,'priority':0x0,'app':_0x5432('0x65'),'appdata':_0x575b42[_0x5432('0x64')]+','+(_0x5488ff[_0x5432('0x39')][_0x5432('0x66')]||0xa),'interval':_0x5432('0x47')});}return respondWithRpcPromise(_0x5432('0x67'),_0x5432('0x68'),_0x5488ff);});}return respondWithRpcPromise('Start',_0x5432('0x68'),_0x5488ff);})[_0x5432('0x14')](function(_0x163ece){_0x5d4da0(_0x163ece);})[_0x5432('0x1b')](function(_0x58db3f){_0x2f57c9(_0x11ad09[_0x5432('0x18')](0x1f4,_0x58db3f[_0x5432('0x19')]));});});}; \ No newline at end of file +var _0x1383=['limit','include','map','model','then','info','catch','ShowMailAccount','find','NotifyMailAccount','body','mail','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','DESC','Applications','get','applications','list','orderBy','priority','autoclose','length','*,*,*,*','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Contact\x20not\x20found','spread','interaction','created','MailMessage','attachments','originTo','bcc','Email','ChatOfflineMessageId','Attachment','Attachments','User','name','agent','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','request','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','GetMailAccount','MailAccount','findAll','options','raw','where','attributes'];(function(_0x2207ea,_0x16690b){var _0x2d04a6=function(_0x564d6c){while(--_0x564d6c){_0x2207ea['push'](_0x2207ea['shift']());}};_0x2d04a6(++_0x16690b);}(_0x1383,0x1c7));var _0x3138=function(_0xc7f601,_0x2f5ed5){_0xc7f601=_0xc7f601-0x0;var _0x57f083=_0x1383[_0xc7f601];return _0x57f083;};'use strict';var _=require(_0x3138('0x0'));var util=require('util');var moment=require(_0x3138('0x1'));var BPromise=require(_0x3138('0x2'));var rs=require(_0x3138('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3138('0x4'))['db'];var utils=require(_0x3138('0x5'));var logger=require(_0x3138('0x6'))(_0x3138('0x7'));var config=require(_0x3138('0x8'));var jayson=require(_0x3138('0x9'));var client=jayson['client'][_0x3138('0xa')]({'port':0x232c});config[_0x3138('0xb')]=_[_0x3138('0xc')](config[_0x3138('0xb')],{'host':_0x3138('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3138('0xb')]));require('./mailAccount.socket')['register'](socket);function respondWithRpcPromise(_0x3833b4,_0x541c94,_0x260fae){return new BPromise(function(_0x265eed,_0x5a3772){return client[_0x3138('0xe')](_0x3833b4,_0x260fae)['then'](function(_0x201b44){logger['info'](_0x3138('0xf'),_0x541c94,'request\x20sent');logger[_0x3138('0x10')](_0x3138('0x11'),_0x541c94,_0x3138('0x12'),JSON[_0x3138('0x13')](_0x201b44));if(_0x201b44['error']){if(_0x201b44[_0x3138('0x14')]['code']===0x1f4){logger[_0x3138('0x14')](_0x3138('0xf'),_0x541c94,_0x201b44[_0x3138('0x14')][_0x3138('0x15')]);return _0x5a3772(_0x201b44[_0x3138('0x14')]['message']);}logger[_0x3138('0x14')](_0x3138('0xf'),_0x541c94,_0x201b44['error'][_0x3138('0x15')]);return _0x265eed(_0x201b44[_0x3138('0x14')]['message']);}else{logger['info'](_0x3138('0xf'),_0x541c94,_0x3138('0x12'));_0x265eed(_0x201b44[_0x3138('0x16')]['message']);}})['catch'](function(_0x3a2014){logger[_0x3138('0x14')](_0x3138('0xf'),_0x541c94,_0x3a2014);_0x5a3772(_0x3a2014);});});}exports[_0x3138('0x17')]=function(_0x3305e6){var _0x4f78bb=this;return new Promise(function(_0x47c7f4,_0x5db22b){return db[_0x3138('0x18')][_0x3138('0x19')]({'raw':_0x3305e6[_0x3138('0x1a')]?_0x3305e6[_0x3138('0x1a')][_0x3138('0x1b')]===undefined?!![]:![]:!![],'where':_0x3305e6[_0x3138('0x1a')]?_0x3305e6[_0x3138('0x1a')][_0x3138('0x1c')]||null:null,'attributes':_0x3305e6['options']?_0x3305e6['options'][_0x3138('0x1d')]||null:null,'limit':_0x3305e6[_0x3138('0x1a')]?_0x3305e6['options'][_0x3138('0x1e')]||null:null,'include':_0x3305e6[_0x3138('0x1a')]?_0x3305e6[_0x3138('0x1a')][_0x3138('0x1f')]?_[_0x3138('0x20')](_0x3305e6[_0x3138('0x1a')][_0x3138('0x1f')],function(_0x2e1439){return{'model':db[_0x2e1439[_0x3138('0x21')]],'as':_0x2e1439['as'],'attributes':_0x2e1439[_0x3138('0x1d')],'include':_0x2e1439[_0x3138('0x1f')]?_['map'](_0x2e1439['include'],function(_0x589e1c){return{'model':db[_0x589e1c[_0x3138('0x21')]],'as':_0x589e1c['as'],'attributes':_0x589e1c[_0x3138('0x1d')],'include':_0x589e1c['include']?_['map'](_0x589e1c[_0x3138('0x1f')],function(_0x93be56){return{'model':db[_0x93be56['model']],'as':_0x93be56['as'],'attributes':_0x93be56[_0x3138('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3138('0x22')](function(_0x2931f0){logger[_0x3138('0x23')](_0x3138('0x17'),_0x3305e6);logger[_0x3138('0x10')](_0x3138('0x17'),_0x3305e6,JSON[_0x3138('0x13')](_0x2931f0));_0x47c7f4(_0x2931f0);})[_0x3138('0x24')](function(_0x1939a5){logger[_0x3138('0x14')]('GetMailAccount',_0x1939a5[_0x3138('0x15')],_0x3305e6);_0x5db22b(_0x4f78bb[_0x3138('0x14')](0x1f4,_0x1939a5[_0x3138('0x15')]));});});};exports[_0x3138('0x25')]=function(_0x53ecee){var _0x1f848f=this;return new Promise(function(_0x3d90f6,_0x513aea){return db[_0x3138('0x18')][_0x3138('0x26')]({'raw':_0x53ecee[_0x3138('0x1a')]?_0x53ecee[_0x3138('0x1a')][_0x3138('0x1b')]===undefined?!![]:![]:!![],'where':_0x53ecee[_0x3138('0x1a')]?_0x53ecee['options'][_0x3138('0x1c')]||null:null,'attributes':_0x53ecee[_0x3138('0x1a')]?_0x53ecee['options']['attributes']||null:null,'include':_0x53ecee[_0x3138('0x1a')]?_0x53ecee[_0x3138('0x1a')][_0x3138('0x1f')]?_[_0x3138('0x20')](_0x53ecee['options'][_0x3138('0x1f')],function(_0x516428){return{'model':db[_0x516428[_0x3138('0x21')]],'as':_0x516428['as'],'attributes':_0x516428['attributes'],'include':_0x516428['include']?_[_0x3138('0x20')](_0x516428[_0x3138('0x1f')],function(_0x816cdf){return{'model':db[_0x816cdf[_0x3138('0x21')]],'as':_0x816cdf['as'],'attributes':_0x816cdf[_0x3138('0x1d')],'include':_0x816cdf[_0x3138('0x1f')]?_[_0x3138('0x20')](_0x816cdf[_0x3138('0x1f')],function(_0x2ce697){return{'model':db[_0x2ce697[_0x3138('0x21')]],'as':_0x2ce697['as'],'attributes':_0x2ce697[_0x3138('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3138('0x22')](function(_0x1875cd){logger[_0x3138('0x23')](_0x3138('0x25'),_0x53ecee);logger[_0x3138('0x10')](_0x3138('0x25'),_0x53ecee,JSON['stringify'](_0x1875cd));_0x3d90f6(_0x1875cd);})[_0x3138('0x24')](function(_0x341d4b){logger['error']('ShowMailAccount',_0x341d4b['message'],_0x53ecee);_0x513aea(_0x1f848f['error'](0x1f4,_0x341d4b[_0x3138('0x15')]));});});};exports[_0x3138('0x27')]=function(_0xa8bef5){var _0x35cf35=this;return new Promise(function(_0x322f37,_0x14b232){var _0x4734c1={'body':_0xa8bef5[_0x3138('0x28')],'channel':_0x3138('0x29')};var _0x29e442=_['difference'](_['keys'](db[_0x3138('0x2a')][_0x3138('0x2b')]),[_0x3138('0x2c'),_0x3138('0x2d'),_0x3138('0x2e'),_0x3138('0x2f')]);var _0x1e45fc=![];if(_0xa8bef5[_0x3138('0x28')]['id']){delete _0xa8bef5[_0x3138('0x28')]['id'];}if(_[_0x3138('0x30')](_0xa8bef5[_0x3138('0x28')][_0x3138('0x31')])){return _0x14b232(_0x35cf35['error'](0x1f4,_0x3138('0x32')));}if(_[_0x3138('0x30')](_0xa8bef5[_0x3138('0x28')][_0x3138('0x28')])||_0xa8bef5[_0x3138('0x28')][_0x3138('0x28')]===''){return _0x14b232(_0x35cf35[_0x3138('0x14')](0x1f4,_0x3138('0x33')));}if(_[_0x3138('0x30')](_0xa8bef5[_0x3138('0x28')][_0x3138('0x34')])){return _0x14b232(_0x35cf35[_0x3138('0x14')](0x1f4,_0x3138('0x35')+_0x29e442));}if(!_['includes'](_0x29e442,_0xa8bef5[_0x3138('0x28')][_0x3138('0x34')])){return _0x14b232(_0x35cf35[_0x3138('0x14')](0x1f4,_0x3138('0x36')+_0x29e442));}var _0x25b4d3={};_0x25b4d3[_0xa8bef5[_0x3138('0x28')][_0x3138('0x34')]]=_0xa8bef5[_0x3138('0x28')][_0x3138('0x31')];return db[_0x3138('0x18')]['find']({'where':{'id':_0xa8bef5[_0x3138('0x37')]['id']},'include':[{'model':db[_0x3138('0x38')],'as':_0x3138('0x39'),'include':[{'model':db[_0x3138('0x2a')],'as':_0x3138('0x3a'),'where':_0x25b4d3,'limit':0x1,'order':[['updatedAt',_0x3138('0x3b')]]}]},{'model':db['MailApplication'],'as':_0x3138('0x3c')},{'model':db['MailServerOut'],'as':'Smtp'}]})[_0x3138('0x22')](function(_0x99cbe){if(_0x99cbe&&_0x99cbe['List']){var _0xf4ab5e=_0x99cbe[_0x3138('0x3d')]({'plain':!![]});_0x4734c1[_0x3138('0x37')]=_['omit'](_0xf4ab5e,[_0x3138('0x3c'),_0x3138('0x39')]);_0x4734c1[_0x3138('0x3e')]=_0xf4ab5e['Applications'];_0x4734c1[_0x3138('0x3f')]=_0xf4ab5e[_0x3138('0x39')];_0x4734c1[_0x3138('0x3e')]=_[_0x3138('0x40')](_0x4734c1[_0x3138('0x3e')],[_0x3138('0x41')],['asc']);if(_0x4734c1[_0x3138('0x37')]&&_0x4734c1['account'][_0x3138('0x42')]){_0x4734c1['applications']['push']({'id':0x0,'priority':_0x4734c1[_0x3138('0x3e')][_0x3138('0x43')]+0x1,'app':'close','appdata':'autoclose','interval':_0x3138('0x44')});}if(_0x4734c1['account']['Applications']){delete _0x4734c1[_0x3138('0x37')][_0x3138('0x3c')];}if(_0x4734c1[_0x3138('0x37')]['List']){delete _0x4734c1['account'][_0x3138('0x39')];}if(_0xf4ab5e[_0x3138('0x39')][_0x3138('0x3a')]['length']){return _0xf4ab5e['List'][_0x3138('0x3a')][0x0];}var _0x3c8c39=_[_0x3138('0xc')](_0xa8bef5[_0x3138('0x28')],{'firstName':_0xa8bef5[_0x3138('0x28')][_0x3138('0x31')],'ListId':_0xf4ab5e[_0x3138('0x2f')]});_0x3c8c39[_0xa8bef5[_0x3138('0x28')][_0x3138('0x34')]]=_0xa8bef5[_0x3138('0x28')][_0x3138('0x31')];return db['CmContact'][_0x3138('0x45')](_0x3c8c39);}else{throw new Error(_0x3138('0x46'));}})[_0x3138('0x22')](function(_0x4d750d){_0x4734c1[_0x3138('0x47')]=_0x4d750d;if(_0x4d750d){if(!_0xa8bef5[_0x3138('0x28')][_0x3138('0x15')]['messageId']){_0xa8bef5[_0x3138('0x28')][_0x3138('0x15')][_0x3138('0x48')]=rs[_0x3138('0x49')]()+'\x20'+_0xa8bef5[_0x3138('0x28')]['message'][_0x3138('0x31')];}var _0x5e58e8={'ContactId':_0x4d750d['id'],'MailAccountId':_0xa8bef5[_0x3138('0x37')]['id'],'inReplyTo':_0xa8bef5['body'][_0x3138('0x15')][_0x3138('0x48')],'to':_0xa8bef5[_0x3138('0x28')]['message'][_0x3138('0x31')],'cc':_0xa8bef5['body'][_0x3138('0x15')]['cc'],'subject':_0xa8bef5[_0x3138('0x28')][_0x3138('0x15')][_0x3138('0x4a')],'attach':_0xa8bef5[_0x3138('0x28')]['message'][_0x3138('0x4b')],'lastMsgAt':moment()[_0x3138('0x4c')](_0x3138('0x4d')),'lastMsgDirection':'in'};return db['MailInteraction']['find']({'where':{'closed':![],'MailAccountId':_0xa8bef5['account']['id']},'include':[{'model':db['MailMessage'],'as':'Messages','attributes':[_0x3138('0x48')],'where':{'messageId':_0xa8bef5[_0x3138('0x28')][_0x3138('0x15')]['inReplyTo']}}]})[_0x3138('0x22')](function(_0x104e6c){if(_0x104e6c){return[_0x104e6c,![]];}return db[_0x3138('0x4e')][_0x3138('0x45')](_0x5e58e8)[_0x3138('0x22')](function(_0x2974fb){return[_0x2974fb,!![]];});});}else{throw new Error(_0x3138('0x4f'));}})[_0x3138('0x50')](function(_0x5b0516,_0x301328){if(_0x5b0516){_0x1e45fc=_0x301328;if(!_0x301328){return _0x5b0516['update']({'inReplyTo':_0xa8bef5['body'][_0x3138('0x15')][_0x3138('0x48')],'to':_0xa8bef5[_0x3138('0x28')][_0x3138('0x15')][_0x3138('0x31')],'cc':_0xa8bef5['body'][_0x3138('0x15')]['cc'],'subject':_0xa8bef5[_0x3138('0x28')]['message'][_0x3138('0x4a')],'attach':_0x5b0516[_0x3138('0x4b')]?_0x5b0516['attach']:_0xa8bef5['body'][_0x3138('0x15')][_0x3138('0x4b')],'substatus':null,'substatusAt':moment()[_0x3138('0x4c')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x3138('0x4c')](_0x3138('0x4d')),'lastMsgDirection':'in'});}else{return _0x5b0516;}}})['then'](function(_0x3a00f1){_0x4734c1[_0x3138('0x51')]=_0x3a00f1['get']({'plain':!![]});_0x4734c1['interaction'][_0x3138('0x52')]=_0x1e45fc;return db[_0x3138('0x53')]['create']({'body':_0xa8bef5['body'][_0x3138('0x28')],'MailAccountId':_0xa8bef5[_0x3138('0x37')]['id'],'MailInteractionId':_0x3a00f1['id'],'direction':'in','ContactId':_0x4734c1[_0x3138('0x47')]['id'],'messageId':_0xa8bef5[_0x3138('0x28')][_0x3138('0x15')][_0x3138('0x48')],'from':_0xa8bef5[_0x3138('0x28')]['message'][_0x3138('0x31')],'to':_0xa8bef5['body'][_0x3138('0x15')]['to'],'cc':_0xa8bef5[_0x3138('0x28')][_0x3138('0x15')]['cc'],'subject':_0xa8bef5[_0x3138('0x28')]['message']['subject'],'attach':_0xa8bef5[_0x3138('0x28')]['message']['attach'],'Attachments':_0xa8bef5[_0x3138('0x28')]['message'][_0x3138('0x54')],'originTo':_0xa8bef5[_0x3138('0x28')][_0x3138('0x15')][_0x3138('0x55')],'originCc':_0xa8bef5[_0x3138('0x28')][_0x3138('0x15')]['originCc'],'bcc':_0xa8bef5[_0x3138('0x28')][_0x3138('0x15')][_0x3138('0x56')],'ChatWebsiteId':_0xa8bef5['body'][_0x3138('0x15')]['ChatWebsiteId']||null,'originChannel':_0xa8bef5[_0x3138('0x28')][_0x3138('0x15')]['originChannel']||_0x3138('0x57'),'ChatOfflineMessageId':_0xa8bef5['body'][_0x3138('0x15')][_0x3138('0x58')]||null},{'include':[{'model':db[_0x3138('0x59')],'as':_0x3138('0x5a')}]});})[_0x3138('0x22')](function(_0x3ce2c4){_0x4734c1[_0x3138('0x15')]=_0x3ce2c4;if(_0x4734c1[_0x3138('0x51')]['UserId']){return db[_0x3138('0x5b')][_0x3138('0x26')]({'attributes':['id',_0x3138('0x5c')],'where':{'id':_0x4734c1[_0x3138('0x51')]['UserId']}})[_0x3138('0x22')](function(_0x4e0cba){if(_0x4e0cba){_0x4734c1[_0x3138('0x3e')]['unshift']({'id':0x0,'priority':0x0,'app':_0x3138('0x5d'),'appdata':_0x4e0cba[_0x3138('0x5c')]+','+(_0x4734c1['account'][_0x3138('0x5e')]||0xa),'interval':_0x3138('0x44')});}return respondWithRpcPromise(_0x3138('0x5f'),_0x3138('0x60'),_0x4734c1);});}return respondWithRpcPromise(_0x3138('0x5f'),_0x3138('0x60'),_0x4734c1);})[_0x3138('0x22')](function(_0x10c70f){_0x322f37(_0x10c70f);})[_0x3138('0x24')](function(_0x2feea6){_0x14b232(_0x35cf35[_0x3138('0x14')](0x1f4,_0x2feea6[_0x3138('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index ba3c6ff..79d65ff 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 _0xc473=['length','mailAccount:','save','remove','register'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0xc473,0x174));var _0x3c47=function(_0x1280d3,_0x15c38e){_0x1280d3=_0x1280d3-0x0;var _0x404e42=_0xc473[_0x1280d3];return _0x404e42;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x3c47('0x0'),_0x3c47('0x1'),'update'];function createListener(_0x41993e,_0x18959e){return function(_0x396fbb){_0x18959e['emit'](_0x41993e,_0x396fbb);};}function removeListener(_0x406b74,_0x2d19b9){return function(){MailAccountEvents['removeListener'](_0x406b74,_0x2d19b9);};}exports[_0x3c47('0x2')]=function(_0x307a82){for(var _0x3a3fb0=0x0,_0x249b37=events[_0x3c47('0x3')];_0x3a3fb0<_0x249b37;_0x3a3fb0++){var _0x3438e3=events[_0x3a3fb0];var _0x105c97=createListener(_0x3c47('0x4')+_0x3438e3,_0x307a82);MailAccountEvents['on'](_0x3438e3,_0x105c97);}}; \ No newline at end of file +var _0xb5b0=['update','emit','removeListener','register','length','mailAccount:','./mailAccount.events','save'];(function(_0x2d12ff,_0x33a77e){var _0x4e8399=function(_0x4b755c){while(--_0x4b755c){_0x2d12ff['push'](_0x2d12ff['shift']());}};_0x4e8399(++_0x33a77e);}(_0xb5b0,0x17e));var _0x0b5b=function(_0x23cb3b,_0x5126d9){_0x23cb3b=_0x23cb3b-0x0;var _0x1ef8e8=_0xb5b0[_0x23cb3b];return _0x1ef8e8;};'use strict';var MailAccountEvents=require(_0x0b5b('0x0'));var events=[_0x0b5b('0x1'),'remove',_0x0b5b('0x2')];function createListener(_0x29551a,_0x3e2fcf){return function(_0x255697){_0x3e2fcf[_0x0b5b('0x3')](_0x29551a,_0x255697);};}function removeListener(_0x188f2e,_0x371e64){return function(){MailAccountEvents[_0x0b5b('0x4')](_0x188f2e,_0x371e64);};}exports[_0x0b5b('0x5')]=function(_0x5edaa0){for(var _0x2680cf=0x0,_0xec7429=events[_0x0b5b('0x6')];_0x2680cf<_0xec7429;_0x2680cf++){var _0x3d81bc=events[_0x2680cf];var _0x1e64a3=createListener(_0x0b5b('0x7')+_0x3d81bc,_0x5edaa0);MailAccountEvents['on'](_0x3d81bc,_0x1e64a3);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 7c4fa02..2201099 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 _0xef88=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x14de9e,_0x42e37f){var _0x58337c=function(_0x49ad86){while(--_0x49ad86){_0x14de9e['push'](_0x14de9e['shift']());}};_0x58337c(++_0x42e37f);}(_0xef88,0x1ac));var _0x8ef8=function(_0x138345,_0x3e18b3){_0x138345=_0x138345-0x0;var _0x370d1f=_0xef88[_0x138345];return _0x370d1f;};'use strict';var multer=require(_0x8ef8('0x0'));var util=require(_0x8ef8('0x1'));var path=require(_0x8ef8('0x2'));var timeout=require('connect-timeout');var express=require(_0x8ef8('0x3'));var router=express[_0x8ef8('0x4')]();var fs_extra=require(_0x8ef8('0x5'));var auth=require(_0x8ef8('0x6'));var interaction=require(_0x8ef8('0x7'));var config=require(_0x8ef8('0x8'));var controller=require('./mailApplication.controller');router[_0x8ef8('0x9')](_0x8ef8('0xa'),auth[_0x8ef8('0xb')](),controller[_0x8ef8('0xc')]);router[_0x8ef8('0xd')](_0x8ef8('0xa'),auth[_0x8ef8('0xb')](),controller[_0x8ef8('0xe')]);router[_0x8ef8('0xf')](_0x8ef8('0xa'),auth[_0x8ef8('0xb')](),controller[_0x8ef8('0x10')]);module[_0x8ef8('0x11')]=router; \ No newline at end of file +var _0x4d93=['connect-timeout','express','Router','../../config/environment','./mailApplication.controller','get','/:id','show','update','isAuthenticated','multer','util','path'];(function(_0x6b2c74,_0x54896f){var _0x3db323=function(_0x1ebd74){while(--_0x1ebd74){_0x6b2c74['push'](_0x6b2c74['shift']());}};_0x3db323(++_0x54896f);}(_0x4d93,0x15c));var _0x34d9=function(_0x2a44e6,_0x32d142){_0x2a44e6=_0x2a44e6-0x0;var _0xf9323f=_0x4d93[_0x2a44e6];return _0xf9323f;};'use strict';var multer=require(_0x34d9('0x0'));var util=require(_0x34d9('0x1'));var path=require(_0x34d9('0x2'));var timeout=require(_0x34d9('0x3'));var express=require(_0x34d9('0x4'));var router=express[_0x34d9('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x34d9('0x6'));var controller=require(_0x34d9('0x7'));router[_0x34d9('0x8')](_0x34d9('0x9'),auth['isAuthenticated'](),controller[_0x34d9('0xa')]);router['put'](_0x34d9('0x9'),auth['isAuthenticated'](),controller[_0x34d9('0xb')]);router['delete'](_0x34d9('0x9'),auth[_0x34d9('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 40c90b3..95d6a53 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 _0x72c2=['TEXT','*,*,*,*','exports','STRING'];(function(_0x3b1a49,_0x57a433){var _0x243b46=function(_0x23870c){while(--_0x23870c){_0x3b1a49['push'](_0x3b1a49['shift']());}};_0x243b46(++_0x57a433);}(_0x72c2,0x132));var _0x272c=function(_0x2106bd,_0xc7dd18){_0x2106bd=_0x2106bd-0x0;var _0x14cc4a=_0x72c2[_0x2106bd];return _0x14cc4a;};'use strict';var Sequelize=require('sequelize');module[_0x272c('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x272c('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x272c('0x2')]()},'description':{'type':Sequelize[_0x272c('0x1')]},'interval':{'type':Sequelize[_0x272c('0x1')],'defaultValue':_0x272c('0x3')}}; \ No newline at end of file +var _0x5ef9=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x18d631,_0x4376d2){var _0x50d708=function(_0x3b6ab5){while(--_0x3b6ab5){_0x18d631['push'](_0x18d631['shift']());}};_0x50d708(++_0x4376d2);}(_0x5ef9,0x12c));var _0x95ef=function(_0x3b5ad9,_0x223867){_0x3b5ad9=_0x3b5ad9-0x0;var _0x611ae9=_0x5ef9[_0x3b5ad9];return _0x611ae9;};'use strict';var Sequelize=require('sequelize');module[_0x95ef('0x0')]={'priority':{'type':Sequelize[_0x95ef('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x95ef('0x2')],'allowNull':![],'defaultValue':_0x95ef('0x3')},'appdata':{'type':Sequelize[_0x95ef('0x4')]()},'description':{'type':Sequelize[_0x95ef('0x2')]},'interval':{'type':Sequelize[_0x95ef('0x2')],'defaultValue':_0x95ef('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 37b8811..765ee6c 100644 --- a/server/api/mailApplication/mailApplication.controller.js +++ b/server/api/mailApplication/mailApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['catch','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','show','params','MailApplication','rawAttributes','query','keys','filters','intersection','model','fields','attributes','length','includeAll','include','merge','options','find','body'];(function(_0x53a0bb,_0x387539){var _0x41c07a=function(_0x438738){while(--_0x438738){_0x53a0bb['push'](_0x53a0bb['shift']());}};_0x41c07a(++_0x387539);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3071('0x0'));var jsonpatch=require(_0x3071('0x1'));var rp=require(_0x3071('0x2'));var moment=require(_0x3071('0x3'));var BPromise=require(_0x3071('0x4'));var Mustache=require('mustache');var util=require(_0x3071('0x5'));var path=require(_0x3071('0x6'));var sox=require(_0x3071('0x7'));var csv=require(_0x3071('0x8'));var ejs=require(_0x3071('0x9'));var fs=require('fs');var fs_extra=require(_0x3071('0xa'));var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x8'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var licenseUtil=require(_0x3071('0x19'));var db=require(_0x3071('0x1a'))['db'];function respondWithStatusCode(_0x4a8cc7,_0x5330a8){_0x5330a8=_0x5330a8||0xcc;return function(_0x1826ca){if(_0x1826ca){return _0x4a8cc7['sendStatus'](_0x5330a8);}return _0x4a8cc7[_0x3071('0x1b')](_0x5330a8)[_0x3071('0x1c')]();};}function respondWithResult(_0x5d4883,_0x104e73){_0x104e73=_0x104e73||0xc8;return function(_0x4e1219){if(_0x4e1219){return _0x5d4883[_0x3071('0x1b')](_0x104e73)[_0x3071('0x1d')](_0x4e1219);}};}function respondWithFilteredResult(_0x1271d0,_0x1f14e1){return function(_0x1caa5d){if(_0x1caa5d){var _0x2a6a4b=typeof _0x1f14e1[_0x3071('0x1e')]===_0x3071('0x1f')&&typeof _0x1f14e1[_0x3071('0x20')]===_0x3071('0x1f');var _0x5f3c22=_0x1caa5d[_0x3071('0x21')];var _0x17dbda=_0x2a6a4b?0x0:_0x1f14e1[_0x3071('0x1e')];var _0x108a83=_0x2a6a4b?_0x1caa5d[_0x3071('0x21')]:_0x1f14e1[_0x3071('0x1e')]+_0x1f14e1[_0x3071('0x20')];var _0x26f113;if(_0x108a83>=_0x5f3c22){_0x108a83=_0x5f3c22;_0x26f113=0xc8;}else{_0x26f113=0xce;}_0x1271d0['status'](_0x26f113);return _0x1271d0[_0x3071('0x22')](_0x3071('0x23'),_0x17dbda+'-'+_0x108a83+'/'+_0x5f3c22)[_0x3071('0x1d')](_0x1caa5d);}return null;};}function patchUpdates(_0x56c267){return function(_0xb8f4e3){try{jsonpatch['apply'](_0xb8f4e3,_0x56c267,!![]);}catch(_0x833074){return BPromise[_0x3071('0x24')](_0x833074);}return _0xb8f4e3[_0x3071('0x25')]();};}function saveUpdates(_0x457b57,_0x33090c){return function(_0x34c50e){if(_0x34c50e){return _0x34c50e[_0x3071('0x26')](_0x457b57)[_0x3071('0x27')](function(_0x542646){return _0x542646;});}return null;};}function removeEntity(_0x481a51,_0x2ce48a){return function(_0xb05b1d){if(_0xb05b1d){return _0xb05b1d[_0x3071('0x28')]()[_0x3071('0x27')](function(){_0x481a51[_0x3071('0x1b')](0xcc)[_0x3071('0x1c')]();});}};}function handleEntityNotFound(_0x7a4cb4,_0x1fe727){return function(_0x1de5fb){if(!_0x1de5fb){_0x7a4cb4['sendStatus'](0x194);}return _0x1de5fb;};}function handleError(_0x2e5f93,_0x3f1e6e){_0x3f1e6e=_0x3f1e6e||0x1f4;return function(_0x177138){logger['error'](_0x177138[_0x3071('0x29')]);if(_0x177138[_0x3071('0x2a')]){delete _0x177138[_0x3071('0x2a')];}_0x2e5f93[_0x3071('0x1b')](_0x3f1e6e)[_0x3071('0x2b')](_0x177138);};}exports[_0x3071('0x2c')]=function(_0x177b5f,_0x3921a1){var _0x32f1b4={'raw':!![],'where':{'id':_0x177b5f[_0x3071('0x2d')]['id']}},_0x292205={};_0x292205['model']=_['keys'](db[_0x3071('0x2e')][_0x3071('0x2f')]);_0x292205[_0x3071('0x30')]=_[_0x3071('0x31')](_0x177b5f[_0x3071('0x30')]);_0x292205[_0x3071('0x32')]=_[_0x3071('0x33')](_0x292205[_0x3071('0x34')],_0x292205['query']);_0x32f1b4['attributes']=_['intersection'](_0x292205[_0x3071('0x34')],qs[_0x3071('0x35')](_0x177b5f['query'][_0x3071('0x35')]));_0x32f1b4[_0x3071('0x36')]=_0x32f1b4[_0x3071('0x36')][_0x3071('0x37')]?_0x32f1b4['attributes']:_0x292205[_0x3071('0x34')];if(_0x177b5f[_0x3071('0x30')][_0x3071('0x38')]){_0x32f1b4[_0x3071('0x39')]=[{'all':!![]}];}_0x32f1b4=_[_0x3071('0x3a')]({},_0x32f1b4,_0x177b5f[_0x3071('0x3b')]);return db[_0x3071('0x2e')][_0x3071('0x3c')](_0x32f1b4)['then'](handleEntityNotFound(_0x3921a1,null))[_0x3071('0x27')](respondWithResult(_0x3921a1,null))['catch'](handleError(_0x3921a1,null));};exports['update']=function(_0x1a1a64,_0xa3a7ae){if(_0x1a1a64['body']['id']){delete _0x1a1a64[_0x3071('0x3d')]['id'];}return db[_0x3071('0x2e')][_0x3071('0x3c')]({'where':{'id':_0x1a1a64[_0x3071('0x2d')]['id']}})[_0x3071('0x27')](handleEntityNotFound(_0xa3a7ae,null))[_0x3071('0x27')](saveUpdates(_0x1a1a64['body'],null))[_0x3071('0x27')](respondWithResult(_0xa3a7ae,null))[_0x3071('0x3e')](handleError(_0xa3a7ae,null));};exports['destroy']=function(_0x44ad05,_0x5b1392){return db[_0x3071('0x2e')][_0x3071('0x3c')]({'where':{'id':_0x44ad05['params']['id']}})['then'](handleEntityNotFound(_0x5b1392,null))[_0x3071('0x27')](removeEntity(_0x5b1392,null))[_0x3071('0x3e')](handleError(_0x5b1392,null));}; \ No newline at end of file +var _0x70e0=['util','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','apply','save','update','then','error','stack','name','send','show','model','keys','MailApplication','query','filters','attributes','intersection','length','includeAll','include','find','catch','body','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache'];(function(_0x12c7c4,_0x445b21){var _0x30bbdb=function(_0x3b9a58){while(--_0x3b9a58){_0x12c7c4['push'](_0x12c7c4['shift']());}};_0x30bbdb(++_0x445b21);}(_0x70e0,0x17b));var _0x070e=function(_0x442c61,_0x1bf5f8){_0x442c61=_0x442c61-0x0;var _0x3a412b=_0x70e0[_0x442c61];return _0x3a412b;};'use strict';var emlformat=require(_0x070e('0x0'));var rimraf=require(_0x070e('0x1'));var zipdir=require(_0x070e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x070e('0x3'));var BPromise=require(_0x070e('0x4'));var Mustache=require(_0x070e('0x5'));var util=require(_0x070e('0x6'));var path=require('path');var sox=require(_0x070e('0x7'));var csv=require('to-csv');var ejs=require(_0x070e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0xc'));var querystring=require(_0x070e('0xd'));var Papa=require(_0x070e('0xe'));var Redis=require(_0x070e('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x070e('0x10'));var hardwareService=require(_0x070e('0x11'));var logger=require(_0x070e('0x12'))(_0x070e('0x13'));var utils=require(_0x070e('0x14'));var config=require(_0x070e('0x15'));var licenseUtil=require(_0x070e('0x16'));var db=require(_0x070e('0x17'))['db'];function respondWithStatusCode(_0x39d2b9,_0x5bf079){_0x5bf079=_0x5bf079||0xcc;return function(_0x2930b8){if(_0x2930b8){return _0x39d2b9['sendStatus'](_0x5bf079);}return _0x39d2b9['status'](_0x5bf079)[_0x070e('0x18')]();};}function respondWithResult(_0x56c7ba,_0x4a33d2){_0x4a33d2=_0x4a33d2||0xc8;return function(_0x5bae0f){if(_0x5bae0f){return _0x56c7ba[_0x070e('0x19')](_0x4a33d2)[_0x070e('0x1a')](_0x5bae0f);}};}function respondWithFilteredResult(_0x51d14d,_0x5d3a38){return function(_0x373d86){if(_0x373d86){var _0xeae1a5=typeof _0x5d3a38[_0x070e('0x1b')]===_0x070e('0x1c')&&typeof _0x5d3a38['limit']==='undefined';var _0x17e2e4=_0x373d86[_0x070e('0x1d')];var _0x38f6e6=_0xeae1a5?0x0:_0x5d3a38[_0x070e('0x1b')];var _0x364b3f=_0xeae1a5?_0x373d86['count']:_0x5d3a38[_0x070e('0x1b')]+_0x5d3a38[_0x070e('0x1e')];var _0x1ad3de;if(_0x364b3f>=_0x17e2e4){_0x364b3f=_0x17e2e4;_0x1ad3de=0xc8;}else{_0x1ad3de=0xce;}_0x51d14d[_0x070e('0x19')](_0x1ad3de);return _0x51d14d[_0x070e('0x1f')]('Content-Range',_0x38f6e6+'-'+_0x364b3f+'/'+_0x17e2e4)['json'](_0x373d86);}return null;};}function patchUpdates(_0x4e958f){return function(_0x9907cf){try{jsonpatch[_0x070e('0x20')](_0x9907cf,_0x4e958f,!![]);}catch(_0x20dc60){return BPromise['reject'](_0x20dc60);}return _0x9907cf[_0x070e('0x21')]();};}function saveUpdates(_0x5dc5d2,_0xf8dd5d){return function(_0x3f6985){if(_0x3f6985){return _0x3f6985[_0x070e('0x22')](_0x5dc5d2)[_0x070e('0x23')](function(_0x28a1c3){return _0x28a1c3;});}return null;};}function removeEntity(_0xa86797,_0xe405e){return function(_0x164cdf){if(_0x164cdf){return _0x164cdf['destroy']()[_0x070e('0x23')](function(){_0xa86797[_0x070e('0x19')](0xcc)[_0x070e('0x18')]();});}};}function handleEntityNotFound(_0x503f4d,_0xf17c56){return function(_0x5f3e9d){if(!_0x5f3e9d){_0x503f4d['sendStatus'](0x194);}return _0x5f3e9d;};}function handleError(_0x2ccbd7,_0x25f6e){_0x25f6e=_0x25f6e||0x1f4;return function(_0x41deb1){logger[_0x070e('0x24')](_0x41deb1[_0x070e('0x25')]);if(_0x41deb1['name']){delete _0x41deb1[_0x070e('0x26')];}_0x2ccbd7[_0x070e('0x19')](_0x25f6e)[_0x070e('0x27')](_0x41deb1);};}exports[_0x070e('0x28')]=function(_0x43dd96,_0x28d7f2){var _0x1a1892={'raw':!![],'where':{'id':_0x43dd96['params']['id']}},_0x26373b={};_0x26373b[_0x070e('0x29')]=_[_0x070e('0x2a')](db[_0x070e('0x2b')]['rawAttributes']);_0x26373b['query']=_[_0x070e('0x2a')](_0x43dd96[_0x070e('0x2c')]);_0x26373b[_0x070e('0x2d')]=_['intersection'](_0x26373b[_0x070e('0x29')],_0x26373b[_0x070e('0x2c')]);_0x1a1892[_0x070e('0x2e')]=_[_0x070e('0x2f')](_0x26373b['model'],qs['fields'](_0x43dd96['query']['fields']));_0x1a1892[_0x070e('0x2e')]=_0x1a1892['attributes'][_0x070e('0x30')]?_0x1a1892[_0x070e('0x2e')]:_0x26373b['model'];if(_0x43dd96['query'][_0x070e('0x31')]){_0x1a1892[_0x070e('0x32')]=[{'all':!![]}];}_0x1a1892=_['merge']({},_0x1a1892,_0x43dd96['options']);return db[_0x070e('0x2b')][_0x070e('0x33')](_0x1a1892)[_0x070e('0x23')](handleEntityNotFound(_0x28d7f2,null))[_0x070e('0x23')](respondWithResult(_0x28d7f2,null))[_0x070e('0x34')](handleError(_0x28d7f2,null));};exports['update']=function(_0x482cc2,_0x24d17d){if(_0x482cc2[_0x070e('0x35')]['id']){delete _0x482cc2[_0x070e('0x35')]['id'];}return db[_0x070e('0x2b')][_0x070e('0x33')]({'where':{'id':_0x482cc2['params']['id']}})[_0x070e('0x23')](handleEntityNotFound(_0x24d17d,null))[_0x070e('0x23')](saveUpdates(_0x482cc2['body'],null))[_0x070e('0x23')](respondWithResult(_0x24d17d,null))[_0x070e('0x34')](handleError(_0x24d17d,null));};exports['destroy']=function(_0x4d4ee8,_0x5ddbe9){return db[_0x070e('0x2b')][_0x070e('0x33')]({'where':{'id':_0x4d4ee8[_0x070e('0x36')]['id']}})[_0x070e('0x23')](handleEntityNotFound(_0x5ddbe9,null))[_0x070e('0x23')](removeEntity(_0x5ddbe9,null))['catch'](handleError(_0x5ddbe9,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index d20aa50..ef4839c 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 _0xdb58=['mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','MailApplication'];(function(_0x2fe290,_0x3302e7){var _0x106431=function(_0xc25c7b){while(--_0xc25c7b){_0x2fe290['push'](_0x2fe290['shift']());}};_0x106431(++_0x3302e7);}(_0xdb58,0x189));var _0x8db5=function(_0x4dfedf,_0x37db28){_0x4dfedf=_0x4dfedf-0x0;var _0xce1704=_0xdb58[_0x4dfedf];return _0xce1704;};'use strict';var _=require(_0x8db5('0x0'));var util=require(_0x8db5('0x1'));var logger=require(_0x8db5('0x2'))(_0x8db5('0x3'));var moment=require(_0x8db5('0x4'));var BPromise=require(_0x8db5('0x5'));var rp=require(_0x8db5('0x6'));var fs=require('fs');var path=require(_0x8db5('0x7'));var rimraf=require(_0x8db5('0x8'));var config=require('../../config/environment');var attributes=require('./mailApplication.attributes');module[_0x8db5('0x9')]=function(_0x1f73f6,_0x4dda3c){return _0x1f73f6[_0x8db5('0xa')](_0x8db5('0xb'),attributes,{'tableName':_0x8db5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8db5('0xd'),'collate':_0x8db5('0xe')});}; \ No newline at end of file +var _0x40f4=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x58f57f,_0x23028c){var _0x318b7f=function(_0x1f239b){while(--_0x1f239b){_0x58f57f['push'](_0x58f57f['shift']());}};_0x318b7f(++_0x23028c);}(_0x40f4,0x1b0));var _0x440f=function(_0x4b4d88,_0x4240de){_0x4b4d88=_0x4b4d88-0x0;var _0x47f369=_0x40f4[_0x4b4d88];return _0x47f369;};'use strict';var _=require(_0x440f('0x0'));var util=require(_0x440f('0x1'));var logger=require(_0x440f('0x2'))(_0x440f('0x3'));var moment=require(_0x440f('0x4'));var BPromise=require(_0x440f('0x5'));var rp=require(_0x440f('0x6'));var fs=require('fs');var path=require(_0x440f('0x7'));var rimraf=require(_0x440f('0x8'));var config=require(_0x440f('0x9'));var attributes=require(_0x440f('0xa'));module['exports']=function(_0x1ceb57,_0x5457b4){return _0x1ceb57[_0x440f('0xb')](_0x440f('0xc'),attributes,{'tableName':_0x440f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x440f('0xe'),'collate':_0x440f('0xf')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 8086df1..ac2ea5f 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 _0xe6a5=['then','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','MailApplication,\x20%s,\x20%s','message','info','result','UpdateMailApplication','MailApplication','update','body','options','raw','where','attributes','limit','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x9ff367,_0x582fa3){var _0x559936=function(_0x5c7b47){while(--_0x5c7b47){_0x9ff367['push'](_0x9ff367['shift']());}};_0x559936(++_0x582fa3);}(_0xe6a5,0x1c2));var _0x5e6a=function(_0x480288,_0x21abdc){_0x480288=_0x480288-0x0;var _0x355a3a=_0xe6a5[_0x480288];return _0x355a3a;};'use strict';var _=require(_0x5e6a('0x0'));var util=require(_0x5e6a('0x1'));var moment=require(_0x5e6a('0x2'));var BPromise=require(_0x5e6a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5e6a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5e6a('0x5'))(_0x5e6a('0x6'));var config=require(_0x5e6a('0x7'));var jayson=require(_0x5e6a('0x8'));var client=jayson[_0x5e6a('0x9')][_0x5e6a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2fe1b4,_0x10517e,_0x107a71){return new BPromise(function(_0x1748ae,_0x4fbea2){return client[_0x5e6a('0xb')](_0x2fe1b4,_0x107a71)[_0x5e6a('0xc')](function(_0x10538e){logger['info']('MailApplication,\x20%s,\x20%s',_0x10517e,_0x5e6a('0xd'));logger[_0x5e6a('0xe')](_0x5e6a('0xf'),_0x10517e,_0x5e6a('0xd'),JSON[_0x5e6a('0x10')](_0x10538e));if(_0x10538e[_0x5e6a('0x11')]){if(_0x10538e[_0x5e6a('0x11')][_0x5e6a('0x12')]===0x1f4){logger[_0x5e6a('0x11')](_0x5e6a('0x13'),_0x10517e,_0x10538e[_0x5e6a('0x11')][_0x5e6a('0x14')]);return _0x4fbea2(_0x10538e[_0x5e6a('0x11')][_0x5e6a('0x14')]);}logger[_0x5e6a('0x11')](_0x5e6a('0x13'),_0x10517e,_0x10538e['error'][_0x5e6a('0x14')]);return _0x1748ae(_0x10538e['error']['message']);}else{logger[_0x5e6a('0x15')](_0x5e6a('0x13'),_0x10517e,_0x5e6a('0xd'));_0x1748ae(_0x10538e[_0x5e6a('0x16')][_0x5e6a('0x14')]);}})['catch'](function(_0x56df6a){logger[_0x5e6a('0x11')](_0x5e6a('0x13'),_0x10517e,_0x56df6a);_0x4fbea2(_0x56df6a);});});}exports[_0x5e6a('0x17')]=function(_0x597245){var _0x504c85=this;return new Promise(function(_0xf0c25b,_0x5d129d){return db[_0x5e6a('0x18')][_0x5e6a('0x19')](_0x597245[_0x5e6a('0x1a')],{'raw':_0x597245[_0x5e6a('0x1b')]?_0x597245[_0x5e6a('0x1b')][_0x5e6a('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x597245[_0x5e6a('0x1b')]?_0x597245['options'][_0x5e6a('0x1d')]||null:null,'attributes':_0x597245[_0x5e6a('0x1b')]?_0x597245[_0x5e6a('0x1b')][_0x5e6a('0x1e')]||null:null,'limit':_0x597245[_0x5e6a('0x1b')]?_0x597245['options'][_0x5e6a('0x1f')]||null:null})['then'](function(_0x121778){logger[_0x5e6a('0x15')](_0x5e6a('0x17'),_0x597245);logger[_0x5e6a('0xe')](_0x5e6a('0x17'),_0x597245,JSON[_0x5e6a('0x10')](_0x121778));_0xf0c25b(_0x121778);})[_0x5e6a('0x20')](function(_0x2c8ceb){logger['error'](_0x5e6a('0x17'),_0x2c8ceb[_0x5e6a('0x14')],_0x597245);_0x5d129d(_0x504c85[_0x5e6a('0x11')](0x1f4,_0x2c8ceb[_0x5e6a('0x14')]));});});}; \ No newline at end of file +var _0xdaa4=['lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','code','MailApplication,\x20%s,\x20%s','message','info','MailApplication','update','body','options','raw','where','limit','UpdateMailApplication','stringify'];(function(_0xcd56da,_0x315299){var _0x37a5a5=function(_0x3acc02){while(--_0x3acc02){_0xcd56da['push'](_0xcd56da['shift']());}};_0x37a5a5(++_0x315299);}(_0xdaa4,0x1d0));var _0x4daa=function(_0xc527f5,_0x1f7c5c){_0xc527f5=_0xc527f5-0x0;var _0x41f85c=_0xdaa4[_0xc527f5];return _0x41f85c;};'use strict';var _=require(_0x4daa('0x0'));var util=require(_0x4daa('0x1'));var moment=require('moment');var BPromise=require(_0x4daa('0x2'));var rs=require(_0x4daa('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4daa('0x4'))['db'];var utils=require(_0x4daa('0x5'));var logger=require('../../config/logger')(_0x4daa('0x6'));var config=require(_0x4daa('0x7'));var jayson=require(_0x4daa('0x8'));var client=jayson[_0x4daa('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a92ba,_0x439106,_0x341f44){return new BPromise(function(_0x1e3ffe,_0xb4aa35){return client[_0x4daa('0xa')](_0x2a92ba,_0x341f44)[_0x4daa('0xb')](function(_0x2247ba){logger['info']('MailApplication,\x20%s,\x20%s',_0x439106,_0x4daa('0xc'));logger[_0x4daa('0xd')](_0x4daa('0xe'),_0x439106,_0x4daa('0xc'),JSON['stringify'](_0x2247ba));if(_0x2247ba[_0x4daa('0xf')]){if(_0x2247ba[_0x4daa('0xf')][_0x4daa('0x10')]===0x1f4){logger[_0x4daa('0xf')](_0x4daa('0x11'),_0x439106,_0x2247ba[_0x4daa('0xf')][_0x4daa('0x12')]);return _0xb4aa35(_0x2247ba['error'][_0x4daa('0x12')]);}logger['error'](_0x4daa('0x11'),_0x439106,_0x2247ba[_0x4daa('0xf')]['message']);return _0x1e3ffe(_0x2247ba[_0x4daa('0xf')][_0x4daa('0x12')]);}else{logger[_0x4daa('0x13')](_0x4daa('0x11'),_0x439106,_0x4daa('0xc'));_0x1e3ffe(_0x2247ba['result'][_0x4daa('0x12')]);}})['catch'](function(_0x5a4420){logger['error'](_0x4daa('0x11'),_0x439106,_0x5a4420);_0xb4aa35(_0x5a4420);});});}exports['UpdateMailApplication']=function(_0x32d5f1){var _0x550ab7=this;return new Promise(function(_0x354e02,_0x11b7ae){return db[_0x4daa('0x14')][_0x4daa('0x15')](_0x32d5f1[_0x4daa('0x16')],{'raw':_0x32d5f1['options']?_0x32d5f1[_0x4daa('0x17')][_0x4daa('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32d5f1[_0x4daa('0x17')]?_0x32d5f1[_0x4daa('0x17')][_0x4daa('0x19')]||null:null,'attributes':_0x32d5f1[_0x4daa('0x17')]?_0x32d5f1[_0x4daa('0x17')]['attributes']||null:null,'limit':_0x32d5f1[_0x4daa('0x17')]?_0x32d5f1[_0x4daa('0x17')][_0x4daa('0x1a')]||null:null})['then'](function(_0x4ba048){logger[_0x4daa('0x13')](_0x4daa('0x1b'),_0x32d5f1);logger[_0x4daa('0xd')](_0x4daa('0x1b'),_0x32d5f1,JSON[_0x4daa('0x1c')](_0x4ba048));_0x354e02(_0x4ba048);})['catch'](function(_0xce66b9){logger[_0x4daa('0xf')]('UpdateMailApplication',_0xce66b9[_0x4daa('0x12')],_0x32d5f1);_0x11b7ae(_0x550ab7[_0x4daa('0xf')](0x1f4,_0xce66b9[_0x4daa('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 6074ce6..5ce72ee 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 _0x705f=['/describe','describe','/:id','show','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','put','mailinteraction:update','update','delete','mailinteraction:destroy','exports','express','Router','./mailInteraction.controller','get','isAuthenticated','index'];(function(_0x1a3550,_0x32309e){var _0x408314=function(_0x2fe547){while(--_0x2fe547){_0x1a3550['push'](_0x1a3550['shift']());}};_0x408314(++_0x32309e);}(_0x705f,0x1b4));var _0xf705=function(_0x6d97b2,_0x3c1332){_0x6d97b2=_0x6d97b2-0x0;var _0x514465=_0x705f[_0x6d97b2];return _0x514465;};'use strict';var express=require(_0xf705('0x0'));var router=express[_0xf705('0x1')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var controller=require(_0xf705('0x2'));router[_0xf705('0x3')]('/',auth[_0xf705('0x4')](),controller[_0xf705('0x5')]);router[_0xf705('0x3')](_0xf705('0x6'),auth[_0xf705('0x4')](),controller[_0xf705('0x7')]);router[_0xf705('0x3')](_0xf705('0x8'),auth[_0xf705('0x4')](),controller[_0xf705('0x9')]);router[_0xf705('0x3')]('/:id/messages',auth[_0xf705('0x4')](),controller['getMessages']);router[_0xf705('0x3')](_0xf705('0xa'),auth['isAuthenticated'](),controller[_0xf705('0xb')]);router[_0xf705('0xc')]('/',auth[_0xf705('0x4')](),controller[_0xf705('0xd')]);router[_0xf705('0xc')](_0xf705('0xe'),auth[_0xf705('0x4')](),controller[_0xf705('0xf')]);router[_0xf705('0xc')](_0xf705('0x10'),auth[_0xf705('0x4')](),interaction[_0xf705('0x11')](_0xf705('0x12'),_0xf705('0x13')),controller['addTags']);router[_0xf705('0x14')](_0xf705('0x8'),auth[_0xf705('0x4')](),interaction[_0xf705('0x11')](_0xf705('0x12'),_0xf705('0x15')),controller[_0xf705('0x16')]);router[_0xf705('0x17')](_0xf705('0x8'),auth['isAuthenticated'](),interaction['tracked']('mail',_0xf705('0x18')),controller['destroy']);router[_0xf705('0x17')]('/:id/tags',auth[_0xf705('0x4')](),controller['removeTags']);module[_0xf705('0x19')]=router; \ No newline at end of file +var _0x694d=['express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','create','post','/:id/tags','tracked','mail','mailinteraction:addtags','put','mailinteraction:update','update','delete','mailinteraction:destroy','removeTags','exports'];(function(_0x59e570,_0x402b94){var _0x2ad87f=function(_0x3733b0){while(--_0x3733b0){_0x59e570['push'](_0x59e570['shift']());}};_0x2ad87f(++_0x402b94);}(_0x694d,0x16c));var _0xd694=function(_0x25bce1,_0x5560cf){_0x25bce1=_0x25bce1-0x0;var _0x31d160=_0x694d[_0x25bce1];return _0x31d160;};'use strict';var express=require(_0xd694('0x0'));var router=express[_0xd694('0x1')]();var auth=require(_0xd694('0x2'));var interaction=require(_0xd694('0x3'));var controller=require('./mailInteraction.controller');router[_0xd694('0x4')]('/',auth[_0xd694('0x5')](),controller['index']);router['get'](_0xd694('0x6'),auth['isAuthenticated'](),controller[_0xd694('0x7')]);router[_0xd694('0x4')](_0xd694('0x8'),auth[_0xd694('0x5')](),controller[_0xd694('0x9')]);router['get'](_0xd694('0xa'),auth[_0xd694('0x5')](),controller[_0xd694('0xb')]);router['get'](_0xd694('0xc'),auth[_0xd694('0x5')](),controller['download']);router['post']('/',auth[_0xd694('0x5')](),controller[_0xd694('0xd')]);router[_0xd694('0xe')](_0xd694('0xa'),auth[_0xd694('0x5')](),controller['addMessage']);router[_0xd694('0xe')](_0xd694('0xf'),auth['isAuthenticated'](),interaction[_0xd694('0x10')](_0xd694('0x11'),_0xd694('0x12')),controller['addTags']);router[_0xd694('0x13')](_0xd694('0x8'),auth[_0xd694('0x5')](),interaction[_0xd694('0x10')](_0xd694('0x11'),_0xd694('0x14')),controller[_0xd694('0x15')]);router[_0xd694('0x16')](_0xd694('0x8'),auth[_0xd694('0x5')](),interaction[_0xd694('0x10')]('mail',_0xd694('0x17')),controller['destroy']);router[_0xd694('0x16')](_0xd694('0xf'),auth[_0xd694('0x5')](),controller[_0xd694('0x18')]);module[_0xd694('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 4d7ca26..23e1640 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 _0x7fc4=['long','BOOLEAN','ENUM','out','sequelize','DATE','STRING','TEXT'];(function(_0x1e3bcd,_0x429b02){var _0x137418=function(_0x506c91){while(--_0x506c91){_0x1e3bcd['push'](_0x1e3bcd['shift']());}};_0x137418(++_0x429b02);}(_0x7fc4,0x174));var _0x47fc=function(_0xcfeffa,_0x534743){_0xcfeffa=_0xcfeffa-0x0;var _0x51263a=_0x7fc4[_0xcfeffa];return _0x51263a;};'use strict';var Sequelize=require(_0x47fc('0x0'));var iconv=require('iconv');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x47fc('0x1')]},'disposition':{'type':Sequelize[_0x47fc('0x2')]},'secondDisposition':{'type':Sequelize[_0x47fc('0x2')]},'thirdDisposition':{'type':Sequelize[_0x47fc('0x2')]},'note':{'type':Sequelize[_0x47fc('0x2')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x47fc('0x2')]},'cc':{'type':Sequelize[_0x47fc('0x3')](_0x47fc('0x4'))},'subject':{'type':Sequelize[_0x47fc('0x3')]()},'attach':{'type':Sequelize[_0x47fc('0x5')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x47fc('0x1')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x47fc('0x1')]},'firstMsgDirection':{'type':Sequelize[_0x47fc('0x6')]('in',_0x47fc('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x47fc('0x1')]},'lastMsgDirection':{'type':Sequelize[_0x47fc('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x47fc('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0xf120=['exports','BOOLEAN','STRING','TEXT','long','DATE','ENUM','out','iconv'];(function(_0x3a7391,_0x4baf7f){var _0x2792d6=function(_0x488845){while(--_0x488845){_0x3a7391['push'](_0x3a7391['shift']());}};_0x2792d6(++_0x4baf7f);}(_0xf120,0x179));var _0x0f12=function(_0x14c745,_0x23ccb6){_0x14c745=_0x14c745-0x0;var _0x57bc93=_0xf120[_0x14c745];return _0x57bc93;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x0f12('0x0'));module[_0x0f12('0x1')]={'closed':{'type':Sequelize[_0x0f12('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x0f12('0x3')]},'secondDisposition':{'type':Sequelize[_0x0f12('0x3')]},'thirdDisposition':{'type':Sequelize[_0x0f12('0x3')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x0f12('0x3')](0x1fe)},'to':{'type':Sequelize[_0x0f12('0x3')]},'cc':{'type':Sequelize[_0x0f12('0x4')](_0x0f12('0x5'))},'subject':{'type':Sequelize[_0x0f12('0x4')]()},'attach':{'type':Sequelize[_0x0f12('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x0f12('0x6')]},'substatus':{'type':Sequelize[_0x0f12('0x3')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x0f12('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0f12('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x0f12('0x7')]('in',_0x0f12('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 97a703c..39c17f5 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 _0xa920=['search','sqlOperator','conditions','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','keys','some','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isEmail','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','Sequelize','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','DESC','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.MailAccountId\x20IS\x20NULL','sequelize','keyBy','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.createdAt','i.closed','i.closedAt','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.substatus','i.to','i.ContactId','i.UserId','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','groupBy','MailInteractionId','Setting','enableEmailPreview','all','rows','params','includeAll','include','options','create','body','describe','addMessage','omit','ids','getMessages','merge','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','setTags','spread','findAll','emit','mailInteractionTags:save','removeTags','unix','root','server','files','tmp','join','attachments','format','transcript-%d-%s.zip','Attachment','Attachments','Messages','subject','get','mkdirSync','each','decode','headers','bcc','Bcc','basename','readFileSync','build','message%d.eml','download','zip-dir','moment','bluebird','util','lodash','squel','juice','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','html-entities','redis','defaults','socket.io-emitter','./mailInteraction.socket','sendStatus','status','end','json','offset','limit','undefined','count','update','then','destroy','error','name','send','Users','map','fullname','TagIds','push','MailMessage','findOne','plainBody','-id','lastMsgText','trimStart','catch','index','MailInteraction','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch'];(function(_0x1a6b14,_0x1566b6){var _0x2b5f48=function(_0x183fe0){while(--_0x183fe0){_0x1a6b14['push'](_0x1a6b14['shift']());}};_0x2b5f48(++_0x1566b6);}(_0xa920,0x92));var _0x0a92=function(_0xedb678,_0x50e542){_0xedb678=_0xedb678-0x0;var _0x344424=_0xa920[_0xedb678];return _0x344424;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0a92('0x0'));var moment=require(_0x0a92('0x1'));var BPromise=require(_0x0a92('0x2'));var util=require(_0x0a92('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x0a92('0x4'));var squel=require(_0x0a92('0x5'));var juice=require(_0x0a92('0x6'));var Redis=require(_0x0a92('0x7'));var qs=require(_0x0a92('0x8'));var as=require(_0x0a92('0x9'));var logger=require(_0x0a92('0xa'))(_0x0a92('0xb'));var config=require('../../config/environment');var db=require(_0x0a92('0xc'))['db'];var htmlEntities=require(_0x0a92('0xd'));config[_0x0a92('0xe')]=_[_0x0a92('0xf')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a92('0x10'))(new Redis(config['redis']));require(_0x0a92('0x11'))['register'](socket);function respondWithStatusCode(_0x4b9697,_0x15cd61){_0x15cd61=_0x15cd61||0xcc;return function(_0x3ba6be){if(_0x3ba6be){return _0x4b9697[_0x0a92('0x12')](_0x15cd61);}return _0x4b9697[_0x0a92('0x13')](_0x15cd61)[_0x0a92('0x14')]();};}function respondWithResult(_0x136a9a,_0x522c61){_0x522c61=_0x522c61||0xc8;return function(_0xec2775){if(_0xec2775){return _0x136a9a[_0x0a92('0x13')](_0x522c61)[_0x0a92('0x15')](_0xec2775);}};}function respondWithFilteredResult(_0x139ff1,_0x314e84){return function(_0x2dfdf8){if(_0x2dfdf8){var _0x18f19b=typeof _0x314e84[_0x0a92('0x16')]==='undefined'&&typeof _0x314e84[_0x0a92('0x17')]===_0x0a92('0x18');var _0x46ec54=_0x2dfdf8[_0x0a92('0x19')];var _0x26a7a8=_0x18f19b?0x0:_0x314e84['offset'];var _0x354479=_0x18f19b?_0x2dfdf8[_0x0a92('0x19')]:_0x314e84[_0x0a92('0x16')]+_0x314e84[_0x0a92('0x17')];var _0x1d3c4c;if(_0x354479>=_0x46ec54){_0x354479=_0x46ec54;_0x1d3c4c=0xc8;}else{_0x1d3c4c=0xce;}_0x139ff1[_0x0a92('0x13')](_0x1d3c4c);return _0x139ff1['set']('Content-Range',_0x26a7a8+'-'+_0x354479+'/'+_0x46ec54)[_0x0a92('0x15')](_0x2dfdf8);}return null;};}function saveUpdates(_0x5620d2){return function(_0x32990d){if(_0x32990d){return _0x32990d[_0x0a92('0x1a')](_0x5620d2)[_0x0a92('0x1b')](function(_0x3c4514){return _0x3c4514;});}return null;};}function removeEntity(_0xbbb7d4){return function(_0x181902){if(_0x181902){return _0x181902[_0x0a92('0x1c')]()['then'](function(){_0xbbb7d4[_0x0a92('0x13')](0xcc)[_0x0a92('0x14')]();});}};}function handleEntityNotFound(_0x2ee200){return function(_0x437592){if(!_0x437592){_0x2ee200[_0x0a92('0x12')](0x194);}return _0x437592;};}function handleError(_0x10c7a5,_0x30297a){_0x30297a=_0x30297a||0x1f4;return function(_0x39d84b){logger[_0x0a92('0x1d')](_0x39d84b['stack']);if(_0x39d84b[_0x0a92('0x1e')]){delete _0x39d84b[_0x0a92('0x1e')];}_0x10c7a5['status'](_0x30297a)[_0x0a92('0x1f')](_0x39d84b);};}function getInteractionUsers(_0x50f7fb,_0x41cfa7){return new BPromise(function(_0x417a55,_0x31de96){try{if(_0x41cfa7[_0x50f7fb['id']]){_0x50f7fb[_0x0a92('0x20')]=_[_0x0a92('0x21')](_0x41cfa7[_0x50f7fb['id']],function(_0x2743b7){return{'id':_0x2743b7['id'],'fullname':_0x2743b7[_0x0a92('0x22')]};});}}catch(_0x120ada){_0x31de96(_0x120ada);}_0x417a55(_0x50f7fb);});}function getInteractionTags(_0x8fd5ac,_0x15f55f){return new BPromise(function(_0x221c6d,_0x1d3f4a){try{if(_0x8fd5ac[_0x0a92('0x23')]){_0x8fd5ac['Tags']=[];_0x8fd5ac['TagIds']['split'](',')['forEach'](function(_0x48dcce){_0x8fd5ac['Tags'][_0x0a92('0x24')](_0x15f55f[_0x48dcce]);});}delete _0x8fd5ac[_0x0a92('0x23')];}catch(_0x37a147){_0x1d3f4a(_0x37a147);}_0x221c6d(_0x8fd5ac);});}function getLastMessageText(_0x4ea7b1){return new BPromise(function(_0x2a81d1,_0x2fdc51){return db[_0x0a92('0x25')][_0x0a92('0x26')]({'where':{'$and':[{'MailInteractionId':_0x4ea7b1['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x0a92('0x27')],'order':_0x0a92('0x28'),'raw':!![]})[_0x0a92('0x1b')](function(_0xc79b38){if(_0xc79b38&&_0xc79b38[_0x0a92('0x27')]){_0x4ea7b1[_0x0a92('0x29')]=_[_0x0a92('0x2a')](_0xc79b38[_0x0a92('0x27')]);}_0x2a81d1(_0x4ea7b1);})[_0x0a92('0x2b')](function(_0x581d54){_0x2fdc51(_0x581d54);});});}function updateMailInteraction(_0x36eac0,_0x3b1e02,_0x5458e3,_0x31b245){return new BPromise(function(_0xe14591,_0x30757b){return getInteractionUsers(_0x36eac0,_0x5458e3)[_0x0a92('0x1b')](function(_0x4ba176){return getInteractionTags(_0x4ba176,_0x3b1e02);})[_0x0a92('0x1b')](function(_0x425451){if(_0x31b245){_0xe14591(getLastMessageText(_0x425451));}else{_0xe14591(_0x425451);}})['catch'](function(_0x52207f){_0x30757b(_0x52207f);});});}exports[_0x0a92('0x2c')]=function(_0x3dd309,_0xfff2d0){var _0xe6e25a={},_0x3e335a={},_0x4558ba={'count':0x0,'rows':[]};var _0x401c2a=_[_0x0a92('0x21')](db[_0x0a92('0x2d')][_0x0a92('0x2e')],function(_0x3ae47c){return{'name':_0x3ae47c[_0x0a92('0x2f')],'type':_0x3ae47c['type'][_0x0a92('0x30')]};});_0x3e335a[_0x0a92('0x31')]=_[_0x0a92('0x21')](_0x401c2a,_0x0a92('0x1e'));_0x3e335a[_0x0a92('0x32')]=_['keys'](_0x3dd309['query']);_0x3e335a[_0x0a92('0x33')]=_['intersection'](_0x3e335a[_0x0a92('0x31')],_0x3e335a[_0x0a92('0x32')]);_0xe6e25a[_0x0a92('0x34')]=_[_0x0a92('0x35')](_0x3e335a[_0x0a92('0x31')],qs[_0x0a92('0x36')](_0x3dd309[_0x0a92('0x32')][_0x0a92('0x36')]));_0xe6e25a[_0x0a92('0x34')]=_0xe6e25a[_0x0a92('0x34')][_0x0a92('0x37')]?_0xe6e25a[_0x0a92('0x34')]:_0x3e335a[_0x0a92('0x31')];if(!_0x3dd309[_0x0a92('0x32')][_0x0a92('0x38')](_0x0a92('0x39'))){_0xe6e25a[_0x0a92('0x17')]=qs[_0x0a92('0x17')](_0x3dd309[_0x0a92('0x32')][_0x0a92('0x17')]);_0xe6e25a[_0x0a92('0x16')]=qs[_0x0a92('0x16')](_0x3dd309[_0x0a92('0x32')][_0x0a92('0x16')]);}_0xe6e25a[_0x0a92('0x3a')]=qs['sort'](_0x3dd309[_0x0a92('0x32')][_0x0a92('0x3b')]);_0xe6e25a[_0x0a92('0x3c')]=qs['filters'](_[_0x0a92('0x3d')](_0x3dd309['query'],_0x3e335a[_0x0a92('0x33')]),_0x401c2a);var _0x4b9dce=[];var _0x4c189f=squel[_0x0a92('0x3e')]()[_0x0a92('0x3f')]('id')[_0x0a92('0x3f')](_0x0a92('0x1e'))[_0x0a92('0x3f')](_0x0a92('0x40'))[_0x0a92('0x41')](_0x0a92('0x42'));var _0x324cdc=squel[_0x0a92('0x3e')]()[_0x0a92('0x3f')](_0x0a92('0x43'))[_0x0a92('0x3f')](_0x0a92('0x44'))[_0x0a92('0x3f')](_0x0a92('0x45'))[_0x0a92('0x41')]('user_has_mail_interactions','ui')[_0x0a92('0x46')](_0x0a92('0x47'),'u',_0x0a92('0x48'));var _0x5d5c42=squel[_0x0a92('0x3e')]()[_0x0a92('0x41')](_0x0a92('0x49'),'i')['left_join']('cm_contacts','c',_0x0a92('0x4a'))['left_join'](_0x0a92('0x47'),'o',_0x0a92('0x4b'))[_0x0a92('0x46')](_0x0a92('0x4c'),'a',_0x0a92('0x4d'))['left_join'](_0x0a92('0x4e'),'me',_0x0a92('0x4f'))[_0x0a92('0x46')](_0x0a92('0x50'),'it',_0x0a92('0x51'))[_0x0a92('0x46')](_0x0a92('0x42'),'t',_0x0a92('0x52'));var _0x1d031e=squel[_0x0a92('0x53')]();var _0x14a988=[];var _0x358a1f=squel['expr']();var _0x5d1c74;if(_0x3dd309[_0x0a92('0x32')]['search']){_0x5d1c74=as[_0x0a92('0x54')](_0x3dd309[_0x0a92('0x32')][_0x0a92('0x55')]);var _0x328b2d=_0x5d1c74[_0x0a92('0x56')];for(var _0x18ecf7=0x0;_0x18ecf7<_0x5d1c74['conditions'][_0x0a92('0x37')];_0x18ecf7++){var _0x15fd1a=_0x5d1c74[_0x0a92('0x57')][_0x18ecf7];var _0x5834dc='i';var _0x1c9381=_[_0x0a92('0x58')](_0x401c2a,[_0x0a92('0x1e'),_0x15fd1a[_0x0a92('0x3f')]]);if(!_0x1c9381){switch(_0x15fd1a[_0x0a92('0x3f')]){case'unreadMessages':if(_0x15fd1a[_0x0a92('0x59')]==0x1){_0x5d5c42[_0x0a92('0x5a')]('`'+_0x15fd1a['field']+_0x0a92('0x5b'));}else{_0x5d5c42['having']('`'+_0x15fd1a[_0x0a92('0x3f')]+_0x0a92('0x5c'));}break;case _0x0a92('0x5d'):if(_0x15fd1a[_0x0a92('0x5e')]==='$substring'){if(_0x15fd1a['value'][_0x0a92('0x5f')]('\x20')[_0x0a92('0x37')]>0x1){_0x1d031e[_0x328b2d](_0x0a92('0x60'),qs['getFullTextValue'](_0x15fd1a['value']),null);}else{var _0x5de575='%'+_0x15fd1a[_0x0a92('0x59')]+'%';_0x1d031e[_0x328b2d](_0x0a92('0x61'),_0x5de575,_0x5de575,_0x5de575);}}else{_0x1c9381=_[_0x0a92('0x58')](_0x401c2a,[_0x0a92('0x1e'),_0x0a92('0x62')]);_0x15fd1a[_0x0a92('0x3f')]=_0x0a92('0x62');_0x3ee6c3=as['buildExpression'](_0x5834dc,_0x1c9381[_0x0a92('0x63')],_0x15fd1a);_0x1d031e[_0x328b2d](_0x3ee6c3[_0x0a92('0x64')],_0x3ee6c3[_0x0a92('0x59')][_0x0a92('0x65')],_0x3ee6c3[_0x0a92('0x59')][_0x0a92('0x14')]);}break;case _0x0a92('0x66'):var _0x3a2b45=_0x15fd1a[_0x0a92('0x59')][_0x0a92('0x5f')](',')['map'](function(_0x4121ba){return Number(_0x4121ba);});_0x3a2b45[_0x0a92('0x67')](function(_0x1a4b6c){_0x358a1f['or'](_0x0a92('0x68'),'%,'+_0x1a4b6c+',%');});_0x14a988=_['union'](_0x14a988,_0x3a2b45);break;case _0x0a92('0x69'):if(_0x15fd1a[_0x0a92('0x5e')]===_0x0a92('0x6a')){_0x1d031e[_0x328b2d](_0x0a92('0x6b'),'%'+_0x15fd1a[_0x0a92('0x59')]+'%',null);}else{_0x1c9381=_['find'](_0x401c2a,['name',_0x0a92('0x6c')]);_0x15fd1a[_0x0a92('0x3f')]=_0x0a92('0x6c');_0x3ee6c3=as['buildExpression'](_0x5834dc,_0x1c9381[_0x0a92('0x63')],_0x15fd1a);_0x1d031e[_0x328b2d](_0x3ee6c3[_0x0a92('0x64')],_0x3ee6c3[_0x0a92('0x59')][_0x0a92('0x65')],_0x3ee6c3[_0x0a92('0x59')][_0x0a92('0x14')]);}break;case _0x0a92('0x27'):_0x3ee6c3=as[_0x0a92('0x6d')]('me',null,_0x15fd1a);_0x1d031e[_0x328b2d](_0x3ee6c3[_0x0a92('0x64')],_0x3ee6c3['value']['start'],_0x3ee6c3['value']['end']);break;}}else{var _0x3ee6c3=as['buildExpression'](_0x5834dc,_0x1c9381[_0x0a92('0x63')],_0x15fd1a);_0x1d031e[_0x328b2d](_0x3ee6c3['text'],_0x3ee6c3[_0x0a92('0x59')][_0x0a92('0x65')],_0x3ee6c3['value'][_0x0a92('0x14')]);}}}else{var _0x25f3e1=_(_0x3dd309[_0x0a92('0x32')])[_0x0a92('0x6e')]()[_0x0a92('0x21')](function(_0xaf2afe){return _[_0x0a92('0x6f')](_0x401c2a,[_0x0a92('0x1e'),_0xaf2afe])?_0xaf2afe:undefined;})['compact']()[_0x0a92('0x59')]();if(!_[_0x0a92('0x70')](_0x25f3e1)){_0x25f3e1[_0x0a92('0x67')](function(_0x24cbbc){if(_0x24cbbc===_0x0a92('0x71')){_0x5d5c42[_0x0a92('0x3c')](_0x0a92('0x72'),[][_0x0a92('0x73')](_0x3dd309[_0x0a92('0x32')][_0x24cbbc]));}else if(_0x24cbbc===_0x0a92('0x74')){var _0x37e4c2=JSON[_0x0a92('0x75')](_0x3dd309[_0x0a92('0x32')][_0x24cbbc])[_0x0a92('0x76')];var _0x1192b8=JSON[_0x0a92('0x75')](_0x3dd309['query'][_0x24cbbc])[_0x0a92('0x77')];_0x5d5c42[_0x0a92('0x3c')](_0x0a92('0x78'),_0x37e4c2,_0x1192b8);}else{if(_0x3dd309[_0x0a92('0x32')][_0x24cbbc]===_0x0a92('0x79')){_0x5d5c42[_0x0a92('0x3c')]('i.'+_0x24cbbc+_0x0a92('0x7a'));}else{_0x5d5c42['where']('i.'+_0x24cbbc+_0x0a92('0x7b'),_0x3dd309[_0x0a92('0x32')][_0x24cbbc]);}}});}if(_0x3dd309[_0x0a92('0x32')][_0x0a92('0x7c')]){if(_0x3dd309[_0x0a92('0x32')]['read']==0x1){_0x5d5c42[_0x0a92('0x5a')](_0x0a92('0x7d'));}else{_0x5d5c42['having'](_0x0a92('0x7e'));}}if(_0x3dd309[_0x0a92('0x32')][_0x0a92('0x7f')]){_0x14a988=_[_0x0a92('0x80')](_0x3dd309[_0x0a92('0x32')][_0x0a92('0x7f')])?_0x3dd309[_0x0a92('0x32')][_0x0a92('0x7f')]:new Array(_0x3dd309['query'][_0x0a92('0x7f')]);_0x14a988[_0x0a92('0x67')](function(_0x9320e3){_0x358a1f['or'](_0x0a92('0x68'),'%,'+_0x9320e3+',%');});}if(_0x3dd309[_0x0a92('0x32')][_0x0a92('0x81')]){var _0x595b1e=_0x3dd309['query']['filter'][_0x0a92('0x82')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x595b1e)){_0x1d031e['or']('i.id\x20LIKE\x20?',_0x595b1e+'%');}else if(qs[_0x0a92('0x83')](_0x595b1e)){_0x1d031e['or']('c.email\x20LIKE\x20?',_0x595b1e+'%');}else{_0x1d031e['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0a92('0x84')](_0x595b1e))['or'](_0x0a92('0x85'),qs[_0x0a92('0x84')](_0x595b1e));}}}_0x5d5c42[_0x0a92('0x3c')](_0x1d031e);_0x5d5c42[_0x0a92('0x86')]('i.id');var _0x44c602={'type':db[_0x0a92('0x87')]['QueryTypes'][_0x0a92('0x88')],'raw':!![]};var _0x2c20ac=_0x5d5c42[_0x0a92('0x89')]();_0x2c20ac[_0x0a92('0x3f')](_0x0a92('0x8a'));_0x2c20ac[_0x0a92('0x3f')](_0x0a92('0x8b'),_0x0a92('0x8c'));if(_0xe6e25a[_0x0a92('0x3a')]){_0xe6e25a[_0x0a92('0x3a')][_0x0a92('0x67')](function(_0x30ebfe){var _0x21c546=_0x30ebfe[0x0]==='contactName'?_0x30ebfe[0x0]:'i.'+_0x30ebfe[0x0];_0x5d5c42[_0x0a92('0x3a')](_0x21c546,_0x30ebfe[0x1]===_0x0a92('0x8d')?![]:!![]);});}if(!_[_0x0a92('0x70')](_0x14a988)){_0x5d5c42[_0x0a92('0x5a')](_0x358a1f);_0x2c20ac['where']('t.id\x20IN\x20?',_0x14a988);}BPromise['resolve']()[_0x0a92('0x1b')](function(){if(!_0x5d1c74){if(_0x3dd309[_0x0a92('0x32')]['MailAccountId'])return;_0x2c20ac['where'](_0x0a92('0x8e'));_0x5d5c42[_0x0a92('0x3c')](_0x0a92('0x8e'));return;}if(_0x3dd309[_0x0a92('0x8f')][_0x0a92('0x90')]!==_0x0a92('0x91'))return;return _0x3dd309['user']['getMailAccounts']({'attributes':['id'],'raw':!![]})[_0x0a92('0x1b')](function(_0x1ee047){if(_[_0x0a92('0x70')](_0x1ee047)){_0x2c20ac[_0x0a92('0x3c')](_0x0a92('0x92'));_0x5d5c42[_0x0a92('0x3c')](_0x0a92('0x92'));}else{_0x2c20ac['where'](_0x0a92('0x72'),_[_0x0a92('0x21')](_0x1ee047,'id'));_0x5d5c42[_0x0a92('0x3c')]('i.MailAccountId\x20IN\x20?',_['map'](_0x1ee047,'id'));}});})['then'](function(){if(_0x3dd309['user']['role']===_0x0a92('0x91')&&!_0x5d1c74&&!_0x3dd309[_0x0a92('0x32')][_0x0a92('0x71')])return[];return db['sequelize'][_0x0a92('0x32')](_0x2c20ac['toString'](),_0x44c602);})[_0x0a92('0x1b')](function(_0x1be477){_0x4558ba[_0x0a92('0x19')]=_0x1be477[_0x0a92('0x37')];if(_0x4558ba[_0x0a92('0x19')]===0x0)return[];return db[_0x0a92('0x93')][_0x0a92('0x32')](_0x4c189f['toString'](),_0x44c602)[_0x0a92('0x1b')](function(_0x5163c7){_0x4b9dce=_[_0x0a92('0x94')](_0x5163c7,'id');_0x44c602=_['merge'](_0x44c602,{'model':db[_0x0a92('0x2d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3dd309[_0x0a92('0x32')]['fields']){_0xe6e25a['attributes']['forEach'](function(_0x221a82){_0x5d5c42[_0x0a92('0x3f')]('i.'+_0x221a82);});}else{_0x5d5c42[_0x0a92('0x3f')](_0x0a92('0x8b'),_0x0a92('0x8c'));_0x5d5c42[_0x0a92('0x3f')]('a.key',_0x0a92('0x95'));_0x5d5c42[_0x0a92('0x3f')](_0x0a92('0x96'),'Account.mandatoryDisposition');_0x5d5c42[_0x0a92('0x3f')](_0x0a92('0x97'),_0x0a92('0x98'));_0x5d5c42['field'](_0x0a92('0x8a'));_0x5d5c42[_0x0a92('0x3f')](_0x0a92('0x99'));_0x5d5c42[_0x0a92('0x3f')]('i.updatedAt');_0x5d5c42['field'](_0x0a92('0x9a'));_0x5d5c42[_0x0a92('0x3f')](_0x0a92('0x9b'));_0x5d5c42[_0x0a92('0x3f')]('i.attach');_0x5d5c42['field'](_0x0a92('0x9c'));_0x5d5c42[_0x0a92('0x3f')](_0x0a92('0x9d'));_0x5d5c42['field'](_0x0a92('0x9e'));_0x5d5c42[_0x0a92('0x3f')](_0x0a92('0x9f'));_0x5d5c42[_0x0a92('0x3f')]('i.secondDisposition');_0x5d5c42[_0x0a92('0x3f')]('i.thirdDisposition');_0x5d5c42[_0x0a92('0x3f')](_0x0a92('0xa0'));_0x5d5c42[_0x0a92('0x3f')](_0x0a92('0xa1'));_0x5d5c42[_0x0a92('0x3f')](_0x0a92('0xa2'));_0x5d5c42[_0x0a92('0x3f')]('i.MailAccountId');_0x5d5c42[_0x0a92('0x3f')](_0x0a92('0xa3'));_0x5d5c42[_0x0a92('0x3f')](_0x0a92('0xa4'),_0x0a92('0xa5'));_0x5d5c42[_0x0a92('0x3f')](_0x0a92('0xa6'),'Contact.lastName');_0x5d5c42[_0x0a92('0x3f')](_0x0a92('0xa7'),_0x0a92('0xa8'));_0x5d5c42[_0x0a92('0x3f')](_0x0a92('0xa9'),_0x0a92('0xaa'));_0x5d5c42['field'](_0x0a92('0xab'),_0x0a92('0xac'));_0x5d5c42['field'](_0x0a92('0xad'),'Contact.fax');_0x5d5c42[_0x0a92('0x3f')](_0x0a92('0xae'),'Owner.fullname');_0x5d5c42[_0x0a92('0x3f')](_0x0a92('0xaf'),_0x0a92('0xb0'));_0x5d5c42[_0x0a92('0x3f')](_0x0a92('0xb1'),'TagIds');}if(_0xe6e25a[_0x0a92('0x17')])_0x5d5c42['limit'](_0xe6e25a['limit']);if(_0xe6e25a['offset'])_0x5d5c42[_0x0a92('0x16')](_0xe6e25a[_0x0a92('0x16')]);return db[_0x0a92('0x93')][_0x0a92('0x32')](_0x5d5c42[_0x0a92('0xb2')](),_0x44c602);})[_0x0a92('0x1b')](function(_0x5b7b84){if(_0x5b7b84[_0x0a92('0x37')]>0x0)_0x324cdc[_0x0a92('0x3c')]('ui.MailInteractionId\x20IN\x20?',_['map'](_0x5b7b84,'id'));return db[_0x0a92('0x93')][_0x0a92('0x32')](_0x324cdc[_0x0a92('0xb2')](),_0x44c602)['then'](function(_0x4a0d87){var _0x1dd4b4=_[_0x0a92('0xb3')](_0x4a0d87,_0x0a92('0xb4'));var _0x225250=[];return db[_0x0a92('0xb5')][_0x0a92('0x26')]({'attributes':[_0x0a92('0xb6')],'raw':!![]})[_0x0a92('0x1b')](function(_0x557161){var _0x208e55=_0x557161[_0x0a92('0xb6')];_0x5b7b84[_0x0a92('0x67')](function(_0x499ed0){_0x225250[_0x0a92('0x24')](updateMailInteraction(_0x499ed0,_0x4b9dce,_0x1dd4b4,_0x208e55));});return BPromise[_0x0a92('0xb7')](_0x225250);});});});})[_0x0a92('0x1b')](function(_0x17c8f4){_0x4558ba[_0x0a92('0xb8')]=_0x17c8f4;return _0x4558ba;})[_0x0a92('0x1b')](respondWithFilteredResult(_0xfff2d0,_0xe6e25a))[_0x0a92('0x2b')](handleError(_0xfff2d0,null));};exports['show']=function(_0x247adb,_0x448be7){var _0x3f173e={'raw':![],'where':{'id':_0x247adb[_0x0a92('0xb9')]['id']}},_0xdc547d={};_0xdc547d[_0x0a92('0x31')]=_[_0x0a92('0x6e')](db[_0x0a92('0x2d')][_0x0a92('0x2e')]);_0xdc547d[_0x0a92('0x32')]=_[_0x0a92('0x6e')](_0x247adb[_0x0a92('0x32')]);_0xdc547d[_0x0a92('0x33')]=_[_0x0a92('0x35')](_0xdc547d[_0x0a92('0x31')],_0xdc547d[_0x0a92('0x32')]);_0x3f173e[_0x0a92('0x34')]=_[_0x0a92('0x35')](_0xdc547d[_0x0a92('0x31')],qs[_0x0a92('0x36')](_0x247adb[_0x0a92('0x32')][_0x0a92('0x36')]));_0x3f173e['attributes']=_0x3f173e[_0x0a92('0x34')][_0x0a92('0x37')]?_0x3f173e[_0x0a92('0x34')]:_0xdc547d[_0x0a92('0x31')];if(_0x247adb[_0x0a92('0x32')][_0x0a92('0xba')]){_0x3f173e[_0x0a92('0xbb')]=[{'all':!![]}];}_0x3f173e=_['merge']({},_0x3f173e,_0x247adb[_0x0a92('0xbc')]);return db[_0x0a92('0x2d')][_0x0a92('0x58')](_0x3f173e)[_0x0a92('0x1b')](handleEntityNotFound(_0x448be7,null))[_0x0a92('0x1b')](respondWithResult(_0x448be7,null))[_0x0a92('0x2b')](handleError(_0x448be7,null));};exports['create']=function(_0x133d5e,_0x573594){return db['MailInteraction'][_0x0a92('0xbd')](_0x133d5e['body'],{})[_0x0a92('0x1b')](respondWithResult(_0x573594,0xc9))['catch'](handleError(_0x573594,null));};exports[_0x0a92('0x1a')]=function(_0x365317,_0x4016a){if(_0x365317[_0x0a92('0xbe')]['id']){delete _0x365317[_0x0a92('0xbe')]['id'];}return db[_0x0a92('0x2d')][_0x0a92('0x58')]({'where':{'id':_0x365317[_0x0a92('0xb9')]['id']}})[_0x0a92('0x1b')](handleEntityNotFound(_0x4016a,null))[_0x0a92('0x1b')](saveUpdates(_0x365317[_0x0a92('0xbe')],null))[_0x0a92('0x1b')](respondWithResult(_0x4016a,null))[_0x0a92('0x2b')](handleError(_0x4016a,null));};exports[_0x0a92('0x1c')]=function(_0x1adad4,_0x419082){return db['MailInteraction']['find']({'where':{'id':_0x1adad4[_0x0a92('0xb9')]['id']}})[_0x0a92('0x1b')](handleEntityNotFound(_0x419082,null))[_0x0a92('0x1b')](removeEntity(_0x419082,null))[_0x0a92('0x2b')](handleError(_0x419082,null));};exports[_0x0a92('0xbf')]=function(_0xe653bb,_0x28503e){return db[_0x0a92('0x2d')][_0x0a92('0xbf')]()[_0x0a92('0x1b')](respondWithResult(_0x28503e,null))[_0x0a92('0x2b')](handleError(_0x28503e,null));};exports[_0x0a92('0xc0')]=function(_0x21dab7,_0x199d1e){return db[_0x0a92('0x25')]['find']({'where':{'id':_0x21dab7[_0x0a92('0xb9')]['id']}})[_0x0a92('0x1b')](handleEntityNotFound(_0x199d1e,null))[_0x0a92('0x1b')](function(_0x2bdb36){if(_0x2bdb36){return _0x2bdb36['addMessage'](_0x21dab7[_0x0a92('0xbe')]['ids'],_[_0x0a92('0xc1')](_0x21dab7[_0x0a92('0xbe')],[_0x0a92('0xc2'),'id'])||{});}})[_0x0a92('0x1b')](respondWithResult(_0x199d1e,null))['catch'](handleError(_0x199d1e,null));};exports[_0x0a92('0xc3')]=function(_0x3dd6b9,_0x46692f){var _0x3e7920={'raw':![],'where':{}};var _0x5b3e54={};var _0x553a32={'count':0x0,'rows':[]};return db['MailInteraction']['findOne']({'where':{'id':_0x3dd6b9[_0x0a92('0xb9')]['id']}})[_0x0a92('0x1b')](handleEntityNotFound(_0x46692f,null))['then'](function(_0x369922){if(_0x369922){_0x5b3e54[_0x0a92('0x31')]=_[_0x0a92('0x6e')](db['MailMessage']['rawAttributes']);_0x5b3e54[_0x0a92('0x32')]=_[_0x0a92('0x6e')](_0x3dd6b9['query']);_0x5b3e54['filters']=_[_0x0a92('0x35')](_0x5b3e54['model'],_0x5b3e54['query']);_0x3e7920[_0x0a92('0x34')]=_[_0x0a92('0x35')](_0x5b3e54[_0x0a92('0x31')],qs[_0x0a92('0x36')](_0x3dd6b9[_0x0a92('0x32')][_0x0a92('0x36')]));_0x3e7920['attributes']=_0x3e7920[_0x0a92('0x34')]['length']?_0x3e7920[_0x0a92('0x34')]:_0x5b3e54['model'];if(!_0x3dd6b9[_0x0a92('0x32')][_0x0a92('0x38')](_0x0a92('0x39'))){_0x3e7920[_0x0a92('0x17')]=qs[_0x0a92('0x17')](_0x3dd6b9[_0x0a92('0x32')][_0x0a92('0x17')]);_0x3e7920[_0x0a92('0x16')]=qs[_0x0a92('0x16')](_0x3dd6b9['query'][_0x0a92('0x16')]);}_0x3e7920['order']=qs[_0x0a92('0x3b')](_0x3dd6b9[_0x0a92('0x32')][_0x0a92('0x3b')]);_0x3e7920['where']=qs[_0x0a92('0x33')](_[_0x0a92('0x3d')](_0x3dd6b9['query'],_0x5b3e54[_0x0a92('0x33')]));_0x3e7920[_0x0a92('0x3c')][_0x0a92('0xb4')]=_0x369922['id'];if(_0x3dd6b9[_0x0a92('0x32')][_0x0a92('0x81')]){_0x3e7920[_0x0a92('0x3c')]=_[_0x0a92('0xc4')](_0x3e7920[_0x0a92('0x3c')],{'$or':_[_0x0a92('0x21')](_0x3e7920['attributes'],function(_0x4de208){var _0x50b23c={};_0x50b23c[_0x4de208]={'$like':'%'+_0x3dd6b9[_0x0a92('0x32')]['filter']+'%'};return _0x50b23c;})});}if(_0x3dd6b9['query'][_0x0a92('0x76')]){var _0x55ccc3=_0x3dd6b9[_0x0a92('0x32')][_0x0a92('0x76')][_0x0a92('0x5f')](',');var _0x4e682a={};_0x4e682a[_0x55ccc3[0x0]]={'$gte':moment(_0x55ccc3[0x1])['format'](_0x0a92('0xc5'))};_0x3e7920['where']=_[_0x0a92('0xc4')](_0x3e7920[_0x0a92('0x3c')],_0x4e682a);}_0x3e7920=_[_0x0a92('0xc4')]({},_0x3e7920,_0x3dd6b9[_0x0a92('0xbc')]);return db[_0x0a92('0x25')]['count']({'where':_0x3e7920[_0x0a92('0x3c')]})[_0x0a92('0x1b')](function(_0x506529){_0x553a32[_0x0a92('0x19')]=_0x506529;if(_0x3dd6b9['query'][_0x0a92('0xba')]){_0x3e7920[_0x0a92('0xbb')]=[{'all':!![]}];}return db[_0x0a92('0x25')]['findAll'](_0x3e7920);})[_0x0a92('0x1b')](function(_0x57c07a){if(_0x3dd6b9[_0x0a92('0x32')][_0x0a92('0xc6')]===_0x0a92('0xc7')){for(var _0x48e590=0x0;_0x48e590<_0x57c07a[_0x0a92('0x37')];_0x48e590++){_0x57c07a[_0x48e590][_0x0a92('0xbe')]=juice(_0x57c07a[_0x48e590][_0x0a92('0xbe')]);}}_0x553a32[_0x0a92('0xb8')]=_0x57c07a;return _0x553a32;});}})[_0x0a92('0x1b')](respondWithFilteredResult(_0x46692f,_0x3e7920))[_0x0a92('0x2b')](handleError(_0x46692f,null));};exports['addTags']=function(_0x1f7db4,_0x1293f4){return db[_0x0a92('0x2d')][_0x0a92('0x58')]({'where':{'id':_0x1f7db4[_0x0a92('0xb9')]['id']}})[_0x0a92('0x1b')](handleEntityNotFound(_0x1293f4,null))[_0x0a92('0x1b')](function(_0x3383c2){if(_0x3383c2){return _0x3383c2[_0x0a92('0xc8')](_0x1f7db4[_0x0a92('0xbe')]['ids'],_[_0x0a92('0xc1')](_0x1f7db4[_0x0a92('0xbe')],[_0x0a92('0xc2'),'id'])||{})[_0x0a92('0xc9')](function(){return db[_0x0a92('0x66')][_0x0a92('0xca')]({'attributes':['id',_0x0a92('0x1e'),'color'],'where':{'id':_0x1f7db4[_0x0a92('0xbe')]['ids']}});})[_0x0a92('0x1b')](function(_0x14dff6){socket[_0x0a92('0xcb')](_0x0a92('0xcc'),{'id':Number(_0x1f7db4[_0x0a92('0xb9')]['id']),'tags':_0x14dff6||[]});return{'id':Number(_0x1f7db4['params']['id']),'tags':_0x14dff6||[]};});}})[_0x0a92('0x1b')](respondWithResult(_0x1293f4,null))['catch'](handleError(_0x1293f4,null));};exports[_0x0a92('0xcd')]=function(_0x11a0e8,_0x38929e){return db[_0x0a92('0x2d')][_0x0a92('0x58')]({'where':{'id':_0x11a0e8['params']['id']}})[_0x0a92('0x1b')](handleEntityNotFound(_0x38929e,null))[_0x0a92('0x1b')](function(_0x398d76){if(_0x398d76){return _0x398d76['removeTags'](_0x11a0e8[_0x0a92('0x32')]['ids']);}})[_0x0a92('0x1b')](respondWithStatusCode(_0x38929e,null))[_0x0a92('0x2b')](handleError(_0x38929e,null));};exports['download']=function(_0x1b86c8,_0x100559){var _0x2344c2=moment()[_0x0a92('0xce')]()['toString']();var _0x5e6b76=path['join'](config[_0x0a92('0xcf')],_0x0a92('0xd0'),_0x0a92('0xd1'),_0x0a92('0xd2'));var _0x2e4246=path[_0x0a92('0xd3')](config[_0x0a92('0xcf')],'server',_0x0a92('0xd1'),_0x0a92('0xd4'));var _0x3e26ac=path[_0x0a92('0xd3')](_0x5e6b76,_0x2344c2);var _0x5df142=util[_0x0a92('0xd5')](_0x0a92('0xd6'),_0x1b86c8[_0x0a92('0xb9')]['id'],_0x2344c2);var _0x24c7c5=path['join'](_0x5e6b76,_0x5df142);var _0x106e19=[];if(_0x1b86c8['query'][_0x0a92('0xd4')]){_0x106e19[_0x0a92('0x24')]({'model':db[_0x0a92('0xd7')],'as':_0x0a92('0xd8'),'raw':!![]});}var _0x3ed3e2=[{'model':db[_0x0a92('0x25')],'as':_0x0a92('0xd9'),'attributes':['id',_0x0a92('0xbe'),'from','to','cc','bcc',_0x0a92('0xda'),_0x0a92('0x74')],'where':{'secret':![]},'order':qs[_0x0a92('0x3b')]('id'),'include':_0x106e19}];return db['MailInteraction']['find']({'where':{'id':_0x1b86c8['params']['id']},'include':_0x3ed3e2})[_0x0a92('0x1b')](handleEntityNotFound(_0x100559,null))[_0x0a92('0x1b')](function(_0x1966c8){if(_0x1966c8&&_0x1966c8[_0x0a92('0xd9')]){var _0x6a21d0=_0x1966c8[_0x0a92('0xdb')]({'plain':!![]});fs[_0x0a92('0xdc')](_0x3e26ac);return BPromise[_0x0a92('0xdd')](_0x6a21d0[_0x0a92('0xd9')],function(_0x244da5,_0x281d59){var _0x3f52ed={'from':_0x244da5[_0x0a92('0x41')],'to':_0x244da5['to'],'subject':_0x244da5[_0x0a92('0xda')],'html':htmlEntities[_0x0a92('0xde')](_0x244da5['body']),'headers':{'Date':moment(_0x244da5[_0x0a92('0x74')])[_0x0a92('0xd5')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x244da5['cc']){_0x3f52ed[_0x0a92('0xdf')]['Cc']=_0x244da5['cc'];}if(_0x244da5[_0x0a92('0xe0')]){_0x3f52ed['headers'][_0x0a92('0xe1')]=_0x244da5[_0x0a92('0xe0')];}return new BPromise(function(_0x20260c,_0x290136){if(_0x244da5[_0x0a92('0xd8')]){for(var _0x377a0b=0x0;_0x377a0b<_0x244da5[_0x0a92('0xd8')][_0x0a92('0x37')];_0x377a0b++){var _0x444993=_0x244da5[_0x0a92('0xd8')][_0x377a0b];var _0x1c6aab=path['join'](_0x2e4246,_0x444993[_0x0a92('0xe2')]);if(fs['existsSync'](_0x1c6aab)){_0x3f52ed['attachments']['push']({'name':_0x444993[_0x0a92('0x1e')],'contentType':_0x444993[_0x0a92('0x63')],'data':fs[_0x0a92('0xe3')](_0x1c6aab)});}}}emlformat[_0x0a92('0xe4')](_0x3f52ed,function(_0x3a0c57,_0x1f013c){if(_0x3a0c57)return _0x290136(_0x3a0c57);fs['writeFileSync'](path[_0x0a92('0xd3')](_0x3e26ac,util[_0x0a92('0xd5')](_0x0a92('0xe5'),_0x281d59)),_0x1f013c);return _0x20260c(_0x1f013c);});});})[_0x0a92('0x1b')](function(){return new BPromise(function(_0x147240,_0x585090){zipdir(_0x3e26ac,{'saveTo':_0x24c7c5},function(_0x5b67dd,_0x4ce7a0){if(_0x5b67dd)return _0x585090(_0x5b67dd);return _0x147240(_0x4ce7a0);});})[_0x0a92('0x1b')](function(){return new BPromise(function(_0x968ac4,_0x3d811a){rimraf(_0x3e26ac,function(_0x445440){if(_0x445440)_0x3d811a(_0x445440);return _0x968ac4();});});})[_0x0a92('0x1b')](function(){return _0x100559[_0x0a92('0xe6')](_0x24c7c5,_0x5df142,function(_0x5daeda){if(!_0x5daeda)fs['unlinkSync'](_0x24c7c5);});});});}else{return _0x100559[_0x0a92('0x12')](0xc8);}})['catch'](handleError(_0x100559,null));}; \ No newline at end of file +var _0x2149=['\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','isEmail','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','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','resolve','user','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','i.MailAccountId\x20IN\x20?','role','sequelize','keyBy','merge','Account.mandatoryDisposition','contactName','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','Owner.fullname','o.internal','Owner.internal','toString','ui.MailInteractionId\x20IN\x20?','MailInteractionId','Setting','all','show','params','includeAll','include','options','create','body','describe','addMessage','ids','getMessages','format','findAll','inlineCss','true','setTags','omit','spread','emit','mailInteractionTags:save','removeTags','download','join','root','files','tmp','server','attachments','transcript-%d-%s.zip','Attachment','Messages','bcc','subject','get','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','build','writeFileSync','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','path','lodash','squel','ioredis','../../config/logger','api','../../config/environment','html-entities','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','error','stack','name','send','Users','TagIds','Tags','split','forEach','push','MailMessage','out','plainBody','lastMsgText','trimStart','catch','map','MailInteraction','rawAttributes','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','tools_tags','u.id','u.fullname','ui.MailInteractionId','from','user_has_mail_interactions','left_join','users','cm_contacts','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','expr','parseSearch','search','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','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','User','UserId','text','some','compact','isEmpty','MailAccountId','concat','createdAt','$gte','parse','$lte','null'];(function(_0x211180,_0x12bf83){var _0x18840d=function(_0x367efa){while(--_0x367efa){_0x211180['push'](_0x211180['shift']());}};_0x18840d(++_0x12bf83);}(_0x2149,0x146));var _0x9214=function(_0x3e6a83,_0x356349){_0x3e6a83=_0x3e6a83-0x0;var _0x315131=_0x2149[_0x3e6a83];return _0x315131;};'use strict';var emlformat=require(_0x9214('0x0'));var rimraf=require(_0x9214('0x1'));var zipdir=require(_0x9214('0x2'));var moment=require(_0x9214('0x3'));var BPromise=require(_0x9214('0x4'));var util=require(_0x9214('0x5'));var path=require(_0x9214('0x6'));var fs=require('fs');var _=require(_0x9214('0x7'));var squel=require(_0x9214('0x8'));var juice=require('juice');var Redis=require(_0x9214('0x9'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var logger=require(_0x9214('0xa'))(_0x9214('0xb'));var config=require(_0x9214('0xc'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0x9214('0xd'));config['redis']=_[_0x9214('0xe')](config[_0x9214('0xf')],{'host':_0x9214('0x10'),'port':0x18eb});var socket=require(_0x9214('0x11'))(new Redis(config[_0x9214('0xf')]));require('./mailInteraction.socket')[_0x9214('0x12')](socket);function respondWithStatusCode(_0x239fa7,_0x142b13){_0x142b13=_0x142b13||0xcc;return function(_0x6afea3){if(_0x6afea3){return _0x239fa7[_0x9214('0x13')](_0x142b13);}return _0x239fa7[_0x9214('0x14')](_0x142b13)['end']();};}function respondWithResult(_0x41133f,_0x531c2a){_0x531c2a=_0x531c2a||0xc8;return function(_0x1822d6){if(_0x1822d6){return _0x41133f[_0x9214('0x14')](_0x531c2a)[_0x9214('0x15')](_0x1822d6);}};}function respondWithFilteredResult(_0x9c7021,_0x34750b){return function(_0x1e2c61){if(_0x1e2c61){var _0x134296=typeof _0x34750b[_0x9214('0x16')]===_0x9214('0x17')&&typeof _0x34750b[_0x9214('0x18')]==='undefined';var _0x4e8b69=_0x1e2c61['count'];var _0x9269ad=_0x134296?0x0:_0x34750b['offset'];var _0x1d79bc=_0x134296?_0x1e2c61[_0x9214('0x19')]:_0x34750b[_0x9214('0x16')]+_0x34750b['limit'];var _0x4fa812;if(_0x1d79bc>=_0x4e8b69){_0x1d79bc=_0x4e8b69;_0x4fa812=0xc8;}else{_0x4fa812=0xce;}_0x9c7021[_0x9214('0x14')](_0x4fa812);return _0x9c7021[_0x9214('0x1a')](_0x9214('0x1b'),_0x9269ad+'-'+_0x1d79bc+'/'+_0x4e8b69)[_0x9214('0x15')](_0x1e2c61);}return null;};}function saveUpdates(_0x53ec2b){return function(_0x2f3504){if(_0x2f3504){return _0x2f3504[_0x9214('0x1c')](_0x53ec2b)[_0x9214('0x1d')](function(_0x2aba58){return _0x2aba58;});}return null;};}function removeEntity(_0x299241){return function(_0x524d7){if(_0x524d7){return _0x524d7[_0x9214('0x1e')]()['then'](function(){_0x299241[_0x9214('0x14')](0xcc)[_0x9214('0x1f')]();});}};}function handleEntityNotFound(_0xeacccf){return function(_0x453bdb){if(!_0x453bdb){_0xeacccf[_0x9214('0x13')](0x194);}return _0x453bdb;};}function handleError(_0x43b9b8,_0x33b52b){_0x33b52b=_0x33b52b||0x1f4;return function(_0xaa9eb4){logger[_0x9214('0x20')](_0xaa9eb4[_0x9214('0x21')]);if(_0xaa9eb4[_0x9214('0x22')]){delete _0xaa9eb4[_0x9214('0x22')];}_0x43b9b8[_0x9214('0x14')](_0x33b52b)[_0x9214('0x23')](_0xaa9eb4);};}function getInteractionUsers(_0x113c29,_0x3782e4){return new BPromise(function(_0x27d9d2,_0x34508e){try{if(_0x3782e4[_0x113c29['id']]){_0x113c29[_0x9214('0x24')]=_['map'](_0x3782e4[_0x113c29['id']],function(_0x2c8ebd){return{'id':_0x2c8ebd['id'],'fullname':_0x2c8ebd['fullname']};});}}catch(_0x4bcaae){_0x34508e(_0x4bcaae);}_0x27d9d2(_0x113c29);});}function getInteractionTags(_0x3faf55,_0x344a99){return new BPromise(function(_0x4f9035,_0xb3666b){try{if(_0x3faf55[_0x9214('0x25')]){_0x3faf55[_0x9214('0x26')]=[];_0x3faf55['TagIds'][_0x9214('0x27')](',')[_0x9214('0x28')](function(_0x1b4d16){_0x3faf55[_0x9214('0x26')][_0x9214('0x29')](_0x344a99[_0x1b4d16]);});}delete _0x3faf55[_0x9214('0x25')];}catch(_0x55bc6a){_0xb3666b(_0x55bc6a);}_0x4f9035(_0x3faf55);});}function getLastMessageText(_0x5311d4){return new BPromise(function(_0x15985d,_0x4fc31b){return db[_0x9214('0x2a')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x5311d4['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x9214('0x2b')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x9214('0x2c')],'order':'-id','raw':!![]})[_0x9214('0x1d')](function(_0x784072){if(_0x784072&&_0x784072['plainBody']){_0x5311d4[_0x9214('0x2d')]=_[_0x9214('0x2e')](_0x784072[_0x9214('0x2c')]);}_0x15985d(_0x5311d4);})[_0x9214('0x2f')](function(_0xca4a28){_0x4fc31b(_0xca4a28);});});}function updateMailInteraction(_0x27f904,_0x169a75,_0x1a5dc3,_0x1251b0){return new BPromise(function(_0x39683a,_0x6c510c){return getInteractionUsers(_0x27f904,_0x1a5dc3)['then'](function(_0x28e882){return getInteractionTags(_0x28e882,_0x169a75);})[_0x9214('0x1d')](function(_0x385732){if(_0x1251b0){_0x39683a(getLastMessageText(_0x385732));}else{_0x39683a(_0x385732);}})[_0x9214('0x2f')](function(_0x5044d3){_0x6c510c(_0x5044d3);});});}exports['index']=function(_0xdc3d9a,_0x1d9d72){var _0x3c3e55={},_0x1393bf={},_0x4a4d67={'count':0x0,'rows':[]};var _0x4968ee=_[_0x9214('0x30')](db[_0x9214('0x31')][_0x9214('0x32')],function(_0x2ac8ee){return{'name':_0x2ac8ee['fieldName'],'type':_0x2ac8ee[_0x9214('0x33')]['key']};});_0x1393bf['model']=_['map'](_0x4968ee,_0x9214('0x22'));_0x1393bf[_0x9214('0x34')]=_[_0x9214('0x35')](_0xdc3d9a[_0x9214('0x34')]);_0x1393bf[_0x9214('0x36')]=_['intersection'](_0x1393bf[_0x9214('0x37')],_0x1393bf[_0x9214('0x34')]);_0x3c3e55[_0x9214('0x38')]=_[_0x9214('0x39')](_0x1393bf[_0x9214('0x37')],qs[_0x9214('0x3a')](_0xdc3d9a[_0x9214('0x34')][_0x9214('0x3a')]));_0x3c3e55[_0x9214('0x38')]=_0x3c3e55['attributes'][_0x9214('0x3b')]?_0x3c3e55[_0x9214('0x38')]:_0x1393bf[_0x9214('0x37')];if(!_0xdc3d9a[_0x9214('0x34')][_0x9214('0x3c')](_0x9214('0x3d'))){_0x3c3e55['limit']=qs[_0x9214('0x18')](_0xdc3d9a[_0x9214('0x34')]['limit']);_0x3c3e55[_0x9214('0x16')]=qs[_0x9214('0x16')](_0xdc3d9a[_0x9214('0x34')]['offset']);}_0x3c3e55[_0x9214('0x3e')]=qs[_0x9214('0x3f')](_0xdc3d9a[_0x9214('0x34')][_0x9214('0x3f')]);_0x3c3e55[_0x9214('0x40')]=qs[_0x9214('0x36')](_[_0x9214('0x41')](_0xdc3d9a[_0x9214('0x34')],_0x1393bf['filters']),_0x4968ee);var _0x4280a4=[];var _0x4c75cd=squel[_0x9214('0x42')]()[_0x9214('0x43')]('id')[_0x9214('0x43')](_0x9214('0x22'))[_0x9214('0x43')]('color')['from'](_0x9214('0x44'));var _0x1e3a04=squel[_0x9214('0x42')]()['field'](_0x9214('0x45'))[_0x9214('0x43')](_0x9214('0x46'))[_0x9214('0x43')](_0x9214('0x47'))[_0x9214('0x48')](_0x9214('0x49'),'ui')[_0x9214('0x4a')](_0x9214('0x4b'),'u','u.id\x20=\x20ui.UserId');var _0x3e42b5=squel[_0x9214('0x42')]()[_0x9214('0x48')]('mail_interactions','i')[_0x9214('0x4a')](_0x9214('0x4c'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o','o.id\x20=\x20i.UserId')[_0x9214('0x4a')](_0x9214('0x4d'),'a',_0x9214('0x4e'))[_0x9214('0x4a')](_0x9214('0x4f'),'me',_0x9214('0x50'))[_0x9214('0x4a')]('mail_interaction_has_tags','it',_0x9214('0x51'))[_0x9214('0x4a')](_0x9214('0x44'),'t','t.id\x20=\x20it.TagId');var _0x3cdb52=squel[_0x9214('0x52')]();var _0x34fc32=[];var _0x4ddcb1=squel[_0x9214('0x52')]();var _0x4bc17e;if(_0xdc3d9a[_0x9214('0x34')]['search']){_0x4bc17e=as[_0x9214('0x53')](_0xdc3d9a[_0x9214('0x34')][_0x9214('0x54')]);var _0x281f0c=_0x4bc17e['sqlOperator'];for(var _0x4638=0x0;_0x4638<_0x4bc17e[_0x9214('0x55')]['length'];_0x4638++){var _0x1b199c=_0x4bc17e[_0x9214('0x55')][_0x4638];var _0x49fe02='i';var _0x72fe38=_[_0x9214('0x56')](_0x4968ee,['name',_0x1b199c['field']]);if(!_0x72fe38){switch(_0x1b199c[_0x9214('0x43')]){case _0x9214('0x57'):if(_0x1b199c[_0x9214('0x58')]==0x1){_0x3e42b5[_0x9214('0x59')]('`'+_0x1b199c[_0x9214('0x43')]+'`\x20=\x200');}else{_0x3e42b5[_0x9214('0x59')]('`'+_0x1b199c[_0x9214('0x43')]+_0x9214('0x5a'));}break;case _0x9214('0x5b'):if(_0x1b199c[_0x9214('0x5c')]===_0x9214('0x5d')){if(_0x1b199c['value'][_0x9214('0x27')]('\x20')['length']>0x1){_0x3cdb52[_0x281f0c](_0x9214('0x5e'),qs[_0x9214('0x5f')](_0x1b199c[_0x9214('0x58')]),null);}else{var _0x1e08c8='%'+_0x1b199c[_0x9214('0x58')]+'%';_0x3cdb52[_0x281f0c](_0x9214('0x60'),_0x1e08c8,_0x1e08c8,_0x1e08c8);}}else{_0x72fe38=_[_0x9214('0x56')](_0x4968ee,['name',_0x9214('0x61')]);_0x1b199c[_0x9214('0x43')]='ContactId';_0x4e7c3a=as[_0x9214('0x62')](_0x49fe02,_0x72fe38[_0x9214('0x33')],_0x1b199c);_0x3cdb52[_0x281f0c](_0x4e7c3a['text'],_0x4e7c3a[_0x9214('0x58')][_0x9214('0x63')],_0x4e7c3a[_0x9214('0x58')][_0x9214('0x1f')]);}break;case _0x9214('0x64'):var _0x7ac00e=_0x1b199c[_0x9214('0x58')][_0x9214('0x27')](',')['map'](function(_0x1f4247){return Number(_0x1f4247);});_0x7ac00e[_0x9214('0x28')](function(_0x412e8e){_0x4ddcb1['or'](_0x9214('0x65'),'%,'+_0x412e8e+',%');});_0x34fc32=_[_0x9214('0x66')](_0x34fc32,_0x7ac00e);break;case _0x9214('0x67'):if(_0x1b199c[_0x9214('0x5c')]==='$substring'){_0x3cdb52[_0x281f0c]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x1b199c[_0x9214('0x58')]+'%',null);}else{_0x72fe38=_[_0x9214('0x56')](_0x4968ee,[_0x9214('0x22'),'UserId']);_0x1b199c[_0x9214('0x43')]=_0x9214('0x68');_0x4e7c3a=as[_0x9214('0x62')](_0x49fe02,_0x72fe38[_0x9214('0x33')],_0x1b199c);_0x3cdb52[_0x281f0c](_0x4e7c3a[_0x9214('0x69')],_0x4e7c3a['value'][_0x9214('0x63')],_0x4e7c3a['value'][_0x9214('0x1f')]);}break;case _0x9214('0x2c'):_0x4e7c3a=as[_0x9214('0x62')]('me',null,_0x1b199c);_0x3cdb52[_0x281f0c](_0x4e7c3a[_0x9214('0x69')],_0x4e7c3a[_0x9214('0x58')][_0x9214('0x63')],_0x4e7c3a[_0x9214('0x58')][_0x9214('0x1f')]);break;}}else{var _0x4e7c3a=as['buildExpression'](_0x49fe02,_0x72fe38[_0x9214('0x33')],_0x1b199c);_0x3cdb52[_0x281f0c](_0x4e7c3a[_0x9214('0x69')],_0x4e7c3a[_0x9214('0x58')][_0x9214('0x63')],_0x4e7c3a[_0x9214('0x58')][_0x9214('0x1f')]);}}}else{var _0x21c072=_(_0xdc3d9a[_0x9214('0x34')])[_0x9214('0x35')]()[_0x9214('0x30')](function(_0x4436c6){return _[_0x9214('0x6a')](_0x4968ee,[_0x9214('0x22'),_0x4436c6])?_0x4436c6:undefined;})[_0x9214('0x6b')]()['value']();if(!_[_0x9214('0x6c')](_0x21c072)){_0x21c072[_0x9214('0x28')](function(_0x16c360){if(_0x16c360===_0x9214('0x6d')){_0x3e42b5[_0x9214('0x40')]('i.MailAccountId\x20IN\x20?',[][_0x9214('0x6e')](_0xdc3d9a[_0x9214('0x34')][_0x16c360]));}else if(_0x16c360===_0x9214('0x6f')){var _0x1bbd8c=JSON['parse'](_0xdc3d9a['query'][_0x16c360])[_0x9214('0x70')];var _0x45ddbe=JSON[_0x9214('0x71')](_0xdc3d9a[_0x9214('0x34')][_0x16c360])[_0x9214('0x72')];_0x3e42b5[_0x9214('0x40')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x1bbd8c,_0x45ddbe);}else{if(_0xdc3d9a[_0x9214('0x34')][_0x16c360]===_0x9214('0x73')){_0x3e42b5[_0x9214('0x40')]('i.'+_0x16c360+'\x20IS\x20NULL');}else{_0x3e42b5['where']('i.'+_0x16c360+_0x9214('0x74'),_0xdc3d9a[_0x9214('0x34')][_0x16c360]);}}});}if(_0xdc3d9a[_0x9214('0x34')][_0x9214('0x75')]){if(_0xdc3d9a[_0x9214('0x34')][_0x9214('0x75')]==0x1){_0x3e42b5[_0x9214('0x59')](_0x9214('0x76'));}else{_0x3e42b5[_0x9214('0x59')](_0x9214('0x77'));}}if(_0xdc3d9a[_0x9214('0x34')][_0x9214('0x78')]){_0x34fc32=_[_0x9214('0x79')](_0xdc3d9a[_0x9214('0x34')][_0x9214('0x78')])?_0xdc3d9a['query'][_0x9214('0x78')]:new Array(_0xdc3d9a[_0x9214('0x34')][_0x9214('0x78')]);_0x34fc32['forEach'](function(_0x4623a1){_0x4ddcb1['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4623a1+',%');});}if(_0xdc3d9a['query']['filter']){var _0x144db8=_0xdc3d9a['query'][_0x9214('0x7a')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x144db8)){_0x3cdb52['or']('i.id\x20LIKE\x20?',_0x144db8+'%');}else if(qs[_0x9214('0x7b')](_0x144db8)){_0x3cdb52['or']('c.email\x20LIKE\x20?',_0x144db8+'%');}else{_0x3cdb52['or'](_0x9214('0x7c'),qs[_0x9214('0x5f')](_0x144db8))['or'](_0x9214('0x7d'),qs['getFullTextValue'](_0x144db8));}}}_0x3e42b5[_0x9214('0x40')](_0x3cdb52);_0x3e42b5[_0x9214('0x7e')](_0x9214('0x7f'));var _0x30ea35={'type':db[_0x9214('0x80')]['QueryTypes']['SELECT'],'raw':!![]};var _0x5913c1=_0x3e42b5[_0x9214('0x81')]();_0x5913c1[_0x9214('0x43')](_0x9214('0x7f'));_0x5913c1[_0x9214('0x43')](_0x9214('0x82'),_0x9214('0x57'));if(_0x3c3e55[_0x9214('0x3e')]){_0x3c3e55[_0x9214('0x3e')]['forEach'](function(_0x35e1eb){var _0x46da21=_0x35e1eb[0x0]==='contactName'?_0x35e1eb[0x0]:'i.'+_0x35e1eb[0x0];_0x3e42b5['order'](_0x46da21,_0x35e1eb[0x1]===_0x9214('0x83')?![]:!![]);});}if(!_['isEmpty'](_0x34fc32)){_0x3e42b5['having'](_0x4ddcb1);_0x5913c1[_0x9214('0x40')]('t.id\x20IN\x20?',_0x34fc32);}BPromise[_0x9214('0x84')]()[_0x9214('0x1d')](function(){if(!_0x4bc17e){if(_0xdc3d9a[_0x9214('0x34')][_0x9214('0x6d')])return;_0x5913c1[_0x9214('0x40')]('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x3e42b5[_0x9214('0x40')]('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0xdc3d9a[_0x9214('0x85')]['role']!==_0x9214('0x86'))return;return _0xdc3d9a[_0x9214('0x85')][_0x9214('0x87')]({'attributes':['id'],'raw':!![]})[_0x9214('0x1d')](function(_0x453ecf){if(_['isEmpty'](_0x453ecf)){_0x5913c1[_0x9214('0x40')](_0x9214('0x88'));_0x3e42b5[_0x9214('0x40')]('i.MailAccountId\x20IS\x20NULL');}else{_0x5913c1['where'](_0x9214('0x89'),_[_0x9214('0x30')](_0x453ecf,'id'));_0x3e42b5[_0x9214('0x40')]('i.MailAccountId\x20IN\x20?',_[_0x9214('0x30')](_0x453ecf,'id'));}});})[_0x9214('0x1d')](function(){if(_0xdc3d9a[_0x9214('0x85')][_0x9214('0x8a')]===_0x9214('0x86')&&!_0x4bc17e&&!_0xdc3d9a[_0x9214('0x34')]['MailAccountId'])return[];return db[_0x9214('0x8b')][_0x9214('0x34')](_0x5913c1['toString'](),_0x30ea35);})[_0x9214('0x1d')](function(_0x2a9794){_0x4a4d67[_0x9214('0x19')]=_0x2a9794[_0x9214('0x3b')];if(_0x4a4d67['count']===0x0)return[];return db[_0x9214('0x8b')]['query'](_0x4c75cd['toString'](),_0x30ea35)[_0x9214('0x1d')](function(_0x23b7b6){_0x4280a4=_[_0x9214('0x8c')](_0x23b7b6,'id');_0x30ea35=_[_0x9214('0x8d')](_0x30ea35,{'model':db[_0x9214('0x31')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xdc3d9a[_0x9214('0x34')][_0x9214('0x3a')]){_0x3c3e55['attributes'][_0x9214('0x28')](function(_0x23c466){_0x3e42b5['field']('i.'+_0x23c466);});}else{_0x3e42b5[_0x9214('0x43')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x9214('0x57'));_0x3e42b5[_0x9214('0x43')]('a.key','Account.key');_0x3e42b5[_0x9214('0x43')]('a.mandatoryDisposition',_0x9214('0x8e'));_0x3e42b5[_0x9214('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',_0x9214('0x8f'));_0x3e42b5[_0x9214('0x43')]('i.id');_0x3e42b5[_0x9214('0x43')](_0x9214('0x90'));_0x3e42b5[_0x9214('0x43')](_0x9214('0x91'));_0x3e42b5[_0x9214('0x43')](_0x9214('0x92'));_0x3e42b5[_0x9214('0x43')](_0x9214('0x93'));_0x3e42b5[_0x9214('0x43')](_0x9214('0x94'));_0x3e42b5['field'](_0x9214('0x95'));_0x3e42b5[_0x9214('0x43')](_0x9214('0x96'));_0x3e42b5[_0x9214('0x43')]('i.subject');_0x3e42b5['field'](_0x9214('0x97'));_0x3e42b5[_0x9214('0x43')](_0x9214('0x98'));_0x3e42b5[_0x9214('0x43')](_0x9214('0x99'));_0x3e42b5[_0x9214('0x43')](_0x9214('0x9a'));_0x3e42b5[_0x9214('0x43')](_0x9214('0x9b'));_0x3e42b5[_0x9214('0x43')](_0x9214('0x9c'));_0x3e42b5[_0x9214('0x43')](_0x9214('0x9d'));_0x3e42b5[_0x9214('0x43')](_0x9214('0x9e'));_0x3e42b5[_0x9214('0x43')]('c.firstName',_0x9214('0x9f'));_0x3e42b5[_0x9214('0x43')](_0x9214('0xa0'),_0x9214('0xa1'));_0x3e42b5['field'](_0x9214('0xa2'),_0x9214('0xa3'));_0x3e42b5['field'](_0x9214('0xa4'),_0x9214('0xa5'));_0x3e42b5[_0x9214('0x43')](_0x9214('0xa6'),_0x9214('0xa7'));_0x3e42b5[_0x9214('0x43')]('c.fax',_0x9214('0xa8'));_0x3e42b5['field']('o.fullname',_0x9214('0xa9'));_0x3e42b5[_0x9214('0x43')](_0x9214('0xaa'),_0x9214('0xab'));_0x3e42b5[_0x9214('0x43')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x9214('0x25'));}if(_0x3c3e55[_0x9214('0x18')])_0x3e42b5['limit'](_0x3c3e55[_0x9214('0x18')]);if(_0x3c3e55[_0x9214('0x16')])_0x3e42b5[_0x9214('0x16')](_0x3c3e55['offset']);return db[_0x9214('0x8b')][_0x9214('0x34')](_0x3e42b5[_0x9214('0xac')](),_0x30ea35);})[_0x9214('0x1d')](function(_0x3b5df4){if(_0x3b5df4[_0x9214('0x3b')]>0x0)_0x1e3a04[_0x9214('0x40')](_0x9214('0xad'),_[_0x9214('0x30')](_0x3b5df4,'id'));return db[_0x9214('0x8b')][_0x9214('0x34')](_0x1e3a04[_0x9214('0xac')](),_0x30ea35)[_0x9214('0x1d')](function(_0x432557){var _0x4b3a3d=_['groupBy'](_0x432557,_0x9214('0xae'));var _0x52ab00=[];return db[_0x9214('0xaf')]['findOne']({'attributes':['enableEmailPreview'],'raw':!![]})[_0x9214('0x1d')](function(_0x5d8f4f){var _0x4f9fe3=_0x5d8f4f['enableEmailPreview'];_0x3b5df4['forEach'](function(_0x4038e8){_0x52ab00[_0x9214('0x29')](updateMailInteraction(_0x4038e8,_0x4280a4,_0x4b3a3d,_0x4f9fe3));});return BPromise[_0x9214('0xb0')](_0x52ab00);});});});})[_0x9214('0x1d')](function(_0x2af582){_0x4a4d67['rows']=_0x2af582;return _0x4a4d67;})['then'](respondWithFilteredResult(_0x1d9d72,_0x3c3e55))['catch'](handleError(_0x1d9d72,null));};exports[_0x9214('0xb1')]=function(_0x52af0b,_0x38a628){var _0x25b508={'raw':![],'where':{'id':_0x52af0b[_0x9214('0xb2')]['id']}},_0x42337f={};_0x42337f['model']=_[_0x9214('0x35')](db['MailInteraction'][_0x9214('0x32')]);_0x42337f[_0x9214('0x34')]=_[_0x9214('0x35')](_0x52af0b[_0x9214('0x34')]);_0x42337f[_0x9214('0x36')]=_['intersection'](_0x42337f[_0x9214('0x37')],_0x42337f[_0x9214('0x34')]);_0x25b508[_0x9214('0x38')]=_['intersection'](_0x42337f['model'],qs['fields'](_0x52af0b['query'][_0x9214('0x3a')]));_0x25b508[_0x9214('0x38')]=_0x25b508['attributes'][_0x9214('0x3b')]?_0x25b508[_0x9214('0x38')]:_0x42337f['model'];if(_0x52af0b[_0x9214('0x34')][_0x9214('0xb3')]){_0x25b508[_0x9214('0xb4')]=[{'all':!![]}];}_0x25b508=_[_0x9214('0x8d')]({},_0x25b508,_0x52af0b[_0x9214('0xb5')]);return db['MailInteraction']['find'](_0x25b508)[_0x9214('0x1d')](handleEntityNotFound(_0x38a628,null))['then'](respondWithResult(_0x38a628,null))[_0x9214('0x2f')](handleError(_0x38a628,null));};exports[_0x9214('0xb6')]=function(_0x52269c,_0x18473a){return db[_0x9214('0x31')][_0x9214('0xb6')](_0x52269c[_0x9214('0xb7')],{})[_0x9214('0x1d')](respondWithResult(_0x18473a,0xc9))[_0x9214('0x2f')](handleError(_0x18473a,null));};exports[_0x9214('0x1c')]=function(_0x4518d8,_0x5c5571){if(_0x4518d8[_0x9214('0xb7')]['id']){delete _0x4518d8[_0x9214('0xb7')]['id'];}return db[_0x9214('0x31')][_0x9214('0x56')]({'where':{'id':_0x4518d8[_0x9214('0xb2')]['id']}})[_0x9214('0x1d')](handleEntityNotFound(_0x5c5571,null))[_0x9214('0x1d')](saveUpdates(_0x4518d8[_0x9214('0xb7')],null))['then'](respondWithResult(_0x5c5571,null))['catch'](handleError(_0x5c5571,null));};exports[_0x9214('0x1e')]=function(_0x4b88fa,_0x22868e){return db[_0x9214('0x31')][_0x9214('0x56')]({'where':{'id':_0x4b88fa[_0x9214('0xb2')]['id']}})[_0x9214('0x1d')](handleEntityNotFound(_0x22868e,null))[_0x9214('0x1d')](removeEntity(_0x22868e,null))[_0x9214('0x2f')](handleError(_0x22868e,null));};exports[_0x9214('0xb8')]=function(_0x4bcd78,_0x4d048a){return db[_0x9214('0x31')][_0x9214('0xb8')]()[_0x9214('0x1d')](respondWithResult(_0x4d048a,null))[_0x9214('0x2f')](handleError(_0x4d048a,null));};exports[_0x9214('0xb9')]=function(_0x1cd308,_0x1ae6fd){return db[_0x9214('0x2a')]['find']({'where':{'id':_0x1cd308[_0x9214('0xb2')]['id']}})[_0x9214('0x1d')](handleEntityNotFound(_0x1ae6fd,null))[_0x9214('0x1d')](function(_0xa114a2){if(_0xa114a2){return _0xa114a2[_0x9214('0xb9')](_0x1cd308[_0x9214('0xb7')][_0x9214('0xba')],_['omit'](_0x1cd308['body'],[_0x9214('0xba'),'id'])||{});}})[_0x9214('0x1d')](respondWithResult(_0x1ae6fd,null))[_0x9214('0x2f')](handleError(_0x1ae6fd,null));};exports[_0x9214('0xbb')]=function(_0x392de7,_0x20ac52){var _0x17a2e8={'raw':![],'where':{}};var _0x9d069d={};var _0x2c39de={'count':0x0,'rows':[]};return db[_0x9214('0x31')]['findOne']({'where':{'id':_0x392de7[_0x9214('0xb2')]['id']}})[_0x9214('0x1d')](handleEntityNotFound(_0x20ac52,null))[_0x9214('0x1d')](function(_0x573df6){if(_0x573df6){_0x9d069d['model']=_['keys'](db[_0x9214('0x2a')][_0x9214('0x32')]);_0x9d069d[_0x9214('0x34')]=_[_0x9214('0x35')](_0x392de7['query']);_0x9d069d[_0x9214('0x36')]=_[_0x9214('0x39')](_0x9d069d[_0x9214('0x37')],_0x9d069d[_0x9214('0x34')]);_0x17a2e8['attributes']=_[_0x9214('0x39')](_0x9d069d[_0x9214('0x37')],qs[_0x9214('0x3a')](_0x392de7['query'][_0x9214('0x3a')]));_0x17a2e8[_0x9214('0x38')]=_0x17a2e8[_0x9214('0x38')][_0x9214('0x3b')]?_0x17a2e8[_0x9214('0x38')]:_0x9d069d[_0x9214('0x37')];if(!_0x392de7[_0x9214('0x34')]['hasOwnProperty'](_0x9214('0x3d'))){_0x17a2e8[_0x9214('0x18')]=qs[_0x9214('0x18')](_0x392de7[_0x9214('0x34')][_0x9214('0x18')]);_0x17a2e8[_0x9214('0x16')]=qs[_0x9214('0x16')](_0x392de7[_0x9214('0x34')][_0x9214('0x16')]);}_0x17a2e8[_0x9214('0x3e')]=qs['sort'](_0x392de7[_0x9214('0x34')][_0x9214('0x3f')]);_0x17a2e8[_0x9214('0x40')]=qs[_0x9214('0x36')](_[_0x9214('0x41')](_0x392de7[_0x9214('0x34')],_0x9d069d[_0x9214('0x36')]));_0x17a2e8[_0x9214('0x40')][_0x9214('0xae')]=_0x573df6['id'];if(_0x392de7[_0x9214('0x34')][_0x9214('0x7a')]){_0x17a2e8[_0x9214('0x40')]=_[_0x9214('0x8d')](_0x17a2e8[_0x9214('0x40')],{'$or':_['map'](_0x17a2e8[_0x9214('0x38')],function(_0x57eba4){var _0x29bcb4={};_0x29bcb4[_0x57eba4]={'$like':'%'+_0x392de7[_0x9214('0x34')]['filter']+'%'};return _0x29bcb4;})});}if(_0x392de7[_0x9214('0x34')][_0x9214('0x70')]){var _0x32c10b=_0x392de7[_0x9214('0x34')][_0x9214('0x70')][_0x9214('0x27')](',');var _0xa5c8d9={};_0xa5c8d9[_0x32c10b[0x0]]={'$gte':moment(_0x32c10b[0x1])[_0x9214('0xbc')]('YYYY-MM-DD\x20HH:mm:ss')};_0x17a2e8['where']=_['merge'](_0x17a2e8[_0x9214('0x40')],_0xa5c8d9);}_0x17a2e8=_['merge']({},_0x17a2e8,_0x392de7[_0x9214('0xb5')]);return db[_0x9214('0x2a')]['count']({'where':_0x17a2e8[_0x9214('0x40')]})[_0x9214('0x1d')](function(_0x1f40a9){_0x2c39de[_0x9214('0x19')]=_0x1f40a9;if(_0x392de7['query']['includeAll']){_0x17a2e8['include']=[{'all':!![]}];}return db[_0x9214('0x2a')][_0x9214('0xbd')](_0x17a2e8);})[_0x9214('0x1d')](function(_0x4e4bc6){if(_0x392de7[_0x9214('0x34')][_0x9214('0xbe')]===_0x9214('0xbf')){for(var _0x3d4bc7=0x0;_0x3d4bc7<_0x4e4bc6['length'];_0x3d4bc7++){_0x4e4bc6[_0x3d4bc7][_0x9214('0xb7')]=juice(_0x4e4bc6[_0x3d4bc7][_0x9214('0xb7')]);}}_0x2c39de['rows']=_0x4e4bc6;return _0x2c39de;});}})[_0x9214('0x1d')](respondWithFilteredResult(_0x20ac52,_0x17a2e8))[_0x9214('0x2f')](handleError(_0x20ac52,null));};exports['addTags']=function(_0x5406ed,_0x23eac7){return db[_0x9214('0x31')][_0x9214('0x56')]({'where':{'id':_0x5406ed['params']['id']}})[_0x9214('0x1d')](handleEntityNotFound(_0x23eac7,null))[_0x9214('0x1d')](function(_0x3893f6){if(_0x3893f6){return _0x3893f6[_0x9214('0xc0')](_0x5406ed[_0x9214('0xb7')][_0x9214('0xba')],_[_0x9214('0xc1')](_0x5406ed[_0x9214('0xb7')],[_0x9214('0xba'),'id'])||{})[_0x9214('0xc2')](function(){return db[_0x9214('0x64')][_0x9214('0xbd')]({'attributes':['id','name','color'],'where':{'id':_0x5406ed['body'][_0x9214('0xba')]}});})[_0x9214('0x1d')](function(_0x27cb5f){socket[_0x9214('0xc3')](_0x9214('0xc4'),{'id':Number(_0x5406ed[_0x9214('0xb2')]['id']),'tags':_0x27cb5f||[]});return{'id':Number(_0x5406ed[_0x9214('0xb2')]['id']),'tags':_0x27cb5f||[]};});}})[_0x9214('0x1d')](respondWithResult(_0x23eac7,null))[_0x9214('0x2f')](handleError(_0x23eac7,null));};exports[_0x9214('0xc5')]=function(_0x1b7884,_0x2ecbbf){return db[_0x9214('0x31')][_0x9214('0x56')]({'where':{'id':_0x1b7884[_0x9214('0xb2')]['id']}})[_0x9214('0x1d')](handleEntityNotFound(_0x2ecbbf,null))['then'](function(_0x3e46b3){if(_0x3e46b3){return _0x3e46b3[_0x9214('0xc5')](_0x1b7884['query']['ids']);}})[_0x9214('0x1d')](respondWithStatusCode(_0x2ecbbf,null))[_0x9214('0x2f')](handleError(_0x2ecbbf,null));};exports[_0x9214('0xc6')]=function(_0x412871,_0xeda76d){var _0x1ef6ea=moment()['unix']()['toString']();var _0x394735=path[_0x9214('0xc7')](config[_0x9214('0xc8')],'server',_0x9214('0xc9'),_0x9214('0xca'));var _0x2aa315=path[_0x9214('0xc7')](config[_0x9214('0xc8')],_0x9214('0xcb'),_0x9214('0xc9'),_0x9214('0xcc'));var _0x5c7b8c=path[_0x9214('0xc7')](_0x394735,_0x1ef6ea);var _0x39aec2=util[_0x9214('0xbc')](_0x9214('0xcd'),_0x412871['params']['id'],_0x1ef6ea);var _0x442d81=path[_0x9214('0xc7')](_0x394735,_0x39aec2);var _0x18f079=[];if(_0x412871['query'][_0x9214('0xcc')]){_0x18f079['push']({'model':db[_0x9214('0xce')],'as':'Attachments','raw':!![]});}var _0xdc9ed=[{'model':db[_0x9214('0x2a')],'as':_0x9214('0xcf'),'attributes':['id',_0x9214('0xb7'),'from','to','cc',_0x9214('0xd0'),_0x9214('0xd1'),_0x9214('0x6f')],'where':{'secret':![]},'order':qs[_0x9214('0x3f')]('id'),'include':_0x18f079}];return db[_0x9214('0x31')][_0x9214('0x56')]({'where':{'id':_0x412871[_0x9214('0xb2')]['id']},'include':_0xdc9ed})[_0x9214('0x1d')](handleEntityNotFound(_0xeda76d,null))[_0x9214('0x1d')](function(_0x42c150){if(_0x42c150&&_0x42c150[_0x9214('0xcf')]){var _0x258c29=_0x42c150[_0x9214('0xd2')]({'plain':!![]});fs[_0x9214('0xd3')](_0x5c7b8c);return BPromise[_0x9214('0xd4')](_0x258c29['Messages'],function(_0x3fa2b0,_0x442c6d){var _0x165622={'from':_0x3fa2b0[_0x9214('0x48')],'to':_0x3fa2b0['to'],'subject':_0x3fa2b0['subject'],'html':htmlEntities['decode'](_0x3fa2b0[_0x9214('0xb7')]),'headers':{'Date':moment(_0x3fa2b0[_0x9214('0x6f')])[_0x9214('0xbc')](_0x9214('0xd5'))},'attachments':[]};if(_0x3fa2b0['cc']){_0x165622[_0x9214('0xd6')]['Cc']=_0x3fa2b0['cc'];}if(_0x3fa2b0['bcc']){_0x165622[_0x9214('0xd6')][_0x9214('0xd7')]=_0x3fa2b0[_0x9214('0xd0')];}return new BPromise(function(_0x4258a8,_0x1b5d72){if(_0x3fa2b0[_0x9214('0xd8')]){for(var _0x57940f=0x0;_0x57940f<_0x3fa2b0['Attachments'][_0x9214('0x3b')];_0x57940f++){var _0x1f0018=_0x3fa2b0[_0x9214('0xd8')][_0x57940f];var _0x3750a7=path[_0x9214('0xc7')](_0x2aa315,_0x1f0018[_0x9214('0xd9')]);if(fs['existsSync'](_0x3750a7)){_0x165622[_0x9214('0xcc')][_0x9214('0x29')]({'name':_0x1f0018[_0x9214('0x22')],'contentType':_0x1f0018[_0x9214('0x33')],'data':fs['readFileSync'](_0x3750a7)});}}}emlformat[_0x9214('0xda')](_0x165622,function(_0x54890e,_0x20d835){if(_0x54890e)return _0x1b5d72(_0x54890e);fs[_0x9214('0xdb')](path['join'](_0x5c7b8c,util['format']('message%d.eml',_0x442c6d)),_0x20d835);return _0x4258a8(_0x20d835);});});})[_0x9214('0x1d')](function(){return new BPromise(function(_0x496ad5,_0x1a3715){zipdir(_0x5c7b8c,{'saveTo':_0x442d81},function(_0x58407f,_0x52880f){if(_0x58407f)return _0x1a3715(_0x58407f);return _0x496ad5(_0x52880f);});})['then'](function(){return new BPromise(function(_0x124d98,_0x30132b){rimraf(_0x5c7b8c,function(_0x2971d9){if(_0x2971d9)_0x30132b(_0x2971d9);return _0x124d98();});});})[_0x9214('0x1d')](function(){return _0xeda76d['download'](_0x442d81,_0x39aec2,function(_0x3cb7c5){if(!_0x3cb7c5)fs[_0x9214('0xdc')](_0x442d81);});});});}else{return _0xeda76d[_0x9214('0x13')](0xc8);}})['catch'](handleError(_0xeda76d,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index aa8546e..8d0f8fd 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 _0xa720=['emit','catch','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save','update','getUsers','then','Users','map','findAll','setDataValue','length'];(function(_0x16dcc2,_0x4aff5f){var _0x2c41f7=function(_0x184c39){while(--_0x184c39){_0x16dcc2['push'](_0x16dcc2['shift']());}};_0x2c41f7(++_0x4aff5f);}(_0xa720,0x155));var _0x0a72=function(_0x58de10,_0x1442e1){_0x58de10=_0x58de10-0x0;var _0xfdd33f=_0xa720[_0x58de10];return _0xfdd33f;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0x0a72('0x0'))['db']['MailInteraction'];var MailMessage=require(_0x0a72('0x0'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x0a72('0x1')](0x0);var events={'afterCreate':_0x0a72('0x2'),'afterUpdate':_0x0a72('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4da34c){return function(_0x20ae41,_0x2c1159,_0x525b94){_0x20ae41[_0x0a72('0x4')]({'attributes':['id'],'raw':!![]})[_0x0a72('0x5')](function(_0x321ce0){_0x20ae41['setDataValue'](_0x0a72('0x6'),_0x321ce0[_0x0a72('0x7')](function(_0xb8fbc6){return{'id':_0xb8fbc6['id']};}));return MailMessage[_0x0a72('0x8')]({'where':{'MailInteractionId':_0x20ae41['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0a72('0x5')](function(_0x4588a8){_0x20ae41[_0x0a72('0x9')]('unreadMessages',_0x4588a8[_0x0a72('0xa')]);MailInteractionEvents[_0x0a72('0xb')](_0x4da34c+':'+_0x20ae41['id'],_0x20ae41);MailInteractionEvents['emit'](_0x4da34c,_0x20ae41);_0x525b94(null);})[_0x0a72('0xc')](_0x525b94(null));};}for(var e in events){if(events[_0x0a72('0xd')](e)){var event=events[e];MailInteraction[_0x0a72('0xe')](e,emitEvent(event));}}module[_0x0a72('0xf')]=MailInteractionEvents; \ No newline at end of file +var _0x3fa8=['findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map'];(function(_0x406385,_0xfdac3c){var _0xe94047=function(_0x1fb1fd){while(--_0x1fb1fd){_0x406385['push'](_0x406385['shift']());}};_0xe94047(++_0xfdac3c);}(_0x3fa8,0x183));var _0x83fa=function(_0x230471,_0x10441f){_0x230471=_0x230471-0x0;var _0x5dd908=_0x3fa8[_0x230471];return _0x5dd908;};'use strict';var EventEmitter=require(_0x83fa('0x0'));var MailInteraction=require(_0x83fa('0x1'))['db']['MailInteraction'];var MailMessage=require(_0x83fa('0x1'))['db'][_0x83fa('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x83fa('0x3')](0x0);var events={'afterCreate':_0x83fa('0x4'),'afterUpdate':_0x83fa('0x5'),'afterDestroy':_0x83fa('0x6')};function emitEvent(_0x23a58e){return function(_0x521e9e,_0x4a8c06,_0x17b1e8){_0x521e9e[_0x83fa('0x7')]({'attributes':['id'],'raw':!![]})[_0x83fa('0x8')](function(_0x36b8e7){_0x521e9e[_0x83fa('0x9')](_0x83fa('0xa'),_0x36b8e7[_0x83fa('0xb')](function(_0xaa9a08){return{'id':_0xaa9a08['id']};}));return MailMessage[_0x83fa('0xc')]({'where':{'MailInteractionId':_0x521e9e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x83fa('0x8')](function(_0x5ef870){_0x521e9e[_0x83fa('0x9')](_0x83fa('0xd'),_0x5ef870[_0x83fa('0xe')]);MailInteractionEvents[_0x83fa('0xf')](_0x23a58e+':'+_0x521e9e['id'],_0x521e9e);MailInteractionEvents['emit'](_0x23a58e,_0x521e9e);_0x17b1e8(null);})[_0x83fa('0x10')](_0x17b1e8(null));};}for(var e in events){if(events[_0x83fa('0x11')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x83fa('0x12')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index e69187e..2e1dcd6 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 _0x5dd1=['request-promise','path','rimraf','../../config/environment','exports','MailInteraction','mail_interactions','subject','FULLTEXT','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','format','changed','closed','closedAt','models','get','update','then','catch','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x55d484,_0x2303ae){var _0x4ff847=function(_0x29abef){while(--_0x29abef){_0x55d484['push'](_0x55d484['shift']());}};_0x4ff847(++_0x2303ae);}(_0x5dd1,0x166));var _0x15dd=function(_0x46b1fa,_0x182fdd){_0x46b1fa=_0x46b1fa-0x0;var _0x2cf8fb=_0x5dd1[_0x46b1fa];return _0x2cf8fb;};'use strict';var _=require(_0x15dd('0x0'));var util=require(_0x15dd('0x1'));var logger=require(_0x15dd('0x2'))(_0x15dd('0x3'));var moment=require(_0x15dd('0x4'));var BPromise=require(_0x15dd('0x5'));var rp=require(_0x15dd('0x6'));var fs=require('fs');var path=require(_0x15dd('0x7'));var rimraf=require(_0x15dd('0x8'));var config=require(_0x15dd('0x9'));var attributes=require('./mailInteraction.attributes');module[_0x15dd('0xa')]=function(_0x222549,_0x543826){return _0x222549['define'](_0x15dd('0xb'),attributes,{'tableName':_0x15dd('0xc'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x15dd('0xd'),'to'],'type':_0x15dd('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x58717a,_0xdb88d6,_0x1176c1){if(_0x58717a[_0x15dd('0xf')]){_0x58717a[_0x15dd('0x10')]=moment()['format'](_0x15dd('0x11'));}if(_0x58717a['closed']){_0x58717a['closedAt']=moment()[_0x15dd('0x12')](_0x15dd('0x11'));}_0x1176c1(null,_0xdb88d6);},'beforeUpdate':function(_0x4a6767,_0x5c244c,_0x1ab81a){if(_0x4a6767[_0x15dd('0x13')](_0x15dd('0xf'))){_0x4a6767[_0x15dd('0x10')]=_0x4a6767[_0x15dd('0xf')]?moment()['format'](_0x15dd('0x11')):null;}if(_0x4a6767['changed'](_0x15dd('0x14'))){_0x4a6767[_0x15dd('0x15')]=moment()[_0x15dd('0x12')](_0x15dd('0x11'));_0x4a6767[_0x15dd('0xf')]=null;_0x4a6767[_0x15dd('0x10')]=null;}_0x1ab81a(null,_0x4a6767);},'afterUpdate':function(_0xc01c64,_0x597db4,_0x375512){var _0x3f324c=_0x222549[_0x15dd('0x16')];var _0x3af8ee=_0xc01c64[_0x15dd('0x17')]({'plain':!![]});if(_0x3af8ee[_0x15dd('0x14')]){return _0x3f324c['MailMessage'][_0x15dd('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x3af8ee['id']}})[_0x15dd('0x19')](function(){_0x375512();})[_0x15dd('0x1a')](function(_0x569781){_0x375512(_0x569781);});}else{_0x375512();}}},'charset':'utf8mb4','collate':_0x15dd('0x1b')});}; \ No newline at end of file +var _0x5769=['FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closedAt','changed','closed','MailMessage','update','then','utf8mb4','utf8mb4_unicode_ci','lodash','bluebird','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','subject'];(function(_0x107502,_0x302aba){var _0x22b9af=function(_0x231bb8){while(--_0x231bb8){_0x107502['push'](_0x107502['shift']());}};_0x22b9af(++_0x302aba);}(_0x5769,0x85));var _0x9576=function(_0x2b285c,_0x4682cd){_0x2b285c=_0x2b285c-0x0;var _0x5a38cf=_0x5769[_0x2b285c];return _0x5a38cf;};'use strict';var _=require(_0x9576('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x9576('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9576('0x2'));var rimraf=require(_0x9576('0x3'));var config=require(_0x9576('0x4'));var attributes=require(_0x9576('0x5'));module[_0x9576('0x6')]=function(_0x8d27e6,_0x11115a){return _0x8d27e6[_0x9576('0x7')](_0x9576('0x8'),attributes,{'tableName':_0x9576('0x9'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x9576('0xa'),'to'],'type':_0x9576('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x17b06d,_0x2d70c7,_0x4d9008){if(_0x17b06d[_0x9576('0xc')]){_0x17b06d[_0x9576('0xd')]=moment()[_0x9576('0xe')](_0x9576('0xf'));}if(_0x17b06d['closed']){_0x17b06d[_0x9576('0x10')]=moment()[_0x9576('0xe')](_0x9576('0xf'));}_0x4d9008(null,_0x2d70c7);},'beforeUpdate':function(_0x5a38cb,_0x31991e,_0x52b4ac){if(_0x5a38cb[_0x9576('0x11')](_0x9576('0xc'))){_0x5a38cb[_0x9576('0xd')]=_0x5a38cb['substatus']?moment()[_0x9576('0xe')](_0x9576('0xf')):null;}if(_0x5a38cb[_0x9576('0x11')](_0x9576('0x12'))){_0x5a38cb[_0x9576('0x10')]=moment()[_0x9576('0xe')](_0x9576('0xf'));_0x5a38cb[_0x9576('0xc')]=null;_0x5a38cb[_0x9576('0xd')]=null;}_0x52b4ac(null,_0x5a38cb);},'afterUpdate':function(_0x4173b5,_0xd29e8a,_0x2b7397){var _0x2eba6b=_0x8d27e6['models'];var _0xffcd05=_0x4173b5['get']({'plain':!![]});if(_0xffcd05[_0x9576('0x12')]){return _0x2eba6b[_0x9576('0x13')][_0x9576('0x14')]({'read':!![]},{'where':{'MailInteractionId':_0xffcd05['id']}})[_0x9576('0x15')](function(){_0x2b7397();})['catch'](function(_0x3bbce0){_0x2b7397(_0x3bbce0);});}else{_0x2b7397();}}},'charset':_0x9576('0x16'),'collate':_0x9576('0x17')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 3989245..c6fbed8 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 _0xba6f=['error','code','message','result','catch','UpdateMailInteraction','update','body','options','raw','debug','AddTagsToMailInteraction','find','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailInteraction.socket','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0xba6f,0x1bf));var _0xfba6=function(_0x192b6f,_0x603378){_0x192b6f=_0x192b6f-0x0;var _0x30f545=_0xba6f[_0x192b6f];return _0x30f545;};'use strict';var _=require('lodash');var util=require(_0xfba6('0x0'));var moment=require(_0xfba6('0x1'));var BPromise=require(_0xfba6('0x2'));var rs=require(_0xfba6('0x3'));var fs=require('fs');var Redis=require(_0xfba6('0x4'));var db=require(_0xfba6('0x5'))['db'];var utils=require(_0xfba6('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xfba6('0x7'));var jayson=require(_0xfba6('0x8'));var client=jayson[_0xfba6('0x9')][_0xfba6('0xa')]({'port':0x232a});config[_0xfba6('0xb')]=_[_0xfba6('0xc')](config[_0xfba6('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xfba6('0xd'))(new Redis(config[_0xfba6('0xb')]));require(_0xfba6('0xe'))['register'](socket);function respondWithRpcPromise(_0x32247a,_0x561a1b,_0x355f9b){return new BPromise(function(_0x53547f,_0x1aec25){return client[_0xfba6('0xf')](_0x32247a,_0x355f9b)[_0xfba6('0x10')](function(_0xaeb12){logger[_0xfba6('0x11')](_0xfba6('0x12'),_0x561a1b,_0xfba6('0x13'));logger['debug']('MailInteraction,\x20%s,\x20%s,\x20%s',_0x561a1b,'request\x20sent',JSON[_0xfba6('0x14')](_0xaeb12));if(_0xaeb12[_0xfba6('0x15')]){if(_0xaeb12[_0xfba6('0x15')][_0xfba6('0x16')]===0x1f4){logger[_0xfba6('0x15')](_0xfba6('0x12'),_0x561a1b,_0xaeb12[_0xfba6('0x15')]['message']);return _0x1aec25(_0xaeb12[_0xfba6('0x15')][_0xfba6('0x17')]);}logger[_0xfba6('0x15')]('MailInteraction,\x20%s,\x20%s',_0x561a1b,_0xaeb12['error']['message']);return _0x53547f(_0xaeb12['error']['message']);}else{logger['info'](_0xfba6('0x12'),_0x561a1b,_0xfba6('0x13'));_0x53547f(_0xaeb12[_0xfba6('0x18')][_0xfba6('0x17')]);}})[_0xfba6('0x19')](function(_0x5a0d0d){logger[_0xfba6('0x15')]('MailInteraction,\x20%s,\x20%s',_0x561a1b,_0x5a0d0d);_0x1aec25(_0x5a0d0d);});});}exports[_0xfba6('0x1a')]=function(_0x2ddc51){var _0x4ef3f2=this;return new Promise(function(_0x349e04,_0x5287f4){return db['MailInteraction'][_0xfba6('0x1b')](_0x2ddc51[_0xfba6('0x1c')],{'raw':_0x2ddc51[_0xfba6('0x1d')]?_0x2ddc51[_0xfba6('0x1d')][_0xfba6('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ddc51[_0xfba6('0x1d')]?_0x2ddc51['options']['where']||null:null,'attributes':_0x2ddc51[_0xfba6('0x1d')]?_0x2ddc51[_0xfba6('0x1d')]['attributes']||null:null,'limit':_0x2ddc51['options']?_0x2ddc51[_0xfba6('0x1d')]['limit']||null:null})[_0xfba6('0x10')](function(_0x322039){logger['info'](_0xfba6('0x1a'),_0x2ddc51);logger[_0xfba6('0x1f')](_0xfba6('0x1a'),_0x2ddc51,JSON[_0xfba6('0x14')](_0x322039));_0x349e04(_0x322039);})[_0xfba6('0x19')](function(_0xf60403){logger[_0xfba6('0x15')](_0xfba6('0x1a'),_0xf60403[_0xfba6('0x17')],_0x2ddc51);_0x5287f4(_0x4ef3f2[_0xfba6('0x15')](0x1f4,_0xf60403[_0xfba6('0x17')]));});});};exports[_0xfba6('0x20')]=function(_0xf97909){return new Promise(function(_0x3e9c35,_0x24cb31){return db['MailInteraction'][_0xfba6('0x21')]({'where':_0xf97909[_0xfba6('0x1d')]?_0xf97909['options']['where']||null:null})[_0xfba6('0x10')](function(_0x140ec3){if(_0x140ec3){return _0x140ec3[_0xfba6('0x22')](_0xf97909['body'][_0xfba6('0x23')],_[_0xfba6('0x24')](_0xf97909[_0xfba6('0x1c')],[_0xfba6('0x23'),'id'])||{});}})[_0xfba6('0x25')](function(_0x441d45){logger[_0xfba6('0x11')](_0xfba6('0x26'),_0xf97909);logger[_0xfba6('0x1f')](_0xfba6('0x26'),_0xf97909,JSON[_0xfba6('0x14')](_0x441d45));_0x3e9c35(_0x441d45);})['catch'](function(_0x4b241e){logger[_0xfba6('0x15')](_0xfba6('0x26'),_0x4b241e[_0xfba6('0x17')],_0xf97909);_0x24cb31(_this['error'](0x1f4,_0x4b241e[_0xfba6('0x17')]));});});}; \ No newline at end of file +var _0x4d49=['rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','UpdateMailInteraction','MailInteraction','body','options','raw','limit','stringify','AddTagsToMailInteraction','find','where','addTags','ids','omit','spread','AddTags','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1ff5cb,_0x256a51){var _0x4b93e3=function(_0x154f90){while(--_0x154f90){_0x1ff5cb['push'](_0x1ff5cb['shift']());}};_0x4b93e3(++_0x256a51);}(_0x4d49,0x141));var _0x94d4=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x4d49[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0x94d4('0x0'));var moment=require('moment');var BPromise=require(_0x94d4('0x1'));var rs=require(_0x94d4('0x2'));var fs=require('fs');var Redis=require(_0x94d4('0x3'));var db=require(_0x94d4('0x4'))['db'];var utils=require(_0x94d4('0x5'));var logger=require(_0x94d4('0x6'))(_0x94d4('0x7'));var config=require(_0x94d4('0x8'));var jayson=require(_0x94d4('0x9'));var client=jayson['client'][_0x94d4('0xa')]({'port':0x232a});config[_0x94d4('0xb')]=_[_0x94d4('0xc')](config[_0x94d4('0xb')],{'host':_0x94d4('0xd'),'port':0x18eb});var socket=require(_0x94d4('0xe'))(new Redis(config['redis']));require(_0x94d4('0xf'))[_0x94d4('0x10')](socket);function respondWithRpcPromise(_0x562265,_0x23ef86,_0x283f63){return new BPromise(function(_0xd7820d,_0x2720dd){return client['request'](_0x562265,_0x283f63)[_0x94d4('0x11')](function(_0xe7f878){logger[_0x94d4('0x12')](_0x94d4('0x13'),_0x23ef86,_0x94d4('0x14'));logger[_0x94d4('0x15')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x23ef86,'request\x20sent',JSON['stringify'](_0xe7f878));if(_0xe7f878[_0x94d4('0x16')]){if(_0xe7f878[_0x94d4('0x16')]['code']===0x1f4){logger[_0x94d4('0x16')](_0x94d4('0x13'),_0x23ef86,_0xe7f878['error'][_0x94d4('0x17')]);return _0x2720dd(_0xe7f878['error'][_0x94d4('0x17')]);}logger['error']('MailInteraction,\x20%s,\x20%s',_0x23ef86,_0xe7f878['error'][_0x94d4('0x17')]);return _0xd7820d(_0xe7f878[_0x94d4('0x16')][_0x94d4('0x17')]);}else{logger['info']('MailInteraction,\x20%s,\x20%s',_0x23ef86,'request\x20sent');_0xd7820d(_0xe7f878[_0x94d4('0x18')][_0x94d4('0x17')]);}})[_0x94d4('0x19')](function(_0x47b760){logger[_0x94d4('0x16')](_0x94d4('0x13'),_0x23ef86,_0x47b760);_0x2720dd(_0x47b760);});});}exports[_0x94d4('0x1a')]=function(_0x58fbb2){var _0x1d61b7=this;return new Promise(function(_0x3e1482,_0x38486e){return db[_0x94d4('0x1b')]['update'](_0x58fbb2[_0x94d4('0x1c')],{'raw':_0x58fbb2['options']?_0x58fbb2[_0x94d4('0x1d')][_0x94d4('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58fbb2[_0x94d4('0x1d')]?_0x58fbb2[_0x94d4('0x1d')]['where']||null:null,'attributes':_0x58fbb2[_0x94d4('0x1d')]?_0x58fbb2[_0x94d4('0x1d')]['attributes']||null:null,'limit':_0x58fbb2['options']?_0x58fbb2[_0x94d4('0x1d')][_0x94d4('0x1f')]||null:null})[_0x94d4('0x11')](function(_0x4af43d){logger[_0x94d4('0x12')]('UpdateMailInteraction',_0x58fbb2);logger[_0x94d4('0x15')]('UpdateMailInteraction',_0x58fbb2,JSON[_0x94d4('0x20')](_0x4af43d));_0x3e1482(_0x4af43d);})[_0x94d4('0x19')](function(_0x22f926){logger[_0x94d4('0x16')](_0x94d4('0x1a'),_0x22f926[_0x94d4('0x17')],_0x58fbb2);_0x38486e(_0x1d61b7['error'](0x1f4,_0x22f926[_0x94d4('0x17')]));});});};exports[_0x94d4('0x21')]=function(_0x36efa4){return new Promise(function(_0x36215d,_0x2c22c0){return db[_0x94d4('0x1b')][_0x94d4('0x22')]({'where':_0x36efa4[_0x94d4('0x1d')]?_0x36efa4[_0x94d4('0x1d')][_0x94d4('0x23')]||null:null})['then'](function(_0x27aa72){if(_0x27aa72){return _0x27aa72[_0x94d4('0x24')](_0x36efa4['body'][_0x94d4('0x25')],_[_0x94d4('0x26')](_0x36efa4[_0x94d4('0x1c')],[_0x94d4('0x25'),'id'])||{});}})[_0x94d4('0x27')](function(_0x397891){logger[_0x94d4('0x12')](_0x94d4('0x28'),_0x36efa4);logger[_0x94d4('0x15')](_0x94d4('0x28'),_0x36efa4,JSON[_0x94d4('0x20')](_0x397891));_0x36215d(_0x397891);})[_0x94d4('0x19')](function(_0x3ec6b1){logger[_0x94d4('0x16')](_0x94d4('0x28'),_0x3ec6b1[_0x94d4('0x17')],_0x36efa4);_0x2c22c0(_this[_0x94d4('0x16')](0x1f4,_0x3ec6b1[_0x94d4('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index fb2c06d..4031034 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 _0xcbb8=['update','emit','removeListener','mailInteraction:','./mailInteraction.events','save','remove'];(function(_0x8ee701,_0x44ea16){var _0x1919ee=function(_0x3b8ff4){while(--_0x3b8ff4){_0x8ee701['push'](_0x8ee701['shift']());}};_0x1919ee(++_0x44ea16);}(_0xcbb8,0x90));var _0x8cbb=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xcbb8[_0x4d8ed9];return _0x1e2140;};'use strict';var MailInteractionEvents=require(_0x8cbb('0x0'));var events=[_0x8cbb('0x1'),_0x8cbb('0x2'),_0x8cbb('0x3')];function createListener(_0x59b2bd,_0x36a73e){return function(_0x5a24ec){_0x36a73e[_0x8cbb('0x4')](_0x59b2bd,_0x5a24ec);};}function removeListener(_0x2c49d2,_0x257ea5){return function(){MailInteractionEvents[_0x8cbb('0x5')](_0x2c49d2,_0x257ea5);};}exports['register']=function(_0xe51af3){for(var _0x489e6a=0x0,_0x1bb6cb=events['length'];_0x489e6a<_0x1bb6cb;_0x489e6a++){var _0x5c9daf=events[_0x489e6a];var _0x28b3b0=createListener(_0x8cbb('0x6')+_0x5c9daf,_0xe51af3);MailInteractionEvents['on'](_0x5c9daf,_0x28b3b0);}}; \ No newline at end of file +var _0x6ed3=['register','length','mailInteraction:','./mailInteraction.events','save','remove','update','emit'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x6ed3,0xd3));var _0x36ed=function(_0x246779,_0x290e3e){_0x246779=_0x246779-0x0;var _0x4d1c02=_0x6ed3[_0x246779];return _0x4d1c02;};'use strict';var MailInteractionEvents=require(_0x36ed('0x0'));var events=[_0x36ed('0x1'),_0x36ed('0x2'),_0x36ed('0x3')];function createListener(_0x1a7cb4,_0x46ccac){return function(_0x2e7cf0){_0x46ccac[_0x36ed('0x4')](_0x1a7cb4,_0x2e7cf0);};}function removeListener(_0x5a2557,_0xa752e8){return function(){MailInteractionEvents['removeListener'](_0x5a2557,_0xa752e8);};}exports[_0x36ed('0x5')]=function(_0x3c7779){for(var _0x2f929a=0x0,_0x35db55=events[_0x36ed('0x6')];_0x2f929a<_0x35db55;_0x2f929a++){var _0x3c1807=events[_0x2f929a];var _0x16a6cb=createListener(_0x36ed('0x7')+_0x3c1807,_0x3c7779);MailInteractionEvents['on'](_0x3c1807,_0x16a6cb);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 95b5c13..eeb7ed5 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 _0x4cdf=['./mailMessage.controller','get','isAuthenticated','index','describe','/:id','show','/:id/download','download','post','mail','mailmessage:create','create','update','put','accept','/:id/reject','reject','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x17bb31,_0x2fc6f8){var _0x505c71=function(_0x5013cf){while(--_0x5013cf){_0x17bb31['push'](_0x17bb31['shift']());}};_0x505c71(++_0x2fc6f8);}(_0x4cdf,0x180));var _0xf4cd=function(_0x906834,_0x440dec){_0x906834=_0x906834-0x0;var _0x33b58c=_0x4cdf[_0x906834];return _0x33b58c;};'use strict';var multer=require(_0xf4cd('0x0'));var util=require(_0xf4cd('0x1'));var path=require(_0xf4cd('0x2'));var timeout=require(_0xf4cd('0x3'));var express=require(_0xf4cd('0x4'));var router=express[_0xf4cd('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf4cd('0x6'));var interaction=require(_0xf4cd('0x7'));var config=require('../../config/environment');var controller=require(_0xf4cd('0x8'));router[_0xf4cd('0x9')]('/',auth[_0xf4cd('0xa')](),controller[_0xf4cd('0xb')]);router[_0xf4cd('0x9')]('/describe',auth[_0xf4cd('0xa')](),controller[_0xf4cd('0xc')]);router[_0xf4cd('0x9')](_0xf4cd('0xd'),auth['isAuthenticated'](),controller[_0xf4cd('0xe')]);router[_0xf4cd('0x9')](_0xf4cd('0xf'),auth[_0xf4cd('0xa')](),controller[_0xf4cd('0x10')]);router[_0xf4cd('0x11')]('/',auth[_0xf4cd('0xa')](),interaction['tracked'](_0xf4cd('0x12'),_0xf4cd('0x13')),controller[_0xf4cd('0x14')]);router['put']('/:id',auth[_0xf4cd('0xa')](),controller[_0xf4cd('0x15')]);router[_0xf4cd('0x16')]('/:id/accept',auth[_0xf4cd('0xa')](),controller[_0xf4cd('0x17')]);router[_0xf4cd('0x16')](_0xf4cd('0x18'),auth[_0xf4cd('0xa')](),controller[_0xf4cd('0x19')]);router['delete'](_0xf4cd('0xd'),auth[_0xf4cd('0xa')](),controller[_0xf4cd('0x1a')]);module[_0xf4cd('0x1b')]=router; \ No newline at end of file +var _0xbde2=['/:id/download','download','tracked','mail','mailmessage:create','create','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0xbde2,0x7a));var _0x2bde=function(_0x6881cb,_0x4e9921){_0x6881cb=_0x6881cb-0x0;var _0x1c4db9=_0xbde2[_0x6881cb];return _0x1c4db9;};'use strict';var multer=require('multer');var util=require(_0x2bde('0x0'));var path=require(_0x2bde('0x1'));var timeout=require(_0x2bde('0x2'));var express=require('express');var router=express[_0x2bde('0x3')]();var fs_extra=require(_0x2bde('0x4'));var auth=require(_0x2bde('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2bde('0x6'));var controller=require(_0x2bde('0x7'));router[_0x2bde('0x8')]('/',auth[_0x2bde('0x9')](),controller['index']);router[_0x2bde('0x8')](_0x2bde('0xa'),auth[_0x2bde('0x9')](),controller[_0x2bde('0xb')]);router[_0x2bde('0x8')](_0x2bde('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0x2bde('0xd'),auth[_0x2bde('0x9')](),controller[_0x2bde('0xe')]);router['post']('/',auth[_0x2bde('0x9')](),interaction[_0x2bde('0xf')](_0x2bde('0x10'),_0x2bde('0x11')),controller[_0x2bde('0x12')]);router[_0x2bde('0x13')]('/:id',auth[_0x2bde('0x9')](),controller['update']);router[_0x2bde('0x13')](_0x2bde('0x14'),auth[_0x2bde('0x9')](),controller[_0x2bde('0x15')]);router[_0x2bde('0x13')](_0x2bde('0x16'),auth[_0x2bde('0x9')](),controller[_0x2bde('0x17')]);router[_0x2bde('0x18')](_0x2bde('0xc'),auth[_0x2bde('0x9')](),controller[_0x2bde('0x19')]);module[_0x2bde('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 569317f..d70e7d9 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 _0xd699=['medium','ENUM','out','STRING','TEXT','DATE','Email','lodash','exports','long'];(function(_0x102f97,_0x5bda2f){var _0xd22058=function(_0x2ccc1f){while(--_0x2ccc1f){_0x102f97['push'](_0x102f97['shift']());}};_0xd22058(++_0x5bda2f);}(_0xd699,0x18d));var _0x9d69=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0xd699[_0x17406a];return _0x1501ff;};'use strict';var Sequelize=require('sequelize');var _=require(_0x9d69('0x0'));module[_0x9d69('0x1')]={'body':{'type':Sequelize['TEXT'](_0x9d69('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x9d69('0x3'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x9d69('0x4')]('in',_0x9d69('0x5')),'defaultValue':_0x9d69('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x9d69('0x6')](0x1fe)},'from':{'type':Sequelize[_0x9d69('0x6')]},'to':{'type':Sequelize[_0x9d69('0x7')](_0x9d69('0x2'))},'cc':{'type':Sequelize[_0x9d69('0x7')](_0x9d69('0x2'))},'bcc':{'type':Sequelize[_0x9d69('0x7')]('long')},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x9d69('0x8')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x9d69('0x7')](_0x9d69('0x2'))},'originCc':{'type':Sequelize['TEXT'](_0x9d69('0x2'))},'originChannel':{'type':Sequelize[_0x9d69('0x4')](_0x9d69('0x9'),'Chat'),'defaultValue':_0x9d69('0x9'),'allowNull':![]}}; \ No newline at end of file +var _0x367e=['DATE','INTEGER','ENUM','Chat','Email','sequelize','lodash','TEXT','long','medium','BOOLEAN','out','STRING'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x367e,0xa1));var _0xe367=function(_0x479d3d,_0x32d023){_0x479d3d=_0x479d3d-0x0;var _0x3e614d=_0x367e[_0x479d3d];return _0x3e614d;};'use strict';var Sequelize=require(_0xe367('0x0'));var _=require(_0xe367('0x1'));module['exports']={'body':{'type':Sequelize[_0xe367('0x2')](_0xe367('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe367('0x2')](_0xe367('0x4'))},'read':{'type':Sequelize[_0xe367('0x5')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xe367('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xe367('0x7')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xe367('0x2')](_0xe367('0x3'))},'cc':{'type':Sequelize[_0xe367('0x2')](_0xe367('0x3'))},'bcc':{'type':Sequelize[_0xe367('0x2')](_0xe367('0x3'))},'subject':{'type':Sequelize[_0xe367('0x2')]},'sentAt':{'type':Sequelize[_0xe367('0x8')]},'attach':{'type':Sequelize[_0xe367('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xe367('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xe367('0x8')]},'originTo':{'type':Sequelize[_0xe367('0x2')](_0xe367('0x3'))},'originCc':{'type':Sequelize[_0xe367('0x2')](_0xe367('0x3'))},'originChannel':{'type':Sequelize[_0xe367('0xa')]('Email',_0xe367('0xb')),'defaultValue':_0xe367('0xc'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 46944c0..6dc1106 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 _0x5753=['find','body','destroy','describe','create','out','secret','findOne','MailAccountId','CmList','CmContact','Contacts','DESC','MailServerOut','Smtp','isNil','host','port','secure','auth','user','service','pass','attachments','server/files/attachments','basename','List','List\x20not\x20found','sendMail','format','YYYY-MM-DD\x20HH:mm:ss','mail','readAt','UserId','get','MailInteraction','read1stAt','interaction','info','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','agent','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','accept','fromString','EventManager','acceptmessage','MailInteractionId','role','RejectMessage','rejectMessage','reject','rejectmessage','download','unix','toString','server','join','files','bcc','subject','from','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','existsSync','push','type','readFileSync','build','writeFileSync','eml-format','moment','bluebird','util','path','html-to-text','../../config/logger','api','mail-interactions','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','offset','undefined','count','limit','status','set','json','update','then','sendStatus','stack','name','send','index','map','MailMessage','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','merge'];(function(_0xee9ab6,_0x10ca99){var _0x521af0=function(_0x470026){while(--_0x470026){_0xee9ab6['push'](_0xee9ab6['shift']());}};_0x521af0(++_0x10ca99);}(_0x5753,0x194));var _0x3575=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x5753[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require(_0x3575('0x0'));var moment=require(_0x3575('0x1'));var BPromise=require(_0x3575('0x2'));var util=require(_0x3575('0x3'));var path=require(_0x3575('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var htmlToText=require(_0x3575('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0x3575('0x6'))(_0x3575('0x7'));var interaction_log=require(_0x3575('0x6'))(_0x3575('0x8'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x3575('0x9')]=_['defaults'](config[_0x3575('0x9')],{'host':_0x3575('0xa'),'port':0x18eb});var socket=require(_0x3575('0xb'))(new Redis(config['redis']));var htmlEntities=require('html-entities');require('./mailMessage.socket')[_0x3575('0xc')](socket);var jayson=require(_0x3575('0xd'));var client=jayson[_0x3575('0xe')][_0x3575('0xf')]({'port':0x232c});var client9003=jayson['client'][_0x3575('0xf')]({'port':0x232b});var client9002=jayson[_0x3575('0xe')][_0x3575('0xf')]({'port':0x232a});function respondWithRpcPromise(_0x274aa1,_0x44650f,_0x582ce2,_0x1fd1f6){return new BPromise(function(_0x171128,_0x519323){var _0xbe776=_0x1fd1f6||client;return _0xbe776[_0x3575('0x10')](_0x274aa1,_0x582ce2)['then'](function(_0x5cf640){logger['info'](_0x3575('0x11'),_0x44650f,_0x3575('0x12'));logger['debug'](_0x3575('0x13'),_0x44650f,'request\x20sent',JSON[_0x3575('0x14')](_0x5cf640));if(_0x5cf640[_0x3575('0x15')]){if(_0x5cf640['error'][_0x3575('0x16')]===0x1f4){logger[_0x3575('0x15')](_0x3575('0x11'),_0x44650f,_0x5cf640[_0x3575('0x15')][_0x3575('0x17')]);return _0x519323(_0x5cf640[_0x3575('0x15')][_0x3575('0x17')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x44650f,_0x5cf640[_0x3575('0x15')][_0x3575('0x17')]);return _0x171128(_0x5cf640['error']['message']);}else{logger['info'](_0x3575('0x11'),_0x44650f,'request\x20sent');_0x171128(_0x5cf640[_0x3575('0x18')][_0x3575('0x17')]);}})[_0x3575('0x19')](function(_0x2e2044){logger[_0x3575('0x15')](_0x3575('0x11'),_0x44650f,_0x2e2044);_0x519323(_0x2e2044);});});}function respondWithResult(_0x7449f5,_0x3a323c){_0x3a323c=_0x3a323c||0xc8;return function(_0x243dbd){if(_0x243dbd){return _0x7449f5['status'](_0x3a323c)['json'](_0x243dbd);}};}function respondWithFilteredResult(_0x74e73,_0x4e571d){return function(_0x206531){if(_0x206531){var _0x10640b=typeof _0x4e571d[_0x3575('0x1a')]===_0x3575('0x1b')&&typeof _0x4e571d['limit']===_0x3575('0x1b');var _0x1177b4=_0x206531[_0x3575('0x1c')];var _0x1f2933=_0x10640b?0x0:_0x4e571d['offset'];var _0x353805=_0x10640b?_0x206531[_0x3575('0x1c')]:_0x4e571d[_0x3575('0x1a')]+_0x4e571d[_0x3575('0x1d')];var _0x43e4a1;if(_0x353805>=_0x1177b4){_0x353805=_0x1177b4;_0x43e4a1=0xc8;}else{_0x43e4a1=0xce;}_0x74e73[_0x3575('0x1e')](_0x43e4a1);return _0x74e73[_0x3575('0x1f')]('Content-Range',_0x1f2933+'-'+_0x353805+'/'+_0x1177b4)[_0x3575('0x20')](_0x206531);}return null;};}function saveUpdates(_0x47c2a4){return function(_0x71a907){if(_0x71a907){return _0x71a907[_0x3575('0x21')](_0x47c2a4)['then'](function(_0xc82de0){return _0xc82de0;});}return null;};}function removeEntity(_0x4985f5){return function(_0x3a0c4f){if(_0x3a0c4f){return _0x3a0c4f['destroy']()[_0x3575('0x22')](function(){_0x4985f5[_0x3575('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x216463){return function(_0x46ab89){if(!_0x46ab89){_0x216463[_0x3575('0x23')](0x194);}return _0x46ab89;};}function handleError(_0x5d3966,_0x52f9c4){_0x52f9c4=_0x52f9c4||0x1f4;return function(_0x46927b){logger[_0x3575('0x15')](_0x46927b[_0x3575('0x24')]);if(_0x46927b[_0x3575('0x25')]){delete _0x46927b[_0x3575('0x25')];}_0x5d3966['status'](_0x52f9c4)[_0x3575('0x26')](_0x46927b);};}exports[_0x3575('0x27')]=function(_0x38c46e,_0x277f8c){var _0x3bf987={},_0x11f535={},_0x5690e6={'count':0x0,'rows':[]};var _0x1c8539=_[_0x3575('0x28')](db[_0x3575('0x29')]['rawAttributes'],function(_0x28f3d0){return{'name':_0x28f3d0[_0x3575('0x2a')],'type':_0x28f3d0['type'][_0x3575('0x2b')]};});_0x11f535[_0x3575('0x2c')]=_[_0x3575('0x28')](_0x1c8539,_0x3575('0x25'));_0x11f535[_0x3575('0x2d')]=_[_0x3575('0x2e')](_0x38c46e[_0x3575('0x2d')]);_0x11f535[_0x3575('0x2f')]=_[_0x3575('0x30')](_0x11f535['model'],_0x11f535[_0x3575('0x2d')]);_0x3bf987[_0x3575('0x31')]=_[_0x3575('0x30')](_0x11f535['model'],qs[_0x3575('0x32')](_0x38c46e[_0x3575('0x2d')][_0x3575('0x32')]));_0x3bf987[_0x3575('0x31')]=_0x3bf987[_0x3575('0x31')][_0x3575('0x33')]?_0x3bf987[_0x3575('0x31')]:_0x11f535[_0x3575('0x2c')];if(!_0x38c46e[_0x3575('0x2d')]['hasOwnProperty'](_0x3575('0x34'))){_0x3bf987[_0x3575('0x1d')]=qs[_0x3575('0x1d')](_0x38c46e[_0x3575('0x2d')][_0x3575('0x1d')]);_0x3bf987[_0x3575('0x1a')]=qs['offset'](_0x38c46e[_0x3575('0x2d')]['offset']);}_0x3bf987[_0x3575('0x35')]=qs[_0x3575('0x36')](_0x38c46e[_0x3575('0x2d')][_0x3575('0x36')]);_0x3bf987[_0x3575('0x37')]=qs[_0x3575('0x2f')](_[_0x3575('0x38')](_0x38c46e[_0x3575('0x2d')],_0x11f535[_0x3575('0x2f')]),_0x1c8539);if(_0x38c46e[_0x3575('0x2d')][_0x3575('0x39')]){_0x3bf987['where']=_['merge'](_0x3bf987[_0x3575('0x37')],{'$or':_[_0x3575('0x28')](_0x1c8539,function(_0x1bdb7e){if(_0x1bdb7e['type']!==_0x3575('0x3a')){var _0x435230={};_0x435230[_0x1bdb7e[_0x3575('0x25')]]={'$like':'%'+_0x38c46e[_0x3575('0x2d')]['filter']+'%'};return _0x435230;}})});}_0x3bf987=_['merge']({},_0x3bf987,_0x38c46e[_0x3575('0x3b')]);var _0x510c65={'where':_0x3bf987[_0x3575('0x37')]};return db[_0x3575('0x29')]['count'](_0x510c65)[_0x3575('0x22')](function(_0x2154e6){_0x5690e6['count']=_0x2154e6;if(_0x38c46e['query'][_0x3575('0x3c')]){_0x3bf987[_0x3575('0x3d')]=[{'all':!![]}];}return db[_0x3575('0x29')]['findAll'](_0x3bf987);})['then'](function(_0x5de1ff){_0x5690e6[_0x3575('0x3e')]=_0x5de1ff;return _0x5690e6;})[_0x3575('0x22')](respondWithFilteredResult(_0x277f8c,_0x3bf987))[_0x3575('0x19')](handleError(_0x277f8c,null));};exports[_0x3575('0x3f')]=function(_0x57d4b8,_0x445980){var _0x472e45={'raw':!![],'where':{'id':_0x57d4b8[_0x3575('0x40')]['id']}},_0x521807={};_0x521807[_0x3575('0x2c')]=_[_0x3575('0x2e')](db[_0x3575('0x29')][_0x3575('0x41')]);_0x521807[_0x3575('0x2d')]=_[_0x3575('0x2e')](_0x57d4b8['query']);_0x521807[_0x3575('0x2f')]=_[_0x3575('0x30')](_0x521807['model'],_0x521807[_0x3575('0x2d')]);_0x472e45[_0x3575('0x31')]=_['intersection'](_0x521807[_0x3575('0x2c')],qs[_0x3575('0x32')](_0x57d4b8[_0x3575('0x2d')][_0x3575('0x32')]));_0x472e45[_0x3575('0x31')]=_0x472e45['attributes']['length']?_0x472e45[_0x3575('0x31')]:_0x521807['model'];if(_0x57d4b8[_0x3575('0x2d')][_0x3575('0x3c')]){_0x472e45[_0x3575('0x3d')]=[{'all':!![]}];}_0x472e45=_[_0x3575('0x42')]({},_0x472e45,_0x57d4b8[_0x3575('0x3b')]);return db['MailMessage'][_0x3575('0x43')](_0x472e45)['then'](handleEntityNotFound(_0x445980,null))[_0x3575('0x22')](respondWithResult(_0x445980,null))[_0x3575('0x19')](handleError(_0x445980,null));};exports[_0x3575('0x21')]=function(_0x37cbfd,_0x540242){if(_0x37cbfd[_0x3575('0x44')]['id']){delete _0x37cbfd[_0x3575('0x44')]['id'];}return db['MailMessage'][_0x3575('0x43')]({'where':{'id':_0x37cbfd[_0x3575('0x40')]['id']}})[_0x3575('0x22')](handleEntityNotFound(_0x540242,null))[_0x3575('0x22')](saveUpdates(_0x37cbfd['body'],null))['then'](respondWithResult(_0x540242,null))[_0x3575('0x19')](handleError(_0x540242,null));};exports[_0x3575('0x45')]=function(_0x2c1c2e,_0x55885b){return db['MailMessage'][_0x3575('0x43')]({'where':{'id':_0x2c1c2e[_0x3575('0x40')]['id']}})[_0x3575('0x22')](handleEntityNotFound(_0x55885b,null))['then'](removeEntity(_0x55885b,null))['catch'](handleError(_0x55885b,null));};exports['describe']=function(_0x5b868f,_0x46efdb){return db[_0x3575('0x29')][_0x3575('0x46')]()[_0x3575('0x22')](respondWithResult(_0x46efdb,null))[_0x3575('0x19')](handleError(_0x46efdb,null));};exports[_0x3575('0x47')]=function(_0x2df1a0,_0x353930){return db['MailMessage'][_0x3575('0x47')](_0x2df1a0[_0x3575('0x44')])[_0x3575('0x22')](function(_0x4df702){if(_0x4df702){if(_0x4df702['direction']===_0x3575('0x48')&&!_0x4df702[_0x3575('0x49')]){var _0x57d7d8,_0x32da10,_0xab8c89;if(_0x2df1a0[_0x3575('0x44')]['to']){_0x32da10=_0x2df1a0[_0x3575('0x44')]['to']['split'](',')[0x0];}return db['MailAccount'][_0x3575('0x4a')]({'where':{'id':_0x4df702[_0x3575('0x4b')]},'include':[{'model':db[_0x3575('0x4c')],'as':'List','include':[{'model':db[_0x3575('0x4d')],'as':_0x3575('0x4e'),'where':{'email':_0x32da10},'limit':0x1,'order':[['updatedAt',_0x3575('0x4f')]]}]},{'model':db[_0x3575('0x50')],'as':'Smtp','raw':!![]}]})[_0x3575('0x22')](function(_0x1de699){_0x57d7d8=_0x1de699;if(_0x57d7d8&&_0x57d7d8[_0x3575('0x51')]){var _0x184d32={'tls':{'rejectUnauthorized':![]}};if(_[_0x3575('0x52')](_0x57d7d8[_0x3575('0x51')]['service'])){_0x184d32[_0x3575('0x53')]=_0x57d7d8['Smtp']['host'];_0x184d32[_0x3575('0x54')]=_0x57d7d8[_0x3575('0x51')][_0x3575('0x54')];_0x184d32[_0x3575('0x55')]=_0x57d7d8[_0x3575('0x51')]['secure'];if(_0x57d7d8['Smtp']['authentication']){_0x184d32[_0x3575('0x56')]={'user':_0x57d7d8['Smtp'][_0x3575('0x57')],'pass':_0x57d7d8[_0x3575('0x51')]['pass']};}}else{_0x184d32[_0x3575('0x58')]=_0x57d7d8[_0x3575('0x51')]['service'];_0x184d32['auth']={'user':_0x57d7d8[_0x3575('0x51')][_0x3575('0x57')],'pass':_0x57d7d8[_0x3575('0x51')][_0x3575('0x59')]};_0x184d32[_0x3575('0x55')]=_0x57d7d8[_0x3575('0x51')][_0x3575('0x55')];}if(_0x2df1a0[_0x3575('0x44')]['attachments']&&_0x2df1a0[_0x3575('0x44')][_0x3575('0x5a')][_0x3575('0x33')]){for(var _0x4651a3=0x0;_0x4651a3<_0x2df1a0[_0x3575('0x44')][_0x3575('0x5a')][_0x3575('0x33')];_0x4651a3+=0x1){_0x2df1a0[_0x3575('0x44')]['attachments'][_0x4651a3]={'filename':_0x2df1a0[_0x3575('0x44')][_0x3575('0x5a')][_0x4651a3][_0x3575('0x25')],'path':path['join'](config['root'],_0x3575('0x5b'),_0x2df1a0[_0x3575('0x44')][_0x3575('0x5a')][_0x4651a3][_0x3575('0x5c')])};}}_0xab8c89={'account':_0x184d32,'message':_0x2df1a0[_0x3575('0x44')]};return;}})[_0x3575('0x22')](function(){if(_0x57d7d8[_0x3575('0x5d')]){if(_0x57d7d8['List'][_0x3575('0x4e')][_0x3575('0x33')]){return _0x57d7d8['List'][_0x3575('0x4e')][0x0];}else{return db[_0x3575('0x4d')][_0x3575('0x47')](_['defaults'](_0x2df1a0[_0x3575('0x44')],{'firstName':_0x2df1a0[_0x3575('0x44')]['to'],'email':_0x2df1a0['body']['to'],'phone':_0x2df1a0[_0x3575('0x44')]['to'],'ListId':_0x57d7d8['ListId']}));}}else{throw new Error(_0x3575('0x5e'));}})[_0x3575('0x22')](function(){if(_0xab8c89){return respondWithRpcPromise('SendMail',_0x3575('0x5f'),_0xab8c89,client9003)[_0x3575('0x22')](function(_0x273d02){return _0x4df702[_0x3575('0x21')]({'read':!![],'messageId':_0x273d02['messageId'],'sentAt':moment()[_0x3575('0x60')](_0x3575('0x61'))});})[_0x3575('0x19')](function(_0x42a666){logger[_0x3575('0x15')]('%s',JSON[_0x3575('0x14')](_0x42a666));return _0x4df702;});}return _0x4df702;});}return _0x4df702;}})['then'](respondWithResult(_0x353930,0xc9))[_0x3575('0x19')](handleError(_0x353930,null));};exports['accept']=function(_0x4fd4a6,_0x1dc326){var _0x22c1ca={'agent':{},'channel':_0x3575('0x62')};if(_0x4fd4a6[_0x3575('0x44')]['id']){delete _0x4fd4a6[_0x3575('0x44')]['id'];}_0x4fd4a6[_0x3575('0x44')]['read']=!![];_0x4fd4a6[_0x3575('0x44')][_0x3575('0x63')]=moment()[_0x3575('0x60')](_0x3575('0x61'));_0x4fd4a6[_0x3575('0x44')][_0x3575('0x64')]=_0x4fd4a6[_0x3575('0x44')]['UserId']||_0x4fd4a6[_0x3575('0x57')]['id'];_0x22c1ca['agent']['id']=_0x4fd4a6['body'][_0x3575('0x64')];return db[_0x3575('0x29')][_0x3575('0x43')]({'where':{'id':_0x4fd4a6[_0x3575('0x40')]['id'],'UserId':null}})[_0x3575('0x22')](handleEntityNotFound(_0x1dc326,null))[_0x3575('0x22')](saveUpdates(_0x4fd4a6[_0x3575('0x44')],null))[_0x3575('0x22')](function(_0x2f3fed){if(_0x2f3fed){_0x22c1ca[_0x3575('0x17')]=_0x2f3fed[_0x3575('0x65')]({'plain':!![]});return db[_0x3575('0x66')]['find']({'where':{'id':_0x2f3fed['MailInteractionId']}});}return null;})[_0x3575('0x22')](handleEntityNotFound(_0x1dc326,null))[_0x3575('0x22')](function(_0x2ff7c3){if(_0x2ff7c3){return _0x2ff7c3[_0x3575('0x21')]({'UserId':_0x4fd4a6[_0x3575('0x44')][_0x3575('0x64')],'read1stAt':_['isNil'](_0x2ff7c3[_0x3575('0x67')])?moment()[_0x3575('0x60')](_0x3575('0x61')):undefined});}return null;})['then'](function(_0xd7e9ec){if(_0xd7e9ec){_0x22c1ca[_0x3575('0x68')]=_0xd7e9ec[_0x3575('0x65')]({'plain':!![]});interaction_log[_0x3575('0x69')](_0x3575('0x6a'),_0x4fd4a6[_0x3575('0x57')]['id'],_0x4fd4a6[_0x3575('0x57')][_0x3575('0x25')],_0x4fd4a6[_0x3575('0x57')]['role'],_0x22c1ca[_0x3575('0x68')]['id'],_0x4fd4a6[_0x3575('0x44')]?JSON[_0x3575('0x14')](_0x4fd4a6['body']):_0x3575('0x6b'));return respondWithRpcPromise(_0x3575('0x6c'),_0x3575('0x6d'),_0x22c1ca);}return null;})[_0x3575('0x22')](function(_0x433498){var _0x2ec610=_0x3575('0x6e')+_0x433498[_0x3575('0x17')][_0x3575('0x6f')];return db[_0x3575('0x70')][_0x3575('0x2d')](_0x2ec610,{'type':db[_0x3575('0x71')][_0x3575('0x72')][_0x3575('0x73')],'raw':!![]})[_0x3575('0x22')](function(_0x132f41){return _0x132f41;});})[_0x3575('0x22')](function(_0x48cc28){if(_0x48cc28){_0x22c1ca[_0x3575('0x17')][_0x3575('0x74')]=_0x48cc28[0x0];if(!_0x4fd4a6[_0x3575('0x44')]['UserId'])return;return db['User'][_0x3575('0x43')]({'where':{'id':_0x4fd4a6['body'][_0x3575('0x64')],'role':_0x3575('0x75')},'attributes':['id',_0x3575('0x25'),_0x3575('0x76'),_0x3575('0x77'),_0x3575('0x78')],'raw':!![]});}return null;})[_0x3575('0x22')](function(_0x31cd57){if(!_0x31cd57)return null;_0x22c1ca[_0x3575('0x17')][_0x3575('0x75')]=_0x31cd57;return _0x22c1ca;})[_0x3575('0x22')](function(_0x56d5b4){if(_0x56d5b4){if(_0x4fd4a6[_0x3575('0x44')][_0x3575('0x79')]){_0x22c1ca[_0x3575('0x17')]['interface']=util[_0x3575('0x60')](_0x3575('0x7a'),_0x4fd4a6[_0x3575('0x57')][_0x3575('0x25')]);_0x22c1ca[_0x3575('0x17')]['channel']=_0x22c1ca[_0x3575('0x7b')];_0x22c1ca[_0x3575('0x17')][_0x3575('0x7c')]=_0x22c1ca[_0x3575('0x7b')];_0x22c1ca[_0x3575('0x17')][_0x3575('0x7d')]=_0x3575('0x7e');_0x22c1ca[_0x3575('0x17')][_0x3575('0x44')]=htmlToText[_0x3575('0x7f')](_0x22c1ca['message'][_0x3575('0x44')]);return respondWithRpcPromise(_0x3575('0x80'),'EventManager',{'event':_0x3575('0x81'),'message':_0x22c1ca[_0x3575('0x17')]},client9002)['then'](function(){return _0x22c1ca;});}return _0x22c1ca;}return null;})['then'](respondWithResult(_0x1dc326,null))[_0x3575('0x19')](handleError(_0x1dc326,null));};exports['reject']=function(_0x11ab87,_0x273d2d){var _0x3d9b7d={'agent':{},'channel':_0x3575('0x62')};if(_0x11ab87['body']['id']){delete _0x11ab87[_0x3575('0x44')]['id'];}_0x11ab87['body'][_0x3575('0x64')]=_0x11ab87[_0x3575('0x44')][_0x3575('0x64')]||_0x11ab87[_0x3575('0x57')]['id'];_0x3d9b7d[_0x3575('0x75')]['id']=_0x11ab87['body']['UserId'];return db['MailMessage'][_0x3575('0x43')]({'where':{'id':_0x11ab87[_0x3575('0x40')]['id'],'UserId':null}})[_0x3575('0x22')](handleEntityNotFound(_0x273d2d,null))[_0x3575('0x22')](function(_0x2bed51){if(_0x2bed51){_0x3d9b7d[_0x3575('0x17')]=_0x2bed51[_0x3575('0x65')]({'plain':!![]});return db[_0x3575('0x66')][_0x3575('0x43')]({'where':{'id':_0x2bed51[_0x3575('0x82')]}});}return null;})[_0x3575('0x22')](handleEntityNotFound(_0x273d2d,null))['then'](function(_0x1e77aa){if(_0x1e77aa){_0x3d9b7d[_0x3575('0x68')]=_0x1e77aa[_0x3575('0x65')]({'plain':!![]});interaction_log['info']('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x11ab87[_0x3575('0x57')]['id'],_0x11ab87[_0x3575('0x57')][_0x3575('0x25')],_0x11ab87['user'][_0x3575('0x83')],_0x3d9b7d[_0x3575('0x68')]['id'],_0x11ab87['body']?JSON['stringify'](_0x11ab87['body']):_0x3575('0x6b'));return respondWithRpcPromise(_0x3575('0x84'),_0x3575('0x85'),_0x3d9b7d);}return null;})['then'](function(_0x4e4e92){var _0x2bb783=_0x3575('0x6e')+_0x4e4e92['message'][_0x3575('0x6f')];return db['sequelize']['query'](_0x2bb783,{'type':db['Sequelize'][_0x3575('0x72')]['SELECT'],'raw':!![]})[_0x3575('0x22')](function(_0x586717){return _0x586717;});})[_0x3575('0x22')](function(_0x3881e4){if(_0x3881e4){_0x3d9b7d[_0x3575('0x17')][_0x3575('0x74')]=_0x3881e4[0x0];if(!_0x11ab87[_0x3575('0x44')][_0x3575('0x64')])return;return db['User'][_0x3575('0x43')]({'where':{'id':_0x11ab87[_0x3575('0x44')]['UserId'],'role':'agent'},'attributes':['id',_0x3575('0x25'),_0x3575('0x76'),_0x3575('0x77'),_0x3575('0x78')],'raw':!![]});}return null;})[_0x3575('0x22')](function(_0x4a2de1){if(!_0x4a2de1)return null;_0x3d9b7d[_0x3575('0x17')]['agent']=_0x4a2de1;return _0x3d9b7d;})[_0x3575('0x22')](function(_0x162b37){if(_0x162b37){_0x162b37['message']['interface']=util[_0x3575('0x60')](_0x3575('0x7a'),_0x11ab87[_0x3575('0x57')][_0x3575('0x25')]);_0x162b37[_0x3575('0x17')][_0x3575('0x7b')]=_0x3d9b7d[_0x3575('0x7b')];_0x162b37[_0x3575('0x17')][_0x3575('0x7c')]=_0x3d9b7d[_0x3575('0x7b')];_0x162b37[_0x3575('0x17')][_0x3575('0x7d')]=_0x3575('0x86');_0x162b37[_0x3575('0x17')][_0x3575('0x44')]=htmlToText[_0x3575('0x7f')](_0x3d9b7d['message'][_0x3575('0x44')]);respondWithRpcPromise(_0x3575('0x80'),'EventManager',{'event':_0x3575('0x87'),'message':_0x162b37['message']},client9002);return _0x3d9b7d;}return null;})[_0x3575('0x22')](respondWithResult(_0x273d2d,null))[_0x3575('0x19')](handleError(_0x273d2d,null));};exports[_0x3575('0x88')]=function(_0x2ba018,_0x286477){var _0x356ede=moment()[_0x3575('0x89')]()[_0x3575('0x8a')]();var _0x4b35f9=path['join'](config['root'],_0x3575('0x8b'),'files','tmp');var _0x3ccd7b=path[_0x3575('0x8c')](config['root'],_0x3575('0x8b'),_0x3575('0x8d'),_0x3575('0x5a'));var _0x35c455=util[_0x3575('0x60')]('message-%s.eml',_0x356ede);return db[_0x3575('0x29')][_0x3575('0x43')]({'where':{'id':_0x2ba018[_0x3575('0x40')]['id']},'attributes':['id',_0x3575('0x44'),'from','to','cc',_0x3575('0x8e'),_0x3575('0x8f'),'createdAt'],'include':_0x2ba018['query']['attachments']?[{'model':db['Attachment'],'as':'Attachments'}]:undefined})['then'](handleEntityNotFound(_0x286477,null))[_0x3575('0x22')](function(_0x1c151e){if(_0x1c151e){var _0x491b09=_0x1c151e;var _0x5a0255={'from':_0x491b09[_0x3575('0x90')],'to':_0x491b09['to'],'subject':_0x491b09[_0x3575('0x8f')],'html':htmlEntities[_0x3575('0x91')](_0x491b09[_0x3575('0x44')]),'headers':{'Date':moment(_0x491b09[_0x3575('0x92')])[_0x3575('0x60')](_0x3575('0x93'))},'attachments':[]};if(_0x1c151e['cc']){_0x5a0255[_0x3575('0x94')]['Cc']=_0x1c151e['cc'];}if(_0x1c151e['bcc']){_0x5a0255[_0x3575('0x94')][_0x3575('0x95')]=_0x1c151e['bcc'];}return new BPromise(function(_0x41d6e1,_0x399e04){if(_0x1c151e[_0x3575('0x96')]){for(var _0x57c8f3=0x0;_0x57c8f3<_0x1c151e[_0x3575('0x96')]['length'];_0x57c8f3++){var _0x53ad5a=_0x1c151e[_0x3575('0x96')][_0x57c8f3];var _0x438eb1=path[_0x3575('0x8c')](_0x3ccd7b,_0x53ad5a['basename']);if(fs[_0x3575('0x97')](_0x438eb1)){_0x5a0255[_0x3575('0x5a')][_0x3575('0x98')]({'name':_0x53ad5a['name'],'contentType':_0x53ad5a[_0x3575('0x99')],'data':fs[_0x3575('0x9a')](_0x438eb1)});}}}emlformat[_0x3575('0x9b')](_0x5a0255,function(_0x30521f,_0x14b675){if(_0x30521f)return _0x399e04(_0x30521f);fs[_0x3575('0x9c')](path['join'](_0x4b35f9,_0x35c455),_0x14b675);return _0x41d6e1(_0x14b675);});});}})[_0x3575('0x22')](function(_0x4f42c3){if(_0x4f42c3){return _0x286477[_0x3575('0x88')](path['join'](_0x4b35f9,_0x35c455),_0x35c455,function(_0x1b6a33){if(!_0x1b6a33)fs['unlinkSync'](path[_0x3575('0x8c')](_0x4b35f9,_0x35c455));});}})['catch'](handleError(_0x286477,null));}; \ No newline at end of file +var _0xba0e=['eml-format','util','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../mysqldb','defaults','redis','socket.io-emitter','./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','catch','status','json','offset','undefined','count','set','Content-Range','destroy','end','sendStatus','name','send','index','MailMessage','rawAttributes','fieldName','type','key','model','map','keys','intersection','query','attributes','fields','length','hasOwnProperty','limit','order','sort','filters','pick','where','merge','VIRTUAL','options','include','rows','show','params','update','body','find','describe','create','direction','secret','split','MailAccount','MailAccountId','CmList','List','CmContact','updatedAt','DESC','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','server/files/attachments','basename','Contacts','ListId','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','agent','get','MailInteractionId','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','User','internal','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','null','RejectMessage','rejectMessage','ContactId','contact','fullname','email','rejectmessage','download','unix','join','root','server','files','tmp','from','bcc','subject','Attachment','Attachments','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','readFileSync','build'];(function(_0x264b9b,_0xa1181e){var _0x4c7a0e=function(_0x4b77a0){while(--_0x4b77a0){_0x264b9b['push'](_0x264b9b['shift']());}};_0x4c7a0e(++_0xa1181e);}(_0xba0e,0xa0));var _0xeba0=function(_0x526f50,_0x4c7e95){_0x526f50=_0x526f50-0x0;var _0x5e0f91=_0xba0e[_0x526f50];return _0x5e0f91;};'use strict';var emlformat=require(_0xeba0('0x0'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xeba0('0x1'));var path=require('path');var fs=require('fs');var _=require(_0xeba0('0x2'));var Redis=require(_0xeba0('0x3'));var htmlToText=require(_0xeba0('0x4'));var qs=require(_0xeba0('0x5'));var logger=require(_0xeba0('0x6'))(_0xeba0('0x7'));var interaction_log=require(_0xeba0('0x6'))(_0xeba0('0x8'));var config=require('../../config/environment');var db=require(_0xeba0('0x9'))['db'];config['redis']=_[_0xeba0('0xa')](config[_0xeba0('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xeba0('0xc'))(new Redis(config[_0xeba0('0xb')]));var htmlEntities=require('html-entities');require(_0xeba0('0xd'))[_0xeba0('0xe')](socket);var jayson=require(_0xeba0('0xf'));var client=jayson['client'][_0xeba0('0x10')]({'port':0x232c});var client9003=jayson[_0xeba0('0x11')][_0xeba0('0x10')]({'port':0x232b});var client9002=jayson[_0xeba0('0x11')][_0xeba0('0x10')]({'port':0x232a});function respondWithRpcPromise(_0x4cf15c,_0x478f2b,_0x1cad88,_0x2f4819){return new BPromise(function(_0x131263,_0x3c0621){var _0x59ac02=_0x2f4819||client;return _0x59ac02[_0xeba0('0x12')](_0x4cf15c,_0x1cad88)[_0xeba0('0x13')](function(_0x123842){logger[_0xeba0('0x14')](_0xeba0('0x15'),_0x478f2b,_0xeba0('0x16'));logger[_0xeba0('0x17')](_0xeba0('0x18'),_0x478f2b,_0xeba0('0x16'),JSON[_0xeba0('0x19')](_0x123842));if(_0x123842[_0xeba0('0x1a')]){if(_0x123842['error']['code']===0x1f4){logger[_0xeba0('0x1a')](_0xeba0('0x15'),_0x478f2b,_0x123842[_0xeba0('0x1a')][_0xeba0('0x1b')]);return _0x3c0621(_0x123842[_0xeba0('0x1a')][_0xeba0('0x1b')]);}logger[_0xeba0('0x1a')](_0xeba0('0x15'),_0x478f2b,_0x123842['error'][_0xeba0('0x1b')]);return _0x131263(_0x123842['error'][_0xeba0('0x1b')]);}else{logger[_0xeba0('0x14')](_0xeba0('0x15'),_0x478f2b,_0xeba0('0x16'));_0x131263(_0x123842['result'][_0xeba0('0x1b')]);}})[_0xeba0('0x1c')](function(_0x5da266){logger[_0xeba0('0x1a')](_0xeba0('0x15'),_0x478f2b,_0x5da266);_0x3c0621(_0x5da266);});});}function respondWithResult(_0x5873c5,_0x5624ea){_0x5624ea=_0x5624ea||0xc8;return function(_0x5ac964){if(_0x5ac964){return _0x5873c5[_0xeba0('0x1d')](_0x5624ea)[_0xeba0('0x1e')](_0x5ac964);}};}function respondWithFilteredResult(_0x1ac3e7,_0x2889a8){return function(_0x473dfb){if(_0x473dfb){var _0x5e48c4=typeof _0x2889a8[_0xeba0('0x1f')]===_0xeba0('0x20')&&typeof _0x2889a8['limit']==='undefined';var _0x17d44d=_0x473dfb[_0xeba0('0x21')];var _0x56f343=_0x5e48c4?0x0:_0x2889a8[_0xeba0('0x1f')];var _0x25982d=_0x5e48c4?_0x473dfb[_0xeba0('0x21')]:_0x2889a8[_0xeba0('0x1f')]+_0x2889a8['limit'];var _0x3d9ee9;if(_0x25982d>=_0x17d44d){_0x25982d=_0x17d44d;_0x3d9ee9=0xc8;}else{_0x3d9ee9=0xce;}_0x1ac3e7['status'](_0x3d9ee9);return _0x1ac3e7[_0xeba0('0x22')](_0xeba0('0x23'),_0x56f343+'-'+_0x25982d+'/'+_0x17d44d)['json'](_0x473dfb);}return null;};}function saveUpdates(_0x5f1c87){return function(_0x5052f7){if(_0x5052f7){return _0x5052f7['update'](_0x5f1c87)[_0xeba0('0x13')](function(_0x55cd7a){return _0x55cd7a;});}return null;};}function removeEntity(_0x2e3bff){return function(_0x5bdc26){if(_0x5bdc26){return _0x5bdc26[_0xeba0('0x24')]()[_0xeba0('0x13')](function(){_0x2e3bff[_0xeba0('0x1d')](0xcc)[_0xeba0('0x25')]();});}};}function handleEntityNotFound(_0x2394ad){return function(_0x4d204d){if(!_0x4d204d){_0x2394ad[_0xeba0('0x26')](0x194);}return _0x4d204d;};}function handleError(_0x589469,_0x3a8a56){_0x3a8a56=_0x3a8a56||0x1f4;return function(_0x1e441e){logger[_0xeba0('0x1a')](_0x1e441e['stack']);if(_0x1e441e[_0xeba0('0x27')]){delete _0x1e441e[_0xeba0('0x27')];}_0x589469[_0xeba0('0x1d')](_0x3a8a56)[_0xeba0('0x28')](_0x1e441e);};}exports[_0xeba0('0x29')]=function(_0x213480,_0x251c7c){var _0x4aa000={},_0x5810bc={},_0xf4e29b={'count':0x0,'rows':[]};var _0x5aa86f=_['map'](db[_0xeba0('0x2a')][_0xeba0('0x2b')],function(_0x451864){return{'name':_0x451864[_0xeba0('0x2c')],'type':_0x451864[_0xeba0('0x2d')][_0xeba0('0x2e')]};});_0x5810bc[_0xeba0('0x2f')]=_[_0xeba0('0x30')](_0x5aa86f,'name');_0x5810bc['query']=_[_0xeba0('0x31')](_0x213480['query']);_0x5810bc['filters']=_[_0xeba0('0x32')](_0x5810bc[_0xeba0('0x2f')],_0x5810bc[_0xeba0('0x33')]);_0x4aa000[_0xeba0('0x34')]=_['intersection'](_0x5810bc[_0xeba0('0x2f')],qs[_0xeba0('0x35')](_0x213480[_0xeba0('0x33')][_0xeba0('0x35')]));_0x4aa000[_0xeba0('0x34')]=_0x4aa000[_0xeba0('0x34')][_0xeba0('0x36')]?_0x4aa000[_0xeba0('0x34')]:_0x5810bc[_0xeba0('0x2f')];if(!_0x213480[_0xeba0('0x33')][_0xeba0('0x37')]('nolimit')){_0x4aa000[_0xeba0('0x38')]=qs[_0xeba0('0x38')](_0x213480[_0xeba0('0x33')][_0xeba0('0x38')]);_0x4aa000[_0xeba0('0x1f')]=qs['offset'](_0x213480[_0xeba0('0x33')][_0xeba0('0x1f')]);}_0x4aa000[_0xeba0('0x39')]=qs[_0xeba0('0x3a')](_0x213480['query'][_0xeba0('0x3a')]);_0x4aa000['where']=qs[_0xeba0('0x3b')](_[_0xeba0('0x3c')](_0x213480[_0xeba0('0x33')],_0x5810bc['filters']),_0x5aa86f);if(_0x213480[_0xeba0('0x33')]['filter']){_0x4aa000[_0xeba0('0x3d')]=_[_0xeba0('0x3e')](_0x4aa000[_0xeba0('0x3d')],{'$or':_['map'](_0x5aa86f,function(_0x266288){if(_0x266288[_0xeba0('0x2d')]!==_0xeba0('0x3f')){var _0x4fcd52={};_0x4fcd52[_0x266288[_0xeba0('0x27')]]={'$like':'%'+_0x213480[_0xeba0('0x33')]['filter']+'%'};return _0x4fcd52;}})});}_0x4aa000=_['merge']({},_0x4aa000,_0x213480[_0xeba0('0x40')]);var _0x2e9ed9={'where':_0x4aa000[_0xeba0('0x3d')]};return db[_0xeba0('0x2a')][_0xeba0('0x21')](_0x2e9ed9)[_0xeba0('0x13')](function(_0x86053a){_0xf4e29b[_0xeba0('0x21')]=_0x86053a;if(_0x213480[_0xeba0('0x33')]['includeAll']){_0x4aa000[_0xeba0('0x41')]=[{'all':!![]}];}return db[_0xeba0('0x2a')]['findAll'](_0x4aa000);})[_0xeba0('0x13')](function(_0x56891c){_0xf4e29b[_0xeba0('0x42')]=_0x56891c;return _0xf4e29b;})['then'](respondWithFilteredResult(_0x251c7c,_0x4aa000))[_0xeba0('0x1c')](handleError(_0x251c7c,null));};exports[_0xeba0('0x43')]=function(_0x58e45a,_0x449453){var _0x5cb6dc={'raw':!![],'where':{'id':_0x58e45a[_0xeba0('0x44')]['id']}},_0x56106c={};_0x56106c[_0xeba0('0x2f')]=_[_0xeba0('0x31')](db['MailMessage'][_0xeba0('0x2b')]);_0x56106c[_0xeba0('0x33')]=_[_0xeba0('0x31')](_0x58e45a[_0xeba0('0x33')]);_0x56106c[_0xeba0('0x3b')]=_['intersection'](_0x56106c[_0xeba0('0x2f')],_0x56106c['query']);_0x5cb6dc[_0xeba0('0x34')]=_[_0xeba0('0x32')](_0x56106c[_0xeba0('0x2f')],qs[_0xeba0('0x35')](_0x58e45a[_0xeba0('0x33')][_0xeba0('0x35')]));_0x5cb6dc[_0xeba0('0x34')]=_0x5cb6dc[_0xeba0('0x34')][_0xeba0('0x36')]?_0x5cb6dc[_0xeba0('0x34')]:_0x56106c['model'];if(_0x58e45a['query']['includeAll']){_0x5cb6dc[_0xeba0('0x41')]=[{'all':!![]}];}_0x5cb6dc=_[_0xeba0('0x3e')]({},_0x5cb6dc,_0x58e45a['options']);return db[_0xeba0('0x2a')]['find'](_0x5cb6dc)[_0xeba0('0x13')](handleEntityNotFound(_0x449453,null))['then'](respondWithResult(_0x449453,null))[_0xeba0('0x1c')](handleError(_0x449453,null));};exports[_0xeba0('0x45')]=function(_0x283532,_0x28b7b1){if(_0x283532[_0xeba0('0x46')]['id']){delete _0x283532[_0xeba0('0x46')]['id'];}return db[_0xeba0('0x2a')]['find']({'where':{'id':_0x283532['params']['id']}})[_0xeba0('0x13')](handleEntityNotFound(_0x28b7b1,null))[_0xeba0('0x13')](saveUpdates(_0x283532[_0xeba0('0x46')],null))['then'](respondWithResult(_0x28b7b1,null))[_0xeba0('0x1c')](handleError(_0x28b7b1,null));};exports[_0xeba0('0x24')]=function(_0x1df5fc,_0x490f1a){return db[_0xeba0('0x2a')][_0xeba0('0x47')]({'where':{'id':_0x1df5fc[_0xeba0('0x44')]['id']}})[_0xeba0('0x13')](handleEntityNotFound(_0x490f1a,null))[_0xeba0('0x13')](removeEntity(_0x490f1a,null))[_0xeba0('0x1c')](handleError(_0x490f1a,null));};exports[_0xeba0('0x48')]=function(_0x31f993,_0x2d0183){return db['MailMessage']['describe']()[_0xeba0('0x13')](respondWithResult(_0x2d0183,null))['catch'](handleError(_0x2d0183,null));};exports[_0xeba0('0x49')]=function(_0x4127bf,_0x3c7d49){return db[_0xeba0('0x2a')][_0xeba0('0x49')](_0x4127bf['body'])['then'](function(_0x3a9d04){if(_0x3a9d04){if(_0x3a9d04[_0xeba0('0x4a')]==='out'&&!_0x3a9d04[_0xeba0('0x4b')]){var _0x3b28ba,_0x564362,_0x44f833;if(_0x4127bf[_0xeba0('0x46')]['to']){_0x564362=_0x4127bf['body']['to'][_0xeba0('0x4c')](',')[0x0];}return db[_0xeba0('0x4d')]['findOne']({'where':{'id':_0x3a9d04[_0xeba0('0x4e')]},'include':[{'model':db[_0xeba0('0x4f')],'as':_0xeba0('0x50'),'include':[{'model':db[_0xeba0('0x51')],'as':'Contacts','where':{'email':_0x564362},'limit':0x1,'order':[[_0xeba0('0x52'),_0xeba0('0x53')]]}]},{'model':db[_0xeba0('0x54')],'as':_0xeba0('0x55'),'raw':!![]}]})[_0xeba0('0x13')](function(_0x1a9f67){_0x3b28ba=_0x1a9f67;if(_0x3b28ba&&_0x3b28ba['Smtp']){var _0x55179d={'tls':{'rejectUnauthorized':![]}};if(_[_0xeba0('0x56')](_0x3b28ba[_0xeba0('0x55')][_0xeba0('0x57')])){_0x55179d['host']=_0x3b28ba[_0xeba0('0x55')][_0xeba0('0x58')];_0x55179d[_0xeba0('0x59')]=_0x3b28ba[_0xeba0('0x55')][_0xeba0('0x59')];_0x55179d['secure']=_0x3b28ba[_0xeba0('0x55')][_0xeba0('0x5a')];if(_0x3b28ba['Smtp'][_0xeba0('0x5b')]){_0x55179d[_0xeba0('0x5c')]={'user':_0x3b28ba[_0xeba0('0x55')][_0xeba0('0x5d')],'pass':_0x3b28ba[_0xeba0('0x55')]['pass']};}}else{_0x55179d[_0xeba0('0x57')]=_0x3b28ba[_0xeba0('0x55')]['service'];_0x55179d[_0xeba0('0x5c')]={'user':_0x3b28ba[_0xeba0('0x55')][_0xeba0('0x5d')],'pass':_0x3b28ba['Smtp'][_0xeba0('0x5e')]};_0x55179d[_0xeba0('0x5a')]=_0x3b28ba[_0xeba0('0x55')][_0xeba0('0x5a')];}if(_0x4127bf[_0xeba0('0x46')][_0xeba0('0x5f')]&&_0x4127bf['body'][_0xeba0('0x5f')][_0xeba0('0x36')]){for(var _0x50c967=0x0;_0x50c967<_0x4127bf[_0xeba0('0x46')][_0xeba0('0x5f')][_0xeba0('0x36')];_0x50c967+=0x1){_0x4127bf[_0xeba0('0x46')][_0xeba0('0x5f')][_0x50c967]={'filename':_0x4127bf[_0xeba0('0x46')][_0xeba0('0x5f')][_0x50c967][_0xeba0('0x27')],'path':path['join'](config['root'],_0xeba0('0x60'),_0x4127bf[_0xeba0('0x46')]['attachments'][_0x50c967][_0xeba0('0x61')])};}}_0x44f833={'account':_0x55179d,'message':_0x4127bf[_0xeba0('0x46')]};return;}})[_0xeba0('0x13')](function(){if(_0x3b28ba['List']){if(_0x3b28ba['List'][_0xeba0('0x62')][_0xeba0('0x36')]){return _0x3b28ba[_0xeba0('0x50')]['Contacts'][0x0];}else{return db[_0xeba0('0x51')][_0xeba0('0x49')](_['defaults'](_0x4127bf['body'],{'firstName':_0x4127bf['body']['to'],'email':_0x4127bf[_0xeba0('0x46')]['to'],'phone':_0x4127bf[_0xeba0('0x46')]['to'],'ListId':_0x3b28ba[_0xeba0('0x63')]}));}}else{throw new Error('List\x20not\x20found');}})['then'](function(){if(_0x44f833){return respondWithRpcPromise(_0xeba0('0x64'),_0xeba0('0x65'),_0x44f833,client9003)[_0xeba0('0x13')](function(_0x4b0a69){return _0x3a9d04[_0xeba0('0x45')]({'read':!![],'messageId':_0x4b0a69[_0xeba0('0x66')],'sentAt':moment()[_0xeba0('0x67')](_0xeba0('0x68'))});})[_0xeba0('0x1c')](function(_0x5a80bd){logger[_0xeba0('0x1a')]('%s',JSON[_0xeba0('0x19')](_0x5a80bd));return _0x3a9d04;});}return _0x3a9d04;});}return _0x3a9d04;}})[_0xeba0('0x13')](respondWithResult(_0x3c7d49,0xc9))['catch'](handleError(_0x3c7d49,null));};exports[_0xeba0('0x69')]=function(_0x40ec63,_0x544d12){var _0x1a959c={'agent':{},'channel':_0xeba0('0x6a')};if(_0x40ec63[_0xeba0('0x46')]['id']){delete _0x40ec63[_0xeba0('0x46')]['id'];}_0x40ec63['body'][_0xeba0('0x6b')]=!![];_0x40ec63[_0xeba0('0x46')][_0xeba0('0x6c')]=moment()[_0xeba0('0x67')](_0xeba0('0x68'));_0x40ec63[_0xeba0('0x46')]['UserId']=_0x40ec63['body'][_0xeba0('0x6d')]||_0x40ec63[_0xeba0('0x5d')]['id'];_0x1a959c[_0xeba0('0x6e')]['id']=_0x40ec63['body']['UserId'];return db[_0xeba0('0x2a')]['find']({'where':{'id':_0x40ec63['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x544d12,null))['then'](saveUpdates(_0x40ec63['body'],null))[_0xeba0('0x13')](function(_0x4e97ef){if(_0x4e97ef){_0x1a959c['message']=_0x4e97ef[_0xeba0('0x6f')]({'plain':!![]});return db['MailInteraction'][_0xeba0('0x47')]({'where':{'id':_0x4e97ef[_0xeba0('0x70')]}});}return null;})[_0xeba0('0x13')](handleEntityNotFound(_0x544d12,null))[_0xeba0('0x13')](function(_0x5b5aee){if(_0x5b5aee){return _0x5b5aee[_0xeba0('0x45')]({'UserId':_0x40ec63['body'][_0xeba0('0x6d')],'read1stAt':_[_0xeba0('0x56')](_0x5b5aee['read1stAt'])?moment()[_0xeba0('0x67')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xeba0('0x13')](function(_0x35458a){if(_0x35458a){_0x1a959c[_0xeba0('0x71')]=_0x35458a[_0xeba0('0x6f')]({'plain':!![]});interaction_log[_0xeba0('0x14')](_0xeba0('0x72'),_0x40ec63['user']['id'],_0x40ec63[_0xeba0('0x5d')][_0xeba0('0x27')],_0x40ec63[_0xeba0('0x5d')][_0xeba0('0x73')],_0x1a959c[_0xeba0('0x71')]['id'],_0x40ec63['body']?JSON[_0xeba0('0x19')](_0x40ec63[_0xeba0('0x46')]):'null');return respondWithRpcPromise(_0xeba0('0x74'),_0xeba0('0x75'),_0x1a959c);}return null;})['then'](function(_0x3e115c){var _0x7bd933=_0xeba0('0x76')+_0x3e115c[_0xeba0('0x1b')]['ContactId'];return db[_0xeba0('0x77')][_0xeba0('0x33')](_0x7bd933,{'type':db[_0xeba0('0x78')][_0xeba0('0x79')][_0xeba0('0x7a')],'raw':!![]})[_0xeba0('0x13')](function(_0x543c2d){return _0x543c2d;});})[_0xeba0('0x13')](function(_0x5ef1c4){if(_0x5ef1c4){_0x1a959c[_0xeba0('0x1b')]['contact']=_0x5ef1c4[0x0];if(!_0x40ec63[_0xeba0('0x46')][_0xeba0('0x6d')])return;return db[_0xeba0('0x7b')][_0xeba0('0x47')]({'where':{'id':_0x40ec63['body'][_0xeba0('0x6d')],'role':_0xeba0('0x6e')},'attributes':['id',_0xeba0('0x27'),'fullname','email',_0xeba0('0x7c')],'raw':!![]});}return null;})[_0xeba0('0x13')](function(_0x14c83e){if(!_0x14c83e)return null;_0x1a959c[_0xeba0('0x1b')]['agent']=_0x14c83e;return _0x1a959c;})[_0xeba0('0x13')](function(_0x3104f6){if(_0x3104f6){if(_0x40ec63[_0xeba0('0x46')]['manual']){_0x1a959c['message'][_0xeba0('0x7d')]=util['format'](_0xeba0('0x7e'),_0x40ec63['user'][_0xeba0('0x27')]);_0x1a959c[_0xeba0('0x1b')][_0xeba0('0x7f')]=_0x1a959c[_0xeba0('0x7f')];_0x1a959c['message'][_0xeba0('0x80')]=_0x1a959c[_0xeba0('0x7f')];_0x1a959c['message'][_0xeba0('0x81')]='accept';_0x1a959c[_0xeba0('0x1b')][_0xeba0('0x46')]=htmlToText[_0xeba0('0x82')](_0x1a959c[_0xeba0('0x1b')][_0xeba0('0x46')]);return respondWithRpcPromise(_0xeba0('0x83'),'EventManager',{'event':_0xeba0('0x84'),'message':_0x1a959c[_0xeba0('0x1b')]},client9002)[_0xeba0('0x13')](function(){return _0x1a959c;});}return _0x1a959c;}return null;})[_0xeba0('0x13')](respondWithResult(_0x544d12,null))[_0xeba0('0x1c')](handleError(_0x544d12,null));};exports[_0xeba0('0x85')]=function(_0x4cdf1d,_0x535e18){var _0x3bc340={'agent':{},'channel':_0xeba0('0x6a')};if(_0x4cdf1d['body']['id']){delete _0x4cdf1d[_0xeba0('0x46')]['id'];}_0x4cdf1d[_0xeba0('0x46')][_0xeba0('0x6d')]=_0x4cdf1d[_0xeba0('0x46')][_0xeba0('0x6d')]||_0x4cdf1d['user']['id'];_0x3bc340[_0xeba0('0x6e')]['id']=_0x4cdf1d[_0xeba0('0x46')][_0xeba0('0x6d')];return db[_0xeba0('0x2a')][_0xeba0('0x47')]({'where':{'id':_0x4cdf1d['params']['id'],'UserId':null}})[_0xeba0('0x13')](handleEntityNotFound(_0x535e18,null))['then'](function(_0x2ae865){if(_0x2ae865){_0x3bc340['message']=_0x2ae865[_0xeba0('0x6f')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x2ae865[_0xeba0('0x70')]}});}return null;})['then'](handleEntityNotFound(_0x535e18,null))[_0xeba0('0x13')](function(_0x397bdc){if(_0x397bdc){_0x3bc340[_0xeba0('0x71')]=_0x397bdc['get']({'plain':!![]});interaction_log[_0xeba0('0x14')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4cdf1d[_0xeba0('0x5d')]['id'],_0x4cdf1d['user'][_0xeba0('0x27')],_0x4cdf1d[_0xeba0('0x5d')][_0xeba0('0x73')],_0x3bc340[_0xeba0('0x71')]['id'],_0x4cdf1d[_0xeba0('0x46')]?JSON['stringify'](_0x4cdf1d['body']):_0xeba0('0x86'));return respondWithRpcPromise(_0xeba0('0x87'),_0xeba0('0x88'),_0x3bc340);}return null;})[_0xeba0('0x13')](function(_0x6b6efb){var _0x5ca984=_0xeba0('0x76')+_0x6b6efb[_0xeba0('0x1b')][_0xeba0('0x89')];return db[_0xeba0('0x77')]['query'](_0x5ca984,{'type':db[_0xeba0('0x78')][_0xeba0('0x79')]['SELECT'],'raw':!![]})[_0xeba0('0x13')](function(_0x330337){return _0x330337;});})[_0xeba0('0x13')](function(_0x51e0f3){if(_0x51e0f3){_0x3bc340['message'][_0xeba0('0x8a')]=_0x51e0f3[0x0];if(!_0x4cdf1d[_0xeba0('0x46')]['UserId'])return;return db[_0xeba0('0x7b')][_0xeba0('0x47')]({'where':{'id':_0x4cdf1d[_0xeba0('0x46')]['UserId'],'role':_0xeba0('0x6e')},'attributes':['id','name',_0xeba0('0x8b'),_0xeba0('0x8c'),_0xeba0('0x7c')],'raw':!![]});}return null;})['then'](function(_0x343092){if(!_0x343092)return null;_0x3bc340[_0xeba0('0x1b')][_0xeba0('0x6e')]=_0x343092;return _0x3bc340;})[_0xeba0('0x13')](function(_0x14edb3){if(_0x14edb3){_0x14edb3[_0xeba0('0x1b')][_0xeba0('0x7d')]=util['format'](_0xeba0('0x7e'),_0x4cdf1d['user'][_0xeba0('0x27')]);_0x14edb3['message']['channel']=_0x3bc340[_0xeba0('0x7f')];_0x14edb3[_0xeba0('0x1b')][_0xeba0('0x80')]=_0x3bc340[_0xeba0('0x7f')];_0x14edb3[_0xeba0('0x1b')][_0xeba0('0x81')]=_0xeba0('0x85');_0x14edb3['message'][_0xeba0('0x46')]=htmlToText[_0xeba0('0x82')](_0x3bc340[_0xeba0('0x1b')][_0xeba0('0x46')]);respondWithRpcPromise(_0xeba0('0x83'),_0xeba0('0x83'),{'event':_0xeba0('0x8d'),'message':_0x14edb3[_0xeba0('0x1b')]},client9002);return _0x3bc340;}return null;})[_0xeba0('0x13')](respondWithResult(_0x535e18,null))[_0xeba0('0x1c')](handleError(_0x535e18,null));};exports[_0xeba0('0x8e')]=function(_0x1a0b3a,_0x2272df){var _0x5b4a9c=moment()[_0xeba0('0x8f')]()['toString']();var _0x3eca5a=path[_0xeba0('0x90')](config[_0xeba0('0x91')],_0xeba0('0x92'),_0xeba0('0x93'),_0xeba0('0x94'));var _0x48dfd2=path[_0xeba0('0x90')](config[_0xeba0('0x91')],_0xeba0('0x92'),'files',_0xeba0('0x5f'));var _0x2ef406=util['format']('message-%s.eml',_0x5b4a9c);return db[_0xeba0('0x2a')][_0xeba0('0x47')]({'where':{'id':_0x1a0b3a[_0xeba0('0x44')]['id']},'attributes':['id','body',_0xeba0('0x95'),'to','cc',_0xeba0('0x96'),_0xeba0('0x97'),'createdAt'],'include':_0x1a0b3a[_0xeba0('0x33')][_0xeba0('0x5f')]?[{'model':db[_0xeba0('0x98')],'as':_0xeba0('0x99')}]:undefined})[_0xeba0('0x13')](handleEntityNotFound(_0x2272df,null))['then'](function(_0x72b078){if(_0x72b078){var _0x1c8cf2=_0x72b078;var _0x130013={'from':_0x1c8cf2[_0xeba0('0x95')],'to':_0x1c8cf2['to'],'subject':_0x1c8cf2['subject'],'html':htmlEntities[_0xeba0('0x9a')](_0x1c8cf2['body']),'headers':{'Date':moment(_0x1c8cf2[_0xeba0('0x9b')])[_0xeba0('0x67')](_0xeba0('0x9c'))},'attachments':[]};if(_0x72b078['cc']){_0x130013[_0xeba0('0x9d')]['Cc']=_0x72b078['cc'];}if(_0x72b078[_0xeba0('0x96')]){_0x130013['headers']['Bcc']=_0x72b078[_0xeba0('0x96')];}return new BPromise(function(_0x5e3b3e,_0x5c4f8b){if(_0x72b078[_0xeba0('0x99')]){for(var _0x5dfded=0x0;_0x5dfded<_0x72b078[_0xeba0('0x99')]['length'];_0x5dfded++){var _0x53563f=_0x72b078['Attachments'][_0x5dfded];var _0x24df88=path[_0xeba0('0x90')](_0x48dfd2,_0x53563f[_0xeba0('0x61')]);if(fs['existsSync'](_0x24df88)){_0x130013[_0xeba0('0x5f')]['push']({'name':_0x53563f['name'],'contentType':_0x53563f[_0xeba0('0x2d')],'data':fs[_0xeba0('0x9e')](_0x24df88)});}}}emlformat[_0xeba0('0x9f')](_0x130013,function(_0x2e7203,_0x5bc31d){if(_0x2e7203)return _0x5c4f8b(_0x2e7203);fs['writeFileSync'](path[_0xeba0('0x90')](_0x3eca5a,_0x2ef406),_0x5bc31d);return _0x5e3b3e(_0x5bc31d);});});}})[_0xeba0('0x13')](function(_0x168aa1){if(_0x168aa1){return _0x2272df['download'](path[_0xeba0('0x90')](_0x3eca5a,_0x2ef406),_0x2ef406,function(_0x4f0ac3){if(!_0x4f0ac3)fs['unlinkSync'](path['join'](_0x3eca5a,_0x2ef406));});}})[_0xeba0('0x1c')](handleError(_0x2272df,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 8960625..188aaa7 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 _0x0161=['save','update','emit','hasOwnProperty','exports','../../mysqldb','MailMessage','setMaxListeners'];(function(_0x38fb0d,_0x52b5db){var _0x30a5d6=function(_0x31eba6){while(--_0x31eba6){_0x38fb0d['push'](_0x38fb0d['shift']());}};_0x30a5d6(++_0x52b5db);}(_0x0161,0xb5));var _0x1016=function(_0xc8aa0c,_0x512f7a){_0xc8aa0c=_0xc8aa0c-0x0;var _0x4fb56c=_0x0161[_0xc8aa0c];return _0x4fb56c;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x1016('0x0'))['db'][_0x1016('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x1016('0x2')](0x0);var events={'afterCreate':_0x1016('0x3'),'afterUpdate':_0x1016('0x4'),'afterDestroy':'remove'};function emitEvent(_0x481f0a){return function(_0x522663,_0x49cdb2,_0x6ca0bb){MailMessageEvents[_0x1016('0x5')](_0x481f0a+':'+_0x522663['id'],_0x522663);MailMessageEvents[_0x1016('0x5')](_0x481f0a,_0x522663);_0x6ca0bb(null);};}for(var e in events){if(events[_0x1016('0x6')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x1016('0x7')]=MailMessageEvents; \ No newline at end of file +var _0xecf1=['save','remove','emit','hook','exports','events','MailMessage','setMaxListeners'];(function(_0x88d2fd,_0x1a6bbb){var _0x37ca48=function(_0xfb5896){while(--_0xfb5896){_0x88d2fd['push'](_0x88d2fd['shift']());}};_0x37ca48(++_0x1a6bbb);}(_0xecf1,0x8d));var _0x1ecf=function(_0x2a0738,_0x3c0bc5){_0x2a0738=_0x2a0738-0x0;var _0x159679=_0xecf1[_0x2a0738];return _0x159679;};'use strict';var EventEmitter=require(_0x1ecf('0x0'));var MailMessage=require('../../mysqldb')['db'][_0x1ecf('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x1ecf('0x2')](0x0);var events={'afterCreate':_0x1ecf('0x3'),'afterUpdate':'update','afterDestroy':_0x1ecf('0x4')};function emitEvent(_0x43780c){return function(_0x36faf8,_0x15c986,_0x5df2f6){MailMessageEvents[_0x1ecf('0x5')](_0x43780c+':'+_0x36faf8['id'],_0x36faf8);MailMessageEvents['emit'](_0x43780c,_0x36faf8);_0x5df2f6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x1ecf('0x6')](e,emitEvent(event));}}module[_0x1ecf('0x7')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 096afe1..8612da8 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 _0xaab5=['direction','toLowerCase','isNil','UserId','MailInteraction','findOne','MailInteractionId','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailMessage.attributes','exports','define','mail_messages','messageId','fti_mail_messages','subject','FULLTEXT','body','plainBody','models'];(function(_0xaeb50,_0x355eca){var _0x4637b7=function(_0x46c9d6){while(--_0x46c9d6){_0xaeb50['push'](_0xaeb50['shift']());}};_0x4637b7(++_0x355eca);}(_0xaab5,0x16c));var _0x5aab=function(_0x2f0053,_0x353f20){_0x2f0053=_0x2f0053-0x0;var _0x5b5fd0=_0xaab5[_0x2f0053];return _0x5b5fd0;};'use strict';var _=require(_0x5aab('0x0'));var util=require(_0x5aab('0x1'));var logger=require(_0x5aab('0x2'))(_0x5aab('0x3'));var moment=require(_0x5aab('0x4'));var BPromise=require(_0x5aab('0x5'));var rp=require(_0x5aab('0x6'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x5aab('0x7'));var rimraf=require(_0x5aab('0x8'));var config=require('../../config/environment');var attributes=require(_0x5aab('0x9'));module[_0x5aab('0xa')]=function(_0x3742e6,_0x46d9eb){return _0x3742e6[_0x5aab('0xb')]('MailMessage',attributes,{'tableName':_0x5aab('0xc'),'paranoid':![],'indexes':[{'name':_0x5aab('0xd'),'fields':[_0x5aab('0xd')]},{'name':_0x5aab('0xe'),'fields':['plainBody',_0x5aab('0xf')],'type':_0x5aab('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4f1586,_0x34b64c,_0x299cd0){if(_0x4f1586[_0x5aab('0x11')]){_0x4f1586[_0x5aab('0x12')]=htmlToText['fromString'](_0x4f1586[_0x5aab('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x299cd0(null,_0x34b64c);},'afterCreate':function(_0x5bfeb5,_0xf477cb,_0x4db42a){var _0x341e0d=_0x3742e6[_0x5aab('0x13')];var _0x33059c=_0x5bfeb5['get']({'plain':!![]});if(_0x33059c[_0x5aab('0x14')][_0x5aab('0x15')]()==='in'||_0x33059c[_0x5aab('0x14')]['toLowerCase']()==='out'&&!_0x33059c['secret']&&!_[_0x5aab('0x16')](_0x33059c[_0x5aab('0x17')])){_0x341e0d[_0x5aab('0x18')][_0x5aab('0x19')]({'where':{'id':_0x33059c[_0x5aab('0x1a')]}})['then'](function(_0x1500fe){if(_0x1500fe){_0x1500fe[_0x5aab('0x1b')]({'lastMsgAt':_0x33059c[_0x5aab('0x1c')],'lastMsgDirection':_0x33059c[_0x5aab('0x14')][_0x5aab('0x15')]()});}})['catch'](function(_0x44fd5d){console[_0x5aab('0x1d')](_0x44fd5d);});}_0x4db42a();}},'charset':_0x5aab('0x1e'),'collate':_0x5aab('0x1f')});}; \ No newline at end of file +var _0xce6a=['get','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body'];(function(_0x211087,_0x354fdd){var _0x2a581f=function(_0x2928fe){while(--_0x2928fe){_0x211087['push'](_0x211087['shift']());}};_0x2a581f(++_0x354fdd);}(_0xce6a,0xa0));var _0xace6=function(_0x2bb70e,_0x65f470){_0x2bb70e=_0x2bb70e-0x0;var _0x41adca=_0xce6a[_0x2bb70e];return _0x41adca;};'use strict';var _=require('lodash');var util=require(_0xace6('0x0'));var logger=require(_0xace6('0x1'))(_0xace6('0x2'));var moment=require(_0xace6('0x3'));var BPromise=require(_0xace6('0x4'));var rp=require(_0xace6('0x5'));var htmlToText=require(_0xace6('0x6'));var fs=require('fs');var path=require(_0xace6('0x7'));var rimraf=require(_0xace6('0x8'));var config=require(_0xace6('0x9'));var attributes=require(_0xace6('0xa'));module[_0xace6('0xb')]=function(_0x45f4fc,_0xd2a39b){return _0x45f4fc[_0xace6('0xc')]('MailMessage',attributes,{'tableName':_0xace6('0xd'),'paranoid':![],'indexes':[{'name':_0xace6('0xe'),'fields':[_0xace6('0xe')]},{'name':_0xace6('0xf'),'fields':[_0xace6('0x10'),_0xace6('0x11')],'type':_0xace6('0x12')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xcbaefe,_0x48cb82,_0x18b6e2){if(_0xcbaefe['body']){_0xcbaefe['plainBody']=htmlToText['fromString'](_0xcbaefe[_0xace6('0x13')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x18b6e2(null,_0x48cb82);},'afterCreate':function(_0x25a972,_0x72e35,_0x3961f4){var _0x41131b=_0x45f4fc['models'];var _0x51901f=_0x25a972[_0xace6('0x14')]({'plain':!![]});if(_0x51901f[_0xace6('0x15')][_0xace6('0x16')]()==='in'||_0x51901f['direction'][_0xace6('0x16')]()===_0xace6('0x17')&&!_0x51901f[_0xace6('0x18')]&&!_[_0xace6('0x19')](_0x51901f[_0xace6('0x1a')])){_0x41131b[_0xace6('0x1b')][_0xace6('0x1c')]({'where':{'id':_0x51901f[_0xace6('0x1d')]}})[_0xace6('0x1e')](function(_0x4c4a43){if(_0x4c4a43){_0x4c4a43[_0xace6('0x1f')]({'lastMsgAt':_0x51901f[_0xace6('0x20')],'lastMsgDirection':_0x51901f[_0xace6('0x15')]['toLowerCase']()});}})['catch'](function(_0x9c6667){console[_0xace6('0x21')](_0x9c6667);});}_0x3961f4();}},'charset':_0xace6('0x22'),'collate':_0xace6('0x23')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index eec361f..d71a1f9 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 _0x6a95=['MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailMessage','create','body','options','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','MailMessage,\x20%s,\x20%s','debug'];(function(_0x20fbb7,_0x2086dc){var _0x460068=function(_0x158d82){while(--_0x158d82){_0x20fbb7['push'](_0x20fbb7['shift']());}};_0x460068(++_0x2086dc);}(_0x6a95,0x1db));var _0x56a9=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x6a95[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require(_0x56a9('0x0'));var util=require(_0x56a9('0x1'));var moment=require(_0x56a9('0x2'));var BPromise=require(_0x56a9('0x3'));var rs=require(_0x56a9('0x4'));var fs=require('fs');var Redis=require(_0x56a9('0x5'));var db=require(_0x56a9('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x56a9('0x7'));var config=require(_0x56a9('0x8'));var jayson=require(_0x56a9('0x9'));var client=jayson[_0x56a9('0xa')][_0x56a9('0xb')]({'port':0x232a});config[_0x56a9('0xc')]=_[_0x56a9('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x56a9('0xe'))(new Redis(config[_0x56a9('0xc')]));require('./mailMessage.socket')[_0x56a9('0xf')](socket);function respondWithRpcPromise(_0x1eddfd,_0x2d590d,_0xcf7c){return new BPromise(function(_0x3c1506,_0x319ff3){return client[_0x56a9('0x10')](_0x1eddfd,_0xcf7c)[_0x56a9('0x11')](function(_0x9ab10c){logger['info'](_0x56a9('0x12'),_0x2d590d,'request\x20sent');logger[_0x56a9('0x13')](_0x56a9('0x14'),_0x2d590d,_0x56a9('0x15'),JSON[_0x56a9('0x16')](_0x9ab10c));if(_0x9ab10c[_0x56a9('0x17')]){if(_0x9ab10c[_0x56a9('0x17')][_0x56a9('0x18')]===0x1f4){logger[_0x56a9('0x17')](_0x56a9('0x12'),_0x2d590d,_0x9ab10c['error']['message']);return _0x319ff3(_0x9ab10c[_0x56a9('0x17')][_0x56a9('0x19')]);}logger[_0x56a9('0x17')](_0x56a9('0x12'),_0x2d590d,_0x9ab10c['error'][_0x56a9('0x19')]);return _0x3c1506(_0x9ab10c['error']['message']);}else{logger['info'](_0x56a9('0x12'),_0x2d590d,_0x56a9('0x15'));_0x3c1506(_0x9ab10c[_0x56a9('0x1a')][_0x56a9('0x19')]);}})[_0x56a9('0x1b')](function(_0x429e24){logger[_0x56a9('0x17')](_0x56a9('0x12'),_0x2d590d,_0x429e24);_0x319ff3(_0x429e24);});});}exports[_0x56a9('0x1c')]=function(_0x335cc3){var _0x2ff2ca=this;return new Promise(function(_0x62f79f,_0x5f145f){return db['MailMessage'][_0x56a9('0x1d')](_0x335cc3[_0x56a9('0x1e')],{'raw':_0x335cc3[_0x56a9('0x1f')]?_0x335cc3[_0x56a9('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0x56a9('0x11')](function(_0x3355c4){logger[_0x56a9('0x20')](_0x56a9('0x1c'),_0x335cc3);logger['debug'](_0x56a9('0x1c'),_0x335cc3,JSON[_0x56a9('0x16')](_0x3355c4));_0x62f79f(_0x3355c4);})[_0x56a9('0x1b')](function(_0xd029f7){logger[_0x56a9('0x17')]('CreateMailMessage',_0xd029f7[_0x56a9('0x19')],_0x335cc3);_0x5f145f(_0x2ff2ca[_0x56a9('0x17')](0x1f4,_0xd029f7[_0x56a9('0x19')]));});});}; \ No newline at end of file +var _0x36ee=['catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateMailMessage','MailMessage','create','body','options','debug'];(function(_0xee6bd0,_0x27979f){var _0x48fd8d=function(_0x25422d){while(--_0x25422d){_0xee6bd0['push'](_0xee6bd0['shift']());}};_0x48fd8d(++_0x27979f);}(_0x36ee,0xe8));var _0xe36e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x36ee[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe36e('0x0'));var BPromise=require('bluebird');var rs=require(_0xe36e('0x1'));var fs=require('fs');var Redis=require(_0xe36e('0x2'));var db=require(_0xe36e('0x3'))['db'];var utils=require(_0xe36e('0x4'));var logger=require(_0xe36e('0x5'))(_0xe36e('0x6'));var config=require(_0xe36e('0x7'));var jayson=require(_0xe36e('0x8'));var client=jayson[_0xe36e('0x9')][_0xe36e('0xa')]({'port':0x232a});config[_0xe36e('0xb')]=_[_0xe36e('0xc')](config['redis'],{'host':_0xe36e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe36e('0xb')]));require(_0xe36e('0xe'))[_0xe36e('0xf')](socket);function respondWithRpcPromise(_0x47ce3a,_0xf119e4,_0x48981b){return new BPromise(function(_0x2e968d,_0x2133cf){return client[_0xe36e('0x10')](_0x47ce3a,_0x48981b)[_0xe36e('0x11')](function(_0xce0110){logger[_0xe36e('0x12')](_0xe36e('0x13'),_0xf119e4,_0xe36e('0x14'));logger['debug'](_0xe36e('0x15'),_0xf119e4,_0xe36e('0x14'),JSON[_0xe36e('0x16')](_0xce0110));if(_0xce0110[_0xe36e('0x17')]){if(_0xce0110['error'][_0xe36e('0x18')]===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0xf119e4,_0xce0110[_0xe36e('0x17')][_0xe36e('0x19')]);return _0x2133cf(_0xce0110[_0xe36e('0x17')][_0xe36e('0x19')]);}logger[_0xe36e('0x17')](_0xe36e('0x13'),_0xf119e4,_0xce0110[_0xe36e('0x17')][_0xe36e('0x19')]);return _0x2e968d(_0xce0110[_0xe36e('0x17')][_0xe36e('0x19')]);}else{logger['info'](_0xe36e('0x13'),_0xf119e4,_0xe36e('0x14'));_0x2e968d(_0xce0110['result'][_0xe36e('0x19')]);}})['catch'](function(_0x471400){logger[_0xe36e('0x17')]('MailMessage,\x20%s,\x20%s',_0xf119e4,_0x471400);_0x2133cf(_0x471400);});});}exports[_0xe36e('0x1a')]=function(_0x6aa186){var _0x21efe7=this;return new Promise(function(_0x597331,_0x21e95e){return db[_0xe36e('0x1b')][_0xe36e('0x1c')](_0x6aa186[_0xe36e('0x1d')],{'raw':_0x6aa186[_0xe36e('0x1e')]?_0x6aa186[_0xe36e('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0xe36e('0x11')](function(_0x4f214a){logger[_0xe36e('0x12')](_0xe36e('0x1a'),_0x6aa186);logger[_0xe36e('0x1f')]('CreateMailMessage',_0x6aa186,JSON['stringify'](_0x4f214a));_0x597331(_0x4f214a);})[_0xe36e('0x20')](function(_0x10818d){logger[_0xe36e('0x17')](_0xe36e('0x1a'),_0x10818d[_0xe36e('0x19')],_0x6aa186);_0x21e95e(_0x21efe7[_0xe36e('0x17')](0x1f4,_0x10818d[_0xe36e('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 92351e8..dc87a60 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 _0x867f=['save','remove','update','removeListener','register','length','mailMessage:','./mailMessage.events'];(function(_0x2efe09,_0x2f63fd){var _0x1858ad=function(_0x14bee7){while(--_0x14bee7){_0x2efe09['push'](_0x2efe09['shift']());}};_0x1858ad(++_0x2f63fd);}(_0x867f,0x7f));var _0xf867=function(_0x76fea7,_0x164167){_0x76fea7=_0x76fea7-0x0;var _0x3183c0=_0x867f[_0x76fea7];return _0x3183c0;};'use strict';var MailMessageEvents=require(_0xf867('0x0'));var events=[_0xf867('0x1'),_0xf867('0x2'),_0xf867('0x3')];function createListener(_0x459ddd,_0x41768e){return function(_0x821d34){_0x41768e['emit'](_0x459ddd,_0x821d34);};}function removeListener(_0x5128f9,_0x59304d){return function(){MailMessageEvents[_0xf867('0x4')](_0x5128f9,_0x59304d);};}exports[_0xf867('0x5')]=function(_0x33b5a7){for(var _0x254e82=0x0,_0x5a1a44=events[_0xf867('0x6')];_0x254e82<_0x5a1a44;_0x254e82++){var _0x35b3ac=events[_0x254e82];var _0x24d6f3=createListener(_0xf867('0x7')+_0x35b3ac,_0x33b5a7);MailMessageEvents['on'](_0x35b3ac,_0x24d6f3);}}; \ No newline at end of file +var _0x220b=['remove','update','emit','mailMessage:','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x220b,0x1b7));var _0xb220=function(_0x3042c5,_0x36cb88){_0x3042c5=_0x3042c5-0x0;var _0x7cd140=_0x220b[_0x3042c5];return _0x7cd140;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0xb220('0x0'),_0xb220('0x1'),_0xb220('0x2')];function createListener(_0x659ee1,_0x2c8e01){return function(_0x227960){_0x2c8e01[_0xb220('0x3')](_0x659ee1,_0x227960);};}function removeListener(_0x287097,_0x4b01ea){return function(){MailMessageEvents['removeListener'](_0x287097,_0x4b01ea);};}exports['register']=function(_0x5719c9){for(var _0x477aaf=0x0,_0x5943d3=events['length'];_0x477aaf<_0x5943d3;_0x477aaf++){var _0x4bde5e=events[_0x477aaf];var _0x49c4ea=createListener(_0xb220('0x4')+_0x4bde5e,_0x5719c9);MailMessageEvents['on'](_0x4bde5e,_0x49c4ea);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 1f30417..37ac0dc 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 _0x97d8=['post','create','addTeams','addAgents','put','update','destroy','delete','removeTeams','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailQueue.controller','get','index','/describe','describe','/:id','isAuthenticated','show','getMembers','/:id/teams','getTeams','/:id/users'];(function(_0x448112,_0x55c6d6){var _0x1ac558=function(_0xc792f7){while(--_0xc792f7){_0x448112['push'](_0x448112['shift']());}};_0x1ac558(++_0x55c6d6);}(_0x97d8,0x154));var _0x897d=function(_0x22e29e,_0x389148){_0x22e29e=_0x22e29e-0x0;var _0x54f5ec=_0x97d8[_0x22e29e];return _0x54f5ec;};'use strict';var multer=require(_0x897d('0x0'));var util=require(_0x897d('0x1'));var path=require(_0x897d('0x2'));var timeout=require('connect-timeout');var express=require(_0x897d('0x3'));var router=express[_0x897d('0x4')]();var fs_extra=require(_0x897d('0x5'));var auth=require(_0x897d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x897d('0x7'));var controller=require(_0x897d('0x8'));router[_0x897d('0x9')]('/',auth['isAuthenticated'](),controller[_0x897d('0xa')]);router[_0x897d('0x9')](_0x897d('0xb'),auth['isAuthenticated'](),controller[_0x897d('0xc')]);router['get'](_0x897d('0xd'),auth[_0x897d('0xe')](),controller[_0x897d('0xf')]);router['get']('/:id/members',auth[_0x897d('0xe')](),controller[_0x897d('0x10')]);router[_0x897d('0x9')](_0x897d('0x11'),auth[_0x897d('0xe')](),controller[_0x897d('0x12')]);router[_0x897d('0x9')](_0x897d('0x13'),auth[_0x897d('0xe')](),controller['getAgents']);router[_0x897d('0x14')]('/',auth[_0x897d('0xe')](),controller[_0x897d('0x15')]);router[_0x897d('0x14')](_0x897d('0x11'),auth['isAuthenticated'](),controller[_0x897d('0x16')]);router[_0x897d('0x14')]('/:id/users',auth[_0x897d('0xe')](),controller[_0x897d('0x17')]);router[_0x897d('0x18')](_0x897d('0xd'),auth[_0x897d('0xe')](),controller[_0x897d('0x19')]);router['delete'](_0x897d('0xd'),auth[_0x897d('0xe')](),controller[_0x897d('0x1a')]);router[_0x897d('0x1b')]('/:id/teams',auth[_0x897d('0xe')](),controller[_0x897d('0x1c')]);router[_0x897d('0x1b')](_0x897d('0x13'),auth[_0x897d('0xe')](),controller['removeAgents']);module[_0x897d('0x1d')]=router; \ No newline at end of file +var _0x823d=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','isAuthenticated','index','get','/describe','/:id','show','getMembers','getTeams','getAgents','post','create','/:id/teams','/:id/users','put','delete','destroy','removeAgents','multer'];(function(_0x550b0f,_0x197dcc){var _0x1bf8ef=function(_0x338742){while(--_0x338742){_0x550b0f['push'](_0x550b0f['shift']());}};_0x1bf8ef(++_0x197dcc);}(_0x823d,0x137));var _0xd823=function(_0xd60031,_0x5efb93){_0xd60031=_0xd60031-0x0;var _0x43d00a=_0x823d[_0xd60031];return _0x43d00a;};'use strict';var multer=require(_0xd823('0x0'));var util=require(_0xd823('0x1'));var path=require(_0xd823('0x2'));var timeout=require(_0xd823('0x3'));var express=require(_0xd823('0x4'));var router=express['Router']();var fs_extra=require(_0xd823('0x5'));var auth=require(_0xd823('0x6'));var interaction=require(_0xd823('0x7'));var config=require('../../config/environment');var controller=require(_0xd823('0x8'));router['get']('/',auth[_0xd823('0x9')](),controller[_0xd823('0xa')]);router[_0xd823('0xb')](_0xd823('0xc'),auth[_0xd823('0x9')](),controller['describe']);router[_0xd823('0xb')](_0xd823('0xd'),auth[_0xd823('0x9')](),controller[_0xd823('0xe')]);router[_0xd823('0xb')]('/:id/members',auth[_0xd823('0x9')](),controller[_0xd823('0xf')]);router['get']('/:id/teams',auth[_0xd823('0x9')](),controller[_0xd823('0x10')]);router[_0xd823('0xb')]('/:id/users',auth['isAuthenticated'](),controller[_0xd823('0x11')]);router[_0xd823('0x12')]('/',auth['isAuthenticated'](),controller[_0xd823('0x13')]);router[_0xd823('0x12')](_0xd823('0x14'),auth[_0xd823('0x9')](),controller['addTeams']);router['post'](_0xd823('0x15'),auth[_0xd823('0x9')](),controller['addAgents']);router[_0xd823('0x16')]('/:id',auth[_0xd823('0x9')](),controller['update']);router[_0xd823('0x17')](_0xd823('0xd'),auth['isAuthenticated'](),controller[_0xd823('0x18')]);router['delete'](_0xd823('0x14'),auth[_0xd823('0x9')](),controller['removeTeams']);router[_0xd823('0x17')](_0xd823('0x15'),auth[_0xd823('0x9')](),controller[_0xd823('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 974500a..abf1ce8 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 _0x12a7=['INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports','STRING','name'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x12a7,0x64));var _0x712a=function(_0x39f8aa,_0x26cd36){_0x39f8aa=_0x39f8aa-0x0;var _0x66e1c8=_0x12a7[_0x39f8aa];return _0x66e1c8;};'use strict';var Sequelize=require(_0x712a('0x0'));module[_0x712a('0x1')]={'name':{'type':Sequelize[_0x712a('0x2')],'unique':_0x712a('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x712a('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x712a('0x5')](_0x712a('0x6'),'beepall',_0x712a('0x7'))}}; \ No newline at end of file +var _0xbd5e=['INTEGER','ENUM','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x3f171b,_0x7af153){var _0x1f1893=function(_0x12684b){while(--_0x12684b){_0x3f171b['push'](_0x3f171b['shift']());}};_0x1f1893(++_0x7af153);}(_0xbd5e,0xcf));var _0xebd5=function(_0x391342,_0x35b0aa){_0x391342=_0x391342-0x0;var _0x352751=_0xbd5e[_0x391342];return _0x352751;};'use strict';var Sequelize=require(_0xebd5('0x0'));module[_0xebd5('0x1')]={'name':{'type':Sequelize[_0xebd5('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xebd5('0x2')]},'timeout':{'type':Sequelize[_0xebd5('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xebd5('0x4')]('rrmemory',_0xebd5('0x5'),_0xebd5('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index c288740..3afa248 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 _0x349a=['filter','where','merge','options','count','includeAll','include','findAll','rows','show','params','model','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','hasOwnProperty','order','pick','findAndCountAll','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','rawAttributes','addTeams','ids','voicePause','interface','flatMap','get','Agents','sequelize','transaction','each','UserMailQueue','findOrCreate','userMailQueue:save','removeTeams','User','select','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','all','union','compact','isEmpty','removeAgents','forEach','emit','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','register','status','end','json','offset','undefined','limit','set','reject','save','update','destroy','then','MailQueues','UserProfileResource','sendStatus','error','name','send','map','MailQueue','fieldName','type','key','query','keys','filters','intersection','fields','attributes','length','nolimit','sort'];(function(_0x2bb217,_0x5190f2){var _0x4ec5d0=function(_0xf7c8ba){while(--_0xf7c8ba){_0x2bb217['push'](_0x2bb217['shift']());}};_0x4ec5d0(++_0x5190f2);}(_0x349a,0xd8));var _0xa349=function(_0x1e8461,_0x5e1500){_0x1e8461=_0x1e8461-0x0;var _0x528f4d=_0x349a[_0x1e8461];return _0x528f4d;};'use strict';var emlformat=require(_0xa349('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa349('0x1'));var jsonpatch=require(_0xa349('0x2'));var rp=require('request-promise');var moment=require(_0xa349('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa349('0x4'));var util=require(_0xa349('0x5'));var path=require(_0xa349('0x6'));var sox=require(_0xa349('0x7'));var csv=require(_0xa349('0x8'));var ejs=require(_0xa349('0x9'));var fs=require('fs');var fs_extra=require(_0xa349('0xa'));var _=require(_0xa349('0xb'));var squel=require(_0xa349('0xc'));var crypto=require(_0xa349('0xd'));var jsforce=require(_0xa349('0xe'));var deskjs=require(_0xa349('0xf'));var toCsv=require(_0xa349('0x8'));var querystring=require(_0xa349('0x10'));var Papa=require(_0xa349('0x11'));var Redis=require(_0xa349('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa349('0x13'));var as=require(_0xa349('0x14'));var hardwareService=require(_0xa349('0x15'));var logger=require(_0xa349('0x16'))('api');var utils=require(_0xa349('0x17'));var config=require(_0xa349('0x18'));var licenseUtil=require(_0xa349('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xa349('0x1a')](config[_0xa349('0x1b')],{'host':_0xa349('0x1c'),'port':0x18eb});var socket=require(_0xa349('0x1d'))(new Redis(config[_0xa349('0x1b')]));require(_0xa349('0x1e'))[_0xa349('0x1f')](socket);function respondWithStatusCode(_0x412c06,_0x36d964){_0x36d964=_0x36d964||0xcc;return function(_0xa287dd){if(_0xa287dd){return _0x412c06['sendStatus'](_0x36d964);}return _0x412c06[_0xa349('0x20')](_0x36d964)[_0xa349('0x21')]();};}function respondWithResult(_0x597f31,_0x5dbabe){_0x5dbabe=_0x5dbabe||0xc8;return function(_0x55d5af){if(_0x55d5af){return _0x597f31['status'](_0x5dbabe)[_0xa349('0x22')](_0x55d5af);}};}function respondWithFilteredResult(_0x59110f,_0xae3da){return function(_0x1e291c){if(_0x1e291c){var _0xebd059=typeof _0xae3da[_0xa349('0x23')]===_0xa349('0x24')&&typeof _0xae3da['limit']===_0xa349('0x24');var _0x5e9248=_0x1e291c['count'];var _0x281fa2=_0xebd059?0x0:_0xae3da[_0xa349('0x23')];var _0x4c6d5d=_0xebd059?_0x1e291c['count']:_0xae3da[_0xa349('0x23')]+_0xae3da[_0xa349('0x25')];var _0x1c3c03;if(_0x4c6d5d>=_0x5e9248){_0x4c6d5d=_0x5e9248;_0x1c3c03=0xc8;}else{_0x1c3c03=0xce;}_0x59110f[_0xa349('0x20')](_0x1c3c03);return _0x59110f[_0xa349('0x26')]('Content-Range',_0x281fa2+'-'+_0x4c6d5d+'/'+_0x5e9248)[_0xa349('0x22')](_0x1e291c);}return null;};}function patchUpdates(_0x5601c2){return function(_0x28f120){try{jsonpatch['apply'](_0x28f120,_0x5601c2,!![]);}catch(_0x304758){return BPromise[_0xa349('0x27')](_0x304758);}return _0x28f120[_0xa349('0x28')]();};}function saveUpdates(_0x5f5df4,_0x43833f){return function(_0x1e7281){if(_0x1e7281){return _0x1e7281[_0xa349('0x29')](_0x5f5df4)['then'](function(_0x5d3edd){return _0x5d3edd;});}return null;};}function removeEntity(_0x3b26a7,_0x2f368d){return function(_0x76d4b2){if(_0x76d4b2){return _0x76d4b2[_0xa349('0x2a')]()[_0xa349('0x2b')](function(){var _0x1362c4=_0x76d4b2['get']({'plain':!![]});var _0x4e5057=_0xa349('0x2c');return db[_0xa349('0x2d')][_0xa349('0x2a')]({'where':{'type':_0x4e5057,'resourceId':_0x1362c4['id']}})['then'](function(){return _0x76d4b2;});})['then'](function(){_0x3b26a7[_0xa349('0x20')](0xcc)[_0xa349('0x21')]();});}};}function handleEntityNotFound(_0x3c6b40,_0x39704c){return function(_0x2e4e08){if(!_0x2e4e08){_0x3c6b40[_0xa349('0x2e')](0x194);}return _0x2e4e08;};}function handleError(_0x433158,_0x5de395){_0x5de395=_0x5de395||0x1f4;return function(_0x1ff15a){logger[_0xa349('0x2f')](_0x1ff15a['stack']);if(_0x1ff15a[_0xa349('0x30')]){delete _0x1ff15a[_0xa349('0x30')];}_0x433158[_0xa349('0x20')](_0x5de395)[_0xa349('0x31')](_0x1ff15a);};}exports['index']=function(_0x4706ca,_0x3215d1){var _0x1b5dc4={},_0x4144b6={},_0x3d5890={'count':0x0,'rows':[]};var _0x18eddf=_[_0xa349('0x32')](db[_0xa349('0x33')]['rawAttributes'],function(_0x44f583){return{'name':_0x44f583[_0xa349('0x34')],'type':_0x44f583[_0xa349('0x35')][_0xa349('0x36')]};});_0x4144b6['model']=_[_0xa349('0x32')](_0x18eddf,_0xa349('0x30'));_0x4144b6[_0xa349('0x37')]=_[_0xa349('0x38')](_0x4706ca['query']);_0x4144b6[_0xa349('0x39')]=_[_0xa349('0x3a')](_0x4144b6['model'],_0x4144b6['query']);_0x1b5dc4['attributes']=_['intersection'](_0x4144b6['model'],qs[_0xa349('0x3b')](_0x4706ca[_0xa349('0x37')][_0xa349('0x3b')]));_0x1b5dc4[_0xa349('0x3c')]=_0x1b5dc4['attributes'][_0xa349('0x3d')]?_0x1b5dc4[_0xa349('0x3c')]:_0x4144b6['model'];if(!_0x4706ca[_0xa349('0x37')]['hasOwnProperty'](_0xa349('0x3e'))){_0x1b5dc4[_0xa349('0x25')]=qs['limit'](_0x4706ca[_0xa349('0x37')]['limit']);_0x1b5dc4[_0xa349('0x23')]=qs[_0xa349('0x23')](_0x4706ca[_0xa349('0x37')]['offset']);}_0x1b5dc4['order']=qs[_0xa349('0x3f')](_0x4706ca[_0xa349('0x37')][_0xa349('0x3f')]);_0x1b5dc4['where']=qs[_0xa349('0x39')](_['pick'](_0x4706ca['query'],_0x4144b6['filters']),_0x18eddf);if(_0x4706ca[_0xa349('0x37')][_0xa349('0x40')]){_0x1b5dc4[_0xa349('0x41')]=_[_0xa349('0x42')](_0x1b5dc4[_0xa349('0x41')],{'$or':_[_0xa349('0x32')](_0x18eddf,function(_0x123159){if(_0x123159['type']!=='VIRTUAL'){var _0x161fd4={};_0x161fd4[_0x123159[_0xa349('0x30')]]={'$like':'%'+_0x4706ca[_0xa349('0x37')][_0xa349('0x40')]+'%'};return _0x161fd4;}})});}_0x1b5dc4=_[_0xa349('0x42')]({},_0x1b5dc4,_0x4706ca[_0xa349('0x43')]);var _0x2d594a={'where':_0x1b5dc4[_0xa349('0x41')]};return db['MailQueue'][_0xa349('0x44')](_0x2d594a)[_0xa349('0x2b')](function(_0x138fb6){_0x3d5890['count']=_0x138fb6;if(_0x4706ca[_0xa349('0x37')][_0xa349('0x45')]){_0x1b5dc4[_0xa349('0x46')]=[{'all':!![]}];}return db['MailQueue'][_0xa349('0x47')](_0x1b5dc4);})[_0xa349('0x2b')](function(_0x378d66){_0x3d5890[_0xa349('0x48')]=_0x378d66;return _0x3d5890;})[_0xa349('0x2b')](respondWithFilteredResult(_0x3215d1,_0x1b5dc4))['catch'](handleError(_0x3215d1,null));};exports[_0xa349('0x49')]=function(_0x417ad4,_0x21e4eb){var _0xa18734={'raw':!![],'where':{'id':_0x417ad4[_0xa349('0x4a')]['id']}},_0x424e88={};_0x424e88[_0xa349('0x4b')]=_[_0xa349('0x38')](db['MailQueue']['rawAttributes']);_0x424e88[_0xa349('0x37')]=_[_0xa349('0x38')](_0x417ad4[_0xa349('0x37')]);_0x424e88['filters']=_[_0xa349('0x3a')](_0x424e88[_0xa349('0x4b')],_0x424e88['query']);_0xa18734['attributes']=_[_0xa349('0x3a')](_0x424e88[_0xa349('0x4b')],qs['fields'](_0x417ad4[_0xa349('0x37')][_0xa349('0x3b')]));_0xa18734[_0xa349('0x3c')]=_0xa18734[_0xa349('0x3c')][_0xa349('0x3d')]?_0xa18734[_0xa349('0x3c')]:_0x424e88[_0xa349('0x4b')];if(_0x417ad4[_0xa349('0x37')][_0xa349('0x45')]){_0xa18734[_0xa349('0x46')]=[{'all':!![]}];}_0xa18734=_[_0xa349('0x42')]({},_0xa18734,_0x417ad4['options']);return db[_0xa349('0x33')]['find'](_0xa18734)['then'](handleEntityNotFound(_0x21e4eb,null))[_0xa349('0x2b')](respondWithResult(_0x21e4eb,null))[_0xa349('0x4c')](handleError(_0x21e4eb,null));};exports[_0xa349('0x4d')]=function(_0xd561ef,_0x1062d8){return db['MailQueue'][_0xa349('0x4d')](_0xd561ef['body'],{})[_0xa349('0x2b')](function(_0x414c51){var _0x4391b4=_0xd561ef[_0xa349('0x4e')]['get']({'plain':!![]});if(!_0x4391b4)throw new Error(_0xa349('0x4f'));if(_0x4391b4[_0xa349('0x50')]===_0xa349('0x4e')){var _0x516882=_0x414c51['get']({'plain':!![]});var _0x3d8638='MailQueues';return db[_0xa349('0x51')][_0xa349('0x52')]({'where':{'name':_0x3d8638,'userProfileId':_0x4391b4['userProfileId']},'raw':!![]})['then'](function(_0x36ff26){if(_0x36ff26&&_0x36ff26[_0xa349('0x53')]===0x0){return db[_0xa349('0x2d')][_0xa349('0x4d')]({'name':_0x516882['name'],'resourceId':_0x516882['id'],'type':_0x36ff26[_0xa349('0x30')],'sectionId':_0x36ff26['id']},{})['then'](function(){return _0x414c51;});}else{return _0x414c51;}})['catch'](function(_0x5df58e){logger[_0xa349('0x2f')](_0xa349('0x54'),_0x5df58e);throw _0x5df58e;});}return _0x414c51;})[_0xa349('0x2b')](respondWithResult(_0x1062d8,0xc9))[_0xa349('0x4c')](handleError(_0x1062d8,null));};exports[_0xa349('0x29')]=function(_0x490dab,_0x19e0bf){if(_0x490dab[_0xa349('0x55')]['id']){delete _0x490dab[_0xa349('0x55')]['id'];}return db['MailQueue'][_0xa349('0x52')]({'where':{'id':_0x490dab[_0xa349('0x4a')]['id']}})[_0xa349('0x2b')](handleEntityNotFound(_0x19e0bf,null))[_0xa349('0x2b')](saveUpdates(_0x490dab[_0xa349('0x55')],null))['then'](respondWithResult(_0x19e0bf,null))['catch'](handleError(_0x19e0bf,null));};exports['destroy']=function(_0x2a3091,_0x4d48d1){return db[_0xa349('0x33')]['find']({'where':{'id':_0x2a3091['params']['id']}})[_0xa349('0x2b')](handleEntityNotFound(_0x4d48d1,null))[_0xa349('0x2b')](removeEntity(_0x4d48d1,null))[_0xa349('0x4c')](handleError(_0x4d48d1,null));};exports['describe']=function(_0x590d66,_0x3f2bf4){return db[_0xa349('0x33')][_0xa349('0x56')]()[_0xa349('0x2b')](respondWithResult(_0x3f2bf4,null))['catch'](handleError(_0x3f2bf4,null));};exports[_0xa349('0x57')]=function(_0x2fbf41,_0x2a9e36,_0x36adc0){var _0x1ca1da={'raw':!![],'where':{}},_0x1a461a={},_0x460d40;return db[_0xa349('0x33')]['findOne']({'where':{'id':_0x2fbf41[_0xa349('0x4a')]['id']}})[_0xa349('0x2b')](handleEntityNotFound(_0x2a9e36,null))['then'](function(_0x2b1b4f){if(_0x2b1b4f){_0x460d40=_0x2b1b4f['get']({'plain':!![]});_0x1a461a[_0xa349('0x4b')]=_[_0xa349('0x38')](db['UserMailQueue']['rawAttributes']);_0x1a461a[_0xa349('0x37')]=_['keys'](_0x2fbf41[_0xa349('0x37')]);_0x1a461a[_0xa349('0x39')]=_[_0xa349('0x3a')](_0x1a461a[_0xa349('0x4b')],_0x1a461a[_0xa349('0x37')]);_0x1ca1da[_0xa349('0x3c')]=_[_0xa349('0x3a')](_0x1a461a['model'],qs['fields'](_0x2fbf41[_0xa349('0x37')]['fields']));_0x1ca1da[_0xa349('0x3c')]=_0x1ca1da[_0xa349('0x3c')][_0xa349('0x3d')]?_0x1ca1da[_0xa349('0x3c')]:_0x1a461a['model'];if(!_0x2fbf41[_0xa349('0x37')][_0xa349('0x58')]('nolimit')){_0x1ca1da[_0xa349('0x25')]=qs[_0xa349('0x25')](_0x2fbf41[_0xa349('0x37')][_0xa349('0x25')]);_0x1ca1da['offset']=qs[_0xa349('0x23')](_0x2fbf41[_0xa349('0x37')][_0xa349('0x23')]);}_0x1ca1da[_0xa349('0x59')]=qs['sort'](_0x2fbf41[_0xa349('0x37')][_0xa349('0x3f')]);_0x1ca1da[_0xa349('0x41')]=qs[_0xa349('0x39')](_[_0xa349('0x5a')](_0x2fbf41[_0xa349('0x37')],_0x1a461a[_0xa349('0x39')]));_0x1ca1da[_0xa349('0x41')]['MailQueueId']=_0x2b1b4f['id'];if(_0x2fbf41[_0xa349('0x37')]['filter']){_0x1ca1da[_0xa349('0x41')]=_['merge'](_0x1ca1da[_0xa349('0x41')],{'$or':_[_0xa349('0x32')](_0x1ca1da[_0xa349('0x3c')],function(_0xe9f659){var _0x9515a1={};_0x9515a1[_0xe9f659]={'$like':'%'+_0x2fbf41[_0xa349('0x37')][_0xa349('0x40')]+'%'};return _0x9515a1;})});}_0x1ca1da=_['merge']({},_0x1ca1da,_0x2fbf41['options']);return db['UserMailQueue'][_0xa349('0x47')](_0x1ca1da);}})[_0xa349('0x2b')](function(_0x7be379){if(_0x7be379){return db['User'][_0xa349('0x5b')]({'where':{'id':_['map'](_0x7be379,'UserId'),'role':'agent'},'attributes':['id',_0xa349('0x30'),_0xa349('0x5c'),_0xa349('0x5d'),_0xa349('0x5e')]});}})['then'](function(_0x33c1ae){if(_0x33c1ae){return{'count':_0x33c1ae[_0xa349('0x44')],'rows':_[_0xa349('0x32')](_0x33c1ae[_0xa349('0x48')],function(_0x617656){return{'membername':_0x617656[_0xa349('0x30')],'UserId':_0x617656['id'],'queue_name':_0x460d40[_0xa349('0x30')],'MailQueueId':_0x460d40['id'],'interface':util[_0xa349('0x5f')](_0xa349('0x60'),_0xa349('0x61'),_0x617656[_0xa349('0x30')]),'penalty':0x0,'paused':_0x617656[_0xa349('0x5c')],'createdAt':_0x617656[_0xa349('0x5e')],'updatedAt':_0x617656['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xa349('0x2b')](respondWithFilteredResult(_0x2a9e36,_0x1ca1da))[_0xa349('0x4c')](handleError(_0x2a9e36,null));};exports[_0xa349('0x62')]=function(_0x29a955,_0x386656,_0x4e8454){var _0x391117={};var _0x5136ef={};var _0x3067d7;var _0x5d53d2;return db[_0xa349('0x33')][_0xa349('0x63')]({'where':{'id':_0x29a955[_0xa349('0x4a')]['id']}})[_0xa349('0x2b')](handleEntityNotFound(_0x386656,null))[_0xa349('0x2b')](function(_0x1c91e1){if(_0x1c91e1){_0x3067d7=_0x1c91e1;_0x5136ef['model']=_['keys'](db[_0xa349('0x64')][_0xa349('0x65')]);_0x5136ef[_0xa349('0x37')]=_['keys'](_0x29a955['query']);_0x5136ef[_0xa349('0x39')]=_[_0xa349('0x3a')](_0x5136ef[_0xa349('0x4b')],_0x5136ef[_0xa349('0x37')]);_0x391117[_0xa349('0x3c')]=_[_0xa349('0x3a')](_0x5136ef[_0xa349('0x4b')],qs[_0xa349('0x3b')](_0x29a955[_0xa349('0x37')]['fields']));_0x391117[_0xa349('0x3c')]=_0x391117['attributes'][_0xa349('0x3d')]?_0x391117['attributes']:_0x5136ef['model'];_0x391117[_0xa349('0x59')]=qs['sort'](_0x29a955[_0xa349('0x37')]['sort']);_0x391117[_0xa349('0x41')]=qs[_0xa349('0x39')](_[_0xa349('0x5a')](_0x29a955[_0xa349('0x37')],_0x5136ef['filters']));if(_0x29a955[_0xa349('0x37')][_0xa349('0x40')]){_0x391117[_0xa349('0x41')]=_[_0xa349('0x42')](_0x391117['where'],{'$or':_[_0xa349('0x32')](_0x391117[_0xa349('0x3c')],function(_0x40ef17){var _0x41bd00={};_0x41bd00[_0x40ef17]={'$like':'%'+_0x29a955[_0xa349('0x37')][_0xa349('0x40')]+'%'};return _0x41bd00;})});}_0x391117=_[_0xa349('0x42')]({},_0x391117,_0x29a955[_0xa349('0x43')]);return _0x3067d7[_0xa349('0x62')](_0x391117);}})[_0xa349('0x2b')](function(_0x7dda0f){if(_0x7dda0f){_0x5d53d2=_0x7dda0f['length'];if(!_0x29a955[_0xa349('0x37')]['hasOwnProperty'](_0xa349('0x3e'))){_0x391117['limit']=qs[_0xa349('0x25')](_0x29a955[_0xa349('0x37')][_0xa349('0x25')]);_0x391117[_0xa349('0x23')]=qs['offset'](_0x29a955[_0xa349('0x37')][_0xa349('0x23')]);}return _0x3067d7['getTeams'](_0x391117);}})['then'](function(_0x5241ba){if(_0x5241ba){return _0x5241ba?{'count':_0x5d53d2,'rows':_0x5241ba}:null;}})[_0xa349('0x2b')](respondWithResult(_0x386656,null))[_0xa349('0x4c')](handleError(_0x386656,null));};exports[_0xa349('0x66')]=function(_0x584711,_0x137b22,_0x3bd657){var _0x566e0e=_0x584711[_0xa349('0x55')][_0xa349('0x67')];return db[_0xa349('0x64')][_0xa349('0x47')]({'where':{'id':_0x566e0e},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xa349('0x30'),'online',_0xa349('0x68'),_0xa349('0x69')],'raw':!![]}]})['then'](function(_0x201e98){if(_0x201e98){var _0x38364a=_[_0xa349('0x6a')](_0x201e98,function(_0x3a01e6){var _0x3bea85=_0x3a01e6[_0xa349('0x6b')]({'plain':!![]});return _0x3bea85[_0xa349('0x6c')];});return db[_0xa349('0x33')][_0xa349('0x52')]({'where':{'id':_0x584711['params']['id']}})[_0xa349('0x2b')](function(_0x123fc8){return db[_0xa349('0x6d')][_0xa349('0x6e')](function(_0x1e7fa1){return _0x123fc8[_0xa349('0x66')](_0x566e0e,{'transaction':_0x1e7fa1})[_0xa349('0x2b')](function(){return BPromise[_0xa349('0x6f')](_0x38364a,function(_0x5c3dbd){return db[_0xa349('0x70')][_0xa349('0x71')]({'where':{'UserId':_0x5c3dbd['id'],'MailQueueId':_0x584711[_0xa349('0x4a')]['id']},'transaction':_0x1e7fa1});});})[_0xa349('0x2b')](function(){_0x38364a['forEach'](function(_0x3c1cb9){socket['emit'](_0xa349('0x72'),{'UserId':_0x3c1cb9['id'],'MailQueueId':_0x123fc8['id']});});});});});}})[_0xa349('0x2b')](respondWithStatusCode(_0x137b22,null))[_0xa349('0x4c')](handleError(_0x137b22,null));};exports[_0xa349('0x73')]=function(_0x50b0b3,_0xcfa830,_0x220047){return db[_0xa349('0x64')][_0xa349('0x47')]({'where':{'id':_0x50b0b3[_0xa349('0x37')]['ids']},'attributes':['id'],'include':[{'model':db[_0xa349('0x74')],'as':_0xa349('0x6c'),'attributes':['id'],'raw':!![]}]})[_0xa349('0x2b')](handleEntityNotFound(_0xcfa830,null))['then'](function(_0x613ed){var _0x481da2=_[_0xa349('0x32')](_0x613ed,'id');var _0x13d1dc=[];var _0x2b4a63=[];var _0x568a02=squel[_0xa349('0x75')]();_0x568a02['field']('tq.TeamId')['from']('team_has_mail_queues','tq')[_0xa349('0x76')](_0xa349('0x77'),'ut',_0xa349('0x78'))[_0xa349('0x41')]('MailQueueId\x20=\x20?',_0x50b0b3[_0xa349('0x4a')]['id']);for(var _0x18ff5a=0x0;_0x18ff5a<_0x613ed[_0xa349('0x3d')];_0x18ff5a+=0x1){let _0xa00ffb=_0x613ed[_0x18ff5a];for(var _0x4ddff1=0x0;_0x4ddff1<_0xa00ffb['Agents'][_0xa349('0x3d')];_0x4ddff1+=0x1){let _0x3110c7=_0xa00ffb[_0xa349('0x6c')][_0x4ddff1];var _0x36986a=_0x568a02[_0xa349('0x79')]();_0x36986a[_0xa349('0x41')](_0xa349('0x7a'),_0x3110c7['id']);_0x2b4a63['push'](db['sequelize'][_0xa349('0x37')](_0x36986a[_0xa349('0x7b')](),{'type':db[_0xa349('0x6d')][_0xa349('0x7c')]['SELECT']})['then'](function(_0x40cdf5){if(_0x40cdf5['length']===0x1){return _0x3110c7['id'];}else{var _0x566afe=_[_0xa349('0x7d')](_['map'](_0x40cdf5,_0xa349('0x7e')),function(_0x2219e6){return _['includes'](_0x481da2,_0x2219e6);});if(_0x566afe){return _0x3110c7['id'];}}}));}}return BPromise[_0xa349('0x7f')](_0x2b4a63)[_0xa349('0x2b')](function(_0x268f47){_0x13d1dc=_(_0x13d1dc)[_0xa349('0x80')](_0x268f47)[_0xa349('0x81')]()['value']();return db['MailQueue'][_0xa349('0x52')]({'where':{'id':_0x50b0b3[_0xa349('0x4a')]['id']}})['then'](function(_0x14f6f8){return db[_0xa349('0x6d')][_0xa349('0x6e')](function(_0x173793){return _0x14f6f8[_0xa349('0x73')](_0x50b0b3['query'][_0xa349('0x67')],{'transaction':_0x173793})['then'](function(){if(!_[_0xa349('0x82')](_0x13d1dc)){return _0x14f6f8[_0xa349('0x83')](_0x13d1dc,{'transaction':_0x173793});}})[_0xa349('0x2b')](function(){_0x13d1dc[_0xa349('0x84')](function(_0x2c330c){socket[_0xa349('0x85')](_0xa349('0x86'),{'UserId':_0x2c330c,'MailQueueId':_0x14f6f8['id']});});});});});});})['then'](respondWithStatusCode(_0xcfa830,null))[_0xa349('0x4c')](handleError(_0xcfa830,null));};exports[_0xa349('0x87')]=function(_0x69591b,_0x4adea6,_0x16cc77){return db['MailQueue'][_0xa349('0x52')]({'where':{'id':_0x69591b[_0xa349('0x4a')]['id']}})[_0xa349('0x2b')](handleEntityNotFound(_0x4adea6,null))['then'](function(_0x20b719){if(_0x20b719){return _0x20b719[_0xa349('0x87')](_0x69591b[_0xa349('0x55')]['ids'],_[_0xa349('0x88')](_0x69591b[_0xa349('0x55')],['ids','id'])||{})[_0xa349('0x89')](function(_0xed1640){for(var _0x427d08=0x0;_0x427d08<_0x69591b[_0xa349('0x55')]['ids'][_0xa349('0x3d')];_0x427d08+=0x1){socket[_0xa349('0x85')](_0xa349('0x72'),{'UserId':Number(_0x69591b[_0xa349('0x55')][_0xa349('0x67')][_0x427d08]),'MailQueueId':Number(_0x69591b[_0xa349('0x4a')]['id'])});}return _0xed1640;});}})[_0xa349('0x2b')](respondWithResult(_0x4adea6,null))[_0xa349('0x4c')](handleError(_0x4adea6,null));};exports['removeAgents']=function(_0x1d49d1,_0x3a5973,_0x59e054){return db[_0xa349('0x33')][_0xa349('0x52')]({'where':{'id':_0x1d49d1['params']['id']}})[_0xa349('0x2b')](handleEntityNotFound(_0x3a5973,null))['then'](function(_0x11ef9c){if(_0x11ef9c){return _0x11ef9c[_0xa349('0x83')](_0x1d49d1['query'][_0xa349('0x67')])[_0xa349('0x2b')](function(){if(_[_0xa349('0x8a')](_0x1d49d1[_0xa349('0x37')]['ids'])){for(var _0x5e7026=0x0;_0x5e7026<_0x1d49d1[_0xa349('0x37')][_0xa349('0x67')]['length'];_0x5e7026+=0x1){socket[_0xa349('0x85')](_0xa349('0x86'),{'UserId':Number(_0x1d49d1[_0xa349('0x37')][_0xa349('0x67')][_0x5e7026]),'MailQueueId':Number(_0x1d49d1[_0xa349('0x4a')]['id'])});}}else{socket['emit']('userMailQueue:remove',{'UserId':Number(_0x1d49d1[_0xa349('0x37')][_0xa349('0x67')]),'MailQueueId':Number(_0x1d49d1[_0xa349('0x4a')]['id'])});}});}})[_0xa349('0x2b')](respondWithStatusCode(_0x3a5973,null))[_0xa349('0x4c')](handleError(_0x3a5973,null));};exports['getAgents']=function(_0x3139fe,_0x336bfc,_0x246440){var _0x33c679={};var _0x2dbf91={};var _0x14d953;var _0x2eccbe;return db[_0xa349('0x33')][_0xa349('0x63')]({'where':{'id':_0x3139fe[_0xa349('0x4a')]['id']}})['then'](handleEntityNotFound(_0x336bfc,null))['then'](function(_0x37eb7c){if(_0x37eb7c){_0x14d953=_0x37eb7c;_0x2dbf91[_0xa349('0x4b')]=_[_0xa349('0x38')](db[_0xa349('0x74')][_0xa349('0x65')]);_0x2dbf91[_0xa349('0x37')]=_[_0xa349('0x38')](_0x3139fe[_0xa349('0x37')]);_0x2dbf91['filters']=_['intersection'](_0x2dbf91[_0xa349('0x4b')],_0x2dbf91[_0xa349('0x37')]);_0x33c679[_0xa349('0x3c')]=_['intersection'](_0x2dbf91[_0xa349('0x4b')],qs['fields'](_0x3139fe['query'][_0xa349('0x3b')]));_0x33c679['attributes']=_0x33c679['attributes']['length']?_0x33c679[_0xa349('0x3c')]:_0x2dbf91[_0xa349('0x4b')];_0x33c679['order']=qs[_0xa349('0x3f')](_0x3139fe[_0xa349('0x37')][_0xa349('0x3f')]);_0x33c679['where']=qs[_0xa349('0x39')](_[_0xa349('0x5a')](_0x3139fe[_0xa349('0x37')],_0x2dbf91[_0xa349('0x39')]));if(_0x3139fe[_0xa349('0x37')]['filter']){_0x33c679['where']=_[_0xa349('0x42')](_0x33c679[_0xa349('0x41')],{'$or':_[_0xa349('0x32')](_0x33c679[_0xa349('0x3c')],function(_0x5ed598){var _0x19be8f={};_0x19be8f[_0x5ed598]={'$like':'%'+_0x3139fe[_0xa349('0x37')][_0xa349('0x40')]+'%'};return _0x19be8f;})});}_0x33c679=_[_0xa349('0x42')]({},_0x33c679,_0x3139fe[_0xa349('0x43')]);return _0x14d953[_0xa349('0x8b')](_0x33c679);}})[_0xa349('0x2b')](function(_0xeac5f2){if(_0xeac5f2){_0x2eccbe=_0xeac5f2[_0xa349('0x3d')];if(!_0x3139fe['query'][_0xa349('0x58')]('nolimit')){_0x33c679[_0xa349('0x25')]=qs[_0xa349('0x25')](_0x3139fe[_0xa349('0x37')]['limit']);_0x33c679[_0xa349('0x23')]=qs['offset'](_0x3139fe['query'][_0xa349('0x23')]);}return _0x14d953[_0xa349('0x8b')](_0x33c679);}})['then'](function(_0x5316d0){if(_0x5316d0){return _0x5316d0?{'count':_0x2eccbe,'rows':_0x5316d0}:null;}})['then'](respondWithResult(_0x336bfc,null))[_0xa349('0x4c')](handleError(_0x336bfc,null));}; \ No newline at end of file +var _0xca07=['addTeams','findAll','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','emit','removeTeams','ids','select','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','userMailQueue:remove','addAgents','omit','userMailQueue:save','removeAgents','isArray','getAgents','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./mailQueue.socket','register','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','MailQueues','UserProfileResource','end','sendStatus','stack','name','map','MailQueue','rawAttributes','type','query','filters','intersection','attributes','model','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','length','find','create','body','user','UserProfileSection','autoAssociation','params','describe','getMembers','keys','UserMailQueue','nolimit','MailQueueId','User','findAndCountAll','createdAt','format','SIP','mailPause','getTeams','findOne','Team'];(function(_0x14311a,_0x4fa562){var _0x4b798b=function(_0x5b3a89){while(--_0x5b3a89){_0x14311a['push'](_0x14311a['shift']());}};_0x4b798b(++_0x4fa562);}(_0xca07,0xb1));var _0x7ca0=function(_0x1a5eb0,_0x1f8fbb){_0x1a5eb0=_0x1a5eb0-0x0;var _0x30f9ba=_0xca07[_0x1a5eb0];return _0x30f9ba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7ca0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7ca0('0x1'));var rp=require('request-promise');var moment=require(_0x7ca0('0x2'));var BPromise=require(_0x7ca0('0x3'));var Mustache=require(_0x7ca0('0x4'));var util=require('util');var path=require(_0x7ca0('0x5'));var sox=require(_0x7ca0('0x6'));var csv=require(_0x7ca0('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7ca0('0x8'));var crypto=require(_0x7ca0('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x7ca0('0xa'));var toCsv=require('to-csv');var querystring=require(_0x7ca0('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7ca0('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x7ca0('0xd'));var hardwareService=require(_0x7ca0('0xe'));var logger=require(_0x7ca0('0xf'))(_0x7ca0('0x10'));var utils=require(_0x7ca0('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x7ca0('0x12'));var db=require(_0x7ca0('0x13'))['db'];config[_0x7ca0('0x14')]=_[_0x7ca0('0x15')](config[_0x7ca0('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x7ca0('0x16'))(new Redis(config[_0x7ca0('0x14')]));require(_0x7ca0('0x17'))[_0x7ca0('0x18')](socket);function respondWithStatusCode(_0x358f60,_0x472c00){_0x472c00=_0x472c00||0xcc;return function(_0x365773){if(_0x365773){return _0x358f60['sendStatus'](_0x472c00);}return _0x358f60['status'](_0x472c00)['end']();};}function respondWithResult(_0xcb51e2,_0x108a28){_0x108a28=_0x108a28||0xc8;return function(_0x1fd121){if(_0x1fd121){return _0xcb51e2[_0x7ca0('0x19')](_0x108a28)[_0x7ca0('0x1a')](_0x1fd121);}};}function respondWithFilteredResult(_0x3e94a3,_0x1da32f){return function(_0x59e466){if(_0x59e466){var _0x2da9e3=typeof _0x1da32f[_0x7ca0('0x1b')]==='undefined'&&typeof _0x1da32f[_0x7ca0('0x1c')]===_0x7ca0('0x1d');var _0x2a6718=_0x59e466[_0x7ca0('0x1e')];var _0x50357e=_0x2da9e3?0x0:_0x1da32f[_0x7ca0('0x1b')];var _0x240ea2=_0x2da9e3?_0x59e466[_0x7ca0('0x1e')]:_0x1da32f['offset']+_0x1da32f[_0x7ca0('0x1c')];var _0x309cd2;if(_0x240ea2>=_0x2a6718){_0x240ea2=_0x2a6718;_0x309cd2=0xc8;}else{_0x309cd2=0xce;}_0x3e94a3[_0x7ca0('0x19')](_0x309cd2);return _0x3e94a3[_0x7ca0('0x1f')](_0x7ca0('0x20'),_0x50357e+'-'+_0x240ea2+'/'+_0x2a6718)[_0x7ca0('0x1a')](_0x59e466);}return null;};}function patchUpdates(_0x4f9f6f){return function(_0x5b0fea){try{jsonpatch['apply'](_0x5b0fea,_0x4f9f6f,!![]);}catch(_0x298326){return BPromise[_0x7ca0('0x21')](_0x298326);}return _0x5b0fea[_0x7ca0('0x22')]();};}function saveUpdates(_0x44aa04,_0x3d8ecd){return function(_0x86456c){if(_0x86456c){return _0x86456c[_0x7ca0('0x23')](_0x44aa04)[_0x7ca0('0x24')](function(_0x54e547){return _0x54e547;});}return null;};}function removeEntity(_0x5d1bd2,_0x2a3719){return function(_0x23b18a){if(_0x23b18a){return _0x23b18a[_0x7ca0('0x25')]()['then'](function(){var _0x4272ea=_0x23b18a[_0x7ca0('0x26')]({'plain':!![]});var _0x24a56d=_0x7ca0('0x27');return db[_0x7ca0('0x28')]['destroy']({'where':{'type':_0x24a56d,'resourceId':_0x4272ea['id']}})[_0x7ca0('0x24')](function(){return _0x23b18a;});})[_0x7ca0('0x24')](function(){_0x5d1bd2[_0x7ca0('0x19')](0xcc)[_0x7ca0('0x29')]();});}};}function handleEntityNotFound(_0x3e6598,_0x4d487f){return function(_0x13087e){if(!_0x13087e){_0x3e6598[_0x7ca0('0x2a')](0x194);}return _0x13087e;};}function handleError(_0x288c24,_0x8da68d){_0x8da68d=_0x8da68d||0x1f4;return function(_0x57cc77){logger['error'](_0x57cc77[_0x7ca0('0x2b')]);if(_0x57cc77[_0x7ca0('0x2c')]){delete _0x57cc77[_0x7ca0('0x2c')];}_0x288c24[_0x7ca0('0x19')](_0x8da68d)['send'](_0x57cc77);};}exports['index']=function(_0x30718d,_0x1bc620){var _0x563a58={},_0x22d087={},_0x37bda4={'count':0x0,'rows':[]};var _0x46c833=_[_0x7ca0('0x2d')](db[_0x7ca0('0x2e')][_0x7ca0('0x2f')],function(_0x54d71c){return{'name':_0x54d71c['fieldName'],'type':_0x54d71c[_0x7ca0('0x30')]['key']};});_0x22d087['model']=_[_0x7ca0('0x2d')](_0x46c833,_0x7ca0('0x2c'));_0x22d087[_0x7ca0('0x31')]=_['keys'](_0x30718d[_0x7ca0('0x31')]);_0x22d087[_0x7ca0('0x32')]=_[_0x7ca0('0x33')](_0x22d087['model'],_0x22d087[_0x7ca0('0x31')]);_0x563a58[_0x7ca0('0x34')]=_[_0x7ca0('0x33')](_0x22d087[_0x7ca0('0x35')],qs[_0x7ca0('0x36')](_0x30718d['query']['fields']));_0x563a58[_0x7ca0('0x34')]=_0x563a58[_0x7ca0('0x34')]['length']?_0x563a58[_0x7ca0('0x34')]:_0x22d087[_0x7ca0('0x35')];if(!_0x30718d[_0x7ca0('0x31')][_0x7ca0('0x37')]('nolimit')){_0x563a58[_0x7ca0('0x1c')]=qs['limit'](_0x30718d[_0x7ca0('0x31')]['limit']);_0x563a58[_0x7ca0('0x1b')]=qs[_0x7ca0('0x1b')](_0x30718d[_0x7ca0('0x31')]['offset']);}_0x563a58[_0x7ca0('0x38')]=qs['sort'](_0x30718d[_0x7ca0('0x31')][_0x7ca0('0x39')]);_0x563a58[_0x7ca0('0x3a')]=qs[_0x7ca0('0x32')](_[_0x7ca0('0x3b')](_0x30718d[_0x7ca0('0x31')],_0x22d087['filters']),_0x46c833);if(_0x30718d[_0x7ca0('0x31')][_0x7ca0('0x3c')]){_0x563a58['where']=_[_0x7ca0('0x3d')](_0x563a58[_0x7ca0('0x3a')],{'$or':_['map'](_0x46c833,function(_0x28547d){if(_0x28547d[_0x7ca0('0x30')]!==_0x7ca0('0x3e')){var _0x972d43={};_0x972d43[_0x28547d[_0x7ca0('0x2c')]]={'$like':'%'+_0x30718d[_0x7ca0('0x31')][_0x7ca0('0x3c')]+'%'};return _0x972d43;}})});}_0x563a58=_['merge']({},_0x563a58,_0x30718d[_0x7ca0('0x3f')]);var _0x312348={'where':_0x563a58[_0x7ca0('0x3a')]};return db['MailQueue']['count'](_0x312348)[_0x7ca0('0x24')](function(_0x296bde){_0x37bda4[_0x7ca0('0x1e')]=_0x296bde;if(_0x30718d[_0x7ca0('0x31')][_0x7ca0('0x40')]){_0x563a58['include']=[{'all':!![]}];}return db[_0x7ca0('0x2e')]['findAll'](_0x563a58);})[_0x7ca0('0x24')](function(_0x3fc9a7){_0x37bda4[_0x7ca0('0x41')]=_0x3fc9a7;return _0x37bda4;})[_0x7ca0('0x24')](respondWithFilteredResult(_0x1bc620,_0x563a58))[_0x7ca0('0x42')](handleError(_0x1bc620,null));};exports[_0x7ca0('0x43')]=function(_0x1bd7c7,_0x19d32e){var _0x593551={'raw':!![],'where':{'id':_0x1bd7c7['params']['id']}},_0x3b0ece={};_0x3b0ece['model']=_['keys'](db[_0x7ca0('0x2e')][_0x7ca0('0x2f')]);_0x3b0ece['query']=_['keys'](_0x1bd7c7[_0x7ca0('0x31')]);_0x3b0ece['filters']=_[_0x7ca0('0x33')](_0x3b0ece[_0x7ca0('0x35')],_0x3b0ece['query']);_0x593551[_0x7ca0('0x34')]=_[_0x7ca0('0x33')](_0x3b0ece['model'],qs[_0x7ca0('0x36')](_0x1bd7c7[_0x7ca0('0x31')]['fields']));_0x593551[_0x7ca0('0x34')]=_0x593551[_0x7ca0('0x34')][_0x7ca0('0x44')]?_0x593551[_0x7ca0('0x34')]:_0x3b0ece[_0x7ca0('0x35')];if(_0x1bd7c7['query'][_0x7ca0('0x40')]){_0x593551['include']=[{'all':!![]}];}_0x593551=_[_0x7ca0('0x3d')]({},_0x593551,_0x1bd7c7['options']);return db[_0x7ca0('0x2e')][_0x7ca0('0x45')](_0x593551)[_0x7ca0('0x24')](handleEntityNotFound(_0x19d32e,null))['then'](respondWithResult(_0x19d32e,null))[_0x7ca0('0x42')](handleError(_0x19d32e,null));};exports[_0x7ca0('0x46')]=function(_0x3fc1e0,_0x212a0f){return db['MailQueue'][_0x7ca0('0x46')](_0x3fc1e0[_0x7ca0('0x47')],{})[_0x7ca0('0x24')](function(_0x488c16){var _0x7f2eff=_0x3fc1e0['user'][_0x7ca0('0x26')]({'plain':!![]});if(!_0x7f2eff)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x7f2eff['role']===_0x7ca0('0x48')){var _0xe41497=_0x488c16[_0x7ca0('0x26')]({'plain':!![]});var _0x417f96=_0x7ca0('0x27');return db[_0x7ca0('0x49')][_0x7ca0('0x45')]({'where':{'name':_0x417f96,'userProfileId':_0x7f2eff['userProfileId']},'raw':!![]})[_0x7ca0('0x24')](function(_0x458ad1){if(_0x458ad1&&_0x458ad1[_0x7ca0('0x4a')]===0x0){return db[_0x7ca0('0x28')]['create']({'name':_0xe41497[_0x7ca0('0x2c')],'resourceId':_0xe41497['id'],'type':_0x458ad1[_0x7ca0('0x2c')],'sectionId':_0x458ad1['id']},{})[_0x7ca0('0x24')](function(){return _0x488c16;});}else{return _0x488c16;}})['catch'](function(_0x500c21){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x500c21);throw _0x500c21;});}return _0x488c16;})[_0x7ca0('0x24')](respondWithResult(_0x212a0f,0xc9))[_0x7ca0('0x42')](handleError(_0x212a0f,null));};exports['update']=function(_0x4343b2,_0x51d3cf){if(_0x4343b2['body']['id']){delete _0x4343b2[_0x7ca0('0x47')]['id'];}return db[_0x7ca0('0x2e')]['find']({'where':{'id':_0x4343b2[_0x7ca0('0x4b')]['id']}})[_0x7ca0('0x24')](handleEntityNotFound(_0x51d3cf,null))[_0x7ca0('0x24')](saveUpdates(_0x4343b2['body'],null))[_0x7ca0('0x24')](respondWithResult(_0x51d3cf,null))[_0x7ca0('0x42')](handleError(_0x51d3cf,null));};exports[_0x7ca0('0x25')]=function(_0x42e3b3,_0x1b31e0){return db[_0x7ca0('0x2e')][_0x7ca0('0x45')]({'where':{'id':_0x42e3b3[_0x7ca0('0x4b')]['id']}})[_0x7ca0('0x24')](handleEntityNotFound(_0x1b31e0,null))[_0x7ca0('0x24')](removeEntity(_0x1b31e0,null))[_0x7ca0('0x42')](handleError(_0x1b31e0,null));};exports['describe']=function(_0x2844bf,_0x5e1559){return db[_0x7ca0('0x2e')][_0x7ca0('0x4c')]()['then'](respondWithResult(_0x5e1559,null))[_0x7ca0('0x42')](handleError(_0x5e1559,null));};exports[_0x7ca0('0x4d')]=function(_0xf38398,_0x132c8a,_0x4a6f3d){var _0x342c60={'raw':!![],'where':{}},_0x6ce08d={},_0x5f47e8;return db[_0x7ca0('0x2e')]['findOne']({'where':{'id':_0xf38398[_0x7ca0('0x4b')]['id']}})[_0x7ca0('0x24')](handleEntityNotFound(_0x132c8a,null))[_0x7ca0('0x24')](function(_0x465c03){if(_0x465c03){_0x5f47e8=_0x465c03[_0x7ca0('0x26')]({'plain':!![]});_0x6ce08d['model']=_[_0x7ca0('0x4e')](db[_0x7ca0('0x4f')]['rawAttributes']);_0x6ce08d[_0x7ca0('0x31')]=_[_0x7ca0('0x4e')](_0xf38398[_0x7ca0('0x31')]);_0x6ce08d[_0x7ca0('0x32')]=_[_0x7ca0('0x33')](_0x6ce08d[_0x7ca0('0x35')],_0x6ce08d[_0x7ca0('0x31')]);_0x342c60[_0x7ca0('0x34')]=_[_0x7ca0('0x33')](_0x6ce08d[_0x7ca0('0x35')],qs['fields'](_0xf38398['query']['fields']));_0x342c60[_0x7ca0('0x34')]=_0x342c60[_0x7ca0('0x34')]['length']?_0x342c60[_0x7ca0('0x34')]:_0x6ce08d[_0x7ca0('0x35')];if(!_0xf38398[_0x7ca0('0x31')][_0x7ca0('0x37')](_0x7ca0('0x50'))){_0x342c60[_0x7ca0('0x1c')]=qs[_0x7ca0('0x1c')](_0xf38398[_0x7ca0('0x31')][_0x7ca0('0x1c')]);_0x342c60[_0x7ca0('0x1b')]=qs[_0x7ca0('0x1b')](_0xf38398[_0x7ca0('0x31')][_0x7ca0('0x1b')]);}_0x342c60[_0x7ca0('0x38')]=qs[_0x7ca0('0x39')](_0xf38398['query'][_0x7ca0('0x39')]);_0x342c60[_0x7ca0('0x3a')]=qs['filters'](_[_0x7ca0('0x3b')](_0xf38398[_0x7ca0('0x31')],_0x6ce08d['filters']));_0x342c60['where'][_0x7ca0('0x51')]=_0x465c03['id'];if(_0xf38398['query'][_0x7ca0('0x3c')]){_0x342c60['where']=_[_0x7ca0('0x3d')](_0x342c60[_0x7ca0('0x3a')],{'$or':_['map'](_0x342c60[_0x7ca0('0x34')],function(_0x189380){var _0x1c2321={};_0x1c2321[_0x189380]={'$like':'%'+_0xf38398[_0x7ca0('0x31')][_0x7ca0('0x3c')]+'%'};return _0x1c2321;})});}_0x342c60=_[_0x7ca0('0x3d')]({},_0x342c60,_0xf38398[_0x7ca0('0x3f')]);return db[_0x7ca0('0x4f')]['findAll'](_0x342c60);}})['then'](function(_0x5210c1){if(_0x5210c1){return db[_0x7ca0('0x52')][_0x7ca0('0x53')]({'where':{'id':_['map'](_0x5210c1,'UserId'),'role':'agent'},'attributes':['id',_0x7ca0('0x2c'),'mailPause','updatedAt',_0x7ca0('0x54')]});}})['then'](function(_0x5b69bf){if(_0x5b69bf){return{'count':_0x5b69bf[_0x7ca0('0x1e')],'rows':_[_0x7ca0('0x2d')](_0x5b69bf[_0x7ca0('0x41')],function(_0x5413ca){return{'membername':_0x5413ca[_0x7ca0('0x2c')],'UserId':_0x5413ca['id'],'queue_name':_0x5f47e8[_0x7ca0('0x2c')],'MailQueueId':_0x5f47e8['id'],'interface':util[_0x7ca0('0x55')]('%s/%s',_0x7ca0('0x56'),_0x5413ca[_0x7ca0('0x2c')]),'penalty':0x0,'paused':_0x5413ca[_0x7ca0('0x57')],'createdAt':_0x5413ca['createdAt'],'updatedAt':_0x5413ca['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x7ca0('0x24')](respondWithFilteredResult(_0x132c8a,_0x342c60))[_0x7ca0('0x42')](handleError(_0x132c8a,null));};exports[_0x7ca0('0x58')]=function(_0x2b20a4,_0x1b451c,_0x133950){var _0x3517b5={};var _0x533a07={};var _0xd9a6a8;var _0x319c9e;return db[_0x7ca0('0x2e')][_0x7ca0('0x59')]({'where':{'id':_0x2b20a4[_0x7ca0('0x4b')]['id']}})[_0x7ca0('0x24')](handleEntityNotFound(_0x1b451c,null))[_0x7ca0('0x24')](function(_0x62ce55){if(_0x62ce55){_0xd9a6a8=_0x62ce55;_0x533a07[_0x7ca0('0x35')]=_['keys'](db[_0x7ca0('0x5a')][_0x7ca0('0x2f')]);_0x533a07[_0x7ca0('0x31')]=_[_0x7ca0('0x4e')](_0x2b20a4[_0x7ca0('0x31')]);_0x533a07[_0x7ca0('0x32')]=_['intersection'](_0x533a07[_0x7ca0('0x35')],_0x533a07[_0x7ca0('0x31')]);_0x3517b5[_0x7ca0('0x34')]=_['intersection'](_0x533a07[_0x7ca0('0x35')],qs[_0x7ca0('0x36')](_0x2b20a4[_0x7ca0('0x31')]['fields']));_0x3517b5[_0x7ca0('0x34')]=_0x3517b5[_0x7ca0('0x34')]['length']?_0x3517b5[_0x7ca0('0x34')]:_0x533a07[_0x7ca0('0x35')];_0x3517b5[_0x7ca0('0x38')]=qs['sort'](_0x2b20a4[_0x7ca0('0x31')][_0x7ca0('0x39')]);_0x3517b5[_0x7ca0('0x3a')]=qs[_0x7ca0('0x32')](_[_0x7ca0('0x3b')](_0x2b20a4['query'],_0x533a07['filters']));if(_0x2b20a4[_0x7ca0('0x31')][_0x7ca0('0x3c')]){_0x3517b5[_0x7ca0('0x3a')]=_['merge'](_0x3517b5[_0x7ca0('0x3a')],{'$or':_[_0x7ca0('0x2d')](_0x3517b5[_0x7ca0('0x34')],function(_0x274853){var _0x10a348={};_0x10a348[_0x274853]={'$like':'%'+_0x2b20a4[_0x7ca0('0x31')][_0x7ca0('0x3c')]+'%'};return _0x10a348;})});}_0x3517b5=_[_0x7ca0('0x3d')]({},_0x3517b5,_0x2b20a4[_0x7ca0('0x3f')]);return _0xd9a6a8[_0x7ca0('0x58')](_0x3517b5);}})[_0x7ca0('0x24')](function(_0x294f27){if(_0x294f27){_0x319c9e=_0x294f27[_0x7ca0('0x44')];if(!_0x2b20a4[_0x7ca0('0x31')][_0x7ca0('0x37')]('nolimit')){_0x3517b5[_0x7ca0('0x1c')]=qs[_0x7ca0('0x1c')](_0x2b20a4[_0x7ca0('0x31')][_0x7ca0('0x1c')]);_0x3517b5[_0x7ca0('0x1b')]=qs[_0x7ca0('0x1b')](_0x2b20a4[_0x7ca0('0x31')][_0x7ca0('0x1b')]);}return _0xd9a6a8['getTeams'](_0x3517b5);}})[_0x7ca0('0x24')](function(_0x4df975){if(_0x4df975){return _0x4df975?{'count':_0x319c9e,'rows':_0x4df975}:null;}})['then'](respondWithResult(_0x1b451c,null))['catch'](handleError(_0x1b451c,null));};exports[_0x7ca0('0x5b')]=function(_0x134fa8,_0x49102d,_0x741750){var _0x344f7e=_0x134fa8['body']['ids'];return db[_0x7ca0('0x5a')][_0x7ca0('0x5c')]({'where':{'id':_0x344f7e},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7ca0('0x5d'),'attributes':['id',_0x7ca0('0x2c'),_0x7ca0('0x5e'),_0x7ca0('0x5f'),_0x7ca0('0x60')],'raw':!![]}]})[_0x7ca0('0x24')](function(_0x2cb018){if(_0x2cb018){var _0x4fafdb=_[_0x7ca0('0x61')](_0x2cb018,function(_0x537aad){var _0x1dbe4a=_0x537aad[_0x7ca0('0x26')]({'plain':!![]});return _0x1dbe4a[_0x7ca0('0x5d')];});return db[_0x7ca0('0x2e')]['find']({'where':{'id':_0x134fa8['params']['id']}})[_0x7ca0('0x24')](function(_0x5b89d0){return db['sequelize'][_0x7ca0('0x62')](function(_0x17ff6c){return _0x5b89d0[_0x7ca0('0x5b')](_0x344f7e,{'transaction':_0x17ff6c})[_0x7ca0('0x24')](function(){return BPromise[_0x7ca0('0x63')](_0x4fafdb,function(_0x3bf012){return db[_0x7ca0('0x4f')][_0x7ca0('0x64')]({'where':{'UserId':_0x3bf012['id'],'MailQueueId':_0x134fa8[_0x7ca0('0x4b')]['id']},'transaction':_0x17ff6c});});})[_0x7ca0('0x24')](function(){_0x4fafdb[_0x7ca0('0x65')](function(_0x2ba453){socket[_0x7ca0('0x66')]('userMailQueue:save',{'UserId':_0x2ba453['id'],'MailQueueId':_0x5b89d0['id']});});});});});}})['then'](respondWithStatusCode(_0x49102d,null))[_0x7ca0('0x42')](handleError(_0x49102d,null));};exports[_0x7ca0('0x67')]=function(_0xde0a6a,_0x4df4e6,_0x3660bf){return db[_0x7ca0('0x5a')][_0x7ca0('0x5c')]({'where':{'id':_0xde0a6a[_0x7ca0('0x31')][_0x7ca0('0x68')]},'attributes':['id'],'include':[{'model':db[_0x7ca0('0x52')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x7ca0('0x24')](handleEntityNotFound(_0x4df4e6,null))[_0x7ca0('0x24')](function(_0x529963){var _0x5f28f8=_[_0x7ca0('0x2d')](_0x529963,'id');var _0x29d9c7=[];var _0x286d07=[];var _0x7ebb1b=squel[_0x7ca0('0x69')]();_0x7ebb1b['field']('tq.TeamId')[_0x7ca0('0x6a')](_0x7ca0('0x6b'),'tq')[_0x7ca0('0x6c')](_0x7ca0('0x6d'),'ut',_0x7ca0('0x6e'))[_0x7ca0('0x3a')](_0x7ca0('0x6f'),_0xde0a6a[_0x7ca0('0x4b')]['id']);for(var _0x32c4a5=0x0;_0x32c4a5<_0x529963['length'];_0x32c4a5+=0x1){let _0x48533f=_0x529963[_0x32c4a5];for(var _0x17083f=0x0;_0x17083f<_0x48533f[_0x7ca0('0x5d')][_0x7ca0('0x44')];_0x17083f+=0x1){let _0x36da8d=_0x48533f['Agents'][_0x17083f];var _0x4dce53=_0x7ebb1b[_0x7ca0('0x70')]();_0x4dce53[_0x7ca0('0x3a')](_0x7ca0('0x71'),_0x36da8d['id']);_0x286d07[_0x7ca0('0x72')](db[_0x7ca0('0x73')][_0x7ca0('0x31')](_0x4dce53[_0x7ca0('0x74')](),{'type':db[_0x7ca0('0x73')][_0x7ca0('0x75')][_0x7ca0('0x76')]})[_0x7ca0('0x24')](function(_0x1d4d7a){if(_0x1d4d7a[_0x7ca0('0x44')]===0x1){return _0x36da8d['id'];}else{var _0x210290=_[_0x7ca0('0x77')](_['map'](_0x1d4d7a,_0x7ca0('0x78')),function(_0x276def){return _[_0x7ca0('0x79')](_0x5f28f8,_0x276def);});if(_0x210290){return _0x36da8d['id'];}}}));}}return BPromise[_0x7ca0('0x7a')](_0x286d07)['then'](function(_0x2758b8){_0x29d9c7=_(_0x29d9c7)[_0x7ca0('0x7b')](_0x2758b8)[_0x7ca0('0x7c')]()[_0x7ca0('0x7d')]();return db[_0x7ca0('0x2e')][_0x7ca0('0x45')]({'where':{'id':_0xde0a6a[_0x7ca0('0x4b')]['id']}})[_0x7ca0('0x24')](function(_0x40b37d){return db['sequelize'][_0x7ca0('0x62')](function(_0x2e6ed8){return _0x40b37d[_0x7ca0('0x67')](_0xde0a6a[_0x7ca0('0x31')]['ids'],{'transaction':_0x2e6ed8})[_0x7ca0('0x24')](function(){if(!_[_0x7ca0('0x7e')](_0x29d9c7)){return _0x40b37d['removeAgents'](_0x29d9c7,{'transaction':_0x2e6ed8});}})[_0x7ca0('0x24')](function(){_0x29d9c7['forEach'](function(_0x3e0c6a){socket['emit'](_0x7ca0('0x7f'),{'UserId':_0x3e0c6a,'MailQueueId':_0x40b37d['id']});});});});});});})[_0x7ca0('0x24')](respondWithStatusCode(_0x4df4e6,null))[_0x7ca0('0x42')](handleError(_0x4df4e6,null));};exports['addAgents']=function(_0x144e49,_0x1af396,_0x116d66){return db[_0x7ca0('0x2e')][_0x7ca0('0x45')]({'where':{'id':_0x144e49[_0x7ca0('0x4b')]['id']}})[_0x7ca0('0x24')](handleEntityNotFound(_0x1af396,null))['then'](function(_0x2e6c01){if(_0x2e6c01){return _0x2e6c01[_0x7ca0('0x80')](_0x144e49[_0x7ca0('0x47')]['ids'],_[_0x7ca0('0x81')](_0x144e49[_0x7ca0('0x47')],[_0x7ca0('0x68'),'id'])||{})['spread'](function(_0x19d265){for(var _0x445430=0x0;_0x445430<_0x144e49['body'][_0x7ca0('0x68')][_0x7ca0('0x44')];_0x445430+=0x1){socket[_0x7ca0('0x66')](_0x7ca0('0x82'),{'UserId':Number(_0x144e49[_0x7ca0('0x47')][_0x7ca0('0x68')][_0x445430]),'MailQueueId':Number(_0x144e49['params']['id'])});}return _0x19d265;});}})[_0x7ca0('0x24')](respondWithResult(_0x1af396,null))[_0x7ca0('0x42')](handleError(_0x1af396,null));};exports[_0x7ca0('0x83')]=function(_0x1d5405,_0x3d668f,_0x440275){return db[_0x7ca0('0x2e')]['find']({'where':{'id':_0x1d5405[_0x7ca0('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3d668f,null))[_0x7ca0('0x24')](function(_0x24c635){if(_0x24c635){return _0x24c635[_0x7ca0('0x83')](_0x1d5405[_0x7ca0('0x31')][_0x7ca0('0x68')])[_0x7ca0('0x24')](function(){if(_[_0x7ca0('0x84')](_0x1d5405[_0x7ca0('0x31')][_0x7ca0('0x68')])){for(var _0x160d4f=0x0;_0x160d4f<_0x1d5405['query'][_0x7ca0('0x68')][_0x7ca0('0x44')];_0x160d4f+=0x1){socket['emit']('userMailQueue:remove',{'UserId':Number(_0x1d5405[_0x7ca0('0x31')]['ids'][_0x160d4f]),'MailQueueId':Number(_0x1d5405[_0x7ca0('0x4b')]['id'])});}}else{socket['emit'](_0x7ca0('0x7f'),{'UserId':Number(_0x1d5405[_0x7ca0('0x31')]['ids']),'MailQueueId':Number(_0x1d5405['params']['id'])});}});}})[_0x7ca0('0x24')](respondWithStatusCode(_0x3d668f,null))['catch'](handleError(_0x3d668f,null));};exports[_0x7ca0('0x85')]=function(_0x51fad3,_0x192055,_0x18c073){var _0x5798d8={};var _0x3c1825={};var _0x237627;var _0x1eb807;return db[_0x7ca0('0x2e')][_0x7ca0('0x59')]({'where':{'id':_0x51fad3[_0x7ca0('0x4b')]['id']}})['then'](handleEntityNotFound(_0x192055,null))[_0x7ca0('0x24')](function(_0x30e024){if(_0x30e024){_0x237627=_0x30e024;_0x3c1825[_0x7ca0('0x35')]=_[_0x7ca0('0x4e')](db[_0x7ca0('0x52')][_0x7ca0('0x2f')]);_0x3c1825[_0x7ca0('0x31')]=_[_0x7ca0('0x4e')](_0x51fad3[_0x7ca0('0x31')]);_0x3c1825[_0x7ca0('0x32')]=_[_0x7ca0('0x33')](_0x3c1825[_0x7ca0('0x35')],_0x3c1825['query']);_0x5798d8[_0x7ca0('0x34')]=_[_0x7ca0('0x33')](_0x3c1825[_0x7ca0('0x35')],qs[_0x7ca0('0x36')](_0x51fad3[_0x7ca0('0x31')][_0x7ca0('0x36')]));_0x5798d8[_0x7ca0('0x34')]=_0x5798d8[_0x7ca0('0x34')][_0x7ca0('0x44')]?_0x5798d8['attributes']:_0x3c1825['model'];_0x5798d8[_0x7ca0('0x38')]=qs['sort'](_0x51fad3[_0x7ca0('0x31')]['sort']);_0x5798d8[_0x7ca0('0x3a')]=qs['filters'](_[_0x7ca0('0x3b')](_0x51fad3[_0x7ca0('0x31')],_0x3c1825[_0x7ca0('0x32')]));if(_0x51fad3[_0x7ca0('0x31')][_0x7ca0('0x3c')]){_0x5798d8[_0x7ca0('0x3a')]=_[_0x7ca0('0x3d')](_0x5798d8[_0x7ca0('0x3a')],{'$or':_['map'](_0x5798d8[_0x7ca0('0x34')],function(_0x5bcfef){var _0x3ae2e8={};_0x3ae2e8[_0x5bcfef]={'$like':'%'+_0x51fad3[_0x7ca0('0x31')][_0x7ca0('0x3c')]+'%'};return _0x3ae2e8;})});}_0x5798d8=_['merge']({},_0x5798d8,_0x51fad3['options']);return _0x237627['getAgents'](_0x5798d8);}})['then'](function(_0x4e5d40){if(_0x4e5d40){_0x1eb807=_0x4e5d40[_0x7ca0('0x44')];if(!_0x51fad3['query'][_0x7ca0('0x37')](_0x7ca0('0x50'))){_0x5798d8[_0x7ca0('0x1c')]=qs[_0x7ca0('0x1c')](_0x51fad3[_0x7ca0('0x31')][_0x7ca0('0x1c')]);_0x5798d8[_0x7ca0('0x1b')]=qs[_0x7ca0('0x1b')](_0x51fad3[_0x7ca0('0x31')]['offset']);}return _0x237627['getAgents'](_0x5798d8);}})[_0x7ca0('0x24')](function(_0x2bae63){if(_0x2bae63){return _0x2bae63?{'count':_0x1eb807,'rows':_0x2bae63}:null;}})[_0x7ca0('0x24')](respondWithResult(_0x192055,null))[_0x7ca0('0x42')](handleError(_0x192055,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 64acdf7..5848871 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 _0x47b6=['setMaxListeners','save','update','emit','hook','exports','../../mysqldb','MailQueue'];(function(_0x260c03,_0x37dca4){var _0x214150=function(_0x3c5971){while(--_0x3c5971){_0x260c03['push'](_0x260c03['shift']());}};_0x214150(++_0x37dca4);}(_0x47b6,0x12e));var _0x647b=function(_0x4c98b9,_0x1ad11b){_0x4c98b9=_0x4c98b9-0x0;var _0x3a257a=_0x47b6[_0x4c98b9];return _0x3a257a;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x647b('0x0'))['db'][_0x647b('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x647b('0x2')](0x0);var events={'afterCreate':_0x647b('0x3'),'afterUpdate':_0x647b('0x4'),'afterDestroy':'remove'};function emitEvent(_0x227ee0){return function(_0x46a162,_0x393d2f,_0xbb17f2){MailQueueEvents['emit'](_0x227ee0+':'+_0x46a162['id'],_0x46a162);MailQueueEvents[_0x647b('0x5')](_0x227ee0,_0x46a162);_0xbb17f2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x647b('0x6')](e,emitEvent(event));}}module[_0x647b('0x7')]=MailQueueEvents; \ No newline at end of file +var _0x3215=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue','save'];(function(_0x2862a3,_0x279026){var _0xe8edd0=function(_0x36d73f){while(--_0x36d73f){_0x2862a3['push'](_0x2862a3['shift']());}};_0xe8edd0(++_0x279026);}(_0x3215,0x146));var _0x5321=function(_0x1ffcdd,_0x29fa39){_0x1ffcdd=_0x1ffcdd-0x0;var _0x10d702=_0x3215[_0x1ffcdd];return _0x10d702;};'use strict';var EventEmitter=require(_0x5321('0x0'));var MailQueue=require(_0x5321('0x1'))['db'][_0x5321('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5321('0x3'),'afterUpdate':_0x5321('0x4'),'afterDestroy':_0x5321('0x5')};function emitEvent(_0x598e40){return function(_0x11c111,_0x58c991,_0x1b87e4){MailQueueEvents[_0x5321('0x6')](_0x598e40+':'+_0x11c111['id'],_0x11c111);MailQueueEvents[_0x5321('0x6')](_0x598e40,_0x11c111);_0x1b87e4(null);};}for(var e in events){if(events[_0x5321('0x7')](e)){var event=events[e];MailQueue[_0x5321('0x8')](e,emitEvent(event));}}module[_0x5321('0x9')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index ace911b..f1a831a 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 _0x4d8c=['rimraf','../../config/environment','./mailQueue.attributes','define','MailQueue','mail_queues','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x48d04c,_0x508d98){var _0x1236bd=function(_0x1bb640){while(--_0x1bb640){_0x48d04c['push'](_0x48d04c['shift']());}};_0x1236bd(++_0x508d98);}(_0x4d8c,0xaf));var _0xc4d8=function(_0x434115,_0x3bd689){_0x434115=_0x434115-0x0;var _0x38bcf7=_0x4d8c[_0x434115];return _0x38bcf7;};'use strict';var _=require('lodash');var util=require(_0xc4d8('0x0'));var logger=require(_0xc4d8('0x1'))(_0xc4d8('0x2'));var moment=require(_0xc4d8('0x3'));var BPromise=require(_0xc4d8('0x4'));var rp=require(_0xc4d8('0x5'));var fs=require('fs');var path=require(_0xc4d8('0x6'));var rimraf=require(_0xc4d8('0x7'));var config=require(_0xc4d8('0x8'));var attributes=require(_0xc4d8('0x9'));module['exports']=function(_0x1944de,_0xf49fc1){return _0x1944de[_0xc4d8('0xa')](_0xc4d8('0xb'),attributes,{'tableName':_0xc4d8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x875c=['moment','request-promise','rimraf','../../config/environment','./mailQueue.attributes','mail_queues','lodash','../../config/logger'];(function(_0x406664,_0x2c92d2){var _0x506a0e=function(_0x21dbcf){while(--_0x21dbcf){_0x406664['push'](_0x406664['shift']());}};_0x506a0e(++_0x2c92d2);}(_0x875c,0x7e));var _0xc875=function(_0x3921e9,_0x7aa7a8){_0x3921e9=_0x3921e9-0x0;var _0x2c963f=_0x875c[_0x3921e9];return _0x2c963f;};'use strict';var _=require(_0xc875('0x0'));var util=require('util');var logger=require(_0xc875('0x1'))('api');var moment=require(_0xc875('0x2'));var BPromise=require('bluebird');var rp=require(_0xc875('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc875('0x4'));var config=require(_0xc875('0x5'));var attributes=require(_0xc875('0x6'));module['exports']=function(_0x257b44,_0x6711cf){return _0x257b44['define']('MailQueue',attributes,{'tableName':_0xc875('0x7'),'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 e21a62f..8546fec 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 _0xdacf=['http','redis','localhost','./mailQueue.socket','register','request','then','info','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailQueue,\x20%s,\x20%s','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','limit','map','include','model','catch','ShowMailQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x51ed62,_0x574379){var _0x34aee3=function(_0x2958bc){while(--_0x2958bc){_0x51ed62['push'](_0x51ed62['shift']());}};_0x34aee3(++_0x574379);}(_0xdacf,0x72));var _0xfdac=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xdacf[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xfdac('0x0'));var util=require(_0xfdac('0x1'));var moment=require(_0xfdac('0x2'));var BPromise=require(_0xfdac('0x3'));var rs=require(_0xfdac('0x4'));var fs=require('fs');var Redis=require(_0xfdac('0x5'));var db=require(_0xfdac('0x6'))['db'];var utils=require(_0xfdac('0x7'));var logger=require(_0xfdac('0x8'))(_0xfdac('0x9'));var config=require('../../config/environment');var jayson=require(_0xfdac('0xa'));var client=jayson[_0xfdac('0xb')][_0xfdac('0xc')]({'port':0x232a});config[_0xfdac('0xd')]=_['defaults'](config['redis'],{'host':_0xfdac('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfdac('0xd')]));require(_0xfdac('0xf'))[_0xfdac('0x10')](socket);function respondWithRpcPromise(_0x1cd73b,_0x4919f7,_0x252427){return new BPromise(function(_0x6dd424,_0x2aec06){return client[_0xfdac('0x11')](_0x1cd73b,_0x252427)[_0xfdac('0x12')](function(_0x1481be){logger[_0xfdac('0x13')]('MailQueue,\x20%s,\x20%s',_0x4919f7,_0xfdac('0x14'));logger[_0xfdac('0x15')](_0xfdac('0x16'),_0x4919f7,_0xfdac('0x14'),JSON[_0xfdac('0x17')](_0x1481be));if(_0x1481be[_0xfdac('0x18')]){if(_0x1481be['error'][_0xfdac('0x19')]===0x1f4){logger['error']('MailQueue,\x20%s,\x20%s',_0x4919f7,_0x1481be[_0xfdac('0x18')]['message']);return _0x2aec06(_0x1481be[_0xfdac('0x18')][_0xfdac('0x1a')]);}logger[_0xfdac('0x18')](_0xfdac('0x1b'),_0x4919f7,_0x1481be[_0xfdac('0x18')][_0xfdac('0x1a')]);return _0x6dd424(_0x1481be['error'][_0xfdac('0x1a')]);}else{logger[_0xfdac('0x13')](_0xfdac('0x1b'),_0x4919f7,_0xfdac('0x14'));_0x6dd424(_0x1481be['result'][_0xfdac('0x1a')]);}})['catch'](function(_0x2c6acf){logger[_0xfdac('0x18')](_0xfdac('0x1b'),_0x4919f7,_0x2c6acf);_0x2aec06(_0x2c6acf);});});}exports[_0xfdac('0x1c')]=function(_0x59c2ba){var _0x17e30d=this;return new Promise(function(_0x3bf9f5,_0x50a273){return db[_0xfdac('0x1d')][_0xfdac('0x1e')]({'raw':_0x59c2ba['options']?_0x59c2ba[_0xfdac('0x1f')][_0xfdac('0x20')]===undefined?!![]:![]:!![],'where':_0x59c2ba['options']?_0x59c2ba[_0xfdac('0x1f')][_0xfdac('0x21')]||null:null,'attributes':_0x59c2ba[_0xfdac('0x1f')]?_0x59c2ba[_0xfdac('0x1f')][_0xfdac('0x22')]||null:null,'limit':_0x59c2ba[_0xfdac('0x1f')]?_0x59c2ba[_0xfdac('0x1f')][_0xfdac('0x23')]||null:null,'include':_0x59c2ba[_0xfdac('0x1f')]?_0x59c2ba[_0xfdac('0x1f')]['include']?_[_0xfdac('0x24')](_0x59c2ba['options'][_0xfdac('0x25')],function(_0x47d86b){return{'model':db[_0x47d86b[_0xfdac('0x26')]],'as':_0x47d86b['as'],'attributes':_0x47d86b[_0xfdac('0x22')],'include':_0x47d86b[_0xfdac('0x25')]?_[_0xfdac('0x24')](_0x47d86b['include'],function(_0x3bc601){return{'model':db[_0x3bc601[_0xfdac('0x26')]],'as':_0x3bc601['as'],'attributes':_0x3bc601['attributes'],'include':_0x3bc601[_0xfdac('0x25')]?_[_0xfdac('0x24')](_0x3bc601[_0xfdac('0x25')],function(_0x27739b){return{'model':db[_0x27739b[_0xfdac('0x26')]],'as':_0x27739b['as'],'attributes':_0x27739b[_0xfdac('0x22')]};}):[]};}):[]};}):[]:[]})[_0xfdac('0x12')](function(_0x1d60ea){logger[_0xfdac('0x13')](_0xfdac('0x1c'),_0x59c2ba);logger[_0xfdac('0x15')](_0xfdac('0x1c'),_0x59c2ba,JSON[_0xfdac('0x17')](_0x1d60ea));_0x3bf9f5(_0x1d60ea);})[_0xfdac('0x27')](function(_0x2d928f){logger[_0xfdac('0x18')](_0xfdac('0x1c'),_0x2d928f[_0xfdac('0x1a')],_0x59c2ba);_0x50a273(_0x17e30d[_0xfdac('0x18')](0x1f4,_0x2d928f[_0xfdac('0x1a')]));});});};exports[_0xfdac('0x28')]=function(_0x3ee8f2){var _0x3845f2=this;return new Promise(function(_0x36c838,_0x24fcc8){return db[_0xfdac('0x1d')][_0xfdac('0x29')]({'raw':_0x3ee8f2[_0xfdac('0x1f')]?_0x3ee8f2[_0xfdac('0x1f')][_0xfdac('0x20')]===undefined?!![]:![]:!![],'where':_0x3ee8f2[_0xfdac('0x1f')]?_0x3ee8f2[_0xfdac('0x1f')][_0xfdac('0x21')]||null:null,'attributes':_0x3ee8f2[_0xfdac('0x1f')]?_0x3ee8f2['options']['attributes']||null:null,'include':_0x3ee8f2[_0xfdac('0x1f')]?_0x3ee8f2[_0xfdac('0x1f')][_0xfdac('0x25')]?_['map'](_0x3ee8f2[_0xfdac('0x1f')]['include'],function(_0x169a88){return{'model':db[_0x169a88[_0xfdac('0x26')]],'as':_0x169a88['as'],'attributes':_0x169a88[_0xfdac('0x22')],'include':_0x169a88[_0xfdac('0x25')]?_[_0xfdac('0x24')](_0x169a88['include'],function(_0x5fc6c6){return{'model':db[_0x5fc6c6[_0xfdac('0x26')]],'as':_0x5fc6c6['as'],'attributes':_0x5fc6c6['attributes'],'include':_0x5fc6c6[_0xfdac('0x25')]?_[_0xfdac('0x24')](_0x5fc6c6['include'],function(_0x1c826b){return{'model':db[_0x1c826b['model']],'as':_0x1c826b['as'],'attributes':_0x1c826b[_0xfdac('0x22')]};}):[]};}):[]};}):[]:[]})[_0xfdac('0x12')](function(_0x278636){logger[_0xfdac('0x13')](_0xfdac('0x28'),_0x3ee8f2);logger[_0xfdac('0x15')](_0xfdac('0x28'),_0x3ee8f2,JSON[_0xfdac('0x17')](_0x278636));_0x36c838(_0x278636);})[_0xfdac('0x27')](function(_0x3a1d86){logger['error'](_0xfdac('0x28'),_0x3a1d86[_0xfdac('0x1a')],_0x3ee8f2);_0x24fcc8(_0x3845f2['error'](0x1f4,_0x3a1d86[_0xfdac('0x1a')]));});});}; \ No newline at end of file +var _0xe12f=['stringify','error','code','message','info','catch','GetMailQueue','findAll','options','raw','where','attributes','include','model','map','then','debug','ShowMailQueue','MailQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','defaults','redis','register','request','MailQueue,\x20%s,\x20%s','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2144df,_0x44549b){var _0x11a2eb=function(_0x4dc17a){while(--_0x4dc17a){_0x2144df['push'](_0x2144df['shift']());}};_0x11a2eb(++_0x44549b);}(_0xe12f,0x83));var _0xfe12=function(_0x55cc37,_0x145f61){_0x55cc37=_0x55cc37-0x0;var _0x42e3a0=_0xe12f[_0x55cc37];return _0x42e3a0;};'use strict';var _=require(_0xfe12('0x0'));var util=require(_0xfe12('0x1'));var moment=require(_0xfe12('0x2'));var BPromise=require(_0xfe12('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe12('0x4'));var db=require(_0xfe12('0x5'))['db'];var utils=require(_0xfe12('0x6'));var logger=require('../../config/logger')(_0xfe12('0x7'));var config=require(_0xfe12('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfe12('0x9')]({'port':0x232a});config['redis']=_[_0xfe12('0xa')](config[_0xfe12('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfe12('0xb')]));require('./mailQueue.socket')[_0xfe12('0xc')](socket);function respondWithRpcPromise(_0x4c13f6,_0x23f9a6,_0x10f3b1){return new BPromise(function(_0x25f4eb,_0x276c9b){return client[_0xfe12('0xd')](_0x4c13f6,_0x10f3b1)['then'](function(_0x3c20a1){logger['info'](_0xfe12('0xe'),_0x23f9a6,'request\x20sent');logger['debug'](_0xfe12('0xf'),_0x23f9a6,_0xfe12('0x10'),JSON[_0xfe12('0x11')](_0x3c20a1));if(_0x3c20a1[_0xfe12('0x12')]){if(_0x3c20a1['error'][_0xfe12('0x13')]===0x1f4){logger[_0xfe12('0x12')]('MailQueue,\x20%s,\x20%s',_0x23f9a6,_0x3c20a1[_0xfe12('0x12')][_0xfe12('0x14')]);return _0x276c9b(_0x3c20a1['error'][_0xfe12('0x14')]);}logger[_0xfe12('0x12')](_0xfe12('0xe'),_0x23f9a6,_0x3c20a1[_0xfe12('0x12')][_0xfe12('0x14')]);return _0x25f4eb(_0x3c20a1[_0xfe12('0x12')]['message']);}else{logger[_0xfe12('0x15')]('MailQueue,\x20%s,\x20%s',_0x23f9a6,_0xfe12('0x10'));_0x25f4eb(_0x3c20a1['result']['message']);}})[_0xfe12('0x16')](function(_0x4ae563){logger[_0xfe12('0x12')](_0xfe12('0xe'),_0x23f9a6,_0x4ae563);_0x276c9b(_0x4ae563);});});}exports[_0xfe12('0x17')]=function(_0x5a570e){var _0x421567=this;return new Promise(function(_0x12853d,_0x1c988f){return db['MailQueue'][_0xfe12('0x18')]({'raw':_0x5a570e['options']?_0x5a570e[_0xfe12('0x19')][_0xfe12('0x1a')]===undefined?!![]:![]:!![],'where':_0x5a570e[_0xfe12('0x19')]?_0x5a570e[_0xfe12('0x19')][_0xfe12('0x1b')]||null:null,'attributes':_0x5a570e[_0xfe12('0x19')]?_0x5a570e['options'][_0xfe12('0x1c')]||null:null,'limit':_0x5a570e[_0xfe12('0x19')]?_0x5a570e[_0xfe12('0x19')]['limit']||null:null,'include':_0x5a570e[_0xfe12('0x19')]?_0x5a570e[_0xfe12('0x19')][_0xfe12('0x1d')]?_['map'](_0x5a570e[_0xfe12('0x19')][_0xfe12('0x1d')],function(_0x1816a8){return{'model':db[_0x1816a8[_0xfe12('0x1e')]],'as':_0x1816a8['as'],'attributes':_0x1816a8[_0xfe12('0x1c')],'include':_0x1816a8[_0xfe12('0x1d')]?_[_0xfe12('0x1f')](_0x1816a8['include'],function(_0x22f8b8){return{'model':db[_0x22f8b8[_0xfe12('0x1e')]],'as':_0x22f8b8['as'],'attributes':_0x22f8b8[_0xfe12('0x1c')],'include':_0x22f8b8[_0xfe12('0x1d')]?_[_0xfe12('0x1f')](_0x22f8b8['include'],function(_0x427d36){return{'model':db[_0x427d36['model']],'as':_0x427d36['as'],'attributes':_0x427d36[_0xfe12('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xfe12('0x20')](function(_0x5bb60e){logger['info']('GetMailQueue',_0x5a570e);logger[_0xfe12('0x21')](_0xfe12('0x17'),_0x5a570e,JSON[_0xfe12('0x11')](_0x5bb60e));_0x12853d(_0x5bb60e);})[_0xfe12('0x16')](function(_0x2f6877){logger[_0xfe12('0x12')](_0xfe12('0x17'),_0x2f6877[_0xfe12('0x14')],_0x5a570e);_0x1c988f(_0x421567['error'](0x1f4,_0x2f6877['message']));});});};exports[_0xfe12('0x22')]=function(_0xf37c00){var _0x1e4df1=this;return new Promise(function(_0xf12eec,_0x42fd64){return db[_0xfe12('0x23')][_0xfe12('0x24')]({'raw':_0xf37c00['options']?_0xf37c00['options']['raw']===undefined?!![]:![]:!![],'where':_0xf37c00['options']?_0xf37c00['options']['where']||null:null,'attributes':_0xf37c00[_0xfe12('0x19')]?_0xf37c00[_0xfe12('0x19')][_0xfe12('0x1c')]||null:null,'include':_0xf37c00[_0xfe12('0x19')]?_0xf37c00[_0xfe12('0x19')][_0xfe12('0x1d')]?_[_0xfe12('0x1f')](_0xf37c00[_0xfe12('0x19')]['include'],function(_0x3646bb){return{'model':db[_0x3646bb[_0xfe12('0x1e')]],'as':_0x3646bb['as'],'attributes':_0x3646bb[_0xfe12('0x1c')],'include':_0x3646bb[_0xfe12('0x1d')]?_[_0xfe12('0x1f')](_0x3646bb[_0xfe12('0x1d')],function(_0x4e3522){return{'model':db[_0x4e3522['model']],'as':_0x4e3522['as'],'attributes':_0x4e3522[_0xfe12('0x1c')],'include':_0x4e3522[_0xfe12('0x1d')]?_[_0xfe12('0x1f')](_0x4e3522['include'],function(_0x3dd75d){return{'model':db[_0x3dd75d[_0xfe12('0x1e')]],'as':_0x3dd75d['as'],'attributes':_0x3dd75d['attributes']};}):[]};}):[]};}):[]:[]})[_0xfe12('0x20')](function(_0x431f1c){logger[_0xfe12('0x15')]('ShowMailQueue',_0xf37c00);logger[_0xfe12('0x21')](_0xfe12('0x22'),_0xf37c00,JSON[_0xfe12('0x11')](_0x431f1c));_0xf12eec(_0x431f1c);})[_0xfe12('0x16')](function(_0x229e76){logger[_0xfe12('0x12')](_0xfe12('0x22'),_0x229e76[_0xfe12('0x14')],_0xf37c00);_0x42fd64(_0x1e4df1[_0xfe12('0x12')](0x1f4,_0x229e76['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 17f6ed2..bf8db79 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 _0xa531=['mailQueue:','./mailQueue.events','save','remove','emit','removeListener','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa531,0x12e));var _0x1a53=function(_0x28b03b,_0x416299){_0x28b03b=_0x28b03b-0x0;var _0x327021=_0xa531[_0x28b03b];return _0x327021;};'use strict';var MailQueueEvents=require(_0x1a53('0x0'));var events=[_0x1a53('0x1'),_0x1a53('0x2'),'update'];function createListener(_0x5d5764,_0x26c357){return function(_0x562254){_0x26c357[_0x1a53('0x3')](_0x5d5764,_0x562254);};}function removeListener(_0x3d7dde,_0x151fa8){return function(){MailQueueEvents[_0x1a53('0x4')](_0x3d7dde,_0x151fa8);};}exports['register']=function(_0x2dcf22){for(var _0x1bbc60=0x0,_0x2d1d3f=events[_0x1a53('0x5')];_0x1bbc60<_0x2d1d3f;_0x1bbc60++){var _0x55382c=events[_0x1bbc60];var _0x4c1ab4=createListener(_0x1a53('0x6')+_0x55382c,_0x2dcf22);MailQueueEvents['on'](_0x55382c,_0x4c1ab4);}}; \ No newline at end of file +var _0x782e=['removeListener','register','length','mailQueue:','./mailQueue.events','save','remove','emit'];(function(_0x4e9559,_0x324346){var _0x13d630=function(_0x35fd5a){while(--_0x35fd5a){_0x4e9559['push'](_0x4e9559['shift']());}};_0x13d630(++_0x324346);}(_0x782e,0x1d4));var _0xe782=function(_0x2a5f2f,_0x8204ca){_0x2a5f2f=_0x2a5f2f-0x0;var _0x205145=_0x782e[_0x2a5f2f];return _0x205145;};'use strict';var MailQueueEvents=require(_0xe782('0x0'));var events=[_0xe782('0x1'),_0xe782('0x2'),'update'];function createListener(_0x500c71,_0x38802e){return function(_0x13e20d){_0x38802e[_0xe782('0x3')](_0x500c71,_0x13e20d);};}function removeListener(_0x35540c,_0x357e69){return function(){MailQueueEvents[_0xe782('0x4')](_0x35540c,_0x357e69);};}exports[_0xe782('0x5')]=function(_0x2183d8){for(var _0x2f9f5d=0x0,_0x286374=events[_0xe782('0x6')];_0x2f9f5d<_0x286374;_0x2f9f5d++){var _0x831385=events[_0x2f9f5d];var _0x383667=createListener(_0xe782('0x7')+_0x831385,_0x2183d8);MailQueueEvents['on'](_0x831385,_0x383667);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 4090a08..e73d31d 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 _0x8608=['index','/describe','/:id','show','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x5e80a1,_0x5558fa){var _0x2290fc=function(_0x28f829){while(--_0x28f829){_0x5e80a1['push'](_0x5e80a1['shift']());}};_0x2290fc(++_0x5558fa);}(_0x8608,0x1c2));var _0x8860=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8608[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x8860('0x0'));var util=require(_0x8860('0x1'));var path=require(_0x8860('0x2'));var timeout=require(_0x8860('0x3'));var express=require(_0x8860('0x4'));var router=express[_0x8860('0x5')]();var fs_extra=require(_0x8860('0x6'));var auth=require(_0x8860('0x7'));var interaction=require(_0x8860('0x8'));var config=require(_0x8860('0x9'));var controller=require('./mailQueueReport.controller');router[_0x8860('0xa')]('/',auth[_0x8860('0xb')](),controller[_0x8860('0xc')]);router['get'](_0x8860('0xd'),auth[_0x8860('0xb')](),controller['describe']);router[_0x8860('0xa')](_0x8860('0xe'),auth[_0x8860('0xb')](),controller[_0x8860('0xf')]);router['post']('/',auth[_0x8860('0xb')](),controller[_0x8860('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x8860('0x11')]);router[_0x8860('0x12')](_0x8860('0xe'),auth[_0x8860('0xb')](),controller[_0x8860('0x13')]);module[_0x8860('0x14')]=router; \ No newline at end of file +var _0x6f66=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','put','update','multer','util','path'];(function(_0x1199ae,_0x4d3766){var _0x211782=function(_0x1c7877){while(--_0x1c7877){_0x1199ae['push'](_0x1199ae['shift']());}};_0x211782(++_0x4d3766);}(_0x6f66,0x10b));var _0x66f6=function(_0x10791d,_0x2562b6){_0x10791d=_0x10791d-0x0;var _0x1b4f9c=_0x6f66[_0x10791d];return _0x1b4f9c;};'use strict';var multer=require(_0x66f6('0x0'));var util=require(_0x66f6('0x1'));var path=require(_0x66f6('0x2'));var timeout=require('connect-timeout');var express=require(_0x66f6('0x3'));var router=express[_0x66f6('0x4')]();var fs_extra=require(_0x66f6('0x5'));var auth=require(_0x66f6('0x6'));var interaction=require(_0x66f6('0x7'));var config=require(_0x66f6('0x8'));var controller=require('./mailQueueReport.controller');router[_0x66f6('0x9')]('/',auth['isAuthenticated'](),controller[_0x66f6('0xa')]);router[_0x66f6('0x9')](_0x66f6('0xb'),auth[_0x66f6('0xc')](),controller[_0x66f6('0xd')]);router[_0x66f6('0x9')](_0x66f6('0xe'),auth[_0x66f6('0xc')](),controller[_0x66f6('0xf')]);router['post']('/',auth[_0x66f6('0xc')](),controller['create']);router[_0x66f6('0x10')](_0x66f6('0xe'),auth['isAuthenticated'](),controller[_0x66f6('0x11')]);router['delete']('/:id',auth[_0x66f6('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 29bbb80..8ef4d34 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 _0xc130=['sequelize','exports','STRING','DATE','moment'];(function(_0x5020ec,_0x1bf2ae){var _0x285c9d=function(_0x2e21b1){while(--_0x2e21b1){_0x5020ec['push'](_0x5020ec['shift']());}};_0x285c9d(++_0x1bf2ae);}(_0xc130,0x7c));var _0x0c13=function(_0x12c7a1,_0x2c8f18){_0x12c7a1=_0x12c7a1-0x0;var _0xbc2f7=_0xc130[_0x12c7a1];return _0xbc2f7;};'use strict';var moment=require(_0x0c13('0x0'));var Sequelize=require(_0x0c13('0x1'));module[_0x0c13('0x2')]={'uniqueid':{'type':Sequelize[_0x0c13('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x0c13('0x3')]},'joinAt':{'type':Sequelize[_0x0c13('0x4')]},'leaveAt':{'type':Sequelize[_0x0c13('0x4')]},'acceptAt':{'type':Sequelize[_0x0c13('0x4')]},'exitAt':{'type':Sequelize[_0x0c13('0x4')]},'reason':{'type':Sequelize[_0x0c13('0x3')]}}; \ No newline at end of file +var _0x84c7=['STRING','DATE','sequelize','exports'];(function(_0x373723,_0x1fe596){var _0x526eba=function(_0x1ab293){while(--_0x1ab293){_0x373723['push'](_0x373723['shift']());}};_0x526eba(++_0x1fe596);}(_0x84c7,0x10e));var _0x784c=function(_0x5be130,_0x8e014a){_0x5be130=_0x5be130-0x0;var _0x32e401=_0x84c7[_0x5be130];return _0x32e401;};'use strict';var moment=require('moment');var Sequelize=require(_0x784c('0x0'));module[_0x784c('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x784c('0x2')]},'joinAt':{'type':Sequelize[_0x784c('0x3')]},'leaveAt':{'type':Sequelize[_0x784c('0x3')]},'acceptAt':{'type':Sequelize[_0x784c('0x3')]},'exitAt':{'type':Sequelize[_0x784c('0x3')]},'reason':{'type':Sequelize[_0x784c('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 0b9e317..30e182e 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 _0x6d11=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','apply','reject','then','destroy','stack','name','send','index','map','MailQueueReport','rawAttributes','key','model','query','keys','filters','intersection','attributes','length','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','show','params','fields','catch','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x6d11,0xbf));var _0x16d1=function(_0x4c0721,_0x4a13a9){_0x4c0721=_0x4c0721-0x0;var _0x3e1085=_0x6d11[_0x4c0721];return _0x3e1085;};'use strict';var emlformat=require(_0x16d1('0x0'));var rimraf=require(_0x16d1('0x1'));var zipdir=require(_0x16d1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x16d1('0x3'));var moment=require('moment');var BPromise=require(_0x16d1('0x4'));var Mustache=require(_0x16d1('0x5'));var util=require('util');var path=require('path');var sox=require(_0x16d1('0x6'));var csv=require(_0x16d1('0x7'));var ejs=require(_0x16d1('0x8'));var fs=require('fs');var fs_extra=require(_0x16d1('0x9'));var _=require(_0x16d1('0xa'));var squel=require(_0x16d1('0xb'));var crypto=require(_0x16d1('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x16d1('0xd'));var Papa=require(_0x16d1('0xe'));var Redis=require(_0x16d1('0xf'));var authService=require(_0x16d1('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x16d1('0x11'));var hardwareService=require(_0x16d1('0x12'));var logger=require(_0x16d1('0x13'))(_0x16d1('0x14'));var utils=require(_0x16d1('0x15'));var config=require(_0x16d1('0x16'));var licenseUtil=require(_0x16d1('0x17'));var db=require(_0x16d1('0x18'))['db'];function respondWithStatusCode(_0x4de260,_0x32fa68){_0x32fa68=_0x32fa68||0xcc;return function(_0x2e71fa){if(_0x2e71fa){return _0x4de260[_0x16d1('0x19')](_0x32fa68);}return _0x4de260[_0x16d1('0x1a')](_0x32fa68)[_0x16d1('0x1b')]();};}function respondWithResult(_0x5a1429,_0xc034b7){_0xc034b7=_0xc034b7||0xc8;return function(_0x1b71d3){if(_0x1b71d3){return _0x5a1429[_0x16d1('0x1a')](_0xc034b7)[_0x16d1('0x1c')](_0x1b71d3);}};}function respondWithFilteredResult(_0x29ebba,_0x173e16){return function(_0x2d7e8a){if(_0x2d7e8a){var _0x4ee46c=typeof _0x173e16[_0x16d1('0x1d')]===_0x16d1('0x1e')&&typeof _0x173e16['limit']==='undefined';var _0x1a9ec8=_0x2d7e8a['count'];var _0x46a25e=_0x4ee46c?0x0:_0x173e16['offset'];var _0x1da1b8=_0x4ee46c?_0x2d7e8a['count']:_0x173e16[_0x16d1('0x1d')]+_0x173e16[_0x16d1('0x1f')];var _0x48cd70;if(_0x1da1b8>=_0x1a9ec8){_0x1da1b8=_0x1a9ec8;_0x48cd70=0xc8;}else{_0x48cd70=0xce;}_0x29ebba['status'](_0x48cd70);return _0x29ebba['set']('Content-Range',_0x46a25e+'-'+_0x1da1b8+'/'+_0x1a9ec8)[_0x16d1('0x1c')](_0x2d7e8a);}return null;};}function patchUpdates(_0x55a0e0){return function(_0x34b88f){try{jsonpatch[_0x16d1('0x20')](_0x34b88f,_0x55a0e0,!![]);}catch(_0x1f6add){return BPromise[_0x16d1('0x21')](_0x1f6add);}return _0x34b88f['save']();};}function saveUpdates(_0x2c7825,_0x58a03b){return function(_0x2a897d){if(_0x2a897d){return _0x2a897d['update'](_0x2c7825)[_0x16d1('0x22')](function(_0x8c7266){return _0x8c7266;});}return null;};}function removeEntity(_0x17e038,_0x47cad4){return function(_0x215c23){if(_0x215c23){return _0x215c23[_0x16d1('0x23')]()[_0x16d1('0x22')](function(){_0x17e038[_0x16d1('0x1a')](0xcc)[_0x16d1('0x1b')]();});}};}function handleEntityNotFound(_0x335c24,_0x4b2b5c){return function(_0x15203b){if(!_0x15203b){_0x335c24[_0x16d1('0x19')](0x194);}return _0x15203b;};}function handleError(_0x262f89,_0x346b69){_0x346b69=_0x346b69||0x1f4;return function(_0x2b8403){logger['error'](_0x2b8403[_0x16d1('0x24')]);if(_0x2b8403[_0x16d1('0x25')]){delete _0x2b8403[_0x16d1('0x25')];}_0x262f89['status'](_0x346b69)[_0x16d1('0x26')](_0x2b8403);};}exports[_0x16d1('0x27')]=function(_0x364bf7,_0x22e5b3){var _0x6396fc={},_0x462e5b={},_0x1dd574={'count':0x0,'rows':[]};var _0x562908=_[_0x16d1('0x28')](db[_0x16d1('0x29')][_0x16d1('0x2a')],function(_0x30cd8f){return{'name':_0x30cd8f['fieldName'],'type':_0x30cd8f['type'][_0x16d1('0x2b')]};});_0x462e5b[_0x16d1('0x2c')]=_[_0x16d1('0x28')](_0x562908,_0x16d1('0x25'));_0x462e5b[_0x16d1('0x2d')]=_[_0x16d1('0x2e')](_0x364bf7[_0x16d1('0x2d')]);_0x462e5b[_0x16d1('0x2f')]=_[_0x16d1('0x30')](_0x462e5b[_0x16d1('0x2c')],_0x462e5b[_0x16d1('0x2d')]);_0x6396fc[_0x16d1('0x31')]=_[_0x16d1('0x30')](_0x462e5b[_0x16d1('0x2c')],qs['fields'](_0x364bf7[_0x16d1('0x2d')]['fields']));_0x6396fc[_0x16d1('0x31')]=_0x6396fc[_0x16d1('0x31')][_0x16d1('0x32')]?_0x6396fc[_0x16d1('0x31')]:_0x462e5b[_0x16d1('0x2c')];if(!_0x364bf7[_0x16d1('0x2d')]['hasOwnProperty']('nolimit')){_0x6396fc['limit']=qs[_0x16d1('0x1f')](_0x364bf7[_0x16d1('0x2d')][_0x16d1('0x1f')]);_0x6396fc[_0x16d1('0x1d')]=qs['offset'](_0x364bf7[_0x16d1('0x2d')][_0x16d1('0x1d')]);}_0x6396fc['order']=qs['sort'](_0x364bf7['query'][_0x16d1('0x33')]);_0x6396fc[_0x16d1('0x34')]=qs[_0x16d1('0x2f')](_['pick'](_0x364bf7[_0x16d1('0x2d')],_0x462e5b[_0x16d1('0x2f')]),_0x562908);if(_0x364bf7[_0x16d1('0x2d')][_0x16d1('0x35')]){_0x6396fc[_0x16d1('0x34')]=_[_0x16d1('0x36')](_0x6396fc[_0x16d1('0x34')],{'$or':_['map'](_0x562908,function(_0x50267b){if(_0x50267b['type']!==_0x16d1('0x37')){var _0x2306d3={};_0x2306d3[_0x50267b[_0x16d1('0x25')]]={'$like':'%'+_0x364bf7[_0x16d1('0x2d')][_0x16d1('0x35')]+'%'};return _0x2306d3;}})});}_0x6396fc=_[_0x16d1('0x36')]({},_0x6396fc,_0x364bf7[_0x16d1('0x38')]);var _0x369b1c={'where':_0x6396fc['where']};return db[_0x16d1('0x29')]['count'](_0x369b1c)['then'](function(_0x352c5b){_0x1dd574[_0x16d1('0x39')]=_0x352c5b;if(_0x364bf7[_0x16d1('0x2d')][_0x16d1('0x3a')]){_0x6396fc[_0x16d1('0x3b')]=[{'all':!![]}];}return db[_0x16d1('0x29')]['findAll'](_0x6396fc);})[_0x16d1('0x22')](function(_0x525212){_0x1dd574['rows']=_0x525212;return _0x1dd574;})['then'](respondWithFilteredResult(_0x22e5b3,_0x6396fc))['catch'](handleError(_0x22e5b3,null));};exports[_0x16d1('0x3c')]=function(_0x168e14,_0x24038b){var _0x1eb761={'raw':!![],'where':{'id':_0x168e14[_0x16d1('0x3d')]['id']}},_0x53de06={};_0x53de06['model']=_[_0x16d1('0x2e')](db[_0x16d1('0x29')][_0x16d1('0x2a')]);_0x53de06[_0x16d1('0x2d')]=_[_0x16d1('0x2e')](_0x168e14[_0x16d1('0x2d')]);_0x53de06[_0x16d1('0x2f')]=_[_0x16d1('0x30')](_0x53de06[_0x16d1('0x2c')],_0x53de06[_0x16d1('0x2d')]);_0x1eb761[_0x16d1('0x31')]=_[_0x16d1('0x30')](_0x53de06[_0x16d1('0x2c')],qs[_0x16d1('0x3e')](_0x168e14[_0x16d1('0x2d')]['fields']));_0x1eb761['attributes']=_0x1eb761[_0x16d1('0x31')][_0x16d1('0x32')]?_0x1eb761[_0x16d1('0x31')]:_0x53de06[_0x16d1('0x2c')];if(_0x168e14[_0x16d1('0x2d')][_0x16d1('0x3a')]){_0x1eb761['include']=[{'all':!![]}];}_0x1eb761=_[_0x16d1('0x36')]({},_0x1eb761,_0x168e14[_0x16d1('0x38')]);return db[_0x16d1('0x29')]['find'](_0x1eb761)['then'](handleEntityNotFound(_0x24038b,null))[_0x16d1('0x22')](respondWithResult(_0x24038b,null))[_0x16d1('0x3f')](handleError(_0x24038b,null));};exports['create']=function(_0x1cc137,_0x583151){return db[_0x16d1('0x29')][_0x16d1('0x40')](_0x1cc137[_0x16d1('0x41')],{})[_0x16d1('0x22')](respondWithResult(_0x583151,0xc9))['catch'](handleError(_0x583151,null));};exports['update']=function(_0x1d92cd,_0x8bb0c1){if(_0x1d92cd['body']['id']){delete _0x1d92cd[_0x16d1('0x41')]['id'];}return db[_0x16d1('0x29')][_0x16d1('0x42')]({'where':{'id':_0x1d92cd[_0x16d1('0x3d')]['id']}})[_0x16d1('0x22')](handleEntityNotFound(_0x8bb0c1,null))['then'](saveUpdates(_0x1d92cd[_0x16d1('0x41')],null))['then'](respondWithResult(_0x8bb0c1,null))[_0x16d1('0x3f')](handleError(_0x8bb0c1,null));};exports[_0x16d1('0x23')]=function(_0x5d384c,_0x413acd){return db[_0x16d1('0x29')][_0x16d1('0x42')]({'where':{'id':_0x5d384c[_0x16d1('0x3d')]['id']}})['then'](handleEntityNotFound(_0x413acd,null))['then'](removeEntity(_0x413acd,null))['catch'](handleError(_0x413acd,null));};exports[_0x16d1('0x43')]=function(_0xbf100f,_0x39fd41){return db[_0x16d1('0x29')]['describe']()[_0x16d1('0x22')](respondWithResult(_0x39fd41,null))[_0x16d1('0x3f')](handleError(_0x39fd41,null));}; \ No newline at end of file +var _0xb44a=['options','rows','catch','show','params','includeAll','merge','create','body','find','destroy','describe','zip-dir','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','name','send','MailQueueReport','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','VIRTUAL'];(function(_0x1bb455,_0x1b8d69){var _0x1b2515=function(_0xa017d8){while(--_0xa017d8){_0x1bb455['push'](_0x1bb455['shift']());}};_0x1b2515(++_0x1b8d69);}(_0xb44a,0x1c2));var _0xab44=function(_0x44e50a,_0x1cc4a2){_0x44e50a=_0x44e50a-0x0;var _0x1b5994=_0xb44a[_0x44e50a];return _0x1b5994;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xab44('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xab44('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xab44('0x2'));var util=require('util');var path=require(_0xab44('0x3'));var sox=require(_0xab44('0x4'));var csv=require(_0xab44('0x5'));var ejs=require(_0xab44('0x6'));var fs=require('fs');var fs_extra=require(_0xab44('0x7'));var _=require(_0xab44('0x8'));var squel=require(_0xab44('0x9'));var crypto=require(_0xab44('0xa'));var jsforce=require(_0xab44('0xb'));var deskjs=require(_0xab44('0xc'));var toCsv=require(_0xab44('0x5'));var querystring=require(_0xab44('0xd'));var Papa=require(_0xab44('0xe'));var Redis=require('ioredis');var authService=require(_0xab44('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xab44('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xab44('0x11'));var utils=require(_0xab44('0x12'));var config=require(_0xab44('0x13'));var licenseUtil=require(_0xab44('0x14'));var db=require(_0xab44('0x15'))['db'];function respondWithStatusCode(_0x237c26,_0x52d282){_0x52d282=_0x52d282||0xcc;return function(_0x57fcff){if(_0x57fcff){return _0x237c26[_0xab44('0x16')](_0x52d282);}return _0x237c26['status'](_0x52d282)[_0xab44('0x17')]();};}function respondWithResult(_0x5ae369,_0x25f611){_0x25f611=_0x25f611||0xc8;return function(_0x15b98a){if(_0x15b98a){return _0x5ae369[_0xab44('0x18')](_0x25f611)[_0xab44('0x19')](_0x15b98a);}};}function respondWithFilteredResult(_0x31404d,_0x41701b){return function(_0x4875df){if(_0x4875df){var _0x51251b=typeof _0x41701b[_0xab44('0x1a')]===_0xab44('0x1b')&&typeof _0x41701b[_0xab44('0x1c')]===_0xab44('0x1b');var _0xffdfbc=_0x4875df[_0xab44('0x1d')];var _0x354b09=_0x51251b?0x0:_0x41701b[_0xab44('0x1a')];var _0x310b15=_0x51251b?_0x4875df[_0xab44('0x1d')]:_0x41701b[_0xab44('0x1a')]+_0x41701b['limit'];var _0xb779bb;if(_0x310b15>=_0xffdfbc){_0x310b15=_0xffdfbc;_0xb779bb=0xc8;}else{_0xb779bb=0xce;}_0x31404d[_0xab44('0x18')](_0xb779bb);return _0x31404d[_0xab44('0x1e')](_0xab44('0x1f'),_0x354b09+'-'+_0x310b15+'/'+_0xffdfbc)[_0xab44('0x19')](_0x4875df);}return null;};}function patchUpdates(_0x5123b1){return function(_0xcd426){try{jsonpatch['apply'](_0xcd426,_0x5123b1,!![]);}catch(_0x1f7311){return BPromise[_0xab44('0x20')](_0x1f7311);}return _0xcd426[_0xab44('0x21')]();};}function saveUpdates(_0x355083,_0x486317){return function(_0x3a2b1d){if(_0x3a2b1d){return _0x3a2b1d[_0xab44('0x22')](_0x355083)[_0xab44('0x23')](function(_0x3b17d5){return _0x3b17d5;});}return null;};}function removeEntity(_0x11f0b,_0x402950){return function(_0x43f1c6){if(_0x43f1c6){return _0x43f1c6['destroy']()['then'](function(){_0x11f0b[_0xab44('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2439f3,_0x5a7269){return function(_0x2a1bbc){if(!_0x2a1bbc){_0x2439f3['sendStatus'](0x194);}return _0x2a1bbc;};}function handleError(_0x531583,_0x8e60fa){_0x8e60fa=_0x8e60fa||0x1f4;return function(_0x25287b){logger[_0xab44('0x24')](_0x25287b[_0xab44('0x25')]);if(_0x25287b[_0xab44('0x26')]){delete _0x25287b['name'];}_0x531583[_0xab44('0x18')](_0x8e60fa)[_0xab44('0x27')](_0x25287b);};}exports['index']=function(_0x887b0d,_0xebb7d1){var _0x21131e={},_0x1cd486={},_0x4550c8={'count':0x0,'rows':[]};var _0xdc50a1=_['map'](db[_0xab44('0x28')][_0xab44('0x29')],function(_0x36f9b6){return{'name':_0x36f9b6['fieldName'],'type':_0x36f9b6['type'][_0xab44('0x2a')]};});_0x1cd486['model']=_['map'](_0xdc50a1,_0xab44('0x26'));_0x1cd486[_0xab44('0x2b')]=_[_0xab44('0x2c')](_0x887b0d[_0xab44('0x2b')]);_0x1cd486[_0xab44('0x2d')]=_[_0xab44('0x2e')](_0x1cd486[_0xab44('0x2f')],_0x1cd486[_0xab44('0x2b')]);_0x21131e[_0xab44('0x30')]=_[_0xab44('0x2e')](_0x1cd486[_0xab44('0x2f')],qs[_0xab44('0x31')](_0x887b0d[_0xab44('0x2b')][_0xab44('0x31')]));_0x21131e['attributes']=_0x21131e['attributes'][_0xab44('0x32')]?_0x21131e[_0xab44('0x30')]:_0x1cd486['model'];if(!_0x887b0d[_0xab44('0x2b')][_0xab44('0x33')](_0xab44('0x34'))){_0x21131e[_0xab44('0x1c')]=qs[_0xab44('0x1c')](_0x887b0d[_0xab44('0x2b')][_0xab44('0x1c')]);_0x21131e[_0xab44('0x1a')]=qs[_0xab44('0x1a')](_0x887b0d[_0xab44('0x2b')][_0xab44('0x1a')]);}_0x21131e[_0xab44('0x35')]=qs[_0xab44('0x36')](_0x887b0d[_0xab44('0x2b')][_0xab44('0x36')]);_0x21131e[_0xab44('0x37')]=qs[_0xab44('0x2d')](_[_0xab44('0x38')](_0x887b0d['query'],_0x1cd486[_0xab44('0x2d')]),_0xdc50a1);if(_0x887b0d[_0xab44('0x2b')][_0xab44('0x39')]){_0x21131e[_0xab44('0x37')]=_['merge'](_0x21131e[_0xab44('0x37')],{'$or':_[_0xab44('0x3a')](_0xdc50a1,function(_0xcd077a){if(_0xcd077a[_0xab44('0x3b')]!==_0xab44('0x3c')){var _0x4f5cf3={};_0x4f5cf3[_0xcd077a[_0xab44('0x26')]]={'$like':'%'+_0x887b0d[_0xab44('0x2b')][_0xab44('0x39')]+'%'};return _0x4f5cf3;}})});}_0x21131e=_['merge']({},_0x21131e,_0x887b0d[_0xab44('0x3d')]);var _0x1e26de={'where':_0x21131e[_0xab44('0x37')]};return db[_0xab44('0x28')][_0xab44('0x1d')](_0x1e26de)['then'](function(_0x1de52d){_0x4550c8['count']=_0x1de52d;if(_0x887b0d[_0xab44('0x2b')]['includeAll']){_0x21131e['include']=[{'all':!![]}];}return db['MailQueueReport']['findAll'](_0x21131e);})['then'](function(_0x120585){_0x4550c8[_0xab44('0x3e')]=_0x120585;return _0x4550c8;})[_0xab44('0x23')](respondWithFilteredResult(_0xebb7d1,_0x21131e))[_0xab44('0x3f')](handleError(_0xebb7d1,null));};exports[_0xab44('0x40')]=function(_0xf3f37a,_0x19d20d){var _0x33641e={'raw':!![],'where':{'id':_0xf3f37a[_0xab44('0x41')]['id']}},_0x4429e6={};_0x4429e6['model']=_[_0xab44('0x2c')](db[_0xab44('0x28')][_0xab44('0x29')]);_0x4429e6[_0xab44('0x2b')]=_['keys'](_0xf3f37a[_0xab44('0x2b')]);_0x4429e6[_0xab44('0x2d')]=_[_0xab44('0x2e')](_0x4429e6[_0xab44('0x2f')],_0x4429e6[_0xab44('0x2b')]);_0x33641e[_0xab44('0x30')]=_['intersection'](_0x4429e6['model'],qs[_0xab44('0x31')](_0xf3f37a[_0xab44('0x2b')][_0xab44('0x31')]));_0x33641e[_0xab44('0x30')]=_0x33641e[_0xab44('0x30')]['length']?_0x33641e[_0xab44('0x30')]:_0x4429e6[_0xab44('0x2f')];if(_0xf3f37a[_0xab44('0x2b')][_0xab44('0x42')]){_0x33641e['include']=[{'all':!![]}];}_0x33641e=_[_0xab44('0x43')]({},_0x33641e,_0xf3f37a[_0xab44('0x3d')]);return db[_0xab44('0x28')]['find'](_0x33641e)[_0xab44('0x23')](handleEntityNotFound(_0x19d20d,null))[_0xab44('0x23')](respondWithResult(_0x19d20d,null))[_0xab44('0x3f')](handleError(_0x19d20d,null));};exports[_0xab44('0x44')]=function(_0x4eeb65,_0x13892d){return db['MailQueueReport'][_0xab44('0x44')](_0x4eeb65[_0xab44('0x45')],{})[_0xab44('0x23')](respondWithResult(_0x13892d,0xc9))[_0xab44('0x3f')](handleError(_0x13892d,null));};exports['update']=function(_0x328891,_0x5497a3){if(_0x328891[_0xab44('0x45')]['id']){delete _0x328891[_0xab44('0x45')]['id'];}return db[_0xab44('0x28')][_0xab44('0x46')]({'where':{'id':_0x328891[_0xab44('0x41')]['id']}})['then'](handleEntityNotFound(_0x5497a3,null))[_0xab44('0x23')](saveUpdates(_0x328891['body'],null))[_0xab44('0x23')](respondWithResult(_0x5497a3,null))[_0xab44('0x3f')](handleError(_0x5497a3,null));};exports[_0xab44('0x47')]=function(_0x50b705,_0x4463f1){return db[_0xab44('0x28')][_0xab44('0x46')]({'where':{'id':_0x50b705[_0xab44('0x41')]['id']}})[_0xab44('0x23')](handleEntityNotFound(_0x4463f1,null))['then'](removeEntity(_0x4463f1,null))['catch'](handleError(_0x4463f1,null));};exports[_0xab44('0x48')]=function(_0x1b18fb,_0xaa00a1){return db['MailQueueReport'][_0xab44('0x48')]()[_0xab44('0x23')](respondWithResult(_0xaa00a1,null))[_0xab44('0x3f')](handleError(_0xaa00a1,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 5c41cc1..12d6519 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 _0x48c5=['uniqueid','util','../../config/logger','api','moment','rimraf','../../config/environment','define','report_mail_queue'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x48c5,0x14e));var _0x548c=function(_0x303758,_0x4fbf83){_0x303758=_0x303758-0x0;var _0x49553a=_0x48c5[_0x303758];return _0x49553a;};'use strict';var _=require('lodash');var util=require(_0x548c('0x0'));var logger=require(_0x548c('0x1'))(_0x548c('0x2'));var moment=require(_0x548c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x548c('0x4'));var config=require(_0x548c('0x5'));var attributes=require('./mailQueueReport.attributes');module['exports']=function(_0xd9d7de,_0x5e6c71){return _0xd9d7de[_0x548c('0x6')]('MailQueueReport',attributes,{'tableName':_0x548c('0x7'),'paranoid':![],'indexes':[{'name':_0x548c('0x8'),'fields':[_0x548c('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x08c9=['api','request-promise','rimraf','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','util','../../config/logger'];(function(_0x99ba67,_0x10eae9){var _0x5c4f7d=function(_0x2962f6){while(--_0x2962f6){_0x99ba67['push'](_0x99ba67['shift']());}};_0x5c4f7d(++_0x10eae9);}(_0x08c9,0x15e));var _0x908c=function(_0x5d23a9,_0x30373b){_0x5d23a9=_0x5d23a9-0x0;var _0x8d150a=_0x08c9[_0x5d23a9];return _0x8d150a;};'use strict';var _=require('lodash');var util=require(_0x908c('0x0'));var logger=require(_0x908c('0x1'))(_0x908c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x908c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x908c('0x4'));var config=require('../../config/environment');var attributes=require(_0x908c('0x5'));module[_0x908c('0x6')]=function(_0x854b50,_0x318f62){return _0x854b50[_0x908c('0x7')](_0x908c('0x8'),attributes,{'tableName':_0x908c('0x9'),'paranoid':![],'indexes':[{'name':_0x908c('0xa'),'fields':[_0x908c('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 1275d56..6fc77d6 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 _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','MailQueueReport','create','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','limit','then','lodash','util'];(function(_0x14cb67,_0x25072d){var _0x2985d4=function(_0x4adaa5){while(--_0x4adaa5){_0x14cb67['push'](_0x14cb67['shift']());}};_0x2985d4(++_0x25072d);}(_0x7a54,0x106));var _0x47a5=function(_0x1203e2,_0x44d89f){_0x1203e2=_0x1203e2-0x0;var _0x4ff447=_0x7a54[_0x1203e2];return _0x4ff447;};'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')]('MailQueueReport,\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['CreateMailQueueReport']=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')]('CreateMailQueueReport',_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')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});}; \ No newline at end of file +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(_0x461dca,_0x30367e){var _0x5ebb6a=function(_0x7cc63e){while(--_0x7cc63e){_0x461dca['push'](_0x461dca['shift']());}};_0x5ebb6a(++_0x30367e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xc4aa[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var 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 diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index b527c12..fc9073a 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(_0x1f2efd,_0x3d1d9e){var _0x19d2a8=function(_0x5b60aa){while(--_0x5b60aa){_0x1f2efd['push'](_0x1f2efd['shift']());}};_0x19d2a8(++_0x3d1d9e);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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(_0x1103c4,_0x562d1d){var _0x1c19ab=function(_0x10e254){while(--_0x10e254){_0x1103c4['push'](_0x1103c4['shift']());}};_0x1c19ab(++_0x562d1d);}(_0x9c44,0x178));var _0x49c4=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x9c44[_0x565c49];return _0x20ca34;};'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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index d28f31e..b16fbc2 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 _0x2bb0=['BOOLEAN','INTEGER','INBOX','sequelize','exports','STRING'];(function(_0x355430,_0x3003ed){var _0x4f93fd=function(_0x1b422f){while(--_0x1b422f){_0x355430['push'](_0x355430['shift']());}};_0x4f93fd(++_0x3003ed);}(_0x2bb0,0xf3));var _0x02bb=function(_0x2bbe79,_0x57c9e2){_0x2bbe79=_0x2bbe79-0x0;var _0x5be86d=_0x2bb0[_0x2bbe79];return _0x5be86d;};'use strict';var Sequelize=require(_0x02bb('0x0'));module[_0x02bb('0x1')]={'description':{'type':Sequelize[_0x02bb('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x02bb('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x02bb('0x4')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x02bb('0x2')],'defaultValue':_0x02bb('0x5')},'connTimeout':{'type':Sequelize[_0x02bb('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x02bb('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x02bb('0x2')]}}; \ No newline at end of file +var _0x5c00=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x103a71,_0x1aa85d){var _0x4ec77=function(_0x32a0df){while(--_0x32a0df){_0x103a71['push'](_0x103a71['shift']());}};_0x4ec77(++_0x1aa85d);}(_0x5c00,0x17e));var _0x05c0=function(_0x423797,_0x3d393b){_0x423797=_0x423797-0x0;var _0x57ec0c=_0x5c00[_0x423797];return _0x57ec0c;};'use strict';var Sequelize=require(_0x05c0('0x0'));module[_0x05c0('0x1')]={'description':{'type':Sequelize[_0x05c0('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x05c0('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x05c0('0x2')]},'port':{'type':Sequelize[_0x05c0('0x4')]},'tls':{'type':Sequelize[_0x05c0('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x05c0('0x2')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x05c0('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x05c0('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x05c0('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index cf8294c..5b4609c 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 _0xff04=['exports','define','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./mailServerIn.attributes'];(function(_0x40a88f,_0x1a38c4){var _0x8eb9c=function(_0x31f1c0){while(--_0x31f1c0){_0x40a88f['push'](_0x40a88f['shift']());}};_0x8eb9c(++_0x1a38c4);}(_0xff04,0x16a));var _0x4ff0=function(_0xb41a29,_0x2b83ad){_0xb41a29=_0xb41a29-0x0;var _0x16f249=_0xff04[_0xb41a29];return _0x16f249;};'use strict';var _=require('lodash');var util=require(_0x4ff0('0x0'));var logger=require(_0x4ff0('0x1'))('api');var moment=require(_0x4ff0('0x2'));var BPromise=require(_0x4ff0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4ff0('0x4'));var config=require(_0x4ff0('0x5'));var attributes=require(_0x4ff0('0x6'));module[_0x4ff0('0x7')]=function(_0x99efb3,_0x272193){return _0x99efb3[_0x4ff0('0x8')]('MailServerIn',attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1242=['bluebird','request-promise','path','../../config/environment','exports','define','MailServerIn','mail_servers_in','lodash','../../config/logger','moment'];(function(_0x2ebc52,_0x496030){var _0x5aefde=function(_0x42b319){while(--_0x42b319){_0x2ebc52['push'](_0x2ebc52['shift']());}};_0x5aefde(++_0x496030);}(_0x1242,0x1e1));var _0x2124=function(_0x3ca501,_0x5cb5ab){_0x3ca501=_0x3ca501-0x0;var _0x313356=_0x1242[_0x3ca501];return _0x313356;};'use strict';var _=require(_0x2124('0x0'));var util=require('util');var logger=require(_0x2124('0x1'))('api');var moment=require(_0x2124('0x2'));var BPromise=require(_0x2124('0x3'));var rp=require(_0x2124('0x4'));var fs=require('fs');var path=require(_0x2124('0x5'));var rimraf=require('rimraf');var config=require(_0x2124('0x6'));var attributes=require('./mailServerIn.attributes');module[_0x2124('0x7')]=function(_0x5e9d75,_0x2bb036){return _0x5e9d75[_0x2124('0x8')](_0x2124('0x9'),attributes,{'tableName':_0x2124('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 dc5208b..1376e53 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 _0x3889=['error','message','request\x20sent','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','include','map','model','debug','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','MailServerIn,\x20%s,\x20%s','stringify'];(function(_0x371aab,_0x105254){var _0x36f7a3=function(_0x5d0220){while(--_0x5d0220){_0x371aab['push'](_0x371aab['shift']());}};_0x36f7a3(++_0x105254);}(_0x3889,0x1c2));var _0x9388=function(_0x15d78d,_0x2003b7){_0x15d78d=_0x15d78d-0x0;var _0x4b9042=_0x3889[_0x15d78d];return _0x4b9042;};'use strict';var _=require(_0x9388('0x0'));var util=require(_0x9388('0x1'));var moment=require(_0x9388('0x2'));var BPromise=require(_0x9388('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9388('0x4'))['db'];var utils=require(_0x9388('0x5'));var logger=require(_0x9388('0x6'))(_0x9388('0x7'));var config=require('../../config/environment');var jayson=require(_0x9388('0x8'));var client=jayson[_0x9388('0x9')][_0x9388('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x964a6f,_0x45729b,_0x37ad14){return new BPromise(function(_0x51153f,_0x352ca4){return client[_0x9388('0xb')](_0x964a6f,_0x37ad14)[_0x9388('0xc')](function(_0x1fc37e){logger['info'](_0x9388('0xd'),_0x45729b,'request\x20sent');logger['debug']('MailServerIn,\x20%s,\x20%s,\x20%s',_0x45729b,'request\x20sent',JSON[_0x9388('0xe')](_0x1fc37e));if(_0x1fc37e[_0x9388('0xf')]){if(_0x1fc37e[_0x9388('0xf')]['code']===0x1f4){logger[_0x9388('0xf')]('MailServerIn,\x20%s,\x20%s',_0x45729b,_0x1fc37e[_0x9388('0xf')]['message']);return _0x352ca4(_0x1fc37e[_0x9388('0xf')][_0x9388('0x10')]);}logger[_0x9388('0xf')](_0x9388('0xd'),_0x45729b,_0x1fc37e[_0x9388('0xf')][_0x9388('0x10')]);return _0x51153f(_0x1fc37e[_0x9388('0xf')][_0x9388('0x10')]);}else{logger['info'](_0x9388('0xd'),_0x45729b,_0x9388('0x11'));_0x51153f(_0x1fc37e[_0x9388('0x12')][_0x9388('0x10')]);}})[_0x9388('0x13')](function(_0x5229a5){logger[_0x9388('0xf')](_0x9388('0xd'),_0x45729b,_0x5229a5);_0x352ca4(_0x5229a5);});});}exports[_0x9388('0x14')]=function(_0x1db29b){var _0x4fc6b7=this;return new Promise(function(_0x253afb,_0x3f2158){return db[_0x9388('0x15')][_0x9388('0x16')]({'raw':_0x1db29b[_0x9388('0x17')]?_0x1db29b['options'][_0x9388('0x18')]===undefined?!![]:![]:!![],'where':_0x1db29b[_0x9388('0x17')]?_0x1db29b[_0x9388('0x17')][_0x9388('0x19')]||null:null,'attributes':_0x1db29b[_0x9388('0x17')]?_0x1db29b[_0x9388('0x17')][_0x9388('0x1a')]||null:null,'limit':_0x1db29b['options']?_0x1db29b[_0x9388('0x17')]['limit']||null:null,'include':_0x1db29b[_0x9388('0x17')]?_0x1db29b['options'][_0x9388('0x1b')]?_[_0x9388('0x1c')](_0x1db29b[_0x9388('0x17')][_0x9388('0x1b')],function(_0x10eeb9){return{'model':db[_0x10eeb9[_0x9388('0x1d')]],'as':_0x10eeb9['as'],'attributes':_0x10eeb9[_0x9388('0x1a')],'include':_0x10eeb9['include']?_[_0x9388('0x1c')](_0x10eeb9['include'],function(_0x36ebd8){return{'model':db[_0x36ebd8[_0x9388('0x1d')]],'as':_0x36ebd8['as'],'attributes':_0x36ebd8[_0x9388('0x1a')],'include':_0x36ebd8[_0x9388('0x1b')]?_[_0x9388('0x1c')](_0x36ebd8['include'],function(_0x2ff963){return{'model':db[_0x2ff963['model']],'as':_0x2ff963['as'],'attributes':_0x2ff963[_0x9388('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9388('0xc')](function(_0x623c21){logger['info'](_0x9388('0x14'),_0x1db29b);logger[_0x9388('0x1e')](_0x9388('0x14'),_0x1db29b,JSON[_0x9388('0xe')](_0x623c21));_0x253afb(_0x623c21);})[_0x9388('0x13')](function(_0x19eaab){logger[_0x9388('0xf')](_0x9388('0x14'),_0x19eaab[_0x9388('0x10')],_0x1db29b);_0x3f2158(_0x4fc6b7[_0x9388('0xf')](0x1f4,_0x19eaab[_0x9388('0x10')]));});});}; \ No newline at end of file +var _0x345e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetMailServerIn','findAll','options','raw','where','limit','include','map','model','attributes','then','lodash','util','bluebird'];(function(_0x1a957b,_0x3a5dca){var _0x2b79f4=function(_0x113582){while(--_0x113582){_0x1a957b['push'](_0x1a957b['shift']());}};_0x2b79f4(++_0x3a5dca);}(_0x345e,0x168));var _0xe345=function(_0xc35e79,_0x37df8f){_0xc35e79=_0xc35e79-0x0;var _0x2f2750=_0x345e[_0xc35e79];return _0x2f2750;};'use strict';var _=require(_0xe345('0x0'));var util=require(_0xe345('0x1'));var moment=require('moment');var BPromise=require(_0xe345('0x2'));var rs=require(_0xe345('0x3'));var fs=require('fs');var Redis=require(_0xe345('0x4'));var db=require(_0xe345('0x5'))['db'];var utils=require(_0xe345('0x6'));var logger=require(_0xe345('0x7'))(_0xe345('0x8'));var config=require(_0xe345('0x9'));var jayson=require(_0xe345('0xa'));var client=jayson['client'][_0xe345('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38cc87,_0x27fc55,_0x246b2f){return new BPromise(function(_0x24f14f,_0x18f9a3){return client['request'](_0x38cc87,_0x246b2f)['then'](function(_0x41bd55){logger[_0xe345('0xc')](_0xe345('0xd'),_0x27fc55,_0xe345('0xe'));logger[_0xe345('0xf')](_0xe345('0x10'),_0x27fc55,_0xe345('0xe'),JSON[_0xe345('0x11')](_0x41bd55));if(_0x41bd55[_0xe345('0x12')]){if(_0x41bd55[_0xe345('0x12')]['code']===0x1f4){logger[_0xe345('0x12')](_0xe345('0xd'),_0x27fc55,_0x41bd55['error']['message']);return _0x18f9a3(_0x41bd55[_0xe345('0x12')]['message']);}logger[_0xe345('0x12')]('MailServerIn,\x20%s,\x20%s',_0x27fc55,_0x41bd55['error'][_0xe345('0x13')]);return _0x24f14f(_0x41bd55[_0xe345('0x12')][_0xe345('0x13')]);}else{logger[_0xe345('0xc')](_0xe345('0xd'),_0x27fc55,_0xe345('0xe'));_0x24f14f(_0x41bd55[_0xe345('0x14')][_0xe345('0x13')]);}})[_0xe345('0x15')](function(_0x1f983c){logger['error']('MailServerIn,\x20%s,\x20%s',_0x27fc55,_0x1f983c);_0x18f9a3(_0x1f983c);});});}exports[_0xe345('0x16')]=function(_0x21f20a){var _0x2000c5=this;return new Promise(function(_0x11332c,_0x412bfa){return db['MailServerIn'][_0xe345('0x17')]({'raw':_0x21f20a[_0xe345('0x18')]?_0x21f20a['options'][_0xe345('0x19')]===undefined?!![]:![]:!![],'where':_0x21f20a[_0xe345('0x18')]?_0x21f20a[_0xe345('0x18')][_0xe345('0x1a')]||null:null,'attributes':_0x21f20a[_0xe345('0x18')]?_0x21f20a[_0xe345('0x18')]['attributes']||null:null,'limit':_0x21f20a[_0xe345('0x18')]?_0x21f20a['options'][_0xe345('0x1b')]||null:null,'include':_0x21f20a['options']?_0x21f20a[_0xe345('0x18')][_0xe345('0x1c')]?_[_0xe345('0x1d')](_0x21f20a[_0xe345('0x18')]['include'],function(_0x5f2641){return{'model':db[_0x5f2641[_0xe345('0x1e')]],'as':_0x5f2641['as'],'attributes':_0x5f2641[_0xe345('0x1f')],'include':_0x5f2641['include']?_['map'](_0x5f2641['include'],function(_0x3dac93){return{'model':db[_0x3dac93[_0xe345('0x1e')]],'as':_0x3dac93['as'],'attributes':_0x3dac93[_0xe345('0x1f')],'include':_0x3dac93['include']?_['map'](_0x3dac93[_0xe345('0x1c')],function(_0x4e017b){return{'model':db[_0x4e017b[_0xe345('0x1e')]],'as':_0x4e017b['as'],'attributes':_0x4e017b[_0xe345('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe345('0x20')](function(_0x517ffa){logger[_0xe345('0xc')]('GetMailServerIn',_0x21f20a);logger[_0xe345('0xf')](_0xe345('0x16'),_0x21f20a,JSON[_0xe345('0x11')](_0x517ffa));_0x11332c(_0x517ffa);})['catch'](function(_0x536c3a){logger[_0xe345('0x12')](_0xe345('0x16'),_0x536c3a[_0xe345('0x13')],_0x21f20a);_0x412bfa(_0x2000c5[_0xe345('0x12')](0x1f4,_0x536c3a[_0xe345('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 00fa178..abf036c 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x7a54,0x106));var _0x47a5=function(_0x1c9618,_0x44ec9a){_0x1c9618=_0x1c9618-0x0;var _0x433d67=_0x7a54[_0x1c9618];return _0x433d67;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _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(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x7a54,0x106));var _0x47a5=function(_0x36d942,_0xe09138){_0x36d942=_0x36d942-0x0;var _0x2ff4fe=_0x7a54[_0x36d942];return _0x2ff4fe;};'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 c82b1cb..149b625 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 _0xaa1b=['STRING','BOOLEAN'];(function(_0x5e80f7,_0x4a043d){var _0x19849c=function(_0x2e57b7){while(--_0x2e57b7){_0x5e80f7['push'](_0x5e80f7['shift']());}};_0x19849c(++_0x4a043d);}(_0xaa1b,0x19c));var _0xbaa1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xaa1b[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0xbaa1('0x0')]},'host':{'type':Sequelize[_0xbaa1('0x0')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0xbaa1('0x0')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0xbaa1('0x1')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xbaa1('0x1')],'defaultValue':!![]}}; \ No newline at end of file +var _0x8d2f=['exports','STRING','INTEGER','BOOLEAN'];(function(_0x416265,_0x28953c){var _0x940c48=function(_0x57725d){while(--_0x57725d){_0x416265['push'](_0x416265['shift']());}};_0x940c48(++_0x28953c);}(_0x8d2f,0xb8));var _0xf8d2=function(_0x5086be,_0x1a9d70){_0x5086be=_0x5086be-0x0;var _0x211fc7=_0x8d2f[_0x5086be];return _0x211fc7;};'use strict';var Sequelize=require('sequelize');module[_0xf8d2('0x0')]={'description':{'type':Sequelize[_0xf8d2('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0xf8d2('0x1')]},'pass':{'type':Sequelize[_0xf8d2('0x1')]},'port':{'type':Sequelize[_0xf8d2('0x2')]},'secure':{'type':Sequelize[_0xf8d2('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xf8d2('0x1')]},'authentication':{'type':Sequelize[_0xf8d2('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 61e1e6c..99439a5 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 _0x7959=['order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','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','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name','send','index','map','MailServerOut','rawAttributes','type','key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x7959,0x1e5));var _0x9795=function(_0x5cdb03,_0x4b5a86){_0x5cdb03=_0x5cdb03-0x0;var _0x41b2b3=_0x7959[_0x5cdb03];return _0x41b2b3;};'use strict';var emlformat=require(_0x9795('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9795('0x1'));var jsonpatch=require(_0x9795('0x2'));var rp=require(_0x9795('0x3'));var moment=require(_0x9795('0x4'));var BPromise=require(_0x9795('0x5'));var Mustache=require(_0x9795('0x6'));var util=require(_0x9795('0x7'));var path=require(_0x9795('0x8'));var sox=require(_0x9795('0x9'));var csv=require(_0x9795('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9795('0xb'));var _=require(_0x9795('0xc'));var squel=require(_0x9795('0xd'));var crypto=require(_0x9795('0xe'));var jsforce=require(_0x9795('0xf'));var deskjs=require(_0x9795('0x10'));var toCsv=require(_0x9795('0xa'));var querystring=require(_0x9795('0x11'));var Papa=require('papaparse');var Redis=require(_0x9795('0x12'));var authService=require(_0x9795('0x13'));var qs=require(_0x9795('0x14'));var as=require(_0x9795('0x15'));var hardwareService=require(_0x9795('0x16'));var logger=require(_0x9795('0x17'))(_0x9795('0x18'));var utils=require('../../config/utils');var config=require(_0x9795('0x19'));var licenseUtil=require(_0x9795('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x313ef6,_0x4b0448){_0x4b0448=_0x4b0448||0xcc;return function(_0xeb1f7b){if(_0xeb1f7b){return _0x313ef6[_0x9795('0x1b')](_0x4b0448);}return _0x313ef6[_0x9795('0x1c')](_0x4b0448)[_0x9795('0x1d')]();};}function respondWithResult(_0x42d3a3,_0x1da7c7){_0x1da7c7=_0x1da7c7||0xc8;return function(_0x15b7d9){if(_0x15b7d9){return _0x42d3a3[_0x9795('0x1c')](_0x1da7c7)[_0x9795('0x1e')](_0x15b7d9);}};}function respondWithFilteredResult(_0x5e6ba6,_0x2361f3){return function(_0x57627c){if(_0x57627c){var _0x3358ad=typeof _0x2361f3[_0x9795('0x1f')]===_0x9795('0x20')&&typeof _0x2361f3[_0x9795('0x21')]===_0x9795('0x20');var _0x342195=_0x57627c[_0x9795('0x22')];var _0x18a3c5=_0x3358ad?0x0:_0x2361f3[_0x9795('0x1f')];var _0x3b8de7=_0x3358ad?_0x57627c[_0x9795('0x22')]:_0x2361f3['offset']+_0x2361f3[_0x9795('0x21')];var _0x35a04;if(_0x3b8de7>=_0x342195){_0x3b8de7=_0x342195;_0x35a04=0xc8;}else{_0x35a04=0xce;}_0x5e6ba6[_0x9795('0x1c')](_0x35a04);return _0x5e6ba6[_0x9795('0x23')]('Content-Range',_0x18a3c5+'-'+_0x3b8de7+'/'+_0x342195)[_0x9795('0x1e')](_0x57627c);}return null;};}function patchUpdates(_0x55d586){return function(_0x4b3391){try{jsonpatch[_0x9795('0x24')](_0x4b3391,_0x55d586,!![]);}catch(_0x4e9dfb){return BPromise[_0x9795('0x25')](_0x4e9dfb);}return _0x4b3391['save']();};}function saveUpdates(_0x59dee7,_0x2d146b){return function(_0x34f46a){if(_0x34f46a){return _0x34f46a[_0x9795('0x26')](_0x59dee7)[_0x9795('0x27')](function(_0x44d2e4){return _0x44d2e4;});}return null;};}function removeEntity(_0x2c1f66,_0x5bfb60){return function(_0xdd2e91){if(_0xdd2e91){return _0xdd2e91[_0x9795('0x28')]()[_0x9795('0x27')](function(){_0x2c1f66['status'](0xcc)[_0x9795('0x1d')]();});}};}function handleEntityNotFound(_0x5447c5,_0x33b64d){return function(_0xaf60cc){if(!_0xaf60cc){_0x5447c5[_0x9795('0x1b')](0x194);}return _0xaf60cc;};}function handleError(_0x335da0,_0x2fbd98){_0x2fbd98=_0x2fbd98||0x1f4;return function(_0x47f2a0){logger[_0x9795('0x29')](_0x47f2a0[_0x9795('0x2a')]);if(_0x47f2a0[_0x9795('0x2b')]){delete _0x47f2a0[_0x9795('0x2b')];}_0x335da0[_0x9795('0x1c')](_0x2fbd98)[_0x9795('0x2c')](_0x47f2a0);};}exports[_0x9795('0x2d')]=function(_0x510b7a,_0x3650ab){var _0x5007a8={},_0x1fded1={},_0x2adf1e={'count':0x0,'rows':[]};var _0x3d4d1b=_[_0x9795('0x2e')](db[_0x9795('0x2f')][_0x9795('0x30')],function(_0x28ebee){return{'name':_0x28ebee['fieldName'],'type':_0x28ebee[_0x9795('0x31')][_0x9795('0x32')]};});_0x1fded1['model']=_['map'](_0x3d4d1b,'name');_0x1fded1['query']=_[_0x9795('0x33')](_0x510b7a[_0x9795('0x34')]);_0x1fded1[_0x9795('0x35')]=_['intersection'](_0x1fded1[_0x9795('0x36')],_0x1fded1['query']);_0x5007a8[_0x9795('0x37')]=_[_0x9795('0x38')](_0x1fded1[_0x9795('0x36')],qs[_0x9795('0x39')](_0x510b7a['query']['fields']));_0x5007a8[_0x9795('0x37')]=_0x5007a8[_0x9795('0x37')][_0x9795('0x3a')]?_0x5007a8[_0x9795('0x37')]:_0x1fded1['model'];if(!_0x510b7a[_0x9795('0x34')][_0x9795('0x3b')](_0x9795('0x3c'))){_0x5007a8[_0x9795('0x21')]=qs['limit'](_0x510b7a[_0x9795('0x34')][_0x9795('0x21')]);_0x5007a8[_0x9795('0x1f')]=qs[_0x9795('0x1f')](_0x510b7a[_0x9795('0x34')][_0x9795('0x1f')]);}_0x5007a8[_0x9795('0x3d')]=qs[_0x9795('0x3e')](_0x510b7a[_0x9795('0x34')]['sort']);_0x5007a8[_0x9795('0x3f')]=qs[_0x9795('0x35')](_['pick'](_0x510b7a[_0x9795('0x34')],_0x1fded1['filters']),_0x3d4d1b);if(_0x510b7a['query'][_0x9795('0x40')]){_0x5007a8[_0x9795('0x3f')]=_[_0x9795('0x41')](_0x5007a8['where'],{'$or':_[_0x9795('0x2e')](_0x3d4d1b,function(_0x4d10da){if(_0x4d10da[_0x9795('0x31')]!==_0x9795('0x42')){var _0x465837={};_0x465837[_0x4d10da['name']]={'$like':'%'+_0x510b7a[_0x9795('0x34')][_0x9795('0x40')]+'%'};return _0x465837;}})});}_0x5007a8=_['merge']({},_0x5007a8,_0x510b7a[_0x9795('0x43')]);var _0x464d4f={'where':_0x5007a8[_0x9795('0x3f')]};return db[_0x9795('0x2f')][_0x9795('0x22')](_0x464d4f)['then'](function(_0x141b4d){_0x2adf1e['count']=_0x141b4d;if(_0x510b7a[_0x9795('0x34')][_0x9795('0x44')]){_0x5007a8[_0x9795('0x45')]=[{'all':!![]}];}return db[_0x9795('0x2f')][_0x9795('0x46')](_0x5007a8);})['then'](function(_0x359186){_0x2adf1e[_0x9795('0x47')]=_0x359186;return _0x2adf1e;})[_0x9795('0x27')](respondWithFilteredResult(_0x3650ab,_0x5007a8))[_0x9795('0x48')](handleError(_0x3650ab,null));};exports[_0x9795('0x49')]=function(_0xc826e0,_0x335b2d){var _0x298818={'raw':!![],'where':{'id':_0xc826e0[_0x9795('0x4a')]['id']}},_0x449a02={};_0x449a02[_0x9795('0x36')]=_[_0x9795('0x33')](db[_0x9795('0x2f')][_0x9795('0x30')]);_0x449a02[_0x9795('0x34')]=_[_0x9795('0x33')](_0xc826e0[_0x9795('0x34')]);_0x449a02['filters']=_['intersection'](_0x449a02['model'],_0x449a02[_0x9795('0x34')]);_0x298818[_0x9795('0x37')]=_[_0x9795('0x38')](_0x449a02[_0x9795('0x36')],qs[_0x9795('0x39')](_0xc826e0['query'][_0x9795('0x39')]));_0x298818[_0x9795('0x37')]=_0x298818['attributes'][_0x9795('0x3a')]?_0x298818[_0x9795('0x37')]:_0x449a02[_0x9795('0x36')];if(_0xc826e0[_0x9795('0x34')][_0x9795('0x44')]){_0x298818[_0x9795('0x45')]=[{'all':!![]}];}_0x298818=_[_0x9795('0x41')]({},_0x298818,_0xc826e0['options']);return db[_0x9795('0x2f')][_0x9795('0x4b')](_0x298818)[_0x9795('0x27')](handleEntityNotFound(_0x335b2d,null))[_0x9795('0x27')](respondWithResult(_0x335b2d,null))[_0x9795('0x48')](handleError(_0x335b2d,null));};exports[_0x9795('0x4c')]=function(_0x5f3858,_0x531f98){return db[_0x9795('0x2f')]['create'](_0x5f3858['body'],{})[_0x9795('0x27')](respondWithResult(_0x531f98,0xc9))[_0x9795('0x48')](handleError(_0x531f98,null));};exports['update']=function(_0x5a3d29,_0x4cd0ff){if(_0x5a3d29[_0x9795('0x4d')]['id']){delete _0x5a3d29[_0x9795('0x4d')]['id'];}return db[_0x9795('0x2f')][_0x9795('0x4b')]({'where':{'id':_0x5a3d29[_0x9795('0x4a')]['id']}})[_0x9795('0x27')](handleEntityNotFound(_0x4cd0ff,null))['then'](saveUpdates(_0x5a3d29[_0x9795('0x4d')],null))[_0x9795('0x27')](respondWithResult(_0x4cd0ff,null))['catch'](handleError(_0x4cd0ff,null));};exports[_0x9795('0x28')]=function(_0xdcca86,_0xadd925){return db[_0x9795('0x2f')][_0x9795('0x4b')]({'where':{'id':_0xdcca86[_0x9795('0x4a')]['id']}})[_0x9795('0x27')](handleEntityNotFound(_0xadd925,null))[_0x9795('0x27')](removeEntity(_0xadd925,null))['catch'](handleError(_0xadd925,null));}; \ No newline at end of file +var _0x7307=['filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','keys','rawAttributes','fields','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','name','send','index','map','MailServerOut','fieldName','type','key','query','intersection','model','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filters'];(function(_0x530b31,_0x17e87d){var _0x48bd71=function(_0x2ba6d5){while(--_0x2ba6d5){_0x530b31['push'](_0x530b31['shift']());}};_0x48bd71(++_0x17e87d);}(_0x7307,0x187));var _0x7730=function(_0x16771d,_0x224c60){_0x16771d=_0x16771d-0x0;var _0x386f11=_0x7307[_0x16771d];return _0x386f11;};'use strict';var emlformat=require(_0x7730('0x0'));var rimraf=require(_0x7730('0x1'));var zipdir=require(_0x7730('0x2'));var jsonpatch=require(_0x7730('0x3'));var rp=require(_0x7730('0x4'));var moment=require(_0x7730('0x5'));var BPromise=require(_0x7730('0x6'));var Mustache=require(_0x7730('0x7'));var util=require(_0x7730('0x8'));var path=require('path');var sox=require(_0x7730('0x9'));var csv=require(_0x7730('0xa'));var ejs=require(_0x7730('0xb'));var fs=require('fs');var fs_extra=require(_0x7730('0xc'));var _=require('lodash');var squel=require(_0x7730('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7730('0xa'));var querystring=require(_0x7730('0xe'));var Papa=require(_0x7730('0xf'));var Redis=require(_0x7730('0x10'));var authService=require(_0x7730('0x11'));var qs=require(_0x7730('0x12'));var as=require(_0x7730('0x13'));var hardwareService=require(_0x7730('0x14'));var logger=require(_0x7730('0x15'))(_0x7730('0x16'));var utils=require(_0x7730('0x17'));var config=require(_0x7730('0x18'));var licenseUtil=require(_0x7730('0x19'));var db=require(_0x7730('0x1a'))['db'];function respondWithStatusCode(_0x145933,_0x38c20c){_0x38c20c=_0x38c20c||0xcc;return function(_0x4ebf1a){if(_0x4ebf1a){return _0x145933[_0x7730('0x1b')](_0x38c20c);}return _0x145933[_0x7730('0x1c')](_0x38c20c)['end']();};}function respondWithResult(_0x3922d2,_0x35f06c){_0x35f06c=_0x35f06c||0xc8;return function(_0x363ed5){if(_0x363ed5){return _0x3922d2['status'](_0x35f06c)[_0x7730('0x1d')](_0x363ed5);}};}function respondWithFilteredResult(_0x5e5356,_0x4053b0){return function(_0x4a80c4){if(_0x4a80c4){var _0x3d9846=typeof _0x4053b0[_0x7730('0x1e')]==='undefined'&&typeof _0x4053b0['limit']===_0x7730('0x1f');var _0x541c0a=_0x4a80c4[_0x7730('0x20')];var _0x11376b=_0x3d9846?0x0:_0x4053b0[_0x7730('0x1e')];var _0x41866f=_0x3d9846?_0x4a80c4['count']:_0x4053b0[_0x7730('0x1e')]+_0x4053b0['limit'];var _0x599a7f;if(_0x41866f>=_0x541c0a){_0x41866f=_0x541c0a;_0x599a7f=0xc8;}else{_0x599a7f=0xce;}_0x5e5356[_0x7730('0x1c')](_0x599a7f);return _0x5e5356[_0x7730('0x21')](_0x7730('0x22'),_0x11376b+'-'+_0x41866f+'/'+_0x541c0a)['json'](_0x4a80c4);}return null;};}function patchUpdates(_0x82e01a){return function(_0x561dcb){try{jsonpatch[_0x7730('0x23')](_0x561dcb,_0x82e01a,!![]);}catch(_0x1d7d2d){return BPromise['reject'](_0x1d7d2d);}return _0x561dcb[_0x7730('0x24')]();};}function saveUpdates(_0x38f107,_0x402b52){return function(_0x2b12a8){if(_0x2b12a8){return _0x2b12a8[_0x7730('0x25')](_0x38f107)[_0x7730('0x26')](function(_0x5d5403){return _0x5d5403;});}return null;};}function removeEntity(_0x42f4c4,_0x4a065c){return function(_0x81e922){if(_0x81e922){return _0x81e922[_0x7730('0x27')]()[_0x7730('0x26')](function(){_0x42f4c4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x291149,_0x2cca93){return function(_0x21b1ff){if(!_0x21b1ff){_0x291149[_0x7730('0x1b')](0x194);}return _0x21b1ff;};}function handleError(_0xee354b,_0x3f67cb){_0x3f67cb=_0x3f67cb||0x1f4;return function(_0x40ad21){logger['error'](_0x40ad21['stack']);if(_0x40ad21[_0x7730('0x28')]){delete _0x40ad21[_0x7730('0x28')];}_0xee354b[_0x7730('0x1c')](_0x3f67cb)[_0x7730('0x29')](_0x40ad21);};}exports[_0x7730('0x2a')]=function(_0x2d19ed,_0x32146d){var _0x55e9ae={},_0x3bc2c3={},_0x58686b={'count':0x0,'rows':[]};var _0x169f99=_[_0x7730('0x2b')](db[_0x7730('0x2c')]['rawAttributes'],function(_0x3f6b06){return{'name':_0x3f6b06[_0x7730('0x2d')],'type':_0x3f6b06[_0x7730('0x2e')][_0x7730('0x2f')]};});_0x3bc2c3['model']=_[_0x7730('0x2b')](_0x169f99,'name');_0x3bc2c3['query']=_['keys'](_0x2d19ed[_0x7730('0x30')]);_0x3bc2c3['filters']=_[_0x7730('0x31')](_0x3bc2c3[_0x7730('0x32')],_0x3bc2c3[_0x7730('0x30')]);_0x55e9ae[_0x7730('0x33')]=_['intersection'](_0x3bc2c3[_0x7730('0x32')],qs['fields'](_0x2d19ed[_0x7730('0x30')]['fields']));_0x55e9ae[_0x7730('0x33')]=_0x55e9ae[_0x7730('0x33')][_0x7730('0x34')]?_0x55e9ae['attributes']:_0x3bc2c3[_0x7730('0x32')];if(!_0x2d19ed[_0x7730('0x30')][_0x7730('0x35')](_0x7730('0x36'))){_0x55e9ae[_0x7730('0x37')]=qs[_0x7730('0x37')](_0x2d19ed[_0x7730('0x30')][_0x7730('0x37')]);_0x55e9ae[_0x7730('0x1e')]=qs[_0x7730('0x1e')](_0x2d19ed[_0x7730('0x30')][_0x7730('0x1e')]);}_0x55e9ae['order']=qs[_0x7730('0x38')](_0x2d19ed[_0x7730('0x30')]['sort']);_0x55e9ae[_0x7730('0x39')]=qs[_0x7730('0x3a')](_['pick'](_0x2d19ed[_0x7730('0x30')],_0x3bc2c3['filters']),_0x169f99);if(_0x2d19ed['query'][_0x7730('0x3b')]){_0x55e9ae[_0x7730('0x39')]=_[_0x7730('0x3c')](_0x55e9ae[_0x7730('0x39')],{'$or':_[_0x7730('0x2b')](_0x169f99,function(_0x373ba4){if(_0x373ba4[_0x7730('0x2e')]!==_0x7730('0x3d')){var _0x1a001d={};_0x1a001d[_0x373ba4[_0x7730('0x28')]]={'$like':'%'+_0x2d19ed[_0x7730('0x30')][_0x7730('0x3b')]+'%'};return _0x1a001d;}})});}_0x55e9ae=_[_0x7730('0x3c')]({},_0x55e9ae,_0x2d19ed[_0x7730('0x3e')]);var _0x440911={'where':_0x55e9ae[_0x7730('0x39')]};return db['MailServerOut'][_0x7730('0x20')](_0x440911)[_0x7730('0x26')](function(_0x3fc8bd){_0x58686b[_0x7730('0x20')]=_0x3fc8bd;if(_0x2d19ed['query'][_0x7730('0x3f')]){_0x55e9ae[_0x7730('0x40')]=[{'all':!![]}];}return db[_0x7730('0x2c')][_0x7730('0x41')](_0x55e9ae);})[_0x7730('0x26')](function(_0x1e1eda){_0x58686b['rows']=_0x1e1eda;return _0x58686b;})[_0x7730('0x26')](respondWithFilteredResult(_0x32146d,_0x55e9ae))[_0x7730('0x42')](handleError(_0x32146d,null));};exports[_0x7730('0x43')]=function(_0x1d9cfc,_0x181d4a){var _0x2c431f={'raw':!![],'where':{'id':_0x1d9cfc['params']['id']}},_0x2b6652={};_0x2b6652[_0x7730('0x32')]=_[_0x7730('0x44')](db['MailServerOut'][_0x7730('0x45')]);_0x2b6652[_0x7730('0x30')]=_['keys'](_0x1d9cfc[_0x7730('0x30')]);_0x2b6652['filters']=_[_0x7730('0x31')](_0x2b6652[_0x7730('0x32')],_0x2b6652['query']);_0x2c431f[_0x7730('0x33')]=_['intersection'](_0x2b6652[_0x7730('0x32')],qs[_0x7730('0x46')](_0x1d9cfc[_0x7730('0x30')][_0x7730('0x46')]));_0x2c431f[_0x7730('0x33')]=_0x2c431f[_0x7730('0x33')][_0x7730('0x34')]?_0x2c431f[_0x7730('0x33')]:_0x2b6652[_0x7730('0x32')];if(_0x1d9cfc['query'][_0x7730('0x3f')]){_0x2c431f[_0x7730('0x40')]=[{'all':!![]}];}_0x2c431f=_[_0x7730('0x3c')]({},_0x2c431f,_0x1d9cfc[_0x7730('0x3e')]);return db[_0x7730('0x2c')][_0x7730('0x47')](_0x2c431f)['then'](handleEntityNotFound(_0x181d4a,null))[_0x7730('0x26')](respondWithResult(_0x181d4a,null))['catch'](handleError(_0x181d4a,null));};exports[_0x7730('0x48')]=function(_0x13ad51,_0x5dd2ef){return db[_0x7730('0x2c')]['create'](_0x13ad51['body'],{})['then'](respondWithResult(_0x5dd2ef,0xc9))[_0x7730('0x42')](handleError(_0x5dd2ef,null));};exports[_0x7730('0x25')]=function(_0x4e1d9b,_0x31ad9e){if(_0x4e1d9b[_0x7730('0x49')]['id']){delete _0x4e1d9b[_0x7730('0x49')]['id'];}return db['MailServerOut'][_0x7730('0x47')]({'where':{'id':_0x4e1d9b[_0x7730('0x4a')]['id']}})['then'](handleEntityNotFound(_0x31ad9e,null))['then'](saveUpdates(_0x4e1d9b[_0x7730('0x49')],null))['then'](respondWithResult(_0x31ad9e,null))[_0x7730('0x42')](handleError(_0x31ad9e,null));};exports[_0x7730('0x27')]=function(_0x1ddc8d,_0x1f44f3){return db[_0x7730('0x2c')][_0x7730('0x47')]({'where':{'id':_0x1ddc8d[_0x7730('0x4a')]['id']}})[_0x7730('0x26')](handleEntityNotFound(_0x1f44f3,null))[_0x7730('0x26')](removeEntity(_0x1f44f3,null))[_0x7730('0x42')](handleError(_0x1f44f3,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 8b3a4ed..69df37b 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 _0x67c7=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define'];(function(_0x367c78,_0x260e5f){var _0x22d51b=function(_0x4a4baf){while(--_0x4a4baf){_0x367c78['push'](_0x367c78['shift']());}};_0x22d51b(++_0x260e5f);}(_0x67c7,0x186));var _0x767c=function(_0x2eea9a,_0x368daf){_0x2eea9a=_0x2eea9a-0x0;var _0x1ec61e=_0x67c7[_0x2eea9a];return _0x1ec61e;};'use strict';var _=require(_0x767c('0x0'));var util=require(_0x767c('0x1'));var logger=require(_0x767c('0x2'))(_0x767c('0x3'));var moment=require(_0x767c('0x4'));var BPromise=require(_0x767c('0x5'));var rp=require(_0x767c('0x6'));var fs=require('fs');var path=require(_0x767c('0x7'));var rimraf=require(_0x767c('0x8'));var config=require(_0x767c('0x9'));var attributes=require(_0x767c('0xa'));module[_0x767c('0xb')]=function(_0xe6d62f,_0x42ad1e){return _0xe6d62f[_0x767c('0xc')]('MailServerOut',attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf916=['../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x293c7f,_0x22d7fb){var _0x20e797=function(_0xbea800){while(--_0xbea800){_0x293c7f['push'](_0x293c7f['shift']());}};_0x20e797(++_0x22d7fb);}(_0xf916,0x1e6));var _0x6f91=function(_0x57ccfc,_0x111942){_0x57ccfc=_0x57ccfc-0x0;var _0x600578=_0xf916[_0x57ccfc];return _0x600578;};'use strict';var _=require(_0x6f91('0x0'));var util=require('util');var logger=require(_0x6f91('0x1'))(_0x6f91('0x2'));var moment=require(_0x6f91('0x3'));var BPromise=require(_0x6f91('0x4'));var rp=require(_0x6f91('0x5'));var fs=require('fs');var path=require(_0x6f91('0x6'));var rimraf=require(_0x6f91('0x7'));var config=require(_0x6f91('0x8'));var attributes=require(_0x6f91('0x9'));module[_0x6f91('0xa')]=function(_0x589563,_0x5bfb67){return _0x589563[_0x6f91('0xb')](_0x6f91('0xc'),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 2105772..32b3abd 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x4cdd6d,_0x234aa1){var _0x5887df=function(_0x4fd1fd){while(--_0x4fd1fd){_0x4cdd6d['push'](_0x4cdd6d['shift']());}};_0x5887df(++_0x234aa1);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4fa8d6,_0x4768ab){_0x4fa8d6=_0x4fa8d6-0x0;var _0x3775d3=_0x5f2f[_0x4fa8d6];return _0x3775d3;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x4d52f2,_0x16b716){var _0x2eb3ba=function(_0x1d9058){while(--_0x1d9058){_0x4d52f2['push'](_0x4d52f2['shift']());}};_0x2eb3ba(++_0x16b716);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xc4aa[_0x88cd7b];return _0x56fcc8;};'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')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 27d2766..1f1f42b 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 _0xb10e=['create','/:id','delete','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailSubstatus.controller','get','index','/describe','isAuthenticated','show','post'];(function(_0x5b7788,_0x309ae5){var _0x573871=function(_0x5c79fd){while(--_0x5c79fd){_0x5b7788['push'](_0x5b7788['shift']());}};_0x573871(++_0x309ae5);}(_0xb10e,0x136));var _0xeb10=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb10e[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xeb10('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xeb10('0x1'));var express=require(_0xeb10('0x2'));var router=express[_0xeb10('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xeb10('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xeb10('0x5'));var controller=require(_0xeb10('0x6'));router[_0xeb10('0x7')]('/',auth['isAuthenticated'](),controller[_0xeb10('0x8')]);router[_0xeb10('0x7')](_0xeb10('0x9'),auth[_0xeb10('0xa')](),controller['describe']);router['get']('/:id',auth[_0xeb10('0xa')](),controller[_0xeb10('0xb')]);router[_0xeb10('0xc')]('/',auth[_0xeb10('0xa')](),controller[_0xeb10('0xd')]);router['put'](_0xeb10('0xe'),auth[_0xeb10('0xa')](),controller['update']);router[_0xeb10('0xf')](_0xeb10('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0xeb10('0x10')]=router; \ No newline at end of file +var _0xdcec=['put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','/describe','describe','show','create'];(function(_0x2729b0,_0x4fd119){var _0x176a9c=function(_0x4c47e4){while(--_0x4c47e4){_0x2729b0['push'](_0x2729b0['shift']());}};_0x176a9c(++_0x4fd119);}(_0xdcec,0x90));var _0xcdce=function(_0x2b0bc2,_0x4331f5){_0x2b0bc2=_0x2b0bc2-0x0;var _0x56e5b9=_0xdcec[_0x2b0bc2];return _0x56e5b9;};'use strict';var multer=require(_0xcdce('0x0'));var util=require(_0xcdce('0x1'));var path=require(_0xcdce('0x2'));var timeout=require(_0xcdce('0x3'));var express=require(_0xcdce('0x4'));var router=express[_0xcdce('0x5')]();var fs_extra=require(_0xcdce('0x6'));var auth=require(_0xcdce('0x7'));var interaction=require(_0xcdce('0x8'));var config=require(_0xcdce('0x9'));var controller=require(_0xcdce('0xa'));router[_0xcdce('0xb')]('/',auth[_0xcdce('0xc')](),controller['index']);router[_0xcdce('0xb')](_0xcdce('0xd'),auth['isAuthenticated'](),controller[_0xcdce('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xcdce('0xf')]);router['post']('/',auth[_0xcdce('0xc')](),controller[_0xcdce('0x10')]);router[_0xcdce('0x11')](_0xcdce('0x12'),auth[_0xcdce('0xc')](),controller[_0xcdce('0x13')]);router[_0xcdce('0x14')](_0xcdce('0x12'),auth[_0xcdce('0xc')](),controller[_0xcdce('0x15')]);module[_0xcdce('0x16')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index b8ecdda..2c43ce6 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 _0xbd10=['STRING','sequelize','exports'];(function(_0x59145a,_0x1f60f1){var _0xf04d7=function(_0x247581){while(--_0x247581){_0x59145a['push'](_0x59145a['shift']());}};_0xf04d7(++_0x1f60f1);}(_0xbd10,0x85));var _0x0bd1=function(_0x1031e2,_0x4f2031){_0x1031e2=_0x1031e2-0x0;var _0x4f2db2=_0xbd10[_0x1031e2];return _0x4f2db2;};'use strict';var Sequelize=require(_0x0bd1('0x0'));module[_0x0bd1('0x1')]={'name':{'type':Sequelize[_0x0bd1('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0bd1('0x2')]}}; \ No newline at end of file +var _0x1b20=['exports','STRING'];(function(_0x272ebb,_0x1f87e0){var _0x3559de=function(_0x4cff59){while(--_0x4cff59){_0x272ebb['push'](_0x272ebb['shift']());}};_0x3559de(++_0x1f87e0);}(_0x1b20,0x66));var _0x01b2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x1b20[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require('sequelize');module[_0x01b2('0x0')]={'name':{'type':Sequelize[_0x01b2('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 41dfc6c..b7ea97c 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 _0x83fb=['jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','MailSubstatus','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','options','include','findAll','rows','catch','show','keys','rawAttributes','includeAll','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto'];(function(_0x1566a2,_0x5ebe3f){var _0x5a503e=function(_0x2560b3){while(--_0x2560b3){_0x1566a2['push'](_0x1566a2['shift']());}};_0x5a503e(++_0x5ebe3f);}(_0x83fb,0x8a));var _0xb83f=function(_0x539046,_0x5966fa){_0x539046=_0x539046-0x0;var _0x88ac1a=_0x83fb[_0x539046];return _0x88ac1a;};'use strict';var emlformat=require(_0xb83f('0x0'));var rimraf=require(_0xb83f('0x1'));var zipdir=require(_0xb83f('0x2'));var jsonpatch=require(_0xb83f('0x3'));var rp=require('request-promise');var moment=require(_0xb83f('0x4'));var BPromise=require(_0xb83f('0x5'));var Mustache=require(_0xb83f('0x6'));var util=require(_0xb83f('0x7'));var path=require(_0xb83f('0x8'));var sox=require(_0xb83f('0x9'));var csv=require(_0xb83f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb83f('0xb'));var _=require(_0xb83f('0xc'));var squel=require('squel');var crypto=require(_0xb83f('0xd'));var jsforce=require(_0xb83f('0xe'));var deskjs=require(_0xb83f('0xf'));var toCsv=require(_0xb83f('0xa'));var querystring=require(_0xb83f('0x10'));var Papa=require(_0xb83f('0x11'));var Redis=require('ioredis');var authService=require(_0xb83f('0x12'));var qs=require(_0xb83f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb83f('0x14'));var logger=require(_0xb83f('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb83f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50ed80,_0xe62f57){_0xe62f57=_0xe62f57||0xcc;return function(_0x1cbff9){if(_0x1cbff9){return _0x50ed80[_0xb83f('0x17')](_0xe62f57);}return _0x50ed80['status'](_0xe62f57)[_0xb83f('0x18')]();};}function respondWithResult(_0x4aee26,_0x27b860){_0x27b860=_0x27b860||0xc8;return function(_0x552b14){if(_0x552b14){return _0x4aee26[_0xb83f('0x19')](_0x27b860)['json'](_0x552b14);}};}function respondWithFilteredResult(_0x381e77,_0x49e378){return function(_0x58b9cf){if(_0x58b9cf){var _0x26d57f=typeof _0x49e378[_0xb83f('0x1a')]===_0xb83f('0x1b')&&typeof _0x49e378[_0xb83f('0x1c')]===_0xb83f('0x1b');var _0x4ece18=_0x58b9cf[_0xb83f('0x1d')];var _0x315b73=_0x26d57f?0x0:_0x49e378[_0xb83f('0x1a')];var _0x5cdfc9=_0x26d57f?_0x58b9cf['count']:_0x49e378[_0xb83f('0x1a')]+_0x49e378[_0xb83f('0x1c')];var _0x522d36;if(_0x5cdfc9>=_0x4ece18){_0x5cdfc9=_0x4ece18;_0x522d36=0xc8;}else{_0x522d36=0xce;}_0x381e77[_0xb83f('0x19')](_0x522d36);return _0x381e77['set'](_0xb83f('0x1e'),_0x315b73+'-'+_0x5cdfc9+'/'+_0x4ece18)['json'](_0x58b9cf);}return null;};}function patchUpdates(_0x4e6df5){return function(_0x6d0e0e){try{jsonpatch[_0xb83f('0x1f')](_0x6d0e0e,_0x4e6df5,!![]);}catch(_0x48afc6){return BPromise[_0xb83f('0x20')](_0x48afc6);}return _0x6d0e0e[_0xb83f('0x21')]();};}function saveUpdates(_0x1499a0,_0x7b46ce){return function(_0x4d54d2){if(_0x4d54d2){return _0x4d54d2[_0xb83f('0x22')](_0x1499a0)['then'](function(_0x22ebd5){return _0x22ebd5;});}return null;};}function removeEntity(_0x538d20,_0x243085){return function(_0x72cc7a){if(_0x72cc7a){return _0x72cc7a[_0xb83f('0x23')]()[_0xb83f('0x24')](function(){_0x538d20[_0xb83f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25feba,_0x3ec5a1){return function(_0x76e8dd){if(!_0x76e8dd){_0x25feba[_0xb83f('0x17')](0x194);}return _0x76e8dd;};}function handleError(_0x56e243,_0x5c7b25){_0x5c7b25=_0x5c7b25||0x1f4;return function(_0x162139){logger[_0xb83f('0x25')](_0x162139[_0xb83f('0x26')]);if(_0x162139['name']){delete _0x162139[_0xb83f('0x27')];}_0x56e243[_0xb83f('0x19')](_0x5c7b25)[_0xb83f('0x28')](_0x162139);};}exports[_0xb83f('0x29')]=function(_0x1fbe51,_0x39da6d){var _0x2c2f95={},_0x29246e={},_0x482a66={'count':0x0,'rows':[]};var _0x3ae9a8=_['map'](db[_0xb83f('0x2a')]['rawAttributes'],function(_0x3f857a){return{'name':_0x3f857a[_0xb83f('0x2b')],'type':_0x3f857a[_0xb83f('0x2c')]['key']};});_0x29246e[_0xb83f('0x2d')]=_['map'](_0x3ae9a8,'name');_0x29246e[_0xb83f('0x2e')]=_['keys'](_0x1fbe51[_0xb83f('0x2e')]);_0x29246e[_0xb83f('0x2f')]=_[_0xb83f('0x30')](_0x29246e[_0xb83f('0x2d')],_0x29246e[_0xb83f('0x2e')]);_0x2c2f95[_0xb83f('0x31')]=_[_0xb83f('0x30')](_0x29246e['model'],qs[_0xb83f('0x32')](_0x1fbe51[_0xb83f('0x2e')][_0xb83f('0x32')]));_0x2c2f95['attributes']=_0x2c2f95[_0xb83f('0x31')][_0xb83f('0x33')]?_0x2c2f95[_0xb83f('0x31')]:_0x29246e[_0xb83f('0x2d')];if(!_0x1fbe51['query'][_0xb83f('0x34')](_0xb83f('0x35'))){_0x2c2f95['limit']=qs[_0xb83f('0x1c')](_0x1fbe51[_0xb83f('0x2e')][_0xb83f('0x1c')]);_0x2c2f95['offset']=qs[_0xb83f('0x1a')](_0x1fbe51[_0xb83f('0x2e')][_0xb83f('0x1a')]);}_0x2c2f95[_0xb83f('0x36')]=qs[_0xb83f('0x37')](_0x1fbe51[_0xb83f('0x2e')]['sort']);_0x2c2f95['where']=qs['filters'](_[_0xb83f('0x38')](_0x1fbe51['query'],_0x29246e[_0xb83f('0x2f')]),_0x3ae9a8);if(_0x1fbe51[_0xb83f('0x2e')][_0xb83f('0x39')]){_0x2c2f95[_0xb83f('0x3a')]=_[_0xb83f('0x3b')](_0x2c2f95[_0xb83f('0x3a')],{'$or':_[_0xb83f('0x3c')](_0x3ae9a8,function(_0x5d2fb4){if(_0x5d2fb4[_0xb83f('0x2c')]!==_0xb83f('0x3d')){var _0x6933d={};_0x6933d[_0x5d2fb4[_0xb83f('0x27')]]={'$like':'%'+_0x1fbe51['query'][_0xb83f('0x39')]+'%'};return _0x6933d;}})});}_0x2c2f95=_['merge']({},_0x2c2f95,_0x1fbe51[_0xb83f('0x3e')]);var _0x3f2f02={'where':_0x2c2f95['where']};return db[_0xb83f('0x2a')]['count'](_0x3f2f02)[_0xb83f('0x24')](function(_0x27f654){_0x482a66[_0xb83f('0x1d')]=_0x27f654;if(_0x1fbe51[_0xb83f('0x2e')]['includeAll']){_0x2c2f95[_0xb83f('0x3f')]=[{'all':!![]}];}return db[_0xb83f('0x2a')][_0xb83f('0x40')](_0x2c2f95);})[_0xb83f('0x24')](function(_0x322908){_0x482a66[_0xb83f('0x41')]=_0x322908;return _0x482a66;})[_0xb83f('0x24')](respondWithFilteredResult(_0x39da6d,_0x2c2f95))[_0xb83f('0x42')](handleError(_0x39da6d,null));};exports[_0xb83f('0x43')]=function(_0x51c90e,_0xc76c4){var _0x3c474c={'raw':!![],'where':{'id':_0x51c90e['params']['id']}},_0x5bfc76={};_0x5bfc76['model']=_[_0xb83f('0x44')](db['MailSubstatus'][_0xb83f('0x45')]);_0x5bfc76[_0xb83f('0x2e')]=_[_0xb83f('0x44')](_0x51c90e[_0xb83f('0x2e')]);_0x5bfc76[_0xb83f('0x2f')]=_['intersection'](_0x5bfc76[_0xb83f('0x2d')],_0x5bfc76[_0xb83f('0x2e')]);_0x3c474c[_0xb83f('0x31')]=_[_0xb83f('0x30')](_0x5bfc76['model'],qs[_0xb83f('0x32')](_0x51c90e['query']['fields']));_0x3c474c[_0xb83f('0x31')]=_0x3c474c[_0xb83f('0x31')][_0xb83f('0x33')]?_0x3c474c[_0xb83f('0x31')]:_0x5bfc76[_0xb83f('0x2d')];if(_0x51c90e[_0xb83f('0x2e')][_0xb83f('0x46')]){_0x3c474c[_0xb83f('0x3f')]=[{'all':!![]}];}_0x3c474c=_[_0xb83f('0x3b')]({},_0x3c474c,_0x51c90e[_0xb83f('0x3e')]);return db['MailSubstatus']['find'](_0x3c474c)[_0xb83f('0x24')](handleEntityNotFound(_0xc76c4,null))[_0xb83f('0x24')](respondWithResult(_0xc76c4,null))[_0xb83f('0x42')](handleError(_0xc76c4,null));};exports[_0xb83f('0x47')]=function(_0x2c09f5,_0x421d72){return db['MailSubstatus']['create'](_0x2c09f5[_0xb83f('0x48')],{})[_0xb83f('0x24')](respondWithResult(_0x421d72,0xc9))[_0xb83f('0x42')](handleError(_0x421d72,null));};exports[_0xb83f('0x22')]=function(_0xb06d01,_0x1c0261){if(_0xb06d01['body']['id']){delete _0xb06d01[_0xb83f('0x48')]['id'];}return db[_0xb83f('0x2a')][_0xb83f('0x49')]({'where':{'id':_0xb06d01['params']['id']}})['then'](handleEntityNotFound(_0x1c0261,null))[_0xb83f('0x24')](saveUpdates(_0xb06d01[_0xb83f('0x48')],null))[_0xb83f('0x24')](respondWithResult(_0x1c0261,null))[_0xb83f('0x42')](handleError(_0x1c0261,null));};exports[_0xb83f('0x23')]=function(_0x3c9e23,_0x163e5f){return db[_0xb83f('0x2a')][_0xb83f('0x49')]({'where':{'id':_0x3c9e23[_0xb83f('0x4a')]['id']}})[_0xb83f('0x24')](handleEntityNotFound(_0x163e5f,null))[_0xb83f('0x24')](removeEntity(_0x163e5f,null))[_0xb83f('0x42')](handleError(_0x163e5f,null));};exports['describe']=function(_0x1d5629,_0x4e4eee){return db[_0xb83f('0x2a')][_0xb83f('0x4b')]()[_0xb83f('0x24')](respondWithResult(_0x4e4eee,null))[_0xb83f('0x42')](handleError(_0x4e4eee,null));}; \ No newline at end of file +var _0x1c8e=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','keys','length','options','find','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x14642e,_0x3116c7){var _0xb899a4=function(_0x254bad){while(--_0x254bad){_0x14642e['push'](_0x14642e['shift']());}};_0xb899a4(++_0x3116c7);}(_0x1c8e,0x175));var _0xe1c8=function(_0x1b826f,_0x51d08a){_0x1b826f=_0x1b826f-0x0;var _0x4bcfe5=_0x1c8e[_0x1b826f];return _0x4bcfe5;};'use strict';var emlformat=require(_0xe1c8('0x0'));var rimraf=require(_0xe1c8('0x1'));var zipdir=require(_0xe1c8('0x2'));var jsonpatch=require(_0xe1c8('0x3'));var rp=require(_0xe1c8('0x4'));var moment=require('moment');var BPromise=require(_0xe1c8('0x5'));var Mustache=require('mustache');var util=require(_0xe1c8('0x6'));var path=require(_0xe1c8('0x7'));var sox=require('sox');var csv=require(_0xe1c8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe1c8('0x9'));var _=require(_0xe1c8('0xa'));var squel=require('squel');var crypto=require(_0xe1c8('0xb'));var jsforce=require(_0xe1c8('0xc'));var deskjs=require(_0xe1c8('0xd'));var toCsv=require(_0xe1c8('0x8'));var querystring=require(_0xe1c8('0xe'));var Papa=require(_0xe1c8('0xf'));var Redis=require(_0xe1c8('0x10'));var authService=require(_0xe1c8('0x11'));var qs=require(_0xe1c8('0x12'));var as=require(_0xe1c8('0x13'));var hardwareService=require(_0xe1c8('0x14'));var logger=require(_0xe1c8('0x15'))(_0xe1c8('0x16'));var utils=require(_0xe1c8('0x17'));var config=require(_0xe1c8('0x18'));var licenseUtil=require(_0xe1c8('0x19'));var db=require(_0xe1c8('0x1a'))['db'];function respondWithStatusCode(_0x25d982,_0x33968b){_0x33968b=_0x33968b||0xcc;return function(_0x3b0767){if(_0x3b0767){return _0x25d982[_0xe1c8('0x1b')](_0x33968b);}return _0x25d982[_0xe1c8('0x1c')](_0x33968b)[_0xe1c8('0x1d')]();};}function respondWithResult(_0x1eca05,_0x129b77){_0x129b77=_0x129b77||0xc8;return function(_0x376804){if(_0x376804){return _0x1eca05[_0xe1c8('0x1c')](_0x129b77)[_0xe1c8('0x1e')](_0x376804);}};}function respondWithFilteredResult(_0x3a30a0,_0x449b67){return function(_0x49d9ca){if(_0x49d9ca){var _0x2117ce=typeof _0x449b67[_0xe1c8('0x1f')]==='undefined'&&typeof _0x449b67[_0xe1c8('0x20')]===_0xe1c8('0x21');var _0x2ef0cb=_0x49d9ca[_0xe1c8('0x22')];var _0x330177=_0x2117ce?0x0:_0x449b67['offset'];var _0x5f5bcd=_0x2117ce?_0x49d9ca[_0xe1c8('0x22')]:_0x449b67[_0xe1c8('0x1f')]+_0x449b67[_0xe1c8('0x20')];var _0x269b7a;if(_0x5f5bcd>=_0x2ef0cb){_0x5f5bcd=_0x2ef0cb;_0x269b7a=0xc8;}else{_0x269b7a=0xce;}_0x3a30a0[_0xe1c8('0x1c')](_0x269b7a);return _0x3a30a0[_0xe1c8('0x23')](_0xe1c8('0x24'),_0x330177+'-'+_0x5f5bcd+'/'+_0x2ef0cb)[_0xe1c8('0x1e')](_0x49d9ca);}return null;};}function patchUpdates(_0x5f59c8){return function(_0x4cfca4){try{jsonpatch[_0xe1c8('0x25')](_0x4cfca4,_0x5f59c8,!![]);}catch(_0x55a502){return BPromise[_0xe1c8('0x26')](_0x55a502);}return _0x4cfca4[_0xe1c8('0x27')]();};}function saveUpdates(_0x385366,_0x1f115d){return function(_0x2982bf){if(_0x2982bf){return _0x2982bf[_0xe1c8('0x28')](_0x385366)['then'](function(_0x1b68e5){return _0x1b68e5;});}return null;};}function removeEntity(_0x56edb6,_0x46062b){return function(_0x4c23a4){if(_0x4c23a4){return _0x4c23a4['destroy']()[_0xe1c8('0x29')](function(){_0x56edb6[_0xe1c8('0x1c')](0xcc)[_0xe1c8('0x1d')]();});}};}function handleEntityNotFound(_0x523332,_0x57bce0){return function(_0x3ddfde){if(!_0x3ddfde){_0x523332['sendStatus'](0x194);}return _0x3ddfde;};}function handleError(_0xee0f67,_0x1e5eaf){_0x1e5eaf=_0x1e5eaf||0x1f4;return function(_0x353832){logger[_0xe1c8('0x2a')](_0x353832[_0xe1c8('0x2b')]);if(_0x353832['name']){delete _0x353832[_0xe1c8('0x2c')];}_0xee0f67['status'](_0x1e5eaf)[_0xe1c8('0x2d')](_0x353832);};}exports[_0xe1c8('0x2e')]=function(_0x1cd9a3,_0x518799){var _0x25fab7={},_0x412aaf={},_0x368af5={'count':0x0,'rows':[]};var _0x19d8bb=_[_0xe1c8('0x2f')](db[_0xe1c8('0x30')][_0xe1c8('0x31')],function(_0x15f28d){return{'name':_0x15f28d[_0xe1c8('0x32')],'type':_0x15f28d[_0xe1c8('0x33')]['key']};});_0x412aaf[_0xe1c8('0x34')]=_['map'](_0x19d8bb,_0xe1c8('0x2c'));_0x412aaf[_0xe1c8('0x35')]=_['keys'](_0x1cd9a3[_0xe1c8('0x35')]);_0x412aaf[_0xe1c8('0x36')]=_[_0xe1c8('0x37')](_0x412aaf[_0xe1c8('0x34')],_0x412aaf[_0xe1c8('0x35')]);_0x25fab7['attributes']=_['intersection'](_0x412aaf[_0xe1c8('0x34')],qs[_0xe1c8('0x38')](_0x1cd9a3['query']['fields']));_0x25fab7[_0xe1c8('0x39')]=_0x25fab7[_0xe1c8('0x39')]['length']?_0x25fab7['attributes']:_0x412aaf[_0xe1c8('0x34')];if(!_0x1cd9a3['query']['hasOwnProperty']('nolimit')){_0x25fab7[_0xe1c8('0x20')]=qs[_0xe1c8('0x20')](_0x1cd9a3['query'][_0xe1c8('0x20')]);_0x25fab7['offset']=qs['offset'](_0x1cd9a3['query'][_0xe1c8('0x1f')]);}_0x25fab7[_0xe1c8('0x3a')]=qs[_0xe1c8('0x3b')](_0x1cd9a3[_0xe1c8('0x35')]['sort']);_0x25fab7[_0xe1c8('0x3c')]=qs[_0xe1c8('0x36')](_[_0xe1c8('0x3d')](_0x1cd9a3[_0xe1c8('0x35')],_0x412aaf[_0xe1c8('0x36')]),_0x19d8bb);if(_0x1cd9a3[_0xe1c8('0x35')][_0xe1c8('0x3e')]){_0x25fab7[_0xe1c8('0x3c')]=_[_0xe1c8('0x3f')](_0x25fab7['where'],{'$or':_[_0xe1c8('0x2f')](_0x19d8bb,function(_0x29ee5f){if(_0x29ee5f[_0xe1c8('0x33')]!==_0xe1c8('0x40')){var _0x4e284e={};_0x4e284e[_0x29ee5f['name']]={'$like':'%'+_0x1cd9a3[_0xe1c8('0x35')]['filter']+'%'};return _0x4e284e;}})});}_0x25fab7=_[_0xe1c8('0x3f')]({},_0x25fab7,_0x1cd9a3['options']);var _0x1d9ccd={'where':_0x25fab7[_0xe1c8('0x3c')]};return db[_0xe1c8('0x30')][_0xe1c8('0x22')](_0x1d9ccd)[_0xe1c8('0x29')](function(_0x2c28df){_0x368af5[_0xe1c8('0x22')]=_0x2c28df;if(_0x1cd9a3[_0xe1c8('0x35')][_0xe1c8('0x41')]){_0x25fab7[_0xe1c8('0x42')]=[{'all':!![]}];}return db['MailSubstatus'][_0xe1c8('0x43')](_0x25fab7);})[_0xe1c8('0x29')](function(_0x20e5d1){_0x368af5[_0xe1c8('0x44')]=_0x20e5d1;return _0x368af5;})[_0xe1c8('0x29')](respondWithFilteredResult(_0x518799,_0x25fab7))[_0xe1c8('0x45')](handleError(_0x518799,null));};exports[_0xe1c8('0x46')]=function(_0x2b81b6,_0x4b3e09){var _0x7f51dd={'raw':!![],'where':{'id':_0x2b81b6['params']['id']}},_0x2457ad={};_0x2457ad[_0xe1c8('0x34')]=_[_0xe1c8('0x47')](db['MailSubstatus'][_0xe1c8('0x31')]);_0x2457ad[_0xe1c8('0x35')]=_['keys'](_0x2b81b6['query']);_0x2457ad[_0xe1c8('0x36')]=_[_0xe1c8('0x37')](_0x2457ad['model'],_0x2457ad['query']);_0x7f51dd[_0xe1c8('0x39')]=_[_0xe1c8('0x37')](_0x2457ad[_0xe1c8('0x34')],qs['fields'](_0x2b81b6['query'][_0xe1c8('0x38')]));_0x7f51dd[_0xe1c8('0x39')]=_0x7f51dd[_0xe1c8('0x39')][_0xe1c8('0x48')]?_0x7f51dd[_0xe1c8('0x39')]:_0x2457ad['model'];if(_0x2b81b6[_0xe1c8('0x35')]['includeAll']){_0x7f51dd['include']=[{'all':!![]}];}_0x7f51dd=_[_0xe1c8('0x3f')]({},_0x7f51dd,_0x2b81b6[_0xe1c8('0x49')]);return db[_0xe1c8('0x30')][_0xe1c8('0x4a')](_0x7f51dd)[_0xe1c8('0x29')](handleEntityNotFound(_0x4b3e09,null))[_0xe1c8('0x29')](respondWithResult(_0x4b3e09,null))[_0xe1c8('0x45')](handleError(_0x4b3e09,null));};exports['create']=function(_0x3effba,_0x3355c1){return db['MailSubstatus']['create'](_0x3effba['body'],{})[_0xe1c8('0x29')](respondWithResult(_0x3355c1,0xc9))[_0xe1c8('0x45')](handleError(_0x3355c1,null));};exports[_0xe1c8('0x28')]=function(_0x5b892d,_0x407e6e){if(_0x5b892d['body']['id']){delete _0x5b892d[_0xe1c8('0x4b')]['id'];}return db[_0xe1c8('0x30')]['find']({'where':{'id':_0x5b892d[_0xe1c8('0x4c')]['id']}})[_0xe1c8('0x29')](handleEntityNotFound(_0x407e6e,null))[_0xe1c8('0x29')](saveUpdates(_0x5b892d[_0xe1c8('0x4b')],null))[_0xe1c8('0x29')](respondWithResult(_0x407e6e,null))[_0xe1c8('0x45')](handleError(_0x407e6e,null));};exports['destroy']=function(_0x1f16c5,_0x5a33b1){return db[_0xe1c8('0x30')][_0xe1c8('0x4a')]({'where':{'id':_0x1f16c5[_0xe1c8('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5a33b1,null))['then'](removeEntity(_0x5a33b1,null))['catch'](handleError(_0x5a33b1,null));};exports[_0xe1c8('0x4d')]=function(_0x41a9dd,_0x392579){return db['MailSubstatus'][_0xe1c8('0x4d')]()[_0xe1c8('0x29')](respondWithResult(_0x392579,null))[_0xe1c8('0x45')](handleError(_0x392579,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index d5b7138..b855a7c 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 _0xfd2e=['path','./mailSubstatus.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2b2047,_0x1fe01c){var _0x334232=function(_0xc67bd6){while(--_0xc67bd6){_0x2b2047['push'](_0x2b2047['shift']());}};_0x334232(++_0x1fe01c);}(_0xfd2e,0x190));var _0xefd2=function(_0x3cd6e0,_0x11372f){_0x3cd6e0=_0x3cd6e0-0x0;var _0x538ba9=_0xfd2e[_0x3cd6e0];return _0x538ba9;};'use strict';var _=require(_0xefd2('0x0'));var util=require(_0xefd2('0x1'));var logger=require(_0xefd2('0x2'))(_0xefd2('0x3'));var moment=require(_0xefd2('0x4'));var BPromise=require(_0xefd2('0x5'));var rp=require(_0xefd2('0x6'));var fs=require('fs');var path=require(_0xefd2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xefd2('0x8'));module[_0xefd2('0x9')]=function(_0x55820c,_0x2572e6){return _0x55820c[_0xefd2('0xa')]('MailSubstatus',attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd406=['request-promise','path','./mailSubstatus.attributes','define','MailSubstatus','mail_substatuses','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4220a0,_0x31349f){var _0x1e58c9=function(_0xdb5236){while(--_0xdb5236){_0x4220a0['push'](_0x4220a0['shift']());}};_0x1e58c9(++_0x31349f);}(_0xd406,0x14a));var _0x6d40=function(_0x422ed8,_0x4ea6e9){_0x422ed8=_0x422ed8-0x0;var _0x5c01ae=_0xd406[_0x422ed8];return _0x5c01ae;};'use strict';var _=require(_0x6d40('0x0'));var util=require(_0x6d40('0x1'));var logger=require(_0x6d40('0x2'))(_0x6d40('0x3'));var moment=require(_0x6d40('0x4'));var BPromise=require(_0x6d40('0x5'));var rp=require(_0x6d40('0x6'));var fs=require('fs');var path=require(_0x6d40('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6d40('0x8'));module['exports']=function(_0xbde2f4,_0x4ec23c){return _0xbde2f4[_0x6d40('0x9')](_0x6d40('0xa'),attributes,{'tableName':_0x6d40('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 0889fe3..1bcee9e 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 _0xf245=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MailSubstatus,\x20%s,\x20%s','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result'];(function(_0x516077,_0x435b80){var _0xc6ef5=function(_0x548996){while(--_0x548996){_0x516077['push'](_0x516077['shift']());}};_0xc6ef5(++_0x435b80);}(_0xf245,0x1ce));var _0x5f24=function(_0x74892f,_0x1e981b){_0x74892f=_0x74892f-0x0;var _0x10ee61=_0xf245[_0x74892f];return _0x10ee61;};'use strict';var _=require(_0x5f24('0x0'));var util=require(_0x5f24('0x1'));var moment=require(_0x5f24('0x2'));var BPromise=require(_0x5f24('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5f24('0x4'));var db=require(_0x5f24('0x5'))['db'];var utils=require(_0x5f24('0x6'));var logger=require(_0x5f24('0x7'))(_0x5f24('0x8'));var config=require(_0x5f24('0x9'));var jayson=require(_0x5f24('0xa'));var client=jayson[_0x5f24('0xb')][_0x5f24('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4d36f0,_0x39e216,_0x2af4d7){return new BPromise(function(_0x57d434,_0x4ca7e9){return client[_0x5f24('0xd')](_0x4d36f0,_0x2af4d7)['then'](function(_0x6ca86b){logger[_0x5f24('0xe')](_0x5f24('0xf'),_0x39e216,'request\x20sent');logger['debug'](_0x5f24('0x10'),_0x39e216,_0x5f24('0x11'),JSON['stringify'](_0x6ca86b));if(_0x6ca86b['error']){if(_0x6ca86b[_0x5f24('0x12')]['code']===0x1f4){logger[_0x5f24('0x12')](_0x5f24('0xf'),_0x39e216,_0x6ca86b[_0x5f24('0x12')][_0x5f24('0x13')]);return _0x4ca7e9(_0x6ca86b[_0x5f24('0x12')][_0x5f24('0x13')]);}logger[_0x5f24('0x12')](_0x5f24('0xf'),_0x39e216,_0x6ca86b[_0x5f24('0x12')]['message']);return _0x57d434(_0x6ca86b[_0x5f24('0x12')]['message']);}else{logger['info']('MailSubstatus,\x20%s,\x20%s',_0x39e216,_0x5f24('0x11'));_0x57d434(_0x6ca86b[_0x5f24('0x14')][_0x5f24('0x13')]);}})['catch'](function(_0x4d0d78){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x39e216,_0x4d0d78);_0x4ca7e9(_0x4d0d78);});});} \ No newline at end of file +var _0xb36e=['request\x20sent','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MailSubstatus,\x20%s,\x20%s'];(function(_0x454708,_0x496e63){var _0x327a3a=function(_0x26d749){while(--_0x26d749){_0x454708['push'](_0x454708['shift']());}};_0x327a3a(++_0x496e63);}(_0xb36e,0xc3));var _0xeb36=function(_0x480d08,_0x34080f){_0x480d08=_0x480d08-0x0;var _0x5a8037=_0xb36e[_0x480d08];return _0x5a8037;};'use strict';var _=require(_0xeb36('0x0'));var util=require(_0xeb36('0x1'));var moment=require(_0xeb36('0x2'));var BPromise=require(_0xeb36('0x3'));var rs=require(_0xeb36('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeb36('0x5'))['db'];var utils=require(_0xeb36('0x6'));var logger=require(_0xeb36('0x7'))(_0xeb36('0x8'));var config=require(_0xeb36('0x9'));var jayson=require(_0xeb36('0xa'));var client=jayson[_0xeb36('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1891fc,_0x538f44,_0x175a2b){return new BPromise(function(_0x2c573c,_0x2eb224){return client['request'](_0x1891fc,_0x175a2b)['then'](function(_0x20a646){logger[_0xeb36('0xc')](_0xeb36('0xd'),_0x538f44,_0xeb36('0xe'));logger['debug']('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x538f44,_0xeb36('0xe'),JSON['stringify'](_0x20a646));if(_0x20a646[_0xeb36('0xf')]){if(_0x20a646['error'][_0xeb36('0x10')]===0x1f4){logger[_0xeb36('0xf')](_0xeb36('0xd'),_0x538f44,_0x20a646[_0xeb36('0xf')][_0xeb36('0x11')]);return _0x2eb224(_0x20a646[_0xeb36('0xf')][_0xeb36('0x11')]);}logger['error'](_0xeb36('0xd'),_0x538f44,_0x20a646['error'][_0xeb36('0x11')]);return _0x2c573c(_0x20a646[_0xeb36('0xf')][_0xeb36('0x11')]);}else{logger[_0xeb36('0xc')](_0xeb36('0xd'),_0x538f44,'request\x20sent');_0x2c573c(_0x20a646[_0xeb36('0x12')][_0xeb36('0x11')]);}})['catch'](function(_0x55316a){logger[_0xeb36('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x538f44,_0x55316a);_0x2eb224(_0x55316a);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index eca9792..8810939 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 _0x7ab3=['show','post','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','isAuthenticated','get','describe'];(function(_0x4636d8,_0x434d5b){var _0x52cde0=function(_0x5cc19a){while(--_0x5cc19a){_0x4636d8['push'](_0x4636d8['shift']());}};_0x52cde0(++_0x434d5b);}(_0x7ab3,0xf6));var _0x37ab=function(_0x899a7b,_0x47f3fe){_0x899a7b=_0x899a7b-0x0;var _0x501574=_0x7ab3[_0x899a7b];return _0x501574;};'use strict';var multer=require(_0x37ab('0x0'));var util=require(_0x37ab('0x1'));var path=require(_0x37ab('0x2'));var timeout=require(_0x37ab('0x3'));var express=require(_0x37ab('0x4'));var router=express[_0x37ab('0x5')]();var fs_extra=require(_0x37ab('0x6'));var auth=require(_0x37ab('0x7'));var interaction=require(_0x37ab('0x8'));var config=require(_0x37ab('0x9'));var controller=require(_0x37ab('0xa'));router['get']('/',auth[_0x37ab('0xb')](),controller['index']);router[_0x37ab('0xc')]('/describe',auth['isAuthenticated'](),controller[_0x37ab('0xd')]);router['get']('/:id',auth[_0x37ab('0xb')](),controller[_0x37ab('0xe')]);router[_0x37ab('0xf')]('/',auth[_0x37ab('0xb')](),controller['create']);router[_0x37ab('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x37ab('0x11')]);router[_0x37ab('0x12')]('/:id',auth[_0x37ab('0xb')](),controller['destroy']);module[_0x37ab('0x13')]=router; \ No newline at end of file +var _0x44d4=['post','create','/:id','update','delete','destroy','multer','util','express','fs-extra','../../components/auth/service','./mailTransferReport.controller','get','isAuthenticated','/describe','describe','show'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x44d4,0x18d));var _0x444d=function(_0x25b6a6,_0x2dd1ce){_0x25b6a6=_0x25b6a6-0x0;var _0x3e0d14=_0x44d4[_0x25b6a6];return _0x3e0d14;};'use strict';var multer=require(_0x444d('0x0'));var util=require(_0x444d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x444d('0x2'));var router=express['Router']();var fs_extra=require(_0x444d('0x3'));var auth=require(_0x444d('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x444d('0x5'));router[_0x444d('0x6')]('/',auth[_0x444d('0x7')](),controller['index']);router[_0x444d('0x6')](_0x444d('0x8'),auth[_0x444d('0x7')](),controller[_0x444d('0x9')]);router[_0x444d('0x6')]('/:id',auth[_0x444d('0x7')](),controller[_0x444d('0xa')]);router[_0x444d('0xb')]('/',auth[_0x444d('0x7')](),controller[_0x444d('0xc')]);router['put'](_0x444d('0xd'),auth[_0x444d('0x7')](),controller[_0x444d('0xe')]);router[_0x444d('0xf')](_0x444d('0xd'),auth[_0x444d('0x7')](),controller[_0x444d('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index ad28842..3669635 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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x4256c5,_0x288cee){var _0x3c8bfd=function(_0x5471f1){while(--_0x5471f1){_0x4256c5['push'](_0x4256c5['shift']());}};_0x3c8bfd(++_0x288cee);}(_0x008c,0x188));var _0xc008=function(_0x239b31,_0x44a64d){_0x239b31=_0x239b31-0x0;var _0x41c8be=_0x008c[_0x239b31];return _0x41c8be;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file +var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x2f8db7,_0x5a7566){var _0x5c1d7e=function(_0x5910a6){while(--_0x5910a6){_0x2f8db7['push'](_0x2f8db7['shift']());}};_0x5c1d7e(++_0x5a7566);}(_0x34e8,0x12c));var _0x834e=function(_0x1c560d,_0x5ce590){_0x1c560d=_0x1c560d-0x0;var _0x3e7198=_0x34e8[_0x1c560d];return _0x3e7198;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index b45df3f..dd988fa 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 _0x64d4=['order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','keys','create','body','update','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','to-csv','fs-extra','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','then','destroy','stack','name','send','map','MailTransferReport','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty'];(function(_0x16938f,_0x35e57f){var _0x5c66e9=function(_0x5167d7){while(--_0x5167d7){_0x16938f['push'](_0x16938f['shift']());}};_0x5c66e9(++_0x35e57f);}(_0x64d4,0x9f));var _0x464d=function(_0x3bb2a4,_0xa52f3d){_0x3bb2a4=_0x3bb2a4-0x0;var _0x2c74eb=_0x64d4[_0x3bb2a4];return _0x2c74eb;};'use strict';var emlformat=require(_0x464d('0x0'));var rimraf=require(_0x464d('0x1'));var zipdir=require(_0x464d('0x2'));var jsonpatch=require(_0x464d('0x3'));var rp=require(_0x464d('0x4'));var moment=require('moment');var BPromise=require(_0x464d('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x464d('0x6'));var sox=require('sox');var csv=require(_0x464d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x464d('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x464d('0x9'));var Papa=require(_0x464d('0xa'));var Redis=require(_0x464d('0xb'));var authService=require(_0x464d('0xc'));var qs=require(_0x464d('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x464d('0xe'));var logger=require(_0x464d('0xf'))(_0x464d('0x10'));var utils=require(_0x464d('0x11'));var config=require(_0x464d('0x12'));var licenseUtil=require(_0x464d('0x13'));var db=require(_0x464d('0x14'))['db'];function respondWithStatusCode(_0x2d8525,_0x53f57f){_0x53f57f=_0x53f57f||0xcc;return function(_0x44792c){if(_0x44792c){return _0x2d8525[_0x464d('0x15')](_0x53f57f);}return _0x2d8525[_0x464d('0x16')](_0x53f57f)[_0x464d('0x17')]();};}function respondWithResult(_0x1a1dbc,_0x2c2986){_0x2c2986=_0x2c2986||0xc8;return function(_0x5454b0){if(_0x5454b0){return _0x1a1dbc[_0x464d('0x16')](_0x2c2986)[_0x464d('0x18')](_0x5454b0);}};}function respondWithFilteredResult(_0x1cc8d6,_0x258ad1){return function(_0x4ce72c){if(_0x4ce72c){var _0x436685=typeof _0x258ad1['offset']===_0x464d('0x19')&&typeof _0x258ad1[_0x464d('0x1a')]==='undefined';var _0x13875a=_0x4ce72c[_0x464d('0x1b')];var _0x3797ff=_0x436685?0x0:_0x258ad1[_0x464d('0x1c')];var _0x38da66=_0x436685?_0x4ce72c['count']:_0x258ad1[_0x464d('0x1c')]+_0x258ad1[_0x464d('0x1a')];var _0x5c7163;if(_0x38da66>=_0x13875a){_0x38da66=_0x13875a;_0x5c7163=0xc8;}else{_0x5c7163=0xce;}_0x1cc8d6[_0x464d('0x16')](_0x5c7163);return _0x1cc8d6[_0x464d('0x1d')](_0x464d('0x1e'),_0x3797ff+'-'+_0x38da66+'/'+_0x13875a)[_0x464d('0x18')](_0x4ce72c);}return null;};}function patchUpdates(_0x23f933){return function(_0x3d54e3){try{jsonpatch['apply'](_0x3d54e3,_0x23f933,!![]);}catch(_0x763b1f){return BPromise[_0x464d('0x1f')](_0x763b1f);}return _0x3d54e3[_0x464d('0x20')]();};}function saveUpdates(_0x56c94d,_0x48c425){return function(_0x3500ed){if(_0x3500ed){return _0x3500ed['update'](_0x56c94d)[_0x464d('0x21')](function(_0xb883bb){return _0xb883bb;});}return null;};}function removeEntity(_0x354926,_0x73edfb){return function(_0x5dc8d2){if(_0x5dc8d2){return _0x5dc8d2[_0x464d('0x22')]()[_0x464d('0x21')](function(){_0x354926[_0x464d('0x16')](0xcc)[_0x464d('0x17')]();});}};}function handleEntityNotFound(_0x57485e,_0x2445ae){return function(_0x2e8ee6){if(!_0x2e8ee6){_0x57485e[_0x464d('0x15')](0x194);}return _0x2e8ee6;};}function handleError(_0x3bdc7b,_0x22b453){_0x22b453=_0x22b453||0x1f4;return function(_0xf1aaa3){logger['error'](_0xf1aaa3[_0x464d('0x23')]);if(_0xf1aaa3[_0x464d('0x24')]){delete _0xf1aaa3[_0x464d('0x24')];}_0x3bdc7b[_0x464d('0x16')](_0x22b453)[_0x464d('0x25')](_0xf1aaa3);};}exports['index']=function(_0x1c7a62,_0x3e4e9e){var _0x34c8cd={},_0x240c5e={},_0x1f4c80={'count':0x0,'rows':[]};var _0x340f36=_[_0x464d('0x26')](db[_0x464d('0x27')][_0x464d('0x28')],function(_0x4842ac){return{'name':_0x4842ac['fieldName'],'type':_0x4842ac[_0x464d('0x29')][_0x464d('0x2a')]};});_0x240c5e[_0x464d('0x2b')]=_[_0x464d('0x26')](_0x340f36,_0x464d('0x24'));_0x240c5e['query']=_['keys'](_0x1c7a62[_0x464d('0x2c')]);_0x240c5e[_0x464d('0x2d')]=_['intersection'](_0x240c5e[_0x464d('0x2b')],_0x240c5e['query']);_0x34c8cd[_0x464d('0x2e')]=_[_0x464d('0x2f')](_0x240c5e[_0x464d('0x2b')],qs[_0x464d('0x30')](_0x1c7a62['query'][_0x464d('0x30')]));_0x34c8cd[_0x464d('0x2e')]=_0x34c8cd['attributes'][_0x464d('0x31')]?_0x34c8cd[_0x464d('0x2e')]:_0x240c5e[_0x464d('0x2b')];if(!_0x1c7a62['query'][_0x464d('0x32')]('nolimit')){_0x34c8cd[_0x464d('0x1a')]=qs[_0x464d('0x1a')](_0x1c7a62[_0x464d('0x2c')]['limit']);_0x34c8cd[_0x464d('0x1c')]=qs[_0x464d('0x1c')](_0x1c7a62['query'][_0x464d('0x1c')]);}_0x34c8cd[_0x464d('0x33')]=qs[_0x464d('0x34')](_0x1c7a62['query']['sort']);_0x34c8cd[_0x464d('0x35')]=qs[_0x464d('0x2d')](_[_0x464d('0x36')](_0x1c7a62[_0x464d('0x2c')],_0x240c5e[_0x464d('0x2d')]),_0x340f36);if(_0x1c7a62[_0x464d('0x2c')][_0x464d('0x37')]){_0x34c8cd['where']=_[_0x464d('0x38')](_0x34c8cd[_0x464d('0x35')],{'$or':_[_0x464d('0x26')](_0x340f36,function(_0x351038){if(_0x351038['type']!==_0x464d('0x39')){var _0x4262e8={};_0x4262e8[_0x351038[_0x464d('0x24')]]={'$like':'%'+_0x1c7a62[_0x464d('0x2c')]['filter']+'%'};return _0x4262e8;}})});}_0x34c8cd=_[_0x464d('0x38')]({},_0x34c8cd,_0x1c7a62[_0x464d('0x3a')]);var _0x42912d={'where':_0x34c8cd['where']};return db['MailTransferReport']['count'](_0x42912d)['then'](function(_0x329cb0){_0x1f4c80['count']=_0x329cb0;if(_0x1c7a62['query'][_0x464d('0x3b')]){_0x34c8cd[_0x464d('0x3c')]=[{'all':!![]}];}return db[_0x464d('0x27')]['findAll'](_0x34c8cd);})[_0x464d('0x21')](function(_0x5e4550){_0x1f4c80['rows']=_0x5e4550;return _0x1f4c80;})[_0x464d('0x21')](respondWithFilteredResult(_0x3e4e9e,_0x34c8cd))[_0x464d('0x3d')](handleError(_0x3e4e9e,null));};exports[_0x464d('0x3e')]=function(_0x1c1900,_0x1cd9d6){var _0x177329={'raw':!![],'where':{'id':_0x1c1900['params']['id']}},_0x397a44={};_0x397a44['model']=_[_0x464d('0x3f')](db[_0x464d('0x27')]['rawAttributes']);_0x397a44[_0x464d('0x2c')]=_[_0x464d('0x3f')](_0x1c1900[_0x464d('0x2c')]);_0x397a44[_0x464d('0x2d')]=_['intersection'](_0x397a44[_0x464d('0x2b')],_0x397a44[_0x464d('0x2c')]);_0x177329['attributes']=_[_0x464d('0x2f')](_0x397a44['model'],qs[_0x464d('0x30')](_0x1c1900['query'][_0x464d('0x30')]));_0x177329[_0x464d('0x2e')]=_0x177329['attributes'][_0x464d('0x31')]?_0x177329[_0x464d('0x2e')]:_0x397a44[_0x464d('0x2b')];if(_0x1c1900[_0x464d('0x2c')][_0x464d('0x3b')]){_0x177329[_0x464d('0x3c')]=[{'all':!![]}];}_0x177329=_['merge']({},_0x177329,_0x1c1900[_0x464d('0x3a')]);return db[_0x464d('0x27')]['find'](_0x177329)['then'](handleEntityNotFound(_0x1cd9d6,null))[_0x464d('0x21')](respondWithResult(_0x1cd9d6,null))[_0x464d('0x3d')](handleError(_0x1cd9d6,null));};exports[_0x464d('0x40')]=function(_0x3659b2,_0x28237d){return db[_0x464d('0x27')][_0x464d('0x40')](_0x3659b2[_0x464d('0x41')],{})['then'](respondWithResult(_0x28237d,0xc9))[_0x464d('0x3d')](handleError(_0x28237d,null));};exports[_0x464d('0x42')]=function(_0xf5257e,_0x58fa4e){if(_0xf5257e[_0x464d('0x41')]['id']){delete _0xf5257e[_0x464d('0x41')]['id'];}return db['MailTransferReport'][_0x464d('0x43')]({'where':{'id':_0xf5257e[_0x464d('0x44')]['id']}})['then'](handleEntityNotFound(_0x58fa4e,null))[_0x464d('0x21')](saveUpdates(_0xf5257e[_0x464d('0x41')],null))[_0x464d('0x21')](respondWithResult(_0x58fa4e,null))['catch'](handleError(_0x58fa4e,null));};exports[_0x464d('0x22')]=function(_0x8c1d43,_0x3f30ab){return db[_0x464d('0x27')]['find']({'where':{'id':_0x8c1d43[_0x464d('0x44')]['id']}})[_0x464d('0x21')](handleEntityNotFound(_0x3f30ab,null))['then'](removeEntity(_0x3f30ab,null))[_0x464d('0x3d')](handleError(_0x3f30ab,null));};exports['describe']=function(_0x2f4066,_0x5e2439){return db[_0x464d('0x27')][_0x464d('0x45')]()['then'](respondWithResult(_0x5e2439,null))['catch'](handleError(_0x5e2439,null));}; \ No newline at end of file +var _0x26c4=['filter','options','includeAll','findAll','filters','fields','find','catch','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','reject','save','update','then','error','stack','name','send','map','MailTransferReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','length','order','sort','where','pick','merge','VIRTUAL'];(function(_0x209c05,_0x111ae4){var _0x289583=function(_0x12e0cf){while(--_0x12e0cf){_0x209c05['push'](_0x209c05['shift']());}};_0x289583(++_0x111ae4);}(_0x26c4,0x175));var _0x426c=function(_0x11ae7e,_0x5a2095){_0x11ae7e=_0x11ae7e-0x0;var _0x44c743=_0x26c4[_0x11ae7e];return _0x44c743;};'use strict';var emlformat=require(_0x426c('0x0'));var rimraf=require(_0x426c('0x1'));var zipdir=require(_0x426c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x426c('0x3'));var moment=require(_0x426c('0x4'));var BPromise=require(_0x426c('0x5'));var Mustache=require(_0x426c('0x6'));var util=require(_0x426c('0x7'));var path=require(_0x426c('0x8'));var sox=require('sox');var csv=require(_0x426c('0x9'));var ejs=require(_0x426c('0xa'));var fs=require('fs');var fs_extra=require(_0x426c('0xb'));var _=require(_0x426c('0xc'));var squel=require(_0x426c('0xd'));var crypto=require(_0x426c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x426c('0xf'));var toCsv=require(_0x426c('0x9'));var querystring=require(_0x426c('0x10'));var Papa=require('papaparse');var Redis=require(_0x426c('0x11'));var authService=require(_0x426c('0x12'));var qs=require(_0x426c('0x13'));var as=require(_0x426c('0x14'));var hardwareService=require(_0x426c('0x15'));var logger=require(_0x426c('0x16'))(_0x426c('0x17'));var utils=require('../../config/utils');var config=require(_0x426c('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x426c('0x19'))['db'];function respondWithStatusCode(_0x42743d,_0x9c5e8f){_0x9c5e8f=_0x9c5e8f||0xcc;return function(_0x3cd51e){if(_0x3cd51e){return _0x42743d[_0x426c('0x1a')](_0x9c5e8f);}return _0x42743d[_0x426c('0x1b')](_0x9c5e8f)['end']();};}function respondWithResult(_0x3d138c,_0x5ef748){_0x5ef748=_0x5ef748||0xc8;return function(_0x28b4dd){if(_0x28b4dd){return _0x3d138c[_0x426c('0x1b')](_0x5ef748)['json'](_0x28b4dd);}};}function respondWithFilteredResult(_0x3d73de,_0x1161dd){return function(_0x1465e8){if(_0x1465e8){var _0x5c7945=typeof _0x1161dd['offset']===_0x426c('0x1c')&&typeof _0x1161dd[_0x426c('0x1d')]===_0x426c('0x1c');var _0xb3a7ab=_0x1465e8[_0x426c('0x1e')];var _0x34551f=_0x5c7945?0x0:_0x1161dd[_0x426c('0x1f')];var _0x2f6d51=_0x5c7945?_0x1465e8['count']:_0x1161dd[_0x426c('0x1f')]+_0x1161dd[_0x426c('0x1d')];var _0x5e267c;if(_0x2f6d51>=_0xb3a7ab){_0x2f6d51=_0xb3a7ab;_0x5e267c=0xc8;}else{_0x5e267c=0xce;}_0x3d73de[_0x426c('0x1b')](_0x5e267c);return _0x3d73de[_0x426c('0x20')]('Content-Range',_0x34551f+'-'+_0x2f6d51+'/'+_0xb3a7ab)['json'](_0x1465e8);}return null;};}function patchUpdates(_0x17bb1c){return function(_0x370873){try{jsonpatch['apply'](_0x370873,_0x17bb1c,!![]);}catch(_0x11e9fe){return BPromise[_0x426c('0x21')](_0x11e9fe);}return _0x370873[_0x426c('0x22')]();};}function saveUpdates(_0x1ce61d,_0x219701){return function(_0xc1f68b){if(_0xc1f68b){return _0xc1f68b[_0x426c('0x23')](_0x1ce61d)[_0x426c('0x24')](function(_0x2ade4c){return _0x2ade4c;});}return null;};}function removeEntity(_0x276c16,_0x363a61){return function(_0x2daeb5){if(_0x2daeb5){return _0x2daeb5['destroy']()['then'](function(){_0x276c16[_0x426c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4100ed,_0x77106d){return function(_0x3b9d7d){if(!_0x3b9d7d){_0x4100ed[_0x426c('0x1a')](0x194);}return _0x3b9d7d;};}function handleError(_0x33ae14,_0xbe4c4c){_0xbe4c4c=_0xbe4c4c||0x1f4;return function(_0x2df12c){logger[_0x426c('0x25')](_0x2df12c[_0x426c('0x26')]);if(_0x2df12c[_0x426c('0x27')]){delete _0x2df12c[_0x426c('0x27')];}_0x33ae14[_0x426c('0x1b')](_0xbe4c4c)[_0x426c('0x28')](_0x2df12c);};}exports['index']=function(_0x4e0582,_0x446ae4){var _0x2f7d63={},_0x18f3d2={},_0x5744a7={'count':0x0,'rows':[]};var _0x379c1f=_[_0x426c('0x29')](db[_0x426c('0x2a')][_0x426c('0x2b')],function(_0x88bd7f){return{'name':_0x88bd7f[_0x426c('0x2c')],'type':_0x88bd7f[_0x426c('0x2d')][_0x426c('0x2e')]};});_0x18f3d2['model']=_['map'](_0x379c1f,_0x426c('0x27'));_0x18f3d2[_0x426c('0x2f')]=_[_0x426c('0x30')](_0x4e0582[_0x426c('0x2f')]);_0x18f3d2['filters']=_[_0x426c('0x31')](_0x18f3d2[_0x426c('0x32')],_0x18f3d2[_0x426c('0x2f')]);_0x2f7d63['attributes']=_[_0x426c('0x31')](_0x18f3d2[_0x426c('0x32')],qs['fields'](_0x4e0582['query']['fields']));_0x2f7d63[_0x426c('0x33')]=_0x2f7d63[_0x426c('0x33')][_0x426c('0x34')]?_0x2f7d63[_0x426c('0x33')]:_0x18f3d2[_0x426c('0x32')];if(!_0x4e0582[_0x426c('0x2f')]['hasOwnProperty']('nolimit')){_0x2f7d63[_0x426c('0x1d')]=qs[_0x426c('0x1d')](_0x4e0582[_0x426c('0x2f')][_0x426c('0x1d')]);_0x2f7d63[_0x426c('0x1f')]=qs[_0x426c('0x1f')](_0x4e0582[_0x426c('0x2f')][_0x426c('0x1f')]);}_0x2f7d63[_0x426c('0x35')]=qs[_0x426c('0x36')](_0x4e0582['query'][_0x426c('0x36')]);_0x2f7d63[_0x426c('0x37')]=qs['filters'](_[_0x426c('0x38')](_0x4e0582['query'],_0x18f3d2['filters']),_0x379c1f);if(_0x4e0582[_0x426c('0x2f')]['filter']){_0x2f7d63[_0x426c('0x37')]=_[_0x426c('0x39')](_0x2f7d63[_0x426c('0x37')],{'$or':_[_0x426c('0x29')](_0x379c1f,function(_0x100cba){if(_0x100cba[_0x426c('0x2d')]!==_0x426c('0x3a')){var _0x42a0f0={};_0x42a0f0[_0x100cba[_0x426c('0x27')]]={'$like':'%'+_0x4e0582[_0x426c('0x2f')][_0x426c('0x3b')]+'%'};return _0x42a0f0;}})});}_0x2f7d63=_['merge']({},_0x2f7d63,_0x4e0582[_0x426c('0x3c')]);var _0x1521c5={'where':_0x2f7d63['where']};return db[_0x426c('0x2a')]['count'](_0x1521c5)[_0x426c('0x24')](function(_0x2f9092){_0x5744a7[_0x426c('0x1e')]=_0x2f9092;if(_0x4e0582[_0x426c('0x2f')][_0x426c('0x3d')]){_0x2f7d63['include']=[{'all':!![]}];}return db['MailTransferReport'][_0x426c('0x3e')](_0x2f7d63);})[_0x426c('0x24')](function(_0x11f9f1){_0x5744a7['rows']=_0x11f9f1;return _0x5744a7;})['then'](respondWithFilteredResult(_0x446ae4,_0x2f7d63))['catch'](handleError(_0x446ae4,null));};exports['show']=function(_0xd0a553,_0x3cf3cc){var _0x19d816={'raw':!![],'where':{'id':_0xd0a553['params']['id']}},_0x54e58c={};_0x54e58c[_0x426c('0x32')]=_[_0x426c('0x30')](db['MailTransferReport'][_0x426c('0x2b')]);_0x54e58c[_0x426c('0x2f')]=_[_0x426c('0x30')](_0xd0a553['query']);_0x54e58c[_0x426c('0x3f')]=_[_0x426c('0x31')](_0x54e58c['model'],_0x54e58c['query']);_0x19d816[_0x426c('0x33')]=_[_0x426c('0x31')](_0x54e58c['model'],qs['fields'](_0xd0a553[_0x426c('0x2f')][_0x426c('0x40')]));_0x19d816[_0x426c('0x33')]=_0x19d816[_0x426c('0x33')][_0x426c('0x34')]?_0x19d816['attributes']:_0x54e58c[_0x426c('0x32')];if(_0xd0a553['query']['includeAll']){_0x19d816['include']=[{'all':!![]}];}_0x19d816=_[_0x426c('0x39')]({},_0x19d816,_0xd0a553[_0x426c('0x3c')]);return db[_0x426c('0x2a')][_0x426c('0x41')](_0x19d816)[_0x426c('0x24')](handleEntityNotFound(_0x3cf3cc,null))[_0x426c('0x24')](respondWithResult(_0x3cf3cc,null))[_0x426c('0x42')](handleError(_0x3cf3cc,null));};exports['create']=function(_0x34baa4,_0x510f08){return db['MailTransferReport'][_0x426c('0x43')](_0x34baa4[_0x426c('0x44')],{})['then'](respondWithResult(_0x510f08,0xc9))[_0x426c('0x42')](handleError(_0x510f08,null));};exports[_0x426c('0x23')]=function(_0x40efbf,_0x3bf44a){if(_0x40efbf['body']['id']){delete _0x40efbf[_0x426c('0x44')]['id'];}return db['MailTransferReport'][_0x426c('0x41')]({'where':{'id':_0x40efbf[_0x426c('0x45')]['id']}})[_0x426c('0x24')](handleEntityNotFound(_0x3bf44a,null))['then'](saveUpdates(_0x40efbf['body'],null))[_0x426c('0x24')](respondWithResult(_0x3bf44a,null))[_0x426c('0x42')](handleError(_0x3bf44a,null));};exports[_0x426c('0x46')]=function(_0x55c83a,_0x173fe1){return db['MailTransferReport'][_0x426c('0x41')]({'where':{'id':_0x55c83a[_0x426c('0x45')]['id']}})[_0x426c('0x24')](handleEntityNotFound(_0x173fe1,null))[_0x426c('0x24')](removeEntity(_0x173fe1,null))['catch'](handleError(_0x173fe1,null));};exports[_0x426c('0x47')]=function(_0x30c4ec,_0x1befe9){return db['MailTransferReport'][_0x426c('0x47')]()['then'](respondWithResult(_0x1befe9,null))[_0x426c('0x42')](handleError(_0x1befe9,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 9073d37..5b20bf1 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 _0x4e8e=['./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x5820df,_0x24240a){var _0x7a47f1=function(_0x37410b){while(--_0x37410b){_0x5820df['push'](_0x5820df['shift']());}};_0x7a47f1(++_0x24240a);}(_0x4e8e,0x95));var _0xe4e8=function(_0x3d049a,_0x5f355f){_0x3d049a=_0x3d049a-0x0;var _0x49779e=_0x4e8e[_0x3d049a];return _0x49779e;};'use strict';var _=require(_0xe4e8('0x0'));var util=require(_0xe4e8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe4e8('0x2'));var BPromise=require(_0xe4e8('0x3'));var rp=require(_0xe4e8('0x4'));var fs=require('fs');var path=require(_0xe4e8('0x5'));var rimraf=require('rimraf');var config=require(_0xe4e8('0x6'));var attributes=require(_0xe4e8('0x7'));module[_0xe4e8('0x8')]=function(_0x4b7f06,_0x270768){return _0x4b7f06[_0xe4e8('0x9')](_0xe4e8('0xa'),attributes,{'tableName':_0xe4e8('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xe4e8('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4b0c=['define','MailTransferReport','report_mail_transfer','uniqueid','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports'];(function(_0x425af8,_0x366c35){var _0x5c2eb1=function(_0x44785f){while(--_0x44785f){_0x425af8['push'](_0x425af8['shift']());}};_0x5c2eb1(++_0x366c35);}(_0x4b0c,0x138));var _0xc4b0=function(_0x39d4e1,_0x57ca19){_0x39d4e1=_0x39d4e1-0x0;var _0x451c9e=_0x4b0c[_0x39d4e1];return _0x451c9e;};'use strict';var _=require(_0xc4b0('0x0'));var util=require('util');var logger=require(_0xc4b0('0x1'))(_0xc4b0('0x2'));var moment=require('moment');var BPromise=require(_0xc4b0('0x3'));var rp=require(_0xc4b0('0x4'));var fs=require('fs');var path=require(_0xc4b0('0x5'));var rimraf=require(_0xc4b0('0x6'));var config=require(_0xc4b0('0x7'));var attributes=require(_0xc4b0('0x8'));module[_0xc4b0('0x9')]=function(_0x138527,_0x563c49){return _0x138527[_0xc4b0('0xa')](_0xc4b0('0xb'),attributes,{'tableName':_0xc4b0('0xc'),'paranoid':![],'indexes':[{'name':_0xc4b0('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 4631522..1458cca 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 _0x3586=['client','http','request','then','MailTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment'];(function(_0x189259,_0x3ccf7b){var _0x2645ef=function(_0x1f400b){while(--_0x1f400b){_0x189259['push'](_0x189259['shift']());}};_0x2645ef(++_0x3ccf7b);}(_0x3586,0x83));var _0x6358=function(_0x397d7c,_0x395c73){_0x397d7c=_0x397d7c-0x0;var _0x195ad3=_0x3586[_0x397d7c];return _0x195ad3;};'use strict';var _=require(_0x6358('0x0'));var util=require(_0x6358('0x1'));var moment=require(_0x6358('0x2'));var BPromise=require(_0x6358('0x3'));var rs=require(_0x6358('0x4'));var fs=require('fs');var Redis=require(_0x6358('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6358('0x6'));var logger=require('../../config/logger')(_0x6358('0x7'));var config=require(_0x6358('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6358('0x9')][_0x6358('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e0613,_0x457e33,_0x42869a){return new BPromise(function(_0x9f0af4,_0x4d647c){return client[_0x6358('0xb')](_0x4e0613,_0x42869a)[_0x6358('0xc')](function(_0x436a3a){logger['info'](_0x6358('0xd'),_0x457e33,_0x6358('0xe'));logger['debug']('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x457e33,'request\x20sent',JSON[_0x6358('0xf')](_0x436a3a));if(_0x436a3a[_0x6358('0x10')]){if(_0x436a3a['error'][_0x6358('0x11')]===0x1f4){logger[_0x6358('0x10')](_0x6358('0xd'),_0x457e33,_0x436a3a['error'][_0x6358('0x12')]);return _0x4d647c(_0x436a3a[_0x6358('0x10')][_0x6358('0x12')]);}logger[_0x6358('0x10')](_0x6358('0xd'),_0x457e33,_0x436a3a[_0x6358('0x10')]['message']);return _0x9f0af4(_0x436a3a[_0x6358('0x10')]['message']);}else{logger[_0x6358('0x13')]('MailTransferReport,\x20%s,\x20%s',_0x457e33,'request\x20sent');_0x9f0af4(_0x436a3a['result'][_0x6358('0x12')]);}})['catch'](function(_0x37a24b){logger[_0x6358('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x457e33,_0x37a24b);_0x4d647c(_0x37a24b);});});} \ No newline at end of file +var _0xbe64=['stringify','error','code','message','MailTransferReport,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','http','then','info','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x3180f5,_0x35a5f1){var _0x49bb78=function(_0x5bd1f7){while(--_0x5bd1f7){_0x3180f5['push'](_0x3180f5['shift']());}};_0x49bb78(++_0x35a5f1);}(_0xbe64,0x123));var _0x4be6=function(_0x421196,_0x1cbd94){_0x421196=_0x421196-0x0;var _0x2738af=_0xbe64[_0x421196];return _0x2738af;};'use strict';var _=require(_0x4be6('0x0'));var util=require(_0x4be6('0x1'));var moment=require(_0x4be6('0x2'));var BPromise=require(_0x4be6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4be6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4be6('0x5'));var logger=require('../../config/logger')(_0x4be6('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4be6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x229f83,_0x48423b,_0x2310c6){return new BPromise(function(_0x376db4,_0x4829df){return client['request'](_0x229f83,_0x2310c6)[_0x4be6('0x8')](function(_0x389153){logger[_0x4be6('0x9')]('MailTransferReport,\x20%s,\x20%s',_0x48423b,_0x4be6('0xa'));logger[_0x4be6('0xb')](_0x4be6('0xc'),_0x48423b,_0x4be6('0xa'),JSON[_0x4be6('0xd')](_0x389153));if(_0x389153[_0x4be6('0xe')]){if(_0x389153[_0x4be6('0xe')][_0x4be6('0xf')]===0x1f4){logger[_0x4be6('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x48423b,_0x389153['error'][_0x4be6('0x10')]);return _0x4829df(_0x389153[_0x4be6('0xe')][_0x4be6('0x10')]);}logger[_0x4be6('0xe')](_0x4be6('0x11'),_0x48423b,_0x389153[_0x4be6('0xe')]['message']);return _0x376db4(_0x389153['error']['message']);}else{logger[_0x4be6('0x9')](_0x4be6('0x11'),_0x48423b,_0x4be6('0xa'));_0x376db4(_0x389153['result'][_0x4be6('0x10')]);}})[_0x4be6('0x12')](function(_0x4d6ea4){logger[_0x4be6('0xe')](_0x4be6('0x11'),_0x48423b,_0x4d6ea4);_0x4829df(_0x4d6ea4);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 6e37b21..9cac8d8 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 _0xe251=['./memberReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x520db3,_0x1a90f2){var _0x572590=function(_0x3a33ed){while(--_0x3a33ed){_0x520db3['push'](_0x520db3['shift']());}};_0x572590(++_0x1a90f2);}(_0xe251,0x129));var _0x1e25=function(_0x29adb2,_0x48616f){_0x29adb2=_0x29adb2-0x0;var _0x250229=_0xe251[_0x29adb2];return _0x250229;};'use strict';var multer=require(_0x1e25('0x0'));var util=require('util');var path=require(_0x1e25('0x1'));var timeout=require(_0x1e25('0x2'));var express=require(_0x1e25('0x3'));var router=express['Router']();var fs_extra=require(_0x1e25('0x4'));var auth=require(_0x1e25('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1e25('0x6'));var controller=require(_0x1e25('0x7'));router[_0x1e25('0x8')]('/',auth[_0x1e25('0x9')](),controller[_0x1e25('0xa')]);router['get'](_0x1e25('0xb'),auth['isAuthenticated'](),controller[_0x1e25('0xc')]);router[_0x1e25('0x8')](_0x1e25('0xd'),auth[_0x1e25('0x9')](),controller[_0x1e25('0xe')]);router[_0x1e25('0xf')]('/',auth[_0x1e25('0x9')](),controller[_0x1e25('0x10')]);router['put'](_0x1e25('0xd'),auth[_0x1e25('0x9')](),controller[_0x1e25('0x11')]);router['delete'](_0x1e25('0xd'),auth[_0x1e25('0x9')](),controller[_0x1e25('0x12')]);module['exports']=router; \ No newline at end of file +var _0x207c=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','show','post','put','update','delete','util'];(function(_0x1a9abe,_0x4c4dcd){var _0x583d81=function(_0x237269){while(--_0x237269){_0x1a9abe['push'](_0x1a9abe['shift']());}};_0x583d81(++_0x4c4dcd);}(_0x207c,0x17b));var _0xc207=function(_0x51f5f7,_0x4e1492){_0x51f5f7=_0x51f5f7-0x0;var _0x6afaa=_0x207c[_0x51f5f7];return _0x6afaa;};'use strict';var multer=require('multer');var util=require(_0xc207('0x0'));var path=require('path');var timeout=require(_0xc207('0x1'));var express=require(_0xc207('0x2'));var router=express[_0xc207('0x3')]();var fs_extra=require(_0xc207('0x4'));var auth=require(_0xc207('0x5'));var interaction=require(_0xc207('0x6'));var config=require(_0xc207('0x7'));var controller=require('./memberReport.controller');router['get']('/',auth[_0xc207('0x8')](),controller[_0xc207('0x9')]);router['get'](_0xc207('0xa'),auth[_0xc207('0x8')](),controller[_0xc207('0xb')]);router[_0xc207('0xc')](_0xc207('0xd'),auth['isAuthenticated'](),controller[_0xc207('0xe')]);router[_0xc207('0xf')]('/',auth[_0xc207('0x8')](),controller['create']);router[_0xc207('0x10')]('/:id',auth[_0xc207('0x8')](),controller[_0xc207('0x11')]);router[_0xc207('0x12')]('/:id',auth[_0xc207('0x8')](),controller['destroy']);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 91965ad..72860f4 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 _0x2f72=['seconds','setDataValue','exitAt','duration','talk:[start]','talk:[destination]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','INTEGER','DATE','getDataValue','enterAt','diff'];(function(_0x1d81e9,_0x2065aa){var _0x2bbc33=function(_0x56c6b2){while(--_0x56c6b2){_0x1d81e9['push'](_0x1d81e9['shift']());}};_0x2bbc33(++_0x2065aa);}(_0x2f72,0x166));var _0x22f7=function(_0x325188,_0x2bfef3){_0x325188=_0x325188-0x0;var _0x155b1e=_0x2f72[_0x325188];return _0x155b1e;};'use strict';var Sequelize=require(_0x22f7('0x0'));var moment=require(_0x22f7('0x1'));module[_0x22f7('0x2')]={'channel':{'type':Sequelize[_0x22f7('0x3')]},'membername':{'type':Sequelize[_0x22f7('0x3')]},'interface':{'type':Sequelize[_0x22f7('0x3')]},'type':{'type':Sequelize[_0x22f7('0x3')],'defaultValue':_0x22f7('0x4'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x22f7('0x5')]},'enterAt':{'type':Sequelize[_0x22f7('0x6')]},'exitAt':{'type':Sequelize[_0x22f7('0x6')],'set':function(_0x216f96){var _0xd85654=moment(_0x216f96);var _0x11cb61=moment(this[_0x22f7('0x7')](_0x22f7('0x8')));var _0x261813=_0xd85654[_0x22f7('0x9')](_0x11cb61,_0x22f7('0xa'));this[_0x22f7('0xb')](_0x22f7('0xc'),_0x216f96);this[_0x22f7('0xb')](_0x22f7('0xd'),_0x261813||null);}},'data1':{'type':Sequelize[_0x22f7('0x3')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x22f7('0x3')],'comment':_0x22f7('0xe')},'data3':{'type':Sequelize['STRING'],'comment':_0x22f7('0xf')},'data4':{'type':Sequelize[_0x22f7('0x3')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x22f7('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0x22f7('0x3')]},'internal':{'type':Sequelize[_0x22f7('0x5')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe2cc=['diff','seconds','exitAt','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt'];(function(_0x4c3de9,_0x36c480){var _0x207428=function(_0x4c52fa){while(--_0x4c52fa){_0x4c3de9['push'](_0x4c3de9['shift']());}};_0x207428(++_0x36c480);}(_0xe2cc,0x69));var _0xce2c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2cc[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xce2c('0x0'));var moment=require(_0xce2c('0x1'));module['exports']={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xce2c('0x2')]},'interface':{'type':Sequelize[_0xce2c('0x2')]},'type':{'type':Sequelize[_0xce2c('0x2')],'defaultValue':_0xce2c('0x3'),'comment':_0xce2c('0x4')},'duration':{'type':Sequelize[_0xce2c('0x5')]},'enterAt':{'type':Sequelize[_0xce2c('0x6')]},'exitAt':{'type':Sequelize[_0xce2c('0x6')],'set':function(_0x592e10){var _0x51e5d0=moment(_0x592e10);var _0x14bb4e=moment(this[_0xce2c('0x7')](_0xce2c('0x8')));var _0x29632b=_0x51e5d0[_0xce2c('0x9')](_0x14bb4e,_0xce2c('0xa'));this['setDataValue'](_0xce2c('0xb'),_0x592e10);this[_0xce2c('0xc')](_0xce2c('0xd'),_0x29632b||null);}},'data1':{'type':Sequelize[_0xce2c('0x2')],'comment':_0xce2c('0xe')},'data2':{'type':Sequelize[_0xce2c('0x2')],'comment':_0xce2c('0xf')},'data3':{'type':Sequelize[_0xce2c('0x2')],'comment':_0xce2c('0x10')},'data4':{'type':Sequelize[_0xce2c('0x2')],'comment':_0xce2c('0x11')},'data5':{'type':Sequelize[_0xce2c('0x2')],'comment':_0xce2c('0x12')},'role':{'type':Sequelize[_0xce2c('0x2')]},'internal':{'type':Sequelize[_0xce2c('0x5')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index f90b6df..9715ea9 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 _0x3e74=['show','params','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x44f37d,_0x1dc5f5){var _0x36de2f=function(_0x5a899d){while(--_0x5a899d){_0x44f37d['push'](_0x44f37d['shift']());}};_0x36de2f(++_0x1dc5f5);}(_0x3e74,0x175));var _0x43e7=function(_0x3b2177,_0xa2c6d7){_0x3b2177=_0x3b2177-0x0;var _0x4b5ff7=_0x3e74[_0x3b2177];return _0x4b5ff7;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){_0x454359['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x23')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x24')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x1b')](_0x20888b)[_0x43e7('0x25')](_0x405f85);};}exports[_0x43e7('0x26')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={},_0x4690a6={},_0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x27')](db[_0x43e7('0x28')][_0x43e7('0x29')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x2a')],'type':_0x31b2a6[_0x43e7('0x2b')][_0x43e7('0x2c')]};});_0x4690a6[_0x43e7('0x2d')]=_[_0x43e7('0x27')](_0x50f9f5,_0x43e7('0x24'));_0x4690a6['query']=_[_0x43e7('0x2e')](_0xb1fc63[_0x43e7('0x2f')]);_0x4690a6[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],_0x4690a6['query']);_0x33a1a5[_0x43e7('0x32')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],qs[_0x43e7('0x33')](_0xb1fc63['query']['fields']));_0x33a1a5['attributes']=_0x33a1a5[_0x43e7('0x32')][_0x43e7('0x34')]?_0x33a1a5[_0x43e7('0x32')]:_0x4690a6[_0x43e7('0x2d')];if(!_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x35')]('nolimit')){_0x33a1a5['limit']=qs['limit'](_0xb1fc63['query']['limit']);_0x33a1a5['offset']=qs['offset'](_0xb1fc63[_0x43e7('0x2f')]['offset']);}_0x33a1a5[_0x43e7('0x36')]=qs[_0x43e7('0x37')](_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x37')]);_0x33a1a5[_0x43e7('0x38')]=qs[_0x43e7('0x30')](_[_0x43e7('0x39')](_0xb1fc63['query'],_0x4690a6['filters']),_0x50f9f5);if(_0xb1fc63['query'][_0x43e7('0x3a')]){_0x33a1a5[_0x43e7('0x38')]=_[_0x43e7('0x3b')](_0x33a1a5[_0x43e7('0x38')],{'$or':_[_0x43e7('0x27')](_0x50f9f5,function(_0x1ed538){if(_0x1ed538[_0x43e7('0x2b')]!==_0x43e7('0x3c')){var _0x55c798={};_0x55c798[_0x1ed538[_0x43e7('0x24')]]={'$like':'%'+_0xb1fc63[_0x43e7('0x2f')]['filter']+'%'};return _0x55c798;}})});}_0x33a1a5=_[_0x43e7('0x3b')]({},_0x33a1a5,_0xb1fc63['options']);var _0x44d8e4={'where':_0x33a1a5[_0x43e7('0x38')]};return db[_0x43e7('0x28')][_0x43e7('0x1a')](_0x44d8e4)[_0x43e7('0x21')](function(_0x234d8f){_0x45b675['count']=_0x234d8f;if(_0xb1fc63['query'][_0x43e7('0x3d')]){_0x33a1a5[_0x43e7('0x3e')]=[{'all':!![]}];}return db[_0x43e7('0x28')][_0x43e7('0x3f')](_0x33a1a5);})[_0x43e7('0x21')](function(_0x4a4a85){_0x45b675[_0x43e7('0x40')]=_0x4a4a85;return _0x45b675;})[_0x43e7('0x21')](respondWithFilteredResult(_0x5087d7,_0x33a1a5))['catch'](handleError(_0x5087d7,null));};exports[_0x43e7('0x41')]=function(_0x51a69c,_0x2ad8ef){var _0x504101={'raw':!![],'where':{'id':_0x51a69c[_0x43e7('0x42')]['id']}},_0x3d81ae={};_0x3d81ae[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](db['MemberReport']['rawAttributes']);_0x3d81ae[_0x43e7('0x2f')]=_[_0x43e7('0x2e')](_0x51a69c[_0x43e7('0x2f')]);_0x3d81ae[_0x43e7('0x30')]=_['intersection'](_0x3d81ae['model'],_0x3d81ae['query']);_0x504101[_0x43e7('0x32')]=_['intersection'](_0x3d81ae[_0x43e7('0x2d')],qs['fields'](_0x51a69c['query'][_0x43e7('0x33')]));_0x504101['attributes']=_0x504101[_0x43e7('0x32')][_0x43e7('0x34')]?_0x504101[_0x43e7('0x32')]:_0x3d81ae[_0x43e7('0x2d')];if(_0x51a69c['query'][_0x43e7('0x3d')]){_0x504101[_0x43e7('0x3e')]=[{'all':!![]}];}_0x504101=_[_0x43e7('0x3b')]({},_0x504101,_0x51a69c[_0x43e7('0x43')]);return db[_0x43e7('0x28')][_0x43e7('0x44')](_0x504101)['then'](handleEntityNotFound(_0x2ad8ef,null))['then'](respondWithResult(_0x2ad8ef,null))[_0x43e7('0x45')](handleError(_0x2ad8ef,null));};exports[_0x43e7('0x46')]=function(_0x212841,_0x4c00a8){return db['MemberReport']['create'](_0x212841[_0x43e7('0x47')],{})[_0x43e7('0x21')](respondWithResult(_0x4c00a8,0xc9))['catch'](handleError(_0x4c00a8,null));};exports[_0x43e7('0x20')]=function(_0x47686e,_0x3c96fe){if(_0x47686e['body']['id']){delete _0x47686e['body']['id'];}return db['MemberReport']['find']({'where':{'id':_0x47686e[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x3c96fe,null))['then'](saveUpdates(_0x47686e[_0x43e7('0x47')],null))[_0x43e7('0x21')](respondWithResult(_0x3c96fe,null))[_0x43e7('0x45')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x22')]=function(_0x4a0ce5,_0x2718d5){return db['MemberReport']['find']({'where':{'id':_0x4a0ce5[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x2718d5,null))[_0x43e7('0x21')](removeEntity(_0x2718d5,null))[_0x43e7('0x45')](handleError(_0x2718d5,null));};exports[_0x43e7('0x48')]=function(_0x2351cf,_0x1cd87c){return db[_0x43e7('0x28')][_0x43e7('0x48')]()[_0x43e7('0x21')](respondWithResult(_0x1cd87c,null))['catch'](handleError(_0x1cd87c,null));}; \ No newline at end of file +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(_0x1af71a,_0x1d18ee){var _0x3acd6a=function(_0x3b7233){while(--_0x3b7233){_0x1af71a['push'](_0x1af71a['shift']());}};_0x3acd6a(++_0x1d18ee);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['MemberReport']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['MemberReport'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['MemberReport'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x4ffc8a['params']['id']}})['then'](handleEntityNotFound(_0x19da63,null))['then'](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x4c')]=function(_0x4cf5db,_0x1cd85){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x26')](respondWithResult(_0x1cd85,null))[_0x7995('0x49')](handleError(_0x1cd85,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 2f60d51..5521408 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 _0x6358=['MemberReport','report_member','membername','interface','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','define'];(function(_0x1f581f,_0x5f0db1){var _0x575397=function(_0x549439){while(--_0x549439){_0x1f581f['push'](_0x1f581f['shift']());}};_0x575397(++_0x5f0db1);}(_0x6358,0xba));var _0x8635=function(_0x46752f,_0x417742){_0x46752f=_0x46752f-0x0;var _0x386a8a=_0x6358[_0x46752f];return _0x386a8a;};'use strict';var _=require(_0x8635('0x0'));var util=require(_0x8635('0x1'));var logger=require(_0x8635('0x2'))(_0x8635('0x3'));var moment=require(_0x8635('0x4'));var BPromise=require(_0x8635('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8635('0x6'));var rimraf=require(_0x8635('0x7'));var config=require('../../config/environment');var attributes=require('./memberReport.attributes');module['exports']=function(_0xb49d7b,_0x5af04a){return _0xb49d7b[_0x8635('0x8')](_0x8635('0x9'),attributes,{'tableName':_0x8635('0xa'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x8635('0xb'),_0x8635('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x63bd=['membername_interface','membername','interface','api','moment','bluebird','request-promise','../../config/environment','./memberReport.attributes','MemberReport','report_member'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x63bd,0x163));var _0xd63b=function(_0x10fda4,_0x4cab62){_0x10fda4=_0x10fda4-0x0;var _0x29b671=_0x63bd[_0x10fda4];return _0x29b671;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xd63b('0x0'));var moment=require(_0xd63b('0x1'));var BPromise=require(_0xd63b('0x2'));var rp=require(_0xd63b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd63b('0x4'));var attributes=require(_0xd63b('0x5'));module['exports']=function(_0x204d0d,_0x5b6bbb){return _0x204d0d['define'](_0xd63b('0x6'),attributes,{'tableName':_0xd63b('0x7'),'paranoid':![],'indexes':[{'name':_0xd63b('0x8'),'fields':[_0xd63b('0x9'),_0xd63b('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 04f5b83..2473a67 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 _0xb194=['then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMemberReport','MemberReport','options','raw','where','limit','map','include','attributes','model','CreateMemberReport','create','body','UpdateMemberReport','update','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http'];(function(_0x305a9a,_0x1e8dd9){var _0x492cbe=function(_0x161a3f){while(--_0x161a3f){_0x305a9a['push'](_0x305a9a['shift']());}};_0x492cbe(++_0x1e8dd9);}(_0xb194,0x1b2));var _0x4b19=function(_0x16ccc4,_0x439e40){_0x16ccc4=_0x16ccc4-0x0;var _0x2d3fd0=_0xb194[_0x16ccc4];return _0x2d3fd0;};'use strict';var _=require(_0x4b19('0x0'));var util=require('util');var moment=require(_0x4b19('0x1'));var BPromise=require(_0x4b19('0x2'));var rs=require(_0x4b19('0x3'));var fs=require('fs');var Redis=require(_0x4b19('0x4'));var db=require(_0x4b19('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4b19('0x6'))(_0x4b19('0x7'));var config=require('../../config/environment');var jayson=require(_0x4b19('0x8'));var client=jayson['client'][_0x4b19('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5070da,_0x36c25a,_0x3fb52e){return new BPromise(function(_0x1dae50,_0x528ad4){return client['request'](_0x5070da,_0x3fb52e)[_0x4b19('0xa')](function(_0x5b39c6){logger[_0x4b19('0xb')](_0x4b19('0xc'),_0x36c25a,_0x4b19('0xd'));logger[_0x4b19('0xe')](_0x4b19('0xf'),_0x36c25a,_0x4b19('0xd'),JSON[_0x4b19('0x10')](_0x5b39c6));if(_0x5b39c6[_0x4b19('0x11')]){if(_0x5b39c6['error'][_0x4b19('0x12')]===0x1f4){logger['error'](_0x4b19('0xc'),_0x36c25a,_0x5b39c6[_0x4b19('0x11')]['message']);return _0x528ad4(_0x5b39c6[_0x4b19('0x11')]['message']);}logger[_0x4b19('0x11')](_0x4b19('0xc'),_0x36c25a,_0x5b39c6[_0x4b19('0x11')][_0x4b19('0x13')]);return _0x1dae50(_0x5b39c6[_0x4b19('0x11')]['message']);}else{logger[_0x4b19('0xb')](_0x4b19('0xc'),_0x36c25a,_0x4b19('0xd'));_0x1dae50(_0x5b39c6[_0x4b19('0x14')][_0x4b19('0x13')]);}})[_0x4b19('0x15')](function(_0x5d8335){logger[_0x4b19('0x11')](_0x4b19('0xc'),_0x36c25a,_0x5d8335);_0x528ad4(_0x5d8335);});});}exports[_0x4b19('0x16')]=function(_0xe7696a){var _0x2d17b5=this;return new Promise(function(_0x17c7da,_0x2ed045){return db[_0x4b19('0x17')]['findAll']({'raw':_0xe7696a[_0x4b19('0x18')]?_0xe7696a['options'][_0x4b19('0x19')]===undefined?!![]:![]:!![],'where':_0xe7696a[_0x4b19('0x18')]?_0xe7696a[_0x4b19('0x18')][_0x4b19('0x1a')]||null:null,'attributes':_0xe7696a[_0x4b19('0x18')]?_0xe7696a[_0x4b19('0x18')]['attributes']||null:null,'limit':_0xe7696a[_0x4b19('0x18')]?_0xe7696a['options'][_0x4b19('0x1b')]||null:null,'include':_0xe7696a[_0x4b19('0x18')]?_0xe7696a[_0x4b19('0x18')]['include']?_[_0x4b19('0x1c')](_0xe7696a['options'][_0x4b19('0x1d')],function(_0x18d376){return{'model':db[_0x18d376['model']],'as':_0x18d376['as'],'attributes':_0x18d376[_0x4b19('0x1e')],'include':_0x18d376[_0x4b19('0x1d')]?_[_0x4b19('0x1c')](_0x18d376[_0x4b19('0x1d')],function(_0x4c5f27){return{'model':db[_0x4c5f27[_0x4b19('0x1f')]],'as':_0x4c5f27['as'],'attributes':_0x4c5f27['attributes'],'include':_0x4c5f27['include']?_[_0x4b19('0x1c')](_0x4c5f27['include'],function(_0x294372){return{'model':db[_0x294372[_0x4b19('0x1f')]],'as':_0x294372['as'],'attributes':_0x294372[_0x4b19('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4b19('0xa')](function(_0x5c6741){logger[_0x4b19('0xb')](_0x4b19('0x16'),_0xe7696a);logger['debug'](_0x4b19('0x16'),_0xe7696a,JSON[_0x4b19('0x10')](_0x5c6741));_0x17c7da(_0x5c6741);})[_0x4b19('0x15')](function(_0x5aec18){logger['error'](_0x4b19('0x16'),_0x5aec18[_0x4b19('0x13')],_0xe7696a);_0x2ed045(_0x2d17b5[_0x4b19('0x11')](0x1f4,_0x5aec18[_0x4b19('0x13')]));});});};exports[_0x4b19('0x20')]=function(_0x4b4463){var _0x15d240=this;return new Promise(function(_0x1b75c,_0x5e8685){return db[_0x4b19('0x17')][_0x4b19('0x21')](_0x4b4463[_0x4b19('0x22')],{'raw':_0x4b4463[_0x4b19('0x18')]?_0x4b4463[_0x4b19('0x18')][_0x4b19('0x19')]===undefined?!![]:![]:!![]})[_0x4b19('0xa')](function(_0xa572b6){logger[_0x4b19('0xb')]('CreateMemberReport',_0x4b4463);logger[_0x4b19('0xe')]('CreateMemberReport',_0x4b4463,JSON[_0x4b19('0x10')](_0xa572b6));_0x1b75c(_0xa572b6);})[_0x4b19('0x15')](function(_0x5aedd8){logger[_0x4b19('0x11')](_0x4b19('0x20'),_0x5aedd8[_0x4b19('0x13')],_0x4b4463);_0x5e8685(_0x15d240[_0x4b19('0x11')](0x1f4,_0x5aedd8[_0x4b19('0x13')]));});});};exports[_0x4b19('0x23')]=function(_0xe68ab5){var _0x22d5e7=this;return new Promise(function(_0x8907e9,_0x1a88b3){return db[_0x4b19('0x17')][_0x4b19('0x24')](_0xe68ab5[_0x4b19('0x22')],{'raw':_0xe68ab5['options']?_0xe68ab5[_0x4b19('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe68ab5['options']?_0xe68ab5[_0x4b19('0x18')][_0x4b19('0x1a')]||null:null,'attributes':_0xe68ab5[_0x4b19('0x18')]?_0xe68ab5[_0x4b19('0x18')][_0x4b19('0x1e')]||null:null,'limit':_0xe68ab5[_0x4b19('0x18')]?_0xe68ab5[_0x4b19('0x18')][_0x4b19('0x1b')]||null:null})[_0x4b19('0xa')](function(_0x2a36d6){logger[_0x4b19('0xb')]('UpdateMemberReport',_0xe68ab5);logger[_0x4b19('0xe')](_0x4b19('0x23'),_0xe68ab5,JSON['stringify'](_0x2a36d6));_0x8907e9(_0x2a36d6);})['catch'](function(_0x124297){logger[_0x4b19('0x11')](_0x4b19('0x23'),_0x124297[_0x4b19('0x13')],_0xe68ab5);_0x1a88b3(_0x22d5e7[_0x4b19('0x11')](0x1f4,_0x124297['message']));});});}; \ No newline at end of file +var _0xf603=['message','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch','CreateMemberReport','create','body','UpdateMemberReport','update','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','code','error'];(function(_0x4b4b04,_0x14d717){var _0x30bb5b=function(_0x514ded){while(--_0x514ded){_0x4b4b04['push'](_0x4b4b04['shift']());}};_0x30bb5b(++_0x14d717);}(_0xf603,0x124));var _0x3f60=function(_0x87386f,_0x444aac){_0x87386f=_0x87386f-0x0;var _0x34c0fd=_0xf603[_0x87386f];return _0x34c0fd;};'use strict';var _=require(_0x3f60('0x0'));var util=require(_0x3f60('0x1'));var moment=require('moment');var BPromise=require(_0x3f60('0x2'));var rs=require(_0x3f60('0x3'));var fs=require('fs');var Redis=require(_0x3f60('0x4'));var db=require(_0x3f60('0x5'))['db'];var utils=require(_0x3f60('0x6'));var logger=require(_0x3f60('0x7'))(_0x3f60('0x8'));var config=require(_0x3f60('0x9'));var jayson=require(_0x3f60('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x49a08c,_0x413b11,_0x43ec55){return new BPromise(function(_0x75bb34,_0x297c05){return client[_0x3f60('0xb')](_0x49a08c,_0x43ec55)[_0x3f60('0xc')](function(_0xb49f89){logger[_0x3f60('0xd')](_0x3f60('0xe'),_0x413b11,_0x3f60('0xf'));logger[_0x3f60('0x10')](_0x3f60('0x11'),_0x413b11,_0x3f60('0xf'),JSON['stringify'](_0xb49f89));if(_0xb49f89['error']){if(_0xb49f89['error'][_0x3f60('0x12')]===0x1f4){logger[_0x3f60('0x13')](_0x3f60('0xe'),_0x413b11,_0xb49f89['error'][_0x3f60('0x14')]);return _0x297c05(_0xb49f89[_0x3f60('0x13')]['message']);}logger[_0x3f60('0x13')](_0x3f60('0xe'),_0x413b11,_0xb49f89['error'][_0x3f60('0x14')]);return _0x75bb34(_0xb49f89['error'][_0x3f60('0x14')]);}else{logger[_0x3f60('0xd')]('MemberReport,\x20%s,\x20%s',_0x413b11,_0x3f60('0xf'));_0x75bb34(_0xb49f89['result'][_0x3f60('0x14')]);}})['catch'](function(_0x219f16){logger[_0x3f60('0x13')](_0x3f60('0xe'),_0x413b11,_0x219f16);_0x297c05(_0x219f16);});});}exports[_0x3f60('0x15')]=function(_0x3ae771){var _0xe64a00=this;return new Promise(function(_0x52aa44,_0xb803f5){return db[_0x3f60('0x16')][_0x3f60('0x17')]({'raw':_0x3ae771[_0x3f60('0x18')]?_0x3ae771[_0x3f60('0x18')][_0x3f60('0x19')]===undefined?!![]:![]:!![],'where':_0x3ae771['options']?_0x3ae771[_0x3f60('0x18')][_0x3f60('0x1a')]||null:null,'attributes':_0x3ae771['options']?_0x3ae771[_0x3f60('0x18')][_0x3f60('0x1b')]||null:null,'limit':_0x3ae771[_0x3f60('0x18')]?_0x3ae771[_0x3f60('0x18')][_0x3f60('0x1c')]||null:null,'include':_0x3ae771[_0x3f60('0x18')]?_0x3ae771[_0x3f60('0x18')][_0x3f60('0x1d')]?_[_0x3f60('0x1e')](_0x3ae771[_0x3f60('0x18')][_0x3f60('0x1d')],function(_0x35b8f6){return{'model':db[_0x35b8f6[_0x3f60('0x1f')]],'as':_0x35b8f6['as'],'attributes':_0x35b8f6[_0x3f60('0x1b')],'include':_0x35b8f6[_0x3f60('0x1d')]?_['map'](_0x35b8f6[_0x3f60('0x1d')],function(_0x3cdef4){return{'model':db[_0x3cdef4[_0x3f60('0x1f')]],'as':_0x3cdef4['as'],'attributes':_0x3cdef4[_0x3f60('0x1b')],'include':_0x3cdef4[_0x3f60('0x1d')]?_[_0x3f60('0x1e')](_0x3cdef4[_0x3f60('0x1d')],function(_0x23e265){return{'model':db[_0x23e265['model']],'as':_0x23e265['as'],'attributes':_0x23e265[_0x3f60('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3f60('0xc')](function(_0x20ef1c){logger[_0x3f60('0xd')](_0x3f60('0x15'),_0x3ae771);logger[_0x3f60('0x10')](_0x3f60('0x15'),_0x3ae771,JSON[_0x3f60('0x20')](_0x20ef1c));_0x52aa44(_0x20ef1c);})[_0x3f60('0x21')](function(_0x3cd0a7){logger[_0x3f60('0x13')](_0x3f60('0x15'),_0x3cd0a7[_0x3f60('0x14')],_0x3ae771);_0xb803f5(_0xe64a00[_0x3f60('0x13')](0x1f4,_0x3cd0a7[_0x3f60('0x14')]));});});};exports[_0x3f60('0x22')]=function(_0x10a861){var _0x3dd647=this;return new Promise(function(_0x19a3a5,_0x169bd3){return db[_0x3f60('0x16')][_0x3f60('0x23')](_0x10a861[_0x3f60('0x24')],{'raw':_0x10a861[_0x3f60('0x18')]?_0x10a861[_0x3f60('0x18')][_0x3f60('0x19')]===undefined?!![]:![]:!![]})[_0x3f60('0xc')](function(_0xd3882a){logger[_0x3f60('0xd')](_0x3f60('0x22'),_0x10a861);logger[_0x3f60('0x10')]('CreateMemberReport',_0x10a861,JSON[_0x3f60('0x20')](_0xd3882a));_0x19a3a5(_0xd3882a);})[_0x3f60('0x21')](function(_0x4a0a25){logger[_0x3f60('0x13')](_0x3f60('0x22'),_0x4a0a25[_0x3f60('0x14')],_0x10a861);_0x169bd3(_0x3dd647[_0x3f60('0x13')](0x1f4,_0x4a0a25['message']));});});};exports[_0x3f60('0x25')]=function(_0x14292c){var _0x5e6bb4=this;return new Promise(function(_0x5c6685,_0x261210){return db['MemberReport'][_0x3f60('0x26')](_0x14292c[_0x3f60('0x24')],{'raw':_0x14292c[_0x3f60('0x18')]?_0x14292c[_0x3f60('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14292c['options']?_0x14292c[_0x3f60('0x18')][_0x3f60('0x1a')]||null:null,'attributes':_0x14292c[_0x3f60('0x18')]?_0x14292c[_0x3f60('0x18')][_0x3f60('0x1b')]||null:null,'limit':_0x14292c[_0x3f60('0x18')]?_0x14292c['options'][_0x3f60('0x1c')]||null:null})['then'](function(_0x217660){logger['info'](_0x3f60('0x25'),_0x14292c);logger[_0x3f60('0x10')](_0x3f60('0x25'),_0x14292c,JSON[_0x3f60('0x20')](_0x217660));_0x5c6685(_0x217660);})[_0x3f60('0x21')](function(_0x4cef5a){logger['error'](_0x3f60('0x25'),_0x4cef5a[_0x3f60('0x14')],_0x14292c);_0x261210(_0x5e6bb4[_0x3f60('0x13')](0x1f4,_0x4cef5a['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 193ba01..db27a3c 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 _0x07b1=['fs-extra','../../components/auth/service','../../components/interaction/service','./migration.controller','get','multer','path','connect-timeout','express','Router'];(function(_0xec1224,_0x2375ef){var _0x47da80=function(_0x32dd16){while(--_0x32dd16){_0xec1224['push'](_0xec1224['shift']());}};_0x47da80(++_0x2375ef);}(_0x07b1,0x1a9));var _0x107b=function(_0x54945e,_0x42f71a){_0x54945e=_0x54945e-0x0;var _0x36eabd=_0x07b1[_0x54945e];return _0x36eabd;};'use strict';var multer=require(_0x107b('0x0'));var util=require('util');var path=require(_0x107b('0x1'));var timeout=require(_0x107b('0x2'));var express=require(_0x107b('0x3'));var router=express[_0x107b('0x4')]();var fs_extra=require(_0x107b('0x5'));var auth=require(_0x107b('0x6'));var interaction=require(_0x107b('0x7'));var config=require('../../config/environment');var controller=require(_0x107b('0x8'));router[_0x107b('0x9')]('/',controller['index']);module['exports']=router; \ No newline at end of file +var _0x7499=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x619fcc,_0x3bd756){var _0x4737a6=function(_0x49311c){while(--_0x49311c){_0x619fcc['push'](_0x619fcc['shift']());}};_0x4737a6(++_0x3bd756);}(_0x7499,0x162));var _0x9749=function(_0x5743e3,_0x4a2aab){_0x5743e3=_0x5743e3-0x0;var _0x24d100=_0x7499[_0x5743e3];return _0x24d100;};'use strict';var multer=require(_0x9749('0x0'));var util=require(_0x9749('0x1'));var path=require('path');var timeout=require(_0x9749('0x2'));var express=require(_0x9749('0x3'));var router=express[_0x9749('0x4')]();var fs_extra=require(_0x9749('0x5'));var auth=require(_0x9749('0x6'));var interaction=require(_0x9749('0x7'));var config=require(_0x9749('0x8'));var controller=require('./migration.controller');router[_0x9749('0x9')]('/',controller[_0x9749('0xa')]);module[_0x9749('0xb')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 8c323e9..472ffa4 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 _0x4743=['exports','STRING','sequelize'];(function(_0x5bd838,_0x4c1ca1){var _0x4aeba5=function(_0x4bf0a7){while(--_0x4bf0a7){_0x5bd838['push'](_0x5bd838['shift']());}};_0x4aeba5(++_0x4c1ca1);}(_0x4743,0x188));var _0x3474=function(_0x2a87fc,_0x30a039){_0x2a87fc=_0x2a87fc-0x0;var _0x32d9f5=_0x4743[_0x2a87fc];return _0x32d9f5;};'use strict';var Sequelize=require(_0x3474('0x0'));module[_0x3474('0x1')]={'version':{'type':Sequelize[_0x3474('0x2')],'unique':'version'}}; \ No newline at end of file +var _0x44a3=['STRING','version','sequelize'];(function(_0x2bb970,_0x4afccc){var _0x3fbdaa=function(_0x583d01){while(--_0x583d01){_0x2bb970['push'](_0x2bb970['shift']());}};_0x3fbdaa(++_0x4afccc);}(_0x44a3,0xb0));var _0x344a=function(_0xd46227,_0x18477f){_0xd46227=_0xd46227-0x0;var _0x2a980d=_0x44a3[_0xd46227];return _0x2a980d;};'use strict';var Sequelize=require(_0x344a('0x0'));module['exports']={'version':{'type':Sequelize[_0x344a('0x1')],'unique':_0x344a('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 4b88687..927395b 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 _0x9ceb=['destroy','end','sendStatus','error','stack','name','send','index','map','Migration','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','fields','model','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','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/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','then'];(function(_0x8605e9,_0x56121e){var _0x4a7e6d=function(_0x33dc8a){while(--_0x33dc8a){_0x8605e9['push'](_0x8605e9['shift']());}};_0x4a7e6d(++_0x56121e);}(_0x9ceb,0x12b));var _0xb9ce=function(_0x27a465,_0x2f1c5e){_0x27a465=_0x27a465-0x0;var _0x35afc3=_0x9ceb[_0x27a465];return _0x35afc3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb9ce('0x0'));var zipdir=require(_0xb9ce('0x1'));var jsonpatch=require(_0xb9ce('0x2'));var rp=require('request-promise');var moment=require(_0xb9ce('0x3'));var BPromise=require(_0xb9ce('0x4'));var Mustache=require(_0xb9ce('0x5'));var util=require(_0xb9ce('0x6'));var path=require(_0xb9ce('0x7'));var sox=require(_0xb9ce('0x8'));var csv=require(_0xb9ce('0x9'));var ejs=require(_0xb9ce('0xa'));var fs=require('fs');var fs_extra=require(_0xb9ce('0xb'));var _=require(_0xb9ce('0xc'));var squel=require(_0xb9ce('0xd'));var crypto=require(_0xb9ce('0xe'));var jsforce=require(_0xb9ce('0xf'));var deskjs=require(_0xb9ce('0x10'));var toCsv=require(_0xb9ce('0x9'));var querystring=require('querystring');var Papa=require(_0xb9ce('0x11'));var Redis=require(_0xb9ce('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb9ce('0x13'));var as=require(_0xb9ce('0x14'));var hardwareService=require(_0xb9ce('0x15'));var logger=require(_0xb9ce('0x16'))(_0xb9ce('0x17'));var utils=require(_0xb9ce('0x18'));var config=require(_0xb9ce('0x19'));var licenseUtil=require(_0xb9ce('0x1a'));var db=require(_0xb9ce('0x1b'))['db'];function respondWithStatusCode(_0x366adc,_0x2264fd){_0x2264fd=_0x2264fd||0xcc;return function(_0x3a7c27){if(_0x3a7c27){return _0x366adc['sendStatus'](_0x2264fd);}return _0x366adc[_0xb9ce('0x1c')](_0x2264fd)['end']();};}function respondWithResult(_0x20c9d1,_0x384d48){_0x384d48=_0x384d48||0xc8;return function(_0x10bf20){if(_0x10bf20){return _0x20c9d1['status'](_0x384d48)['json'](_0x10bf20);}};}function respondWithFilteredResult(_0x645b18,_0x2971d4){return function(_0x556d96){if(_0x556d96){var _0x16f6e8=typeof _0x2971d4[_0xb9ce('0x1d')]===_0xb9ce('0x1e')&&typeof _0x2971d4[_0xb9ce('0x1f')]===_0xb9ce('0x1e');var _0x5a862d=_0x556d96[_0xb9ce('0x20')];var _0x4ada56=_0x16f6e8?0x0:_0x2971d4[_0xb9ce('0x1d')];var _0x2bd858=_0x16f6e8?_0x556d96[_0xb9ce('0x20')]:_0x2971d4['offset']+_0x2971d4[_0xb9ce('0x1f')];var _0xde1731;if(_0x2bd858>=_0x5a862d){_0x2bd858=_0x5a862d;_0xde1731=0xc8;}else{_0xde1731=0xce;}_0x645b18[_0xb9ce('0x1c')](_0xde1731);return _0x645b18[_0xb9ce('0x21')](_0xb9ce('0x22'),_0x4ada56+'-'+_0x2bd858+'/'+_0x5a862d)['json'](_0x556d96);}return null;};}function patchUpdates(_0x4b198d){return function(_0x5daf89){try{jsonpatch['apply'](_0x5daf89,_0x4b198d,!![]);}catch(_0x5ee3af){return BPromise['reject'](_0x5ee3af);}return _0x5daf89['save']();};}function saveUpdates(_0x1e6261,_0x43d5ac){return function(_0x2425b3){if(_0x2425b3){return _0x2425b3['update'](_0x1e6261)[_0xb9ce('0x23')](function(_0x5058b1){return _0x5058b1;});}return null;};}function removeEntity(_0x1f4acd,_0x37b1f3){return function(_0x49447){if(_0x49447){return _0x49447[_0xb9ce('0x24')]()[_0xb9ce('0x23')](function(){_0x1f4acd[_0xb9ce('0x1c')](0xcc)[_0xb9ce('0x25')]();});}};}function handleEntityNotFound(_0x9f1a42,_0xf79c2){return function(_0x30b9b2){if(!_0x30b9b2){_0x9f1a42[_0xb9ce('0x26')](0x194);}return _0x30b9b2;};}function handleError(_0x2e21b8,_0x18f3e1){_0x18f3e1=_0x18f3e1||0x1f4;return function(_0x536407){logger[_0xb9ce('0x27')](_0x536407[_0xb9ce('0x28')]);if(_0x536407[_0xb9ce('0x29')]){delete _0x536407[_0xb9ce('0x29')];}_0x2e21b8[_0xb9ce('0x1c')](_0x18f3e1)[_0xb9ce('0x2a')](_0x536407);};}exports[_0xb9ce('0x2b')]=function(_0x41fc54,_0x2f3320){var _0x14e7bc={},_0x1f510d={},_0x431b0b={'count':0x0,'rows':[]};var _0x3b78ad=_[_0xb9ce('0x2c')](db[_0xb9ce('0x2d')][_0xb9ce('0x2e')],function(_0x489f3d){return{'name':_0x489f3d[_0xb9ce('0x2f')],'type':_0x489f3d[_0xb9ce('0x30')]['key']};});_0x1f510d['model']=_[_0xb9ce('0x2c')](_0x3b78ad,'name');_0x1f510d[_0xb9ce('0x31')]=_[_0xb9ce('0x32')](_0x41fc54[_0xb9ce('0x31')]);_0x1f510d[_0xb9ce('0x33')]=_[_0xb9ce('0x34')](_0x1f510d['model'],_0x1f510d[_0xb9ce('0x31')]);_0x14e7bc[_0xb9ce('0x35')]=_[_0xb9ce('0x34')](_0x1f510d['model'],qs[_0xb9ce('0x36')](_0x41fc54[_0xb9ce('0x31')][_0xb9ce('0x36')]));_0x14e7bc['attributes']=_0x14e7bc['attributes']['length']?_0x14e7bc[_0xb9ce('0x35')]:_0x1f510d[_0xb9ce('0x37')];if(!_0x41fc54['query'][_0xb9ce('0x38')]('nolimit')){_0x14e7bc[_0xb9ce('0x1f')]=qs['limit'](_0x41fc54[_0xb9ce('0x31')][_0xb9ce('0x1f')]);_0x14e7bc['offset']=qs[_0xb9ce('0x1d')](_0x41fc54['query'][_0xb9ce('0x1d')]);}_0x14e7bc[_0xb9ce('0x39')]=qs[_0xb9ce('0x3a')](_0x41fc54[_0xb9ce('0x31')][_0xb9ce('0x3a')]);_0x14e7bc[_0xb9ce('0x3b')]=qs['filters'](_[_0xb9ce('0x3c')](_0x41fc54[_0xb9ce('0x31')],_0x1f510d[_0xb9ce('0x33')]),_0x3b78ad);if(_0x41fc54[_0xb9ce('0x31')][_0xb9ce('0x3d')]){_0x14e7bc[_0xb9ce('0x3b')]=_[_0xb9ce('0x3e')](_0x14e7bc[_0xb9ce('0x3b')],{'$or':_['map'](_0x3b78ad,function(_0x3f751b){if(_0x3f751b[_0xb9ce('0x30')]!==_0xb9ce('0x3f')){var _0x286e8c={};_0x286e8c[_0x3f751b[_0xb9ce('0x29')]]={'$like':'%'+_0x41fc54[_0xb9ce('0x31')][_0xb9ce('0x3d')]+'%'};return _0x286e8c;}})});}_0x14e7bc=_[_0xb9ce('0x3e')]({},_0x14e7bc,_0x41fc54[_0xb9ce('0x40')]);var _0x17cf6e={'where':_0x14e7bc[_0xb9ce('0x3b')]};return db['Migration'][_0xb9ce('0x20')](_0x17cf6e)['then'](function(_0x2f5766){_0x431b0b['count']=_0x2f5766;if(_0x41fc54[_0xb9ce('0x31')][_0xb9ce('0x41')]){_0x14e7bc['include']=[{'all':!![]}];}return db[_0xb9ce('0x2d')][_0xb9ce('0x42')](_0x14e7bc);})[_0xb9ce('0x23')](function(_0x352011){_0x431b0b['rows']=_0x352011;return _0x431b0b;})[_0xb9ce('0x23')](respondWithFilteredResult(_0x2f3320,_0x14e7bc))['catch'](handleError(_0x2f3320,null));}; \ No newline at end of file +var _0xbbc2=['hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','stack','name','index','map','Migration','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length'];(function(_0xdc03a,_0x218f69){var _0x2c4197=function(_0x5b7302){while(--_0x5b7302){_0xdc03a['push'](_0xdc03a['shift']());}};_0x2c4197(++_0x218f69);}(_0xbbc2,0xa0));var _0x2bbc=function(_0x5bcece,_0x53286d){_0x5bcece=_0x5bcece-0x0;var _0x1cab81=_0xbbc2[_0x5bcece];return _0x1cab81;};'use strict';var emlformat=require(_0x2bbc('0x0'));var rimraf=require(_0x2bbc('0x1'));var zipdir=require(_0x2bbc('0x2'));var jsonpatch=require(_0x2bbc('0x3'));var rp=require(_0x2bbc('0x4'));var moment=require(_0x2bbc('0x5'));var BPromise=require(_0x2bbc('0x6'));var Mustache=require(_0x2bbc('0x7'));var util=require(_0x2bbc('0x8'));var path=require(_0x2bbc('0x9'));var sox=require('sox');var csv=require(_0x2bbc('0xa'));var ejs=require(_0x2bbc('0xb'));var fs=require('fs');var fs_extra=require(_0x2bbc('0xc'));var _=require(_0x2bbc('0xd'));var squel=require(_0x2bbc('0xe'));var crypto=require(_0x2bbc('0xf'));var jsforce=require(_0x2bbc('0x10'));var deskjs=require(_0x2bbc('0x11'));var toCsv=require('to-csv');var querystring=require(_0x2bbc('0x12'));var Papa=require(_0x2bbc('0x13'));var Redis=require(_0x2bbc('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x2bbc('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2bbc('0x16'));var logger=require(_0x2bbc('0x17'))(_0x2bbc('0x18'));var utils=require(_0x2bbc('0x19'));var config=require(_0x2bbc('0x1a'));var licenseUtil=require(_0x2bbc('0x1b'));var db=require(_0x2bbc('0x1c'))['db'];function respondWithStatusCode(_0x4f83dc,_0x2ae601){_0x2ae601=_0x2ae601||0xcc;return function(_0x1d264f){if(_0x1d264f){return _0x4f83dc[_0x2bbc('0x1d')](_0x2ae601);}return _0x4f83dc[_0x2bbc('0x1e')](_0x2ae601)['end']();};}function respondWithResult(_0x59059,_0x8ed736){_0x8ed736=_0x8ed736||0xc8;return function(_0x4c1f6b){if(_0x4c1f6b){return _0x59059['status'](_0x8ed736)['json'](_0x4c1f6b);}};}function respondWithFilteredResult(_0x15acf7,_0x26fb86){return function(_0x4357bf){if(_0x4357bf){var _0x5c3bb5=typeof _0x26fb86[_0x2bbc('0x1f')]===_0x2bbc('0x20')&&typeof _0x26fb86['limit']===_0x2bbc('0x20');var _0x29cdf3=_0x4357bf[_0x2bbc('0x21')];var _0x4c3549=_0x5c3bb5?0x0:_0x26fb86['offset'];var _0x3e3dd6=_0x5c3bb5?_0x4357bf[_0x2bbc('0x21')]:_0x26fb86[_0x2bbc('0x1f')]+_0x26fb86['limit'];var _0x1fce40;if(_0x3e3dd6>=_0x29cdf3){_0x3e3dd6=_0x29cdf3;_0x1fce40=0xc8;}else{_0x1fce40=0xce;}_0x15acf7[_0x2bbc('0x1e')](_0x1fce40);return _0x15acf7[_0x2bbc('0x22')](_0x2bbc('0x23'),_0x4c3549+'-'+_0x3e3dd6+'/'+_0x29cdf3)[_0x2bbc('0x24')](_0x4357bf);}return null;};}function patchUpdates(_0x308633){return function(_0x26477d){try{jsonpatch[_0x2bbc('0x25')](_0x26477d,_0x308633,!![]);}catch(_0x40c3bd){return BPromise[_0x2bbc('0x26')](_0x40c3bd);}return _0x26477d[_0x2bbc('0x27')]();};}function saveUpdates(_0x2228e4,_0x99fce4){return function(_0x4cbe7a){if(_0x4cbe7a){return _0x4cbe7a[_0x2bbc('0x28')](_0x2228e4)[_0x2bbc('0x29')](function(_0x13ca99){return _0x13ca99;});}return null;};}function removeEntity(_0x11c71b,_0x5d73cb){return function(_0x3a2255){if(_0x3a2255){return _0x3a2255[_0x2bbc('0x2a')]()[_0x2bbc('0x29')](function(){_0x11c71b[_0x2bbc('0x1e')](0xcc)[_0x2bbc('0x2b')]();});}};}function handleEntityNotFound(_0x5abbd0,_0x5a5d52){return function(_0x3f6bcb){if(!_0x3f6bcb){_0x5abbd0[_0x2bbc('0x1d')](0x194);}return _0x3f6bcb;};}function handleError(_0xe0bbe,_0xedc9f9){_0xedc9f9=_0xedc9f9||0x1f4;return function(_0x3c30eb){logger['error'](_0x3c30eb[_0x2bbc('0x2c')]);if(_0x3c30eb[_0x2bbc('0x2d')]){delete _0x3c30eb['name'];}_0xe0bbe['status'](_0xedc9f9)['send'](_0x3c30eb);};}exports[_0x2bbc('0x2e')]=function(_0x18929b,_0x287b5f){var _0x449983={},_0x206a07={},_0x58670b={'count':0x0,'rows':[]};var _0x9178cf=_[_0x2bbc('0x2f')](db[_0x2bbc('0x30')][_0x2bbc('0x31')],function(_0x398dcd){return{'name':_0x398dcd[_0x2bbc('0x32')],'type':_0x398dcd[_0x2bbc('0x33')]['key']};});_0x206a07[_0x2bbc('0x34')]=_['map'](_0x9178cf,_0x2bbc('0x2d'));_0x206a07[_0x2bbc('0x35')]=_['keys'](_0x18929b[_0x2bbc('0x35')]);_0x206a07[_0x2bbc('0x36')]=_[_0x2bbc('0x37')](_0x206a07['model'],_0x206a07[_0x2bbc('0x35')]);_0x449983[_0x2bbc('0x38')]=_[_0x2bbc('0x37')](_0x206a07['model'],qs['fields'](_0x18929b[_0x2bbc('0x35')][_0x2bbc('0x39')]));_0x449983[_0x2bbc('0x38')]=_0x449983[_0x2bbc('0x38')][_0x2bbc('0x3a')]?_0x449983[_0x2bbc('0x38')]:_0x206a07[_0x2bbc('0x34')];if(!_0x18929b[_0x2bbc('0x35')][_0x2bbc('0x3b')]('nolimit')){_0x449983[_0x2bbc('0x3c')]=qs[_0x2bbc('0x3c')](_0x18929b[_0x2bbc('0x35')][_0x2bbc('0x3c')]);_0x449983[_0x2bbc('0x1f')]=qs[_0x2bbc('0x1f')](_0x18929b['query']['offset']);}_0x449983[_0x2bbc('0x3d')]=qs[_0x2bbc('0x3e')](_0x18929b[_0x2bbc('0x35')][_0x2bbc('0x3e')]);_0x449983[_0x2bbc('0x3f')]=qs['filters'](_[_0x2bbc('0x40')](_0x18929b[_0x2bbc('0x35')],_0x206a07[_0x2bbc('0x36')]),_0x9178cf);if(_0x18929b[_0x2bbc('0x35')][_0x2bbc('0x41')]){_0x449983[_0x2bbc('0x3f')]=_[_0x2bbc('0x42')](_0x449983[_0x2bbc('0x3f')],{'$or':_[_0x2bbc('0x2f')](_0x9178cf,function(_0x4f4b0c){if(_0x4f4b0c[_0x2bbc('0x33')]!==_0x2bbc('0x43')){var _0x1d302b={};_0x1d302b[_0x4f4b0c[_0x2bbc('0x2d')]]={'$like':'%'+_0x18929b[_0x2bbc('0x35')][_0x2bbc('0x41')]+'%'};return _0x1d302b;}})});}_0x449983=_[_0x2bbc('0x42')]({},_0x449983,_0x18929b['options']);var _0x114300={'where':_0x449983[_0x2bbc('0x3f')]};return db[_0x2bbc('0x30')][_0x2bbc('0x21')](_0x114300)[_0x2bbc('0x29')](function(_0x3bc07d){_0x58670b[_0x2bbc('0x21')]=_0x3bc07d;if(_0x18929b[_0x2bbc('0x35')][_0x2bbc('0x44')]){_0x449983[_0x2bbc('0x45')]=[{'all':!![]}];}return db['Migration'][_0x2bbc('0x46')](_0x449983);})[_0x2bbc('0x29')](function(_0x5e34f5){_0x58670b[_0x2bbc('0x47')]=_0x5e34f5;return _0x58670b;})[_0x2bbc('0x29')](respondWithFilteredResult(_0x287b5f,_0x449983))[_0x2bbc('0x48')](handleError(_0x287b5f,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index e5b76d9..d188e07 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 _0x1aea=['moment','bluebird','request-promise','path','./migration.attributes','exports','define','Migration','migrations'];(function(_0x515afd,_0x1a1e91){var _0x536d53=function(_0x1d3a89){while(--_0x1d3a89){_0x515afd['push'](_0x515afd['shift']());}};_0x536d53(++_0x1a1e91);}(_0x1aea,0x129));var _0xa1ae=function(_0x382c73,_0x199cab){_0x382c73=_0x382c73-0x0;var _0x1dd0bf=_0x1aea[_0x382c73];return _0x1dd0bf;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xa1ae('0x0'));var BPromise=require(_0xa1ae('0x1'));var rp=require(_0xa1ae('0x2'));var fs=require('fs');var path=require(_0xa1ae('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa1ae('0x4'));module[_0xa1ae('0x5')]=function(_0x9b222c,_0x5a7079){return _0x9b222c[_0xa1ae('0x6')](_0xa1ae('0x7'),attributes,{'tableName':_0xa1ae('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7454=['./migration.attributes','define','migrations','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x4117ae,_0x1e7f51){var _0x4a1035=function(_0x660a45){while(--_0x660a45){_0x4117ae['push'](_0x4117ae['shift']());}};_0x4a1035(++_0x1e7f51);}(_0x7454,0xc1));var _0x4745=function(_0x31e5cb,_0x2f5adf){_0x31e5cb=_0x31e5cb-0x0;var _0x4170df=_0x7454[_0x31e5cb];return _0x4170df;};'use strict';var _=require('lodash');var util=require(_0x4745('0x0'));var logger=require(_0x4745('0x1'))('api');var moment=require(_0x4745('0x2'));var BPromise=require(_0x4745('0x3'));var rp=require(_0x4745('0x4'));var fs=require('fs');var path=require(_0x4745('0x5'));var rimraf=require(_0x4745('0x6'));var config=require('../../config/environment');var attributes=require(_0x4745('0x7'));module['exports']=function(_0xaf97e5,_0x52c917){return _0xaf97e5[_0x4745('0x8')]('Migration',attributes,{'tableName':_0x4745('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index f2e450c..bedf56c 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 _0xb4e6=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2e7087,_0x112eec){var _0xb5b3a6=function(_0x296310){while(--_0x296310){_0x2e7087['push'](_0x2e7087['shift']());}};_0xb5b3a6(++_0x112eec);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x5c3ae9,_0x450f9a){_0x5c3ae9=_0x5c3ae9-0x0;var _0x3f5950=_0xb4e6[_0x5c3ae9];return _0x3f5950;};'use strict';var _=require(_0x6b4e('0x0'));var util=require('util');var moment=require(_0x6b4e('0x1'));var BPromise=require(_0x6b4e('0x2'));var rs=require(_0x6b4e('0x3'));var fs=require('fs');var Redis=require(_0x6b4e('0x4'));var db=require(_0x6b4e('0x5'))['db'];var utils=require(_0x6b4e('0x6'));var logger=require(_0x6b4e('0x7'))('rpc');var config=require(_0x6b4e('0x8'));var jayson=require(_0x6b4e('0x9'));var client=jayson[_0x6b4e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd3138f,_0x570346,_0x4f00be){return new BPromise(function(_0x2311d9,_0x48c870){return client['request'](_0xd3138f,_0x4f00be)[_0x6b4e('0xb')](function(_0x2bd576){logger[_0x6b4e('0xc')](_0x6b4e('0xd'),_0x570346,_0x6b4e('0xe'));logger[_0x6b4e('0xf')](_0x6b4e('0x10'),_0x570346,'request\x20sent',JSON[_0x6b4e('0x11')](_0x2bd576));if(_0x2bd576[_0x6b4e('0x12')]){if(_0x2bd576['error'][_0x6b4e('0x13')]===0x1f4){logger[_0x6b4e('0x12')](_0x6b4e('0xd'),_0x570346,_0x2bd576[_0x6b4e('0x12')][_0x6b4e('0x14')]);return _0x48c870(_0x2bd576[_0x6b4e('0x12')][_0x6b4e('0x14')]);}logger['error'](_0x6b4e('0xd'),_0x570346,_0x2bd576[_0x6b4e('0x12')]['message']);return _0x2311d9(_0x2bd576[_0x6b4e('0x12')]['message']);}else{logger[_0x6b4e('0xc')](_0x6b4e('0xd'),_0x570346,_0x6b4e('0xe'));_0x2311d9(_0x2bd576[_0x6b4e('0x15')][_0x6b4e('0x14')]);}})[_0x6b4e('0x16')](function(_0x53a934){logger['error'](_0x6b4e('0xd'),_0x570346,_0x53a934);_0x48c870(_0x53a934);});});} \ No newline at end of file +var _0xce25=['../../config/utils','rpc','../../config/environment','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','error','code','message','result','moment','../../mysqldb'];(function(_0x1dd24c,_0x3c3ab3){var _0x1cf3e0=function(_0x5aa52d){while(--_0x5aa52d){_0x1dd24c['push'](_0x1dd24c['shift']());}};_0x1cf3e0(++_0x3c3ab3);}(_0xce25,0x196));var _0x5ce2=function(_0x1bfe6a,_0x348e16){_0x1bfe6a=_0x1bfe6a-0x0;var _0x225557=_0xce25[_0x1bfe6a];return _0x225557;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5ce2('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5ce2('0x1'))['db'];var utils=require(_0x5ce2('0x2'));var logger=require('../../config/logger')(_0x5ce2('0x3'));var config=require(_0x5ce2('0x4'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5ce2('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x417149,_0x1ab2e7,_0xcb80ee){return new BPromise(function(_0x4a57a6,_0x2ccf81){return client[_0x5ce2('0x6')](_0x417149,_0xcb80ee)[_0x5ce2('0x7')](function(_0x49ede4){logger[_0x5ce2('0x8')](_0x5ce2('0x9'),_0x1ab2e7,_0x5ce2('0xa'));logger[_0x5ce2('0xb')](_0x5ce2('0xc'),_0x1ab2e7,_0x5ce2('0xa'),JSON['stringify'](_0x49ede4));if(_0x49ede4[_0x5ce2('0xd')]){if(_0x49ede4['error'][_0x5ce2('0xe')]===0x1f4){logger[_0x5ce2('0xd')]('Migration,\x20%s,\x20%s',_0x1ab2e7,_0x49ede4['error']['message']);return _0x2ccf81(_0x49ede4['error'][_0x5ce2('0xf')]);}logger['error']('Migration,\x20%s,\x20%s',_0x1ab2e7,_0x49ede4[_0x5ce2('0xd')]['message']);return _0x4a57a6(_0x49ede4[_0x5ce2('0xd')][_0x5ce2('0xf')]);}else{logger[_0x5ce2('0x8')]('Migration,\x20%s,\x20%s',_0x1ab2e7,_0x5ce2('0xa'));_0x4a57a6(_0x49ede4[_0x5ce2('0x10')][_0x5ce2('0xf')]);}})['catch'](function(_0x4b89d3){logger[_0x5ce2('0xd')](_0x5ce2('0x9'),_0x1ab2e7,_0x4b89d3);_0x2ccf81(_0x4b89d3);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index f1e4ea1..fd8d0c5 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 _0xf2c5=['isAuthenticated','index','/:id','post','create','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get'];(function(_0xbb8f5d,_0x1ccf45){var _0x4aba29=function(_0x253f3b){while(--_0x253f3b){_0xbb8f5d['push'](_0xbb8f5d['shift']());}};_0x4aba29(++_0x1ccf45);}(_0xf2c5,0x6d));var _0x5f2c=function(_0x4f1234,_0x49549f){_0x4f1234=_0x4f1234-0x0;var _0x42008e=_0xf2c5[_0x4f1234];return _0x42008e;};'use strict';var multer=require(_0x5f2c('0x0'));var util=require(_0x5f2c('0x1'));var path=require(_0x5f2c('0x2'));var timeout=require('connect-timeout');var express=require(_0x5f2c('0x3'));var router=express[_0x5f2c('0x4')]();var fs_extra=require(_0x5f2c('0x5'));var auth=require(_0x5f2c('0x6'));var interaction=require(_0x5f2c('0x7'));var config=require(_0x5f2c('0x8'));var controller=require(_0x5f2c('0x9'));router[_0x5f2c('0xa')]('/',auth[_0x5f2c('0xb')](),controller[_0x5f2c('0xc')]);router['get'](_0x5f2c('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x5f2c('0xe')]('/',auth[_0x5f2c('0xb')](),controller[_0x5f2c('0xf')]);router[_0x5f2c('0x10')](_0x5f2c('0xd'),auth[_0x5f2c('0xb')](),controller[_0x5f2c('0x11')]);router[_0x5f2c('0x12')]('/:id',auth[_0x5f2c('0xb')](),controller['destroy']);module[_0x5f2c('0x13')]=router; \ No newline at end of file +var _0x41d0=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show','create','update','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x41d0,0x1c6));var _0x041d=function(_0x4c6f7e,_0xad2dfa){_0x4c6f7e=_0x4c6f7e-0x0;var _0x49ba40=_0x41d0[_0x4c6f7e];return _0x49ba40;};'use strict';var multer=require(_0x041d('0x0'));var util=require(_0x041d('0x1'));var path=require(_0x041d('0x2'));var timeout=require(_0x041d('0x3'));var express=require('express');var router=express[_0x041d('0x4')]();var fs_extra=require(_0x041d('0x5'));var auth=require(_0x041d('0x6'));var interaction=require(_0x041d('0x7'));var config=require(_0x041d('0x8'));var controller=require(_0x041d('0x9'));router[_0x041d('0xa')]('/',auth[_0x041d('0xb')](),controller[_0x041d('0xc')]);router['get'](_0x041d('0xd'),auth['isAuthenticated'](),controller[_0x041d('0xe')]);router['post']('/',auth[_0x041d('0xb')](),controller[_0x041d('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x041d('0x10')]);router['delete'](_0x041d('0xd'),auth['isAuthenticated'](),controller[_0x041d('0x11')]);module[_0x041d('0x12')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 11234af..ed28a60 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 _0x95ca=['localnet','externip','stun','STRING','sequelize','exports','ENUM'];(function(_0x2014b3,_0x4e2160){var _0x26a3b0=function(_0x3826dd){while(--_0x3826dd){_0x2014b3['push'](_0x2014b3['shift']());}};_0x26a3b0(++_0x4e2160);}(_0x95ca,0x193));var _0xa95c=function(_0x3485a8,_0x49e7b7){_0x3485a8=_0x3485a8-0x0;var _0x1f3e31=_0x95ca[_0x3485a8];return _0x1f3e31;};'use strict';var Sequelize=require(_0xa95c('0x0'));module[_0xa95c('0x1')]={'type':{'type':Sequelize[_0xa95c('0x2')](_0xa95c('0x3'),_0xa95c('0x4'),_0xa95c('0x5'),'turn')},'value':{'type':Sequelize[_0xa95c('0x6')]},'username':{'type':Sequelize[_0xa95c('0x6')]},'password':{'type':Sequelize[_0xa95c('0x6')]}}; \ No newline at end of file +var _0x38d0=['localnet','externip','stun','STRING','sequelize','ENUM'];(function(_0x56a7bb,_0xbc8866){var _0x152cb3=function(_0x2756b6){while(--_0x2756b6){_0x56a7bb['push'](_0x56a7bb['shift']());}};_0x152cb3(++_0xbc8866);}(_0x38d0,0x1ba));var _0x038d=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x38d0[_0x26462c];return _0x509a42;};'use strict';var Sequelize=require(_0x038d('0x0'));module['exports']={'type':{'type':Sequelize[_0x038d('0x1')](_0x038d('0x2'),_0x038d('0x3'),_0x038d('0x4'),'turn')},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x038d('0x5')]},'password':{'type':Sequelize[_0x038d('0x5')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 149743c..211ab3b 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 _0x12b7=['error','message','info','result','catch','sendStatus','status','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','end','stack','send','index','map','Network','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','keys','find','create','sequelize','transaction','body','findAll','toUpperCase','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','format','/etc/asterisk/sip_xcally_%s.conf','Reload','chan_sip.so','params','STUN','/etc/asterisk/stun_xcally.conf','update','server/files/templates/network.ejs','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','http','request','then','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x5e8b46,_0x21eb4a){var _0x252814=function(_0x327288){while(--_0x327288){_0x5e8b46['push'](_0x5e8b46['shift']());}};_0x252814(++_0x21eb4a);}(_0x12b7,0x194));var _0x712b=function(_0xad31a2,_0x2d4fff){_0xad31a2=_0xad31a2-0x0;var _0x95c640=_0x12b7[_0xad31a2];return _0x95c640;};'use strict';var emlformat=require(_0x712b('0x0'));var rimraf=require(_0x712b('0x1'));var zipdir=require(_0x712b('0x2'));var jsonpatch=require(_0x712b('0x3'));var rp=require(_0x712b('0x4'));var moment=require('moment');var BPromise=require(_0x712b('0x5'));var Mustache=require(_0x712b('0x6'));var util=require(_0x712b('0x7'));var path=require(_0x712b('0x8'));var sox=require(_0x712b('0x9'));var csv=require(_0x712b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x712b('0xb'));var _=require(_0x712b('0xc'));var squel=require('squel');var crypto=require(_0x712b('0xd'));var jsforce=require(_0x712b('0xe'));var deskjs=require(_0x712b('0xf'));var toCsv=require(_0x712b('0xa'));var querystring=require(_0x712b('0x10'));var Papa=require(_0x712b('0x11'));var Redis=require(_0x712b('0x12'));var authService=require(_0x712b('0x13'));var qs=require(_0x712b('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x712b('0x15'));var logger=require(_0x712b('0x16'))(_0x712b('0x17'));var utils=require('../../config/utils');var config=require(_0x712b('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x712b('0x19'))['db'];var jayson=require(_0x712b('0x1a'));var client=jayson['client'][_0x712b('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x369d5e,_0xc0b400,_0x131e51,_0x10bd05){return new BPromise(function(_0x224480,_0x171130){var _0x347bc9=_0x10bd05||client;return _0x347bc9[_0x712b('0x1c')](_0x369d5e,_0x131e51)[_0x712b('0x1d')](function(_0x105b1a){logger['info'](_0x712b('0x1e'),_0xc0b400,_0x712b('0x1f'));logger[_0x712b('0x20')](_0x712b('0x21'),_0xc0b400,'request\x20sent',JSON[_0x712b('0x22')](_0x105b1a));if(_0x105b1a['error']){if(_0x105b1a['error'][_0x712b('0x23')]===0x1f4){logger[_0x712b('0x24')](_0x712b('0x1e'),_0xc0b400,_0x105b1a[_0x712b('0x24')]['message']);return _0x171130(_0x105b1a[_0x712b('0x24')][_0x712b('0x25')]);}logger['error'](_0x712b('0x1e'),_0xc0b400,_0x105b1a[_0x712b('0x24')][_0x712b('0x25')]);return _0x224480(_0x105b1a['error'][_0x712b('0x25')]);}else{logger[_0x712b('0x26')](_0x712b('0x1e'),_0xc0b400,_0x712b('0x1f'));_0x224480(_0x105b1a[_0x712b('0x27')][_0x712b('0x25')]);}})[_0x712b('0x28')](function(_0x466483){logger[_0x712b('0x24')](_0x712b('0x1e'),_0xc0b400,_0x466483);_0x171130(_0x466483);});});}function respondWithStatusCode(_0x41f328,_0x4729fc){_0x4729fc=_0x4729fc||0xcc;return function(_0xb7067d){if(_0xb7067d){return _0x41f328[_0x712b('0x29')](_0x4729fc);}return _0x41f328['status'](_0x4729fc)['end']();};}function respondWithResult(_0x3ac2c2,_0x33aeea){_0x33aeea=_0x33aeea||0xc8;return function(_0x30d213){if(_0x30d213){return _0x3ac2c2[_0x712b('0x2a')](_0x33aeea)['json'](_0x30d213);}};}function respondWithFilteredResult(_0x18c4a4,_0x43b2cd){return function(_0x1799ab){if(_0x1799ab){var _0x29b0e2=typeof _0x43b2cd['offset']===_0x712b('0x2b')&&typeof _0x43b2cd[_0x712b('0x2c')]===_0x712b('0x2b');var _0x3d6948=_0x1799ab[_0x712b('0x2d')];var _0x4ed3fe=_0x29b0e2?0x0:_0x43b2cd[_0x712b('0x2e')];var _0x561e11=_0x29b0e2?_0x1799ab[_0x712b('0x2d')]:_0x43b2cd[_0x712b('0x2e')]+_0x43b2cd[_0x712b('0x2c')];var _0x32eddb;if(_0x561e11>=_0x3d6948){_0x561e11=_0x3d6948;_0x32eddb=0xc8;}else{_0x32eddb=0xce;}_0x18c4a4['status'](_0x32eddb);return _0x18c4a4[_0x712b('0x2f')](_0x712b('0x30'),_0x4ed3fe+'-'+_0x561e11+'/'+_0x3d6948)['json'](_0x1799ab);}return null;};}function patchUpdates(_0x26dc6d){return function(_0x428403){try{jsonpatch[_0x712b('0x31')](_0x428403,_0x26dc6d,!![]);}catch(_0x11b1ad){return BPromise[_0x712b('0x32')](_0x11b1ad);}return _0x428403[_0x712b('0x33')]();};}function saveUpdates(_0x1d2baf,_0x508865){return function(_0x315d5f){if(_0x315d5f){return _0x315d5f['update'](_0x1d2baf)[_0x712b('0x1d')](function(_0x2a89d3){return _0x2a89d3;});}return null;};}function removeEntity(_0x1ee777,_0x12f5da){return function(_0xaa662d){if(_0xaa662d){return _0xaa662d[_0x712b('0x34')]()[_0x712b('0x1d')](function(){_0x1ee777[_0x712b('0x2a')](0xcc)[_0x712b('0x35')]();});}};}function handleEntityNotFound(_0x4101ff,_0x3201bb){return function(_0x4c8bc1){if(!_0x4c8bc1){_0x4101ff[_0x712b('0x29')](0x194);}return _0x4c8bc1;};}function handleError(_0x511cee,_0x1c56f9){_0x1c56f9=_0x1c56f9||0x1f4;return function(_0x25b383){logger['error'](_0x25b383[_0x712b('0x36')]);if(_0x25b383['name']){delete _0x25b383['name'];}_0x511cee[_0x712b('0x2a')](_0x1c56f9)[_0x712b('0x37')](_0x25b383);};}exports[_0x712b('0x38')]=function(_0x3ddd0e,_0x1056a5){var _0x142d27={},_0x25bf36={},_0x2a0f24={'count':0x0,'rows':[]};var _0xe3f4dc=_[_0x712b('0x39')](db[_0x712b('0x3a')]['rawAttributes'],function(_0x558248){return{'name':_0x558248[_0x712b('0x3b')],'type':_0x558248[_0x712b('0x3c')][_0x712b('0x3d')]};});_0x25bf36[_0x712b('0x3e')]=_[_0x712b('0x39')](_0xe3f4dc,'name');_0x25bf36['query']=_['keys'](_0x3ddd0e[_0x712b('0x3f')]);_0x25bf36['filters']=_[_0x712b('0x40')](_0x25bf36['model'],_0x25bf36['query']);_0x142d27[_0x712b('0x41')]=_[_0x712b('0x40')](_0x25bf36[_0x712b('0x3e')],qs[_0x712b('0x42')](_0x3ddd0e[_0x712b('0x3f')]['fields']));_0x142d27[_0x712b('0x41')]=_0x142d27[_0x712b('0x41')][_0x712b('0x43')]?_0x142d27[_0x712b('0x41')]:_0x25bf36[_0x712b('0x3e')];if(!_0x3ddd0e[_0x712b('0x3f')][_0x712b('0x44')](_0x712b('0x45'))){_0x142d27[_0x712b('0x2c')]=qs['limit'](_0x3ddd0e[_0x712b('0x3f')]['limit']);_0x142d27['offset']=qs['offset'](_0x3ddd0e[_0x712b('0x3f')]['offset']);}_0x142d27[_0x712b('0x46')]=qs['sort'](_0x3ddd0e[_0x712b('0x3f')][_0x712b('0x47')]);_0x142d27['where']=qs[_0x712b('0x48')](_[_0x712b('0x49')](_0x3ddd0e[_0x712b('0x3f')],_0x25bf36[_0x712b('0x48')]),_0xe3f4dc);if(_0x3ddd0e['query'][_0x712b('0x4a')]){_0x142d27[_0x712b('0x4b')]=_[_0x712b('0x4c')](_0x142d27[_0x712b('0x4b')],{'$or':_[_0x712b('0x39')](_0xe3f4dc,function(_0x4f06c5){if(_0x4f06c5[_0x712b('0x3c')]!==_0x712b('0x4d')){var _0x481100={};_0x481100[_0x4f06c5['name']]={'$like':'%'+_0x3ddd0e['query'][_0x712b('0x4a')]+'%'};return _0x481100;}})});}_0x142d27=_[_0x712b('0x4c')]({},_0x142d27,_0x3ddd0e[_0x712b('0x4e')]);var _0x3a899c={'where':_0x142d27[_0x712b('0x4b')]};return db[_0x712b('0x3a')][_0x712b('0x2d')](_0x3a899c)[_0x712b('0x1d')](function(_0x33faad){_0x2a0f24[_0x712b('0x2d')]=_0x33faad;if(_0x3ddd0e[_0x712b('0x3f')][_0x712b('0x4f')]){_0x142d27[_0x712b('0x50')]=[{'all':!![]}];}return db['Network']['findAll'](_0x142d27);})[_0x712b('0x1d')](function(_0x1ccce4){_0x2a0f24['rows']=_0x1ccce4;return _0x2a0f24;})[_0x712b('0x1d')](respondWithFilteredResult(_0x1056a5,_0x142d27))[_0x712b('0x28')](handleError(_0x1056a5,null));};exports['show']=function(_0x4714d6,_0x315bba){var _0x541e8f={'raw':!![],'where':{'id':_0x4714d6['params']['id']}},_0x4c39c7={};_0x4c39c7['model']=_[_0x712b('0x51')](db[_0x712b('0x3a')]['rawAttributes']);_0x4c39c7['query']=_['keys'](_0x4714d6[_0x712b('0x3f')]);_0x4c39c7[_0x712b('0x48')]=_[_0x712b('0x40')](_0x4c39c7[_0x712b('0x3e')],_0x4c39c7[_0x712b('0x3f')]);_0x541e8f[_0x712b('0x41')]=_['intersection'](_0x4c39c7[_0x712b('0x3e')],qs[_0x712b('0x42')](_0x4714d6[_0x712b('0x3f')]['fields']));_0x541e8f['attributes']=_0x541e8f[_0x712b('0x41')]['length']?_0x541e8f[_0x712b('0x41')]:_0x4c39c7['model'];if(_0x4714d6[_0x712b('0x3f')]['includeAll']){_0x541e8f[_0x712b('0x50')]=[{'all':!![]}];}_0x541e8f=_[_0x712b('0x4c')]({},_0x541e8f,_0x4714d6['options']);return db[_0x712b('0x3a')][_0x712b('0x52')](_0x541e8f)['then'](handleEntityNotFound(_0x315bba,null))['then'](respondWithResult(_0x315bba,null))['catch'](handleError(_0x315bba,null));};exports[_0x712b('0x53')]=function(_0x427393,_0x25b2a0,_0x24e53c){var _0x352ec6;return db[_0x712b('0x54')][_0x712b('0x55')](function(_0x87e353){return db[_0x712b('0x3a')]['create'](_0x427393[_0x712b('0x56')],{'raw':!![]})[_0x712b('0x1d')](function(_0x48b362){_0x352ec6=_0x48b362;return db[_0x712b('0x3a')][_0x712b('0x57')]({'where':{'type':_0x427393['body'][_0x712b('0x3c')]},'raw':!![]});})[_0x712b('0x1d')](function(_0x4c4041){if(_0x352ec6[_0x712b('0x3c')][_0x712b('0x58')]()=='STUN'){var _0x3cb025=fs[_0x712b('0x59')](path[_0x712b('0x5a')](config[_0x712b('0x5b')],_0x712b('0x5c')),_0x712b('0x5d'));var _0x3670a7=ejs[_0x712b('0x5e')](_0x3cb025,{'networks':_0x4c4041||[]});fs[_0x712b('0x5f')]('/etc/asterisk/stun_xcally.conf',_0x3670a7);return respondWithRpcPromise('Reload',_0x712b('0x53'),{'module':_0x712b('0x60')});}else if(_0x352ec6[_0x712b('0x3c')][_0x712b('0x58')]()==_0x712b('0x61')){var _0x58fbd3=fs[_0x712b('0x59')](path[_0x712b('0x5a')](config['root'],_0x712b('0x62')),_0x712b('0x5d'));var _0x5ca865=ejs[_0x712b('0x5e')](_0x58fbd3,{'networks':_0x4c4041||[]});fs[_0x712b('0x5f')](_0x712b('0x63'),_0x5ca865);return respondWithRpcPromise('Reload',_0x712b('0x53'),{'module':_0x712b('0x60')});}else{var _0x2702bc=fs[_0x712b('0x59')](path[_0x712b('0x5a')](config[_0x712b('0x5b')],'server/files/templates/network.ejs'),_0x712b('0x5d'));var _0x3ea8cf=ejs[_0x712b('0x5e')](_0x2702bc,{'networks':_0x4c4041||[]});fs['writeFileSync'](util[_0x712b('0x64')](_0x712b('0x65'),_0x427393[_0x712b('0x56')][_0x712b('0x3c')]['toLowerCase']()),_0x3ea8cf);return respondWithRpcPromise(_0x712b('0x66'),_0x712b('0x53'),{'module':_0x712b('0x67')});}return null;})[_0x712b('0x1d')](function(){return _0x352ec6;});})[_0x712b('0x1d')](respondWithResult(_0x25b2a0,0xc9))[_0x712b('0x28')](handleError(_0x25b2a0,null));};exports['update']=function(_0x778b7e,_0x42ee74,_0x1f0a33){var _0x271138;return db['sequelize'][_0x712b('0x55')](function(_0x51ae23){return db[_0x712b('0x3a')][_0x712b('0x52')]({'where':{'id':_0x778b7e[_0x712b('0x68')]['id']}})[_0x712b('0x1d')](handleEntityNotFound(_0x42ee74,null))['then'](saveUpdates(_0x778b7e[_0x712b('0x56')],null))[_0x712b('0x1d')](function(_0x1f3084){if(_0x1f3084){_0x271138=_0x1f3084;return db['Network'][_0x712b('0x57')]({'where':{'type':_0x271138['type']},'raw':!![]});}return null;})[_0x712b('0x1d')](function(_0x54ae0c){if(_0x271138[_0x712b('0x3c')]['toUpperCase']()==_0x712b('0x69')){var _0x2f9d17=fs[_0x712b('0x59')](path[_0x712b('0x5a')](config[_0x712b('0x5b')],_0x712b('0x5c')),_0x712b('0x5d'));var _0x13b569=ejs[_0x712b('0x5e')](_0x2f9d17,{'networks':_0x54ae0c||[]});fs['writeFileSync'](_0x712b('0x6a'),_0x13b569);return respondWithRpcPromise(_0x712b('0x66'),'update',{'module':_0x712b('0x60')});}else if(_0x271138[_0x712b('0x3c')][_0x712b('0x58')]()==_0x712b('0x61')){var _0x399a46=fs[_0x712b('0x59')](path[_0x712b('0x5a')](config[_0x712b('0x5b')],_0x712b('0x62')),_0x712b('0x5d'));var _0x213a0c=ejs[_0x712b('0x5e')](_0x399a46,{'networks':_0x54ae0c||[]});fs[_0x712b('0x5f')](_0x712b('0x63'),_0x213a0c);return respondWithRpcPromise(_0x712b('0x66'),_0x712b('0x6b'),{'module':_0x712b('0x60')});}else{var _0x3ad7ea=fs[_0x712b('0x59')](path[_0x712b('0x5a')](config[_0x712b('0x5b')],_0x712b('0x6c')),_0x712b('0x5d'));var _0x321df3=ejs['render'](_0x3ad7ea,{'networks':_0x54ae0c||[]});fs[_0x712b('0x5f')](util[_0x712b('0x64')](_0x712b('0x65'),_0x778b7e[_0x712b('0x56')][_0x712b('0x3c')][_0x712b('0x6d')]()),_0x321df3);return respondWithRpcPromise(_0x712b('0x66'),'update',{'module':'chan_sip.so'});}return null;})['then'](function(_0x5424bf){if(_0x5424bf){return _0x271138;}return null;});})[_0x712b('0x1d')](respondWithResult(_0x42ee74,null))[_0x712b('0x28')](handleError(_0x42ee74,null));};exports['destroy']=function(_0x216efa,_0x28c848,_0x53c6e8){var _0x463369;return db[_0x712b('0x3a')]['find']({'where':{'id':_0x216efa[_0x712b('0x68')]['id']}})[_0x712b('0x1d')](function(_0x16c492){_0x463369=_0x16c492;return _0x16c492;})[_0x712b('0x1d')](handleEntityNotFound(_0x28c848,null))[_0x712b('0x1d')](removeEntity(_0x28c848,null))['then'](function(){if(_0x463369){return db[_0x712b('0x3a')][_0x712b('0x57')]({'where':{'type':_0x463369[_0x712b('0x3c')]},'raw':!![]});}})[_0x712b('0x1d')](function(_0x385dbc){if(_0x463369[_0x712b('0x3c')][_0x712b('0x58')]()==_0x712b('0x69')){var _0x18a15b=fs[_0x712b('0x59')](path[_0x712b('0x5a')](config[_0x712b('0x5b')],'server/files/templates/stun_multiple.ejs'),_0x712b('0x5d'));var _0x213dfd=ejs[_0x712b('0x5e')](_0x18a15b,{'networks':_0x385dbc||[]});fs['writeFileSync'](_0x712b('0x6a'),_0x213dfd);return respondWithRpcPromise(_0x712b('0x66'),_0x712b('0x34'),{'module':'res_stun_monitor.so'});}else if(_0x463369[_0x712b('0x3c')][_0x712b('0x58')]()==_0x712b('0x61')){var _0x23e8d1=fs[_0x712b('0x59')](path[_0x712b('0x5a')](config['root'],_0x712b('0x62')),_0x712b('0x5d'));var _0x226306=ejs['render'](_0x23e8d1,{'networks':_0x385dbc||[]});fs['writeFileSync'](_0x712b('0x63'),_0x226306);return respondWithRpcPromise(_0x712b('0x66'),_0x712b('0x34'),{'module':_0x712b('0x60')});}else{var _0x457d2a=fs['readFileSync'](path[_0x712b('0x5a')](config[_0x712b('0x5b')],_0x712b('0x6c')),_0x712b('0x5d'));var _0x5890c1=ejs['render'](_0x457d2a,{'networks':_0x385dbc||[]});fs[_0x712b('0x5f')](util[_0x712b('0x64')](_0x712b('0x65'),_0x216efa[_0x712b('0x56')]['type'][_0x712b('0x6d')]()),_0x5890c1);return respondWithRpcPromise(_0x712b('0x66'),_0x712b('0x34'),{'module':_0x712b('0x67')});}return null;})[_0x712b('0x28')](handleError(_0x28c848,null));}; \ No newline at end of file +var _0x84cf=['name','send','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','merge','VIRTUAL','options','includeAll','include','Network','rows','catch','params','create','body','findAll','toUpperCase','server/files/templates/stun_multiple.ejs','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','readFileSync','join','root','server/files/templates/turn_multiple.ejs','utf8','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','sequelize','transaction','STUN','format','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','destroy','end','stack'];(function(_0x3a64ca,_0x2549b5){var _0x4775cc=function(_0x584df8){while(--_0x584df8){_0x3a64ca['push'](_0x3a64ca['shift']());}};_0x4775cc(++_0x2549b5);}(_0x84cf,0x176));var _0xf84c=function(_0x2c0abe,_0x1b4c6b){_0x2c0abe=_0x2c0abe-0x0;var _0x566ac1=_0x84cf[_0x2c0abe];return _0x566ac1;};'use strict';var emlformat=require(_0xf84c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf84c('0x1'));var jsonpatch=require(_0xf84c('0x2'));var rp=require(_0xf84c('0x3'));var moment=require(_0xf84c('0x4'));var BPromise=require(_0xf84c('0x5'));var Mustache=require(_0xf84c('0x6'));var util=require(_0xf84c('0x7'));var path=require(_0xf84c('0x8'));var sox=require('sox');var csv=require(_0xf84c('0x9'));var ejs=require(_0xf84c('0xa'));var fs=require('fs');var fs_extra=require(_0xf84c('0xb'));var _=require(_0xf84c('0xc'));var squel=require('squel');var crypto=require(_0xf84c('0xd'));var jsforce=require(_0xf84c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf84c('0x9'));var querystring=require(_0xf84c('0xf'));var Papa=require(_0xf84c('0x10'));var Redis=require(_0xf84c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf84c('0x12'));var as=require(_0xf84c('0x13'));var hardwareService=require(_0xf84c('0x14'));var logger=require(_0xf84c('0x15'))('api');var utils=require(_0xf84c('0x16'));var config=require(_0xf84c('0x17'));var licenseUtil=require(_0xf84c('0x18'));var db=require(_0xf84c('0x19'))['db'];var jayson=require(_0xf84c('0x1a'));var client=jayson[_0xf84c('0x1b')][_0xf84c('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5eeaa5,_0x38ebfa,_0x4d90e3,_0x11beea){return new BPromise(function(_0x2f20c5,_0x2bcf70){var _0x2baf6f=_0x11beea||client;return _0x2baf6f[_0xf84c('0x1d')](_0x5eeaa5,_0x4d90e3)[_0xf84c('0x1e')](function(_0x5d0788){logger[_0xf84c('0x1f')](_0xf84c('0x20'),_0x38ebfa,_0xf84c('0x21'));logger[_0xf84c('0x22')]('Network,\x20%s,\x20%s,\x20%s',_0x38ebfa,_0xf84c('0x21'),JSON[_0xf84c('0x23')](_0x5d0788));if(_0x5d0788[_0xf84c('0x24')]){if(_0x5d0788[_0xf84c('0x24')][_0xf84c('0x25')]===0x1f4){logger[_0xf84c('0x24')](_0xf84c('0x20'),_0x38ebfa,_0x5d0788[_0xf84c('0x24')]['message']);return _0x2bcf70(_0x5d0788[_0xf84c('0x24')][_0xf84c('0x26')]);}logger[_0xf84c('0x24')](_0xf84c('0x20'),_0x38ebfa,_0x5d0788[_0xf84c('0x24')][_0xf84c('0x26')]);return _0x2f20c5(_0x5d0788[_0xf84c('0x24')][_0xf84c('0x26')]);}else{logger[_0xf84c('0x1f')](_0xf84c('0x20'),_0x38ebfa,_0xf84c('0x21'));_0x2f20c5(_0x5d0788[_0xf84c('0x27')][_0xf84c('0x26')]);}})['catch'](function(_0x474132){logger[_0xf84c('0x24')]('Network,\x20%s,\x20%s',_0x38ebfa,_0x474132);_0x2bcf70(_0x474132);});});}function respondWithStatusCode(_0x5d8a0e,_0x1f1bca){_0x1f1bca=_0x1f1bca||0xcc;return function(_0x39fe1d){if(_0x39fe1d){return _0x5d8a0e[_0xf84c('0x28')](_0x1f1bca);}return _0x5d8a0e[_0xf84c('0x29')](_0x1f1bca)['end']();};}function respondWithResult(_0x497388,_0x44f80a){_0x44f80a=_0x44f80a||0xc8;return function(_0x1c790e){if(_0x1c790e){return _0x497388[_0xf84c('0x29')](_0x44f80a)[_0xf84c('0x2a')](_0x1c790e);}};}function respondWithFilteredResult(_0x40168d,_0x36ab95){return function(_0x5aae8f){if(_0x5aae8f){var _0x831278=typeof _0x36ab95[_0xf84c('0x2b')]===_0xf84c('0x2c')&&typeof _0x36ab95[_0xf84c('0x2d')]===_0xf84c('0x2c');var _0x5c8541=_0x5aae8f[_0xf84c('0x2e')];var _0x55961e=_0x831278?0x0:_0x36ab95[_0xf84c('0x2b')];var _0x2ceab9=_0x831278?_0x5aae8f['count']:_0x36ab95[_0xf84c('0x2b')]+_0x36ab95[_0xf84c('0x2d')];var _0x4c0d84;if(_0x2ceab9>=_0x5c8541){_0x2ceab9=_0x5c8541;_0x4c0d84=0xc8;}else{_0x4c0d84=0xce;}_0x40168d[_0xf84c('0x29')](_0x4c0d84);return _0x40168d[_0xf84c('0x2f')]('Content-Range',_0x55961e+'-'+_0x2ceab9+'/'+_0x5c8541)['json'](_0x5aae8f);}return null;};}function patchUpdates(_0x51567a){return function(_0x97be38){try{jsonpatch[_0xf84c('0x30')](_0x97be38,_0x51567a,!![]);}catch(_0x2ced88){return BPromise[_0xf84c('0x31')](_0x2ced88);}return _0x97be38['save']();};}function saveUpdates(_0x55aa56,_0x97f041){return function(_0x2b3df3){if(_0x2b3df3){return _0x2b3df3[_0xf84c('0x32')](_0x55aa56)[_0xf84c('0x1e')](function(_0x52c77f){return _0x52c77f;});}return null;};}function removeEntity(_0x494db3,_0x167830){return function(_0x4949da){if(_0x4949da){return _0x4949da[_0xf84c('0x33')]()[_0xf84c('0x1e')](function(){_0x494db3[_0xf84c('0x29')](0xcc)[_0xf84c('0x34')]();});}};}function handleEntityNotFound(_0x2f7d0c,_0x2de985){return function(_0x425aa1){if(!_0x425aa1){_0x2f7d0c[_0xf84c('0x28')](0x194);}return _0x425aa1;};}function handleError(_0x243d53,_0x59abea){_0x59abea=_0x59abea||0x1f4;return function(_0x170cf1){logger[_0xf84c('0x24')](_0x170cf1[_0xf84c('0x35')]);if(_0x170cf1[_0xf84c('0x36')]){delete _0x170cf1['name'];}_0x243d53['status'](_0x59abea)[_0xf84c('0x37')](_0x170cf1);};}exports['index']=function(_0x56d37b,_0x269eee){var _0x1173b2={},_0x32529c={},_0x265bbd={'count':0x0,'rows':[]};var _0x2aa05a=_['map'](db['Network'][_0xf84c('0x38')],function(_0x3abae9){return{'name':_0x3abae9[_0xf84c('0x39')],'type':_0x3abae9[_0xf84c('0x3a')][_0xf84c('0x3b')]};});_0x32529c[_0xf84c('0x3c')]=_[_0xf84c('0x3d')](_0x2aa05a,'name');_0x32529c['query']=_[_0xf84c('0x3e')](_0x56d37b[_0xf84c('0x3f')]);_0x32529c['filters']=_[_0xf84c('0x40')](_0x32529c[_0xf84c('0x3c')],_0x32529c['query']);_0x1173b2['attributes']=_[_0xf84c('0x40')](_0x32529c[_0xf84c('0x3c')],qs['fields'](_0x56d37b['query'][_0xf84c('0x41')]));_0x1173b2[_0xf84c('0x42')]=_0x1173b2['attributes'][_0xf84c('0x43')]?_0x1173b2['attributes']:_0x32529c[_0xf84c('0x3c')];if(!_0x56d37b[_0xf84c('0x3f')][_0xf84c('0x44')]('nolimit')){_0x1173b2['limit']=qs[_0xf84c('0x2d')](_0x56d37b[_0xf84c('0x3f')]['limit']);_0x1173b2[_0xf84c('0x2b')]=qs[_0xf84c('0x2b')](_0x56d37b[_0xf84c('0x3f')][_0xf84c('0x2b')]);}_0x1173b2['order']=qs[_0xf84c('0x45')](_0x56d37b[_0xf84c('0x3f')]['sort']);_0x1173b2[_0xf84c('0x46')]=qs[_0xf84c('0x47')](_['pick'](_0x56d37b['query'],_0x32529c['filters']),_0x2aa05a);if(_0x56d37b['query']['filter']){_0x1173b2[_0xf84c('0x46')]=_[_0xf84c('0x48')](_0x1173b2[_0xf84c('0x46')],{'$or':_['map'](_0x2aa05a,function(_0x27cfca){if(_0x27cfca[_0xf84c('0x3a')]!==_0xf84c('0x49')){var _0x22b9b0={};_0x22b9b0[_0x27cfca[_0xf84c('0x36')]]={'$like':'%'+_0x56d37b[_0xf84c('0x3f')]['filter']+'%'};return _0x22b9b0;}})});}_0x1173b2=_[_0xf84c('0x48')]({},_0x1173b2,_0x56d37b[_0xf84c('0x4a')]);var _0xa68abf={'where':_0x1173b2[_0xf84c('0x46')]};return db['Network'][_0xf84c('0x2e')](_0xa68abf)[_0xf84c('0x1e')](function(_0x1e9ca1){_0x265bbd[_0xf84c('0x2e')]=_0x1e9ca1;if(_0x56d37b[_0xf84c('0x3f')][_0xf84c('0x4b')]){_0x1173b2[_0xf84c('0x4c')]=[{'all':!![]}];}return db[_0xf84c('0x4d')]['findAll'](_0x1173b2);})[_0xf84c('0x1e')](function(_0x39b80f){_0x265bbd[_0xf84c('0x4e')]=_0x39b80f;return _0x265bbd;})['then'](respondWithFilteredResult(_0x269eee,_0x1173b2))[_0xf84c('0x4f')](handleError(_0x269eee,null));};exports['show']=function(_0x47d256,_0x48d540){var _0x5873e5={'raw':!![],'where':{'id':_0x47d256[_0xf84c('0x50')]['id']}},_0x4c2ac1={};_0x4c2ac1[_0xf84c('0x3c')]=_['keys'](db['Network'][_0xf84c('0x38')]);_0x4c2ac1[_0xf84c('0x3f')]=_['keys'](_0x47d256[_0xf84c('0x3f')]);_0x4c2ac1[_0xf84c('0x47')]=_[_0xf84c('0x40')](_0x4c2ac1[_0xf84c('0x3c')],_0x4c2ac1[_0xf84c('0x3f')]);_0x5873e5['attributes']=_[_0xf84c('0x40')](_0x4c2ac1[_0xf84c('0x3c')],qs['fields'](_0x47d256[_0xf84c('0x3f')][_0xf84c('0x41')]));_0x5873e5[_0xf84c('0x42')]=_0x5873e5[_0xf84c('0x42')][_0xf84c('0x43')]?_0x5873e5[_0xf84c('0x42')]:_0x4c2ac1[_0xf84c('0x3c')];if(_0x47d256[_0xf84c('0x3f')]['includeAll']){_0x5873e5[_0xf84c('0x4c')]=[{'all':!![]}];}_0x5873e5=_[_0xf84c('0x48')]({},_0x5873e5,_0x47d256['options']);return db['Network']['find'](_0x5873e5)[_0xf84c('0x1e')](handleEntityNotFound(_0x48d540,null))[_0xf84c('0x1e')](respondWithResult(_0x48d540,null))[_0xf84c('0x4f')](handleError(_0x48d540,null));};exports[_0xf84c('0x51')]=function(_0x2a792e,_0x4056bd,_0x31651d){var _0x1bb246;return db['sequelize']['transaction'](function(_0x40ed28){return db['Network'][_0xf84c('0x51')](_0x2a792e[_0xf84c('0x52')],{'raw':!![]})[_0xf84c('0x1e')](function(_0x2e29fa){_0x1bb246=_0x2e29fa;return db['Network'][_0xf84c('0x53')]({'where':{'type':_0x2a792e[_0xf84c('0x52')][_0xf84c('0x3a')]},'raw':!![]});})[_0xf84c('0x1e')](function(_0x59a89a){if(_0x1bb246[_0xf84c('0x3a')][_0xf84c('0x54')]()=='STUN'){var _0x51133c=fs['readFileSync'](path['join'](config['root'],_0xf84c('0x55')),'utf8');var _0x33354c=ejs[_0xf84c('0x56')](_0x51133c,{'networks':_0x59a89a||[]});fs[_0xf84c('0x57')](_0xf84c('0x58'),_0x33354c);return respondWithRpcPromise(_0xf84c('0x59'),'create',{'module':_0xf84c('0x5a')});}else if(_0x1bb246[_0xf84c('0x3a')][_0xf84c('0x54')]()==_0xf84c('0x5b')){var _0x57718e=fs[_0xf84c('0x5c')](path[_0xf84c('0x5d')](config[_0xf84c('0x5e')],_0xf84c('0x5f')),_0xf84c('0x60'));var _0x430d07=ejs[_0xf84c('0x56')](_0x57718e,{'networks':_0x59a89a||[]});fs['writeFileSync'](_0xf84c('0x61'),_0x430d07);return respondWithRpcPromise(_0xf84c('0x59'),_0xf84c('0x51'),{'module':_0xf84c('0x5a')});}else{var _0xcacf28=fs[_0xf84c('0x5c')](path[_0xf84c('0x5d')](config[_0xf84c('0x5e')],_0xf84c('0x62')),_0xf84c('0x60'));var _0x2a77b8=ejs[_0xf84c('0x56')](_0xcacf28,{'networks':_0x59a89a||[]});fs[_0xf84c('0x57')](util['format'](_0xf84c('0x63'),_0x2a792e[_0xf84c('0x52')][_0xf84c('0x3a')][_0xf84c('0x64')]()),_0x2a77b8);return respondWithRpcPromise(_0xf84c('0x59'),'create',{'module':_0xf84c('0x65')});}return null;})[_0xf84c('0x1e')](function(){return _0x1bb246;});})[_0xf84c('0x1e')](respondWithResult(_0x4056bd,0xc9))[_0xf84c('0x4f')](handleError(_0x4056bd,null));};exports[_0xf84c('0x32')]=function(_0x1d9b65,_0x620747,_0x3a6df3){var _0x170d19;return db[_0xf84c('0x66')][_0xf84c('0x67')](function(_0x2d2cda){return db['Network']['find']({'where':{'id':_0x1d9b65[_0xf84c('0x50')]['id']}})[_0xf84c('0x1e')](handleEntityNotFound(_0x620747,null))[_0xf84c('0x1e')](saveUpdates(_0x1d9b65['body'],null))[_0xf84c('0x1e')](function(_0x100237){if(_0x100237){_0x170d19=_0x100237;return db[_0xf84c('0x4d')][_0xf84c('0x53')]({'where':{'type':_0x170d19[_0xf84c('0x3a')]},'raw':!![]});}return null;})[_0xf84c('0x1e')](function(_0x344b1e){if(_0x170d19['type'][_0xf84c('0x54')]()==_0xf84c('0x68')){var _0x819c65=fs[_0xf84c('0x5c')](path[_0xf84c('0x5d')](config[_0xf84c('0x5e')],_0xf84c('0x55')),_0xf84c('0x60'));var _0x23a97f=ejs['render'](_0x819c65,{'networks':_0x344b1e||[]});fs[_0xf84c('0x57')]('/etc/asterisk/stun_xcally.conf',_0x23a97f);return respondWithRpcPromise(_0xf84c('0x59'),_0xf84c('0x32'),{'module':_0xf84c('0x5a')});}else if(_0x170d19[_0xf84c('0x3a')][_0xf84c('0x54')]()==_0xf84c('0x5b')){var _0x34bf3e=fs[_0xf84c('0x5c')](path[_0xf84c('0x5d')](config[_0xf84c('0x5e')],_0xf84c('0x5f')),_0xf84c('0x60'));var _0x3e9d77=ejs[_0xf84c('0x56')](_0x34bf3e,{'networks':_0x344b1e||[]});fs[_0xf84c('0x57')](_0xf84c('0x61'),_0x3e9d77);return respondWithRpcPromise(_0xf84c('0x59'),_0xf84c('0x32'),{'module':_0xf84c('0x5a')});}else{var _0x3a466b=fs[_0xf84c('0x5c')](path[_0xf84c('0x5d')](config[_0xf84c('0x5e')],'server/files/templates/network.ejs'),_0xf84c('0x60'));var _0x3740fb=ejs[_0xf84c('0x56')](_0x3a466b,{'networks':_0x344b1e||[]});fs['writeFileSync'](util[_0xf84c('0x69')](_0xf84c('0x63'),_0x1d9b65[_0xf84c('0x52')][_0xf84c('0x3a')][_0xf84c('0x64')]()),_0x3740fb);return respondWithRpcPromise(_0xf84c('0x59'),_0xf84c('0x32'),{'module':_0xf84c('0x65')});}return null;})[_0xf84c('0x1e')](function(_0x5831a0){if(_0x5831a0){return _0x170d19;}return null;});})[_0xf84c('0x1e')](respondWithResult(_0x620747,null))[_0xf84c('0x4f')](handleError(_0x620747,null));};exports[_0xf84c('0x33')]=function(_0x517e14,_0x2df2f8,_0x119ab5){var _0x21ac5e;return db['Network'][_0xf84c('0x6a')]({'where':{'id':_0x517e14[_0xf84c('0x50')]['id']}})[_0xf84c('0x1e')](function(_0x950e91){_0x21ac5e=_0x950e91;return _0x950e91;})['then'](handleEntityNotFound(_0x2df2f8,null))['then'](removeEntity(_0x2df2f8,null))[_0xf84c('0x1e')](function(){if(_0x21ac5e){return db[_0xf84c('0x4d')][_0xf84c('0x53')]({'where':{'type':_0x21ac5e[_0xf84c('0x3a')]},'raw':!![]});}})[_0xf84c('0x1e')](function(_0x1d43bd){if(_0x21ac5e[_0xf84c('0x3a')]['toUpperCase']()==_0xf84c('0x68')){var _0x122b73=fs[_0xf84c('0x5c')](path[_0xf84c('0x5d')](config[_0xf84c('0x5e')],_0xf84c('0x55')),_0xf84c('0x60'));var _0x117c3b=ejs[_0xf84c('0x56')](_0x122b73,{'networks':_0x1d43bd||[]});fs[_0xf84c('0x57')](_0xf84c('0x58'),_0x117c3b);return respondWithRpcPromise(_0xf84c('0x59'),_0xf84c('0x33'),{'module':'res_stun_monitor.so'});}else if(_0x21ac5e[_0xf84c('0x3a')][_0xf84c('0x54')]()==_0xf84c('0x5b')){var _0x3f3af0=fs[_0xf84c('0x5c')](path[_0xf84c('0x5d')](config[_0xf84c('0x5e')],_0xf84c('0x5f')),_0xf84c('0x60'));var _0x2cf858=ejs[_0xf84c('0x56')](_0x3f3af0,{'networks':_0x1d43bd||[]});fs[_0xf84c('0x57')]('/etc/asterisk/turn_xcally.conf',_0x2cf858);return respondWithRpcPromise(_0xf84c('0x59'),_0xf84c('0x33'),{'module':_0xf84c('0x5a')});}else{var _0x13edab=fs[_0xf84c('0x5c')](path[_0xf84c('0x5d')](config[_0xf84c('0x5e')],_0xf84c('0x62')),'utf8');var _0x3c655b=ejs['render'](_0x13edab,{'networks':_0x1d43bd||[]});fs[_0xf84c('0x57')](util[_0xf84c('0x69')](_0xf84c('0x63'),_0x517e14[_0xf84c('0x52')]['type'][_0xf84c('0x64')]()),_0x3c655b);return respondWithRpcPromise(_0xf84c('0x59'),_0xf84c('0x33'),{'module':_0xf84c('0x65')});}return null;})['catch'](handleError(_0x2df2f8,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index f4d78d9..260a65f 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 _0x0c5d=['api','bluebird','request-promise','path','rimraf','../../config/environment','./network.attributes','exports','define','lodash','util'];(function(_0x5a7a74,_0x2d9172){var _0x5c5d62=function(_0x54873b){while(--_0x54873b){_0x5a7a74['push'](_0x5a7a74['shift']());}};_0x5c5d62(++_0x2d9172);}(_0x0c5d,0x6c));var _0xd0c5=function(_0x518fa0,_0x14d0c0){_0x518fa0=_0x518fa0-0x0;var _0x47bdba=_0x0c5d[_0x518fa0];return _0x47bdba;};'use strict';var _=require(_0xd0c5('0x0'));var util=require(_0xd0c5('0x1'));var logger=require('../../config/logger')(_0xd0c5('0x2'));var moment=require('moment');var BPromise=require(_0xd0c5('0x3'));var rp=require(_0xd0c5('0x4'));var fs=require('fs');var path=require(_0xd0c5('0x5'));var rimraf=require(_0xd0c5('0x6'));var config=require(_0xd0c5('0x7'));var attributes=require(_0xd0c5('0x8'));module[_0xd0c5('0x9')]=function(_0x121911,_0x569992){return _0x121911[_0xd0c5('0xa')]('Network',attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['define','network','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4887a9,_0x4b0d83){var _0x23c160=function(_0x526746){while(--_0x526746){_0x4887a9['push'](_0x4887a9['shift']());}};_0x23c160(++_0x4b0d83);}(_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('./network.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('Network',attributes,{'tableName':_0x0d8b('0x8'),'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 b1143aa..df519ef 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x4fe0ed,_0x5bc963){_0x4fe0ed=_0x4fe0ed-0x0;var _0x1e1bae=_0x7a54[_0x4fe0ed];return _0x1e1bae;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x51ea6b,_0x43b50f){_0x51ea6b=_0x51ea6b-0x0;var _0x3d1e39=_0x7a54[_0x51ea6b];return _0x3d1e39;};'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 6dd1f8b..79adebf 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 _0x1c31=['removeDispositions','removeAnswers','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/applications','/:id/users','getAgents','create','post','addAnswer','/:id/notify','notify','addAgents','/:id/send','send','update','delete','destroy'];(function(_0x4988c7,_0x351403){var _0x2d7a7b=function(_0x1a1590){while(--_0x1a1590){_0x4988c7['push'](_0x4988c7['shift']());}};_0x2d7a7b(++_0x351403);}(_0x1c31,0x1b0));var _0x11c3=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x1c31[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require('multer');var util=require(_0x11c3('0x0'));var path=require(_0x11c3('0x1'));var timeout=require(_0x11c3('0x2'));var express=require(_0x11c3('0x3'));var router=express[_0x11c3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x11c3('0x5'));var interaction=require(_0x11c3('0x6'));var config=require(_0x11c3('0x7'));var controller=require(_0x11c3('0x8'));router[_0x11c3('0x9')]('/',auth[_0x11c3('0xa')](),controller['index']);router[_0x11c3('0x9')](_0x11c3('0xb'),auth[_0x11c3('0xa')](),controller[_0x11c3('0xc')]);router[_0x11c3('0x9')](_0x11c3('0xd'),auth[_0x11c3('0xa')](),controller['show']);router[_0x11c3('0x9')](_0x11c3('0xe'),auth['isAuthenticated'](),controller[_0x11c3('0xf')]);router['get']('/:id/canned_answers',auth[_0x11c3('0xa')](),controller['getAnswers']);router[_0x11c3('0x9')](_0x11c3('0x10'),auth[_0x11c3('0xa')](),controller['getApplications']);router['get']('/:id/interactions',auth['isAuthenticated'](),controller['getInteractions']);router[_0x11c3('0x9')](_0x11c3('0x11'),auth[_0x11c3('0xa')](),controller[_0x11c3('0x12')]);router['post']('/',auth[_0x11c3('0xa')](),controller[_0x11c3('0x13')]);router[_0x11c3('0x14')](_0x11c3('0xe'),auth[_0x11c3('0xa')](),controller['addDisposition']);router[_0x11c3('0x14')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x11c3('0x15')]);router['post'](_0x11c3('0x16'),controller[_0x11c3('0x17')]);router[_0x11c3('0x14')](_0x11c3('0x10'),auth[_0x11c3('0xa')](),controller['addApplications']);router['post'](_0x11c3('0x11'),auth[_0x11c3('0xa')](),controller[_0x11c3('0x18')]);router[_0x11c3('0x14')](_0x11c3('0x19'),auth[_0x11c3('0xa')](),controller[_0x11c3('0x1a')]);router['put'](_0x11c3('0xd'),auth[_0x11c3('0xa')](),controller[_0x11c3('0x1b')]);router[_0x11c3('0x1c')](_0x11c3('0xd'),auth['isAuthenticated'](),controller[_0x11c3('0x1d')]);router[_0x11c3('0x1c')](_0x11c3('0xe'),auth['isAuthenticated'](),controller[_0x11c3('0x1e')]);router[_0x11c3('0x1c')]('/:id/canned_answers',auth[_0x11c3('0xa')](),controller[_0x11c3('0x1f')]);router[_0x11c3('0x1c')](_0x11c3('0x11'),auth[_0x11c3('0xa')](),controller['removeAgents']);module[_0x11c3('0x20')]=router; \ No newline at end of file +var _0xb34c=['describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','create','post','/:id/notify','notify','addAgents','/:id/send','put','/:id','update','destroy','delete','removeDispositions','exports','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','/describe'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb34c,0x1a4));var _0xcb34=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xb34c[_0x432682];return _0x463d05;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcb34('0x0'));var timeout=require(_0xcb34('0x1'));var express=require(_0xcb34('0x2'));var router=express[_0xcb34('0x3')]();var fs_extra=require(_0xcb34('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xcb34('0x5'));var controller=require('./openchannelAccount.controller');router[_0xcb34('0x6')]('/',auth[_0xcb34('0x7')](),controller['index']);router[_0xcb34('0x6')](_0xcb34('0x8'),auth[_0xcb34('0x7')](),controller[_0xcb34('0x9')]);router[_0xcb34('0x6')]('/:id',auth[_0xcb34('0x7')](),controller[_0xcb34('0xa')]);router['get'](_0xcb34('0xb'),auth[_0xcb34('0x7')](),controller[_0xcb34('0xc')]);router[_0xcb34('0x6')](_0xcb34('0xd'),auth[_0xcb34('0x7')](),controller[_0xcb34('0xe')]);router[_0xcb34('0x6')](_0xcb34('0xf'),auth[_0xcb34('0x7')](),controller[_0xcb34('0x10')]);router[_0xcb34('0x6')](_0xcb34('0x11'),auth[_0xcb34('0x7')](),controller[_0xcb34('0x12')]);router['get'](_0xcb34('0x13'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0xcb34('0x7')](),controller[_0xcb34('0x14')]);router[_0xcb34('0x15')]('/:id/dispositions',auth[_0xcb34('0x7')](),controller['addDisposition']);router[_0xcb34('0x15')](_0xcb34('0xd'),auth[_0xcb34('0x7')](),controller['addAnswer']);router[_0xcb34('0x15')](_0xcb34('0x16'),controller[_0xcb34('0x17')]);router[_0xcb34('0x15')](_0xcb34('0xf'),auth['isAuthenticated'](),controller['addApplications']);router['post']('/:id/users',auth[_0xcb34('0x7')](),controller[_0xcb34('0x18')]);router[_0xcb34('0x15')](_0xcb34('0x19'),auth[_0xcb34('0x7')](),controller['send']);router[_0xcb34('0x1a')](_0xcb34('0x1b'),auth['isAuthenticated'](),controller[_0xcb34('0x1c')]);router['delete']('/:id',auth[_0xcb34('0x7')](),controller[_0xcb34('0x1d')]);router[_0xcb34('0x1e')](_0xcb34('0xb'),auth[_0xcb34('0x7')](),controller[_0xcb34('0x1f')]);router[_0xcb34('0x1e')](_0xcb34('0xd'),auth[_0xcb34('0x7')](),controller['removeAnswers']);router[_0xcb34('0x1e')]('/:id/users',auth[_0xcb34('0x7')](),controller['removeAgents']);module[_0xcb34('0x20')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index f6b0e12..2abab4f 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 _0x3b4a=['sequelize','randomstring','exports','name','STRING','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','mandatoryDisposition'];(function(_0xd42641,_0x2c0b99){var _0x2efbfb=function(_0x55d73d){while(--_0x55d73d){_0xd42641['push'](_0xd42641['shift']());}};_0x2efbfb(++_0x2c0b99);}(_0x3b4a,0x1b0));var _0xa3b4=function(_0x457062,_0x1893df){_0x457062=_0x457062-0x0;var _0x4df1a9=_0x3b4a[_0x457062];return _0x4df1a9;};'use strict';var Sequelize=require(_0xa3b4('0x0'));var rs=require(_0xa3b4('0x1'));module[_0xa3b4('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xa3b4('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xa3b4('0x4')]},'token':{'type':Sequelize[_0xa3b4('0x4')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0xa3b4('0x4')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xa3b4('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xa3b4('0x5');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa3b4('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa3b4('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0xa3b4('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa3b4('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa3b4('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0xa3b4('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xa3b4('0x6')],'defaultValue':![],'comment':_0xa3b4('0x9'),'set':function(_0x5afd96){if(!_0x5afd96)this[_0xa3b4('0xa')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0xa3b4('0xb'),_0x5afd96);}}}; \ No newline at end of file +var _0x9b90=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','name','generate'];(function(_0x91f14d,_0x3fb045){var _0x5afda6=function(_0x397230){while(--_0x397230){_0x91f14d['push'](_0x91f14d['shift']());}};_0x5afda6(++_0x3fb045);}(_0x9b90,0x1a9));var _0x09b9=function(_0x578415,_0x4229bd){_0x578415=_0x578415-0x0;var _0x171c0d=_0x9b90[_0x578415];return _0x171c0d;};'use strict';var Sequelize=require(_0x09b9('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x09b9('0x1')],'unique':_0x09b9('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x09b9('0x1')]},'token':{'type':Sequelize[_0x09b9('0x1')],'defaultValue':function(){return rs[_0x09b9('0x3')]();}},'replyUri':{'type':Sequelize[_0x09b9('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x09b9('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x09b9('0x4');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x09b9('0x1')]},'queueTransfer':{'type':Sequelize[_0x09b9('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x09b9('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x09b9('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x09b9('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x09b9('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x09b9('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x144526){if(!_0x144526)this[_0x09b9('0x8')](_0x09b9('0x9'),null);this[_0x09b9('0x8')](_0x09b9('0xa'),_0x144526);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 4165620..1266ef5 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 _0xf9c0=['pick','VIRTUAL','filter','merge','OpenchannelAccount','includeAll','findAll','rows','show','params','mandatoryDispositionPause','rawAttributes','intersection','fields','include','options','find','create','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','Disposition','getDispositions','findOne','hasOwnProperty','OpenchannelAccountId','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','Applications','applications','List','orderBy','asc','account','Contacts','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','sequelize','transaction','OpenchannelApplication','bulkCreate','priority','getApplications','getInteractions','Contact','User','fullname','internal','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','CmList','out','OpenchannelMessage','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','client','http','request','then','info','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','get','OpenchannelAccounts','destroy','stack','name','send','index','Pause','map','fieldName','type','key','model','keys','query','filters','attributes','length','nolimit','order','sort','where'];(function(_0x2be06b,_0x28ddcc){var _0x362130=function(_0x395ad8){while(--_0x395ad8){_0x2be06b['push'](_0x2be06b['shift']());}};_0x362130(++_0x28ddcc);}(_0xf9c0,0x6e));var _0x0f9c=function(_0x10b5fa,_0x3ab3a1){_0x10b5fa=_0x10b5fa-0x0;var _0x16c252=_0xf9c0[_0x10b5fa];return _0x16c252;};'use strict';var emlformat=require(_0x0f9c('0x0'));var rimraf=require(_0x0f9c('0x1'));var zipdir=require(_0x0f9c('0x2'));var jsonpatch=require(_0x0f9c('0x3'));var rp=require(_0x0f9c('0x4'));var moment=require(_0x0f9c('0x5'));var BPromise=require(_0x0f9c('0x6'));var Mustache=require('mustache');var util=require(_0x0f9c('0x7'));var path=require(_0x0f9c('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0f9c('0x9'));var fs=require('fs');var fs_extra=require(_0x0f9c('0xa'));var _=require(_0x0f9c('0xb'));var squel=require(_0x0f9c('0xc'));var crypto=require('crypto');var jsforce=require(_0x0f9c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0f9c('0xe'));var querystring=require(_0x0f9c('0xf'));var Papa=require(_0x0f9c('0x10'));var Redis=require(_0x0f9c('0x11'));var authService=require(_0x0f9c('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0f9c('0x13'));var logger=require(_0x0f9c('0x14'))(_0x0f9c('0x15'));var utils=require('../../config/utils');var config=require(_0x0f9c('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x0f9c('0x17')]=_[_0x0f9c('0x18')](config['redis'],{'host':_0x0f9c('0x19'),'port':0x18eb});var socket=require(_0x0f9c('0x1a'))(new Redis(config[_0x0f9c('0x17')]));require(_0x0f9c('0x1b'))[_0x0f9c('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x0f9c('0x1d')][_0x0f9c('0x1e')]({'port':0x232c});var client9002=jayson[_0x0f9c('0x1d')][_0x0f9c('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x47938a,_0x2e1709,_0x53c7a0,_0x2237cd){return new BPromise(function(_0x3d5ab6,_0x48b100){var _0x2e6eef=_0x2237cd||client;return _0x2e6eef[_0x0f9c('0x1f')](_0x47938a,_0x53c7a0)[_0x0f9c('0x20')](function(_0x450532){logger[_0x0f9c('0x21')]('OpenchannelAccount,\x20%s,\x20%s',_0x2e1709,_0x0f9c('0x22'));logger[_0x0f9c('0x23')](_0x0f9c('0x24'),_0x2e1709,'request\x20sent',JSON['stringify'](_0x450532));if(_0x450532[_0x0f9c('0x25')]){if(_0x450532[_0x0f9c('0x25')][_0x0f9c('0x26')]===0x1f4){logger['error'](_0x0f9c('0x27'),_0x2e1709,_0x450532[_0x0f9c('0x25')][_0x0f9c('0x28')]);return _0x48b100(_0x450532[_0x0f9c('0x25')][_0x0f9c('0x28')]);}logger[_0x0f9c('0x25')](_0x0f9c('0x27'),_0x2e1709,_0x450532[_0x0f9c('0x25')][_0x0f9c('0x28')]);return _0x3d5ab6(_0x450532[_0x0f9c('0x25')][_0x0f9c('0x28')]);}else{logger[_0x0f9c('0x21')]('OpenchannelAccount,\x20%s,\x20%s',_0x2e1709,_0x0f9c('0x22'));_0x3d5ab6(_0x450532[_0x0f9c('0x29')][_0x0f9c('0x28')]);}})[_0x0f9c('0x2a')](function(_0x497c98){logger[_0x0f9c('0x25')](_0x0f9c('0x27'),_0x2e1709,_0x497c98);_0x48b100(_0x497c98);});});}function respondWithStatusCode(_0x1d7b30,_0x522536){_0x522536=_0x522536||0xcc;return function(_0x44efa4){if(_0x44efa4){return _0x1d7b30[_0x0f9c('0x2b')](_0x522536);}return _0x1d7b30['status'](_0x522536)[_0x0f9c('0x2c')]();};}function respondWithResult(_0x1f0b9d,_0x4687d7){_0x4687d7=_0x4687d7||0xc8;return function(_0x386ee3){if(_0x386ee3){return _0x1f0b9d[_0x0f9c('0x2d')](_0x4687d7)[_0x0f9c('0x2e')](_0x386ee3);}};}function respondWithFilteredResult(_0xc8c1dd,_0x38e34c){return function(_0x30e713){if(_0x30e713){var _0x25f886=typeof _0x38e34c['offset']===_0x0f9c('0x2f')&&typeof _0x38e34c[_0x0f9c('0x30')]==='undefined';var _0x3b9506=_0x30e713[_0x0f9c('0x31')];var _0x474d96=_0x25f886?0x0:_0x38e34c['offset'];var _0x40e9fa=_0x25f886?_0x30e713[_0x0f9c('0x31')]:_0x38e34c[_0x0f9c('0x32')]+_0x38e34c[_0x0f9c('0x30')];var _0x5a75de;if(_0x40e9fa>=_0x3b9506){_0x40e9fa=_0x3b9506;_0x5a75de=0xc8;}else{_0x5a75de=0xce;}_0xc8c1dd[_0x0f9c('0x2d')](_0x5a75de);return _0xc8c1dd[_0x0f9c('0x33')](_0x0f9c('0x34'),_0x474d96+'-'+_0x40e9fa+'/'+_0x3b9506)['json'](_0x30e713);}return null;};}function patchUpdates(_0x108728){return function(_0x5c09de){try{jsonpatch[_0x0f9c('0x35')](_0x5c09de,_0x108728,!![]);}catch(_0x280ff6){return BPromise[_0x0f9c('0x36')](_0x280ff6);}return _0x5c09de['save']();};}function saveUpdates(_0x46d78b,_0xc79d08){return function(_0x3d612f){if(_0x3d612f){return _0x3d612f[_0x0f9c('0x37')](_0x46d78b)[_0x0f9c('0x20')](function(_0x3e0d21){return _0x3e0d21;});}return null;};}function removeEntity(_0x525c7a,_0x1b93d8){return function(_0x4a574f){if(_0x4a574f){return _0x4a574f['destroy']()[_0x0f9c('0x20')](function(){var _0xbf41a2=_0x4a574f[_0x0f9c('0x38')]({'plain':!![]});var _0x5e4774=_0x0f9c('0x39');return db['UserProfileResource'][_0x0f9c('0x3a')]({'where':{'type':_0x5e4774,'resourceId':_0xbf41a2['id']}})[_0x0f9c('0x20')](function(){return _0x4a574f;});})[_0x0f9c('0x20')](function(){_0x525c7a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a8528,_0x5ce9ff){return function(_0xc3e081){if(!_0xc3e081){_0x3a8528[_0x0f9c('0x2b')](0x194);}return _0xc3e081;};}function handleError(_0x14a5d6,_0x209f94){_0x209f94=_0x209f94||0x1f4;return function(_0xe6d775){logger['error'](_0xe6d775[_0x0f9c('0x3b')]);if(_0xe6d775[_0x0f9c('0x3c')]){delete _0xe6d775[_0x0f9c('0x3c')];}_0x14a5d6[_0x0f9c('0x2d')](_0x209f94)[_0x0f9c('0x3d')](_0xe6d775);};}exports[_0x0f9c('0x3e')]=function(_0x3d84c5,_0x1937ca){var _0x5cf564={'include':[{'model':db[_0x0f9c('0x3f')],'as':'mandatoryDispositionPause'}]},_0x4587b5={},_0xa79d6f={'count':0x0,'rows':[]};var _0x277c49=_[_0x0f9c('0x40')](db['OpenchannelAccount']['rawAttributes'],function(_0x53fbd0){return{'name':_0x53fbd0[_0x0f9c('0x41')],'type':_0x53fbd0[_0x0f9c('0x42')][_0x0f9c('0x43')]};});_0x4587b5[_0x0f9c('0x44')]=_[_0x0f9c('0x40')](_0x277c49,_0x0f9c('0x3c'));_0x4587b5['query']=_[_0x0f9c('0x45')](_0x3d84c5[_0x0f9c('0x46')]);_0x4587b5[_0x0f9c('0x47')]=_['intersection'](_0x4587b5[_0x0f9c('0x44')],_0x4587b5[_0x0f9c('0x46')]);_0x5cf564[_0x0f9c('0x48')]=_['intersection'](_0x4587b5[_0x0f9c('0x44')],qs['fields'](_0x3d84c5[_0x0f9c('0x46')]['fields']));_0x5cf564['attributes']=_0x5cf564['attributes'][_0x0f9c('0x49')]?_0x5cf564[_0x0f9c('0x48')]:_0x4587b5['model'];if(!_0x3d84c5[_0x0f9c('0x46')]['hasOwnProperty'](_0x0f9c('0x4a'))){_0x5cf564[_0x0f9c('0x30')]=qs[_0x0f9c('0x30')](_0x3d84c5[_0x0f9c('0x46')][_0x0f9c('0x30')]);_0x5cf564[_0x0f9c('0x32')]=qs['offset'](_0x3d84c5['query']['offset']);}_0x5cf564[_0x0f9c('0x4b')]=qs[_0x0f9c('0x4c')](_0x3d84c5[_0x0f9c('0x46')]['sort']);_0x5cf564[_0x0f9c('0x4d')]=qs['filters'](_[_0x0f9c('0x4e')](_0x3d84c5[_0x0f9c('0x46')],_0x4587b5[_0x0f9c('0x47')]),_0x277c49);if(_0x3d84c5[_0x0f9c('0x46')]['filter']){_0x5cf564[_0x0f9c('0x4d')]=_['merge'](_0x5cf564[_0x0f9c('0x4d')],{'$or':_['map'](_0x277c49,function(_0x5cf2fc){if(_0x5cf2fc[_0x0f9c('0x42')]!==_0x0f9c('0x4f')){var _0x4a7576={};_0x4a7576[_0x5cf2fc[_0x0f9c('0x3c')]]={'$like':'%'+_0x3d84c5['query'][_0x0f9c('0x50')]+'%'};return _0x4a7576;}})});}_0x5cf564=_[_0x0f9c('0x51')]({},_0x5cf564,_0x3d84c5['options']);var _0x56d00d={'where':_0x5cf564[_0x0f9c('0x4d')]};return db[_0x0f9c('0x52')][_0x0f9c('0x31')](_0x56d00d)['then'](function(_0x49958f){_0xa79d6f[_0x0f9c('0x31')]=_0x49958f;if(_0x3d84c5['query'][_0x0f9c('0x53')]){_0x5cf564['include']=[{'all':!![]}];}return db[_0x0f9c('0x52')][_0x0f9c('0x54')](_0x5cf564);})[_0x0f9c('0x20')](function(_0x50762a){_0xa79d6f[_0x0f9c('0x55')]=_0x50762a;return _0xa79d6f;})['then'](respondWithFilteredResult(_0x1937ca,_0x5cf564))['catch'](handleError(_0x1937ca,null));};exports[_0x0f9c('0x56')]=function(_0x56f584,_0x1372ad){var _0xadfb4a={'raw':![],'where':{'id':_0x56f584[_0x0f9c('0x57')]['id']},'include':[{'model':db[_0x0f9c('0x3f')],'as':_0x0f9c('0x58')}]},_0x538dfa={};_0x538dfa[_0x0f9c('0x44')]=_[_0x0f9c('0x45')](db['OpenchannelAccount'][_0x0f9c('0x59')]);_0x538dfa[_0x0f9c('0x46')]=_[_0x0f9c('0x45')](_0x56f584[_0x0f9c('0x46')]);_0x538dfa['filters']=_[_0x0f9c('0x5a')](_0x538dfa[_0x0f9c('0x44')],_0x538dfa[_0x0f9c('0x46')]);_0xadfb4a['attributes']=_[_0x0f9c('0x5a')](_0x538dfa[_0x0f9c('0x44')],qs[_0x0f9c('0x5b')](_0x56f584[_0x0f9c('0x46')][_0x0f9c('0x5b')]));_0xadfb4a[_0x0f9c('0x48')]=_0xadfb4a[_0x0f9c('0x48')][_0x0f9c('0x49')]?_0xadfb4a[_0x0f9c('0x48')]:_0x538dfa[_0x0f9c('0x44')];if(_0x56f584['query'][_0x0f9c('0x53')]){_0xadfb4a[_0x0f9c('0x5c')]=[{'all':!![]}];}_0xadfb4a=_[_0x0f9c('0x51')]({},_0xadfb4a,_0x56f584[_0x0f9c('0x5d')]);return db[_0x0f9c('0x52')][_0x0f9c('0x5e')](_0xadfb4a)[_0x0f9c('0x20')](handleEntityNotFound(_0x1372ad,null))['then'](respondWithResult(_0x1372ad,null))[_0x0f9c('0x2a')](handleError(_0x1372ad,null));};exports['create']=function(_0xe9aec7,_0x5688f6){return db['OpenchannelAccount'][_0x0f9c('0x5f')](_0xe9aec7['body'],{})[_0x0f9c('0x20')](function(_0x589ccc){var _0x301c2c=_0xe9aec7['user'][_0x0f9c('0x38')]({'plain':!![]});if(!_0x301c2c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x301c2c[_0x0f9c('0x60')]===_0x0f9c('0x61')){var _0x571e31=_0x589ccc['get']({'plain':!![]});var _0x5a96b5=_0x0f9c('0x39');return db[_0x0f9c('0x62')][_0x0f9c('0x5e')]({'where':{'name':_0x5a96b5,'userProfileId':_0x301c2c[_0x0f9c('0x63')]},'raw':!![]})[_0x0f9c('0x20')](function(_0x41cbb6){if(_0x41cbb6&&_0x41cbb6[_0x0f9c('0x64')]===0x0){return db[_0x0f9c('0x65')][_0x0f9c('0x5f')]({'name':_0x571e31[_0x0f9c('0x3c')],'resourceId':_0x571e31['id'],'type':_0x41cbb6[_0x0f9c('0x3c')],'sectionId':_0x41cbb6['id']},{})[_0x0f9c('0x20')](function(){return _0x589ccc;});}else{return _0x589ccc;}})[_0x0f9c('0x2a')](function(_0x463247){logger['error'](_0x0f9c('0x66'),_0x463247);throw _0x463247;});}return _0x589ccc;})[_0x0f9c('0x20')](respondWithResult(_0x5688f6,0xc9))[_0x0f9c('0x2a')](handleError(_0x5688f6,null));};exports[_0x0f9c('0x37')]=function(_0xed7095,_0x5a9e44){if(_0xed7095[_0x0f9c('0x67')]['id']){delete _0xed7095[_0x0f9c('0x67')]['id'];}return db[_0x0f9c('0x52')][_0x0f9c('0x5e')]({'where':{'id':_0xed7095['params']['id']},'include':[{'model':db[_0x0f9c('0x3f')],'as':_0x0f9c('0x58')}]})[_0x0f9c('0x20')](handleEntityNotFound(_0x5a9e44,null))[_0x0f9c('0x20')](saveUpdates(_0xed7095[_0x0f9c('0x67')],null))[_0x0f9c('0x20')](respondWithResult(_0x5a9e44,null))[_0x0f9c('0x2a')](handleError(_0x5a9e44,null));};exports['destroy']=function(_0x2b8d9b,_0x2a8747){return db[_0x0f9c('0x52')][_0x0f9c('0x5e')]({'where':{'id':_0x2b8d9b['params']['id']}})[_0x0f9c('0x20')](handleEntityNotFound(_0x2a8747,null))[_0x0f9c('0x20')](removeEntity(_0x2a8747,null))[_0x0f9c('0x2a')](handleError(_0x2a8747,null));};exports[_0x0f9c('0x68')]=function(_0x14619c,_0x32ac52){return db[_0x0f9c('0x52')]['describe']()[_0x0f9c('0x20')](respondWithResult(_0x32ac52,null))[_0x0f9c('0x2a')](handleError(_0x32ac52,null));};exports[_0x0f9c('0x69')]=function(_0x3632b1,_0x2dae1f,_0x56bf44){if(_0x3632b1[_0x0f9c('0x67')]['id']){delete _0x3632b1[_0x0f9c('0x67')]['id'];}return db[_0x0f9c('0x52')]['find']({'where':{'id':_0x3632b1[_0x0f9c('0x57')]['id']}})[_0x0f9c('0x20')](handleEntityNotFound(_0x2dae1f,null))['then'](function(_0x456456){if(_0x456456){_0x3632b1['body']['OpenchannelAccountId']=_0x456456['id'];return db[_0x0f9c('0x6a')][_0x0f9c('0x5f')](_0x3632b1[_0x0f9c('0x67')]);}})[_0x0f9c('0x20')](respondWithResult(_0x2dae1f,null))[_0x0f9c('0x2a')](handleError(_0x2dae1f,null));};exports[_0x0f9c('0x6b')]=function(_0x668f69,_0x2b1ecf,_0x102c94){var _0x58c2b7={'raw':![],'where':{}};var _0x2ac08e={};var _0xda66f8={'count':0x0,'rows':[]};return db[_0x0f9c('0x52')][_0x0f9c('0x6c')]({'where':{'id':_0x668f69[_0x0f9c('0x57')]['id']}})[_0x0f9c('0x20')](handleEntityNotFound(_0x2b1ecf,null))['then'](function(_0x54d23b){if(_0x54d23b){_0x2ac08e['model']=_['keys'](db[_0x0f9c('0x6a')][_0x0f9c('0x59')]);_0x2ac08e['query']=_[_0x0f9c('0x45')](_0x668f69[_0x0f9c('0x46')]);_0x2ac08e[_0x0f9c('0x47')]=_[_0x0f9c('0x5a')](_0x2ac08e[_0x0f9c('0x44')],_0x2ac08e[_0x0f9c('0x46')]);_0x58c2b7[_0x0f9c('0x48')]=_[_0x0f9c('0x5a')](_0x2ac08e[_0x0f9c('0x44')],qs[_0x0f9c('0x5b')](_0x668f69[_0x0f9c('0x46')][_0x0f9c('0x5b')]));_0x58c2b7[_0x0f9c('0x48')]=_0x58c2b7[_0x0f9c('0x48')][_0x0f9c('0x49')]?_0x58c2b7[_0x0f9c('0x48')]:_0x2ac08e[_0x0f9c('0x44')];if(!_0x668f69[_0x0f9c('0x46')][_0x0f9c('0x6d')](_0x0f9c('0x4a'))){_0x58c2b7[_0x0f9c('0x30')]=qs['limit'](_0x668f69[_0x0f9c('0x46')]['limit']);_0x58c2b7[_0x0f9c('0x32')]=qs[_0x0f9c('0x32')](_0x668f69['query'][_0x0f9c('0x32')]);}_0x58c2b7[_0x0f9c('0x4b')]=qs[_0x0f9c('0x4c')](_0x668f69[_0x0f9c('0x46')]['sort']);_0x58c2b7['where']=qs[_0x0f9c('0x47')](_[_0x0f9c('0x4e')](_0x668f69['query'],_0x2ac08e[_0x0f9c('0x47')]));_0x58c2b7[_0x0f9c('0x4d')][_0x0f9c('0x6e')]=_0x54d23b['id'];if(_0x668f69[_0x0f9c('0x46')][_0x0f9c('0x50')]){_0x58c2b7[_0x0f9c('0x4d')]=_[_0x0f9c('0x51')](_0x58c2b7[_0x0f9c('0x4d')],{'$or':_[_0x0f9c('0x40')](_0x58c2b7[_0x0f9c('0x48')],function(_0x3ee653){var _0x1cb3ed={};_0x1cb3ed[_0x3ee653]={'$like':'%'+_0x668f69[_0x0f9c('0x46')][_0x0f9c('0x50')]+'%'};return _0x1cb3ed;})});}_0x58c2b7=_[_0x0f9c('0x51')]({},_0x58c2b7,_0x668f69['options']);return db[_0x0f9c('0x6a')][_0x0f9c('0x31')]({'where':_0x58c2b7[_0x0f9c('0x4d')]})[_0x0f9c('0x20')](function(_0x4d37f1){_0xda66f8[_0x0f9c('0x31')]=_0x4d37f1;if(_0x668f69[_0x0f9c('0x46')]['includeAll']){_0x58c2b7['include']=[{'all':!![]}];}return db[_0x0f9c('0x6a')]['findAll'](_0x58c2b7);})[_0x0f9c('0x20')](function(_0x11e745){_0xda66f8[_0x0f9c('0x55')]=_0x11e745;return _0xda66f8;});}})[_0x0f9c('0x20')](respondWithFilteredResult(_0x2b1ecf,_0x58c2b7))[_0x0f9c('0x2a')](handleError(_0x2b1ecf,null));};exports['removeDispositions']=function(_0x71b2a3,_0x11c53a,_0x254f64){return db['OpenchannelAccount']['find']({'where':{'id':_0x71b2a3[_0x0f9c('0x57')]['id']}})['then'](handleEntityNotFound(_0x11c53a,null))['then'](function(_0x8a0697){if(_0x8a0697){return _0x8a0697['removeDispositions'](_0x71b2a3['query'][_0x0f9c('0x6f')]);}})[_0x0f9c('0x20')](respondWithStatusCode(_0x11c53a,null))[_0x0f9c('0x2a')](handleError(_0x11c53a,null));};exports[_0x0f9c('0x70')]=function(_0x12972c,_0x4b64cb,_0x33bbf9){if(_0x12972c[_0x0f9c('0x67')]['id']){delete _0x12972c[_0x0f9c('0x67')]['id'];}return db['OpenchannelAccount'][_0x0f9c('0x5e')]({'where':{'id':_0x12972c[_0x0f9c('0x57')]['id']}})['then'](handleEntityNotFound(_0x4b64cb,null))['then'](function(_0x3282b1){if(_0x3282b1){_0x12972c[_0x0f9c('0x67')][_0x0f9c('0x6e')]=_0x3282b1['id'];return db[_0x0f9c('0x71')][_0x0f9c('0x5f')](_0x12972c[_0x0f9c('0x67')]);}})[_0x0f9c('0x20')](respondWithResult(_0x4b64cb,null))['catch'](handleError(_0x4b64cb,null));};exports[_0x0f9c('0x72')]=function(_0x35f208,_0x563f33,_0x5e223a){var _0x22cec6={'raw':![],'where':{}};var _0x5ebd00={};var _0x1d420={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x0f9c('0x6c')]({'where':{'id':_0x35f208['params']['id']}})[_0x0f9c('0x20')](handleEntityNotFound(_0x563f33,null))['then'](function(_0x22e138){if(_0x22e138){_0x5ebd00['model']=_[_0x0f9c('0x45')](db[_0x0f9c('0x71')][_0x0f9c('0x59')]);_0x5ebd00[_0x0f9c('0x46')]=_[_0x0f9c('0x45')](_0x35f208[_0x0f9c('0x46')]);_0x5ebd00[_0x0f9c('0x47')]=_[_0x0f9c('0x5a')](_0x5ebd00[_0x0f9c('0x44')],_0x5ebd00['query']);_0x22cec6[_0x0f9c('0x48')]=_[_0x0f9c('0x5a')](_0x5ebd00[_0x0f9c('0x44')],qs[_0x0f9c('0x5b')](_0x35f208[_0x0f9c('0x46')][_0x0f9c('0x5b')]));_0x22cec6['attributes']=_0x22cec6[_0x0f9c('0x48')][_0x0f9c('0x49')]?_0x22cec6[_0x0f9c('0x48')]:_0x5ebd00[_0x0f9c('0x44')];if(!_0x35f208['query'][_0x0f9c('0x6d')](_0x0f9c('0x4a'))){_0x22cec6[_0x0f9c('0x30')]=qs['limit'](_0x35f208[_0x0f9c('0x46')][_0x0f9c('0x30')]);_0x22cec6[_0x0f9c('0x32')]=qs['offset'](_0x35f208[_0x0f9c('0x46')][_0x0f9c('0x32')]);}_0x22cec6[_0x0f9c('0x4b')]=qs['sort'](_0x35f208[_0x0f9c('0x46')][_0x0f9c('0x4c')]);_0x22cec6[_0x0f9c('0x4d')]=qs[_0x0f9c('0x47')](_[_0x0f9c('0x4e')](_0x35f208[_0x0f9c('0x46')],_0x5ebd00['filters']));_0x22cec6[_0x0f9c('0x4d')][_0x0f9c('0x6e')]=_0x22e138['id'];if(_0x35f208['query'][_0x0f9c('0x50')]){_0x22cec6[_0x0f9c('0x4d')]=_['merge'](_0x22cec6[_0x0f9c('0x4d')],{'$or':_[_0x0f9c('0x40')](_0x22cec6['attributes'],function(_0x96cdbf){var _0x28dd3a={};_0x28dd3a[_0x96cdbf]={'$like':'%'+_0x35f208[_0x0f9c('0x46')][_0x0f9c('0x50')]+'%'};return _0x28dd3a;})});}_0x22cec6=_[_0x0f9c('0x51')]({},_0x22cec6,_0x35f208[_0x0f9c('0x5d')]);return db[_0x0f9c('0x71')]['count']({'where':_0x22cec6[_0x0f9c('0x4d')]})[_0x0f9c('0x20')](function(_0x13afd4){_0x1d420[_0x0f9c('0x31')]=_0x13afd4;if(_0x35f208[_0x0f9c('0x46')]['includeAll']){_0x22cec6['include']=[{'all':!![]}];}return db[_0x0f9c('0x71')][_0x0f9c('0x54')](_0x22cec6);})[_0x0f9c('0x20')](function(_0x499079){_0x1d420[_0x0f9c('0x55')]=_0x499079;return _0x1d420;});}})['then'](respondWithFilteredResult(_0x563f33,_0x22cec6))[_0x0f9c('0x2a')](handleError(_0x563f33,null));};exports[_0x0f9c('0x73')]=function(_0x37f73e,_0x33ca20,_0x4fd2cd){return db['OpenchannelAccount'][_0x0f9c('0x5e')]({'where':{'id':_0x37f73e['params']['id']}})[_0x0f9c('0x20')](handleEntityNotFound(_0x33ca20,null))[_0x0f9c('0x20')](function(_0x2b4176){if(_0x2b4176){return _0x2b4176[_0x0f9c('0x73')](_0x37f73e[_0x0f9c('0x46')][_0x0f9c('0x6f')]);}})[_0x0f9c('0x20')](respondWithStatusCode(_0x33ca20,null))['catch'](handleError(_0x33ca20,null));};exports[_0x0f9c('0x74')]=function(_0x443b23,_0x275a40,_0x4aa8ce){var _0x9649fe={'body':_0x443b23[_0x0f9c('0x67')],'channel':_0x0f9c('0x75')};var _0x376415=[];var _0x57601a=[];var _0x308925={};var _0x4c627d=![];return db[_0x0f9c('0x76')][_0x0f9c('0x68')]()[_0x0f9c('0x20')](function(_0x49173d){if(!_0x49173d){throw new db[(_0x0f9c('0x77'))][(_0x0f9c('0x78'))]('no\x20available\x20attributes');}_0x376415=_['difference'](_[_0x0f9c('0x45')](_0x49173d),['createdAt','updatedAt']);_0x57601a=_[_0x0f9c('0x79')](_[_0x0f9c('0x45')](_0x49173d),[_0x0f9c('0x7a'),_0x0f9c('0x7b'),_0x0f9c('0x7c'),_0x0f9c('0x7d')]);if(_0x443b23[_0x0f9c('0x67')]['id']){delete _0x443b23[_0x0f9c('0x67')]['id'];}if(_[_0x0f9c('0x7e')](_0x443b23[_0x0f9c('0x67')][_0x0f9c('0x7f')])){throw new db[(_0x0f9c('0x77'))][(_0x0f9c('0x78'))](_0x0f9c('0x80'));}if(_['isNil'](_0x443b23[_0x0f9c('0x67')][_0x0f9c('0x67')])||_0x443b23[_0x0f9c('0x67')]['body']===''){throw new db['Sequelize'][(_0x0f9c('0x78'))](_0x0f9c('0x81'));}if(_['isNil'](_0x443b23['body']['mapKey'])){throw new db[(_0x0f9c('0x77'))][(_0x0f9c('0x78'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x57601a);}if(!_['includes'](_0x57601a,_0x443b23['body']['mapKey'])){throw new db['Sequelize'][(_0x0f9c('0x78'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x57601a);}_0x308925[_0x443b23[_0x0f9c('0x67')][_0x0f9c('0x82')]]=_0x443b23['body'][_0x0f9c('0x7f')];})[_0x0f9c('0x20')](function(){return db['OpenchannelAccount']['find']({'where':{'id':_0x443b23['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':_0x308925,'limit':0x1,'order':[[_0x0f9c('0x7b'),'DESC']]}]},{'model':db['OpenchannelApplication'],'as':_0x0f9c('0x83')}]});})[_0x0f9c('0x20')](handleEntityNotFound(_0x275a40,null))[_0x0f9c('0x20')](function(_0x446055){if(_0x446055&&_0x446055['List']){_0x9649fe['account']=_0x446055;_0x9649fe[_0x0f9c('0x84')]=_0x446055[_0x0f9c('0x83')];_0x9649fe['list']=_0x446055[_0x0f9c('0x85')];_0x9649fe[_0x0f9c('0x84')]=_[_0x0f9c('0x86')](_0x9649fe['applications'],['priority'],[_0x0f9c('0x87')]);if(_0x9649fe[_0x0f9c('0x88')]['Applications']){delete _0x9649fe['account'][_0x0f9c('0x83')];}if(_0x9649fe[_0x0f9c('0x88')][_0x0f9c('0x85')]&&_0x9649fe[_0x0f9c('0x88')]['List'][_0x0f9c('0x89')][_0x0f9c('0x49')]){return _0x9649fe[_0x0f9c('0x88')][_0x0f9c('0x85')][_0x0f9c('0x89')][0x0];}var _0x280e8f=_[_0x0f9c('0x18')](_0x443b23['body'],{'firstName':_0x443b23['body'][_0x0f9c('0x7f')],'ListId':_0x446055[_0x0f9c('0x7d')]});_0x280e8f[_0x443b23[_0x0f9c('0x67')][_0x0f9c('0x82')]]=_0x443b23['body']['from'];return db[_0x0f9c('0x76')]['create'](_0x280e8f,{'fields':_0x376415,'raw':!![]});}})[_0x0f9c('0x20')](handleEntityNotFound(_0x275a40,null))[_0x0f9c('0x20')](function(_0x2a5ca3){_0x9649fe[_0x0f9c('0x8a')]=_0x2a5ca3;if(_0x2a5ca3){var _0x29f9ba={'ContactId':_0x2a5ca3['id'],'OpenchannelAccountId':_0x443b23[_0x0f9c('0x57')]['id'],'from':(_0x2a5ca3[_0x0f9c('0x8b')]||'')+'\x20'+(_0x2a5ca3[_0x0f9c('0x8c')]||'')};var _0x5cd3ad={'OpenchannelAccountId':_0x443b23[_0x0f9c('0x57')]['id'],'closed':![]};if(_0x443b23['body'][_0x0f9c('0x8d')]){_0x5cd3ad[_0x0f9c('0x8d')]=_0x443b23[_0x0f9c('0x67')]['threadId'];return db[_0x0f9c('0x8e')][_0x0f9c('0x5e')]({'where':_0x5cd3ad})['then'](function(_0x315171){if(_0x315171){return[_0x315171,![]];}_0x29f9ba['threadId']=_0x443b23[_0x0f9c('0x67')][_0x0f9c('0x8d')];_0x29f9ba[_0x0f9c('0x8f')]=_0x443b23[_0x0f9c('0x67')]['externalUrl'];return db[_0x0f9c('0x8e')]['create'](_0x29f9ba)[_0x0f9c('0x20')](function(_0x346bbf){return[_0x346bbf,!![]];});});}else{_0x5cd3ad[_0x0f9c('0x8d')]=null;}_0x5cd3ad[_0x0f9c('0x90')]=_0x2a5ca3['id'];return db[_0x0f9c('0x8e')][_0x0f9c('0x5e')]({'where':_0x5cd3ad})[_0x0f9c('0x20')](function(_0x5aa2ee){if(_0x5aa2ee){return[_0x5aa2ee,![]];}return db[_0x0f9c('0x8e')][_0x0f9c('0x5f')](_0x29f9ba)['then'](function(_0x3daeb6){return[_0x3daeb6,!![]];});});}})[_0x0f9c('0x91')](function(_0x5d261a,_0x599f26){if(_0x5d261a){_0x4c627d=_0x599f26;if(!_0x599f26){var _0x306616={'from':(_0x9649fe[_0x0f9c('0x8a')]['firstName']||'')+'\x20'+(_0x9649fe[_0x0f9c('0x8a')]['lastName']||'')};if(_0x443b23[_0x0f9c('0x67')][_0x0f9c('0x8d')]&&_0x443b23['body'][_0x0f9c('0x92')]&&_0x443b23[_0x0f9c('0x67')]['threadId']!=_0x443b23[_0x0f9c('0x67')]['messageId']){_0x306616[_0x0f9c('0x8d')]=_0x443b23[_0x0f9c('0x67')][_0x0f9c('0x92')];}return _0x5d261a[_0x0f9c('0x37')](_0x306616);}else{return _0x5d261a;}}})[_0x0f9c('0x20')](function(_0x514fc6){_0x9649fe[_0x0f9c('0x93')]=_0x514fc6[_0x0f9c('0x38')]({'plain':!![]});_0x9649fe['interaction'][_0x0f9c('0x94')]=_0x4c627d;if(_0x9649fe[_0x0f9c('0x93')][_0x0f9c('0x94')]){if(_0x9649fe[_0x0f9c('0x88')][_0x0f9c('0x95')]){_0x9649fe[_0x0f9c('0x84')][_0x0f9c('0x96')]({'id':0x0,'priority':_0x9649fe[_0x0f9c('0x84')][_0x0f9c('0x49')]+0x1,'app':_0x0f9c('0x97'),'appdata':_0x0f9c('0x98'),'interval':_0x0f9c('0x99')});}}return db['OpenchannelMessage'][_0x0f9c('0x5f')]({'body':_0x443b23[_0x0f9c('0x67')][_0x0f9c('0x67')],'OpenchannelAccountId':_0x443b23[_0x0f9c('0x57')]['id'],'OpenchannelInteractionId':_0x514fc6['id'],'direction':'in','ContactId':_0x9649fe[_0x0f9c('0x8a')]['id'],'AttachmentId':_0x443b23[_0x0f9c('0x67')][_0x0f9c('0x9a')]});})[_0x0f9c('0x20')](function(_0x311f46){_0x9649fe[_0x0f9c('0x28')]=_0x311f46;if(_0x9649fe[_0x0f9c('0x93')][_0x0f9c('0x9b')]){return db['User'][_0x0f9c('0x5e')]({'attributes':['id',_0x0f9c('0x3c')],'where':{'id':_0x9649fe[_0x0f9c('0x93')][_0x0f9c('0x9b')]}})[_0x0f9c('0x20')](function(_0x5188b0){if(_0x5188b0){_0x9649fe[_0x0f9c('0x84')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5188b0['name']+','+(_0x9649fe[_0x0f9c('0x88')][_0x0f9c('0x9c')]||0xa),'interval':_0x0f9c('0x99')});_0x9649fe[_0x0f9c('0x9d')]=![];}return respondWithRpcPromise(_0x0f9c('0x9e'),_0x0f9c('0x9f'),_0x9649fe);});}return respondWithRpcPromise(_0x0f9c('0x9e'),_0x0f9c('0x9f'),_0x9649fe);})[_0x0f9c('0x20')](function(_0x3a2bb7){respondWithRpcPromise('EventManager',_0x0f9c('0xa0'),{'event':'notify','message':_0x3a2bb7},client9002);return _0x3a2bb7;})[_0x0f9c('0x20')](respondWithResult(_0x275a40,null))[_0x0f9c('0x2a')](handleError(_0x275a40,null));};exports['addApplications']=function(_0xa46dbf,_0x43bc01,_0x4ea1d0){return db[_0x0f9c('0x52')][_0x0f9c('0x6c')]({'where':{'id':_0xa46dbf[_0x0f9c('0x57')]['id']}})[_0x0f9c('0x20')](handleEntityNotFound(_0x43bc01,null))[_0x0f9c('0x20')](function(_0xb45ee2){if(_0xb45ee2){return db[_0x0f9c('0xa1')][_0x0f9c('0xa2')](function(_0x5d9673){return db[_0x0f9c('0xa3')]['destroy']({'where':{'OpenchannelAccountId':_0xa46dbf[_0x0f9c('0x57')]['id']},'transaction':_0x5d9673})[_0x0f9c('0x20')](function(_0x5cd4b3){var _0x489f04=_[_0x0f9c('0x40')](_0xa46dbf[_0x0f9c('0x67')],function(_0x582c21){_0x582c21[_0x0f9c('0x6e')]=_0xa46dbf[_0x0f9c('0x57')]['id'];return _0x582c21;});return db[_0x0f9c('0xa3')][_0x0f9c('0xa4')](_0x489f04,{'transaction':_0x5d9673});});})[_0x0f9c('0x20')](function(){return db[_0x0f9c('0xa3')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0xa46dbf[_0x0f9c('0x57')]['id']},'order':_0x0f9c('0xa5')});});}})[_0x0f9c('0x20')](respondWithResult(_0x43bc01,null))[_0x0f9c('0x2a')](handleError(_0x43bc01,null));};exports[_0x0f9c('0xa6')]=function(_0x168323,_0x515400,_0x6dc974){var _0x5f16d8={};var _0x50d1fa={};var _0x2324e1;var _0x143c54;return db['OpenchannelAccount'][_0x0f9c('0x6c')]({'where':{'id':_0x168323[_0x0f9c('0x57')]['id']}})['then'](handleEntityNotFound(_0x515400,null))[_0x0f9c('0x20')](function(_0x1d8612){if(_0x1d8612){_0x2324e1=_0x1d8612;_0x50d1fa[_0x0f9c('0x44')]=_[_0x0f9c('0x45')](db[_0x0f9c('0xa3')][_0x0f9c('0x59')]);_0x50d1fa[_0x0f9c('0x46')]=_[_0x0f9c('0x45')](_0x168323[_0x0f9c('0x46')]);_0x50d1fa[_0x0f9c('0x47')]=_['intersection'](_0x50d1fa[_0x0f9c('0x44')],_0x50d1fa[_0x0f9c('0x46')]);_0x5f16d8['attributes']=_[_0x0f9c('0x5a')](_0x50d1fa[_0x0f9c('0x44')],qs[_0x0f9c('0x5b')](_0x168323[_0x0f9c('0x46')][_0x0f9c('0x5b')]));_0x5f16d8[_0x0f9c('0x48')]=_0x5f16d8[_0x0f9c('0x48')][_0x0f9c('0x49')]?_0x5f16d8[_0x0f9c('0x48')]:_0x50d1fa[_0x0f9c('0x44')];_0x5f16d8[_0x0f9c('0x4b')]=qs[_0x0f9c('0x4c')](_0x168323[_0x0f9c('0x46')][_0x0f9c('0x4c')]);_0x5f16d8[_0x0f9c('0x4d')]=qs[_0x0f9c('0x47')](_[_0x0f9c('0x4e')](_0x168323[_0x0f9c('0x46')],_0x50d1fa[_0x0f9c('0x47')]));if(_0x168323['query'][_0x0f9c('0x50')]){_0x5f16d8['where']=_[_0x0f9c('0x51')](_0x5f16d8[_0x0f9c('0x4d')],{'$or':_[_0x0f9c('0x40')](_0x5f16d8['attributes'],function(_0xebc700){var _0x4bd10b={};_0x4bd10b[_0xebc700]={'$like':'%'+_0x168323[_0x0f9c('0x46')][_0x0f9c('0x50')]+'%'};return _0x4bd10b;})});}_0x5f16d8=_[_0x0f9c('0x51')]({},_0x5f16d8,_0x168323[_0x0f9c('0x5d')]);return _0x2324e1[_0x0f9c('0xa6')](_0x5f16d8);}})[_0x0f9c('0x20')](function(_0x42a40d){if(_0x42a40d){_0x143c54=_0x42a40d[_0x0f9c('0x49')];if(!_0x168323[_0x0f9c('0x46')][_0x0f9c('0x6d')](_0x0f9c('0x4a'))){_0x5f16d8[_0x0f9c('0x30')]=qs[_0x0f9c('0x30')](_0x168323['query'][_0x0f9c('0x30')]);_0x5f16d8['offset']=qs['offset'](_0x168323[_0x0f9c('0x46')][_0x0f9c('0x32')]);}return _0x2324e1[_0x0f9c('0xa6')](_0x5f16d8);}})[_0x0f9c('0x20')](function(_0x3e2cb1){if(_0x3e2cb1){return _0x3e2cb1?{'count':_0x143c54,'rows':_0x3e2cb1}:null;}})['then'](respondWithResult(_0x515400,null))[_0x0f9c('0x2a')](handleError(_0x515400,null));};exports[_0x0f9c('0xa7')]=function(_0x2255fb,_0x2544c3,_0x20ac43){var _0x69dcb6={'raw':![],'where':{}};var _0x3e6f4c={};var _0x53ef1d={'count':0x0,'rows':[]};return db[_0x0f9c('0x52')][_0x0f9c('0x6c')]({'where':{'id':_0x2255fb[_0x0f9c('0x57')]['id']}})[_0x0f9c('0x20')](handleEntityNotFound(_0x2544c3,null))['then'](function(_0x2e375a){if(_0x2e375a){_0x3e6f4c['model']=_[_0x0f9c('0x45')](db[_0x0f9c('0x8e')][_0x0f9c('0x59')]);_0x3e6f4c[_0x0f9c('0x46')]=_['keys'](_0x2255fb['query']);_0x3e6f4c[_0x0f9c('0x47')]=_[_0x0f9c('0x5a')](_0x3e6f4c['model'],_0x3e6f4c['query']);_0x69dcb6[_0x0f9c('0x48')]=_[_0x0f9c('0x5a')](_0x3e6f4c[_0x0f9c('0x44')],qs['fields'](_0x2255fb[_0x0f9c('0x46')][_0x0f9c('0x5b')]));_0x69dcb6['attributes']=_0x69dcb6[_0x0f9c('0x48')][_0x0f9c('0x49')]?_0x69dcb6[_0x0f9c('0x48')]:_0x3e6f4c[_0x0f9c('0x44')];if(!_0x2255fb['query'][_0x0f9c('0x6d')](_0x0f9c('0x4a'))){_0x69dcb6['limit']=qs[_0x0f9c('0x30')](_0x2255fb['query'][_0x0f9c('0x30')]);_0x69dcb6[_0x0f9c('0x32')]=qs[_0x0f9c('0x32')](_0x2255fb[_0x0f9c('0x46')]['offset']);}_0x69dcb6[_0x0f9c('0x4b')]=qs[_0x0f9c('0x4c')](_0x2255fb['query'][_0x0f9c('0x4c')]);_0x69dcb6[_0x0f9c('0x4d')]=qs[_0x0f9c('0x47')](_[_0x0f9c('0x4e')](_0x2255fb[_0x0f9c('0x46')],_0x3e6f4c[_0x0f9c('0x47')]));_0x69dcb6[_0x0f9c('0x4d')]['OpenchannelAccountId']=_0x2e375a['id'];if(_0x2255fb['query']['filter']){_0x69dcb6['where']=_[_0x0f9c('0x51')](_0x69dcb6['where'],{'$or':_[_0x0f9c('0x40')](_0x69dcb6[_0x0f9c('0x48')],function(_0x207446){var _0x1ba629={};_0x1ba629[_0x207446]={'$like':'%'+_0x2255fb[_0x0f9c('0x46')][_0x0f9c('0x50')]+'%'};return _0x1ba629;})});}_0x69dcb6=_[_0x0f9c('0x51')]({},_0x69dcb6,_0x2255fb[_0x0f9c('0x5d')]);return db[_0x0f9c('0x8e')]['count']({'where':_0x69dcb6[_0x0f9c('0x4d')]})[_0x0f9c('0x20')](function(_0x1abaee){_0x53ef1d['count']=_0x1abaee;if(_0x2255fb[_0x0f9c('0x46')][_0x0f9c('0x53')]){_0x69dcb6[_0x0f9c('0x5c')]=[{'model':db[_0x0f9c('0x76')],'as':_0x0f9c('0xa8'),'required':![]},{'model':db[_0x0f9c('0xa9')],'as':'Owner','attributes':['name',_0x0f9c('0xaa'),_0x0f9c('0xab')],'required':![]},{'model':db['Tag'],'as':_0x0f9c('0xac'),'attributes':['id',_0x0f9c('0x3c'),_0x0f9c('0xad')],'where':_0x2255fb[_0x0f9c('0x46')][_0x0f9c('0xae')]?{'id':_0x2255fb['query'][_0x0f9c('0xae')]}:undefined,'required':_0x2255fb['query'][_0x0f9c('0xae')]?!![]:![]}];}return db[_0x0f9c('0x8e')]['findAll'](_0x69dcb6);})[_0x0f9c('0x20')](function(_0x17afb3){_0x53ef1d[_0x0f9c('0x55')]=_0x17afb3;return _0x53ef1d;});}})['then'](respondWithFilteredResult(_0x2544c3,_0x69dcb6))[_0x0f9c('0x2a')](handleError(_0x2544c3,null));};exports[_0x0f9c('0xaf')]=function(_0x350fc9,_0x11485c,_0x4b4cdd){return db[_0x0f9c('0x52')][_0x0f9c('0x5e')]({'where':{'id':_0x350fc9['params']['id']}})[_0x0f9c('0x20')](handleEntityNotFound(_0x11485c,null))[_0x0f9c('0x20')](function(_0x191d7f){if(_0x191d7f){return _0x191d7f[_0x0f9c('0xaf')](_0x350fc9[_0x0f9c('0x67')][_0x0f9c('0x6f')],_[_0x0f9c('0xb0')](_0x350fc9[_0x0f9c('0x67')],[_0x0f9c('0x6f'),'id'])||{})[_0x0f9c('0x91')](function(_0x3c810f){for(var _0x161853=0x0;_0x161853<_0x350fc9['body'][_0x0f9c('0x6f')][_0x0f9c('0x49')];_0x161853+=0x1){socket[_0x0f9c('0xb1')](_0x0f9c('0xb2'),{'UserId':Number(_0x350fc9[_0x0f9c('0x67')]['ids'][_0x161853]),'OpenchannelAccountId':Number(_0x350fc9[_0x0f9c('0x57')]['id'])});}return _0x3c810f;});}})['then'](respondWithResult(_0x11485c,null))[_0x0f9c('0x2a')](handleError(_0x11485c,null));};exports[_0x0f9c('0xb3')]=function(_0xb691d4,_0x388f10,_0xb96243){return db['OpenchannelAccount'][_0x0f9c('0x5e')]({'where':{'id':_0xb691d4[_0x0f9c('0x57')]['id']}})[_0x0f9c('0x20')](handleEntityNotFound(_0x388f10,null))[_0x0f9c('0x20')](function(_0x53c3aa){if(_0x53c3aa){return _0x53c3aa[_0x0f9c('0xb3')](_0xb691d4[_0x0f9c('0x46')][_0x0f9c('0x6f')])[_0x0f9c('0x20')](function(){if(_[_0x0f9c('0xb4')](_0xb691d4[_0x0f9c('0x46')]['ids'])){for(var _0x5c7eff=0x0;_0x5c7eff<_0xb691d4[_0x0f9c('0x46')]['ids'][_0x0f9c('0x49')];_0x5c7eff+=0x1){socket[_0x0f9c('0xb1')](_0x0f9c('0xb5'),{'UserId':Number(_0xb691d4[_0x0f9c('0x46')][_0x0f9c('0x6f')][_0x5c7eff]),'OpenchannelAccountId':Number(_0xb691d4[_0x0f9c('0x57')]['id'])});}}else{socket['emit'](_0x0f9c('0xb5'),{'UserId':Number(_0xb691d4[_0x0f9c('0x46')][_0x0f9c('0x6f')]),'OpenchannelAccountId':Number(_0xb691d4['params']['id'])});}});}})[_0x0f9c('0x20')](respondWithStatusCode(_0x388f10,null))['catch'](handleError(_0x388f10,null));};exports[_0x0f9c('0xb6')]=function(_0x6c3c00,_0x3f32ff,_0x54381e){var _0x38f37c={};var _0x85c248={};var _0x43aa2f;var _0x492215;return db[_0x0f9c('0x52')][_0x0f9c('0x6c')]({'where':{'id':_0x6c3c00[_0x0f9c('0x57')]['id']}})[_0x0f9c('0x20')](handleEntityNotFound(_0x3f32ff,null))[_0x0f9c('0x20')](function(_0x2cceab){if(_0x2cceab){_0x43aa2f=_0x2cceab;_0x85c248[_0x0f9c('0x44')]=_[_0x0f9c('0x45')](db[_0x0f9c('0xa9')][_0x0f9c('0x59')]);_0x85c248[_0x0f9c('0x46')]=_[_0x0f9c('0x45')](_0x6c3c00[_0x0f9c('0x46')]);_0x85c248[_0x0f9c('0x47')]=_[_0x0f9c('0x5a')](_0x85c248['model'],_0x85c248[_0x0f9c('0x46')]);_0x38f37c[_0x0f9c('0x48')]=_[_0x0f9c('0x5a')](_0x85c248[_0x0f9c('0x44')],qs['fields'](_0x6c3c00[_0x0f9c('0x46')][_0x0f9c('0x5b')]));_0x38f37c[_0x0f9c('0x48')]=_0x38f37c[_0x0f9c('0x48')][_0x0f9c('0x49')]?_0x38f37c[_0x0f9c('0x48')]:_0x85c248['model'];_0x38f37c['order']=qs[_0x0f9c('0x4c')](_0x6c3c00[_0x0f9c('0x46')][_0x0f9c('0x4c')]);_0x38f37c[_0x0f9c('0x4d')]=qs[_0x0f9c('0x47')](_[_0x0f9c('0x4e')](_0x6c3c00[_0x0f9c('0x46')],_0x85c248[_0x0f9c('0x47')]));if(_0x6c3c00[_0x0f9c('0x46')][_0x0f9c('0x50')]){_0x38f37c[_0x0f9c('0x4d')]=_[_0x0f9c('0x51')](_0x38f37c[_0x0f9c('0x4d')],{'$or':_[_0x0f9c('0x40')](_0x38f37c['attributes'],function(_0x4521c9){var _0x254a0b={};_0x254a0b[_0x4521c9]={'$like':'%'+_0x6c3c00[_0x0f9c('0x46')][_0x0f9c('0x50')]+'%'};return _0x254a0b;})});}_0x38f37c=_[_0x0f9c('0x51')]({},_0x38f37c,_0x6c3c00[_0x0f9c('0x5d')]);return _0x43aa2f['getAgents'](_0x38f37c);}})[_0x0f9c('0x20')](function(_0x20a47d){if(_0x20a47d){_0x492215=_0x20a47d[_0x0f9c('0x49')];if(!_0x6c3c00[_0x0f9c('0x46')][_0x0f9c('0x6d')](_0x0f9c('0x4a'))){_0x38f37c[_0x0f9c('0x30')]=qs[_0x0f9c('0x30')](_0x6c3c00[_0x0f9c('0x46')]['limit']);_0x38f37c[_0x0f9c('0x32')]=qs[_0x0f9c('0x32')](_0x6c3c00[_0x0f9c('0x46')][_0x0f9c('0x32')]);}return _0x43aa2f[_0x0f9c('0xb6')](_0x38f37c);}})[_0x0f9c('0x20')](function(_0x43c492){if(_0x43c492){return _0x43c492?{'count':_0x492215,'rows':_0x43c492}:null;}})['then'](respondWithResult(_0x3f32ff,null))[_0x0f9c('0x2a')](handleError(_0x3f32ff,null));};exports[_0x0f9c('0x3d')]=function(_0x2d9057,_0x5ccd51,_0x555cd2){var _0x4bddbd,_0x5508fc,_0x5a889f;if(_['isNil'](_0x2d9057[_0x0f9c('0x67')][_0x0f9c('0x67')])||_0x2d9057[_0x0f9c('0x67')][_0x0f9c('0x67')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x0f9c('0x7e')](_0x2d9057[_0x0f9c('0x67')]['to'])){}_0x4bddbd=_0x2d9057[_0x0f9c('0x67')]['to'];return db['OpenchannelAccount'][_0x0f9c('0x6c')]({'where':{'id':_0x2d9057[_0x0f9c('0x57')]['id']}})[_0x0f9c('0x20')](handleEntityNotFound(_0x5ccd51,null))[_0x0f9c('0x20')](function(_0x4998e8){if(_0x4998e8){return db[_0x0f9c('0x52')][_0x0f9c('0x5e')]({'where':{'id':_0x4998e8['id']},'include':[{'model':db[_0x0f9c('0xb7')],'as':_0x0f9c('0x85'),'include':[{'model':db[_0x0f9c('0x76')],'as':_0x0f9c('0x89'),'where':{[_0x4998e8[_0x0f9c('0x82')]]:_0x4bddbd},'limit':0x1,'order':[[_0x0f9c('0x7b'),'DESC']]}]}]})[_0x0f9c('0x20')](handleEntityNotFound(_0x5ccd51,null))['then'](function(_0x32f18f){if(_0x32f18f&&_0x32f18f[_0x0f9c('0x85')]){_0x5508fc=_0x32f18f[_0x0f9c('0x38')]({'plain':!![]});if(_0x5508fc[_0x0f9c('0x85')]&&_0x5508fc[_0x0f9c('0x85')]['Contacts']['length']){return _0x5508fc[_0x0f9c('0x85')][_0x0f9c('0x89')][0x0];}return db[_0x0f9c('0x76')][_0x0f9c('0x5f')](_['defaults'](_0x2d9057[_0x0f9c('0x67')],{'firstName':_0x4bddbd,[_0x32f18f[_0x0f9c('0x82')]]:_0x4bddbd,'phone':_0x4bddbd,'ListId':_0x5508fc[_0x0f9c('0x7d')]}));}})[_0x0f9c('0x20')](handleEntityNotFound(_0x5ccd51,null))[_0x0f9c('0x20')](function(_0x1f8619){if(_0x1f8619){_0x5a889f=_0x1f8619;return db[_0x0f9c('0x8e')][_0x0f9c('0x5e')]({'where':{'ContactId':_0x5a889f['id'],'closed':![],'OpenchannelAccountId':_0x5508fc['id']}})['then'](function(_0x4d3686){if(_0x4d3686){return[_0x4d3686,![]];}return db[_0x0f9c('0x8e')]['create']({'UserId':_0x2d9057[_0x0f9c('0x61')]['id'],'ContactId':_0x5a889f['id'],'OpenchannelAccountId':_0x5508fc['id'],'lastMsgDirection':_0x0f9c('0xb8'),'Messages':[_[_0x0f9c('0x51')](_0x2d9057[_0x0f9c('0x67')],{'read':![],'body':_0x2d9057[_0x0f9c('0x67')][_0x0f9c('0x67')],'OpenchannelAccountId':_0x5508fc['id'],'UserId':_0x2d9057['user']['id'],'ContactId':_0x5a889f['id']})]},{'include':[{'model':db[_0x0f9c('0xb9')],'as':_0x0f9c('0xba')}]})[_0x0f9c('0x20')](function(_0x592e41){return[_0x592e41,!![]];});});}})['spread'](function(_0x1c0e85,_0x347962){if(_0x347962){return _0x1c0e85;}return db[_0x0f9c('0xb9')][_0x0f9c('0x5f')](_['merge'](_0x2d9057[_0x0f9c('0x67')],{'read':![],'body':_0x2d9057[_0x0f9c('0x67')][_0x0f9c('0x67')],'OpenchannelAccountId':_0x5508fc['id'],'OpenchannelInteractionId':_0x1c0e85['id'],'UserId':_0x2d9057[_0x0f9c('0x61')]['id'],'ContactId':_0x5a889f['id']}))['then'](function(_0x43d7a2){_0x1c0e85[_0x0f9c('0xbb')][_0x0f9c('0xba')]=[];_0x1c0e85[_0x0f9c('0xbb')][_0x0f9c('0xba')][_0x0f9c('0x96')](_0x43d7a2[_0x0f9c('0xbb')]);return _0x1c0e85;});});}})[_0x0f9c('0x20')](respondWithResult(_0x5ccd51,null))[_0x0f9c('0x2a')](handleError(_0x5ccd51,null));}; \ No newline at end of file +var _0x0789=['sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','Pause','mandatoryDispositionPause','keys','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','rows','ids','addAnswer','getAnswers','CannedAnswer','length','removeAnswers','notify','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','ValidationError','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','DESC','OpenchannelApplication','Applications','account','list','applications','orderBy','priority','asc','Contacts','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','messageId','interaction','created','push','close','*,*,*,*','OpenchannelMessage','AttachmentId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','findOne','getApplications','hasOwnProperty','getInteractions','Contact','fullname','internal','color','tag','addAgents','omit','spread','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','Messages','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','message','result','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','update','then','destroy','get','OpenchannelAccounts','stack','name','send','index','OpenchannelAccount','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','nolimit','order'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x0789,0x132));var _0x9078=function(_0x5b3d9c,_0x40421a){_0x5b3d9c=_0x5b3d9c-0x0;var _0x5cdb6f=_0x0789[_0x5b3d9c];return _0x5cdb6f;};'use strict';var emlformat=require(_0x9078('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9078('0x1'));var jsonpatch=require(_0x9078('0x2'));var rp=require(_0x9078('0x3'));var moment=require('moment');var BPromise=require(_0x9078('0x4'));var Mustache=require(_0x9078('0x5'));var util=require(_0x9078('0x6'));var path=require(_0x9078('0x7'));var sox=require(_0x9078('0x8'));var csv=require('to-csv');var ejs=require(_0x9078('0x9'));var fs=require('fs');var fs_extra=require(_0x9078('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9078('0xb'));var deskjs=require(_0x9078('0xc'));var toCsv=require(_0x9078('0xd'));var querystring=require(_0x9078('0xe'));var Papa=require(_0x9078('0xf'));var Redis=require('ioredis');var authService=require(_0x9078('0x10'));var qs=require(_0x9078('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9078('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x9078('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x9078('0x14'));var db=require(_0x9078('0x15'))['db'];config['redis']=_[_0x9078('0x16')](config[_0x9078('0x17')],{'host':_0x9078('0x18'),'port':0x18eb});var socket=require(_0x9078('0x19'))(new Redis(config[_0x9078('0x17')]));require(_0x9078('0x1a'))[_0x9078('0x1b')](socket);var jayson=require(_0x9078('0x1c'));var client=jayson[_0x9078('0x1d')][_0x9078('0x1e')]({'port':0x232c});var client9002=jayson[_0x9078('0x1d')][_0x9078('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x221c3e,_0x3bd04c,_0x31b46e,_0x12290d){return new BPromise(function(_0x263634,_0x9d35e8){var _0x4e2085=_0x12290d||client;return _0x4e2085[_0x9078('0x1f')](_0x221c3e,_0x31b46e)['then'](function(_0xe8bc62){logger[_0x9078('0x20')](_0x9078('0x21'),_0x3bd04c,_0x9078('0x22'));logger[_0x9078('0x23')](_0x9078('0x24'),_0x3bd04c,'request\x20sent',JSON['stringify'](_0xe8bc62));if(_0xe8bc62[_0x9078('0x25')]){if(_0xe8bc62[_0x9078('0x25')]['code']===0x1f4){logger[_0x9078('0x25')](_0x9078('0x21'),_0x3bd04c,_0xe8bc62[_0x9078('0x25')][_0x9078('0x26')]);return _0x9d35e8(_0xe8bc62[_0x9078('0x25')]['message']);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x3bd04c,_0xe8bc62[_0x9078('0x25')][_0x9078('0x26')]);return _0x263634(_0xe8bc62['error'][_0x9078('0x26')]);}else{logger[_0x9078('0x20')]('OpenchannelAccount,\x20%s,\x20%s',_0x3bd04c,'request\x20sent');_0x263634(_0xe8bc62[_0x9078('0x27')][_0x9078('0x26')]);}})['catch'](function(_0x47183c){logger[_0x9078('0x25')](_0x9078('0x21'),_0x3bd04c,_0x47183c);_0x9d35e8(_0x47183c);});});}function respondWithStatusCode(_0xd5a1b9,_0x590484){_0x590484=_0x590484||0xcc;return function(_0x2f8157){if(_0x2f8157){return _0xd5a1b9[_0x9078('0x28')](_0x590484);}return _0xd5a1b9[_0x9078('0x29')](_0x590484)[_0x9078('0x2a')]();};}function respondWithResult(_0x48fb28,_0x15cd6e){_0x15cd6e=_0x15cd6e||0xc8;return function(_0x1a9a6e){if(_0x1a9a6e){return _0x48fb28[_0x9078('0x29')](_0x15cd6e)[_0x9078('0x2b')](_0x1a9a6e);}};}function respondWithFilteredResult(_0x5b271d,_0xee391f){return function(_0x4889db){if(_0x4889db){var _0x3b0e87=typeof _0xee391f['offset']===_0x9078('0x2c')&&typeof _0xee391f['limit']==='undefined';var _0x4415f4=_0x4889db[_0x9078('0x2d')];var _0x4244f6=_0x3b0e87?0x0:_0xee391f[_0x9078('0x2e')];var _0x519b8a=_0x3b0e87?_0x4889db[_0x9078('0x2d')]:_0xee391f[_0x9078('0x2e')]+_0xee391f[_0x9078('0x2f')];var _0x2246cc;if(_0x519b8a>=_0x4415f4){_0x519b8a=_0x4415f4;_0x2246cc=0xc8;}else{_0x2246cc=0xce;}_0x5b271d[_0x9078('0x29')](_0x2246cc);return _0x5b271d[_0x9078('0x30')](_0x9078('0x31'),_0x4244f6+'-'+_0x519b8a+'/'+_0x4415f4)[_0x9078('0x2b')](_0x4889db);}return null;};}function patchUpdates(_0x588266){return function(_0x4bb7b0){try{jsonpatch[_0x9078('0x32')](_0x4bb7b0,_0x588266,!![]);}catch(_0x55c738){return BPromise['reject'](_0x55c738);}return _0x4bb7b0['save']();};}function saveUpdates(_0x1f775b,_0x330a74){return function(_0x5540c0){if(_0x5540c0){return _0x5540c0[_0x9078('0x33')](_0x1f775b)[_0x9078('0x34')](function(_0x9cc5f3){return _0x9cc5f3;});}return null;};}function removeEntity(_0x18f0e5,_0x29c5a7){return function(_0x202629){if(_0x202629){return _0x202629[_0x9078('0x35')]()[_0x9078('0x34')](function(){var _0x4f802c=_0x202629[_0x9078('0x36')]({'plain':!![]});var _0x11a63c=_0x9078('0x37');return db['UserProfileResource'][_0x9078('0x35')]({'where':{'type':_0x11a63c,'resourceId':_0x4f802c['id']}})[_0x9078('0x34')](function(){return _0x202629;});})[_0x9078('0x34')](function(){_0x18f0e5[_0x9078('0x29')](0xcc)[_0x9078('0x2a')]();});}};}function handleEntityNotFound(_0x1b316a,_0x431694){return function(_0x3fddb6){if(!_0x3fddb6){_0x1b316a[_0x9078('0x28')](0x194);}return _0x3fddb6;};}function handleError(_0x5816ae,_0x2c73f9){_0x2c73f9=_0x2c73f9||0x1f4;return function(_0x536afc){logger[_0x9078('0x25')](_0x536afc[_0x9078('0x38')]);if(_0x536afc[_0x9078('0x39')]){delete _0x536afc['name'];}_0x5816ae[_0x9078('0x29')](_0x2c73f9)[_0x9078('0x3a')](_0x536afc);};}exports[_0x9078('0x3b')]=function(_0x35fc30,_0x2d09ae){var _0x34e444={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x9d341={},_0x3bf169={'count':0x0,'rows':[]};var _0x34f2c0=_['map'](db[_0x9078('0x3c')][_0x9078('0x3d')],function(_0x1d3edd){return{'name':_0x1d3edd[_0x9078('0x3e')],'type':_0x1d3edd[_0x9078('0x3f')][_0x9078('0x40')]};});_0x9d341[_0x9078('0x41')]=_[_0x9078('0x42')](_0x34f2c0,_0x9078('0x39'));_0x9d341[_0x9078('0x43')]=_['keys'](_0x35fc30['query']);_0x9d341[_0x9078('0x44')]=_[_0x9078('0x45')](_0x9d341[_0x9078('0x41')],_0x9d341[_0x9078('0x43')]);_0x34e444['attributes']=_[_0x9078('0x45')](_0x9d341[_0x9078('0x41')],qs[_0x9078('0x46')](_0x35fc30[_0x9078('0x43')]['fields']));_0x34e444[_0x9078('0x47')]=_0x34e444[_0x9078('0x47')]['length']?_0x34e444[_0x9078('0x47')]:_0x9d341[_0x9078('0x41')];if(!_0x35fc30[_0x9078('0x43')]['hasOwnProperty'](_0x9078('0x48'))){_0x34e444[_0x9078('0x2f')]=qs[_0x9078('0x2f')](_0x35fc30[_0x9078('0x43')]['limit']);_0x34e444[_0x9078('0x2e')]=qs['offset'](_0x35fc30[_0x9078('0x43')][_0x9078('0x2e')]);}_0x34e444[_0x9078('0x49')]=qs[_0x9078('0x4a')](_0x35fc30[_0x9078('0x43')][_0x9078('0x4a')]);_0x34e444[_0x9078('0x4b')]=qs[_0x9078('0x44')](_[_0x9078('0x4c')](_0x35fc30[_0x9078('0x43')],_0x9d341[_0x9078('0x44')]),_0x34f2c0);if(_0x35fc30[_0x9078('0x43')]['filter']){_0x34e444[_0x9078('0x4b')]=_[_0x9078('0x4d')](_0x34e444[_0x9078('0x4b')],{'$or':_['map'](_0x34f2c0,function(_0x2c1cce){if(_0x2c1cce[_0x9078('0x3f')]!==_0x9078('0x4e')){var _0x597d15={};_0x597d15[_0x2c1cce[_0x9078('0x39')]]={'$like':'%'+_0x35fc30[_0x9078('0x43')][_0x9078('0x4f')]+'%'};return _0x597d15;}})});}_0x34e444=_['merge']({},_0x34e444,_0x35fc30[_0x9078('0x50')]);var _0x4daecc={'where':_0x34e444[_0x9078('0x4b')]};return db[_0x9078('0x3c')]['count'](_0x4daecc)[_0x9078('0x34')](function(_0x47d1f3){_0x3bf169[_0x9078('0x2d')]=_0x47d1f3;if(_0x35fc30['query'][_0x9078('0x51')]){_0x34e444['include']=[{'all':!![]}];}return db[_0x9078('0x3c')][_0x9078('0x52')](_0x34e444);})['then'](function(_0x40a9f5){_0x3bf169['rows']=_0x40a9f5;return _0x3bf169;})[_0x9078('0x34')](respondWithFilteredResult(_0x2d09ae,_0x34e444))[_0x9078('0x53')](handleError(_0x2d09ae,null));};exports[_0x9078('0x54')]=function(_0x30acb2,_0xaf50d4){var _0x104f18={'raw':![],'where':{'id':_0x30acb2[_0x9078('0x55')]['id']},'include':[{'model':db[_0x9078('0x56')],'as':_0x9078('0x57')}]},_0x3469eb={};_0x3469eb[_0x9078('0x41')]=_[_0x9078('0x58')](db['OpenchannelAccount']['rawAttributes']);_0x3469eb[_0x9078('0x43')]=_[_0x9078('0x58')](_0x30acb2[_0x9078('0x43')]);_0x3469eb['filters']=_[_0x9078('0x45')](_0x3469eb[_0x9078('0x41')],_0x3469eb['query']);_0x104f18[_0x9078('0x47')]=_[_0x9078('0x45')](_0x3469eb['model'],qs[_0x9078('0x46')](_0x30acb2[_0x9078('0x43')]['fields']));_0x104f18[_0x9078('0x47')]=_0x104f18[_0x9078('0x47')]['length']?_0x104f18[_0x9078('0x47')]:_0x3469eb['model'];if(_0x30acb2[_0x9078('0x43')][_0x9078('0x51')]){_0x104f18[_0x9078('0x59')]=[{'all':!![]}];}_0x104f18=_['merge']({},_0x104f18,_0x30acb2[_0x9078('0x50')]);return db[_0x9078('0x3c')][_0x9078('0x5a')](_0x104f18)[_0x9078('0x34')](handleEntityNotFound(_0xaf50d4,null))[_0x9078('0x34')](respondWithResult(_0xaf50d4,null))[_0x9078('0x53')](handleError(_0xaf50d4,null));};exports[_0x9078('0x5b')]=function(_0x418f7b,_0x39f048){return db[_0x9078('0x3c')]['create'](_0x418f7b[_0x9078('0x5c')],{})[_0x9078('0x34')](function(_0x39af05){var _0x1f0c87=_0x418f7b[_0x9078('0x5d')][_0x9078('0x36')]({'plain':!![]});if(!_0x1f0c87)throw new Error(_0x9078('0x5e'));if(_0x1f0c87[_0x9078('0x5f')]===_0x9078('0x5d')){var _0x4da46a=_0x39af05['get']({'plain':!![]});var _0x4b8284=_0x9078('0x37');return db[_0x9078('0x60')][_0x9078('0x5a')]({'where':{'name':_0x4b8284,'userProfileId':_0x1f0c87[_0x9078('0x61')]},'raw':!![]})['then'](function(_0x27ef54){if(_0x27ef54&&_0x27ef54[_0x9078('0x62')]===0x0){return db[_0x9078('0x63')][_0x9078('0x5b')]({'name':_0x4da46a[_0x9078('0x39')],'resourceId':_0x4da46a['id'],'type':_0x27ef54['name'],'sectionId':_0x27ef54['id']},{})[_0x9078('0x34')](function(){return _0x39af05;});}else{return _0x39af05;}})['catch'](function(_0x410ec6){logger[_0x9078('0x25')](_0x9078('0x64'),_0x410ec6);throw _0x410ec6;});}return _0x39af05;})[_0x9078('0x34')](respondWithResult(_0x39f048,0xc9))[_0x9078('0x53')](handleError(_0x39f048,null));};exports[_0x9078('0x33')]=function(_0x148b06,_0x4a4cc5){if(_0x148b06[_0x9078('0x5c')]['id']){delete _0x148b06[_0x9078('0x5c')]['id'];}return db['OpenchannelAccount'][_0x9078('0x5a')]({'where':{'id':_0x148b06[_0x9078('0x55')]['id']},'include':[{'model':db[_0x9078('0x56')],'as':_0x9078('0x57')}]})['then'](handleEntityNotFound(_0x4a4cc5,null))[_0x9078('0x34')](saveUpdates(_0x148b06[_0x9078('0x5c')],null))[_0x9078('0x34')](respondWithResult(_0x4a4cc5,null))[_0x9078('0x53')](handleError(_0x4a4cc5,null));};exports[_0x9078('0x35')]=function(_0x3ed41e,_0x164cd4){return db[_0x9078('0x3c')][_0x9078('0x5a')]({'where':{'id':_0x3ed41e['params']['id']}})[_0x9078('0x34')](handleEntityNotFound(_0x164cd4,null))[_0x9078('0x34')](removeEntity(_0x164cd4,null))[_0x9078('0x53')](handleError(_0x164cd4,null));};exports[_0x9078('0x65')]=function(_0x9bb78c,_0x3efd2a){return db['OpenchannelAccount'][_0x9078('0x65')]()[_0x9078('0x34')](respondWithResult(_0x3efd2a,null))['catch'](handleError(_0x3efd2a,null));};exports[_0x9078('0x66')]=function(_0x17d8f3,_0x5f1027,_0xeae8c5){if(_0x17d8f3[_0x9078('0x5c')]['id']){delete _0x17d8f3[_0x9078('0x5c')]['id'];}return db['OpenchannelAccount'][_0x9078('0x5a')]({'where':{'id':_0x17d8f3['params']['id']}})[_0x9078('0x34')](handleEntityNotFound(_0x5f1027,null))['then'](function(_0x114b25){if(_0x114b25){_0x17d8f3[_0x9078('0x5c')][_0x9078('0x67')]=_0x114b25['id'];return db[_0x9078('0x68')][_0x9078('0x5b')](_0x17d8f3[_0x9078('0x5c')]);}})[_0x9078('0x34')](respondWithResult(_0x5f1027,null))[_0x9078('0x53')](handleError(_0x5f1027,null));};exports[_0x9078('0x69')]=function(_0xcfce5f,_0x2273ae,_0x4c54a1){var _0x13eb0a={'raw':![],'where':{}};var _0x14b771={};var _0x45a408={'count':0x0,'rows':[]};return db[_0x9078('0x3c')]['findOne']({'where':{'id':_0xcfce5f[_0x9078('0x55')]['id']}})[_0x9078('0x34')](handleEntityNotFound(_0x2273ae,null))['then'](function(_0x3ac308){if(_0x3ac308){_0x14b771['model']=_[_0x9078('0x58')](db[_0x9078('0x68')][_0x9078('0x3d')]);_0x14b771[_0x9078('0x43')]=_[_0x9078('0x58')](_0xcfce5f[_0x9078('0x43')]);_0x14b771[_0x9078('0x44')]=_['intersection'](_0x14b771[_0x9078('0x41')],_0x14b771[_0x9078('0x43')]);_0x13eb0a['attributes']=_[_0x9078('0x45')](_0x14b771[_0x9078('0x41')],qs['fields'](_0xcfce5f[_0x9078('0x43')][_0x9078('0x46')]));_0x13eb0a[_0x9078('0x47')]=_0x13eb0a[_0x9078('0x47')]['length']?_0x13eb0a[_0x9078('0x47')]:_0x14b771['model'];if(!_0xcfce5f[_0x9078('0x43')]['hasOwnProperty']('nolimit')){_0x13eb0a['limit']=qs[_0x9078('0x2f')](_0xcfce5f[_0x9078('0x43')][_0x9078('0x2f')]);_0x13eb0a[_0x9078('0x2e')]=qs[_0x9078('0x2e')](_0xcfce5f[_0x9078('0x43')][_0x9078('0x2e')]);}_0x13eb0a['order']=qs[_0x9078('0x4a')](_0xcfce5f['query'][_0x9078('0x4a')]);_0x13eb0a[_0x9078('0x4b')]=qs[_0x9078('0x44')](_[_0x9078('0x4c')](_0xcfce5f[_0x9078('0x43')],_0x14b771[_0x9078('0x44')]));_0x13eb0a['where']['OpenchannelAccountId']=_0x3ac308['id'];if(_0xcfce5f['query'][_0x9078('0x4f')]){_0x13eb0a[_0x9078('0x4b')]=_[_0x9078('0x4d')](_0x13eb0a[_0x9078('0x4b')],{'$or':_['map'](_0x13eb0a[_0x9078('0x47')],function(_0x2cf84c){var _0x2e640c={};_0x2e640c[_0x2cf84c]={'$like':'%'+_0xcfce5f['query'][_0x9078('0x4f')]+'%'};return _0x2e640c;})});}_0x13eb0a=_[_0x9078('0x4d')]({},_0x13eb0a,_0xcfce5f[_0x9078('0x50')]);return db[_0x9078('0x68')][_0x9078('0x2d')]({'where':_0x13eb0a[_0x9078('0x4b')]})[_0x9078('0x34')](function(_0x1562d7){_0x45a408[_0x9078('0x2d')]=_0x1562d7;if(_0xcfce5f[_0x9078('0x43')][_0x9078('0x51')]){_0x13eb0a['include']=[{'all':!![]}];}return db[_0x9078('0x68')][_0x9078('0x52')](_0x13eb0a);})[_0x9078('0x34')](function(_0x8e2afb){_0x45a408[_0x9078('0x6a')]=_0x8e2afb;return _0x45a408;});}})[_0x9078('0x34')](respondWithFilteredResult(_0x2273ae,_0x13eb0a))[_0x9078('0x53')](handleError(_0x2273ae,null));};exports['removeDispositions']=function(_0x50fe7b,_0x245a4f,_0x5880bf){return db[_0x9078('0x3c')][_0x9078('0x5a')]({'where':{'id':_0x50fe7b[_0x9078('0x55')]['id']}})[_0x9078('0x34')](handleEntityNotFound(_0x245a4f,null))['then'](function(_0x561ce6){if(_0x561ce6){return _0x561ce6['removeDispositions'](_0x50fe7b[_0x9078('0x43')][_0x9078('0x6b')]);}})[_0x9078('0x34')](respondWithStatusCode(_0x245a4f,null))[_0x9078('0x53')](handleError(_0x245a4f,null));};exports[_0x9078('0x6c')]=function(_0x1448a5,_0x30b1da,_0x46eb0f){if(_0x1448a5[_0x9078('0x5c')]['id']){delete _0x1448a5[_0x9078('0x5c')]['id'];}return db[_0x9078('0x3c')][_0x9078('0x5a')]({'where':{'id':_0x1448a5[_0x9078('0x55')]['id']}})[_0x9078('0x34')](handleEntityNotFound(_0x30b1da,null))[_0x9078('0x34')](function(_0x44ba1e){if(_0x44ba1e){_0x1448a5[_0x9078('0x5c')][_0x9078('0x67')]=_0x44ba1e['id'];return db['CannedAnswer']['create'](_0x1448a5[_0x9078('0x5c')]);}})[_0x9078('0x34')](respondWithResult(_0x30b1da,null))[_0x9078('0x53')](handleError(_0x30b1da,null));};exports[_0x9078('0x6d')]=function(_0x563bd6,_0x4ce448,_0x510995){var _0x2e4013={'raw':![],'where':{}};var _0x253c49={};var _0x3d913a={'count':0x0,'rows':[]};return db[_0x9078('0x3c')]['findOne']({'where':{'id':_0x563bd6[_0x9078('0x55')]['id']}})[_0x9078('0x34')](handleEntityNotFound(_0x4ce448,null))['then'](function(_0xd117aa){if(_0xd117aa){_0x253c49[_0x9078('0x41')]=_[_0x9078('0x58')](db[_0x9078('0x6e')]['rawAttributes']);_0x253c49[_0x9078('0x43')]=_[_0x9078('0x58')](_0x563bd6[_0x9078('0x43')]);_0x253c49[_0x9078('0x44')]=_[_0x9078('0x45')](_0x253c49['model'],_0x253c49[_0x9078('0x43')]);_0x2e4013[_0x9078('0x47')]=_[_0x9078('0x45')](_0x253c49[_0x9078('0x41')],qs[_0x9078('0x46')](_0x563bd6[_0x9078('0x43')][_0x9078('0x46')]));_0x2e4013[_0x9078('0x47')]=_0x2e4013['attributes'][_0x9078('0x6f')]?_0x2e4013['attributes']:_0x253c49[_0x9078('0x41')];if(!_0x563bd6[_0x9078('0x43')]['hasOwnProperty'](_0x9078('0x48'))){_0x2e4013['limit']=qs[_0x9078('0x2f')](_0x563bd6[_0x9078('0x43')]['limit']);_0x2e4013['offset']=qs[_0x9078('0x2e')](_0x563bd6[_0x9078('0x43')][_0x9078('0x2e')]);}_0x2e4013['order']=qs['sort'](_0x563bd6[_0x9078('0x43')]['sort']);_0x2e4013[_0x9078('0x4b')]=qs[_0x9078('0x44')](_[_0x9078('0x4c')](_0x563bd6['query'],_0x253c49['filters']));_0x2e4013[_0x9078('0x4b')]['OpenchannelAccountId']=_0xd117aa['id'];if(_0x563bd6[_0x9078('0x43')][_0x9078('0x4f')]){_0x2e4013['where']=_[_0x9078('0x4d')](_0x2e4013['where'],{'$or':_[_0x9078('0x42')](_0x2e4013['attributes'],function(_0x52e8cc){var _0xc810d4={};_0xc810d4[_0x52e8cc]={'$like':'%'+_0x563bd6[_0x9078('0x43')][_0x9078('0x4f')]+'%'};return _0xc810d4;})});}_0x2e4013=_[_0x9078('0x4d')]({},_0x2e4013,_0x563bd6['options']);return db[_0x9078('0x6e')]['count']({'where':_0x2e4013['where']})[_0x9078('0x34')](function(_0x4a09aa){_0x3d913a['count']=_0x4a09aa;if(_0x563bd6[_0x9078('0x43')][_0x9078('0x51')]){_0x2e4013[_0x9078('0x59')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x2e4013);})['then'](function(_0x49e82d){_0x3d913a[_0x9078('0x6a')]=_0x49e82d;return _0x3d913a;});}})[_0x9078('0x34')](respondWithFilteredResult(_0x4ce448,_0x2e4013))[_0x9078('0x53')](handleError(_0x4ce448,null));};exports[_0x9078('0x70')]=function(_0x45b05b,_0x2e759c,_0x380930){return db[_0x9078('0x3c')][_0x9078('0x5a')]({'where':{'id':_0x45b05b['params']['id']}})[_0x9078('0x34')](handleEntityNotFound(_0x2e759c,null))['then'](function(_0x5bebc1){if(_0x5bebc1){return _0x5bebc1[_0x9078('0x70')](_0x45b05b[_0x9078('0x43')]['ids']);}})[_0x9078('0x34')](respondWithStatusCode(_0x2e759c,null))[_0x9078('0x53')](handleError(_0x2e759c,null));};exports[_0x9078('0x71')]=function(_0x42a9dc,_0x5961fb,_0x5ae456){var _0x165f2e={'body':_0x42a9dc[_0x9078('0x5c')],'channel':'openchannel'};var _0x51f0fa=[];var _0x18084e=[];var _0x3047f1={};var _0x32c563=![];return db[_0x9078('0x72')][_0x9078('0x65')]()['then'](function(_0x58d9db){if(!_0x58d9db){throw new db[(_0x9078('0x73'))]['ValidationError'](_0x9078('0x74'));}_0x51f0fa=_[_0x9078('0x75')](_[_0x9078('0x58')](_0x58d9db),[_0x9078('0x76'),_0x9078('0x77')]);_0x18084e=_[_0x9078('0x75')](_[_0x9078('0x58')](_0x58d9db),[_0x9078('0x76'),_0x9078('0x77'),_0x9078('0x78'),_0x9078('0x79')]);if(_0x42a9dc[_0x9078('0x5c')]['id']){delete _0x42a9dc[_0x9078('0x5c')]['id'];}if(_['isNil'](_0x42a9dc[_0x9078('0x5c')][_0x9078('0x7a')])){throw new db[(_0x9078('0x73'))][(_0x9078('0x7b'))](_0x9078('0x7c'));}if(_[_0x9078('0x7d')](_0x42a9dc[_0x9078('0x5c')][_0x9078('0x5c')])||_0x42a9dc[_0x9078('0x5c')][_0x9078('0x5c')]===''){throw new db[(_0x9078('0x73'))][(_0x9078('0x7b'))](_0x9078('0x7e'));}if(_[_0x9078('0x7d')](_0x42a9dc[_0x9078('0x5c')][_0x9078('0x7f')])){throw new db['Sequelize'][(_0x9078('0x7b'))](_0x9078('0x80')+_0x18084e);}if(!_[_0x9078('0x81')](_0x18084e,_0x42a9dc[_0x9078('0x5c')][_0x9078('0x7f')])){throw new db[(_0x9078('0x73'))][(_0x9078('0x7b'))](_0x9078('0x82')+_0x18084e);}_0x3047f1[_0x42a9dc['body'][_0x9078('0x7f')]]=_0x42a9dc[_0x9078('0x5c')]['from'];})[_0x9078('0x34')](function(){return db[_0x9078('0x3c')][_0x9078('0x5a')]({'where':{'id':_0x42a9dc[_0x9078('0x55')]['id']},'include':[{'model':db[_0x9078('0x83')],'as':_0x9078('0x84'),'include':[{'model':db[_0x9078('0x72')],'as':'Contacts','where':_0x3047f1,'limit':0x1,'order':[[_0x9078('0x77'),_0x9078('0x85')]]}]},{'model':db[_0x9078('0x86')],'as':_0x9078('0x87')}]});})[_0x9078('0x34')](handleEntityNotFound(_0x5961fb,null))[_0x9078('0x34')](function(_0x4f956b){if(_0x4f956b&&_0x4f956b[_0x9078('0x84')]){_0x165f2e[_0x9078('0x88')]=_0x4f956b;_0x165f2e['applications']=_0x4f956b[_0x9078('0x87')];_0x165f2e[_0x9078('0x89')]=_0x4f956b[_0x9078('0x84')];_0x165f2e[_0x9078('0x8a')]=_[_0x9078('0x8b')](_0x165f2e[_0x9078('0x8a')],[_0x9078('0x8c')],[_0x9078('0x8d')]);if(_0x165f2e[_0x9078('0x88')][_0x9078('0x87')]){delete _0x165f2e['account'][_0x9078('0x87')];}if(_0x165f2e[_0x9078('0x88')][_0x9078('0x84')]&&_0x165f2e['account'][_0x9078('0x84')][_0x9078('0x8e')]['length']){return _0x165f2e['account'][_0x9078('0x84')]['Contacts'][0x0];}var _0x8d9208=_[_0x9078('0x16')](_0x42a9dc[_0x9078('0x5c')],{'firstName':_0x42a9dc[_0x9078('0x5c')][_0x9078('0x7a')],'ListId':_0x4f956b[_0x9078('0x79')]});_0x8d9208[_0x42a9dc['body'][_0x9078('0x7f')]]=_0x42a9dc[_0x9078('0x5c')][_0x9078('0x7a')];return db[_0x9078('0x72')][_0x9078('0x5b')](_0x8d9208,{'fields':_0x51f0fa,'raw':!![]});}})[_0x9078('0x34')](handleEntityNotFound(_0x5961fb,null))[_0x9078('0x34')](function(_0x122eb0){_0x165f2e[_0x9078('0x8f')]=_0x122eb0;if(_0x122eb0){var _0x100e47={'ContactId':_0x122eb0['id'],'OpenchannelAccountId':_0x42a9dc['params']['id'],'from':(_0x122eb0[_0x9078('0x90')]||'')+'\x20'+(_0x122eb0[_0x9078('0x91')]||'')};var _0x19e36c={'OpenchannelAccountId':_0x42a9dc[_0x9078('0x55')]['id'],'closed':![]};if(_0x42a9dc[_0x9078('0x5c')][_0x9078('0x92')]){_0x19e36c[_0x9078('0x92')]=_0x42a9dc[_0x9078('0x5c')][_0x9078('0x92')];return db[_0x9078('0x93')][_0x9078('0x5a')]({'where':_0x19e36c})[_0x9078('0x34')](function(_0x260746){if(_0x260746){return[_0x260746,![]];}_0x100e47[_0x9078('0x92')]=_0x42a9dc['body'][_0x9078('0x92')];_0x100e47['externalUrl']=_0x42a9dc[_0x9078('0x5c')][_0x9078('0x94')];return db[_0x9078('0x93')][_0x9078('0x5b')](_0x100e47)['then'](function(_0x494aad){return[_0x494aad,!![]];});});}else{_0x19e36c['threadId']=null;}_0x19e36c[_0x9078('0x95')]=_0x122eb0['id'];return db[_0x9078('0x93')][_0x9078('0x5a')]({'where':_0x19e36c})[_0x9078('0x34')](function(_0x244ca6){if(_0x244ca6){return[_0x244ca6,![]];}return db[_0x9078('0x93')]['create'](_0x100e47)[_0x9078('0x34')](function(_0x13b9cb){return[_0x13b9cb,!![]];});});}})['spread'](function(_0x422151,_0xf10a51){if(_0x422151){_0x32c563=_0xf10a51;if(!_0xf10a51){var _0x54fd58={'from':(_0x165f2e['contact'][_0x9078('0x90')]||'')+'\x20'+(_0x165f2e['contact'][_0x9078('0x91')]||'')};if(_0x42a9dc['body']['threadId']&&_0x42a9dc[_0x9078('0x5c')][_0x9078('0x96')]&&_0x42a9dc['body']['threadId']!=_0x42a9dc[_0x9078('0x5c')][_0x9078('0x96')]){_0x54fd58['threadId']=_0x42a9dc['body'][_0x9078('0x96')];}return _0x422151['update'](_0x54fd58);}else{return _0x422151;}}})[_0x9078('0x34')](function(_0x291866){_0x165f2e[_0x9078('0x97')]=_0x291866[_0x9078('0x36')]({'plain':!![]});_0x165f2e['interaction'][_0x9078('0x98')]=_0x32c563;if(_0x165f2e[_0x9078('0x97')][_0x9078('0x98')]){if(_0x165f2e[_0x9078('0x88')]['autoclose']){_0x165f2e[_0x9078('0x8a')][_0x9078('0x99')]({'id':0x0,'priority':_0x165f2e[_0x9078('0x8a')]['length']+0x1,'app':_0x9078('0x9a'),'appdata':'unmanaged','interval':_0x9078('0x9b')});}}return db[_0x9078('0x9c')][_0x9078('0x5b')]({'body':_0x42a9dc[_0x9078('0x5c')][_0x9078('0x5c')],'OpenchannelAccountId':_0x42a9dc[_0x9078('0x55')]['id'],'OpenchannelInteractionId':_0x291866['id'],'direction':'in','ContactId':_0x165f2e[_0x9078('0x8f')]['id'],'AttachmentId':_0x42a9dc[_0x9078('0x5c')][_0x9078('0x9d')]});})[_0x9078('0x34')](function(_0x41d6cd){_0x165f2e[_0x9078('0x26')]=_0x41d6cd;if(_0x165f2e[_0x9078('0x97')]['UserId']){return db['User'][_0x9078('0x5a')]({'attributes':['id','name'],'where':{'id':_0x165f2e[_0x9078('0x97')]['UserId']}})[_0x9078('0x34')](function(_0x306b45){if(_0x306b45){_0x165f2e['applications'][_0x9078('0x9e')]({'id':0x0,'priority':0x0,'app':_0x9078('0x9f'),'appdata':_0x306b45[_0x9078('0x39')]+','+(_0x165f2e[_0x9078('0x88')][_0x9078('0xa0')]||0xa),'interval':_0x9078('0x9b')});_0x165f2e[_0x9078('0xa1')]=![];}return respondWithRpcPromise('Start',_0x9078('0xa2'),_0x165f2e);});}return respondWithRpcPromise(_0x9078('0xa3'),_0x9078('0xa2'),_0x165f2e);})[_0x9078('0x34')](function(_0x2a3016){respondWithRpcPromise(_0x9078('0xa4'),_0x9078('0xa4'),{'event':_0x9078('0x71'),'message':_0x2a3016},client9002);return _0x2a3016;})[_0x9078('0x34')](respondWithResult(_0x5961fb,null))[_0x9078('0x53')](handleError(_0x5961fb,null));};exports[_0x9078('0xa5')]=function(_0x243a31,_0x56b995,_0xe4b7b4){return db[_0x9078('0x3c')]['findOne']({'where':{'id':_0x243a31[_0x9078('0x55')]['id']}})['then'](handleEntityNotFound(_0x56b995,null))[_0x9078('0x34')](function(_0x55c9ad){if(_0x55c9ad){return db[_0x9078('0xa6')][_0x9078('0xa7')](function(_0x4141ff){return db[_0x9078('0x86')][_0x9078('0x35')]({'where':{'OpenchannelAccountId':_0x243a31[_0x9078('0x55')]['id']},'transaction':_0x4141ff})['then'](function(_0x8747dd){var _0x1688d6=_[_0x9078('0x42')](_0x243a31[_0x9078('0x5c')],function(_0x1bc514){_0x1bc514[_0x9078('0x67')]=_0x243a31[_0x9078('0x55')]['id'];return _0x1bc514;});return db[_0x9078('0x86')][_0x9078('0xa8')](_0x1688d6,{'transaction':_0x4141ff});});})[_0x9078('0x34')](function(){return db[_0x9078('0x86')][_0x9078('0xa9')]({'where':{'OpenchannelAccountId':_0x243a31['params']['id']},'order':_0x9078('0x8c')});});}})[_0x9078('0x34')](respondWithResult(_0x56b995,null))[_0x9078('0x53')](handleError(_0x56b995,null));};exports['getApplications']=function(_0x3a86d7,_0xf5c71f,_0x2647ce){var _0x33d57d={};var _0x3e81ea={};var _0x2592d0;var _0x2ae526;return db[_0x9078('0x3c')][_0x9078('0xaa')]({'where':{'id':_0x3a86d7['params']['id']}})[_0x9078('0x34')](handleEntityNotFound(_0xf5c71f,null))[_0x9078('0x34')](function(_0x3d7d63){if(_0x3d7d63){_0x2592d0=_0x3d7d63;_0x3e81ea['model']=_[_0x9078('0x58')](db[_0x9078('0x86')][_0x9078('0x3d')]);_0x3e81ea[_0x9078('0x43')]=_[_0x9078('0x58')](_0x3a86d7[_0x9078('0x43')]);_0x3e81ea[_0x9078('0x44')]=_[_0x9078('0x45')](_0x3e81ea[_0x9078('0x41')],_0x3e81ea[_0x9078('0x43')]);_0x33d57d[_0x9078('0x47')]=_['intersection'](_0x3e81ea[_0x9078('0x41')],qs[_0x9078('0x46')](_0x3a86d7[_0x9078('0x43')][_0x9078('0x46')]));_0x33d57d['attributes']=_0x33d57d[_0x9078('0x47')][_0x9078('0x6f')]?_0x33d57d[_0x9078('0x47')]:_0x3e81ea[_0x9078('0x41')];_0x33d57d['order']=qs[_0x9078('0x4a')](_0x3a86d7[_0x9078('0x43')]['sort']);_0x33d57d['where']=qs[_0x9078('0x44')](_['pick'](_0x3a86d7[_0x9078('0x43')],_0x3e81ea[_0x9078('0x44')]));if(_0x3a86d7[_0x9078('0x43')][_0x9078('0x4f')]){_0x33d57d['where']=_[_0x9078('0x4d')](_0x33d57d[_0x9078('0x4b')],{'$or':_[_0x9078('0x42')](_0x33d57d[_0x9078('0x47')],function(_0x411fa6){var _0x499299={};_0x499299[_0x411fa6]={'$like':'%'+_0x3a86d7['query']['filter']+'%'};return _0x499299;})});}_0x33d57d=_[_0x9078('0x4d')]({},_0x33d57d,_0x3a86d7['options']);return _0x2592d0[_0x9078('0xab')](_0x33d57d);}})[_0x9078('0x34')](function(_0x96fa21){if(_0x96fa21){_0x2ae526=_0x96fa21['length'];if(!_0x3a86d7[_0x9078('0x43')][_0x9078('0xac')]('nolimit')){_0x33d57d['limit']=qs['limit'](_0x3a86d7[_0x9078('0x43')][_0x9078('0x2f')]);_0x33d57d[_0x9078('0x2e')]=qs[_0x9078('0x2e')](_0x3a86d7['query'][_0x9078('0x2e')]);}return _0x2592d0[_0x9078('0xab')](_0x33d57d);}})[_0x9078('0x34')](function(_0xd4238a){if(_0xd4238a){return _0xd4238a?{'count':_0x2ae526,'rows':_0xd4238a}:null;}})[_0x9078('0x34')](respondWithResult(_0xf5c71f,null))[_0x9078('0x53')](handleError(_0xf5c71f,null));};exports[_0x9078('0xad')]=function(_0x281bdd,_0x1d78a8,_0x33cd2d){var _0x612dff={'raw':![],'where':{}};var _0xf96325={};var _0x5eae18={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x9078('0xaa')]({'where':{'id':_0x281bdd[_0x9078('0x55')]['id']}})['then'](handleEntityNotFound(_0x1d78a8,null))[_0x9078('0x34')](function(_0x2006c2){if(_0x2006c2){_0xf96325['model']=_[_0x9078('0x58')](db[_0x9078('0x93')][_0x9078('0x3d')]);_0xf96325[_0x9078('0x43')]=_['keys'](_0x281bdd[_0x9078('0x43')]);_0xf96325[_0x9078('0x44')]=_[_0x9078('0x45')](_0xf96325[_0x9078('0x41')],_0xf96325['query']);_0x612dff['attributes']=_[_0x9078('0x45')](_0xf96325[_0x9078('0x41')],qs[_0x9078('0x46')](_0x281bdd['query']['fields']));_0x612dff['attributes']=_0x612dff[_0x9078('0x47')][_0x9078('0x6f')]?_0x612dff[_0x9078('0x47')]:_0xf96325[_0x9078('0x41')];if(!_0x281bdd['query'][_0x9078('0xac')]('nolimit')){_0x612dff[_0x9078('0x2f')]=qs[_0x9078('0x2f')](_0x281bdd[_0x9078('0x43')][_0x9078('0x2f')]);_0x612dff[_0x9078('0x2e')]=qs['offset'](_0x281bdd[_0x9078('0x43')][_0x9078('0x2e')]);}_0x612dff['order']=qs[_0x9078('0x4a')](_0x281bdd[_0x9078('0x43')][_0x9078('0x4a')]);_0x612dff[_0x9078('0x4b')]=qs['filters'](_[_0x9078('0x4c')](_0x281bdd[_0x9078('0x43')],_0xf96325[_0x9078('0x44')]));_0x612dff['where']['OpenchannelAccountId']=_0x2006c2['id'];if(_0x281bdd['query'][_0x9078('0x4f')]){_0x612dff[_0x9078('0x4b')]=_['merge'](_0x612dff[_0x9078('0x4b')],{'$or':_['map'](_0x612dff[_0x9078('0x47')],function(_0x53a138){var _0x301864={};_0x301864[_0x53a138]={'$like':'%'+_0x281bdd[_0x9078('0x43')][_0x9078('0x4f')]+'%'};return _0x301864;})});}_0x612dff=_[_0x9078('0x4d')]({},_0x612dff,_0x281bdd['options']);return db[_0x9078('0x93')]['count']({'where':_0x612dff[_0x9078('0x4b')]})[_0x9078('0x34')](function(_0x224cc8){_0x5eae18[_0x9078('0x2d')]=_0x224cc8;if(_0x281bdd['query']['includeAll']){_0x612dff[_0x9078('0x59')]=[{'model':db[_0x9078('0x72')],'as':_0x9078('0xae'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x9078('0x39'),_0x9078('0xaf'),_0x9078('0xb0')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x9078('0x39'),_0x9078('0xb1')],'where':_0x281bdd[_0x9078('0x43')][_0x9078('0xb2')]?{'id':_0x281bdd[_0x9078('0x43')]['tag']}:undefined,'required':_0x281bdd[_0x9078('0x43')]['tag']?!![]:![]}];}return db[_0x9078('0x93')]['findAll'](_0x612dff);})[_0x9078('0x34')](function(_0x3bbaf0){_0x5eae18['rows']=_0x3bbaf0;return _0x5eae18;});}})[_0x9078('0x34')](respondWithFilteredResult(_0x1d78a8,_0x612dff))[_0x9078('0x53')](handleError(_0x1d78a8,null));};exports[_0x9078('0xb3')]=function(_0x3c5ba8,_0x4d3539,_0xb5a09e){return db[_0x9078('0x3c')][_0x9078('0x5a')]({'where':{'id':_0x3c5ba8['params']['id']}})[_0x9078('0x34')](handleEntityNotFound(_0x4d3539,null))[_0x9078('0x34')](function(_0x1b98ac){if(_0x1b98ac){return _0x1b98ac[_0x9078('0xb3')](_0x3c5ba8[_0x9078('0x5c')][_0x9078('0x6b')],_[_0x9078('0xb4')](_0x3c5ba8[_0x9078('0x5c')],[_0x9078('0x6b'),'id'])||{})[_0x9078('0xb5')](function(_0x4d8f90){for(var _0x1d5a4e=0x0;_0x1d5a4e<_0x3c5ba8[_0x9078('0x5c')]['ids']['length'];_0x1d5a4e+=0x1){socket[_0x9078('0xb6')](_0x9078('0xb7'),{'UserId':Number(_0x3c5ba8['body']['ids'][_0x1d5a4e]),'OpenchannelAccountId':Number(_0x3c5ba8[_0x9078('0x55')]['id'])});}return _0x4d8f90;});}})['then'](respondWithResult(_0x4d3539,null))[_0x9078('0x53')](handleError(_0x4d3539,null));};exports[_0x9078('0xb8')]=function(_0x1f22da,_0x3424d8,_0x142322){return db[_0x9078('0x3c')][_0x9078('0x5a')]({'where':{'id':_0x1f22da[_0x9078('0x55')]['id']}})[_0x9078('0x34')](handleEntityNotFound(_0x3424d8,null))['then'](function(_0x498eb5){if(_0x498eb5){return _0x498eb5[_0x9078('0xb8')](_0x1f22da[_0x9078('0x43')][_0x9078('0x6b')])[_0x9078('0x34')](function(){if(_[_0x9078('0xb9')](_0x1f22da['query'][_0x9078('0x6b')])){for(var _0x4ca211=0x0;_0x4ca211<_0x1f22da['query'][_0x9078('0x6b')][_0x9078('0x6f')];_0x4ca211+=0x1){socket[_0x9078('0xb6')]('userOpenchannelAccount:remove',{'UserId':Number(_0x1f22da['query']['ids'][_0x4ca211]),'OpenchannelAccountId':Number(_0x1f22da[_0x9078('0x55')]['id'])});}}else{socket[_0x9078('0xb6')](_0x9078('0xba'),{'UserId':Number(_0x1f22da[_0x9078('0x43')]['ids']),'OpenchannelAccountId':Number(_0x1f22da[_0x9078('0x55')]['id'])});}});}})[_0x9078('0x34')](respondWithStatusCode(_0x3424d8,null))[_0x9078('0x53')](handleError(_0x3424d8,null));};exports['getAgents']=function(_0x5e4bd2,_0x185320,_0x31f414){var _0x37490f={};var _0x1d349a={};var _0x289e6e;var _0x276592;return db[_0x9078('0x3c')][_0x9078('0xaa')]({'where':{'id':_0x5e4bd2[_0x9078('0x55')]['id']}})[_0x9078('0x34')](handleEntityNotFound(_0x185320,null))[_0x9078('0x34')](function(_0x1f790a){if(_0x1f790a){_0x289e6e=_0x1f790a;_0x1d349a['model']=_[_0x9078('0x58')](db['User'][_0x9078('0x3d')]);_0x1d349a['query']=_['keys'](_0x5e4bd2[_0x9078('0x43')]);_0x1d349a[_0x9078('0x44')]=_[_0x9078('0x45')](_0x1d349a[_0x9078('0x41')],_0x1d349a[_0x9078('0x43')]);_0x37490f[_0x9078('0x47')]=_[_0x9078('0x45')](_0x1d349a['model'],qs[_0x9078('0x46')](_0x5e4bd2[_0x9078('0x43')][_0x9078('0x46')]));_0x37490f['attributes']=_0x37490f[_0x9078('0x47')]['length']?_0x37490f[_0x9078('0x47')]:_0x1d349a[_0x9078('0x41')];_0x37490f[_0x9078('0x49')]=qs['sort'](_0x5e4bd2[_0x9078('0x43')][_0x9078('0x4a')]);_0x37490f['where']=qs[_0x9078('0x44')](_['pick'](_0x5e4bd2[_0x9078('0x43')],_0x1d349a[_0x9078('0x44')]));if(_0x5e4bd2[_0x9078('0x43')][_0x9078('0x4f')]){_0x37490f[_0x9078('0x4b')]=_['merge'](_0x37490f[_0x9078('0x4b')],{'$or':_[_0x9078('0x42')](_0x37490f[_0x9078('0x47')],function(_0x35c8d0){var _0x4c3711={};_0x4c3711[_0x35c8d0]={'$like':'%'+_0x5e4bd2[_0x9078('0x43')][_0x9078('0x4f')]+'%'};return _0x4c3711;})});}_0x37490f=_['merge']({},_0x37490f,_0x5e4bd2[_0x9078('0x50')]);return _0x289e6e[_0x9078('0xbb')](_0x37490f);}})[_0x9078('0x34')](function(_0x3c7c7b){if(_0x3c7c7b){_0x276592=_0x3c7c7b['length'];if(!_0x5e4bd2[_0x9078('0x43')][_0x9078('0xac')](_0x9078('0x48'))){_0x37490f[_0x9078('0x2f')]=qs[_0x9078('0x2f')](_0x5e4bd2[_0x9078('0x43')]['limit']);_0x37490f[_0x9078('0x2e')]=qs['offset'](_0x5e4bd2[_0x9078('0x43')]['offset']);}return _0x289e6e[_0x9078('0xbb')](_0x37490f);}})[_0x9078('0x34')](function(_0x5451a8){if(_0x5451a8){return _0x5451a8?{'count':_0x276592,'rows':_0x5451a8}:null;}})['then'](respondWithResult(_0x185320,null))[_0x9078('0x53')](handleError(_0x185320,null));};exports[_0x9078('0x3a')]=function(_0x8586b5,_0x4d5240,_0x576f8d){var _0x144e1c,_0x1c971e,_0x1e948b;if(_['isNil'](_0x8586b5[_0x9078('0x5c')][_0x9078('0x5c')])||_0x8586b5[_0x9078('0x5c')][_0x9078('0x5c')]===''){throw new db[(_0x9078('0x73'))][(_0x9078('0x7b'))](_0x9078('0x7e'));}if(_[_0x9078('0x7d')](_0x8586b5[_0x9078('0x5c')]['to'])){}_0x144e1c=_0x8586b5['body']['to'];return db['OpenchannelAccount'][_0x9078('0xaa')]({'where':{'id':_0x8586b5[_0x9078('0x55')]['id']}})[_0x9078('0x34')](handleEntityNotFound(_0x4d5240,null))[_0x9078('0x34')](function(_0x41fe4c){if(_0x41fe4c){return db['OpenchannelAccount'][_0x9078('0x5a')]({'where':{'id':_0x41fe4c['id']},'include':[{'model':db[_0x9078('0x83')],'as':_0x9078('0x84'),'include':[{'model':db[_0x9078('0x72')],'as':_0x9078('0x8e'),'where':{[_0x41fe4c[_0x9078('0x7f')]]:_0x144e1c},'limit':0x1,'order':[['updatedAt',_0x9078('0x85')]]}]}]})[_0x9078('0x34')](handleEntityNotFound(_0x4d5240,null))[_0x9078('0x34')](function(_0x41120d){if(_0x41120d&&_0x41120d[_0x9078('0x84')]){_0x1c971e=_0x41120d[_0x9078('0x36')]({'plain':!![]});if(_0x1c971e[_0x9078('0x84')]&&_0x1c971e['List']['Contacts'][_0x9078('0x6f')]){return _0x1c971e[_0x9078('0x84')]['Contacts'][0x0];}return db[_0x9078('0x72')]['create'](_['defaults'](_0x8586b5[_0x9078('0x5c')],{'firstName':_0x144e1c,[_0x41120d[_0x9078('0x7f')]]:_0x144e1c,'phone':_0x144e1c,'ListId':_0x1c971e['ListId']}));}})[_0x9078('0x34')](handleEntityNotFound(_0x4d5240,null))[_0x9078('0x34')](function(_0x423fcd){if(_0x423fcd){_0x1e948b=_0x423fcd;return db['OpenchannelInteraction'][_0x9078('0x5a')]({'where':{'ContactId':_0x1e948b['id'],'closed':![],'OpenchannelAccountId':_0x1c971e['id']}})[_0x9078('0x34')](function(_0x267172){if(_0x267172){return[_0x267172,![]];}return db['OpenchannelInteraction'][_0x9078('0x5b')]({'UserId':_0x8586b5[_0x9078('0x5d')]['id'],'ContactId':_0x1e948b['id'],'OpenchannelAccountId':_0x1c971e['id'],'lastMsgDirection':'out','Messages':[_[_0x9078('0x4d')](_0x8586b5['body'],{'read':![],'body':_0x8586b5[_0x9078('0x5c')][_0x9078('0x5c')],'OpenchannelAccountId':_0x1c971e['id'],'UserId':_0x8586b5['user']['id'],'ContactId':_0x1e948b['id']})]},{'include':[{'model':db[_0x9078('0x9c')],'as':_0x9078('0xbc')}]})[_0x9078('0x34')](function(_0x2c2967){return[_0x2c2967,!![]];});});}})['spread'](function(_0x3fd94e,_0x2141f5){if(_0x2141f5){return _0x3fd94e;}return db[_0x9078('0x9c')][_0x9078('0x5b')](_[_0x9078('0x4d')](_0x8586b5[_0x9078('0x5c')],{'read':![],'body':_0x8586b5[_0x9078('0x5c')][_0x9078('0x5c')],'OpenchannelAccountId':_0x1c971e['id'],'OpenchannelInteractionId':_0x3fd94e['id'],'UserId':_0x8586b5[_0x9078('0x5d')]['id'],'ContactId':_0x1e948b['id']}))[_0x9078('0x34')](function(_0x1cdb74){_0x3fd94e[_0x9078('0xbd')][_0x9078('0xbc')]=[];_0x3fd94e[_0x9078('0xbd')]['Messages']['push'](_0x1cdb74[_0x9078('0xbd')]);return _0x3fd94e;});});}})['then'](respondWithResult(_0x4d5240,null))[_0x9078('0x53')](handleError(_0x4d5240,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 42b2569..1642e23 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 _0x1339=['update','remove','emit','hasOwnProperty','exports','OpenchannelAccount','setMaxListeners','save'];(function(_0x5a4ba0,_0x31c422){var _0x1e1820=function(_0x4a6008){while(--_0x4a6008){_0x5a4ba0['push'](_0x5a4ba0['shift']());}};_0x1e1820(++_0x31c422);}(_0x1339,0x1ed));var _0x9133=function(_0x203067,_0x4d0f30){_0x203067=_0x203067-0x0;var _0x19c323=_0x1339[_0x203067];return _0x19c323;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0x9133('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x9133('0x1')](0x0);var events={'afterCreate':_0x9133('0x2'),'afterUpdate':_0x9133('0x3'),'afterDestroy':_0x9133('0x4')};function emitEvent(_0x192d48){return function(_0x176e80,_0x110c51,_0x558345){OpenchannelAccountEvents[_0x9133('0x5')](_0x192d48+':'+_0x176e80['id'],_0x176e80);OpenchannelAccountEvents[_0x9133('0x5')](_0x192d48,_0x176e80);_0x558345(null);};}for(var e in events){if(events[_0x9133('0x6')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0x9133('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x2547=['hasOwnProperty','exports','../../mysqldb','OpenchannelAccount','setMaxListeners','save','update','remove','emit'];(function(_0x67714a,_0x550d17){var _0x468499=function(_0x4a272a){while(--_0x4a272a){_0x67714a['push'](_0x67714a['shift']());}};_0x468499(++_0x550d17);}(_0x2547,0x1cd));var _0x7254=function(_0x3bddc6,_0x217f85){_0x3bddc6=_0x3bddc6-0x0;var _0x34d646=_0x2547[_0x3bddc6];return _0x34d646;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0x7254('0x0'))['db'][_0x7254('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x7254('0x2')](0x0);var events={'afterCreate':_0x7254('0x3'),'afterUpdate':_0x7254('0x4'),'afterDestroy':_0x7254('0x5')};function emitEvent(_0x9f3435){return function(_0x265ebf,_0x53a02f,_0x2ddeae){OpenchannelAccountEvents[_0x7254('0x6')](_0x9f3435+':'+_0x265ebf['id'],_0x265ebf);OpenchannelAccountEvents[_0x7254('0x6')](_0x9f3435,_0x265ebf);_0x2ddeae(null);};}for(var e in events){if(events[_0x7254('0x7')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0x7254('0x8')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index a5dcb1d..df98b94 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(_0x2b102f,_0x4bd396){var _0x4fef15=function(_0x4675ea){while(--_0x4675ea){_0x2b102f['push'](_0x2b102f['shift']());}};_0x4fef15(++_0x4bd396);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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(_0x1b8278,_0x59d5ba){var _0xa9cacd=function(_0x231108){while(--_0x231108){_0x1b8278['push'](_0x1b8278['shift']());}};_0xa9cacd(++_0x59d5ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'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 4660a32..27af821 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 _0xf7b4=['result','catch','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0xf7b4,0x152));var _0x4f7b=function(_0x26de2b,_0x2e093d){_0x26de2b=_0x26de2b-0x0;var _0x3d4b9b=_0xf7b4[_0x26de2b];return _0x3d4b9b;};'use strict';var _=require(_0x4f7b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4f7b('0x1'));var rs=require(_0x4f7b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4f7b('0x3'));var logger=require(_0x4f7b('0x4'))(_0x4f7b('0x5'));var config=require(_0x4f7b('0x6'));var jayson=require(_0x4f7b('0x7'));var client=jayson[_0x4f7b('0x8')][_0x4f7b('0x9')]({'port':0x232a});config[_0x4f7b('0xa')]=_[_0x4f7b('0xb')](config[_0x4f7b('0xa')],{'host':_0x4f7b('0xc'),'port':0x18eb});var socket=require(_0x4f7b('0xd'))(new Redis(config[_0x4f7b('0xa')]));require('./openchannelAccount.socket')[_0x4f7b('0xe')](socket);function respondWithRpcPromise(_0x1016e0,_0x479208,_0xdd1aab){return new BPromise(function(_0x3a3d6c,_0x408e01){return client[_0x4f7b('0xf')](_0x1016e0,_0xdd1aab)[_0x4f7b('0x10')](function(_0x55d69f){logger[_0x4f7b('0x11')]('OpenchannelAccount,\x20%s,\x20%s',_0x479208,'request\x20sent');logger[_0x4f7b('0x12')](_0x4f7b('0x13'),_0x479208,_0x4f7b('0x14'),JSON[_0x4f7b('0x15')](_0x55d69f));if(_0x55d69f['error']){if(_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x17')]===0x1f4){logger[_0x4f7b('0x16')](_0x4f7b('0x18'),_0x479208,_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x19')]);return _0x408e01(_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x19')]);}logger[_0x4f7b('0x16')](_0x4f7b('0x18'),_0x479208,_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x19')]);return _0x3a3d6c(_0x55d69f['error'][_0x4f7b('0x19')]);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x479208,_0x4f7b('0x14'));_0x3a3d6c(_0x55d69f[_0x4f7b('0x1a')]['message']);}})[_0x4f7b('0x1b')](function(_0x24c460){logger[_0x4f7b('0x16')](_0x4f7b('0x18'),_0x479208,_0x24c460);_0x408e01(_0x24c460);});});} \ No newline at end of file +var _0xf7b4=['result','catch','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xf7b4,0x152));var _0x4f7b=function(_0x346797,_0x2d92e2){_0x346797=_0x346797-0x0;var _0x4f1b71=_0xf7b4[_0x346797];return _0x4f1b71;};'use strict';var _=require(_0x4f7b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4f7b('0x1'));var rs=require(_0x4f7b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4f7b('0x3'));var logger=require(_0x4f7b('0x4'))(_0x4f7b('0x5'));var config=require(_0x4f7b('0x6'));var jayson=require(_0x4f7b('0x7'));var client=jayson[_0x4f7b('0x8')][_0x4f7b('0x9')]({'port':0x232a});config[_0x4f7b('0xa')]=_[_0x4f7b('0xb')](config[_0x4f7b('0xa')],{'host':_0x4f7b('0xc'),'port':0x18eb});var socket=require(_0x4f7b('0xd'))(new Redis(config[_0x4f7b('0xa')]));require('./openchannelAccount.socket')[_0x4f7b('0xe')](socket);function respondWithRpcPromise(_0x1016e0,_0x479208,_0xdd1aab){return new BPromise(function(_0x3a3d6c,_0x408e01){return client[_0x4f7b('0xf')](_0x1016e0,_0xdd1aab)[_0x4f7b('0x10')](function(_0x55d69f){logger[_0x4f7b('0x11')]('OpenchannelAccount,\x20%s,\x20%s',_0x479208,'request\x20sent');logger[_0x4f7b('0x12')](_0x4f7b('0x13'),_0x479208,_0x4f7b('0x14'),JSON[_0x4f7b('0x15')](_0x55d69f));if(_0x55d69f['error']){if(_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x17')]===0x1f4){logger[_0x4f7b('0x16')](_0x4f7b('0x18'),_0x479208,_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x19')]);return _0x408e01(_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x19')]);}logger[_0x4f7b('0x16')](_0x4f7b('0x18'),_0x479208,_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x19')]);return _0x3a3d6c(_0x55d69f['error'][_0x4f7b('0x19')]);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x479208,_0x4f7b('0x14'));_0x3a3d6c(_0x55d69f[_0x4f7b('0x1a')]['message']);}})[_0x4f7b('0x1b')](function(_0x24c460){logger[_0x4f7b('0x16')](_0x4f7b('0x18'),_0x479208,_0x24c460);_0x408e01(_0x24c460);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index efee49d..6294825 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 _0x31c2=['emit','removeListener','register','length','openchannelAccount:','./openchannelAccount.events','update'];(function(_0x4b85a3,_0x55a93f){var _0xcf8bc7=function(_0x4792d0){while(--_0x4792d0){_0x4b85a3['push'](_0x4b85a3['shift']());}};_0xcf8bc7(++_0x55a93f);}(_0x31c2,0x98));var _0x231c=function(_0x20af4e,_0x16bac1){_0x20af4e=_0x20af4e-0x0;var _0x4e8b89=_0x31c2[_0x20af4e];return _0x4e8b89;};'use strict';var OpenchannelAccountEvents=require(_0x231c('0x0'));var events=['save','remove',_0x231c('0x1')];function createListener(_0x1426bb,_0x4bcfa6){return function(_0x2f0b2c){_0x4bcfa6[_0x231c('0x2')](_0x1426bb,_0x2f0b2c);};}function removeListener(_0x396f04,_0xe1bfea){return function(){OpenchannelAccountEvents[_0x231c('0x3')](_0x396f04,_0xe1bfea);};}exports[_0x231c('0x4')]=function(_0x21b4df){for(var _0x4442b9=0x0,_0x5afc76=events[_0x231c('0x5')];_0x4442b9<_0x5afc76;_0x4442b9++){var _0x4fd8b8=events[_0x4442b9];var _0x3dfccb=createListener(_0x231c('0x6')+_0x4fd8b8,_0x21b4df);OpenchannelAccountEvents['on'](_0x4fd8b8,_0x3dfccb);}}; \ No newline at end of file +var _0x1c8a=['removeListener','openchannelAccount:','./openchannelAccount.events','save','remove','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1c8a,0x140));var _0xa1c8=function(_0x2ac0d2,_0x2a2125){_0x2ac0d2=_0x2ac0d2-0x0;var _0x4ea9a9=_0x1c8a[_0x2ac0d2];return _0x4ea9a9;};'use strict';var OpenchannelAccountEvents=require(_0xa1c8('0x0'));var events=[_0xa1c8('0x1'),_0xa1c8('0x2'),_0xa1c8('0x3')];function createListener(_0x2eb128,_0x50af02){return function(_0x250aa9){_0x50af02['emit'](_0x2eb128,_0x250aa9);};}function removeListener(_0x122813,_0x1cdee0){return function(){OpenchannelAccountEvents[_0xa1c8('0x4')](_0x122813,_0x1cdee0);};}exports['register']=function(_0x331282){for(var _0x14b85c=0x0,_0x14d2f0=events['length'];_0x14b85c<_0x14d2f0;_0x14b85c++){var _0x32993e=events[_0x14b85c];var _0xf93962=createListener(_0xa1c8('0x5')+_0x32993e,_0x331282);OpenchannelAccountEvents['on'](_0x32993e,_0xf93962);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index c128aa9..e9da329 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 _0xf39d=['get','/:id','show','post','create','put','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','isAuthenticated','index'];(function(_0xaf8365,_0x34630b){var _0x494107=function(_0x10bce0){while(--_0x10bce0){_0xaf8365['push'](_0xaf8365['shift']());}};_0x494107(++_0x34630b);}(_0xf39d,0x14c));var _0xdf39=function(_0x51fe5f,_0x1d8632){_0x51fe5f=_0x51fe5f-0x0;var _0x4abce9=_0xf39d[_0x51fe5f];return _0x4abce9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdf39('0x0'));var timeout=require(_0xdf39('0x1'));var express=require(_0xdf39('0x2'));var router=express[_0xdf39('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xdf39('0x4'));var interaction=require(_0xdf39('0x5'));var config=require(_0xdf39('0x6'));var controller=require(_0xdf39('0x7'));router['get']('/',auth[_0xdf39('0x8')](),controller[_0xdf39('0x9')]);router[_0xdf39('0xa')](_0xdf39('0xb'),auth['isAuthenticated'](),controller[_0xdf39('0xc')]);router[_0xdf39('0xd')]('/',auth[_0xdf39('0x8')](),controller[_0xdf39('0xe')]);router[_0xdf39('0xf')](_0xdf39('0xb'),auth[_0xdf39('0x8')](),controller['update']);router['delete'](_0xdf39('0xb'),auth[_0xdf39('0x8')](),controller[_0xdf39('0x10')]);module[_0xdf39('0x11')]=router; \ No newline at end of file +var _0xc232=['../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','put','delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x482c43,_0x1b2cd8){var _0x3babc6=function(_0x93aa9e){while(--_0x93aa9e){_0x482c43['push'](_0x482c43['shift']());}};_0x3babc6(++_0x1b2cd8);}(_0xc232,0x1ab));var _0x2c23=function(_0x19d1f1,_0x15098b){_0x19d1f1=_0x19d1f1-0x0;var _0x394fcc=_0xc232[_0x19d1f1];return _0x394fcc;};'use strict';var multer=require(_0x2c23('0x0'));var util=require(_0x2c23('0x1'));var path=require('path');var timeout=require(_0x2c23('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2c23('0x3'));var auth=require(_0x2c23('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2c23('0x5'));var controller=require(_0x2c23('0x6'));router[_0x2c23('0x7')]('/',auth[_0x2c23('0x8')](),controller[_0x2c23('0x9')]);router[_0x2c23('0x7')](_0x2c23('0xa'),auth[_0x2c23('0x8')](),controller[_0x2c23('0xb')]);router['post']('/',auth[_0x2c23('0x8')](),controller['create']);router[_0x2c23('0xc')](_0x2c23('0xa'),auth[_0x2c23('0x8')](),controller['update']);router[_0x2c23('0xd')](_0x2c23('0xa'),auth[_0x2c23('0x8')](),controller[_0x2c23('0xe')]);module[_0x2c23('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index aeef1be..7cb47d7 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 _0xd69b=['*,*,*,*','exports','INTEGER','STRING','noop','TEXT'];(function(_0x3cb152,_0x57eb54){var _0x4f54c3=function(_0x273a45){while(--_0x273a45){_0x3cb152['push'](_0x3cb152['shift']());}};_0x4f54c3(++_0x57eb54);}(_0xd69b,0x79));var _0xbd69=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0xd69b[_0x1b2ff7];return _0x31656a;};'use strict';var Sequelize=require('sequelize');module[_0xbd69('0x0')]={'priority':{'type':Sequelize[_0xbd69('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xbd69('0x2')],'allowNull':![],'defaultValue':_0xbd69('0x3')},'appdata':{'type':Sequelize[_0xbd69('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xbd69('0x2')],'defaultValue':_0xbd69('0x5')}}; \ No newline at end of file +var _0x2a98=['STRING','*,*,*,*','sequelize','exports','INTEGER','noop','TEXT'];(function(_0x43b9b6,_0x57fb71){var _0xdb5eab=function(_0x5e47ca){while(--_0x5e47ca){_0x43b9b6['push'](_0x43b9b6['shift']());}};_0xdb5eab(++_0x57fb71);}(_0x2a98,0x87));var _0x82a9=function(_0x2310a3,_0x4268a0){_0x2310a3=_0x2310a3-0x0;var _0x5262dc=_0x2a98[_0x2310a3];return _0x5262dc;};'use strict';var Sequelize=require(_0x82a9('0x0'));module[_0x82a9('0x1')]={'priority':{'type':Sequelize[_0x82a9('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x82a9('0x3')},'appdata':{'type':Sequelize[_0x82a9('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x82a9('0x5')],'defaultValue':_0x82a9('0x6')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index e50d40f..9cc1aa7 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 _0xc59e=['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','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','sendStatus','error','stack','name','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','keys','includeAll','find','create','body','update','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x2c2917,_0x72725e){var _0x2d078e=function(_0x720565){while(--_0x720565){_0x2c2917['push'](_0x2c2917['shift']());}};_0x2d078e(++_0x72725e);}(_0xc59e,0x93));var _0xec59=function(_0x4d8b12,_0x29c0a7){_0x4d8b12=_0x4d8b12-0x0;var _0xb889bc=_0xc59e[_0x4d8b12];return _0xb889bc;};'use strict';var emlformat=require(_0xec59('0x0'));var rimraf=require(_0xec59('0x1'));var zipdir=require(_0xec59('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xec59('0x3'));var moment=require('moment');var BPromise=require(_0xec59('0x4'));var Mustache=require(_0xec59('0x5'));var util=require(_0xec59('0x6'));var path=require(_0xec59('0x7'));var sox=require(_0xec59('0x8'));var csv=require(_0xec59('0x9'));var ejs=require(_0xec59('0xa'));var fs=require('fs');var fs_extra=require(_0xec59('0xb'));var _=require(_0xec59('0xc'));var squel=require(_0xec59('0xd'));var crypto=require(_0xec59('0xe'));var jsforce=require(_0xec59('0xf'));var deskjs=require(_0xec59('0x10'));var toCsv=require(_0xec59('0x9'));var querystring=require(_0xec59('0x11'));var Papa=require(_0xec59('0x12'));var Redis=require('ioredis');var authService=require(_0xec59('0x13'));var qs=require(_0xec59('0x14'));var as=require(_0xec59('0x15'));var hardwareService=require(_0xec59('0x16'));var logger=require(_0xec59('0x17'))(_0xec59('0x18'));var utils=require(_0xec59('0x19'));var config=require(_0xec59('0x1a'));var licenseUtil=require(_0xec59('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ce7be,_0x4021ba){_0x4021ba=_0x4021ba||0xcc;return function(_0x177d65){if(_0x177d65){return _0x5ce7be['sendStatus'](_0x4021ba);}return _0x5ce7be[_0xec59('0x1c')](_0x4021ba)['end']();};}function respondWithResult(_0x5cba36,_0x501053){_0x501053=_0x501053||0xc8;return function(_0x367a7a){if(_0x367a7a){return _0x5cba36[_0xec59('0x1c')](_0x501053)[_0xec59('0x1d')](_0x367a7a);}};}function respondWithFilteredResult(_0x54fda7,_0x16efc3){return function(_0x42273d){if(_0x42273d){var _0x41c3e5=typeof _0x16efc3[_0xec59('0x1e')]===_0xec59('0x1f')&&typeof _0x16efc3[_0xec59('0x20')]===_0xec59('0x1f');var _0xe4caa8=_0x42273d['count'];var _0x56af32=_0x41c3e5?0x0:_0x16efc3['offset'];var _0xc2eba7=_0x41c3e5?_0x42273d[_0xec59('0x21')]:_0x16efc3['offset']+_0x16efc3[_0xec59('0x20')];var _0x42ab7a;if(_0xc2eba7>=_0xe4caa8){_0xc2eba7=_0xe4caa8;_0x42ab7a=0xc8;}else{_0x42ab7a=0xce;}_0x54fda7[_0xec59('0x1c')](_0x42ab7a);return _0x54fda7[_0xec59('0x22')](_0xec59('0x23'),_0x56af32+'-'+_0xc2eba7+'/'+_0xe4caa8)[_0xec59('0x1d')](_0x42273d);}return null;};}function patchUpdates(_0xadda2c){return function(_0xb0eb42){try{jsonpatch[_0xec59('0x24')](_0xb0eb42,_0xadda2c,!![]);}catch(_0x48e843){return BPromise[_0xec59('0x25')](_0x48e843);}return _0xb0eb42[_0xec59('0x26')]();};}function saveUpdates(_0x113110,_0x3a402c){return function(_0x50ba14){if(_0x50ba14){return _0x50ba14['update'](_0x113110)[_0xec59('0x27')](function(_0x5c5865){return _0x5c5865;});}return null;};}function removeEntity(_0xa51d98,_0xa614c7){return function(_0x474948){if(_0x474948){return _0x474948[_0xec59('0x28')]()['then'](function(){_0xa51d98[_0xec59('0x1c')](0xcc)[_0xec59('0x29')]();});}};}function handleEntityNotFound(_0x5b7cb2,_0xebad33){return function(_0xa2c839){if(!_0xa2c839){_0x5b7cb2[_0xec59('0x2a')](0x194);}return _0xa2c839;};}function handleError(_0x38a726,_0x21f28e){_0x21f28e=_0x21f28e||0x1f4;return function(_0x164baf){logger[_0xec59('0x2b')](_0x164baf[_0xec59('0x2c')]);if(_0x164baf[_0xec59('0x2d')]){delete _0x164baf[_0xec59('0x2d')];}_0x38a726[_0xec59('0x1c')](_0x21f28e)['send'](_0x164baf);};}exports[_0xec59('0x2e')]=function(_0x542037,_0x4df600){var _0x1f8749={},_0x299977={},_0x4b0f5a={'count':0x0,'rows':[]};var _0x4483e2=_[_0xec59('0x2f')](db[_0xec59('0x30')][_0xec59('0x31')],function(_0x4809d4){return{'name':_0x4809d4[_0xec59('0x32')],'type':_0x4809d4[_0xec59('0x33')][_0xec59('0x34')]};});_0x299977[_0xec59('0x35')]=_['map'](_0x4483e2,_0xec59('0x2d'));_0x299977[_0xec59('0x36')]=_['keys'](_0x542037[_0xec59('0x36')]);_0x299977[_0xec59('0x37')]=_['intersection'](_0x299977['model'],_0x299977[_0xec59('0x36')]);_0x1f8749[_0xec59('0x38')]=_[_0xec59('0x39')](_0x299977['model'],qs['fields'](_0x542037['query'][_0xec59('0x3a')]));_0x1f8749[_0xec59('0x38')]=_0x1f8749[_0xec59('0x38')][_0xec59('0x3b')]?_0x1f8749['attributes']:_0x299977[_0xec59('0x35')];if(!_0x542037[_0xec59('0x36')]['hasOwnProperty'](_0xec59('0x3c'))){_0x1f8749['limit']=qs[_0xec59('0x20')](_0x542037[_0xec59('0x36')][_0xec59('0x20')]);_0x1f8749['offset']=qs[_0xec59('0x1e')](_0x542037[_0xec59('0x36')][_0xec59('0x1e')]);}_0x1f8749[_0xec59('0x3d')]=qs[_0xec59('0x3e')](_0x542037[_0xec59('0x36')][_0xec59('0x3e')]);_0x1f8749[_0xec59('0x3f')]=qs[_0xec59('0x37')](_[_0xec59('0x40')](_0x542037[_0xec59('0x36')],_0x299977[_0xec59('0x37')]),_0x4483e2);if(_0x542037[_0xec59('0x36')][_0xec59('0x41')]){_0x1f8749[_0xec59('0x3f')]=_[_0xec59('0x42')](_0x1f8749['where'],{'$or':_['map'](_0x4483e2,function(_0xb594bf){if(_0xb594bf['type']!==_0xec59('0x43')){var _0x411ebc={};_0x411ebc[_0xb594bf['name']]={'$like':'%'+_0x542037[_0xec59('0x36')][_0xec59('0x41')]+'%'};return _0x411ebc;}})});}_0x1f8749=_['merge']({},_0x1f8749,_0x542037[_0xec59('0x44')]);var _0x139202={'where':_0x1f8749[_0xec59('0x3f')]};return db['OpenchannelApplication']['count'](_0x139202)[_0xec59('0x27')](function(_0x29e8b3){_0x4b0f5a[_0xec59('0x21')]=_0x29e8b3;if(_0x542037[_0xec59('0x36')]['includeAll']){_0x1f8749[_0xec59('0x45')]=[{'all':!![]}];}return db[_0xec59('0x30')][_0xec59('0x46')](_0x1f8749);})[_0xec59('0x27')](function(_0x4f2aed){_0x4b0f5a[_0xec59('0x47')]=_0x4f2aed;return _0x4b0f5a;})[_0xec59('0x27')](respondWithFilteredResult(_0x4df600,_0x1f8749))[_0xec59('0x48')](handleError(_0x4df600,null));};exports['show']=function(_0x25e553,_0x557aa3){var _0x8796cc={'raw':!![],'where':{'id':_0x25e553[_0xec59('0x49')]['id']}},_0x2f5f5b={};_0x2f5f5b[_0xec59('0x35')]=_[_0xec59('0x4a')](db[_0xec59('0x30')][_0xec59('0x31')]);_0x2f5f5b[_0xec59('0x36')]=_[_0xec59('0x4a')](_0x25e553[_0xec59('0x36')]);_0x2f5f5b[_0xec59('0x37')]=_[_0xec59('0x39')](_0x2f5f5b[_0xec59('0x35')],_0x2f5f5b['query']);_0x8796cc[_0xec59('0x38')]=_[_0xec59('0x39')](_0x2f5f5b[_0xec59('0x35')],qs['fields'](_0x25e553[_0xec59('0x36')][_0xec59('0x3a')]));_0x8796cc[_0xec59('0x38')]=_0x8796cc[_0xec59('0x38')][_0xec59('0x3b')]?_0x8796cc[_0xec59('0x38')]:_0x2f5f5b[_0xec59('0x35')];if(_0x25e553[_0xec59('0x36')][_0xec59('0x4b')]){_0x8796cc[_0xec59('0x45')]=[{'all':!![]}];}_0x8796cc=_['merge']({},_0x8796cc,_0x25e553['options']);return db[_0xec59('0x30')][_0xec59('0x4c')](_0x8796cc)['then'](handleEntityNotFound(_0x557aa3,null))[_0xec59('0x27')](respondWithResult(_0x557aa3,null))[_0xec59('0x48')](handleError(_0x557aa3,null));};exports[_0xec59('0x4d')]=function(_0x4011bc,_0xce42ca){return db[_0xec59('0x30')][_0xec59('0x4d')](_0x4011bc[_0xec59('0x4e')],{})[_0xec59('0x27')](respondWithResult(_0xce42ca,0xc9))[_0xec59('0x48')](handleError(_0xce42ca,null));};exports[_0xec59('0x4f')]=function(_0x4fc4fc,_0x15a6e4){if(_0x4fc4fc[_0xec59('0x4e')]['id']){delete _0x4fc4fc[_0xec59('0x4e')]['id'];}return db[_0xec59('0x30')][_0xec59('0x4c')]({'where':{'id':_0x4fc4fc[_0xec59('0x49')]['id']}})[_0xec59('0x27')](handleEntityNotFound(_0x15a6e4,null))[_0xec59('0x27')](saveUpdates(_0x4fc4fc[_0xec59('0x4e')],null))[_0xec59('0x27')](respondWithResult(_0x15a6e4,null))[_0xec59('0x48')](handleError(_0x15a6e4,null));};exports['destroy']=function(_0x4f6106,_0x3b1731){return db[_0xec59('0x30')][_0xec59('0x4c')]({'where':{'id':_0x4f6106[_0xec59('0x49')]['id']}})[_0xec59('0x27')](handleEntityNotFound(_0x3b1731,null))[_0xec59('0x27')](removeEntity(_0x3b1731,null))['catch'](handleError(_0x3b1731,null));}; \ No newline at end of file +var _0xe360=['request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','catch','find','create','body','params','rimraf','zip-dir','fast-json-patch'];(function(_0x2ebb82,_0x1ec439){var _0xbe36fb=function(_0x17e41f){while(--_0x17e41f){_0x2ebb82['push'](_0x2ebb82['shift']());}};_0xbe36fb(++_0x1ec439);}(_0xe360,0x15b));var _0x0e36=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xe360[_0x1a36a5];return _0x746243;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0e36('0x0'));var zipdir=require(_0x0e36('0x1'));var jsonpatch=require(_0x0e36('0x2'));var rp=require(_0x0e36('0x3'));var moment=require(_0x0e36('0x4'));var BPromise=require(_0x0e36('0x5'));var Mustache=require(_0x0e36('0x6'));var util=require(_0x0e36('0x7'));var path=require('path');var sox=require(_0x0e36('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0e36('0x9'));var _=require(_0x0e36('0xa'));var squel=require(_0x0e36('0xb'));var crypto=require('crypto');var jsforce=require(_0x0e36('0xc'));var deskjs=require(_0x0e36('0xd'));var toCsv=require(_0x0e36('0xe'));var querystring=require(_0x0e36('0xf'));var Papa=require(_0x0e36('0x10'));var Redis=require(_0x0e36('0x11'));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('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0e36('0x12'));var db=require(_0x0e36('0x13'))['db'];function respondWithStatusCode(_0x3a45d3,_0x2d98c7){_0x2d98c7=_0x2d98c7||0xcc;return function(_0x5c7914){if(_0x5c7914){return _0x3a45d3[_0x0e36('0x14')](_0x2d98c7);}return _0x3a45d3[_0x0e36('0x15')](_0x2d98c7)['end']();};}function respondWithResult(_0x562dda,_0x4a829c){_0x4a829c=_0x4a829c||0xc8;return function(_0x1c7424){if(_0x1c7424){return _0x562dda[_0x0e36('0x15')](_0x4a829c)[_0x0e36('0x16')](_0x1c7424);}};}function respondWithFilteredResult(_0x2364b3,_0x1dd3ea){return function(_0x2e607a){if(_0x2e607a){var _0x4889ea=typeof _0x1dd3ea['offset']===_0x0e36('0x17')&&typeof _0x1dd3ea[_0x0e36('0x18')]==='undefined';var _0x1a3473=_0x2e607a[_0x0e36('0x19')];var _0x420333=_0x4889ea?0x0:_0x1dd3ea['offset'];var _0x31731e=_0x4889ea?_0x2e607a[_0x0e36('0x19')]:_0x1dd3ea[_0x0e36('0x1a')]+_0x1dd3ea[_0x0e36('0x18')];var _0x4412e1;if(_0x31731e>=_0x1a3473){_0x31731e=_0x1a3473;_0x4412e1=0xc8;}else{_0x4412e1=0xce;}_0x2364b3['status'](_0x4412e1);return _0x2364b3['set'](_0x0e36('0x1b'),_0x420333+'-'+_0x31731e+'/'+_0x1a3473)[_0x0e36('0x16')](_0x2e607a);}return null;};}function patchUpdates(_0x49c375){return function(_0x31829d){try{jsonpatch[_0x0e36('0x1c')](_0x31829d,_0x49c375,!![]);}catch(_0x3c5e2f){return BPromise[_0x0e36('0x1d')](_0x3c5e2f);}return _0x31829d[_0x0e36('0x1e')]();};}function saveUpdates(_0x5b92fc,_0x15902d){return function(_0x4a3c68){if(_0x4a3c68){return _0x4a3c68[_0x0e36('0x1f')](_0x5b92fc)[_0x0e36('0x20')](function(_0x2f1c36){return _0x2f1c36;});}return null;};}function removeEntity(_0x42f66c,_0x4aedec){return function(_0x3eaba5){if(_0x3eaba5){return _0x3eaba5[_0x0e36('0x21')]()['then'](function(){_0x42f66c['status'](0xcc)[_0x0e36('0x22')]();});}};}function handleEntityNotFound(_0x5b94db,_0xab73b){return function(_0x559de3){if(!_0x559de3){_0x5b94db['sendStatus'](0x194);}return _0x559de3;};}function handleError(_0x5c59df,_0x24da49){_0x24da49=_0x24da49||0x1f4;return function(_0x1a1434){logger['error'](_0x1a1434[_0x0e36('0x23')]);if(_0x1a1434[_0x0e36('0x24')]){delete _0x1a1434[_0x0e36('0x24')];}_0x5c59df['status'](_0x24da49)[_0x0e36('0x25')](_0x1a1434);};}exports[_0x0e36('0x26')]=function(_0x2fdbae,_0x5d3959){var _0x49dc97={},_0x259cfa={},_0x2a0a19={'count':0x0,'rows':[]};var _0x22cffb=_[_0x0e36('0x27')](db[_0x0e36('0x28')][_0x0e36('0x29')],function(_0x1ccdd2){return{'name':_0x1ccdd2[_0x0e36('0x2a')],'type':_0x1ccdd2['type'][_0x0e36('0x2b')]};});_0x259cfa[_0x0e36('0x2c')]=_[_0x0e36('0x27')](_0x22cffb,_0x0e36('0x24'));_0x259cfa['query']=_[_0x0e36('0x2d')](_0x2fdbae[_0x0e36('0x2e')]);_0x259cfa[_0x0e36('0x2f')]=_['intersection'](_0x259cfa[_0x0e36('0x2c')],_0x259cfa[_0x0e36('0x2e')]);_0x49dc97[_0x0e36('0x30')]=_[_0x0e36('0x31')](_0x259cfa['model'],qs[_0x0e36('0x32')](_0x2fdbae[_0x0e36('0x2e')]['fields']));_0x49dc97[_0x0e36('0x30')]=_0x49dc97[_0x0e36('0x30')][_0x0e36('0x33')]?_0x49dc97[_0x0e36('0x30')]:_0x259cfa[_0x0e36('0x2c')];if(!_0x2fdbae[_0x0e36('0x2e')][_0x0e36('0x34')](_0x0e36('0x35'))){_0x49dc97[_0x0e36('0x18')]=qs['limit'](_0x2fdbae[_0x0e36('0x2e')][_0x0e36('0x18')]);_0x49dc97[_0x0e36('0x1a')]=qs['offset'](_0x2fdbae[_0x0e36('0x2e')][_0x0e36('0x1a')]);}_0x49dc97['order']=qs[_0x0e36('0x36')](_0x2fdbae['query']['sort']);_0x49dc97[_0x0e36('0x37')]=qs['filters'](_[_0x0e36('0x38')](_0x2fdbae[_0x0e36('0x2e')],_0x259cfa['filters']),_0x22cffb);if(_0x2fdbae[_0x0e36('0x2e')]['filter']){_0x49dc97[_0x0e36('0x37')]=_[_0x0e36('0x39')](_0x49dc97[_0x0e36('0x37')],{'$or':_[_0x0e36('0x27')](_0x22cffb,function(_0x1d5a1b){if(_0x1d5a1b[_0x0e36('0x3a')]!==_0x0e36('0x3b')){var _0xaf65b4={};_0xaf65b4[_0x1d5a1b[_0x0e36('0x24')]]={'$like':'%'+_0x2fdbae[_0x0e36('0x2e')][_0x0e36('0x3c')]+'%'};return _0xaf65b4;}})});}_0x49dc97=_['merge']({},_0x49dc97,_0x2fdbae[_0x0e36('0x3d')]);var _0x2d22b2={'where':_0x49dc97[_0x0e36('0x37')]};return db[_0x0e36('0x28')][_0x0e36('0x19')](_0x2d22b2)['then'](function(_0x48065a){_0x2a0a19[_0x0e36('0x19')]=_0x48065a;if(_0x2fdbae['query'][_0x0e36('0x3e')]){_0x49dc97[_0x0e36('0x3f')]=[{'all':!![]}];}return db[_0x0e36('0x28')][_0x0e36('0x40')](_0x49dc97);})['then'](function(_0x3bbba3){_0x2a0a19['rows']=_0x3bbba3;return _0x2a0a19;})['then'](respondWithFilteredResult(_0x5d3959,_0x49dc97))[_0x0e36('0x41')](handleError(_0x5d3959,null));};exports['show']=function(_0x2509b3,_0x4b9561){var _0xaea43={'raw':!![],'where':{'id':_0x2509b3['params']['id']}},_0xb259fe={};_0xb259fe[_0x0e36('0x2c')]=_['keys'](db['OpenchannelApplication'][_0x0e36('0x29')]);_0xb259fe[_0x0e36('0x2e')]=_[_0x0e36('0x2d')](_0x2509b3['query']);_0xb259fe[_0x0e36('0x2f')]=_[_0x0e36('0x31')](_0xb259fe['model'],_0xb259fe[_0x0e36('0x2e')]);_0xaea43['attributes']=_[_0x0e36('0x31')](_0xb259fe['model'],qs[_0x0e36('0x32')](_0x2509b3[_0x0e36('0x2e')][_0x0e36('0x32')]));_0xaea43['attributes']=_0xaea43[_0x0e36('0x30')][_0x0e36('0x33')]?_0xaea43[_0x0e36('0x30')]:_0xb259fe[_0x0e36('0x2c')];if(_0x2509b3['query'][_0x0e36('0x3e')]){_0xaea43[_0x0e36('0x3f')]=[{'all':!![]}];}_0xaea43=_['merge']({},_0xaea43,_0x2509b3[_0x0e36('0x3d')]);return db[_0x0e36('0x28')][_0x0e36('0x42')](_0xaea43)[_0x0e36('0x20')](handleEntityNotFound(_0x4b9561,null))['then'](respondWithResult(_0x4b9561,null))[_0x0e36('0x41')](handleError(_0x4b9561,null));};exports['create']=function(_0x554acb,_0x1ed9d3){return db[_0x0e36('0x28')][_0x0e36('0x43')](_0x554acb['body'],{})[_0x0e36('0x20')](respondWithResult(_0x1ed9d3,0xc9))[_0x0e36('0x41')](handleError(_0x1ed9d3,null));};exports['update']=function(_0xf0673e,_0x1a5d84){if(_0xf0673e[_0x0e36('0x44')]['id']){delete _0xf0673e['body']['id'];}return db['OpenchannelApplication'][_0x0e36('0x42')]({'where':{'id':_0xf0673e[_0x0e36('0x45')]['id']}})[_0x0e36('0x20')](handleEntityNotFound(_0x1a5d84,null))[_0x0e36('0x20')](saveUpdates(_0xf0673e[_0x0e36('0x44')],null))['then'](respondWithResult(_0x1a5d84,null))[_0x0e36('0x41')](handleError(_0x1a5d84,null));};exports[_0x0e36('0x21')]=function(_0x526796,_0x30d258){return db[_0x0e36('0x28')][_0x0e36('0x42')]({'where':{'id':_0x526796[_0x0e36('0x45')]['id']}})[_0x0e36('0x20')](handleEntityNotFound(_0x30d258,null))[_0x0e36('0x20')](removeEntity(_0x30d258,null))['catch'](handleError(_0x30d258,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 2c588e0..54c1bb4 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 _0xbb77=['openchannel_applications','utf8mb4','lodash','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x48546a,_0x107120){var _0x120e0f=function(_0xe11301){while(--_0xe11301){_0x48546a['push'](_0x48546a['shift']());}};_0x120e0f(++_0x107120);}(_0xbb77,0x1df));var _0x7bb7=function(_0x19fb2f,_0x51ca51){_0x19fb2f=_0x19fb2f-0x0;var _0x77ca88=_0xbb77[_0x19fb2f];return _0x77ca88;};'use strict';var _=require(_0x7bb7('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x7bb7('0x1'));var rp=require(_0x7bb7('0x2'));var fs=require('fs');var path=require(_0x7bb7('0x3'));var rimraf=require(_0x7bb7('0x4'));var config=require('../../config/environment');var attributes=require('./openchannelApplication.attributes');module[_0x7bb7('0x5')]=function(_0x47a0ee,_0x3bdc7f){return _0x47a0ee[_0x7bb7('0x6')]('OpenchannelApplication',attributes,{'tableName':_0x7bb7('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7bb7('0x8'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xb801=['define','OpenchannelApplication','openchannel_applications','utf8mb4','util','../../config/logger','api','moment','request-promise','path','./openchannelApplication.attributes'];(function(_0x17208f,_0x4d14fb){var _0x28cbe6=function(_0xb203bb){while(--_0xb203bb){_0x17208f['push'](_0x17208f['shift']());}};_0x28cbe6(++_0x4d14fb);}(_0xb801,0x72));var _0x1b80=function(_0xd53e10,_0xcdea82){_0xd53e10=_0xd53e10-0x0;var _0x1f4b56=_0xb801[_0xd53e10];return _0x1f4b56;};'use strict';var _=require('lodash');var util=require(_0x1b80('0x0'));var logger=require(_0x1b80('0x1'))(_0x1b80('0x2'));var moment=require(_0x1b80('0x3'));var BPromise=require('bluebird');var rp=require(_0x1b80('0x4'));var fs=require('fs');var path=require(_0x1b80('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1b80('0x6'));module['exports']=function(_0x290dfa,_0x21a00e){return _0x290dfa[_0x1b80('0x7')](_0x1b80('0x8'),attributes,{'tableName':_0x1b80('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1b80('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index a31f60f..f2c2f06 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 _0x68bb=['raw','where','attributes','UpdateOpenchannelApplication','stringify','catch','lodash','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','error','code','message','OpenchannelApplication','update','body','options'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x68bb,0x1d6));var _0xb68b=function(_0xf4aa53,_0x1000ab){_0xf4aa53=_0xf4aa53-0x0;var _0xe34fa8=_0x68bb[_0xf4aa53];return _0xe34fa8;};'use strict';var _=require(_0xb68b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb68b('0x1'));var fs=require('fs');var Redis=require(_0xb68b('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xb68b('0x3'));var logger=require('../../config/logger')(_0xb68b('0x4'));var config=require(_0xb68b('0x5'));var jayson=require(_0xb68b('0x6'));var client=jayson[_0xb68b('0x7')][_0xb68b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2dc5b0,_0x3e880f,_0x440c9e){return new BPromise(function(_0x2fbc0b,_0x398e8b){return client[_0xb68b('0x9')](_0x2dc5b0,_0x440c9e)[_0xb68b('0xa')](function(_0x5504af){logger[_0xb68b('0xb')](_0xb68b('0xc'),_0x3e880f,_0xb68b('0xd'));logger[_0xb68b('0xe')](_0xb68b('0xf'),_0x3e880f,_0xb68b('0xd'),JSON['stringify'](_0x5504af));if(_0x5504af['error']){if(_0x5504af[_0xb68b('0x10')][_0xb68b('0x11')]===0x1f4){logger[_0xb68b('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x3e880f,_0x5504af[_0xb68b('0x10')][_0xb68b('0x12')]);return _0x398e8b(_0x5504af['error'][_0xb68b('0x12')]);}logger[_0xb68b('0x10')](_0xb68b('0xc'),_0x3e880f,_0x5504af[_0xb68b('0x10')]['message']);return _0x2fbc0b(_0x5504af[_0xb68b('0x10')][_0xb68b('0x12')]);}else{logger[_0xb68b('0xb')](_0xb68b('0xc'),_0x3e880f,'request\x20sent');_0x2fbc0b(_0x5504af['result'][_0xb68b('0x12')]);}})['catch'](function(_0x564c19){logger[_0xb68b('0x10')](_0xb68b('0xc'),_0x3e880f,_0x564c19);_0x398e8b(_0x564c19);});});}exports['UpdateOpenchannelApplication']=function(_0x1c84d2){var _0x5664a0=this;return new Promise(function(_0x111895,_0x5d1e3b){return db[_0xb68b('0x13')][_0xb68b('0x14')](_0x1c84d2[_0xb68b('0x15')],{'raw':_0x1c84d2[_0xb68b('0x16')]?_0x1c84d2[_0xb68b('0x16')][_0xb68b('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c84d2[_0xb68b('0x16')]?_0x1c84d2['options'][_0xb68b('0x18')]||null:null,'attributes':_0x1c84d2['options']?_0x1c84d2[_0xb68b('0x16')][_0xb68b('0x19')]||null:null,'limit':_0x1c84d2[_0xb68b('0x16')]?_0x1c84d2[_0xb68b('0x16')]['limit']||null:null})[_0xb68b('0xa')](function(_0x2d7a8a){logger[_0xb68b('0xb')](_0xb68b('0x1a'),_0x1c84d2);logger[_0xb68b('0xe')]('UpdateOpenchannelApplication',_0x1c84d2,JSON[_0xb68b('0x1b')](_0x2d7a8a));_0x111895(_0x2d7a8a);})[_0xb68b('0x1c')](function(_0x39167b){logger[_0xb68b('0x10')](_0xb68b('0x1a'),_0x39167b[_0xb68b('0x12')],_0x1c84d2);_0x5d1e3b(_0x5664a0['error'](0x1f4,_0x39167b[_0xb68b('0x12')]));});});}; \ No newline at end of file +var _0x70af=['message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','info','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x70af,0xfc));var _0xf70a=function(_0x4e65ea,_0x538229){_0x4e65ea=_0x4e65ea-0x0;var _0x351f9b=_0x70af[_0x4e65ea];return _0x351f9b;};'use strict';var _=require(_0xf70a('0x0'));var util=require(_0xf70a('0x1'));var moment=require(_0xf70a('0x2'));var BPromise=require('bluebird');var rs=require(_0xf70a('0x3'));var fs=require('fs');var Redis=require(_0xf70a('0x4'));var db=require(_0xf70a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf70a('0x6'))(_0xf70a('0x7'));var config=require(_0xf70a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf70a('0x9')][_0xf70a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e4691,_0x24ae7b,_0x4c01aa){return new BPromise(function(_0x3614e3,_0x1abaf9){return client['request'](_0x3e4691,_0x4c01aa)[_0xf70a('0xb')](function(_0x113f8d){logger['info'](_0xf70a('0xc'),_0x24ae7b,_0xf70a('0xd'));logger[_0xf70a('0xe')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x24ae7b,_0xf70a('0xd'),JSON[_0xf70a('0xf')](_0x113f8d));if(_0x113f8d[_0xf70a('0x10')]){if(_0x113f8d['error'][_0xf70a('0x11')]===0x1f4){logger[_0xf70a('0x10')](_0xf70a('0xc'),_0x24ae7b,_0x113f8d['error']['message']);return _0x1abaf9(_0x113f8d[_0xf70a('0x10')][_0xf70a('0x12')]);}logger[_0xf70a('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x24ae7b,_0x113f8d[_0xf70a('0x10')][_0xf70a('0x12')]);return _0x3614e3(_0x113f8d[_0xf70a('0x10')][_0xf70a('0x12')]);}else{logger['info'](_0xf70a('0xc'),_0x24ae7b,_0xf70a('0xd'));_0x3614e3(_0x113f8d[_0xf70a('0x13')][_0xf70a('0x12')]);}})[_0xf70a('0x14')](function(_0x49eadd){logger[_0xf70a('0x10')](_0xf70a('0xc'),_0x24ae7b,_0x49eadd);_0x1abaf9(_0x49eadd);});});}exports[_0xf70a('0x15')]=function(_0x1d77e0){var _0x2ffd7a=this;return new Promise(function(_0x21c93d,_0x92d01a){return db[_0xf70a('0x16')][_0xf70a('0x17')](_0x1d77e0[_0xf70a('0x18')],{'raw':_0x1d77e0[_0xf70a('0x19')]?_0x1d77e0[_0xf70a('0x19')][_0xf70a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d77e0['options']?_0x1d77e0[_0xf70a('0x19')][_0xf70a('0x1b')]||null:null,'attributes':_0x1d77e0[_0xf70a('0x19')]?_0x1d77e0[_0xf70a('0x19')][_0xf70a('0x1c')]||null:null,'limit':_0x1d77e0[_0xf70a('0x19')]?_0x1d77e0[_0xf70a('0x19')]['limit']||null:null})[_0xf70a('0xb')](function(_0x1e36da){logger[_0xf70a('0x1d')](_0xf70a('0x15'),_0x1d77e0);logger['debug'](_0xf70a('0x15'),_0x1d77e0,JSON['stringify'](_0x1e36da));_0x21c93d(_0x1e36da);})['catch'](function(_0x434733){logger[_0xf70a('0x10')](_0xf70a('0x15'),_0x434733[_0xf70a('0x12')],_0x1d77e0);_0x92d01a(_0x2ffd7a['error'](0x1f4,_0x434733[_0xf70a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 939d64d..afa9001 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 _0x6cff=['/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','/:id','show'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x6cff,0xfa));var _0xf6cf=function(_0x289842,_0x2d9db4){_0x289842=_0x289842-0x0;var _0x16155a=_0x6cff[_0x289842];return _0x16155a;};'use strict';var multer=require(_0xf6cf('0x0'));var util=require('util');var path=require(_0xf6cf('0x1'));var timeout=require(_0xf6cf('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf6cf('0x3'));var interaction=require(_0xf6cf('0x4'));var config=require(_0xf6cf('0x5'));var controller=require('./openchannelInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xf6cf('0x6')](_0xf6cf('0x7'),auth[_0xf6cf('0x8')](),controller['describe']);router[_0xf6cf('0x6')](_0xf6cf('0x9'),auth[_0xf6cf('0x8')](),controller[_0xf6cf('0xa')]);router[_0xf6cf('0x6')](_0xf6cf('0xb'),auth[_0xf6cf('0x8')](),controller['getMessages']);router['get'](_0xf6cf('0xc'),auth[_0xf6cf('0x8')](),controller[_0xf6cf('0xd')]);router[_0xf6cf('0xe')]('/',auth['isAuthenticated'](),controller[_0xf6cf('0xf')]);router[_0xf6cf('0xe')](_0xf6cf('0xb'),auth[_0xf6cf('0x8')](),controller[_0xf6cf('0x10')]);router[_0xf6cf('0xe')](_0xf6cf('0x11'),auth[_0xf6cf('0x8')](),interaction[_0xf6cf('0x12')](_0xf6cf('0x13'),_0xf6cf('0x14')),controller[_0xf6cf('0x15')]);router[_0xf6cf('0x16')](_0xf6cf('0x9'),auth['isAuthenticated'](),interaction[_0xf6cf('0x12')](_0xf6cf('0x13'),_0xf6cf('0x17')),controller[_0xf6cf('0x18')]);router[_0xf6cf('0x19')](_0xf6cf('0x9'),auth[_0xf6cf('0x8')](),interaction[_0xf6cf('0x12')](_0xf6cf('0x13'),_0xf6cf('0x1a')),controller[_0xf6cf('0x1b')]);router[_0xf6cf('0x19')](_0xf6cf('0x11'),auth[_0xf6cf('0x8')](),controller[_0xf6cf('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x97ab=['isAuthenticated','index','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','openchannelinteraction:update','update','openchannelinteraction:destroy','destroy','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./openchannelInteraction.controller','get'];(function(_0x5ca5bc,_0x5b8a9d){var _0x26ca86=function(_0x1ad9a6){while(--_0x1ad9a6){_0x5ca5bc['push'](_0x5ca5bc['shift']());}};_0x26ca86(++_0x5b8a9d);}(_0x97ab,0xf6));var _0xb97a=function(_0x5945ad,_0xddc347){_0x5945ad=_0x5945ad-0x0;var _0x26944b=_0x97ab[_0x5945ad];return _0x26944b;};'use strict';var multer=require(_0xb97a('0x0'));var util=require(_0xb97a('0x1'));var path=require(_0xb97a('0x2'));var timeout=require(_0xb97a('0x3'));var express=require(_0xb97a('0x4'));var router=express['Router']();var fs_extra=require(_0xb97a('0x5'));var auth=require(_0xb97a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb97a('0x7'));var controller=require(_0xb97a('0x8'));router[_0xb97a('0x9')]('/',auth[_0xb97a('0xa')](),controller[_0xb97a('0xb')]);router[_0xb97a('0x9')]('/describe',auth[_0xb97a('0xa')](),controller[_0xb97a('0xc')]);router[_0xb97a('0x9')](_0xb97a('0xd'),auth[_0xb97a('0xa')](),controller[_0xb97a('0xe')]);router[_0xb97a('0x9')](_0xb97a('0xf'),auth[_0xb97a('0xa')](),controller[_0xb97a('0x10')]);router['get'](_0xb97a('0x11'),auth[_0xb97a('0xa')](),controller[_0xb97a('0x12')]);router[_0xb97a('0x13')]('/',auth[_0xb97a('0xa')](),controller['create']);router['post'](_0xb97a('0xf'),auth['isAuthenticated'](),controller[_0xb97a('0x14')]);router[_0xb97a('0x13')](_0xb97a('0x15'),auth[_0xb97a('0xa')](),interaction[_0xb97a('0x16')](_0xb97a('0x17'),_0xb97a('0x18')),controller[_0xb97a('0x19')]);router['put']('/:id',auth[_0xb97a('0xa')](),interaction['tracked'](_0xb97a('0x17'),_0xb97a('0x1a')),controller[_0xb97a('0x1b')]);router['delete']('/:id',auth[_0xb97a('0xa')](),interaction[_0xb97a('0x16')](_0xb97a('0x17'),_0xb97a('0x1c')),controller[_0xb97a('0x1d')]);router[_0xb97a('0x1e')](_0xb97a('0x15'),auth['isAuthenticated'](),controller['removeTags']);module[_0xb97a('0x1f')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 373754f..ed603d1 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 _0x7617=['exports','DATE','STRING','ENUM','out','sequelize'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7617,0x1cd));var _0x7761=function(_0x3228f0,_0x5a61b2){_0x3228f0=_0x3228f0-0x0;var _0x54baab=_0x7617[_0x3228f0];return _0x54baab;};'use strict';var Sequelize=require(_0x7761('0x0'));module[_0x7761('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7761('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x7761('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x7761('0x3')]},'externalUrl':{'type':Sequelize[_0x7761('0x3')]},'lastMsgAt':{'type':Sequelize[_0x7761('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x7761('0x4')]('in',_0x7761('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x7761('0x3')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xe1f0=['exports','BOOLEAN','STRING','DATE','ENUM'];(function(_0x52f14b,_0xa6b793){var _0x866eb0=function(_0x3a40f1){while(--_0x3a40f1){_0x52f14b['push'](_0x52f14b['shift']());}};_0x866eb0(++_0xa6b793);}(_0xe1f0,0x1c2));var _0x0e1f=function(_0x4a6a67,_0x4bada2){_0x4a6a67=_0x4a6a67-0x0;var _0x3f67ac=_0xe1f0[_0x4a6a67];return _0x3f67ac;};'use strict';var Sequelize=require('sequelize');module[_0x0e1f('0x0')]={'closed':{'type':Sequelize[_0x0e1f('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x0e1f('0x2')]},'secondDisposition':{'type':Sequelize[_0x0e1f('0x2')]},'thirdDisposition':{'type':Sequelize[_0x0e1f('0x2')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x0e1f('0x3')]},'threadId':{'type':Sequelize[_0x0e1f('0x2')]},'externalUrl':{'type':Sequelize[_0x0e1f('0x2')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x0e1f('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x0e1f('0x2')]},'autoreplyExecuted':{'type':Sequelize[_0x0e1f('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index cafaaac..68ff07a 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 _0x1be5=['json','offset','undefined','limit','count','Content-Range','reject','save','destroy','then','error','name','send','Users','map','fullname','TagIds','split','forEach','push','catch','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','field','tools_tags','u.id','from','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','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','parseSearch','search','sqlOperator','length','conditions','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','find','buildExpression','text','start','end','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','`unreadMessages`\x20>\x200','tag','isArray','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','order','contactName','DESC','isEmpty','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','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.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','OpenchannelInteractionId','show','params','rawAttributes','includeAll','create','update','describe','addMessage','OpenchannelMessage','ids','getMessages','pick','filter','YYYY-MM-DD\x20HH:mm:ss','options','findAll','rows','addTags','setTags','omit','spread','color','removeTags','unix','join','root','tmp','server','attachments','format','CmContact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','OpenchannelAccount','Account','Owner','get','Openchannel','N.A.','closed','closedAt','disposition','Public','Private','existsSync','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','download','log','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','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','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status'];(function(_0xede3b6,_0x3a9555){var _0x421fbb=function(_0x29e1c6){while(--_0x29e1c6){_0xede3b6['push'](_0xede3b6['shift']());}};_0x421fbb(++_0x3a9555);}(_0x1be5,0xca));var _0x51be=function(_0x4e1a17,_0x21751f){_0x4e1a17=_0x4e1a17-0x0;var _0x443b80=_0x1be5[_0x4e1a17];return _0x443b80;};'use strict';var emlformat=require(_0x51be('0x0'));var rimraf=require(_0x51be('0x1'));var zipdir=require(_0x51be('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x51be('0x3'));var moment=require(_0x51be('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x51be('0x5'));var util=require(_0x51be('0x6'));var path=require(_0x51be('0x7'));var sox=require(_0x51be('0x8'));var csv=require(_0x51be('0x9'));var ejs=require(_0x51be('0xa'));var fs=require('fs');var fs_extra=require(_0x51be('0xb'));var _=require(_0x51be('0xc'));var squel=require(_0x51be('0xd'));var crypto=require(_0x51be('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x51be('0xf'));var toCsv=require(_0x51be('0x9'));var querystring=require('querystring');var Papa=require(_0x51be('0x10'));var Redis=require(_0x51be('0x11'));var authService=require(_0x51be('0x12'));var qs=require(_0x51be('0x13'));var as=require(_0x51be('0x14'));var pdf=require(_0x51be('0x15'));var hardwareService=require(_0x51be('0x16'));var logger=require('../../config/logger')(_0x51be('0x17'));var utils=require(_0x51be('0x18'));var config=require(_0x51be('0x19'));var licenseUtil=require(_0x51be('0x1a'));var db=require('../../mysqldb')['db'];config[_0x51be('0x1b')]=_[_0x51be('0x1c')](config[_0x51be('0x1b')],{'host':_0x51be('0x1d'),'port':0x18eb});var socket=require(_0x51be('0x1e'))(new Redis(config[_0x51be('0x1b')]));require(_0x51be('0x1f'))[_0x51be('0x20')](socket);function respondWithStatusCode(_0x4f9c39,_0x13ff7c){_0x13ff7c=_0x13ff7c||0xcc;return function(_0x4dfcf3){if(_0x4dfcf3){return _0x4f9c39[_0x51be('0x21')](_0x13ff7c);}return _0x4f9c39[_0x51be('0x22')](_0x13ff7c)['end']();};}function respondWithResult(_0x5ab4a4,_0x46cb9f){_0x46cb9f=_0x46cb9f||0xc8;return function(_0x926219){if(_0x926219){return _0x5ab4a4[_0x51be('0x22')](_0x46cb9f)[_0x51be('0x23')](_0x926219);}};}function respondWithFilteredResult(_0x1999f3,_0x5afcfb){return function(_0x394a7d){if(_0x394a7d){var _0x454846=typeof _0x5afcfb[_0x51be('0x24')]===_0x51be('0x25')&&typeof _0x5afcfb[_0x51be('0x26')]===_0x51be('0x25');var _0x551b0b=_0x394a7d[_0x51be('0x27')];var _0x8ebd79=_0x454846?0x0:_0x5afcfb[_0x51be('0x24')];var _0x4e46e1=_0x454846?_0x394a7d[_0x51be('0x27')]:_0x5afcfb[_0x51be('0x24')]+_0x5afcfb['limit'];var _0x5d69ca;if(_0x4e46e1>=_0x551b0b){_0x4e46e1=_0x551b0b;_0x5d69ca=0xc8;}else{_0x5d69ca=0xce;}_0x1999f3[_0x51be('0x22')](_0x5d69ca);return _0x1999f3['set'](_0x51be('0x28'),_0x8ebd79+'-'+_0x4e46e1+'/'+_0x551b0b)[_0x51be('0x23')](_0x394a7d);}return null;};}function patchUpdates(_0x4cd55b){return function(_0x4b1da2){try{jsonpatch['apply'](_0x4b1da2,_0x4cd55b,!![]);}catch(_0x112c20){return BPromise[_0x51be('0x29')](_0x112c20);}return _0x4b1da2[_0x51be('0x2a')]();};}function saveUpdates(_0x35ebb6,_0x51ab88){return function(_0x1890f1){if(_0x1890f1){return _0x1890f1['update'](_0x35ebb6)['then'](function(_0x476f2e){return _0x476f2e;});}return null;};}function removeEntity(_0x4c5c17,_0xf9687){return function(_0x17a12a){if(_0x17a12a){return _0x17a12a[_0x51be('0x2b')]()[_0x51be('0x2c')](function(){_0x4c5c17[_0x51be('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x584e96,_0x503565){return function(_0x3f10aa){if(!_0x3f10aa){_0x584e96['sendStatus'](0x194);}return _0x3f10aa;};}function handleError(_0x424d16,_0x344efb){_0x344efb=_0x344efb||0x1f4;return function(_0x40777b){logger[_0x51be('0x2d')](_0x40777b['stack']);if(_0x40777b[_0x51be('0x2e')]){delete _0x40777b[_0x51be('0x2e')];}_0x424d16[_0x51be('0x22')](_0x344efb)[_0x51be('0x2f')](_0x40777b);};}function getInteractionUsers(_0x86ae60,_0x2081a9){return new BPromise(function(_0x1571f2,_0x4da564){try{if(_0x2081a9[_0x86ae60['id']]){_0x86ae60[_0x51be('0x30')]=_[_0x51be('0x31')](_0x2081a9[_0x86ae60['id']],function(_0x30effd){return{'id':_0x30effd['id'],'fullname':_0x30effd[_0x51be('0x32')]};});}}catch(_0xc42142){_0x4da564(_0xc42142);}_0x1571f2(_0x86ae60);});}function getInteractionTags(_0x278364,_0x2f8733){return new BPromise(function(_0x2e773f,_0x5ec3e9){try{if(_0x278364['TagIds']){_0x278364['Tags']=[];_0x278364[_0x51be('0x33')][_0x51be('0x34')](',')[_0x51be('0x35')](function(_0x38166c){_0x278364['Tags'][_0x51be('0x36')](_0x2f8733[_0x38166c]);});}delete _0x278364['TagIds'];}catch(_0x16ccd3){_0x5ec3e9(_0x16ccd3);}_0x2e773f(_0x278364);});}function updateOpenchannelInteraction(_0x3b5b2f,_0x29a053,_0x3725ea){return new BPromise(function(_0x537982,_0x24c12c){return getInteractionUsers(_0x3b5b2f,_0x3725ea)[_0x51be('0x2c')](function(_0x4d05e6){return getInteractionTags(_0x4d05e6,_0x29a053);})['then'](function(_0x30884d){_0x537982(_0x30884d);})[_0x51be('0x37')](function(_0x5d60de){_0x24c12c(_0x5d60de);});});}exports['index']=function(_0x4e0f38,_0x32268d){var _0x29a691={},_0x280b22={},_0x469338={'count':0x0,'rows':[]};var _0x4a88a9=_[_0x51be('0x31')](db['OpenchannelInteraction']['rawAttributes'],function(_0x5c61c9){return{'name':_0x5c61c9[_0x51be('0x38')],'type':_0x5c61c9[_0x51be('0x39')][_0x51be('0x3a')]};});_0x280b22[_0x51be('0x3b')]=_['map'](_0x4a88a9,_0x51be('0x2e'));_0x280b22['query']=_[_0x51be('0x3c')](_0x4e0f38[_0x51be('0x3d')]);_0x280b22[_0x51be('0x3e')]=_[_0x51be('0x3f')](_0x280b22[_0x51be('0x3b')],_0x280b22[_0x51be('0x3d')]);_0x29a691[_0x51be('0x40')]=_[_0x51be('0x3f')](_0x280b22[_0x51be('0x3b')],qs[_0x51be('0x41')](_0x4e0f38[_0x51be('0x3d')][_0x51be('0x41')]));_0x29a691[_0x51be('0x40')]=_0x29a691[_0x51be('0x40')]['length']?_0x29a691[_0x51be('0x40')]:_0x280b22['model'];if(!_0x4e0f38[_0x51be('0x3d')][_0x51be('0x42')](_0x51be('0x43'))){_0x29a691[_0x51be('0x26')]=qs[_0x51be('0x26')](_0x4e0f38[_0x51be('0x3d')][_0x51be('0x26')]);_0x29a691[_0x51be('0x24')]=qs[_0x51be('0x24')](_0x4e0f38[_0x51be('0x3d')][_0x51be('0x24')]);}_0x29a691['order']=qs[_0x51be('0x44')](_0x4e0f38['query']['sort']);_0x29a691[_0x51be('0x45')]=qs[_0x51be('0x3e')](_['pick'](_0x4e0f38[_0x51be('0x3d')],_0x280b22['filters']),_0x4a88a9);var _0x378763=[];var _0x17bc24=squel['select']()[_0x51be('0x46')]('id')[_0x51be('0x46')](_0x51be('0x2e'))[_0x51be('0x46')]('color')['from'](_0x51be('0x47'));var _0x26aa82=squel['select']()[_0x51be('0x46')](_0x51be('0x48'))[_0x51be('0x46')]('u.fullname')['field']('ui.OpenchannelInteractionId')[_0x51be('0x49')](_0x51be('0x4a'),'ui')[_0x51be('0x4b')](_0x51be('0x4c'),'u',_0x51be('0x4d'));var _0x4314c8=squel[_0x51be('0x4e')]()[_0x51be('0x49')](_0x51be('0x4f'),'i')[_0x51be('0x4b')](_0x51be('0x50'),'c',_0x51be('0x51'))[_0x51be('0x4b')](_0x51be('0x4c'),'o',_0x51be('0x52'))[_0x51be('0x4b')](_0x51be('0x53'),'a',_0x51be('0x54'))[_0x51be('0x4b')](_0x51be('0x55'),'me',_0x51be('0x56'))['left_join']('openchannel_interaction_has_tags','it',_0x51be('0x57'))[_0x51be('0x4b')]('tools_tags','t',_0x51be('0x58'));var _0x2461ef=squel[_0x51be('0x59')]();var _0x2b9982=[];var _0xaefa0e=squel[_0x51be('0x59')]();var _0x6405a1;if(_0x4e0f38[_0x51be('0x3d')]['search']){_0x6405a1=as[_0x51be('0x5a')](_0x4e0f38[_0x51be('0x3d')][_0x51be('0x5b')]);var _0xf3fbf6=_0x6405a1[_0x51be('0x5c')];for(var _0x4bd104=0x0;_0x4bd104<_0x6405a1['conditions'][_0x51be('0x5d')];_0x4bd104++){var _0x41b909=_0x6405a1[_0x51be('0x5e')][_0x4bd104];var _0x4eb6b8='i';var _0x48c377=_['find'](_0x4a88a9,[_0x51be('0x2e'),_0x41b909['field']]);if(!_0x48c377){switch(_0x41b909[_0x51be('0x46')]){case _0x51be('0x5f'):if(_0x41b909['value']==0x1){_0x4314c8[_0x51be('0x60')]('`'+_0x41b909['field']+_0x51be('0x61'));}else{_0x4314c8[_0x51be('0x60')]('`'+_0x41b909['field']+_0x51be('0x62'));}break;case _0x51be('0x63'):if(_0x41b909[_0x51be('0x64')]===_0x51be('0x65')){if(_0x41b909[_0x51be('0x66')][_0x51be('0x34')]('\x20')['length']>0x1){_0x2461ef[_0xf3fbf6]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x41b909[_0x51be('0x66')]),null);}else{var _0x10c1ed='%'+_0x41b909[_0x51be('0x66')]+'%';_0x2461ef[_0xf3fbf6]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x10c1ed,_0x10c1ed,_0x10c1ed);}}else{_0x48c377=_[_0x51be('0x67')](_0x4a88a9,[_0x51be('0x2e'),'ContactId']);_0x41b909[_0x51be('0x46')]='ContactId';_0x462c03=as[_0x51be('0x68')](_0x4eb6b8,_0x48c377[_0x51be('0x39')],_0x41b909);_0x2461ef[_0xf3fbf6](_0x462c03[_0x51be('0x69')],_0x462c03[_0x51be('0x66')][_0x51be('0x6a')],_0x462c03[_0x51be('0x66')][_0x51be('0x6b')]);}break;case _0x51be('0x6c'):var _0x2f3460=_0x41b909[_0x51be('0x66')][_0x51be('0x34')](',')[_0x51be('0x31')](function(_0x21c838){return Number(_0x21c838);});_0x2f3460['forEach'](function(_0x442ac0){_0xaefa0e['or'](_0x51be('0x6d'),'%,'+_0x442ac0+',%');});_0x2b9982=_[_0x51be('0x6e')](_0x2b9982,_0x2f3460);break;case _0x51be('0x6f'):if(_0x41b909[_0x51be('0x64')]===_0x51be('0x65')){_0x2461ef[_0xf3fbf6](_0x51be('0x70'),'%'+_0x41b909[_0x51be('0x66')]+'%',null);}else{_0x48c377=_[_0x51be('0x67')](_0x4a88a9,['name','UserId']);_0x41b909[_0x51be('0x46')]=_0x51be('0x71');_0x462c03=as['buildExpression'](_0x4eb6b8,_0x48c377['type'],_0x41b909);_0x2461ef[_0xf3fbf6](_0x462c03[_0x51be('0x69')],_0x462c03[_0x51be('0x66')][_0x51be('0x6a')],_0x462c03[_0x51be('0x66')]['end']);}break;case _0x51be('0x72'):_0x462c03=as[_0x51be('0x68')]('me',null,_0x41b909);_0x2461ef[_0xf3fbf6](_0x462c03[_0x51be('0x69')],_0x462c03[_0x51be('0x66')]['start'],_0x462c03[_0x51be('0x66')]['end']);break;}}else{var _0x462c03=as[_0x51be('0x68')](_0x4eb6b8,_0x48c377[_0x51be('0x39')],_0x41b909);_0x2461ef[_0xf3fbf6](_0x462c03['text'],_0x462c03[_0x51be('0x66')][_0x51be('0x6a')],_0x462c03[_0x51be('0x66')]['end']);}}}else{var _0x200d23=_(_0x4e0f38[_0x51be('0x3d')])[_0x51be('0x3c')]()[_0x51be('0x31')](function(_0x3485ef){return _[_0x51be('0x73')](_0x4a88a9,['name',_0x3485ef])?_0x3485ef:undefined;})[_0x51be('0x74')]()['value']();if(!_['isEmpty'](_0x200d23)){_0x200d23[_0x51be('0x35')](function(_0x1156e5){if(_0x1156e5===_0x51be('0x75')){_0x4314c8[_0x51be('0x45')](_0x51be('0x76'),[]['concat'](_0x4e0f38[_0x51be('0x3d')][_0x1156e5]));}else if(_0x1156e5==='createdAt'){var _0x4c9414=JSON[_0x51be('0x77')](_0x4e0f38[_0x51be('0x3d')][_0x1156e5])[_0x51be('0x78')];var _0x101873=JSON[_0x51be('0x77')](_0x4e0f38[_0x51be('0x3d')][_0x1156e5])[_0x51be('0x79')];_0x4314c8['where'](_0x51be('0x7a'),_0x4c9414,_0x101873);}else{if(_0x4e0f38['query'][_0x1156e5]===_0x51be('0x7b')){_0x4314c8['where']('i.'+_0x1156e5+'\x20IS\x20NULL');}else{_0x4314c8[_0x51be('0x45')]('i.'+_0x1156e5+'\x20=\x20?',_0x4e0f38['query'][_0x1156e5]);}}});}if(_0x4e0f38[_0x51be('0x3d')]['read']){if(_0x4e0f38['query'][_0x51be('0x7c')]==0x1){_0x4314c8['having']('`unreadMessages`\x20=\x200');}else{_0x4314c8[_0x51be('0x60')](_0x51be('0x7d'));}}if(_0x4e0f38['query'][_0x51be('0x7e')]){_0x2b9982=_[_0x51be('0x7f')](_0x4e0f38[_0x51be('0x3d')][_0x51be('0x7e')])?_0x4e0f38[_0x51be('0x3d')]['tag']:new Array(_0x4e0f38[_0x51be('0x3d')][_0x51be('0x7e')]);_0x2b9982[_0x51be('0x35')](function(_0x537548){_0xaefa0e['or'](_0x51be('0x6d'),'%,'+_0x537548+',%');});}if(_0x4e0f38[_0x51be('0x3d')]['filter']){var _0xe493ba=_0x4e0f38['query']['filter'][_0x51be('0x80')]('\x5c','\x5c\x5c')[_0x51be('0x80')](/'/g,'\x27\x27');if(qs[_0x51be('0x81')](_0xe493ba)){_0x2461ef['or'](_0x51be('0x82'),_0xe493ba+'%');}else{_0x2461ef['or'](_0x51be('0x83'),qs['getFullTextValue'](_0xe493ba))['or'](_0x51be('0x84'),_0xe493ba+'%')['or'](_0x51be('0x85'),_0xe493ba+'%');}}}_0x4314c8['where'](_0x2461ef);_0x4314c8[_0x51be('0x86')](_0x51be('0x87'));var _0x58baa8={'type':db[_0x51be('0x88')][_0x51be('0x89')]['SELECT'],'raw':!![]};var _0x5a0022=_0x4314c8[_0x51be('0x8a')]();_0x5a0022[_0x51be('0x46')]('i.id');_0x5a0022[_0x51be('0x46')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x29a691[_0x51be('0x8b')]){_0x29a691[_0x51be('0x8b')]['forEach'](function(_0x3874de){var _0x5e1d71=_0x3874de[0x0]===_0x51be('0x8c')?_0x3874de[0x0]:'i.'+_0x3874de[0x0];_0x4314c8[_0x51be('0x8b')](_0x5e1d71,_0x3874de[0x1]===_0x51be('0x8d')?![]:!![]);});}if(!_[_0x51be('0x8e')](_0x2b9982)){_0x4314c8[_0x51be('0x60')](_0xaefa0e);_0x5a0022[_0x51be('0x45')]('t.id\x20IN\x20?',_0x2b9982);}BPromise[_0x51be('0x8f')]()[_0x51be('0x2c')](function(){if(!_0x6405a1){if(_0x4e0f38[_0x51be('0x3d')][_0x51be('0x75')])return;_0x5a0022['where'](_0x51be('0x90'));_0x4314c8[_0x51be('0x45')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x4e0f38['user'][_0x51be('0x91')]!==_0x51be('0x92'))return;return _0x4e0f38[_0x51be('0x93')][_0x51be('0x94')]({'attributes':['id'],'raw':!![]})[_0x51be('0x2c')](function(_0x2fa922){if(_['isEmpty'](_0x2fa922)){_0x5a0022['where']('i.OpenchannelAccountId\x20IS\x20NULL');_0x4314c8['where'](_0x51be('0x95'));}else{_0x5a0022['where']('i.OpenchannelAccountId\x20IN\x20?',_['map'](_0x2fa922,'id'));_0x4314c8[_0x51be('0x45')](_0x51be('0x76'),_[_0x51be('0x31')](_0x2fa922,'id'));}});})['then'](function(){if(_0x4e0f38[_0x51be('0x93')][_0x51be('0x91')]===_0x51be('0x92')&&!_0x6405a1&&!_0x4e0f38[_0x51be('0x3d')]['OpenchannelAccountId'])return[];return db[_0x51be('0x96')][_0x51be('0x3d')](_0x5a0022[_0x51be('0x97')](),_0x58baa8);})[_0x51be('0x2c')](function(_0x55f938){_0x469338[_0x51be('0x27')]=_0x55f938[_0x51be('0x5d')];if(_0x469338[_0x51be('0x27')]===0x0)return[];return db[_0x51be('0x96')][_0x51be('0x3d')](_0x17bc24[_0x51be('0x97')](),_0x58baa8)['then'](function(_0x436618){_0x378763=_[_0x51be('0x98')](_0x436618,'id');_0x58baa8=_[_0x51be('0x99')](_0x58baa8,{'model':db[_0x51be('0x9a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4e0f38[_0x51be('0x3d')][_0x51be('0x41')]){_0x29a691['attributes'][_0x51be('0x35')](function(_0x25aae5){_0x4314c8[_0x51be('0x46')]('i.'+_0x25aae5);});}else{_0x4314c8[_0x51be('0x46')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x51be('0x5f'));_0x4314c8[_0x51be('0x46')](_0x51be('0x9b'),_0x51be('0x9c'));_0x4314c8[_0x51be('0x46')](_0x51be('0x9d'),_0x51be('0x9e'));_0x4314c8[_0x51be('0x46')](_0x51be('0x9f'),_0x51be('0x8c'));_0x4314c8[_0x51be('0x46')](_0x51be('0xa0'));_0x4314c8['field']('c.firstName',_0x51be('0xa1'));_0x4314c8[_0x51be('0x46')](_0x51be('0xa2'),_0x51be('0xa3'));_0x4314c8['field'](_0x51be('0xa4'),_0x51be('0xa5'));_0x4314c8['field'](_0x51be('0xa6'),_0x51be('0xa7'));_0x4314c8[_0x51be('0x46')](_0x51be('0xa8'),'Contact.mobile');_0x4314c8['field']('c.fax',_0x51be('0xa9'));_0x4314c8[_0x51be('0x46')](_0x51be('0xaa'),_0x51be('0xab'));_0x4314c8[_0x51be('0x46')](_0x51be('0xac'),_0x51be('0xad'));_0x4314c8['field'](_0x51be('0xae'),'TagIds');}if(_0x29a691[_0x51be('0x26')])_0x4314c8[_0x51be('0x26')](_0x29a691[_0x51be('0x26')]);if(_0x29a691[_0x51be('0x24')])_0x4314c8['offset'](_0x29a691[_0x51be('0x24')]);return db[_0x51be('0x96')][_0x51be('0x3d')](_0x4314c8[_0x51be('0x97')](),_0x58baa8);})[_0x51be('0x2c')](function(_0x26eab4){if(_0x26eab4[_0x51be('0x5d')]>0x0)_0x26aa82[_0x51be('0x45')]('ui.OpenchannelInteractionId\x20IN\x20?',_[_0x51be('0x31')](_0x26eab4,'id'));return db['sequelize']['query'](_0x26aa82[_0x51be('0x97')](),_0x58baa8)[_0x51be('0x2c')](function(_0x11747){var _0x279dc1=_[_0x51be('0xaf')](_0x11747,_0x51be('0xb0'));var _0x491333=[];_0x26eab4['forEach'](function(_0x2d518f){_0x491333['push'](updateOpenchannelInteraction(_0x2d518f,_0x378763,_0x279dc1));});return BPromise['all'](_0x491333);});});})[_0x51be('0x2c')](function(_0x8509aa){_0x469338['rows']=_0x8509aa;return _0x469338;})[_0x51be('0x2c')](respondWithFilteredResult(_0x32268d,_0x29a691))[_0x51be('0x37')](handleError(_0x32268d,null));};exports[_0x51be('0xb1')]=function(_0x5d1978,_0x198f93){var _0xf61c38={};if(_0x5d1978[_0x51be('0x3d')][_0x51be('0x39')]&&_0x5d1978[_0x51be('0x3d')][_0x51be('0x39')]===_0x51be('0x49')){_0xf61c38[_0x51be('0x49')]=_0x5d1978['params']['id'];}else{_0xf61c38['id']=_0x5d1978[_0x51be('0xb2')]['id'];}var _0x16680a={'raw':![],'where':_0xf61c38},_0x3b3d1b={};_0x3b3d1b[_0x51be('0x3b')]=_[_0x51be('0x3c')](db['OpenchannelInteraction'][_0x51be('0xb3')]);_0x3b3d1b[_0x51be('0x3d')]=_[_0x51be('0x3c')](_0x5d1978['query']);_0x3b3d1b[_0x51be('0x3e')]=_[_0x51be('0x3f')](_0x3b3d1b['model'],_0x3b3d1b[_0x51be('0x3d')]);_0x16680a[_0x51be('0x40')]=_[_0x51be('0x3f')](_0x3b3d1b[_0x51be('0x3b')],qs[_0x51be('0x41')](_0x5d1978[_0x51be('0x3d')][_0x51be('0x41')]));_0x16680a[_0x51be('0x40')]=_0x16680a[_0x51be('0x40')][_0x51be('0x5d')]?_0x16680a['attributes']:_0x3b3d1b[_0x51be('0x3b')];if(_0x5d1978['query'][_0x51be('0xb4')]){_0x16680a['include']=[{'all':!![]}];}_0x16680a=_['merge']({},_0x16680a,_0x5d1978['options']);return db['OpenchannelInteraction'][_0x51be('0x67')](_0x16680a)['then'](handleEntityNotFound(_0x198f93,null))[_0x51be('0x2c')](respondWithResult(_0x198f93,null))[_0x51be('0x37')](handleError(_0x198f93,null));};exports[_0x51be('0xb5')]=function(_0x405ed5,_0x272128){return db['OpenchannelInteraction']['create'](_0x405ed5['body'],{})[_0x51be('0x2c')](respondWithResult(_0x272128,0xc9))[_0x51be('0x37')](handleError(_0x272128,null));};exports[_0x51be('0xb6')]=function(_0x3f6200,_0x9a97fc){if(_0x3f6200[_0x51be('0x72')]['id']){delete _0x3f6200[_0x51be('0x72')]['id'];}return db['OpenchannelInteraction'][_0x51be('0x67')]({'where':{'id':_0x3f6200[_0x51be('0xb2')]['id']}})[_0x51be('0x2c')](handleEntityNotFound(_0x9a97fc,null))[_0x51be('0x2c')](saveUpdates(_0x3f6200['body'],null))['then'](respondWithResult(_0x9a97fc,null))[_0x51be('0x37')](handleError(_0x9a97fc,null));};exports['destroy']=function(_0x4bae63,_0xbd04c2){return db['OpenchannelInteraction']['find']({'where':{'id':_0x4bae63[_0x51be('0xb2')]['id']}})[_0x51be('0x2c')](handleEntityNotFound(_0xbd04c2,null))[_0x51be('0x2c')](removeEntity(_0xbd04c2,null))['catch'](handleError(_0xbd04c2,null));};exports[_0x51be('0xb7')]=function(_0x1ab6b5,_0x13dd42){return db['OpenchannelInteraction'][_0x51be('0xb7')]()[_0x51be('0x2c')](respondWithResult(_0x13dd42,null))[_0x51be('0x37')](handleError(_0x13dd42,null));};exports[_0x51be('0xb8')]=function(_0x4395ea,_0x4c5506,_0x44c66c){return db[_0x51be('0xb9')][_0x51be('0x67')]({'where':{'id':_0x4395ea[_0x51be('0xb2')]['id']}})[_0x51be('0x2c')](handleEntityNotFound(_0x4c5506,null))['then'](function(_0x3e588a){if(_0x3e588a){return _0x3e588a['addMessage'](_0x4395ea['body']['ids'],_['omit'](_0x4395ea['body'],[_0x51be('0xba'),'id'])||{});}})[_0x51be('0x2c')](respondWithResult(_0x4c5506,null))[_0x51be('0x37')](handleError(_0x4c5506,null));};exports[_0x51be('0xbb')]=function(_0x32fc11,_0xe7dee9,_0x5f9f0b){var _0x1bfc98={'raw':![],'where':{}};var _0x2bf93b={};var _0x4abfd7={'count':0x0,'rows':[]};return db['OpenchannelInteraction']['findOne']({'where':{'id':_0x32fc11[_0x51be('0xb2')]['id']}})[_0x51be('0x2c')](handleEntityNotFound(_0xe7dee9,null))[_0x51be('0x2c')](function(_0x402689){if(_0x402689){_0x2bf93b[_0x51be('0x3b')]=_[_0x51be('0x3c')](db[_0x51be('0xb9')][_0x51be('0xb3')]);_0x2bf93b[_0x51be('0x3d')]=_[_0x51be('0x3c')](_0x32fc11[_0x51be('0x3d')]);_0x2bf93b[_0x51be('0x3e')]=_[_0x51be('0x3f')](_0x2bf93b[_0x51be('0x3b')],_0x2bf93b[_0x51be('0x3d')]);_0x1bfc98[_0x51be('0x40')]=_['intersection'](_0x2bf93b[_0x51be('0x3b')],qs['fields'](_0x32fc11[_0x51be('0x3d')]['fields']));_0x1bfc98[_0x51be('0x40')]=_0x1bfc98['attributes'][_0x51be('0x5d')]?_0x1bfc98[_0x51be('0x40')]:_0x2bf93b[_0x51be('0x3b')];if(!_0x32fc11['query'][_0x51be('0x42')](_0x51be('0x43'))){_0x1bfc98[_0x51be('0x26')]=qs[_0x51be('0x26')](_0x32fc11['query'][_0x51be('0x26')]);_0x1bfc98[_0x51be('0x24')]=qs['offset'](_0x32fc11[_0x51be('0x3d')][_0x51be('0x24')]);}_0x1bfc98[_0x51be('0x8b')]=qs[_0x51be('0x44')](_0x32fc11[_0x51be('0x3d')][_0x51be('0x44')]);_0x1bfc98['where']=qs[_0x51be('0x3e')](_[_0x51be('0xbc')](_0x32fc11['query'],_0x2bf93b['filters']));_0x1bfc98[_0x51be('0x45')]['OpenchannelInteractionId']=_0x402689['id'];if(_0x32fc11['query']['filter']){_0x1bfc98[_0x51be('0x45')]=_[_0x51be('0x99')](_0x1bfc98['where'],{'$or':_[_0x51be('0x31')](_0x1bfc98[_0x51be('0x40')],function(_0x58f975){var _0x4b6557={};_0x4b6557[_0x58f975]={'$like':'%'+_0x32fc11[_0x51be('0x3d')][_0x51be('0xbd')]+'%'};return _0x4b6557;})});}if(_0x32fc11['query']['$gte']){var _0x351912=_0x32fc11['query'][_0x51be('0x78')][_0x51be('0x34')](',');var _0x45f280={};_0x45f280[_0x351912[0x0]]={'$gte':moment(_0x351912[0x1])['format'](_0x51be('0xbe'))};_0x1bfc98[_0x51be('0x45')]=_['merge'](_0x1bfc98[_0x51be('0x45')],_0x45f280);}_0x1bfc98=_[_0x51be('0x99')]({},_0x1bfc98,_0x32fc11[_0x51be('0xbf')]);return db['OpenchannelMessage'][_0x51be('0x27')]({'where':_0x1bfc98[_0x51be('0x45')]})[_0x51be('0x2c')](function(_0x36df6a){_0x4abfd7['count']=_0x36df6a;if(_0x32fc11['query'][_0x51be('0xb4')]){_0x1bfc98['include']=[{'all':!![]}];}return db[_0x51be('0xb9')][_0x51be('0xc0')](_0x1bfc98);})['then'](function(_0x5eeb8f){_0x4abfd7[_0x51be('0xc1')]=_0x5eeb8f;return _0x4abfd7;});}})[_0x51be('0x2c')](respondWithFilteredResult(_0xe7dee9,_0x1bfc98))[_0x51be('0x37')](handleError(_0xe7dee9,null));};exports[_0x51be('0xc2')]=function(_0x20b942,_0x4e947e,_0x289783){return db[_0x51be('0x9a')][_0x51be('0x67')]({'where':{'id':_0x20b942['params']['id']}})[_0x51be('0x2c')](handleEntityNotFound(_0x4e947e,null))[_0x51be('0x2c')](function(_0x92a3ae){if(_0x92a3ae){return _0x92a3ae[_0x51be('0xc3')](_0x20b942[_0x51be('0x72')]['ids'],_[_0x51be('0xc4')](_0x20b942[_0x51be('0x72')],[_0x51be('0xba'),'id'])||{})[_0x51be('0xc5')](function(){return db['Tag'][_0x51be('0xc0')]({'attributes':['id',_0x51be('0x2e'),_0x51be('0xc6')],'where':{'id':_0x20b942[_0x51be('0x72')][_0x51be('0xba')]}});})[_0x51be('0x2c')](function(_0x2427b4){socket['emit']('openchannelInteractionTags:save',{'id':Number(_0x20b942[_0x51be('0xb2')]['id']),'tags':_0x2427b4||[]});return{'id':Number(_0x20b942[_0x51be('0xb2')]['id']),'tags':_0x2427b4||[]};});}})[_0x51be('0x2c')](respondWithResult(_0x4e947e,null))[_0x51be('0x37')](handleError(_0x4e947e,null));};exports['removeTags']=function(_0x117c81,_0x405697,_0x4bed43){return db[_0x51be('0x9a')]['find']({'where':{'id':_0x117c81['params']['id']}})[_0x51be('0x2c')](handleEntityNotFound(_0x405697,null))[_0x51be('0x2c')](function(_0x34d490){if(_0x34d490){return _0x34d490[_0x51be('0xc7')](_0x117c81[_0x51be('0x3d')]['ids']);}})[_0x51be('0x2c')](respondWithStatusCode(_0x405697,null))[_0x51be('0x37')](handleError(_0x405697,null));};exports['download']=function(_0x1d3876,_0x1e440d){var _0x3d31b0=moment()[_0x51be('0xc8')]()[_0x51be('0x97')]();var _0x411e72=path[_0x51be('0xc9')](config[_0x51be('0xca')],'server','files',_0x51be('0xcb'));var _0x55f00e=path['join'](config[_0x51be('0xca')],_0x51be('0xcc'),'files',_0x51be('0xcd'));var _0x1ca279=path['join'](_0x411e72,_0x3d31b0);var _0x5f5873=util[_0x51be('0xce')]('transcript-%d-%s.zip',_0x1d3876[_0x51be('0xb2')]['id'],_0x3d31b0);var _0x456513=path[_0x51be('0xc9')](_0x411e72,_0x5f5873);var _0x2c3441=[];_0x2c3441[_0x51be('0x36')]({'model':db[_0x51be('0x6f')],'as':'User','attributes':['id',_0x51be('0x32')],'raw':!![]});_0x2c3441[_0x51be('0x36')]({'model':db[_0x51be('0xcf')],'as':_0x51be('0x63'),'attributes':['id',_0x51be('0xd0'),_0x51be('0xd1')],'raw':!![]});if(_0x1d3876['query'][_0x51be('0xcd')]){_0x2c3441[_0x51be('0x36')]({'model':db[_0x51be('0xd2')],'as':_0x51be('0xd2'),'raw':!![]});}var _0x1ddce2=[{'model':db[_0x51be('0xb9')],'as':_0x51be('0xd3'),'attributes':['id',_0x51be('0x72'),_0x51be('0xd4'),_0x51be('0xd5'),_0x51be('0xd6'),_0x51be('0x7c')],'include':_0x2c3441}];_0x1ddce2[_0x51be('0x36')]({'model':db[_0x51be('0xd7')],'as':_0x51be('0xd8'),'attributes':['id',_0x51be('0x2e')]});_0x1ddce2[_0x51be('0x36')]({'model':db['User'],'as':_0x51be('0xd9'),'attributes':['id','fullname']});return db[_0x51be('0x9a')][_0x51be('0x67')]({'where':{'id':_0x1d3876[_0x51be('0xb2')]['id']},'include':_0x1ddce2})['then'](handleEntityNotFound(_0x1e440d,null))[_0x51be('0x2c')](function(_0x150f38){if(_0x150f38){var _0x2e1ea1=_0x150f38[_0x51be('0xda')]({'plain':!![]});fs['mkdirSync'](_0x1ca279);var _0x33e665={'channel':_0x51be('0xdb'),'account':_0x2e1ea1[_0x51be('0xd8')][_0x51be('0x2e')],'agent':_0x2e1ea1[_0x51be('0xd9')]?_0x2e1ea1[_0x51be('0xd9')]['fullname']:_0x51be('0xdc'),'createdAt':moment(_0x2e1ea1[_0x51be('0xd4')])[_0x51be('0xce')]('YYYY-MM-DD\x20HH:mm:ss')[_0x51be('0x97')](),'closedAt':_0x2e1ea1[_0x51be('0xdd')]?moment(_0x2e1ea1[_0x51be('0xde')])['format'](_0x51be('0xbe'))[_0x51be('0x97')]():'','disposition':_0x2e1ea1[_0x51be('0xdf')],'visibility':_0x2e1ea1['threadId']?_0x51be('0xe0'):_0x51be('0xe1'),'messages':_(_0x2e1ea1[_0x51be('0xd3')])[_0x51be('0xbd')]({'secret':![]})[_0x51be('0x31')](function(_0x354303){if(_0x354303['Attachment']){var _0x49be0b=path[_0x51be('0xc9')](_0x55f00e,_0x354303[_0x51be('0xd2')]['basename']);if(fs[_0x51be('0xe2')](_0x49be0b)){fs['createReadStream'](_0x49be0b)['pipe'](fs['createWriteStream'](path['join'](_0x1ca279,_0x354303[_0x51be('0xd2')]['basename'])));}}return{'date':moment(_0x354303[_0x51be('0xd4')])[_0x51be('0xce')]('YYYY-MM-DD\x20HH:mm:ss')[_0x51be('0x97')](),'sender':_0x354303[_0x51be('0xd5')]===_0x51be('0xe3')?_0x354303[_0x51be('0x6f')]?_0x354303['User'][_0x51be('0x32')]:'System':_0x354303[_0x51be('0x63')][_0x51be('0xd0')]+(_0x354303[_0x51be('0x63')][_0x51be('0xd1')]?'\x20'+_0x354303['Contact']['lastName']:''),'body':_0x354303['Attachment']?_0x354303[_0x51be('0xd2')]['basename']:_0x354303[_0x51be('0x72')],'direction':_0x354303['direction']===_0x51be('0xe3')?'A':'C','secret':_0x354303['secret'],'read':_0x354303[_0x51be('0x7c')],'attachment':_0x354303['Attachment']};})[_0x51be('0x66')]()};return ejs[_0x51be('0xe4')](path[_0x51be('0xc9')](config[_0x51be('0xca')],_0x51be('0xcc'),_0x51be('0xe5'),_0x51be('0xe6')),{'interaction':_0x33e665})['then'](function(_0x140c8b){var _0x33b4b6=path[_0x51be('0xc9')](_0x1ca279,_0x51be('0xe7')+_0x2e1ea1['id']+'-'+_0x3d31b0+_0x51be('0xe8'));var _0x7f2a6d={'path':_0x33b4b6,'channel':_0x51be('0xdb'),'interactionId':_0x2e1ea1['id']};return pdf['createPdfFromHTML'](_0x140c8b,_0x7f2a6d);})['then'](function(){return new BPromise(function(_0x1f816a,_0x3bb7ed){zipdir(_0x1ca279,{'saveTo':_0x456513},function(_0x2b66d0,_0x3f779f){if(_0x2b66d0)return _0x3bb7ed(_0x2b66d0);return _0x1f816a(_0x3f779f);});})[_0x51be('0x2c')](function(){return new BPromise(function(_0x3b1cb8,_0x4eca58){rimraf(_0x1ca279,function(_0x200b64){if(_0x200b64)_0x4eca58(_0x200b64);return _0x3b1cb8();});});})[_0x51be('0x2c')](function(){return _0x1e440d[_0x51be('0xe9')](_0x456513,_0x5f5873,function(_0x4afb9c){if(_0x4afb9c){console[_0x51be('0xea')](_0x51be('0xeb'),_0x4afb9c);}else{fs[_0x51be('0xec')](_0x456513);}});});});}else{return _0x1e440d[_0x51be('0x21')](0xc8);}})[_0x51be('0x37')](handleError(_0x1e440d,null));}; \ No newline at end of file +var _0x2c98=['join','root','files','attachments','fullname','firstName','lastName','Attachment','Messages','direction','secret','Account','get','Openchannel','Owner','N.A.','closedAt','disposition','threadId','Private','basename','existsSync','createReadStream','createWriteStream','out','System','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./openchannelInteraction.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','map','TagIds','split','Tags','index','OpenchannelInteraction','type','model','keys','query','intersection','fields','attributes','length','nolimit','sort','where','pick','field','color','from','tools_tags','select','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','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','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?','find','UserId','buildExpression','body','some','compact','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','resolve','OpenchannelAccountId','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','agent','user','isEmpty','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','Contact.lastName','Contact.email','c.phone','c.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','push','all','catch','params','filters','includeAll','include','options','create','describe','addMessage','omit','ids','getMessages','rawAttributes','hasOwnProperty','OpenchannelInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','OpenchannelMessage','rows','setTags','spread','emit','openchannelInteractionTags:save','removeTags','download','unix','server'];(function(_0x326bce,_0x1b0c53){var _0x29e9e2=function(_0x34e568){while(--_0x34e568){_0x326bce['push'](_0x326bce['shift']());}};_0x29e9e2(++_0x1b0c53);}(_0x2c98,0x110));var _0x82c9=function(_0x53fe41,_0xfd7e0d){_0x53fe41=_0x53fe41-0x0;var _0x4d7d13=_0x2c98[_0x53fe41];return _0x4d7d13;};'use strict';var emlformat=require(_0x82c9('0x0'));var rimraf=require(_0x82c9('0x1'));var zipdir=require(_0x82c9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x82c9('0x3'));var BPromise=require(_0x82c9('0x4'));var Mustache=require(_0x82c9('0x5'));var util=require(_0x82c9('0x6'));var path=require(_0x82c9('0x7'));var sox=require(_0x82c9('0x8'));var csv=require(_0x82c9('0x9'));var ejs=require(_0x82c9('0xa'));var fs=require('fs');var fs_extra=require(_0x82c9('0xb'));var _=require(_0x82c9('0xc'));var squel=require('squel');var crypto=require(_0x82c9('0xd'));var jsforce=require(_0x82c9('0xe'));var deskjs=require(_0x82c9('0xf'));var toCsv=require(_0x82c9('0x9'));var querystring=require(_0x82c9('0x10'));var Papa=require(_0x82c9('0x11'));var Redis=require(_0x82c9('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x82c9('0x13'));var as=require(_0x82c9('0x14'));var pdf=require(_0x82c9('0x15'));var hardwareService=require(_0x82c9('0x16'));var logger=require(_0x82c9('0x17'))(_0x82c9('0x18'));var utils=require(_0x82c9('0x19'));var config=require(_0x82c9('0x1a'));var licenseUtil=require(_0x82c9('0x1b'));var db=require(_0x82c9('0x1c'))['db'];config[_0x82c9('0x1d')]=_['defaults'](config[_0x82c9('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0x82c9('0x1e'))(new Redis(config[_0x82c9('0x1d')]));require(_0x82c9('0x1f'))['register'](socket);function respondWithStatusCode(_0x4a1e91,_0x1d0491){_0x1d0491=_0x1d0491||0xcc;return function(_0xd59638){if(_0xd59638){return _0x4a1e91[_0x82c9('0x20')](_0x1d0491);}return _0x4a1e91[_0x82c9('0x21')](_0x1d0491)['end']();};}function respondWithResult(_0x1f8c81,_0x4d6625){_0x4d6625=_0x4d6625||0xc8;return function(_0x3a978f){if(_0x3a978f){return _0x1f8c81[_0x82c9('0x21')](_0x4d6625)[_0x82c9('0x22')](_0x3a978f);}};}function respondWithFilteredResult(_0x3433d0,_0x58c57d){return function(_0x518e0d){if(_0x518e0d){var _0xa16a9c=typeof _0x58c57d[_0x82c9('0x23')]===_0x82c9('0x24')&&typeof _0x58c57d[_0x82c9('0x25')]==='undefined';var _0x29ac81=_0x518e0d['count'];var _0x4298f3=_0xa16a9c?0x0:_0x58c57d[_0x82c9('0x23')];var _0x470861=_0xa16a9c?_0x518e0d[_0x82c9('0x26')]:_0x58c57d[_0x82c9('0x23')]+_0x58c57d['limit'];var _0x2197c7;if(_0x470861>=_0x29ac81){_0x470861=_0x29ac81;_0x2197c7=0xc8;}else{_0x2197c7=0xce;}_0x3433d0[_0x82c9('0x21')](_0x2197c7);return _0x3433d0[_0x82c9('0x27')](_0x82c9('0x28'),_0x4298f3+'-'+_0x470861+'/'+_0x29ac81)[_0x82c9('0x22')](_0x518e0d);}return null;};}function patchUpdates(_0x20acf7){return function(_0x502109){try{jsonpatch[_0x82c9('0x29')](_0x502109,_0x20acf7,!![]);}catch(_0x41c382){return BPromise[_0x82c9('0x2a')](_0x41c382);}return _0x502109['save']();};}function saveUpdates(_0x567f77,_0x2ccedc){return function(_0x5c6186){if(_0x5c6186){return _0x5c6186[_0x82c9('0x2b')](_0x567f77)[_0x82c9('0x2c')](function(_0x59bdd6){return _0x59bdd6;});}return null;};}function removeEntity(_0x206960,_0x31ae97){return function(_0x74c110){if(_0x74c110){return _0x74c110[_0x82c9('0x2d')]()[_0x82c9('0x2c')](function(){_0x206960['status'](0xcc)[_0x82c9('0x2e')]();});}};}function handleEntityNotFound(_0x4e04a6,_0x244e79){return function(_0x690f5f){if(!_0x690f5f){_0x4e04a6['sendStatus'](0x194);}return _0x690f5f;};}function handleError(_0xe096a7,_0x4acde8){_0x4acde8=_0x4acde8||0x1f4;return function(_0x4bcd12){logger[_0x82c9('0x2f')](_0x4bcd12[_0x82c9('0x30')]);if(_0x4bcd12[_0x82c9('0x31')]){delete _0x4bcd12[_0x82c9('0x31')];}_0xe096a7[_0x82c9('0x21')](_0x4acde8)[_0x82c9('0x32')](_0x4bcd12);};}function getInteractionUsers(_0x384462,_0x450bcf){return new BPromise(function(_0xba049d,_0x10b72e){try{if(_0x450bcf[_0x384462['id']]){_0x384462['Users']=_[_0x82c9('0x33')](_0x450bcf[_0x384462['id']],function(_0x54c1e1){return{'id':_0x54c1e1['id'],'fullname':_0x54c1e1['fullname']};});}}catch(_0x22649d){_0x10b72e(_0x22649d);}_0xba049d(_0x384462);});}function getInteractionTags(_0x533ae7,_0x2749c3){return new BPromise(function(_0x422735,_0x5e1716){try{if(_0x533ae7[_0x82c9('0x34')]){_0x533ae7['Tags']=[];_0x533ae7[_0x82c9('0x34')][_0x82c9('0x35')](',')['forEach'](function(_0x466054){_0x533ae7[_0x82c9('0x36')]['push'](_0x2749c3[_0x466054]);});}delete _0x533ae7[_0x82c9('0x34')];}catch(_0x1df9f1){_0x5e1716(_0x1df9f1);}_0x422735(_0x533ae7);});}function updateOpenchannelInteraction(_0x177e22,_0x413984,_0xc6cc2e){return new BPromise(function(_0x56e654,_0x31d1bb){return getInteractionUsers(_0x177e22,_0xc6cc2e)['then'](function(_0x288cfd){return getInteractionTags(_0x288cfd,_0x413984);})['then'](function(_0x3014c9){_0x56e654(_0x3014c9);})['catch'](function(_0x420b52){_0x31d1bb(_0x420b52);});});}exports[_0x82c9('0x37')]=function(_0x1c0476,_0x4212b4){var _0x33f2de={},_0x1ac8cb={},_0x21eabd={'count':0x0,'rows':[]};var _0x4a88bc=_['map'](db[_0x82c9('0x38')]['rawAttributes'],function(_0x18bd39){return{'name':_0x18bd39['fieldName'],'type':_0x18bd39[_0x82c9('0x39')]['key']};});_0x1ac8cb[_0x82c9('0x3a')]=_['map'](_0x4a88bc,'name');_0x1ac8cb['query']=_[_0x82c9('0x3b')](_0x1c0476[_0x82c9('0x3c')]);_0x1ac8cb['filters']=_[_0x82c9('0x3d')](_0x1ac8cb[_0x82c9('0x3a')],_0x1ac8cb[_0x82c9('0x3c')]);_0x33f2de['attributes']=_[_0x82c9('0x3d')](_0x1ac8cb[_0x82c9('0x3a')],qs[_0x82c9('0x3e')](_0x1c0476[_0x82c9('0x3c')][_0x82c9('0x3e')]));_0x33f2de[_0x82c9('0x3f')]=_0x33f2de[_0x82c9('0x3f')][_0x82c9('0x40')]?_0x33f2de['attributes']:_0x1ac8cb[_0x82c9('0x3a')];if(!_0x1c0476[_0x82c9('0x3c')]['hasOwnProperty'](_0x82c9('0x41'))){_0x33f2de[_0x82c9('0x25')]=qs[_0x82c9('0x25')](_0x1c0476[_0x82c9('0x3c')][_0x82c9('0x25')]);_0x33f2de[_0x82c9('0x23')]=qs[_0x82c9('0x23')](_0x1c0476[_0x82c9('0x3c')]['offset']);}_0x33f2de['order']=qs[_0x82c9('0x42')](_0x1c0476[_0x82c9('0x3c')]['sort']);_0x33f2de[_0x82c9('0x43')]=qs['filters'](_[_0x82c9('0x44')](_0x1c0476[_0x82c9('0x3c')],_0x1ac8cb['filters']),_0x4a88bc);var _0x57c3a7=[];var _0x4f4ddd=squel['select']()[_0x82c9('0x45')]('id')[_0x82c9('0x45')]('name')[_0x82c9('0x45')](_0x82c9('0x46'))[_0x82c9('0x47')](_0x82c9('0x48'));var _0x1cd52e=squel[_0x82c9('0x49')]()['field'](_0x82c9('0x4a'))[_0x82c9('0x45')](_0x82c9('0x4b'))[_0x82c9('0x45')](_0x82c9('0x4c'))[_0x82c9('0x47')](_0x82c9('0x4d'),'ui')[_0x82c9('0x4e')](_0x82c9('0x4f'),'u',_0x82c9('0x50'));var _0xfb2885=squel['select']()[_0x82c9('0x47')](_0x82c9('0x51'),'i')['left_join'](_0x82c9('0x52'),'c',_0x82c9('0x53'))[_0x82c9('0x4e')](_0x82c9('0x4f'),'o','o.id\x20=\x20i.UserId')[_0x82c9('0x4e')](_0x82c9('0x54'),'a','a.id\x20=\x20i.OpenchannelAccountId')[_0x82c9('0x4e')]('openchannel_messages','me','me.OpenchannelInteractionId\x20=\x20i.id')[_0x82c9('0x4e')](_0x82c9('0x55'),'it',_0x82c9('0x56'))[_0x82c9('0x4e')](_0x82c9('0x48'),'t','t.id\x20=\x20it.TagId');var _0xf2f5de=squel[_0x82c9('0x57')]();var _0x39e167=[];var _0x22c712=squel[_0x82c9('0x57')]();var _0x32b828;if(_0x1c0476['query'][_0x82c9('0x58')]){_0x32b828=as[_0x82c9('0x59')](_0x1c0476['query'][_0x82c9('0x58')]);var _0x1ee724=_0x32b828[_0x82c9('0x5a')];for(var _0x187161=0x0;_0x187161<_0x32b828['conditions'][_0x82c9('0x40')];_0x187161++){var _0x2a85e7=_0x32b828[_0x82c9('0x5b')][_0x187161];var _0x1ded47='i';var _0x189251=_['find'](_0x4a88bc,[_0x82c9('0x31'),_0x2a85e7[_0x82c9('0x45')]]);if(!_0x189251){switch(_0x2a85e7[_0x82c9('0x45')]){case _0x82c9('0x5c'):if(_0x2a85e7[_0x82c9('0x5d')]==0x1){_0xfb2885['having']('`'+_0x2a85e7[_0x82c9('0x45')]+'`\x20=\x200');}else{_0xfb2885[_0x82c9('0x5e')]('`'+_0x2a85e7['field']+'`\x20>\x200');}break;case _0x82c9('0x5f'):if(_0x2a85e7[_0x82c9('0x60')]===_0x82c9('0x61')){if(_0x2a85e7[_0x82c9('0x5d')][_0x82c9('0x35')]('\x20')[_0x82c9('0x40')]>0x1){_0xf2f5de[_0x1ee724](_0x82c9('0x62'),qs[_0x82c9('0x63')](_0x2a85e7['value']),null);}else{var _0x442ec8='%'+_0x2a85e7[_0x82c9('0x5d')]+'%';_0xf2f5de[_0x1ee724](_0x82c9('0x64'),_0x442ec8,_0x442ec8,_0x442ec8);}}else{_0x189251=_['find'](_0x4a88bc,['name',_0x82c9('0x65')]);_0x2a85e7[_0x82c9('0x45')]=_0x82c9('0x65');_0xcd90bd=as['buildExpression'](_0x1ded47,_0x189251['type'],_0x2a85e7);_0xf2f5de[_0x1ee724](_0xcd90bd[_0x82c9('0x66')],_0xcd90bd[_0x82c9('0x5d')][_0x82c9('0x67')],_0xcd90bd[_0x82c9('0x5d')][_0x82c9('0x2e')]);}break;case _0x82c9('0x68'):var _0x4b1088=_0x2a85e7['value'][_0x82c9('0x35')](',')['map'](function(_0x5b06b2){return Number(_0x5b06b2);});_0x4b1088[_0x82c9('0x69')](function(_0x4ec9aa){_0x22c712['or'](_0x82c9('0x6a'),'%,'+_0x4ec9aa+',%');});_0x39e167=_['union'](_0x39e167,_0x4b1088);break;case _0x82c9('0x6b'):if(_0x2a85e7['operator']===_0x82c9('0x61')){_0xf2f5de[_0x1ee724](_0x82c9('0x6c'),'%'+_0x2a85e7[_0x82c9('0x5d')]+'%',null);}else{_0x189251=_[_0x82c9('0x6d')](_0x4a88bc,['name',_0x82c9('0x6e')]);_0x2a85e7[_0x82c9('0x45')]='UserId';_0xcd90bd=as[_0x82c9('0x6f')](_0x1ded47,_0x189251[_0x82c9('0x39')],_0x2a85e7);_0xf2f5de[_0x1ee724](_0xcd90bd[_0x82c9('0x66')],_0xcd90bd['value']['start'],_0xcd90bd[_0x82c9('0x5d')][_0x82c9('0x2e')]);}break;case _0x82c9('0x70'):_0xcd90bd=as[_0x82c9('0x6f')]('me',null,_0x2a85e7);_0xf2f5de[_0x1ee724](_0xcd90bd[_0x82c9('0x66')],_0xcd90bd[_0x82c9('0x5d')]['start'],_0xcd90bd[_0x82c9('0x5d')]['end']);break;}}else{var _0xcd90bd=as[_0x82c9('0x6f')](_0x1ded47,_0x189251['type'],_0x2a85e7);_0xf2f5de[_0x1ee724](_0xcd90bd[_0x82c9('0x66')],_0xcd90bd[_0x82c9('0x5d')][_0x82c9('0x67')],_0xcd90bd[_0x82c9('0x5d')][_0x82c9('0x2e')]);}}}else{var _0x195997=_(_0x1c0476['query'])['keys']()[_0x82c9('0x33')](function(_0x44e5e7){return _[_0x82c9('0x71')](_0x4a88bc,['name',_0x44e5e7])?_0x44e5e7:undefined;})[_0x82c9('0x72')]()[_0x82c9('0x5d')]();if(!_['isEmpty'](_0x195997)){_0x195997[_0x82c9('0x69')](function(_0x2e092f){if(_0x2e092f==='OpenchannelAccountId'){_0xfb2885[_0x82c9('0x43')](_0x82c9('0x73'),[][_0x82c9('0x74')](_0x1c0476[_0x82c9('0x3c')][_0x2e092f]));}else if(_0x2e092f===_0x82c9('0x75')){var _0x19ff4e=JSON[_0x82c9('0x76')](_0x1c0476[_0x82c9('0x3c')][_0x2e092f])['$gte'];var _0x3d1a12=JSON[_0x82c9('0x76')](_0x1c0476[_0x82c9('0x3c')][_0x2e092f])[_0x82c9('0x77')];_0xfb2885[_0x82c9('0x43')](_0x82c9('0x78'),_0x19ff4e,_0x3d1a12);}else{if(_0x1c0476[_0x82c9('0x3c')][_0x2e092f]===_0x82c9('0x79')){_0xfb2885[_0x82c9('0x43')]('i.'+_0x2e092f+_0x82c9('0x7a'));}else{_0xfb2885[_0x82c9('0x43')]('i.'+_0x2e092f+_0x82c9('0x7b'),_0x1c0476[_0x82c9('0x3c')][_0x2e092f]);}}});}if(_0x1c0476[_0x82c9('0x3c')]['read']){if(_0x1c0476[_0x82c9('0x3c')][_0x82c9('0x7c')]==0x1){_0xfb2885[_0x82c9('0x5e')]('`unreadMessages`\x20=\x200');}else{_0xfb2885['having'](_0x82c9('0x7d'));}}if(_0x1c0476['query'][_0x82c9('0x7e')]){_0x39e167=_['isArray'](_0x1c0476[_0x82c9('0x3c')]['tag'])?_0x1c0476['query']['tag']:new Array(_0x1c0476['query'][_0x82c9('0x7e')]);_0x39e167['forEach'](function(_0x3829ae){_0x22c712['or'](_0x82c9('0x6a'),'%,'+_0x3829ae+',%');});}if(_0x1c0476['query']['filter']){var _0x5bab33=_0x1c0476[_0x82c9('0x3c')][_0x82c9('0x7f')][_0x82c9('0x80')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x82c9('0x81')](_0x5bab33)){_0xf2f5de['or'](_0x82c9('0x82'),_0x5bab33+'%');}else{_0xf2f5de['or'](_0x82c9('0x83'),qs['getFullTextValue'](_0x5bab33))['or'](_0x82c9('0x84'),_0x5bab33+'%')['or'](_0x82c9('0x85'),_0x5bab33+'%');}}}_0xfb2885[_0x82c9('0x43')](_0xf2f5de);_0xfb2885[_0x82c9('0x86')](_0x82c9('0x87'));var _0x396a4b={'type':db['Sequelize'][_0x82c9('0x88')]['SELECT'],'raw':!![]};var _0x322c34=_0xfb2885[_0x82c9('0x89')]();_0x322c34['field'](_0x82c9('0x87'));_0x322c34[_0x82c9('0x45')](_0x82c9('0x8a'),_0x82c9('0x5c'));if(_0x33f2de[_0x82c9('0x8b')]){_0x33f2de['order']['forEach'](function(_0x6459a1){var _0x2131f5=_0x6459a1[0x0]===_0x82c9('0x8c')?_0x6459a1[0x0]:'i.'+_0x6459a1[0x0];_0xfb2885[_0x82c9('0x8b')](_0x2131f5,_0x6459a1[0x1]===_0x82c9('0x8d')?![]:!![]);});}if(!_['isEmpty'](_0x39e167)){_0xfb2885[_0x82c9('0x5e')](_0x22c712);_0x322c34[_0x82c9('0x43')](_0x82c9('0x8e'),_0x39e167);}BPromise[_0x82c9('0x8f')]()[_0x82c9('0x2c')](function(){if(!_0x32b828){if(_0x1c0476[_0x82c9('0x3c')][_0x82c9('0x90')])return;_0x322c34[_0x82c9('0x43')](_0x82c9('0x91'));_0xfb2885['where'](_0x82c9('0x91'));return;}if(_0x1c0476['user'][_0x82c9('0x92')]!==_0x82c9('0x93'))return;return _0x1c0476[_0x82c9('0x94')]['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x521d81){if(_[_0x82c9('0x95')](_0x521d81)){_0x322c34[_0x82c9('0x43')](_0x82c9('0x96'));_0xfb2885['where']('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x322c34[_0x82c9('0x43')](_0x82c9('0x73'),_[_0x82c9('0x33')](_0x521d81,'id'));_0xfb2885[_0x82c9('0x43')]('i.OpenchannelAccountId\x20IN\x20?',_['map'](_0x521d81,'id'));}});})[_0x82c9('0x2c')](function(){if(_0x1c0476[_0x82c9('0x94')]['role']===_0x82c9('0x93')&&!_0x32b828&&!_0x1c0476[_0x82c9('0x3c')]['OpenchannelAccountId'])return[];return db[_0x82c9('0x97')][_0x82c9('0x3c')](_0x322c34[_0x82c9('0x98')](),_0x396a4b);})['then'](function(_0x361162){_0x21eabd['count']=_0x361162[_0x82c9('0x40')];if(_0x21eabd[_0x82c9('0x26')]===0x0)return[];return db[_0x82c9('0x97')][_0x82c9('0x3c')](_0x4f4ddd[_0x82c9('0x98')](),_0x396a4b)[_0x82c9('0x2c')](function(_0x174d04){_0x57c3a7=_[_0x82c9('0x99')](_0x174d04,'id');_0x396a4b=_[_0x82c9('0x9a')](_0x396a4b,{'model':db[_0x82c9('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1c0476[_0x82c9('0x3c')][_0x82c9('0x3e')]){_0x33f2de[_0x82c9('0x3f')][_0x82c9('0x69')](function(_0x3b30cd){_0xfb2885[_0x82c9('0x45')]('i.'+_0x3b30cd);});}else{_0xfb2885[_0x82c9('0x45')](_0x82c9('0x8a'),'unreadMessages');_0xfb2885[_0x82c9('0x45')](_0x82c9('0x9b'),_0x82c9('0x9c'));_0xfb2885[_0x82c9('0x45')](_0x82c9('0x9d'),_0x82c9('0x9e'));_0xfb2885['field'](_0x82c9('0x9f'),_0x82c9('0x8c'));_0xfb2885[_0x82c9('0x45')]('i.*');_0xfb2885['field'](_0x82c9('0xa0'),_0x82c9('0xa1'));_0xfb2885[_0x82c9('0x45')]('c.lastName',_0x82c9('0xa2'));_0xfb2885['field']('c.email',_0x82c9('0xa3'));_0xfb2885[_0x82c9('0x45')](_0x82c9('0xa4'),'Contact.phone');_0xfb2885[_0x82c9('0x45')](_0x82c9('0xa5'),'Contact.mobile');_0xfb2885[_0x82c9('0x45')](_0x82c9('0xa6'),'Contact.fax');_0xfb2885[_0x82c9('0x45')](_0x82c9('0xa7'),_0x82c9('0xa8'));_0xfb2885[_0x82c9('0x45')](_0x82c9('0xa9'),_0x82c9('0xaa'));_0xfb2885[_0x82c9('0x45')](_0x82c9('0xab'),_0x82c9('0x34'));}if(_0x33f2de[_0x82c9('0x25')])_0xfb2885['limit'](_0x33f2de['limit']);if(_0x33f2de['offset'])_0xfb2885[_0x82c9('0x23')](_0x33f2de[_0x82c9('0x23')]);return db[_0x82c9('0x97')][_0x82c9('0x3c')](_0xfb2885[_0x82c9('0x98')](),_0x396a4b);})[_0x82c9('0x2c')](function(_0xdb3aa2){if(_0xdb3aa2['length']>0x0)_0x1cd52e[_0x82c9('0x43')](_0x82c9('0xac'),_[_0x82c9('0x33')](_0xdb3aa2,'id'));return db['sequelize']['query'](_0x1cd52e[_0x82c9('0x98')](),_0x396a4b)[_0x82c9('0x2c')](function(_0x56ffce){var _0x2f4b9a=_[_0x82c9('0xad')](_0x56ffce,'OpenchannelInteractionId');var _0x31d8bc=[];_0xdb3aa2[_0x82c9('0x69')](function(_0x558b16){_0x31d8bc[_0x82c9('0xae')](updateOpenchannelInteraction(_0x558b16,_0x57c3a7,_0x2f4b9a));});return BPromise[_0x82c9('0xaf')](_0x31d8bc);});});})[_0x82c9('0x2c')](function(_0x2ea5c5){_0x21eabd['rows']=_0x2ea5c5;return _0x21eabd;})[_0x82c9('0x2c')](respondWithFilteredResult(_0x4212b4,_0x33f2de))[_0x82c9('0xb0')](handleError(_0x4212b4,null));};exports['show']=function(_0x59f8d8,_0xa80792){var _0x595986={};if(_0x59f8d8['query']['type']&&_0x59f8d8[_0x82c9('0x3c')][_0x82c9('0x39')]===_0x82c9('0x47')){_0x595986[_0x82c9('0x47')]=_0x59f8d8[_0x82c9('0xb1')]['id'];}else{_0x595986['id']=_0x59f8d8[_0x82c9('0xb1')]['id'];}var _0x3dccf8={'raw':![],'where':_0x595986},_0x565cf2={};_0x565cf2[_0x82c9('0x3a')]=_['keys'](db[_0x82c9('0x38')]['rawAttributes']);_0x565cf2[_0x82c9('0x3c')]=_[_0x82c9('0x3b')](_0x59f8d8['query']);_0x565cf2[_0x82c9('0xb2')]=_[_0x82c9('0x3d')](_0x565cf2[_0x82c9('0x3a')],_0x565cf2[_0x82c9('0x3c')]);_0x3dccf8[_0x82c9('0x3f')]=_[_0x82c9('0x3d')](_0x565cf2[_0x82c9('0x3a')],qs[_0x82c9('0x3e')](_0x59f8d8['query'][_0x82c9('0x3e')]));_0x3dccf8['attributes']=_0x3dccf8[_0x82c9('0x3f')][_0x82c9('0x40')]?_0x3dccf8['attributes']:_0x565cf2[_0x82c9('0x3a')];if(_0x59f8d8[_0x82c9('0x3c')][_0x82c9('0xb3')]){_0x3dccf8[_0x82c9('0xb4')]=[{'all':!![]}];}_0x3dccf8=_[_0x82c9('0x9a')]({},_0x3dccf8,_0x59f8d8[_0x82c9('0xb5')]);return db['OpenchannelInteraction'][_0x82c9('0x6d')](_0x3dccf8)[_0x82c9('0x2c')](handleEntityNotFound(_0xa80792,null))['then'](respondWithResult(_0xa80792,null))['catch'](handleError(_0xa80792,null));};exports[_0x82c9('0xb6')]=function(_0x56a23f,_0xd5be95){return db[_0x82c9('0x38')][_0x82c9('0xb6')](_0x56a23f[_0x82c9('0x70')],{})['then'](respondWithResult(_0xd5be95,0xc9))['catch'](handleError(_0xd5be95,null));};exports[_0x82c9('0x2b')]=function(_0x51d2ad,_0x43a255){if(_0x51d2ad[_0x82c9('0x70')]['id']){delete _0x51d2ad[_0x82c9('0x70')]['id'];}return db[_0x82c9('0x38')][_0x82c9('0x6d')]({'where':{'id':_0x51d2ad[_0x82c9('0xb1')]['id']}})['then'](handleEntityNotFound(_0x43a255,null))[_0x82c9('0x2c')](saveUpdates(_0x51d2ad[_0x82c9('0x70')],null))[_0x82c9('0x2c')](respondWithResult(_0x43a255,null))[_0x82c9('0xb0')](handleError(_0x43a255,null));};exports[_0x82c9('0x2d')]=function(_0xfbb307,_0x25433a){return db['OpenchannelInteraction'][_0x82c9('0x6d')]({'where':{'id':_0xfbb307['params']['id']}})[_0x82c9('0x2c')](handleEntityNotFound(_0x25433a,null))[_0x82c9('0x2c')](removeEntity(_0x25433a,null))[_0x82c9('0xb0')](handleError(_0x25433a,null));};exports[_0x82c9('0xb7')]=function(_0x475e04,_0x482b58){return db[_0x82c9('0x38')][_0x82c9('0xb7')]()[_0x82c9('0x2c')](respondWithResult(_0x482b58,null))[_0x82c9('0xb0')](handleError(_0x482b58,null));};exports[_0x82c9('0xb8')]=function(_0x762928,_0x40d60a,_0x12c613){return db['OpenchannelMessage']['find']({'where':{'id':_0x762928[_0x82c9('0xb1')]['id']}})[_0x82c9('0x2c')](handleEntityNotFound(_0x40d60a,null))[_0x82c9('0x2c')](function(_0x598fe2){if(_0x598fe2){return _0x598fe2[_0x82c9('0xb8')](_0x762928[_0x82c9('0x70')]['ids'],_[_0x82c9('0xb9')](_0x762928[_0x82c9('0x70')],[_0x82c9('0xba'),'id'])||{});}})[_0x82c9('0x2c')](respondWithResult(_0x40d60a,null))[_0x82c9('0xb0')](handleError(_0x40d60a,null));};exports[_0x82c9('0xbb')]=function(_0x2609b1,_0x52b8a8,_0x3567aa){var _0x441d7e={'raw':![],'where':{}};var _0x273766={};var _0x51f31e={'count':0x0,'rows':[]};return db[_0x82c9('0x38')]['findOne']({'where':{'id':_0x2609b1[_0x82c9('0xb1')]['id']}})[_0x82c9('0x2c')](handleEntityNotFound(_0x52b8a8,null))[_0x82c9('0x2c')](function(_0x112a9a){if(_0x112a9a){_0x273766[_0x82c9('0x3a')]=_['keys'](db['OpenchannelMessage'][_0x82c9('0xbc')]);_0x273766[_0x82c9('0x3c')]=_[_0x82c9('0x3b')](_0x2609b1[_0x82c9('0x3c')]);_0x273766['filters']=_[_0x82c9('0x3d')](_0x273766[_0x82c9('0x3a')],_0x273766[_0x82c9('0x3c')]);_0x441d7e[_0x82c9('0x3f')]=_['intersection'](_0x273766[_0x82c9('0x3a')],qs[_0x82c9('0x3e')](_0x2609b1[_0x82c9('0x3c')][_0x82c9('0x3e')]));_0x441d7e[_0x82c9('0x3f')]=_0x441d7e[_0x82c9('0x3f')]['length']?_0x441d7e[_0x82c9('0x3f')]:_0x273766[_0x82c9('0x3a')];if(!_0x2609b1[_0x82c9('0x3c')][_0x82c9('0xbd')]('nolimit')){_0x441d7e['limit']=qs[_0x82c9('0x25')](_0x2609b1['query'][_0x82c9('0x25')]);_0x441d7e[_0x82c9('0x23')]=qs[_0x82c9('0x23')](_0x2609b1[_0x82c9('0x3c')]['offset']);}_0x441d7e[_0x82c9('0x8b')]=qs['sort'](_0x2609b1[_0x82c9('0x3c')][_0x82c9('0x42')]);_0x441d7e[_0x82c9('0x43')]=qs['filters'](_['pick'](_0x2609b1[_0x82c9('0x3c')],_0x273766['filters']));_0x441d7e[_0x82c9('0x43')][_0x82c9('0xbe')]=_0x112a9a['id'];if(_0x2609b1[_0x82c9('0x3c')]['filter']){_0x441d7e[_0x82c9('0x43')]=_[_0x82c9('0x9a')](_0x441d7e['where'],{'$or':_[_0x82c9('0x33')](_0x441d7e[_0x82c9('0x3f')],function(_0x498cb5){var _0x2abd30={};_0x2abd30[_0x498cb5]={'$like':'%'+_0x2609b1['query']['filter']+'%'};return _0x2abd30;})});}if(_0x2609b1[_0x82c9('0x3c')][_0x82c9('0xbf')]){var _0x35a61f=_0x2609b1['query'][_0x82c9('0xbf')]['split'](',');var _0x211985={};_0x211985[_0x35a61f[0x0]]={'$gte':moment(_0x35a61f[0x1])[_0x82c9('0xc0')](_0x82c9('0xc1'))};_0x441d7e[_0x82c9('0x43')]=_[_0x82c9('0x9a')](_0x441d7e['where'],_0x211985);}_0x441d7e=_[_0x82c9('0x9a')]({},_0x441d7e,_0x2609b1[_0x82c9('0xb5')]);return db[_0x82c9('0xc2')][_0x82c9('0x26')]({'where':_0x441d7e['where']})[_0x82c9('0x2c')](function(_0x33bf1){_0x51f31e['count']=_0x33bf1;if(_0x2609b1[_0x82c9('0x3c')][_0x82c9('0xb3')]){_0x441d7e[_0x82c9('0xb4')]=[{'all':!![]}];}return db[_0x82c9('0xc2')]['findAll'](_0x441d7e);})[_0x82c9('0x2c')](function(_0x171976){_0x51f31e[_0x82c9('0xc3')]=_0x171976;return _0x51f31e;});}})[_0x82c9('0x2c')](respondWithFilteredResult(_0x52b8a8,_0x441d7e))[_0x82c9('0xb0')](handleError(_0x52b8a8,null));};exports['addTags']=function(_0x1f6cfb,_0x44c560,_0x28c2e4){return db['OpenchannelInteraction'][_0x82c9('0x6d')]({'where':{'id':_0x1f6cfb[_0x82c9('0xb1')]['id']}})['then'](handleEntityNotFound(_0x44c560,null))['then'](function(_0x6283f4){if(_0x6283f4){return _0x6283f4[_0x82c9('0xc4')](_0x1f6cfb[_0x82c9('0x70')]['ids'],_[_0x82c9('0xb9')](_0x1f6cfb[_0x82c9('0x70')],['ids','id'])||{})[_0x82c9('0xc5')](function(){return db[_0x82c9('0x68')]['findAll']({'attributes':['id',_0x82c9('0x31'),_0x82c9('0x46')],'where':{'id':_0x1f6cfb[_0x82c9('0x70')][_0x82c9('0xba')]}});})[_0x82c9('0x2c')](function(_0x359025){socket[_0x82c9('0xc6')](_0x82c9('0xc7'),{'id':Number(_0x1f6cfb[_0x82c9('0xb1')]['id']),'tags':_0x359025||[]});return{'id':Number(_0x1f6cfb['params']['id']),'tags':_0x359025||[]};});}})[_0x82c9('0x2c')](respondWithResult(_0x44c560,null))[_0x82c9('0xb0')](handleError(_0x44c560,null));};exports[_0x82c9('0xc8')]=function(_0x71ac70,_0x5e05ee,_0x1295d2){return db[_0x82c9('0x38')][_0x82c9('0x6d')]({'where':{'id':_0x71ac70['params']['id']}})[_0x82c9('0x2c')](handleEntityNotFound(_0x5e05ee,null))['then'](function(_0x591582){if(_0x591582){return _0x591582['removeTags'](_0x71ac70[_0x82c9('0x3c')]['ids']);}})[_0x82c9('0x2c')](respondWithStatusCode(_0x5e05ee,null))[_0x82c9('0xb0')](handleError(_0x5e05ee,null));};exports[_0x82c9('0xc9')]=function(_0x42b9dd,_0x464f58){var _0x58f214=moment()[_0x82c9('0xca')]()['toString']();var _0x5d09e4=path['join'](config['root'],_0x82c9('0xcb'),'files','tmp');var _0x187f97=path[_0x82c9('0xcc')](config[_0x82c9('0xcd')],_0x82c9('0xcb'),_0x82c9('0xce'),_0x82c9('0xcf'));var _0x1c1f39=path['join'](_0x5d09e4,_0x58f214);var _0x46486a=util[_0x82c9('0xc0')]('transcript-%d-%s.zip',_0x42b9dd[_0x82c9('0xb1')]['id'],_0x58f214);var _0x515a80=path[_0x82c9('0xcc')](_0x5d09e4,_0x46486a);var _0x3b880c=[];_0x3b880c[_0x82c9('0xae')]({'model':db[_0x82c9('0x6b')],'as':_0x82c9('0x6b'),'attributes':['id',_0x82c9('0xd0')],'raw':!![]});_0x3b880c[_0x82c9('0xae')]({'model':db['CmContact'],'as':_0x82c9('0x5f'),'attributes':['id',_0x82c9('0xd1'),_0x82c9('0xd2')],'raw':!![]});if(_0x42b9dd['query']['attachments']){_0x3b880c[_0x82c9('0xae')]({'model':db[_0x82c9('0xd3')],'as':_0x82c9('0xd3'),'raw':!![]});}var _0x3a3fd9=[{'model':db['OpenchannelMessage'],'as':_0x82c9('0xd4'),'attributes':['id',_0x82c9('0x70'),'createdAt',_0x82c9('0xd5'),_0x82c9('0xd6'),_0x82c9('0x7c')],'include':_0x3b880c}];_0x3a3fd9['push']({'model':db['OpenchannelAccount'],'as':_0x82c9('0xd7'),'attributes':['id','name']});_0x3a3fd9['push']({'model':db[_0x82c9('0x6b')],'as':'Owner','attributes':['id',_0x82c9('0xd0')]});return db[_0x82c9('0x38')][_0x82c9('0x6d')]({'where':{'id':_0x42b9dd[_0x82c9('0xb1')]['id']},'include':_0x3a3fd9})[_0x82c9('0x2c')](handleEntityNotFound(_0x464f58,null))['then'](function(_0x393489){if(_0x393489){var _0x10381a=_0x393489[_0x82c9('0xd8')]({'plain':!![]});fs['mkdirSync'](_0x1c1f39);var _0x5f4644={'channel':_0x82c9('0xd9'),'account':_0x10381a['Account']['name'],'agent':_0x10381a[_0x82c9('0xda')]?_0x10381a[_0x82c9('0xda')]['fullname']:_0x82c9('0xdb'),'createdAt':moment(_0x10381a[_0x82c9('0x75')])[_0x82c9('0xc0')](_0x82c9('0xc1'))[_0x82c9('0x98')](),'closedAt':_0x10381a['closed']?moment(_0x10381a[_0x82c9('0xdc')])[_0x82c9('0xc0')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x10381a[_0x82c9('0xdd')],'visibility':_0x10381a[_0x82c9('0xde')]?'Public':_0x82c9('0xdf'),'messages':_(_0x10381a['Messages'])[_0x82c9('0x7f')]({'secret':![]})[_0x82c9('0x33')](function(_0x3d7f8a){if(_0x3d7f8a[_0x82c9('0xd3')]){var _0xc225df=path['join'](_0x187f97,_0x3d7f8a[_0x82c9('0xd3')][_0x82c9('0xe0')]);if(fs[_0x82c9('0xe1')](_0xc225df)){fs[_0x82c9('0xe2')](_0xc225df)['pipe'](fs[_0x82c9('0xe3')](path[_0x82c9('0xcc')](_0x1c1f39,_0x3d7f8a[_0x82c9('0xd3')]['basename'])));}}return{'date':moment(_0x3d7f8a[_0x82c9('0x75')])[_0x82c9('0xc0')](_0x82c9('0xc1'))[_0x82c9('0x98')](),'sender':_0x3d7f8a[_0x82c9('0xd5')]===_0x82c9('0xe4')?_0x3d7f8a[_0x82c9('0x6b')]?_0x3d7f8a[_0x82c9('0x6b')]['fullname']:_0x82c9('0xe5'):_0x3d7f8a[_0x82c9('0x5f')]['firstName']+(_0x3d7f8a[_0x82c9('0x5f')][_0x82c9('0xd2')]?'\x20'+_0x3d7f8a['Contact']['lastName']:''),'body':_0x3d7f8a[_0x82c9('0xd3')]?_0x3d7f8a[_0x82c9('0xd3')][_0x82c9('0xe0')]:_0x3d7f8a[_0x82c9('0x70')],'direction':_0x3d7f8a['direction']===_0x82c9('0xe4')?'A':'C','secret':_0x3d7f8a[_0x82c9('0xd6')],'read':_0x3d7f8a[_0x82c9('0x7c')],'attachment':_0x3d7f8a[_0x82c9('0xd3')]};})[_0x82c9('0x5d')]()};return ejs[_0x82c9('0xe6')](path[_0x82c9('0xcc')](config['root'],_0x82c9('0xcb'),'views',_0x82c9('0xe7')),{'interaction':_0x5f4644})['then'](function(_0x19ff7d){var _0x3e8b36=path['join'](_0x1c1f39,_0x82c9('0xe8')+_0x10381a['id']+'-'+_0x58f214+_0x82c9('0xe9'));var _0x40a51c={'path':_0x3e8b36,'channel':_0x82c9('0xd9'),'interactionId':_0x10381a['id']};return pdf[_0x82c9('0xea')](_0x19ff7d,_0x40a51c);})[_0x82c9('0x2c')](function(){return new BPromise(function(_0x4a5e86,_0x479688){zipdir(_0x1c1f39,{'saveTo':_0x515a80},function(_0x3a1a21,_0x469ca5){if(_0x3a1a21)return _0x479688(_0x3a1a21);return _0x4a5e86(_0x469ca5);});})[_0x82c9('0x2c')](function(){return new BPromise(function(_0x13e46f,_0x1cecc3){rimraf(_0x1c1f39,function(_0x159611){if(_0x159611)_0x1cecc3(_0x159611);return _0x13e46f();});});})['then'](function(){return _0x464f58['download'](_0x515a80,_0x46486a,function(_0xd2dba4){if(_0xd2dba4){console[_0x82c9('0xeb')](_0x82c9('0xec'),_0xd2dba4);}else{fs[_0x82c9('0xed')](_0x515a80);}});});});}else{return _0x464f58[_0x82c9('0x20')](0xc8);}})[_0x82c9('0xb0')](handleError(_0x464f58,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 5a3d441..72a7e2d 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 _0xa94e=['findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','OpenchannelInteraction','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','getUsers','then','setDataValue','Users','map'];(function(_0x31de51,_0x7ee9a8){var _0x41170a=function(_0x36b072){while(--_0x36b072){_0x31de51['push'](_0x31de51['shift']());}};_0x41170a(++_0x7ee9a8);}(_0xa94e,0x124));var _0xea94=function(_0x3f6d74,_0x1b9fcc){_0x3f6d74=_0x3f6d74-0x0;var _0x4f372c=_0xa94e[_0x3f6d74];return _0x4f372c;};'use strict';var EventEmitter=require(_0xea94('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0xea94('0x1')];var OpenchannelMessage=require(_0xea94('0x2'))['db'][_0xea94('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xea94('0x4')](0x0);var events={'afterCreate':_0xea94('0x5'),'afterUpdate':_0xea94('0x6'),'afterDestroy':'remove'};function emitEvent(_0x5d1975){return function(_0x2119e2,_0x3c171c,_0x432410){_0x2119e2[_0xea94('0x7')]({'attributes':['id'],'raw':!![]})[_0xea94('0x8')](function(_0x39d1d5){_0x2119e2[_0xea94('0x9')](_0xea94('0xa'),_0x39d1d5[_0xea94('0xb')](function(_0xe770d9){return{'id':_0xe770d9['id']};}));return OpenchannelMessage[_0xea94('0xc')]({'where':{'OpenchannelInteractionId':_0x2119e2['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x50cd02){_0x2119e2['setDataValue'](_0xea94('0xd'),_0x50cd02[_0xea94('0xe')]);OpenchannelInteractionEvents[_0xea94('0xf')](_0x5d1975+':'+_0x2119e2['id'],_0x2119e2);OpenchannelInteractionEvents['emit'](_0x5d1975,_0x2119e2);_0x432410(null);})[_0xea94('0x10')](_0x432410(null));};}for(var e in events){if(events[_0xea94('0x11')](e)){var event=events[e];OpenchannelInteraction[_0xea94('0x12')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0x3912=['Users','setDataValue','unreadMessages','length','emit','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','remove','getUsers','then'];(function(_0x3e23bf,_0x287f22){var _0x423f00=function(_0x3748e0){while(--_0x3748e0){_0x3e23bf['push'](_0x3e23bf['shift']());}};_0x423f00(++_0x287f22);}(_0x3912,0x160));var _0x2391=function(_0x3c92db,_0x54ae6c){_0x3c92db=_0x3c92db-0x0;var _0x52f22a=_0x3912[_0x3c92db];return _0x52f22a;};'use strict';var EventEmitter=require(_0x2391('0x0'));var OpenchannelInteraction=require(_0x2391('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x2391('0x1'))['db'][_0x2391('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x2391('0x3')](0x0);var events={'afterCreate':_0x2391('0x4'),'afterUpdate':'update','afterDestroy':_0x2391('0x5')};function emitEvent(_0x56ac07){return function(_0x1eb327,_0x201661,_0x564542){_0x1eb327[_0x2391('0x6')]({'attributes':['id'],'raw':!![]})[_0x2391('0x7')](function(_0xa0b3ff){_0x1eb327['setDataValue'](_0x2391('0x8'),_0xa0b3ff['map'](function(_0x252de9){return{'id':_0x252de9['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x1eb327['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2391('0x7')](function(_0x58c37e){_0x1eb327[_0x2391('0x9')](_0x2391('0xa'),_0x58c37e[_0x2391('0xb')]);OpenchannelInteractionEvents['emit'](_0x56ac07+':'+_0x1eb327['id'],_0x1eb327);OpenchannelInteractionEvents[_0x2391('0xc')](_0x56ac07,_0x1eb327);_0x564542(null);})['catch'](_0x564542(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x2391('0xd')](e,emitEvent(event));}}module[_0x2391('0xe')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 9e860c2..32213e6 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 _0xcbff=['changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3b578c,_0x32a640){var _0x81476b=function(_0x13c4a8){while(--_0x13c4a8){_0x3b578c['push'](_0x3b578c['shift']());}};_0x81476b(++_0x32a640);}(_0xcbff,0x1c6));var _0xfcbf=function(_0x371f33,_0x278a69){_0x371f33=_0x371f33-0x0;var _0x246c96=_0xcbff[_0x371f33];return _0x246c96;};'use strict';var _=require(_0xfcbf('0x0'));var util=require(_0xfcbf('0x1'));var logger=require('../../config/logger')(_0xfcbf('0x2'));var moment=require(_0xfcbf('0x3'));var BPromise=require(_0xfcbf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfcbf('0x5'));var rimraf=require(_0xfcbf('0x6'));var config=require(_0xfcbf('0x7'));var attributes=require(_0xfcbf('0x8'));module[_0xfcbf('0x9')]=function(_0x5d11f7,_0x5e3962){return _0x5d11f7['define'](_0xfcbf('0xa'),attributes,{'tableName':_0xfcbf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfcbf('0xc'),'collate':_0xfcbf('0xd'),'hooks':{'beforeUpdate':function(_0x5ae120,_0x462e7c,_0x35763f){if(_0x5ae120[_0xfcbf('0xe')]('closed')){_0x5ae120[_0xfcbf('0xf')]=moment()[_0xfcbf('0x10')](_0xfcbf('0x11'));}_0x35763f(null,_0x5ae120);}}});}; \ No newline at end of file +var _0x1dda=['exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x269456,_0x5980ef){var _0x52c201=function(_0x3ffb86){while(--_0x3ffb86){_0x269456['push'](_0x269456['shift']());}};_0x52c201(++_0x5980ef);}(_0x1dda,0x139));var _0xa1dd=function(_0x153e7d,_0x10a35f){_0x153e7d=_0x153e7d-0x0;var _0x3c22dd=_0x1dda[_0x153e7d];return _0x3c22dd;};'use strict';var _=require(_0xa1dd('0x0'));var util=require(_0xa1dd('0x1'));var logger=require(_0xa1dd('0x2'))('api');var moment=require(_0xa1dd('0x3'));var BPromise=require(_0xa1dd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa1dd('0x5'));var rimraf=require(_0xa1dd('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelInteraction.attributes');module[_0xa1dd('0x7')]=function(_0x597071,_0x52c86d){return _0x597071[_0xa1dd('0x8')](_0xa1dd('0x9'),attributes,{'tableName':_0xa1dd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa1dd('0xb'),'collate':_0xa1dd('0xc'),'hooks':{'beforeUpdate':function(_0x231949,_0x102d56,_0x18d6a2){if(_0x231949[_0xa1dd('0xd')](_0xa1dd('0xe'))){_0x231949['closedAt']=moment()['format'](_0xa1dd('0xf'));}_0x18d6a2(null,_0x231949);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 130fbb8..aeb4cad 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 _0xdf7a=['UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','raw','options','where','limit','then','AddTagsToOpenchannelInteraction','addTags','omit','ids','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./openchannelInteraction.socket','register','request','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x244914,_0xbeb85){var _0x4e4939=function(_0xcc2017){while(--_0xcc2017){_0x244914['push'](_0x244914['shift']());}};_0x4e4939(++_0xbeb85);}(_0xdf7a,0x16e));var _0xadf7=function(_0x21c8a9,_0x5687f4){_0x21c8a9=_0x21c8a9-0x0;var _0x1f8a72=_0xdf7a[_0x21c8a9];return _0x1f8a72;};'use strict';var _=require(_0xadf7('0x0'));var util=require('util');var moment=require(_0xadf7('0x1'));var BPromise=require(_0xadf7('0x2'));var rs=require(_0xadf7('0x3'));var fs=require('fs');var Redis=require(_0xadf7('0x4'));var db=require(_0xadf7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xadf7('0x6'))(_0xadf7('0x7'));var config=require(_0xadf7('0x8'));var jayson=require(_0xadf7('0x9'));var client=jayson[_0xadf7('0xa')][_0xadf7('0xb')]({'port':0x232a});config['redis']=_[_0xadf7('0xc')](config['redis'],{'host':_0xadf7('0xd'),'port':0x18eb});var socket=require(_0xadf7('0xe'))(new Redis(config[_0xadf7('0xf')]));require(_0xadf7('0x10'))[_0xadf7('0x11')](socket);function respondWithRpcPromise(_0x33fb0e,_0x1cbc26,_0x19a2ff){return new BPromise(function(_0x1eb9bd,_0x41d7a2){return client[_0xadf7('0x12')](_0x33fb0e,_0x19a2ff)['then'](function(_0x4d4ae6){logger[_0xadf7('0x13')](_0xadf7('0x14'),_0x1cbc26,_0xadf7('0x15'));logger[_0xadf7('0x16')](_0xadf7('0x17'),_0x1cbc26,_0xadf7('0x15'),JSON[_0xadf7('0x18')](_0x4d4ae6));if(_0x4d4ae6[_0xadf7('0x19')]){if(_0x4d4ae6[_0xadf7('0x19')][_0xadf7('0x1a')]===0x1f4){logger[_0xadf7('0x19')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1cbc26,_0x4d4ae6['error'][_0xadf7('0x1b')]);return _0x41d7a2(_0x4d4ae6[_0xadf7('0x19')][_0xadf7('0x1b')]);}logger[_0xadf7('0x19')](_0xadf7('0x14'),_0x1cbc26,_0x4d4ae6['error'][_0xadf7('0x1b')]);return _0x1eb9bd(_0x4d4ae6[_0xadf7('0x19')][_0xadf7('0x1b')]);}else{logger[_0xadf7('0x13')](_0xadf7('0x14'),_0x1cbc26,_0xadf7('0x15'));_0x1eb9bd(_0x4d4ae6[_0xadf7('0x1c')][_0xadf7('0x1b')]);}})[_0xadf7('0x1d')](function(_0x471548){logger[_0xadf7('0x19')](_0xadf7('0x14'),_0x1cbc26,_0x471548);_0x41d7a2(_0x471548);});});}exports[_0xadf7('0x1e')]=function(_0x5cdd7c){var _0x59f6d3=this;return new Promise(function(_0x3b3e03,_0x23b286){return db[_0xadf7('0x1f')][_0xadf7('0x20')](_0x5cdd7c[_0xadf7('0x21')],{'raw':_0x5cdd7c['options']?_0x5cdd7c['options'][_0xadf7('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5cdd7c[_0xadf7('0x23')]?_0x5cdd7c[_0xadf7('0x23')][_0xadf7('0x24')]||null:null,'attributes':_0x5cdd7c[_0xadf7('0x23')]?_0x5cdd7c[_0xadf7('0x23')]['attributes']||null:null,'limit':_0x5cdd7c[_0xadf7('0x23')]?_0x5cdd7c[_0xadf7('0x23')][_0xadf7('0x25')]||null:null})[_0xadf7('0x26')](function(_0x5a892a){logger['info'](_0xadf7('0x1e'),_0x5cdd7c);logger[_0xadf7('0x16')](_0xadf7('0x1e'),_0x5cdd7c,JSON[_0xadf7('0x18')](_0x5a892a));_0x3b3e03(_0x5a892a);})[_0xadf7('0x1d')](function(_0x97be28){logger['error']('UpdateOpenchannelInteraction',_0x97be28[_0xadf7('0x1b')],_0x5cdd7c);_0x23b286(_0x59f6d3[_0xadf7('0x19')](0x1f4,_0x97be28[_0xadf7('0x1b')]));});});};exports[_0xadf7('0x27')]=function(_0x12abf1){return new Promise(function(_0x1f7a4d,_0x3d3855){return db['OpenchannelInteraction']['find']({'where':_0x12abf1[_0xadf7('0x23')]?_0x12abf1['options']['where']||null:null})[_0xadf7('0x26')](function(_0x31e9c3){if(_0x31e9c3){return _0x31e9c3[_0xadf7('0x28')](_0x12abf1[_0xadf7('0x21')]['ids'],_[_0xadf7('0x29')](_0x12abf1[_0xadf7('0x21')],[_0xadf7('0x2a'),'id'])||{});}})['spread'](function(_0x485945){logger[_0xadf7('0x13')](_0xadf7('0x2b'),_0x12abf1);logger[_0xadf7('0x16')](_0xadf7('0x2b'),_0x12abf1,JSON[_0xadf7('0x18')](_0x485945));_0x1f7a4d(_0x485945);})[_0xadf7('0x1d')](function(_0x2619c1){logger[_0xadf7('0x19')](_0xadf7('0x2b'),_0x2619c1[_0xadf7('0x1b')],_0x12abf1);_0x3d3855(_this[_0xadf7('0x19')](0x1f4,_0x2619c1[_0xadf7('0x1b')]));});});}; \ No newline at end of file +var _0x578a=['redis','socket.io-emitter','./openchannelInteraction.socket','register','then','info','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelInteraction,\x20%s,\x20%s','message','result','catch','UpdateOpenchannelInteraction','update','body','options','raw','where','attributes','limit','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2efeb7,_0x403fce){var _0x191e25=function(_0x25c3ac){while(--_0x25c3ac){_0x2efeb7['push'](_0x2efeb7['shift']());}};_0x191e25(++_0x403fce);}(_0x578a,0x7a));var _0xa578=function(_0x430459,_0x58519c){_0x430459=_0x430459-0x0;var _0x3a2439=_0x578a[_0x430459];return _0x3a2439;};'use strict';var _=require(_0xa578('0x0'));var util=require('util');var moment=require(_0xa578('0x1'));var BPromise=require(_0xa578('0x2'));var rs=require(_0xa578('0x3'));var fs=require('fs');var Redis=require(_0xa578('0x4'));var db=require(_0xa578('0x5'))['db'];var utils=require(_0xa578('0x6'));var logger=require(_0xa578('0x7'))(_0xa578('0x8'));var config=require(_0xa578('0x9'));var jayson=require(_0xa578('0xa'));var client=jayson[_0xa578('0xb')][_0xa578('0xc')]({'port':0x232a});config[_0xa578('0xd')]=_['defaults'](config[_0xa578('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xa578('0xe'))(new Redis(config[_0xa578('0xd')]));require(_0xa578('0xf'))[_0xa578('0x10')](socket);function respondWithRpcPromise(_0x5bf778,_0x6c4d0d,_0x160266){return new BPromise(function(_0x5e1a7b,_0x3484f4){return client['request'](_0x5bf778,_0x160266)[_0xa578('0x11')](function(_0x35f02c){logger[_0xa578('0x12')]('OpenchannelInteraction,\x20%s,\x20%s',_0x6c4d0d,'request\x20sent');logger[_0xa578('0x13')](_0xa578('0x14'),_0x6c4d0d,_0xa578('0x15'),JSON[_0xa578('0x16')](_0x35f02c));if(_0x35f02c[_0xa578('0x17')]){if(_0x35f02c['error'][_0xa578('0x18')]===0x1f4){logger[_0xa578('0x17')](_0xa578('0x19'),_0x6c4d0d,_0x35f02c[_0xa578('0x17')][_0xa578('0x1a')]);return _0x3484f4(_0x35f02c[_0xa578('0x17')][_0xa578('0x1a')]);}logger[_0xa578('0x17')](_0xa578('0x19'),_0x6c4d0d,_0x35f02c[_0xa578('0x17')][_0xa578('0x1a')]);return _0x5e1a7b(_0x35f02c[_0xa578('0x17')]['message']);}else{logger['info'](_0xa578('0x19'),_0x6c4d0d,_0xa578('0x15'));_0x5e1a7b(_0x35f02c[_0xa578('0x1b')][_0xa578('0x1a')]);}})[_0xa578('0x1c')](function(_0x168ad3){logger[_0xa578('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x6c4d0d,_0x168ad3);_0x3484f4(_0x168ad3);});});}exports[_0xa578('0x1d')]=function(_0x291477){var _0x10bcc9=this;return new Promise(function(_0x2ee22f,_0xf20a85){return db['OpenchannelInteraction'][_0xa578('0x1e')](_0x291477[_0xa578('0x1f')],{'raw':_0x291477['options']?_0x291477[_0xa578('0x20')][_0xa578('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x291477[_0xa578('0x20')]?_0x291477['options'][_0xa578('0x22')]||null:null,'attributes':_0x291477[_0xa578('0x20')]?_0x291477[_0xa578('0x20')][_0xa578('0x23')]||null:null,'limit':_0x291477[_0xa578('0x20')]?_0x291477['options'][_0xa578('0x24')]||null:null})['then'](function(_0xa0013a){logger['info']('UpdateOpenchannelInteraction',_0x291477);logger['debug'](_0xa578('0x1d'),_0x291477,JSON[_0xa578('0x16')](_0xa0013a));_0x2ee22f(_0xa0013a);})[_0xa578('0x1c')](function(_0x4be9f5){logger[_0xa578('0x17')](_0xa578('0x1d'),_0x4be9f5['message'],_0x291477);_0xf20a85(_0x10bcc9[_0xa578('0x17')](0x1f4,_0x4be9f5[_0xa578('0x1a')]));});});};exports[_0xa578('0x25')]=function(_0x5d94bd){return new Promise(function(_0x4fde47,_0x21adf8){return db[_0xa578('0x26')][_0xa578('0x27')]({'where':_0x5d94bd[_0xa578('0x20')]?_0x5d94bd[_0xa578('0x20')][_0xa578('0x22')]||null:null})[_0xa578('0x11')](function(_0x502e11){if(_0x502e11){return _0x502e11[_0xa578('0x28')](_0x5d94bd[_0xa578('0x1f')][_0xa578('0x29')],_[_0xa578('0x2a')](_0x5d94bd[_0xa578('0x1f')],[_0xa578('0x29'),'id'])||{});}})[_0xa578('0x2b')](function(_0xfd80af){logger[_0xa578('0x12')](_0xa578('0x2c'),_0x5d94bd);logger[_0xa578('0x13')]('AddTags',_0x5d94bd,JSON['stringify'](_0xfd80af));_0x4fde47(_0xfd80af);})['catch'](function(_0x4b6ff6){logger[_0xa578('0x17')](_0xa578('0x2c'),_0x4b6ff6[_0xa578('0x1a')],_0x5d94bd);_0x21adf8(_this['error'](0x1f4,_0x4b6ff6['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 9a19157..65a8a8d 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 _0xf02c=['register','openchannelInteraction:','./openchannelInteraction.events','save','emit'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xf02c,0xd9));var _0xcf02=function(_0x1eab37,_0x3f8a10){_0x1eab37=_0x1eab37-0x0;var _0x12f74a=_0xf02c[_0x1eab37];return _0x12f74a;};'use strict';var OpenchannelInteractionEvents=require(_0xcf02('0x0'));var events=[_0xcf02('0x1'),'remove','update'];function createListener(_0x454417,_0x53998c){return function(_0x36ef6c){_0x53998c[_0xcf02('0x2')](_0x454417,_0x36ef6c);};}function removeListener(_0xdd16c9,_0xefa849){return function(){OpenchannelInteractionEvents['removeListener'](_0xdd16c9,_0xefa849);};}exports[_0xcf02('0x3')]=function(_0x5dd0ef){for(var _0x2ee6d1=0x0,_0xf82068=events['length'];_0x2ee6d1<_0xf82068;_0x2ee6d1++){var _0x2c3943=events[_0x2ee6d1];var _0x4f65be=createListener(_0xcf02('0x4')+_0x2c3943,_0x5dd0ef);OpenchannelInteractionEvents['on'](_0x2c3943,_0x4f65be);}}; \ No newline at end of file +var _0x7a64=['emit','removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','save','remove'];(function(_0x29932d,_0x1425e9){var _0x15524f=function(_0x1c9732){while(--_0x1c9732){_0x29932d['push'](_0x29932d['shift']());}};_0x15524f(++_0x1425e9);}(_0x7a64,0x15d));var _0x47a6=function(_0x159005,_0x5d336d){_0x159005=_0x159005-0x0;var _0x3da39b=_0x7a64[_0x159005];return _0x3da39b;};'use strict';var OpenchannelInteractionEvents=require(_0x47a6('0x0'));var events=[_0x47a6('0x1'),_0x47a6('0x2'),'update'];function createListener(_0xb52ac7,_0x5ba9bf){return function(_0x2d0219){_0x5ba9bf[_0x47a6('0x3')](_0xb52ac7,_0x2d0219);};}function removeListener(_0x46337c,_0x1d46fa){return function(){OpenchannelInteractionEvents[_0x47a6('0x4')](_0x46337c,_0x1d46fa);};}exports[_0x47a6('0x5')]=function(_0x1d49e5){for(var _0x39d1de=0x0,_0x973bef=events[_0x47a6('0x6')];_0x39d1de<_0x973bef;_0x39d1de++){var _0x3a646d=events[_0x39d1de];var _0x6a6a9b=createListener(_0x47a6('0x7')+_0x3a646d,_0x1d49e5);OpenchannelInteractionEvents['on'](_0x3a646d,_0x6a6a9b);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 6d53575..42d884c 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports'];(function(_0x4be459,_0x3ded05){var _0x94dfab=function(_0x37c097){while(--_0x37c097){_0x4be459['push'](_0x4be459['shift']());}};_0x94dfab(++_0x3ded05);}(_0xedd9,0xfc));var _0x9edd=function(_0x3cedce,_0x416557){_0x3cedce=_0x3cedce-0x0;var _0x280108=_0xedd9[_0x3cedce];return _0x280108;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['show']);router[_0x9edd('0xf')]('/',auth['isAuthenticated'](),interaction[_0x9edd('0x10')](_0x9edd('0x11'),'openchannelmessage:create'),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')](_0x9edd('0x15'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x16')]);router[_0x9edd('0x13')](_0x9edd('0x17'),auth['isAuthenticated'](),controller[_0x9edd('0x18')]);router[_0x9edd('0x19')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x1a')]);module[_0x9edd('0x1b')]=router; \ No newline at end of file +var _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 3b735b2..42d7335 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 _0x6f59=['BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports','TEXT','medium'];(function(_0x3ad9f3,_0x4e9855){var _0x26723d=function(_0xc1a78a){while(--_0xc1a78a){_0x3ad9f3['push'](_0x3ad9f3['shift']());}};_0x26723d(++_0x4e9855);}(_0x6f59,0x1be));var _0x96f5=function(_0x1e973a,_0x2025d4){_0x1e973a=_0x1e973a-0x0;var _0x17ba11=_0x6f59[_0x1e973a];return _0x17ba11;};'use strict';var Sequelize=require(_0x96f5('0x0'));module[_0x96f5('0x1')]={'body':{'type':Sequelize[_0x96f5('0x2')](_0x96f5('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x96f5('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x96f5('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x96f5('0x5')]('in',_0x96f5('0x6')),'defaultValue':_0x96f5('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x96f5('0x7')]},'providerName':{'type':Sequelize[_0x96f5('0x8')]},'providerResponse':{'type':Sequelize[_0x96f5('0x2')]}}; \ No newline at end of file +var _0xbc87=['STRING','TEXT','sequelize','medium','BOOLEAN','out','DATE'];(function(_0x459a5c,_0xf310e5){var _0xe9f02d=function(_0x50dbfc){while(--_0x50dbfc){_0x459a5c['push'](_0x459a5c['shift']());}};_0xe9f02d(++_0xf310e5);}(_0xbc87,0x144));var _0x7bc8=function(_0x3d5cd3,_0x1e8caa){_0x3d5cd3=_0x3d5cd3-0x0;var _0x576889=_0xbc87[_0x3d5cd3];return _0x576889;};'use strict';var Sequelize=require(_0x7bc8('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x7bc8('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x7bc8('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x7bc8('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x7bc8('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0x7bc8('0x4')]},'providerName':{'type':Sequelize[_0x7bc8('0x5')]},'providerResponse':{'type':Sequelize[_0x7bc8('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 686d3ba..6db3fe5 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 _0x4435=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','stack','name','send','index','OpenchannelMessage','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','include','rows','show','params','includeAll','find','create','body','describe','openchannel-interactions','accept','openchannel','read','readAt','format','UserId','user','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','User','fullname','internal','agent','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','../../config/logger','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','ContactId','QueryTypes','SELECT','contact','event','rejectmessage','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js'];(function(_0x552fce,_0x3f24bc){var _0x3e27a2=function(_0xc91154){while(--_0xc91154){_0x552fce['push'](_0x552fce['shift']());}};_0x3e27a2(++_0x3f24bc);}(_0x4435,0x79));var _0x5443=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0x4435[_0x5317b5];return _0x3b7ce2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5443('0x0'));var zipdir=require(_0x5443('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5443('0x2'));var BPromise=require(_0x5443('0x3'));var Mustache=require(_0x5443('0x4'));var util=require(_0x5443('0x5'));var path=require(_0x5443('0x6'));var sox=require('sox');var csv=require(_0x5443('0x7'));var ejs=require(_0x5443('0x8'));var fs=require('fs');var fs_extra=require(_0x5443('0x9'));var _=require(_0x5443('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5443('0xb'));var deskjs=require(_0x5443('0xc'));var toCsv=require(_0x5443('0x7'));var querystring=require(_0x5443('0xd'));var Papa=require('papaparse');var Redis=require(_0x5443('0xe'));var authService=require(_0x5443('0xf'));var qs=require(_0x5443('0x10'));var as=require(_0x5443('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5443('0x12'));var utils=require(_0x5443('0x13'));var config=require(_0x5443('0x14'));var licenseUtil=require(_0x5443('0x15'));var db=require(_0x5443('0x16'))['db'];config[_0x5443('0x17')]=_[_0x5443('0x18')](config[_0x5443('0x17')],{'host':_0x5443('0x19'),'port':0x18eb});var socket=require(_0x5443('0x1a'))(new Redis(config['redis']));require(_0x5443('0x1b'))[_0x5443('0x1c')](socket);var jayson=require(_0x5443('0x1d'));var client=jayson[_0x5443('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0x5443('0x1e')][_0x5443('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x566d4b,_0x457edb,_0x5210b4,_0x39a419){return new BPromise(function(_0xca9855,_0x3475b2){var _0x4986c9=_0x39a419||client;return _0x4986c9[_0x5443('0x20')](_0x566d4b,_0x5210b4)['then'](function(_0x53bd2a){logger[_0x5443('0x21')](_0x5443('0x22'),_0x457edb,_0x5443('0x23'));logger['debug'](_0x5443('0x24'),_0x457edb,_0x5443('0x23'),JSON[_0x5443('0x25')](_0x53bd2a));if(_0x53bd2a['error']){if(_0x53bd2a[_0x5443('0x26')][_0x5443('0x27')]===0x1f4){logger[_0x5443('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x457edb,_0x53bd2a['error'][_0x5443('0x28')]);return _0x3475b2(_0x53bd2a[_0x5443('0x26')][_0x5443('0x28')]);}logger[_0x5443('0x26')](_0x5443('0x22'),_0x457edb,_0x53bd2a[_0x5443('0x26')]['message']);return _0xca9855(_0x53bd2a[_0x5443('0x26')][_0x5443('0x28')]);}else{logger[_0x5443('0x21')](_0x5443('0x22'),_0x457edb,_0x5443('0x23'));_0xca9855(_0x53bd2a['result'][_0x5443('0x28')]);}})[_0x5443('0x29')](function(_0x39e687){logger[_0x5443('0x26')](_0x5443('0x22'),_0x457edb,_0x39e687);_0x3475b2(_0x39e687);});});}function respondWithStatusCode(_0x1d4a81,_0x96bd3c){_0x96bd3c=_0x96bd3c||0xcc;return function(_0xfddb87){if(_0xfddb87){return _0x1d4a81[_0x5443('0x2a')](_0x96bd3c);}return _0x1d4a81[_0x5443('0x2b')](_0x96bd3c)[_0x5443('0x2c')]();};}function respondWithResult(_0x1067b8,_0x47f4df){_0x47f4df=_0x47f4df||0xc8;return function(_0x3bfc3b){if(_0x3bfc3b){return _0x1067b8[_0x5443('0x2b')](_0x47f4df)[_0x5443('0x2d')](_0x3bfc3b);}};}function respondWithFilteredResult(_0x226e6f,_0x1d60d6){return function(_0x5c35fe){if(_0x5c35fe){var _0x4922fd=typeof _0x1d60d6[_0x5443('0x2e')]===_0x5443('0x2f')&&typeof _0x1d60d6['limit']===_0x5443('0x2f');var _0x315eb6=_0x5c35fe[_0x5443('0x30')];var _0x5e0a72=_0x4922fd?0x0:_0x1d60d6['offset'];var _0x472736=_0x4922fd?_0x5c35fe['count']:_0x1d60d6[_0x5443('0x2e')]+_0x1d60d6[_0x5443('0x31')];var _0x25c604;if(_0x472736>=_0x315eb6){_0x472736=_0x315eb6;_0x25c604=0xc8;}else{_0x25c604=0xce;}_0x226e6f[_0x5443('0x2b')](_0x25c604);return _0x226e6f[_0x5443('0x32')]('Content-Range',_0x5e0a72+'-'+_0x472736+'/'+_0x315eb6)[_0x5443('0x2d')](_0x5c35fe);}return null;};}function patchUpdates(_0xf87a5f){return function(_0x2d54d2){try{jsonpatch[_0x5443('0x33')](_0x2d54d2,_0xf87a5f,!![]);}catch(_0x3005aa){return BPromise[_0x5443('0x34')](_0x3005aa);}return _0x2d54d2[_0x5443('0x35')]();};}function saveUpdates(_0x150294,_0x58b33d){return function(_0x1908a6){if(_0x1908a6){return _0x1908a6[_0x5443('0x36')](_0x150294)[_0x5443('0x37')](function(_0x188f0e){return _0x188f0e;});}return null;};}function removeEntity(_0xd3ffd0,_0x142833){return function(_0x42ff68){if(_0x42ff68){return _0x42ff68[_0x5443('0x38')]()[_0x5443('0x37')](function(){_0xd3ffd0['status'](0xcc)[_0x5443('0x2c')]();});}};}function handleEntityNotFound(_0x55e549,_0x12d353){return function(_0x22765a){if(!_0x22765a){_0x55e549[_0x5443('0x2a')](0x194);}return _0x22765a;};}function handleError(_0x4ad3bf,_0x426c66){_0x426c66=_0x426c66||0x1f4;return function(_0x207e8a){logger[_0x5443('0x26')](_0x207e8a[_0x5443('0x39')]);if(_0x207e8a['name']){delete _0x207e8a[_0x5443('0x3a')];}_0x4ad3bf['status'](_0x426c66)[_0x5443('0x3b')](_0x207e8a);};}exports[_0x5443('0x3c')]=function(_0x41c0bc,_0x47f8cc){var _0x305969={},_0x132ac2={},_0x32176e={'count':0x0,'rows':[]};var _0x389056=_['map'](db[_0x5443('0x3d')][_0x5443('0x3e')],function(_0x17a2d7){return{'name':_0x17a2d7['fieldName'],'type':_0x17a2d7[_0x5443('0x3f')][_0x5443('0x40')]};});_0x132ac2[_0x5443('0x41')]=_[_0x5443('0x42')](_0x389056,_0x5443('0x3a'));_0x132ac2[_0x5443('0x43')]=_[_0x5443('0x44')](_0x41c0bc[_0x5443('0x43')]);_0x132ac2['filters']=_[_0x5443('0x45')](_0x132ac2[_0x5443('0x41')],_0x132ac2['query']);_0x305969[_0x5443('0x46')]=_[_0x5443('0x45')](_0x132ac2['model'],qs['fields'](_0x41c0bc['query'][_0x5443('0x47')]));_0x305969[_0x5443('0x46')]=_0x305969[_0x5443('0x46')][_0x5443('0x48')]?_0x305969[_0x5443('0x46')]:_0x132ac2[_0x5443('0x41')];if(!_0x41c0bc[_0x5443('0x43')][_0x5443('0x49')](_0x5443('0x4a'))){_0x305969[_0x5443('0x31')]=qs[_0x5443('0x31')](_0x41c0bc[_0x5443('0x43')][_0x5443('0x31')]);_0x305969['offset']=qs['offset'](_0x41c0bc[_0x5443('0x43')][_0x5443('0x2e')]);}_0x305969[_0x5443('0x4b')]=qs[_0x5443('0x4c')](_0x41c0bc[_0x5443('0x43')][_0x5443('0x4c')]);_0x305969['where']=qs[_0x5443('0x4d')](_[_0x5443('0x4e')](_0x41c0bc[_0x5443('0x43')],_0x132ac2[_0x5443('0x4d')]),_0x389056);if(_0x41c0bc[_0x5443('0x43')][_0x5443('0x4f')]){_0x305969[_0x5443('0x50')]=_[_0x5443('0x51')](_0x305969[_0x5443('0x50')],{'$or':_['map'](_0x389056,function(_0x25e122){if(_0x25e122[_0x5443('0x3f')]!=='VIRTUAL'){var _0x5b8aa8={};_0x5b8aa8[_0x25e122['name']]={'$like':'%'+_0x41c0bc[_0x5443('0x43')]['filter']+'%'};return _0x5b8aa8;}})});}_0x305969=_[_0x5443('0x51')]({},_0x305969,_0x41c0bc[_0x5443('0x52')]);var _0x5d775c={'where':_0x305969['where']};return db[_0x5443('0x3d')][_0x5443('0x30')](_0x5d775c)[_0x5443('0x37')](function(_0x3a630e){_0x32176e[_0x5443('0x30')]=_0x3a630e;if(_0x41c0bc[_0x5443('0x43')]['includeAll']){_0x305969[_0x5443('0x53')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x305969);})['then'](function(_0x4e011f){_0x32176e[_0x5443('0x54')]=_0x4e011f;return _0x32176e;})[_0x5443('0x37')](respondWithFilteredResult(_0x47f8cc,_0x305969))[_0x5443('0x29')](handleError(_0x47f8cc,null));};exports[_0x5443('0x55')]=function(_0x43e3c5,_0x248d9e){var _0x18200e={'raw':!![],'where':{'id':_0x43e3c5[_0x5443('0x56')]['id']}},_0x1b6cbb={};_0x1b6cbb[_0x5443('0x41')]=_[_0x5443('0x44')](db[_0x5443('0x3d')]['rawAttributes']);_0x1b6cbb[_0x5443('0x43')]=_[_0x5443('0x44')](_0x43e3c5['query']);_0x1b6cbb['filters']=_[_0x5443('0x45')](_0x1b6cbb[_0x5443('0x41')],_0x1b6cbb['query']);_0x18200e[_0x5443('0x46')]=_[_0x5443('0x45')](_0x1b6cbb[_0x5443('0x41')],qs['fields'](_0x43e3c5[_0x5443('0x43')]['fields']));_0x18200e['attributes']=_0x18200e['attributes'][_0x5443('0x48')]?_0x18200e['attributes']:_0x1b6cbb['model'];if(_0x43e3c5[_0x5443('0x43')][_0x5443('0x57')]){_0x18200e[_0x5443('0x53')]=[{'all':!![]}];}_0x18200e=_[_0x5443('0x51')]({},_0x18200e,_0x43e3c5[_0x5443('0x52')]);return db[_0x5443('0x3d')][_0x5443('0x58')](_0x18200e)[_0x5443('0x37')](handleEntityNotFound(_0x248d9e,null))[_0x5443('0x37')](respondWithResult(_0x248d9e,null))['catch'](handleError(_0x248d9e,null));};exports[_0x5443('0x59')]=function(_0x4fe8b0,_0x2bb6c0){return db['OpenchannelMessage'][_0x5443('0x59')](_0x4fe8b0[_0x5443('0x5a')],{})['then'](respondWithResult(_0x2bb6c0,0xc9))[_0x5443('0x29')](handleError(_0x2bb6c0,null));};exports['update']=function(_0x1634f6,_0x17930c){if(_0x1634f6[_0x5443('0x5a')]['id']){delete _0x1634f6['body']['id'];}return db['OpenchannelMessage'][_0x5443('0x58')]({'where':{'id':_0x1634f6[_0x5443('0x56')]['id']}})[_0x5443('0x37')](handleEntityNotFound(_0x17930c,null))['then'](saveUpdates(_0x1634f6[_0x5443('0x5a')],null))[_0x5443('0x37')](respondWithResult(_0x17930c,null))[_0x5443('0x29')](handleError(_0x17930c,null));};exports[_0x5443('0x38')]=function(_0x96a1ed,_0x2d480a){return db[_0x5443('0x3d')][_0x5443('0x58')]({'where':{'id':_0x96a1ed['params']['id']}})[_0x5443('0x37')](handleEntityNotFound(_0x2d480a,null))[_0x5443('0x37')](removeEntity(_0x2d480a,null))['catch'](handleError(_0x2d480a,null));};exports[_0x5443('0x5b')]=function(_0x1e42f4,_0x3b268c){return db[_0x5443('0x3d')][_0x5443('0x5b')]()[_0x5443('0x37')](respondWithResult(_0x3b268c,null))[_0x5443('0x29')](handleError(_0x3b268c,null));};var interaction_log=require('../../config/logger')(_0x5443('0x5c'));exports[_0x5443('0x5d')]=function(_0x243ed7,_0x2261ce,_0x44bb84){var _0x3228a0={'agent':{},'channel':_0x5443('0x5e')};if(_0x243ed7[_0x5443('0x5a')]['id']){delete _0x243ed7[_0x5443('0x5a')]['id'];}_0x243ed7[_0x5443('0x5a')][_0x5443('0x5f')]=!![];_0x243ed7[_0x5443('0x5a')][_0x5443('0x60')]=moment()[_0x5443('0x61')]('YYYY-MM-DD\x20HH:mm:ss');_0x243ed7['body'][_0x5443('0x62')]=_0x243ed7[_0x5443('0x5a')]['UserId']||_0x243ed7[_0x5443('0x63')]['id'];_0x3228a0['agent']['id']=_0x243ed7[_0x5443('0x5a')][_0x5443('0x62')];return db[_0x5443('0x3d')][_0x5443('0x58')]({'where':{'id':_0x243ed7[_0x5443('0x56')]['id'],'UserId':null}})[_0x5443('0x37')](handleEntityNotFound(_0x2261ce,null))['then'](saveUpdates(_0x243ed7[_0x5443('0x5a')],null))[_0x5443('0x37')](function(_0x5b3cea){if(_0x5b3cea){_0x3228a0[_0x5443('0x28')]=_0x5b3cea[_0x5443('0x64')]({'plain':!![]});return db[_0x5443('0x65')][_0x5443('0x58')]({'where':{'id':_0x5b3cea[_0x5443('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x2261ce,null))[_0x5443('0x37')](function(_0x49e1a4){if(_0x49e1a4){return _0x49e1a4[_0x5443('0x36')]({'UserId':_0x243ed7[_0x5443('0x5a')][_0x5443('0x62')],'read1stAt':_[_0x5443('0x67')](_0x49e1a4['read1stAt'])?moment()['format'](_0x5443('0x68')):undefined});}return null;})[_0x5443('0x37')](function(_0x2b487f){if(_0x2b487f){_0x3228a0[_0x5443('0x69')]=_0x2b487f[_0x5443('0x64')]({'plain':!![]});interaction_log[_0x5443('0x21')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x243ed7['user']['id'],_0x243ed7['user'][_0x5443('0x3a')],_0x243ed7[_0x5443('0x63')]['role'],_0x3228a0['interaction']['id'],_0x243ed7[_0x5443('0x5a')]?JSON['stringify'](_0x243ed7[_0x5443('0x5a')]):'null');return respondWithRpcPromise(_0x5443('0x6a'),_0x5443('0x6b'),_0x3228a0);}return null;})[_0x5443('0x37')](function(_0x3a02b0){var _0x4a2170=_0x5443('0x6c')+_0x3a02b0[_0x5443('0x28')]['ContactId'];return db[_0x5443('0x6d')][_0x5443('0x43')](_0x4a2170,{'type':db[_0x5443('0x6e')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x444605){return _0x444605;});})['then'](function(_0xb79fec){if(_0xb79fec){_0x3228a0[_0x5443('0x28')]['contact']=_0xb79fec[0x0];if(!_0x243ed7[_0x5443('0x5a')][_0x5443('0x62')])return;return db[_0x5443('0x6f')][_0x5443('0x58')]({'where':{'id':_0x243ed7[_0x5443('0x5a')][_0x5443('0x62')],'role':'agent'},'attributes':['id',_0x5443('0x3a'),_0x5443('0x70'),'email',_0x5443('0x71')],'raw':!![]});}return null;})[_0x5443('0x37')](function(_0x25f24a){if(!_0x25f24a)return null;_0x3228a0[_0x5443('0x28')][_0x5443('0x72')]=_0x25f24a;return _0x3228a0;})[_0x5443('0x37')](function(_0x28da79){if(_0x28da79){if(_0x243ed7[_0x5443('0x5a')][_0x5443('0x73')]){_0x3228a0['message'][_0x5443('0x74')]=util[_0x5443('0x61')](_0x5443('0x75'),_0x243ed7[_0x5443('0x63')][_0x5443('0x3a')]);_0x3228a0['message'][_0x5443('0x76')]=_0x3228a0['channel'];_0x3228a0['message'][_0x5443('0x77')]=_0x3228a0[_0x5443('0x76')];_0x3228a0['message']['event']=_0x5443('0x5d');return respondWithRpcPromise(_0x5443('0x78'),_0x5443('0x78'),{'event':_0x5443('0x79'),'message':_0x3228a0['message']},client9002)[_0x5443('0x37')](function(){return _0x3228a0;});}return _0x3228a0;}return null;})['then'](respondWithResult(_0x2261ce,null))[_0x5443('0x29')](handleError(_0x2261ce,null));};var interaction_log=require(_0x5443('0x7a'))(_0x5443('0x5c'));exports[_0x5443('0x34')]=function(_0x11d067,_0xb7601,_0x4d7ebc){var _0x52fc93={'agent':{},'channel':_0x5443('0x5e')};if(_0x11d067[_0x5443('0x5a')]['id']){delete _0x11d067[_0x5443('0x5a')]['id'];}_0x11d067[_0x5443('0x5a')]['UserId']=_0x11d067['body'][_0x5443('0x62')]||_0x11d067['user']['id'];_0x52fc93[_0x5443('0x72')]['id']=_0x11d067[_0x5443('0x5a')][_0x5443('0x62')];return db['OpenchannelMessage'][_0x5443('0x58')]({'where':{'id':_0x11d067[_0x5443('0x56')]['id'],'UserId':null}})[_0x5443('0x37')](handleEntityNotFound(_0xb7601,null))[_0x5443('0x37')](function(_0x44353f){if(_0x44353f){_0x52fc93[_0x5443('0x28')]=_0x44353f[_0x5443('0x64')]({'plain':!![]});return db[_0x5443('0x65')][_0x5443('0x58')]({'where':{'id':_0x44353f[_0x5443('0x66')]}});}return null;})['then'](handleEntityNotFound(_0xb7601,null))[_0x5443('0x37')](function(_0x396ce1){if(_0x396ce1){_0x52fc93[_0x5443('0x69')]=_0x396ce1['get']({'plain':!![]});interaction_log[_0x5443('0x21')](_0x5443('0x7b'),_0x11d067[_0x5443('0x63')]['id'],_0x11d067[_0x5443('0x63')]['name'],_0x11d067[_0x5443('0x63')][_0x5443('0x7c')],_0x52fc93[_0x5443('0x69')]['id'],_0x11d067[_0x5443('0x5a')]?JSON['stringify'](_0x11d067[_0x5443('0x5a')]):_0x5443('0x7d'));return respondWithRpcPromise(_0x5443('0x7e'),_0x5443('0x7f'),_0x52fc93);}return null;})[_0x5443('0x37')](function(_0x3108e9){var _0x435961=_0x5443('0x6c')+_0x3108e9['message'][_0x5443('0x80')];return db[_0x5443('0x6d')][_0x5443('0x43')](_0x435961,{'type':db['Sequelize'][_0x5443('0x81')][_0x5443('0x82')],'raw':!![]})[_0x5443('0x37')](function(_0x105880){return _0x105880;});})[_0x5443('0x37')](function(_0x3c0fc2){if(_0x3c0fc2){_0x52fc93[_0x5443('0x28')][_0x5443('0x83')]=_0x3c0fc2[0x0];if(!_0x11d067['body']['UserId'])return;return db['User']['find']({'where':{'id':_0x11d067['body'][_0x5443('0x62')],'role':_0x5443('0x72')},'attributes':['id',_0x5443('0x3a'),_0x5443('0x70'),'email',_0x5443('0x71')],'raw':!![]});}return null;})['then'](function(_0xc092e4){if(!_0xc092e4)return null;_0x52fc93[_0x5443('0x28')]['agent']=_0xc092e4;return _0x52fc93;})[_0x5443('0x37')](function(_0x1aea58){if(_0x1aea58){_0x1aea58[_0x5443('0x28')][_0x5443('0x74')]=util[_0x5443('0x61')]('SIP/%s',_0x11d067[_0x5443('0x63')]['name']);_0x1aea58[_0x5443('0x28')][_0x5443('0x76')]=_0x52fc93['channel'];_0x1aea58['message']['motionChannel']=_0x52fc93[_0x5443('0x76')];_0x1aea58[_0x5443('0x28')][_0x5443('0x84')]=_0x5443('0x34');respondWithRpcPromise(_0x5443('0x78'),_0x5443('0x78'),{'event':_0x5443('0x85'),'message':_0x1aea58[_0x5443('0x28')]},client9002);return _0x52fc93;}return null;})[_0x5443('0x37')](respondWithResult(_0xb7601,null))[_0x5443('0x29')](handleError(_0xb7601,null));}; \ No newline at end of file +var _0x53eb=['nolimit','order','sort','filter','where','merge','VIRTUAL','OpenchannelMessage','includeAll','findAll','rows','show','include','options','find','create','body','params','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','OpenchannelInteraction','OpenchannelInteractionId','read1stAt','user','interaction','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','reject','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','SELECT','motionChannel','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','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','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','OpenchannelMessage,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','length'];(function(_0x5b45cd,_0x2c84f4){var _0x49a830=function(_0x614c40){while(--_0x614c40){_0x5b45cd['push'](_0x5b45cd['shift']());}};_0x49a830(++_0x2c84f4);}(_0x53eb,0x14b));var _0xb53e=function(_0x150949,_0x6fdad2){_0x150949=_0x150949-0x0;var _0x235e29=_0x53eb[_0x150949];return _0x235e29;};'use strict';var emlformat=require(_0xb53e('0x0'));var rimraf=require(_0xb53e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb53e('0x2'));var rp=require(_0xb53e('0x3'));var moment=require(_0xb53e('0x4'));var BPromise=require(_0xb53e('0x5'));var Mustache=require(_0xb53e('0x6'));var util=require(_0xb53e('0x7'));var path=require(_0xb53e('0x8'));var sox=require(_0xb53e('0x9'));var csv=require(_0xb53e('0xa'));var ejs=require(_0xb53e('0xb'));var fs=require('fs');var fs_extra=require(_0xb53e('0xc'));var _=require(_0xb53e('0xd'));var squel=require(_0xb53e('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb53e('0xa'));var querystring=require(_0xb53e('0xf'));var Papa=require('papaparse');var Redis=require(_0xb53e('0x10'));var authService=require(_0xb53e('0x11'));var qs=require(_0xb53e('0x12'));var as=require(_0xb53e('0x13'));var hardwareService=require(_0xb53e('0x14'));var logger=require(_0xb53e('0x15'))(_0xb53e('0x16'));var utils=require(_0xb53e('0x17'));var config=require(_0xb53e('0x18'));var licenseUtil=require(_0xb53e('0x19'));var db=require(_0xb53e('0x1a'))['db'];config['redis']=_[_0xb53e('0x1b')](config[_0xb53e('0x1c')],{'host':_0xb53e('0x1d'),'port':0x18eb});var socket=require(_0xb53e('0x1e'))(new Redis(config[_0xb53e('0x1c')]));require(_0xb53e('0x1f'))[_0xb53e('0x20')](socket);var jayson=require(_0xb53e('0x21'));var client=jayson[_0xb53e('0x22')]['http']({'port':0x232c});var client9002=jayson[_0xb53e('0x22')][_0xb53e('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x5ac534,_0x1db3ac,_0x26785a,_0x3350cf){return new BPromise(function(_0x295620,_0x59bf4e){var _0x2830aa=_0x3350cf||client;return _0x2830aa[_0xb53e('0x24')](_0x5ac534,_0x26785a)[_0xb53e('0x25')](function(_0x2abf6f){logger[_0xb53e('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x1db3ac,'request\x20sent');logger[_0xb53e('0x27')](_0xb53e('0x28'),_0x1db3ac,_0xb53e('0x29'),JSON[_0xb53e('0x2a')](_0x2abf6f));if(_0x2abf6f[_0xb53e('0x2b')]){if(_0x2abf6f['error']['code']===0x1f4){logger[_0xb53e('0x2b')](_0xb53e('0x2c'),_0x1db3ac,_0x2abf6f[_0xb53e('0x2b')][_0xb53e('0x2d')]);return _0x59bf4e(_0x2abf6f[_0xb53e('0x2b')][_0xb53e('0x2d')]);}logger[_0xb53e('0x2b')]('OpenchannelMessage,\x20%s,\x20%s',_0x1db3ac,_0x2abf6f[_0xb53e('0x2b')][_0xb53e('0x2d')]);return _0x295620(_0x2abf6f['error'][_0xb53e('0x2d')]);}else{logger['info'](_0xb53e('0x2c'),_0x1db3ac,'request\x20sent');_0x295620(_0x2abf6f['result'][_0xb53e('0x2d')]);}})[_0xb53e('0x2e')](function(_0x5e3347){logger[_0xb53e('0x2b')](_0xb53e('0x2c'),_0x1db3ac,_0x5e3347);_0x59bf4e(_0x5e3347);});});}function respondWithStatusCode(_0x17e274,_0x5924c4){_0x5924c4=_0x5924c4||0xcc;return function(_0x22e5c4){if(_0x22e5c4){return _0x17e274[_0xb53e('0x2f')](_0x5924c4);}return _0x17e274[_0xb53e('0x30')](_0x5924c4)[_0xb53e('0x31')]();};}function respondWithResult(_0x50e35d,_0x55c066){_0x55c066=_0x55c066||0xc8;return function(_0xaa6a20){if(_0xaa6a20){return _0x50e35d['status'](_0x55c066)[_0xb53e('0x32')](_0xaa6a20);}};}function respondWithFilteredResult(_0x79fc3e,_0x5282de){return function(_0x26ac09){if(_0x26ac09){var _0x58317c=typeof _0x5282de['offset']===_0xb53e('0x33')&&typeof _0x5282de[_0xb53e('0x34')]===_0xb53e('0x33');var _0x39f3b4=_0x26ac09[_0xb53e('0x35')];var _0x1c9224=_0x58317c?0x0:_0x5282de[_0xb53e('0x36')];var _0x3ea349=_0x58317c?_0x26ac09[_0xb53e('0x35')]:_0x5282de[_0xb53e('0x36')]+_0x5282de[_0xb53e('0x34')];var _0x543ef2;if(_0x3ea349>=_0x39f3b4){_0x3ea349=_0x39f3b4;_0x543ef2=0xc8;}else{_0x543ef2=0xce;}_0x79fc3e[_0xb53e('0x30')](_0x543ef2);return _0x79fc3e[_0xb53e('0x37')](_0xb53e('0x38'),_0x1c9224+'-'+_0x3ea349+'/'+_0x39f3b4)[_0xb53e('0x32')](_0x26ac09);}return null;};}function patchUpdates(_0x423048){return function(_0x2c9f5f){try{jsonpatch[_0xb53e('0x39')](_0x2c9f5f,_0x423048,!![]);}catch(_0x44e16d){return BPromise['reject'](_0x44e16d);}return _0x2c9f5f[_0xb53e('0x3a')]();};}function saveUpdates(_0x5a4041,_0x4c1720){return function(_0x533b74){if(_0x533b74){return _0x533b74[_0xb53e('0x3b')](_0x5a4041)[_0xb53e('0x25')](function(_0x1faf3a){return _0x1faf3a;});}return null;};}function removeEntity(_0x48645c,_0x3f4f46){return function(_0x3c9752){if(_0x3c9752){return _0x3c9752['destroy']()[_0xb53e('0x25')](function(){_0x48645c[_0xb53e('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bdc7e,_0x17c532){return function(_0x225c63){if(!_0x225c63){_0x5bdc7e[_0xb53e('0x2f')](0x194);}return _0x225c63;};}function handleError(_0x55c79c,_0x46983a){_0x46983a=_0x46983a||0x1f4;return function(_0x191dc2){logger[_0xb53e('0x2b')](_0x191dc2[_0xb53e('0x3c')]);if(_0x191dc2[_0xb53e('0x3d')]){delete _0x191dc2['name'];}_0x55c79c[_0xb53e('0x30')](_0x46983a)[_0xb53e('0x3e')](_0x191dc2);};}exports[_0xb53e('0x3f')]=function(_0x3d996e,_0xbd1a7c){var _0x3cf0a2={},_0x338ca6={},_0x11b27d={'count':0x0,'rows':[]};var _0x23ca29=_['map'](db['OpenchannelMessage'][_0xb53e('0x40')],function(_0x2cca60){return{'name':_0x2cca60[_0xb53e('0x41')],'type':_0x2cca60[_0xb53e('0x42')][_0xb53e('0x43')]};});_0x338ca6['model']=_[_0xb53e('0x44')](_0x23ca29,_0xb53e('0x3d'));_0x338ca6[_0xb53e('0x45')]=_[_0xb53e('0x46')](_0x3d996e[_0xb53e('0x45')]);_0x338ca6[_0xb53e('0x47')]=_[_0xb53e('0x48')](_0x338ca6['model'],_0x338ca6[_0xb53e('0x45')]);_0x3cf0a2[_0xb53e('0x49')]=_['intersection'](_0x338ca6[_0xb53e('0x4a')],qs[_0xb53e('0x4b')](_0x3d996e[_0xb53e('0x45')][_0xb53e('0x4b')]));_0x3cf0a2[_0xb53e('0x49')]=_0x3cf0a2[_0xb53e('0x49')][_0xb53e('0x4c')]?_0x3cf0a2[_0xb53e('0x49')]:_0x338ca6[_0xb53e('0x4a')];if(!_0x3d996e[_0xb53e('0x45')]['hasOwnProperty'](_0xb53e('0x4d'))){_0x3cf0a2['limit']=qs[_0xb53e('0x34')](_0x3d996e['query'][_0xb53e('0x34')]);_0x3cf0a2['offset']=qs[_0xb53e('0x36')](_0x3d996e[_0xb53e('0x45')][_0xb53e('0x36')]);}_0x3cf0a2[_0xb53e('0x4e')]=qs[_0xb53e('0x4f')](_0x3d996e[_0xb53e('0x45')]['sort']);_0x3cf0a2['where']=qs[_0xb53e('0x47')](_['pick'](_0x3d996e[_0xb53e('0x45')],_0x338ca6[_0xb53e('0x47')]),_0x23ca29);if(_0x3d996e[_0xb53e('0x45')][_0xb53e('0x50')]){_0x3cf0a2[_0xb53e('0x51')]=_[_0xb53e('0x52')](_0x3cf0a2[_0xb53e('0x51')],{'$or':_['map'](_0x23ca29,function(_0x58be8a){if(_0x58be8a['type']!==_0xb53e('0x53')){var _0x5bb3bd={};_0x5bb3bd[_0x58be8a['name']]={'$like':'%'+_0x3d996e[_0xb53e('0x45')]['filter']+'%'};return _0x5bb3bd;}})});}_0x3cf0a2=_[_0xb53e('0x52')]({},_0x3cf0a2,_0x3d996e['options']);var _0x16e192={'where':_0x3cf0a2[_0xb53e('0x51')]};return db[_0xb53e('0x54')]['count'](_0x16e192)[_0xb53e('0x25')](function(_0x22bc5f){_0x11b27d[_0xb53e('0x35')]=_0x22bc5f;if(_0x3d996e[_0xb53e('0x45')][_0xb53e('0x55')]){_0x3cf0a2['include']=[{'all':!![]}];}return db[_0xb53e('0x54')][_0xb53e('0x56')](_0x3cf0a2);})[_0xb53e('0x25')](function(_0x1f6295){_0x11b27d[_0xb53e('0x57')]=_0x1f6295;return _0x11b27d;})[_0xb53e('0x25')](respondWithFilteredResult(_0xbd1a7c,_0x3cf0a2))[_0xb53e('0x2e')](handleError(_0xbd1a7c,null));};exports[_0xb53e('0x58')]=function(_0x3edee8,_0x198d9a){var _0x12ed5b={'raw':!![],'where':{'id':_0x3edee8['params']['id']}},_0x542bc3={};_0x542bc3['model']=_[_0xb53e('0x46')](db[_0xb53e('0x54')][_0xb53e('0x40')]);_0x542bc3['query']=_[_0xb53e('0x46')](_0x3edee8[_0xb53e('0x45')]);_0x542bc3['filters']=_[_0xb53e('0x48')](_0x542bc3[_0xb53e('0x4a')],_0x542bc3['query']);_0x12ed5b[_0xb53e('0x49')]=_[_0xb53e('0x48')](_0x542bc3['model'],qs[_0xb53e('0x4b')](_0x3edee8[_0xb53e('0x45')][_0xb53e('0x4b')]));_0x12ed5b[_0xb53e('0x49')]=_0x12ed5b[_0xb53e('0x49')][_0xb53e('0x4c')]?_0x12ed5b['attributes']:_0x542bc3[_0xb53e('0x4a')];if(_0x3edee8[_0xb53e('0x45')]['includeAll']){_0x12ed5b[_0xb53e('0x59')]=[{'all':!![]}];}_0x12ed5b=_['merge']({},_0x12ed5b,_0x3edee8[_0xb53e('0x5a')]);return db[_0xb53e('0x54')][_0xb53e('0x5b')](_0x12ed5b)[_0xb53e('0x25')](handleEntityNotFound(_0x198d9a,null))[_0xb53e('0x25')](respondWithResult(_0x198d9a,null))[_0xb53e('0x2e')](handleError(_0x198d9a,null));};exports['create']=function(_0x258ac6,_0x538784){return db['OpenchannelMessage'][_0xb53e('0x5c')](_0x258ac6[_0xb53e('0x5d')],{})[_0xb53e('0x25')](respondWithResult(_0x538784,0xc9))['catch'](handleError(_0x538784,null));};exports[_0xb53e('0x3b')]=function(_0x33a5dd,_0x25c233){if(_0x33a5dd['body']['id']){delete _0x33a5dd[_0xb53e('0x5d')]['id'];}return db[_0xb53e('0x54')][_0xb53e('0x5b')]({'where':{'id':_0x33a5dd[_0xb53e('0x5e')]['id']}})['then'](handleEntityNotFound(_0x25c233,null))[_0xb53e('0x25')](saveUpdates(_0x33a5dd['body'],null))[_0xb53e('0x25')](respondWithResult(_0x25c233,null))['catch'](handleError(_0x25c233,null));};exports['destroy']=function(_0x1fe108,_0x5091b7){return db[_0xb53e('0x54')]['find']({'where':{'id':_0x1fe108['params']['id']}})[_0xb53e('0x25')](handleEntityNotFound(_0x5091b7,null))['then'](removeEntity(_0x5091b7,null))[_0xb53e('0x2e')](handleError(_0x5091b7,null));};exports[_0xb53e('0x5f')]=function(_0x58e7b4,_0x3f151b){return db[_0xb53e('0x54')][_0xb53e('0x5f')]()[_0xb53e('0x25')](respondWithResult(_0x3f151b,null))['catch'](handleError(_0x3f151b,null));};var interaction_log=require('../../config/logger')(_0xb53e('0x60'));exports[_0xb53e('0x61')]=function(_0x268807,_0x15ce5b,_0x45adb4){var _0x1db76b={'agent':{},'channel':_0xb53e('0x62')};if(_0x268807[_0xb53e('0x5d')]['id']){delete _0x268807['body']['id'];}_0x268807['body'][_0xb53e('0x63')]=!![];_0x268807['body'][_0xb53e('0x64')]=moment()[_0xb53e('0x65')](_0xb53e('0x66'));_0x268807[_0xb53e('0x5d')][_0xb53e('0x67')]=_0x268807[_0xb53e('0x5d')][_0xb53e('0x67')]||_0x268807['user']['id'];_0x1db76b['agent']['id']=_0x268807[_0xb53e('0x5d')]['UserId'];return db['OpenchannelMessage'][_0xb53e('0x5b')]({'where':{'id':_0x268807['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x15ce5b,null))[_0xb53e('0x25')](saveUpdates(_0x268807[_0xb53e('0x5d')],null))['then'](function(_0x47a4f0){if(_0x47a4f0){_0x1db76b[_0xb53e('0x2d')]=_0x47a4f0[_0xb53e('0x68')]({'plain':!![]});return db[_0xb53e('0x69')]['find']({'where':{'id':_0x47a4f0[_0xb53e('0x6a')]}});}return null;})[_0xb53e('0x25')](handleEntityNotFound(_0x15ce5b,null))[_0xb53e('0x25')](function(_0x10cc44){if(_0x10cc44){return _0x10cc44[_0xb53e('0x3b')]({'UserId':_0x268807[_0xb53e('0x5d')][_0xb53e('0x67')],'read1stAt':_['isNil'](_0x10cc44[_0xb53e('0x6b')])?moment()['format'](_0xb53e('0x66')):undefined});}return null;})[_0xb53e('0x25')](function(_0x23315f){if(_0x23315f){_0x1db76b['interaction']=_0x23315f[_0xb53e('0x68')]({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x268807[_0xb53e('0x6c')]['id'],_0x268807[_0xb53e('0x6c')][_0xb53e('0x3d')],_0x268807['user']['role'],_0x1db76b[_0xb53e('0x6d')]['id'],_0x268807[_0xb53e('0x5d')]?JSON['stringify'](_0x268807[_0xb53e('0x5d')]):_0xb53e('0x6e'));return respondWithRpcPromise(_0xb53e('0x6f'),'acceptMessage',_0x1db76b);}return null;})['then'](function(_0x302b5b){var _0x494369=_0xb53e('0x70')+_0x302b5b['message'][_0xb53e('0x71')];return db[_0xb53e('0x72')][_0xb53e('0x45')](_0x494369,{'type':db[_0xb53e('0x73')][_0xb53e('0x74')]['SELECT'],'raw':!![]})[_0xb53e('0x25')](function(_0x2c3b16){return _0x2c3b16;});})[_0xb53e('0x25')](function(_0x19eb82){if(_0x19eb82){_0x1db76b[_0xb53e('0x2d')][_0xb53e('0x75')]=_0x19eb82[0x0];if(!_0x268807[_0xb53e('0x5d')][_0xb53e('0x67')])return;return db[_0xb53e('0x76')]['find']({'where':{'id':_0x268807[_0xb53e('0x5d')][_0xb53e('0x67')],'role':_0xb53e('0x77')},'attributes':['id',_0xb53e('0x3d'),_0xb53e('0x78'),_0xb53e('0x79'),_0xb53e('0x7a')],'raw':!![]});}return null;})[_0xb53e('0x25')](function(_0x41123b){if(!_0x41123b)return null;_0x1db76b[_0xb53e('0x2d')][_0xb53e('0x77')]=_0x41123b;return _0x1db76b;})['then'](function(_0x397b56){if(_0x397b56){if(_0x268807[_0xb53e('0x5d')][_0xb53e('0x7b')]){_0x1db76b[_0xb53e('0x2d')][_0xb53e('0x7c')]=util['format'](_0xb53e('0x7d'),_0x268807[_0xb53e('0x6c')][_0xb53e('0x3d')]);_0x1db76b['message'][_0xb53e('0x7e')]=_0x1db76b[_0xb53e('0x7e')];_0x1db76b[_0xb53e('0x2d')]['motionChannel']=_0x1db76b[_0xb53e('0x7e')];_0x1db76b[_0xb53e('0x2d')][_0xb53e('0x7f')]='accept';return respondWithRpcPromise(_0xb53e('0x80'),_0xb53e('0x80'),{'event':_0xb53e('0x81'),'message':_0x1db76b[_0xb53e('0x2d')]},client9002)[_0xb53e('0x25')](function(){return _0x1db76b;});}return _0x1db76b;}return null;})['then'](respondWithResult(_0x15ce5b,null))['catch'](handleError(_0x15ce5b,null));};var interaction_log=require('../../config/logger')(_0xb53e('0x60'));exports[_0xb53e('0x82')]=function(_0x5baaff,_0x9516d2,_0x550832){var _0x5e8e76={'agent':{},'channel':_0xb53e('0x62')};if(_0x5baaff[_0xb53e('0x5d')]['id']){delete _0x5baaff['body']['id'];}_0x5baaff[_0xb53e('0x5d')][_0xb53e('0x67')]=_0x5baaff[_0xb53e('0x5d')][_0xb53e('0x67')]||_0x5baaff[_0xb53e('0x6c')]['id'];_0x5e8e76[_0xb53e('0x77')]['id']=_0x5baaff[_0xb53e('0x5d')][_0xb53e('0x67')];return db[_0xb53e('0x54')][_0xb53e('0x5b')]({'where':{'id':_0x5baaff[_0xb53e('0x5e')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x9516d2,null))['then'](function(_0xf60962){if(_0xf60962){_0x5e8e76[_0xb53e('0x2d')]=_0xf60962[_0xb53e('0x68')]({'plain':!![]});return db['OpenchannelInteraction'][_0xb53e('0x5b')]({'where':{'id':_0xf60962[_0xb53e('0x6a')]}});}return null;})[_0xb53e('0x25')](handleEntityNotFound(_0x9516d2,null))[_0xb53e('0x25')](function(_0x504c41){if(_0x504c41){_0x5e8e76[_0xb53e('0x6d')]=_0x504c41[_0xb53e('0x68')]({'plain':!![]});interaction_log[_0xb53e('0x26')](_0xb53e('0x83'),_0x5baaff['user']['id'],_0x5baaff[_0xb53e('0x6c')][_0xb53e('0x3d')],_0x5baaff['user'][_0xb53e('0x84')],_0x5e8e76[_0xb53e('0x6d')]['id'],_0x5baaff[_0xb53e('0x5d')]?JSON[_0xb53e('0x2a')](_0x5baaff[_0xb53e('0x5d')]):_0xb53e('0x6e'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x5e8e76);}return null;})[_0xb53e('0x25')](function(_0x5a7ab6){var _0x3c8e04=_0xb53e('0x70')+_0x5a7ab6['message'][_0xb53e('0x71')];return db['sequelize'][_0xb53e('0x45')](_0x3c8e04,{'type':db[_0xb53e('0x73')]['QueryTypes'][_0xb53e('0x85')],'raw':!![]})[_0xb53e('0x25')](function(_0x4e33d6){return _0x4e33d6;});})[_0xb53e('0x25')](function(_0x2ff3da){if(_0x2ff3da){_0x5e8e76['message'][_0xb53e('0x75')]=_0x2ff3da[0x0];if(!_0x5baaff[_0xb53e('0x5d')]['UserId'])return;return db[_0xb53e('0x76')][_0xb53e('0x5b')]({'where':{'id':_0x5baaff[_0xb53e('0x5d')]['UserId'],'role':_0xb53e('0x77')},'attributes':['id',_0xb53e('0x3d'),'fullname',_0xb53e('0x79'),_0xb53e('0x7a')],'raw':!![]});}return null;})['then'](function(_0x5e4d28){if(!_0x5e4d28)return null;_0x5e8e76[_0xb53e('0x2d')][_0xb53e('0x77')]=_0x5e4d28;return _0x5e8e76;})[_0xb53e('0x25')](function(_0x62f2c3){if(_0x62f2c3){_0x62f2c3[_0xb53e('0x2d')][_0xb53e('0x7c')]=util[_0xb53e('0x65')](_0xb53e('0x7d'),_0x5baaff[_0xb53e('0x6c')][_0xb53e('0x3d')]);_0x62f2c3['message'][_0xb53e('0x7e')]=_0x5e8e76[_0xb53e('0x7e')];_0x62f2c3[_0xb53e('0x2d')][_0xb53e('0x86')]=_0x5e8e76[_0xb53e('0x7e')];_0x62f2c3['message'][_0xb53e('0x7f')]='reject';respondWithRpcPromise(_0xb53e('0x80'),_0xb53e('0x80'),{'event':_0xb53e('0x87'),'message':_0x62f2c3[_0xb53e('0x2d')]},client9002);return _0x5e8e76;}return null;})[_0xb53e('0x25')](respondWithResult(_0x9516d2,null))[_0xb53e('0x2e')](handleError(_0x9516d2,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 76d7972..c05d19c 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 _0xd575=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners'];(function(_0x30c9f6,_0x5aba29){var _0x4a5738=function(_0x3ea210){while(--_0x3ea210){_0x30c9f6['push'](_0x30c9f6['shift']());}};_0x4a5738(++_0x5aba29);}(_0xd575,0xac));var _0x5d57=function(_0x3d6f5f,_0x1551d8){_0x3d6f5f=_0x3d6f5f-0x0;var _0x30efb0=_0xd575[_0x3d6f5f];return _0x30efb0;};'use strict';var EventEmitter=require(_0x5d57('0x0'));var OpenchannelMessage=require(_0x5d57('0x1'))['db'][_0x5d57('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x5d57('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x5d57('0x4')};function emitEvent(_0x42f790){return function(_0x126f0f,_0x3bc371,_0x176bb8){OpenchannelMessageEvents[_0x5d57('0x5')](_0x42f790+':'+_0x126f0f['id'],_0x126f0f);OpenchannelMessageEvents['emit'](_0x42f790,_0x126f0f);_0x176bb8(null);};}for(var e in events){if(events[_0x5d57('0x6')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x5d57('0x7')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x3ad5=['setMaxListeners','save','update','emit','events','OpenchannelMessage'];(function(_0x235636,_0x432467){var _0x48c727=function(_0x3b57de){while(--_0x3b57de){_0x235636['push'](_0x235636['shift']());}};_0x48c727(++_0x432467);}(_0x3ad5,0x130));var _0x53ad=function(_0x3b91c2,_0x100920){_0x3b91c2=_0x3b91c2-0x0;var _0x49ef2f=_0x3ad5[_0x3b91c2];return _0x49ef2f;};'use strict';var EventEmitter=require(_0x53ad('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x53ad('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x53ad('0x2')](0x0);var events={'afterCreate':_0x53ad('0x3'),'afterUpdate':_0x53ad('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1ca27c){return function(_0x53c5f6,_0x5f28c3,_0x2b23fe){OpenchannelMessageEvents[_0x53ad('0x5')](_0x1ca27c+':'+_0x53c5f6['id'],_0x53c5f6);OpenchannelMessageEvents[_0x53ad('0x5')](_0x1ca27c,_0x53c5f6);_0x2b23fe(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 4543e85..bae7de9 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 _0xf4f4=['Interactions','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','omit','POST','method','Message\x20%d\x20forwarded\x20to\x20%s','Interaction','threadId','error','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','OpenchannelInteractionId','update','createdAt','catch','CmContact','describe','then','OpenchannelAccount','find','OpenchannelAccountId'];(function(_0x10b9ce,_0x16bcaf){var _0x484203=function(_0x3a393c){while(--_0x3a393c){_0x10b9ce['push'](_0x10b9ce['shift']());}};_0x484203(++_0x16bcaf);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x266815,_0x30df52){_0x266815=_0x266815-0x0;var _0x46e321=_0xf4f4[_0x266815];return _0x46e321;};'use strict';var _=require(_0x4f4f('0x0'));var util=require(_0x4f4f('0x1'));var logger=require('../../config/logger')(_0x4f4f('0x2'));var moment=require(_0x4f4f('0x3'));var BPromise=require(_0x4f4f('0x4'));var rp=require(_0x4f4f('0x5'));var fs=require('fs');var path=require(_0x4f4f('0x6'));var rimraf=require('rimraf');var config=require(_0x4f4f('0x7'));var attributes=require('./openchannelMessage.attributes');module[_0x4f4f('0x8')]=function(_0x132d5c,_0x20ee6e){return _0x132d5c[_0x4f4f('0x9')](_0x4f4f('0xa'),attributes,{'tableName':_0x4f4f('0xb'),'paranoid':![],'indexes':[{'name':_0x4f4f('0xc'),'fields':[_0x4f4f('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0xc066a4,_0x38d110,_0x39e36b){var _0x2d86d1=_0x132d5c[_0x4f4f('0xe')];var _0x11940f=_0xc066a4[_0x4f4f('0xf')]({'plain':!![]});if(_0x11940f[_0x4f4f('0x10')]['toLowerCase']()==='in'||_0x11940f['direction'][_0x4f4f('0x11')]()===_0x4f4f('0x12')&&!_0x11940f[_0x4f4f('0x13')]&&!_[_0x4f4f('0x14')](_0x11940f[_0x4f4f('0x15')])){_0x2d86d1[_0x4f4f('0x16')]['findOne']({'where':{'id':_0x11940f[_0x4f4f('0x17')]}})['then'](function(_0x216ba8){if(_0x216ba8){_0x216ba8[_0x4f4f('0x18')]({'lastMsgAt':_0x11940f[_0x4f4f('0x19')],'lastMsgDirection':_0x11940f[_0x4f4f('0x10')]['toLowerCase']()});}})[_0x4f4f('0x1a')](function(_0x4c68f4){console['error'](_0x4c68f4);});}if(_0x11940f['direction']===_0x4f4f('0x12')&&!_0x11940f[_0x4f4f('0x13')]){var _0x2d21ed;_0x2d86d1[_0x4f4f('0x1b')][_0x4f4f('0x1c')]()[_0x4f4f('0x1d')](function(_0x1245c4){return _0x2d86d1[_0x4f4f('0x1e')][_0x4f4f('0x1f')]({'where':{'id':_0x11940f[_0x4f4f('0x20')]},'include':[{'model':_0x2d86d1[_0x4f4f('0x16')],'as':_0x4f4f('0x21'),'where':{'id':_0x11940f['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x2d86d1[_0x4f4f('0x1b')],'as':_0x4f4f('0x22'),'attributes':_[_0x4f4f('0x23')](_0x1245c4)}]}]});})[_0x4f4f('0x1d')](function(_0x302a79){_0x2d21ed=_0x302a79[_0x4f4f('0xf')]({'plain':!![]});if(_0x2d21ed&&_0x2d21ed[_0x4f4f('0x24')]){logger[_0x4f4f('0x25')](_0x4f4f('0x26'),_0x4f4f('0x27'),util[_0x4f4f('0x28')](_0x4f4f('0x29'),_0x11940f['id'],_0x2d21ed[_0x4f4f('0x24')]));if(_0x2d21ed[_0x4f4f('0x21')]&&_0x2d21ed['Interactions']['length']){_0x11940f['Interaction']=_[_0x4f4f('0x2a')](_0x2d21ed[_0x4f4f('0x21')][0x0],'Contact');_0x11940f[_0x4f4f('0x22')]=_0x2d21ed[_0x4f4f('0x21')][0x0][_0x4f4f('0x22')];}var _0x38d110={'method':_0x4f4f('0x2b'),'uri':encodeURI(_0x2d21ed[_0x4f4f('0x24')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x38d110[_0x4f4f('0x2c')]){case'GET':_0x38d110['qs']=_0x11940f;break;case _0x4f4f('0x2b'):_0x38d110[_0x4f4f('0xd')]=_0x11940f;break;}return rp(_0x38d110)[_0x4f4f('0x1d')](function(_0x15c79c){logger[_0x4f4f('0x25')]('OpenchannelMessage,\x20%s,\x20%s',_0x4f4f('0x27'),util[_0x4f4f('0x28')](_0x4f4f('0x2d'),_0x11940f['id'],_0x2d21ed['replyUri']));if(_0x15c79c['body']['threadId']&&_0x15c79c[_0x4f4f('0xd')]['threadId']!=_0x11940f[_0x4f4f('0x2e')][_0x4f4f('0x2f')]){return _0x2d86d1[_0x4f4f('0x16')]['update']({'threadId':_0x15c79c[_0x4f4f('0xd')][_0x4f4f('0x2f')]},{'logging':!![],'where':{'id':_0x11940f['Interaction']['id']}});}else{return;}})[_0x4f4f('0x1d')](function(){return _0xc066a4[_0x4f4f('0x18')]({'read':!![]});})[_0x4f4f('0x1a')](function(_0x5b937e){logger[_0x4f4f('0x30')](_0x4f4f('0x26'),'afterCreate',util['inspect'](_0x5b937e,{'showHidden':![],'depth':null}));_0x39e36b();});}else{_0x39e36b();}})[_0x4f4f('0x31')](function(){_0x39e36b();});}else{_0x39e36b();}}},'charset':_0x4f4f('0x32'),'collate':_0x4f4f('0x33')});}; \ No newline at end of file +var _0x8603=['secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','out','CmContact','describe','OpenchannelAccountId','Interactions','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','Interaction','omit','method','body','threadId','inspect','finally','utf8mb4_unicode_ci','util','../../config/logger','api','request-promise','path','rimraf','./openchannelMessage.attributes','define','OpenchannelMessage','openchannel_messages','models','get','direction','toLowerCase'];(function(_0x5c6c01,_0x478a31){var _0x59860e=function(_0x4d308f){while(--_0x4d308f){_0x5c6c01['push'](_0x5c6c01['shift']());}};_0x59860e(++_0x478a31);}(_0x8603,0x190));var _0x3860=function(_0x15bcf8,_0x38b21d){_0x15bcf8=_0x15bcf8-0x0;var _0xc6c79c=_0x8603[_0x15bcf8];return _0xc6c79c;};'use strict';var _=require('lodash');var util=require(_0x3860('0x0'));var logger=require(_0x3860('0x1'))(_0x3860('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3860('0x3'));var fs=require('fs');var path=require(_0x3860('0x4'));var rimraf=require(_0x3860('0x5'));var config=require('../../config/environment');var attributes=require(_0x3860('0x6'));module['exports']=function(_0xb0fc24,_0x40739b){return _0xb0fc24[_0x3860('0x7')](_0x3860('0x8'),attributes,{'tableName':_0x3860('0x9'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1ad015,_0x441dc4,_0x52c277){var _0x2fb169=_0xb0fc24[_0x3860('0xa')];var _0x5909b8=_0x1ad015[_0x3860('0xb')]({'plain':!![]});if(_0x5909b8[_0x3860('0xc')]['toLowerCase']()==='in'||_0x5909b8[_0x3860('0xc')][_0x3860('0xd')]()==='out'&&!_0x5909b8[_0x3860('0xe')]&&!_[_0x3860('0xf')](_0x5909b8[_0x3860('0x10')])){_0x2fb169[_0x3860('0x11')][_0x3860('0x12')]({'where':{'id':_0x5909b8[_0x3860('0x13')]}})[_0x3860('0x14')](function(_0x12b23b){if(_0x12b23b){_0x12b23b[_0x3860('0x15')]({'lastMsgAt':_0x5909b8[_0x3860('0x16')],'lastMsgDirection':_0x5909b8['direction'][_0x3860('0xd')]()});}})[_0x3860('0x17')](function(_0x122e40){console[_0x3860('0x18')](_0x122e40);});}if(_0x5909b8[_0x3860('0xc')]===_0x3860('0x19')&&!_0x5909b8[_0x3860('0xe')]){var _0x378305;_0x2fb169[_0x3860('0x1a')][_0x3860('0x1b')]()[_0x3860('0x14')](function(_0x45b799){return _0x2fb169['OpenchannelAccount']['find']({'where':{'id':_0x5909b8[_0x3860('0x1c')]},'include':[{'model':_0x2fb169[_0x3860('0x11')],'as':_0x3860('0x1d'),'where':{'id':_0x5909b8['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x2fb169[_0x3860('0x1a')],'as':_0x3860('0x1e'),'attributes':_[_0x3860('0x1f')](_0x45b799)}]}]});})[_0x3860('0x14')](function(_0x20a5b0){_0x378305=_0x20a5b0[_0x3860('0xb')]({'plain':!![]});if(_0x378305&&_0x378305[_0x3860('0x20')]){logger[_0x3860('0x21')](_0x3860('0x22'),_0x3860('0x23'),util[_0x3860('0x24')](_0x3860('0x25'),_0x5909b8['id'],_0x378305[_0x3860('0x20')]));if(_0x378305[_0x3860('0x1d')]&&_0x378305[_0x3860('0x1d')]['length']){_0x5909b8[_0x3860('0x26')]=_[_0x3860('0x27')](_0x378305[_0x3860('0x1d')][0x0],_0x3860('0x1e'));_0x5909b8[_0x3860('0x1e')]=_0x378305['Interactions'][0x0][_0x3860('0x1e')];}var _0x441dc4={'method':'POST','uri':encodeURI(_0x378305[_0x3860('0x20')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x441dc4[_0x3860('0x28')]){case'GET':_0x441dc4['qs']=_0x5909b8;break;case'POST':_0x441dc4['body']=_0x5909b8;break;}return rp(_0x441dc4)[_0x3860('0x14')](function(_0x3ebc5b){logger[_0x3860('0x21')](_0x3860('0x22'),_0x3860('0x23'),util[_0x3860('0x24')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x5909b8['id'],_0x378305['replyUri']));if(_0x3ebc5b[_0x3860('0x29')][_0x3860('0x2a')]&&_0x3ebc5b['body'][_0x3860('0x2a')]!=_0x5909b8[_0x3860('0x26')][_0x3860('0x2a')]){return _0x2fb169[_0x3860('0x11')][_0x3860('0x15')]({'threadId':_0x3ebc5b['body'][_0x3860('0x2a')]},{'logging':!![],'where':{'id':_0x5909b8[_0x3860('0x26')]['id']}});}else{return;}})[_0x3860('0x14')](function(){return _0x1ad015['update']({'read':!![]});})[_0x3860('0x17')](function(_0x5e25ce){logger[_0x3860('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x3860('0x23'),util[_0x3860('0x2b')](_0x5e25ce,{'showHidden':![],'depth':null}));_0x52c277();});}else{_0x52c277();}})[_0x3860('0x2c')](function(){_0x52c277();});}else{_0x52c277();}}},'charset':'utf8mb4','collate':_0x3860('0x2d')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index da280de..5640bf0 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','body','options','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x7192e5,_0xe461e0){var _0x59c69a=function(_0x3a966c){while(--_0x3a966c){_0x7192e5['push'](_0x7192e5['shift']());}};_0x59c69a(++_0xe461e0);}(_0x7a54,0x106));var _0x47a5=function(_0x3153bb,_0x3666fd){_0x3153bb=_0x3153bb-0x0;var _0x43cb38=_0x7a54[_0x3153bb];return _0x43cb38;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});config['redis']=_[_0x47a5('0xb')](config[_0x47a5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0xd'))(new Redis(config['redis']));require('./openchannelMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2a0e98,_0x2baee7,_0x5e31dd){return new BPromise(function(_0x2eb0dd,_0x49e844){return client['request'](_0x2a0e98,_0x5e31dd)[_0x47a5('0xe')](function(_0x69e4d4){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x2baee7,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x2baee7,'request\x20sent',JSON[_0x47a5('0x14')](_0x69e4d4));if(_0x69e4d4[_0x47a5('0x15')]){if(_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x49e844(_0x69e4d4['error'][_0x47a5('0x17')]);}logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2eb0dd(_0x69e4d4['error']['message']);}else{logger[_0x47a5('0xf')]('OpenchannelMessage,\x20%s,\x20%s',_0x2baee7,'request\x20sent');_0x2eb0dd(_0x69e4d4[_0x47a5('0x18')][_0x47a5('0x17')]);}})[_0x47a5('0x19')](function(_0x1ef371){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x1ef371);_0x49e844(_0x1ef371);});});}exports[_0x47a5('0x1a')]=function(_0xe3c618){var _0x3aed38=this;return new Promise(function(_0x4a9fcb,_0x1570bc){return db[_0x47a5('0x1b')]['create'](_0xe3c618[_0x47a5('0x1c')],{'raw':_0xe3c618[_0x47a5('0x1d')]?_0xe3c618[_0x47a5('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x47a5('0xe')](function(_0x2f142b){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xe3c618);logger['debug'](_0x47a5('0x1a'),_0xe3c618,JSON[_0x47a5('0x14')](_0x2f142b));_0x4a9fcb(_0x2f142b);})['catch'](function(_0x28747d){logger[_0x47a5('0x15')](_0x47a5('0x1a'),_0x28747d[_0x47a5('0x17')],_0xe3c618);_0x1570bc(_0x3aed38[_0x47a5('0x15')](0x1f4,_0x28747d['message']));});});}; \ No newline at end of file +var _0x5f66=['stringify','error','code','message','info','result','OpenchannelMessage','create','body','options','raw','CreateOpenchannelMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x4a9954,_0x6d8ebd){var _0x47f1da=function(_0x548eb0){while(--_0x548eb0){_0x4a9954['push'](_0x4a9954['shift']());}};_0x47f1da(++_0x6d8ebd);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x5f66[_0x4243a3];return _0x1b2a33;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateOpenchannelMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index f751a0c..fd4a611 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 _0x29af=['./openchannelMessage.events','save','remove','emit','removeListener','length','openchannelMessage:'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x29af,0x134));var _0xf29a=function(_0x159519,_0x74f529){_0x159519=_0x159519-0x0;var _0x28d1af=_0x29af[_0x159519];return _0x28d1af;};'use strict';var OpenchannelMessageEvents=require(_0xf29a('0x0'));var events=[_0xf29a('0x1'),_0xf29a('0x2'),'update'];function createListener(_0x133327,_0x13cfd8){return function(_0x58929e){_0x13cfd8[_0xf29a('0x3')](_0x133327,_0x58929e);};}function removeListener(_0x505d15,_0x37e156){return function(){OpenchannelMessageEvents[_0xf29a('0x4')](_0x505d15,_0x37e156);};}exports['register']=function(_0x553398){for(var _0x2e25dc=0x0,_0x2c111b=events[_0xf29a('0x5')];_0x2e25dc<_0x2c111b;_0x2e25dc++){var _0x33a308=events[_0x2e25dc];var _0x347d76=createListener(_0xf29a('0x6')+_0x33a308,_0x553398);OpenchannelMessageEvents['on'](_0x33a308,_0x347d76);}}; \ No newline at end of file +var _0x2ba6=['register','length','./openchannelMessage.events','save','remove','update','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2ba6,0x1ea));var _0x62ba=function(_0x3b8bff,_0x441914){_0x3b8bff=_0x3b8bff-0x0;var _0x2a0301=_0x2ba6[_0x3b8bff];return _0x2a0301;};'use strict';var OpenchannelMessageEvents=require(_0x62ba('0x0'));var events=[_0x62ba('0x1'),_0x62ba('0x2'),_0x62ba('0x3')];function createListener(_0x44c939,_0x49a26c){return function(_0xf21fcc){_0x49a26c[_0x62ba('0x4')](_0x44c939,_0xf21fcc);};}function removeListener(_0x19316d,_0x362f2c){return function(){OpenchannelMessageEvents[_0x62ba('0x5')](_0x19316d,_0x362f2c);};}exports[_0x62ba('0x6')]=function(_0x57d9f9){for(var _0x304c4b=0x0,_0x24c78a=events[_0x62ba('0x7')];_0x304c4b<_0x24c78a;_0x304c4b++){var _0x4c1b10=events[_0x304c4b];var _0xa8dec7=createListener('openchannelMessage:'+_0x4c1b10,_0x57d9f9);OpenchannelMessageEvents['on'](_0x4c1b10,_0xa8dec7);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index d3a8aaf..78f54c8 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 _0x01f1=['show','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','addAgents','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','index','isAuthenticated','describe','/:id'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x01f1,0x15d));var _0x101f=function(_0x1c470d,_0x81d66b){_0x1c470d=_0x1c470d-0x0;var _0x12141b=_0x01f1[_0x1c470d];return _0x12141b;};'use strict';var multer=require(_0x101f('0x0'));var util=require(_0x101f('0x1'));var path=require(_0x101f('0x2'));var timeout=require(_0x101f('0x3'));var express=require(_0x101f('0x4'));var router=express[_0x101f('0x5')]();var fs_extra=require(_0x101f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x101f('0x7'));var config=require(_0x101f('0x8'));var controller=require(_0x101f('0x9'));router[_0x101f('0xa')]('/',auth['isAuthenticated'](),controller[_0x101f('0xb')]);router[_0x101f('0xa')]('/describe',auth[_0x101f('0xc')](),controller[_0x101f('0xd')]);router[_0x101f('0xa')](_0x101f('0xe'),auth[_0x101f('0xc')](),controller[_0x101f('0xf')]);router[_0x101f('0xa')]('/:id/members',auth['isAuthenticated'](),controller[_0x101f('0x10')]);router[_0x101f('0xa')](_0x101f('0x11'),auth[_0x101f('0xc')](),controller[_0x101f('0x12')]);router[_0x101f('0xa')](_0x101f('0x13'),auth[_0x101f('0xc')](),controller['getAgents']);router['post']('/',auth[_0x101f('0xc')](),controller['create']);router[_0x101f('0x14')]('/:id/teams',auth[_0x101f('0xc')](),controller[_0x101f('0x15')]);router['post'](_0x101f('0x13'),auth['isAuthenticated'](),controller[_0x101f('0x16')]);router['put'](_0x101f('0xe'),auth['isAuthenticated'](),controller[_0x101f('0x17')]);router[_0x101f('0x18')](_0x101f('0xe'),auth['isAuthenticated'](),controller[_0x101f('0x19')]);router['delete'](_0x101f('0x11'),auth[_0x101f('0xc')](),controller['removeTeams']);router[_0x101f('0x18')](_0x101f('0x13'),auth[_0x101f('0xc')](),controller[_0x101f('0x1a')]);module[_0x101f('0x1b')]=router; \ No newline at end of file +var _0x6b69=['describe','/:id','show','/:id/members','getTeams','create','post','/:id/teams','/:id/users','update','delete','destroy','removeTeams','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated'];(function(_0x2f4d1b,_0x1f65be){var _0x5da6c2=function(_0x5cd4a2){while(--_0x5cd4a2){_0x2f4d1b['push'](_0x2f4d1b['shift']());}};_0x5da6c2(++_0x1f65be);}(_0x6b69,0x1c8));var _0x96b6=function(_0x1701de,_0x586ae9){_0x1701de=_0x1701de-0x0;var _0x259d37=_0x6b69[_0x1701de];return _0x259d37;};'use strict';var multer=require(_0x96b6('0x0'));var util=require(_0x96b6('0x1'));var path=require(_0x96b6('0x2'));var timeout=require(_0x96b6('0x3'));var express=require(_0x96b6('0x4'));var router=express[_0x96b6('0x5')]();var fs_extra=require(_0x96b6('0x6'));var auth=require(_0x96b6('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x96b6('0x8'));var controller=require(_0x96b6('0x9'));router[_0x96b6('0xa')]('/',auth[_0x96b6('0xb')](),controller['index']);router[_0x96b6('0xa')]('/describe',auth[_0x96b6('0xb')](),controller[_0x96b6('0xc')]);router[_0x96b6('0xa')](_0x96b6('0xd'),auth['isAuthenticated'](),controller[_0x96b6('0xe')]);router[_0x96b6('0xa')](_0x96b6('0xf'),auth['isAuthenticated'](),controller['getMembers']);router[_0x96b6('0xa')]('/:id/teams',auth[_0x96b6('0xb')](),controller[_0x96b6('0x10')]);router[_0x96b6('0xa')]('/:id/users',auth[_0x96b6('0xb')](),controller['getAgents']);router['post']('/',auth[_0x96b6('0xb')](),controller[_0x96b6('0x11')]);router[_0x96b6('0x12')](_0x96b6('0x13'),auth[_0x96b6('0xb')](),controller['addTeams']);router[_0x96b6('0x12')](_0x96b6('0x14'),auth[_0x96b6('0xb')](),controller['addAgents']);router['put'](_0x96b6('0xd'),auth['isAuthenticated'](),controller[_0x96b6('0x15')]);router[_0x96b6('0x16')](_0x96b6('0xd'),auth[_0x96b6('0xb')](),controller[_0x96b6('0x17')]);router[_0x96b6('0x16')](_0x96b6('0x13'),auth['isAuthenticated'](),controller[_0x96b6('0x18')]);router['delete'](_0x96b6('0x14'),auth[_0x96b6('0xb')](),controller['removeAgents']);module[_0x96b6('0x19')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index fe436e7..be65fcc 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 _0x0c8a=['beepall','sequelize','STRING','INTEGER','ENUM','rrmemory'];(function(_0x301c34,_0x15701e){var _0x1a8c5a=function(_0x297b4f){while(--_0x297b4f){_0x301c34['push'](_0x301c34['shift']());}};_0x1a8c5a(++_0x15701e);}(_0x0c8a,0x1a5));var _0xa0c8=function(_0x58d348,_0x423546){_0x58d348=_0x58d348-0x0;var _0x5c886b=_0x0c8a[_0x58d348];return _0x5c886b;};'use strict';var Sequelize=require(_0xa0c8('0x0'));module['exports']={'name':{'type':Sequelize[_0xa0c8('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xa0c8('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa0c8('0x3')](_0xa0c8('0x4'),_0xa0c8('0x5'),'roundrobin')}}; \ No newline at end of file +var _0x834e=['beepall','roundrobin','sequelize','STRING','INTEGER','ENUM','rrmemory'];(function(_0x4e9fc2,_0x89538e){var _0x53c1b4=function(_0x513caf){while(--_0x513caf){_0x4e9fc2['push'](_0x4e9fc2['shift']());}};_0x53c1b4(++_0x89538e);}(_0x834e,0x1de));var _0xe834=function(_0x50e3af,_0x3913a8){_0x50e3af=_0x50e3af-0x0;var _0x49e34d=_0x834e[_0x50e3af];return _0x49e34d;};'use strict';var Sequelize=require(_0xe834('0x0'));module['exports']={'name':{'type':Sequelize[_0xe834('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe834('0x1')]},'timeout':{'type':Sequelize[_0xe834('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe834('0x3')](_0xe834('0x4'),_0xe834('0x5'),_0xe834('0x6'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 5ea6df5..500be38 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 _0xed1f=['flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','User','select','field','tq.TeamId','from','team_has_openchannel_queues','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','zip-dir','fast-json-patch','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','map','VIRTUAL','merge','options','OpenchannelQueue','includeAll','include','rows','catch','show','params','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','UserOpenchannelQueue','OpenchannelQueueId','filter','findAndCountAll','agent','updatedAt','createdAt','format','%s/%s','SIP','openchannelPause','getTeams','Team','order','addTeams','ids','findAll','online','interface'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0xed1f,0x152));var _0xfed1=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xed1f[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0xfed1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfed1('0x1'));var jsonpatch=require(_0xfed1('0x2'));var rp=require('request-promise');var moment=require(_0xfed1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xfed1('0x4'));var util=require(_0xfed1('0x5'));var path=require('path');var sox=require(_0xfed1('0x6'));var csv=require('to-csv');var ejs=require(_0xfed1('0x7'));var fs=require('fs');var fs_extra=require(_0xfed1('0x8'));var _=require(_0xfed1('0x9'));var squel=require(_0xfed1('0xa'));var crypto=require(_0xfed1('0xb'));var jsforce=require(_0xfed1('0xc'));var deskjs=require(_0xfed1('0xd'));var toCsv=require(_0xfed1('0xe'));var querystring=require(_0xfed1('0xf'));var Papa=require('papaparse');var Redis=require(_0xfed1('0x10'));var authService=require(_0xfed1('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xfed1('0x12'));var hardwareService=require(_0xfed1('0x13'));var logger=require(_0xfed1('0x14'))(_0xfed1('0x15'));var utils=require(_0xfed1('0x16'));var config=require(_0xfed1('0x17'));var licenseUtil=require(_0xfed1('0x18'));var db=require(_0xfed1('0x19'))['db'];config['redis']=_[_0xfed1('0x1a')](config[_0xfed1('0x1b')],{'host':_0xfed1('0x1c'),'port':0x18eb});var socket=require(_0xfed1('0x1d'))(new Redis(config[_0xfed1('0x1b')]));require('./openchannelQueue.socket')['register'](socket);function respondWithStatusCode(_0x37a6ce,_0x527d99){_0x527d99=_0x527d99||0xcc;return function(_0x2fa8cc){if(_0x2fa8cc){return _0x37a6ce[_0xfed1('0x1e')](_0x527d99);}return _0x37a6ce['status'](_0x527d99)[_0xfed1('0x1f')]();};}function respondWithResult(_0x41ed78,_0x416345){_0x416345=_0x416345||0xc8;return function(_0x2db613){if(_0x2db613){return _0x41ed78[_0xfed1('0x20')](_0x416345)['json'](_0x2db613);}};}function respondWithFilteredResult(_0xefac94,_0x3fdf95){return function(_0x139d25){if(_0x139d25){var _0xa2102a=typeof _0x3fdf95[_0xfed1('0x21')]===_0xfed1('0x22')&&typeof _0x3fdf95[_0xfed1('0x23')]==='undefined';var _0x4fec34=_0x139d25['count'];var _0x54e9ed=_0xa2102a?0x0:_0x3fdf95[_0xfed1('0x21')];var _0x5c62c8=_0xa2102a?_0x139d25[_0xfed1('0x24')]:_0x3fdf95[_0xfed1('0x21')]+_0x3fdf95[_0xfed1('0x23')];var _0x54140f;if(_0x5c62c8>=_0x4fec34){_0x5c62c8=_0x4fec34;_0x54140f=0xc8;}else{_0x54140f=0xce;}_0xefac94[_0xfed1('0x20')](_0x54140f);return _0xefac94[_0xfed1('0x25')](_0xfed1('0x26'),_0x54e9ed+'-'+_0x5c62c8+'/'+_0x4fec34)['json'](_0x139d25);}return null;};}function patchUpdates(_0x1d57ce){return function(_0x422d61){try{jsonpatch[_0xfed1('0x27')](_0x422d61,_0x1d57ce,!![]);}catch(_0x133093){return BPromise[_0xfed1('0x28')](_0x133093);}return _0x422d61[_0xfed1('0x29')]();};}function saveUpdates(_0x56af12,_0x19306f){return function(_0x30387e){if(_0x30387e){return _0x30387e[_0xfed1('0x2a')](_0x56af12)[_0xfed1('0x2b')](function(_0x3bd3d0){return _0x3bd3d0;});}return null;};}function removeEntity(_0x5aacbe,_0x28abf7){return function(_0x2a5369){if(_0x2a5369){return _0x2a5369[_0xfed1('0x2c')]()[_0xfed1('0x2b')](function(){var _0x511acf=_0x2a5369[_0xfed1('0x2d')]({'plain':!![]});var _0x7ac035=_0xfed1('0x2e');return db[_0xfed1('0x2f')][_0xfed1('0x2c')]({'where':{'type':_0x7ac035,'resourceId':_0x511acf['id']}})[_0xfed1('0x2b')](function(){return _0x2a5369;});})[_0xfed1('0x2b')](function(){_0x5aacbe['status'](0xcc)[_0xfed1('0x1f')]();});}};}function handleEntityNotFound(_0x24952d,_0x1ac12d){return function(_0x3ee6ff){if(!_0x3ee6ff){_0x24952d['sendStatus'](0x194);}return _0x3ee6ff;};}function handleError(_0x49e719,_0xb4f055){_0xb4f055=_0xb4f055||0x1f4;return function(_0x5b775){logger[_0xfed1('0x30')](_0x5b775[_0xfed1('0x31')]);if(_0x5b775[_0xfed1('0x32')]){delete _0x5b775[_0xfed1('0x32')];}_0x49e719['status'](_0xb4f055)[_0xfed1('0x33')](_0x5b775);};}exports[_0xfed1('0x34')]=function(_0x3f794a,_0x41cb97){var _0x577521={},_0x53d01b={},_0x4e9b68={'count':0x0,'rows':[]};var _0x36c456=_['map'](db['OpenchannelQueue'][_0xfed1('0x35')],function(_0x43a070){return{'name':_0x43a070[_0xfed1('0x36')],'type':_0x43a070[_0xfed1('0x37')][_0xfed1('0x38')]};});_0x53d01b[_0xfed1('0x39')]=_['map'](_0x36c456,_0xfed1('0x32'));_0x53d01b[_0xfed1('0x3a')]=_['keys'](_0x3f794a[_0xfed1('0x3a')]);_0x53d01b[_0xfed1('0x3b')]=_[_0xfed1('0x3c')](_0x53d01b[_0xfed1('0x39')],_0x53d01b[_0xfed1('0x3a')]);_0x577521[_0xfed1('0x3d')]=_[_0xfed1('0x3c')](_0x53d01b[_0xfed1('0x39')],qs[_0xfed1('0x3e')](_0x3f794a[_0xfed1('0x3a')][_0xfed1('0x3e')]));_0x577521['attributes']=_0x577521[_0xfed1('0x3d')][_0xfed1('0x3f')]?_0x577521[_0xfed1('0x3d')]:_0x53d01b['model'];if(!_0x3f794a['query'][_0xfed1('0x40')](_0xfed1('0x41'))){_0x577521['limit']=qs[_0xfed1('0x23')](_0x3f794a[_0xfed1('0x3a')][_0xfed1('0x23')]);_0x577521[_0xfed1('0x21')]=qs[_0xfed1('0x21')](_0x3f794a[_0xfed1('0x3a')][_0xfed1('0x21')]);}_0x577521['order']=qs[_0xfed1('0x42')](_0x3f794a['query']['sort']);_0x577521[_0xfed1('0x43')]=qs['filters'](_[_0xfed1('0x44')](_0x3f794a[_0xfed1('0x3a')],_0x53d01b[_0xfed1('0x3b')]),_0x36c456);if(_0x3f794a[_0xfed1('0x3a')]['filter']){_0x577521[_0xfed1('0x43')]=_['merge'](_0x577521[_0xfed1('0x43')],{'$or':_[_0xfed1('0x45')](_0x36c456,function(_0x328e06){if(_0x328e06['type']!==_0xfed1('0x46')){var _0x3e8602={};_0x3e8602[_0x328e06[_0xfed1('0x32')]]={'$like':'%'+_0x3f794a[_0xfed1('0x3a')]['filter']+'%'};return _0x3e8602;}})});}_0x577521=_[_0xfed1('0x47')]({},_0x577521,_0x3f794a[_0xfed1('0x48')]);var _0x53af98={'where':_0x577521[_0xfed1('0x43')]};return db[_0xfed1('0x49')][_0xfed1('0x24')](_0x53af98)[_0xfed1('0x2b')](function(_0x27effc){_0x4e9b68['count']=_0x27effc;if(_0x3f794a['query'][_0xfed1('0x4a')]){_0x577521[_0xfed1('0x4b')]=[{'all':!![]}];}return db[_0xfed1('0x49')]['findAll'](_0x577521);})[_0xfed1('0x2b')](function(_0x762a1e){_0x4e9b68[_0xfed1('0x4c')]=_0x762a1e;return _0x4e9b68;})[_0xfed1('0x2b')](respondWithFilteredResult(_0x41cb97,_0x577521))[_0xfed1('0x4d')](handleError(_0x41cb97,null));};exports[_0xfed1('0x4e')]=function(_0x1a5a35,_0x5deba0){var _0x3b72e0={'raw':!![],'where':{'id':_0x1a5a35[_0xfed1('0x4f')]['id']}},_0x47acbe={};_0x47acbe[_0xfed1('0x39')]=_[_0xfed1('0x50')](db[_0xfed1('0x49')]['rawAttributes']);_0x47acbe[_0xfed1('0x3a')]=_[_0xfed1('0x50')](_0x1a5a35[_0xfed1('0x3a')]);_0x47acbe[_0xfed1('0x3b')]=_['intersection'](_0x47acbe[_0xfed1('0x39')],_0x47acbe[_0xfed1('0x3a')]);_0x3b72e0['attributes']=_[_0xfed1('0x3c')](_0x47acbe[_0xfed1('0x39')],qs[_0xfed1('0x3e')](_0x1a5a35['query'][_0xfed1('0x3e')]));_0x3b72e0[_0xfed1('0x3d')]=_0x3b72e0[_0xfed1('0x3d')][_0xfed1('0x3f')]?_0x3b72e0[_0xfed1('0x3d')]:_0x47acbe[_0xfed1('0x39')];if(_0x1a5a35['query'][_0xfed1('0x4a')]){_0x3b72e0['include']=[{'all':!![]}];}_0x3b72e0=_['merge']({},_0x3b72e0,_0x1a5a35[_0xfed1('0x48')]);return db[_0xfed1('0x49')][_0xfed1('0x51')](_0x3b72e0)[_0xfed1('0x2b')](handleEntityNotFound(_0x5deba0,null))[_0xfed1('0x2b')](respondWithResult(_0x5deba0,null))[_0xfed1('0x4d')](handleError(_0x5deba0,null));};exports[_0xfed1('0x52')]=function(_0x67a735,_0x52dfc2){return db[_0xfed1('0x49')][_0xfed1('0x52')](_0x67a735['body'],{})[_0xfed1('0x2b')](function(_0x23f054){var _0x3b759b=_0x67a735[_0xfed1('0x53')][_0xfed1('0x2d')]({'plain':!![]});if(!_0x3b759b)throw new Error(_0xfed1('0x54'));if(_0x3b759b[_0xfed1('0x55')]===_0xfed1('0x53')){var _0x6efdb=_0x23f054[_0xfed1('0x2d')]({'plain':!![]});var _0x32b5cd='OpenchannelQueues';return db[_0xfed1('0x56')][_0xfed1('0x51')]({'where':{'name':_0x32b5cd,'userProfileId':_0x3b759b[_0xfed1('0x57')]},'raw':!![]})[_0xfed1('0x2b')](function(_0x4a8f1f){if(_0x4a8f1f&&_0x4a8f1f[_0xfed1('0x58')]===0x0){return db[_0xfed1('0x2f')]['create']({'name':_0x6efdb[_0xfed1('0x32')],'resourceId':_0x6efdb['id'],'type':_0x4a8f1f[_0xfed1('0x32')],'sectionId':_0x4a8f1f['id']},{})['then'](function(){return _0x23f054;});}else{return _0x23f054;}})['catch'](function(_0x45b5e1){logger['error'](_0xfed1('0x59'),_0x45b5e1);throw _0x45b5e1;});}return _0x23f054;})[_0xfed1('0x2b')](respondWithResult(_0x52dfc2,0xc9))[_0xfed1('0x4d')](handleError(_0x52dfc2,null));};exports[_0xfed1('0x2a')]=function(_0x4b2c02,_0x385080){if(_0x4b2c02[_0xfed1('0x5a')]['id']){delete _0x4b2c02[_0xfed1('0x5a')]['id'];}return db[_0xfed1('0x49')]['find']({'where':{'id':_0x4b2c02[_0xfed1('0x4f')]['id']}})[_0xfed1('0x2b')](handleEntityNotFound(_0x385080,null))[_0xfed1('0x2b')](saveUpdates(_0x4b2c02[_0xfed1('0x5a')],null))['then'](respondWithResult(_0x385080,null))[_0xfed1('0x4d')](handleError(_0x385080,null));};exports['destroy']=function(_0x42ef22,_0x10c991){return db['OpenchannelQueue'][_0xfed1('0x51')]({'where':{'id':_0x42ef22['params']['id']}})[_0xfed1('0x2b')](handleEntityNotFound(_0x10c991,null))['then'](removeEntity(_0x10c991,null))['catch'](handleError(_0x10c991,null));};exports[_0xfed1('0x5b')]=function(_0x1dfd8b,_0x48325f){return db[_0xfed1('0x49')][_0xfed1('0x5b')]()[_0xfed1('0x2b')](respondWithResult(_0x48325f,null))[_0xfed1('0x4d')](handleError(_0x48325f,null));};exports['getMembers']=function(_0x5d5648,_0x2e59a8,_0x11d743){var _0x2f8e5f={'raw':!![],'where':{}},_0x3d34df={},_0x4a85e7;return db['OpenchannelQueue'][_0xfed1('0x5c')]({'where':{'id':_0x5d5648[_0xfed1('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2e59a8,null))['then'](function(_0x2ad5cb){if(_0x2ad5cb){_0x4a85e7=_0x2ad5cb[_0xfed1('0x2d')]({'plain':!![]});_0x3d34df[_0xfed1('0x39')]=_[_0xfed1('0x50')](db[_0xfed1('0x5d')]['rawAttributes']);_0x3d34df[_0xfed1('0x3a')]=_[_0xfed1('0x50')](_0x5d5648[_0xfed1('0x3a')]);_0x3d34df[_0xfed1('0x3b')]=_['intersection'](_0x3d34df[_0xfed1('0x39')],_0x3d34df[_0xfed1('0x3a')]);_0x2f8e5f['attributes']=_[_0xfed1('0x3c')](_0x3d34df[_0xfed1('0x39')],qs[_0xfed1('0x3e')](_0x5d5648['query']['fields']));_0x2f8e5f['attributes']=_0x2f8e5f[_0xfed1('0x3d')][_0xfed1('0x3f')]?_0x2f8e5f[_0xfed1('0x3d')]:_0x3d34df[_0xfed1('0x39')];if(!_0x5d5648[_0xfed1('0x3a')][_0xfed1('0x40')](_0xfed1('0x41'))){_0x2f8e5f[_0xfed1('0x23')]=qs['limit'](_0x5d5648[_0xfed1('0x3a')][_0xfed1('0x23')]);_0x2f8e5f[_0xfed1('0x21')]=qs[_0xfed1('0x21')](_0x5d5648[_0xfed1('0x3a')][_0xfed1('0x21')]);}_0x2f8e5f['order']=qs[_0xfed1('0x42')](_0x5d5648['query'][_0xfed1('0x42')]);_0x2f8e5f[_0xfed1('0x43')]=qs['filters'](_[_0xfed1('0x44')](_0x5d5648['query'],_0x3d34df[_0xfed1('0x3b')]));_0x2f8e5f[_0xfed1('0x43')][_0xfed1('0x5e')]=_0x2ad5cb['id'];if(_0x5d5648[_0xfed1('0x3a')][_0xfed1('0x5f')]){_0x2f8e5f['where']=_[_0xfed1('0x47')](_0x2f8e5f[_0xfed1('0x43')],{'$or':_['map'](_0x2f8e5f[_0xfed1('0x3d')],function(_0x14c586){var _0x9bed88={};_0x9bed88[_0x14c586]={'$like':'%'+_0x5d5648[_0xfed1('0x3a')][_0xfed1('0x5f')]+'%'};return _0x9bed88;})});}_0x2f8e5f=_['merge']({},_0x2f8e5f,_0x5d5648[_0xfed1('0x48')]);return db[_0xfed1('0x5d')]['findAll'](_0x2f8e5f);}})['then'](function(_0x27b52d){if(_0x27b52d){return db['User'][_0xfed1('0x60')]({'where':{'id':_[_0xfed1('0x45')](_0x27b52d,'UserId'),'role':_0xfed1('0x61')},'attributes':['id','name','openchannelPause',_0xfed1('0x62'),_0xfed1('0x63')]});}})['then'](function(_0x49ef92){if(_0x49ef92){return{'count':_0x49ef92[_0xfed1('0x24')],'rows':_[_0xfed1('0x45')](_0x49ef92['rows'],function(_0xfd75ab){return{'membername':_0xfd75ab[_0xfed1('0x32')],'UserId':_0xfd75ab['id'],'queue_name':_0x4a85e7[_0xfed1('0x32')],'OpenchannelQueueId':_0x4a85e7['id'],'interface':util[_0xfed1('0x64')](_0xfed1('0x65'),_0xfed1('0x66'),_0xfd75ab[_0xfed1('0x32')]),'penalty':0x0,'paused':_0xfd75ab[_0xfed1('0x67')],'createdAt':_0xfd75ab['createdAt'],'updatedAt':_0xfd75ab[_0xfed1('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xfed1('0x2b')](respondWithFilteredResult(_0x2e59a8,_0x2f8e5f))[_0xfed1('0x4d')](handleError(_0x2e59a8,null));};exports[_0xfed1('0x68')]=function(_0xe3c70d,_0x52f818,_0x5bdbbc){var _0x46f71e={};var _0x222cc4={};var _0x4c9e8f;var _0x47580a;return db[_0xfed1('0x49')]['findOne']({'where':{'id':_0xe3c70d[_0xfed1('0x4f')]['id']}})['then'](handleEntityNotFound(_0x52f818,null))['then'](function(_0x5444bf){if(_0x5444bf){_0x4c9e8f=_0x5444bf;_0x222cc4['model']=_['keys'](db[_0xfed1('0x69')][_0xfed1('0x35')]);_0x222cc4[_0xfed1('0x3a')]=_[_0xfed1('0x50')](_0xe3c70d[_0xfed1('0x3a')]);_0x222cc4[_0xfed1('0x3b')]=_[_0xfed1('0x3c')](_0x222cc4[_0xfed1('0x39')],_0x222cc4['query']);_0x46f71e[_0xfed1('0x3d')]=_[_0xfed1('0x3c')](_0x222cc4[_0xfed1('0x39')],qs[_0xfed1('0x3e')](_0xe3c70d[_0xfed1('0x3a')]['fields']));_0x46f71e[_0xfed1('0x3d')]=_0x46f71e[_0xfed1('0x3d')][_0xfed1('0x3f')]?_0x46f71e[_0xfed1('0x3d')]:_0x222cc4[_0xfed1('0x39')];_0x46f71e[_0xfed1('0x6a')]=qs[_0xfed1('0x42')](_0xe3c70d[_0xfed1('0x3a')][_0xfed1('0x42')]);_0x46f71e[_0xfed1('0x43')]=qs[_0xfed1('0x3b')](_[_0xfed1('0x44')](_0xe3c70d[_0xfed1('0x3a')],_0x222cc4['filters']));if(_0xe3c70d[_0xfed1('0x3a')][_0xfed1('0x5f')]){_0x46f71e[_0xfed1('0x43')]=_[_0xfed1('0x47')](_0x46f71e['where'],{'$or':_[_0xfed1('0x45')](_0x46f71e[_0xfed1('0x3d')],function(_0x1873f7){var _0x50a339={};_0x50a339[_0x1873f7]={'$like':'%'+_0xe3c70d['query']['filter']+'%'};return _0x50a339;})});}_0x46f71e=_['merge']({},_0x46f71e,_0xe3c70d[_0xfed1('0x48')]);return _0x4c9e8f[_0xfed1('0x68')](_0x46f71e);}})[_0xfed1('0x2b')](function(_0x350d6c){if(_0x350d6c){_0x47580a=_0x350d6c[_0xfed1('0x3f')];if(!_0xe3c70d['query'][_0xfed1('0x40')]('nolimit')){_0x46f71e['limit']=qs['limit'](_0xe3c70d[_0xfed1('0x3a')][_0xfed1('0x23')]);_0x46f71e['offset']=qs[_0xfed1('0x21')](_0xe3c70d[_0xfed1('0x3a')][_0xfed1('0x21')]);}return _0x4c9e8f[_0xfed1('0x68')](_0x46f71e);}})[_0xfed1('0x2b')](function(_0x5671a0){if(_0x5671a0){return _0x5671a0?{'count':_0x47580a,'rows':_0x5671a0}:null;}})['then'](respondWithResult(_0x52f818,null))[_0xfed1('0x4d')](handleError(_0x52f818,null));};exports[_0xfed1('0x6b')]=function(_0x2165d4,_0x152921,_0x4adced){var _0x27bc89=_0x2165d4['body'][_0xfed1('0x6c')];return db['Team'][_0xfed1('0x6d')]({'where':{'id':_0x27bc89},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xfed1('0x32'),_0xfed1('0x6e'),'voicePause',_0xfed1('0x6f')],'raw':!![]}]})[_0xfed1('0x2b')](function(_0x38af1d){if(_0x38af1d){var _0x4a7742=_[_0xfed1('0x70')](_0x38af1d,function(_0x17aae5){var _0x482c68=_0x17aae5[_0xfed1('0x2d')]({'plain':!![]});return _0x482c68[_0xfed1('0x71')];});return db[_0xfed1('0x49')][_0xfed1('0x51')]({'where':{'id':_0x2165d4[_0xfed1('0x4f')]['id']}})[_0xfed1('0x2b')](function(_0x4094ea){return db[_0xfed1('0x72')][_0xfed1('0x73')](function(_0x7aed0){return _0x4094ea[_0xfed1('0x6b')](_0x27bc89,{'transaction':_0x7aed0})[_0xfed1('0x2b')](function(){return BPromise[_0xfed1('0x74')](_0x4a7742,function(_0x10743e){return db[_0xfed1('0x5d')][_0xfed1('0x75')]({'where':{'UserId':_0x10743e['id'],'OpenchannelQueueId':_0x2165d4[_0xfed1('0x4f')]['id']},'transaction':_0x7aed0});});})[_0xfed1('0x2b')](function(){_0x4a7742[_0xfed1('0x76')](function(_0x4a29fe){socket[_0xfed1('0x77')](_0xfed1('0x78'),{'UserId':_0x4a29fe['id'],'OpenchannelQueueId':_0x4094ea['id']});});});});});}})[_0xfed1('0x2b')](respondWithStatusCode(_0x152921,null))[_0xfed1('0x4d')](handleError(_0x152921,null));};exports[_0xfed1('0x79')]=function(_0x557ff5,_0x2e9184,_0x371f31){return db[_0xfed1('0x69')][_0xfed1('0x6d')]({'where':{'id':_0x557ff5['query'][_0xfed1('0x6c')]},'attributes':['id'],'include':[{'model':db[_0xfed1('0x7a')],'as':_0xfed1('0x71'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2e9184,null))[_0xfed1('0x2b')](function(_0x165c57){var _0x3ddc13=_[_0xfed1('0x45')](_0x165c57,'id');var _0x52a181=[];var _0x69dc8b=[];var _0x296f9f=squel[_0xfed1('0x7b')]();_0x296f9f[_0xfed1('0x7c')](_0xfed1('0x7d'))[_0xfed1('0x7e')](_0xfed1('0x7f'),'tq')['join']('user_has_teams','ut',_0xfed1('0x80'))[_0xfed1('0x43')](_0xfed1('0x81'),_0x557ff5['params']['id']);for(var _0x43e47f=0x0;_0x43e47f<_0x165c57['length'];_0x43e47f+=0x1){let _0x50fa6e=_0x165c57[_0x43e47f];for(var _0x4aeedf=0x0;_0x4aeedf<_0x50fa6e[_0xfed1('0x71')][_0xfed1('0x3f')];_0x4aeedf+=0x1){let _0x1d7f8e=_0x50fa6e[_0xfed1('0x71')][_0x4aeedf];var _0x5e3eb2=_0x296f9f[_0xfed1('0x82')]();_0x5e3eb2[_0xfed1('0x43')](_0xfed1('0x83'),_0x1d7f8e['id']);_0x69dc8b[_0xfed1('0x84')](db[_0xfed1('0x72')][_0xfed1('0x3a')](_0x5e3eb2[_0xfed1('0x85')](),{'type':db[_0xfed1('0x72')][_0xfed1('0x86')][_0xfed1('0x87')]})[_0xfed1('0x2b')](function(_0x2cf871){if(_0x2cf871['length']===0x1){return _0x1d7f8e['id'];}else{var _0x535dd4=_[_0xfed1('0x88')](_[_0xfed1('0x45')](_0x2cf871,'TeamId'),function(_0x17baca){return _[_0xfed1('0x89')](_0x3ddc13,_0x17baca);});if(_0x535dd4){return _0x1d7f8e['id'];}}}));}}return BPromise[_0xfed1('0x8a')](_0x69dc8b)['then'](function(_0x505d1d){_0x52a181=_(_0x52a181)[_0xfed1('0x8b')](_0x505d1d)[_0xfed1('0x8c')]()[_0xfed1('0x8d')]();return db[_0xfed1('0x49')][_0xfed1('0x51')]({'where':{'id':_0x557ff5[_0xfed1('0x4f')]['id']}})[_0xfed1('0x2b')](function(_0x518096){return db[_0xfed1('0x72')][_0xfed1('0x73')](function(_0x17da83){return _0x518096[_0xfed1('0x79')](_0x557ff5[_0xfed1('0x3a')]['ids'],{'transaction':_0x17da83})[_0xfed1('0x2b')](function(){if(!_[_0xfed1('0x8e')](_0x52a181)){return _0x518096[_0xfed1('0x8f')](_0x52a181,{'transaction':_0x17da83});}})[_0xfed1('0x2b')](function(){_0x52a181[_0xfed1('0x76')](function(_0x1dfa7d){socket['emit'](_0xfed1('0x90'),{'UserId':_0x1dfa7d,'OpenchannelQueueId':_0x518096['id']});});});});});});})['then'](respondWithStatusCode(_0x2e9184,null))[_0xfed1('0x4d')](handleError(_0x2e9184,null));};exports[_0xfed1('0x91')]=function(_0x305da8,_0x4dfe5c,_0xe4c43b){return db[_0xfed1('0x49')][_0xfed1('0x51')]({'where':{'id':_0x305da8[_0xfed1('0x4f')]['id']}})[_0xfed1('0x2b')](handleEntityNotFound(_0x4dfe5c,null))[_0xfed1('0x2b')](function(_0x35ac1c){if(_0x35ac1c){return _0x35ac1c[_0xfed1('0x91')](_0x305da8[_0xfed1('0x5a')][_0xfed1('0x6c')],_[_0xfed1('0x92')](_0x305da8[_0xfed1('0x5a')],[_0xfed1('0x6c'),'id'])||{})[_0xfed1('0x93')](function(_0x1bfb72){for(var _0x4c9e4f=0x0;_0x4c9e4f<_0x305da8[_0xfed1('0x5a')][_0xfed1('0x6c')][_0xfed1('0x3f')];_0x4c9e4f+=0x1){socket[_0xfed1('0x77')](_0xfed1('0x78'),{'UserId':Number(_0x305da8['body'][_0xfed1('0x6c')][_0x4c9e4f]),'OpenchannelQueueId':Number(_0x305da8[_0xfed1('0x4f')]['id'])});}return _0x1bfb72;});}})[_0xfed1('0x2b')](respondWithResult(_0x4dfe5c,null))['catch'](handleError(_0x4dfe5c,null));};exports[_0xfed1('0x8f')]=function(_0x410fed,_0x19b432,_0x3a5215){return db['OpenchannelQueue']['find']({'where':{'id':_0x410fed[_0xfed1('0x4f')]['id']}})[_0xfed1('0x2b')](handleEntityNotFound(_0x19b432,null))['then'](function(_0x237d16){if(_0x237d16){return _0x237d16[_0xfed1('0x8f')](_0x410fed[_0xfed1('0x3a')][_0xfed1('0x6c')])[_0xfed1('0x2b')](function(){if(_[_0xfed1('0x94')](_0x410fed['query'][_0xfed1('0x6c')])){for(var _0xfe7aa0=0x0;_0xfe7aa0<_0x410fed[_0xfed1('0x3a')]['ids'][_0xfed1('0x3f')];_0xfe7aa0+=0x1){socket[_0xfed1('0x77')](_0xfed1('0x90'),{'UserId':Number(_0x410fed[_0xfed1('0x3a')][_0xfed1('0x6c')][_0xfe7aa0]),'OpenchannelQueueId':Number(_0x410fed[_0xfed1('0x4f')]['id'])});}}else{socket[_0xfed1('0x77')](_0xfed1('0x90'),{'UserId':Number(_0x410fed[_0xfed1('0x3a')][_0xfed1('0x6c')]),'OpenchannelQueueId':Number(_0x410fed[_0xfed1('0x4f')]['id'])});}});}})[_0xfed1('0x2b')](respondWithStatusCode(_0x19b432,null))[_0xfed1('0x4d')](handleError(_0x19b432,null));};exports[_0xfed1('0x95')]=function(_0x400808,_0xbd2701,_0x18bc01){var _0x14aad5={};var _0x2388da={};var _0x35d7d7;var _0x1d2a9a;return db[_0xfed1('0x49')]['findOne']({'where':{'id':_0x400808[_0xfed1('0x4f')]['id']}})[_0xfed1('0x2b')](handleEntityNotFound(_0xbd2701,null))['then'](function(_0x8d2f19){if(_0x8d2f19){_0x35d7d7=_0x8d2f19;_0x2388da[_0xfed1('0x39')]=_['keys'](db[_0xfed1('0x7a')]['rawAttributes']);_0x2388da[_0xfed1('0x3a')]=_[_0xfed1('0x50')](_0x400808[_0xfed1('0x3a')]);_0x2388da['filters']=_[_0xfed1('0x3c')](_0x2388da[_0xfed1('0x39')],_0x2388da['query']);_0x14aad5[_0xfed1('0x3d')]=_[_0xfed1('0x3c')](_0x2388da['model'],qs[_0xfed1('0x3e')](_0x400808[_0xfed1('0x3a')]['fields']));_0x14aad5[_0xfed1('0x3d')]=_0x14aad5[_0xfed1('0x3d')][_0xfed1('0x3f')]?_0x14aad5[_0xfed1('0x3d')]:_0x2388da[_0xfed1('0x39')];_0x14aad5[_0xfed1('0x6a')]=qs[_0xfed1('0x42')](_0x400808[_0xfed1('0x3a')][_0xfed1('0x42')]);_0x14aad5[_0xfed1('0x43')]=qs['filters'](_['pick'](_0x400808[_0xfed1('0x3a')],_0x2388da[_0xfed1('0x3b')]));if(_0x400808['query'][_0xfed1('0x5f')]){_0x14aad5['where']=_[_0xfed1('0x47')](_0x14aad5[_0xfed1('0x43')],{'$or':_[_0xfed1('0x45')](_0x14aad5[_0xfed1('0x3d')],function(_0x2b2f75){var _0xf3ed5f={};_0xf3ed5f[_0x2b2f75]={'$like':'%'+_0x400808['query'][_0xfed1('0x5f')]+'%'};return _0xf3ed5f;})});}_0x14aad5=_['merge']({},_0x14aad5,_0x400808[_0xfed1('0x48')]);return _0x35d7d7[_0xfed1('0x95')](_0x14aad5);}})[_0xfed1('0x2b')](function(_0x264826){if(_0x264826){_0x1d2a9a=_0x264826[_0xfed1('0x3f')];if(!_0x400808['query'][_0xfed1('0x40')](_0xfed1('0x41'))){_0x14aad5[_0xfed1('0x23')]=qs[_0xfed1('0x23')](_0x400808['query'][_0xfed1('0x23')]);_0x14aad5[_0xfed1('0x21')]=qs['offset'](_0x400808['query']['offset']);}return _0x35d7d7[_0xfed1('0x95')](_0x14aad5);}})[_0xfed1('0x2b')](function(_0x15d605){if(_0x15d605){return _0x15d605?{'count':_0x1d2a9a,'rows':_0x15d605}:null;}})[_0xfed1('0x2b')](respondWithResult(_0xbd2701,null))[_0xfed1('0x4d')](handleError(_0xbd2701,null));}; \ No newline at end of file +var _0x122c=['user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','transaction','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','spread','userOpenchannelQueue:save','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','OpenchannelQueues','end','error','stack','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','get','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','User','findAndCountAll','UserId','agent','updatedAt','format','SIP','openchannelPause','createdAt','getTeams','Team','order','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','each','findOrCreate','forEach','emit','removeTeams','select','team_has_openchannel_queues'];(function(_0x46361e,_0x243aaf){var _0x14e302=function(_0x9ebecf){while(--_0x9ebecf){_0x46361e['push'](_0x46361e['shift']());}};_0x14e302(++_0x243aaf);}(_0x122c,0xa6));var _0xc122=function(_0x3bc306,_0x32948e){_0x3bc306=_0x3bc306-0x0;var _0x356bc0=_0x122c[_0x3bc306];return _0x356bc0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc122('0x0'));var zipdir=require(_0xc122('0x1'));var jsonpatch=require(_0xc122('0x2'));var rp=require(_0xc122('0x3'));var moment=require(_0xc122('0x4'));var BPromise=require(_0xc122('0x5'));var Mustache=require(_0xc122('0x6'));var util=require(_0xc122('0x7'));var path=require('path');var sox=require(_0xc122('0x8'));var csv=require(_0xc122('0x9'));var ejs=require(_0xc122('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc122('0xb'));var squel=require(_0xc122('0xc'));var crypto=require('crypto');var jsforce=require(_0xc122('0xd'));var deskjs=require(_0xc122('0xe'));var toCsv=require(_0xc122('0x9'));var querystring=require(_0xc122('0xf'));var Papa=require(_0xc122('0x10'));var Redis=require(_0xc122('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xc122('0x12'));var as=require(_0xc122('0x13'));var hardwareService=require(_0xc122('0x14'));var logger=require(_0xc122('0x15'))(_0xc122('0x16'));var utils=require(_0xc122('0x17'));var config=require(_0xc122('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xc122('0x19'))['db'];config['redis']=_['defaults'](config[_0xc122('0x1a')],{'host':_0xc122('0x1b'),'port':0x18eb});var socket=require(_0xc122('0x1c'))(new Redis(config[_0xc122('0x1a')]));require('./openchannelQueue.socket')[_0xc122('0x1d')](socket);function respondWithStatusCode(_0x461327,_0xf997db){_0xf997db=_0xf997db||0xcc;return function(_0x1df4b0){if(_0x1df4b0){return _0x461327[_0xc122('0x1e')](_0xf997db);}return _0x461327[_0xc122('0x1f')](_0xf997db)['end']();};}function respondWithResult(_0x716e93,_0x237893){_0x237893=_0x237893||0xc8;return function(_0x56c8ec){if(_0x56c8ec){return _0x716e93[_0xc122('0x1f')](_0x237893)[_0xc122('0x20')](_0x56c8ec);}};}function respondWithFilteredResult(_0x58f28e,_0x241348){return function(_0x36bffb){if(_0x36bffb){var _0x5f00e1=typeof _0x241348[_0xc122('0x21')]===_0xc122('0x22')&&typeof _0x241348[_0xc122('0x23')]===_0xc122('0x22');var _0x12a211=_0x36bffb[_0xc122('0x24')];var _0x51c356=_0x5f00e1?0x0:_0x241348['offset'];var _0x179bf3=_0x5f00e1?_0x36bffb[_0xc122('0x24')]:_0x241348[_0xc122('0x21')]+_0x241348[_0xc122('0x23')];var _0x37d88e;if(_0x179bf3>=_0x12a211){_0x179bf3=_0x12a211;_0x37d88e=0xc8;}else{_0x37d88e=0xce;}_0x58f28e[_0xc122('0x1f')](_0x37d88e);return _0x58f28e[_0xc122('0x25')](_0xc122('0x26'),_0x51c356+'-'+_0x179bf3+'/'+_0x12a211)[_0xc122('0x20')](_0x36bffb);}return null;};}function patchUpdates(_0x40c148){return function(_0xef1ae2){try{jsonpatch[_0xc122('0x27')](_0xef1ae2,_0x40c148,!![]);}catch(_0xdd5f3c){return BPromise['reject'](_0xdd5f3c);}return _0xef1ae2[_0xc122('0x28')]();};}function saveUpdates(_0x2e4cb9,_0xa01a09){return function(_0x377073){if(_0x377073){return _0x377073[_0xc122('0x29')](_0x2e4cb9)[_0xc122('0x2a')](function(_0x544198){return _0x544198;});}return null;};}function removeEntity(_0x5ba416,_0x190883){return function(_0x1f02bd){if(_0x1f02bd){return _0x1f02bd[_0xc122('0x2b')]()[_0xc122('0x2a')](function(){var _0x4d087f=_0x1f02bd['get']({'plain':!![]});var _0x58a454=_0xc122('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x58a454,'resourceId':_0x4d087f['id']}})[_0xc122('0x2a')](function(){return _0x1f02bd;});})['then'](function(){_0x5ba416[_0xc122('0x1f')](0xcc)[_0xc122('0x2d')]();});}};}function handleEntityNotFound(_0x39c946,_0x2b88cd){return function(_0x4a9c19){if(!_0x4a9c19){_0x39c946[_0xc122('0x1e')](0x194);}return _0x4a9c19;};}function handleError(_0x361d4f,_0xe2ad10){_0xe2ad10=_0xe2ad10||0x1f4;return function(_0x4ef454){logger[_0xc122('0x2e')](_0x4ef454[_0xc122('0x2f')]);if(_0x4ef454['name']){delete _0x4ef454['name'];}_0x361d4f[_0xc122('0x1f')](_0xe2ad10)[_0xc122('0x30')](_0x4ef454);};}exports[_0xc122('0x31')]=function(_0x302946,_0x4dfaad){var _0xa26177={},_0x38a472={},_0xb0c1a7={'count':0x0,'rows':[]};var _0x5005f3=_[_0xc122('0x32')](db[_0xc122('0x33')][_0xc122('0x34')],function(_0x6379d7){return{'name':_0x6379d7[_0xc122('0x35')],'type':_0x6379d7[_0xc122('0x36')][_0xc122('0x37')]};});_0x38a472[_0xc122('0x38')]=_[_0xc122('0x32')](_0x5005f3,_0xc122('0x39'));_0x38a472['query']=_[_0xc122('0x3a')](_0x302946[_0xc122('0x3b')]);_0x38a472[_0xc122('0x3c')]=_[_0xc122('0x3d')](_0x38a472['model'],_0x38a472['query']);_0xa26177[_0xc122('0x3e')]=_[_0xc122('0x3d')](_0x38a472[_0xc122('0x38')],qs['fields'](_0x302946[_0xc122('0x3b')][_0xc122('0x3f')]));_0xa26177[_0xc122('0x3e')]=_0xa26177['attributes']['length']?_0xa26177[_0xc122('0x3e')]:_0x38a472[_0xc122('0x38')];if(!_0x302946[_0xc122('0x3b')][_0xc122('0x40')](_0xc122('0x41'))){_0xa26177[_0xc122('0x23')]=qs['limit'](_0x302946['query'][_0xc122('0x23')]);_0xa26177['offset']=qs[_0xc122('0x21')](_0x302946[_0xc122('0x3b')][_0xc122('0x21')]);}_0xa26177['order']=qs[_0xc122('0x42')](_0x302946[_0xc122('0x3b')][_0xc122('0x42')]);_0xa26177[_0xc122('0x43')]=qs[_0xc122('0x3c')](_[_0xc122('0x44')](_0x302946[_0xc122('0x3b')],_0x38a472[_0xc122('0x3c')]),_0x5005f3);if(_0x302946['query'][_0xc122('0x45')]){_0xa26177['where']=_[_0xc122('0x46')](_0xa26177[_0xc122('0x43')],{'$or':_['map'](_0x5005f3,function(_0x3b4247){if(_0x3b4247[_0xc122('0x36')]!==_0xc122('0x47')){var _0x1cdf63={};_0x1cdf63[_0x3b4247['name']]={'$like':'%'+_0x302946[_0xc122('0x3b')]['filter']+'%'};return _0x1cdf63;}})});}_0xa26177=_['merge']({},_0xa26177,_0x302946[_0xc122('0x48')]);var _0x2b3876={'where':_0xa26177[_0xc122('0x43')]};return db[_0xc122('0x33')]['count'](_0x2b3876)[_0xc122('0x2a')](function(_0x1ce71c){_0xb0c1a7[_0xc122('0x24')]=_0x1ce71c;if(_0x302946[_0xc122('0x3b')][_0xc122('0x49')]){_0xa26177[_0xc122('0x4a')]=[{'all':!![]}];}return db[_0xc122('0x33')][_0xc122('0x4b')](_0xa26177);})[_0xc122('0x2a')](function(_0x26ba52){_0xb0c1a7[_0xc122('0x4c')]=_0x26ba52;return _0xb0c1a7;})[_0xc122('0x2a')](respondWithFilteredResult(_0x4dfaad,_0xa26177))[_0xc122('0x4d')](handleError(_0x4dfaad,null));};exports[_0xc122('0x4e')]=function(_0x3652e0,_0x2373e0){var _0x35b103={'raw':!![],'where':{'id':_0x3652e0[_0xc122('0x4f')]['id']}},_0x4b1aae={};_0x4b1aae[_0xc122('0x38')]=_[_0xc122('0x3a')](db[_0xc122('0x33')]['rawAttributes']);_0x4b1aae['query']=_['keys'](_0x3652e0[_0xc122('0x3b')]);_0x4b1aae[_0xc122('0x3c')]=_['intersection'](_0x4b1aae[_0xc122('0x38')],_0x4b1aae[_0xc122('0x3b')]);_0x35b103[_0xc122('0x3e')]=_[_0xc122('0x3d')](_0x4b1aae['model'],qs[_0xc122('0x3f')](_0x3652e0[_0xc122('0x3b')][_0xc122('0x3f')]));_0x35b103['attributes']=_0x35b103[_0xc122('0x3e')][_0xc122('0x50')]?_0x35b103['attributes']:_0x4b1aae[_0xc122('0x38')];if(_0x3652e0['query'][_0xc122('0x49')]){_0x35b103['include']=[{'all':!![]}];}_0x35b103=_['merge']({},_0x35b103,_0x3652e0[_0xc122('0x48')]);return db[_0xc122('0x33')][_0xc122('0x51')](_0x35b103)[_0xc122('0x2a')](handleEntityNotFound(_0x2373e0,null))[_0xc122('0x2a')](respondWithResult(_0x2373e0,null))[_0xc122('0x4d')](handleError(_0x2373e0,null));};exports[_0xc122('0x52')]=function(_0x3efcae,_0x458519){return db[_0xc122('0x33')][_0xc122('0x52')](_0x3efcae[_0xc122('0x53')],{})[_0xc122('0x2a')](function(_0x15662f){var _0x5a873b=_0x3efcae[_0xc122('0x54')][_0xc122('0x55')]({'plain':!![]});if(!_0x5a873b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a873b[_0xc122('0x56')]===_0xc122('0x54')){var _0x1ca004=_0x15662f[_0xc122('0x55')]({'plain':!![]});var _0x563f15=_0xc122('0x2c');return db['UserProfileSection'][_0xc122('0x51')]({'where':{'name':_0x563f15,'userProfileId':_0x5a873b[_0xc122('0x57')]},'raw':!![]})[_0xc122('0x2a')](function(_0xa88754){if(_0xa88754&&_0xa88754[_0xc122('0x58')]===0x0){return db['UserProfileResource'][_0xc122('0x52')]({'name':_0x1ca004[_0xc122('0x39')],'resourceId':_0x1ca004['id'],'type':_0xa88754['name'],'sectionId':_0xa88754['id']},{})['then'](function(){return _0x15662f;});}else{return _0x15662f;}})[_0xc122('0x4d')](function(_0x2f2621){logger[_0xc122('0x2e')](_0xc122('0x59'),_0x2f2621);throw _0x2f2621;});}return _0x15662f;})[_0xc122('0x2a')](respondWithResult(_0x458519,0xc9))[_0xc122('0x4d')](handleError(_0x458519,null));};exports[_0xc122('0x29')]=function(_0x4c229e,_0x410e30){if(_0x4c229e[_0xc122('0x53')]['id']){delete _0x4c229e[_0xc122('0x53')]['id'];}return db['OpenchannelQueue'][_0xc122('0x51')]({'where':{'id':_0x4c229e['params']['id']}})['then'](handleEntityNotFound(_0x410e30,null))[_0xc122('0x2a')](saveUpdates(_0x4c229e[_0xc122('0x53')],null))['then'](respondWithResult(_0x410e30,null))[_0xc122('0x4d')](handleError(_0x410e30,null));};exports[_0xc122('0x2b')]=function(_0x5a4c5a,_0x102aec){return db['OpenchannelQueue'][_0xc122('0x51')]({'where':{'id':_0x5a4c5a['params']['id']}})[_0xc122('0x2a')](handleEntityNotFound(_0x102aec,null))[_0xc122('0x2a')](removeEntity(_0x102aec,null))[_0xc122('0x4d')](handleError(_0x102aec,null));};exports[_0xc122('0x5a')]=function(_0x381dcf,_0x323ec9){return db['OpenchannelQueue']['describe']()[_0xc122('0x2a')](respondWithResult(_0x323ec9,null))['catch'](handleError(_0x323ec9,null));};exports[_0xc122('0x5b')]=function(_0x514413,_0x2d3b8e,_0x1a343d){var _0x52b123={'raw':!![],'where':{}},_0x4c7c27={},_0x36ed8b;return db[_0xc122('0x33')][_0xc122('0x5c')]({'where':{'id':_0x514413[_0xc122('0x4f')]['id']}})[_0xc122('0x2a')](handleEntityNotFound(_0x2d3b8e,null))[_0xc122('0x2a')](function(_0x31d809){if(_0x31d809){_0x36ed8b=_0x31d809['get']({'plain':!![]});_0x4c7c27['model']=_[_0xc122('0x3a')](db[_0xc122('0x5d')][_0xc122('0x34')]);_0x4c7c27['query']=_[_0xc122('0x3a')](_0x514413[_0xc122('0x3b')]);_0x4c7c27[_0xc122('0x3c')]=_['intersection'](_0x4c7c27[_0xc122('0x38')],_0x4c7c27[_0xc122('0x3b')]);_0x52b123[_0xc122('0x3e')]=_[_0xc122('0x3d')](_0x4c7c27[_0xc122('0x38')],qs[_0xc122('0x3f')](_0x514413[_0xc122('0x3b')][_0xc122('0x3f')]));_0x52b123[_0xc122('0x3e')]=_0x52b123[_0xc122('0x3e')][_0xc122('0x50')]?_0x52b123['attributes']:_0x4c7c27[_0xc122('0x38')];if(!_0x514413[_0xc122('0x3b')][_0xc122('0x40')]('nolimit')){_0x52b123['limit']=qs['limit'](_0x514413['query']['limit']);_0x52b123[_0xc122('0x21')]=qs[_0xc122('0x21')](_0x514413[_0xc122('0x3b')]['offset']);}_0x52b123['order']=qs['sort'](_0x514413[_0xc122('0x3b')][_0xc122('0x42')]);_0x52b123[_0xc122('0x43')]=qs[_0xc122('0x3c')](_[_0xc122('0x44')](_0x514413[_0xc122('0x3b')],_0x4c7c27[_0xc122('0x3c')]));_0x52b123[_0xc122('0x43')]['OpenchannelQueueId']=_0x31d809['id'];if(_0x514413['query']['filter']){_0x52b123[_0xc122('0x43')]=_[_0xc122('0x46')](_0x52b123[_0xc122('0x43')],{'$or':_[_0xc122('0x32')](_0x52b123['attributes'],function(_0x45d542){var _0x61522e={};_0x61522e[_0x45d542]={'$like':'%'+_0x514413[_0xc122('0x3b')]['filter']+'%'};return _0x61522e;})});}_0x52b123=_[_0xc122('0x46')]({},_0x52b123,_0x514413[_0xc122('0x48')]);return db[_0xc122('0x5d')][_0xc122('0x4b')](_0x52b123);}})[_0xc122('0x2a')](function(_0x2a9ed5){if(_0x2a9ed5){return db[_0xc122('0x5e')][_0xc122('0x5f')]({'where':{'id':_[_0xc122('0x32')](_0x2a9ed5,_0xc122('0x60')),'role':_0xc122('0x61')},'attributes':['id',_0xc122('0x39'),'openchannelPause',_0xc122('0x62'),'createdAt']});}})[_0xc122('0x2a')](function(_0x5cbd69){if(_0x5cbd69){return{'count':_0x5cbd69[_0xc122('0x24')],'rows':_[_0xc122('0x32')](_0x5cbd69[_0xc122('0x4c')],function(_0x24283d){return{'membername':_0x24283d[_0xc122('0x39')],'UserId':_0x24283d['id'],'queue_name':_0x36ed8b[_0xc122('0x39')],'OpenchannelQueueId':_0x36ed8b['id'],'interface':util[_0xc122('0x63')]('%s/%s',_0xc122('0x64'),_0x24283d[_0xc122('0x39')]),'penalty':0x0,'paused':_0x24283d[_0xc122('0x65')],'createdAt':_0x24283d[_0xc122('0x66')],'updatedAt':_0x24283d[_0xc122('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2d3b8e,_0x52b123))['catch'](handleError(_0x2d3b8e,null));};exports[_0xc122('0x67')]=function(_0x30c1a4,_0x45e0d5,_0x476dac){var _0x585f0d={};var _0x4da2bb={};var _0x27627f;var _0x206d12;return db[_0xc122('0x33')][_0xc122('0x5c')]({'where':{'id':_0x30c1a4[_0xc122('0x4f')]['id']}})[_0xc122('0x2a')](handleEntityNotFound(_0x45e0d5,null))['then'](function(_0x2117d6){if(_0x2117d6){_0x27627f=_0x2117d6;_0x4da2bb[_0xc122('0x38')]=_[_0xc122('0x3a')](db[_0xc122('0x68')][_0xc122('0x34')]);_0x4da2bb[_0xc122('0x3b')]=_[_0xc122('0x3a')](_0x30c1a4['query']);_0x4da2bb[_0xc122('0x3c')]=_[_0xc122('0x3d')](_0x4da2bb['model'],_0x4da2bb[_0xc122('0x3b')]);_0x585f0d[_0xc122('0x3e')]=_[_0xc122('0x3d')](_0x4da2bb['model'],qs['fields'](_0x30c1a4[_0xc122('0x3b')][_0xc122('0x3f')]));_0x585f0d[_0xc122('0x3e')]=_0x585f0d[_0xc122('0x3e')][_0xc122('0x50')]?_0x585f0d[_0xc122('0x3e')]:_0x4da2bb[_0xc122('0x38')];_0x585f0d[_0xc122('0x69')]=qs[_0xc122('0x42')](_0x30c1a4['query'][_0xc122('0x42')]);_0x585f0d['where']=qs[_0xc122('0x3c')](_[_0xc122('0x44')](_0x30c1a4[_0xc122('0x3b')],_0x4da2bb[_0xc122('0x3c')]));if(_0x30c1a4[_0xc122('0x3b')][_0xc122('0x45')]){_0x585f0d['where']=_[_0xc122('0x46')](_0x585f0d[_0xc122('0x43')],{'$or':_[_0xc122('0x32')](_0x585f0d[_0xc122('0x3e')],function(_0x4583c4){var _0x2ccab6={};_0x2ccab6[_0x4583c4]={'$like':'%'+_0x30c1a4[_0xc122('0x3b')][_0xc122('0x45')]+'%'};return _0x2ccab6;})});}_0x585f0d=_[_0xc122('0x46')]({},_0x585f0d,_0x30c1a4[_0xc122('0x48')]);return _0x27627f[_0xc122('0x67')](_0x585f0d);}})[_0xc122('0x2a')](function(_0x101bcb){if(_0x101bcb){_0x206d12=_0x101bcb[_0xc122('0x50')];if(!_0x30c1a4[_0xc122('0x3b')][_0xc122('0x40')]('nolimit')){_0x585f0d[_0xc122('0x23')]=qs[_0xc122('0x23')](_0x30c1a4[_0xc122('0x3b')]['limit']);_0x585f0d['offset']=qs[_0xc122('0x21')](_0x30c1a4['query'][_0xc122('0x21')]);}return _0x27627f[_0xc122('0x67')](_0x585f0d);}})[_0xc122('0x2a')](function(_0x2b8000){if(_0x2b8000){return _0x2b8000?{'count':_0x206d12,'rows':_0x2b8000}:null;}})[_0xc122('0x2a')](respondWithResult(_0x45e0d5,null))[_0xc122('0x4d')](handleError(_0x45e0d5,null));};exports[_0xc122('0x6a')]=function(_0x11a0b9,_0x16a853,_0x32ac59){var _0x270793=_0x11a0b9[_0xc122('0x53')][_0xc122('0x6b')];return db[_0xc122('0x68')][_0xc122('0x4b')]({'where':{'id':_0x270793},'attributes':['id'],'include':[{'model':db[_0xc122('0x5e')],'as':_0xc122('0x6c'),'attributes':['id',_0xc122('0x39'),_0xc122('0x6d'),_0xc122('0x6e'),'interface'],'raw':!![]}]})[_0xc122('0x2a')](function(_0x3d2cc1){if(_0x3d2cc1){var _0x1c5ec3=_[_0xc122('0x6f')](_0x3d2cc1,function(_0x6b1ff4){var _0x34b981=_0x6b1ff4[_0xc122('0x55')]({'plain':!![]});return _0x34b981[_0xc122('0x6c')];});return db[_0xc122('0x33')][_0xc122('0x51')]({'where':{'id':_0x11a0b9['params']['id']}})[_0xc122('0x2a')](function(_0x5559f5){return db[_0xc122('0x70')]['transaction'](function(_0x32971d){return _0x5559f5[_0xc122('0x6a')](_0x270793,{'transaction':_0x32971d})[_0xc122('0x2a')](function(){return BPromise[_0xc122('0x71')](_0x1c5ec3,function(_0x417fe8){return db['UserOpenchannelQueue'][_0xc122('0x72')]({'where':{'UserId':_0x417fe8['id'],'OpenchannelQueueId':_0x11a0b9[_0xc122('0x4f')]['id']},'transaction':_0x32971d});});})[_0xc122('0x2a')](function(){_0x1c5ec3[_0xc122('0x73')](function(_0x5bc64){socket[_0xc122('0x74')]('userOpenchannelQueue:save',{'UserId':_0x5bc64['id'],'OpenchannelQueueId':_0x5559f5['id']});});});});});}})['then'](respondWithStatusCode(_0x16a853,null))[_0xc122('0x4d')](handleError(_0x16a853,null));};exports[_0xc122('0x75')]=function(_0x1e0276,_0x493390,_0x1bcf1d){return db[_0xc122('0x68')][_0xc122('0x4b')]({'where':{'id':_0x1e0276['query'][_0xc122('0x6b')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x493390,null))[_0xc122('0x2a')](function(_0x2fcec9){var _0xb9c9e9=_[_0xc122('0x32')](_0x2fcec9,'id');var _0x2849f6=[];var _0x204398=[];var _0x35b9b0=squel[_0xc122('0x76')]();_0x35b9b0['field']('tq.TeamId')['from'](_0xc122('0x77'),'tq')['join'](_0xc122('0x78'),'ut',_0xc122('0x79'))['where'](_0xc122('0x7a'),_0x1e0276['params']['id']);for(var _0xf93afa=0x0;_0xf93afa<_0x2fcec9[_0xc122('0x50')];_0xf93afa+=0x1){let _0x13b8f6=_0x2fcec9[_0xf93afa];for(var _0x6d6dd0=0x0;_0x6d6dd0<_0x13b8f6[_0xc122('0x6c')][_0xc122('0x50')];_0x6d6dd0+=0x1){let _0xb38360=_0x13b8f6[_0xc122('0x6c')][_0x6d6dd0];var _0xf90cfb=_0x35b9b0[_0xc122('0x7b')]();_0xf90cfb[_0xc122('0x43')](_0xc122('0x7c'),_0xb38360['id']);_0x204398[_0xc122('0x7d')](db[_0xc122('0x70')][_0xc122('0x3b')](_0xf90cfb[_0xc122('0x7e')](),{'type':db[_0xc122('0x70')][_0xc122('0x7f')][_0xc122('0x80')]})[_0xc122('0x2a')](function(_0x564d49){if(_0x564d49['length']===0x1){return _0xb38360['id'];}else{var _0x3c5c8e=_[_0xc122('0x81')](_['map'](_0x564d49,_0xc122('0x82')),function(_0x4f4c17){return _['includes'](_0xb9c9e9,_0x4f4c17);});if(_0x3c5c8e){return _0xb38360['id'];}}}));}}return BPromise[_0xc122('0x83')](_0x204398)[_0xc122('0x2a')](function(_0x33b902){_0x2849f6=_(_0x2849f6)[_0xc122('0x84')](_0x33b902)[_0xc122('0x85')]()[_0xc122('0x86')]();return db[_0xc122('0x33')][_0xc122('0x51')]({'where':{'id':_0x1e0276[_0xc122('0x4f')]['id']}})[_0xc122('0x2a')](function(_0x15a218){return db['sequelize'][_0xc122('0x87')](function(_0x1475f2){return _0x15a218['removeTeams'](_0x1e0276[_0xc122('0x3b')]['ids'],{'transaction':_0x1475f2})[_0xc122('0x2a')](function(){if(!_[_0xc122('0x88')](_0x2849f6)){return _0x15a218[_0xc122('0x89')](_0x2849f6,{'transaction':_0x1475f2});}})[_0xc122('0x2a')](function(){_0x2849f6['forEach'](function(_0x686ba2){socket[_0xc122('0x74')](_0xc122('0x8a'),{'UserId':_0x686ba2,'OpenchannelQueueId':_0x15a218['id']});});});});});});})[_0xc122('0x2a')](respondWithStatusCode(_0x493390,null))[_0xc122('0x4d')](handleError(_0x493390,null));};exports['addAgents']=function(_0x41940e,_0x17c031,_0x29f137){return db[_0xc122('0x33')][_0xc122('0x51')]({'where':{'id':_0x41940e['params']['id']}})[_0xc122('0x2a')](handleEntityNotFound(_0x17c031,null))[_0xc122('0x2a')](function(_0x355a0b){if(_0x355a0b){return _0x355a0b[_0xc122('0x8b')](_0x41940e[_0xc122('0x53')][_0xc122('0x6b')],_['omit'](_0x41940e['body'],[_0xc122('0x6b'),'id'])||{})[_0xc122('0x8c')](function(_0x439f7e){for(var _0x1ffe58=0x0;_0x1ffe58<_0x41940e['body'][_0xc122('0x6b')]['length'];_0x1ffe58+=0x1){socket[_0xc122('0x74')](_0xc122('0x8d'),{'UserId':Number(_0x41940e['body'][_0xc122('0x6b')][_0x1ffe58]),'OpenchannelQueueId':Number(_0x41940e[_0xc122('0x4f')]['id'])});}return _0x439f7e;});}})[_0xc122('0x2a')](respondWithResult(_0x17c031,null))[_0xc122('0x4d')](handleError(_0x17c031,null));};exports[_0xc122('0x89')]=function(_0xc84d7,_0xf9b558,_0x13af2e){return db[_0xc122('0x33')]['find']({'where':{'id':_0xc84d7[_0xc122('0x4f')]['id']}})[_0xc122('0x2a')](handleEntityNotFound(_0xf9b558,null))[_0xc122('0x2a')](function(_0x3a76ff){if(_0x3a76ff){return _0x3a76ff[_0xc122('0x89')](_0xc84d7[_0xc122('0x3b')][_0xc122('0x6b')])[_0xc122('0x2a')](function(){if(_['isArray'](_0xc84d7[_0xc122('0x3b')][_0xc122('0x6b')])){for(var _0x695127=0x0;_0x695127<_0xc84d7[_0xc122('0x3b')]['ids']['length'];_0x695127+=0x1){socket['emit'](_0xc122('0x8a'),{'UserId':Number(_0xc84d7[_0xc122('0x3b')][_0xc122('0x6b')][_0x695127]),'OpenchannelQueueId':Number(_0xc84d7[_0xc122('0x4f')]['id'])});}}else{socket[_0xc122('0x74')](_0xc122('0x8a'),{'UserId':Number(_0xc84d7[_0xc122('0x3b')]['ids']),'OpenchannelQueueId':Number(_0xc84d7['params']['id'])});}});}})['then'](respondWithStatusCode(_0xf9b558,null))[_0xc122('0x4d')](handleError(_0xf9b558,null));};exports[_0xc122('0x8e')]=function(_0x591b72,_0x3490c0,_0x4ba12f){var _0x272698={};var _0x21463f={};var _0x52aabd;var _0x1bc3dc;return db[_0xc122('0x33')]['findOne']({'where':{'id':_0x591b72[_0xc122('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3490c0,null))[_0xc122('0x2a')](function(_0x4d7324){if(_0x4d7324){_0x52aabd=_0x4d7324;_0x21463f[_0xc122('0x38')]=_[_0xc122('0x3a')](db[_0xc122('0x5e')][_0xc122('0x34')]);_0x21463f[_0xc122('0x3b')]=_[_0xc122('0x3a')](_0x591b72[_0xc122('0x3b')]);_0x21463f[_0xc122('0x3c')]=_[_0xc122('0x3d')](_0x21463f['model'],_0x21463f[_0xc122('0x3b')]);_0x272698[_0xc122('0x3e')]=_[_0xc122('0x3d')](_0x21463f[_0xc122('0x38')],qs['fields'](_0x591b72[_0xc122('0x3b')][_0xc122('0x3f')]));_0x272698[_0xc122('0x3e')]=_0x272698[_0xc122('0x3e')]['length']?_0x272698[_0xc122('0x3e')]:_0x21463f['model'];_0x272698[_0xc122('0x69')]=qs['sort'](_0x591b72[_0xc122('0x3b')]['sort']);_0x272698[_0xc122('0x43')]=qs['filters'](_[_0xc122('0x44')](_0x591b72[_0xc122('0x3b')],_0x21463f[_0xc122('0x3c')]));if(_0x591b72['query']['filter']){_0x272698[_0xc122('0x43')]=_[_0xc122('0x46')](_0x272698[_0xc122('0x43')],{'$or':_[_0xc122('0x32')](_0x272698['attributes'],function(_0x17dae6){var _0x2d9f38={};_0x2d9f38[_0x17dae6]={'$like':'%'+_0x591b72[_0xc122('0x3b')][_0xc122('0x45')]+'%'};return _0x2d9f38;})});}_0x272698=_[_0xc122('0x46')]({},_0x272698,_0x591b72[_0xc122('0x48')]);return _0x52aabd[_0xc122('0x8e')](_0x272698);}})['then'](function(_0x4c5100){if(_0x4c5100){_0x1bc3dc=_0x4c5100[_0xc122('0x50')];if(!_0x591b72[_0xc122('0x3b')][_0xc122('0x40')](_0xc122('0x41'))){_0x272698[_0xc122('0x23')]=qs[_0xc122('0x23')](_0x591b72[_0xc122('0x3b')][_0xc122('0x23')]);_0x272698[_0xc122('0x21')]=qs[_0xc122('0x21')](_0x591b72[_0xc122('0x3b')][_0xc122('0x21')]);}return _0x52aabd[_0xc122('0x8e')](_0x272698);}})[_0xc122('0x2a')](function(_0x54e0d4){if(_0x54e0d4){return _0x54e0d4?{'count':_0x1bc3dc,'rows':_0x54e0d4}:null;}})[_0xc122('0x2a')](respondWithResult(_0x3490c0,null))['catch'](handleError(_0x3490c0,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 4079c31..e35b0e0 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 _0xd561=['hook','exports','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x55a9ec,_0x12af64){var _0x17ac84=function(_0xaefc48){while(--_0xaefc48){_0x55a9ec['push'](_0x55a9ec['shift']());}};_0x17ac84(++_0x12af64);}(_0xd561,0x1ec));var _0x1d56=function(_0x16bde9,_0x3036ee){_0x16bde9=_0x16bde9-0x0;var _0x40a506=_0xd561[_0x16bde9];return _0x40a506;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x1d56('0x0'))['db'][_0x1d56('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x1d56('0x2')](0x0);var events={'afterCreate':_0x1d56('0x3'),'afterUpdate':_0x1d56('0x4'),'afterDestroy':_0x1d56('0x5')};function emitEvent(_0x10e4b6){return function(_0x59751a,_0x4de7ee,_0x15c19b){OpenchannelQueueEvents[_0x1d56('0x6')](_0x10e4b6+':'+_0x59751a['id'],_0x59751a);OpenchannelQueueEvents['emit'](_0x10e4b6,_0x59751a);_0x15c19b(null);};}for(var e in events){if(events[_0x1d56('0x7')](e)){var event=events[e];OpenchannelQueue[_0x1d56('0x8')](e,emitEvent(event));}}module[_0x1d56('0x9')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xc285=['events','../../mysqldb','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x5bd7ea,_0xabc85f){var _0x40b84d=function(_0x156338){while(--_0x156338){_0x5bd7ea['push'](_0x5bd7ea['shift']());}};_0x40b84d(++_0xabc85f);}(_0xc285,0xd8));var _0x5c28=function(_0x1bc750,_0x23f442){_0x1bc750=_0x1bc750-0x0;var _0xcd51da=_0xc285[_0x1bc750];return _0xcd51da;};'use strict';var EventEmitter=require(_0x5c28('0x0'));var OpenchannelQueue=require(_0x5c28('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x5c28('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5c28('0x3'),'afterDestroy':'remove'};function emitEvent(_0xd72f18){return function(_0x3bf1de,_0x4f6468,_0xd2f679){OpenchannelQueueEvents[_0x5c28('0x4')](_0xd72f18+':'+_0x3bf1de['id'],_0x3bf1de);OpenchannelQueueEvents[_0x5c28('0x4')](_0xd72f18,_0x3bf1de);_0xd2f679(null);};}for(var e in events){if(events[_0x5c28('0x5')](e)){var event=events[e];OpenchannelQueue[_0x5c28('0x6')](e,emitEvent(event));}}module[_0x5c28('0x7')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 4c061fb..fe77de9 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 _0x9f1c=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9f1c,0x10a));var _0xc9f1=function(_0x16f021,_0x50aa14){_0x16f021=_0x16f021-0x0;var _0x4d0309=_0x9f1c[_0x16f021];return _0x4d0309;};'use strict';var _=require(_0xc9f1('0x0'));var util=require(_0xc9f1('0x1'));var logger=require(_0xc9f1('0x2'))(_0xc9f1('0x3'));var moment=require(_0xc9f1('0x4'));var BPromise=require('bluebird');var rp=require(_0xc9f1('0x5'));var fs=require('fs');var path=require(_0xc9f1('0x6'));var rimraf=require(_0xc9f1('0x7'));var config=require(_0xc9f1('0x8'));var attributes=require(_0xc9f1('0x9'));module[_0xc9f1('0xa')]=function(_0x4416b8,_0x15cf6f){return _0x4416b8[_0xc9f1('0xb')](_0xc9f1('0xc'),attributes,{'tableName':_0xc9f1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbbbb=['openchannel_queues','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./openchannelQueue.attributes','exports','define'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xbbbb,0xfd));var _0xbbbb=function(_0x1ca5b4,_0x315446){_0x1ca5b4=_0x1ca5b4-0x0;var _0x361c1a=_0xbbbb[_0x1ca5b4];return _0x361c1a;};'use strict';var _=require(_0xbbbb('0x0'));var util=require(_0xbbbb('0x1'));var logger=require(_0xbbbb('0x2'))(_0xbbbb('0x3'));var moment=require(_0xbbbb('0x4'));var BPromise=require('bluebird');var rp=require(_0xbbbb('0x5'));var fs=require('fs');var path=require(_0xbbbb('0x6'));var rimraf=require('rimraf');var config=require(_0xbbbb('0x7'));var attributes=require(_0xbbbb('0x8'));module[_0xbbbb('0x9')]=function(_0x466aae,_0x8d12ac){return _0x466aae[_0xbbbb('0xa')]('OpenchannelQueue',attributes,{'tableName':_0xbbbb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 66cf952..0985999 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 _0x7326=['message','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowOpenchannelQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x7326,0x176));var _0x6732=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x7326[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0x6732('0x0'));var util=require(_0x6732('0x1'));var moment=require(_0x6732('0x2'));var BPromise=require(_0x6732('0x3'));var rs=require(_0x6732('0x4'));var fs=require('fs');var Redis=require(_0x6732('0x5'));var db=require(_0x6732('0x6'))['db'];var utils=require(_0x6732('0x7'));var logger=require(_0x6732('0x8'))(_0x6732('0x9'));var config=require('../../config/environment');var jayson=require(_0x6732('0xa'));var client=jayson[_0x6732('0xb')][_0x6732('0xc')]({'port':0x232a});config[_0x6732('0xd')]=_[_0x6732('0xe')](config[_0x6732('0xd')],{'host':_0x6732('0xf'),'port':0x18eb});var socket=require(_0x6732('0x10'))(new Redis(config[_0x6732('0xd')]));require('./openchannelQueue.socket')[_0x6732('0x11')](socket);function respondWithRpcPromise(_0x4625c6,_0x307ce6,_0x5dc064){return new BPromise(function(_0x4611c9,_0x1f7f21){return client[_0x6732('0x12')](_0x4625c6,_0x5dc064)[_0x6732('0x13')](function(_0x15986c){logger[_0x6732('0x14')](_0x6732('0x15'),_0x307ce6,_0x6732('0x16'));logger['debug']('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x307ce6,'request\x20sent',JSON[_0x6732('0x17')](_0x15986c));if(_0x15986c['error']){if(_0x15986c[_0x6732('0x18')][_0x6732('0x19')]===0x1f4){logger[_0x6732('0x18')]('OpenchannelQueue,\x20%s,\x20%s',_0x307ce6,_0x15986c[_0x6732('0x18')][_0x6732('0x1a')]);return _0x1f7f21(_0x15986c['error'][_0x6732('0x1a')]);}logger[_0x6732('0x18')](_0x6732('0x15'),_0x307ce6,_0x15986c[_0x6732('0x18')][_0x6732('0x1a')]);return _0x4611c9(_0x15986c['error'][_0x6732('0x1a')]);}else{logger['info'](_0x6732('0x15'),_0x307ce6,_0x6732('0x16'));_0x4611c9(_0x15986c['result'][_0x6732('0x1a')]);}})[_0x6732('0x1b')](function(_0x209119){logger['error'](_0x6732('0x15'),_0x307ce6,_0x209119);_0x1f7f21(_0x209119);});});}exports[_0x6732('0x1c')]=function(_0x310b93){var _0xfbd3e3=this;return new Promise(function(_0x58b74b,_0x39727b){return db[_0x6732('0x1d')][_0x6732('0x1e')]({'raw':_0x310b93[_0x6732('0x1f')]?_0x310b93['options'][_0x6732('0x20')]===undefined?!![]:![]:!![],'where':_0x310b93[_0x6732('0x1f')]?_0x310b93[_0x6732('0x1f')][_0x6732('0x21')]||null:null,'attributes':_0x310b93[_0x6732('0x1f')]?_0x310b93[_0x6732('0x1f')][_0x6732('0x22')]||null:null,'limit':_0x310b93[_0x6732('0x1f')]?_0x310b93[_0x6732('0x1f')][_0x6732('0x23')]||null:null,'include':_0x310b93[_0x6732('0x1f')]?_0x310b93[_0x6732('0x1f')][_0x6732('0x24')]?_[_0x6732('0x25')](_0x310b93[_0x6732('0x1f')][_0x6732('0x24')],function(_0x399c14){return{'model':db[_0x399c14[_0x6732('0x26')]],'as':_0x399c14['as'],'attributes':_0x399c14[_0x6732('0x22')],'include':_0x399c14[_0x6732('0x24')]?_['map'](_0x399c14[_0x6732('0x24')],function(_0x4ed676){return{'model':db[_0x4ed676['model']],'as':_0x4ed676['as'],'attributes':_0x4ed676['attributes'],'include':_0x4ed676[_0x6732('0x24')]?_[_0x6732('0x25')](_0x4ed676[_0x6732('0x24')],function(_0x206554){return{'model':db[_0x206554[_0x6732('0x26')]],'as':_0x206554['as'],'attributes':_0x206554['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x59de88){logger[_0x6732('0x14')](_0x6732('0x1c'),_0x310b93);logger['debug'](_0x6732('0x1c'),_0x310b93,JSON['stringify'](_0x59de88));_0x58b74b(_0x59de88);})['catch'](function(_0x148f88){logger['error'](_0x6732('0x1c'),_0x148f88[_0x6732('0x1a')],_0x310b93);_0x39727b(_0xfbd3e3[_0x6732('0x18')](0x1f4,_0x148f88['message']));});});};exports[_0x6732('0x27')]=function(_0x394d26){var _0x268c78=this;return new Promise(function(_0x1f4535,_0x24fffd){return db[_0x6732('0x1d')]['find']({'raw':_0x394d26[_0x6732('0x1f')]?_0x394d26[_0x6732('0x1f')][_0x6732('0x20')]===undefined?!![]:![]:!![],'where':_0x394d26[_0x6732('0x1f')]?_0x394d26['options'][_0x6732('0x21')]||null:null,'attributes':_0x394d26[_0x6732('0x1f')]?_0x394d26[_0x6732('0x1f')][_0x6732('0x22')]||null:null,'include':_0x394d26[_0x6732('0x1f')]?_0x394d26['options'][_0x6732('0x24')]?_[_0x6732('0x25')](_0x394d26['options'][_0x6732('0x24')],function(_0x4031f0){return{'model':db[_0x4031f0['model']],'as':_0x4031f0['as'],'attributes':_0x4031f0[_0x6732('0x22')],'include':_0x4031f0[_0x6732('0x24')]?_[_0x6732('0x25')](_0x4031f0['include'],function(_0xf02d15){return{'model':db[_0xf02d15[_0x6732('0x26')]],'as':_0xf02d15['as'],'attributes':_0xf02d15[_0x6732('0x22')],'include':_0xf02d15[_0x6732('0x24')]?_[_0x6732('0x25')](_0xf02d15['include'],function(_0x5ee816){return{'model':db[_0x5ee816[_0x6732('0x26')]],'as':_0x5ee816['as'],'attributes':_0x5ee816[_0x6732('0x22')]};}):[]};}):[]};}):[]:[]})[_0x6732('0x13')](function(_0x4cb937){logger[_0x6732('0x14')](_0x6732('0x27'),_0x394d26);logger['debug'](_0x6732('0x27'),_0x394d26,JSON[_0x6732('0x17')](_0x4cb937));_0x1f4535(_0x4cb937);})['catch'](function(_0x53b006){logger['error'](_0x6732('0x27'),_0x53b006[_0x6732('0x1a')],_0x394d26);_0x24fffd(_0x268c78['error'](0x1f4,_0x53b006['message']));});});}; \ No newline at end of file +var _0x0155=['register','request','then','info','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','OpenchannelQueue,\x20%s,\x20%s','message','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','attributes','include','model','map','stringify','find','ShowOpenchannelQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket'];(function(_0x1daac8,_0x2e1db4){var _0x45b253=function(_0x523af5){while(--_0x523af5){_0x1daac8['push'](_0x1daac8['shift']());}};_0x45b253(++_0x2e1db4);}(_0x0155,0x158));var _0x5015=function(_0x4ff28a,_0x42164c){_0x4ff28a=_0x4ff28a-0x0;var _0x4ee5e4=_0x0155[_0x4ff28a];return _0x4ee5e4;};'use strict';var _=require(_0x5015('0x0'));var util=require(_0x5015('0x1'));var moment=require(_0x5015('0x2'));var BPromise=require(_0x5015('0x3'));var rs=require(_0x5015('0x4'));var fs=require('fs');var Redis=require(_0x5015('0x5'));var db=require(_0x5015('0x6'))['db'];var utils=require(_0x5015('0x7'));var logger=require(_0x5015('0x8'))('rpc');var config=require(_0x5015('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5015('0xa')]['http']({'port':0x232a});config[_0x5015('0xb')]=_[_0x5015('0xc')](config[_0x5015('0xb')],{'host':_0x5015('0xd'),'port':0x18eb});var socket=require(_0x5015('0xe'))(new Redis(config['redis']));require(_0x5015('0xf'))[_0x5015('0x10')](socket);function respondWithRpcPromise(_0x579394,_0x4420d9,_0x335046){return new BPromise(function(_0x203226,_0x587baa){return client[_0x5015('0x11')](_0x579394,_0x335046)[_0x5015('0x12')](function(_0x160d94){logger[_0x5015('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x4420d9,_0x5015('0x14'));logger[_0x5015('0x15')](_0x5015('0x16'),_0x4420d9,_0x5015('0x14'),JSON['stringify'](_0x160d94));if(_0x160d94[_0x5015('0x17')]){if(_0x160d94['error'][_0x5015('0x18')]===0x1f4){logger[_0x5015('0x17')](_0x5015('0x19'),_0x4420d9,_0x160d94[_0x5015('0x17')][_0x5015('0x1a')]);return _0x587baa(_0x160d94[_0x5015('0x17')]['message']);}logger[_0x5015('0x17')]('OpenchannelQueue,\x20%s,\x20%s',_0x4420d9,_0x160d94[_0x5015('0x17')]['message']);return _0x203226(_0x160d94[_0x5015('0x17')]['message']);}else{logger[_0x5015('0x13')](_0x5015('0x19'),_0x4420d9,'request\x20sent');_0x203226(_0x160d94['result']['message']);}})[_0x5015('0x1b')](function(_0x52b6f6){logger[_0x5015('0x17')]('OpenchannelQueue,\x20%s,\x20%s',_0x4420d9,_0x52b6f6);_0x587baa(_0x52b6f6);});});}exports[_0x5015('0x1c')]=function(_0xc72771){var _0x389f0a=this;return new Promise(function(_0xba411c,_0x1e0313){return db[_0x5015('0x1d')][_0x5015('0x1e')]({'raw':_0xc72771[_0x5015('0x1f')]?_0xc72771[_0x5015('0x1f')][_0x5015('0x20')]===undefined?!![]:![]:!![],'where':_0xc72771[_0x5015('0x1f')]?_0xc72771['options']['where']||null:null,'attributes':_0xc72771[_0x5015('0x1f')]?_0xc72771[_0x5015('0x1f')][_0x5015('0x21')]||null:null,'limit':_0xc72771[_0x5015('0x1f')]?_0xc72771[_0x5015('0x1f')]['limit']||null:null,'include':_0xc72771[_0x5015('0x1f')]?_0xc72771[_0x5015('0x1f')][_0x5015('0x22')]?_['map'](_0xc72771[_0x5015('0x1f')]['include'],function(_0x558b39){return{'model':db[_0x558b39[_0x5015('0x23')]],'as':_0x558b39['as'],'attributes':_0x558b39['attributes'],'include':_0x558b39[_0x5015('0x22')]?_[_0x5015('0x24')](_0x558b39[_0x5015('0x22')],function(_0x53b30d){return{'model':db[_0x53b30d[_0x5015('0x23')]],'as':_0x53b30d['as'],'attributes':_0x53b30d['attributes'],'include':_0x53b30d[_0x5015('0x22')]?_[_0x5015('0x24')](_0x53b30d[_0x5015('0x22')],function(_0x2012ae){return{'model':db[_0x2012ae[_0x5015('0x23')]],'as':_0x2012ae['as'],'attributes':_0x2012ae[_0x5015('0x21')]};}):[]};}):[]};}):[]:[]})[_0x5015('0x12')](function(_0x5b6f4d){logger[_0x5015('0x13')](_0x5015('0x1c'),_0xc72771);logger[_0x5015('0x15')]('GetOpenchannelQueue',_0xc72771,JSON[_0x5015('0x25')](_0x5b6f4d));_0xba411c(_0x5b6f4d);})[_0x5015('0x1b')](function(_0x18f4e1){logger['error'](_0x5015('0x1c'),_0x18f4e1[_0x5015('0x1a')],_0xc72771);_0x1e0313(_0x389f0a[_0x5015('0x17')](0x1f4,_0x18f4e1[_0x5015('0x1a')]));});});};exports['ShowOpenchannelQueue']=function(_0x1e931f){var _0x170ced=this;return new Promise(function(_0x10578c,_0x16234a){return db[_0x5015('0x1d')][_0x5015('0x26')]({'raw':_0x1e931f['options']?_0x1e931f['options'][_0x5015('0x20')]===undefined?!![]:![]:!![],'where':_0x1e931f[_0x5015('0x1f')]?_0x1e931f['options']['where']||null:null,'attributes':_0x1e931f['options']?_0x1e931f[_0x5015('0x1f')][_0x5015('0x21')]||null:null,'include':_0x1e931f[_0x5015('0x1f')]?_0x1e931f[_0x5015('0x1f')]['include']?_[_0x5015('0x24')](_0x1e931f[_0x5015('0x1f')][_0x5015('0x22')],function(_0x3377d6){return{'model':db[_0x3377d6[_0x5015('0x23')]],'as':_0x3377d6['as'],'attributes':_0x3377d6[_0x5015('0x21')],'include':_0x3377d6['include']?_['map'](_0x3377d6[_0x5015('0x22')],function(_0x147ecb){return{'model':db[_0x147ecb['model']],'as':_0x147ecb['as'],'attributes':_0x147ecb[_0x5015('0x21')],'include':_0x147ecb[_0x5015('0x22')]?_[_0x5015('0x24')](_0x147ecb[_0x5015('0x22')],function(_0x89900b){return{'model':db[_0x89900b[_0x5015('0x23')]],'as':_0x89900b['as'],'attributes':_0x89900b[_0x5015('0x21')]};}):[]};}):[]};}):[]:[]})[_0x5015('0x12')](function(_0x3d1437){logger[_0x5015('0x13')](_0x5015('0x27'),_0x1e931f);logger[_0x5015('0x15')]('ShowOpenchannelQueue',_0x1e931f,JSON[_0x5015('0x25')](_0x3d1437));_0x10578c(_0x3d1437);})[_0x5015('0x1b')](function(_0x4d664b){logger[_0x5015('0x17')](_0x5015('0x27'),_0x4d664b['message'],_0x1e931f);_0x16234a(_0x170ced[_0x5015('0x17')](0x1f4,_0x4d664b[_0x5015('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 9ecddee..f3f647c 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 _0xe900=['length','./openchannelQueue.events','save','update','emit','removeListener','register'];(function(_0x1616cd,_0x35f1da){var _0x101e2e=function(_0x3dc338){while(--_0x3dc338){_0x1616cd['push'](_0x1616cd['shift']());}};_0x101e2e(++_0x35f1da);}(_0xe900,0xfd));var _0x0e90=function(_0x2413e0,_0x31ec2f){_0x2413e0=_0x2413e0-0x0;var _0x479323=_0xe900[_0x2413e0];return _0x479323;};'use strict';var OpenchannelQueueEvents=require(_0x0e90('0x0'));var events=[_0x0e90('0x1'),'remove',_0x0e90('0x2')];function createListener(_0x2561d8,_0x3343b1){return function(_0x5a795e){_0x3343b1[_0x0e90('0x3')](_0x2561d8,_0x5a795e);};}function removeListener(_0x19cf6c,_0x2640b3){return function(){OpenchannelQueueEvents[_0x0e90('0x4')](_0x19cf6c,_0x2640b3);};}exports[_0x0e90('0x5')]=function(_0x17344a){for(var _0x4f4106=0x0,_0x1673bf=events[_0x0e90('0x6')];_0x4f4106<_0x1673bf;_0x4f4106++){var _0x599702=events[_0x4f4106];var _0x29d410=createListener('openchannelQueue:'+_0x599702,_0x17344a);OpenchannelQueueEvents['on'](_0x599702,_0x29d410);}}; \ No newline at end of file +var _0x69a2=['openchannelQueue:','./openchannelQueue.events','remove','update','emit','removeListener','register','length'];(function(_0x177fb8,_0x41bb55){var _0xa52dc2=function(_0x421c8f){while(--_0x421c8f){_0x177fb8['push'](_0x177fb8['shift']());}};_0xa52dc2(++_0x41bb55);}(_0x69a2,0x1a1));var _0x269a=function(_0x281d47,_0x3aef47){_0x281d47=_0x281d47-0x0;var _0x396c51=_0x69a2[_0x281d47];return _0x396c51;};'use strict';var OpenchannelQueueEvents=require(_0x269a('0x0'));var events=['save',_0x269a('0x1'),_0x269a('0x2')];function createListener(_0x4345dc,_0x3481b2){return function(_0x4ed938){_0x3481b2[_0x269a('0x3')](_0x4345dc,_0x4ed938);};}function removeListener(_0x4729eb,_0x2a1630){return function(){OpenchannelQueueEvents[_0x269a('0x4')](_0x4729eb,_0x2a1630);};}exports[_0x269a('0x5')]=function(_0x20f512){for(var _0x592a71=0x0,_0x26392f=events[_0x269a('0x6')];_0x592a71<_0x26392f;_0x592a71++){var _0x3d2d60=events[_0x592a71];var _0x12003a=createListener(_0x269a('0x7')+_0x3d2d60,_0x20f512);OpenchannelQueueEvents['on'](_0x3d2d60,_0x12003a);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 520de3f..816e464 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 _0xbd90=['put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueueReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x3cb52a,_0x5a586d){var _0x4e6bab=function(_0xd38f5){while(--_0xd38f5){_0x3cb52a['push'](_0x3cb52a['shift']());}};_0x4e6bab(++_0x5a586d);}(_0xbd90,0x1a6));var _0x0bd9=function(_0x4fd264,_0x152758){_0x4fd264=_0x4fd264-0x0;var _0x1903ff=_0xbd90[_0x4fd264];return _0x1903ff;};'use strict';var multer=require(_0x0bd9('0x0'));var util=require(_0x0bd9('0x1'));var path=require(_0x0bd9('0x2'));var timeout=require(_0x0bd9('0x3'));var express=require(_0x0bd9('0x4'));var router=express['Router']();var fs_extra=require(_0x0bd9('0x5'));var auth=require(_0x0bd9('0x6'));var interaction=require(_0x0bd9('0x7'));var config=require('../../config/environment');var controller=require(_0x0bd9('0x8'));router[_0x0bd9('0x9')]('/',auth[_0x0bd9('0xa')](),controller['index']);router[_0x0bd9('0x9')](_0x0bd9('0xb'),auth[_0x0bd9('0xa')](),controller['describe']);router[_0x0bd9('0x9')](_0x0bd9('0xc'),auth[_0x0bd9('0xa')](),controller['show']);router[_0x0bd9('0xd')]('/',auth[_0x0bd9('0xa')](),controller[_0x0bd9('0xe')]);router[_0x0bd9('0xf')](_0x0bd9('0xc'),auth[_0x0bd9('0xa')](),controller[_0x0bd9('0x10')]);router[_0x0bd9('0x11')]('/:id',auth[_0x0bd9('0xa')](),controller[_0x0bd9('0x12')]);module['exports']=router; \ No newline at end of file +var _0x1de8=['isAuthenticated','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueueReport.controller','get','describe','show','post'];(function(_0x2a098b,_0x190126){var _0x47397c=function(_0x555e0f){while(--_0x555e0f){_0x2a098b['push'](_0x2a098b['shift']());}};_0x47397c(++_0x190126);}(_0x1de8,0x118));var _0x81de=function(_0x368e09,_0x2c1517){_0x368e09=_0x368e09-0x0;var _0x14b7df=_0x1de8[_0x368e09];return _0x14b7df;};'use strict';var multer=require(_0x81de('0x0'));var util=require(_0x81de('0x1'));var path=require(_0x81de('0x2'));var timeout=require(_0x81de('0x3'));var express=require(_0x81de('0x4'));var router=express[_0x81de('0x5')]();var fs_extra=require(_0x81de('0x6'));var auth=require(_0x81de('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x81de('0x8'));var controller=require(_0x81de('0x9'));router[_0x81de('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x81de('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x81de('0xb')]);router[_0x81de('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x81de('0xc')]);router[_0x81de('0xd')]('/',auth[_0x81de('0xe')](),controller[_0x81de('0xf')]);router[_0x81de('0x10')](_0x81de('0x11'),auth[_0x81de('0xe')](),controller['update']);router[_0x81de('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x81de('0x13')]);module[_0x81de('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 1399327..90f8a81 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 _0x4b5f=['sequelize','exports','STRING','DATE','moment'];(function(_0x3a97bb,_0x5b45da){var _0x3ec89d=function(_0x16d947){while(--_0x16d947){_0x3a97bb['push'](_0x3a97bb['shift']());}};_0x3ec89d(++_0x5b45da);}(_0x4b5f,0x81));var _0xf4b5=function(_0x3167a8,_0x4d5006){_0x3167a8=_0x3167a8-0x0;var _0x20073f=_0x4b5f[_0x3167a8];return _0x20073f;};'use strict';var moment=require(_0xf4b5('0x0'));var Sequelize=require(_0xf4b5('0x1'));module[_0xf4b5('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xf4b5('0x3')]},'joinAt':{'type':Sequelize[_0xf4b5('0x4')]},'leaveAt':{'type':Sequelize[_0xf4b5('0x4')]},'acceptAt':{'type':Sequelize[_0xf4b5('0x4')]},'exitAt':{'type':Sequelize[_0xf4b5('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe1b1=['sequelize','exports','DATE','STRING'];(function(_0x3ec4e3,_0x15aab4){var _0x38ee8c=function(_0x439303){while(--_0x439303){_0x3ec4e3['push'](_0x3ec4e3['shift']());}};_0x38ee8c(++_0x15aab4);}(_0xe1b1,0x138));var _0x1e1b=function(_0x12315b,_0x42c96c){_0x12315b=_0x12315b-0x0;var _0x39eb7a=_0xe1b1[_0x12315b];return _0x39eb7a;};'use strict';var moment=require('moment');var Sequelize=require(_0x1e1b('0x0'));module[_0x1e1b('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x1e1b('0x2')]},'leaveAt':{'type':Sequelize[_0x1e1b('0x2')]},'acceptAt':{'type':Sequelize[_0x1e1b('0x2')]},'exitAt':{'type':Sequelize[_0x1e1b('0x2')]},'reason':{'type':Sequelize[_0x1e1b('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index acb693d..b435f51 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 _0x1b5c=['end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','OpenchannelQueueReport','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x1b5c,0x1a7));var _0xc1b5=function(_0x27a3cb,_0x4af597){_0x27a3cb=_0x27a3cb-0x0;var _0x54ff38=_0x1b5c[_0x27a3cb];return _0x54ff38;};'use strict';var emlformat=require(_0xc1b5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc1b5('0x1'));var jsonpatch=require(_0xc1b5('0x2'));var rp=require(_0xc1b5('0x3'));var moment=require(_0xc1b5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc1b5('0x5'));var util=require(_0xc1b5('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xc1b5('0x7'));var ejs=require(_0xc1b5('0x8'));var fs=require('fs');var fs_extra=require(_0xc1b5('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc1b5('0xa'));var jsforce=require(_0xc1b5('0xb'));var deskjs=require(_0xc1b5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xc1b5('0xd'));var Papa=require('papaparse');var Redis=require(_0xc1b5('0xe'));var authService=require(_0xc1b5('0xf'));var qs=require(_0xc1b5('0x10'));var as=require(_0xc1b5('0x11'));var hardwareService=require(_0xc1b5('0x12'));var logger=require(_0xc1b5('0x13'))(_0xc1b5('0x14'));var utils=require(_0xc1b5('0x15'));var config=require(_0xc1b5('0x16'));var licenseUtil=require(_0xc1b5('0x17'));var db=require(_0xc1b5('0x18'))['db'];function respondWithStatusCode(_0x1a41dd,_0x4e64be){_0x4e64be=_0x4e64be||0xcc;return function(_0x2350f6){if(_0x2350f6){return _0x1a41dd[_0xc1b5('0x19')](_0x4e64be);}return _0x1a41dd[_0xc1b5('0x1a')](_0x4e64be)[_0xc1b5('0x1b')]();};}function respondWithResult(_0x27c215,_0x40b964){_0x40b964=_0x40b964||0xc8;return function(_0x4862dd){if(_0x4862dd){return _0x27c215[_0xc1b5('0x1a')](_0x40b964)[_0xc1b5('0x1c')](_0x4862dd);}};}function respondWithFilteredResult(_0x314143,_0x5aeb39){return function(_0x1236f2){if(_0x1236f2){var _0x118245=typeof _0x5aeb39[_0xc1b5('0x1d')]===_0xc1b5('0x1e')&&typeof _0x5aeb39[_0xc1b5('0x1f')]===_0xc1b5('0x1e');var _0x53244a=_0x1236f2[_0xc1b5('0x20')];var _0x68476e=_0x118245?0x0:_0x5aeb39[_0xc1b5('0x1d')];var _0x515a3f=_0x118245?_0x1236f2[_0xc1b5('0x20')]:_0x5aeb39[_0xc1b5('0x1d')]+_0x5aeb39[_0xc1b5('0x1f')];var _0x5f3fd5;if(_0x515a3f>=_0x53244a){_0x515a3f=_0x53244a;_0x5f3fd5=0xc8;}else{_0x5f3fd5=0xce;}_0x314143[_0xc1b5('0x1a')](_0x5f3fd5);return _0x314143['set'](_0xc1b5('0x21'),_0x68476e+'-'+_0x515a3f+'/'+_0x53244a)[_0xc1b5('0x1c')](_0x1236f2);}return null;};}function patchUpdates(_0x5ebf5b){return function(_0x51e4e9){try{jsonpatch[_0xc1b5('0x22')](_0x51e4e9,_0x5ebf5b,!![]);}catch(_0x52f3cc){return BPromise[_0xc1b5('0x23')](_0x52f3cc);}return _0x51e4e9[_0xc1b5('0x24')]();};}function saveUpdates(_0x59dc52,_0x2be76a){return function(_0x36305d){if(_0x36305d){return _0x36305d[_0xc1b5('0x25')](_0x59dc52)[_0xc1b5('0x26')](function(_0x5690b5){return _0x5690b5;});}return null;};}function removeEntity(_0x3a2b0f,_0x5324de){return function(_0x45b65f){if(_0x45b65f){return _0x45b65f[_0xc1b5('0x27')]()[_0xc1b5('0x26')](function(){_0x3a2b0f[_0xc1b5('0x1a')](0xcc)[_0xc1b5('0x1b')]();});}};}function handleEntityNotFound(_0x2c997d,_0xe8e125){return function(_0x34b9c0){if(!_0x34b9c0){_0x2c997d[_0xc1b5('0x19')](0x194);}return _0x34b9c0;};}function handleError(_0x1688d6,_0x1f7a74){_0x1f7a74=_0x1f7a74||0x1f4;return function(_0x4def7e){logger[_0xc1b5('0x28')](_0x4def7e[_0xc1b5('0x29')]);if(_0x4def7e[_0xc1b5('0x2a')]){delete _0x4def7e[_0xc1b5('0x2a')];}_0x1688d6[_0xc1b5('0x1a')](_0x1f7a74)['send'](_0x4def7e);};}exports[_0xc1b5('0x2b')]=function(_0x343b06,_0x4aacda){var _0x3750b8={},_0x366fc4={},_0x30e836={'count':0x0,'rows':[]};var _0x29ecef=_['map'](db[_0xc1b5('0x2c')][_0xc1b5('0x2d')],function(_0xfcf358){return{'name':_0xfcf358[_0xc1b5('0x2e')],'type':_0xfcf358[_0xc1b5('0x2f')]['key']};});_0x366fc4['model']=_['map'](_0x29ecef,_0xc1b5('0x2a'));_0x366fc4['query']=_[_0xc1b5('0x30')](_0x343b06[_0xc1b5('0x31')]);_0x366fc4[_0xc1b5('0x32')]=_[_0xc1b5('0x33')](_0x366fc4[_0xc1b5('0x34')],_0x366fc4[_0xc1b5('0x31')]);_0x3750b8[_0xc1b5('0x35')]=_[_0xc1b5('0x33')](_0x366fc4['model'],qs[_0xc1b5('0x36')](_0x343b06[_0xc1b5('0x31')][_0xc1b5('0x36')]));_0x3750b8[_0xc1b5('0x35')]=_0x3750b8[_0xc1b5('0x35')]['length']?_0x3750b8['attributes']:_0x366fc4[_0xc1b5('0x34')];if(!_0x343b06[_0xc1b5('0x31')]['hasOwnProperty'](_0xc1b5('0x37'))){_0x3750b8[_0xc1b5('0x1f')]=qs['limit'](_0x343b06[_0xc1b5('0x31')]['limit']);_0x3750b8[_0xc1b5('0x1d')]=qs[_0xc1b5('0x1d')](_0x343b06[_0xc1b5('0x31')]['offset']);}_0x3750b8[_0xc1b5('0x38')]=qs['sort'](_0x343b06['query'][_0xc1b5('0x39')]);_0x3750b8[_0xc1b5('0x3a')]=qs[_0xc1b5('0x32')](_[_0xc1b5('0x3b')](_0x343b06[_0xc1b5('0x31')],_0x366fc4[_0xc1b5('0x32')]),_0x29ecef);if(_0x343b06['query'][_0xc1b5('0x3c')]){_0x3750b8[_0xc1b5('0x3a')]=_[_0xc1b5('0x3d')](_0x3750b8[_0xc1b5('0x3a')],{'$or':_['map'](_0x29ecef,function(_0x209389){if(_0x209389['type']!==_0xc1b5('0x3e')){var _0x441c34={};_0x441c34[_0x209389[_0xc1b5('0x2a')]]={'$like':'%'+_0x343b06[_0xc1b5('0x31')][_0xc1b5('0x3c')]+'%'};return _0x441c34;}})});}_0x3750b8=_[_0xc1b5('0x3d')]({},_0x3750b8,_0x343b06[_0xc1b5('0x3f')]);var _0x1b5306={'where':_0x3750b8[_0xc1b5('0x3a')]};return db[_0xc1b5('0x2c')][_0xc1b5('0x20')](_0x1b5306)[_0xc1b5('0x26')](function(_0x991b6){_0x30e836[_0xc1b5('0x20')]=_0x991b6;if(_0x343b06[_0xc1b5('0x31')][_0xc1b5('0x40')]){_0x3750b8[_0xc1b5('0x41')]=[{'all':!![]}];}return db[_0xc1b5('0x2c')][_0xc1b5('0x42')](_0x3750b8);})[_0xc1b5('0x26')](function(_0x5cc83b){_0x30e836[_0xc1b5('0x43')]=_0x5cc83b;return _0x30e836;})['then'](respondWithFilteredResult(_0x4aacda,_0x3750b8))[_0xc1b5('0x44')](handleError(_0x4aacda,null));};exports[_0xc1b5('0x45')]=function(_0x519893,_0x567f05){var _0x25f619={'raw':!![],'where':{'id':_0x519893[_0xc1b5('0x46')]['id']}},_0x3fce1b={};_0x3fce1b[_0xc1b5('0x34')]=_[_0xc1b5('0x30')](db['OpenchannelQueueReport'][_0xc1b5('0x2d')]);_0x3fce1b['query']=_['keys'](_0x519893[_0xc1b5('0x31')]);_0x3fce1b[_0xc1b5('0x32')]=_[_0xc1b5('0x33')](_0x3fce1b['model'],_0x3fce1b[_0xc1b5('0x31')]);_0x25f619['attributes']=_[_0xc1b5('0x33')](_0x3fce1b[_0xc1b5('0x34')],qs[_0xc1b5('0x36')](_0x519893['query'][_0xc1b5('0x36')]));_0x25f619['attributes']=_0x25f619[_0xc1b5('0x35')]['length']?_0x25f619[_0xc1b5('0x35')]:_0x3fce1b[_0xc1b5('0x34')];if(_0x519893['query'][_0xc1b5('0x40')]){_0x25f619[_0xc1b5('0x41')]=[{'all':!![]}];}_0x25f619=_[_0xc1b5('0x3d')]({},_0x25f619,_0x519893[_0xc1b5('0x3f')]);return db[_0xc1b5('0x2c')]['find'](_0x25f619)[_0xc1b5('0x26')](handleEntityNotFound(_0x567f05,null))['then'](respondWithResult(_0x567f05,null))[_0xc1b5('0x44')](handleError(_0x567f05,null));};exports[_0xc1b5('0x47')]=function(_0x1d5ac0,_0x4562e1){return db[_0xc1b5('0x2c')][_0xc1b5('0x47')](_0x1d5ac0[_0xc1b5('0x48')],{})[_0xc1b5('0x26')](respondWithResult(_0x4562e1,0xc9))[_0xc1b5('0x44')](handleError(_0x4562e1,null));};exports[_0xc1b5('0x25')]=function(_0x1ac3af,_0x5118d5){if(_0x1ac3af['body']['id']){delete _0x1ac3af['body']['id'];}return db[_0xc1b5('0x2c')][_0xc1b5('0x49')]({'where':{'id':_0x1ac3af[_0xc1b5('0x46')]['id']}})['then'](handleEntityNotFound(_0x5118d5,null))[_0xc1b5('0x26')](saveUpdates(_0x1ac3af[_0xc1b5('0x48')],null))[_0xc1b5('0x26')](respondWithResult(_0x5118d5,null))[_0xc1b5('0x44')](handleError(_0x5118d5,null));};exports[_0xc1b5('0x27')]=function(_0x4992e9,_0x4ae0d1){return db[_0xc1b5('0x2c')]['find']({'where':{'id':_0x4992e9[_0xc1b5('0x46')]['id']}})[_0xc1b5('0x26')](handleEntityNotFound(_0x4ae0d1,null))[_0xc1b5('0x26')](removeEntity(_0x4ae0d1,null))['catch'](handleError(_0x4ae0d1,null));};exports[_0xc1b5('0x4a')]=function(_0xb2fe68,_0x256bfb){return db[_0xc1b5('0x2c')][_0xc1b5('0x4a')]()[_0xc1b5('0x26')](respondWithResult(_0x256bfb,null))[_0xc1b5('0x44')](handleError(_0x256bfb,null));}; \ No newline at end of file +var _0x1291=['send','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','pick','where','merge','filter','includeAll','include','findAll','rows','catch','show','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','limit','undefined','offset','count','set','apply','save','update','then','destroy','end','error','stack','name'];(function(_0x20a74e,_0x26c09d){var _0x513e0f=function(_0x4abe92){while(--_0x4abe92){_0x20a74e['push'](_0x20a74e['shift']());}};_0x513e0f(++_0x26c09d);}(_0x1291,0x140));var _0x1129=function(_0x264971,_0xebef3a){_0x264971=_0x264971-0x0;var _0x211ce1=_0x1291[_0x264971];return _0x211ce1;};'use strict';var emlformat=require(_0x1129('0x0'));var rimraf=require(_0x1129('0x1'));var zipdir=require(_0x1129('0x2'));var jsonpatch=require(_0x1129('0x3'));var rp=require(_0x1129('0x4'));var moment=require(_0x1129('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1129('0x6'));var path=require('path');var sox=require(_0x1129('0x7'));var csv=require(_0x1129('0x8'));var ejs=require(_0x1129('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1129('0xa'));var squel=require(_0x1129('0xb'));var crypto=require(_0x1129('0xc'));var jsforce=require(_0x1129('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1129('0x8'));var querystring=require(_0x1129('0xe'));var Papa=require(_0x1129('0xf'));var Redis=require(_0x1129('0x10'));var authService=require(_0x1129('0x11'));var qs=require(_0x1129('0x12'));var as=require(_0x1129('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1129('0x14'));var utils=require('../../config/utils');var config=require(_0x1129('0x15'));var licenseUtil=require(_0x1129('0x16'));var db=require(_0x1129('0x17'))['db'];function respondWithStatusCode(_0x3782b4,_0x1defe7){_0x1defe7=_0x1defe7||0xcc;return function(_0x2e284a){if(_0x2e284a){return _0x3782b4['sendStatus'](_0x1defe7);}return _0x3782b4[_0x1129('0x18')](_0x1defe7)['end']();};}function respondWithResult(_0x236fb6,_0x4a56f8){_0x4a56f8=_0x4a56f8||0xc8;return function(_0x1ef165){if(_0x1ef165){return _0x236fb6[_0x1129('0x18')](_0x4a56f8)[_0x1129('0x19')](_0x1ef165);}};}function respondWithFilteredResult(_0x49a994,_0x690b9){return function(_0x51b1f0){if(_0x51b1f0){var _0x5de13d=typeof _0x690b9['offset']==='undefined'&&typeof _0x690b9[_0x1129('0x1a')]===_0x1129('0x1b');var _0xf4672b=_0x51b1f0['count'];var _0x3719ea=_0x5de13d?0x0:_0x690b9[_0x1129('0x1c')];var _0x18da24=_0x5de13d?_0x51b1f0[_0x1129('0x1d')]:_0x690b9[_0x1129('0x1c')]+_0x690b9[_0x1129('0x1a')];var _0x538ff8;if(_0x18da24>=_0xf4672b){_0x18da24=_0xf4672b;_0x538ff8=0xc8;}else{_0x538ff8=0xce;}_0x49a994['status'](_0x538ff8);return _0x49a994[_0x1129('0x1e')]('Content-Range',_0x3719ea+'-'+_0x18da24+'/'+_0xf4672b)['json'](_0x51b1f0);}return null;};}function patchUpdates(_0xf43126){return function(_0x4f2dc3){try{jsonpatch[_0x1129('0x1f')](_0x4f2dc3,_0xf43126,!![]);}catch(_0xeee423){return BPromise['reject'](_0xeee423);}return _0x4f2dc3[_0x1129('0x20')]();};}function saveUpdates(_0x2c5359,_0x2df8ce){return function(_0x36e929){if(_0x36e929){return _0x36e929[_0x1129('0x21')](_0x2c5359)[_0x1129('0x22')](function(_0x2a2b21){return _0x2a2b21;});}return null;};}function removeEntity(_0x5814b1,_0x37e212){return function(_0x3c959a){if(_0x3c959a){return _0x3c959a[_0x1129('0x23')]()[_0x1129('0x22')](function(){_0x5814b1['status'](0xcc)[_0x1129('0x24')]();});}};}function handleEntityNotFound(_0x37c75d,_0x24ecb1){return function(_0x30233b){if(!_0x30233b){_0x37c75d['sendStatus'](0x194);}return _0x30233b;};}function handleError(_0x9409e0,_0x2e3b6e){_0x2e3b6e=_0x2e3b6e||0x1f4;return function(_0x325694){logger[_0x1129('0x25')](_0x325694[_0x1129('0x26')]);if(_0x325694[_0x1129('0x27')]){delete _0x325694[_0x1129('0x27')];}_0x9409e0[_0x1129('0x18')](_0x2e3b6e)[_0x1129('0x28')](_0x325694);};}exports['index']=function(_0x268f8f,_0x5e655c){var _0x1f64be={},_0x5b2113={},_0x135b7e={'count':0x0,'rows':[]};var _0x54c98d=_[_0x1129('0x29')](db[_0x1129('0x2a')][_0x1129('0x2b')],function(_0x222de4){return{'name':_0x222de4[_0x1129('0x2c')],'type':_0x222de4[_0x1129('0x2d')][_0x1129('0x2e')]};});_0x5b2113[_0x1129('0x2f')]=_[_0x1129('0x29')](_0x54c98d,_0x1129('0x27'));_0x5b2113[_0x1129('0x30')]=_[_0x1129('0x31')](_0x268f8f[_0x1129('0x30')]);_0x5b2113[_0x1129('0x32')]=_[_0x1129('0x33')](_0x5b2113[_0x1129('0x2f')],_0x5b2113['query']);_0x1f64be[_0x1129('0x34')]=_[_0x1129('0x33')](_0x5b2113[_0x1129('0x2f')],qs[_0x1129('0x35')](_0x268f8f[_0x1129('0x30')]['fields']));_0x1f64be[_0x1129('0x34')]=_0x1f64be[_0x1129('0x34')][_0x1129('0x36')]?_0x1f64be['attributes']:_0x5b2113[_0x1129('0x2f')];if(!_0x268f8f[_0x1129('0x30')]['hasOwnProperty'](_0x1129('0x37'))){_0x1f64be[_0x1129('0x1a')]=qs[_0x1129('0x1a')](_0x268f8f[_0x1129('0x30')][_0x1129('0x1a')]);_0x1f64be['offset']=qs['offset'](_0x268f8f[_0x1129('0x30')][_0x1129('0x1c')]);}_0x1f64be['order']=qs['sort'](_0x268f8f[_0x1129('0x30')]['sort']);_0x1f64be['where']=qs['filters'](_[_0x1129('0x38')](_0x268f8f['query'],_0x5b2113[_0x1129('0x32')]),_0x54c98d);if(_0x268f8f[_0x1129('0x30')]['filter']){_0x1f64be[_0x1129('0x39')]=_[_0x1129('0x3a')](_0x1f64be['where'],{'$or':_[_0x1129('0x29')](_0x54c98d,function(_0x40ae15){if(_0x40ae15[_0x1129('0x2d')]!=='VIRTUAL'){var _0x5c60aa={};_0x5c60aa[_0x40ae15[_0x1129('0x27')]]={'$like':'%'+_0x268f8f[_0x1129('0x30')][_0x1129('0x3b')]+'%'};return _0x5c60aa;}})});}_0x1f64be=_['merge']({},_0x1f64be,_0x268f8f['options']);var _0xd399f7={'where':_0x1f64be[_0x1129('0x39')]};return db['OpenchannelQueueReport']['count'](_0xd399f7)[_0x1129('0x22')](function(_0x2fd1ef){_0x135b7e['count']=_0x2fd1ef;if(_0x268f8f[_0x1129('0x30')][_0x1129('0x3c')]){_0x1f64be[_0x1129('0x3d')]=[{'all':!![]}];}return db[_0x1129('0x2a')][_0x1129('0x3e')](_0x1f64be);})[_0x1129('0x22')](function(_0x27afb6){_0x135b7e[_0x1129('0x3f')]=_0x27afb6;return _0x135b7e;})[_0x1129('0x22')](respondWithFilteredResult(_0x5e655c,_0x1f64be))[_0x1129('0x40')](handleError(_0x5e655c,null));};exports[_0x1129('0x41')]=function(_0x16c973,_0xee63b4){var _0x5493a2={'raw':!![],'where':{'id':_0x16c973['params']['id']}},_0x1c43c6={};_0x1c43c6[_0x1129('0x2f')]=_[_0x1129('0x31')](db[_0x1129('0x2a')][_0x1129('0x2b')]);_0x1c43c6['query']=_[_0x1129('0x31')](_0x16c973[_0x1129('0x30')]);_0x1c43c6[_0x1129('0x32')]=_[_0x1129('0x33')](_0x1c43c6[_0x1129('0x2f')],_0x1c43c6[_0x1129('0x30')]);_0x5493a2[_0x1129('0x34')]=_[_0x1129('0x33')](_0x1c43c6[_0x1129('0x2f')],qs['fields'](_0x16c973[_0x1129('0x30')]['fields']));_0x5493a2[_0x1129('0x34')]=_0x5493a2[_0x1129('0x34')][_0x1129('0x36')]?_0x5493a2[_0x1129('0x34')]:_0x1c43c6[_0x1129('0x2f')];if(_0x16c973[_0x1129('0x30')][_0x1129('0x3c')]){_0x5493a2[_0x1129('0x3d')]=[{'all':!![]}];}_0x5493a2=_[_0x1129('0x3a')]({},_0x5493a2,_0x16c973[_0x1129('0x42')]);return db[_0x1129('0x2a')][_0x1129('0x43')](_0x5493a2)[_0x1129('0x22')](handleEntityNotFound(_0xee63b4,null))['then'](respondWithResult(_0xee63b4,null))['catch'](handleError(_0xee63b4,null));};exports[_0x1129('0x44')]=function(_0x5c3a83,_0x37afef){return db[_0x1129('0x2a')][_0x1129('0x44')](_0x5c3a83[_0x1129('0x45')],{})[_0x1129('0x22')](respondWithResult(_0x37afef,0xc9))[_0x1129('0x40')](handleError(_0x37afef,null));};exports[_0x1129('0x21')]=function(_0x2f57ea,_0x18a409){if(_0x2f57ea['body']['id']){delete _0x2f57ea[_0x1129('0x45')]['id'];}return db[_0x1129('0x2a')][_0x1129('0x43')]({'where':{'id':_0x2f57ea[_0x1129('0x46')]['id']}})[_0x1129('0x22')](handleEntityNotFound(_0x18a409,null))[_0x1129('0x22')](saveUpdates(_0x2f57ea['body'],null))['then'](respondWithResult(_0x18a409,null))['catch'](handleError(_0x18a409,null));};exports[_0x1129('0x23')]=function(_0x511d49,_0x2a45dc){return db[_0x1129('0x2a')][_0x1129('0x43')]({'where':{'id':_0x511d49['params']['id']}})[_0x1129('0x22')](handleEntityNotFound(_0x2a45dc,null))[_0x1129('0x22')](removeEntity(_0x2a45dc,null))['catch'](handleError(_0x2a45dc,null));};exports['describe']=function(_0x472955,_0x12bba4){return db[_0x1129('0x2a')][_0x1129('0x47')]()[_0x1129('0x22')](respondWithResult(_0x12bba4,null))['catch'](handleError(_0x12bba4,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 2700974..e7f4692 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(_0x38e219,_0x8a59f){var _0x2ed8a3=function(_0x15abe8){while(--_0x15abe8){_0x38e219['push'](_0x38e219['shift']());}};_0x2ed8a3(++_0x8a59f);}(_0x326f,0xd1));var _0xf326=function(_0x33f616,_0x3ad289){_0x33f616=_0x33f616-0x0;var _0x422e81=_0x326f[_0x33f616];return _0x422e81;};'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 _0xe14b=['bluebird','path','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','moment'];(function(_0x55dc16,_0x255db8){var _0x31504b=function(_0x128967){while(--_0x128967){_0x55dc16['push'](_0x55dc16['shift']());}};_0x31504b(++_0x255db8);}(_0xe14b,0x93));var _0xbe14=function(_0x1c102c,_0x5d3105){_0x1c102c=_0x1c102c-0x0;var _0x4165a6=_0xe14b[_0x1c102c];return _0x4165a6;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 44830fa..96954b9 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 _0x19e1=['where','attributes','limit','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','update'];(function(_0x1fbe91,_0x45d0b7){var _0x58bd79=function(_0x23732b){while(--_0x23732b){_0x1fbe91['push'](_0x1fbe91['shift']());}};_0x58bd79(++_0x45d0b7);}(_0x19e1,0x163));var _0x119e=function(_0x1c6089,_0x3816e2){_0x1c6089=_0x1c6089-0x0;var _0x4d97c1=_0x19e1[_0x1c6089];return _0x4d97c1;};'use strict';var _=require(_0x119e('0x0'));var util=require(_0x119e('0x1'));var moment=require(_0x119e('0x2'));var BPromise=require(_0x119e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x119e('0x4'))['db'];var utils=require(_0x119e('0x5'));var logger=require('../../config/logger')(_0x119e('0x6'));var config=require(_0x119e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x119e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b5306,_0x25e166,_0x16a2ee){return new BPromise(function(_0x1b3797,_0x53d5b7){return client[_0x119e('0x9')](_0x1b5306,_0x16a2ee)[_0x119e('0xa')](function(_0x1a6747){logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x25e166,_0x119e('0xb'));logger[_0x119e('0xc')](_0x119e('0xd'),_0x25e166,_0x119e('0xb'),JSON[_0x119e('0xe')](_0x1a6747));if(_0x1a6747[_0x119e('0xf')]){if(_0x1a6747[_0x119e('0xf')]['code']===0x1f4){logger[_0x119e('0xf')](_0x119e('0x10'),_0x25e166,_0x1a6747[_0x119e('0xf')][_0x119e('0x11')]);return _0x53d5b7(_0x1a6747[_0x119e('0xf')][_0x119e('0x11')]);}logger['error'](_0x119e('0x10'),_0x25e166,_0x1a6747[_0x119e('0xf')][_0x119e('0x11')]);return _0x1b3797(_0x1a6747[_0x119e('0xf')][_0x119e('0x11')]);}else{logger[_0x119e('0x12')](_0x119e('0x10'),_0x25e166,_0x119e('0xb'));_0x1b3797(_0x1a6747[_0x119e('0x13')][_0x119e('0x11')]);}})[_0x119e('0x14')](function(_0x54c326){logger[_0x119e('0xf')](_0x119e('0x10'),_0x25e166,_0x54c326);_0x53d5b7(_0x54c326);});});}exports[_0x119e('0x15')]=function(_0xb3375c){var _0x348ae3=this;return new Promise(function(_0xedc945,_0x2848fa){return db[_0x119e('0x16')][_0x119e('0x17')](_0xb3375c[_0x119e('0x18')],{'raw':_0xb3375c[_0x119e('0x19')]?_0xb3375c['options'][_0x119e('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0xd4c2d5){logger['info'](_0x119e('0x15'),_0xb3375c);logger[_0x119e('0xc')]('CreateOpenchannelQueueReport',_0xb3375c,JSON['stringify'](_0xd4c2d5));_0xedc945(_0xd4c2d5);})[_0x119e('0x14')](function(_0x29de19){logger[_0x119e('0xf')]('CreateOpenchannelQueueReport',_0x29de19['message'],_0xb3375c);_0x2848fa(_0x348ae3[_0x119e('0xf')](0x1f4,_0x29de19['message']));});});};exports[_0x119e('0x1b')]=function(_0x21fb19){var _0x198f7b=this;return new Promise(function(_0x596dfb,_0x1e4c98){return db['OpenchannelQueueReport'][_0x119e('0x1c')](_0x21fb19['body'],{'raw':_0x21fb19['options']?_0x21fb19[_0x119e('0x19')][_0x119e('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21fb19[_0x119e('0x19')]?_0x21fb19[_0x119e('0x19')][_0x119e('0x1d')]||null:null,'attributes':_0x21fb19[_0x119e('0x19')]?_0x21fb19['options'][_0x119e('0x1e')]||null:null,'limit':_0x21fb19[_0x119e('0x19')]?_0x21fb19['options'][_0x119e('0x1f')]||null:null})[_0x119e('0xa')](function(_0x49b965){logger[_0x119e('0x12')]('UpdateOpenchannelQueueReport',_0x21fb19);logger[_0x119e('0xc')](_0x119e('0x1b'),_0x21fb19,JSON[_0x119e('0xe')](_0x49b965));_0x596dfb(_0x49b965);})[_0x119e('0x14')](function(_0x3df7e9){logger['error'](_0x119e('0x1b'),_0x3df7e9[_0x119e('0x11')],_0x21fb19);_0x1e4c98(_0x198f7b[_0x119e('0xf')](0x1f4,_0x3df7e9[_0x119e('0x11')]));});});}; \ No newline at end of file +var _0x056b=['CreateOpenchannelQueueReport','OpenchannelQueueReport','create','options','raw','then','debug','update','body','where','attributes','UpdateOpenchannelQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x9df392,_0xc910c7){var _0x965d1b=function(_0x256374){while(--_0x256374){_0x9df392['push'](_0x9df392['shift']());}};_0x965d1b(++_0xc910c7);}(_0x056b,0xb6));var _0xb056=function(_0x3baa05,_0x207228){_0x3baa05=_0x3baa05-0x0;var _0x3b2b8d=_0x056b[_0x3baa05];return _0x3b2b8d;};'use strict';var _=require('lodash');var util=require(_0xb056('0x0'));var moment=require(_0xb056('0x1'));var BPromise=require(_0xb056('0x2'));var rs=require(_0xb056('0x3'));var fs=require('fs');var Redis=require(_0xb056('0x4'));var db=require(_0xb056('0x5'))['db'];var utils=require(_0xb056('0x6'));var logger=require(_0xb056('0x7'))(_0xb056('0x8'));var config=require(_0xb056('0x9'));var jayson=require(_0xb056('0xa'));var client=jayson['client'][_0xb056('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x314637,_0x3eae69,_0x3c9b89){return new BPromise(function(_0x80daf1,_0x6bf4c){return client['request'](_0x314637,_0x3c9b89)['then'](function(_0x37a86d){logger[_0xb056('0xc')](_0xb056('0xd'),_0x3eae69,_0xb056('0xe'));logger['debug'](_0xb056('0xf'),_0x3eae69,'request\x20sent',JSON[_0xb056('0x10')](_0x37a86d));if(_0x37a86d[_0xb056('0x11')]){if(_0x37a86d[_0xb056('0x11')][_0xb056('0x12')]===0x1f4){logger[_0xb056('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3eae69,_0x37a86d['error'][_0xb056('0x13')]);return _0x6bf4c(_0x37a86d[_0xb056('0x11')]['message']);}logger[_0xb056('0x11')](_0xb056('0xd'),_0x3eae69,_0x37a86d[_0xb056('0x11')][_0xb056('0x13')]);return _0x80daf1(_0x37a86d[_0xb056('0x11')][_0xb056('0x13')]);}else{logger[_0xb056('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3eae69,_0xb056('0xe'));_0x80daf1(_0x37a86d[_0xb056('0x14')][_0xb056('0x13')]);}})[_0xb056('0x15')](function(_0x5a4ef1){logger[_0xb056('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3eae69,_0x5a4ef1);_0x6bf4c(_0x5a4ef1);});});}exports[_0xb056('0x16')]=function(_0x311eb9){var _0x48e140=this;return new Promise(function(_0x29c77e,_0x4c57e6){return db[_0xb056('0x17')][_0xb056('0x18')](_0x311eb9['body'],{'raw':_0x311eb9[_0xb056('0x19')]?_0x311eb9['options'][_0xb056('0x1a')]===undefined?!![]:![]:!![]})[_0xb056('0x1b')](function(_0x457b54){logger[_0xb056('0xc')]('CreateOpenchannelQueueReport',_0x311eb9);logger[_0xb056('0x1c')]('CreateOpenchannelQueueReport',_0x311eb9,JSON[_0xb056('0x10')](_0x457b54));_0x29c77e(_0x457b54);})['catch'](function(_0x324ce6){logger[_0xb056('0x11')](_0xb056('0x16'),_0x324ce6[_0xb056('0x13')],_0x311eb9);_0x4c57e6(_0x48e140[_0xb056('0x11')](0x1f4,_0x324ce6[_0xb056('0x13')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x1016da){var _0x18a3f2=this;return new Promise(function(_0x341544,_0x1bd6ac){return db['OpenchannelQueueReport'][_0xb056('0x1d')](_0x1016da[_0xb056('0x1e')],{'raw':_0x1016da['options']?_0x1016da[_0xb056('0x19')][_0xb056('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1016da[_0xb056('0x19')]?_0x1016da[_0xb056('0x19')][_0xb056('0x1f')]||null:null,'attributes':_0x1016da[_0xb056('0x19')]?_0x1016da[_0xb056('0x19')][_0xb056('0x20')]||null:null,'limit':_0x1016da['options']?_0x1016da[_0xb056('0x19')]['limit']||null:null})[_0xb056('0x1b')](function(_0x9c6f4a){logger[_0xb056('0xc')]('UpdateOpenchannelQueueReport',_0x1016da);logger[_0xb056('0x1c')](_0xb056('0x21'),_0x1016da,JSON['stringify'](_0x9c6f4a));_0x341544(_0x9c6f4a);})[_0xb056('0x15')](function(_0x43aa63){logger[_0xb056('0x11')](_0xb056('0x21'),_0x43aa63[_0xb056('0x13')],_0x1016da);_0x1bd6ac(_0x18a3f2['error'](0x1f4,_0x43aa63[_0xb056('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index d83bfa1..21f219b 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 _0xfede=['isAuthenticated','index','get','/:id','show','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x316994,_0x14b69d){var _0x2de742=function(_0x30fa40){while(--_0x30fa40){_0x316994['push'](_0x316994['shift']());}};_0x2de742(++_0x14b69d);}(_0xfede,0x1de));var _0xefed=function(_0x2f5a22,_0x5e9f03){_0x2f5a22=_0x2f5a22-0x0;var _0x326b70=_0xfede[_0x2f5a22];return _0x326b70;};'use strict';var multer=require(_0xefed('0x0'));var util=require(_0xefed('0x1'));var path=require(_0xefed('0x2'));var timeout=require(_0xefed('0x3'));var express=require(_0xefed('0x4'));var router=express['Router']();var fs_extra=require(_0xefed('0x5'));var auth=require(_0xefed('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xefed('0x7'));var controller=require('./openchannelTransferReport.controller');router['get']('/',auth[_0xefed('0x8')](),controller[_0xefed('0x9')]);router[_0xefed('0xa')]('/describe',auth[_0xefed('0x8')](),controller['describe']);router[_0xefed('0xa')](_0xefed('0xb'),auth['isAuthenticated'](),controller[_0xefed('0xc')]);router[_0xefed('0xd')]('/',auth[_0xefed('0x8')](),controller[_0xefed('0xe')]);router[_0xefed('0xf')]('/:id',auth[_0xefed('0x8')](),controller['update']);router['delete'](_0xefed('0xb'),auth[_0xefed('0x8')](),controller[_0xefed('0x10')]);module[_0xefed('0x11')]=router; \ No newline at end of file +var _0x2272=['describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./openchannelTransferReport.controller','get','index','/describe'];(function(_0x29fdc2,_0x587b41){var _0x5ed737=function(_0x2b9ad6){while(--_0x2b9ad6){_0x29fdc2['push'](_0x29fdc2['shift']());}};_0x5ed737(++_0x587b41);}(_0x2272,0x129));var _0x2227=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2272[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x2227('0x0'));var util=require(_0x2227('0x1'));var path=require(_0x2227('0x2'));var timeout=require(_0x2227('0x3'));var express=require(_0x2227('0x4'));var router=express[_0x2227('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2227('0x6'));var controller=require(_0x2227('0x7'));router[_0x2227('0x8')]('/',auth['isAuthenticated'](),controller[_0x2227('0x9')]);router[_0x2227('0x8')](_0x2227('0xa'),auth['isAuthenticated'](),controller[_0x2227('0xb')]);router['get'](_0x2227('0xc'),auth[_0x2227('0xd')](),controller[_0x2227('0xe')]);router[_0x2227('0xf')]('/',auth['isAuthenticated'](),controller[_0x2227('0x10')]);router[_0x2227('0x11')]('/:id',auth[_0x2227('0xd')](),controller[_0x2227('0x12')]);router[_0x2227('0x13')](_0x2227('0xc'),auth[_0x2227('0xd')](),controller[_0x2227('0x14')]);module[_0x2227('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 67b6f45..17273a7 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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x543242,_0xeac9fd){var _0x4c99b6=function(_0x47d087){while(--_0x47d087){_0x543242['push'](_0x543242['shift']());}};_0x4c99b6(++_0xeac9fd);}(_0x9bde,0xe1));var _0xe9bd=function(_0x2b496d,_0xa46831){_0x2b496d=_0x2b496d-0x0;var _0x3e7b06=_0x9bde[_0x2b496d];return _0x3e7b06;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file +var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x2ffbce,_0x3b242d){var _0xd8005b=function(_0x567e42){while(--_0x567e42){_0x2ffbce['push'](_0x2ffbce['shift']());}};_0xd8005b(++_0x3b242d);}(_0x54ef,0x112));var _0xf54e=function(_0x5cce96,_0x37d376){_0x5cce96=_0x5cce96-0x0;var _0x1d1409=_0x54ef[_0x5cce96];return _0x1d1409;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 478502b..1b5b3af 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 _0x19a0=['ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','OpenchannelTransferReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x19a0,0xda));var _0x019a=function(_0x1ced8b,_0x53442e){_0x1ced8b=_0x1ced8b-0x0;var _0x5717ac=_0x19a0[_0x1ced8b];return _0x5717ac;};'use strict';var emlformat=require(_0x019a('0x0'));var rimraf=require(_0x019a('0x1'));var zipdir=require(_0x019a('0x2'));var jsonpatch=require(_0x019a('0x3'));var rp=require(_0x019a('0x4'));var moment=require(_0x019a('0x5'));var BPromise=require(_0x019a('0x6'));var Mustache=require('mustache');var util=require(_0x019a('0x7'));var path=require(_0x019a('0x8'));var sox=require(_0x019a('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x019a('0xa'));var _=require(_0x019a('0xb'));var squel=require(_0x019a('0xc'));var crypto=require(_0x019a('0xd'));var jsforce=require(_0x019a('0xe'));var deskjs=require(_0x019a('0xf'));var toCsv=require(_0x019a('0x10'));var querystring=require(_0x019a('0x11'));var Papa=require(_0x019a('0x12'));var Redis=require(_0x019a('0x13'));var authService=require(_0x019a('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x019a('0x15'));var logger=require(_0x019a('0x16'))(_0x019a('0x17'));var utils=require('../../config/utils');var config=require(_0x019a('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x019a('0x19'))['db'];function respondWithStatusCode(_0xd40b3,_0x3732da){_0x3732da=_0x3732da||0xcc;return function(_0x4d13cc){if(_0x4d13cc){return _0xd40b3['sendStatus'](_0x3732da);}return _0xd40b3['status'](_0x3732da)[_0x019a('0x1a')]();};}function respondWithResult(_0x564fb3,_0x19c7c4){_0x19c7c4=_0x19c7c4||0xc8;return function(_0x15c51a){if(_0x15c51a){return _0x564fb3['status'](_0x19c7c4)[_0x019a('0x1b')](_0x15c51a);}};}function respondWithFilteredResult(_0x56b762,_0x31c09c){return function(_0x3f750e){if(_0x3f750e){var _0x2bd3a8=typeof _0x31c09c[_0x019a('0x1c')]===_0x019a('0x1d')&&typeof _0x31c09c[_0x019a('0x1e')]===_0x019a('0x1d');var _0x34c91b=_0x3f750e[_0x019a('0x1f')];var _0x2ed582=_0x2bd3a8?0x0:_0x31c09c['offset'];var _0x2afcd4=_0x2bd3a8?_0x3f750e[_0x019a('0x1f')]:_0x31c09c[_0x019a('0x1c')]+_0x31c09c[_0x019a('0x1e')];var _0x19e432;if(_0x2afcd4>=_0x34c91b){_0x2afcd4=_0x34c91b;_0x19e432=0xc8;}else{_0x19e432=0xce;}_0x56b762[_0x019a('0x20')](_0x19e432);return _0x56b762[_0x019a('0x21')](_0x019a('0x22'),_0x2ed582+'-'+_0x2afcd4+'/'+_0x34c91b)['json'](_0x3f750e);}return null;};}function patchUpdates(_0x479b85){return function(_0x1ebbe3){try{jsonpatch[_0x019a('0x23')](_0x1ebbe3,_0x479b85,!![]);}catch(_0x104398){return BPromise[_0x019a('0x24')](_0x104398);}return _0x1ebbe3[_0x019a('0x25')]();};}function saveUpdates(_0x762e6e,_0x1b0e96){return function(_0x25ff61){if(_0x25ff61){return _0x25ff61[_0x019a('0x26')](_0x762e6e)[_0x019a('0x27')](function(_0x5b7663){return _0x5b7663;});}return null;};}function removeEntity(_0xa5a42a,_0x4d1c21){return function(_0x22c9e4){if(_0x22c9e4){return _0x22c9e4[_0x019a('0x28')]()['then'](function(){_0xa5a42a[_0x019a('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x567aa4,_0x642579){return function(_0x5a3656){if(!_0x5a3656){_0x567aa4[_0x019a('0x29')](0x194);}return _0x5a3656;};}function handleError(_0x55156e,_0x59dd81){_0x59dd81=_0x59dd81||0x1f4;return function(_0x5a1b03){logger[_0x019a('0x2a')](_0x5a1b03[_0x019a('0x2b')]);if(_0x5a1b03[_0x019a('0x2c')]){delete _0x5a1b03['name'];}_0x55156e['status'](_0x59dd81)['send'](_0x5a1b03);};}exports[_0x019a('0x2d')]=function(_0x2a4693,_0x276336){var _0x47e022={},_0x230ddb={},_0x54001e={'count':0x0,'rows':[]};var _0x1adccd=_[_0x019a('0x2e')](db[_0x019a('0x2f')][_0x019a('0x30')],function(_0x24a8b0){return{'name':_0x24a8b0[_0x019a('0x31')],'type':_0x24a8b0['type'][_0x019a('0x32')]};});_0x230ddb[_0x019a('0x33')]=_['map'](_0x1adccd,_0x019a('0x2c'));_0x230ddb['query']=_[_0x019a('0x34')](_0x2a4693[_0x019a('0x35')]);_0x230ddb[_0x019a('0x36')]=_[_0x019a('0x37')](_0x230ddb[_0x019a('0x33')],_0x230ddb['query']);_0x47e022[_0x019a('0x38')]=_[_0x019a('0x37')](_0x230ddb[_0x019a('0x33')],qs[_0x019a('0x39')](_0x2a4693['query'][_0x019a('0x39')]));_0x47e022[_0x019a('0x38')]=_0x47e022[_0x019a('0x38')][_0x019a('0x3a')]?_0x47e022[_0x019a('0x38')]:_0x230ddb[_0x019a('0x33')];if(!_0x2a4693[_0x019a('0x35')][_0x019a('0x3b')](_0x019a('0x3c'))){_0x47e022['limit']=qs[_0x019a('0x1e')](_0x2a4693[_0x019a('0x35')][_0x019a('0x1e')]);_0x47e022[_0x019a('0x1c')]=qs[_0x019a('0x1c')](_0x2a4693['query'][_0x019a('0x1c')]);}_0x47e022['order']=qs[_0x019a('0x3d')](_0x2a4693[_0x019a('0x35')][_0x019a('0x3d')]);_0x47e022[_0x019a('0x3e')]=qs[_0x019a('0x36')](_[_0x019a('0x3f')](_0x2a4693['query'],_0x230ddb['filters']),_0x1adccd);if(_0x2a4693[_0x019a('0x35')]['filter']){_0x47e022[_0x019a('0x3e')]=_[_0x019a('0x40')](_0x47e022[_0x019a('0x3e')],{'$or':_['map'](_0x1adccd,function(_0x227d22){if(_0x227d22[_0x019a('0x41')]!==_0x019a('0x42')){var _0xcd3177={};_0xcd3177[_0x227d22[_0x019a('0x2c')]]={'$like':'%'+_0x2a4693[_0x019a('0x35')][_0x019a('0x43')]+'%'};return _0xcd3177;}})});}_0x47e022=_[_0x019a('0x40')]({},_0x47e022,_0x2a4693[_0x019a('0x44')]);var _0x2b5d6b={'where':_0x47e022[_0x019a('0x3e')]};return db[_0x019a('0x2f')][_0x019a('0x1f')](_0x2b5d6b)[_0x019a('0x27')](function(_0x1d707b){_0x54001e[_0x019a('0x1f')]=_0x1d707b;if(_0x2a4693['query'][_0x019a('0x45')]){_0x47e022[_0x019a('0x46')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x019a('0x47')](_0x47e022);})[_0x019a('0x27')](function(_0x23ac0a){_0x54001e[_0x019a('0x48')]=_0x23ac0a;return _0x54001e;})[_0x019a('0x27')](respondWithFilteredResult(_0x276336,_0x47e022))['catch'](handleError(_0x276336,null));};exports['show']=function(_0x1e0391,_0x5b0b54){var _0x4a3ab9={'raw':!![],'where':{'id':_0x1e0391[_0x019a('0x49')]['id']}},_0x3f5f0a={};_0x3f5f0a[_0x019a('0x33')]=_[_0x019a('0x34')](db[_0x019a('0x2f')][_0x019a('0x30')]);_0x3f5f0a[_0x019a('0x35')]=_[_0x019a('0x34')](_0x1e0391[_0x019a('0x35')]);_0x3f5f0a[_0x019a('0x36')]=_[_0x019a('0x37')](_0x3f5f0a['model'],_0x3f5f0a[_0x019a('0x35')]);_0x4a3ab9['attributes']=_[_0x019a('0x37')](_0x3f5f0a['model'],qs[_0x019a('0x39')](_0x1e0391['query'][_0x019a('0x39')]));_0x4a3ab9[_0x019a('0x38')]=_0x4a3ab9[_0x019a('0x38')][_0x019a('0x3a')]?_0x4a3ab9[_0x019a('0x38')]:_0x3f5f0a['model'];if(_0x1e0391['query'][_0x019a('0x45')]){_0x4a3ab9[_0x019a('0x46')]=[{'all':!![]}];}_0x4a3ab9=_['merge']({},_0x4a3ab9,_0x1e0391[_0x019a('0x44')]);return db[_0x019a('0x2f')][_0x019a('0x4a')](_0x4a3ab9)[_0x019a('0x27')](handleEntityNotFound(_0x5b0b54,null))[_0x019a('0x27')](respondWithResult(_0x5b0b54,null))[_0x019a('0x4b')](handleError(_0x5b0b54,null));};exports[_0x019a('0x4c')]=function(_0xc15de9,_0x57ac1f){return db[_0x019a('0x2f')][_0x019a('0x4c')](_0xc15de9['body'],{})[_0x019a('0x27')](respondWithResult(_0x57ac1f,0xc9))[_0x019a('0x4b')](handleError(_0x57ac1f,null));};exports['update']=function(_0x438815,_0x2046f4){if(_0x438815[_0x019a('0x4d')]['id']){delete _0x438815[_0x019a('0x4d')]['id'];}return db['OpenchannelTransferReport']['find']({'where':{'id':_0x438815[_0x019a('0x49')]['id']}})[_0x019a('0x27')](handleEntityNotFound(_0x2046f4,null))[_0x019a('0x27')](saveUpdates(_0x438815['body'],null))['then'](respondWithResult(_0x2046f4,null))[_0x019a('0x4b')](handleError(_0x2046f4,null));};exports[_0x019a('0x28')]=function(_0x1a2b1d,_0x5e7bf3){return db[_0x019a('0x2f')][_0x019a('0x4a')]({'where':{'id':_0x1a2b1d['params']['id']}})[_0x019a('0x27')](handleEntityNotFound(_0x5e7bf3,null))[_0x019a('0x27')](removeEntity(_0x5e7bf3,null))['catch'](handleError(_0x5e7bf3,null));};exports[_0x019a('0x4e')]=function(_0x18c869,_0x1f9891){return db[_0x019a('0x2f')][_0x019a('0x4e')]()[_0x019a('0x27')](respondWithResult(_0x1f9891,null))[_0x019a('0x4b')](handleError(_0x1f9891,null));}; \ No newline at end of file +var _0xa575=['desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','then','destroy','error','stack','name','send','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','include','catch','show','params','length','includeAll','merge','options','create','update','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','jsforce'];(function(_0x11fdf3,_0x4d7e31){var _0x27dbb2=function(_0x2af1b0){while(--_0x2af1b0){_0x11fdf3['push'](_0x11fdf3['shift']());}};_0x27dbb2(++_0x4d7e31);}(_0xa575,0x1ae));var _0x5a57=function(_0x5454a1,_0x3714bd){_0x5454a1=_0x5454a1-0x0;var _0x305b4c=_0xa575[_0x5454a1];return _0x305b4c;};'use strict';var emlformat=require(_0x5a57('0x0'));var rimraf=require(_0x5a57('0x1'));var zipdir=require(_0x5a57('0x2'));var jsonpatch=require(_0x5a57('0x3'));var rp=require(_0x5a57('0x4'));var moment=require(_0x5a57('0x5'));var BPromise=require(_0x5a57('0x6'));var Mustache=require(_0x5a57('0x7'));var util=require(_0x5a57('0x8'));var path=require('path');var sox=require(_0x5a57('0x9'));var csv=require('to-csv');var ejs=require(_0x5a57('0xa'));var fs=require('fs');var fs_extra=require(_0x5a57('0xb'));var _=require(_0x5a57('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5a57('0xd'));var deskjs=require(_0x5a57('0xe'));var toCsv=require(_0x5a57('0xf'));var querystring=require(_0x5a57('0x10'));var Papa=require('papaparse');var Redis=require(_0x5a57('0x11'));var authService=require(_0x5a57('0x12'));var qs=require(_0x5a57('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5a57('0x14'));var logger=require('../../config/logger')(_0x5a57('0x15'));var utils=require('../../config/utils');var config=require(_0x5a57('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5a57('0x17'))['db'];function respondWithStatusCode(_0x339133,_0x5a9beb){_0x5a9beb=_0x5a9beb||0xcc;return function(_0x315f97){if(_0x315f97){return _0x339133[_0x5a57('0x18')](_0x5a9beb);}return _0x339133[_0x5a57('0x19')](_0x5a9beb)[_0x5a57('0x1a')]();};}function respondWithResult(_0x36644a,_0x3bc905){_0x3bc905=_0x3bc905||0xc8;return function(_0x3bac78){if(_0x3bac78){return _0x36644a[_0x5a57('0x19')](_0x3bc905)[_0x5a57('0x1b')](_0x3bac78);}};}function respondWithFilteredResult(_0x1b2c72,_0x3ae948){return function(_0x373d69){if(_0x373d69){var _0x49aef6=typeof _0x3ae948[_0x5a57('0x1c')]===_0x5a57('0x1d')&&typeof _0x3ae948[_0x5a57('0x1e')]===_0x5a57('0x1d');var _0x1f16be=_0x373d69[_0x5a57('0x1f')];var _0x5b9297=_0x49aef6?0x0:_0x3ae948['offset'];var _0x145625=_0x49aef6?_0x373d69[_0x5a57('0x1f')]:_0x3ae948[_0x5a57('0x1c')]+_0x3ae948['limit'];var _0x4b243f;if(_0x145625>=_0x1f16be){_0x145625=_0x1f16be;_0x4b243f=0xc8;}else{_0x4b243f=0xce;}_0x1b2c72[_0x5a57('0x19')](_0x4b243f);return _0x1b2c72['set'](_0x5a57('0x20'),_0x5b9297+'-'+_0x145625+'/'+_0x1f16be)[_0x5a57('0x1b')](_0x373d69);}return null;};}function patchUpdates(_0x4eb11f){return function(_0x5c1ddb){try{jsonpatch[_0x5a57('0x21')](_0x5c1ddb,_0x4eb11f,!![]);}catch(_0xb54043){return BPromise['reject'](_0xb54043);}return _0x5c1ddb[_0x5a57('0x22')]();};}function saveUpdates(_0x59a2ce,_0x54adb3){return function(_0x4eb811){if(_0x4eb811){return _0x4eb811['update'](_0x59a2ce)[_0x5a57('0x23')](function(_0x27339e){return _0x27339e;});}return null;};}function removeEntity(_0x806425,_0x192610){return function(_0x3165f9){if(_0x3165f9){return _0x3165f9[_0x5a57('0x24')]()['then'](function(){_0x806425[_0x5a57('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32ea34,_0x246723){return function(_0x225f8a){if(!_0x225f8a){_0x32ea34[_0x5a57('0x18')](0x194);}return _0x225f8a;};}function handleError(_0x4a6807,_0x28a4bf){_0x28a4bf=_0x28a4bf||0x1f4;return function(_0x3f9a76){logger[_0x5a57('0x25')](_0x3f9a76[_0x5a57('0x26')]);if(_0x3f9a76[_0x5a57('0x27')]){delete _0x3f9a76[_0x5a57('0x27')];}_0x4a6807[_0x5a57('0x19')](_0x28a4bf)[_0x5a57('0x28')](_0x3f9a76);};}exports['index']=function(_0x1ec63e,_0x479145){var _0x279d74={},_0xa99111={},_0x114dca={'count':0x0,'rows':[]};var _0x5c3aa3=_['map'](db[_0x5a57('0x29')][_0x5a57('0x2a')],function(_0x5641bd){return{'name':_0x5641bd[_0x5a57('0x2b')],'type':_0x5641bd[_0x5a57('0x2c')][_0x5a57('0x2d')]};});_0xa99111[_0x5a57('0x2e')]=_['map'](_0x5c3aa3,_0x5a57('0x27'));_0xa99111['query']=_[_0x5a57('0x2f')](_0x1ec63e[_0x5a57('0x30')]);_0xa99111[_0x5a57('0x31')]=_[_0x5a57('0x32')](_0xa99111[_0x5a57('0x2e')],_0xa99111[_0x5a57('0x30')]);_0x279d74[_0x5a57('0x33')]=_[_0x5a57('0x32')](_0xa99111[_0x5a57('0x2e')],qs[_0x5a57('0x34')](_0x1ec63e[_0x5a57('0x30')]['fields']));_0x279d74['attributes']=_0x279d74['attributes']['length']?_0x279d74['attributes']:_0xa99111[_0x5a57('0x2e')];if(!_0x1ec63e['query'][_0x5a57('0x35')](_0x5a57('0x36'))){_0x279d74[_0x5a57('0x1e')]=qs['limit'](_0x1ec63e[_0x5a57('0x30')][_0x5a57('0x1e')]);_0x279d74[_0x5a57('0x1c')]=qs[_0x5a57('0x1c')](_0x1ec63e['query'][_0x5a57('0x1c')]);}_0x279d74[_0x5a57('0x37')]=qs[_0x5a57('0x38')](_0x1ec63e['query'][_0x5a57('0x38')]);_0x279d74['where']=qs[_0x5a57('0x31')](_[_0x5a57('0x39')](_0x1ec63e[_0x5a57('0x30')],_0xa99111[_0x5a57('0x31')]),_0x5c3aa3);if(_0x1ec63e[_0x5a57('0x30')][_0x5a57('0x3a')]){_0x279d74[_0x5a57('0x3b')]=_['merge'](_0x279d74[_0x5a57('0x3b')],{'$or':_['map'](_0x5c3aa3,function(_0x5e8d37){if(_0x5e8d37[_0x5a57('0x2c')]!==_0x5a57('0x3c')){var _0x3ebe14={};_0x3ebe14[_0x5e8d37['name']]={'$like':'%'+_0x1ec63e[_0x5a57('0x30')][_0x5a57('0x3a')]+'%'};return _0x3ebe14;}})});}_0x279d74=_['merge']({},_0x279d74,_0x1ec63e['options']);var _0xe91512={'where':_0x279d74[_0x5a57('0x3b')]};return db['OpenchannelTransferReport'][_0x5a57('0x1f')](_0xe91512)[_0x5a57('0x23')](function(_0xcc617){_0x114dca[_0x5a57('0x1f')]=_0xcc617;if(_0x1ec63e['query']['includeAll']){_0x279d74[_0x5a57('0x3d')]=[{'all':!![]}];}return db[_0x5a57('0x29')]['findAll'](_0x279d74);})['then'](function(_0x5ed478){_0x114dca['rows']=_0x5ed478;return _0x114dca;})[_0x5a57('0x23')](respondWithFilteredResult(_0x479145,_0x279d74))[_0x5a57('0x3e')](handleError(_0x479145,null));};exports[_0x5a57('0x3f')]=function(_0x1c3601,_0x1f982d){var _0x53e07b={'raw':!![],'where':{'id':_0x1c3601[_0x5a57('0x40')]['id']}},_0x30ab63={};_0x30ab63[_0x5a57('0x2e')]=_[_0x5a57('0x2f')](db[_0x5a57('0x29')][_0x5a57('0x2a')]);_0x30ab63[_0x5a57('0x30')]=_[_0x5a57('0x2f')](_0x1c3601[_0x5a57('0x30')]);_0x30ab63[_0x5a57('0x31')]=_[_0x5a57('0x32')](_0x30ab63[_0x5a57('0x2e')],_0x30ab63['query']);_0x53e07b['attributes']=_[_0x5a57('0x32')](_0x30ab63[_0x5a57('0x2e')],qs[_0x5a57('0x34')](_0x1c3601[_0x5a57('0x30')]['fields']));_0x53e07b[_0x5a57('0x33')]=_0x53e07b[_0x5a57('0x33')][_0x5a57('0x41')]?_0x53e07b[_0x5a57('0x33')]:_0x30ab63[_0x5a57('0x2e')];if(_0x1c3601[_0x5a57('0x30')][_0x5a57('0x42')]){_0x53e07b['include']=[{'all':!![]}];}_0x53e07b=_[_0x5a57('0x43')]({},_0x53e07b,_0x1c3601[_0x5a57('0x44')]);return db[_0x5a57('0x29')]['find'](_0x53e07b)['then'](handleEntityNotFound(_0x1f982d,null))['then'](respondWithResult(_0x1f982d,null))[_0x5a57('0x3e')](handleError(_0x1f982d,null));};exports[_0x5a57('0x45')]=function(_0x36981d,_0x5dc705){return db['OpenchannelTransferReport'][_0x5a57('0x45')](_0x36981d['body'],{})[_0x5a57('0x23')](respondWithResult(_0x5dc705,0xc9))[_0x5a57('0x3e')](handleError(_0x5dc705,null));};exports[_0x5a57('0x46')]=function(_0x271cb3,_0x15f0b7){if(_0x271cb3[_0x5a57('0x47')]['id']){delete _0x271cb3[_0x5a57('0x47')]['id'];}return db[_0x5a57('0x29')][_0x5a57('0x48')]({'where':{'id':_0x271cb3[_0x5a57('0x40')]['id']}})['then'](handleEntityNotFound(_0x15f0b7,null))[_0x5a57('0x23')](saveUpdates(_0x271cb3[_0x5a57('0x47')],null))['then'](respondWithResult(_0x15f0b7,null))[_0x5a57('0x3e')](handleError(_0x15f0b7,null));};exports[_0x5a57('0x24')]=function(_0x3fb5f1,_0x4600a6){return db[_0x5a57('0x29')][_0x5a57('0x48')]({'where':{'id':_0x3fb5f1[_0x5a57('0x40')]['id']}})[_0x5a57('0x23')](handleEntityNotFound(_0x4600a6,null))[_0x5a57('0x23')](removeEntity(_0x4600a6,null))[_0x5a57('0x3e')](handleError(_0x4600a6,null));};exports[_0x5a57('0x49')]=function(_0x2764a1,_0xd81e09){return db[_0x5a57('0x29')][_0x5a57('0x49')]()[_0x5a57('0x23')](respondWithResult(_0xd81e09,null))[_0x5a57('0x3e')](handleError(_0xd81e09,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 18767a4..e74f930 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 _0x462b=['../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x462b,0xbd));var _0xb462=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x462b[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xb462('0x0'));var util=require(_0xb462('0x1'));var logger=require(_0xb462('0x2'))(_0xb462('0x3'));var moment=require('moment');var BPromise=require(_0xb462('0x4'));var rp=require(_0xb462('0x5'));var fs=require('fs');var path=require(_0xb462('0x6'));var rimraf=require('rimraf');var config=require(_0xb462('0x7'));var attributes=require(_0xb462('0x8'));module[_0xb462('0x9')]=function(_0x3b13bb,_0xbcd8d){return _0x3b13bb[_0xb462('0xa')](_0xb462('0xb'),attributes,{'tableName':_0xb462('0xc'),'paranoid':![],'indexes':[{'name':_0xb462('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9629=['bluebird','request-promise','path','rimraf','./openchannelTransferReport.attributes','define','OpenchannelTransferReport','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0xd56d70,_0x3748cb){var _0xf7fee4=function(_0x6623fd){while(--_0x6623fd){_0xd56d70['push'](_0xd56d70['shift']());}};_0xf7fee4(++_0x3748cb);}(_0x9629,0xf2));var _0x9962=function(_0xe92eee,_0x41959c){_0xe92eee=_0xe92eee-0x0;var _0x1216c6=_0x9629[_0xe92eee];return _0x1216c6;};'use strict';var _=require(_0x9962('0x0'));var util=require(_0x9962('0x1'));var logger=require(_0x9962('0x2'))(_0x9962('0x3'));var moment=require(_0x9962('0x4'));var BPromise=require(_0x9962('0x5'));var rp=require(_0x9962('0x6'));var fs=require('fs');var path=require(_0x9962('0x7'));var rimraf=require(_0x9962('0x8'));var config=require('../../config/environment');var attributes=require(_0x9962('0x9'));module['exports']=function(_0x3697a1,_0x3da037){return _0x3697a1[_0x9962('0xa')](_0x9962('0xb'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x9962('0xc'),'fields':[_0x9962('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index fd60ad0..0c22a50 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 _0x0734=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x4983c1,_0x56788b){var _0x3d6c82=function(_0x5c3632){while(--_0x5c3632){_0x4983c1['push'](_0x4983c1['shift']());}};_0x3d6c82(++_0x56788b);}(_0x0734,0xba));var _0x4073=function(_0x298013,_0x971ed6){_0x298013=_0x298013-0x0;var _0x4fe078=_0x0734[_0x298013];return _0x4fe078;};'use strict';var _=require(_0x4073('0x0'));var util=require(_0x4073('0x1'));var moment=require(_0x4073('0x2'));var BPromise=require(_0x4073('0x3'));var rs=require(_0x4073('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4073('0x5'))['db'];var utils=require(_0x4073('0x6'));var logger=require(_0x4073('0x7'))(_0x4073('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4073('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c3c14,_0x2195e0,_0x1251bd){return new BPromise(function(_0x22a33d,_0x51515d){return client[_0x4073('0xa')](_0x2c3c14,_0x1251bd)['then'](function(_0x5432c4){logger[_0x4073('0xb')](_0x4073('0xc'),_0x2195e0,_0x4073('0xd'));logger['debug']('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x2195e0,_0x4073('0xd'),JSON[_0x4073('0xe')](_0x5432c4));if(_0x5432c4['error']){if(_0x5432c4[_0x4073('0xf')]['code']===0x1f4){logger[_0x4073('0xf')](_0x4073('0xc'),_0x2195e0,_0x5432c4[_0x4073('0xf')][_0x4073('0x10')]);return _0x51515d(_0x5432c4['error'][_0x4073('0x10')]);}logger[_0x4073('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x2195e0,_0x5432c4[_0x4073('0xf')][_0x4073('0x10')]);return _0x22a33d(_0x5432c4[_0x4073('0xf')][_0x4073('0x10')]);}else{logger[_0x4073('0xb')](_0x4073('0xc'),_0x2195e0,'request\x20sent');_0x22a33d(_0x5432c4[_0x4073('0x11')]['message']);}})[_0x4073('0x12')](function(_0x38ea09){logger['error'](_0x4073('0xc'),_0x2195e0,_0x38ea09);_0x51515d(_0x38ea09);});});} \ No newline at end of file +var _0x4f0d=['ioredis','../../mysqldb','../../config/utils','rpc','client','request','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result'];(function(_0x574189,_0x466535){var _0xefcee6=function(_0x2cfd6e){while(--_0x2cfd6e){_0x574189['push'](_0x574189['shift']());}};_0xefcee6(++_0x466535);}(_0x4f0d,0x1c2));var _0xd4f0=function(_0x40a0a4,_0x4269e1){_0x40a0a4=_0x40a0a4-0x0;var _0x115c37=_0x4f0d[_0x40a0a4];return _0x115c37;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd4f0('0x0'));var db=require(_0xd4f0('0x1'))['db'];var utils=require(_0xd4f0('0x2'));var logger=require('../../config/logger')(_0xd4f0('0x3'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd4f0('0x4')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16da18,_0x4dd938,_0x50e79f){return new BPromise(function(_0x19a779,_0x69309d){return client[_0xd4f0('0x5')](_0x16da18,_0x50e79f)[_0xd4f0('0x6')](function(_0x9b959f){logger['info'](_0xd4f0('0x7'),_0x4dd938,_0xd4f0('0x8'));logger['debug']('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x4dd938,_0xd4f0('0x8'),JSON[_0xd4f0('0x9')](_0x9b959f));if(_0x9b959f['error']){if(_0x9b959f[_0xd4f0('0xa')][_0xd4f0('0xb')]===0x1f4){logger[_0xd4f0('0xa')](_0xd4f0('0x7'),_0x4dd938,_0x9b959f[_0xd4f0('0xa')]['message']);return _0x69309d(_0x9b959f[_0xd4f0('0xa')][_0xd4f0('0xc')]);}logger[_0xd4f0('0xa')](_0xd4f0('0x7'),_0x4dd938,_0x9b959f[_0xd4f0('0xa')][_0xd4f0('0xc')]);return _0x19a779(_0x9b959f[_0xd4f0('0xa')][_0xd4f0('0xc')]);}else{logger[_0xd4f0('0xd')](_0xd4f0('0x7'),_0x4dd938,_0xd4f0('0x8'));_0x19a779(_0x9b959f[_0xd4f0('0xe')]['message']);}})['catch'](function(_0x169443){logger[_0xd4f0('0xa')](_0xd4f0('0x7'),_0x4dd938,_0x169443);_0x69309d(_0x169443);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index bd34011..fe3a2f8 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 _0x6f1a=['put','update','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./pause.controller','get','isAuthenticated','index','post','create'];(function(_0x405d40,_0xc57994){var _0x576905=function(_0x4f58da){while(--_0x4f58da){_0x405d40['push'](_0x405d40['shift']());}};_0x576905(++_0xc57994);}(_0x6f1a,0x1f4));var _0xa6f1=function(_0x1246e7,_0xdee926){_0x1246e7=_0x1246e7-0x0;var _0x59e6ff=_0x6f1a[_0x1246e7];return _0x59e6ff;};'use strict';var multer=require(_0xa6f1('0x0'));var util=require('util');var path=require(_0xa6f1('0x1'));var timeout=require(_0xa6f1('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa6f1('0x3'));var auth=require(_0xa6f1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa6f1('0x5'));var controller=require(_0xa6f1('0x6'));router[_0xa6f1('0x7')]('/',auth[_0xa6f1('0x8')](),controller[_0xa6f1('0x9')]);router['get']('/:id',auth[_0xa6f1('0x8')](),controller['show']);router[_0xa6f1('0xa')]('/',auth[_0xa6f1('0x8')](),controller[_0xa6f1('0xb')]);router[_0xa6f1('0xc')]('/:id',auth[_0xa6f1('0x8')](),controller[_0xa6f1('0xd')]);router['delete']('/:id',auth[_0xa6f1('0x8')](),controller[_0xa6f1('0xe')]);module[_0xa6f1('0xf')]=router; \ No newline at end of file +var _0x6fc5=['update','destroy','exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x26d6d9,_0x431cb8){var _0x1b4875=function(_0x41111f){while(--_0x41111f){_0x26d6d9['push'](_0x26d6d9['shift']());}};_0x1b4875(++_0x431cb8);}(_0x6fc5,0x93));var _0x56fc=function(_0x924a42,_0x1f466f){_0x924a42=_0x924a42-0x0;var _0x4c552f=_0x6fc5[_0x924a42];return _0x4c552f;};'use strict';var multer=require(_0x56fc('0x0'));var util=require('util');var path=require(_0x56fc('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x56fc('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x56fc('0x3'));var interaction=require(_0x56fc('0x4'));var config=require('../../config/environment');var controller=require('./pause.controller');router[_0x56fc('0x5')]('/',auth[_0x56fc('0x6')](),controller[_0x56fc('0x7')]);router[_0x56fc('0x5')](_0x56fc('0x8'),auth[_0x56fc('0x6')](),controller[_0x56fc('0x9')]);router[_0x56fc('0xa')]('/',auth[_0x56fc('0x6')](),controller[_0x56fc('0xb')]);router[_0x56fc('0xc')](_0x56fc('0x8'),auth[_0x56fc('0x6')](),controller[_0x56fc('0xd')]);router['delete'](_0x56fc('0x8'),auth['isAuthenticated'](),controller[_0x56fc('0xe')]);module[_0x56fc('0xf')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 062dcd6..6d58224 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 _0x51b2=['STRING','name','sequelize','exports'];(function(_0x35eb72,_0x168447){var _0x122a61=function(_0xba74c7){while(--_0xba74c7){_0x35eb72['push'](_0x35eb72['shift']());}};_0x122a61(++_0x168447);}(_0x51b2,0x166));var _0x251b=function(_0x4912ca,_0x1345b0){_0x4912ca=_0x4912ca-0x0;var _0x1b8006=_0x51b2[_0x4912ca];return _0x1b8006;};'use strict';var Sequelize=require(_0x251b('0x0'));module[_0x251b('0x1')]={'name':{'type':Sequelize[_0x251b('0x2')],'unique':_0x251b('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2171=['STRING','sequelize','name'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x2171,0x70));var _0x1217=function(_0x5da059,_0x22a596){_0x5da059=_0x5da059-0x0;var _0x4f5e90=_0x2171[_0x5da059];return _0x4f5e90;};'use strict';var Sequelize=require(_0x1217('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x1217('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x1217('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index fde477c..57c6ba0 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 _0x2928=['reject','save','update','then','get','Pauses','error','stack','name','send','index','map','Pause','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','catch','show','params','fields','find','create','body','user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply'];(function(_0x393cf6,_0x49a942){var _0xdd998=function(_0x386fff){while(--_0x386fff){_0x393cf6['push'](_0x393cf6['shift']());}};_0xdd998(++_0x49a942);}(_0x2928,0xd3));var _0x8292=function(_0x1d87fc,_0x1e5321){_0x1d87fc=_0x1d87fc-0x0;var _0x492b56=_0x2928[_0x1d87fc];return _0x492b56;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8292('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8292('0x1'));var BPromise=require(_0x8292('0x2'));var Mustache=require(_0x8292('0x3'));var util=require(_0x8292('0x4'));var path=require(_0x8292('0x5'));var sox=require(_0x8292('0x6'));var csv=require(_0x8292('0x7'));var ejs=require(_0x8292('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8292('0x9'));var squel=require(_0x8292('0xa'));var crypto=require(_0x8292('0xb'));var jsforce=require(_0x8292('0xc'));var deskjs=require(_0x8292('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8292('0xe'));var Redis=require('ioredis');var authService=require(_0x8292('0xf'));var qs=require(_0x8292('0x10'));var as=require(_0x8292('0x11'));var hardwareService=require(_0x8292('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x8292('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x8292('0x14'));var db=require(_0x8292('0x15'))['db'];function respondWithStatusCode(_0x2281d5,_0x331e6d){_0x331e6d=_0x331e6d||0xcc;return function(_0x34d210){if(_0x34d210){return _0x2281d5[_0x8292('0x16')](_0x331e6d);}return _0x2281d5[_0x8292('0x17')](_0x331e6d)[_0x8292('0x18')]();};}function respondWithResult(_0x325c0c,_0x2d73e2){_0x2d73e2=_0x2d73e2||0xc8;return function(_0x2a3c83){if(_0x2a3c83){return _0x325c0c[_0x8292('0x17')](_0x2d73e2)[_0x8292('0x19')](_0x2a3c83);}};}function respondWithFilteredResult(_0x44f52a,_0x4ad736){return function(_0x5ba716){if(_0x5ba716){var _0x44aa65=typeof _0x4ad736[_0x8292('0x1a')]===_0x8292('0x1b')&&typeof _0x4ad736[_0x8292('0x1c')]===_0x8292('0x1b');var _0x541670=_0x5ba716['count'];var _0xd6cc2=_0x44aa65?0x0:_0x4ad736[_0x8292('0x1a')];var _0x39c1c7=_0x44aa65?_0x5ba716['count']:_0x4ad736[_0x8292('0x1a')]+_0x4ad736[_0x8292('0x1c')];var _0x2d1fdd;if(_0x39c1c7>=_0x541670){_0x39c1c7=_0x541670;_0x2d1fdd=0xc8;}else{_0x2d1fdd=0xce;}_0x44f52a[_0x8292('0x17')](_0x2d1fdd);return _0x44f52a[_0x8292('0x1d')](_0x8292('0x1e'),_0xd6cc2+'-'+_0x39c1c7+'/'+_0x541670)[_0x8292('0x19')](_0x5ba716);}return null;};}function patchUpdates(_0x2e4a10){return function(_0x2b658c){try{jsonpatch[_0x8292('0x1f')](_0x2b658c,_0x2e4a10,!![]);}catch(_0x3821f4){return BPromise[_0x8292('0x20')](_0x3821f4);}return _0x2b658c[_0x8292('0x21')]();};}function saveUpdates(_0x4aa62f,_0x4d26af){return function(_0xc25feb){if(_0xc25feb){return _0xc25feb[_0x8292('0x22')](_0x4aa62f)[_0x8292('0x23')](function(_0x5432dd){return _0x5432dd;});}return null;};}function removeEntity(_0x2c56f1,_0x20937b){return function(_0xc6e8c2){if(_0xc6e8c2){return _0xc6e8c2['destroy']()[_0x8292('0x23')](function(){var _0xea4c52=_0xc6e8c2[_0x8292('0x24')]({'plain':!![]});var _0x2eb8b0=_0x8292('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x2eb8b0,'resourceId':_0xea4c52['id']}})[_0x8292('0x23')](function(){return _0xc6e8c2;});})[_0x8292('0x23')](function(){_0x2c56f1[_0x8292('0x17')](0xcc)[_0x8292('0x18')]();});}};}function handleEntityNotFound(_0x4489be,_0x2d67a7){return function(_0x1a9400){if(!_0x1a9400){_0x4489be['sendStatus'](0x194);}return _0x1a9400;};}function handleError(_0x32061d,_0x529acb){_0x529acb=_0x529acb||0x1f4;return function(_0xbf75e1){logger[_0x8292('0x26')](_0xbf75e1[_0x8292('0x27')]);if(_0xbf75e1[_0x8292('0x28')]){delete _0xbf75e1[_0x8292('0x28')];}_0x32061d[_0x8292('0x17')](_0x529acb)[_0x8292('0x29')](_0xbf75e1);};}exports[_0x8292('0x2a')]=function(_0x167105,_0x389122){var _0x1a1ea8={},_0x1c4be3={},_0xa65502={'count':0x0,'rows':[]};var _0xeca075=_[_0x8292('0x2b')](db[_0x8292('0x2c')][_0x8292('0x2d')],function(_0x1164ba){return{'name':_0x1164ba['fieldName'],'type':_0x1164ba[_0x8292('0x2e')][_0x8292('0x2f')]};});_0x1c4be3[_0x8292('0x30')]=_[_0x8292('0x2b')](_0xeca075,_0x8292('0x28'));_0x1c4be3['query']=_[_0x8292('0x31')](_0x167105[_0x8292('0x32')]);_0x1c4be3[_0x8292('0x33')]=_['intersection'](_0x1c4be3[_0x8292('0x30')],_0x1c4be3[_0x8292('0x32')]);_0x1a1ea8[_0x8292('0x34')]=_[_0x8292('0x35')](_0x1c4be3[_0x8292('0x30')],qs['fields'](_0x167105[_0x8292('0x32')]['fields']));_0x1a1ea8[_0x8292('0x34')]=_0x1a1ea8['attributes'][_0x8292('0x36')]?_0x1a1ea8[_0x8292('0x34')]:_0x1c4be3[_0x8292('0x30')];if(!_0x167105[_0x8292('0x32')][_0x8292('0x37')](_0x8292('0x38'))){_0x1a1ea8['limit']=qs[_0x8292('0x1c')](_0x167105['query'][_0x8292('0x1c')]);_0x1a1ea8[_0x8292('0x1a')]=qs[_0x8292('0x1a')](_0x167105['query'][_0x8292('0x1a')]);}_0x1a1ea8['order']=qs[_0x8292('0x39')](_0x167105['query'][_0x8292('0x39')]);_0x1a1ea8[_0x8292('0x3a')]=qs['filters'](_[_0x8292('0x3b')](_0x167105['query'],_0x1c4be3['filters']),_0xeca075);if(_0x167105[_0x8292('0x32')][_0x8292('0x3c')]){_0x1a1ea8[_0x8292('0x3a')]=_[_0x8292('0x3d')](_0x1a1ea8['where'],{'$or':_['map'](_0xeca075,function(_0x4e615a){if(_0x4e615a[_0x8292('0x2e')]!=='VIRTUAL'){var _0xef83c8={};_0xef83c8[_0x4e615a[_0x8292('0x28')]]={'$like':'%'+_0x167105['query'][_0x8292('0x3c')]+'%'};return _0xef83c8;}})});}_0x1a1ea8=_[_0x8292('0x3d')]({},_0x1a1ea8,_0x167105[_0x8292('0x3e')]);var _0x371b9d={'where':_0x1a1ea8[_0x8292('0x3a')]};return db[_0x8292('0x2c')][_0x8292('0x3f')](_0x371b9d)[_0x8292('0x23')](function(_0x2e2d03){_0xa65502[_0x8292('0x3f')]=_0x2e2d03;if(_0x167105['query'][_0x8292('0x40')]){_0x1a1ea8[_0x8292('0x41')]=[{'all':!![]}];}return db[_0x8292('0x2c')][_0x8292('0x42')](_0x1a1ea8);})[_0x8292('0x23')](function(_0x58d15c){_0xa65502['rows']=_0x58d15c;return _0xa65502;})[_0x8292('0x23')](respondWithFilteredResult(_0x389122,_0x1a1ea8))[_0x8292('0x43')](handleError(_0x389122,null));};exports[_0x8292('0x44')]=function(_0x2e13e2,_0x2bf2ab){var _0xaedfc3={'raw':!![],'where':{'id':_0x2e13e2[_0x8292('0x45')]['id']}},_0x29713c={};_0x29713c[_0x8292('0x30')]=_[_0x8292('0x31')](db[_0x8292('0x2c')][_0x8292('0x2d')]);_0x29713c[_0x8292('0x32')]=_[_0x8292('0x31')](_0x2e13e2[_0x8292('0x32')]);_0x29713c[_0x8292('0x33')]=_['intersection'](_0x29713c['model'],_0x29713c[_0x8292('0x32')]);_0xaedfc3['attributes']=_['intersection'](_0x29713c[_0x8292('0x30')],qs['fields'](_0x2e13e2[_0x8292('0x32')][_0x8292('0x46')]));_0xaedfc3[_0x8292('0x34')]=_0xaedfc3[_0x8292('0x34')][_0x8292('0x36')]?_0xaedfc3[_0x8292('0x34')]:_0x29713c['model'];if(_0x2e13e2['query'][_0x8292('0x40')]){_0xaedfc3[_0x8292('0x41')]=[{'all':!![]}];}_0xaedfc3=_[_0x8292('0x3d')]({},_0xaedfc3,_0x2e13e2[_0x8292('0x3e')]);return db[_0x8292('0x2c')][_0x8292('0x47')](_0xaedfc3)[_0x8292('0x23')](handleEntityNotFound(_0x2bf2ab,null))[_0x8292('0x23')](respondWithResult(_0x2bf2ab,null))['catch'](handleError(_0x2bf2ab,null));};exports[_0x8292('0x48')]=function(_0x9baf91,_0x18f983){return db[_0x8292('0x2c')][_0x8292('0x48')](_0x9baf91[_0x8292('0x49')],{})[_0x8292('0x23')](function(_0xddf16a){var _0x57bae4=_0x9baf91[_0x8292('0x4a')][_0x8292('0x24')]({'plain':!![]});if(!_0x57bae4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x57bae4[_0x8292('0x4b')]===_0x8292('0x4a')){var _0x4dd297=_0xddf16a[_0x8292('0x24')]({'plain':!![]});var _0x1bd54f=_0x8292('0x25');return db[_0x8292('0x4c')][_0x8292('0x47')]({'where':{'name':_0x1bd54f,'userProfileId':_0x57bae4['userProfileId']},'raw':!![]})[_0x8292('0x23')](function(_0x15fbc9){if(_0x15fbc9&&_0x15fbc9[_0x8292('0x4d')]===0x0){return db[_0x8292('0x4e')][_0x8292('0x48')]({'name':_0x4dd297['name'],'resourceId':_0x4dd297['id'],'type':_0x15fbc9[_0x8292('0x28')],'sectionId':_0x15fbc9['id']},{})['then'](function(){return _0xddf16a;});}else{return _0xddf16a;}})[_0x8292('0x43')](function(_0xe0791c){logger[_0x8292('0x26')](_0x8292('0x4f'),_0xe0791c);throw _0xe0791c;});}return _0xddf16a;})[_0x8292('0x23')](respondWithResult(_0x18f983,0xc9))['catch'](handleError(_0x18f983,null));};exports['update']=function(_0x1da557,_0x877b05){if(_0x1da557[_0x8292('0x49')]['id']){delete _0x1da557[_0x8292('0x49')]['id'];}return db[_0x8292('0x2c')][_0x8292('0x47')]({'where':{'id':_0x1da557[_0x8292('0x45')]['id']}})[_0x8292('0x23')](handleEntityNotFound(_0x877b05,null))['then'](saveUpdates(_0x1da557[_0x8292('0x49')],null))['then'](respondWithResult(_0x877b05,null))[_0x8292('0x43')](handleError(_0x877b05,null));};exports[_0x8292('0x50')]=function(_0x140166,_0x3fc3bd){return db[_0x8292('0x2c')][_0x8292('0x47')]({'where':{'id':_0x140166[_0x8292('0x45')]['id']}})['then'](handleEntityNotFound(_0x3fc3bd,null))[_0x8292('0x23')](removeEntity(_0x3fc3bd,null))[_0x8292('0x43')](handleError(_0x3fc3bd,null));}; \ No newline at end of file +var _0x0ef1=['where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','end','json','offset','undefined','count','status','set','Content-Range','reject','then','get','Pauses','UserProfileResource','destroy','sendStatus','error','name','send','Pause','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort'];(function(_0x226879,_0x30a56b){var _0x20964c=function(_0x4a1ea6){while(--_0x4a1ea6){_0x226879['push'](_0x226879['shift']());}};_0x20964c(++_0x30a56b);}(_0x0ef1,0x108));var _0x10ef=function(_0x4838e5,_0x4fba21){_0x4838e5=_0x4838e5-0x0;var _0x257561=_0x0ef1[_0x4838e5];return _0x257561;};'use strict';var emlformat=require(_0x10ef('0x0'));var rimraf=require(_0x10ef('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x10ef('0x2'));var rp=require(_0x10ef('0x3'));var moment=require(_0x10ef('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x10ef('0x5'));var util=require(_0x10ef('0x6'));var path=require(_0x10ef('0x7'));var sox=require(_0x10ef('0x8'));var csv=require('to-csv');var ejs=require(_0x10ef('0x9'));var fs=require('fs');var fs_extra=require(_0x10ef('0xa'));var _=require(_0x10ef('0xb'));var squel=require(_0x10ef('0xc'));var crypto=require(_0x10ef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x10ef('0xe'));var toCsv=require(_0x10ef('0xf'));var querystring=require(_0x10ef('0x10'));var Papa=require(_0x10ef('0x11'));var Redis=require(_0x10ef('0x12'));var authService=require(_0x10ef('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x10ef('0x14'));var logger=require(_0x10ef('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x10ef('0x16'));var db=require(_0x10ef('0x17'))['db'];function respondWithStatusCode(_0x2bf142,_0x4d6563){_0x4d6563=_0x4d6563||0xcc;return function(_0x376e66){if(_0x376e66){return _0x2bf142['sendStatus'](_0x4d6563);}return _0x2bf142['status'](_0x4d6563)[_0x10ef('0x18')]();};}function respondWithResult(_0x1bb5d0,_0x2eafbe){_0x2eafbe=_0x2eafbe||0xc8;return function(_0x296520){if(_0x296520){return _0x1bb5d0['status'](_0x2eafbe)[_0x10ef('0x19')](_0x296520);}};}function respondWithFilteredResult(_0x196d4f,_0x56c076){return function(_0x538f41){if(_0x538f41){var _0xcf6797=typeof _0x56c076[_0x10ef('0x1a')]===_0x10ef('0x1b')&&typeof _0x56c076['limit']===_0x10ef('0x1b');var _0x127ba7=_0x538f41[_0x10ef('0x1c')];var _0x54d4bb=_0xcf6797?0x0:_0x56c076['offset'];var _0x25cb4c=_0xcf6797?_0x538f41[_0x10ef('0x1c')]:_0x56c076[_0x10ef('0x1a')]+_0x56c076['limit'];var _0x2f0796;if(_0x25cb4c>=_0x127ba7){_0x25cb4c=_0x127ba7;_0x2f0796=0xc8;}else{_0x2f0796=0xce;}_0x196d4f[_0x10ef('0x1d')](_0x2f0796);return _0x196d4f[_0x10ef('0x1e')](_0x10ef('0x1f'),_0x54d4bb+'-'+_0x25cb4c+'/'+_0x127ba7)[_0x10ef('0x19')](_0x538f41);}return null;};}function patchUpdates(_0xbb3592){return function(_0x292549){try{jsonpatch['apply'](_0x292549,_0xbb3592,!![]);}catch(_0x43d3a0){return BPromise[_0x10ef('0x20')](_0x43d3a0);}return _0x292549['save']();};}function saveUpdates(_0x3b3374,_0x4c47d2){return function(_0x508d39){if(_0x508d39){return _0x508d39['update'](_0x3b3374)[_0x10ef('0x21')](function(_0x465135){return _0x465135;});}return null;};}function removeEntity(_0x13c081,_0x17e648){return function(_0x47ad3a){if(_0x47ad3a){return _0x47ad3a['destroy']()[_0x10ef('0x21')](function(){var _0x4169b0=_0x47ad3a[_0x10ef('0x22')]({'plain':!![]});var _0x3bd0f2=_0x10ef('0x23');return db[_0x10ef('0x24')][_0x10ef('0x25')]({'where':{'type':_0x3bd0f2,'resourceId':_0x4169b0['id']}})[_0x10ef('0x21')](function(){return _0x47ad3a;});})[_0x10ef('0x21')](function(){_0x13c081[_0x10ef('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b13f8,_0x5954a6){return function(_0x20e2bb){if(!_0x20e2bb){_0x1b13f8[_0x10ef('0x26')](0x194);}return _0x20e2bb;};}function handleError(_0x30a55f,_0x45feac){_0x45feac=_0x45feac||0x1f4;return function(_0x48a0ca){logger[_0x10ef('0x27')](_0x48a0ca['stack']);if(_0x48a0ca['name']){delete _0x48a0ca[_0x10ef('0x28')];}_0x30a55f[_0x10ef('0x1d')](_0x45feac)[_0x10ef('0x29')](_0x48a0ca);};}exports['index']=function(_0x223bae,_0x2cbc67){var _0x37f608={},_0x26fd48={},_0x21a594={'count':0x0,'rows':[]};var _0x36a0ed=_['map'](db[_0x10ef('0x2a')][_0x10ef('0x2b')],function(_0xbaae99){return{'name':_0xbaae99[_0x10ef('0x2c')],'type':_0xbaae99[_0x10ef('0x2d')]['key']};});_0x26fd48['model']=_[_0x10ef('0x2e')](_0x36a0ed,_0x10ef('0x28'));_0x26fd48[_0x10ef('0x2f')]=_[_0x10ef('0x30')](_0x223bae[_0x10ef('0x2f')]);_0x26fd48[_0x10ef('0x31')]=_[_0x10ef('0x32')](_0x26fd48[_0x10ef('0x33')],_0x26fd48[_0x10ef('0x2f')]);_0x37f608[_0x10ef('0x34')]=_[_0x10ef('0x32')](_0x26fd48[_0x10ef('0x33')],qs[_0x10ef('0x35')](_0x223bae['query']['fields']));_0x37f608[_0x10ef('0x34')]=_0x37f608[_0x10ef('0x34')][_0x10ef('0x36')]?_0x37f608['attributes']:_0x26fd48['model'];if(!_0x223bae[_0x10ef('0x2f')][_0x10ef('0x37')](_0x10ef('0x38'))){_0x37f608[_0x10ef('0x39')]=qs['limit'](_0x223bae['query']['limit']);_0x37f608['offset']=qs[_0x10ef('0x1a')](_0x223bae[_0x10ef('0x2f')]['offset']);}_0x37f608[_0x10ef('0x3a')]=qs[_0x10ef('0x3b')](_0x223bae['query']['sort']);_0x37f608[_0x10ef('0x3c')]=qs[_0x10ef('0x31')](_[_0x10ef('0x3d')](_0x223bae[_0x10ef('0x2f')],_0x26fd48['filters']),_0x36a0ed);if(_0x223bae[_0x10ef('0x2f')][_0x10ef('0x3e')]){_0x37f608[_0x10ef('0x3c')]=_['merge'](_0x37f608['where'],{'$or':_[_0x10ef('0x2e')](_0x36a0ed,function(_0x2475af){if(_0x2475af[_0x10ef('0x2d')]!==_0x10ef('0x3f')){var _0xc68172={};_0xc68172[_0x2475af[_0x10ef('0x28')]]={'$like':'%'+_0x223bae[_0x10ef('0x2f')][_0x10ef('0x3e')]+'%'};return _0xc68172;}})});}_0x37f608=_[_0x10ef('0x40')]({},_0x37f608,_0x223bae[_0x10ef('0x41')]);var _0x12c692={'where':_0x37f608[_0x10ef('0x3c')]};return db[_0x10ef('0x2a')][_0x10ef('0x1c')](_0x12c692)[_0x10ef('0x21')](function(_0x28ae1f){_0x21a594['count']=_0x28ae1f;if(_0x223bae[_0x10ef('0x2f')][_0x10ef('0x42')]){_0x37f608[_0x10ef('0x43')]=[{'all':!![]}];}return db['Pause'][_0x10ef('0x44')](_0x37f608);})[_0x10ef('0x21')](function(_0x47c099){_0x21a594[_0x10ef('0x45')]=_0x47c099;return _0x21a594;})[_0x10ef('0x21')](respondWithFilteredResult(_0x2cbc67,_0x37f608))[_0x10ef('0x46')](handleError(_0x2cbc67,null));};exports[_0x10ef('0x47')]=function(_0x4ad411,_0x356e4f){var _0x29aca9={'raw':!![],'where':{'id':_0x4ad411[_0x10ef('0x48')]['id']}},_0x22f2d8={};_0x22f2d8['model']=_['keys'](db[_0x10ef('0x2a')][_0x10ef('0x2b')]);_0x22f2d8[_0x10ef('0x2f')]=_[_0x10ef('0x30')](_0x4ad411[_0x10ef('0x2f')]);_0x22f2d8[_0x10ef('0x31')]=_['intersection'](_0x22f2d8[_0x10ef('0x33')],_0x22f2d8[_0x10ef('0x2f')]);_0x29aca9[_0x10ef('0x34')]=_[_0x10ef('0x32')](_0x22f2d8[_0x10ef('0x33')],qs[_0x10ef('0x35')](_0x4ad411[_0x10ef('0x2f')]['fields']));_0x29aca9[_0x10ef('0x34')]=_0x29aca9[_0x10ef('0x34')][_0x10ef('0x36')]?_0x29aca9['attributes']:_0x22f2d8[_0x10ef('0x33')];if(_0x4ad411[_0x10ef('0x2f')]['includeAll']){_0x29aca9[_0x10ef('0x43')]=[{'all':!![]}];}_0x29aca9=_[_0x10ef('0x40')]({},_0x29aca9,_0x4ad411['options']);return db[_0x10ef('0x2a')]['find'](_0x29aca9)[_0x10ef('0x21')](handleEntityNotFound(_0x356e4f,null))[_0x10ef('0x21')](respondWithResult(_0x356e4f,null))['catch'](handleError(_0x356e4f,null));};exports[_0x10ef('0x49')]=function(_0x23bd7c,_0x37c6df){return db['Pause'][_0x10ef('0x49')](_0x23bd7c['body'],{})[_0x10ef('0x21')](function(_0x319627){var _0x8df633=_0x23bd7c[_0x10ef('0x4a')]['get']({'plain':!![]});if(!_0x8df633)throw new Error(_0x10ef('0x4b'));if(_0x8df633['role']===_0x10ef('0x4a')){var _0xdd5781=_0x319627[_0x10ef('0x22')]({'plain':!![]});var _0x20343c=_0x10ef('0x23');return db[_0x10ef('0x4c')][_0x10ef('0x4d')]({'where':{'name':_0x20343c,'userProfileId':_0x8df633['userProfileId']},'raw':!![]})[_0x10ef('0x21')](function(_0x2cd6cf){if(_0x2cd6cf&&_0x2cd6cf[_0x10ef('0x4e')]===0x0){return db[_0x10ef('0x24')][_0x10ef('0x49')]({'name':_0xdd5781[_0x10ef('0x28')],'resourceId':_0xdd5781['id'],'type':_0x2cd6cf['name'],'sectionId':_0x2cd6cf['id']},{})['then'](function(){return _0x319627;});}else{return _0x319627;}})[_0x10ef('0x46')](function(_0x4a555f){logger['error'](_0x10ef('0x4f'),_0x4a555f);throw _0x4a555f;});}return _0x319627;})[_0x10ef('0x21')](respondWithResult(_0x37c6df,0xc9))[_0x10ef('0x46')](handleError(_0x37c6df,null));};exports['update']=function(_0x5abb04,_0x8a7bee){if(_0x5abb04[_0x10ef('0x50')]['id']){delete _0x5abb04[_0x10ef('0x50')]['id'];}return db[_0x10ef('0x2a')]['find']({'where':{'id':_0x5abb04[_0x10ef('0x48')]['id']}})[_0x10ef('0x21')](handleEntityNotFound(_0x8a7bee,null))[_0x10ef('0x21')](saveUpdates(_0x5abb04[_0x10ef('0x50')],null))[_0x10ef('0x21')](respondWithResult(_0x8a7bee,null))['catch'](handleError(_0x8a7bee,null));};exports[_0x10ef('0x25')]=function(_0x3b00d6,_0x634484){return db['Pause'][_0x10ef('0x4d')]({'where':{'id':_0x3b00d6[_0x10ef('0x48')]['id']}})['then'](handleEntityNotFound(_0x634484,null))[_0x10ef('0x21')](removeEntity(_0x634484,null))[_0x10ef('0x46')](handleError(_0x634484,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 91416d7..e76a922 100644 --- a/server/api/pause/pause.model.js +++ b/server/api/pause/pause.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6aa7=['Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x6aa7,0x178));var _0x76aa=function(_0x4c0694,_0x29e537){_0x4c0694=_0x4c0694-0x0;var _0x5e8ec0=_0x6aa7[_0x4c0694];return _0x5e8ec0;};'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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x6aa7,0x178));var _0x76aa=function(_0x59a8ae,_0x34b47d){_0x59a8ae=_0x59a8ae-0x0;var _0xce1243=_0x6aa7[_0x59a8ae];return _0xce1243;};'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 c638544..759d8be 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x37f8eb,_0x1e3a41){var _0x1473af=function(_0xdafa91){while(--_0xdafa91){_0x37f8eb['push'](_0x37f8eb['shift']());}};_0x1473af(++_0x1e3a41);}(_0x7a54,0x106));var _0x47a5=function(_0x7843ae,_0x56324a){_0x7843ae=_0x7843ae-0x0;var _0xaf4d80=_0x7a54[_0x7843ae];return _0xaf4d80;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x1aa12d,_0x559817){var _0x3f01f5=function(_0x2524b4){while(--_0x2524b4){_0x1aa12d['push'](_0x1aa12d['shift']());}};_0x3f01f5(++_0x559817);}(_0xb10b,0x12a));var _0xbb10=function(_0xe6164f,_0x47e826){_0xe6164f=_0xe6164f-0x0;var _0x557c61=_0xb10b[_0xe6164f];return _0x557c61;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 312ae07..da96a77 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 _0xb66c=['/:id','show','/:id/download','isAuthenticated','download','join','server/files/plugins','originalname','replace','format','%s-%s%s','extname','single','file','upload','post','webhookPost','put','update','delete','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./plugin.controller','get','/webhook','webhookGet'];(function(_0x279d72,_0x39f8db){var _0x56685d=function(_0x4c5f6e){while(--_0x4c5f6e){_0x279d72['push'](_0x279d72['shift']());}};_0x56685d(++_0x39f8db);}(_0xb66c,0x175));var _0xcb66=function(_0x52f2a7,_0x24a6ff){_0x52f2a7=_0x52f2a7-0x0;var _0xd136c0=_0xb66c[_0x52f2a7];return _0xd136c0;};'use strict';var multer=require(_0xcb66('0x0'));var util=require('util');var path=require(_0xcb66('0x1'));var timeout=require('connect-timeout');var express=require(_0xcb66('0x2'));var router=express[_0xcb66('0x3')]();var fs_extra=require(_0xcb66('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcb66('0x5'));var config=require(_0xcb66('0x6'));var controller=require(_0xcb66('0x7'));router[_0xcb66('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xcb66('0x8')](_0xcb66('0x9'),controller[_0xcb66('0xa')]);router[_0xcb66('0x8')](_0xcb66('0xb'),auth['isAuthenticated'](),controller[_0xcb66('0xc')]);router[_0xcb66('0x8')](_0xcb66('0xd'),auth[_0xcb66('0xe')](),controller[_0xcb66('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x393bde,_0x2b32ec,_0xf12828){_0xf12828(null,path[_0xcb66('0x10')](config['root'],_0xcb66('0x11')));},'filename':function(_0x3471f3,_0x4105d2,_0x2339bb){_0x4105d2['originalname']=_0x4105d2[_0xcb66('0x12')][_0xcb66('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2339bb(null,util[_0xcb66('0x14')](_0xcb66('0x15'),path['basename'](_0x4105d2[_0xcb66('0x12')],path['extname'](_0x4105d2[_0xcb66('0x12')])),Date['now'](),path[_0xcb66('0x16')](_0x4105d2['originalname'])));}})});router['post']('/',upload[_0xcb66('0x17')](_0xcb66('0x18')),controller[_0xcb66('0x19')]);router[_0xcb66('0x1a')]('/webhook',controller[_0xcb66('0x1b')]);router[_0xcb66('0x1c')](_0xcb66('0xb'),auth['isAuthenticated'](),controller[_0xcb66('0x1d')]);router['delete'](_0xcb66('0xb'),auth[_0xcb66('0xe')](),controller[_0xcb66('0x1e')]);module[_0xcb66('0x1f')]=router; \ No newline at end of file +var _0x4fdb=['server/files/plugins','originalname','replace','%s-%s%s','basename','extname','now','post','single','file','upload','webhookPost','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','isAuthenticated','/webhook','webhookGet','get','show','/:id/download','download','diskStorage','root'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x1beed1,_0x166e72){_0x1beed1=_0x1beed1-0x0;var _0x248552=_0x4fdb[_0x1beed1];return _0x248552;};'use strict';var multer=require(_0xb4fd('0x0'));var util=require(_0xb4fd('0x1'));var path=require(_0xb4fd('0x2'));var timeout=require(_0xb4fd('0x3'));var express=require(_0xb4fd('0x4'));var router=express[_0xb4fd('0x5')]();var fs_extra=require(_0xb4fd('0x6'));var auth=require(_0xb4fd('0x7'));var interaction=require(_0xb4fd('0x8'));var config=require('../../config/environment');var controller=require(_0xb4fd('0x9'));router['get']('/',auth[_0xb4fd('0xa')](),controller['index']);router['get'](_0xb4fd('0xb'),controller[_0xb4fd('0xc')]);router[_0xb4fd('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xb4fd('0xe')]);router[_0xb4fd('0xd')](_0xb4fd('0xf'),auth['isAuthenticated'](),controller[_0xb4fd('0x10')]);var upload=multer({'storage':multer[_0xb4fd('0x11')]({'destination':function(_0x2148db,_0x23b08f,_0x306bd4){_0x306bd4(null,path['join'](config[_0xb4fd('0x12')],_0xb4fd('0x13')));},'filename':function(_0x2e8ee1,_0x120c2e,_0x5ba7e1){_0x120c2e[_0xb4fd('0x14')]=_0x120c2e[_0xb4fd('0x14')][_0xb4fd('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5ba7e1(null,util['format'](_0xb4fd('0x16'),path[_0xb4fd('0x17')](_0x120c2e[_0xb4fd('0x14')],path[_0xb4fd('0x18')](_0x120c2e[_0xb4fd('0x14')])),Date[_0xb4fd('0x19')](),path[_0xb4fd('0x18')](_0x120c2e['originalname'])));}})});router[_0xb4fd('0x1a')]('/',upload[_0xb4fd('0x1b')](_0xb4fd('0x1c')),controller[_0xb4fd('0x1d')]);router[_0xb4fd('0x1a')](_0xb4fd('0xb'),controller[_0xb4fd('0x1e')]);router[_0xb4fd('0x1f')](_0xb4fd('0x20'),auth[_0xb4fd('0xa')](),controller[_0xb4fd('0x21')]);router['delete']('/:id',auth['isAuthenticated'](),controller['delete']);module[_0xb4fd('0x22')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index d082612..ffe789d 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 _0xcbd6=['The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','agentOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','exports','STRING','ENUM','html','TEXT'];(function(_0x2677aa,_0x3591e4){var _0x33b72e=function(_0x4f8f89){while(--_0x4f8f89){_0x2677aa['push'](_0x2677aa['shift']());}};_0x33b72e(++_0x3591e4);}(_0xcbd6,0xb6));var _0x6cbd=function(_0x455798,_0xd126ce){_0x455798=_0x455798-0x0;var _0x3afe64=_0xcbd6[_0x455798];return _0x3afe64;};'use strict';var Sequelize=require('sequelize');module[_0x6cbd('0x0')]={'name':{'type':Sequelize[_0x6cbd('0x1')]},'type':{'type':Sequelize[_0x6cbd('0x2')](_0x6cbd('0x3'),'script')},'description':{'type':Sequelize[_0x6cbd('0x4')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x6cbd('0x1')],'comment':_0x6cbd('0x5')},'active':{'type':Sequelize[_0x6cbd('0x6')],'defaultValue':0x0,'comment':_0x6cbd('0x7')},'sidebar':{'type':Sequelize[_0x6cbd('0x2')]('adminOnly',_0x6cbd('0x8'),_0x6cbd('0x9'),'never'),'defaultValue':'always','comment':_0x6cbd('0xa')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x6cbd('0x1')]},'agentUrl':{'type':Sequelize[_0x6cbd('0x1')]},'scriptName':{'type':Sequelize[_0x6cbd('0x1')]},'scriptPath':{'type':Sequelize[_0x6cbd('0x1')]}}; \ No newline at end of file +var _0xf382=['always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xf382,0xfe));var _0x2f38=function(_0x4d610a,_0x8891ef){_0x4d610a=_0x4d610a-0x0;var _0x831be7=_0xf382[_0x4d610a];return _0x831be7;};'use strict';var Sequelize=require(_0x2f38('0x0'));module[_0x2f38('0x1')]={'name':{'type':Sequelize[_0x2f38('0x2')]},'type':{'type':Sequelize[_0x2f38('0x3')](_0x2f38('0x4'),_0x2f38('0x5'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x2f38('0x6')]},'path':{'type':Sequelize[_0x2f38('0x2')],'comment':_0x2f38('0x7')},'active':{'type':Sequelize[_0x2f38('0x8')],'defaultValue':0x0,'comment':_0x2f38('0x9')},'sidebar':{'type':Sequelize[_0x2f38('0x3')](_0x2f38('0xa'),_0x2f38('0xb'),_0x2f38('0xc'),'never'),'defaultValue':_0x2f38('0xc'),'comment':_0x2f38('0xd')},'icon':{'type':Sequelize[_0x2f38('0x2')]},'adminUrl':{'type':Sequelize[_0x2f38('0x2')]},'agentUrl':{'type':Sequelize[_0x2f38('0x2')]},'scriptName':{'type':Sequelize[_0x2f38('0x2')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 46cd122..1c4fac0 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 _0x6608=['statusCode','webhookPost','http://localhost:','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./plugin.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Plugins','UserProfileResource','error','stack','name','send','index','map','Plugin','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','rows','show','params','length','include','find','catch','download','join','root','server/files/plugins','format','%s.zip','basename','warning','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','**/*','dirname','node_modules/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','Download\x20completed','info','Temporary\x20file\x20removed','file','filename','extname','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20type\x20missing','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','body','role','userProfileId','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Extracted\x20folder\x20removed','delete','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','method','%s%s','headers','content-length','content-type','endsWith'];(function(_0x2c2064,_0x3192c0){var _0x292781=function(_0x1c2777){while(--_0x1c2777){_0x2c2064['push'](_0x2c2064['shift']());}};_0x292781(++_0x3192c0);}(_0x6608,0xa4));var _0x8660=function(_0x511664,_0x386a03){_0x511664=_0x511664-0x0;var _0x1ded4c=_0x6608[_0x511664];return _0x1ded4c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8660('0x0'));var zipdir=require(_0x8660('0x1'));var jsonpatch=require(_0x8660('0x2'));var rp=require(_0x8660('0x3'));var moment=require(_0x8660('0x4'));var BPromise=require(_0x8660('0x5'));var Mustache=require(_0x8660('0x6'));var util=require('util');var path=require(_0x8660('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8660('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8660('0x9'));var crypto=require(_0x8660('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x8660('0xb'));var toCsv=require(_0x8660('0xc'));var querystring=require('querystring');var Papa=require(_0x8660('0xd'));var extract=require('extract-zip');var rimraf=require('rimraf');var archiver=require('archiver');var Redis=require(_0x8660('0xe'));var authService=require(_0x8660('0xf'));var qs=require(_0x8660('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8660('0x11'));var logger=require(_0x8660('0x12'))('api');var utils=require(_0x8660('0x13'));var config=require(_0x8660('0x14'));var licenseUtil=require(_0x8660('0x15'));var db=require(_0x8660('0x16'))['db'];config[_0x8660('0x17')]=_[_0x8660('0x18')](config[_0x8660('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x8660('0x19'))(new Redis(config[_0x8660('0x17')]));require(_0x8660('0x1a'))['register'](socket);function respondWithStatusCode(_0x2612d9,_0x5c80de){_0x5c80de=_0x5c80de||0xcc;return function(_0x4598ac){if(_0x4598ac){return _0x2612d9[_0x8660('0x1b')](_0x5c80de);}return _0x2612d9[_0x8660('0x1c')](_0x5c80de)[_0x8660('0x1d')]();};}function respondWithResult(_0x31f93c,_0x4ec2dd){_0x4ec2dd=_0x4ec2dd||0xc8;return function(_0x38c825){if(_0x38c825){return _0x31f93c['status'](_0x4ec2dd)[_0x8660('0x1e')](_0x38c825);}};}function respondWithFilteredResult(_0x5bb372,_0x13db89){return function(_0x2399f9){if(_0x2399f9){var _0x42d2a5=typeof _0x13db89[_0x8660('0x1f')]===_0x8660('0x20')&&typeof _0x13db89[_0x8660('0x21')]==='undefined';var _0x4ef2fd=_0x2399f9[_0x8660('0x22')];var _0x1fe8a7=_0x42d2a5?0x0:_0x13db89[_0x8660('0x1f')];var _0x33292d=_0x42d2a5?_0x2399f9['count']:_0x13db89[_0x8660('0x1f')]+_0x13db89[_0x8660('0x21')];var _0x537eff;if(_0x33292d>=_0x4ef2fd){_0x33292d=_0x4ef2fd;_0x537eff=0xc8;}else{_0x537eff=0xce;}_0x5bb372[_0x8660('0x1c')](_0x537eff);return _0x5bb372[_0x8660('0x23')](_0x8660('0x24'),_0x1fe8a7+'-'+_0x33292d+'/'+_0x4ef2fd)[_0x8660('0x1e')](_0x2399f9);}return null;};}function patchUpdates(_0x440ec2){return function(_0x3dcbe6){try{jsonpatch[_0x8660('0x25')](_0x3dcbe6,_0x440ec2,!![]);}catch(_0x5b64c8){return BPromise[_0x8660('0x26')](_0x5b64c8);}return _0x3dcbe6[_0x8660('0x27')]();};}function saveUpdates(_0x4d0b57,_0x4f1a10){return function(_0x563cb6){if(_0x563cb6){return _0x563cb6[_0x8660('0x28')](_0x4d0b57)[_0x8660('0x29')](function(_0x3d9ce0){return _0x3d9ce0;});}return null;};}function removeEntity(_0x4f42d7,_0x286605){return function(_0xd10935){if(_0xd10935){return _0xd10935[_0x8660('0x2a')]()['then'](function(){var _0xc741b7=_0xd10935[_0x8660('0x2b')]({'plain':!![]});var _0x4d2a96=_0x8660('0x2c');return db[_0x8660('0x2d')][_0x8660('0x2a')]({'where':{'type':_0x4d2a96,'resourceId':_0xc741b7['id']}})['then'](function(){return _0xd10935;});})[_0x8660('0x29')](function(){_0x4f42d7[_0x8660('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ebf93,_0x5918e0){return function(_0x1c348e){if(!_0x1c348e){_0x4ebf93[_0x8660('0x1b')](0x194);}return _0x1c348e;};}function handleError(_0x6afb7,_0x371fcd){_0x371fcd=_0x371fcd||0x1f4;return function(_0x30f52d){logger[_0x8660('0x2e')](_0x30f52d[_0x8660('0x2f')]);if(_0x30f52d[_0x8660('0x30')]){delete _0x30f52d['name'];}_0x6afb7[_0x8660('0x1c')](_0x371fcd)[_0x8660('0x31')](_0x30f52d);};}exports[_0x8660('0x32')]=function(_0x3d2614,_0x1defaa){var _0x5c9523={},_0x270dbb={},_0x50287d={'count':0x0,'rows':[]};var _0xa5f489=_[_0x8660('0x33')](db[_0x8660('0x34')][_0x8660('0x35')],function(_0x5bfc1e){return{'name':_0x5bfc1e['fieldName'],'type':_0x5bfc1e[_0x8660('0x36')]['key']};});_0x270dbb[_0x8660('0x37')]=_[_0x8660('0x33')](_0xa5f489,'name');_0x270dbb[_0x8660('0x38')]=_[_0x8660('0x39')](_0x3d2614[_0x8660('0x38')]);_0x270dbb[_0x8660('0x3a')]=_[_0x8660('0x3b')](_0x270dbb[_0x8660('0x37')],_0x270dbb[_0x8660('0x38')]);_0x5c9523[_0x8660('0x3c')]=_[_0x8660('0x3b')](_0x270dbb[_0x8660('0x37')],qs[_0x8660('0x3d')](_0x3d2614['query']['fields']));_0x5c9523['attributes']=_0x5c9523[_0x8660('0x3c')]['length']?_0x5c9523[_0x8660('0x3c')]:_0x270dbb[_0x8660('0x37')];if(!_0x3d2614[_0x8660('0x38')][_0x8660('0x3e')](_0x8660('0x3f'))){_0x5c9523['limit']=qs['limit'](_0x3d2614[_0x8660('0x38')]['limit']);_0x5c9523[_0x8660('0x1f')]=qs['offset'](_0x3d2614[_0x8660('0x38')][_0x8660('0x1f')]);}_0x5c9523[_0x8660('0x40')]=qs['sort'](_0x3d2614[_0x8660('0x38')][_0x8660('0x41')]);_0x5c9523['where']=qs[_0x8660('0x3a')](_[_0x8660('0x42')](_0x3d2614[_0x8660('0x38')],_0x270dbb['filters']),_0xa5f489);if(_0x3d2614[_0x8660('0x38')][_0x8660('0x43')]){_0x5c9523['where']=_[_0x8660('0x44')](_0x5c9523[_0x8660('0x45')],{'$or':_[_0x8660('0x33')](_0xa5f489,function(_0x5b927a){if(_0x5b927a[_0x8660('0x36')]!==_0x8660('0x46')){var _0x4af734={};_0x4af734[_0x5b927a[_0x8660('0x30')]]={'$like':'%'+_0x3d2614['query'][_0x8660('0x43')]+'%'};return _0x4af734;}})});}_0x5c9523=_[_0x8660('0x44')]({},_0x5c9523,_0x3d2614[_0x8660('0x47')]);var _0x5b4344={'where':_0x5c9523['where']};return db['Plugin'][_0x8660('0x22')](_0x5b4344)[_0x8660('0x29')](function(_0x106f2a){_0x50287d[_0x8660('0x22')]=_0x106f2a;if(_0x3d2614[_0x8660('0x38')][_0x8660('0x48')]){_0x5c9523['include']=[{'all':!![]}];}return db[_0x8660('0x34')]['findAll'](_0x5c9523);})[_0x8660('0x29')](function(_0xaad073){_0x50287d[_0x8660('0x49')]=_0xaad073;return _0x50287d;})[_0x8660('0x29')](respondWithFilteredResult(_0x1defaa,_0x5c9523))['catch'](handleError(_0x1defaa,null));};exports[_0x8660('0x4a')]=function(_0x178b7f,_0x54571d){var _0xb0bc66={'raw':!![],'where':{'id':_0x178b7f[_0x8660('0x4b')]['id']}},_0x6af26={};_0x6af26[_0x8660('0x37')]=_[_0x8660('0x39')](db[_0x8660('0x34')][_0x8660('0x35')]);_0x6af26[_0x8660('0x38')]=_[_0x8660('0x39')](_0x178b7f[_0x8660('0x38')]);_0x6af26[_0x8660('0x3a')]=_[_0x8660('0x3b')](_0x6af26[_0x8660('0x37')],_0x6af26[_0x8660('0x38')]);_0xb0bc66[_0x8660('0x3c')]=_['intersection'](_0x6af26[_0x8660('0x37')],qs[_0x8660('0x3d')](_0x178b7f[_0x8660('0x38')][_0x8660('0x3d')]));_0xb0bc66[_0x8660('0x3c')]=_0xb0bc66[_0x8660('0x3c')][_0x8660('0x4c')]?_0xb0bc66[_0x8660('0x3c')]:_0x6af26[_0x8660('0x37')];if(_0x178b7f[_0x8660('0x38')][_0x8660('0x48')]){_0xb0bc66[_0x8660('0x4d')]=[{'all':!![]}];}_0xb0bc66=_[_0x8660('0x44')]({},_0xb0bc66,_0x178b7f[_0x8660('0x47')]);return db[_0x8660('0x34')][_0x8660('0x4e')](_0xb0bc66)[_0x8660('0x29')](handleEntityNotFound(_0x54571d,null))[_0x8660('0x29')](respondWithResult(_0x54571d,null))[_0x8660('0x4f')](handleError(_0x54571d,null));};exports[_0x8660('0x50')]=function(_0x1f9b63,_0x5aba85,_0x56db92){return db[_0x8660('0x34')][_0x8660('0x4e')]({'where':{'id':_0x1f9b63[_0x8660('0x4b')]['id']},'attributes':[_0x8660('0x30'),_0x8660('0x7')],'raw':!![]})[_0x8660('0x29')](handleEntityNotFound(_0x5aba85,null))[_0x8660('0x29')](function(_0xd22ce1){if(_0xd22ce1){var _0x3a3c8f=path[_0x8660('0x51')](config[_0x8660('0x52')],_0x8660('0x53'),util[_0x8660('0x54')](_0x8660('0x55'),path[_0x8660('0x56')](_0xd22ce1['path'])));var _0x4ec0fb=fs['createWriteStream'](_0x3a3c8f);var _0x24e0b2=archiver('zip',{'zlib':{'level':0x9}});_0x24e0b2['on'](_0x8660('0x57'),function(_0x11ea30){if(_0x11ea30['code']==='ENOENT'){logger[_0x8660('0x2e')](_0x11ea30);}else{throw new db[(_0x8660('0x58'))][(_0x8660('0x59'))](_0x8660('0x5a'));}});_0x24e0b2['on']('error',function(_0x43e060){throw new db[(_0x8660('0x58'))][(_0x8660('0x59'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x24e0b2[_0x8660('0x5b')](_0x4ec0fb);_0x24e0b2['glob'](_0x8660('0x5c'),{'cwd':path[_0x8660('0x51')](config[_0x8660('0x52')],_0x8660('0x53'),path[_0x8660('0x5d')](_0xd22ce1[_0x8660('0x7')])),'ignore':[path[_0x8660('0x51')](path[_0x8660('0x56')](_0xd22ce1[_0x8660('0x7')]),_0x8660('0x5e')),path[_0x8660('0x51')](path[_0x8660('0x56')](_0xd22ce1[_0x8660('0x7')]),'attachments/**/*')],'nodir':!![]})[_0x8660('0x5f')]();_0x4ec0fb['on'](_0x8660('0x60'),function(){if(!fs[_0x8660('0x61')](_0x3a3c8f)){throw new db[(_0x8660('0x58'))]['Error'](_0x8660('0x62'));}return _0x5aba85[_0x8660('0x50')](_0x3a3c8f,util[_0x8660('0x54')](_0x8660('0x55'),path[_0x8660('0x56')](_0xd22ce1['path'])),function(_0x46e945){if(_0x46e945){throw new db['Sequelize'][(_0x8660('0x59'))](_0x8660('0x63'));}fs[_0x8660('0x64')](_0x3a3c8f);logger['info'](_0x8660('0x65'));logger[_0x8660('0x66')](_0x8660('0x67'));});});}return null;})[_0x8660('0x4f')](handleError(_0x5aba85,null));};exports['upload']=function(_0x35067b,_0x347303,_0x35cab5){var _0x33f099=path[_0x8660('0x56')](_0x35067b[_0x8660('0x68')][_0x8660('0x69')],path[_0x8660('0x6a')](_0x35067b[_0x8660('0x68')][_0x8660('0x69')]));var _0x3a6961=path[_0x8660('0x51')](config[_0x8660('0x52')],_0x8660('0x53'),_0x35067b[_0x8660('0x68')][_0x8660('0x69')]);var _0x4ecf2d=path[_0x8660('0x51')](config[_0x8660('0x52')],_0x8660('0x53'),_0x33f099);logger['info']('Plugin\x20upload\x20filepath:\x20%s',_0x3a6961);logger[_0x8660('0x66')]('Plugin\x20upload\x20destination:\x20%s',_0x4ecf2d);try{fs[_0x8660('0x6b')](_0x3a6961,parseInt(_0x8660('0x6c'),0x8));extract(_0x3a6961,{'dir':_0x4ecf2d},function(_0x20a027){if(_0x20a027){logger[_0x8660('0x2e')](_0x20a027);handleError(_0x20a027,!![]);};var _0x2816db=fs[_0x8660('0x6d')](_0x4ecf2d);if(_0x2816db[_0x8660('0x4c')]>0x1){removeReferences(_0x3a6961,_0x4ecf2d);logger[_0x8660('0x2e')]('Invalid\x20plugin\x20structure');return _0x35cab5(new Error(_0x8660('0x6e')));}var _0x55a306=fs[_0x8660('0x6f')](path[_0x8660('0x51')](_0x4ecf2d,_0x2816db[0x0]));if(_0x55a306[_0x8660('0x70')]()){removeReferences(_0x3a6961,_0x4ecf2d);logger[_0x8660('0x2e')](_0x8660('0x6e'));return _0x35cab5(new Error('Invalid\x20plugin\x20structure'));}if(_0x55a306[_0x8660('0x71')]()){var _0x4dc5ef=fs[_0x8660('0x6d')](path[_0x8660('0x51')](_0x4ecf2d,_0x2816db[0x0]));if(_0x4dc5ef[_0x8660('0x4c')]===0x0){removeReferences(_0x3a6961,_0x4ecf2d);logger['error'](_0x8660('0x6e'));return _0x35cab5(new Error('Invalid\x20plugin\x20structure'));}var _0x302dfa=_0x4dc5ef[_0x8660('0x72')](function(_0x26a3b4){return _0x26a3b4==='manifest.json';});if(!_0x302dfa){return _0x35cab5(new Error(_0x8660('0x73')));}var _0xc79df1=fs[_0x8660('0x74')](path[_0x8660('0x51')](_0x4ecf2d,_0x2816db[0x0],'manifest.json'));var _0x266ded=JSON['parse'](_0xc79df1);if(_0x8660('0x20')==typeof _0x266ded[_0x8660('0x30')]){return _0x35cab5(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x8660('0x20')==typeof _0x266ded[_0x8660('0x36')]){return _0x35cab5(new Error(_0x8660('0x75')));}if(_0x8660('0x20')==typeof _0x266ded[_0x8660('0x76')]){return _0x35cab5(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x8660('0x20')==typeof _0x266ded[_0x8660('0x77')]){return _0x35cab5(new Error(_0x8660('0x78')));}if(_0x266ded[_0x8660('0x36')]===_0x8660('0x79')){if(_0x8660('0x20')==typeof _0x266ded['parameters'][_0x8660('0x7a')]){return _0x35cab5(new Error(_0x8660('0x7b')));}if(_0x8660('0x20')==typeof _0x266ded[_0x8660('0x77')][_0x8660('0x7a')][_0x8660('0x7c')]&&_0x8660('0x20')==typeof _0x266ded['parameters']['views'][_0x8660('0x7d')]){return _0x35cab5(new Error(_0x8660('0x7e')));}}else if(_0x266ded[_0x8660('0x36')]===_0x8660('0x7f')){if(_0x8660('0x20')==typeof _0x266ded[_0x8660('0x77')][_0x8660('0x80')]){return _0x35cab5(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if('undefined'==typeof _0x266ded[_0x8660('0x77')][_0x8660('0x81')]){return _0x35cab5(new Error(_0x8660('0x82')));}}else{return _0x35cab5(new Error(_0x8660('0x83')));}var _0x39b3ca=_0x266ded['name'];var _0x4ab08d=_0x266ded[_0x8660('0x84')];var _0x229106=_0x266ded[_0x8660('0x36')];var _0x21dbfb=_0x266ded['sidebar']?_0x266ded[_0x8660('0x85')]:'always';var _0x30f981=_0x266ded['icon']?_0x266ded[_0x8660('0x86')]:'icon-apps';var _0x2d14ea='';var _0x29c042='';var _0x8dd3dd='';var _0x978140='';var _0x36d1da=_0x266ded['version'];if(_0x229106===_0x8660('0x79')){if(_0x8660('0x20')!=typeof _0x266ded['parameters']['views'][_0x8660('0x7c')]){var _0x1c16fb=_0x266ded[_0x8660('0x77')][_0x8660('0x7a')][_0x8660('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0x8660('0x87')](_0x1c16fb)){_0x2d14ea=path[_0x8660('0x51')](_0x8660('0x88'),_0x33f099,_0x2816db[0x0],_0x1c16fb);}else{_0x2d14ea=_0x1c16fb;}}else{logger[_0x8660('0x66')](_0x8660('0x89'));}if('undefined'!=typeof _0x266ded[_0x8660('0x77')][_0x8660('0x7a')]['agent']){var _0x58050b=_0x266ded[_0x8660('0x77')][_0x8660('0x7a')][_0x8660('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x8660('0x87')](_0x58050b)){_0x29c042=path[_0x8660('0x51')](_0x8660('0x88'),_0x33f099,_0x2816db[0x0],_0x58050b);}else{_0x29c042=_0x58050b;}}else{logger[_0x8660('0x66')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x229106===_0x8660('0x7f')){_0x8dd3dd=_0x266ded[_0x8660('0x77')][_0x8660('0x80')];_0x978140=_0x266ded[_0x8660('0x77')][_0x8660('0x81')];if(_0x8660('0x20')!=typeof _0x266ded[_0x8660('0x77')][_0x8660('0x7a')]){if(_0x8660('0x20')!=typeof _0x266ded[_0x8660('0x77')][_0x8660('0x7a')][_0x8660('0x7c')]){var _0x1c16fb=_0x266ded[_0x8660('0x77')][_0x8660('0x7a')][_0x8660('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0x8660('0x87')](_0x1c16fb)){_0x2d14ea=path[_0x8660('0x51')](_0x8660('0x88'),_0x33f099,_0x2816db[0x0],_0x1c16fb);}else{_0x2d14ea=_0x1c16fb;}}if('undefined'!=typeof _0x266ded[_0x8660('0x77')][_0x8660('0x7a')][_0x8660('0x7d')]){var _0x58050b=_0x266ded['parameters'][_0x8660('0x7a')][_0x8660('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x8660('0x87')](_0x58050b)){_0x29c042=path[_0x8660('0x51')](_0x8660('0x88'),_0x33f099,_0x2816db[0x0],_0x58050b);}else{_0x29c042=_0x58050b;}}}}var _0x4dde81={'name':_0x39b3ca,'description':_0x4ab08d,'path':path[_0x8660('0x51')](_0x33f099,_0x2816db[0x0]),'type':_0x229106,'sidebar':_0x21dbfb,'icon':_0x30f981,'adminUrl':_0x2d14ea,'agentUrl':_0x29c042,'scriptName':_0x8dd3dd,'scriptPath':_0x978140,'version':_0x36d1da};removeReferences(_0x3a6961,null);return db[_0x8660('0x34')]['create'](_0x4dde81)[_0x8660('0x29')](function(_0x22b028){var _0x5c1b2d={'role':_0x35067b[_0x8660('0x8a')][_0x8660('0x8b')],'userProfileId':_0x35067b[_0x8660('0x8a')][_0x8660('0x8c')]};if(!_0x5c1b2d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c1b2d[_0x8660('0x8b')]==='user'){var _0x31049e=_0x22b028[_0x8660('0x2b')]({'plain':!![]});return db[_0x8660('0x8d')][_0x8660('0x4e')]({'where':{'name':'Plugins','userProfileId':_0x5c1b2d[_0x8660('0x8c')]},'raw':!![]})['then'](function(_0x14a3bf){if(_0x14a3bf&&_0x14a3bf['autoAssociation']===0x0){return db[_0x8660('0x2d')][_0x8660('0x8e')]({'name':_0x31049e[_0x8660('0x30')],'resourceId':_0x31049e['id'],'type':_0x14a3bf[_0x8660('0x30')],'sectionId':_0x14a3bf['id']},{})[_0x8660('0x29')](function(){return _0x22b028;});}else{return _0x22b028;}})[_0x8660('0x4f')](function(_0x2d2cbb){logger[_0x8660('0x2e')](_0x8660('0x8f'),_0x2d2cbb);throw _0x2d2cbb;});}return _0x22b028;})[_0x8660('0x29')](respondWithResult(_0x347303,null))[_0x8660('0x4f')](handleError(_0x347303,null));}});}catch(_0x1b0846){_0x347303[_0x8660('0x1c')](0x1f4)['send'](_0x1b0846);}};function removeReferences(_0x46aa2a,_0x3a175a){try{if(_0x46aa2a){fs[_0x8660('0x64')](_0x46aa2a);logger[_0x8660('0x66')]('Zip\x20archive\x20removed');}if(_0x3a175a){rimraf(_0x3a175a,function(){});logger[_0x8660('0x66')](_0x8660('0x90'));}}catch(_0x320228){logger[_0x8660('0x2e')](_0x320228);}}exports[_0x8660('0x28')]=function(_0x21808c,_0x36b2b1,_0x22b467){return db[_0x8660('0x34')][_0x8660('0x4e')]({'where':{'id':_0x21808c[_0x8660('0x4b')]['id']}})[_0x8660('0x29')](handleEntityNotFound(_0x36b2b1,null))[_0x8660('0x29')](saveUpdates(_0x21808c['body'],null))[_0x8660('0x29')](respondWithResult(_0x36b2b1,null))[_0x8660('0x4f')](handleError(_0x36b2b1,null));};exports[_0x8660('0x91')]=function(_0x55e686,_0x59cc74,_0x388735){return db[_0x8660('0x34')]['find']({'where':{'id':_0x55e686[_0x8660('0x4b')]['id']}})[_0x8660('0x29')](function(_0x3f7459){if(_0x3f7459){return _0x3f7459[_0x8660('0x2a')]();}})[_0x8660('0x29')](function(_0x4e1c1d){rimraf(path[_0x8660('0x51')](config['root'],_0x8660('0x53'),path[_0x8660('0x5d')](_0x4e1c1d[_0x8660('0x7')])),function(){});return _0x4e1c1d;})[_0x8660('0x29')](handleEntityNotFound(_0x59cc74,null))['then'](respondWithStatusCode(_0x59cc74,null))[_0x8660('0x4f')](handleError(_0x59cc74,null));};exports[_0x8660('0x92')]=function(_0x2581fa,_0x598ebb,_0x2a4d8e){return BPromise['resolve']()['then'](function(){if(!_0x2581fa['query'][_0x8660('0x7')]){throw new Error(_0x8660('0x93'));}if(!_0x2581fa[_0x8660('0x38')][_0x8660('0x94')]){throw new Error(_0x8660('0x95'));}var _0x29ee67=_0x2581fa[_0x8660('0x38')][_0x8660('0x96')]?_0x2581fa[_0x8660('0x38')]['hostname']+':'+_0x2581fa[_0x8660('0x38')][_0x8660('0x94')]:'http://localhost:'+_0x2581fa[_0x8660('0x38')][_0x8660('0x94')];var _0x38056e=_0x2581fa[_0x8660('0x38')]['json']?_0x2581fa[_0x8660('0x38')][_0x8660('0x1e')]:!![];var _0x3de027=_0x2581fa[_0x8660('0x38')]['encoding']?_0x2581fa['query'][_0x8660('0x97')]:null;var _0x5af7ee={'method':_0x2581fa[_0x8660('0x98')],'uri':util[_0x8660('0x54')](_0x8660('0x99'),_0x29ee67,_0x2581fa['query'][_0x8660('0x7')]),'json':_0x38056e,'resolveWithFullResponse':!![],'encoding':_0x3de027,'qs':_0x2581fa[_0x8660('0x38')]};if(_0x2581fa['headers']){_0x5af7ee[_0x8660('0x9a')]=_0x2581fa['headers'];if(_0x5af7ee['headers'][_0x8660('0x9b')]){delete _0x5af7ee[_0x8660('0x9a')][_0x8660('0x9b')];}}if(_0x5af7ee[_0x8660('0x9a')]['content-type']){delete _0x5af7ee[_0x8660('0x9a')][_0x8660('0x9c')];}return rp(_0x5af7ee);})['then'](function(_0x33022e){if(_0x33022e){_0x598ebb[_0x8660('0x23')](_0x33022e[_0x8660('0x9a')]);logger['info'](_0x33022e['body']);if(_[_0x8660('0x9d')](_0x2581fa[_0x8660('0x38')]['path'],'download')&&_0x33022e[_0x8660('0x9e')]==0x1f4){return _0x598ebb[_0x8660('0x1b')](_0x33022e[_0x8660('0x9e')]);}else{return _0x598ebb[_0x8660('0x1c')](_0x33022e[_0x8660('0x9e')])[_0x8660('0x31')](_0x33022e['body']);}}else{return _0x598ebb[_0x8660('0x1b')](0xc8);}})[_0x8660('0x4f')](handleError(_0x598ebb,null));};exports[_0x8660('0x9f')]=function(_0x5b6172,_0x10a273,_0x448b5e){return BPromise['resolve']()[_0x8660('0x29')](function(){if(!_0x5b6172[_0x8660('0x38')][_0x8660('0x7')]){throw new Error(_0x8660('0x93'));}if(!_0x5b6172[_0x8660('0x38')][_0x8660('0x94')]){throw new Error(_0x8660('0x95'));}var _0x1ce5b0=_0x5b6172[_0x8660('0x38')][_0x8660('0x96')]?_0x5b6172[_0x8660('0x38')][_0x8660('0x96')]+':'+_0x5b6172[_0x8660('0x38')][_0x8660('0x94')]:_0x8660('0xa0')+_0x5b6172[_0x8660('0x38')][_0x8660('0x94')];var _0x51eb79=_0x5b6172['query'][_0x8660('0x1e')]?_0x5b6172[_0x8660('0x38')][_0x8660('0x1e')]:!![];var _0x1c125b=_0x5b6172[_0x8660('0x38')]['encoding']?_0x5b6172[_0x8660('0x38')][_0x8660('0x97')]:null;var _0x124963={'method':_0x5b6172[_0x8660('0x98')],'uri':util[_0x8660('0x54')]('%s%s',_0x1ce5b0,_0x5b6172['query'][_0x8660('0x7')]),'json':_0x51eb79,'resolveWithFullResponse':!![],'encoding':_0x1c125b,'body':_0x5b6172[_0x8660('0x8a')]};if(_0x5b6172['headers']){_0x124963[_0x8660('0x9a')]=_0x5b6172[_0x8660('0x9a')];if(_0x124963[_0x8660('0x9a')]['content-length']){delete _0x124963[_0x8660('0x9a')][_0x8660('0x9b')];}}if(_0x124963[_0x8660('0x9a')]['content-type']){delete _0x124963[_0x8660('0x9a')]['content-type'];}return rp(_0x124963);})[_0x8660('0x29')](function(_0xddafa0){if(_0xddafa0){_0x10a273[_0x8660('0x23')](_0xddafa0['headers']);logger['info'](_0xddafa0[_0x8660('0x8a')]);return _0x10a273[_0x8660('0x1c')](_0xddafa0['statusCode'])[_0x8660('0x31')](_0xddafa0[_0x8660('0x8a')]);}else{return _0x10a273[_0x8660('0x1b')](0xc8);}})[_0x8660('0x4f')](handleError(_0x10a273,null));}; \ No newline at end of file +var _0xd0ac=['end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','get','Plugins','destroy','sendStatus','error','stack','name','index','rawAttributes','type','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','filter','VIRTUAL','options','include','Plugin','findAll','rows','catch','show','params','keys','includeAll','merge','find','download','path','root','server/files/plugins','format','%s.zip','basename','createWriteStream','code','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','dirname','join','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Sequelize','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','manifest.json','readFileSync','Invalid\x20manifest:\x20type\x20missing','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','icon-apps','admin','test','plugins','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','json','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./plugin.socket','register','status'];(function(_0x3ebb69,_0x3e612e){var _0x421e59=function(_0x5a8c66){while(--_0x5a8c66){_0x3ebb69['push'](_0x3ebb69['shift']());}};_0x421e59(++_0x3e612e);}(_0xd0ac,0x130));var _0xcd0a=function(_0x4f2a47,_0x42d97f){_0x4f2a47=_0x4f2a47-0x0;var _0x4e80cc=_0xd0ac[_0x4f2a47];return _0x4e80cc;};'use strict';var emlformat=require(_0xcd0a('0x0'));var rimraf=require(_0xcd0a('0x1'));var zipdir=require(_0xcd0a('0x2'));var jsonpatch=require(_0xcd0a('0x3'));var rp=require(_0xcd0a('0x4'));var moment=require('moment');var BPromise=require(_0xcd0a('0x5'));var Mustache=require(_0xcd0a('0x6'));var util=require(_0xcd0a('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xcd0a('0x8'));var ejs=require(_0xcd0a('0x9'));var fs=require('fs');var fs_extra=require(_0xcd0a('0xa'));var _=require(_0xcd0a('0xb'));var squel=require(_0xcd0a('0xc'));var crypto=require('crypto');var jsforce=require(_0xcd0a('0xd'));var deskjs=require(_0xcd0a('0xe'));var toCsv=require('to-csv');var querystring=require(_0xcd0a('0xf'));var Papa=require('papaparse');var extract=require(_0xcd0a('0x10'));var rimraf=require(_0xcd0a('0x1'));var archiver=require(_0xcd0a('0x11'));var Redis=require(_0xcd0a('0x12'));var authService=require(_0xcd0a('0x13'));var qs=require(_0xcd0a('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xcd0a('0x15'))(_0xcd0a('0x16'));var utils=require(_0xcd0a('0x17'));var config=require(_0xcd0a('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xcd0a('0x19'))['db'];config[_0xcd0a('0x1a')]=_[_0xcd0a('0x1b')](config[_0xcd0a('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xcd0a('0x1c'))(new Redis(config[_0xcd0a('0x1a')]));require(_0xcd0a('0x1d'))[_0xcd0a('0x1e')](socket);function respondWithStatusCode(_0x1a1702,_0xa1451a){_0xa1451a=_0xa1451a||0xcc;return function(_0x1535e1){if(_0x1535e1){return _0x1a1702['sendStatus'](_0xa1451a);}return _0x1a1702[_0xcd0a('0x1f')](_0xa1451a)[_0xcd0a('0x20')]();};}function respondWithResult(_0x2e2fb5,_0x5ce101){_0x5ce101=_0x5ce101||0xc8;return function(_0x2b3168){if(_0x2b3168){return _0x2e2fb5['status'](_0x5ce101)['json'](_0x2b3168);}};}function respondWithFilteredResult(_0x5a5259,_0x543d31){return function(_0x24558d){if(_0x24558d){var _0x44ec5e=typeof _0x543d31[_0xcd0a('0x21')]==='undefined'&&typeof _0x543d31['limit']===_0xcd0a('0x22');var _0x324266=_0x24558d[_0xcd0a('0x23')];var _0x4be87a=_0x44ec5e?0x0:_0x543d31[_0xcd0a('0x21')];var _0x29c438=_0x44ec5e?_0x24558d[_0xcd0a('0x23')]:_0x543d31[_0xcd0a('0x21')]+_0x543d31[_0xcd0a('0x24')];var _0x6a0b2d;if(_0x29c438>=_0x324266){_0x29c438=_0x324266;_0x6a0b2d=0xc8;}else{_0x6a0b2d=0xce;}_0x5a5259[_0xcd0a('0x1f')](_0x6a0b2d);return _0x5a5259[_0xcd0a('0x25')](_0xcd0a('0x26'),_0x4be87a+'-'+_0x29c438+'/'+_0x324266)['json'](_0x24558d);}return null;};}function patchUpdates(_0x65f191){return function(_0x188b93){try{jsonpatch[_0xcd0a('0x27')](_0x188b93,_0x65f191,!![]);}catch(_0x1555b7){return BPromise[_0xcd0a('0x28')](_0x1555b7);}return _0x188b93[_0xcd0a('0x29')]();};}function saveUpdates(_0x1225a1,_0x50a2ca){return function(_0x4c1ce9){if(_0x4c1ce9){return _0x4c1ce9[_0xcd0a('0x2a')](_0x1225a1)[_0xcd0a('0x2b')](function(_0x21ae33){return _0x21ae33;});}return null;};}function removeEntity(_0x36a375,_0x20dbdb){return function(_0x32f500){if(_0x32f500){return _0x32f500['destroy']()[_0xcd0a('0x2b')](function(){var _0x30d577=_0x32f500[_0xcd0a('0x2c')]({'plain':!![]});var _0x38edeb=_0xcd0a('0x2d');return db['UserProfileResource'][_0xcd0a('0x2e')]({'where':{'type':_0x38edeb,'resourceId':_0x30d577['id']}})[_0xcd0a('0x2b')](function(){return _0x32f500;});})[_0xcd0a('0x2b')](function(){_0x36a375['status'](0xcc)[_0xcd0a('0x20')]();});}};}function handleEntityNotFound(_0xbdb1ce,_0x175578){return function(_0x30868c){if(!_0x30868c){_0xbdb1ce[_0xcd0a('0x2f')](0x194);}return _0x30868c;};}function handleError(_0x34b164,_0x3c4017){_0x3c4017=_0x3c4017||0x1f4;return function(_0x6d3e66){logger[_0xcd0a('0x30')](_0x6d3e66[_0xcd0a('0x31')]);if(_0x6d3e66[_0xcd0a('0x32')]){delete _0x6d3e66['name'];}_0x34b164[_0xcd0a('0x1f')](_0x3c4017)['send'](_0x6d3e66);};}exports[_0xcd0a('0x33')]=function(_0x1f885c,_0xf8b963){var _0x41b83c={},_0x6c0aa1={},_0x293bf6={'count':0x0,'rows':[]};var _0x471bbc=_['map'](db['Plugin'][_0xcd0a('0x34')],function(_0x49b744){return{'name':_0x49b744['fieldName'],'type':_0x49b744[_0xcd0a('0x35')][_0xcd0a('0x36')]};});_0x6c0aa1['model']=_[_0xcd0a('0x37')](_0x471bbc,_0xcd0a('0x32'));_0x6c0aa1[_0xcd0a('0x38')]=_['keys'](_0x1f885c['query']);_0x6c0aa1[_0xcd0a('0x39')]=_[_0xcd0a('0x3a')](_0x6c0aa1[_0xcd0a('0x3b')],_0x6c0aa1[_0xcd0a('0x38')]);_0x41b83c[_0xcd0a('0x3c')]=_['intersection'](_0x6c0aa1[_0xcd0a('0x3b')],qs[_0xcd0a('0x3d')](_0x1f885c[_0xcd0a('0x38')]['fields']));_0x41b83c[_0xcd0a('0x3c')]=_0x41b83c[_0xcd0a('0x3c')][_0xcd0a('0x3e')]?_0x41b83c[_0xcd0a('0x3c')]:_0x6c0aa1[_0xcd0a('0x3b')];if(!_0x1f885c[_0xcd0a('0x38')][_0xcd0a('0x3f')]('nolimit')){_0x41b83c[_0xcd0a('0x24')]=qs['limit'](_0x1f885c['query'][_0xcd0a('0x24')]);_0x41b83c[_0xcd0a('0x21')]=qs['offset'](_0x1f885c[_0xcd0a('0x38')]['offset']);}_0x41b83c['order']=qs[_0xcd0a('0x40')](_0x1f885c[_0xcd0a('0x38')][_0xcd0a('0x40')]);_0x41b83c[_0xcd0a('0x41')]=qs[_0xcd0a('0x39')](_['pick'](_0x1f885c[_0xcd0a('0x38')],_0x6c0aa1[_0xcd0a('0x39')]),_0x471bbc);if(_0x1f885c[_0xcd0a('0x38')][_0xcd0a('0x42')]){_0x41b83c[_0xcd0a('0x41')]=_['merge'](_0x41b83c[_0xcd0a('0x41')],{'$or':_[_0xcd0a('0x37')](_0x471bbc,function(_0x8bbca1){if(_0x8bbca1[_0xcd0a('0x35')]!==_0xcd0a('0x43')){var _0x32fa95={};_0x32fa95[_0x8bbca1[_0xcd0a('0x32')]]={'$like':'%'+_0x1f885c[_0xcd0a('0x38')][_0xcd0a('0x42')]+'%'};return _0x32fa95;}})});}_0x41b83c=_['merge']({},_0x41b83c,_0x1f885c[_0xcd0a('0x44')]);var _0x5301a6={'where':_0x41b83c[_0xcd0a('0x41')]};return db['Plugin'][_0xcd0a('0x23')](_0x5301a6)[_0xcd0a('0x2b')](function(_0x5df35d){_0x293bf6[_0xcd0a('0x23')]=_0x5df35d;if(_0x1f885c[_0xcd0a('0x38')]['includeAll']){_0x41b83c[_0xcd0a('0x45')]=[{'all':!![]}];}return db[_0xcd0a('0x46')][_0xcd0a('0x47')](_0x41b83c);})[_0xcd0a('0x2b')](function(_0x231eae){_0x293bf6[_0xcd0a('0x48')]=_0x231eae;return _0x293bf6;})[_0xcd0a('0x2b')](respondWithFilteredResult(_0xf8b963,_0x41b83c))[_0xcd0a('0x49')](handleError(_0xf8b963,null));};exports[_0xcd0a('0x4a')]=function(_0x3bc0a5,_0x49a65){var _0x98ead7={'raw':!![],'where':{'id':_0x3bc0a5[_0xcd0a('0x4b')]['id']}},_0x14a94f={};_0x14a94f[_0xcd0a('0x3b')]=_[_0xcd0a('0x4c')](db[_0xcd0a('0x46')][_0xcd0a('0x34')]);_0x14a94f[_0xcd0a('0x38')]=_[_0xcd0a('0x4c')](_0x3bc0a5[_0xcd0a('0x38')]);_0x14a94f['filters']=_['intersection'](_0x14a94f[_0xcd0a('0x3b')],_0x14a94f['query']);_0x98ead7[_0xcd0a('0x3c')]=_[_0xcd0a('0x3a')](_0x14a94f['model'],qs[_0xcd0a('0x3d')](_0x3bc0a5[_0xcd0a('0x38')]['fields']));_0x98ead7['attributes']=_0x98ead7['attributes'][_0xcd0a('0x3e')]?_0x98ead7[_0xcd0a('0x3c')]:_0x14a94f[_0xcd0a('0x3b')];if(_0x3bc0a5[_0xcd0a('0x38')][_0xcd0a('0x4d')]){_0x98ead7['include']=[{'all':!![]}];}_0x98ead7=_[_0xcd0a('0x4e')]({},_0x98ead7,_0x3bc0a5[_0xcd0a('0x44')]);return db[_0xcd0a('0x46')][_0xcd0a('0x4f')](_0x98ead7)[_0xcd0a('0x2b')](handleEntityNotFound(_0x49a65,null))[_0xcd0a('0x2b')](respondWithResult(_0x49a65,null))[_0xcd0a('0x49')](handleError(_0x49a65,null));};exports[_0xcd0a('0x50')]=function(_0x42ec2c,_0x515865,_0x2a4d81){return db['Plugin'][_0xcd0a('0x4f')]({'where':{'id':_0x42ec2c[_0xcd0a('0x4b')]['id']},'attributes':[_0xcd0a('0x32'),_0xcd0a('0x51')],'raw':!![]})[_0xcd0a('0x2b')](handleEntityNotFound(_0x515865,null))[_0xcd0a('0x2b')](function(_0x37c485){if(_0x37c485){var _0x4ed45f=path['join'](config[_0xcd0a('0x52')],_0xcd0a('0x53'),util[_0xcd0a('0x54')](_0xcd0a('0x55'),path[_0xcd0a('0x56')](_0x37c485[_0xcd0a('0x51')])));var _0x34af84=fs[_0xcd0a('0x57')](_0x4ed45f);var _0x4caaa6=archiver('zip',{'zlib':{'level':0x9}});_0x4caaa6['on']('warning',function(_0x11e5f1){if(_0x11e5f1[_0xcd0a('0x58')]==='ENOENT'){logger[_0xcd0a('0x30')](_0x11e5f1);}else{throw new db['Sequelize']['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x4caaa6['on']('error',function(_0x4fba04){throw new db['Sequelize'][(_0xcd0a('0x59'))](_0xcd0a('0x5a'));});_0x4caaa6[_0xcd0a('0x5b')](_0x34af84);_0x4caaa6[_0xcd0a('0x5c')]('**/*',{'cwd':path['join'](config[_0xcd0a('0x52')],'server/files/plugins',path[_0xcd0a('0x5d')](_0x37c485[_0xcd0a('0x51')])),'ignore':[path[_0xcd0a('0x5e')](path[_0xcd0a('0x56')](_0x37c485[_0xcd0a('0x51')]),_0xcd0a('0x5f')),path[_0xcd0a('0x5e')](path[_0xcd0a('0x56')](_0x37c485[_0xcd0a('0x51')]),_0xcd0a('0x60'))],'nodir':!![]})[_0xcd0a('0x61')]();_0x34af84['on'](_0xcd0a('0x62'),function(){if(!fs[_0xcd0a('0x63')](_0x4ed45f)){throw new db['Sequelize']['Error'](_0xcd0a('0x64'));}return _0x515865[_0xcd0a('0x50')](_0x4ed45f,util[_0xcd0a('0x54')](_0xcd0a('0x55'),path[_0xcd0a('0x56')](_0x37c485[_0xcd0a('0x51')])),function(_0x2fc428){if(_0x2fc428){throw new db[(_0xcd0a('0x65'))][(_0xcd0a('0x59'))](_0xcd0a('0x66'));}fs['unlinkSync'](_0x4ed45f);logger[_0xcd0a('0x67')](_0xcd0a('0x68'));logger[_0xcd0a('0x67')]('Temporary\x20file\x20removed');});});}return null;})[_0xcd0a('0x49')](handleError(_0x515865,null));};exports[_0xcd0a('0x69')]=function(_0x4a2d99,_0x3425ba,_0x150674){var _0x5bb555=path[_0xcd0a('0x56')](_0x4a2d99[_0xcd0a('0x6a')][_0xcd0a('0x6b')],path['extname'](_0x4a2d99[_0xcd0a('0x6a')][_0xcd0a('0x6b')]));var _0x3e4d80=path[_0xcd0a('0x5e')](config[_0xcd0a('0x52')],_0xcd0a('0x53'),_0x4a2d99[_0xcd0a('0x6a')][_0xcd0a('0x6b')]);var _0x17f88a=path['join'](config[_0xcd0a('0x52')],'server/files/plugins',_0x5bb555);logger[_0xcd0a('0x67')](_0xcd0a('0x6c'),_0x3e4d80);logger[_0xcd0a('0x67')]('Plugin\x20upload\x20destination:\x20%s',_0x17f88a);try{fs['chmodSync'](_0x3e4d80,parseInt(_0xcd0a('0x6d'),0x8));extract(_0x3e4d80,{'dir':_0x17f88a},function(_0x2f8b9f){if(_0x2f8b9f){logger['error'](_0x2f8b9f);handleError(_0x2f8b9f,!![]);};var _0x3773b1=fs[_0xcd0a('0x6e')](_0x17f88a);if(_0x3773b1['length']>0x1){removeReferences(_0x3e4d80,_0x17f88a);logger[_0xcd0a('0x30')]('Invalid\x20plugin\x20structure');return _0x150674(new Error(_0xcd0a('0x6f')));}var _0xeaa054=fs[_0xcd0a('0x70')](path[_0xcd0a('0x5e')](_0x17f88a,_0x3773b1[0x0]));if(_0xeaa054['isFile']()){removeReferences(_0x3e4d80,_0x17f88a);logger[_0xcd0a('0x30')](_0xcd0a('0x6f'));return _0x150674(new Error('Invalid\x20plugin\x20structure'));}if(_0xeaa054['isDirectory']()){var _0x2d02d6=fs[_0xcd0a('0x6e')](path[_0xcd0a('0x5e')](_0x17f88a,_0x3773b1[0x0]));if(_0x2d02d6[_0xcd0a('0x3e')]===0x0){removeReferences(_0x3e4d80,_0x17f88a);logger[_0xcd0a('0x30')](_0xcd0a('0x6f'));return _0x150674(new Error(_0xcd0a('0x6f')));}var _0x20938e=_0x2d02d6['some'](function(_0x209a66){return _0x209a66===_0xcd0a('0x71');});if(!_0x20938e){return _0x150674(new Error('Plugin\x20manifest\x20missing'));}var _0x340c77=fs[_0xcd0a('0x72')](path[_0xcd0a('0x5e')](_0x17f88a,_0x3773b1[0x0],_0xcd0a('0x71')));var _0x503229=JSON['parse'](_0x340c77);if(_0xcd0a('0x22')==typeof _0x503229['name']){return _0x150674(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0xcd0a('0x22')==typeof _0x503229[_0xcd0a('0x35')]){return _0x150674(new Error(_0xcd0a('0x73')));}if(_0xcd0a('0x22')==typeof _0x503229[_0xcd0a('0x74')]){return _0x150674(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0xcd0a('0x22')==typeof _0x503229[_0xcd0a('0x75')]){return _0x150674(new Error(_0xcd0a('0x76')));}if(_0x503229[_0xcd0a('0x35')]===_0xcd0a('0x77')){if(_0xcd0a('0x22')==typeof _0x503229[_0xcd0a('0x75')][_0xcd0a('0x78')]){return _0x150674(new Error(_0xcd0a('0x79')));}if(_0xcd0a('0x22')==typeof _0x503229['parameters'][_0xcd0a('0x78')]['admin']&&'undefined'==typeof _0x503229[_0xcd0a('0x75')]['views'][_0xcd0a('0x7a')]){return _0x150674(new Error(_0xcd0a('0x7b')));}}else if(_0x503229[_0xcd0a('0x35')]===_0xcd0a('0x7c')){if(_0xcd0a('0x22')==typeof _0x503229[_0xcd0a('0x75')][_0xcd0a('0x7d')]){return _0x150674(new Error(_0xcd0a('0x7e')));}if(_0xcd0a('0x22')==typeof _0x503229[_0xcd0a('0x75')][_0xcd0a('0x7f')]){return _0x150674(new Error(_0xcd0a('0x80')));}}else{return _0x150674(new Error(_0xcd0a('0x81')));}var _0x538e94=_0x503229[_0xcd0a('0x32')];var _0x192f51=_0x503229[_0xcd0a('0x82')];var _0x36932c=_0x503229[_0xcd0a('0x35')];var _0x4c9ce9=_0x503229[_0xcd0a('0x83')]?_0x503229[_0xcd0a('0x83')]:'always';var _0x179651=_0x503229['icon']?_0x503229[_0xcd0a('0x84')]:_0xcd0a('0x85');var _0x406323='';var _0x213213='';var _0x5783c7='';var _0x9c26df='';var _0x40e61f=_0x503229[_0xcd0a('0x74')];if(_0x36932c==='html'){if(_0xcd0a('0x22')!=typeof _0x503229[_0xcd0a('0x75')][_0xcd0a('0x78')][_0xcd0a('0x86')]){var _0x1148c7=_0x503229[_0xcd0a('0x75')][_0xcd0a('0x78')][_0xcd0a('0x86')];if(!/^(f|ht)tps?:\/\//i[_0xcd0a('0x87')](_0x1148c7)){_0x406323=path['join']('plugins',_0x5bb555,_0x3773b1[0x0],_0x1148c7);}else{_0x406323=_0x1148c7;}}else{logger[_0xcd0a('0x67')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0xcd0a('0x22')!=typeof _0x503229[_0xcd0a('0x75')][_0xcd0a('0x78')]['agent']){var _0xbc89b3=_0x503229[_0xcd0a('0x75')]['views'][_0xcd0a('0x7a')];if(!/^(f|ht)tps?:\/\//i[_0xcd0a('0x87')](_0xbc89b3)){_0x213213=path[_0xcd0a('0x5e')](_0xcd0a('0x88'),_0x5bb555,_0x3773b1[0x0],_0xbc89b3);}else{_0x213213=_0xbc89b3;}}else{logger['info'](_0xcd0a('0x89'));}}else if(_0x36932c===_0xcd0a('0x7c')){_0x5783c7=_0x503229[_0xcd0a('0x75')][_0xcd0a('0x7d')];_0x9c26df=_0x503229['parameters'][_0xcd0a('0x7f')];if(_0xcd0a('0x22')!=typeof _0x503229['parameters'][_0xcd0a('0x78')]){if(_0xcd0a('0x22')!=typeof _0x503229[_0xcd0a('0x75')][_0xcd0a('0x78')][_0xcd0a('0x86')]){var _0x1148c7=_0x503229[_0xcd0a('0x75')]['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0xcd0a('0x87')](_0x1148c7)){_0x406323=path[_0xcd0a('0x5e')]('plugins',_0x5bb555,_0x3773b1[0x0],_0x1148c7);}else{_0x406323=_0x1148c7;}}if(_0xcd0a('0x22')!=typeof _0x503229[_0xcd0a('0x75')][_0xcd0a('0x78')][_0xcd0a('0x7a')]){var _0xbc89b3=_0x503229[_0xcd0a('0x75')][_0xcd0a('0x78')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xcd0a('0x87')](_0xbc89b3)){_0x213213=path[_0xcd0a('0x5e')](_0xcd0a('0x88'),_0x5bb555,_0x3773b1[0x0],_0xbc89b3);}else{_0x213213=_0xbc89b3;}}}}var _0x453baa={'name':_0x538e94,'description':_0x192f51,'path':path[_0xcd0a('0x5e')](_0x5bb555,_0x3773b1[0x0]),'type':_0x36932c,'sidebar':_0x4c9ce9,'icon':_0x179651,'adminUrl':_0x406323,'agentUrl':_0x213213,'scriptName':_0x5783c7,'scriptPath':_0x9c26df,'version':_0x40e61f};removeReferences(_0x3e4d80,null);return db[_0xcd0a('0x46')][_0xcd0a('0x8a')](_0x453baa)[_0xcd0a('0x2b')](function(_0x5e567f){var _0x2dac50={'role':_0x4a2d99[_0xcd0a('0x8b')][_0xcd0a('0x8c')],'userProfileId':_0x4a2d99[_0xcd0a('0x8b')]['userProfileId']};if(!_0x2dac50)throw new Error(_0xcd0a('0x8d'));if(_0x2dac50[_0xcd0a('0x8c')]==='user'){var _0x5a0ccf=_0x5e567f[_0xcd0a('0x2c')]({'plain':!![]});return db[_0xcd0a('0x8e')][_0xcd0a('0x4f')]({'where':{'name':_0xcd0a('0x2d'),'userProfileId':_0x2dac50[_0xcd0a('0x8f')]},'raw':!![]})[_0xcd0a('0x2b')](function(_0xe17256){if(_0xe17256&&_0xe17256[_0xcd0a('0x90')]===0x0){return db[_0xcd0a('0x91')][_0xcd0a('0x8a')]({'name':_0x5a0ccf['name'],'resourceId':_0x5a0ccf['id'],'type':_0xe17256[_0xcd0a('0x32')],'sectionId':_0xe17256['id']},{})['then'](function(){return _0x5e567f;});}else{return _0x5e567f;}})[_0xcd0a('0x49')](function(_0x41d508){logger['error'](_0xcd0a('0x92'),_0x41d508);throw _0x41d508;});}return _0x5e567f;})[_0xcd0a('0x2b')](respondWithResult(_0x3425ba,null))[_0xcd0a('0x49')](handleError(_0x3425ba,null));}});}catch(_0x255fa5){_0x3425ba[_0xcd0a('0x1f')](0x1f4)[_0xcd0a('0x93')](_0x255fa5);}};function removeReferences(_0xd4bf4a,_0x4ac61a){try{if(_0xd4bf4a){fs[_0xcd0a('0x94')](_0xd4bf4a);logger['info'](_0xcd0a('0x95'));}if(_0x4ac61a){rimraf(_0x4ac61a,function(){});logger[_0xcd0a('0x67')](_0xcd0a('0x96'));}}catch(_0x2dde78){logger[_0xcd0a('0x30')](_0x2dde78);}}exports['update']=function(_0x458f4a,_0x3f5396,_0x5a9fa7){return db['Plugin']['find']({'where':{'id':_0x458f4a['params']['id']}})['then'](handleEntityNotFound(_0x3f5396,null))[_0xcd0a('0x2b')](saveUpdates(_0x458f4a['body'],null))['then'](respondWithResult(_0x3f5396,null))['catch'](handleError(_0x3f5396,null));};exports['delete']=function(_0x552dbc,_0x51f1e2,_0x7a0ad2){return db[_0xcd0a('0x46')][_0xcd0a('0x4f')]({'where':{'id':_0x552dbc[_0xcd0a('0x4b')]['id']}})[_0xcd0a('0x2b')](function(_0x700456){if(_0x700456){return _0x700456[_0xcd0a('0x2e')]();}})['then'](function(_0x281645){rimraf(path['join'](config[_0xcd0a('0x52')],'server/files/plugins',path[_0xcd0a('0x5d')](_0x281645['path'])),function(){});return _0x281645;})[_0xcd0a('0x2b')](handleEntityNotFound(_0x51f1e2,null))['then'](respondWithStatusCode(_0x51f1e2,null))[_0xcd0a('0x49')](handleError(_0x51f1e2,null));};exports[_0xcd0a('0x97')]=function(_0x552262,_0x2f5d94,_0x1aeffe){return BPromise[_0xcd0a('0x98')]()[_0xcd0a('0x2b')](function(){if(!_0x552262[_0xcd0a('0x38')][_0xcd0a('0x51')]){throw new Error(_0xcd0a('0x99'));}if(!_0x552262[_0xcd0a('0x38')][_0xcd0a('0x9a')]){throw new Error(_0xcd0a('0x9b'));}var _0x180b96=_0x552262[_0xcd0a('0x38')][_0xcd0a('0x9c')]?_0x552262['query'][_0xcd0a('0x9c')]+':'+_0x552262[_0xcd0a('0x38')]['port']:_0xcd0a('0x9d')+_0x552262['query'][_0xcd0a('0x9a')];var _0x2f4d89=_0x552262[_0xcd0a('0x38')][_0xcd0a('0x9e')]?_0x552262['query'][_0xcd0a('0x9e')]:!![];var _0x2984d6=_0x552262[_0xcd0a('0x38')]['encoding']?_0x552262[_0xcd0a('0x38')][_0xcd0a('0x9f')]:null;var _0x559e53={'method':_0x552262[_0xcd0a('0xa0')],'uri':util[_0xcd0a('0x54')](_0xcd0a('0xa1'),_0x180b96,_0x552262['query'][_0xcd0a('0x51')]),'json':_0x2f4d89,'resolveWithFullResponse':!![],'encoding':_0x2984d6,'qs':_0x552262[_0xcd0a('0x38')]};if(_0x552262[_0xcd0a('0xa2')]){_0x559e53[_0xcd0a('0xa2')]=_0x552262[_0xcd0a('0xa2')];if(_0x559e53[_0xcd0a('0xa2')][_0xcd0a('0xa3')]){delete _0x559e53[_0xcd0a('0xa2')][_0xcd0a('0xa3')];}}if(_0x559e53['headers'][_0xcd0a('0xa4')]){delete _0x559e53[_0xcd0a('0xa2')][_0xcd0a('0xa4')];}return rp(_0x559e53);})[_0xcd0a('0x2b')](function(_0x37d4ba){if(_0x37d4ba){_0x2f5d94['set'](_0x37d4ba[_0xcd0a('0xa2')]);logger['info'](_0x37d4ba[_0xcd0a('0x8b')]);if(_[_0xcd0a('0xa5')](_0x552262['query']['path'],_0xcd0a('0x50'))&&_0x37d4ba[_0xcd0a('0xa6')]==0x1f4){return _0x2f5d94[_0xcd0a('0x2f')](_0x37d4ba['statusCode']);}else{return _0x2f5d94[_0xcd0a('0x1f')](_0x37d4ba['statusCode'])['send'](_0x37d4ba[_0xcd0a('0x8b')]);}}else{return _0x2f5d94['sendStatus'](0xc8);}})[_0xcd0a('0x49')](handleError(_0x2f5d94,null));};exports[_0xcd0a('0xa7')]=function(_0xc1567d,_0x5b92dc,_0x5d4540){return BPromise[_0xcd0a('0x98')]()[_0xcd0a('0x2b')](function(){if(!_0xc1567d[_0xcd0a('0x38')][_0xcd0a('0x51')]){throw new Error(_0xcd0a('0x99'));}if(!_0xc1567d[_0xcd0a('0x38')][_0xcd0a('0x9a')]){throw new Error(_0xcd0a('0x9b'));}var _0x2122ff=_0xc1567d[_0xcd0a('0x38')][_0xcd0a('0x9c')]?_0xc1567d[_0xcd0a('0x38')][_0xcd0a('0x9c')]+':'+_0xc1567d['query']['port']:'http://localhost:'+_0xc1567d['query']['port'];var _0x2369d2=_0xc1567d[_0xcd0a('0x38')][_0xcd0a('0x9e')]?_0xc1567d['query']['json']:!![];var _0x5b8215=_0xc1567d[_0xcd0a('0x38')][_0xcd0a('0x9f')]?_0xc1567d[_0xcd0a('0x38')]['encoding']:null;var _0xdd7a84={'method':_0xc1567d['method'],'uri':util[_0xcd0a('0x54')](_0xcd0a('0xa1'),_0x2122ff,_0xc1567d[_0xcd0a('0x38')][_0xcd0a('0x51')]),'json':_0x2369d2,'resolveWithFullResponse':!![],'encoding':_0x5b8215,'body':_0xc1567d[_0xcd0a('0x8b')]};if(_0xc1567d[_0xcd0a('0xa2')]){_0xdd7a84[_0xcd0a('0xa2')]=_0xc1567d[_0xcd0a('0xa2')];if(_0xdd7a84['headers'][_0xcd0a('0xa3')]){delete _0xdd7a84[_0xcd0a('0xa2')][_0xcd0a('0xa3')];}}if(_0xdd7a84[_0xcd0a('0xa2')][_0xcd0a('0xa4')]){delete _0xdd7a84['headers'][_0xcd0a('0xa4')];}return rp(_0xdd7a84);})[_0xcd0a('0x2b')](function(_0xc5be07){if(_0xc5be07){_0x5b92dc['set'](_0xc5be07[_0xcd0a('0xa2')]);logger[_0xcd0a('0x67')](_0xc5be07[_0xcd0a('0x8b')]);return _0x5b92dc[_0xcd0a('0x1f')](_0xc5be07[_0xcd0a('0xa6')])[_0xcd0a('0x93')](_0xc5be07[_0xcd0a('0x8b')]);}else{return _0x5b92dc[_0xcd0a('0x2f')](0xc8);}})[_0xcd0a('0x49')](handleError(_0x5b92dc,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 2d20f8a..23b5410 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 _0x741c=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin','setMaxListeners'];(function(_0x5850c0,_0x3c2c){var _0x113882=function(_0x1d8200){while(--_0x1d8200){_0x5850c0['push'](_0x5850c0['shift']());}};_0x113882(++_0x3c2c);}(_0x741c,0x196));var _0xc741=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x741c[_0x40a045];return _0x1a687c;};'use strict';var EventEmitter=require(_0xc741('0x0'));var Plugin=require(_0xc741('0x1'))['db'][_0xc741('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xc741('0x3')](0x0);var events={'afterCreate':_0xc741('0x4'),'afterUpdate':_0xc741('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5cee2e){return function(_0x4089bf,_0x4ccc27,_0xc80e99){PluginEvents[_0xc741('0x6')](_0x5cee2e+':'+_0x4089bf['id'],_0x4089bf);PluginEvents[_0xc741('0x6')](_0x5cee2e,_0x4089bf);_0xc80e99(null);};}for(var e in events){if(events[_0xc741('0x7')](e)){var event=events[e];Plugin[_0xc741('0x8')](e,emitEvent(event));}}module[_0xc741('0x9')]=PluginEvents; \ No newline at end of file +var _0x3837=['exports','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x514c15,_0x486901){var _0x16283e=function(_0x53b7d0){while(--_0x53b7d0){_0x514c15['push'](_0x514c15['shift']());}};_0x16283e(++_0x486901);}(_0x3837,0x1d1));var _0x7383=function(_0x18fecc,_0x12ac76){_0x18fecc=_0x18fecc-0x0;var _0x4d066e=_0x3837[_0x18fecc];return _0x4d066e;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x7383('0x0'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x7383('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7383('0x2'),'afterDestroy':_0x7383('0x3')};function emitEvent(_0x49878d){return function(_0x227ab2,_0xf57468,_0x53485d){PluginEvents['emit'](_0x49878d+':'+_0x227ab2['id'],_0x227ab2);PluginEvents[_0x7383('0x4')](_0x49878d,_0x227ab2);_0x53485d(null);};}for(var e in events){if(events[_0x7383('0x5')](e)){var event=events[e];Plugin[_0x7383('0x6')](e,emitEvent(event));}}module[_0x7383('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 9d96568..887f46f 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 _0x5ddf=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./plugin.attributes','Plugin','plugins','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5ddf,0xb9));var _0xf5dd=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x5ddf[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xf5dd('0x0'));var util=require(_0xf5dd('0x1'));var logger=require(_0xf5dd('0x2'))('api');var moment=require(_0xf5dd('0x3'));var BPromise=require('bluebird');var rp=require(_0xf5dd('0x4'));var fs=require('fs');var path=require(_0xf5dd('0x5'));var rimraf=require(_0xf5dd('0x6'));var config=require(_0xf5dd('0x7'));var attributes=require(_0xf5dd('0x8'));module['exports']=function(_0x5c4f5a,_0x1f3d22){return _0x5c4f5a['define'](_0xf5dd('0x9'),attributes,{'tableName':_0xf5dd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7eed=['moment','request-promise','path','rimraf','../../config/environment','exports','define','Plugin','plugins','lodash','util','../../config/logger','api'];(function(_0x356132,_0x32a258){var _0x52e5d4=function(_0x126fe9){while(--_0x126fe9){_0x356132['push'](_0x356132['shift']());}};_0x52e5d4(++_0x32a258);}(_0x7eed,0xcc));var _0xd7ee=function(_0x1f83a5,_0x59843f){_0x1f83a5=_0x1f83a5-0x0;var _0x45edf0=_0x7eed[_0x1f83a5];return _0x45edf0;};'use strict';var _=require(_0xd7ee('0x0'));var util=require(_0xd7ee('0x1'));var logger=require(_0xd7ee('0x2'))(_0xd7ee('0x3'));var moment=require(_0xd7ee('0x4'));var BPromise=require('bluebird');var rp=require(_0xd7ee('0x5'));var fs=require('fs');var path=require(_0xd7ee('0x6'));var rimraf=require(_0xd7ee('0x7'));var config=require(_0xd7ee('0x8'));var attributes=require('./plugin.attributes');module[_0xd7ee('0x9')]=function(_0x347d92,_0x3e286f){return _0x347d92[_0xd7ee('0xa')](_0xd7ee('0xb'),attributes,{'tableName':_0xd7ee('0xc'),'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 99fb9d9..4b3090a 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 _0x6033=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','defaults','redis','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','debug','Plugin,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Plugin,\x20%s,\x20%s','message','catch','CreatePlugin','Plugin','create','lodash','util','moment','bluebird'];(function(_0x3061d3,_0x1be4dc){var _0x265134=function(_0x11865b){while(--_0x11865b){_0x3061d3['push'](_0x3061d3['shift']());}};_0x265134(++_0x1be4dc);}(_0x6033,0xdc));var _0x3603=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6033[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x3603('0x0'));var util=require(_0x3603('0x1'));var moment=require(_0x3603('0x2'));var BPromise=require(_0x3603('0x3'));var rs=require(_0x3603('0x4'));var fs=require('fs');var Redis=require(_0x3603('0x5'));var db=require(_0x3603('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3603('0x7'))(_0x3603('0x8'));var config=require(_0x3603('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3603('0xa')]({'port':0x232a});config['redis']=_[_0x3603('0xb')](config[_0x3603('0xc')],{'host':_0x3603('0xd'),'port':0x18eb});var socket=require(_0x3603('0xe'))(new Redis(config[_0x3603('0xc')]));require(_0x3603('0xf'))[_0x3603('0x10')](socket);function respondWithRpcPromise(_0x36d38d,_0x1646bf,_0x498182){return new BPromise(function(_0x56146e,_0x4a2982){return client[_0x3603('0x11')](_0x36d38d,_0x498182)[_0x3603('0x12')](function(_0x3465e6){logger[_0x3603('0x13')]('Plugin,\x20%s,\x20%s',_0x1646bf,'request\x20sent');logger[_0x3603('0x14')](_0x3603('0x15'),_0x1646bf,_0x3603('0x16'),JSON[_0x3603('0x17')](_0x3465e6));if(_0x3465e6['error']){if(_0x3465e6[_0x3603('0x18')][_0x3603('0x19')]===0x1f4){logger[_0x3603('0x18')](_0x3603('0x1a'),_0x1646bf,_0x3465e6[_0x3603('0x18')]['message']);return _0x4a2982(_0x3465e6['error'][_0x3603('0x1b')]);}logger[_0x3603('0x18')](_0x3603('0x1a'),_0x1646bf,_0x3465e6[_0x3603('0x18')]['message']);return _0x56146e(_0x3465e6[_0x3603('0x18')][_0x3603('0x1b')]);}else{logger['info'](_0x3603('0x1a'),_0x1646bf,_0x3603('0x16'));_0x56146e(_0x3465e6['result']['message']);}})[_0x3603('0x1c')](function(_0x1ec50b){logger['error'](_0x3603('0x1a'),_0x1646bf,_0x1ec50b);_0x4a2982(_0x1ec50b);});});}exports[_0x3603('0x1d')]=function(_0x28414f){var _0x34a296=this;return new Promise(function(_0x53585c,_0x8b1b19){return db[_0x3603('0x1e')][_0x3603('0x1f')](_0x28414f['body'],{'raw':_0x28414f['options']?_0x28414f['options']['raw']===undefined?!![]:![]:!![]})[_0x3603('0x12')](function(_0x4c4cca){logger['info']('CreatePlugin',_0x28414f);logger[_0x3603('0x14')](_0x3603('0x1d'),_0x28414f,JSON[_0x3603('0x17')](_0x4c4cca));_0x53585c(_0x4c4cca);})['catch'](function(_0x8aedda){logger['error']('CreatePlugin',_0x8aedda[_0x3603('0x1b')],_0x28414f);_0x8b1b19(_0x34a296[_0x3603('0x18')](0x1f4,_0x8aedda[_0x3603('0x1b')]));});});}; \ No newline at end of file +var _0x1339=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','debug','Plugin,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','CreatePlugin','Plugin','body','stringify','moment','bluebird','randomstring'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x1339,0x1ed));var _0x9133=function(_0x450c9f,_0x32c163){_0x450c9f=_0x450c9f-0x0;var _0xcfba17=_0x1339[_0x450c9f];return _0xcfba17;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9133('0x0'));var BPromise=require(_0x9133('0x1'));var rs=require(_0x9133('0x2'));var fs=require('fs');var Redis=require(_0x9133('0x3'));var db=require(_0x9133('0x4'))['db'];var utils=require(_0x9133('0x5'));var logger=require(_0x9133('0x6'))(_0x9133('0x7'));var config=require('../../config/environment');var jayson=require(_0x9133('0x8'));var client=jayson[_0x9133('0x9')][_0x9133('0xa')]({'port':0x232a});config['redis']=_[_0x9133('0xb')](config[_0x9133('0xc')],{'host':_0x9133('0xd'),'port':0x18eb});var socket=require(_0x9133('0xe'))(new Redis(config[_0x9133('0xc')]));require(_0x9133('0xf'))[_0x9133('0x10')](socket);function respondWithRpcPromise(_0x245134,_0x10a9e4,_0xd588c){return new BPromise(function(_0x4c4517,_0x3f9650){return client[_0x9133('0x11')](_0x245134,_0xd588c)[_0x9133('0x12')](function(_0x452481){logger[_0x9133('0x13')](_0x9133('0x14'),_0x10a9e4,'request\x20sent');logger[_0x9133('0x15')](_0x9133('0x16'),_0x10a9e4,'request\x20sent',JSON['stringify'](_0x452481));if(_0x452481[_0x9133('0x17')]){if(_0x452481['error'][_0x9133('0x18')]===0x1f4){logger[_0x9133('0x17')](_0x9133('0x14'),_0x10a9e4,_0x452481[_0x9133('0x17')][_0x9133('0x19')]);return _0x3f9650(_0x452481[_0x9133('0x17')]['message']);}logger[_0x9133('0x17')](_0x9133('0x14'),_0x10a9e4,_0x452481['error'][_0x9133('0x19')]);return _0x4c4517(_0x452481[_0x9133('0x17')][_0x9133('0x19')]);}else{logger[_0x9133('0x13')]('Plugin,\x20%s,\x20%s',_0x10a9e4,_0x9133('0x1a'));_0x4c4517(_0x452481['result'][_0x9133('0x19')]);}})['catch'](function(_0x115ee8){logger[_0x9133('0x17')]('Plugin,\x20%s,\x20%s',_0x10a9e4,_0x115ee8);_0x3f9650(_0x115ee8);});});}exports[_0x9133('0x1b')]=function(_0x4b940b){var _0x2f91f8=this;return new Promise(function(_0x57af5e,_0x5e4f0c){return db[_0x9133('0x1c')]['create'](_0x4b940b[_0x9133('0x1d')],{'raw':_0x4b940b['options']?_0x4b940b['options']['raw']===undefined?!![]:![]:!![]})[_0x9133('0x12')](function(_0x2dcfb8){logger['info'](_0x9133('0x1b'),_0x4b940b);logger[_0x9133('0x15')](_0x9133('0x1b'),_0x4b940b,JSON[_0x9133('0x1e')](_0x2dcfb8));_0x57af5e(_0x2dcfb8);})['catch'](function(_0xdb7a98){logger['error'](_0x9133('0x1b'),_0xdb7a98[_0x9133('0x19')],_0x4b940b);_0x5e4f0c(_0x2f91f8[_0x9133('0x17')](0x1f4,_0xdb7a98[_0x9133('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 5fea8c1..5476cef 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 _0x706e=['remove','update','emit','register','length','plugin:'];(function(_0x601b6b,_0x96a863){var _0x55881c=function(_0x59b7b2){while(--_0x59b7b2){_0x601b6b['push'](_0x601b6b['shift']());}};_0x55881c(++_0x96a863);}(_0x706e,0x1b0));var _0xe706=function(_0x9f7d77,_0x32e7b2){_0x9f7d77=_0x9f7d77-0x0;var _0x3f50a1=_0x706e[_0x9f7d77];return _0x3f50a1;};'use strict';var PluginEvents=require('./plugin.events');var events=['save',_0xe706('0x0'),_0xe706('0x1')];function createListener(_0x53fab7,_0x472580){return function(_0x54cc0f){_0x472580[_0xe706('0x2')](_0x53fab7,_0x54cc0f);};}function removeListener(_0x345e0a,_0x558d77){return function(){PluginEvents['removeListener'](_0x345e0a,_0x558d77);};}exports[_0xe706('0x3')]=function(_0x55e4c4){for(var _0x25c950=0x0,_0x24ae9c=events[_0xe706('0x4')];_0x25c950<_0x24ae9c;_0x25c950++){var _0x285d20=events[_0x25c950];var _0x6e1412=createListener(_0xe706('0x5')+_0x285d20,_0x55e4c4);PluginEvents['on'](_0x285d20,_0x6e1412);}}; \ No newline at end of file +var _0x8c47=['length','emit','removeListener'];(function(_0x1bf36c,_0x1fa239){var _0x3b9b18=function(_0x3984ff){while(--_0x3984ff){_0x1bf36c['push'](_0x1bf36c['shift']());}};_0x3b9b18(++_0x1fa239);}(_0x8c47,0x1cf));var _0x78c4=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x8c47[_0x3511d3];return _0x5d6321;};'use strict';var PluginEvents=require('./plugin.events');var events=['save','remove','update'];function createListener(_0x418066,_0x226187){return function(_0x5bf1ad){_0x226187[_0x78c4('0x0')](_0x418066,_0x5bf1ad);};}function removeListener(_0x4dbcf9,_0x365fef){return function(){PluginEvents[_0x78c4('0x1')](_0x4dbcf9,_0x365fef);};}exports['register']=function(_0x401035){for(var _0x4a8b65=0x0,_0x195e37=events[_0x78c4('0x2')];_0x4a8b65<_0x195e37;_0x4a8b65++){var _0x4eff46=events[_0x4a8b65];var _0x3ca6d7=createListener('plugin:'+_0x4eff46,_0x401035);PluginEvents['on'](_0x4eff46,_0x3ca6d7);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 8a0b4de..25e6c67 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(_0x4879d0,_0x591cba){var _0x3a0a4e=function(_0x4be577){while(--_0x4be577){_0x4879d0['push'](_0x4879d0['shift']());}};_0x3a0a4e(++_0x591cba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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(_0x397f2e,_0x42c7cb){var _0x5ec4a9=function(_0x1da322){while(--_0x1da322){_0x397f2e['push'](_0x397f2e['shift']());}};_0x5ec4a9(++_0x42c7cb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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 0c043c5..545a109 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 _0xb688=['error','stack','name','send','info','index','then','reject','motion2','catch','show','describe','params','create','body','script','join','../../files/plugins','chdir','dirname','start','dump','update','stop','Unknown\x20status','destroy','Unknown\x20id','../../config/pm2','../../config/logger','api','path','child_process','exec','sendStatus','status','json'];(function(_0x55c979,_0x36c5f0){var _0x690107=function(_0xa61dad){while(--_0xa61dad){_0x55c979['push'](_0x55c979['shift']());}};_0x690107(++_0x36c5f0);}(_0xb688,0xcf));var _0x8b68=function(_0x208bb0,_0x2afb8c){_0x208bb0=_0x208bb0-0x0;var _0x3cbf09=_0xb688[_0x208bb0];return _0x3cbf09;};'use strict';var _=require('lodash');var pm2=require(_0x8b68('0x0'));var logger=require(_0x8b68('0x1'))(_0x8b68('0x2'));var path=require(_0x8b68('0x3'));var exec=require(_0x8b68('0x4'))[_0x8b68('0x5')];var BPromise=require('bluebird');function handleEntityNotFound(_0x41030e,_0x27925d){return function(_0x30f33d){if(!_0x30f33d){_0x41030e[_0x8b68('0x6')](0x194);;}return _0x30f33d;};}function respondWithResult(_0x583d16,_0x34314e){_0x34314e=_0x34314e||0xc8;return function(_0x57ee56){if(_0x57ee56){return _0x583d16[_0x8b68('0x7')](_0x34314e)[_0x8b68('0x8')](_0x57ee56);}return null;};}function handleError(_0x130892,_0xa5571b){_0xa5571b=_0xa5571b||0x1f4;return function(_0x132617){logger[_0x8b68('0x9')](_0x132617[_0x8b68('0xa')]);if(_0x132617[_0x8b68('0xb')]){delete _0x132617[_0x8b68('0xb')];}_0x130892[_0x8b68('0x7')](_0xa5571b)[_0x8b68('0xc')](_0x132617);};}function execChildProcess(){return new BPromise(function(_0x317d01,_0x2a852a){exec('npm\x20install',function(_0x2c0f3b,_0x4426d1,_0x5e76c){logger[_0x8b68('0xd')](_0x4426d1);logger[_0x8b68('0xd')](_0x5e76c);if(_0x2c0f3b){logger[_0x8b68('0x9')](_0x2c0f3b);return _0x2a852a(_0x2c0f3b);}return _0x317d01(_0x4426d1);});});}exports[_0x8b68('0xe')]=function(_0x137c8e,_0x2686c7){return pm2['list']()[_0x8b68('0xf')](function(_0x509033){if(_0x509033){var _0x5e3c66=_[_0x8b68('0x10')](_0x509033,function(_0x1554d6){return _0x1554d6[_0x8b68('0xb')]==='express'||_0x1554d6['name']===_0x8b68('0x11');});return{'rows':_0x5e3c66,'count':_0x5e3c66['length']};}return null;})[_0x8b68('0xf')](respondWithResult(_0x2686c7,null))[_0x8b68('0x12')](handleError(_0x2686c7,null));};exports[_0x8b68('0x13')]=function(_0x10c9c6,_0x491695){return pm2[_0x8b68('0x14')](_0x10c9c6[_0x8b68('0x15')]['id'])['then'](respondWithResult(_0x491695,null))[_0x8b68('0xf')](handleEntityNotFound(_0x491695,null))[_0x8b68('0x12')](handleError(_0x491695,null));};exports[_0x8b68('0x16')]=function(_0x17f321,_0x38b7a7){if(_0x17f321['body'][_0x8b68('0xb')]&&_0x17f321[_0x8b68('0x17')][_0x8b68('0x18')]){var _0x1a9788=path[_0x8b68('0x19')](__dirname,_0x8b68('0x1a'),_0x17f321['body']['script']);var _0x23edc1=process['cwd']();process[_0x8b68('0x1b')](path[_0x8b68('0x1c')](_0x1a9788));return execChildProcess()[_0x8b68('0xf')](function(_0x21ecca){process[_0x8b68('0x1b')](_0x23edc1);return pm2[_0x8b68('0x1d')]({'name':_0x17f321['body'][_0x8b68('0xb')],'script':_0x1a9788});})[_0x8b68('0xf')](function(_0x4ca77d){pm2[_0x8b68('0x1e')]();return _0x4ca77d[0x0];})[_0x8b68('0xf')](respondWithResult(_0x38b7a7,0xc9))[_0x8b68('0x12')](handleError(_0x38b7a7,null));}else{return _0x38b7a7['status'](0x1f4)['send']({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x8b68('0x1f')]=function(_0x448e43,_0x2ba2a3){if(_0x448e43['body']['id']){delete _0x448e43[_0x8b68('0x17')]['id'];}var _0x53aaa2={'online':'restart','stopped':_0x8b68('0x20')};if(_0x53aaa2['hasOwnProperty'](_0x448e43[_0x8b68('0x17')][_0x8b68('0x7')])){return pm2[_0x53aaa2[_0x448e43['body']['status']]](_0x448e43[_0x8b68('0x15')]['id'])[_0x8b68('0xf')](respondWithResult(_0x2ba2a3,0xc8))[_0x8b68('0x12')](handleError(_0x2ba2a3,null));}else{return _0x2ba2a3[_0x8b68('0x7')](0x1f4)[_0x8b68('0xc')]({'message':_0x8b68('0x21')});}};exports[_0x8b68('0x22')]=function(_0x5b7ed1,_0x3b6d1b){if(_0x5b7ed1['body']['id']){delete _0x5b7ed1[_0x8b68('0x17')]['id'];}if(_0x5b7ed1[_0x8b68('0x15')]['id']){return pm2['delete'](_0x5b7ed1[_0x8b68('0x15')]['id'])[_0x8b68('0xf')](function(_0x26fe0e){pm2['dump']();return _0x26fe0e[0x0];})['then'](respondWithResult(_0x3b6d1b,null))[_0x8b68('0x12')](handleError(_0x3b6d1b,null));}else{return _0x3b6d1b[_0x8b68('0x7')](0x1f4)[_0x8b68('0xc')]({'message':_0x8b68('0x23')});}}; \ No newline at end of file +var _0x2e54=['exec','bluebird','sendStatus','status','error','stack','name','send','info','index','list','then','express','motion2','length','catch','show','describe','params','body','script','join','../../files/plugins','chdir','start','dump','Missing\x20name\x20and/or\x20path','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','lodash','api','path','child_process'];(function(_0x5731c0,_0x233b7a){var _0x4cb844=function(_0x3c99b7){while(--_0x3c99b7){_0x5731c0['push'](_0x5731c0['shift']());}};_0x4cb844(++_0x233b7a);}(_0x2e54,0x1dd));var _0x42e5=function(_0xeeacd,_0x42954c){_0xeeacd=_0xeeacd-0x0;var _0x58754a=_0x2e54[_0xeeacd];return _0x58754a;};'use strict';var _=require(_0x42e5('0x0'));var pm2=require('../../config/pm2');var logger=require('../../config/logger')(_0x42e5('0x1'));var path=require(_0x42e5('0x2'));var exec=require(_0x42e5('0x3'))[_0x42e5('0x4')];var BPromise=require(_0x42e5('0x5'));function handleEntityNotFound(_0x153440,_0x42736b){return function(_0x528772){if(!_0x528772){_0x153440[_0x42e5('0x6')](0x194);;}return _0x528772;};}function respondWithResult(_0x455f48,_0x38cb1b){_0x38cb1b=_0x38cb1b||0xc8;return function(_0x4bed10){if(_0x4bed10){return _0x455f48[_0x42e5('0x7')](_0x38cb1b)['json'](_0x4bed10);}return null;};}function handleError(_0x335b92,_0x490b99){_0x490b99=_0x490b99||0x1f4;return function(_0x3a8494){logger[_0x42e5('0x8')](_0x3a8494[_0x42e5('0x9')]);if(_0x3a8494[_0x42e5('0xa')]){delete _0x3a8494[_0x42e5('0xa')];}_0x335b92[_0x42e5('0x7')](_0x490b99)[_0x42e5('0xb')](_0x3a8494);};}function execChildProcess(){return new BPromise(function(_0x2fa2f0,_0x197752){exec('npm\x20install',function(_0x456298,_0x28b3b3,_0x5d57f4){logger[_0x42e5('0xc')](_0x28b3b3);logger[_0x42e5('0xc')](_0x5d57f4);if(_0x456298){logger[_0x42e5('0x8')](_0x456298);return _0x197752(_0x456298);}return _0x2fa2f0(_0x28b3b3);});});}exports[_0x42e5('0xd')]=function(_0x144fb4,_0x1faafc){return pm2[_0x42e5('0xe')]()[_0x42e5('0xf')](function(_0x447648){if(_0x447648){var _0x23957f=_['reject'](_0x447648,function(_0x3b3dd9){return _0x3b3dd9[_0x42e5('0xa')]===_0x42e5('0x10')||_0x3b3dd9[_0x42e5('0xa')]===_0x42e5('0x11');});return{'rows':_0x23957f,'count':_0x23957f[_0x42e5('0x12')]};}return null;})[_0x42e5('0xf')](respondWithResult(_0x1faafc,null))[_0x42e5('0x13')](handleError(_0x1faafc,null));};exports[_0x42e5('0x14')]=function(_0x3c7b79,_0x22655f){return pm2[_0x42e5('0x15')](_0x3c7b79[_0x42e5('0x16')]['id'])[_0x42e5('0xf')](respondWithResult(_0x22655f,null))['then'](handleEntityNotFound(_0x22655f,null))[_0x42e5('0x13')](handleError(_0x22655f,null));};exports['create']=function(_0x5f4428,_0x14d16d){if(_0x5f4428[_0x42e5('0x17')]['name']&&_0x5f4428[_0x42e5('0x17')][_0x42e5('0x18')]){var _0x1c2169=path[_0x42e5('0x19')](__dirname,_0x42e5('0x1a'),_0x5f4428[_0x42e5('0x17')][_0x42e5('0x18')]);var _0x58eee5=process['cwd']();process[_0x42e5('0x1b')](path['dirname'](_0x1c2169));return execChildProcess()[_0x42e5('0xf')](function(_0x2e9574){process[_0x42e5('0x1b')](_0x58eee5);return pm2[_0x42e5('0x1c')]({'name':_0x5f4428[_0x42e5('0x17')]['name'],'script':_0x1c2169});})[_0x42e5('0xf')](function(_0xf29221){pm2[_0x42e5('0x1d')]();return _0xf29221[0x0];})[_0x42e5('0xf')](respondWithResult(_0x14d16d,0xc9))[_0x42e5('0x13')](handleError(_0x14d16d,null));}else{return _0x14d16d['status'](0x1f4)['send']({'message':_0x42e5('0x1e')});}};exports['update']=function(_0x56f812,_0x1b60be){if(_0x56f812['body']['id']){delete _0x56f812[_0x42e5('0x17')]['id'];}var _0x2d9e65={'online':_0x42e5('0x1f'),'stopped':_0x42e5('0x20')};if(_0x2d9e65[_0x42e5('0x21')](_0x56f812[_0x42e5('0x17')]['status'])){return pm2[_0x2d9e65[_0x56f812[_0x42e5('0x17')][_0x42e5('0x7')]]](_0x56f812[_0x42e5('0x16')]['id'])[_0x42e5('0xf')](respondWithResult(_0x1b60be,0xc8))[_0x42e5('0x13')](handleError(_0x1b60be,null));}else{return _0x1b60be[_0x42e5('0x7')](0x1f4)[_0x42e5('0xb')]({'message':_0x42e5('0x22')});}};exports[_0x42e5('0x23')]=function(_0x2ba9ef,_0x2c7542){if(_0x2ba9ef[_0x42e5('0x17')]['id']){delete _0x2ba9ef[_0x42e5('0x17')]['id'];}if(_0x2ba9ef['params']['id']){return pm2[_0x42e5('0x24')](_0x2ba9ef[_0x42e5('0x16')]['id'])[_0x42e5('0xf')](function(_0x156e73){pm2['dump']();return _0x156e73[0x0];})['then'](respondWithResult(_0x2c7542,null))[_0x42e5('0x13')](handleError(_0x2c7542,null));}else{return _0x2c7542['status'](0x1f4)[_0x42e5('0xb')]({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 3071117..d4d6f88 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 _0x5732=['isAuthenticated','getQueues','exports','Router','../../components/auth/service','./realtime.controller','/queues'];(function(_0x58ca19,_0x303148){var _0x506284=function(_0xc76a07){while(--_0xc76a07){_0x58ca19['push'](_0x58ca19['shift']());}};_0x506284(++_0x303148);}(_0x5732,0xdc));var _0x2573=function(_0x23b660,_0x12bbe3){_0x23b660=_0x23b660-0x0;var _0x39dd56=_0x5732[_0x23b660];return _0x39dd56;};'use strict';var express=require('express');var router=express[_0x2573('0x0')]();var auth=require(_0x2573('0x1'));var controller=require(_0x2573('0x2'));router['get'](_0x2573('0x3'),auth[_0x2573('0x4')](),controller[_0x2573('0x5')]);module[_0x2573('0x6')]=router; \ No newline at end of file +var _0xa5c9=['Router','../../components/auth/service','./realtime.controller','isAuthenticated','getQueues','express'];(function(_0x538df0,_0x2d2167){var _0x4db070=function(_0x1ba965){while(--_0x1ba965){_0x538df0['push'](_0x538df0['shift']());}};_0x4db070(++_0x2d2167);}(_0xa5c9,0x143));var _0x9a5c=function(_0x59bcb1,_0x5a4b6c){_0x59bcb1=_0x59bcb1-0x0;var _0x4a737f=_0xa5c9[_0x59bcb1];return _0x4a737f;};'use strict';var express=require(_0x9a5c('0x0'));var router=express[_0x9a5c('0x1')]();var auth=require(_0x9a5c('0x2'));var controller=require(_0x9a5c('0x3'));router['get']('/queues',auth[_0x9a5c('0x4')](),controller[_0x9a5c('0x5')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index b35556a..568e794 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 _0xfb65=['filter','UserProfile','findAndCountAll','then','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','loggedIn','available','waiting','talking','paused','push','pTalking','message','dialActive','Trunk','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','rows','loggedInDb','originated','find','merge','getAgents','online','length','UserId','agents','User','Pause','findAll','QueueId','agent','all','catch','lodash','jayson/promise','../../config/logger','../../mysqldb','client','http','offset','undefined','limit','count','status','set','Content-Range','json','error','stack','name','send','chat','sms','openchannel','whatsapp','voice','resolve','query','includes','channel','toLowerCase','Invalid\x20channel','map','fieldName','type','key','user','role','userProfileId','outbound','QueueCampaigns','startCase','Queues'];(function(_0x2cb58b,_0x5a879d){var _0xe9dd9c=function(_0x11e835){while(--_0x11e835){_0x2cb58b['push'](_0x2cb58b['shift']());}};_0xe9dd9c(++_0x5a879d);}(_0xfb65,0x82));var _0x5fb6=function(_0x4b0b82,_0x18561f){_0x4b0b82=_0x4b0b82-0x0;var _0xb18f65=_0xfb65[_0x4b0b82];return _0xb18f65;};'use strict';var util=require('util');var _=require(_0x5fb6('0x0'));var jayson=require(_0x5fb6('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x5fb6('0x2'))('api');var db=require(_0x5fb6('0x3'))['db'];var client=jayson[_0x5fb6('0x4')][_0x5fb6('0x5')]({'port':0x232a});var routingClient=jayson[_0x5fb6('0x4')][_0x5fb6('0x5')]({'port':0x232c});function respondWithFilteredResult(_0x1fefe3,_0x4dec8f){return function(_0x50782b){if(_0x50782b){var _0x238914=typeof _0x4dec8f[_0x5fb6('0x6')]===_0x5fb6('0x7')&&typeof _0x4dec8f[_0x5fb6('0x8')]==='undefined';var _0x381710=_0x50782b[_0x5fb6('0x9')];var _0x46e061=_0x238914?0x0:_0x4dec8f[_0x5fb6('0x6')];var _0x4ff5d2=_0x238914?_0x50782b[_0x5fb6('0x9')]:_0x4dec8f[_0x5fb6('0x6')]+_0x4dec8f['limit'];var _0x6c3565;if(_0x4ff5d2>=_0x381710){_0x4ff5d2=_0x381710;_0x6c3565=0xc8;}else{_0x6c3565=0xce;}_0x1fefe3[_0x5fb6('0xa')](_0x6c3565);return _0x1fefe3[_0x5fb6('0xb')](_0x5fb6('0xc'),_0x46e061+'-'+_0x4ff5d2+'/'+_0x381710)[_0x5fb6('0xd')](_0x50782b);}return null;};}function handleError(_0x507d88,_0x1927d0){_0x1927d0=_0x1927d0||0x1f4;return function(_0x15b296){logger[_0x5fb6('0xe')](_0x15b296[_0x5fb6('0xf')]);if(_0x15b296[_0x5fb6('0x10')]){delete _0x15b296[_0x5fb6('0x10')];}_0x507d88[_0x5fb6('0xa')](_0x1927d0)[_0x5fb6('0x11')](_0x15b296);};}exports['getQueues']=function(_0x47a197,_0x46f1cf){var _0xfaea56=['mail',_0x5fb6('0x12'),_0x5fb6('0x13'),_0x5fb6('0x14'),'fax',_0x5fb6('0x15'),_0x5fb6('0x16')];var _0x27bd8b={'count':0x0,'rows':[]},_0x182af5={},_0x167354;Promise[_0x5fb6('0x17')]()['then'](function(){if(_0x47a197[_0x5fb6('0x18')]['channel']){if(!_[_0x5fb6('0x19')](_0xfaea56,_0x47a197['query'][_0x5fb6('0x1a')][_0x5fb6('0x1b')]()))throw new Error(_0x5fb6('0x1c'));_0x167354=_0x47a197[_0x5fb6('0x18')][_0x5fb6('0x1a')][_0x5fb6('0x1b')]();}var _0x11c21b=_['startCase'](_0x167354)+'Queue';var _0xfd8d78=_[_0x5fb6('0x1d')](db[_0x11c21b]['rawAttributes'],function(_0xdf1794){return{'name':_0xdf1794[_0x5fb6('0x1e')],'type':_0xdf1794[_0x5fb6('0x1f')][_0x5fb6('0x20')]};});_0x182af5=qs['getOptions'](_0xfd8d78,_0x47a197);if(_0x47a197[_0x5fb6('0x21')][_0x5fb6('0x22')]===_0x5fb6('0x21')){var _0x20de69={'params':{'id':_0x47a197[_0x5fb6('0x21')][_0x5fb6('0x23')]},'query':{'section':_0x167354==='voice'&&_0x47a197['query'][_0x5fb6('0x1f')]===_0x5fb6('0x24')?_0x5fb6('0x25'):_[_0x5fb6('0x26')](_0x167354)+_0x5fb6('0x27'),'type':_0x47a197[_0x5fb6('0x18')][_0x5fb6('0x1f')],'nolimit':!![],'sort':'name','filter':_0x47a197[_0x5fb6('0x18')][_0x5fb6('0x28')]}};return db[_0x5fb6('0x29')]['getResources'](_0x20de69);}return db[_0x11c21b][_0x5fb6('0x2a')](_0x182af5);})[_0x5fb6('0x2b')](function(_0x49a828){_0x27bd8b[_0x5fb6('0x9')]=_0x49a828[_0x5fb6('0x9')];var _0x52afd7=_0x167354===_0x5fb6('0x16')?client:routingClient;return _0x52afd7['request'](_[_0x5fb6('0x26')](_0x167354)+'Queues',_0x47a197)['then'](function(_0x159971){if(_0x159971[_0x5fb6('0xe')])throw new Error(util[_0x5fb6('0x2c')](_0x5fb6('0x2d'),_0x167354));var _0x36fc09=_0x159971[_0x5fb6('0x2e')];var _0x585658=[_0x5fb6('0x2f'),_0x5fb6('0x30'),_0x5fb6('0x31'),_0x5fb6('0x32'),_0x5fb6('0x33')];if(_0x167354===_0x5fb6('0x16')&&_0x47a197[_0x5fb6('0x18')][_0x5fb6('0x1f')]===_0x5fb6('0x24')){_0x585658[_0x5fb6('0x34')](_0x5fb6('0x35'),'originated',_0x5fb6('0x36'),_0x5fb6('0x37'),'dialMethod',_0x5fb6('0x38'),'startPredictive','startProgressive',_0x5fb6('0x39'),_0x5fb6('0x3a'),_0x5fb6('0x3b'),'erlangBusyFactor',_0x5fb6('0x3c'),'dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold',_0x5fb6('0x3d'),_0x5fb6('0x3e'),_0x5fb6('0x3f'),_0x5fb6('0x40'),_0x5fb6('0x41'),_0x5fb6('0x42'),_0x5fb6('0x43'));}var _0x236e4e=_0x49a828[_0x5fb6('0x44')][_0x5fb6('0x1d')](function(_0x8446db){var _0x6bfdc2=_0x8446db['get']({'plain':!![]});_0x6bfdc2[_0x5fb6('0x33')]=0x0;_0x6bfdc2[_0x5fb6('0x45')]=0x0;_0x6bfdc2[_0x5fb6('0x2f')]=0x0;_0x6bfdc2['available']=0x0;_0x6bfdc2[_0x5fb6('0x33')]=0x0;_0x6bfdc2['waiting']=0x0;if(_0x167354===_0x5fb6('0x16')){_0x6bfdc2['talking']=0x0;if(_0x47a197[_0x5fb6('0x18')][_0x5fb6('0x1f')]===_0x5fb6('0x24')){_0x6bfdc2[_0x5fb6('0x35')]=0x0;_0x6bfdc2[_0x5fb6('0x46')]=0x0;}}_0x6bfdc2['agents']=[];var _0x1a6518=_[_0x5fb6('0x47')](_0x36fc09[_0x5fb6('0x44')],['id',_0x6bfdc2['id']]);if(_0x1a6518)_[_0x5fb6('0x48')](_0x6bfdc2,_['pick'](_0x1a6518,_0x585658));if(_0x167354===_0x5fb6('0x16')){return _0x8446db[_0x5fb6('0x49')]({'attributes':['id',_0x5fb6('0x10'),_0x5fb6('0x4a')],'joinTableAttributes':[],'raw':!![]})[_0x5fb6('0x2b')](function(_0x26962b){return _0x8446db['getMembers']({'raw':!![]})[_0x5fb6('0x2b')](function(_0x18c88c){for(var _0x290714=0x0;_0x290714<_0x26962b[_0x5fb6('0x4b')];_0x290714++){var _0xb7651f=_[_0x5fb6('0x47')](_0x18c88c,[_0x5fb6('0x4c'),_0x26962b[_0x290714]['id']]);var _0x529c2d={'id':_0x26962b[_0x290714]['id'],'name':_0x26962b[_0x290714][_0x5fb6('0x10')],'online':Boolean(_0x26962b[_0x290714][_0x5fb6('0x4a')]),'paused':_0xb7651f?Boolean(_0xb7651f[_0x5fb6('0x33')]):![]};if(_0x529c2d['online'])_0x6bfdc2[_0x5fb6('0x45')]++;if(_0x529c2d['paused'])_0x6bfdc2[_0x5fb6('0x33')]++;_0x6bfdc2[_0x5fb6('0x4d')]['push'](_0x529c2d);}return _0x6bfdc2;});});}else{var _0x116119=_0x5fb6('0x4e')+_[_0x5fb6('0x26')](_0x167354)+'Queue';var _0x53343d=_0x167354+_0x5fb6('0x4f');return db[_0x116119][_0x5fb6('0x50')]({'where':{[_[_0x5fb6('0x26')](_0x167354)+_0x5fb6('0x51')]:_0x8446db['id']},'raw':!![]})[_0x5fb6('0x2b')](function(_0x9fee51){return db[_0x5fb6('0x4e')][_0x5fb6('0x50')]({'attributes':['id',_0x5fb6('0x10'),_0x5fb6('0x4a'),_0x53343d],'where':{'id':_[_0x5fb6('0x1d')](_0x9fee51,'UserId'),'role':_0x5fb6('0x52')},'raw':!![]});})['then'](function(_0x54eedf){for(var _0x2d8b10=0x0;_0x2d8b10<_0x54eedf[_0x5fb6('0x4b')];_0x2d8b10++){var _0x18cfb1={'id':_0x54eedf[_0x2d8b10]['id'],'name':_0x54eedf[_0x2d8b10][_0x5fb6('0x10')],'online':Boolean(_0x54eedf[_0x2d8b10][_0x5fb6('0x4a')]),'paused':Boolean(_0x54eedf[_0x2d8b10][_0x53343d])};if(_0x18cfb1[_0x5fb6('0x4a')])_0x6bfdc2[_0x5fb6('0x45')]++;if(_0x18cfb1['paused'])_0x6bfdc2[_0x5fb6('0x33')]++;_0x6bfdc2[_0x5fb6('0x4d')]['push'](_0x18cfb1);}return _0x6bfdc2;});}});return Promise[_0x5fb6('0x53')](_0x236e4e);});})[_0x5fb6('0x2b')](function(_0x1d6188){_0x27bd8b[_0x5fb6('0x44')]=_0x1d6188;return _0x27bd8b;})[_0x5fb6('0x2b')](respondWithFilteredResult(_0x46f1cf,_0x182af5))[_0x5fb6('0x54')](handleError(_0x46f1cf,null));}; \ No newline at end of file +var _0xacf4=['fax','then','query','channel','includes','toLowerCase','Invalid\x20channel','startCase','Queue','map','rawAttributes','fieldName','type','key','getOptions','role','user','userProfileId','outbound','QueueCampaigns','filter','UserProfile','getResources','findAndCountAll','voice','request','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','loggedIn','available','talking','paused','push','pTalking','originated','message','dialMethod','Trunk','startProgressive','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','rows','get','waiting','agents','merge','online','length','find','UserId','loggedInDb','Pause','findAll','User','agent','all','catch','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','http','offset','undefined','limit','count','Content-Range','error','stack','name','status','send','getQueues','mail','sms','openchannel'];(function(_0x512f16,_0x311fbd){var _0x152880=function(_0xbe2a2a){while(--_0xbe2a2a){_0x512f16['push'](_0x512f16['shift']());}};_0x152880(++_0x311fbd);}(_0xacf4,0xe7));var _0x4acf=function(_0x42fb06,_0xc8e815){_0x42fb06=_0x42fb06-0x0;var _0x5580ad=_0xacf4[_0x42fb06];return _0x5580ad;};'use strict';var util=require('util');var _=require('lodash');var jayson=require(_0x4acf('0x0'));var qs=require(_0x4acf('0x1'));var logger=require(_0x4acf('0x2'))(_0x4acf('0x3'));var db=require(_0x4acf('0x4'))['db'];var client=jayson[_0x4acf('0x5')][_0x4acf('0x6')]({'port':0x232a});var routingClient=jayson['client'][_0x4acf('0x6')]({'port':0x232c});function respondWithFilteredResult(_0x2124c8,_0x4e0c43){return function(_0x24bf24){if(_0x24bf24){var _0x2ba08a=typeof _0x4e0c43[_0x4acf('0x7')]===_0x4acf('0x8')&&typeof _0x4e0c43[_0x4acf('0x9')]==='undefined';var _0x55f61d=_0x24bf24[_0x4acf('0xa')];var _0x59f559=_0x2ba08a?0x0:_0x4e0c43[_0x4acf('0x7')];var _0x2c2cb4=_0x2ba08a?_0x24bf24[_0x4acf('0xa')]:_0x4e0c43['offset']+_0x4e0c43[_0x4acf('0x9')];var _0x57f6cb;if(_0x2c2cb4>=_0x55f61d){_0x2c2cb4=_0x55f61d;_0x57f6cb=0xc8;}else{_0x57f6cb=0xce;}_0x2124c8['status'](_0x57f6cb);return _0x2124c8['set'](_0x4acf('0xb'),_0x59f559+'-'+_0x2c2cb4+'/'+_0x55f61d)['json'](_0x24bf24);}return null;};}function handleError(_0x5bca4e,_0x1783d2){_0x1783d2=_0x1783d2||0x1f4;return function(_0x979f49){logger[_0x4acf('0xc')](_0x979f49[_0x4acf('0xd')]);if(_0x979f49[_0x4acf('0xe')]){delete _0x979f49[_0x4acf('0xe')];}_0x5bca4e[_0x4acf('0xf')](_0x1783d2)[_0x4acf('0x10')](_0x979f49);};}exports[_0x4acf('0x11')]=function(_0x312bb5,_0x2741d3){var _0x5f0260=[_0x4acf('0x12'),'chat',_0x4acf('0x13'),_0x4acf('0x14'),_0x4acf('0x15'),'whatsapp','voice'];var _0x13d10e={'count':0x0,'rows':[]},_0x40cb8d={},_0x240c00;Promise['resolve']()[_0x4acf('0x16')](function(){if(_0x312bb5[_0x4acf('0x17')][_0x4acf('0x18')]){if(!_[_0x4acf('0x19')](_0x5f0260,_0x312bb5[_0x4acf('0x17')][_0x4acf('0x18')][_0x4acf('0x1a')]()))throw new Error(_0x4acf('0x1b'));_0x240c00=_0x312bb5[_0x4acf('0x17')][_0x4acf('0x18')][_0x4acf('0x1a')]();}var _0x5f0284=_[_0x4acf('0x1c')](_0x240c00)+_0x4acf('0x1d');var _0x57ea46=_[_0x4acf('0x1e')](db[_0x5f0284][_0x4acf('0x1f')],function(_0x569d9e){return{'name':_0x569d9e[_0x4acf('0x20')],'type':_0x569d9e[_0x4acf('0x21')][_0x4acf('0x22')]};});_0x40cb8d=qs[_0x4acf('0x23')](_0x57ea46,_0x312bb5);if(_0x312bb5['user'][_0x4acf('0x24')]===_0x4acf('0x25')){var _0x57e595={'params':{'id':_0x312bb5[_0x4acf('0x25')][_0x4acf('0x26')]},'query':{'section':_0x240c00==='voice'&&_0x312bb5[_0x4acf('0x17')][_0x4acf('0x21')]===_0x4acf('0x27')?_0x4acf('0x28'):_['startCase'](_0x240c00)+'Queues','type':_0x312bb5[_0x4acf('0x17')][_0x4acf('0x21')],'nolimit':!![],'sort':_0x4acf('0xe'),'filter':_0x312bb5[_0x4acf('0x17')][_0x4acf('0x29')]}};return db[_0x4acf('0x2a')][_0x4acf('0x2b')](_0x57e595);}return db[_0x5f0284][_0x4acf('0x2c')](_0x40cb8d);})[_0x4acf('0x16')](function(_0x2a3830){_0x13d10e['count']=_0x2a3830[_0x4acf('0xa')];var _0x3f5614=_0x240c00===_0x4acf('0x2d')?client:routingClient;return _0x3f5614[_0x4acf('0x2e')](_[_0x4acf('0x1c')](_0x240c00)+_0x4acf('0x2f'),_0x312bb5)[_0x4acf('0x16')](function(_0x5d862f){if(_0x5d862f[_0x4acf('0xc')])throw new Error(util[_0x4acf('0x30')](_0x4acf('0x31'),_0x240c00));var _0x50dced=_0x5d862f[_0x4acf('0x32')];var _0x18d0bf=[_0x4acf('0x33'),_0x4acf('0x34'),'waiting',_0x4acf('0x35'),_0x4acf('0x36')];if(_0x240c00===_0x4acf('0x2d')&&_0x312bb5['query'][_0x4acf('0x21')]===_0x4acf('0x27')){_0x18d0bf[_0x4acf('0x37')](_0x4acf('0x38'),_0x4acf('0x39'),_0x4acf('0x3a'),'dialActive',_0x4acf('0x3b'),_0x4acf('0x3c'),'startPredictive',_0x4acf('0x3d'),'erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold',_0x4acf('0x3e'),_0x4acf('0x3f'),'predictiveIntervalAnsweredCalls',_0x4acf('0x40'),_0x4acf('0x41'),_0x4acf('0x42'),_0x4acf('0x43'));}var _0x1cbb67=_0x2a3830[_0x4acf('0x44')][_0x4acf('0x1e')](function(_0x29dc65){var _0x24465b=_0x29dc65[_0x4acf('0x45')]({'plain':!![]});_0x24465b['paused']=0x0;_0x24465b['loggedInDb']=0x0;_0x24465b[_0x4acf('0x33')]=0x0;_0x24465b[_0x4acf('0x34')]=0x0;_0x24465b['paused']=0x0;_0x24465b[_0x4acf('0x46')]=0x0;if(_0x240c00===_0x4acf('0x2d')){_0x24465b[_0x4acf('0x35')]=0x0;if(_0x312bb5[_0x4acf('0x17')]['type']==='outbound'){_0x24465b[_0x4acf('0x38')]=0x0;_0x24465b[_0x4acf('0x39')]=0x0;}}_0x24465b[_0x4acf('0x47')]=[];var _0x44b567=_['find'](_0x50dced[_0x4acf('0x44')],['id',_0x24465b['id']]);if(_0x44b567)_[_0x4acf('0x48')](_0x24465b,_['pick'](_0x44b567,_0x18d0bf));if(_0x240c00==='voice'){return _0x29dc65['getAgents']({'attributes':['id','name',_0x4acf('0x49')],'joinTableAttributes':[],'raw':!![]})[_0x4acf('0x16')](function(_0x208af3){return _0x29dc65['getMembers']({'raw':!![]})[_0x4acf('0x16')](function(_0x3b6574){for(var _0x19e94a=0x0;_0x19e94a<_0x208af3[_0x4acf('0x4a')];_0x19e94a++){var _0x14d92b=_[_0x4acf('0x4b')](_0x3b6574,[_0x4acf('0x4c'),_0x208af3[_0x19e94a]['id']]);var _0x17d5e9={'id':_0x208af3[_0x19e94a]['id'],'name':_0x208af3[_0x19e94a][_0x4acf('0xe')],'online':Boolean(_0x208af3[_0x19e94a][_0x4acf('0x49')]),'paused':_0x14d92b?Boolean(_0x14d92b[_0x4acf('0x36')]):![]};if(_0x17d5e9['online'])_0x24465b[_0x4acf('0x4d')]++;if(_0x17d5e9[_0x4acf('0x36')])_0x24465b[_0x4acf('0x36')]++;_0x24465b[_0x4acf('0x47')][_0x4acf('0x37')](_0x17d5e9);}return _0x24465b;});});}else{var _0x58bc5d='User'+_[_0x4acf('0x1c')](_0x240c00)+_0x4acf('0x1d');var _0xeee54a=_0x240c00+_0x4acf('0x4e');return db[_0x58bc5d][_0x4acf('0x4f')]({'where':{[_[_0x4acf('0x1c')](_0x240c00)+'QueueId']:_0x29dc65['id']},'raw':!![]})[_0x4acf('0x16')](function(_0x5735fc){return db[_0x4acf('0x50')][_0x4acf('0x4f')]({'attributes':['id','name','online',_0xeee54a],'where':{'id':_[_0x4acf('0x1e')](_0x5735fc,_0x4acf('0x4c')),'role':_0x4acf('0x51')},'raw':!![]});})[_0x4acf('0x16')](function(_0x52584a){for(var _0x2f1d23=0x0;_0x2f1d23<_0x52584a[_0x4acf('0x4a')];_0x2f1d23++){var _0x2378c6={'id':_0x52584a[_0x2f1d23]['id'],'name':_0x52584a[_0x2f1d23][_0x4acf('0xe')],'online':Boolean(_0x52584a[_0x2f1d23][_0x4acf('0x49')]),'paused':Boolean(_0x52584a[_0x2f1d23][_0xeee54a])};if(_0x2378c6[_0x4acf('0x49')])_0x24465b[_0x4acf('0x4d')]++;if(_0x2378c6[_0x4acf('0x36')])_0x24465b['paused']++;_0x24465b['agents'][_0x4acf('0x37')](_0x2378c6);}return _0x24465b;});}});return Promise[_0x4acf('0x52')](_0x1cbb67);});})[_0x4acf('0x16')](function(_0x33bc52){_0x13d10e[_0x4acf('0x44')]=_0x33bc52;return _0x13d10e;})[_0x4acf('0x16')](respondWithFilteredResult(_0x2741d3,_0x40cb8d))[_0x4acf('0x53')](handleError(_0x2741d3,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 1d1ee48..f481dd3 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3b89d7,_0x4fa6db){var _0x5532c1=function(_0x335324){while(--_0x335324){_0x3b89d7['push'](_0x3b89d7['shift']());}};_0x5532c1(++_0x4fa6db);}(_0xe706,0xa3));var _0x6e70=function(_0x50eab9,_0x1a6d00){_0x50eab9=_0x50eab9-0x0;var _0x102a2f=_0xe706[_0x50eab9];return _0x102a2f;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x5001b4,_0x362ed5){var _0x44ffa7=function(_0x3a0a8e){while(--_0x3a0a8e){_0x5001b4['push'](_0x5001b4['shift']());}};_0x44ffa7(++_0x362ed5);}(_0x9c44,0x178));var _0x49c4=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x9c44[_0x273c39];return _0x46d6b5;};'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 42e01a7..0148511 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 _0xd69e=['sequelize','exports','INTEGER','DATE','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd69e,0xa0));var _0xed69=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xd69e[_0x138adb];return _0x1b27f2;};'use strict';var Sequelize=require(_0xed69('0x0'));module[_0xed69('0x1')]={'state':{'type':Sequelize[_0xed69('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xed69('0x3')]},'uniqueid':{'type':Sequelize[_0xed69('0x4')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xed69('0x4')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x363e=['DATE','INTEGER','sequelize','exports','STRING'];(function(_0x528281,_0x2917c9){var _0x1f74b6=function(_0x15a273){while(--_0x15a273){_0x528281['push'](_0x528281['shift']());}};_0x1f74b6(++_0x2917c9);}(_0x363e,0x179));var _0xe363=function(_0x4151f4,_0x4c6cba){_0x4151f4=_0x4151f4-0x0;var _0xdeed0b=_0x363e[_0x4151f4];return _0xdeed0b;};'use strict';var Sequelize=require(_0xe363('0x0'));module[_0xe363('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xe363('0x2')]},'scheduledat':{'type':Sequelize[_0xe363('0x3')]},'uniqueid':{'type':Sequelize[_0xe363('0x2')]},'starttime':{'type':Sequelize[_0xe363('0x3')]},'responsetime':{'type':Sequelize[_0xe363('0x3')]},'ringtime':{'type':Sequelize[_0xe363('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xe363('0x2')]},'campaigntype':{'type':Sequelize[_0xe363('0x2')]},'membername':{'type':Sequelize[_0xe363('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 9ab3509..79045f2 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 _0x9456=['ReportAgentPreview','report_agent_preview','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define'];(function(_0x3845c1,_0x5090a2){var _0x4222f5=function(_0x3fbf3a){while(--_0x3fbf3a){_0x3845c1['push'](_0x3845c1['shift']());}};_0x4222f5(++_0x5090a2);}(_0x9456,0x84));var _0x6945=function(_0x1bdd6e,_0x4002ed){_0x1bdd6e=_0x1bdd6e-0x0;var _0x2ac422=_0x9456[_0x1bdd6e];return _0x2ac422;};'use strict';var _=require('lodash');var util=require(_0x6945('0x0'));var logger=require(_0x6945('0x1'))(_0x6945('0x2'));var moment=require('moment');var BPromise=require(_0x6945('0x3'));var rp=require(_0x6945('0x4'));var fs=require('fs');var path=require(_0x6945('0x5'));var rimraf=require(_0x6945('0x6'));var config=require(_0x6945('0x7'));var attributes=require(_0x6945('0x8'));module[_0x6945('0x9')]=function(_0x4b791c,_0x40ffed){return _0x4b791c[_0x6945('0xa')](_0x6945('0xb'),attributes,{'tableName':_0x6945('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeb36=['rimraf','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x5d98e8,_0x1b7a31){var _0x28923a=function(_0x5f73ea){while(--_0x5f73ea){_0x5d98e8['push'](_0x5d98e8['shift']());}};_0x28923a(++_0x1b7a31);}(_0xeb36,0x123));var _0x6eb3=function(_0x5d426d,_0x463b3b){_0x5d426d=_0x5d426d-0x0;var _0x343059=_0xeb36[_0x5d426d];return _0x343059;};'use strict';var _=require(_0x6eb3('0x0'));var util=require(_0x6eb3('0x1'));var logger=require(_0x6eb3('0x2'))(_0x6eb3('0x3'));var moment=require(_0x6eb3('0x4'));var BPromise=require('bluebird');var rp=require(_0x6eb3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6eb3('0x6'));var config=require('../../config/environment');var attributes=require(_0x6eb3('0x7'));module[_0x6eb3('0x8')]=function(_0x39a087,_0x445cb2){return _0x39a087[_0x6eb3('0x9')](_0x6eb3('0xa'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index f52d180..e1696a2 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 _0xe63a=['debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','info','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent'];(function(_0x493dda,_0x1528d3){var _0x31a5a6=function(_0x43c676){while(--_0x43c676){_0x493dda['push'](_0x493dda['shift']());}};_0x31a5a6(++_0x1528d3);}(_0xe63a,0x106));var _0xae63=function(_0x2bbb24,_0xe0f9a0){_0x2bbb24=_0x2bbb24-0x0;var _0x494a11=_0xe63a[_0x2bbb24];return _0x494a11;};'use strict';var _=require(_0xae63('0x0'));var util=require(_0xae63('0x1'));var moment=require(_0xae63('0x2'));var BPromise=require(_0xae63('0x3'));var rs=require(_0xae63('0x4'));var fs=require('fs');var Redis=require(_0xae63('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xae63('0x6'));var logger=require(_0xae63('0x7'))(_0xae63('0x8'));var config=require(_0xae63('0x9'));var jayson=require(_0xae63('0xa'));var client=jayson[_0xae63('0xb')][_0xae63('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x40f154,_0x1f0101,_0x5377dd){return new BPromise(function(_0x51ebef,_0x379ce8){return client[_0xae63('0xd')](_0x40f154,_0x5377dd)[_0xae63('0xe')](function(_0xe2c2ec){logger['info'](_0xae63('0xf'),_0x1f0101,_0xae63('0x10'));logger[_0xae63('0x11')](_0xae63('0x12'),_0x1f0101,'request\x20sent',JSON[_0xae63('0x13')](_0xe2c2ec));if(_0xe2c2ec['error']){if(_0xe2c2ec[_0xae63('0x14')][_0xae63('0x15')]===0x1f4){logger[_0xae63('0x14')](_0xae63('0xf'),_0x1f0101,_0xe2c2ec[_0xae63('0x14')][_0xae63('0x16')]);return _0x379ce8(_0xe2c2ec[_0xae63('0x14')][_0xae63('0x16')]);}logger[_0xae63('0x14')](_0xae63('0xf'),_0x1f0101,_0xe2c2ec['error'][_0xae63('0x16')]);return _0x51ebef(_0xe2c2ec[_0xae63('0x14')]['message']);}else{logger['info'](_0xae63('0xf'),_0x1f0101,'request\x20sent');_0x51ebef(_0xe2c2ec[_0xae63('0x17')]['message']);}})['catch'](function(_0x16aca0){logger['error'](_0xae63('0xf'),_0x1f0101,_0x16aca0);_0x379ce8(_0x16aca0);});});}exports[_0xae63('0x18')]=function(_0x57c55b){var _0x3800f1=this;return new Promise(function(_0x95f665,_0x317af7){return db[_0xae63('0x19')][_0xae63('0x1a')](_0x57c55b[_0xae63('0x1b')],{'raw':_0x57c55b[_0xae63('0x1c')]?_0x57c55b[_0xae63('0x1c')][_0xae63('0x1d')]===undefined?!![]:![]:!![]})[_0xae63('0xe')](function(_0x8327a0){logger[_0xae63('0x1e')]('CreateReportAgentPreview',_0x57c55b);logger[_0xae63('0x11')]('CreateReportAgentPreview',_0x57c55b,JSON[_0xae63('0x13')](_0x8327a0));_0x95f665(_0x8327a0);})['catch'](function(_0x40c7c0){logger[_0xae63('0x14')]('CreateReportAgentPreview',_0x40c7c0[_0xae63('0x16')],_0x57c55b);_0x317af7(_0x3800f1[_0xae63('0x14')](0x1f4,_0x40c7c0['message']));});});}; \ No newline at end of file +var _0x56e5=['../../config/environment','jayson/promise','client','http','request','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','options','raw','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x2148ad,_0x2cc73f){var _0xa54f3=function(_0x30151f){while(--_0x30151f){_0x2148ad['push'](_0x2148ad['shift']());}};_0xa54f3(++_0x2cc73f);}(_0x56e5,0x174));var _0x556e=function(_0x12d6c2,_0x409bc8){_0x12d6c2=_0x12d6c2-0x0;var _0x1c9825=_0x56e5[_0x12d6c2];return _0x1c9825;};'use strict';var _=require('lodash');var util=require(_0x556e('0x0'));var moment=require('moment');var BPromise=require(_0x556e('0x1'));var rs=require(_0x556e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x556e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x556e('0x4'))(_0x556e('0x5'));var config=require(_0x556e('0x6'));var jayson=require(_0x556e('0x7'));var client=jayson[_0x556e('0x8')][_0x556e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x417ebf,_0x390341,_0x5c7d24){return new BPromise(function(_0x4e4586,_0x883741){return client[_0x556e('0xa')](_0x417ebf,_0x5c7d24)[_0x556e('0xb')](function(_0x747667){logger['info'](_0x556e('0xc'),_0x390341,_0x556e('0xd'));logger[_0x556e('0xe')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x390341,_0x556e('0xd'),JSON[_0x556e('0xf')](_0x747667));if(_0x747667[_0x556e('0x10')]){if(_0x747667['error'][_0x556e('0x11')]===0x1f4){logger[_0x556e('0x10')](_0x556e('0xc'),_0x390341,_0x747667[_0x556e('0x10')]['message']);return _0x883741(_0x747667[_0x556e('0x10')][_0x556e('0x12')]);}logger[_0x556e('0x10')](_0x556e('0xc'),_0x390341,_0x747667[_0x556e('0x10')][_0x556e('0x12')]);return _0x4e4586(_0x747667[_0x556e('0x10')]['message']);}else{logger[_0x556e('0x13')](_0x556e('0xc'),_0x390341,_0x556e('0xd'));_0x4e4586(_0x747667[_0x556e('0x14')][_0x556e('0x12')]);}})[_0x556e('0x15')](function(_0x4d8375){logger[_0x556e('0x10')](_0x556e('0xc'),_0x390341,_0x4d8375);_0x883741(_0x4d8375);});});}exports[_0x556e('0x16')]=function(_0x5461af){var _0x293a9d=this;return new Promise(function(_0x56f80a,_0x545469){return db[_0x556e('0x17')][_0x556e('0x18')](_0x5461af['body'],{'raw':_0x5461af[_0x556e('0x19')]?_0x5461af[_0x556e('0x19')][_0x556e('0x1a')]===undefined?!![]:![]:!![]})[_0x556e('0xb')](function(_0x476718){logger[_0x556e('0x13')](_0x556e('0x16'),_0x5461af);logger['debug'](_0x556e('0x16'),_0x5461af,JSON[_0x556e('0xf')](_0x476718));_0x56f80a(_0x476718);})[_0x556e('0x15')](function(_0xd80a3f){logger['error'](_0x556e('0x16'),_0xd80a3f[_0x556e('0x12')],_0x5461af);_0x545469(_0x293a9d['error'](0x1f4,_0xd80a3f[_0x556e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index ad05547..183057f 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 _0x3d51=['voiceQueues','/chat/queues','chatQueues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','/whatsapp/queues','whatsappQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','showVoiceQueues','put','/voice/queues/:id','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','/sms/queues/:id/notify','sms','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','voiceChannelStopMixMonitor','/voice/queues'];(function(_0xbd273b,_0x1f729f){var _0x49e94e=function(_0x1dce9a){while(--_0x1dce9a){_0xbd273b['push'](_0xbd273b['shift']());}};_0x49e94e(++_0x1f729f);}(_0x3d51,0xfb));var _0x13d5=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x3d51[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x13d5('0x0'));var util=require('util');var path=require('path');var express=require(_0x13d5('0x1'));var router=express[_0x13d5('0x2')]();var auth=require(_0x13d5('0x3'));var controller=require(_0x13d5('0x4'));router[_0x13d5('0x5')](_0x13d5('0x6'),auth[_0x13d5('0x7')](),controller[_0x13d5('0x8')]);router[_0x13d5('0x5')](_0x13d5('0x9'),auth['isAuthenticated'](),controller[_0x13d5('0xa')]);router[_0x13d5('0x5')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x13d5('0x7')](),controller[_0x13d5('0xb')]);router['get'](_0x13d5('0xc'),auth[_0x13d5('0x7')](),controller[_0x13d5('0xd')]);router[_0x13d5('0x5')](_0x13d5('0xe'),auth[_0x13d5('0x7')](),controller[_0x13d5('0xf')]);router[_0x13d5('0x5')]('/mail/queues',auth[_0x13d5('0x7')](),controller[_0x13d5('0x10')]);router[_0x13d5('0x5')](_0x13d5('0x11'),auth[_0x13d5('0x7')](),controller[_0x13d5('0x12')]);router[_0x13d5('0x5')](_0x13d5('0x13'),auth['isAuthenticated'](),controller[_0x13d5('0x14')]);router['get'](_0x13d5('0x15'),auth[_0x13d5('0x7')](),controller['smsQueues']);router[_0x13d5('0x5')](_0x13d5('0x16'),auth[_0x13d5('0x7')](),controller[_0x13d5('0x17')]);router[_0x13d5('0x5')]('/fax/queues',auth[_0x13d5('0x7')](),controller['faxQueues']);router[_0x13d5('0x5')](_0x13d5('0x18'),auth['isAuthenticated'](),controller[_0x13d5('0x19')]);router[_0x13d5('0x5')](_0x13d5('0x1a'),auth['isAuthenticated'](),controller[_0x13d5('0x1b')]);router[_0x13d5('0x5')](_0x13d5('0x1c'),auth[_0x13d5('0x7')](),controller[_0x13d5('0x1d')]);router['get'](_0x13d5('0x1e'),auth[_0x13d5('0x7')](),controller[_0x13d5('0x1f')]);router['get'](_0x13d5('0x20'),auth['isAuthenticated'](),controller[_0x13d5('0x21')]);router[_0x13d5('0x5')]('/voice/queues/:id',auth[_0x13d5('0x7')](),controller[_0x13d5('0x22')]);router[_0x13d5('0x23')](_0x13d5('0x24'),auth[_0x13d5('0x7')](),controller[_0x13d5('0x25')]);router[_0x13d5('0x5')](_0x13d5('0x26'),auth[_0x13d5('0x7')](),controller[_0x13d5('0x27')]);router['get'](_0x13d5('0x28'),auth[_0x13d5('0x7')](),controller[_0x13d5('0x29')]);router['get'](_0x13d5('0x2a'),auth[_0x13d5('0x7')](),controller['agents']);router['put']('/agents/:id/capacity',auth['isAuthenticated'](),controller[_0x13d5('0x2b')]);router['get'](_0x13d5('0x2c'),auth[_0x13d5('0x7')](),controller[_0x13d5('0x2d')]);router[_0x13d5('0x5')](_0x13d5('0x2e'),auth[_0x13d5('0x7')](),controller[_0x13d5('0x2f')]);router[_0x13d5('0x5')](_0x13d5('0x30'),auth['isAuthenticated'](),controller['campaigns']);router[_0x13d5('0x5')](_0x13d5('0x31'),auth['isAuthenticated'](),controller['faxAccounts']);router['get'](_0x13d5('0x32'),auth[_0x13d5('0x7')](),controller[_0x13d5('0x33')]);router[_0x13d5('0x5')](_0x13d5('0x34'),auth['isAuthenticated'](),controller['mailQueuesWaitingInteractions']);router[_0x13d5('0x5')](_0x13d5('0x35'),auth[_0x13d5('0x7')](),controller[_0x13d5('0x36')]);router[_0x13d5('0x5')](_0x13d5('0x37'),auth[_0x13d5('0x7')](),controller[_0x13d5('0x38')]);router[_0x13d5('0x5')](_0x13d5('0x39'),auth[_0x13d5('0x7')](),controller[_0x13d5('0x3a')]);router['get'](_0x13d5('0x3b'),auth[_0x13d5('0x7')](),controller[_0x13d5('0x3c')]);router[_0x13d5('0x5')]('/fax/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x13d5('0x3d')]);router[_0x13d5('0x3e')](_0x13d5('0x3f'),auth[_0x13d5('0x7')](),controller[_0x13d5('0x40')](_0x13d5('0x41')));router[_0x13d5('0x5')](_0x13d5('0x42'),auth[_0x13d5('0x7')](),controller[_0x13d5('0x43')]);router[_0x13d5('0x3e')](_0x13d5('0x44'),auth[_0x13d5('0x7')](),controller['queueNotify'](_0x13d5('0x45')));router[_0x13d5('0x5')](_0x13d5('0x46'),auth['isAuthenticated'](),controller[_0x13d5('0x47')]);router['post']('/fax/queues/:id/notify',auth[_0x13d5('0x7')](),controller[_0x13d5('0x40')](_0x13d5('0x48')));router[_0x13d5('0x5')](_0x13d5('0x49'),auth['isAuthenticated'](),controller[_0x13d5('0x4a')]);router['post'](_0x13d5('0x4b'),auth[_0x13d5('0x7')](),controller[_0x13d5('0x40')](_0x13d5('0x4c')));router[_0x13d5('0x5')](_0x13d5('0x4d'),auth[_0x13d5('0x7')](),controller['showOpenchannelQueues']);router[_0x13d5('0x3e')](_0x13d5('0x4e'),auth[_0x13d5('0x7')](),controller[_0x13d5('0x40')](_0x13d5('0x4f')));router[_0x13d5('0x3e')]('/whatsapp/queues/:id/notify',auth[_0x13d5('0x7')](),controller[_0x13d5('0x40')](_0x13d5('0x50')));router[_0x13d5('0x5')](_0x13d5('0x51'),auth['isAuthenticated'](),controller[_0x13d5('0x52')]);router[_0x13d5('0x5')](_0x13d5('0x53'),auth[_0x13d5('0x7')](),controller[_0x13d5('0x54')]);router['post'](_0x13d5('0x55'),auth[_0x13d5('0x7')](),controller[_0x13d5('0x56')]);module[_0x13d5('0x57')]=router; \ No newline at end of file +var _0xe12d=['telephones','/trunks','trunks','/campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','showMailQueues','/chat/queues/:id/notify','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceQueues','/chat/queues','chatQueues','mailQueues','/mail/accounts','mailAccounts','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','faxQueues','voiceQueuesPreview','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','put','updateVoiceQueue','/outbound','/outbound/channels','outboundChannels','agents','/agents/:id/capacity','agentCapacity','/telephones'];(function(_0x5bc8d1,_0x5800fe){var _0x5db7d0=function(_0x5a9756){while(--_0x5a9756){_0x5bc8d1['push'](_0x5bc8d1['shift']());}};_0x5db7d0(++_0x5800fe);}(_0xe12d,0xc8));var _0xde12=function(_0x45c846,_0x444500){_0x45c846=_0x45c846-0x0;var _0x2fec58=_0xe12d[_0x45c846];return _0x2fec58;};'use strict';var multer=require(_0xde12('0x0'));var util=require(_0xde12('0x1'));var path=require(_0xde12('0x2'));var express=require(_0xde12('0x3'));var router=express[_0xde12('0x4')]();var auth=require(_0xde12('0x5'));var controller=require(_0xde12('0x6'));router[_0xde12('0x7')](_0xde12('0x8'),auth['isAuthenticated'](),controller['voiceChannels']);router[_0xde12('0x7')](_0xde12('0x9'),auth[_0xde12('0xa')](),controller[_0xde12('0xb')]);router[_0xde12('0x7')](_0xde12('0xc'),auth[_0xde12('0xa')](),controller['voiceChannelStopMixMonitor']);router[_0xde12('0x7')]('/voice/queues',auth[_0xde12('0xa')](),controller[_0xde12('0xd')]);router[_0xde12('0x7')](_0xde12('0xe'),auth[_0xde12('0xa')](),controller[_0xde12('0xf')]);router[_0xde12('0x7')]('/mail/queues',auth[_0xde12('0xa')](),controller[_0xde12('0x10')]);router[_0xde12('0x7')](_0xde12('0x11'),auth[_0xde12('0xa')](),controller[_0xde12('0x12')]);router[_0xde12('0x7')]('/openchannel/queues',auth[_0xde12('0xa')](),controller[_0xde12('0x13')]);router[_0xde12('0x7')](_0xde12('0x14'),auth['isAuthenticated'](),controller[_0xde12('0x15')]);router[_0xde12('0x7')](_0xde12('0x16'),auth[_0xde12('0xa')](),controller[_0xde12('0x17')]);router[_0xde12('0x7')]('/fax/queues',auth[_0xde12('0xa')](),controller[_0xde12('0x18')]);router[_0xde12('0x7')]('/voice/queues/preview/:id',auth[_0xde12('0xa')](),controller[_0xde12('0x19')]);router[_0xde12('0x7')]('/voice/queues/channels',auth[_0xde12('0xa')](),controller['voiceQueuesChannels']);router[_0xde12('0x7')](_0xde12('0x1a'),auth['isAuthenticated'](),controller['voiceQueuesChannel']);router[_0xde12('0x7')](_0xde12('0x1b'),auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router['get'](_0xde12('0x1c'),auth[_0xde12('0xa')](),controller[_0xde12('0x1d')]);router[_0xde12('0x7')](_0xde12('0x1e'),auth[_0xde12('0xa')](),controller['showVoiceQueues']);router[_0xde12('0x1f')](_0xde12('0x1e'),auth['isAuthenticated'](),controller[_0xde12('0x20')]);router[_0xde12('0x7')](_0xde12('0x21'),auth[_0xde12('0xa')](),controller['outbound']);router[_0xde12('0x7')](_0xde12('0x22'),auth[_0xde12('0xa')](),controller[_0xde12('0x23')]);router[_0xde12('0x7')]('/agents',auth[_0xde12('0xa')](),controller[_0xde12('0x24')]);router[_0xde12('0x1f')](_0xde12('0x25'),auth[_0xde12('0xa')](),controller[_0xde12('0x26')]);router['get'](_0xde12('0x27'),auth[_0xde12('0xa')](),controller[_0xde12('0x28')]);router[_0xde12('0x7')](_0xde12('0x29'),auth[_0xde12('0xa')](),controller[_0xde12('0x2a')]);router['get'](_0xde12('0x2b'),auth[_0xde12('0xa')](),controller['campaigns']);router['get'](_0xde12('0x2c'),auth['isAuthenticated'](),controller['faxAccounts']);router[_0xde12('0x7')](_0xde12('0x2d'),auth['isAuthenticated'](),controller[_0xde12('0x2e')]);router['get'](_0xde12('0x2f'),auth[_0xde12('0xa')](),controller[_0xde12('0x30')]);router[_0xde12('0x7')]('/openchannel/queues/waitinginteractions',auth['isAuthenticated'](),controller['openchannelQueuesWaitingInteractions']);router[_0xde12('0x7')](_0xde12('0x31'),auth[_0xde12('0xa')](),controller[_0xde12('0x32')]);router['get'](_0xde12('0x33'),auth[_0xde12('0xa')](),controller[_0xde12('0x34')]);router[_0xde12('0x7')](_0xde12('0x35'),auth['isAuthenticated'](),controller[_0xde12('0x36')]);router['get'](_0xde12('0x37'),auth[_0xde12('0xa')](),controller[_0xde12('0x38')]);router[_0xde12('0x39')](_0xde12('0x3a'),auth[_0xde12('0xa')](),controller[_0xde12('0x3b')]('mail'));router[_0xde12('0x7')]('/mail/queues/:id',auth[_0xde12('0xa')](),controller[_0xde12('0x3c')]);router[_0xde12('0x39')](_0xde12('0x3d'),auth['isAuthenticated'](),controller[_0xde12('0x3b')]('chat'));router[_0xde12('0x7')](_0xde12('0x3e'),auth[_0xde12('0xa')](),controller[_0xde12('0x3f')]);router[_0xde12('0x39')](_0xde12('0x40'),auth['isAuthenticated'](),controller[_0xde12('0x3b')](_0xde12('0x41')));router['get'](_0xde12('0x42'),auth[_0xde12('0xa')](),controller['showFaxQueues']);router['post'](_0xde12('0x43'),auth[_0xde12('0xa')](),controller[_0xde12('0x3b')](_0xde12('0x44')));router[_0xde12('0x7')](_0xde12('0x45'),auth['isAuthenticated'](),controller[_0xde12('0x46')]);router[_0xde12('0x39')]('/sms/queues/:id/notify',auth['isAuthenticated'](),controller[_0xde12('0x3b')]('sms'));router['post'](_0xde12('0x47'),auth[_0xde12('0xa')](),controller['queueNotify'](_0xde12('0x48')));router['get'](_0xde12('0x49'),auth[_0xde12('0xa')](),controller[_0xde12('0x4a')]);router[_0xde12('0x7')](_0xde12('0x4b'),auth['isAuthenticated'](),controller[_0xde12('0x4c')]);router[_0xde12('0x39')](_0xde12('0x4d'),auth['isAuthenticated'](),controller[_0xde12('0x4e')]);module[_0xde12('0x4f')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 43871fe..74ebf14 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 _0xa630=['user','interaction','hasOwnProperty','MemberReport','findAll','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','findOrCreate','agent','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','ChatQueues','MailQueues','showMailQueues','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','uniq','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','Website','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','queue','MessageId','InteractionId','From','Account','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','channel','Channel\x20field\x20is\x20mandatory','update','agentTransferTimeout','bluebird','moment','../../mysqldb','api','client','http','then','error','code','message','result','json','stack','name','status','isNil','rows','find','voiceChannels','VoiceChannels','catch','VoiceChannelMixMonitor','merge','query','params','VoiceChannelStopMixMonitor','showVoiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','outboundChannels','OutboundChannels','agents','agentCapacity'];(function(_0x350ec3,_0x1dcb41){var _0x1eef31=function(_0x388869){while(--_0x388869){_0x350ec3['push'](_0x350ec3['shift']());}};_0x1eef31(++_0x1dcb41);}(_0xa630,0xbe));var _0x0a63=function(_0x2bcb14,_0x214d85){_0x2bcb14=_0x2bcb14-0x0;var _0x402ea9=_0xa630[_0x2bcb14];return _0x402ea9;};'use strict';var BPromise=require(_0x0a63('0x0'));var moment=require(_0x0a63('0x1'));var _=require('lodash');var util=require('util');var db=require(_0x0a63('0x2'))['db'];var logger=require('../../config/logger')(_0x0a63('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0x0a63('0x4')][_0x0a63('0x5')]({'port':0x232a});var mailClient=jayson[_0x0a63('0x4')][_0x0a63('0x5')]({'port':0x232b});var routingClient=jayson[_0x0a63('0x4')]['http']({'port':0x232c});function respondWithRpcPromise(_0x2760b0,_0x3d5f0b,_0xc2dcd7){return new BPromise(function(_0x41d21d,_0x12a7df){var _0x2a1bd7=_0xc2dcd7?_0xc2dcd7:amiClient;return _0x2a1bd7['request'](_0x2760b0,_0x3d5f0b)[_0x0a63('0x6')](function(_0xb714c7){if(_0xb714c7[_0x0a63('0x7')]){if(_0xb714c7[_0x0a63('0x7')][_0x0a63('0x8')]===0x1f4){return _0x12a7df(_0xb714c7[_0x0a63('0x7')][_0x0a63('0x9')]);}return _0x41d21d(_0xb714c7[_0x0a63('0x7')][_0x0a63('0x9')]);}else{_0x41d21d(_0xb714c7[_0x0a63('0xa')]);}})['catch'](function(_0x345f56){_0x12a7df(_0x345f56);});});}function respondWithResult(_0x420043,_0x2fce86){_0x2fce86=_0x2fce86||0xc8;return function(_0x3d6323){if(_0x3d6323){return _0x420043['status'](_0x2fce86)[_0x0a63('0xb')](_0x3d6323);}return _0x420043['sendStatus'](0x194);};}function handleError(_0x331e99,_0x19e922){_0x19e922=_0x19e922||0x1f4;return function(_0x26b2bc){logger[_0x0a63('0x7')](_0x26b2bc[_0x0a63('0xc')]);if(_0x26b2bc[_0x0a63('0xd')]){delete _0x26b2bc[_0x0a63('0xd')];}_0x331e99[_0x0a63('0xe')](_0x19e922)['send'](_0x26b2bc);};}function findById(_0x47788e){return function(_0x56b314){if(!_[_0x0a63('0xf')](_0x47788e)&&!_[_0x0a63('0xf')](_0x56b314)&&!_[_0x0a63('0xf')](_0x56b314[_0x0a63('0x10')])){return _[_0x0a63('0x11')](_0x56b314[_0x0a63('0x10')],function(_0x30f292){return _0x30f292['id']==_0x47788e;});}return null;};}exports[_0x0a63('0x12')]=function(_0x2fd06c,_0x3cc74d){return respondWithRpcPromise(_0x0a63('0x13'),_0x2fd06c['query'])['then'](respondWithResult(_0x3cc74d,null))[_0x0a63('0x14')](handleError(_0x3cc74d,null));};exports['voiceChannelMixMonitor']=function(_0x2fc87c,_0x5937df){return respondWithRpcPromise(_0x0a63('0x15'),_[_0x0a63('0x16')](_0x2fc87c[_0x0a63('0x17')],_0x2fc87c[_0x0a63('0x18')]))['then'](respondWithResult(_0x5937df,null))[_0x0a63('0x14')](handleError(_0x5937df,null));};exports['voiceChannelStopMixMonitor']=function(_0x3a7f9d,_0x11fe64){return respondWithRpcPromise(_0x0a63('0x19'),_[_0x0a63('0x16')](_0x3a7f9d[_0x0a63('0x17')],_0x3a7f9d[_0x0a63('0x18')]))[_0x0a63('0x6')](respondWithResult(_0x11fe64,null))[_0x0a63('0x14')](handleError(_0x11fe64,null));};exports['voiceQueues']=function(_0x5e5987,_0x55fb70){return respondWithRpcPromise('VoiceQueues',_0x5e5987[_0x0a63('0x17')])['then'](respondWithResult(_0x55fb70,null))['catch'](handleError(_0x55fb70,null));};exports[_0x0a63('0x1a')]=function(_0x1d5448,_0x362d6a){return respondWithRpcPromise(_0x0a63('0x1b'),_0x1d5448['query'])[_0x0a63('0x6')](findById(_0x1d5448[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0x362d6a,null))['catch'](handleError(_0x362d6a,null));};exports[_0x0a63('0x1c')]=function(_0xcf409,_0x1b7bdb){return respondWithRpcPromise(_0x0a63('0x1d'),_[_0x0a63('0x16')](_0xcf409[_0x0a63('0x1e')],_0xcf409[_0x0a63('0x18')]))[_0x0a63('0x6')](respondWithResult(_0x1b7bdb,null))['catch'](handleError(_0x1b7bdb,null));};exports[_0x0a63('0x1f')]=function(_0x574c06,_0x151cb6){return respondWithRpcPromise(_0x0a63('0x20'),_[_0x0a63('0x16')](_0x574c06[_0x0a63('0x17')],_0x574c06[_0x0a63('0x18')]))['then'](respondWithResult(_0x151cb6,null))[_0x0a63('0x14')](handleError(_0x151cb6,null));};exports[_0x0a63('0x21')]=function(_0x33a717,_0x46fb40){return respondWithRpcPromise('VoiceQueuesChannels',_0x33a717[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0x46fb40,null))['catch'](handleError(_0x46fb40,null));};exports['voiceQueuesChannel']=function(_0x34a170,_0x51d959){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x0a63('0x16')](_0x34a170[_0x0a63('0x17')],_0x34a170['params']))[_0x0a63('0x6')](respondWithResult(_0x51d959,null))[_0x0a63('0x14')](handleError(_0x51d959,null));};exports[_0x0a63('0x22')]=function(_0x333130,_0x395cce){return respondWithRpcPromise('VoiceQueuesChannelHangup',_['merge'](_0x333130[_0x0a63('0x17')],_0x333130[_0x0a63('0x18')]))[_0x0a63('0x6')](respondWithResult(_0x395cce,null))[_0x0a63('0x14')](handleError(_0x395cce,null));};exports[_0x0a63('0x23')]=function(_0x273bcf,_0x59912d){return respondWithRpcPromise(_0x0a63('0x24'),_[_0x0a63('0x16')](_0x273bcf['query'],_0x273bcf[_0x0a63('0x18')]))['then'](respondWithResult(_0x59912d,null))['catch'](handleError(_0x59912d,null));};exports[_0x0a63('0x25')]=function(_0x232388,_0xdc602c){return respondWithRpcPromise('Outbound',_0x232388[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0xdc602c,null))[_0x0a63('0x14')](handleError(_0xdc602c,null));};exports[_0x0a63('0x26')]=function(_0x3f88a1,_0x876bc6){return respondWithRpcPromise(_0x0a63('0x27'),_0x3f88a1['query'])[_0x0a63('0x6')](respondWithResult(_0x876bc6,null))[_0x0a63('0x14')](handleError(_0x876bc6,null));};exports[_0x0a63('0x28')]=function(_0x53d034,_0x5d9952){var _0x28f904;return respondWithRpcPromise('Agents',_0x53d034[_0x0a63('0x17')])[_0x0a63('0x6')](function(_0x128e9e){_0x28f904=_0x128e9e;return respondWithRpcPromise('Agents',_0x53d034[_0x0a63('0x17')],routingClient);})[_0x0a63('0x6')](function(_0x46b6ee){return _[_0x0a63('0x16')]({},_0x46b6ee,_0x28f904);})['then'](respondWithResult(_0x5d9952,null))[_0x0a63('0x14')](handleError(_0x5d9952,null));};exports[_0x0a63('0x29')]=function(_0x4234cd,_0x2ccd99){if(_0x4234cd[_0x0a63('0x1e')]&&_0x4234cd[_0x0a63('0x1e')]['interaction']&&_0x4234cd[_0x0a63('0x2a')]&&_0x4234cd[_0x0a63('0x2a')][_0x0a63('0xd')]){for(var _0x793502 in _0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')]){if(_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x0a63('0x2c')](_0x793502)){db[_0x0a63('0x2d')][_0x0a63('0x2e')]({'where':{'channel':_0x793502,'membername':_0x4234cd[_0x0a63('0x2a')][_0x0a63('0xd')],'type':_0x0a63('0x2f'),'exitAt':null,'uniqueid':_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x793502]&&_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x793502]['length']?{'$notIn':_0x4234cd[_0x0a63('0x1e')]['interaction'][_0x793502]}:{'$ne':null}}})['then'](function(_0xd9eddc){var _0x223ecf=moment()[_0x0a63('0x30')](_0x0a63('0x31'));for(var _0xd9149d=0x0,_0x9c89ed=_0xd9eddc[_0x0a63('0x32')];_0xd9149d<_0x9c89ed;_0xd9149d+=0x1){_0xd9eddc[_0xd9149d][_0x0a63('0x33')]({'exitAt':_0x223ecf});}});for(var _0x3d0667=0x0;_0x3d0667<_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x793502][_0x0a63('0x32')];_0x3d0667+=0x1){db[_0x0a63('0x2d')][_0x0a63('0x34')]({'where':{'channel':_0x793502,'membername':_0x4234cd[_0x0a63('0x2a')][_0x0a63('0xd')],'type':_0x0a63('0x2f'),'uniqueid':_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x793502][_0x3d0667],'exitAt':null},'defaults':{'channel':_0x793502,'membername':_0x4234cd[_0x0a63('0x2a')]['name'],'interface':_[_0x0a63('0xf')](_0x4234cd[_0x0a63('0x2a')]['interface'])?util['format']('SIP/%s',_0x4234cd['user'][_0x0a63('0xd')]):_0x4234cd[_0x0a63('0x2a')]['interface'],'type':_0x0a63('0x2f'),'enterAt':moment()['format'](_0x0a63('0x31')),'role':_0x0a63('0x35'),'internal':_0x4234cd['user']['internal'],'uniqueid':_0x4234cd['body'][_0x0a63('0x2b')][_0x793502][_0x3d0667]}});}}}}return respondWithRpcPromise(_0x0a63('0x36'),{'id':_0x4234cd[_0x0a63('0x18')]['id'],'capacity':_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x37')]},routingClient)['then'](respondWithResult(_0x2ccd99,null))[_0x0a63('0x14')](handleError(_0x2ccd99,null));};exports[_0x0a63('0x38')]=function(_0x22b3ea,_0x10adf1){return respondWithRpcPromise(_0x0a63('0x39'),_0x22b3ea['query'])[_0x0a63('0x6')](respondWithResult(_0x10adf1,null))[_0x0a63('0x14')](handleError(_0x10adf1,null));};exports[_0x0a63('0x3a')]=function(_0x1fbd2b,_0x4f3414){return respondWithRpcPromise(_0x0a63('0x3b'),_0x1fbd2b[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0x4f3414,null))[_0x0a63('0x14')](handleError(_0x4f3414,null));};exports[_0x0a63('0x3c')]=function(_0x258ed3,_0x4d4e20){return respondWithRpcPromise(_0x0a63('0x3d'),_0x258ed3[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0x4d4e20,null))[_0x0a63('0x14')](handleError(_0x4d4e20,null));};exports['chatQueues']=function(_0x4c1e34,_0x2ac98b){return respondWithRpcPromise(_0x0a63('0x3e'),_0x4c1e34[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x2ac98b,null))[_0x0a63('0x14')](handleError(_0x2ac98b,null));};exports['showChatQueues']=function(_0x5e6aae,_0x58b3a8){return respondWithRpcPromise(_0x0a63('0x3e'),_0x5e6aae['query'],routingClient)[_0x0a63('0x6')](findById(_0x5e6aae[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0x58b3a8,null))['catch'](handleError(_0x58b3a8,null));};exports['mailQueues']=function(_0x2d63c6,_0x226279){return respondWithRpcPromise(_0x0a63('0x3f'),_0x2d63c6[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x226279,null))[_0x0a63('0x14')](handleError(_0x226279,null));};exports[_0x0a63('0x40')]=function(_0xc3415c,_0xe454ef){return respondWithRpcPromise(_0x0a63('0x3f'),_0xc3415c[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0xc3415c[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0xe454ef,null))['catch'](handleError(_0xe454ef,null));};exports['mailAccounts']=function(_0x1adea6,_0x24c9e0){return respondWithRpcPromise('MailAccounts',_0x1adea6[_0x0a63('0x17')],mailClient)[_0x0a63('0x6')](respondWithResult(_0x24c9e0,null))['catch'](handleError(_0x24c9e0,null));};exports[_0x0a63('0x41')]=function(_0x3053e4,_0x5e5495){return respondWithRpcPromise('OpenchannelQueues',_0x3053e4[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x5e5495,null))[_0x0a63('0x14')](handleError(_0x5e5495,null));};exports['showOpenchannelQueues']=function(_0x116e05,_0x375acd){return respondWithRpcPromise(_0x0a63('0x42'),_0x116e05[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0x116e05['params']['id']))[_0x0a63('0x6')](respondWithResult(_0x375acd,null))[_0x0a63('0x14')](handleError(_0x375acd,null));};exports[_0x0a63('0x43')]=function(_0x1fa9cd,_0x295c06){return respondWithRpcPromise(_0x0a63('0x44'),_0x1fa9cd[_0x0a63('0x17')],routingClient)['then'](respondWithResult(_0x295c06,null))[_0x0a63('0x14')](handleError(_0x295c06,null));};exports[_0x0a63('0x45')]=function(_0x252f70,_0x1155f1){return respondWithRpcPromise(_0x0a63('0x44'),_0x252f70[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0x252f70[_0x0a63('0x18')]['id']))['then'](respondWithResult(_0x1155f1,null))['catch'](handleError(_0x1155f1,null));};exports[_0x0a63('0x46')]=function(_0x30e5f0,_0x4137bc){return respondWithRpcPromise(_0x0a63('0x47'),_0x30e5f0[_0x0a63('0x17')],routingClient)['then'](respondWithResult(_0x4137bc,null))[_0x0a63('0x14')](handleError(_0x4137bc,null));};exports[_0x0a63('0x48')]=function(_0x1aefc4,_0x2a2f1b){return respondWithRpcPromise(_0x0a63('0x47'),_0x1aefc4[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0x1aefc4[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0x2a2f1b,null))[_0x0a63('0x14')](handleError(_0x2a2f1b,null));};exports[_0x0a63('0x49')]=function(_0x485969,_0x25276f){return respondWithRpcPromise('FaxQueues',_0x485969[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x25276f,null))['catch'](handleError(_0x25276f,null));};exports['showFaxQueues']=function(_0x480acb,_0x31481f){return respondWithRpcPromise(_0x0a63('0x4a'),_0x480acb[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0x480acb[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0x31481f,null))['catch'](handleError(_0x31481f,null));};exports['faxAccounts']=function(_0x5cb325,_0x1213a5){return respondWithRpcPromise(_0x0a63('0x4b'),_0x5cb325[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0x1213a5,null))['catch'](handleError(_0x1213a5,null));};exports[_0x0a63('0x4c')]=function(_0x5ed2db,_0x5de3de){return respondWithRpcPromise(_0x0a63('0x4d'),_0x5ed2db['query'],routingClient)[_0x0a63('0x6')](respondWithResult(_0x5de3de,null))[_0x0a63('0x14')](handleError(_0x5de3de,null));};exports['mailQueuesWaitingInteractions']=function(_0x267583,_0x4d1e35){return respondWithRpcPromise(_0x0a63('0x4e'),_0x267583['query'],routingClient)[_0x0a63('0x6')](respondWithResult(_0x4d1e35,null))[_0x0a63('0x14')](handleError(_0x4d1e35,null));};exports[_0x0a63('0x4f')]=function(_0x4fba49,_0x3b8442){return respondWithRpcPromise(_0x0a63('0x50'),_0x4fba49[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x3b8442,null))[_0x0a63('0x14')](handleError(_0x3b8442,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x55174c,_0x550dbb){return respondWithRpcPromise(_0x0a63('0x50'),_0x55174c['query'],routingClient)[_0x0a63('0x6')](function(_0xa27da4){if(_0x55174c[_0x0a63('0x17')][_0x0a63('0x51')]!==undefined){var _0x5540c6=_(_0xa27da4[_0x0a63('0x10')])[_0x0a63('0x52')]([_0x55174c['query'][_0x0a63('0x51')],_0x55174c[_0x0a63('0x18')]['id']])[_0x0a63('0x53')](_0x0a63('0x54'))[_0x0a63('0x55')]()['value']();return _0xa27da4[_0x0a63('0x10')][_0x0a63('0x52')](function(_0x3941f6){return _0x5540c6['indexOf'](_0x3941f6['queue_id'])>-0x1;});}else{return _0xa27da4['rows'][_0x0a63('0x52')](function(_0x3b94ae){return _0x3b94ae[_0x0a63('0x54')]===parseInt(_0x55174c[_0x0a63('0x18')]['id']);});}})[_0x0a63('0x6')](respondWithResult(_0x550dbb,null))[_0x0a63('0x14')](handleError(_0x550dbb,null));};exports[_0x0a63('0x56')]=function(_0x37255d,_0x1dc593){return respondWithRpcPromise(_0x0a63('0x57'),_0x37255d['query'],routingClient)[_0x0a63('0x6')](respondWithResult(_0x1dc593,null))[_0x0a63('0x14')](handleError(_0x1dc593,null));};exports[_0x0a63('0x58')]=function(_0x229954,_0x3d62ca){return respondWithRpcPromise(_0x0a63('0x59'),_0x229954['query'],routingClient)['then'](respondWithResult(_0x3d62ca,null))[_0x0a63('0x14')](handleError(_0x3d62ca,null));};exports[_0x0a63('0x5a')]=function(_0x425c8c,_0x3caea6){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x425c8c[_0x0a63('0x17')],routingClient)['then'](respondWithResult(_0x3caea6,null))[_0x0a63('0x14')](handleError(_0x3caea6,null));};exports[_0x0a63('0x5b')]=function(_0x1e256e){return function(_0xee586,_0x486ffc){var _0x3710fa,_0x2173ee;var _0x430065=_[_0x0a63('0x5c')](_0x1e256e);var _0x540953=_0x1e256e==='chat'?_0x0a63('0x5d'):'Account';return db[_0x430065+_0x0a63('0x5e')][_0x0a63('0x5f')]({'raw':!![],'where':{'id':_0xee586[_0x0a63('0x18')]['id']}})[_0x0a63('0x6')](function(_0x65a390){if(_['isNil'](_0x65a390)){throw new Error(_0x430065+_0x0a63('0x60'));}_0x3710fa=_0x65a390;return db[_0x430065+_0x0a63('0x61')][_0x0a63('0x5f')]({'where':{'id':_0xee586[_0x0a63('0x1e')][_0x0a63('0x62')]},'include':[{'model':db[_0x430065+_0x0a63('0x63')],'as':_0x0a63('0x63')},{'model':db[_0x430065+_0x540953],'as':'Account'}]});})[_0x0a63('0x6')](function(_0x1a329c){if(_[_0x0a63('0xf')](_0x1a329c)){throw new Error(_0x430065+_0x0a63('0x64'));}_0x2173ee=_0x1a329c;return _0x1a329c['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x0a63('0x6')](function(){var _0x148bbd={'uniqueid':_0x1e256e+'.'+_0x2173ee['id']+'.'+_0x2173ee[_0x0a63('0x63')]['id'],'FromUserId':_0xee586['user']['id'],'type':_0x0a63('0x65')};_0x148bbd[_0x430065+_0x0a63('0x66')]=_0x2173ee['id'];_0x148bbd[_0x430065+_0x0a63('0x67')]=_0x2173ee['Interaction']['id'];_0x148bbd[_0x0a63('0x68')+_0x430065+_0x540953+'Id']=_0x2173ee[_0x0a63('0x69')]['id'];_0x148bbd['To'+_0x430065+_0x0a63('0x6a')]=_0x3710fa['id'];return db[_0x430065+_0x0a63('0x6b')][_0x0a63('0x6c')](_0x148bbd);})[_0x0a63('0x6')](function(){return respondWithRpcPromise(_0x0a63('0x6d'),{'channel':_0x1e256e,'interaction':_0x2173ee[_0x0a63('0x63')],'message':_0x2173ee,'account':_0x2173ee[_0x0a63('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0a63('0x65'),'appdata':_0x3710fa[_0x0a63('0xd')]+','+(_0x2173ee[_0x0a63('0x69')][_0x0a63('0x6e')]||0x12c),'interval':_0x0a63('0x6f')}]},routingClient);})[_0x0a63('0x6')](respondWithResult(_0x486ffc,null))[_0x0a63('0x14')](handleError(_0x486ffc,null));};};exports['agentNotify']=function(_0x3ddf5e,_0x5f0510){var _0x19a46f,_0x36fd48;if(_['isNil'](_0x3ddf5e[_0x0a63('0x1e')][_0x0a63('0x70')])){throw new Error(_0x0a63('0x71'));}var _0x2e1dc6=_0x3ddf5e[_0x0a63('0x1e')][_0x0a63('0x70')];var _0x1030f7=_[_0x0a63('0x5c')](_0x2e1dc6);var _0x393399=_0x2e1dc6==='chat'?_0x0a63('0x5d'):'Account';return db['User'][_0x0a63('0x5f')]({'raw':!![],'where':{'id':_0x3ddf5e[_0x0a63('0x18')]['id'],'role':_0x0a63('0x35')}})[_0x0a63('0x6')](function(_0x5e1f76){if(_[_0x0a63('0xf')](_0x5e1f76)){throw new Error('Agent\x20not\x20found');}_0x19a46f=_0x5e1f76;return db[_0x1030f7+'Message'][_0x0a63('0x5f')]({'where':{'id':_0x3ddf5e['body']['messageId']},'include':[{'model':db[_0x1030f7+_0x0a63('0x63')],'as':_0x0a63('0x63')},{'model':db[_0x1030f7+_0x393399],'as':_0x0a63('0x69')}]});})[_0x0a63('0x6')](function(_0x52488a){if(_[_0x0a63('0xf')](_0x52488a)){throw new Error(_0x1030f7+'\x20Message\x20not\x20found');}_0x36fd48=_0x52488a;return _0x52488a[_0x0a63('0x72')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x11dd21={'uniqueid':_0x2e1dc6+'.'+_0x36fd48['id']+'.'+_0x36fd48['Interaction']['id'],'FromUserId':_0x3ddf5e[_0x0a63('0x2a')]['id'],'type':_0x0a63('0x65'),'ToUserId':_0x19a46f['id']};_0x11dd21[_0x1030f7+_0x0a63('0x66')]=_0x36fd48['id'];_0x11dd21[_0x1030f7+_0x0a63('0x67')]=_0x36fd48[_0x0a63('0x63')]['id'];_0x11dd21[_0x0a63('0x68')+_0x1030f7+_0x393399+'Id']=_0x36fd48[_0x0a63('0x69')]['id'];return db[_0x1030f7+_0x0a63('0x6b')][_0x0a63('0x6c')](_0x11dd21);})['then'](function(){return respondWithRpcPromise(_0x0a63('0x6d'),{'channel':_0x2e1dc6,'interaction':_0x36fd48['Interaction'],'message':_0x36fd48,'account':_0x36fd48[_0x0a63('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0a63('0x35'),'appdata':_0x19a46f[_0x0a63('0xd')]+','+(_0x36fd48[_0x0a63('0x69')][_0x0a63('0x73')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x0a63('0x6')](respondWithResult(_0x5f0510,null))[_0x0a63('0x14')](handleError(_0x5f0510,null));}; \ No newline at end of file +var _0x032e=['MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','queue_id','uniq','value','filter','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Website','Account','Queue','\x20Queue\x20not\x20found','findOne','Interaction','update','queue','MessageId','InteractionId','From','TransferReport','agentNotify','Channel\x20field\x20is\x20mandatory','channel','Agent\x20not\x20found','Message','\x20Message\x20not\x20found','create','Start','bluebird','lodash','util','api','jayson/promise','client','http','request','then','error','code','message','result','catch','status','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','params','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesChannels','VoiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','format','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x032e,0x124));var _0xe032=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x032e[_0x2763f2];return _0x3ef471;};'use strict';var BPromise=require(_0xe032('0x0'));var moment=require('moment');var _=require(_0xe032('0x1'));var util=require(_0xe032('0x2'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0xe032('0x3'));var jayson=require(_0xe032('0x4'));var amiClient=jayson[_0xe032('0x5')][_0xe032('0x6')]({'port':0x232a});var mailClient=jayson[_0xe032('0x5')][_0xe032('0x6')]({'port':0x232b});var routingClient=jayson[_0xe032('0x5')][_0xe032('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x37432f,_0x1576c8,_0x3289b0){return new BPromise(function(_0xd84027,_0xaf3907){var _0x3b0ef8=_0x3289b0?_0x3289b0:amiClient;return _0x3b0ef8[_0xe032('0x7')](_0x37432f,_0x1576c8)[_0xe032('0x8')](function(_0x2dc9e5){if(_0x2dc9e5[_0xe032('0x9')]){if(_0x2dc9e5['error'][_0xe032('0xa')]===0x1f4){return _0xaf3907(_0x2dc9e5[_0xe032('0x9')][_0xe032('0xb')]);}return _0xd84027(_0x2dc9e5[_0xe032('0x9')][_0xe032('0xb')]);}else{_0xd84027(_0x2dc9e5[_0xe032('0xc')]);}})[_0xe032('0xd')](function(_0x5bcb5b){_0xaf3907(_0x5bcb5b);});});}function respondWithResult(_0x646979,_0x266d71){_0x266d71=_0x266d71||0xc8;return function(_0x28c2b6){if(_0x28c2b6){return _0x646979[_0xe032('0xe')](_0x266d71)['json'](_0x28c2b6);}return _0x646979[_0xe032('0xf')](0x194);};}function handleError(_0x2e267b,_0x176547){_0x176547=_0x176547||0x1f4;return function(_0x422e96){logger[_0xe032('0x9')](_0x422e96[_0xe032('0x10')]);if(_0x422e96[_0xe032('0x11')]){delete _0x422e96['name'];}_0x2e267b[_0xe032('0xe')](_0x176547)[_0xe032('0x12')](_0x422e96);};}function findById(_0x36fb7c){return function(_0x3b57d3){if(!_[_0xe032('0x13')](_0x36fb7c)&&!_[_0xe032('0x13')](_0x3b57d3)&&!_['isNil'](_0x3b57d3[_0xe032('0x14')])){return _[_0xe032('0x15')](_0x3b57d3[_0xe032('0x14')],function(_0x41d2a5){return _0x41d2a5['id']==_0x36fb7c;});}return null;};}exports[_0xe032('0x16')]=function(_0x5721ce,_0x4b644b){return respondWithRpcPromise('VoiceChannels',_0x5721ce[_0xe032('0x17')])['then'](respondWithResult(_0x4b644b,null))[_0xe032('0xd')](handleError(_0x4b644b,null));};exports[_0xe032('0x18')]=function(_0x3f0257,_0x2aa342){return respondWithRpcPromise(_0xe032('0x19'),_[_0xe032('0x1a')](_0x3f0257[_0xe032('0x17')],_0x3f0257['params']))[_0xe032('0x8')](respondWithResult(_0x2aa342,null))[_0xe032('0xd')](handleError(_0x2aa342,null));};exports[_0xe032('0x1b')]=function(_0x2be433,_0x2ca592){return respondWithRpcPromise(_0xe032('0x1c'),_[_0xe032('0x1a')](_0x2be433[_0xe032('0x17')],_0x2be433['params']))['then'](respondWithResult(_0x2ca592,null))['catch'](handleError(_0x2ca592,null));};exports[_0xe032('0x1d')]=function(_0x2568ce,_0x302559){return respondWithRpcPromise(_0xe032('0x1e'),_0x2568ce[_0xe032('0x17')])[_0xe032('0x8')](respondWithResult(_0x302559,null))[_0xe032('0xd')](handleError(_0x302559,null));};exports[_0xe032('0x1f')]=function(_0x4dcbf1,_0x1ac20b){return respondWithRpcPromise('VoiceQueues',_0x4dcbf1[_0xe032('0x17')])[_0xe032('0x8')](findById(_0x4dcbf1[_0xe032('0x20')]['id']))[_0xe032('0x8')](respondWithResult(_0x1ac20b,null))['catch'](handleError(_0x1ac20b,null));};exports['updateVoiceQueue']=function(_0x3e2575,_0x38e7ea){return respondWithRpcPromise(_0xe032('0x21'),_[_0xe032('0x1a')](_0x3e2575['body'],_0x3e2575['params']))['then'](respondWithResult(_0x38e7ea,null))[_0xe032('0xd')](handleError(_0x38e7ea,null));};exports[_0xe032('0x22')]=function(_0x5518ac,_0x707b){return respondWithRpcPromise('VoiceQueuesPreview',_[_0xe032('0x1a')](_0x5518ac[_0xe032('0x17')],_0x5518ac[_0xe032('0x20')]))[_0xe032('0x8')](respondWithResult(_0x707b,null))[_0xe032('0xd')](handleError(_0x707b,null));};exports['voiceQueuesChannels']=function(_0xd90bd5,_0x33634c){return respondWithRpcPromise(_0xe032('0x23'),_0xd90bd5[_0xe032('0x17')])['then'](respondWithResult(_0x33634c,null))[_0xe032('0xd')](handleError(_0x33634c,null));};exports['voiceQueuesChannel']=function(_0x2f3e59,_0x53df28){return respondWithRpcPromise(_0xe032('0x24'),_['merge'](_0x2f3e59[_0xe032('0x17')],_0x2f3e59['params']))[_0xe032('0x8')](respondWithResult(_0x53df28,null))[_0xe032('0xd')](handleError(_0x53df28,null));};exports['voiceQueuesChannelHangup']=function(_0x3e3598,_0x2fdf41){return respondWithRpcPromise(_0xe032('0x25'),_[_0xe032('0x1a')](_0x3e3598['query'],_0x3e3598[_0xe032('0x20')]))['then'](respondWithResult(_0x2fdf41,null))[_0xe032('0xd')](handleError(_0x2fdf41,null));};exports[_0xe032('0x26')]=function(_0x5d02c1,_0x450ba4){return respondWithRpcPromise(_0xe032('0x27'),_['merge'](_0x5d02c1[_0xe032('0x17')],_0x5d02c1[_0xe032('0x20')]))[_0xe032('0x8')](respondWithResult(_0x450ba4,null))[_0xe032('0xd')](handleError(_0x450ba4,null));};exports[_0xe032('0x28')]=function(_0x42f58a,_0x19ee0a){return respondWithRpcPromise(_0xe032('0x29'),_0x42f58a[_0xe032('0x17')])[_0xe032('0x8')](respondWithResult(_0x19ee0a,null))[_0xe032('0xd')](handleError(_0x19ee0a,null));};exports[_0xe032('0x2a')]=function(_0x30571c,_0x28ba5d){return respondWithRpcPromise(_0xe032('0x2b'),_0x30571c[_0xe032('0x17')])[_0xe032('0x8')](respondWithResult(_0x28ba5d,null))['catch'](handleError(_0x28ba5d,null));};exports[_0xe032('0x2c')]=function(_0x536c76,_0x3d02c1){var _0x2bcfb4;return respondWithRpcPromise(_0xe032('0x2d'),_0x536c76[_0xe032('0x17')])[_0xe032('0x8')](function(_0x5eccad){_0x2bcfb4=_0x5eccad;return respondWithRpcPromise(_0xe032('0x2d'),_0x536c76['query'],routingClient);})[_0xe032('0x8')](function(_0x590be2){return _[_0xe032('0x1a')]({},_0x590be2,_0x2bcfb4);})[_0xe032('0x8')](respondWithResult(_0x3d02c1,null))[_0xe032('0xd')](handleError(_0x3d02c1,null));};exports[_0xe032('0x2e')]=function(_0x4dc836,_0x477360){if(_0x4dc836['body']&&_0x4dc836[_0xe032('0x2f')][_0xe032('0x30')]&&_0x4dc836[_0xe032('0x31')]&&_0x4dc836[_0xe032('0x31')]['name']){for(var _0x513b0c in _0x4dc836[_0xe032('0x2f')][_0xe032('0x30')]){if(_0x4dc836['body'][_0xe032('0x30')][_0xe032('0x32')](_0x513b0c)){db[_0xe032('0x33')][_0xe032('0x34')]({'where':{'channel':_0x513b0c,'membername':_0x4dc836[_0xe032('0x31')]['name'],'type':_0xe032('0x35'),'exitAt':null,'uniqueid':_0x4dc836[_0xe032('0x2f')][_0xe032('0x30')][_0x513b0c]&&_0x4dc836[_0xe032('0x2f')][_0xe032('0x30')][_0x513b0c][_0xe032('0x36')]?{'$notIn':_0x4dc836[_0xe032('0x2f')][_0xe032('0x30')][_0x513b0c]}:{'$ne':null}}})['then'](function(_0x535f34){var _0x1b0e28=moment()['format'](_0xe032('0x37'));for(var _0x277207=0x0,_0x1873a6=_0x535f34[_0xe032('0x36')];_0x277207<_0x1873a6;_0x277207+=0x1){_0x535f34[_0x277207][_0xe032('0x38')]({'exitAt':_0x1b0e28});}});for(var _0x3dfb51=0x0;_0x3dfb51<_0x4dc836[_0xe032('0x2f')][_0xe032('0x30')][_0x513b0c][_0xe032('0x36')];_0x3dfb51+=0x1){db['MemberReport'][_0xe032('0x39')]({'where':{'channel':_0x513b0c,'membername':_0x4dc836['user']['name'],'type':_0xe032('0x35'),'uniqueid':_0x4dc836[_0xe032('0x2f')][_0xe032('0x30')][_0x513b0c][_0x3dfb51],'exitAt':null},'defaults':{'channel':_0x513b0c,'membername':_0x4dc836[_0xe032('0x31')]['name'],'interface':_[_0xe032('0x13')](_0x4dc836[_0xe032('0x31')][_0xe032('0x3a')])?util[_0xe032('0x3b')](_0xe032('0x3c'),_0x4dc836[_0xe032('0x31')][_0xe032('0x11')]):_0x4dc836['user'][_0xe032('0x3a')],'type':_0xe032('0x35'),'enterAt':moment()['format'](_0xe032('0x37')),'role':_0xe032('0x3d'),'internal':_0x4dc836[_0xe032('0x31')][_0xe032('0x3e')],'uniqueid':_0x4dc836[_0xe032('0x2f')][_0xe032('0x30')][_0x513b0c][_0x3dfb51]}});}}}}return respondWithRpcPromise(_0xe032('0x3f'),{'id':_0x4dc836[_0xe032('0x20')]['id'],'capacity':_0x4dc836[_0xe032('0x2f')][_0xe032('0x40')]},routingClient)[_0xe032('0x8')](respondWithResult(_0x477360,null))[_0xe032('0xd')](handleError(_0x477360,null));};exports[_0xe032('0x41')]=function(_0x2f8114,_0x4eabfc){return respondWithRpcPromise(_0xe032('0x42'),_0x2f8114['query'])[_0xe032('0x8')](respondWithResult(_0x4eabfc,null))[_0xe032('0xd')](handleError(_0x4eabfc,null));};exports[_0xe032('0x43')]=function(_0x11ae58,_0x41289d){return respondWithRpcPromise(_0xe032('0x44'),_0x11ae58[_0xe032('0x17')])[_0xe032('0x8')](respondWithResult(_0x41289d,null))[_0xe032('0xd')](handleError(_0x41289d,null));};exports[_0xe032('0x45')]=function(_0x1b9012,_0x564fe0){return respondWithRpcPromise(_0xe032('0x46'),_0x1b9012[_0xe032('0x17')])['then'](respondWithResult(_0x564fe0,null))[_0xe032('0xd')](handleError(_0x564fe0,null));};exports['chatQueues']=function(_0x39b878,_0x1f2422){return respondWithRpcPromise(_0xe032('0x47'),_0x39b878[_0xe032('0x17')],routingClient)[_0xe032('0x8')](respondWithResult(_0x1f2422,null))['catch'](handleError(_0x1f2422,null));};exports[_0xe032('0x48')]=function(_0x2dbc33,_0x1e1277){return respondWithRpcPromise(_0xe032('0x47'),_0x2dbc33[_0xe032('0x17')],routingClient)[_0xe032('0x8')](findById(_0x2dbc33[_0xe032('0x20')]['id']))['then'](respondWithResult(_0x1e1277,null))[_0xe032('0xd')](handleError(_0x1e1277,null));};exports[_0xe032('0x49')]=function(_0x454b29,_0x15325e){return respondWithRpcPromise(_0xe032('0x4a'),_0x454b29[_0xe032('0x17')],routingClient)[_0xe032('0x8')](respondWithResult(_0x15325e,null))[_0xe032('0xd')](handleError(_0x15325e,null));};exports[_0xe032('0x4b')]=function(_0x54c0b0,_0x795a58){return respondWithRpcPromise(_0xe032('0x4a'),_0x54c0b0[_0xe032('0x17')],routingClient)['then'](findById(_0x54c0b0[_0xe032('0x20')]['id']))[_0xe032('0x8')](respondWithResult(_0x795a58,null))['catch'](handleError(_0x795a58,null));};exports[_0xe032('0x4c')]=function(_0x29dfa7,_0x43ad0d){return respondWithRpcPromise(_0xe032('0x4d'),_0x29dfa7[_0xe032('0x17')],mailClient)[_0xe032('0x8')](respondWithResult(_0x43ad0d,null))[_0xe032('0xd')](handleError(_0x43ad0d,null));};exports[_0xe032('0x4e')]=function(_0x1aa18e,_0x19ce2b){return respondWithRpcPromise(_0xe032('0x4f'),_0x1aa18e['query'],routingClient)[_0xe032('0x8')](respondWithResult(_0x19ce2b,null))[_0xe032('0xd')](handleError(_0x19ce2b,null));};exports[_0xe032('0x50')]=function(_0xd5cf55,_0x3d7a3f){return respondWithRpcPromise('OpenchannelQueues',_0xd5cf55[_0xe032('0x17')],routingClient)['then'](findById(_0xd5cf55[_0xe032('0x20')]['id']))[_0xe032('0x8')](respondWithResult(_0x3d7a3f,null))[_0xe032('0xd')](handleError(_0x3d7a3f,null));};exports[_0xe032('0x51')]=function(_0x3c5eb8,_0x1ddb11){return respondWithRpcPromise(_0xe032('0x52'),_0x3c5eb8[_0xe032('0x17')],routingClient)[_0xe032('0x8')](respondWithResult(_0x1ddb11,null))['catch'](handleError(_0x1ddb11,null));};exports['showSmsQueues']=function(_0x5c516a,_0x221473){return respondWithRpcPromise(_0xe032('0x52'),_0x5c516a[_0xe032('0x17')],routingClient)[_0xe032('0x8')](findById(_0x5c516a[_0xe032('0x20')]['id']))[_0xe032('0x8')](respondWithResult(_0x221473,null))['catch'](handleError(_0x221473,null));};exports[_0xe032('0x53')]=function(_0x1d66c3,_0x1018d4){return respondWithRpcPromise('WhatsappQueues',_0x1d66c3[_0xe032('0x17')],routingClient)['then'](respondWithResult(_0x1018d4,null))[_0xe032('0xd')](handleError(_0x1018d4,null));};exports[_0xe032('0x54')]=function(_0x48063d,_0x590905){return respondWithRpcPromise('WhatsappQueues',_0x48063d[_0xe032('0x17')],routingClient)['then'](findById(_0x48063d['params']['id']))[_0xe032('0x8')](respondWithResult(_0x590905,null))[_0xe032('0xd')](handleError(_0x590905,null));};exports[_0xe032('0x55')]=function(_0x4ed078,_0x193a0f){return respondWithRpcPromise('FaxQueues',_0x4ed078[_0xe032('0x17')],routingClient)[_0xe032('0x8')](respondWithResult(_0x193a0f,null))[_0xe032('0xd')](handleError(_0x193a0f,null));};exports[_0xe032('0x56')]=function(_0x1f24ec,_0x2b987b){return respondWithRpcPromise(_0xe032('0x57'),_0x1f24ec[_0xe032('0x17')],routingClient)[_0xe032('0x8')](findById(_0x1f24ec[_0xe032('0x20')]['id']))[_0xe032('0x8')](respondWithResult(_0x2b987b,null))['catch'](handleError(_0x2b987b,null));};exports[_0xe032('0x58')]=function(_0x338ef2,_0x5aa7a6){return respondWithRpcPromise('FaxAccounts',_0x338ef2[_0xe032('0x17')])[_0xe032('0x8')](respondWithResult(_0x5aa7a6,null))[_0xe032('0xd')](handleError(_0x5aa7a6,null));};exports[_0xe032('0x59')]=function(_0x1e38bd,_0x23922e){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x1e38bd[_0xe032('0x17')],routingClient)[_0xe032('0x8')](respondWithResult(_0x23922e,null))['catch'](handleError(_0x23922e,null));};exports[_0xe032('0x5a')]=function(_0x2ea4a5,_0x1c3601){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x2ea4a5[_0xe032('0x17')],routingClient)[_0xe032('0x8')](respondWithResult(_0x1c3601,null))[_0xe032('0xd')](handleError(_0x1c3601,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x52dfa0,_0xdd691c){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x52dfa0[_0xe032('0x17')],routingClient)[_0xe032('0x8')](respondWithResult(_0xdd691c,null))[_0xe032('0xd')](handleError(_0xdd691c,null));};exports[_0xe032('0x5b')]=function(_0x37af62,_0x443fcc){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x37af62[_0xe032('0x17')],routingClient)[_0xe032('0x8')](function(_0x33e7c3){if(_0x37af62['query'][_0xe032('0x5c')]!==undefined){var _0x48e9c9=_(_0x33e7c3[_0xe032('0x14')])['filter']([_0x37af62[_0xe032('0x17')][_0xe032('0x5c')],_0x37af62[_0xe032('0x20')]['id']])['map'](_0xe032('0x5d'))[_0xe032('0x5e')]()[_0xe032('0x5f')]();return _0x33e7c3[_0xe032('0x14')][_0xe032('0x60')](function(_0x2a2c98){return _0x48e9c9['indexOf'](_0x2a2c98[_0xe032('0x5d')])>-0x1;});}else{return _0x33e7c3[_0xe032('0x14')]['filter'](function(_0x50fd01){return _0x50fd01[_0xe032('0x5d')]===parseInt(_0x37af62[_0xe032('0x20')]['id']);});}})[_0xe032('0x8')](respondWithResult(_0x443fcc,null))[_0xe032('0xd')](handleError(_0x443fcc,null));};exports[_0xe032('0x61')]=function(_0x54803e,_0x3a04b9){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x54803e[_0xe032('0x17')],routingClient)['then'](respondWithResult(_0x3a04b9,null))[_0xe032('0xd')](handleError(_0x3a04b9,null));};exports[_0xe032('0x62')]=function(_0x36137b,_0x2ecdc7){return respondWithRpcPromise(_0xe032('0x63'),_0x36137b[_0xe032('0x17')],routingClient)['then'](respondWithResult(_0x2ecdc7,null))[_0xe032('0xd')](handleError(_0x2ecdc7,null));};exports['faxQueuesWaitingInteractions']=function(_0x4ee54a,_0x485458){return respondWithRpcPromise(_0xe032('0x64'),_0x4ee54a[_0xe032('0x17')],routingClient)['then'](respondWithResult(_0x485458,null))[_0xe032('0xd')](handleError(_0x485458,null));};exports['queueNotify']=function(_0x5f42b1){return function(_0x2f2b74,_0x10873b){var _0x577f56,_0x4ab179;var _0x45e28d=_[_0xe032('0x65')](_0x5f42b1);var _0x51d89a=_0x5f42b1===_0xe032('0x66')?_0xe032('0x67'):_0xe032('0x68');return db[_0x45e28d+_0xe032('0x69')]['findOne']({'raw':!![],'where':{'id':_0x2f2b74[_0xe032('0x20')]['id']}})['then'](function(_0x1caebf){if(_[_0xe032('0x13')](_0x1caebf)){throw new Error(_0x45e28d+_0xe032('0x6a'));}_0x577f56=_0x1caebf;return db[_0x45e28d+'Message'][_0xe032('0x6b')]({'where':{'id':_0x2f2b74[_0xe032('0x2f')]['messageId']},'include':[{'model':db[_0x45e28d+_0xe032('0x6c')],'as':_0xe032('0x6c')},{'model':db[_0x45e28d+_0x51d89a],'as':_0xe032('0x68')}]});})[_0xe032('0x8')](function(_0x3c1b08){if(_[_0xe032('0x13')](_0x3c1b08)){throw new Error(_0x45e28d+'\x20Message\x20not\x20found');}_0x4ab179=_0x3c1b08;return _0x3c1b08[_0xe032('0x6d')]({'read':0x0,'readAt':null,'UserId':null});})[_0xe032('0x8')](function(){var _0x27eb0c={'uniqueid':_0x5f42b1+'.'+_0x4ab179['id']+'.'+_0x4ab179[_0xe032('0x6c')]['id'],'FromUserId':_0x2f2b74[_0xe032('0x31')]['id'],'type':_0xe032('0x6e')};_0x27eb0c[_0x45e28d+_0xe032('0x6f')]=_0x4ab179['id'];_0x27eb0c[_0x45e28d+_0xe032('0x70')]=_0x4ab179[_0xe032('0x6c')]['id'];_0x27eb0c[_0xe032('0x71')+_0x45e28d+_0x51d89a+'Id']=_0x4ab179[_0xe032('0x68')]['id'];_0x27eb0c['To'+_0x45e28d+'QueueId']=_0x577f56['id'];return db[_0x45e28d+_0xe032('0x72')]['create'](_0x27eb0c);})[_0xe032('0x8')](function(){return respondWithRpcPromise('Start',{'channel':_0x5f42b1,'interaction':_0x4ab179[_0xe032('0x6c')],'message':_0x4ab179,'account':_0x4ab179[_0xe032('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x577f56[_0xe032('0x11')]+','+(_0x4ab179['Account']['queueTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xe032('0x8')](respondWithResult(_0x10873b,null))[_0xe032('0xd')](handleError(_0x10873b,null));};};exports[_0xe032('0x73')]=function(_0x4e9f83,_0x210e7a){var _0x2e6dad,_0x2d68aa;if(_['isNil'](_0x4e9f83[_0xe032('0x2f')]['channel'])){throw new Error(_0xe032('0x74'));}var _0x868fad=_0x4e9f83[_0xe032('0x2f')][_0xe032('0x75')];var _0x3ee725=_[_0xe032('0x65')](_0x868fad);var _0x205058=_0x868fad===_0xe032('0x66')?_0xe032('0x67'):_0xe032('0x68');return db['User']['findOne']({'raw':!![],'where':{'id':_0x4e9f83[_0xe032('0x20')]['id'],'role':_0xe032('0x3d')}})[_0xe032('0x8')](function(_0x1d9498){if(_['isNil'](_0x1d9498)){throw new Error(_0xe032('0x76'));}_0x2e6dad=_0x1d9498;return db[_0x3ee725+_0xe032('0x77')][_0xe032('0x6b')]({'where':{'id':_0x4e9f83[_0xe032('0x2f')]['messageId']},'include':[{'model':db[_0x3ee725+_0xe032('0x6c')],'as':_0xe032('0x6c')},{'model':db[_0x3ee725+_0x205058],'as':_0xe032('0x68')}]});})[_0xe032('0x8')](function(_0x3cf0bc){if(_[_0xe032('0x13')](_0x3cf0bc)){throw new Error(_0x3ee725+_0xe032('0x78'));}_0x2d68aa=_0x3cf0bc;return _0x3cf0bc['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x56523f={'uniqueid':_0x868fad+'.'+_0x2d68aa['id']+'.'+_0x2d68aa['Interaction']['id'],'FromUserId':_0x4e9f83['user']['id'],'type':_0xe032('0x6e'),'ToUserId':_0x2e6dad['id']};_0x56523f[_0x3ee725+_0xe032('0x6f')]=_0x2d68aa['id'];_0x56523f[_0x3ee725+_0xe032('0x70')]=_0x2d68aa[_0xe032('0x6c')]['id'];_0x56523f[_0xe032('0x71')+_0x3ee725+_0x205058+'Id']=_0x2d68aa['Account']['id'];return db[_0x3ee725+_0xe032('0x72')][_0xe032('0x79')](_0x56523f);})[_0xe032('0x8')](function(){return respondWithRpcPromise(_0xe032('0x7a'),{'channel':_0x868fad,'interaction':_0x2d68aa[_0xe032('0x6c')],'message':_0x2d68aa,'account':_0x2d68aa[_0xe032('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0xe032('0x3d'),'appdata':_0x2e6dad[_0xe032('0x11')]+','+(_0x2d68aa[_0xe032('0x68')]['agentTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x210e7a,null))[_0xe032('0xd')](handleError(_0x210e7a,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 68fb1f7..60ef15d 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 _0x9b64=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/run','run','post','create','put','/:id','update','destroy','exports','multer','util'];(function(_0x13ae15,_0x88182e){var _0x4b3cc9=function(_0x3be123){while(--_0x3be123){_0x13ae15['push'](_0x13ae15['shift']());}};_0x4b3cc9(++_0x88182e);}(_0x9b64,0x1b6));var _0x49b6=function(_0x44511e,_0x2242ba){_0x44511e=_0x44511e-0x0;var _0x243798=_0x9b64[_0x44511e];return _0x243798;};'use strict';var multer=require(_0x49b6('0x0'));var util=require(_0x49b6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x49b6('0x2'));var router=express[_0x49b6('0x3')]();var fs_extra=require(_0x49b6('0x4'));var auth=require(_0x49b6('0x5'));var interaction=require(_0x49b6('0x6'));var config=require(_0x49b6('0x7'));var controller=require('./schedule.controller');router[_0x49b6('0x8')]('/',auth[_0x49b6('0x9')](),controller['index']);router[_0x49b6('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x49b6('0xa')]);router[_0x49b6('0x8')](_0x49b6('0xb'),auth[_0x49b6('0x9')](),controller[_0x49b6('0xc')]);router[_0x49b6('0xd')]('/',auth[_0x49b6('0x9')](),controller[_0x49b6('0xe')]);router[_0x49b6('0xf')](_0x49b6('0x10'),auth[_0x49b6('0x9')](),controller[_0x49b6('0x11')]);router['delete']('/:id',auth[_0x49b6('0x9')](),controller[_0x49b6('0x12')]);module[_0x49b6('0x13')]=router; \ No newline at end of file +var _0x9be9=['../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','/:id','show','run','post','put','update','util','path','express','Router','fs-extra'];(function(_0x1a1dd7,_0x9e586a){var _0x5e5ac6=function(_0x6b7c37){while(--_0x6b7c37){_0x1a1dd7['push'](_0x1a1dd7['shift']());}};_0x5e5ac6(++_0x9e586a);}(_0x9be9,0x1e8));var _0x99be=function(_0x367c4b,_0x8120e2){_0x367c4b=_0x367c4b-0x0;var _0x240198=_0x9be9[_0x367c4b];return _0x240198;};'use strict';var multer=require('multer');var util=require(_0x99be('0x0'));var path=require(_0x99be('0x1'));var timeout=require('connect-timeout');var express=require(_0x99be('0x2'));var router=express[_0x99be('0x3')]();var fs_extra=require(_0x99be('0x4'));var auth=require(_0x99be('0x5'));var interaction=require(_0x99be('0x6'));var config=require(_0x99be('0x7'));var controller=require(_0x99be('0x8'));router[_0x99be('0x9')]('/',auth[_0x99be('0xa')](),controller['index']);router[_0x99be('0x9')](_0x99be('0xb'),auth[_0x99be('0xa')](),controller[_0x99be('0xc')]);router[_0x99be('0x9')]('/:id/run',auth[_0x99be('0xa')](),controller[_0x99be('0xd')]);router[_0x99be('0xe')]('/',auth[_0x99be('0xa')](),controller['create']);router[_0x99be('0xf')](_0x99be('0xb'),auth[_0x99be('0xa')](),controller[_0x99be('0x10')]);router['delete'](_0x99be('0xb'),auth[_0x99be('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index a74c0c3..3fc3999 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 _0x6039=['TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','ENUM','years','quarters','months','weeks','days','minutes','csv','custom','default'];(function(_0x51fc35,_0x394adf){var _0x154f7e=function(_0x34fec3){while(--_0x34fec3){_0x51fc35['push'](_0x51fc35['shift']());}};_0x154f7e(++_0x394adf);}(_0x6039,0x133));var _0x9603=function(_0x2ba669,_0x374d0c){_0x2ba669=_0x2ba669-0x0;var _0x3616cd=_0x6039[_0x2ba669];return _0x3616cd;};'use strict';var Sequelize=require(_0x9603('0x0'));module[_0x9603('0x1')]={'name':{'type':Sequelize[_0x9603('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x9603('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x9603('0x2')],'allowNull':![],'defaultValue':_0x9603('0x4')},'startAt':{'type':Sequelize[_0x9603('0x5')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x9603('0x6')](_0x9603('0x7'),_0x9603('0x8'),_0x9603('0x9'),_0x9603('0xa'),_0x9603('0xb'),'hours',_0x9603('0xc')),'allowNull':![],'defaultValue':_0x9603('0xb')},'output':{'type':Sequelize[_0x9603('0x6')]('csv','pdf','xlsx'),'allowNull':![],'defaultValue':_0x9603('0xd')},'type':{'type':Sequelize[_0x9603('0x6')](_0x9603('0xe'),_0x9603('0xf')),'allowNull':![],'defaultValue':_0x9603('0xe')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x9603('0x2')]},'cc':{'type':Sequelize[_0x9603('0x10')]},'bcc':{'type':Sequelize[_0x9603('0x10')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xc26a=['pdf','custom','TEXT','sequelize','exports','STRING','BOOLEAN','DATE','ENUM','days','minutes'];(function(_0x2b9ee9,_0x973945){var _0x44867a=function(_0x1e6abf){while(--_0x1e6abf){_0x2b9ee9['push'](_0x2b9ee9['shift']());}};_0x44867a(++_0x973945);}(_0xc26a,0x179));var _0xac26=function(_0x4f3522,_0x3e9fb){_0x4f3522=_0x4f3522-0x0;var _0x5b4de7=_0xc26a[_0x4f3522];return _0x5b4de7;};'use strict';var Sequelize=require(_0xac26('0x0'));module[_0xac26('0x1')]={'name':{'type':Sequelize[_0xac26('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xac26('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xac26('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0xac26('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0xac26('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xac26('0x5')]('years','quarters','months','weeks',_0xac26('0x6'),'hours',_0xac26('0x7')),'allowNull':![],'defaultValue':_0xac26('0x6')},'output':{'type':Sequelize[_0xac26('0x5')]('csv',_0xac26('0x8'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0xac26('0x5')](_0xac26('0x9'),'default'),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0xac26('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xac26('0x2')]},'cc':{'type':Sequelize[_0xac26('0xa')]},'bcc':{'type':Sequelize[_0xac26('0xa')]},'sendIfEmpty':{'type':Sequelize[_0xac26('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index dde0309..14c87c1 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 _0xae6b=['end','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','options','Schedule','includeAll','findAll','rows','catch','show','params','keys','include','merge','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','run','../../config/schedule','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xae6b,0x98));var _0xbae6=function(_0x215c73,_0x272244){_0x215c73=_0x215c73-0x0;var _0x3287b2=_0xae6b[_0x215c73];return _0x3287b2;};'use strict';var emlformat=require(_0xbae6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbae6('0x1'));var rp=require(_0xbae6('0x2'));var moment=require(_0xbae6('0x3'));var BPromise=require(_0xbae6('0x4'));var Mustache=require(_0xbae6('0x5'));var util=require(_0xbae6('0x6'));var path=require(_0xbae6('0x7'));var sox=require(_0xbae6('0x8'));var csv=require('to-csv');var ejs=require(_0xbae6('0x9'));var fs=require('fs');var fs_extra=require(_0xbae6('0xa'));var _=require('lodash');var squel=require(_0xbae6('0xb'));var crypto=require(_0xbae6('0xc'));var jsforce=require(_0xbae6('0xd'));var deskjs=require(_0xbae6('0xe'));var toCsv=require(_0xbae6('0xf'));var querystring=require(_0xbae6('0x10'));var Papa=require(_0xbae6('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbae6('0x12'));var as=require(_0xbae6('0x13'));var hardwareService=require(_0xbae6('0x14'));var logger=require(_0xbae6('0x15'))(_0xbae6('0x16'));var utils=require('../../config/utils');var config=require(_0xbae6('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xbae6('0x18'))['db'];function respondWithStatusCode(_0x190199,_0x5ee2f9){_0x5ee2f9=_0x5ee2f9||0xcc;return function(_0xa72c5b){if(_0xa72c5b){return _0x190199['sendStatus'](_0x5ee2f9);}return _0x190199[_0xbae6('0x19')](_0x5ee2f9)[_0xbae6('0x1a')]();};}function respondWithResult(_0x2f6962,_0x4f3d4c){_0x4f3d4c=_0x4f3d4c||0xc8;return function(_0x23b273){if(_0x23b273){return _0x2f6962[_0xbae6('0x19')](_0x4f3d4c)['json'](_0x23b273);}};}function respondWithFilteredResult(_0x15bd9f,_0x2abb6c){return function(_0xc74a0b){if(_0xc74a0b){var _0x4b2730=typeof _0x2abb6c[_0xbae6('0x1b')]==='undefined'&&typeof _0x2abb6c[_0xbae6('0x1c')]===_0xbae6('0x1d');var _0x4badc4=_0xc74a0b[_0xbae6('0x1e')];var _0x52ae12=_0x4b2730?0x0:_0x2abb6c[_0xbae6('0x1b')];var _0x4fed5b=_0x4b2730?_0xc74a0b['count']:_0x2abb6c[_0xbae6('0x1b')]+_0x2abb6c['limit'];var _0x499d4b;if(_0x4fed5b>=_0x4badc4){_0x4fed5b=_0x4badc4;_0x499d4b=0xc8;}else{_0x499d4b=0xce;}_0x15bd9f[_0xbae6('0x19')](_0x499d4b);return _0x15bd9f[_0xbae6('0x1f')]('Content-Range',_0x52ae12+'-'+_0x4fed5b+'/'+_0x4badc4)['json'](_0xc74a0b);}return null;};}function patchUpdates(_0x34c995){return function(_0x45f2d6){try{jsonpatch[_0xbae6('0x20')](_0x45f2d6,_0x34c995,!![]);}catch(_0x3968d0){return BPromise[_0xbae6('0x21')](_0x3968d0);}return _0x45f2d6[_0xbae6('0x22')]();};}function saveUpdates(_0x2eb854,_0x3342c8){return function(_0x466cf8){if(_0x466cf8){return _0x466cf8[_0xbae6('0x23')](_0x2eb854)[_0xbae6('0x24')](function(_0x95c0ce){return _0x95c0ce;});}return null;};}function removeEntity(_0x9a17d,_0x1980a4){return function(_0x53f18f){if(_0x53f18f){return _0x53f18f[_0xbae6('0x25')]()['then'](function(){var _0x4e732e=_0x53f18f[_0xbae6('0x26')]({'plain':!![]});var _0x32afc4=_0xbae6('0x27');return db[_0xbae6('0x28')]['destroy']({'where':{'type':_0x32afc4,'resourceId':_0x4e732e['id']}})['then'](function(){return _0x53f18f;});})['then'](function(){_0x9a17d[_0xbae6('0x19')](0xcc)[_0xbae6('0x1a')]();});}};}function handleEntityNotFound(_0x27fc48,_0x163c80){return function(_0x163530){if(!_0x163530){_0x27fc48[_0xbae6('0x29')](0x194);}return _0x163530;};}function handleError(_0x451d85,_0x30a301){_0x30a301=_0x30a301||0x1f4;return function(_0x2fdac4){logger[_0xbae6('0x2a')](_0x2fdac4[_0xbae6('0x2b')]);if(_0x2fdac4[_0xbae6('0x2c')]){delete _0x2fdac4[_0xbae6('0x2c')];}_0x451d85['status'](_0x30a301)[_0xbae6('0x2d')](_0x2fdac4);};}exports[_0xbae6('0x2e')]=function(_0x2752ee,_0x164937){var _0x5b619d={},_0x805bae={},_0x9c12b9={'count':0x0,'rows':[]};var _0x12e3f2=_[_0xbae6('0x2f')](db['Schedule'][_0xbae6('0x30')],function(_0x3cd6bc){return{'name':_0x3cd6bc[_0xbae6('0x31')],'type':_0x3cd6bc[_0xbae6('0x32')][_0xbae6('0x33')]};});_0x805bae[_0xbae6('0x34')]=_[_0xbae6('0x2f')](_0x12e3f2,'name');_0x805bae[_0xbae6('0x35')]=_['keys'](_0x2752ee[_0xbae6('0x35')]);_0x805bae['filters']=_[_0xbae6('0x36')](_0x805bae[_0xbae6('0x34')],_0x805bae[_0xbae6('0x35')]);_0x5b619d[_0xbae6('0x37')]=_[_0xbae6('0x36')](_0x805bae[_0xbae6('0x34')],qs[_0xbae6('0x38')](_0x2752ee[_0xbae6('0x35')][_0xbae6('0x38')]));_0x5b619d[_0xbae6('0x37')]=_0x5b619d[_0xbae6('0x37')][_0xbae6('0x39')]?_0x5b619d[_0xbae6('0x37')]:_0x805bae[_0xbae6('0x34')];if(!_0x2752ee[_0xbae6('0x35')][_0xbae6('0x3a')](_0xbae6('0x3b'))){_0x5b619d[_0xbae6('0x1c')]=qs[_0xbae6('0x1c')](_0x2752ee[_0xbae6('0x35')][_0xbae6('0x1c')]);_0x5b619d['offset']=qs[_0xbae6('0x1b')](_0x2752ee[_0xbae6('0x35')][_0xbae6('0x1b')]);}_0x5b619d[_0xbae6('0x3c')]=qs['sort'](_0x2752ee[_0xbae6('0x35')][_0xbae6('0x3d')]);_0x5b619d[_0xbae6('0x3e')]=qs['filters'](_[_0xbae6('0x3f')](_0x2752ee[_0xbae6('0x35')],_0x805bae[_0xbae6('0x40')]),_0x12e3f2);if(_0x2752ee[_0xbae6('0x35')][_0xbae6('0x41')]){_0x5b619d[_0xbae6('0x3e')]=_['merge'](_0x5b619d[_0xbae6('0x3e')],{'$or':_[_0xbae6('0x2f')](_0x12e3f2,function(_0x5e4ea9){if(_0x5e4ea9[_0xbae6('0x32')]!==_0xbae6('0x42')){var _0x515685={};_0x515685[_0x5e4ea9[_0xbae6('0x2c')]]={'$like':'%'+_0x2752ee['query'][_0xbae6('0x41')]+'%'};return _0x515685;}})});}_0x5b619d=_['merge']({},_0x5b619d,_0x2752ee[_0xbae6('0x43')]);var _0x2dae43={'where':_0x5b619d[_0xbae6('0x3e')]};return db[_0xbae6('0x44')][_0xbae6('0x1e')](_0x2dae43)[_0xbae6('0x24')](function(_0x402abf){_0x9c12b9[_0xbae6('0x1e')]=_0x402abf;if(_0x2752ee['query'][_0xbae6('0x45')]){_0x5b619d['include']=[{'all':!![]}];}return db['Schedule'][_0xbae6('0x46')](_0x5b619d);})[_0xbae6('0x24')](function(_0x96f08b){_0x9c12b9[_0xbae6('0x47')]=_0x96f08b;return _0x9c12b9;})['then'](respondWithFilteredResult(_0x164937,_0x5b619d))[_0xbae6('0x48')](handleError(_0x164937,null));};exports[_0xbae6('0x49')]=function(_0x4c484c,_0x51e39c){var _0x319f00={'raw':![],'where':{'id':_0x4c484c[_0xbae6('0x4a')]['id']}},_0x5de818={};_0x5de818[_0xbae6('0x34')]=_[_0xbae6('0x4b')](db['Schedule'][_0xbae6('0x30')]);_0x5de818['query']=_[_0xbae6('0x4b')](_0x4c484c[_0xbae6('0x35')]);_0x5de818[_0xbae6('0x40')]=_[_0xbae6('0x36')](_0x5de818[_0xbae6('0x34')],_0x5de818[_0xbae6('0x35')]);_0x319f00['attributes']=_[_0xbae6('0x36')](_0x5de818['model'],qs[_0xbae6('0x38')](_0x4c484c[_0xbae6('0x35')][_0xbae6('0x38')]));_0x319f00[_0xbae6('0x37')]=_0x319f00[_0xbae6('0x37')][_0xbae6('0x39')]?_0x319f00[_0xbae6('0x37')]:_0x5de818[_0xbae6('0x34')];if(_0x4c484c[_0xbae6('0x35')]['includeAll']){_0x319f00[_0xbae6('0x4c')]=[{'all':!![]}];}_0x319f00=_[_0xbae6('0x4d')]({},_0x319f00,_0x4c484c[_0xbae6('0x43')]);return db[_0xbae6('0x44')]['find'](_0x319f00)[_0xbae6('0x24')](handleEntityNotFound(_0x51e39c,null))[_0xbae6('0x24')](respondWithResult(_0x51e39c,null))[_0xbae6('0x48')](handleError(_0x51e39c,null));};exports['create']=function(_0x582d13,_0x5b2163){return db[_0xbae6('0x44')]['create'](_0x582d13[_0xbae6('0x4e')],{})[_0xbae6('0x24')](function(_0x7baf48){var _0xc0db02=_0x582d13[_0xbae6('0x4f')][_0xbae6('0x26')]({'plain':!![]});if(!_0xc0db02)throw new Error(_0xbae6('0x50'));if(_0xc0db02[_0xbae6('0x51')]===_0xbae6('0x4f')){var _0x1263a6=_0x7baf48[_0xbae6('0x26')]({'plain':!![]});var _0x4b9801=_0xbae6('0x27');return db['UserProfileSection']['find']({'where':{'name':_0x4b9801,'userProfileId':_0xc0db02[_0xbae6('0x52')]},'raw':!![]})[_0xbae6('0x24')](function(_0x2ed716){if(_0x2ed716&&_0x2ed716[_0xbae6('0x53')]===0x0){return db['UserProfileResource'][_0xbae6('0x54')]({'name':_0x1263a6[_0xbae6('0x2c')],'resourceId':_0x1263a6['id'],'type':_0x2ed716[_0xbae6('0x2c')],'sectionId':_0x2ed716['id']},{})['then'](function(){return _0x7baf48;});}else{return _0x7baf48;}})[_0xbae6('0x48')](function(_0x5e8514){logger[_0xbae6('0x2a')](_0xbae6('0x55'),_0x5e8514);throw _0x5e8514;});}return _0x7baf48;})[_0xbae6('0x24')](respondWithResult(_0x5b2163,0xc9))['catch'](handleError(_0x5b2163,null));};exports[_0xbae6('0x23')]=function(_0x304b9a,_0x17432a){if(_0x304b9a[_0xbae6('0x4e')]['id']){delete _0x304b9a[_0xbae6('0x4e')]['id'];}return db[_0xbae6('0x44')]['find']({'where':{'id':_0x304b9a['params']['id']}})['then'](handleEntityNotFound(_0x17432a,null))[_0xbae6('0x24')](saveUpdates(_0x304b9a[_0xbae6('0x4e')],null))[_0xbae6('0x24')](respondWithResult(_0x17432a,null))[_0xbae6('0x48')](handleError(_0x17432a,null));};exports['destroy']=function(_0x5b6267,_0x5d772a){return db[_0xbae6('0x44')][_0xbae6('0x56')]({'where':{'id':_0x5b6267[_0xbae6('0x4a')]['id']}})[_0xbae6('0x24')](handleEntityNotFound(_0x5d772a,null))[_0xbae6('0x24')](removeEntity(_0x5d772a,null))['catch'](handleError(_0x5d772a,null));};exports[_0xbae6('0x57')]=function(_0x3bdbab,_0x3e3823,_0x2d0bba){var _0x3eb47d=require(_0xbae6('0x58'));return db['Schedule'][_0xbae6('0x56')]({'where':{'id':_0x3bdbab[_0xbae6('0x4a')]['id']},'raw':!![]})[_0xbae6('0x24')](handleEntityNotFound(_0x3e3823,null))[_0xbae6('0x24')](function(){_0x3eb47d['run'](_0x3bdbab[_0xbae6('0x4a')]['id']);})[_0xbae6('0x24')](respondWithStatusCode(_0x3e3823,null))[_0xbae6('0x48')](handleError(_0x3e3823,null));}; \ No newline at end of file +var _0x5220=['Schedule','rawAttributes','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','../../config/schedule','run','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','get','Scheduler','UserProfileResource','error','stack','name','send','map'];(function(_0x54e6f5,_0x4f4e99){var _0x5e8794=function(_0x27512b){while(--_0x27512b){_0x54e6f5['push'](_0x54e6f5['shift']());}};_0x5e8794(++_0x4f4e99);}(_0x5220,0x79));var _0x0522=function(_0x1c2a65,_0x4450f2){_0x1c2a65=_0x1c2a65-0x0;var _0x9b7e31=_0x5220[_0x1c2a65];return _0x9b7e31;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0522('0x0'));var jsonpatch=require(_0x0522('0x1'));var rp=require('request-promise');var moment=require(_0x0522('0x2'));var BPromise=require(_0x0522('0x3'));var Mustache=require(_0x0522('0x4'));var util=require('util');var path=require(_0x0522('0x5'));var sox=require(_0x0522('0x6'));var csv=require(_0x0522('0x7'));var ejs=require(_0x0522('0x8'));var fs=require('fs');var fs_extra=require(_0x0522('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0522('0xa'));var deskjs=require(_0x0522('0xb'));var toCsv=require('to-csv');var querystring=require(_0x0522('0xc'));var Papa=require(_0x0522('0xd'));var Redis=require(_0x0522('0xe'));var authService=require(_0x0522('0xf'));var qs=require(_0x0522('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0522('0x11'));var logger=require(_0x0522('0x12'))(_0x0522('0x13'));var utils=require('../../config/utils');var config=require(_0x0522('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14f0f9,_0x21dfa2){_0x21dfa2=_0x21dfa2||0xcc;return function(_0xe0b69){if(_0xe0b69){return _0x14f0f9[_0x0522('0x15')](_0x21dfa2);}return _0x14f0f9[_0x0522('0x16')](_0x21dfa2)[_0x0522('0x17')]();};}function respondWithResult(_0x13990e,_0x1da1d8){_0x1da1d8=_0x1da1d8||0xc8;return function(_0x549176){if(_0x549176){return _0x13990e[_0x0522('0x16')](_0x1da1d8)[_0x0522('0x18')](_0x549176);}};}function respondWithFilteredResult(_0x2edc3d,_0x135a48){return function(_0x13e50d){if(_0x13e50d){var _0x52a864=typeof _0x135a48['offset']===_0x0522('0x19')&&typeof _0x135a48[_0x0522('0x1a')]===_0x0522('0x19');var _0x2697d8=_0x13e50d[_0x0522('0x1b')];var _0x25d868=_0x52a864?0x0:_0x135a48['offset'];var _0x55b495=_0x52a864?_0x13e50d[_0x0522('0x1b')]:_0x135a48[_0x0522('0x1c')]+_0x135a48[_0x0522('0x1a')];var _0x26a507;if(_0x55b495>=_0x2697d8){_0x55b495=_0x2697d8;_0x26a507=0xc8;}else{_0x26a507=0xce;}_0x2edc3d['status'](_0x26a507);return _0x2edc3d[_0x0522('0x1d')](_0x0522('0x1e'),_0x25d868+'-'+_0x55b495+'/'+_0x2697d8)['json'](_0x13e50d);}return null;};}function patchUpdates(_0x2d1403){return function(_0x2ace33){try{jsonpatch[_0x0522('0x1f')](_0x2ace33,_0x2d1403,!![]);}catch(_0x4a1596){return BPromise['reject'](_0x4a1596);}return _0x2ace33[_0x0522('0x20')]();};}function saveUpdates(_0x8c035d,_0x88276){return function(_0x9d9b73){if(_0x9d9b73){return _0x9d9b73['update'](_0x8c035d)[_0x0522('0x21')](function(_0x3d2e19){return _0x3d2e19;});}return null;};}function removeEntity(_0x9470d2,_0x1e9839){return function(_0x18c25e){if(_0x18c25e){return _0x18c25e[_0x0522('0x22')]()['then'](function(){var _0x45ba45=_0x18c25e[_0x0522('0x23')]({'plain':!![]});var _0x4c0c8e=_0x0522('0x24');return db[_0x0522('0x25')][_0x0522('0x22')]({'where':{'type':_0x4c0c8e,'resourceId':_0x45ba45['id']}})['then'](function(){return _0x18c25e;});})[_0x0522('0x21')](function(){_0x9470d2['status'](0xcc)[_0x0522('0x17')]();});}};}function handleEntityNotFound(_0x193771,_0x2b7372){return function(_0x9dcf3c){if(!_0x9dcf3c){_0x193771['sendStatus'](0x194);}return _0x9dcf3c;};}function handleError(_0x126c75,_0x402aef){_0x402aef=_0x402aef||0x1f4;return function(_0x3b8a4e){logger[_0x0522('0x26')](_0x3b8a4e[_0x0522('0x27')]);if(_0x3b8a4e[_0x0522('0x28')]){delete _0x3b8a4e[_0x0522('0x28')];}_0x126c75[_0x0522('0x16')](_0x402aef)[_0x0522('0x29')](_0x3b8a4e);};}exports['index']=function(_0x124c7b,_0x1f01bf){var _0x337294={},_0x5b1e42={},_0x5b8cf3={'count':0x0,'rows':[]};var _0x67b2cf=_[_0x0522('0x2a')](db[_0x0522('0x2b')][_0x0522('0x2c')],function(_0x17aefc){return{'name':_0x17aefc['fieldName'],'type':_0x17aefc[_0x0522('0x2d')]['key']};});_0x5b1e42['model']=_[_0x0522('0x2a')](_0x67b2cf,_0x0522('0x28'));_0x5b1e42[_0x0522('0x2e')]=_[_0x0522('0x2f')](_0x124c7b[_0x0522('0x2e')]);_0x5b1e42[_0x0522('0x30')]=_[_0x0522('0x31')](_0x5b1e42['model'],_0x5b1e42[_0x0522('0x2e')]);_0x337294['attributes']=_[_0x0522('0x31')](_0x5b1e42[_0x0522('0x32')],qs[_0x0522('0x33')](_0x124c7b[_0x0522('0x2e')]['fields']));_0x337294[_0x0522('0x34')]=_0x337294['attributes'][_0x0522('0x35')]?_0x337294[_0x0522('0x34')]:_0x5b1e42[_0x0522('0x32')];if(!_0x124c7b[_0x0522('0x2e')][_0x0522('0x36')]('nolimit')){_0x337294[_0x0522('0x1a')]=qs[_0x0522('0x1a')](_0x124c7b[_0x0522('0x2e')][_0x0522('0x1a')]);_0x337294[_0x0522('0x1c')]=qs['offset'](_0x124c7b[_0x0522('0x2e')][_0x0522('0x1c')]);}_0x337294[_0x0522('0x37')]=qs[_0x0522('0x38')](_0x124c7b[_0x0522('0x2e')][_0x0522('0x38')]);_0x337294[_0x0522('0x39')]=qs[_0x0522('0x30')](_[_0x0522('0x3a')](_0x124c7b[_0x0522('0x2e')],_0x5b1e42[_0x0522('0x30')]),_0x67b2cf);if(_0x124c7b[_0x0522('0x2e')][_0x0522('0x3b')]){_0x337294[_0x0522('0x39')]=_[_0x0522('0x3c')](_0x337294[_0x0522('0x39')],{'$or':_[_0x0522('0x2a')](_0x67b2cf,function(_0x685cdd){if(_0x685cdd[_0x0522('0x2d')]!==_0x0522('0x3d')){var _0x3580c6={};_0x3580c6[_0x685cdd[_0x0522('0x28')]]={'$like':'%'+_0x124c7b[_0x0522('0x2e')][_0x0522('0x3b')]+'%'};return _0x3580c6;}})});}_0x337294=_['merge']({},_0x337294,_0x124c7b['options']);var _0x1f6691={'where':_0x337294[_0x0522('0x39')]};return db[_0x0522('0x2b')]['count'](_0x1f6691)[_0x0522('0x21')](function(_0x3ed955){_0x5b8cf3[_0x0522('0x1b')]=_0x3ed955;if(_0x124c7b['query'][_0x0522('0x3e')]){_0x337294['include']=[{'all':!![]}];}return db[_0x0522('0x2b')][_0x0522('0x3f')](_0x337294);})['then'](function(_0x27965f){_0x5b8cf3[_0x0522('0x40')]=_0x27965f;return _0x5b8cf3;})['then'](respondWithFilteredResult(_0x1f01bf,_0x337294))[_0x0522('0x41')](handleError(_0x1f01bf,null));};exports[_0x0522('0x42')]=function(_0x27775d,_0x15d98a){var _0x2a6435={'raw':![],'where':{'id':_0x27775d[_0x0522('0x43')]['id']}},_0x13e708={};_0x13e708[_0x0522('0x32')]=_['keys'](db[_0x0522('0x2b')][_0x0522('0x2c')]);_0x13e708[_0x0522('0x2e')]=_[_0x0522('0x2f')](_0x27775d['query']);_0x13e708[_0x0522('0x30')]=_[_0x0522('0x31')](_0x13e708[_0x0522('0x32')],_0x13e708[_0x0522('0x2e')]);_0x2a6435['attributes']=_[_0x0522('0x31')](_0x13e708[_0x0522('0x32')],qs[_0x0522('0x33')](_0x27775d[_0x0522('0x2e')][_0x0522('0x33')]));_0x2a6435[_0x0522('0x34')]=_0x2a6435[_0x0522('0x34')][_0x0522('0x35')]?_0x2a6435[_0x0522('0x34')]:_0x13e708[_0x0522('0x32')];if(_0x27775d[_0x0522('0x2e')]['includeAll']){_0x2a6435[_0x0522('0x44')]=[{'all':!![]}];}_0x2a6435=_[_0x0522('0x3c')]({},_0x2a6435,_0x27775d[_0x0522('0x45')]);return db[_0x0522('0x2b')][_0x0522('0x46')](_0x2a6435)[_0x0522('0x21')](handleEntityNotFound(_0x15d98a,null))[_0x0522('0x21')](respondWithResult(_0x15d98a,null))['catch'](handleError(_0x15d98a,null));};exports[_0x0522('0x47')]=function(_0x3c4a3b,_0x447107){return db[_0x0522('0x2b')][_0x0522('0x47')](_0x3c4a3b['body'],{})['then'](function(_0x2ee4d1){var _0x4c3cf2=_0x3c4a3b['user'][_0x0522('0x23')]({'plain':!![]});if(!_0x4c3cf2)throw new Error(_0x0522('0x48'));if(_0x4c3cf2[_0x0522('0x49')]===_0x0522('0x4a')){var _0x362c11=_0x2ee4d1[_0x0522('0x23')]({'plain':!![]});var _0x29c781=_0x0522('0x24');return db[_0x0522('0x4b')]['find']({'where':{'name':_0x29c781,'userProfileId':_0x4c3cf2[_0x0522('0x4c')]},'raw':!![]})[_0x0522('0x21')](function(_0xed3f45){if(_0xed3f45&&_0xed3f45['autoAssociation']===0x0){return db[_0x0522('0x25')][_0x0522('0x47')]({'name':_0x362c11['name'],'resourceId':_0x362c11['id'],'type':_0xed3f45[_0x0522('0x28')],'sectionId':_0xed3f45['id']},{})['then'](function(){return _0x2ee4d1;});}else{return _0x2ee4d1;}})['catch'](function(_0x8f4097){logger[_0x0522('0x26')](_0x0522('0x4d'),_0x8f4097);throw _0x8f4097;});}return _0x2ee4d1;})[_0x0522('0x21')](respondWithResult(_0x447107,0xc9))[_0x0522('0x41')](handleError(_0x447107,null));};exports[_0x0522('0x4e')]=function(_0x700fad,_0x3a7eb9){if(_0x700fad[_0x0522('0x4f')]['id']){delete _0x700fad[_0x0522('0x4f')]['id'];}return db['Schedule'][_0x0522('0x46')]({'where':{'id':_0x700fad[_0x0522('0x43')]['id']}})[_0x0522('0x21')](handleEntityNotFound(_0x3a7eb9,null))[_0x0522('0x21')](saveUpdates(_0x700fad['body'],null))[_0x0522('0x21')](respondWithResult(_0x3a7eb9,null))[_0x0522('0x41')](handleError(_0x3a7eb9,null));};exports[_0x0522('0x22')]=function(_0x5cb236,_0x1beefd){return db['Schedule'][_0x0522('0x46')]({'where':{'id':_0x5cb236[_0x0522('0x43')]['id']}})[_0x0522('0x21')](handleEntityNotFound(_0x1beefd,null))[_0x0522('0x21')](removeEntity(_0x1beefd,null))[_0x0522('0x41')](handleError(_0x1beefd,null));};exports['run']=function(_0x14e890,_0x4a36b8,_0x3c294f){var _0x32392a=require(_0x0522('0x50'));return db['Schedule'][_0x0522('0x46')]({'where':{'id':_0x14e890[_0x0522('0x43')]['id']},'raw':!![]})[_0x0522('0x21')](handleEntityNotFound(_0x4a36b8,null))[_0x0522('0x21')](function(){_0x32392a[_0x0522('0x51')](_0x14e890['params']['id']);})[_0x0522('0x21')](respondWithStatusCode(_0x4a36b8,null))[_0x0522('0x41')](handleError(_0x4a36b8,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 8e2f692..5b9a147 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 _0x8c10=['bluebird','rimraf','./schedule.attributes','define','Schedule','tools_schedules','lodash','util','../../config/logger','api'];(function(_0x59d963,_0x497aac){var _0x3b0a74=function(_0xd04d77){while(--_0xd04d77){_0x59d963['push'](_0x59d963['shift']());}};_0x3b0a74(++_0x497aac);}(_0x8c10,0x16e));var _0x08c1=function(_0x17b777,_0xa0ce1b){_0x17b777=_0x17b777-0x0;var _0x1e10ee=_0x8c10[_0x17b777];return _0x1e10ee;};'use strict';var _=require(_0x08c1('0x0'));var util=require(_0x08c1('0x1'));var logger=require(_0x08c1('0x2'))(_0x08c1('0x3'));var moment=require('moment');var BPromise=require(_0x08c1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x08c1('0x5'));var config=require('../../config/environment');var attributes=require(_0x08c1('0x6'));module['exports']=function(_0x59db91,_0x7129d6){return _0x59db91[_0x08c1('0x7')](_0x08c1('0x8'),attributes,{'tableName':_0x08c1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x28dc=['util','bluebird','request-promise','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules'];(function(_0x426b63,_0x3b4c07){var _0x1adcc0=function(_0x638c80){while(--_0x638c80){_0x426b63['push'](_0x426b63['shift']());}};_0x1adcc0(++_0x3b4c07);}(_0x28dc,0x136));var _0xc28d=function(_0x1c289a,_0x277fe7){_0x1c289a=_0x1c289a-0x0;var _0x28d68e=_0x28dc[_0x1c289a];return _0x28d68e;};'use strict';var _=require('lodash');var util=require(_0xc28d('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xc28d('0x1'));var rp=require(_0xc28d('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc28d('0x3'));var config=require(_0xc28d('0x4'));var attributes=require(_0xc28d('0x5'));module[_0xc28d('0x6')]=function(_0xd05f0d,_0xce067d){return _0xd05f0d[_0xc28d('0x7')](_0xc28d('0x8'),attributes,{'tableName':_0xc28d('0x9'),'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 d5d90cf..1925858 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 _0x6d4f=['code','Schedule,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise','request','info','request\x20sent','debug','stringify','error'];(function(_0x3dcec2,_0x45caac){var _0x416c34=function(_0x18532d){while(--_0x18532d){_0x3dcec2['push'](_0x3dcec2['shift']());}};_0x416c34(++_0x45caac);}(_0x6d4f,0x149));var _0xf6d4=function(_0x41f0fb,_0x155b08){_0x41f0fb=_0x41f0fb-0x0;var _0x494a7f=_0x6d4f[_0x41f0fb];return _0x494a7f;};'use strict';var _=require(_0xf6d4('0x0'));var util=require('util');var moment=require(_0xf6d4('0x1'));var BPromise=require(_0xf6d4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf6d4('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf6d4('0x4'))(_0xf6d4('0x5'));var config=require('../../config/environment');var jayson=require(_0xf6d4('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x460279,_0x58b790,_0x1ab79f){return new BPromise(function(_0x5d183a,_0x37eb0b){return client[_0xf6d4('0x7')](_0x460279,_0x1ab79f)['then'](function(_0x3ce965){logger[_0xf6d4('0x8')]('Schedule,\x20%s,\x20%s',_0x58b790,_0xf6d4('0x9'));logger[_0xf6d4('0xa')]('Schedule,\x20%s,\x20%s,\x20%s',_0x58b790,_0xf6d4('0x9'),JSON[_0xf6d4('0xb')](_0x3ce965));if(_0x3ce965[_0xf6d4('0xc')]){if(_0x3ce965[_0xf6d4('0xc')][_0xf6d4('0xd')]===0x1f4){logger[_0xf6d4('0xc')](_0xf6d4('0xe'),_0x58b790,_0x3ce965[_0xf6d4('0xc')]['message']);return _0x37eb0b(_0x3ce965[_0xf6d4('0xc')][_0xf6d4('0xf')]);}logger['error']('Schedule,\x20%s,\x20%s',_0x58b790,_0x3ce965[_0xf6d4('0xc')][_0xf6d4('0xf')]);return _0x5d183a(_0x3ce965[_0xf6d4('0xc')][_0xf6d4('0xf')]);}else{logger[_0xf6d4('0x8')](_0xf6d4('0xe'),_0x58b790,'request\x20sent');_0x5d183a(_0x3ce965[_0xf6d4('0x10')][_0xf6d4('0xf')]);}})[_0xf6d4('0x11')](function(_0x20c899){logger[_0xf6d4('0xc')]('Schedule,\x20%s,\x20%s',_0x58b790,_0x20c899);_0x37eb0b(_0x20c899);});});} \ No newline at end of file +var _0xe930=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','Schedule,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0xdc920e,_0xa8e481){var _0x1dd989=function(_0x594cc0){while(--_0x594cc0){_0xdc920e['push'](_0xdc920e['shift']());}};_0x1dd989(++_0xa8e481);}(_0xe930,0x107));var _0x0e93=function(_0x4179e2,_0xf2dbb){_0x4179e2=_0x4179e2-0x0;var _0x24cb50=_0xe930[_0x4179e2];return _0x24cb50;};'use strict';var _=require(_0x0e93('0x0'));var util=require(_0x0e93('0x1'));var moment=require('moment');var BPromise=require(_0x0e93('0x2'));var rs=require(_0x0e93('0x3'));var fs=require('fs');var Redis=require(_0x0e93('0x4'));var db=require(_0x0e93('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0e93('0x6'))(_0x0e93('0x7'));var config=require(_0x0e93('0x8'));var jayson=require(_0x0e93('0x9'));var client=jayson[_0x0e93('0xa')][_0x0e93('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x203f6a,_0x43bff2,_0x2dd4ba){return new BPromise(function(_0xd83867,_0x4c086d){return client[_0x0e93('0xc')](_0x203f6a,_0x2dd4ba)[_0x0e93('0xd')](function(_0x9c7002){logger[_0x0e93('0xe')]('Schedule,\x20%s,\x20%s',_0x43bff2,_0x0e93('0xf'));logger['debug']('Schedule,\x20%s,\x20%s,\x20%s',_0x43bff2,_0x0e93('0xf'),JSON[_0x0e93('0x10')](_0x9c7002));if(_0x9c7002['error']){if(_0x9c7002[_0x0e93('0x11')]['code']===0x1f4){logger[_0x0e93('0x11')](_0x0e93('0x12'),_0x43bff2,_0x9c7002[_0x0e93('0x11')]['message']);return _0x4c086d(_0x9c7002['error'][_0x0e93('0x13')]);}logger[_0x0e93('0x11')](_0x0e93('0x12'),_0x43bff2,_0x9c7002['error'][_0x0e93('0x13')]);return _0xd83867(_0x9c7002[_0x0e93('0x11')][_0x0e93('0x13')]);}else{logger[_0x0e93('0xe')](_0x0e93('0x12'),_0x43bff2,_0x0e93('0xf'));_0xd83867(_0x9c7002[_0x0e93('0x14')]['message']);}})[_0x0e93('0x15')](function(_0x52a933){logger[_0x0e93('0x11')](_0x0e93('0x12'),_0x43bff2,_0x52a933);_0x4c086d(_0x52a933);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 06a2c2d..82245e1 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 _0xcbdf=['exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','describe','/:id','isAuthenticated','show','/:id/download','download','create','put','update','delete','destroy'];(function(_0x2a7c69,_0x4bcd4b){var _0x21705d=function(_0x318fc3){while(--_0x318fc3){_0x2a7c69['push'](_0x2a7c69['shift']());}};_0x21705d(++_0x4bcd4b);}(_0xcbdf,0xdd));var _0xfcbd=function(_0x43f7ed,_0x194582){_0x43f7ed=_0x43f7ed-0x0;var _0x279673=_0xcbdf[_0x43f7ed];return _0x279673;};'use strict';var multer=require(_0xfcbd('0x0'));var util=require(_0xfcbd('0x1'));var path=require(_0xfcbd('0x2'));var timeout=require('connect-timeout');var express=require(_0xfcbd('0x3'));var router=express['Router']();var fs_extra=require(_0xfcbd('0x4'));var auth=require(_0xfcbd('0x5'));var interaction=require(_0xfcbd('0x6'));var config=require(_0xfcbd('0x7'));var controller=require('./screenRecording.controller');router[_0xfcbd('0x8')]('/',auth['isAuthenticated'](),controller[_0xfcbd('0x9')]);router[_0xfcbd('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xfcbd('0xa')]);router[_0xfcbd('0x8')](_0xfcbd('0xb'),auth[_0xfcbd('0xc')](),controller[_0xfcbd('0xd')]);router[_0xfcbd('0x8')](_0xfcbd('0xe'),auth[_0xfcbd('0xc')](),controller[_0xfcbd('0xf')]);router['post']('/',auth[_0xfcbd('0xc')](),controller[_0xfcbd('0x10')]);router[_0xfcbd('0x11')](_0xfcbd('0xb'),auth[_0xfcbd('0xc')](),controller[_0xfcbd('0x12')]);router[_0xfcbd('0x13')](_0xfcbd('0xb'),auth['isAuthenticated'](),controller[_0xfcbd('0x14')]);module[_0xfcbd('0x15')]=router; \ No newline at end of file +var _0xf187=['update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','isAuthenticated','index','/describe','describe','/:id','show','get','/:id/download','download','post','create','put'];(function(_0x544ddc,_0x1d1b9a){var _0x1855f2=function(_0x283125){while(--_0x283125){_0x544ddc['push'](_0x544ddc['shift']());}};_0x1855f2(++_0x1d1b9a);}(_0xf187,0x13c));var _0x7f18=function(_0x1242e5,_0x43a562){_0x1242e5=_0x1242e5-0x0;var _0x1f4d32=_0xf187[_0x1242e5];return _0x1f4d32;};'use strict';var multer=require('multer');var util=require(_0x7f18('0x0'));var path=require(_0x7f18('0x1'));var timeout=require(_0x7f18('0x2'));var express=require('express');var router=express[_0x7f18('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7f18('0x4'));var interaction=require(_0x7f18('0x5'));var config=require(_0x7f18('0x6'));var controller=require(_0x7f18('0x7'));router['get']('/',auth[_0x7f18('0x8')](),controller[_0x7f18('0x9')]);router['get'](_0x7f18('0xa'),auth[_0x7f18('0x8')](),controller[_0x7f18('0xb')]);router['get'](_0x7f18('0xc'),auth[_0x7f18('0x8')](),controller[_0x7f18('0xd')]);router[_0x7f18('0xe')](_0x7f18('0xf'),auth[_0x7f18('0x8')](),controller[_0x7f18('0x10')]);router[_0x7f18('0x11')]('/',auth['isAuthenticated'](),controller[_0x7f18('0x12')]);router[_0x7f18('0x13')](_0x7f18('0xc'),auth[_0x7f18('0x8')](),controller[_0x7f18('0x14')]);router[_0x7f18('0x15')](_0x7f18('0xc'),auth[_0x7f18('0x8')](),controller[_0x7f18('0x16')]);module[_0x7f18('0x17')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index d1f9c6f..26b443e 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 _0xfa25=['moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','setDataValue','INTEGER','startedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','closedAt','createdAt'];(function(_0x548f31,_0x316c76){var _0x9c10a8=function(_0x218f82){while(--_0x218f82){_0x548f31['push'](_0x548f31['shift']());}};_0x9c10a8(++_0x316c76);}(_0xfa25,0xd1));var _0x5fa2=function(_0x162942,_0x916d9b){_0x162942=_0x162942-0x0;var _0x178117=_0xfa25[_0x162942];return _0x178117;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x5fa2('0x0'));var path=require(_0x5fa2('0x1'));var config=require(_0x5fa2('0x2'));module[_0x5fa2('0x3')]={'format':{'type':Sequelize[_0x5fa2('0x4')],'get':function(){return this[_0x5fa2('0x5')](_0x5fa2('0x6'))?path[_0x5fa2('0x7')](this['getDataValue']('value')):undefined;}},'interactionid':{'type':Sequelize[_0x5fa2('0x8')]},'channel':{'type':Sequelize[_0x5fa2('0x8')]},'value':{'type':Sequelize['STRING'],'set':function(_0x53a560){var _0x2a9a69=_0x53a560['replace'](/\\/g,'/');this[_0x5fa2('0x9')](_0x5fa2('0x6'),_0x2a9a69);}},'rating':{'type':Sequelize[_0x5fa2('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x36778e){this[_0x5fa2('0x9')](_0x5fa2('0xb'),moment()['subtract'](_0x36778e,'ms'));this[_0x5fa2('0x9')]('closedAt',moment());this['setDataValue'](_0x5fa2('0xc'),_0x36778e);}},'startedAt':{'type':Sequelize[_0x5fa2('0xd')],'get':function(){return moment(this['getDataValue'](_0x5fa2('0xb')))[_0x5fa2('0xe')](_0x5fa2('0xf'))[_0x5fa2('0x10')]();}},'closedAt':{'type':Sequelize[_0x5fa2('0xd')],'get':function(){return moment(this[_0x5fa2('0x5')](_0x5fa2('0x11')))[_0x5fa2('0xe')](_0x5fa2('0xf'))[_0x5fa2('0x10')]();}},'createdAt':{'type':Sequelize[_0x5fa2('0xd')],'get':function(){return moment(this[_0x5fa2('0x5')](_0x5fa2('0x12')))[_0x5fa2('0xe')]('MM-DD-YYYY\x20HH:mm')[_0x5fa2('0x10')]();}},'updatedAt':{'type':Sequelize[_0x5fa2('0xd')],'get':function(){return moment(this[_0x5fa2('0x5')]('updatedAt'))['format'](_0x5fa2('0xf'))[_0x5fa2('0x10')]();}}}; \ No newline at end of file +var _0xbbbc=['format','toString','closedAt','createdAt','updatedAt','MM-DD-YYYY\x20HH:mm','sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','extname','value','STRING','replace','setDataValue','INTEGER','DATE'];(function(_0x6503ff,_0x2b169a){var _0x22e638=function(_0x53e4c4){while(--_0x53e4c4){_0x6503ff['push'](_0x6503ff['shift']());}};_0x22e638(++_0x2b169a);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x47be61,_0x199d0a){_0x47be61=_0x47be61-0x0;var _0x5d2ec5=_0xbbbc[_0x47be61];return _0x5d2ec5;};'use strict';var Sequelize=require(_0xcbbb('0x0'));var moment=require(_0xcbbb('0x1'));var path=require(_0xcbbb('0x2'));var config=require(_0xcbbb('0x3'));module[_0xcbbb('0x4')]={'format':{'type':Sequelize[_0xcbbb('0x5')],'get':function(){return this[_0xcbbb('0x6')]('value')?path[_0xcbbb('0x7')](this[_0xcbbb('0x6')](_0xcbbb('0x8'))):undefined;}},'interactionid':{'type':Sequelize[_0xcbbb('0x9')]},'channel':{'type':Sequelize[_0xcbbb('0x9')]},'value':{'type':Sequelize['STRING'],'set':function(_0x388197){var _0x1796b4=_0x388197[_0xcbbb('0xa')](/\\/g,'/');this[_0xcbbb('0xb')](_0xcbbb('0x8'),_0x1796b4);}},'rating':{'type':Sequelize[_0xcbbb('0xc')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xcbbb('0xc')],'set':function(_0x4ec90a){this[_0xcbbb('0xb')]('startedAt',moment()['subtract'](_0x4ec90a,'ms'));this[_0xcbbb('0xb')]('closedAt',moment());this[_0xcbbb('0xb')]('duration',_0x4ec90a);}},'startedAt':{'type':Sequelize[_0xcbbb('0xd')],'get':function(){return moment(this[_0xcbbb('0x6')]('startedAt'))[_0xcbbb('0xe')]('MM-DD-YYYY\x20HH:mm')[_0xcbbb('0xf')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xcbbb('0x6')](_0xcbbb('0x10')))[_0xcbbb('0xe')]('MM-DD-YYYY\x20HH:mm')[_0xcbbb('0xf')]();}},'createdAt':{'type':Sequelize[_0xcbbb('0xd')],'get':function(){return moment(this[_0xcbbb('0x6')](_0xcbbb('0x11')))['format']('MM-DD-YYYY\x20HH:mm')[_0xcbbb('0xf')]();}},'updatedAt':{'type':Sequelize[_0xcbbb('0xd')],'get':function(){return moment(this[_0xcbbb('0x6')](_0xcbbb('0x12')))['format'](_0xcbbb('0x13'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index aaa0b78..47331f1 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 _0x7bae=['zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','save','update','then','error','stack','name','index','map','ScreenRecording','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','type','VIRTUAL','filter','includeAll','findAll','rows','catch','params','options','find','create','body','duration','createdAt','value','describe','download','../../components/encryptor','uniqueid','join','root','format','%s.cypher','existsSync','secrets','recording','server/files/screen_recordings','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','send','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione'];(function(_0x268b2e,_0x1528d9){var _0x1c814b=function(_0x20caeb){while(--_0x20caeb){_0x268b2e['push'](_0x268b2e['shift']());}};_0x1c814b(++_0x1528d9);}(_0x7bae,0x13b));var _0xe7ba=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0x7bae[_0x32d457];return _0x338386;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7ba('0x0'));var jsonpatch=require(_0xe7ba('0x1'));var rp=require('request-promise');var moment=require(_0xe7ba('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe7ba('0x3'));var util=require(_0xe7ba('0x4'));var path=require(_0xe7ba('0x5'));var sox=require(_0xe7ba('0x6'));var csv=require(_0xe7ba('0x7'));var ejs=require(_0xe7ba('0x8'));var fs=require('fs');var fs_extra=require(_0xe7ba('0x9'));var _=require(_0xe7ba('0xa'));var squel=require(_0xe7ba('0xb'));var crypto=require(_0xe7ba('0xc'));var jsforce=require(_0xe7ba('0xd'));var deskjs=require(_0xe7ba('0xe'));var toCsv=require(_0xe7ba('0x7'));var querystring=require(_0xe7ba('0xf'));var Papa=require('papaparse');var Redis=require(_0xe7ba('0x10'));var authService=require(_0xe7ba('0x11'));var qs=require(_0xe7ba('0x12'));var as=require(_0xe7ba('0x13'));var hardwareService=require(_0xe7ba('0x14'));var logger=require(_0xe7ba('0x15'))(_0xe7ba('0x16'));var utils=require(_0xe7ba('0x17'));var config=require(_0xe7ba('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe7ba('0x19'))['db'];function respondWithStatusCode(_0x588c8b,_0x602b1){_0x602b1=_0x602b1||0xcc;return function(_0x45229c){if(_0x45229c){return _0x588c8b[_0xe7ba('0x1a')](_0x602b1);}return _0x588c8b[_0xe7ba('0x1b')](_0x602b1)[_0xe7ba('0x1c')]();};}function respondWithResult(_0x41369f,_0x561dbb){_0x561dbb=_0x561dbb||0xc8;return function(_0x561c48){if(_0x561c48){return _0x41369f[_0xe7ba('0x1b')](_0x561dbb)[_0xe7ba('0x1d')](_0x561c48);}};}function respondWithFilteredResult(_0x359f6f,_0x5d1d03){return function(_0x4390e3){if(_0x4390e3){var _0x4b20fd=typeof _0x5d1d03['offset']==='undefined'&&typeof _0x5d1d03[_0xe7ba('0x1e')]==='undefined';var _0x41a773=_0x4390e3['count'];var _0x4e3021=_0x4b20fd?0x0:_0x5d1d03['offset'];var _0x3f326a=_0x4b20fd?_0x4390e3[_0xe7ba('0x1f')]:_0x5d1d03[_0xe7ba('0x20')]+_0x5d1d03[_0xe7ba('0x1e')];var _0x1c8b5b;if(_0x3f326a>=_0x41a773){_0x3f326a=_0x41a773;_0x1c8b5b=0xc8;}else{_0x1c8b5b=0xce;}_0x359f6f['status'](_0x1c8b5b);return _0x359f6f[_0xe7ba('0x21')](_0xe7ba('0x22'),_0x4e3021+'-'+_0x3f326a+'/'+_0x41a773)[_0xe7ba('0x1d')](_0x4390e3);}return null;};}function patchUpdates(_0x136ec6){return function(_0x4aaf35){try{jsonpatch[_0xe7ba('0x23')](_0x4aaf35,_0x136ec6,!![]);}catch(_0x2936b7){return BPromise['reject'](_0x2936b7);}return _0x4aaf35[_0xe7ba('0x24')]();};}function saveUpdates(_0x4514e8,_0x27c882){return function(_0x7ab9e4){if(_0x7ab9e4){return _0x7ab9e4[_0xe7ba('0x25')](_0x4514e8)[_0xe7ba('0x26')](function(_0x293b14){return _0x293b14;});}return null;};}function removeEntity(_0x2b29f0,_0x41cbd9){return function(_0xa72f1c){if(_0xa72f1c){return _0xa72f1c['destroy']()['then'](function(){_0x2b29f0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4363a8,_0x576513){return function(_0x4ecc0d){if(!_0x4ecc0d){_0x4363a8['sendStatus'](0x194);}return _0x4ecc0d;};}function handleError(_0x255def,_0x32cc00){_0x32cc00=_0x32cc00||0x1f4;return function(_0xe32862){logger[_0xe7ba('0x27')](_0xe32862[_0xe7ba('0x28')]);if(_0xe32862[_0xe7ba('0x29')]){delete _0xe32862[_0xe7ba('0x29')];}_0x255def[_0xe7ba('0x1b')](_0x32cc00)['send'](_0xe32862);};}exports[_0xe7ba('0x2a')]=function(_0x48c869,_0x102925){var _0x92fe7={},_0x369451={},_0x4bf5f9={'count':0x0,'rows':[]};var _0x587c7d=_[_0xe7ba('0x2b')](db[_0xe7ba('0x2c')][_0xe7ba('0x2d')],function(_0x20b6cd){return{'name':_0x20b6cd[_0xe7ba('0x2e')],'type':_0x20b6cd['type'][_0xe7ba('0x2f')]};});_0x369451[_0xe7ba('0x30')]=_['differenceBy'](_[_0xe7ba('0x2b')](_0x587c7d,'name'),['format']);_0x369451[_0xe7ba('0x31')]=_[_0xe7ba('0x32')](_0x48c869[_0xe7ba('0x31')]);_0x369451['filters']=_[_0xe7ba('0x33')](_0x369451['model'],_0x369451[_0xe7ba('0x31')]);_0x92fe7[_0xe7ba('0x34')]=_[_0xe7ba('0x33')](_0x369451[_0xe7ba('0x30')],qs[_0xe7ba('0x35')](_0x48c869['query'][_0xe7ba('0x35')]));_0x92fe7[_0xe7ba('0x34')]=_0x92fe7['attributes'][_0xe7ba('0x36')]?_0x92fe7[_0xe7ba('0x34')]:_0x369451[_0xe7ba('0x30')];if(!_0x48c869['query'][_0xe7ba('0x37')](_0xe7ba('0x38'))){_0x92fe7['limit']=qs[_0xe7ba('0x1e')](_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x1e')]);_0x92fe7['offset']=qs[_0xe7ba('0x20')](_0x48c869[_0xe7ba('0x31')]['offset']);}_0x92fe7[_0xe7ba('0x39')]=qs[_0xe7ba('0x3a')](_0x48c869[_0xe7ba('0x31')]['sort']);_0x92fe7['where']=qs[_0xe7ba('0x3b')](_[_0xe7ba('0x3c')](_0x48c869[_0xe7ba('0x31')],_0x369451[_0xe7ba('0x3b')]),_0x587c7d);if(_0x48c869[_0xe7ba('0x31')]['filter']){_0x92fe7[_0xe7ba('0x3d')]=_[_0xe7ba('0x3e')](_0x92fe7[_0xe7ba('0x3d')],{'$or':_[_0xe7ba('0x2b')](_0x587c7d,function(_0x5e9619){if(_0x5e9619[_0xe7ba('0x3f')]!==_0xe7ba('0x40')){var _0x46e31a={};_0x46e31a[_0x5e9619[_0xe7ba('0x29')]]={'$like':'%'+_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x41')]+'%'};return _0x46e31a;}})});}_0x92fe7=_[_0xe7ba('0x3e')]({},_0x92fe7,_0x48c869['options']);var _0x3429fa={'where':_0x92fe7[_0xe7ba('0x3d')]};return db[_0xe7ba('0x2c')][_0xe7ba('0x1f')](_0x3429fa)[_0xe7ba('0x26')](function(_0x3b3abe){_0x4bf5f9[_0xe7ba('0x1f')]=_0x3b3abe;if(_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x42')]){_0x92fe7['include']=[{'all':!![]}];}return db[_0xe7ba('0x2c')][_0xe7ba('0x43')](_0x92fe7);})['then'](function(_0x5dae52){_0x4bf5f9[_0xe7ba('0x44')]=_0x5dae52;return _0x4bf5f9;})[_0xe7ba('0x26')](respondWithFilteredResult(_0x102925,_0x92fe7))[_0xe7ba('0x45')](handleError(_0x102925,null));};exports['show']=function(_0x249e1d,_0x82246e){var _0x3569b6={'raw':![],'where':{'id':_0x249e1d[_0xe7ba('0x46')]['id']}},_0x12770d={};_0x12770d['model']=_[_0xe7ba('0x32')](db['ScreenRecording'][_0xe7ba('0x2d')]);_0x12770d[_0xe7ba('0x31')]=_[_0xe7ba('0x32')](_0x249e1d[_0xe7ba('0x31')]);_0x12770d[_0xe7ba('0x3b')]=_[_0xe7ba('0x33')](_0x12770d[_0xe7ba('0x30')],_0x12770d[_0xe7ba('0x31')]);_0x3569b6['attributes']=_[_0xe7ba('0x33')](_0x12770d[_0xe7ba('0x30')],qs[_0xe7ba('0x35')](_0x249e1d[_0xe7ba('0x31')][_0xe7ba('0x35')]));_0x3569b6[_0xe7ba('0x34')]=_0x3569b6[_0xe7ba('0x34')][_0xe7ba('0x36')]?_0x3569b6[_0xe7ba('0x34')]:_0x12770d[_0xe7ba('0x30')];if(_0x249e1d['query'][_0xe7ba('0x42')]){_0x3569b6['include']=[{'all':!![]}];}_0x3569b6=_[_0xe7ba('0x3e')]({},_0x3569b6,_0x249e1d[_0xe7ba('0x47')]);return db[_0xe7ba('0x2c')][_0xe7ba('0x48')](_0x3569b6)[_0xe7ba('0x26')](handleEntityNotFound(_0x82246e,null))[_0xe7ba('0x26')](respondWithResult(_0x82246e,null))['catch'](handleError(_0x82246e,null));};exports[_0xe7ba('0x49')]=function(_0x1cc668,_0x3f17ed){return db[_0xe7ba('0x2c')][_0xe7ba('0x49')](_0x1cc668[_0xe7ba('0x4a')],{})[_0xe7ba('0x26')](respondWithResult(_0x3f17ed,0xc9))[_0xe7ba('0x45')](handleError(_0x3f17ed,null));};exports[_0xe7ba('0x25')]=function(_0x1189bd,_0xbe2a32){if(_0x1189bd['body']['id']){delete _0x1189bd[_0xe7ba('0x4a')]['id'];}delete _0x1189bd[_0xe7ba('0x4a')][_0xe7ba('0x4b')];delete _0x1189bd[_0xe7ba('0x4a')][_0xe7ba('0x4c')];delete _0x1189bd[_0xe7ba('0x4a')]['closedAt'];delete _0x1189bd[_0xe7ba('0x4a')][_0xe7ba('0x4d')];return db['ScreenRecording'][_0xe7ba('0x48')]({'where':{'id':_0x1189bd[_0xe7ba('0x46')]['id']}})[_0xe7ba('0x26')](handleEntityNotFound(_0xbe2a32,null))[_0xe7ba('0x26')](saveUpdates(_0x1189bd['body'],null))['then'](respondWithResult(_0xbe2a32,null))[_0xe7ba('0x45')](handleError(_0xbe2a32,null));};exports[_0xe7ba('0x4e')]=function(_0x285743,_0x5af106){return db[_0xe7ba('0x2c')][_0xe7ba('0x4e')]()[_0xe7ba('0x26')](respondWithResult(_0x5af106,null))[_0xe7ba('0x45')](handleError(_0x5af106,null));};exports[_0xe7ba('0x4f')]=function(_0x6b6f1,_0xf3a41f,_0x5e6612){var _0x2a6fdd=require(_0xe7ba('0x50'));var _0x316b51=![];var _0x5863c8={};if(_0x6b6f1[_0xe7ba('0x31')][_0xe7ba('0x3f')]&&_0x6b6f1['query'][_0xe7ba('0x3f')]===_0xe7ba('0x51')){_0x5863c8['uniqueid']=_0x6b6f1[_0xe7ba('0x46')]['id'];}else{_0x5863c8['id']=_0x6b6f1['params']['id'];}return db[_0xe7ba('0x2c')][_0xe7ba('0x48')]({'where':_0x5863c8,'attributes':['id',_0xe7ba('0x4d')],'raw':!![]})['then'](handleEntityNotFound(_0xf3a41f,null))[_0xe7ba('0x26')](function(_0x1128be){if(_0x1128be){var _0x314549=path[_0xe7ba('0x52')](config[_0xe7ba('0x53')],'server/files/screen_recordings',_0x1128be[_0xe7ba('0x4d')]);var _0x455e50=util[_0xe7ba('0x54')](_0xe7ba('0x55'),_0x314549);if(fs[_0xe7ba('0x56')](_0x455e50)){_0x316b51=!![];return _0x2a6fdd['decryptFile'](_0x455e50,_0x314549,config[_0xe7ba('0x57')][_0xe7ba('0x58')])[_0xe7ba('0x26')](function(){return _0x1128be;});}return _0x1128be;}})[_0xe7ba('0x26')](function(_0x57b23e){if(_0x57b23e){var _0x3e31c1=path[_0xe7ba('0x52')](config[_0xe7ba('0x53')],_0xe7ba('0x59'),_0x57b23e[_0xe7ba('0x4d')]);if(!fs[_0xe7ba('0x56')](_0x3e31c1)){throw new db['Sequelize'][(_0xe7ba('0x5a'))](_0xe7ba('0x5b'));}if(_0x57b23e[_0xe7ba('0x5c')]){return _0xf3a41f['download'](_0x3e31c1,_0x57b23e[_0xe7ba('0x5c')]+path[_0xe7ba('0x5d')](_0x3e31c1),function(){if(_0x316b51){fs[_0xe7ba('0x5e')](_0x3e31c1);}});}else{return _0xf3a41f[_0xe7ba('0x4f')](_0x3e31c1,function(_0x45fb0f){if(_0x316b51){fs[_0xe7ba('0x5e')](_0x3e31c1);}});}}})[_0xe7ba('0x45')](function(_0x3351d5){if(_0x3351d5[_0xe7ba('0x5f')]===_0xe7ba('0x5b')){_0xf3a41f[_0xe7ba('0x1b')](0x194)[_0xe7ba('0x60')]('Not\x20found');}else{return handleError(_0xf3a41f,null);}});};exports[_0xe7ba('0x61')]=function(_0x384cea,_0x357af4){return db['ScreenRecording'][_0xe7ba('0x48')]({'where':{'id':_0x384cea['params']['id']}})[_0xe7ba('0x26')](function(_0x194dff){if(_[_0xe7ba('0x62')](_0x194dff)){throw new ReferenceError('Entity\x20not\x20found');}return _0x194dff;})['then'](function(_0x46d06e){var _0x2812af=path[_0xe7ba('0x52')](config['root'],_0xe7ba('0x59'),_0x46d06e[_0xe7ba('0x4d')]);logger[_0xe7ba('0x63')](_0xe7ba('0x64'),_0x2812af);if(!_[_0xe7ba('0x62')](_0x46d06e['value'])&&fs[_0xe7ba('0x56')](_0x2812af)){logger[_0xe7ba('0x63')](_0xe7ba('0x65')+_0x2812af+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xe7ba('0x66')](_0x2812af);}_0x2812af=_0x2812af+_0xe7ba('0x67');if(!_[_0xe7ba('0x62')](_0x46d06e[_0xe7ba('0x4d')])&&fs[_0xe7ba('0x56')](_0x2812af)){logger[_0xe7ba('0x63')](_0xe7ba('0x65')+_0x2812af+_0xe7ba('0x68'));fs[_0xe7ba('0x66')](_0x2812af);}return _0x46d06e;})[_0xe7ba('0x26')](function(_0x5a5394){if(!_0x5a5394)throw new InternalError();return _0x5a5394[_0xe7ba('0x61')]();})[_0xe7ba('0x26')](function(){_0x357af4[_0xe7ba('0x1b')](0xcc)[_0xe7ba('0x1c')]();})['catch'](handleError(_0x357af4,null));}; \ No newline at end of file +var _0xdc97=['join','root','%s.cypher','existsSync','decryptFile','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','sendStatus','error','name','send','index','map','format','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','options','ScreenRecording','includeAll','rows','catch','show','params','include','find','create','body','duration','createdAt','closedAt','value','describe','download','../../components/encryptor','uniqueid'];(function(_0x19e859,_0x333efb){var _0x481f06=function(_0x5736ee){while(--_0x5736ee){_0x19e859['push'](_0x19e859['shift']());}};_0x481f06(++_0x333efb);}(_0xdc97,0x13b));var _0x7dc9=function(_0x4e3e01,_0x318dc5){_0x4e3e01=_0x4e3e01-0x0;var _0x69379c=_0xdc97[_0x4e3e01];return _0x69379c;};'use strict';var emlformat=require(_0x7dc9('0x0'));var rimraf=require(_0x7dc9('0x1'));var zipdir=require(_0x7dc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc9('0x3'));var moment=require('moment');var BPromise=require(_0x7dc9('0x4'));var Mustache=require(_0x7dc9('0x5'));var util=require('util');var path=require(_0x7dc9('0x6'));var sox=require(_0x7dc9('0x7'));var csv=require(_0x7dc9('0x8'));var ejs=require(_0x7dc9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dc9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc9('0xb'));var deskjs=require(_0x7dc9('0xc'));var toCsv=require(_0x7dc9('0x8'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc9('0xf'));var qs=require(_0x7dc9('0x10'));var as=require(_0x7dc9('0x11'));var hardwareService=require(_0x7dc9('0x12'));var logger=require(_0x7dc9('0x13'))(_0x7dc9('0x14'));var utils=require(_0x7dc9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x599ef1,_0x94c75a){_0x94c75a=_0x94c75a||0xcc;return function(_0x14e5db){if(_0x14e5db){return _0x599ef1['sendStatus'](_0x94c75a);}return _0x599ef1[_0x7dc9('0x16')](_0x94c75a)[_0x7dc9('0x17')]();};}function respondWithResult(_0xaadf2,_0xf37bc7){_0xf37bc7=_0xf37bc7||0xc8;return function(_0x31d43d){if(_0x31d43d){return _0xaadf2[_0x7dc9('0x16')](_0xf37bc7)['json'](_0x31d43d);}};}function respondWithFilteredResult(_0x3a54f2,_0x278191){return function(_0x1b0aa1){if(_0x1b0aa1){var _0x442819=typeof _0x278191[_0x7dc9('0x18')]===_0x7dc9('0x19')&&typeof _0x278191[_0x7dc9('0x1a')]===_0x7dc9('0x19');var _0x4778d5=_0x1b0aa1['count'];var _0x22577e=_0x442819?0x0:_0x278191['offset'];var _0x1f5906=_0x442819?_0x1b0aa1[_0x7dc9('0x1b')]:_0x278191['offset']+_0x278191[_0x7dc9('0x1a')];var _0x3b738a;if(_0x1f5906>=_0x4778d5){_0x1f5906=_0x4778d5;_0x3b738a=0xc8;}else{_0x3b738a=0xce;}_0x3a54f2[_0x7dc9('0x16')](_0x3b738a);return _0x3a54f2[_0x7dc9('0x1c')](_0x7dc9('0x1d'),_0x22577e+'-'+_0x1f5906+'/'+_0x4778d5)[_0x7dc9('0x1e')](_0x1b0aa1);}return null;};}function patchUpdates(_0x2dad65){return function(_0x2895f5){try{jsonpatch[_0x7dc9('0x1f')](_0x2895f5,_0x2dad65,!![]);}catch(_0x2b38d6){return BPromise['reject'](_0x2b38d6);}return _0x2895f5['save']();};}function saveUpdates(_0x12954f,_0x5981e2){return function(_0x596e0f){if(_0x596e0f){return _0x596e0f[_0x7dc9('0x20')](_0x12954f)[_0x7dc9('0x21')](function(_0x5e9525){return _0x5e9525;});}return null;};}function removeEntity(_0xffc080,_0x43d31f){return function(_0x41110a){if(_0x41110a){return _0x41110a['destroy']()[_0x7dc9('0x21')](function(){_0xffc080[_0x7dc9('0x16')](0xcc)[_0x7dc9('0x17')]();});}};}function handleEntityNotFound(_0x55a482,_0x48c6bc){return function(_0x4b9ba6){if(!_0x4b9ba6){_0x55a482[_0x7dc9('0x22')](0x194);}return _0x4b9ba6;};}function handleError(_0x32d032,_0x5843bf){_0x5843bf=_0x5843bf||0x1f4;return function(_0x585eef){logger[_0x7dc9('0x23')](_0x585eef['stack']);if(_0x585eef[_0x7dc9('0x24')]){delete _0x585eef[_0x7dc9('0x24')];}_0x32d032[_0x7dc9('0x16')](_0x5843bf)[_0x7dc9('0x25')](_0x585eef);};}exports[_0x7dc9('0x26')]=function(_0x450124,_0x236d42){var _0x229f8e={},_0x1fcf0e={},_0x3c4379={'count':0x0,'rows':[]};var _0x14083d=_[_0x7dc9('0x27')](db['ScreenRecording']['rawAttributes'],function(_0x513dd6){return{'name':_0x513dd6['fieldName'],'type':_0x513dd6['type']['key']};});_0x1fcf0e['model']=_['differenceBy'](_[_0x7dc9('0x27')](_0x14083d,_0x7dc9('0x24')),[_0x7dc9('0x28')]);_0x1fcf0e[_0x7dc9('0x29')]=_[_0x7dc9('0x2a')](_0x450124[_0x7dc9('0x29')]);_0x1fcf0e['filters']=_['intersection'](_0x1fcf0e['model'],_0x1fcf0e[_0x7dc9('0x29')]);_0x229f8e['attributes']=_[_0x7dc9('0x2b')](_0x1fcf0e[_0x7dc9('0x2c')],qs[_0x7dc9('0x2d')](_0x450124[_0x7dc9('0x29')][_0x7dc9('0x2d')]));_0x229f8e[_0x7dc9('0x2e')]=_0x229f8e[_0x7dc9('0x2e')][_0x7dc9('0x2f')]?_0x229f8e['attributes']:_0x1fcf0e[_0x7dc9('0x2c')];if(!_0x450124['query'][_0x7dc9('0x30')](_0x7dc9('0x31'))){_0x229f8e[_0x7dc9('0x1a')]=qs[_0x7dc9('0x1a')](_0x450124['query'][_0x7dc9('0x1a')]);_0x229f8e['offset']=qs[_0x7dc9('0x18')](_0x450124['query']['offset']);}_0x229f8e[_0x7dc9('0x32')]=qs[_0x7dc9('0x33')](_0x450124[_0x7dc9('0x29')][_0x7dc9('0x33')]);_0x229f8e['where']=qs[_0x7dc9('0x34')](_[_0x7dc9('0x35')](_0x450124[_0x7dc9('0x29')],_0x1fcf0e[_0x7dc9('0x34')]),_0x14083d);if(_0x450124[_0x7dc9('0x29')][_0x7dc9('0x36')]){_0x229f8e[_0x7dc9('0x37')]=_[_0x7dc9('0x38')](_0x229f8e[_0x7dc9('0x37')],{'$or':_[_0x7dc9('0x27')](_0x14083d,function(_0x452aed){if(_0x452aed[_0x7dc9('0x39')]!=='VIRTUAL'){var _0x34b5c9={};_0x34b5c9[_0x452aed[_0x7dc9('0x24')]]={'$like':'%'+_0x450124[_0x7dc9('0x29')][_0x7dc9('0x36')]+'%'};return _0x34b5c9;}})});}_0x229f8e=_['merge']({},_0x229f8e,_0x450124[_0x7dc9('0x3a')]);var _0x89db0e={'where':_0x229f8e[_0x7dc9('0x37')]};return db[_0x7dc9('0x3b')][_0x7dc9('0x1b')](_0x89db0e)[_0x7dc9('0x21')](function(_0x5a1201){_0x3c4379['count']=_0x5a1201;if(_0x450124[_0x7dc9('0x29')][_0x7dc9('0x3c')]){_0x229f8e['include']=[{'all':!![]}];}return db[_0x7dc9('0x3b')]['findAll'](_0x229f8e);})[_0x7dc9('0x21')](function(_0x2a91fe){_0x3c4379[_0x7dc9('0x3d')]=_0x2a91fe;return _0x3c4379;})['then'](respondWithFilteredResult(_0x236d42,_0x229f8e))[_0x7dc9('0x3e')](handleError(_0x236d42,null));};exports[_0x7dc9('0x3f')]=function(_0x1929b6,_0x95513c){var _0x28ffc0={'raw':![],'where':{'id':_0x1929b6[_0x7dc9('0x40')]['id']}},_0x23499a={};_0x23499a['model']=_[_0x7dc9('0x2a')](db['ScreenRecording']['rawAttributes']);_0x23499a[_0x7dc9('0x29')]=_[_0x7dc9('0x2a')](_0x1929b6[_0x7dc9('0x29')]);_0x23499a[_0x7dc9('0x34')]=_[_0x7dc9('0x2b')](_0x23499a[_0x7dc9('0x2c')],_0x23499a[_0x7dc9('0x29')]);_0x28ffc0[_0x7dc9('0x2e')]=_[_0x7dc9('0x2b')](_0x23499a['model'],qs[_0x7dc9('0x2d')](_0x1929b6[_0x7dc9('0x29')][_0x7dc9('0x2d')]));_0x28ffc0[_0x7dc9('0x2e')]=_0x28ffc0[_0x7dc9('0x2e')][_0x7dc9('0x2f')]?_0x28ffc0['attributes']:_0x23499a[_0x7dc9('0x2c')];if(_0x1929b6[_0x7dc9('0x29')]['includeAll']){_0x28ffc0[_0x7dc9('0x41')]=[{'all':!![]}];}_0x28ffc0=_[_0x7dc9('0x38')]({},_0x28ffc0,_0x1929b6[_0x7dc9('0x3a')]);return db['ScreenRecording'][_0x7dc9('0x42')](_0x28ffc0)['then'](handleEntityNotFound(_0x95513c,null))['then'](respondWithResult(_0x95513c,null))[_0x7dc9('0x3e')](handleError(_0x95513c,null));};exports[_0x7dc9('0x43')]=function(_0x36d591,_0x5e0dc5){return db['ScreenRecording'][_0x7dc9('0x43')](_0x36d591['body'],{})[_0x7dc9('0x21')](respondWithResult(_0x5e0dc5,0xc9))[_0x7dc9('0x3e')](handleError(_0x5e0dc5,null));};exports['update']=function(_0x24ccce,_0x1d6c0a){if(_0x24ccce[_0x7dc9('0x44')]['id']){delete _0x24ccce[_0x7dc9('0x44')]['id'];}delete _0x24ccce[_0x7dc9('0x44')][_0x7dc9('0x45')];delete _0x24ccce[_0x7dc9('0x44')][_0x7dc9('0x46')];delete _0x24ccce[_0x7dc9('0x44')][_0x7dc9('0x47')];delete _0x24ccce[_0x7dc9('0x44')][_0x7dc9('0x48')];return db[_0x7dc9('0x3b')]['find']({'where':{'id':_0x24ccce[_0x7dc9('0x40')]['id']}})['then'](handleEntityNotFound(_0x1d6c0a,null))['then'](saveUpdates(_0x24ccce[_0x7dc9('0x44')],null))[_0x7dc9('0x21')](respondWithResult(_0x1d6c0a,null))[_0x7dc9('0x3e')](handleError(_0x1d6c0a,null));};exports[_0x7dc9('0x49')]=function(_0x346d27,_0x510e2a){return db[_0x7dc9('0x3b')][_0x7dc9('0x49')]()[_0x7dc9('0x21')](respondWithResult(_0x510e2a,null))['catch'](handleError(_0x510e2a,null));};exports[_0x7dc9('0x4a')]=function(_0x3fc164,_0x2cf133,_0x32bc31){var _0xf41b8c=require(_0x7dc9('0x4b'));var _0x593132=![];var _0x366b8b={};if(_0x3fc164[_0x7dc9('0x29')][_0x7dc9('0x39')]&&_0x3fc164[_0x7dc9('0x29')][_0x7dc9('0x39')]===_0x7dc9('0x4c')){_0x366b8b[_0x7dc9('0x4c')]=_0x3fc164[_0x7dc9('0x40')]['id'];}else{_0x366b8b['id']=_0x3fc164[_0x7dc9('0x40')]['id'];}return db[_0x7dc9('0x3b')][_0x7dc9('0x42')]({'where':_0x366b8b,'attributes':['id',_0x7dc9('0x48')],'raw':!![]})['then'](handleEntityNotFound(_0x2cf133,null))[_0x7dc9('0x21')](function(_0x39be46){if(_0x39be46){var _0x38df9a=path[_0x7dc9('0x4d')](config[_0x7dc9('0x4e')],'server/files/screen_recordings',_0x39be46[_0x7dc9('0x48')]);var _0xd8d327=util[_0x7dc9('0x28')](_0x7dc9('0x4f'),_0x38df9a);if(fs[_0x7dc9('0x50')](_0xd8d327)){_0x593132=!![];return _0xf41b8c[_0x7dc9('0x51')](_0xd8d327,_0x38df9a,config['secrets']['recording'])['then'](function(){return _0x39be46;});}return _0x39be46;}})[_0x7dc9('0x21')](function(_0x3daf33){if(_0x3daf33){var _0x32a64f=path[_0x7dc9('0x4d')](config['root'],'server/files/screen_recordings',_0x3daf33[_0x7dc9('0x48')]);if(!fs[_0x7dc9('0x50')](_0x32a64f)){throw new db[(_0x7dc9('0x52'))][(_0x7dc9('0x53'))](_0x7dc9('0x54'));}if(_0x3daf33[_0x7dc9('0x55')]){return _0x2cf133[_0x7dc9('0x4a')](_0x32a64f,_0x3daf33['filename']+path[_0x7dc9('0x56')](_0x32a64f),function(){if(_0x593132){fs[_0x7dc9('0x57')](_0x32a64f);}});}else{return _0x2cf133[_0x7dc9('0x4a')](_0x32a64f,function(_0x1dad95){if(_0x593132){fs[_0x7dc9('0x57')](_0x32a64f);}});}}})['catch'](function(_0x175858){if(_0x175858[_0x7dc9('0x58')]===_0x7dc9('0x54')){_0x2cf133[_0x7dc9('0x16')](0x194)[_0x7dc9('0x25')](_0x7dc9('0x59'));}else{return handleError(_0x2cf133,null);}});};exports[_0x7dc9('0x5a')]=function(_0x2a02ed,_0x3463e4){return db[_0x7dc9('0x3b')][_0x7dc9('0x42')]({'where':{'id':_0x2a02ed[_0x7dc9('0x40')]['id']}})[_0x7dc9('0x21')](function(_0x5eee27){if(_[_0x7dc9('0x5b')](_0x5eee27)){throw new ReferenceError('Entity\x20not\x20found');}return _0x5eee27;})[_0x7dc9('0x21')](function(_0x15cf19){var _0x48ea37=path[_0x7dc9('0x4d')](config[_0x7dc9('0x4e')],'server/files/screen_recordings',_0x15cf19[_0x7dc9('0x48')]);logger[_0x7dc9('0x5c')](_0x7dc9('0x5d'),_0x48ea37);if(!_['isNil'](_0x15cf19['value'])&&fs[_0x7dc9('0x50')](_0x48ea37)){logger[_0x7dc9('0x5c')](_0x7dc9('0x5e')+_0x48ea37+_0x7dc9('0x5f'));fs[_0x7dc9('0x60')](_0x48ea37);}_0x48ea37=_0x48ea37+_0x7dc9('0x61');if(!_[_0x7dc9('0x5b')](_0x15cf19[_0x7dc9('0x48')])&&fs[_0x7dc9('0x50')](_0x48ea37)){logger['info'](_0x7dc9('0x5e')+_0x48ea37+_0x7dc9('0x5f'));fs[_0x7dc9('0x60')](_0x48ea37);}return _0x15cf19;})['then'](function(_0x4f80bd){if(!_0x4f80bd)throw new InternalError();return _0x4f80bd[_0x7dc9('0x5a')]();})[_0x7dc9('0x21')](function(){_0x3463e4[_0x7dc9('0x16')](0xcc)[_0x7dc9('0x17')]();})['catch'](handleError(_0x3463e4,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index fb8639f..3d6ecd1 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 _0xb2fb=['interactionid','lodash','util','../../config/logger','api','moment','bluebird','rimraf','exports','define','ScreenRecording'];(function(_0x408f7e,_0x4138cb){var _0x4f87ce=function(_0x2a95f4){while(--_0x2a95f4){_0x408f7e['push'](_0x408f7e['shift']());}};_0x4f87ce(++_0x4138cb);}(_0xb2fb,0x1a3));var _0xbb2f=function(_0x229a6b,_0x5e4a9a){_0x229a6b=_0x229a6b-0x0;var _0x5edf49=_0xb2fb[_0x229a6b];return _0x5edf49;};'use strict';var _=require(_0xbb2f('0x0'));var util=require(_0xbb2f('0x1'));var logger=require(_0xbb2f('0x2'))(_0xbb2f('0x3'));var moment=require(_0xbb2f('0x4'));var BPromise=require(_0xbb2f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbb2f('0x6'));var config=require('../../config/environment');var attributes=require('./screenRecording.attributes');module[_0xbb2f('0x7')]=function(_0xf6c1e8,_0xa302c6){return _0xf6c1e8[_0xbb2f('0x8')](_0xbb2f('0x9'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0xbb2f('0xa'),'fields':[_0xbb2f('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf5ee=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./screenRecording.attributes','exports','define','interactionid'];(function(_0x5783aa,_0x2aa482){var _0x3a3fe1=function(_0x568e89){while(--_0x568e89){_0x5783aa['push'](_0x5783aa['shift']());}};_0x3a3fe1(++_0x2aa482);}(_0xf5ee,0x1e0));var _0xef5e=function(_0x3e6401,_0x12ef0e){_0x3e6401=_0x3e6401-0x0;var _0x3b1f5a=_0xf5ee[_0x3e6401];return _0x3b1f5a;};'use strict';var _=require('lodash');var util=require(_0xef5e('0x0'));var logger=require(_0xef5e('0x1'))(_0xef5e('0x2'));var moment=require(_0xef5e('0x3'));var BPromise=require(_0xef5e('0x4'));var rp=require(_0xef5e('0x5'));var fs=require('fs');var path=require(_0xef5e('0x6'));var rimraf=require('rimraf');var config=require(_0xef5e('0x7'));var attributes=require(_0xef5e('0x8'));module[_0xef5e('0x9')]=function(_0x13d8e0,_0x18358e){return _0x13d8e0[_0xef5e('0xa')]('ScreenRecording',attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':'interactionid','fields':[_0xef5e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index fd91471..213b6d1 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 _0x98bf=['result','catch','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x53cc92,_0x3e61ec){var _0x5315bd=function(_0x142aac){while(--_0x142aac){_0x53cc92['push'](_0x53cc92['shift']());}};_0x5315bd(++_0x3e61ec);}(_0x98bf,0xca));var _0xf98b=function(_0x18c575,_0x3e74e0){_0x18c575=_0x18c575-0x0;var _0x150071=_0x98bf[_0x18c575];return _0x150071;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xf98b('0x0'));var rs=require(_0xf98b('0x1'));var fs=require('fs');var Redis=require(_0xf98b('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xf98b('0x3'));var logger=require(_0xf98b('0x4'))(_0xf98b('0x5'));var config=require('../../config/environment');var jayson=require(_0xf98b('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2d5704,_0xa9790b,_0x60b7b3){return new BPromise(function(_0x3dd5a8,_0x1a487){return client[_0xf98b('0x7')](_0x2d5704,_0x60b7b3)[_0xf98b('0x8')](function(_0x31b84e){logger['info'](_0xf98b('0x9'),_0xa9790b,_0xf98b('0xa'));logger[_0xf98b('0xb')](_0xf98b('0xc'),_0xa9790b,_0xf98b('0xa'),JSON[_0xf98b('0xd')](_0x31b84e));if(_0x31b84e['error']){if(_0x31b84e[_0xf98b('0xe')][_0xf98b('0xf')]===0x1f4){logger[_0xf98b('0xe')](_0xf98b('0x9'),_0xa9790b,_0x31b84e['error'][_0xf98b('0x10')]);return _0x1a487(_0x31b84e[_0xf98b('0xe')][_0xf98b('0x10')]);}logger[_0xf98b('0xe')]('ScreenRecording,\x20%s,\x20%s',_0xa9790b,_0x31b84e[_0xf98b('0xe')][_0xf98b('0x10')]);return _0x3dd5a8(_0x31b84e[_0xf98b('0xe')]['message']);}else{logger[_0xf98b('0x11')](_0xf98b('0x9'),_0xa9790b,_0xf98b('0xa'));_0x3dd5a8(_0x31b84e[_0xf98b('0x12')][_0xf98b('0x10')]);}})[_0xf98b('0x13')](function(_0x30b2dc){logger[_0xf98b('0xe')](_0xf98b('0x9'),_0xa9790b,_0x30b2dc);_0x1a487(_0x30b2dc);});});} \ No newline at end of file +var _0x1862=['debug','error','code','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent'];(function(_0x12b1a6,_0x22df2d){var _0x5813d3=function(_0x57773e){while(--_0x57773e){_0x12b1a6['push'](_0x12b1a6['shift']());}};_0x5813d3(++_0x22df2d);}(_0x1862,0x1ce));var _0x2186=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1862[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2186('0x0'));var util=require('util');var moment=require(_0x2186('0x1'));var BPromise=require(_0x2186('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2186('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2186('0x4'))(_0x2186('0x5'));var config=require(_0x2186('0x6'));var jayson=require(_0x2186('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1f49ae,_0x5c30af,_0x556749){return new BPromise(function(_0x29b090,_0x1f6868){return client[_0x2186('0x8')](_0x1f49ae,_0x556749)[_0x2186('0x9')](function(_0x35e56e){logger[_0x2186('0xa')](_0x2186('0xb'),_0x5c30af,_0x2186('0xc'));logger[_0x2186('0xd')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x5c30af,_0x2186('0xc'),JSON['stringify'](_0x35e56e));if(_0x35e56e[_0x2186('0xe')]){if(_0x35e56e['error'][_0x2186('0xf')]===0x1f4){logger['error'](_0x2186('0xb'),_0x5c30af,_0x35e56e[_0x2186('0xe')][_0x2186('0x10')]);return _0x1f6868(_0x35e56e[_0x2186('0xe')][_0x2186('0x10')]);}logger[_0x2186('0xe')](_0x2186('0xb'),_0x5c30af,_0x35e56e['error'][_0x2186('0x10')]);return _0x29b090(_0x35e56e['error']['message']);}else{logger[_0x2186('0xa')]('ScreenRecording,\x20%s,\x20%s',_0x5c30af,_0x2186('0xc'));_0x29b090(_0x35e56e[_0x2186('0x11')][_0x2186('0x10')]);}})[_0x2186('0x12')](function(_0x323780){logger[_0x2186('0xe')](_0x2186('0xb'),_0x5c30af,_0x323780);_0x1f6868(_0x323780);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 9cff2bf..b55b00f 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 _0xd332=['/:id/logo','single','file','join','addLogoLogin','addPreferred','addFavicon','put','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','getDate','/:id','show','getLogo','getLogoLogin','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','post'];(function(_0x17e771,_0x55fd17){var _0x1f3a6d=function(_0x346ee3){while(--_0x346ee3){_0x17e771['push'](_0x17e771['shift']());}};_0x1f3a6d(++_0x55fd17);}(_0xd332,0x8a));var _0x2d33=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0xd332[_0x1b2ff7];return _0x31656a;};'use strict';var multer=require(_0x2d33('0x0'));var util=require(_0x2d33('0x1'));var path=require(_0x2d33('0x2'));var timeout=require(_0x2d33('0x3'));var express=require(_0x2d33('0x4'));var router=express[_0x2d33('0x5')]();var fs_extra=require(_0x2d33('0x6'));var auth=require(_0x2d33('0x7'));var interaction=require(_0x2d33('0x8'));var config=require(_0x2d33('0x9'));var controller=require(_0x2d33('0xa'));router[_0x2d33('0xb')]('/',auth[_0x2d33('0xc')](),controller[_0x2d33('0xd')]);router[_0x2d33('0xb')](_0x2d33('0xe'),controller[_0x2d33('0xf')]);router[_0x2d33('0xb')](_0x2d33('0x10'),controller[_0x2d33('0x11')]);router['get']('/:id/logo',controller[_0x2d33('0x12')]);router[_0x2d33('0xb')]('/:id/logo_login',controller[_0x2d33('0x13')]);router[_0x2d33('0xb')]('/:id/gdpr',controller[_0x2d33('0x14')]);router[_0x2d33('0xb')](_0x2d33('0x15'),controller[_0x2d33('0x16')]);router['get'](_0x2d33('0x17'),controller[_0x2d33('0x18')]);var upload=multer({'storage':multer[_0x2d33('0x19')]({'destination':function(_0x3eea12,_0x31c8ca,_0x419512){_0x419512(null,path['join'](config[_0x2d33('0x1a')],_0x2d33('0x1b')));},'filename':function(_0x1406fa,_0x5ad8be,_0x5f066d){_0x5f066d(null,util[_0x2d33('0x1c')](_0x2d33('0x1d'),_0x2d33('0x1e'),path[_0x2d33('0x1f')](_0x5ad8be[_0x2d33('0x20')])));}})});router[_0x2d33('0x21')](_0x2d33('0x22'),upload[_0x2d33('0x23')](_0x2d33('0x24')),controller['addLogo']);var upload=multer({'storage':multer[_0x2d33('0x19')]({'destination':function(_0x4d827c,_0x1778dd,_0xffe5bf){_0xffe5bf(null,path[_0x2d33('0x25')](config[_0x2d33('0x1a')],_0x2d33('0x1b')));},'filename':function(_0x4c7900,_0x1e09d7,_0x3dff10){_0x3dff10(null,util[_0x2d33('0x1c')](_0x2d33('0x1d'),'logologin',path['extname'](_0x1e09d7[_0x2d33('0x20')])));}})});router[_0x2d33('0x21')]('/:id/logo_login',upload[_0x2d33('0x23')](_0x2d33('0x24')),controller[_0x2d33('0x26')]);var upload=multer({'storage':multer[_0x2d33('0x19')]({'destination':function(_0x3ffaa4,_0x1fbb9c,_0x15b0d4){_0x15b0d4(null,path['join'](config[_0x2d33('0x1a')],_0x2d33('0x1b')));},'filename':function(_0x3a7ad8,_0x612798,_0x1165b0){_0x1165b0(null,util[_0x2d33('0x1c')](_0x2d33('0x1d'),'preferred',path[_0x2d33('0x1f')](_0x612798[_0x2d33('0x20')])));}})});router[_0x2d33('0x21')](_0x2d33('0x15'),upload[_0x2d33('0x23')](_0x2d33('0x24')),controller[_0x2d33('0x27')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x303685,_0x17bc45,_0x2cef08){_0x2cef08(null,path[_0x2d33('0x25')](config['root'],_0x2d33('0x1b')));},'filename':function(_0x18224a,_0x5e9189,_0x7e2179){_0x7e2179(null,util[_0x2d33('0x1c')](_0x2d33('0x1d'),'favicon',path[_0x2d33('0x1f')](_0x5e9189[_0x2d33('0x20')])));}})});router['post'](_0x2d33('0x17'),upload[_0x2d33('0x23')]('file'),controller[_0x2d33('0x28')]);router[_0x2d33('0x29')]('/:id',auth[_0x2d33('0xc')](),controller['update']);module[_0x2d33('0x2a')]=router; \ No newline at end of file +var _0x57fd=['addLogoLogin','addPreferred','server/files/images/logos/','addFavicon','put','isAuthenticated','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./setting.controller','index','get','/now','/:id','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','format','logo','extname','post','/:id/logo','single','file','addLogo','join','root','%s%s','logologin','originalname'];(function(_0x409e33,_0xe16891){var _0x550815=function(_0x5d5a7f){while(--_0x5d5a7f){_0x409e33['push'](_0x409e33['shift']());}};_0x550815(++_0xe16891);}(_0x57fd,0xaf));var _0xd57f=function(_0x1563d1,_0x17e733){_0x1563d1=_0x1563d1-0x0;var _0x12c7cd=_0x57fd[_0x1563d1];return _0x12c7cd;};'use strict';var multer=require(_0xd57f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd57f('0x1'));var express=require(_0xd57f('0x2'));var router=express[_0xd57f('0x3')]();var fs_extra=require(_0xd57f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd57f('0x5'));var config=require(_0xd57f('0x6'));var controller=require(_0xd57f('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xd57f('0x8')]);router[_0xd57f('0x9')](_0xd57f('0xa'),controller['getDate']);router[_0xd57f('0x9')](_0xd57f('0xb'),controller['show']);router[_0xd57f('0x9')]('/:id/logo',controller[_0xd57f('0xc')]);router[_0xd57f('0x9')](_0xd57f('0xd'),controller[_0xd57f('0xe')]);router[_0xd57f('0x9')](_0xd57f('0xf'),controller[_0xd57f('0x10')]);router['get'](_0xd57f('0x11'),controller[_0xd57f('0x12')]);router[_0xd57f('0x9')](_0xd57f('0x13'),controller[_0xd57f('0x14')]);var upload=multer({'storage':multer[_0xd57f('0x15')]({'destination':function(_0x2b0764,_0x66a8f0,_0xa6d35f){_0xa6d35f(null,path['join'](config['root'],'server/files/images/logos/'));},'filename':function(_0x147ef6,_0xe9558a,_0xb80081){_0xb80081(null,util[_0xd57f('0x16')]('%s%s',_0xd57f('0x17'),path[_0xd57f('0x18')](_0xe9558a['originalname'])));}})});router[_0xd57f('0x19')](_0xd57f('0x1a'),upload[_0xd57f('0x1b')](_0xd57f('0x1c')),controller[_0xd57f('0x1d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5ca676,_0x4bb80b,_0x54b8ac){_0x54b8ac(null,path[_0xd57f('0x1e')](config[_0xd57f('0x1f')],'server/files/images/logos/'));},'filename':function(_0x2bbd3a,_0x3a3eae,_0xae082c){_0xae082c(null,util[_0xd57f('0x16')](_0xd57f('0x20'),_0xd57f('0x21'),path[_0xd57f('0x18')](_0x3a3eae[_0xd57f('0x22')])));}})});router[_0xd57f('0x19')](_0xd57f('0xd'),upload[_0xd57f('0x1b')](_0xd57f('0x1c')),controller[_0xd57f('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x216313,_0x3f1be3,_0x9421){_0x9421(null,path[_0xd57f('0x1e')](config[_0xd57f('0x1f')],'server/files/images/logos/'));},'filename':function(_0x13763f,_0x22dc7b,_0x1e1126){_0x1e1126(null,util[_0xd57f('0x16')](_0xd57f('0x20'),'preferred',path[_0xd57f('0x18')](_0x22dc7b[_0xd57f('0x22')])));}})});router[_0xd57f('0x19')](_0xd57f('0x11'),upload[_0xd57f('0x1b')](_0xd57f('0x1c')),controller[_0xd57f('0x24')]);var upload=multer({'storage':multer[_0xd57f('0x15')]({'destination':function(_0x5d8c10,_0x2127f3,_0x12b536){_0x12b536(null,path[_0xd57f('0x1e')](config[_0xd57f('0x1f')],_0xd57f('0x25')));},'filename':function(_0x31d99a,_0x2b0dad,_0x5185b4){_0x5185b4(null,util['format'](_0xd57f('0x20'),'favicon',path[_0xd57f('0x18')](_0x2b0dad[_0xd57f('0x22')])));}})});router['post'](_0xd57f('0x13'),upload['single'](_0xd57f('0x1c')),controller[_0xd57f('0x26')]);router[_0xd57f('0x27')]('/:id',auth[_0xd57f('0x28')](),controller['update']);module[_0xd57f('0x29')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index ae938d2..8e68c06 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 _0x7a54=['UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','alternate'];(function(_0x37cfdc,_0x3ba7f3){var _0x1b7b8a=function(_0x43a3f9){while(--_0x43a3f9){_0x37cfdc['push'](_0x37cfdc['shift']());}};_0x1b7b8a(++_0x3ba7f3);}(_0x7a54,0x106));var _0x47a5=function(_0x5dd4ad,_0x58e63d){_0x5dd4ad=_0x5dd4ad-0x0;var _0x2390af=_0x7a54[_0x5dd4ad];return _0x2390af;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'min_internal':{'type':Sequelize[_0x47a5('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x47a5('0x2')](0xb),'unique':_0x47a5('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x47a5('0x4')],'defaultValue':_0x47a5('0x5')},'logo':{'type':Sequelize[_0x47a5('0x4')]},'defaultLogo':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x47a5('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x47a5('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x47a5('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x47a5('0x4')],'defaultValue':_0x47a5('0x7')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x47a5('0x4')]},'defaultPreferred':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x47a5('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x47a5('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x47a5('0x2')]},'transcribeRegion':{'type':Sequelize[_0x47a5('0x4')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x47a5('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0x47a5('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x5f2f=['INTEGER','min_internal','min_mailbox','STRING','BOOLEAN','alternate','UNSIGNED','sequelize','exports'];(function(_0xdadd07,_0x367d87){var _0x507886=function(_0x34d79a){while(--_0x34d79a){_0xdadd07['push'](_0xdadd07['shift']());}};_0x507886(++_0x367d87);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4a42ca,_0x4beefe){_0x4a42ca=_0x4a42ca-0x0;var _0x23a3f6=_0x5f2f[_0x4a42ca];return _0x23a3f6;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'min_internal':{'type':Sequelize[_0xf5f2('0x2')](0xb),'unique':_0xf5f2('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xf5f2('0x2')](0xb),'unique':_0xf5f2('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xf5f2('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xf5f2('0x5')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xf5f2('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xf5f2('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xf5f2('0x5')]},'turnaddr':{'type':Sequelize[_0xf5f2('0x5')]},'turnusername':{'type':Sequelize[_0xf5f2('0x5')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0xf5f2('0x5')]},'defaultPageTitle':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xf5f2('0x5')],'defaultValue':_0xf5f2('0x7')},'chatTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xf5f2('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xf5f2('0x2')]},'transcribeRegion':{'type':Sequelize[_0xf5f2('0x5')]},'sentiment':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xf5f2('0x2')]},'sentimentRegion':{'type':Sequelize[_0xf5f2('0x5')]},'language':{'type':Sequelize[_0xf5f2('0x5')]},'bucket':{'type':Sequelize[_0xf5f2('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xf5f2('0x2')](0x2)[_0xf5f2('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xf5f2('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xf5f2('0x2')](0x2)[_0xf5f2('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 35e09a5..5904b7b 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 _0xadb2=['default_preferred.png','download','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','sendStatus','status','end','offset','limit','set','json','apply','reject','save','update','destroy','stack','name','send','map','Setting','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','sort','where','merge','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','params','find','body','file','logo','filename','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','join','root','toLower','default','upperFirst','custom','default_logo.svg','existsSync','Sequelize','ValidationError','\x20not\x20found','loginLogo','default_loginLogo.svg','gdpr','securePassword','getPreferred'];(function(_0x4efba3,_0x2d89bb){var _0x15ea51=function(_0xfddefd){while(--_0xfddefd){_0x4efba3['push'](_0x4efba3['shift']());}};_0x15ea51(++_0x2d89bb);}(_0xadb2,0xf2));var _0x2adb=function(_0x1c1b62,_0x5de226){_0x1c1b62=_0x1c1b62-0x0;var _0x5087fd=_0xadb2[_0x1c1b62];return _0x5087fd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2adb('0x0'));var zipdir=require(_0x2adb('0x1'));var jsonpatch=require(_0x2adb('0x2'));var rp=require(_0x2adb('0x3'));var moment=require('moment');var BPromise=require(_0x2adb('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2adb('0x5'));var sox=require(_0x2adb('0x6'));var csv=require('to-csv');var ejs=require(_0x2adb('0x7'));var fs=require('fs');var fs_extra=require(_0x2adb('0x8'));var _=require(_0x2adb('0x9'));var squel=require(_0x2adb('0xa'));var crypto=require(_0x2adb('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2adb('0xc'));var querystring=require(_0x2adb('0xd'));var Papa=require(_0x2adb('0xe'));var Redis=require('ioredis');var authService=require(_0x2adb('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2adb('0x10'));var hardwareService=require(_0x2adb('0x11'));var logger=require(_0x2adb('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2adb('0x13'));var db=require(_0x2adb('0x14'))['db'];var jayson=require(_0x2adb('0x15'));var client=jayson[_0x2adb('0x16')][_0x2adb('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x32a17d,_0x224234,_0x45f430,_0x48d16a){return new BPromise(function(_0x26bcfe,_0x4e081f){var _0x585883=_0x48d16a||client;return _0x585883[_0x2adb('0x18')](_0x32a17d,_0x45f430)[_0x2adb('0x19')](function(_0x493e8f){logger[_0x2adb('0x1a')](_0x2adb('0x1b'),_0x224234,'request\x20sent');logger[_0x2adb('0x1c')](_0x2adb('0x1d'),_0x224234,_0x2adb('0x1e'),JSON[_0x2adb('0x1f')](_0x493e8f));if(_0x493e8f[_0x2adb('0x20')]){if(_0x493e8f[_0x2adb('0x20')]['code']===0x1f4){logger[_0x2adb('0x20')](_0x2adb('0x1b'),_0x224234,_0x493e8f[_0x2adb('0x20')][_0x2adb('0x21')]);return _0x4e081f(_0x493e8f[_0x2adb('0x20')][_0x2adb('0x21')]);}logger[_0x2adb('0x20')](_0x2adb('0x1b'),_0x224234,_0x493e8f[_0x2adb('0x20')]['message']);return _0x26bcfe(_0x493e8f[_0x2adb('0x20')][_0x2adb('0x21')]);}else{logger[_0x2adb('0x1a')](_0x2adb('0x1b'),_0x224234,_0x2adb('0x1e'));_0x26bcfe(_0x493e8f[_0x2adb('0x22')][_0x2adb('0x21')]);}})['catch'](function(_0x515401){logger[_0x2adb('0x20')](_0x2adb('0x1b'),_0x224234,_0x515401);_0x4e081f(_0x515401);});});}function respondWithStatusCode(_0xd0ba85,_0x4f2545){_0x4f2545=_0x4f2545||0xcc;return function(_0x137af6){if(_0x137af6){return _0xd0ba85[_0x2adb('0x23')](_0x4f2545);}return _0xd0ba85[_0x2adb('0x24')](_0x4f2545)[_0x2adb('0x25')]();};}function respondWithResult(_0x533e72,_0x54c3ec){_0x54c3ec=_0x54c3ec||0xc8;return function(_0x212a16){if(_0x212a16){return _0x533e72[_0x2adb('0x24')](_0x54c3ec)['json'](_0x212a16);}};}function respondWithFilteredResult(_0x4bdd70,_0x49b8a3){return function(_0x46110e){if(_0x46110e){var _0x38fc5c=typeof _0x49b8a3[_0x2adb('0x26')]==='undefined'&&typeof _0x49b8a3[_0x2adb('0x27')]==='undefined';var _0x39c24f=_0x46110e['count'];var _0x241a31=_0x38fc5c?0x0:_0x49b8a3[_0x2adb('0x26')];var _0x482f7e=_0x38fc5c?_0x46110e['count']:_0x49b8a3[_0x2adb('0x26')]+_0x49b8a3[_0x2adb('0x27')];var _0x1fe120;if(_0x482f7e>=_0x39c24f){_0x482f7e=_0x39c24f;_0x1fe120=0xc8;}else{_0x1fe120=0xce;}_0x4bdd70[_0x2adb('0x24')](_0x1fe120);return _0x4bdd70[_0x2adb('0x28')]('Content-Range',_0x241a31+'-'+_0x482f7e+'/'+_0x39c24f)[_0x2adb('0x29')](_0x46110e);}return null;};}function patchUpdates(_0xe78d24){return function(_0x2b789e){try{jsonpatch[_0x2adb('0x2a')](_0x2b789e,_0xe78d24,!![]);}catch(_0x39af1f){return BPromise[_0x2adb('0x2b')](_0x39af1f);}return _0x2b789e[_0x2adb('0x2c')]();};}function saveUpdates(_0x7519f,_0x472ea9){return function(_0x130fd3){if(_0x130fd3){return _0x130fd3[_0x2adb('0x2d')](_0x7519f)['then'](function(_0x208121){return _0x208121;});}return null;};}function removeEntity(_0x28b86a,_0x514604){return function(_0x269c1f){if(_0x269c1f){return _0x269c1f[_0x2adb('0x2e')]()['then'](function(){_0x28b86a[_0x2adb('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x176244,_0x42ba3c){return function(_0x18aacf){if(!_0x18aacf){_0x176244['sendStatus'](0x194);}return _0x18aacf;};}function handleError(_0x50e2c5,_0x25f21f){_0x25f21f=_0x25f21f||0x1f4;return function(_0x3ac880){logger[_0x2adb('0x20')](_0x3ac880[_0x2adb('0x2f')]);if(_0x3ac880[_0x2adb('0x30')]){delete _0x3ac880['name'];}_0x50e2c5[_0x2adb('0x24')](_0x25f21f)[_0x2adb('0x31')](_0x3ac880);};}exports['index']=function(_0x2c0abc,_0x4c4267){var _0x5d6b0e={},_0x212949={},_0x31ce60={'count':0x0,'rows':[]};var _0x48a9e0=_[_0x2adb('0x32')](db[_0x2adb('0x33')][_0x2adb('0x34')],function(_0x9fee5c){return{'name':_0x9fee5c[_0x2adb('0x35')],'type':_0x9fee5c[_0x2adb('0x36')]['key']};});_0x212949['model']=_[_0x2adb('0x32')](_0x48a9e0,_0x2adb('0x30'));_0x212949[_0x2adb('0x37')]=_[_0x2adb('0x38')](_0x2c0abc[_0x2adb('0x37')]);_0x212949[_0x2adb('0x39')]=_[_0x2adb('0x3a')](_0x212949['model'],_0x212949[_0x2adb('0x37')]);_0x5d6b0e[_0x2adb('0x3b')]=_[_0x2adb('0x3a')](_0x212949[_0x2adb('0x3c')],qs[_0x2adb('0x3d')](_0x2c0abc[_0x2adb('0x37')][_0x2adb('0x3d')]));_0x5d6b0e[_0x2adb('0x3b')]=_0x5d6b0e[_0x2adb('0x3b')][_0x2adb('0x3e')]?_0x5d6b0e[_0x2adb('0x3b')]:_0x212949[_0x2adb('0x3c')];if(!_0x2c0abc[_0x2adb('0x37')][_0x2adb('0x3f')]('nolimit')){_0x5d6b0e[_0x2adb('0x27')]=qs[_0x2adb('0x27')](_0x2c0abc['query']['limit']);_0x5d6b0e['offset']=qs[_0x2adb('0x26')](_0x2c0abc[_0x2adb('0x37')][_0x2adb('0x26')]);}_0x5d6b0e['order']=qs[_0x2adb('0x40')](_0x2c0abc[_0x2adb('0x37')][_0x2adb('0x40')]);_0x5d6b0e[_0x2adb('0x41')]=qs[_0x2adb('0x39')](_['pick'](_0x2c0abc[_0x2adb('0x37')],_0x212949[_0x2adb('0x39')]),_0x48a9e0);if(_0x2c0abc[_0x2adb('0x37')]['filter']){_0x5d6b0e[_0x2adb('0x41')]=_[_0x2adb('0x42')](_0x5d6b0e[_0x2adb('0x41')],{'$or':_['map'](_0x48a9e0,function(_0x37635c){if(_0x37635c[_0x2adb('0x36')]!==_0x2adb('0x43')){var _0x1835b8={};_0x1835b8[_0x37635c['name']]={'$like':'%'+_0x2c0abc[_0x2adb('0x37')]['filter']+'%'};return _0x1835b8;}})});}_0x5d6b0e=_['merge']({},_0x5d6b0e,_0x2c0abc[_0x2adb('0x44')]);var _0x24f197={'where':_0x5d6b0e[_0x2adb('0x41')]};return db[_0x2adb('0x33')][_0x2adb('0x45')](_0x24f197)['then'](function(_0x4b031d){_0x31ce60['count']=_0x4b031d;if(_0x2c0abc['query'][_0x2adb('0x46')]){_0x5d6b0e['include']=[{'all':!![]}];}return db[_0x2adb('0x33')][_0x2adb('0x47')](_0x5d6b0e);})[_0x2adb('0x19')](function(_0x5e6791){_0x31ce60[_0x2adb('0x48')]=_0x5e6791;return _0x31ce60;})[_0x2adb('0x19')](respondWithFilteredResult(_0x4c4267,_0x5d6b0e))[_0x2adb('0x49')](handleError(_0x4c4267,null));};exports[_0x2adb('0x4a')]=function(_0x9acbbb,_0x21eb91){var _0x1b2e70={'raw':![],'where':{'id':_0x9acbbb[_0x2adb('0x4b')]['id']}},_0x57e48d={};_0x57e48d['model']=_[_0x2adb('0x38')](db['Setting'][_0x2adb('0x34')]);_0x57e48d['query']=_['keys'](_0x9acbbb['query']);_0x57e48d[_0x2adb('0x39')]=_['intersection'](_0x57e48d[_0x2adb('0x3c')],_0x57e48d[_0x2adb('0x37')]);_0x1b2e70[_0x2adb('0x3b')]=_[_0x2adb('0x3a')](_0x57e48d[_0x2adb('0x3c')],qs[_0x2adb('0x3d')](_0x9acbbb[_0x2adb('0x37')][_0x2adb('0x3d')]));_0x1b2e70['attributes']=_0x1b2e70[_0x2adb('0x3b')]['length']?_0x1b2e70[_0x2adb('0x3b')]:_0x57e48d['model'];if(_0x9acbbb[_0x2adb('0x37')][_0x2adb('0x46')]){_0x1b2e70['include']=[{'all':!![]}];}_0x1b2e70=_[_0x2adb('0x42')]({},_0x1b2e70,_0x9acbbb[_0x2adb('0x44')]);return db[_0x2adb('0x33')][_0x2adb('0x4c')](_0x1b2e70)[_0x2adb('0x19')](handleEntityNotFound(_0x21eb91,null))['then'](respondWithResult(_0x21eb91,null))[_0x2adb('0x49')](handleError(_0x21eb91,null));};exports[_0x2adb('0x2d')]=function(_0x528223,_0x345407){if(_0x528223[_0x2adb('0x4d')]['id']){delete _0x528223[_0x2adb('0x4d')]['id'];}return db[_0x2adb('0x33')][_0x2adb('0x4c')]({'where':{'id':_0x528223[_0x2adb('0x4b')]['id']}})['then'](handleEntityNotFound(_0x345407,null))[_0x2adb('0x19')](saveUpdates(_0x528223[_0x2adb('0x4d')],null))[_0x2adb('0x19')](respondWithResult(_0x345407,null))[_0x2adb('0x49')](handleError(_0x345407,null));};exports['addLogo']=function(_0x41d4b9,_0x4855db,_0x4e48e8){if(_0x41d4b9['file']&&_0x41d4b9[_0x2adb('0x4e')]['filename']){_0x41d4b9[_0x2adb('0x4d')][_0x2adb('0x4f')]=_0x41d4b9[_0x2adb('0x4e')][_0x2adb('0x50')];}return db[_0x2adb('0x33')][_0x2adb('0x4c')]({'where':{'id':_0x41d4b9[_0x2adb('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4855db,null))['then'](saveUpdates(_0x41d4b9[_0x2adb('0x4d')],null))[_0x2adb('0x19')](respondWithResult(_0x4855db,null))['catch'](handleError(_0x4855db,null));};exports['addLogoLogin']=function(_0xca90f0,_0x183aa5,_0x54db9d){if(_0xca90f0['file']&&_0xca90f0['file']['filename']){_0xca90f0[_0x2adb('0x4d')]['loginLogo']=_0xca90f0[_0x2adb('0x4e')][_0x2adb('0x50')];}return db[_0x2adb('0x33')][_0x2adb('0x4c')]({'where':{'id':_0xca90f0[_0x2adb('0x4b')]['id']}})['then'](handleEntityNotFound(_0x183aa5,null))[_0x2adb('0x19')](saveUpdates(_0xca90f0['body'],null))[_0x2adb('0x19')](respondWithResult(_0x183aa5,null))[_0x2adb('0x49')](handleError(_0x183aa5,null));};var utilLicense=require(_0x2adb('0x13'));exports[_0x2adb('0x51')]=function(_0x2ce75b,_0x503861,_0x1db296){var _0x5b0ebf=_0x2adb('0x52');var _0x60841a={'custom':![]};return utilLicense[_0x2adb('0x53')]()[_0x2adb('0x19')](function(_0x1e09bb){if(_0x1e09bb){_0x60841a=_0x1e09bb;}return db[_0x2adb('0x33')][_0x2adb('0x4c')]({'where':{'id':_0x2ce75b[_0x2adb('0x4b')]['id']},'attributes':[_0x2adb('0x4f'),'loginLogo',_0x2adb('0x54'),_0x2adb('0x55'),_0x2adb('0x56'),_0x2adb('0x57'),_0x2adb('0x58'),_0x2adb('0x59')],'raw':!![]});})['then'](handleEntityNotFound(_0x503861,null))[_0x2adb('0x19')](function(_0x5ca965){if(_0x5ca965){var _0x4d4e25=_0x5ca965[_0x2adb('0x4f')]&&fs['existsSync'](path[_0x2adb('0x5a')](config['root'],_0x5b0ebf,_['toLower'](_0x5ca965[_0x2adb('0x4f')])))?path[_0x2adb('0x5a')](config[_0x2adb('0x5b')],_0x5b0ebf,_[_0x2adb('0x5c')](_0x5ca965[_0x2adb('0x4f')])):path['join'](config[_0x2adb('0x5b')],_0x5b0ebf,_[_0x2adb('0x5c')]('default_logo.svg'));var _0x1884fb=_0x2adb('0x5d')+_[_0x2adb('0x5e')](_0x2adb('0x4f'));if(_0x5ca965[_0x1884fb]||!_0x60841a[_0x2adb('0x5f')]){_0x4d4e25=path[_0x2adb('0x5a')](config[_0x2adb('0x5b')],_0x5b0ebf,_['toLower'](_0x2adb('0x60')));}if(!fs[_0x2adb('0x61')](_0x4d4e25)){throw new db[(_0x2adb('0x62'))][(_0x2adb('0x63'))](_[_0x2adb('0x5e')]('logo')+_0x2adb('0x64'));}return _0x503861['download'](_0x4d4e25);}})[_0x2adb('0x49')](handleError(_0x503861,null));};var utilLicense=require(_0x2adb('0x13'));exports['getLogoLogin']=function(_0x5722bc,_0x7e5d9d,_0x185db0){var _0x40bb39='server/files/images/logos';var _0x217cc1={'custom':![]};return utilLicense['getLicense']()[_0x2adb('0x19')](function(_0x59b3d0){if(_0x59b3d0){_0x217cc1=_0x59b3d0;}return db[_0x2adb('0x33')][_0x2adb('0x4c')]({'where':{'id':_0x5722bc['params']['id']},'attributes':[_0x2adb('0x4f'),_0x2adb('0x65'),_0x2adb('0x54'),_0x2adb('0x55'),_0x2adb('0x56'),'defaultLoginLogo',_0x2adb('0x58'),'defaultFavicon'],'raw':!![]});})[_0x2adb('0x19')](handleEntityNotFound(_0x7e5d9d,null))['then'](function(_0x4c171e){if(_0x4c171e){var _0x2cfc59=_0x4c171e['loginLogo']&&fs['existsSync'](path[_0x2adb('0x5a')](config[_0x2adb('0x5b')],_0x40bb39,_[_0x2adb('0x5c')](_0x4c171e['loginLogo'])))?path[_0x2adb('0x5a')](config[_0x2adb('0x5b')],_0x40bb39,_[_0x2adb('0x5c')](_0x4c171e[_0x2adb('0x65')])):path['join'](config[_0x2adb('0x5b')],_0x40bb39,_[_0x2adb('0x5c')](_0x2adb('0x66')));var _0x248fa0=_0x2adb('0x5d')+_[_0x2adb('0x5e')](_0x2adb('0x65'));if(_0x4c171e[_0x248fa0]||!_0x217cc1[_0x2adb('0x5f')]){_0x2cfc59=path[_0x2adb('0x5a')](config['root'],_0x40bb39,_['toLower'](_0x2adb('0x66')));}if(!fs[_0x2adb('0x61')](_0x2cfc59)){throw new db[(_0x2adb('0x62'))]['ValidationError'](_[_0x2adb('0x5e')](_0x2adb('0x65'))+'\x20not\x20found');}return _0x7e5d9d['download'](_0x2cfc59);}})[_0x2adb('0x49')](handleError(_0x7e5d9d,null));};exports[_0x2adb('0x67')]=function(_0x1d3e3e,_0x36a7e5){return db[_0x2adb('0x33')]['find']({'where':{'id':_0x1d3e3e[_0x2adb('0x4b')]['id']},'attributes':[_0x2adb('0x68')]})[_0x2adb('0x19')](respondWithResult(_0x36a7e5,null))[_0x2adb('0x49')](handleError(_0x36a7e5,null));};exports['addPreferred']=function(_0x5a1031,_0x306406,_0x372862){if(_0x5a1031[_0x2adb('0x4e')]&&_0x5a1031['file'][_0x2adb('0x50')]){_0x5a1031[_0x2adb('0x4d')][_0x2adb('0x54')]=_0x5a1031['file'][_0x2adb('0x50')];}return db[_0x2adb('0x33')][_0x2adb('0x4c')]({'where':{'id':_0x5a1031[_0x2adb('0x4b')]['id']}})[_0x2adb('0x19')](handleEntityNotFound(_0x306406,null))[_0x2adb('0x19')](saveUpdates(_0x5a1031['body'],null))[_0x2adb('0x19')](respondWithResult(_0x306406,null))['catch'](handleError(_0x306406,null));};var utilLicense=require(_0x2adb('0x13'));exports[_0x2adb('0x69')]=function(_0x36f033,_0x918924,_0x4d06f7){var _0x43315f='server/files/images/logos';var _0x449131={'custom':![]};return utilLicense['getLicense']()[_0x2adb('0x19')](function(_0x5056df){if(_0x5056df){_0x449131=_0x5056df;}return db[_0x2adb('0x33')][_0x2adb('0x4c')]({'where':{'id':_0x36f033[_0x2adb('0x4b')]['id']},'attributes':[_0x2adb('0x4f'),'loginLogo',_0x2adb('0x54'),_0x2adb('0x55'),'defaultLogo',_0x2adb('0x57'),_0x2adb('0x58'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x918924,null))['then'](function(_0x3ec4ab){if(_0x3ec4ab){var _0x1f7dd5=_0x3ec4ab['preferred']&&fs[_0x2adb('0x61')](path[_0x2adb('0x5a')](config[_0x2adb('0x5b')],_0x43315f,_[_0x2adb('0x5c')](_0x3ec4ab[_0x2adb('0x54')])))?path[_0x2adb('0x5a')](config[_0x2adb('0x5b')],_0x43315f,_[_0x2adb('0x5c')](_0x3ec4ab[_0x2adb('0x54')])):path[_0x2adb('0x5a')](config[_0x2adb('0x5b')],_0x43315f,_[_0x2adb('0x5c')](_0x2adb('0x6a')));var _0x57a1c6=_0x2adb('0x5d')+_['upperFirst'](_0x2adb('0x54'));if(_0x3ec4ab[_0x57a1c6]||!_0x449131[_0x2adb('0x5f')]||!_0x449131[_0x2adb('0x54')]){_0x1f7dd5=path[_0x2adb('0x5a')](config[_0x2adb('0x5b')],_0x43315f,_[_0x2adb('0x5c')]('default_preferred.png'));}if(!fs[_0x2adb('0x61')](_0x1f7dd5)){throw new db['Sequelize'][(_0x2adb('0x63'))](_[_0x2adb('0x5e')](_0x2adb('0x54'))+_0x2adb('0x64'));}return _0x918924[_0x2adb('0x6b')](_0x1f7dd5);}})[_0x2adb('0x49')](handleError(_0x918924,null));};exports[_0x2adb('0x6c')]=function(_0x2c79c2,_0x1c5fd3,_0x2288a9){if(_0x2c79c2[_0x2adb('0x4e')]&&_0x2c79c2[_0x2adb('0x4e')][_0x2adb('0x50')]){_0x2c79c2[_0x2adb('0x4d')][_0x2adb('0x55')]=_0x2c79c2[_0x2adb('0x4e')][_0x2adb('0x50')];}return db[_0x2adb('0x33')][_0x2adb('0x4c')]({'where':{'id':_0x2c79c2[_0x2adb('0x4b')]['id']}})[_0x2adb('0x19')](handleEntityNotFound(_0x1c5fd3,null))[_0x2adb('0x19')](saveUpdates(_0x2c79c2[_0x2adb('0x4d')],null))['then'](respondWithResult(_0x1c5fd3,null))['catch'](handleError(_0x1c5fd3,null));};var utilLicense=require(_0x2adb('0x13'));exports[_0x2adb('0x6d')]=function(_0x2db017,_0x4ef3ea,_0x452f6c){var _0xdb7307='server/files/images/logos';var _0x320fb2={'custom':![]};return utilLicense['getLicense']()[_0x2adb('0x19')](function(_0x4f6c83){if(_0x4f6c83){_0x320fb2=_0x4f6c83;}return db[_0x2adb('0x33')][_0x2adb('0x4c')]({'where':{'id':_0x2db017[_0x2adb('0x4b')]['id']},'attributes':[_0x2adb('0x4f'),'loginLogo',_0x2adb('0x54'),_0x2adb('0x55'),_0x2adb('0x56'),_0x2adb('0x57'),_0x2adb('0x58'),_0x2adb('0x59')],'raw':!![]});})['then'](handleEntityNotFound(_0x4ef3ea,null))[_0x2adb('0x19')](function(_0x268c16){if(_0x268c16){var _0x4d6d2f=_0x268c16[_0x2adb('0x55')]&&fs['existsSync'](path['join'](config['root'],_0xdb7307,_['toLower'](_0x268c16['favicon'])))?path[_0x2adb('0x5a')](config['root'],_0xdb7307,_[_0x2adb('0x5c')](_0x268c16['favicon'])):path[_0x2adb('0x5a')](config[_0x2adb('0x5b')],_0xdb7307,_[_0x2adb('0x5c')]('default_favicon.ico'));var _0x4ec04f=_0x2adb('0x5d')+_['upperFirst'](_0x2adb('0x55'));if(_0x268c16[_0x4ec04f]||!_0x320fb2[_0x2adb('0x5f')]){_0x4d6d2f=path[_0x2adb('0x5a')](config[_0x2adb('0x5b')],_0xdb7307,_[_0x2adb('0x5c')](_0x2adb('0x6e')));}if(!fs['existsSync'](_0x4d6d2f)){throw new db[(_0x2adb('0x62'))][(_0x2adb('0x63'))](_[_0x2adb('0x5e')](_0x2adb('0x55'))+_0x2adb('0x64'));}return _0x4ef3ea[_0x2adb('0x6b')](_0x4d6d2f);}})[_0x2adb('0x49')](handleError(_0x4ef3ea,null));};exports[_0x2adb('0x6f')]=function(_0x52622a,_0x3773a5){var _0x49c23d={'offset':moment()[_0x2adb('0x70')]()};_0x49c23d[_0x2adb('0x71')]=moment()['utcOffset'](_0x49c23d[_0x2adb('0x26')])[_0x2adb('0x72')](_0x2adb('0x73'));return _0x3773a5['status'](0xc8)[_0x2adb('0x31')](_0x49c23d);}; \ No newline at end of file +var _0x394f=['default','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','../../config/license/util','getLogoLogin','server/files/images/logos','default_loginLogo.svg','download','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','send','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','jayson/promise','client','request','then','info','Setting,\x20%s,\x20%s','debug','stringify','error','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','stack','name','map','Setting','fieldName','type','key','model','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','options','includeAll','findAll','rows','show','intersection','length','include','body','find','params','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','toLower','root','default_logo.svg'];(function(_0x125dfa,_0x2cace0){var _0x2ded9b=function(_0x44a2ad){while(--_0x44a2ad){_0x125dfa['push'](_0x125dfa['shift']());}};_0x2ded9b(++_0x2cace0);}(_0x394f,0x8f));var _0xf394=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x394f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xf394('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf394('0x1'));var jsonpatch=require(_0xf394('0x2'));var rp=require(_0xf394('0x3'));var moment=require(_0xf394('0x4'));var BPromise=require(_0xf394('0x5'));var Mustache=require(_0xf394('0x6'));var util=require(_0xf394('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(_0xf394('0x8'));var squel=require(_0xf394('0x9'));var crypto=require(_0xf394('0xa'));var jsforce=require(_0xf394('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf394('0xc'));var Redis=require(_0xf394('0xd'));var authService=require(_0xf394('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xf394('0xf'));var hardwareService=require(_0xf394('0x10'));var logger=require('../../config/logger')(_0xf394('0x11'));var utils=require(_0xf394('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf394('0x13'))['db'];var jayson=require(_0xf394('0x14'));var client=jayson[_0xf394('0x15')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2668ce,_0x509d8a,_0x5eb3a2,_0x457117){return new BPromise(function(_0x56bfa0,_0xad56c9){var _0x25c4cd=_0x457117||client;return _0x25c4cd[_0xf394('0x16')](_0x2668ce,_0x5eb3a2)[_0xf394('0x17')](function(_0x2374a9){logger[_0xf394('0x18')](_0xf394('0x19'),_0x509d8a,'request\x20sent');logger[_0xf394('0x1a')]('Setting,\x20%s,\x20%s,\x20%s',_0x509d8a,'request\x20sent',JSON[_0xf394('0x1b')](_0x2374a9));if(_0x2374a9[_0xf394('0x1c')]){if(_0x2374a9[_0xf394('0x1c')]['code']===0x1f4){logger[_0xf394('0x1c')]('Setting,\x20%s,\x20%s',_0x509d8a,_0x2374a9[_0xf394('0x1c')]['message']);return _0xad56c9(_0x2374a9['error'][_0xf394('0x1d')]);}logger[_0xf394('0x1c')](_0xf394('0x19'),_0x509d8a,_0x2374a9['error'][_0xf394('0x1d')]);return _0x56bfa0(_0x2374a9[_0xf394('0x1c')][_0xf394('0x1d')]);}else{logger[_0xf394('0x18')](_0xf394('0x19'),_0x509d8a,'request\x20sent');_0x56bfa0(_0x2374a9['result'][_0xf394('0x1d')]);}})[_0xf394('0x1e')](function(_0x4a59bf){logger[_0xf394('0x1c')](_0xf394('0x19'),_0x509d8a,_0x4a59bf);_0xad56c9(_0x4a59bf);});});}function respondWithStatusCode(_0x310157,_0xf2985e){_0xf2985e=_0xf2985e||0xcc;return function(_0x4abe18){if(_0x4abe18){return _0x310157[_0xf394('0x1f')](_0xf2985e);}return _0x310157[_0xf394('0x20')](_0xf2985e)[_0xf394('0x21')]();};}function respondWithResult(_0x13797a,_0x2a30b6){_0x2a30b6=_0x2a30b6||0xc8;return function(_0x4fc8f8){if(_0x4fc8f8){return _0x13797a[_0xf394('0x20')](_0x2a30b6)[_0xf394('0x22')](_0x4fc8f8);}};}function respondWithFilteredResult(_0x593277,_0x1bf372){return function(_0x2e4cba){if(_0x2e4cba){var _0x53e2fc=typeof _0x1bf372[_0xf394('0x23')]===_0xf394('0x24')&&typeof _0x1bf372[_0xf394('0x25')]===_0xf394('0x24');var _0x229c8c=_0x2e4cba[_0xf394('0x26')];var _0x294a3c=_0x53e2fc?0x0:_0x1bf372[_0xf394('0x23')];var _0x224aa2=_0x53e2fc?_0x2e4cba['count']:_0x1bf372[_0xf394('0x23')]+_0x1bf372[_0xf394('0x25')];var _0x205d40;if(_0x224aa2>=_0x229c8c){_0x224aa2=_0x229c8c;_0x205d40=0xc8;}else{_0x205d40=0xce;}_0x593277['status'](_0x205d40);return _0x593277[_0xf394('0x27')](_0xf394('0x28'),_0x294a3c+'-'+_0x224aa2+'/'+_0x229c8c)['json'](_0x2e4cba);}return null;};}function patchUpdates(_0x21f5f8){return function(_0x264f94){try{jsonpatch[_0xf394('0x29')](_0x264f94,_0x21f5f8,!![]);}catch(_0xfe7df2){return BPromise[_0xf394('0x2a')](_0xfe7df2);}return _0x264f94['save']();};}function saveUpdates(_0x438a95,_0x5d5aa1){return function(_0x2e7382){if(_0x2e7382){return _0x2e7382[_0xf394('0x2b')](_0x438a95)[_0xf394('0x17')](function(_0x5ab843){return _0x5ab843;});}return null;};}function removeEntity(_0x3f6b47,_0x3e8d6a){return function(_0x3f3660){if(_0x3f3660){return _0x3f3660[_0xf394('0x2c')]()[_0xf394('0x17')](function(){_0x3f6b47['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1acba6,_0x3e7fd1){return function(_0x250520){if(!_0x250520){_0x1acba6[_0xf394('0x1f')](0x194);}return _0x250520;};}function handleError(_0x1fdec7,_0x94adf9){_0x94adf9=_0x94adf9||0x1f4;return function(_0x5c1686){logger[_0xf394('0x1c')](_0x5c1686[_0xf394('0x2d')]);if(_0x5c1686[_0xf394('0x2e')]){delete _0x5c1686[_0xf394('0x2e')];}_0x1fdec7[_0xf394('0x20')](_0x94adf9)['send'](_0x5c1686);};}exports['index']=function(_0x2267d1,_0x5dfb96){var _0x1c6be2={},_0x98796b={},_0x221184={'count':0x0,'rows':[]};var _0x4186d9=_[_0xf394('0x2f')](db[_0xf394('0x30')]['rawAttributes'],function(_0x1f3e97){return{'name':_0x1f3e97[_0xf394('0x31')],'type':_0x1f3e97[_0xf394('0x32')][_0xf394('0x33')]};});_0x98796b[_0xf394('0x34')]=_[_0xf394('0x2f')](_0x4186d9,_0xf394('0x2e'));_0x98796b[_0xf394('0x35')]=_[_0xf394('0x36')](_0x2267d1['query']);_0x98796b[_0xf394('0x37')]=_['intersection'](_0x98796b[_0xf394('0x34')],_0x98796b[_0xf394('0x35')]);_0x1c6be2['attributes']=_['intersection'](_0x98796b[_0xf394('0x34')],qs[_0xf394('0x38')](_0x2267d1[_0xf394('0x35')][_0xf394('0x38')]));_0x1c6be2[_0xf394('0x39')]=_0x1c6be2[_0xf394('0x39')]['length']?_0x1c6be2[_0xf394('0x39')]:_0x98796b['model'];if(!_0x2267d1[_0xf394('0x35')][_0xf394('0x3a')](_0xf394('0x3b'))){_0x1c6be2[_0xf394('0x25')]=qs[_0xf394('0x25')](_0x2267d1['query']['limit']);_0x1c6be2[_0xf394('0x23')]=qs[_0xf394('0x23')](_0x2267d1[_0xf394('0x35')]['offset']);}_0x1c6be2[_0xf394('0x3c')]=qs[_0xf394('0x3d')](_0x2267d1['query'][_0xf394('0x3d')]);_0x1c6be2['where']=qs[_0xf394('0x37')](_['pick'](_0x2267d1[_0xf394('0x35')],_0x98796b['filters']),_0x4186d9);if(_0x2267d1['query'][_0xf394('0x3e')]){_0x1c6be2['where']=_[_0xf394('0x3f')](_0x1c6be2[_0xf394('0x40')],{'$or':_[_0xf394('0x2f')](_0x4186d9,function(_0xc77d2d){if(_0xc77d2d[_0xf394('0x32')]!==_0xf394('0x41')){var _0x18e73e={};_0x18e73e[_0xc77d2d[_0xf394('0x2e')]]={'$like':'%'+_0x2267d1[_0xf394('0x35')][_0xf394('0x3e')]+'%'};return _0x18e73e;}})});}_0x1c6be2=_[_0xf394('0x3f')]({},_0x1c6be2,_0x2267d1[_0xf394('0x42')]);var _0x51c719={'where':_0x1c6be2[_0xf394('0x40')]};return db['Setting'][_0xf394('0x26')](_0x51c719)['then'](function(_0x2736a3){_0x221184['count']=_0x2736a3;if(_0x2267d1['query'][_0xf394('0x43')]){_0x1c6be2['include']=[{'all':!![]}];}return db[_0xf394('0x30')][_0xf394('0x44')](_0x1c6be2);})[_0xf394('0x17')](function(_0x17e537){_0x221184[_0xf394('0x45')]=_0x17e537;return _0x221184;})[_0xf394('0x17')](respondWithFilteredResult(_0x5dfb96,_0x1c6be2))[_0xf394('0x1e')](handleError(_0x5dfb96,null));};exports[_0xf394('0x46')]=function(_0x29c23d,_0x3f6c62){var _0x9a8862={'raw':![],'where':{'id':_0x29c23d['params']['id']}},_0x42f1ba={};_0x42f1ba[_0xf394('0x34')]=_['keys'](db['Setting']['rawAttributes']);_0x42f1ba['query']=_[_0xf394('0x36')](_0x29c23d[_0xf394('0x35')]);_0x42f1ba['filters']=_[_0xf394('0x47')](_0x42f1ba[_0xf394('0x34')],_0x42f1ba[_0xf394('0x35')]);_0x9a8862['attributes']=_[_0xf394('0x47')](_0x42f1ba[_0xf394('0x34')],qs[_0xf394('0x38')](_0x29c23d[_0xf394('0x35')]['fields']));_0x9a8862[_0xf394('0x39')]=_0x9a8862['attributes'][_0xf394('0x48')]?_0x9a8862[_0xf394('0x39')]:_0x42f1ba['model'];if(_0x29c23d['query'][_0xf394('0x43')]){_0x9a8862[_0xf394('0x49')]=[{'all':!![]}];}_0x9a8862=_['merge']({},_0x9a8862,_0x29c23d[_0xf394('0x42')]);return db[_0xf394('0x30')]['find'](_0x9a8862)[_0xf394('0x17')](handleEntityNotFound(_0x3f6c62,null))[_0xf394('0x17')](respondWithResult(_0x3f6c62,null))['catch'](handleError(_0x3f6c62,null));};exports[_0xf394('0x2b')]=function(_0x3ce93b,_0x36a33e){if(_0x3ce93b['body']['id']){delete _0x3ce93b[_0xf394('0x4a')]['id'];}return db[_0xf394('0x30')][_0xf394('0x4b')]({'where':{'id':_0x3ce93b[_0xf394('0x4c')]['id']}})['then'](handleEntityNotFound(_0x36a33e,null))['then'](saveUpdates(_0x3ce93b[_0xf394('0x4a')],null))[_0xf394('0x17')](respondWithResult(_0x36a33e,null))['catch'](handleError(_0x36a33e,null));};exports[_0xf394('0x4d')]=function(_0x486fe1,_0xcfbf09,_0x3073b4){if(_0x486fe1[_0xf394('0x4e')]&&_0x486fe1[_0xf394('0x4e')][_0xf394('0x4f')]){_0x486fe1['body'][_0xf394('0x50')]=_0x486fe1[_0xf394('0x4e')][_0xf394('0x4f')];}return db['Setting'][_0xf394('0x4b')]({'where':{'id':_0x486fe1[_0xf394('0x4c')]['id']}})[_0xf394('0x17')](handleEntityNotFound(_0xcfbf09,null))[_0xf394('0x17')](saveUpdates(_0x486fe1[_0xf394('0x4a')],null))[_0xf394('0x17')](respondWithResult(_0xcfbf09,null))[_0xf394('0x1e')](handleError(_0xcfbf09,null));};exports[_0xf394('0x51')]=function(_0x1b3c8b,_0x37019e,_0x4641f9){if(_0x1b3c8b[_0xf394('0x4e')]&&_0x1b3c8b[_0xf394('0x4e')][_0xf394('0x4f')]){_0x1b3c8b[_0xf394('0x4a')][_0xf394('0x52')]=_0x1b3c8b['file'][_0xf394('0x4f')];}return db['Setting'][_0xf394('0x4b')]({'where':{'id':_0x1b3c8b[_0xf394('0x4c')]['id']}})['then'](handleEntityNotFound(_0x37019e,null))['then'](saveUpdates(_0x1b3c8b[_0xf394('0x4a')],null))[_0xf394('0x17')](respondWithResult(_0x37019e,null))['catch'](handleError(_0x37019e,null));};var utilLicense=require('../../config/license/util');exports['getLogo']=function(_0x1b8cd2,_0x15050b,_0x5c83d8){var _0x4cb2ff='server/files/images/logos';var _0x2c2a02={'custom':![]};return utilLicense[_0xf394('0x53')]()[_0xf394('0x17')](function(_0x1b4091){if(_0x1b4091){_0x2c2a02=_0x1b4091;}return db[_0xf394('0x30')]['find']({'where':{'id':_0x1b8cd2[_0xf394('0x4c')]['id']},'attributes':[_0xf394('0x50'),'loginLogo',_0xf394('0x54'),_0xf394('0x55'),_0xf394('0x56'),_0xf394('0x57'),_0xf394('0x58'),_0xf394('0x59')],'raw':!![]});})[_0xf394('0x17')](handleEntityNotFound(_0x15050b,null))[_0xf394('0x17')](function(_0x232c52){if(_0x232c52){var _0x2bf8e0=_0x232c52[_0xf394('0x50')]&&fs[_0xf394('0x5a')](path[_0xf394('0x5b')](config['root'],_0x4cb2ff,_[_0xf394('0x5c')](_0x232c52['logo'])))?path['join'](config['root'],_0x4cb2ff,_[_0xf394('0x5c')](_0x232c52[_0xf394('0x50')])):path[_0xf394('0x5b')](config[_0xf394('0x5d')],_0x4cb2ff,_[_0xf394('0x5c')](_0xf394('0x5e')));var _0xaf657d=_0xf394('0x5f')+_[_0xf394('0x60')]('logo');if(_0x232c52[_0xaf657d]||!_0x2c2a02[_0xf394('0x61')]){_0x2bf8e0=path['join'](config['root'],_0x4cb2ff,_[_0xf394('0x5c')](_0xf394('0x5e')));}if(!fs['existsSync'](_0x2bf8e0)){throw new db[(_0xf394('0x62'))][(_0xf394('0x63'))](_[_0xf394('0x60')](_0xf394('0x50'))+_0xf394('0x64'));}return _0x15050b['download'](_0x2bf8e0);}})['catch'](handleError(_0x15050b,null));};var utilLicense=require(_0xf394('0x65'));exports[_0xf394('0x66')]=function(_0x1a6c6c,_0x2d1aa9,_0x3a59d0){var _0x20d088=_0xf394('0x67');var _0x357e5f={'custom':![]};return utilLicense[_0xf394('0x53')]()[_0xf394('0x17')](function(_0x2d7417){if(_0x2d7417){_0x357e5f=_0x2d7417;}return db[_0xf394('0x30')][_0xf394('0x4b')]({'where':{'id':_0x1a6c6c[_0xf394('0x4c')]['id']},'attributes':[_0xf394('0x50'),'loginLogo','preferred','favicon','defaultLogo',_0xf394('0x57'),'defaultPreferred',_0xf394('0x59')],'raw':!![]});})[_0xf394('0x17')](handleEntityNotFound(_0x2d1aa9,null))[_0xf394('0x17')](function(_0x20ddf3){if(_0x20ddf3){var _0xf64963=_0x20ddf3['loginLogo']&&fs[_0xf394('0x5a')](path[_0xf394('0x5b')](config['root'],_0x20d088,_[_0xf394('0x5c')](_0x20ddf3[_0xf394('0x52')])))?path[_0xf394('0x5b')](config[_0xf394('0x5d')],_0x20d088,_[_0xf394('0x5c')](_0x20ddf3[_0xf394('0x52')])):path[_0xf394('0x5b')](config['root'],_0x20d088,_[_0xf394('0x5c')](_0xf394('0x68')));var _0x4cae1a=_0xf394('0x5f')+_[_0xf394('0x60')]('loginLogo');if(_0x20ddf3[_0x4cae1a]||!_0x357e5f['custom']){_0xf64963=path[_0xf394('0x5b')](config[_0xf394('0x5d')],_0x20d088,_[_0xf394('0x5c')](_0xf394('0x68')));}if(!fs[_0xf394('0x5a')](_0xf64963)){throw new db[(_0xf394('0x62'))]['ValidationError'](_[_0xf394('0x60')](_0xf394('0x52'))+'\x20not\x20found');}return _0x2d1aa9[_0xf394('0x69')](_0xf64963);}})[_0xf394('0x1e')](handleError(_0x2d1aa9,null));};exports[_0xf394('0x6a')]=function(_0x200738,_0x59fcba){return db[_0xf394('0x30')][_0xf394('0x4b')]({'where':{'id':_0x200738[_0xf394('0x4c')]['id']},'attributes':[_0xf394('0x6b')]})[_0xf394('0x17')](respondWithResult(_0x59fcba,null))[_0xf394('0x1e')](handleError(_0x59fcba,null));};exports[_0xf394('0x6c')]=function(_0x4d94a5,_0x4e4de7,_0x89ecc2){if(_0x4d94a5['file']&&_0x4d94a5[_0xf394('0x4e')][_0xf394('0x4f')]){_0x4d94a5['body'][_0xf394('0x54')]=_0x4d94a5['file'][_0xf394('0x4f')];}return db[_0xf394('0x30')][_0xf394('0x4b')]({'where':{'id':_0x4d94a5[_0xf394('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4e4de7,null))[_0xf394('0x17')](saveUpdates(_0x4d94a5[_0xf394('0x4a')],null))[_0xf394('0x17')](respondWithResult(_0x4e4de7,null))[_0xf394('0x1e')](handleError(_0x4e4de7,null));};var utilLicense=require(_0xf394('0x65'));exports[_0xf394('0x6d')]=function(_0x30a56e,_0x33c725,_0x4a2bb9){var _0x2d1932='server/files/images/logos';var _0x49f612={'custom':![]};return utilLicense['getLicense']()[_0xf394('0x17')](function(_0x56680b){if(_0x56680b){_0x49f612=_0x56680b;}return db[_0xf394('0x30')][_0xf394('0x4b')]({'where':{'id':_0x30a56e[_0xf394('0x4c')]['id']},'attributes':['logo','loginLogo',_0xf394('0x54'),_0xf394('0x55'),_0xf394('0x56'),'defaultLoginLogo',_0xf394('0x58'),_0xf394('0x59')],'raw':!![]});})[_0xf394('0x17')](handleEntityNotFound(_0x33c725,null))['then'](function(_0x1344a5){if(_0x1344a5){var _0x2a1c7b=_0x1344a5[_0xf394('0x54')]&&fs[_0xf394('0x5a')](path[_0xf394('0x5b')](config[_0xf394('0x5d')],_0x2d1932,_[_0xf394('0x5c')](_0x1344a5[_0xf394('0x54')])))?path[_0xf394('0x5b')](config[_0xf394('0x5d')],_0x2d1932,_[_0xf394('0x5c')](_0x1344a5['preferred'])):path[_0xf394('0x5b')](config[_0xf394('0x5d')],_0x2d1932,_['toLower'](_0xf394('0x6e')));var _0xe101d2='default'+_['upperFirst'](_0xf394('0x54'));if(_0x1344a5[_0xe101d2]||!_0x49f612[_0xf394('0x61')]||!_0x49f612[_0xf394('0x54')]){_0x2a1c7b=path['join'](config[_0xf394('0x5d')],_0x2d1932,_['toLower'](_0xf394('0x6e')));}if(!fs[_0xf394('0x5a')](_0x2a1c7b)){throw new db[(_0xf394('0x62'))][(_0xf394('0x63'))](_[_0xf394('0x60')](_0xf394('0x54'))+_0xf394('0x64'));}return _0x33c725[_0xf394('0x69')](_0x2a1c7b);}})[_0xf394('0x1e')](handleError(_0x33c725,null));};exports[_0xf394('0x6f')]=function(_0x1f78e8,_0x26b5dc,_0x1444e1){if(_0x1f78e8[_0xf394('0x4e')]&&_0x1f78e8[_0xf394('0x4e')][_0xf394('0x4f')]){_0x1f78e8[_0xf394('0x4a')]['favicon']=_0x1f78e8['file'][_0xf394('0x4f')];}return db['Setting']['find']({'where':{'id':_0x1f78e8['params']['id']}})[_0xf394('0x17')](handleEntityNotFound(_0x26b5dc,null))[_0xf394('0x17')](saveUpdates(_0x1f78e8[_0xf394('0x4a')],null))['then'](respondWithResult(_0x26b5dc,null))['catch'](handleError(_0x26b5dc,null));};var utilLicense=require(_0xf394('0x65'));exports[_0xf394('0x70')]=function(_0x364f32,_0x327b7e,_0x48faac){var _0x482008=_0xf394('0x67');var _0x5cd1a6={'custom':![]};return utilLicense['getLicense']()[_0xf394('0x17')](function(_0x5db4f3){if(_0x5db4f3){_0x5cd1a6=_0x5db4f3;}return db[_0xf394('0x30')][_0xf394('0x4b')]({'where':{'id':_0x364f32[_0xf394('0x4c')]['id']},'attributes':[_0xf394('0x50'),_0xf394('0x52'),_0xf394('0x54'),_0xf394('0x55'),_0xf394('0x56'),'defaultLoginLogo',_0xf394('0x58'),_0xf394('0x59')],'raw':!![]});})[_0xf394('0x17')](handleEntityNotFound(_0x327b7e,null))['then'](function(_0x963d9e){if(_0x963d9e){var _0x488da4=_0x963d9e[_0xf394('0x55')]&&fs[_0xf394('0x5a')](path[_0xf394('0x5b')](config['root'],_0x482008,_[_0xf394('0x5c')](_0x963d9e[_0xf394('0x55')])))?path[_0xf394('0x5b')](config[_0xf394('0x5d')],_0x482008,_[_0xf394('0x5c')](_0x963d9e[_0xf394('0x55')])):path['join'](config['root'],_0x482008,_[_0xf394('0x5c')]('default_favicon.ico'));var _0x40d161=_0xf394('0x5f')+_[_0xf394('0x60')]('favicon');if(_0x963d9e[_0x40d161]||!_0x5cd1a6[_0xf394('0x61')]){_0x488da4=path[_0xf394('0x5b')](config[_0xf394('0x5d')],_0x482008,_['toLower'](_0xf394('0x71')));}if(!fs[_0xf394('0x5a')](_0x488da4)){throw new db['Sequelize'][(_0xf394('0x63'))](_[_0xf394('0x60')](_0xf394('0x55'))+_0xf394('0x64'));}return _0x327b7e[_0xf394('0x69')](_0x488da4);}})[_0xf394('0x1e')](handleError(_0x327b7e,null));};exports[_0xf394('0x72')]=function(_0xb0e659,_0x281380){var _0x5ab54d={'offset':moment()[_0xf394('0x73')]()};_0x5ab54d[_0xf394('0x74')]=moment()[_0xf394('0x73')](_0x5ab54d['offset'])[_0xf394('0x75')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x281380[_0xf394('0x20')](0xc8)[_0xf394('0x76')](_0x5ab54d);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 283201e..7075ca4 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 _0x34e8=['settings','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports','Setting'];(function(_0x4e09bf,_0x4c9811){var _0x2dba97=function(_0x57c815){while(--_0x57c815){_0x4e09bf['push'](_0x4e09bf['shift']());}};_0x2dba97(++_0x4c9811);}(_0x34e8,0x12c));var _0x834e=function(_0xe9a9c4,_0x3feab9){_0xe9a9c4=_0xe9a9c4-0x0;var _0x379685=_0x34e8[_0xe9a9c4];return _0x379685;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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':'settings','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 3311445..7888fa7 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 _0xb79e=['stringify','error','message','result','catch','find','options','raw','where','attributes','include','model','ShowSetting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xb79e,0xc7));var _0xeb79=function(_0x2c8265,_0xe3a3ba){_0x2c8265=_0x2c8265-0x0;var _0x59b2d5=_0xb79e[_0x2c8265];return _0x59b2d5;};'use strict';var _=require(_0xeb79('0x0'));var util=require('util');var moment=require(_0xeb79('0x1'));var BPromise=require(_0xeb79('0x2'));var rs=require(_0xeb79('0x3'));var fs=require('fs');var Redis=require(_0xeb79('0x4'));var db=require(_0xeb79('0x5'))['db'];var utils=require(_0xeb79('0x6'));var logger=require(_0xeb79('0x7'))(_0xeb79('0x8'));var config=require('../../config/environment');var jayson=require(_0xeb79('0x9'));var client=jayson[_0xeb79('0xa')][_0xeb79('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ad539,_0x426666,_0x3323a6){return new BPromise(function(_0x2d372c,_0x514523){return client['request'](_0x4ad539,_0x3323a6)[_0xeb79('0xc')](function(_0x20bb97){logger[_0xeb79('0xd')](_0xeb79('0xe'),_0x426666,_0xeb79('0xf'));logger[_0xeb79('0x10')](_0xeb79('0x11'),_0x426666,'request\x20sent',JSON[_0xeb79('0x12')](_0x20bb97));if(_0x20bb97[_0xeb79('0x13')]){if(_0x20bb97['error']['code']===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0x426666,_0x20bb97['error'][_0xeb79('0x14')]);return _0x514523(_0x20bb97[_0xeb79('0x13')][_0xeb79('0x14')]);}logger[_0xeb79('0x13')](_0xeb79('0xe'),_0x426666,_0x20bb97[_0xeb79('0x13')][_0xeb79('0x14')]);return _0x2d372c(_0x20bb97[_0xeb79('0x13')][_0xeb79('0x14')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x426666,'request\x20sent');_0x2d372c(_0x20bb97[_0xeb79('0x15')][_0xeb79('0x14')]);}})[_0xeb79('0x16')](function(_0x175eb1){logger[_0xeb79('0x13')](_0xeb79('0xe'),_0x426666,_0x175eb1);_0x514523(_0x175eb1);});});}exports['ShowSetting']=function(_0x107d03){var _0x4c0632=this;return new Promise(function(_0xe12989,_0xc5d8d9){return db['Setting'][_0xeb79('0x17')]({'raw':_0x107d03[_0xeb79('0x18')]?_0x107d03[_0xeb79('0x18')][_0xeb79('0x19')]===undefined?!![]:![]:!![],'where':_0x107d03[_0xeb79('0x18')]?_0x107d03[_0xeb79('0x18')][_0xeb79('0x1a')]||null:null,'attributes':_0x107d03[_0xeb79('0x18')]?_0x107d03[_0xeb79('0x18')][_0xeb79('0x1b')]||null:null,'include':_0x107d03[_0xeb79('0x18')]?_0x107d03[_0xeb79('0x18')][_0xeb79('0x1c')]?_['map'](_0x107d03['options'][_0xeb79('0x1c')],function(_0x2629d1){return{'model':db[_0x2629d1[_0xeb79('0x1d')]],'as':_0x2629d1['as'],'attributes':_0x2629d1[_0xeb79('0x1b')],'include':_0x2629d1['include']?_['map'](_0x2629d1[_0xeb79('0x1c')],function(_0x392ca4){return{'model':db[_0x392ca4[_0xeb79('0x1d')]],'as':_0x392ca4['as'],'attributes':_0x392ca4[_0xeb79('0x1b')],'include':_0x392ca4['include']?_['map'](_0x392ca4[_0xeb79('0x1c')],function(_0x5e6744){return{'model':db[_0x5e6744[_0xeb79('0x1d')]],'as':_0x5e6744['as'],'attributes':_0x5e6744['attributes']};}):[]};}):[]};}):[]:[]})[_0xeb79('0xc')](function(_0x1bb29f){logger[_0xeb79('0xd')](_0xeb79('0x1e'),_0x107d03);logger['debug'](_0xeb79('0x1e'),_0x107d03,JSON[_0xeb79('0x12')](_0x1bb29f));_0xe12989(_0x1bb29f);})['catch'](function(_0x3b28eb){logger[_0xeb79('0x13')](_0xeb79('0x1e'),_0x3b28eb[_0xeb79('0x14')],_0x107d03);_0xc5d8d9(_0x4c0632[_0xeb79('0x13')](0x1f4,_0x3b28eb[_0xeb79('0x14')]));});});}; \ No newline at end of file +var _0x0512=['include','model','map','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','ShowSetting','Setting','options','raw','where','attributes'];(function(_0x58f5d5,_0x5fbadd){var _0xe138ae=function(_0x3f030a){while(--_0x3f030a){_0x58f5d5['push'](_0x58f5d5['shift']());}};_0xe138ae(++_0x5fbadd);}(_0x0512,0x1c3));var _0x2051=function(_0x4f667f,_0x26a037){_0x4f667f=_0x4f667f-0x0;var _0x2cfff0=_0x0512[_0x4f667f];return _0x2cfff0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2051('0x0'));var BPromise=require(_0x2051('0x1'));var rs=require(_0x2051('0x2'));var fs=require('fs');var Redis=require(_0x2051('0x3'));var db=require(_0x2051('0x4'))['db'];var utils=require(_0x2051('0x5'));var logger=require(_0x2051('0x6'))(_0x2051('0x7'));var config=require(_0x2051('0x8'));var jayson=require(_0x2051('0x9'));var client=jayson[_0x2051('0xa')][_0x2051('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39caf4,_0x39a8e4,_0x18d41c){return new BPromise(function(_0xa55dfa,_0x278e7a){return client[_0x2051('0xc')](_0x39caf4,_0x18d41c)[_0x2051('0xd')](function(_0x57c880){logger[_0x2051('0xe')](_0x2051('0xf'),_0x39a8e4,_0x2051('0x10'));logger[_0x2051('0x11')]('Setting,\x20%s,\x20%s,\x20%s',_0x39a8e4,_0x2051('0x10'),JSON[_0x2051('0x12')](_0x57c880));if(_0x57c880['error']){if(_0x57c880[_0x2051('0x13')][_0x2051('0x14')]===0x1f4){logger['error'](_0x2051('0xf'),_0x39a8e4,_0x57c880['error'][_0x2051('0x15')]);return _0x278e7a(_0x57c880[_0x2051('0x13')][_0x2051('0x15')]);}logger[_0x2051('0x13')](_0x2051('0xf'),_0x39a8e4,_0x57c880[_0x2051('0x13')][_0x2051('0x15')]);return _0xa55dfa(_0x57c880['error'][_0x2051('0x15')]);}else{logger[_0x2051('0xe')](_0x2051('0xf'),_0x39a8e4,_0x2051('0x10'));_0xa55dfa(_0x57c880['result'][_0x2051('0x15')]);}})[_0x2051('0x16')](function(_0x469e3a){logger[_0x2051('0x13')](_0x2051('0xf'),_0x39a8e4,_0x469e3a);_0x278e7a(_0x469e3a);});});}exports[_0x2051('0x17')]=function(_0x128eee){var _0x4b29bb=this;return new Promise(function(_0x52fd8c,_0x4fbb4c){return db[_0x2051('0x18')]['find']({'raw':_0x128eee[_0x2051('0x19')]?_0x128eee[_0x2051('0x19')][_0x2051('0x1a')]===undefined?!![]:![]:!![],'where':_0x128eee['options']?_0x128eee['options'][_0x2051('0x1b')]||null:null,'attributes':_0x128eee[_0x2051('0x19')]?_0x128eee[_0x2051('0x19')][_0x2051('0x1c')]||null:null,'include':_0x128eee['options']?_0x128eee['options'][_0x2051('0x1d')]?_['map'](_0x128eee[_0x2051('0x19')][_0x2051('0x1d')],function(_0x441dbf){return{'model':db[_0x441dbf[_0x2051('0x1e')]],'as':_0x441dbf['as'],'attributes':_0x441dbf[_0x2051('0x1c')],'include':_0x441dbf[_0x2051('0x1d')]?_['map'](_0x441dbf[_0x2051('0x1d')],function(_0x394ea2){return{'model':db[_0x394ea2[_0x2051('0x1e')]],'as':_0x394ea2['as'],'attributes':_0x394ea2[_0x2051('0x1c')],'include':_0x394ea2[_0x2051('0x1d')]?_[_0x2051('0x1f')](_0x394ea2[_0x2051('0x1d')],function(_0x2a4471){return{'model':db[_0x2a4471['model']],'as':_0x2a4471['as'],'attributes':_0x2a4471[_0x2051('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2051('0xd')](function(_0x25e529){logger[_0x2051('0xe')](_0x2051('0x17'),_0x128eee);logger[_0x2051('0x11')](_0x2051('0x17'),_0x128eee,JSON[_0x2051('0x12')](_0x25e529));_0x52fd8c(_0x25e529);})['catch'](function(_0x4e0d9d){logger[_0x2051('0x13')](_0x2051('0x17'),_0x4e0d9d[_0x2051('0x15')],_0x128eee);_0x4fbb4c(_0x4b29bb[_0x2051('0x13')](0x1f4,_0x4e0d9d[_0x2051('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index de1ae40..8c29ecc 100644 --- a/server/api/smsAccount/index.js +++ b/server/api/smsAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6aa7=['create','addDisposition','addAnswer','addApplications','/:id/send','send','status','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','/:id/users','getAgents','post'];(function(_0x547054,_0x1b4467){var _0x15c4ec=function(_0x3d8fb5){while(--_0x3d8fb5){_0x547054['push'](_0x547054['shift']());}};_0x15c4ec(++_0x1b4467);}(_0x6aa7,0x178));var _0x76aa=function(_0x45001f,_0x1c9ade){_0x45001f=_0x45001f-0x0;var _0x28d4c1=_0x6aa7[_0x45001f];return _0x28d4c1;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x76aa('0x5'));var interaction=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var controller=require('./smsAccount.controller');router['get']('/',auth[_0x76aa('0x8')](),controller['index']);router[_0x76aa('0x9')](_0x76aa('0xa'),auth[_0x76aa('0x8')](),controller['describe']);router[_0x76aa('0x9')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller['show']);router[_0x76aa('0x9')](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xd')]);router[_0x76aa('0x9')](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xf')]);router[_0x76aa('0x9')](_0x76aa('0x10'),auth['isAuthenticated'](),controller[_0x76aa('0x11')]);router['get'](_0x76aa('0x12'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x13')]);router[_0x76aa('0x9')](_0x76aa('0x14'),controller['statusGet']);router['get'](_0x76aa('0x15'),auth['isAuthenticated'](),controller[_0x76aa('0x16')]);router[_0x76aa('0x17')]('/',auth['isAuthenticated'](),controller[_0x76aa('0x18')]);router['post'](_0x76aa('0xc'),auth['isAuthenticated'](),controller[_0x76aa('0x19')]);router[_0x76aa('0x17')](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1a')]);router[_0x76aa('0x17')]('/:id/notify',controller['notify']);router[_0x76aa('0x17')](_0x76aa('0x10'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1b')]);router[_0x76aa('0x17')](_0x76aa('0x1c'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1d')]);router[_0x76aa('0x17')]('/:id/status',controller[_0x76aa('0x1e')]);router[_0x76aa('0x17')](_0x76aa('0x15'),auth['isAuthenticated'](),controller[_0x76aa('0x1f')]);router[_0x76aa('0x20')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x21')]);router[_0x76aa('0x22')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x23')]);router[_0x76aa('0x22')](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x24')]);router['delete'](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x25')]);router[_0x76aa('0x22')](_0x76aa('0x15'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x26')]);module[_0x76aa('0x27')]=router; \ No newline at end of file +var _0x1cb9=['/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/users','post','create','addAnswer','/:id/notify','notify','/:id/applications','/:id/send','/:id/status','status','addAgents','put','update','delete','destroy','removeDispositions','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1cb9,0x14e));var _0x91cb=function(_0x55066b,_0x42b3a2){_0x55066b=_0x55066b-0x0;var _0x33edd0=_0x1cb9[_0x55066b];return _0x33edd0;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0x8')](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x8')](_0x91cb('0x11'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x8')]('/:id/applications',auth[_0x91cb('0x9')](),controller[_0x91cb('0x13')]);router['get'](_0x91cb('0x14'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x15')]);router[_0x91cb('0x8')]('/:id/status',controller['statusGet']);router[_0x91cb('0x8')](_0x91cb('0x16'),auth['isAuthenticated'](),controller['getAgents']);router[_0x91cb('0x17')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x18')]);router['post'](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller['addDisposition']);router[_0x91cb('0x17')](_0x91cb('0x11'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x19')]);router['post'](_0x91cb('0x1a'),controller[_0x91cb('0x1b')]);router['post'](_0x91cb('0x1c'),auth['isAuthenticated'](),controller['addApplications']);router[_0x91cb('0x17')](_0x91cb('0x1d'),auth['isAuthenticated'](),controller['send']);router['post'](_0x91cb('0x1e'),controller[_0x91cb('0x1f')]);router[_0x91cb('0x17')](_0x91cb('0x16'),auth['isAuthenticated'](),controller[_0x91cb('0x20')]);router[_0x91cb('0x21')](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0x22')]);router[_0x91cb('0x23')](_0x91cb('0xd'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x24')]);router[_0x91cb('0x23')](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x25')]);router['delete']('/:id/canned_answers',auth[_0x91cb('0x9')](),controller['removeAnswers']);router[_0x91cb('0x23')](_0x91cb('0x16'),auth[_0x91cb('0x9')](),controller['removeAgents']);module[_0x91cb('0x26')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 61dd27a..de2da5e 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 _0x8f50=['twilio','skebby','connectel','clicksend','plivo','clickatell','bandwidth','infobip','ENUM','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate'];(function(_0x157298,_0x2f1dd2){var _0x43368c=function(_0x5848ff){while(--_0x5848ff){_0x157298['push'](_0x157298['shift']());}};_0x43368c(++_0x2f1dd2);}(_0x8f50,0xa2));var _0x08f5=function(_0xc333d2,_0x363281){_0xc333d2=_0xc333d2-0x0;var _0x321c95=_0x8f50[_0xc333d2];return _0x321c95;};'use strict';var Sequelize=require(_0x08f5('0x0'));var rs=require(_0x08f5('0x1'));module[_0x08f5('0x2')]={'name':{'type':Sequelize[_0x08f5('0x3')],'unique':_0x08f5('0x4'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x08f5('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x08f5('0x3')],'defaultValue':function(){return rs[_0x08f5('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x08f5('0x6'),_0x08f5('0x7'),_0x08f5('0x8'),_0x08f5('0x9'),_0x08f5('0xa'),_0x08f5('0xb'),_0x08f5('0xc'),'csc',_0x08f5('0xd'),'intelepeer')},'accountSid':{'type':Sequelize[_0x08f5('0x3')]},'authId':{'type':Sequelize[_0x08f5('0x3')]},'authToken':{'type':Sequelize[_0x08f5('0x3')]},'smsMethod':{'type':Sequelize[_0x08f5('0xe')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x08f5('0x3')]},'apiKey':{'type':Sequelize[_0x08f5('0x3')]},'applicationId':{'type':Sequelize[_0x08f5('0x3')]},'accountId':{'type':Sequelize[_0x08f5('0x3')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0x08f5('0xf')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x08f5('0x10')],'defaultValue':function(){return _0x08f5('0x11');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x08f5('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x08f5('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x08f5('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x08f5('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x08f5('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x08f5('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x08f5('0x12')],'comment':_0x08f5('0x13')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x08f5('0x14'),'set':function(_0x1d81f2){if(!_0x1d81f2)this[_0x08f5('0x15')](_0x08f5('0x16'),null);this[_0x08f5('0x15')](_0x08f5('0x17'),_0x1d81f2);}}}; \ No newline at end of file +var _0x1760=['setDataValue','mandatoryDisposition','randomstring','exports','name','STRING','twilio','skebby','connectel','plivo','clickatell','bandwidth','csc','infobip','intelepeer','ENUM','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId'];(function(_0x1ab495,_0x25af34){var _0x152da6=function(_0x6ec06e){while(--_0x6ec06e){_0x1ab495['push'](_0x1ab495['shift']());}};_0x152da6(++_0x25af34);}(_0x1760,0x1ce));var _0x0176=function(_0x3397cb,_0x3974e5){_0x3397cb=_0x3397cb-0x0;var _0x16a82f=_0x1760[_0x3397cb];return _0x16a82f;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x0176('0x0'));module[_0x0176('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x0176('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x0176('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x0176('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x0176('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x0176('0x3')]},'type':{'type':Sequelize['ENUM'](_0x0176('0x4'),_0x0176('0x5'),_0x0176('0x6'),'clicksend',_0x0176('0x7'),_0x0176('0x8'),_0x0176('0x9'),_0x0176('0xa'),_0x0176('0xb'),_0x0176('0xc'))},'accountSid':{'type':Sequelize[_0x0176('0x3')]},'authId':{'type':Sequelize[_0x0176('0x3')]},'authToken':{'type':Sequelize[_0x0176('0x3')]},'smsMethod':{'type':Sequelize[_0x0176('0xd')]('SI','TI','GP')},'username':{'type':Sequelize[_0x0176('0x3')]},'password':{'type':Sequelize[_0x0176('0x3')]},'apiKey':{'type':Sequelize[_0x0176('0x3')]},'applicationId':{'type':Sequelize[_0x0176('0x3')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x0176('0x3')]},'deliveryReport':{'type':Sequelize[_0x0176('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0x0176('0x3')]},'notificationTemplate':{'type':Sequelize[_0x0176('0xf')],'defaultValue':function(){return _0x0176('0x10');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0176('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0176('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0176('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0176('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0176('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x0176('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0176('0x11')],'comment':_0x0176('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x0176('0xe')],'defaultValue':![],'comment':_0x0176('0x13'),'set':function(_0x41f533){if(!_0x41f533)this['setDataValue'](_0x0176('0x14'),null);this[_0x0176('0x15')](_0x0176('0x16'),_0x41f533);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 5d85120..91914b6 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 _0x3cc3=['unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','CmContact','Owner','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','Messages','spread','dataValues','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','clickatell','bandwidth','intelepeer','redif','update','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsAccount.socket','jayson/promise','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','SmsAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','SmsAccountId','Disposition','findOne','findAll','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','notify','sms','SmsApplication','Applications','applications','orderBy','priority','asc','account','ValidationError','no\x20available\x20attributes','difference','createdAt','ListId','twilio','from','From','messageId','MessageSid','skebby','sender','text','connectel','clicksend','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','fromNumber','replyMessageId','refid','isNil','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','updatedAt','DESC','list','omit','contact','SmsInteraction','interaction','created','autoclose','push','close','unmanaged','SmsMessage','ContactId','AttachmentId','UserId','User'];(function(_0x44867b,_0x5e25f4){var _0x365576=function(_0x3f3f03){while(--_0x3f3f03){_0x44867b['push'](_0x44867b['shift']());}};_0x365576(++_0x5e25f4);}(_0x3cc3,0x11b));var _0x33cc=function(_0x232a09,_0x45b6c5){_0x232a09=_0x232a09-0x0;var _0x42339a=_0x3cc3[_0x232a09];return _0x42339a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x33cc('0x0'));var Mustache=require('mustache');var util=require(_0x33cc('0x1'));var path=require('path');var sox=require(_0x33cc('0x2'));var csv=require(_0x33cc('0x3'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x33cc('0x4'));var _=require(_0x33cc('0x5'));var squel=require(_0x33cc('0x6'));var crypto=require(_0x33cc('0x7'));var jsforce=require(_0x33cc('0x8'));var deskjs=require(_0x33cc('0x9'));var toCsv=require(_0x33cc('0x3'));var querystring=require('querystring');var Papa=require(_0x33cc('0xa'));var Redis=require('ioredis');var authService=require(_0x33cc('0xb'));var qs=require(_0x33cc('0xc'));var as=require(_0x33cc('0xd'));var hardwareService=require(_0x33cc('0xe'));var logger=require(_0x33cc('0xf'))(_0x33cc('0x10'));var utils=require('../../config/utils');var config=require(_0x33cc('0x11'));var licenseUtil=require(_0x33cc('0x12'));var db=require(_0x33cc('0x13'))['db'];config[_0x33cc('0x14')]=_[_0x33cc('0x15')](config[_0x33cc('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x33cc('0x16'))(new Redis(config[_0x33cc('0x14')]));require(_0x33cc('0x17'))['register'](socket);var jayson=require(_0x33cc('0x18'));var client=jayson[_0x33cc('0x19')][_0x33cc('0x1a')]({'port':0x232c});function respondWithRpcPromise(_0x1813c3,_0xac45a4,_0xee4642,_0x2dcbbe){return new BPromise(function(_0x4d233c,_0x2d17c4){var _0x2295d4=_0x2dcbbe||client;return _0x2295d4[_0x33cc('0x1b')](_0x1813c3,_0xee4642)[_0x33cc('0x1c')](function(_0x48dac6){logger[_0x33cc('0x1d')](_0x33cc('0x1e'),_0xac45a4,'request\x20sent');logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xac45a4,'request\x20sent',JSON[_0x33cc('0x1f')](_0x48dac6));if(_0x48dac6['error']){if(_0x48dac6['error'][_0x33cc('0x20')]===0x1f4){logger[_0x33cc('0x21')](_0x33cc('0x1e'),_0xac45a4,_0x48dac6[_0x33cc('0x21')][_0x33cc('0x22')]);return _0x2d17c4(_0x48dac6[_0x33cc('0x21')]['message']);}logger[_0x33cc('0x21')](_0x33cc('0x1e'),_0xac45a4,_0x48dac6[_0x33cc('0x21')][_0x33cc('0x22')]);return _0x4d233c(_0x48dac6[_0x33cc('0x21')][_0x33cc('0x22')]);}else{logger[_0x33cc('0x1d')]('SmsAccount,\x20%s,\x20%s',_0xac45a4,_0x33cc('0x23'));_0x4d233c(_0x48dac6[_0x33cc('0x24')]['message']);}})[_0x33cc('0x25')](function(_0x1a6a40){logger[_0x33cc('0x21')]('SmsAccount,\x20%s,\x20%s',_0xac45a4,_0x1a6a40);_0x2d17c4(_0x1a6a40);});});}function respondWithStatusCode(_0x1904a1,_0x15831e){_0x15831e=_0x15831e||0xcc;return function(_0x4aef20){if(_0x4aef20){return _0x1904a1[_0x33cc('0x26')](_0x15831e);}return _0x1904a1[_0x33cc('0x27')](_0x15831e)[_0x33cc('0x28')]();};}function respondWithResult(_0x2c8cc0,_0x222f63){_0x222f63=_0x222f63||0xc8;return function(_0x3d2f05){if(_0x3d2f05){return _0x2c8cc0[_0x33cc('0x27')](_0x222f63)[_0x33cc('0x29')](_0x3d2f05);}};}function respondWithFilteredResult(_0xc113d5,_0x5c2846){return function(_0x336562){if(_0x336562){var _0x150ccc=typeof _0x5c2846[_0x33cc('0x2a')]===_0x33cc('0x2b')&&typeof _0x5c2846[_0x33cc('0x2c')]===_0x33cc('0x2b');var _0x392c05=_0x336562[_0x33cc('0x2d')];var _0x502b4a=_0x150ccc?0x0:_0x5c2846[_0x33cc('0x2a')];var _0x450d21=_0x150ccc?_0x336562[_0x33cc('0x2d')]:_0x5c2846[_0x33cc('0x2a')]+_0x5c2846[_0x33cc('0x2c')];var _0xa6d4cd;if(_0x450d21>=_0x392c05){_0x450d21=_0x392c05;_0xa6d4cd=0xc8;}else{_0xa6d4cd=0xce;}_0xc113d5['status'](_0xa6d4cd);return _0xc113d5[_0x33cc('0x2e')](_0x33cc('0x2f'),_0x502b4a+'-'+_0x450d21+'/'+_0x392c05)[_0x33cc('0x29')](_0x336562);}return null;};}function patchUpdates(_0x377f8b){return function(_0x549fa4){try{jsonpatch[_0x33cc('0x30')](_0x549fa4,_0x377f8b,!![]);}catch(_0x21f8ae){return BPromise['reject'](_0x21f8ae);}return _0x549fa4['save']();};}function saveUpdates(_0x524e5a,_0x8ff2eb){return function(_0x20fde0){if(_0x20fde0){return _0x20fde0['update'](_0x524e5a)[_0x33cc('0x1c')](function(_0xb30653){return _0xb30653;});}return null;};}function removeEntity(_0x17df74,_0x59cd40){return function(_0x2af065){if(_0x2af065){return _0x2af065[_0x33cc('0x31')]()[_0x33cc('0x1c')](function(){var _0x3b4646=_0x2af065[_0x33cc('0x32')]({'plain':!![]});var _0x115518=_0x33cc('0x33');return db[_0x33cc('0x34')]['destroy']({'where':{'type':_0x115518,'resourceId':_0x3b4646['id']}})['then'](function(){return _0x2af065;});})[_0x33cc('0x1c')](function(){_0x17df74[_0x33cc('0x27')](0xcc)[_0x33cc('0x28')]();});}};}function handleEntityNotFound(_0x59eab7,_0x4f3fc1){return function(_0x23141f){if(!_0x23141f){_0x59eab7[_0x33cc('0x26')](0x194);}return _0x23141f;};}function handleError(_0x24c3ea,_0x13369d){_0x13369d=_0x13369d||0x1f4;return function(_0x541e38){logger[_0x33cc('0x21')](_0x541e38[_0x33cc('0x35')]);if(_0x541e38['name']){delete _0x541e38[_0x33cc('0x36')];}_0x24c3ea[_0x33cc('0x27')](_0x13369d)[_0x33cc('0x37')](_0x541e38);};}exports[_0x33cc('0x38')]=function(_0x19a482,_0xeb712c){var _0x1d4f6d={'include':[{'model':db[_0x33cc('0x39')],'as':_0x33cc('0x3a')}]},_0x2e5ada={},_0x47c59d={'count':0x0,'rows':[]};var _0x121e4f=_['map'](db[_0x33cc('0x3b')][_0x33cc('0x3c')],function(_0xc8b335){return{'name':_0xc8b335[_0x33cc('0x3d')],'type':_0xc8b335[_0x33cc('0x3e')][_0x33cc('0x3f')]};});_0x2e5ada[_0x33cc('0x40')]=_[_0x33cc('0x41')](_0x121e4f,_0x33cc('0x36'));_0x2e5ada[_0x33cc('0x42')]=_[_0x33cc('0x43')](_0x19a482[_0x33cc('0x42')]);_0x2e5ada[_0x33cc('0x44')]=_[_0x33cc('0x45')](_0x2e5ada[_0x33cc('0x40')],_0x2e5ada[_0x33cc('0x42')]);_0x1d4f6d[_0x33cc('0x46')]=_[_0x33cc('0x45')](_0x2e5ada[_0x33cc('0x40')],qs[_0x33cc('0x47')](_0x19a482['query'][_0x33cc('0x47')]));_0x1d4f6d['attributes']=_0x1d4f6d['attributes'][_0x33cc('0x48')]?_0x1d4f6d[_0x33cc('0x46')]:_0x2e5ada[_0x33cc('0x40')];if(!_0x19a482[_0x33cc('0x42')][_0x33cc('0x49')](_0x33cc('0x4a'))){_0x1d4f6d[_0x33cc('0x2c')]=qs['limit'](_0x19a482[_0x33cc('0x42')][_0x33cc('0x2c')]);_0x1d4f6d['offset']=qs[_0x33cc('0x2a')](_0x19a482[_0x33cc('0x42')][_0x33cc('0x2a')]);}_0x1d4f6d[_0x33cc('0x4b')]=qs[_0x33cc('0x4c')](_0x19a482[_0x33cc('0x42')]['sort']);_0x1d4f6d['where']=qs[_0x33cc('0x44')](_[_0x33cc('0x4d')](_0x19a482[_0x33cc('0x42')],_0x2e5ada[_0x33cc('0x44')]),_0x121e4f);if(_0x19a482['query'][_0x33cc('0x4e')]){_0x1d4f6d[_0x33cc('0x4f')]=_[_0x33cc('0x50')](_0x1d4f6d[_0x33cc('0x4f')],{'$or':_[_0x33cc('0x41')](_0x121e4f,function(_0x2f4841){if(_0x2f4841['type']!==_0x33cc('0x51')){var _0x3730d7={};_0x3730d7[_0x2f4841[_0x33cc('0x36')]]={'$like':'%'+_0x19a482['query'][_0x33cc('0x4e')]+'%'};return _0x3730d7;}})});}_0x1d4f6d=_[_0x33cc('0x50')]({},_0x1d4f6d,_0x19a482[_0x33cc('0x52')]);var _0x237787={'where':_0x1d4f6d[_0x33cc('0x4f')]};return db[_0x33cc('0x3b')][_0x33cc('0x2d')](_0x237787)[_0x33cc('0x1c')](function(_0x2c2055){_0x47c59d[_0x33cc('0x2d')]=_0x2c2055;if(_0x19a482['query'][_0x33cc('0x53')]){_0x1d4f6d[_0x33cc('0x54')]=[{'all':!![]}];}return db[_0x33cc('0x3b')]['findAll'](_0x1d4f6d);})[_0x33cc('0x1c')](function(_0x1f1a81){_0x47c59d[_0x33cc('0x55')]=_0x1f1a81;return _0x47c59d;})['then'](respondWithFilteredResult(_0xeb712c,_0x1d4f6d))[_0x33cc('0x25')](handleError(_0xeb712c,null));};exports[_0x33cc('0x56')]=function(_0x33dd98,_0x51f504){var _0x57588e={'raw':![],'where':{'id':_0x33dd98[_0x33cc('0x57')]['id']},'include':[{'model':db[_0x33cc('0x39')],'as':_0x33cc('0x3a')}]},_0x1579e3={};_0x1579e3['model']=_[_0x33cc('0x43')](db[_0x33cc('0x3b')]['rawAttributes']);_0x1579e3[_0x33cc('0x42')]=_['keys'](_0x33dd98['query']);_0x1579e3[_0x33cc('0x44')]=_[_0x33cc('0x45')](_0x1579e3[_0x33cc('0x40')],_0x1579e3[_0x33cc('0x42')]);_0x57588e[_0x33cc('0x46')]=_['intersection'](_0x1579e3[_0x33cc('0x40')],qs[_0x33cc('0x47')](_0x33dd98[_0x33cc('0x42')]['fields']));_0x57588e[_0x33cc('0x46')]=_0x57588e['attributes'][_0x33cc('0x48')]?_0x57588e[_0x33cc('0x46')]:_0x1579e3['model'];if(_0x33dd98[_0x33cc('0x42')][_0x33cc('0x53')]){_0x57588e['include']=[{'all':!![]}];}_0x57588e=_[_0x33cc('0x50')]({},_0x57588e,_0x33dd98['options']);return db[_0x33cc('0x3b')][_0x33cc('0x58')](_0x57588e)[_0x33cc('0x1c')](handleEntityNotFound(_0x51f504,null))['then'](respondWithResult(_0x51f504,null))[_0x33cc('0x25')](handleError(_0x51f504,null));};exports[_0x33cc('0x59')]=function(_0x236500,_0x4f8350){return db[_0x33cc('0x3b')]['create'](_0x236500[_0x33cc('0x5a')],{})['then'](function(_0x3aab6b){var _0x39ca67=_0x236500[_0x33cc('0x5b')][_0x33cc('0x32')]({'plain':!![]});if(!_0x39ca67)throw new Error(_0x33cc('0x5c'));if(_0x39ca67[_0x33cc('0x5d')]===_0x33cc('0x5b')){var _0x3edd15=_0x3aab6b[_0x33cc('0x32')]({'plain':!![]});var _0x405953=_0x33cc('0x33');return db[_0x33cc('0x5e')][_0x33cc('0x58')]({'where':{'name':_0x405953,'userProfileId':_0x39ca67[_0x33cc('0x5f')]},'raw':!![]})[_0x33cc('0x1c')](function(_0x4a9c5a){if(_0x4a9c5a&&_0x4a9c5a[_0x33cc('0x60')]===0x0){return db['UserProfileResource'][_0x33cc('0x59')]({'name':_0x3edd15[_0x33cc('0x36')],'resourceId':_0x3edd15['id'],'type':_0x4a9c5a['name'],'sectionId':_0x4a9c5a['id']},{})['then'](function(){return _0x3aab6b;});}else{return _0x3aab6b;}})[_0x33cc('0x25')](function(_0x39a8a7){logger['error'](_0x33cc('0x61'),_0x39a8a7);throw _0x39a8a7;});}return _0x3aab6b;})[_0x33cc('0x1c')](respondWithResult(_0x4f8350,0xc9))['catch'](handleError(_0x4f8350,null));};exports['update']=function(_0x5ef7cf,_0x1585c2){if(_0x5ef7cf[_0x33cc('0x5a')]['id']){delete _0x5ef7cf[_0x33cc('0x5a')]['id'];}return db[_0x33cc('0x3b')][_0x33cc('0x58')]({'where':{'id':_0x5ef7cf[_0x33cc('0x57')]['id']},'include':[{'model':db[_0x33cc('0x39')],'as':_0x33cc('0x3a')}]})[_0x33cc('0x1c')](handleEntityNotFound(_0x1585c2,null))['then'](saveUpdates(_0x5ef7cf['body'],null))[_0x33cc('0x1c')](respondWithResult(_0x1585c2,null))[_0x33cc('0x25')](handleError(_0x1585c2,null));};exports[_0x33cc('0x31')]=function(_0x2d0bce,_0x24555a){return db[_0x33cc('0x3b')][_0x33cc('0x58')]({'where':{'id':_0x2d0bce['params']['id']}})[_0x33cc('0x1c')](handleEntityNotFound(_0x24555a,null))[_0x33cc('0x1c')](removeEntity(_0x24555a,null))[_0x33cc('0x25')](handleError(_0x24555a,null));};exports[_0x33cc('0x62')]=function(_0x2bd039,_0x15261a){return db[_0x33cc('0x3b')][_0x33cc('0x62')]()[_0x33cc('0x1c')](respondWithResult(_0x15261a,null))[_0x33cc('0x25')](handleError(_0x15261a,null));};exports['addDisposition']=function(_0x4c9d26,_0x51e679,_0x3b026b){if(_0x4c9d26[_0x33cc('0x5a')]['id']){delete _0x4c9d26[_0x33cc('0x5a')]['id'];}return db[_0x33cc('0x3b')][_0x33cc('0x58')]({'where':{'id':_0x4c9d26[_0x33cc('0x57')]['id']}})['then'](handleEntityNotFound(_0x51e679,null))[_0x33cc('0x1c')](function(_0x378dc8){if(_0x378dc8){_0x4c9d26[_0x33cc('0x5a')][_0x33cc('0x63')]=_0x378dc8['id'];return db[_0x33cc('0x64')][_0x33cc('0x59')](_0x4c9d26[_0x33cc('0x5a')]);}})['then'](respondWithResult(_0x51e679,null))[_0x33cc('0x25')](handleError(_0x51e679,null));};exports['getDispositions']=function(_0x334629,_0x332ec1,_0x5598c5){var _0xf4c79={'raw':![],'where':{}};var _0x297b95={};var _0x1e65fd={'count':0x0,'rows':[]};return db['SmsAccount'][_0x33cc('0x65')]({'where':{'id':_0x334629[_0x33cc('0x57')]['id']}})[_0x33cc('0x1c')](handleEntityNotFound(_0x332ec1,null))[_0x33cc('0x1c')](function(_0x586d89){if(_0x586d89){_0x297b95[_0x33cc('0x40')]=_[_0x33cc('0x43')](db['Disposition'][_0x33cc('0x3c')]);_0x297b95[_0x33cc('0x42')]=_[_0x33cc('0x43')](_0x334629[_0x33cc('0x42')]);_0x297b95['filters']=_[_0x33cc('0x45')](_0x297b95[_0x33cc('0x40')],_0x297b95['query']);_0xf4c79[_0x33cc('0x46')]=_[_0x33cc('0x45')](_0x297b95['model'],qs[_0x33cc('0x47')](_0x334629[_0x33cc('0x42')]['fields']));_0xf4c79[_0x33cc('0x46')]=_0xf4c79[_0x33cc('0x46')][_0x33cc('0x48')]?_0xf4c79[_0x33cc('0x46')]:_0x297b95[_0x33cc('0x40')];if(!_0x334629[_0x33cc('0x42')][_0x33cc('0x49')]('nolimit')){_0xf4c79[_0x33cc('0x2c')]=qs[_0x33cc('0x2c')](_0x334629['query'][_0x33cc('0x2c')]);_0xf4c79['offset']=qs[_0x33cc('0x2a')](_0x334629['query']['offset']);}_0xf4c79[_0x33cc('0x4b')]=qs[_0x33cc('0x4c')](_0x334629[_0x33cc('0x42')][_0x33cc('0x4c')]);_0xf4c79[_0x33cc('0x4f')]=qs[_0x33cc('0x44')](_['pick'](_0x334629['query'],_0x297b95['filters']));_0xf4c79[_0x33cc('0x4f')][_0x33cc('0x63')]=_0x586d89['id'];if(_0x334629[_0x33cc('0x42')][_0x33cc('0x4e')]){_0xf4c79[_0x33cc('0x4f')]=_[_0x33cc('0x50')](_0xf4c79[_0x33cc('0x4f')],{'$or':_['map'](_0xf4c79[_0x33cc('0x46')],function(_0x522db0){var _0x6bf887={};_0x6bf887[_0x522db0]={'$like':'%'+_0x334629[_0x33cc('0x42')][_0x33cc('0x4e')]+'%'};return _0x6bf887;})});}_0xf4c79=_[_0x33cc('0x50')]({},_0xf4c79,_0x334629['options']);return db[_0x33cc('0x64')][_0x33cc('0x2d')]({'where':_0xf4c79[_0x33cc('0x4f')]})[_0x33cc('0x1c')](function(_0x6a5363){_0x1e65fd[_0x33cc('0x2d')]=_0x6a5363;if(_0x334629[_0x33cc('0x42')][_0x33cc('0x53')]){_0xf4c79['include']=[{'all':!![]}];}return db['Disposition'][_0x33cc('0x66')](_0xf4c79);})[_0x33cc('0x1c')](function(_0x2eece5){_0x1e65fd[_0x33cc('0x55')]=_0x2eece5;return _0x1e65fd;});}})[_0x33cc('0x1c')](respondWithFilteredResult(_0x332ec1,_0xf4c79))[_0x33cc('0x25')](handleError(_0x332ec1,null));};exports[_0x33cc('0x67')]=function(_0x344946,_0x5e37cb,_0x3e4b85){return db[_0x33cc('0x3b')][_0x33cc('0x58')]({'where':{'id':_0x344946[_0x33cc('0x57')]['id']}})[_0x33cc('0x1c')](handleEntityNotFound(_0x5e37cb,null))[_0x33cc('0x1c')](function(_0x3a9a44){if(_0x3a9a44){return _0x3a9a44[_0x33cc('0x67')](_0x344946[_0x33cc('0x42')][_0x33cc('0x68')]);}})['then'](respondWithStatusCode(_0x5e37cb,null))[_0x33cc('0x25')](handleError(_0x5e37cb,null));};exports[_0x33cc('0x69')]=function(_0x3ee5be,_0x4c3627,_0x3a8fc9){if(_0x3ee5be[_0x33cc('0x5a')]['id']){delete _0x3ee5be[_0x33cc('0x5a')]['id'];}return db['SmsAccount'][_0x33cc('0x58')]({'where':{'id':_0x3ee5be[_0x33cc('0x57')]['id']}})[_0x33cc('0x1c')](handleEntityNotFound(_0x4c3627,null))[_0x33cc('0x1c')](function(_0x5a2ea5){if(_0x5a2ea5){_0x3ee5be['body'][_0x33cc('0x63')]=_0x5a2ea5['id'];return db[_0x33cc('0x6a')][_0x33cc('0x59')](_0x3ee5be[_0x33cc('0x5a')]);}})[_0x33cc('0x1c')](respondWithResult(_0x4c3627,null))[_0x33cc('0x25')](handleError(_0x4c3627,null));};exports['getAnswers']=function(_0x53a014,_0x481b9f,_0x2b2037){var _0x308529={'raw':![],'where':{}};var _0x544284={};var _0x40904b={'count':0x0,'rows':[]};return db[_0x33cc('0x3b')][_0x33cc('0x65')]({'where':{'id':_0x53a014[_0x33cc('0x57')]['id']}})[_0x33cc('0x1c')](handleEntityNotFound(_0x481b9f,null))[_0x33cc('0x1c')](function(_0x2afd5f){if(_0x2afd5f){_0x544284[_0x33cc('0x40')]=_[_0x33cc('0x43')](db['CannedAnswer'][_0x33cc('0x3c')]);_0x544284[_0x33cc('0x42')]=_[_0x33cc('0x43')](_0x53a014[_0x33cc('0x42')]);_0x544284['filters']=_[_0x33cc('0x45')](_0x544284['model'],_0x544284['query']);_0x308529[_0x33cc('0x46')]=_[_0x33cc('0x45')](_0x544284[_0x33cc('0x40')],qs['fields'](_0x53a014[_0x33cc('0x42')][_0x33cc('0x47')]));_0x308529[_0x33cc('0x46')]=_0x308529[_0x33cc('0x46')][_0x33cc('0x48')]?_0x308529[_0x33cc('0x46')]:_0x544284[_0x33cc('0x40')];if(!_0x53a014[_0x33cc('0x42')]['hasOwnProperty'](_0x33cc('0x4a'))){_0x308529[_0x33cc('0x2c')]=qs[_0x33cc('0x2c')](_0x53a014[_0x33cc('0x42')][_0x33cc('0x2c')]);_0x308529['offset']=qs[_0x33cc('0x2a')](_0x53a014['query'][_0x33cc('0x2a')]);}_0x308529['order']=qs['sort'](_0x53a014[_0x33cc('0x42')][_0x33cc('0x4c')]);_0x308529[_0x33cc('0x4f')]=qs[_0x33cc('0x44')](_['pick'](_0x53a014[_0x33cc('0x42')],_0x544284[_0x33cc('0x44')]));_0x308529[_0x33cc('0x4f')][_0x33cc('0x63')]=_0x2afd5f['id'];if(_0x53a014['query']['filter']){_0x308529[_0x33cc('0x4f')]=_[_0x33cc('0x50')](_0x308529['where'],{'$or':_[_0x33cc('0x41')](_0x308529[_0x33cc('0x46')],function(_0x21d50f){var _0x58b9a5={};_0x58b9a5[_0x21d50f]={'$like':'%'+_0x53a014[_0x33cc('0x42')][_0x33cc('0x4e')]+'%'};return _0x58b9a5;})});}_0x308529=_['merge']({},_0x308529,_0x53a014['options']);return db[_0x33cc('0x6a')][_0x33cc('0x2d')]({'where':_0x308529[_0x33cc('0x4f')]})['then'](function(_0x3b8765){_0x40904b['count']=_0x3b8765;if(_0x53a014[_0x33cc('0x42')]['includeAll']){_0x308529[_0x33cc('0x54')]=[{'all':!![]}];}return db['CannedAnswer'][_0x33cc('0x66')](_0x308529);})[_0x33cc('0x1c')](function(_0x495fce){_0x40904b[_0x33cc('0x55')]=_0x495fce;return _0x40904b;});}})[_0x33cc('0x1c')](respondWithFilteredResult(_0x481b9f,_0x308529))[_0x33cc('0x25')](handleError(_0x481b9f,null));};exports[_0x33cc('0x6b')]=function(_0x3c0e0b,_0x1fb67a,_0x20ba03){return db[_0x33cc('0x3b')][_0x33cc('0x58')]({'where':{'id':_0x3c0e0b['params']['id']}})['then'](handleEntityNotFound(_0x1fb67a,null))[_0x33cc('0x1c')](function(_0x3350fd){if(_0x3350fd){return _0x3350fd[_0x33cc('0x6b')](_0x3c0e0b[_0x33cc('0x42')][_0x33cc('0x68')]);}})[_0x33cc('0x1c')](respondWithStatusCode(_0x1fb67a,null))[_0x33cc('0x25')](handleError(_0x1fb67a,null));};exports[_0x33cc('0x6c')]=function(_0xbbd8db,_0x25c5ab,_0x343d37){var _0x53cb31={'channel':_0x33cc('0x6d')};var _0xb8ad65=[];var _0x4561ae=[];var _0x253a26={};return db[_0x33cc('0x3b')][_0x33cc('0x58')]({'where':{'id':_0xbbd8db[_0x33cc('0x57')]['id']},'include':[{'model':db[_0x33cc('0x6e')],'as':_0x33cc('0x6f')}]})[_0x33cc('0x1c')](handleEntityNotFound(_0x25c5ab,null))[_0x33cc('0x1c')](function(_0x5a3a4a){_0x53cb31['account']=_0x5a3a4a;_0x53cb31[_0x33cc('0x70')]=_[_0x33cc('0x71')](_0x5a3a4a['Applications'],[_0x33cc('0x72')],[_0x33cc('0x73')]);if(_0x53cb31[_0x33cc('0x74')][_0x33cc('0x6f')]){delete _0x53cb31[_0x33cc('0x74')]['Applications'];}return db['CmContact'][_0x33cc('0x62')]();})[_0x33cc('0x1c')](function(_0x2c718b){if(!_0x2c718b){throw new db['Sequelize'][(_0x33cc('0x75'))](_0x33cc('0x76'));}_0xb8ad65=_['difference'](_[_0x33cc('0x43')](_0x2c718b),['createdAt','updatedAt']);_0x4561ae=_[_0x33cc('0x77')](_[_0x33cc('0x43')](_0x2c718b),[_0x33cc('0x78'),'updatedAt','CompanyId',_0x33cc('0x79')]);_0x53cb31[_0x33cc('0x5a')]={'mapKey':'mobile'};if(_0x53cb31[_0x33cc('0x74')][_0x33cc('0x3e')]){switch(_0x53cb31['account'][_0x33cc('0x3e')]){case _0x33cc('0x7a'):_0x53cb31['body'][_0x33cc('0x7b')]=_0xbbd8db[_0x33cc('0x5a')][_0x33cc('0x7c')];_0x53cb31[_0x33cc('0x5a')][_0x33cc('0x5a')]=_0xbbd8db[_0x33cc('0x5a')]['Body'];_0x53cb31[_0x33cc('0x5a')][_0x33cc('0x7d')]=_0xbbd8db['body'][_0x33cc('0x7e')];break;case _0x33cc('0x7f'):_0x53cb31[_0x33cc('0x5a')][_0x33cc('0x7b')]='+'+_0xbbd8db[_0x33cc('0x5a')][_0x33cc('0x80')];_0x53cb31[_0x33cc('0x5a')][_0x33cc('0x5a')]=_0xbbd8db[_0x33cc('0x5a')][_0x33cc('0x81')];break;case _0x33cc('0x82'):_0x53cb31[_0x33cc('0x5a')]['from']=_0xbbd8db[_0x33cc('0x5a')][_0x33cc('0x7b')];_0x53cb31[_0x33cc('0x5a')][_0x33cc('0x5a')]=_0xbbd8db[_0x33cc('0x5a')][_0x33cc('0x22')];break;case _0x33cc('0x83'):_0x53cb31[_0x33cc('0x5a')][_0x33cc('0x7b')]=_0xbbd8db['body'][_0x33cc('0x7b')];_0x53cb31[_0x33cc('0x5a')]['body']=_0xbbd8db[_0x33cc('0x5a')][_0x33cc('0x5a')];_0x53cb31[_0x33cc('0x5a')][_0x33cc('0x7d')]=_0xbbd8db['body'][_0x33cc('0x84')];break;case _0x33cc('0x85'):_0x53cb31[_0x33cc('0x5a')][_0x33cc('0x7b')]=_0xbbd8db[_0x33cc('0x5a')]['From'];_0x53cb31[_0x33cc('0x5a')]['body']=_0xbbd8db['body'][_0x33cc('0x86')];_0x53cb31[_0x33cc('0x5a')]['messageId']=_0xbbd8db[_0x33cc('0x5a')][_0x33cc('0x87')];break;case _0x33cc('0x88'):_0x53cb31[_0x33cc('0x5a')][_0x33cc('0x7b')]='+'+_0xbbd8db[_0x33cc('0x5a')]['results'][0x0]['from'];_0x53cb31[_0x33cc('0x5a')]['body']=_0xbbd8db[_0x33cc('0x5a')][_0x33cc('0x89')][0x0][_0x33cc('0x81')];_0x53cb31[_0x33cc('0x5a')][_0x33cc('0x7d')]=_0xbbd8db[_0x33cc('0x5a')][_0x33cc('0x89')][0x0][_0x33cc('0x7d')];break;case _0x33cc('0x8a'):_0x53cb31[_0x33cc('0x5a')][_0x33cc('0x7b')]=_0xbbd8db[_0x33cc('0x5a')][_0x33cc('0x8b')];_0x53cb31[_0x33cc('0x5a')][_0x33cc('0x5a')]=_0xbbd8db['body'][_0x33cc('0x8c')][_0x33cc('0x22')];break;case'clickatell':_0x53cb31['body'][_0x33cc('0x7b')]=_0xbbd8db[_0x33cc('0x5a')][_0x33cc('0x8d')];_0x53cb31[_0x33cc('0x5a')][_0x33cc('0x5a')]=_0xbbd8db[_0x33cc('0x5a')][_0x33cc('0x81')];_0x53cb31[_0x33cc('0x5a')][_0x33cc('0x7d')]=_0xbbd8db[_0x33cc('0x5a')][_0x33cc('0x8e')];break;case'bandwidth':_0x53cb31['body'][_0x33cc('0x7d')]=_0xbbd8db[_0x33cc('0x5a')][0x0][_0x33cc('0x22')]['id'];_0x53cb31[_0x33cc('0x5a')][_0x33cc('0x7b')]=_0xbbd8db[_0x33cc('0x5a')][0x0][_0x33cc('0x22')][_0x33cc('0x7b')];_0x53cb31[_0x33cc('0x5a')][_0x33cc('0x5a')]=_0xbbd8db['body'][0x0]['message'][_0x33cc('0x81')];break;case'intelepeer':_0x53cb31[_0x33cc('0x5a')][_0x33cc('0x7b')]=_0xbbd8db['body']['from'];_0x53cb31[_0x33cc('0x5a')][_0x33cc('0x5a')]=_0xbbd8db[_0x33cc('0x5a')][_0x33cc('0x22')];_0x53cb31[_0x33cc('0x5a')][_0x33cc('0x7d')]=_0xbbd8db[_0x33cc('0x5a')][_0x33cc('0x8f')];break;}}if(_0x53cb31[_0x33cc('0x5a')]['id']){delete _0x53cb31[_0x33cc('0x5a')]['id'];}if(_[_0x33cc('0x90')](_0x53cb31[_0x33cc('0x5a')][_0x33cc('0x7b')])){throw new db[(_0x33cc('0x91'))]['ValidationError'](_0x33cc('0x92'));}if(_[_0x33cc('0x90')](_0x53cb31[_0x33cc('0x5a')][_0x33cc('0x5a')])||_0x53cb31[_0x33cc('0x5a')][_0x33cc('0x5a')]===''){throw new db['Sequelize'][(_0x33cc('0x75'))](_0x33cc('0x93'));}if(_['isNil'](_0x53cb31[_0x33cc('0x5a')][_0x33cc('0x94')])){throw new db[(_0x33cc('0x91'))][(_0x33cc('0x75'))](_0x33cc('0x95')+_0x4561ae);}if(!_[_0x33cc('0x96')](_0x4561ae,_0x53cb31[_0x33cc('0x5a')]['mapKey'])){throw new db[(_0x33cc('0x91'))]['ValidationError'](_0x33cc('0x97')+_0x4561ae);}_0x253a26[_0x53cb31[_0x33cc('0x5a')]['mapKey']]=_0x53cb31[_0x33cc('0x5a')][_0x33cc('0x7b')];return db[_0x33cc('0x98')][_0x33cc('0x58')]({'where':{'id':_0x53cb31[_0x33cc('0x74')]['ListId']},'include':[{'model':db['CmContact'],'as':_0x33cc('0x99'),'where':_0x253a26,'limit':0x1,'order':[[_0x33cc('0x9a'),_0x33cc('0x9b')]]}]});})[_0x33cc('0x1c')](handleEntityNotFound(_0x25c5ab,null))[_0x33cc('0x1c')](function(_0x24ffaf){if(_0x24ffaf){_0x53cb31[_0x33cc('0x9c')]=_[_0x33cc('0x9d')](_0x24ffaf,[_0x33cc('0x99')]);if(_0x24ffaf['Contacts'][_0x33cc('0x48')]){return _0x24ffaf[_0x33cc('0x99')][0x0];}var _0x453ad6=_[_0x33cc('0x15')](_0x53cb31[_0x33cc('0x5a')],{'firstName':_0x53cb31[_0x33cc('0x5a')][_0x33cc('0x7b')],'ListId':_0x24ffaf['id']});_0x453ad6[_0x53cb31[_0x33cc('0x5a')]['mapKey']]=_0x53cb31[_0x33cc('0x5a')]['from'];return db['CmContact'][_0x33cc('0x59')](_0x453ad6,{'fields':_0xb8ad65,'raw':!![]});}})[_0x33cc('0x1c')](handleEntityNotFound(_0x25c5ab,null))[_0x33cc('0x1c')](function(_0x15a02f){if(_0x15a02f){_0x53cb31[_0x33cc('0x9e')]=_0x15a02f;var _0x2d708a={'ContactId':_0x15a02f['id'],'phone':_0x53cb31[_0x33cc('0x5a')]['from'],'SmsAccountId':_0xbbd8db[_0x33cc('0x57')]['id']};var _0x4eb1a6={'ContactId':_0x15a02f['id'],'SmsAccountId':_0xbbd8db[_0x33cc('0x57')]['id'],'closed':![]};return db['SmsInteraction'][_0x33cc('0x58')]({'where':_0x4eb1a6})[_0x33cc('0x1c')](function(_0x19577a){if(_0x19577a){return[_0x19577a,![]];}return db[_0x33cc('0x9f')][_0x33cc('0x59')](_0x2d708a)[_0x33cc('0x1c')](function(_0x4d9add){return[_0x4d9add,!![]];});});}})['spread'](function(_0x304470,_0x7ce6b4){_0x53cb31[_0x33cc('0xa0')]=_0x304470['get']({'plain':!![]});_0x53cb31[_0x33cc('0xa0')][_0x33cc('0xa1')]=![];if(_0x7ce6b4){if(_0x53cb31['account'][_0x33cc('0xa2')]){_0x53cb31[_0x33cc('0x70')][_0x33cc('0xa3')]({'id':0x0,'priority':_0x53cb31[_0x33cc('0x70')][_0x33cc('0x48')]+0x1,'app':_0x33cc('0xa4'),'appdata':_0x33cc('0xa5'),'interval':'*,*,*,*'});}_0x53cb31[_0x33cc('0xa0')][_0x33cc('0xa1')]=!![];}return db[_0x33cc('0xa6')]['create']({'phone':_0x53cb31[_0x33cc('0x5a')][_0x33cc('0x7b')],'messageId':_0x53cb31[_0x33cc('0x5a')][_0x33cc('0x7d')],'body':_0x53cb31['body'][_0x33cc('0x5a')],'SmsAccountId':_0xbbd8db[_0x33cc('0x57')]['id'],'SmsInteractionId':_0x304470['id'],'direction':'in','ContactId':_0x304470[_0x33cc('0xa7')],'AttachmentId':_0x53cb31['body'][_0x33cc('0xa8')]});})['then'](function(_0xc1eb0e){_0x53cb31[_0x33cc('0x22')]=_0xc1eb0e;if(_0x53cb31['interaction'][_0x33cc('0xa9')]){return db[_0x33cc('0xaa')][_0x33cc('0x58')]({'attributes':['id','name'],'where':{'id':_0x53cb31[_0x33cc('0xa0')][_0x33cc('0xa9')]}})[_0x33cc('0x1c')](function(_0x3bef2b){if(_0x3bef2b){_0x53cb31[_0x33cc('0x70')][_0x33cc('0xab')]({'id':0x0,'priority':0x0,'app':_0x33cc('0xac'),'appdata':_0x3bef2b[_0x33cc('0x36')]+','+(_0x53cb31[_0x33cc('0x74')][_0x33cc('0xad')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x33cc('0xae'),'startRouting',_0x53cb31);});}return respondWithRpcPromise('Start',_0x33cc('0xaf'),_0x53cb31);})[_0x33cc('0x1c')](function(_0x4d2b17){if(_0x4d2b17){var _0xb40231=0xc8;var _0x211694=_0x33cc('0xb0');logger[_0x33cc('0x1d')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x211694,_0xb40231,'entity\x20found');logger[_0x33cc('0xb1')](_0x33cc('0xb2'),_0x211694,_0xb40231,'entity\x20found',JSON['stringify'](_0x4d2b17));if(_0x53cb31[_0x33cc('0x74')][_0x33cc('0x3e')]===_0x33cc('0x7a')){return _0x25c5ab[_0x33cc('0x27')](_0xb40231)[_0x33cc('0x2e')](_0x33cc('0xb3'),_0x33cc('0xb4'))[_0x33cc('0x37')]('\x0a');}else{return _0x25c5ab[_0x33cc('0x27')](_0xb40231)['json'](_0x4d2b17);}}})[_0x33cc('0x25')](handleError(_0x25c5ab,null));};exports['addApplications']=function(_0x505b76,_0x5c9e70,_0x2eb66b){return db[_0x33cc('0x3b')][_0x33cc('0x65')]({'where':{'id':_0x505b76['params']['id']}})[_0x33cc('0x1c')](handleEntityNotFound(_0x5c9e70,null))[_0x33cc('0x1c')](function(_0xbf4ccb){if(_0xbf4ccb){return db[_0x33cc('0xb5')][_0x33cc('0xb6')](function(_0x708d34){return db[_0x33cc('0x6e')][_0x33cc('0x31')]({'where':{'SmsAccountId':_0x505b76[_0x33cc('0x57')]['id']},'transaction':_0x708d34})['then'](function(_0x1fa3be){var _0x40b4ca=_[_0x33cc('0x41')](_0x505b76[_0x33cc('0x5a')],function(_0x2dc306){_0x2dc306['SmsAccountId']=_0x505b76[_0x33cc('0x57')]['id'];return _0x2dc306;});return db['SmsApplication'][_0x33cc('0xb7')](_0x40b4ca,{'transaction':_0x708d34});});})[_0x33cc('0x1c')](function(){return db[_0x33cc('0x6e')][_0x33cc('0xb8')]({'where':{'SmsAccountId':_0x505b76[_0x33cc('0x57')]['id']},'order':_0x33cc('0x72')});});}})[_0x33cc('0x1c')](respondWithResult(_0x5c9e70,null))['catch'](handleError(_0x5c9e70,null));};exports[_0x33cc('0xb9')]=function(_0x4a851a,_0x41078d,_0x48788d){var _0xb089de={};var _0xd1e3a9={};var _0x39da6e;var _0x101088;return db[_0x33cc('0x3b')]['findOne']({'where':{'id':_0x4a851a[_0x33cc('0x57')]['id']}})[_0x33cc('0x1c')](handleEntityNotFound(_0x41078d,null))[_0x33cc('0x1c')](function(_0x319b12){if(_0x319b12){_0x39da6e=_0x319b12;_0xd1e3a9[_0x33cc('0x40')]=_['keys'](db[_0x33cc('0x6e')][_0x33cc('0x3c')]);_0xd1e3a9['query']=_[_0x33cc('0x43')](_0x4a851a['query']);_0xd1e3a9['filters']=_[_0x33cc('0x45')](_0xd1e3a9[_0x33cc('0x40')],_0xd1e3a9['query']);_0xb089de['attributes']=_[_0x33cc('0x45')](_0xd1e3a9[_0x33cc('0x40')],qs['fields'](_0x4a851a[_0x33cc('0x42')][_0x33cc('0x47')]));_0xb089de['attributes']=_0xb089de[_0x33cc('0x46')]['length']?_0xb089de[_0x33cc('0x46')]:_0xd1e3a9[_0x33cc('0x40')];_0xb089de[_0x33cc('0x4b')]=qs['sort'](_0x4a851a['query'][_0x33cc('0x4c')]);_0xb089de['where']=qs[_0x33cc('0x44')](_['pick'](_0x4a851a[_0x33cc('0x42')],_0xd1e3a9[_0x33cc('0x44')]));if(_0x4a851a[_0x33cc('0x42')][_0x33cc('0x4e')]){_0xb089de[_0x33cc('0x4f')]=_[_0x33cc('0x50')](_0xb089de[_0x33cc('0x4f')],{'$or':_['map'](_0xb089de[_0x33cc('0x46')],function(_0xdc0c76){var _0x48b926={};_0x48b926[_0xdc0c76]={'$like':'%'+_0x4a851a[_0x33cc('0x42')]['filter']+'%'};return _0x48b926;})});}_0xb089de=_[_0x33cc('0x50')]({},_0xb089de,_0x4a851a[_0x33cc('0x52')]);return _0x39da6e[_0x33cc('0xb9')](_0xb089de);}})[_0x33cc('0x1c')](function(_0x129ba6){if(_0x129ba6){_0x101088=_0x129ba6['length'];if(!_0x4a851a[_0x33cc('0x42')][_0x33cc('0x49')](_0x33cc('0x4a'))){_0xb089de[_0x33cc('0x2c')]=qs[_0x33cc('0x2c')](_0x4a851a[_0x33cc('0x42')]['limit']);_0xb089de[_0x33cc('0x2a')]=qs[_0x33cc('0x2a')](_0x4a851a[_0x33cc('0x42')][_0x33cc('0x2a')]);}return _0x39da6e[_0x33cc('0xb9')](_0xb089de);}})[_0x33cc('0x1c')](function(_0x42c0ae){if(_0x42c0ae){return _0x42c0ae?{'count':_0x101088,'rows':_0x42c0ae}:null;}})[_0x33cc('0x1c')](respondWithResult(_0x41078d,null))[_0x33cc('0x25')](handleError(_0x41078d,null));};exports['getInteractions']=function(_0x35cf6a,_0x1757ef,_0x541278){var _0x320832={'raw':![],'where':{}};var _0x44607e={};var _0x9004c1={'count':0x0,'rows':[]};return db[_0x33cc('0x3b')][_0x33cc('0x65')]({'where':{'id':_0x35cf6a[_0x33cc('0x57')]['id']}})['then'](handleEntityNotFound(_0x1757ef,null))[_0x33cc('0x1c')](function(_0x1a0fa7){if(_0x1a0fa7){_0x44607e[_0x33cc('0x40')]=_['keys'](db['SmsInteraction']['rawAttributes']);_0x44607e['query']=_['keys'](_0x35cf6a[_0x33cc('0x42')]);_0x44607e[_0x33cc('0x44')]=_[_0x33cc('0x45')](_0x44607e['model'],_0x44607e[_0x33cc('0x42')]);_0x320832[_0x33cc('0x46')]=_[_0x33cc('0x45')](_0x44607e[_0x33cc('0x40')],qs['fields'](_0x35cf6a[_0x33cc('0x42')][_0x33cc('0x47')]));_0x320832[_0x33cc('0x46')]=_0x320832[_0x33cc('0x46')][_0x33cc('0x48')]?_0x320832[_0x33cc('0x46')]:_0x44607e[_0x33cc('0x40')];if(!_0x35cf6a[_0x33cc('0x42')]['hasOwnProperty']('nolimit')){_0x320832[_0x33cc('0x2c')]=qs[_0x33cc('0x2c')](_0x35cf6a[_0x33cc('0x42')][_0x33cc('0x2c')]);_0x320832[_0x33cc('0x2a')]=qs[_0x33cc('0x2a')](_0x35cf6a[_0x33cc('0x42')][_0x33cc('0x2a')]);}_0x320832[_0x33cc('0x4b')]=qs[_0x33cc('0x4c')](_0x35cf6a[_0x33cc('0x42')]['sort']);_0x320832[_0x33cc('0x4f')]=qs[_0x33cc('0x44')](_[_0x33cc('0x4d')](_0x35cf6a[_0x33cc('0x42')],_0x44607e['filters']));_0x320832['where'][_0x33cc('0x63')]=_0x1a0fa7['id'];if(_0x35cf6a[_0x33cc('0x42')][_0x33cc('0x4e')]){_0x320832[_0x33cc('0x4f')]=_[_0x33cc('0x50')](_0x320832[_0x33cc('0x4f')],{'$or':_[_0x33cc('0x41')](_0x320832['attributes'],function(_0x3be69a){var _0x5a66f6={};_0x5a66f6[_0x3be69a]={'$like':'%'+_0x35cf6a['query']['filter']+'%'};return _0x5a66f6;})});}_0x320832=_[_0x33cc('0x50')]({},_0x320832,_0x35cf6a[_0x33cc('0x52')]);return db[_0x33cc('0x9f')]['count']({'where':_0x320832[_0x33cc('0x4f')]})[_0x33cc('0x1c')](function(_0x48f65f){_0x9004c1[_0x33cc('0x2d')]=_0x48f65f;if(_0x35cf6a['query'][_0x33cc('0x53')]){_0x320832[_0x33cc('0x54')]=[{'model':db[_0x33cc('0xba')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x33cc('0xbb'),'attributes':['name','fullname',_0x33cc('0xbc')],'required':![]},{'model':db[_0x33cc('0xbd')],'as':_0x33cc('0xbe'),'attributes':['id','name',_0x33cc('0xbf')],'where':_0x35cf6a[_0x33cc('0x42')]['tag']?{'id':_0x35cf6a['query'][_0x33cc('0xc0')]}:undefined,'required':_0x35cf6a[_0x33cc('0x42')][_0x33cc('0xc0')]?!![]:![]}];}return db['SmsInteraction'][_0x33cc('0x66')](_0x320832);})[_0x33cc('0x1c')](function(_0x24ac1c){_0x9004c1[_0x33cc('0x55')]=_0x24ac1c;return _0x9004c1;});}})['then'](respondWithFilteredResult(_0x1757ef,_0x320832))[_0x33cc('0x25')](handleError(_0x1757ef,null));};exports[_0x33cc('0x37')]=function(_0x150991,_0x1efcde,_0x2fda83){var _0x3844be,_0x25c2fc,_0x3dc8f7;if(_[_0x33cc('0x90')](_0x150991['body']['body'])||_0x150991[_0x33cc('0x5a')][_0x33cc('0x5a')]===''){throw new db[(_0x33cc('0x91'))][(_0x33cc('0x75'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x33cc('0x90')](_0x150991['body']['to'])){throw new db[(_0x33cc('0x91'))]['ValidationError'](_0x33cc('0xc1'));}_0x3844be=_0x150991[_0x33cc('0x5a')]['to'];return db[_0x33cc('0x3b')][_0x33cc('0x58')]({'where':{'id':_0x150991['params']['id']},'include':[{'model':db[_0x33cc('0x98')],'as':_0x33cc('0xc2'),'include':[{'model':db[_0x33cc('0xba')],'as':'Contacts','where':{'mobile':_0x3844be},'limit':0x1,'order':[[_0x33cc('0x9a'),_0x33cc('0x9b')]]}]}]})[_0x33cc('0x1c')](handleEntityNotFound(_0x1efcde,null))[_0x33cc('0x1c')](function(_0x106d37){if(_0x106d37&&_0x106d37[_0x33cc('0xc2')]){_0x25c2fc=_0x106d37['get']({'plain':!![]});if(_0x25c2fc[_0x33cc('0xc2')]&&_0x25c2fc[_0x33cc('0xc2')][_0x33cc('0x99')][_0x33cc('0x48')]){return _0x25c2fc[_0x33cc('0xc2')][_0x33cc('0x99')][0x0];}return db['CmContact'][_0x33cc('0x59')](_[_0x33cc('0x15')](_0x150991[_0x33cc('0x5a')],{'firstName':_0x3844be,'mobile':_0x3844be,'phone':_0x3844be,'ListId':_0x25c2fc[_0x33cc('0x79')]}));}})[_0x33cc('0x1c')](handleEntityNotFound(_0x1efcde,null))[_0x33cc('0x1c')](function(_0x2f1358){if(_0x2f1358){_0x3dc8f7=_0x2f1358;return db['SmsInteraction'][_0x33cc('0x58')]({'where':{'ContactId':_0x3dc8f7['id'],'closed':![],'SmsAccountId':_0x25c2fc['id']}})[_0x33cc('0x1c')](function(_0x20de19){if(_0x20de19){return[_0x20de19,![]];}return db[_0x33cc('0x9f')]['create']({'UserId':_0x150991[_0x33cc('0x5b')]['id'],'ContactId':_0x3dc8f7['id'],'SmsAccountId':_0x25c2fc['id'],'phone':_0x3844be,'firstMsgDirection':'out','Messages':[_[_0x33cc('0x50')](_0x150991['body'],{'read':![],'body':_0x150991[_0x33cc('0x5a')][_0x33cc('0x5a')],'phone':_0x3844be,'SmsAccountId':_0x25c2fc['id'],'UserId':_0x150991[_0x33cc('0x5b')]['id'],'ContactId':_0x3dc8f7['id']})]},{'include':[{'model':db[_0x33cc('0xa6')],'as':_0x33cc('0xc3')}]})[_0x33cc('0x1c')](function(_0x4eae98){return[_0x4eae98,!![]];});});}})[_0x33cc('0xc4')](function(_0x2a5de5,_0x2fa0c0){if(_0x2fa0c0){return _0x2a5de5;}return db[_0x33cc('0xa6')][_0x33cc('0x59')](_[_0x33cc('0x50')](_0x150991[_0x33cc('0x5a')],{'read':![],'body':_0x150991['body'][_0x33cc('0x5a')],'phone':_0x3844be,'SmsAccountId':_0x25c2fc['id'],'SmsInteractionId':_0x2a5de5['id'],'UserId':_0x150991[_0x33cc('0x5b')]['id'],'ContactId':_0x3dc8f7['id']}))[_0x33cc('0x1c')](function(_0x3a43b1){_0x2a5de5[_0x33cc('0xc5')][_0x33cc('0xc3')]=[];_0x2a5de5[_0x33cc('0xc5')]['Messages'][_0x33cc('0xa3')](_0x3a43b1['dataValues']);return _0x2a5de5;});})[_0x33cc('0x1c')](respondWithResult(_0x1efcde,null))[_0x33cc('0x25')](handleError(_0x1efcde,null));};exports[_0x33cc('0x27')]=function(_0xa47ae4,_0x4910dd,_0x10cc42){if(_0xa47ae4[_0x33cc('0x5a')]['id']){delete _0xa47ae4['body']['id'];}var _0x3fb1a4,_0x1957fc,_0x36bdf8;return db[_0x33cc('0x3b')]['find']({'where':{'id':_0xa47ae4[_0x33cc('0x57')]['id']}})[_0x33cc('0x1c')](handleEntityNotFound(_0x4910dd,null))['then'](function(_0x2a372e){if(_0x2a372e){_0x36bdf8=_0x2a372e;logger[_0x33cc('0xb1')](_0x33cc('0xc6'),_0x33cc('0x27'),'received\x20delivery\x20report\x20from',_0x2a372e[_0x33cc('0x3e')],util[_0x33cc('0xc7')](_0xa47ae4['body'],{'showHidden':![],'depth':null}));switch(_0x2a372e[_0x33cc('0x3e')]){case'skebby':if(_0xa47ae4['body'][_0x33cc('0xc8')]&&_0xa47ae4[_0x33cc('0x5a')][_0x33cc('0x27')]){_0x1957fc=_0xa47ae4[_0x33cc('0x5a')]['status'];return db[_0x33cc('0xa6')]['find']({'where':{'messageId':_0xa47ae4[_0x33cc('0x5a')][_0x33cc('0xc8')]}});}break;case'connectel':if(_0xa47ae4[_0x33cc('0x5a')][_0x33cc('0xc9')]&&_0xa47ae4[_0x33cc('0x5a')][_0x33cc('0xca')]){_0x1957fc=_0xa47ae4[_0x33cc('0x5a')][_0x33cc('0xca')];return db['SmsMessage'][_0x33cc('0x58')]({'where':{'messageId':_0xa47ae4['body'][_0x33cc('0xc9')]}});}break;case _0x33cc('0x83'):if(_0xa47ae4[_0x33cc('0x5a')][_0x33cc('0x84')]&&_0xa47ae4[_0x33cc('0x5a')][_0x33cc('0xcb')]){_0x1957fc=_0xa47ae4['body'][_0x33cc('0xcb')];return db[_0x33cc('0xa6')][_0x33cc('0x58')]({'where':{'messageId':_0xa47ae4[_0x33cc('0x5a')][_0x33cc('0x84')]}});}break;case _0x33cc('0x88'):var _0x43f4d8=_0xa47ae4['body'][_0x33cc('0x89')][0x0];if(_0x43f4d8[_0x33cc('0x7d')]&&_0x43f4d8[_0x33cc('0x27')][_0x33cc('0xcc')]===_0x33cc('0xcd')){_0x1957fc=_0x43f4d8[_0x33cc('0x27')][_0x33cc('0xcc')];return db[_0x33cc('0xa6')][_0x33cc('0x58')]({'where':{'messageId':_0x43f4d8[_0x33cc('0x7d')]}});}break;case _0x33cc('0xce'):if(_0xa47ae4[_0x33cc('0x5a')][_0x33cc('0x7d')]&&_0xa47ae4[_0x33cc('0x5a')][_0x33cc('0x27')]){_0x1957fc=_0xa47ae4['body']['status'];return db['SmsMessage'][_0x33cc('0x58')]({'where':{'messageId':_0xa47ae4[_0x33cc('0x5a')][_0x33cc('0x7d')]}});}break;case _0x33cc('0xcf'):if(_0xa47ae4[_0x33cc('0x5a')][0x0]['message']['id']){_0x1957fc=_0xa47ae4[_0x33cc('0x5a')][0x0][_0x33cc('0x3e')];return db[_0x33cc('0xa6')][_0x33cc('0x58')]({'where':{'messageId':_0xa47ae4[_0x33cc('0x5a')][0x0][_0x33cc('0x22')]['id']}});}break;case _0x33cc('0xd0'):if(_0xa47ae4[_0x33cc('0x5a')][_0x33cc('0xd1')]&&_0xa47ae4['body']['status']){_0x1957fc=_0xa47ae4[_0x33cc('0x5a')][_0x33cc('0x27')];return db['SmsMessage']['find']({'where':{'messageId':_0xa47ae4[_0x33cc('0x5a')][_0x33cc('0xd1')]}});}break;}}})[_0x33cc('0x1c')](handleEntityNotFound(_0x4910dd,null))['then'](function(_0x28eac7){if(_0x28eac7){_0x3fb1a4=_0x28eac7;switch(_0x36bdf8[_0x33cc('0x3e')]){case _0x33cc('0x7f'):if(_0x1957fc===_0x33cc('0xcd')){return _0x3fb1a4[_0x33cc('0xd2')]({'read':!![]});}else{logger[_0x33cc('0x21')](_0x33cc('0xc6'),'status','skebby',util[_0x33cc('0xc7')](_0xa47ae4[_0x33cc('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x33cc('0x82'):if(_0x1957fc==='1'){return _0x3fb1a4[_0x33cc('0xd2')]({'read':!![]});}else{logger[_0x33cc('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x33cc('0x27'),'skebby',util[_0x33cc('0xc7')](_0xa47ae4['body'],{'showHidden':![],'depth':null}));}break;case _0x33cc('0x83'):if(!_0xa47ae4[_0x33cc('0x5a')][_0x33cc('0xd3')]&&_0x1957fc>=0xc8&&_0x1957fc<=0xce){return _0x3fb1a4['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x33cc('0x27'),_0x33cc('0x83'),util[_0x33cc('0xc7')](_0xa47ae4['body'],{'showHidden':![],'depth':null}));}break;case _0x33cc('0x88'):var _0x133df4=_0xa47ae4['body'][_0x33cc('0x89')][0x0];if(_0x133df4['status']['groupName']===_0x33cc('0xcd')){return _0x3fb1a4[_0x33cc('0xd2')]({'read':!![]});}else{logger[_0x33cc('0x21')](_0x33cc('0xc6'),'status','infobip',util[_0x33cc('0xc7')](_0xa47ae4[_0x33cc('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x33cc('0xce'):if(_0x1957fc==_0x33cc('0xd4')||_0x1957fc==_0x33cc('0xd5')){return _0x3fb1a4['update']({'read':!![]});}else{logger[_0x33cc('0x21')](_0x33cc('0xc6'),_0x33cc('0x27'),'clickatell',util['inspect'](_0xa47ae4[_0x33cc('0x5a')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x1957fc==_0x33cc('0xd6')){return _0x3fb1a4[_0x33cc('0xd2')]({'read':!![]});}else{logger[_0x33cc('0x21')](_0x33cc('0xc6'),'status',_0x33cc('0xcf'),util['inspect'](_0xa47ae4[_0x33cc('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x33cc('0xd0'):if(_0x1957fc==='DELIVRD'||_0x1957fc===_0x33cc('0xd7')){return _0x3fb1a4[_0x33cc('0xd2')]({'read':!![]});}else{logger[_0x33cc('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x33cc('0x27'),'intelepeer',util['inspect'](_0xa47ae4['body'],{'showHidden':![],'depth':null}));}break;}return _0x3fb1a4;}})[_0x33cc('0x1c')](respondWithResult(_0x4910dd,null))[_0x33cc('0x25')](handleError(_0x4910dd,null));};exports[_0x33cc('0xd8')]=function(_0x2695b3,_0x4cb1ec,_0x2beeb0){var _0x171e72,_0x126597,_0x7eeefb;return db[_0x33cc('0x3b')][_0x33cc('0x58')]({'where':{'id':_0x2695b3[_0x33cc('0x57')]['id']}})['then'](handleEntityNotFound(_0x4cb1ec,null))[_0x33cc('0x1c')](function(_0x137fea){if(_0x137fea){_0x7eeefb=_0x137fea;logger[_0x33cc('0xb1')](_0x33cc('0xc6'),_0x33cc('0x27'),_0x33cc('0xd9'),_0x137fea[_0x33cc('0x3e')],util[_0x33cc('0xc7')](_0x2695b3[_0x33cc('0x42')],{'showHidden':![],'depth':null}));switch(_0x137fea['type']){case _0x33cc('0x8a'):if(_0x2695b3['query'][_0x33cc('0xda')]&&_0x2695b3[_0x33cc('0x42')][_0x33cc('0xdb')]){_0x126597=_0x2695b3[_0x33cc('0x42')][_0x33cc('0xdb')];return db[_0x33cc('0xa6')]['find']({'where':{'messageId':_0x2695b3[_0x33cc('0x42')][_0x33cc('0xda')]}});}break;}}})[_0x33cc('0x1c')](handleEntityNotFound(_0x4cb1ec,null))['then'](function(_0x2b9399){if(_0x2b9399){_0x171e72=_0x2b9399;switch(_0x7eeefb[_0x33cc('0x3e')]){case _0x33cc('0x8a'):if(_0x126597==='2'||_0x126597==='6'){return _0x171e72['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x33cc('0x27'),_0x33cc('0x8a'),util[_0x33cc('0xc7')](_0x2695b3[_0x33cc('0x42')],{'showHidden':![],'depth':null}));};break;}return _0x171e72;}})[_0x33cc('0x1c')](respondWithResult(_0x4cb1ec,null))[_0x33cc('0x25')](handleError(_0x4cb1ec,null));};exports['addAgents']=function(_0x20f385,_0x10465e,_0xc9852b){return db[_0x33cc('0x3b')][_0x33cc('0x58')]({'where':{'id':_0x20f385[_0x33cc('0x57')]['id']}})['then'](handleEntityNotFound(_0x10465e,null))[_0x33cc('0x1c')](function(_0x1242b4){if(_0x1242b4){return _0x1242b4[_0x33cc('0xdc')](_0x20f385[_0x33cc('0x5a')]['ids'],_[_0x33cc('0x9d')](_0x20f385[_0x33cc('0x5a')],[_0x33cc('0x68'),'id'])||{})[_0x33cc('0xc4')](function(_0x133daa){for(var _0x304e54=0x0;_0x304e54<_0x20f385[_0x33cc('0x5a')][_0x33cc('0x68')]['length'];_0x304e54+=0x1){socket[_0x33cc('0xdd')](_0x33cc('0xde'),{'UserId':Number(_0x20f385[_0x33cc('0x5a')]['ids'][_0x304e54]),'SmsAccountId':Number(_0x20f385[_0x33cc('0x57')]['id'])});}return _0x133daa;});}})[_0x33cc('0x1c')](respondWithResult(_0x10465e,null))[_0x33cc('0x25')](handleError(_0x10465e,null));};exports[_0x33cc('0xdf')]=function(_0x23ee0f,_0x3cc8e8,_0x3a8a44){return db[_0x33cc('0x3b')][_0x33cc('0x58')]({'where':{'id':_0x23ee0f[_0x33cc('0x57')]['id']}})[_0x33cc('0x1c')](handleEntityNotFound(_0x3cc8e8,null))[_0x33cc('0x1c')](function(_0x57dafa){if(_0x57dafa){return _0x57dafa[_0x33cc('0xdf')](_0x23ee0f[_0x33cc('0x42')][_0x33cc('0x68')])[_0x33cc('0x1c')](function(){if(_[_0x33cc('0xe0')](_0x23ee0f[_0x33cc('0x42')][_0x33cc('0x68')])){for(var _0x19384d=0x0;_0x19384d<_0x23ee0f['query'][_0x33cc('0x68')][_0x33cc('0x48')];_0x19384d+=0x1){socket[_0x33cc('0xdd')](_0x33cc('0xe1'),{'UserId':Number(_0x23ee0f[_0x33cc('0x42')][_0x33cc('0x68')][_0x19384d]),'SmsAccountId':Number(_0x23ee0f['params']['id'])});}}else{socket[_0x33cc('0xdd')](_0x33cc('0xe1'),{'UserId':Number(_0x23ee0f[_0x33cc('0x42')][_0x33cc('0x68')]),'SmsAccountId':Number(_0x23ee0f[_0x33cc('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x3cc8e8,null))[_0x33cc('0x25')](handleError(_0x3cc8e8,null));};exports[_0x33cc('0xe2')]=function(_0x4a3a67,_0x33fa4e,_0x1012bd){var _0x24a2b6={};var _0x102df4={};var _0x3d11ee;var _0x3c1092;return db[_0x33cc('0x3b')][_0x33cc('0x65')]({'where':{'id':_0x4a3a67[_0x33cc('0x57')]['id']}})['then'](handleEntityNotFound(_0x33fa4e,null))[_0x33cc('0x1c')](function(_0x54fb5c){if(_0x54fb5c){_0x3d11ee=_0x54fb5c;_0x102df4[_0x33cc('0x40')]=_[_0x33cc('0x43')](db[_0x33cc('0xaa')][_0x33cc('0x3c')]);_0x102df4[_0x33cc('0x42')]=_[_0x33cc('0x43')](_0x4a3a67['query']);_0x102df4['filters']=_['intersection'](_0x102df4[_0x33cc('0x40')],_0x102df4[_0x33cc('0x42')]);_0x24a2b6[_0x33cc('0x46')]=_['intersection'](_0x102df4[_0x33cc('0x40')],qs[_0x33cc('0x47')](_0x4a3a67[_0x33cc('0x42')][_0x33cc('0x47')]));_0x24a2b6[_0x33cc('0x46')]=_0x24a2b6[_0x33cc('0x46')]['length']?_0x24a2b6[_0x33cc('0x46')]:_0x102df4[_0x33cc('0x40')];_0x24a2b6[_0x33cc('0x4b')]=qs[_0x33cc('0x4c')](_0x4a3a67['query']['sort']);_0x24a2b6[_0x33cc('0x4f')]=qs[_0x33cc('0x44')](_[_0x33cc('0x4d')](_0x4a3a67[_0x33cc('0x42')],_0x102df4[_0x33cc('0x44')]));if(_0x4a3a67['query'][_0x33cc('0x4e')]){_0x24a2b6['where']=_[_0x33cc('0x50')](_0x24a2b6[_0x33cc('0x4f')],{'$or':_[_0x33cc('0x41')](_0x24a2b6['attributes'],function(_0x59787d){var _0x2316c8={};_0x2316c8[_0x59787d]={'$like':'%'+_0x4a3a67[_0x33cc('0x42')][_0x33cc('0x4e')]+'%'};return _0x2316c8;})});}_0x24a2b6=_['merge']({},_0x24a2b6,_0x4a3a67[_0x33cc('0x52')]);return _0x3d11ee[_0x33cc('0xe2')](_0x24a2b6);}})['then'](function(_0x4fb65a){if(_0x4fb65a){_0x3c1092=_0x4fb65a[_0x33cc('0x48')];if(!_0x4a3a67[_0x33cc('0x42')][_0x33cc('0x49')](_0x33cc('0x4a'))){_0x24a2b6['limit']=qs[_0x33cc('0x2c')](_0x4a3a67[_0x33cc('0x42')][_0x33cc('0x2c')]);_0x24a2b6[_0x33cc('0x2a')]=qs[_0x33cc('0x2a')](_0x4a3a67[_0x33cc('0x42')][_0x33cc('0x2a')]);}return _0x3d11ee['getAgents'](_0x24a2b6);}})['then'](function(_0x345f3c){if(_0x345f3c){return _0x345f3c?{'count':_0x3c1092,'rows':_0x345f3c}:null;}})['then'](respondWithResult(_0x33fa4e,null))['catch'](handleError(_0x33fa4e,null));}; \ No newline at end of file +var _0xd886=['userSmsAccount:save','removeAgents','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','client','http','request','then','info','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','SmsAccount,\x20%s,\x20%s','message','result','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','get','SmsAccounts','UserProfileResource','end','stack','name','send','index','mandatoryDispositionPause','map','SmsAccount','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','merge','where','filter','options','includeAll','include','findAll','rows','catch','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','Pause','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','nolimit','removeAnswers','notify','sms','account','applications','orderBy','Applications','priority','asc','CmContact','Sequelize','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','Body','MessageSid','skebby','sender','connectel','from','clicksend','messageId','plivo','From','MessageUUID','infobip','results','text','segmentedMessage','fromNumber','refid','isNil','ValidationError','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','list','defaults','contact','SmsInteraction','spread','interaction','autoclose','close','unmanaged','created','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','\x0a','sequelize','transaction','SmsApplication','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','push','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','message_id','status_code','groupName','DELIVERED','clickatell','bandwidth','intelepeer','redif','error_code','DELIVERED_TO_GATEWAY','message-delivered','DELIVRD','ACCEPTD','statusGet','csc','message-id','addAgents','omit','emit'];(function(_0x359bf5,_0x20c418){var _0x2ebad8=function(_0x1cdbf2){while(--_0x1cdbf2){_0x359bf5['push'](_0x359bf5['shift']());}};_0x2ebad8(++_0x20c418);}(_0xd886,0xeb));var _0x6d88=function(_0x34e868,_0x8f70){_0x34e868=_0x34e868-0x0;var _0x2e90a6=_0xd886[_0x34e868];return _0x2e90a6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6d88('0x0'));var zipdir=require(_0x6d88('0x1'));var jsonpatch=require(_0x6d88('0x2'));var rp=require(_0x6d88('0x3'));var moment=require(_0x6d88('0x4'));var BPromise=require(_0x6d88('0x5'));var Mustache=require(_0x6d88('0x6'));var util=require(_0x6d88('0x7'));var path=require(_0x6d88('0x8'));var sox=require(_0x6d88('0x9'));var csv=require(_0x6d88('0xa'));var ejs=require(_0x6d88('0xb'));var fs=require('fs');var fs_extra=require(_0x6d88('0xc'));var _=require(_0x6d88('0xd'));var squel=require(_0x6d88('0xe'));var crypto=require(_0x6d88('0xf'));var jsforce=require(_0x6d88('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x6d88('0xa'));var querystring=require('querystring');var Papa=require(_0x6d88('0x11'));var Redis=require(_0x6d88('0x12'));var authService=require(_0x6d88('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6d88('0x14'));var logger=require(_0x6d88('0x15'))(_0x6d88('0x16'));var utils=require(_0x6d88('0x17'));var config=require(_0x6d88('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x6d88('0x19'))['db'];config['redis']=_['defaults'](config[_0x6d88('0x1a')],{'host':_0x6d88('0x1b'),'port':0x18eb});var socket=require(_0x6d88('0x1c'))(new Redis(config['redis']));require('./smsAccount.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x6d88('0x1d')][_0x6d88('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x4d05f4,_0x4cadd5,_0x2afa08,_0x362732){return new BPromise(function(_0x558b99,_0xeca92a){var _0x4a6aa6=_0x362732||client;return _0x4a6aa6[_0x6d88('0x1f')](_0x4d05f4,_0x2afa08)[_0x6d88('0x20')](function(_0x2b6af8){logger[_0x6d88('0x21')]('SmsAccount,\x20%s,\x20%s',_0x4cadd5,'request\x20sent');logger[_0x6d88('0x22')](_0x6d88('0x23'),_0x4cadd5,_0x6d88('0x24'),JSON[_0x6d88('0x25')](_0x2b6af8));if(_0x2b6af8['error']){if(_0x2b6af8['error'][_0x6d88('0x26')]===0x1f4){logger[_0x6d88('0x27')](_0x6d88('0x28'),_0x4cadd5,_0x2b6af8[_0x6d88('0x27')][_0x6d88('0x29')]);return _0xeca92a(_0x2b6af8[_0x6d88('0x27')][_0x6d88('0x29')]);}logger['error'](_0x6d88('0x28'),_0x4cadd5,_0x2b6af8[_0x6d88('0x27')]['message']);return _0x558b99(_0x2b6af8['error']['message']);}else{logger['info'](_0x6d88('0x28'),_0x4cadd5,_0x6d88('0x24'));_0x558b99(_0x2b6af8[_0x6d88('0x2a')][_0x6d88('0x29')]);}})['catch'](function(_0x5f063c){logger[_0x6d88('0x27')](_0x6d88('0x28'),_0x4cadd5,_0x5f063c);_0xeca92a(_0x5f063c);});});}function respondWithStatusCode(_0xe9edc4,_0x39fa13){_0x39fa13=_0x39fa13||0xcc;return function(_0x14f066){if(_0x14f066){return _0xe9edc4[_0x6d88('0x2b')](_0x39fa13);}return _0xe9edc4[_0x6d88('0x2c')](_0x39fa13)['end']();};}function respondWithResult(_0x1c0552,_0x3bb72a){_0x3bb72a=_0x3bb72a||0xc8;return function(_0x492c6f){if(_0x492c6f){return _0x1c0552['status'](_0x3bb72a)[_0x6d88('0x2d')](_0x492c6f);}};}function respondWithFilteredResult(_0x683348,_0x1ec792){return function(_0x4f806b){if(_0x4f806b){var _0x32e886=typeof _0x1ec792[_0x6d88('0x2e')]===_0x6d88('0x2f')&&typeof _0x1ec792[_0x6d88('0x30')]===_0x6d88('0x2f');var _0x5be9e0=_0x4f806b[_0x6d88('0x31')];var _0x252d4e=_0x32e886?0x0:_0x1ec792[_0x6d88('0x2e')];var _0x2a6f07=_0x32e886?_0x4f806b[_0x6d88('0x31')]:_0x1ec792['offset']+_0x1ec792[_0x6d88('0x30')];var _0x3c3ae4;if(_0x2a6f07>=_0x5be9e0){_0x2a6f07=_0x5be9e0;_0x3c3ae4=0xc8;}else{_0x3c3ae4=0xce;}_0x683348[_0x6d88('0x2c')](_0x3c3ae4);return _0x683348[_0x6d88('0x32')](_0x6d88('0x33'),_0x252d4e+'-'+_0x2a6f07+'/'+_0x5be9e0)[_0x6d88('0x2d')](_0x4f806b);}return null;};}function patchUpdates(_0x37400c){return function(_0xdd42a0){try{jsonpatch['apply'](_0xdd42a0,_0x37400c,!![]);}catch(_0x550b5a){return BPromise['reject'](_0x550b5a);}return _0xdd42a0[_0x6d88('0x34')]();};}function saveUpdates(_0x4f2b91,_0x5a9a83){return function(_0x2e4f40){if(_0x2e4f40){return _0x2e4f40[_0x6d88('0x35')](_0x4f2b91)[_0x6d88('0x20')](function(_0x16c7e6){return _0x16c7e6;});}return null;};}function removeEntity(_0x4cc0b0,_0x985366){return function(_0x23c6d5){if(_0x23c6d5){return _0x23c6d5[_0x6d88('0x36')]()['then'](function(){var _0x342ed5=_0x23c6d5[_0x6d88('0x37')]({'plain':!![]});var _0x581554=_0x6d88('0x38');return db[_0x6d88('0x39')][_0x6d88('0x36')]({'where':{'type':_0x581554,'resourceId':_0x342ed5['id']}})['then'](function(){return _0x23c6d5;});})[_0x6d88('0x20')](function(){_0x4cc0b0[_0x6d88('0x2c')](0xcc)[_0x6d88('0x3a')]();});}};}function handleEntityNotFound(_0x213e5e,_0x466373){return function(_0xa6093c){if(!_0xa6093c){_0x213e5e[_0x6d88('0x2b')](0x194);}return _0xa6093c;};}function handleError(_0x99b7f5,_0x49a686){_0x49a686=_0x49a686||0x1f4;return function(_0x5e2510){logger['error'](_0x5e2510[_0x6d88('0x3b')]);if(_0x5e2510[_0x6d88('0x3c')]){delete _0x5e2510['name'];}_0x99b7f5[_0x6d88('0x2c')](_0x49a686)[_0x6d88('0x3d')](_0x5e2510);};}exports[_0x6d88('0x3e')]=function(_0x55874f,_0x57f180){var _0x22d4be={'include':[{'model':db['Pause'],'as':_0x6d88('0x3f')}]},_0x46d1c3={},_0x28edd5={'count':0x0,'rows':[]};var _0x57303a=_[_0x6d88('0x40')](db[_0x6d88('0x41')]['rawAttributes'],function(_0x4495b9){return{'name':_0x4495b9[_0x6d88('0x42')],'type':_0x4495b9[_0x6d88('0x43')][_0x6d88('0x44')]};});_0x46d1c3[_0x6d88('0x45')]=_['map'](_0x57303a,_0x6d88('0x3c'));_0x46d1c3[_0x6d88('0x46')]=_[_0x6d88('0x47')](_0x55874f[_0x6d88('0x46')]);_0x46d1c3['filters']=_[_0x6d88('0x48')](_0x46d1c3[_0x6d88('0x45')],_0x46d1c3[_0x6d88('0x46')]);_0x22d4be[_0x6d88('0x49')]=_[_0x6d88('0x48')](_0x46d1c3[_0x6d88('0x45')],qs[_0x6d88('0x4a')](_0x55874f[_0x6d88('0x46')]['fields']));_0x22d4be[_0x6d88('0x49')]=_0x22d4be[_0x6d88('0x49')][_0x6d88('0x4b')]?_0x22d4be[_0x6d88('0x49')]:_0x46d1c3[_0x6d88('0x45')];if(!_0x55874f[_0x6d88('0x46')][_0x6d88('0x4c')]('nolimit')){_0x22d4be[_0x6d88('0x30')]=qs[_0x6d88('0x30')](_0x55874f['query'][_0x6d88('0x30')]);_0x22d4be[_0x6d88('0x2e')]=qs[_0x6d88('0x2e')](_0x55874f[_0x6d88('0x46')][_0x6d88('0x2e')]);}_0x22d4be[_0x6d88('0x4d')]=qs[_0x6d88('0x4e')](_0x55874f[_0x6d88('0x46')][_0x6d88('0x4e')]);_0x22d4be['where']=qs['filters'](_['pick'](_0x55874f[_0x6d88('0x46')],_0x46d1c3[_0x6d88('0x4f')]),_0x57303a);if(_0x55874f[_0x6d88('0x46')]['filter']){_0x22d4be['where']=_[_0x6d88('0x50')](_0x22d4be[_0x6d88('0x51')],{'$or':_['map'](_0x57303a,function(_0x3389ef){if(_0x3389ef['type']!=='VIRTUAL'){var _0x40743e={};_0x40743e[_0x3389ef[_0x6d88('0x3c')]]={'$like':'%'+_0x55874f[_0x6d88('0x46')][_0x6d88('0x52')]+'%'};return _0x40743e;}})});}_0x22d4be=_[_0x6d88('0x50')]({},_0x22d4be,_0x55874f[_0x6d88('0x53')]);var _0x29c410={'where':_0x22d4be[_0x6d88('0x51')]};return db['SmsAccount'][_0x6d88('0x31')](_0x29c410)[_0x6d88('0x20')](function(_0x49a078){_0x28edd5[_0x6d88('0x31')]=_0x49a078;if(_0x55874f[_0x6d88('0x46')][_0x6d88('0x54')]){_0x22d4be[_0x6d88('0x55')]=[{'all':!![]}];}return db[_0x6d88('0x41')][_0x6d88('0x56')](_0x22d4be);})[_0x6d88('0x20')](function(_0x59e721){_0x28edd5[_0x6d88('0x57')]=_0x59e721;return _0x28edd5;})['then'](respondWithFilteredResult(_0x57f180,_0x22d4be))[_0x6d88('0x58')](handleError(_0x57f180,null));};exports['show']=function(_0x3dbb4a,_0x30efd7){var _0x314a6f={'raw':![],'where':{'id':_0x3dbb4a['params']['id']},'include':[{'model':db['Pause'],'as':_0x6d88('0x3f')}]},_0x12e233={};_0x12e233['model']=_[_0x6d88('0x47')](db[_0x6d88('0x41')][_0x6d88('0x59')]);_0x12e233[_0x6d88('0x46')]=_[_0x6d88('0x47')](_0x3dbb4a[_0x6d88('0x46')]);_0x12e233[_0x6d88('0x4f')]=_[_0x6d88('0x48')](_0x12e233[_0x6d88('0x45')],_0x12e233[_0x6d88('0x46')]);_0x314a6f[_0x6d88('0x49')]=_[_0x6d88('0x48')](_0x12e233['model'],qs[_0x6d88('0x4a')](_0x3dbb4a[_0x6d88('0x46')]['fields']));_0x314a6f['attributes']=_0x314a6f[_0x6d88('0x49')][_0x6d88('0x4b')]?_0x314a6f[_0x6d88('0x49')]:_0x12e233[_0x6d88('0x45')];if(_0x3dbb4a['query'][_0x6d88('0x54')]){_0x314a6f[_0x6d88('0x55')]=[{'all':!![]}];}_0x314a6f=_[_0x6d88('0x50')]({},_0x314a6f,_0x3dbb4a[_0x6d88('0x53')]);return db[_0x6d88('0x41')]['find'](_0x314a6f)['then'](handleEntityNotFound(_0x30efd7,null))[_0x6d88('0x20')](respondWithResult(_0x30efd7,null))['catch'](handleError(_0x30efd7,null));};exports[_0x6d88('0x5a')]=function(_0x2fab98,_0x5b0537){return db[_0x6d88('0x41')][_0x6d88('0x5a')](_0x2fab98[_0x6d88('0x5b')],{})[_0x6d88('0x20')](function(_0x10121f){var _0x55b4b8=_0x2fab98[_0x6d88('0x5c')][_0x6d88('0x37')]({'plain':!![]});if(!_0x55b4b8)throw new Error(_0x6d88('0x5d'));if(_0x55b4b8['role']===_0x6d88('0x5c')){var _0x3b83c9=_0x10121f['get']({'plain':!![]});var _0x458ba8='SmsAccounts';return db[_0x6d88('0x5e')]['find']({'where':{'name':_0x458ba8,'userProfileId':_0x55b4b8[_0x6d88('0x5f')]},'raw':!![]})[_0x6d88('0x20')](function(_0x20f3b9){if(_0x20f3b9&&_0x20f3b9[_0x6d88('0x60')]===0x0){return db[_0x6d88('0x39')][_0x6d88('0x5a')]({'name':_0x3b83c9['name'],'resourceId':_0x3b83c9['id'],'type':_0x20f3b9[_0x6d88('0x3c')],'sectionId':_0x20f3b9['id']},{})[_0x6d88('0x20')](function(){return _0x10121f;});}else{return _0x10121f;}})[_0x6d88('0x58')](function(_0x2e55fe){logger[_0x6d88('0x27')](_0x6d88('0x61'),_0x2e55fe);throw _0x2e55fe;});}return _0x10121f;})['then'](respondWithResult(_0x5b0537,0xc9))[_0x6d88('0x58')](handleError(_0x5b0537,null));};exports[_0x6d88('0x35')]=function(_0x29db2a,_0x42c4d4){if(_0x29db2a[_0x6d88('0x5b')]['id']){delete _0x29db2a['body']['id'];}return db[_0x6d88('0x41')][_0x6d88('0x62')]({'where':{'id':_0x29db2a[_0x6d88('0x63')]['id']},'include':[{'model':db[_0x6d88('0x64')],'as':_0x6d88('0x3f')}]})[_0x6d88('0x20')](handleEntityNotFound(_0x42c4d4,null))[_0x6d88('0x20')](saveUpdates(_0x29db2a[_0x6d88('0x5b')],null))[_0x6d88('0x20')](respondWithResult(_0x42c4d4,null))['catch'](handleError(_0x42c4d4,null));};exports[_0x6d88('0x36')]=function(_0x5c102d,_0x4d11cb){return db[_0x6d88('0x41')][_0x6d88('0x62')]({'where':{'id':_0x5c102d[_0x6d88('0x63')]['id']}})['then'](handleEntityNotFound(_0x4d11cb,null))[_0x6d88('0x20')](removeEntity(_0x4d11cb,null))[_0x6d88('0x58')](handleError(_0x4d11cb,null));};exports[_0x6d88('0x65')]=function(_0x30cb3b,_0x2be494){return db[_0x6d88('0x41')]['describe']()[_0x6d88('0x20')](respondWithResult(_0x2be494,null))[_0x6d88('0x58')](handleError(_0x2be494,null));};exports[_0x6d88('0x66')]=function(_0x1ce8d0,_0x5c2070,_0x26819d){if(_0x1ce8d0['body']['id']){delete _0x1ce8d0[_0x6d88('0x5b')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x1ce8d0[_0x6d88('0x63')]['id']}})[_0x6d88('0x20')](handleEntityNotFound(_0x5c2070,null))['then'](function(_0x344120){if(_0x344120){_0x1ce8d0[_0x6d88('0x5b')][_0x6d88('0x67')]=_0x344120['id'];return db[_0x6d88('0x68')][_0x6d88('0x5a')](_0x1ce8d0[_0x6d88('0x5b')]);}})[_0x6d88('0x20')](respondWithResult(_0x5c2070,null))['catch'](handleError(_0x5c2070,null));};exports[_0x6d88('0x69')]=function(_0x5e4a9d,_0xf16279,_0x6ae2c){var _0x372b97={'raw':![],'where':{}};var _0x71f1ad={};var _0x1fe1f2={'count':0x0,'rows':[]};return db['SmsAccount'][_0x6d88('0x6a')]({'where':{'id':_0x5e4a9d[_0x6d88('0x63')]['id']}})[_0x6d88('0x20')](handleEntityNotFound(_0xf16279,null))['then'](function(_0x555b42){if(_0x555b42){_0x71f1ad['model']=_[_0x6d88('0x47')](db[_0x6d88('0x68')][_0x6d88('0x59')]);_0x71f1ad['query']=_[_0x6d88('0x47')](_0x5e4a9d[_0x6d88('0x46')]);_0x71f1ad[_0x6d88('0x4f')]=_[_0x6d88('0x48')](_0x71f1ad[_0x6d88('0x45')],_0x71f1ad[_0x6d88('0x46')]);_0x372b97[_0x6d88('0x49')]=_[_0x6d88('0x48')](_0x71f1ad[_0x6d88('0x45')],qs[_0x6d88('0x4a')](_0x5e4a9d[_0x6d88('0x46')][_0x6d88('0x4a')]));_0x372b97['attributes']=_0x372b97[_0x6d88('0x49')][_0x6d88('0x4b')]?_0x372b97['attributes']:_0x71f1ad[_0x6d88('0x45')];if(!_0x5e4a9d[_0x6d88('0x46')]['hasOwnProperty']('nolimit')){_0x372b97[_0x6d88('0x30')]=qs[_0x6d88('0x30')](_0x5e4a9d['query'][_0x6d88('0x30')]);_0x372b97[_0x6d88('0x2e')]=qs[_0x6d88('0x2e')](_0x5e4a9d[_0x6d88('0x46')][_0x6d88('0x2e')]);}_0x372b97['order']=qs[_0x6d88('0x4e')](_0x5e4a9d[_0x6d88('0x46')]['sort']);_0x372b97['where']=qs['filters'](_[_0x6d88('0x6b')](_0x5e4a9d[_0x6d88('0x46')],_0x71f1ad[_0x6d88('0x4f')]));_0x372b97[_0x6d88('0x51')][_0x6d88('0x67')]=_0x555b42['id'];if(_0x5e4a9d['query'][_0x6d88('0x52')]){_0x372b97[_0x6d88('0x51')]=_[_0x6d88('0x50')](_0x372b97[_0x6d88('0x51')],{'$or':_[_0x6d88('0x40')](_0x372b97[_0x6d88('0x49')],function(_0x48bdf8){var _0x2fb0d7={};_0x2fb0d7[_0x48bdf8]={'$like':'%'+_0x5e4a9d[_0x6d88('0x46')][_0x6d88('0x52')]+'%'};return _0x2fb0d7;})});}_0x372b97=_[_0x6d88('0x50')]({},_0x372b97,_0x5e4a9d[_0x6d88('0x53')]);return db[_0x6d88('0x68')]['count']({'where':_0x372b97[_0x6d88('0x51')]})[_0x6d88('0x20')](function(_0xe181b1){_0x1fe1f2[_0x6d88('0x31')]=_0xe181b1;if(_0x5e4a9d['query']['includeAll']){_0x372b97['include']=[{'all':!![]}];}return db['Disposition'][_0x6d88('0x56')](_0x372b97);})[_0x6d88('0x20')](function(_0x583db2){_0x1fe1f2[_0x6d88('0x57')]=_0x583db2;return _0x1fe1f2;});}})[_0x6d88('0x20')](respondWithFilteredResult(_0xf16279,_0x372b97))['catch'](handleError(_0xf16279,null));};exports[_0x6d88('0x6c')]=function(_0x48ba54,_0xf1d79c,_0x1236f2){return db[_0x6d88('0x41')][_0x6d88('0x62')]({'where':{'id':_0x48ba54[_0x6d88('0x63')]['id']}})[_0x6d88('0x20')](handleEntityNotFound(_0xf1d79c,null))[_0x6d88('0x20')](function(_0x5b5603){if(_0x5b5603){return _0x5b5603['removeDispositions'](_0x48ba54[_0x6d88('0x46')][_0x6d88('0x6d')]);}})['then'](respondWithStatusCode(_0xf1d79c,null))['catch'](handleError(_0xf1d79c,null));};exports[_0x6d88('0x6e')]=function(_0x2aab3b,_0x53e73c,_0xf59e1c){if(_0x2aab3b[_0x6d88('0x5b')]['id']){delete _0x2aab3b[_0x6d88('0x5b')]['id'];}return db['SmsAccount'][_0x6d88('0x62')]({'where':{'id':_0x2aab3b[_0x6d88('0x63')]['id']}})[_0x6d88('0x20')](handleEntityNotFound(_0x53e73c,null))[_0x6d88('0x20')](function(_0x23624f){if(_0x23624f){_0x2aab3b[_0x6d88('0x5b')][_0x6d88('0x67')]=_0x23624f['id'];return db[_0x6d88('0x6f')][_0x6d88('0x5a')](_0x2aab3b[_0x6d88('0x5b')]);}})[_0x6d88('0x20')](respondWithResult(_0x53e73c,null))[_0x6d88('0x58')](handleError(_0x53e73c,null));};exports[_0x6d88('0x70')]=function(_0x199d3c,_0x9e67fc,_0x473795){var _0x28b28d={'raw':![],'where':{}};var _0xc517e6={};var _0x4959fa={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x199d3c[_0x6d88('0x63')]['id']}})[_0x6d88('0x20')](handleEntityNotFound(_0x9e67fc,null))[_0x6d88('0x20')](function(_0x490bf1){if(_0x490bf1){_0xc517e6['model']=_[_0x6d88('0x47')](db[_0x6d88('0x6f')][_0x6d88('0x59')]);_0xc517e6[_0x6d88('0x46')]=_['keys'](_0x199d3c[_0x6d88('0x46')]);_0xc517e6[_0x6d88('0x4f')]=_['intersection'](_0xc517e6['model'],_0xc517e6[_0x6d88('0x46')]);_0x28b28d[_0x6d88('0x49')]=_[_0x6d88('0x48')](_0xc517e6['model'],qs[_0x6d88('0x4a')](_0x199d3c['query'][_0x6d88('0x4a')]));_0x28b28d[_0x6d88('0x49')]=_0x28b28d[_0x6d88('0x49')][_0x6d88('0x4b')]?_0x28b28d[_0x6d88('0x49')]:_0xc517e6[_0x6d88('0x45')];if(!_0x199d3c[_0x6d88('0x46')][_0x6d88('0x4c')](_0x6d88('0x71'))){_0x28b28d[_0x6d88('0x30')]=qs['limit'](_0x199d3c[_0x6d88('0x46')][_0x6d88('0x30')]);_0x28b28d[_0x6d88('0x2e')]=qs[_0x6d88('0x2e')](_0x199d3c[_0x6d88('0x46')]['offset']);}_0x28b28d[_0x6d88('0x4d')]=qs[_0x6d88('0x4e')](_0x199d3c[_0x6d88('0x46')][_0x6d88('0x4e')]);_0x28b28d[_0x6d88('0x51')]=qs[_0x6d88('0x4f')](_[_0x6d88('0x6b')](_0x199d3c[_0x6d88('0x46')],_0xc517e6[_0x6d88('0x4f')]));_0x28b28d[_0x6d88('0x51')][_0x6d88('0x67')]=_0x490bf1['id'];if(_0x199d3c[_0x6d88('0x46')][_0x6d88('0x52')]){_0x28b28d['where']=_[_0x6d88('0x50')](_0x28b28d[_0x6d88('0x51')],{'$or':_[_0x6d88('0x40')](_0x28b28d[_0x6d88('0x49')],function(_0x53f81f){var _0x24d0d9={};_0x24d0d9[_0x53f81f]={'$like':'%'+_0x199d3c[_0x6d88('0x46')]['filter']+'%'};return _0x24d0d9;})});}_0x28b28d=_[_0x6d88('0x50')]({},_0x28b28d,_0x199d3c['options']);return db['CannedAnswer'][_0x6d88('0x31')]({'where':_0x28b28d['where']})[_0x6d88('0x20')](function(_0x196f2b){_0x4959fa['count']=_0x196f2b;if(_0x199d3c[_0x6d88('0x46')][_0x6d88('0x54')]){_0x28b28d[_0x6d88('0x55')]=[{'all':!![]}];}return db[_0x6d88('0x6f')][_0x6d88('0x56')](_0x28b28d);})['then'](function(_0x2768e2){_0x4959fa['rows']=_0x2768e2;return _0x4959fa;});}})[_0x6d88('0x20')](respondWithFilteredResult(_0x9e67fc,_0x28b28d))[_0x6d88('0x58')](handleError(_0x9e67fc,null));};exports[_0x6d88('0x72')]=function(_0x141f16,_0x2a36dc,_0x3ebaee){return db[_0x6d88('0x41')][_0x6d88('0x62')]({'where':{'id':_0x141f16[_0x6d88('0x63')]['id']}})[_0x6d88('0x20')](handleEntityNotFound(_0x2a36dc,null))[_0x6d88('0x20')](function(_0x233ef6){if(_0x233ef6){return _0x233ef6[_0x6d88('0x72')](_0x141f16['query'][_0x6d88('0x6d')]);}})[_0x6d88('0x20')](respondWithStatusCode(_0x2a36dc,null))['catch'](handleError(_0x2a36dc,null));};exports[_0x6d88('0x73')]=function(_0x107ea2,_0x2fae20,_0x3ce97c){var _0x5dcfee={'channel':_0x6d88('0x74')};var _0x574a98=[];var _0x2c646e=[];var _0x3b92b4={};return db[_0x6d88('0x41')]['find']({'where':{'id':_0x107ea2[_0x6d88('0x63')]['id']},'include':[{'model':db['SmsApplication'],'as':'Applications'}]})[_0x6d88('0x20')](handleEntityNotFound(_0x2fae20,null))[_0x6d88('0x20')](function(_0x3a10c6){_0x5dcfee[_0x6d88('0x75')]=_0x3a10c6;_0x5dcfee[_0x6d88('0x76')]=_[_0x6d88('0x77')](_0x3a10c6[_0x6d88('0x78')],[_0x6d88('0x79')],[_0x6d88('0x7a')]);if(_0x5dcfee[_0x6d88('0x75')][_0x6d88('0x78')]){delete _0x5dcfee[_0x6d88('0x75')][_0x6d88('0x78')];}return db[_0x6d88('0x7b')][_0x6d88('0x65')]();})[_0x6d88('0x20')](function(_0x5d4550){if(!_0x5d4550){throw new db[(_0x6d88('0x7c'))]['ValidationError']('no\x20available\x20attributes');}_0x574a98=_[_0x6d88('0x7d')](_[_0x6d88('0x47')](_0x5d4550),[_0x6d88('0x7e'),_0x6d88('0x7f')]);_0x2c646e=_[_0x6d88('0x7d')](_[_0x6d88('0x47')](_0x5d4550),[_0x6d88('0x7e'),_0x6d88('0x7f'),_0x6d88('0x80'),_0x6d88('0x81')]);_0x5dcfee[_0x6d88('0x5b')]={'mapKey':_0x6d88('0x82')};if(_0x5dcfee[_0x6d88('0x75')][_0x6d88('0x43')]){switch(_0x5dcfee['account']['type']){case _0x6d88('0x83'):_0x5dcfee[_0x6d88('0x5b')]['from']=_0x107ea2[_0x6d88('0x5b')]['From'];_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x5b')]=_0x107ea2[_0x6d88('0x5b')][_0x6d88('0x84')];_0x5dcfee['body']['messageId']=_0x107ea2['body'][_0x6d88('0x85')];break;case _0x6d88('0x86'):_0x5dcfee['body']['from']='+'+_0x107ea2[_0x6d88('0x5b')][_0x6d88('0x87')];_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x5b')]=_0x107ea2['body']['text'];break;case _0x6d88('0x88'):_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x89')]=_0x107ea2[_0x6d88('0x5b')][_0x6d88('0x89')];_0x5dcfee['body'][_0x6d88('0x5b')]=_0x107ea2[_0x6d88('0x5b')][_0x6d88('0x29')];break;case _0x6d88('0x8a'):_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x89')]=_0x107ea2['body'][_0x6d88('0x89')];_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x5b')]=_0x107ea2[_0x6d88('0x5b')][_0x6d88('0x5b')];_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x8b')]=_0x107ea2['body']['message_id'];break;case _0x6d88('0x8c'):_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x89')]=_0x107ea2[_0x6d88('0x5b')][_0x6d88('0x8d')];_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x5b')]=_0x107ea2[_0x6d88('0x5b')]['Text'];_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x8b')]=_0x107ea2[_0x6d88('0x5b')][_0x6d88('0x8e')];break;case _0x6d88('0x8f'):_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x89')]='+'+_0x107ea2[_0x6d88('0x5b')][_0x6d88('0x90')][0x0]['from'];_0x5dcfee[_0x6d88('0x5b')]['body']=_0x107ea2[_0x6d88('0x5b')]['results'][0x0][_0x6d88('0x91')];_0x5dcfee['body'][_0x6d88('0x8b')]=_0x107ea2[_0x6d88('0x5b')][_0x6d88('0x90')][0x0][_0x6d88('0x8b')];break;case'csc':_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x89')]=_0x107ea2[_0x6d88('0x5b')]['originatingAddress'];_0x5dcfee[_0x6d88('0x5b')]['body']=_0x107ea2[_0x6d88('0x5b')][_0x6d88('0x92')][_0x6d88('0x29')];break;case'clickatell':_0x5dcfee[_0x6d88('0x5b')]['from']=_0x107ea2['body'][_0x6d88('0x93')];_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x5b')]=_0x107ea2[_0x6d88('0x5b')][_0x6d88('0x91')];_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x8b')]=_0x107ea2[_0x6d88('0x5b')]['replyMessageId'];break;case'bandwidth':_0x5dcfee['body'][_0x6d88('0x8b')]=_0x107ea2[_0x6d88('0x5b')][0x0]['message']['id'];_0x5dcfee['body'][_0x6d88('0x89')]=_0x107ea2[_0x6d88('0x5b')][0x0][_0x6d88('0x29')]['from'];_0x5dcfee['body'][_0x6d88('0x5b')]=_0x107ea2[_0x6d88('0x5b')][0x0]['message'][_0x6d88('0x91')];break;case'intelepeer':_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x89')]=_0x107ea2[_0x6d88('0x5b')]['from'];_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x5b')]=_0x107ea2[_0x6d88('0x5b')][_0x6d88('0x29')];_0x5dcfee[_0x6d88('0x5b')]['messageId']=_0x107ea2[_0x6d88('0x5b')][_0x6d88('0x94')];break;}}if(_0x5dcfee[_0x6d88('0x5b')]['id']){delete _0x5dcfee[_0x6d88('0x5b')]['id'];}if(_[_0x6d88('0x95')](_0x5dcfee['body'][_0x6d88('0x89')])){throw new db[(_0x6d88('0x7c'))][(_0x6d88('0x96'))](_0x6d88('0x97'));}if(_['isNil'](_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x5b')])||_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x5b')]===''){throw new db[(_0x6d88('0x7c'))][(_0x6d88('0x96'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x6d88('0x95')](_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x98')])){throw new db[(_0x6d88('0x7c'))]['ValidationError'](_0x6d88('0x99')+_0x2c646e);}if(!_[_0x6d88('0x9a')](_0x2c646e,_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x98')])){throw new db[(_0x6d88('0x7c'))]['ValidationError'](_0x6d88('0x9b')+_0x2c646e);}_0x3b92b4[_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x98')]]=_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x89')];return db['CmList'][_0x6d88('0x62')]({'where':{'id':_0x5dcfee[_0x6d88('0x75')][_0x6d88('0x81')]},'include':[{'model':db['CmContact'],'as':_0x6d88('0x9c'),'where':_0x3b92b4,'limit':0x1,'order':[[_0x6d88('0x7f'),_0x6d88('0x9d')]]}]});})[_0x6d88('0x20')](handleEntityNotFound(_0x2fae20,null))['then'](function(_0x433e18){if(_0x433e18){_0x5dcfee[_0x6d88('0x9e')]=_['omit'](_0x433e18,[_0x6d88('0x9c')]);if(_0x433e18[_0x6d88('0x9c')][_0x6d88('0x4b')]){return _0x433e18[_0x6d88('0x9c')][0x0];}var _0x3c504a=_[_0x6d88('0x9f')](_0x5dcfee[_0x6d88('0x5b')],{'firstName':_0x5dcfee[_0x6d88('0x5b')]['from'],'ListId':_0x433e18['id']});_0x3c504a[_0x5dcfee['body'][_0x6d88('0x98')]]=_0x5dcfee[_0x6d88('0x5b')]['from'];return db[_0x6d88('0x7b')][_0x6d88('0x5a')](_0x3c504a,{'fields':_0x574a98,'raw':!![]});}})[_0x6d88('0x20')](handleEntityNotFound(_0x2fae20,null))['then'](function(_0x1abe89){if(_0x1abe89){_0x5dcfee[_0x6d88('0xa0')]=_0x1abe89;var _0x587f9e={'ContactId':_0x1abe89['id'],'phone':_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x89')],'SmsAccountId':_0x107ea2[_0x6d88('0x63')]['id']};var _0x35ab84={'ContactId':_0x1abe89['id'],'SmsAccountId':_0x107ea2[_0x6d88('0x63')]['id'],'closed':![]};return db[_0x6d88('0xa1')][_0x6d88('0x62')]({'where':_0x35ab84})[_0x6d88('0x20')](function(_0x59c844){if(_0x59c844){return[_0x59c844,![]];}return db[_0x6d88('0xa1')]['create'](_0x587f9e)[_0x6d88('0x20')](function(_0x79fd80){return[_0x79fd80,!![]];});});}})[_0x6d88('0xa2')](function(_0x409322,_0xe123cc){_0x5dcfee['interaction']=_0x409322[_0x6d88('0x37')]({'plain':!![]});_0x5dcfee[_0x6d88('0xa3')]['created']=![];if(_0xe123cc){if(_0x5dcfee[_0x6d88('0x75')][_0x6d88('0xa4')]){_0x5dcfee[_0x6d88('0x76')]['push']({'id':0x0,'priority':_0x5dcfee['applications']['length']+0x1,'app':_0x6d88('0xa5'),'appdata':_0x6d88('0xa6'),'interval':'*,*,*,*'});}_0x5dcfee[_0x6d88('0xa3')][_0x6d88('0xa7')]=!![];}return db[_0x6d88('0xa8')]['create']({'phone':_0x5dcfee[_0x6d88('0x5b')]['from'],'messageId':_0x5dcfee[_0x6d88('0x5b')]['messageId'],'body':_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x5b')],'SmsAccountId':_0x107ea2[_0x6d88('0x63')]['id'],'SmsInteractionId':_0x409322['id'],'direction':'in','ContactId':_0x409322[_0x6d88('0xa9')],'AttachmentId':_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0xaa')]});})['then'](function(_0x739b22){_0x5dcfee[_0x6d88('0x29')]=_0x739b22;if(_0x5dcfee[_0x6d88('0xa3')][_0x6d88('0xab')]){return db[_0x6d88('0xac')][_0x6d88('0x62')]({'attributes':['id',_0x6d88('0x3c')],'where':{'id':_0x5dcfee['interaction'][_0x6d88('0xab')]}})[_0x6d88('0x20')](function(_0x2e8cd6){if(_0x2e8cd6){_0x5dcfee['applications'][_0x6d88('0xad')]({'id':0x0,'priority':0x0,'app':_0x6d88('0xae'),'appdata':_0x2e8cd6[_0x6d88('0x3c')]+','+(_0x5dcfee[_0x6d88('0x75')]['waitForTheAssignedAgent']||0xa),'interval':_0x6d88('0xaf')});}return respondWithRpcPromise(_0x6d88('0xb0'),_0x6d88('0xb1'),_0x5dcfee);});}return respondWithRpcPromise(_0x6d88('0xb0'),'startRouting',_0x5dcfee);})[_0x6d88('0x20')](function(_0x267cdb){if(_0x267cdb){var _0x517ef1=0xc8;var _0x21a3ff=_0x6d88('0xb2');logger[_0x6d88('0x21')](_0x6d88('0x23'),_0x21a3ff,_0x517ef1,_0x6d88('0xb3'));logger['debug'](_0x6d88('0xb4'),_0x21a3ff,_0x517ef1,_0x6d88('0xb3'),JSON[_0x6d88('0x25')](_0x267cdb));if(_0x5dcfee['account'][_0x6d88('0x43')]===_0x6d88('0x83')){return _0x2fae20[_0x6d88('0x2c')](_0x517ef1)[_0x6d88('0x32')]('Content-Type',_0x6d88('0xb5'))['send'](_0x6d88('0xb6'));}else{return _0x2fae20['status'](_0x517ef1)[_0x6d88('0x2d')](_0x267cdb);}}})['catch'](handleError(_0x2fae20,null));};exports['addApplications']=function(_0x11cd0f,_0x28c274,_0x12d7a3){return db[_0x6d88('0x41')][_0x6d88('0x6a')]({'where':{'id':_0x11cd0f[_0x6d88('0x63')]['id']}})[_0x6d88('0x20')](handleEntityNotFound(_0x28c274,null))['then'](function(_0x39ac87){if(_0x39ac87){return db[_0x6d88('0xb7')][_0x6d88('0xb8')](function(_0x3d4cd7){return db[_0x6d88('0xb9')]['destroy']({'where':{'SmsAccountId':_0x11cd0f[_0x6d88('0x63')]['id']},'transaction':_0x3d4cd7})[_0x6d88('0x20')](function(_0xc15d66){var _0x5c77c0=_[_0x6d88('0x40')](_0x11cd0f[_0x6d88('0x5b')],function(_0x3d1880){_0x3d1880[_0x6d88('0x67')]=_0x11cd0f['params']['id'];return _0x3d1880;});return db[_0x6d88('0xb9')][_0x6d88('0xba')](_0x5c77c0,{'transaction':_0x3d4cd7});});})[_0x6d88('0x20')](function(){return db['SmsApplication'][_0x6d88('0xbb')]({'where':{'SmsAccountId':_0x11cd0f['params']['id']},'order':'priority'});});}})['then'](respondWithResult(_0x28c274,null))[_0x6d88('0x58')](handleError(_0x28c274,null));};exports[_0x6d88('0xbc')]=function(_0x28dda2,_0x3927d8,_0x27db17){var _0x36ba1d={};var _0x14c259={};var _0x26bfc0;var _0x1d95b8;return db[_0x6d88('0x41')][_0x6d88('0x6a')]({'where':{'id':_0x28dda2[_0x6d88('0x63')]['id']}})['then'](handleEntityNotFound(_0x3927d8,null))[_0x6d88('0x20')](function(_0x50f1a0){if(_0x50f1a0){_0x26bfc0=_0x50f1a0;_0x14c259[_0x6d88('0x45')]=_['keys'](db['SmsApplication']['rawAttributes']);_0x14c259[_0x6d88('0x46')]=_[_0x6d88('0x47')](_0x28dda2[_0x6d88('0x46')]);_0x14c259['filters']=_['intersection'](_0x14c259[_0x6d88('0x45')],_0x14c259['query']);_0x36ba1d['attributes']=_['intersection'](_0x14c259[_0x6d88('0x45')],qs[_0x6d88('0x4a')](_0x28dda2[_0x6d88('0x46')][_0x6d88('0x4a')]));_0x36ba1d[_0x6d88('0x49')]=_0x36ba1d[_0x6d88('0x49')][_0x6d88('0x4b')]?_0x36ba1d[_0x6d88('0x49')]:_0x14c259[_0x6d88('0x45')];_0x36ba1d[_0x6d88('0x4d')]=qs['sort'](_0x28dda2[_0x6d88('0x46')][_0x6d88('0x4e')]);_0x36ba1d[_0x6d88('0x51')]=qs[_0x6d88('0x4f')](_[_0x6d88('0x6b')](_0x28dda2[_0x6d88('0x46')],_0x14c259[_0x6d88('0x4f')]));if(_0x28dda2[_0x6d88('0x46')][_0x6d88('0x52')]){_0x36ba1d[_0x6d88('0x51')]=_[_0x6d88('0x50')](_0x36ba1d[_0x6d88('0x51')],{'$or':_[_0x6d88('0x40')](_0x36ba1d['attributes'],function(_0x4bc5cb){var _0xc1ca95={};_0xc1ca95[_0x4bc5cb]={'$like':'%'+_0x28dda2[_0x6d88('0x46')][_0x6d88('0x52')]+'%'};return _0xc1ca95;})});}_0x36ba1d=_[_0x6d88('0x50')]({},_0x36ba1d,_0x28dda2[_0x6d88('0x53')]);return _0x26bfc0['getApplications'](_0x36ba1d);}})[_0x6d88('0x20')](function(_0x1fce15){if(_0x1fce15){_0x1d95b8=_0x1fce15[_0x6d88('0x4b')];if(!_0x28dda2[_0x6d88('0x46')][_0x6d88('0x4c')]('nolimit')){_0x36ba1d[_0x6d88('0x30')]=qs[_0x6d88('0x30')](_0x28dda2[_0x6d88('0x46')]['limit']);_0x36ba1d[_0x6d88('0x2e')]=qs[_0x6d88('0x2e')](_0x28dda2['query'][_0x6d88('0x2e')]);}return _0x26bfc0[_0x6d88('0xbc')](_0x36ba1d);}})[_0x6d88('0x20')](function(_0x630b4b){if(_0x630b4b){return _0x630b4b?{'count':_0x1d95b8,'rows':_0x630b4b}:null;}})[_0x6d88('0x20')](respondWithResult(_0x3927d8,null))['catch'](handleError(_0x3927d8,null));};exports[_0x6d88('0xbd')]=function(_0x3c8197,_0x59a0eb,_0x1977cd){var _0x19f900={'raw':![],'where':{}};var _0x11adb2={};var _0x1ba388={'count':0x0,'rows':[]};return db[_0x6d88('0x41')]['findOne']({'where':{'id':_0x3c8197['params']['id']}})[_0x6d88('0x20')](handleEntityNotFound(_0x59a0eb,null))[_0x6d88('0x20')](function(_0x308f33){if(_0x308f33){_0x11adb2[_0x6d88('0x45')]=_[_0x6d88('0x47')](db[_0x6d88('0xa1')]['rawAttributes']);_0x11adb2[_0x6d88('0x46')]=_[_0x6d88('0x47')](_0x3c8197['query']);_0x11adb2[_0x6d88('0x4f')]=_[_0x6d88('0x48')](_0x11adb2[_0x6d88('0x45')],_0x11adb2['query']);_0x19f900[_0x6d88('0x49')]=_[_0x6d88('0x48')](_0x11adb2[_0x6d88('0x45')],qs[_0x6d88('0x4a')](_0x3c8197[_0x6d88('0x46')][_0x6d88('0x4a')]));_0x19f900[_0x6d88('0x49')]=_0x19f900[_0x6d88('0x49')][_0x6d88('0x4b')]?_0x19f900[_0x6d88('0x49')]:_0x11adb2[_0x6d88('0x45')];if(!_0x3c8197[_0x6d88('0x46')][_0x6d88('0x4c')](_0x6d88('0x71'))){_0x19f900[_0x6d88('0x30')]=qs[_0x6d88('0x30')](_0x3c8197['query'][_0x6d88('0x30')]);_0x19f900[_0x6d88('0x2e')]=qs[_0x6d88('0x2e')](_0x3c8197[_0x6d88('0x46')]['offset']);}_0x19f900['order']=qs['sort'](_0x3c8197['query']['sort']);_0x19f900[_0x6d88('0x51')]=qs['filters'](_[_0x6d88('0x6b')](_0x3c8197[_0x6d88('0x46')],_0x11adb2[_0x6d88('0x4f')]));_0x19f900[_0x6d88('0x51')][_0x6d88('0x67')]=_0x308f33['id'];if(_0x3c8197[_0x6d88('0x46')][_0x6d88('0x52')]){_0x19f900[_0x6d88('0x51')]=_[_0x6d88('0x50')](_0x19f900['where'],{'$or':_[_0x6d88('0x40')](_0x19f900[_0x6d88('0x49')],function(_0x4d56e3){var _0x4a15d2={};_0x4a15d2[_0x4d56e3]={'$like':'%'+_0x3c8197[_0x6d88('0x46')][_0x6d88('0x52')]+'%'};return _0x4a15d2;})});}_0x19f900=_[_0x6d88('0x50')]({},_0x19f900,_0x3c8197[_0x6d88('0x53')]);return db[_0x6d88('0xa1')][_0x6d88('0x31')]({'where':_0x19f900[_0x6d88('0x51')]})[_0x6d88('0x20')](function(_0x5bbc42){_0x1ba388['count']=_0x5bbc42;if(_0x3c8197['query'][_0x6d88('0x54')]){_0x19f900[_0x6d88('0x55')]=[{'model':db['CmContact'],'as':_0x6d88('0xbe'),'required':![]},{'model':db[_0x6d88('0xac')],'as':_0x6d88('0xbf'),'attributes':[_0x6d88('0x3c'),_0x6d88('0xc0'),'internal'],'required':![]},{'model':db[_0x6d88('0xc1')],'as':_0x6d88('0xc2'),'attributes':['id',_0x6d88('0x3c'),_0x6d88('0xc3')],'where':_0x3c8197[_0x6d88('0x46')]['tag']?{'id':_0x3c8197[_0x6d88('0x46')][_0x6d88('0xc4')]}:undefined,'required':_0x3c8197['query'][_0x6d88('0xc4')]?!![]:![]}];}return db[_0x6d88('0xa1')][_0x6d88('0x56')](_0x19f900);})[_0x6d88('0x20')](function(_0x14f2d5){_0x1ba388[_0x6d88('0x57')]=_0x14f2d5;return _0x1ba388;});}})['then'](respondWithFilteredResult(_0x59a0eb,_0x19f900))[_0x6d88('0x58')](handleError(_0x59a0eb,null));};exports[_0x6d88('0x3d')]=function(_0x34a0c5,_0x207299,_0x21b212){var _0x74e810,_0x585a84,_0x31a7ae;if(_[_0x6d88('0x95')](_0x34a0c5[_0x6d88('0x5b')]['body'])||_0x34a0c5[_0x6d88('0x5b')][_0x6d88('0x5b')]===''){throw new db[(_0x6d88('0x7c'))][(_0x6d88('0x96'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x34a0c5[_0x6d88('0x5b')]['to'])){throw new db['Sequelize'][(_0x6d88('0x96'))](_0x6d88('0xc5'));}_0x74e810=_0x34a0c5[_0x6d88('0x5b')]['to'];return db[_0x6d88('0x41')]['find']({'where':{'id':_0x34a0c5[_0x6d88('0x63')]['id']},'include':[{'model':db['CmList'],'as':_0x6d88('0xc6'),'include':[{'model':db[_0x6d88('0x7b')],'as':_0x6d88('0x9c'),'where':{'mobile':_0x74e810},'limit':0x1,'order':[[_0x6d88('0x7f'),_0x6d88('0x9d')]]}]}]})[_0x6d88('0x20')](handleEntityNotFound(_0x207299,null))[_0x6d88('0x20')](function(_0x1790b2){if(_0x1790b2&&_0x1790b2[_0x6d88('0xc6')]){_0x585a84=_0x1790b2['get']({'plain':!![]});if(_0x585a84[_0x6d88('0xc6')]&&_0x585a84[_0x6d88('0xc6')][_0x6d88('0x9c')][_0x6d88('0x4b')]){return _0x585a84[_0x6d88('0xc6')][_0x6d88('0x9c')][0x0];}return db[_0x6d88('0x7b')][_0x6d88('0x5a')](_['defaults'](_0x34a0c5[_0x6d88('0x5b')],{'firstName':_0x74e810,'mobile':_0x74e810,'phone':_0x74e810,'ListId':_0x585a84[_0x6d88('0x81')]}));}})['then'](handleEntityNotFound(_0x207299,null))['then'](function(_0x4b201c){if(_0x4b201c){_0x31a7ae=_0x4b201c;return db[_0x6d88('0xa1')]['find']({'where':{'ContactId':_0x31a7ae['id'],'closed':![],'SmsAccountId':_0x585a84['id']}})[_0x6d88('0x20')](function(_0x323378){if(_0x323378){return[_0x323378,![]];}return db['SmsInteraction'][_0x6d88('0x5a')]({'UserId':_0x34a0c5[_0x6d88('0x5c')]['id'],'ContactId':_0x31a7ae['id'],'SmsAccountId':_0x585a84['id'],'phone':_0x74e810,'firstMsgDirection':_0x6d88('0xc7'),'Messages':[_[_0x6d88('0x50')](_0x34a0c5[_0x6d88('0x5b')],{'read':![],'body':_0x34a0c5['body'][_0x6d88('0x5b')],'phone':_0x74e810,'SmsAccountId':_0x585a84['id'],'UserId':_0x34a0c5[_0x6d88('0x5c')]['id'],'ContactId':_0x31a7ae['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x6d88('0xc8')}]})[_0x6d88('0x20')](function(_0x5afb82){return[_0x5afb82,!![]];});});}})[_0x6d88('0xa2')](function(_0x260fbd,_0x3ba6b6){if(_0x3ba6b6){return _0x260fbd;}return db[_0x6d88('0xa8')][_0x6d88('0x5a')](_[_0x6d88('0x50')](_0x34a0c5[_0x6d88('0x5b')],{'read':![],'body':_0x34a0c5['body'][_0x6d88('0x5b')],'phone':_0x74e810,'SmsAccountId':_0x585a84['id'],'SmsInteractionId':_0x260fbd['id'],'UserId':_0x34a0c5[_0x6d88('0x5c')]['id'],'ContactId':_0x31a7ae['id']}))[_0x6d88('0x20')](function(_0x3dfb3b){_0x260fbd['dataValues'][_0x6d88('0xc8')]=[];_0x260fbd[_0x6d88('0xc9')][_0x6d88('0xc8')][_0x6d88('0xca')](_0x3dfb3b[_0x6d88('0xc9')]);return _0x260fbd;});})[_0x6d88('0x20')](respondWithResult(_0x207299,null))[_0x6d88('0x58')](handleError(_0x207299,null));};exports[_0x6d88('0x2c')]=function(_0x1e1528,_0x5ece6b,_0x407ac5){if(_0x1e1528['body']['id']){delete _0x1e1528[_0x6d88('0x5b')]['id'];}var _0x5ebe19,_0x5ba023,_0xaab3fc;return db[_0x6d88('0x41')][_0x6d88('0x62')]({'where':{'id':_0x1e1528['params']['id']}})[_0x6d88('0x20')](handleEntityNotFound(_0x5ece6b,null))[_0x6d88('0x20')](function(_0x2d9b4c){if(_0x2d9b4c){_0xaab3fc=_0x2d9b4c;logger[_0x6d88('0x22')](_0x6d88('0x23'),_0x6d88('0x2c'),_0x6d88('0xcb'),_0x2d9b4c[_0x6d88('0x43')],util[_0x6d88('0xcc')](_0x1e1528[_0x6d88('0x5b')],{'showHidden':![],'depth':null}));switch(_0x2d9b4c[_0x6d88('0x43')]){case _0x6d88('0x86'):if(_0x1e1528[_0x6d88('0x5b')][_0x6d88('0xcd')]&&_0x1e1528['body'][_0x6d88('0x2c')]){_0x5ba023=_0x1e1528[_0x6d88('0x5b')][_0x6d88('0x2c')];return db[_0x6d88('0xa8')][_0x6d88('0x62')]({'where':{'messageId':_0x1e1528['body']['skebby_dispatch_id']}});}break;case _0x6d88('0x88'):if(_0x1e1528[_0x6d88('0x5b')][_0x6d88('0xce')]&&_0x1e1528[_0x6d88('0x5b')][_0x6d88('0xcf')]){_0x5ba023=_0x1e1528[_0x6d88('0x5b')][_0x6d88('0xcf')];return db[_0x6d88('0xa8')]['find']({'where':{'messageId':_0x1e1528['body'][_0x6d88('0xce')]}});}break;case'clicksend':if(_0x1e1528[_0x6d88('0x5b')][_0x6d88('0xd0')]&&_0x1e1528[_0x6d88('0x5b')][_0x6d88('0xd1')]){_0x5ba023=_0x1e1528[_0x6d88('0x5b')][_0x6d88('0xd1')];return db[_0x6d88('0xa8')][_0x6d88('0x62')]({'where':{'messageId':_0x1e1528[_0x6d88('0x5b')]['message_id']}});}break;case'infobip':var _0x3ff669=_0x1e1528[_0x6d88('0x5b')][_0x6d88('0x90')][0x0];if(_0x3ff669['messageId']&&_0x3ff669[_0x6d88('0x2c')][_0x6d88('0xd2')]===_0x6d88('0xd3')){_0x5ba023=_0x3ff669['status']['groupName'];return db['SmsMessage'][_0x6d88('0x62')]({'where':{'messageId':_0x3ff669['messageId']}});}break;case _0x6d88('0xd4'):if(_0x1e1528[_0x6d88('0x5b')][_0x6d88('0x8b')]&&_0x1e1528[_0x6d88('0x5b')]['status']){_0x5ba023=_0x1e1528['body'][_0x6d88('0x2c')];return db[_0x6d88('0xa8')][_0x6d88('0x62')]({'where':{'messageId':_0x1e1528['body'][_0x6d88('0x8b')]}});}break;case _0x6d88('0xd5'):if(_0x1e1528[_0x6d88('0x5b')][0x0]['message']['id']){_0x5ba023=_0x1e1528['body'][0x0][_0x6d88('0x43')];return db[_0x6d88('0xa8')][_0x6d88('0x62')]({'where':{'messageId':_0x1e1528[_0x6d88('0x5b')][0x0][_0x6d88('0x29')]['id']}});}break;case _0x6d88('0xd6'):if(_0x1e1528[_0x6d88('0x5b')][_0x6d88('0xd7')]&&_0x1e1528[_0x6d88('0x5b')][_0x6d88('0x2c')]){_0x5ba023=_0x1e1528[_0x6d88('0x5b')][_0x6d88('0x2c')];return db[_0x6d88('0xa8')][_0x6d88('0x62')]({'where':{'messageId':_0x1e1528['body'][_0x6d88('0xd7')]}});}break;}}})[_0x6d88('0x20')](handleEntityNotFound(_0x5ece6b,null))[_0x6d88('0x20')](function(_0x4d3b14){if(_0x4d3b14){_0x5ebe19=_0x4d3b14;switch(_0xaab3fc[_0x6d88('0x43')]){case _0x6d88('0x86'):if(_0x5ba023===_0x6d88('0xd3')){return _0x5ebe19['update']({'read':!![]});}else{logger['error'](_0x6d88('0x23'),_0x6d88('0x2c'),_0x6d88('0x86'),util['inspect'](_0x1e1528[_0x6d88('0x5b')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x5ba023==='1'){return _0x5ebe19[_0x6d88('0x35')]({'read':!![]});}else{logger[_0x6d88('0x27')](_0x6d88('0x23'),_0x6d88('0x2c'),_0x6d88('0x86'),util[_0x6d88('0xcc')](_0x1e1528[_0x6d88('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x6d88('0x8a'):if(!_0x1e1528[_0x6d88('0x5b')][_0x6d88('0xd8')]&&_0x5ba023>=0xc8&&_0x5ba023<=0xce){return _0x5ebe19[_0x6d88('0x35')]({'read':!![]});}else{logger['error'](_0x6d88('0x23'),_0x6d88('0x2c'),_0x6d88('0x8a'),util[_0x6d88('0xcc')](_0x1e1528[_0x6d88('0x5b')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0xd08180=_0x1e1528[_0x6d88('0x5b')][_0x6d88('0x90')][0x0];if(_0xd08180[_0x6d88('0x2c')]['groupName']===_0x6d88('0xd3')){return _0x5ebe19[_0x6d88('0x35')]({'read':!![]});}else{logger[_0x6d88('0x27')](_0x6d88('0x23'),_0x6d88('0x2c'),'infobip',util[_0x6d88('0xcc')](_0x1e1528[_0x6d88('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x6d88('0xd4'):if(_0x5ba023==_0x6d88('0xd9')||_0x5ba023=='RECEIVED_BY_RECIPIENT'){return _0x5ebe19[_0x6d88('0x35')]({'read':!![]});}else{logger[_0x6d88('0x27')](_0x6d88('0x23'),_0x6d88('0x2c'),'clickatell',util[_0x6d88('0xcc')](_0x1e1528[_0x6d88('0x5b')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x5ba023==_0x6d88('0xda')){return _0x5ebe19[_0x6d88('0x35')]({'read':!![]});}else{logger[_0x6d88('0x27')](_0x6d88('0x23'),'status',_0x6d88('0xd5'),util[_0x6d88('0xcc')](_0x1e1528['body'],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x5ba023===_0x6d88('0xdb')||_0x5ba023===_0x6d88('0xdc')){return _0x5ebe19['update']({'read':!![]});}else{logger[_0x6d88('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x6d88('0x2c'),_0x6d88('0xd6'),util['inspect'](_0x1e1528[_0x6d88('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x5ebe19;}})[_0x6d88('0x20')](respondWithResult(_0x5ece6b,null))[_0x6d88('0x58')](handleError(_0x5ece6b,null));};exports[_0x6d88('0xdd')]=function(_0x31a187,_0x149504,_0x30d6c1){var _0x122cfc,_0x5d6feb,_0x37c9df;return db[_0x6d88('0x41')][_0x6d88('0x62')]({'where':{'id':_0x31a187[_0x6d88('0x63')]['id']}})[_0x6d88('0x20')](handleEntityNotFound(_0x149504,null))[_0x6d88('0x20')](function(_0x1233a7){if(_0x1233a7){_0x37c9df=_0x1233a7;logger[_0x6d88('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x6d88('0x2c'),_0x6d88('0xcb'),_0x1233a7['type'],util[_0x6d88('0xcc')](_0x31a187['query'],{'showHidden':![],'depth':null}));switch(_0x1233a7[_0x6d88('0x43')]){case _0x6d88('0xde'):if(_0x31a187['query'][_0x6d88('0xdf')]&&_0x31a187[_0x6d88('0x46')]['state']){_0x5d6feb=_0x31a187[_0x6d88('0x46')]['state'];return db[_0x6d88('0xa8')][_0x6d88('0x62')]({'where':{'messageId':_0x31a187[_0x6d88('0x46')][_0x6d88('0xdf')]}});}break;}}})['then'](handleEntityNotFound(_0x149504,null))[_0x6d88('0x20')](function(_0x5a59a5){if(_0x5a59a5){_0x122cfc=_0x5a59a5;switch(_0x37c9df[_0x6d88('0x43')]){case _0x6d88('0xde'):if(_0x5d6feb==='2'||_0x5d6feb==='6'){return _0x122cfc[_0x6d88('0x35')]({'read':!![]});}else{logger[_0x6d88('0x27')](_0x6d88('0x23'),_0x6d88('0x2c'),_0x6d88('0xde'),util['inspect'](_0x31a187[_0x6d88('0x46')],{'showHidden':![],'depth':null}));};break;}return _0x122cfc;}})['then'](respondWithResult(_0x149504,null))[_0x6d88('0x58')](handleError(_0x149504,null));};exports[_0x6d88('0xe0')]=function(_0x2ec1f7,_0x38b93f,_0x179316){return db['SmsAccount']['find']({'where':{'id':_0x2ec1f7['params']['id']}})[_0x6d88('0x20')](handleEntityNotFound(_0x38b93f,null))['then'](function(_0x5f57d4){if(_0x5f57d4){return _0x5f57d4[_0x6d88('0xe0')](_0x2ec1f7[_0x6d88('0x5b')][_0x6d88('0x6d')],_[_0x6d88('0xe1')](_0x2ec1f7[_0x6d88('0x5b')],[_0x6d88('0x6d'),'id'])||{})[_0x6d88('0xa2')](function(_0x590f21){for(var _0x262526=0x0;_0x262526<_0x2ec1f7[_0x6d88('0x5b')][_0x6d88('0x6d')][_0x6d88('0x4b')];_0x262526+=0x1){socket[_0x6d88('0xe2')](_0x6d88('0xe3'),{'UserId':Number(_0x2ec1f7[_0x6d88('0x5b')]['ids'][_0x262526]),'SmsAccountId':Number(_0x2ec1f7[_0x6d88('0x63')]['id'])});}return _0x590f21;});}})[_0x6d88('0x20')](respondWithResult(_0x38b93f,null))['catch'](handleError(_0x38b93f,null));};exports[_0x6d88('0xe4')]=function(_0x39be18,_0x27fbe0,_0x34cf98){return db[_0x6d88('0x41')][_0x6d88('0x62')]({'where':{'id':_0x39be18[_0x6d88('0x63')]['id']}})[_0x6d88('0x20')](handleEntityNotFound(_0x27fbe0,null))[_0x6d88('0x20')](function(_0x518dec){if(_0x518dec){return _0x518dec[_0x6d88('0xe4')](_0x39be18['query'][_0x6d88('0x6d')])[_0x6d88('0x20')](function(){if(_[_0x6d88('0xe5')](_0x39be18[_0x6d88('0x46')][_0x6d88('0x6d')])){for(var _0x5348f6=0x0;_0x5348f6<_0x39be18[_0x6d88('0x46')][_0x6d88('0x6d')][_0x6d88('0x4b')];_0x5348f6+=0x1){socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x39be18[_0x6d88('0x46')][_0x6d88('0x6d')][_0x5348f6]),'SmsAccountId':Number(_0x39be18[_0x6d88('0x63')]['id'])});}}else{socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x39be18[_0x6d88('0x46')][_0x6d88('0x6d')]),'SmsAccountId':Number(_0x39be18[_0x6d88('0x63')]['id'])});}});}})[_0x6d88('0x20')](respondWithStatusCode(_0x27fbe0,null))['catch'](handleError(_0x27fbe0,null));};exports[_0x6d88('0xe6')]=function(_0x373bcf,_0x52f3de,_0x499e3c){var _0x8af6c0={};var _0x21236c={};var _0x17afa9;var _0x4fd032;return db[_0x6d88('0x41')]['findOne']({'where':{'id':_0x373bcf[_0x6d88('0x63')]['id']}})['then'](handleEntityNotFound(_0x52f3de,null))[_0x6d88('0x20')](function(_0xff286d){if(_0xff286d){_0x17afa9=_0xff286d;_0x21236c[_0x6d88('0x45')]=_[_0x6d88('0x47')](db[_0x6d88('0xac')][_0x6d88('0x59')]);_0x21236c[_0x6d88('0x46')]=_[_0x6d88('0x47')](_0x373bcf['query']);_0x21236c[_0x6d88('0x4f')]=_['intersection'](_0x21236c[_0x6d88('0x45')],_0x21236c[_0x6d88('0x46')]);_0x8af6c0['attributes']=_['intersection'](_0x21236c[_0x6d88('0x45')],qs['fields'](_0x373bcf[_0x6d88('0x46')][_0x6d88('0x4a')]));_0x8af6c0['attributes']=_0x8af6c0[_0x6d88('0x49')]['length']?_0x8af6c0[_0x6d88('0x49')]:_0x21236c[_0x6d88('0x45')];_0x8af6c0[_0x6d88('0x4d')]=qs[_0x6d88('0x4e')](_0x373bcf['query'][_0x6d88('0x4e')]);_0x8af6c0[_0x6d88('0x51')]=qs['filters'](_[_0x6d88('0x6b')](_0x373bcf[_0x6d88('0x46')],_0x21236c[_0x6d88('0x4f')]));if(_0x373bcf[_0x6d88('0x46')][_0x6d88('0x52')]){_0x8af6c0[_0x6d88('0x51')]=_['merge'](_0x8af6c0[_0x6d88('0x51')],{'$or':_[_0x6d88('0x40')](_0x8af6c0[_0x6d88('0x49')],function(_0x47dff3){var _0x435fd7={};_0x435fd7[_0x47dff3]={'$like':'%'+_0x373bcf[_0x6d88('0x46')][_0x6d88('0x52')]+'%'};return _0x435fd7;})});}_0x8af6c0=_[_0x6d88('0x50')]({},_0x8af6c0,_0x373bcf['options']);return _0x17afa9[_0x6d88('0xe6')](_0x8af6c0);}})['then'](function(_0x35cfb2){if(_0x35cfb2){_0x4fd032=_0x35cfb2['length'];if(!_0x373bcf[_0x6d88('0x46')]['hasOwnProperty'](_0x6d88('0x71'))){_0x8af6c0[_0x6d88('0x30')]=qs[_0x6d88('0x30')](_0x373bcf[_0x6d88('0x46')][_0x6d88('0x30')]);_0x8af6c0[_0x6d88('0x2e')]=qs[_0x6d88('0x2e')](_0x373bcf[_0x6d88('0x46')][_0x6d88('0x2e')]);}return _0x17afa9[_0x6d88('0xe6')](_0x8af6c0);}})[_0x6d88('0x20')](function(_0x3ae614){if(_0x3ae614){return _0x3ae614?{'count':_0x4fd032,'rows':_0x3ae614}:null;}})['then'](respondWithResult(_0x52f3de,null))['catch'](handleError(_0x52f3de,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 8886b57..ecc0d83 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 _0x732f=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0xf6a32b,_0x2538b4){var _0x1c125a=function(_0x5939ec){while(--_0x5939ec){_0xf6a32b['push'](_0xf6a32b['shift']());}};_0x1c125a(++_0x2538b4);}(_0x732f,0x1c2));var _0xf732=function(_0x239b16,_0x51ce2b){_0x239b16=_0x239b16-0x0;var _0x5547e7=_0x732f[_0x239b16];return _0x5547e7;};'use strict';var EventEmitter=require(_0xf732('0x0'));var SmsAccount=require(_0xf732('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xf732('0x2')](0x0);var events={'afterCreate':_0xf732('0x3'),'afterUpdate':_0xf732('0x4'),'afterDestroy':_0xf732('0x5')};function emitEvent(_0x57988d){return function(_0x527367,_0x2b1941,_0x514eb6){SmsAccountEvents[_0xf732('0x6')](_0x57988d+':'+_0x527367['id'],_0x527367);SmsAccountEvents[_0xf732('0x6')](_0x57988d,_0x527367);_0x514eb6(null);};}for(var e in events){if(events[_0xf732('0x7')](e)){var event=events[e];SmsAccount[_0xf732('0x8')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0x78e8=['events','../../mysqldb','SmsAccount','setMaxListeners','save','update','emit','hasOwnProperty','exports'];(function(_0x2d1d91,_0x330db9){var _0x1a0b0d=function(_0x204121){while(--_0x204121){_0x2d1d91['push'](_0x2d1d91['shift']());}};_0x1a0b0d(++_0x330db9);}(_0x78e8,0x75));var _0x878e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x78e8[_0x6c993a];return _0x27f547;};'use strict';var EventEmitter=require(_0x878e('0x0'));var SmsAccount=require(_0x878e('0x1'))['db'][_0x878e('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x878e('0x3')](0x0);var events={'afterCreate':_0x878e('0x4'),'afterUpdate':_0x878e('0x5'),'afterDestroy':'remove'};function emitEvent(_0x12ea7d){return function(_0x35b18c,_0x682e9e,_0x27fab6){SmsAccountEvents['emit'](_0x12ea7d+':'+_0x35b18c['id'],_0x35b18c);SmsAccountEvents[_0x878e('0x6')](_0x12ea7d,_0x35b18c);_0x27fab6(null);};}for(var e in events){if(events[_0x878e('0x7')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x878e('0x8')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 23d0abe..7bee7f8 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 _0x910d=['exports','SmsAccount','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./smsAccount.attributes'];(function(_0x35a935,_0x31e388){var _0x15012f=function(_0x256275){while(--_0x256275){_0x35a935['push'](_0x35a935['shift']());}};_0x15012f(++_0x31e388);}(_0x910d,0x141));var _0xd910=function(_0x2c0964,_0x504d2f){_0x2c0964=_0x2c0964-0x0;var _0x3c6616=_0x910d[_0x2c0964];return _0x3c6616;};'use strict';var _=require(_0xd910('0x0'));var util=require(_0xd910('0x1'));var logger=require(_0xd910('0x2'))(_0xd910('0x3'));var moment=require(_0xd910('0x4'));var BPromise=require(_0xd910('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd910('0x6'));var rimraf=require(_0xd910('0x7'));var config=require('../../config/environment');var attributes=require(_0xd910('0x8'));module[_0xd910('0x9')]=function(_0x36239d,_0x70414d){return _0x36239d['define'](_0xd910('0xa'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab49=['lodash','util','api','bluebird','request-promise','rimraf','exports','define','SmsAccount','sms_accounts'];(function(_0x1e784f,_0x255025){var _0x43ef90=function(_0x15e152){while(--_0x15e152){_0x1e784f['push'](_0x1e784f['shift']());}};_0x43ef90(++_0x255025);}(_0xab49,0x122));var _0x9ab4=function(_0x215e65,_0x183f97){_0x215e65=_0x215e65-0x0;var _0xa85842=_0xab49[_0x215e65];return _0xa85842;};'use strict';var _=require(_0x9ab4('0x0'));var util=require(_0x9ab4('0x1'));var logger=require('../../config/logger')(_0x9ab4('0x2'));var moment=require('moment');var BPromise=require(_0x9ab4('0x3'));var rp=require(_0x9ab4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9ab4('0x5'));var config=require('../../config/environment');var attributes=require('./smsAccount.attributes');module[_0x9ab4('0x6')]=function(_0xdeb307,_0x1bb2b4){return _0xdeb307[_0x9ab4('0x7')](_0x9ab4('0x8'),attributes,{'tableName':_0x9ab4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index ff439a0..609ae25 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 _0xcecd=['attributes','model','ShowSmsAccount','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','info','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','catch','options','where','include','map'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xcecd,0x87));var _0xdcec=function(_0x444577,_0x1ebc67){_0x444577=_0x444577-0x0;var _0x4ee291=_0xcecd[_0x444577];return _0x4ee291;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdcec('0x0'));var BPromise=require(_0xdcec('0x1'));var rs=require(_0xdcec('0x2'));var fs=require('fs');var Redis=require(_0xdcec('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xdcec('0x4'));var logger=require(_0xdcec('0x5'))(_0xdcec('0x6'));var config=require(_0xdcec('0x7'));var jayson=require(_0xdcec('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xdcec('0x9')]=_['defaults'](config['redis'],{'host':_0xdcec('0xa'),'port':0x18eb});var socket=require(_0xdcec('0xb'))(new Redis(config[_0xdcec('0x9')]));require(_0xdcec('0xc'))[_0xdcec('0xd')](socket);function respondWithRpcPromise(_0x46edb8,_0x48172b,_0x283717){return new BPromise(function(_0x53aa8b,_0x1e68bd){return client[_0xdcec('0xe')](_0x46edb8,_0x283717)[_0xdcec('0xf')](function(_0x1603eb){logger[_0xdcec('0x10')]('SmsAccount,\x20%s,\x20%s',_0x48172b,'request\x20sent');logger[_0xdcec('0x11')](_0xdcec('0x12'),_0x48172b,_0xdcec('0x13'),JSON[_0xdcec('0x14')](_0x1603eb));if(_0x1603eb['error']){if(_0x1603eb[_0xdcec('0x15')][_0xdcec('0x16')]===0x1f4){logger[_0xdcec('0x15')](_0xdcec('0x17'),_0x48172b,_0x1603eb[_0xdcec('0x15')][_0xdcec('0x18')]);return _0x1e68bd(_0x1603eb[_0xdcec('0x15')]['message']);}logger[_0xdcec('0x15')](_0xdcec('0x17'),_0x48172b,_0x1603eb[_0xdcec('0x15')][_0xdcec('0x18')]);return _0x53aa8b(_0x1603eb[_0xdcec('0x15')]['message']);}else{logger[_0xdcec('0x10')](_0xdcec('0x17'),_0x48172b,'request\x20sent');_0x53aa8b(_0x1603eb['result'][_0xdcec('0x18')]);}})[_0xdcec('0x19')](function(_0x5c3613){logger[_0xdcec('0x15')](_0xdcec('0x17'),_0x48172b,_0x5c3613);_0x1e68bd(_0x5c3613);});});}exports['ShowSmsAccount']=function(_0x370e56){var _0x19c76f=this;return new Promise(function(_0xdb084e,_0xc339cc){return db['SmsAccount']['find']({'raw':_0x370e56['options']?_0x370e56[_0xdcec('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x370e56[_0xdcec('0x1a')]?_0x370e56[_0xdcec('0x1a')][_0xdcec('0x1b')]||null:null,'attributes':_0x370e56[_0xdcec('0x1a')]?_0x370e56['options']['attributes']||null:null,'include':_0x370e56[_0xdcec('0x1a')]?_0x370e56[_0xdcec('0x1a')][_0xdcec('0x1c')]?_[_0xdcec('0x1d')](_0x370e56[_0xdcec('0x1a')][_0xdcec('0x1c')],function(_0x47227d){return{'model':db[_0x47227d['model']],'as':_0x47227d['as'],'attributes':_0x47227d[_0xdcec('0x1e')],'include':_0x47227d['include']?_[_0xdcec('0x1d')](_0x47227d[_0xdcec('0x1c')],function(_0x1736e2){return{'model':db[_0x1736e2[_0xdcec('0x1f')]],'as':_0x1736e2['as'],'attributes':_0x1736e2[_0xdcec('0x1e')],'include':_0x1736e2[_0xdcec('0x1c')]?_[_0xdcec('0x1d')](_0x1736e2[_0xdcec('0x1c')],function(_0x426a75){return{'model':db[_0x426a75['model']],'as':_0x426a75['as'],'attributes':_0x426a75[_0xdcec('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xdcec('0xf')](function(_0x18e457){logger['info'](_0xdcec('0x20'),_0x370e56);logger[_0xdcec('0x11')](_0xdcec('0x20'),_0x370e56,JSON[_0xdcec('0x14')](_0x18e457));_0xdb084e(_0x18e457);})['catch'](function(_0x5b9da6){logger[_0xdcec('0x15')]('ShowSmsAccount',_0x5b9da6[_0xdcec('0x18')],_0x370e56);_0xc339cc(_0x19c76f[_0xdcec('0x15')](0x1f4,_0x5b9da6[_0xdcec('0x18')]));});});}; \ No newline at end of file +var _0x7d25=['util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','request','then','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','SmsAccount,\x20%s,\x20%s','message','info','request\x20sent','result','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','map','model','include','catch','lodash'];(function(_0x198446,_0x119c8f){var _0x38d7b7=function(_0x293752){while(--_0x293752){_0x198446['push'](_0x198446['shift']());}};_0x38d7b7(++_0x119c8f);}(_0x7d25,0x1e0));var _0x57d2=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0x7d25[_0x59d89e];return _0x554e93;};'use strict';var _=require(_0x57d2('0x0'));var util=require(_0x57d2('0x1'));var moment=require(_0x57d2('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x57d2('0x3'))['db'];var utils=require(_0x57d2('0x4'));var logger=require(_0x57d2('0x5'))(_0x57d2('0x6'));var config=require(_0x57d2('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x57d2('0x8')][_0x57d2('0x9')]({'port':0x232a});config[_0x57d2('0xa')]=_[_0x57d2('0xb')](config[_0x57d2('0xa')],{'host':_0x57d2('0xc'),'port':0x18eb});var socket=require(_0x57d2('0xd'))(new Redis(config[_0x57d2('0xa')]));require(_0x57d2('0xe'))['register'](socket);function respondWithRpcPromise(_0x19da04,_0x1dc3b,_0x12ba0c){return new BPromise(function(_0x5c5e4e,_0x3c8677){return client[_0x57d2('0xf')](_0x19da04,_0x12ba0c)[_0x57d2('0x10')](function(_0x29a3a6){logger['info']('SmsAccount,\x20%s,\x20%s',_0x1dc3b,'request\x20sent');logger[_0x57d2('0x11')](_0x57d2('0x12'),_0x1dc3b,'request\x20sent',JSON[_0x57d2('0x13')](_0x29a3a6));if(_0x29a3a6['error']){if(_0x29a3a6['error']['code']===0x1f4){logger[_0x57d2('0x14')](_0x57d2('0x15'),_0x1dc3b,_0x29a3a6[_0x57d2('0x14')][_0x57d2('0x16')]);return _0x3c8677(_0x29a3a6[_0x57d2('0x14')][_0x57d2('0x16')]);}logger[_0x57d2('0x14')](_0x57d2('0x15'),_0x1dc3b,_0x29a3a6['error']['message']);return _0x5c5e4e(_0x29a3a6[_0x57d2('0x14')][_0x57d2('0x16')]);}else{logger[_0x57d2('0x17')](_0x57d2('0x15'),_0x1dc3b,_0x57d2('0x18'));_0x5c5e4e(_0x29a3a6[_0x57d2('0x19')][_0x57d2('0x16')]);}})['catch'](function(_0x3e0805){logger[_0x57d2('0x14')]('SmsAccount,\x20%s,\x20%s',_0x1dc3b,_0x3e0805);_0x3c8677(_0x3e0805);});});}exports[_0x57d2('0x1a')]=function(_0x2d68f7){var _0x287645=this;return new Promise(function(_0x3013a2,_0x3e40aa){return db[_0x57d2('0x1b')][_0x57d2('0x1c')]({'raw':_0x2d68f7[_0x57d2('0x1d')]?_0x2d68f7[_0x57d2('0x1d')][_0x57d2('0x1e')]===undefined?!![]:![]:!![],'where':_0x2d68f7[_0x57d2('0x1d')]?_0x2d68f7[_0x57d2('0x1d')][_0x57d2('0x1f')]||null:null,'attributes':_0x2d68f7[_0x57d2('0x1d')]?_0x2d68f7['options'][_0x57d2('0x20')]||null:null,'include':_0x2d68f7[_0x57d2('0x1d')]?_0x2d68f7['options']['include']?_[_0x57d2('0x21')](_0x2d68f7[_0x57d2('0x1d')]['include'],function(_0x216ed4){return{'model':db[_0x216ed4[_0x57d2('0x22')]],'as':_0x216ed4['as'],'attributes':_0x216ed4[_0x57d2('0x20')],'include':_0x216ed4['include']?_['map'](_0x216ed4[_0x57d2('0x23')],function(_0x12d07e){return{'model':db[_0x12d07e[_0x57d2('0x22')]],'as':_0x12d07e['as'],'attributes':_0x12d07e[_0x57d2('0x20')],'include':_0x12d07e[_0x57d2('0x23')]?_[_0x57d2('0x21')](_0x12d07e[_0x57d2('0x23')],function(_0x117192){return{'model':db[_0x117192[_0x57d2('0x22')]],'as':_0x117192['as'],'attributes':_0x117192['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x27f8c0){logger[_0x57d2('0x17')](_0x57d2('0x1a'),_0x2d68f7);logger[_0x57d2('0x11')](_0x57d2('0x1a'),_0x2d68f7,JSON[_0x57d2('0x13')](_0x27f8c0));_0x3013a2(_0x27f8c0);})[_0x57d2('0x24')](function(_0x2d162f){logger[_0x57d2('0x14')]('ShowSmsAccount',_0x2d162f['message'],_0x2d68f7);_0x3e40aa(_0x287645[_0x57d2('0x14')](0x1f4,_0x2d162f[_0x57d2('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 908b1d0..576420a 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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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 0381652..fbc2e04 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 _0xe14b=['/:id','create','put','exports','multer','util','express','Router','../../components/auth/service','./smsApplication.controller','get','isAuthenticated','index'];(function(_0x58608b,_0x355775){var _0x5b150d=function(_0x2ac470){while(--_0x2ac470){_0x58608b['push'](_0x58608b['shift']());}};_0x5b150d(++_0x355775);}(_0xe14b,0x93));var _0xbe14=function(_0x3254b5,_0x54fc88){_0x3254b5=_0x3254b5-0x0;var _0x5b9e37=_0xe14b[_0x3254b5];return _0x5b9e37;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xbe14('0xa')]);router[_0xbe14('0xb')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['update']);router['delete'](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['destroy']);module[_0xbe14('0xc')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index f2b6d58..4aab0a0 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 _0x42ba=['noop','TEXT','sequelize','exports','STRING'];(function(_0x39399d,_0x377e4b){var _0x2ebf58=function(_0x5bf0b6){while(--_0x5bf0b6){_0x39399d['push'](_0x39399d['shift']());}};_0x2ebf58(++_0x377e4b);}(_0x42ba,0x115));var _0xa42b=function(_0x259a6e,_0x3347b8){_0x259a6e=_0x259a6e-0x0;var _0x4ff58f=_0x42ba[_0x259a6e];return _0x4ff58f;};'use strict';var Sequelize=require(_0xa42b('0x0'));module[_0xa42b('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xa42b('0x2')],'allowNull':![],'defaultValue':_0xa42b('0x3')},'appdata':{'type':Sequelize[_0xa42b('0x4')]()},'description':{'type':Sequelize[_0xa42b('0x2')]},'interval':{'type':Sequelize[_0xa42b('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x3c9a=['INTEGER','STRING','*,*,*,*','exports'];(function(_0x544098,_0x4f7e9a){var _0x42d945=function(_0x25fb15){while(--_0x25fb15){_0x544098['push'](_0x544098['shift']());}};_0x42d945(++_0x4f7e9a);}(_0x3c9a,0x77));var _0xa3c9=function(_0x38b777,_0x58b31e){_0x38b777=_0x38b777-0x0;var _0x41da2c=_0x3c9a[_0x38b777];return _0x41da2c;};'use strict';var Sequelize=require('sequelize');module[_0xa3c9('0x0')]={'priority':{'type':Sequelize[_0xa3c9('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xa3c9('0x2')],'defaultValue':_0xa3c9('0x3')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 4c8ce54..d924e0d 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 _0x607f=['apply','reject','save','update','then','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','merge','SmsApplication','includeAll','include','findAll','rows','catch','params','keys','options','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','json','undefined','count','offset','limit','Content-Range'];(function(_0x5ee3d3,_0x537c30){var _0x4b272f=function(_0x3dc277){while(--_0x3dc277){_0x5ee3d3['push'](_0x5ee3d3['shift']());}};_0x4b272f(++_0x537c30);}(_0x607f,0x1d5));var _0xf607=function(_0x2ba671,_0x4ec91f){_0x2ba671=_0x2ba671-0x0;var _0x418b9c=_0x607f[_0x2ba671];return _0x418b9c;};'use strict';var emlformat=require(_0xf607('0x0'));var rimraf=require(_0xf607('0x1'));var zipdir=require(_0xf607('0x2'));var jsonpatch=require(_0xf607('0x3'));var rp=require(_0xf607('0x4'));var moment=require('moment');var BPromise=require(_0xf607('0x5'));var Mustache=require(_0xf607('0x6'));var util=require(_0xf607('0x7'));var path=require(_0xf607('0x8'));var sox=require(_0xf607('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf607('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf607('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf607('0xc'));var Redis=require(_0xf607('0xd'));var authService=require(_0xf607('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xf607('0xf'));var hardwareService=require(_0xf607('0x10'));var logger=require('../../config/logger')(_0xf607('0x11'));var utils=require(_0xf607('0x12'));var config=require(_0xf607('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xf607('0x14'))['db'];function respondWithStatusCode(_0x55cc9a,_0x31c8ed){_0x31c8ed=_0x31c8ed||0xcc;return function(_0x16b32f){if(_0x16b32f){return _0x55cc9a['sendStatus'](_0x31c8ed);}return _0x55cc9a[_0xf607('0x15')](_0x31c8ed)['end']();};}function respondWithResult(_0x263a55,_0x252b0c){_0x252b0c=_0x252b0c||0xc8;return function(_0x1633bd){if(_0x1633bd){return _0x263a55[_0xf607('0x15')](_0x252b0c)[_0xf607('0x16')](_0x1633bd);}};}function respondWithFilteredResult(_0x528897,_0x2aa6d2){return function(_0x3f1cd1){if(_0x3f1cd1){var _0x3a3293=typeof _0x2aa6d2['offset']===_0xf607('0x17')&&typeof _0x2aa6d2['limit']===_0xf607('0x17');var _0x42b418=_0x3f1cd1[_0xf607('0x18')];var _0x5ecea4=_0x3a3293?0x0:_0x2aa6d2[_0xf607('0x19')];var _0x202466=_0x3a3293?_0x3f1cd1['count']:_0x2aa6d2['offset']+_0x2aa6d2[_0xf607('0x1a')];var _0x1a857e;if(_0x202466>=_0x42b418){_0x202466=_0x42b418;_0x1a857e=0xc8;}else{_0x1a857e=0xce;}_0x528897[_0xf607('0x15')](_0x1a857e);return _0x528897['set'](_0xf607('0x1b'),_0x5ecea4+'-'+_0x202466+'/'+_0x42b418)[_0xf607('0x16')](_0x3f1cd1);}return null;};}function patchUpdates(_0x5b3340){return function(_0x484059){try{jsonpatch[_0xf607('0x1c')](_0x484059,_0x5b3340,!![]);}catch(_0x40014c){return BPromise[_0xf607('0x1d')](_0x40014c);}return _0x484059[_0xf607('0x1e')]();};}function saveUpdates(_0x322080,_0x37d137){return function(_0x2176ab){if(_0x2176ab){return _0x2176ab[_0xf607('0x1f')](_0x322080)[_0xf607('0x20')](function(_0x3fa805){return _0x3fa805;});}return null;};}function removeEntity(_0x52fc1f,_0x727062){return function(_0x401fdb){if(_0x401fdb){return _0x401fdb['destroy']()[_0xf607('0x20')](function(){_0x52fc1f[_0xf607('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a61f8,_0x3c4c40){return function(_0x2282e2){if(!_0x2282e2){_0x5a61f8[_0xf607('0x21')](0x194);}return _0x2282e2;};}function handleError(_0x4d5665,_0x42e28d){_0x42e28d=_0x42e28d||0x1f4;return function(_0x4ff770){logger[_0xf607('0x22')](_0x4ff770[_0xf607('0x23')]);if(_0x4ff770[_0xf607('0x24')]){delete _0x4ff770['name'];}_0x4d5665['status'](_0x42e28d)[_0xf607('0x25')](_0x4ff770);};}exports[_0xf607('0x26')]=function(_0x2ee826,_0x5610e4){var _0x33ab5e={},_0x54ae04={},_0x16075a={'count':0x0,'rows':[]};var _0x242916=_['map'](db['SmsApplication'][_0xf607('0x27')],function(_0x443efe){return{'name':_0x443efe[_0xf607('0x28')],'type':_0x443efe[_0xf607('0x29')][_0xf607('0x2a')]};});_0x54ae04[_0xf607('0x2b')]=_[_0xf607('0x2c')](_0x242916,'name');_0x54ae04[_0xf607('0x2d')]=_['keys'](_0x2ee826[_0xf607('0x2d')]);_0x54ae04[_0xf607('0x2e')]=_[_0xf607('0x2f')](_0x54ae04['model'],_0x54ae04[_0xf607('0x2d')]);_0x33ab5e[_0xf607('0x30')]=_[_0xf607('0x2f')](_0x54ae04[_0xf607('0x2b')],qs[_0xf607('0x31')](_0x2ee826[_0xf607('0x2d')][_0xf607('0x31')]));_0x33ab5e[_0xf607('0x30')]=_0x33ab5e[_0xf607('0x30')][_0xf607('0x32')]?_0x33ab5e[_0xf607('0x30')]:_0x54ae04[_0xf607('0x2b')];if(!_0x2ee826['query']['hasOwnProperty'](_0xf607('0x33'))){_0x33ab5e[_0xf607('0x1a')]=qs[_0xf607('0x1a')](_0x2ee826[_0xf607('0x2d')][_0xf607('0x1a')]);_0x33ab5e['offset']=qs[_0xf607('0x19')](_0x2ee826['query']['offset']);}_0x33ab5e[_0xf607('0x34')]=qs[_0xf607('0x35')](_0x2ee826[_0xf607('0x2d')][_0xf607('0x35')]);_0x33ab5e[_0xf607('0x36')]=qs[_0xf607('0x2e')](_['pick'](_0x2ee826['query'],_0x54ae04[_0xf607('0x2e')]),_0x242916);if(_0x2ee826[_0xf607('0x2d')][_0xf607('0x37')]){_0x33ab5e[_0xf607('0x36')]=_['merge'](_0x33ab5e[_0xf607('0x36')],{'$or':_['map'](_0x242916,function(_0x2ea2f0){if(_0x2ea2f0[_0xf607('0x29')]!==_0xf607('0x38')){var _0x3c1998={};_0x3c1998[_0x2ea2f0[_0xf607('0x24')]]={'$like':'%'+_0x2ee826[_0xf607('0x2d')]['filter']+'%'};return _0x3c1998;}})});}_0x33ab5e=_[_0xf607('0x39')]({},_0x33ab5e,_0x2ee826['options']);var _0x2e6a3a={'where':_0x33ab5e[_0xf607('0x36')]};return db[_0xf607('0x3a')][_0xf607('0x18')](_0x2e6a3a)['then'](function(_0x4b9be4){_0x16075a[_0xf607('0x18')]=_0x4b9be4;if(_0x2ee826[_0xf607('0x2d')][_0xf607('0x3b')]){_0x33ab5e[_0xf607('0x3c')]=[{'all':!![]}];}return db[_0xf607('0x3a')][_0xf607('0x3d')](_0x33ab5e);})[_0xf607('0x20')](function(_0x30e0fc){_0x16075a[_0xf607('0x3e')]=_0x30e0fc;return _0x16075a;})['then'](respondWithFilteredResult(_0x5610e4,_0x33ab5e))[_0xf607('0x3f')](handleError(_0x5610e4,null));};exports['show']=function(_0x5635ca,_0x3cf091){var _0x396577={'raw':!![],'where':{'id':_0x5635ca[_0xf607('0x40')]['id']}},_0x40641f={};_0x40641f[_0xf607('0x2b')]=_[_0xf607('0x41')](db[_0xf607('0x3a')]['rawAttributes']);_0x40641f['query']=_['keys'](_0x5635ca[_0xf607('0x2d')]);_0x40641f[_0xf607('0x2e')]=_[_0xf607('0x2f')](_0x40641f['model'],_0x40641f[_0xf607('0x2d')]);_0x396577[_0xf607('0x30')]=_[_0xf607('0x2f')](_0x40641f[_0xf607('0x2b')],qs['fields'](_0x5635ca[_0xf607('0x2d')][_0xf607('0x31')]));_0x396577[_0xf607('0x30')]=_0x396577[_0xf607('0x30')][_0xf607('0x32')]?_0x396577[_0xf607('0x30')]:_0x40641f[_0xf607('0x2b')];if(_0x5635ca[_0xf607('0x2d')][_0xf607('0x3b')]){_0x396577[_0xf607('0x3c')]=[{'all':!![]}];}_0x396577=_[_0xf607('0x39')]({},_0x396577,_0x5635ca[_0xf607('0x42')]);return db[_0xf607('0x3a')][_0xf607('0x43')](_0x396577)[_0xf607('0x20')](handleEntityNotFound(_0x3cf091,null))['then'](respondWithResult(_0x3cf091,null))[_0xf607('0x3f')](handleError(_0x3cf091,null));};exports[_0xf607('0x44')]=function(_0xbb1252,_0xe4a918){return db['SmsApplication'][_0xf607('0x44')](_0xbb1252[_0xf607('0x45')],{})[_0xf607('0x20')](respondWithResult(_0xe4a918,0xc9))[_0xf607('0x3f')](handleError(_0xe4a918,null));};exports['update']=function(_0x5cb21e,_0x5a746c){if(_0x5cb21e['body']['id']){delete _0x5cb21e[_0xf607('0x45')]['id'];}return db[_0xf607('0x3a')]['find']({'where':{'id':_0x5cb21e[_0xf607('0x40')]['id']}})[_0xf607('0x20')](handleEntityNotFound(_0x5a746c,null))[_0xf607('0x20')](saveUpdates(_0x5cb21e[_0xf607('0x45')],null))['then'](respondWithResult(_0x5a746c,null))[_0xf607('0x3f')](handleError(_0x5a746c,null));};exports[_0xf607('0x46')]=function(_0x4e76a3,_0x18b810){return db[_0xf607('0x3a')][_0xf607('0x43')]({'where':{'id':_0x4e76a3[_0xf607('0x40')]['id']}})[_0xf607('0x20')](handleEntityNotFound(_0x18b810,null))[_0xf607('0x20')](removeEntity(_0x18b810,null))[_0xf607('0x3f')](handleError(_0x18b810,null));}; \ No newline at end of file +var _0x17a6=['update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','includeAll','SmsApplication','findAll','params','fields','include','merge','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','limit','count','offset','status','set','Content-Range','reject','save'];(function(_0x4df9ea,_0x3d19ad){var _0x40c78b=function(_0x21fd7c){while(--_0x21fd7c){_0x4df9ea['push'](_0x4df9ea['shift']());}};_0x40c78b(++_0x3d19ad);}(_0x17a6,0x107));var _0x617a=function(_0x1753b8,_0x3edb69){_0x1753b8=_0x1753b8-0x0;var _0x1e56e6=_0x17a6[_0x1753b8];return _0x1e56e6;};'use strict';var emlformat=require(_0x617a('0x0'));var rimraf=require(_0x617a('0x1'));var zipdir=require(_0x617a('0x2'));var jsonpatch=require(_0x617a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x617a('0x4'));var Mustache=require(_0x617a('0x5'));var util=require(_0x617a('0x6'));var path=require(_0x617a('0x7'));var sox=require('sox');var csv=require(_0x617a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x617a('0x9'));var squel=require(_0x617a('0xa'));var crypto=require(_0x617a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x617a('0xc'));var toCsv=require('to-csv');var querystring=require(_0x617a('0xd'));var Papa=require(_0x617a('0xe'));var Redis=require(_0x617a('0xf'));var authService=require(_0x617a('0x10'));var qs=require(_0x617a('0x11'));var as=require(_0x617a('0x12'));var hardwareService=require(_0x617a('0x13'));var logger=require('../../config/logger')(_0x617a('0x14'));var utils=require(_0x617a('0x15'));var config=require(_0x617a('0x16'));var licenseUtil=require(_0x617a('0x17'));var db=require(_0x617a('0x18'))['db'];function respondWithStatusCode(_0x529781,_0x26e5cc){_0x26e5cc=_0x26e5cc||0xcc;return function(_0x2b4b37){if(_0x2b4b37){return _0x529781[_0x617a('0x19')](_0x26e5cc);}return _0x529781['status'](_0x26e5cc)[_0x617a('0x1a')]();};}function respondWithResult(_0x48ab1a,_0x587586){_0x587586=_0x587586||0xc8;return function(_0x3c63b7){if(_0x3c63b7){return _0x48ab1a['status'](_0x587586)[_0x617a('0x1b')](_0x3c63b7);}};}function respondWithFilteredResult(_0x18f8b3,_0x2bee47){return function(_0x42d2cb){if(_0x42d2cb){var _0x2dd99f=typeof _0x2bee47['offset']===_0x617a('0x1c')&&typeof _0x2bee47[_0x617a('0x1d')]===_0x617a('0x1c');var _0x2339ba=_0x42d2cb[_0x617a('0x1e')];var _0x241c86=_0x2dd99f?0x0:_0x2bee47['offset'];var _0x48addf=_0x2dd99f?_0x42d2cb[_0x617a('0x1e')]:_0x2bee47[_0x617a('0x1f')]+_0x2bee47[_0x617a('0x1d')];var _0x3f187a;if(_0x48addf>=_0x2339ba){_0x48addf=_0x2339ba;_0x3f187a=0xc8;}else{_0x3f187a=0xce;}_0x18f8b3[_0x617a('0x20')](_0x3f187a);return _0x18f8b3[_0x617a('0x21')](_0x617a('0x22'),_0x241c86+'-'+_0x48addf+'/'+_0x2339ba)['json'](_0x42d2cb);}return null;};}function patchUpdates(_0x1429e4){return function(_0x373a52){try{jsonpatch['apply'](_0x373a52,_0x1429e4,!![]);}catch(_0x45010d){return BPromise[_0x617a('0x23')](_0x45010d);}return _0x373a52[_0x617a('0x24')]();};}function saveUpdates(_0x2ba74e,_0x3bf2a6){return function(_0x2316e8){if(_0x2316e8){return _0x2316e8[_0x617a('0x25')](_0x2ba74e)['then'](function(_0x408e55){return _0x408e55;});}return null;};}function removeEntity(_0xd4cf05,_0x35a395){return function(_0x45d49c){if(_0x45d49c){return _0x45d49c[_0x617a('0x26')]()[_0x617a('0x27')](function(){_0xd4cf05['status'](0xcc)[_0x617a('0x1a')]();});}};}function handleEntityNotFound(_0x3fa289,_0x3dfd85){return function(_0x485f94){if(!_0x485f94){_0x3fa289[_0x617a('0x19')](0x194);}return _0x485f94;};}function handleError(_0x42a860,_0x179e17){_0x179e17=_0x179e17||0x1f4;return function(_0x61dddb){logger[_0x617a('0x28')](_0x61dddb[_0x617a('0x29')]);if(_0x61dddb[_0x617a('0x2a')]){delete _0x61dddb[_0x617a('0x2a')];}_0x42a860[_0x617a('0x20')](_0x179e17)[_0x617a('0x2b')](_0x61dddb);};}exports[_0x617a('0x2c')]=function(_0x48e540,_0x1c8d13){var _0x1a3bd1={},_0x33d023={},_0x48bdfc={'count':0x0,'rows':[]};var _0x2cea03=_[_0x617a('0x2d')](db['SmsApplication'][_0x617a('0x2e')],function(_0x38dea0){return{'name':_0x38dea0[_0x617a('0x2f')],'type':_0x38dea0[_0x617a('0x30')][_0x617a('0x31')]};});_0x33d023['model']=_['map'](_0x2cea03,_0x617a('0x2a'));_0x33d023[_0x617a('0x32')]=_[_0x617a('0x33')](_0x48e540[_0x617a('0x32')]);_0x33d023['filters']=_[_0x617a('0x34')](_0x33d023[_0x617a('0x35')],_0x33d023[_0x617a('0x32')]);_0x1a3bd1[_0x617a('0x36')]=_[_0x617a('0x34')](_0x33d023[_0x617a('0x35')],qs['fields'](_0x48e540[_0x617a('0x32')]['fields']));_0x1a3bd1['attributes']=_0x1a3bd1['attributes'][_0x617a('0x37')]?_0x1a3bd1[_0x617a('0x36')]:_0x33d023[_0x617a('0x35')];if(!_0x48e540[_0x617a('0x32')][_0x617a('0x38')]('nolimit')){_0x1a3bd1[_0x617a('0x1d')]=qs[_0x617a('0x1d')](_0x48e540[_0x617a('0x32')][_0x617a('0x1d')]);_0x1a3bd1[_0x617a('0x1f')]=qs['offset'](_0x48e540[_0x617a('0x32')][_0x617a('0x1f')]);}_0x1a3bd1[_0x617a('0x39')]=qs[_0x617a('0x3a')](_0x48e540[_0x617a('0x32')][_0x617a('0x3a')]);_0x1a3bd1[_0x617a('0x3b')]=qs[_0x617a('0x3c')](_[_0x617a('0x3d')](_0x48e540[_0x617a('0x32')],_0x33d023[_0x617a('0x3c')]),_0x2cea03);if(_0x48e540[_0x617a('0x32')][_0x617a('0x3e')]){_0x1a3bd1[_0x617a('0x3b')]=_['merge'](_0x1a3bd1[_0x617a('0x3b')],{'$or':_[_0x617a('0x2d')](_0x2cea03,function(_0x356e9f){if(_0x356e9f[_0x617a('0x30')]!==_0x617a('0x3f')){var _0xe23633={};_0xe23633[_0x356e9f[_0x617a('0x2a')]]={'$like':'%'+_0x48e540[_0x617a('0x32')]['filter']+'%'};return _0xe23633;}})});}_0x1a3bd1=_['merge']({},_0x1a3bd1,_0x48e540['options']);var _0x159a6a={'where':_0x1a3bd1[_0x617a('0x3b')]};return db['SmsApplication'][_0x617a('0x1e')](_0x159a6a)[_0x617a('0x27')](function(_0x1294f6){_0x48bdfc['count']=_0x1294f6;if(_0x48e540[_0x617a('0x32')][_0x617a('0x40')]){_0x1a3bd1['include']=[{'all':!![]}];}return db[_0x617a('0x41')][_0x617a('0x42')](_0x1a3bd1);})[_0x617a('0x27')](function(_0x412983){_0x48bdfc['rows']=_0x412983;return _0x48bdfc;})[_0x617a('0x27')](respondWithFilteredResult(_0x1c8d13,_0x1a3bd1))['catch'](handleError(_0x1c8d13,null));};exports['show']=function(_0x4c4f06,_0x2abc17){var _0x3edea4={'raw':!![],'where':{'id':_0x4c4f06[_0x617a('0x43')]['id']}},_0x1a5825={};_0x1a5825['model']=_['keys'](db['SmsApplication']['rawAttributes']);_0x1a5825[_0x617a('0x32')]=_[_0x617a('0x33')](_0x4c4f06['query']);_0x1a5825['filters']=_[_0x617a('0x34')](_0x1a5825[_0x617a('0x35')],_0x1a5825[_0x617a('0x32')]);_0x3edea4[_0x617a('0x36')]=_[_0x617a('0x34')](_0x1a5825['model'],qs[_0x617a('0x44')](_0x4c4f06[_0x617a('0x32')][_0x617a('0x44')]));_0x3edea4[_0x617a('0x36')]=_0x3edea4[_0x617a('0x36')][_0x617a('0x37')]?_0x3edea4[_0x617a('0x36')]:_0x1a5825[_0x617a('0x35')];if(_0x4c4f06[_0x617a('0x32')][_0x617a('0x40')]){_0x3edea4[_0x617a('0x45')]=[{'all':!![]}];}_0x3edea4=_[_0x617a('0x46')]({},_0x3edea4,_0x4c4f06['options']);return db[_0x617a('0x41')][_0x617a('0x47')](_0x3edea4)[_0x617a('0x27')](handleEntityNotFound(_0x2abc17,null))['then'](respondWithResult(_0x2abc17,null))[_0x617a('0x48')](handleError(_0x2abc17,null));};exports[_0x617a('0x49')]=function(_0x241918,_0x5e6271){return db[_0x617a('0x41')][_0x617a('0x49')](_0x241918[_0x617a('0x4a')],{})['then'](respondWithResult(_0x5e6271,0xc9))[_0x617a('0x48')](handleError(_0x5e6271,null));};exports[_0x617a('0x25')]=function(_0x2a0e95,_0x4bb145){if(_0x2a0e95['body']['id']){delete _0x2a0e95[_0x617a('0x4a')]['id'];}return db[_0x617a('0x41')][_0x617a('0x47')]({'where':{'id':_0x2a0e95[_0x617a('0x43')]['id']}})[_0x617a('0x27')](handleEntityNotFound(_0x4bb145,null))[_0x617a('0x27')](saveUpdates(_0x2a0e95['body'],null))[_0x617a('0x27')](respondWithResult(_0x4bb145,null))['catch'](handleError(_0x4bb145,null));};exports[_0x617a('0x26')]=function(_0x3207ad,_0x512f66){return db[_0x617a('0x41')]['find']({'where':{'id':_0x3207ad[_0x617a('0x43')]['id']}})[_0x617a('0x27')](handleEntityNotFound(_0x512f66,null))[_0x617a('0x27')](removeEntity(_0x512f66,null))['catch'](handleError(_0x512f66,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 8f8ccdf..e4bde9e 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 _0x3de0=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0x3de0,0x143));var _0x03de=function(_0x14bf66,_0x3e1066){_0x14bf66=_0x14bf66-0x0;var _0xaf4bf7=_0x3de0[_0x14bf66];return _0xaf4bf7;};'use strict';var _=require(_0x03de('0x0'));var util=require('util');var logger=require(_0x03de('0x1'))(_0x03de('0x2'));var moment=require('moment');var BPromise=require(_0x03de('0x3'));var rp=require(_0x03de('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x03de('0x5'));var config=require(_0x03de('0x6'));var attributes=require('./smsApplication.attributes');module['exports']=function(_0x340386,_0x6567ae){return _0x340386[_0x03de('0x7')](_0x03de('0x8'),attributes,{'tableName':_0x03de('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x03de('0xa'),'collate':_0x03de('0xb')});}; \ No newline at end of file +var _0xc03e=['bluebird','path','rimraf','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','utf8mb4','utf8mb4_unicode_ci','lodash','api'];(function(_0xae72a4,_0x1bdc6a){var _0x27c197=function(_0x5f3335){while(--_0x5f3335){_0xae72a4['push'](_0xae72a4['shift']());}};_0x27c197(++_0x1bdc6a);}(_0xc03e,0x15a));var _0xec03=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xc03e[_0x32f7d7];return _0x133d09;};'use strict';var _=require(_0xec03('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xec03('0x1'));var moment=require('moment');var BPromise=require(_0xec03('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xec03('0x3'));var rimraf=require(_0xec03('0x4'));var config=require(_0xec03('0x5'));var attributes=require(_0xec03('0x6'));module[_0xec03('0x7')]=function(_0x1ce78a,_0x31db21){return _0x1ce78a[_0xec03('0x8')](_0xec03('0x9'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xec03('0xa'),'collate':_0xec03('0xb')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 2d6a1da..119ec3a 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 _0x6dc0=['rpc','../../config/environment','client','info','SmsApplication,\x20%s,\x20%s','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1aa1cb,_0x149b39){var _0x3fc960=function(_0x122428){while(--_0x122428){_0x1aa1cb['push'](_0x1aa1cb['shift']());}};_0x3fc960(++_0x149b39);}(_0x6dc0,0xb6));var _0x06dc=function(_0x23d028,_0x164bda){_0x23d028=_0x23d028-0x0;var _0x467d65=_0x6dc0[_0x23d028];return _0x467d65;};'use strict';var _=require(_0x06dc('0x0'));var util=require(_0x06dc('0x1'));var moment=require(_0x06dc('0x2'));var BPromise=require('bluebird');var rs=require(_0x06dc('0x3'));var fs=require('fs');var Redis=require(_0x06dc('0x4'));var db=require(_0x06dc('0x5'))['db'];var utils=require(_0x06dc('0x6'));var logger=require('../../config/logger')(_0x06dc('0x7'));var config=require(_0x06dc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x06dc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x419534,_0x3212ca,_0x14c15b){return new BPromise(function(_0x10e23b,_0x140eef){return client['request'](_0x419534,_0x14c15b)['then'](function(_0x480f30){logger[_0x06dc('0xa')](_0x06dc('0xb'),_0x3212ca,'request\x20sent');logger[_0x06dc('0xc')](_0x06dc('0xd'),_0x3212ca,_0x06dc('0xe'),JSON[_0x06dc('0xf')](_0x480f30));if(_0x480f30['error']){if(_0x480f30[_0x06dc('0x10')][_0x06dc('0x11')]===0x1f4){logger['error']('SmsApplication,\x20%s,\x20%s',_0x3212ca,_0x480f30['error']['message']);return _0x140eef(_0x480f30[_0x06dc('0x10')]['message']);}logger['error']('SmsApplication,\x20%s,\x20%s',_0x3212ca,_0x480f30[_0x06dc('0x10')][_0x06dc('0x12')]);return _0x10e23b(_0x480f30[_0x06dc('0x10')]['message']);}else{logger[_0x06dc('0xa')](_0x06dc('0xb'),_0x3212ca,_0x06dc('0xe'));_0x10e23b(_0x480f30[_0x06dc('0x13')]['message']);}})[_0x06dc('0x14')](function(_0x30c1c5){logger[_0x06dc('0x10')](_0x06dc('0xb'),_0x3212ca,_0x30c1c5);_0x140eef(_0x30c1c5);});});} \ No newline at end of file +var _0x7916=['result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0xcce451,_0x2dbd1a){var _0x5ade27=function(_0x240379){while(--_0x240379){_0xcce451['push'](_0xcce451['shift']());}};_0x5ade27(++_0x2dbd1a);}(_0x7916,0x128));var _0x6791=function(_0x2c7253,_0x5debe6){_0x2c7253=_0x2c7253-0x0;var _0x4ae6fb=_0x7916[_0x2c7253];return _0x4ae6fb;};'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});function respondWithRpcPromise(_0x5ad8c0,_0x8b85ff,_0x5d2118){return new BPromise(function(_0x2b240c,_0x50c563){return client['request'](_0x5ad8c0,_0x5d2118)[_0x6791('0xa')](function(_0x198a64){logger['info'](_0x6791('0xb'),_0x8b85ff,_0x6791('0xc'));logger[_0x6791('0xd')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x8b85ff,_0x6791('0xc'),JSON[_0x6791('0xe')](_0x198a64));if(_0x198a64[_0x6791('0xf')]){if(_0x198a64[_0x6791('0xf')][_0x6791('0x10')]===0x1f4){logger[_0x6791('0xf')](_0x6791('0xb'),_0x8b85ff,_0x198a64[_0x6791('0xf')][_0x6791('0x11')]);return _0x50c563(_0x198a64[_0x6791('0xf')][_0x6791('0x11')]);}logger['error']('SmsApplication,\x20%s,\x20%s',_0x8b85ff,_0x198a64[_0x6791('0xf')]['message']);return _0x2b240c(_0x198a64[_0x6791('0xf')]['message']);}else{logger[_0x6791('0x12')](_0x6791('0xb'),_0x8b85ff,'request\x20sent');_0x2b240c(_0x198a64[_0x6791('0x13')]['message']);}})[_0x6791('0x14')](function(_0x150d1f){logger['error'](_0x6791('0xb'),_0x8b85ff,_0x150d1f);_0x50c563(_0x150d1f);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 70718d6..af88193 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 _0x0abf=['create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','smsinteraction:destroy','destroy','delete','removeTags','exports','multer','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','describe','/:id','show','/:id/messages','download','post'];(function(_0x6bfbea,_0x309a7a){var _0x32214c=function(_0x5a63e6){while(--_0x5a63e6){_0x6bfbea['push'](_0x6bfbea['shift']());}};_0x32214c(++_0x309a7a);}(_0x0abf,0xe8));var _0xf0ab=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x0abf[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0xf0ab('0x0'));var util=require('util');var path=require(_0xf0ab('0x1'));var timeout=require(_0xf0ab('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf0ab('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf0ab('0x4'));var config=require(_0xf0ab('0x5'));var controller=require(_0xf0ab('0x6'));router[_0xf0ab('0x7')]('/',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x9')]);router[_0xf0ab('0x7')]('/describe',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0xa')]);router[_0xf0ab('0x7')](_0xf0ab('0xb'),auth['isAuthenticated'](),controller[_0xf0ab('0xc')]);router[_0xf0ab('0x7')](_0xf0ab('0xd'),auth['isAuthenticated'](),controller['getMessages']);router[_0xf0ab('0x7')]('/:id/download',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0xe')]);router[_0xf0ab('0xf')]('/',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x10')]);router[_0xf0ab('0xf')](_0xf0ab('0xd'),auth['isAuthenticated'](),controller[_0xf0ab('0x11')]);router[_0xf0ab('0xf')](_0xf0ab('0x12'),auth[_0xf0ab('0x8')](),interaction[_0xf0ab('0x13')](_0xf0ab('0x14'),_0xf0ab('0x15')),controller[_0xf0ab('0x16')]);router[_0xf0ab('0x17')](_0xf0ab('0xb'),auth[_0xf0ab('0x8')](),interaction[_0xf0ab('0x13')](_0xf0ab('0x14'),_0xf0ab('0x18')),controller[_0xf0ab('0x19')]);router['delete'](_0xf0ab('0xb'),auth[_0xf0ab('0x8')](),interaction[_0xf0ab('0x13')](_0xf0ab('0x14'),_0xf0ab('0x1a')),controller[_0xf0ab('0x1b')]);router[_0xf0ab('0x1c')](_0xf0ab('0x12'),auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x1d')]);module[_0xf0ab('0x1e')]=router; \ No newline at end of file +var _0x14a0=['/:id/download','post','create','/:id/messages','addMessage','/:id/tags','tracked','sms','addTags','put','smsinteraction:update','update','delete','/:id','smsinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./smsInteraction.controller','get','isAuthenticated','/describe','describe','getMessages'];(function(_0x1f9cca,_0x3e51da){var _0x2aba04=function(_0x3037f6){while(--_0x3037f6){_0x1f9cca['push'](_0x1f9cca['shift']());}};_0x2aba04(++_0x3e51da);}(_0x14a0,0x8e));var _0x014a=function(_0x5234a6,_0x44fa0a){_0x5234a6=_0x5234a6-0x0;var _0x473c8e=_0x14a0[_0x5234a6];return _0x473c8e;};'use strict';var multer=require('multer');var util=require(_0x014a('0x0'));var path=require(_0x014a('0x1'));var timeout=require(_0x014a('0x2'));var express=require(_0x014a('0x3'));var router=express[_0x014a('0x4')]();var fs_extra=require(_0x014a('0x5'));var auth=require(_0x014a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x014a('0x7'));router[_0x014a('0x8')]('/',auth[_0x014a('0x9')](),controller['index']);router['get'](_0x014a('0xa'),auth[_0x014a('0x9')](),controller[_0x014a('0xb')]);router['get']('/:id',auth[_0x014a('0x9')](),controller['show']);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0x014a('0xc')]);router['get'](_0x014a('0xd'),auth[_0x014a('0x9')](),controller['download']);router[_0x014a('0xe')]('/',auth[_0x014a('0x9')](),controller[_0x014a('0xf')]);router[_0x014a('0xe')](_0x014a('0x10'),auth[_0x014a('0x9')](),controller[_0x014a('0x11')]);router[_0x014a('0xe')](_0x014a('0x12'),auth[_0x014a('0x9')](),interaction[_0x014a('0x13')](_0x014a('0x14'),'smsinteraction:addtags'),controller[_0x014a('0x15')]);router[_0x014a('0x16')]('/:id',auth[_0x014a('0x9')](),interaction[_0x014a('0x13')]('sms',_0x014a('0x17')),controller[_0x014a('0x18')]);router[_0x014a('0x19')](_0x014a('0x1a'),auth[_0x014a('0x9')](),interaction[_0x014a('0x13')](_0x014a('0x14'),_0x014a('0x1b')),controller[_0x014a('0x1c')]);router[_0x014a('0x19')](_0x014a('0x12'),auth[_0x014a('0x9')](),controller[_0x014a('0x1d')]);module[_0x014a('0x1e')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 6bde209..eac57cd 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 _0x960c=['exports','DATE','STRING','out','ENUM','sequelize'];(function(_0x545a79,_0x1f3160){var _0x3e0101=function(_0x496855){while(--_0x496855){_0x545a79['push'](_0x545a79['shift']());}};_0x3e0101(++_0x1f3160);}(_0x960c,0x113));var _0xc960=function(_0x5a812b,_0x3f9996){_0x5a812b=_0x5a812b-0x0;var _0x584f4f=_0x960c[_0x5a812b];return _0x584f4f;};'use strict';var Sequelize=require(_0xc960('0x0'));var moment=require('moment');module[_0xc960('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc960('0x2')]},'disposition':{'type':Sequelize[_0xc960('0x3')]},'secondDisposition':{'type':Sequelize[_0xc960('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xc960('0x3')]},'phone':{'type':Sequelize[_0xc960('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xc960('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xc960('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xc960('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x8819=['DATE','STRING','ENUM','out','exports','BOOLEAN'];(function(_0x1bc296,_0x4c0446){var _0x3b22da=function(_0x5a0558){while(--_0x5a0558){_0x1bc296['push'](_0x1bc296['shift']());}};_0x3b22da(++_0x4c0446);}(_0x8819,0x94));var _0x9881=function(_0x421c55,_0x169e3a){_0x421c55=_0x421c55-0x0;var _0x589d4c=_0x8819[_0x421c55];return _0x589d4c;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x9881('0x0')]={'closed':{'type':Sequelize[_0x9881('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9881('0x2')]},'disposition':{'type':Sequelize[_0x9881('0x3')]},'secondDisposition':{'type':Sequelize[_0x9881('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x9881('0x3')]},'phone':{'type':Sequelize[_0x9881('0x3')]},'read1stAt':{'type':Sequelize[_0x9881('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x9881('0x4')]('in',_0x9881('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9881('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x9881('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 5ce45ea..799a88b 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 _0xdbfc=['ids','omit','getMessages','findOne','hasOwnProperty','pick','SmsInteractionId','filter','format','YYYY-MM-DD\x20HH:mm:ss','setTags','spread','emit','removeTags','download','unix','join','root','server','tmp','files','attachments','transcript-%d-%s.zip','fullname','CmContact','Contact','lastName','direction','SmsAccount','Owner','get','mkdirSync','Sms','N.A.','closed','closedAt','Messages','out','System','secret','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','stack','name','send','Users','map','Tags','TagIds','split','forEach','push','catch','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','select','field','color','from','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','having','`\x20>\x200','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','t.id\x20IN\x20?','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','agent','toString','sequelize','keyBy','merge','SmsInteraction','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','all','rows','params','includeAll','include','options','create','describe','addMessage','SmsMessage'];(function(_0xc20ed7,_0x539803){var _0x1e8139=function(_0x14328e){while(--_0x14328e){_0xc20ed7['push'](_0xc20ed7['shift']());}};_0x1e8139(++_0x539803);}(_0xdbfc,0x11d));var _0xcdbf=function(_0x2b03ee,_0x30b66e){_0x2b03ee=_0x2b03ee-0x0;var _0x17752d=_0xdbfc[_0x2b03ee];return _0x17752d;};'use strict';var emlformat=require(_0xcdbf('0x0'));var rimraf=require(_0xcdbf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xcdbf('0x2'));var moment=require(_0xcdbf('0x3'));var BPromise=require(_0xcdbf('0x4'));var Mustache=require(_0xcdbf('0x5'));var util=require(_0xcdbf('0x6'));var path=require(_0xcdbf('0x7'));var sox=require(_0xcdbf('0x8'));var csv=require('to-csv');var ejs=require(_0xcdbf('0x9'));var fs=require('fs');var fs_extra=require(_0xcdbf('0xa'));var _=require('lodash');var squel=require(_0xcdbf('0xb'));var crypto=require(_0xcdbf('0xc'));var jsforce=require(_0xcdbf('0xd'));var deskjs=require(_0xcdbf('0xe'));var toCsv=require('to-csv');var querystring=require(_0xcdbf('0xf'));var Papa=require(_0xcdbf('0x10'));var Redis=require(_0xcdbf('0x11'));var authService=require(_0xcdbf('0x12'));var qs=require(_0xcdbf('0x13'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xcdbf('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcdbf('0x15'))('api');var utils=require(_0xcdbf('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xcdbf('0x17'));var db=require(_0xcdbf('0x18'))['db'];config[_0xcdbf('0x19')]=_['defaults'](config[_0xcdbf('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xcdbf('0x1a'))(new Redis(config[_0xcdbf('0x19')]));require(_0xcdbf('0x1b'))[_0xcdbf('0x1c')](socket);function respondWithStatusCode(_0x3e3881,_0x5ec307){_0x5ec307=_0x5ec307||0xcc;return function(_0x3eba78){if(_0x3eba78){return _0x3e3881[_0xcdbf('0x1d')](_0x5ec307);}return _0x3e3881[_0xcdbf('0x1e')](_0x5ec307)[_0xcdbf('0x1f')]();};}function respondWithResult(_0x17334c,_0x2d78bc){_0x2d78bc=_0x2d78bc||0xc8;return function(_0x19b5bd){if(_0x19b5bd){return _0x17334c[_0xcdbf('0x1e')](_0x2d78bc)[_0xcdbf('0x20')](_0x19b5bd);}};}function respondWithFilteredResult(_0x3b3630,_0x133959){return function(_0x4b7f78){if(_0x4b7f78){var _0x270e96=typeof _0x133959[_0xcdbf('0x21')]===_0xcdbf('0x22')&&typeof _0x133959[_0xcdbf('0x23')]===_0xcdbf('0x22');var _0x1ec5dc=_0x4b7f78['count'];var _0x2c37b1=_0x270e96?0x0:_0x133959[_0xcdbf('0x21')];var _0x41458b=_0x270e96?_0x4b7f78[_0xcdbf('0x24')]:_0x133959[_0xcdbf('0x21')]+_0x133959['limit'];var _0x264c6b;if(_0x41458b>=_0x1ec5dc){_0x41458b=_0x1ec5dc;_0x264c6b=0xc8;}else{_0x264c6b=0xce;}_0x3b3630[_0xcdbf('0x1e')](_0x264c6b);return _0x3b3630[_0xcdbf('0x25')](_0xcdbf('0x26'),_0x2c37b1+'-'+_0x41458b+'/'+_0x1ec5dc)['json'](_0x4b7f78);}return null;};}function patchUpdates(_0x40da4f){return function(_0x5c253a){try{jsonpatch['apply'](_0x5c253a,_0x40da4f,!![]);}catch(_0xeb67c4){return BPromise['reject'](_0xeb67c4);}return _0x5c253a[_0xcdbf('0x27')]();};}function saveUpdates(_0x16b328,_0x3e1dd7){return function(_0x21da6e){if(_0x21da6e){return _0x21da6e[_0xcdbf('0x28')](_0x16b328)['then'](function(_0x464c9f){return _0x464c9f;});}return null;};}function removeEntity(_0x102f5c,_0x19898b){return function(_0x44db5a){if(_0x44db5a){return _0x44db5a[_0xcdbf('0x29')]()[_0xcdbf('0x2a')](function(){_0x102f5c[_0xcdbf('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b96ba,_0x37a5b1){return function(_0xc9f8e5){if(!_0xc9f8e5){_0x3b96ba[_0xcdbf('0x1d')](0x194);}return _0xc9f8e5;};}function handleError(_0x15c884,_0x48f4a){_0x48f4a=_0x48f4a||0x1f4;return function(_0x3c3c4b){logger['error'](_0x3c3c4b[_0xcdbf('0x2b')]);if(_0x3c3c4b[_0xcdbf('0x2c')]){delete _0x3c3c4b[_0xcdbf('0x2c')];}_0x15c884[_0xcdbf('0x1e')](_0x48f4a)[_0xcdbf('0x2d')](_0x3c3c4b);};}function getInteractionUsers(_0x575be6,_0x2863d0){return new BPromise(function(_0x10cac2,_0xcc7e4e){try{if(_0x2863d0[_0x575be6['id']]){_0x575be6[_0xcdbf('0x2e')]=_[_0xcdbf('0x2f')](_0x2863d0[_0x575be6['id']],function(_0x32cd07){return{'id':_0x32cd07['id'],'fullname':_0x32cd07['fullname']};});}}catch(_0x3957a9){_0xcc7e4e(_0x3957a9);}_0x10cac2(_0x575be6);});}function getInteractionTags(_0x1d02da,_0x39e439){return new BPromise(function(_0x39e327,_0x2e7ad5){try{if(_0x1d02da['TagIds']){_0x1d02da[_0xcdbf('0x30')]=[];_0x1d02da[_0xcdbf('0x31')][_0xcdbf('0x32')](',')[_0xcdbf('0x33')](function(_0x209e39){_0x1d02da[_0xcdbf('0x30')][_0xcdbf('0x34')](_0x39e439[_0x209e39]);});}delete _0x1d02da[_0xcdbf('0x31')];}catch(_0x4a2ec){_0x2e7ad5(_0x4a2ec);}_0x39e327(_0x1d02da);});}function updateSmsInteraction(_0x40bac1,_0x57fde0,_0x531bf8){return new BPromise(function(_0x19babb,_0x44a0a8){return getInteractionUsers(_0x40bac1,_0x531bf8)[_0xcdbf('0x2a')](function(_0x483837){return getInteractionTags(_0x483837,_0x57fde0);})[_0xcdbf('0x2a')](function(_0x40c17d){_0x19babb(_0x40c17d);})[_0xcdbf('0x35')](function(_0x1ff718){_0x44a0a8(_0x1ff718);});});}exports[_0xcdbf('0x36')]=function(_0x74ee45,_0x40cffe){var _0x3650ac={},_0x5a0569={},_0x972fef={'count':0x0,'rows':[]};var _0x5987ed=_[_0xcdbf('0x2f')](db['SmsInteraction'][_0xcdbf('0x37')],function(_0x3c1e03){return{'name':_0x3c1e03[_0xcdbf('0x38')],'type':_0x3c1e03[_0xcdbf('0x39')][_0xcdbf('0x3a')]};});_0x5a0569[_0xcdbf('0x3b')]=_[_0xcdbf('0x2f')](_0x5987ed,_0xcdbf('0x2c'));_0x5a0569[_0xcdbf('0x3c')]=_[_0xcdbf('0x3d')](_0x74ee45['query']);_0x5a0569[_0xcdbf('0x3e')]=_[_0xcdbf('0x3f')](_0x5a0569[_0xcdbf('0x3b')],_0x5a0569[_0xcdbf('0x3c')]);_0x3650ac['attributes']=_[_0xcdbf('0x3f')](_0x5a0569[_0xcdbf('0x3b')],qs[_0xcdbf('0x40')](_0x74ee45[_0xcdbf('0x3c')][_0xcdbf('0x40')]));_0x3650ac[_0xcdbf('0x41')]=_0x3650ac[_0xcdbf('0x41')][_0xcdbf('0x42')]?_0x3650ac['attributes']:_0x5a0569[_0xcdbf('0x3b')];if(!_0x74ee45[_0xcdbf('0x3c')]['hasOwnProperty'](_0xcdbf('0x43'))){_0x3650ac[_0xcdbf('0x23')]=qs[_0xcdbf('0x23')](_0x74ee45[_0xcdbf('0x3c')][_0xcdbf('0x23')]);_0x3650ac[_0xcdbf('0x21')]=qs[_0xcdbf('0x21')](_0x74ee45[_0xcdbf('0x3c')][_0xcdbf('0x21')]);}_0x3650ac[_0xcdbf('0x44')]=qs[_0xcdbf('0x45')](_0x74ee45['query'][_0xcdbf('0x45')]);_0x3650ac[_0xcdbf('0x46')]=qs[_0xcdbf('0x3e')](_['pick'](_0x74ee45[_0xcdbf('0x3c')],_0x5a0569[_0xcdbf('0x3e')]),_0x5987ed);var _0x19e423=[];var _0x188849=squel[_0xcdbf('0x47')]()[_0xcdbf('0x48')]('id')['field'](_0xcdbf('0x2c'))[_0xcdbf('0x48')](_0xcdbf('0x49'))[_0xcdbf('0x4a')]('tools_tags');var _0x53f3bf=squel[_0xcdbf('0x47')]()[_0xcdbf('0x48')](_0xcdbf('0x4b'))[_0xcdbf('0x48')](_0xcdbf('0x4c'))['field'](_0xcdbf('0x4d'))['from'](_0xcdbf('0x4e'),'ui')[_0xcdbf('0x4f')](_0xcdbf('0x50'),'u','u.id\x20=\x20ui.UserId');var _0x323d33=squel['select']()[_0xcdbf('0x4a')](_0xcdbf('0x51'),'i')[_0xcdbf('0x4f')](_0xcdbf('0x52'),'c',_0xcdbf('0x53'))[_0xcdbf('0x4f')](_0xcdbf('0x50'),'o',_0xcdbf('0x54'))['left_join'](_0xcdbf('0x55'),'a',_0xcdbf('0x56'))[_0xcdbf('0x4f')](_0xcdbf('0x57'),'me','me.SmsInteractionId\x20=\x20i.id')[_0xcdbf('0x4f')](_0xcdbf('0x58'),'it',_0xcdbf('0x59'))[_0xcdbf('0x4f')](_0xcdbf('0x5a'),'t',_0xcdbf('0x5b'));var _0x4e6e91=squel['expr']();var _0x9198f9=[];var _0x241907=squel[_0xcdbf('0x5c')]();var _0x582efb;if(_0x74ee45[_0xcdbf('0x3c')][_0xcdbf('0x5d')]){_0x582efb=as[_0xcdbf('0x5e')](_0x74ee45[_0xcdbf('0x3c')][_0xcdbf('0x5d')]);var _0x49f54f=_0x582efb[_0xcdbf('0x5f')];for(var _0x267594=0x0;_0x267594<_0x582efb['conditions'][_0xcdbf('0x42')];_0x267594++){var _0x506c98=_0x582efb[_0xcdbf('0x60')][_0x267594];var _0x1b5db4='i';var _0x417288=_[_0xcdbf('0x61')](_0x5987ed,[_0xcdbf('0x2c'),_0x506c98[_0xcdbf('0x48')]]);if(!_0x417288){switch(_0x506c98[_0xcdbf('0x48')]){case'unreadMessages':if(_0x506c98['value']==0x1){_0x323d33['having']('`'+_0x506c98[_0xcdbf('0x48')]+'`\x20=\x200');}else{_0x323d33[_0xcdbf('0x62')]('`'+_0x506c98['field']+_0xcdbf('0x63'));}break;case'Contact':if(_0x506c98['operator']===_0xcdbf('0x64')){if(_0x506c98['value'][_0xcdbf('0x32')]('\x20')[_0xcdbf('0x42')]>0x1){_0x4e6e91[_0x49f54f](_0xcdbf('0x65'),qs['getFullTextValue'](_0x506c98['value']),null);}else{var _0x23e0d4='%'+_0x506c98[_0xcdbf('0x66')]+'%';_0x4e6e91[_0x49f54f](_0xcdbf('0x67'),_0x23e0d4,_0x23e0d4,_0x23e0d4);}}else{_0x417288=_[_0xcdbf('0x61')](_0x5987ed,[_0xcdbf('0x2c'),'ContactId']);_0x506c98[_0xcdbf('0x48')]=_0xcdbf('0x68');_0x4124ab=as[_0xcdbf('0x69')](_0x1b5db4,_0x417288[_0xcdbf('0x39')],_0x506c98);_0x4e6e91[_0x49f54f](_0x4124ab[_0xcdbf('0x6a')],_0x4124ab[_0xcdbf('0x66')][_0xcdbf('0x6b')],_0x4124ab[_0xcdbf('0x66')][_0xcdbf('0x1f')]);}break;case _0xcdbf('0x6c'):var _0x1e370c=_0x506c98['value'][_0xcdbf('0x32')](',')[_0xcdbf('0x2f')](function(_0x3d3288){return Number(_0x3d3288);});_0x1e370c['forEach'](function(_0x2e1bcf){_0x241907['or'](_0xcdbf('0x6d'),'%,'+_0x2e1bcf+',%');});_0x9198f9=_['union'](_0x9198f9,_0x1e370c);break;case _0xcdbf('0x6e'):if(_0x506c98[_0xcdbf('0x6f')]===_0xcdbf('0x64')){_0x4e6e91[_0x49f54f](_0xcdbf('0x70'),'%'+_0x506c98[_0xcdbf('0x66')]+'%',null);}else{_0x417288=_[_0xcdbf('0x61')](_0x5987ed,[_0xcdbf('0x2c'),_0xcdbf('0x71')]);_0x506c98[_0xcdbf('0x48')]=_0xcdbf('0x71');_0x4124ab=as[_0xcdbf('0x69')](_0x1b5db4,_0x417288[_0xcdbf('0x39')],_0x506c98);_0x4e6e91[_0x49f54f](_0x4124ab[_0xcdbf('0x6a')],_0x4124ab[_0xcdbf('0x66')][_0xcdbf('0x6b')],_0x4124ab[_0xcdbf('0x66')][_0xcdbf('0x1f')]);}break;case _0xcdbf('0x72'):_0x4124ab=as[_0xcdbf('0x69')]('me',null,_0x506c98);_0x4e6e91[_0x49f54f](_0x4124ab['text'],_0x4124ab[_0xcdbf('0x66')][_0xcdbf('0x6b')],_0x4124ab[_0xcdbf('0x66')][_0xcdbf('0x1f')]);break;}}else{var _0x4124ab=as[_0xcdbf('0x69')](_0x1b5db4,_0x417288['type'],_0x506c98);_0x4e6e91[_0x49f54f](_0x4124ab[_0xcdbf('0x6a')],_0x4124ab[_0xcdbf('0x66')][_0xcdbf('0x6b')],_0x4124ab[_0xcdbf('0x66')][_0xcdbf('0x1f')]);}}}else{var _0x4051d3=_(_0x74ee45[_0xcdbf('0x3c')])['keys']()['map'](function(_0x4d3e3c){return _[_0xcdbf('0x73')](_0x5987ed,[_0xcdbf('0x2c'),_0x4d3e3c])?_0x4d3e3c:undefined;})['compact']()[_0xcdbf('0x66')]();if(!_[_0xcdbf('0x74')](_0x4051d3)){_0x4051d3[_0xcdbf('0x33')](function(_0x4985a9){if(_0x4985a9===_0xcdbf('0x75')){_0x323d33[_0xcdbf('0x46')](_0xcdbf('0x76'),[][_0xcdbf('0x77')](_0x74ee45['query'][_0x4985a9]));}else if(_0x4985a9===_0xcdbf('0x78')){var _0x1b6857=JSON[_0xcdbf('0x79')](_0x74ee45[_0xcdbf('0x3c')][_0x4985a9])[_0xcdbf('0x7a')];var _0x4d44e6=JSON[_0xcdbf('0x79')](_0x74ee45[_0xcdbf('0x3c')][_0x4985a9])['$lte'];_0x323d33[_0xcdbf('0x46')](_0xcdbf('0x7b'),_0x1b6857,_0x4d44e6);}else{if(_0x74ee45[_0xcdbf('0x3c')][_0x4985a9]==='null'){_0x323d33[_0xcdbf('0x46')]('i.'+_0x4985a9+_0xcdbf('0x7c'));}else{_0x323d33[_0xcdbf('0x46')]('i.'+_0x4985a9+_0xcdbf('0x7d'),_0x74ee45[_0xcdbf('0x3c')][_0x4985a9]);}}});}if(_0x74ee45[_0xcdbf('0x3c')][_0xcdbf('0x7e')]){if(_0x74ee45[_0xcdbf('0x3c')][_0xcdbf('0x7e')]==0x1){_0x323d33[_0xcdbf('0x62')](_0xcdbf('0x7f'));}else{_0x323d33[_0xcdbf('0x62')](_0xcdbf('0x80'));}}if(_0x74ee45[_0xcdbf('0x3c')][_0xcdbf('0x81')]){_0x9198f9=_[_0xcdbf('0x82')](_0x74ee45[_0xcdbf('0x3c')][_0xcdbf('0x81')])?_0x74ee45['query']['tag']:new Array(_0x74ee45[_0xcdbf('0x3c')]['tag']);_0x9198f9['forEach'](function(_0x53316a){_0x241907['or'](_0xcdbf('0x6d'),'%,'+_0x53316a+',%');});}if(_0x74ee45['query']['filter']){var _0x46b963=_0x74ee45[_0xcdbf('0x3c')]['filter'][_0xcdbf('0x83')]('\x5c','\x5c\x5c')[_0xcdbf('0x83')](/'/g,'\x27\x27');if(qs[_0xcdbf('0x84')](_0x46b963)){_0x4e6e91['or'](_0xcdbf('0x85'),_0x46b963+'%')['or'](_0xcdbf('0x86'),_0x46b963+'%');}else{_0x4e6e91['or'](_0xcdbf('0x87'),qs['getFullTextValue'](_0x46b963))['or'](_0xcdbf('0x88'),_0x46b963+'%');}}}_0x323d33[_0xcdbf('0x46')](_0x4e6e91);_0x323d33[_0xcdbf('0x89')](_0xcdbf('0x8a'));var _0x2a1b63={'type':db['Sequelize'][_0xcdbf('0x8b')][_0xcdbf('0x8c')],'raw':!![]};var _0x515842=_0x323d33[_0xcdbf('0x8d')]();_0x515842[_0xcdbf('0x48')]('i.id');_0x515842[_0xcdbf('0x48')](_0xcdbf('0x8e'),_0xcdbf('0x8f'));if(_0x3650ac[_0xcdbf('0x44')]){_0x3650ac[_0xcdbf('0x44')][_0xcdbf('0x33')](function(_0x240f61){var _0x473200=_0x240f61[0x0]===_0xcdbf('0x90')?_0x240f61[0x0]:'i.'+_0x240f61[0x0];_0x323d33['order'](_0x473200,_0x240f61[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x9198f9)){_0x323d33[_0xcdbf('0x62')](_0x241907);_0x515842[_0xcdbf('0x46')](_0xcdbf('0x91'),_0x9198f9);}BPromise['resolve']()['then'](function(){if(!_0x582efb){if(_0x74ee45[_0xcdbf('0x3c')][_0xcdbf('0x75')])return;_0x515842['where'](_0xcdbf('0x92'));_0x323d33['where'](_0xcdbf('0x92'));return;}if(_0x74ee45[_0xcdbf('0x93')][_0xcdbf('0x94')]!=='agent')return;return _0x74ee45[_0xcdbf('0x93')][_0xcdbf('0x95')]({'attributes':['id'],'raw':!![]})['then'](function(_0x64f2a9){if(_[_0xcdbf('0x74')](_0x64f2a9)){_0x515842['where'](_0xcdbf('0x96'));_0x323d33[_0xcdbf('0x46')](_0xcdbf('0x96'));}else{_0x515842['where'](_0xcdbf('0x76'),_['map'](_0x64f2a9,'id'));_0x323d33['where'](_0xcdbf('0x76'),_[_0xcdbf('0x2f')](_0x64f2a9,'id'));}});})[_0xcdbf('0x2a')](function(){if(_0x74ee45[_0xcdbf('0x93')]['role']===_0xcdbf('0x97')&&!_0x582efb&&!_0x74ee45['query']['SmsAccountId'])return[];return db['sequelize']['query'](_0x515842[_0xcdbf('0x98')](),_0x2a1b63);})['then'](function(_0x1a1b9f){_0x972fef[_0xcdbf('0x24')]=_0x1a1b9f[_0xcdbf('0x42')];if(_0x972fef[_0xcdbf('0x24')]===0x0)return[];return db[_0xcdbf('0x99')][_0xcdbf('0x3c')](_0x188849[_0xcdbf('0x98')](),_0x2a1b63)['then'](function(_0x5340a5){_0x19e423=_[_0xcdbf('0x9a')](_0x5340a5,'id');_0x2a1b63=_[_0xcdbf('0x9b')](_0x2a1b63,{'model':db[_0xcdbf('0x9c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x74ee45[_0xcdbf('0x3c')]['fields']){_0x3650ac[_0xcdbf('0x41')][_0xcdbf('0x33')](function(_0x24067d){_0x323d33[_0xcdbf('0x48')]('i.'+_0x24067d);});}else{_0x323d33[_0xcdbf('0x48')](_0xcdbf('0x8e'),_0xcdbf('0x8f'));_0x323d33[_0xcdbf('0x48')](_0xcdbf('0x9d'),_0xcdbf('0x9e'));_0x323d33[_0xcdbf('0x48')](_0xcdbf('0x9f'),'Account.mandatoryDisposition');_0x323d33[_0xcdbf('0x48')](_0xcdbf('0xa0'),_0xcdbf('0x90'));_0x323d33[_0xcdbf('0x48')](_0xcdbf('0xa1'));_0x323d33[_0xcdbf('0x48')](_0xcdbf('0xa2'),_0xcdbf('0xa3'));_0x323d33[_0xcdbf('0x48')](_0xcdbf('0xa4'),'Contact.lastName');_0x323d33[_0xcdbf('0x48')]('c.email',_0xcdbf('0xa5'));_0x323d33[_0xcdbf('0x48')](_0xcdbf('0xa6'),_0xcdbf('0xa7'));_0x323d33[_0xcdbf('0x48')](_0xcdbf('0xa8'),_0xcdbf('0xa9'));_0x323d33[_0xcdbf('0x48')](_0xcdbf('0xaa'),_0xcdbf('0xab'));_0x323d33['field'](_0xcdbf('0xac'),_0xcdbf('0xad'));_0x323d33[_0xcdbf('0x48')](_0xcdbf('0xae'),_0xcdbf('0xaf'));_0x323d33[_0xcdbf('0x48')](_0xcdbf('0xb0'),_0xcdbf('0x31'));}if(_0x3650ac['limit'])_0x323d33[_0xcdbf('0x23')](_0x3650ac[_0xcdbf('0x23')]);if(_0x3650ac[_0xcdbf('0x21')])_0x323d33['offset'](_0x3650ac[_0xcdbf('0x21')]);return db[_0xcdbf('0x99')][_0xcdbf('0x3c')](_0x323d33[_0xcdbf('0x98')](),_0x2a1b63);})[_0xcdbf('0x2a')](function(_0x1da8b1){if(_0x1da8b1[_0xcdbf('0x42')]>0x0)_0x53f3bf[_0xcdbf('0x46')](_0xcdbf('0xb1'),_[_0xcdbf('0x2f')](_0x1da8b1,'id'));return db[_0xcdbf('0x99')][_0xcdbf('0x3c')](_0x53f3bf['toString'](),_0x2a1b63)[_0xcdbf('0x2a')](function(_0x1d6de9){var _0x597439=_[_0xcdbf('0xb2')](_0x1d6de9,'SmsInteractionId');var _0x403f18=[];_0x1da8b1[_0xcdbf('0x33')](function(_0x394469){_0x403f18[_0xcdbf('0x34')](updateSmsInteraction(_0x394469,_0x19e423,_0x597439));});return BPromise[_0xcdbf('0xb3')](_0x403f18);});});})[_0xcdbf('0x2a')](function(_0x204e72){_0x972fef[_0xcdbf('0xb4')]=_0x204e72;return _0x972fef;})[_0xcdbf('0x2a')](respondWithFilteredResult(_0x40cffe,_0x3650ac))[_0xcdbf('0x35')](handleError(_0x40cffe,null));};exports['show']=function(_0x25228a,_0x2468fa){var _0x34a5da={'raw':![],'where':{'id':_0x25228a[_0xcdbf('0xb5')]['id']}},_0x252587={};_0x252587[_0xcdbf('0x3b')]=_[_0xcdbf('0x3d')](db[_0xcdbf('0x9c')][_0xcdbf('0x37')]);_0x252587[_0xcdbf('0x3c')]=_[_0xcdbf('0x3d')](_0x25228a[_0xcdbf('0x3c')]);_0x252587[_0xcdbf('0x3e')]=_[_0xcdbf('0x3f')](_0x252587['model'],_0x252587['query']);_0x34a5da[_0xcdbf('0x41')]=_['intersection'](_0x252587[_0xcdbf('0x3b')],qs['fields'](_0x25228a['query'][_0xcdbf('0x40')]));_0x34a5da['attributes']=_0x34a5da[_0xcdbf('0x41')][_0xcdbf('0x42')]?_0x34a5da[_0xcdbf('0x41')]:_0x252587['model'];if(_0x25228a[_0xcdbf('0x3c')][_0xcdbf('0xb6')]){_0x34a5da[_0xcdbf('0xb7')]=[{'all':!![]}];}_0x34a5da=_[_0xcdbf('0x9b')]({},_0x34a5da,_0x25228a[_0xcdbf('0xb8')]);return db['SmsInteraction'][_0xcdbf('0x61')](_0x34a5da)[_0xcdbf('0x2a')](handleEntityNotFound(_0x2468fa,null))[_0xcdbf('0x2a')](respondWithResult(_0x2468fa,null))[_0xcdbf('0x35')](handleError(_0x2468fa,null));};exports[_0xcdbf('0xb9')]=function(_0x25b0b2,_0x3e435c){return db[_0xcdbf('0x9c')]['create'](_0x25b0b2[_0xcdbf('0x72')],{})[_0xcdbf('0x2a')](respondWithResult(_0x3e435c,0xc9))[_0xcdbf('0x35')](handleError(_0x3e435c,null));};exports['update']=function(_0x16c4ec,_0x351c30){if(_0x16c4ec['body']['id']){delete _0x16c4ec[_0xcdbf('0x72')]['id'];}return db[_0xcdbf('0x9c')][_0xcdbf('0x61')]({'where':{'id':_0x16c4ec[_0xcdbf('0xb5')]['id']}})[_0xcdbf('0x2a')](handleEntityNotFound(_0x351c30,null))[_0xcdbf('0x2a')](saveUpdates(_0x16c4ec[_0xcdbf('0x72')],null))[_0xcdbf('0x2a')](respondWithResult(_0x351c30,null))[_0xcdbf('0x35')](handleError(_0x351c30,null));};exports[_0xcdbf('0x29')]=function(_0x164d78,_0x4d20da){return db[_0xcdbf('0x9c')][_0xcdbf('0x61')]({'where':{'id':_0x164d78[_0xcdbf('0xb5')]['id']}})[_0xcdbf('0x2a')](handleEntityNotFound(_0x4d20da,null))[_0xcdbf('0x2a')](removeEntity(_0x4d20da,null))[_0xcdbf('0x35')](handleError(_0x4d20da,null));};exports[_0xcdbf('0xba')]=function(_0x5257c5,_0x2f1774){return db[_0xcdbf('0x9c')][_0xcdbf('0xba')]()['then'](respondWithResult(_0x2f1774,null))[_0xcdbf('0x35')](handleError(_0x2f1774,null));};exports[_0xcdbf('0xbb')]=function(_0x48093f,_0x435d48,_0xd8c274){return db[_0xcdbf('0xbc')][_0xcdbf('0x61')]({'where':{'id':_0x48093f[_0xcdbf('0xb5')]['id']}})[_0xcdbf('0x2a')](handleEntityNotFound(_0x435d48,null))[_0xcdbf('0x2a')](function(_0x11c69a){if(_0x11c69a){return _0x11c69a[_0xcdbf('0xbb')](_0x48093f[_0xcdbf('0x72')][_0xcdbf('0xbd')],_[_0xcdbf('0xbe')](_0x48093f['body'],[_0xcdbf('0xbd'),'id'])||{});}})['then'](respondWithResult(_0x435d48,null))[_0xcdbf('0x35')](handleError(_0x435d48,null));};exports[_0xcdbf('0xbf')]=function(_0x4478d7,_0xdd3937,_0x248541){var _0x5c783f={'raw':![],'where':{}};var _0x5e6dd0={};var _0x1cc6c4={'count':0x0,'rows':[]};return db['SmsInteraction'][_0xcdbf('0xc0')]({'where':{'id':_0x4478d7[_0xcdbf('0xb5')]['id']}})[_0xcdbf('0x2a')](handleEntityNotFound(_0xdd3937,null))[_0xcdbf('0x2a')](function(_0x582f6){if(_0x582f6){_0x5e6dd0['model']=_[_0xcdbf('0x3d')](db[_0xcdbf('0xbc')][_0xcdbf('0x37')]);_0x5e6dd0['query']=_[_0xcdbf('0x3d')](_0x4478d7['query']);_0x5e6dd0[_0xcdbf('0x3e')]=_[_0xcdbf('0x3f')](_0x5e6dd0[_0xcdbf('0x3b')],_0x5e6dd0[_0xcdbf('0x3c')]);_0x5c783f[_0xcdbf('0x41')]=_['intersection'](_0x5e6dd0[_0xcdbf('0x3b')],qs[_0xcdbf('0x40')](_0x4478d7[_0xcdbf('0x3c')][_0xcdbf('0x40')]));_0x5c783f['attributes']=_0x5c783f['attributes']['length']?_0x5c783f[_0xcdbf('0x41')]:_0x5e6dd0[_0xcdbf('0x3b')];if(!_0x4478d7[_0xcdbf('0x3c')][_0xcdbf('0xc1')]('nolimit')){_0x5c783f[_0xcdbf('0x23')]=qs[_0xcdbf('0x23')](_0x4478d7[_0xcdbf('0x3c')][_0xcdbf('0x23')]);_0x5c783f['offset']=qs['offset'](_0x4478d7[_0xcdbf('0x3c')][_0xcdbf('0x21')]);}_0x5c783f[_0xcdbf('0x44')]=qs[_0xcdbf('0x45')](_0x4478d7[_0xcdbf('0x3c')]['sort']);_0x5c783f[_0xcdbf('0x46')]=qs[_0xcdbf('0x3e')](_[_0xcdbf('0xc2')](_0x4478d7['query'],_0x5e6dd0['filters']));_0x5c783f[_0xcdbf('0x46')][_0xcdbf('0xc3')]=_0x582f6['id'];if(_0x4478d7[_0xcdbf('0x3c')]['filter']){_0x5c783f['where']=_[_0xcdbf('0x9b')](_0x5c783f[_0xcdbf('0x46')],{'$or':_['map'](_0x5c783f[_0xcdbf('0x41')],function(_0x20bdd5){var _0x458c9c={};_0x458c9c[_0x20bdd5]={'$like':'%'+_0x4478d7[_0xcdbf('0x3c')][_0xcdbf('0xc4')]+'%'};return _0x458c9c;})});}if(_0x4478d7['query'][_0xcdbf('0x7a')]){var _0x1db737=_0x4478d7[_0xcdbf('0x3c')][_0xcdbf('0x7a')][_0xcdbf('0x32')](',');var _0x446046={};_0x446046[_0x1db737[0x0]]={'$gte':moment(_0x1db737[0x1])[_0xcdbf('0xc5')](_0xcdbf('0xc6'))};_0x5c783f['where']=_[_0xcdbf('0x9b')](_0x5c783f[_0xcdbf('0x46')],_0x446046);}_0x5c783f=_[_0xcdbf('0x9b')]({},_0x5c783f,_0x4478d7[_0xcdbf('0xb8')]);return db['SmsMessage'][_0xcdbf('0x24')]({'where':_0x5c783f[_0xcdbf('0x46')]})[_0xcdbf('0x2a')](function(_0x489611){_0x1cc6c4[_0xcdbf('0x24')]=_0x489611;if(_0x4478d7[_0xcdbf('0x3c')][_0xcdbf('0xb6')]){_0x5c783f[_0xcdbf('0xb7')]=[{'all':!![]}];}return db['SmsMessage']['findAll'](_0x5c783f);})[_0xcdbf('0x2a')](function(_0x3160b6){_0x1cc6c4[_0xcdbf('0xb4')]=_0x3160b6;return _0x1cc6c4;});}})[_0xcdbf('0x2a')](respondWithFilteredResult(_0xdd3937,_0x5c783f))['catch'](handleError(_0xdd3937,null));};exports['addTags']=function(_0x539bee,_0x2ca00e,_0xb5d179){return db[_0xcdbf('0x9c')][_0xcdbf('0x61')]({'where':{'id':_0x539bee[_0xcdbf('0xb5')]['id']}})[_0xcdbf('0x2a')](handleEntityNotFound(_0x2ca00e,null))[_0xcdbf('0x2a')](function(_0x2e8c68){if(_0x2e8c68){return _0x2e8c68[_0xcdbf('0xc7')](_0x539bee[_0xcdbf('0x72')]['ids'],_['omit'](_0x539bee[_0xcdbf('0x72')],[_0xcdbf('0xbd'),'id'])||{})[_0xcdbf('0xc8')](function(){return db[_0xcdbf('0x6c')]['findAll']({'attributes':['id',_0xcdbf('0x2c'),_0xcdbf('0x49')],'where':{'id':_0x539bee['body'][_0xcdbf('0xbd')]}});})['then'](function(_0x2ed791){socket[_0xcdbf('0xc9')]('smsInteractionTags:save',{'id':Number(_0x539bee[_0xcdbf('0xb5')]['id']),'tags':_0x2ed791||[]});return{'id':Number(_0x539bee['params']['id']),'tags':_0x2ed791||[]};});}})[_0xcdbf('0x2a')](respondWithResult(_0x2ca00e,null))[_0xcdbf('0x35')](handleError(_0x2ca00e,null));};exports[_0xcdbf('0xca')]=function(_0x47b307,_0x40538e,_0x1ff874){return db[_0xcdbf('0x9c')]['find']({'where':{'id':_0x47b307[_0xcdbf('0xb5')]['id']}})[_0xcdbf('0x2a')](handleEntityNotFound(_0x40538e,null))[_0xcdbf('0x2a')](function(_0x33ab0a){if(_0x33ab0a){return _0x33ab0a['removeTags'](_0x47b307[_0xcdbf('0x3c')]['ids']);}})[_0xcdbf('0x2a')](respondWithStatusCode(_0x40538e,null))[_0xcdbf('0x35')](handleError(_0x40538e,null));};exports[_0xcdbf('0xcb')]=function(_0x50f6ea,_0x3bc0c1){var _0x4ea841=moment()[_0xcdbf('0xcc')]()[_0xcdbf('0x98')]();var _0x8bf4f9=path[_0xcdbf('0xcd')](config[_0xcdbf('0xce')],_0xcdbf('0xcf'),'files',_0xcdbf('0xd0'));var _0xc6e2ef=path[_0xcdbf('0xcd')](config[_0xcdbf('0xce')],'server',_0xcdbf('0xd1'),_0xcdbf('0xd2'));var _0x19d671=path[_0xcdbf('0xcd')](_0x8bf4f9,_0x4ea841);var _0x2670b1=util[_0xcdbf('0xc5')](_0xcdbf('0xd3'),_0x50f6ea[_0xcdbf('0xb5')]['id'],_0x4ea841);var _0xe62489=path[_0xcdbf('0xcd')](_0x8bf4f9,_0x2670b1);var _0x47914d=[];_0x47914d[_0xcdbf('0x34')]({'model':db['User'],'as':_0xcdbf('0x6e'),'attributes':['id',_0xcdbf('0xd4')],'raw':!![]});_0x47914d[_0xcdbf('0x34')]({'model':db[_0xcdbf('0xd5')],'as':_0xcdbf('0xd6'),'attributes':['id','firstName',_0xcdbf('0xd7')],'raw':!![]});var _0x1e06e4=[{'model':db['SmsMessage'],'as':'Messages','attributes':['id',_0xcdbf('0x72'),_0xcdbf('0x78'),_0xcdbf('0xd8'),'secret',_0xcdbf('0x7e')],'include':_0x47914d}];_0x1e06e4[_0xcdbf('0x34')]({'model':db[_0xcdbf('0xd9')],'as':'Account','attributes':['id',_0xcdbf('0x2c')]});_0x1e06e4[_0xcdbf('0x34')]({'model':db['User'],'as':_0xcdbf('0xda'),'attributes':['id','fullname']});return db[_0xcdbf('0x9c')]['find']({'where':{'id':_0x50f6ea[_0xcdbf('0xb5')]['id']},'include':_0x1e06e4})[_0xcdbf('0x2a')](handleEntityNotFound(_0x3bc0c1,null))['then'](function(_0x12784a){if(_0x12784a){var _0x5cf117=_0x12784a[_0xcdbf('0xdb')]({'plain':!![]});fs[_0xcdbf('0xdc')](_0x19d671);var _0x5e3abe={'channel':_0xcdbf('0xdd'),'account':_0x5cf117['Account']['name'],'agent':_0x5cf117['Owner']?_0x5cf117[_0xcdbf('0xda')][_0xcdbf('0xd4')]:_0xcdbf('0xde'),'createdAt':moment(_0x5cf117[_0xcdbf('0x78')])[_0xcdbf('0xc5')](_0xcdbf('0xc6'))['toString'](),'closedAt':_0x5cf117[_0xcdbf('0xdf')]?moment(_0x5cf117[_0xcdbf('0xe0')])[_0xcdbf('0xc5')](_0xcdbf('0xc6'))['toString']():'','disposition':_0x5cf117['disposition'],'messages':_(_0x5cf117[_0xcdbf('0xe1')])['filter']({'secret':![]})['map'](function(_0x4a9194){return{'date':moment(_0x4a9194[_0xcdbf('0x78')])[_0xcdbf('0xc5')](_0xcdbf('0xc6'))[_0xcdbf('0x98')](),'sender':_0x4a9194[_0xcdbf('0xd8')]===_0xcdbf('0xe2')?_0x4a9194['User']?_0x4a9194[_0xcdbf('0x6e')][_0xcdbf('0xd4')]:_0xcdbf('0xe3'):_0x4a9194[_0xcdbf('0xd6')]['firstName']+(_0x4a9194['Contact']['lastName']?'\x20'+_0x4a9194[_0xcdbf('0xd6')]['lastName']:''),'body':_0x4a9194['body'],'direction':_0x4a9194[_0xcdbf('0xd8')]===_0xcdbf('0xe2')?'A':'C','secret':_0x4a9194[_0xcdbf('0xe4')],'read':_0x4a9194[_0xcdbf('0x7e')]};})[_0xcdbf('0x66')]()};return ejs[_0xcdbf('0xe5')](path[_0xcdbf('0xcd')](config[_0xcdbf('0xce')],_0xcdbf('0xcf'),_0xcdbf('0xe6'),_0xcdbf('0xe7')),{'interaction':_0x5e3abe})[_0xcdbf('0x2a')](function(_0x4ffed2){var _0x43171b=path[_0xcdbf('0xcd')](_0x19d671,_0xcdbf('0xe8')+_0x5cf117['id']+'-'+_0x4ea841+'.pdf');var _0x16da6a={'path':_0x43171b,'channel':_0xcdbf('0xdd'),'interactionId':_0x5cf117['id']};return pdf[_0xcdbf('0xe9')](_0x4ffed2,_0x16da6a);})[_0xcdbf('0x2a')](function(){return new BPromise(function(_0x1d7155,_0x18b5ca){zipdir(_0x19d671,{'saveTo':_0xe62489},function(_0x365d82,_0x232b9c){if(_0x365d82)return _0x18b5ca(_0x365d82);return _0x1d7155(_0x232b9c);});})[_0xcdbf('0x2a')](function(){return new BPromise(function(_0x3e33f9,_0x420463){rimraf(_0x19d671,function(_0x380793){if(_0x380793)_0x420463(_0x380793);return _0x3e33f9();});});})[_0xcdbf('0x2a')](function(){return _0x3bc0c1[_0xcdbf('0xcb')](_0xe62489,_0x2670b1,function(_0x122781){if(_0x122781){console[_0xcdbf('0xea')](_0xcdbf('0xeb'),_0x122781);}else{fs[_0xcdbf('0xec')](_0xe62489);}});});});}else{return _0x3bc0c1[_0xcdbf('0x1d')](0xc8);}})['catch'](handleError(_0x3bc0c1,null));}; \ No newline at end of file +var _0xe0c6=['where','pick','filters','select','field','color','from','u.id','u.fullname','ui.SmsInteractionId','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','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','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','buildExpression','start','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','body','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','SmsInteractionId','rows','show','params','rawAttributes','includeAll','include','options','create','describe','SmsMessage','addMessage','ids','omit','findOne','hasOwnProperty','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','emit','removeTags','download','unix','join','root','server','tmp','files','attachments','transcript-%d-%s.zip','CmContact','Contact','firstName','lastName','direction','secret','Account','Owner','get','N.A.','closedAt','disposition','out','System','renderFile','transcript-','.pdf','Sms','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','./smsInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','fullname','TagIds','Tags','split','forEach','push','catch','index','map','SmsInteraction','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xe0c6,0x9f));var _0x6e0c=function(_0x1e1e76,_0x5e980c){_0x1e1e76=_0x1e1e76-0x0;var _0x4f9c36=_0xe0c6[_0x1e1e76];return _0x4f9c36;};'use strict';var emlformat=require(_0x6e0c('0x0'));var rimraf=require(_0x6e0c('0x1'));var zipdir=require(_0x6e0c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6e0c('0x3'));var moment=require(_0x6e0c('0x4'));var BPromise=require(_0x6e0c('0x5'));var Mustache=require(_0x6e0c('0x6'));var util=require(_0x6e0c('0x7'));var path=require(_0x6e0c('0x8'));var sox=require(_0x6e0c('0x9'));var csv=require(_0x6e0c('0xa'));var ejs=require(_0x6e0c('0xb'));var fs=require('fs');var fs_extra=require(_0x6e0c('0xc'));var _=require(_0x6e0c('0xd'));var squel=require(_0x6e0c('0xe'));var crypto=require('crypto');var jsforce=require(_0x6e0c('0xf'));var deskjs=require(_0x6e0c('0x10'));var toCsv=require(_0x6e0c('0xa'));var querystring=require(_0x6e0c('0x11'));var Papa=require(_0x6e0c('0x12'));var Redis=require('ioredis');var authService=require(_0x6e0c('0x13'));var qs=require(_0x6e0c('0x14'));var as=require(_0x6e0c('0x15'));var pdf=require(_0x6e0c('0x16'));var hardwareService=require(_0x6e0c('0x17'));var logger=require(_0x6e0c('0x18'))(_0x6e0c('0x19'));var utils=require(_0x6e0c('0x1a'));var config=require(_0x6e0c('0x1b'));var licenseUtil=require(_0x6e0c('0x1c'));var db=require(_0x6e0c('0x1d'))['db'];config['redis']=_[_0x6e0c('0x1e')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6e0c('0x1f'))(new Redis(config[_0x6e0c('0x20')]));require(_0x6e0c('0x21'))[_0x6e0c('0x22')](socket);function respondWithStatusCode(_0x8d3de4,_0x487496){_0x487496=_0x487496||0xcc;return function(_0xdbb1f2){if(_0xdbb1f2){return _0x8d3de4[_0x6e0c('0x23')](_0x487496);}return _0x8d3de4[_0x6e0c('0x24')](_0x487496)[_0x6e0c('0x25')]();};}function respondWithResult(_0x4cf8f0,_0x3e4313){_0x3e4313=_0x3e4313||0xc8;return function(_0x249c17){if(_0x249c17){return _0x4cf8f0[_0x6e0c('0x24')](_0x3e4313)[_0x6e0c('0x26')](_0x249c17);}};}function respondWithFilteredResult(_0x82b5d8,_0x37976b){return function(_0x19d5cf){if(_0x19d5cf){var _0x6637b2=typeof _0x37976b[_0x6e0c('0x27')]===_0x6e0c('0x28')&&typeof _0x37976b[_0x6e0c('0x29')]===_0x6e0c('0x28');var _0x353b7c=_0x19d5cf[_0x6e0c('0x2a')];var _0xd349bb=_0x6637b2?0x0:_0x37976b[_0x6e0c('0x27')];var _0x5e2bd5=_0x6637b2?_0x19d5cf['count']:_0x37976b[_0x6e0c('0x27')]+_0x37976b[_0x6e0c('0x29')];var _0x37f2e8;if(_0x5e2bd5>=_0x353b7c){_0x5e2bd5=_0x353b7c;_0x37f2e8=0xc8;}else{_0x37f2e8=0xce;}_0x82b5d8['status'](_0x37f2e8);return _0x82b5d8[_0x6e0c('0x2b')](_0x6e0c('0x2c'),_0xd349bb+'-'+_0x5e2bd5+'/'+_0x353b7c)[_0x6e0c('0x26')](_0x19d5cf);}return null;};}function patchUpdates(_0x2f0005){return function(_0x4179bd){try{jsonpatch[_0x6e0c('0x2d')](_0x4179bd,_0x2f0005,!![]);}catch(_0xa1206f){return BPromise['reject'](_0xa1206f);}return _0x4179bd[_0x6e0c('0x2e')]();};}function saveUpdates(_0x18ae2f,_0x44eee0){return function(_0x12d714){if(_0x12d714){return _0x12d714[_0x6e0c('0x2f')](_0x18ae2f)['then'](function(_0x1308a){return _0x1308a;});}return null;};}function removeEntity(_0x5c625d,_0x41044c){return function(_0x582136){if(_0x582136){return _0x582136[_0x6e0c('0x30')]()[_0x6e0c('0x31')](function(){_0x5c625d[_0x6e0c('0x24')](0xcc)[_0x6e0c('0x25')]();});}};}function handleEntityNotFound(_0xfa2d2d,_0x2535c5){return function(_0x57728e){if(!_0x57728e){_0xfa2d2d[_0x6e0c('0x23')](0x194);}return _0x57728e;};}function handleError(_0xcce5d2,_0x87e1ab){_0x87e1ab=_0x87e1ab||0x1f4;return function(_0x462436){logger[_0x6e0c('0x32')](_0x462436[_0x6e0c('0x33')]);if(_0x462436['name']){delete _0x462436[_0x6e0c('0x34')];}_0xcce5d2['status'](_0x87e1ab)[_0x6e0c('0x35')](_0x462436);};}function getInteractionUsers(_0x145081,_0x2ddfa9){return new BPromise(function(_0x3d44da,_0x55c136){try{if(_0x2ddfa9[_0x145081['id']]){_0x145081['Users']=_['map'](_0x2ddfa9[_0x145081['id']],function(_0xce8ad9){return{'id':_0xce8ad9['id'],'fullname':_0xce8ad9[_0x6e0c('0x36')]};});}}catch(_0x16d0ee){_0x55c136(_0x16d0ee);}_0x3d44da(_0x145081);});}function getInteractionTags(_0x84167a,_0x62017b){return new BPromise(function(_0x1a3352,_0x57845d){try{if(_0x84167a[_0x6e0c('0x37')]){_0x84167a[_0x6e0c('0x38')]=[];_0x84167a[_0x6e0c('0x37')][_0x6e0c('0x39')](',')[_0x6e0c('0x3a')](function(_0x4f018f){_0x84167a['Tags'][_0x6e0c('0x3b')](_0x62017b[_0x4f018f]);});}delete _0x84167a['TagIds'];}catch(_0x41f0b8){_0x57845d(_0x41f0b8);}_0x1a3352(_0x84167a);});}function updateSmsInteraction(_0x3c254e,_0x493e0f,_0x3e06de){return new BPromise(function(_0x35d4b6,_0x4f99c8){return getInteractionUsers(_0x3c254e,_0x3e06de)[_0x6e0c('0x31')](function(_0x1a15d4){return getInteractionTags(_0x1a15d4,_0x493e0f);})[_0x6e0c('0x31')](function(_0x40d4ce){_0x35d4b6(_0x40d4ce);})[_0x6e0c('0x3c')](function(_0x591342){_0x4f99c8(_0x591342);});});}exports[_0x6e0c('0x3d')]=function(_0x429f3f,_0x47321f){var _0xcf8d77={},_0x520cc6={},_0x1b2bf1={'count':0x0,'rows':[]};var _0x1d1401=_[_0x6e0c('0x3e')](db[_0x6e0c('0x3f')]['rawAttributes'],function(_0x4e3483){return{'name':_0x4e3483[_0x6e0c('0x40')],'type':_0x4e3483[_0x6e0c('0x41')][_0x6e0c('0x42')]};});_0x520cc6[_0x6e0c('0x43')]=_[_0x6e0c('0x3e')](_0x1d1401,_0x6e0c('0x34'));_0x520cc6[_0x6e0c('0x44')]=_[_0x6e0c('0x45')](_0x429f3f['query']);_0x520cc6['filters']=_[_0x6e0c('0x46')](_0x520cc6[_0x6e0c('0x43')],_0x520cc6[_0x6e0c('0x44')]);_0xcf8d77[_0x6e0c('0x47')]=_[_0x6e0c('0x46')](_0x520cc6[_0x6e0c('0x43')],qs[_0x6e0c('0x48')](_0x429f3f['query'][_0x6e0c('0x48')]));_0xcf8d77[_0x6e0c('0x47')]=_0xcf8d77[_0x6e0c('0x47')][_0x6e0c('0x49')]?_0xcf8d77[_0x6e0c('0x47')]:_0x520cc6[_0x6e0c('0x43')];if(!_0x429f3f[_0x6e0c('0x44')]['hasOwnProperty'](_0x6e0c('0x4a'))){_0xcf8d77['limit']=qs[_0x6e0c('0x29')](_0x429f3f[_0x6e0c('0x44')]['limit']);_0xcf8d77['offset']=qs['offset'](_0x429f3f[_0x6e0c('0x44')][_0x6e0c('0x27')]);}_0xcf8d77[_0x6e0c('0x4b')]=qs['sort'](_0x429f3f['query'][_0x6e0c('0x4c')]);_0xcf8d77[_0x6e0c('0x4d')]=qs['filters'](_[_0x6e0c('0x4e')](_0x429f3f[_0x6e0c('0x44')],_0x520cc6[_0x6e0c('0x4f')]),_0x1d1401);var _0x4d0379=[];var _0x1088f0=squel[_0x6e0c('0x50')]()['field']('id')[_0x6e0c('0x51')]('name')[_0x6e0c('0x51')](_0x6e0c('0x52'))[_0x6e0c('0x53')]('tools_tags');var _0xa00e34=squel['select']()[_0x6e0c('0x51')](_0x6e0c('0x54'))[_0x6e0c('0x51')](_0x6e0c('0x55'))['field'](_0x6e0c('0x56'))[_0x6e0c('0x53')]('user_has_sms_interactions','ui')[_0x6e0c('0x57')](_0x6e0c('0x58'),'u',_0x6e0c('0x59'));var _0x22f037=squel[_0x6e0c('0x50')]()[_0x6e0c('0x53')](_0x6e0c('0x5a'),'i')[_0x6e0c('0x57')](_0x6e0c('0x5b'),'c',_0x6e0c('0x5c'))[_0x6e0c('0x57')](_0x6e0c('0x58'),'o','o.id\x20=\x20i.UserId')[_0x6e0c('0x57')](_0x6e0c('0x5d'),'a',_0x6e0c('0x5e'))[_0x6e0c('0x57')](_0x6e0c('0x5f'),'me',_0x6e0c('0x60'))[_0x6e0c('0x57')]('sms_interaction_has_tags','it',_0x6e0c('0x61'))[_0x6e0c('0x57')]('tools_tags','t',_0x6e0c('0x62'));var _0x21711f=squel[_0x6e0c('0x63')]();var _0x238f23=[];var _0x12998=squel[_0x6e0c('0x63')]();var _0x30f690;if(_0x429f3f[_0x6e0c('0x44')][_0x6e0c('0x64')]){_0x30f690=as['parseSearch'](_0x429f3f[_0x6e0c('0x44')][_0x6e0c('0x64')]);var _0x264626=_0x30f690['sqlOperator'];for(var _0x384189=0x0;_0x384189<_0x30f690[_0x6e0c('0x65')][_0x6e0c('0x49')];_0x384189++){var _0x34ea2c=_0x30f690[_0x6e0c('0x65')][_0x384189];var _0x4c0b84='i';var _0x2e569a=_[_0x6e0c('0x66')](_0x1d1401,[_0x6e0c('0x34'),_0x34ea2c[_0x6e0c('0x51')]]);if(!_0x2e569a){switch(_0x34ea2c[_0x6e0c('0x51')]){case _0x6e0c('0x67'):if(_0x34ea2c[_0x6e0c('0x68')]==0x1){_0x22f037[_0x6e0c('0x69')]('`'+_0x34ea2c['field']+_0x6e0c('0x6a'));}else{_0x22f037[_0x6e0c('0x69')]('`'+_0x34ea2c['field']+'`\x20>\x200');}break;case'Contact':if(_0x34ea2c[_0x6e0c('0x6b')]===_0x6e0c('0x6c')){if(_0x34ea2c['value'][_0x6e0c('0x39')]('\x20')['length']>0x1){_0x21711f[_0x264626](_0x6e0c('0x6d'),qs[_0x6e0c('0x6e')](_0x34ea2c[_0x6e0c('0x68')]),null);}else{var _0x517d5c='%'+_0x34ea2c['value']+'%';_0x21711f[_0x264626](_0x6e0c('0x6f'),_0x517d5c,_0x517d5c,_0x517d5c);}}else{_0x2e569a=_[_0x6e0c('0x66')](_0x1d1401,[_0x6e0c('0x34'),'ContactId']);_0x34ea2c[_0x6e0c('0x51')]='ContactId';_0x332364=as[_0x6e0c('0x70')](_0x4c0b84,_0x2e569a['type'],_0x34ea2c);_0x21711f[_0x264626](_0x332364['text'],_0x332364[_0x6e0c('0x68')][_0x6e0c('0x71')],_0x332364[_0x6e0c('0x68')]['end']);}break;case _0x6e0c('0x72'):var _0xf82f65=_0x34ea2c[_0x6e0c('0x68')][_0x6e0c('0x39')](',')[_0x6e0c('0x3e')](function(_0x501b02){return Number(_0x501b02);});_0xf82f65[_0x6e0c('0x3a')](function(_0x18830a){_0x12998['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x18830a+',%');});_0x238f23=_[_0x6e0c('0x73')](_0x238f23,_0xf82f65);break;case _0x6e0c('0x74'):if(_0x34ea2c[_0x6e0c('0x6b')]==='$substring'){_0x21711f[_0x264626](_0x6e0c('0x75'),'%'+_0x34ea2c[_0x6e0c('0x68')]+'%',null);}else{_0x2e569a=_['find'](_0x1d1401,[_0x6e0c('0x34'),'UserId']);_0x34ea2c['field']='UserId';_0x332364=as['buildExpression'](_0x4c0b84,_0x2e569a[_0x6e0c('0x41')],_0x34ea2c);_0x21711f[_0x264626](_0x332364[_0x6e0c('0x76')],_0x332364['value'][_0x6e0c('0x71')],_0x332364['value'][_0x6e0c('0x25')]);}break;case _0x6e0c('0x77'):_0x332364=as[_0x6e0c('0x70')]('me',null,_0x34ea2c);_0x21711f[_0x264626](_0x332364[_0x6e0c('0x76')],_0x332364[_0x6e0c('0x68')][_0x6e0c('0x71')],_0x332364['value'][_0x6e0c('0x25')]);break;}}else{var _0x332364=as[_0x6e0c('0x70')](_0x4c0b84,_0x2e569a['type'],_0x34ea2c);_0x21711f[_0x264626](_0x332364[_0x6e0c('0x76')],_0x332364[_0x6e0c('0x68')][_0x6e0c('0x71')],_0x332364['value'][_0x6e0c('0x25')]);}}}else{var _0x4a2fd7=_(_0x429f3f[_0x6e0c('0x44')])[_0x6e0c('0x45')]()[_0x6e0c('0x3e')](function(_0x1c223e){return _['some'](_0x1d1401,['name',_0x1c223e])?_0x1c223e:undefined;})[_0x6e0c('0x78')]()[_0x6e0c('0x68')]();if(!_[_0x6e0c('0x79')](_0x4a2fd7)){_0x4a2fd7[_0x6e0c('0x3a')](function(_0x523c9f){if(_0x523c9f===_0x6e0c('0x7a')){_0x22f037[_0x6e0c('0x4d')](_0x6e0c('0x7b'),[][_0x6e0c('0x7c')](_0x429f3f[_0x6e0c('0x44')][_0x523c9f]));}else if(_0x523c9f===_0x6e0c('0x7d')){var _0x1b4175=JSON[_0x6e0c('0x7e')](_0x429f3f[_0x6e0c('0x44')][_0x523c9f])[_0x6e0c('0x7f')];var _0x433db9=JSON[_0x6e0c('0x7e')](_0x429f3f[_0x6e0c('0x44')][_0x523c9f])['$lte'];_0x22f037['where'](_0x6e0c('0x80'),_0x1b4175,_0x433db9);}else{if(_0x429f3f['query'][_0x523c9f]===_0x6e0c('0x81')){_0x22f037[_0x6e0c('0x4d')]('i.'+_0x523c9f+_0x6e0c('0x82'));}else{_0x22f037['where']('i.'+_0x523c9f+_0x6e0c('0x83'),_0x429f3f['query'][_0x523c9f]);}}});}if(_0x429f3f[_0x6e0c('0x44')]['read']){if(_0x429f3f[_0x6e0c('0x44')][_0x6e0c('0x84')]==0x1){_0x22f037[_0x6e0c('0x69')](_0x6e0c('0x85'));}else{_0x22f037['having'](_0x6e0c('0x86'));}}if(_0x429f3f[_0x6e0c('0x44')][_0x6e0c('0x87')]){_0x238f23=_[_0x6e0c('0x88')](_0x429f3f['query'][_0x6e0c('0x87')])?_0x429f3f[_0x6e0c('0x44')][_0x6e0c('0x87')]:new Array(_0x429f3f['query'][_0x6e0c('0x87')]);_0x238f23[_0x6e0c('0x3a')](function(_0x4cecd8){_0x12998['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4cecd8+',%');});}if(_0x429f3f[_0x6e0c('0x44')]['filter']){var _0x317aba=_0x429f3f[_0x6e0c('0x44')][_0x6e0c('0x89')][_0x6e0c('0x8a')]('\x5c','\x5c\x5c')[_0x6e0c('0x8a')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x317aba)){_0x21711f['or'](_0x6e0c('0x8b'),_0x317aba+'%')['or'](_0x6e0c('0x8c'),_0x317aba+'%');}else{_0x21711f['or'](_0x6e0c('0x8d'),qs[_0x6e0c('0x6e')](_0x317aba))['or'](_0x6e0c('0x8e'),_0x317aba+'%');}}}_0x22f037[_0x6e0c('0x4d')](_0x21711f);_0x22f037[_0x6e0c('0x8f')](_0x6e0c('0x90'));var _0x43af9a={'type':db[_0x6e0c('0x91')][_0x6e0c('0x92')][_0x6e0c('0x93')],'raw':!![]};var _0x122435=_0x22f037['clone']();_0x122435[_0x6e0c('0x51')]('i.id');_0x122435['field'](_0x6e0c('0x94'),_0x6e0c('0x67'));if(_0xcf8d77[_0x6e0c('0x4b')]){_0xcf8d77[_0x6e0c('0x4b')]['forEach'](function(_0x5512ae){var _0x44b47f=_0x5512ae[0x0]===_0x6e0c('0x95')?_0x5512ae[0x0]:'i.'+_0x5512ae[0x0];_0x22f037[_0x6e0c('0x4b')](_0x44b47f,_0x5512ae[0x1]===_0x6e0c('0x96')?![]:!![]);});}if(!_[_0x6e0c('0x79')](_0x238f23)){_0x22f037['having'](_0x12998);_0x122435['where']('t.id\x20IN\x20?',_0x238f23);}BPromise['resolve']()[_0x6e0c('0x31')](function(){if(!_0x30f690){if(_0x429f3f[_0x6e0c('0x44')]['SmsAccountId'])return;_0x122435[_0x6e0c('0x4d')](_0x6e0c('0x97'));_0x22f037['where'](_0x6e0c('0x97'));return;}if(_0x429f3f[_0x6e0c('0x98')][_0x6e0c('0x99')]!==_0x6e0c('0x9a'))return;return _0x429f3f[_0x6e0c('0x98')][_0x6e0c('0x9b')]({'attributes':['id'],'raw':!![]})['then'](function(_0x12d674){if(_[_0x6e0c('0x79')](_0x12d674)){_0x122435['where']('i.SmsAccountId\x20IS\x20NULL');_0x22f037[_0x6e0c('0x4d')]('i.SmsAccountId\x20IS\x20NULL');}else{_0x122435[_0x6e0c('0x4d')]('i.SmsAccountId\x20IN\x20?',_[_0x6e0c('0x3e')](_0x12d674,'id'));_0x22f037[_0x6e0c('0x4d')]('i.SmsAccountId\x20IN\x20?',_[_0x6e0c('0x3e')](_0x12d674,'id'));}});})[_0x6e0c('0x31')](function(){if(_0x429f3f[_0x6e0c('0x98')][_0x6e0c('0x99')]===_0x6e0c('0x9a')&&!_0x30f690&&!_0x429f3f[_0x6e0c('0x44')]['SmsAccountId'])return[];return db[_0x6e0c('0x9c')][_0x6e0c('0x44')](_0x122435['toString'](),_0x43af9a);})['then'](function(_0x590340){_0x1b2bf1[_0x6e0c('0x2a')]=_0x590340[_0x6e0c('0x49')];if(_0x1b2bf1[_0x6e0c('0x2a')]===0x0)return[];return db[_0x6e0c('0x9c')][_0x6e0c('0x44')](_0x1088f0[_0x6e0c('0x9d')](),_0x43af9a)['then'](function(_0x199929){_0x4d0379=_[_0x6e0c('0x9e')](_0x199929,'id');_0x43af9a=_[_0x6e0c('0x9f')](_0x43af9a,{'model':db[_0x6e0c('0x3f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x429f3f[_0x6e0c('0x44')][_0x6e0c('0x48')]){_0xcf8d77['attributes']['forEach'](function(_0x282edb){_0x22f037[_0x6e0c('0x51')]('i.'+_0x282edb);});}else{_0x22f037[_0x6e0c('0x51')](_0x6e0c('0x94'),_0x6e0c('0x67'));_0x22f037[_0x6e0c('0x51')](_0x6e0c('0xa0'),_0x6e0c('0xa1'));_0x22f037[_0x6e0c('0x51')](_0x6e0c('0xa2'),_0x6e0c('0xa3'));_0x22f037[_0x6e0c('0x51')](_0x6e0c('0xa4'),_0x6e0c('0x95'));_0x22f037[_0x6e0c('0x51')](_0x6e0c('0xa5'));_0x22f037[_0x6e0c('0x51')](_0x6e0c('0xa6'),_0x6e0c('0xa7'));_0x22f037[_0x6e0c('0x51')](_0x6e0c('0xa8'),_0x6e0c('0xa9'));_0x22f037[_0x6e0c('0x51')](_0x6e0c('0xaa'),_0x6e0c('0xab'));_0x22f037['field'](_0x6e0c('0xac'),_0x6e0c('0xad'));_0x22f037[_0x6e0c('0x51')](_0x6e0c('0xae'),_0x6e0c('0xaf'));_0x22f037[_0x6e0c('0x51')](_0x6e0c('0xb0'),_0x6e0c('0xb1'));_0x22f037[_0x6e0c('0x51')](_0x6e0c('0xb2'),'Owner.fullname');_0x22f037[_0x6e0c('0x51')](_0x6e0c('0xb3'),'Owner.internal');_0x22f037['field'](_0x6e0c('0xb4'),_0x6e0c('0x37'));}if(_0xcf8d77[_0x6e0c('0x29')])_0x22f037[_0x6e0c('0x29')](_0xcf8d77[_0x6e0c('0x29')]);if(_0xcf8d77[_0x6e0c('0x27')])_0x22f037[_0x6e0c('0x27')](_0xcf8d77[_0x6e0c('0x27')]);return db['sequelize']['query'](_0x22f037[_0x6e0c('0x9d')](),_0x43af9a);})[_0x6e0c('0x31')](function(_0x56c5ba){if(_0x56c5ba[_0x6e0c('0x49')]>0x0)_0xa00e34[_0x6e0c('0x4d')]('ui.SmsInteractionId\x20IN\x20?',_['map'](_0x56c5ba,'id'));return db[_0x6e0c('0x9c')][_0x6e0c('0x44')](_0xa00e34['toString'](),_0x43af9a)[_0x6e0c('0x31')](function(_0x4239b3){var _0x38f785=_[_0x6e0c('0xb5')](_0x4239b3,_0x6e0c('0xb6'));var _0x1d898d=[];_0x56c5ba[_0x6e0c('0x3a')](function(_0x34b989){_0x1d898d['push'](updateSmsInteraction(_0x34b989,_0x4d0379,_0x38f785));});return BPromise['all'](_0x1d898d);});});})[_0x6e0c('0x31')](function(_0x122715){_0x1b2bf1[_0x6e0c('0xb7')]=_0x122715;return _0x1b2bf1;})[_0x6e0c('0x31')](respondWithFilteredResult(_0x47321f,_0xcf8d77))[_0x6e0c('0x3c')](handleError(_0x47321f,null));};exports[_0x6e0c('0xb8')]=function(_0x587472,_0x12ff57){var _0x388e9d={'raw':![],'where':{'id':_0x587472[_0x6e0c('0xb9')]['id']}},_0x254600={};_0x254600[_0x6e0c('0x43')]=_[_0x6e0c('0x45')](db[_0x6e0c('0x3f')][_0x6e0c('0xba')]);_0x254600['query']=_['keys'](_0x587472[_0x6e0c('0x44')]);_0x254600[_0x6e0c('0x4f')]=_[_0x6e0c('0x46')](_0x254600['model'],_0x254600['query']);_0x388e9d[_0x6e0c('0x47')]=_[_0x6e0c('0x46')](_0x254600[_0x6e0c('0x43')],qs[_0x6e0c('0x48')](_0x587472['query'][_0x6e0c('0x48')]));_0x388e9d[_0x6e0c('0x47')]=_0x388e9d[_0x6e0c('0x47')][_0x6e0c('0x49')]?_0x388e9d[_0x6e0c('0x47')]:_0x254600[_0x6e0c('0x43')];if(_0x587472[_0x6e0c('0x44')][_0x6e0c('0xbb')]){_0x388e9d[_0x6e0c('0xbc')]=[{'all':!![]}];}_0x388e9d=_['merge']({},_0x388e9d,_0x587472[_0x6e0c('0xbd')]);return db[_0x6e0c('0x3f')]['find'](_0x388e9d)['then'](handleEntityNotFound(_0x12ff57,null))[_0x6e0c('0x31')](respondWithResult(_0x12ff57,null))[_0x6e0c('0x3c')](handleError(_0x12ff57,null));};exports[_0x6e0c('0xbe')]=function(_0x48227f,_0x4af23d){return db[_0x6e0c('0x3f')]['create'](_0x48227f[_0x6e0c('0x77')],{})[_0x6e0c('0x31')](respondWithResult(_0x4af23d,0xc9))['catch'](handleError(_0x4af23d,null));};exports[_0x6e0c('0x2f')]=function(_0x526bce,_0x4ea88f){if(_0x526bce[_0x6e0c('0x77')]['id']){delete _0x526bce[_0x6e0c('0x77')]['id'];}return db[_0x6e0c('0x3f')][_0x6e0c('0x66')]({'where':{'id':_0x526bce[_0x6e0c('0xb9')]['id']}})['then'](handleEntityNotFound(_0x4ea88f,null))['then'](saveUpdates(_0x526bce[_0x6e0c('0x77')],null))[_0x6e0c('0x31')](respondWithResult(_0x4ea88f,null))[_0x6e0c('0x3c')](handleError(_0x4ea88f,null));};exports[_0x6e0c('0x30')]=function(_0x2221f0,_0x283d95){return db['SmsInteraction'][_0x6e0c('0x66')]({'where':{'id':_0x2221f0[_0x6e0c('0xb9')]['id']}})[_0x6e0c('0x31')](handleEntityNotFound(_0x283d95,null))[_0x6e0c('0x31')](removeEntity(_0x283d95,null))[_0x6e0c('0x3c')](handleError(_0x283d95,null));};exports['describe']=function(_0x5d62af,_0x1060a0){return db[_0x6e0c('0x3f')][_0x6e0c('0xbf')]()[_0x6e0c('0x31')](respondWithResult(_0x1060a0,null))[_0x6e0c('0x3c')](handleError(_0x1060a0,null));};exports['addMessage']=function(_0x4b596d,_0xf6f3bc,_0x51aa2b){return db[_0x6e0c('0xc0')][_0x6e0c('0x66')]({'where':{'id':_0x4b596d[_0x6e0c('0xb9')]['id']}})['then'](handleEntityNotFound(_0xf6f3bc,null))[_0x6e0c('0x31')](function(_0x2e99d4){if(_0x2e99d4){return _0x2e99d4[_0x6e0c('0xc1')](_0x4b596d['body'][_0x6e0c('0xc2')],_[_0x6e0c('0xc3')](_0x4b596d[_0x6e0c('0x77')],[_0x6e0c('0xc2'),'id'])||{});}})[_0x6e0c('0x31')](respondWithResult(_0xf6f3bc,null))['catch'](handleError(_0xf6f3bc,null));};exports['getMessages']=function(_0x117e78,_0x5e5b50,_0x36a872){var _0x5e333e={'raw':![],'where':{}};var _0x1c76ae={};var _0x5a18a7={'count':0x0,'rows':[]};return db['SmsInteraction'][_0x6e0c('0xc4')]({'where':{'id':_0x117e78['params']['id']}})[_0x6e0c('0x31')](handleEntityNotFound(_0x5e5b50,null))[_0x6e0c('0x31')](function(_0x2e9de3){if(_0x2e9de3){_0x1c76ae['model']=_[_0x6e0c('0x45')](db[_0x6e0c('0xc0')][_0x6e0c('0xba')]);_0x1c76ae['query']=_[_0x6e0c('0x45')](_0x117e78[_0x6e0c('0x44')]);_0x1c76ae[_0x6e0c('0x4f')]=_[_0x6e0c('0x46')](_0x1c76ae['model'],_0x1c76ae['query']);_0x5e333e['attributes']=_[_0x6e0c('0x46')](_0x1c76ae['model'],qs[_0x6e0c('0x48')](_0x117e78[_0x6e0c('0x44')][_0x6e0c('0x48')]));_0x5e333e[_0x6e0c('0x47')]=_0x5e333e[_0x6e0c('0x47')]['length']?_0x5e333e['attributes']:_0x1c76ae[_0x6e0c('0x43')];if(!_0x117e78[_0x6e0c('0x44')][_0x6e0c('0xc5')](_0x6e0c('0x4a'))){_0x5e333e['limit']=qs[_0x6e0c('0x29')](_0x117e78['query']['limit']);_0x5e333e[_0x6e0c('0x27')]=qs['offset'](_0x117e78['query'][_0x6e0c('0x27')]);}_0x5e333e[_0x6e0c('0x4b')]=qs[_0x6e0c('0x4c')](_0x117e78[_0x6e0c('0x44')][_0x6e0c('0x4c')]);_0x5e333e[_0x6e0c('0x4d')]=qs[_0x6e0c('0x4f')](_[_0x6e0c('0x4e')](_0x117e78[_0x6e0c('0x44')],_0x1c76ae[_0x6e0c('0x4f')]));_0x5e333e['where'][_0x6e0c('0xb6')]=_0x2e9de3['id'];if(_0x117e78[_0x6e0c('0x44')][_0x6e0c('0x89')]){_0x5e333e['where']=_['merge'](_0x5e333e[_0x6e0c('0x4d')],{'$or':_['map'](_0x5e333e[_0x6e0c('0x47')],function(_0x3e6dc0){var _0x16dc13={};_0x16dc13[_0x3e6dc0]={'$like':'%'+_0x117e78['query'][_0x6e0c('0x89')]+'%'};return _0x16dc13;})});}if(_0x117e78[_0x6e0c('0x44')][_0x6e0c('0x7f')]){var _0x28250d=_0x117e78['query'][_0x6e0c('0x7f')][_0x6e0c('0x39')](',');var _0x217787={};_0x217787[_0x28250d[0x0]]={'$gte':moment(_0x28250d[0x1])[_0x6e0c('0xc6')](_0x6e0c('0xc7'))};_0x5e333e[_0x6e0c('0x4d')]=_[_0x6e0c('0x9f')](_0x5e333e['where'],_0x217787);}_0x5e333e=_[_0x6e0c('0x9f')]({},_0x5e333e,_0x117e78[_0x6e0c('0xbd')]);return db[_0x6e0c('0xc0')]['count']({'where':_0x5e333e[_0x6e0c('0x4d')]})[_0x6e0c('0x31')](function(_0x5af2de){_0x5a18a7['count']=_0x5af2de;if(_0x117e78[_0x6e0c('0x44')]['includeAll']){_0x5e333e[_0x6e0c('0xbc')]=[{'all':!![]}];}return db[_0x6e0c('0xc0')][_0x6e0c('0xc8')](_0x5e333e);})[_0x6e0c('0x31')](function(_0x3728ba){_0x5a18a7[_0x6e0c('0xb7')]=_0x3728ba;return _0x5a18a7;});}})[_0x6e0c('0x31')](respondWithFilteredResult(_0x5e5b50,_0x5e333e))[_0x6e0c('0x3c')](handleError(_0x5e5b50,null));};exports[_0x6e0c('0xc9')]=function(_0x261381,_0x22ef29,_0x1e50c9){return db[_0x6e0c('0x3f')][_0x6e0c('0x66')]({'where':{'id':_0x261381['params']['id']}})['then'](handleEntityNotFound(_0x22ef29,null))[_0x6e0c('0x31')](function(_0x2d2586){if(_0x2d2586){return _0x2d2586[_0x6e0c('0xca')](_0x261381[_0x6e0c('0x77')][_0x6e0c('0xc2')],_[_0x6e0c('0xc3')](_0x261381[_0x6e0c('0x77')],[_0x6e0c('0xc2'),'id'])||{})['spread'](function(){return db[_0x6e0c('0x72')]['findAll']({'attributes':['id',_0x6e0c('0x34'),_0x6e0c('0x52')],'where':{'id':_0x261381['body'][_0x6e0c('0xc2')]}});})[_0x6e0c('0x31')](function(_0x40a1f7){socket[_0x6e0c('0xcb')]('smsInteractionTags:save',{'id':Number(_0x261381[_0x6e0c('0xb9')]['id']),'tags':_0x40a1f7||[]});return{'id':Number(_0x261381[_0x6e0c('0xb9')]['id']),'tags':_0x40a1f7||[]};});}})[_0x6e0c('0x31')](respondWithResult(_0x22ef29,null))[_0x6e0c('0x3c')](handleError(_0x22ef29,null));};exports[_0x6e0c('0xcc')]=function(_0x20ede0,_0x2266fe,_0x5cbb79){return db['SmsInteraction'][_0x6e0c('0x66')]({'where':{'id':_0x20ede0[_0x6e0c('0xb9')]['id']}})[_0x6e0c('0x31')](handleEntityNotFound(_0x2266fe,null))[_0x6e0c('0x31')](function(_0x224238){if(_0x224238){return _0x224238[_0x6e0c('0xcc')](_0x20ede0['query'][_0x6e0c('0xc2')]);}})[_0x6e0c('0x31')](respondWithStatusCode(_0x2266fe,null))['catch'](handleError(_0x2266fe,null));};exports[_0x6e0c('0xcd')]=function(_0x210d05,_0x3ca3aa){var _0x53d3ec=moment()[_0x6e0c('0xce')]()[_0x6e0c('0x9d')]();var _0xbaec77=path[_0x6e0c('0xcf')](config[_0x6e0c('0xd0')],_0x6e0c('0xd1'),'files',_0x6e0c('0xd2'));var _0x2c40b2=path['join'](config[_0x6e0c('0xd0')],'server',_0x6e0c('0xd3'),_0x6e0c('0xd4'));var _0x975455=path['join'](_0xbaec77,_0x53d3ec);var _0x1aa0a3=util[_0x6e0c('0xc6')](_0x6e0c('0xd5'),_0x210d05[_0x6e0c('0xb9')]['id'],_0x53d3ec);var _0x356f19=path[_0x6e0c('0xcf')](_0xbaec77,_0x1aa0a3);var _0x3d1878=[];_0x3d1878[_0x6e0c('0x3b')]({'model':db[_0x6e0c('0x74')],'as':'User','attributes':['id',_0x6e0c('0x36')],'raw':!![]});_0x3d1878[_0x6e0c('0x3b')]({'model':db[_0x6e0c('0xd6')],'as':_0x6e0c('0xd7'),'attributes':['id',_0x6e0c('0xd8'),_0x6e0c('0xd9')],'raw':!![]});var _0x1bb2b8=[{'model':db[_0x6e0c('0xc0')],'as':'Messages','attributes':['id',_0x6e0c('0x77'),'createdAt',_0x6e0c('0xda'),_0x6e0c('0xdb'),_0x6e0c('0x84')],'include':_0x3d1878}];_0x1bb2b8['push']({'model':db['SmsAccount'],'as':_0x6e0c('0xdc'),'attributes':['id',_0x6e0c('0x34')]});_0x1bb2b8[_0x6e0c('0x3b')]({'model':db[_0x6e0c('0x74')],'as':_0x6e0c('0xdd'),'attributes':['id',_0x6e0c('0x36')]});return db[_0x6e0c('0x3f')][_0x6e0c('0x66')]({'where':{'id':_0x210d05[_0x6e0c('0xb9')]['id']},'include':_0x1bb2b8})[_0x6e0c('0x31')](handleEntityNotFound(_0x3ca3aa,null))[_0x6e0c('0x31')](function(_0x31bd3a){if(_0x31bd3a){var _0x3f45ff=_0x31bd3a[_0x6e0c('0xde')]({'plain':!![]});fs['mkdirSync'](_0x975455);var _0x45bf48={'channel':'Sms','account':_0x3f45ff[_0x6e0c('0xdc')][_0x6e0c('0x34')],'agent':_0x3f45ff[_0x6e0c('0xdd')]?_0x3f45ff[_0x6e0c('0xdd')][_0x6e0c('0x36')]:_0x6e0c('0xdf'),'createdAt':moment(_0x3f45ff['createdAt'])[_0x6e0c('0xc6')](_0x6e0c('0xc7'))[_0x6e0c('0x9d')](),'closedAt':_0x3f45ff['closed']?moment(_0x3f45ff[_0x6e0c('0xe0')])['format'](_0x6e0c('0xc7'))['toString']():'','disposition':_0x3f45ff[_0x6e0c('0xe1')],'messages':_(_0x3f45ff['Messages'])['filter']({'secret':![]})[_0x6e0c('0x3e')](function(_0x2bbd03){return{'date':moment(_0x2bbd03[_0x6e0c('0x7d')])[_0x6e0c('0xc6')](_0x6e0c('0xc7'))[_0x6e0c('0x9d')](),'sender':_0x2bbd03[_0x6e0c('0xda')]===_0x6e0c('0xe2')?_0x2bbd03[_0x6e0c('0x74')]?_0x2bbd03['User'][_0x6e0c('0x36')]:_0x6e0c('0xe3'):_0x2bbd03['Contact'][_0x6e0c('0xd8')]+(_0x2bbd03[_0x6e0c('0xd7')][_0x6e0c('0xd9')]?'\x20'+_0x2bbd03[_0x6e0c('0xd7')][_0x6e0c('0xd9')]:''),'body':_0x2bbd03[_0x6e0c('0x77')],'direction':_0x2bbd03[_0x6e0c('0xda')]===_0x6e0c('0xe2')?'A':'C','secret':_0x2bbd03[_0x6e0c('0xdb')],'read':_0x2bbd03[_0x6e0c('0x84')]};})[_0x6e0c('0x68')]()};return ejs[_0x6e0c('0xe4')](path[_0x6e0c('0xcf')](config[_0x6e0c('0xd0')],_0x6e0c('0xd1'),'views','downloadInteraction.ejs'),{'interaction':_0x45bf48})[_0x6e0c('0x31')](function(_0x2c7d35){var _0x4e47e9=path[_0x6e0c('0xcf')](_0x975455,_0x6e0c('0xe5')+_0x3f45ff['id']+'-'+_0x53d3ec+_0x6e0c('0xe6'));var _0x272c53={'path':_0x4e47e9,'channel':_0x6e0c('0xe7'),'interactionId':_0x3f45ff['id']};return pdf[_0x6e0c('0xe8')](_0x2c7d35,_0x272c53);})[_0x6e0c('0x31')](function(){return new BPromise(function(_0x2c84db,_0x5d12a7){zipdir(_0x975455,{'saveTo':_0x356f19},function(_0x4335e2,_0x9c673c){if(_0x4335e2)return _0x5d12a7(_0x4335e2);return _0x2c84db(_0x9c673c);});})['then'](function(){return new BPromise(function(_0x560750,_0xec7f7e){rimraf(_0x975455,function(_0x34692d){if(_0x34692d)_0xec7f7e(_0x34692d);return _0x560750();});});})[_0x6e0c('0x31')](function(){return _0x3ca3aa[_0x6e0c('0xcd')](_0x356f19,_0x1aa0a3,function(_0x1f8451){if(_0x1f8451){console[_0x6e0c('0xe9')](_0x6e0c('0xea'),_0x1f8451);}else{fs[_0x6e0c('0xeb')](_0x356f19);}});});});}else{return _0x3ca3aa['sendStatus'](0xc8);}})[_0x6e0c('0x3c')](handleError(_0x3ca3aa,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 3b83981..f2fb9fd 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 _0xcf66=['setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','remove','getUsers'];(function(_0x258919,_0x1754e6){var _0xfbd68b=function(_0x3bc3e9){while(--_0x3bc3e9){_0x258919['push'](_0x258919['shift']());}};_0xfbd68b(++_0x1754e6);}(_0xcf66,0x71));var _0x6cf6=function(_0x25efba,_0x2e202a){_0x25efba=_0x25efba-0x0;var _0x2e94ed=_0xcf66[_0x25efba];return _0x2e94ed;};'use strict';var EventEmitter=require(_0x6cf6('0x0'));var SmsInteraction=require(_0x6cf6('0x1'))['db'][_0x6cf6('0x2')];var SmsMessage=require('../../mysqldb')['db'][_0x6cf6('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x6cf6('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x6cf6('0x5')};function emitEvent(_0x45d0d8){return function(_0x57f22f,_0x39f1d6,_0x1fbedd){_0x57f22f[_0x6cf6('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x94c6a9){_0x57f22f[_0x6cf6('0x7')](_0x6cf6('0x8'),_0x94c6a9[_0x6cf6('0x9')](function(_0x175b18){return{'id':_0x175b18['id']};}));return SmsMessage[_0x6cf6('0xa')]({'where':{'SmsInteractionId':_0x57f22f['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x58378c){_0x57f22f['setDataValue'](_0x6cf6('0xb'),_0x58378c['length']);SmsInteractionEvents[_0x6cf6('0xc')](_0x45d0d8+':'+_0x57f22f['id'],_0x57f22f);SmsInteractionEvents[_0x6cf6('0xc')](_0x45d0d8,_0x57f22f);_0x1fbedd(null);})[_0x6cf6('0xd')](_0x1fbedd(null));};}for(var e in events){if(events[_0x6cf6('0xe')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0x0120=['hasOwnProperty','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','setDataValue','Users','map','then','unreadMessages','emit','catch'];(function(_0x257b0e,_0x563d7e){var _0x27ac2a=function(_0x3a4bbc){while(--_0x3a4bbc){_0x257b0e['push'](_0x257b0e['shift']());}};_0x27ac2a(++_0x563d7e);}(_0x0120,0x6f));var _0x0012=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x0120[_0x6c993a];return _0x27f547;};'use strict';var EventEmitter=require(_0x0012('0x0'));var SmsInteraction=require(_0x0012('0x1'))['db'][_0x0012('0x2')];var SmsMessage=require(_0x0012('0x1'))['db'][_0x0012('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x0012('0x4')](0x0);var events={'afterCreate':_0x0012('0x5'),'afterUpdate':_0x0012('0x6'),'afterDestroy':_0x0012('0x7')};function emitEvent(_0x302029){return function(_0x3505ab,_0x3fcfbc,_0x4eaa5b){_0x3505ab['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x95d441){_0x3505ab[_0x0012('0x8')](_0x0012('0x9'),_0x95d441[_0x0012('0xa')](function(_0x33c82f){return{'id':_0x33c82f['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x3505ab['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0012('0xb')](function(_0x2d484c){_0x3505ab[_0x0012('0x8')](_0x0012('0xc'),_0x2d484c['length']);SmsInteractionEvents[_0x0012('0xd')](_0x302029+':'+_0x3505ab['id'],_0x3505ab);SmsInteractionEvents['emit'](_0x302029,_0x3505ab);_0x4eaa5b(null);})[_0x0012('0xe')](_0x4eaa5b(null));};}for(var e in events){if(events[_0x0012('0xf')](e)){var event=events[e];SmsInteraction[_0x0012('0x10')](e,emitEvent(event));}}module[_0x0012('0x11')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 882b566..b1faa71 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 _0x4fb4=['rimraf','../../config/environment','./smsInteraction.attributes','define','changed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x1b6c0c,_0x51ef20){var _0x178991=function(_0x3b6f64){while(--_0x3b6f64){_0x1b6c0c['push'](_0x1b6c0c['shift']());}};_0x178991(++_0x51ef20);}(_0x4fb4,0xd9));var _0x44fb=function(_0x16d73d,_0x3c9515){_0x16d73d=_0x16d73d-0x0;var _0xc415ac=_0x4fb4[_0x16d73d];return _0xc415ac;};'use strict';var _=require(_0x44fb('0x0'));var util=require(_0x44fb('0x1'));var logger=require(_0x44fb('0x2'))(_0x44fb('0x3'));var moment=require(_0x44fb('0x4'));var BPromise=require('bluebird');var rp=require(_0x44fb('0x5'));var fs=require('fs');var path=require(_0x44fb('0x6'));var rimraf=require(_0x44fb('0x7'));var config=require(_0x44fb('0x8'));var attributes=require(_0x44fb('0x9'));module['exports']=function(_0x1ed6d2,_0x90f0ca){return _0x1ed6d2[_0x44fb('0xa')]('SmsInteraction',attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x301366,_0x487e73,_0x41bd9f){if(_0x301366[_0x44fb('0xb')]('closed')){_0x301366['closedAt']=moment()[_0x44fb('0xc')](_0x44fb('0xd'));}_0x41bd9f(null,_0x301366);}}});}; \ No newline at end of file +var _0x570f=['api','bluebird','request-promise','path','./smsInteraction.attributes','exports','SmsInteraction','sms_interactions','changed','closed','closedAt','lodash','../../config/logger'];(function(_0x52712a,_0x4cf13c){var _0x35b3ef=function(_0x2b06a5){while(--_0x2b06a5){_0x52712a['push'](_0x52712a['shift']());}};_0x35b3ef(++_0x4cf13c);}(_0x570f,0x1ec));var _0xf570=function(_0x15ee41,_0x9275d8){_0x15ee41=_0x15ee41-0x0;var _0x2b2846=_0x570f[_0x15ee41];return _0x2b2846;};'use strict';var _=require(_0xf570('0x0'));var util=require('util');var logger=require(_0xf570('0x1'))(_0xf570('0x2'));var moment=require('moment');var BPromise=require(_0xf570('0x3'));var rp=require(_0xf570('0x4'));var fs=require('fs');var path=require(_0xf570('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf570('0x6'));module[_0xf570('0x7')]=function(_0x3f3b0e,_0x34b2af){return _0x3f3b0e['define'](_0xf570('0x8'),attributes,{'tableName':_0xf570('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3bcb08,_0x4e40d0,_0xb88f12){if(_0x3bcb08[_0xf570('0xa')](_0xf570('0xb'))){_0x3bcb08[_0xf570('0xc')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0xb88f12(null,_0x3bcb08);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 42549c0..7906d55 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 _0x615a=['update','body','raw','options','where','attributes','limit','AddTagsToSmsInteraction','find','omit','ids','spread','AddTags','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','./smsInteraction.socket','request','then','info','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','SmsInteraction,\x20%s,\x20%s','result','catch','UpdateSmsInteraction','SmsInteraction'];(function(_0x19b62c,_0x2b3d71){var _0x5045f8=function(_0x4b46de){while(--_0x4b46de){_0x19b62c['push'](_0x19b62c['shift']());}};_0x5045f8(++_0x2b3d71);}(_0x615a,0x12c));var _0xa615=function(_0x1a6007,_0x350755){_0x1a6007=_0x1a6007-0x0;var _0x120665=_0x615a[_0x1a6007];return _0x120665;};'use strict';var _=require('lodash');var util=require(_0xa615('0x0'));var moment=require(_0xa615('0x1'));var BPromise=require('bluebird');var rs=require(_0xa615('0x2'));var fs=require('fs');var Redis=require(_0xa615('0x3'));var db=require(_0xa615('0x4'))['db'];var utils=require(_0xa615('0x5'));var logger=require(_0xa615('0x6'))(_0xa615('0x7'));var config=require(_0xa615('0x8'));var jayson=require(_0xa615('0x9'));var client=jayson['client'][_0xa615('0xa')]({'port':0x232a});config[_0xa615('0xb')]=_[_0xa615('0xc')](config[_0xa615('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa615('0xb')]));require(_0xa615('0xd'))['register'](socket);function respondWithRpcPromise(_0x5492a2,_0x5d970b,_0x3e184e){return new BPromise(function(_0x6ee8cb,_0x39baa7){return client[_0xa615('0xe')](_0x5492a2,_0x3e184e)[_0xa615('0xf')](function(_0x2f6061){logger[_0xa615('0x10')]('SmsInteraction,\x20%s,\x20%s',_0x5d970b,_0xa615('0x11'));logger[_0xa615('0x12')](_0xa615('0x13'),_0x5d970b,_0xa615('0x11'),JSON[_0xa615('0x14')](_0x2f6061));if(_0x2f6061['error']){if(_0x2f6061[_0xa615('0x15')]['code']===0x1f4){logger[_0xa615('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x5d970b,_0x2f6061['error'][_0xa615('0x16')]);return _0x39baa7(_0x2f6061[_0xa615('0x15')][_0xa615('0x16')]);}logger[_0xa615('0x15')](_0xa615('0x17'),_0x5d970b,_0x2f6061[_0xa615('0x15')][_0xa615('0x16')]);return _0x6ee8cb(_0x2f6061[_0xa615('0x15')][_0xa615('0x16')]);}else{logger[_0xa615('0x10')]('SmsInteraction,\x20%s,\x20%s',_0x5d970b,_0xa615('0x11'));_0x6ee8cb(_0x2f6061[_0xa615('0x18')]['message']);}})[_0xa615('0x19')](function(_0x3899c0){logger[_0xa615('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x5d970b,_0x3899c0);_0x39baa7(_0x3899c0);});});}exports[_0xa615('0x1a')]=function(_0x26bd4e){var _0x147663=this;return new Promise(function(_0x1f8158,_0x7888c5){return db[_0xa615('0x1b')][_0xa615('0x1c')](_0x26bd4e[_0xa615('0x1d')],{'raw':_0x26bd4e['options']?_0x26bd4e['options'][_0xa615('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26bd4e[_0xa615('0x1f')]?_0x26bd4e[_0xa615('0x1f')][_0xa615('0x20')]||null:null,'attributes':_0x26bd4e[_0xa615('0x1f')]?_0x26bd4e[_0xa615('0x1f')][_0xa615('0x21')]||null:null,'limit':_0x26bd4e['options']?_0x26bd4e[_0xa615('0x1f')][_0xa615('0x22')]||null:null})[_0xa615('0xf')](function(_0x3a3043){logger[_0xa615('0x10')](_0xa615('0x1a'),_0x26bd4e);logger['debug'](_0xa615('0x1a'),_0x26bd4e,JSON[_0xa615('0x14')](_0x3a3043));_0x1f8158(_0x3a3043);})[_0xa615('0x19')](function(_0x2be326){logger[_0xa615('0x15')](_0xa615('0x1a'),_0x2be326['message'],_0x26bd4e);_0x7888c5(_0x147663[_0xa615('0x15')](0x1f4,_0x2be326[_0xa615('0x16')]));});});};exports[_0xa615('0x23')]=function(_0x5c012f){return new Promise(function(_0x3f2bd3,_0x2a8057){return db[_0xa615('0x1b')][_0xa615('0x24')]({'where':_0x5c012f[_0xa615('0x1f')]?_0x5c012f[_0xa615('0x1f')][_0xa615('0x20')]||null:null})['then'](function(_0x5d7f81){if(_0x5d7f81){return _0x5d7f81['addTags'](_0x5c012f[_0xa615('0x1d')]['ids'],_[_0xa615('0x25')](_0x5c012f[_0xa615('0x1d')],[_0xa615('0x26'),'id'])||{});}})[_0xa615('0x27')](function(_0x2b7530){logger[_0xa615('0x10')]('AddTags',_0x5c012f);logger[_0xa615('0x12')](_0xa615('0x28'),_0x5c012f,JSON[_0xa615('0x14')](_0x2b7530));_0x3f2bd3(_0x2b7530);})[_0xa615('0x19')](function(_0x19946b){logger[_0xa615('0x15')](_0xa615('0x28'),_0x19946b[_0xa615('0x16')],_0x5c012f);_0x2a8057(_this['error'](0x1f4,_0x19946b['message']));});});}; \ No newline at end of file +var _0x5b7d=['jayson/promise','client','redis','localhost','socket.io-emitter','register','request','then','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','message','SmsInteraction,\x20%s,\x20%s','info','result','catch','UpdateSmsInteraction','SmsInteraction','update','options','raw','attributes','limit','stringify','AddTagsToSmsInteraction','find','where','addTags','body','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x5a07ab,_0xddde9c){var _0x3e59f4=function(_0x24b06c){while(--_0x24b06c){_0x5a07ab['push'](_0x5a07ab['shift']());}};_0x3e59f4(++_0xddde9c);}(_0x5b7d,0x124));var _0xd5b7=function(_0x2b32a4,_0x2ee2dd){_0x2b32a4=_0x2b32a4-0x0;var _0x11380c=_0x5b7d[_0x2b32a4];return _0x11380c;};'use strict';var _=require(_0xd5b7('0x0'));var util=require(_0xd5b7('0x1'));var moment=require(_0xd5b7('0x2'));var BPromise=require(_0xd5b7('0x3'));var rs=require(_0xd5b7('0x4'));var fs=require('fs');var Redis=require(_0xd5b7('0x5'));var db=require(_0xd5b7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd5b7('0x7'))('rpc');var config=require(_0xd5b7('0x8'));var jayson=require(_0xd5b7('0x9'));var client=jayson[_0xd5b7('0xa')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xd5b7('0xb')],{'host':_0xd5b7('0xc'),'port':0x18eb});var socket=require(_0xd5b7('0xd'))(new Redis(config[_0xd5b7('0xb')]));require('./smsInteraction.socket')[_0xd5b7('0xe')](socket);function respondWithRpcPromise(_0x596c7e,_0x26199a,_0x5604bf){return new BPromise(function(_0x32387a,_0x58061e){return client[_0xd5b7('0xf')](_0x596c7e,_0x5604bf)[_0xd5b7('0x10')](function(_0x1f22f7){logger['info']('SmsInteraction,\x20%s,\x20%s',_0x26199a,_0xd5b7('0x11'));logger[_0xd5b7('0x12')](_0xd5b7('0x13'),_0x26199a,_0xd5b7('0x11'),JSON['stringify'](_0x1f22f7));if(_0x1f22f7[_0xd5b7('0x14')]){if(_0x1f22f7[_0xd5b7('0x14')][_0xd5b7('0x15')]===0x1f4){logger['error']('SmsInteraction,\x20%s,\x20%s',_0x26199a,_0x1f22f7[_0xd5b7('0x14')][_0xd5b7('0x16')]);return _0x58061e(_0x1f22f7[_0xd5b7('0x14')][_0xd5b7('0x16')]);}logger[_0xd5b7('0x14')](_0xd5b7('0x17'),_0x26199a,_0x1f22f7['error'][_0xd5b7('0x16')]);return _0x32387a(_0x1f22f7[_0xd5b7('0x14')][_0xd5b7('0x16')]);}else{logger[_0xd5b7('0x18')](_0xd5b7('0x17'),_0x26199a,'request\x20sent');_0x32387a(_0x1f22f7[_0xd5b7('0x19')][_0xd5b7('0x16')]);}})[_0xd5b7('0x1a')](function(_0xa3056){logger[_0xd5b7('0x14')](_0xd5b7('0x17'),_0x26199a,_0xa3056);_0x58061e(_0xa3056);});});}exports[_0xd5b7('0x1b')]=function(_0x2e277d){var _0x1eaa89=this;return new Promise(function(_0x3b2ba2,_0x5bb129){return db[_0xd5b7('0x1c')][_0xd5b7('0x1d')](_0x2e277d['body'],{'raw':_0x2e277d[_0xd5b7('0x1e')]?_0x2e277d[_0xd5b7('0x1e')][_0xd5b7('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e277d[_0xd5b7('0x1e')]?_0x2e277d[_0xd5b7('0x1e')]['where']||null:null,'attributes':_0x2e277d[_0xd5b7('0x1e')]?_0x2e277d[_0xd5b7('0x1e')][_0xd5b7('0x20')]||null:null,'limit':_0x2e277d[_0xd5b7('0x1e')]?_0x2e277d[_0xd5b7('0x1e')][_0xd5b7('0x21')]||null:null})[_0xd5b7('0x10')](function(_0x1909e6){logger['info'](_0xd5b7('0x1b'),_0x2e277d);logger[_0xd5b7('0x12')](_0xd5b7('0x1b'),_0x2e277d,JSON[_0xd5b7('0x22')](_0x1909e6));_0x3b2ba2(_0x1909e6);})[_0xd5b7('0x1a')](function(_0x44237d){logger['error']('UpdateSmsInteraction',_0x44237d[_0xd5b7('0x16')],_0x2e277d);_0x5bb129(_0x1eaa89[_0xd5b7('0x14')](0x1f4,_0x44237d['message']));});});};exports[_0xd5b7('0x23')]=function(_0x2217f2){return new Promise(function(_0x41287f,_0x302e4a){return db['SmsInteraction'][_0xd5b7('0x24')]({'where':_0x2217f2['options']?_0x2217f2[_0xd5b7('0x1e')][_0xd5b7('0x25')]||null:null})[_0xd5b7('0x10')](function(_0x89ff76){if(_0x89ff76){return _0x89ff76[_0xd5b7('0x26')](_0x2217f2[_0xd5b7('0x27')]['ids'],_[_0xd5b7('0x28')](_0x2217f2['body'],['ids','id'])||{});}})[_0xd5b7('0x29')](function(_0x5df528){logger[_0xd5b7('0x18')](_0xd5b7('0x2a'),_0x2217f2);logger[_0xd5b7('0x12')](_0xd5b7('0x2a'),_0x2217f2,JSON[_0xd5b7('0x22')](_0x5df528));_0x41287f(_0x5df528);})['catch'](function(_0x1e4756){logger[_0xd5b7('0x14')](_0xd5b7('0x2a'),_0x1e4756[_0xd5b7('0x16')],_0x2217f2);_0x302e4a(_this[_0xd5b7('0x14')](0x1f4,_0x1e4756[_0xd5b7('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 2b18475..98ea787 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 _0xbf88=['length','smsInteraction:','./smsInteraction.events','save','remove','update','emit','register'];(function(_0x20eb01,_0x59ae21){var _0x5c5e37=function(_0x26c0be){while(--_0x26c0be){_0x20eb01['push'](_0x20eb01['shift']());}};_0x5c5e37(++_0x59ae21);}(_0xbf88,0x192));var _0x8bf8=function(_0x521362,_0x3af604){_0x521362=_0x521362-0x0;var _0x4520b7=_0xbf88[_0x521362];return _0x4520b7;};'use strict';var SmsInteractionEvents=require(_0x8bf8('0x0'));var events=[_0x8bf8('0x1'),_0x8bf8('0x2'),_0x8bf8('0x3')];function createListener(_0x1f7bf4,_0x4032c1){return function(_0x4a26cd){_0x4032c1[_0x8bf8('0x4')](_0x1f7bf4,_0x4a26cd);};}function removeListener(_0xc2e997,_0x847b10){return function(){SmsInteractionEvents['removeListener'](_0xc2e997,_0x847b10);};}exports[_0x8bf8('0x5')]=function(_0x5e44c1){for(var _0x3d7b8d=0x0,_0x324ee9=events[_0x8bf8('0x6')];_0x3d7b8d<_0x324ee9;_0x3d7b8d++){var _0x21151b=events[_0x3d7b8d];var _0x42b173=createListener(_0x8bf8('0x7')+_0x21151b,_0x5e44c1);SmsInteractionEvents['on'](_0x21151b,_0x42b173);}}; \ No newline at end of file +var _0xdab6=['removeListener','register','length','smsInteraction:','save','remove','emit'];(function(_0x1e393b,_0x355f6b){var _0x3d0bfe=function(_0x320830){while(--_0x320830){_0x1e393b['push'](_0x1e393b['shift']());}};_0x3d0bfe(++_0x355f6b);}(_0xdab6,0xe4));var _0x6dab=function(_0x48cbfa,_0x80864){_0x48cbfa=_0x48cbfa-0x0;var _0x1cea43=_0xdab6[_0x48cbfa];return _0x1cea43;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x6dab('0x0'),_0x6dab('0x1'),'update'];function createListener(_0x564bab,_0x3dae46){return function(_0x2d09ea){_0x3dae46[_0x6dab('0x2')](_0x564bab,_0x2d09ea);};}function removeListener(_0x17294c,_0x416150){return function(){SmsInteractionEvents[_0x6dab('0x3')](_0x17294c,_0x416150);};}exports[_0x6dab('0x4')]=function(_0x2f3d9f){for(var _0x1eb2f6=0x0,_0x118186=events[_0x6dab('0x5')];_0x1eb2f6<_0x118186;_0x1eb2f6++){var _0x11d485=events[_0x1eb2f6];var _0x2b0583=createListener(_0x6dab('0x6')+_0x11d485,_0x2f3d9f);SmsInteractionEvents['on'](_0x11d485,_0x2b0583);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index c7f39f9..38e16b4 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 _0x9e42=['tracked','create','/:id/status','status','put','/:id/accept','delete','destroy','exports','util','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x3a3c17,_0x5b7b7e){var _0xd07f21=function(_0xeaad44){while(--_0xeaad44){_0x3a3c17['push'](_0x3a3c17['shift']());}};_0xd07f21(++_0x5b7b7e);}(_0x9e42,0x169));var _0x29e4=function(_0x2b31a8,_0x28b862){_0x2b31a8=_0x2b31a8-0x0;var _0x1175a5=_0x9e42[_0x2b31a8];return _0x1175a5;};'use strict';var multer=require('multer');var util=require(_0x29e4('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x29e4('0x1'));var router=express[_0x29e4('0x2')]();var fs_extra=require(_0x29e4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x29e4('0x4'));var config=require('../../config/environment');var controller=require('./smsMessage.controller');router[_0x29e4('0x5')]('/',auth[_0x29e4('0x6')](),controller[_0x29e4('0x7')]);router[_0x29e4('0x5')](_0x29e4('0x8'),auth[_0x29e4('0x6')](),controller[_0x29e4('0x9')]);router[_0x29e4('0x5')](_0x29e4('0xa'),auth[_0x29e4('0x6')](),controller[_0x29e4('0xb')]);router[_0x29e4('0xc')]('/',auth[_0x29e4('0x6')](),interaction[_0x29e4('0xd')]('sms','smsmessage:create'),controller[_0x29e4('0xe')]);router[_0x29e4('0xc')](_0x29e4('0xf'),controller[_0x29e4('0x10')]);router[_0x29e4('0x11')](_0x29e4('0xa'),auth[_0x29e4('0x6')](),controller['update']);router[_0x29e4('0x11')](_0x29e4('0x12'),auth[_0x29e4('0x6')](),controller['accept']);router[_0x29e4('0x11')]('/:id/reject',auth[_0x29e4('0x6')](),controller['reject']);router[_0x29e4('0x13')](_0x29e4('0xa'),auth[_0x29e4('0x6')](),controller[_0x29e4('0x14')]);module[_0x29e4('0x15')]=router; \ No newline at end of file +var _0xe8ae=['sms','create','post','/:id/status','update','put','/:id/accept','accept','/:id','destroy','path','connect-timeout','express','Router','fs-extra','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','show','tracked'];(function(_0x313806,_0x3deffe){var _0x19dc96=function(_0x231879){while(--_0x231879){_0x313806['push'](_0x313806['shift']());}};_0x19dc96(++_0x3deffe);}(_0xe8ae,0x163));var _0xee8a=function(_0x3bc393,_0x3869a8){_0x3bc393=_0x3bc393-0x0;var _0x14f745=_0xe8ae[_0x3bc393];return _0x14f745;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xee8a('0x0'));var timeout=require(_0xee8a('0x1'));var express=require(_0xee8a('0x2'));var router=express[_0xee8a('0x3')]();var fs_extra=require(_0xee8a('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xee8a('0x5'));router[_0xee8a('0x6')]('/',auth[_0xee8a('0x7')](),controller[_0xee8a('0x8')]);router[_0xee8a('0x6')](_0xee8a('0x9'),auth['isAuthenticated'](),controller[_0xee8a('0xa')]);router[_0xee8a('0x6')]('/:id',auth[_0xee8a('0x7')](),controller[_0xee8a('0xb')]);router['post']('/',auth[_0xee8a('0x7')](),interaction[_0xee8a('0xc')](_0xee8a('0xd'),'smsmessage:create'),controller[_0xee8a('0xe')]);router[_0xee8a('0xf')](_0xee8a('0x10'),controller['status']);router['put']('/:id',auth[_0xee8a('0x7')](),controller[_0xee8a('0x11')]);router[_0xee8a('0x12')](_0xee8a('0x13'),auth[_0xee8a('0x7')](),controller[_0xee8a('0x14')]);router[_0xee8a('0x12')]('/:id/reject',auth[_0xee8a('0x7')](),controller['reject']);router['delete'](_0xee8a('0x15'),auth[_0xee8a('0x7')](),controller[_0xee8a('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index c1a113e..540a272 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 _0xb6a8=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','DATE','STRING'];(function(_0x4e1a81,_0x4c3697){var _0x52ea72=function(_0x4cda82){while(--_0x4cda82){_0x4e1a81['push'](_0x4e1a81['shift']());}};_0x52ea72(++_0x4c3697);}(_0xb6a8,0xc8));var _0x8b6a=function(_0x37e619,_0x100d53){_0x37e619=_0x37e619-0x0;var _0x21c7c6=_0xb6a8[_0x37e619];return _0x21c7c6;};'use strict';var Sequelize=require(_0x8b6a('0x0'));module[_0x8b6a('0x1')]={'body':{'type':Sequelize[_0x8b6a('0x2')](_0x8b6a('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x8b6a('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8b6a('0x5')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x8b6a('0x6')]},'secret':{'type':Sequelize[_0x8b6a('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x8b6a('0x7')]},'providerResponse':{'type':Sequelize[_0x8b6a('0x2')]}}; \ No newline at end of file +var _0xdbef=['out','STRING','sequelize','exports','TEXT','BOOLEAN'];(function(_0x33cd5f,_0x579df3){var _0x596552=function(_0x57abc7){while(--_0x57abc7){_0x33cd5f['push'](_0x33cd5f['shift']());}};_0x596552(++_0x579df3);}(_0xdbef,0xc2));var _0xfdbe=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xdbef[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xfdbe('0x0'));module[_0xfdbe('0x1')]={'body':{'type':Sequelize[_0xfdbe('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xfdbe('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xfdbe('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xfdbe('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xfdbe('0x5')]},'providerResponse':{'type':Sequelize[_0xfdbe('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 6a8d7e2..c548d1f 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 _0x64eb=['localhost','socket.io-emitter','jayson/promise','client','http','request','info','debug','request\x20sent','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','fields','SmsMessage','find','catch','create','body','params','describe','../../config/logger','sms','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','read1stAt','interaction','user','role','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','sms-interactions','SmsInteraction','SmsInteractionId','RejectMessage','ContactId','User','EventManager','rejectmessage','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','sent','delivered','Status','plivio','infobip','groupName','eml-format','rimraf','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults'];(function(_0xe51964,_0x433b90){var _0x2c2366=function(_0x1bc95c){while(--_0x1bc95c){_0xe51964['push'](_0xe51964['shift']());}};_0x2c2366(++_0x433b90);}(_0x64eb,0x109));var _0xb64e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x64eb[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xb64e('0x0'));var rimraf=require(_0xb64e('0x1'));var zipdir=require(_0xb64e('0x2'));var jsonpatch=require(_0xb64e('0x3'));var rp=require(_0xb64e('0x4'));var moment=require(_0xb64e('0x5'));var BPromise=require(_0xb64e('0x6'));var Mustache=require(_0xb64e('0x7'));var util=require(_0xb64e('0x8'));var path=require(_0xb64e('0x9'));var sox=require(_0xb64e('0xa'));var csv=require(_0xb64e('0xb'));var ejs=require(_0xb64e('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb64e('0xd'));var squel=require(_0xb64e('0xe'));var crypto=require('crypto');var jsforce=require(_0xb64e('0xf'));var deskjs=require(_0xb64e('0x10'));var toCsv=require(_0xb64e('0xb'));var querystring=require(_0xb64e('0x11'));var Papa=require(_0xb64e('0x12'));var Redis=require(_0xb64e('0x13'));var authService=require(_0xb64e('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xb64e('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb64e('0x16'));var utils=require(_0xb64e('0x17'));var config=require(_0xb64e('0x18'));var licenseUtil=require(_0xb64e('0x19'));var db=require(_0xb64e('0x1a'))['db'];config[_0xb64e('0x1b')]=_[_0xb64e('0x1c')](config['redis'],{'host':_0xb64e('0x1d'),'port':0x18eb});var socket=require(_0xb64e('0x1e'))(new Redis(config[_0xb64e('0x1b')]));require('./smsMessage.socket')['register'](socket);var jayson=require(_0xb64e('0x1f'));var client=jayson[_0xb64e('0x20')][_0xb64e('0x21')]({'port':0x232c});var client9002=jayson[_0xb64e('0x20')][_0xb64e('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x249cb0,_0x176062,_0x1f0948,_0xcb927e){return new BPromise(function(_0xe00a28,_0x26426e){var _0x31541a=_0xcb927e||client;return _0x31541a[_0xb64e('0x22')](_0x249cb0,_0x1f0948)['then'](function(_0x4ea5de){logger[_0xb64e('0x23')]('SmsMessage,\x20%s,\x20%s',_0x176062,'request\x20sent');logger[_0xb64e('0x24')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x176062,_0xb64e('0x25'),JSON[_0xb64e('0x26')](_0x4ea5de));if(_0x4ea5de['error']){if(_0x4ea5de[_0xb64e('0x27')][_0xb64e('0x28')]===0x1f4){logger['error'](_0xb64e('0x29'),_0x176062,_0x4ea5de['error'][_0xb64e('0x2a')]);return _0x26426e(_0x4ea5de['error'][_0xb64e('0x2a')]);}logger[_0xb64e('0x27')](_0xb64e('0x29'),_0x176062,_0x4ea5de['error'][_0xb64e('0x2a')]);return _0xe00a28(_0x4ea5de[_0xb64e('0x27')][_0xb64e('0x2a')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x176062,_0xb64e('0x25'));_0xe00a28(_0x4ea5de[_0xb64e('0x2b')]['message']);}})['catch'](function(_0x1bc2df){logger[_0xb64e('0x27')](_0xb64e('0x29'),_0x176062,_0x1bc2df);_0x26426e(_0x1bc2df);});});}function respondWithStatusCode(_0x1d474b,_0x3dca50){_0x3dca50=_0x3dca50||0xcc;return function(_0x216e6b){if(_0x216e6b){return _0x1d474b['sendStatus'](_0x3dca50);}return _0x1d474b[_0xb64e('0x2c')](_0x3dca50)[_0xb64e('0x2d')]();};}function respondWithResult(_0xcd1e26,_0x23adb5){_0x23adb5=_0x23adb5||0xc8;return function(_0x116c77){if(_0x116c77){return _0xcd1e26[_0xb64e('0x2c')](_0x23adb5)[_0xb64e('0x2e')](_0x116c77);}};}function respondWithFilteredResult(_0x48e7b6,_0x17a42f){return function(_0xdc517e){if(_0xdc517e){var _0x5b8bd2=typeof _0x17a42f['offset']==='undefined'&&typeof _0x17a42f[_0xb64e('0x2f')]===_0xb64e('0x30');var _0x54e943=_0xdc517e[_0xb64e('0x31')];var _0x442c25=_0x5b8bd2?0x0:_0x17a42f[_0xb64e('0x32')];var _0x27cd47=_0x5b8bd2?_0xdc517e[_0xb64e('0x31')]:_0x17a42f[_0xb64e('0x32')]+_0x17a42f[_0xb64e('0x2f')];var _0x4c8d4a;if(_0x27cd47>=_0x54e943){_0x27cd47=_0x54e943;_0x4c8d4a=0xc8;}else{_0x4c8d4a=0xce;}_0x48e7b6['status'](_0x4c8d4a);return _0x48e7b6['set'](_0xb64e('0x33'),_0x442c25+'-'+_0x27cd47+'/'+_0x54e943)[_0xb64e('0x2e')](_0xdc517e);}return null;};}function patchUpdates(_0x23bddd){return function(_0x409bed){try{jsonpatch[_0xb64e('0x34')](_0x409bed,_0x23bddd,!![]);}catch(_0x34d714){return BPromise[_0xb64e('0x35')](_0x34d714);}return _0x409bed[_0xb64e('0x36')]();};}function saveUpdates(_0xef5e7f,_0x378bba){return function(_0xdd00fc){if(_0xdd00fc){return _0xdd00fc[_0xb64e('0x37')](_0xef5e7f)[_0xb64e('0x38')](function(_0x46df63){return _0x46df63;});}return null;};}function removeEntity(_0x101573,_0x1b550d){return function(_0x4fd233){if(_0x4fd233){return _0x4fd233[_0xb64e('0x39')]()['then'](function(){_0x101573[_0xb64e('0x2c')](0xcc)[_0xb64e('0x2d')]();});}};}function handleEntityNotFound(_0x552176,_0x2b31ee){return function(_0x16ae0c){if(!_0x16ae0c){_0x552176[_0xb64e('0x3a')](0x194);}return _0x16ae0c;};}function handleError(_0x5d76c7,_0x5ccfdf){_0x5ccfdf=_0x5ccfdf||0x1f4;return function(_0x184dc1){logger[_0xb64e('0x27')](_0x184dc1[_0xb64e('0x3b')]);if(_0x184dc1['name']){delete _0x184dc1[_0xb64e('0x3c')];}_0x5d76c7[_0xb64e('0x2c')](_0x5ccfdf)[_0xb64e('0x3d')](_0x184dc1);};}exports[_0xb64e('0x3e')]=function(_0x3d613b,_0x50e542){var _0x382ff5={},_0x2dfc8c={},_0x726848={'count':0x0,'rows':[]};var _0x330bec=_['map'](db['SmsMessage']['rawAttributes'],function(_0xec1abb){return{'name':_0xec1abb[_0xb64e('0x3f')],'type':_0xec1abb[_0xb64e('0x40')][_0xb64e('0x41')]};});_0x2dfc8c[_0xb64e('0x42')]=_[_0xb64e('0x43')](_0x330bec,'name');_0x2dfc8c[_0xb64e('0x44')]=_[_0xb64e('0x45')](_0x3d613b[_0xb64e('0x44')]);_0x2dfc8c[_0xb64e('0x46')]=_[_0xb64e('0x47')](_0x2dfc8c[_0xb64e('0x42')],_0x2dfc8c['query']);_0x382ff5[_0xb64e('0x48')]=_['intersection'](_0x2dfc8c['model'],qs['fields'](_0x3d613b[_0xb64e('0x44')]['fields']));_0x382ff5[_0xb64e('0x48')]=_0x382ff5['attributes'][_0xb64e('0x49')]?_0x382ff5[_0xb64e('0x48')]:_0x2dfc8c[_0xb64e('0x42')];if(!_0x3d613b[_0xb64e('0x44')]['hasOwnProperty']('nolimit')){_0x382ff5['limit']=qs[_0xb64e('0x2f')](_0x3d613b[_0xb64e('0x44')][_0xb64e('0x2f')]);_0x382ff5['offset']=qs[_0xb64e('0x32')](_0x3d613b[_0xb64e('0x44')][_0xb64e('0x32')]);}_0x382ff5[_0xb64e('0x4a')]=qs[_0xb64e('0x4b')](_0x3d613b[_0xb64e('0x44')]['sort']);_0x382ff5[_0xb64e('0x4c')]=qs['filters'](_[_0xb64e('0x4d')](_0x3d613b[_0xb64e('0x44')],_0x2dfc8c[_0xb64e('0x46')]),_0x330bec);if(_0x3d613b[_0xb64e('0x44')][_0xb64e('0x4e')]){_0x382ff5[_0xb64e('0x4c')]=_[_0xb64e('0x4f')](_0x382ff5[_0xb64e('0x4c')],{'$or':_[_0xb64e('0x43')](_0x330bec,function(_0x3d6566){if(_0x3d6566['type']!==_0xb64e('0x50')){var _0x4fb4e9={};_0x4fb4e9[_0x3d6566[_0xb64e('0x3c')]]={'$like':'%'+_0x3d613b[_0xb64e('0x44')][_0xb64e('0x4e')]+'%'};return _0x4fb4e9;}})});}_0x382ff5=_[_0xb64e('0x4f')]({},_0x382ff5,_0x3d613b[_0xb64e('0x51')]);var _0x5150f4={'where':_0x382ff5[_0xb64e('0x4c')]};return db['SmsMessage']['count'](_0x5150f4)[_0xb64e('0x38')](function(_0x1795f8){_0x726848[_0xb64e('0x31')]=_0x1795f8;if(_0x3d613b[_0xb64e('0x44')][_0xb64e('0x52')]){_0x382ff5[_0xb64e('0x53')]=[{'all':!![]}];}return db['SmsMessage'][_0xb64e('0x54')](_0x382ff5);})['then'](function(_0x1cd6e2){_0x726848[_0xb64e('0x55')]=_0x1cd6e2;return _0x726848;})[_0xb64e('0x38')](respondWithFilteredResult(_0x50e542,_0x382ff5))['catch'](handleError(_0x50e542,null));};exports[_0xb64e('0x56')]=function(_0x366bd0,_0x40f2c5){var _0x29ea8c={'raw':!![],'where':{'id':_0x366bd0['params']['id']}},_0x20c550={};_0x20c550[_0xb64e('0x42')]=_[_0xb64e('0x45')](db['SmsMessage'][_0xb64e('0x57')]);_0x20c550[_0xb64e('0x44')]=_[_0xb64e('0x45')](_0x366bd0[_0xb64e('0x44')]);_0x20c550['filters']=_[_0xb64e('0x47')](_0x20c550[_0xb64e('0x42')],_0x20c550[_0xb64e('0x44')]);_0x29ea8c[_0xb64e('0x48')]=_[_0xb64e('0x47')](_0x20c550[_0xb64e('0x42')],qs[_0xb64e('0x58')](_0x366bd0[_0xb64e('0x44')]['fields']));_0x29ea8c[_0xb64e('0x48')]=_0x29ea8c[_0xb64e('0x48')]['length']?_0x29ea8c[_0xb64e('0x48')]:_0x20c550[_0xb64e('0x42')];if(_0x366bd0[_0xb64e('0x44')]['includeAll']){_0x29ea8c[_0xb64e('0x53')]=[{'all':!![]}];}_0x29ea8c=_[_0xb64e('0x4f')]({},_0x29ea8c,_0x366bd0[_0xb64e('0x51')]);return db[_0xb64e('0x59')][_0xb64e('0x5a')](_0x29ea8c)[_0xb64e('0x38')](handleEntityNotFound(_0x40f2c5,null))['then'](respondWithResult(_0x40f2c5,null))[_0xb64e('0x5b')](handleError(_0x40f2c5,null));};exports[_0xb64e('0x5c')]=function(_0x254848,_0x17239d){return db[_0xb64e('0x59')][_0xb64e('0x5c')](_0x254848[_0xb64e('0x5d')],{})['then'](respondWithResult(_0x17239d,0xc9))[_0xb64e('0x5b')](handleError(_0x17239d,null));};exports[_0xb64e('0x37')]=function(_0x143a8f,_0x4d0f4b){if(_0x143a8f[_0xb64e('0x5d')]['id']){delete _0x143a8f['body']['id'];}return db[_0xb64e('0x59')][_0xb64e('0x5a')]({'where':{'id':_0x143a8f[_0xb64e('0x5e')]['id']}})['then'](handleEntityNotFound(_0x4d0f4b,null))[_0xb64e('0x38')](saveUpdates(_0x143a8f['body'],null))['then'](respondWithResult(_0x4d0f4b,null))[_0xb64e('0x5b')](handleError(_0x4d0f4b,null));};exports['destroy']=function(_0x229cf6,_0x3ebf20){return db['SmsMessage'][_0xb64e('0x5a')]({'where':{'id':_0x229cf6[_0xb64e('0x5e')]['id']}})[_0xb64e('0x38')](handleEntityNotFound(_0x3ebf20,null))[_0xb64e('0x38')](removeEntity(_0x3ebf20,null))[_0xb64e('0x5b')](handleError(_0x3ebf20,null));};exports[_0xb64e('0x5f')]=function(_0x22709f,_0xeb67be){return db[_0xb64e('0x59')][_0xb64e('0x5f')]()[_0xb64e('0x38')](respondWithResult(_0xeb67be,null))[_0xb64e('0x5b')](handleError(_0xeb67be,null));};var interaction_log=require(_0xb64e('0x60'))('sms-interactions');exports['accept']=function(_0x5583e0,_0x543c03,_0x45b7ea){var _0x24ae77={'agent':{},'channel':_0xb64e('0x61')};if(_0x5583e0[_0xb64e('0x5d')]['id']){delete _0x5583e0['body']['id'];}_0x5583e0[_0xb64e('0x5d')]['read']=!![];_0x5583e0[_0xb64e('0x5d')]['readAt']=moment()[_0xb64e('0x62')](_0xb64e('0x63'));_0x5583e0[_0xb64e('0x5d')][_0xb64e('0x64')]=_0x5583e0[_0xb64e('0x5d')][_0xb64e('0x64')]||_0x5583e0['user']['id'];_0x24ae77['agent']['id']=_0x5583e0[_0xb64e('0x5d')][_0xb64e('0x64')];return db['SmsMessage'][_0xb64e('0x5a')]({'where':{'id':_0x5583e0[_0xb64e('0x5e')]['id'],'UserId':null}})[_0xb64e('0x38')](handleEntityNotFound(_0x543c03,null))['then'](saveUpdates(_0x5583e0[_0xb64e('0x5d')],null))['then'](function(_0x577319){if(_0x577319){_0x24ae77[_0xb64e('0x2a')]=_0x577319[_0xb64e('0x65')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x577319['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x543c03,null))[_0xb64e('0x38')](function(_0x4c51cc){if(_0x4c51cc){return _0x4c51cc[_0xb64e('0x37')]({'UserId':_0x5583e0[_0xb64e('0x5d')]['UserId'],'read1stAt':_['isNil'](_0x4c51cc[_0xb64e('0x66')])?moment()[_0xb64e('0x62')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0xa84c2d){if(_0xa84c2d){_0x24ae77[_0xb64e('0x67')]=_0xa84c2d['get']({'plain':!![]});interaction_log[_0xb64e('0x23')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5583e0[_0xb64e('0x68')]['id'],_0x5583e0['user'][_0xb64e('0x3c')],_0x5583e0[_0xb64e('0x68')][_0xb64e('0x69')],_0x24ae77[_0xb64e('0x67')]['id'],_0x5583e0[_0xb64e('0x5d')]?JSON['stringify'](_0x5583e0['body']):_0xb64e('0x6a'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x24ae77);}return null;})[_0xb64e('0x38')](function(_0x396e3c){var _0x5a4757=_0xb64e('0x6b')+_0x396e3c[_0xb64e('0x2a')]['ContactId'];return db[_0xb64e('0x6c')][_0xb64e('0x44')](_0x5a4757,{'type':db[_0xb64e('0x6d')][_0xb64e('0x6e')][_0xb64e('0x6f')],'raw':!![]})[_0xb64e('0x38')](function(_0x45754b){return _0x45754b;});})[_0xb64e('0x38')](function(_0x64865c){if(_0x64865c){_0x24ae77[_0xb64e('0x2a')][_0xb64e('0x70')]=_0x64865c[0x0];if(!_0x5583e0[_0xb64e('0x5d')][_0xb64e('0x64')])return;return db['User']['find']({'where':{'id':_0x5583e0[_0xb64e('0x5d')]['UserId'],'role':_0xb64e('0x71')},'attributes':['id','name',_0xb64e('0x72'),_0xb64e('0x73'),_0xb64e('0x74')],'raw':!![]});}return null;})[_0xb64e('0x38')](function(_0x3a07c1){if(!_0x3a07c1)return null;_0x24ae77['message'][_0xb64e('0x71')]=_0x3a07c1;return _0x24ae77;})[_0xb64e('0x38')](function(_0x20d007){if(_0x20d007){if(_0x5583e0[_0xb64e('0x5d')][_0xb64e('0x75')]){_0x24ae77[_0xb64e('0x2a')][_0xb64e('0x76')]=util[_0xb64e('0x62')](_0xb64e('0x77'),_0x5583e0[_0xb64e('0x68')][_0xb64e('0x3c')]);_0x24ae77['message'][_0xb64e('0x78')]=_0x24ae77[_0xb64e('0x78')];_0x24ae77['message'][_0xb64e('0x79')]=_0x24ae77[_0xb64e('0x78')];_0x24ae77[_0xb64e('0x2a')][_0xb64e('0x7a')]=_0xb64e('0x7b');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x24ae77['message']},client9002)['then'](function(){return _0x24ae77;});}return _0x24ae77;}return null;})[_0xb64e('0x38')](respondWithResult(_0x543c03,null))[_0xb64e('0x5b')](handleError(_0x543c03,null));};var interaction_log=require('../../config/logger')(_0xb64e('0x7c'));exports[_0xb64e('0x35')]=function(_0x1d714a,_0x5c8746,_0x4b074a){var _0x1f8c79={'agent':{},'channel':_0xb64e('0x61')};if(_0x1d714a[_0xb64e('0x5d')]['id']){delete _0x1d714a[_0xb64e('0x5d')]['id'];}_0x1d714a['body']['UserId']=_0x1d714a['body'][_0xb64e('0x64')]||_0x1d714a[_0xb64e('0x68')]['id'];_0x1f8c79[_0xb64e('0x71')]['id']=_0x1d714a[_0xb64e('0x5d')][_0xb64e('0x64')];return db[_0xb64e('0x59')][_0xb64e('0x5a')]({'where':{'id':_0x1d714a[_0xb64e('0x5e')]['id'],'UserId':null}})[_0xb64e('0x38')](handleEntityNotFound(_0x5c8746,null))[_0xb64e('0x38')](function(_0x580ebc){if(_0x580ebc){_0x1f8c79['message']=_0x580ebc[_0xb64e('0x65')]({'plain':!![]});return db[_0xb64e('0x7d')][_0xb64e('0x5a')]({'where':{'id':_0x580ebc[_0xb64e('0x7e')]}});}return null;})[_0xb64e('0x38')](handleEntityNotFound(_0x5c8746,null))['then'](function(_0x1883f1){if(_0x1883f1){_0x1f8c79[_0xb64e('0x67')]=_0x1883f1['get']({'plain':!![]});interaction_log[_0xb64e('0x23')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1d714a[_0xb64e('0x68')]['id'],_0x1d714a[_0xb64e('0x68')][_0xb64e('0x3c')],_0x1d714a[_0xb64e('0x68')]['role'],_0x1f8c79['interaction']['id'],_0x1d714a[_0xb64e('0x5d')]?JSON[_0xb64e('0x26')](_0x1d714a[_0xb64e('0x5d')]):_0xb64e('0x6a'));return respondWithRpcPromise(_0xb64e('0x7f'),'rejectMessage',_0x1f8c79);}return null;})[_0xb64e('0x38')](function(_0x259259){var _0x3d7956=_0xb64e('0x6b')+_0x259259[_0xb64e('0x2a')][_0xb64e('0x80')];return db[_0xb64e('0x6c')][_0xb64e('0x44')](_0x3d7956,{'type':db[_0xb64e('0x6d')]['QueryTypes'][_0xb64e('0x6f')],'raw':!![]})['then'](function(_0x4cee39){return _0x4cee39;});})[_0xb64e('0x38')](function(_0x198564){if(_0x198564){_0x1f8c79[_0xb64e('0x2a')][_0xb64e('0x70')]=_0x198564[0x0];if(!_0x1d714a[_0xb64e('0x5d')][_0xb64e('0x64')])return;return db[_0xb64e('0x81')][_0xb64e('0x5a')]({'where':{'id':_0x1d714a[_0xb64e('0x5d')][_0xb64e('0x64')],'role':'agent'},'attributes':['id',_0xb64e('0x3c'),_0xb64e('0x72'),_0xb64e('0x73'),_0xb64e('0x74')],'raw':!![]});}return null;})[_0xb64e('0x38')](function(_0x1adffe){if(!_0x1adffe)return null;_0x1f8c79['message'][_0xb64e('0x71')]=_0x1adffe;return _0x1f8c79;})[_0xb64e('0x38')](function(_0x16a030){if(_0x16a030){_0x16a030[_0xb64e('0x2a')][_0xb64e('0x76')]=util[_0xb64e('0x62')](_0xb64e('0x77'),_0x1d714a[_0xb64e('0x68')][_0xb64e('0x3c')]);_0x16a030[_0xb64e('0x2a')][_0xb64e('0x78')]=_0x1f8c79['channel'];_0x16a030[_0xb64e('0x2a')][_0xb64e('0x79')]=_0x1f8c79[_0xb64e('0x78')];_0x16a030[_0xb64e('0x2a')][_0xb64e('0x7a')]=_0xb64e('0x35');respondWithRpcPromise(_0xb64e('0x82'),_0xb64e('0x82'),{'event':_0xb64e('0x83'),'message':_0x16a030['message']},client9002);return _0x1f8c79;}return null;})[_0xb64e('0x38')](respondWithResult(_0x5c8746,null))['catch'](handleError(_0x5c8746,null));};exports['status']=function(_0xc7b276,_0x13d717,_0x3e604b){if(_0xc7b276['body']['id']){delete _0xc7b276[_0xb64e('0x5d')]['id'];}var _0x58df9d;return db[_0xb64e('0x59')]['find']({'where':{'id':_0xc7b276[_0xb64e('0x5e')]['id']}})[_0xb64e('0x38')](handleEntityNotFound(_0x13d717,null))['then'](function(_0x1a76d9){if(_0x1a76d9){_0x58df9d=_0x1a76d9;return db['SmsAccount'][_0xb64e('0x5a')]({'where':{'id':_0x1a76d9[_0xb64e('0x84')]}});}})[_0xb64e('0x38')](handleEntityNotFound(_0x13d717,null))[_0xb64e('0x38')](function(_0x5c3172){if(_0x5c3172){logger[_0xb64e('0x24')](_0xb64e('0x85'),_0xb64e('0x2c'),_0xb64e('0x86'),_0x5c3172[_0xb64e('0x40')],util[_0xb64e('0x87')](_0xc7b276[_0xb64e('0x5d')],{'showHidden':![],'depth':null}));switch(_0x5c3172[_0xb64e('0x40')]){case _0xb64e('0x88'):if(_0xc7b276[_0xb64e('0x5d')]['MessageSid']&&_0xc7b276[_0xb64e('0x5d')][_0xb64e('0x89')]===_0x58df9d[_0xb64e('0x8a')]){return _0x58df9d[_0xb64e('0x37')]({'read':!![]});}else{logger[_0xb64e('0x27')](_0xb64e('0x8b'),_0xb64e('0x2c'),_0xb64e('0x88'),util[_0xb64e('0x87')](_0xc7b276['body'],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0xc7b276[_0xb64e('0x5d')][_0xb64e('0x8c')]&&_0xc7b276[_0xb64e('0x5d')][_0xb64e('0x8c')]===_0x58df9d[_0xb64e('0x8a')]&&_['indexOf']([_0xb64e('0x8d'),_0xb64e('0x8e')],_0xc7b276[_0xb64e('0x5d')][_0xb64e('0x8f')])>=0x0){return _0x58df9d[_0xb64e('0x37')]({'read':!![]});}else{logger[_0xb64e('0x27')](_0xb64e('0x8b'),_0xb64e('0x2c'),_0xb64e('0x90'),util['inspect'](_0xc7b276[_0xb64e('0x5d')],{'showHidden':![],'depth':null}));}break;case _0xb64e('0x91'):var _0x53e7ce=_0xc7b276[_0xb64e('0x5d')]['results'][0x0];if(_0x53e7ce[_0xb64e('0x2c')][_0xb64e('0x92')]==='DELIVERED'){return _0x58df9d[_0xb64e('0x37')]({'read':!![]});}else{logger['error'](_0xb64e('0x8b'),_0xb64e('0x2c'),_0xb64e('0x91'),util[_0xb64e('0x87')](_0xc7b276[_0xb64e('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x58df9d;}})['then'](respondWithResult(_0x13d717,null))['catch'](handleError(_0x13d717,null));}; \ No newline at end of file +var _0x25a5=['[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','QueryTypes','contact','User','fullname','email','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','SmsInteraction','RejectMessage','rejectMessage','Sequelize','internal','rejectmessage','SmsAccountId','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','plivio','infobip','results','DELIVERED','eml-format','rimraf','fast-json-patch','bluebird','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','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','stack','name','send','index','map','SmsMessage','rawAttributes','type','key','model','keys','filters','intersection','attributes','fields','query','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','describe','sms-interactions','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteractionId','isNil','read1stAt','interaction'];(function(_0x5391ef,_0x3c8788){var _0x136499=function(_0x4d80a5){while(--_0x4d80a5){_0x5391ef['push'](_0x5391ef['shift']());}};_0x136499(++_0x3c8788);}(_0x25a5,0x1e1));var _0x525a=function(_0x29223a,_0x3fd7dd){_0x29223a=_0x29223a-0x0;var _0xe3c621=_0x25a5[_0x29223a];return _0xe3c621;};'use strict';var emlformat=require(_0x525a('0x0'));var rimraf=require(_0x525a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x525a('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x525a('0x3'));var Mustache=require('mustache');var util=require(_0x525a('0x4'));var path=require('path');var sox=require(_0x525a('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x525a('0x6'));var squel=require(_0x525a('0x7'));var crypto=require(_0x525a('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x525a('0x9'));var toCsv=require(_0x525a('0xa'));var querystring=require(_0x525a('0xb'));var Papa=require(_0x525a('0xc'));var Redis=require(_0x525a('0xd'));var authService=require(_0x525a('0xe'));var qs=require(_0x525a('0xf'));var as=require(_0x525a('0x10'));var hardwareService=require(_0x525a('0x11'));var logger=require(_0x525a('0x12'))(_0x525a('0x13'));var utils=require(_0x525a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x525a('0x15'));var db=require(_0x525a('0x16'))['db'];config[_0x525a('0x17')]=_[_0x525a('0x18')](config[_0x525a('0x17')],{'host':_0x525a('0x19'),'port':0x18eb});var socket=require(_0x525a('0x1a'))(new Redis(config[_0x525a('0x17')]));require(_0x525a('0x1b'))[_0x525a('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x525a('0x1d')][_0x525a('0x1e')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3f1bd3,_0x295c8c,_0x3bcc8d,_0x5a7961){return new BPromise(function(_0x4db427,_0x55060d){var _0x374d67=_0x5a7961||client;return _0x374d67[_0x525a('0x1f')](_0x3f1bd3,_0x3bcc8d)[_0x525a('0x20')](function(_0x29a6a3){logger[_0x525a('0x21')](_0x525a('0x22'),_0x295c8c,_0x525a('0x23'));logger[_0x525a('0x24')](_0x525a('0x25'),_0x295c8c,_0x525a('0x23'),JSON[_0x525a('0x26')](_0x29a6a3));if(_0x29a6a3['error']){if(_0x29a6a3[_0x525a('0x27')][_0x525a('0x28')]===0x1f4){logger[_0x525a('0x27')](_0x525a('0x22'),_0x295c8c,_0x29a6a3[_0x525a('0x27')][_0x525a('0x29')]);return _0x55060d(_0x29a6a3['error'][_0x525a('0x29')]);}logger[_0x525a('0x27')](_0x525a('0x22'),_0x295c8c,_0x29a6a3[_0x525a('0x27')][_0x525a('0x29')]);return _0x4db427(_0x29a6a3[_0x525a('0x27')][_0x525a('0x29')]);}else{logger[_0x525a('0x21')](_0x525a('0x22'),_0x295c8c,_0x525a('0x23'));_0x4db427(_0x29a6a3[_0x525a('0x2a')][_0x525a('0x29')]);}})[_0x525a('0x2b')](function(_0xe26b19){logger[_0x525a('0x27')](_0x525a('0x22'),_0x295c8c,_0xe26b19);_0x55060d(_0xe26b19);});});}function respondWithStatusCode(_0x5b65f0,_0x48e02c){_0x48e02c=_0x48e02c||0xcc;return function(_0x112721){if(_0x112721){return _0x5b65f0[_0x525a('0x2c')](_0x48e02c);}return _0x5b65f0[_0x525a('0x2d')](_0x48e02c)[_0x525a('0x2e')]();};}function respondWithResult(_0x4afe1b,_0x3082c8){_0x3082c8=_0x3082c8||0xc8;return function(_0x302e5c){if(_0x302e5c){return _0x4afe1b[_0x525a('0x2d')](_0x3082c8)[_0x525a('0x2f')](_0x302e5c);}};}function respondWithFilteredResult(_0x3f46dc,_0x256cd5){return function(_0x17213b){if(_0x17213b){var _0x5bd740=typeof _0x256cd5[_0x525a('0x30')]===_0x525a('0x31')&&typeof _0x256cd5[_0x525a('0x32')]===_0x525a('0x31');var _0xe290cf=_0x17213b[_0x525a('0x33')];var _0x1cdf91=_0x5bd740?0x0:_0x256cd5['offset'];var _0x2c1bbd=_0x5bd740?_0x17213b['count']:_0x256cd5['offset']+_0x256cd5['limit'];var _0x546dd9;if(_0x2c1bbd>=_0xe290cf){_0x2c1bbd=_0xe290cf;_0x546dd9=0xc8;}else{_0x546dd9=0xce;}_0x3f46dc[_0x525a('0x2d')](_0x546dd9);return _0x3f46dc['set'](_0x525a('0x34'),_0x1cdf91+'-'+_0x2c1bbd+'/'+_0xe290cf)[_0x525a('0x2f')](_0x17213b);}return null;};}function patchUpdates(_0x4ba2c7){return function(_0x38423b){try{jsonpatch[_0x525a('0x35')](_0x38423b,_0x4ba2c7,!![]);}catch(_0x1585f5){return BPromise[_0x525a('0x36')](_0x1585f5);}return _0x38423b['save']();};}function saveUpdates(_0x500c90,_0x371c6b){return function(_0x3b7fa6){if(_0x3b7fa6){return _0x3b7fa6[_0x525a('0x37')](_0x500c90)[_0x525a('0x20')](function(_0x4596dd){return _0x4596dd;});}return null;};}function removeEntity(_0x4c0a03,_0x2129be){return function(_0x471f3b){if(_0x471f3b){return _0x471f3b[_0x525a('0x38')]()[_0x525a('0x20')](function(){_0x4c0a03[_0x525a('0x2d')](0xcc)[_0x525a('0x2e')]();});}};}function handleEntityNotFound(_0x62c2d6,_0x2c71a3){return function(_0x373209){if(!_0x373209){_0x62c2d6[_0x525a('0x2c')](0x194);}return _0x373209;};}function handleError(_0x5db2a6,_0x529eba){_0x529eba=_0x529eba||0x1f4;return function(_0x50aa6c){logger[_0x525a('0x27')](_0x50aa6c[_0x525a('0x39')]);if(_0x50aa6c[_0x525a('0x3a')]){delete _0x50aa6c[_0x525a('0x3a')];}_0x5db2a6['status'](_0x529eba)[_0x525a('0x3b')](_0x50aa6c);};}exports[_0x525a('0x3c')]=function(_0x4756e4,_0x1c604e){var _0x3dc1da={},_0x499d69={},_0x4cb6a4={'count':0x0,'rows':[]};var _0x1d56c1=_[_0x525a('0x3d')](db[_0x525a('0x3e')][_0x525a('0x3f')],function(_0x18bd36){return{'name':_0x18bd36['fieldName'],'type':_0x18bd36[_0x525a('0x40')][_0x525a('0x41')]};});_0x499d69[_0x525a('0x42')]=_[_0x525a('0x3d')](_0x1d56c1,_0x525a('0x3a'));_0x499d69['query']=_[_0x525a('0x43')](_0x4756e4['query']);_0x499d69[_0x525a('0x44')]=_[_0x525a('0x45')](_0x499d69[_0x525a('0x42')],_0x499d69['query']);_0x3dc1da[_0x525a('0x46')]=_['intersection'](_0x499d69[_0x525a('0x42')],qs[_0x525a('0x47')](_0x4756e4[_0x525a('0x48')]['fields']));_0x3dc1da['attributes']=_0x3dc1da[_0x525a('0x46')][_0x525a('0x49')]?_0x3dc1da[_0x525a('0x46')]:_0x499d69[_0x525a('0x42')];if(!_0x4756e4[_0x525a('0x48')]['hasOwnProperty'](_0x525a('0x4a'))){_0x3dc1da[_0x525a('0x32')]=qs[_0x525a('0x32')](_0x4756e4[_0x525a('0x48')]['limit']);_0x3dc1da[_0x525a('0x30')]=qs['offset'](_0x4756e4['query'][_0x525a('0x30')]);}_0x3dc1da[_0x525a('0x4b')]=qs['sort'](_0x4756e4[_0x525a('0x48')][_0x525a('0x4c')]);_0x3dc1da[_0x525a('0x4d')]=qs[_0x525a('0x44')](_[_0x525a('0x4e')](_0x4756e4['query'],_0x499d69[_0x525a('0x44')]),_0x1d56c1);if(_0x4756e4[_0x525a('0x48')][_0x525a('0x4f')]){_0x3dc1da[_0x525a('0x4d')]=_[_0x525a('0x50')](_0x3dc1da['where'],{'$or':_['map'](_0x1d56c1,function(_0x3cc4f5){if(_0x3cc4f5[_0x525a('0x40')]!==_0x525a('0x51')){var _0x3289d3={};_0x3289d3[_0x3cc4f5[_0x525a('0x3a')]]={'$like':'%'+_0x4756e4['query'][_0x525a('0x4f')]+'%'};return _0x3289d3;}})});}_0x3dc1da=_[_0x525a('0x50')]({},_0x3dc1da,_0x4756e4[_0x525a('0x52')]);var _0x59d955={'where':_0x3dc1da[_0x525a('0x4d')]};return db['SmsMessage'][_0x525a('0x33')](_0x59d955)['then'](function(_0x1e2c00){_0x4cb6a4['count']=_0x1e2c00;if(_0x4756e4[_0x525a('0x48')][_0x525a('0x53')]){_0x3dc1da[_0x525a('0x54')]=[{'all':!![]}];}return db['SmsMessage'][_0x525a('0x55')](_0x3dc1da);})[_0x525a('0x20')](function(_0x41f4a8){_0x4cb6a4[_0x525a('0x56')]=_0x41f4a8;return _0x4cb6a4;})[_0x525a('0x20')](respondWithFilteredResult(_0x1c604e,_0x3dc1da))[_0x525a('0x2b')](handleError(_0x1c604e,null));};exports[_0x525a('0x57')]=function(_0x3eead6,_0x5bf1fa){var _0x9da5d4={'raw':!![],'where':{'id':_0x3eead6[_0x525a('0x58')]['id']}},_0x53910e={};_0x53910e['model']=_[_0x525a('0x43')](db[_0x525a('0x3e')][_0x525a('0x3f')]);_0x53910e[_0x525a('0x48')]=_[_0x525a('0x43')](_0x3eead6[_0x525a('0x48')]);_0x53910e[_0x525a('0x44')]=_[_0x525a('0x45')](_0x53910e[_0x525a('0x42')],_0x53910e['query']);_0x9da5d4[_0x525a('0x46')]=_[_0x525a('0x45')](_0x53910e[_0x525a('0x42')],qs[_0x525a('0x47')](_0x3eead6[_0x525a('0x48')][_0x525a('0x47')]));_0x9da5d4[_0x525a('0x46')]=_0x9da5d4[_0x525a('0x46')][_0x525a('0x49')]?_0x9da5d4[_0x525a('0x46')]:_0x53910e['model'];if(_0x3eead6[_0x525a('0x48')]['includeAll']){_0x9da5d4[_0x525a('0x54')]=[{'all':!![]}];}_0x9da5d4=_['merge']({},_0x9da5d4,_0x3eead6['options']);return db[_0x525a('0x3e')][_0x525a('0x59')](_0x9da5d4)[_0x525a('0x20')](handleEntityNotFound(_0x5bf1fa,null))[_0x525a('0x20')](respondWithResult(_0x5bf1fa,null))[_0x525a('0x2b')](handleError(_0x5bf1fa,null));};exports['create']=function(_0x42ee7d,_0x2674a1){return db[_0x525a('0x3e')][_0x525a('0x5a')](_0x42ee7d[_0x525a('0x5b')],{})[_0x525a('0x20')](respondWithResult(_0x2674a1,0xc9))[_0x525a('0x2b')](handleError(_0x2674a1,null));};exports['update']=function(_0x54a043,_0x391d13){if(_0x54a043[_0x525a('0x5b')]['id']){delete _0x54a043[_0x525a('0x5b')]['id'];}return db[_0x525a('0x3e')]['find']({'where':{'id':_0x54a043[_0x525a('0x58')]['id']}})['then'](handleEntityNotFound(_0x391d13,null))[_0x525a('0x20')](saveUpdates(_0x54a043['body'],null))[_0x525a('0x20')](respondWithResult(_0x391d13,null))[_0x525a('0x2b')](handleError(_0x391d13,null));};exports[_0x525a('0x38')]=function(_0x4d7c3f,_0x5c49ce){return db[_0x525a('0x3e')]['find']({'where':{'id':_0x4d7c3f['params']['id']}})[_0x525a('0x20')](handleEntityNotFound(_0x5c49ce,null))['then'](removeEntity(_0x5c49ce,null))[_0x525a('0x2b')](handleError(_0x5c49ce,null));};exports[_0x525a('0x5c')]=function(_0x4292c8,_0x13c051){return db[_0x525a('0x3e')][_0x525a('0x5c')]()['then'](respondWithResult(_0x13c051,null))[_0x525a('0x2b')](handleError(_0x13c051,null));};var interaction_log=require(_0x525a('0x12'))(_0x525a('0x5d'));exports['accept']=function(_0xd04325,_0x39c57b,_0x48f41a){var _0x4b847d={'agent':{},'channel':_0x525a('0x5e')};if(_0xd04325[_0x525a('0x5b')]['id']){delete _0xd04325['body']['id'];}_0xd04325[_0x525a('0x5b')][_0x525a('0x5f')]=!![];_0xd04325[_0x525a('0x5b')][_0x525a('0x60')]=moment()[_0x525a('0x61')](_0x525a('0x62'));_0xd04325[_0x525a('0x5b')][_0x525a('0x63')]=_0xd04325[_0x525a('0x5b')][_0x525a('0x63')]||_0xd04325[_0x525a('0x64')]['id'];_0x4b847d[_0x525a('0x65')]['id']=_0xd04325[_0x525a('0x5b')][_0x525a('0x63')];return db[_0x525a('0x3e')]['find']({'where':{'id':_0xd04325[_0x525a('0x58')]['id'],'UserId':null}})[_0x525a('0x20')](handleEntityNotFound(_0x39c57b,null))[_0x525a('0x20')](saveUpdates(_0xd04325[_0x525a('0x5b')],null))[_0x525a('0x20')](function(_0x3ef7e8){if(_0x3ef7e8){_0x4b847d[_0x525a('0x29')]=_0x3ef7e8[_0x525a('0x66')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x3ef7e8[_0x525a('0x67')]}});}return null;})[_0x525a('0x20')](handleEntityNotFound(_0x39c57b,null))[_0x525a('0x20')](function(_0x709dfe){if(_0x709dfe){return _0x709dfe[_0x525a('0x37')]({'UserId':_0xd04325['body'][_0x525a('0x63')],'read1stAt':_[_0x525a('0x68')](_0x709dfe[_0x525a('0x69')])?moment()[_0x525a('0x61')](_0x525a('0x62')):undefined});}return null;})[_0x525a('0x20')](function(_0x53c7fd){if(_0x53c7fd){_0x4b847d[_0x525a('0x6a')]=_0x53c7fd['get']({'plain':!![]});interaction_log[_0x525a('0x21')](_0x525a('0x6b'),_0xd04325['user']['id'],_0xd04325['user'][_0x525a('0x3a')],_0xd04325[_0x525a('0x64')][_0x525a('0x6c')],_0x4b847d[_0x525a('0x6a')]['id'],_0xd04325['body']?JSON[_0x525a('0x26')](_0xd04325['body']):_0x525a('0x6d'));return respondWithRpcPromise(_0x525a('0x6e'),_0x525a('0x6f'),_0x4b847d);}return null;})[_0x525a('0x20')](function(_0x317671){var _0x18fae7=_0x525a('0x70')+_0x317671[_0x525a('0x29')][_0x525a('0x71')];return db['sequelize'][_0x525a('0x48')](_0x18fae7,{'type':db['Sequelize'][_0x525a('0x72')]['SELECT'],'raw':!![]})['then'](function(_0x200c47){return _0x200c47;});})[_0x525a('0x20')](function(_0x468002){if(_0x468002){_0x4b847d[_0x525a('0x29')][_0x525a('0x73')]=_0x468002[0x0];if(!_0xd04325['body'][_0x525a('0x63')])return;return db[_0x525a('0x74')][_0x525a('0x59')]({'where':{'id':_0xd04325[_0x525a('0x5b')]['UserId'],'role':_0x525a('0x65')},'attributes':['id','name',_0x525a('0x75'),_0x525a('0x76'),'internal'],'raw':!![]});}return null;})['then'](function(_0x149203){if(!_0x149203)return null;_0x4b847d[_0x525a('0x29')][_0x525a('0x65')]=_0x149203;return _0x4b847d;})[_0x525a('0x20')](function(_0x397e1d){if(_0x397e1d){if(_0xd04325[_0x525a('0x5b')]['manual']){_0x4b847d['message'][_0x525a('0x77')]=util[_0x525a('0x61')](_0x525a('0x78'),_0xd04325[_0x525a('0x64')]['name']);_0x4b847d[_0x525a('0x29')][_0x525a('0x79')]=_0x4b847d[_0x525a('0x79')];_0x4b847d[_0x525a('0x29')][_0x525a('0x7a')]=_0x4b847d[_0x525a('0x79')];_0x4b847d[_0x525a('0x29')][_0x525a('0x7b')]=_0x525a('0x7c');return respondWithRpcPromise('EventManager',_0x525a('0x7d'),{'event':'acceptmessage','message':_0x4b847d[_0x525a('0x29')]},client9002)['then'](function(){return _0x4b847d;});}return _0x4b847d;}return null;})[_0x525a('0x20')](respondWithResult(_0x39c57b,null))['catch'](handleError(_0x39c57b,null));};var interaction_log=require(_0x525a('0x12'))(_0x525a('0x5d'));exports[_0x525a('0x36')]=function(_0x456fe0,_0x1d59f2,_0x34ea85){var _0x7b6efd={'agent':{},'channel':'sms'};if(_0x456fe0['body']['id']){delete _0x456fe0['body']['id'];}_0x456fe0[_0x525a('0x5b')][_0x525a('0x63')]=_0x456fe0[_0x525a('0x5b')][_0x525a('0x63')]||_0x456fe0[_0x525a('0x64')]['id'];_0x7b6efd['agent']['id']=_0x456fe0[_0x525a('0x5b')][_0x525a('0x63')];return db[_0x525a('0x3e')][_0x525a('0x59')]({'where':{'id':_0x456fe0[_0x525a('0x58')]['id'],'UserId':null}})[_0x525a('0x20')](handleEntityNotFound(_0x1d59f2,null))[_0x525a('0x20')](function(_0xd44733){if(_0xd44733){_0x7b6efd[_0x525a('0x29')]=_0xd44733[_0x525a('0x66')]({'plain':!![]});return db[_0x525a('0x7e')][_0x525a('0x59')]({'where':{'id':_0xd44733['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x1d59f2,null))[_0x525a('0x20')](function(_0x5b786b){if(_0x5b786b){_0x7b6efd[_0x525a('0x6a')]=_0x5b786b[_0x525a('0x66')]({'plain':!![]});interaction_log[_0x525a('0x21')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x456fe0[_0x525a('0x64')]['id'],_0x456fe0[_0x525a('0x64')][_0x525a('0x3a')],_0x456fe0[_0x525a('0x64')][_0x525a('0x6c')],_0x7b6efd['interaction']['id'],_0x456fe0[_0x525a('0x5b')]?JSON[_0x525a('0x26')](_0x456fe0[_0x525a('0x5b')]):_0x525a('0x6d'));return respondWithRpcPromise(_0x525a('0x7f'),_0x525a('0x80'),_0x7b6efd);}return null;})[_0x525a('0x20')](function(_0x5e74b0){var _0x21609b=_0x525a('0x70')+_0x5e74b0['message'][_0x525a('0x71')];return db['sequelize']['query'](_0x21609b,{'type':db[_0x525a('0x81')][_0x525a('0x72')]['SELECT'],'raw':!![]})[_0x525a('0x20')](function(_0x589142){return _0x589142;});})['then'](function(_0x3e476a){if(_0x3e476a){_0x7b6efd[_0x525a('0x29')][_0x525a('0x73')]=_0x3e476a[0x0];if(!_0x456fe0[_0x525a('0x5b')]['UserId'])return;return db[_0x525a('0x74')][_0x525a('0x59')]({'where':{'id':_0x456fe0[_0x525a('0x5b')][_0x525a('0x63')],'role':_0x525a('0x65')},'attributes':['id',_0x525a('0x3a'),_0x525a('0x75'),_0x525a('0x76'),_0x525a('0x82')],'raw':!![]});}return null;})['then'](function(_0x18c402){if(!_0x18c402)return null;_0x7b6efd['message'][_0x525a('0x65')]=_0x18c402;return _0x7b6efd;})['then'](function(_0x2b6042){if(_0x2b6042){_0x2b6042['message'][_0x525a('0x77')]=util[_0x525a('0x61')](_0x525a('0x78'),_0x456fe0[_0x525a('0x64')][_0x525a('0x3a')]);_0x2b6042[_0x525a('0x29')]['channel']=_0x7b6efd[_0x525a('0x79')];_0x2b6042[_0x525a('0x29')]['motionChannel']=_0x7b6efd[_0x525a('0x79')];_0x2b6042['message']['event']=_0x525a('0x36');respondWithRpcPromise(_0x525a('0x7d'),_0x525a('0x7d'),{'event':_0x525a('0x83'),'message':_0x2b6042[_0x525a('0x29')]},client9002);return _0x7b6efd;}return null;})[_0x525a('0x20')](respondWithResult(_0x1d59f2,null))[_0x525a('0x2b')](handleError(_0x1d59f2,null));};exports[_0x525a('0x2d')]=function(_0x1f2433,_0x14f670,_0xef9c7b){if(_0x1f2433[_0x525a('0x5b')]['id']){delete _0x1f2433['body']['id'];}var _0x494211;return db['SmsMessage'][_0x525a('0x59')]({'where':{'id':_0x1f2433[_0x525a('0x58')]['id']}})['then'](handleEntityNotFound(_0x14f670,null))[_0x525a('0x20')](function(_0x289df6){if(_0x289df6){_0x494211=_0x289df6;return db['SmsAccount'][_0x525a('0x59')]({'where':{'id':_0x289df6[_0x525a('0x84')]}});}})[_0x525a('0x20')](handleEntityNotFound(_0x14f670,null))['then'](function(_0x11d4af){if(_0x11d4af){logger[_0x525a('0x24')](_0x525a('0x25'),'status',_0x525a('0x85'),_0x11d4af[_0x525a('0x40')],util[_0x525a('0x86')](_0x1f2433[_0x525a('0x5b')],{'showHidden':![],'depth':null}));switch(_0x11d4af[_0x525a('0x40')]){case'twilio':if(_0x1f2433[_0x525a('0x5b')][_0x525a('0x87')]&&_0x1f2433[_0x525a('0x5b')][_0x525a('0x87')]===_0x494211[_0x525a('0x88')]){return _0x494211['update']({'read':!![]});}else{logger[_0x525a('0x27')](_0x525a('0x89'),_0x525a('0x2d'),'twilio',util[_0x525a('0x86')](_0x1f2433['body'],{'showHidden':![],'depth':null}));}break;case _0x525a('0x8a'):if(_0x1f2433['body'][_0x525a('0x8b')]&&_0x1f2433[_0x525a('0x5b')][_0x525a('0x8b')]===_0x494211[_0x525a('0x88')]&&_[_0x525a('0x8c')]([_0x525a('0x8d'),_0x525a('0x8e')],_0x1f2433['body']['Status'])>=0x0){return _0x494211[_0x525a('0x37')]({'read':!![]});}else{logger['error'](_0x525a('0x89'),_0x525a('0x2d'),_0x525a('0x8f'),util['inspect'](_0x1f2433[_0x525a('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x525a('0x90'):var _0x23cb08=_0x1f2433[_0x525a('0x5b')][_0x525a('0x91')][0x0];if(_0x23cb08[_0x525a('0x2d')]['groupName']===_0x525a('0x92')){return _0x494211[_0x525a('0x37')]({'read':!![]});}else{logger[_0x525a('0x27')](_0x525a('0x89'),'status',_0x525a('0x90'),util[_0x525a('0x86')](_0x1f2433[_0x525a('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x494211;}})[_0x525a('0x20')](respondWithResult(_0x14f670,null))[_0x525a('0x2b')](handleError(_0x14f670,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 838317a..db2e4e2 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 _0xce5c=['SmsMessage','setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x1f1e31,_0x27b5c3){var _0x229b56=function(_0x16db77){while(--_0x16db77){_0x1f1e31['push'](_0x1f1e31['shift']());}};_0x229b56(++_0x27b5c3);}(_0xce5c,0xee));var _0xcce5=function(_0x888385,_0x9cdc66){_0x888385=_0x888385-0x0;var _0x22d5c2=_0xce5c[_0x888385];return _0x22d5c2;};'use strict';var EventEmitter=require(_0xcce5('0x0'));var SmsMessage=require(_0xcce5('0x1'))['db'][_0xcce5('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xcce5('0x3')](0x0);var events={'afterCreate':_0xcce5('0x4'),'afterUpdate':_0xcce5('0x5'),'afterDestroy':_0xcce5('0x6')};function emitEvent(_0x525fe4){return function(_0x53ef8d,_0x1d5934,_0x547c60){SmsMessageEvents[_0xcce5('0x7')](_0x525fe4+':'+_0x53ef8d['id'],_0x53ef8d);SmsMessageEvents['emit'](_0x525fe4,_0x53ef8d);_0x547c60(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0xcce5('0x8')](e,emitEvent(event));}}module[_0xcce5('0x9')]=SmsMessageEvents; \ No newline at end of file +var _0xbe3e=['events','SmsMessage','setMaxListeners','update','emit','hook','exports'];(function(_0x1f8e33,_0x300371){var _0x37b939=function(_0x4d4fa4){while(--_0x4d4fa4){_0x1f8e33['push'](_0x1f8e33['shift']());}};_0x37b939(++_0x300371);}(_0xbe3e,0x1ab));var _0xebe3=function(_0x4535c7,_0x2c89c7){_0x4535c7=_0x4535c7-0x0;var _0x37ca9c=_0xbe3e[_0x4535c7];return _0x37ca9c;};'use strict';var EventEmitter=require(_0xebe3('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0xebe3('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xebe3('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xebe3('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5a49ed){return function(_0x3e145c,_0x102d5a,_0x22d1f8){SmsMessageEvents[_0xebe3('0x4')](_0x5a49ed+':'+_0x3e145c['id'],_0x3e145c);SmsMessageEvents[_0xebe3('0x4')](_0x5a49ed,_0x3e145c);_0x22d1f8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0xebe3('0x5')](e,emitEvent(event));}}module[_0xebe3('0x6')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 5b14b29..afec69e 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 _0x4d9e=['requestid','deliveryReport','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','queued_count','head','message_id','clickSend','authId','/api/sms/messages/','toString','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/sms/2/text/advanced','application/json','IBSSO\x20','token','infobip','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','text','keys','sort','createHash','signature=','GET','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','uuid','UTF-8','apiMessageId','bandwidth','accountId','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','refid','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','api','bluebird','path','rimraf','./smsMessage.attributes','exports','define','SmsMessage','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','SmsInteractionId','then','createdAt','catch','error','out','SmsAccount','find','type','twilio','accountSid','authToken','phone','messages','create','remote','/status?token=','update','sid','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','split','sms','total_sent','read','afterCreate','Missing\x20parameters:\x20username,\x20password','connectel','senderString','POST','https://smsapi.connectel.se/api/v2/send/'];(function(_0x3182f0,_0x22236d){var _0x5adfc1=function(_0x28f6e5){while(--_0x28f6e5){_0x3182f0['push'](_0x3182f0['shift']());}};_0x5adfc1(++_0x22236d);}(_0x4d9e,0x18c));var _0xe4d9=function(_0x210297,_0xf6170d){_0x210297=_0x210297-0x0;var _0x17df3c=_0x4d9e[_0x210297];return _0x17df3c;};'use strict';var _=require(_0xe4d9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe4d9('0x1'));var moment=require('moment');var BPromise=require(_0xe4d9('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe4d9('0x3'));var rimraf=require(_0xe4d9('0x4'));var config=require('../../config/environment');var attributes=require(_0xe4d9('0x5'));module[_0xe4d9('0x6')]=function(_0x278035,_0x34c2a2){return _0x278035[_0xe4d9('0x7')](_0xe4d9('0x8'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0xe4d9('0x9'),'fields':[_0xe4d9('0x9')]},{'name':_0xe4d9('0xa'),'fields':[_0xe4d9('0xb')],'type':_0xe4d9('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x21ebb8,_0x4b7cd0,_0x1127e5){var _0x1160d5=_0x278035[_0xe4d9('0xd')];var _0x3575ac=_0x21ebb8[_0xe4d9('0xe')]({'plain':!![]});if(_0x3575ac[_0xe4d9('0xf')][_0xe4d9('0x10')]()==='in'||_0x3575ac['direction']['toLowerCase']()==='out'&&!_0x3575ac['secret']&&!_['isNil'](_0x3575ac['UserId'])){_0x1160d5['SmsInteraction']['findOne']({'where':{'id':_0x3575ac[_0xe4d9('0x11')]}})[_0xe4d9('0x12')](function(_0x3f884c){if(_0x3f884c){_0x3f884c['update']({'lastMsgAt':_0x3575ac[_0xe4d9('0x13')],'lastMsgDirection':_0x3575ac[_0xe4d9('0xf')][_0xe4d9('0x10')]()});}})[_0xe4d9('0x14')](function(_0x58d0cf){console[_0xe4d9('0x15')](_0x58d0cf);});}if(_0x3575ac[_0xe4d9('0xf')]===_0xe4d9('0x16')&&!_0x3575ac['secret']){var _0x4d2afd;_0x1160d5[_0xe4d9('0x17')][_0xe4d9('0x18')]({'where':{'id':_0x3575ac['SmsAccountId']},'raw':!![]})[_0xe4d9('0x12')](function(_0x4f8dba){_0x4d2afd=_0x4f8dba;if(_0x4d2afd&&_0x4d2afd[_0xe4d9('0x19')]){switch(_0x4d2afd[_0xe4d9('0x19')]){case _0xe4d9('0x1a'):var _0x2522f3=require('twilio');if(_0x4d2afd[_0xe4d9('0x1b')]&&_0x4d2afd[_0xe4d9('0x1c')]&&_0x4d2afd[_0xe4d9('0x1d')]){var _0x171224=new _0x2522f3(_0x4d2afd[_0xe4d9('0x1b')],_0x4d2afd[_0xe4d9('0x1c')]);_0x171224[_0xe4d9('0x1e')][_0xe4d9('0x1f')]({'body':_0x3575ac[_0xe4d9('0xb')],'to':_0x3575ac['phone'],'from':_0x4d2afd[_0xe4d9('0x1d')],'statusCallback':_0x4d2afd[_0xe4d9('0x20')]+'/api/sms/messages/'+_0x3575ac['id']+_0xe4d9('0x21')+_0x4d2afd['token']})[_0xe4d9('0x12')](function(_0x125320){if(_0x125320['sid']){return _0x21ebb8[_0xe4d9('0x22')]({'messageId':_0x125320[_0xe4d9('0x23')]});}})['catch'](function(_0xc5be1b){logger[_0xe4d9('0x15')](_0xe4d9('0x24'),'afterCreate','twilio',util[_0xe4d9('0x25')](_0xc5be1b,{'showHidden':![],'depth':null}));});}else{logger[_0xe4d9('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xe4d9('0x26'):var _0x48d481=_0xe4d9('0x27');if(_0x4d2afd[_0xe4d9('0x28')]&&_0x4d2afd[_0xe4d9('0x29')]){var _0x535200={'recipient':[_0x3575ac[_0xe4d9('0x1d')]],'message':_0x3575ac[_0xe4d9('0xb')],'message_type':_0x4d2afd[_0xe4d9('0x2a')]};if(_0x4d2afd[_0xe4d9('0x2a')]&&_0x4d2afd[_0xe4d9('0x2a')]!=='SI'){_0x535200[_0xe4d9('0x2b')]=_0x4d2afd[_0xe4d9('0x1d')];}var _0x1a10b0={'url':_0x48d481+_0xe4d9('0x2c')+_0x4d2afd[_0xe4d9('0x28')]+_0xe4d9('0x2d')+_0x4d2afd[_0xe4d9('0x29')],'method':'GET'};rp(_0x1a10b0)[_0xe4d9('0x12')](function(_0x349be3){var _0x2b716b=_0x349be3[_0xe4d9('0x2e')](';');var _0xa444d0={'user_key':_0x2b716b[0x0],'session_key':_0x2b716b[0x1]};_0x1a10b0={'url':_0x48d481+_0xe4d9('0x2f'),'method':'POST','headers':{'user_key':_0xa444d0['user_key'],'Session_key':_0xa444d0['session_key']},'json':!![],'body':_0x535200};return rp(_0x1a10b0);})[_0xe4d9('0x12')](function(_0x100e57){if(_0x100e57[_0xe4d9('0x30')]>=0x1){var _0x4f8abf={'messageId':_0x100e57['internal_order_id']};if(_0x4d2afd['smsMethod']!=='GP'||!_0x4d2afd['deliveryReport']){_0x4f8abf[_0xe4d9('0x31')]=!![];}return _0x21ebb8[_0xe4d9('0x22')](_0x4f8abf);}else{return logger['error'](_0xe4d9('0x24'),_0xe4d9('0x32'),'skebby',util[_0xe4d9('0x25')](_0x100e57,{'showHidden':![],'depth':null}));}})[_0xe4d9('0x14')](function(_0x945a80){return logger[_0xe4d9('0x15')](_0xe4d9('0x24'),_0xe4d9('0x32'),_0xe4d9('0x26'),util[_0xe4d9('0x25')](_0x945a80,{'showHidden':![],'depth':null}));});}else{logger[_0xe4d9('0x15')](_0xe4d9('0x24'),_0xe4d9('0x32'),_0xe4d9('0x26'),_0xe4d9('0x33'));}break;case _0xe4d9('0x34'):if(_0x4d2afd['authToken']){var _0x17b46b={'recipient':_0x3575ac[_0xe4d9('0x1d')],'message':_0x3575ac[_0xe4d9('0xb')],'sender':_0x4d2afd[_0xe4d9('0x35')]||_0x4d2afd[_0xe4d9('0x1d')],'authorization':_0x4d2afd[_0xe4d9('0x1c')]};var _0x4b7cd0={'method':_0xe4d9('0x36'),'uri':_0xe4d9('0x37'),'body':_0x17b46b,'json':!![]};rp(_0x4b7cd0)['then'](function(_0x4d8346){var _0x5f5bc5={'messageId':_0x4d8346[_0xe4d9('0x38')]};if(!_0x4d2afd[_0xe4d9('0x39')]){_0x5f5bc5[_0xe4d9('0x31')]=!![];}return _0x21ebb8[_0xe4d9('0x22')](_0x5f5bc5);})[_0xe4d9('0x14')](function(_0x324679){logger[_0xe4d9('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','connectel',util[_0xe4d9('0x25')](_0x324679,{'showHidden':![],'depth':null}));});}else{logger[_0xe4d9('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe4d9('0x32'),_0xe4d9('0x34'),_0xe4d9('0x3a'));}break;case _0xe4d9('0x3b'):if(_0x4d2afd['username']&&_0x4d2afd[_0xe4d9('0x29')]){var _0x17b46b={'messages':[{'source':_0xe4d9('0x3c'),'to':_0x3575ac[_0xe4d9('0x1d')],'body':_0x3575ac[_0xe4d9('0xb')],'from':_0x4d2afd[_0xe4d9('0x35')]||_0x4d2afd[_0xe4d9('0x1d')]}]};var _0x4044be=util[_0xe4d9('0x3d')](_0xe4d9('0x3e'),_0x4d2afd[_0xe4d9('0x28')],_0x4d2afd['password']);var _0x4b7cd0={'method':_0xe4d9('0x36'),'uri':_0xe4d9('0x3f'),'body':_0x17b46b,'headers':{'Authorization':util[_0xe4d9('0x3d')](_0xe4d9('0x40'),new Buffer(_0x4044be)['toString'](_0xe4d9('0x41')))},'json':!![]};rp(_0x4b7cd0)[_0xe4d9('0x12')](function(_0x658510){if(_0x658510[_0xe4d9('0x42')]>=0xc8&&_0x658510[_0xe4d9('0x42')]<=0xce){if(_0x658510[_0xe4d9('0x43')]&&_0x658510[_0xe4d9('0x43')][_0xe4d9('0x44')]>0x0){var _0x42744d=_[_0xe4d9('0x45')](_0x658510['data'][_0xe4d9('0x1e')]);var _0x179117={'messageId':_0x42744d[_0xe4d9('0x46')]};if(!_0x4d2afd['deliveryReport']){_0x179117[_0xe4d9('0x31')]=!![];}return _0x21ebb8[_0xe4d9('0x22')](_0x179117);}else{logger[_0xe4d9('0x15')](_0xe4d9('0x24'),_0xe4d9('0x32'),_0xe4d9('0x47'),util[_0xe4d9('0x25')](_0x658510,{'showHidden':![],'depth':null}));}}else{logger['error'](_0xe4d9('0x24'),_0xe4d9('0x32'),_0xe4d9('0x47'),util[_0xe4d9('0x25')](_0x658510,{'showHidden':![],'depth':null}));}})[_0xe4d9('0x14')](function(_0x423881){logger['error'](_0xe4d9('0x24'),_0xe4d9('0x32'),_0xe4d9('0x47'),util[_0xe4d9('0x25')](_0x423881,{'showHidden':![],'depth':null}));});}else{logger[_0xe4d9('0x15')](_0xe4d9('0x24'),'afterCreate',_0xe4d9('0x47'),_0xe4d9('0x33'));}break;case'plivo':if(_0x4d2afd[_0xe4d9('0x48')]&&_0x4d2afd['authToken']){var _0x17b46b={'dst':_0x3575ac[_0xe4d9('0x1d')],'text':_0x3575ac['body'],'src':_0x4d2afd[_0xe4d9('0x35')]||_0x4d2afd['phone'],'url':_0x4d2afd[_0xe4d9('0x20')]+_0xe4d9('0x49')+_0x3575ac['id']+_0xe4d9('0x21')+_0x4d2afd['token']};var _0x4044be=util[_0xe4d9('0x3d')]('%s:%s',_0x4d2afd[_0xe4d9('0x48')],_0x4d2afd[_0xe4d9('0x1c')]);var _0x4b7cd0={'method':_0xe4d9('0x36'),'uri':util['format']('https://api.plivo.com/v1/Account/%s/Message/',_0x4d2afd[_0xe4d9('0x48')]),'body':_0x17b46b,'headers':{'Authorization':util[_0xe4d9('0x3d')](_0xe4d9('0x40'),new Buffer(_0x4044be)[_0xe4d9('0x4a')](_0xe4d9('0x41')))},'json':!![]};rp(_0x4b7cd0)[_0xe4d9('0x12')](function(_0x5cee57){var _0x5a57ad={'messageId':_0x5cee57[_0xe4d9('0x4b')][0x0]};return _0x21ebb8[_0xe4d9('0x22')](_0x5a57ad);})[_0xe4d9('0x14')](function(_0x1c2205){logger[_0xe4d9('0x15')](_0xe4d9('0x24'),'afterCreate',_0xe4d9('0x4c'),util[_0xe4d9('0x25')](_0x1c2205,{'showHidden':![],'depth':null}));});}else{logger[_0xe4d9('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe4d9('0x32'),_0xe4d9('0x4c'),_0xe4d9('0x4d'));}break;case'infobip':if(_0x4d2afd[_0xe4d9('0x28')]&&_0x4d2afd['password']){if(_0x4d2afd[_0xe4d9('0x4e')]){var _0x13b008={'method':_0xe4d9('0x36'),'uri':_0x4d2afd['baseUrl']+'/auth/1/session','body':{'username':_0x4d2afd['username'],'password':_0x4d2afd[_0xe4d9('0x29')]},'json':!![]};return rp(_0x13b008)['then'](function(_0x29c51b){var _0x4c37a6={'method':'POST','uri':_0x4d2afd[_0xe4d9('0x4e')]+_0xe4d9('0x4f'),'body':{'messages':[{'from':_0x4d2afd[_0xe4d9('0x1d')],'destinations':[{'to':_0x3575ac[_0xe4d9('0x1d')]}],'text':_0x3575ac[_0xe4d9('0xb')],'notifyUrl':_0x4d2afd['remote']+'/api/sms/messages/'+_0x3575ac['id']+'/status?token='+_0x4d2afd['token'],'notifyContentType':_0xe4d9('0x50'),'callbackData':_0x4d2afd[_0xe4d9('0x1d')]+';'+_0x3575ac[_0xe4d9('0xb')]}]},'headers':{'Authorization':_0xe4d9('0x51')+_0x29c51b[_0xe4d9('0x52')]},'json':!![]};return rp(_0x4c37a6)[_0xe4d9('0x12')](function(_0x2e6c84){if(_0x2e6c84['messages']){var _0x524e8c={'messageId':_0x2e6c84[_0xe4d9('0x1e')][0x0][_0xe4d9('0x9')]};if(!_0x4d2afd[_0xe4d9('0x39')]){_0x524e8c[_0xe4d9('0x31')]=!![];}return _0x21ebb8[_0xe4d9('0x22')](_0x524e8c);}else{return logger[_0xe4d9('0x15')](_0xe4d9('0x24'),_0xe4d9('0x32'),_0xe4d9('0x53'),util[_0xe4d9('0x25')](_0x2e6c84,{'showHidden':![],'depth':null}));}});})[_0xe4d9('0x14')](function(_0x12f647){return logger['error'](_0xe4d9('0x24'),_0xe4d9('0x32'),_0xe4d9('0x53'),util[_0xe4d9('0x25')](_0x12f647,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xe4d9('0x53'),_0xe4d9('0x54'));}}else{logger[_0xe4d9('0x15')](_0xe4d9('0x24'),'afterCreate','infobip',_0xe4d9('0x33'));}break;case _0xe4d9('0x55'):var _0x2b45bf=require(_0xe4d9('0x56'));if(_0x4d2afd[_0xe4d9('0x57')]){var _0x1c7ba4={};_0x1c7ba4['login']=_0x4d2afd[_0xe4d9('0x28')];_0x1c7ba4['phone']=_0x3575ac[_0xe4d9('0x1d')];_0x1c7ba4[_0xe4d9('0x2b')]=_0x4d2afd['phone'];_0x1c7ba4[_0xe4d9('0x58')]=_0x3575ac[_0xe4d9('0xb')];_0x1c7ba4['timestamp']=+new Date();var _0x18b2ca='';var _0x655901='';var _0x46d795=Object[_0xe4d9('0x59')](_0x1c7ba4);_0x46d795[_0xe4d9('0x5a')]();for(var _0x1e61a3=0x0;_0x1e61a3<_0x46d795['length'];_0x1e61a3++){if(_0x18b2ca!=''){_0x18b2ca+='&';}_0x18b2ca+=_0x46d795[_0x1e61a3]+'='+encodeURIComponent(_0x1c7ba4[_0x46d795[_0x1e61a3]]);_0x655901+=_0x1c7ba4[_0x46d795[_0x1e61a3]];}_0x655901+=_0x4d2afd['apiKey'];_0x655901=_0x2b45bf[_0xe4d9('0x5b')]('md5')[_0xe4d9('0x22')](_0x655901)['digest']('hex');if(_0x18b2ca!==''){_0x18b2ca+='&';}_0x18b2ca+=_0xe4d9('0x5c')+_0x655901;var _0x1a10b0={'method':_0xe4d9('0x5d'),'uri':_0x4d2afd['baseUrl']+_0xe4d9('0x5e')+_0x18b2ca,'json':!![]};return rp(_0x1a10b0)['then'](function(_0xfa28c5){var _0x1b658b=Object[_0xe4d9('0x59')](_0xfa28c5);if(_0xfa28c5[_0x1b658b[0x0]][_0xe4d9('0x15')]&&parseInt(_0xfa28c5[_0x1b658b[0x0]]['error'])===0x0){var _0x3b9fd3={'messageId':_0xfa28c5[_0x1b658b[0x0]][_0xe4d9('0x5f')]};if(!_0x4d2afd[_0xe4d9('0x39')]){_0x3b9fd3[_0xe4d9('0x31')]=!![];}return _0x21ebb8[_0xe4d9('0x22')](_0x3b9fd3);}else{return logger[_0xe4d9('0x15')](_0xe4d9('0x24'),_0xe4d9('0x32'),_0xe4d9('0x55'),util['inspect'](_0xfa28c5[_0xe4d9('0x15')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x8a066b){return logger[_0xe4d9('0x15')](_0xe4d9('0x24'),_0xe4d9('0x32'),'csc',util['inspect'](_0x8a066b,{'showHidden':![],'depth':null}));});}else{logger[_0xe4d9('0x15')](_0xe4d9('0x24'),_0xe4d9('0x32'),_0xe4d9('0x55'),_0xe4d9('0x60'));}break;case _0xe4d9('0x61'):if(_0x4d2afd[_0xe4d9('0x57')]){var _0x1ca4a6={'method':_0xe4d9('0x36'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x4d2afd[_0xe4d9('0x57')]},'body':{'content':_0x3575ac[_0xe4d9('0xb')],'to':[_0x3575ac['phone']],'from':_0x4d2afd[_0xe4d9('0x1d')],'binary':![],'clientMessageId':_0xe4d9('0x62'),'charset':_0xe4d9('0x63')},'json':!![]};rp(_0x1ca4a6)[_0xe4d9('0x12')](function(_0x2120e6){if(!_0x2120e6['error']){var _0x276bf8={'messageId':_0x2120e6[_0xe4d9('0x1e')][0x0][_0xe4d9('0x64')]};if(!_0x4d2afd[_0xe4d9('0x39')]){_0x276bf8[_0xe4d9('0x31')]=!![];}return _0x21ebb8[_0xe4d9('0x22')](_0x276bf8);}else{return logger[_0xe4d9('0x15')](_0xe4d9('0x24'),_0xe4d9('0x32'),'clickatell',util[_0xe4d9('0x25')](_0x2120e6['error'],{'showHidden':![],'depth':null}));}})[_0xe4d9('0x14')](function(_0x27599d){return logger[_0xe4d9('0x15')](_0xe4d9('0x24'),'afterCreate',_0xe4d9('0x61'),util[_0xe4d9('0x25')](_0x27599d,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xe4d9('0x24'),_0xe4d9('0x32'),'clickatell',_0xe4d9('0x60'));}break;case _0xe4d9('0x65'):if(_0x4d2afd[_0xe4d9('0x28')]&&_0x4d2afd[_0xe4d9('0x29')]){var _0x4044be=util[_0xe4d9('0x3d')](_0xe4d9('0x3e'),_0x4d2afd[_0xe4d9('0x28')],_0x4d2afd[_0xe4d9('0x29')]);var _0x4b7cd0={'method':_0xe4d9('0x36'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x4d2afd[_0xe4d9('0x66')]+'/messages','body':{'to':[_0x3575ac[_0xe4d9('0x1d')]],'text':_0x3575ac[_0xe4d9('0xb')],'from':_0x4d2afd[_0xe4d9('0x1d')],'applicationId':_0x4d2afd[_0xe4d9('0x67')]},'headers':{'Authorization':util[_0xe4d9('0x3d')](_0xe4d9('0x40'),new Buffer(_0x4044be)[_0xe4d9('0x4a')](_0xe4d9('0x41')))},'json':!![]};rp(_0x4b7cd0)['then'](function(_0x2033fe){if(_0x2033fe['id']){var _0x41050c={'messageId':_0x2033fe['id']};return _0x21ebb8[_0xe4d9('0x22')](_0x41050c);}else{logger[_0xe4d9('0x15')](_0xe4d9('0x24'),_0xe4d9('0x32'),_0xe4d9('0x65'),util[_0xe4d9('0x25')](_0x2033fe,{'showHidden':![],'depth':null}));}})[_0xe4d9('0x14')](function(_0x255330){logger[_0xe4d9('0x15')](_0xe4d9('0x24'),_0xe4d9('0x32'),'bandwidth',util[_0xe4d9('0x25')](_0x255330,{'showHidden':![],'depth':null}));});}else{logger[_0xe4d9('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe4d9('0x32'),_0xe4d9('0x65'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xe4d9('0x68'):if(_0x4d2afd[_0xe4d9('0x57')]){var _0x248e4a={};var _0x1a10b0={'method':_0xe4d9('0x36'),'uri':_0xe4d9('0x69'),'headers':{'Authorization':_0xe4d9('0x6a')+_0x4d2afd[_0xe4d9('0x57')],'Content-Type':_0xe4d9('0x50')},'body':{'from':_0x4d2afd[_0xe4d9('0x1d')],'to':_0x3575ac[_0xe4d9('0x1d')],'text':_0x3575ac[_0xe4d9('0xb')]},'json':!![]};return rp(_0x1a10b0)[_0xe4d9('0x12')](function(_0x54f9f7){if(_0x54f9f7['code']==0xca){_0x248e4a['message']=_0x54f9f7;var _0x277d57={'method':_0xe4d9('0x36'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':'Bearer\x20'+_0x4d2afd[_0xe4d9('0x57')],'Content-Type':'application/json'},'body':{'refid':_0x248e4a[_0xe4d9('0x6b')]['refid']},'json':!![]};return rp(_0x277d57)[_0xe4d9('0x12')](function(_0x133f5a){_0x248e4a['status']=_0x133f5a;var _0x100cbd={'messageId':_0x248e4a[_0xe4d9('0x6b')][_0xe4d9('0x6c')],'read':!![]};return _0x21ebb8['update'](_0x100cbd);});}else{return logger[_0xe4d9('0x15')](_0xe4d9('0x24'),_0xe4d9('0x32'),_0xe4d9('0x68'),util[_0xe4d9('0x25')](_0x54f9f7,{'showHidden':![],'depth':null}));}})[_0xe4d9('0x14')](function(_0x13ac34){return logger[_0xe4d9('0x15')](_0xe4d9('0x24'),_0xe4d9('0x32'),_0xe4d9('0x68'),util[_0xe4d9('0x25')](_0x13ac34,{'showHidden':![],'depth':null}));});}else{return logger[_0xe4d9('0x15')](_0xe4d9('0x24'),_0xe4d9('0x32'),_0xe4d9('0x68'),_0xe4d9('0x6d'));}break;}}})[_0xe4d9('0x6e')](function(){_0x1127e5();});}else{_0x1127e5();}}},'charset':_0xe4d9('0x6f'),'collate':_0xe4d9('0x70')});}; \ No newline at end of file +var _0x37f8=['SmsAccount','find','then','type','twilio','accountSid','authToken','phone','messages','create','remote','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','GET','split','sms','session_key','total_sent','deliveryReport','skebby','senderString','POST','https://smsapi.connectel.se/api/v2/send/','read','connectel','clicksend','xCALLY\x20Motion','%s:%s','https://rest.clicksend.com/v3/sms/send','format','Basic\x20%s','toString','http_code','data','queued_count','message_id','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','base64','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','crypto','apiKey','login','text','timestamp','keys','length','createHash','md5','digest','signature=','id_sms','csc','clickatell','uuid','UTF-8','Missing\x20parameters:\x20apiKey','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','Missing\x20parameters:\x20username,\x20password','intelepeer','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','update','createdAt','catch','error','secret'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x37f8,0xd2));var _0x837f=function(_0x22be3b,_0x243882){_0x22be3b=_0x22be3b-0x0;var _0x4e083f=_0x37f8[_0x22be3b];return _0x4e083f;};'use strict';var _=require('lodash');var util=require(_0x837f('0x0'));var logger=require(_0x837f('0x1'))(_0x837f('0x2'));var moment=require(_0x837f('0x3'));var BPromise=require('bluebird');var rp=require(_0x837f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsMessage.attributes');module['exports']=function(_0x19c939,_0x42986f){return _0x19c939[_0x837f('0x5')](_0x837f('0x6'),attributes,{'tableName':_0x837f('0x7'),'paranoid':![],'indexes':[{'name':_0x837f('0x8'),'fields':[_0x837f('0x8')]},{'name':_0x837f('0x9'),'fields':[_0x837f('0xa')],'type':_0x837f('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x475c7b,_0x1aea1e,_0x2063a3){var _0x1f8668=_0x19c939[_0x837f('0xc')];var _0x50b133=_0x475c7b[_0x837f('0xd')]({'plain':!![]});if(_0x50b133[_0x837f('0xe')][_0x837f('0xf')]()==='in'||_0x50b133[_0x837f('0xe')][_0x837f('0xf')]()==='out'&&!_0x50b133['secret']&&!_[_0x837f('0x10')](_0x50b133[_0x837f('0x11')])){_0x1f8668[_0x837f('0x12')][_0x837f('0x13')]({'where':{'id':_0x50b133[_0x837f('0x14')]}})['then'](function(_0x18d8aa){if(_0x18d8aa){_0x18d8aa[_0x837f('0x15')]({'lastMsgAt':_0x50b133[_0x837f('0x16')],'lastMsgDirection':_0x50b133[_0x837f('0xe')][_0x837f('0xf')]()});}})[_0x837f('0x17')](function(_0x546352){console[_0x837f('0x18')](_0x546352);});}if(_0x50b133[_0x837f('0xe')]==='out'&&!_0x50b133[_0x837f('0x19')]){var _0x2745f6;_0x1f8668[_0x837f('0x1a')][_0x837f('0x1b')]({'where':{'id':_0x50b133['SmsAccountId']},'raw':!![]})[_0x837f('0x1c')](function(_0x2d5d54){_0x2745f6=_0x2d5d54;if(_0x2745f6&&_0x2745f6[_0x837f('0x1d')]){switch(_0x2745f6[_0x837f('0x1d')]){case _0x837f('0x1e'):var _0x4e46c4=require(_0x837f('0x1e'));if(_0x2745f6[_0x837f('0x1f')]&&_0x2745f6[_0x837f('0x20')]&&_0x2745f6[_0x837f('0x21')]){var _0x3540f3=new _0x4e46c4(_0x2745f6['accountSid'],_0x2745f6[_0x837f('0x20')]);_0x3540f3[_0x837f('0x22')][_0x837f('0x23')]({'body':_0x50b133[_0x837f('0xa')],'to':_0x50b133[_0x837f('0x21')],'from':_0x2745f6[_0x837f('0x21')],'statusCallback':_0x2745f6[_0x837f('0x24')]+_0x837f('0x25')+_0x50b133['id']+_0x837f('0x26')+_0x2745f6[_0x837f('0x27')]})[_0x837f('0x1c')](function(_0xfb4df0){if(_0xfb4df0[_0x837f('0x28')]){return _0x475c7b[_0x837f('0x15')]({'messageId':_0xfb4df0[_0x837f('0x28')]});}})[_0x837f('0x17')](function(_0x43ca7d){logger[_0x837f('0x18')](_0x837f('0x29'),_0x837f('0x2a'),_0x837f('0x1e'),util[_0x837f('0x2b')](_0x43ca7d,{'showHidden':![],'depth':null}));});}else{logger[_0x837f('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x837f('0x2a'),_0x837f('0x1e'),_0x837f('0x2c'));}break;case'skebby':var _0x530f6d=_0x837f('0x2d');if(_0x2745f6[_0x837f('0x2e')]&&_0x2745f6[_0x837f('0x2f')]){var _0x4072a4={'recipient':[_0x50b133[_0x837f('0x21')]],'message':_0x50b133[_0x837f('0xa')],'message_type':_0x2745f6[_0x837f('0x30')]};if(_0x2745f6['smsMethod']&&_0x2745f6[_0x837f('0x30')]!=='SI'){_0x4072a4[_0x837f('0x31')]=_0x2745f6[_0x837f('0x21')];}var _0x3289b7={'url':_0x530f6d+'login?username='+_0x2745f6['username']+'&password='+_0x2745f6[_0x837f('0x2f')],'method':_0x837f('0x32')};rp(_0x3289b7)[_0x837f('0x1c')](function(_0x422498){var _0x5e186e=_0x422498[_0x837f('0x33')](';');var _0x4ac99c={'user_key':_0x5e186e[0x0],'session_key':_0x5e186e[0x1]};_0x3289b7={'url':_0x530f6d+_0x837f('0x34'),'method':'POST','headers':{'user_key':_0x4ac99c['user_key'],'Session_key':_0x4ac99c[_0x837f('0x35')]},'json':!![],'body':_0x4072a4};return rp(_0x3289b7);})[_0x837f('0x1c')](function(_0x359fea){if(_0x359fea[_0x837f('0x36')]>=0x1){var _0x42494b={'messageId':_0x359fea['internal_order_id']};if(_0x2745f6['smsMethod']!=='GP'||!_0x2745f6[_0x837f('0x37')]){_0x42494b['read']=!![];}return _0x475c7b[_0x837f('0x15')](_0x42494b);}else{return logger[_0x837f('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x837f('0x2a'),_0x837f('0x38'),util[_0x837f('0x2b')](_0x359fea,{'showHidden':![],'depth':null}));}})[_0x837f('0x17')](function(_0x26bde0){return logger['error'](_0x837f('0x29'),_0x837f('0x2a'),_0x837f('0x38'),util[_0x837f('0x2b')](_0x26bde0,{'showHidden':![],'depth':null}));});}else{logger[_0x837f('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x837f('0x38'),'Missing\x20parameters:\x20username,\x20password');}break;case'connectel':if(_0x2745f6[_0x837f('0x20')]){var _0xb6951a={'recipient':_0x50b133['phone'],'message':_0x50b133['body'],'sender':_0x2745f6[_0x837f('0x39')]||_0x2745f6[_0x837f('0x21')],'authorization':_0x2745f6[_0x837f('0x20')]};var _0x1aea1e={'method':_0x837f('0x3a'),'uri':_0x837f('0x3b'),'body':_0xb6951a,'json':!![]};rp(_0x1aea1e)[_0x837f('0x1c')](function(_0x214e50){var _0x2ed1de={'messageId':_0x214e50['requestid']};if(!_0x2745f6['deliveryReport']){_0x2ed1de[_0x837f('0x3c')]=!![];}return _0x475c7b[_0x837f('0x15')](_0x2ed1de);})[_0x837f('0x17')](function(_0x53c0c7){logger['error'](_0x837f('0x29'),_0x837f('0x2a'),_0x837f('0x3d'),util['inspect'](_0x53c0c7,{'showHidden':![],'depth':null}));});}else{logger[_0x837f('0x18')](_0x837f('0x29'),'afterCreate','connectel','Missing\x20parameters:\x20authToken');}break;case _0x837f('0x3e'):if(_0x2745f6[_0x837f('0x2e')]&&_0x2745f6[_0x837f('0x2f')]){var _0xb6951a={'messages':[{'source':_0x837f('0x3f'),'to':_0x50b133[_0x837f('0x21')],'body':_0x50b133[_0x837f('0xa')],'from':_0x2745f6[_0x837f('0x39')]||_0x2745f6[_0x837f('0x21')]}]};var _0xef98af=util['format'](_0x837f('0x40'),_0x2745f6[_0x837f('0x2e')],_0x2745f6['password']);var _0x1aea1e={'method':_0x837f('0x3a'),'uri':_0x837f('0x41'),'body':_0xb6951a,'headers':{'Authorization':util[_0x837f('0x42')](_0x837f('0x43'),new Buffer(_0xef98af)[_0x837f('0x44')]('base64'))},'json':!![]};rp(_0x1aea1e)[_0x837f('0x1c')](function(_0x18747f){if(_0x18747f[_0x837f('0x45')]>=0xc8&&_0x18747f[_0x837f('0x45')]<=0xce){if(_0x18747f[_0x837f('0x46')]&&_0x18747f[_0x837f('0x46')][_0x837f('0x47')]>0x0){var _0x1ba5bc=_['head'](_0x18747f[_0x837f('0x46')][_0x837f('0x22')]);var _0x4f9dcf={'messageId':_0x1ba5bc[_0x837f('0x48')]};if(!_0x2745f6[_0x837f('0x37')]){_0x4f9dcf['read']=!![];}return _0x475c7b[_0x837f('0x15')](_0x4f9dcf);}else{logger[_0x837f('0x18')](_0x837f('0x29'),_0x837f('0x2a'),_0x837f('0x49'),util[_0x837f('0x2b')](_0x18747f,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x837f('0x29'),'afterCreate',_0x837f('0x49'),util[_0x837f('0x2b')](_0x18747f,{'showHidden':![],'depth':null}));}})[_0x837f('0x17')](function(_0x39ce8b){logger[_0x837f('0x18')](_0x837f('0x29'),'afterCreate','clickSend',util['inspect'](_0x39ce8b,{'showHidden':![],'depth':null}));});}else{logger[_0x837f('0x18')](_0x837f('0x29'),'afterCreate',_0x837f('0x49'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x837f('0x4a'):if(_0x2745f6[_0x837f('0x4b')]&&_0x2745f6[_0x837f('0x20')]){var _0xb6951a={'dst':_0x50b133[_0x837f('0x21')],'text':_0x50b133[_0x837f('0xa')],'src':_0x2745f6['senderString']||_0x2745f6[_0x837f('0x21')],'url':_0x2745f6['remote']+_0x837f('0x25')+_0x50b133['id']+_0x837f('0x26')+_0x2745f6[_0x837f('0x27')]};var _0xef98af=util[_0x837f('0x42')](_0x837f('0x40'),_0x2745f6[_0x837f('0x4b')],_0x2745f6[_0x837f('0x20')]);var _0x1aea1e={'method':_0x837f('0x3a'),'uri':util['format'](_0x837f('0x4c'),_0x2745f6[_0x837f('0x4b')]),'body':_0xb6951a,'headers':{'Authorization':util[_0x837f('0x42')](_0x837f('0x43'),new Buffer(_0xef98af)['toString'](_0x837f('0x4d')))},'json':!![]};rp(_0x1aea1e)['then'](function(_0x250e51){var _0x576365={'messageId':_0x250e51[_0x837f('0x4e')][0x0]};return _0x475c7b[_0x837f('0x15')](_0x576365);})[_0x837f('0x17')](function(_0x63cfe2){logger[_0x837f('0x18')](_0x837f('0x29'),_0x837f('0x2a'),_0x837f('0x4a'),util[_0x837f('0x2b')](_0x63cfe2,{'showHidden':![],'depth':null}));});}else{logger[_0x837f('0x18')](_0x837f('0x29'),_0x837f('0x2a'),'plivo',_0x837f('0x4f'));}break;case _0x837f('0x50'):if(_0x2745f6['username']&&_0x2745f6[_0x837f('0x2f')]){if(_0x2745f6[_0x837f('0x51')]){var _0x6b06c1={'method':_0x837f('0x3a'),'uri':_0x2745f6[_0x837f('0x51')]+_0x837f('0x52'),'body':{'username':_0x2745f6[_0x837f('0x2e')],'password':_0x2745f6[_0x837f('0x2f')]},'json':!![]};return rp(_0x6b06c1)[_0x837f('0x1c')](function(_0x366a3a){var _0xb376c2={'method':_0x837f('0x3a'),'uri':_0x2745f6[_0x837f('0x51')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x2745f6[_0x837f('0x21')],'destinations':[{'to':_0x50b133[_0x837f('0x21')]}],'text':_0x50b133[_0x837f('0xa')],'notifyUrl':_0x2745f6['remote']+_0x837f('0x25')+_0x50b133['id']+_0x837f('0x26')+_0x2745f6[_0x837f('0x27')],'notifyContentType':_0x837f('0x53'),'callbackData':_0x2745f6[_0x837f('0x21')]+';'+_0x50b133[_0x837f('0xa')]}]},'headers':{'Authorization':_0x837f('0x54')+_0x366a3a['token']},'json':!![]};return rp(_0xb376c2)[_0x837f('0x1c')](function(_0x35d7d1){if(_0x35d7d1[_0x837f('0x22')]){var _0x5a2868={'messageId':_0x35d7d1[_0x837f('0x22')][0x0][_0x837f('0x8')]};if(!_0x2745f6[_0x837f('0x37')]){_0x5a2868[_0x837f('0x3c')]=!![];}return _0x475c7b['update'](_0x5a2868);}else{return logger[_0x837f('0x18')](_0x837f('0x29'),_0x837f('0x2a'),'infobip',util['inspect'](_0x35d7d1,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x323344){return logger[_0x837f('0x18')](_0x837f('0x29'),_0x837f('0x2a'),_0x837f('0x50'),util[_0x837f('0x2b')](_0x323344,{'showHidden':![],'depth':null}));});}else{logger[_0x837f('0x18')](_0x837f('0x29'),_0x837f('0x2a'),_0x837f('0x50'),_0x837f('0x55'));}}else{logger[_0x837f('0x18')](_0x837f('0x29'),_0x837f('0x2a'),'infobip','Missing\x20parameters:\x20username,\x20password');}break;case'csc':var _0x128011=require(_0x837f('0x56'));if(_0x2745f6[_0x837f('0x57')]){var _0x474d2a={};_0x474d2a[_0x837f('0x58')]=_0x2745f6[_0x837f('0x2e')];_0x474d2a['phone']=_0x50b133[_0x837f('0x21')];_0x474d2a[_0x837f('0x31')]=_0x2745f6['phone'];_0x474d2a[_0x837f('0x59')]=_0x50b133[_0x837f('0xa')];_0x474d2a[_0x837f('0x5a')]=+new Date();var _0x5ccf08='';var _0x438297='';var _0x365bff=Object[_0x837f('0x5b')](_0x474d2a);_0x365bff['sort']();for(var _0x4a3dc7=0x0;_0x4a3dc7<_0x365bff[_0x837f('0x5c')];_0x4a3dc7++){if(_0x5ccf08!=''){_0x5ccf08+='&';}_0x5ccf08+=_0x365bff[_0x4a3dc7]+'='+encodeURIComponent(_0x474d2a[_0x365bff[_0x4a3dc7]]);_0x438297+=_0x474d2a[_0x365bff[_0x4a3dc7]];}_0x438297+=_0x2745f6['apiKey'];_0x438297=_0x128011[_0x837f('0x5d')](_0x837f('0x5e'))[_0x837f('0x15')](_0x438297)[_0x837f('0x5f')]('hex');if(_0x5ccf08!==''){_0x5ccf08+='&';}_0x5ccf08+=_0x837f('0x60')+_0x438297;var _0x3289b7={'method':_0x837f('0x32'),'uri':_0x2745f6['baseUrl']+'/external/get/send.php?'+_0x5ccf08,'json':!![]};return rp(_0x3289b7)[_0x837f('0x1c')](function(_0x130f36){var _0x262b76=Object['keys'](_0x130f36);if(_0x130f36[_0x262b76[0x0]]['error']&&parseInt(_0x130f36[_0x262b76[0x0]]['error'])===0x0){var _0x42071d={'messageId':_0x130f36[_0x262b76[0x0]][_0x837f('0x61')]};if(!_0x2745f6[_0x837f('0x37')]){_0x42071d[_0x837f('0x3c')]=!![];}return _0x475c7b['update'](_0x42071d);}else{return logger[_0x837f('0x18')](_0x837f('0x29'),'afterCreate',_0x837f('0x62'),util['inspect'](_0x130f36[_0x837f('0x18')],{'showHidden':![],'depth':null}));}})[_0x837f('0x17')](function(_0x14cfd9){return logger[_0x837f('0x18')](_0x837f('0x29'),'afterCreate',_0x837f('0x62'),util['inspect'](_0x14cfd9,{'showHidden':![],'depth':null}));});}else{logger[_0x837f('0x18')](_0x837f('0x29'),_0x837f('0x2a'),_0x837f('0x62'),'Missing\x20parameters:\x20apiKey');}break;case _0x837f('0x63'):if(_0x2745f6[_0x837f('0x57')]){var _0x4e2cf6={'method':_0x837f('0x3a'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x2745f6[_0x837f('0x57')]},'body':{'content':_0x50b133[_0x837f('0xa')],'to':[_0x50b133['phone']],'from':_0x2745f6[_0x837f('0x21')],'binary':![],'clientMessageId':_0x837f('0x64'),'charset':_0x837f('0x65')},'json':!![]};rp(_0x4e2cf6)[_0x837f('0x1c')](function(_0x2ca1d8){if(!_0x2ca1d8[_0x837f('0x18')]){var _0x6202f0={'messageId':_0x2ca1d8[_0x837f('0x22')][0x0]['apiMessageId']};if(!_0x2745f6[_0x837f('0x37')]){_0x6202f0[_0x837f('0x3c')]=!![];}return _0x475c7b[_0x837f('0x15')](_0x6202f0);}else{return logger['error'](_0x837f('0x29'),_0x837f('0x2a'),_0x837f('0x63'),util['inspect'](_0x2ca1d8[_0x837f('0x18')],{'showHidden':![],'depth':null}));}})[_0x837f('0x17')](function(_0x457b22){return logger['error'](_0x837f('0x29'),_0x837f('0x2a'),_0x837f('0x63'),util[_0x837f('0x2b')](_0x457b22,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x837f('0x29'),_0x837f('0x2a'),_0x837f('0x63'),_0x837f('0x66'));}break;case _0x837f('0x67'):if(_0x2745f6[_0x837f('0x2e')]&&_0x2745f6[_0x837f('0x2f')]){var _0xef98af=util[_0x837f('0x42')](_0x837f('0x40'),_0x2745f6[_0x837f('0x2e')],_0x2745f6[_0x837f('0x2f')]);var _0x1aea1e={'method':_0x837f('0x3a'),'uri':_0x837f('0x68')+_0x2745f6[_0x837f('0x69')]+_0x837f('0x6a'),'body':{'to':[_0x50b133[_0x837f('0x21')]],'text':_0x50b133[_0x837f('0xa')],'from':_0x2745f6[_0x837f('0x21')],'applicationId':_0x2745f6[_0x837f('0x6b')]},'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0xef98af)[_0x837f('0x44')](_0x837f('0x4d')))},'json':!![]};rp(_0x1aea1e)[_0x837f('0x1c')](function(_0xe7a459){if(_0xe7a459['id']){var _0x166a50={'messageId':_0xe7a459['id']};return _0x475c7b[_0x837f('0x15')](_0x166a50);}else{logger['error'](_0x837f('0x29'),_0x837f('0x2a'),_0x837f('0x67'),util[_0x837f('0x2b')](_0xe7a459,{'showHidden':![],'depth':null}));}})[_0x837f('0x17')](function(_0x803a0a){logger['error'](_0x837f('0x29'),_0x837f('0x2a'),_0x837f('0x67'),util['inspect'](_0x803a0a,{'showHidden':![],'depth':null}));});}else{logger[_0x837f('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x837f('0x2a'),'bandwidth',_0x837f('0x6c'));}break;case _0x837f('0x6d'):if(_0x2745f6['apiKey']){var _0x48ddbf={};var _0x3289b7={'method':_0x837f('0x3a'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':'Bearer\x20'+_0x2745f6[_0x837f('0x57')],'Content-Type':_0x837f('0x53')},'body':{'from':_0x2745f6[_0x837f('0x21')],'to':_0x50b133[_0x837f('0x21')],'text':_0x50b133[_0x837f('0xa')]},'json':!![]};return rp(_0x3289b7)[_0x837f('0x1c')](function(_0x35db13){if(_0x35db13[_0x837f('0x6e')]==0xca){_0x48ddbf[_0x837f('0x6f')]=_0x35db13;var _0x278ee1={'method':_0x837f('0x3a'),'uri':_0x837f('0x70'),'headers':{'Authorization':'Bearer\x20'+_0x2745f6[_0x837f('0x57')],'Content-Type':_0x837f('0x53')},'body':{'refid':_0x48ddbf[_0x837f('0x6f')][_0x837f('0x71')]},'json':!![]};return rp(_0x278ee1)[_0x837f('0x1c')](function(_0x1e0883){_0x48ddbf[_0x837f('0x72')]=_0x1e0883;var _0x552af7={'messageId':_0x48ddbf[_0x837f('0x6f')][_0x837f('0x71')],'read':!![]};return _0x475c7b[_0x837f('0x15')](_0x552af7);});}else{return logger[_0x837f('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x837f('0x2a'),_0x837f('0x6d'),util['inspect'](_0x35db13,{'showHidden':![],'depth':null}));}})[_0x837f('0x17')](function(_0x41fc30){return logger[_0x837f('0x18')](_0x837f('0x29'),_0x837f('0x2a'),_0x837f('0x6d'),util[_0x837f('0x2b')](_0x41fc30,{'showHidden':![],'depth':null}));});}else{return logger[_0x837f('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x837f('0x2a'),_0x837f('0x6d'),_0x837f('0x73'));}break;}}})['finally'](function(){_0x2063a3();});}else{_0x2063a3();}}},'charset':_0x837f('0x74'),'collate':_0x837f('0x75')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index ca9fc8d..3019fb4 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 _0x14bd=['../../config/environment','jayson/promise','client','defaults','redis','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','debug','lodash','bluebird','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x543b7e,_0x4d02d8){var _0x59cfd8=function(_0x1bfadf){while(--_0x1bfadf){_0x543b7e['push'](_0x543b7e['shift']());}};_0x59cfd8(++_0x4d02d8);}(_0x14bd,0x108));var _0xd14b=function(_0x3eb1da,_0x2a0c10){_0x3eb1da=_0x3eb1da-0x0;var _0x189f03=_0x14bd[_0x3eb1da];return _0x189f03;};'use strict';var _=require(_0xd14b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd14b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd14b('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xd14b('0x3'));var logger=require(_0xd14b('0x4'))(_0xd14b('0x5'));var config=require(_0xd14b('0x6'));var jayson=require(_0xd14b('0x7'));var client=jayson[_0xd14b('0x8')]['http']({'port':0x232a});config['redis']=_[_0xd14b('0x9')](config[_0xd14b('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd14b('0xa')]));require(_0xd14b('0xb'))[_0xd14b('0xc')](socket);function respondWithRpcPromise(_0x4439ce,_0x308b4e,_0x1cec2a){return new BPromise(function(_0x194392,_0x25aa3d){return client[_0xd14b('0xd')](_0x4439ce,_0x1cec2a)[_0xd14b('0xe')](function(_0x59d7a1){logger[_0xd14b('0xf')](_0xd14b('0x10'),_0x308b4e,'request\x20sent');logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x308b4e,_0xd14b('0x11'),JSON[_0xd14b('0x12')](_0x59d7a1));if(_0x59d7a1[_0xd14b('0x13')]){if(_0x59d7a1[_0xd14b('0x13')]['code']===0x1f4){logger[_0xd14b('0x13')](_0xd14b('0x10'),_0x308b4e,_0x59d7a1[_0xd14b('0x13')][_0xd14b('0x14')]);return _0x25aa3d(_0x59d7a1[_0xd14b('0x13')][_0xd14b('0x14')]);}logger['error'](_0xd14b('0x10'),_0x308b4e,_0x59d7a1[_0xd14b('0x13')][_0xd14b('0x14')]);return _0x194392(_0x59d7a1['error'][_0xd14b('0x14')]);}else{logger[_0xd14b('0xf')](_0xd14b('0x10'),_0x308b4e,_0xd14b('0x11'));_0x194392(_0x59d7a1[_0xd14b('0x15')]['message']);}})[_0xd14b('0x16')](function(_0x1828e8){logger[_0xd14b('0x13')](_0xd14b('0x10'),_0x308b4e,_0x1828e8);_0x25aa3d(_0x1828e8);});});}exports[_0xd14b('0x17')]=function(_0x223d2d){var _0x11056a=this;return new Promise(function(_0x1f41a8,_0x15811e){return db[_0xd14b('0x18')][_0xd14b('0x19')](_0x223d2d[_0xd14b('0x1a')],{'raw':_0x223d2d[_0xd14b('0x1b')]?_0x223d2d[_0xd14b('0x1b')][_0xd14b('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x47efa2){logger[_0xd14b('0xf')](_0xd14b('0x17'),_0x223d2d);logger[_0xd14b('0x1d')](_0xd14b('0x17'),_0x223d2d,JSON['stringify'](_0x47efa2));_0x1f41a8(_0x47efa2);})[_0xd14b('0x16')](function(_0x25703c){logger[_0xd14b('0x13')](_0xd14b('0x17'),_0x25703c[_0xd14b('0x14')],_0x223d2d);_0x15811e(_0x11056a[_0xd14b('0x13')](0x1f4,_0x25703c['message']));});});}; \ No newline at end of file +var _0x0579=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./smsMessage.socket','register','request\x20sent','debug','stringify','error','SmsMessage,\x20%s,\x20%s','message','info','result','CreateSmsMessage','SmsMessage','body','options','raw','then','catch','lodash','util','bluebird','randomstring'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x0579,0xec));var _0x9057=function(_0x4534de,_0x967871){_0x4534de=_0x4534de-0x0;var _0x20819f=_0x0579[_0x4534de];return _0x20819f;};'use strict';var _=require(_0x9057('0x0'));var util=require(_0x9057('0x1'));var moment=require('moment');var BPromise=require(_0x9057('0x2'));var rs=require(_0x9057('0x3'));var fs=require('fs');var Redis=require(_0x9057('0x4'));var db=require(_0x9057('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9057('0x6'))(_0x9057('0x7'));var config=require(_0x9057('0x8'));var jayson=require(_0x9057('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x9057('0xa')]=_[_0x9057('0xb')](config[_0x9057('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x9057('0xc'))(new Redis(config['redis']));require(_0x9057('0xd'))[_0x9057('0xe')](socket);function respondWithRpcPromise(_0x41e955,_0x5455de,_0x37573a){return new BPromise(function(_0x22a570,_0x13dcb0){return client['request'](_0x41e955,_0x37573a)['then'](function(_0x15165f){logger['info']('SmsMessage,\x20%s,\x20%s',_0x5455de,_0x9057('0xf'));logger[_0x9057('0x10')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5455de,_0x9057('0xf'),JSON[_0x9057('0x11')](_0x15165f));if(_0x15165f['error']){if(_0x15165f['error']['code']===0x1f4){logger[_0x9057('0x12')](_0x9057('0x13'),_0x5455de,_0x15165f[_0x9057('0x12')][_0x9057('0x14')]);return _0x13dcb0(_0x15165f[_0x9057('0x12')][_0x9057('0x14')]);}logger[_0x9057('0x12')]('SmsMessage,\x20%s,\x20%s',_0x5455de,_0x15165f['error'][_0x9057('0x14')]);return _0x22a570(_0x15165f[_0x9057('0x12')]['message']);}else{logger[_0x9057('0x15')](_0x9057('0x13'),_0x5455de,_0x9057('0xf'));_0x22a570(_0x15165f[_0x9057('0x16')][_0x9057('0x14')]);}})['catch'](function(_0x35cb63){logger[_0x9057('0x12')](_0x9057('0x13'),_0x5455de,_0x35cb63);_0x13dcb0(_0x35cb63);});});}exports[_0x9057('0x17')]=function(_0x7e3c23){var _0x3d5f0c=this;return new Promise(function(_0x1adc29,_0x47837c){return db[_0x9057('0x18')]['create'](_0x7e3c23[_0x9057('0x19')],{'raw':_0x7e3c23['options']?_0x7e3c23[_0x9057('0x1a')][_0x9057('0x1b')]===undefined?!![]:![]:!![]})[_0x9057('0x1c')](function(_0x3b8acc){logger[_0x9057('0x15')]('CreateSmsMessage',_0x7e3c23);logger[_0x9057('0x10')]('CreateSmsMessage',_0x7e3c23,JSON[_0x9057('0x11')](_0x3b8acc));_0x1adc29(_0x3b8acc);})[_0x9057('0x1d')](function(_0x4c1e47){logger[_0x9057('0x12')](_0x9057('0x17'),_0x4c1e47[_0x9057('0x14')],_0x7e3c23);_0x47837c(_0x3d5f0c['error'](0x1f4,_0x4c1e47[_0x9057('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index b8f5018..374fa63 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 _0x2b62=['update','register','length','smsMessage:'];(function(_0x54fcb9,_0x18a9c2){var _0x6f9e18=function(_0x52143d){while(--_0x52143d){_0x54fcb9['push'](_0x54fcb9['shift']());}};_0x6f9e18(++_0x18a9c2);}(_0x2b62,0x114));var _0x22b6=function(_0x3e4a12,_0x39b9a6){_0x3e4a12=_0x3e4a12-0x0;var _0x252e8d=_0x2b62[_0x3e4a12];return _0x252e8d;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=['save','remove',_0x22b6('0x0')];function createListener(_0x2c2957,_0x57d68a){return function(_0x71d314){_0x57d68a['emit'](_0x2c2957,_0x71d314);};}function removeListener(_0x3ced03,_0x426116){return function(){SmsMessageEvents['removeListener'](_0x3ced03,_0x426116);};}exports[_0x22b6('0x1')]=function(_0x191604){for(var _0x543eb3=0x0,_0x53a32a=events[_0x22b6('0x2')];_0x543eb3<_0x53a32a;_0x543eb3++){var _0x4faf87=events[_0x543eb3];var _0x2b7503=createListener(_0x22b6('0x3')+_0x4faf87,_0x191604);SmsMessageEvents['on'](_0x4faf87,_0x2b7503);}}; \ No newline at end of file +var _0xedc6=['save','remove','update','smsMessage:','./smsMessage.events'];(function(_0x2c6d5b,_0x158029){var _0x2a5366=function(_0x279909){while(--_0x279909){_0x2c6d5b['push'](_0x2c6d5b['shift']());}};_0x2a5366(++_0x158029);}(_0xedc6,0x1a8));var _0x6edc=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xedc6[_0xf71120];return _0xbe2fd3;};'use strict';var SmsMessageEvents=require(_0x6edc('0x0'));var events=[_0x6edc('0x1'),_0x6edc('0x2'),_0x6edc('0x3')];function createListener(_0x5c6f21,_0xe508e9){return function(_0x495bc2){_0xe508e9['emit'](_0x5c6f21,_0x495bc2);};}function removeListener(_0x5d1cdf,_0x209ac0){return function(){SmsMessageEvents['removeListener'](_0x5d1cdf,_0x209ac0);};}exports['register']=function(_0xa3bc49){for(var _0xe41a9f=0x0,_0x3d6ae4=events['length'];_0xe41a9f<_0x3d6ae4;_0xe41a9f++){var _0x424590=events[_0xe41a9f];var _0xb82688=createListener(_0x6edc('0x4')+_0x424590,_0xa3bc49);SmsMessageEvents['on'](_0x424590,_0xb82688);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 7700d7b..e5ac2cf 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 _0xc771=['/describe','describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','/:id','update','delete','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','./smsQueue.controller','get','isAuthenticated','index'];(function(_0x1906b6,_0x2cb891){var _0x351c60=function(_0x80066b){while(--_0x80066b){_0x1906b6['push'](_0x1906b6['shift']());}};_0x351c60(++_0x2cb891);}(_0xc771,0xf2));var _0x1c77=function(_0x1e1121,_0x1deb8b){_0x1e1121=_0x1e1121-0x0;var _0x490105=_0xc771[_0x1e1121];return _0x490105;};'use strict';var multer=require(_0x1c77('0x0'));var util=require('util');var path=require(_0x1c77('0x1'));var timeout=require(_0x1c77('0x2'));var express=require(_0x1c77('0x3'));var router=express['Router']();var fs_extra=require(_0x1c77('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1c77('0x5'));var config=require('../../config/environment');var controller=require(_0x1c77('0x6'));router[_0x1c77('0x7')]('/',auth[_0x1c77('0x8')](),controller[_0x1c77('0x9')]);router[_0x1c77('0x7')](_0x1c77('0xa'),auth[_0x1c77('0x8')](),controller[_0x1c77('0xb')]);router[_0x1c77('0x7')]('/:id',auth[_0x1c77('0x8')](),controller[_0x1c77('0xc')]);router[_0x1c77('0x7')](_0x1c77('0xd'),auth[_0x1c77('0x8')](),controller[_0x1c77('0xe')]);router['get'](_0x1c77('0xf'),auth['isAuthenticated'](),controller[_0x1c77('0x10')]);router[_0x1c77('0x7')](_0x1c77('0x11'),auth[_0x1c77('0x8')](),controller[_0x1c77('0x12')]);router[_0x1c77('0x13')]('/',auth[_0x1c77('0x8')](),controller['create']);router['post'](_0x1c77('0xf'),auth[_0x1c77('0x8')](),controller[_0x1c77('0x14')]);router[_0x1c77('0x13')](_0x1c77('0x11'),auth['isAuthenticated'](),controller[_0x1c77('0x15')]);router['put'](_0x1c77('0x16'),auth[_0x1c77('0x8')](),controller[_0x1c77('0x17')]);router[_0x1c77('0x18')](_0x1c77('0x16'),auth['isAuthenticated'](),controller['destroy']);router[_0x1c77('0x18')]('/:id/teams',auth[_0x1c77('0x8')](),controller[_0x1c77('0x19')]);router[_0x1c77('0x18')](_0x1c77('0x11'),auth[_0x1c77('0x8')](),controller[_0x1c77('0x1a')]);module[_0x1c77('0x1b')]=router; \ No newline at end of file +var _0xd0b2=['update','delete','destroy','/:id/teams','removeAgents','exports','multer','path','connect-timeout','Router','../../components/auth/service','isAuthenticated','index','get','/describe','/:id','show','getTeams','/:id/users','getAgents','post','create'];(function(_0x2d91f2,_0x4b56ae){var _0x1ba446=function(_0x1668e0){while(--_0x1668e0){_0x2d91f2['push'](_0x2d91f2['shift']());}};_0x1ba446(++_0x4b56ae);}(_0xd0b2,0x74));var _0x2d0b=function(_0x332c4c,_0x9a12ff){_0x332c4c=_0x332c4c-0x0;var _0x3e8d3f=_0xd0b2[_0x332c4c];return _0x3e8d3f;};'use strict';var multer=require(_0x2d0b('0x0'));var util=require('util');var path=require(_0x2d0b('0x1'));var timeout=require(_0x2d0b('0x2'));var express=require('express');var router=express[_0x2d0b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2d0b('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./smsQueue.controller');router['get']('/',auth[_0x2d0b('0x5')](),controller[_0x2d0b('0x6')]);router[_0x2d0b('0x7')](_0x2d0b('0x8'),auth[_0x2d0b('0x5')](),controller['describe']);router['get'](_0x2d0b('0x9'),auth[_0x2d0b('0x5')](),controller[_0x2d0b('0xa')]);router[_0x2d0b('0x7')]('/:id/members',auth[_0x2d0b('0x5')](),controller['getMembers']);router['get']('/:id/teams',auth[_0x2d0b('0x5')](),controller[_0x2d0b('0xb')]);router['get'](_0x2d0b('0xc'),auth[_0x2d0b('0x5')](),controller[_0x2d0b('0xd')]);router[_0x2d0b('0xe')]('/',auth[_0x2d0b('0x5')](),controller[_0x2d0b('0xf')]);router['post']('/:id/teams',auth[_0x2d0b('0x5')](),controller['addTeams']);router['post'](_0x2d0b('0xc'),auth[_0x2d0b('0x5')](),controller['addAgents']);router['put']('/:id',auth[_0x2d0b('0x5')](),controller[_0x2d0b('0x10')]);router[_0x2d0b('0x11')](_0x2d0b('0x9'),auth[_0x2d0b('0x5')](),controller[_0x2d0b('0x12')]);router[_0x2d0b('0x11')](_0x2d0b('0x13'),auth['isAuthenticated'](),controller['removeTeams']);router['delete'](_0x2d0b('0xc'),auth['isAuthenticated'](),controller[_0x2d0b('0x14')]);module[_0x2d0b('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 51b72a7..8d25a9c 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 _0xedfe=['roundrobin','sequelize','exports','STRING','ENUM','rrmemory','beepall'];(function(_0x29ca8c,_0x2b721b){var _0x16bc86=function(_0x4b713b){while(--_0x4b713b){_0x29ca8c['push'](_0x29ca8c['shift']());}};_0x16bc86(++_0x2b721b);}(_0xedfe,0xd3));var _0xeedf=function(_0x25020d,_0x5d1757){_0x25020d=_0x25020d-0x0;var _0x21daf4=_0xedfe[_0x25020d];return _0x21daf4;};'use strict';var Sequelize=require(_0xeedf('0x0'));module[_0xeedf('0x1')]={'name':{'type':Sequelize[_0xeedf('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xeedf('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xeedf('0x3')](_0xeedf('0x4'),_0xeedf('0x5'),_0xeedf('0x6'))}}; \ No newline at end of file +var _0x50e7=['exports','STRING','name','INTEGER','rrmemory','beepall','roundrobin'];(function(_0x2f365f,_0x4830a2){var _0x3266c4=function(_0x241f20){while(--_0x241f20){_0x2f365f['push'](_0x2f365f['shift']());}};_0x3266c4(++_0x4830a2);}(_0x50e7,0x19d));var _0x750e=function(_0x470805,_0x437de0){_0x470805=_0x470805-0x0;var _0x34cff0=_0x50e7[_0x470805];return _0x34cff0;};'use strict';var Sequelize=require('sequelize');module[_0x750e('0x0')]={'name':{'type':Sequelize[_0x750e('0x1')],'unique':_0x750e('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x750e('0x1')]},'timeout':{'type':Sequelize[_0x750e('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x750e('0x4'),_0x750e('0x5'),_0x750e('0x6'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index d475c10..c8e9ea2 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 _0xe67e=['clone','toString','SELECT','every','TeamId','union','compact','value','isEmpty','removeAgents','emit','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsQueue.socket','register','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','sendStatus','error','name','index','map','SmsQueue','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','UserSmsQueue','SmsQueueId','User','findAndCountAll','UserId','agent','updatedAt','format','%s/%s','SIP','smsPause','createdAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','findOrCreate','forEach','userSmsQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','SmsQueueId\x20=\x20?','length'];(function(_0x4f8909,_0x127885){var _0x8b66ef=function(_0x3b4891){while(--_0x3b4891){_0x4f8909['push'](_0x4f8909['shift']());}};_0x8b66ef(++_0x127885);}(_0xe67e,0x1ca));var _0xee67=function(_0x5f0964,_0x1d3414){_0x5f0964=_0x5f0964-0x0;var _0x15e9d3=_0xe67e[_0x5f0964];return _0x15e9d3;};'use strict';var emlformat=require(_0xee67('0x0'));var rimraf=require(_0xee67('0x1'));var zipdir=require(_0xee67('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xee67('0x3'));var moment=require(_0xee67('0x4'));var BPromise=require(_0xee67('0x5'));var Mustache=require(_0xee67('0x6'));var util=require(_0xee67('0x7'));var path=require(_0xee67('0x8'));var sox=require(_0xee67('0x9'));var csv=require('to-csv');var ejs=require(_0xee67('0xa'));var fs=require('fs');var fs_extra=require(_0xee67('0xb'));var _=require(_0xee67('0xc'));var squel=require(_0xee67('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xee67('0xe'));var toCsv=require(_0xee67('0xf'));var querystring=require('querystring');var Papa=require(_0xee67('0x10'));var Redis=require(_0xee67('0x11'));var authService=require(_0xee67('0x12'));var qs=require(_0xee67('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xee67('0x14'));var logger=require(_0xee67('0x15'))(_0xee67('0x16'));var utils=require(_0xee67('0x17'));var config=require(_0xee67('0x18'));var licenseUtil=require(_0xee67('0x19'));var db=require(_0xee67('0x1a'))['db'];config[_0xee67('0x1b')]=_[_0xee67('0x1c')](config[_0xee67('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xee67('0x1d'))(new Redis(config[_0xee67('0x1b')]));require(_0xee67('0x1e'))[_0xee67('0x1f')](socket);function respondWithStatusCode(_0x9f0d9e,_0x1692cb){_0x1692cb=_0x1692cb||0xcc;return function(_0x183cc8){if(_0x183cc8){return _0x9f0d9e['sendStatus'](_0x1692cb);}return _0x9f0d9e[_0xee67('0x20')](_0x1692cb)[_0xee67('0x21')]();};}function respondWithResult(_0x41a47b,_0x517d5d){_0x517d5d=_0x517d5d||0xc8;return function(_0x43ac2f){if(_0x43ac2f){return _0x41a47b[_0xee67('0x20')](_0x517d5d)['json'](_0x43ac2f);}};}function respondWithFilteredResult(_0x47a7c1,_0x2ffad4){return function(_0x2f6b37){if(_0x2f6b37){var _0x9aac53=typeof _0x2ffad4[_0xee67('0x22')]===_0xee67('0x23')&&typeof _0x2ffad4[_0xee67('0x24')]===_0xee67('0x23');var _0x3340ce=_0x2f6b37[_0xee67('0x25')];var _0x3e9943=_0x9aac53?0x0:_0x2ffad4[_0xee67('0x22')];var _0x239ac0=_0x9aac53?_0x2f6b37[_0xee67('0x25')]:_0x2ffad4[_0xee67('0x22')]+_0x2ffad4[_0xee67('0x24')];var _0x5972ba;if(_0x239ac0>=_0x3340ce){_0x239ac0=_0x3340ce;_0x5972ba=0xc8;}else{_0x5972ba=0xce;}_0x47a7c1[_0xee67('0x20')](_0x5972ba);return _0x47a7c1[_0xee67('0x26')](_0xee67('0x27'),_0x3e9943+'-'+_0x239ac0+'/'+_0x3340ce)[_0xee67('0x28')](_0x2f6b37);}return null;};}function patchUpdates(_0x3d09d5){return function(_0x45e27c){try{jsonpatch[_0xee67('0x29')](_0x45e27c,_0x3d09d5,!![]);}catch(_0x408184){return BPromise[_0xee67('0x2a')](_0x408184);}return _0x45e27c[_0xee67('0x2b')]();};}function saveUpdates(_0x232a8c,_0xe9cbf9){return function(_0x27f14c){if(_0x27f14c){return _0x27f14c[_0xee67('0x2c')](_0x232a8c)[_0xee67('0x2d')](function(_0x10f01b){return _0x10f01b;});}return null;};}function removeEntity(_0x11dfb4,_0x2ab7a6){return function(_0x1ab6f5){if(_0x1ab6f5){return _0x1ab6f5[_0xee67('0x2e')]()[_0xee67('0x2d')](function(){var _0x596d92=_0x1ab6f5[_0xee67('0x2f')]({'plain':!![]});var _0x7fadf3=_0xee67('0x30');return db[_0xee67('0x31')][_0xee67('0x2e')]({'where':{'type':_0x7fadf3,'resourceId':_0x596d92['id']}})[_0xee67('0x2d')](function(){return _0x1ab6f5;});})[_0xee67('0x2d')](function(){_0x11dfb4[_0xee67('0x20')](0xcc)[_0xee67('0x21')]();});}};}function handleEntityNotFound(_0x18c518,_0x52b3fb){return function(_0x248cf1){if(!_0x248cf1){_0x18c518[_0xee67('0x32')](0x194);}return _0x248cf1;};}function handleError(_0x31d45d,_0x3ea1cc){_0x3ea1cc=_0x3ea1cc||0x1f4;return function(_0x1115c5){logger[_0xee67('0x33')](_0x1115c5['stack']);if(_0x1115c5[_0xee67('0x34')]){delete _0x1115c5['name'];}_0x31d45d[_0xee67('0x20')](_0x3ea1cc)['send'](_0x1115c5);};}exports[_0xee67('0x35')]=function(_0x908327,_0x2c476b){var _0x83424={},_0x395e6a={},_0x45c69a={'count':0x0,'rows':[]};var _0x34df0f=_[_0xee67('0x36')](db[_0xee67('0x37')][_0xee67('0x38')],function(_0x44622b){return{'name':_0x44622b[_0xee67('0x39')],'type':_0x44622b['type'][_0xee67('0x3a')]};});_0x395e6a[_0xee67('0x3b')]=_['map'](_0x34df0f,_0xee67('0x34'));_0x395e6a[_0xee67('0x3c')]=_['keys'](_0x908327[_0xee67('0x3c')]);_0x395e6a[_0xee67('0x3d')]=_[_0xee67('0x3e')](_0x395e6a[_0xee67('0x3b')],_0x395e6a[_0xee67('0x3c')]);_0x83424['attributes']=_[_0xee67('0x3e')](_0x395e6a[_0xee67('0x3b')],qs[_0xee67('0x3f')](_0x908327['query'][_0xee67('0x3f')]));_0x83424['attributes']=_0x83424[_0xee67('0x40')]['length']?_0x83424[_0xee67('0x40')]:_0x395e6a[_0xee67('0x3b')];if(!_0x908327['query'][_0xee67('0x41')](_0xee67('0x42'))){_0x83424[_0xee67('0x24')]=qs['limit'](_0x908327[_0xee67('0x3c')]['limit']);_0x83424[_0xee67('0x22')]=qs[_0xee67('0x22')](_0x908327[_0xee67('0x3c')][_0xee67('0x22')]);}_0x83424[_0xee67('0x43')]=qs[_0xee67('0x44')](_0x908327[_0xee67('0x3c')][_0xee67('0x44')]);_0x83424[_0xee67('0x45')]=qs[_0xee67('0x3d')](_[_0xee67('0x46')](_0x908327[_0xee67('0x3c')],_0x395e6a[_0xee67('0x3d')]),_0x34df0f);if(_0x908327[_0xee67('0x3c')][_0xee67('0x47')]){_0x83424['where']=_[_0xee67('0x48')](_0x83424['where'],{'$or':_['map'](_0x34df0f,function(_0x217182){if(_0x217182[_0xee67('0x49')]!==_0xee67('0x4a')){var _0x67aff7={};_0x67aff7[_0x217182[_0xee67('0x34')]]={'$like':'%'+_0x908327[_0xee67('0x3c')][_0xee67('0x47')]+'%'};return _0x67aff7;}})});}_0x83424=_[_0xee67('0x48')]({},_0x83424,_0x908327[_0xee67('0x4b')]);var _0x446c1f={'where':_0x83424['where']};return db[_0xee67('0x37')]['count'](_0x446c1f)[_0xee67('0x2d')](function(_0x553cc9){_0x45c69a['count']=_0x553cc9;if(_0x908327['query'][_0xee67('0x4c')]){_0x83424[_0xee67('0x4d')]=[{'all':!![]}];}return db[_0xee67('0x37')][_0xee67('0x4e')](_0x83424);})[_0xee67('0x2d')](function(_0x5b3983){_0x45c69a[_0xee67('0x4f')]=_0x5b3983;return _0x45c69a;})[_0xee67('0x2d')](respondWithFilteredResult(_0x2c476b,_0x83424))[_0xee67('0x50')](handleError(_0x2c476b,null));};exports[_0xee67('0x51')]=function(_0x91d304,_0x3c2f0c){var _0x5288d8={'raw':!![],'where':{'id':_0x91d304['params']['id']}},_0x571ecf={};_0x571ecf[_0xee67('0x3b')]=_[_0xee67('0x52')](db[_0xee67('0x37')][_0xee67('0x38')]);_0x571ecf[_0xee67('0x3c')]=_[_0xee67('0x52')](_0x91d304[_0xee67('0x3c')]);_0x571ecf[_0xee67('0x3d')]=_['intersection'](_0x571ecf[_0xee67('0x3b')],_0x571ecf[_0xee67('0x3c')]);_0x5288d8['attributes']=_[_0xee67('0x3e')](_0x571ecf['model'],qs[_0xee67('0x3f')](_0x91d304[_0xee67('0x3c')][_0xee67('0x3f')]));_0x5288d8[_0xee67('0x40')]=_0x5288d8['attributes']['length']?_0x5288d8['attributes']:_0x571ecf[_0xee67('0x3b')];if(_0x91d304[_0xee67('0x3c')]['includeAll']){_0x5288d8[_0xee67('0x4d')]=[{'all':!![]}];}_0x5288d8=_['merge']({},_0x5288d8,_0x91d304[_0xee67('0x4b')]);return db[_0xee67('0x37')][_0xee67('0x53')](_0x5288d8)[_0xee67('0x2d')](handleEntityNotFound(_0x3c2f0c,null))[_0xee67('0x2d')](respondWithResult(_0x3c2f0c,null))[_0xee67('0x50')](handleError(_0x3c2f0c,null));};exports[_0xee67('0x54')]=function(_0x3d756d,_0x6d304){return db['SmsQueue']['create'](_0x3d756d[_0xee67('0x55')],{})[_0xee67('0x2d')](function(_0x1cbd7b){var _0x30f6f8=_0x3d756d[_0xee67('0x56')][_0xee67('0x2f')]({'plain':!![]});if(!_0x30f6f8)throw new Error(_0xee67('0x57'));if(_0x30f6f8[_0xee67('0x58')]===_0xee67('0x56')){var _0x30844e=_0x1cbd7b[_0xee67('0x2f')]({'plain':!![]});var _0x12e609=_0xee67('0x30');return db[_0xee67('0x59')][_0xee67('0x53')]({'where':{'name':_0x12e609,'userProfileId':_0x30f6f8['userProfileId']},'raw':!![]})[_0xee67('0x2d')](function(_0x21d9a1){if(_0x21d9a1&&_0x21d9a1[_0xee67('0x5a')]===0x0){return db[_0xee67('0x31')][_0xee67('0x54')]({'name':_0x30844e[_0xee67('0x34')],'resourceId':_0x30844e['id'],'type':_0x21d9a1[_0xee67('0x34')],'sectionId':_0x21d9a1['id']},{})['then'](function(){return _0x1cbd7b;});}else{return _0x1cbd7b;}})[_0xee67('0x50')](function(_0x5cc6e3){logger[_0xee67('0x33')](_0xee67('0x5b'),_0x5cc6e3);throw _0x5cc6e3;});}return _0x1cbd7b;})[_0xee67('0x2d')](respondWithResult(_0x6d304,0xc9))[_0xee67('0x50')](handleError(_0x6d304,null));};exports[_0xee67('0x2c')]=function(_0x3dffe9,_0x3eb749){if(_0x3dffe9['body']['id']){delete _0x3dffe9['body']['id'];}return db[_0xee67('0x37')][_0xee67('0x53')]({'where':{'id':_0x3dffe9[_0xee67('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3eb749,null))[_0xee67('0x2d')](saveUpdates(_0x3dffe9['body'],null))['then'](respondWithResult(_0x3eb749,null))[_0xee67('0x50')](handleError(_0x3eb749,null));};exports[_0xee67('0x2e')]=function(_0x8b7c05,_0xbd047e){return db['SmsQueue']['find']({'where':{'id':_0x8b7c05['params']['id']}})[_0xee67('0x2d')](handleEntityNotFound(_0xbd047e,null))[_0xee67('0x2d')](removeEntity(_0xbd047e,null))['catch'](handleError(_0xbd047e,null));};exports[_0xee67('0x5d')]=function(_0x11f15e,_0x57ec00){return db[_0xee67('0x37')][_0xee67('0x5d')]()[_0xee67('0x2d')](respondWithResult(_0x57ec00,null))['catch'](handleError(_0x57ec00,null));};exports['getMembers']=function(_0x5626a7,_0x4fd855,_0x31e36c){var _0x53d84d={'raw':!![],'where':{}},_0x5784b3={},_0x5078f3;return db[_0xee67('0x37')][_0xee67('0x5e')]({'where':{'id':_0x5626a7[_0xee67('0x5c')]['id']}})[_0xee67('0x2d')](handleEntityNotFound(_0x4fd855,null))[_0xee67('0x2d')](function(_0x11d10a){if(_0x11d10a){_0x5078f3=_0x11d10a[_0xee67('0x2f')]({'plain':!![]});_0x5784b3[_0xee67('0x3b')]=_['keys'](db[_0xee67('0x5f')][_0xee67('0x38')]);_0x5784b3[_0xee67('0x3c')]=_[_0xee67('0x52')](_0x5626a7[_0xee67('0x3c')]);_0x5784b3['filters']=_['intersection'](_0x5784b3[_0xee67('0x3b')],_0x5784b3[_0xee67('0x3c')]);_0x53d84d[_0xee67('0x40')]=_[_0xee67('0x3e')](_0x5784b3['model'],qs['fields'](_0x5626a7['query'][_0xee67('0x3f')]));_0x53d84d[_0xee67('0x40')]=_0x53d84d[_0xee67('0x40')]['length']?_0x53d84d[_0xee67('0x40')]:_0x5784b3[_0xee67('0x3b')];if(!_0x5626a7[_0xee67('0x3c')][_0xee67('0x41')](_0xee67('0x42'))){_0x53d84d[_0xee67('0x24')]=qs['limit'](_0x5626a7[_0xee67('0x3c')][_0xee67('0x24')]);_0x53d84d[_0xee67('0x22')]=qs['offset'](_0x5626a7['query']['offset']);}_0x53d84d[_0xee67('0x43')]=qs[_0xee67('0x44')](_0x5626a7['query']['sort']);_0x53d84d[_0xee67('0x45')]=qs[_0xee67('0x3d')](_['pick'](_0x5626a7[_0xee67('0x3c')],_0x5784b3['filters']));_0x53d84d['where'][_0xee67('0x60')]=_0x11d10a['id'];if(_0x5626a7[_0xee67('0x3c')]['filter']){_0x53d84d['where']=_[_0xee67('0x48')](_0x53d84d['where'],{'$or':_[_0xee67('0x36')](_0x53d84d[_0xee67('0x40')],function(_0x25278b){var _0x3b02ff={};_0x3b02ff[_0x25278b]={'$like':'%'+_0x5626a7[_0xee67('0x3c')]['filter']+'%'};return _0x3b02ff;})});}_0x53d84d=_['merge']({},_0x53d84d,_0x5626a7[_0xee67('0x4b')]);return db[_0xee67('0x5f')][_0xee67('0x4e')](_0x53d84d);}})['then'](function(_0x1a3bb0){if(_0x1a3bb0){return db[_0xee67('0x61')][_0xee67('0x62')]({'where':{'id':_['map'](_0x1a3bb0,_0xee67('0x63')),'role':_0xee67('0x64')},'attributes':['id',_0xee67('0x34'),'smsPause',_0xee67('0x65'),'createdAt']});}})[_0xee67('0x2d')](function(_0x75200b){if(_0x75200b){return{'count':_0x75200b['count'],'rows':_[_0xee67('0x36')](_0x75200b[_0xee67('0x4f')],function(_0x3d8884){return{'membername':_0x3d8884[_0xee67('0x34')],'UserId':_0x3d8884['id'],'queue_name':_0x5078f3[_0xee67('0x34')],'SmsQueueId':_0x5078f3['id'],'interface':util[_0xee67('0x66')](_0xee67('0x67'),_0xee67('0x68'),_0x3d8884[_0xee67('0x34')]),'penalty':0x0,'paused':_0x3d8884[_0xee67('0x69')],'createdAt':_0x3d8884[_0xee67('0x6a')],'updatedAt':_0x3d8884[_0xee67('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4fd855,_0x53d84d))[_0xee67('0x50')](handleError(_0x4fd855,null));};exports[_0xee67('0x6b')]=function(_0x2b43b6,_0x3ac075,_0x225deb){var _0xbb948f={};var _0x2ec6c5={};var _0x59a16b;var _0x1ccc35;return db[_0xee67('0x37')]['findOne']({'where':{'id':_0x2b43b6['params']['id']}})[_0xee67('0x2d')](handleEntityNotFound(_0x3ac075,null))[_0xee67('0x2d')](function(_0x56c778){if(_0x56c778){_0x59a16b=_0x56c778;_0x2ec6c5[_0xee67('0x3b')]=_[_0xee67('0x52')](db[_0xee67('0x6c')][_0xee67('0x38')]);_0x2ec6c5[_0xee67('0x3c')]=_[_0xee67('0x52')](_0x2b43b6[_0xee67('0x3c')]);_0x2ec6c5[_0xee67('0x3d')]=_[_0xee67('0x3e')](_0x2ec6c5[_0xee67('0x3b')],_0x2ec6c5[_0xee67('0x3c')]);_0xbb948f[_0xee67('0x40')]=_[_0xee67('0x3e')](_0x2ec6c5['model'],qs['fields'](_0x2b43b6[_0xee67('0x3c')][_0xee67('0x3f')]));_0xbb948f['attributes']=_0xbb948f[_0xee67('0x40')]['length']?_0xbb948f['attributes']:_0x2ec6c5[_0xee67('0x3b')];_0xbb948f['order']=qs['sort'](_0x2b43b6[_0xee67('0x3c')][_0xee67('0x44')]);_0xbb948f[_0xee67('0x45')]=qs['filters'](_[_0xee67('0x46')](_0x2b43b6['query'],_0x2ec6c5['filters']));if(_0x2b43b6['query'][_0xee67('0x47')]){_0xbb948f[_0xee67('0x45')]=_[_0xee67('0x48')](_0xbb948f[_0xee67('0x45')],{'$or':_['map'](_0xbb948f[_0xee67('0x40')],function(_0x521319){var _0x2ae7f7={};_0x2ae7f7[_0x521319]={'$like':'%'+_0x2b43b6[_0xee67('0x3c')]['filter']+'%'};return _0x2ae7f7;})});}_0xbb948f=_['merge']({},_0xbb948f,_0x2b43b6[_0xee67('0x4b')]);return _0x59a16b[_0xee67('0x6b')](_0xbb948f);}})[_0xee67('0x2d')](function(_0x3ec281){if(_0x3ec281){_0x1ccc35=_0x3ec281['length'];if(!_0x2b43b6[_0xee67('0x3c')]['hasOwnProperty'](_0xee67('0x42'))){_0xbb948f[_0xee67('0x24')]=qs[_0xee67('0x24')](_0x2b43b6[_0xee67('0x3c')][_0xee67('0x24')]);_0xbb948f[_0xee67('0x22')]=qs[_0xee67('0x22')](_0x2b43b6['query'][_0xee67('0x22')]);}return _0x59a16b[_0xee67('0x6b')](_0xbb948f);}})['then'](function(_0x38ab3a){if(_0x38ab3a){return _0x38ab3a?{'count':_0x1ccc35,'rows':_0x38ab3a}:null;}})[_0xee67('0x2d')](respondWithResult(_0x3ac075,null))[_0xee67('0x50')](handleError(_0x3ac075,null));};exports[_0xee67('0x6d')]=function(_0xd9d1cc,_0x33ecb1,_0x57ed00){var _0x10b35d=_0xd9d1cc[_0xee67('0x55')][_0xee67('0x6e')];return db[_0xee67('0x6c')][_0xee67('0x4e')]({'where':{'id':_0x10b35d},'attributes':['id'],'include':[{'model':db[_0xee67('0x61')],'as':_0xee67('0x6f'),'attributes':['id',_0xee67('0x34'),_0xee67('0x70'),_0xee67('0x71'),_0xee67('0x72')],'raw':!![]}]})[_0xee67('0x2d')](function(_0x1af00c){if(_0x1af00c){var _0x5b382a=_['flatMap'](_0x1af00c,function(_0x45da09){var _0x2426d8=_0x45da09[_0xee67('0x2f')]({'plain':!![]});return _0x2426d8[_0xee67('0x6f')];});return db[_0xee67('0x37')][_0xee67('0x53')]({'where':{'id':_0xd9d1cc[_0xee67('0x5c')]['id']}})[_0xee67('0x2d')](function(_0x490b1f){return db[_0xee67('0x73')][_0xee67('0x74')](function(_0x3fc207){return _0x490b1f[_0xee67('0x6d')](_0x10b35d,{'transaction':_0x3fc207})[_0xee67('0x2d')](function(){return BPromise['each'](_0x5b382a,function(_0x4ebfc1){return db[_0xee67('0x5f')][_0xee67('0x75')]({'where':{'UserId':_0x4ebfc1['id'],'SmsQueueId':_0xd9d1cc[_0xee67('0x5c')]['id']},'transaction':_0x3fc207});});})[_0xee67('0x2d')](function(){_0x5b382a[_0xee67('0x76')](function(_0xdde3ed){socket['emit'](_0xee67('0x77'),{'UserId':_0xdde3ed['id'],'SmsQueueId':_0x490b1f['id']});});});});});}})[_0xee67('0x2d')](respondWithStatusCode(_0x33ecb1,null))[_0xee67('0x50')](handleError(_0x33ecb1,null));};exports[_0xee67('0x78')]=function(_0x35b750,_0x2f58ae,_0x3f71b1){return db[_0xee67('0x6c')][_0xee67('0x4e')]({'where':{'id':_0x35b750[_0xee67('0x3c')][_0xee67('0x6e')]},'attributes':['id'],'include':[{'model':db[_0xee67('0x61')],'as':_0xee67('0x6f'),'attributes':['id'],'raw':!![]}]})[_0xee67('0x2d')](handleEntityNotFound(_0x2f58ae,null))[_0xee67('0x2d')](function(_0x5f3227){var _0x15ae2a=_['map'](_0x5f3227,'id');var _0x3036b0=[];var _0x350ad2=[];var _0x2f7d03=squel[_0xee67('0x79')]();_0x2f7d03[_0xee67('0x7a')](_0xee67('0x7b'))[_0xee67('0x7c')](_0xee67('0x7d'),'tq')[_0xee67('0x7e')](_0xee67('0x7f'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xee67('0x80'),_0x35b750[_0xee67('0x5c')]['id']);for(var _0x2cc2f2=0x0;_0x2cc2f2<_0x5f3227[_0xee67('0x81')];_0x2cc2f2+=0x1){let _0x3c4901=_0x5f3227[_0x2cc2f2];for(var _0xedc8be=0x0;_0xedc8be<_0x3c4901[_0xee67('0x6f')][_0xee67('0x81')];_0xedc8be+=0x1){let _0x3199a6=_0x3c4901[_0xee67('0x6f')][_0xedc8be];var _0x3c6ee0=_0x2f7d03[_0xee67('0x82')]();_0x3c6ee0[_0xee67('0x45')]('ut.UserId\x20=\x20?',_0x3199a6['id']);_0x350ad2['push'](db[_0xee67('0x73')]['query'](_0x3c6ee0[_0xee67('0x83')](),{'type':db[_0xee67('0x73')]['QueryTypes'][_0xee67('0x84')]})[_0xee67('0x2d')](function(_0x477f1e){if(_0x477f1e[_0xee67('0x81')]===0x1){return _0x3199a6['id'];}else{var _0x3899dc=_[_0xee67('0x85')](_['map'](_0x477f1e,_0xee67('0x86')),function(_0x297e86){return _['includes'](_0x15ae2a,_0x297e86);});if(_0x3899dc){return _0x3199a6['id'];}}}));}}return BPromise['all'](_0x350ad2)[_0xee67('0x2d')](function(_0x153331){_0x3036b0=_(_0x3036b0)[_0xee67('0x87')](_0x153331)[_0xee67('0x88')]()[_0xee67('0x89')]();return db[_0xee67('0x37')][_0xee67('0x53')]({'where':{'id':_0x35b750[_0xee67('0x5c')]['id']}})['then'](function(_0x219cfd){return db[_0xee67('0x73')]['transaction'](function(_0x4d2b3c){return _0x219cfd['removeTeams'](_0x35b750[_0xee67('0x3c')][_0xee67('0x6e')],{'transaction':_0x4d2b3c})[_0xee67('0x2d')](function(){if(!_[_0xee67('0x8a')](_0x3036b0)){return _0x219cfd[_0xee67('0x8b')](_0x3036b0,{'transaction':_0x4d2b3c});}})['then'](function(){_0x3036b0[_0xee67('0x76')](function(_0x57b33d){socket[_0xee67('0x8c')](_0xee67('0x8d'),{'UserId':_0x57b33d,'SmsQueueId':_0x219cfd['id']});});});});});});})['then'](respondWithStatusCode(_0x2f58ae,null))[_0xee67('0x50')](handleError(_0x2f58ae,null));};exports[_0xee67('0x8e')]=function(_0x567101,_0x44a735,_0x159146){return db['SmsQueue'][_0xee67('0x53')]({'where':{'id':_0x567101[_0xee67('0x5c')]['id']}})[_0xee67('0x2d')](handleEntityNotFound(_0x44a735,null))[_0xee67('0x2d')](function(_0x3dd1eb){if(_0x3dd1eb){return _0x3dd1eb[_0xee67('0x8e')](_0x567101['body'][_0xee67('0x6e')],_[_0xee67('0x8f')](_0x567101[_0xee67('0x55')],[_0xee67('0x6e'),'id'])||{})[_0xee67('0x90')](function(_0x3404fd){for(var _0x3fd4f7=0x0;_0x3fd4f7<_0x567101[_0xee67('0x55')][_0xee67('0x6e')][_0xee67('0x81')];_0x3fd4f7+=0x1){socket[_0xee67('0x8c')](_0xee67('0x77'),{'UserId':Number(_0x567101['body'][_0xee67('0x6e')][_0x3fd4f7]),'SmsQueueId':Number(_0x567101[_0xee67('0x5c')]['id'])});}return _0x3404fd;});}})[_0xee67('0x2d')](respondWithResult(_0x44a735,null))[_0xee67('0x50')](handleError(_0x44a735,null));};exports[_0xee67('0x8b')]=function(_0x36682b,_0x146f3b,_0x410d97){return db[_0xee67('0x37')]['find']({'where':{'id':_0x36682b[_0xee67('0x5c')]['id']}})['then'](handleEntityNotFound(_0x146f3b,null))[_0xee67('0x2d')](function(_0x5ac834){if(_0x5ac834){return _0x5ac834[_0xee67('0x8b')](_0x36682b['query'][_0xee67('0x6e')])['then'](function(){if(_[_0xee67('0x91')](_0x36682b['query'][_0xee67('0x6e')])){for(var _0x1c6749=0x0;_0x1c6749<_0x36682b[_0xee67('0x3c')][_0xee67('0x6e')][_0xee67('0x81')];_0x1c6749+=0x1){socket[_0xee67('0x8c')](_0xee67('0x8d'),{'UserId':Number(_0x36682b[_0xee67('0x3c')][_0xee67('0x6e')][_0x1c6749]),'SmsQueueId':Number(_0x36682b['params']['id'])});}}else{socket[_0xee67('0x8c')](_0xee67('0x8d'),{'UserId':Number(_0x36682b['query']['ids']),'SmsQueueId':Number(_0x36682b[_0xee67('0x5c')]['id'])});}});}})[_0xee67('0x2d')](respondWithStatusCode(_0x146f3b,null))['catch'](handleError(_0x146f3b,null));};exports[_0xee67('0x92')]=function(_0x381043,_0x4d3c34,_0x156e6c){var _0x1e2c68={};var _0x3ca51a={};var _0x29f5d9;var _0x57a5bc;return db[_0xee67('0x37')][_0xee67('0x5e')]({'where':{'id':_0x381043['params']['id']}})[_0xee67('0x2d')](handleEntityNotFound(_0x4d3c34,null))[_0xee67('0x2d')](function(_0x40ceb9){if(_0x40ceb9){_0x29f5d9=_0x40ceb9;_0x3ca51a[_0xee67('0x3b')]=_[_0xee67('0x52')](db[_0xee67('0x61')]['rawAttributes']);_0x3ca51a[_0xee67('0x3c')]=_['keys'](_0x381043['query']);_0x3ca51a[_0xee67('0x3d')]=_[_0xee67('0x3e')](_0x3ca51a[_0xee67('0x3b')],_0x3ca51a['query']);_0x1e2c68[_0xee67('0x40')]=_[_0xee67('0x3e')](_0x3ca51a[_0xee67('0x3b')],qs[_0xee67('0x3f')](_0x381043['query'][_0xee67('0x3f')]));_0x1e2c68[_0xee67('0x40')]=_0x1e2c68['attributes'][_0xee67('0x81')]?_0x1e2c68['attributes']:_0x3ca51a['model'];_0x1e2c68[_0xee67('0x43')]=qs['sort'](_0x381043[_0xee67('0x3c')][_0xee67('0x44')]);_0x1e2c68[_0xee67('0x45')]=qs['filters'](_['pick'](_0x381043['query'],_0x3ca51a[_0xee67('0x3d')]));if(_0x381043[_0xee67('0x3c')]['filter']){_0x1e2c68['where']=_[_0xee67('0x48')](_0x1e2c68['where'],{'$or':_[_0xee67('0x36')](_0x1e2c68['attributes'],function(_0xba416b){var _0x408df9={};_0x408df9[_0xba416b]={'$like':'%'+_0x381043[_0xee67('0x3c')][_0xee67('0x47')]+'%'};return _0x408df9;})});}_0x1e2c68=_[_0xee67('0x48')]({},_0x1e2c68,_0x381043['options']);return _0x29f5d9['getAgents'](_0x1e2c68);}})[_0xee67('0x2d')](function(_0x43a664){if(_0x43a664){_0x57a5bc=_0x43a664[_0xee67('0x81')];if(!_0x381043[_0xee67('0x3c')]['hasOwnProperty']('nolimit')){_0x1e2c68[_0xee67('0x24')]=qs[_0xee67('0x24')](_0x381043['query'][_0xee67('0x24')]);_0x1e2c68['offset']=qs[_0xee67('0x22')](_0x381043[_0xee67('0x3c')][_0xee67('0x22')]);}return _0x29f5d9[_0xee67('0x92')](_0x1e2c68);}})[_0xee67('0x2d')](function(_0x4eb6e2){if(_0x4eb6e2){return _0x4eb6e2?{'count':_0x57a5bc,'rows':_0x4eb6e2}:null;}})[_0xee67('0x2d')](respondWithResult(_0x4d3c34,null))[_0xee67('0x50')](handleError(_0x4d3c34,null));}; \ No newline at end of file +var _0x0b4b=['Content-Range','reject','update','then','get','UserProfileResource','destroy','stack','name','index','map','model','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','SmsQueue','count','includeAll','include','findAll','rows','catch','show','keys','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsQueues','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','findOne','UserSmsQueue','rawAttributes','SmsQueueId','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','getTeams','addTeams','ids','Team','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','field','tq.TeamId','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','push','toString','QueryTypes','every','all','union','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','eml-format','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','set'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x0b4b,0x16a));var _0xb0b4=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0x0b4b[_0x166742];return _0xb7814a;};'use strict';var emlformat=require(_0xb0b4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb0b4('0x1'));var jsonpatch=require(_0xb0b4('0x2'));var rp=require('request-promise');var moment=require(_0xb0b4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb0b4('0x4'));var util=require('util');var path=require(_0xb0b4('0x5'));var sox=require(_0xb0b4('0x6'));var csv=require(_0xb0b4('0x7'));var ejs=require(_0xb0b4('0x8'));var fs=require('fs');var fs_extra=require(_0xb0b4('0x9'));var _=require(_0xb0b4('0xa'));var squel=require(_0xb0b4('0xb'));var crypto=require(_0xb0b4('0xc'));var jsforce=require(_0xb0b4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb0b4('0x7'));var querystring=require(_0xb0b4('0xe'));var Papa=require('papaparse');var Redis=require(_0xb0b4('0xf'));var authService=require(_0xb0b4('0x10'));var qs=require(_0xb0b4('0x11'));var as=require(_0xb0b4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb0b4('0x13'))(_0xb0b4('0x14'));var utils=require(_0xb0b4('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb0b4('0x16'))['db'];config[_0xb0b4('0x17')]=_[_0xb0b4('0x18')](config['redis'],{'host':_0xb0b4('0x19'),'port':0x18eb});var socket=require(_0xb0b4('0x1a'))(new Redis(config[_0xb0b4('0x17')]));require(_0xb0b4('0x1b'))[_0xb0b4('0x1c')](socket);function respondWithStatusCode(_0x1b71fa,_0x1627cf){_0x1627cf=_0x1627cf||0xcc;return function(_0x2f864b){if(_0x2f864b){return _0x1b71fa[_0xb0b4('0x1d')](_0x1627cf);}return _0x1b71fa[_0xb0b4('0x1e')](_0x1627cf)[_0xb0b4('0x1f')]();};}function respondWithResult(_0x580ea4,_0x5d3252){_0x5d3252=_0x5d3252||0xc8;return function(_0x38bc91){if(_0x38bc91){return _0x580ea4['status'](_0x5d3252)[_0xb0b4('0x20')](_0x38bc91);}};}function respondWithFilteredResult(_0x32bf88,_0x2b8dad){return function(_0x225179){if(_0x225179){var _0x3a3daa=typeof _0x2b8dad[_0xb0b4('0x21')]==='undefined'&&typeof _0x2b8dad[_0xb0b4('0x22')]===_0xb0b4('0x23');var _0x2786ae=_0x225179['count'];var _0x5af140=_0x3a3daa?0x0:_0x2b8dad[_0xb0b4('0x21')];var _0x456a52=_0x3a3daa?_0x225179['count']:_0x2b8dad['offset']+_0x2b8dad['limit'];var _0x2c69f6;if(_0x456a52>=_0x2786ae){_0x456a52=_0x2786ae;_0x2c69f6=0xc8;}else{_0x2c69f6=0xce;}_0x32bf88['status'](_0x2c69f6);return _0x32bf88[_0xb0b4('0x24')](_0xb0b4('0x25'),_0x5af140+'-'+_0x456a52+'/'+_0x2786ae)[_0xb0b4('0x20')](_0x225179);}return null;};}function patchUpdates(_0x50aae4){return function(_0x1d24c4){try{jsonpatch['apply'](_0x1d24c4,_0x50aae4,!![]);}catch(_0x284cb2){return BPromise[_0xb0b4('0x26')](_0x284cb2);}return _0x1d24c4['save']();};}function saveUpdates(_0x593d23,_0x436871){return function(_0x45f012){if(_0x45f012){return _0x45f012[_0xb0b4('0x27')](_0x593d23)[_0xb0b4('0x28')](function(_0x25739e){return _0x25739e;});}return null;};}function removeEntity(_0x4aa328,_0x19eda7){return function(_0x1c3f24){if(_0x1c3f24){return _0x1c3f24['destroy']()[_0xb0b4('0x28')](function(){var _0x2f1250=_0x1c3f24[_0xb0b4('0x29')]({'plain':!![]});var _0x3e455d='SmsQueues';return db[_0xb0b4('0x2a')][_0xb0b4('0x2b')]({'where':{'type':_0x3e455d,'resourceId':_0x2f1250['id']}})['then'](function(){return _0x1c3f24;});})[_0xb0b4('0x28')](function(){_0x4aa328[_0xb0b4('0x1e')](0xcc)[_0xb0b4('0x1f')]();});}};}function handleEntityNotFound(_0x247d8b,_0x107023){return function(_0xf3791f){if(!_0xf3791f){_0x247d8b[_0xb0b4('0x1d')](0x194);}return _0xf3791f;};}function handleError(_0x240d6a,_0x408c36){_0x408c36=_0x408c36||0x1f4;return function(_0x334dca){logger['error'](_0x334dca[_0xb0b4('0x2c')]);if(_0x334dca['name']){delete _0x334dca[_0xb0b4('0x2d')];}_0x240d6a[_0xb0b4('0x1e')](_0x408c36)['send'](_0x334dca);};}exports[_0xb0b4('0x2e')]=function(_0x3acefd,_0x332f85){var _0x2c8bcd={},_0x5330bb={},_0x334368={'count':0x0,'rows':[]};var _0x43df28=_[_0xb0b4('0x2f')](db['SmsQueue']['rawAttributes'],function(_0xb92feb){return{'name':_0xb92feb['fieldName'],'type':_0xb92feb['type']['key']};});_0x5330bb[_0xb0b4('0x30')]=_['map'](_0x43df28,'name');_0x5330bb['query']=_['keys'](_0x3acefd['query']);_0x5330bb[_0xb0b4('0x31')]=_['intersection'](_0x5330bb[_0xb0b4('0x30')],_0x5330bb[_0xb0b4('0x32')]);_0x2c8bcd[_0xb0b4('0x33')]=_[_0xb0b4('0x34')](_0x5330bb['model'],qs[_0xb0b4('0x35')](_0x3acefd['query']['fields']));_0x2c8bcd[_0xb0b4('0x33')]=_0x2c8bcd[_0xb0b4('0x33')][_0xb0b4('0x36')]?_0x2c8bcd[_0xb0b4('0x33')]:_0x5330bb[_0xb0b4('0x30')];if(!_0x3acefd[_0xb0b4('0x32')][_0xb0b4('0x37')](_0xb0b4('0x38'))){_0x2c8bcd[_0xb0b4('0x22')]=qs[_0xb0b4('0x22')](_0x3acefd[_0xb0b4('0x32')][_0xb0b4('0x22')]);_0x2c8bcd['offset']=qs[_0xb0b4('0x21')](_0x3acefd[_0xb0b4('0x32')][_0xb0b4('0x21')]);}_0x2c8bcd[_0xb0b4('0x39')]=qs[_0xb0b4('0x3a')](_0x3acefd[_0xb0b4('0x32')][_0xb0b4('0x3a')]);_0x2c8bcd[_0xb0b4('0x3b')]=qs[_0xb0b4('0x31')](_[_0xb0b4('0x3c')](_0x3acefd[_0xb0b4('0x32')],_0x5330bb[_0xb0b4('0x31')]),_0x43df28);if(_0x3acefd[_0xb0b4('0x32')][_0xb0b4('0x3d')]){_0x2c8bcd[_0xb0b4('0x3b')]=_[_0xb0b4('0x3e')](_0x2c8bcd[_0xb0b4('0x3b')],{'$or':_[_0xb0b4('0x2f')](_0x43df28,function(_0x26fa23){if(_0x26fa23[_0xb0b4('0x3f')]!==_0xb0b4('0x40')){var _0x37cd3a={};_0x37cd3a[_0x26fa23[_0xb0b4('0x2d')]]={'$like':'%'+_0x3acefd[_0xb0b4('0x32')][_0xb0b4('0x3d')]+'%'};return _0x37cd3a;}})});}_0x2c8bcd=_[_0xb0b4('0x3e')]({},_0x2c8bcd,_0x3acefd[_0xb0b4('0x41')]);var _0x3ad2f8={'where':_0x2c8bcd['where']};return db[_0xb0b4('0x42')][_0xb0b4('0x43')](_0x3ad2f8)[_0xb0b4('0x28')](function(_0x41afde){_0x334368[_0xb0b4('0x43')]=_0x41afde;if(_0x3acefd['query'][_0xb0b4('0x44')]){_0x2c8bcd[_0xb0b4('0x45')]=[{'all':!![]}];}return db[_0xb0b4('0x42')][_0xb0b4('0x46')](_0x2c8bcd);})[_0xb0b4('0x28')](function(_0x2e4dc5){_0x334368[_0xb0b4('0x47')]=_0x2e4dc5;return _0x334368;})[_0xb0b4('0x28')](respondWithFilteredResult(_0x332f85,_0x2c8bcd))[_0xb0b4('0x48')](handleError(_0x332f85,null));};exports[_0xb0b4('0x49')]=function(_0x7db876,_0x1fe4af){var _0x5b72d6={'raw':!![],'where':{'id':_0x7db876['params']['id']}},_0x560430={};_0x560430[_0xb0b4('0x30')]=_[_0xb0b4('0x4a')](db[_0xb0b4('0x42')]['rawAttributes']);_0x560430[_0xb0b4('0x32')]=_[_0xb0b4('0x4a')](_0x7db876['query']);_0x560430['filters']=_[_0xb0b4('0x34')](_0x560430[_0xb0b4('0x30')],_0x560430[_0xb0b4('0x32')]);_0x5b72d6[_0xb0b4('0x33')]=_[_0xb0b4('0x34')](_0x560430[_0xb0b4('0x30')],qs[_0xb0b4('0x35')](_0x7db876[_0xb0b4('0x32')]['fields']));_0x5b72d6[_0xb0b4('0x33')]=_0x5b72d6[_0xb0b4('0x33')][_0xb0b4('0x36')]?_0x5b72d6[_0xb0b4('0x33')]:_0x560430[_0xb0b4('0x30')];if(_0x7db876[_0xb0b4('0x32')][_0xb0b4('0x44')]){_0x5b72d6[_0xb0b4('0x45')]=[{'all':!![]}];}_0x5b72d6=_[_0xb0b4('0x3e')]({},_0x5b72d6,_0x7db876[_0xb0b4('0x41')]);return db[_0xb0b4('0x42')][_0xb0b4('0x4b')](_0x5b72d6)[_0xb0b4('0x28')](handleEntityNotFound(_0x1fe4af,null))[_0xb0b4('0x28')](respondWithResult(_0x1fe4af,null))['catch'](handleError(_0x1fe4af,null));};exports[_0xb0b4('0x4c')]=function(_0x5f1667,_0x18a388){return db[_0xb0b4('0x42')]['create'](_0x5f1667['body'],{})[_0xb0b4('0x28')](function(_0x26d264){var _0x2edf02=_0x5f1667['user']['get']({'plain':!![]});if(!_0x2edf02)throw new Error(_0xb0b4('0x4d'));if(_0x2edf02[_0xb0b4('0x4e')]==='user'){var _0x40197e=_0x26d264['get']({'plain':!![]});var _0x3fc0af=_0xb0b4('0x4f');return db['UserProfileSection'][_0xb0b4('0x4b')]({'where':{'name':_0x3fc0af,'userProfileId':_0x2edf02['userProfileId']},'raw':!![]})[_0xb0b4('0x28')](function(_0xbf2400){if(_0xbf2400&&_0xbf2400[_0xb0b4('0x50')]===0x0){return db[_0xb0b4('0x2a')][_0xb0b4('0x4c')]({'name':_0x40197e[_0xb0b4('0x2d')],'resourceId':_0x40197e['id'],'type':_0xbf2400[_0xb0b4('0x2d')],'sectionId':_0xbf2400['id']},{})[_0xb0b4('0x28')](function(){return _0x26d264;});}else{return _0x26d264;}})[_0xb0b4('0x48')](function(_0x219062){logger['error'](_0xb0b4('0x51'),_0x219062);throw _0x219062;});}return _0x26d264;})[_0xb0b4('0x28')](respondWithResult(_0x18a388,0xc9))[_0xb0b4('0x48')](handleError(_0x18a388,null));};exports[_0xb0b4('0x27')]=function(_0x57c66e,_0x5a85c4){if(_0x57c66e[_0xb0b4('0x52')]['id']){delete _0x57c66e[_0xb0b4('0x52')]['id'];}return db['SmsQueue'][_0xb0b4('0x4b')]({'where':{'id':_0x57c66e['params']['id']}})['then'](handleEntityNotFound(_0x5a85c4,null))[_0xb0b4('0x28')](saveUpdates(_0x57c66e[_0xb0b4('0x52')],null))['then'](respondWithResult(_0x5a85c4,null))[_0xb0b4('0x48')](handleError(_0x5a85c4,null));};exports[_0xb0b4('0x2b')]=function(_0x26d601,_0x3e44e9){return db['SmsQueue'][_0xb0b4('0x4b')]({'where':{'id':_0x26d601[_0xb0b4('0x53')]['id']}})[_0xb0b4('0x28')](handleEntityNotFound(_0x3e44e9,null))['then'](removeEntity(_0x3e44e9,null))[_0xb0b4('0x48')](handleError(_0x3e44e9,null));};exports[_0xb0b4('0x54')]=function(_0x1f4e41,_0x2bf12d){return db[_0xb0b4('0x42')][_0xb0b4('0x54')]()['then'](respondWithResult(_0x2bf12d,null))[_0xb0b4('0x48')](handleError(_0x2bf12d,null));};exports[_0xb0b4('0x55')]=function(_0x18e750,_0x43603b,_0x9fe44a){var _0x1fda97={'raw':!![],'where':{}},_0x173c32={},_0x3b4bfd;return db[_0xb0b4('0x42')][_0xb0b4('0x56')]({'where':{'id':_0x18e750[_0xb0b4('0x53')]['id']}})[_0xb0b4('0x28')](handleEntityNotFound(_0x43603b,null))[_0xb0b4('0x28')](function(_0x1576b6){if(_0x1576b6){_0x3b4bfd=_0x1576b6['get']({'plain':!![]});_0x173c32['model']=_[_0xb0b4('0x4a')](db[_0xb0b4('0x57')][_0xb0b4('0x58')]);_0x173c32[_0xb0b4('0x32')]=_['keys'](_0x18e750['query']);_0x173c32[_0xb0b4('0x31')]=_['intersection'](_0x173c32[_0xb0b4('0x30')],_0x173c32[_0xb0b4('0x32')]);_0x1fda97['attributes']=_[_0xb0b4('0x34')](_0x173c32[_0xb0b4('0x30')],qs[_0xb0b4('0x35')](_0x18e750['query']['fields']));_0x1fda97[_0xb0b4('0x33')]=_0x1fda97[_0xb0b4('0x33')][_0xb0b4('0x36')]?_0x1fda97[_0xb0b4('0x33')]:_0x173c32[_0xb0b4('0x30')];if(!_0x18e750['query'][_0xb0b4('0x37')](_0xb0b4('0x38'))){_0x1fda97[_0xb0b4('0x22')]=qs['limit'](_0x18e750[_0xb0b4('0x32')][_0xb0b4('0x22')]);_0x1fda97[_0xb0b4('0x21')]=qs[_0xb0b4('0x21')](_0x18e750[_0xb0b4('0x32')][_0xb0b4('0x21')]);}_0x1fda97['order']=qs['sort'](_0x18e750['query'][_0xb0b4('0x3a')]);_0x1fda97[_0xb0b4('0x3b')]=qs[_0xb0b4('0x31')](_[_0xb0b4('0x3c')](_0x18e750[_0xb0b4('0x32')],_0x173c32[_0xb0b4('0x31')]));_0x1fda97['where'][_0xb0b4('0x59')]=_0x1576b6['id'];if(_0x18e750[_0xb0b4('0x32')][_0xb0b4('0x3d')]){_0x1fda97[_0xb0b4('0x3b')]=_[_0xb0b4('0x3e')](_0x1fda97[_0xb0b4('0x3b')],{'$or':_[_0xb0b4('0x2f')](_0x1fda97[_0xb0b4('0x33')],function(_0x258e4a){var _0x4db1ab={};_0x4db1ab[_0x258e4a]={'$like':'%'+_0x18e750[_0xb0b4('0x32')][_0xb0b4('0x3d')]+'%'};return _0x4db1ab;})});}_0x1fda97=_[_0xb0b4('0x3e')]({},_0x1fda97,_0x18e750[_0xb0b4('0x41')]);return db[_0xb0b4('0x57')][_0xb0b4('0x46')](_0x1fda97);}})['then'](function(_0x13d0ff){if(_0x13d0ff){return db[_0xb0b4('0x5a')][_0xb0b4('0x5b')]({'where':{'id':_[_0xb0b4('0x2f')](_0x13d0ff,_0xb0b4('0x5c')),'role':_0xb0b4('0x5d')},'attributes':['id','name',_0xb0b4('0x5e'),_0xb0b4('0x5f'),_0xb0b4('0x60')]});}})[_0xb0b4('0x28')](function(_0x9d75b8){if(_0x9d75b8){return{'count':_0x9d75b8['count'],'rows':_[_0xb0b4('0x2f')](_0x9d75b8[_0xb0b4('0x47')],function(_0x26b406){return{'membername':_0x26b406[_0xb0b4('0x2d')],'UserId':_0x26b406['id'],'queue_name':_0x3b4bfd['name'],'SmsQueueId':_0x3b4bfd['id'],'interface':util['format']('%s/%s','SIP',_0x26b406[_0xb0b4('0x2d')]),'penalty':0x0,'paused':_0x26b406[_0xb0b4('0x5e')],'createdAt':_0x26b406[_0xb0b4('0x60')],'updatedAt':_0x26b406[_0xb0b4('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb0b4('0x28')](respondWithFilteredResult(_0x43603b,_0x1fda97))[_0xb0b4('0x48')](handleError(_0x43603b,null));};exports[_0xb0b4('0x61')]=function(_0x4a16f3,_0x4be0b3,_0x4275b5){var _0xa53f76={};var _0xfb6527={};var _0x2d3f3e;var _0x759494;return db[_0xb0b4('0x42')][_0xb0b4('0x56')]({'where':{'id':_0x4a16f3['params']['id']}})[_0xb0b4('0x28')](handleEntityNotFound(_0x4be0b3,null))['then'](function(_0x4f844a){if(_0x4f844a){_0x2d3f3e=_0x4f844a;_0xfb6527[_0xb0b4('0x30')]=_[_0xb0b4('0x4a')](db['Team']['rawAttributes']);_0xfb6527[_0xb0b4('0x32')]=_[_0xb0b4('0x4a')](_0x4a16f3[_0xb0b4('0x32')]);_0xfb6527[_0xb0b4('0x31')]=_['intersection'](_0xfb6527[_0xb0b4('0x30')],_0xfb6527['query']);_0xa53f76[_0xb0b4('0x33')]=_[_0xb0b4('0x34')](_0xfb6527[_0xb0b4('0x30')],qs[_0xb0b4('0x35')](_0x4a16f3[_0xb0b4('0x32')][_0xb0b4('0x35')]));_0xa53f76[_0xb0b4('0x33')]=_0xa53f76[_0xb0b4('0x33')]['length']?_0xa53f76[_0xb0b4('0x33')]:_0xfb6527[_0xb0b4('0x30')];_0xa53f76[_0xb0b4('0x39')]=qs[_0xb0b4('0x3a')](_0x4a16f3[_0xb0b4('0x32')]['sort']);_0xa53f76['where']=qs['filters'](_[_0xb0b4('0x3c')](_0x4a16f3[_0xb0b4('0x32')],_0xfb6527[_0xb0b4('0x31')]));if(_0x4a16f3['query'][_0xb0b4('0x3d')]){_0xa53f76[_0xb0b4('0x3b')]=_[_0xb0b4('0x3e')](_0xa53f76['where'],{'$or':_['map'](_0xa53f76[_0xb0b4('0x33')],function(_0x4e34a3){var _0x49ce5e={};_0x49ce5e[_0x4e34a3]={'$like':'%'+_0x4a16f3['query']['filter']+'%'};return _0x49ce5e;})});}_0xa53f76=_[_0xb0b4('0x3e')]({},_0xa53f76,_0x4a16f3[_0xb0b4('0x41')]);return _0x2d3f3e[_0xb0b4('0x61')](_0xa53f76);}})['then'](function(_0x5517c4){if(_0x5517c4){_0x759494=_0x5517c4[_0xb0b4('0x36')];if(!_0x4a16f3[_0xb0b4('0x32')][_0xb0b4('0x37')](_0xb0b4('0x38'))){_0xa53f76[_0xb0b4('0x22')]=qs[_0xb0b4('0x22')](_0x4a16f3[_0xb0b4('0x32')][_0xb0b4('0x22')]);_0xa53f76[_0xb0b4('0x21')]=qs[_0xb0b4('0x21')](_0x4a16f3['query'][_0xb0b4('0x21')]);}return _0x2d3f3e['getTeams'](_0xa53f76);}})[_0xb0b4('0x28')](function(_0xe4ffb7){if(_0xe4ffb7){return _0xe4ffb7?{'count':_0x759494,'rows':_0xe4ffb7}:null;}})['then'](respondWithResult(_0x4be0b3,null))[_0xb0b4('0x48')](handleError(_0x4be0b3,null));};exports[_0xb0b4('0x62')]=function(_0x1842b8,_0x20a864,_0x397a33){var _0x56c21c=_0x1842b8[_0xb0b4('0x52')][_0xb0b4('0x63')];return db[_0xb0b4('0x64')]['findAll']({'where':{'id':_0x56c21c},'attributes':['id'],'include':[{'model':db[_0xb0b4('0x5a')],'as':_0xb0b4('0x65'),'attributes':['id',_0xb0b4('0x2d'),_0xb0b4('0x66'),_0xb0b4('0x67'),_0xb0b4('0x68')],'raw':!![]}]})[_0xb0b4('0x28')](function(_0x1c5488){if(_0x1c5488){var _0x5946a2=_['flatMap'](_0x1c5488,function(_0x15f6fe){var _0x3e823e=_0x15f6fe[_0xb0b4('0x29')]({'plain':!![]});return _0x3e823e['Agents'];});return db[_0xb0b4('0x42')][_0xb0b4('0x4b')]({'where':{'id':_0x1842b8[_0xb0b4('0x53')]['id']}})[_0xb0b4('0x28')](function(_0x2f5ac6){return db[_0xb0b4('0x69')][_0xb0b4('0x6a')](function(_0x34d95f){return _0x2f5ac6[_0xb0b4('0x62')](_0x56c21c,{'transaction':_0x34d95f})['then'](function(){return BPromise[_0xb0b4('0x6b')](_0x5946a2,function(_0x5a1ffe){return db[_0xb0b4('0x57')][_0xb0b4('0x6c')]({'where':{'UserId':_0x5a1ffe['id'],'SmsQueueId':_0x1842b8[_0xb0b4('0x53')]['id']},'transaction':_0x34d95f});});})[_0xb0b4('0x28')](function(){_0x5946a2[_0xb0b4('0x6d')](function(_0x29ea04){socket[_0xb0b4('0x6e')](_0xb0b4('0x6f'),{'UserId':_0x29ea04['id'],'SmsQueueId':_0x2f5ac6['id']});});});});});}})[_0xb0b4('0x28')](respondWithStatusCode(_0x20a864,null))[_0xb0b4('0x48')](handleError(_0x20a864,null));};exports[_0xb0b4('0x70')]=function(_0x549dee,_0x5d1d2e,_0x58e630){return db[_0xb0b4('0x64')][_0xb0b4('0x46')]({'where':{'id':_0x549dee['query'][_0xb0b4('0x63')]},'attributes':['id'],'include':[{'model':db[_0xb0b4('0x5a')],'as':_0xb0b4('0x65'),'attributes':['id'],'raw':!![]}]})[_0xb0b4('0x28')](handleEntityNotFound(_0x5d1d2e,null))[_0xb0b4('0x28')](function(_0x1c9524){var _0x530ce7=_[_0xb0b4('0x2f')](_0x1c9524,'id');var _0x23155d=[];var _0x3c4063=[];var _0x47b581=squel['select']();_0x47b581[_0xb0b4('0x71')](_0xb0b4('0x72'))['from'](_0xb0b4('0x73'),'tq')[_0xb0b4('0x74')]('user_has_teams','ut',_0xb0b4('0x75'))[_0xb0b4('0x3b')](_0xb0b4('0x76'),_0x549dee[_0xb0b4('0x53')]['id']);for(var _0x3bccc5=0x0;_0x3bccc5<_0x1c9524[_0xb0b4('0x36')];_0x3bccc5+=0x1){let _0x2be9a2=_0x1c9524[_0x3bccc5];for(var _0x24e94e=0x0;_0x24e94e<_0x2be9a2[_0xb0b4('0x65')][_0xb0b4('0x36')];_0x24e94e+=0x1){let _0x39fcc3=_0x2be9a2['Agents'][_0x24e94e];var _0x546871=_0x47b581[_0xb0b4('0x77')]();_0x546871['where']('ut.UserId\x20=\x20?',_0x39fcc3['id']);_0x3c4063[_0xb0b4('0x78')](db[_0xb0b4('0x69')][_0xb0b4('0x32')](_0x546871[_0xb0b4('0x79')](),{'type':db[_0xb0b4('0x69')][_0xb0b4('0x7a')]['SELECT']})['then'](function(_0xf25ccf){if(_0xf25ccf[_0xb0b4('0x36')]===0x1){return _0x39fcc3['id'];}else{var _0x32c07b=_[_0xb0b4('0x7b')](_[_0xb0b4('0x2f')](_0xf25ccf,'TeamId'),function(_0x56eef4){return _['includes'](_0x530ce7,_0x56eef4);});if(_0x32c07b){return _0x39fcc3['id'];}}}));}}return BPromise[_0xb0b4('0x7c')](_0x3c4063)[_0xb0b4('0x28')](function(_0x3f0c7d){_0x23155d=_(_0x23155d)[_0xb0b4('0x7d')](_0x3f0c7d)['compact']()['value']();return db['SmsQueue'][_0xb0b4('0x4b')]({'where':{'id':_0x549dee[_0xb0b4('0x53')]['id']}})[_0xb0b4('0x28')](function(_0x25b7e9){return db['sequelize'][_0xb0b4('0x6a')](function(_0x4eedc4){return _0x25b7e9[_0xb0b4('0x70')](_0x549dee[_0xb0b4('0x32')]['ids'],{'transaction':_0x4eedc4})['then'](function(){if(!_[_0xb0b4('0x7e')](_0x23155d)){return _0x25b7e9[_0xb0b4('0x7f')](_0x23155d,{'transaction':_0x4eedc4});}})[_0xb0b4('0x28')](function(){_0x23155d[_0xb0b4('0x6d')](function(_0x170fe3){socket[_0xb0b4('0x6e')](_0xb0b4('0x80'),{'UserId':_0x170fe3,'SmsQueueId':_0x25b7e9['id']});});});});});});})[_0xb0b4('0x28')](respondWithStatusCode(_0x5d1d2e,null))['catch'](handleError(_0x5d1d2e,null));};exports['addAgents']=function(_0x301c46,_0x25baee,_0x3a1c0a){return db[_0xb0b4('0x42')][_0xb0b4('0x4b')]({'where':{'id':_0x301c46[_0xb0b4('0x53')]['id']}})['then'](handleEntityNotFound(_0x25baee,null))[_0xb0b4('0x28')](function(_0x3857d4){if(_0x3857d4){return _0x3857d4[_0xb0b4('0x81')](_0x301c46[_0xb0b4('0x52')]['ids'],_[_0xb0b4('0x82')](_0x301c46[_0xb0b4('0x52')],[_0xb0b4('0x63'),'id'])||{})[_0xb0b4('0x83')](function(_0x4d31e4){for(var _0x536080=0x0;_0x536080<_0x301c46[_0xb0b4('0x52')]['ids']['length'];_0x536080+=0x1){socket[_0xb0b4('0x6e')](_0xb0b4('0x6f'),{'UserId':Number(_0x301c46['body'][_0xb0b4('0x63')][_0x536080]),'SmsQueueId':Number(_0x301c46[_0xb0b4('0x53')]['id'])});}return _0x4d31e4;});}})[_0xb0b4('0x28')](respondWithResult(_0x25baee,null))['catch'](handleError(_0x25baee,null));};exports[_0xb0b4('0x7f')]=function(_0x228ea3,_0x4602b5,_0x5c043e){return db[_0xb0b4('0x42')][_0xb0b4('0x4b')]({'where':{'id':_0x228ea3[_0xb0b4('0x53')]['id']}})[_0xb0b4('0x28')](handleEntityNotFound(_0x4602b5,null))['then'](function(_0x49bcff){if(_0x49bcff){return _0x49bcff[_0xb0b4('0x7f')](_0x228ea3['query'][_0xb0b4('0x63')])[_0xb0b4('0x28')](function(){if(_[_0xb0b4('0x84')](_0x228ea3[_0xb0b4('0x32')][_0xb0b4('0x63')])){for(var _0x4ead1a=0x0;_0x4ead1a<_0x228ea3[_0xb0b4('0x32')]['ids'][_0xb0b4('0x36')];_0x4ead1a+=0x1){socket[_0xb0b4('0x6e')](_0xb0b4('0x80'),{'UserId':Number(_0x228ea3[_0xb0b4('0x32')][_0xb0b4('0x63')][_0x4ead1a]),'SmsQueueId':Number(_0x228ea3[_0xb0b4('0x53')]['id'])});}}else{socket[_0xb0b4('0x6e')](_0xb0b4('0x80'),{'UserId':Number(_0x228ea3[_0xb0b4('0x32')][_0xb0b4('0x63')]),'SmsQueueId':Number(_0x228ea3[_0xb0b4('0x53')]['id'])});}});}})[_0xb0b4('0x28')](respondWithStatusCode(_0x4602b5,null))[_0xb0b4('0x48')](handleError(_0x4602b5,null));};exports['getAgents']=function(_0x2edb07,_0x1c6766,_0x10e513){var _0x2e5b75={};var _0x41add9={};var _0x555ec3;var _0x3a0f1e;return db[_0xb0b4('0x42')][_0xb0b4('0x56')]({'where':{'id':_0x2edb07[_0xb0b4('0x53')]['id']}})[_0xb0b4('0x28')](handleEntityNotFound(_0x1c6766,null))[_0xb0b4('0x28')](function(_0x5b5431){if(_0x5b5431){_0x555ec3=_0x5b5431;_0x41add9['model']=_['keys'](db[_0xb0b4('0x5a')][_0xb0b4('0x58')]);_0x41add9[_0xb0b4('0x32')]=_[_0xb0b4('0x4a')](_0x2edb07['query']);_0x41add9[_0xb0b4('0x31')]=_['intersection'](_0x41add9[_0xb0b4('0x30')],_0x41add9[_0xb0b4('0x32')]);_0x2e5b75['attributes']=_[_0xb0b4('0x34')](_0x41add9[_0xb0b4('0x30')],qs[_0xb0b4('0x35')](_0x2edb07[_0xb0b4('0x32')]['fields']));_0x2e5b75['attributes']=_0x2e5b75[_0xb0b4('0x33')][_0xb0b4('0x36')]?_0x2e5b75[_0xb0b4('0x33')]:_0x41add9[_0xb0b4('0x30')];_0x2e5b75[_0xb0b4('0x39')]=qs[_0xb0b4('0x3a')](_0x2edb07[_0xb0b4('0x32')][_0xb0b4('0x3a')]);_0x2e5b75['where']=qs[_0xb0b4('0x31')](_['pick'](_0x2edb07[_0xb0b4('0x32')],_0x41add9[_0xb0b4('0x31')]));if(_0x2edb07[_0xb0b4('0x32')]['filter']){_0x2e5b75['where']=_[_0xb0b4('0x3e')](_0x2e5b75[_0xb0b4('0x3b')],{'$or':_[_0xb0b4('0x2f')](_0x2e5b75[_0xb0b4('0x33')],function(_0x34b5cc){var _0x46bcdf={};_0x46bcdf[_0x34b5cc]={'$like':'%'+_0x2edb07['query'][_0xb0b4('0x3d')]+'%'};return _0x46bcdf;})});}_0x2e5b75=_[_0xb0b4('0x3e')]({},_0x2e5b75,_0x2edb07[_0xb0b4('0x41')]);return _0x555ec3['getAgents'](_0x2e5b75);}})['then'](function(_0x5e44bf){if(_0x5e44bf){_0x3a0f1e=_0x5e44bf['length'];if(!_0x2edb07['query']['hasOwnProperty'](_0xb0b4('0x38'))){_0x2e5b75[_0xb0b4('0x22')]=qs[_0xb0b4('0x22')](_0x2edb07[_0xb0b4('0x32')][_0xb0b4('0x22')]);_0x2e5b75[_0xb0b4('0x21')]=qs[_0xb0b4('0x21')](_0x2edb07[_0xb0b4('0x32')]['offset']);}return _0x555ec3['getAgents'](_0x2e5b75);}})[_0xb0b4('0x28')](function(_0x4b046a){if(_0x4b046a){return _0x4b046a?{'count':_0x3a0f1e,'rows':_0x4b046a}:null;}})[_0xb0b4('0x28')](respondWithResult(_0x1c6766,null))[_0xb0b4('0x48')](handleError(_0x1c6766,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index f8d9833..cc09e0c 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 _0x202a=['../../mysqldb','SmsQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x49bfb8,_0x5b6e2b){var _0x1be0b7=function(_0x3df70f){while(--_0x3df70f){_0x49bfb8['push'](_0x49bfb8['shift']());}};_0x1be0b7(++_0x5b6e2b);}(_0x202a,0x8e));var _0xa202=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x202a[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xa202('0x0'));var SmsQueue=require(_0xa202('0x1'))['db'][_0xa202('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xa202('0x3')](0x0);var events={'afterCreate':_0xa202('0x4'),'afterUpdate':_0xa202('0x5'),'afterDestroy':_0xa202('0x6')};function emitEvent(_0x46eaf6){return function(_0x5df98c,_0xb68e58,_0x482602){SmsQueueEvents['emit'](_0x46eaf6+':'+_0x5df98c['id'],_0x5df98c);SmsQueueEvents[_0xa202('0x7')](_0x46eaf6,_0x5df98c);_0x482602(null);};}for(var e in events){if(events[_0xa202('0x8')](e)){var event=events[e];SmsQueue[_0xa202('0x9')](e,emitEvent(event));}}module[_0xa202('0xa')]=SmsQueueEvents; \ No newline at end of file +var _0x0824=['events','SmsQueue','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x595439,_0x1653d0){var _0x2fd012=function(_0x45113d){while(--_0x45113d){_0x595439['push'](_0x595439['shift']());}};_0x2fd012(++_0x1653d0);}(_0x0824,0x80));var _0x4082=function(_0x471cd7,_0x4cc335){_0x471cd7=_0x471cd7-0x0;var _0x100420=_0x0824[_0x471cd7];return _0x100420;};'use strict';var EventEmitter=require(_0x4082('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0x4082('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4082('0x2'),'afterUpdate':'update','afterDestroy':_0x4082('0x3')};function emitEvent(_0x21ee04){return function(_0x4d985a,_0x4f1b57,_0x5de37a){SmsQueueEvents[_0x4082('0x4')](_0x21ee04+':'+_0x4d985a['id'],_0x4d985a);SmsQueueEvents[_0x4082('0x4')](_0x21ee04,_0x4d985a);_0x5de37a(null);};}for(var e in events){if(events[_0x4082('0x5')](e)){var event=events[e];SmsQueue[_0x4082('0x6')](e,emitEvent(event));}}module[_0x4082('0x7')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 6e685ea..7be8cc9 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 _0x140d=['api','moment','bluebird','path','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash','util','../../config/logger'];(function(_0xa99439,_0x2400f9){var _0x121716=function(_0x3a7295){while(--_0x3a7295){_0xa99439['push'](_0xa99439['shift']());}};_0x121716(++_0x2400f9);}(_0x140d,0x69));var _0xd140=function(_0x5dc3fb,_0x2455c4){_0x5dc3fb=_0x5dc3fb-0x0;var _0x56b21d=_0x140d[_0x5dc3fb];return _0x56b21d;};'use strict';var _=require(_0xd140('0x0'));var util=require(_0xd140('0x1'));var logger=require(_0xd140('0x2'))(_0xd140('0x3'));var moment=require(_0xd140('0x4'));var BPromise=require(_0xd140('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd140('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd140('0x7'));module[_0xd140('0x8')]=function(_0x5c4aa6,_0x4732f4){return _0x5c4aa6[_0xd140('0x9')](_0xd140('0xa'),attributes,{'tableName':_0xd140('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf137=['bluebird','request-promise','rimraf','../../config/environment','SmsQueue','sms_queues','lodash','util','../../config/logger','api','moment'];(function(_0x50e012,_0x2498bb){var _0x208e39=function(_0x3216b9){while(--_0x3216b9){_0x50e012['push'](_0x50e012['shift']());}};_0x208e39(++_0x2498bb);}(_0xf137,0x7f));var _0x7f13=function(_0x2123aa,_0x2e8a74){_0x2123aa=_0x2123aa-0x0;var _0x413cde=_0xf137[_0x2123aa];return _0x413cde;};'use strict';var _=require(_0x7f13('0x0'));var util=require(_0x7f13('0x1'));var logger=require(_0x7f13('0x2'))(_0x7f13('0x3'));var moment=require(_0x7f13('0x4'));var BPromise=require(_0x7f13('0x5'));var rp=require(_0x7f13('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7f13('0x7'));var config=require(_0x7f13('0x8'));var attributes=require('./smsQueue.attributes');module['exports']=function(_0x53c6ad,_0x497c8a){return _0x53c6ad['define'](_0x7f13('0x9'),attributes,{'tableName':_0x7f13('0xa'),'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 6a87f5a..31f6508 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 _0x098c=['socket.io-emitter','request','then','info','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueue,\x20%s,\x20%s','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','limit','map','include','model','ShowSmsQueue','lodash','util','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x3d90be,_0x14ee9d){var _0x179bc4=function(_0x59a99c){while(--_0x59a99c){_0x3d90be['push'](_0x3d90be['shift']());}};_0x179bc4(++_0x14ee9d);}(_0x098c,0x124));var _0xc098=function(_0x4f26c0,_0x241b6d){_0x4f26c0=_0x4f26c0-0x0;var _0x72e46=_0x098c[_0x4f26c0];return _0x72e46;};'use strict';var _=require(_0xc098('0x0'));var util=require(_0xc098('0x1'));var moment=require('moment');var BPromise=require(_0xc098('0x2'));var rs=require(_0xc098('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc098('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc098('0x5'));var config=require('../../config/environment');var jayson=require(_0xc098('0x6'));var client=jayson[_0xc098('0x7')][_0xc098('0x8')]({'port':0x232a});config[_0xc098('0x9')]=_[_0xc098('0xa')](config[_0xc098('0x9')],{'host':_0xc098('0xb'),'port':0x18eb});var socket=require(_0xc098('0xc'))(new Redis(config[_0xc098('0x9')]));require('./smsQueue.socket')['register'](socket);function respondWithRpcPromise(_0x3ff8d9,_0x1788eb,_0x1590ac){return new BPromise(function(_0x88e38c,_0x310d2d){return client[_0xc098('0xd')](_0x3ff8d9,_0x1590ac)[_0xc098('0xe')](function(_0x40e7db){logger[_0xc098('0xf')]('SmsQueue,\x20%s,\x20%s',_0x1788eb,_0xc098('0x10'));logger[_0xc098('0x11')](_0xc098('0x12'),_0x1788eb,_0xc098('0x10'),JSON[_0xc098('0x13')](_0x40e7db));if(_0x40e7db['error']){if(_0x40e7db[_0xc098('0x14')][_0xc098('0x15')]===0x1f4){logger[_0xc098('0x14')](_0xc098('0x16'),_0x1788eb,_0x40e7db['error'][_0xc098('0x17')]);return _0x310d2d(_0x40e7db[_0xc098('0x14')][_0xc098('0x17')]);}logger[_0xc098('0x14')]('SmsQueue,\x20%s,\x20%s',_0x1788eb,_0x40e7db['error'][_0xc098('0x17')]);return _0x88e38c(_0x40e7db['error']['message']);}else{logger['info'](_0xc098('0x16'),_0x1788eb,_0xc098('0x10'));_0x88e38c(_0x40e7db[_0xc098('0x18')][_0xc098('0x17')]);}})[_0xc098('0x19')](function(_0x1549c5){logger[_0xc098('0x14')](_0xc098('0x16'),_0x1788eb,_0x1549c5);_0x310d2d(_0x1549c5);});});}exports[_0xc098('0x1a')]=function(_0xd1feba){var _0x357a96=this;return new Promise(function(_0x374c4a,_0x378fab){return db[_0xc098('0x1b')][_0xc098('0x1c')]({'raw':_0xd1feba['options']?_0xd1feba[_0xc098('0x1d')][_0xc098('0x1e')]===undefined?!![]:![]:!![],'where':_0xd1feba['options']?_0xd1feba[_0xc098('0x1d')][_0xc098('0x1f')]||null:null,'attributes':_0xd1feba[_0xc098('0x1d')]?_0xd1feba[_0xc098('0x1d')][_0xc098('0x20')]||null:null,'limit':_0xd1feba[_0xc098('0x1d')]?_0xd1feba[_0xc098('0x1d')][_0xc098('0x21')]||null:null,'include':_0xd1feba[_0xc098('0x1d')]?_0xd1feba['options']['include']?_[_0xc098('0x22')](_0xd1feba[_0xc098('0x1d')][_0xc098('0x23')],function(_0x331111){return{'model':db[_0x331111[_0xc098('0x24')]],'as':_0x331111['as'],'attributes':_0x331111[_0xc098('0x20')],'include':_0x331111['include']?_[_0xc098('0x22')](_0x331111['include'],function(_0x2680ad){return{'model':db[_0x2680ad['model']],'as':_0x2680ad['as'],'attributes':_0x2680ad[_0xc098('0x20')],'include':_0x2680ad[_0xc098('0x23')]?_[_0xc098('0x22')](_0x2680ad[_0xc098('0x23')],function(_0x5237ac){return{'model':db[_0x5237ac[_0xc098('0x24')]],'as':_0x5237ac['as'],'attributes':_0x5237ac[_0xc098('0x20')]};}):[]};}):[]};}):[]:[]})[_0xc098('0xe')](function(_0x459484){logger['info'](_0xc098('0x1a'),_0xd1feba);logger[_0xc098('0x11')](_0xc098('0x1a'),_0xd1feba,JSON[_0xc098('0x13')](_0x459484));_0x374c4a(_0x459484);})[_0xc098('0x19')](function(_0x171eca){logger[_0xc098('0x14')](_0xc098('0x1a'),_0x171eca[_0xc098('0x17')],_0xd1feba);_0x378fab(_0x357a96[_0xc098('0x14')](0x1f4,_0x171eca[_0xc098('0x17')]));});});};exports['ShowSmsQueue']=function(_0x4df4c9){var _0x49abba=this;return new Promise(function(_0x5c3d1b,_0xee21b8){return db[_0xc098('0x1b')]['find']({'raw':_0x4df4c9[_0xc098('0x1d')]?_0x4df4c9[_0xc098('0x1d')][_0xc098('0x1e')]===undefined?!![]:![]:!![],'where':_0x4df4c9[_0xc098('0x1d')]?_0x4df4c9[_0xc098('0x1d')]['where']||null:null,'attributes':_0x4df4c9[_0xc098('0x1d')]?_0x4df4c9[_0xc098('0x1d')][_0xc098('0x20')]||null:null,'include':_0x4df4c9[_0xc098('0x1d')]?_0x4df4c9[_0xc098('0x1d')][_0xc098('0x23')]?_[_0xc098('0x22')](_0x4df4c9[_0xc098('0x1d')][_0xc098('0x23')],function(_0x31e662){return{'model':db[_0x31e662[_0xc098('0x24')]],'as':_0x31e662['as'],'attributes':_0x31e662['attributes'],'include':_0x31e662[_0xc098('0x23')]?_[_0xc098('0x22')](_0x31e662[_0xc098('0x23')],function(_0x54351c){return{'model':db[_0x54351c[_0xc098('0x24')]],'as':_0x54351c['as'],'attributes':_0x54351c[_0xc098('0x20')],'include':_0x54351c['include']?_[_0xc098('0x22')](_0x54351c[_0xc098('0x23')],function(_0x157cd3){return{'model':db[_0x157cd3[_0xc098('0x24')]],'as':_0x157cd3['as'],'attributes':_0x157cd3[_0xc098('0x20')]};}):[]};}):[]};}):[]:[]})[_0xc098('0xe')](function(_0x3bf4b9){logger[_0xc098('0xf')]('ShowSmsQueue',_0x4df4c9);logger['debug'](_0xc098('0x25'),_0x4df4c9,JSON[_0xc098('0x13')](_0x3bf4b9));_0x5c3d1b(_0x3bf4b9);})['catch'](function(_0xc04032){logger[_0xc098('0x14')](_0xc098('0x25'),_0xc04032[_0xc098('0x17')],_0x4df4c9);_0xee21b8(_0x49abba['error'](0x1f4,_0xc04032[_0xc098('0x17')]));});});}; \ No newline at end of file +var _0x53e9=['ShowSmsQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','register','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x294d80,_0x44806b){var _0x4f67ff=function(_0x271527){while(--_0x271527){_0x294d80['push'](_0x294d80['shift']());}};_0x4f67ff(++_0x44806b);}(_0x53e9,0x1db));var _0x953e=function(_0x43a788,_0x4403a7){_0x43a788=_0x43a788-0x0;var _0x265d60=_0x53e9[_0x43a788];return _0x265d60;};'use strict';var _=require(_0x953e('0x0'));var util=require(_0x953e('0x1'));var moment=require(_0x953e('0x2'));var BPromise=require(_0x953e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x953e('0x4'));var db=require(_0x953e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x953e('0x6'))(_0x953e('0x7'));var config=require(_0x953e('0x8'));var jayson=require(_0x953e('0x9'));var client=jayson[_0x953e('0xa')][_0x953e('0xb')]({'port':0x232a});config['redis']=_[_0x953e('0xc')](config[_0x953e('0xd')],{'host':_0x953e('0xe'),'port':0x18eb});var socket=require(_0x953e('0xf'))(new Redis(config['redis']));require(_0x953e('0x10'))[_0x953e('0x11')](socket);function respondWithRpcPromise(_0x2ae8dc,_0x3c3656,_0x2ca0e1){return new BPromise(function(_0xde348,_0x79018b){return client['request'](_0x2ae8dc,_0x2ca0e1)[_0x953e('0x12')](function(_0x44666a){logger[_0x953e('0x13')](_0x953e('0x14'),_0x3c3656,_0x953e('0x15'));logger[_0x953e('0x16')](_0x953e('0x17'),_0x3c3656,'request\x20sent',JSON[_0x953e('0x18')](_0x44666a));if(_0x44666a[_0x953e('0x19')]){if(_0x44666a[_0x953e('0x19')][_0x953e('0x1a')]===0x1f4){logger['error']('SmsQueue,\x20%s,\x20%s',_0x3c3656,_0x44666a[_0x953e('0x19')][_0x953e('0x1b')]);return _0x79018b(_0x44666a[_0x953e('0x19')][_0x953e('0x1b')]);}logger[_0x953e('0x19')](_0x953e('0x14'),_0x3c3656,_0x44666a[_0x953e('0x19')][_0x953e('0x1b')]);return _0xde348(_0x44666a[_0x953e('0x19')]['message']);}else{logger[_0x953e('0x13')](_0x953e('0x14'),_0x3c3656,_0x953e('0x15'));_0xde348(_0x44666a[_0x953e('0x1c')]['message']);}})[_0x953e('0x1d')](function(_0x4866b3){logger[_0x953e('0x19')](_0x953e('0x14'),_0x3c3656,_0x4866b3);_0x79018b(_0x4866b3);});});}exports[_0x953e('0x1e')]=function(_0xc90fbf){var _0x2438e1=this;return new Promise(function(_0x467c29,_0x5047f1){return db[_0x953e('0x1f')][_0x953e('0x20')]({'raw':_0xc90fbf['options']?_0xc90fbf[_0x953e('0x21')][_0x953e('0x22')]===undefined?!![]:![]:!![],'where':_0xc90fbf[_0x953e('0x21')]?_0xc90fbf[_0x953e('0x21')][_0x953e('0x23')]||null:null,'attributes':_0xc90fbf[_0x953e('0x21')]?_0xc90fbf[_0x953e('0x21')][_0x953e('0x24')]||null:null,'limit':_0xc90fbf[_0x953e('0x21')]?_0xc90fbf[_0x953e('0x21')][_0x953e('0x25')]||null:null,'include':_0xc90fbf['options']?_0xc90fbf['options'][_0x953e('0x26')]?_[_0x953e('0x27')](_0xc90fbf[_0x953e('0x21')][_0x953e('0x26')],function(_0x5ab872){return{'model':db[_0x5ab872[_0x953e('0x28')]],'as':_0x5ab872['as'],'attributes':_0x5ab872[_0x953e('0x24')],'include':_0x5ab872[_0x953e('0x26')]?_['map'](_0x5ab872[_0x953e('0x26')],function(_0x30a4df){return{'model':db[_0x30a4df[_0x953e('0x28')]],'as':_0x30a4df['as'],'attributes':_0x30a4df[_0x953e('0x24')],'include':_0x30a4df[_0x953e('0x26')]?_['map'](_0x30a4df[_0x953e('0x26')],function(_0x40596f){return{'model':db[_0x40596f[_0x953e('0x28')]],'as':_0x40596f['as'],'attributes':_0x40596f[_0x953e('0x24')]};}):[]};}):[]};}):[]:[]})[_0x953e('0x12')](function(_0x34c6e4){logger[_0x953e('0x13')]('GetSmsQueue',_0xc90fbf);logger['debug'](_0x953e('0x1e'),_0xc90fbf,JSON[_0x953e('0x18')](_0x34c6e4));_0x467c29(_0x34c6e4);})[_0x953e('0x1d')](function(_0x16b531){logger[_0x953e('0x19')](_0x953e('0x1e'),_0x16b531[_0x953e('0x1b')],_0xc90fbf);_0x5047f1(_0x2438e1[_0x953e('0x19')](0x1f4,_0x16b531[_0x953e('0x1b')]));});});};exports[_0x953e('0x29')]=function(_0x167fce){var _0x53fc56=this;return new Promise(function(_0x547780,_0x4a27a0){return db[_0x953e('0x1f')][_0x953e('0x2a')]({'raw':_0x167fce[_0x953e('0x21')]?_0x167fce[_0x953e('0x21')][_0x953e('0x22')]===undefined?!![]:![]:!![],'where':_0x167fce[_0x953e('0x21')]?_0x167fce[_0x953e('0x21')][_0x953e('0x23')]||null:null,'attributes':_0x167fce[_0x953e('0x21')]?_0x167fce[_0x953e('0x21')][_0x953e('0x24')]||null:null,'include':_0x167fce[_0x953e('0x21')]?_0x167fce['options']['include']?_[_0x953e('0x27')](_0x167fce[_0x953e('0x21')][_0x953e('0x26')],function(_0x2d6b72){return{'model':db[_0x2d6b72[_0x953e('0x28')]],'as':_0x2d6b72['as'],'attributes':_0x2d6b72['attributes'],'include':_0x2d6b72[_0x953e('0x26')]?_[_0x953e('0x27')](_0x2d6b72[_0x953e('0x26')],function(_0x57fe84){return{'model':db[_0x57fe84[_0x953e('0x28')]],'as':_0x57fe84['as'],'attributes':_0x57fe84[_0x953e('0x24')],'include':_0x57fe84[_0x953e('0x26')]?_[_0x953e('0x27')](_0x57fe84[_0x953e('0x26')],function(_0x26d914){return{'model':db[_0x26d914[_0x953e('0x28')]],'as':_0x26d914['as'],'attributes':_0x26d914[_0x953e('0x24')]};}):[]};}):[]};}):[]:[]})[_0x953e('0x12')](function(_0x34fddb){logger['info']('ShowSmsQueue',_0x167fce);logger[_0x953e('0x16')]('ShowSmsQueue',_0x167fce,JSON[_0x953e('0x18')](_0x34fddb));_0x547780(_0x34fddb);})[_0x953e('0x1d')](function(_0xc6352f){logger['error'](_0x953e('0x29'),_0xc6352f[_0x953e('0x1b')],_0x167fce);_0x4a27a0(_0x53fc56[_0x953e('0x19')](0x1f4,_0xc6352f[_0x953e('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 180aee8..92e6110 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 _0x37d3=['smsQueue:','./smsQueue.events','save','emit','removeListener','register','length'];(function(_0x2f5345,_0x1c940d){var _0x4ddb18=function(_0x4fed81){while(--_0x4fed81){_0x2f5345['push'](_0x2f5345['shift']());}};_0x4ddb18(++_0x1c940d);}(_0x37d3,0xfd));var _0x337d=function(_0x5e6c27,_0x57ff21){_0x5e6c27=_0x5e6c27-0x0;var _0x4f0edb=_0x37d3[_0x5e6c27];return _0x4f0edb;};'use strict';var SmsQueueEvents=require(_0x337d('0x0'));var events=[_0x337d('0x1'),'remove','update'];function createListener(_0x5ba3d2,_0x44f805){return function(_0x4b3ff3){_0x44f805[_0x337d('0x2')](_0x5ba3d2,_0x4b3ff3);};}function removeListener(_0x5c9a9f,_0x38e7b6){return function(){SmsQueueEvents[_0x337d('0x3')](_0x5c9a9f,_0x38e7b6);};}exports[_0x337d('0x4')]=function(_0x537060){for(var _0x39e9a5=0x0,_0x2a09b4=events[_0x337d('0x5')];_0x39e9a5<_0x2a09b4;_0x39e9a5++){var _0x5b4940=events[_0x39e9a5];var _0x12ae3e=createListener(_0x337d('0x6')+_0x5b4940,_0x537060);SmsQueueEvents['on'](_0x5b4940,_0x12ae3e);}}; \ No newline at end of file +var _0x306c=['./smsQueue.events','remove','emit','removeListener','register'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x306c,0x17c));var _0xc306=function(_0x714313,_0x43c99a){_0x714313=_0x714313-0x0;var _0x26b576=_0x306c[_0x714313];return _0x26b576;};'use strict';var SmsQueueEvents=require(_0xc306('0x0'));var events=['save',_0xc306('0x1'),'update'];function createListener(_0x162578,_0x1cd18e){return function(_0x428992){_0x1cd18e[_0xc306('0x2')](_0x162578,_0x428992);};}function removeListener(_0x41dfca,_0xfa398c){return function(){SmsQueueEvents[_0xc306('0x3')](_0x41dfca,_0xfa398c);};}exports[_0xc306('0x4')]=function(_0x14a9b5){for(var _0x3dd99b=0x0,_0xb93fd4=events['length'];_0x3dd99b<_0xb93fd4;_0x3dd99b++){var _0x2dc96d=events[_0x3dd99b];var _0x461cad=createListener('smsQueue:'+_0x2dc96d,_0x14a9b5);SmsQueueEvents['on'](_0x2dc96d,_0x461cad);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index b7ae00a..5efee14 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 _0x269f=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','isAuthenticated','index','get','/describe','describe','show','post','create','put','/:id','exports','multer','util'];(function(_0x3922bd,_0xfa2a3b){var _0x9af358=function(_0x411ef8){while(--_0x411ef8){_0x3922bd['push'](_0x3922bd['shift']());}};_0x9af358(++_0xfa2a3b);}(_0x269f,0xee));var _0xf269=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x269f[_0x49b207];return _0x2dc8fa;};'use strict';var multer=require(_0xf269('0x0'));var util=require(_0xf269('0x1'));var path=require(_0xf269('0x2'));var timeout=require('connect-timeout');var express=require(_0xf269('0x3'));var router=express['Router']();var fs_extra=require(_0xf269('0x4'));var auth=require(_0xf269('0x5'));var interaction=require(_0xf269('0x6'));var config=require(_0xf269('0x7'));var controller=require(_0xf269('0x8'));router['get']('/',auth[_0xf269('0x9')](),controller[_0xf269('0xa')]);router[_0xf269('0xb')](_0xf269('0xc'),auth[_0xf269('0x9')](),controller[_0xf269('0xd')]);router[_0xf269('0xb')]('/:id',auth[_0xf269('0x9')](),controller[_0xf269('0xe')]);router[_0xf269('0xf')]('/',auth[_0xf269('0x9')](),controller[_0xf269('0x10')]);router[_0xf269('0x11')](_0xf269('0x12'),auth[_0xf269('0x9')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xf269('0x13')]=router; \ No newline at end of file +var _0x1867=['put','update','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','isAuthenticated','index','get','/describe','/:id','create'];(function(_0x2452b4,_0x36150a){var _0x1d7288=function(_0x4e6e5f){while(--_0x4e6e5f){_0x2452b4['push'](_0x2452b4['shift']());}};_0x1d7288(++_0x36150a);}(_0x1867,0x134));var _0x7186=function(_0xfe0b89,_0xd9064){_0xfe0b89=_0xfe0b89-0x0;var _0x482866=_0x1867[_0xfe0b89];return _0x482866;};'use strict';var multer=require(_0x7186('0x0'));var util=require(_0x7186('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7186('0x2'));var router=express[_0x7186('0x3')]();var fs_extra=require(_0x7186('0x4'));var auth=require(_0x7186('0x5'));var interaction=require(_0x7186('0x6'));var config=require(_0x7186('0x7'));var controller=require(_0x7186('0x8'));router['get']('/',auth[_0x7186('0x9')](),controller[_0x7186('0xa')]);router[_0x7186('0xb')](_0x7186('0xc'),auth[_0x7186('0x9')](),controller['describe']);router[_0x7186('0xb')](_0x7186('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x7186('0xe')]);router[_0x7186('0xf')](_0x7186('0xd'),auth[_0x7186('0x9')](),controller[_0x7186('0x10')]);router['delete'](_0x7186('0xd'),auth[_0x7186('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index d9bd4bb..8dbe254 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 _0x84d9=['STRING','DATE'];(function(_0x331e77,_0x114123){var _0x5b1b95=function(_0x1691ae){while(--_0x1691ae){_0x331e77['push'](_0x331e77['shift']());}};_0x5b1b95(++_0x114123);}(_0x84d9,0x6e));var _0x984d=function(_0x28733b,_0x2ea9a9){_0x28733b=_0x28733b-0x0;var _0x12498e=_0x84d9[_0x28733b];return _0x12498e;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x984d('0x0')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x984d('0x1')]},'acceptAt':{'type':Sequelize[_0x984d('0x1')]},'exitAt':{'type':Sequelize[_0x984d('0x1')]},'reason':{'type':Sequelize[_0x984d('0x0')]}}; \ No newline at end of file +var _0x4143=['exports','STRING','DATE','moment'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0x4143,0x167));var _0x3414=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x4143[_0xc6be3a];return _0x56a310;};'use strict';var moment=require(_0x3414('0x0'));var Sequelize=require('sequelize');module[_0x3414('0x1')]={'uniqueid':{'type':Sequelize[_0x3414('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x3414('0x2')]},'joinAt':{'type':Sequelize[_0x3414('0x3')]},'leaveAt':{'type':Sequelize[_0x3414('0x3')]},'acceptAt':{'type':Sequelize[_0x3414('0x3')]},'exitAt':{'type':Sequelize[_0x3414('0x3')]},'reason':{'type':Sequelize[_0x3414('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 2df881b..86f0d5b 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 _0xe27b=['findAll','catch','show','keys','SmsQueueReport','length','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','destroy','then','error','stack','name','index','map','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include'];(function(_0x6d93ee,_0x1bc661){var _0x324d9b=function(_0x35f50a){while(--_0x35f50a){_0x6d93ee['push'](_0x6d93ee['shift']());}};_0x324d9b(++_0x1bc661);}(_0xe27b,0x1d9));var _0xbe27=function(_0x6f37f1,_0x26cabd){_0x6f37f1=_0x6f37f1-0x0;var _0x285243=_0xe27b[_0x6f37f1];return _0x285243;};'use strict';var emlformat=require(_0xbe27('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbe27('0x1'));var jsonpatch=require(_0xbe27('0x2'));var rp=require(_0xbe27('0x3'));var moment=require(_0xbe27('0x4'));var BPromise=require(_0xbe27('0x5'));var Mustache=require(_0xbe27('0x6'));var util=require(_0xbe27('0x7'));var path=require('path');var sox=require(_0xbe27('0x8'));var csv=require(_0xbe27('0x9'));var ejs=require(_0xbe27('0xa'));var fs=require('fs');var fs_extra=require(_0xbe27('0xb'));var _=require(_0xbe27('0xc'));var squel=require(_0xbe27('0xd'));var crypto=require(_0xbe27('0xe'));var jsforce=require(_0xbe27('0xf'));var deskjs=require(_0xbe27('0x10'));var toCsv=require(_0xbe27('0x9'));var querystring=require(_0xbe27('0x11'));var Papa=require(_0xbe27('0x12'));var Redis=require('ioredis');var authService=require(_0xbe27('0x13'));var qs=require(_0xbe27('0x14'));var as=require(_0xbe27('0x15'));var hardwareService=require(_0xbe27('0x16'));var logger=require(_0xbe27('0x17'))('api');var utils=require(_0xbe27('0x18'));var config=require(_0xbe27('0x19'));var licenseUtil=require(_0xbe27('0x1a'));var db=require(_0xbe27('0x1b'))['db'];function respondWithStatusCode(_0x1f4993,_0xc1a944){_0xc1a944=_0xc1a944||0xcc;return function(_0xe308a){if(_0xe308a){return _0x1f4993[_0xbe27('0x1c')](_0xc1a944);}return _0x1f4993[_0xbe27('0x1d')](_0xc1a944)['end']();};}function respondWithResult(_0x2b5e04,_0xd90aad){_0xd90aad=_0xd90aad||0xc8;return function(_0x8df7cd){if(_0x8df7cd){return _0x2b5e04[_0xbe27('0x1d')](_0xd90aad)[_0xbe27('0x1e')](_0x8df7cd);}};}function respondWithFilteredResult(_0x3eaf20,_0x4bbb60){return function(_0x67d37b){if(_0x67d37b){var _0x4981a5=typeof _0x4bbb60[_0xbe27('0x1f')]===_0xbe27('0x20')&&typeof _0x4bbb60['limit']===_0xbe27('0x20');var _0x127026=_0x67d37b[_0xbe27('0x21')];var _0x54ae3a=_0x4981a5?0x0:_0x4bbb60[_0xbe27('0x1f')];var _0x2d9980=_0x4981a5?_0x67d37b[_0xbe27('0x21')]:_0x4bbb60['offset']+_0x4bbb60[_0xbe27('0x22')];var _0x53bfeb;if(_0x2d9980>=_0x127026){_0x2d9980=_0x127026;_0x53bfeb=0xc8;}else{_0x53bfeb=0xce;}_0x3eaf20[_0xbe27('0x1d')](_0x53bfeb);return _0x3eaf20['set'](_0xbe27('0x23'),_0x54ae3a+'-'+_0x2d9980+'/'+_0x127026)[_0xbe27('0x1e')](_0x67d37b);}return null;};}function patchUpdates(_0xfc6227){return function(_0x34a5a5){try{jsonpatch[_0xbe27('0x24')](_0x34a5a5,_0xfc6227,!![]);}catch(_0x1925d8){return BPromise[_0xbe27('0x25')](_0x1925d8);}return _0x34a5a5[_0xbe27('0x26')]();};}function saveUpdates(_0x498737,_0xc700c6){return function(_0x94cc8d){if(_0x94cc8d){return _0x94cc8d['update'](_0x498737)['then'](function(_0x37b2e3){return _0x37b2e3;});}return null;};}function removeEntity(_0x416811,_0x10577d){return function(_0xa9ddc0){if(_0xa9ddc0){return _0xa9ddc0[_0xbe27('0x27')]()[_0xbe27('0x28')](function(){_0x416811[_0xbe27('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9f329c,_0x54637d){return function(_0x546580){if(!_0x546580){_0x9f329c[_0xbe27('0x1c')](0x194);}return _0x546580;};}function handleError(_0x2124c6,_0x3d815c){_0x3d815c=_0x3d815c||0x1f4;return function(_0xe4a366){logger[_0xbe27('0x29')](_0xe4a366[_0xbe27('0x2a')]);if(_0xe4a366['name']){delete _0xe4a366[_0xbe27('0x2b')];}_0x2124c6[_0xbe27('0x1d')](_0x3d815c)['send'](_0xe4a366);};}exports[_0xbe27('0x2c')]=function(_0x209db6,_0x49333a){var _0x6183ec={},_0x45db77={},_0x5506f2={'count':0x0,'rows':[]};var _0x5d224a=_[_0xbe27('0x2d')](db['SmsQueueReport'][_0xbe27('0x2e')],function(_0x283ea9){return{'name':_0x283ea9[_0xbe27('0x2f')],'type':_0x283ea9['type'][_0xbe27('0x30')]};});_0x45db77['model']=_[_0xbe27('0x2d')](_0x5d224a,_0xbe27('0x2b'));_0x45db77['query']=_['keys'](_0x209db6[_0xbe27('0x31')]);_0x45db77[_0xbe27('0x32')]=_[_0xbe27('0x33')](_0x45db77[_0xbe27('0x34')],_0x45db77[_0xbe27('0x31')]);_0x6183ec[_0xbe27('0x35')]=_[_0xbe27('0x33')](_0x45db77['model'],qs[_0xbe27('0x36')](_0x209db6['query'][_0xbe27('0x36')]));_0x6183ec[_0xbe27('0x35')]=_0x6183ec[_0xbe27('0x35')]['length']?_0x6183ec[_0xbe27('0x35')]:_0x45db77[_0xbe27('0x34')];if(!_0x209db6[_0xbe27('0x31')][_0xbe27('0x37')]('nolimit')){_0x6183ec['limit']=qs[_0xbe27('0x22')](_0x209db6[_0xbe27('0x31')][_0xbe27('0x22')]);_0x6183ec[_0xbe27('0x1f')]=qs[_0xbe27('0x1f')](_0x209db6[_0xbe27('0x31')][_0xbe27('0x1f')]);}_0x6183ec[_0xbe27('0x38')]=qs['sort'](_0x209db6['query']['sort']);_0x6183ec['where']=qs[_0xbe27('0x32')](_[_0xbe27('0x39')](_0x209db6['query'],_0x45db77[_0xbe27('0x32')]),_0x5d224a);if(_0x209db6['query'][_0xbe27('0x3a')]){_0x6183ec['where']=_[_0xbe27('0x3b')](_0x6183ec[_0xbe27('0x3c')],{'$or':_[_0xbe27('0x2d')](_0x5d224a,function(_0x259f8b){if(_0x259f8b[_0xbe27('0x3d')]!==_0xbe27('0x3e')){var _0x2f2d45={};_0x2f2d45[_0x259f8b['name']]={'$like':'%'+_0x209db6[_0xbe27('0x31')][_0xbe27('0x3a')]+'%'};return _0x2f2d45;}})});}_0x6183ec=_[_0xbe27('0x3b')]({},_0x6183ec,_0x209db6[_0xbe27('0x3f')]);var _0x4926b1={'where':_0x6183ec[_0xbe27('0x3c')]};return db['SmsQueueReport'][_0xbe27('0x21')](_0x4926b1)[_0xbe27('0x28')](function(_0x181599){_0x5506f2[_0xbe27('0x21')]=_0x181599;if(_0x209db6['query'][_0xbe27('0x40')]){_0x6183ec[_0xbe27('0x41')]=[{'all':!![]}];}return db['SmsQueueReport'][_0xbe27('0x42')](_0x6183ec);})['then'](function(_0x3aa345){_0x5506f2['rows']=_0x3aa345;return _0x5506f2;})[_0xbe27('0x28')](respondWithFilteredResult(_0x49333a,_0x6183ec))[_0xbe27('0x43')](handleError(_0x49333a,null));};exports[_0xbe27('0x44')]=function(_0x1f9434,_0x5c0e79){var _0x331af0={'raw':!![],'where':{'id':_0x1f9434['params']['id']}},_0x4b18dc={};_0x4b18dc['model']=_[_0xbe27('0x45')](db[_0xbe27('0x46')][_0xbe27('0x2e')]);_0x4b18dc[_0xbe27('0x31')]=_['keys'](_0x1f9434[_0xbe27('0x31')]);_0x4b18dc[_0xbe27('0x32')]=_['intersection'](_0x4b18dc[_0xbe27('0x34')],_0x4b18dc['query']);_0x331af0[_0xbe27('0x35')]=_[_0xbe27('0x33')](_0x4b18dc[_0xbe27('0x34')],qs[_0xbe27('0x36')](_0x1f9434[_0xbe27('0x31')][_0xbe27('0x36')]));_0x331af0['attributes']=_0x331af0[_0xbe27('0x35')][_0xbe27('0x47')]?_0x331af0[_0xbe27('0x35')]:_0x4b18dc[_0xbe27('0x34')];if(_0x1f9434['query'][_0xbe27('0x40')]){_0x331af0['include']=[{'all':!![]}];}_0x331af0=_[_0xbe27('0x3b')]({},_0x331af0,_0x1f9434['options']);return db['SmsQueueReport'][_0xbe27('0x48')](_0x331af0)[_0xbe27('0x28')](handleEntityNotFound(_0x5c0e79,null))[_0xbe27('0x28')](respondWithResult(_0x5c0e79,null))[_0xbe27('0x43')](handleError(_0x5c0e79,null));};exports[_0xbe27('0x49')]=function(_0x3dc0bc,_0x5e36e7){return db['SmsQueueReport'][_0xbe27('0x49')](_0x3dc0bc[_0xbe27('0x4a')],{})[_0xbe27('0x28')](respondWithResult(_0x5e36e7,0xc9))[_0xbe27('0x43')](handleError(_0x5e36e7,null));};exports['update']=function(_0x24050f,_0x161d82){if(_0x24050f[_0xbe27('0x4a')]['id']){delete _0x24050f[_0xbe27('0x4a')]['id'];}return db[_0xbe27('0x46')]['find']({'where':{'id':_0x24050f[_0xbe27('0x4b')]['id']}})[_0xbe27('0x28')](handleEntityNotFound(_0x161d82,null))['then'](saveUpdates(_0x24050f['body'],null))[_0xbe27('0x28')](respondWithResult(_0x161d82,null))[_0xbe27('0x43')](handleError(_0x161d82,null));};exports[_0xbe27('0x27')]=function(_0x1d5d90,_0xb3a28b){return db[_0xbe27('0x46')][_0xbe27('0x48')]({'where':{'id':_0x1d5d90['params']['id']}})[_0xbe27('0x28')](handleEntityNotFound(_0xb3a28b,null))['then'](removeEntity(_0xb3a28b,null))[_0xbe27('0x43')](handleError(_0xb3a28b,null));};exports[_0xbe27('0x4c')]=function(_0x2c614f,_0x49c93a){return db[_0xbe27('0x46')]['describe']()[_0xbe27('0x28')](respondWithResult(_0x49c93a,null))[_0xbe27('0x43')](handleError(_0x49c93a,null));}; \ No newline at end of file +var _0xaf1f=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','name','index','map','SmsQueueReport','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','then','rows','catch','show','params','length','include','find','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce'];(function(_0x18afca,_0x4219d9){var _0x11603f=function(_0x21d5d1){while(--_0x21d5d1){_0x18afca['push'](_0x18afca['shift']());}};_0x11603f(++_0x4219d9);}(_0xaf1f,0x156));var _0xfaf1=function(_0x5d0680,_0x10c11d){_0x5d0680=_0x5d0680-0x0;var _0x1ef1dc=_0xaf1f[_0x5d0680];return _0x1ef1dc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfaf1('0x0'));var zipdir=require(_0xfaf1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfaf1('0x2'));var moment=require(_0xfaf1('0x3'));var BPromise=require(_0xfaf1('0x4'));var Mustache=require(_0xfaf1('0x5'));var util=require(_0xfaf1('0x6'));var path=require(_0xfaf1('0x7'));var sox=require('sox');var csv=require(_0xfaf1('0x8'));var ejs=require(_0xfaf1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfaf1('0xa'));var squel=require(_0xfaf1('0xb'));var crypto=require('crypto');var jsforce=require(_0xfaf1('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfaf1('0xd'));var Papa=require(_0xfaf1('0xe'));var Redis=require(_0xfaf1('0xf'));var authService=require(_0xfaf1('0x10'));var qs=require(_0xfaf1('0x11'));var as=require(_0xfaf1('0x12'));var hardwareService=require(_0xfaf1('0x13'));var logger=require('../../config/logger')(_0xfaf1('0x14'));var utils=require('../../config/utils');var config=require(_0xfaf1('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xfaf1('0x16'))['db'];function respondWithStatusCode(_0x348c18,_0x547b56){_0x547b56=_0x547b56||0xcc;return function(_0x561f97){if(_0x561f97){return _0x348c18[_0xfaf1('0x17')](_0x547b56);}return _0x348c18[_0xfaf1('0x18')](_0x547b56)[_0xfaf1('0x19')]();};}function respondWithResult(_0x49cb4d,_0x9056a6){_0x9056a6=_0x9056a6||0xc8;return function(_0x5ee621){if(_0x5ee621){return _0x49cb4d[_0xfaf1('0x18')](_0x9056a6)[_0xfaf1('0x1a')](_0x5ee621);}};}function respondWithFilteredResult(_0x4f079b,_0x5e3d40){return function(_0x319f3e){if(_0x319f3e){var _0x23ec76=typeof _0x5e3d40[_0xfaf1('0x1b')]===_0xfaf1('0x1c')&&typeof _0x5e3d40[_0xfaf1('0x1d')]===_0xfaf1('0x1c');var _0x51e5b4=_0x319f3e[_0xfaf1('0x1e')];var _0x1b8995=_0x23ec76?0x0:_0x5e3d40[_0xfaf1('0x1b')];var _0x49af9e=_0x23ec76?_0x319f3e['count']:_0x5e3d40[_0xfaf1('0x1b')]+_0x5e3d40[_0xfaf1('0x1d')];var _0x31d7f7;if(_0x49af9e>=_0x51e5b4){_0x49af9e=_0x51e5b4;_0x31d7f7=0xc8;}else{_0x31d7f7=0xce;}_0x4f079b[_0xfaf1('0x18')](_0x31d7f7);return _0x4f079b[_0xfaf1('0x1f')](_0xfaf1('0x20'),_0x1b8995+'-'+_0x49af9e+'/'+_0x51e5b4)[_0xfaf1('0x1a')](_0x319f3e);}return null;};}function patchUpdates(_0x1543b1){return function(_0x258a62){try{jsonpatch[_0xfaf1('0x21')](_0x258a62,_0x1543b1,!![]);}catch(_0x5825b2){return BPromise['reject'](_0x5825b2);}return _0x258a62['save']();};}function saveUpdates(_0x47e088,_0x3de118){return function(_0x2a96dd){if(_0x2a96dd){return _0x2a96dd[_0xfaf1('0x22')](_0x47e088)['then'](function(_0x2aedc3){return _0x2aedc3;});}return null;};}function removeEntity(_0x3b4c1d,_0x2ea420){return function(_0x1be07a){if(_0x1be07a){return _0x1be07a[_0xfaf1('0x23')]()['then'](function(){_0x3b4c1d[_0xfaf1('0x18')](0xcc)[_0xfaf1('0x19')]();});}};}function handleEntityNotFound(_0x3c920a,_0x474081){return function(_0x34cbbe){if(!_0x34cbbe){_0x3c920a[_0xfaf1('0x17')](0x194);}return _0x34cbbe;};}function handleError(_0x3b2139,_0x341469){_0x341469=_0x341469||0x1f4;return function(_0x4ccb36){logger['error'](_0x4ccb36['stack']);if(_0x4ccb36[_0xfaf1('0x24')]){delete _0x4ccb36['name'];}_0x3b2139['status'](_0x341469)['send'](_0x4ccb36);};}exports[_0xfaf1('0x25')]=function(_0x1e97ac,_0x1b3533){var _0x4a991a={},_0x574d59={},_0xf648da={'count':0x0,'rows':[]};var _0x436a98=_[_0xfaf1('0x26')](db[_0xfaf1('0x27')][_0xfaf1('0x28')],function(_0x20a98f){return{'name':_0x20a98f[_0xfaf1('0x29')],'type':_0x20a98f[_0xfaf1('0x2a')]['key']};});_0x574d59[_0xfaf1('0x2b')]=_[_0xfaf1('0x26')](_0x436a98,_0xfaf1('0x24'));_0x574d59['query']=_[_0xfaf1('0x2c')](_0x1e97ac[_0xfaf1('0x2d')]);_0x574d59[_0xfaf1('0x2e')]=_[_0xfaf1('0x2f')](_0x574d59[_0xfaf1('0x2b')],_0x574d59[_0xfaf1('0x2d')]);_0x4a991a['attributes']=_['intersection'](_0x574d59[_0xfaf1('0x2b')],qs[_0xfaf1('0x30')](_0x1e97ac[_0xfaf1('0x2d')][_0xfaf1('0x30')]));_0x4a991a[_0xfaf1('0x31')]=_0x4a991a[_0xfaf1('0x31')]['length']?_0x4a991a['attributes']:_0x574d59[_0xfaf1('0x2b')];if(!_0x1e97ac[_0xfaf1('0x2d')][_0xfaf1('0x32')](_0xfaf1('0x33'))){_0x4a991a[_0xfaf1('0x1d')]=qs[_0xfaf1('0x1d')](_0x1e97ac[_0xfaf1('0x2d')][_0xfaf1('0x1d')]);_0x4a991a[_0xfaf1('0x1b')]=qs[_0xfaf1('0x1b')](_0x1e97ac[_0xfaf1('0x2d')][_0xfaf1('0x1b')]);}_0x4a991a[_0xfaf1('0x34')]=qs[_0xfaf1('0x35')](_0x1e97ac['query'][_0xfaf1('0x35')]);_0x4a991a[_0xfaf1('0x36')]=qs['filters'](_[_0xfaf1('0x37')](_0x1e97ac[_0xfaf1('0x2d')],_0x574d59['filters']),_0x436a98);if(_0x1e97ac['query'][_0xfaf1('0x38')]){_0x4a991a['where']=_[_0xfaf1('0x39')](_0x4a991a[_0xfaf1('0x36')],{'$or':_[_0xfaf1('0x26')](_0x436a98,function(_0x1da286){if(_0x1da286[_0xfaf1('0x2a')]!=='VIRTUAL'){var _0x1351aa={};_0x1351aa[_0x1da286[_0xfaf1('0x24')]]={'$like':'%'+_0x1e97ac['query'][_0xfaf1('0x38')]+'%'};return _0x1351aa;}})});}_0x4a991a=_[_0xfaf1('0x39')]({},_0x4a991a,_0x1e97ac[_0xfaf1('0x3a')]);var _0x51c465={'where':_0x4a991a[_0xfaf1('0x36')]};return db[_0xfaf1('0x27')]['count'](_0x51c465)['then'](function(_0x559590){_0xf648da[_0xfaf1('0x1e')]=_0x559590;if(_0x1e97ac['query'][_0xfaf1('0x3b')]){_0x4a991a['include']=[{'all':!![]}];}return db['SmsQueueReport']['findAll'](_0x4a991a);})[_0xfaf1('0x3c')](function(_0x575e93){_0xf648da[_0xfaf1('0x3d')]=_0x575e93;return _0xf648da;})[_0xfaf1('0x3c')](respondWithFilteredResult(_0x1b3533,_0x4a991a))[_0xfaf1('0x3e')](handleError(_0x1b3533,null));};exports[_0xfaf1('0x3f')]=function(_0x4f4208,_0x4b9d05){var _0x6187fd={'raw':!![],'where':{'id':_0x4f4208[_0xfaf1('0x40')]['id']}},_0x5206fc={};_0x5206fc[_0xfaf1('0x2b')]=_[_0xfaf1('0x2c')](db[_0xfaf1('0x27')][_0xfaf1('0x28')]);_0x5206fc[_0xfaf1('0x2d')]=_[_0xfaf1('0x2c')](_0x4f4208['query']);_0x5206fc[_0xfaf1('0x2e')]=_[_0xfaf1('0x2f')](_0x5206fc[_0xfaf1('0x2b')],_0x5206fc[_0xfaf1('0x2d')]);_0x6187fd[_0xfaf1('0x31')]=_[_0xfaf1('0x2f')](_0x5206fc[_0xfaf1('0x2b')],qs[_0xfaf1('0x30')](_0x4f4208[_0xfaf1('0x2d')]['fields']));_0x6187fd[_0xfaf1('0x31')]=_0x6187fd[_0xfaf1('0x31')][_0xfaf1('0x41')]?_0x6187fd[_0xfaf1('0x31')]:_0x5206fc[_0xfaf1('0x2b')];if(_0x4f4208[_0xfaf1('0x2d')][_0xfaf1('0x3b')]){_0x6187fd[_0xfaf1('0x42')]=[{'all':!![]}];}_0x6187fd=_[_0xfaf1('0x39')]({},_0x6187fd,_0x4f4208[_0xfaf1('0x3a')]);return db[_0xfaf1('0x27')][_0xfaf1('0x43')](_0x6187fd)[_0xfaf1('0x3c')](handleEntityNotFound(_0x4b9d05,null))[_0xfaf1('0x3c')](respondWithResult(_0x4b9d05,null))[_0xfaf1('0x3e')](handleError(_0x4b9d05,null));};exports[_0xfaf1('0x44')]=function(_0x42f087,_0xc02b79){return db[_0xfaf1('0x27')][_0xfaf1('0x44')](_0x42f087[_0xfaf1('0x45')],{})[_0xfaf1('0x3c')](respondWithResult(_0xc02b79,0xc9))['catch'](handleError(_0xc02b79,null));};exports['update']=function(_0x5b0559,_0x807c27){if(_0x5b0559['body']['id']){delete _0x5b0559[_0xfaf1('0x45')]['id'];}return db[_0xfaf1('0x27')][_0xfaf1('0x43')]({'where':{'id':_0x5b0559[_0xfaf1('0x40')]['id']}})[_0xfaf1('0x3c')](handleEntityNotFound(_0x807c27,null))[_0xfaf1('0x3c')](saveUpdates(_0x5b0559[_0xfaf1('0x45')],null))[_0xfaf1('0x3c')](respondWithResult(_0x807c27,null))[_0xfaf1('0x3e')](handleError(_0x807c27,null));};exports[_0xfaf1('0x23')]=function(_0x21f8d7,_0x57b4bf){return db['SmsQueueReport']['find']({'where':{'id':_0x21f8d7[_0xfaf1('0x40')]['id']}})['then'](handleEntityNotFound(_0x57b4bf,null))[_0xfaf1('0x3c')](removeEntity(_0x57b4bf,null))[_0xfaf1('0x3e')](handleError(_0x57b4bf,null));};exports[_0xfaf1('0x46')]=function(_0x233466,_0x139121){return db[_0xfaf1('0x27')][_0xfaf1('0x46')]()[_0xfaf1('0x3c')](respondWithResult(_0x139121,null))[_0xfaf1('0x3e')](handleError(_0x139121,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index f5b7aff..79fffe0 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util'];(function(_0x2958f8,_0x1b8fda){var _0x1a02c0=function(_0x47642c){while(--_0x47642c){_0x2958f8['push'](_0x2958f8['shift']());}};_0x1a02c0(++_0x1b8fda);}(_0xe706,0xa3));var _0x6e70=function(_0x180fcb,_0x208b94){_0x180fcb=_0x180fcb-0x0;var _0x515f0d=_0xe706[_0x180fcb];return _0x515f0d;};'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 _0xcb91=['path','rimraf','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x39ed8,_0x259fd6){var _0x4dfbd0=function(_0x4763eb){while(--_0x4763eb){_0x39ed8['push'](_0x39ed8['shift']());}};_0x4dfbd0(++_0x259fd6);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x249e96,_0x3ea39d){_0x249e96=_0x249e96-0x0;var _0x17444c=_0xcb91[_0x249e96];return _0x17444c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('SmsQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index b97292d..e2210c6 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 _0x92f7=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','request','then','SmsQueueReport,\x20%s,\x20%s','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','debug','update','where','attributes','limit','UpdateSmsQueueReport','lodash','util'];(function(_0x1dbfc6,_0x3044fb){var _0x22c2e1=function(_0xbc2deb){while(--_0xbc2deb){_0x1dbfc6['push'](_0x1dbfc6['shift']());}};_0x22c2e1(++_0x3044fb);}(_0x92f7,0xbe));var _0x792f=function(_0x26e727,_0x3e65be){_0x26e727=_0x26e727-0x0;var _0x563800=_0x92f7[_0x26e727];return _0x563800;};'use strict';var _=require(_0x792f('0x0'));var util=require(_0x792f('0x1'));var moment=require(_0x792f('0x2'));var BPromise=require(_0x792f('0x3'));var rs=require(_0x792f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x792f('0x5'))['db'];var utils=require(_0x792f('0x6'));var logger=require('../../config/logger')(_0x792f('0x7'));var config=require('../../config/environment');var jayson=require(_0x792f('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x332d62,_0x4ec057,_0x57da2d){return new BPromise(function(_0x451fd8,_0x5d4640){return client[_0x792f('0x9')](_0x332d62,_0x57da2d)[_0x792f('0xa')](function(_0x4dadee){logger['info'](_0x792f('0xb'),_0x4ec057,_0x792f('0xc'));logger['debug'](_0x792f('0xd'),_0x4ec057,_0x792f('0xc'),JSON[_0x792f('0xe')](_0x4dadee));if(_0x4dadee[_0x792f('0xf')]){if(_0x4dadee[_0x792f('0xf')]['code']===0x1f4){logger[_0x792f('0xf')](_0x792f('0xb'),_0x4ec057,_0x4dadee[_0x792f('0xf')]['message']);return _0x5d4640(_0x4dadee['error'][_0x792f('0x10')]);}logger[_0x792f('0xf')](_0x792f('0xb'),_0x4ec057,_0x4dadee[_0x792f('0xf')][_0x792f('0x10')]);return _0x451fd8(_0x4dadee[_0x792f('0xf')][_0x792f('0x10')]);}else{logger[_0x792f('0x11')](_0x792f('0xb'),_0x4ec057,_0x792f('0xc'));_0x451fd8(_0x4dadee[_0x792f('0x12')][_0x792f('0x10')]);}})[_0x792f('0x13')](function(_0x2bdad5){logger[_0x792f('0xf')](_0x792f('0xb'),_0x4ec057,_0x2bdad5);_0x5d4640(_0x2bdad5);});});}exports[_0x792f('0x14')]=function(_0x38f57b){var _0x2278a2=this;return new Promise(function(_0x219f99,_0x1db6eb){return db[_0x792f('0x15')][_0x792f('0x16')](_0x38f57b[_0x792f('0x17')],{'raw':_0x38f57b[_0x792f('0x18')]?_0x38f57b['options'][_0x792f('0x19')]===undefined?!![]:![]:!![]})[_0x792f('0xa')](function(_0x1ed068){logger[_0x792f('0x11')]('CreateSmsQueueReport',_0x38f57b);logger[_0x792f('0x1a')](_0x792f('0x14'),_0x38f57b,JSON[_0x792f('0xe')](_0x1ed068));_0x219f99(_0x1ed068);})[_0x792f('0x13')](function(_0x23b0cc){logger[_0x792f('0xf')](_0x792f('0x14'),_0x23b0cc[_0x792f('0x10')],_0x38f57b);_0x1db6eb(_0x2278a2[_0x792f('0xf')](0x1f4,_0x23b0cc[_0x792f('0x10')]));});});};exports['UpdateSmsQueueReport']=function(_0x56e936){var _0x260fae=this;return new Promise(function(_0x2e2bff,_0x5dd1ca){return db['SmsQueueReport'][_0x792f('0x1b')](_0x56e936[_0x792f('0x17')],{'raw':_0x56e936['options']?_0x56e936[_0x792f('0x18')][_0x792f('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56e936[_0x792f('0x18')]?_0x56e936['options'][_0x792f('0x1c')]||null:null,'attributes':_0x56e936[_0x792f('0x18')]?_0x56e936['options'][_0x792f('0x1d')]||null:null,'limit':_0x56e936[_0x792f('0x18')]?_0x56e936['options'][_0x792f('0x1e')]||null:null})['then'](function(_0x1c354c){logger[_0x792f('0x11')]('UpdateSmsQueueReport',_0x56e936);logger[_0x792f('0x1a')](_0x792f('0x1f'),_0x56e936,JSON[_0x792f('0xe')](_0x1c354c));_0x2e2bff(_0x1c354c);})[_0x792f('0x13')](function(_0x36c6d2){logger['error']('UpdateSmsQueueReport',_0x36c6d2['message'],_0x56e936);_0x5dd1ca(_0x260fae[_0x792f('0xf')](0x1f4,_0x36c6d2['message']));});});}; \ No newline at end of file +var _0x7220=['catch','CreateSmsQueueReport','SmsQueueReport','create','options','raw','UpdateSmsQueueReport','update','where','attributes','limit','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5f3bfb,_0x2ab7d9){var _0xa3e1a9=function(_0x2fde2c){while(--_0x2fde2c){_0x5f3bfb['push'](_0x5f3bfb['shift']());}};_0xa3e1a9(++_0x2ab7d9);}(_0x7220,0x12b));var _0x0722=function(_0x51e08e,_0x3aeb82){_0x51e08e=_0x51e08e-0x0;var _0x564615=_0x7220[_0x51e08e];return _0x564615;};'use strict';var _=require('lodash');var util=require(_0x0722('0x0'));var moment=require(_0x0722('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0722('0x2'));var db=require(_0x0722('0x3'))['db'];var utils=require(_0x0722('0x4'));var logger=require(_0x0722('0x5'))(_0x0722('0x6'));var config=require(_0x0722('0x7'));var jayson=require(_0x0722('0x8'));var client=jayson[_0x0722('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x324757,_0x1c6a25,_0x34fb6b){return new BPromise(function(_0x22eadb,_0x57415d){return client[_0x0722('0xa')](_0x324757,_0x34fb6b)[_0x0722('0xb')](function(_0x552e3a){logger[_0x0722('0xc')](_0x0722('0xd'),_0x1c6a25,_0x0722('0xe'));logger[_0x0722('0xf')](_0x0722('0x10'),_0x1c6a25,_0x0722('0xe'),JSON[_0x0722('0x11')](_0x552e3a));if(_0x552e3a['error']){if(_0x552e3a[_0x0722('0x12')][_0x0722('0x13')]===0x1f4){logger['error'](_0x0722('0xd'),_0x1c6a25,_0x552e3a[_0x0722('0x12')]['message']);return _0x57415d(_0x552e3a['error']['message']);}logger[_0x0722('0x12')](_0x0722('0xd'),_0x1c6a25,_0x552e3a[_0x0722('0x12')][_0x0722('0x14')]);return _0x22eadb(_0x552e3a[_0x0722('0x12')][_0x0722('0x14')]);}else{logger['info'](_0x0722('0xd'),_0x1c6a25,_0x0722('0xe'));_0x22eadb(_0x552e3a['result'][_0x0722('0x14')]);}})[_0x0722('0x15')](function(_0x38dce3){logger[_0x0722('0x12')]('SmsQueueReport,\x20%s,\x20%s',_0x1c6a25,_0x38dce3);_0x57415d(_0x38dce3);});});}exports[_0x0722('0x16')]=function(_0x175bc3){var _0x283879=this;return new Promise(function(_0x4b824f,_0x24c9ec){return db[_0x0722('0x17')][_0x0722('0x18')](_0x175bc3['body'],{'raw':_0x175bc3[_0x0722('0x19')]?_0x175bc3[_0x0722('0x19')][_0x0722('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x190fb1){logger[_0x0722('0xc')](_0x0722('0x16'),_0x175bc3);logger[_0x0722('0xf')](_0x0722('0x16'),_0x175bc3,JSON[_0x0722('0x11')](_0x190fb1));_0x4b824f(_0x190fb1);})[_0x0722('0x15')](function(_0x18b7c1){logger[_0x0722('0x12')](_0x0722('0x16'),_0x18b7c1['message'],_0x175bc3);_0x24c9ec(_0x283879['error'](0x1f4,_0x18b7c1[_0x0722('0x14')]));});});};exports[_0x0722('0x1b')]=function(_0x209788){var _0x3dfadf=this;return new Promise(function(_0x53b0a8,_0x4f5ab1){return db['SmsQueueReport'][_0x0722('0x1c')](_0x209788['body'],{'raw':_0x209788[_0x0722('0x19')]?_0x209788[_0x0722('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x209788[_0x0722('0x19')]?_0x209788[_0x0722('0x19')][_0x0722('0x1d')]||null:null,'attributes':_0x209788[_0x0722('0x19')]?_0x209788[_0x0722('0x19')][_0x0722('0x1e')]||null:null,'limit':_0x209788[_0x0722('0x19')]?_0x209788[_0x0722('0x19')][_0x0722('0x1f')]||null:null})[_0x0722('0xb')](function(_0xbd3db8){logger[_0x0722('0xc')](_0x0722('0x1b'),_0x209788);logger[_0x0722('0xf')]('UpdateSmsQueueReport',_0x209788,JSON['stringify'](_0xbd3db8));_0x53b0a8(_0xbd3db8);})['catch'](function(_0x392f07){logger[_0x0722('0x12')](_0x0722('0x1b'),_0x392f07[_0x0722('0x14')],_0x209788);_0x4f5ab1(_0x3dfadf['error'](0x1f4,_0x392f07['message']));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 1e98ad0..4b47ea5 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 _0x9c5a=['fs-extra','../../components/interaction/service','../../config/environment','get','index','describe','isAuthenticated','show','create','update','delete','/:id','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x37f666,_0x17284f){_0x37f666=_0x37f666-0x0;var _0x29f7e5=_0x9c5a[_0x37f666];return _0x29f7e5;};'use strict';var multer=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var path=require('path');var timeout=require(_0xa9c5('0x2'));var express=require(_0xa9c5('0x3'));var router=express[_0xa9c5('0x4')]();var fs_extra=require(_0xa9c5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa9c5('0x6'));var config=require(_0xa9c5('0x7'));var controller=require('./smsTransferReport.controller');router[_0xa9c5('0x8')]('/',auth['isAuthenticated'](),controller[_0xa9c5('0x9')]);router[_0xa9c5('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xa9c5('0xa')]);router[_0xa9c5('0x8')]('/:id',auth[_0xa9c5('0xb')](),controller[_0xa9c5('0xc')]);router['post']('/',auth[_0xa9c5('0xb')](),controller[_0xa9c5('0xd')]);router['put']('/:id',auth[_0xa9c5('0xb')](),controller[_0xa9c5('0xe')]);router[_0xa9c5('0xf')](_0xa9c5('0x10'),auth[_0xa9c5('0xb')](),controller[_0xa9c5('0x11')]);module[_0xa9c5('0x12')]=router; \ No newline at end of file +var _0x08d9=['fs-extra','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','multer','path','express','Router'];(function(_0x1b6911,_0x3ffb3c){var _0x26f1dd=function(_0xc18660){while(--_0xc18660){_0x1b6911['push'](_0x1b6911['shift']());}};_0x26f1dd(++_0x3ffb3c);}(_0x08d9,0xc2));var _0x908d=function(_0x32aaa5,_0x45c662){_0x32aaa5=_0x32aaa5-0x0;var _0x45b69e=_0x08d9[_0x32aaa5];return _0x45b69e;};'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 diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index c90928c..152e949 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x4c72f2,_0x42aba8){var _0xd26d61=function(_0x29aa96){while(--_0x29aa96){_0x4c72f2['push'](_0x4c72f2['shift']());}};_0xd26d61(++_0x42aba8);}(_0xaa88,0x137));var _0x8aa8=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xaa88[_0x4154a6];return _0x3b2786;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file +var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x2a4095,_0x13f4f0){var _0x52eeab=function(_0x3950dd){while(--_0x3950dd){_0x2a4095['push'](_0x2a4095['shift']());}};_0x52eeab(++_0x13f4f0);}(_0x9c44,0x178));var _0x49c4=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x9c44[_0x2e4aa2];return _0x5e6092;};'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 0ac03cd..b3ffd4d 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 _0x9a63=['includeAll','findAll','rows','show','params','options','catch','create','body','destroy','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','querystring','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','save','update','then','error','stack','send','map','SmsTransferReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','name','filter'];(function(_0x4f62df,_0x1a3b57){var _0x2e1a12=function(_0x11cf8e){while(--_0x11cf8e){_0x4f62df['push'](_0x4f62df['shift']());}};_0x2e1a12(++_0x1a3b57);}(_0x9a63,0x11c));var _0x39a6=function(_0x374ff6,_0x30546f){_0x374ff6=_0x374ff6-0x0;var _0x58203b=_0x9a63[_0x374ff6];return _0x58203b;};'use strict';var emlformat=require(_0x39a6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x39a6('0x1'));var jsonpatch=require(_0x39a6('0x2'));var rp=require(_0x39a6('0x3'));var moment=require(_0x39a6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x39a6('0x5'));var util=require(_0x39a6('0x6'));var path=require(_0x39a6('0x7'));var sox=require('sox');var csv=require(_0x39a6('0x8'));var ejs=require(_0x39a6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x39a6('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x39a6('0x8'));var querystring=require(_0x39a6('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x39a6('0xc'));var qs=require(_0x39a6('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x39a6('0xe'));var utils=require(_0x39a6('0xf'));var config=require('../../config/environment');var licenseUtil=require(_0x39a6('0x10'));var db=require(_0x39a6('0x11'))['db'];function respondWithStatusCode(_0x2f05b9,_0x3d6f3a){_0x3d6f3a=_0x3d6f3a||0xcc;return function(_0x44c179){if(_0x44c179){return _0x2f05b9[_0x39a6('0x12')](_0x3d6f3a);}return _0x2f05b9['status'](_0x3d6f3a)[_0x39a6('0x13')]();};}function respondWithResult(_0x3e365a,_0x598200){_0x598200=_0x598200||0xc8;return function(_0x39fc09){if(_0x39fc09){return _0x3e365a[_0x39a6('0x14')](_0x598200)[_0x39a6('0x15')](_0x39fc09);}};}function respondWithFilteredResult(_0x3047d0,_0x5e74a5){return function(_0x3afb7d){if(_0x3afb7d){var _0x52aa26=typeof _0x5e74a5[_0x39a6('0x16')]===_0x39a6('0x17')&&typeof _0x5e74a5['limit']===_0x39a6('0x17');var _0x211ac0=_0x3afb7d[_0x39a6('0x18')];var _0x46a2c9=_0x52aa26?0x0:_0x5e74a5[_0x39a6('0x16')];var _0x2d1235=_0x52aa26?_0x3afb7d[_0x39a6('0x18')]:_0x5e74a5[_0x39a6('0x16')]+_0x5e74a5[_0x39a6('0x19')];var _0x134cb6;if(_0x2d1235>=_0x211ac0){_0x2d1235=_0x211ac0;_0x134cb6=0xc8;}else{_0x134cb6=0xce;}_0x3047d0['status'](_0x134cb6);return _0x3047d0[_0x39a6('0x1a')](_0x39a6('0x1b'),_0x46a2c9+'-'+_0x2d1235+'/'+_0x211ac0)[_0x39a6('0x15')](_0x3afb7d);}return null;};}function patchUpdates(_0xf22187){return function(_0x319edb){try{jsonpatch['apply'](_0x319edb,_0xf22187,!![]);}catch(_0x18b107){return BPromise['reject'](_0x18b107);}return _0x319edb[_0x39a6('0x1c')]();};}function saveUpdates(_0x3a7e81,_0x55f14b){return function(_0xe32eb7){if(_0xe32eb7){return _0xe32eb7[_0x39a6('0x1d')](_0x3a7e81)['then'](function(_0x138a6c){return _0x138a6c;});}return null;};}function removeEntity(_0x19da10,_0x5a430d){return function(_0x1d8fcd){if(_0x1d8fcd){return _0x1d8fcd['destroy']()[_0x39a6('0x1e')](function(){_0x19da10[_0x39a6('0x14')](0xcc)[_0x39a6('0x13')]();});}};}function handleEntityNotFound(_0x4580b8,_0x5df984){return function(_0x8b67a5){if(!_0x8b67a5){_0x4580b8[_0x39a6('0x12')](0x194);}return _0x8b67a5;};}function handleError(_0x2af200,_0x416ffd){_0x416ffd=_0x416ffd||0x1f4;return function(_0x34716a){logger[_0x39a6('0x1f')](_0x34716a[_0x39a6('0x20')]);if(_0x34716a['name']){delete _0x34716a['name'];}_0x2af200[_0x39a6('0x14')](_0x416ffd)[_0x39a6('0x21')](_0x34716a);};}exports['index']=function(_0x323b0b,_0x3d0dee){var _0xb39394={},_0x606db0={},_0x24f15c={'count':0x0,'rows':[]};var _0x3feba4=_[_0x39a6('0x22')](db[_0x39a6('0x23')][_0x39a6('0x24')],function(_0x2bd0e7){return{'name':_0x2bd0e7['fieldName'],'type':_0x2bd0e7[_0x39a6('0x25')][_0x39a6('0x26')]};});_0x606db0[_0x39a6('0x27')]=_['map'](_0x3feba4,'name');_0x606db0[_0x39a6('0x28')]=_[_0x39a6('0x29')](_0x323b0b[_0x39a6('0x28')]);_0x606db0[_0x39a6('0x2a')]=_[_0x39a6('0x2b')](_0x606db0[_0x39a6('0x27')],_0x606db0['query']);_0xb39394[_0x39a6('0x2c')]=_[_0x39a6('0x2b')](_0x606db0[_0x39a6('0x27')],qs[_0x39a6('0x2d')](_0x323b0b[_0x39a6('0x28')][_0x39a6('0x2d')]));_0xb39394[_0x39a6('0x2c')]=_0xb39394[_0x39a6('0x2c')][_0x39a6('0x2e')]?_0xb39394[_0x39a6('0x2c')]:_0x606db0[_0x39a6('0x27')];if(!_0x323b0b[_0x39a6('0x28')][_0x39a6('0x2f')](_0x39a6('0x30'))){_0xb39394[_0x39a6('0x19')]=qs[_0x39a6('0x19')](_0x323b0b['query'][_0x39a6('0x19')]);_0xb39394[_0x39a6('0x16')]=qs[_0x39a6('0x16')](_0x323b0b[_0x39a6('0x28')]['offset']);}_0xb39394[_0x39a6('0x31')]=qs[_0x39a6('0x32')](_0x323b0b[_0x39a6('0x28')]['sort']);_0xb39394[_0x39a6('0x33')]=qs['filters'](_[_0x39a6('0x34')](_0x323b0b['query'],_0x606db0['filters']),_0x3feba4);if(_0x323b0b['query']['filter']){_0xb39394[_0x39a6('0x33')]=_[_0x39a6('0x35')](_0xb39394[_0x39a6('0x33')],{'$or':_['map'](_0x3feba4,function(_0x2779fd){if(_0x2779fd[_0x39a6('0x25')]!=='VIRTUAL'){var _0x135005={};_0x135005[_0x2779fd[_0x39a6('0x36')]]={'$like':'%'+_0x323b0b[_0x39a6('0x28')][_0x39a6('0x37')]+'%'};return _0x135005;}})});}_0xb39394=_[_0x39a6('0x35')]({},_0xb39394,_0x323b0b['options']);var _0x63da96={'where':_0xb39394[_0x39a6('0x33')]};return db[_0x39a6('0x23')][_0x39a6('0x18')](_0x63da96)[_0x39a6('0x1e')](function(_0x50fb47){_0x24f15c['count']=_0x50fb47;if(_0x323b0b[_0x39a6('0x28')][_0x39a6('0x38')]){_0xb39394['include']=[{'all':!![]}];}return db[_0x39a6('0x23')][_0x39a6('0x39')](_0xb39394);})['then'](function(_0x3ce9fa){_0x24f15c[_0x39a6('0x3a')]=_0x3ce9fa;return _0x24f15c;})[_0x39a6('0x1e')](respondWithFilteredResult(_0x3d0dee,_0xb39394))['catch'](handleError(_0x3d0dee,null));};exports[_0x39a6('0x3b')]=function(_0x248098,_0x27ddf7){var _0x4dd865={'raw':!![],'where':{'id':_0x248098[_0x39a6('0x3c')]['id']}},_0x2b0712={};_0x2b0712['model']=_['keys'](db[_0x39a6('0x23')][_0x39a6('0x24')]);_0x2b0712[_0x39a6('0x28')]=_[_0x39a6('0x29')](_0x248098['query']);_0x2b0712[_0x39a6('0x2a')]=_[_0x39a6('0x2b')](_0x2b0712[_0x39a6('0x27')],_0x2b0712[_0x39a6('0x28')]);_0x4dd865[_0x39a6('0x2c')]=_[_0x39a6('0x2b')](_0x2b0712[_0x39a6('0x27')],qs[_0x39a6('0x2d')](_0x248098[_0x39a6('0x28')][_0x39a6('0x2d')]));_0x4dd865[_0x39a6('0x2c')]=_0x4dd865['attributes'][_0x39a6('0x2e')]?_0x4dd865['attributes']:_0x2b0712[_0x39a6('0x27')];if(_0x248098[_0x39a6('0x28')][_0x39a6('0x38')]){_0x4dd865['include']=[{'all':!![]}];}_0x4dd865=_['merge']({},_0x4dd865,_0x248098[_0x39a6('0x3d')]);return db[_0x39a6('0x23')]['find'](_0x4dd865)['then'](handleEntityNotFound(_0x27ddf7,null))[_0x39a6('0x1e')](respondWithResult(_0x27ddf7,null))[_0x39a6('0x3e')](handleError(_0x27ddf7,null));};exports['create']=function(_0x154a5a,_0x38791c){return db[_0x39a6('0x23')][_0x39a6('0x3f')](_0x154a5a[_0x39a6('0x40')],{})['then'](respondWithResult(_0x38791c,0xc9))[_0x39a6('0x3e')](handleError(_0x38791c,null));};exports[_0x39a6('0x1d')]=function(_0x31ad4a,_0x1b561f){if(_0x31ad4a[_0x39a6('0x40')]['id']){delete _0x31ad4a['body']['id'];}return db['SmsTransferReport']['find']({'where':{'id':_0x31ad4a[_0x39a6('0x3c')]['id']}})[_0x39a6('0x1e')](handleEntityNotFound(_0x1b561f,null))['then'](saveUpdates(_0x31ad4a['body'],null))[_0x39a6('0x1e')](respondWithResult(_0x1b561f,null))[_0x39a6('0x3e')](handleError(_0x1b561f,null));};exports[_0x39a6('0x41')]=function(_0x40a185,_0x21a755){return db['SmsTransferReport'][_0x39a6('0x42')]({'where':{'id':_0x40a185[_0x39a6('0x3c')]['id']}})[_0x39a6('0x1e')](handleEntityNotFound(_0x21a755,null))['then'](removeEntity(_0x21a755,null))[_0x39a6('0x3e')](handleError(_0x21a755,null));};exports[_0x39a6('0x43')]=function(_0x5e3adb,_0x2b689c){return db[_0x39a6('0x23')]['describe']()[_0x39a6('0x1e')](respondWithResult(_0x2b689c,null))['catch'](handleError(_0x2b689c,null));}; \ No newline at end of file +var _0x7b8b=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','SmsTransferReport','include','catch','params','rawAttributes','body','find','describe','eml-format','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs'];(function(_0x1df101,_0x21b61b){var _0x3c7b19=function(_0x2c4b2a){while(--_0x2c4b2a){_0x1df101['push'](_0x1df101['shift']());}};_0x3c7b19(++_0x21b61b);}(_0x7b8b,0xc9));var _0xb7b8=function(_0x366e99,_0x15d82d){_0x366e99=_0x366e99-0x0;var _0x180bbe=_0x7b8b[_0x366e99];return _0x180bbe;};'use strict';var emlformat=require(_0xb7b8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb7b8('0x1'));var moment=require(_0xb7b8('0x2'));var BPromise=require(_0xb7b8('0x3'));var Mustache=require(_0xb7b8('0x4'));var util=require(_0xb7b8('0x5'));var path=require(_0xb7b8('0x6'));var sox=require('sox');var csv=require(_0xb7b8('0x7'));var ejs=require(_0xb7b8('0x8'));var fs=require('fs');var fs_extra=require(_0xb7b8('0x9'));var _=require(_0xb7b8('0xa'));var squel=require(_0xb7b8('0xb'));var crypto=require(_0xb7b8('0xc'));var jsforce=require(_0xb7b8('0xd'));var deskjs=require(_0xb7b8('0xe'));var toCsv=require(_0xb7b8('0x7'));var querystring=require('querystring');var Papa=require(_0xb7b8('0xf'));var Redis=require(_0xb7b8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb7b8('0x11'));var as=require(_0xb7b8('0x12'));var hardwareService=require(_0xb7b8('0x13'));var logger=require(_0xb7b8('0x14'))(_0xb7b8('0x15'));var utils=require(_0xb7b8('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xb7b8('0x17'));var db=require(_0xb7b8('0x18'))['db'];function respondWithStatusCode(_0x58eb99,_0x57531b){_0x57531b=_0x57531b||0xcc;return function(_0x548dc9){if(_0x548dc9){return _0x58eb99[_0xb7b8('0x19')](_0x57531b);}return _0x58eb99[_0xb7b8('0x1a')](_0x57531b)['end']();};}function respondWithResult(_0x38b023,_0x11ce65){_0x11ce65=_0x11ce65||0xc8;return function(_0x335384){if(_0x335384){return _0x38b023['status'](_0x11ce65)[_0xb7b8('0x1b')](_0x335384);}};}function respondWithFilteredResult(_0x265905,_0x5286a3){return function(_0x538d47){if(_0x538d47){var _0x3cca57=typeof _0x5286a3['offset']===_0xb7b8('0x1c')&&typeof _0x5286a3[_0xb7b8('0x1d')]===_0xb7b8('0x1c');var _0x22f3b3=_0x538d47[_0xb7b8('0x1e')];var _0x563e0d=_0x3cca57?0x0:_0x5286a3[_0xb7b8('0x1f')];var _0x39c793=_0x3cca57?_0x538d47[_0xb7b8('0x1e')]:_0x5286a3[_0xb7b8('0x1f')]+_0x5286a3[_0xb7b8('0x1d')];var _0x2882e0;if(_0x39c793>=_0x22f3b3){_0x39c793=_0x22f3b3;_0x2882e0=0xc8;}else{_0x2882e0=0xce;}_0x265905[_0xb7b8('0x1a')](_0x2882e0);return _0x265905[_0xb7b8('0x20')](_0xb7b8('0x21'),_0x563e0d+'-'+_0x39c793+'/'+_0x22f3b3)[_0xb7b8('0x1b')](_0x538d47);}return null;};}function patchUpdates(_0xd10db2){return function(_0x143f78){try{jsonpatch['apply'](_0x143f78,_0xd10db2,!![]);}catch(_0x32b623){return BPromise[_0xb7b8('0x22')](_0x32b623);}return _0x143f78[_0xb7b8('0x23')]();};}function saveUpdates(_0x1889ce,_0x12be87){return function(_0x18503a){if(_0x18503a){return _0x18503a[_0xb7b8('0x24')](_0x1889ce)[_0xb7b8('0x25')](function(_0x10039c){return _0x10039c;});}return null;};}function removeEntity(_0x29d6e1,_0x2fd16d){return function(_0xc8b89e){if(_0xc8b89e){return _0xc8b89e[_0xb7b8('0x26')]()[_0xb7b8('0x25')](function(){_0x29d6e1['status'](0xcc)[_0xb7b8('0x27')]();});}};}function handleEntityNotFound(_0xb95398,_0x26e53f){return function(_0x390a6a){if(!_0x390a6a){_0xb95398[_0xb7b8('0x19')](0x194);}return _0x390a6a;};}function handleError(_0x291d5f,_0x3fe56b){_0x3fe56b=_0x3fe56b||0x1f4;return function(_0x24ed7b){logger[_0xb7b8('0x28')](_0x24ed7b[_0xb7b8('0x29')]);if(_0x24ed7b[_0xb7b8('0x2a')]){delete _0x24ed7b[_0xb7b8('0x2a')];}_0x291d5f[_0xb7b8('0x1a')](_0x3fe56b)[_0xb7b8('0x2b')](_0x24ed7b);};}exports[_0xb7b8('0x2c')]=function(_0x597fd6,_0x92a27f){var _0x261543={},_0x17cf97={},_0x303d6e={'count':0x0,'rows':[]};var _0x2dc925=_[_0xb7b8('0x2d')](db['SmsTransferReport']['rawAttributes'],function(_0x40480a){return{'name':_0x40480a[_0xb7b8('0x2e')],'type':_0x40480a[_0xb7b8('0x2f')][_0xb7b8('0x30')]};});_0x17cf97[_0xb7b8('0x31')]=_[_0xb7b8('0x2d')](_0x2dc925,_0xb7b8('0x2a'));_0x17cf97[_0xb7b8('0x32')]=_[_0xb7b8('0x33')](_0x597fd6[_0xb7b8('0x32')]);_0x17cf97[_0xb7b8('0x34')]=_[_0xb7b8('0x35')](_0x17cf97[_0xb7b8('0x31')],_0x17cf97[_0xb7b8('0x32')]);_0x261543[_0xb7b8('0x36')]=_[_0xb7b8('0x35')](_0x17cf97[_0xb7b8('0x31')],qs['fields'](_0x597fd6[_0xb7b8('0x32')][_0xb7b8('0x37')]));_0x261543[_0xb7b8('0x36')]=_0x261543['attributes'][_0xb7b8('0x38')]?_0x261543['attributes']:_0x17cf97[_0xb7b8('0x31')];if(!_0x597fd6[_0xb7b8('0x32')]['hasOwnProperty'](_0xb7b8('0x39'))){_0x261543[_0xb7b8('0x1d')]=qs['limit'](_0x597fd6['query'][_0xb7b8('0x1d')]);_0x261543[_0xb7b8('0x1f')]=qs[_0xb7b8('0x1f')](_0x597fd6[_0xb7b8('0x32')][_0xb7b8('0x1f')]);}_0x261543[_0xb7b8('0x3a')]=qs[_0xb7b8('0x3b')](_0x597fd6[_0xb7b8('0x32')][_0xb7b8('0x3b')]);_0x261543[_0xb7b8('0x3c')]=qs[_0xb7b8('0x34')](_[_0xb7b8('0x3d')](_0x597fd6[_0xb7b8('0x32')],_0x17cf97[_0xb7b8('0x34')]),_0x2dc925);if(_0x597fd6[_0xb7b8('0x32')]['filter']){_0x261543[_0xb7b8('0x3c')]=_[_0xb7b8('0x3e')](_0x261543[_0xb7b8('0x3c')],{'$or':_[_0xb7b8('0x2d')](_0x2dc925,function(_0x5c5edb){if(_0x5c5edb[_0xb7b8('0x2f')]!==_0xb7b8('0x3f')){var _0x3cb7a8={};_0x3cb7a8[_0x5c5edb[_0xb7b8('0x2a')]]={'$like':'%'+_0x597fd6[_0xb7b8('0x32')][_0xb7b8('0x40')]+'%'};return _0x3cb7a8;}})});}_0x261543=_[_0xb7b8('0x3e')]({},_0x261543,_0x597fd6['options']);var _0x33914c={'where':_0x261543[_0xb7b8('0x3c')]};return db[_0xb7b8('0x41')][_0xb7b8('0x1e')](_0x33914c)[_0xb7b8('0x25')](function(_0x4d7687){_0x303d6e[_0xb7b8('0x1e')]=_0x4d7687;if(_0x597fd6[_0xb7b8('0x32')]['includeAll']){_0x261543[_0xb7b8('0x42')]=[{'all':!![]}];}return db['SmsTransferReport']['findAll'](_0x261543);})[_0xb7b8('0x25')](function(_0x5c4e96){_0x303d6e['rows']=_0x5c4e96;return _0x303d6e;})[_0xb7b8('0x25')](respondWithFilteredResult(_0x92a27f,_0x261543))[_0xb7b8('0x43')](handleError(_0x92a27f,null));};exports['show']=function(_0x5d6888,_0x418805){var _0x2d74c8={'raw':!![],'where':{'id':_0x5d6888[_0xb7b8('0x44')]['id']}},_0x3ae476={};_0x3ae476[_0xb7b8('0x31')]=_[_0xb7b8('0x33')](db[_0xb7b8('0x41')][_0xb7b8('0x45')]);_0x3ae476[_0xb7b8('0x32')]=_[_0xb7b8('0x33')](_0x5d6888['query']);_0x3ae476[_0xb7b8('0x34')]=_[_0xb7b8('0x35')](_0x3ae476['model'],_0x3ae476[_0xb7b8('0x32')]);_0x2d74c8[_0xb7b8('0x36')]=_[_0xb7b8('0x35')](_0x3ae476[_0xb7b8('0x31')],qs['fields'](_0x5d6888['query'][_0xb7b8('0x37')]));_0x2d74c8[_0xb7b8('0x36')]=_0x2d74c8[_0xb7b8('0x36')][_0xb7b8('0x38')]?_0x2d74c8[_0xb7b8('0x36')]:_0x3ae476[_0xb7b8('0x31')];if(_0x5d6888[_0xb7b8('0x32')]['includeAll']){_0x2d74c8[_0xb7b8('0x42')]=[{'all':!![]}];}_0x2d74c8=_[_0xb7b8('0x3e')]({},_0x2d74c8,_0x5d6888['options']);return db[_0xb7b8('0x41')]['find'](_0x2d74c8)['then'](handleEntityNotFound(_0x418805,null))[_0xb7b8('0x25')](respondWithResult(_0x418805,null))[_0xb7b8('0x43')](handleError(_0x418805,null));};exports['create']=function(_0x115d56,_0x2dc265){return db['SmsTransferReport']['create'](_0x115d56[_0xb7b8('0x46')],{})['then'](respondWithResult(_0x2dc265,0xc9))[_0xb7b8('0x43')](handleError(_0x2dc265,null));};exports[_0xb7b8('0x24')]=function(_0x383bd2,_0x170102){if(_0x383bd2[_0xb7b8('0x46')]['id']){delete _0x383bd2[_0xb7b8('0x46')]['id'];}return db[_0xb7b8('0x41')][_0xb7b8('0x47')]({'where':{'id':_0x383bd2[_0xb7b8('0x44')]['id']}})[_0xb7b8('0x25')](handleEntityNotFound(_0x170102,null))[_0xb7b8('0x25')](saveUpdates(_0x383bd2[_0xb7b8('0x46')],null))[_0xb7b8('0x25')](respondWithResult(_0x170102,null))['catch'](handleError(_0x170102,null));};exports[_0xb7b8('0x26')]=function(_0x432900,_0x3335f8){return db[_0xb7b8('0x41')][_0xb7b8('0x47')]({'where':{'id':_0x432900[_0xb7b8('0x44')]['id']}})[_0xb7b8('0x25')](handleEntityNotFound(_0x3335f8,null))[_0xb7b8('0x25')](removeEntity(_0x3335f8,null))[_0xb7b8('0x43')](handleError(_0x3335f8,null));};exports[_0xb7b8('0x48')]=function(_0x891cc3,_0x15474b){return db[_0xb7b8('0x41')]['describe']()[_0xb7b8('0x25')](respondWithResult(_0x15474b,null))['catch'](handleError(_0x15474b,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 30ea75a..f78a004 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 _0xc904=['../../config/environment','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','moment','bluebird','path','rimraf'];(function(_0x37565b,_0x4bb868){var _0x7fd032=function(_0x3de752){while(--_0x3de752){_0x37565b['push'](_0x37565b['shift']());}};_0x7fd032(++_0x4bb868);}(_0xc904,0x1aa));var _0x4c90=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xc904[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0x4c90('0x0'));var util=require(_0x4c90('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4c90('0x2'));var BPromise=require(_0x4c90('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4c90('0x4'));var rimraf=require(_0x4c90('0x5'));var config=require(_0x4c90('0x6'));var attributes=require('./smsTransferReport.attributes');module[_0x4c90('0x7')]=function(_0x2dee19,_0x12343f){return _0x2dee19[_0x4c90('0x8')](_0x4c90('0x9'),attributes,{'tableName':_0x4c90('0xa'),'paranoid':![],'indexes':[{'name':_0x4c90('0xb'),'fields':[_0x4c90('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe548=['../../config/logger','api','moment','./smsTransferReport.attributes','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util'];(function(_0x4f3075,_0x3c0b65){var _0x40735f=function(_0x4a95b6){while(--_0x4a95b6){_0x4f3075['push'](_0x4f3075['shift']());}};_0x40735f(++_0x3c0b65);}(_0xe548,0x184));var _0x8e54=function(_0x2e5069,_0x3a1115){_0x2e5069=_0x2e5069-0x0;var _0x2f00ad=_0xe548[_0x2e5069];return _0x2f00ad;};'use strict';var _=require(_0x8e54('0x0'));var util=require(_0x8e54('0x1'));var logger=require(_0x8e54('0x2'))(_0x8e54('0x3'));var moment=require(_0x8e54('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8e54('0x5'));module['exports']=function(_0x288be8,_0x47a58d){return _0x288be8[_0x8e54('0x6')](_0x8e54('0x7'),attributes,{'tableName':_0x8e54('0x8'),'paranoid':![],'indexes':[{'name':_0x8e54('0x9'),'fields':[_0x8e54('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 1163aa2..686fba1 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 _0x8784=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x135786,_0x43cc30){var _0x2624af=function(_0x12c61e){while(--_0x12c61e){_0x135786['push'](_0x135786['shift']());}};_0x2624af(++_0x43cc30);}(_0x8784,0x172));var _0x4878=function(_0x215e65,_0x183f97){_0x215e65=_0x215e65-0x0;var _0xa85842=_0x8784[_0x215e65];return _0xa85842;};'use strict';var _=require(_0x4878('0x0'));var util=require(_0x4878('0x1'));var moment=require('moment');var BPromise=require(_0x4878('0x2'));var rs=require(_0x4878('0x3'));var fs=require('fs');var Redis=require(_0x4878('0x4'));var db=require(_0x4878('0x5'))['db'];var utils=require(_0x4878('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4878('0x7'));var jayson=require(_0x4878('0x8'));var client=jayson[_0x4878('0x9')][_0x4878('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe22936,_0x4148dd,_0x131e82){return new BPromise(function(_0x35cd6a,_0x29d02e){return client['request'](_0xe22936,_0x131e82)[_0x4878('0xb')](function(_0xfe196b){logger[_0x4878('0xc')](_0x4878('0xd'),_0x4148dd,_0x4878('0xe'));logger[_0x4878('0xf')](_0x4878('0x10'),_0x4148dd,_0x4878('0xe'),JSON[_0x4878('0x11')](_0xfe196b));if(_0xfe196b[_0x4878('0x12')]){if(_0xfe196b[_0x4878('0x12')][_0x4878('0x13')]===0x1f4){logger['error'](_0x4878('0xd'),_0x4148dd,_0xfe196b[_0x4878('0x12')][_0x4878('0x14')]);return _0x29d02e(_0xfe196b['error'][_0x4878('0x14')]);}logger[_0x4878('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x4148dd,_0xfe196b[_0x4878('0x12')]['message']);return _0x35cd6a(_0xfe196b['error'][_0x4878('0x14')]);}else{logger[_0x4878('0xc')](_0x4878('0xd'),_0x4148dd,_0x4878('0xe'));_0x35cd6a(_0xfe196b[_0x4878('0x15')]['message']);}})[_0x4878('0x16')](function(_0x25282f){logger['error'](_0x4878('0xd'),_0x4148dd,_0x25282f);_0x29d02e(_0x25282f);});});} \ No newline at end of file +var _0x34f8=['http','request','info','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x34f8,0x80));var _0x834f=function(_0x39f9ab,_0x127552){_0x39f9ab=_0x39f9ab-0x0;var _0x1d9d70=_0x34f8[_0x39f9ab];return _0x1d9d70;};'use strict';var _=require(_0x834f('0x0'));var util=require(_0x834f('0x1'));var moment=require(_0x834f('0x2'));var BPromise=require(_0x834f('0x3'));var rs=require(_0x834f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x834f('0x5'));var logger=require(_0x834f('0x6'))('rpc');var config=require(_0x834f('0x7'));var jayson=require(_0x834f('0x8'));var client=jayson[_0x834f('0x9')][_0x834f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5378c4,_0x4cd107,_0xf778e4){return new BPromise(function(_0x2597c6,_0x20b504){return client[_0x834f('0xb')](_0x5378c4,_0xf778e4)['then'](function(_0x4210cf){logger[_0x834f('0xc')]('SmsTransferReport,\x20%s,\x20%s',_0x4cd107,_0x834f('0xd'));logger[_0x834f('0xe')](_0x834f('0xf'),_0x4cd107,_0x834f('0xd'),JSON[_0x834f('0x10')](_0x4210cf));if(_0x4210cf[_0x834f('0x11')]){if(_0x4210cf[_0x834f('0x11')][_0x834f('0x12')]===0x1f4){logger['error'](_0x834f('0x13'),_0x4cd107,_0x4210cf[_0x834f('0x11')][_0x834f('0x14')]);return _0x20b504(_0x4210cf[_0x834f('0x11')][_0x834f('0x14')]);}logger['error'](_0x834f('0x13'),_0x4cd107,_0x4210cf[_0x834f('0x11')]['message']);return _0x2597c6(_0x4210cf[_0x834f('0x11')][_0x834f('0x14')]);}else{logger['info'](_0x834f('0x13'),_0x4cd107,'request\x20sent');_0x2597c6(_0x4210cf[_0x834f('0x15')][_0x834f('0x14')]);}})[_0x834f('0x16')](function(_0x248924){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x4cd107,_0x248924);_0x20b504(_0x248924);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 36e3109..d010c72 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 _0x530c=['isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','join','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','single','file','create','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./sound.controller'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x530c,0xbc));var _0xc530=function(_0xe052be,_0x393642){_0xe052be=_0xe052be-0x0;var _0x11ba22=_0x530c[_0xe052be];return _0x11ba22;};'use strict';var multer=require(_0xc530('0x0'));var util=require('util');var path=require(_0xc530('0x1'));var timeout=require(_0xc530('0x2'));var express=require(_0xc530('0x3'));var router=express['Router']();var fs_extra=require(_0xc530('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc530('0x5'));var config=require(_0xc530('0x6'));var controller=require(_0xc530('0x7'));router['get']('/',auth[_0xc530('0x8')](),controller[_0xc530('0x9')]);router['get'](_0xc530('0xa'),auth[_0xc530('0x8')](),controller[_0xc530('0xb')]);router['get'](_0xc530('0xc'),auth[_0xc530('0x8')](),controller[_0xc530('0xd')]);var upload=multer({'storage':multer[_0xc530('0xe')]({'destination':function(_0x44242d,_0x10fc22,_0xcdf424){_0xcdf424(null,path[_0xc530('0xf')](config['root'],_0xc530('0x10')));},'filename':function(_0x437f61,_0x2ee5a4,_0x47e64c){_0x2ee5a4[_0xc530('0x11')]=_0x2ee5a4[_0xc530('0x11')][_0xc530('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x47e64c(null,util[_0xc530('0x13')](_0xc530('0x14'),path[_0xc530('0x15')](_0x2ee5a4[_0xc530('0x11')],path['extname'](_0x2ee5a4[_0xc530('0x11')])),Date['now'](),path[_0xc530('0x16')](_0x2ee5a4['originalname'])));}})});router['post']('/',upload[_0xc530('0x17')](_0xc530('0x18')),controller[_0xc530('0x19')]);router['put'](_0xc530('0xa'),auth[_0xc530('0x8')](),controller['update']);router['delete'](_0xc530('0xa'),auth[_0xc530('0x8')](),controller[_0xc530('0x1a')]);module[_0xc530('0x1b')]=router; \ No newline at end of file +var _0xa3d8=['download','diskStorage','join','server/files/sounds/original/','originalname','format','%s-%s%s','basename','extname','now','post','single','file','create','put','update','delete','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download'];(function(_0x2a0a38,_0x4a6de5){var _0x4a200e=function(_0x2ef26b){while(--_0x2ef26b){_0x2a0a38['push'](_0x2a0a38['shift']());}};_0x4a200e(++_0x4a6de5);}(_0xa3d8,0x1f1));var _0x8a3d=function(_0x5bf26d,_0x12e71e){_0x5bf26d=_0x5bf26d-0x0;var _0x124db5=_0xa3d8[_0x5bf26d];return _0x124db5;};'use strict';var multer=require(_0x8a3d('0x0'));var util=require('util');var path=require(_0x8a3d('0x1'));var timeout=require(_0x8a3d('0x2'));var express=require(_0x8a3d('0x3'));var router=express['Router']();var fs_extra=require(_0x8a3d('0x4'));var auth=require(_0x8a3d('0x5'));var interaction=require(_0x8a3d('0x6'));var config=require(_0x8a3d('0x7'));var controller=require(_0x8a3d('0x8'));router[_0x8a3d('0x9')]('/',auth[_0x8a3d('0xa')](),controller[_0x8a3d('0xb')]);router[_0x8a3d('0x9')](_0x8a3d('0xc'),auth['isAuthenticated'](),controller[_0x8a3d('0xd')]);router[_0x8a3d('0x9')](_0x8a3d('0xe'),auth[_0x8a3d('0xa')](),controller[_0x8a3d('0xf')]);var upload=multer({'storage':multer[_0x8a3d('0x10')]({'destination':function(_0x219e09,_0x5a640f,_0x3046d5){_0x3046d5(null,path[_0x8a3d('0x11')](config['root'],_0x8a3d('0x12')));},'filename':function(_0x977574,_0x12e580,_0x1bd2ef){_0x12e580[_0x8a3d('0x13')]=_0x12e580[_0x8a3d('0x13')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1bd2ef(null,util[_0x8a3d('0x14')](_0x8a3d('0x15'),path[_0x8a3d('0x16')](_0x12e580[_0x8a3d('0x13')],path[_0x8a3d('0x17')](_0x12e580[_0x8a3d('0x13')])),Date[_0x8a3d('0x18')](),path[_0x8a3d('0x17')](_0x12e580[_0x8a3d('0x13')])));}})});router[_0x8a3d('0x19')]('/',upload[_0x8a3d('0x1a')](_0x8a3d('0x1b')),controller[_0x8a3d('0x1c')]);router[_0x8a3d('0x1d')]('/:id',auth[_0x8a3d('0xa')](),controller[_0x8a3d('0x1e')]);router[_0x8a3d('0x1f')](_0x8a3d('0xc'),auth['isAuthenticated'](),controller[_0x8a3d('0x1f')]);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 cde4eee..6d61d26 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 _0x65bb=['STRING','FLOAT','BIGINT','INTEGER','sequelize'];(function(_0x492e85,_0x163683){var _0x134f56=function(_0x19401e){while(--_0x19401e){_0x492e85['push'](_0x492e85['shift']());}};_0x134f56(++_0x163683);}(_0x65bb,0x126));var _0xb65b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x65bb[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb65b('0x0'));module['exports']={'name':{'type':Sequelize[_0xb65b('0x1')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0xb65b('0x1')]},'display_name':{'type':Sequelize[_0xb65b('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0xb65b('0x1')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0xb65b('0x2')]},'original_sampleCount':{'type':Sequelize[_0xb65b('0x3')]},'original_channelCount':{'type':Sequelize[_0xb65b('0x4')]},'original_bitRate':{'type':Sequelize[_0xb65b('0x3')]},'original_sampleRate':{'type':Sequelize[_0xb65b('0x4')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0xb65b('0x2')]},'converted_sampleCount':{'type':Sequelize[_0xb65b('0x3')]},'converted_channelCount':{'type':Sequelize[_0xb65b('0x4')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xb65b('0x4')]}}; \ No newline at end of file +var _0x4708=['STRING','FLOAT','BIGINT','INTEGER','exports','name'];(function(_0x731e02,_0x338a0e){var _0x5a3b93=function(_0x357e4f){while(--_0x357e4f){_0x731e02['push'](_0x731e02['shift']());}};_0x5a3b93(++_0x338a0e);}(_0x4708,0x196));var _0x8470=function(_0x492f46,_0x233349){_0x492f46=_0x492f46-0x0;var _0x5bb67c=_0x4708[_0x492f46];return _0x5bb67c;};'use strict';var Sequelize=require('sequelize');module[_0x8470('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x8470('0x1'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x8470('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x8470('0x2')]},'original_format':{'type':Sequelize[_0x8470('0x2')]},'original_duration':{'type':Sequelize[_0x8470('0x3')]},'original_sampleCount':{'type':Sequelize[_0x8470('0x4')]},'original_channelCount':{'type':Sequelize[_0x8470('0x5')]},'original_bitRate':{'type':Sequelize[_0x8470('0x4')]},'original_sampleRate':{'type':Sequelize[_0x8470('0x5')]},'converted_format':{'type':Sequelize[_0x8470('0x2')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x8470('0x4')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x8470('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 46e63fb..c20e87e 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 _0x63d3=['model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','options','Sound','count','includeAll','include','findAll','rows','show','params','rawAttributes','intersection','length','merge','find','save_name','existsSync','root','server/files/sounds/converted','converted_format','Sequelize','ValidationError','download','join','format','catch','create','basename','file','originalname','extname','filename','substring','server/files/sounds/original','%s.%s','Sound\x20upload\x20filepath:\x20%s','chmodSync','transcode','wav','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','sampleRate','0777','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','apply','reject','update','then','destroy','Sounds','error','stack','name','send','map','fieldName','type','key'];(function(_0xb6a965,_0x5c5ace){var _0x51d37d=function(_0x1c7c0d){while(--_0x1c7c0d){_0xb6a965['push'](_0xb6a965['shift']());}};_0x51d37d(++_0x5c5ace);}(_0x63d3,0x1c0));var _0x363d=function(_0x55e054,_0x3cdee0){_0x55e054=_0x55e054-0x0;var _0x2bb76c=_0x63d3[_0x55e054];return _0x2bb76c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x363d('0x0'));var zipdir=require(_0x363d('0x1'));var jsonpatch=require(_0x363d('0x2'));var rp=require(_0x363d('0x3'));var moment=require(_0x363d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x363d('0x5'));var util=require('util');var path=require(_0x363d('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x363d('0x7'));var fs=require('fs');var fs_extra=require(_0x363d('0x8'));var _=require('lodash');var squel=require(_0x363d('0x9'));var crypto=require(_0x363d('0xa'));var jsforce=require(_0x363d('0xb'));var deskjs=require(_0x363d('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x363d('0xd'));var Redis=require(_0x363d('0xe'));var authService=require(_0x363d('0xf'));var qs=require(_0x363d('0x10'));var as=require(_0x363d('0x11'));var hardwareService=require(_0x363d('0x12'));var logger=require(_0x363d('0x13'))(_0x363d('0x14'));var utils=require('../../config/utils');var config=require(_0x363d('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x363d('0x16'))['db'];function respondWithStatusCode(_0x252edc,_0x9289ed){_0x9289ed=_0x9289ed||0xcc;return function(_0x4b21f2){if(_0x4b21f2){return _0x252edc[_0x363d('0x17')](_0x9289ed);}return _0x252edc['status'](_0x9289ed)[_0x363d('0x18')]();};}function respondWithResult(_0x556286,_0x23a3b7){_0x23a3b7=_0x23a3b7||0xc8;return function(_0x504e90){if(_0x504e90){return _0x556286[_0x363d('0x19')](_0x23a3b7)[_0x363d('0x1a')](_0x504e90);}};}function respondWithFilteredResult(_0x58768f,_0x546f90){return function(_0x19dbb3){if(_0x19dbb3){var _0xdeb050=typeof _0x546f90['offset']===_0x363d('0x1b')&&typeof _0x546f90[_0x363d('0x1c')]===_0x363d('0x1b');var _0x14f969=_0x19dbb3['count'];var _0x5a46b1=_0xdeb050?0x0:_0x546f90['offset'];var _0x1ac1eb=_0xdeb050?_0x19dbb3['count']:_0x546f90[_0x363d('0x1d')]+_0x546f90[_0x363d('0x1c')];var _0x3e0deb;if(_0x1ac1eb>=_0x14f969){_0x1ac1eb=_0x14f969;_0x3e0deb=0xc8;}else{_0x3e0deb=0xce;}_0x58768f[_0x363d('0x19')](_0x3e0deb);return _0x58768f['set']('Content-Range',_0x5a46b1+'-'+_0x1ac1eb+'/'+_0x14f969)['json'](_0x19dbb3);}return null;};}function patchUpdates(_0x15d3f3){return function(_0x30a163){try{jsonpatch[_0x363d('0x1e')](_0x30a163,_0x15d3f3,!![]);}catch(_0xa3357f){return BPromise[_0x363d('0x1f')](_0xa3357f);}return _0x30a163['save']();};}function saveUpdates(_0x4935f2,_0x287a6a){return function(_0x49cfec){if(_0x49cfec){return _0x49cfec[_0x363d('0x20')](_0x4935f2)[_0x363d('0x21')](function(_0x44521e){return _0x44521e;});}return null;};}function removeEntity(_0xc7ef1a,_0x4e2438){return function(_0x18998f){if(_0x18998f){return _0x18998f[_0x363d('0x22')]()[_0x363d('0x21')](function(){var _0x342e7f=_0x18998f['get']({'plain':!![]});var _0x376447=_0x363d('0x23');return db['UserProfileResource'][_0x363d('0x22')]({'where':{'type':_0x376447,'resourceId':_0x342e7f['id']}})['then'](function(){return _0x18998f;});})[_0x363d('0x21')](function(){_0xc7ef1a[_0x363d('0x19')](0xcc)[_0x363d('0x18')]();});}};}function handleEntityNotFound(_0x45cfe7,_0x14b78d){return function(_0x59fc16){if(!_0x59fc16){_0x45cfe7[_0x363d('0x17')](0x194);}return _0x59fc16;};}function handleError(_0x3bc81e,_0x257737){_0x257737=_0x257737||0x1f4;return function(_0x2789b9){logger[_0x363d('0x24')](_0x2789b9[_0x363d('0x25')]);if(_0x2789b9[_0x363d('0x26')]){delete _0x2789b9[_0x363d('0x26')];}_0x3bc81e[_0x363d('0x19')](_0x257737)[_0x363d('0x27')](_0x2789b9);};}exports['index']=function(_0x38e7a0,_0x3ae0fc){var _0x4f61a6={},_0xd3e4be={},_0x4220d8={'count':0x0,'rows':[]};var _0x14ada0=_[_0x363d('0x28')](db['Sound']['rawAttributes'],function(_0x8568d6){return{'name':_0x8568d6[_0x363d('0x29')],'type':_0x8568d6[_0x363d('0x2a')][_0x363d('0x2b')]};});_0xd3e4be[_0x363d('0x2c')]=_[_0x363d('0x28')](_0x14ada0,_0x363d('0x26'));_0xd3e4be[_0x363d('0x2d')]=_[_0x363d('0x2e')](_0x38e7a0['query']);_0xd3e4be[_0x363d('0x2f')]=_['intersection'](_0xd3e4be[_0x363d('0x2c')],_0xd3e4be[_0x363d('0x2d')]);_0x4f61a6[_0x363d('0x30')]=_['intersection'](_0xd3e4be['model'],qs[_0x363d('0x31')](_0x38e7a0[_0x363d('0x2d')][_0x363d('0x31')]));_0x4f61a6[_0x363d('0x30')]=_0x4f61a6[_0x363d('0x30')]['length']?_0x4f61a6['attributes']:_0xd3e4be[_0x363d('0x2c')];if(!_0x38e7a0[_0x363d('0x2d')][_0x363d('0x32')](_0x363d('0x33'))){_0x4f61a6[_0x363d('0x1c')]=qs[_0x363d('0x1c')](_0x38e7a0[_0x363d('0x2d')][_0x363d('0x1c')]);_0x4f61a6[_0x363d('0x1d')]=qs['offset'](_0x38e7a0[_0x363d('0x2d')]['offset']);}_0x4f61a6['order']=qs[_0x363d('0x34')](_0x38e7a0[_0x363d('0x2d')][_0x363d('0x34')]);_0x4f61a6['where']=qs[_0x363d('0x2f')](_[_0x363d('0x35')](_0x38e7a0[_0x363d('0x2d')],_0xd3e4be['filters']),_0x14ada0);if(_0x38e7a0[_0x363d('0x2d')][_0x363d('0x36')]){_0x4f61a6[_0x363d('0x37')]=_['merge'](_0x4f61a6[_0x363d('0x37')],{'$or':_[_0x363d('0x28')](_0x14ada0,function(_0x382497){if(_0x382497['type']!==_0x363d('0x38')){var _0x380cc4={};_0x380cc4[_0x382497[_0x363d('0x26')]]={'$like':'%'+_0x38e7a0[_0x363d('0x2d')][_0x363d('0x36')]+'%'};return _0x380cc4;}})});}_0x4f61a6=_['merge']({},_0x4f61a6,_0x38e7a0[_0x363d('0x39')]);var _0x307d7e={'where':_0x4f61a6['where']};return db[_0x363d('0x3a')][_0x363d('0x3b')](_0x307d7e)[_0x363d('0x21')](function(_0x51c930){_0x4220d8[_0x363d('0x3b')]=_0x51c930;if(_0x38e7a0[_0x363d('0x2d')][_0x363d('0x3c')]){_0x4f61a6[_0x363d('0x3d')]=[{'all':!![]}];}return db[_0x363d('0x3a')][_0x363d('0x3e')](_0x4f61a6);})[_0x363d('0x21')](function(_0x54ef0d){_0x4220d8[_0x363d('0x3f')]=_0x54ef0d;return _0x4220d8;})[_0x363d('0x21')](respondWithFilteredResult(_0x3ae0fc,_0x4f61a6))['catch'](handleError(_0x3ae0fc,null));};exports[_0x363d('0x40')]=function(_0x4220b4,_0x18e4e8){var _0x54db36={'raw':!![],'where':{'id':_0x4220b4[_0x363d('0x41')]['id']}},_0x4fac45={};_0x4fac45[_0x363d('0x2c')]=_[_0x363d('0x2e')](db[_0x363d('0x3a')][_0x363d('0x42')]);_0x4fac45[_0x363d('0x2d')]=_[_0x363d('0x2e')](_0x4220b4[_0x363d('0x2d')]);_0x4fac45['filters']=_[_0x363d('0x43')](_0x4fac45[_0x363d('0x2c')],_0x4fac45[_0x363d('0x2d')]);_0x54db36[_0x363d('0x30')]=_['intersection'](_0x4fac45[_0x363d('0x2c')],qs[_0x363d('0x31')](_0x4220b4[_0x363d('0x2d')][_0x363d('0x31')]));_0x54db36[_0x363d('0x30')]=_0x54db36['attributes'][_0x363d('0x44')]?_0x54db36[_0x363d('0x30')]:_0x4fac45['model'];if(_0x4220b4['query'][_0x363d('0x3c')]){_0x54db36['include']=[{'all':!![]}];}_0x54db36=_[_0x363d('0x45')]({},_0x54db36,_0x4220b4[_0x363d('0x39')]);return db[_0x363d('0x3a')]['find'](_0x54db36)[_0x363d('0x21')](handleEntityNotFound(_0x18e4e8,null))[_0x363d('0x21')](respondWithResult(_0x18e4e8,null))['catch'](handleError(_0x18e4e8,null));};exports['download']=function(_0xfaa43c,_0x5d1529,_0x52a450){return db[_0x363d('0x3a')][_0x363d('0x46')]({'where':{'id':_0xfaa43c[_0x363d('0x41')]['id']},'attributes':[_0x363d('0x26'),_0x363d('0x47'),'converted_format'],'raw':!![]})['then'](handleEntityNotFound(_0x5d1529,null))[_0x363d('0x21')](function(_0x48bf20){if(_0x48bf20){if(!fs[_0x363d('0x48')](path['join'](config[_0x363d('0x49')],_0x363d('0x4a'),_0x48bf20[_0x363d('0x47')]+'.'+_0x48bf20[_0x363d('0x4b')]))){throw new db[(_0x363d('0x4c'))][(_0x363d('0x4d'))]('Sound\x20not\x20found');}return _0x5d1529[_0x363d('0x4e')](path[_0x363d('0x4f')](config['root'],_0x363d('0x4a'),util[_0x363d('0x50')]('%s.%s',_0x48bf20['save_name'],_0x48bf20['converted_format'])),util[_0x363d('0x50')]('%s.%s',_0x48bf20[_0x363d('0x26')],_0x48bf20['converted_format']));}return null;})[_0x363d('0x51')](handleError(_0x5d1529,null));};exports[_0x363d('0x52')]=function(_0x5dac25,_0x17ffa6,_0x242405){var _0x1fa3cd={'name':path[_0x363d('0x53')](_0x5dac25[_0x363d('0x54')][_0x363d('0x55')],path[_0x363d('0x56')](_0x5dac25[_0x363d('0x54')][_0x363d('0x55')])),'save_name':path[_0x363d('0x53')](_0x5dac25[_0x363d('0x54')][_0x363d('0x57')],path[_0x363d('0x56')](_0x5dac25[_0x363d('0x54')][_0x363d('0x57')])),'original_format':path[_0x363d('0x56')](_0x5dac25['file'][_0x363d('0x55')])[_0x363d('0x58')](0x1),'converted_format':'wav'};var _0x29b883=path[_0x363d('0x4f')](config[_0x363d('0x49')],_0x363d('0x59'),_0x5dac25[_0x363d('0x54')][_0x363d('0x57')]);var _0x1f219d=path['join'](config[_0x363d('0x49')],'server/files/sounds/converted',util[_0x363d('0x50')](_0x363d('0x5a'),path[_0x363d('0x53')](_0x5dac25[_0x363d('0x54')]['filename'],path[_0x363d('0x56')](_0x5dac25[_0x363d('0x54')][_0x363d('0x57')])),_0x1fa3cd[_0x363d('0x4b')]));logger['info'](_0x363d('0x5b'),_0x29b883);logger['info']('Sound\x20upload\x20destination:\x20%s',_0x1f219d);try{fs[_0x363d('0x5c')](_0x29b883,parseInt('0777',0x8));var _0x4e0031=sox[_0x363d('0x5d')](_0x29b883,_0x1f219d,{'sampleRate':0x1f40,'format':_0x363d('0x5e'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4e0031['on'](_0x363d('0x24'),function(_0x3ac7e5){fs['unlinkSync'](_0x29b883);_0x17ffa6[_0x363d('0x19')](0x1f4)[_0x363d('0x27')](_0x3ac7e5);});_0x4e0031['on'](_0x363d('0x5f'),function(_0x460587){_0x1fa3cd[_0x363d('0x60')]=isNaN(_0x460587[_0x363d('0x61')])?null:_0x460587[_0x363d('0x61')]*0x3e8;_0x1fa3cd[_0x363d('0x62')]=isNaN(_0x460587['sampleCount'])?null:_0x460587[_0x363d('0x63')];_0x1fa3cd[_0x363d('0x64')]=isNaN(_0x460587[_0x363d('0x65')])?null:_0x460587['channelCount'];_0x1fa3cd[_0x363d('0x66')]=isNaN(_0x460587['bitRate'])?null:_0x460587[_0x363d('0x67')];_0x1fa3cd[_0x363d('0x68')]=isNaN(_0x460587['sampleRate'])?null:_0x460587['sampleRate'];});_0x4e0031['on'](_0x363d('0x69'),function(_0x317a98){_0x1fa3cd[_0x363d('0x6a')]=isNaN(_0x317a98['duration'])?null:_0x317a98[_0x363d('0x61')]*0x3e8;_0x1fa3cd[_0x363d('0x6b')]=isNaN(_0x317a98['sampleCount'])?null:_0x317a98[_0x363d('0x63')];_0x1fa3cd[_0x363d('0x6c')]=isNaN(_0x317a98[_0x363d('0x65')])?null:_0x317a98['channelCount'];_0x1fa3cd[_0x363d('0x6d')]=isNaN(_0x317a98[_0x363d('0x67')])?null:_0x317a98['bitRate'];_0x1fa3cd[_0x363d('0x6e')]=isNaN(_0x317a98[_0x363d('0x6f')])?null:_0x317a98['sampleRate'];});_0x4e0031['on'](_0x363d('0x18'),function(){fs[_0x363d('0x5c')](_0x1f219d,parseInt(_0x363d('0x70'),0x8));return db[_0x363d('0x3a')]['create'](_0x1fa3cd)[_0x363d('0x21')](function(_0x55d1d3){var _0x3ab1d8={'role':_0x5dac25['body'][_0x363d('0x71')],'userProfileId':_0x5dac25['body'][_0x363d('0x72')]};if(!_0x3ab1d8)throw new Error(_0x363d('0x73'));if(_0x3ab1d8[_0x363d('0x71')]===_0x363d('0x74')){var _0x55a33e=_0x55d1d3['get']({'plain':!![]});return db['UserProfileSection'][_0x363d('0x46')]({'where':{'name':_0x363d('0x23'),'userProfileId':_0x3ab1d8[_0x363d('0x72')]},'raw':!![]})['then'](function(_0x1a4018){if(_0x1a4018&&_0x1a4018[_0x363d('0x75')]===0x0){return db['UserProfileResource'][_0x363d('0x52')]({'name':_0x55a33e['name'],'resourceId':_0x55a33e['id'],'type':_0x1a4018[_0x363d('0x26')],'sectionId':_0x1a4018['id']},{})['then'](function(){return _0x55d1d3;});}else{return _0x55d1d3;}})['catch'](function(_0x5037e6){logger[_0x363d('0x24')](_0x363d('0x76'),_0x5037e6);throw _0x5037e6;});}return _0x55d1d3;})[_0x363d('0x21')](respondWithResult(_0x17ffa6,null))[_0x363d('0x51')](handleError(_0x17ffa6,null));});_0x4e0031[_0x363d('0x77')]();}catch(_0x92061a){_0x17ffa6[_0x363d('0x19')](0x1f4)[_0x363d('0x27')](_0x92061a);}};exports[_0x363d('0x20')]=function(_0x27a6ba,_0x3dd1b1,_0x776671){return db['Sound']['find']({'where':{'id':_0x27a6ba[_0x363d('0x41')]['id']}})[_0x363d('0x21')](handleEntityNotFound(_0x3dd1b1,null))[_0x363d('0x21')](saveUpdates(_[_0x363d('0x35')](_0x27a6ba['body'],['name',_0x363d('0x78')]),null))[_0x363d('0x21')](respondWithResult(_0x3dd1b1,null))['catch'](handleError(_0x3dd1b1,null));};exports[_0x363d('0x79')]=function(_0x10267e,_0x948762,_0x347866){return db[_0x363d('0x3a')][_0x363d('0x46')]({'where':{'id':_0x10267e[_0x363d('0x41')]['id']}})[_0x363d('0x21')](function(_0x5015e3){if(_0x5015e3){return _0x5015e3['destroy']();}})[_0x363d('0x21')](function(_0x75cefd){var _0xae43b0=path[_0x363d('0x4f')](config[_0x363d('0x49')],_0x363d('0x59'),util[_0x363d('0x50')](_0x363d('0x5a'),_0x75cefd[_0x363d('0x47')],_0x75cefd['original_format']));var _0x372de5=path[_0x363d('0x4f')](config[_0x363d('0x49')],'server/files/sounds/converted',util['format'](_0x363d('0x5a'),_0x75cefd['save_name'],_0x75cefd['converted_format']));fs[_0x363d('0x7a')](_0xae43b0);fs[_0x363d('0x7a')](_0x372de5);return _0x75cefd;})['then'](function(_0xcd689e){if(_0xcd689e){return _0x948762['status'](0xcc)[_0x363d('0x18')]();}})['then'](handleEntityNotFound(_0x948762,null))['catch'](handleError(_0x948762,null));}; \ No newline at end of file +var _0xe560=['sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','then','destroy','get','Sounds','UserProfileResource','end','error','stack','name','map','Sound','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','catch','show','params','options','find','existsSync','join','root','server/files/sounds/converted','save_name','Sequelize','download','format','%s.%s','converted_format','basename','file','originalname','filename','extname','substring','wav','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','send','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_channelCount','converted_bitRate','bitRate','converted_sampleRate','create','body','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','update','description','delete','server/files/sounds/original','original_format','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path'];(function(_0x118653,_0x50ef26){var _0xc11fa6=function(_0x2ec581){while(--_0x2ec581){_0x118653['push'](_0x118653['shift']());}};_0xc11fa6(++_0x50ef26);}(_0xe560,0x169));var _0x0e56=function(_0x663c22,_0x36041d){_0x663c22=_0x663c22-0x0;var _0x159b4d=_0xe560[_0x663c22];return _0x159b4d;};'use strict';var emlformat=require(_0x0e56('0x0'));var rimraf=require(_0x0e56('0x1'));var zipdir=require(_0x0e56('0x2'));var jsonpatch=require(_0x0e56('0x3'));var rp=require('request-promise');var moment=require(_0x0e56('0x4'));var BPromise=require(_0x0e56('0x5'));var Mustache=require('mustache');var util=require(_0x0e56('0x6'));var path=require(_0x0e56('0x7'));var sox=require(_0x0e56('0x8'));var csv=require(_0x0e56('0x9'));var ejs=require(_0x0e56('0xa'));var fs=require('fs');var fs_extra=require(_0x0e56('0xb'));var _=require('lodash');var squel=require(_0x0e56('0xc'));var crypto=require(_0x0e56('0xd'));var jsforce=require(_0x0e56('0xe'));var deskjs=require(_0x0e56('0xf'));var toCsv=require(_0x0e56('0x9'));var querystring=require(_0x0e56('0x10'));var Papa=require(_0x0e56('0x11'));var Redis=require(_0x0e56('0x12'));var authService=require(_0x0e56('0x13'));var qs=require(_0x0e56('0x14'));var as=require(_0x0e56('0x15'));var hardwareService=require(_0x0e56('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0e56('0x17'));var licenseUtil=require(_0x0e56('0x18'));var db=require(_0x0e56('0x19'))['db'];function respondWithStatusCode(_0x4bacce,_0x315ee5){_0x315ee5=_0x315ee5||0xcc;return function(_0x12185a){if(_0x12185a){return _0x4bacce[_0x0e56('0x1a')](_0x315ee5);}return _0x4bacce[_0x0e56('0x1b')](_0x315ee5)['end']();};}function respondWithResult(_0x191c76,_0x235830){_0x235830=_0x235830||0xc8;return function(_0x3df598){if(_0x3df598){return _0x191c76[_0x0e56('0x1b')](_0x235830)[_0x0e56('0x1c')](_0x3df598);}};}function respondWithFilteredResult(_0x24e2c4,_0x23f71e){return function(_0x255c9c){if(_0x255c9c){var _0x28d4a7=typeof _0x23f71e[_0x0e56('0x1d')]===_0x0e56('0x1e')&&typeof _0x23f71e[_0x0e56('0x1f')]===_0x0e56('0x1e');var _0x3b9077=_0x255c9c[_0x0e56('0x20')];var _0x2486ed=_0x28d4a7?0x0:_0x23f71e['offset'];var _0x2fd9d4=_0x28d4a7?_0x255c9c['count']:_0x23f71e[_0x0e56('0x1d')]+_0x23f71e[_0x0e56('0x1f')];var _0x22a4a5;if(_0x2fd9d4>=_0x3b9077){_0x2fd9d4=_0x3b9077;_0x22a4a5=0xc8;}else{_0x22a4a5=0xce;}_0x24e2c4[_0x0e56('0x1b')](_0x22a4a5);return _0x24e2c4[_0x0e56('0x21')]('Content-Range',_0x2486ed+'-'+_0x2fd9d4+'/'+_0x3b9077)['json'](_0x255c9c);}return null;};}function patchUpdates(_0x424384){return function(_0x201bef){try{jsonpatch[_0x0e56('0x22')](_0x201bef,_0x424384,!![]);}catch(_0x55f99f){return BPromise[_0x0e56('0x23')](_0x55f99f);}return _0x201bef['save']();};}function saveUpdates(_0x109b43,_0x5d363f){return function(_0x5843df){if(_0x5843df){return _0x5843df['update'](_0x109b43)[_0x0e56('0x24')](function(_0x37a142){return _0x37a142;});}return null;};}function removeEntity(_0x3c2bba,_0x4f1075){return function(_0x272865){if(_0x272865){return _0x272865[_0x0e56('0x25')]()[_0x0e56('0x24')](function(){var _0x49b026=_0x272865[_0x0e56('0x26')]({'plain':!![]});var _0xbbd414=_0x0e56('0x27');return db[_0x0e56('0x28')][_0x0e56('0x25')]({'where':{'type':_0xbbd414,'resourceId':_0x49b026['id']}})['then'](function(){return _0x272865;});})[_0x0e56('0x24')](function(){_0x3c2bba['status'](0xcc)[_0x0e56('0x29')]();});}};}function handleEntityNotFound(_0x18d8e0,_0x49a0fd){return function(_0x186fc2){if(!_0x186fc2){_0x18d8e0[_0x0e56('0x1a')](0x194);}return _0x186fc2;};}function handleError(_0x8c4f4e,_0x45db1c){_0x45db1c=_0x45db1c||0x1f4;return function(_0x3df88b){logger[_0x0e56('0x2a')](_0x3df88b[_0x0e56('0x2b')]);if(_0x3df88b['name']){delete _0x3df88b[_0x0e56('0x2c')];}_0x8c4f4e[_0x0e56('0x1b')](_0x45db1c)['send'](_0x3df88b);};}exports['index']=function(_0x3e0047,_0xe01bbc){var _0x14d259={},_0xf7b5df={},_0x23ee5b={'count':0x0,'rows':[]};var _0x406712=_[_0x0e56('0x2d')](db[_0x0e56('0x2e')][_0x0e56('0x2f')],function(_0x2e2770){return{'name':_0x2e2770[_0x0e56('0x30')],'type':_0x2e2770[_0x0e56('0x31')][_0x0e56('0x32')]};});_0xf7b5df['model']=_[_0x0e56('0x2d')](_0x406712,_0x0e56('0x2c'));_0xf7b5df[_0x0e56('0x33')]=_[_0x0e56('0x34')](_0x3e0047[_0x0e56('0x33')]);_0xf7b5df[_0x0e56('0x35')]=_['intersection'](_0xf7b5df[_0x0e56('0x36')],_0xf7b5df[_0x0e56('0x33')]);_0x14d259[_0x0e56('0x37')]=_[_0x0e56('0x38')](_0xf7b5df[_0x0e56('0x36')],qs[_0x0e56('0x39')](_0x3e0047[_0x0e56('0x33')]['fields']));_0x14d259['attributes']=_0x14d259[_0x0e56('0x37')][_0x0e56('0x3a')]?_0x14d259[_0x0e56('0x37')]:_0xf7b5df['model'];if(!_0x3e0047[_0x0e56('0x33')][_0x0e56('0x3b')](_0x0e56('0x3c'))){_0x14d259[_0x0e56('0x1f')]=qs[_0x0e56('0x1f')](_0x3e0047['query'][_0x0e56('0x1f')]);_0x14d259[_0x0e56('0x1d')]=qs['offset'](_0x3e0047[_0x0e56('0x33')][_0x0e56('0x1d')]);}_0x14d259[_0x0e56('0x3d')]=qs[_0x0e56('0x3e')](_0x3e0047[_0x0e56('0x33')][_0x0e56('0x3e')]);_0x14d259[_0x0e56('0x3f')]=qs[_0x0e56('0x35')](_['pick'](_0x3e0047['query'],_0xf7b5df[_0x0e56('0x35')]),_0x406712);if(_0x3e0047[_0x0e56('0x33')][_0x0e56('0x40')]){_0x14d259['where']=_[_0x0e56('0x41')](_0x14d259[_0x0e56('0x3f')],{'$or':_['map'](_0x406712,function(_0x77f256){if(_0x77f256[_0x0e56('0x31')]!==_0x0e56('0x42')){var _0x2653d2={};_0x2653d2[_0x77f256['name']]={'$like':'%'+_0x3e0047[_0x0e56('0x33')]['filter']+'%'};return _0x2653d2;}})});}_0x14d259=_[_0x0e56('0x41')]({},_0x14d259,_0x3e0047['options']);var _0x501faa={'where':_0x14d259[_0x0e56('0x3f')]};return db[_0x0e56('0x2e')][_0x0e56('0x20')](_0x501faa)[_0x0e56('0x24')](function(_0x870549){_0x23ee5b['count']=_0x870549;if(_0x3e0047[_0x0e56('0x33')][_0x0e56('0x43')]){_0x14d259[_0x0e56('0x44')]=[{'all':!![]}];}return db[_0x0e56('0x2e')]['findAll'](_0x14d259);})[_0x0e56('0x24')](function(_0x3255c7){_0x23ee5b['rows']=_0x3255c7;return _0x23ee5b;})[_0x0e56('0x24')](respondWithFilteredResult(_0xe01bbc,_0x14d259))[_0x0e56('0x45')](handleError(_0xe01bbc,null));};exports[_0x0e56('0x46')]=function(_0x97ed90,_0x36450b){var _0x7bf6a1={'raw':!![],'where':{'id':_0x97ed90[_0x0e56('0x47')]['id']}},_0x1e827b={};_0x1e827b[_0x0e56('0x36')]=_[_0x0e56('0x34')](db[_0x0e56('0x2e')][_0x0e56('0x2f')]);_0x1e827b[_0x0e56('0x33')]=_[_0x0e56('0x34')](_0x97ed90[_0x0e56('0x33')]);_0x1e827b[_0x0e56('0x35')]=_['intersection'](_0x1e827b[_0x0e56('0x36')],_0x1e827b[_0x0e56('0x33')]);_0x7bf6a1[_0x0e56('0x37')]=_[_0x0e56('0x38')](_0x1e827b[_0x0e56('0x36')],qs['fields'](_0x97ed90[_0x0e56('0x33')][_0x0e56('0x39')]));_0x7bf6a1[_0x0e56('0x37')]=_0x7bf6a1[_0x0e56('0x37')][_0x0e56('0x3a')]?_0x7bf6a1[_0x0e56('0x37')]:_0x1e827b[_0x0e56('0x36')];if(_0x97ed90[_0x0e56('0x33')][_0x0e56('0x43')]){_0x7bf6a1[_0x0e56('0x44')]=[{'all':!![]}];}_0x7bf6a1=_[_0x0e56('0x41')]({},_0x7bf6a1,_0x97ed90[_0x0e56('0x48')]);return db[_0x0e56('0x2e')][_0x0e56('0x49')](_0x7bf6a1)[_0x0e56('0x24')](handleEntityNotFound(_0x36450b,null))[_0x0e56('0x24')](respondWithResult(_0x36450b,null))[_0x0e56('0x45')](handleError(_0x36450b,null));};exports['download']=function(_0x5ba199,_0x4e8a2c,_0x41b89b){return db[_0x0e56('0x2e')][_0x0e56('0x49')]({'where':{'id':_0x5ba199[_0x0e56('0x47')]['id']},'attributes':['name','save_name','converted_format'],'raw':!![]})['then'](handleEntityNotFound(_0x4e8a2c,null))[_0x0e56('0x24')](function(_0x3231ae){if(_0x3231ae){if(!fs[_0x0e56('0x4a')](path[_0x0e56('0x4b')](config[_0x0e56('0x4c')],_0x0e56('0x4d'),_0x3231ae[_0x0e56('0x4e')]+'.'+_0x3231ae['converted_format']))){throw new db[(_0x0e56('0x4f'))]['ValidationError']('Sound\x20not\x20found');}return _0x4e8a2c[_0x0e56('0x50')](path['join'](config[_0x0e56('0x4c')],_0x0e56('0x4d'),util[_0x0e56('0x51')](_0x0e56('0x52'),_0x3231ae[_0x0e56('0x4e')],_0x3231ae[_0x0e56('0x53')])),util['format'](_0x0e56('0x52'),_0x3231ae[_0x0e56('0x2c')],_0x3231ae[_0x0e56('0x53')]));}return null;})[_0x0e56('0x45')](handleError(_0x4e8a2c,null));};exports['create']=function(_0x5e88cb,_0x50d1f2,_0x319c96){var _0x4c872d={'name':path[_0x0e56('0x54')](_0x5e88cb[_0x0e56('0x55')][_0x0e56('0x56')],path['extname'](_0x5e88cb[_0x0e56('0x55')][_0x0e56('0x56')])),'save_name':path[_0x0e56('0x54')](_0x5e88cb['file'][_0x0e56('0x57')],path[_0x0e56('0x58')](_0x5e88cb[_0x0e56('0x55')][_0x0e56('0x57')])),'original_format':path[_0x0e56('0x58')](_0x5e88cb['file']['originalname'])[_0x0e56('0x59')](0x1),'converted_format':_0x0e56('0x5a')};var _0x2d6355=path[_0x0e56('0x4b')](config['root'],'server/files/sounds/original',_0x5e88cb['file'][_0x0e56('0x57')]);var _0x18ccee=path['join'](config['root'],_0x0e56('0x4d'),util[_0x0e56('0x51')](_0x0e56('0x52'),path[_0x0e56('0x54')](_0x5e88cb['file'][_0x0e56('0x57')],path[_0x0e56('0x58')](_0x5e88cb[_0x0e56('0x55')][_0x0e56('0x57')])),_0x4c872d[_0x0e56('0x53')]));logger['info']('Sound\x20upload\x20filepath:\x20%s',_0x2d6355);logger[_0x0e56('0x5b')](_0x0e56('0x5c'),_0x18ccee);try{fs[_0x0e56('0x5d')](_0x2d6355,parseInt(_0x0e56('0x5e'),0x8));var _0x82bced=sox['transcode'](_0x2d6355,_0x18ccee,{'sampleRate':0x1f40,'format':_0x0e56('0x5a'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x82bced['on'](_0x0e56('0x2a'),function(_0x426cf6){fs['unlinkSync'](_0x2d6355);_0x50d1f2[_0x0e56('0x1b')](0x1f4)[_0x0e56('0x5f')](_0x426cf6);});_0x82bced['on'](_0x0e56('0x60'),function(_0x2aac92){_0x4c872d['original_duration']=isNaN(_0x2aac92[_0x0e56('0x61')])?null:_0x2aac92['duration']*0x3e8;_0x4c872d[_0x0e56('0x62')]=isNaN(_0x2aac92[_0x0e56('0x63')])?null:_0x2aac92[_0x0e56('0x63')];_0x4c872d[_0x0e56('0x64')]=isNaN(_0x2aac92[_0x0e56('0x65')])?null:_0x2aac92[_0x0e56('0x65')];_0x4c872d[_0x0e56('0x66')]=isNaN(_0x2aac92['bitRate'])?null:_0x2aac92['bitRate'];_0x4c872d[_0x0e56('0x67')]=isNaN(_0x2aac92['sampleRate'])?null:_0x2aac92[_0x0e56('0x68')];});_0x82bced['on'](_0x0e56('0x69'),function(_0x2967c1){_0x4c872d[_0x0e56('0x6a')]=isNaN(_0x2967c1[_0x0e56('0x61')])?null:_0x2967c1[_0x0e56('0x61')]*0x3e8;_0x4c872d['converted_sampleCount']=isNaN(_0x2967c1[_0x0e56('0x63')])?null:_0x2967c1[_0x0e56('0x63')];_0x4c872d[_0x0e56('0x6b')]=isNaN(_0x2967c1[_0x0e56('0x65')])?null:_0x2967c1[_0x0e56('0x65')];_0x4c872d[_0x0e56('0x6c')]=isNaN(_0x2967c1[_0x0e56('0x6d')])?null:_0x2967c1['bitRate'];_0x4c872d[_0x0e56('0x6e')]=isNaN(_0x2967c1[_0x0e56('0x68')])?null:_0x2967c1['sampleRate'];});_0x82bced['on'](_0x0e56('0x29'),function(){fs[_0x0e56('0x5d')](_0x18ccee,parseInt(_0x0e56('0x5e'),0x8));return db['Sound'][_0x0e56('0x6f')](_0x4c872d)['then'](function(_0x20c1f1){var _0x4aa7e8={'role':_0x5e88cb[_0x0e56('0x70')]['role'],'userProfileId':_0x5e88cb[_0x0e56('0x70')][_0x0e56('0x71')]};if(!_0x4aa7e8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4aa7e8['role']==='user'){var _0x3ca496=_0x20c1f1[_0x0e56('0x26')]({'plain':!![]});return db['UserProfileSection'][_0x0e56('0x49')]({'where':{'name':_0x0e56('0x27'),'userProfileId':_0x4aa7e8[_0x0e56('0x71')]},'raw':!![]})[_0x0e56('0x24')](function(_0x1fe9eb){if(_0x1fe9eb&&_0x1fe9eb[_0x0e56('0x72')]===0x0){return db[_0x0e56('0x28')][_0x0e56('0x6f')]({'name':_0x3ca496['name'],'resourceId':_0x3ca496['id'],'type':_0x1fe9eb['name'],'sectionId':_0x1fe9eb['id']},{})[_0x0e56('0x24')](function(){return _0x20c1f1;});}else{return _0x20c1f1;}})[_0x0e56('0x45')](function(_0x2fa3fd){logger[_0x0e56('0x2a')](_0x0e56('0x73'),_0x2fa3fd);throw _0x2fa3fd;});}return _0x20c1f1;})[_0x0e56('0x24')](respondWithResult(_0x50d1f2,null))['catch'](handleError(_0x50d1f2,null));});_0x82bced[_0x0e56('0x74')]();}catch(_0x3f2818){_0x50d1f2[_0x0e56('0x1b')](0x1f4)[_0x0e56('0x5f')](_0x3f2818);}};exports[_0x0e56('0x75')]=function(_0x32f9b6,_0x1d5dc7,_0x1d7ba3){return db[_0x0e56('0x2e')][_0x0e56('0x49')]({'where':{'id':_0x32f9b6[_0x0e56('0x47')]['id']}})['then'](handleEntityNotFound(_0x1d5dc7,null))[_0x0e56('0x24')](saveUpdates(_['pick'](_0x32f9b6[_0x0e56('0x70')],['name',_0x0e56('0x76')]),null))[_0x0e56('0x24')](respondWithResult(_0x1d5dc7,null))[_0x0e56('0x45')](handleError(_0x1d5dc7,null));};exports[_0x0e56('0x77')]=function(_0x12c12b,_0x39c8c2,_0xa1b1d3){return db[_0x0e56('0x2e')][_0x0e56('0x49')]({'where':{'id':_0x12c12b[_0x0e56('0x47')]['id']}})[_0x0e56('0x24')](function(_0x1bead5){if(_0x1bead5){return _0x1bead5[_0x0e56('0x25')]();}})['then'](function(_0xaa521c){var _0x5ae49a=path['join'](config[_0x0e56('0x4c')],_0x0e56('0x78'),util[_0x0e56('0x51')]('%s.%s',_0xaa521c[_0x0e56('0x4e')],_0xaa521c[_0x0e56('0x79')]));var _0x4a26b4=path[_0x0e56('0x4b')](config['root'],_0x0e56('0x4d'),util['format'](_0x0e56('0x52'),_0xaa521c[_0x0e56('0x4e')],_0xaa521c[_0x0e56('0x53')]));fs[_0x0e56('0x7a')](_0x5ae49a);fs[_0x0e56('0x7a')](_0x4a26b4);return _0xaa521c;})['then'](function(_0x3a2c1d){if(_0x3a2c1d){return _0x39c8c2[_0x0e56('0x1b')](0xcc)[_0x0e56('0x29')]();}})[_0x0e56('0x24')](handleEntityNotFound(_0x39c8c2,null))[_0x0e56('0x45')](handleError(_0x39c8c2,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 04cbc4d..78f4be6 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 _0x394f=['request-promise','path','rimraf','../../config/environment','exports','Sound','tools_sounds','lodash','util','api'];(function(_0x27e495,_0x41bf18){var _0x2305f9=function(_0x3b9fd2){while(--_0x3b9fd2){_0x27e495['push'](_0x27e495['shift']());}};_0x2305f9(++_0x41bf18);}(_0x394f,0x6b));var _0xf394=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x394f[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xf394('0x0'));var util=require(_0xf394('0x1'));var logger=require('../../config/logger')(_0xf394('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf394('0x3'));var fs=require('fs');var path=require(_0xf394('0x4'));var rimraf=require(_0xf394('0x5'));var config=require(_0xf394('0x6'));var attributes=require('./sound.attributes');module[_0xf394('0x7')]=function(_0x7c2637,_0x2aac73){return _0x7c2637['define'](_0xf394('0x8'),attributes,{'tableName':_0xf394('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb766=['../../config/environment','./sound.attributes','exports','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x1efbb6,_0x33d9c0){var _0x4fb725=function(_0x65f4bf){while(--_0x65f4bf){_0x1efbb6['push'](_0x1efbb6['shift']());}};_0x4fb725(++_0x33d9c0);}(_0xb766,0x71));var _0x6b76=function(_0x4bfe08,_0x48ae7b){_0x4bfe08=_0x4bfe08-0x0;var _0x1f9125=_0xb766[_0x4bfe08];return _0x1f9125;};'use strict';var _=require(_0x6b76('0x0'));var util=require('util');var logger=require(_0x6b76('0x1'))(_0x6b76('0x2'));var moment=require(_0x6b76('0x3'));var BPromise=require(_0x6b76('0x4'));var rp=require(_0x6b76('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6b76('0x6'));var config=require(_0x6b76('0x7'));var attributes=require(_0x6b76('0x8'));module[_0x6b76('0x9')]=function(_0xf5f18f,_0x1eb70a){return _0xf5f18f['define']('Sound',attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 42df508..cde3a79 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 _0x6d42=['client','request','then','info','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','message','Sound,\x20%s,\x20%s','result','ShowSound','Sound','find','options','raw','include','map','model','attributes','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise'];(function(_0x4fd20d,_0x139f76){var _0x493d4b=function(_0x1902d4){while(--_0x1902d4){_0x4fd20d['push'](_0x4fd20d['shift']());}};_0x493d4b(++_0x139f76);}(_0x6d42,0x17e));var _0x26d4=function(_0x21efb2,_0x5f52d3){_0x21efb2=_0x21efb2-0x0;var _0x20ac3c=_0x6d42[_0x21efb2];return _0x20ac3c;};'use strict';var _=require(_0x26d4('0x0'));var util=require('util');var moment=require(_0x26d4('0x1'));var BPromise=require(_0x26d4('0x2'));var rs=require(_0x26d4('0x3'));var fs=require('fs');var Redis=require(_0x26d4('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x26d4('0x5'))('rpc');var config=require(_0x26d4('0x6'));var jayson=require(_0x26d4('0x7'));var client=jayson[_0x26d4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x287221,_0x3f41ce,_0x560dae){return new BPromise(function(_0x33d615,_0x10e8c4){return client[_0x26d4('0x9')](_0x287221,_0x560dae)[_0x26d4('0xa')](function(_0x4a5d37){logger[_0x26d4('0xb')]('Sound,\x20%s,\x20%s',_0x3f41ce,_0x26d4('0xc'));logger[_0x26d4('0xd')](_0x26d4('0xe'),_0x3f41ce,_0x26d4('0xc'),JSON[_0x26d4('0xf')](_0x4a5d37));if(_0x4a5d37['error']){if(_0x4a5d37['error']['code']===0x1f4){logger[_0x26d4('0x10')]('Sound,\x20%s,\x20%s',_0x3f41ce,_0x4a5d37[_0x26d4('0x10')]['message']);return _0x10e8c4(_0x4a5d37[_0x26d4('0x10')][_0x26d4('0x11')]);}logger[_0x26d4('0x10')](_0x26d4('0x12'),_0x3f41ce,_0x4a5d37[_0x26d4('0x10')]['message']);return _0x33d615(_0x4a5d37[_0x26d4('0x10')][_0x26d4('0x11')]);}else{logger['info'](_0x26d4('0x12'),_0x3f41ce,_0x26d4('0xc'));_0x33d615(_0x4a5d37[_0x26d4('0x13')]['message']);}})['catch'](function(_0x15f5b3){logger[_0x26d4('0x10')](_0x26d4('0x12'),_0x3f41ce,_0x15f5b3);_0x10e8c4(_0x15f5b3);});});}exports[_0x26d4('0x14')]=function(_0x3c1e9f){var _0x4a9e5f=this;return new Promise(function(_0x37a21f,_0x4899ff){return db[_0x26d4('0x15')][_0x26d4('0x16')]({'raw':_0x3c1e9f[_0x26d4('0x17')]?_0x3c1e9f[_0x26d4('0x17')][_0x26d4('0x18')]===undefined?!![]:![]:!![],'where':_0x3c1e9f[_0x26d4('0x17')]?_0x3c1e9f[_0x26d4('0x17')]['where']||null:null,'attributes':_0x3c1e9f[_0x26d4('0x17')]?_0x3c1e9f[_0x26d4('0x17')]['attributes']||null:null,'include':_0x3c1e9f[_0x26d4('0x17')]?_0x3c1e9f[_0x26d4('0x17')][_0x26d4('0x19')]?_[_0x26d4('0x1a')](_0x3c1e9f[_0x26d4('0x17')][_0x26d4('0x19')],function(_0x5b2231){return{'model':db[_0x5b2231[_0x26d4('0x1b')]],'as':_0x5b2231['as'],'attributes':_0x5b2231['attributes'],'include':_0x5b2231[_0x26d4('0x19')]?_[_0x26d4('0x1a')](_0x5b2231['include'],function(_0x4cea56){return{'model':db[_0x4cea56['model']],'as':_0x4cea56['as'],'attributes':_0x4cea56['attributes'],'include':_0x4cea56['include']?_['map'](_0x4cea56['include'],function(_0x3b4f5d){return{'model':db[_0x3b4f5d[_0x26d4('0x1b')]],'as':_0x3b4f5d['as'],'attributes':_0x3b4f5d[_0x26d4('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x26d4('0xa')](function(_0x376e94){logger[_0x26d4('0xb')](_0x26d4('0x14'),_0x3c1e9f);logger[_0x26d4('0xd')](_0x26d4('0x14'),_0x3c1e9f,JSON[_0x26d4('0xf')](_0x376e94));_0x37a21f(_0x376e94);})[_0x26d4('0x1d')](function(_0x25e516){logger[_0x26d4('0x10')]('ShowSound',_0x25e516[_0x26d4('0x11')],_0x3c1e9f);_0x4899ff(_0x4a9e5f[_0x26d4('0x10')](0x1f4,_0x25e516[_0x26d4('0x11')]));});});}; \ No newline at end of file +var _0xa362=['stringify','error','code','message','result','catch','find','options','raw','where','attributes','include','map','model','ShowSound','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x21e80c,_0x304d8f){var _0x4d4ebc=function(_0x1df650){while(--_0x1df650){_0x21e80c['push'](_0x21e80c['shift']());}};_0x4d4ebc(++_0x304d8f);}(_0xa362,0x87));var _0x2a36=function(_0x44ada0,_0x51e747){_0x44ada0=_0x44ada0-0x0;var _0x1de325=_0xa362[_0x44ada0];return _0x1de325;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x2a36('0x0'));var rs=require(_0x2a36('0x1'));var fs=require('fs');var Redis=require(_0x2a36('0x2'));var db=require(_0x2a36('0x3'))['db'];var utils=require(_0x2a36('0x4'));var logger=require(_0x2a36('0x5'))(_0x2a36('0x6'));var config=require(_0x2a36('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2a36('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x48d21f,_0x2c5a9c,_0x2e813b){return new BPromise(function(_0x44b791,_0x3eff53){return client['request'](_0x48d21f,_0x2e813b)[_0x2a36('0x9')](function(_0x38329d){logger[_0x2a36('0xa')](_0x2a36('0xb'),_0x2c5a9c,'request\x20sent');logger[_0x2a36('0xc')](_0x2a36('0xd'),_0x2c5a9c,_0x2a36('0xe'),JSON[_0x2a36('0xf')](_0x38329d));if(_0x38329d[_0x2a36('0x10')]){if(_0x38329d['error'][_0x2a36('0x11')]===0x1f4){logger[_0x2a36('0x10')](_0x2a36('0xb'),_0x2c5a9c,_0x38329d[_0x2a36('0x10')][_0x2a36('0x12')]);return _0x3eff53(_0x38329d[_0x2a36('0x10')][_0x2a36('0x12')]);}logger[_0x2a36('0x10')](_0x2a36('0xb'),_0x2c5a9c,_0x38329d['error']['message']);return _0x44b791(_0x38329d['error']['message']);}else{logger[_0x2a36('0xa')](_0x2a36('0xb'),_0x2c5a9c,_0x2a36('0xe'));_0x44b791(_0x38329d[_0x2a36('0x13')]['message']);}})[_0x2a36('0x14')](function(_0x2ec1f7){logger[_0x2a36('0x10')](_0x2a36('0xb'),_0x2c5a9c,_0x2ec1f7);_0x3eff53(_0x2ec1f7);});});}exports['ShowSound']=function(_0x122ec9){var _0x8c9e1=this;return new Promise(function(_0x45af59,_0x4ef562){return db['Sound'][_0x2a36('0x15')]({'raw':_0x122ec9[_0x2a36('0x16')]?_0x122ec9[_0x2a36('0x16')][_0x2a36('0x17')]===undefined?!![]:![]:!![],'where':_0x122ec9[_0x2a36('0x16')]?_0x122ec9[_0x2a36('0x16')][_0x2a36('0x18')]||null:null,'attributes':_0x122ec9[_0x2a36('0x16')]?_0x122ec9['options'][_0x2a36('0x19')]||null:null,'include':_0x122ec9[_0x2a36('0x16')]?_0x122ec9['options'][_0x2a36('0x1a')]?_['map'](_0x122ec9[_0x2a36('0x16')][_0x2a36('0x1a')],function(_0x8e6f86){return{'model':db[_0x8e6f86['model']],'as':_0x8e6f86['as'],'attributes':_0x8e6f86['attributes'],'include':_0x8e6f86[_0x2a36('0x1a')]?_['map'](_0x8e6f86[_0x2a36('0x1a')],function(_0x5eafbe){return{'model':db[_0x5eafbe['model']],'as':_0x5eafbe['as'],'attributes':_0x5eafbe[_0x2a36('0x19')],'include':_0x5eafbe[_0x2a36('0x1a')]?_[_0x2a36('0x1b')](_0x5eafbe[_0x2a36('0x1a')],function(_0x574962){return{'model':db[_0x574962[_0x2a36('0x1c')]],'as':_0x574962['as'],'attributes':_0x574962[_0x2a36('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2a36('0x9')](function(_0x4c8f73){logger[_0x2a36('0xa')](_0x2a36('0x1d'),_0x122ec9);logger[_0x2a36('0xc')](_0x2a36('0x1d'),_0x122ec9,JSON['stringify'](_0x4c8f73));_0x45af59(_0x4c8f73);})['catch'](function(_0x4f4573){logger[_0x2a36('0x10')](_0x2a36('0x1d'),_0x4f4573['message'],_0x122ec9);_0x4ef562(_0x8c9e1[_0x2a36('0x10')](0x1f4,_0x4f4573['message']));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 135e564..a245fe4 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 _0xb7e7=['exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','index','get','/:id','show','post','isAuthenticated','create','put','delete','destroy'];(function(_0x26f451,_0x4d63ba){var _0x8ae9b1=function(_0x57e18d){while(--_0x57e18d){_0x26f451['push'](_0x26f451['shift']());}};_0x8ae9b1(++_0x4d63ba);}(_0xb7e7,0x121));var _0x7b7e=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0xb7e7[_0x468b0f];return _0x3e74d9;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0xb')]('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller['update']);router[_0x7b7e('0xf')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x10')]);module[_0x7b7e('0x11')]=router; \ No newline at end of file +var _0xb7e7=['exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','index','get','/:id','show','post','isAuthenticated','create','put','delete','destroy'];(function(_0x79480f,_0x57671f){var _0x18f22c=function(_0x5f62bd){while(--_0x5f62bd){_0x79480f['push'](_0x79480f['shift']());}};_0x18f22c(++_0x57671f);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0xb7e7[_0x1b5aea];return _0x15cfc6;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0xb')]('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller['update']);router[_0x7b7e('0xf')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x10')]);module[_0x7b7e('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 8758efb..1468dac 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 _0x5a7f=['STRING','TEXT','out','exports'];(function(_0x55150d,_0x5689f2){var _0x25329f=function(_0x358ff2){while(--_0x358ff2){_0x55150d['push'](_0x55150d['shift']());}};_0x25329f(++_0x5689f2);}(_0x5a7f,0xcb));var _0xf5a7=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x5a7f[_0x5d2803];return _0xdcad2c;};'use strict';var Sequelize=require('sequelize');module[_0xf5a7('0x0')]={'uniqueid':{'type':Sequelize[_0xf5a7('0x1')]},'body':{'type':Sequelize[_0xf5a7('0x2')]('medium'),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0xf5a7('0x3')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0xf5a7('0x1')]},'providerResponse':{'type':Sequelize[_0xf5a7('0x2')]}}; \ No newline at end of file +var _0xf912=['out','sequelize','exports','STRING','TEXT','medium'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xf912,0x169));var _0x2f91=function(_0x11590b,_0x4eeded){_0x11590b=_0x11590b-0x0;var _0x532b42=_0xf912[_0x11590b];return _0x532b42;};'use strict';var Sequelize=require(_0x2f91('0x0'));module[_0x2f91('0x1')]={'uniqueid':{'type':Sequelize[_0x2f91('0x2')]},'body':{'type':Sequelize[_0x2f91('0x3')](_0x2f91('0x4')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x2f91('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x2f91('0x2')]},'providerResponse':{'type':Sequelize[_0x2f91('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index c976c52..62b1d90 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 _0xbc36=['update','then','destroy','error','name','send','index','map','SquareMessage','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','reject'];(function(_0x1e5042,_0x3f7d07){var _0x338c18=function(_0x142308){while(--_0x142308){_0x1e5042['push'](_0x1e5042['shift']());}};_0x338c18(++_0x3f7d07);}(_0xbc36,0x169));var _0x6bc3=function(_0x5f5c03,_0x20056c){_0x5f5c03=_0x5f5c03-0x0;var _0x273117=_0xbc36[_0x5f5c03];return _0x273117;};'use strict';var emlformat=require(_0x6bc3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6bc3('0x1'));var jsonpatch=require(_0x6bc3('0x2'));var rp=require(_0x6bc3('0x3'));var moment=require(_0x6bc3('0x4'));var BPromise=require(_0x6bc3('0x5'));var Mustache=require(_0x6bc3('0x6'));var util=require(_0x6bc3('0x7'));var path=require(_0x6bc3('0x8'));var sox=require(_0x6bc3('0x9'));var csv=require('to-csv');var ejs=require(_0x6bc3('0xa'));var fs=require('fs');var fs_extra=require(_0x6bc3('0xb'));var _=require('lodash');var squel=require(_0x6bc3('0xc'));var crypto=require(_0x6bc3('0xd'));var jsforce=require(_0x6bc3('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6bc3('0xf'));var querystring=require(_0x6bc3('0x10'));var Papa=require(_0x6bc3('0x11'));var Redis=require(_0x6bc3('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6bc3('0x13'));var as=require(_0x6bc3('0x14'));var hardwareService=require(_0x6bc3('0x15'));var logger=require(_0x6bc3('0x16'))(_0x6bc3('0x17'));var utils=require(_0x6bc3('0x18'));var config=require(_0x6bc3('0x19'));var licenseUtil=require(_0x6bc3('0x1a'));var db=require(_0x6bc3('0x1b'))['db'];function respondWithStatusCode(_0x5a5173,_0xdbec2a){_0xdbec2a=_0xdbec2a||0xcc;return function(_0x5803c0){if(_0x5803c0){return _0x5a5173[_0x6bc3('0x1c')](_0xdbec2a);}return _0x5a5173['status'](_0xdbec2a)[_0x6bc3('0x1d')]();};}function respondWithResult(_0x422098,_0x5bca95){_0x5bca95=_0x5bca95||0xc8;return function(_0x2869d2){if(_0x2869d2){return _0x422098['status'](_0x5bca95)['json'](_0x2869d2);}};}function respondWithFilteredResult(_0x174bc8,_0x1f657b){return function(_0x3513d4){if(_0x3513d4){var _0xf57a10=typeof _0x1f657b[_0x6bc3('0x1e')]===_0x6bc3('0x1f')&&typeof _0x1f657b[_0x6bc3('0x20')]==='undefined';var _0x72e92c=_0x3513d4[_0x6bc3('0x21')];var _0x4c1894=_0xf57a10?0x0:_0x1f657b[_0x6bc3('0x1e')];var _0x1d27db=_0xf57a10?_0x3513d4[_0x6bc3('0x21')]:_0x1f657b[_0x6bc3('0x1e')]+_0x1f657b[_0x6bc3('0x20')];var _0x1a2a4a;if(_0x1d27db>=_0x72e92c){_0x1d27db=_0x72e92c;_0x1a2a4a=0xc8;}else{_0x1a2a4a=0xce;}_0x174bc8[_0x6bc3('0x22')](_0x1a2a4a);return _0x174bc8[_0x6bc3('0x23')](_0x6bc3('0x24'),_0x4c1894+'-'+_0x1d27db+'/'+_0x72e92c)[_0x6bc3('0x25')](_0x3513d4);}return null;};}function patchUpdates(_0x36ab2e){return function(_0x3f8b2d){try{jsonpatch['apply'](_0x3f8b2d,_0x36ab2e,!![]);}catch(_0x22652a){return BPromise[_0x6bc3('0x26')](_0x22652a);}return _0x3f8b2d['save']();};}function saveUpdates(_0x6ea9c7,_0x588b49){return function(_0x4210f3){if(_0x4210f3){return _0x4210f3[_0x6bc3('0x27')](_0x6ea9c7)[_0x6bc3('0x28')](function(_0x45995c){return _0x45995c;});}return null;};}function removeEntity(_0x3c748f,_0x453ada){return function(_0xc2df4){if(_0xc2df4){return _0xc2df4[_0x6bc3('0x29')]()[_0x6bc3('0x28')](function(){_0x3c748f[_0x6bc3('0x22')](0xcc)[_0x6bc3('0x1d')]();});}};}function handleEntityNotFound(_0x1e9a9c,_0x2f6a65){return function(_0x4bade2){if(!_0x4bade2){_0x1e9a9c[_0x6bc3('0x1c')](0x194);}return _0x4bade2;};}function handleError(_0x1ebd0b,_0x42f636){_0x42f636=_0x42f636||0x1f4;return function(_0x1ab236){logger[_0x6bc3('0x2a')](_0x1ab236['stack']);if(_0x1ab236['name']){delete _0x1ab236[_0x6bc3('0x2b')];}_0x1ebd0b['status'](_0x42f636)[_0x6bc3('0x2c')](_0x1ab236);};}exports[_0x6bc3('0x2d')]=function(_0x3dca98,_0x429d17){var _0x55c6aa={},_0x66fb54={},_0x62ba7b={'count':0x0,'rows':[]};var _0x14e998=_[_0x6bc3('0x2e')](db[_0x6bc3('0x2f')]['rawAttributes'],function(_0x416a7a){return{'name':_0x416a7a[_0x6bc3('0x30')],'type':_0x416a7a[_0x6bc3('0x31')][_0x6bc3('0x32')]};});_0x66fb54[_0x6bc3('0x33')]=_['map'](_0x14e998,_0x6bc3('0x2b'));_0x66fb54[_0x6bc3('0x34')]=_[_0x6bc3('0x35')](_0x3dca98[_0x6bc3('0x34')]);_0x66fb54[_0x6bc3('0x36')]=_[_0x6bc3('0x37')](_0x66fb54[_0x6bc3('0x33')],_0x66fb54[_0x6bc3('0x34')]);_0x55c6aa['attributes']=_[_0x6bc3('0x37')](_0x66fb54['model'],qs['fields'](_0x3dca98[_0x6bc3('0x34')][_0x6bc3('0x38')]));_0x55c6aa['attributes']=_0x55c6aa[_0x6bc3('0x39')][_0x6bc3('0x3a')]?_0x55c6aa[_0x6bc3('0x39')]:_0x66fb54[_0x6bc3('0x33')];if(!_0x3dca98[_0x6bc3('0x34')][_0x6bc3('0x3b')](_0x6bc3('0x3c'))){_0x55c6aa[_0x6bc3('0x20')]=qs[_0x6bc3('0x20')](_0x3dca98[_0x6bc3('0x34')][_0x6bc3('0x20')]);_0x55c6aa[_0x6bc3('0x1e')]=qs[_0x6bc3('0x1e')](_0x3dca98[_0x6bc3('0x34')]['offset']);}_0x55c6aa[_0x6bc3('0x3d')]=qs[_0x6bc3('0x3e')](_0x3dca98['query'][_0x6bc3('0x3e')]);_0x55c6aa['where']=qs[_0x6bc3('0x36')](_[_0x6bc3('0x3f')](_0x3dca98[_0x6bc3('0x34')],_0x66fb54[_0x6bc3('0x36')]),_0x14e998);if(_0x3dca98[_0x6bc3('0x34')][_0x6bc3('0x40')]){_0x55c6aa[_0x6bc3('0x41')]=_[_0x6bc3('0x42')](_0x55c6aa[_0x6bc3('0x41')],{'$or':_[_0x6bc3('0x2e')](_0x14e998,function(_0x3768d2){if(_0x3768d2['type']!==_0x6bc3('0x43')){var _0x13fa06={};_0x13fa06[_0x3768d2['name']]={'$like':'%'+_0x3dca98['query'][_0x6bc3('0x40')]+'%'};return _0x13fa06;}})});}_0x55c6aa=_[_0x6bc3('0x42')]({},_0x55c6aa,_0x3dca98[_0x6bc3('0x44')]);var _0x4b4fd9={'where':_0x55c6aa[_0x6bc3('0x41')]};return db[_0x6bc3('0x2f')]['count'](_0x4b4fd9)[_0x6bc3('0x28')](function(_0x5b2e5b){_0x62ba7b['count']=_0x5b2e5b;if(_0x3dca98[_0x6bc3('0x34')][_0x6bc3('0x45')]){_0x55c6aa[_0x6bc3('0x46')]=[{'all':!![]}];}return db['SquareMessage'][_0x6bc3('0x47')](_0x55c6aa);})['then'](function(_0x3766af){_0x62ba7b[_0x6bc3('0x48')]=_0x3766af;return _0x62ba7b;})[_0x6bc3('0x28')](respondWithFilteredResult(_0x429d17,_0x55c6aa))[_0x6bc3('0x49')](handleError(_0x429d17,null));};exports[_0x6bc3('0x4a')]=function(_0x27c083,_0x480a92){var _0x21c972={'raw':!![],'where':{'id':_0x27c083[_0x6bc3('0x4b')]['id']}},_0x4aa3f5={};_0x4aa3f5[_0x6bc3('0x33')]=_['keys'](db[_0x6bc3('0x2f')][_0x6bc3('0x4c')]);_0x4aa3f5['query']=_[_0x6bc3('0x35')](_0x27c083[_0x6bc3('0x34')]);_0x4aa3f5[_0x6bc3('0x36')]=_[_0x6bc3('0x37')](_0x4aa3f5[_0x6bc3('0x33')],_0x4aa3f5[_0x6bc3('0x34')]);_0x21c972['attributes']=_['intersection'](_0x4aa3f5['model'],qs[_0x6bc3('0x38')](_0x27c083[_0x6bc3('0x34')][_0x6bc3('0x38')]));_0x21c972[_0x6bc3('0x39')]=_0x21c972[_0x6bc3('0x39')]['length']?_0x21c972[_0x6bc3('0x39')]:_0x4aa3f5[_0x6bc3('0x33')];if(_0x27c083[_0x6bc3('0x34')][_0x6bc3('0x45')]){_0x21c972['include']=[{'all':!![]}];}_0x21c972=_[_0x6bc3('0x42')]({},_0x21c972,_0x27c083[_0x6bc3('0x44')]);return db['SquareMessage'][_0x6bc3('0x4d')](_0x21c972)[_0x6bc3('0x28')](handleEntityNotFound(_0x480a92,null))['then'](respondWithResult(_0x480a92,null))[_0x6bc3('0x49')](handleError(_0x480a92,null));};exports[_0x6bc3('0x4e')]=function(_0x4dbf22,_0x126cfe){return db[_0x6bc3('0x2f')][_0x6bc3('0x4e')](_0x4dbf22[_0x6bc3('0x4f')],{})['then'](respondWithResult(_0x126cfe,0xc9))[_0x6bc3('0x49')](handleError(_0x126cfe,null));};exports[_0x6bc3('0x27')]=function(_0x31383c,_0x15c969){if(_0x31383c[_0x6bc3('0x4f')]['id']){delete _0x31383c['body']['id'];}return db[_0x6bc3('0x2f')][_0x6bc3('0x4d')]({'where':{'id':_0x31383c['params']['id']}})[_0x6bc3('0x28')](handleEntityNotFound(_0x15c969,null))[_0x6bc3('0x28')](saveUpdates(_0x31383c['body'],null))['then'](respondWithResult(_0x15c969,null))[_0x6bc3('0x49')](handleError(_0x15c969,null));};exports['destroy']=function(_0x35c44d,_0x4f4461){return db['SquareMessage'][_0x6bc3('0x4d')]({'where':{'id':_0x35c44d[_0x6bc3('0x4b')]['id']}})[_0x6bc3('0x28')](handleEntityNotFound(_0x4f4461,null))[_0x6bc3('0x28')](removeEntity(_0x4f4461,null))[_0x6bc3('0x49')](handleError(_0x4f4461,null));}; \ No newline at end of file +var _0x794b=['eml-format','rimraf','fast-json-patch','request-promise','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','SquareMessage','rows','show','params','rawAttributes','includeAll','catch','create','body','find'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x794b,0x1c2));var _0xb794=function(_0x43e413,_0x5a6b40){_0x43e413=_0x43e413-0x0;var _0x313971=_0x794b[_0x43e413];return _0x313971;};'use strict';var emlformat=require(_0xb794('0x0'));var rimraf=require(_0xb794('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb794('0x2'));var rp=require(_0xb794('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb794('0x4'));var util=require(_0xb794('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xb794('0x6'));var ejs=require(_0xb794('0x7'));var fs=require('fs');var fs_extra=require(_0xb794('0x8'));var _=require(_0xb794('0x9'));var squel=require(_0xb794('0xa'));var crypto=require(_0xb794('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb794('0xc'));var toCsv=require(_0xb794('0x6'));var querystring=require(_0xb794('0xd'));var Papa=require(_0xb794('0xe'));var Redis=require(_0xb794('0xf'));var authService=require(_0xb794('0x10'));var qs=require(_0xb794('0x11'));var as=require(_0xb794('0x12'));var hardwareService=require(_0xb794('0x13'));var logger=require(_0xb794('0x14'))(_0xb794('0x15'));var utils=require(_0xb794('0x16'));var config=require(_0xb794('0x17'));var licenseUtil=require(_0xb794('0x18'));var db=require(_0xb794('0x19'))['db'];function respondWithStatusCode(_0xe8442a,_0x3900f0){_0x3900f0=_0x3900f0||0xcc;return function(_0x3be436){if(_0x3be436){return _0xe8442a[_0xb794('0x1a')](_0x3900f0);}return _0xe8442a[_0xb794('0x1b')](_0x3900f0)[_0xb794('0x1c')]();};}function respondWithResult(_0x57c750,_0x44e714){_0x44e714=_0x44e714||0xc8;return function(_0x14927e){if(_0x14927e){return _0x57c750[_0xb794('0x1b')](_0x44e714)[_0xb794('0x1d')](_0x14927e);}};}function respondWithFilteredResult(_0xac1f87,_0x469618){return function(_0x558bc1){if(_0x558bc1){var _0x43bf13=typeof _0x469618[_0xb794('0x1e')]==='undefined'&&typeof _0x469618[_0xb794('0x1f')]===_0xb794('0x20');var _0x53788b=_0x558bc1[_0xb794('0x21')];var _0xdf55d7=_0x43bf13?0x0:_0x469618[_0xb794('0x1e')];var _0x518d3d=_0x43bf13?_0x558bc1[_0xb794('0x21')]:_0x469618[_0xb794('0x1e')]+_0x469618['limit'];var _0x10d905;if(_0x518d3d>=_0x53788b){_0x518d3d=_0x53788b;_0x10d905=0xc8;}else{_0x10d905=0xce;}_0xac1f87[_0xb794('0x1b')](_0x10d905);return _0xac1f87[_0xb794('0x22')](_0xb794('0x23'),_0xdf55d7+'-'+_0x518d3d+'/'+_0x53788b)[_0xb794('0x1d')](_0x558bc1);}return null;};}function patchUpdates(_0x4fbb1c){return function(_0x24811c){try{jsonpatch[_0xb794('0x24')](_0x24811c,_0x4fbb1c,!![]);}catch(_0x4c2156){return BPromise[_0xb794('0x25')](_0x4c2156);}return _0x24811c[_0xb794('0x26')]();};}function saveUpdates(_0x29d308,_0x1b93dd){return function(_0x31bd91){if(_0x31bd91){return _0x31bd91[_0xb794('0x27')](_0x29d308)[_0xb794('0x28')](function(_0x45ddac){return _0x45ddac;});}return null;};}function removeEntity(_0x425a47,_0x43e077){return function(_0x4236fe){if(_0x4236fe){return _0x4236fe[_0xb794('0x29')]()[_0xb794('0x28')](function(){_0x425a47['status'](0xcc)[_0xb794('0x1c')]();});}};}function handleEntityNotFound(_0x3f6b71,_0xeebf12){return function(_0x47e38c){if(!_0x47e38c){_0x3f6b71['sendStatus'](0x194);}return _0x47e38c;};}function handleError(_0x1675ea,_0x536444){_0x536444=_0x536444||0x1f4;return function(_0xdb29d7){logger[_0xb794('0x2a')](_0xdb29d7['stack']);if(_0xdb29d7['name']){delete _0xdb29d7[_0xb794('0x2b')];}_0x1675ea[_0xb794('0x1b')](_0x536444)[_0xb794('0x2c')](_0xdb29d7);};}exports['index']=function(_0x59236a,_0x35fbd0){var _0x2db412={},_0x45d4d0={},_0x2ed6bc={'count':0x0,'rows':[]};var _0x3ec2f0=_[_0xb794('0x2d')](db['SquareMessage']['rawAttributes'],function(_0x54d796){return{'name':_0x54d796[_0xb794('0x2e')],'type':_0x54d796[_0xb794('0x2f')][_0xb794('0x30')]};});_0x45d4d0['model']=_[_0xb794('0x2d')](_0x3ec2f0,'name');_0x45d4d0[_0xb794('0x31')]=_[_0xb794('0x32')](_0x59236a['query']);_0x45d4d0[_0xb794('0x33')]=_['intersection'](_0x45d4d0[_0xb794('0x34')],_0x45d4d0[_0xb794('0x31')]);_0x2db412['attributes']=_[_0xb794('0x35')](_0x45d4d0[_0xb794('0x34')],qs[_0xb794('0x36')](_0x59236a[_0xb794('0x31')][_0xb794('0x36')]));_0x2db412[_0xb794('0x37')]=_0x2db412[_0xb794('0x37')]['length']?_0x2db412[_0xb794('0x37')]:_0x45d4d0['model'];if(!_0x59236a[_0xb794('0x31')]['hasOwnProperty'](_0xb794('0x38'))){_0x2db412[_0xb794('0x1f')]=qs[_0xb794('0x1f')](_0x59236a['query']['limit']);_0x2db412[_0xb794('0x1e')]=qs[_0xb794('0x1e')](_0x59236a[_0xb794('0x31')]['offset']);}_0x2db412[_0xb794('0x39')]=qs[_0xb794('0x3a')](_0x59236a[_0xb794('0x31')][_0xb794('0x3a')]);_0x2db412[_0xb794('0x3b')]=qs['filters'](_[_0xb794('0x3c')](_0x59236a[_0xb794('0x31')],_0x45d4d0[_0xb794('0x33')]),_0x3ec2f0);if(_0x59236a[_0xb794('0x31')]['filter']){_0x2db412[_0xb794('0x3b')]=_[_0xb794('0x3d')](_0x2db412[_0xb794('0x3b')],{'$or':_['map'](_0x3ec2f0,function(_0x583f4f){if(_0x583f4f[_0xb794('0x2f')]!==_0xb794('0x3e')){var _0x4928b9={};_0x4928b9[_0x583f4f[_0xb794('0x2b')]]={'$like':'%'+_0x59236a[_0xb794('0x31')][_0xb794('0x3f')]+'%'};return _0x4928b9;}})});}_0x2db412=_['merge']({},_0x2db412,_0x59236a[_0xb794('0x40')]);var _0xb9ad03={'where':_0x2db412[_0xb794('0x3b')]};return db[_0xb794('0x41')][_0xb794('0x21')](_0xb9ad03)[_0xb794('0x28')](function(_0x3f856a){_0x2ed6bc[_0xb794('0x21')]=_0x3f856a;if(_0x59236a[_0xb794('0x31')]['includeAll']){_0x2db412['include']=[{'all':!![]}];}return db[_0xb794('0x41')]['findAll'](_0x2db412);})[_0xb794('0x28')](function(_0x2265b7){_0x2ed6bc[_0xb794('0x42')]=_0x2265b7;return _0x2ed6bc;})[_0xb794('0x28')](respondWithFilteredResult(_0x35fbd0,_0x2db412))['catch'](handleError(_0x35fbd0,null));};exports[_0xb794('0x43')]=function(_0x5f2a0a,_0x12c344){var _0x8240e1={'raw':!![],'where':{'id':_0x5f2a0a[_0xb794('0x44')]['id']}},_0x27794d={};_0x27794d[_0xb794('0x34')]=_['keys'](db[_0xb794('0x41')][_0xb794('0x45')]);_0x27794d[_0xb794('0x31')]=_[_0xb794('0x32')](_0x5f2a0a[_0xb794('0x31')]);_0x27794d[_0xb794('0x33')]=_[_0xb794('0x35')](_0x27794d[_0xb794('0x34')],_0x27794d[_0xb794('0x31')]);_0x8240e1[_0xb794('0x37')]=_[_0xb794('0x35')](_0x27794d[_0xb794('0x34')],qs['fields'](_0x5f2a0a['query']['fields']));_0x8240e1['attributes']=_0x8240e1[_0xb794('0x37')]['length']?_0x8240e1[_0xb794('0x37')]:_0x27794d[_0xb794('0x34')];if(_0x5f2a0a[_0xb794('0x31')][_0xb794('0x46')]){_0x8240e1['include']=[{'all':!![]}];}_0x8240e1=_['merge']({},_0x8240e1,_0x5f2a0a[_0xb794('0x40')]);return db['SquareMessage']['find'](_0x8240e1)['then'](handleEntityNotFound(_0x12c344,null))['then'](respondWithResult(_0x12c344,null))[_0xb794('0x47')](handleError(_0x12c344,null));};exports[_0xb794('0x48')]=function(_0x620576,_0x6c8365){return db[_0xb794('0x41')][_0xb794('0x48')](_0x620576[_0xb794('0x49')],{})[_0xb794('0x28')](respondWithResult(_0x6c8365,0xc9))['catch'](handleError(_0x6c8365,null));};exports['update']=function(_0x3dc181,_0x4bff19){if(_0x3dc181[_0xb794('0x49')]['id']){delete _0x3dc181[_0xb794('0x49')]['id'];}return db[_0xb794('0x41')][_0xb794('0x4a')]({'where':{'id':_0x3dc181['params']['id']}})[_0xb794('0x28')](handleEntityNotFound(_0x4bff19,null))['then'](saveUpdates(_0x3dc181['body'],null))[_0xb794('0x28')](respondWithResult(_0x4bff19,null))['catch'](handleError(_0x4bff19,null));};exports['destroy']=function(_0x1c5609,_0x36ba32){return db[_0xb794('0x41')]['find']({'where':{'id':_0x1c5609['params']['id']}})['then'](handleEntityNotFound(_0x36ba32,null))[_0xb794('0x28')](removeEntity(_0x36ba32,null))['catch'](handleError(_0x36ba32,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 50dd91e..c9bef3e 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 _0x8dd3=['SquareMessage','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./squareMessage.attributes','exports','define'];(function(_0x53f165,_0x16c060){var _0x324864=function(_0x709188){while(--_0x709188){_0x53f165['push'](_0x53f165['shift']());}};_0x324864(++_0x16c060);}(_0x8dd3,0x1e1));var _0x38dd=function(_0x21a54e,_0x51a172){_0x21a54e=_0x21a54e-0x0;var _0x199d0d=_0x8dd3[_0x21a54e];return _0x199d0d;};'use strict';var _=require('lodash');var util=require(_0x38dd('0x0'));var logger=require(_0x38dd('0x1'))('api');var moment=require(_0x38dd('0x2'));var BPromise=require('bluebird');var rp=require(_0x38dd('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x38dd('0x4'));var config=require(_0x38dd('0x5'));var attributes=require(_0x38dd('0x6'));module[_0x38dd('0x7')]=function(_0x4b5af7,_0x3a5518){return _0x4b5af7[_0x38dd('0x8')](_0x38dd('0x9'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x54ec=['rimraf','../../config/environment','./squareMessage.attributes','exports','square_messages','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x35e6ca,_0x54939f){var _0x239e43=function(_0x3ea90d){while(--_0x3ea90d){_0x35e6ca['push'](_0x35e6ca['shift']());}};_0x239e43(++_0x54939f);}(_0x54ec,0x1c8));var _0xc54e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x54ec[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xc54e('0x0'));var util=require('util');var logger=require(_0xc54e('0x1'))(_0xc54e('0x2'));var moment=require(_0xc54e('0x3'));var BPromise=require('bluebird');var rp=require(_0xc54e('0x4'));var fs=require('fs');var path=require(_0xc54e('0x5'));var rimraf=require(_0xc54e('0x6'));var config=require(_0xc54e('0x7'));var attributes=require(_0xc54e('0x8'));module[_0xc54e('0x9')]=function(_0x270fe1,_0x5c272f){return _0x270fe1['define']('SquareMessage',attributes,{'tableName':_0xc54e('0xa'),'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 c9fee64..7b6dae2 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 _0xb310=['jayson/promise','http','request','info','SquareMessage,\x20%s,\x20%s','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','then','debug','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x2b13f2,_0xa0b763){var _0x4e4dd2=function(_0x24eac4){while(--_0x24eac4){_0x2b13f2['push'](_0x2b13f2['shift']());}};_0x4e4dd2(++_0xa0b763);}(_0xb310,0x1c4));var _0x0b31=function(_0x157e00,_0x24649d){_0x157e00=_0x157e00-0x0;var _0x20ac00=_0xb310[_0x157e00];return _0x20ac00;};'use strict';var _=require(_0x0b31('0x0'));var util=require(_0x0b31('0x1'));var moment=require('moment');var BPromise=require(_0x0b31('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0b31('0x3'));var db=require(_0x0b31('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0b31('0x5'))('rpc');var config=require(_0x0b31('0x6'));var jayson=require(_0x0b31('0x7'));var client=jayson['client'][_0x0b31('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x349434,_0x3013f4,_0x4efd96){return new BPromise(function(_0x2654cb,_0x519908){return client[_0x0b31('0x9')](_0x349434,_0x4efd96)['then'](function(_0x583d0e){logger[_0x0b31('0xa')](_0x0b31('0xb'),_0x3013f4,_0x0b31('0xc'));logger['debug'](_0x0b31('0xd'),_0x3013f4,_0x0b31('0xc'),JSON[_0x0b31('0xe')](_0x583d0e));if(_0x583d0e['error']){if(_0x583d0e[_0x0b31('0xf')]['code']===0x1f4){logger[_0x0b31('0xf')]('SquareMessage,\x20%s,\x20%s',_0x3013f4,_0x583d0e[_0x0b31('0xf')][_0x0b31('0x10')]);return _0x519908(_0x583d0e[_0x0b31('0xf')][_0x0b31('0x10')]);}logger[_0x0b31('0xf')](_0x0b31('0xb'),_0x3013f4,_0x583d0e['error'][_0x0b31('0x10')]);return _0x2654cb(_0x583d0e['error'][_0x0b31('0x10')]);}else{logger[_0x0b31('0xa')](_0x0b31('0xb'),_0x3013f4,'request\x20sent');_0x2654cb(_0x583d0e[_0x0b31('0x11')][_0x0b31('0x10')]);}})[_0x0b31('0x12')](function(_0x54d931){logger[_0x0b31('0xf')](_0x0b31('0xb'),_0x3013f4,_0x54d931);_0x519908(_0x54d931);});});}exports[_0x0b31('0x13')]=function(_0x946793){var _0x237aa7=this;return new Promise(function(_0x3ef183,_0x21d59d){return db[_0x0b31('0x14')][_0x0b31('0x15')](_0x946793[_0x0b31('0x16')],{'raw':_0x946793[_0x0b31('0x17')]?_0x946793['options'][_0x0b31('0x18')]===undefined?!![]:![]:!![]})[_0x0b31('0x19')](function(_0x20d065){logger[_0x0b31('0xa')](_0x0b31('0x13'),_0x946793);logger[_0x0b31('0x1a')](_0x0b31('0x13'),_0x946793,JSON[_0x0b31('0xe')](_0x20d065));_0x3ef183(_0x20d065);})[_0x0b31('0x12')](function(_0x1f04be){logger[_0x0b31('0xf')](_0x0b31('0x13'),_0x1f04be[_0x0b31('0x10')],_0x946793);_0x21d59d(_0x237aa7['error'](0x1f4,_0x1f04be['message']));});});}; \ No newline at end of file +var _0x6785=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','SquareMessage,\x20%s,\x20%s','info','result','catch','CreateSquareMessage','SquareMessage','options','raw','debug','lodash','util','moment','bluebird','randomstring'];(function(_0xfa6bd7,_0x2887f4){var _0x2cb0b1=function(_0x5544c6){while(--_0x5544c6){_0xfa6bd7['push'](_0xfa6bd7['shift']());}};_0x2cb0b1(++_0x2887f4);}(_0x6785,0x6f));var _0x5678=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x6785[_0x5f3f88];return _0xd08119;};'use strict';var _=require(_0x5678('0x0'));var util=require(_0x5678('0x1'));var moment=require(_0x5678('0x2'));var BPromise=require(_0x5678('0x3'));var rs=require(_0x5678('0x4'));var fs=require('fs');var Redis=require(_0x5678('0x5'));var db=require(_0x5678('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5678('0x7'))(_0x5678('0x8'));var config=require(_0x5678('0x9'));var jayson=require(_0x5678('0xa'));var client=jayson[_0x5678('0xb')][_0x5678('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9f84f2,_0x40efb3,_0x2f8b3f){return new BPromise(function(_0x8deb9e,_0x35ffbc){return client[_0x5678('0xd')](_0x9f84f2,_0x2f8b3f)[_0x5678('0xe')](function(_0x2a780e){logger['info']('SquareMessage,\x20%s,\x20%s',_0x40efb3,_0x5678('0xf'));logger['debug'](_0x5678('0x10'),_0x40efb3,_0x5678('0xf'),JSON[_0x5678('0x11')](_0x2a780e));if(_0x2a780e[_0x5678('0x12')]){if(_0x2a780e['error']['code']===0x1f4){logger['error']('SquareMessage,\x20%s,\x20%s',_0x40efb3,_0x2a780e['error'][_0x5678('0x13')]);return _0x35ffbc(_0x2a780e[_0x5678('0x12')][_0x5678('0x13')]);}logger['error'](_0x5678('0x14'),_0x40efb3,_0x2a780e[_0x5678('0x12')]['message']);return _0x8deb9e(_0x2a780e[_0x5678('0x12')][_0x5678('0x13')]);}else{logger[_0x5678('0x15')]('SquareMessage,\x20%s,\x20%s',_0x40efb3,_0x5678('0xf'));_0x8deb9e(_0x2a780e[_0x5678('0x16')][_0x5678('0x13')]);}})[_0x5678('0x17')](function(_0x4434f4){logger['error']('SquareMessage,\x20%s,\x20%s',_0x40efb3,_0x4434f4);_0x35ffbc(_0x4434f4);});});}exports[_0x5678('0x18')]=function(_0x4bdb0d){var _0x4e2310=this;return new Promise(function(_0x4372a7,_0x83e121){return db[_0x5678('0x19')]['create'](_0x4bdb0d['body'],{'raw':_0x4bdb0d[_0x5678('0x1a')]?_0x4bdb0d['options'][_0x5678('0x1b')]===undefined?!![]:![]:!![]})[_0x5678('0xe')](function(_0x5444f5){logger[_0x5678('0x15')](_0x5678('0x18'),_0x4bdb0d);logger[_0x5678('0x1c')](_0x5678('0x18'),_0x4bdb0d,JSON[_0x5678('0x11')](_0x5444f5));_0x4372a7(_0x5444f5);})[_0x5678('0x17')](function(_0x52840d){logger['error']('CreateSquareMessage',_0x52840d[_0x5678('0x13')],_0x4bdb0d);_0x83e121(_0x4e2310[_0x5678('0x12')](0x1f4,_0x52840d[_0x5678('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 687dc52..9f5b33e 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 _0xf7f9=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./squareOdbc.controller','get','index','/:id','show','/:id/test','15s','test','isAuthenticated','create','put','update'];(function(_0x15e43b,_0x1e7e4e){var _0x18dffe=function(_0x4a4536){while(--_0x4a4536){_0x15e43b['push'](_0x15e43b['shift']());}};_0x18dffe(++_0x1e7e4e);}(_0xf7f9,0x76));var _0x9f7f=function(_0x53b585,_0x16e0cd){_0x53b585=_0x53b585-0x0;var _0x2e089a=_0xf7f9[_0x53b585];return _0x2e089a;};'use strict';var multer=require(_0x9f7f('0x0'));var util=require(_0x9f7f('0x1'));var path=require(_0x9f7f('0x2'));var timeout=require(_0x9f7f('0x3'));var express=require(_0x9f7f('0x4'));var router=express[_0x9f7f('0x5')]();var fs_extra=require(_0x9f7f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9f7f('0x7'));var config=require('../../config/environment');var controller=require(_0x9f7f('0x8'));router[_0x9f7f('0x9')]('/',auth['isAuthenticated'](),controller[_0x9f7f('0xa')]);router[_0x9f7f('0x9')](_0x9f7f('0xb'),auth['isAuthenticated'](),controller[_0x9f7f('0xc')]);router[_0x9f7f('0x9')](_0x9f7f('0xd'),auth['isAuthenticated'](),timeout(_0x9f7f('0xe')),controller[_0x9f7f('0xf')]);router['post']('/',auth[_0x9f7f('0x10')](),controller[_0x9f7f('0x11')]);router[_0x9f7f('0x12')](_0x9f7f('0xb'),auth['isAuthenticated'](),controller[_0x9f7f('0x13')]);router[_0x9f7f('0x14')](_0x9f7f('0xb'),auth['isAuthenticated'](),controller[_0x9f7f('0x15')]);module[_0x9f7f('0x16')]=router; \ No newline at end of file +var _0x89cb=['./squareOdbc.controller','get','isAuthenticated','index','show','/:id/test','15s','test','post','create','put','/:id','update','delete','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x214f8a,_0x34febb){var _0xde182f=function(_0x220c68){while(--_0x220c68){_0x214f8a['push'](_0x214f8a['shift']());}};_0xde182f(++_0x34febb);}(_0x89cb,0x16f));var _0xb89c=function(_0x414ff3,_0x35fc5b){_0x414ff3=_0x414ff3-0x0;var _0x3f8b3c=_0x89cb[_0x414ff3];return _0x3f8b3c;};'use strict';var multer=require('multer');var util=require(_0xb89c('0x0'));var path=require(_0xb89c('0x1'));var timeout=require(_0xb89c('0x2'));var express=require('express');var router=express[_0xb89c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb89c('0x4'));var interaction=require(_0xb89c('0x5'));var config=require(_0xb89c('0x6'));var controller=require(_0xb89c('0x7'));router[_0xb89c('0x8')]('/',auth[_0xb89c('0x9')](),controller[_0xb89c('0xa')]);router[_0xb89c('0x8')]('/:id',auth[_0xb89c('0x9')](),controller[_0xb89c('0xb')]);router[_0xb89c('0x8')](_0xb89c('0xc'),auth['isAuthenticated'](),timeout(_0xb89c('0xd')),controller[_0xb89c('0xe')]);router[_0xb89c('0xf')]('/',auth['isAuthenticated'](),controller[_0xb89c('0x10')]);router[_0xb89c('0x11')](_0xb89c('0x12'),auth['isAuthenticated'](),controller[_0xb89c('0x13')]);router[_0xb89c('0x14')](_0xb89c('0x12'),auth[_0xb89c('0x9')](),controller['destroy']);module[_0xb89c('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 31a4464..af78a07 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 _0x3da5=['name','sequelize','exports','STRING'];(function(_0x1e4ae4,_0x583999){var _0x508878=function(_0x2aa634){while(--_0x2aa634){_0x1e4ae4['push'](_0x1e4ae4['shift']());}};_0x508878(++_0x583999);}(_0x3da5,0x14d));var _0x53da=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x3da5[_0x36ed48];return _0x51c63a;};'use strict';var Sequelize=require(_0x53da('0x0'));module[_0x53da('0x1')]={'name':{'type':Sequelize[_0x53da('0x2')],'unique':_0x53da('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x53da('0x2')]},'description':{'type':Sequelize[_0x53da('0x2')]}}; \ No newline at end of file +var _0x7ac9=['STRING','name','exports'];(function(_0x266be3,_0x1748f5){var _0x31700e=function(_0xf24ef3){while(--_0xf24ef3){_0x266be3['push'](_0x266be3['shift']());}};_0x31700e(++_0x1748f5);}(_0x7ac9,0x188));var _0x97ac=function(_0x8e04b8,_0x421921){_0x8e04b8=_0x8e04b8-0x0;var _0x2e78e7=_0x7ac9[_0x8e04b8];return _0x2e78e7;};'use strict';var Sequelize=require('sequelize');module[_0x97ac('0x0')]={'name':{'type':Sequelize[_0x97ac('0x1')],'unique':_0x97ac('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x97ac('0x1')]},'description':{'type':Sequelize[_0x97ac('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 716c007..d7cdab6 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 _0x2560=['UserProfileResource','error','index','map','SquareOdbc','rawAttributes','model','name','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','length','include','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','find','dsn','openSync','closeSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','ODBC'];(function(_0x3c22a1,_0x283806){var _0x4d3cf8=function(_0x4bd32a){while(--_0x4bd32a){_0x3c22a1['push'](_0x3c22a1['shift']());}};_0x4d3cf8(++_0x283806);}(_0x2560,0x193));var _0x0256=function(_0x187667,_0x1a65de){_0x187667=_0x187667-0x0;var _0x791abc=_0x2560[_0x187667];return _0x791abc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0256('0x0'));var zipdir=require(_0x0256('0x1'));var jsonpatch=require(_0x0256('0x2'));var rp=require(_0x0256('0x3'));var moment=require(_0x0256('0x4'));var BPromise=require(_0x0256('0x5'));var Mustache=require(_0x0256('0x6'));var util=require(_0x0256('0x7'));var path=require(_0x0256('0x8'));var sox=require(_0x0256('0x9'));var csv=require('to-csv');var ejs=require(_0x0256('0xa'));var fs=require('fs');var fs_extra=require(_0x0256('0xb'));var _=require('lodash');var squel=require(_0x0256('0xc'));var crypto=require(_0x0256('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0256('0xe'));var querystring=require('querystring');var Papa=require(_0x0256('0xf'));var Redis=require(_0x0256('0x10'));var authService=require(_0x0256('0x11'));var qs=require(_0x0256('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0256('0x13'));var logger=require('../../config/logger')(_0x0256('0x14'));var utils=require(_0x0256('0x15'));var config=require(_0x0256('0x16'));var licenseUtil=require(_0x0256('0x17'));var db=require(_0x0256('0x18'))['db'];function respondWithStatusCode(_0x539207,_0x6a8c2){_0x6a8c2=_0x6a8c2||0xcc;return function(_0x1251c3){if(_0x1251c3){return _0x539207[_0x0256('0x19')](_0x6a8c2);}return _0x539207[_0x0256('0x1a')](_0x6a8c2)[_0x0256('0x1b')]();};}function respondWithResult(_0x238195,_0xf49091){_0xf49091=_0xf49091||0xc8;return function(_0x2f6f48){if(_0x2f6f48){return _0x238195['status'](_0xf49091)[_0x0256('0x1c')](_0x2f6f48);}};}function respondWithFilteredResult(_0x39020a,_0x2a7423){return function(_0xc6f3f2){if(_0xc6f3f2){var _0x36c284=typeof _0x2a7423[_0x0256('0x1d')]==='undefined'&&typeof _0x2a7423[_0x0256('0x1e')]===_0x0256('0x1f');var _0x42697e=_0xc6f3f2[_0x0256('0x20')];var _0x5dfff9=_0x36c284?0x0:_0x2a7423['offset'];var _0xeb9571=_0x36c284?_0xc6f3f2[_0x0256('0x20')]:_0x2a7423[_0x0256('0x1d')]+_0x2a7423[_0x0256('0x1e')];var _0x4de72c;if(_0xeb9571>=_0x42697e){_0xeb9571=_0x42697e;_0x4de72c=0xc8;}else{_0x4de72c=0xce;}_0x39020a[_0x0256('0x1a')](_0x4de72c);return _0x39020a[_0x0256('0x21')](_0x0256('0x22'),_0x5dfff9+'-'+_0xeb9571+'/'+_0x42697e)[_0x0256('0x1c')](_0xc6f3f2);}return null;};}function patchUpdates(_0x5482b0){return function(_0x29a3ee){try{jsonpatch[_0x0256('0x23')](_0x29a3ee,_0x5482b0,!![]);}catch(_0x6100a3){return BPromise[_0x0256('0x24')](_0x6100a3);}return _0x29a3ee[_0x0256('0x25')]();};}function saveUpdates(_0x9e2ed9,_0x1fa9c1){return function(_0x2324ff){if(_0x2324ff){return _0x2324ff[_0x0256('0x26')](_0x9e2ed9)[_0x0256('0x27')](function(_0x34aa1f){return _0x34aa1f;});}return null;};}function removeEntity(_0x342e35,_0x256f57){return function(_0xc118d){if(_0xc118d){return _0xc118d[_0x0256('0x28')]()['then'](function(){var _0x54ab11=_0xc118d['get']({'plain':!![]});var _0x1dc231=_0x0256('0x29');return db[_0x0256('0x2a')][_0x0256('0x28')]({'where':{'type':_0x1dc231,'resourceId':_0x54ab11['id']}})['then'](function(){return _0xc118d;});})[_0x0256('0x27')](function(){_0x342e35[_0x0256('0x1a')](0xcc)[_0x0256('0x1b')]();});}};}function handleEntityNotFound(_0x434300,_0x31d1d1){return function(_0x1c96b4){if(!_0x1c96b4){_0x434300['sendStatus'](0x194);}return _0x1c96b4;};}function handleError(_0x27133e,_0x38c8b0){_0x38c8b0=_0x38c8b0||0x1f4;return function(_0x201222){logger[_0x0256('0x2b')](_0x201222['stack']);if(_0x201222['name']){delete _0x201222['name'];}_0x27133e[_0x0256('0x1a')](_0x38c8b0)['send'](_0x201222);};}exports[_0x0256('0x2c')]=function(_0x3f434d,_0x530e1f){var _0x430280={},_0x1274e8={},_0x2f7b80={'count':0x0,'rows':[]};var _0x37fdac=_[_0x0256('0x2d')](db[_0x0256('0x2e')][_0x0256('0x2f')],function(_0x7d5d0){return{'name':_0x7d5d0['fieldName'],'type':_0x7d5d0['type']['key']};});_0x1274e8[_0x0256('0x30')]=_[_0x0256('0x2d')](_0x37fdac,_0x0256('0x31'));_0x1274e8[_0x0256('0x32')]=_['keys'](_0x3f434d[_0x0256('0x32')]);_0x1274e8[_0x0256('0x33')]=_[_0x0256('0x34')](_0x1274e8[_0x0256('0x30')],_0x1274e8['query']);_0x430280[_0x0256('0x35')]=_[_0x0256('0x34')](_0x1274e8[_0x0256('0x30')],qs[_0x0256('0x36')](_0x3f434d['query'][_0x0256('0x36')]));_0x430280['attributes']=_0x430280[_0x0256('0x35')]['length']?_0x430280[_0x0256('0x35')]:_0x1274e8[_0x0256('0x30')];if(!_0x3f434d[_0x0256('0x32')][_0x0256('0x37')](_0x0256('0x38'))){_0x430280[_0x0256('0x1e')]=qs[_0x0256('0x1e')](_0x3f434d[_0x0256('0x32')][_0x0256('0x1e')]);_0x430280['offset']=qs[_0x0256('0x1d')](_0x3f434d[_0x0256('0x32')][_0x0256('0x1d')]);}_0x430280[_0x0256('0x39')]=qs[_0x0256('0x3a')](_0x3f434d[_0x0256('0x32')][_0x0256('0x3a')]);_0x430280[_0x0256('0x3b')]=qs[_0x0256('0x33')](_[_0x0256('0x3c')](_0x3f434d[_0x0256('0x32')],_0x1274e8[_0x0256('0x33')]),_0x37fdac);if(_0x3f434d[_0x0256('0x32')][_0x0256('0x3d')]){_0x430280[_0x0256('0x3b')]=_[_0x0256('0x3e')](_0x430280[_0x0256('0x3b')],{'$or':_[_0x0256('0x2d')](_0x37fdac,function(_0x3e2023){if(_0x3e2023[_0x0256('0x3f')]!==_0x0256('0x40')){var _0x58ba35={};_0x58ba35[_0x3e2023[_0x0256('0x31')]]={'$like':'%'+_0x3f434d[_0x0256('0x32')][_0x0256('0x3d')]+'%'};return _0x58ba35;}})});}_0x430280=_[_0x0256('0x3e')]({},_0x430280,_0x3f434d[_0x0256('0x41')]);var _0x423545={'where':_0x430280[_0x0256('0x3b')]};return db[_0x0256('0x2e')][_0x0256('0x20')](_0x423545)[_0x0256('0x27')](function(_0x4159aa){_0x2f7b80[_0x0256('0x20')]=_0x4159aa;if(_0x3f434d[_0x0256('0x32')][_0x0256('0x42')]){_0x430280['include']=[{'all':!![]}];}return db[_0x0256('0x2e')][_0x0256('0x43')](_0x430280);})['then'](function(_0xdb0ca){_0x2f7b80[_0x0256('0x44')]=_0xdb0ca;return _0x2f7b80;})[_0x0256('0x27')](respondWithFilteredResult(_0x530e1f,_0x430280))[_0x0256('0x45')](handleError(_0x530e1f,null));};exports[_0x0256('0x46')]=function(_0x4529e6,_0x9f5b06){var _0x4fe34a={'raw':!![],'where':{'id':_0x4529e6[_0x0256('0x47')]['id']}},_0x3448c4={};_0x3448c4['model']=_[_0x0256('0x48')](db['SquareOdbc'][_0x0256('0x2f')]);_0x3448c4[_0x0256('0x32')]=_['keys'](_0x4529e6[_0x0256('0x32')]);_0x3448c4[_0x0256('0x33')]=_[_0x0256('0x34')](_0x3448c4[_0x0256('0x30')],_0x3448c4['query']);_0x4fe34a[_0x0256('0x35')]=_['intersection'](_0x3448c4['model'],qs[_0x0256('0x36')](_0x4529e6[_0x0256('0x32')][_0x0256('0x36')]));_0x4fe34a['attributes']=_0x4fe34a[_0x0256('0x35')][_0x0256('0x49')]?_0x4fe34a[_0x0256('0x35')]:_0x3448c4['model'];if(_0x4529e6[_0x0256('0x32')][_0x0256('0x42')]){_0x4fe34a[_0x0256('0x4a')]=[{'all':!![]}];}_0x4fe34a=_[_0x0256('0x3e')]({},_0x4fe34a,_0x4529e6[_0x0256('0x41')]);return db[_0x0256('0x2e')]['find'](_0x4fe34a)[_0x0256('0x27')](handleEntityNotFound(_0x9f5b06,null))[_0x0256('0x27')](respondWithResult(_0x9f5b06,null))[_0x0256('0x45')](handleError(_0x9f5b06,null));};exports[_0x0256('0x4b')]=function(_0x1be337,_0x4aa0a9){return db[_0x0256('0x2e')][_0x0256('0x4b')](_0x1be337[_0x0256('0x4c')],{})[_0x0256('0x27')](function(_0x596533){var _0x54594f=_0x1be337[_0x0256('0x4d')][_0x0256('0x4e')]({'plain':!![]});if(!_0x54594f)throw new Error(_0x0256('0x4f'));if(_0x54594f[_0x0256('0x50')]===_0x0256('0x4d')){var _0x5c5306=_0x596533[_0x0256('0x4e')]({'plain':!![]});var _0x1c5931='ODBC';return db[_0x0256('0x51')]['find']({'where':{'name':_0x1c5931,'userProfileId':_0x54594f[_0x0256('0x52')]},'raw':!![]})['then'](function(_0x49b127){if(_0x49b127&&_0x49b127[_0x0256('0x53')]===0x0){return db[_0x0256('0x2a')]['create']({'name':_0x5c5306[_0x0256('0x31')],'resourceId':_0x5c5306['id'],'type':_0x49b127[_0x0256('0x31')],'sectionId':_0x49b127['id']},{})[_0x0256('0x27')](function(){return _0x596533;});}else{return _0x596533;}})[_0x0256('0x45')](function(_0x487c7c){logger[_0x0256('0x2b')](_0x0256('0x54'),_0x487c7c);throw _0x487c7c;});}return _0x596533;})['then'](respondWithResult(_0x4aa0a9,0xc9))['catch'](handleError(_0x4aa0a9,null));};exports[_0x0256('0x26')]=function(_0x51902a,_0x4cdcad){if(_0x51902a[_0x0256('0x4c')]['id']){delete _0x51902a[_0x0256('0x4c')]['id'];}return db[_0x0256('0x2e')][_0x0256('0x55')]({'where':{'id':_0x51902a['params']['id']}})[_0x0256('0x27')](handleEntityNotFound(_0x4cdcad,null))[_0x0256('0x27')](saveUpdates(_0x51902a['body'],null))[_0x0256('0x27')](respondWithResult(_0x4cdcad,null))[_0x0256('0x45')](handleError(_0x4cdcad,null));};exports[_0x0256('0x28')]=function(_0x2fbec5,_0x1d23af){return db[_0x0256('0x2e')][_0x0256('0x55')]({'where':{'id':_0x2fbec5[_0x0256('0x47')]['id']}})[_0x0256('0x27')](handleEntityNotFound(_0x1d23af,null))[_0x0256('0x27')](removeEntity(_0x1d23af,null))[_0x0256('0x45')](handleError(_0x1d23af,null));};exports['test']=function(_0x276031,_0x4d4186,_0x586aab){var _0x5e6795;return db['SquareOdbc']['find']({'where':{'id':_0x276031['params']['id']},'attributes':['id',_0x0256('0x56')]})[_0x0256('0x27')](handleEntityNotFound(_0x4d4186,null))['then'](function(_0x5be3ad){if(_0x5be3ad){var _0x2d3dc3=require('odbc')();_0x2d3dc3[_0x0256('0x57')](_0x5be3ad[_0x0256('0x56')]);_0x2d3dc3[_0x0256('0x58')]();return _0x5be3ad;}})[_0x0256('0x27')](respondWithResult(_0x4d4186,null))[_0x0256('0x45')](handleError(_0x4d4186,null));}; \ No newline at end of file +var _0x8e6d=['../../components/parsers/advancedSearch','api','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','then','get','ODBC','UserProfileResource','error','stack','name','send','map','SquareOdbc','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','filters','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','includeAll','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','body','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs'];(function(_0x34d2d4,_0x480737){var _0x2384bc=function(_0x116c28){while(--_0x116c28){_0x34d2d4['push'](_0x34d2d4['shift']());}};_0x2384bc(++_0x480737);}(_0x8e6d,0x94));var _0xd8e6=function(_0x30c1d0,_0x473bb4){_0x30c1d0=_0x30c1d0-0x0;var _0x1cfcbe=_0x8e6d[_0x30c1d0];return _0x1cfcbe;};'use strict';var emlformat=require(_0xd8e6('0x0'));var rimraf=require(_0xd8e6('0x1'));var zipdir=require(_0xd8e6('0x2'));var jsonpatch=require(_0xd8e6('0x3'));var rp=require(_0xd8e6('0x4'));var moment=require(_0xd8e6('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd8e6('0x6'));var path=require(_0xd8e6('0x7'));var sox=require('sox');var csv=require(_0xd8e6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd8e6('0x9'));var _=require('lodash');var squel=require(_0xd8e6('0xa'));var crypto=require(_0xd8e6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd8e6('0xc'));var toCsv=require(_0xd8e6('0x8'));var querystring=require(_0xd8e6('0xd'));var Papa=require('papaparse');var Redis=require(_0xd8e6('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd8e6('0xf'));var as=require(_0xd8e6('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd8e6('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd8e6('0x12'))['db'];function respondWithStatusCode(_0x1fe818,_0x2560f2){_0x2560f2=_0x2560f2||0xcc;return function(_0x7c6748){if(_0x7c6748){return _0x1fe818[_0xd8e6('0x13')](_0x2560f2);}return _0x1fe818[_0xd8e6('0x14')](_0x2560f2)[_0xd8e6('0x15')]();};}function respondWithResult(_0x51e3d8,_0x5e216e){_0x5e216e=_0x5e216e||0xc8;return function(_0x5cf3fe){if(_0x5cf3fe){return _0x51e3d8[_0xd8e6('0x14')](_0x5e216e)['json'](_0x5cf3fe);}};}function respondWithFilteredResult(_0x56a9a9,_0xa0de35){return function(_0x37f5c7){if(_0x37f5c7){var _0x1ff893=typeof _0xa0de35[_0xd8e6('0x16')]==='undefined'&&typeof _0xa0de35[_0xd8e6('0x17')]===_0xd8e6('0x18');var _0x3c5574=_0x37f5c7['count'];var _0x3c9c31=_0x1ff893?0x0:_0xa0de35['offset'];var _0x59ede0=_0x1ff893?_0x37f5c7[_0xd8e6('0x19')]:_0xa0de35['offset']+_0xa0de35[_0xd8e6('0x17')];var _0x856c7d;if(_0x59ede0>=_0x3c5574){_0x59ede0=_0x3c5574;_0x856c7d=0xc8;}else{_0x856c7d=0xce;}_0x56a9a9['status'](_0x856c7d);return _0x56a9a9[_0xd8e6('0x1a')](_0xd8e6('0x1b'),_0x3c9c31+'-'+_0x59ede0+'/'+_0x3c5574)[_0xd8e6('0x1c')](_0x37f5c7);}return null;};}function patchUpdates(_0x5c6614){return function(_0x59e1a1){try{jsonpatch[_0xd8e6('0x1d')](_0x59e1a1,_0x5c6614,!![]);}catch(_0x246651){return BPromise[_0xd8e6('0x1e')](_0x246651);}return _0x59e1a1[_0xd8e6('0x1f')]();};}function saveUpdates(_0x220459,_0x32bc9a){return function(_0x43df3d){if(_0x43df3d){return _0x43df3d[_0xd8e6('0x20')](_0x220459)['then'](function(_0x2eeec3){return _0x2eeec3;});}return null;};}function removeEntity(_0x2651fb,_0x4dd328){return function(_0xc25588){if(_0xc25588){return _0xc25588[_0xd8e6('0x21')]()[_0xd8e6('0x22')](function(){var _0x18cdd7=_0xc25588[_0xd8e6('0x23')]({'plain':!![]});var _0x29287b=_0xd8e6('0x24');return db[_0xd8e6('0x25')][_0xd8e6('0x21')]({'where':{'type':_0x29287b,'resourceId':_0x18cdd7['id']}})['then'](function(){return _0xc25588;});})[_0xd8e6('0x22')](function(){_0x2651fb[_0xd8e6('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34369b,_0xff3062){return function(_0x1184f7){if(!_0x1184f7){_0x34369b[_0xd8e6('0x13')](0x194);}return _0x1184f7;};}function handleError(_0x410e58,_0x2f6c91){_0x2f6c91=_0x2f6c91||0x1f4;return function(_0x3176be){logger[_0xd8e6('0x26')](_0x3176be[_0xd8e6('0x27')]);if(_0x3176be[_0xd8e6('0x28')]){delete _0x3176be[_0xd8e6('0x28')];}_0x410e58[_0xd8e6('0x14')](_0x2f6c91)[_0xd8e6('0x29')](_0x3176be);};}exports['index']=function(_0x7989cd,_0x44055c){var _0x2577dd={},_0x58f717={},_0x192f8a={'count':0x0,'rows':[]};var _0x32c065=_[_0xd8e6('0x2a')](db[_0xd8e6('0x2b')][_0xd8e6('0x2c')],function(_0x218528){return{'name':_0x218528[_0xd8e6('0x2d')],'type':_0x218528[_0xd8e6('0x2e')][_0xd8e6('0x2f')]};});_0x58f717['model']=_[_0xd8e6('0x2a')](_0x32c065,_0xd8e6('0x28'));_0x58f717[_0xd8e6('0x30')]=_[_0xd8e6('0x31')](_0x7989cd[_0xd8e6('0x30')]);_0x58f717['filters']=_[_0xd8e6('0x32')](_0x58f717[_0xd8e6('0x33')],_0x58f717[_0xd8e6('0x30')]);_0x2577dd[_0xd8e6('0x34')]=_[_0xd8e6('0x32')](_0x58f717[_0xd8e6('0x33')],qs[_0xd8e6('0x35')](_0x7989cd['query'][_0xd8e6('0x35')]));_0x2577dd[_0xd8e6('0x34')]=_0x2577dd[_0xd8e6('0x34')][_0xd8e6('0x36')]?_0x2577dd['attributes']:_0x58f717[_0xd8e6('0x33')];if(!_0x7989cd[_0xd8e6('0x30')][_0xd8e6('0x37')]('nolimit')){_0x2577dd[_0xd8e6('0x17')]=qs[_0xd8e6('0x17')](_0x7989cd[_0xd8e6('0x30')][_0xd8e6('0x17')]);_0x2577dd[_0xd8e6('0x16')]=qs[_0xd8e6('0x16')](_0x7989cd[_0xd8e6('0x30')][_0xd8e6('0x16')]);}_0x2577dd['order']=qs[_0xd8e6('0x38')](_0x7989cd[_0xd8e6('0x30')]['sort']);_0x2577dd[_0xd8e6('0x39')]=qs[_0xd8e6('0x3a')](_['pick'](_0x7989cd[_0xd8e6('0x30')],_0x58f717[_0xd8e6('0x3a')]),_0x32c065);if(_0x7989cd[_0xd8e6('0x30')]['filter']){_0x2577dd[_0xd8e6('0x39')]=_[_0xd8e6('0x3b')](_0x2577dd[_0xd8e6('0x39')],{'$or':_[_0xd8e6('0x2a')](_0x32c065,function(_0x5e397e){if(_0x5e397e[_0xd8e6('0x2e')]!==_0xd8e6('0x3c')){var _0x4e5998={};_0x4e5998[_0x5e397e[_0xd8e6('0x28')]]={'$like':'%'+_0x7989cd['query'][_0xd8e6('0x3d')]+'%'};return _0x4e5998;}})});}_0x2577dd=_[_0xd8e6('0x3b')]({},_0x2577dd,_0x7989cd[_0xd8e6('0x3e')]);var _0x3f9928={'where':_0x2577dd['where']};return db['SquareOdbc'][_0xd8e6('0x19')](_0x3f9928)[_0xd8e6('0x22')](function(_0xcab691){_0x192f8a[_0xd8e6('0x19')]=_0xcab691;if(_0x7989cd[_0xd8e6('0x30')]['includeAll']){_0x2577dd[_0xd8e6('0x3f')]=[{'all':!![]}];}return db[_0xd8e6('0x2b')][_0xd8e6('0x40')](_0x2577dd);})[_0xd8e6('0x22')](function(_0xdf00ec){_0x192f8a[_0xd8e6('0x41')]=_0xdf00ec;return _0x192f8a;})[_0xd8e6('0x22')](respondWithFilteredResult(_0x44055c,_0x2577dd))[_0xd8e6('0x42')](handleError(_0x44055c,null));};exports[_0xd8e6('0x43')]=function(_0x49219a,_0xc1a3c4){var _0x278db6={'raw':!![],'where':{'id':_0x49219a[_0xd8e6('0x44')]['id']}},_0x22268a={};_0x22268a[_0xd8e6('0x33')]=_[_0xd8e6('0x31')](db[_0xd8e6('0x2b')]['rawAttributes']);_0x22268a[_0xd8e6('0x30')]=_[_0xd8e6('0x31')](_0x49219a[_0xd8e6('0x30')]);_0x22268a[_0xd8e6('0x3a')]=_['intersection'](_0x22268a[_0xd8e6('0x33')],_0x22268a[_0xd8e6('0x30')]);_0x278db6[_0xd8e6('0x34')]=_[_0xd8e6('0x32')](_0x22268a[_0xd8e6('0x33')],qs['fields'](_0x49219a[_0xd8e6('0x30')][_0xd8e6('0x35')]));_0x278db6[_0xd8e6('0x34')]=_0x278db6[_0xd8e6('0x34')][_0xd8e6('0x36')]?_0x278db6['attributes']:_0x22268a[_0xd8e6('0x33')];if(_0x49219a[_0xd8e6('0x30')][_0xd8e6('0x45')]){_0x278db6[_0xd8e6('0x3f')]=[{'all':!![]}];}_0x278db6=_[_0xd8e6('0x3b')]({},_0x278db6,_0x49219a['options']);return db[_0xd8e6('0x2b')][_0xd8e6('0x46')](_0x278db6)['then'](handleEntityNotFound(_0xc1a3c4,null))['then'](respondWithResult(_0xc1a3c4,null))[_0xd8e6('0x42')](handleError(_0xc1a3c4,null));};exports['create']=function(_0x1c51bb,_0x3dd16e){return db[_0xd8e6('0x2b')][_0xd8e6('0x47')](_0x1c51bb['body'],{})['then'](function(_0x1a5f8b){var _0x1f916d=_0x1c51bb[_0xd8e6('0x48')][_0xd8e6('0x23')]({'plain':!![]});if(!_0x1f916d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1f916d[_0xd8e6('0x49')]===_0xd8e6('0x48')){var _0x13cc50=_0x1a5f8b[_0xd8e6('0x23')]({'plain':!![]});var _0x2f8a75='ODBC';return db[_0xd8e6('0x4a')][_0xd8e6('0x46')]({'where':{'name':_0x2f8a75,'userProfileId':_0x1f916d[_0xd8e6('0x4b')]},'raw':!![]})['then'](function(_0xa58844){if(_0xa58844&&_0xa58844[_0xd8e6('0x4c')]===0x0){return db['UserProfileResource'][_0xd8e6('0x47')]({'name':_0x13cc50['name'],'resourceId':_0x13cc50['id'],'type':_0xa58844[_0xd8e6('0x28')],'sectionId':_0xa58844['id']},{})[_0xd8e6('0x22')](function(){return _0x1a5f8b;});}else{return _0x1a5f8b;}})[_0xd8e6('0x42')](function(_0xf885c6){logger[_0xd8e6('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xf885c6);throw _0xf885c6;});}return _0x1a5f8b;})['then'](respondWithResult(_0x3dd16e,0xc9))[_0xd8e6('0x42')](handleError(_0x3dd16e,null));};exports['update']=function(_0x118115,_0x5273e6){if(_0x118115[_0xd8e6('0x4d')]['id']){delete _0x118115[_0xd8e6('0x4d')]['id'];}return db['SquareOdbc'][_0xd8e6('0x46')]({'where':{'id':_0x118115['params']['id']}})[_0xd8e6('0x22')](handleEntityNotFound(_0x5273e6,null))[_0xd8e6('0x22')](saveUpdates(_0x118115['body'],null))[_0xd8e6('0x22')](respondWithResult(_0x5273e6,null))[_0xd8e6('0x42')](handleError(_0x5273e6,null));};exports[_0xd8e6('0x21')]=function(_0x39fbe9,_0x2efdc1){return db['SquareOdbc'][_0xd8e6('0x46')]({'where':{'id':_0x39fbe9[_0xd8e6('0x44')]['id']}})['then'](handleEntityNotFound(_0x2efdc1,null))['then'](removeEntity(_0x2efdc1,null))['catch'](handleError(_0x2efdc1,null));};exports['test']=function(_0x12958c,_0x26420a,_0xc12e1d){var _0x1e39b3;return db[_0xd8e6('0x2b')][_0xd8e6('0x46')]({'where':{'id':_0x12958c[_0xd8e6('0x44')]['id']},'attributes':['id',_0xd8e6('0x4e')]})[_0xd8e6('0x22')](handleEntityNotFound(_0x26420a,null))[_0xd8e6('0x22')](function(_0xa25022){if(_0xa25022){var _0xca0b2b=require(_0xd8e6('0x4f'))();_0xca0b2b[_0xd8e6('0x50')](_0xa25022[_0xd8e6('0x4e')]);_0xca0b2b[_0xd8e6('0x51')]();return _0xa25022;}})[_0xd8e6('0x22')](respondWithResult(_0x26420a,null))[_0xd8e6('0x42')](handleError(_0x26420a,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 40c0348..02b273b 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 _0x2e4f=['rimraf','../../config/environment','./squareOdbc.attributes','define','square_odbc','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x56d591,_0x3191a3){var _0x4bf0ff=function(_0x2312cd){while(--_0x2312cd){_0x56d591['push'](_0x56d591['shift']());}};_0x4bf0ff(++_0x3191a3);}(_0x2e4f,0xb9));var _0xf2e4=function(_0x25df80,_0xa2aec5){_0x25df80=_0x25df80-0x0;var _0x17b6d0=_0x2e4f[_0x25df80];return _0x17b6d0;};'use strict';var _=require(_0xf2e4('0x0'));var util=require(_0xf2e4('0x1'));var logger=require(_0xf2e4('0x2'))('api');var moment=require(_0xf2e4('0x3'));var BPromise=require(_0xf2e4('0x4'));var rp=require(_0xf2e4('0x5'));var fs=require('fs');var path=require(_0xf2e4('0x6'));var rimraf=require(_0xf2e4('0x7'));var config=require(_0xf2e4('0x8'));var attributes=require(_0xf2e4('0x9'));module['exports']=function(_0x221351,_0x1b7303){return _0x221351[_0xf2e4('0xa')]('SquareOdbc',attributes,{'tableName':_0xf2e4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb056=['api','moment','request-promise','../../config/environment','./squareOdbc.attributes','exports','lodash','util','../../config/logger'];(function(_0xedfbda,_0x427b63){var _0xbdb66=function(_0x37f46b){while(--_0x37f46b){_0xedfbda['push'](_0xedfbda['shift']());}};_0xbdb66(++_0x427b63);}(_0xb056,0x1da));var _0x6b05=function(_0x57744a,_0x1759eb){_0x57744a=_0x57744a-0x0;var _0x38d3fa=_0xb056[_0x57744a];return _0x38d3fa;};'use strict';var _=require(_0x6b05('0x0'));var util=require(_0x6b05('0x1'));var logger=require(_0x6b05('0x2'))(_0x6b05('0x3'));var moment=require(_0x6b05('0x4'));var BPromise=require('bluebird');var rp=require(_0x6b05('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6b05('0x6'));var attributes=require(_0x6b05('0x7'));module[_0x6b05('0x8')]=function(_0x5576f2,_0x2fb671){return _0x5576f2['define']('SquareOdbc',attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index 92e311b..75edfdb 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 _0xe6f5=['client','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSquareOdbc','find','options','raw','map','include','model','attributes','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x348ca1,_0x429707){var _0x466322=function(_0x131ed7){while(--_0x131ed7){_0x348ca1['push'](_0x348ca1['shift']());}};_0x466322(++_0x429707);}(_0xe6f5,0x8d));var _0x5e6f=function(_0x8ceead,_0x735f6a){_0x8ceead=_0x8ceead-0x0;var _0x29589d=_0xe6f5[_0x8ceead];return _0x29589d;};'use strict';var _=require(_0x5e6f('0x0'));var util=require('util');var moment=require(_0x5e6f('0x1'));var BPromise=require(_0x5e6f('0x2'));var rs=require(_0x5e6f('0x3'));var fs=require('fs');var Redis=require(_0x5e6f('0x4'));var db=require(_0x5e6f('0x5'))['db'];var utils=require(_0x5e6f('0x6'));var logger=require(_0x5e6f('0x7'))('rpc');var config=require(_0x5e6f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5e6f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x189e9e,_0x161c5a,_0xc00ec1){return new BPromise(function(_0x2c6c6e,_0x44adf3){return client[_0x5e6f('0xa')](_0x189e9e,_0xc00ec1)[_0x5e6f('0xb')](function(_0x20fe57){logger[_0x5e6f('0xc')](_0x5e6f('0xd'),_0x161c5a,_0x5e6f('0xe'));logger[_0x5e6f('0xf')](_0x5e6f('0x10'),_0x161c5a,_0x5e6f('0xe'),JSON[_0x5e6f('0x11')](_0x20fe57));if(_0x20fe57[_0x5e6f('0x12')]){if(_0x20fe57[_0x5e6f('0x12')][_0x5e6f('0x13')]===0x1f4){logger[_0x5e6f('0x12')](_0x5e6f('0xd'),_0x161c5a,_0x20fe57[_0x5e6f('0x12')][_0x5e6f('0x14')]);return _0x44adf3(_0x20fe57[_0x5e6f('0x12')][_0x5e6f('0x14')]);}logger[_0x5e6f('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x161c5a,_0x20fe57[_0x5e6f('0x12')][_0x5e6f('0x14')]);return _0x2c6c6e(_0x20fe57[_0x5e6f('0x12')][_0x5e6f('0x14')]);}else{logger[_0x5e6f('0xc')]('SquareOdbc,\x20%s,\x20%s',_0x161c5a,_0x5e6f('0xe'));_0x2c6c6e(_0x20fe57['result'][_0x5e6f('0x14')]);}})[_0x5e6f('0x15')](function(_0x52b8e4){logger[_0x5e6f('0x12')](_0x5e6f('0xd'),_0x161c5a,_0x52b8e4);_0x44adf3(_0x52b8e4);});});}exports[_0x5e6f('0x16')]=function(_0x2fd132){var _0x22b691=this;return new Promise(function(_0x1962b3,_0x4ff8d6){return db['SquareOdbc'][_0x5e6f('0x17')]({'raw':_0x2fd132[_0x5e6f('0x18')]?_0x2fd132[_0x5e6f('0x18')][_0x5e6f('0x19')]===undefined?!![]:![]:!![],'where':_0x2fd132[_0x5e6f('0x18')]?_0x2fd132[_0x5e6f('0x18')]['where']||null:null,'attributes':_0x2fd132[_0x5e6f('0x18')]?_0x2fd132['options']['attributes']||null:null,'include':_0x2fd132[_0x5e6f('0x18')]?_0x2fd132[_0x5e6f('0x18')]['include']?_[_0x5e6f('0x1a')](_0x2fd132[_0x5e6f('0x18')][_0x5e6f('0x1b')],function(_0x557d8a){return{'model':db[_0x557d8a[_0x5e6f('0x1c')]],'as':_0x557d8a['as'],'attributes':_0x557d8a[_0x5e6f('0x1d')],'include':_0x557d8a[_0x5e6f('0x1b')]?_[_0x5e6f('0x1a')](_0x557d8a['include'],function(_0x1f3f46){return{'model':db[_0x1f3f46[_0x5e6f('0x1c')]],'as':_0x1f3f46['as'],'attributes':_0x1f3f46[_0x5e6f('0x1d')],'include':_0x1f3f46['include']?_[_0x5e6f('0x1a')](_0x1f3f46['include'],function(_0x46c118){return{'model':db[_0x46c118[_0x5e6f('0x1c')]],'as':_0x46c118['as'],'attributes':_0x46c118[_0x5e6f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5e6f('0xb')](function(_0x552ff7){logger['info'](_0x5e6f('0x16'),_0x2fd132);logger[_0x5e6f('0xf')](_0x5e6f('0x16'),_0x2fd132,JSON[_0x5e6f('0x11')](_0x552ff7));_0x1962b3(_0x552ff7);})['catch'](function(_0x2d01d9){logger[_0x5e6f('0x12')](_0x5e6f('0x16'),_0x2d01d9['message'],_0x2fd132);_0x4ff8d6(_0x22b691[_0x5e6f('0x12')](0x1f4,_0x2d01d9[_0x5e6f('0x14')]));});});}; \ No newline at end of file +var _0x9bca=['util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','map','include','model','stringify'];(function(_0x2797c6,_0x37421b){var _0x54809f=function(_0x2d100c){while(--_0x2d100c){_0x2797c6['push'](_0x2797c6['shift']());}};_0x54809f(++_0x37421b);}(_0x9bca,0x1d1));var _0xa9bc=function(_0xd0f029,_0x181ef9){_0xd0f029=_0xd0f029-0x0;var _0x51b539=_0x9bca[_0xd0f029];return _0x51b539;};'use strict';var _=require('lodash');var util=require(_0xa9bc('0x0'));var moment=require('moment');var BPromise=require(_0xa9bc('0x1'));var rs=require(_0xa9bc('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa9bc('0x3'))['db'];var utils=require(_0xa9bc('0x4'));var logger=require('../../config/logger')(_0xa9bc('0x5'));var config=require(_0xa9bc('0x6'));var jayson=require(_0xa9bc('0x7'));var client=jayson[_0xa9bc('0x8')][_0xa9bc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a1ac3,_0x1c804e,_0x1c29ce){return new BPromise(function(_0x388b07,_0x4a679f){return client[_0xa9bc('0xa')](_0x4a1ac3,_0x1c29ce)[_0xa9bc('0xb')](function(_0x51a8e4){logger['info'](_0xa9bc('0xc'),_0x1c804e,_0xa9bc('0xd'));logger[_0xa9bc('0xe')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x1c804e,_0xa9bc('0xd'),JSON['stringify'](_0x51a8e4));if(_0x51a8e4['error']){if(_0x51a8e4[_0xa9bc('0xf')]['code']===0x1f4){logger[_0xa9bc('0xf')]('SquareOdbc,\x20%s,\x20%s',_0x1c804e,_0x51a8e4['error']['message']);return _0x4a679f(_0x51a8e4[_0xa9bc('0xf')]['message']);}logger[_0xa9bc('0xf')](_0xa9bc('0xc'),_0x1c804e,_0x51a8e4[_0xa9bc('0xf')]['message']);return _0x388b07(_0x51a8e4[_0xa9bc('0xf')][_0xa9bc('0x10')]);}else{logger[_0xa9bc('0x11')](_0xa9bc('0xc'),_0x1c804e,_0xa9bc('0xd'));_0x388b07(_0x51a8e4[_0xa9bc('0x12')][_0xa9bc('0x10')]);}})[_0xa9bc('0x13')](function(_0x564e83){logger[_0xa9bc('0xf')](_0xa9bc('0xc'),_0x1c804e,_0x564e83);_0x4a679f(_0x564e83);});});}exports[_0xa9bc('0x14')]=function(_0x42a04d){var _0x40c0c7=this;return new Promise(function(_0xc9db69,_0x9f9e63){return db[_0xa9bc('0x15')][_0xa9bc('0x16')]({'raw':_0x42a04d[_0xa9bc('0x17')]?_0x42a04d[_0xa9bc('0x17')][_0xa9bc('0x18')]===undefined?!![]:![]:!![],'where':_0x42a04d['options']?_0x42a04d[_0xa9bc('0x17')][_0xa9bc('0x19')]||null:null,'attributes':_0x42a04d[_0xa9bc('0x17')]?_0x42a04d[_0xa9bc('0x17')][_0xa9bc('0x1a')]||null:null,'include':_0x42a04d[_0xa9bc('0x17')]?_0x42a04d[_0xa9bc('0x17')]['include']?_[_0xa9bc('0x1b')](_0x42a04d[_0xa9bc('0x17')][_0xa9bc('0x1c')],function(_0xc31076){return{'model':db[_0xc31076[_0xa9bc('0x1d')]],'as':_0xc31076['as'],'attributes':_0xc31076[_0xa9bc('0x1a')],'include':_0xc31076[_0xa9bc('0x1c')]?_[_0xa9bc('0x1b')](_0xc31076[_0xa9bc('0x1c')],function(_0x144ac8){return{'model':db[_0x144ac8['model']],'as':_0x144ac8['as'],'attributes':_0x144ac8[_0xa9bc('0x1a')],'include':_0x144ac8[_0xa9bc('0x1c')]?_[_0xa9bc('0x1b')](_0x144ac8['include'],function(_0x334a5b){return{'model':db[_0x334a5b['model']],'as':_0x334a5b['as'],'attributes':_0x334a5b['attributes']};}):[]};}):[]};}):[]:[]})[_0xa9bc('0xb')](function(_0x31b884){logger[_0xa9bc('0x11')](_0xa9bc('0x14'),_0x42a04d);logger[_0xa9bc('0xe')](_0xa9bc('0x14'),_0x42a04d,JSON[_0xa9bc('0x1e')](_0x31b884));_0xc9db69(_0x31b884);})[_0xa9bc('0x13')](function(_0xc79c6e){logger[_0xa9bc('0xf')](_0xa9bc('0x14'),_0xc79c6e[_0xa9bc('0x10')],_0x42a04d);_0x9f9e63(_0x40c0c7[_0xa9bc('0xf')](0x1f4,_0xc79c6e['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 543cba2..87aee60 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 _0xff4c=['/:id/users','addUsers','put','update','delete','destroy','removeUsers','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','/:id','show','getUsers','post','create'];(function(_0x5562fe,_0x4e809c){var _0x1829c7=function(_0x18919f){while(--_0x18919f){_0x5562fe['push'](_0x5562fe['shift']());}};_0x1829c7(++_0x4e809c);}(_0xff4c,0x167));var _0xcff4=function(_0x452968,_0x31e391){_0x452968=_0x452968-0x0;var _0xb6f9ae=_0xff4c[_0x452968];return _0xb6f9ae;};'use strict';var multer=require(_0xcff4('0x0'));var util=require(_0xcff4('0x1'));var path=require('path');var timeout=require(_0xcff4('0x2'));var express=require('express');var router=express[_0xcff4('0x3')]();var fs_extra=require(_0xcff4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcff4('0x5'));var config=require(_0xcff4('0x6'));var controller=require(_0xcff4('0x7'));router[_0xcff4('0x8')]('/',auth[_0xcff4('0x9')](),controller['index']);router[_0xcff4('0x8')](_0xcff4('0xa'),auth[_0xcff4('0x9')](),controller[_0xcff4('0xb')]);router[_0xcff4('0x8')]('/:id/users',auth[_0xcff4('0x9')](),controller[_0xcff4('0xc')]);router[_0xcff4('0xd')]('/',auth[_0xcff4('0x9')](),controller[_0xcff4('0xe')]);router[_0xcff4('0xd')](_0xcff4('0xf'),auth['isAuthenticated'](),controller[_0xcff4('0x10')]);router[_0xcff4('0x11')](_0xcff4('0xa'),auth['isAuthenticated'](),controller[_0xcff4('0x12')]);router[_0xcff4('0x13')](_0xcff4('0xa'),auth[_0xcff4('0x9')](),controller[_0xcff4('0x14')]);router['delete']('/:id/users',auth[_0xcff4('0x9')](),controller[_0xcff4('0x15')]);module['exports']=router; \ No newline at end of file +var _0x7ebf=['update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','index','/:id','isAuthenticated','show','/:id/users','post','put'];(function(_0x11487e,_0x2695cd){var _0x3bb686=function(_0x3029de){while(--_0x3029de){_0x11487e['push'](_0x11487e['shift']());}};_0x3bb686(++_0x2695cd);}(_0x7ebf,0x153));var _0xf7eb=function(_0x2cdfe9,_0x5d833a){_0x2cdfe9=_0x2cdfe9-0x0;var _0x5c2490=_0x7ebf[_0x2cdfe9];return _0x5c2490;};'use strict';var multer=require(_0xf7eb('0x0'));var util=require(_0xf7eb('0x1'));var path=require('path');var timeout=require(_0xf7eb('0x2'));var express=require(_0xf7eb('0x3'));var router=express[_0xf7eb('0x4')]();var fs_extra=require(_0xf7eb('0x5'));var auth=require(_0xf7eb('0x6'));var interaction=require(_0xf7eb('0x7'));var config=require(_0xf7eb('0x8'));var controller=require(_0xf7eb('0x9'));router[_0xf7eb('0xa')]('/',auth['isAuthenticated'](),controller[_0xf7eb('0xb')]);router[_0xf7eb('0xa')](_0xf7eb('0xc'),auth[_0xf7eb('0xd')](),controller[_0xf7eb('0xe')]);router[_0xf7eb('0xa')](_0xf7eb('0xf'),auth[_0xf7eb('0xd')](),controller['getUsers']);router[_0xf7eb('0x10')]('/',auth[_0xf7eb('0xd')](),controller['create']);router['post'](_0xf7eb('0xf'),auth['isAuthenticated'](),controller['addUsers']);router[_0xf7eb('0x11')](_0xf7eb('0xc'),auth['isAuthenticated'](),controller[_0xf7eb('0x12')]);router[_0xf7eb('0x13')]('/:id',auth[_0xf7eb('0xd')](),controller['destroy']);router['delete'](_0xf7eb('0xf'),auth[_0xf7eb('0xd')](),controller['removeUsers']);module[_0xf7eb('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index cec9d47..41590cc 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 _0x1e20=['STRING','TEXT','BLOB','long','preproduction','toString','getDataValue','production','utf8','DATE','exports'];(function(_0x546d59,_0x19a1e3){var _0x483098=function(_0x2c6e27){while(--_0x2c6e27){_0x546d59['push'](_0x546d59['shift']());}};_0x483098(++_0x19a1e3);}(_0x1e20,0x1ac));var _0x01e2=function(_0x5700d2,_0x59b5fa){_0x5700d2=_0x5700d2-0x0;var _0x25c1e0=_0x1e20[_0x5700d2];return _0x25c1e0;};'use strict';var Sequelize=require('sequelize');module[_0x01e2('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x01e2('0x1')]},'notes':{'type':Sequelize[_0x01e2('0x2')]},'preproduction':{'type':Sequelize[_0x01e2('0x3')](_0x01e2('0x4')),'get':function(){if(this['getDataValue'](_0x01e2('0x5'))){return this['getDataValue'](_0x01e2('0x5'))[_0x01e2('0x6')]('utf8');}}},'production':{'type':Sequelize[_0x01e2('0x3')]('long'),'get':function(){if(this[_0x01e2('0x7')](_0x01e2('0x8'))){return this[_0x01e2('0x7')](_0x01e2('0x8'))[_0x01e2('0x6')](_0x01e2('0x9'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x01e2('0xa')]}}; \ No newline at end of file +var _0xc52c=['preproduction','toString','production','DATE','sequelize','exports','STRING','BLOB','getDataValue'];(function(_0x283487,_0x16b3e5){var _0x5cd831=function(_0x1dee6c){while(--_0x1dee6c){_0x283487['push'](_0x283487['shift']());}};_0x5cd831(++_0x16b3e5);}(_0xc52c,0x124));var _0xcc52=function(_0x3f4f3b,_0x2d7be2){_0x3f4f3b=_0x3f4f3b-0x0;var _0xfc6f02=_0xc52c[_0x3f4f3b];return _0xfc6f02;};'use strict';var Sequelize=require(_0xcc52('0x0'));module[_0xcc52('0x1')]={'name':{'type':Sequelize[_0xcc52('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xcc52('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0xcc52('0x3')]('long'),'get':function(){if(this[_0xcc52('0x4')](_0xcc52('0x5'))){return this[_0xcc52('0x4')]('preproduction')[_0xcc52('0x6')]('utf8');}}},'production':{'type':Sequelize[_0xcc52('0x3')]('long'),'get':function(){if(this[_0xcc52('0x4')](_0xcc52('0x7'))){return this['getDataValue'](_0xcc52('0x7'))['toString']('utf8');}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0xcc52('0x8')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index c74cb0a..ce0f0c2 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 _0xccef=['order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','params','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','register','status','end','offset','undefined','limit','count','set','json','apply','reject','save','destroy','then','get','SquareProjects','UserProfileResource','sendStatus','error','name','send','index','SquareProject','rawAttributes','fieldName','type','key','map','keys','filters','intersection','query','attributes','fields','length','model','nolimit'];(function(_0x23b655,_0x4feb2b){var _0x364b32=function(_0x4e41ac){while(--_0x4e41ac){_0x23b655['push'](_0x23b655['shift']());}};_0x364b32(++_0x4feb2b);}(_0xccef,0x14a));var _0xfcce=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xccef[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0xfcce('0x0'));var rimraf=require(_0xfcce('0x1'));var zipdir=require(_0xfcce('0x2'));var jsonpatch=require(_0xfcce('0x3'));var rp=require(_0xfcce('0x4'));var moment=require(_0xfcce('0x5'));var BPromise=require(_0xfcce('0x6'));var Mustache=require(_0xfcce('0x7'));var util=require('util');var path=require('path');var sox=require(_0xfcce('0x8'));var csv=require('to-csv');var ejs=require(_0xfcce('0x9'));var fs=require('fs');var fs_extra=require(_0xfcce('0xa'));var _=require(_0xfcce('0xb'));var squel=require(_0xfcce('0xc'));var crypto=require(_0xfcce('0xd'));var jsforce=require(_0xfcce('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xfcce('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfcce('0x10'));var authService=require(_0xfcce('0x11'));var qs=require(_0xfcce('0x12'));var as=require(_0xfcce('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfcce('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xfcce('0x15'));var licenseUtil=require(_0xfcce('0x16'));var db=require(_0xfcce('0x17'))['db'];config['redis']=_[_0xfcce('0x18')](config[_0xfcce('0x19')],{'host':_0xfcce('0x1a'),'port':0x18eb});var socket=require(_0xfcce('0x1b'))(new Redis(config[_0xfcce('0x19')]));require(_0xfcce('0x1c'))[_0xfcce('0x1d')](socket);function respondWithStatusCode(_0x476de6,_0x30d9c7){_0x30d9c7=_0x30d9c7||0xcc;return function(_0x4ae149){if(_0x4ae149){return _0x476de6['sendStatus'](_0x30d9c7);}return _0x476de6[_0xfcce('0x1e')](_0x30d9c7)[_0xfcce('0x1f')]();};}function respondWithResult(_0x5413e1,_0x391d0e){_0x391d0e=_0x391d0e||0xc8;return function(_0x1495ea){if(_0x1495ea){return _0x5413e1[_0xfcce('0x1e')](_0x391d0e)['json'](_0x1495ea);}};}function respondWithFilteredResult(_0x2f98e1,_0x5aba6b){return function(_0x2de2b5){if(_0x2de2b5){var _0x283a48=typeof _0x5aba6b[_0xfcce('0x20')]===_0xfcce('0x21')&&typeof _0x5aba6b[_0xfcce('0x22')]===_0xfcce('0x21');var _0x4e0de9=_0x2de2b5['count'];var _0x1fdfc0=_0x283a48?0x0:_0x5aba6b['offset'];var _0xecf4af=_0x283a48?_0x2de2b5[_0xfcce('0x23')]:_0x5aba6b[_0xfcce('0x20')]+_0x5aba6b[_0xfcce('0x22')];var _0x2c0577;if(_0xecf4af>=_0x4e0de9){_0xecf4af=_0x4e0de9;_0x2c0577=0xc8;}else{_0x2c0577=0xce;}_0x2f98e1[_0xfcce('0x1e')](_0x2c0577);return _0x2f98e1[_0xfcce('0x24')]('Content-Range',_0x1fdfc0+'-'+_0xecf4af+'/'+_0x4e0de9)[_0xfcce('0x25')](_0x2de2b5);}return null;};}function patchUpdates(_0x116199){return function(_0x36d256){try{jsonpatch[_0xfcce('0x26')](_0x36d256,_0x116199,!![]);}catch(_0x13454a){return BPromise[_0xfcce('0x27')](_0x13454a);}return _0x36d256[_0xfcce('0x28')]();};}function saveUpdates(_0x8b0ee5,_0x2f204a){return function(_0x8a8df4){if(_0x8a8df4){return _0x8a8df4['update'](_0x8b0ee5)['then'](function(_0x7e0d45){return _0x7e0d45;});}return null;};}function removeEntity(_0x10bdc4,_0x3ae52a){return function(_0x132a77){if(_0x132a77){return _0x132a77[_0xfcce('0x29')]()[_0xfcce('0x2a')](function(){var _0x5d3ccf=_0x132a77[_0xfcce('0x2b')]({'plain':!![]});var _0x4edbc7=_0xfcce('0x2c');return db[_0xfcce('0x2d')]['destroy']({'where':{'type':_0x4edbc7,'resourceId':_0x5d3ccf['id']}})['then'](function(){return _0x132a77;});})[_0xfcce('0x2a')](function(){_0x10bdc4[_0xfcce('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56a451,_0x5a0549){return function(_0x85da97){if(!_0x85da97){_0x56a451[_0xfcce('0x2e')](0x194);}return _0x85da97;};}function handleError(_0x3a1880,_0x311be2){_0x311be2=_0x311be2||0x1f4;return function(_0x55daf5){logger[_0xfcce('0x2f')](_0x55daf5['stack']);if(_0x55daf5[_0xfcce('0x30')]){delete _0x55daf5['name'];}_0x3a1880[_0xfcce('0x1e')](_0x311be2)[_0xfcce('0x31')](_0x55daf5);};}exports[_0xfcce('0x32')]=function(_0x10b7ac,_0x3c1b7f){var _0x1d791d={},_0x4f4464={},_0x200510={'count':0x0,'rows':[]};var _0x10df54=_['map'](db[_0xfcce('0x33')][_0xfcce('0x34')],function(_0x217374){return{'name':_0x217374[_0xfcce('0x35')],'type':_0x217374[_0xfcce('0x36')][_0xfcce('0x37')]};});_0x4f4464['model']=_[_0xfcce('0x38')](_0x10df54,_0xfcce('0x30'));_0x4f4464['query']=_[_0xfcce('0x39')](_0x10b7ac['query']);_0x4f4464[_0xfcce('0x3a')]=_[_0xfcce('0x3b')](_0x4f4464['model'],_0x4f4464[_0xfcce('0x3c')]);_0x1d791d[_0xfcce('0x3d')]=_[_0xfcce('0x3b')](_0x4f4464['model'],qs[_0xfcce('0x3e')](_0x10b7ac[_0xfcce('0x3c')]['fields']));_0x1d791d[_0xfcce('0x3d')]=_0x1d791d['attributes'][_0xfcce('0x3f')]?_0x1d791d[_0xfcce('0x3d')]:_0x4f4464[_0xfcce('0x40')];if(!_0x10b7ac[_0xfcce('0x3c')]['hasOwnProperty'](_0xfcce('0x41'))){_0x1d791d[_0xfcce('0x22')]=qs['limit'](_0x10b7ac[_0xfcce('0x3c')][_0xfcce('0x22')]);_0x1d791d[_0xfcce('0x20')]=qs['offset'](_0x10b7ac[_0xfcce('0x3c')][_0xfcce('0x20')]);}_0x1d791d[_0xfcce('0x42')]=qs[_0xfcce('0x43')](_0x10b7ac[_0xfcce('0x3c')][_0xfcce('0x43')]);_0x1d791d[_0xfcce('0x44')]=qs['filters'](_[_0xfcce('0x45')](_0x10b7ac[_0xfcce('0x3c')],_0x4f4464[_0xfcce('0x3a')]),_0x10df54);if(_0x10b7ac['query']['filter']){_0x1d791d['where']=_['merge'](_0x1d791d[_0xfcce('0x44')],{'$or':_[_0xfcce('0x38')](_0x10df54,function(_0x576dd4){if(_0x576dd4[_0xfcce('0x36')]!==_0xfcce('0x46')){var _0x26ff4b={};_0x26ff4b[_0x576dd4[_0xfcce('0x30')]]={'$like':'%'+_0x10b7ac[_0xfcce('0x3c')][_0xfcce('0x47')]+'%'};return _0x26ff4b;}})});}_0x1d791d=_[_0xfcce('0x48')]({},_0x1d791d,_0x10b7ac[_0xfcce('0x49')]);var _0x332826={'where':_0x1d791d[_0xfcce('0x44')]};return db[_0xfcce('0x33')][_0xfcce('0x23')](_0x332826)['then'](function(_0x1eb2ce){_0x200510[_0xfcce('0x23')]=_0x1eb2ce;if(_0x10b7ac['query'][_0xfcce('0x4a')]){_0x1d791d[_0xfcce('0x4b')]=[{'all':!![]}];}return db[_0xfcce('0x33')]['findAll'](_0x1d791d);})[_0xfcce('0x2a')](function(_0x24aa20){_0x200510[_0xfcce('0x4c')]=_0x24aa20;return _0x200510;})[_0xfcce('0x2a')](respondWithFilteredResult(_0x3c1b7f,_0x1d791d))[_0xfcce('0x4d')](handleError(_0x3c1b7f,null));};exports['show']=function(_0x2016c8,_0x55143e){var _0x3dd6b4={'raw':![],'where':{'id':_0x2016c8[_0xfcce('0x4e')]['id']}},_0x4d37df={};_0x4d37df[_0xfcce('0x40')]=_[_0xfcce('0x39')](db['SquareProject'][_0xfcce('0x34')]);_0x4d37df[_0xfcce('0x3c')]=_[_0xfcce('0x39')](_0x2016c8[_0xfcce('0x3c')]);_0x4d37df['filters']=_['intersection'](_0x4d37df[_0xfcce('0x40')],_0x4d37df[_0xfcce('0x3c')]);_0x3dd6b4['attributes']=_[_0xfcce('0x3b')](_0x4d37df['model'],qs['fields'](_0x2016c8[_0xfcce('0x3c')][_0xfcce('0x3e')]));_0x3dd6b4[_0xfcce('0x3d')]=_0x3dd6b4['attributes'][_0xfcce('0x3f')]?_0x3dd6b4[_0xfcce('0x3d')]:_0x4d37df[_0xfcce('0x40')];if(_0x2016c8[_0xfcce('0x3c')][_0xfcce('0x4a')]){_0x3dd6b4[_0xfcce('0x4b')]=[{'all':!![]}];}_0x3dd6b4=_[_0xfcce('0x48')]({},_0x3dd6b4,_0x2016c8['options']);return db[_0xfcce('0x33')]['find'](_0x3dd6b4)[_0xfcce('0x2a')](handleEntityNotFound(_0x55143e,null))[_0xfcce('0x2a')](respondWithResult(_0x55143e,null))[_0xfcce('0x4d')](handleError(_0x55143e,null));};exports['create']=function(_0x2540bb,_0x2fecc9){return db[_0xfcce('0x33')][_0xfcce('0x4f')](_0x2540bb[_0xfcce('0x50')],{})[_0xfcce('0x2a')](function(_0x3a9b53){var _0x410271=_0x2540bb[_0xfcce('0x51')]['get']({'plain':!![]});if(!_0x410271)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x410271[_0xfcce('0x52')]===_0xfcce('0x51')){var _0x570b93=_0x3a9b53[_0xfcce('0x2b')]({'plain':!![]});var _0xacd40e=_0xfcce('0x2c');return db[_0xfcce('0x53')]['find']({'where':{'name':_0xacd40e,'userProfileId':_0x410271[_0xfcce('0x54')]},'raw':!![]})[_0xfcce('0x2a')](function(_0x3320c7){if(_0x3320c7&&_0x3320c7[_0xfcce('0x55')]===0x0){return db['UserProfileResource'][_0xfcce('0x4f')]({'name':_0x570b93[_0xfcce('0x30')],'resourceId':_0x570b93['id'],'type':_0x3320c7[_0xfcce('0x30')],'sectionId':_0x3320c7['id']},{})[_0xfcce('0x2a')](function(){return _0x3a9b53;});}else{return _0x3a9b53;}})[_0xfcce('0x4d')](function(_0x44e4ad){logger[_0xfcce('0x2f')](_0xfcce('0x56'),_0x44e4ad);throw _0x44e4ad;});}return _0x3a9b53;})[_0xfcce('0x2a')](respondWithResult(_0x2fecc9,0xc9))[_0xfcce('0x4d')](handleError(_0x2fecc9,null));};exports['update']=function(_0x5da04c,_0x4838ff){if(_0x5da04c[_0xfcce('0x50')]['id']){delete _0x5da04c[_0xfcce('0x50')]['id'];}return db[_0xfcce('0x33')][_0xfcce('0x57')]({'where':{'id':_0x5da04c[_0xfcce('0x4e')]['id']}})[_0xfcce('0x2a')](handleEntityNotFound(_0x4838ff,null))[_0xfcce('0x2a')](saveUpdates(_0x5da04c[_0xfcce('0x50')],null))[_0xfcce('0x2a')](respondWithResult(_0x4838ff,null))['catch'](handleError(_0x4838ff,null));};exports[_0xfcce('0x29')]=function(_0x5515bf,_0xf64cae){return db[_0xfcce('0x33')][_0xfcce('0x57')]({'where':{'id':_0x5515bf[_0xfcce('0x4e')]['id']}})[_0xfcce('0x2a')](handleEntityNotFound(_0xf64cae,null))[_0xfcce('0x2a')](removeEntity(_0xf64cae,null))[_0xfcce('0x4d')](handleError(_0xf64cae,null));};exports[_0xfcce('0x58')]=function(_0x4e1cf2,_0x4a649c,_0x3b4595){return db[_0xfcce('0x33')][_0xfcce('0x57')]({'where':{'id':_0x4e1cf2[_0xfcce('0x4e')]['id']}})[_0xfcce('0x2a')](handleEntityNotFound(_0x4a649c,null))[_0xfcce('0x2a')](function(_0x1cf23d){if(_0x1cf23d){return _0x1cf23d['addUsers'](_0x4e1cf2[_0xfcce('0x50')][_0xfcce('0x59')],_[_0xfcce('0x5a')](_0x4e1cf2[_0xfcce('0x50')],[_0xfcce('0x59'),'id'])||{});}})['then'](respondWithResult(_0x4a649c,null))[_0xfcce('0x4d')](handleError(_0x4a649c,null));};exports[_0xfcce('0x5b')]=function(_0x2d037c,_0x267f68,_0x3ce698){return db['SquareProject'][_0xfcce('0x57')]({'where':{'id':_0x2d037c['params']['id']}})['then'](handleEntityNotFound(_0x267f68,null))[_0xfcce('0x2a')](function(_0x4cade5){if(_0x4cade5){return _0x4cade5['removeUsers'](_0x2d037c[_0xfcce('0x3c')]['ids'])[_0xfcce('0x2a')](function(){if(_[_0xfcce('0x5c')](_0x2d037c[_0xfcce('0x3c')][_0xfcce('0x59')])){for(var _0x132c94=0x0;_0x132c94<_0x2d037c[_0xfcce('0x3c')]['ids'][_0xfcce('0x3f')];_0x132c94+=0x1){socket['emit']('userSquareProject:remove',{'UserId':Number(_0x2d037c[_0xfcce('0x3c')][_0xfcce('0x59')][_0x132c94]),'SquareProjectId':Number(_0x2d037c[_0xfcce('0x4e')]['id'])});}}else{socket[_0xfcce('0x5d')](_0xfcce('0x5e'),{'UserId':Number(_0x2d037c['query'][_0xfcce('0x59')]),'SquareProjectId':Number(_0x2d037c[_0xfcce('0x4e')]['id'])});}});}})[_0xfcce('0x2a')](respondWithStatusCode(_0x267f68,null))[_0xfcce('0x4d')](handleError(_0x267f68,null));};exports[_0xfcce('0x5f')]=function(_0x72033f,_0x408e31,_0x547e05){var _0x51e07c={};var _0x56ea53={};var _0x343c56;var _0x153853;return db[_0xfcce('0x33')][_0xfcce('0x60')]({'where':{'id':_0x72033f[_0xfcce('0x4e')]['id']}})[_0xfcce('0x2a')](handleEntityNotFound(_0x408e31,null))[_0xfcce('0x2a')](function(_0x66da8f){if(_0x66da8f){_0x343c56=_0x66da8f;_0x56ea53[_0xfcce('0x40')]=_[_0xfcce('0x39')](db[_0xfcce('0x61')][_0xfcce('0x34')]);_0x56ea53[_0xfcce('0x3c')]=_['keys'](_0x72033f[_0xfcce('0x3c')]);_0x56ea53[_0xfcce('0x3a')]=_[_0xfcce('0x3b')](_0x56ea53['model'],_0x56ea53['query']);_0x51e07c[_0xfcce('0x3d')]=_['intersection'](_0x56ea53[_0xfcce('0x40')],qs[_0xfcce('0x3e')](_0x72033f[_0xfcce('0x3c')][_0xfcce('0x3e')]));_0x51e07c[_0xfcce('0x3d')]=_0x51e07c[_0xfcce('0x3d')]['length']?_0x51e07c['attributes']:_0x56ea53['model'];_0x51e07c[_0xfcce('0x42')]=qs['sort'](_0x72033f['query']['sort']);_0x51e07c['where']=qs[_0xfcce('0x3a')](_[_0xfcce('0x45')](_0x72033f['query'],_0x56ea53['filters']));if(_0x72033f['query'][_0xfcce('0x47')]){_0x51e07c[_0xfcce('0x44')]=_[_0xfcce('0x48')](_0x51e07c[_0xfcce('0x44')],{'$or':_[_0xfcce('0x38')](_0x51e07c[_0xfcce('0x3d')],function(_0x1b0e3f){var _0x1f5d19={};_0x1f5d19[_0x1b0e3f]={'$like':'%'+_0x72033f[_0xfcce('0x3c')]['filter']+'%'};return _0x1f5d19;})});}_0x51e07c=_[_0xfcce('0x48')]({},_0x51e07c,_0x72033f[_0xfcce('0x49')]);return _0x343c56[_0xfcce('0x5f')](_0x51e07c);}})[_0xfcce('0x2a')](function(_0x1382ea){if(_0x1382ea){_0x153853=_0x1382ea[_0xfcce('0x3f')];if(!_0x72033f[_0xfcce('0x3c')][_0xfcce('0x62')](_0xfcce('0x41'))){_0x51e07c['limit']=qs[_0xfcce('0x22')](_0x72033f[_0xfcce('0x3c')]['limit']);_0x51e07c[_0xfcce('0x20')]=qs[_0xfcce('0x20')](_0x72033f[_0xfcce('0x3c')][_0xfcce('0x20')]);}return _0x343c56[_0xfcce('0x5f')](_0x51e07c);}})['then'](function(_0x3475b1){if(_0x3475b1){return _0x3475b1?{'count':_0x153853,'rows':_0x3475b1}:null;}})[_0xfcce('0x2a')](respondWithResult(_0x408e31,null))[_0xfcce('0x4d')](handleError(_0x408e31,null));}; \ No newline at end of file +var _0x46b7=['order','filter','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','register','status','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','then','destroy','UserProfileResource','end','sendStatus','stack','name','send','map','SquareProject','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','SquareProjects','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','omit','removeUsers','emit','userSquareProject:remove','getUsers','User'];(function(_0x5a27e8,_0x492a2f){var _0x4e38f7=function(_0x2a4048){while(--_0x2a4048){_0x5a27e8['push'](_0x5a27e8['shift']());}};_0x4e38f7(++_0x492a2f);}(_0x46b7,0x1d3));var _0x746b=function(_0x352a13,_0x172aa9){_0x352a13=_0x352a13-0x0;var _0x553856=_0x46b7[_0x352a13];return _0x553856;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x746b('0x0'));var jsonpatch=require(_0x746b('0x1'));var rp=require(_0x746b('0x2'));var moment=require(_0x746b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x746b('0x4'));var util=require('util');var path=require(_0x746b('0x5'));var sox=require('sox');var csv=require(_0x746b('0x6'));var ejs=require(_0x746b('0x7'));var fs=require('fs');var fs_extra=require(_0x746b('0x8'));var _=require(_0x746b('0x9'));var squel=require('squel');var crypto=require(_0x746b('0xa'));var jsforce=require(_0x746b('0xb'));var deskjs=require(_0x746b('0xc'));var toCsv=require(_0x746b('0x6'));var querystring=require(_0x746b('0xd'));var Papa=require('papaparse');var Redis=require(_0x746b('0xe'));var authService=require(_0x746b('0xf'));var qs=require(_0x746b('0x10'));var as=require(_0x746b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x746b('0x12'))(_0x746b('0x13'));var utils=require(_0x746b('0x14'));var config=require(_0x746b('0x15'));var licenseUtil=require(_0x746b('0x16'));var db=require(_0x746b('0x17'))['db'];config[_0x746b('0x18')]=_[_0x746b('0x19')](config[_0x746b('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x746b('0x18')]));require('./squareProject.socket')[_0x746b('0x1a')](socket);function respondWithStatusCode(_0x467f5f,_0x8c86b){_0x8c86b=_0x8c86b||0xcc;return function(_0x301305){if(_0x301305){return _0x467f5f['sendStatus'](_0x8c86b);}return _0x467f5f['status'](_0x8c86b)['end']();};}function respondWithResult(_0x20211c,_0x114d69){_0x114d69=_0x114d69||0xc8;return function(_0x5c68fe){if(_0x5c68fe){return _0x20211c[_0x746b('0x1b')](_0x114d69)['json'](_0x5c68fe);}};}function respondWithFilteredResult(_0x37fe5c,_0x32ace4){return function(_0x1cae4c){if(_0x1cae4c){var _0x495903=typeof _0x32ace4['offset']===_0x746b('0x1c')&&typeof _0x32ace4[_0x746b('0x1d')]===_0x746b('0x1c');var _0x38b2d3=_0x1cae4c[_0x746b('0x1e')];var _0x485608=_0x495903?0x0:_0x32ace4[_0x746b('0x1f')];var _0x3d43d5=_0x495903?_0x1cae4c[_0x746b('0x1e')]:_0x32ace4[_0x746b('0x1f')]+_0x32ace4[_0x746b('0x1d')];var _0x5dcb95;if(_0x3d43d5>=_0x38b2d3){_0x3d43d5=_0x38b2d3;_0x5dcb95=0xc8;}else{_0x5dcb95=0xce;}_0x37fe5c[_0x746b('0x1b')](_0x5dcb95);return _0x37fe5c[_0x746b('0x20')](_0x746b('0x21'),_0x485608+'-'+_0x3d43d5+'/'+_0x38b2d3)[_0x746b('0x22')](_0x1cae4c);}return null;};}function patchUpdates(_0x19d078){return function(_0x256236){try{jsonpatch[_0x746b('0x23')](_0x256236,_0x19d078,!![]);}catch(_0xe36a23){return BPromise['reject'](_0xe36a23);}return _0x256236[_0x746b('0x24')]();};}function saveUpdates(_0x2594af,_0x244e92){return function(_0x5a2bde){if(_0x5a2bde){return _0x5a2bde[_0x746b('0x25')](_0x2594af)[_0x746b('0x26')](function(_0xf98686){return _0xf98686;});}return null;};}function removeEntity(_0x1e43a1,_0x2edb7a){return function(_0x1bec8e){if(_0x1bec8e){return _0x1bec8e[_0x746b('0x27')]()['then'](function(){var _0x47d247=_0x1bec8e['get']({'plain':!![]});var _0x28619d='SquareProjects';return db[_0x746b('0x28')]['destroy']({'where':{'type':_0x28619d,'resourceId':_0x47d247['id']}})[_0x746b('0x26')](function(){return _0x1bec8e;});})['then'](function(){_0x1e43a1[_0x746b('0x1b')](0xcc)[_0x746b('0x29')]();});}};}function handleEntityNotFound(_0x55bf54,_0x4fb961){return function(_0x30cdba){if(!_0x30cdba){_0x55bf54[_0x746b('0x2a')](0x194);}return _0x30cdba;};}function handleError(_0x106891,_0x4463e2){_0x4463e2=_0x4463e2||0x1f4;return function(_0x2754af){logger['error'](_0x2754af[_0x746b('0x2b')]);if(_0x2754af[_0x746b('0x2c')]){delete _0x2754af['name'];}_0x106891[_0x746b('0x1b')](_0x4463e2)[_0x746b('0x2d')](_0x2754af);};}exports['index']=function(_0x109877,_0x55226c){var _0x3a60e9={},_0x200632={},_0x239faf={'count':0x0,'rows':[]};var _0x5f0b5e=_[_0x746b('0x2e')](db[_0x746b('0x2f')][_0x746b('0x30')],function(_0x52bf0a){return{'name':_0x52bf0a['fieldName'],'type':_0x52bf0a['type'][_0x746b('0x31')]};});_0x200632[_0x746b('0x32')]=_[_0x746b('0x2e')](_0x5f0b5e,_0x746b('0x2c'));_0x200632[_0x746b('0x33')]=_[_0x746b('0x34')](_0x109877[_0x746b('0x33')]);_0x200632[_0x746b('0x35')]=_[_0x746b('0x36')](_0x200632[_0x746b('0x32')],_0x200632[_0x746b('0x33')]);_0x3a60e9[_0x746b('0x37')]=_[_0x746b('0x36')](_0x200632[_0x746b('0x32')],qs[_0x746b('0x38')](_0x109877['query'][_0x746b('0x38')]));_0x3a60e9[_0x746b('0x37')]=_0x3a60e9[_0x746b('0x37')][_0x746b('0x39')]?_0x3a60e9['attributes']:_0x200632['model'];if(!_0x109877[_0x746b('0x33')][_0x746b('0x3a')](_0x746b('0x3b'))){_0x3a60e9['limit']=qs[_0x746b('0x1d')](_0x109877['query'][_0x746b('0x1d')]);_0x3a60e9[_0x746b('0x1f')]=qs[_0x746b('0x1f')](_0x109877['query']['offset']);}_0x3a60e9['order']=qs[_0x746b('0x3c')](_0x109877[_0x746b('0x33')][_0x746b('0x3c')]);_0x3a60e9[_0x746b('0x3d')]=qs['filters'](_[_0x746b('0x3e')](_0x109877[_0x746b('0x33')],_0x200632[_0x746b('0x35')]),_0x5f0b5e);if(_0x109877[_0x746b('0x33')]['filter']){_0x3a60e9[_0x746b('0x3d')]=_[_0x746b('0x3f')](_0x3a60e9[_0x746b('0x3d')],{'$or':_[_0x746b('0x2e')](_0x5f0b5e,function(_0x17f14f){if(_0x17f14f[_0x746b('0x40')]!==_0x746b('0x41')){var _0x56137c={};_0x56137c[_0x17f14f['name']]={'$like':'%'+_0x109877[_0x746b('0x33')]['filter']+'%'};return _0x56137c;}})});}_0x3a60e9=_[_0x746b('0x3f')]({},_0x3a60e9,_0x109877[_0x746b('0x42')]);var _0x57a5cc={'where':_0x3a60e9[_0x746b('0x3d')]};return db[_0x746b('0x2f')][_0x746b('0x1e')](_0x57a5cc)[_0x746b('0x26')](function(_0x164b73){_0x239faf['count']=_0x164b73;if(_0x109877[_0x746b('0x33')][_0x746b('0x43')]){_0x3a60e9[_0x746b('0x44')]=[{'all':!![]}];}return db[_0x746b('0x2f')][_0x746b('0x45')](_0x3a60e9);})[_0x746b('0x26')](function(_0x134ffb){_0x239faf[_0x746b('0x46')]=_0x134ffb;return _0x239faf;})[_0x746b('0x26')](respondWithFilteredResult(_0x55226c,_0x3a60e9))[_0x746b('0x47')](handleError(_0x55226c,null));};exports[_0x746b('0x48')]=function(_0x16b634,_0x17021e){var _0xc1d5cf={'raw':![],'where':{'id':_0x16b634[_0x746b('0x49')]['id']}},_0x4ad9e8={};_0x4ad9e8[_0x746b('0x32')]=_[_0x746b('0x34')](db[_0x746b('0x2f')][_0x746b('0x30')]);_0x4ad9e8['query']=_['keys'](_0x16b634['query']);_0x4ad9e8['filters']=_[_0x746b('0x36')](_0x4ad9e8[_0x746b('0x32')],_0x4ad9e8[_0x746b('0x33')]);_0xc1d5cf[_0x746b('0x37')]=_[_0x746b('0x36')](_0x4ad9e8['model'],qs['fields'](_0x16b634[_0x746b('0x33')][_0x746b('0x38')]));_0xc1d5cf['attributes']=_0xc1d5cf['attributes'][_0x746b('0x39')]?_0xc1d5cf[_0x746b('0x37')]:_0x4ad9e8[_0x746b('0x32')];if(_0x16b634[_0x746b('0x33')][_0x746b('0x43')]){_0xc1d5cf[_0x746b('0x44')]=[{'all':!![]}];}_0xc1d5cf=_[_0x746b('0x3f')]({},_0xc1d5cf,_0x16b634[_0x746b('0x42')]);return db[_0x746b('0x2f')][_0x746b('0x4a')](_0xc1d5cf)['then'](handleEntityNotFound(_0x17021e,null))[_0x746b('0x26')](respondWithResult(_0x17021e,null))[_0x746b('0x47')](handleError(_0x17021e,null));};exports[_0x746b('0x4b')]=function(_0x244160,_0x173a28){return db[_0x746b('0x2f')][_0x746b('0x4b')](_0x244160[_0x746b('0x4c')],{})[_0x746b('0x26')](function(_0x59b8ed){var _0x5cbd00=_0x244160['user'][_0x746b('0x4d')]({'plain':!![]});if(!_0x5cbd00)throw new Error(_0x746b('0x4e'));if(_0x5cbd00['role']==='user'){var _0x52d0ff=_0x59b8ed[_0x746b('0x4d')]({'plain':!![]});var _0x372a41=_0x746b('0x4f');return db[_0x746b('0x50')][_0x746b('0x4a')]({'where':{'name':_0x372a41,'userProfileId':_0x5cbd00['userProfileId']},'raw':!![]})[_0x746b('0x26')](function(_0x5ca6a0){if(_0x5ca6a0&&_0x5ca6a0[_0x746b('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x52d0ff[_0x746b('0x2c')],'resourceId':_0x52d0ff['id'],'type':_0x5ca6a0[_0x746b('0x2c')],'sectionId':_0x5ca6a0['id']},{})[_0x746b('0x26')](function(){return _0x59b8ed;});}else{return _0x59b8ed;}})['catch'](function(_0x4e15f4){logger['error'](_0x746b('0x52'),_0x4e15f4);throw _0x4e15f4;});}return _0x59b8ed;})[_0x746b('0x26')](respondWithResult(_0x173a28,0xc9))[_0x746b('0x47')](handleError(_0x173a28,null));};exports[_0x746b('0x25')]=function(_0x201066,_0x36e4f0){if(_0x201066[_0x746b('0x4c')]['id']){delete _0x201066[_0x746b('0x4c')]['id'];}return db[_0x746b('0x2f')][_0x746b('0x4a')]({'where':{'id':_0x201066[_0x746b('0x49')]['id']}})['then'](handleEntityNotFound(_0x36e4f0,null))[_0x746b('0x26')](saveUpdates(_0x201066[_0x746b('0x4c')],null))[_0x746b('0x26')](respondWithResult(_0x36e4f0,null))['catch'](handleError(_0x36e4f0,null));};exports[_0x746b('0x27')]=function(_0x2fd74e,_0x169036){return db['SquareProject'][_0x746b('0x4a')]({'where':{'id':_0x2fd74e[_0x746b('0x49')]['id']}})[_0x746b('0x26')](handleEntityNotFound(_0x169036,null))[_0x746b('0x26')](removeEntity(_0x169036,null))['catch'](handleError(_0x169036,null));};exports[_0x746b('0x53')]=function(_0x396adf,_0x25c786,_0x42e665){return db[_0x746b('0x2f')]['find']({'where':{'id':_0x396adf[_0x746b('0x49')]['id']}})[_0x746b('0x26')](handleEntityNotFound(_0x25c786,null))[_0x746b('0x26')](function(_0x3ca300){if(_0x3ca300){return _0x3ca300['addUsers'](_0x396adf['body'][_0x746b('0x54')],_[_0x746b('0x55')](_0x396adf[_0x746b('0x4c')],[_0x746b('0x54'),'id'])||{});}})[_0x746b('0x26')](respondWithResult(_0x25c786,null))[_0x746b('0x47')](handleError(_0x25c786,null));};exports['removeUsers']=function(_0x5416f6,_0x83f33f,_0x34abd7){return db[_0x746b('0x2f')][_0x746b('0x4a')]({'where':{'id':_0x5416f6[_0x746b('0x49')]['id']}})[_0x746b('0x26')](handleEntityNotFound(_0x83f33f,null))[_0x746b('0x26')](function(_0x5e759b){if(_0x5e759b){return _0x5e759b[_0x746b('0x56')](_0x5416f6[_0x746b('0x33')][_0x746b('0x54')])[_0x746b('0x26')](function(){if(_['isArray'](_0x5416f6['query']['ids'])){for(var _0x4e9480=0x0;_0x4e9480<_0x5416f6[_0x746b('0x33')][_0x746b('0x54')][_0x746b('0x39')];_0x4e9480+=0x1){socket[_0x746b('0x57')](_0x746b('0x58'),{'UserId':Number(_0x5416f6[_0x746b('0x33')][_0x746b('0x54')][_0x4e9480]),'SquareProjectId':Number(_0x5416f6[_0x746b('0x49')]['id'])});}}else{socket[_0x746b('0x57')](_0x746b('0x58'),{'UserId':Number(_0x5416f6['query'][_0x746b('0x54')]),'SquareProjectId':Number(_0x5416f6[_0x746b('0x49')]['id'])});}});}})[_0x746b('0x26')](respondWithStatusCode(_0x83f33f,null))[_0x746b('0x47')](handleError(_0x83f33f,null));};exports[_0x746b('0x59')]=function(_0x59f53b,_0x4f87a7,_0x53a499){var _0xee6f1d={};var _0x3ef6b0={};var _0x18c19c;var _0x298a4d;return db[_0x746b('0x2f')]['findOne']({'where':{'id':_0x59f53b[_0x746b('0x49')]['id']}})[_0x746b('0x26')](handleEntityNotFound(_0x4f87a7,null))[_0x746b('0x26')](function(_0x46693c){if(_0x46693c){_0x18c19c=_0x46693c;_0x3ef6b0[_0x746b('0x32')]=_['keys'](db[_0x746b('0x5a')][_0x746b('0x30')]);_0x3ef6b0[_0x746b('0x33')]=_[_0x746b('0x34')](_0x59f53b[_0x746b('0x33')]);_0x3ef6b0['filters']=_[_0x746b('0x36')](_0x3ef6b0[_0x746b('0x32')],_0x3ef6b0['query']);_0xee6f1d[_0x746b('0x37')]=_[_0x746b('0x36')](_0x3ef6b0['model'],qs[_0x746b('0x38')](_0x59f53b[_0x746b('0x33')]['fields']));_0xee6f1d[_0x746b('0x37')]=_0xee6f1d[_0x746b('0x37')][_0x746b('0x39')]?_0xee6f1d[_0x746b('0x37')]:_0x3ef6b0[_0x746b('0x32')];_0xee6f1d[_0x746b('0x5b')]=qs[_0x746b('0x3c')](_0x59f53b[_0x746b('0x33')][_0x746b('0x3c')]);_0xee6f1d[_0x746b('0x3d')]=qs[_0x746b('0x35')](_[_0x746b('0x3e')](_0x59f53b['query'],_0x3ef6b0[_0x746b('0x35')]));if(_0x59f53b[_0x746b('0x33')][_0x746b('0x5c')]){_0xee6f1d['where']=_['merge'](_0xee6f1d[_0x746b('0x3d')],{'$or':_[_0x746b('0x2e')](_0xee6f1d['attributes'],function(_0x4ec717){var _0x2c6f5a={};_0x2c6f5a[_0x4ec717]={'$like':'%'+_0x59f53b[_0x746b('0x33')][_0x746b('0x5c')]+'%'};return _0x2c6f5a;})});}_0xee6f1d=_[_0x746b('0x3f')]({},_0xee6f1d,_0x59f53b['options']);return _0x18c19c[_0x746b('0x59')](_0xee6f1d);}})[_0x746b('0x26')](function(_0x4facfe){if(_0x4facfe){_0x298a4d=_0x4facfe['length'];if(!_0x59f53b[_0x746b('0x33')]['hasOwnProperty'](_0x746b('0x3b'))){_0xee6f1d[_0x746b('0x1d')]=qs[_0x746b('0x1d')](_0x59f53b[_0x746b('0x33')][_0x746b('0x1d')]);_0xee6f1d['offset']=qs[_0x746b('0x1f')](_0x59f53b['query'][_0x746b('0x1f')]);}return _0x18c19c[_0x746b('0x59')](_0xee6f1d);}})[_0x746b('0x26')](function(_0x2e6bd6){if(_0x2e6bd6){return _0x2e6bd6?{'count':_0x298a4d,'rows':_0x2e6bd6}:null;}})[_0x746b('0x26')](respondWithResult(_0x4f87a7,null))[_0x746b('0x47')](handleError(_0x4f87a7,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index c0120cf..f651507 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 _0x9bb5=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','update','remove'];(function(_0x4b4844,_0x2f0dfb){var _0x575192=function(_0x13ee1b){while(--_0x13ee1b){_0x4b4844['push'](_0x4b4844['shift']());}};_0x575192(++_0x2f0dfb);}(_0x9bb5,0x94));var _0x59bb=function(_0x11faef,_0x3c4a60){_0x11faef=_0x11faef-0x0;var _0x170abc=_0x9bb5[_0x11faef];return _0x170abc;};'use strict';var EventEmitter=require(_0x59bb('0x0'));var SquareProject=require('../../mysqldb')['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x59bb('0x1')](0x0);var events={'afterCreate':_0x59bb('0x2'),'afterUpdate':_0x59bb('0x3'),'afterDestroy':_0x59bb('0x4')};function emitEvent(_0x5d402c){return function(_0x5d1421,_0x225a8e,_0x31149d){SquareProjectEvents[_0x59bb('0x5')](_0x5d402c+':'+_0x5d1421['id'],_0x5d1421);SquareProjectEvents[_0x59bb('0x5')](_0x5d402c,_0x5d1421);_0x31149d(null);};}for(var e in events){if(events[_0x59bb('0x6')](e)){var event=events[e];SquareProject[_0x59bb('0x7')](e,emitEvent(event));}}module[_0x59bb('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0xf526=['hook','events','../../mysqldb','SquareProject','save','update','remove','emit','hasOwnProperty'];(function(_0x407bd8,_0x277add){var _0x20b6c9=function(_0x215b6c){while(--_0x215b6c){_0x407bd8['push'](_0x407bd8['shift']());}};_0x20b6c9(++_0x277add);}(_0xf526,0x1d5));var _0x6f52=function(_0x2cd007,_0x55231e){_0x2cd007=_0x2cd007-0x0;var _0x48ae38=_0xf526[_0x2cd007];return _0x48ae38;};'use strict';var EventEmitter=require(_0x6f52('0x0'));var SquareProject=require(_0x6f52('0x1'))['db'][_0x6f52('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6f52('0x3'),'afterUpdate':_0x6f52('0x4'),'afterDestroy':_0x6f52('0x5')};function emitEvent(_0x5b6541){return function(_0x439c3a,_0x20b4c3,_0x587109){SquareProjectEvents[_0x6f52('0x6')](_0x5b6541+':'+_0x439c3a['id'],_0x439c3a);SquareProjectEvents[_0x6f52('0x6')](_0x5b6541,_0x439c3a);_0x587109(null);};}for(var e in events){if(events[_0x6f52('0x7')](e)){var event=events[e];SquareProject[_0x6f52('0x8')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index c193412..c316a6f 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 _0x3f17=['moment','bluebird','request-promise','path','rimraf','./squareProject.attributes','exports','define','SquareProject','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','api'];(function(_0x41e137,_0x34f2bb){var _0x41e9be=function(_0x2addd9){while(--_0x2addd9){_0x41e137['push'](_0x41e137['shift']());}};_0x41e9be(++_0x34f2bb);}(_0x3f17,0xd9));var _0x73f1=function(_0x509b60,_0x535f5b){_0x509b60=_0x509b60-0x0;var _0xe8c60c=_0x3f17[_0x509b60];return _0xe8c60c;};'use strict';var _=require(_0x73f1('0x0'));var util=require(_0x73f1('0x1'));var logger=require('../../config/logger')(_0x73f1('0x2'));var moment=require(_0x73f1('0x3'));var BPromise=require(_0x73f1('0x4'));var rp=require(_0x73f1('0x5'));var fs=require('fs');var path=require(_0x73f1('0x6'));var rimraf=require(_0x73f1('0x7'));var config=require('../../config/environment');var attributes=require(_0x73f1('0x8'));module[_0x73f1('0x9')]=function(_0x416ed8,_0x28356c){return _0x416ed8[_0x73f1('0xa')](_0x73f1('0xb'),attributes,{'tableName':_0x73f1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xb08dbc,_0x47f9f2,_0x156ef1){if(_0xb08dbc[_0x73f1('0xd')](_0x73f1('0xe'))){_0xb08dbc[_0x73f1('0xf')]=moment()[_0x73f1('0x10')](_0x73f1('0x11'));}if(_0xb08dbc[_0x73f1('0xd')](_0x73f1('0x12'))){_0xb08dbc[_0x73f1('0x13')]=moment()[_0x73f1('0x10')](_0x73f1('0x11'));}_0x156ef1(null,_0xb08dbc);}}});}; \ No newline at end of file +var _0x9371=['square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject'];(function(_0x109f95,_0xf40cb4){var _0x446879=function(_0x355ca3){while(--_0x355ca3){_0x109f95['push'](_0x109f95['shift']());}};_0x446879(++_0xf40cb4);}(_0x9371,0x120));var _0x1937=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x9371[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x1937('0x0'));var util=require(_0x1937('0x1'));var logger=require(_0x1937('0x2'))(_0x1937('0x3'));var moment=require(_0x1937('0x4'));var BPromise=require(_0x1937('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1937('0x6'));var config=require(_0x1937('0x7'));var attributes=require(_0x1937('0x8'));module[_0x1937('0x9')]=function(_0x247c8d,_0x1ea5d4){return _0x247c8d[_0x1937('0xa')](_0x1937('0xb'),attributes,{'tableName':_0x1937('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x258ba8,_0x19985e,_0x2bfd7e){if(_0x258ba8[_0x1937('0xd')](_0x1937('0xe'))){_0x258ba8[_0x1937('0xf')]=moment()[_0x1937('0x10')](_0x1937('0x11'));}if(_0x258ba8[_0x1937('0xd')](_0x1937('0x12'))){_0x258ba8[_0x1937('0x13')]=moment()[_0x1937('0x10')](_0x1937('0x11'));}_0x2bfd7e(null,_0x258ba8);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 1ddf265..4739234 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 _0xafb3=['then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','register','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSquareProject','options','raw','where','map','include','model','attributes'];(function(_0x1ebf3c,_0x5a7341){var _0x2b27cc=function(_0x160207){while(--_0x160207){_0x1ebf3c['push'](_0x1ebf3c['shift']());}};_0x2b27cc(++_0x5a7341);}(_0xafb3,0x13c));var _0x3afb=function(_0x33880b,_0x42f4c1){_0x33880b=_0x33880b-0x0;var _0x295ce1=_0xafb3[_0x33880b];return _0x295ce1;};'use strict';var _=require(_0x3afb('0x0'));var util=require(_0x3afb('0x1'));var moment=require(_0x3afb('0x2'));var BPromise=require(_0x3afb('0x3'));var rs=require(_0x3afb('0x4'));var fs=require('fs');var Redis=require(_0x3afb('0x5'));var db=require(_0x3afb('0x6'))['db'];var utils=require(_0x3afb('0x7'));var logger=require(_0x3afb('0x8'))('rpc');var config=require(_0x3afb('0x9'));var jayson=require(_0x3afb('0xa'));var client=jayson[_0x3afb('0xb')]['http']({'port':0x232a});config[_0x3afb('0xc')]=_[_0x3afb('0xd')](config[_0x3afb('0xc')],{'host':_0x3afb('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3afb('0xc')]));require('./squareProject.socket')[_0x3afb('0xf')](socket);function respondWithRpcPromise(_0x4f412b,_0x5540b6,_0x362d35){return new BPromise(function(_0x4d60cb,_0x435a6d){return client['request'](_0x4f412b,_0x362d35)['then'](function(_0x483464){logger[_0x3afb('0x10')](_0x3afb('0x11'),_0x5540b6,_0x3afb('0x12'));logger[_0x3afb('0x13')](_0x3afb('0x14'),_0x5540b6,_0x3afb('0x12'),JSON[_0x3afb('0x15')](_0x483464));if(_0x483464[_0x3afb('0x16')]){if(_0x483464[_0x3afb('0x16')][_0x3afb('0x17')]===0x1f4){logger[_0x3afb('0x16')](_0x3afb('0x11'),_0x5540b6,_0x483464[_0x3afb('0x16')][_0x3afb('0x18')]);return _0x435a6d(_0x483464[_0x3afb('0x16')][_0x3afb('0x18')]);}logger[_0x3afb('0x16')](_0x3afb('0x11'),_0x5540b6,_0x483464['error'][_0x3afb('0x18')]);return _0x4d60cb(_0x483464[_0x3afb('0x16')][_0x3afb('0x18')]);}else{logger[_0x3afb('0x10')](_0x3afb('0x11'),_0x5540b6,_0x3afb('0x12'));_0x4d60cb(_0x483464['result'][_0x3afb('0x18')]);}})[_0x3afb('0x19')](function(_0x437d09){logger[_0x3afb('0x16')]('SquareProject,\x20%s,\x20%s',_0x5540b6,_0x437d09);_0x435a6d(_0x437d09);});});}exports[_0x3afb('0x1a')]=function(_0x23af47){var _0x34498a=this;return new Promise(function(_0x473c29,_0x2ab77f){return db['SquareProject']['find']({'raw':_0x23af47[_0x3afb('0x1b')]?_0x23af47[_0x3afb('0x1b')][_0x3afb('0x1c')]===undefined?!![]:![]:!![],'where':_0x23af47[_0x3afb('0x1b')]?_0x23af47[_0x3afb('0x1b')][_0x3afb('0x1d')]||null:null,'attributes':_0x23af47[_0x3afb('0x1b')]?_0x23af47[_0x3afb('0x1b')]['attributes']||null:null,'include':_0x23af47[_0x3afb('0x1b')]?_0x23af47[_0x3afb('0x1b')]['include']?_[_0x3afb('0x1e')](_0x23af47[_0x3afb('0x1b')][_0x3afb('0x1f')],function(_0x265ba4){return{'model':db[_0x265ba4[_0x3afb('0x20')]],'as':_0x265ba4['as'],'attributes':_0x265ba4[_0x3afb('0x21')],'include':_0x265ba4[_0x3afb('0x1f')]?_['map'](_0x265ba4['include'],function(_0x856762){return{'model':db[_0x856762['model']],'as':_0x856762['as'],'attributes':_0x856762[_0x3afb('0x21')],'include':_0x856762[_0x3afb('0x1f')]?_['map'](_0x856762[_0x3afb('0x1f')],function(_0x1e1ffb){return{'model':db[_0x1e1ffb[_0x3afb('0x20')]],'as':_0x1e1ffb['as'],'attributes':_0x1e1ffb[_0x3afb('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3afb('0x22')](function(_0x1e559c){logger[_0x3afb('0x10')](_0x3afb('0x1a'),_0x23af47);logger[_0x3afb('0x13')](_0x3afb('0x1a'),_0x23af47,JSON[_0x3afb('0x15')](_0x1e559c));_0x473c29(_0x1e559c);})['catch'](function(_0x342546){logger[_0x3afb('0x16')](_0x3afb('0x1a'),_0x342546[_0x3afb('0x18')],_0x23af47);_0x2ab77f(_0x34498a['error'](0x1f4,_0x342546[_0x3afb('0x18')]));});});}; \ No newline at end of file +var _0x57f3=['find','options','raw','where','include','map','model','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSquareProject','SquareProject'];(function(_0x3e6785,_0x4f5844){var _0x23b4c0=function(_0x39323f){while(--_0x39323f){_0x3e6785['push'](_0x3e6785['shift']());}};_0x23b4c0(++_0x4f5844);}(_0x57f3,0x1e8));var _0x357f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x57f3[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x357f('0x0'));var util=require(_0x357f('0x1'));var moment=require(_0x357f('0x2'));var BPromise=require(_0x357f('0x3'));var rs=require(_0x357f('0x4'));var fs=require('fs');var Redis=require(_0x357f('0x5'));var db=require(_0x357f('0x6'))['db'];var utils=require(_0x357f('0x7'));var logger=require(_0x357f('0x8'))(_0x357f('0x9'));var config=require(_0x357f('0xa'));var jayson=require(_0x357f('0xb'));var client=jayson[_0x357f('0xc')][_0x357f('0xd')]({'port':0x232a});config[_0x357f('0xe')]=_[_0x357f('0xf')](config[_0x357f('0xe')],{'host':_0x357f('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./squareProject.socket')[_0x357f('0x11')](socket);function respondWithRpcPromise(_0x514800,_0x47f6a7,_0x168a1a){return new BPromise(function(_0xabb1ea,_0x54d41c){return client[_0x357f('0x12')](_0x514800,_0x168a1a)[_0x357f('0x13')](function(_0x333f5e){logger[_0x357f('0x14')](_0x357f('0x15'),_0x47f6a7,_0x357f('0x16'));logger[_0x357f('0x17')](_0x357f('0x18'),_0x47f6a7,'request\x20sent',JSON[_0x357f('0x19')](_0x333f5e));if(_0x333f5e['error']){if(_0x333f5e[_0x357f('0x1a')][_0x357f('0x1b')]===0x1f4){logger[_0x357f('0x1a')](_0x357f('0x15'),_0x47f6a7,_0x333f5e[_0x357f('0x1a')][_0x357f('0x1c')]);return _0x54d41c(_0x333f5e[_0x357f('0x1a')][_0x357f('0x1c')]);}logger[_0x357f('0x1a')](_0x357f('0x15'),_0x47f6a7,_0x333f5e[_0x357f('0x1a')][_0x357f('0x1c')]);return _0xabb1ea(_0x333f5e[_0x357f('0x1a')][_0x357f('0x1c')]);}else{logger[_0x357f('0x14')]('SquareProject,\x20%s,\x20%s',_0x47f6a7,_0x357f('0x16'));_0xabb1ea(_0x333f5e['result'][_0x357f('0x1c')]);}})[_0x357f('0x1d')](function(_0x2ffbde){logger['error'](_0x357f('0x15'),_0x47f6a7,_0x2ffbde);_0x54d41c(_0x2ffbde);});});}exports[_0x357f('0x1e')]=function(_0x2dbf02){var _0x1fc3cf=this;return new Promise(function(_0x57a76d,_0x407dbf){return db[_0x357f('0x1f')][_0x357f('0x20')]({'raw':_0x2dbf02[_0x357f('0x21')]?_0x2dbf02[_0x357f('0x21')][_0x357f('0x22')]===undefined?!![]:![]:!![],'where':_0x2dbf02['options']?_0x2dbf02[_0x357f('0x21')][_0x357f('0x23')]||null:null,'attributes':_0x2dbf02[_0x357f('0x21')]?_0x2dbf02[_0x357f('0x21')]['attributes']||null:null,'include':_0x2dbf02[_0x357f('0x21')]?_0x2dbf02[_0x357f('0x21')][_0x357f('0x24')]?_[_0x357f('0x25')](_0x2dbf02[_0x357f('0x21')]['include'],function(_0x92a003){return{'model':db[_0x92a003[_0x357f('0x26')]],'as':_0x92a003['as'],'attributes':_0x92a003['attributes'],'include':_0x92a003[_0x357f('0x24')]?_[_0x357f('0x25')](_0x92a003[_0x357f('0x24')],function(_0x12d95f){return{'model':db[_0x12d95f[_0x357f('0x26')]],'as':_0x12d95f['as'],'attributes':_0x12d95f[_0x357f('0x27')],'include':_0x12d95f['include']?_['map'](_0x12d95f['include'],function(_0x2dea39){return{'model':db[_0x2dea39['model']],'as':_0x2dea39['as'],'attributes':_0x2dea39['attributes']};}):[]};}):[]};}):[]:[]})[_0x357f('0x13')](function(_0x332eea){logger[_0x357f('0x14')](_0x357f('0x1e'),_0x2dbf02);logger[_0x357f('0x17')]('ShowSquareProject',_0x2dbf02,JSON['stringify'](_0x332eea));_0x57a76d(_0x332eea);})['catch'](function(_0x3d0e16){logger['error'](_0x357f('0x1e'),_0x3d0e16[_0x357f('0x1c')],_0x2dbf02);_0x407dbf(_0x1fc3cf[_0x357f('0x1a')](0x1f4,_0x3d0e16[_0x357f('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 1c462cf..da8707a 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 _0xafce=['remove','update','emit','removeListener','register','length','./squareProject.events','save'];(function(_0x572706,_0xadcdb5){var _0x556ee9=function(_0x5c174b){while(--_0x5c174b){_0x572706['push'](_0x572706['shift']());}};_0x556ee9(++_0xadcdb5);}(_0xafce,0x86));var _0xeafc=function(_0x18c937,_0x32d230){_0x18c937=_0x18c937-0x0;var _0xc920b3=_0xafce[_0x18c937];return _0xc920b3;};'use strict';var SquareProjectEvents=require(_0xeafc('0x0'));var events=[_0xeafc('0x1'),_0xeafc('0x2'),_0xeafc('0x3')];function createListener(_0x5c06cc,_0x21e5ed){return function(_0x32f8ee){_0x21e5ed[_0xeafc('0x4')](_0x5c06cc,_0x32f8ee);};}function removeListener(_0x56bf9a,_0x21c142){return function(){SquareProjectEvents[_0xeafc('0x5')](_0x56bf9a,_0x21c142);};}exports[_0xeafc('0x6')]=function(_0x6e621f){for(var _0x371465=0x0,_0x45356b=events[_0xeafc('0x7')];_0x371465<_0x45356b;_0x371465++){var _0x2a2763=events[_0x371465];var _0x1fab54=createListener('squareProject:'+_0x2a2763,_0x6e621f);SquareProjectEvents['on'](_0x2a2763,_0x1fab54);}}; \ No newline at end of file +var _0x2472=['emit','removeListener','register','squareProject:','./squareProject.events','update'];(function(_0xae7134,_0x5a583b){var _0x25bf3b=function(_0x364793){while(--_0x364793){_0xae7134['push'](_0xae7134['shift']());}};_0x25bf3b(++_0x5a583b);}(_0x2472,0x17e));var _0x2247=function(_0x43561f,_0x517f0c){_0x43561f=_0x43561f-0x0;var _0x4f6641=_0x2472[_0x43561f];return _0x4f6641;};'use strict';var SquareProjectEvents=require(_0x2247('0x0'));var events=['save','remove',_0x2247('0x1')];function createListener(_0x75bd1e,_0x35db56){return function(_0x55b9f0){_0x35db56[_0x2247('0x2')](_0x75bd1e,_0x55b9f0);};}function removeListener(_0xd8485c,_0x46c7cc){return function(){SquareProjectEvents[_0x2247('0x3')](_0xd8485c,_0x46c7cc);};}exports[_0x2247('0x4')]=function(_0x3b971a){for(var _0x585cdd=0x0,_0x2faf83=events['length'];_0x585cdd<_0x2faf83;_0x585cdd++){var _0x37f8c7=events[_0x585cdd];var _0x2bcb7b=createListener(_0x2247('0x5')+_0x37f8c7,_0x3b971a);SquareProjectEvents['on'](_0x37f8c7,_0x2bcb7b);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index ab0cd00..9d5189e 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 _0x326f=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','download','post','create','put','delete','exports'];(function(_0x2a7f29,_0x2c89dc){var _0x38924b=function(_0x422538){while(--_0x422538){_0x2a7f29['push'](_0x2a7f29['shift']());}};_0x38924b(++_0x2c89dc);}(_0x326f,0xd1));var _0xf326=function(_0x180a6e,_0x539486){_0x180a6e=_0x180a6e-0x0;var _0x103745=_0x326f[_0x180a6e];return _0x103745;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0xe')]('/',auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router[_0xf326('0x10')]('/:id',auth[_0xf326('0xa')](),controller['update']);router[_0xf326('0x11')]('/:id',auth[_0xf326('0xa')](),controller['destroy']);module[_0xf326('0x12')]=router; \ No newline at end of file +var _0x5fab=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','/:id/download','download','create','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x1f9a47,_0x540442){var _0x550db1=function(_0x4c84c3){while(--_0x4c84c3){_0x1f9a47['push'](_0x1f9a47['shift']());}};_0x550db1(++_0x540442);}(_0x5fab,0x177));var _0xb5fa=function(_0x2ec3d1,_0x2d82b2){_0x2ec3d1=_0x2ec3d1-0x0;var _0x2551e2=_0x5fab[_0x2ec3d1];return _0x2551e2;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var fs_extra=require(_0xb5fa('0x5'));var auth=require(_0xb5fa('0x6'));var interaction=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var controller=require(_0xb5fa('0x9'));router[_0xb5fa('0xa')]('/',auth[_0xb5fa('0xb')](),controller['index']);router['get'](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xd')]);router['get'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0x11')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0x13')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index a4e899e..35baa2f 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 _0xac31=['STRING','VIRTUAL','savePath','lastIndexOf','sequelize','exports'];(function(_0x564b0a,_0x4dd651){var _0x350a24=function(_0x200bb4){while(--_0x200bb4){_0x564b0a['push'](_0x564b0a['shift']());}};_0x350a24(++_0x4dd651);}(_0xac31,0xca));var _0x1ac3=function(_0x47e32a,_0x5e53a7){_0x47e32a=_0x47e32a-0x0;var _0x5647c0=_0xac31[_0x47e32a];return _0x5647c0;};'use strict';var Sequelize=require(_0x1ac3('0x0'));module[_0x1ac3('0x1')]={'uniqueid':{'type':Sequelize[_0x1ac3('0x2')]},'callerid':{'type':Sequelize[_0x1ac3('0x2')]},'calleridname':{'type':Sequelize[_0x1ac3('0x2')]},'context':{'type':Sequelize[_0x1ac3('0x2')]},'extension':{'type':Sequelize[_0x1ac3('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x1ac3('0x2')]},'dnid':{'type':Sequelize[_0x1ac3('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x1ac3('0x2')]},'savePath':{'type':Sequelize[_0x1ac3('0x2')]},'format':{'type':Sequelize[_0x1ac3('0x3')],'get':function(){var _0x1be223='';var _0x157604=this['getDataValue'](_0x1ac3('0x4'));if(_0x157604){_0x1be223=_0x157604['substring'](_0x157604[_0x1ac3('0x5')]('.'));}return _0x1be223;}}}; \ No newline at end of file +var _0xed1f=['lastIndexOf','sequelize','exports','STRING','VIRTUAL','getDataValue','substring'];(function(_0x5d225a,_0x2debe9){var _0x1e7761=function(_0x491dc2){while(--_0x491dc2){_0x5d225a['push'](_0x5d225a['shift']());}};_0x1e7761(++_0x2debe9);}(_0xed1f,0x6a));var _0xfed1=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xed1f[_0x49b207];return _0x2dc8fa;};'use strict';var Sequelize=require(_0xfed1('0x0'));module[_0xfed1('0x1')]={'uniqueid':{'type':Sequelize[_0xfed1('0x2')]},'callerid':{'type':Sequelize[_0xfed1('0x2')]},'calleridname':{'type':Sequelize[_0xfed1('0x2')]},'context':{'type':Sequelize[_0xfed1('0x2')]},'extension':{'type':Sequelize[_0xfed1('0x2')]},'priority':{'type':Sequelize[_0xfed1('0x2')]},'accountcode':{'type':Sequelize[_0xfed1('0x2')]},'dnid':{'type':Sequelize[_0xfed1('0x2')]},'projectName':{'type':Sequelize[_0xfed1('0x2')]},'saveName':{'type':Sequelize[_0xfed1('0x2')]},'filename':{'type':Sequelize[_0xfed1('0x2')]},'savePath':{'type':Sequelize[_0xfed1('0x2')]},'format':{'type':Sequelize[_0xfed1('0x3')],'get':function(){var _0x612b38='';var _0x2a6082=this[_0xfed1('0x4')]('savePath');if(_0x2a6082){_0x612b38=_0x2a6082[_0xfed1('0x5')](_0x2a6082[_0xfed1('0x6')]('.'));}return _0x612b38;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 3c5300c..98dd697 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 _0xe57f=['fieldName','type','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','include','SquareRecording','findAll','rows','show','params','keys','includeAll','catch','create','body','find','download','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','Sequelize','ValidationError','SquareRecording\x20not\x20found','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format','rimraf','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','update','then','destroy','error','name','send','index','map','rawAttributes'];(function(_0x44474f,_0x431580){var _0x427d97=function(_0x53f7d4){while(--_0x53f7d4){_0x44474f['push'](_0x44474f['shift']());}};_0x427d97(++_0x431580);}(_0xe57f,0x1a3));var _0xfe57=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xe57f[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0xfe57('0x0'));var rimraf=require(_0xfe57('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfe57('0x2'));var Mustache=require(_0xfe57('0x3'));var util=require(_0xfe57('0x4'));var path=require('path');var sox=require(_0xfe57('0x5'));var csv=require(_0xfe57('0x6'));var ejs=require(_0xfe57('0x7'));var fs=require('fs');var fs_extra=require(_0xfe57('0x8'));var _=require(_0xfe57('0x9'));var squel=require(_0xfe57('0xa'));var crypto=require(_0xfe57('0xb'));var jsforce=require(_0xfe57('0xc'));var deskjs=require(_0xfe57('0xd'));var toCsv=require(_0xfe57('0x6'));var querystring=require(_0xfe57('0xe'));var Papa=require('papaparse');var Redis=require(_0xfe57('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfe57('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfe57('0x11'))('api');var utils=require(_0xfe57('0x12'));var config=require(_0xfe57('0x13'));var licenseUtil=require(_0xfe57('0x14'));var db=require(_0xfe57('0x15'))['db'];function respondWithStatusCode(_0x41aac4,_0x2d4453){_0x2d4453=_0x2d4453||0xcc;return function(_0x3e7082){if(_0x3e7082){return _0x41aac4[_0xfe57('0x16')](_0x2d4453);}return _0x41aac4[_0xfe57('0x17')](_0x2d4453)[_0xfe57('0x18')]();};}function respondWithResult(_0x499ae9,_0x767e2d){_0x767e2d=_0x767e2d||0xc8;return function(_0x371f23){if(_0x371f23){return _0x499ae9[_0xfe57('0x17')](_0x767e2d)['json'](_0x371f23);}};}function respondWithFilteredResult(_0x4f3385,_0x9add2e){return function(_0x2a3a3b){if(_0x2a3a3b){var _0x1a4dbe=typeof _0x9add2e[_0xfe57('0x19')]===_0xfe57('0x1a')&&typeof _0x9add2e[_0xfe57('0x1b')]==='undefined';var _0x2aefb5=_0x2a3a3b[_0xfe57('0x1c')];var _0x131a63=_0x1a4dbe?0x0:_0x9add2e['offset'];var _0x2fb216=_0x1a4dbe?_0x2a3a3b[_0xfe57('0x1c')]:_0x9add2e['offset']+_0x9add2e[_0xfe57('0x1b')];var _0x1178fc;if(_0x2fb216>=_0x2aefb5){_0x2fb216=_0x2aefb5;_0x1178fc=0xc8;}else{_0x1178fc=0xce;}_0x4f3385[_0xfe57('0x17')](_0x1178fc);return _0x4f3385[_0xfe57('0x1d')]('Content-Range',_0x131a63+'-'+_0x2fb216+'/'+_0x2aefb5)[_0xfe57('0x1e')](_0x2a3a3b);}return null;};}function patchUpdates(_0x344a24){return function(_0x402a5c){try{jsonpatch['apply'](_0x402a5c,_0x344a24,!![]);}catch(_0x2d4367){return BPromise[_0xfe57('0x1f')](_0x2d4367);}return _0x402a5c['save']();};}function saveUpdates(_0x31ed1d,_0x40f3c8){return function(_0x47721a){if(_0x47721a){return _0x47721a[_0xfe57('0x20')](_0x31ed1d)[_0xfe57('0x21')](function(_0x49a08d){return _0x49a08d;});}return null;};}function removeEntity(_0x5b1bd3,_0x4811c1){return function(_0x9387e8){if(_0x9387e8){return _0x9387e8[_0xfe57('0x22')]()[_0xfe57('0x21')](function(){_0x5b1bd3['status'](0xcc)[_0xfe57('0x18')]();});}};}function handleEntityNotFound(_0x21abc6,_0x200c8e){return function(_0xb02d98){if(!_0xb02d98){_0x21abc6[_0xfe57('0x16')](0x194);}return _0xb02d98;};}function handleError(_0x31b697,_0xb7e182){_0xb7e182=_0xb7e182||0x1f4;return function(_0x238138){logger[_0xfe57('0x23')](_0x238138['stack']);if(_0x238138[_0xfe57('0x24')]){delete _0x238138['name'];}_0x31b697['status'](_0xb7e182)[_0xfe57('0x25')](_0x238138);};}exports[_0xfe57('0x26')]=function(_0xcec83d,_0x195d62){var _0x4537e2={},_0x34de05={},_0x17277a={'count':0x0,'rows':[]};var _0x159525=_[_0xfe57('0x27')](db['SquareRecording'][_0xfe57('0x28')],function(_0x4a6c27){return{'name':_0x4a6c27[_0xfe57('0x29')],'type':_0x4a6c27[_0xfe57('0x2a')]['key']};});_0x34de05[_0xfe57('0x2b')]=_['map'](_0x159525,_0xfe57('0x24'));_0x34de05[_0xfe57('0x2c')]=_['keys'](_0xcec83d[_0xfe57('0x2c')]);_0x34de05['filters']=_['intersection'](_0x34de05[_0xfe57('0x2b')],_0x34de05[_0xfe57('0x2c')]);_0x4537e2[_0xfe57('0x2d')]=_[_0xfe57('0x2e')](_0x34de05[_0xfe57('0x2b')],qs['fields'](_0xcec83d[_0xfe57('0x2c')][_0xfe57('0x2f')]));_0x4537e2[_0xfe57('0x2d')]=_0x4537e2['attributes'][_0xfe57('0x30')]?_0x4537e2[_0xfe57('0x2d')]:_0x34de05[_0xfe57('0x2b')];if(!_0xcec83d[_0xfe57('0x2c')][_0xfe57('0x31')](_0xfe57('0x32'))){_0x4537e2[_0xfe57('0x1b')]=qs[_0xfe57('0x1b')](_0xcec83d[_0xfe57('0x2c')][_0xfe57('0x1b')]);_0x4537e2[_0xfe57('0x19')]=qs[_0xfe57('0x19')](_0xcec83d[_0xfe57('0x2c')][_0xfe57('0x19')]);}_0x4537e2['order']=qs[_0xfe57('0x33')](_0xcec83d[_0xfe57('0x2c')][_0xfe57('0x33')]);_0x4537e2[_0xfe57('0x34')]=qs[_0xfe57('0x35')](_['pick'](_0xcec83d[_0xfe57('0x2c')],_0x34de05['filters']),_0x159525);if(_0xcec83d[_0xfe57('0x2c')][_0xfe57('0x36')]){_0x4537e2['where']=_[_0xfe57('0x37')](_0x4537e2[_0xfe57('0x34')],{'$or':_[_0xfe57('0x27')](_0x159525,function(_0x5606b7){if(_0x5606b7[_0xfe57('0x2a')]!==_0xfe57('0x38')){var _0x3dca16={};_0x3dca16[_0x5606b7[_0xfe57('0x24')]]={'$like':'%'+_0xcec83d[_0xfe57('0x2c')][_0xfe57('0x36')]+'%'};return _0x3dca16;}})});}_0x4537e2=_['merge']({},_0x4537e2,_0xcec83d[_0xfe57('0x39')]);var _0x4e9b51={'where':_0x4537e2[_0xfe57('0x34')]};return db['SquareRecording']['count'](_0x4e9b51)[_0xfe57('0x21')](function(_0x17f63c){_0x17277a[_0xfe57('0x1c')]=_0x17f63c;if(_0xcec83d[_0xfe57('0x2c')]['includeAll']){_0x4537e2[_0xfe57('0x3a')]=[{'all':!![]}];}return db[_0xfe57('0x3b')][_0xfe57('0x3c')](_0x4537e2);})[_0xfe57('0x21')](function(_0x141875){_0x17277a[_0xfe57('0x3d')]=_0x141875;return _0x17277a;})[_0xfe57('0x21')](respondWithFilteredResult(_0x195d62,_0x4537e2))['catch'](handleError(_0x195d62,null));};exports[_0xfe57('0x3e')]=function(_0x3e5949,_0x2801a3){var _0x2489df={'raw':!![],'where':{'id':_0x3e5949[_0xfe57('0x3f')]['id']}},_0x377623={};_0x377623[_0xfe57('0x2b')]=_[_0xfe57('0x40')](db[_0xfe57('0x3b')][_0xfe57('0x28')]);_0x377623[_0xfe57('0x2c')]=_[_0xfe57('0x40')](_0x3e5949[_0xfe57('0x2c')]);_0x377623['filters']=_[_0xfe57('0x2e')](_0x377623[_0xfe57('0x2b')],_0x377623[_0xfe57('0x2c')]);_0x2489df[_0xfe57('0x2d')]=_[_0xfe57('0x2e')](_0x377623[_0xfe57('0x2b')],qs[_0xfe57('0x2f')](_0x3e5949['query'][_0xfe57('0x2f')]));_0x2489df[_0xfe57('0x2d')]=_0x2489df[_0xfe57('0x2d')][_0xfe57('0x30')]?_0x2489df[_0xfe57('0x2d')]:_0x377623['model'];if(_0x3e5949[_0xfe57('0x2c')][_0xfe57('0x41')]){_0x2489df[_0xfe57('0x3a')]=[{'all':!![]}];}_0x2489df=_[_0xfe57('0x37')]({},_0x2489df,_0x3e5949[_0xfe57('0x39')]);return db['SquareRecording']['find'](_0x2489df)['then'](handleEntityNotFound(_0x2801a3,null))[_0xfe57('0x21')](respondWithResult(_0x2801a3,null))[_0xfe57('0x42')](handleError(_0x2801a3,null));};exports[_0xfe57('0x43')]=function(_0x257bd5,_0x1a643f){return db['SquareRecording'][_0xfe57('0x43')](_0x257bd5[_0xfe57('0x44')],{})['then'](respondWithResult(_0x1a643f,0xc9))[_0xfe57('0x42')](handleError(_0x1a643f,null));};exports[_0xfe57('0x20')]=function(_0x21a840,_0x59dfa5){if(_0x21a840[_0xfe57('0x44')]['id']){delete _0x21a840['body']['id'];}return db[_0xfe57('0x3b')][_0xfe57('0x45')]({'where':{'id':_0x21a840[_0xfe57('0x3f')]['id']}})['then'](handleEntityNotFound(_0x59dfa5,null))[_0xfe57('0x21')](saveUpdates(_0x21a840[_0xfe57('0x44')],null))[_0xfe57('0x21')](respondWithResult(_0x59dfa5,null))['catch'](handleError(_0x59dfa5,null));};exports[_0xfe57('0x46')]=function(_0x3be55c,_0x473a13,_0x49666a){var _0x560144=require('../../components/encryptor');var _0x27504f=![];var _0x1d12ad={};if(_0x3be55c[_0xfe57('0x2c')]['type']&&_0x3be55c['query'][_0xfe57('0x2a')]===_0xfe57('0x47')){_0x1d12ad[_0xfe57('0x47')]=_0x3be55c[_0xfe57('0x3f')]['id'];}else{_0x1d12ad['id']=_0x3be55c[_0xfe57('0x3f')]['id'];}return db[_0xfe57('0x3b')][_0xfe57('0x45')]({'where':_0x1d12ad,'attributes':['id',_0xfe57('0x48'),_0xfe57('0x49')],'raw':!![]})['then'](handleEntityNotFound(_0x473a13,null))[_0xfe57('0x21')](function(_0x1c395a){if(_0x1c395a){var _0x2004c0=_0x1c395a[_0xfe57('0x48')];var _0x59285b=util[_0xfe57('0x4a')](_0xfe57('0x4b'),_0x2004c0);if(fs[_0xfe57('0x4c')](_0x59285b)){_0x27504f=!![];return _0x560144[_0xfe57('0x4d')](_0x59285b,_0x2004c0,config[_0xfe57('0x4e')]['recording'])[_0xfe57('0x21')](function(){return _0x1c395a;});}return _0x1c395a;}})[_0xfe57('0x21')](function(_0x23e2b5){if(_0x23e2b5){var _0x5161c2=_0x23e2b5[_0xfe57('0x48')];if(!fs[_0xfe57('0x4c')](_0x5161c2)){throw new db[(_0xfe57('0x4f'))][(_0xfe57('0x50'))](_0xfe57('0x51'));}if(_0x23e2b5[_0xfe57('0x49')]){return _0x473a13[_0xfe57('0x46')](_0x5161c2,_0x23e2b5[_0xfe57('0x49')]+path['extname'](_0x5161c2),function(){if(_0x27504f){fs[_0xfe57('0x52')](_0x5161c2);}});}else{return _0x473a13[_0xfe57('0x46')](_0x5161c2,function(_0xc991c1){if(_0x27504f){fs[_0xfe57('0x52')](_0x5161c2);}});}}})[_0xfe57('0x42')](function(_0x1fe78d){if(_0x1fe78d[_0xfe57('0x53')]===_0xfe57('0x51')){_0x473a13[_0xfe57('0x17')](0x194)[_0xfe57('0x25')](_0xfe57('0x54'));}else{return handleError(_0x473a13,null);}});};exports[_0xfe57('0x22')]=function(_0x368c7b,_0x570415){return db[_0xfe57('0x3b')][_0xfe57('0x45')]({'where':{'id':_0x368c7b['params']['id']}})['then'](function(_0x4969a2){if(_[_0xfe57('0x55')](_0x4969a2)){throw new ReferenceError(_0xfe57('0x56'));}return _0x4969a2;})['then'](function(_0x4d6317){var _0x390f4a=_0x4d6317[_0xfe57('0x48')];logger[_0xfe57('0x57')]('cancellazione\x20fisica\x20documento\x20%s',_0x390f4a);if(!_[_0xfe57('0x55')](_0x4d6317[_0xfe57('0x48')])&&fs[_0xfe57('0x4c')](_0x390f4a)){logger[_0xfe57('0x57')](_0xfe57('0x58')+_0x390f4a+_0xfe57('0x59'));fs['unlinkSync'](_0x390f4a);}_0x390f4a=_0x390f4a+_0xfe57('0x5a');if(!_[_0xfe57('0x55')](_0x4d6317[_0xfe57('0x48')])&&fs[_0xfe57('0x4c')](_0x390f4a)){logger[_0xfe57('0x57')](_0xfe57('0x58')+_0x390f4a+_0xfe57('0x59'));fs[_0xfe57('0x5b')](_0x390f4a);}return _0x4d6317;})['then'](function(_0x4a1d91){if(!_0x4a1d91)throw new InternalError();return _0x4a1d91[_0xfe57('0x22')]();})[_0xfe57('0x21')](function(){_0x570415[_0xfe57('0x17')](0xcc)[_0xfe57('0x18')]();})['catch'](handleError(_0x570415,null));}; \ No newline at end of file +var _0x4a71=['rimraf','request-promise','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','map','SquareRecording','rawAttributes','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','secrets','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x4a71,0x1d0));var _0x14a7=function(_0xd3a512,_0x5ef934){_0xd3a512=_0xd3a512-0x0;var _0x4b449d=_0x4a71[_0xd3a512];return _0x4b449d;};'use strict';var emlformat=require(_0x14a7('0x0'));var rimraf=require(_0x14a7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x14a7('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x14a7('0x3'));var sox=require(_0x14a7('0x4'));var csv=require(_0x14a7('0x5'));var ejs=require(_0x14a7('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x14a7('0x7'));var squel=require(_0x14a7('0x8'));var crypto=require(_0x14a7('0x9'));var jsforce=require(_0x14a7('0xa'));var deskjs=require(_0x14a7('0xb'));var toCsv=require(_0x14a7('0x5'));var querystring=require(_0x14a7('0xc'));var Papa=require(_0x14a7('0xd'));var Redis=require(_0x14a7('0xe'));var authService=require(_0x14a7('0xf'));var qs=require(_0x14a7('0x10'));var as=require(_0x14a7('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x14a7('0x12'))('api');var utils=require(_0x14a7('0x13'));var config=require(_0x14a7('0x14'));var licenseUtil=require(_0x14a7('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c6a4f,_0x2a6700){_0x2a6700=_0x2a6700||0xcc;return function(_0x2668d5){if(_0x2668d5){return _0x2c6a4f[_0x14a7('0x16')](_0x2a6700);}return _0x2c6a4f[_0x14a7('0x17')](_0x2a6700)[_0x14a7('0x18')]();};}function respondWithResult(_0x516f30,_0x18ca29){_0x18ca29=_0x18ca29||0xc8;return function(_0x99c61f){if(_0x99c61f){return _0x516f30['status'](_0x18ca29)[_0x14a7('0x19')](_0x99c61f);}};}function respondWithFilteredResult(_0x591575,_0x51b296){return function(_0x14712b){if(_0x14712b){var _0x5ca6df=typeof _0x51b296[_0x14a7('0x1a')]==='undefined'&&typeof _0x51b296[_0x14a7('0x1b')]===_0x14a7('0x1c');var _0x41f417=_0x14712b[_0x14a7('0x1d')];var _0x569f9f=_0x5ca6df?0x0:_0x51b296[_0x14a7('0x1a')];var _0x247217=_0x5ca6df?_0x14712b[_0x14a7('0x1d')]:_0x51b296[_0x14a7('0x1a')]+_0x51b296[_0x14a7('0x1b')];var _0x272ac7;if(_0x247217>=_0x41f417){_0x247217=_0x41f417;_0x272ac7=0xc8;}else{_0x272ac7=0xce;}_0x591575['status'](_0x272ac7);return _0x591575[_0x14a7('0x1e')](_0x14a7('0x1f'),_0x569f9f+'-'+_0x247217+'/'+_0x41f417)[_0x14a7('0x19')](_0x14712b);}return null;};}function patchUpdates(_0x1754b0){return function(_0x4a3ee2){try{jsonpatch[_0x14a7('0x20')](_0x4a3ee2,_0x1754b0,!![]);}catch(_0x179c30){return BPromise['reject'](_0x179c30);}return _0x4a3ee2[_0x14a7('0x21')]();};}function saveUpdates(_0x229f59,_0x350a9f){return function(_0xfacf00){if(_0xfacf00){return _0xfacf00[_0x14a7('0x22')](_0x229f59)['then'](function(_0x161ab7){return _0x161ab7;});}return null;};}function removeEntity(_0x1d3741,_0x25d308){return function(_0x5bdb12){if(_0x5bdb12){return _0x5bdb12[_0x14a7('0x23')]()[_0x14a7('0x24')](function(){_0x1d3741[_0x14a7('0x17')](0xcc)[_0x14a7('0x18')]();});}};}function handleEntityNotFound(_0x2d7855,_0x6eb658){return function(_0x2207d5){if(!_0x2207d5){_0x2d7855[_0x14a7('0x16')](0x194);}return _0x2207d5;};}function handleError(_0x2d3967,_0x2f8eba){_0x2f8eba=_0x2f8eba||0x1f4;return function(_0x3c57de){logger[_0x14a7('0x25')](_0x3c57de[_0x14a7('0x26')]);if(_0x3c57de[_0x14a7('0x27')]){delete _0x3c57de[_0x14a7('0x27')];}_0x2d3967['status'](_0x2f8eba)[_0x14a7('0x28')](_0x3c57de);};}exports[_0x14a7('0x29')]=function(_0x7743bf,_0x182fd8){var _0x4a1384={},_0x2eb313={},_0x4cc5f6={'count':0x0,'rows':[]};var _0x5ad9a6=_[_0x14a7('0x2a')](db[_0x14a7('0x2b')][_0x14a7('0x2c')],function(_0x175543){return{'name':_0x175543['fieldName'],'type':_0x175543[_0x14a7('0x2d')][_0x14a7('0x2e')]};});_0x2eb313['model']=_[_0x14a7('0x2a')](_0x5ad9a6,_0x14a7('0x27'));_0x2eb313[_0x14a7('0x2f')]=_['keys'](_0x7743bf[_0x14a7('0x2f')]);_0x2eb313[_0x14a7('0x30')]=_[_0x14a7('0x31')](_0x2eb313['model'],_0x2eb313[_0x14a7('0x2f')]);_0x4a1384[_0x14a7('0x32')]=_['intersection'](_0x2eb313[_0x14a7('0x33')],qs[_0x14a7('0x34')](_0x7743bf[_0x14a7('0x2f')][_0x14a7('0x34')]));_0x4a1384[_0x14a7('0x32')]=_0x4a1384['attributes'][_0x14a7('0x35')]?_0x4a1384[_0x14a7('0x32')]:_0x2eb313[_0x14a7('0x33')];if(!_0x7743bf['query'][_0x14a7('0x36')](_0x14a7('0x37'))){_0x4a1384['limit']=qs[_0x14a7('0x1b')](_0x7743bf[_0x14a7('0x2f')][_0x14a7('0x1b')]);_0x4a1384[_0x14a7('0x1a')]=qs[_0x14a7('0x1a')](_0x7743bf[_0x14a7('0x2f')]['offset']);}_0x4a1384[_0x14a7('0x38')]=qs['sort'](_0x7743bf[_0x14a7('0x2f')][_0x14a7('0x39')]);_0x4a1384[_0x14a7('0x3a')]=qs[_0x14a7('0x30')](_[_0x14a7('0x3b')](_0x7743bf[_0x14a7('0x2f')],_0x2eb313[_0x14a7('0x30')]),_0x5ad9a6);if(_0x7743bf[_0x14a7('0x2f')][_0x14a7('0x3c')]){_0x4a1384[_0x14a7('0x3a')]=_[_0x14a7('0x3d')](_0x4a1384[_0x14a7('0x3a')],{'$or':_[_0x14a7('0x2a')](_0x5ad9a6,function(_0x3c4edd){if(_0x3c4edd[_0x14a7('0x2d')]!==_0x14a7('0x3e')){var _0x1a5d8e={};_0x1a5d8e[_0x3c4edd[_0x14a7('0x27')]]={'$like':'%'+_0x7743bf[_0x14a7('0x2f')][_0x14a7('0x3c')]+'%'};return _0x1a5d8e;}})});}_0x4a1384=_[_0x14a7('0x3d')]({},_0x4a1384,_0x7743bf[_0x14a7('0x3f')]);var _0x3ea3f8={'where':_0x4a1384[_0x14a7('0x3a')]};return db[_0x14a7('0x2b')][_0x14a7('0x1d')](_0x3ea3f8)[_0x14a7('0x24')](function(_0x40336c){_0x4cc5f6[_0x14a7('0x1d')]=_0x40336c;if(_0x7743bf['query'][_0x14a7('0x40')]){_0x4a1384[_0x14a7('0x41')]=[{'all':!![]}];}return db[_0x14a7('0x2b')][_0x14a7('0x42')](_0x4a1384);})['then'](function(_0x13b90b){_0x4cc5f6['rows']=_0x13b90b;return _0x4cc5f6;})[_0x14a7('0x24')](respondWithFilteredResult(_0x182fd8,_0x4a1384))[_0x14a7('0x43')](handleError(_0x182fd8,null));};exports[_0x14a7('0x44')]=function(_0x541971,_0x5b40bf){var _0xd46bad={'raw':!![],'where':{'id':_0x541971[_0x14a7('0x45')]['id']}},_0x2c5c68={};_0x2c5c68[_0x14a7('0x33')]=_['keys'](db['SquareRecording'][_0x14a7('0x2c')]);_0x2c5c68[_0x14a7('0x2f')]=_[_0x14a7('0x46')](_0x541971['query']);_0x2c5c68[_0x14a7('0x30')]=_[_0x14a7('0x31')](_0x2c5c68[_0x14a7('0x33')],_0x2c5c68[_0x14a7('0x2f')]);_0xd46bad['attributes']=_[_0x14a7('0x31')](_0x2c5c68['model'],qs[_0x14a7('0x34')](_0x541971['query'][_0x14a7('0x34')]));_0xd46bad[_0x14a7('0x32')]=_0xd46bad[_0x14a7('0x32')][_0x14a7('0x35')]?_0xd46bad[_0x14a7('0x32')]:_0x2c5c68[_0x14a7('0x33')];if(_0x541971['query'][_0x14a7('0x40')]){_0xd46bad[_0x14a7('0x41')]=[{'all':!![]}];}_0xd46bad=_[_0x14a7('0x3d')]({},_0xd46bad,_0x541971['options']);return db[_0x14a7('0x2b')][_0x14a7('0x47')](_0xd46bad)[_0x14a7('0x24')](handleEntityNotFound(_0x5b40bf,null))['then'](respondWithResult(_0x5b40bf,null))[_0x14a7('0x43')](handleError(_0x5b40bf,null));};exports['create']=function(_0x16d077,_0x1eac2d){return db[_0x14a7('0x2b')][_0x14a7('0x48')](_0x16d077[_0x14a7('0x49')],{})[_0x14a7('0x24')](respondWithResult(_0x1eac2d,0xc9))['catch'](handleError(_0x1eac2d,null));};exports['update']=function(_0x1c852b,_0x19c916){if(_0x1c852b[_0x14a7('0x49')]['id']){delete _0x1c852b[_0x14a7('0x49')]['id'];}return db['SquareRecording'][_0x14a7('0x47')]({'where':{'id':_0x1c852b[_0x14a7('0x45')]['id']}})['then'](handleEntityNotFound(_0x19c916,null))['then'](saveUpdates(_0x1c852b[_0x14a7('0x49')],null))[_0x14a7('0x24')](respondWithResult(_0x19c916,null))[_0x14a7('0x43')](handleError(_0x19c916,null));};exports['download']=function(_0x5a18c3,_0x182743,_0x107c56){var _0x503ed0=require(_0x14a7('0x4a'));var _0x2c9567=![];var _0x326394={};if(_0x5a18c3[_0x14a7('0x2f')][_0x14a7('0x2d')]&&_0x5a18c3[_0x14a7('0x2f')][_0x14a7('0x2d')]===_0x14a7('0x4b')){_0x326394[_0x14a7('0x4b')]=_0x5a18c3[_0x14a7('0x45')]['id'];}else{_0x326394['id']=_0x5a18c3['params']['id'];}return db[_0x14a7('0x2b')][_0x14a7('0x47')]({'where':_0x326394,'attributes':['id',_0x14a7('0x4c'),_0x14a7('0x4d')],'raw':!![]})['then'](handleEntityNotFound(_0x182743,null))[_0x14a7('0x24')](function(_0x2aa939){if(_0x2aa939){var _0x17470d=_0x2aa939['savePath'];var _0x19696e=util[_0x14a7('0x4e')](_0x14a7('0x4f'),_0x17470d);if(fs[_0x14a7('0x50')](_0x19696e)){_0x2c9567=!![];return _0x503ed0['decryptFile'](_0x19696e,_0x17470d,config[_0x14a7('0x51')]['recording'])['then'](function(){return _0x2aa939;});}return _0x2aa939;}})[_0x14a7('0x24')](function(_0x5a98b6){if(_0x5a98b6){var _0x43dd78=_0x5a98b6[_0x14a7('0x4c')];if(!fs[_0x14a7('0x50')](_0x43dd78)){throw new db[(_0x14a7('0x52'))][(_0x14a7('0x53'))](_0x14a7('0x54'));}if(_0x5a98b6['filename']){return _0x182743['download'](_0x43dd78,_0x5a98b6['filename']+path[_0x14a7('0x55')](_0x43dd78),function(){if(_0x2c9567){fs[_0x14a7('0x56')](_0x43dd78);}});}else{return _0x182743['download'](_0x43dd78,function(_0x3f65fa){if(_0x2c9567){fs[_0x14a7('0x56')](_0x43dd78);}});}}})[_0x14a7('0x43')](function(_0x37e20d){if(_0x37e20d['message']==='SquareRecording\x20not\x20found'){_0x182743[_0x14a7('0x17')](0x194)[_0x14a7('0x28')]('Not\x20found');}else{return handleError(_0x182743,null);}});};exports[_0x14a7('0x23')]=function(_0x351a5c,_0x5558b6){return db[_0x14a7('0x2b')][_0x14a7('0x47')]({'where':{'id':_0x351a5c[_0x14a7('0x45')]['id']}})[_0x14a7('0x24')](function(_0x59b493){if(_[_0x14a7('0x57')](_0x59b493)){throw new ReferenceError('Entity\x20not\x20found');}return _0x59b493;})[_0x14a7('0x24')](function(_0x182832){var _0x3323e2=_0x182832[_0x14a7('0x4c')];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x3323e2);if(!_['isNil'](_0x182832['savePath'])&&fs[_0x14a7('0x50')](_0x3323e2)){logger[_0x14a7('0x58')](_0x14a7('0x59')+_0x3323e2+_0x14a7('0x5a'));fs['unlinkSync'](_0x3323e2);}_0x3323e2=_0x3323e2+_0x14a7('0x5b');if(!_['isNil'](_0x182832[_0x14a7('0x4c')])&&fs['existsSync'](_0x3323e2)){logger[_0x14a7('0x58')]('File:\x20\x22'+_0x3323e2+_0x14a7('0x5a'));fs[_0x14a7('0x5c')](_0x3323e2);}return _0x182832;})[_0x14a7('0x24')](function(_0x469bbd){if(!_0x469bbd)throw new InternalError();return _0x469bbd[_0x14a7('0x23')]();})[_0x14a7('0x24')](function(){_0x5558b6[_0x14a7('0x17')](0xcc)[_0x14a7('0x18')]();})[_0x14a7('0x43')](handleError(_0x5558b6,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index f922b5a..4e06862 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 _0xf55c=['request-promise','path','rimraf','./squareRecording.attributes','exports','SquareRecording','square_recordings','lodash','../../config/logger','api','moment','bluebird'];(function(_0x3a9661,_0x530b12){var _0x5bb119=function(_0x1278f){while(--_0x1278f){_0x3a9661['push'](_0x3a9661['shift']());}};_0x5bb119(++_0x530b12);}(_0xf55c,0x1e7));var _0xcf55=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xf55c[_0xf50820];return _0x2a9b10;};'use strict';var _=require(_0xcf55('0x0'));var util=require('util');var logger=require(_0xcf55('0x1'))(_0xcf55('0x2'));var moment=require(_0xcf55('0x3'));var BPromise=require(_0xcf55('0x4'));var rp=require(_0xcf55('0x5'));var fs=require('fs');var path=require(_0xcf55('0x6'));var rimraf=require(_0xcf55('0x7'));var config=require('../../config/environment');var attributes=require(_0xcf55('0x8'));module[_0xcf55('0x9')]=function(_0x14574c,_0x3a6de7){return _0x14574c['define'](_0xcf55('0xa'),attributes,{'tableName':_0xcf55('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7b77=['../../config/environment','./squareRecording.attributes','exports','define','square_recordings','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x193b8d,_0x4b794b){var _0x23659a=function(_0xf87999){while(--_0xf87999){_0x193b8d['push'](_0x193b8d['shift']());}};_0x23659a(++_0x4b794b);}(_0x7b77,0x179));var _0x77b7=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x7b77[_0x1cb18a];return _0x22442e;};'use strict';var _=require(_0x77b7('0x0'));var util=require(_0x77b7('0x1'));var logger=require(_0x77b7('0x2'))(_0x77b7('0x3'));var moment=require('moment');var BPromise=require(_0x77b7('0x4'));var rp=require(_0x77b7('0x5'));var fs=require('fs');var path=require(_0x77b7('0x6'));var rimraf=require('rimraf');var config=require(_0x77b7('0x7'));var attributes=require(_0x77b7('0x8'));module[_0x77b7('0x9')]=function(_0x3d97f0,_0x4556c1){return _0x3d97f0[_0x77b7('0xa')]('SquareRecording',attributes,{'tableName':_0x77b7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index d467ffe..736e2f0 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 _0xb12e=['debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','CreateSquareRecording','SquareRecording','create','body','options','raw','then','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','SquareRecording,\x20%s,\x20%s'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0xb12e,0x1e1));var _0xeb12=function(_0x300567,_0x4d97f0){_0x300567=_0x300567-0x0;var _0x4365cb=_0xb12e[_0x300567];return _0x4365cb;};'use strict';var _=require('lodash');var util=require(_0xeb12('0x0'));var moment=require(_0xeb12('0x1'));var BPromise=require(_0xeb12('0x2'));var rs=require(_0xeb12('0x3'));var fs=require('fs');var Redis=require(_0xeb12('0x4'));var db=require(_0xeb12('0x5'))['db'];var utils=require(_0xeb12('0x6'));var logger=require(_0xeb12('0x7'))(_0xeb12('0x8'));var config=require(_0xeb12('0x9'));var jayson=require(_0xeb12('0xa'));var client=jayson[_0xeb12('0xb')][_0xeb12('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1fbf8a,_0x5104e0,_0x3a95df){return new BPromise(function(_0x4039a7,_0x43abb0){return client[_0xeb12('0xd')](_0x1fbf8a,_0x3a95df)['then'](function(_0xfa6a65){logger['info'](_0xeb12('0xe'),_0x5104e0,'request\x20sent');logger[_0xeb12('0xf')](_0xeb12('0x10'),_0x5104e0,_0xeb12('0x11'),JSON[_0xeb12('0x12')](_0xfa6a65));if(_0xfa6a65[_0xeb12('0x13')]){if(_0xfa6a65[_0xeb12('0x13')][_0xeb12('0x14')]===0x1f4){logger[_0xeb12('0x13')](_0xeb12('0xe'),_0x5104e0,_0xfa6a65[_0xeb12('0x13')]['message']);return _0x43abb0(_0xfa6a65[_0xeb12('0x13')][_0xeb12('0x15')]);}logger['error']('SquareRecording,\x20%s,\x20%s',_0x5104e0,_0xfa6a65['error'][_0xeb12('0x15')]);return _0x4039a7(_0xfa6a65[_0xeb12('0x13')]['message']);}else{logger[_0xeb12('0x16')](_0xeb12('0xe'),_0x5104e0,_0xeb12('0x11'));_0x4039a7(_0xfa6a65['result'][_0xeb12('0x15')]);}})['catch'](function(_0xb9be7f){logger['error'](_0xeb12('0xe'),_0x5104e0,_0xb9be7f);_0x43abb0(_0xb9be7f);});});}exports[_0xeb12('0x17')]=function(_0x13303a){var _0x327705=this;return new Promise(function(_0x38902f,_0x577c44){return db[_0xeb12('0x18')][_0xeb12('0x19')](_0x13303a[_0xeb12('0x1a')],{'raw':_0x13303a[_0xeb12('0x1b')]?_0x13303a[_0xeb12('0x1b')][_0xeb12('0x1c')]===undefined?!![]:![]:!![]})[_0xeb12('0x1d')](function(_0x56c9e2){logger[_0xeb12('0x16')](_0xeb12('0x17'),_0x13303a);logger[_0xeb12('0xf')](_0xeb12('0x17'),_0x13303a,JSON['stringify'](_0x56c9e2));_0x38902f(_0x56c9e2);})[_0xeb12('0x1e')](function(_0x36c8ed){logger['error'](_0xeb12('0x17'),_0x36c8ed[_0xeb12('0x15')],_0x13303a);_0x577c44(_0x327705['error'](0x1f4,_0x36c8ed[_0xeb12('0x15')]));});});}; \ No newline at end of file +var _0x0ca9=['http','info','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','CreateSquareRecording','SquareRecording','create','options','raw','then','lodash','util','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client'];(function(_0xbbe7a8,_0x36a6b3){var _0x2f7ba4=function(_0xe195f7){while(--_0xe195f7){_0xbbe7a8['push'](_0xbbe7a8['shift']());}};_0x2f7ba4(++_0x36a6b3);}(_0x0ca9,0x99));var _0x90ca=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0ca9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x90ca('0x0'));var util=require(_0x90ca('0x1'));var moment=require('moment');var BPromise=require(_0x90ca('0x2'));var rs=require(_0x90ca('0x3'));var fs=require('fs');var Redis=require(_0x90ca('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x90ca('0x5'));var config=require(_0x90ca('0x6'));var jayson=require(_0x90ca('0x7'));var client=jayson[_0x90ca('0x8')][_0x90ca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4faf32,_0x1e31d2,_0x5995ec){return new BPromise(function(_0x6a6d1,_0x8365e6){return client['request'](_0x4faf32,_0x5995ec)['then'](function(_0x139917){logger[_0x90ca('0xa')](_0x90ca('0xb'),_0x1e31d2,'request\x20sent');logger[_0x90ca('0xc')](_0x90ca('0xd'),_0x1e31d2,'request\x20sent',JSON[_0x90ca('0xe')](_0x139917));if(_0x139917[_0x90ca('0xf')]){if(_0x139917['error'][_0x90ca('0x10')]===0x1f4){logger[_0x90ca('0xf')](_0x90ca('0xb'),_0x1e31d2,_0x139917[_0x90ca('0xf')][_0x90ca('0x11')]);return _0x8365e6(_0x139917[_0x90ca('0xf')][_0x90ca('0x11')]);}logger['error'](_0x90ca('0xb'),_0x1e31d2,_0x139917[_0x90ca('0xf')][_0x90ca('0x11')]);return _0x6a6d1(_0x139917[_0x90ca('0xf')][_0x90ca('0x11')]);}else{logger[_0x90ca('0xa')](_0x90ca('0xb'),_0x1e31d2,_0x90ca('0x12'));_0x6a6d1(_0x139917[_0x90ca('0x13')][_0x90ca('0x11')]);}})[_0x90ca('0x14')](function(_0x580987){logger[_0x90ca('0xf')](_0x90ca('0xb'),_0x1e31d2,_0x580987);_0x8365e6(_0x580987);});});}exports[_0x90ca('0x15')]=function(_0x1c96d6){var _0x1da559=this;return new Promise(function(_0x263db3,_0xf6ce97){return db[_0x90ca('0x16')][_0x90ca('0x17')](_0x1c96d6['body'],{'raw':_0x1c96d6[_0x90ca('0x18')]?_0x1c96d6[_0x90ca('0x18')][_0x90ca('0x19')]===undefined?!![]:![]:!![]})[_0x90ca('0x1a')](function(_0x443313){logger['info'](_0x90ca('0x15'),_0x1c96d6);logger['debug'](_0x90ca('0x15'),_0x1c96d6,JSON[_0x90ca('0xe')](_0x443313));_0x263db3(_0x443313);})[_0x90ca('0x14')](function(_0x40dbeb){logger[_0x90ca('0xf')](_0x90ca('0x15'),_0x40dbeb[_0x90ca('0x11')],_0x1c96d6);_0xf6ce97(_0x1da559[_0x90ca('0xf')](0x1f4,_0x40dbeb['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 96e20a8..b1859c5 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 _0xb10b=['../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x79e3c,_0x3cdcd4){var _0x190b2a=function(_0x11dca9){while(--_0x11dca9){_0x79e3c['push'](_0x79e3c['shift']());}};_0x190b2a(++_0x3cdcd4);}(_0xb10b,0x12a));var _0xbb10=function(_0x5d84d6,_0x1a4671){_0x5d84d6=_0x5d84d6-0x0;var _0x2cd0f5=_0xb10b[_0x5d84d6];return _0x2cd0f5;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x4171bf,_0x4322f3){var _0x18a433=function(_0x41c545){while(--_0x41c545){_0x4171bf['push'](_0x4171bf['shift']());}};_0x18a433(++_0x4322f3);}(_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('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index e804988..a02fee2 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 _0xabbf=['DATE','BOOLEAN','sequelize','exports','STRING'];(function(_0x5fc43f,_0xd310aa){var _0x439e29=function(_0x178f73){while(--_0x178f73){_0x5fc43f['push'](_0x5fc43f['shift']());}};_0x439e29(++_0xd310aa);}(_0xabbf,0x1a1));var _0xfabb=function(_0x527824,_0xc824a9){_0x527824=_0x527824-0x0;var _0xc8b8ed=_0xabbf[_0x527824];return _0xc8b8ed;};'use strict';var Sequelize=require(_0xfabb('0x0'));module[_0xfabb('0x1')]={'network':{'type':Sequelize[_0xfabb('0x2')]},'network_script':{'type':Sequelize[_0xfabb('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xfabb('0x2')]},'language':{'type':Sequelize[_0xfabb('0x2')]},'type':{'type':Sequelize[_0xfabb('0x2')]},'uniqueid':{'type':Sequelize[_0xfabb('0x2')]},'version':{'type':Sequelize[_0xfabb('0x2')]},'callerid':{'type':Sequelize[_0xfabb('0x2')]},'calleridname':{'type':Sequelize[_0xfabb('0x2')]},'callingpres':{'type':Sequelize[_0xfabb('0x2')]},'callingani2':{'type':Sequelize[_0xfabb('0x2')]},'callington':{'type':Sequelize[_0xfabb('0x2')]},'callingtns':{'type':Sequelize[_0xfabb('0x2')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0xfabb('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xfabb('0x2')]},'priority':{'type':Sequelize[_0xfabb('0x2')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xfabb('0x2')]},'threadid':{'type':Sequelize[_0xfabb('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xfabb('0x3')]},'bot':{'type':Sequelize[_0xfabb('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x200b=['BOOLEAN','sequelize','STRING','DATE'];(function(_0x215dc8,_0x52c245){var _0x583ea3=function(_0x32350d){while(--_0x32350d){_0x215dc8['push'](_0x215dc8['shift']());}};_0x583ea3(++_0x52c245);}(_0x200b,0x7d));var _0xb200=function(_0x206aac,_0x820337){_0x206aac=_0x206aac-0x0;var _0xd10a7d=_0x200b[_0x206aac];return _0xd10a7d;};'use strict';var Sequelize=require(_0xb200('0x0'));module['exports']={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0xb200('0x1')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xb200('0x1')]},'language':{'type':Sequelize[_0xb200('0x1')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xb200('0x1')]},'version':{'type':Sequelize[_0xb200('0x1')]},'callerid':{'type':Sequelize[_0xb200('0x1')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0xb200('0x1')]},'callingani2':{'type':Sequelize[_0xb200('0x1')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0xb200('0x1')]},'rdnis':{'type':Sequelize[_0xb200('0x1')]},'context':{'type':Sequelize[_0xb200('0x1')]},'extension':{'type':Sequelize[_0xb200('0x1')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0xb200('0x1')]},'project_name':{'type':Sequelize[_0xb200('0x1')]},'joinAt':{'type':Sequelize[_0xb200('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0xb200('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 9c35582..6d24204 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 _0x9500=['limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','includeAll','findAll','rows','catch','params','keys','merge','options','find','create','body','describe','eml-format','zip-dir','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined'];(function(_0x3e5a3a,_0x4d9f26){var _0x26ea10=function(_0x34bede){while(--_0x34bede){_0x3e5a3a['push'](_0x3e5a3a['shift']());}};_0x26ea10(++_0x4d9f26);}(_0x9500,0x1b7));var _0x0950=function(_0x380c6e,_0x536610){_0x380c6e=_0x380c6e-0x0;var _0x25828c=_0x9500[_0x380c6e];return _0x25828c;};'use strict';var emlformat=require(_0x0950('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0950('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0950('0x2'));var BPromise=require(_0x0950('0x3'));var Mustache=require(_0x0950('0x4'));var util=require(_0x0950('0x5'));var path=require(_0x0950('0x6'));var sox=require('sox');var csv=require(_0x0950('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0950('0x8'));var _=require(_0x0950('0x9'));var squel=require(_0x0950('0xa'));var crypto=require(_0x0950('0xb'));var jsforce=require(_0x0950('0xc'));var deskjs=require(_0x0950('0xd'));var toCsv=require(_0x0950('0x7'));var querystring=require(_0x0950('0xe'));var Papa=require(_0x0950('0xf'));var Redis=require(_0x0950('0x10'));var authService=require(_0x0950('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0950('0x12'));var hardwareService=require(_0x0950('0x13'));var logger=require('../../config/logger')(_0x0950('0x14'));var utils=require(_0x0950('0x15'));var config=require(_0x0950('0x16'));var licenseUtil=require(_0x0950('0x17'));var db=require(_0x0950('0x18'))['db'];function respondWithStatusCode(_0x2a0faa,_0xfceec6){_0xfceec6=_0xfceec6||0xcc;return function(_0x17c547){if(_0x17c547){return _0x2a0faa[_0x0950('0x19')](_0xfceec6);}return _0x2a0faa[_0x0950('0x1a')](_0xfceec6)['end']();};}function respondWithResult(_0x354632,_0x20cf91){_0x20cf91=_0x20cf91||0xc8;return function(_0x505795){if(_0x505795){return _0x354632[_0x0950('0x1a')](_0x20cf91)[_0x0950('0x1b')](_0x505795);}};}function respondWithFilteredResult(_0x4ac050,_0x24d8de){return function(_0x2b2939){if(_0x2b2939){var _0x456632=typeof _0x24d8de['offset']===_0x0950('0x1c')&&typeof _0x24d8de[_0x0950('0x1d')]===_0x0950('0x1c');var _0x36d84d=_0x2b2939[_0x0950('0x1e')];var _0x24a458=_0x456632?0x0:_0x24d8de[_0x0950('0x1f')];var _0x457006=_0x456632?_0x2b2939[_0x0950('0x1e')]:_0x24d8de['offset']+_0x24d8de['limit'];var _0x69831c;if(_0x457006>=_0x36d84d){_0x457006=_0x36d84d;_0x69831c=0xc8;}else{_0x69831c=0xce;}_0x4ac050[_0x0950('0x1a')](_0x69831c);return _0x4ac050[_0x0950('0x20')](_0x0950('0x21'),_0x24a458+'-'+_0x457006+'/'+_0x36d84d)[_0x0950('0x1b')](_0x2b2939);}return null;};}function patchUpdates(_0x1b4fa2){return function(_0x84d6c5){try{jsonpatch[_0x0950('0x22')](_0x84d6c5,_0x1b4fa2,!![]);}catch(_0x370e65){return BPromise[_0x0950('0x23')](_0x370e65);}return _0x84d6c5[_0x0950('0x24')]();};}function saveUpdates(_0x38eb9f,_0x5d37c5){return function(_0x1517d4){if(_0x1517d4){return _0x1517d4[_0x0950('0x25')](_0x38eb9f)[_0x0950('0x26')](function(_0x13cc04){return _0x13cc04;});}return null;};}function removeEntity(_0x4bbabc,_0x2199d1){return function(_0x116adc){if(_0x116adc){return _0x116adc[_0x0950('0x27')]()['then'](function(){_0x4bbabc['status'](0xcc)[_0x0950('0x28')]();});}};}function handleEntityNotFound(_0x5271a9,_0x48fafe){return function(_0x42cbd9){if(!_0x42cbd9){_0x5271a9[_0x0950('0x19')](0x194);}return _0x42cbd9;};}function handleError(_0x4a5893,_0x220d31){_0x220d31=_0x220d31||0x1f4;return function(_0x2de0d8){logger[_0x0950('0x29')](_0x2de0d8[_0x0950('0x2a')]);if(_0x2de0d8[_0x0950('0x2b')]){delete _0x2de0d8['name'];}_0x4a5893[_0x0950('0x1a')](_0x220d31)[_0x0950('0x2c')](_0x2de0d8);};}exports[_0x0950('0x2d')]=function(_0x35ac5c,_0x67bf9a){var _0x518224={},_0x4adad6={},_0xd26f93={'count':0x0,'rows':[]};var _0x24c80b=_[_0x0950('0x2e')](db[_0x0950('0x2f')][_0x0950('0x30')],function(_0x42f748){return{'name':_0x42f748[_0x0950('0x31')],'type':_0x42f748[_0x0950('0x32')][_0x0950('0x33')]};});_0x4adad6[_0x0950('0x34')]=_[_0x0950('0x2e')](_0x24c80b,_0x0950('0x2b'));_0x4adad6[_0x0950('0x35')]=_['keys'](_0x35ac5c[_0x0950('0x35')]);_0x4adad6['filters']=_[_0x0950('0x36')](_0x4adad6['model'],_0x4adad6[_0x0950('0x35')]);_0x518224[_0x0950('0x37')]=_['intersection'](_0x4adad6[_0x0950('0x34')],qs[_0x0950('0x38')](_0x35ac5c['query'][_0x0950('0x38')]));_0x518224[_0x0950('0x37')]=_0x518224[_0x0950('0x37')]['length']?_0x518224[_0x0950('0x37')]:_0x4adad6[_0x0950('0x34')];if(!_0x35ac5c[_0x0950('0x35')][_0x0950('0x39')](_0x0950('0x3a'))){_0x518224['limit']=qs['limit'](_0x35ac5c[_0x0950('0x35')]['limit']);_0x518224['offset']=qs['offset'](_0x35ac5c[_0x0950('0x35')][_0x0950('0x1f')]);}_0x518224[_0x0950('0x3b')]=qs[_0x0950('0x3c')](_0x35ac5c[_0x0950('0x35')]['sort']);_0x518224[_0x0950('0x3d')]=qs[_0x0950('0x3e')](_[_0x0950('0x3f')](_0x35ac5c[_0x0950('0x35')],_0x4adad6[_0x0950('0x3e')]),_0x24c80b);if(_0x35ac5c[_0x0950('0x35')][_0x0950('0x40')]){_0x518224[_0x0950('0x3d')]=_['merge'](_0x518224[_0x0950('0x3d')],{'$or':_['map'](_0x24c80b,function(_0x2f0647){if(_0x2f0647[_0x0950('0x32')]!==_0x0950('0x41')){var _0x3658a9={};_0x3658a9[_0x2f0647[_0x0950('0x2b')]]={'$like':'%'+_0x35ac5c[_0x0950('0x35')]['filter']+'%'};return _0x3658a9;}})});}_0x518224=_['merge']({},_0x518224,_0x35ac5c['options']);var _0x4c2dfe={'where':_0x518224[_0x0950('0x3d')]};return db[_0x0950('0x2f')][_0x0950('0x1e')](_0x4c2dfe)[_0x0950('0x26')](function(_0x11f267){_0xd26f93['count']=_0x11f267;if(_0x35ac5c[_0x0950('0x35')][_0x0950('0x42')]){_0x518224['include']=[{'all':!![]}];}return db['SquareReport'][_0x0950('0x43')](_0x518224);})[_0x0950('0x26')](function(_0x544837){_0xd26f93[_0x0950('0x44')]=_0x544837;return _0xd26f93;})[_0x0950('0x26')](respondWithFilteredResult(_0x67bf9a,_0x518224))[_0x0950('0x45')](handleError(_0x67bf9a,null));};exports['show']=function(_0x213c1a,_0x3120c3){var _0x12a22f={'raw':!![],'where':{'id':_0x213c1a[_0x0950('0x46')]['id']}},_0x42aebf={};_0x42aebf[_0x0950('0x34')]=_['keys'](db[_0x0950('0x2f')][_0x0950('0x30')]);_0x42aebf[_0x0950('0x35')]=_[_0x0950('0x47')](_0x213c1a['query']);_0x42aebf[_0x0950('0x3e')]=_[_0x0950('0x36')](_0x42aebf[_0x0950('0x34')],_0x42aebf[_0x0950('0x35')]);_0x12a22f[_0x0950('0x37')]=_[_0x0950('0x36')](_0x42aebf[_0x0950('0x34')],qs[_0x0950('0x38')](_0x213c1a[_0x0950('0x35')][_0x0950('0x38')]));_0x12a22f[_0x0950('0x37')]=_0x12a22f[_0x0950('0x37')]['length']?_0x12a22f['attributes']:_0x42aebf[_0x0950('0x34')];if(_0x213c1a[_0x0950('0x35')][_0x0950('0x42')]){_0x12a22f['include']=[{'all':!![]}];}_0x12a22f=_[_0x0950('0x48')]({},_0x12a22f,_0x213c1a[_0x0950('0x49')]);return db[_0x0950('0x2f')][_0x0950('0x4a')](_0x12a22f)['then'](handleEntityNotFound(_0x3120c3,null))[_0x0950('0x26')](respondWithResult(_0x3120c3,null))[_0x0950('0x45')](handleError(_0x3120c3,null));};exports[_0x0950('0x4b')]=function(_0x5b1619,_0x32baac){return db['SquareReport'][_0x0950('0x4b')](_0x5b1619[_0x0950('0x4c')],{})[_0x0950('0x26')](respondWithResult(_0x32baac,0xc9))[_0x0950('0x45')](handleError(_0x32baac,null));};exports[_0x0950('0x25')]=function(_0x5dcfc2,_0x1b0c18){if(_0x5dcfc2[_0x0950('0x4c')]['id']){delete _0x5dcfc2[_0x0950('0x4c')]['id'];}return db[_0x0950('0x2f')][_0x0950('0x4a')]({'where':{'id':_0x5dcfc2[_0x0950('0x46')]['id']}})[_0x0950('0x26')](handleEntityNotFound(_0x1b0c18,null))[_0x0950('0x26')](saveUpdates(_0x5dcfc2['body'],null))[_0x0950('0x26')](respondWithResult(_0x1b0c18,null))[_0x0950('0x45')](handleError(_0x1b0c18,null));};exports[_0x0950('0x27')]=function(_0x1c4228,_0x1ed99b){return db[_0x0950('0x2f')][_0x0950('0x4a')]({'where':{'id':_0x1c4228[_0x0950('0x46')]['id']}})['then'](handleEntityNotFound(_0x1ed99b,null))[_0x0950('0x26')](removeEntity(_0x1ed99b,null))[_0x0950('0x45')](handleError(_0x1ed99b,null));};exports['describe']=function(_0xee2fa,_0x197085){return db[_0x0950('0x2f')][_0x0950('0x4d')]()[_0x0950('0x26')](respondWithResult(_0x197085,null))['catch'](handleError(_0x197085,null));}; \ No newline at end of file +var _0x59a7=['fast-json-patch','request-promise','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','filter','merge','options','SquareReport','include','findAll','rows','catch','params','keys','length','includeAll','find','create','body','destroy','describe','eml-format','rimraf','zip-dir'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x59a7,0x8f));var _0x759a=function(_0x123281,_0x80da8e){_0x123281=_0x123281-0x0;var _0xec9f4=_0x59a7[_0x123281];return _0xec9f4;};'use strict';var emlformat=require(_0x759a('0x0'));var rimraf=require(_0x759a('0x1'));var zipdir=require(_0x759a('0x2'));var jsonpatch=require(_0x759a('0x3'));var rp=require(_0x759a('0x4'));var moment=require('moment');var BPromise=require(_0x759a('0x5'));var Mustache=require(_0x759a('0x6'));var util=require(_0x759a('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x759a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x759a('0x9'));var _=require(_0x759a('0xa'));var squel=require(_0x759a('0xb'));var crypto=require(_0x759a('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x759a('0x8'));var querystring=require(_0x759a('0xd'));var Papa=require(_0x759a('0xe'));var Redis=require(_0x759a('0xf'));var authService=require(_0x759a('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x759a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x759a('0x12'));var utils=require(_0x759a('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x759a('0x14'));var db=require(_0x759a('0x15'))['db'];function respondWithStatusCode(_0x19615b,_0x589697){_0x589697=_0x589697||0xcc;return function(_0x19d615){if(_0x19d615){return _0x19615b['sendStatus'](_0x589697);}return _0x19615b[_0x759a('0x16')](_0x589697)[_0x759a('0x17')]();};}function respondWithResult(_0x1d8a74,_0x25a481){_0x25a481=_0x25a481||0xc8;return function(_0x567bab){if(_0x567bab){return _0x1d8a74[_0x759a('0x16')](_0x25a481)[_0x759a('0x18')](_0x567bab);}};}function respondWithFilteredResult(_0x52e329,_0x5a5c35){return function(_0x469c20){if(_0x469c20){var _0x555b6b=typeof _0x5a5c35['offset']===_0x759a('0x19')&&typeof _0x5a5c35[_0x759a('0x1a')]===_0x759a('0x19');var _0x1486f7=_0x469c20[_0x759a('0x1b')];var _0xf091c1=_0x555b6b?0x0:_0x5a5c35[_0x759a('0x1c')];var _0x300a59=_0x555b6b?_0x469c20['count']:_0x5a5c35[_0x759a('0x1c')]+_0x5a5c35[_0x759a('0x1a')];var _0x4771fe;if(_0x300a59>=_0x1486f7){_0x300a59=_0x1486f7;_0x4771fe=0xc8;}else{_0x4771fe=0xce;}_0x52e329[_0x759a('0x16')](_0x4771fe);return _0x52e329['set'](_0x759a('0x1d'),_0xf091c1+'-'+_0x300a59+'/'+_0x1486f7)[_0x759a('0x18')](_0x469c20);}return null;};}function patchUpdates(_0x2e82ba){return function(_0x1719e1){try{jsonpatch[_0x759a('0x1e')](_0x1719e1,_0x2e82ba,!![]);}catch(_0x47fb24){return BPromise[_0x759a('0x1f')](_0x47fb24);}return _0x1719e1['save']();};}function saveUpdates(_0x3ef420,_0x221417){return function(_0x49feca){if(_0x49feca){return _0x49feca[_0x759a('0x20')](_0x3ef420)[_0x759a('0x21')](function(_0x202889){return _0x202889;});}return null;};}function removeEntity(_0x2e3d5c,_0x5855b1){return function(_0x41afd6){if(_0x41afd6){return _0x41afd6['destroy']()[_0x759a('0x21')](function(){_0x2e3d5c[_0x759a('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a9b62,_0x1a8e16){return function(_0x2dc911){if(!_0x2dc911){_0x4a9b62['sendStatus'](0x194);}return _0x2dc911;};}function handleError(_0x5d6fa9,_0x3a11ce){_0x3a11ce=_0x3a11ce||0x1f4;return function(_0x4443fe){logger[_0x759a('0x22')](_0x4443fe[_0x759a('0x23')]);if(_0x4443fe[_0x759a('0x24')]){delete _0x4443fe['name'];}_0x5d6fa9[_0x759a('0x16')](_0x3a11ce)[_0x759a('0x25')](_0x4443fe);};}exports[_0x759a('0x26')]=function(_0x1aa4d4,_0x4912ff){var _0x1f1d6c={},_0x3803ed={},_0x1c6f74={'count':0x0,'rows':[]};var _0x23a6f8=_[_0x759a('0x27')](db['SquareReport'][_0x759a('0x28')],function(_0x12e7e4){return{'name':_0x12e7e4[_0x759a('0x29')],'type':_0x12e7e4['type'][_0x759a('0x2a')]};});_0x3803ed[_0x759a('0x2b')]=_[_0x759a('0x27')](_0x23a6f8,'name');_0x3803ed[_0x759a('0x2c')]=_['keys'](_0x1aa4d4[_0x759a('0x2c')]);_0x3803ed[_0x759a('0x2d')]=_[_0x759a('0x2e')](_0x3803ed[_0x759a('0x2b')],_0x3803ed[_0x759a('0x2c')]);_0x1f1d6c[_0x759a('0x2f')]=_[_0x759a('0x2e')](_0x3803ed[_0x759a('0x2b')],qs[_0x759a('0x30')](_0x1aa4d4[_0x759a('0x2c')]['fields']));_0x1f1d6c['attributes']=_0x1f1d6c['attributes']['length']?_0x1f1d6c[_0x759a('0x2f')]:_0x3803ed[_0x759a('0x2b')];if(!_0x1aa4d4[_0x759a('0x2c')][_0x759a('0x31')](_0x759a('0x32'))){_0x1f1d6c[_0x759a('0x1a')]=qs[_0x759a('0x1a')](_0x1aa4d4['query']['limit']);_0x1f1d6c[_0x759a('0x1c')]=qs[_0x759a('0x1c')](_0x1aa4d4[_0x759a('0x2c')]['offset']);}_0x1f1d6c['order']=qs[_0x759a('0x33')](_0x1aa4d4['query'][_0x759a('0x33')]);_0x1f1d6c[_0x759a('0x34')]=qs[_0x759a('0x2d')](_[_0x759a('0x35')](_0x1aa4d4[_0x759a('0x2c')],_0x3803ed['filters']),_0x23a6f8);if(_0x1aa4d4[_0x759a('0x2c')]['filter']){_0x1f1d6c['where']=_['merge'](_0x1f1d6c[_0x759a('0x34')],{'$or':_[_0x759a('0x27')](_0x23a6f8,function(_0x5cf58a){if(_0x5cf58a[_0x759a('0x36')]!==_0x759a('0x37')){var _0x3e98c3={};_0x3e98c3[_0x5cf58a['name']]={'$like':'%'+_0x1aa4d4['query'][_0x759a('0x38')]+'%'};return _0x3e98c3;}})});}_0x1f1d6c=_[_0x759a('0x39')]({},_0x1f1d6c,_0x1aa4d4[_0x759a('0x3a')]);var _0x32c545={'where':_0x1f1d6c[_0x759a('0x34')]};return db[_0x759a('0x3b')][_0x759a('0x1b')](_0x32c545)['then'](function(_0x1ff142){_0x1c6f74[_0x759a('0x1b')]=_0x1ff142;if(_0x1aa4d4[_0x759a('0x2c')]['includeAll']){_0x1f1d6c[_0x759a('0x3c')]=[{'all':!![]}];}return db['SquareReport'][_0x759a('0x3d')](_0x1f1d6c);})['then'](function(_0x3481de){_0x1c6f74[_0x759a('0x3e')]=_0x3481de;return _0x1c6f74;})['then'](respondWithFilteredResult(_0x4912ff,_0x1f1d6c))[_0x759a('0x3f')](handleError(_0x4912ff,null));};exports['show']=function(_0x1a40b8,_0x124d51){var _0x3e4608={'raw':!![],'where':{'id':_0x1a40b8[_0x759a('0x40')]['id']}},_0x3f4599={};_0x3f4599[_0x759a('0x2b')]=_[_0x759a('0x41')](db['SquareReport'][_0x759a('0x28')]);_0x3f4599[_0x759a('0x2c')]=_[_0x759a('0x41')](_0x1a40b8['query']);_0x3f4599[_0x759a('0x2d')]=_[_0x759a('0x2e')](_0x3f4599['model'],_0x3f4599['query']);_0x3e4608[_0x759a('0x2f')]=_[_0x759a('0x2e')](_0x3f4599[_0x759a('0x2b')],qs[_0x759a('0x30')](_0x1a40b8[_0x759a('0x2c')][_0x759a('0x30')]));_0x3e4608[_0x759a('0x2f')]=_0x3e4608[_0x759a('0x2f')][_0x759a('0x42')]?_0x3e4608[_0x759a('0x2f')]:_0x3f4599[_0x759a('0x2b')];if(_0x1a40b8[_0x759a('0x2c')][_0x759a('0x43')]){_0x3e4608[_0x759a('0x3c')]=[{'all':!![]}];}_0x3e4608=_[_0x759a('0x39')]({},_0x3e4608,_0x1a40b8[_0x759a('0x3a')]);return db['SquareReport'][_0x759a('0x44')](_0x3e4608)[_0x759a('0x21')](handleEntityNotFound(_0x124d51,null))[_0x759a('0x21')](respondWithResult(_0x124d51,null))[_0x759a('0x3f')](handleError(_0x124d51,null));};exports[_0x759a('0x45')]=function(_0x4ccc1a,_0x350fa1){return db['SquareReport'][_0x759a('0x45')](_0x4ccc1a['body'],{})[_0x759a('0x21')](respondWithResult(_0x350fa1,0xc9))[_0x759a('0x3f')](handleError(_0x350fa1,null));};exports[_0x759a('0x20')]=function(_0x2a8004,_0x104ddc){if(_0x2a8004['body']['id']){delete _0x2a8004[_0x759a('0x46')]['id'];}return db[_0x759a('0x3b')][_0x759a('0x44')]({'where':{'id':_0x2a8004[_0x759a('0x40')]['id']}})['then'](handleEntityNotFound(_0x104ddc,null))[_0x759a('0x21')](saveUpdates(_0x2a8004['body'],null))['then'](respondWithResult(_0x104ddc,null))[_0x759a('0x3f')](handleError(_0x104ddc,null));};exports[_0x759a('0x47')]=function(_0x51e5eb,_0x1779a9){return db[_0x759a('0x3b')]['find']({'where':{'id':_0x51e5eb[_0x759a('0x40')]['id']}})[_0x759a('0x21')](handleEntityNotFound(_0x1779a9,null))[_0x759a('0x21')](removeEntity(_0x1779a9,null))[_0x759a('0x3f')](handleError(_0x1779a9,null));};exports['describe']=function(_0x59c052,_0xf15ad6){return db[_0x759a('0x3b')][_0x759a('0x48')]()[_0x759a('0x21')](respondWithResult(_0xf15ad6,null))[_0x759a('0x3f')](handleError(_0xf15ad6,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 04ad3ea..8a4ceca 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 _0x24a3=['define','SquareReport','uid_pname','uniqueid','leaveAt','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports'];(function(_0x1c0807,_0x48f2e1){var _0x5d3cc1=function(_0x1cc12c){while(--_0x1cc12c){_0x1c0807['push'](_0x1c0807['shift']());}};_0x5d3cc1(++_0x48f2e1);}(_0x24a3,0x6e));var _0x324a=function(_0x5a97b9,_0x2bc4bd){_0x5a97b9=_0x5a97b9-0x0;var _0x108139=_0x24a3[_0x5a97b9];return _0x108139;};'use strict';var _=require(_0x324a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x324a('0x1'));var moment=require(_0x324a('0x2'));var BPromise=require(_0x324a('0x3'));var rp=require(_0x324a('0x4'));var fs=require('fs');var path=require(_0x324a('0x5'));var rimraf=require(_0x324a('0x6'));var config=require(_0x324a('0x7'));var attributes=require(_0x324a('0x8'));module[_0x324a('0x9')]=function(_0x1eb935,_0x5942a4){return _0x1eb935[_0x324a('0xa')](_0x324a('0xb'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x324a('0xc'),'fields':[_0x324a('0xd'),'project_name']},{'name':'leaveAt','fields':[_0x324a('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc9fa=['uid_pname','uniqueid','project_name','leaveAt','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./squareReport.attributes','exports','define','report_square'];(function(_0x37afab,_0x20ba27){var _0x3d5018=function(_0x5968fc){while(--_0x5968fc){_0x37afab['push'](_0x37afab['shift']());}};_0x3d5018(++_0x20ba27);}(_0xc9fa,0x1a8));var _0xac9f=function(_0x4dd210,_0x585025){_0x4dd210=_0x4dd210-0x0;var _0x48885f=_0xc9fa[_0x4dd210];return _0x48885f;};'use strict';var _=require('lodash');var util=require(_0xac9f('0x0'));var logger=require(_0xac9f('0x1'))('api');var moment=require(_0xac9f('0x2'));var BPromise=require('bluebird');var rp=require(_0xac9f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xac9f('0x4'));var config=require(_0xac9f('0x5'));var attributes=require(_0xac9f('0x6'));module[_0xac9f('0x7')]=function(_0x187b71,_0x2cdc90){return _0x187b71[_0xac9f('0x8')]('SquareReport',attributes,{'tableName':_0xac9f('0x9'),'paranoid':![],'indexes':[{'name':_0xac9f('0xa'),'fields':[_0xac9f('0xb'),_0xac9f('0xc')]},{'name':'leaveAt','fields':[_0xac9f('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index c03da1e..b7cd5f1 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 _0xe162=['util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareReport','SquareReport','create','body','options','raw','UpdateSquareReport','update','where','limit','lodash'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xe162,0xa4));var _0x2e16=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xe162[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x2e16('0x0'));var util=require(_0x2e16('0x1'));var moment=require(_0x2e16('0x2'));var BPromise=require('bluebird');var rs=require(_0x2e16('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2e16('0x4'))['db'];var utils=require(_0x2e16('0x5'));var logger=require(_0x2e16('0x6'))(_0x2e16('0x7'));var config=require(_0x2e16('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2e16('0x9')][_0x2e16('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d3c40,_0x4e9227,_0x410daf){return new BPromise(function(_0x2028f2,_0x39fe2d){return client['request'](_0x5d3c40,_0x410daf)[_0x2e16('0xb')](function(_0x1e52a5){logger[_0x2e16('0xc')](_0x2e16('0xd'),_0x4e9227,_0x2e16('0xe'));logger[_0x2e16('0xf')](_0x2e16('0x10'),_0x4e9227,_0x2e16('0xe'),JSON[_0x2e16('0x11')](_0x1e52a5));if(_0x1e52a5['error']){if(_0x1e52a5[_0x2e16('0x12')][_0x2e16('0x13')]===0x1f4){logger[_0x2e16('0x12')](_0x2e16('0xd'),_0x4e9227,_0x1e52a5[_0x2e16('0x12')][_0x2e16('0x14')]);return _0x39fe2d(_0x1e52a5[_0x2e16('0x12')][_0x2e16('0x14')]);}logger[_0x2e16('0x12')](_0x2e16('0xd'),_0x4e9227,_0x1e52a5[_0x2e16('0x12')][_0x2e16('0x14')]);return _0x2028f2(_0x1e52a5[_0x2e16('0x12')][_0x2e16('0x14')]);}else{logger[_0x2e16('0xc')](_0x2e16('0xd'),_0x4e9227,_0x2e16('0xe'));_0x2028f2(_0x1e52a5[_0x2e16('0x15')][_0x2e16('0x14')]);}})[_0x2e16('0x16')](function(_0x4fa643){logger['error'](_0x2e16('0xd'),_0x4e9227,_0x4fa643);_0x39fe2d(_0x4fa643);});});}exports[_0x2e16('0x17')]=function(_0xa0672c){var _0x4c882b=this;return new Promise(function(_0x2e007c,_0x451ca9){return db[_0x2e16('0x18')][_0x2e16('0x19')](_0xa0672c[_0x2e16('0x1a')],{'raw':_0xa0672c[_0x2e16('0x1b')]?_0xa0672c[_0x2e16('0x1b')][_0x2e16('0x1c')]===undefined?!![]:![]:!![]})[_0x2e16('0xb')](function(_0x1c6abf){logger[_0x2e16('0xc')](_0x2e16('0x17'),_0xa0672c);logger['debug'](_0x2e16('0x17'),_0xa0672c,JSON['stringify'](_0x1c6abf));_0x2e007c(_0x1c6abf);})[_0x2e16('0x16')](function(_0x5af110){logger['error'](_0x2e16('0x17'),_0x5af110[_0x2e16('0x14')],_0xa0672c);_0x451ca9(_0x4c882b[_0x2e16('0x12')](0x1f4,_0x5af110[_0x2e16('0x14')]));});});};exports[_0x2e16('0x1d')]=function(_0x31a28c){var _0x27c88d=this;return new Promise(function(_0x35947c,_0x34da85){return db[_0x2e16('0x18')][_0x2e16('0x1e')](_0x31a28c[_0x2e16('0x1a')],{'raw':_0x31a28c[_0x2e16('0x1b')]?_0x31a28c[_0x2e16('0x1b')][_0x2e16('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31a28c[_0x2e16('0x1b')]?_0x31a28c[_0x2e16('0x1b')][_0x2e16('0x1f')]||null:null,'attributes':_0x31a28c[_0x2e16('0x1b')]?_0x31a28c[_0x2e16('0x1b')]['attributes']||null:null,'limit':_0x31a28c['options']?_0x31a28c['options'][_0x2e16('0x20')]||null:null})[_0x2e16('0xb')](function(_0x43bea7){logger[_0x2e16('0xc')](_0x2e16('0x1d'),_0x31a28c);logger[_0x2e16('0xf')]('UpdateSquareReport',_0x31a28c,JSON[_0x2e16('0x11')](_0x43bea7));_0x35947c(_0x43bea7);})['catch'](function(_0xd2238d){logger[_0x2e16('0x12')]('UpdateSquareReport',_0xd2238d[_0x2e16('0x14')],_0x31a28c);_0x34da85(_0x27c88d['error'](0x1f4,_0xd2238d['message']));});});}; \ No newline at end of file +var _0x72a8=['SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','options','CreateSquareReport','debug','UpdateSquareReport','body','raw','limit','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x320fa3,_0x1a10c5){var _0x2a0ba3=function(_0x708eff){while(--_0x708eff){_0x320fa3['push'](_0x320fa3['shift']());}};_0x2a0ba3(++_0x1a10c5);}(_0x72a8,0xe3));var _0x872a=function(_0x5e221f,_0xf62c4f){_0x5e221f=_0x5e221f-0x0;var _0x33329c=_0x72a8[_0x5e221f];return _0x33329c;};'use strict';var _=require(_0x872a('0x0'));var util=require('util');var moment=require(_0x872a('0x1'));var BPromise=require('bluebird');var rs=require(_0x872a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x872a('0x3'))['db'];var utils=require(_0x872a('0x4'));var logger=require(_0x872a('0x5'))('rpc');var config=require(_0x872a('0x6'));var jayson=require(_0x872a('0x7'));var client=jayson[_0x872a('0x8')][_0x872a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e268a,_0x203fa4,_0xf6e4d8){return new BPromise(function(_0x3ecdc8,_0x9a0711){return client[_0x872a('0xa')](_0x5e268a,_0xf6e4d8)[_0x872a('0xb')](function(_0x4fb679){logger[_0x872a('0xc')](_0x872a('0xd'),_0x203fa4,_0x872a('0xe'));logger['debug'](_0x872a('0xf'),_0x203fa4,_0x872a('0xe'),JSON[_0x872a('0x10')](_0x4fb679));if(_0x4fb679[_0x872a('0x11')]){if(_0x4fb679[_0x872a('0x11')][_0x872a('0x12')]===0x1f4){logger[_0x872a('0x11')](_0x872a('0xd'),_0x203fa4,_0x4fb679[_0x872a('0x11')][_0x872a('0x13')]);return _0x9a0711(_0x4fb679[_0x872a('0x11')][_0x872a('0x13')]);}logger['error']('SquareReport,\x20%s,\x20%s',_0x203fa4,_0x4fb679[_0x872a('0x11')][_0x872a('0x13')]);return _0x3ecdc8(_0x4fb679[_0x872a('0x11')][_0x872a('0x13')]);}else{logger[_0x872a('0xc')]('SquareReport,\x20%s,\x20%s',_0x203fa4,_0x872a('0xe'));_0x3ecdc8(_0x4fb679[_0x872a('0x14')][_0x872a('0x13')]);}})[_0x872a('0x15')](function(_0x55bdaf){logger[_0x872a('0x11')](_0x872a('0xd'),_0x203fa4,_0x55bdaf);_0x9a0711(_0x55bdaf);});});}exports['CreateSquareReport']=function(_0x379720){var _0x118c27=this;return new Promise(function(_0x5f0b47,_0x5debb5){return db['SquareReport'][_0x872a('0x16')](_0x379720['body'],{'raw':_0x379720[_0x872a('0x17')]?_0x379720['options']['raw']===undefined?!![]:![]:!![]})[_0x872a('0xb')](function(_0x2c5d73){logger[_0x872a('0xc')](_0x872a('0x18'),_0x379720);logger[_0x872a('0x19')](_0x872a('0x18'),_0x379720,JSON[_0x872a('0x10')](_0x2c5d73));_0x5f0b47(_0x2c5d73);})['catch'](function(_0x23a0a5){logger[_0x872a('0x11')](_0x872a('0x18'),_0x23a0a5['message'],_0x379720);_0x5debb5(_0x118c27[_0x872a('0x11')](0x1f4,_0x23a0a5[_0x872a('0x13')]));});});};exports[_0x872a('0x1a')]=function(_0x5abf70){var _0x2e2796=this;return new Promise(function(_0x383a38,_0x22cb01){return db['SquareReport']['update'](_0x5abf70[_0x872a('0x1b')],{'raw':_0x5abf70[_0x872a('0x17')]?_0x5abf70[_0x872a('0x17')][_0x872a('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5abf70[_0x872a('0x17')]?_0x5abf70[_0x872a('0x17')]['where']||null:null,'attributes':_0x5abf70[_0x872a('0x17')]?_0x5abf70[_0x872a('0x17')]['attributes']||null:null,'limit':_0x5abf70[_0x872a('0x17')]?_0x5abf70['options'][_0x872a('0x1d')]||null:null})[_0x872a('0xb')](function(_0x1fd316){logger[_0x872a('0xc')](_0x872a('0x1a'),_0x5abf70);logger[_0x872a('0x19')](_0x872a('0x1a'),_0x5abf70,JSON[_0x872a('0x10')](_0x1fd316));_0x383a38(_0x1fd316);})[_0x872a('0x15')](function(_0x524d8d){logger[_0x872a('0x11')](_0x872a('0x1a'),_0x524d8d[_0x872a('0x13')],_0x5abf70);_0x22cb01(_0x2e2796[_0x872a('0x11')](0x1f4,_0x524d8d['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index f012b27..a1f8287 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 _0xd6e9=['../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','update','destroy','multer','util','Router','fs-extra'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0xd6e9,0x1d0));var _0x9d6e=function(_0x72fd6b,_0x1f9439){_0x72fd6b=_0x72fd6b-0x0;var _0x4e84d1=_0xd6e9[_0x72fd6b];return _0x4e84d1;};'use strict';var multer=require(_0x9d6e('0x0'));var util=require(_0x9d6e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9d6e('0x2')]();var fs_extra=require(_0x9d6e('0x3'));var auth=require(_0x9d6e('0x4'));var interaction=require(_0x9d6e('0x5'));var config=require(_0x9d6e('0x6'));var controller=require(_0x9d6e('0x7'));router[_0x9d6e('0x8')]('/',auth[_0x9d6e('0x9')](),controller[_0x9d6e('0xa')]);router[_0x9d6e('0x8')](_0x9d6e('0xb'),auth[_0x9d6e('0x9')](),controller[_0x9d6e('0xc')]);router[_0x9d6e('0x8')](_0x9d6e('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x9d6e('0xe')]('/',auth[_0x9d6e('0x9')](),controller[_0x9d6e('0xf')]);router['put'](_0x9d6e('0xd'),auth[_0x9d6e('0x9')](),controller[_0x9d6e('0x10')]);router['delete']('/:id',auth[_0x9d6e('0x9')](),controller[_0x9d6e('0x11')]);module['exports']=router; \ No newline at end of file +var _0xc9dc=['isAuthenticated','index','describe','/:id','show','post','create','put','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get'];(function(_0x2567f0,_0x4fa60){var _0x14852a=function(_0x55b95f){while(--_0x55b95f){_0x2567f0['push'](_0x2567f0['shift']());}};_0x14852a(++_0x4fa60);}(_0xc9dc,0x75));var _0xcc9d=function(_0x4a4646,_0x516d11){_0x4a4646=_0x4a4646-0x0;var _0x22d6af=_0xc9dc[_0x4a4646];return _0x22d6af;};'use strict';var multer=require(_0xcc9d('0x0'));var util=require(_0xcc9d('0x1'));var path=require('path');var timeout=require(_0xcc9d('0x2'));var express=require(_0xcc9d('0x3'));var router=express[_0xcc9d('0x4')]();var fs_extra=require(_0xcc9d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xcc9d('0x6'));var config=require(_0xcc9d('0x7'));var controller=require('./squareReportDetail.controller');router[_0xcc9d('0x8')]('/',auth[_0xcc9d('0x9')](),controller[_0xcc9d('0xa')]);router['get']('/describe',auth[_0xcc9d('0x9')](),controller[_0xcc9d('0xb')]);router[_0xcc9d('0x8')](_0xcc9d('0xc'),auth[_0xcc9d('0x9')](),controller[_0xcc9d('0xd')]);router[_0xcc9d('0xe')]('/',auth[_0xcc9d('0x9')](),controller[_0xcc9d('0xf')]);router[_0xcc9d('0x10')](_0xcc9d('0xc'),auth[_0xcc9d('0x9')](),controller['update']);router['delete']('/:id',auth[_0xcc9d('0x9')](),controller['destroy']);module[_0xcc9d('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 0637acc..7e27816 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 _0x09ec=['TEXT','STRING'];(function(_0x3df207,_0x4b191){var _0x1ae258=function(_0x33d062){while(--_0x33d062){_0x3df207['push'](_0x3df207['shift']());}};_0x1ae258(++_0x4b191);}(_0x09ec,0xab));var _0xc09e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x09ec[_0x187ee1];return _0x388160;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xc09e('0x0')]},'node':{'type':Sequelize[_0xc09e('0x0')]},'application':{'type':Sequelize[_0xc09e('0x0')]},'data':{'type':Sequelize[_0xc09e('0x1')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xc09e('0x0')]}}; \ No newline at end of file +var _0x8755=['sequelize','exports','STRING','TEXT'];(function(_0x4bfa32,_0x3981db){var _0x403269=function(_0x4f0b9a){while(--_0x4f0b9a){_0x4bfa32['push'](_0x4bfa32['shift']());}};_0x403269(++_0x3981db);}(_0x8755,0x138));var _0x5875=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8755[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x5875('0x0'));module[_0x5875('0x1')]={'uniqueid':{'type':Sequelize[_0x5875('0x2')]},'node':{'type':Sequelize[_0x5875('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x5875('0x3')]},'project_name':{'type':Sequelize[_0x5875('0x2')]},'callerid':{'type':Sequelize[_0x5875('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index c00d1ad..bcd81ae 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 _0xce5a=['merge','type','VIRTUAL','options','include','findAll','catch','show','keys','includeAll','create','body','update','find','describe','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','destroy','error','stack','name','index','map','SquareDetailsReport','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xce5a,0x1dd));var _0xace5=function(_0x299784,_0xb0918f){_0x299784=_0x299784-0x0;var _0x5ab008=_0xce5a[_0x299784];return _0x5ab008;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xace5('0x0'));var zipdir=require(_0xace5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xace5('0x2'));var moment=require('moment');var BPromise=require(_0xace5('0x3'));var Mustache=require(_0xace5('0x4'));var util=require(_0xace5('0x5'));var path=require(_0xace5('0x6'));var sox=require(_0xace5('0x7'));var csv=require('to-csv');var ejs=require(_0xace5('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xace5('0x9'));var squel=require(_0xace5('0xa'));var crypto=require(_0xace5('0xb'));var jsforce=require(_0xace5('0xc'));var deskjs=require(_0xace5('0xd'));var toCsv=require(_0xace5('0xe'));var querystring=require('querystring');var Papa=require(_0xace5('0xf'));var Redis=require(_0xace5('0x10'));var authService=require(_0xace5('0x11'));var qs=require(_0xace5('0x12'));var as=require(_0xace5('0x13'));var hardwareService=require(_0xace5('0x14'));var logger=require(_0xace5('0x15'))('api');var utils=require(_0xace5('0x16'));var config=require(_0xace5('0x17'));var licenseUtil=require(_0xace5('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50c22a,_0x4cbe47){_0x4cbe47=_0x4cbe47||0xcc;return function(_0x50c997){if(_0x50c997){return _0x50c22a[_0xace5('0x19')](_0x4cbe47);}return _0x50c22a[_0xace5('0x1a')](_0x4cbe47)[_0xace5('0x1b')]();};}function respondWithResult(_0x339ab8,_0x54a511){_0x54a511=_0x54a511||0xc8;return function(_0x14a108){if(_0x14a108){return _0x339ab8['status'](_0x54a511)[_0xace5('0x1c')](_0x14a108);}};}function respondWithFilteredResult(_0x4923e2,_0x5c0083){return function(_0x1db6cf){if(_0x1db6cf){var _0x52f311=typeof _0x5c0083[_0xace5('0x1d')]==='undefined'&&typeof _0x5c0083[_0xace5('0x1e')]===_0xace5('0x1f');var _0x265703=_0x1db6cf[_0xace5('0x20')];var _0x12a1e0=_0x52f311?0x0:_0x5c0083[_0xace5('0x1d')];var _0x18b43c=_0x52f311?_0x1db6cf[_0xace5('0x20')]:_0x5c0083[_0xace5('0x1d')]+_0x5c0083[_0xace5('0x1e')];var _0x439dd2;if(_0x18b43c>=_0x265703){_0x18b43c=_0x265703;_0x439dd2=0xc8;}else{_0x439dd2=0xce;}_0x4923e2['status'](_0x439dd2);return _0x4923e2[_0xace5('0x21')](_0xace5('0x22'),_0x12a1e0+'-'+_0x18b43c+'/'+_0x265703)[_0xace5('0x1c')](_0x1db6cf);}return null;};}function patchUpdates(_0x6194cf){return function(_0x49f6c8){try{jsonpatch['apply'](_0x49f6c8,_0x6194cf,!![]);}catch(_0x2c57f2){return BPromise[_0xace5('0x23')](_0x2c57f2);}return _0x49f6c8[_0xace5('0x24')]();};}function saveUpdates(_0x323518,_0x1d7994){return function(_0x480651){if(_0x480651){return _0x480651['update'](_0x323518)[_0xace5('0x25')](function(_0x59a369){return _0x59a369;});}return null;};}function removeEntity(_0x115ddc,_0x4ee83e){return function(_0xc90e9f){if(_0xc90e9f){return _0xc90e9f[_0xace5('0x26')]()[_0xace5('0x25')](function(){_0x115ddc[_0xace5('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d42fe,_0x1b3dff){return function(_0x2122e9){if(!_0x2122e9){_0x5d42fe['sendStatus'](0x194);}return _0x2122e9;};}function handleError(_0x56c202,_0x5cafc1){_0x5cafc1=_0x5cafc1||0x1f4;return function(_0x14bb23){logger[_0xace5('0x27')](_0x14bb23[_0xace5('0x28')]);if(_0x14bb23[_0xace5('0x29')]){delete _0x14bb23[_0xace5('0x29')];}_0x56c202['status'](_0x5cafc1)['send'](_0x14bb23);};}exports[_0xace5('0x2a')]=function(_0x340675,_0x5f3955){var _0x334382={},_0x3f2e97={},_0x3ed576={'count':0x0,'rows':[]};var _0x4b2712=_[_0xace5('0x2b')](db[_0xace5('0x2c')][_0xace5('0x2d')],function(_0x2befb8){return{'name':_0x2befb8[_0xace5('0x2e')],'type':_0x2befb8['type'][_0xace5('0x2f')]};});_0x3f2e97[_0xace5('0x30')]=_[_0xace5('0x2b')](_0x4b2712,_0xace5('0x29'));_0x3f2e97[_0xace5('0x31')]=_['keys'](_0x340675[_0xace5('0x31')]);_0x3f2e97['filters']=_[_0xace5('0x32')](_0x3f2e97[_0xace5('0x30')],_0x3f2e97[_0xace5('0x31')]);_0x334382['attributes']=_[_0xace5('0x32')](_0x3f2e97[_0xace5('0x30')],qs[_0xace5('0x33')](_0x340675[_0xace5('0x31')][_0xace5('0x33')]));_0x334382[_0xace5('0x34')]=_0x334382[_0xace5('0x34')][_0xace5('0x35')]?_0x334382['attributes']:_0x3f2e97[_0xace5('0x30')];if(!_0x340675[_0xace5('0x31')][_0xace5('0x36')](_0xace5('0x37'))){_0x334382['limit']=qs['limit'](_0x340675[_0xace5('0x31')][_0xace5('0x1e')]);_0x334382[_0xace5('0x1d')]=qs[_0xace5('0x1d')](_0x340675[_0xace5('0x31')][_0xace5('0x1d')]);}_0x334382[_0xace5('0x38')]=qs['sort'](_0x340675[_0xace5('0x31')][_0xace5('0x39')]);_0x334382[_0xace5('0x3a')]=qs['filters'](_[_0xace5('0x3b')](_0x340675[_0xace5('0x31')],_0x3f2e97[_0xace5('0x3c')]),_0x4b2712);if(_0x340675[_0xace5('0x31')][_0xace5('0x3d')]){_0x334382[_0xace5('0x3a')]=_[_0xace5('0x3e')](_0x334382[_0xace5('0x3a')],{'$or':_['map'](_0x4b2712,function(_0x58855b){if(_0x58855b[_0xace5('0x3f')]!==_0xace5('0x40')){var _0x4fde6e={};_0x4fde6e[_0x58855b[_0xace5('0x29')]]={'$like':'%'+_0x340675['query']['filter']+'%'};return _0x4fde6e;}})});}_0x334382=_[_0xace5('0x3e')]({},_0x334382,_0x340675[_0xace5('0x41')]);var _0x57c0b1={'where':_0x334382[_0xace5('0x3a')]};return db[_0xace5('0x2c')]['count'](_0x57c0b1)[_0xace5('0x25')](function(_0x394b8e){_0x3ed576[_0xace5('0x20')]=_0x394b8e;if(_0x340675[_0xace5('0x31')]['includeAll']){_0x334382[_0xace5('0x42')]=[{'all':!![]}];}return db[_0xace5('0x2c')][_0xace5('0x43')](_0x334382);})[_0xace5('0x25')](function(_0x5b451d){_0x3ed576['rows']=_0x5b451d;return _0x3ed576;})[_0xace5('0x25')](respondWithFilteredResult(_0x5f3955,_0x334382))[_0xace5('0x44')](handleError(_0x5f3955,null));};exports[_0xace5('0x45')]=function(_0x1471ef,_0x358e32){var _0x25741d={'raw':!![],'where':{'id':_0x1471ef['params']['id']}},_0x23fe42={};_0x23fe42[_0xace5('0x30')]=_[_0xace5('0x46')](db['SquareDetailsReport'][_0xace5('0x2d')]);_0x23fe42[_0xace5('0x31')]=_[_0xace5('0x46')](_0x1471ef[_0xace5('0x31')]);_0x23fe42['filters']=_['intersection'](_0x23fe42[_0xace5('0x30')],_0x23fe42[_0xace5('0x31')]);_0x25741d[_0xace5('0x34')]=_[_0xace5('0x32')](_0x23fe42['model'],qs[_0xace5('0x33')](_0x1471ef[_0xace5('0x31')][_0xace5('0x33')]));_0x25741d[_0xace5('0x34')]=_0x25741d[_0xace5('0x34')][_0xace5('0x35')]?_0x25741d[_0xace5('0x34')]:_0x23fe42[_0xace5('0x30')];if(_0x1471ef['query'][_0xace5('0x47')]){_0x25741d['include']=[{'all':!![]}];}_0x25741d=_[_0xace5('0x3e')]({},_0x25741d,_0x1471ef[_0xace5('0x41')]);return db['SquareDetailsReport']['find'](_0x25741d)[_0xace5('0x25')](handleEntityNotFound(_0x358e32,null))[_0xace5('0x25')](respondWithResult(_0x358e32,null))[_0xace5('0x44')](handleError(_0x358e32,null));};exports['create']=function(_0xf64a5,_0x2bcf7e){return db[_0xace5('0x2c')][_0xace5('0x48')](_0xf64a5[_0xace5('0x49')],{})[_0xace5('0x25')](respondWithResult(_0x2bcf7e,0xc9))[_0xace5('0x44')](handleError(_0x2bcf7e,null));};exports[_0xace5('0x4a')]=function(_0x467077,_0x3c7fa9){if(_0x467077[_0xace5('0x49')]['id']){delete _0x467077[_0xace5('0x49')]['id'];}return db[_0xace5('0x2c')][_0xace5('0x4b')]({'where':{'id':_0x467077['params']['id']}})[_0xace5('0x25')](handleEntityNotFound(_0x3c7fa9,null))[_0xace5('0x25')](saveUpdates(_0x467077[_0xace5('0x49')],null))[_0xace5('0x25')](respondWithResult(_0x3c7fa9,null))[_0xace5('0x44')](handleError(_0x3c7fa9,null));};exports[_0xace5('0x26')]=function(_0x1d9293,_0x140312){return db[_0xace5('0x2c')][_0xace5('0x4b')]({'where':{'id':_0x1d9293['params']['id']}})[_0xace5('0x25')](handleEntityNotFound(_0x140312,null))[_0xace5('0x25')](removeEntity(_0x140312,null))[_0xace5('0x44')](handleError(_0x140312,null));};exports[_0xace5('0x4c')]=function(_0x3a9fbf,_0x169592){return db[_0xace5('0x2c')][_0xace5('0x4c')]()[_0xace5('0x25')](respondWithResult(_0x169592,null))['catch'](handleError(_0x169592,null));}; \ No newline at end of file +var _0x0b5d=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','model','filters','intersection','query','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','show','params','keys','find','catch','create','body','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x233148,_0x4cb72a){var _0x3d7b70=function(_0x3f6caf){while(--_0x3f6caf){_0x233148['push'](_0x233148['shift']());}};_0x3d7b70(++_0x4cb72a);}(_0x0b5d,0x80));var _0xd0b5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0b5d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd0b5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd0b5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd0b5('0x2'));var moment=require(_0xd0b5('0x3'));var BPromise=require(_0xd0b5('0x4'));var Mustache=require(_0xd0b5('0x5'));var util=require(_0xd0b5('0x6'));var path=require(_0xd0b5('0x7'));var sox=require(_0xd0b5('0x8'));var csv=require(_0xd0b5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd0b5('0xa'));var squel=require(_0xd0b5('0xb'));var crypto=require('crypto');var jsforce=require(_0xd0b5('0xc'));var deskjs=require(_0xd0b5('0xd'));var toCsv=require(_0xd0b5('0x9'));var querystring=require(_0xd0b5('0xe'));var Papa=require(_0xd0b5('0xf'));var Redis=require(_0xd0b5('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd0b5('0x11'));var as=require(_0xd0b5('0x12'));var hardwareService=require(_0xd0b5('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xd0b5('0x14'));var config=require(_0xd0b5('0x15'));var licenseUtil=require(_0xd0b5('0x16'));var db=require(_0xd0b5('0x17'))['db'];function respondWithStatusCode(_0x9a344b,_0x8ec3e8){_0x8ec3e8=_0x8ec3e8||0xcc;return function(_0x68b64f){if(_0x68b64f){return _0x9a344b[_0xd0b5('0x18')](_0x8ec3e8);}return _0x9a344b[_0xd0b5('0x19')](_0x8ec3e8)['end']();};}function respondWithResult(_0x13c2cd,_0xae6661){_0xae6661=_0xae6661||0xc8;return function(_0x3c2844){if(_0x3c2844){return _0x13c2cd[_0xd0b5('0x19')](_0xae6661)[_0xd0b5('0x1a')](_0x3c2844);}};}function respondWithFilteredResult(_0x337616,_0x29152a){return function(_0x494aec){if(_0x494aec){var _0x4f9a3a=typeof _0x29152a['offset']==='undefined'&&typeof _0x29152a['limit']===_0xd0b5('0x1b');var _0x1187c2=_0x494aec[_0xd0b5('0x1c')];var _0x157c63=_0x4f9a3a?0x0:_0x29152a['offset'];var _0x27ba06=_0x4f9a3a?_0x494aec[_0xd0b5('0x1c')]:_0x29152a[_0xd0b5('0x1d')]+_0x29152a[_0xd0b5('0x1e')];var _0x169ed9;if(_0x27ba06>=_0x1187c2){_0x27ba06=_0x1187c2;_0x169ed9=0xc8;}else{_0x169ed9=0xce;}_0x337616['status'](_0x169ed9);return _0x337616['set'](_0xd0b5('0x1f'),_0x157c63+'-'+_0x27ba06+'/'+_0x1187c2)[_0xd0b5('0x1a')](_0x494aec);}return null;};}function patchUpdates(_0x51b0f0){return function(_0x472844){try{jsonpatch[_0xd0b5('0x20')](_0x472844,_0x51b0f0,!![]);}catch(_0x2e34fc){return BPromise[_0xd0b5('0x21')](_0x2e34fc);}return _0x472844[_0xd0b5('0x22')]();};}function saveUpdates(_0xb20146,_0xff3f5b){return function(_0x49ae61){if(_0x49ae61){return _0x49ae61[_0xd0b5('0x23')](_0xb20146)['then'](function(_0x24daf0){return _0x24daf0;});}return null;};}function removeEntity(_0x1e6dd8,_0x5469bc){return function(_0x7d16b){if(_0x7d16b){return _0x7d16b[_0xd0b5('0x24')]()[_0xd0b5('0x25')](function(){_0x1e6dd8[_0xd0b5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31f5d1,_0xc7b99b){return function(_0x2720ce){if(!_0x2720ce){_0x31f5d1[_0xd0b5('0x18')](0x194);}return _0x2720ce;};}function handleError(_0x2e7499,_0x53a822){_0x53a822=_0x53a822||0x1f4;return function(_0x3cce22){logger[_0xd0b5('0x26')](_0x3cce22[_0xd0b5('0x27')]);if(_0x3cce22[_0xd0b5('0x28')]){delete _0x3cce22[_0xd0b5('0x28')];}_0x2e7499['status'](_0x53a822)[_0xd0b5('0x29')](_0x3cce22);};}exports[_0xd0b5('0x2a')]=function(_0x2bcc84,_0x8befe0){var _0xac99c6={},_0x50b072={},_0xcddbf9={'count':0x0,'rows':[]};var _0x2638a5=_[_0xd0b5('0x2b')](db[_0xd0b5('0x2c')][_0xd0b5('0x2d')],function(_0x3bdebb){return{'name':_0x3bdebb[_0xd0b5('0x2e')],'type':_0x3bdebb[_0xd0b5('0x2f')]['key']};});_0x50b072[_0xd0b5('0x30')]=_[_0xd0b5('0x2b')](_0x2638a5,_0xd0b5('0x28'));_0x50b072['query']=_['keys'](_0x2bcc84['query']);_0x50b072[_0xd0b5('0x31')]=_[_0xd0b5('0x32')](_0x50b072['model'],_0x50b072[_0xd0b5('0x33')]);_0xac99c6['attributes']=_[_0xd0b5('0x32')](_0x50b072[_0xd0b5('0x30')],qs[_0xd0b5('0x34')](_0x2bcc84[_0xd0b5('0x33')][_0xd0b5('0x34')]));_0xac99c6['attributes']=_0xac99c6[_0xd0b5('0x35')][_0xd0b5('0x36')]?_0xac99c6[_0xd0b5('0x35')]:_0x50b072[_0xd0b5('0x30')];if(!_0x2bcc84[_0xd0b5('0x33')][_0xd0b5('0x37')]('nolimit')){_0xac99c6[_0xd0b5('0x1e')]=qs[_0xd0b5('0x1e')](_0x2bcc84[_0xd0b5('0x33')]['limit']);_0xac99c6['offset']=qs['offset'](_0x2bcc84[_0xd0b5('0x33')][_0xd0b5('0x1d')]);}_0xac99c6[_0xd0b5('0x38')]=qs[_0xd0b5('0x39')](_0x2bcc84[_0xd0b5('0x33')]['sort']);_0xac99c6[_0xd0b5('0x3a')]=qs[_0xd0b5('0x31')](_[_0xd0b5('0x3b')](_0x2bcc84[_0xd0b5('0x33')],_0x50b072['filters']),_0x2638a5);if(_0x2bcc84[_0xd0b5('0x33')][_0xd0b5('0x3c')]){_0xac99c6[_0xd0b5('0x3a')]=_[_0xd0b5('0x3d')](_0xac99c6[_0xd0b5('0x3a')],{'$or':_[_0xd0b5('0x2b')](_0x2638a5,function(_0x17cb42){if(_0x17cb42[_0xd0b5('0x2f')]!==_0xd0b5('0x3e')){var _0x1a962f={};_0x1a962f[_0x17cb42[_0xd0b5('0x28')]]={'$like':'%'+_0x2bcc84[_0xd0b5('0x33')]['filter']+'%'};return _0x1a962f;}})});}_0xac99c6=_[_0xd0b5('0x3d')]({},_0xac99c6,_0x2bcc84[_0xd0b5('0x3f')]);var _0x508c54={'where':_0xac99c6[_0xd0b5('0x3a')]};return db[_0xd0b5('0x2c')][_0xd0b5('0x1c')](_0x508c54)[_0xd0b5('0x25')](function(_0xf3828d){_0xcddbf9['count']=_0xf3828d;if(_0x2bcc84['query']['includeAll']){_0xac99c6[_0xd0b5('0x40')]=[{'all':!![]}];}return db[_0xd0b5('0x2c')]['findAll'](_0xac99c6);})[_0xd0b5('0x25')](function(_0x27ed62){_0xcddbf9[_0xd0b5('0x41')]=_0x27ed62;return _0xcddbf9;})[_0xd0b5('0x25')](respondWithFilteredResult(_0x8befe0,_0xac99c6))['catch'](handleError(_0x8befe0,null));};exports[_0xd0b5('0x42')]=function(_0x4766a3,_0x40ac73){var _0x2d76e5={'raw':!![],'where':{'id':_0x4766a3[_0xd0b5('0x43')]['id']}},_0x49f6fc={};_0x49f6fc[_0xd0b5('0x30')]=_[_0xd0b5('0x44')](db['SquareDetailsReport'][_0xd0b5('0x2d')]);_0x49f6fc[_0xd0b5('0x33')]=_[_0xd0b5('0x44')](_0x4766a3[_0xd0b5('0x33')]);_0x49f6fc[_0xd0b5('0x31')]=_[_0xd0b5('0x32')](_0x49f6fc[_0xd0b5('0x30')],_0x49f6fc['query']);_0x2d76e5['attributes']=_[_0xd0b5('0x32')](_0x49f6fc['model'],qs[_0xd0b5('0x34')](_0x4766a3[_0xd0b5('0x33')][_0xd0b5('0x34')]));_0x2d76e5[_0xd0b5('0x35')]=_0x2d76e5[_0xd0b5('0x35')][_0xd0b5('0x36')]?_0x2d76e5[_0xd0b5('0x35')]:_0x49f6fc[_0xd0b5('0x30')];if(_0x4766a3[_0xd0b5('0x33')]['includeAll']){_0x2d76e5['include']=[{'all':!![]}];}_0x2d76e5=_[_0xd0b5('0x3d')]({},_0x2d76e5,_0x4766a3['options']);return db[_0xd0b5('0x2c')][_0xd0b5('0x45')](_0x2d76e5)[_0xd0b5('0x25')](handleEntityNotFound(_0x40ac73,null))[_0xd0b5('0x25')](respondWithResult(_0x40ac73,null))[_0xd0b5('0x46')](handleError(_0x40ac73,null));};exports[_0xd0b5('0x47')]=function(_0x15d474,_0x2a2c1a){return db[_0xd0b5('0x2c')]['create'](_0x15d474[_0xd0b5('0x48')],{})['then'](respondWithResult(_0x2a2c1a,0xc9))[_0xd0b5('0x46')](handleError(_0x2a2c1a,null));};exports[_0xd0b5('0x23')]=function(_0x5ed42a,_0x3ca9fc){if(_0x5ed42a['body']['id']){delete _0x5ed42a[_0xd0b5('0x48')]['id'];}return db['SquareDetailsReport']['find']({'where':{'id':_0x5ed42a[_0xd0b5('0x43')]['id']}})[_0xd0b5('0x25')](handleEntityNotFound(_0x3ca9fc,null))[_0xd0b5('0x25')](saveUpdates(_0x5ed42a['body'],null))[_0xd0b5('0x25')](respondWithResult(_0x3ca9fc,null))['catch'](handleError(_0x3ca9fc,null));};exports['destroy']=function(_0x280412,_0x2ad3c0){return db['SquareDetailsReport']['find']({'where':{'id':_0x280412['params']['id']}})[_0xd0b5('0x25')](handleEntityNotFound(_0x2ad3c0,null))[_0xd0b5('0x25')](removeEntity(_0x2ad3c0,null))[_0xd0b5('0x46')](handleError(_0x2ad3c0,null));};exports['describe']=function(_0x15fb87,_0x4dbdad){return db[_0xd0b5('0x2c')]['describe']()[_0xd0b5('0x25')](respondWithResult(_0x4dbdad,null))[_0xd0b5('0x46')](handleError(_0x4dbdad,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index c4f7d1e..a116398 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 _0x1534=['define','report_square_details','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x4fb1b8,_0x32d98d){var _0x146c71=function(_0x4bb74e){while(--_0x4bb74e){_0x4fb1b8['push'](_0x4fb1b8['shift']());}};_0x146c71(++_0x32d98d);}(_0x1534,0x86));var _0x4153=function(_0x549e70,_0x8a5460){_0x549e70=_0x549e70-0x0;var _0x9a9d8c=_0x1534[_0x549e70];return _0x9a9d8c;};'use strict';var _=require(_0x4153('0x0'));var util=require('util');var logger=require(_0x4153('0x1'))(_0x4153('0x2'));var moment=require(_0x4153('0x3'));var BPromise=require(_0x4153('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4153('0x5'));var rimraf=require(_0x4153('0x6'));var config=require(_0x4153('0x7'));var attributes=require('./squareReportDetail.attributes');module[_0x4153('0x8')]=function(_0x8fc5ba,_0x319c31){return _0x8fc5ba[_0x4153('0x9')]('SquareDetailsReport',attributes,{'tableName':_0x4153('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2f55=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','SquareDetailsReport','lodash'];(function(_0x3aab1b,_0xddaa33){var _0x3134b0=function(_0x1ea18b){while(--_0x1ea18b){_0x3aab1b['push'](_0x3aab1b['shift']());}};_0x3134b0(++_0xddaa33);}(_0x2f55,0x18b));var _0x52f5=function(_0x449cee,_0x3d88b0){_0x449cee=_0x449cee-0x0;var _0x58de0a=_0x2f55[_0x449cee];return _0x58de0a;};'use strict';var _=require(_0x52f5('0x0'));var util=require(_0x52f5('0x1'));var logger=require(_0x52f5('0x2'))('api');var moment=require(_0x52f5('0x3'));var BPromise=require('bluebird');var rp=require(_0x52f5('0x4'));var fs=require('fs');var path=require(_0x52f5('0x5'));var rimraf=require(_0x52f5('0x6'));var config=require(_0x52f5('0x7'));var attributes=require(_0x52f5('0x8'));module[_0x52f5('0x9')]=function(_0x1e79d8,_0x4ba268){return _0x1e79d8['define'](_0x52f5('0xa'),attributes,{'tableName':'report_square_details','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 daf366d..9634f7c 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 _0xbb59=['rpc','jayson/promise','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateSquareDetailsReport','body','options','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x445c20,_0x860230){var _0x33721c=function(_0x192e11){while(--_0x192e11){_0x445c20['push'](_0x445c20['shift']());}};_0x33721c(++_0x860230);}(_0xbb59,0xec));var _0x9bb5=function(_0x220825,_0x15a3d8){_0x220825=_0x220825-0x0;var _0x27ee66=_0xbb59[_0x220825];return _0x27ee66;};'use strict';var _=require(_0x9bb5('0x0'));var util=require(_0x9bb5('0x1'));var moment=require(_0x9bb5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9bb5('0x3'));var db=require(_0x9bb5('0x4'))['db'];var utils=require(_0x9bb5('0x5'));var logger=require(_0x9bb5('0x6'))(_0x9bb5('0x7'));var config=require('../../config/environment');var jayson=require(_0x9bb5('0x8'));var client=jayson[_0x9bb5('0x9')][_0x9bb5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2df722,_0xe362e0,_0x83fd10){return new BPromise(function(_0x2d6cce,_0x4e3857){return client[_0x9bb5('0xb')](_0x2df722,_0x83fd10)[_0x9bb5('0xc')](function(_0x2fdbcb){logger[_0x9bb5('0xd')](_0x9bb5('0xe'),_0xe362e0,'request\x20sent');logger[_0x9bb5('0xf')](_0x9bb5('0x10'),_0xe362e0,_0x9bb5('0x11'),JSON[_0x9bb5('0x12')](_0x2fdbcb));if(_0x2fdbcb[_0x9bb5('0x13')]){if(_0x2fdbcb[_0x9bb5('0x13')][_0x9bb5('0x14')]===0x1f4){logger[_0x9bb5('0x13')](_0x9bb5('0xe'),_0xe362e0,_0x2fdbcb[_0x9bb5('0x13')][_0x9bb5('0x15')]);return _0x4e3857(_0x2fdbcb[_0x9bb5('0x13')][_0x9bb5('0x15')]);}logger[_0x9bb5('0x13')]('SquareDetailsReport,\x20%s,\x20%s',_0xe362e0,_0x2fdbcb['error'][_0x9bb5('0x15')]);return _0x2d6cce(_0x2fdbcb['error']['message']);}else{logger[_0x9bb5('0xd')]('SquareDetailsReport,\x20%s,\x20%s',_0xe362e0,_0x9bb5('0x11'));_0x2d6cce(_0x2fdbcb[_0x9bb5('0x16')][_0x9bb5('0x15')]);}})['catch'](function(_0xb471e){logger[_0x9bb5('0x13')](_0x9bb5('0xe'),_0xe362e0,_0xb471e);_0x4e3857(_0xb471e);});});}exports[_0x9bb5('0x17')]=function(_0xba8392){var _0x19d1e9=this;return new Promise(function(_0x162815,_0xe44bdd){return db['SquareDetailsReport']['create'](_0xba8392[_0x9bb5('0x18')],{'raw':_0xba8392[_0x9bb5('0x19')]?_0xba8392['options']['raw']===undefined?!![]:![]:!![]})[_0x9bb5('0xc')](function(_0x182966){logger[_0x9bb5('0xd')]('CreateSquareDetailsReport',_0xba8392);logger[_0x9bb5('0xf')](_0x9bb5('0x17'),_0xba8392,JSON[_0x9bb5('0x12')](_0x182966));_0x162815(_0x182966);})[_0x9bb5('0x1a')](function(_0x51fa34){logger[_0x9bb5('0x13')](_0x9bb5('0x17'),_0x51fa34['message'],_0xba8392);_0xe44bdd(_0x19d1e9[_0x9bb5('0x13')](0x1f4,_0x51fa34['message']));});});}; \ No newline at end of file +var _0x36ee=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','options','raw'];(function(_0x47a836,_0x5228a9){var _0x1b3d12=function(_0x2350a1){while(--_0x2350a1){_0x47a836['push'](_0x47a836['shift']());}};_0x1b3d12(++_0x5228a9);}(_0x36ee,0xe8));var _0xe36e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x36ee[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe36e('0x0'));var BPromise=require('bluebird');var rs=require(_0xe36e('0x1'));var fs=require('fs');var Redis=require(_0xe36e('0x2'));var db=require(_0xe36e('0x3'))['db'];var utils=require(_0xe36e('0x4'));var logger=require(_0xe36e('0x5'))(_0xe36e('0x6'));var config=require(_0xe36e('0x7'));var jayson=require(_0xe36e('0x8'));var client=jayson[_0xe36e('0x9')][_0xe36e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21be0b,_0x1aa596,_0x51b4bd){return new BPromise(function(_0x74b4b7,_0x4aebdd){return client[_0xe36e('0xb')](_0x21be0b,_0x51b4bd)[_0xe36e('0xc')](function(_0x46f239){logger['info'](_0xe36e('0xd'),_0x1aa596,'request\x20sent');logger[_0xe36e('0xe')](_0xe36e('0xf'),_0x1aa596,_0xe36e('0x10'),JSON[_0xe36e('0x11')](_0x46f239));if(_0x46f239[_0xe36e('0x12')]){if(_0x46f239[_0xe36e('0x12')][_0xe36e('0x13')]===0x1f4){logger[_0xe36e('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0x1aa596,_0x46f239[_0xe36e('0x12')][_0xe36e('0x14')]);return _0x4aebdd(_0x46f239[_0xe36e('0x12')][_0xe36e('0x14')]);}logger['error'](_0xe36e('0xd'),_0x1aa596,_0x46f239['error']['message']);return _0x74b4b7(_0x46f239[_0xe36e('0x12')][_0xe36e('0x14')]);}else{logger[_0xe36e('0x15')](_0xe36e('0xd'),_0x1aa596,_0xe36e('0x10'));_0x74b4b7(_0x46f239[_0xe36e('0x16')][_0xe36e('0x14')]);}})[_0xe36e('0x17')](function(_0x387c37){logger[_0xe36e('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0x1aa596,_0x387c37);_0x4aebdd(_0x387c37);});});}exports[_0xe36e('0x18')]=function(_0x2184ae){var _0x56c019=this;return new Promise(function(_0x21d9a3,_0x533c06){return db[_0xe36e('0x19')][_0xe36e('0x1a')](_0x2184ae['body'],{'raw':_0x2184ae[_0xe36e('0x1b')]?_0x2184ae[_0xe36e('0x1b')][_0xe36e('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x21e95e){logger[_0xe36e('0x15')](_0xe36e('0x18'),_0x2184ae);logger[_0xe36e('0xe')](_0xe36e('0x18'),_0x2184ae,JSON[_0xe36e('0x11')](_0x21e95e));_0x21d9a3(_0x21e95e);})['catch'](function(_0xd71137){logger[_0xe36e('0x12')](_0xe36e('0x18'),_0xd71137[_0xe36e('0x14')],_0x2184ae);_0x533c06(_0x56c019[_0xe36e('0x12')](0x1f4,_0xd71137['message']));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 1226d42..8897da2 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 _0x7c6f=['Router','../../components/auth/service','index','get','/process/:pid/kill','exports','express'];(function(_0xf7c208,_0x5cbc84){var _0x16992d=function(_0x2fe157){while(--_0x2fe157){_0xf7c208['push'](_0xf7c208['shift']());}};_0x16992d(++_0x5cbc84);}(_0x7c6f,0x141));var _0xf7c6=function(_0x36d00d,_0x33c55c){_0x36d00d=_0x36d00d-0x0;var _0x429560=_0x7c6f[_0x36d00d];return _0x429560;};'use strict';var express=require(_0xf7c6('0x0'));var router=express[_0xf7c6('0x1')]();var auth=require(_0xf7c6('0x2'));var controller=require('./system.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xf7c6('0x3')]);router[_0xf7c6('0x4')](_0xf7c6('0x5'),auth['isAuthenticated'](),controller['killProcess']);module[_0xf7c6('0x6')]=router; \ No newline at end of file +var _0x4eb2=['./system.controller','get','index','/process/:pid/kill','killProcess','express','../../components/auth/service'];(function(_0x146bd4,_0x143604){var _0x209fac=function(_0x11b3ae){while(--_0x11b3ae){_0x146bd4['push'](_0x146bd4['shift']());}};_0x209fac(++_0x143604);}(_0x4eb2,0xf3));var _0x24eb=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0x4eb2[_0x1eda20];return _0x31b953;};'use strict';var express=require(_0x24eb('0x0'));var router=express['Router']();var auth=require(_0x24eb('0x1'));var controller=require(_0x24eb('0x2'));router[_0x24eb('0x3')]('/',auth['isAuthenticated'](),controller[_0x24eb('0x4')]);router[_0x24eb('0x3')](_0x24eb('0x5'),auth['isAuthenticated'](),controller[_0x24eb('0x6')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index d61ea24..cafdae1 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 _0xb2d1=['components/import/cm','format','params','pid','then','split','length','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','child_process','exec','../../config/logger','api','bluebird','error','inspect','status','send','getAllData','catch','json','killProcess'];(function(_0x4a7685,_0x4b1411){var _0x461b64=function(_0x25854c){while(--_0x25854c){_0x4a7685['push'](_0x4a7685['shift']());}};_0x461b64(++_0x4b1411);}(_0xb2d1,0xc2));var _0x1b2d=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xb2d1[_0x68c979];return _0x4f0001;};'use strict';var info=require('systeminformation');var exec=require(_0x1b2d('0x0'))[_0x1b2d('0x1')];var logger=require(_0x1b2d('0x2'))(_0x1b2d('0x3'));var util=require('util');var BPromise=require(_0x1b2d('0x4'));var _=require('lodash');function handleError(_0x4c62ed,_0x50fbbc,_0x2b396){_0x50fbbc=_0x50fbbc||0x1f4;return function(_0x57620e){logger[_0x1b2d('0x5')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x2b396,_0x50fbbc,util[_0x1b2d('0x6')](_0x57620e,{'showHidden':![],'depth':null}));delete _0x57620e['name'];_0x4c62ed[_0x1b2d('0x7')](_0x50fbbc)[_0x1b2d('0x8')](_0x57620e);};}exports['index']=function(_0x40c4bb,_0x5f4b09){return info[_0x1b2d('0x9')]()['then'](function(_0x6a7ad7){return _0x5f4b09[_0x1b2d('0x7')](0xc8)['json'](_0x6a7ad7);})[_0x1b2d('0xa')](function(_0x4c99ab){return _0x5f4b09[_0x1b2d('0x7')](0x1f4)[_0x1b2d('0xb')](_0x4c99ab);});};exports[_0x1b2d('0xc')]=function(_0x2ee524,_0x57eb92){var _0x2cf8c9=[_0x1b2d('0xd')];return new BPromise(function(_0x10d798,_0x3401f9){return exec(util[_0x1b2d('0xe')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x2ee524[_0x1b2d('0xf')][_0x1b2d('0x10')]),function(_0x5942ca,_0x456185,_0x32b541){if(_0x5942ca){return _0x3401f9(_0x5942ca);}return _0x10d798(_0x456185);});})[_0x1b2d('0x11')](function(_0x303ee7){var _0x33ef51=![];var _0x533e62=_0x303ee7[_0x1b2d('0x12')](/\n/);for(var _0x5a13c2=0x0,_0x423378=_0x2cf8c9[_0x1b2d('0x13')];_0x5a13c2<_0x423378,_0x33ef51===![];_0x5a13c2+=0x1){if(_0x303ee7['indexOf'](_0x2cf8c9[_0x5a13c2])>=0x0){_0x33ef51=!![];}}if(!_0x33ef51){throw new Error(util[_0x1b2d('0xe')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x2ee524[_0x1b2d('0xf')]['pid']));}process[_0x1b2d('0x14')](_0x2ee524[_0x1b2d('0xf')][_0x1b2d('0x10')],_0x1b2d('0x15'));return _0x57eb92[_0x1b2d('0x7')](0xc8)[_0x1b2d('0xb')]({'message':util[_0x1b2d('0xe')](_0x1b2d('0x16'),_0x2ee524[_0x1b2d('0xf')][_0x1b2d('0x10')])});})[_0x1b2d('0xa')](handleError(_0x57eb92,null,_0x1b2d('0xc')));}; \ No newline at end of file +var _0x55f1=['length','format','Process\x20with\x20pid\x20%s\x20not\x20found!','SIGINT','systeminformation','child_process','exec','../../config/logger','api','util','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','json','catch','killProcess','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','then','split'];(function(_0x1896d2,_0x38e977){var _0xd06e7=function(_0x2ef043){while(--_0x2ef043){_0x1896d2['push'](_0x1896d2['shift']());}};_0xd06e7(++_0x38e977);}(_0x55f1,0x17b));var _0x155f=function(_0xfd0380,_0x20399b){_0xfd0380=_0xfd0380-0x0;var _0x54f7fd=_0x55f1[_0xfd0380];return _0x54f7fd;};'use strict';var info=require(_0x155f('0x0'));var exec=require(_0x155f('0x1'))[_0x155f('0x2')];var logger=require(_0x155f('0x3'))(_0x155f('0x4'));var util=require(_0x155f('0x5'));var BPromise=require('bluebird');var _=require(_0x155f('0x6'));function handleError(_0x4eb66c,_0x11c1fe,_0x36e5b9){_0x11c1fe=_0x11c1fe||0x1f4;return function(_0x4c3691){logger['error'](_0x155f('0x7'),_0x36e5b9,_0x11c1fe,util[_0x155f('0x8')](_0x4c3691,{'showHidden':![],'depth':null}));delete _0x4c3691[_0x155f('0x9')];_0x4eb66c[_0x155f('0xa')](_0x11c1fe)[_0x155f('0xb')](_0x4c3691);};}exports['index']=function(_0x1f9acc,_0x8fc7b3){return info['getAllData']()['then'](function(_0x3dfa33){return _0x8fc7b3[_0x155f('0xa')](0xc8)[_0x155f('0xc')](_0x3dfa33);})[_0x155f('0xd')](function(_0x59a072){return _0x8fc7b3[_0x155f('0xa')](0x1f4)[_0x155f('0xc')](_0x59a072);});};exports[_0x155f('0xe')]=function(_0x30fb54,_0x57cdaa){var _0x28367b=[_0x155f('0xf')];return new BPromise(function(_0x11e0bd,_0x31e426){return exec(util['format'](_0x155f('0x10'),_0x30fb54[_0x155f('0x11')][_0x155f('0x12')]),function(_0x21a530,_0xaff98b,_0x3584ba){if(_0x21a530){return _0x31e426(_0x21a530);}return _0x11e0bd(_0xaff98b);});})[_0x155f('0x13')](function(_0x6c2711){var _0x310a54=![];var _0x310ab4=_0x6c2711[_0x155f('0x14')](/\n/);for(var _0x484716=0x0,_0x47020d=_0x28367b[_0x155f('0x15')];_0x484716<_0x47020d,_0x310a54===![];_0x484716+=0x1){if(_0x6c2711['indexOf'](_0x28367b[_0x484716])>=0x0){_0x310a54=!![];}}if(!_0x310a54){throw new Error(util[_0x155f('0x16')](_0x155f('0x17'),_0x30fb54['params']['pid']));}process['kill'](_0x30fb54['params'][_0x155f('0x12')],_0x155f('0x18'));return _0x57cdaa[_0x155f('0xa')](0xc8)['json']({'message':util['format']('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x30fb54[_0x155f('0x11')][_0x155f('0x12')])});})[_0x155f('0xd')](handleError(_0x57cdaa,null,_0x155f('0xe')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index caa8403..aa8d7b8 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 _0x6177=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x5d2821,_0x557c59){var _0x7588b5=function(_0x5dc756){while(--_0x5dc756){_0x5d2821['push'](_0x5d2821['shift']());}};_0x7588b5(++_0x557c59);}(_0x6177,0xf8));var _0x7617=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x6177[_0x341e0f];return _0x59555a;};'use strict';var multer=require(_0x7617('0x0'));var util=require(_0x7617('0x1'));var path=require(_0x7617('0x2'));var timeout=require(_0x7617('0x3'));var express=require(_0x7617('0x4'));var router=express[_0x7617('0x5')]();var fs_extra=require(_0x7617('0x6'));var auth=require(_0x7617('0x7'));var interaction=require(_0x7617('0x8'));var config=require(_0x7617('0x9'));var controller=require(_0x7617('0xa'));router[_0x7617('0xb')]('/',auth[_0x7617('0xc')](),controller[_0x7617('0xd')]);router[_0x7617('0xb')](_0x7617('0xe'),auth[_0x7617('0xc')](),controller[_0x7617('0xf')]);router[_0x7617('0x10')]('/',auth['isAuthenticated'](),controller[_0x7617('0x11')]);router[_0x7617('0x12')]('/:id',auth[_0x7617('0xc')](),controller[_0x7617('0x13')]);router[_0x7617('0x14')](_0x7617('0xe'),auth['isAuthenticated'](),controller[_0x7617('0x15')]);module[_0x7617('0x16')]=router; \ No newline at end of file +var _0xdcdb=['index','/:id','show','post','delete','exports','multer','connect-timeout','express','../../components/auth/service','../../config/environment','./tag.controller','get','isAuthenticated'];(function(_0x158ad5,_0x335477){var _0x264448=function(_0x4da69e){while(--_0x4da69e){_0x158ad5['push'](_0x158ad5['shift']());}};_0x264448(++_0x335477);}(_0xdcdb,0xae));var _0xbdcd=function(_0x2367b2,_0x345751){_0x2367b2=_0x2367b2-0x0;var _0x58c87e=_0xdcdb[_0x2367b2];return _0x58c87e;};'use strict';var multer=require(_0xbdcd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xbdcd('0x1'));var express=require(_0xbdcd('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbdcd('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xbdcd('0x4'));var controller=require(_0xbdcd('0x5'));router[_0xbdcd('0x6')]('/',auth[_0xbdcd('0x7')](),controller[_0xbdcd('0x8')]);router[_0xbdcd('0x6')](_0xbdcd('0x9'),auth[_0xbdcd('0x7')](),controller[_0xbdcd('0xa')]);router[_0xbdcd('0xb')]('/',auth[_0xbdcd('0x7')](),controller['create']);router['put'](_0xbdcd('0x9'),auth[_0xbdcd('0x7')](),controller['update']);router[_0xbdcd('0xc')](_0xbdcd('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xbdcd('0xd')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 7ae0aba..846ee63 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 _0x6888=['name','#0091EA','sequelize','STRING'];(function(_0x34e734,_0x5c3938){var _0x1d24fa=function(_0x2be9e3){while(--_0x2be9e3){_0x34e734['push'](_0x34e734['shift']());}};_0x1d24fa(++_0x5c3938);}(_0x6888,0xd2));var _0x8688=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x6888[_0x2e4aa2];return _0x5e6092;};'use strict';var Sequelize=require(_0x8688('0x0'));module['exports']={'name':{'type':Sequelize[_0x8688('0x1')],'unique':_0x8688('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x8688('0x1')],'defaultValue':_0x8688('0x3')},'description':{'type':Sequelize[_0x8688('0x1')]}}; \ No newline at end of file +var _0xbc4a=['sequelize','exports','STRING'];(function(_0x8a2b25,_0x788ab3){var _0xc174a3=function(_0x5c218f){while(--_0x5c218f){_0x8a2b25['push'](_0x8a2b25['shift']());}};_0xc174a3(++_0x788ab3);}(_0xbc4a,0x1dd));var _0xabc4=function(_0x24679e,_0x22d9d7){_0x24679e=_0x24679e-0x0;var _0x291f21=_0xbc4a[_0x24679e];return _0x291f21;};'use strict';var Sequelize=require(_0xabc4('0x0'));module[_0xabc4('0x1')]={'name':{'type':Sequelize[_0xabc4('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':'#0091EA'},'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 7eeda3c..8e8fb43 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 _0x00b3=['to-csv','ejs','fs-extra','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','set','json','reject','save','then','destroy','get','Tags','UserProfileResource','error','stack','name','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','options','Tag','include','findAll','catch','show','params','rawAttributes','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','update','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox'];(function(_0x2e217a,_0x2451df){var _0x332e80=function(_0x1dba03){while(--_0x1dba03){_0x2e217a['push'](_0x2e217a['shift']());}};_0x332e80(++_0x2451df);}(_0x00b3,0x17a));var _0x300b=function(_0x154662,_0x270de6){_0x154662=_0x154662-0x0;var _0x41b01e=_0x00b3[_0x154662];return _0x41b01e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x300b('0x0'));var zipdir=require(_0x300b('0x1'));var jsonpatch=require(_0x300b('0x2'));var rp=require(_0x300b('0x3'));var moment=require('moment');var BPromise=require(_0x300b('0x4'));var Mustache=require('mustache');var util=require(_0x300b('0x5'));var path=require('path');var sox=require(_0x300b('0x6'));var csv=require(_0x300b('0x7'));var ejs=require(_0x300b('0x8'));var fs=require('fs');var fs_extra=require(_0x300b('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x300b('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x300b('0x7'));var querystring=require(_0x300b('0xb'));var Papa=require(_0x300b('0xc'));var Redis=require('ioredis');var authService=require(_0x300b('0xd'));var qs=require(_0x300b('0xe'));var as=require(_0x300b('0xf'));var hardwareService=require(_0x300b('0x10'));var logger=require('../../config/logger')(_0x300b('0x11'));var utils=require(_0x300b('0x12'));var config=require(_0x300b('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x300b('0x14'))['db'];function respondWithStatusCode(_0xea95bb,_0x138efb){_0x138efb=_0x138efb||0xcc;return function(_0x40c03b){if(_0x40c03b){return _0xea95bb[_0x300b('0x15')](_0x138efb);}return _0xea95bb[_0x300b('0x16')](_0x138efb)[_0x300b('0x17')]();};}function respondWithResult(_0x10bb41,_0x58746b){_0x58746b=_0x58746b||0xc8;return function(_0x54c3ee){if(_0x54c3ee){return _0x10bb41['status'](_0x58746b)['json'](_0x54c3ee);}};}function respondWithFilteredResult(_0x44e61b,_0x26c0e5){return function(_0xfb49f){if(_0xfb49f){var _0xd252fa=typeof _0x26c0e5['offset']==='undefined'&&typeof _0x26c0e5[_0x300b('0x18')]===_0x300b('0x19');var _0x2fed99=_0xfb49f[_0x300b('0x1a')];var _0x4d2024=_0xd252fa?0x0:_0x26c0e5[_0x300b('0x1b')];var _0x2a7d96=_0xd252fa?_0xfb49f[_0x300b('0x1a')]:_0x26c0e5['offset']+_0x26c0e5[_0x300b('0x18')];var _0x10174b;if(_0x2a7d96>=_0x2fed99){_0x2a7d96=_0x2fed99;_0x10174b=0xc8;}else{_0x10174b=0xce;}_0x44e61b[_0x300b('0x16')](_0x10174b);return _0x44e61b[_0x300b('0x1c')]('Content-Range',_0x4d2024+'-'+_0x2a7d96+'/'+_0x2fed99)[_0x300b('0x1d')](_0xfb49f);}return null;};}function patchUpdates(_0x16bfc6){return function(_0x971d15){try{jsonpatch['apply'](_0x971d15,_0x16bfc6,!![]);}catch(_0xe05542){return BPromise[_0x300b('0x1e')](_0xe05542);}return _0x971d15[_0x300b('0x1f')]();};}function saveUpdates(_0x502c5f,_0x26913f){return function(_0x5b14ed){if(_0x5b14ed){return _0x5b14ed['update'](_0x502c5f)[_0x300b('0x20')](function(_0xad0fb){return _0xad0fb;});}return null;};}function removeEntity(_0x28bc0a,_0x3ea40b){return function(_0x3219aa){if(_0x3219aa){return _0x3219aa[_0x300b('0x21')]()[_0x300b('0x20')](function(){var _0x2fa577=_0x3219aa[_0x300b('0x22')]({'plain':!![]});var _0x544658=_0x300b('0x23');return db[_0x300b('0x24')][_0x300b('0x21')]({'where':{'type':_0x544658,'resourceId':_0x2fa577['id']}})[_0x300b('0x20')](function(){return _0x3219aa;});})['then'](function(){_0x28bc0a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x39794a,_0x4a1300){return function(_0x1241c7){if(!_0x1241c7){_0x39794a[_0x300b('0x15')](0x194);}return _0x1241c7;};}function handleError(_0x60bb0c,_0x30b260){_0x30b260=_0x30b260||0x1f4;return function(_0x2d2ea7){logger[_0x300b('0x25')](_0x2d2ea7[_0x300b('0x26')]);if(_0x2d2ea7[_0x300b('0x27')]){delete _0x2d2ea7[_0x300b('0x27')];}_0x60bb0c[_0x300b('0x16')](_0x30b260)['send'](_0x2d2ea7);};}exports['index']=function(_0x35cafd,_0x2a7604){var _0x1cb3bc={},_0x3d89ab={},_0x4b8639={'count':0x0,'rows':[]};var _0x2e30df=_['map'](db['Tag']['rawAttributes'],function(_0x27d2de){return{'name':_0x27d2de[_0x300b('0x28')],'type':_0x27d2de['type'][_0x300b('0x29')]};});_0x3d89ab[_0x300b('0x2a')]=_['map'](_0x2e30df,_0x300b('0x27'));_0x3d89ab['query']=_[_0x300b('0x2b')](_0x35cafd[_0x300b('0x2c')]);_0x3d89ab[_0x300b('0x2d')]=_[_0x300b('0x2e')](_0x3d89ab[_0x300b('0x2a')],_0x3d89ab[_0x300b('0x2c')]);_0x1cb3bc[_0x300b('0x2f')]=_['intersection'](_0x3d89ab[_0x300b('0x2a')],qs['fields'](_0x35cafd[_0x300b('0x2c')][_0x300b('0x30')]));_0x1cb3bc['attributes']=_0x1cb3bc[_0x300b('0x2f')][_0x300b('0x31')]?_0x1cb3bc['attributes']:_0x3d89ab[_0x300b('0x2a')];if(!_0x35cafd[_0x300b('0x2c')][_0x300b('0x32')]('nolimit')){_0x1cb3bc[_0x300b('0x18')]=qs[_0x300b('0x18')](_0x35cafd[_0x300b('0x2c')][_0x300b('0x18')]);_0x1cb3bc[_0x300b('0x1b')]=qs[_0x300b('0x1b')](_0x35cafd[_0x300b('0x2c')]['offset']);}_0x1cb3bc[_0x300b('0x33')]=qs[_0x300b('0x34')](_0x35cafd['query'][_0x300b('0x34')]);_0x1cb3bc['where']=qs['filters'](_[_0x300b('0x35')](_0x35cafd[_0x300b('0x2c')],_0x3d89ab[_0x300b('0x2d')]),_0x2e30df);if(_0x35cafd[_0x300b('0x2c')][_0x300b('0x36')]){_0x1cb3bc['where']=_[_0x300b('0x37')](_0x1cb3bc[_0x300b('0x38')],{'$or':_['map'](_0x2e30df,function(_0x43af8f){if(_0x43af8f['type']!==_0x300b('0x39')){var _0x262ddb={};_0x262ddb[_0x43af8f[_0x300b('0x27')]]={'$like':'%'+_0x35cafd[_0x300b('0x2c')][_0x300b('0x36')]+'%'};return _0x262ddb;}})});}_0x1cb3bc=_[_0x300b('0x37')]({},_0x1cb3bc,_0x35cafd[_0x300b('0x3a')]);var _0x2f897e={'where':_0x1cb3bc[_0x300b('0x38')]};return db[_0x300b('0x3b')][_0x300b('0x1a')](_0x2f897e)['then'](function(_0x4ee1d0){_0x4b8639[_0x300b('0x1a')]=_0x4ee1d0;if(_0x35cafd['query']['includeAll']){_0x1cb3bc[_0x300b('0x3c')]=[{'all':!![]}];}return db[_0x300b('0x3b')][_0x300b('0x3d')](_0x1cb3bc);})['then'](function(_0x7aa03a){_0x4b8639['rows']=_0x7aa03a;return _0x4b8639;})['then'](respondWithFilteredResult(_0x2a7604,_0x1cb3bc))[_0x300b('0x3e')](handleError(_0x2a7604,null));};exports[_0x300b('0x3f')]=function(_0x5f0fd1,_0x24b227){var _0x10f652={'raw':!![],'where':{'id':_0x5f0fd1[_0x300b('0x40')]['id']}},_0x54bdc9={};_0x54bdc9[_0x300b('0x2a')]=_['keys'](db[_0x300b('0x3b')][_0x300b('0x41')]);_0x54bdc9[_0x300b('0x2c')]=_[_0x300b('0x2b')](_0x5f0fd1[_0x300b('0x2c')]);_0x54bdc9[_0x300b('0x2d')]=_[_0x300b('0x2e')](_0x54bdc9[_0x300b('0x2a')],_0x54bdc9['query']);_0x10f652['attributes']=_[_0x300b('0x2e')](_0x54bdc9['model'],qs['fields'](_0x5f0fd1[_0x300b('0x2c')][_0x300b('0x30')]));_0x10f652[_0x300b('0x2f')]=_0x10f652[_0x300b('0x2f')][_0x300b('0x31')]?_0x10f652[_0x300b('0x2f')]:_0x54bdc9['model'];if(_0x5f0fd1[_0x300b('0x2c')]['includeAll']){_0x10f652['include']=[{'all':!![]}];}_0x10f652=_[_0x300b('0x37')]({},_0x10f652,_0x5f0fd1[_0x300b('0x3a')]);return db['Tag'][_0x300b('0x42')](_0x10f652)[_0x300b('0x20')](handleEntityNotFound(_0x24b227,null))[_0x300b('0x20')](respondWithResult(_0x24b227,null))[_0x300b('0x3e')](handleError(_0x24b227,null));};exports['create']=function(_0x389256,_0x43eef6){return db['Tag'][_0x300b('0x43')](_0x389256[_0x300b('0x44')],{})[_0x300b('0x20')](function(_0x5e8e29){var _0x27c57d=_0x389256[_0x300b('0x45')][_0x300b('0x22')]({'plain':!![]});if(!_0x27c57d)throw new Error(_0x300b('0x46'));if(_0x27c57d[_0x300b('0x47')]===_0x300b('0x45')){var _0x418ac3=_0x5e8e29[_0x300b('0x22')]({'plain':!![]});var _0x186519=_0x300b('0x23');return db[_0x300b('0x48')][_0x300b('0x42')]({'where':{'name':_0x186519,'userProfileId':_0x27c57d[_0x300b('0x49')]},'raw':!![]})['then'](function(_0x5ae549){if(_0x5ae549&&_0x5ae549[_0x300b('0x4a')]===0x0){return db[_0x300b('0x24')][_0x300b('0x43')]({'name':_0x418ac3['name'],'resourceId':_0x418ac3['id'],'type':_0x5ae549[_0x300b('0x27')],'sectionId':_0x5ae549['id']},{})['then'](function(){return _0x5e8e29;});}else{return _0x5e8e29;}})[_0x300b('0x3e')](function(_0x4ffa19){logger['error'](_0x300b('0x4b'),_0x4ffa19);throw _0x4ffa19;});}return _0x5e8e29;})[_0x300b('0x20')](respondWithResult(_0x43eef6,0xc9))[_0x300b('0x3e')](handleError(_0x43eef6,null));};exports[_0x300b('0x4c')]=function(_0x5309a3,_0x224375){if(_0x5309a3['body']['id']){delete _0x5309a3[_0x300b('0x44')]['id'];}return db[_0x300b('0x3b')][_0x300b('0x42')]({'where':{'id':_0x5309a3[_0x300b('0x40')]['id']}})[_0x300b('0x20')](handleEntityNotFound(_0x224375,null))[_0x300b('0x20')](saveUpdates(_0x5309a3[_0x300b('0x44')],null))[_0x300b('0x20')](respondWithResult(_0x224375,null))[_0x300b('0x3e')](handleError(_0x224375,null));};exports[_0x300b('0x21')]=function(_0x873b9a,_0x1d6672){return db[_0x300b('0x3b')][_0x300b('0x42')]({'where':{'id':_0x873b9a['params']['id']}})[_0x300b('0x20')](handleEntityNotFound(_0x1d6672,null))[_0x300b('0x20')](removeEntity(_0x1d6672,null))['catch'](handleError(_0x1d6672,null));}; \ No newline at end of file +var _0x702d=['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','offset','limit','undefined','count','set','Content-Range','apply','save','destroy','then','get','Tags','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','Tag','includeAll','include','rows','show','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel'];(function(_0x2604d8,_0x445628){var _0x54e7c8=function(_0x255ec4){while(--_0x255ec4){_0x2604d8['push'](_0x2604d8['shift']());}};_0x54e7c8(++_0x445628);}(_0x702d,0x147));var _0xd702=function(_0x20eebc,_0x253840){_0x20eebc=_0x20eebc-0x0;var _0x44309d=_0x702d[_0x20eebc];return _0x44309d;};'use strict';var emlformat=require(_0xd702('0x0'));var rimraf=require(_0xd702('0x1'));var zipdir=require(_0xd702('0x2'));var jsonpatch=require(_0xd702('0x3'));var rp=require(_0xd702('0x4'));var moment=require('moment');var BPromise=require(_0xd702('0x5'));var Mustache=require(_0xd702('0x6'));var util=require(_0xd702('0x7'));var path=require(_0xd702('0x8'));var sox=require('sox');var csv=require(_0xd702('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd702('0xa'));var _=require(_0xd702('0xb'));var squel=require(_0xd702('0xc'));var crypto=require('crypto');var jsforce=require(_0xd702('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd702('0x9'));var querystring=require(_0xd702('0xe'));var Papa=require(_0xd702('0xf'));var Redis=require(_0xd702('0x10'));var authService=require(_0xd702('0x11'));var qs=require(_0xd702('0x12'));var as=require(_0xd702('0x13'));var hardwareService=require(_0xd702('0x14'));var logger=require(_0xd702('0x15'))(_0xd702('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd702('0x17'));var db=require(_0xd702('0x18'))['db'];function respondWithStatusCode(_0x273577,_0x5c0dad){_0x5c0dad=_0x5c0dad||0xcc;return function(_0x13ee5a){if(_0x13ee5a){return _0x273577[_0xd702('0x19')](_0x5c0dad);}return _0x273577[_0xd702('0x1a')](_0x5c0dad)[_0xd702('0x1b')]();};}function respondWithResult(_0x3948f8,_0x181ff2){_0x181ff2=_0x181ff2||0xc8;return function(_0x59dd33){if(_0x59dd33){return _0x3948f8[_0xd702('0x1a')](_0x181ff2)[_0xd702('0x1c')](_0x59dd33);}};}function respondWithFilteredResult(_0x5d7978,_0x707b9){return function(_0x4922f8){if(_0x4922f8){var _0x268c66=typeof _0x707b9[_0xd702('0x1d')]==='undefined'&&typeof _0x707b9[_0xd702('0x1e')]===_0xd702('0x1f');var _0x2a87f2=_0x4922f8['count'];var _0x5b3b1d=_0x268c66?0x0:_0x707b9[_0xd702('0x1d')];var _0x5a296e=_0x268c66?_0x4922f8[_0xd702('0x20')]:_0x707b9[_0xd702('0x1d')]+_0x707b9[_0xd702('0x1e')];var _0x265b1b;if(_0x5a296e>=_0x2a87f2){_0x5a296e=_0x2a87f2;_0x265b1b=0xc8;}else{_0x265b1b=0xce;}_0x5d7978[_0xd702('0x1a')](_0x265b1b);return _0x5d7978[_0xd702('0x21')](_0xd702('0x22'),_0x5b3b1d+'-'+_0x5a296e+'/'+_0x2a87f2)['json'](_0x4922f8);}return null;};}function patchUpdates(_0x4be140){return function(_0x536ca8){try{jsonpatch[_0xd702('0x23')](_0x536ca8,_0x4be140,!![]);}catch(_0x109284){return BPromise['reject'](_0x109284);}return _0x536ca8[_0xd702('0x24')]();};}function saveUpdates(_0x5d91fd,_0xc4c246){return function(_0x5824ec){if(_0x5824ec){return _0x5824ec['update'](_0x5d91fd)['then'](function(_0x21c00e){return _0x21c00e;});}return null;};}function removeEntity(_0xeec2e4,_0x459184){return function(_0x49761c){if(_0x49761c){return _0x49761c[_0xd702('0x25')]()[_0xd702('0x26')](function(){var _0x10599a=_0x49761c[_0xd702('0x27')]({'plain':!![]});var _0x1200ed=_0xd702('0x28');return db[_0xd702('0x29')][_0xd702('0x25')]({'where':{'type':_0x1200ed,'resourceId':_0x10599a['id']}})[_0xd702('0x26')](function(){return _0x49761c;});})['then'](function(){_0xeec2e4[_0xd702('0x1a')](0xcc)[_0xd702('0x1b')]();});}};}function handleEntityNotFound(_0x25e96a,_0x335202){return function(_0xbe4518){if(!_0xbe4518){_0x25e96a[_0xd702('0x19')](0x194);}return _0xbe4518;};}function handleError(_0x797156,_0x22441b){_0x22441b=_0x22441b||0x1f4;return function(_0x5f1084){logger['error'](_0x5f1084[_0xd702('0x2a')]);if(_0x5f1084[_0xd702('0x2b')]){delete _0x5f1084['name'];}_0x797156[_0xd702('0x1a')](_0x22441b)[_0xd702('0x2c')](_0x5f1084);};}exports[_0xd702('0x2d')]=function(_0x2946ae,_0x56e9cd){var _0x213c31={},_0x313281={},_0x1630ed={'count':0x0,'rows':[]};var _0x43fe18=_[_0xd702('0x2e')](db['Tag'][_0xd702('0x2f')],function(_0x219f41){return{'name':_0x219f41[_0xd702('0x30')],'type':_0x219f41['type'][_0xd702('0x31')]};});_0x313281['model']=_['map'](_0x43fe18,_0xd702('0x2b'));_0x313281[_0xd702('0x32')]=_[_0xd702('0x33')](_0x2946ae['query']);_0x313281[_0xd702('0x34')]=_[_0xd702('0x35')](_0x313281['model'],_0x313281[_0xd702('0x32')]);_0x213c31[_0xd702('0x36')]=_[_0xd702('0x35')](_0x313281[_0xd702('0x37')],qs[_0xd702('0x38')](_0x2946ae[_0xd702('0x32')][_0xd702('0x38')]));_0x213c31[_0xd702('0x36')]=_0x213c31[_0xd702('0x36')][_0xd702('0x39')]?_0x213c31[_0xd702('0x36')]:_0x313281[_0xd702('0x37')];if(!_0x2946ae[_0xd702('0x32')]['hasOwnProperty'](_0xd702('0x3a'))){_0x213c31[_0xd702('0x1e')]=qs[_0xd702('0x1e')](_0x2946ae[_0xd702('0x32')][_0xd702('0x1e')]);_0x213c31[_0xd702('0x1d')]=qs[_0xd702('0x1d')](_0x2946ae['query']['offset']);}_0x213c31[_0xd702('0x3b')]=qs[_0xd702('0x3c')](_0x2946ae['query']['sort']);_0x213c31[_0xd702('0x3d')]=qs[_0xd702('0x34')](_['pick'](_0x2946ae[_0xd702('0x32')],_0x313281[_0xd702('0x34')]),_0x43fe18);if(_0x2946ae[_0xd702('0x32')]['filter']){_0x213c31[_0xd702('0x3d')]=_[_0xd702('0x3e')](_0x213c31[_0xd702('0x3d')],{'$or':_['map'](_0x43fe18,function(_0x45acfc){if(_0x45acfc['type']!==_0xd702('0x3f')){var _0x239bec={};_0x239bec[_0x45acfc[_0xd702('0x2b')]]={'$like':'%'+_0x2946ae[_0xd702('0x32')][_0xd702('0x40')]+'%'};return _0x239bec;}})});}_0x213c31=_[_0xd702('0x3e')]({},_0x213c31,_0x2946ae[_0xd702('0x41')]);var _0x388efa={'where':_0x213c31['where']};return db[_0xd702('0x42')][_0xd702('0x20')](_0x388efa)[_0xd702('0x26')](function(_0x3d703e){_0x1630ed[_0xd702('0x20')]=_0x3d703e;if(_0x2946ae['query'][_0xd702('0x43')]){_0x213c31[_0xd702('0x44')]=[{'all':!![]}];}return db[_0xd702('0x42')]['findAll'](_0x213c31);})[_0xd702('0x26')](function(_0x3a1ed5){_0x1630ed[_0xd702('0x45')]=_0x3a1ed5;return _0x1630ed;})[_0xd702('0x26')](respondWithFilteredResult(_0x56e9cd,_0x213c31))['catch'](handleError(_0x56e9cd,null));};exports[_0xd702('0x46')]=function(_0xfa5e9,_0x1743bd){var _0x3579ea={'raw':!![],'where':{'id':_0xfa5e9['params']['id']}},_0x185e4a={};_0x185e4a[_0xd702('0x37')]=_[_0xd702('0x33')](db['Tag']['rawAttributes']);_0x185e4a[_0xd702('0x32')]=_[_0xd702('0x33')](_0xfa5e9[_0xd702('0x32')]);_0x185e4a[_0xd702('0x34')]=_[_0xd702('0x35')](_0x185e4a[_0xd702('0x37')],_0x185e4a[_0xd702('0x32')]);_0x3579ea[_0xd702('0x36')]=_[_0xd702('0x35')](_0x185e4a['model'],qs['fields'](_0xfa5e9[_0xd702('0x32')]['fields']));_0x3579ea[_0xd702('0x36')]=_0x3579ea['attributes'][_0xd702('0x39')]?_0x3579ea['attributes']:_0x185e4a[_0xd702('0x37')];if(_0xfa5e9['query'][_0xd702('0x43')]){_0x3579ea[_0xd702('0x44')]=[{'all':!![]}];}_0x3579ea=_['merge']({},_0x3579ea,_0xfa5e9[_0xd702('0x41')]);return db[_0xd702('0x42')][_0xd702('0x47')](_0x3579ea)[_0xd702('0x26')](handleEntityNotFound(_0x1743bd,null))[_0xd702('0x26')](respondWithResult(_0x1743bd,null))['catch'](handleError(_0x1743bd,null));};exports[_0xd702('0x48')]=function(_0x14c1db,_0x2d09be){return db['Tag'][_0xd702('0x48')](_0x14c1db['body'],{})[_0xd702('0x26')](function(_0x9a970b){var _0x1bd39e=_0x14c1db['user']['get']({'plain':!![]});if(!_0x1bd39e)throw new Error(_0xd702('0x49'));if(_0x1bd39e[_0xd702('0x4a')]===_0xd702('0x4b')){var _0x397e91=_0x9a970b[_0xd702('0x27')]({'plain':!![]});var _0x2274bd=_0xd702('0x28');return db[_0xd702('0x4c')][_0xd702('0x47')]({'where':{'name':_0x2274bd,'userProfileId':_0x1bd39e[_0xd702('0x4d')]},'raw':!![]})['then'](function(_0x4efdc7){if(_0x4efdc7&&_0x4efdc7[_0xd702('0x4e')]===0x0){return db[_0xd702('0x29')][_0xd702('0x48')]({'name':_0x397e91['name'],'resourceId':_0x397e91['id'],'type':_0x4efdc7['name'],'sectionId':_0x4efdc7['id']},{})[_0xd702('0x26')](function(){return _0x9a970b;});}else{return _0x9a970b;}})['catch'](function(_0x46b92e){logger[_0xd702('0x4f')](_0xd702('0x50'),_0x46b92e);throw _0x46b92e;});}return _0x9a970b;})[_0xd702('0x26')](respondWithResult(_0x2d09be,0xc9))[_0xd702('0x51')](handleError(_0x2d09be,null));};exports[_0xd702('0x52')]=function(_0x475e03,_0x2863a3){if(_0x475e03[_0xd702('0x53')]['id']){delete _0x475e03['body']['id'];}return db[_0xd702('0x42')][_0xd702('0x47')]({'where':{'id':_0x475e03[_0xd702('0x54')]['id']}})[_0xd702('0x26')](handleEntityNotFound(_0x2863a3,null))['then'](saveUpdates(_0x475e03[_0xd702('0x53')],null))['then'](respondWithResult(_0x2863a3,null))[_0xd702('0x51')](handleError(_0x2863a3,null));};exports['destroy']=function(_0x581360,_0x2a31c0){return db[_0xd702('0x42')][_0xd702('0x47')]({'where':{'id':_0x581360[_0xd702('0x54')]['id']}})[_0xd702('0x26')](handleEntityNotFound(_0x2a31c0,null))[_0xd702('0x26')](removeEntity(_0x2a31c0,null))['catch'](handleError(_0x2a31c0,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 0633e8f..46af968 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 _0x8a5e=['define','Tag','tools_tags','lodash','../../config/logger','api','path','../../config/environment','exports'];(function(_0x5f4ec0,_0x3d1ef5){var _0x472b2f=function(_0x4242c9){while(--_0x4242c9){_0x5f4ec0['push'](_0x5f4ec0['shift']());}};_0x472b2f(++_0x3d1ef5);}(_0x8a5e,0xc0));var _0xe8a5=function(_0x50405d,_0x2327cd){_0x50405d=_0x50405d-0x0;var _0x39ad85=_0x8a5e[_0x50405d];return _0x39ad85;};'use strict';var _=require(_0xe8a5('0x0'));var util=require('util');var logger=require(_0xe8a5('0x1'))(_0xe8a5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe8a5('0x3'));var rimraf=require('rimraf');var config=require(_0xe8a5('0x4'));var attributes=require('./tag.attributes');module[_0xe8a5('0x5')]=function(_0x4d503f,_0xd60518){return _0x4d503f[_0xe8a5('0x6')](_0xe8a5('0x7'),attributes,{'tableName':_0xe8a5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x72f8=['rimraf','../../config/environment','./tag.attributes','exports','define','tools_tags','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x5ac602,_0x5a92a4){var _0x464a2d=function(_0x5b4bc2){while(--_0x5b4bc2){_0x5ac602['push'](_0x5ac602['shift']());}};_0x464a2d(++_0x5a92a4);}(_0x72f8,0x6e));var _0x872f=function(_0x2962d5,_0x38deda){_0x2962d5=_0x2962d5-0x0;var _0x273406=_0x72f8[_0x2962d5];return _0x273406;};'use strict';var _=require(_0x872f('0x0'));var util=require(_0x872f('0x1'));var logger=require(_0x872f('0x2'))(_0x872f('0x3'));var moment=require(_0x872f('0x4'));var BPromise=require(_0x872f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x872f('0x6'));var rimraf=require(_0x872f('0x7'));var config=require(_0x872f('0x8'));var attributes=require(_0x872f('0x9'));module[_0x872f('0xa')]=function(_0x3bb376,_0x1f7d52){return _0x3bb376[_0x872f('0xb')]('Tag',attributes,{'tableName':_0x872f('0xc'),'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 0475798..0af37c7 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 _0x984b=['Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','bluebird','randomstring','ioredis','../../config/logger','rpc','client','http','then','info'];(function(_0x49184b,_0x8be366){var _0x398d8b=function(_0x3270f4){while(--_0x3270f4){_0x49184b['push'](_0x49184b['shift']());}};_0x398d8b(++_0x8be366);}(_0x984b,0xee));var _0xb984=function(_0x1981b3,_0x510d27){_0x1981b3=_0x1981b3-0x0;var _0x1a959b=_0x984b[_0x1981b3];return _0x1a959b;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xb984('0x0'));var rs=require(_0xb984('0x1'));var fs=require('fs');var Redis=require(_0xb984('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb984('0x3'))(_0xb984('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb984('0x5')][_0xb984('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5a605a,_0x7405cd,_0x1a00d6){return new BPromise(function(_0x4d72b7,_0x37fd36){return client['request'](_0x5a605a,_0x1a00d6)[_0xb984('0x7')](function(_0x42dfd9){logger[_0xb984('0x8')](_0xb984('0x9'),_0x7405cd,_0xb984('0xa'));logger[_0xb984('0xb')](_0xb984('0xc'),_0x7405cd,_0xb984('0xa'),JSON[_0xb984('0xd')](_0x42dfd9));if(_0x42dfd9[_0xb984('0xe')]){if(_0x42dfd9[_0xb984('0xe')][_0xb984('0xf')]===0x1f4){logger['error'](_0xb984('0x9'),_0x7405cd,_0x42dfd9['error'][_0xb984('0x10')]);return _0x37fd36(_0x42dfd9[_0xb984('0xe')]['message']);}logger[_0xb984('0xe')](_0xb984('0x9'),_0x7405cd,_0x42dfd9['error'][_0xb984('0x10')]);return _0x4d72b7(_0x42dfd9[_0xb984('0xe')]['message']);}else{logger[_0xb984('0x8')](_0xb984('0x9'),_0x7405cd,'request\x20sent');_0x4d72b7(_0x42dfd9[_0xb984('0x11')]['message']);}})[_0xb984('0x12')](function(_0x1dc4df){logger[_0xb984('0xe')](_0xb984('0x9'),_0x7405cd,_0x1dc4df);_0x37fd36(_0x1dc4df);});});} \ No newline at end of file +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(_0xe4971c,_0x5e5ae2){var _0x1f5c80=function(_0x382d57){while(--_0x382d57){_0xe4971c['push'](_0xe4971c['shift']());}};_0x1f5c80(++_0x5e5ae2);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb6b1[_0x2641f9];return _0x585741;};'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 diff --git a/server/api/team/index.js b/server/api/team/index.js index d53f804..d76c62f 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(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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 bf9c11a..2ddd0d5 100644 --- a/server/api/team/team.attributes.js +++ b/server/api/team/team.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['name','exports','STRING'];(function(_0x86a6f,_0x23ec10){var _0x3e3d7c=function(_0x338b46){while(--_0x338b46){_0x86a6f['push'](_0x86a6f['shift']());}};_0x3e3d7c(++_0x23ec10);}(_0x2032,0xd9));var _0x2203=function(_0x8b899,_0x1058a1){_0x8b899=_0x8b899-0x0;var _0x32cb42=_0x2032[_0x8b899];return _0x32cb42;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0713=['STRING','name'];(function(_0x2d140d,_0x262d51){var _0x4b462c=function(_0x390714){while(--_0x390714){_0x2d140d['push'](_0x2d140d['shift']());}};_0x4b462c(++_0x262d51);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 7dcf45e..e32bee2 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 _0xc674=['offset','limit','undefined','count','json','apply','reject','save','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','Team','findAll','rows','show','includeAll','include','options','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','destroy','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','sequelize','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','SELECT','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','end','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','addQueues','add','ids','removeQueues','remove','Queues','addAgents','Voice','Chat','Mail','Sms','Fax','Openchannel','penalty','QueueId','User','findOrCreate','emit','Queue:save','interface','UserVoiceQueueRt','upsert','isNil','TeamVoiceQueue','all','spread','removeAgents','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./team.socket','sendStatus','status'];(function(_0x4f25f9,_0x255051){var _0x92083c=function(_0x46ab7b){while(--_0x46ab7b){_0x4f25f9['push'](_0x4f25f9['shift']());}};_0x92083c(++_0x255051);}(_0xc674,0x1b6));var _0x4c67=function(_0x3238ea,_0x91809d){_0x3238ea=_0x3238ea-0x0;var _0x4aaac2=_0xc674[_0x3238ea];return _0x4aaac2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4c67('0x0'));var zipdir=require(_0x4c67('0x1'));var jsonpatch=require(_0x4c67('0x2'));var rp=require(_0x4c67('0x3'));var moment=require(_0x4c67('0x4'));var BPromise=require(_0x4c67('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4c67('0x6'));var sox=require(_0x4c67('0x7'));var csv=require(_0x4c67('0x8'));var ejs=require(_0x4c67('0x9'));var fs=require('fs');var fs_extra=require(_0x4c67('0xa'));var _=require(_0x4c67('0xb'));var squel=require(_0x4c67('0xc'));var crypto=require(_0x4c67('0xd'));var jsforce=require(_0x4c67('0xe'));var deskjs=require(_0x4c67('0xf'));var toCsv=require(_0x4c67('0x8'));var querystring=require(_0x4c67('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4c67('0x11'));var qs=require(_0x4c67('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4c67('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x4c67('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x4c67('0x15'));var db=require(_0x4c67('0x16'))['db'];config['redis']=_[_0x4c67('0x17')](config['redis'],{'host':_0x4c67('0x18'),'port':0x18eb});var socket=require(_0x4c67('0x19'))(new Redis(config[_0x4c67('0x1a')]));require(_0x4c67('0x1b'))['register'](socket);function respondWithStatusCode(_0x419c6d,_0x4fa7cf){_0x4fa7cf=_0x4fa7cf||0xcc;return function(_0x185d63){if(_0x185d63){return _0x419c6d[_0x4c67('0x1c')](_0x4fa7cf);}return _0x419c6d[_0x4c67('0x1d')](_0x4fa7cf)['end']();};}function respondWithResult(_0x4dfca6,_0x228d9e){_0x228d9e=_0x228d9e||0xc8;return function(_0x48931a){if(_0x48931a){return _0x4dfca6[_0x4c67('0x1d')](_0x228d9e)['json'](_0x48931a);}};}function respondWithFilteredResult(_0x327809,_0x51e4ed){return function(_0x5756c1){if(_0x5756c1){var _0x256123=typeof _0x51e4ed[_0x4c67('0x1e')]==='undefined'&&typeof _0x51e4ed[_0x4c67('0x1f')]===_0x4c67('0x20');var _0x465cab=_0x5756c1[_0x4c67('0x21')];var _0x241244=_0x256123?0x0:_0x51e4ed[_0x4c67('0x1e')];var _0x236f6f=_0x256123?_0x5756c1['count']:_0x51e4ed[_0x4c67('0x1e')]+_0x51e4ed['limit'];var _0x33df73;if(_0x236f6f>=_0x465cab){_0x236f6f=_0x465cab;_0x33df73=0xc8;}else{_0x33df73=0xce;}_0x327809[_0x4c67('0x1d')](_0x33df73);return _0x327809['set']('Content-Range',_0x241244+'-'+_0x236f6f+'/'+_0x465cab)[_0x4c67('0x22')](_0x5756c1);}return null;};}function patchUpdates(_0x4441dd){return function(_0x17b853){try{jsonpatch[_0x4c67('0x23')](_0x17b853,_0x4441dd,!![]);}catch(_0x4bf6ed){return BPromise[_0x4c67('0x24')](_0x4bf6ed);}return _0x17b853[_0x4c67('0x25')]();};}function saveUpdates(_0x307d3d,_0x4e3769){return function(_0x4564cc){if(_0x4564cc){return _0x4564cc['update'](_0x307d3d)[_0x4c67('0x26')](function(_0x444c58){return _0x444c58;});}return null;};}function handleEntityNotFound(_0x146fe7,_0x66d6ae){return function(_0x2349e1){if(!_0x2349e1){_0x146fe7['sendStatus'](0x194);}return _0x2349e1;};}function handleError(_0x237326,_0x3735c6){_0x3735c6=_0x3735c6||0x1f4;return function(_0x1d623b){logger['error'](_0x1d623b[_0x4c67('0x27')]);if(_0x1d623b[_0x4c67('0x28')]){delete _0x1d623b['name'];}_0x237326['status'](_0x3735c6)[_0x4c67('0x29')](_0x1d623b);};}exports[_0x4c67('0x2a')]=function(_0x43871a,_0x4a05f9){var _0x5c8ae1={},_0x8c2b93={},_0x3eaa56={'count':0x0,'rows':[]};var _0xdaf475=_[_0x4c67('0x2b')](db['Team'][_0x4c67('0x2c')],function(_0x3045fa){return{'name':_0x3045fa[_0x4c67('0x2d')],'type':_0x3045fa[_0x4c67('0x2e')][_0x4c67('0x2f')]};});_0x8c2b93[_0x4c67('0x30')]=_[_0x4c67('0x2b')](_0xdaf475,'name');_0x8c2b93[_0x4c67('0x31')]=_[_0x4c67('0x32')](_0x43871a['query']);_0x8c2b93[_0x4c67('0x33')]=_[_0x4c67('0x34')](_0x8c2b93['model'],_0x8c2b93['query']);_0x5c8ae1[_0x4c67('0x35')]=_[_0x4c67('0x34')](_0x8c2b93[_0x4c67('0x30')],qs[_0x4c67('0x36')](_0x43871a[_0x4c67('0x31')][_0x4c67('0x36')]));_0x5c8ae1[_0x4c67('0x35')]=_0x5c8ae1[_0x4c67('0x35')][_0x4c67('0x37')]?_0x5c8ae1[_0x4c67('0x35')]:_0x8c2b93[_0x4c67('0x30')];if(!_0x43871a[_0x4c67('0x31')][_0x4c67('0x38')](_0x4c67('0x39'))){_0x5c8ae1[_0x4c67('0x1f')]=qs[_0x4c67('0x1f')](_0x43871a['query'][_0x4c67('0x1f')]);_0x5c8ae1[_0x4c67('0x1e')]=qs[_0x4c67('0x1e')](_0x43871a[_0x4c67('0x31')]['offset']);}_0x5c8ae1[_0x4c67('0x3a')]=qs[_0x4c67('0x3b')](_0x43871a[_0x4c67('0x31')]['sort']);_0x5c8ae1[_0x4c67('0x3c')]=qs['filters'](_[_0x4c67('0x3d')](_0x43871a[_0x4c67('0x31')],_0x8c2b93['filters']),_0xdaf475);if(_0x43871a[_0x4c67('0x31')]['filter']){_0x5c8ae1[_0x4c67('0x3c')]=_[_0x4c67('0x3e')](_0x5c8ae1['where'],{'$or':_[_0x4c67('0x2b')](_0xdaf475,function(_0x41d3ad){if(_0x41d3ad[_0x4c67('0x2e')]!==_0x4c67('0x3f')){var _0x2ee5d7={};_0x2ee5d7[_0x41d3ad['name']]={'$like':'%'+_0x43871a[_0x4c67('0x31')][_0x4c67('0x40')]+'%'};return _0x2ee5d7;}})});}_0x5c8ae1=_[_0x4c67('0x3e')]({},_0x5c8ae1,_0x43871a['options']);var _0x2992c5={'where':_0x5c8ae1[_0x4c67('0x3c')]};return db[_0x4c67('0x41')][_0x4c67('0x21')](_0x2992c5)['then'](function(_0x36f083){_0x3eaa56[_0x4c67('0x21')]=_0x36f083;if(_0x43871a['query']['includeAll']){_0x5c8ae1['include']=[{'all':!![]}];}return db['Team'][_0x4c67('0x42')](_0x5c8ae1);})[_0x4c67('0x26')](function(_0x534169){_0x3eaa56[_0x4c67('0x43')]=_0x534169;return _0x3eaa56;})[_0x4c67('0x26')](respondWithFilteredResult(_0x4a05f9,_0x5c8ae1))['catch'](handleError(_0x4a05f9,null));};exports[_0x4c67('0x44')]=function(_0x2974f5,_0x1fe93a){var _0x1ce833={'raw':![],'where':{'id':_0x2974f5['params']['id']}},_0x31a71e={};_0x31a71e[_0x4c67('0x30')]=_[_0x4c67('0x32')](db[_0x4c67('0x41')][_0x4c67('0x2c')]);_0x31a71e['query']=_[_0x4c67('0x32')](_0x2974f5[_0x4c67('0x31')]);_0x31a71e[_0x4c67('0x33')]=_[_0x4c67('0x34')](_0x31a71e[_0x4c67('0x30')],_0x31a71e[_0x4c67('0x31')]);_0x1ce833['attributes']=_[_0x4c67('0x34')](_0x31a71e['model'],qs['fields'](_0x2974f5[_0x4c67('0x31')][_0x4c67('0x36')]));_0x1ce833[_0x4c67('0x35')]=_0x1ce833[_0x4c67('0x35')][_0x4c67('0x37')]?_0x1ce833[_0x4c67('0x35')]:_0x31a71e[_0x4c67('0x30')];if(_0x2974f5[_0x4c67('0x31')][_0x4c67('0x45')]){_0x1ce833[_0x4c67('0x46')]=[{'all':!![]}];}_0x1ce833=_[_0x4c67('0x3e')]({},_0x1ce833,_0x2974f5[_0x4c67('0x47')]);return db[_0x4c67('0x41')][_0x4c67('0x48')](_0x1ce833)[_0x4c67('0x26')](handleEntityNotFound(_0x1fe93a,null))[_0x4c67('0x26')](respondWithResult(_0x1fe93a,null))[_0x4c67('0x49')](handleError(_0x1fe93a,null));};exports[_0x4c67('0x4a')]=function(_0x5961ba,_0x5b1de1){return db['Team']['create'](_0x5961ba[_0x4c67('0x4b')],{})[_0x4c67('0x26')](function(_0x2d1862){var _0x302d8d=_0x5961ba[_0x4c67('0x4c')][_0x4c67('0x4d')]({'plain':!![]});if(!_0x302d8d)throw new Error(_0x4c67('0x4e'));if(_0x302d8d[_0x4c67('0x4f')]===_0x4c67('0x4c')){var _0x43732f=_0x2d1862[_0x4c67('0x4d')]({'plain':!![]});var _0x3cabc4=_0x4c67('0x50');return db[_0x4c67('0x51')][_0x4c67('0x48')]({'where':{'name':_0x3cabc4,'userProfileId':_0x302d8d[_0x4c67('0x52')]},'raw':!![]})[_0x4c67('0x26')](function(_0x3397d8){if(_0x3397d8&&_0x3397d8['autoAssociation']===0x0){return db[_0x4c67('0x53')][_0x4c67('0x4a')]({'name':_0x43732f[_0x4c67('0x28')],'resourceId':_0x43732f['id'],'type':_0x3397d8[_0x4c67('0x28')],'sectionId':_0x3397d8['id']},{})['then'](function(){return _0x2d1862;});}else{return _0x2d1862;}})[_0x4c67('0x49')](function(_0x34fd0e){logger[_0x4c67('0x54')](_0x4c67('0x55'),_0x34fd0e);throw _0x34fd0e;});}return _0x2d1862;})[_0x4c67('0x26')](respondWithResult(_0x5b1de1,0xc9))[_0x4c67('0x49')](handleError(_0x5b1de1,null));};exports[_0x4c67('0x56')]=function(_0x1e38f8,_0x468092){if(_0x1e38f8['body']['id']){delete _0x1e38f8[_0x4c67('0x4b')]['id'];}return db['Team'][_0x4c67('0x48')]({'where':{'id':_0x1e38f8[_0x4c67('0x57')]['id']}})[_0x4c67('0x26')](handleEntityNotFound(_0x468092,null))['then'](saveUpdates(_0x1e38f8[_0x4c67('0x4b')],null))[_0x4c67('0x26')](respondWithResult(_0x468092,null))[_0x4c67('0x49')](handleError(_0x468092,null));};exports[_0x4c67('0x58')]=function(_0x13105e,_0x20d6df){var _0x900b90=_0x13105e[_0x4c67('0x57')]['id'];var _0x4773a8=[];return db['sequelize'][_0x4c67('0x59')](function(_0x4a9ff3){var _0x39408e=_0x4c67('0x5a')+_0x900b90;return db['sequelize'][_0x4c67('0x31')](_0x39408e,{'type':db[_0x4c67('0x5b')][_0x4c67('0x5c')]['SELECT'],'raw':!![],'transaction':_0x4a9ff3})[_0x4c67('0x26')](function(_0x1f1e6b){_0x4773a8=_[_0x4c67('0x2b')](_0x1f1e6b,function(_0x40cf14){return Number(_0x40cf14[_0x4c67('0x5d')]);});})[_0x4c67('0x26')](function(){var _0x48fc4d=_0x4c67('0x5e')+_0x900b90;return db[_0x4c67('0x5f')][_0x4c67('0x31')](_0x48fc4d,{'type':db[_0x4c67('0x5b')][_0x4c67('0x5c')]['SELECT'],'raw':!![],'transaction':_0x4a9ff3});})[_0x4c67('0x26')](function(_0x38248a){var _0x4efc4b=_[_0x4c67('0x2b')](_0x38248a,function(_0x47e20f){return Number(_0x47e20f[_0x4c67('0x60')]);});return db[_0x4c67('0x61')]['destroy']({'where':{'UserId':{'$in':_0x4773a8},'VoiceQueueId':{'$in':_0x4efc4b}},'transaction':_0x4a9ff3});})[_0x4c67('0x26')](function(){var _0x4c6c49=_0x4c67('0x62')+_0x900b90;return db[_0x4c67('0x5f')][_0x4c67('0x31')](_0x4c6c49,{'type':db[_0x4c67('0x5b')][_0x4c67('0x5c')][_0x4c67('0x63')],'raw':!![],'transaction':_0x4a9ff3});})['then'](function(_0x55f2bb){var _0x16662f=_[_0x4c67('0x2b')](_0x55f2bb,function(_0x5279c6){return Number(_0x5279c6[_0x4c67('0x64')]);});return db[_0x4c67('0x65')]['destroy']({'where':{'UserId':{'$in':_0x4773a8},'MailQueueId':{'$in':_0x16662f}},'transaction':_0x4a9ff3});})['then'](function(){var _0x52ee4f=_0x4c67('0x66')+_0x900b90;return db[_0x4c67('0x5f')][_0x4c67('0x31')](_0x52ee4f,{'type':db[_0x4c67('0x5b')][_0x4c67('0x5c')][_0x4c67('0x63')],'raw':!![],'transaction':_0x4a9ff3});})[_0x4c67('0x26')](function(_0x4bfdb2){var _0x193291=_[_0x4c67('0x2b')](_0x4bfdb2,function(_0x3f52d1){return Number(_0x3f52d1[_0x4c67('0x67')]);});return db[_0x4c67('0x68')][_0x4c67('0x58')]({'where':{'UserId':{'$in':_0x4773a8},'SmsQueueId':{'$in':_0x193291}},'transaction':_0x4a9ff3});})[_0x4c67('0x26')](function(){var _0x17978b=_0x4c67('0x69')+_0x900b90;return db[_0x4c67('0x5f')][_0x4c67('0x31')](_0x17978b,{'type':db[_0x4c67('0x5b')]['QueryTypes'][_0x4c67('0x63')],'raw':!![],'transaction':_0x4a9ff3});})[_0x4c67('0x26')](function(_0x1cd0ae){var _0x18d34b=_[_0x4c67('0x2b')](_0x1cd0ae,function(_0x262ab5){return Number(_0x262ab5[_0x4c67('0x6a')]);});return db[_0x4c67('0x6b')]['destroy']({'where':{'UserId':{'$in':_0x4773a8},'ChatQueueId':{'$in':_0x18d34b}},'transaction':_0x4a9ff3});})[_0x4c67('0x26')](function(){var _0x3b73ac=_0x4c67('0x6c')+_0x900b90;return db['sequelize'][_0x4c67('0x31')](_0x3b73ac,{'type':db['Sequelize']['QueryTypes'][_0x4c67('0x63')],'raw':!![],'transaction':_0x4a9ff3});})[_0x4c67('0x26')](function(_0xaa208a){var _0x263725=_['map'](_0xaa208a,function(_0x445186){return Number(_0x445186[_0x4c67('0x6d')]);});return db[_0x4c67('0x6e')][_0x4c67('0x58')]({'where':{'UserId':{'$in':_0x4773a8},'FaxQueueId':{'$in':_0x263725}},'transaction':_0x4a9ff3});})[_0x4c67('0x26')](function(){var _0x56f164=_0x4c67('0x6f')+_0x900b90;return db[_0x4c67('0x5f')]['query'](_0x56f164,{'type':db[_0x4c67('0x5b')][_0x4c67('0x5c')][_0x4c67('0x63')],'raw':!![],'transaction':_0x4a9ff3});})[_0x4c67('0x26')](function(_0x4b6531){var _0x527320=_[_0x4c67('0x2b')](_0x4b6531,function(_0x332d25){return Number(_0x332d25['OpenchannelQueueId']);});return db[_0x4c67('0x70')][_0x4c67('0x58')]({'where':{'UserId':{'$in':_0x4773a8},'OpenchannelQueueId':{'$in':_0x527320}},'transaction':_0x4a9ff3});})[_0x4c67('0x26')](function(){var _0x55ef60=_0x4c67('0x71')+_0x900b90;return db[_0x4c67('0x5f')][_0x4c67('0x31')](_0x55ef60,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x4a9ff3});})[_0x4c67('0x26')](function(_0x56c02a){var _0x5686f4=_[_0x4c67('0x2b')](_0x56c02a,function(_0x4f1b12){return Number(_0x4f1b12[_0x4c67('0x72')]);});return db['UserWhatsappQueue'][_0x4c67('0x58')]({'where':{'UserId':{'$in':_0x4773a8},'WhatsappQueueId':{'$in':_0x5686f4}},'transaction':_0x4a9ff3});})[_0x4c67('0x26')](function(){return db[_0x4c67('0x73')][_0x4c67('0x48')]({'where':{'TeamId':_0x900b90}});})[_0x4c67('0x26')](function(_0x54441e){if(_0x54441e===null){return;}return db[_0x4c67('0x74')][_0x4c67('0x58')]({'where':{'UserId':{'$in':_0x4773a8},'VoicePrefixId':_0x54441e[_0x4c67('0x75')]},'transaction':_0x4a9ff3});})[_0x4c67('0x26')](function(){return db['Team'][_0x4c67('0x58')]({'where':{'id':_0x900b90},'cascade':!![],'transaction':_0x4a9ff3});})[_0x4c67('0x26')](function(_0x5f0107){if(_0x5f0107===0x0){_0x20d6df[_0x4c67('0x1c')](0x194);}else{return db[_0x4c67('0x53')]['destroy']({'where':{'type':_0x4c67('0x50'),'resourceId':_0x900b90},'cascade':!![],'transaction':_0x4a9ff3})['then'](function(){_0x20d6df['status'](0xcc)[_0x4c67('0x76')]();});}})[_0x4c67('0x49')](function(_0x2f69be){_0x20d6df[_0x4c67('0x1d')](0x1f4)['send'](_0x2f69be);});});};exports['getQueues']=function(_0x53fb98,_0x3f59c5,_0x1af975){return db[_0x4c67('0x41')][_0x4c67('0x77')]({'where':{'id':_0x53fb98['params']['id']}})[_0x4c67('0x26')](handleEntityNotFound(_0x3f59c5,null))[_0x4c67('0x26')](function(_0x15fd33){if(!_0x53fb98[_0x4c67('0x31')][_0x4c67('0x78')]||!utils[_0x4c67('0x79')](_0x53fb98[_0x4c67('0x31')][_0x4c67('0x78')])){throw new db[(_0x4c67('0x5b'))][(_0x4c67('0x7a'))](_0x4c67('0x7b'));}var _0x3d606f={};var _0x4c8a06={};_0x4c8a06[_0x4c67('0x30')]=_[_0x4c67('0x32')](db[_[_0x4c67('0x7c')](_0x53fb98[_0x4c67('0x31')]['channel'][_0x4c67('0x7d')]())+_0x4c67('0x7e')][_0x4c67('0x2c')]);_0x4c8a06[_0x4c67('0x31')]=_['keys'](_0x53fb98[_0x4c67('0x31')]);_0x4c8a06[_0x4c67('0x33')]=_[_0x4c67('0x34')](_0x4c8a06[_0x4c67('0x30')],_0x4c8a06[_0x4c67('0x31')]);_0x3d606f[_0x4c67('0x35')]=_['intersection'](_0x4c8a06[_0x4c67('0x30')],qs['fields'](_0x53fb98['query'][_0x4c67('0x36')]));_0x3d606f[_0x4c67('0x35')]=_0x3d606f['attributes'][_0x4c67('0x37')]?_0x3d606f[_0x4c67('0x35')]:_0x4c8a06[_0x4c67('0x30')];_0x3d606f['limit']=qs[_0x4c67('0x1f')](_0x53fb98[_0x4c67('0x31')][_0x4c67('0x1f')]);_0x3d606f[_0x4c67('0x1e')]=qs[_0x4c67('0x1e')](_0x53fb98['query'][_0x4c67('0x1e')]);_0x3d606f['order']=qs[_0x4c67('0x3b')](_0x53fb98[_0x4c67('0x31')][_0x4c67('0x3b')]);_0x3d606f[_0x4c67('0x3c')]=qs['filters'](_['pick'](_0x53fb98['query'],_0x4c8a06['filters']));_0x3d606f=_[_0x4c67('0x3e')]({},_0x3d606f,_0x53fb98[_0x4c67('0x47')]);return _0x15fd33['get'+_[_0x4c67('0x7c')](_0x53fb98[_0x4c67('0x31')]['channel'][_0x4c67('0x7d')]())+'Queues'](_0x3d606f);})[_0x4c67('0x26')](respondWithResult(_0x3f59c5,null))[_0x4c67('0x49')](handleError(_0x3f59c5,null));};exports[_0x4c67('0x7f')]=function(_0x458cb9,_0x17cb80,_0x1296d3){return db[_0x4c67('0x41')][_0x4c67('0x77')]({'where':{'id':_0x458cb9['params']['id']}})[_0x4c67('0x26')](function(_0x3b35ea){if(_0x3b35ea){if(!_0x458cb9[_0x4c67('0x4b')][_0x4c67('0x78')]||!utils[_0x4c67('0x79')](_0x458cb9[_0x4c67('0x4b')][_0x4c67('0x78')])){throw new db['Sequelize'][(_0x4c67('0x7a'))](_0x4c67('0x7b'));}return _0x3b35ea[_0x4c67('0x80')+_[_0x4c67('0x7c')](_0x458cb9[_0x4c67('0x4b')]['channel']['toLowerCase']())+'Queues'](_0x458cb9[_0x4c67('0x4b')][_0x4c67('0x81')]);}return null;})[_0x4c67('0x26')](handleEntityNotFound(_0x17cb80,null))[_0x4c67('0x26')](respondWithStatusCode(_0x17cb80,null))[_0x4c67('0x49')](handleError(_0x17cb80,null));};exports[_0x4c67('0x82')]=function(_0xd23902,_0x135af6,_0x3e9008){return db[_0x4c67('0x41')][_0x4c67('0x77')]({'where':{'id':_0xd23902[_0x4c67('0x57')]['id']}})[_0x4c67('0x26')](function(_0x104c91){if(_0x104c91){if(!_0xd23902[_0x4c67('0x31')][_0x4c67('0x78')]||!utils[_0x4c67('0x79')](_0xd23902[_0x4c67('0x31')][_0x4c67('0x78')])){throw new db[(_0x4c67('0x5b'))][(_0x4c67('0x7a'))](_0x4c67('0x7b'));}return _0x104c91[_0x4c67('0x83')+_['capitalize'](_0xd23902[_0x4c67('0x31')]['channel']['toLowerCase']())+_0x4c67('0x84')](_0xd23902[_0x4c67('0x31')][_0x4c67('0x81')]);}return null;})[_0x4c67('0x26')](handleEntityNotFound(_0x135af6,null))['then'](respondWithStatusCode(_0x135af6,null))[_0x4c67('0x49')](handleError(_0x135af6,null));};exports[_0x4c67('0x85')]=function(_0x775859,_0x2d80b9){var _0x182571=_['isArray'](_0x775859[_0x4c67('0x4b')][_0x4c67('0x81')])?_0x775859[_0x4c67('0x4b')][_0x4c67('0x81')]:[_0x775859[_0x4c67('0x4b')][_0x4c67('0x81')]];var _0xac10b1=_0x775859[_0x4c67('0x57')]['id'];return db['Team'][_0x4c67('0x48')]({'where':{'id':_0xac10b1}})['then'](handleEntityNotFound(_0x2d80b9,null))['then'](function(_0x49ba31){if(_0x49ba31){var _0x366313=[_0x4c67('0x86'),_0x4c67('0x87'),_0x4c67('0x88'),_0x4c67('0x89'),_0x4c67('0x8a'),_0x4c67('0x8b'),'Whatsapp'];return db[_0x4c67('0x5f')][_0x4c67('0x59')](function(_0x53b83d){var _0x1c85ee=_[_0x4c67('0x2b')](_0x366313,function(_0x711cd9){var _0xda8b61={'attributes':['id',_0x4c67('0x28')]};if(_0x711cd9==='Voice'){_0xda8b61['through']={'attributes':[_0x4c67('0x8c')]};}return _0x49ba31[_0x4c67('0x4d')+_0x711cd9+'Queues'](_0xda8b61)[_0x4c67('0x26')](function(_0x32d3cd){var _0x515797=_['map'](_0x32d3cd,function(_0x34db54){var _0x94145d=_['map'](_0x182571,function(_0x330f31){var _0x51dfa5={'where':{'UserId':_0x330f31,[_0x711cd9+_0x4c67('0x8d')]:_0x34db54['id']},'transaction':_0x53b83d};if(_0x711cd9===_0x4c67('0x86')){_0x51dfa5[_0x4c67('0x17')]={'penalty':_0x34db54['TeamVoiceQueue']['penalty']};}return db[_0x4c67('0x8e')+_0x711cd9+_0x4c67('0x7e')][_0x4c67('0x8f')](_0x51dfa5)[_0x4c67('0x26')](function(){socket[_0x4c67('0x90')](_0x4c67('0x4c')+_0x711cd9+_0x4c67('0x91'),{'UserId':_0x330f31,[_0x711cd9+_0x4c67('0x8d')]:_0x34db54['id']});if(_0x711cd9!==_0x4c67('0x86')){return;}return db[_0x4c67('0x8e')]['findAll']({'where':{'id':_0x182571,'online':0x1},'attributes':['id','name','online','voicePause',_0x4c67('0x92')],'raw':!![]})['then'](function(_0x39aacb){var _0x5ee151=_[_0x4c67('0x2b')](_0x39aacb,function(_0x436422){return db[_0x4c67('0x93')][_0x4c67('0x94')]({'membername':_0x436422[_0x4c67('0x28')],'UserId':_0x436422['id'],'queue_name':_0x34db54[_0x4c67('0x28')],'VoiceQueueId':_0x34db54['id'],'interface':_[_0x4c67('0x95')](_0x436422['interface'])?util['format']('SIP/%s',_0x436422[_0x4c67('0x28')]):_0x436422['interface'],'paused':_0x436422['voicePause']||![],'penalty':_0x34db54[_0x4c67('0x96')][_0x4c67('0x8c')]},{'transaction':_0x53b83d});});return Promise['all'](_0x5ee151);});});});return Promise[_0x4c67('0x97')](_0x94145d);});return Promise['all'](_0x515797);})[_0x4c67('0x26')](function(){return db[_0x4c67('0x73')]['findOne']({'where':{'teamId':_0xac10b1}})[_0x4c67('0x26')](function(_0xed0d1f){if(_0xed0d1f){var _0x4224dd=_[_0x4c67('0x2b')](_0x182571,function(_0x2176ea){db[_0x4c67('0x74')][_0x4c67('0x94')]({'UserId':_0x2176ea,'VoicePrefixId':_0xed0d1f['VoicePrefixId']});});return Promise[_0x4c67('0x97')](_0x4224dd);}});});});return Promise[_0x4c67('0x97')](_0x1c85ee)[_0x4c67('0x26')](function(){return _0x49ba31[_0x4c67('0x85')](_0x182571,{'transaction':_0x53b83d})[_0x4c67('0x98')](function(_0x1bf304){return _0x1bf304;});});});}})[_0x4c67('0x26')](respondWithResult(_0x2d80b9,null))[_0x4c67('0x49')](handleError(_0x2d80b9,null));};exports[_0x4c67('0x99')]=function(_0x33cef1,_0x3e6246){var _0x2f6829=_[_0x4c67('0x9a')](_0x33cef1[_0x4c67('0x31')]['ids'])?_0x33cef1[_0x4c67('0x31')][_0x4c67('0x81')]:[_0x33cef1[_0x4c67('0x31')][_0x4c67('0x81')]];var _0x2b008e=_0x33cef1[_0x4c67('0x57')]['id'];return db[_0x4c67('0x41')][_0x4c67('0x48')]({'where':{'id':_0x2b008e}})['then'](handleEntityNotFound(_0x3e6246,null))[_0x4c67('0x26')](function(_0x22809d){if(_0x22809d){var _0x2aaf85=[_0x4c67('0x86'),_0x4c67('0x87'),_0x4c67('0x88'),'Sms',_0x4c67('0x8a'),_0x4c67('0x8b'),'Whatsapp'];return db[_0x4c67('0x5f')]['transaction'](function(_0x512bac){var _0x471dcc=_['map'](_0x2aaf85,function(_0x442857){var _0x44fc5e={'attributes':['id',_0x4c67('0x28')]};return _0x22809d[_0x4c67('0x4d')+_0x442857+'Queues'](_0x44fc5e)[_0x4c67('0x26')](function(_0x44f78){var _0x4ca2f1=_[_0x4c67('0x2b')](_0x44f78,function(_0x3e9653){return _0x3e9653[_0x4c67('0x99')](_0x2f6829,{'transaction':_0x512bac})[_0x4c67('0x26')](function(){var _0x63c80c=_['map'](_0x2f6829,function(_0x51cc7d){socket['emit'](_0x4c67('0x4c')+_0x442857+'Queue:remove',{'UserId':Number(_0x51cc7d),[_0x442857+_0x4c67('0x8d')]:_0x3e9653['id']});if(_0x442857!==_0x4c67('0x86')){return;}return db[_0x4c67('0x93')]['destroy']({'where':{'VoiceQueueId':_0x3e9653['id'],'UserId':_0x51cc7d},'transaction':_0x512bac});});return Promise[_0x4c67('0x97')](_0x63c80c);});});return Promise[_0x4c67('0x97')](_0x4ca2f1);});});return Promise[_0x4c67('0x97')](_0x471dcc)[_0x4c67('0x26')](function(){return _0x22809d['removeAgents'](_0x2f6829,{'transaction':_0x512bac});})['then'](function(){return db['TeamVoicePrefix'][_0x4c67('0x77')]({'where':{'teamId':_0x2b008e}})[_0x4c67('0x26')](function(_0x33b6d7){if(_0x33b6d7){var _0x1dba57=_['map'](_0x2f6829,function(_0x5e0cc3){db[_0x4c67('0x74')][_0x4c67('0x58')]({'where':{'UserId':_0x5e0cc3,'VoicePrefixId':_0x33b6d7['VoicePrefixId']}});});return Promise[_0x4c67('0x97')](_0x1dba57);}});});});}})[_0x4c67('0x26')](respondWithStatusCode(_0x3e6246,null))[_0x4c67('0x49')](handleError(_0x3e6246,null));};exports[_0x4c67('0x9b')]=function(_0x40cd69,_0x2a6bca,_0x5f370a){var _0x3c89ba={};var _0x44db97={};var _0x29345e;var _0x1edc4d;return db['Team'][_0x4c67('0x77')]({'where':{'id':_0x40cd69[_0x4c67('0x57')]['id']}})[_0x4c67('0x26')](handleEntityNotFound(_0x2a6bca,null))['then'](function(_0x2e9539){if(_0x2e9539){_0x29345e=_0x2e9539;_0x44db97[_0x4c67('0x30')]=_[_0x4c67('0x32')](db['User']['rawAttributes']);_0x44db97[_0x4c67('0x31')]=_['keys'](_0x40cd69[_0x4c67('0x31')]);_0x44db97[_0x4c67('0x33')]=_[_0x4c67('0x34')](_0x44db97[_0x4c67('0x30')],_0x44db97[_0x4c67('0x31')]);_0x3c89ba['attributes']=_[_0x4c67('0x34')](_0x44db97['model'],qs[_0x4c67('0x36')](_0x40cd69[_0x4c67('0x31')][_0x4c67('0x36')]));_0x3c89ba[_0x4c67('0x35')]=_0x3c89ba['attributes'][_0x4c67('0x37')]?_0x3c89ba['attributes']:_0x44db97[_0x4c67('0x30')];_0x3c89ba[_0x4c67('0x3a')]=qs[_0x4c67('0x3b')](_0x40cd69[_0x4c67('0x31')]['sort']);_0x3c89ba[_0x4c67('0x3c')]=qs[_0x4c67('0x33')](_[_0x4c67('0x3d')](_0x40cd69[_0x4c67('0x31')],_0x44db97[_0x4c67('0x33')]));if(_0x40cd69['query'][_0x4c67('0x40')]){_0x3c89ba['where']=_[_0x4c67('0x3e')](_0x3c89ba['where'],{'$or':_[_0x4c67('0x2b')](_0x3c89ba[_0x4c67('0x35')],function(_0x1e6700){var _0x441110={};_0x441110[_0x1e6700]={'$like':'%'+_0x40cd69['query'][_0x4c67('0x40')]+'%'};return _0x441110;})});}_0x3c89ba=_[_0x4c67('0x3e')]({},_0x3c89ba,_0x40cd69[_0x4c67('0x47')]);return _0x29345e['getAgents'](_0x3c89ba);}})[_0x4c67('0x26')](function(_0x6597cd){if(_0x6597cd){_0x1edc4d=_0x6597cd['length'];if(!_0x40cd69[_0x4c67('0x31')][_0x4c67('0x38')](_0x4c67('0x39'))){_0x3c89ba[_0x4c67('0x1f')]=qs[_0x4c67('0x1f')](_0x40cd69[_0x4c67('0x31')][_0x4c67('0x1f')]);_0x3c89ba[_0x4c67('0x1e')]=qs['offset'](_0x40cd69[_0x4c67('0x31')]['offset']);}return _0x29345e[_0x4c67('0x9b')](_0x3c89ba);}})[_0x4c67('0x26')](function(_0x14c8dd){if(_0x14c8dd){return _0x14c8dd?{'count':_0x1edc4d,'rows':_0x14c8dd}:null;}})[_0x4c67('0x26')](respondWithResult(_0x2a6bca,null))[_0x4c67('0x49')](handleError(_0x2a6bca,null));}; \ No newline at end of file +var _0x87b1=['upsert','isNil','format','SIP/%s','all','UserVoicePrefix','addAgents','spread','removeAgents','emit','getAgents','eml-format','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./team.socket','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','stack','name','send','map','Team','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Teams','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','sequelize','transaction','Sequelize','QueryTypes','SELECT','UserId','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','UserMailQueue','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','UserFaxQueue','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','VoicePrefixId','getQueues','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','pick','addQueues','findOne','add','Queues','ids','remove','isArray','Voice','Mail','Sms','Fax','Openchannel','Whatsapp','through','penalty','QueueId','TeamVoiceQueue','User','Queue','findOrCreate','online','interface','UserVoiceQueueRt'];(function(_0x1ac120,_0x3e7e45){var _0x19b703=function(_0x5f32cb){while(--_0x5f32cb){_0x1ac120['push'](_0x1ac120['shift']());}};_0x19b703(++_0x3e7e45);}(_0x87b1,0xa2));var _0x187b=function(_0x40bfde,_0x13168a){_0x40bfde=_0x40bfde-0x0;var _0x3d25ad=_0x87b1[_0x40bfde];return _0x3d25ad;};'use strict';var emlformat=require(_0x187b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x187b('0x1'));var moment=require(_0x187b('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x187b('0x3'));var path=require(_0x187b('0x4'));var sox=require(_0x187b('0x5'));var csv=require(_0x187b('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x187b('0x7'));var _=require(_0x187b('0x8'));var squel=require(_0x187b('0x9'));var crypto=require(_0x187b('0xa'));var jsforce=require(_0x187b('0xb'));var deskjs=require(_0x187b('0xc'));var toCsv=require(_0x187b('0x6'));var querystring=require(_0x187b('0xd'));var Papa=require(_0x187b('0xe'));var Redis=require(_0x187b('0xf'));var authService=require(_0x187b('0x10'));var qs=require(_0x187b('0x11'));var as=require(_0x187b('0x12'));var hardwareService=require(_0x187b('0x13'));var logger=require(_0x187b('0x14'))(_0x187b('0x15'));var utils=require('../../config/utils');var config=require(_0x187b('0x16'));var licenseUtil=require(_0x187b('0x17'));var db=require(_0x187b('0x18'))['db'];config['redis']=_[_0x187b('0x19')](config[_0x187b('0x1a')],{'host':_0x187b('0x1b'),'port':0x18eb});var socket=require(_0x187b('0x1c'))(new Redis(config[_0x187b('0x1a')]));require(_0x187b('0x1d'))['register'](socket);function respondWithStatusCode(_0x9cd8de,_0x24ebe6){_0x24ebe6=_0x24ebe6||0xcc;return function(_0xb7f582){if(_0xb7f582){return _0x9cd8de[_0x187b('0x1e')](_0x24ebe6);}return _0x9cd8de[_0x187b('0x1f')](_0x24ebe6)[_0x187b('0x20')]();};}function respondWithResult(_0x24dbd4,_0x44dd22){_0x44dd22=_0x44dd22||0xc8;return function(_0x156755){if(_0x156755){return _0x24dbd4[_0x187b('0x1f')](_0x44dd22)[_0x187b('0x21')](_0x156755);}};}function respondWithFilteredResult(_0x23f828,_0x404f2c){return function(_0x383013){if(_0x383013){var _0x3c6de5=typeof _0x404f2c[_0x187b('0x22')]===_0x187b('0x23')&&typeof _0x404f2c[_0x187b('0x24')]===_0x187b('0x23');var _0x5cac25=_0x383013[_0x187b('0x25')];var _0x156991=_0x3c6de5?0x0:_0x404f2c[_0x187b('0x22')];var _0x26f163=_0x3c6de5?_0x383013[_0x187b('0x25')]:_0x404f2c[_0x187b('0x22')]+_0x404f2c[_0x187b('0x24')];var _0x5a4866;if(_0x26f163>=_0x5cac25){_0x26f163=_0x5cac25;_0x5a4866=0xc8;}else{_0x5a4866=0xce;}_0x23f828[_0x187b('0x1f')](_0x5a4866);return _0x23f828['set'](_0x187b('0x26'),_0x156991+'-'+_0x26f163+'/'+_0x5cac25)[_0x187b('0x21')](_0x383013);}return null;};}function patchUpdates(_0x2cdcc0){return function(_0x1fa0ec){try{jsonpatch[_0x187b('0x27')](_0x1fa0ec,_0x2cdcc0,!![]);}catch(_0xfe4af0){return BPromise[_0x187b('0x28')](_0xfe4af0);}return _0x1fa0ec[_0x187b('0x29')]();};}function saveUpdates(_0x211eeb,_0x36c8fd){return function(_0x580f36){if(_0x580f36){return _0x580f36[_0x187b('0x2a')](_0x211eeb)['then'](function(_0x375879){return _0x375879;});}return null;};}function handleEntityNotFound(_0x4b5688,_0x1baaa0){return function(_0x10f51f){if(!_0x10f51f){_0x4b5688[_0x187b('0x1e')](0x194);}return _0x10f51f;};}function handleError(_0x1a3a05,_0x565350){_0x565350=_0x565350||0x1f4;return function(_0x3cb573){logger['error'](_0x3cb573[_0x187b('0x2b')]);if(_0x3cb573['name']){delete _0x3cb573[_0x187b('0x2c')];}_0x1a3a05['status'](_0x565350)[_0x187b('0x2d')](_0x3cb573);};}exports['index']=function(_0x572c28,_0x57e7db){var _0x560731={},_0x4338dd={},_0x4aba2b={'count':0x0,'rows':[]};var _0x7c1b98=_[_0x187b('0x2e')](db[_0x187b('0x2f')][_0x187b('0x30')],function(_0x4a83fa){return{'name':_0x4a83fa['fieldName'],'type':_0x4a83fa[_0x187b('0x31')][_0x187b('0x32')]};});_0x4338dd[_0x187b('0x33')]=_['map'](_0x7c1b98,_0x187b('0x2c'));_0x4338dd[_0x187b('0x34')]=_['keys'](_0x572c28[_0x187b('0x34')]);_0x4338dd[_0x187b('0x35')]=_['intersection'](_0x4338dd[_0x187b('0x33')],_0x4338dd[_0x187b('0x34')]);_0x560731[_0x187b('0x36')]=_[_0x187b('0x37')](_0x4338dd[_0x187b('0x33')],qs[_0x187b('0x38')](_0x572c28[_0x187b('0x34')][_0x187b('0x38')]));_0x560731[_0x187b('0x36')]=_0x560731[_0x187b('0x36')][_0x187b('0x39')]?_0x560731[_0x187b('0x36')]:_0x4338dd[_0x187b('0x33')];if(!_0x572c28['query'][_0x187b('0x3a')](_0x187b('0x3b'))){_0x560731[_0x187b('0x24')]=qs[_0x187b('0x24')](_0x572c28['query'][_0x187b('0x24')]);_0x560731[_0x187b('0x22')]=qs['offset'](_0x572c28[_0x187b('0x34')][_0x187b('0x22')]);}_0x560731[_0x187b('0x3c')]=qs[_0x187b('0x3d')](_0x572c28[_0x187b('0x34')][_0x187b('0x3d')]);_0x560731[_0x187b('0x3e')]=qs['filters'](_['pick'](_0x572c28['query'],_0x4338dd[_0x187b('0x35')]),_0x7c1b98);if(_0x572c28[_0x187b('0x34')][_0x187b('0x3f')]){_0x560731['where']=_[_0x187b('0x40')](_0x560731[_0x187b('0x3e')],{'$or':_['map'](_0x7c1b98,function(_0x11b028){if(_0x11b028['type']!==_0x187b('0x41')){var _0x10685c={};_0x10685c[_0x11b028[_0x187b('0x2c')]]={'$like':'%'+_0x572c28[_0x187b('0x34')][_0x187b('0x3f')]+'%'};return _0x10685c;}})});}_0x560731=_[_0x187b('0x40')]({},_0x560731,_0x572c28[_0x187b('0x42')]);var _0x2eed51={'where':_0x560731[_0x187b('0x3e')]};return db[_0x187b('0x2f')][_0x187b('0x25')](_0x2eed51)[_0x187b('0x43')](function(_0x5d4431){_0x4aba2b[_0x187b('0x25')]=_0x5d4431;if(_0x572c28[_0x187b('0x34')][_0x187b('0x44')]){_0x560731[_0x187b('0x45')]=[{'all':!![]}];}return db[_0x187b('0x2f')][_0x187b('0x46')](_0x560731);})['then'](function(_0x4d0665){_0x4aba2b[_0x187b('0x47')]=_0x4d0665;return _0x4aba2b;})['then'](respondWithFilteredResult(_0x57e7db,_0x560731))[_0x187b('0x48')](handleError(_0x57e7db,null));};exports['show']=function(_0x1bd796,_0x4d6fba){var _0x14a132={'raw':![],'where':{'id':_0x1bd796['params']['id']}},_0x4c0eb5={};_0x4c0eb5['model']=_['keys'](db['Team']['rawAttributes']);_0x4c0eb5[_0x187b('0x34')]=_[_0x187b('0x49')](_0x1bd796['query']);_0x4c0eb5[_0x187b('0x35')]=_[_0x187b('0x37')](_0x4c0eb5['model'],_0x4c0eb5[_0x187b('0x34')]);_0x14a132[_0x187b('0x36')]=_[_0x187b('0x37')](_0x4c0eb5[_0x187b('0x33')],qs[_0x187b('0x38')](_0x1bd796[_0x187b('0x34')][_0x187b('0x38')]));_0x14a132[_0x187b('0x36')]=_0x14a132[_0x187b('0x36')]['length']?_0x14a132[_0x187b('0x36')]:_0x4c0eb5[_0x187b('0x33')];if(_0x1bd796['query'][_0x187b('0x44')]){_0x14a132['include']=[{'all':!![]}];}_0x14a132=_[_0x187b('0x40')]({},_0x14a132,_0x1bd796['options']);return db[_0x187b('0x2f')][_0x187b('0x4a')](_0x14a132)['then'](handleEntityNotFound(_0x4d6fba,null))['then'](respondWithResult(_0x4d6fba,null))[_0x187b('0x48')](handleError(_0x4d6fba,null));};exports['create']=function(_0x2fc37e,_0x546ae9){return db[_0x187b('0x2f')][_0x187b('0x4b')](_0x2fc37e[_0x187b('0x4c')],{})[_0x187b('0x43')](function(_0x2981a5){var _0x44b251=_0x2fc37e[_0x187b('0x4d')][_0x187b('0x4e')]({'plain':!![]});if(!_0x44b251)throw new Error(_0x187b('0x4f'));if(_0x44b251['role']===_0x187b('0x4d')){var _0x55826c=_0x2981a5[_0x187b('0x4e')]({'plain':!![]});var _0x5e7c8e=_0x187b('0x50');return db['UserProfileSection'][_0x187b('0x4a')]({'where':{'name':_0x5e7c8e,'userProfileId':_0x44b251[_0x187b('0x51')]},'raw':!![]})[_0x187b('0x43')](function(_0xab8920){if(_0xab8920&&_0xab8920[_0x187b('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0x55826c[_0x187b('0x2c')],'resourceId':_0x55826c['id'],'type':_0xab8920[_0x187b('0x2c')],'sectionId':_0xab8920['id']},{})[_0x187b('0x43')](function(){return _0x2981a5;});}else{return _0x2981a5;}})[_0x187b('0x48')](function(_0x4b9671){logger[_0x187b('0x53')](_0x187b('0x54'),_0x4b9671);throw _0x4b9671;});}return _0x2981a5;})[_0x187b('0x43')](respondWithResult(_0x546ae9,0xc9))['catch'](handleError(_0x546ae9,null));};exports[_0x187b('0x2a')]=function(_0x56428a,_0xa808ec){if(_0x56428a['body']['id']){delete _0x56428a[_0x187b('0x4c')]['id'];}return db[_0x187b('0x2f')]['find']({'where':{'id':_0x56428a[_0x187b('0x55')]['id']}})[_0x187b('0x43')](handleEntityNotFound(_0xa808ec,null))[_0x187b('0x43')](saveUpdates(_0x56428a[_0x187b('0x4c')],null))['then'](respondWithResult(_0xa808ec,null))['catch'](handleError(_0xa808ec,null));};exports[_0x187b('0x56')]=function(_0x6bc33,_0x32ea82){var _0x4beac4=_0x6bc33[_0x187b('0x55')]['id'];var _0x7a774e=[];return db[_0x187b('0x57')][_0x187b('0x58')](function(_0x18586b){var _0x481b35='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x4beac4;return db[_0x187b('0x57')][_0x187b('0x34')](_0x481b35,{'type':db[_0x187b('0x59')][_0x187b('0x5a')][_0x187b('0x5b')],'raw':!![],'transaction':_0x18586b})[_0x187b('0x43')](function(_0x1a00bf){_0x7a774e=_[_0x187b('0x2e')](_0x1a00bf,function(_0x10489b){return Number(_0x10489b[_0x187b('0x5c')]);});})[_0x187b('0x43')](function(){var _0x2c3750='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4beac4;return db[_0x187b('0x57')][_0x187b('0x34')](_0x2c3750,{'type':db[_0x187b('0x59')][_0x187b('0x5a')]['SELECT'],'raw':!![],'transaction':_0x18586b});})[_0x187b('0x43')](function(_0x537ab3){var _0x3d4bc2=_[_0x187b('0x2e')](_0x537ab3,function(_0x485a4f){return Number(_0x485a4f[_0x187b('0x5d')]);});return db[_0x187b('0x5e')][_0x187b('0x56')]({'where':{'UserId':{'$in':_0x7a774e},'VoiceQueueId':{'$in':_0x3d4bc2}},'transaction':_0x18586b});})[_0x187b('0x43')](function(){var _0x490bbe=_0x187b('0x5f')+_0x4beac4;return db[_0x187b('0x57')][_0x187b('0x34')](_0x490bbe,{'type':db[_0x187b('0x59')][_0x187b('0x5a')][_0x187b('0x5b')],'raw':!![],'transaction':_0x18586b});})[_0x187b('0x43')](function(_0x8788e){var _0x492d27=_[_0x187b('0x2e')](_0x8788e,function(_0x33457e){return Number(_0x33457e['MailQueueId']);});return db[_0x187b('0x60')]['destroy']({'where':{'UserId':{'$in':_0x7a774e},'MailQueueId':{'$in':_0x492d27}},'transaction':_0x18586b});})['then'](function(){var _0x4ea820='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4beac4;return db[_0x187b('0x57')]['query'](_0x4ea820,{'type':db['Sequelize'][_0x187b('0x5a')][_0x187b('0x5b')],'raw':!![],'transaction':_0x18586b});})[_0x187b('0x43')](function(_0x3cb682){var _0x1eade3=_['map'](_0x3cb682,function(_0x4d298d){return Number(_0x4d298d[_0x187b('0x61')]);});return db['UserSmsQueue'][_0x187b('0x56')]({'where':{'UserId':{'$in':_0x7a774e},'SmsQueueId':{'$in':_0x1eade3}},'transaction':_0x18586b});})[_0x187b('0x43')](function(){var _0x5af1d2=_0x187b('0x62')+_0x4beac4;return db[_0x187b('0x57')][_0x187b('0x34')](_0x5af1d2,{'type':db[_0x187b('0x59')][_0x187b('0x5a')][_0x187b('0x5b')],'raw':!![],'transaction':_0x18586b});})[_0x187b('0x43')](function(_0x3e164b){var _0x4dc047=_['map'](_0x3e164b,function(_0x29cb26){return Number(_0x29cb26[_0x187b('0x63')]);});return db[_0x187b('0x64')][_0x187b('0x56')]({'where':{'UserId':{'$in':_0x7a774e},'ChatQueueId':{'$in':_0x4dc047}},'transaction':_0x18586b});})[_0x187b('0x43')](function(){var _0x49ebba='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4beac4;return db[_0x187b('0x57')][_0x187b('0x34')](_0x49ebba,{'type':db[_0x187b('0x59')][_0x187b('0x5a')][_0x187b('0x5b')],'raw':!![],'transaction':_0x18586b});})[_0x187b('0x43')](function(_0x19830a){var _0x2670cc=_[_0x187b('0x2e')](_0x19830a,function(_0x5841a2){return Number(_0x5841a2['FaxQueueId']);});return db[_0x187b('0x65')][_0x187b('0x56')]({'where':{'UserId':{'$in':_0x7a774e},'FaxQueueId':{'$in':_0x2670cc}},'transaction':_0x18586b});})['then'](function(){var _0xafdd44='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4beac4;return db[_0x187b('0x57')][_0x187b('0x34')](_0xafdd44,{'type':db[_0x187b('0x59')]['QueryTypes'][_0x187b('0x5b')],'raw':!![],'transaction':_0x18586b});})[_0x187b('0x43')](function(_0x3b209d){var _0x3f8c26=_[_0x187b('0x2e')](_0x3b209d,function(_0x5ab607){return Number(_0x5ab607[_0x187b('0x66')]);});return db[_0x187b('0x67')][_0x187b('0x56')]({'where':{'UserId':{'$in':_0x7a774e},'OpenchannelQueueId':{'$in':_0x3f8c26}},'transaction':_0x18586b});})[_0x187b('0x43')](function(){var _0x41b80c=_0x187b('0x68')+_0x4beac4;return db['sequelize']['query'](_0x41b80c,{'type':db[_0x187b('0x59')]['QueryTypes'][_0x187b('0x5b')],'raw':!![],'transaction':_0x18586b});})[_0x187b('0x43')](function(_0xa59a2c){var _0x3b9e32=_[_0x187b('0x2e')](_0xa59a2c,function(_0x2bf1e7){return Number(_0x2bf1e7[_0x187b('0x69')]);});return db[_0x187b('0x6a')]['destroy']({'where':{'UserId':{'$in':_0x7a774e},'WhatsappQueueId':{'$in':_0x3b9e32}},'transaction':_0x18586b});})[_0x187b('0x43')](function(){return db[_0x187b('0x6b')][_0x187b('0x4a')]({'where':{'TeamId':_0x4beac4}});})[_0x187b('0x43')](function(_0x3be930){if(_0x3be930===null){return;}return db['UserVoicePrefix'][_0x187b('0x56')]({'where':{'UserId':{'$in':_0x7a774e},'VoicePrefixId':_0x3be930[_0x187b('0x6c')]},'transaction':_0x18586b});})[_0x187b('0x43')](function(){return db[_0x187b('0x2f')][_0x187b('0x56')]({'where':{'id':_0x4beac4},'cascade':!![],'transaction':_0x18586b});})[_0x187b('0x43')](function(_0x2e5ee7){if(_0x2e5ee7===0x0){_0x32ea82[_0x187b('0x1e')](0x194);}else{return db['UserProfileResource'][_0x187b('0x56')]({'where':{'type':'Teams','resourceId':_0x4beac4},'cascade':!![],'transaction':_0x18586b})[_0x187b('0x43')](function(){_0x32ea82[_0x187b('0x1f')](0xcc)[_0x187b('0x20')]();});}})['catch'](function(_0x340b59){_0x32ea82[_0x187b('0x1f')](0x1f4)[_0x187b('0x2d')](_0x340b59);});});};exports[_0x187b('0x6d')]=function(_0x4d65fc,_0x496d36,_0x37daa3){return db[_0x187b('0x2f')]['findOne']({'where':{'id':_0x4d65fc[_0x187b('0x55')]['id']}})[_0x187b('0x43')](handleEntityNotFound(_0x496d36,null))[_0x187b('0x43')](function(_0x2250b1){if(!_0x4d65fc[_0x187b('0x34')][_0x187b('0x6e')]||!utils[_0x187b('0x6f')](_0x4d65fc[_0x187b('0x34')][_0x187b('0x6e')])){throw new db[(_0x187b('0x59'))][(_0x187b('0x70'))](_0x187b('0x71'));}var _0x39df7b={};var _0x41d028={};_0x41d028['model']=_[_0x187b('0x49')](db[_[_0x187b('0x72')](_0x4d65fc['query']['channel'][_0x187b('0x73')]())+'Queue'][_0x187b('0x30')]);_0x41d028[_0x187b('0x34')]=_[_0x187b('0x49')](_0x4d65fc[_0x187b('0x34')]);_0x41d028[_0x187b('0x35')]=_[_0x187b('0x37')](_0x41d028[_0x187b('0x33')],_0x41d028[_0x187b('0x34')]);_0x39df7b['attributes']=_[_0x187b('0x37')](_0x41d028[_0x187b('0x33')],qs['fields'](_0x4d65fc[_0x187b('0x34')]['fields']));_0x39df7b[_0x187b('0x36')]=_0x39df7b[_0x187b('0x36')][_0x187b('0x39')]?_0x39df7b[_0x187b('0x36')]:_0x41d028[_0x187b('0x33')];_0x39df7b[_0x187b('0x24')]=qs[_0x187b('0x24')](_0x4d65fc[_0x187b('0x34')][_0x187b('0x24')]);_0x39df7b['offset']=qs[_0x187b('0x22')](_0x4d65fc[_0x187b('0x34')]['offset']);_0x39df7b[_0x187b('0x3c')]=qs[_0x187b('0x3d')](_0x4d65fc[_0x187b('0x34')][_0x187b('0x3d')]);_0x39df7b[_0x187b('0x3e')]=qs[_0x187b('0x35')](_[_0x187b('0x74')](_0x4d65fc['query'],_0x41d028[_0x187b('0x35')]));_0x39df7b=_['merge']({},_0x39df7b,_0x4d65fc[_0x187b('0x42')]);return _0x2250b1[_0x187b('0x4e')+_[_0x187b('0x72')](_0x4d65fc[_0x187b('0x34')][_0x187b('0x6e')][_0x187b('0x73')]())+'Queues'](_0x39df7b);})[_0x187b('0x43')](respondWithResult(_0x496d36,null))[_0x187b('0x48')](handleError(_0x496d36,null));};exports[_0x187b('0x75')]=function(_0x117420,_0x335a79,_0x1031e3){return db[_0x187b('0x2f')][_0x187b('0x76')]({'where':{'id':_0x117420['params']['id']}})[_0x187b('0x43')](function(_0x8f0080){if(_0x8f0080){if(!_0x117420['body'][_0x187b('0x6e')]||!utils[_0x187b('0x6f')](_0x117420[_0x187b('0x4c')][_0x187b('0x6e')])){throw new db[(_0x187b('0x59'))][(_0x187b('0x70'))](_0x187b('0x71'));}return _0x8f0080[_0x187b('0x77')+_[_0x187b('0x72')](_0x117420['body']['channel'][_0x187b('0x73')]())+_0x187b('0x78')](_0x117420[_0x187b('0x4c')][_0x187b('0x79')]);}return null;})[_0x187b('0x43')](handleEntityNotFound(_0x335a79,null))[_0x187b('0x43')](respondWithStatusCode(_0x335a79,null))[_0x187b('0x48')](handleError(_0x335a79,null));};exports['removeQueues']=function(_0x606a5b,_0x1a306a,_0x2e73cd){return db['Team'][_0x187b('0x76')]({'where':{'id':_0x606a5b[_0x187b('0x55')]['id']}})[_0x187b('0x43')](function(_0x517784){if(_0x517784){if(!_0x606a5b[_0x187b('0x34')][_0x187b('0x6e')]||!utils[_0x187b('0x6f')](_0x606a5b[_0x187b('0x34')]['channel'])){throw new db['Sequelize'][(_0x187b('0x70'))](_0x187b('0x71'));}return _0x517784[_0x187b('0x7a')+_[_0x187b('0x72')](_0x606a5b['query'][_0x187b('0x6e')][_0x187b('0x73')]())+_0x187b('0x78')](_0x606a5b[_0x187b('0x34')]['ids']);}return null;})[_0x187b('0x43')](handleEntityNotFound(_0x1a306a,null))[_0x187b('0x43')](respondWithStatusCode(_0x1a306a,null))[_0x187b('0x48')](handleError(_0x1a306a,null));};exports['addAgents']=function(_0x3725bc,_0x5bad5a){var _0x31b44c=_[_0x187b('0x7b')](_0x3725bc['body'][_0x187b('0x79')])?_0x3725bc['body'][_0x187b('0x79')]:[_0x3725bc['body']['ids']];var _0x4946a3=_0x3725bc[_0x187b('0x55')]['id'];return db[_0x187b('0x2f')][_0x187b('0x4a')]({'where':{'id':_0x4946a3}})['then'](handleEntityNotFound(_0x5bad5a,null))[_0x187b('0x43')](function(_0x51db24){if(_0x51db24){var _0x2344e3=[_0x187b('0x7c'),'Chat',_0x187b('0x7d'),_0x187b('0x7e'),_0x187b('0x7f'),_0x187b('0x80'),_0x187b('0x81')];return db[_0x187b('0x57')][_0x187b('0x58')](function(_0x14a6a6){var _0x14d4c2=_[_0x187b('0x2e')](_0x2344e3,function(_0x29e385){var _0x11a6b3={'attributes':['id',_0x187b('0x2c')]};if(_0x29e385==='Voice'){_0x11a6b3[_0x187b('0x82')]={'attributes':[_0x187b('0x83')]};}return _0x51db24[_0x187b('0x4e')+_0x29e385+_0x187b('0x78')](_0x11a6b3)[_0x187b('0x43')](function(_0x3ebbb2){var _0x23750c=_[_0x187b('0x2e')](_0x3ebbb2,function(_0x1e2e60){var _0x39132e=_[_0x187b('0x2e')](_0x31b44c,function(_0x59d7ed){var _0x40aba5={'where':{'UserId':_0x59d7ed,[_0x29e385+_0x187b('0x84')]:_0x1e2e60['id']},'transaction':_0x14a6a6};if(_0x29e385==='Voice'){_0x40aba5[_0x187b('0x19')]={'penalty':_0x1e2e60[_0x187b('0x85')][_0x187b('0x83')]};}return db[_0x187b('0x86')+_0x29e385+_0x187b('0x87')][_0x187b('0x88')](_0x40aba5)[_0x187b('0x43')](function(){socket['emit'](_0x187b('0x4d')+_0x29e385+'Queue:save',{'UserId':_0x59d7ed,[_0x29e385+_0x187b('0x84')]:_0x1e2e60['id']});if(_0x29e385!==_0x187b('0x7c')){return;}return db[_0x187b('0x86')]['findAll']({'where':{'id':_0x31b44c,'online':0x1},'attributes':['id',_0x187b('0x2c'),_0x187b('0x89'),'voicePause',_0x187b('0x8a')],'raw':!![]})[_0x187b('0x43')](function(_0x9c342b){var _0x963da7=_[_0x187b('0x2e')](_0x9c342b,function(_0x51844a){return db[_0x187b('0x8b')][_0x187b('0x8c')]({'membername':_0x51844a[_0x187b('0x2c')],'UserId':_0x51844a['id'],'queue_name':_0x1e2e60['name'],'VoiceQueueId':_0x1e2e60['id'],'interface':_[_0x187b('0x8d')](_0x51844a['interface'])?util[_0x187b('0x8e')](_0x187b('0x8f'),_0x51844a[_0x187b('0x2c')]):_0x51844a[_0x187b('0x8a')],'paused':_0x51844a['voicePause']||![],'penalty':_0x1e2e60[_0x187b('0x85')][_0x187b('0x83')]},{'transaction':_0x14a6a6});});return Promise['all'](_0x963da7);});});});return Promise[_0x187b('0x90')](_0x39132e);});return Promise[_0x187b('0x90')](_0x23750c);})[_0x187b('0x43')](function(){return db[_0x187b('0x6b')][_0x187b('0x76')]({'where':{'teamId':_0x4946a3}})[_0x187b('0x43')](function(_0x1649fd){if(_0x1649fd){var _0x3136d7=_[_0x187b('0x2e')](_0x31b44c,function(_0x34edfd){db[_0x187b('0x91')][_0x187b('0x8c')]({'UserId':_0x34edfd,'VoicePrefixId':_0x1649fd[_0x187b('0x6c')]});});return Promise[_0x187b('0x90')](_0x3136d7);}});});});return Promise[_0x187b('0x90')](_0x14d4c2)[_0x187b('0x43')](function(){return _0x51db24[_0x187b('0x92')](_0x31b44c,{'transaction':_0x14a6a6})[_0x187b('0x93')](function(_0x1cfafc){return _0x1cfafc;});});});}})[_0x187b('0x43')](respondWithResult(_0x5bad5a,null))[_0x187b('0x48')](handleError(_0x5bad5a,null));};exports[_0x187b('0x94')]=function(_0x35b2c3,_0x45996c){var _0x329d2e=_[_0x187b('0x7b')](_0x35b2c3['query'][_0x187b('0x79')])?_0x35b2c3['query'][_0x187b('0x79')]:[_0x35b2c3[_0x187b('0x34')]['ids']];var _0x46c52b=_0x35b2c3[_0x187b('0x55')]['id'];return db[_0x187b('0x2f')][_0x187b('0x4a')]({'where':{'id':_0x46c52b}})[_0x187b('0x43')](handleEntityNotFound(_0x45996c,null))[_0x187b('0x43')](function(_0x75f8ec){if(_0x75f8ec){var _0x19ac17=[_0x187b('0x7c'),'Chat',_0x187b('0x7d'),_0x187b('0x7e'),_0x187b('0x7f'),_0x187b('0x80'),'Whatsapp'];return db['sequelize'][_0x187b('0x58')](function(_0x31a345){var _0x1fee94=_['map'](_0x19ac17,function(_0x50335b){var _0x459e0a={'attributes':['id',_0x187b('0x2c')]};return _0x75f8ec[_0x187b('0x4e')+_0x50335b+_0x187b('0x78')](_0x459e0a)[_0x187b('0x43')](function(_0x37657f){var _0x53e197=_['map'](_0x37657f,function(_0x7106ed){return _0x7106ed['removeAgents'](_0x329d2e,{'transaction':_0x31a345})[_0x187b('0x43')](function(){var _0x3cd298=_[_0x187b('0x2e')](_0x329d2e,function(_0x331b3c){socket[_0x187b('0x95')]('user'+_0x50335b+'Queue:remove',{'UserId':Number(_0x331b3c),[_0x50335b+_0x187b('0x84')]:_0x7106ed['id']});if(_0x50335b!==_0x187b('0x7c')){return;}return db[_0x187b('0x8b')][_0x187b('0x56')]({'where':{'VoiceQueueId':_0x7106ed['id'],'UserId':_0x331b3c},'transaction':_0x31a345});});return Promise['all'](_0x3cd298);});});return Promise[_0x187b('0x90')](_0x53e197);});});return Promise[_0x187b('0x90')](_0x1fee94)['then'](function(){return _0x75f8ec[_0x187b('0x94')](_0x329d2e,{'transaction':_0x31a345});})[_0x187b('0x43')](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x46c52b}})['then'](function(_0x27acc0){if(_0x27acc0){var _0x355f83=_[_0x187b('0x2e')](_0x329d2e,function(_0xa8133){db[_0x187b('0x91')][_0x187b('0x56')]({'where':{'UserId':_0xa8133,'VoicePrefixId':_0x27acc0['VoicePrefixId']}});});return Promise[_0x187b('0x90')](_0x355f83);}});});});}})[_0x187b('0x43')](respondWithStatusCode(_0x45996c,null))[_0x187b('0x48')](handleError(_0x45996c,null));};exports[_0x187b('0x96')]=function(_0x264592,_0x3c494b,_0xd45f46){var _0x1f622f={};var _0x33ddc5={};var _0x43d003;var _0x18f430;return db['Team']['findOne']({'where':{'id':_0x264592[_0x187b('0x55')]['id']}})['then'](handleEntityNotFound(_0x3c494b,null))[_0x187b('0x43')](function(_0x571fab){if(_0x571fab){_0x43d003=_0x571fab;_0x33ddc5[_0x187b('0x33')]=_[_0x187b('0x49')](db['User']['rawAttributes']);_0x33ddc5[_0x187b('0x34')]=_['keys'](_0x264592[_0x187b('0x34')]);_0x33ddc5['filters']=_[_0x187b('0x37')](_0x33ddc5[_0x187b('0x33')],_0x33ddc5['query']);_0x1f622f[_0x187b('0x36')]=_['intersection'](_0x33ddc5['model'],qs[_0x187b('0x38')](_0x264592[_0x187b('0x34')][_0x187b('0x38')]));_0x1f622f[_0x187b('0x36')]=_0x1f622f[_0x187b('0x36')][_0x187b('0x39')]?_0x1f622f[_0x187b('0x36')]:_0x33ddc5[_0x187b('0x33')];_0x1f622f[_0x187b('0x3c')]=qs[_0x187b('0x3d')](_0x264592[_0x187b('0x34')][_0x187b('0x3d')]);_0x1f622f[_0x187b('0x3e')]=qs[_0x187b('0x35')](_[_0x187b('0x74')](_0x264592[_0x187b('0x34')],_0x33ddc5[_0x187b('0x35')]));if(_0x264592[_0x187b('0x34')][_0x187b('0x3f')]){_0x1f622f[_0x187b('0x3e')]=_[_0x187b('0x40')](_0x1f622f[_0x187b('0x3e')],{'$or':_[_0x187b('0x2e')](_0x1f622f[_0x187b('0x36')],function(_0x259700){var _0x3d94a9={};_0x3d94a9[_0x259700]={'$like':'%'+_0x264592[_0x187b('0x34')][_0x187b('0x3f')]+'%'};return _0x3d94a9;})});}_0x1f622f=_[_0x187b('0x40')]({},_0x1f622f,_0x264592['options']);return _0x43d003['getAgents'](_0x1f622f);}})[_0x187b('0x43')](function(_0x31258d){if(_0x31258d){_0x18f430=_0x31258d[_0x187b('0x39')];if(!_0x264592[_0x187b('0x34')]['hasOwnProperty'](_0x187b('0x3b'))){_0x1f622f[_0x187b('0x24')]=qs[_0x187b('0x24')](_0x264592[_0x187b('0x34')][_0x187b('0x24')]);_0x1f622f['offset']=qs[_0x187b('0x22')](_0x264592[_0x187b('0x34')][_0x187b('0x22')]);}return _0x43d003['getAgents'](_0x1f622f);}})[_0x187b('0x43')](function(_0x4b352b){if(_0x4b352b){return _0x4b352b?{'count':_0x18f430,'rows':_0x4b352b}:null;}})[_0x187b('0x43')](respondWithResult(_0x3c494b,null))['catch'](handleError(_0x3c494b,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 1ff580a..6ae2c99 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 _0x2488=['remove','emit','hasOwnProperty','hook','setMaxListeners','save','update'];(function(_0x4b487d,_0x5d066e){var _0x13a2d3=function(_0x2451d6){while(--_0x2451d6){_0x4b487d['push'](_0x4b487d['shift']());}};_0x13a2d3(++_0x5d066e);}(_0x2488,0xac));var _0x8248=function(_0xd42ae9,_0x562ea2){_0xd42ae9=_0xd42ae9-0x0;var _0x581cff=_0x2488[_0xd42ae9];return _0x581cff;};'use strict';var EventEmitter=require('events');var Team=require('../../mysqldb')['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x8248('0x0')](0x0);var events={'afterCreate':_0x8248('0x1'),'afterUpdate':_0x8248('0x2'),'afterDestroy':_0x8248('0x3')};function emitEvent(_0x172f07){return function(_0x2ad45c,_0x5d509a,_0x1da84b){TeamEvents['emit'](_0x172f07+':'+_0x2ad45c['id'],_0x2ad45c);TeamEvents[_0x8248('0x4')](_0x172f07,_0x2ad45c);_0x1da84b(null);};}for(var e in events){if(events[_0x8248('0x5')](e)){var event=events[e];Team[_0x8248('0x6')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0x52a3=['update','remove','emit','hook','exports','events','../../mysqldb','Team','setMaxListeners','save'];(function(_0x8cadfc,_0x4ff50c){var _0x3ed3a6=function(_0x15e5fa){while(--_0x15e5fa){_0x8cadfc['push'](_0x8cadfc['shift']());}};_0x3ed3a6(++_0x4ff50c);}(_0x52a3,0x16d));var _0x352a=function(_0x3d2c3d,_0x16164b){_0x3d2c3d=_0x3d2c3d-0x0;var _0x36126c=_0x52a3[_0x3d2c3d];return _0x36126c;};'use strict';var EventEmitter=require(_0x352a('0x0'));var Team=require(_0x352a('0x1'))['db'][_0x352a('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x352a('0x3')](0x0);var events={'afterCreate':_0x352a('0x4'),'afterUpdate':_0x352a('0x5'),'afterDestroy':_0x352a('0x6')};function emitEvent(_0x5112ff){return function(_0x3fd516,_0x2515a1,_0x25199e){TeamEvents[_0x352a('0x7')](_0x5112ff+':'+_0x3fd516['id'],_0x3fd516);TeamEvents[_0x352a('0x7')](_0x5112ff,_0x3fd516);_0x25199e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x352a('0x8')](e,emitEvent(event));}}module[_0x352a('0x9')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index b848686..ba71ee7 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 _0x99c0=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./team.attributes','exports','define','lodash'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0x99c0,0x173));var _0x099c=function(_0x2aba12,_0x356368){_0x2aba12=_0x2aba12-0x0;var _0x4b3978=_0x99c0[_0x2aba12];return _0x4b3978;};'use strict';var _=require(_0x099c('0x0'));var util=require('util');var logger=require(_0x099c('0x1'))(_0x099c('0x2'));var moment=require(_0x099c('0x3'));var BPromise=require(_0x099c('0x4'));var rp=require(_0x099c('0x5'));var fs=require('fs');var path=require(_0x099c('0x6'));var rimraf=require(_0x099c('0x7'));var config=require(_0x099c('0x8'));var attributes=require(_0x099c('0x9'));module[_0x099c('0xa')]=function(_0x2a2745,_0x4563c7){return _0x2a2745[_0x099c('0xb')]('Team',attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ee0=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./team.attributes','define','Team','lodash'];(function(_0x289967,_0x52906c){var _0x1f8a3c=function(_0x1d1202){while(--_0x1d1202){_0x289967['push'](_0x289967['shift']());}};_0x1f8a3c(++_0x52906c);}(_0x8ee0,0xc2));var _0x08ee=function(_0xb875ee,_0x583042){_0xb875ee=_0xb875ee-0x0;var _0x4c7f3a=_0x8ee0[_0xb875ee];return _0x4c7f3a;};'use strict';var _=require(_0x08ee('0x0'));var util=require(_0x08ee('0x1'));var logger=require(_0x08ee('0x2'))(_0x08ee('0x3'));var moment=require(_0x08ee('0x4'));var BPromise=require(_0x08ee('0x5'));var rp=require(_0x08ee('0x6'));var fs=require('fs');var path=require(_0x08ee('0x7'));var rimraf=require(_0x08ee('0x8'));var config=require(_0x08ee('0x9'));var attributes=require(_0x08ee('0xa'));module['exports']=function(_0x534668,_0x55878a){return _0x534668[_0x08ee('0xb')](_0x08ee('0xc'),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 01f11ee..76e3fcd 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 _0x41e5=['socket.io-emitter','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','code','message','result','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost'];(function(_0x4d0b5b,_0xf881c4){var _0x521856=function(_0x2e5d01){while(--_0x2e5d01){_0x4d0b5b['push'](_0x4d0b5b['shift']());}};_0x521856(++_0xf881c4);}(_0x41e5,0x193));var _0x541e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41e5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x541e('0x0'));var moment=require(_0x541e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x541e('0x2'));var db=require(_0x541e('0x3'))['db'];var utils=require(_0x541e('0x4'));var logger=require(_0x541e('0x5'))(_0x541e('0x6'));var config=require(_0x541e('0x7'));var jayson=require(_0x541e('0x8'));var client=jayson['client'][_0x541e('0x9')]({'port':0x232a});config[_0x541e('0xa')]=_[_0x541e('0xb')](config[_0x541e('0xa')],{'host':_0x541e('0xc'),'port':0x18eb});var socket=require(_0x541e('0xd'))(new Redis(config['redis']));require('./team.socket')[_0x541e('0xe')](socket);function respondWithRpcPromise(_0x5a6fc6,_0x3b68e4,_0x24ac2e){return new BPromise(function(_0x3d1883,_0x50f048){return client[_0x541e('0xf')](_0x5a6fc6,_0x24ac2e)[_0x541e('0x10')](function(_0x5592a8){logger[_0x541e('0x11')](_0x541e('0x12'),_0x3b68e4,_0x541e('0x13'));logger[_0x541e('0x14')](_0x541e('0x15'),_0x3b68e4,_0x541e('0x13'),JSON['stringify'](_0x5592a8));if(_0x5592a8[_0x541e('0x16')]){if(_0x5592a8['error'][_0x541e('0x17')]===0x1f4){logger[_0x541e('0x16')](_0x541e('0x12'),_0x3b68e4,_0x5592a8[_0x541e('0x16')][_0x541e('0x18')]);return _0x50f048(_0x5592a8[_0x541e('0x16')]['message']);}logger['error']('Team,\x20%s,\x20%s',_0x3b68e4,_0x5592a8['error']['message']);return _0x3d1883(_0x5592a8[_0x541e('0x16')][_0x541e('0x18')]);}else{logger['info'](_0x541e('0x12'),_0x3b68e4,_0x541e('0x13'));_0x3d1883(_0x5592a8[_0x541e('0x19')][_0x541e('0x18')]);}})['catch'](function(_0x4eb797){logger['error'](_0x541e('0x12'),_0x3b68e4,_0x4eb797);_0x50f048(_0x4eb797);});});} \ No newline at end of file +var _0x84ff=['request\x20sent','debug','error','code','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','register','request','then','info','Team,\x20%s,\x20%s'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x84ff,0x156));var _0xf84f=function(_0x153d09,_0x39f503){_0x153d09=_0x153d09-0x0;var _0x3ee63b=_0x84ff[_0x153d09];return _0x3ee63b;};'use strict';var _=require('lodash');var util=require(_0xf84f('0x0'));var moment=require('moment');var BPromise=require(_0xf84f('0x1'));var rs=require(_0xf84f('0x2'));var fs=require('fs');var Redis=require(_0xf84f('0x3'));var db=require(_0xf84f('0x4'))['db'];var utils=require(_0xf84f('0x5'));var logger=require(_0xf84f('0x6'))('rpc');var config=require(_0xf84f('0x7'));var jayson=require(_0xf84f('0x8'));var client=jayson[_0xf84f('0x9')][_0xf84f('0xa')]({'port':0x232a});config[_0xf84f('0xb')]=_[_0xf84f('0xc')](config[_0xf84f('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf84f('0xb')]));require('./team.socket')[_0xf84f('0xd')](socket);function respondWithRpcPromise(_0x1be5c4,_0xa04e60,_0x5babf9){return new BPromise(function(_0xec4af,_0x10dc7d){return client[_0xf84f('0xe')](_0x1be5c4,_0x5babf9)[_0xf84f('0xf')](function(_0x157433){logger[_0xf84f('0x10')](_0xf84f('0x11'),_0xa04e60,_0xf84f('0x12'));logger[_0xf84f('0x13')]('Team,\x20%s,\x20%s,\x20%s',_0xa04e60,_0xf84f('0x12'),JSON['stringify'](_0x157433));if(_0x157433[_0xf84f('0x14')]){if(_0x157433[_0xf84f('0x14')][_0xf84f('0x15')]===0x1f4){logger[_0xf84f('0x14')](_0xf84f('0x11'),_0xa04e60,_0x157433[_0xf84f('0x14')][_0xf84f('0x16')]);return _0x10dc7d(_0x157433[_0xf84f('0x14')]['message']);}logger[_0xf84f('0x14')](_0xf84f('0x11'),_0xa04e60,_0x157433[_0xf84f('0x14')][_0xf84f('0x16')]);return _0xec4af(_0x157433[_0xf84f('0x14')]['message']);}else{logger['info']('Team,\x20%s,\x20%s',_0xa04e60,_0xf84f('0x12'));_0xec4af(_0x157433[_0xf84f('0x17')][_0xf84f('0x16')]);}})['catch'](function(_0x95cc5){logger[_0xf84f('0x14')]('Team,\x20%s,\x20%s',_0xa04e60,_0x95cc5);_0x10dc7d(_0x95cc5);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 5718ca9..73db523 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 _0xceda=['emit','removeListener','register','team:','./team.events','save','remove','update'];(function(_0x568bba,_0x2cabca){var _0x3b49e0=function(_0x2ef3f2){while(--_0x2ef3f2){_0x568bba['push'](_0x568bba['shift']());}};_0x3b49e0(++_0x2cabca);}(_0xceda,0x1c4));var _0xaced=function(_0x2d0963,_0x576dd7){_0x2d0963=_0x2d0963-0x0;var _0x203db3=_0xceda[_0x2d0963];return _0x203db3;};'use strict';var TeamEvents=require(_0xaced('0x0'));var events=[_0xaced('0x1'),_0xaced('0x2'),_0xaced('0x3')];function createListener(_0x34073c,_0x883151){return function(_0x2ad04f){_0x883151[_0xaced('0x4')](_0x34073c,_0x2ad04f);};}function removeListener(_0x2971c2,_0xcf5a01){return function(){TeamEvents[_0xaced('0x5')](_0x2971c2,_0xcf5a01);};}exports[_0xaced('0x6')]=function(_0x106c62){for(var _0x4bd96d=0x0,_0x42f97f=events['length'];_0x4bd96d<_0x42f97f;_0x4bd96d++){var _0x5ef911=events[_0x4bd96d];var _0x4818a3=createListener(_0xaced('0x7')+_0x5ef911,_0x106c62);TeamEvents['on'](_0x5ef911,_0x4818a3);}}; \ No newline at end of file +var _0x30c7=['update','emit','length','./team.events','remove'];(function(_0x551bfb,_0x272f93){var _0x17069b=function(_0x1cb79a){while(--_0x1cb79a){_0x551bfb['push'](_0x551bfb['shift']());}};_0x17069b(++_0x272f93);}(_0x30c7,0x111));var _0x730c=function(_0x224ad1,_0x400422){_0x224ad1=_0x224ad1-0x0;var _0x156e8d=_0x30c7[_0x224ad1];return _0x156e8d;};'use strict';var TeamEvents=require(_0x730c('0x0'));var events=['save',_0x730c('0x1'),_0x730c('0x2')];function createListener(_0x3a8026,_0x5aa43a){return function(_0x47601e){_0x5aa43a[_0x730c('0x3')](_0x3a8026,_0x47601e);};}function removeListener(_0x49c816,_0x59a230){return function(){TeamEvents['removeListener'](_0x49c816,_0x59a230);};}exports['register']=function(_0x3516be){for(var _0x229682=0x0,_0x5748ab=events[_0x730c('0x4')];_0x229682<_0x5748ab;_0x229682++){var _0x2ed29c=events[_0x229682];var _0x6022ae=createListener('team:'+_0x2ed29c,_0x3516be);TeamEvents['on'](_0x2ed29c,_0x6022ae);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 70004b6..fa7193c 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 _0x8801=['exports','INTEGER','sequelize'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x8801,0x116));var _0x1880=function(_0xc69f9,_0x2849d4){_0xc69f9=_0xc69f9-0x0;var _0x5b5b34=_0x8801[_0xc69f9];return _0x5b5b34;};'use strict';var Sequelize=require(_0x1880('0x0'));module[_0x1880('0x1')]={'TeamId':{'type':Sequelize[_0x1880('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x1880('0x2')]}}; \ No newline at end of file +var _0x7ec2=['sequelize','exports','INTEGER'];(function(_0x6f8972,_0x343da7){var _0x5677d9=function(_0x5eb51f){while(--_0x5eb51f){_0x6f8972['push'](_0x6f8972['shift']());}};_0x5677d9(++_0x343da7);}(_0x7ec2,0x15c));var _0x27ec=function(_0x20e94e,_0x5bc6f8){_0x20e94e=_0x20e94e-0x0;var _0x12b132=_0x7ec2[_0x20e94e];return _0x12b132;};'use strict';var Sequelize=require(_0x27ec('0x0'));module[_0x27ec('0x1')]={'TeamId':{'type':Sequelize[_0x27ec('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 410c90a..7522500 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 _0xcce8=['team_has_voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','TeamVoicePrefix'];(function(_0xa3fadc,_0xd1e16){var _0x23ecb8=function(_0x2c71f7){while(--_0x2c71f7){_0xa3fadc['push'](_0xa3fadc['shift']());}};_0x23ecb8(++_0xd1e16);}(_0xcce8,0x1a5));var _0x8cce=function(_0x150290,_0x40784b){_0x150290=_0x150290-0x0;var _0x41f994=_0xcce8[_0x150290];return _0x41f994;};'use strict';var _=require(_0x8cce('0x0'));var util=require(_0x8cce('0x1'));var logger=require(_0x8cce('0x2'))(_0x8cce('0x3'));var moment=require(_0x8cce('0x4'));var BPromise=require(_0x8cce('0x5'));var rp=require(_0x8cce('0x6'));var fs=require('fs');var path=require(_0x8cce('0x7'));var rimraf=require(_0x8cce('0x8'));var config=require(_0x8cce('0x9'));var attributes=require('./teamVoicePrefix.attributes');module[_0x8cce('0xa')]=function(_0x30554a,_0x2a008a){return _0x30554a[_0x8cce('0xb')](_0x8cce('0xc'),attributes,{'tableName':_0x8cce('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3495=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./teamVoicePrefix.attributes','exports','TeamVoicePrefix','lodash','util'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x3495,0x1de));var _0x5349=function(_0x18d3eb,_0x5334d6){_0x18d3eb=_0x18d3eb-0x0;var _0x4bddd1=_0x3495[_0x18d3eb];return _0x4bddd1;};'use strict';var _=require(_0x5349('0x0'));var util=require(_0x5349('0x1'));var logger=require(_0x5349('0x2'))(_0x5349('0x3'));var moment=require(_0x5349('0x4'));var BPromise=require(_0x5349('0x5'));var rp=require(_0x5349('0x6'));var fs=require('fs');var path=require(_0x5349('0x7'));var rimraf=require(_0x5349('0x8'));var config=require('../../config/environment');var attributes=require(_0x5349('0x9'));module[_0x5349('0xa')]=function(_0x5ce2cd,_0xcb5a1){return _0x5ce2cd['define'](_0x5349('0xb'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index ecd2973..5348905 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x508036,_0x2d97d9){var _0x1f5862=function(_0x5538b3){while(--_0x5538b3){_0x508036['push'](_0x508036['shift']());}};_0x1f5862(++_0x2d97d9);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x381db5,_0x1e7659){var _0x59cf4c=function(_0x11a940){while(--_0x11a940){_0x381db5['push'](_0x381db5['shift']());}};_0x59cf4c(++_0x1e7659);}(_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 7db4af5..45aabd3 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 _0x4444=['exports','sequelize'];(function(_0x27a1d8,_0x103114){var _0x511295=function(_0x3438e1){while(--_0x3438e1){_0x27a1d8['push'](_0x27a1d8['shift']());}};_0x511295(++_0x103114);}(_0x4444,0xa3));var _0x4444=function(_0x26b00e,_0x245a09){_0x26b00e=_0x26b00e-0x0;var _0x3764c3=_0x4444[_0x26b00e];return _0x3764c3;};'use strict';var Sequelize=require(_0x4444('0x0'));module[_0x4444('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x2580=['sequelize','INTEGER'];(function(_0xcba282,_0x565c7c){var _0x3ab27d=function(_0x2d06e7){while(--_0x2d06e7){_0xcba282['push'](_0xcba282['shift']());}};_0x3ab27d(++_0x565c7c);}(_0x2580,0xa6));var _0x0258=function(_0x456ca0,_0x25aa28){_0x456ca0=_0x456ca0-0x0;var _0x3d200e=_0x2580[_0x456ca0];return _0x3d200e;};'use strict';var Sequelize=require(_0x0258('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x0258('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index a1da8a4..08cca2f 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 _0xa7b4=['bluebird','../../config/environment','./teamVoiceQueue.attributes','define','TeamVoiceQueue','team_has_voice_queues','util','../../config/logger','moment'];(function(_0x48b00c,_0x16690b){var _0x55d181=function(_0x58b5bd){while(--_0x58b5bd){_0x48b00c['push'](_0x48b00c['shift']());}};_0x55d181(++_0x16690b);}(_0xa7b4,0x8d));var _0x4a7b=function(_0x267ad8,_0x8e8f9c){_0x267ad8=_0x267ad8-0x0;var _0x264e34=_0xa7b4[_0x267ad8];return _0x264e34;};'use strict';var _=require('lodash');var util=require(_0x4a7b('0x0'));var logger=require(_0x4a7b('0x1'))('api');var moment=require(_0x4a7b('0x2'));var BPromise=require(_0x4a7b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4a7b('0x4'));var attributes=require(_0x4a7b('0x5'));module['exports']=function(_0x27e783,_0xf43e24){return _0x27e783[_0x4a7b('0x6')](_0x4a7b('0x7'),attributes,{'tableName':_0x4a7b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf9bb=['./teamVoiceQueue.attributes','exports','team_has_voice_queues','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment'];(function(_0x2ab231,_0x116f5c){var _0x3d3662=function(_0x3d6da8){while(--_0x3d6da8){_0x2ab231['push'](_0x2ab231['shift']());}};_0x3d3662(++_0x116f5c);}(_0xf9bb,0x14d));var _0xbf9b=function(_0x4563b6,_0x2611c5){_0x4563b6=_0x4563b6-0x0;var _0xa7e08c=_0xf9bb[_0x4563b6];return _0xa7e08c;};'use strict';var _=require(_0xbf9b('0x0'));var util=require(_0xbf9b('0x1'));var logger=require(_0xbf9b('0x2'))('api');var moment=require(_0xbf9b('0x3'));var BPromise=require(_0xbf9b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbf9b('0x5'));var config=require(_0xbf9b('0x6'));var attributes=require(_0xbf9b('0x7'));module[_0xbf9b('0x8')]=function(_0x46d1f,_0x7fa5a){return _0x46d1f['define']('TeamVoiceQueue',attributes,{'tableName':_0xbf9b('0x9'),'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 c325e68..8f15d46 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 _0xab4d=['request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','TeamVoiceQueue,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','client','http','request','info'];(function(_0x13a9a8,_0x17243a){var _0x1dd3ee=function(_0x454b7e){while(--_0x454b7e){_0x13a9a8['push'](_0x13a9a8['shift']());}};_0x1dd3ee(++_0x17243a);}(_0xab4d,0x1ae));var _0xdab4=function(_0x1678c8,_0x1c32f4){_0x1678c8=_0x1678c8-0x0;var _0x387aa9=_0xab4d[_0x1678c8];return _0x387aa9;};'use strict';var _=require(_0xdab4('0x0'));var util=require(_0xdab4('0x1'));var moment=require(_0xdab4('0x2'));var BPromise=require(_0xdab4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdab4('0x4'))['db'];var utils=require(_0xdab4('0x5'));var logger=require('../../config/logger')(_0xdab4('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xdab4('0x7')][_0xdab4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1a57f9,_0x34ee7c,_0x69556c){return new BPromise(function(_0x176349,_0x8e5a7e){return client[_0xdab4('0x9')](_0x1a57f9,_0x69556c)['then'](function(_0xf20d2e){logger[_0xdab4('0xa')]('TeamVoiceQueue,\x20%s,\x20%s',_0x34ee7c,_0xdab4('0xb'));logger[_0xdab4('0xc')](_0xdab4('0xd'),_0x34ee7c,_0xdab4('0xb'),JSON[_0xdab4('0xe')](_0xf20d2e));if(_0xf20d2e[_0xdab4('0xf')]){if(_0xf20d2e[_0xdab4('0xf')][_0xdab4('0x10')]===0x1f4){logger[_0xdab4('0xf')]('TeamVoiceQueue,\x20%s,\x20%s',_0x34ee7c,_0xf20d2e[_0xdab4('0xf')][_0xdab4('0x11')]);return _0x8e5a7e(_0xf20d2e[_0xdab4('0xf')][_0xdab4('0x11')]);}logger[_0xdab4('0xf')](_0xdab4('0x12'),_0x34ee7c,_0xf20d2e['error']['message']);return _0x176349(_0xf20d2e['error'][_0xdab4('0x11')]);}else{logger[_0xdab4('0xa')]('TeamVoiceQueue,\x20%s,\x20%s',_0x34ee7c,_0xdab4('0xb'));_0x176349(_0xf20d2e[_0xdab4('0x13')][_0xdab4('0x11')]);}})[_0xdab4('0x14')](function(_0x4c1475){logger['error'](_0xdab4('0x12'),_0x34ee7c,_0x4c1475);_0x8e5a7e(_0x4c1475);});});} \ No newline at end of file +var _0x395a=['code','TeamVoiceQueue,\x20%s,\x20%s','message','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x395a,0x159));var _0xa395=function(_0x3f6bcf,_0x531e79){_0x3f6bcf=_0x3f6bcf-0x0;var _0x1c5350=_0x395a[_0x3f6bcf];return _0x1c5350;};'use strict';var _=require(_0xa395('0x0'));var util=require(_0xa395('0x1'));var moment=require(_0xa395('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa395('0x3'))['db'];var utils=require(_0xa395('0x4'));var logger=require(_0xa395('0x5'))('rpc');var config=require(_0xa395('0x6'));var jayson=require(_0xa395('0x7'));var client=jayson[_0xa395('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x492f47,_0x397dc3,_0x3a23c5){return new BPromise(function(_0x39f352,_0x4ce79f){return client[_0xa395('0x9')](_0x492f47,_0x3a23c5)['then'](function(_0x22f00e){logger[_0xa395('0xa')]('TeamVoiceQueue,\x20%s,\x20%s',_0x397dc3,_0xa395('0xb'));logger[_0xa395('0xc')](_0xa395('0xd'),_0x397dc3,_0xa395('0xb'),JSON[_0xa395('0xe')](_0x22f00e));if(_0x22f00e[_0xa395('0xf')]){if(_0x22f00e[_0xa395('0xf')][_0xa395('0x10')]===0x1f4){logger[_0xa395('0xf')](_0xa395('0x11'),_0x397dc3,_0x22f00e[_0xa395('0xf')][_0xa395('0x12')]);return _0x4ce79f(_0x22f00e[_0xa395('0xf')]['message']);}logger['error'](_0xa395('0x11'),_0x397dc3,_0x22f00e[_0xa395('0xf')][_0xa395('0x12')]);return _0x39f352(_0x22f00e[_0xa395('0xf')]['message']);}else{logger[_0xa395('0xa')](_0xa395('0x11'),_0x397dc3,_0xa395('0xb'));_0x39f352(_0x22f00e['result']['message']);}})['catch'](function(_0x1723f0){logger[_0xa395('0xf')](_0xa395('0x11'),_0x397dc3,_0x1723f0);_0x4ce79f(_0x1723f0);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 6b2c74f..88fb169 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 _0x4732=['delete','/:id','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','isAuthenticated','index','show','post','create','put'];(function(_0x440073,_0x33f295){var _0x1b6781=function(_0x25877d){while(--_0x25877d){_0x440073['push'](_0x440073['shift']());}};_0x1b6781(++_0x33f295);}(_0x4732,0x17d));var _0x2473=function(_0x2defb5,_0x1cda14){_0x2defb5=_0x2defb5-0x0;var _0x229c53=_0x4732[_0x2defb5];return _0x229c53;};'use strict';var multer=require(_0x2473('0x0'));var util=require('util');var path=require(_0x2473('0x1'));var timeout=require('connect-timeout');var express=require(_0x2473('0x2'));var router=express[_0x2473('0x3')]();var fs_extra=require(_0x2473('0x4'));var auth=require(_0x2473('0x5'));var interaction=require(_0x2473('0x6'));var config=require(_0x2473('0x7'));var controller=require(_0x2473('0x8'));router['get']('/',auth[_0x2473('0x9')](),controller[_0x2473('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x2473('0xb')]);router[_0x2473('0xc')]('/',auth[_0x2473('0x9')](),controller[_0x2473('0xd')]);router[_0x2473('0xe')]('/:id',auth[_0x2473('0x9')](),controller['update']);router[_0x2473('0xf')](_0x2473('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x2473('0x11')]=router; \ No newline at end of file +var _0x8768=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','/:id','show','post','put','delete','destroy'];(function(_0x106de4,_0x5c4eeb){var _0x130bf2=function(_0x4a1536){while(--_0x4a1536){_0x106de4['push'](_0x106de4['shift']());}};_0x130bf2(++_0x5c4eeb);}(_0x8768,0xa1));var _0x8876=function(_0x64039e,_0x86a69b){_0x64039e=_0x64039e-0x0;var _0x3b948a=_0x8768[_0x64039e];return _0x3b948a;};'use strict';var multer=require(_0x8876('0x0'));var util=require(_0x8876('0x1'));var path=require(_0x8876('0x2'));var timeout=require(_0x8876('0x3'));var express=require(_0x8876('0x4'));var router=express[_0x8876('0x5')]();var fs_extra=require(_0x8876('0x6'));var auth=require(_0x8876('0x7'));var interaction=require(_0x8876('0x8'));var config=require(_0x8876('0x9'));var controller=require(_0x8876('0xa'));router[_0x8876('0xb')]('/',auth[_0x8876('0xc')](),controller['index']);router[_0x8876('0xb')](_0x8876('0xd'),auth[_0x8876('0xc')](),controller[_0x8876('0xe')]);router[_0x8876('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8876('0x10')](_0x8876('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x8876('0x11')](_0x8876('0xd'),auth[_0x8876('0xc')](),controller[_0x8876('0x12')]);module[_0x8876('0x13')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 68997ac..84533bf 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 _0x7c0d=['TEXT','sequelize','exports','STRING'];(function(_0x65cd6e,_0x4781fd){var _0x39fb99=function(_0x378ae4){while(--_0x378ae4){_0x65cd6e['push'](_0x65cd6e['shift']());}};_0x39fb99(++_0x4781fd);}(_0x7c0d,0xc1));var _0xd7c0=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x7c0d[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0xd7c0('0x0'));module[_0xd7c0('0x1')]={'name':{'type':Sequelize[_0xd7c0('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0xd7c0('0x3')]}}; \ No newline at end of file +var _0x5b95=['TEXT','sequelize','exports','STRING'];(function(_0x1177d5,_0x22b649){var _0xc3ddc2=function(_0x43ff95){while(--_0x43ff95){_0x1177d5['push'](_0x1177d5['shift']());}};_0xc3ddc2(++_0x22b649);}(_0x5b95,0xc9));var _0x55b9=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x5b95[_0x3fba9f];return _0x192cf1;};'use strict';var Sequelize=require(_0x55b9('0x0'));module[_0x55b9('0x1')]={'name':{'type':Sequelize[_0x55b9('0x2')]},'description':{'type':Sequelize[_0x55b9('0x2')]},'html':{'type':Sequelize[_0x55b9('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index f3fdcab..4a8289a 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 _0xdc5f=['count','set','Content-Range','json','reject','save','update','then','destroy','get','Templates','end','error','name','send','Template','rawAttributes','model','keys','filters','intersection','query','attributes','nolimit','sort','where','filter','merge','type','VIRTUAL','includeAll','findAll','catch','show','params','fields','length','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit'];(function(_0x4f3e33,_0x5704a8){var _0x1a070c=function(_0x2a385a){while(--_0x2a385a){_0x4f3e33['push'](_0x4f3e33['shift']());}};_0x1a070c(++_0x5704a8);}(_0xdc5f,0x7b));var _0xfdc5=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0xdc5f[_0x50007c];return _0x5c1ec7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfdc5('0x0'));var rp=require(_0xfdc5('0x1'));var moment=require(_0xfdc5('0x2'));var BPromise=require(_0xfdc5('0x3'));var Mustache=require(_0xfdc5('0x4'));var util=require(_0xfdc5('0x5'));var path=require(_0xfdc5('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfdc5('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfdc5('0x8'));var squel=require(_0xfdc5('0x9'));var crypto=require(_0xfdc5('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xfdc5('0xb'));var toCsv=require('to-csv');var querystring=require(_0xfdc5('0xc'));var Papa=require(_0xfdc5('0xd'));var Redis=require(_0xfdc5('0xe'));var authService=require(_0xfdc5('0xf'));var qs=require(_0xfdc5('0x10'));var as=require(_0xfdc5('0x11'));var hardwareService=require(_0xfdc5('0x12'));var logger=require('../../config/logger')(_0xfdc5('0x13'));var utils=require(_0xfdc5('0x14'));var config=require(_0xfdc5('0x15'));var licenseUtil=require(_0xfdc5('0x16'));var db=require(_0xfdc5('0x17'))['db'];function respondWithStatusCode(_0x514747,_0x9121ca){_0x9121ca=_0x9121ca||0xcc;return function(_0x5670fc){if(_0x5670fc){return _0x514747[_0xfdc5('0x18')](_0x9121ca);}return _0x514747[_0xfdc5('0x19')](_0x9121ca)['end']();};}function respondWithResult(_0x3c32ee,_0x59f991){_0x59f991=_0x59f991||0xc8;return function(_0x115379){if(_0x115379){return _0x3c32ee[_0xfdc5('0x19')](_0x59f991)['json'](_0x115379);}};}function respondWithFilteredResult(_0x29a6f2,_0x1599ab){return function(_0xc89c1e){if(_0xc89c1e){var _0x21c987=typeof _0x1599ab[_0xfdc5('0x1a')]===_0xfdc5('0x1b')&&typeof _0x1599ab[_0xfdc5('0x1c')]===_0xfdc5('0x1b');var _0x169769=_0xc89c1e[_0xfdc5('0x1d')];var _0x1b930d=_0x21c987?0x0:_0x1599ab['offset'];var _0x14578d=_0x21c987?_0xc89c1e['count']:_0x1599ab[_0xfdc5('0x1a')]+_0x1599ab['limit'];var _0x257a64;if(_0x14578d>=_0x169769){_0x14578d=_0x169769;_0x257a64=0xc8;}else{_0x257a64=0xce;}_0x29a6f2['status'](_0x257a64);return _0x29a6f2[_0xfdc5('0x1e')](_0xfdc5('0x1f'),_0x1b930d+'-'+_0x14578d+'/'+_0x169769)[_0xfdc5('0x20')](_0xc89c1e);}return null;};}function patchUpdates(_0x3c9cd0){return function(_0x5d8e4c){try{jsonpatch['apply'](_0x5d8e4c,_0x3c9cd0,!![]);}catch(_0x10cefa){return BPromise[_0xfdc5('0x21')](_0x10cefa);}return _0x5d8e4c[_0xfdc5('0x22')]();};}function saveUpdates(_0x487f6b,_0x43416e){return function(_0xfe6d73){if(_0xfe6d73){return _0xfe6d73[_0xfdc5('0x23')](_0x487f6b)[_0xfdc5('0x24')](function(_0x2fde85){return _0x2fde85;});}return null;};}function removeEntity(_0x3bbff6,_0x10e66d){return function(_0x25bef1){if(_0x25bef1){return _0x25bef1[_0xfdc5('0x25')]()[_0xfdc5('0x24')](function(){var _0x59db5b=_0x25bef1[_0xfdc5('0x26')]({'plain':!![]});var _0x29ecac=_0xfdc5('0x27');return db['UserProfileResource'][_0xfdc5('0x25')]({'where':{'type':_0x29ecac,'resourceId':_0x59db5b['id']}})[_0xfdc5('0x24')](function(){return _0x25bef1;});})['then'](function(){_0x3bbff6[_0xfdc5('0x19')](0xcc)[_0xfdc5('0x28')]();});}};}function handleEntityNotFound(_0x4de10e,_0x3a32f3){return function(_0x27c932){if(!_0x27c932){_0x4de10e[_0xfdc5('0x18')](0x194);}return _0x27c932;};}function handleError(_0xa53b2d,_0x535dc8){_0x535dc8=_0x535dc8||0x1f4;return function(_0x11ab53){logger[_0xfdc5('0x29')](_0x11ab53['stack']);if(_0x11ab53[_0xfdc5('0x2a')]){delete _0x11ab53[_0xfdc5('0x2a')];}_0xa53b2d[_0xfdc5('0x19')](_0x535dc8)[_0xfdc5('0x2b')](_0x11ab53);};}exports['index']=function(_0x106ab7,_0x452717){var _0x50292f={},_0x33853e={},_0x1fa21e={'count':0x0,'rows':[]};var _0x2a21e9=_['map'](db[_0xfdc5('0x2c')][_0xfdc5('0x2d')],function(_0x274823){return{'name':_0x274823['fieldName'],'type':_0x274823['type']['key']};});_0x33853e[_0xfdc5('0x2e')]=_['map'](_0x2a21e9,'name');_0x33853e['query']=_[_0xfdc5('0x2f')](_0x106ab7['query']);_0x33853e[_0xfdc5('0x30')]=_[_0xfdc5('0x31')](_0x33853e[_0xfdc5('0x2e')],_0x33853e[_0xfdc5('0x32')]);_0x50292f[_0xfdc5('0x33')]=_[_0xfdc5('0x31')](_0x33853e['model'],qs['fields'](_0x106ab7[_0xfdc5('0x32')]['fields']));_0x50292f['attributes']=_0x50292f[_0xfdc5('0x33')]['length']?_0x50292f['attributes']:_0x33853e[_0xfdc5('0x2e')];if(!_0x106ab7['query']['hasOwnProperty'](_0xfdc5('0x34'))){_0x50292f[_0xfdc5('0x1c')]=qs[_0xfdc5('0x1c')](_0x106ab7[_0xfdc5('0x32')][_0xfdc5('0x1c')]);_0x50292f[_0xfdc5('0x1a')]=qs[_0xfdc5('0x1a')](_0x106ab7[_0xfdc5('0x32')]['offset']);}_0x50292f['order']=qs[_0xfdc5('0x35')](_0x106ab7[_0xfdc5('0x32')][_0xfdc5('0x35')]);_0x50292f[_0xfdc5('0x36')]=qs[_0xfdc5('0x30')](_['pick'](_0x106ab7['query'],_0x33853e[_0xfdc5('0x30')]),_0x2a21e9);if(_0x106ab7[_0xfdc5('0x32')][_0xfdc5('0x37')]){_0x50292f['where']=_[_0xfdc5('0x38')](_0x50292f[_0xfdc5('0x36')],{'$or':_['map'](_0x2a21e9,function(_0x586abd){if(_0x586abd[_0xfdc5('0x39')]!==_0xfdc5('0x3a')){var _0x455628={};_0x455628[_0x586abd['name']]={'$like':'%'+_0x106ab7['query']['filter']+'%'};return _0x455628;}})});}_0x50292f=_[_0xfdc5('0x38')]({},_0x50292f,_0x106ab7['options']);var _0x474def={'where':_0x50292f[_0xfdc5('0x36')]};return db['Template'][_0xfdc5('0x1d')](_0x474def)['then'](function(_0x209ae2){_0x1fa21e['count']=_0x209ae2;if(_0x106ab7[_0xfdc5('0x32')][_0xfdc5('0x3b')]){_0x50292f['include']=[{'all':!![]}];}return db[_0xfdc5('0x2c')][_0xfdc5('0x3c')](_0x50292f);})[_0xfdc5('0x24')](function(_0x5a6eff){_0x1fa21e['rows']=_0x5a6eff;return _0x1fa21e;})['then'](respondWithFilteredResult(_0x452717,_0x50292f))[_0xfdc5('0x3d')](handleError(_0x452717,null));};exports[_0xfdc5('0x3e')]=function(_0x584394,_0x39ffbd){var _0xa493f={'raw':!![],'where':{'id':_0x584394[_0xfdc5('0x3f')]['id']}},_0x117896={};_0x117896['model']=_[_0xfdc5('0x2f')](db[_0xfdc5('0x2c')][_0xfdc5('0x2d')]);_0x117896[_0xfdc5('0x32')]=_[_0xfdc5('0x2f')](_0x584394[_0xfdc5('0x32')]);_0x117896[_0xfdc5('0x30')]=_[_0xfdc5('0x31')](_0x117896[_0xfdc5('0x2e')],_0x117896[_0xfdc5('0x32')]);_0xa493f[_0xfdc5('0x33')]=_[_0xfdc5('0x31')](_0x117896[_0xfdc5('0x2e')],qs['fields'](_0x584394[_0xfdc5('0x32')][_0xfdc5('0x40')]));_0xa493f[_0xfdc5('0x33')]=_0xa493f[_0xfdc5('0x33')][_0xfdc5('0x41')]?_0xa493f['attributes']:_0x117896['model'];if(_0x584394[_0xfdc5('0x32')][_0xfdc5('0x3b')]){_0xa493f[_0xfdc5('0x42')]=[{'all':!![]}];}_0xa493f=_[_0xfdc5('0x38')]({},_0xa493f,_0x584394[_0xfdc5('0x43')]);return db['Template'][_0xfdc5('0x44')](_0xa493f)[_0xfdc5('0x24')](handleEntityNotFound(_0x39ffbd,null))[_0xfdc5('0x24')](respondWithResult(_0x39ffbd,null))[_0xfdc5('0x3d')](handleError(_0x39ffbd,null));};exports['create']=function(_0xf50798,_0x1441bd){return db[_0xfdc5('0x2c')][_0xfdc5('0x45')](_0xf50798[_0xfdc5('0x46')],{})[_0xfdc5('0x24')](function(_0x116a64){var _0x1a4946=_0xf50798[_0xfdc5('0x47')][_0xfdc5('0x26')]({'plain':!![]});if(!_0x1a4946)throw new Error(_0xfdc5('0x48'));if(_0x1a4946[_0xfdc5('0x49')]===_0xfdc5('0x47')){var _0x4c333c=_0x116a64[_0xfdc5('0x26')]({'plain':!![]});var _0x27ef57=_0xfdc5('0x27');return db['UserProfileSection'][_0xfdc5('0x44')]({'where':{'name':_0x27ef57,'userProfileId':_0x1a4946['userProfileId']},'raw':!![]})[_0xfdc5('0x24')](function(_0x351d46){if(_0x351d46&&_0x351d46[_0xfdc5('0x4a')]===0x0){return db['UserProfileResource'][_0xfdc5('0x45')]({'name':_0x4c333c[_0xfdc5('0x2a')],'resourceId':_0x4c333c['id'],'type':_0x351d46[_0xfdc5('0x2a')],'sectionId':_0x351d46['id']},{})['then'](function(){return _0x116a64;});}else{return _0x116a64;}})[_0xfdc5('0x3d')](function(_0x41f3f1){logger['error'](_0xfdc5('0x4b'),_0x41f3f1);throw _0x41f3f1;});}return _0x116a64;})[_0xfdc5('0x24')](respondWithResult(_0x1441bd,0xc9))[_0xfdc5('0x3d')](handleError(_0x1441bd,null));};exports[_0xfdc5('0x23')]=function(_0x102f40,_0x34e896){if(_0x102f40[_0xfdc5('0x46')]['id']){delete _0x102f40[_0xfdc5('0x46')]['id'];}return db[_0xfdc5('0x2c')][_0xfdc5('0x44')]({'where':{'id':_0x102f40[_0xfdc5('0x3f')]['id']}})[_0xfdc5('0x24')](handleEntityNotFound(_0x34e896,null))[_0xfdc5('0x24')](saveUpdates(_0x102f40[_0xfdc5('0x46')],null))[_0xfdc5('0x24')](respondWithResult(_0x34e896,null))[_0xfdc5('0x3d')](handleError(_0x34e896,null));};exports[_0xfdc5('0x25')]=function(_0x5931bc,_0x45e2e4){return db['Template']['find']({'where':{'id':_0x5931bc[_0xfdc5('0x3f')]['id']}})[_0xfdc5('0x24')](handleEntityNotFound(_0x45e2e4,null))[_0xfdc5('0x24')](removeEntity(_0x45e2e4,null))['catch'](handleError(_0x45e2e4,null));}; \ No newline at end of file +var _0x3e1d=['key','model','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','params','keys','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Templates','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','get','UserProfileResource','destroy','error','stack','name','send','map','Template','fieldName'];(function(_0x13b90c,_0x54b635){var _0x2034fe=function(_0x2bf095){while(--_0x2bf095){_0x13b90c['push'](_0x13b90c['shift']());}};_0x2034fe(++_0x54b635);}(_0x3e1d,0x76));var _0xd3e1=function(_0x3e8270,_0x293590){_0x3e8270=_0x3e8270-0x0;var _0x1ccde9=_0x3e1d[_0x3e8270];return _0x1ccde9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd3e1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd3e1('0x1'));var rp=require(_0xd3e1('0x2'));var moment=require(_0xd3e1('0x3'));var BPromise=require(_0xd3e1('0x4'));var Mustache=require(_0xd3e1('0x5'));var util=require(_0xd3e1('0x6'));var path=require('path');var sox=require(_0xd3e1('0x7'));var csv=require(_0xd3e1('0x8'));var ejs=require(_0xd3e1('0x9'));var fs=require('fs');var fs_extra=require(_0xd3e1('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd3e1('0xb'));var deskjs=require(_0xd3e1('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd3e1('0xd'));var Papa=require(_0xd3e1('0xe'));var Redis=require(_0xd3e1('0xf'));var authService=require(_0xd3e1('0x10'));var qs=require(_0xd3e1('0x11'));var as=require(_0xd3e1('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd3e1('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xd3e1('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x241106,_0x436cb5){_0x436cb5=_0x436cb5||0xcc;return function(_0xc9219a){if(_0xc9219a){return _0x241106[_0xd3e1('0x15')](_0x436cb5);}return _0x241106[_0xd3e1('0x16')](_0x436cb5)[_0xd3e1('0x17')]();};}function respondWithResult(_0x3e24d5,_0xe70372){_0xe70372=_0xe70372||0xc8;return function(_0x299cc3){if(_0x299cc3){return _0x3e24d5[_0xd3e1('0x16')](_0xe70372)[_0xd3e1('0x18')](_0x299cc3);}};}function respondWithFilteredResult(_0xdddc15,_0x4960be){return function(_0x450c24){if(_0x450c24){var _0x3abff8=typeof _0x4960be['offset']===_0xd3e1('0x19')&&typeof _0x4960be[_0xd3e1('0x1a')]==='undefined';var _0x5553d4=_0x450c24[_0xd3e1('0x1b')];var _0x128b99=_0x3abff8?0x0:_0x4960be[_0xd3e1('0x1c')];var _0x5e9676=_0x3abff8?_0x450c24[_0xd3e1('0x1b')]:_0x4960be[_0xd3e1('0x1c')]+_0x4960be[_0xd3e1('0x1a')];var _0x2ff98d;if(_0x5e9676>=_0x5553d4){_0x5e9676=_0x5553d4;_0x2ff98d=0xc8;}else{_0x2ff98d=0xce;}_0xdddc15[_0xd3e1('0x16')](_0x2ff98d);return _0xdddc15[_0xd3e1('0x1d')](_0xd3e1('0x1e'),_0x128b99+'-'+_0x5e9676+'/'+_0x5553d4)[_0xd3e1('0x18')](_0x450c24);}return null;};}function patchUpdates(_0x3e8be2){return function(_0x3c78cf){try{jsonpatch['apply'](_0x3c78cf,_0x3e8be2,!![]);}catch(_0x569f85){return BPromise[_0xd3e1('0x1f')](_0x569f85);}return _0x3c78cf['save']();};}function saveUpdates(_0x344fdc,_0x351059){return function(_0x5e4951){if(_0x5e4951){return _0x5e4951[_0xd3e1('0x20')](_0x344fdc)[_0xd3e1('0x21')](function(_0x22577b){return _0x22577b;});}return null;};}function removeEntity(_0x5ab48f,_0x57624d){return function(_0x110b05){if(_0x110b05){return _0x110b05['destroy']()[_0xd3e1('0x21')](function(){var _0x4712e3=_0x110b05[_0xd3e1('0x22')]({'plain':!![]});var _0x3b3679='Templates';return db[_0xd3e1('0x23')][_0xd3e1('0x24')]({'where':{'type':_0x3b3679,'resourceId':_0x4712e3['id']}})[_0xd3e1('0x21')](function(){return _0x110b05;});})['then'](function(){_0x5ab48f[_0xd3e1('0x16')](0xcc)[_0xd3e1('0x17')]();});}};}function handleEntityNotFound(_0x38a4d9,_0x1b6f0a){return function(_0x2d8de3){if(!_0x2d8de3){_0x38a4d9[_0xd3e1('0x15')](0x194);}return _0x2d8de3;};}function handleError(_0x3285f4,_0x286d9a){_0x286d9a=_0x286d9a||0x1f4;return function(_0x17ea82){logger[_0xd3e1('0x25')](_0x17ea82[_0xd3e1('0x26')]);if(_0x17ea82[_0xd3e1('0x27')]){delete _0x17ea82[_0xd3e1('0x27')];}_0x3285f4[_0xd3e1('0x16')](_0x286d9a)[_0xd3e1('0x28')](_0x17ea82);};}exports['index']=function(_0x1bf270,_0x374e0b){var _0x40ebde={},_0x33b690={},_0x295bab={'count':0x0,'rows':[]};var _0x388590=_[_0xd3e1('0x29')](db[_0xd3e1('0x2a')]['rawAttributes'],function(_0x585857){return{'name':_0x585857[_0xd3e1('0x2b')],'type':_0x585857['type'][_0xd3e1('0x2c')]};});_0x33b690[_0xd3e1('0x2d')]=_[_0xd3e1('0x29')](_0x388590,_0xd3e1('0x27'));_0x33b690['query']=_['keys'](_0x1bf270['query']);_0x33b690['filters']=_[_0xd3e1('0x2e')](_0x33b690[_0xd3e1('0x2d')],_0x33b690[_0xd3e1('0x2f')]);_0x40ebde['attributes']=_[_0xd3e1('0x2e')](_0x33b690[_0xd3e1('0x2d')],qs[_0xd3e1('0x30')](_0x1bf270['query'][_0xd3e1('0x30')]));_0x40ebde[_0xd3e1('0x31')]=_0x40ebde[_0xd3e1('0x31')][_0xd3e1('0x32')]?_0x40ebde[_0xd3e1('0x31')]:_0x33b690['model'];if(!_0x1bf270['query'][_0xd3e1('0x33')](_0xd3e1('0x34'))){_0x40ebde[_0xd3e1('0x1a')]=qs[_0xd3e1('0x1a')](_0x1bf270['query'][_0xd3e1('0x1a')]);_0x40ebde[_0xd3e1('0x1c')]=qs[_0xd3e1('0x1c')](_0x1bf270[_0xd3e1('0x2f')]['offset']);}_0x40ebde[_0xd3e1('0x35')]=qs[_0xd3e1('0x36')](_0x1bf270[_0xd3e1('0x2f')][_0xd3e1('0x36')]);_0x40ebde[_0xd3e1('0x37')]=qs['filters'](_[_0xd3e1('0x38')](_0x1bf270[_0xd3e1('0x2f')],_0x33b690[_0xd3e1('0x39')]),_0x388590);if(_0x1bf270['query'][_0xd3e1('0x3a')]){_0x40ebde['where']=_[_0xd3e1('0x3b')](_0x40ebde[_0xd3e1('0x37')],{'$or':_[_0xd3e1('0x29')](_0x388590,function(_0xe8260b){if(_0xe8260b[_0xd3e1('0x3c')]!==_0xd3e1('0x3d')){var _0x3d00ec={};_0x3d00ec[_0xe8260b[_0xd3e1('0x27')]]={'$like':'%'+_0x1bf270[_0xd3e1('0x2f')]['filter']+'%'};return _0x3d00ec;}})});}_0x40ebde=_['merge']({},_0x40ebde,_0x1bf270[_0xd3e1('0x3e')]);var _0x57927a={'where':_0x40ebde[_0xd3e1('0x37')]};return db[_0xd3e1('0x2a')][_0xd3e1('0x1b')](_0x57927a)[_0xd3e1('0x21')](function(_0x352a6a){_0x295bab[_0xd3e1('0x1b')]=_0x352a6a;if(_0x1bf270['query'][_0xd3e1('0x3f')]){_0x40ebde['include']=[{'all':!![]}];}return db[_0xd3e1('0x2a')][_0xd3e1('0x40')](_0x40ebde);})['then'](function(_0x5e2021){_0x295bab[_0xd3e1('0x41')]=_0x5e2021;return _0x295bab;})['then'](respondWithFilteredResult(_0x374e0b,_0x40ebde))[_0xd3e1('0x42')](handleError(_0x374e0b,null));};exports['show']=function(_0x4029b0,_0x515a3e){var _0x143b23={'raw':!![],'where':{'id':_0x4029b0[_0xd3e1('0x43')]['id']}},_0x52ade5={};_0x52ade5[_0xd3e1('0x2d')]=_[_0xd3e1('0x44')](db[_0xd3e1('0x2a')][_0xd3e1('0x45')]);_0x52ade5['query']=_['keys'](_0x4029b0[_0xd3e1('0x2f')]);_0x52ade5['filters']=_['intersection'](_0x52ade5['model'],_0x52ade5[_0xd3e1('0x2f')]);_0x143b23[_0xd3e1('0x31')]=_['intersection'](_0x52ade5['model'],qs['fields'](_0x4029b0[_0xd3e1('0x2f')][_0xd3e1('0x30')]));_0x143b23[_0xd3e1('0x31')]=_0x143b23[_0xd3e1('0x31')][_0xd3e1('0x32')]?_0x143b23[_0xd3e1('0x31')]:_0x52ade5[_0xd3e1('0x2d')];if(_0x4029b0['query'][_0xd3e1('0x3f')]){_0x143b23[_0xd3e1('0x46')]=[{'all':!![]}];}_0x143b23=_['merge']({},_0x143b23,_0x4029b0['options']);return db[_0xd3e1('0x2a')][_0xd3e1('0x47')](_0x143b23)[_0xd3e1('0x21')](handleEntityNotFound(_0x515a3e,null))['then'](respondWithResult(_0x515a3e,null))[_0xd3e1('0x42')](handleError(_0x515a3e,null));};exports[_0xd3e1('0x48')]=function(_0x33155e,_0x5879f8){return db['Template'][_0xd3e1('0x48')](_0x33155e[_0xd3e1('0x49')],{})[_0xd3e1('0x21')](function(_0x4ea45d){var _0x2c3922=_0x33155e[_0xd3e1('0x4a')][_0xd3e1('0x22')]({'plain':!![]});if(!_0x2c3922)throw new Error(_0xd3e1('0x4b'));if(_0x2c3922[_0xd3e1('0x4c')]===_0xd3e1('0x4a')){var _0x5e732a=_0x4ea45d[_0xd3e1('0x22')]({'plain':!![]});var _0x2d1aab=_0xd3e1('0x4d');return db[_0xd3e1('0x4e')][_0xd3e1('0x47')]({'where':{'name':_0x2d1aab,'userProfileId':_0x2c3922[_0xd3e1('0x4f')]},'raw':!![]})[_0xd3e1('0x21')](function(_0x3e7ea2){if(_0x3e7ea2&&_0x3e7ea2['autoAssociation']===0x0){return db[_0xd3e1('0x23')][_0xd3e1('0x48')]({'name':_0x5e732a[_0xd3e1('0x27')],'resourceId':_0x5e732a['id'],'type':_0x3e7ea2['name'],'sectionId':_0x3e7ea2['id']},{})[_0xd3e1('0x21')](function(){return _0x4ea45d;});}else{return _0x4ea45d;}})['catch'](function(_0x5a1760){logger[_0xd3e1('0x25')](_0xd3e1('0x50'),_0x5a1760);throw _0x5a1760;});}return _0x4ea45d;})[_0xd3e1('0x21')](respondWithResult(_0x5879f8,0xc9))[_0xd3e1('0x42')](handleError(_0x5879f8,null));};exports['update']=function(_0x33cd97,_0x11d381){if(_0x33cd97[_0xd3e1('0x49')]['id']){delete _0x33cd97[_0xd3e1('0x49')]['id'];}return db[_0xd3e1('0x2a')][_0xd3e1('0x47')]({'where':{'id':_0x33cd97['params']['id']}})[_0xd3e1('0x21')](handleEntityNotFound(_0x11d381,null))[_0xd3e1('0x21')](saveUpdates(_0x33cd97[_0xd3e1('0x49')],null))[_0xd3e1('0x21')](respondWithResult(_0x11d381,null))['catch'](handleError(_0x11d381,null));};exports[_0xd3e1('0x24')]=function(_0x2d98eb,_0x4b7f49){return db[_0xd3e1('0x2a')]['find']({'where':{'id':_0x2d98eb[_0xd3e1('0x43')]['id']}})[_0xd3e1('0x21')](handleEntityNotFound(_0x4b7f49,null))[_0xd3e1('0x21')](removeEntity(_0x4b7f49,null))[_0xd3e1('0x42')](handleError(_0x4b7f49,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 393d082..a218371 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 _0x8af3=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./template.attributes','exports','define','Template','tools_templates','lodash'];(function(_0xbfcf07,_0x3dd6f0){var _0x2a7548=function(_0x2653e3){while(--_0x2653e3){_0xbfcf07['push'](_0xbfcf07['shift']());}};_0x2a7548(++_0x3dd6f0);}(_0x8af3,0x1cd));var _0x38af=function(_0x5c9872,_0x5d6324){_0x5c9872=_0x5c9872-0x0;var _0x3022b7=_0x8af3[_0x5c9872];return _0x3022b7;};'use strict';var _=require(_0x38af('0x0'));var util=require(_0x38af('0x1'));var logger=require(_0x38af('0x2'))(_0x38af('0x3'));var moment=require(_0x38af('0x4'));var BPromise=require(_0x38af('0x5'));var rp=require(_0x38af('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x38af('0x7'));var config=require(_0x38af('0x8'));var attributes=require(_0x38af('0x9'));module[_0x38af('0xa')]=function(_0x1813ab,_0x1927af){return _0x1813ab[_0x38af('0xb')](_0x38af('0xc'),attributes,{'tableName':_0x38af('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x57ee=['define','Template','tools_templates','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes','exports'];(function(_0x5422ca,_0x538609){var _0x2c514e=function(_0x55c92c){while(--_0x55c92c){_0x5422ca['push'](_0x5422ca['shift']());}};_0x2c514e(++_0x538609);}(_0x57ee,0x1d1));var _0xe57e=function(_0x3b9f20,_0x57b0a2){_0x3b9f20=_0x3b9f20-0x0;var _0x54b6b7=_0x57ee[_0x3b9f20];return _0x54b6b7;};'use strict';var _=require(_0xe57e('0x0'));var util=require(_0xe57e('0x1'));var logger=require('../../config/logger')(_0xe57e('0x2'));var moment=require(_0xe57e('0x3'));var BPromise=require(_0xe57e('0x4'));var rp=require(_0xe57e('0x5'));var fs=require('fs');var path=require(_0xe57e('0x6'));var rimraf=require(_0xe57e('0x7'));var config=require(_0xe57e('0x8'));var attributes=require(_0xe57e('0x9'));module[_0xe57e('0xa')]=function(_0x5a7de2,_0x12982f){return _0x5a7de2[_0xe57e('0xb')](_0xe57e('0xc'),attributes,{'tableName':_0xe57e('0xd'),'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 93b22cb..6fbd916 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 _0xede3=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','findAll','options','attributes','limit','map','include','model','GetTemplate'];(function(_0x36ea36,_0x544f2a){var _0x419659=function(_0x43a55e){while(--_0x43a55e){_0x36ea36['push'](_0x36ea36['shift']());}};_0x419659(++_0x544f2a);}(_0xede3,0xc0));var _0x3ede=function(_0x208bad,_0x21b575){_0x208bad=_0x208bad-0x0;var _0x4d34a3=_0xede3[_0x208bad];return _0x4d34a3;};'use strict';var _=require('lodash');var util=require(_0x3ede('0x0'));var moment=require('moment');var BPromise=require(_0x3ede('0x1'));var rs=require(_0x3ede('0x2'));var fs=require('fs');var Redis=require(_0x3ede('0x3'));var db=require(_0x3ede('0x4'))['db'];var utils=require(_0x3ede('0x5'));var logger=require(_0x3ede('0x6'))(_0x3ede('0x7'));var config=require(_0x3ede('0x8'));var jayson=require(_0x3ede('0x9'));var client=jayson[_0x3ede('0xa')][_0x3ede('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x150182,_0x23646f,_0x402872){return new BPromise(function(_0x583272,_0x428a4b){return client[_0x3ede('0xc')](_0x150182,_0x402872)[_0x3ede('0xd')](function(_0x58ceae){logger[_0x3ede('0xe')](_0x3ede('0xf'),_0x23646f,_0x3ede('0x10'));logger[_0x3ede('0x11')](_0x3ede('0x12'),_0x23646f,'request\x20sent',JSON[_0x3ede('0x13')](_0x58ceae));if(_0x58ceae[_0x3ede('0x14')]){if(_0x58ceae[_0x3ede('0x14')][_0x3ede('0x15')]===0x1f4){logger[_0x3ede('0x14')](_0x3ede('0xf'),_0x23646f,_0x58ceae[_0x3ede('0x14')][_0x3ede('0x16')]);return _0x428a4b(_0x58ceae[_0x3ede('0x14')][_0x3ede('0x16')]);}logger[_0x3ede('0x14')](_0x3ede('0xf'),_0x23646f,_0x58ceae[_0x3ede('0x14')]['message']);return _0x583272(_0x58ceae['error'][_0x3ede('0x16')]);}else{logger['info'](_0x3ede('0xf'),_0x23646f,'request\x20sent');_0x583272(_0x58ceae['result'][_0x3ede('0x16')]);}})[_0x3ede('0x17')](function(_0xb774be){logger['error'](_0x3ede('0xf'),_0x23646f,_0xb774be);_0x428a4b(_0xb774be);});});}exports['GetTemplate']=function(_0x5931f7){var _0x390421=this;return new Promise(function(_0x430327,_0x1c0268){return db['Template'][_0x3ede('0x18')]({'raw':_0x5931f7[_0x3ede('0x19')]?_0x5931f7[_0x3ede('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5931f7['options']?_0x5931f7[_0x3ede('0x19')]['where']||null:null,'attributes':_0x5931f7[_0x3ede('0x19')]?_0x5931f7['options'][_0x3ede('0x1a')]||null:null,'limit':_0x5931f7[_0x3ede('0x19')]?_0x5931f7[_0x3ede('0x19')][_0x3ede('0x1b')]||null:null,'include':_0x5931f7[_0x3ede('0x19')]?_0x5931f7[_0x3ede('0x19')]['include']?_[_0x3ede('0x1c')](_0x5931f7[_0x3ede('0x19')][_0x3ede('0x1d')],function(_0x19e9aa){return{'model':db[_0x19e9aa[_0x3ede('0x1e')]],'as':_0x19e9aa['as'],'attributes':_0x19e9aa[_0x3ede('0x1a')],'include':_0x19e9aa[_0x3ede('0x1d')]?_[_0x3ede('0x1c')](_0x19e9aa[_0x3ede('0x1d')],function(_0x1224b5){return{'model':db[_0x1224b5['model']],'as':_0x1224b5['as'],'attributes':_0x1224b5['attributes'],'include':_0x1224b5[_0x3ede('0x1d')]?_[_0x3ede('0x1c')](_0x1224b5[_0x3ede('0x1d')],function(_0x8e750c){return{'model':db[_0x8e750c[_0x3ede('0x1e')]],'as':_0x8e750c['as'],'attributes':_0x8e750c[_0x3ede('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ee27d){logger[_0x3ede('0xe')](_0x3ede('0x1f'),_0x5931f7);logger['debug'](_0x3ede('0x1f'),_0x5931f7,JSON[_0x3ede('0x13')](_0x2ee27d));_0x430327(_0x2ee27d);})[_0x3ede('0x17')](function(_0x57cf8a){logger[_0x3ede('0x14')]('GetTemplate',_0x57cf8a[_0x3ede('0x16')],_0x5931f7);_0x1c0268(_0x390421[_0x3ede('0x14')](0x1f4,_0x57cf8a['message']));});});}; \ No newline at end of file +var _0xd2bf=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Template','options','raw','where','limit','include','model','attributes','map','GetTemplate','lodash','randomstring','ioredis'];(function(_0x3a243d,_0x31d480){var _0x2fcd72=function(_0x57fca3){while(--_0x57fca3){_0x3a243d['push'](_0x3a243d['shift']());}};_0x2fcd72(++_0x31d480);}(_0xd2bf,0x1dd));var _0xfd2b=function(_0x176d14,_0x3984ea){_0x176d14=_0x176d14-0x0;var _0x89522c=_0xd2bf[_0x176d14];return _0x89522c;};'use strict';var _=require(_0xfd2b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfd2b('0x1'));var fs=require('fs');var Redis=require(_0xfd2b('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xfd2b('0x3'));var logger=require('../../config/logger')(_0xfd2b('0x4'));var config=require(_0xfd2b('0x5'));var jayson=require(_0xfd2b('0x6'));var client=jayson[_0xfd2b('0x7')][_0xfd2b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4fb95e,_0x38db5b,_0x2fa636){return new BPromise(function(_0x46e8db,_0x476f85){return client[_0xfd2b('0x9')](_0x4fb95e,_0x2fa636)[_0xfd2b('0xa')](function(_0x40dde7){logger[_0xfd2b('0xb')](_0xfd2b('0xc'),_0x38db5b,_0xfd2b('0xd'));logger[_0xfd2b('0xe')](_0xfd2b('0xf'),_0x38db5b,_0xfd2b('0xd'),JSON[_0xfd2b('0x10')](_0x40dde7));if(_0x40dde7['error']){if(_0x40dde7[_0xfd2b('0x11')][_0xfd2b('0x12')]===0x1f4){logger[_0xfd2b('0x11')]('Template,\x20%s,\x20%s',_0x38db5b,_0x40dde7[_0xfd2b('0x11')]['message']);return _0x476f85(_0x40dde7[_0xfd2b('0x11')][_0xfd2b('0x13')]);}logger[_0xfd2b('0x11')]('Template,\x20%s,\x20%s',_0x38db5b,_0x40dde7[_0xfd2b('0x11')][_0xfd2b('0x13')]);return _0x46e8db(_0x40dde7[_0xfd2b('0x11')][_0xfd2b('0x13')]);}else{logger[_0xfd2b('0xb')]('Template,\x20%s,\x20%s',_0x38db5b,_0xfd2b('0xd'));_0x46e8db(_0x40dde7[_0xfd2b('0x14')][_0xfd2b('0x13')]);}})[_0xfd2b('0x15')](function(_0x40d901){logger[_0xfd2b('0x11')]('Template,\x20%s,\x20%s',_0x38db5b,_0x40d901);_0x476f85(_0x40d901);});});}exports['GetTemplate']=function(_0x2ebf14){var _0x738bd=this;return new Promise(function(_0x1efd2d,_0x28b353){return db[_0xfd2b('0x16')]['findAll']({'raw':_0x2ebf14[_0xfd2b('0x17')]?_0x2ebf14[_0xfd2b('0x17')][_0xfd2b('0x18')]===undefined?!![]:![]:!![],'where':_0x2ebf14[_0xfd2b('0x17')]?_0x2ebf14['options'][_0xfd2b('0x19')]||null:null,'attributes':_0x2ebf14[_0xfd2b('0x17')]?_0x2ebf14[_0xfd2b('0x17')]['attributes']||null:null,'limit':_0x2ebf14[_0xfd2b('0x17')]?_0x2ebf14[_0xfd2b('0x17')][_0xfd2b('0x1a')]||null:null,'include':_0x2ebf14[_0xfd2b('0x17')]?_0x2ebf14['options'][_0xfd2b('0x1b')]?_['map'](_0x2ebf14[_0xfd2b('0x17')][_0xfd2b('0x1b')],function(_0x5ada3e){return{'model':db[_0x5ada3e[_0xfd2b('0x1c')]],'as':_0x5ada3e['as'],'attributes':_0x5ada3e[_0xfd2b('0x1d')],'include':_0x5ada3e[_0xfd2b('0x1b')]?_[_0xfd2b('0x1e')](_0x5ada3e[_0xfd2b('0x1b')],function(_0x222eed){return{'model':db[_0x222eed[_0xfd2b('0x1c')]],'as':_0x222eed['as'],'attributes':_0x222eed[_0xfd2b('0x1d')],'include':_0x222eed[_0xfd2b('0x1b')]?_['map'](_0x222eed[_0xfd2b('0x1b')],function(_0x1b7126){return{'model':db[_0x1b7126[_0xfd2b('0x1c')]],'as':_0x1b7126['as'],'attributes':_0x1b7126[_0xfd2b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfd2b('0xa')](function(_0x271081){logger[_0xfd2b('0xb')]('GetTemplate',_0x2ebf14);logger[_0xfd2b('0xe')]('GetTemplate',_0x2ebf14,JSON[_0xfd2b('0x10')](_0x271081));_0x1efd2d(_0x271081);})[_0xfd2b('0x15')](function(_0x160c54){logger[_0xfd2b('0x11')](_0xfd2b('0x1f'),_0x160c54[_0xfd2b('0x13')],_0x2ebf14);_0x28b353(_0x738bd[_0xfd2b('0x11')](0x1f4,_0x160c54[_0xfd2b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 11058e5..1629889 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 _0x5523=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','addAllCondition','addAnyCondition','put','/:id','update','destroy','path'];(function(_0x35b216,_0x10526d){var _0x48a7c6=function(_0x2f0987){while(--_0x2f0987){_0x35b216['push'](_0x35b216['shift']());}};_0x48a7c6(++_0x10526d);}(_0x5523,0x137));var _0x3552=function(_0x568d97,_0x4bf20c){_0x568d97=_0x568d97-0x0;var _0x45c140=_0x5523[_0x568d97];return _0x45c140;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3552('0x0'));var timeout=require(_0x3552('0x1'));var express=require(_0x3552('0x2'));var router=express[_0x3552('0x3')]();var fs_extra=require(_0x3552('0x4'));var auth=require(_0x3552('0x5'));var interaction=require(_0x3552('0x6'));var config=require(_0x3552('0x7'));var controller=require(_0x3552('0x8'));router[_0x3552('0x9')]('/',auth[_0x3552('0xa')](),controller['index']);router['get']('/:id',auth[_0x3552('0xa')](),controller['show']);router[_0x3552('0x9')](_0x3552('0xb'),auth[_0x3552('0xa')](),controller['getAllConditions']);router['get'](_0x3552('0xc'),auth[_0x3552('0xa')](),controller[_0x3552('0xd')]);router[_0x3552('0x9')](_0x3552('0xe'),auth[_0x3552('0xa')](),controller[_0x3552('0xf')]);router[_0x3552('0x10')]('/',auth[_0x3552('0xa')](),controller[_0x3552('0x11')]);router[_0x3552('0x10')]('/:id/all_conditions',auth[_0x3552('0xa')](),controller[_0x3552('0x12')]);router[_0x3552('0x10')]('/:id/any_conditions',auth['isAuthenticated'](),controller[_0x3552('0x13')]);router[_0x3552('0x10')](_0x3552('0xe'),auth[_0x3552('0xa')](),controller['addAction']);router[_0x3552('0x14')](_0x3552('0x15'),auth[_0x3552('0xa')](),controller[_0x3552('0x16')]);router['delete'](_0x3552('0x15'),auth[_0x3552('0xa')](),controller[_0x3552('0x17')]);module['exports']=router; \ No newline at end of file +var _0x8bc9=['fs-extra','../../components/interaction/service','../../config/environment','./trigger.controller','get','index','/:id','isAuthenticated','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','/:id/all_conditions','addAllCondition','addAnyCondition','addAction','put','update','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x90dc14,_0x3e55e5){var _0x23a79c=function(_0x5bb338){while(--_0x5bb338){_0x90dc14['push'](_0x90dc14['shift']());}};_0x23a79c(++_0x3e55e5);}(_0x8bc9,0x1bb));var _0x98bc=function(_0x27dc51,_0x14950f){_0x27dc51=_0x27dc51-0x0;var _0x739ae1=_0x8bc9[_0x27dc51];return _0x739ae1;};'use strict';var multer=require(_0x98bc('0x0'));var util=require(_0x98bc('0x1'));var path=require(_0x98bc('0x2'));var timeout=require(_0x98bc('0x3'));var express=require('express');var router=express[_0x98bc('0x4')]();var fs_extra=require(_0x98bc('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x98bc('0x6'));var config=require(_0x98bc('0x7'));var controller=require(_0x98bc('0x8'));router[_0x98bc('0x9')]('/',auth['isAuthenticated'](),controller[_0x98bc('0xa')]);router[_0x98bc('0x9')](_0x98bc('0xb'),auth[_0x98bc('0xc')](),controller['show']);router['get']('/:id/all_conditions',auth[_0x98bc('0xc')](),controller[_0x98bc('0xd')]);router['get'](_0x98bc('0xe'),auth[_0x98bc('0xc')](),controller[_0x98bc('0xf')]);router[_0x98bc('0x9')](_0x98bc('0x10'),auth[_0x98bc('0xc')](),controller[_0x98bc('0x11')]);router[_0x98bc('0x12')]('/',auth[_0x98bc('0xc')](),controller[_0x98bc('0x13')]);router[_0x98bc('0x12')](_0x98bc('0x14'),auth[_0x98bc('0xc')](),controller[_0x98bc('0x15')]);router[_0x98bc('0x12')](_0x98bc('0xe'),auth[_0x98bc('0xc')](),controller[_0x98bc('0x16')]);router[_0x98bc('0x12')](_0x98bc('0x10'),auth['isAuthenticated'](),controller[_0x98bc('0x17')]);router[_0x98bc('0x18')]('/:id',auth[_0x98bc('0xc')](),controller[_0x98bc('0x19')]);router['delete'](_0x98bc('0xb'),auth['isAuthenticated'](),controller[_0x98bc('0x1a')]);module[_0x98bc('0x1b')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 79be170..e57af0d 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 _0xb833=['sequelize','exports','STRING','BOOLEAN'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xb833,0x168));var _0x3b83=function(_0x1ea7fb,_0x1c1749){_0x1ea7fb=_0x1ea7fb-0x0;var _0x4e2a31=_0xb833[_0x1ea7fb];return _0x4e2a31;};'use strict';var Sequelize=require(_0x3b83('0x0'));module[_0x3b83('0x1')]={'name':{'type':Sequelize[_0x3b83('0x2')]},'channel':{'type':Sequelize[_0x3b83('0x2')]},'description':{'type':Sequelize[_0x3b83('0x2')]},'status':{'type':Sequelize[_0x3b83('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x57bd=['sequelize','exports','STRING','BOOLEAN'];(function(_0x473862,_0x199b67){var _0x5a57bb=function(_0x15d93d){while(--_0x15d93d){_0x473862['push'](_0x473862['shift']());}};_0x5a57bb(++_0x199b67);}(_0x57bd,0xec));var _0xd57b=function(_0x1c05ca,_0x6153de){_0x1c05ca=_0x1c05ca-0x0;var _0x241a2e=_0x57bd[_0x1c05ca];return _0x241a2e;};'use strict';var Sequelize=require(_0xd57b('0x0'));module[_0xd57b('0x1')]={'name':{'type':Sequelize[_0xd57b('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd57b('0x2')]},'status':{'type':Sequelize[_0xd57b('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 2f9ba4c..ac08870 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 _0xed4e=['api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','update','then','destroy','get','Triggers','UserProfileResource','sendStatus','error','stack','name','send','index','map','Trigger','type','key','model','query','attributes','intersection','fields','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','length','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','TriggerAllId','Condition','addAnyCondition','getAllConditions','options','hasOwnProperty','getAnyConditions','findOne','addAction','TriggerId','Action','getActions','eml-format','zip-dir','fast-json-patch','moment','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x3eac89,_0x1e89ba){var _0x4630e8=function(_0x2fbf04){while(--_0x2fbf04){_0x3eac89['push'](_0x3eac89['shift']());}};_0x4630e8(++_0x1e89ba);}(_0xed4e,0xa8));var _0xeed4=function(_0x4f9975,_0x3741fb){_0x4f9975=_0x4f9975-0x0;var _0x34114f=_0xed4e[_0x4f9975];return _0x34114f;};'use strict';var emlformat=require(_0xeed4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xeed4('0x1'));var jsonpatch=require(_0xeed4('0x2'));var rp=require('request-promise');var moment=require(_0xeed4('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xeed4('0x4'));var path=require('path');var sox=require(_0xeed4('0x5'));var csv=require(_0xeed4('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeed4('0x7'));var _=require(_0xeed4('0x8'));var squel=require(_0xeed4('0x9'));var crypto=require(_0xeed4('0xa'));var jsforce=require(_0xeed4('0xb'));var deskjs=require(_0xeed4('0xc'));var toCsv=require(_0xeed4('0x6'));var querystring=require(_0xeed4('0xd'));var Papa=require(_0xeed4('0xe'));var Redis=require(_0xeed4('0xf'));var authService=require(_0xeed4('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xeed4('0x11'));var hardwareService=require(_0xeed4('0x12'));var logger=require(_0xeed4('0x13'))(_0xeed4('0x14'));var utils=require('../../config/utils');var config=require(_0xeed4('0x15'));var licenseUtil=require(_0xeed4('0x16'));var db=require(_0xeed4('0x17'))['db'];function respondWithStatusCode(_0x383a92,_0x5bc2b1){_0x5bc2b1=_0x5bc2b1||0xcc;return function(_0x3062b4){if(_0x3062b4){return _0x383a92['sendStatus'](_0x5bc2b1);}return _0x383a92[_0xeed4('0x18')](_0x5bc2b1)[_0xeed4('0x19')]();};}function respondWithResult(_0x26c154,_0x5037eb){_0x5037eb=_0x5037eb||0xc8;return function(_0x189aee){if(_0x189aee){return _0x26c154[_0xeed4('0x18')](_0x5037eb)[_0xeed4('0x1a')](_0x189aee);}};}function respondWithFilteredResult(_0x5ec477,_0x20de92){return function(_0x1e2d1f){if(_0x1e2d1f){var _0x998fd3=typeof _0x20de92[_0xeed4('0x1b')]===_0xeed4('0x1c')&&typeof _0x20de92[_0xeed4('0x1d')]===_0xeed4('0x1c');var _0x3b1a48=_0x1e2d1f['count'];var _0x22fa54=_0x998fd3?0x0:_0x20de92[_0xeed4('0x1b')];var _0x8e9b8c=_0x998fd3?_0x1e2d1f[_0xeed4('0x1e')]:_0x20de92['offset']+_0x20de92[_0xeed4('0x1d')];var _0x157e32;if(_0x8e9b8c>=_0x3b1a48){_0x8e9b8c=_0x3b1a48;_0x157e32=0xc8;}else{_0x157e32=0xce;}_0x5ec477[_0xeed4('0x18')](_0x157e32);return _0x5ec477[_0xeed4('0x1f')]('Content-Range',_0x22fa54+'-'+_0x8e9b8c+'/'+_0x3b1a48)[_0xeed4('0x1a')](_0x1e2d1f);}return null;};}function patchUpdates(_0x541cd7){return function(_0x423e08){try{jsonpatch['apply'](_0x423e08,_0x541cd7,!![]);}catch(_0x1b1996){return BPromise['reject'](_0x1b1996);}return _0x423e08['save']();};}function saveUpdates(_0x4984a6,_0x26d6be){return function(_0x454526){if(_0x454526){return _0x454526[_0xeed4('0x20')](_0x4984a6)[_0xeed4('0x21')](function(_0x1800a4){return _0x1800a4;});}return null;};}function removeEntity(_0x4eb9da,_0x1d4b36){return function(_0x2f6c3f){if(_0x2f6c3f){return _0x2f6c3f[_0xeed4('0x22')]()['then'](function(){var _0x940b35=_0x2f6c3f[_0xeed4('0x23')]({'plain':!![]});var _0x4931dd=_0xeed4('0x24');return db[_0xeed4('0x25')]['destroy']({'where':{'type':_0x4931dd,'resourceId':_0x940b35['id']}})['then'](function(){return _0x2f6c3f;});})[_0xeed4('0x21')](function(){_0x4eb9da[_0xeed4('0x18')](0xcc)[_0xeed4('0x19')]();});}};}function handleEntityNotFound(_0x4893da,_0x11ef94){return function(_0x3a4322){if(!_0x3a4322){_0x4893da[_0xeed4('0x26')](0x194);}return _0x3a4322;};}function handleError(_0x133dbc,_0x5a1bd5){_0x5a1bd5=_0x5a1bd5||0x1f4;return function(_0x17a065){logger[_0xeed4('0x27')](_0x17a065[_0xeed4('0x28')]);if(_0x17a065['name']){delete _0x17a065[_0xeed4('0x29')];}_0x133dbc['status'](_0x5a1bd5)[_0xeed4('0x2a')](_0x17a065);};}exports[_0xeed4('0x2b')]=function(_0x562e9b,_0x2c45f3){var _0x78e9a8={},_0x36ea74={},_0x3577ac={'count':0x0,'rows':[]};var _0x4f8cd7=_[_0xeed4('0x2c')](db[_0xeed4('0x2d')]['rawAttributes'],function(_0x81fe51){return{'name':_0x81fe51['fieldName'],'type':_0x81fe51[_0xeed4('0x2e')][_0xeed4('0x2f')]};});_0x36ea74[_0xeed4('0x30')]=_[_0xeed4('0x2c')](_0x4f8cd7,_0xeed4('0x29'));_0x36ea74[_0xeed4('0x31')]=_['keys'](_0x562e9b[_0xeed4('0x31')]);_0x36ea74['filters']=_['intersection'](_0x36ea74[_0xeed4('0x30')],_0x36ea74['query']);_0x78e9a8[_0xeed4('0x32')]=_[_0xeed4('0x33')](_0x36ea74[_0xeed4('0x30')],qs['fields'](_0x562e9b[_0xeed4('0x31')][_0xeed4('0x34')]));_0x78e9a8[_0xeed4('0x32')]=_0x78e9a8[_0xeed4('0x32')]['length']?_0x78e9a8['attributes']:_0x36ea74[_0xeed4('0x30')];if(!_0x562e9b['query']['hasOwnProperty'](_0xeed4('0x35'))){_0x78e9a8[_0xeed4('0x1d')]=qs[_0xeed4('0x1d')](_0x562e9b[_0xeed4('0x31')][_0xeed4('0x1d')]);_0x78e9a8[_0xeed4('0x1b')]=qs[_0xeed4('0x1b')](_0x562e9b[_0xeed4('0x31')][_0xeed4('0x1b')]);}_0x78e9a8[_0xeed4('0x36')]=qs[_0xeed4('0x37')](_0x562e9b[_0xeed4('0x31')]['sort']);_0x78e9a8[_0xeed4('0x38')]=qs[_0xeed4('0x39')](_[_0xeed4('0x3a')](_0x562e9b[_0xeed4('0x31')],_0x36ea74['filters']),_0x4f8cd7);if(_0x562e9b[_0xeed4('0x31')][_0xeed4('0x3b')]){_0x78e9a8['where']=_['merge'](_0x78e9a8[_0xeed4('0x38')],{'$or':_['map'](_0x4f8cd7,function(_0x1cf8df){if(_0x1cf8df[_0xeed4('0x2e')]!==_0xeed4('0x3c')){var _0x87c3b4={};_0x87c3b4[_0x1cf8df[_0xeed4('0x29')]]={'$like':'%'+_0x562e9b[_0xeed4('0x31')][_0xeed4('0x3b')]+'%'};return _0x87c3b4;}})});}_0x78e9a8=_[_0xeed4('0x3d')]({},_0x78e9a8,_0x562e9b['options']);var _0x4f0487={'where':_0x78e9a8[_0xeed4('0x38')]};return db['Trigger'][_0xeed4('0x1e')](_0x4f0487)[_0xeed4('0x21')](function(_0x53ee03){_0x3577ac[_0xeed4('0x1e')]=_0x53ee03;if(_0x562e9b[_0xeed4('0x31')][_0xeed4('0x3e')]){_0x78e9a8[_0xeed4('0x3f')]=[{'all':!![]}];}return db[_0xeed4('0x2d')][_0xeed4('0x40')](_0x78e9a8);})['then'](function(_0x43cd7b){_0x3577ac[_0xeed4('0x41')]=_0x43cd7b;return _0x3577ac;})[_0xeed4('0x21')](respondWithFilteredResult(_0x2c45f3,_0x78e9a8))[_0xeed4('0x42')](handleError(_0x2c45f3,null));};exports[_0xeed4('0x43')]=function(_0x194f7f,_0x280835){var _0x47678d={'raw':![],'where':{'id':_0x194f7f['params']['id']}},_0x49a5da={};_0x49a5da[_0xeed4('0x30')]=_[_0xeed4('0x44')](db[_0xeed4('0x2d')][_0xeed4('0x45')]);_0x49a5da[_0xeed4('0x31')]=_['keys'](_0x194f7f[_0xeed4('0x31')]);_0x49a5da[_0xeed4('0x39')]=_[_0xeed4('0x33')](_0x49a5da[_0xeed4('0x30')],_0x49a5da['query']);_0x47678d[_0xeed4('0x32')]=_[_0xeed4('0x33')](_0x49a5da['model'],qs[_0xeed4('0x34')](_0x194f7f['query']['fields']));_0x47678d[_0xeed4('0x32')]=_0x47678d[_0xeed4('0x32')][_0xeed4('0x46')]?_0x47678d[_0xeed4('0x32')]:_0x49a5da[_0xeed4('0x30')];if(_0x194f7f['query']['includeAll']){_0x47678d[_0xeed4('0x3f')]=[{'all':!![]}];}_0x47678d=_[_0xeed4('0x3d')]({},_0x47678d,_0x194f7f['options']);return db['Trigger']['find'](_0x47678d)[_0xeed4('0x21')](handleEntityNotFound(_0x280835,null))[_0xeed4('0x21')](respondWithResult(_0x280835,null))['catch'](handleError(_0x280835,null));};exports[_0xeed4('0x47')]=function(_0x4ebea9,_0x1a7edf){return db[_0xeed4('0x2d')][_0xeed4('0x47')](_0x4ebea9[_0xeed4('0x48')],{})['then'](function(_0x1a031b){var _0x261853=_0x4ebea9['user'][_0xeed4('0x23')]({'plain':!![]});if(!_0x261853)throw new Error(_0xeed4('0x49'));if(_0x261853[_0xeed4('0x4a')]===_0xeed4('0x4b')){var _0x57e99e=_0x1a031b[_0xeed4('0x23')]({'plain':!![]});var _0x29135c=_0xeed4('0x24');return db[_0xeed4('0x4c')][_0xeed4('0x4d')]({'where':{'name':_0x29135c,'userProfileId':_0x261853[_0xeed4('0x4e')]},'raw':!![]})[_0xeed4('0x21')](function(_0xa8c7c9){if(_0xa8c7c9&&_0xa8c7c9[_0xeed4('0x4f')]===0x0){return db[_0xeed4('0x25')][_0xeed4('0x47')]({'name':_0x57e99e[_0xeed4('0x29')],'resourceId':_0x57e99e['id'],'type':_0xa8c7c9[_0xeed4('0x29')],'sectionId':_0xa8c7c9['id']},{})[_0xeed4('0x21')](function(){return _0x1a031b;});}else{return _0x1a031b;}})[_0xeed4('0x42')](function(_0x5817be){logger['error'](_0xeed4('0x50'),_0x5817be);throw _0x5817be;});}return _0x1a031b;})[_0xeed4('0x21')](respondWithResult(_0x1a7edf,0xc9))[_0xeed4('0x42')](handleError(_0x1a7edf,null));};exports['update']=function(_0x46aadf,_0x4d9985){if(_0x46aadf['body']['id']){delete _0x46aadf['body']['id'];}return db[_0xeed4('0x2d')][_0xeed4('0x4d')]({'where':{'id':_0x46aadf[_0xeed4('0x51')]['id']}})[_0xeed4('0x21')](handleEntityNotFound(_0x4d9985,null))['then'](saveUpdates(_0x46aadf['body'],null))[_0xeed4('0x21')](respondWithResult(_0x4d9985,null))[_0xeed4('0x42')](handleError(_0x4d9985,null));};exports[_0xeed4('0x22')]=function(_0x220060,_0x31eb23){return db['Trigger'][_0xeed4('0x4d')]({'where':{'id':_0x220060['params']['id']}})[_0xeed4('0x21')](handleEntityNotFound(_0x31eb23,null))[_0xeed4('0x21')](removeEntity(_0x31eb23,null))[_0xeed4('0x42')](handleError(_0x31eb23,null));};exports['addAllCondition']=function(_0x22bf31,_0x35a7a1,_0x640f09){if(_0x22bf31['body']['id']){delete _0x22bf31[_0xeed4('0x48')]['id'];}return db[_0xeed4('0x2d')][_0xeed4('0x4d')]({'where':{'id':_0x22bf31[_0xeed4('0x51')]['id']}})[_0xeed4('0x21')](handleEntityNotFound(_0x35a7a1,null))['then'](function(_0x41056f){if(_0x41056f){_0x22bf31[_0xeed4('0x48')][_0xeed4('0x52')]=_0x41056f['id'];return db[_0xeed4('0x53')][_0xeed4('0x47')](_0x22bf31[_0xeed4('0x48')]);}})[_0xeed4('0x21')](respondWithResult(_0x35a7a1,null))[_0xeed4('0x42')](handleError(_0x35a7a1,null));};exports[_0xeed4('0x54')]=function(_0x41e33d,_0x5a45bc,_0x4be381){if(_0x41e33d[_0xeed4('0x48')]['id']){delete _0x41e33d[_0xeed4('0x48')]['id'];}return db['Trigger'][_0xeed4('0x4d')]({'where':{'id':_0x41e33d[_0xeed4('0x51')]['id']}})[_0xeed4('0x21')](handleEntityNotFound(_0x5a45bc,null))[_0xeed4('0x21')](function(_0x1e13b0){if(_0x1e13b0){_0x41e33d[_0xeed4('0x48')]['TriggerAnyId']=_0x1e13b0['id'];return db[_0xeed4('0x53')][_0xeed4('0x47')](_0x41e33d[_0xeed4('0x48')]);}})[_0xeed4('0x21')](respondWithResult(_0x5a45bc,null))[_0xeed4('0x42')](handleError(_0x5a45bc,null));};exports[_0xeed4('0x55')]=function(_0x10edd2,_0x4e1de6,_0x7c7ef8){var _0x4b0ff7={};var _0xd2a775={};var _0x1b7bd1;var _0x32d898;return db[_0xeed4('0x2d')]['findOne']({'where':{'id':_0x10edd2[_0xeed4('0x51')]['id']}})[_0xeed4('0x21')](handleEntityNotFound(_0x4e1de6,null))[_0xeed4('0x21')](function(_0x1fd66d){if(_0x1fd66d){_0x1b7bd1=_0x1fd66d;_0xd2a775[_0xeed4('0x30')]=_[_0xeed4('0x44')](db[_0xeed4('0x53')][_0xeed4('0x45')]);_0xd2a775[_0xeed4('0x31')]=_['keys'](_0x10edd2['query']);_0xd2a775['filters']=_[_0xeed4('0x33')](_0xd2a775[_0xeed4('0x30')],_0xd2a775[_0xeed4('0x31')]);_0x4b0ff7['attributes']=_[_0xeed4('0x33')](_0xd2a775[_0xeed4('0x30')],qs[_0xeed4('0x34')](_0x10edd2[_0xeed4('0x31')]['fields']));_0x4b0ff7[_0xeed4('0x32')]=_0x4b0ff7[_0xeed4('0x32')]['length']?_0x4b0ff7[_0xeed4('0x32')]:_0xd2a775[_0xeed4('0x30')];_0x4b0ff7[_0xeed4('0x36')]=qs[_0xeed4('0x37')](_0x10edd2[_0xeed4('0x31')][_0xeed4('0x37')]);_0x4b0ff7[_0xeed4('0x38')]=qs[_0xeed4('0x39')](_[_0xeed4('0x3a')](_0x10edd2['query'],_0xd2a775[_0xeed4('0x39')]));if(_0x10edd2[_0xeed4('0x31')]['filter']){_0x4b0ff7[_0xeed4('0x38')]=_[_0xeed4('0x3d')](_0x4b0ff7[_0xeed4('0x38')],{'$or':_[_0xeed4('0x2c')](_0x4b0ff7[_0xeed4('0x32')],function(_0x246065){var _0x4afa48={};_0x4afa48[_0x246065]={'$like':'%'+_0x10edd2[_0xeed4('0x31')][_0xeed4('0x3b')]+'%'};return _0x4afa48;})});}_0x4b0ff7=_[_0xeed4('0x3d')]({},_0x4b0ff7,_0x10edd2[_0xeed4('0x56')]);return _0x1b7bd1['getAllConditions'](_0x4b0ff7);}})[_0xeed4('0x21')](function(_0x32ca3b){if(_0x32ca3b){_0x32d898=_0x32ca3b[_0xeed4('0x46')];if(!_0x10edd2[_0xeed4('0x31')][_0xeed4('0x57')]('nolimit')){_0x4b0ff7[_0xeed4('0x1d')]=qs[_0xeed4('0x1d')](_0x10edd2['query']['limit']);_0x4b0ff7[_0xeed4('0x1b')]=qs[_0xeed4('0x1b')](_0x10edd2[_0xeed4('0x31')][_0xeed4('0x1b')]);}return _0x1b7bd1[_0xeed4('0x55')](_0x4b0ff7);}})[_0xeed4('0x21')](function(_0x1725c0){if(_0x1725c0){return _0x1725c0?{'count':_0x32d898,'rows':_0x1725c0}:null;}})['then'](respondWithResult(_0x4e1de6,null))['catch'](handleError(_0x4e1de6,null));};exports[_0xeed4('0x58')]=function(_0x49777c,_0x45568f,_0x541f97){var _0x4296a2={};var _0x2c3052={};var _0x78aaab;var _0x128b93;return db[_0xeed4('0x2d')][_0xeed4('0x59')]({'where':{'id':_0x49777c[_0xeed4('0x51')]['id']}})[_0xeed4('0x21')](handleEntityNotFound(_0x45568f,null))[_0xeed4('0x21')](function(_0x10cf62){if(_0x10cf62){_0x78aaab=_0x10cf62;_0x2c3052[_0xeed4('0x30')]=_['keys'](db[_0xeed4('0x53')][_0xeed4('0x45')]);_0x2c3052[_0xeed4('0x31')]=_[_0xeed4('0x44')](_0x49777c[_0xeed4('0x31')]);_0x2c3052[_0xeed4('0x39')]=_['intersection'](_0x2c3052[_0xeed4('0x30')],_0x2c3052[_0xeed4('0x31')]);_0x4296a2[_0xeed4('0x32')]=_[_0xeed4('0x33')](_0x2c3052[_0xeed4('0x30')],qs[_0xeed4('0x34')](_0x49777c['query'][_0xeed4('0x34')]));_0x4296a2[_0xeed4('0x32')]=_0x4296a2[_0xeed4('0x32')][_0xeed4('0x46')]?_0x4296a2[_0xeed4('0x32')]:_0x2c3052[_0xeed4('0x30')];_0x4296a2[_0xeed4('0x36')]=qs[_0xeed4('0x37')](_0x49777c[_0xeed4('0x31')]['sort']);_0x4296a2['where']=qs[_0xeed4('0x39')](_[_0xeed4('0x3a')](_0x49777c[_0xeed4('0x31')],_0x2c3052['filters']));if(_0x49777c[_0xeed4('0x31')][_0xeed4('0x3b')]){_0x4296a2[_0xeed4('0x38')]=_['merge'](_0x4296a2[_0xeed4('0x38')],{'$or':_[_0xeed4('0x2c')](_0x4296a2[_0xeed4('0x32')],function(_0x387cca){var _0x2d6ad3={};_0x2d6ad3[_0x387cca]={'$like':'%'+_0x49777c[_0xeed4('0x31')][_0xeed4('0x3b')]+'%'};return _0x2d6ad3;})});}_0x4296a2=_['merge']({},_0x4296a2,_0x49777c[_0xeed4('0x56')]);return _0x78aaab[_0xeed4('0x58')](_0x4296a2);}})[_0xeed4('0x21')](function(_0x3e9a6c){if(_0x3e9a6c){_0x128b93=_0x3e9a6c['length'];if(!_0x49777c[_0xeed4('0x31')][_0xeed4('0x57')](_0xeed4('0x35'))){_0x4296a2[_0xeed4('0x1d')]=qs[_0xeed4('0x1d')](_0x49777c['query'][_0xeed4('0x1d')]);_0x4296a2[_0xeed4('0x1b')]=qs[_0xeed4('0x1b')](_0x49777c['query'][_0xeed4('0x1b')]);}return _0x78aaab[_0xeed4('0x58')](_0x4296a2);}})['then'](function(_0x4cf52a){if(_0x4cf52a){return _0x4cf52a?{'count':_0x128b93,'rows':_0x4cf52a}:null;}})['then'](respondWithResult(_0x45568f,null))[_0xeed4('0x42')](handleError(_0x45568f,null));};exports[_0xeed4('0x5a')]=function(_0x41c33d,_0x482d2d,_0x526d61){if(_0x41c33d['body']['id']){delete _0x41c33d[_0xeed4('0x48')]['id'];}return db[_0xeed4('0x2d')]['find']({'where':{'id':_0x41c33d['params']['id']}})[_0xeed4('0x21')](handleEntityNotFound(_0x482d2d,null))[_0xeed4('0x21')](function(_0x56fe1a){if(_0x56fe1a){_0x41c33d[_0xeed4('0x48')][_0xeed4('0x5b')]=_0x56fe1a['id'];return db[_0xeed4('0x5c')]['create'](_0x41c33d[_0xeed4('0x48')]);}})['then'](respondWithResult(_0x482d2d,null))[_0xeed4('0x42')](handleError(_0x482d2d,null));};exports['getActions']=function(_0x513e70,_0x35b9ac,_0x1085b0){var _0x28b203={};var _0x457fc4={};var _0x2d2ff3;var _0x5bf361;return db[_0xeed4('0x2d')][_0xeed4('0x59')]({'where':{'id':_0x513e70[_0xeed4('0x51')]['id']}})['then'](handleEntityNotFound(_0x35b9ac,null))['then'](function(_0x5cd86a){if(_0x5cd86a){_0x2d2ff3=_0x5cd86a;_0x457fc4['model']=_['keys'](db[_0xeed4('0x5c')]['rawAttributes']);_0x457fc4[_0xeed4('0x31')]=_[_0xeed4('0x44')](_0x513e70[_0xeed4('0x31')]);_0x457fc4[_0xeed4('0x39')]=_['intersection'](_0x457fc4[_0xeed4('0x30')],_0x457fc4['query']);_0x28b203['attributes']=_[_0xeed4('0x33')](_0x457fc4[_0xeed4('0x30')],qs[_0xeed4('0x34')](_0x513e70[_0xeed4('0x31')][_0xeed4('0x34')]));_0x28b203[_0xeed4('0x32')]=_0x28b203[_0xeed4('0x32')][_0xeed4('0x46')]?_0x28b203[_0xeed4('0x32')]:_0x457fc4[_0xeed4('0x30')];_0x28b203[_0xeed4('0x36')]=qs[_0xeed4('0x37')](_0x513e70[_0xeed4('0x31')]['sort']);_0x28b203[_0xeed4('0x38')]=qs[_0xeed4('0x39')](_['pick'](_0x513e70[_0xeed4('0x31')],_0x457fc4[_0xeed4('0x39')]));if(_0x513e70['query'][_0xeed4('0x3b')]){_0x28b203[_0xeed4('0x38')]=_[_0xeed4('0x3d')](_0x28b203[_0xeed4('0x38')],{'$or':_[_0xeed4('0x2c')](_0x28b203[_0xeed4('0x32')],function(_0x1afe64){var _0x2cd5e9={};_0x2cd5e9[_0x1afe64]={'$like':'%'+_0x513e70[_0xeed4('0x31')][_0xeed4('0x3b')]+'%'};return _0x2cd5e9;})});}_0x28b203=_['merge']({},_0x28b203,_0x513e70[_0xeed4('0x56')]);return _0x2d2ff3[_0xeed4('0x5d')](_0x28b203);}})[_0xeed4('0x21')](function(_0x57ec12){if(_0x57ec12){_0x5bf361=_0x57ec12[_0xeed4('0x46')];if(!_0x513e70['query'][_0xeed4('0x57')](_0xeed4('0x35'))){_0x28b203[_0xeed4('0x1d')]=qs[_0xeed4('0x1d')](_0x513e70[_0xeed4('0x31')][_0xeed4('0x1d')]);_0x28b203['offset']=qs[_0xeed4('0x1b')](_0x513e70[_0xeed4('0x31')][_0xeed4('0x1b')]);}return _0x2d2ff3[_0xeed4('0x5d')](_0x28b203);}})[_0xeed4('0x21')](function(_0x4d91c5){if(_0x4d91c5){return _0x4d91c5?{'count':_0x5bf361,'rows':_0x4d91c5}:null;}})[_0xeed4('0x21')](respondWithResult(_0x35b9ac,null))[_0xeed4('0x42')](handleError(_0x35b9ac,null));}; \ No newline at end of file +var _0x66c0=['include','findAll','rows','show','params','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Triggers','find','userProfileId','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','order','nolimit','getAnyConditions','Action','getActions','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','get','destroy','error','stack','name','send','index','map','Trigger','fieldName','key','model','keys','filters','intersection','attributes','fields','length','query','hasOwnProperty','sort','where','pick','VIRTUAL','filter','merge','options','includeAll'];(function(_0x3b98c1,_0x3a4ae5){var _0x26990b=function(_0x2e1779){while(--_0x2e1779){_0x3b98c1['push'](_0x3b98c1['shift']());}};_0x26990b(++_0x3a4ae5);}(_0x66c0,0x1a2));var _0x066c=function(_0x402510,_0xe6fa73){_0x402510=_0x402510-0x0;var _0x5e43e3=_0x66c0[_0x402510];return _0x5e43e3;};'use strict';var emlformat=require(_0x066c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x066c('0x1'));var rp=require(_0x066c('0x2'));var moment=require(_0x066c('0x3'));var BPromise=require(_0x066c('0x4'));var Mustache=require(_0x066c('0x5'));var util=require(_0x066c('0x6'));var path=require(_0x066c('0x7'));var sox=require('sox');var csv=require(_0x066c('0x8'));var ejs=require(_0x066c('0x9'));var fs=require('fs');var fs_extra=require(_0x066c('0xa'));var _=require(_0x066c('0xb'));var squel=require(_0x066c('0xc'));var crypto=require('crypto');var jsforce=require(_0x066c('0xd'));var deskjs=require(_0x066c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x066c('0xf'));var Papa=require(_0x066c('0x10'));var Redis=require(_0x066c('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x066c('0x12'));var hardwareService=require(_0x066c('0x13'));var logger=require('../../config/logger')(_0x066c('0x14'));var utils=require(_0x066c('0x15'));var config=require(_0x066c('0x16'));var licenseUtil=require(_0x066c('0x17'));var db=require(_0x066c('0x18'))['db'];function respondWithStatusCode(_0x523aa7,_0x3ae722){_0x3ae722=_0x3ae722||0xcc;return function(_0x2b2c5e){if(_0x2b2c5e){return _0x523aa7[_0x066c('0x19')](_0x3ae722);}return _0x523aa7[_0x066c('0x1a')](_0x3ae722)[_0x066c('0x1b')]();};}function respondWithResult(_0x50f801,_0x4e2ccf){_0x4e2ccf=_0x4e2ccf||0xc8;return function(_0x1b2c5c){if(_0x1b2c5c){return _0x50f801[_0x066c('0x1a')](_0x4e2ccf)['json'](_0x1b2c5c);}};}function respondWithFilteredResult(_0x416043,_0x382996){return function(_0x50ae43){if(_0x50ae43){var _0x5e47a8=typeof _0x382996[_0x066c('0x1c')]===_0x066c('0x1d')&&typeof _0x382996[_0x066c('0x1e')]===_0x066c('0x1d');var _0x4440c8=_0x50ae43[_0x066c('0x1f')];var _0x58c025=_0x5e47a8?0x0:_0x382996[_0x066c('0x1c')];var _0x95708b=_0x5e47a8?_0x50ae43[_0x066c('0x1f')]:_0x382996[_0x066c('0x1c')]+_0x382996[_0x066c('0x1e')];var _0x401404;if(_0x95708b>=_0x4440c8){_0x95708b=_0x4440c8;_0x401404=0xc8;}else{_0x401404=0xce;}_0x416043[_0x066c('0x1a')](_0x401404);return _0x416043[_0x066c('0x20')](_0x066c('0x21'),_0x58c025+'-'+_0x95708b+'/'+_0x4440c8)[_0x066c('0x22')](_0x50ae43);}return null;};}function patchUpdates(_0x29ab7b){return function(_0x2bdb3a){try{jsonpatch[_0x066c('0x23')](_0x2bdb3a,_0x29ab7b,!![]);}catch(_0x44fc4f){return BPromise[_0x066c('0x24')](_0x44fc4f);}return _0x2bdb3a[_0x066c('0x25')]();};}function saveUpdates(_0x5d3141,_0x217ba2){return function(_0x2b572a){if(_0x2b572a){return _0x2b572a['update'](_0x5d3141)['then'](function(_0x328103){return _0x328103;});}return null;};}function removeEntity(_0x2c34bb,_0x3bcbb2){return function(_0x422631){if(_0x422631){return _0x422631['destroy']()[_0x066c('0x26')](function(){var _0x1fd002=_0x422631[_0x066c('0x27')]({'plain':!![]});var _0x37452a='Triggers';return db['UserProfileResource'][_0x066c('0x28')]({'where':{'type':_0x37452a,'resourceId':_0x1fd002['id']}})[_0x066c('0x26')](function(){return _0x422631;});})['then'](function(){_0x2c34bb['status'](0xcc)[_0x066c('0x1b')]();});}};}function handleEntityNotFound(_0x42e184,_0xa6ef30){return function(_0x35be85){if(!_0x35be85){_0x42e184['sendStatus'](0x194);}return _0x35be85;};}function handleError(_0x2562ef,_0x3f6987){_0x3f6987=_0x3f6987||0x1f4;return function(_0x39eea1){logger[_0x066c('0x29')](_0x39eea1[_0x066c('0x2a')]);if(_0x39eea1[_0x066c('0x2b')]){delete _0x39eea1[_0x066c('0x2b')];}_0x2562ef[_0x066c('0x1a')](_0x3f6987)[_0x066c('0x2c')](_0x39eea1);};}exports[_0x066c('0x2d')]=function(_0x27c249,_0x141f9f){var _0x1455f1={},_0x22e4ea={},_0x3afd11={'count':0x0,'rows':[]};var _0x26135a=_[_0x066c('0x2e')](db[_0x066c('0x2f')]['rawAttributes'],function(_0x55f878){return{'name':_0x55f878[_0x066c('0x30')],'type':_0x55f878['type'][_0x066c('0x31')]};});_0x22e4ea[_0x066c('0x32')]=_['map'](_0x26135a,_0x066c('0x2b'));_0x22e4ea['query']=_[_0x066c('0x33')](_0x27c249['query']);_0x22e4ea[_0x066c('0x34')]=_[_0x066c('0x35')](_0x22e4ea['model'],_0x22e4ea['query']);_0x1455f1[_0x066c('0x36')]=_[_0x066c('0x35')](_0x22e4ea[_0x066c('0x32')],qs[_0x066c('0x37')](_0x27c249['query'][_0x066c('0x37')]));_0x1455f1[_0x066c('0x36')]=_0x1455f1[_0x066c('0x36')][_0x066c('0x38')]?_0x1455f1[_0x066c('0x36')]:_0x22e4ea[_0x066c('0x32')];if(!_0x27c249[_0x066c('0x39')][_0x066c('0x3a')]('nolimit')){_0x1455f1['limit']=qs['limit'](_0x27c249['query'][_0x066c('0x1e')]);_0x1455f1[_0x066c('0x1c')]=qs[_0x066c('0x1c')](_0x27c249[_0x066c('0x39')][_0x066c('0x1c')]);}_0x1455f1['order']=qs[_0x066c('0x3b')](_0x27c249[_0x066c('0x39')][_0x066c('0x3b')]);_0x1455f1[_0x066c('0x3c')]=qs[_0x066c('0x34')](_[_0x066c('0x3d')](_0x27c249[_0x066c('0x39')],_0x22e4ea[_0x066c('0x34')]),_0x26135a);if(_0x27c249['query']['filter']){_0x1455f1['where']=_['merge'](_0x1455f1['where'],{'$or':_[_0x066c('0x2e')](_0x26135a,function(_0x43ed98){if(_0x43ed98['type']!==_0x066c('0x3e')){var _0x1bb61c={};_0x1bb61c[_0x43ed98['name']]={'$like':'%'+_0x27c249[_0x066c('0x39')][_0x066c('0x3f')]+'%'};return _0x1bb61c;}})});}_0x1455f1=_[_0x066c('0x40')]({},_0x1455f1,_0x27c249[_0x066c('0x41')]);var _0x23e08b={'where':_0x1455f1[_0x066c('0x3c')]};return db[_0x066c('0x2f')][_0x066c('0x1f')](_0x23e08b)[_0x066c('0x26')](function(_0x40948f){_0x3afd11[_0x066c('0x1f')]=_0x40948f;if(_0x27c249['query'][_0x066c('0x42')]){_0x1455f1[_0x066c('0x43')]=[{'all':!![]}];}return db[_0x066c('0x2f')][_0x066c('0x44')](_0x1455f1);})['then'](function(_0x37f205){_0x3afd11[_0x066c('0x45')]=_0x37f205;return _0x3afd11;})[_0x066c('0x26')](respondWithFilteredResult(_0x141f9f,_0x1455f1))['catch'](handleError(_0x141f9f,null));};exports[_0x066c('0x46')]=function(_0x4e046e,_0xaf4dc){var _0x125b9c={'raw':![],'where':{'id':_0x4e046e[_0x066c('0x47')]['id']}},_0x26990d={};_0x26990d[_0x066c('0x32')]=_[_0x066c('0x33')](db[_0x066c('0x2f')][_0x066c('0x48')]);_0x26990d[_0x066c('0x39')]=_[_0x066c('0x33')](_0x4e046e[_0x066c('0x39')]);_0x26990d[_0x066c('0x34')]=_[_0x066c('0x35')](_0x26990d['model'],_0x26990d['query']);_0x125b9c[_0x066c('0x36')]=_[_0x066c('0x35')](_0x26990d[_0x066c('0x32')],qs[_0x066c('0x37')](_0x4e046e[_0x066c('0x39')][_0x066c('0x37')]));_0x125b9c[_0x066c('0x36')]=_0x125b9c[_0x066c('0x36')][_0x066c('0x38')]?_0x125b9c[_0x066c('0x36')]:_0x26990d[_0x066c('0x32')];if(_0x4e046e[_0x066c('0x39')][_0x066c('0x42')]){_0x125b9c[_0x066c('0x43')]=[{'all':!![]}];}_0x125b9c=_[_0x066c('0x40')]({},_0x125b9c,_0x4e046e[_0x066c('0x41')]);return db['Trigger']['find'](_0x125b9c)[_0x066c('0x26')](handleEntityNotFound(_0xaf4dc,null))[_0x066c('0x26')](respondWithResult(_0xaf4dc,null))['catch'](handleError(_0xaf4dc,null));};exports[_0x066c('0x49')]=function(_0x2c332c,_0x406639){return db[_0x066c('0x2f')][_0x066c('0x49')](_0x2c332c[_0x066c('0x4a')],{})[_0x066c('0x26')](function(_0xdf347a){var _0x36815b=_0x2c332c[_0x066c('0x4b')]['get']({'plain':!![]});if(!_0x36815b)throw new Error(_0x066c('0x4c'));if(_0x36815b[_0x066c('0x4d')]===_0x066c('0x4b')){var _0x515f59=_0xdf347a[_0x066c('0x27')]({'plain':!![]});var _0xf57868=_0x066c('0x4e');return db['UserProfileSection'][_0x066c('0x4f')]({'where':{'name':_0xf57868,'userProfileId':_0x36815b[_0x066c('0x50')]},'raw':!![]})[_0x066c('0x26')](function(_0x544b76){if(_0x544b76&&_0x544b76['autoAssociation']===0x0){return db[_0x066c('0x51')][_0x066c('0x49')]({'name':_0x515f59[_0x066c('0x2b')],'resourceId':_0x515f59['id'],'type':_0x544b76[_0x066c('0x2b')],'sectionId':_0x544b76['id']},{})[_0x066c('0x26')](function(){return _0xdf347a;});}else{return _0xdf347a;}})[_0x066c('0x52')](function(_0x5eb29b){logger[_0x066c('0x29')](_0x066c('0x53'),_0x5eb29b);throw _0x5eb29b;});}return _0xdf347a;})['then'](respondWithResult(_0x406639,0xc9))[_0x066c('0x52')](handleError(_0x406639,null));};exports[_0x066c('0x54')]=function(_0x14278e,_0x2eb8a8){if(_0x14278e['body']['id']){delete _0x14278e[_0x066c('0x4a')]['id'];}return db[_0x066c('0x2f')]['find']({'where':{'id':_0x14278e[_0x066c('0x47')]['id']}})[_0x066c('0x26')](handleEntityNotFound(_0x2eb8a8,null))[_0x066c('0x26')](saveUpdates(_0x14278e[_0x066c('0x4a')],null))[_0x066c('0x26')](respondWithResult(_0x2eb8a8,null))[_0x066c('0x52')](handleError(_0x2eb8a8,null));};exports[_0x066c('0x28')]=function(_0x383280,_0x2ca8a3){return db['Trigger'][_0x066c('0x4f')]({'where':{'id':_0x383280[_0x066c('0x47')]['id']}})[_0x066c('0x26')](handleEntityNotFound(_0x2ca8a3,null))[_0x066c('0x26')](removeEntity(_0x2ca8a3,null))[_0x066c('0x52')](handleError(_0x2ca8a3,null));};exports[_0x066c('0x55')]=function(_0x374563,_0x546f6b,_0x49af18){if(_0x374563[_0x066c('0x4a')]['id']){delete _0x374563[_0x066c('0x4a')]['id'];}return db[_0x066c('0x2f')][_0x066c('0x4f')]({'where':{'id':_0x374563[_0x066c('0x47')]['id']}})['then'](handleEntityNotFound(_0x546f6b,null))['then'](function(_0x24b966){if(_0x24b966){_0x374563['body'][_0x066c('0x56')]=_0x24b966['id'];return db[_0x066c('0x57')][_0x066c('0x49')](_0x374563[_0x066c('0x4a')]);}})[_0x066c('0x26')](respondWithResult(_0x546f6b,null))['catch'](handleError(_0x546f6b,null));};exports[_0x066c('0x58')]=function(_0x377033,_0x342e25,_0x318851){if(_0x377033['body']['id']){delete _0x377033[_0x066c('0x4a')]['id'];}return db[_0x066c('0x2f')][_0x066c('0x4f')]({'where':{'id':_0x377033[_0x066c('0x47')]['id']}})[_0x066c('0x26')](handleEntityNotFound(_0x342e25,null))['then'](function(_0x3f4792){if(_0x3f4792){_0x377033['body'][_0x066c('0x59')]=_0x3f4792['id'];return db[_0x066c('0x57')][_0x066c('0x49')](_0x377033[_0x066c('0x4a')]);}})[_0x066c('0x26')](respondWithResult(_0x342e25,null))[_0x066c('0x52')](handleError(_0x342e25,null));};exports[_0x066c('0x5a')]=function(_0x17afef,_0x25c80c,_0x1524d3){var _0x24c8e9={};var _0x928a67={};var _0x4e523c;var _0x10d94a;return db[_0x066c('0x2f')][_0x066c('0x5b')]({'where':{'id':_0x17afef['params']['id']}})['then'](handleEntityNotFound(_0x25c80c,null))[_0x066c('0x26')](function(_0x37cffa){if(_0x37cffa){_0x4e523c=_0x37cffa;_0x928a67[_0x066c('0x32')]=_[_0x066c('0x33')](db['Condition'][_0x066c('0x48')]);_0x928a67['query']=_[_0x066c('0x33')](_0x17afef[_0x066c('0x39')]);_0x928a67[_0x066c('0x34')]=_[_0x066c('0x35')](_0x928a67[_0x066c('0x32')],_0x928a67[_0x066c('0x39')]);_0x24c8e9[_0x066c('0x36')]=_[_0x066c('0x35')](_0x928a67[_0x066c('0x32')],qs[_0x066c('0x37')](_0x17afef[_0x066c('0x39')]['fields']));_0x24c8e9[_0x066c('0x36')]=_0x24c8e9['attributes'][_0x066c('0x38')]?_0x24c8e9[_0x066c('0x36')]:_0x928a67[_0x066c('0x32')];_0x24c8e9[_0x066c('0x5c')]=qs[_0x066c('0x3b')](_0x17afef['query'][_0x066c('0x3b')]);_0x24c8e9[_0x066c('0x3c')]=qs[_0x066c('0x34')](_['pick'](_0x17afef['query'],_0x928a67[_0x066c('0x34')]));if(_0x17afef[_0x066c('0x39')][_0x066c('0x3f')]){_0x24c8e9['where']=_[_0x066c('0x40')](_0x24c8e9[_0x066c('0x3c')],{'$or':_[_0x066c('0x2e')](_0x24c8e9[_0x066c('0x36')],function(_0x1bd8b2){var _0xdb8a05={};_0xdb8a05[_0x1bd8b2]={'$like':'%'+_0x17afef[_0x066c('0x39')]['filter']+'%'};return _0xdb8a05;})});}_0x24c8e9=_['merge']({},_0x24c8e9,_0x17afef[_0x066c('0x41')]);return _0x4e523c[_0x066c('0x5a')](_0x24c8e9);}})[_0x066c('0x26')](function(_0x3e1929){if(_0x3e1929){_0x10d94a=_0x3e1929[_0x066c('0x38')];if(!_0x17afef['query'][_0x066c('0x3a')](_0x066c('0x5d'))){_0x24c8e9[_0x066c('0x1e')]=qs[_0x066c('0x1e')](_0x17afef[_0x066c('0x39')][_0x066c('0x1e')]);_0x24c8e9[_0x066c('0x1c')]=qs['offset'](_0x17afef[_0x066c('0x39')][_0x066c('0x1c')]);}return _0x4e523c[_0x066c('0x5a')](_0x24c8e9);}})[_0x066c('0x26')](function(_0x2ed64b){if(_0x2ed64b){return _0x2ed64b?{'count':_0x10d94a,'rows':_0x2ed64b}:null;}})['then'](respondWithResult(_0x25c80c,null))[_0x066c('0x52')](handleError(_0x25c80c,null));};exports[_0x066c('0x5e')]=function(_0x382df8,_0x1a6fdc,_0x47b244){var _0x2402e2={};var _0x1ff4ab={};var _0x119f54;var _0xe5bf00;return db[_0x066c('0x2f')]['findOne']({'where':{'id':_0x382df8['params']['id']}})[_0x066c('0x26')](handleEntityNotFound(_0x1a6fdc,null))[_0x066c('0x26')](function(_0x6d8e66){if(_0x6d8e66){_0x119f54=_0x6d8e66;_0x1ff4ab[_0x066c('0x32')]=_['keys'](db[_0x066c('0x57')][_0x066c('0x48')]);_0x1ff4ab[_0x066c('0x39')]=_[_0x066c('0x33')](_0x382df8[_0x066c('0x39')]);_0x1ff4ab['filters']=_[_0x066c('0x35')](_0x1ff4ab[_0x066c('0x32')],_0x1ff4ab['query']);_0x2402e2[_0x066c('0x36')]=_[_0x066c('0x35')](_0x1ff4ab[_0x066c('0x32')],qs['fields'](_0x382df8[_0x066c('0x39')][_0x066c('0x37')]));_0x2402e2[_0x066c('0x36')]=_0x2402e2[_0x066c('0x36')][_0x066c('0x38')]?_0x2402e2[_0x066c('0x36')]:_0x1ff4ab[_0x066c('0x32')];_0x2402e2['order']=qs['sort'](_0x382df8[_0x066c('0x39')]['sort']);_0x2402e2[_0x066c('0x3c')]=qs['filters'](_[_0x066c('0x3d')](_0x382df8[_0x066c('0x39')],_0x1ff4ab[_0x066c('0x34')]));if(_0x382df8[_0x066c('0x39')][_0x066c('0x3f')]){_0x2402e2['where']=_[_0x066c('0x40')](_0x2402e2[_0x066c('0x3c')],{'$or':_[_0x066c('0x2e')](_0x2402e2['attributes'],function(_0x1a96ef){var _0x58a6ec={};_0x58a6ec[_0x1a96ef]={'$like':'%'+_0x382df8[_0x066c('0x39')][_0x066c('0x3f')]+'%'};return _0x58a6ec;})});}_0x2402e2=_['merge']({},_0x2402e2,_0x382df8['options']);return _0x119f54[_0x066c('0x5e')](_0x2402e2);}})[_0x066c('0x26')](function(_0x525453){if(_0x525453){_0xe5bf00=_0x525453[_0x066c('0x38')];if(!_0x382df8['query'][_0x066c('0x3a')]('nolimit')){_0x2402e2[_0x066c('0x1e')]=qs[_0x066c('0x1e')](_0x382df8[_0x066c('0x39')][_0x066c('0x1e')]);_0x2402e2['offset']=qs[_0x066c('0x1c')](_0x382df8[_0x066c('0x39')][_0x066c('0x1c')]);}return _0x119f54['getAnyConditions'](_0x2402e2);}})[_0x066c('0x26')](function(_0x29c827){if(_0x29c827){return _0x29c827?{'count':_0xe5bf00,'rows':_0x29c827}:null;}})['then'](respondWithResult(_0x1a6fdc,null))[_0x066c('0x52')](handleError(_0x1a6fdc,null));};exports['addAction']=function(_0x213666,_0x260287,_0x1b5cd7){if(_0x213666[_0x066c('0x4a')]['id']){delete _0x213666[_0x066c('0x4a')]['id'];}return db[_0x066c('0x2f')][_0x066c('0x4f')]({'where':{'id':_0x213666[_0x066c('0x47')]['id']}})[_0x066c('0x26')](handleEntityNotFound(_0x260287,null))[_0x066c('0x26')](function(_0x1cd7a6){if(_0x1cd7a6){_0x213666[_0x066c('0x4a')]['TriggerId']=_0x1cd7a6['id'];return db['Action'][_0x066c('0x49')](_0x213666[_0x066c('0x4a')]);}})['then'](respondWithResult(_0x260287,null))[_0x066c('0x52')](handleError(_0x260287,null));};exports['getActions']=function(_0x2724dc,_0x413a58,_0x1d8bc6){var _0x4ee314={};var _0x376ae0={};var _0x2780e0;var _0x15a2e9;return db[_0x066c('0x2f')][_0x066c('0x5b')]({'where':{'id':_0x2724dc[_0x066c('0x47')]['id']}})['then'](handleEntityNotFound(_0x413a58,null))[_0x066c('0x26')](function(_0x447a0f){if(_0x447a0f){_0x2780e0=_0x447a0f;_0x376ae0[_0x066c('0x32')]=_['keys'](db[_0x066c('0x5f')][_0x066c('0x48')]);_0x376ae0[_0x066c('0x39')]=_[_0x066c('0x33')](_0x2724dc[_0x066c('0x39')]);_0x376ae0['filters']=_[_0x066c('0x35')](_0x376ae0[_0x066c('0x32')],_0x376ae0[_0x066c('0x39')]);_0x4ee314[_0x066c('0x36')]=_[_0x066c('0x35')](_0x376ae0[_0x066c('0x32')],qs[_0x066c('0x37')](_0x2724dc['query'][_0x066c('0x37')]));_0x4ee314[_0x066c('0x36')]=_0x4ee314[_0x066c('0x36')][_0x066c('0x38')]?_0x4ee314[_0x066c('0x36')]:_0x376ae0['model'];_0x4ee314[_0x066c('0x5c')]=qs[_0x066c('0x3b')](_0x2724dc[_0x066c('0x39')]['sort']);_0x4ee314['where']=qs[_0x066c('0x34')](_[_0x066c('0x3d')](_0x2724dc['query'],_0x376ae0[_0x066c('0x34')]));if(_0x2724dc['query'][_0x066c('0x3f')]){_0x4ee314[_0x066c('0x3c')]=_[_0x066c('0x40')](_0x4ee314['where'],{'$or':_[_0x066c('0x2e')](_0x4ee314[_0x066c('0x36')],function(_0x5853ab){var _0x2cf660={};_0x2cf660[_0x5853ab]={'$like':'%'+_0x2724dc['query']['filter']+'%'};return _0x2cf660;})});}_0x4ee314=_[_0x066c('0x40')]({},_0x4ee314,_0x2724dc[_0x066c('0x41')]);return _0x2780e0['getActions'](_0x4ee314);}})[_0x066c('0x26')](function(_0x5bc41b){if(_0x5bc41b){_0x15a2e9=_0x5bc41b[_0x066c('0x38')];if(!_0x2724dc[_0x066c('0x39')][_0x066c('0x3a')](_0x066c('0x5d'))){_0x4ee314[_0x066c('0x1e')]=qs['limit'](_0x2724dc['query'][_0x066c('0x1e')]);_0x4ee314[_0x066c('0x1c')]=qs[_0x066c('0x1c')](_0x2724dc['query'][_0x066c('0x1c')]);}return _0x2780e0[_0x066c('0x60')](_0x4ee314);}})[_0x066c('0x26')](function(_0x254c38){if(_0x254c38){return _0x254c38?{'count':_0x15a2e9,'rows':_0x254c38}:null;}})['then'](respondWithResult(_0x413a58,null))[_0x066c('0x52')](handleError(_0x413a58,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index eafa0a1..fd1d6df 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 _0x9ff4=['rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','api','moment','bluebird','request-promise'];(function(_0x213d5b,_0x35ed46){var _0x1f2410=function(_0x1985d0){while(--_0x1985d0){_0x213d5b['push'](_0x213d5b['shift']());}};_0x1f2410(++_0x35ed46);}(_0x9ff4,0x196));var _0x49ff=function(_0xa2604f,_0x25b542){_0xa2604f=_0xa2604f-0x0;var _0x539399=_0x9ff4[_0xa2604f];return _0x539399;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x49ff('0x0'));var moment=require(_0x49ff('0x1'));var BPromise=require(_0x49ff('0x2'));var rp=require(_0x49ff('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x49ff('0x4'));var config=require(_0x49ff('0x5'));var attributes=require(_0x49ff('0x6'));module[_0x49ff('0x7')]=function(_0x153755,_0x22febd){return _0x153755[_0x49ff('0x8')](_0x49ff('0x9'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf987=['bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','../../config/logger','api'];(function(_0xe0564e,_0x37cf17){var _0x36ffe3=function(_0x1e5677){while(--_0x1e5677){_0xe0564e['push'](_0xe0564e['shift']());}};_0x36ffe3(++_0x37cf17);}(_0xf987,0x18a));var _0x7f98=function(_0x3f33a3,_0x430b3c){_0x3f33a3=_0x3f33a3-0x0;var _0x59e530=_0xf987[_0x3f33a3];return _0x59e530;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7f98('0x0'))(_0x7f98('0x1'));var moment=require('moment');var BPromise=require(_0x7f98('0x2'));var rp=require(_0x7f98('0x3'));var fs=require('fs');var path=require(_0x7f98('0x4'));var rimraf=require(_0x7f98('0x5'));var config=require(_0x7f98('0x6'));var attributes=require(_0x7f98('0x7'));module[_0x7f98('0x8')]=function(_0x3b5abb,_0x3fb8e2){return _0x3b5abb[_0x7f98('0x9')](_0x7f98('0xa'),attributes,{'tableName':_0x7f98('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 53a99b6..6e27934 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 _0x2489=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','Trigger,\x20%s,\x20%s','message','info','catch','GetTrigger','Trigger','findAll','options','raw','limit','map','model','attributes','include','ShowTrigger','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x50528e,_0x5ae7de){var _0xb53771=function(_0x171db7){while(--_0x171db7){_0x50528e['push'](_0x50528e['shift']());}};_0xb53771(++_0x5ae7de);}(_0x2489,0x1b5));var _0x9248=function(_0x2df295,_0x2a387d){_0x2df295=_0x2df295-0x0;var _0x2fce86=_0x2489[_0x2df295];return _0x2fce86;};'use strict';var _=require(_0x9248('0x0'));var util=require(_0x9248('0x1'));var moment=require(_0x9248('0x2'));var BPromise=require(_0x9248('0x3'));var rs=require(_0x9248('0x4'));var fs=require('fs');var Redis=require(_0x9248('0x5'));var db=require(_0x9248('0x6'))['db'];var utils=require(_0x9248('0x7'));var logger=require(_0x9248('0x8'))(_0x9248('0x9'));var config=require('../../config/environment');var jayson=require(_0x9248('0xa'));var client=jayson[_0x9248('0xb')][_0x9248('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2cbaf3,_0x19ee69,_0x378b7e){return new BPromise(function(_0x44714f,_0x113879){return client[_0x9248('0xd')](_0x2cbaf3,_0x378b7e)[_0x9248('0xe')](function(_0x14ba6b){logger['info']('Trigger,\x20%s,\x20%s',_0x19ee69,_0x9248('0xf'));logger[_0x9248('0x10')](_0x9248('0x11'),_0x19ee69,_0x9248('0xf'),JSON[_0x9248('0x12')](_0x14ba6b));if(_0x14ba6b[_0x9248('0x13')]){if(_0x14ba6b['error'][_0x9248('0x14')]===0x1f4){logger[_0x9248('0x13')](_0x9248('0x15'),_0x19ee69,_0x14ba6b[_0x9248('0x13')][_0x9248('0x16')]);return _0x113879(_0x14ba6b[_0x9248('0x13')][_0x9248('0x16')]);}logger[_0x9248('0x13')]('Trigger,\x20%s,\x20%s',_0x19ee69,_0x14ba6b[_0x9248('0x13')][_0x9248('0x16')]);return _0x44714f(_0x14ba6b[_0x9248('0x13')][_0x9248('0x16')]);}else{logger[_0x9248('0x17')](_0x9248('0x15'),_0x19ee69,'request\x20sent');_0x44714f(_0x14ba6b['result']['message']);}})[_0x9248('0x18')](function(_0x4cb987){logger[_0x9248('0x13')](_0x9248('0x15'),_0x19ee69,_0x4cb987);_0x113879(_0x4cb987);});});}exports[_0x9248('0x19')]=function(_0x5c546b){var _0xcc148d=this;return new Promise(function(_0x40b828,_0x21bfa6){return db[_0x9248('0x1a')][_0x9248('0x1b')]({'raw':_0x5c546b[_0x9248('0x1c')]?_0x5c546b[_0x9248('0x1c')][_0x9248('0x1d')]===undefined?!![]:![]:!![],'where':_0x5c546b[_0x9248('0x1c')]?_0x5c546b['options']['where']||null:null,'attributes':_0x5c546b['options']?_0x5c546b['options']['attributes']||null:null,'limit':_0x5c546b[_0x9248('0x1c')]?_0x5c546b['options'][_0x9248('0x1e')]||null:null,'include':_0x5c546b[_0x9248('0x1c')]?_0x5c546b[_0x9248('0x1c')]['include']?_[_0x9248('0x1f')](_0x5c546b['options']['include'],function(_0x38bd43){return{'model':db[_0x38bd43[_0x9248('0x20')]],'as':_0x38bd43['as'],'attributes':_0x38bd43[_0x9248('0x21')],'include':_0x38bd43[_0x9248('0x22')]?_[_0x9248('0x1f')](_0x38bd43['include'],function(_0x243218){return{'model':db[_0x243218[_0x9248('0x20')]],'as':_0x243218['as'],'attributes':_0x243218['attributes'],'include':_0x243218[_0x9248('0x22')]?_[_0x9248('0x1f')](_0x243218[_0x9248('0x22')],function(_0x1cbe74){return{'model':db[_0x1cbe74['model']],'as':_0x1cbe74['as'],'attributes':_0x1cbe74['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x43fc57){logger[_0x9248('0x17')](_0x9248('0x19'),_0x5c546b);logger[_0x9248('0x10')](_0x9248('0x19'),_0x5c546b,JSON[_0x9248('0x12')](_0x43fc57));_0x40b828(_0x43fc57);})[_0x9248('0x18')](function(_0x554e88){logger[_0x9248('0x13')](_0x9248('0x19'),_0x554e88[_0x9248('0x16')],_0x5c546b);_0x21bfa6(_0xcc148d[_0x9248('0x13')](0x1f4,_0x554e88['message']));});});};exports[_0x9248('0x23')]=function(_0x57cc26){var _0x46af1d=this;return new Promise(function(_0x12e595,_0x213420){return db['Trigger'][_0x9248('0x24')]({'raw':_0x57cc26[_0x9248('0x1c')]?_0x57cc26['options'][_0x9248('0x1d')]===undefined?!![]:![]:!![],'where':_0x57cc26['options']?_0x57cc26[_0x9248('0x1c')]['where']||null:null,'attributes':_0x57cc26['options']?_0x57cc26['options'][_0x9248('0x21')]||null:null,'include':_0x57cc26[_0x9248('0x1c')]?_0x57cc26[_0x9248('0x1c')][_0x9248('0x22')]?_[_0x9248('0x1f')](_0x57cc26['options'][_0x9248('0x22')],function(_0x4f8632){return{'model':db[_0x4f8632[_0x9248('0x20')]],'as':_0x4f8632['as'],'attributes':_0x4f8632[_0x9248('0x21')],'include':_0x4f8632[_0x9248('0x22')]?_[_0x9248('0x1f')](_0x4f8632['include'],function(_0x3ca8a1){return{'model':db[_0x3ca8a1['model']],'as':_0x3ca8a1['as'],'attributes':_0x3ca8a1[_0x9248('0x21')],'include':_0x3ca8a1[_0x9248('0x22')]?_[_0x9248('0x1f')](_0x3ca8a1[_0x9248('0x22')],function(_0x144042){return{'model':db[_0x144042[_0x9248('0x20')]],'as':_0x144042['as'],'attributes':_0x144042[_0x9248('0x21')]};}):[]};}):[]};}):[]:[]})[_0x9248('0xe')](function(_0x5cc5e4){logger[_0x9248('0x17')](_0x9248('0x23'),_0x57cc26);logger[_0x9248('0x10')](_0x9248('0x23'),_0x57cc26,JSON['stringify'](_0x5cc5e4));_0x12e595(_0x5cc5e4);})[_0x9248('0x18')](function(_0x2e08d6){logger[_0x9248('0x13')]('ShowTrigger',_0x2e08d6[_0x9248('0x16')],_0x57cc26);_0x213420(_0x46af1d[_0x9248('0x13')](0x1f4,_0x2e08d6[_0x9248('0x16')]));});});}; \ No newline at end of file +var _0xde03=['limit','include','map','model','then','debug','ShowTrigger','Trigger','find','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','http','request','info','Trigger,\x20%s,\x20%s','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetTrigger','findAll','raw','options','where','attributes'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0xde03,0x1f3));var _0x3de0=function(_0x569b67,_0x14d427){_0x569b67=_0x569b67-0x0;var _0x33131f=_0xde03[_0x569b67];return _0x33131f;};'use strict';var _=require(_0x3de0('0x0'));var util=require(_0x3de0('0x1'));var moment=require(_0x3de0('0x2'));var BPromise=require(_0x3de0('0x3'));var rs=require(_0x3de0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3de0('0x5'));var logger=require(_0x3de0('0x6'))(_0x3de0('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3de0('0x8')][_0x3de0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3151a8,_0x424009,_0x2c3fc8){return new BPromise(function(_0x1f2851,_0x585b41){return client[_0x3de0('0xa')](_0x3151a8,_0x2c3fc8)['then'](function(_0x5edbaa){logger[_0x3de0('0xb')](_0x3de0('0xc'),_0x424009,_0x3de0('0xd'));logger['debug'](_0x3de0('0xe'),_0x424009,_0x3de0('0xd'),JSON[_0x3de0('0xf')](_0x5edbaa));if(_0x5edbaa[_0x3de0('0x10')]){if(_0x5edbaa[_0x3de0('0x10')][_0x3de0('0x11')]===0x1f4){logger[_0x3de0('0x10')]('Trigger,\x20%s,\x20%s',_0x424009,_0x5edbaa[_0x3de0('0x10')][_0x3de0('0x12')]);return _0x585b41(_0x5edbaa[_0x3de0('0x10')][_0x3de0('0x12')]);}logger[_0x3de0('0x10')](_0x3de0('0xc'),_0x424009,_0x5edbaa['error'][_0x3de0('0x12')]);return _0x1f2851(_0x5edbaa[_0x3de0('0x10')][_0x3de0('0x12')]);}else{logger[_0x3de0('0xb')](_0x3de0('0xc'),_0x424009,'request\x20sent');_0x1f2851(_0x5edbaa['result'][_0x3de0('0x12')]);}})[_0x3de0('0x13')](function(_0x4c6f13){logger[_0x3de0('0x10')](_0x3de0('0xc'),_0x424009,_0x4c6f13);_0x585b41(_0x4c6f13);});});}exports[_0x3de0('0x14')]=function(_0x489b0b){var _0x48e05a=this;return new Promise(function(_0x33fe7d,_0x76952c){return db['Trigger'][_0x3de0('0x15')]({'raw':_0x489b0b['options']?_0x489b0b['options'][_0x3de0('0x16')]===undefined?!![]:![]:!![],'where':_0x489b0b[_0x3de0('0x17')]?_0x489b0b[_0x3de0('0x17')][_0x3de0('0x18')]||null:null,'attributes':_0x489b0b[_0x3de0('0x17')]?_0x489b0b[_0x3de0('0x17')][_0x3de0('0x19')]||null:null,'limit':_0x489b0b[_0x3de0('0x17')]?_0x489b0b[_0x3de0('0x17')][_0x3de0('0x1a')]||null:null,'include':_0x489b0b[_0x3de0('0x17')]?_0x489b0b[_0x3de0('0x17')]['include']?_['map'](_0x489b0b[_0x3de0('0x17')][_0x3de0('0x1b')],function(_0x2a034c){return{'model':db[_0x2a034c['model']],'as':_0x2a034c['as'],'attributes':_0x2a034c[_0x3de0('0x19')],'include':_0x2a034c[_0x3de0('0x1b')]?_[_0x3de0('0x1c')](_0x2a034c[_0x3de0('0x1b')],function(_0x32ccb6){return{'model':db[_0x32ccb6[_0x3de0('0x1d')]],'as':_0x32ccb6['as'],'attributes':_0x32ccb6[_0x3de0('0x19')],'include':_0x32ccb6[_0x3de0('0x1b')]?_[_0x3de0('0x1c')](_0x32ccb6[_0x3de0('0x1b')],function(_0x16e614){return{'model':db[_0x16e614['model']],'as':_0x16e614['as'],'attributes':_0x16e614[_0x3de0('0x19')]};}):[]};}):[]};}):[]:[]})[_0x3de0('0x1e')](function(_0x29da7e){logger[_0x3de0('0xb')](_0x3de0('0x14'),_0x489b0b);logger[_0x3de0('0x1f')](_0x3de0('0x14'),_0x489b0b,JSON[_0x3de0('0xf')](_0x29da7e));_0x33fe7d(_0x29da7e);})[_0x3de0('0x13')](function(_0x1f1861){logger[_0x3de0('0x10')](_0x3de0('0x14'),_0x1f1861[_0x3de0('0x12')],_0x489b0b);_0x76952c(_0x48e05a['error'](0x1f4,_0x1f1861[_0x3de0('0x12')]));});});};exports[_0x3de0('0x20')]=function(_0x14866f){var _0x4d7371=this;return new Promise(function(_0x81152f,_0x43b7da){return db[_0x3de0('0x21')][_0x3de0('0x22')]({'raw':_0x14866f[_0x3de0('0x17')]?_0x14866f[_0x3de0('0x17')][_0x3de0('0x16')]===undefined?!![]:![]:!![],'where':_0x14866f['options']?_0x14866f['options'][_0x3de0('0x18')]||null:null,'attributes':_0x14866f[_0x3de0('0x17')]?_0x14866f[_0x3de0('0x17')][_0x3de0('0x19')]||null:null,'include':_0x14866f[_0x3de0('0x17')]?_0x14866f[_0x3de0('0x17')][_0x3de0('0x1b')]?_[_0x3de0('0x1c')](_0x14866f[_0x3de0('0x17')][_0x3de0('0x1b')],function(_0x2723d9){return{'model':db[_0x2723d9[_0x3de0('0x1d')]],'as':_0x2723d9['as'],'attributes':_0x2723d9[_0x3de0('0x19')],'include':_0x2723d9[_0x3de0('0x1b')]?_[_0x3de0('0x1c')](_0x2723d9[_0x3de0('0x1b')],function(_0x1e70e6){return{'model':db[_0x1e70e6[_0x3de0('0x1d')]],'as':_0x1e70e6['as'],'attributes':_0x1e70e6[_0x3de0('0x19')],'include':_0x1e70e6[_0x3de0('0x1b')]?_[_0x3de0('0x1c')](_0x1e70e6[_0x3de0('0x1b')],function(_0x13493a){return{'model':db[_0x13493a[_0x3de0('0x1d')]],'as':_0x13493a['as'],'attributes':_0x13493a[_0x3de0('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x14d55c){logger[_0x3de0('0xb')](_0x3de0('0x20'),_0x14866f);logger[_0x3de0('0x1f')](_0x3de0('0x20'),_0x14866f,JSON[_0x3de0('0xf')](_0x14d55c));_0x81152f(_0x14d55c);})[_0x3de0('0x13')](function(_0x23f62d){logger[_0x3de0('0x10')](_0x3de0('0x20'),_0x23f62d['message'],_0x14866f);_0x43b7da(_0x4d7371[_0x3de0('0x10')](0x1f4,_0x23f62d['message']));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index e931c06..d68e8dd 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 _0xc579=['../../components/interaction/service','../../config/environment','./trunk.controller','get','index','isAuthenticated','show','post','/:id/clone','clone','create','put','/:id','delete','destroy','exports','connect-timeout','express','Router','fs-extra'];(function(_0x3c9de4,_0x3e25a0){var _0x1e6a17=function(_0x1712f5){while(--_0x1712f5){_0x3c9de4['push'](_0x3c9de4['shift']());}};_0x1e6a17(++_0x3e25a0);}(_0xc579,0xc4));var _0x9c57=function(_0xa9523b,_0x1737d2){_0xa9523b=_0xa9523b-0x0;var _0x27a6de=_0xc579[_0xa9523b];return _0x27a6de;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x9c57('0x0'));var express=require(_0x9c57('0x1'));var router=express[_0x9c57('0x2')]();var fs_extra=require(_0x9c57('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9c57('0x4'));var config=require(_0x9c57('0x5'));var controller=require(_0x9c57('0x6'));router[_0x9c57('0x7')]('/',auth['isAuthenticated'](),controller[_0x9c57('0x8')]);router[_0x9c57('0x7')]('/:id',auth[_0x9c57('0x9')](),controller[_0x9c57('0xa')]);router[_0x9c57('0xb')](_0x9c57('0xc'),auth[_0x9c57('0x9')](),controller[_0x9c57('0xd')]);router[_0x9c57('0xb')]('/',auth[_0x9c57('0x9')](),controller[_0x9c57('0xe')]);router[_0x9c57('0xf')](_0x9c57('0x10'),auth['isAuthenticated'](),controller['update']);router[_0x9c57('0x11')](_0x9c57('0x10'),auth['isAuthenticated'](),controller[_0x9c57('0x12')]);module[_0x9c57('0x13')]=router; \ No newline at end of file +var _0x20dd=['../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','/:id/clone','post','put','delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service'];(function(_0xef58d7,_0x3df485){var _0x11d7eb=function(_0x1705d9){while(--_0x1705d9){_0xef58d7['push'](_0xef58d7['shift']());}};_0x11d7eb(++_0x3df485);}(_0x20dd,0xd3));var _0xd20d=function(_0x147df6,_0x2ba7cf){_0x147df6=_0x147df6-0x0;var _0x17ec6a=_0x20dd[_0x147df6];return _0x17ec6a;};'use strict';var multer=require(_0xd20d('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd20d('0x1'));var router=express[_0xd20d('0x2')]();var fs_extra=require(_0xd20d('0x3'));var auth=require(_0xd20d('0x4'));var interaction=require(_0xd20d('0x5'));var config=require(_0xd20d('0x6'));var controller=require(_0xd20d('0x7'));router[_0xd20d('0x8')]('/',auth[_0xd20d('0x9')](),controller[_0xd20d('0xa')]);router[_0xd20d('0x8')](_0xd20d('0xb'),auth[_0xd20d('0x9')](),controller['show']);router['post'](_0xd20d('0xc'),auth[_0xd20d('0x9')](),controller['clone']);router[_0xd20d('0xd')]('/',auth[_0xd20d('0x9')](),controller['create']);router[_0xd20d('0xe')]('/:id',auth[_0xd20d('0x9')](),controller['update']);router[_0xd20d('0xf')](_0xd20d('0xb'),auth[_0xd20d('0x9')](),controller[_0xd20d('0x10')]);module[_0xd20d('0x11')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 2c08b3a..01a13cf 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 _0x9c3a=['setDataValue','join','nat','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','refuse','originate','uas','fingerprint','certificate','active','dynamic','update,nonat','BOOLEAN','sequelize','exports','STRING','name','friend','user','peer','from-voip-provider','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','udp','transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','auto','nonat','update','outgoing','yes','force_rport,comedia'];(function(_0x48b122,_0x2e66d2){var _0x5f573a=function(_0x3b0901){while(--_0x3b0901){_0x48b122['push'](_0x48b122['shift']());}};_0x5f573a(++_0x2e66d2);}(_0x9c3a,0x128));var _0xa9c3=function(_0xf1c24c,_0xa89722){_0xf1c24c=_0xf1c24c-0x0;var _0x128db5=_0x9c3a[_0xf1c24c];return _0x128db5;};'use strict';var Sequelize=require(_0xa9c3('0x0'));module[_0xa9c3('0x1')]={'name':{'type':Sequelize[_0xa9c3('0x2')],'allowNull':![],'unique':_0xa9c3('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xa9c3('0x4'),_0xa9c3('0x5'),_0xa9c3('0x6')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xa9c3('0x2')],'allowNull':![],'defaultValue':_0xa9c3('0x7')},'callingpres':{'type':Sequelize[_0xa9c3('0x8')](_0xa9c3('0x9'),_0xa9c3('0xa'),'ALLOWED_FAILED_SCREEN',_0xa9c3('0xb'),'PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB')},'deny':{'type':Sequelize[_0xa9c3('0x2')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0xa9c3('0x2')]},'md5secret':{'type':Sequelize[_0xa9c3('0x2')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0xa9c3('0x2')],'defaultValue':_0xa9c3('0xc'),'set':function(_0xe04ac4){this['setDataValue'](_0xa9c3('0xd'),_0xe04ac4?_0xe04ac4['join'](','):null);},'get':function(){return this['getDataValue'](_0xa9c3('0xd'))?this[_0xa9c3('0xe')]('transport')[_0xa9c3('0xf')](','):null;},'comment':_0xa9c3('0x10')},'dtmfmode':{'type':Sequelize[_0xa9c3('0x8')](_0xa9c3('0x11'),'info',_0xa9c3('0x12'),_0xa9c3('0x13'),_0xa9c3('0x14')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xa9c3('0x8')]('yes','no',_0xa9c3('0x15'),_0xa9c3('0x16'),_0xa9c3('0x17')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xa9c3('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0xa9c3('0x2')]},'nat':{'type':Sequelize[_0xa9c3('0x2')],'defaultValue':_0xa9c3('0x19'),'set':function(_0x30e12a){this[_0xa9c3('0x1a')]('nat',_0x30e12a?_0x30e12a[_0xa9c3('0x1b')](','):null);},'get':function(){return this['getDataValue'](_0xa9c3('0x1c'))?this[_0xa9c3('0xe')](_0xa9c3('0x1c'))[_0xa9c3('0xf')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xa9c3('0x2')]},'namedcallgroup':{'type':Sequelize[_0xa9c3('0x2')]},'pickupgroup':{'type':Sequelize[_0xa9c3('0x2')]},'namedpickupgroup':{'type':Sequelize[_0xa9c3('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':'all'},'allow':{'type':Sequelize[_0xa9c3('0x2')],'allowNull':![],'defaultValue':_0xa9c3('0x1d'),'set':function(_0x2ac69d){this[_0xa9c3('0x1a')](_0xa9c3('0x1e'),_0x2ac69d?_0x2ac69d[_0xa9c3('0x1b')](';'):_0xa9c3('0x1d'));},'get':function(){return this[_0xa9c3('0xe')](_0xa9c3('0x1e'))?this[_0xa9c3('0xe')]('allow')['split'](';'):null;},'comment':_0xa9c3('0x1f')},'autoframing':{'type':Sequelize[_0xa9c3('0x8')](_0xa9c3('0x18'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0xa9c3('0x20'),'set':function(_0x10dbfe){this[_0xa9c3('0x1a')](_0xa9c3('0x21'),_0x10dbfe?_0x10dbfe[_0xa9c3('0x1b')](','):null);},'get':function(){return this[_0xa9c3('0xe')](_0xa9c3('0x21'))?this['getDataValue'](_0xa9c3('0x21'))[_0xa9c3('0xf')](','):null;},'comment':_0xa9c3('0x22')},'trustrpid':{'type':Sequelize[_0xa9c3('0x8')](_0xa9c3('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xa9c3('0x8')](_0xa9c3('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xa9c3('0x8')](_0xa9c3('0x18'),'no',_0xa9c3('0x23'))},'promiscredir':{'type':Sequelize['ENUM'](_0xa9c3('0x18'),'no')},'useclientcode':{'type':Sequelize[_0xa9c3('0x8')](_0xa9c3('0x18'),'no')},'accountcode':{'type':Sequelize[_0xa9c3('0x24')](0xb)},'setvar':{'type':Sequelize[_0xa9c3('0x2')]},'callerid':{'type':Sequelize[_0xa9c3('0x2')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0xa9c3('0x8')]('yes','no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xa9c3('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0xa9c3('0x8')](_0xa9c3('0x18'),'no')},'allowsubscribe':{'type':Sequelize[_0xa9c3('0x8')](_0xa9c3('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0xa9c3('0x8')](_0xa9c3('0x18'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xa9c3('0x18'),'no')},'subscribecontext':{'type':Sequelize[_0xa9c3('0x2')]},'template':{'type':Sequelize[_0xa9c3('0x2')]},'videosupport':{'type':Sequelize['ENUM'](_0xa9c3('0x18'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xa9c3('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xa9c3('0x18'),'no')},'mailbox':{'type':Sequelize[_0xa9c3('0x2')]},'session_timers':{'type':Sequelize[_0xa9c3('0x8')]('accept',_0xa9c3('0x25'),_0xa9c3('0x26'))},'session_expires':{'type':Sequelize[_0xa9c3('0x24')](0xb)},'session_minse':{'type':Sequelize[_0xa9c3('0x24')](0xb)},'session_refresher':{'type':Sequelize[_0xa9c3('0x8')]('uac',_0xa9c3('0x27')),'defaultValue':_0xa9c3('0x27')},'t38pt_usertpsource':{'type':Sequelize[_0xa9c3('0x2')]},'regexten':{'type':Sequelize[_0xa9c3('0x2')]},'fromdomain':{'type':Sequelize[_0xa9c3('0x2')]},'fromuser':{'type':Sequelize[_0xa9c3('0x2')]},'port':{'type':Sequelize[_0xa9c3('0x24')](0x5)},'qualify':{'type':Sequelize[_0xa9c3('0x8')](_0xa9c3('0x18'),'no'),'defaultValue':_0xa9c3('0x18')},'keepalive':{'type':Sequelize[_0xa9c3('0x24')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xa9c3('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0xa9c3('0x8')](_0xa9c3('0x18'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xa9c3('0x2')]},'callbackextension':{'type':Sequelize[_0xa9c3('0x2')]},'timert1':{'type':Sequelize[_0xa9c3('0x24')](0xb)},'timerb':{'type':Sequelize[_0xa9c3('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0xa9c3('0x24')](0xb)},'contactpermit':{'type':Sequelize[_0xa9c3('0x2')]},'contactdeny':{'type':Sequelize[_0xa9c3('0x2')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0xa9c3('0x2')]},'use_q850_reason':{'type':Sequelize[_0xa9c3('0x2')]},'maxforwards':{'type':Sequelize[_0xa9c3('0x24')](0xb)},'encryption':{'type':Sequelize[_0xa9c3('0x8')](_0xa9c3('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xa9c3('0x18'),'no')},'force_avp':{'type':Sequelize['ENUM']('yes','no')},'icesupport':{'type':Sequelize['ENUM'](_0xa9c3('0x18'),'no')},'dtlsenable':{'type':Sequelize[_0xa9c3('0x8')](_0xa9c3('0x18'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0xa9c3('0x18'),'no',_0xa9c3('0x28'),_0xa9c3('0x29'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0xa9c3('0x2')]},'dtlscapath':{'type':Sequelize[_0xa9c3('0x2')]},'dtlssetup':{'type':Sequelize['ENUM'](_0xa9c3('0x2a'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0xa9c3('0x8')](_0xa9c3('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0xa9c3('0x2')]},'call_limit':{'type':Sequelize[_0xa9c3('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xa9c3('0x8')](_0xa9c3('0x18'),'no')},'subscribemwi':{'type':Sequelize[_0xa9c3('0x8')]('yes','no')},'vmexten':{'type':Sequelize[_0xa9c3('0x2')]},'mohinterpret':{'type':Sequelize[_0xa9c3('0x2')]},'mohsuggest':{'type':Sequelize[_0xa9c3('0x2')]},'parkinglot':{'type':Sequelize[_0xa9c3('0x2')]},'description':{'type':Sequelize[_0xa9c3('0x2')]},'host':{'type':Sequelize[_0xa9c3('0x2')],'defaultValue':_0xa9c3('0x2b')},'canreinvite':{'type':Sequelize[_0xa9c3('0x8')](_0xa9c3('0x18'),'no',_0xa9c3('0x15'),'update',_0xa9c3('0x2c')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xa9c3('0x2')]},'otherFields':{'type':Sequelize[_0xa9c3('0x2')]},'active':{'type':Sequelize[_0xa9c3('0x2d')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xa9c3('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0x889e=['join','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','ENUM','rfc2833','shortinfo','auto','nonat','outgoing','yes','force_rport,comedia','setDataValue','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','accept','refuse','originate','uac','uas','fingerprint','certificate','active','passive','actpass','dynamic','update','update,nonat','BOOLEAN','sequelize','exports','STRING','name','friend','user','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp'];(function(_0x14b459,_0x3d2605){var _0x456ad1=function(_0xc7ea01){while(--_0xc7ea01){_0x14b459['push'](_0x14b459['shift']());}};_0x456ad1(++_0x3d2605);}(_0x889e,0x19a));var _0xe889=function(_0x266176,_0x24c6e3){_0x266176=_0x266176-0x0;var _0x186e01=_0x889e[_0x266176];return _0x186e01;};'use strict';var Sequelize=require(_0xe889('0x0'));module[_0xe889('0x1')]={'name':{'type':Sequelize[_0xe889('0x2')],'allowNull':![],'unique':_0xe889('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xe889('0x4'),_0xe889('0x5'),'peer'),'allowNull':![],'defaultValue':_0xe889('0x4')},'context':{'type':Sequelize[_0xe889('0x2')],'allowNull':![],'defaultValue':_0xe889('0x6')},'callingpres':{'type':Sequelize['ENUM'](_0xe889('0x7'),'ALLOWED_PASSED_SCREEN',_0xe889('0x8'),'ALLOWED',_0xe889('0x9'),_0xe889('0xa'),_0xe889('0xb'),_0xe889('0xc'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0xe889('0x2')]},'secret':{'type':Sequelize[_0xe889('0x2')]},'md5secret':{'type':Sequelize[_0xe889('0x2')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0xe889('0x2')],'defaultValue':_0xe889('0xd'),'set':function(_0xb81cd3){this['setDataValue']('transport',_0xb81cd3?_0xb81cd3[_0xe889('0xe')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0xe889('0xf')](_0xe889('0x10'))[_0xe889('0x11')](','):null;},'comment':_0xe889('0x12')},'dtmfmode':{'type':Sequelize[_0xe889('0x13')](_0xe889('0x14'),'info',_0xe889('0x15'),'inband',_0xe889('0x16')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM']('yes','no',_0xe889('0x17'),'update',_0xe889('0x18')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xe889('0x19'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xe889('0x2')]},'directmediadeny':{'type':Sequelize[_0xe889('0x2')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0xe889('0x1a'),'set':function(_0x3d9bc5){this[_0xe889('0x1b')](_0xe889('0x1c'),_0x3d9bc5?_0x3d9bc5[_0xe889('0xe')](','):null);},'get':function(){return this[_0xe889('0xf')]('nat')?this['getDataValue'](_0xe889('0x1c'))[_0xe889('0x11')](','):null;},'comment':_0xe889('0x1d')},'callgroup':{'type':Sequelize[_0xe889('0x2')]},'namedcallgroup':{'type':Sequelize[_0xe889('0x2')]},'pickupgroup':{'type':Sequelize[_0xe889('0x2')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xe889('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xe889('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xe889('0x2')],'defaultValue':_0xe889('0x1e')},'allow':{'type':Sequelize[_0xe889('0x2')],'allowNull':![],'defaultValue':_0xe889('0x1f'),'set':function(_0x103206){this[_0xe889('0x1b')](_0xe889('0x20'),_0x103206?_0x103206[_0xe889('0xe')](';'):_0xe889('0x1f'));},'get':function(){return this[_0xe889('0xf')](_0xe889('0x20'))?this[_0xe889('0xf')](_0xe889('0x20'))[_0xe889('0x11')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0xe889('0x13')]('yes','no')},'insecure':{'type':Sequelize[_0xe889('0x2')],'defaultValue':_0xe889('0x21'),'set':function(_0xa4a20d){this['setDataValue'](_0xe889('0x22'),_0xa4a20d?_0xa4a20d[_0xe889('0xe')](','):null);},'get':function(){return this['getDataValue'](_0xe889('0x22'))?this[_0xe889('0xf')](_0xe889('0x22'))[_0xe889('0x11')](','):null;},'comment':_0xe889('0x23')},'trustrpid':{'type':Sequelize[_0xe889('0x13')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xe889('0x13')](_0xe889('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xe889('0x13')]('yes','no',_0xe889('0x24'))},'promiscredir':{'type':Sequelize[_0xe889('0x13')](_0xe889('0x19'),'no')},'useclientcode':{'type':Sequelize['ENUM']('yes','no')},'accountcode':{'type':Sequelize[_0xe889('0x25')](0xb)},'setvar':{'type':Sequelize[_0xe889('0x2')]},'callerid':{'type':Sequelize[_0xe889('0x2')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0xe889('0x13')]('yes','no'),'defaultValue':_0xe889('0x19')},'busylevel':{'type':Sequelize[_0xe889('0x25')](0xb)},'allowoverlap':{'type':Sequelize['ENUM']('yes','no')},'allowsubscribe':{'type':Sequelize[_0xe889('0x13')]('yes','no')},'allowtransfer':{'type':Sequelize['ENUM'](_0xe889('0x19'),'no')},'ignoresdpversion':{'type':Sequelize[_0xe889('0x13')](_0xe889('0x19'),'no')},'subscribecontext':{'type':Sequelize[_0xe889('0x2')]},'template':{'type':Sequelize[_0xe889('0x2')]},'videosupport':{'type':Sequelize[_0xe889('0x13')](_0xe889('0x19'),'no',_0xe889('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xe889('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xe889('0x19'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0xe889('0x13')](_0xe889('0x27'),_0xe889('0x28'),_0xe889('0x29'))},'session_expires':{'type':Sequelize[_0xe889('0x25')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xe889('0x2a'),_0xe889('0x2b')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0xe889('0x2')]},'fromdomain':{'type':Sequelize[_0xe889('0x2')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xe889('0x25')](0x5)},'qualify':{'type':Sequelize[_0xe889('0x13')](_0xe889('0x19'),'no'),'defaultValue':_0xe889('0x19')},'keepalive':{'type':Sequelize[_0xe889('0x25')](0xb)},'defaultip':{'type':Sequelize[_0xe889('0x2')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0xe889('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xe889('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0xe889('0x13')]('yes','no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0xe889('0x2')]},'timert1':{'type':Sequelize[_0xe889('0x25')](0xb)},'timerb':{'type':Sequelize[_0xe889('0x25')](0xb)},'qualifyfreq':{'type':Sequelize[_0xe889('0x25')](0xb)},'contactpermit':{'type':Sequelize[_0xe889('0x2')]},'contactdeny':{'type':Sequelize[_0xe889('0x2')]},'contactacl':{'type':Sequelize[_0xe889('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0xe889('0x2')]},'use_q850_reason':{'type':Sequelize[_0xe889('0x2')]},'maxforwards':{'type':Sequelize[_0xe889('0x25')](0xb)},'encryption':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xe889('0x13')]('yes','no')},'force_avp':{'type':Sequelize[_0xe889('0x13')]('yes','no')},'icesupport':{'type':Sequelize[_0xe889('0x13')](_0xe889('0x19'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0xe889('0x19'),'no')},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0xe889('0x2c'),_0xe889('0x2d'))},'dtlsrekey':{'type':Sequelize[_0xe889('0x25')](0xb)},'dtlscertfile':{'type':Sequelize[_0xe889('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0xe889('0x2')]},'dtlscipher':{'type':Sequelize[_0xe889('0x2')]},'dtlscafile':{'type':Sequelize[_0xe889('0x2')]},'dtlscapath':{'type':Sequelize[_0xe889('0x2')]},'dtlssetup':{'type':Sequelize[_0xe889('0x13')](_0xe889('0x2e'),_0xe889('0x2f'),_0xe889('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xe889('0x2')]},'usereqphone':{'type':Sequelize['ENUM'](_0xe889('0x19'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xe889('0x2')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xe889('0x13')]('yes','no')},'subscribemwi':{'type':Sequelize[_0xe889('0x13')](_0xe889('0x19'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0xe889('0x2')]},'mohsuggest':{'type':Sequelize[_0xe889('0x2')]},'parkinglot':{'type':Sequelize[_0xe889('0x2')]},'description':{'type':Sequelize[_0xe889('0x2')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0xe889('0x31')},'canreinvite':{'type':Sequelize[_0xe889('0x13')]('yes','no',_0xe889('0x17'),_0xe889('0x32'),_0xe889('0x33')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xe889('0x2')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xe889('0x34')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xe889('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 1048c1b..e4115cf 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 _0x8d0e=['omit','updatedAt','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8','readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','then','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','reject','update','destroy','get','Trunks','stack','name','send','map','Trunk','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','keys','rawAttributes','includeAll','find','createdAt','body'];(function(_0x100332,_0x4296e1){var _0x308ffc=function(_0x43791b){while(--_0x43791b){_0x100332['push'](_0x100332['shift']());}};_0x308ffc(++_0x4296e1);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x3062fb,_0x241705){_0x3062fb=_0x3062fb-0x0;var _0x5b30f3=_0x8d0e[_0x3062fb];return _0x5b30f3;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xe8d0('0x1b')][_0xe8d0('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x533b42,_0x2b640d,_0x4cbd26,_0x59b4b7){return new BPromise(function(_0x90a1ea,_0x2aa906){var _0x1aa725=_0x59b4b7||client;return _0x1aa725[_0xe8d0('0x1d')](_0x533b42,_0x4cbd26)[_0xe8d0('0x1e')](function(_0x7151c6){logger['info'](_0xe8d0('0x1f'),_0x2b640d,'request\x20sent');logger[_0xe8d0('0x20')](_0xe8d0('0x21'),_0x2b640d,_0xe8d0('0x22'),JSON['stringify'](_0x7151c6));if(_0x7151c6['error']){if(_0x7151c6['error'][_0xe8d0('0x23')]===0x1f4){logger[_0xe8d0('0x24')](_0xe8d0('0x1f'),_0x2b640d,_0x7151c6[_0xe8d0('0x24')][_0xe8d0('0x25')]);return _0x2aa906(_0x7151c6['error'][_0xe8d0('0x25')]);}logger[_0xe8d0('0x24')]('Trunk,\x20%s,\x20%s',_0x2b640d,_0x7151c6['error']['message']);return _0x90a1ea(_0x7151c6[_0xe8d0('0x24')][_0xe8d0('0x25')]);}else{logger[_0xe8d0('0x26')](_0xe8d0('0x1f'),_0x2b640d,_0xe8d0('0x22'));_0x90a1ea(_0x7151c6[_0xe8d0('0x27')][_0xe8d0('0x25')]);}})[_0xe8d0('0x28')](function(_0x32e39a){logger['error'](_0xe8d0('0x1f'),_0x2b640d,_0x32e39a);_0x2aa906(_0x32e39a);});});}function respondWithStatusCode(_0x9f747,_0x572c25){_0x572c25=_0x572c25||0xcc;return function(_0x106614){if(_0x106614){return _0x9f747[_0xe8d0('0x29')](_0x572c25);}return _0x9f747[_0xe8d0('0x2a')](_0x572c25)[_0xe8d0('0x2b')]();};}function respondWithResult(_0x146783,_0x149dfd){_0x149dfd=_0x149dfd||0xc8;return function(_0x31519b){if(_0x31519b){return _0x146783[_0xe8d0('0x2a')](_0x149dfd)[_0xe8d0('0x2c')](_0x31519b);}};}function respondWithFilteredResult(_0x2dee67,_0x264de4){return function(_0x539548){if(_0x539548){var _0x24982c=typeof _0x264de4[_0xe8d0('0x2d')]===_0xe8d0('0x2e')&&typeof _0x264de4['limit']===_0xe8d0('0x2e');var _0x343b08=_0x539548['count'];var _0x1519e2=_0x24982c?0x0:_0x264de4[_0xe8d0('0x2d')];var _0x11fcf2=_0x24982c?_0x539548[_0xe8d0('0x2f')]:_0x264de4[_0xe8d0('0x2d')]+_0x264de4['limit'];var _0x3cc292;if(_0x11fcf2>=_0x343b08){_0x11fcf2=_0x343b08;_0x3cc292=0xc8;}else{_0x3cc292=0xce;}_0x2dee67['status'](_0x3cc292);return _0x2dee67['set']('Content-Range',_0x1519e2+'-'+_0x11fcf2+'/'+_0x343b08)[_0xe8d0('0x2c')](_0x539548);}return null;};}function patchUpdates(_0x13cd4c){return function(_0x36ccec){try{jsonpatch['apply'](_0x36ccec,_0x13cd4c,!![]);}catch(_0x57e375){return BPromise[_0xe8d0('0x30')](_0x57e375);}return _0x36ccec['save']();};}function saveUpdates(_0x3b5d31,_0x383084){return function(_0x327004){if(_0x327004){return _0x327004[_0xe8d0('0x31')](_0x3b5d31)[_0xe8d0('0x1e')](function(_0x5bbc9e){return _0x5bbc9e;});}return null;};}function removeEntity(_0x1bee61,_0x4db53c){return function(_0x402e90){if(_0x402e90){return _0x402e90[_0xe8d0('0x32')]()['then'](function(){var _0x4547b6=_0x402e90[_0xe8d0('0x33')]({'plain':!![]});var _0x4c1347=_0xe8d0('0x34');return db['UserProfileResource'][_0xe8d0('0x32')]({'where':{'type':_0x4c1347,'resourceId':_0x4547b6['id']}})['then'](function(){return _0x402e90;});})[_0xe8d0('0x1e')](function(){_0x1bee61['status'](0xcc)[_0xe8d0('0x2b')]();});}};}function handleEntityNotFound(_0xb2cdbf,_0x1e2430){return function(_0x320565){if(!_0x320565){_0xb2cdbf['sendStatus'](0x194);}return _0x320565;};}function handleError(_0x36a650,_0x354e19){_0x354e19=_0x354e19||0x1f4;return function(_0x20eec5){logger['error'](_0x20eec5[_0xe8d0('0x35')]);if(_0x20eec5[_0xe8d0('0x36')]){delete _0x20eec5[_0xe8d0('0x36')];}_0x36a650[_0xe8d0('0x2a')](_0x354e19)[_0xe8d0('0x37')](_0x20eec5);};}exports['index']=function(_0x5a969a,_0x1828c5){var _0x10970d={},_0x3d76d5={},_0x318106={'count':0x0,'rows':[]};var _0x23d72e=_[_0xe8d0('0x38')](db[_0xe8d0('0x39')]['rawAttributes'],function(_0x5dff14){return{'name':_0x5dff14[_0xe8d0('0x3a')],'type':_0x5dff14[_0xe8d0('0x3b')][_0xe8d0('0x3c')]};});_0x3d76d5[_0xe8d0('0x3d')]=_[_0xe8d0('0x38')](_0x23d72e,'name');_0x3d76d5[_0xe8d0('0x3e')]=_['keys'](_0x5a969a[_0xe8d0('0x3e')]);_0x3d76d5[_0xe8d0('0x3f')]=_[_0xe8d0('0x40')](_0x3d76d5['model'],_0x3d76d5[_0xe8d0('0x3e')]);_0x10970d[_0xe8d0('0x41')]=_[_0xe8d0('0x40')](_0x3d76d5[_0xe8d0('0x3d')],qs[_0xe8d0('0x42')](_0x5a969a['query']['fields']));_0x10970d['attributes']=_0x10970d['attributes'][_0xe8d0('0x43')]?_0x10970d['attributes']:_0x3d76d5[_0xe8d0('0x3d')];if(!_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x44')](_0xe8d0('0x45'))){_0x10970d[_0xe8d0('0x46')]=qs[_0xe8d0('0x46')](_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x46')]);_0x10970d['offset']=qs[_0xe8d0('0x2d')](_0x5a969a[_0xe8d0('0x3e')]['offset']);}_0x10970d['order']=qs[_0xe8d0('0x47')](_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x47')]);_0x10970d['where']=qs[_0xe8d0('0x3f')](_[_0xe8d0('0x48')](_0x5a969a['query'],_0x3d76d5[_0xe8d0('0x3f')]),_0x23d72e);if(_0x5a969a[_0xe8d0('0x3e')]['filter']){_0x10970d[_0xe8d0('0x49')]=_[_0xe8d0('0x4a')](_0x10970d[_0xe8d0('0x49')],{'$or':_[_0xe8d0('0x38')](_0x23d72e,function(_0x1d5815){if(_0x1d5815[_0xe8d0('0x3b')]!==_0xe8d0('0x4b')){var _0x1ce97d={};_0x1ce97d[_0x1d5815['name']]={'$like':'%'+_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x4c')]+'%'};return _0x1ce97d;}})});}_0x10970d=_[_0xe8d0('0x4a')]({},_0x10970d,_0x5a969a[_0xe8d0('0x4d')]);var _0x28d38b={'where':_0x10970d[_0xe8d0('0x49')]};return db[_0xe8d0('0x39')][_0xe8d0('0x2f')](_0x28d38b)[_0xe8d0('0x1e')](function(_0x2e2c05){_0x318106[_0xe8d0('0x2f')]=_0x2e2c05;if(_0x5a969a[_0xe8d0('0x3e')]['includeAll']){_0x10970d[_0xe8d0('0x4e')]=[{'all':!![]}];}return db[_0xe8d0('0x39')][_0xe8d0('0x4f')](_0x10970d);})[_0xe8d0('0x1e')](function(_0x34047c){_0x318106[_0xe8d0('0x50')]=_0x34047c;return _0x318106;})[_0xe8d0('0x1e')](respondWithFilteredResult(_0x1828c5,_0x10970d))['catch'](handleError(_0x1828c5,null));};exports[_0xe8d0('0x51')]=function(_0x424764,_0x151cf4){var _0x205933={'raw':![],'where':{'id':_0x424764[_0xe8d0('0x52')]['id']}},_0x4ed47f={};_0x4ed47f['model']=_[_0xe8d0('0x53')](db[_0xe8d0('0x39')][_0xe8d0('0x54')]);_0x4ed47f[_0xe8d0('0x3e')]=_[_0xe8d0('0x53')](_0x424764[_0xe8d0('0x3e')]);_0x4ed47f[_0xe8d0('0x3f')]=_['intersection'](_0x4ed47f[_0xe8d0('0x3d')],_0x4ed47f['query']);_0x205933['attributes']=_[_0xe8d0('0x40')](_0x4ed47f['model'],qs[_0xe8d0('0x42')](_0x424764['query'][_0xe8d0('0x42')]));_0x205933[_0xe8d0('0x41')]=_0x205933[_0xe8d0('0x41')][_0xe8d0('0x43')]?_0x205933['attributes']:_0x4ed47f[_0xe8d0('0x3d')];if(_0x424764[_0xe8d0('0x3e')][_0xe8d0('0x55')]){_0x205933[_0xe8d0('0x4e')]=[{'all':!![]}];}_0x205933=_[_0xe8d0('0x4a')]({},_0x205933,_0x424764['options']);return db[_0xe8d0('0x39')][_0xe8d0('0x56')](_0x205933)[_0xe8d0('0x1e')](handleEntityNotFound(_0x151cf4,null))['then'](respondWithResult(_0x151cf4,null))[_0xe8d0('0x28')](handleError(_0x151cf4,null));};exports['clone']=function(_0x56b4fa,_0x1bd329){var _0x37040a={'where':{'id':_0x56b4fa[_0xe8d0('0x52')]['id']}},_0x4e7b49={};_0x4e7b49[_0xe8d0('0x3d')]=_['keys'](db[_0xe8d0('0x39')][_0xe8d0('0x54')]);_0x37040a[_0xe8d0('0x41')]=_[_0xe8d0('0x40')](_0x4e7b49['model'],qs[_0xe8d0('0x42')](_0x56b4fa[_0xe8d0('0x3e')][_0xe8d0('0x42')]));_0x37040a[_0xe8d0('0x41')]=_0x37040a['attributes'][_0xe8d0('0x43')]?_0x37040a[_0xe8d0('0x41')]:_0x4e7b49[_0xe8d0('0x3d')];if(_0x56b4fa[_0xe8d0('0x3e')][_0xe8d0('0x55')]){_0x37040a[_0xe8d0('0x4e')]=[{'all':!![]}];}_0x37040a=_['merge']({},_0x37040a,_0x56b4fa['options']);return db[_0xe8d0('0x39')]['find'](_0x37040a)[_0xe8d0('0x1e')](handleEntityNotFound(_0x1bd329,null))[_0xe8d0('0x1e')](function(_0x4c0d4c){if(_0x4c0d4c){var _0x5ac1ae=_0x4c0d4c[_0xe8d0('0x33')]({'plain':!![]});_0x5ac1ae=qs['omit'](_0x5ac1ae,['id',_0xe8d0('0x57'),'updatedAt']);_0x56b4fa[_0xe8d0('0x58')]=_[_0xe8d0('0x59')](_0x56b4fa[_0xe8d0('0x58')],['id','createdAt',_0xe8d0('0x5a')]);return db[_0xe8d0('0x39')]['create'](_[_0xe8d0('0x4a')](_0x5ac1ae,_0x56b4fa['body']),{'include':_0x56b4fa[_0xe8d0('0x3e')]['includeAll']?[{'all':!![]}]:undefined})[_0xe8d0('0x1e')](function(_0x17afc2){var _0x29467d=_0x56b4fa[_0xe8d0('0x5b')][_0xe8d0('0x33')]({'plain':!![]});if(!_0x29467d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x29467d['role']===_0xe8d0('0x5b')){var _0x55a2df=_0x17afc2[_0xe8d0('0x33')]({'plain':!![]});var _0x18b655=_0xe8d0('0x34');return db[_0xe8d0('0x5c')][_0xe8d0('0x56')]({'where':{'name':_0x18b655,'userProfileId':_0x29467d[_0xe8d0('0x5d')]},'raw':!![]})[_0xe8d0('0x1e')](function(_0x20647d){if(_0x20647d&&_0x20647d[_0xe8d0('0x5e')]===0x0){return db[_0xe8d0('0x5f')][_0xe8d0('0x60')]({'name':_0x55a2df[_0xe8d0('0x36')],'resourceId':_0x55a2df['id'],'type':_0x20647d[_0xe8d0('0x36')],'sectionId':_0x20647d['id']},{})[_0xe8d0('0x1e')](function(){return _0x17afc2;});}else{return _0x17afc2;}})[_0xe8d0('0x28')](function(_0x4a68d5){logger[_0xe8d0('0x24')](_0xe8d0('0x61'),_0x4a68d5);throw _0x4a68d5;});}return _0x17afc2;});}})[_0xe8d0('0x1e')](respondWithResult(_0x1bd329,0xc9))[_0xe8d0('0x28')](handleError(_0x1bd329,null));};exports[_0xe8d0('0x60')]=function(_0x4848d4,_0x2eeb92,_0x1d30c0){var _0x45b42b;return db[_0xe8d0('0x39')][_0xe8d0('0x60')](_0x4848d4[_0xe8d0('0x58')],{'raw':!![]})[_0xe8d0('0x1e')](function(_0x13ceb4){_0x45b42b=_0x13ceb4;return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});})[_0xe8d0('0x1e')](function(_0xdb3e53){var _0x556d7e=fs['readFileSync'](path[_0xe8d0('0x62')](config['root'],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x56761c=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x1b5df8=ejs[_0xe8d0('0x68')](_0x556d7e,{'trunks':_0xdb3e53||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x1b5df8);if(_0x45b42b[_0xe8d0('0x6b')]){var _0xb078d8=ejs[_0xe8d0('0x68')](_0x56761c,{'trunks':_0xdb3e53||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6c'),_0xb078d8);}})[_0xe8d0('0x1e')](function(){return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x60'),{'module':_0xe8d0('0x6e')});})[_0xe8d0('0x1e')](function(){var _0x500fb0=_0x4848d4[_0xe8d0('0x5b')][_0xe8d0('0x33')]({'plain':!![]});if(!_0x500fb0)throw new Error(_0xe8d0('0x6f'));if(_0x500fb0['role']===_0xe8d0('0x5b')){var _0x4c54c4=_0x45b42b[_0xe8d0('0x33')]({'plain':!![]});return db[_0xe8d0('0x5c')][_0xe8d0('0x56')]({'where':{'name':'Trunks','userProfileId':_0x500fb0[_0xe8d0('0x5d')]},'raw':!![]})[_0xe8d0('0x1e')](function(_0xc94cd3){if(_0xc94cd3&&_0xc94cd3[_0xe8d0('0x5e')]===0x0){return db[_0xe8d0('0x5f')]['create']({'name':_0x4c54c4[_0xe8d0('0x36')],'resourceId':_0x4c54c4['id'],'type':_0xc94cd3[_0xe8d0('0x36')],'sectionId':_0xc94cd3['id']},{})[_0xe8d0('0x1e')](function(){return _0x45b42b;});}else{return _0x45b42b;}})[_0xe8d0('0x28')](function(_0x252f0e){logger[_0xe8d0('0x24')](_0xe8d0('0x61'),_0x252f0e);throw _0x252f0e;});}return _0x45b42b;})[_0xe8d0('0x1e')](respondWithResult(_0x2eeb92,0xc9))['catch'](handleError(_0x2eeb92,null));};exports[_0xe8d0('0x31')]=function(_0x31b9d3,_0x14d722,_0x2aa6fc){var _0x4d5997;return db[_0xe8d0('0x39')][_0xe8d0('0x56')]({'where':{'id':_0x31b9d3[_0xe8d0('0x52')]['id']}})['then'](handleEntityNotFound(_0x14d722,null))[_0xe8d0('0x1e')](saveUpdates(_0x31b9d3['body'],null))[_0xe8d0('0x1e')](function(_0x478eb2){if(_0x478eb2){_0x4d5997=_0x478eb2;return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});}})[_0xe8d0('0x1e')](function(_0xa90bdc){if(_0xa90bdc){var _0x87aa04=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x2eaf2f=fs[_0xe8d0('0x65')](path['join'](config[_0xe8d0('0x66')],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x761e97=ejs[_0xe8d0('0x68')](_0x87aa04,{'trunks':_0xa90bdc||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x761e97);var _0x605b5f=ejs[_0xe8d0('0x68')](_0x2eaf2f,{'trunks':_0xa90bdc||[]});fs[_0xe8d0('0x69')]('/etc/asterisk/sip_xcally_registers.conf',_0x605b5f);return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x31'),{'module':_0xe8d0('0x6e')});}return null;})[_0xe8d0('0x1e')](function(_0x255e4b){if(_0x255e4b){return _0x4d5997;}})['then'](respondWithResult(_0x14d722,null))['catch'](handleError(_0x14d722,null));};exports[_0xe8d0('0x32')]=function(_0x5c8c7d,_0x3fb7c8,_0x16098b){var _0x363b3a;return db['Trunk'][_0xe8d0('0x56')]({'where':{'id':_0x5c8c7d['params']['id']}})[_0xe8d0('0x1e')](handleEntityNotFound(_0x3fb7c8,null))[_0xe8d0('0x1e')](removeEntity(_0x3fb7c8,null))[_0xe8d0('0x1e')](function(){return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});})['then'](function(_0x58034d){var _0xfbacce=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x2790f=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config['root'],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x142db4=ejs[_0xe8d0('0x68')](_0xfbacce,{'trunks':_0x58034d});var _0x4a568f=ejs['render'](_0x2790f,{'trunks':_0x58034d});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x142db4);fs[_0xe8d0('0x69')](_0xe8d0('0x6c'),_0x4a568f);return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x32'),{'module':_0xe8d0('0x6e')});})[_0xe8d0('0x28')](handleError(_0x3fb7c8,null));}; \ No newline at end of file +var _0x98a8=['../../mysqldb','jayson/promise','client','request','Trunk,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','get','Trunks','UserProfileResource','stack','name','map','fieldName','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Trunk','include','show','params','keys','rawAttributes','includeAll','clone','find','createdAt','updatedAt','body','omit','create','user','role','UserProfileSection','userProfileId','autoAssociation','findAll','readFileSync','root','server/files/templates/trunk.ejs','join','server/files/templates/registry.ejs','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x43e95a,_0x578530){var _0x17b22a=function(_0x4f92c5){while(--_0x4f92c5){_0x43e95a['push'](_0x43e95a['shift']());}};_0x17b22a(++_0x578530);}(_0x98a8,0x12c));var _0x898a=function(_0x46ac61,_0x3d6c94){_0x46ac61=_0x46ac61-0x0;var _0x48e2f4=_0x98a8[_0x46ac61];return _0x48e2f4;};'use strict';var emlformat=require(_0x898a('0x0'));var rimraf=require(_0x898a('0x1'));var zipdir=require(_0x898a('0x2'));var jsonpatch=require(_0x898a('0x3'));var rp=require(_0x898a('0x4'));var moment=require(_0x898a('0x5'));var BPromise=require(_0x898a('0x6'));var Mustache=require('mustache');var util=require(_0x898a('0x7'));var path=require(_0x898a('0x8'));var sox=require(_0x898a('0x9'));var csv=require(_0x898a('0xa'));var ejs=require(_0x898a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xa'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x898a('0x18'))['db'];var jayson=require(_0x898a('0x19'));var client=jayson[_0x898a('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bfded,_0x5b5c9c,_0x373d53,_0x1f5be4){return new BPromise(function(_0xb24335,_0x116fbe){var _0x1873e9=_0x1f5be4||client;return _0x1873e9[_0x898a('0x1b')](_0x5bfded,_0x373d53)['then'](function(_0x47033c){logger['info'](_0x898a('0x1c'),_0x5b5c9c,'request\x20sent');logger[_0x898a('0x1d')]('Trunk,\x20%s,\x20%s,\x20%s',_0x5b5c9c,_0x898a('0x1e'),JSON['stringify'](_0x47033c));if(_0x47033c[_0x898a('0x1f')]){if(_0x47033c[_0x898a('0x1f')][_0x898a('0x20')]===0x1f4){logger['error'](_0x898a('0x1c'),_0x5b5c9c,_0x47033c['error']['message']);return _0x116fbe(_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x5b5c9c,_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);return _0xb24335(_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);}else{logger[_0x898a('0x22')](_0x898a('0x1c'),_0x5b5c9c,_0x898a('0x1e'));_0xb24335(_0x47033c['result'][_0x898a('0x21')]);}})[_0x898a('0x23')](function(_0x11cae2){logger[_0x898a('0x1f')](_0x898a('0x1c'),_0x5b5c9c,_0x11cae2);_0x116fbe(_0x11cae2);});});}function respondWithStatusCode(_0x310bfa,_0x4e254d){_0x4e254d=_0x4e254d||0xcc;return function(_0x274cdf){if(_0x274cdf){return _0x310bfa[_0x898a('0x24')](_0x4e254d);}return _0x310bfa[_0x898a('0x25')](_0x4e254d)[_0x898a('0x26')]();};}function respondWithResult(_0x3901ab,_0x1426e3){_0x1426e3=_0x1426e3||0xc8;return function(_0x5b7719){if(_0x5b7719){return _0x3901ab[_0x898a('0x25')](_0x1426e3)['json'](_0x5b7719);}};}function respondWithFilteredResult(_0x513c6b,_0x53ddb2){return function(_0x3678be){if(_0x3678be){var _0x1f4d86=typeof _0x53ddb2[_0x898a('0x27')]===_0x898a('0x28')&&typeof _0x53ddb2[_0x898a('0x29')]===_0x898a('0x28');var _0x398e98=_0x3678be[_0x898a('0x2a')];var _0xd31922=_0x1f4d86?0x0:_0x53ddb2['offset'];var _0x4b3e68=_0x1f4d86?_0x3678be['count']:_0x53ddb2[_0x898a('0x27')]+_0x53ddb2[_0x898a('0x29')];var _0x3b7704;if(_0x4b3e68>=_0x398e98){_0x4b3e68=_0x398e98;_0x3b7704=0xc8;}else{_0x3b7704=0xce;}_0x513c6b[_0x898a('0x25')](_0x3b7704);return _0x513c6b[_0x898a('0x2b')](_0x898a('0x2c'),_0xd31922+'-'+_0x4b3e68+'/'+_0x398e98)[_0x898a('0x2d')](_0x3678be);}return null;};}function patchUpdates(_0xf74645){return function(_0x18773a){try{jsonpatch[_0x898a('0x2e')](_0x18773a,_0xf74645,!![]);}catch(_0x44c5d2){return BPromise[_0x898a('0x2f')](_0x44c5d2);}return _0x18773a['save']();};}function saveUpdates(_0x7a1eb5,_0x17a5f3){return function(_0x26eead){if(_0x26eead){return _0x26eead[_0x898a('0x30')](_0x7a1eb5)[_0x898a('0x31')](function(_0x47af5b){return _0x47af5b;});}return null;};}function removeEntity(_0x48cefb,_0x20a3fe){return function(_0x1e2fd4){if(_0x1e2fd4){return _0x1e2fd4[_0x898a('0x32')]()['then'](function(){var _0x105477=_0x1e2fd4[_0x898a('0x33')]({'plain':!![]});var _0x5eafc7=_0x898a('0x34');return db[_0x898a('0x35')][_0x898a('0x32')]({'where':{'type':_0x5eafc7,'resourceId':_0x105477['id']}})[_0x898a('0x31')](function(){return _0x1e2fd4;});})[_0x898a('0x31')](function(){_0x48cefb['status'](0xcc)[_0x898a('0x26')]();});}};}function handleEntityNotFound(_0x5baf5b,_0x573eb3){return function(_0x14e2dc){if(!_0x14e2dc){_0x5baf5b['sendStatus'](0x194);}return _0x14e2dc;};}function handleError(_0x3c9588,_0x4b3aac){_0x4b3aac=_0x4b3aac||0x1f4;return function(_0x37cb11){logger['error'](_0x37cb11[_0x898a('0x36')]);if(_0x37cb11[_0x898a('0x37')]){delete _0x37cb11[_0x898a('0x37')];}_0x3c9588['status'](_0x4b3aac)['send'](_0x37cb11);};}exports['index']=function(_0x1575d2,_0x429c32){var _0x5a228f={},_0xdd019d={},_0x3d3463={'count':0x0,'rows':[]};var _0xe84f7e=_[_0x898a('0x38')](db['Trunk']['rawAttributes'],function(_0x3aed01){return{'name':_0x3aed01[_0x898a('0x39')],'type':_0x3aed01['type']['key']};});_0xdd019d[_0x898a('0x3a')]=_[_0x898a('0x38')](_0xe84f7e,_0x898a('0x37'));_0xdd019d[_0x898a('0x3b')]=_['keys'](_0x1575d2[_0x898a('0x3b')]);_0xdd019d[_0x898a('0x3c')]=_['intersection'](_0xdd019d['model'],_0xdd019d['query']);_0x5a228f[_0x898a('0x3d')]=_[_0x898a('0x3e')](_0xdd019d[_0x898a('0x3a')],qs[_0x898a('0x3f')](_0x1575d2[_0x898a('0x3b')][_0x898a('0x3f')]));_0x5a228f[_0x898a('0x3d')]=_0x5a228f[_0x898a('0x3d')][_0x898a('0x40')]?_0x5a228f[_0x898a('0x3d')]:_0xdd019d[_0x898a('0x3a')];if(!_0x1575d2[_0x898a('0x3b')][_0x898a('0x41')](_0x898a('0x42'))){_0x5a228f[_0x898a('0x29')]=qs['limit'](_0x1575d2[_0x898a('0x3b')][_0x898a('0x29')]);_0x5a228f[_0x898a('0x27')]=qs['offset'](_0x1575d2[_0x898a('0x3b')][_0x898a('0x27')]);}_0x5a228f[_0x898a('0x43')]=qs[_0x898a('0x44')](_0x1575d2[_0x898a('0x3b')][_0x898a('0x44')]);_0x5a228f[_0x898a('0x45')]=qs[_0x898a('0x3c')](_['pick'](_0x1575d2[_0x898a('0x3b')],_0xdd019d[_0x898a('0x3c')]),_0xe84f7e);if(_0x1575d2[_0x898a('0x3b')][_0x898a('0x46')]){_0x5a228f['where']=_[_0x898a('0x47')](_0x5a228f[_0x898a('0x45')],{'$or':_['map'](_0xe84f7e,function(_0x241677){if(_0x241677['type']!==_0x898a('0x48')){var _0x5137c4={};_0x5137c4[_0x241677['name']]={'$like':'%'+_0x1575d2[_0x898a('0x3b')]['filter']+'%'};return _0x5137c4;}})});}_0x5a228f=_[_0x898a('0x47')]({},_0x5a228f,_0x1575d2[_0x898a('0x49')]);var _0x4d6ac0={'where':_0x5a228f[_0x898a('0x45')]};return db[_0x898a('0x4a')]['count'](_0x4d6ac0)[_0x898a('0x31')](function(_0x199437){_0x3d3463[_0x898a('0x2a')]=_0x199437;if(_0x1575d2[_0x898a('0x3b')]['includeAll']){_0x5a228f[_0x898a('0x4b')]=[{'all':!![]}];}return db[_0x898a('0x4a')]['findAll'](_0x5a228f);})[_0x898a('0x31')](function(_0x1d8c16){_0x3d3463['rows']=_0x1d8c16;return _0x3d3463;})[_0x898a('0x31')](respondWithFilteredResult(_0x429c32,_0x5a228f))['catch'](handleError(_0x429c32,null));};exports[_0x898a('0x4c')]=function(_0x41f291,_0x32ccb9){var _0x50f9e3={'raw':![],'where':{'id':_0x41f291[_0x898a('0x4d')]['id']}},_0x2f6cb3={};_0x2f6cb3[_0x898a('0x3a')]=_[_0x898a('0x4e')](db['Trunk'][_0x898a('0x4f')]);_0x2f6cb3['query']=_[_0x898a('0x4e')](_0x41f291[_0x898a('0x3b')]);_0x2f6cb3[_0x898a('0x3c')]=_['intersection'](_0x2f6cb3[_0x898a('0x3a')],_0x2f6cb3[_0x898a('0x3b')]);_0x50f9e3[_0x898a('0x3d')]=_['intersection'](_0x2f6cb3['model'],qs[_0x898a('0x3f')](_0x41f291[_0x898a('0x3b')][_0x898a('0x3f')]));_0x50f9e3[_0x898a('0x3d')]=_0x50f9e3[_0x898a('0x3d')][_0x898a('0x40')]?_0x50f9e3[_0x898a('0x3d')]:_0x2f6cb3[_0x898a('0x3a')];if(_0x41f291[_0x898a('0x3b')][_0x898a('0x50')]){_0x50f9e3[_0x898a('0x4b')]=[{'all':!![]}];}_0x50f9e3=_['merge']({},_0x50f9e3,_0x41f291[_0x898a('0x49')]);return db[_0x898a('0x4a')]['find'](_0x50f9e3)[_0x898a('0x31')](handleEntityNotFound(_0x32ccb9,null))['then'](respondWithResult(_0x32ccb9,null))['catch'](handleError(_0x32ccb9,null));};exports[_0x898a('0x51')]=function(_0x124f9b,_0x209529){var _0x5bfd61={'where':{'id':_0x124f9b[_0x898a('0x4d')]['id']}},_0x556fd8={};_0x556fd8[_0x898a('0x3a')]=_['keys'](db[_0x898a('0x4a')][_0x898a('0x4f')]);_0x5bfd61['attributes']=_[_0x898a('0x3e')](_0x556fd8[_0x898a('0x3a')],qs[_0x898a('0x3f')](_0x124f9b['query'][_0x898a('0x3f')]));_0x5bfd61[_0x898a('0x3d')]=_0x5bfd61[_0x898a('0x3d')][_0x898a('0x40')]?_0x5bfd61[_0x898a('0x3d')]:_0x556fd8[_0x898a('0x3a')];if(_0x124f9b['query'][_0x898a('0x50')]){_0x5bfd61['include']=[{'all':!![]}];}_0x5bfd61=_[_0x898a('0x47')]({},_0x5bfd61,_0x124f9b[_0x898a('0x49')]);return db[_0x898a('0x4a')][_0x898a('0x52')](_0x5bfd61)[_0x898a('0x31')](handleEntityNotFound(_0x209529,null))[_0x898a('0x31')](function(_0x2486a5){if(_0x2486a5){var _0x75ff57=_0x2486a5[_0x898a('0x33')]({'plain':!![]});_0x75ff57=qs['omit'](_0x75ff57,['id',_0x898a('0x53'),_0x898a('0x54')]);_0x124f9b[_0x898a('0x55')]=_[_0x898a('0x56')](_0x124f9b[_0x898a('0x55')],['id',_0x898a('0x53'),_0x898a('0x54')]);return db[_0x898a('0x4a')][_0x898a('0x57')](_[_0x898a('0x47')](_0x75ff57,_0x124f9b[_0x898a('0x55')]),{'include':_0x124f9b[_0x898a('0x3b')][_0x898a('0x50')]?[{'all':!![]}]:undefined})[_0x898a('0x31')](function(_0x22f9ba){var _0x5f42ae=_0x124f9b[_0x898a('0x58')][_0x898a('0x33')]({'plain':!![]});if(!_0x5f42ae)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5f42ae[_0x898a('0x59')]===_0x898a('0x58')){var _0x5f0944=_0x22f9ba[_0x898a('0x33')]({'plain':!![]});var _0x1daecd=_0x898a('0x34');return db[_0x898a('0x5a')]['find']({'where':{'name':_0x1daecd,'userProfileId':_0x5f42ae[_0x898a('0x5b')]},'raw':!![]})[_0x898a('0x31')](function(_0x137935){if(_0x137935&&_0x137935[_0x898a('0x5c')]===0x0){return db['UserProfileResource'][_0x898a('0x57')]({'name':_0x5f0944[_0x898a('0x37')],'resourceId':_0x5f0944['id'],'type':_0x137935['name'],'sectionId':_0x137935['id']},{})[_0x898a('0x31')](function(){return _0x22f9ba;});}else{return _0x22f9ba;}})[_0x898a('0x23')](function(_0x5b7019){logger[_0x898a('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b7019);throw _0x5b7019;});}return _0x22f9ba;});}})[_0x898a('0x31')](respondWithResult(_0x209529,0xc9))['catch'](handleError(_0x209529,null));};exports['create']=function(_0x5ed35e,_0xfdd6d8,_0x473f5c){var _0x3909c5;return db[_0x898a('0x4a')]['create'](_0x5ed35e['body'],{'raw':!![]})[_0x898a('0x31')](function(_0x232be0){_0x3909c5=_0x232be0;return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});})[_0x898a('0x31')](function(_0x41cf94){var _0x30051d=fs[_0x898a('0x5e')](path['join'](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x42fda8=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x62')),_0x898a('0x63'));var _0x3bcc3d=ejs[_0x898a('0x64')](_0x30051d,{'trunks':_0x41cf94||[]});fs[_0x898a('0x65')](_0x898a('0x66'),_0x3bcc3d);if(_0x3909c5[_0x898a('0x67')]){var _0x307849=ejs[_0x898a('0x64')](_0x42fda8,{'trunks':_0x41cf94||[]});fs['writeFileSync'](_0x898a('0x68'),_0x307849);}})['then'](function(){return respondWithRpcPromise(_0x898a('0x69'),_0x898a('0x57'),{'module':_0x898a('0x6a')});})['then'](function(){var _0x31102d=_0x5ed35e[_0x898a('0x58')][_0x898a('0x33')]({'plain':!![]});if(!_0x31102d)throw new Error(_0x898a('0x6b'));if(_0x31102d[_0x898a('0x59')]==='user'){var _0x4b9487=_0x3909c5[_0x898a('0x33')]({'plain':!![]});return db[_0x898a('0x5a')][_0x898a('0x52')]({'where':{'name':_0x898a('0x34'),'userProfileId':_0x31102d['userProfileId']},'raw':!![]})[_0x898a('0x31')](function(_0x3d3451){if(_0x3d3451&&_0x3d3451[_0x898a('0x5c')]===0x0){return db[_0x898a('0x35')][_0x898a('0x57')]({'name':_0x4b9487[_0x898a('0x37')],'resourceId':_0x4b9487['id'],'type':_0x3d3451[_0x898a('0x37')],'sectionId':_0x3d3451['id']},{})[_0x898a('0x31')](function(){return _0x3909c5;});}else{return _0x3909c5;}})['catch'](function(_0x32a207){logger[_0x898a('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32a207);throw _0x32a207;});}return _0x3909c5;})[_0x898a('0x31')](respondWithResult(_0xfdd6d8,0xc9))['catch'](handleError(_0xfdd6d8,null));};exports[_0x898a('0x30')]=function(_0x4b2575,_0x2471d8,_0x387f2c){var _0x3b07dc;return db[_0x898a('0x4a')][_0x898a('0x52')]({'where':{'id':_0x4b2575[_0x898a('0x4d')]['id']}})[_0x898a('0x31')](handleEntityNotFound(_0x2471d8,null))[_0x898a('0x31')](saveUpdates(_0x4b2575[_0x898a('0x55')],null))['then'](function(_0x3fe54b){if(_0x3fe54b){_0x3b07dc=_0x3fe54b;return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});}})[_0x898a('0x31')](function(_0x290972){if(_0x290972){var _0x1d594b=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x4fad03=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config['root'],'server/files/templates/registry.ejs'),_0x898a('0x63'));var _0x4a79a4=ejs[_0x898a('0x64')](_0x1d594b,{'trunks':_0x290972||[]});fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4a79a4);var _0x3f6815=ejs[_0x898a('0x64')](_0x4fad03,{'trunks':_0x290972||[]});fs[_0x898a('0x65')](_0x898a('0x68'),_0x3f6815);return respondWithRpcPromise(_0x898a('0x69'),_0x898a('0x30'),{'module':_0x898a('0x6a')});}return null;})['then'](function(_0x3237e8){if(_0x3237e8){return _0x3b07dc;}})[_0x898a('0x31')](respondWithResult(_0x2471d8,null))[_0x898a('0x23')](handleError(_0x2471d8,null));};exports['destroy']=function(_0x27560f,_0x61247c,_0x5c6247){var _0x39e917;return db['Trunk']['find']({'where':{'id':_0x27560f['params']['id']}})[_0x898a('0x31')](handleEntityNotFound(_0x61247c,null))[_0x898a('0x31')](removeEntity(_0x61247c,null))[_0x898a('0x31')](function(){return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});})[_0x898a('0x31')](function(_0x12e54b){var _0x50dd52=fs[_0x898a('0x5e')](path['join'](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x24670c=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x62')),'utf8');var _0x5847cb=ejs['render'](_0x50dd52,{'trunks':_0x12e54b});var _0x3b8fb5=ejs[_0x898a('0x64')](_0x24670c,{'trunks':_0x12e54b});fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_trunks.conf',_0x5847cb);fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_registers.conf',_0x3b8fb5);return respondWithRpcPromise('Reload',_0x898a('0x32'),{'module':_0x898a('0x6a')});})[_0x898a('0x23')](handleError(_0x61247c,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index c6a6399..682758e 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 _0xeb64=['./trunk.attributes','exports','define','Trunk','tools_trunks','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xeb64,0x10f));var _0x4eb6=function(_0x5742b9,_0x1a07e0){_0x5742b9=_0x5742b9-0x0;var _0x253f30=_0xeb64[_0x5742b9];return _0x253f30;};'use strict';var _=require(_0x4eb6('0x0'));var util=require(_0x4eb6('0x1'));var logger=require(_0x4eb6('0x2'))('api');var moment=require(_0x4eb6('0x3'));var BPromise=require(_0x4eb6('0x4'));var rp=require(_0x4eb6('0x5'));var fs=require('fs');var path=require(_0x4eb6('0x6'));var rimraf=require(_0x4eb6('0x7'));var config=require(_0x4eb6('0x8'));var attributes=require(_0x4eb6('0x9'));module[_0x4eb6('0xa')]=function(_0x78075a,_0x201836){return _0x78075a[_0x4eb6('0xb')](_0x4eb6('0xc'),attributes,{'tableName':_0x4eb6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4efd=['util','../../config/logger','moment','bluebird','request-promise','rimraf','./trunk.attributes','exports','define','Trunk','lodash'];(function(_0x55d124,_0x4eb63f){var _0x316748=function(_0x12a23f){while(--_0x12a23f){_0x55d124['push'](_0x55d124['shift']());}};_0x316748(++_0x4eb63f);}(_0x4efd,0xf1));var _0xd4ef=function(_0x65c903,_0x41e920){_0x65c903=_0x65c903-0x0;var _0x23e1d7=_0x4efd[_0x65c903];return _0x23e1d7;};'use strict';var _=require(_0xd4ef('0x0'));var util=require(_0xd4ef('0x1'));var logger=require(_0xd4ef('0x2'))('api');var moment=require(_0xd4ef('0x3'));var BPromise=require(_0xd4ef('0x4'));var rp=require(_0xd4ef('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd4ef('0x6'));var config=require('../../config/environment');var attributes=require(_0xd4ef('0x7'));module[_0xd4ef('0x8')]=function(_0x14c25b,_0x5aee8b){return _0x14c25b[_0xd4ef('0x9')](_0xd4ef('0xa'),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 41b94c9..405d0d3 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 _0xb686=['find','where','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetTrunk','Trunk','findAll','options','raw','limit','include','map','attributes','model','ShowTrunk'];(function(_0x4650e4,_0x1145ad){var _0xb03d06=function(_0x5f36d4){while(--_0x5f36d4){_0x4650e4['push'](_0x4650e4['shift']());}};_0xb03d06(++_0x1145ad);}(_0xb686,0x1b2));var _0x6b68=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xb686[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require(_0x6b68('0x0'));var util=require(_0x6b68('0x1'));var moment=require(_0x6b68('0x2'));var BPromise=require(_0x6b68('0x3'));var rs=require(_0x6b68('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6b68('0x5'));var logger=require(_0x6b68('0x6'))(_0x6b68('0x7'));var config=require(_0x6b68('0x8'));var jayson=require(_0x6b68('0x9'));var client=jayson[_0x6b68('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4bc76a,_0x1f5df1,_0x3670ce){return new BPromise(function(_0x414b53,_0x411aff){return client['request'](_0x4bc76a,_0x3670ce)[_0x6b68('0xb')](function(_0x277021){logger[_0x6b68('0xc')](_0x6b68('0xd'),_0x1f5df1,'request\x20sent');logger[_0x6b68('0xe')](_0x6b68('0xf'),_0x1f5df1,_0x6b68('0x10'),JSON[_0x6b68('0x11')](_0x277021));if(_0x277021[_0x6b68('0x12')]){if(_0x277021['error'][_0x6b68('0x13')]===0x1f4){logger[_0x6b68('0x12')]('Trunk,\x20%s,\x20%s',_0x1f5df1,_0x277021[_0x6b68('0x12')]['message']);return _0x411aff(_0x277021[_0x6b68('0x12')][_0x6b68('0x14')]);}logger[_0x6b68('0x12')](_0x6b68('0xd'),_0x1f5df1,_0x277021[_0x6b68('0x12')][_0x6b68('0x14')]);return _0x414b53(_0x277021[_0x6b68('0x12')][_0x6b68('0x14')]);}else{logger['info'](_0x6b68('0xd'),_0x1f5df1,_0x6b68('0x10'));_0x414b53(_0x277021[_0x6b68('0x15')][_0x6b68('0x14')]);}})[_0x6b68('0x16')](function(_0x4c8452){logger['error'](_0x6b68('0xd'),_0x1f5df1,_0x4c8452);_0x411aff(_0x4c8452);});});}exports[_0x6b68('0x17')]=function(_0x440e6d){var _0x2ff0d7=this;return new Promise(function(_0x19040c,_0x1dd26b){return db[_0x6b68('0x18')][_0x6b68('0x19')]({'raw':_0x440e6d[_0x6b68('0x1a')]?_0x440e6d['options'][_0x6b68('0x1b')]===undefined?!![]:![]:!![],'where':_0x440e6d[_0x6b68('0x1a')]?_0x440e6d[_0x6b68('0x1a')]['where']||null:null,'attributes':_0x440e6d['options']?_0x440e6d[_0x6b68('0x1a')]['attributes']||null:null,'limit':_0x440e6d[_0x6b68('0x1a')]?_0x440e6d['options'][_0x6b68('0x1c')]||null:null,'include':_0x440e6d['options']?_0x440e6d[_0x6b68('0x1a')][_0x6b68('0x1d')]?_[_0x6b68('0x1e')](_0x440e6d[_0x6b68('0x1a')]['include'],function(_0x3a8df3){return{'model':db[_0x3a8df3['model']],'as':_0x3a8df3['as'],'attributes':_0x3a8df3['attributes'],'include':_0x3a8df3[_0x6b68('0x1d')]?_['map'](_0x3a8df3[_0x6b68('0x1d')],function(_0x363082){return{'model':db[_0x363082['model']],'as':_0x363082['as'],'attributes':_0x363082[_0x6b68('0x1f')],'include':_0x363082['include']?_['map'](_0x363082['include'],function(_0x300530){return{'model':db[_0x300530[_0x6b68('0x20')]],'as':_0x300530['as'],'attributes':_0x300530[_0x6b68('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6b68('0xb')](function(_0x594823){logger[_0x6b68('0xc')]('GetTrunk',_0x440e6d);logger[_0x6b68('0xe')](_0x6b68('0x17'),_0x440e6d,JSON[_0x6b68('0x11')](_0x594823));_0x19040c(_0x594823);})['catch'](function(_0x4c1c25){logger[_0x6b68('0x12')](_0x6b68('0x17'),_0x4c1c25[_0x6b68('0x14')],_0x440e6d);_0x1dd26b(_0x2ff0d7[_0x6b68('0x12')](0x1f4,_0x4c1c25[_0x6b68('0x14')]));});});};exports[_0x6b68('0x21')]=function(_0xad9edd){var _0x5eecc6=this;return new Promise(function(_0x22f205,_0x4bd60c){return db['Trunk'][_0x6b68('0x22')]({'raw':_0xad9edd['options']?_0xad9edd[_0x6b68('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xad9edd[_0x6b68('0x1a')]?_0xad9edd['options'][_0x6b68('0x23')]||null:null,'attributes':_0xad9edd[_0x6b68('0x1a')]?_0xad9edd[_0x6b68('0x1a')]['attributes']||null:null,'include':_0xad9edd[_0x6b68('0x1a')]?_0xad9edd[_0x6b68('0x1a')]['include']?_[_0x6b68('0x1e')](_0xad9edd['options'][_0x6b68('0x1d')],function(_0x5adba4){return{'model':db[_0x5adba4[_0x6b68('0x20')]],'as':_0x5adba4['as'],'attributes':_0x5adba4['attributes'],'include':_0x5adba4[_0x6b68('0x1d')]?_['map'](_0x5adba4[_0x6b68('0x1d')],function(_0x154b57){return{'model':db[_0x154b57[_0x6b68('0x20')]],'as':_0x154b57['as'],'attributes':_0x154b57[_0x6b68('0x1f')],'include':_0x154b57[_0x6b68('0x1d')]?_[_0x6b68('0x1e')](_0x154b57[_0x6b68('0x1d')],function(_0x18d101){return{'model':db[_0x18d101[_0x6b68('0x20')]],'as':_0x18d101['as'],'attributes':_0x18d101[_0x6b68('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6b68('0xb')](function(_0x26991b){logger[_0x6b68('0xc')]('ShowTrunk',_0xad9edd);logger[_0x6b68('0xe')](_0x6b68('0x21'),_0xad9edd,JSON['stringify'](_0x26991b));_0x22f205(_0x26991b);})[_0x6b68('0x16')](function(_0x59bf14){logger[_0x6b68('0x12')](_0x6b68('0x21'),_0x59bf14[_0x6b68('0x14')],_0xad9edd);_0x4bd60c(_0x5eecc6[_0x6b68('0x12')](0x1f4,_0x59bf14[_0x6b68('0x14')]));});});}; \ No newline at end of file +var _0x0579=['where','attributes','limit','include','map','model','ShowTrunk','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetTrunk','Trunk','findAll','options','raw'];(function(_0x461c18,_0x5605b9){var _0x35501c=function(_0x1cd251){while(--_0x1cd251){_0x461c18['push'](_0x461c18['shift']());}};_0x35501c(++_0x5605b9);}(_0x0579,0x111));var _0x9057=function(_0x306770,_0x41e405){_0x306770=_0x306770-0x0;var _0x5ccf4a=_0x0579[_0x306770];return _0x5ccf4a;};'use strict';var _=require(_0x9057('0x0'));var util=require(_0x9057('0x1'));var moment=require(_0x9057('0x2'));var BPromise=require(_0x9057('0x3'));var rs=require(_0x9057('0x4'));var fs=require('fs');var Redis=require(_0x9057('0x5'));var db=require(_0x9057('0x6'))['db'];var utils=require(_0x9057('0x7'));var logger=require(_0x9057('0x8'))(_0x9057('0x9'));var config=require(_0x9057('0xa'));var jayson=require(_0x9057('0xb'));var client=jayson[_0x9057('0xc')][_0x9057('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1d1bfd,_0x2c63ef,_0x53df46){return new BPromise(function(_0x1e4ea6,_0x372532){return client[_0x9057('0xe')](_0x1d1bfd,_0x53df46)[_0x9057('0xf')](function(_0x4df855){logger['info'](_0x9057('0x10'),_0x2c63ef,_0x9057('0x11'));logger[_0x9057('0x12')](_0x9057('0x13'),_0x2c63ef,_0x9057('0x11'),JSON[_0x9057('0x14')](_0x4df855));if(_0x4df855[_0x9057('0x15')]){if(_0x4df855[_0x9057('0x15')][_0x9057('0x16')]===0x1f4){logger[_0x9057('0x15')](_0x9057('0x10'),_0x2c63ef,_0x4df855[_0x9057('0x15')]['message']);return _0x372532(_0x4df855['error'][_0x9057('0x17')]);}logger[_0x9057('0x15')](_0x9057('0x10'),_0x2c63ef,_0x4df855[_0x9057('0x15')][_0x9057('0x17')]);return _0x1e4ea6(_0x4df855[_0x9057('0x15')][_0x9057('0x17')]);}else{logger[_0x9057('0x18')](_0x9057('0x10'),_0x2c63ef,_0x9057('0x11'));_0x1e4ea6(_0x4df855['result'][_0x9057('0x17')]);}})[_0x9057('0x19')](function(_0x50eff9){logger[_0x9057('0x15')](_0x9057('0x10'),_0x2c63ef,_0x50eff9);_0x372532(_0x50eff9);});});}exports[_0x9057('0x1a')]=function(_0xf67862){var _0x49ba88=this;return new Promise(function(_0x2f82c4,_0x10d0e3){return db[_0x9057('0x1b')][_0x9057('0x1c')]({'raw':_0xf67862['options']?_0xf67862[_0x9057('0x1d')][_0x9057('0x1e')]===undefined?!![]:![]:!![],'where':_0xf67862[_0x9057('0x1d')]?_0xf67862['options'][_0x9057('0x1f')]||null:null,'attributes':_0xf67862['options']?_0xf67862[_0x9057('0x1d')][_0x9057('0x20')]||null:null,'limit':_0xf67862[_0x9057('0x1d')]?_0xf67862[_0x9057('0x1d')][_0x9057('0x21')]||null:null,'include':_0xf67862[_0x9057('0x1d')]?_0xf67862[_0x9057('0x1d')][_0x9057('0x22')]?_['map'](_0xf67862['options'][_0x9057('0x22')],function(_0x2bd7b9){return{'model':db[_0x2bd7b9['model']],'as':_0x2bd7b9['as'],'attributes':_0x2bd7b9[_0x9057('0x20')],'include':_0x2bd7b9[_0x9057('0x22')]?_[_0x9057('0x23')](_0x2bd7b9[_0x9057('0x22')],function(_0x2d8d59){return{'model':db[_0x2d8d59['model']],'as':_0x2d8d59['as'],'attributes':_0x2d8d59['attributes'],'include':_0x2d8d59[_0x9057('0x22')]?_['map'](_0x2d8d59[_0x9057('0x22')],function(_0x1128cf){return{'model':db[_0x1128cf[_0x9057('0x24')]],'as':_0x1128cf['as'],'attributes':_0x1128cf['attributes']};}):[]};}):[]};}):[]:[]})[_0x9057('0xf')](function(_0x397028){logger[_0x9057('0x18')](_0x9057('0x1a'),_0xf67862);logger['debug'](_0x9057('0x1a'),_0xf67862,JSON[_0x9057('0x14')](_0x397028));_0x2f82c4(_0x397028);})[_0x9057('0x19')](function(_0x22d112){logger[_0x9057('0x15')](_0x9057('0x1a'),_0x22d112[_0x9057('0x17')],_0xf67862);_0x10d0e3(_0x49ba88[_0x9057('0x15')](0x1f4,_0x22d112[_0x9057('0x17')]));});});};exports['ShowTrunk']=function(_0x161d72){var _0x3b6074=this;return new Promise(function(_0x144036,_0xe60ffd){return db[_0x9057('0x1b')]['find']({'raw':_0x161d72[_0x9057('0x1d')]?_0x161d72[_0x9057('0x1d')][_0x9057('0x1e')]===undefined?!![]:![]:!![],'where':_0x161d72[_0x9057('0x1d')]?_0x161d72[_0x9057('0x1d')][_0x9057('0x1f')]||null:null,'attributes':_0x161d72[_0x9057('0x1d')]?_0x161d72[_0x9057('0x1d')]['attributes']||null:null,'include':_0x161d72[_0x9057('0x1d')]?_0x161d72[_0x9057('0x1d')]['include']?_[_0x9057('0x23')](_0x161d72['options'][_0x9057('0x22')],function(_0x362f6f){return{'model':db[_0x362f6f[_0x9057('0x24')]],'as':_0x362f6f['as'],'attributes':_0x362f6f[_0x9057('0x20')],'include':_0x362f6f[_0x9057('0x22')]?_[_0x9057('0x23')](_0x362f6f[_0x9057('0x22')],function(_0x1ab66b){return{'model':db[_0x1ab66b[_0x9057('0x24')]],'as':_0x1ab66b['as'],'attributes':_0x1ab66b[_0x9057('0x20')],'include':_0x1ab66b[_0x9057('0x22')]?_['map'](_0x1ab66b[_0x9057('0x22')],function(_0x31f9e6){return{'model':db[_0x31f9e6[_0x9057('0x24')]],'as':_0x31f9e6['as'],'attributes':_0x31f9e6[_0x9057('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x231573){logger['info'](_0x9057('0x25'),_0x161d72);logger['debug'](_0x9057('0x25'),_0x161d72,JSON[_0x9057('0x14')](_0x231573));_0x144036(_0x231573);})[_0x9057('0x19')](function(_0x27e348){logger[_0x9057('0x15')](_0x9057('0x25'),_0x27e348[_0x9057('0x17')],_0x161d72);_0xe60ffd(_0x3b6074[_0x9057('0x15')](0x1f4,_0x27e348[_0x9057('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 33e5d09..9b21f5e 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 _0x74f8=['removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','index','/describe','describe','/whoami','isAuthenticated','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','getContacts','getQueues','getRecordings','/:id/screen_recordings','/:id/chat/interactions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','/:id/api_key','getApiKey','/:id/contacts','addContacts','post','/create_many','bulkCreate','/:id/queues','addQueues','root','server/files/images/','format','%s-%s','now','originalname','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addWhatsappAccounts','createApiKey','put','/:id/password','changePassword','removeQueues','delete','removeTeams','destroy','/:id/chat_interactions','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts'];(function(_0x56e936,_0x33440c){var _0x229c63=function(_0x53f760){while(--_0x53f760){_0x56e936['push'](_0x56e936['shift']());}};_0x229c63(++_0x33440c);}(_0x74f8,0x1e1));var _0x874f=function(_0x1f1fbb,_0x4124c6){_0x1f1fbb=_0x1f1fbb-0x0;var _0x24b173=_0x74f8[_0x1f1fbb];return _0x24b173;};'use strict';var multer=require(_0x874f('0x0'));var util=require(_0x874f('0x1'));var path=require(_0x874f('0x2'));var timeout=require('connect-timeout');var express=require(_0x874f('0x3'));var router=express[_0x874f('0x4')]();var fs_extra=require(_0x874f('0x5'));var auth=require(_0x874f('0x6'));var interaction=require(_0x874f('0x7'));var config=require(_0x874f('0x8'));var controller=require(_0x874f('0x9'));router[_0x874f('0xa')]('/',auth['isAuthenticated'](),controller[_0x874f('0xb')]);router['get'](_0x874f('0xc'),auth['isAuthenticated'](),controller[_0x874f('0xd')]);router[_0x874f('0xa')](_0x874f('0xe'),auth[_0x874f('0xf')](),controller[_0x874f('0x10')]);router[_0x874f('0xa')](_0x874f('0x11'),auth['isAuthenticated'](),controller[_0x874f('0x12')]);router[_0x874f('0xa')](_0x874f('0x13'),auth[_0x874f('0xf')](),controller[_0x874f('0x14')]);router[_0x874f('0xa')](_0x874f('0x15'),controller[_0x874f('0x16')]);router[_0x874f('0xa')](_0x874f('0x17'),auth[_0x874f('0xf')](),controller[_0x874f('0x18')]);router[_0x874f('0xa')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x874f('0x19')]);router[_0x874f('0xa')]('/:id/queues',auth[_0x874f('0xf')](),controller[_0x874f('0x1a')]);router['get']('/:id/queues_rt',auth[_0x874f('0xf')](),controller['getVoiceQueuesRt']);router[_0x874f('0xa')]('/:id/groups',auth['isAuthenticated'](),controller['getGroups']);router[_0x874f('0xa')]('/:id/recordings',auth[_0x874f('0xf')](),controller[_0x874f('0x1b')]);router[_0x874f('0xa')](_0x874f('0x1c'),auth[_0x874f('0xf')](),controller['getScreenRecordings']);router[_0x874f('0xa')](_0x874f('0x1d'),auth['isAuthenticated'](),controller['getChatInteractions']);router[_0x874f('0xa')](_0x874f('0x1e'),auth[_0x874f('0xf')](),controller[_0x874f('0x1f')]);router[_0x874f('0xa')](_0x874f('0x20'),auth[_0x874f('0xf')](),controller['getMailInteractions']);router[_0x874f('0xa')](_0x874f('0x21'),auth[_0x874f('0xf')](),controller['getSmsInteractions']);router['get'](_0x874f('0x22'),auth['isAuthenticated'](),controller[_0x874f('0x23')]);router[_0x874f('0xa')](_0x874f('0x24'),auth[_0x874f('0xf')](),controller[_0x874f('0x25')]);router['get'](_0x874f('0x26'),auth['isAuthenticated'](),controller[_0x874f('0x27')]);router[_0x874f('0xa')](_0x874f('0x28'),auth[_0x874f('0xf')](),controller[_0x874f('0x29')]);router['get'](_0x874f('0x2a'),auth[_0x874f('0xf')](),controller['getAgents']);router[_0x874f('0xa')]('/:id/prefixes',auth[_0x874f('0xf')](),controller[_0x874f('0x2b')]);router[_0x874f('0xa')](_0x874f('0x2c'),auth[_0x874f('0xf')](),controller[_0x874f('0x2d')]);router['get'](_0x874f('0x2e'),auth[_0x874f('0xf')](),controller[_0x874f('0x2f')]);router[_0x874f('0xa')](_0x874f('0x30'),auth[_0x874f('0xf')](),controller['getOpenchannelAccounts']);router[_0x874f('0xa')](_0x874f('0x31'),auth[_0x874f('0xf')](),controller[_0x874f('0x32')]);router[_0x874f('0xa')](_0x874f('0x33'),auth[_0x874f('0xf')](),controller[_0x874f('0x34')]);router[_0x874f('0xa')](_0x874f('0x35'),auth[_0x874f('0xf')](),controller[_0x874f('0x36')]);router['get'](_0x874f('0x37'),auth[_0x874f('0xf')](),controller[_0x874f('0x38')]);router[_0x874f('0xa')](_0x874f('0x39'),auth['isAuthenticated'](),controller['getScheduledCalls']);router['get'](_0x874f('0x3a'),auth[_0x874f('0xf')](),controller[_0x874f('0x3b')]);router['post'](_0x874f('0x3c'),auth['isAuthenticated'](),controller[_0x874f('0x3d')]);router['post']('/',auth[_0x874f('0xf')](),controller['create']);router[_0x874f('0x3e')](_0x874f('0x3f'),auth['isAuthenticated'](),controller[_0x874f('0x40')]);router[_0x874f('0x3e')](_0x874f('0x41'),auth[_0x874f('0xf')](),controller[_0x874f('0x42')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x236f8b,_0x4eadb9,_0x6532a9){_0x6532a9(null,path['join'](config[_0x874f('0x43')],_0x874f('0x44')));},'filename':function(_0x4df64d,_0x36337e,_0x4dbdd9){_0x4dbdd9(null,util[_0x874f('0x45')](_0x874f('0x46'),Date[_0x874f('0x47')](),_0x36337e[_0x874f('0x48')]));}})});router[_0x874f('0x3e')]('/:id/avatar',upload['single'](_0x874f('0x49')),controller[_0x874f('0x4a')]);router[_0x874f('0x3e')](_0x874f('0x4b'),auth[_0x874f('0xf')](),controller[_0x874f('0x4c')]);router[_0x874f('0x3e')](_0x874f('0x4d'),auth[_0x874f('0xf')](),controller[_0x874f('0x4e')]);router[_0x874f('0x3e')](_0x874f('0x4f'),auth[_0x874f('0xf')](),controller[_0x874f('0x50')]);router[_0x874f('0x3e')](_0x874f('0x51'),auth['isAuthenticated'](),controller[_0x874f('0x52')]);router[_0x874f('0x3e')](_0x874f('0x26'),auth[_0x874f('0xf')](),controller[_0x874f('0x53')]);router[_0x874f('0x3e')]('/:id/chat_interactions',auth[_0x874f('0xf')](),controller[_0x874f('0x54')]);router[_0x874f('0x3e')](_0x874f('0x55'),auth[_0x874f('0xf')](),controller[_0x874f('0x56')]);router[_0x874f('0x3e')](_0x874f('0x57'),auth['isAuthenticated'](),controller[_0x874f('0x58')]);router[_0x874f('0x3e')](_0x874f('0x59'),auth[_0x874f('0xf')](),controller[_0x874f('0x5a')]);router[_0x874f('0x3e')](_0x874f('0x5b'),auth['isAuthenticated'](),controller['addOpenchannelInteractions']);router['post'](_0x874f('0x5c'),auth[_0x874f('0xf')](),controller[_0x874f('0x5d')]);router[_0x874f('0x3e')](_0x874f('0x2c'),auth[_0x874f('0xf')](),controller[_0x874f('0x5e')]);router[_0x874f('0x3e')](_0x874f('0x2e'),auth[_0x874f('0xf')](),controller['addMailAccounts']);router[_0x874f('0x3e')](_0x874f('0x30'),auth[_0x874f('0xf')](),controller['addOpenchannelAccounts']);router[_0x874f('0x3e')](_0x874f('0x31'),auth[_0x874f('0xf')](),controller['addSmsAccounts']);router['post'](_0x874f('0x33'),auth[_0x874f('0xf')](),controller['addChatWebsites']);router[_0x874f('0x3e')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller[_0x874f('0x5f')]);router[_0x874f('0x3e')](_0x874f('0x37'),auth[_0x874f('0xf')](),controller['addSquareProjects']);router[_0x874f('0x3e')](_0x874f('0x3a'),auth[_0x874f('0xf')](),controller[_0x874f('0x60')]);router[_0x874f('0x61')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x874f('0x61')](_0x874f('0x62'),auth[_0x874f('0xf')](),controller[_0x874f('0x63')]);router['delete'](_0x874f('0x41'),auth[_0x874f('0xf')](),controller[_0x874f('0x64')]);router[_0x874f('0x65')]('/:id/teams',auth[_0x874f('0xf')](),controller[_0x874f('0x66')]);router['delete'](_0x874f('0x13'),auth['isAuthenticated'](),controller[_0x874f('0x67')]);router[_0x874f('0x65')](_0x874f('0x68'),auth['isAuthenticated'](),controller[_0x874f('0x69')]);router[_0x874f('0x65')](_0x874f('0x55'),auth[_0x874f('0xf')](),controller[_0x874f('0x6a')]);router['delete'](_0x874f('0x57'),auth['isAuthenticated'](),controller[_0x874f('0x6b')]);router[_0x874f('0x65')]('/:id/sms_interactions',auth['isAuthenticated'](),controller[_0x874f('0x6c')]);router[_0x874f('0x65')]('/:id/openchannel_interactions',auth[_0x874f('0xf')](),controller[_0x874f('0x6d')]);router[_0x874f('0x65')]('/:id/whatsapp_interactions',auth[_0x874f('0xf')](),controller[_0x874f('0x6e')]);router[_0x874f('0x65')]('/:id/fax_accounts',auth[_0x874f('0xf')](),controller['removeFaxAccounts']);router[_0x874f('0x65')](_0x874f('0x2e'),auth['isAuthenticated'](),controller[_0x874f('0x6f')]);router[_0x874f('0x65')](_0x874f('0x30'),auth['isAuthenticated'](),controller[_0x874f('0x70')]);router['delete'](_0x874f('0x31'),auth[_0x874f('0xf')](),controller[_0x874f('0x71')]);router[_0x874f('0x65')](_0x874f('0x33'),auth[_0x874f('0xf')](),controller[_0x874f('0x72')]);router[_0x874f('0x65')]('/:id/whatsapp_accounts',auth[_0x874f('0xf')](),controller[_0x874f('0x73')]);router[_0x874f('0x65')]('/:id/square_projects',auth[_0x874f('0xf')](),controller[_0x874f('0x74')]);router[_0x874f('0x65')](_0x874f('0x3a'),auth['isAuthenticated'](),controller[_0x874f('0x75')]);module[_0x874f('0x76')]=router; \ No newline at end of file +var _0x64d4=['removeWhatsappInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','describe','/whoami','whoami','/presence','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/lists','getLists','/:id/prefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getApiKey','post','addContacts','create','addQueues','now','single','file','addAvatar','/:id/login','login','logout','/:id/pause','pause','unpause','/:id/chat_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addOpenchannelAccounts','addWhatsappAccounts','/:id/api_key','createApiKey','/:id','changePassword','removeQueues','delete','/:id/teams','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions'];(function(_0x32bd7b,_0x31964d){var _0x2a61d6=function(_0x1249bd){while(--_0x1249bd){_0x32bd7b['push'](_0x32bd7b['shift']());}};_0x2a61d6(++_0x31964d);}(_0x64d4,0xe3));var _0x464d=function(_0x5f1c67,_0x2124f4){_0x5f1c67=_0x5f1c67-0x0;var _0x1dc4c4=_0x64d4[_0x5f1c67];return _0x1dc4c4;};'use strict';var multer=require(_0x464d('0x0'));var util=require(_0x464d('0x1'));var path=require(_0x464d('0x2'));var timeout=require(_0x464d('0x3'));var express=require(_0x464d('0x4'));var router=express[_0x464d('0x5')]();var fs_extra=require(_0x464d('0x6'));var auth=require(_0x464d('0x7'));var interaction=require(_0x464d('0x8'));var config=require(_0x464d('0x9'));var controller=require(_0x464d('0xa'));router[_0x464d('0xb')]('/',auth[_0x464d('0xc')](),controller[_0x464d('0xd')]);router[_0x464d('0xb')]('/describe',auth[_0x464d('0xc')](),controller[_0x464d('0xe')]);router[_0x464d('0xb')](_0x464d('0xf'),auth[_0x464d('0xc')](),controller[_0x464d('0x10')]);router[_0x464d('0xb')](_0x464d('0x11'),auth[_0x464d('0xc')](),controller['getPresence']);router['get']('/:id',auth[_0x464d('0xc')](),controller[_0x464d('0x12')]);router[_0x464d('0xb')](_0x464d('0x13'),controller[_0x464d('0x14')]);router[_0x464d('0xb')](_0x464d('0x15'),auth[_0x464d('0xc')](),controller[_0x464d('0x16')]);router['get'](_0x464d('0x17'),auth[_0x464d('0xc')](),controller['getContacts']);router[_0x464d('0xb')](_0x464d('0x18'),auth['isAuthenticated'](),controller['getQueues']);router[_0x464d('0xb')](_0x464d('0x19'),auth[_0x464d('0xc')](),controller[_0x464d('0x1a')]);router[_0x464d('0xb')](_0x464d('0x1b'),auth['isAuthenticated'](),controller[_0x464d('0x1c')]);router['get'](_0x464d('0x1d'),auth[_0x464d('0xc')](),controller[_0x464d('0x1e')]);router[_0x464d('0xb')](_0x464d('0x1f'),auth[_0x464d('0xc')](),controller[_0x464d('0x20')]);router[_0x464d('0xb')]('/:id/chat/interactions',auth[_0x464d('0xc')](),controller[_0x464d('0x21')]);router[_0x464d('0xb')](_0x464d('0x22'),auth[_0x464d('0xc')](),controller[_0x464d('0x23')]);router[_0x464d('0xb')](_0x464d('0x24'),auth['isAuthenticated'](),controller[_0x464d('0x25')]);router[_0x464d('0xb')]('/:id/sms/interactions',auth[_0x464d('0xc')](),controller[_0x464d('0x26')]);router[_0x464d('0xb')](_0x464d('0x27'),auth[_0x464d('0xc')](),controller[_0x464d('0x28')]);router[_0x464d('0xb')](_0x464d('0x29'),auth[_0x464d('0xc')](),controller[_0x464d('0x2a')]);router['get']('/:id/teams',auth[_0x464d('0xc')](),controller['getTeams']);router[_0x464d('0xb')](_0x464d('0x2b'),auth[_0x464d('0xc')](),controller[_0x464d('0x2c')]);router['get']('/:id/agents',auth[_0x464d('0xc')](),controller['getAgents']);router[_0x464d('0xb')](_0x464d('0x2d'),auth[_0x464d('0xc')](),controller['getVoicePrefixes']);router[_0x464d('0xb')](_0x464d('0x2e'),auth[_0x464d('0xc')](),controller[_0x464d('0x2f')]);router[_0x464d('0xb')](_0x464d('0x30'),auth[_0x464d('0xc')](),controller[_0x464d('0x31')]);router[_0x464d('0xb')](_0x464d('0x32'),auth[_0x464d('0xc')](),controller[_0x464d('0x33')]);router[_0x464d('0xb')](_0x464d('0x34'),auth[_0x464d('0xc')](),controller[_0x464d('0x35')]);router[_0x464d('0xb')](_0x464d('0x36'),auth[_0x464d('0xc')](),controller[_0x464d('0x37')]);router[_0x464d('0xb')](_0x464d('0x38'),auth['isAuthenticated'](),controller['getWhatsappAccounts']);router[_0x464d('0xb')](_0x464d('0x39'),auth[_0x464d('0xc')](),controller[_0x464d('0x3a')]);router[_0x464d('0xb')](_0x464d('0x3b'),auth[_0x464d('0xc')](),controller['getScheduledCalls']);router['get']('/:id/api_key',auth['isAuthenticated'](),controller[_0x464d('0x3c')]);router[_0x464d('0x3d')]('/:id/contacts',auth[_0x464d('0xc')](),controller[_0x464d('0x3e')]);router[_0x464d('0x3d')]('/',auth[_0x464d('0xc')](),controller[_0x464d('0x3f')]);router[_0x464d('0x3d')]('/create_many',auth['isAuthenticated'](),controller['bulkCreate']);router[_0x464d('0x3d')](_0x464d('0x18'),auth[_0x464d('0xc')](),controller[_0x464d('0x40')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5bd281,_0x5317fe,_0x2e12b7){_0x2e12b7(null,path['join'](config['root'],'server/files/images/'));},'filename':function(_0x4a390d,_0x5ddb74,_0x275103){_0x275103(null,util['format']('%s-%s',Date[_0x464d('0x41')](),_0x5ddb74['originalname']));}})});router[_0x464d('0x3d')](_0x464d('0x13'),upload[_0x464d('0x42')](_0x464d('0x43')),controller[_0x464d('0x44')]);router['post'](_0x464d('0x45'),auth['isAuthenticated'](),controller[_0x464d('0x46')]);router[_0x464d('0x3d')]('/:id/logout',auth['isAuthenticated'](),controller[_0x464d('0x47')]);router[_0x464d('0x3d')](_0x464d('0x48'),auth[_0x464d('0xc')](),controller[_0x464d('0x49')]);router[_0x464d('0x3d')]('/:id/unpause',auth[_0x464d('0xc')](),controller[_0x464d('0x4a')]);router['post']('/:id/teams',auth[_0x464d('0xc')](),controller['addTeams']);router[_0x464d('0x3d')](_0x464d('0x4b'),auth[_0x464d('0xc')](),controller['addChatInteractions']);router[_0x464d('0x3d')]('/:id/mail_interactions',auth[_0x464d('0xc')](),controller[_0x464d('0x4c')]);router['post'](_0x464d('0x4d'),auth[_0x464d('0xc')](),controller[_0x464d('0x4e')]);router[_0x464d('0x3d')](_0x464d('0x4f'),auth[_0x464d('0xc')](),controller[_0x464d('0x50')]);router[_0x464d('0x3d')](_0x464d('0x51'),auth[_0x464d('0xc')](),controller[_0x464d('0x52')]);router[_0x464d('0x3d')](_0x464d('0x53'),auth[_0x464d('0xc')](),controller[_0x464d('0x54')]);router[_0x464d('0x3d')]('/:id/fax_accounts',auth[_0x464d('0xc')](),controller['addFaxAccounts']);router[_0x464d('0x3d')]('/:id/mail_accounts',auth[_0x464d('0xc')](),controller['addMailAccounts']);router['post'](_0x464d('0x32'),auth[_0x464d('0xc')](),controller[_0x464d('0x55')]);router[_0x464d('0x3d')](_0x464d('0x34'),auth[_0x464d('0xc')](),controller['addSmsAccounts']);router[_0x464d('0x3d')](_0x464d('0x36'),auth[_0x464d('0xc')](),controller['addChatWebsites']);router[_0x464d('0x3d')]('/:id/whatsapp_accounts',auth[_0x464d('0xc')](),controller[_0x464d('0x56')]);router[_0x464d('0x3d')](_0x464d('0x39'),auth['isAuthenticated'](),controller['addSquareProjects']);router[_0x464d('0x3d')](_0x464d('0x57'),auth['isAuthenticated'](),controller[_0x464d('0x58')]);router['put'](_0x464d('0x59'),auth[_0x464d('0xc')](),controller['update']);router['put']('/:id/password',auth[_0x464d('0xc')](),controller[_0x464d('0x5a')]);router['delete']('/:id/queues',auth[_0x464d('0xc')](),controller[_0x464d('0x5b')]);router[_0x464d('0x5c')](_0x464d('0x5d'),auth[_0x464d('0xc')](),controller[_0x464d('0x5e')]);router[_0x464d('0x5c')](_0x464d('0x59'),auth['isAuthenticated'](),controller[_0x464d('0x5f')]);router[_0x464d('0x5c')](_0x464d('0x4b'),auth[_0x464d('0xc')](),controller[_0x464d('0x60')]);router[_0x464d('0x5c')]('/:id/mail_interactions',auth[_0x464d('0xc')](),controller[_0x464d('0x61')]);router['delete'](_0x464d('0x4d'),auth['isAuthenticated'](),controller[_0x464d('0x62')]);router[_0x464d('0x5c')](_0x464d('0x4f'),auth[_0x464d('0xc')](),controller[_0x464d('0x63')]);router[_0x464d('0x5c')](_0x464d('0x51'),auth[_0x464d('0xc')](),controller['removeOpenchannelInteractions']);router[_0x464d('0x5c')](_0x464d('0x53'),auth[_0x464d('0xc')](),controller[_0x464d('0x64')]);router['delete'](_0x464d('0x2e'),auth[_0x464d('0xc')](),controller[_0x464d('0x65')]);router[_0x464d('0x5c')](_0x464d('0x30'),auth[_0x464d('0xc')](),controller['removeMailAccounts']);router[_0x464d('0x5c')](_0x464d('0x32'),auth[_0x464d('0xc')](),controller[_0x464d('0x66')]);router['delete'](_0x464d('0x34'),auth[_0x464d('0xc')](),controller[_0x464d('0x67')]);router[_0x464d('0x5c')](_0x464d('0x36'),auth[_0x464d('0xc')](),controller[_0x464d('0x68')]);router[_0x464d('0x5c')](_0x464d('0x38'),auth[_0x464d('0xc')](),controller[_0x464d('0x69')]);router[_0x464d('0x5c')]('/:id/square_projects',auth['isAuthenticated'](),controller[_0x464d('0x6a')]);router[_0x464d('0x5c')](_0x464d('0x57'),auth[_0x464d('0xc')](),controller[_0x464d('0x6b')]);module[_0x464d('0x6c')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 36ed4fb..e724f84 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 _0x96e0=['refuse','originate','uac','uas','certificate','active','passive','actpass','update,nonat','TEXT','showWebBar','get','isArray','wss','encryption','force_avp','icesupport','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','avpf','dtlsenable','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','phoneBarEnableScreenRecordingByAgent','string','true','screenrecording','blocked','loginAttempts','blockedAt','UNSIGNED','sequelize','util','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','format','getDataValue','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','local','INTEGER','callerid','\x22%s\x22\x20<%s>','DATE','BOOLEAN','DEFAULT\x20PAUSE','peer','friend','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]','info','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','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','always','accept'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x96e0,0x7e));var _0x096e=function(_0x270294,_0x402db0){_0x270294=_0x270294-0x0;var _0x5889a6=_0x96e0[_0x270294];return _0x5889a6;};'use strict';var Sequelize=require(_0x096e('0x0'));var moment=require('moment');var util=require(_0x096e('0x1'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x096e('0x2')],'allowNull':![],'unique':_0x096e('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x44027f){this[_0x096e('0x4')]('name',_0x44027f);this['setDataValue']('defaultuser',_0x44027f);},'comment':_0x096e('0x5')},'fullname':{'type':Sequelize[_0x096e('0x2')],'allowNull':![],'set':function(_0x23c5ab){this[_0x096e('0x4')](_0x096e('0x6'),_0x23c5ab);this[_0x096e('0x4')]('callerid',util[_0x096e('0x7')]('\x22%s\x22\x20<%s>',_0x23c5ab,this[_0x096e('0x8')](_0x096e('0x9'))));}},'alias':{'type':Sequelize[_0x096e('0x2')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x096e('0xa'),'validate':{'isEmail':!![]},'set':function(_0xa4339d){if(_0xa4339d){this[_0x096e('0x4')]('email',_0xa4339d[_0x096e('0xb')]());}}},'role':{'type':Sequelize[_0x096e('0xc')](_0x096e('0xd'),_0x096e('0xe'),_0x096e('0xf'),_0x096e('0x10')),'allowNull':![]},'password':{'type':Sequelize[_0x096e('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x096e('0x11')},'internal':{'type':Sequelize[_0x096e('0x12')](0xb),'allowNull':![],'unique':'internal','set':function(_0x73ac62){this[_0x096e('0x4')](_0x096e('0x9'),_0x73ac62);this[_0x096e('0x4')]('accountcode',_0x73ac62);this[_0x096e('0x4')](_0x096e('0x13'),util['format'](_0x096e('0x14'),this['getDataValue'](_0x096e('0x6')),_0x73ac62));}},'salt':{'type':Sequelize[_0x096e('0x2')]},'phone':{'type':Sequelize[_0x096e('0x2')]},'mobile':{'type':Sequelize[_0x096e('0x2')]},'address':{'type':Sequelize[_0x096e('0x2')]},'zipcode':{'type':Sequelize[_0x096e('0x2')]},'userpic':{'type':Sequelize[_0x096e('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x096e('0x15')]},'voicePause':{'type':Sequelize[_0x096e('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x096e('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x096e('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x096e('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0x096e('0x17')},'lastPauseAt':{'type':Sequelize[_0x096e('0x15')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x096e('0x12')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x096e('0x12')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x096e('0x12')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x096e('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x096e('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x096e('0x12')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x096e('0x12')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x096e('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x096e('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x096e('0x16')],'defaultValue':![]},'description':{'type':Sequelize[_0x096e('0x2')],'allowNull':!![]},'host':{'type':Sequelize[_0x096e('0x2')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x096e('0x2')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x096e('0x2')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x096e('0x2')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x096e('0x2')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x096e('0x12')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x096e('0xc')]('friend',_0x096e('0xe'),_0x096e('0x18')),'allowNull':!![],'defaultValue':_0x096e('0x19')},'context':{'type':Sequelize[_0x096e('0x2')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize['ENUM'](_0x096e('0x1a'),_0x096e('0x1b'),_0x096e('0x1c'),_0x096e('0x1d'),_0x096e('0x1e'),_0x096e('0x1f'),_0x096e('0x20'),_0x096e('0x21')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x096e('0x2')],'allowNull':!![]},'secret':{'type':Sequelize[_0x096e('0x2')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x096e('0x2')],'allowNull':!![]},'transport':{'type':Sequelize[_0x096e('0x2')],'allowNull':!![],'defaultValue':_0x096e('0x22'),'set':function(_0x361499){this['setDataValue'](_0x096e('0x23'),_0x361499?_0x361499[_0x096e('0x24')](','):null);},'get':function(){return this[_0x096e('0x8')](_0x096e('0x23'))?this[_0x096e('0x8')]('transport')[_0x096e('0x25')](','):null;},'comment':_0x096e('0x26')},'dtmfmode':{'type':Sequelize[_0x096e('0xc')]('rfc2833',_0x096e('0x27'),'shortinfo','inband','auto'),'allowNull':!![],'defaultValue':_0x096e('0x28')},'directmedia':{'type':Sequelize[_0x096e('0xc')](_0x096e('0x29'),'no',_0x096e('0x2a'),_0x096e('0x2b'),_0x096e('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x096e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x096e('0x2')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0x096e('0x2')],'allowNull':!![],'defaultValue':_0x096e('0x2d'),'set':function(_0xca99d1){this['setDataValue'](_0x096e('0x2e'),_0xca99d1?_0xca99d1['join'](','):null);},'get':function(){return this[_0x096e('0x8')](_0x096e('0x2e'))?this[_0x096e('0x8')](_0x096e('0x2e'))[_0x096e('0x25')](','):null;},'comment':_0x096e('0x2f')},'callgroup':{'type':Sequelize[_0x096e('0x2')]},'namedcallgroup':{'type':Sequelize[_0x096e('0x2')]},'pickupgroup':{'type':Sequelize[_0x096e('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x096e('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x096e('0x2')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x096e('0x30')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x7a4d5a){this['setDataValue'](_0x096e('0x31'),_0x7a4d5a?_0x7a4d5a[_0x096e('0x24')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x096e('0x8')](_0x096e('0x31'))?this[_0x096e('0x8')](_0x096e('0x31'))['split'](';'):null;},'comment':_0x096e('0x32')},'autoframing':{'type':Sequelize['ENUM'](_0x096e('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x096e('0x2')],'allowNull':!![],'set':function(_0x47abf5){this[_0x096e('0x4')]('insecure',_0x47abf5?_0x47abf5[_0x096e('0x24')](','):null);},'get':function(){return this[_0x096e('0x8')]('insecure')?this[_0x096e('0x8')]('insecure')[_0x096e('0x25')](','):null;},'comment':_0x096e('0x33')},'trustrpid':{'type':Sequelize[_0x096e('0xc')](_0x096e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x096e('0xc')](_0x096e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x096e('0xc')](_0x096e('0x29'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x096e('0xc')](_0x096e('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x096e('0xc')](_0x096e('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x096e('0x12')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x096e('0x2')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x096e('0x2')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x096e('0x2')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x096e('0xc')](_0x096e('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x096e('0x12')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x096e('0xc')](_0x096e('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x096e('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x096e('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x096e('0xc')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x096e('0x2')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x096e('0xc')](_0x096e('0x29'),'no',_0x096e('0x34')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x096e('0x12')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x096e('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x096e('0x2')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x096e('0xc')](_0x096e('0x35'),_0x096e('0x36'),_0x096e('0x37')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x096e('0x12')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x096e('0x12')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x096e('0xc')](_0x096e('0x38'),'uas'),'allowNull':!![],'defaultValue':_0x096e('0x39')},'t38pt_usertpsource':{'type':Sequelize[_0x096e('0x2')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x096e('0x2')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0x096e('0xc')](_0x096e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x096e('0x29')},'keepalive':{'type':Sequelize[_0x096e('0x12')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x096e('0x2')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x096e('0x12')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x096e('0x12')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x096e('0x12')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x096e('0xc')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x096e('0x2')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x096e('0x2')],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x096e('0x12')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x096e('0x12')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x096e('0x2')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x096e('0x2')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x096e('0x12')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x096e('0xc')](_0x096e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x096e('0xc')](_0x096e('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x096e('0xc')](_0x096e('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x096e('0xc')](_0x096e('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM']('yes','no','fingerprint',_0x096e('0x3a')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x096e('0x12')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x096e('0x2')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x096e('0x2')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x096e('0x2')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x096e('0x2')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x096e('0xc')](_0x096e('0x3b'),_0x096e('0x3c'),_0x096e('0x3d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x096e('0xc')](_0x096e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x096e('0x29'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x096e('0xc')](_0x096e('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x096e('0x2')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x096e('0x2')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x096e('0x2')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x096e('0xc')](_0x096e('0x29'),'no',_0x096e('0x2a'),_0x096e('0x2b'),_0x096e('0x3e')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x096e('0x15')]},'passwordResetAt':{'type':Sequelize[_0x096e('0x15')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x096e('0x3f')]},'showWebBar':{'type':Sequelize[_0x096e('0x12')],'defaultValue':0x0,'set':function(_0x3f07b4){this[_0x096e('0x4')](_0x096e('0x40'),_0x3f07b4);var _0x2ee64a=this[_0x096e('0x41')]({'plain':!![]});switch(_0x3f07b4){case 0x0:case 0x1:var _0x22c7a3=_0x2ee64a[_0x096e('0x23')]?_[_0x096e('0x42')](_0x2ee64a['transport'])?_0x2ee64a[_0x096e('0x23')][_0x096e('0x24')]():_0x2ee64a[_0x096e('0x23')]:_0x096e('0x22');if(_0x22c7a3===_0x096e('0x43')){_0x22c7a3=_0x096e('0x22');}this[_0x096e('0x4')]('transport',_0x22c7a3);this['setDataValue'](_0x096e('0x44'),'no');this[_0x096e('0x4')]('avpf',null);this[_0x096e('0x4')](_0x096e('0x45'),null);this[_0x096e('0x4')](_0x096e('0x46'),null);this[_0x096e('0x4')]('dtlsenable',null);this[_0x096e('0x4')](_0x096e('0x47'),null);this['setDataValue'](_0x096e('0x48'),null);this[_0x096e('0x4')]('dtlscertfile',null);this['setDataValue'](_0x096e('0x49'),null);this['setDataValue'](_0x096e('0x4a'),'no');break;case 0x2:this[_0x096e('0x4')](_0x096e('0x23'),_0x096e('0x43'));this[_0x096e('0x4')]('encryption','yes');this[_0x096e('0x4')](_0x096e('0x4b'),_0x096e('0x29'));this['setDataValue'](_0x096e('0x45'),'yes');this[_0x096e('0x4')](_0x096e('0x46'),_0x096e('0x29'));this['setDataValue'](_0x096e('0x4c'),_0x096e('0x29'));this['setDataValue'](_0x096e('0x47'),'no');this[_0x096e('0x4')](_0x096e('0x48'),'actpass');this[_0x096e('0x4')]('dtlscertfile',_0x2ee64a[_0x096e('0x4d')]||_0x096e('0x4e'));this[_0x096e('0x4')](_0x096e('0x49'),_0x2ee64a[_0x096e('0x49')]||_0x096e('0x4f'));this[_0x096e('0x4')](_0x096e('0x4a'),_0x096e('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0xc92565){this[_0x096e('0x4')](_0x096e('0x50'),_0xc92565?_0xc92565[_0x096e('0x24')](','):[]);},'get':function(){return this[_0x096e('0x8')](_0x096e('0x50'))?_[_0x096e('0x51')](this[_0x096e('0x8')](_0x096e('0x50'))[_0x096e('0x25')](','),function(_0x54223f){return parseInt(_0x54223f,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x096e('0x2')]},'phoneBarUnconditional':{'type':Sequelize[_0x096e('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x096e('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x096e('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x096e('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x096e('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x096e('0x12')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x096e('0x2')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x096e('0x12')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x096e('0xc')](_0x096e('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x096e('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x096e('0x2')]},'phoneBarEnableJaws':{'type':Sequelize[_0x096e('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x096e('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x096e('0x8')](_0x096e('0x52'))?this[_0x096e('0x8')](_0x096e('0x52')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x096e('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x096e('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x096e('0x16')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x096e('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x096e('0x2')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x096e('0x2')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x096e('0x16')],'defaultValue':![],'set':function(_0xe147d1){if(typeof _0xe147d1===_0x096e('0x53')){var _0x2e07fe=_0xe147d1==='1'?!![]:_0xe147d1==='0'?![]:_0xe147d1===_0x096e('0x54')?!![]:_0xe147d1==='false'?![]:![];this[_0x096e('0x4')](_0x096e('0x55'),_0x2e07fe);}else{this[_0x096e('0x4')]('screenrecording',_0xe147d1);}}},'blocked':{'type':Sequelize[_0x096e('0x16')],'defaultValue':![],'set':function(_0x4f7700){this['setDataValue'](_0x096e('0x56'),_0x4f7700);if(_0x4f7700===!![]){this[_0x096e('0x4')]('blockedAt',moment());this[_0x096e('0x4')](_0x096e('0x57'),0x0);}else{this['setDataValue'](_0x096e('0x58'),null);}}},'blockedAt':{'type':Sequelize[_0x096e('0x15')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x096e('0x12')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x096e('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x096e('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)[_0x096e('0x59')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x096e('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x096e('0x16')],'defaultValue':!![]}}; \ No newline at end of file +var _0x2ef3=['permissions','map','phoneBarEnableScreenRecordingByAgent','string','true','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','util','lodash','exports','STRING','setDataValue','defaultuser','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','admin','agent','accountcode','DATE','BOOLEAN','DEFAULT\x20PAUSE','INTEGER','dynamic','ENUM','user','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','transport','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','yes','nonat','update','nat','split','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','always','accept','refuse','originate','uac','uas','fingerprint','active','passive','actpass','TEXT','showWebBar','udp','wss','avpf','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','encryption','force_avp','/etc/pki/tls/private/motion.key'];(function(_0xc7ae8c,_0x44b3ef){var _0x1978e9=function(_0x925b92){while(--_0x925b92){_0xc7ae8c['push'](_0xc7ae8c['shift']());}};_0x1978e9(++_0x44b3ef);}(_0x2ef3,0xba));var _0x32ef=function(_0xa5bfa8,_0x56b1cb){_0xa5bfa8=_0xa5bfa8-0x0;var _0x1f044a=_0x2ef3[_0xa5bfa8];return _0x1f044a;};'use strict';var Sequelize=require(_0x32ef('0x0'));var moment=require(_0x32ef('0x1'));var util=require(_0x32ef('0x2'));var _=require(_0x32ef('0x3'));module[_0x32ef('0x4')]={'name':{'type':Sequelize[_0x32ef('0x5')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x38f865){this[_0x32ef('0x6')]('name',_0x38f865);this[_0x32ef('0x6')](_0x32ef('0x7'),_0x38f865);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x2c0089){this[_0x32ef('0x6')](_0x32ef('0x8'),_0x2c0089);this[_0x32ef('0x6')](_0x32ef('0x9'),util[_0x32ef('0xa')](_0x32ef('0xb'),_0x2c0089,this[_0x32ef('0xc')](_0x32ef('0xd'))));}},'alias':{'type':Sequelize[_0x32ef('0x5')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x401d0b){if(_0x401d0b){this[_0x32ef('0x6')](_0x32ef('0xe'),_0x401d0b[_0x32ef('0xf')]());}}},'role':{'type':Sequelize['ENUM'](_0x32ef('0x10'),'user',_0x32ef('0x11'),'telephone'),'allowNull':![]},'password':{'type':Sequelize[_0x32ef('0x5')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x32ef('0x5')],'defaultValue':'local'},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x32ef('0xd'),'set':function(_0x4d8009){this[_0x32ef('0x6')](_0x32ef('0xd'),_0x4d8009);this[_0x32ef('0x6')](_0x32ef('0x12'),_0x4d8009);this['setDataValue']('callerid',util['format'](_0x32ef('0xb'),this[_0x32ef('0xc')](_0x32ef('0x8')),_0x4d8009));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x32ef('0x5')]},'address':{'type':Sequelize[_0x32ef('0x5')]},'zipcode':{'type':Sequelize[_0x32ef('0x5')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x32ef('0x5')]},'country':{'type':Sequelize[_0x32ef('0x5')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x32ef('0x13')]},'voicePause':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0x32ef('0x15')},'lastPauseAt':{'type':Sequelize[_0x32ef('0x13')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x32ef('0x16')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x32ef('0x16')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x32ef('0x16')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x32ef('0x16')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x32ef('0x16')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':![]},'description':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'host':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![],'defaultValue':_0x32ef('0x17')},'ipaddr':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'port':{'type':Sequelize[_0x32ef('0x16')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x32ef('0x16')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x32ef('0x16')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x32ef('0x18')]('friend',_0x32ef('0x19'),_0x32ef('0x1a')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![],'defaultValue':_0x32ef('0x1b')},'callingpres':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x1c'),'ALLOWED_PASSED_SCREEN',_0x32ef('0x1d'),_0x32ef('0x1e'),_0x32ef('0x1f'),_0x32ef('0x20'),_0x32ef('0x21'),_0x32ef('0x22')),'allowNull':!![]},'deny':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'transport':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![],'defaultValue':'udp','set':function(_0xcc2efb){this[_0x32ef('0x6')](_0x32ef('0x23'),_0xcc2efb?_0xcc2efb[_0x32ef('0x24')](','):null);},'get':function(){return this[_0x32ef('0xc')]('transport')?this['getDataValue'](_0x32ef('0x23'))['split'](','):null;},'comment':_0x32ef('0x25')},'dtmfmode':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x26'),_0x32ef('0x27'),_0x32ef('0x28'),_0x32ef('0x29'),'auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0x32ef('0x2a'),'no',_0x32ef('0x2b'),_0x32ef('0x2c'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x32ef('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0xcbdec8){this[_0x32ef('0x6')](_0x32ef('0x2d'),_0xcbdec8?_0xcbdec8[_0x32ef('0x24')](','):null);},'get':function(){return this[_0x32ef('0xc')](_0x32ef('0x2d'))?this[_0x32ef('0xc')](_0x32ef('0x2d'))[_0x32ef('0x2e')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x32ef('0x5')]},'namedcallgroup':{'type':Sequelize[_0x32ef('0x5')]},'pickupgroup':{'type':Sequelize[_0x32ef('0x5')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x32ef('0x5')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x32ef('0x5')]},'disallow':{'type':Sequelize[_0x32ef('0x5')],'allowNull':![],'defaultValue':_0x32ef('0x2f')},'allow':{'type':Sequelize[_0x32ef('0x5')],'allowNull':![],'defaultValue':_0x32ef('0x30'),'set':function(_0x256c40){this[_0x32ef('0x6')](_0x32ef('0x31'),_0x256c40?_0x256c40[_0x32ef('0x24')](';'):_0x32ef('0x30'));},'get':function(){return this[_0x32ef('0xc')]('allow')?this[_0x32ef('0xc')](_0x32ef('0x31'))[_0x32ef('0x2e')](';'):null;},'comment':_0x32ef('0x32')},'autoframing':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x2a'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![],'set':function(_0x596d5a){this['setDataValue'](_0x32ef('0x33'),_0x596d5a?_0x596d5a[_0x32ef('0x24')](','):null);},'get':function(){return this[_0x32ef('0xc')](_0x32ef('0x33'))?this['getDataValue'](_0x32ef('0x33'))[_0x32ef('0x2e')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x32ef('0x18')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x2a'),'no',_0x32ef('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x2a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x32ef('0x16')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x2a'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x32ef('0x16')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x2a'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'template':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x2a'),'no',_0x32ef('0x35')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x32ef('0x16')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x2a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x36'),_0x32ef('0x37'),_0x32ef('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x32ef('0x16')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x39'),_0x32ef('0x3a')),'allowNull':!![],'defaultValue':_0x32ef('0x3a')},'t38pt_usertpsource':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x32ef('0x2a')},'keepalive':{'type':Sequelize[_0x32ef('0x16')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x32ef('0x16')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x32ef('0x16')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x32ef('0x16')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x32ef('0x16')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x32ef('0x16')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x32ef('0x16')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x32ef('0x16')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x32ef('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x2a'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x32ef('0x18')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x2a'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x32ef('0x18')]('yes','no',_0x32ef('0x3b'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x32ef('0x16')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x3c'),_0x32ef('0x3d'),_0x32ef('0x3e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x32ef('0x18')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x32ef('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x2a'),'no',_0x32ef('0x2b'),'update','update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x32ef('0x5')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x32ef('0x13')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x32ef('0x3f')]},'showWebBar':{'type':Sequelize[_0x32ef('0x16')],'defaultValue':0x0,'set':function(_0x49c245){this[_0x32ef('0x6')](_0x32ef('0x40'),_0x49c245);var _0x20dcc5=this['get']({'plain':!![]});switch(_0x49c245){case 0x0:case 0x1:var _0x5e6030=_0x20dcc5[_0x32ef('0x23')]?_['isArray'](_0x20dcc5[_0x32ef('0x23')])?_0x20dcc5['transport']['join']():_0x20dcc5[_0x32ef('0x23')]:_0x32ef('0x41');if(_0x5e6030===_0x32ef('0x42')){_0x5e6030='udp';}this[_0x32ef('0x6')](_0x32ef('0x23'),_0x5e6030);this[_0x32ef('0x6')]('encryption','no');this[_0x32ef('0x6')](_0x32ef('0x43'),null);this['setDataValue']('force_avp',null);this[_0x32ef('0x6')](_0x32ef('0x44'),null);this[_0x32ef('0x6')](_0x32ef('0x45'),null);this[_0x32ef('0x6')](_0x32ef('0x46'),null);this['setDataValue'](_0x32ef('0x47'),null);this[_0x32ef('0x6')](_0x32ef('0x48'),null);this[_0x32ef('0x6')](_0x32ef('0x49'),null);this[_0x32ef('0x6')](_0x32ef('0x4a'),'no');break;case 0x2:this[_0x32ef('0x6')](_0x32ef('0x23'),'wss');this[_0x32ef('0x6')](_0x32ef('0x4b'),_0x32ef('0x2a'));this[_0x32ef('0x6')](_0x32ef('0x43'),'yes');this['setDataValue'](_0x32ef('0x4c'),_0x32ef('0x2a'));this[_0x32ef('0x6')](_0x32ef('0x44'),_0x32ef('0x2a'));this['setDataValue'](_0x32ef('0x45'),'yes');this[_0x32ef('0x6')](_0x32ef('0x46'),'no');this['setDataValue']('dtlssetup',_0x32ef('0x3e'));this[_0x32ef('0x6')](_0x32ef('0x48'),_0x20dcc5['dtlscertfile']||'/etc/pki/tls/certs/motion.crt');this[_0x32ef('0x6')](_0x32ef('0x49'),_0x20dcc5[_0x32ef('0x49')]||_0x32ef('0x4d'));this['setDataValue'](_0x32ef('0x4a'),_0x32ef('0x2a'));break;default:}}},'permissions':{'type':Sequelize[_0x32ef('0x3f')],'set':function(_0xd7a78){this[_0x32ef('0x6')](_0x32ef('0x4e'),_0xd7a78?_0xd7a78[_0x32ef('0x24')](','):[]);},'get':function(){return this[_0x32ef('0xc')](_0x32ef('0x4e'))?_[_0x32ef('0x4f')](this[_0x32ef('0xc')](_0x32ef('0x4e'))['split'](','),function(_0x4ab179){return parseInt(_0x4ab179,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x32ef('0x5')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x32ef('0x5')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x32ef('0x16')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x32ef('0x16')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x32ef('0x18')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x32ef('0x5')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x32ef('0xc')](_0x32ef('0x50'))?this[_0x32ef('0xc')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':![],'set':function(_0x339184){if(typeof _0x339184===_0x32ef('0x51')){var _0x51a34d=_0x339184==='1'?!![]:_0x339184==='0'?![]:_0x339184===_0x32ef('0x52')?!![]:_0x339184==='false'?![]:![];this['setDataValue'](_0x32ef('0x53'),_0x51a34d);}else{this['setDataValue'](_0x32ef('0x53'),_0x339184);}}},'blocked':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':![],'set':function(_0x4d64ec){this[_0x32ef('0x6')](_0x32ef('0x54'),_0x4d64ec);if(_0x4d64ec===!![]){this[_0x32ef('0x6')](_0x32ef('0x55'),moment());this[_0x32ef('0x6')](_0x32ef('0x56'),0x0);}else{this['setDataValue']('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x32ef('0x13')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x32ef('0x16')](0x5)[_0x32ef('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 078ba66..2fb9e0d 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 _0x8e3f=['Queue','pick','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','ScreenRecording','UserId','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','MailInteraction','getSmsInteractions','FaxInteraction','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','phone','intrf','user:%s','user:forcelogout','x-forwarded-for','connection','socket','remoteAddress','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','LOGIN','device','PAUSE','LOGININPAUSE','concat','isMiddleware','resolve','logout','pause','QueuePause','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','faxPause','smsPause','whatsapppause','pauseType','manual','%s%s','getTeams','Team','addTeams','setDataValue','Voice','getChatQueues','Chat','getMailQueues','getSmsQueues','Sms','Whatsapp','Fax','getOpenchannelQueues','Openchannel','getDataValue','Queue:save','UserVoicePrefix','VoicePrefixId','removeTeams','Mail','getFaxQueues','flatten','transaction','TeamVoicePrefix','getLists','CmList','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','FaxAccount','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$gt','$gte','$ne','$eq','$not','$notBetween','$in','$notIn','$notLike','$iLike','$like','$overlap','$contains','$contained','$any','firstName','lastName','Contact','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','removeApiKey','apiKeyNonce','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','teams','queues','inbound','toString','asc','desc','substring','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','ringing','voiceStatus','slice','charAt','toUpperCase','ui.','InteractionId','field','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','bluebird','util','lodash','squel','jayson/promise','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','socket.io-emitter','redis','./user.socket','register','defaults','localhost','client','http','request','then','info','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','User,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','update','destroy','get','role','admin','Users','Agents','agent','filter','map','value','includes','find','name','UserProfileResource','stack','send','index','User','rawAttributes','type','key','password','salt','query','includeAll','include','attributes','push','findAll','rows','length','chat','dataValues','fax','openchannel','show','params','model','differenceBy','keys','filters','intersection','fields','merge','openTabs','mail','body','describe','addContacts','ids','omit','Setting','findById','securePassword','validatePasswordPattern','max','internal','isNil','min_internal','sequelize','QueryTypes','SELECT','from','voicemail','mailbox','fullname','permissions','101','102','103','113','110','104','105','106','108','109','100','111','create','user','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','VoiceMail','UserProfileSection','Telephones','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\x20administrator','all','each','isEmpty','telephone','compact','oldPassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','updatePasswordsHistory','addQueues','channel','online','loginInPause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','spread','QueueId','voice','VoiceQueue','format','SIP/%s','voicePause','penalty','UserVoiceQueueRt','upsert','removeQueues','remove','isArray','emit','Queue:remove','userpic','file','filename','getAvatar','join','server/files/images/logos/default_profile.png','download','root','server/files/images/','getOpenTabs','sms','whatsapp','ChatOpenTabs','CHAT','createdAt','FAX','OpenchannelOpenTabs','MailOpenTabs','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','getContacts','CmContact','order','sort','where','options','List','Tag','Tags','color','tag','hasOwnProperty','nolimit','getQueues'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x8e3f[_0x59ee6f];return _0x4c0979;};'use strict';var moment=require(_0xf8e3('0x0'));var BPromise=require(_0xf8e3('0x1'));var util=require(_0xf8e3('0x2'));var path=require('path');var fs=require('fs');var _=require(_0xf8e3('0x3'));var squel=require(_0xf8e3('0x4'));var jayson=require(_0xf8e3('0x5'));var Redis=require('ioredis');var authService=require(_0xf8e3('0x6'));var qs=require(_0xf8e3('0x7'));var logger=require('../../config/logger')(_0xf8e3('0x8'));var utils=require(_0xf8e3('0x9'));var config=require(_0xf8e3('0xa'));var licenseUtil=require(_0xf8e3('0xb'));var db=require('../../mysqldb')['db'];var socket=require(_0xf8e3('0xc'))(new Redis(config[_0xf8e3('0xd')]));require(_0xf8e3('0xe'))[_0xf8e3('0xf')](socket);config[_0xf8e3('0xd')]=_[_0xf8e3('0x10')](config[_0xf8e3('0xd')],{'host':_0xf8e3('0x11'),'port':0x18eb});var client=jayson[_0xf8e3('0x12')][_0xf8e3('0x13')]({'port':0x232a});var values;function respondWithRpcPromise(_0x28f5f0,_0xe584cd,_0x5e4b87,_0xb7d14f){return new BPromise(function(_0x1e6d9c,_0x3b6ac6){var _0x4888eb=_0xb7d14f||client;return _0x4888eb[_0xf8e3('0x14')](_0x28f5f0,_0x5e4b87)[_0xf8e3('0x15')](function(_0x336790){logger[_0xf8e3('0x16')]('User,\x20%s,\x20%s',_0xe584cd,_0xf8e3('0x17'));logger[_0xf8e3('0x18')](_0xf8e3('0x19'),_0xe584cd,'request\x20sent',JSON[_0xf8e3('0x1a')](_0x336790));if(_0x336790['error']){if(_0x336790[_0xf8e3('0x1b')][_0xf8e3('0x1c')]===0x1f4){logger[_0xf8e3('0x1b')]('User,\x20%s,\x20%s',_0xe584cd,_0x336790['error'][_0xf8e3('0x1d')]);return _0x3b6ac6(_0x336790[_0xf8e3('0x1b')][_0xf8e3('0x1d')]);}logger[_0xf8e3('0x1b')](_0xf8e3('0x1e'),_0xe584cd,_0x336790[_0xf8e3('0x1b')][_0xf8e3('0x1d')]);return _0x1e6d9c(_0x336790[_0xf8e3('0x1b')][_0xf8e3('0x1d')]);}else{logger[_0xf8e3('0x16')]('User,\x20%s,\x20%s',_0xe584cd,_0xf8e3('0x17'));_0x1e6d9c(_0x336790[_0xf8e3('0x1f')][_0xf8e3('0x1d')]);}})[_0xf8e3('0x20')](function(_0x3128ad){logger[_0xf8e3('0x1b')](_0xf8e3('0x1e'),_0xe584cd,_0x3128ad);_0x3b6ac6(_0x3128ad);});});}function respondWithStatusCode(_0x3fff85,_0x5b99b1){_0x5b99b1=_0x5b99b1||0xcc;return function(_0xe5102b){if(_0xe5102b){return _0x3fff85[_0xf8e3('0x21')](_0x5b99b1);}return _0x3fff85[_0xf8e3('0x22')](_0x5b99b1)[_0xf8e3('0x23')]();};}function respondWithResult(_0x4a1e5f,_0x39df34){_0x39df34=_0x39df34||0xc8;return function(_0x4b3705){if(_0x4b3705){return _0x4a1e5f[_0xf8e3('0x22')](_0x39df34)[_0xf8e3('0x24')](_0x4b3705);}};}function respondWithFilteredResult(_0x33d526,_0x2dc856){return function(_0x1f4b68){if(_0x1f4b68){var _0x3ac384=typeof _0x2dc856['offset']===_0xf8e3('0x25')&&typeof _0x2dc856[_0xf8e3('0x26')]===_0xf8e3('0x25');var _0x417b42=_0x1f4b68[_0xf8e3('0x27')];var _0x3b41a1=_0x3ac384?0x0:_0x2dc856[_0xf8e3('0x28')];var _0x157a2d=_0x3ac384?_0x1f4b68['count']:_0x2dc856[_0xf8e3('0x28')]+_0x2dc856[_0xf8e3('0x26')];var _0x12ebd2;if(_0x157a2d>=_0x417b42){_0x157a2d=_0x417b42;_0x12ebd2=0xc8;}else{_0x12ebd2=0xce;}_0x33d526[_0xf8e3('0x22')](_0x12ebd2);return _0x33d526[_0xf8e3('0x29')](_0xf8e3('0x2a'),_0x3b41a1+'-'+_0x157a2d+'/'+_0x417b42)[_0xf8e3('0x24')](_0x1f4b68);}return null;};}function saveUpdates(_0xfaf15d){return function(_0x4f2ae9){if(_0x4f2ae9){return _0x4f2ae9[_0xf8e3('0x2b')](_0xfaf15d)[_0xf8e3('0x15')](function(_0x492694){return _0x492694;});}return null;};}function removeEntity(_0x28b2f2){return function(_0x567153){if(_0x567153){return _0x567153[_0xf8e3('0x2c')]()[_0xf8e3('0x15')](function(){var _0x40f64d=_0x567153[_0xf8e3('0x2d')]({'plain':!![]});if(_0x40f64d[_0xf8e3('0x2e')]===_0xf8e3('0x2f'))return;var _0xb9c26=[{'name':_0xf8e3('0x30'),'value':'user','ignore':!![]},{'name':_0xf8e3('0x31'),'value':_0xf8e3('0x32'),'ignore':![]},{'name':'Telephones','value':'telephone','ignore':![]}];var _0x5cc1ed=_(_0xb9c26)[_0xf8e3('0x33')]('ignore')[_0xf8e3('0x34')](_0xf8e3('0x35'))[_0xf8e3('0x35')]();if(_[_0xf8e3('0x36')](_0x5cc1ed,_0x40f64d['role'])){return;}var _0x581a97=_[_0xf8e3('0x37')](_0xb9c26,[_0xf8e3('0x35'),_0x40f64d[_0xf8e3('0x2e')]])[_0xf8e3('0x38')];return db[_0xf8e3('0x39')][_0xf8e3('0x2c')]({'where':{'type':_0x581a97,'resourceId':_0x40f64d['id']}})['then'](function(){return _0x567153;});})[_0xf8e3('0x15')](function(){_0x28b2f2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1eaa03){return function(_0x1e8878){if(!_0x1e8878){_0x1eaa03[_0xf8e3('0x21')](0x194);}return _0x1e8878;};}function handleError(_0x1b7af2,_0x4cb46a){_0x4cb46a=_0x4cb46a||0x1f4;return function(_0x5ece46){logger[_0xf8e3('0x1b')](_0x5ece46[_0xf8e3('0x3a')]);if(_0x5ece46['name']){delete _0x5ece46[_0xf8e3('0x38')];}_0x1b7af2[_0xf8e3('0x22')](_0x4cb46a)[_0xf8e3('0x3b')](_0x5ece46);};}exports[_0xf8e3('0x3c')]=function(_0x547f53,_0x53cfea){var _0x5d307e={},_0x22b65e={'count':0x0,'rows':[]};var _0xcd2ffe=_(db[_0xf8e3('0x3d')][_0xf8e3('0x3e')])['map'](function(_0xee2e34){return{'name':_0xee2e34['fieldName'],'type':_0xee2e34[_0xf8e3('0x3f')][_0xf8e3('0x40')]};})[_0xf8e3('0x33')](function(_0x10e225){return!_[_0xf8e3('0x36')]([_0xf8e3('0x41'),_0xf8e3('0x42')],_0x10e225[_0xf8e3('0x38')]);})[_0xf8e3('0x35')]();_0x5d307e=qs['getOptions'](_0xcd2ffe,_0x547f53);var _0x211620={'where':_0x5d307e['where']};return db[_0xf8e3('0x3d')][_0xf8e3('0x27')](_0x211620)[_0xf8e3('0x15')](function(_0x9a6b37){_0x22b65e[_0xf8e3('0x27')]=_0x9a6b37;if(_0x547f53[_0xf8e3('0x43')][_0xf8e3('0x44')]){_0x5d307e[_0xf8e3('0x45')]=[{'all':!![]}];}if(!_['includes'](_0x5d307e[_0xf8e3('0x46')],'id')){_0x5d307e[_0xf8e3('0x46')][_0xf8e3('0x47')]('id');}return db[_0xf8e3('0x3d')][_0xf8e3('0x48')](_0x5d307e);})[_0xf8e3('0x15')](function(_0x792190){_0x22b65e[_0xf8e3('0x49')]=_0x792190;if(_0x547f53['query']['openTabs']==='true'){var _0x30fecf=[];for(var _0x3d3ea5=0x0;_0x3d3ea5<_0x22b65e['rows'][_0xf8e3('0x4a')];_0x3d3ea5++){_0x30fecf['push'](get_open_tabs(_0xf8e3('0x4b'),_0x22b65e[_0xf8e3('0x49')][_0x3d3ea5]['dataValues']));_0x30fecf[_0xf8e3('0x47')](get_open_tabs('sms',_0x22b65e[_0xf8e3('0x49')][_0x3d3ea5][_0xf8e3('0x4c')]));_0x30fecf['push'](get_open_tabs(_0xf8e3('0x4d'),_0x22b65e[_0xf8e3('0x49')][_0x3d3ea5][_0xf8e3('0x4c')]));_0x30fecf[_0xf8e3('0x47')](get_open_tabs('mail',_0x22b65e['rows'][_0x3d3ea5]['dataValues']));_0x30fecf[_0xf8e3('0x47')](get_open_tabs(_0xf8e3('0x4e'),_0x22b65e[_0xf8e3('0x49')][_0x3d3ea5]['dataValues']));_0x30fecf[_0xf8e3('0x47')](get_open_tabs('whatsapp',_0x22b65e[_0xf8e3('0x49')][_0x3d3ea5][_0xf8e3('0x4c')]));}return BPromise['all'](_0x30fecf)['then'](function(_0x128234){return _0x22b65e;});}else{return _0x22b65e;}})[_0xf8e3('0x15')](respondWithFilteredResult(_0x53cfea,_0x5d307e))[_0xf8e3('0x20')](handleError(_0x53cfea,null));};exports[_0xf8e3('0x4f')]=function(_0x3b790f,_0x1fc2a6){var _0x3b56ed={'raw':![],'where':{'id':_0x3b790f[_0xf8e3('0x50')]['id']}},_0x2a58e2={};_0x2a58e2[_0xf8e3('0x51')]=_[_0xf8e3('0x52')](_['keys'](db[_0xf8e3('0x3d')][_0xf8e3('0x3e')]),[_0xf8e3('0x41'),_0xf8e3('0x42')]);_0x2a58e2[_0xf8e3('0x43')]=_[_0xf8e3('0x53')](_0x3b790f['query']);_0x2a58e2[_0xf8e3('0x54')]=_[_0xf8e3('0x55')](_0x2a58e2[_0xf8e3('0x51')],_0x2a58e2[_0xf8e3('0x43')]);_0x3b56ed[_0xf8e3('0x46')]=_[_0xf8e3('0x55')](_0x2a58e2['model'],qs[_0xf8e3('0x56')](_0x3b790f[_0xf8e3('0x43')][_0xf8e3('0x56')]));_0x3b56ed[_0xf8e3('0x46')]=_0x3b56ed[_0xf8e3('0x46')][_0xf8e3('0x4a')]?_0x3b56ed['attributes']:_0x2a58e2[_0xf8e3('0x51')];if(_0x3b790f[_0xf8e3('0x43')][_0xf8e3('0x44')]){_0x3b56ed[_0xf8e3('0x45')]=[{'all':!![]}];}_0x3b56ed=_[_0xf8e3('0x57')]({},_0x3b56ed,_0x3b790f['options']);if(!_[_0xf8e3('0x36')](_0x3b56ed[_0xf8e3('0x46')],'id')){_0x3b56ed[_0xf8e3('0x46')]['push']('id');}return db['User'][_0xf8e3('0x37')](_0x3b56ed)[_0xf8e3('0x15')](handleEntityNotFound(_0x1fc2a6,null))[_0xf8e3('0x15')](function(_0x3ad7f1){var _0x58ad2f=[];values=_0x3ad7f1;if(_0x3b790f[_0xf8e3('0x43')][_0xf8e3('0x58')]==='true'){_0x58ad2f['push'](get_open_tabs(_0xf8e3('0x4b'),_0x3ad7f1[_0xf8e3('0x4c')]));_0x58ad2f[_0xf8e3('0x47')](get_open_tabs('sms',_0x3ad7f1['dataValues']));_0x58ad2f['push'](get_open_tabs(_0xf8e3('0x4e'),_0x3ad7f1[_0xf8e3('0x4c')]));_0x58ad2f['push'](get_open_tabs('whatsapp',_0x3ad7f1['dataValues']));_0x58ad2f[_0xf8e3('0x47')](get_open_tabs(_0xf8e3('0x4d'),_0x3ad7f1['dataValues']));_0x58ad2f[_0xf8e3('0x47')](get_open_tabs(_0xf8e3('0x59'),_0x3ad7f1[_0xf8e3('0x4c')]));return BPromise['all'](_0x58ad2f);}else{return values;}})['then'](function(_0x524fbc){return values;})['then'](respondWithResult(_0x1fc2a6,null))[_0xf8e3('0x20')](handleError(_0x1fc2a6,null));};exports[_0xf8e3('0x2b')]=function(_0x3ef144,_0x447efe){if(_0x3ef144[_0xf8e3('0x5a')]['id']){delete _0x3ef144[_0xf8e3('0x5a')]['id'];}delete _0x3ef144[_0xf8e3('0x5a')][_0xf8e3('0x2e')];return db[_0xf8e3('0x3d')]['find']({'where':{'id':_0x3ef144['params']['id']}})[_0xf8e3('0x15')](handleEntityNotFound(_0x447efe,null))[_0xf8e3('0x15')](saveUpdates(_0x3ef144[_0xf8e3('0x5a')],null))['then'](respondWithResult(_0x447efe,null))[_0xf8e3('0x20')](handleError(_0x447efe,null));};exports[_0xf8e3('0x5b')]=function(_0x4879c7,_0x48bb3f){return db[_0xf8e3('0x3d')][_0xf8e3('0x5b')]()[_0xf8e3('0x15')](respondWithResult(_0x48bb3f,null))[_0xf8e3('0x20')](handleError(_0x48bb3f,null));};exports['addContacts']=function(_0x5bd7bf,_0x37751e){return db[_0xf8e3('0x3d')][_0xf8e3('0x37')]({'where':{'id':_0x5bd7bf[_0xf8e3('0x50')]['id']}})['then'](handleEntityNotFound(_0x37751e,null))['then'](function(_0x324ad5){if(_0x324ad5){return _0x324ad5[_0xf8e3('0x5c')](_0x5bd7bf['body'][_0xf8e3('0x5d')],_[_0xf8e3('0x5e')](_0x5bd7bf[_0xf8e3('0x5a')],[_0xf8e3('0x5d'),'id'])||{});}})['then'](respondWithResult(_0x37751e,null))[_0xf8e3('0x20')](handleError(_0x37751e,null));};function validateUser(_0x5d2ecf){return new BPromise(function(_0x217979,_0x1cad38){if(_0x5d2ecf['internal'])return _0x217979(_0x5d2ecf);return db[_0xf8e3('0x5f')][_0xf8e3('0x60')](0x1)['then'](function(_0x232d83){if(_0x232d83[_0xf8e3('0x61')])authService[_0xf8e3('0x62')](_0x5d2ecf[_0xf8e3('0x41')]);db['User'][_0xf8e3('0x63')](_0xf8e3('0x64'))[_0xf8e3('0x15')](function(_0x3c214f){if(_[_0xf8e3('0x65')](_0x3c214f)){_0x5d2ecf[_0xf8e3('0x64')]=_0x232d83[_0xf8e3('0x66')]||0x1;return;}if(_[_0xf8e3('0x65')](_0x232d83[_0xf8e3('0x66')])||_0x232d83[_0xf8e3('0x66')]===_0x3c214f){_0x5d2ecf[_0xf8e3('0x64')]=_0x3c214f+0x1;return;}if(_0x232d83[_0xf8e3('0x66')]>_0x3c214f){_0x5d2ecf['internal']=_0x232d83['min_internal'];return;}return db[_0xf8e3('0x67')][_0xf8e3('0x43')]('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[_0xf8e3('0x67')][_0xf8e3('0x68')][_0xf8e3('0x69')]})[_0xf8e3('0x15')](function(_0x18a810){if(_0x18a810&&_0x18a810['length']){for(var _0x3e501c=0x0,_0x1dcd23=_0x18a810['length'];_0x3e501c<_0x1dcd23&&_[_0xf8e3('0x65')](_0x5d2ecf['internal']);_0x3e501c++){if(_0x232d83[_0xf8e3('0x66')]<=_0x18a810[_0x3e501c]['from']){_0x5d2ecf[_0xf8e3('0x64')]=_0x18a810[_0x3e501c][_0xf8e3('0x6a')];}else if(_0x232d83[_0xf8e3('0x66')]>_0x18a810[_0x3e501c][_0xf8e3('0x6a')]&&_0x232d83[_0xf8e3('0x66')]<=_0x18a810[_0x3e501c]['to']){_0x5d2ecf['internal']=_0x232d83[_0xf8e3('0x66')];}}}if(_[_0xf8e3('0x65')](_0x5d2ecf[_0xf8e3('0x64')])){_0x5d2ecf[_0xf8e3('0x64')]=_0x3c214f+0x1;}return _0x217979(_0x5d2ecf);});});})[_0xf8e3('0x20')](function(_0x3852d1){_0x1cad38(_0x3852d1);});});}function updateUser(_0x459562){return new BPromise(function(_0x2ccd34,_0x3ddc19){try{if(_0x459562[_0xf8e3('0x6b')]){_0x459562[_0xf8e3('0x6c')]=_0x459562[_0xf8e3('0x64')];_0x459562['VoiceMail']={'mailbox':_0x459562[_0xf8e3('0x64')],'password':_0x459562[_0xf8e3('0x41')],'fullname':_0x459562[_0xf8e3('0x6d')],'email':_0x459562['email']};}if(_0x459562[_0xf8e3('0x2e')]===_0xf8e3('0x32')){if(!_0x459562[_0xf8e3('0x6e')])_0x459562[_0xf8e3('0x6e')]=[_0xf8e3('0x6f'),_0xf8e3('0x70'),_0xf8e3('0x71'),_0xf8e3('0x72'),_0xf8e3('0x73'),_0xf8e3('0x74'),_0xf8e3('0x75'),_0xf8e3('0x76'),'107',_0xf8e3('0x77'),_0xf8e3('0x78'),_0xf8e3('0x79'),_0xf8e3('0x7a'),'114','115'];}_0x2ccd34(_0x459562);}catch(_0x11aa1d){_0x3ddc19(_0x11aa1d);}});}exports[_0xf8e3('0x7b')]=function(_0x4c8707,_0x5bedc7){if(_0x4c8707[_0xf8e3('0x7c')][_0xf8e3('0x2e')]==='agent')throw new Error(_0xf8e3('0x7d'));if(_0x4c8707[_0xf8e3('0x5a')][_0xf8e3('0x2e')]===_0xf8e3('0x7c')&&_0x4c8707[_0xf8e3('0x7c')]['role']!==_0xf8e3('0x2f')){throw new Error(_0xf8e3('0x7e'));}if(_0x4c8707['body']['role']===_0xf8e3('0x2f')&&_0x4c8707[_0xf8e3('0x7c')][_0xf8e3('0x2e')]!==_0xf8e3('0x2f')){throw new Error(_0xf8e3('0x7f'));}return licenseUtil[_0xf8e3('0x80')]([_0x4c8707[_0xf8e3('0x5a')]])[_0xf8e3('0x15')](function(){return validateUser(_0x4c8707['body']);})[_0xf8e3('0x15')](function(_0x2c9a8e){return updateUser(_0x2c9a8e)[_0xf8e3('0x15')](function(_0x16f087){if(_0x16f087[_0xf8e3('0x2e')]===_0xf8e3('0x2f')){_0x16f087['settingsEnabled']=_0x4c8707[_0xf8e3('0x7c')][_0xf8e3('0x81')];delete _0x16f087[_0xf8e3('0x82')];}return _0x16f087;});})['then'](function(_0x47a748){return db[_0xf8e3('0x3d')][_0xf8e3('0x7b')](_0x47a748,{'include':[{'model':db[_0xf8e3('0x83')],'as':_0xf8e3('0x83')}]});})[_0xf8e3('0x15')](function(_0x5b8840){if(_0x4c8707[_0xf8e3('0x5a')][_0xf8e3('0x2e')]===_0xf8e3('0x7c'))return _0x5b8840;if(_0x4c8707[_0xf8e3('0x7c')][_0xf8e3('0x2e')]!==_0xf8e3('0x7c'))return _0x5b8840;return db[_0xf8e3('0x84')][_0xf8e3('0x37')]({'where':{'name':_0x5b8840[_0xf8e3('0x2e')]==='agent'?_0xf8e3('0x31'):_0xf8e3('0x85'),'userProfileId':_0x4c8707[_0xf8e3('0x7c')][_0xf8e3('0x82')]},'raw':!![]})[_0xf8e3('0x15')](function(_0xb2f16e){if(!_0xb2f16e||_0xb2f16e[_0xf8e3('0x86')]!=0x0)return _0x5b8840;return db['UserProfileResource']['create']({'name':_0x5b8840[_0xf8e3('0x38')],'resourceId':_0x5b8840['id'],'type':_0xb2f16e[_0xf8e3('0x38')],'sectionId':_0xb2f16e['id']},{})['then'](function(){return _0x5b8840;});})[_0xf8e3('0x20')](function(_0x2412f9){logger[_0xf8e3('0x1b')](_0xf8e3('0x87'),_0x2412f9);throw _0x2412f9;});})[_0xf8e3('0x15')](respondWithResult(_0x5bedc7,0xc9))[_0xf8e3('0x20')](handleError(_0x5bedc7,null));};exports[_0xf8e3('0x88')]=function(_0x4b5a1f,_0xddfaee){var _0x2121f3=_0x4b5a1f[_0xf8e3('0x5a')];var _0xc8c987=[];if(_0x4b5a1f[_0xf8e3('0x7c')][_0xf8e3('0x2e')]===_0xf8e3('0x32'))throw new Error(_0xf8e3('0x7d'));if(_[_0xf8e3('0x89')](_0x2121f3,[_0xf8e3('0x2e'),_0xf8e3('0x7c')])&&_0x4b5a1f['user']['role']!==_0xf8e3('0x2f')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0xf8e3('0x89')](_0x2121f3,['role',_0xf8e3('0x2f')])&&_0x4b5a1f[_0xf8e3('0x7c')][_0xf8e3('0x2e')]!=='admin'){throw new Error(_0xf8e3('0x8a'));}return licenseUtil[_0xf8e3('0x80')](_0x2121f3)[_0xf8e3('0x15')](function(){return validateUser(_0x2121f3[0x0]);})[_0xf8e3('0x15')](function(){for(var _0x3619cd=0x1;_0x3619cd<_0x2121f3['length'];_0x3619cd++){var _0xec1ff5=_0x2121f3[_0x3619cd-0x1]['internal'];if(!_0x2121f3[_0x3619cd][_0xf8e3('0x64')])_0x2121f3[_0x3619cd][_0xf8e3('0x64')]=_0xec1ff5+0x1;_0xc8c987[_0xf8e3('0x47')](validateUser(_0x2121f3[_0x3619cd]));}return BPromise[_0xf8e3('0x8b')](_0xc8c987);})[_0xf8e3('0x15')](function(){_0xc8c987=[];for(var _0x3243b5=0x0;_0x3243b5<_0x2121f3[_0xf8e3('0x4a')];_0x3243b5++){_0xc8c987['push'](updateUser(_0x2121f3[_0x3243b5]));}return BPromise[_0xf8e3('0x8b')](_0xc8c987);})[_0xf8e3('0x15')](function(){return BPromise[_0xf8e3('0x8c')](_0x2121f3,function(_0x1a9ba6){return db['User'][_0xf8e3('0x7b')](_0x1a9ba6,{'include':[{'model':db[_0xf8e3('0x83')],'as':_0xf8e3('0x83')}]})[_0xf8e3('0x15')](function(_0x22fa2f){_0x1a9ba6['id']=_0x22fa2f['id'];return _0x1a9ba6;});});})[_0xf8e3('0x15')](function(_0x477589){if(_0x4b5a1f[_0xf8e3('0x5a')]['role']==='user')return _0x477589;if(_0x4b5a1f[_0xf8e3('0x7c')][_0xf8e3('0x2e')]!==_0xf8e3('0x7c'))return _0x477589;var _0x161347=_[_0xf8e3('0x89')](_0x477589,function(_0x12bc5b){return _0x12bc5b[_0xf8e3('0x2e')]==='agent'||_0x12bc5b[_0xf8e3('0x2e')]==='telephone';});if(!_0x161347)return _0x477589;return db[_0xf8e3('0x84')][_0xf8e3('0x48')]({'where':{'name':{'$or':[_0xf8e3('0x31'),_0xf8e3('0x85')]},'userProfileId':_0x4b5a1f['user'][_0xf8e3('0x82')]},'raw':!![]})['then'](function(_0x567d66){if(_[_0xf8e3('0x8d')](_0x567d66)||!_[_0xf8e3('0x89')](_0x567d66,[_0xf8e3('0x86'),0x0]))return _0x477589;_0xc8c987=[];var _0x2db4e4=_(_0x567d66)['map'](function(_0x4e7821){if(_0x4e7821[_0xf8e3('0x86')]===0x1)return;return _0x4e7821[_0xf8e3('0x38')]==='Agents'?'agent':_0xf8e3('0x8e');})[_0xf8e3('0x8f')]()['value']();for(var _0x1844da=0x0;_0x1844da<_0x477589[_0xf8e3('0x4a')];_0x1844da++){if(!_[_0xf8e3('0x36')](_0x2db4e4,_0x477589[_0x1844da][_0xf8e3('0x2e')]))return;var _0x1bae38=_0x477589[_0x1844da][_0xf8e3('0x2e')]===_0xf8e3('0x32')?'Agents':_0xf8e3('0x85');_0xc8c987[_0xf8e3('0x47')](db['UserProfileResource'][_0xf8e3('0x7b')]({'name':_0x477589[_0x1844da]['name'],'resourceId':_0x477589[_0x1844da]['id'],'type':_0x1bae38,'sectionId':_[_0xf8e3('0x37')](_0x567d66,[_0xf8e3('0x38'),_0x1bae38])['id']},{}));}return BPromise[_0xf8e3('0x8b')](_0xc8c987);});})['then'](respondWithResult(_0xddfaee,0xc9))[_0xf8e3('0x20')](handleError(_0xddfaee,null));};exports['changePassword']=function(_0x153c80,_0x41ca1b){if(_0x153c80[_0xf8e3('0x5a')]['id']){delete _0x153c80[_0xf8e3('0x5a')]['id'];}return db['User']['find']({'where':{'id':_0x153c80[_0xf8e3('0x50')]['id']}})[_0xf8e3('0x15')](function(_0x268855){if(!_0x268855)return null;if(_0x268855['id']===_0x153c80[_0xf8e3('0x7c')]['id']){if(!_0x153c80[_0xf8e3('0x5a')][_0xf8e3('0x90')]||!_0x153c80['body'][_0xf8e3('0x91')]){throw new db[(_0xf8e3('0x92'))][(_0xf8e3('0x93'))](_0xf8e3('0x94'));}if(!_0x268855['authenticate'](_0x153c80[_0xf8e3('0x5a')]['oldPassword'])){throw new db[(_0xf8e3('0x92'))][(_0xf8e3('0x93'))]('Wrong\x20credentials');}if(_0x153c80[_0xf8e3('0x5a')]['oldPassword']===_0x153c80[_0xf8e3('0x5a')][_0xf8e3('0x91')]){throw new db['Sequelize'][(_0xf8e3('0x93'))](_0xf8e3('0x95'));}}else if(_0x153c80['user'][_0xf8e3('0x2e')]===_0xf8e3('0x2f')){if(!_0x153c80[_0xf8e3('0x5a')][_0xf8e3('0x91')]){throw new db[(_0xf8e3('0x92'))][(_0xf8e3('0x93'))](_0xf8e3('0x96'));}}else if(_0x153c80[_0xf8e3('0x7c')][_0xf8e3('0x2e')]===_0xf8e3('0x7c')){if(!_0x153c80[_0xf8e3('0x5a')][_0xf8e3('0x91')]){throw new db['Sequelize'][(_0xf8e3('0x93'))](_0xf8e3('0x96'));}if(_0x268855[_0xf8e3('0x2e')]!=='agent'){throw new db[(_0xf8e3('0x92'))][(_0xf8e3('0x93'))](_0xf8e3('0x7d'));}}else{throw new db[(_0xf8e3('0x92'))][(_0xf8e3('0x93'))](_0xf8e3('0x7d'));}return _0x268855;})[_0xf8e3('0x15')](handleEntityNotFound(_0x41ca1b,null))['then'](function(_0x513b90){return db[_0xf8e3('0x5f')][_0xf8e3('0x97')]({'attributes':['id','securePassword',_0xf8e3('0x98'),_0xf8e3('0x99')]})['then'](function(_0x45919d){if(_0x45919d[_0xf8e3('0x61')])authService[_0xf8e3('0x62')](_0x153c80[_0xf8e3('0x5a')][_0xf8e3('0x91')]);if(!_0x45919d['enforcePasswordHistory']||!_0x513b90[_0xf8e3('0x9a')])return _0x513b90;authService[_0xf8e3('0x9b')](_0x153c80['body'][_0xf8e3('0x91')],_0x513b90[_0xf8e3('0x9a')],_0x45919d[_0xf8e3('0x99')]);return _0x513b90;})[_0xf8e3('0x15')](saveUpdates({'password':_0x153c80[_0xf8e3('0x5a')][_0xf8e3('0x91')],'passwordResetAt':_0x153c80[_0xf8e3('0x7c')]['id']==_0x153c80['params']['id']?moment():null,'previousPasswords':authService[_0xf8e3('0x9c')](_0x153c80[_0xf8e3('0x5a')]['newPassword'],_0x513b90['previousPasswords'])},null));})['then'](respondWithResult(_0x41ca1b,null))[_0xf8e3('0x20')](handleError(_0x41ca1b,null));};exports[_0xf8e3('0x9d')]=function(_0x417af2,_0x29f5d0){var _0x4622b1=_0x417af2[_0xf8e3('0x5a')][_0xf8e3('0x9e')];return db['User']['find']({'where':{'id':_0x417af2[_0xf8e3('0x50')]['id']},'attributes':['id','name','role',_0xf8e3('0x9f'),_0xf8e3('0xa0'),'voicePause',_0xf8e3('0xa1')]})[_0xf8e3('0x15')](handleEntityNotFound(_0x29f5d0,null))[_0xf8e3('0x15')](function(_0x2c4060){if(_0x2c4060){if(!utils[_0xf8e3('0xa2')](_0x4622b1)){throw new db[(_0xf8e3('0x92'))][(_0xf8e3('0x93'))](_0xf8e3('0xa3'));}return _0x2c4060[_0xf8e3('0xa4')+_[_0xf8e3('0xa5')](_0x4622b1[_0xf8e3('0xa6')]())+_0xf8e3('0xa7')](_0x417af2[_0xf8e3('0x5a')][_0xf8e3('0x5d')],{'penalty':_0x417af2[_0xf8e3('0x5a')]['penalty']||0x0})[_0xf8e3('0xa8')](function(_0x3de54e){for(var _0x4cb7c0=0x0;_0x4cb7c0<_0x417af2[_0xf8e3('0x5a')]['ids']['length'];_0x4cb7c0+=0x1){var _0x5a66ee={'UserId':Number(_0x417af2[_0xf8e3('0x50')]['id'])};_0x5a66ee[_[_0xf8e3('0xa5')](_0x4622b1['toLowerCase']())+_0xf8e3('0xa9')]=Number(_0x417af2[_0xf8e3('0x5a')][_0xf8e3('0x5d')][_0x4cb7c0]);socket['emit'](_0xf8e3('0x7c')+_[_0xf8e3('0xa5')](_0x4622b1[_0xf8e3('0xa6')]())+'Queue:save',_0x5a66ee);}return _0x3de54e;})[_0xf8e3('0x15')](function(){if(_0x4622b1===_0xf8e3('0xaa')){return db[_0xf8e3('0xab')]['findAll']({'where':{'id':_0x417af2[_0xf8e3('0x5a')][_0xf8e3('0x5d')]||[]},'raw':!![],'attributes':['id',_0xf8e3('0x38')]});}})[_0xf8e3('0x15')](function(_0x239890){var _0x446bf8=_0x2c4060['get']({'plain':!![]});var _0x14b346=[];if(_0x4622b1===_0xf8e3('0xaa')&&_0x446bf8['role']===_0xf8e3('0x32')&&_0x446bf8[_0xf8e3('0x9f')]){for(var _0xcf534f=0x0;_0xcf534f<_0x239890[_0xf8e3('0x4a')];_0xcf534f+=0x1){_0x14b346['push']({'membername':_0x446bf8[_0xf8e3('0x38')],'UserId':_0x446bf8['id'],'queue_name':_0x239890[_0xcf534f]['name'],'VoiceQueueId':_0x239890[_0xcf534f]['id'],'interface':_[_0xf8e3('0x65')](_0x446bf8['interface'])?util[_0xf8e3('0xac')](_0xf8e3('0xad'),_0x446bf8['name']):_0x446bf8[_0xf8e3('0xa1')],'paused':_0x446bf8[_0xf8e3('0xae')]||![],'penalty':_0x417af2[_0xf8e3('0x5a')][_0xf8e3('0xaf')]||0x0});}return BPromise[_0xf8e3('0x8c')](_0x14b346,function(_0x1b02c8){return db[_0xf8e3('0xb0')][_0xf8e3('0xb1')](_0x1b02c8);});}return _0x2c4060;});}})[_0xf8e3('0x15')](respondWithStatusCode(_0x29f5d0,null))[_0xf8e3('0x20')](handleError(_0x29f5d0,null));};exports[_0xf8e3('0xb2')]=function(_0xba6c1a,_0x4508d2){var _0x430f5b;return db[_0xf8e3('0x3d')][_0xf8e3('0x37')]({'where':{'id':_0xba6c1a['params']['id']},'attributes':['id',_0xf8e3('0x38'),'role']})[_0xf8e3('0x15')](handleEntityNotFound(_0x4508d2,null))[_0xf8e3('0x15')](function(_0x50b249){if(_0x50b249){_0x430f5b=_0x50b249;if(!_0xba6c1a[_0xf8e3('0x43')]['channel']||!utils[_0xf8e3('0xa2')](_0xba6c1a[_0xf8e3('0x43')][_0xf8e3('0x9e')])){throw new db[(_0xf8e3('0x92'))]['ValidationError'](_0xf8e3('0xa3'));}return _0x50b249[_0xf8e3('0xb3')+_[_0xf8e3('0xa5')](_0xba6c1a[_0xf8e3('0x43')][_0xf8e3('0x9e')][_0xf8e3('0xa6')]())+'Queues'](_0xba6c1a[_0xf8e3('0x43')]['ids']);}})['then'](function(_0x490b3c){if(_[_0xf8e3('0xb4')](_0xba6c1a['query']['ids'])){for(var _0x537cf0=0x0;_0x537cf0<_0xba6c1a[_0xf8e3('0x43')][_0xf8e3('0x5d')][_0xf8e3('0x4a')];_0x537cf0+=0x1){var _0x5399b5={'UserId':Number(_0xba6c1a[_0xf8e3('0x50')]['id'])};_0x5399b5[_[_0xf8e3('0xa5')](_0xba6c1a[_0xf8e3('0x43')][_0xf8e3('0x9e')][_0xf8e3('0xa6')]())+_0xf8e3('0xa9')]=Number(_0xba6c1a[_0xf8e3('0x43')][_0xf8e3('0x5d')][_0x537cf0]);socket[_0xf8e3('0xb5')](_0xf8e3('0x7c')+_[_0xf8e3('0xa5')](_0xba6c1a[_0xf8e3('0x43')][_0xf8e3('0x9e')][_0xf8e3('0xa6')]())+_0xf8e3('0xb6'),_0x5399b5);}}else{var _0x5399b5={'UserId':Number(_0xba6c1a[_0xf8e3('0x50')]['id'])};_0x5399b5[_[_0xf8e3('0xa5')](_0xba6c1a['query'][_0xf8e3('0x9e')]['toLowerCase']())+_0xf8e3('0xa9')]=Number(_0xba6c1a[_0xf8e3('0x43')]['ids']);socket[_0xf8e3('0xb5')]('user'+_[_0xf8e3('0xa5')](_0xba6c1a[_0xf8e3('0x43')][_0xf8e3('0x9e')][_0xf8e3('0xa6')]())+_0xf8e3('0xb6'),_0x5399b5);}return _0x490b3c;})[_0xf8e3('0x15')](function(){if(_0xba6c1a[_0xf8e3('0x43')][_0xf8e3('0x9e')]===_0xf8e3('0xaa')){return db[_0xf8e3('0xb0')][_0xf8e3('0x2c')]({'where':{'UserId':_0xba6c1a[_0xf8e3('0x50')]['id'],'VoiceQueueId':_0xba6c1a[_0xf8e3('0x43')][_0xf8e3('0x5d')]},'individualHooks':!![]})[_0xf8e3('0x15')](function(){return _0x430f5b;});}return _0x430f5b;})[_0xf8e3('0x15')](respondWithStatusCode(_0x4508d2,null))[_0xf8e3('0x20')](handleError(_0x4508d2,null));};exports['addAvatar']=function(_0x463566,_0x37d5c9){_0x463566[_0xf8e3('0x5a')][_0xf8e3('0xb7')]=_0x463566[_0xf8e3('0xb8')][_0xf8e3('0xb9')];return db[_0xf8e3('0x3d')][_0xf8e3('0x37')]({'where':{'id':_0x463566[_0xf8e3('0x50')]['id']}})[_0xf8e3('0x15')](handleEntityNotFound(_0x37d5c9,null))[_0xf8e3('0x15')](saveUpdates(_0x463566[_0xf8e3('0x5a')],null))[_0xf8e3('0x15')](respondWithResult(_0x37d5c9,null))[_0xf8e3('0x20')](handleError(_0x37d5c9,null));};exports[_0xf8e3('0xba')]=function(_0x3cf809,_0x4d2cdb){var _0x3f4924=path[_0xf8e3('0xbb')](config['root'],_0xf8e3('0xbc'));return db[_0xf8e3('0x3d')][_0xf8e3('0x37')]({'where':{'id':_0x3cf809['params']['id']},'attributes':['id','userpic'],'raw':!![]})[_0xf8e3('0x15')](handleEntityNotFound(_0x4d2cdb,null))['then'](function(_0x445091){if(_0x445091){if(_['isNil'](_0x445091['userpic'])){return _0x4d2cdb[_0xf8e3('0xbd')](_0x3f4924);}else{if(!fs['existsSync'](path[_0xf8e3('0xbb')](config[_0xf8e3('0xbe')],'server/files/images/',_0x445091['userpic']))){return _0x4d2cdb[_0xf8e3('0xbd')](_0x3f4924);}return _0x4d2cdb['download'](path[_0xf8e3('0xbb')](config[_0xf8e3('0xbe')],_0xf8e3('0xbf'),_0x445091['userpic']));}}})[_0xf8e3('0x20')](handleError(_0x4d2cdb,null));};exports[_0xf8e3('0xc0')]=function(_0x33cf45,_0xfd0019){return db[_0xf8e3('0x3d')][_0xf8e3('0x37')]({'where':{'id':_0x33cf45[_0xf8e3('0x50')]['id']},'attributes':['id']})[_0xf8e3('0x15')](handleEntityNotFound(_0xfd0019,null))[_0xf8e3('0x15')](function(_0xe70da7){var _0x3bffa9=[];values=_0xe70da7[_0xf8e3('0x4c')];_0x3bffa9[_0xf8e3('0x47')](get_open_tabs(_0xf8e3('0x4b'),_0xe70da7['dataValues']));_0x3bffa9['push'](get_open_tabs(_0xf8e3('0xc1'),_0xe70da7['dataValues']));_0x3bffa9[_0xf8e3('0x47')](get_open_tabs(_0xf8e3('0x4e'),_0xe70da7['dataValues']));_0x3bffa9[_0xf8e3('0x47')](get_open_tabs(_0xf8e3('0xc2'),_0xe70da7[_0xf8e3('0x4c')]));_0x3bffa9[_0xf8e3('0x47')](get_open_tabs(_0xf8e3('0x4d'),_0xe70da7[_0xf8e3('0x4c')]));_0x3bffa9[_0xf8e3('0x47')](get_open_tabs(_0xf8e3('0x59'),_0xe70da7[_0xf8e3('0x4c')]));return BPromise['all'](_0x3bffa9);})[_0xf8e3('0x15')](function(_0x3996fe){var _0x5e026c=[];if(_0x3996fe){for(var _0x15fa6f=0x0;_0x15fa6f=_0x598aa4){_0xeff822=_0x598aa4;_0x2a20ed=0xc8;}else{_0x2a20ed=0xce;}_0x145771[_0xd187('0x21')](_0x2a20ed);return _0x145771['set'](_0xd187('0x25'),_0x4eac6a+'-'+_0xeff822+'/'+_0x598aa4)[_0xd187('0x26')](_0x1047f4);}return null;};}function saveUpdates(_0x34febe){return function(_0x4c50a5){if(_0x4c50a5){return _0x4c50a5[_0xd187('0x27')](_0x34febe)['then'](function(_0x263e31){return _0x263e31;});}return null;};}function removeEntity(_0x19e75f){return function(_0x1e7750){if(_0x1e7750){return _0x1e7750[_0xd187('0x28')]()['then'](function(){var _0x140e54=_0x1e7750[_0xd187('0x29')]({'plain':!![]});if(_0x140e54['role']==='admin')return;var _0x1a1922=[{'name':_0xd187('0x2a'),'value':_0xd187('0x2b'),'ignore':!![]},{'name':_0xd187('0x2c'),'value':_0xd187('0x2d'),'ignore':![]},{'name':_0xd187('0x2e'),'value':_0xd187('0x2f'),'ignore':![]}];var _0x4713df=_(_0x1a1922)['filter'](_0xd187('0x30'))[_0xd187('0x31')](_0xd187('0x32'))['value']();if(_[_0xd187('0x33')](_0x4713df,_0x140e54['role'])){return;}var _0xb3efa3=_[_0xd187('0x34')](_0x1a1922,[_0xd187('0x32'),_0x140e54['role']])['name'];return db[_0xd187('0x35')][_0xd187('0x28')]({'where':{'type':_0xb3efa3,'resourceId':_0x140e54['id']}})['then'](function(){return _0x1e7750;});})[_0xd187('0x16')](function(){_0x19e75f[_0xd187('0x21')](0xcc)[_0xd187('0x20')]();});}};}function handleEntityNotFound(_0x54abed){return function(_0x527c6f){if(!_0x527c6f){_0x54abed[_0xd187('0x36')](0x194);}return _0x527c6f;};}function handleError(_0xf32da2,_0x556146){_0x556146=_0x556146||0x1f4;return function(_0x51f5bf){logger['error'](_0x51f5bf[_0xd187('0x37')]);if(_0x51f5bf['name']){delete _0x51f5bf[_0xd187('0x38')];}_0xf32da2[_0xd187('0x21')](_0x556146)['send'](_0x51f5bf);};}exports[_0xd187('0x39')]=function(_0x5674ca,_0x293ce9){var _0x2db36e={},_0x4af59f={'count':0x0,'rows':[]};var _0x1a6256=_(db[_0xd187('0x3a')]['rawAttributes'])[_0xd187('0x31')](function(_0x5ec6cd){return{'name':_0x5ec6cd['fieldName'],'type':_0x5ec6cd[_0xd187('0x3b')][_0xd187('0x3c')]};})[_0xd187('0x3d')](function(_0x1a8f54){return!_[_0xd187('0x33')](['password',_0xd187('0x3e')],_0x1a8f54[_0xd187('0x38')]);})[_0xd187('0x32')]();_0x2db36e=qs['getOptions'](_0x1a6256,_0x5674ca);var _0x4b121c={'where':_0x2db36e['where']};return db['User'][_0xd187('0x24')](_0x4b121c)[_0xd187('0x16')](function(_0x3d74cc){_0x4af59f[_0xd187('0x24')]=_0x3d74cc;if(_0x5674ca[_0xd187('0x3f')][_0xd187('0x40')]){_0x2db36e[_0xd187('0x41')]=[{'all':!![]}];}if(!_[_0xd187('0x33')](_0x2db36e['attributes'],'id')){_0x2db36e[_0xd187('0x42')][_0xd187('0x43')]('id');}return db[_0xd187('0x3a')]['findAll'](_0x2db36e);})[_0xd187('0x16')](function(_0x48c100){_0x4af59f[_0xd187('0x44')]=_0x48c100;if(_0x5674ca[_0xd187('0x3f')][_0xd187('0x45')]===_0xd187('0x46')){var _0x3cea48=[];for(var _0x49c26e=0x0;_0x49c26e<_0x4af59f[_0xd187('0x44')][_0xd187('0x47')];_0x49c26e++){_0x3cea48[_0xd187('0x43')](get_open_tabs(_0xd187('0x48'),_0x4af59f['rows'][_0x49c26e][_0xd187('0x49')]));_0x3cea48[_0xd187('0x43')](get_open_tabs('sms',_0x4af59f[_0xd187('0x44')][_0x49c26e][_0xd187('0x49')]));_0x3cea48['push'](get_open_tabs('fax',_0x4af59f[_0xd187('0x44')][_0x49c26e][_0xd187('0x49')]));_0x3cea48['push'](get_open_tabs('mail',_0x4af59f['rows'][_0x49c26e][_0xd187('0x49')]));_0x3cea48[_0xd187('0x43')](get_open_tabs(_0xd187('0x4a'),_0x4af59f[_0xd187('0x44')][_0x49c26e][_0xd187('0x49')]));_0x3cea48[_0xd187('0x43')](get_open_tabs(_0xd187('0x4b'),_0x4af59f['rows'][_0x49c26e][_0xd187('0x49')]));}return BPromise[_0xd187('0x4c')](_0x3cea48)[_0xd187('0x16')](function(_0x3ce4a1){return _0x4af59f;});}else{return _0x4af59f;}})[_0xd187('0x16')](respondWithFilteredResult(_0x293ce9,_0x2db36e))[_0xd187('0x1f')](handleError(_0x293ce9,null));};exports[_0xd187('0x4d')]=function(_0x3400a0,_0x4e4a32){var _0x368348={'raw':![],'where':{'id':_0x3400a0[_0xd187('0x4e')]['id']}},_0x2657be={};_0x2657be[_0xd187('0x4f')]=_[_0xd187('0x50')](_['keys'](db[_0xd187('0x3a')][_0xd187('0x51')]),['password',_0xd187('0x3e')]);_0x2657be[_0xd187('0x3f')]=_['keys'](_0x3400a0['query']);_0x2657be['filters']=_['intersection'](_0x2657be[_0xd187('0x4f')],_0x2657be[_0xd187('0x3f')]);_0x368348[_0xd187('0x42')]=_[_0xd187('0x52')](_0x2657be[_0xd187('0x4f')],qs[_0xd187('0x53')](_0x3400a0[_0xd187('0x3f')]['fields']));_0x368348[_0xd187('0x42')]=_0x368348[_0xd187('0x42')][_0xd187('0x47')]?_0x368348[_0xd187('0x42')]:_0x2657be['model'];if(_0x3400a0[_0xd187('0x3f')]['includeAll']){_0x368348['include']=[{'all':!![]}];}_0x368348=_[_0xd187('0x54')]({},_0x368348,_0x3400a0['options']);if(!_[_0xd187('0x33')](_0x368348[_0xd187('0x42')],'id')){_0x368348[_0xd187('0x42')][_0xd187('0x43')]('id');}return db[_0xd187('0x3a')][_0xd187('0x34')](_0x368348)[_0xd187('0x16')](handleEntityNotFound(_0x4e4a32,null))[_0xd187('0x16')](function(_0x1649a2){var _0x55e954=[];values=_0x1649a2;if(_0x3400a0[_0xd187('0x3f')][_0xd187('0x45')]==='true'){_0x55e954[_0xd187('0x43')](get_open_tabs(_0xd187('0x48'),_0x1649a2[_0xd187('0x49')]));_0x55e954['push'](get_open_tabs(_0xd187('0x55'),_0x1649a2[_0xd187('0x49')]));_0x55e954['push'](get_open_tabs(_0xd187('0x4a'),_0x1649a2[_0xd187('0x49')]));_0x55e954['push'](get_open_tabs(_0xd187('0x4b'),_0x1649a2['dataValues']));_0x55e954[_0xd187('0x43')](get_open_tabs(_0xd187('0x56'),_0x1649a2[_0xd187('0x49')]));_0x55e954[_0xd187('0x43')](get_open_tabs(_0xd187('0x57'),_0x1649a2[_0xd187('0x49')]));return BPromise[_0xd187('0x4c')](_0x55e954);}else{return values;}})['then'](function(_0xcef6ca){return values;})[_0xd187('0x16')](respondWithResult(_0x4e4a32,null))[_0xd187('0x1f')](handleError(_0x4e4a32,null));};exports['update']=function(_0x374e30,_0x23428f){if(_0x374e30[_0xd187('0x58')]['id']){delete _0x374e30[_0xd187('0x58')]['id'];}delete _0x374e30[_0xd187('0x58')][_0xd187('0x59')];return db[_0xd187('0x3a')][_0xd187('0x34')]({'where':{'id':_0x374e30[_0xd187('0x4e')]['id']}})[_0xd187('0x16')](handleEntityNotFound(_0x23428f,null))[_0xd187('0x16')](saveUpdates(_0x374e30[_0xd187('0x58')],null))[_0xd187('0x16')](respondWithResult(_0x23428f,null))[_0xd187('0x1f')](handleError(_0x23428f,null));};exports[_0xd187('0x5a')]=function(_0xaff1e6,_0x42fb32){return db[_0xd187('0x3a')][_0xd187('0x5a')]()[_0xd187('0x16')](respondWithResult(_0x42fb32,null))['catch'](handleError(_0x42fb32,null));};exports[_0xd187('0x5b')]=function(_0x48c82d,_0x13d118){return db[_0xd187('0x3a')][_0xd187('0x34')]({'where':{'id':_0x48c82d[_0xd187('0x4e')]['id']}})['then'](handleEntityNotFound(_0x13d118,null))[_0xd187('0x16')](function(_0x2eda30){if(_0x2eda30){return _0x2eda30['addContacts'](_0x48c82d['body'][_0xd187('0x5c')],_[_0xd187('0x5d')](_0x48c82d[_0xd187('0x58')],[_0xd187('0x5c'),'id'])||{});}})['then'](respondWithResult(_0x13d118,null))[_0xd187('0x1f')](handleError(_0x13d118,null));};function validateUser(_0x49543f){return new BPromise(function(_0x1971b2,_0x2f6a72){if(_0x49543f[_0xd187('0x5e')])return _0x1971b2(_0x49543f);return db[_0xd187('0x5f')]['findById'](0x1)[_0xd187('0x16')](function(_0xaea7e0){if(_0xaea7e0[_0xd187('0x60')])authService[_0xd187('0x61')](_0x49543f[_0xd187('0x62')]);db['User']['max'](_0xd187('0x5e'))[_0xd187('0x16')](function(_0x167eaf){if(_[_0xd187('0x63')](_0x167eaf)){_0x49543f[_0xd187('0x5e')]=_0xaea7e0[_0xd187('0x64')]||0x1;return;}if(_[_0xd187('0x63')](_0xaea7e0[_0xd187('0x64')])||_0xaea7e0[_0xd187('0x64')]===_0x167eaf){_0x49543f[_0xd187('0x5e')]=_0x167eaf+0x1;return;}if(_0xaea7e0[_0xd187('0x64')]>_0x167eaf){_0x49543f[_0xd187('0x5e')]=_0xaea7e0['min_internal'];return;}return db[_0xd187('0x65')][_0xd187('0x3f')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0xd187('0x65')][_0xd187('0x66')]['SELECT']})['then'](function(_0x32ba2a){if(_0x32ba2a&&_0x32ba2a[_0xd187('0x47')]){for(var _0x2ac56f=0x0,_0x2f743b=_0x32ba2a['length'];_0x2ac56f<_0x2f743b&&_[_0xd187('0x63')](_0x49543f[_0xd187('0x5e')]);_0x2ac56f++){if(_0xaea7e0['min_internal']<=_0x32ba2a[_0x2ac56f]['from']){_0x49543f[_0xd187('0x5e')]=_0x32ba2a[_0x2ac56f]['from'];}else if(_0xaea7e0[_0xd187('0x64')]>_0x32ba2a[_0x2ac56f][_0xd187('0x67')]&&_0xaea7e0['min_internal']<=_0x32ba2a[_0x2ac56f]['to']){_0x49543f[_0xd187('0x5e')]=_0xaea7e0['min_internal'];}}}if(_[_0xd187('0x63')](_0x49543f['internal'])){_0x49543f['internal']=_0x167eaf+0x1;}return _0x1971b2(_0x49543f);});});})['catch'](function(_0x16d9ea){_0x2f6a72(_0x16d9ea);});});}function updateUser(_0x243063){return new BPromise(function(_0x421585,_0x216829){try{if(_0x243063[_0xd187('0x68')]){_0x243063[_0xd187('0x69')]=_0x243063[_0xd187('0x5e')];_0x243063[_0xd187('0x6a')]={'mailbox':_0x243063['internal'],'password':_0x243063[_0xd187('0x62')],'fullname':_0x243063[_0xd187('0x6b')],'email':_0x243063[_0xd187('0x6c')]};}if(_0x243063['role']===_0xd187('0x2d')){if(!_0x243063[_0xd187('0x6d')])_0x243063[_0xd187('0x6d')]=[_0xd187('0x6e'),'102',_0xd187('0x6f'),_0xd187('0x70'),'110',_0xd187('0x71'),_0xd187('0x72'),_0xd187('0x73'),_0xd187('0x74'),'108',_0xd187('0x75'),_0xd187('0x76'),'111',_0xd187('0x77'),'115'];}_0x421585(_0x243063);}catch(_0x47c27c){_0x216829(_0x47c27c);}});}exports['create']=function(_0x7cbbac,_0x28472d){if(_0x7cbbac[_0xd187('0x2b')][_0xd187('0x59')]===_0xd187('0x2d'))throw new Error(_0xd187('0x78'));if(_0x7cbbac['body'][_0xd187('0x59')]===_0xd187('0x2b')&&_0x7cbbac['user']['role']!==_0xd187('0x79')){throw new Error(_0xd187('0x7a'));}if(_0x7cbbac[_0xd187('0x58')][_0xd187('0x59')]===_0xd187('0x79')&&_0x7cbbac[_0xd187('0x2b')]['role']!==_0xd187('0x79')){throw new Error(_0xd187('0x7b'));}return licenseUtil[_0xd187('0x7c')]([_0x7cbbac[_0xd187('0x58')]])[_0xd187('0x16')](function(){return validateUser(_0x7cbbac[_0xd187('0x58')]);})[_0xd187('0x16')](function(_0x1e58d4){return updateUser(_0x1e58d4)[_0xd187('0x16')](function(_0xf31fac){if(_0xf31fac[_0xd187('0x59')]===_0xd187('0x79')){_0xf31fac['settingsEnabled']=_0x7cbbac['user'][_0xd187('0x7d')];delete _0xf31fac[_0xd187('0x7e')];}return _0xf31fac;});})[_0xd187('0x16')](function(_0x147c96){return db[_0xd187('0x3a')][_0xd187('0x7f')](_0x147c96,{'include':[{'model':db['VoiceMail'],'as':_0xd187('0x6a')}]});})['then'](function(_0x2b2df3){if(_0x7cbbac['body']['role']===_0xd187('0x2b'))return _0x2b2df3;if(_0x7cbbac['user'][_0xd187('0x59')]!==_0xd187('0x2b'))return _0x2b2df3;return db[_0xd187('0x80')][_0xd187('0x34')]({'where':{'name':_0x2b2df3[_0xd187('0x59')]===_0xd187('0x2d')?_0xd187('0x2c'):_0xd187('0x2e'),'userProfileId':_0x7cbbac[_0xd187('0x2b')][_0xd187('0x7e')]},'raw':!![]})[_0xd187('0x16')](function(_0x3ae931){if(!_0x3ae931||_0x3ae931[_0xd187('0x81')]!=0x0)return _0x2b2df3;return db[_0xd187('0x35')][_0xd187('0x7f')]({'name':_0x2b2df3['name'],'resourceId':_0x2b2df3['id'],'type':_0x3ae931[_0xd187('0x38')],'sectionId':_0x3ae931['id']},{})[_0xd187('0x16')](function(){return _0x2b2df3;});})[_0xd187('0x1f')](function(_0x43563b){logger['error'](_0xd187('0x82'),_0x43563b);throw _0x43563b;});})[_0xd187('0x16')](respondWithResult(_0x28472d,0xc9))['catch'](handleError(_0x28472d,null));};exports['bulkCreate']=function(_0x20b680,_0x3c993a){var _0x7fdb14=_0x20b680[_0xd187('0x58')];var _0x371869=[];if(_0x20b680[_0xd187('0x2b')]['role']===_0xd187('0x2d'))throw new Error(_0xd187('0x78'));if(_['some'](_0x7fdb14,[_0xd187('0x59'),_0xd187('0x2b')])&&_0x20b680[_0xd187('0x2b')][_0xd187('0x59')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0xd187('0x83')](_0x7fdb14,[_0xd187('0x59'),_0xd187('0x79')])&&_0x20b680['user'][_0xd187('0x59')]!==_0xd187('0x79')){throw new Error(_0xd187('0x84'));}return licenseUtil[_0xd187('0x7c')](_0x7fdb14)['then'](function(){return validateUser(_0x7fdb14[0x0]);})[_0xd187('0x16')](function(){for(var _0x4efb9f=0x1;_0x4efb9f<_0x7fdb14['length'];_0x4efb9f++){var _0x4a9310=_0x7fdb14[_0x4efb9f-0x1]['internal'];if(!_0x7fdb14[_0x4efb9f]['internal'])_0x7fdb14[_0x4efb9f]['internal']=_0x4a9310+0x1;_0x371869['push'](validateUser(_0x7fdb14[_0x4efb9f]));}return BPromise[_0xd187('0x4c')](_0x371869);})[_0xd187('0x16')](function(){_0x371869=[];for(var _0x4c5879=0x0;_0x4c5879<_0x7fdb14[_0xd187('0x47')];_0x4c5879++){_0x371869[_0xd187('0x43')](updateUser(_0x7fdb14[_0x4c5879]));}return BPromise[_0xd187('0x4c')](_0x371869);})[_0xd187('0x16')](function(){return BPromise[_0xd187('0x85')](_0x7fdb14,function(_0x4a1189){return db[_0xd187('0x3a')]['create'](_0x4a1189,{'include':[{'model':db[_0xd187('0x6a')],'as':_0xd187('0x6a')}]})[_0xd187('0x16')](function(_0x36e6ae){_0x4a1189['id']=_0x36e6ae['id'];return _0x4a1189;});});})[_0xd187('0x16')](function(_0x18690e){if(_0x20b680[_0xd187('0x58')]['role']===_0xd187('0x2b'))return _0x18690e;if(_0x20b680[_0xd187('0x2b')]['role']!==_0xd187('0x2b'))return _0x18690e;var _0x3720f1=_['some'](_0x18690e,function(_0x348b73){return _0x348b73[_0xd187('0x59')]===_0xd187('0x2d')||_0x348b73[_0xd187('0x59')]===_0xd187('0x2f');});if(!_0x3720f1)return _0x18690e;return db[_0xd187('0x80')][_0xd187('0x86')]({'where':{'name':{'$or':[_0xd187('0x2c'),'Telephones']},'userProfileId':_0x20b680[_0xd187('0x2b')][_0xd187('0x7e')]},'raw':!![]})[_0xd187('0x16')](function(_0x44ac47){if(_[_0xd187('0x87')](_0x44ac47)||!_[_0xd187('0x83')](_0x44ac47,['autoAssociation',0x0]))return _0x18690e;_0x371869=[];var _0x4fcf43=_(_0x44ac47)[_0xd187('0x31')](function(_0x3c9248){if(_0x3c9248['autoAssociation']===0x1)return;return _0x3c9248[_0xd187('0x38')]===_0xd187('0x2c')?_0xd187('0x2d'):_0xd187('0x2f');})[_0xd187('0x88')]()[_0xd187('0x32')]();for(var _0x578de9=0x0;_0x578de9<_0x18690e[_0xd187('0x47')];_0x578de9++){if(!_[_0xd187('0x33')](_0x4fcf43,_0x18690e[_0x578de9][_0xd187('0x59')]))return;var _0x23e30b=_0x18690e[_0x578de9][_0xd187('0x59')]===_0xd187('0x2d')?_0xd187('0x2c'):_0xd187('0x2e');_0x371869[_0xd187('0x43')](db['UserProfileResource'][_0xd187('0x7f')]({'name':_0x18690e[_0x578de9][_0xd187('0x38')],'resourceId':_0x18690e[_0x578de9]['id'],'type':_0x23e30b,'sectionId':_[_0xd187('0x34')](_0x44ac47,['name',_0x23e30b])['id']},{}));}return BPromise[_0xd187('0x4c')](_0x371869);});})[_0xd187('0x16')](respondWithResult(_0x3c993a,0xc9))[_0xd187('0x1f')](handleError(_0x3c993a,null));};exports[_0xd187('0x89')]=function(_0x1e0e80,_0xec0779){if(_0x1e0e80['body']['id']){delete _0x1e0e80[_0xd187('0x58')]['id'];}return db[_0xd187('0x3a')][_0xd187('0x34')]({'where':{'id':_0x1e0e80['params']['id']}})[_0xd187('0x16')](function(_0xd39f2a){if(!_0xd39f2a)return null;if(_0xd39f2a['id']===_0x1e0e80[_0xd187('0x2b')]['id']){if(!_0x1e0e80[_0xd187('0x58')][_0xd187('0x8a')]||!_0x1e0e80[_0xd187('0x58')]['newPassword']){throw new db[(_0xd187('0x8b'))][(_0xd187('0x8c'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0xd39f2a[_0xd187('0x8d')](_0x1e0e80[_0xd187('0x58')]['oldPassword'])){throw new db[(_0xd187('0x8b'))][(_0xd187('0x8c'))]('Wrong\x20credentials');}if(_0x1e0e80[_0xd187('0x58')][_0xd187('0x8a')]===_0x1e0e80['body'][_0xd187('0x8e')]){throw new db['Sequelize'][(_0xd187('0x8c'))](_0xd187('0x8f'));}}else if(_0x1e0e80[_0xd187('0x2b')][_0xd187('0x59')]===_0xd187('0x79')){if(!_0x1e0e80['body']['newPassword']){throw new db[(_0xd187('0x8b'))][(_0xd187('0x8c'))](_0xd187('0x90'));}}else if(_0x1e0e80[_0xd187('0x2b')][_0xd187('0x59')]===_0xd187('0x2b')){if(!_0x1e0e80[_0xd187('0x58')]['newPassword']){throw new db[(_0xd187('0x8b'))][(_0xd187('0x8c'))](_0xd187('0x90'));}if(_0xd39f2a[_0xd187('0x59')]!==_0xd187('0x2d')){throw new db[(_0xd187('0x8b'))]['ValidationError'](_0xd187('0x78'));}}else{throw new db[(_0xd187('0x8b'))][(_0xd187('0x8c'))](_0xd187('0x78'));}return _0xd39f2a;})[_0xd187('0x16')](handleEntityNotFound(_0xec0779,null))[_0xd187('0x16')](function(_0x1c6433){return db[_0xd187('0x5f')]['findOne']({'attributes':['id',_0xd187('0x60'),'enforcePasswordHistory',_0xd187('0x91')]})[_0xd187('0x16')](function(_0x4853a8){if(_0x4853a8[_0xd187('0x60')])authService[_0xd187('0x61')](_0x1e0e80['body'][_0xd187('0x8e')]);if(!_0x4853a8['enforcePasswordHistory']||!_0x1c6433[_0xd187('0x92')])return _0x1c6433;authService['validatePasswordHistory'](_0x1e0e80['body'][_0xd187('0x8e')],_0x1c6433[_0xd187('0x92')],_0x4853a8[_0xd187('0x91')]);return _0x1c6433;})[_0xd187('0x16')](saveUpdates({'password':_0x1e0e80['body'][_0xd187('0x8e')],'passwordResetAt':_0x1e0e80[_0xd187('0x2b')]['id']==_0x1e0e80[_0xd187('0x4e')]['id']?moment():null,'previousPasswords':authService[_0xd187('0x93')](_0x1e0e80[_0xd187('0x58')][_0xd187('0x8e')],_0x1c6433[_0xd187('0x92')])},null));})[_0xd187('0x16')](respondWithResult(_0xec0779,null))[_0xd187('0x1f')](handleError(_0xec0779,null));};exports[_0xd187('0x94')]=function(_0x52f520,_0x74f8d7){var _0x8c3b2a=_0x52f520[_0xd187('0x58')]['channel'];return db['User'][_0xd187('0x34')]({'where':{'id':_0x52f520[_0xd187('0x4e')]['id']},'attributes':['id',_0xd187('0x38'),'role','online',_0xd187('0x95'),_0xd187('0x96'),'interface']})[_0xd187('0x16')](handleEntityNotFound(_0x74f8d7,null))[_0xd187('0x16')](function(_0x361f8b){if(_0x361f8b){if(!utils[_0xd187('0x97')](_0x8c3b2a)){throw new db['Sequelize'][(_0xd187('0x8c'))](_0xd187('0x98'));}return _0x361f8b[_0xd187('0x99')+_[_0xd187('0x9a')](_0x8c3b2a[_0xd187('0x9b')]())+_0xd187('0x9c')](_0x52f520[_0xd187('0x58')]['ids'],{'penalty':_0x52f520[_0xd187('0x58')]['penalty']||0x0})[_0xd187('0x9d')](function(_0x4f50a8){for(var _0x3a1101=0x0;_0x3a1101<_0x52f520['body'][_0xd187('0x5c')][_0xd187('0x47')];_0x3a1101+=0x1){var _0x388797={'UserId':Number(_0x52f520['params']['id'])};_0x388797[_[_0xd187('0x9a')](_0x8c3b2a[_0xd187('0x9b')]())+_0xd187('0x9e')]=Number(_0x52f520[_0xd187('0x58')][_0xd187('0x5c')][_0x3a1101]);socket[_0xd187('0x9f')](_0xd187('0x2b')+_[_0xd187('0x9a')](_0x8c3b2a['toLowerCase']())+_0xd187('0xa0'),_0x388797);}return _0x4f50a8;})[_0xd187('0x16')](function(){if(_0x8c3b2a===_0xd187('0xa1')){return db['VoiceQueue'][_0xd187('0x86')]({'where':{'id':_0x52f520[_0xd187('0x58')][_0xd187('0x5c')]||[]},'raw':!![],'attributes':['id',_0xd187('0x38')]});}})[_0xd187('0x16')](function(_0x28bc14){var _0x2e4db4=_0x361f8b[_0xd187('0x29')]({'plain':!![]});var _0xbb4a68=[];if(_0x8c3b2a===_0xd187('0xa1')&&_0x2e4db4[_0xd187('0x59')]==='agent'&&_0x2e4db4[_0xd187('0xa2')]){for(var _0x7960ed=0x0;_0x7960ed<_0x28bc14[_0xd187('0x47')];_0x7960ed+=0x1){_0xbb4a68[_0xd187('0x43')]({'membername':_0x2e4db4['name'],'UserId':_0x2e4db4['id'],'queue_name':_0x28bc14[_0x7960ed][_0xd187('0x38')],'VoiceQueueId':_0x28bc14[_0x7960ed]['id'],'interface':_['isNil'](_0x2e4db4[_0xd187('0xa3')])?util[_0xd187('0xa4')](_0xd187('0xa5'),_0x2e4db4[_0xd187('0x38')]):_0x2e4db4[_0xd187('0xa3')],'paused':_0x2e4db4['voicePause']||![],'penalty':_0x52f520[_0xd187('0x58')][_0xd187('0xa6')]||0x0});}return BPromise[_0xd187('0x85')](_0xbb4a68,function(_0x31c17b){return db[_0xd187('0xa7')]['upsert'](_0x31c17b);});}return _0x361f8b;});}})[_0xd187('0x16')](respondWithStatusCode(_0x74f8d7,null))[_0xd187('0x1f')](handleError(_0x74f8d7,null));};exports[_0xd187('0xa8')]=function(_0x4fce90,_0x4dcd41){var _0x38e2af;return db[_0xd187('0x3a')][_0xd187('0x34')]({'where':{'id':_0x4fce90[_0xd187('0x4e')]['id']},'attributes':['id','name',_0xd187('0x59')]})[_0xd187('0x16')](handleEntityNotFound(_0x4dcd41,null))[_0xd187('0x16')](function(_0x1721c2){if(_0x1721c2){_0x38e2af=_0x1721c2;if(!_0x4fce90['query'][_0xd187('0xa9')]||!utils['isValidChannel'](_0x4fce90[_0xd187('0x3f')][_0xd187('0xa9')])){throw new db[(_0xd187('0x8b'))][(_0xd187('0x8c'))](_0xd187('0x98'));}return _0x1721c2['remove'+_[_0xd187('0x9a')](_0x4fce90[_0xd187('0x3f')][_0xd187('0xa9')][_0xd187('0x9b')]())+'Queues'](_0x4fce90[_0xd187('0x3f')][_0xd187('0x5c')]);}})[_0xd187('0x16')](function(_0x474a9f){if(_[_0xd187('0xaa')](_0x4fce90[_0xd187('0x3f')][_0xd187('0x5c')])){for(var _0x12e3ca=0x0;_0x12e3ca<_0x4fce90[_0xd187('0x3f')][_0xd187('0x5c')][_0xd187('0x47')];_0x12e3ca+=0x1){var _0x943fc1={'UserId':Number(_0x4fce90[_0xd187('0x4e')]['id'])};_0x943fc1[_['capitalize'](_0x4fce90[_0xd187('0x3f')]['channel'][_0xd187('0x9b')]())+'QueueId']=Number(_0x4fce90[_0xd187('0x3f')][_0xd187('0x5c')][_0x12e3ca]);socket[_0xd187('0x9f')](_0xd187('0x2b')+_['capitalize'](_0x4fce90['query'][_0xd187('0xa9')][_0xd187('0x9b')]())+_0xd187('0xab'),_0x943fc1);}}else{var _0x943fc1={'UserId':Number(_0x4fce90[_0xd187('0x4e')]['id'])};_0x943fc1[_[_0xd187('0x9a')](_0x4fce90['query']['channel'][_0xd187('0x9b')]())+_0xd187('0x9e')]=Number(_0x4fce90[_0xd187('0x3f')]['ids']);socket[_0xd187('0x9f')](_0xd187('0x2b')+_[_0xd187('0x9a')](_0x4fce90['query'][_0xd187('0xa9')]['toLowerCase']())+_0xd187('0xab'),_0x943fc1);}return _0x474a9f;})['then'](function(){if(_0x4fce90['query']['channel']===_0xd187('0xa1')){return db[_0xd187('0xa7')][_0xd187('0x28')]({'where':{'UserId':_0x4fce90[_0xd187('0x4e')]['id'],'VoiceQueueId':_0x4fce90[_0xd187('0x3f')][_0xd187('0x5c')]},'individualHooks':!![]})['then'](function(){return _0x38e2af;});}return _0x38e2af;})[_0xd187('0x16')](respondWithStatusCode(_0x4dcd41,null))['catch'](handleError(_0x4dcd41,null));};exports[_0xd187('0xac')]=function(_0x3ee43e,_0x3c71f3){_0x3ee43e[_0xd187('0x58')][_0xd187('0xad')]=_0x3ee43e[_0xd187('0xae')]['filename'];return db[_0xd187('0x3a')][_0xd187('0x34')]({'where':{'id':_0x3ee43e[_0xd187('0x4e')]['id']}})[_0xd187('0x16')](handleEntityNotFound(_0x3c71f3,null))['then'](saveUpdates(_0x3ee43e[_0xd187('0x58')],null))[_0xd187('0x16')](respondWithResult(_0x3c71f3,null))['catch'](handleError(_0x3c71f3,null));};exports[_0xd187('0xaf')]=function(_0x305023,_0xc926a1){var _0x18c8e4=path['join'](config[_0xd187('0xb0')],'server/files/images/logos/default_profile.png');return db['User']['find']({'where':{'id':_0x305023[_0xd187('0x4e')]['id']},'attributes':['id',_0xd187('0xad')],'raw':!![]})[_0xd187('0x16')](handleEntityNotFound(_0xc926a1,null))[_0xd187('0x16')](function(_0x7d8eb5){if(_0x7d8eb5){if(_[_0xd187('0x63')](_0x7d8eb5[_0xd187('0xad')])){return _0xc926a1[_0xd187('0xb1')](_0x18c8e4);}else{if(!fs['existsSync'](path[_0xd187('0xb2')](config[_0xd187('0xb0')],_0xd187('0xb3'),_0x7d8eb5['userpic']))){return _0xc926a1[_0xd187('0xb1')](_0x18c8e4);}return _0xc926a1[_0xd187('0xb1')](path[_0xd187('0xb2')](config[_0xd187('0xb0')],_0xd187('0xb3'),_0x7d8eb5['userpic']));}}})[_0xd187('0x1f')](handleError(_0xc926a1,null));};exports[_0xd187('0xb4')]=function(_0x1ac714,_0x5ac21a){return db[_0xd187('0x3a')][_0xd187('0x34')]({'where':{'id':_0x1ac714[_0xd187('0x4e')]['id']},'attributes':['id']})[_0xd187('0x16')](handleEntityNotFound(_0x5ac21a,null))['then'](function(_0x476b70){var _0x3cf76c=[];values=_0x476b70[_0xd187('0x49')];_0x3cf76c[_0xd187('0x43')](get_open_tabs('chat',_0x476b70[_0xd187('0x49')]));_0x3cf76c[_0xd187('0x43')](get_open_tabs('sms',_0x476b70[_0xd187('0x49')]));_0x3cf76c['push'](get_open_tabs(_0xd187('0x4a'),_0x476b70['dataValues']));_0x3cf76c['push'](get_open_tabs(_0xd187('0x4b'),_0x476b70['dataValues']));_0x3cf76c[_0xd187('0x43')](get_open_tabs('fax',_0x476b70[_0xd187('0x49')]));_0x3cf76c[_0xd187('0x43')](get_open_tabs('mail',_0x476b70[_0xd187('0x49')]));return BPromise[_0xd187('0x4c')](_0x3cf76c);})[_0xd187('0x16')](function(_0x450bf6){var _0x1751ee=[];if(_0x450bf6){for(var _0x17a1d6=0x0;_0x17a1d6=_0x44a11d['agents']){throw new Error(_0x1515('0x51'));}})[_0x1515('0x11')](function(){if(_0x549f22){return db['UserVoiceQueueRt'][_0x1515('0x49')]({'where':{'membername':_0x549f22[_0x1515('0x28')]},'individualHooks':!![]});}})[_0x1515('0x11')](function(){if(_0x549f22){return _0x549f22['getVoiceQueues']({'raw':!![]});}})[_0x1515('0x11')](function(_0x468efc){if(_0x549f22){if(_0x468efc){var _0x120e02=[];_0x431d6a=_0x468efc;if(_0x431d6a['length']){for(var _0x4a40d0=0x0;_0x4a40d0<_0x431d6a[_0x1515('0x2d')];_0x4a40d0++){_0x120e02['push'](db['UserVoiceQueueRt'][_0x1515('0x52')]({'membername':_0x549f22[_0x1515('0x28')],'UserId':_0x549f22['id'],'queue_name':_0x431d6a[_0x4a40d0]['name'],'VoiceQueueId':_0x431d6a[_0x4a40d0]['id'],'interface':_0x3c6467,'paused':_0x549f22[_0x1515('0x53')]||![],'penalty':_0x431d6a[_0x4a40d0][_0x1515('0x54')]||0x0}));}return BPromise[_0x1515('0x46')](_0x120e02);}}}})[_0x1515('0x11')](function(){if(_0x549f22){return db['MemberReport'][_0x1515('0x45')]({'where':{'membername':_0x549f22['name'],'exitAt':null}});}})[_0x1515('0x11')](function(_0x3f867d){if(_0x549f22){if(_0x3f867d&&_0x3f867d[_0x1515('0x2d')]){var _0x3026b5=[];_0x3f867d[_0x1515('0x31')](function(_0x5616a3){_0x3026b5[_0x1515('0x32')](_0x5616a3[_0x1515('0x2b')]({'exitAt':moment()[_0x1515('0x2e')](_0x1515('0x2f'))}));});return BPromise[_0x1515('0x46')](_0x3026b5);}}})[_0x1515('0x11')](function(_0x477f4b){if(_0x549f22){var _0x92e138=[];var _0x3e8f0c=[];var _0x27a4a0=utils[_0x1515('0x30')]();var _0x453c1a={'membername':_0x549f22[_0x1515('0x28')],'interface':_0x3c6467,'enterAt':moment()[_0x1515('0x2e')](_0x1515('0x2f')),'role':_0x549f22[_0x1515('0x29')],'internal':_0x549f22[_0x1515('0x37')]};_0x27a4a0[_0x1515('0x31')](function(_0x240d1e){_0x92e138[_0x1515('0x32')](_[_0x1515('0x55')]({'channel':_0x240d1e,'type':'LOGIN','data1':_0x1515('0x56'),'data2':_0x3c6467},_0x453c1a));if(_0x549f22[_0x1515('0x53')]){_0x3e8f0c[_0x1515('0x32')](_[_0x1515('0x55')]({'channel':_0x240d1e,'type':_0x1515('0x2c'),'data1':_0x1515('0x57')},_0x453c1a));}});return db['MemberReport']['bulkCreate'](_0x92e138[_0x1515('0x58')](_0x3e8f0c),{'individualHooks':!![]});}})['then'](function(){if(_0x549f22){return _0x549f22[_0x1515('0x2b')]({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x549f22[_0x1515('0x53')]||![],'mailPause':_0x549f22[_0x1515('0x53')]||![],'chatPause':_0x549f22[_0x1515('0x53')]||![],'faxPause':_0x549f22['loginInPause']||![],'smsPause':_0x549f22[_0x1515('0x53')]||![],'openchannelPause':_0x549f22[_0x1515('0x53')]||![],'pauseType':_0x549f22[_0x1515('0x53')]?_0x1515('0x57'):null,'lastPauseAt':moment()[_0x1515('0x2e')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x3c6467});}})[_0x1515('0x11')](function(_0x4ad98c){_0x12594f(_0x4ad98c);})['catch'](function(_0x4a0f87){_0x315a76(_0x4996dd[_0x1515('0x14')](0x1f4,_0x4a0f87['message']));});});}; \ No newline at end of file +var _0x62c3=['where','include','map','attributes','model','ShowUser','find','info','PauseUser','role','internal','MemberReport','name','length','format','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','push','SIP/%s','PAUSE','body','type','DEFAULT\x20PAUSE','bulkCreate','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','voice','UserVoiceQueueRt','update','system','chat','fax','openchannel','whatsapp','set','%s%s','all','LogoutUser','destroy','LoginUser','mobile','loginInPause','interface','count','agent','../../config/license/util','getLicense','agents','getVoiceQueues','upsert','UserVoiceQueue.penalty','merge','callysquare','LOGININPAUSE','concat','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./user.socket','then','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetUser','User','findAll','options','raw'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x62c3,0x1a7));var _0x362c=function(_0x34b1b8,_0x54c9bf){_0x34b1b8=_0x34b1b8-0x0;var _0x542dd8=_0x62c3[_0x34b1b8];return _0x542dd8;};'use strict';var _=require(_0x362c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x362c('0x1'));var rs=require(_0x362c('0x2'));var fs=require('fs');var Redis=require(_0x362c('0x3'));var db=require(_0x362c('0x4'))['db'];var utils=require(_0x362c('0x5'));var logger=require(_0x362c('0x6'))(_0x362c('0x7'));var config=require(_0x362c('0x8'));var jayson=require(_0x362c('0x9'));var client=jayson['client'][_0x362c('0xa')]({'port':0x232a});config[_0x362c('0xb')]=_[_0x362c('0xc')](config[_0x362c('0xb')],{'host':_0x362c('0xd'),'port':0x18eb});var socket=require(_0x362c('0xe'))(new Redis(config[_0x362c('0xb')]));require(_0x362c('0xf'))['register'](socket);function respondWithRpcPromise(_0x32f589,_0x28a7ff,_0x237832){return new BPromise(function(_0x5b00be,_0x37ece1){return client['request'](_0x32f589,_0x237832)[_0x362c('0x10')](function(_0x37b3b5){logger['info'](_0x362c('0x11'),_0x28a7ff,_0x362c('0x12'));logger[_0x362c('0x13')](_0x362c('0x14'),_0x28a7ff,'request\x20sent',JSON[_0x362c('0x15')](_0x37b3b5));if(_0x37b3b5['error']){if(_0x37b3b5[_0x362c('0x16')][_0x362c('0x17')]===0x1f4){logger[_0x362c('0x16')](_0x362c('0x11'),_0x28a7ff,_0x37b3b5['error'][_0x362c('0x18')]);return _0x37ece1(_0x37b3b5['error'][_0x362c('0x18')]);}logger[_0x362c('0x16')](_0x362c('0x11'),_0x28a7ff,_0x37b3b5['error']['message']);return _0x5b00be(_0x37b3b5[_0x362c('0x16')]['message']);}else{logger['info'](_0x362c('0x11'),_0x28a7ff,_0x362c('0x12'));_0x5b00be(_0x37b3b5[_0x362c('0x19')][_0x362c('0x18')]);}})[_0x362c('0x1a')](function(_0x5aee62){logger[_0x362c('0x16')](_0x362c('0x11'),_0x28a7ff,_0x5aee62);_0x37ece1(_0x5aee62);});});}exports[_0x362c('0x1b')]=function(_0xbcd470){var _0x47bc98=this;return new Promise(function(_0x313720,_0x5f5b73){return db[_0x362c('0x1c')][_0x362c('0x1d')]({'raw':_0xbcd470[_0x362c('0x1e')]?_0xbcd470['options'][_0x362c('0x1f')]===undefined?!![]:![]:!![],'where':_0xbcd470['options']?_0xbcd470[_0x362c('0x1e')][_0x362c('0x20')]||null:null,'attributes':_0xbcd470[_0x362c('0x1e')]?_0xbcd470[_0x362c('0x1e')]['attributes']||null:null,'limit':_0xbcd470[_0x362c('0x1e')]?_0xbcd470[_0x362c('0x1e')]['limit']||null:null,'include':_0xbcd470['options']?_0xbcd470[_0x362c('0x1e')][_0x362c('0x21')]?_[_0x362c('0x22')](_0xbcd470[_0x362c('0x1e')][_0x362c('0x21')],function(_0x4857b2){return{'model':db[_0x4857b2['model']],'as':_0x4857b2['as'],'attributes':_0x4857b2[_0x362c('0x23')],'include':_0x4857b2[_0x362c('0x21')]?_[_0x362c('0x22')](_0x4857b2['include'],function(_0x48c8c6){return{'model':db[_0x48c8c6[_0x362c('0x24')]],'as':_0x48c8c6['as'],'attributes':_0x48c8c6[_0x362c('0x23')],'include':_0x48c8c6[_0x362c('0x21')]?_['map'](_0x48c8c6[_0x362c('0x21')],function(_0x5ca498){return{'model':db[_0x5ca498['model']],'as':_0x5ca498['as'],'attributes':_0x5ca498[_0x362c('0x23')]};}):[]};}):[]};}):[]:[]})[_0x362c('0x10')](function(_0x4ab7a){logger['info'](_0x362c('0x1b'),_0xbcd470);logger[_0x362c('0x13')](_0x362c('0x1b'),_0xbcd470,JSON[_0x362c('0x15')](_0x4ab7a));_0x313720(_0x4ab7a);})[_0x362c('0x1a')](function(_0x5114e3){logger[_0x362c('0x16')](_0x362c('0x1b'),_0x5114e3[_0x362c('0x18')],_0xbcd470);_0x5f5b73(_0x47bc98[_0x362c('0x16')](0x1f4,_0x5114e3[_0x362c('0x18')]));});});};exports[_0x362c('0x25')]=function(_0x27bd1f){var _0x305066=this;return new Promise(function(_0x435ca8,_0x402479){return db['User'][_0x362c('0x26')]({'raw':_0x27bd1f[_0x362c('0x1e')]?_0x27bd1f[_0x362c('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x27bd1f[_0x362c('0x1e')]?_0x27bd1f['options'][_0x362c('0x20')]||null:null,'attributes':_0x27bd1f[_0x362c('0x1e')]?_0x27bd1f[_0x362c('0x1e')]['attributes']||null:null,'include':_0x27bd1f[_0x362c('0x1e')]?_0x27bd1f['options'][_0x362c('0x21')]?_[_0x362c('0x22')](_0x27bd1f['options'][_0x362c('0x21')],function(_0x1b990a){return{'model':db[_0x1b990a[_0x362c('0x24')]],'as':_0x1b990a['as'],'attributes':_0x1b990a[_0x362c('0x23')],'include':_0x1b990a[_0x362c('0x21')]?_[_0x362c('0x22')](_0x1b990a[_0x362c('0x21')],function(_0x5dd6ad){return{'model':db[_0x5dd6ad['model']],'as':_0x5dd6ad['as'],'attributes':_0x5dd6ad['attributes'],'include':_0x5dd6ad[_0x362c('0x21')]?_[_0x362c('0x22')](_0x5dd6ad['include'],function(_0x3d4969){return{'model':db[_0x3d4969[_0x362c('0x24')]],'as':_0x3d4969['as'],'attributes':_0x3d4969[_0x362c('0x23')]};}):[]};}):[]};}):[]:[]})[_0x362c('0x10')](function(_0x3e1f03){logger[_0x362c('0x27')]('ShowUser',_0x27bd1f);logger[_0x362c('0x13')](_0x362c('0x25'),_0x27bd1f,JSON['stringify'](_0x3e1f03));_0x435ca8(_0x3e1f03);})[_0x362c('0x1a')](function(_0x23c2da){logger['error'](_0x362c('0x25'),_0x23c2da[_0x362c('0x18')],_0x27bd1f);_0x402479(_0x305066[_0x362c('0x16')](0x1f4,_0x23c2da[_0x362c('0x18')]));});});};exports[_0x362c('0x28')]=function(_0x104c90){var _0x2ae045=this;return new Promise(function(_0x1150bd,_0x4b83e5){var _0x3cb8c0;return db['User'][_0x362c('0x26')]({'where':_0x104c90[_0x362c('0x1e')][_0x362c('0x20')]||{},'attributes':['id','name',_0x362c('0x29'),_0x362c('0x2a'),'interface']})[_0x362c('0x10')](function(_0x3e55a9){if(_0x3e55a9){_0x3cb8c0=_0x3e55a9;return db['UserVoiceQueueRt']['update']({'paused':0x1},{'where':{'UserId':_0x3cb8c0['id']},'individualHooks':!![]});}})['then'](function(){if(_0x3cb8c0){return db[_0x362c('0x2b')][_0x362c('0x1d')]({'where':{'membername':_0x3cb8c0[_0x362c('0x2c')],'type':'PAUSE','exitAt':null}});}})['then'](function(_0x542703){if(_0x3cb8c0){if(_0x542703&&_0x542703[_0x362c('0x2d')]){var _0x3ad81e=moment()[_0x362c('0x2e')](_0x362c('0x2f'));for(var _0x491921=0x0,_0x5cdb4a=_0x542703[_0x362c('0x2d')];_0x491921<_0x5cdb4a;_0x491921++){_0x542703[_0x491921]['updateAttributes']({'exitAt':_0x3ad81e});}}}})[_0x362c('0x10')](function(){if(_0x3cb8c0){var _0x43663c=[];var _0x157479=utils[_0x362c('0x30')]();_0x157479[_0x362c('0x31')](function(_0x4ecf41){_0x43663c[_0x362c('0x32')]({'channel':_0x4ecf41,'membername':_0x3cb8c0[_0x362c('0x2c')],'interface':_['isNil'](_0x3cb8c0['interface'])?util[_0x362c('0x2e')](_0x362c('0x33'),_0x3cb8c0[_0x362c('0x2c')]):_0x3cb8c0['interface'],'type':_0x362c('0x34'),'enterAt':moment()[_0x362c('0x2e')](_0x362c('0x2f')),'data1':_0x104c90[_0x362c('0x35')][_0x362c('0x36')]||_0x362c('0x37'),'role':_0x3cb8c0[_0x362c('0x29')],'internal':_0x3cb8c0[_0x362c('0x2a')],'uniqueid':_0x104c90[_0x362c('0x35')]['uniqueid']||null});});return db[_0x362c('0x2b')][_0x362c('0x38')](_0x43663c,{'individualHooks':!![]});}})['then'](function(){if(_0x3cb8c0){return _0x3cb8c0['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x104c90[_0x362c('0x35')][_0x362c('0x36')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x362c('0x2e')](_0x362c('0x2f'))});}})[_0x362c('0x10')](function(_0x571891){_0x1150bd(_0x571891);})['catch'](function(_0x156bed){_0x4b83e5(_0x2ae045[_0x362c('0x16')](0x1f4,_0x156bed[_0x362c('0x18')]));});});};exports[_0x362c('0x39')]=function(_0x42b579){var _0xf018f9=this;return new Promise(function(_0x1e8451,_0x9ccaaf){var _0x1a836e;return db[_0x362c('0x1c')][_0x362c('0x3a')]({'where':_0x42b579[_0x362c('0x1e')][_0x362c('0x20')]||{},'attributes':['id','name']})[_0x362c('0x10')](function(_0x59e501){if(_0x59e501){_0x1a836e=_0x59e501;if(_0x42b579[_0x362c('0x35')][_0x362c('0x3b')]&&!utils[_0x362c('0x3c')](_0x42b579['body'][_0x362c('0x3b')])){throw new Error(_0x362c('0x3d'));}switch(_0x42b579['body'][_0x362c('0x3b')]){case _0x362c('0x3e'):return db[_0x362c('0x3f')]['update']({'paused':0x0},{'where':{'UserId':_0x1a836e['id']}})[_0x362c('0x10')](function(){return db[_0x362c('0x2b')][_0x362c('0x26')]({'where':{'channel':_0x42b579['body'][_0x362c('0x3b')],'membername':_0x1a836e[_0x362c('0x2c')],'type':_0x362c('0x34'),'exitAt':null}});})['then'](function(_0x172b06){if(_0x172b06){return _0x172b06[_0x362c('0x40')]({'exitAt':moment()[_0x362c('0x2e')](_0x362c('0x2f')),'data2':_0x362c('0x41')},{'individualHooks':!![]});}return null;})[_0x362c('0x10')](function(){return _0x1a836e[_0x362c('0x40')]({'voicePause':![]});});case'mail':case _0x362c('0x42'):case _0x362c('0x43'):case'sms':case _0x362c('0x44'):case _0x362c('0x45'):return db[_0x362c('0x2b')][_0x362c('0x26')]({'where':{'channel':_0x42b579['body'][_0x362c('0x3b')],'membername':_0x1a836e[_0x362c('0x2c')],'type':_0x362c('0x34'),'exitAt':null}})['then'](function(_0x274c10){return _0x274c10[_0x362c('0x40')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x362c('0x41')},{'individualHooks':!![]});})[_0x362c('0x10')](function(){var _0x24b990={};_[_0x362c('0x46')](_0x24b990,util[_0x362c('0x2e')](_0x362c('0x47'),_0x42b579[_0x362c('0x35')]['channel'],'Pause'),![]);return _0x1a836e[_0x362c('0x40')](_0x24b990);});default:return db[_0x362c('0x3f')][_0x362c('0x40')]({'paused':0x0},{'where':{'UserId':_0x1a836e['id']}})[_0x362c('0x10')](function(){return db[_0x362c('0x2b')][_0x362c('0x1d')]({'where':{'membername':_0x1a836e[_0x362c('0x2c')],'type':_0x362c('0x34'),'exitAt':null}});})[_0x362c('0x10')](function(_0x506209){var _0x4a3042=[];_0x506209[_0x362c('0x31')](function(_0x349d72){_0x4a3042['push'](_0x349d72[_0x362c('0x40')]({'exitAt':moment()[_0x362c('0x2e')](_0x362c('0x2f')),'data2':'system'}));});return BPromise[_0x362c('0x48')](_0x4a3042);})[_0x362c('0x10')](function(){return _0x1a836e['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x362c('0x10')](function(_0x1aeace){_0x1e8451(_0x1aeace);})[_0x362c('0x1a')](function(_0x16a46a){_0x9ccaaf(_0xf018f9['error'](0x1f4,_0x16a46a[_0x362c('0x18')]));});});};exports[_0x362c('0x49')]=function(_0x34f459){var _0x57d2b6=this;return new Promise(function(_0x30c327,_0xd6a4fd){var _0xb43ee1;return db[_0x362c('0x1c')][_0x362c('0x3a')]({'where':_0x34f459['options'][_0x362c('0x20')]||{},'attributes':['id',_0x362c('0x2c')]})[_0x362c('0x10')](function(_0x541eb9){if(_0x541eb9){_0xb43ee1=_0x541eb9;return db[_0x362c('0x3f')][_0x362c('0x4a')]({'where':{'membername':_0xb43ee1[_0x362c('0x2c')]},'individualHooks':!![]});}})[_0x362c('0x10')](function(){if(_0xb43ee1){return db[_0x362c('0x2b')]['findAll']({'where':{'membername':_0xb43ee1[_0x362c('0x2c')],'exitAt':null}});}})['then'](function(_0x1ba14d){if(_0xb43ee1){if(_0x1ba14d&&_0x1ba14d[_0x362c('0x2d')]){var _0x23de8b=[];_0x1ba14d[_0x362c('0x31')](function(_0x18d7c7){_0x23de8b[_0x362c('0x32')](_0x18d7c7[_0x362c('0x40')]({'exitAt':moment()[_0x362c('0x2e')](_0x362c('0x2f'))}));});return BPromise[_0x362c('0x48')](_0x23de8b);}}})[_0x362c('0x10')](function(){if(_0xb43ee1){return _0xb43ee1[_0x362c('0x40')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x362c('0x10')](function(_0x12a882){_0x30c327(_0x12a882);})[_0x362c('0x1a')](function(_0x1f64ef){_0xd6a4fd(_0x57d2b6[_0x362c('0x16')](0x1f4,_0x1f64ef['message']));});});};exports[_0x362c('0x4b')]=function(_0x4d453d){var _0x1dd853=this;return new Promise(function(_0x5468ae,_0x1dfbea){var _0xa652ba;var _0x50ee8e;var _0x1abf9e;var _0x1e69c0;return db[_0x362c('0x1c')]['findOne']({'where':_0x4d453d['options']['where']||{},'attributes':['id',_0x362c('0x2c'),_0x362c('0x29'),_0x362c('0x4c'),'phone','internal',_0x362c('0x4d'),_0x362c('0x4e')]})[_0x362c('0x10')](function(_0x13ff36){if(_0x13ff36){_0xa652ba=_0x13ff36;_0x1e69c0=_0x4d453d['body'][_0x362c('0x4e')]?_0x4d453d['body'][_0x362c('0x4e')]:util[_0x362c('0x2e')](_0x362c('0x33'),_0xa652ba[_0x362c('0x2c')]);return db[_0x362c('0x1c')][_0x362c('0x4f')]({'where':{'role':_0x362c('0x50'),'online':!![],'id':{'$ne':_0xa652ba['id']}}});}})[_0x362c('0x10')](function(_0x234960){if(_0x234960){_0x1abf9e=_0x234960;return require(_0x362c('0x51'))[_0x362c('0x52')]();}})[_0x362c('0x10')](function(_0x1e24f2){if(_0x1e24f2&&_0x1e24f2[_0x362c('0x53')]&&_0x1abf9e>=_0x1e24f2[_0x362c('0x53')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x362c('0x10')](function(){if(_0xa652ba){return db[_0x362c('0x3f')]['destroy']({'where':{'membername':_0xa652ba['name']},'individualHooks':!![]});}})[_0x362c('0x10')](function(){if(_0xa652ba){return _0xa652ba[_0x362c('0x54')]({'raw':!![]});}})[_0x362c('0x10')](function(_0x3ef3d9){if(_0xa652ba){if(_0x3ef3d9){var _0x59cf5b=[];_0x50ee8e=_0x3ef3d9;if(_0x50ee8e[_0x362c('0x2d')]){for(var _0x456064=0x0;_0x456064<_0x50ee8e['length'];_0x456064++){_0x59cf5b[_0x362c('0x32')](db[_0x362c('0x3f')][_0x362c('0x55')]({'membername':_0xa652ba[_0x362c('0x2c')],'UserId':_0xa652ba['id'],'queue_name':_0x50ee8e[_0x456064][_0x362c('0x2c')],'VoiceQueueId':_0x50ee8e[_0x456064]['id'],'interface':_0x1e69c0,'paused':_0xa652ba['loginInPause']||![],'penalty':_0x50ee8e[_0x456064][_0x362c('0x56')]||0x0}));}return BPromise[_0x362c('0x48')](_0x59cf5b);}}}})[_0x362c('0x10')](function(){if(_0xa652ba){return db[_0x362c('0x2b')]['findAll']({'where':{'membername':_0xa652ba[_0x362c('0x2c')],'exitAt':null}});}})[_0x362c('0x10')](function(_0x692ff2){if(_0xa652ba){if(_0x692ff2&&_0x692ff2[_0x362c('0x2d')]){var _0x10e40f=[];_0x692ff2[_0x362c('0x31')](function(_0x36b1aa){_0x10e40f[_0x362c('0x32')](_0x36b1aa[_0x362c('0x40')]({'exitAt':moment()[_0x362c('0x2e')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x362c('0x48')](_0x10e40f);}}})[_0x362c('0x10')](function(_0x1516c6){if(_0xa652ba){var _0x83287c=[];var _0x3dba92=[];var _0x5b3748=utils['getChannels']();var _0x81e8e6={'membername':_0xa652ba['name'],'interface':_0x1e69c0,'enterAt':moment()[_0x362c('0x2e')](_0x362c('0x2f')),'role':_0xa652ba[_0x362c('0x29')],'internal':_0xa652ba[_0x362c('0x2a')]};_0x5b3748['forEach'](function(_0x5b9276){_0x83287c[_0x362c('0x32')](_[_0x362c('0x57')]({'channel':_0x5b9276,'type':'LOGIN','data1':_0x362c('0x58'),'data2':_0x1e69c0},_0x81e8e6));if(_0xa652ba[_0x362c('0x4d')]){_0x3dba92[_0x362c('0x32')](_['merge']({'channel':_0x5b9276,'type':_0x362c('0x34'),'data1':_0x362c('0x59')},_0x81e8e6));}});return db['MemberReport'][_0x362c('0x38')](_0x83287c[_0x362c('0x5a')](_0x3dba92),{'individualHooks':!![]});}})[_0x362c('0x10')](function(){if(_0xa652ba){return _0xa652ba['update']({'online':!![],'lastLoginAt':moment()[_0x362c('0x2e')](_0x362c('0x2f')),'voicePause':_0xa652ba['loginInPause']||![],'mailPause':_0xa652ba['loginInPause']||![],'chatPause':_0xa652ba[_0x362c('0x4d')]||![],'faxPause':_0xa652ba[_0x362c('0x4d')]||![],'smsPause':_0xa652ba['loginInPause']||![],'openchannelPause':_0xa652ba[_0x362c('0x4d')]||![],'pauseType':_0xa652ba[_0x362c('0x4d')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x362c('0x2e')](_0x362c('0x2f')),'interface':_0x1e69c0});}})['then'](function(_0x13a0df){_0x5468ae(_0x13a0df);})[_0x362c('0x1a')](function(_0x198d90){_0x1dfbea(_0x1dd853['error'](0x1f4,_0x198d90['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index e2c38bb..9ec4894 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 _0x670f=['emit','removeListener','register','user:','./user.events','save','update'];(function(_0x4a135a,_0x8d183d){var _0x42e26d=function(_0x2f3292){while(--_0x2f3292){_0x4a135a['push'](_0x4a135a['shift']());}};_0x42e26d(++_0x8d183d);}(_0x670f,0x169));var _0xf670=function(_0x305ecc,_0x8fd533){_0x305ecc=_0x305ecc-0x0;var _0x56443d=_0x670f[_0x305ecc];return _0x56443d;};'use strict';var UserEvents=require(_0xf670('0x0'));var events=[_0xf670('0x1'),'remove',_0xf670('0x2')];function createListener(_0x247d49,_0x364274){return function(_0x244f12){_0x364274[_0xf670('0x3')](_0x247d49,_0x244f12);};}function removeListener(_0x56b3a4,_0x12eb62){return function(){UserEvents[_0xf670('0x4')](_0x56b3a4,_0x12eb62);};}exports[_0xf670('0x5')]=function(_0x477048){for(var _0xc0f9e6=0x0,_0x1f30be=events['length'];_0xc0f9e6<_0x1f30be;_0xc0f9e6++){var _0x1e106e=events[_0xc0f9e6];var _0x3e6996=createListener(_0xf670('0x6')+_0x1e106e,_0x477048);UserEvents['on'](_0x1e106e,_0x3e6996);}}; \ No newline at end of file +var _0x7b66=['update','removeListener','register','length','user:','./user.events','save','remove'];(function(_0x3fd2b4,_0x2a4116){var _0x18b688=function(_0x8279e8){while(--_0x8279e8){_0x3fd2b4['push'](_0x3fd2b4['shift']());}};_0x18b688(++_0x2a4116);}(_0x7b66,0x10d));var _0x67b6=function(_0x3248aa,_0x56468c){_0x3248aa=_0x3248aa-0x0;var _0x1147a5=_0x7b66[_0x3248aa];return _0x1147a5;};'use strict';var UserEvents=require(_0x67b6('0x0'));var events=[_0x67b6('0x1'),_0x67b6('0x2'),_0x67b6('0x3')];function createListener(_0x5c7f79,_0x5276f5){return function(_0x560fe6){_0x5276f5['emit'](_0x5c7f79,_0x560fe6);};}function removeListener(_0x276325,_0x3f5335){return function(){UserEvents[_0x67b6('0x4')](_0x276325,_0x3f5335);};}exports[_0x67b6('0x5')]=function(_0x1e7983){for(var _0xad90c0=0x0,_0x4b04a4=events[_0x67b6('0x6')];_0xad90c0<_0x4b04a4;_0xad90c0++){var _0x2143fd=events[_0xad90c0];var _0x53d285=createListener(_0x67b6('0x7')+_0x2143fd,_0x1e7983);UserEvents['on'](_0x2143fd,_0x53d285);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 17ab913..bb4b976 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x2e48bf,_0x4bde87){var _0x2b6b2d=function(_0x183d59){while(--_0x183d59){_0x2e48bf['push'](_0x2e48bf['shift']());}};_0x2b6b2d(++_0x4bde87);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x5cad3f,_0x178b11){var _0x2b3e9d=function(_0x57179b){while(--_0x57179b){_0x5cad3f['push'](_0x5cad3f['shift']());}};_0x2b3e9d(++_0x178b11);}(_0x70e0,0x17b));var _0x070e=function(_0x5fac1d,_0x42f6e9){_0x5fac1d=_0x5fac1d-0x0;var _0x1c021a=_0x70e0[_0x5fac1d];return _0x1c021a;};'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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 622a83b..2be4041 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 _0x9b0e=['sequelize','exports'];(function(_0xd83613,_0x1c6e5b){var _0x4516f8=function(_0x3efaf5){while(--_0x3efaf5){_0xd83613['push'](_0xd83613['shift']());}};_0x4516f8(++_0x1c6e5b);}(_0x9b0e,0x12c));var _0xe9b0=function(_0x2760fd,_0x5760e9){_0x2760fd=_0x2760fd-0x0;var _0x302046=_0x9b0e[_0x2760fd];return _0x302046;};'use strict';var Sequelize=require(_0xe9b0('0x0'));module[_0xe9b0('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xeb2c=['INTEGER','sequelize'];(function(_0x3f624f,_0x369ab0){var _0x1b99e7=function(_0x2a8093){while(--_0x2a8093){_0x3f624f['push'](_0x3f624f['shift']());}};_0x1b99e7(++_0x369ab0);}(_0xeb2c,0x105));var _0xceb2=function(_0x44a440,_0x21ddad){_0x44a440=_0x44a440-0x0;var _0x53df80=_0xeb2c[_0x44a440];return _0x53df80;};'use strict';var Sequelize=require(_0xceb2('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xceb2('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 b65fdf8..3e7ee59 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 _0x8ab4=['exports','UserChatQueue','user_has_chat_queues','lodash','../../config/logger','bluebird','request-promise','path','rimraf','./userChatQueue.attributes'];(function(_0x4499ed,_0x26249a){var _0x10d27c=function(_0x7f80d6){while(--_0x7f80d6){_0x4499ed['push'](_0x4499ed['shift']());}};_0x10d27c(++_0x26249a);}(_0x8ab4,0xf3));var _0x48ab=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x8ab4[_0x5f0089];return _0x193892;};'use strict';var _=require(_0x48ab('0x0'));var util=require('util');var logger=require(_0x48ab('0x1'))('api');var moment=require('moment');var BPromise=require(_0x48ab('0x2'));var rp=require(_0x48ab('0x3'));var fs=require('fs');var path=require(_0x48ab('0x4'));var rimraf=require(_0x48ab('0x5'));var config=require('../../config/environment');var attributes=require(_0x48ab('0x6'));module[_0x48ab('0x7')]=function(_0x7e74de,_0x15c5f2){return _0x7e74de['define'](_0x48ab('0x8'),attributes,{'tableName':_0x48ab('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb155=['rimraf','../../config/environment','./userChatQueue.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xea8476,_0x187479){var _0x307e6f=function(_0x13262d){while(--_0x13262d){_0xea8476['push'](_0xea8476['shift']());}};_0x307e6f(++_0x187479);}(_0xb155,0x198));var _0x5b15=function(_0x34b821,_0x504e55){_0x34b821=_0x34b821-0x0;var _0x5e00a0=_0xb155[_0x34b821];return _0x5e00a0;};'use strict';var _=require(_0x5b15('0x0'));var util=require(_0x5b15('0x1'));var logger=require(_0x5b15('0x2'))(_0x5b15('0x3'));var moment=require(_0x5b15('0x4'));var BPromise=require(_0x5b15('0x5'));var rp=require(_0x5b15('0x6'));var fs=require('fs');var path=require(_0x5b15('0x7'));var rimraf=require(_0x5b15('0x8'));var config=require(_0x5b15('0x9'));var attributes=require(_0x5b15('0xa'));module[_0x5b15('0xb')]=function(_0x490d55,_0x18a3f4){return _0x490d55[_0x5b15('0xc')]('UserChatQueue',attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index a46324b..106e6b9 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 _0xa11d=['../../config/logger','rpc','../../config/environment','client','request','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','UserChatQueue,\x20%s,\x20%s','result','catch','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x673722,_0x275d7e){var _0x21249c=function(_0x25b4e7){while(--_0x25b4e7){_0x673722['push'](_0x673722['shift']());}};_0x21249c(++_0x275d7e);}(_0xa11d,0x177));var _0xda11=function(_0x57d6d6,_0x55f331){_0x57d6d6=_0x57d6d6-0x0;var _0x2f28b5=_0xa11d[_0x57d6d6];return _0x2f28b5;};'use strict';var _=require('lodash');var util=require(_0xda11('0x0'));var moment=require(_0xda11('0x1'));var BPromise=require('bluebird');var rs=require(_0xda11('0x2'));var fs=require('fs');var Redis=require(_0xda11('0x3'));var db=require(_0xda11('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xda11('0x5'))(_0xda11('0x6'));var config=require(_0xda11('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xda11('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e08ee,_0x12e0b9,_0x14be71){return new BPromise(function(_0x2c1964,_0x94892c){return client[_0xda11('0x9')](_0x4e08ee,_0x14be71)['then'](function(_0x1e7acc){logger['info']('UserChatQueue,\x20%s,\x20%s',_0x12e0b9,'request\x20sent');logger[_0xda11('0xa')](_0xda11('0xb'),_0x12e0b9,_0xda11('0xc'),JSON[_0xda11('0xd')](_0x1e7acc));if(_0x1e7acc[_0xda11('0xe')]){if(_0x1e7acc['error'][_0xda11('0xf')]===0x1f4){logger[_0xda11('0xe')]('UserChatQueue,\x20%s,\x20%s',_0x12e0b9,_0x1e7acc[_0xda11('0xe')][_0xda11('0x10')]);return _0x94892c(_0x1e7acc[_0xda11('0xe')][_0xda11('0x10')]);}logger[_0xda11('0xe')](_0xda11('0x11'),_0x12e0b9,_0x1e7acc[_0xda11('0xe')][_0xda11('0x10')]);return _0x2c1964(_0x1e7acc[_0xda11('0xe')][_0xda11('0x10')]);}else{logger['info']('UserChatQueue,\x20%s,\x20%s',_0x12e0b9,_0xda11('0xc'));_0x2c1964(_0x1e7acc[_0xda11('0x12')][_0xda11('0x10')]);}})[_0xda11('0x13')](function(_0x398760){logger['error'](_0xda11('0x11'),_0x12e0b9,_0x398760);_0x94892c(_0x398760);});});} \ No newline at end of file +var _0x1eaf=['debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','UserChatQueue,\x20%s,\x20%s','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent'];(function(_0x567849,_0x5c2294){var _0xc68d9c=function(_0x3a4ee1){while(--_0x3a4ee1){_0x567849['push'](_0x567849['shift']());}};_0xc68d9c(++_0x5c2294);}(_0x1eaf,0x17e));var _0xf1ea=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x1eaf[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0xf1ea('0x0'));var moment=require('moment');var BPromise=require(_0xf1ea('0x1'));var rs=require(_0xf1ea('0x2'));var fs=require('fs');var Redis=require(_0xf1ea('0x3'));var db=require(_0xf1ea('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf1ea('0x5'))(_0xf1ea('0x6'));var config=require(_0xf1ea('0x7'));var jayson=require(_0xf1ea('0x8'));var client=jayson['client'][_0xf1ea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x195689,_0x59457d,_0x32e4dc){return new BPromise(function(_0x312cad,_0x4739b1){return client[_0xf1ea('0xa')](_0x195689,_0x32e4dc)[_0xf1ea('0xb')](function(_0x4543ba){logger[_0xf1ea('0xc')]('UserChatQueue,\x20%s,\x20%s',_0x59457d,_0xf1ea('0xd'));logger[_0xf1ea('0xe')](_0xf1ea('0xf'),_0x59457d,_0xf1ea('0xd'),JSON[_0xf1ea('0x10')](_0x4543ba));if(_0x4543ba[_0xf1ea('0x11')]){if(_0x4543ba['error']['code']===0x1f4){logger[_0xf1ea('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x59457d,_0x4543ba['error']['message']);return _0x4739b1(_0x4543ba[_0xf1ea('0x11')][_0xf1ea('0x12')]);}logger[_0xf1ea('0x11')](_0xf1ea('0x13'),_0x59457d,_0x4543ba['error'][_0xf1ea('0x12')]);return _0x312cad(_0x4543ba['error'][_0xf1ea('0x12')]);}else{logger[_0xf1ea('0xc')](_0xf1ea('0x13'),_0x59457d,'request\x20sent');_0x312cad(_0x4543ba[_0xf1ea('0x14')]['message']);}})[_0xf1ea('0x15')](function(_0x10a947){logger[_0xf1ea('0x11')](_0xf1ea('0x13'),_0x59457d,_0x10a947);_0x4739b1(_0x10a947);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index a180768..2142bf3 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x421a0d,_0x4f3bc0){var _0x14068d=function(_0x893ff5){while(--_0x893ff5){_0x421a0d['push'](_0x421a0d['shift']());}};_0x14068d(++_0x4f3bc0);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x4f3309,_0x5092e3){var _0x9f0fb7=function(_0x515e0c){while(--_0x515e0c){_0x4f3309['push'](_0x4f3309['shift']());}};_0x9f0fb7(++_0x5092e3);}(_0x70e0,0x17b));var _0x070e=function(_0x4dbaa0,_0x2b764e){_0x4dbaa0=_0x4dbaa0-0x0;var _0x4359ff=_0x70e0[_0x4dbaa0];return _0x4359ff;};'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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 75de763..d21e35c 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 _0xb146=['STRING','exports','INTEGER'];(function(_0x4e34d4,_0x104f6d){var _0x43b30d=function(_0x13d0dc){while(--_0x13d0dc){_0x4e34d4['push'](_0x4e34d4['shift']());}};_0x43b30d(++_0x104f6d);}(_0xb146,0xf4));var _0x6b14=function(_0x1e2dce,_0x5b6ee9){_0x1e2dce=_0x1e2dce-0x0;var _0x574086=_0xb146[_0x1e2dce];return _0x574086;};'use strict';var Sequelize=require('sequelize');module[_0x6b14('0x0')]={'penalty':{'type':Sequelize[_0x6b14('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x6b14('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x6b14('0x2')]}}; \ No newline at end of file +var _0x089a=['INTEGER','sequelize','exports'];(function(_0x378d3b,_0x116b94){var _0x462153=function(_0xb5658){while(--_0xb5658){_0x378d3b['push'](_0x378d3b['shift']());}};_0x462153(++_0x116b94);}(_0x089a,0x112));var _0xa089=function(_0x2f5658,_0x1935a5){_0x2f5658=_0x2f5658-0x0;var _0x54c3ed=_0x089a[_0x2f5658];return _0x54c3ed;};'use strict';var Sequelize=require(_0xa089('0x0'));module[_0xa089('0x1')]={'penalty':{'type':Sequelize[_0xa089('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index a05e779..924b8c5 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 _0x3ee2=['request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','moment','bluebird'];(function(_0x453b22,_0x48dcec){var _0x28c275=function(_0x2ab11d){while(--_0x2ab11d){_0x453b22['push'](_0x453b22['shift']());}};_0x28c275(++_0x48dcec);}(_0x3ee2,0x64));var _0x23ee=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x3ee2[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x23ee('0x0'));var util=require(_0x23ee('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x23ee('0x2'));var BPromise=require(_0x23ee('0x3'));var rp=require(_0x23ee('0x4'));var fs=require('fs');var path=require(_0x23ee('0x5'));var rimraf=require(_0x23ee('0x6'));var config=require(_0x23ee('0x7'));var attributes=require(_0x23ee('0x8'));module[_0x23ee('0x9')]=function(_0x54678e,_0x42eb2f){return _0x54678e[_0x23ee('0xa')](_0x23ee('0xb'),attributes,{'tableName':_0x23ee('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x497d=['api','bluebird','request-promise','path','../../config/environment','./userFaxQueue.attributes','UserFaxQueue','user_has_fax_queues'];(function(_0x65c50e,_0x1aa926){var _0x4573e7=function(_0x5bc049){while(--_0x5bc049){_0x65c50e['push'](_0x65c50e['shift']());}};_0x4573e7(++_0x1aa926);}(_0x497d,0xf0));var _0xd497=function(_0xa5c3a0,_0x20dd0a){_0xa5c3a0=_0xa5c3a0-0x0;var _0x3cec3d=_0x497d[_0xa5c3a0];return _0x3cec3d;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xd497('0x0'));var moment=require('moment');var BPromise=require(_0xd497('0x1'));var rp=require(_0xd497('0x2'));var fs=require('fs');var path=require(_0xd497('0x3'));var rimraf=require('rimraf');var config=require(_0xd497('0x4'));var attributes=require(_0xd497('0x5'));module['exports']=function(_0x1a4edb,_0xc16605){return _0x1a4edb['define'](_0xd497('0x6'),attributes,{'tableName':_0xd497('0x7'),'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 9ee8036..af803b5 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 _0xacad=['message','result','catch','util','bluebird','../../mysqldb','client','http','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x529131,_0x15bf34){var _0x3e648b=function(_0x2d9a60){while(--_0x2d9a60){_0x529131['push'](_0x529131['shift']());}};_0x3e648b(++_0x15bf34);}(_0xacad,0xbe));var _0xdaca=function(_0x4aa996,_0x1f045a){_0x4aa996=_0x4aa996-0x0;var _0x372e0a=_0xacad[_0x4aa996];return _0x372e0a;};'use strict';var _=require('lodash');var util=require(_0xdaca('0x0'));var moment=require('moment');var BPromise=require(_0xdaca('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdaca('0x2'))['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[_0xdaca('0x3')][_0xdaca('0x4')]({'port':0x232a});function respondWithRpcPromise(_0x5f300f,_0x4f2415,_0xe15501){return new BPromise(function(_0x38275e,_0x2e806b){return client['request'](_0x5f300f,_0xe15501)[_0xdaca('0x5')](function(_0x28f6b4){logger[_0xdaca('0x6')](_0xdaca('0x7'),_0x4f2415,_0xdaca('0x8'));logger[_0xdaca('0x9')](_0xdaca('0xa'),_0x4f2415,_0xdaca('0x8'),JSON[_0xdaca('0xb')](_0x28f6b4));if(_0x28f6b4['error']){if(_0x28f6b4[_0xdaca('0xc')][_0xdaca('0xd')]===0x1f4){logger['error'](_0xdaca('0x7'),_0x4f2415,_0x28f6b4[_0xdaca('0xc')][_0xdaca('0xe')]);return _0x2e806b(_0x28f6b4[_0xdaca('0xc')][_0xdaca('0xe')]);}logger[_0xdaca('0xc')](_0xdaca('0x7'),_0x4f2415,_0x28f6b4[_0xdaca('0xc')][_0xdaca('0xe')]);return _0x38275e(_0x28f6b4['error'][_0xdaca('0xe')]);}else{logger[_0xdaca('0x6')](_0xdaca('0x7'),_0x4f2415,_0xdaca('0x8'));_0x38275e(_0x28f6b4[_0xdaca('0xf')][_0xdaca('0xe')]);}})[_0xdaca('0x10')](function(_0x3fea9f){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x4f2415,_0x3fea9f);_0x2e806b(_0x3fea9f);});});} \ No newline at end of file +var _0x7c2a=['message','info','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x7c2a,0x17e));var _0xa7c2=function(_0x2c38a8,_0x31e01f){_0x2c38a8=_0x2c38a8-0x0;var _0x441655=_0x7c2a[_0x2c38a8];return _0x441655;};'use strict';var _=require('lodash');var util=require(_0xa7c2('0x0'));var moment=require(_0xa7c2('0x1'));var BPromise=require('bluebird');var rs=require(_0xa7c2('0x2'));var fs=require('fs');var Redis=require(_0xa7c2('0x3'));var db=require(_0xa7c2('0x4'))['db'];var utils=require(_0xa7c2('0x5'));var logger=require(_0xa7c2('0x6'))(_0xa7c2('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xa7c2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x38a95e,_0x46398a,_0x91791c){return new BPromise(function(_0x241315,_0x2f5d28){return client[_0xa7c2('0x9')](_0x38a95e,_0x91791c)[_0xa7c2('0xa')](function(_0x5b3b55){logger['info'](_0xa7c2('0xb'),_0x46398a,'request\x20sent');logger[_0xa7c2('0xc')](_0xa7c2('0xd'),_0x46398a,_0xa7c2('0xe'),JSON['stringify'](_0x5b3b55));if(_0x5b3b55['error']){if(_0x5b3b55[_0xa7c2('0xf')][_0xa7c2('0x10')]===0x1f4){logger[_0xa7c2('0xf')](_0xa7c2('0xb'),_0x46398a,_0x5b3b55[_0xa7c2('0xf')][_0xa7c2('0x11')]);return _0x2f5d28(_0x5b3b55[_0xa7c2('0xf')][_0xa7c2('0x11')]);}logger[_0xa7c2('0xf')](_0xa7c2('0xb'),_0x46398a,_0x5b3b55[_0xa7c2('0xf')][_0xa7c2('0x11')]);return _0x241315(_0x5b3b55['error'][_0xa7c2('0x11')]);}else{logger[_0xa7c2('0x12')](_0xa7c2('0xb'),_0x46398a,'request\x20sent');_0x241315(_0x5b3b55['result'][_0xa7c2('0x11')]);}})['catch'](function(_0x65bb01){logger[_0xa7c2('0xf')](_0xa7c2('0xb'),_0x46398a,_0x65bb01);_0x2f5d28(_0x65bb01);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 47103a5..b10eff0 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x382af1,_0x44e6d1){var _0x31d1ca=function(_0x453d93){while(--_0x453d93){_0x382af1['push'](_0x382af1['shift']());}};_0x31d1ca(++_0x44e6d1);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x2260f3,_0x1b433c){var _0xb76562=function(_0x31409e){while(--_0x31409e){_0x2260f3['push'](_0x2260f3['shift']());}};_0xb76562(++_0x1b433c);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index e5b9afe..bd85bdf 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 _0x2e8c=['INTEGER','sequelize'];(function(_0x2f622a,_0x55ef9){var _0x4b7cc9=function(_0x7c6ce3){while(--_0x7c6ce3){_0x2f622a['push'](_0x2f622a['shift']());}};_0x4b7cc9(++_0x55ef9);}(_0x2e8c,0xbd));var _0xc2e8=function(_0x5645e8,_0x4bc838){_0x5645e8=_0x5645e8-0x0;var _0x565601=_0x2e8c[_0x5645e8];return _0x565601;};'use strict';var Sequelize=require(_0xc2e8('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xc2e8('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa0bf=['INTEGER','exports'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xa0bf,0xcd));var _0xfa0b=function(_0x250d2c,_0x948c48){_0x250d2c=_0x250d2c-0x0;var _0x42c1ed=_0xa0bf[_0x250d2c];return _0x42c1ed;};'use strict';var Sequelize=require('sequelize');module[_0xfa0b('0x0')]={'penalty':{'type':Sequelize[_0xfa0b('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index ee5d2b4..4d33c34 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 _0x44f4=['util','api','moment','bluebird','request-promise','path','rimraf','./userMailQueue.attributes','define','UserMailQueue'];(function(_0x53b74a,_0x40eddd){var _0x5a7c78=function(_0x465f38){while(--_0x465f38){_0x53b74a['push'](_0x53b74a['shift']());}};_0x5a7c78(++_0x40eddd);}(_0x44f4,0x15e));var _0x444f=function(_0xf67efa,_0x18bc5e){_0xf67efa=_0xf67efa-0x0;var _0x32ab57=_0x44f4[_0xf67efa];return _0x32ab57;};'use strict';var _=require('lodash');var util=require(_0x444f('0x0'));var logger=require('../../config/logger')(_0x444f('0x1'));var moment=require(_0x444f('0x2'));var BPromise=require(_0x444f('0x3'));var rp=require(_0x444f('0x4'));var fs=require('fs');var path=require(_0x444f('0x5'));var rimraf=require(_0x444f('0x6'));var config=require('../../config/environment');var attributes=require(_0x444f('0x7'));module['exports']=function(_0x5e9621,_0x2dbef4){return _0x5e9621[_0x444f('0x8')](_0x444f('0x9'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfb18=['bluebird','request-promise','path','../../config/environment','exports','define','UserMailQueue','user_has_mail_queues','lodash','util','api','moment'];(function(_0x7c9eef,_0x196fbb){var _0x16c4e5=function(_0x2613a6){while(--_0x2613a6){_0x7c9eef['push'](_0x7c9eef['shift']());}};_0x16c4e5(++_0x196fbb);}(_0xfb18,0x1f4));var _0x8fb1=function(_0x754ab4,_0x56daa7){_0x754ab4=_0x754ab4-0x0;var _0x34079a=_0xfb18[_0x754ab4];return _0x34079a;};'use strict';var _=require(_0x8fb1('0x0'));var util=require(_0x8fb1('0x1'));var logger=require('../../config/logger')(_0x8fb1('0x2'));var moment=require(_0x8fb1('0x3'));var BPromise=require(_0x8fb1('0x4'));var rp=require(_0x8fb1('0x5'));var fs=require('fs');var path=require(_0x8fb1('0x6'));var rimraf=require('rimraf');var config=require(_0x8fb1('0x7'));var attributes=require('./userMailQueue.attributes');module[_0x8fb1('0x8')]=function(_0xae7a6a,_0x5f58c5){return _0xae7a6a[_0x8fb1('0x9')](_0x8fb1('0xa'),attributes,{'tableName':_0x8fb1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 645bd4b..9747316 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 _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x5d4a08,_0x2e4941){var _0xd10640=function(_0x2da69b){while(--_0x2da69b){_0x5d4a08['push'](_0x5d4a08['shift']());}};_0xd10640(++_0x2e4941);}(_0x34e8,0x12c));var _0x834e=function(_0x131744,_0x5e7023){_0x131744=_0x131744-0x0;var _0x1291ed=_0x34e8[_0x131744];return _0x1291ed;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52056d,_0x3e16d2,_0x3cc2e3){return new BPromise(function(_0x3a3ef6,_0x2e69e2){return client[_0x834e('0xc')](_0x52056d,_0x3cc2e3)[_0x834e('0xd')](function(_0x363786){logger[_0x834e('0xe')](_0x834e('0xf'),_0x3e16d2,_0x834e('0x10'));logger[_0x834e('0x11')](_0x834e('0x12'),_0x3e16d2,_0x834e('0x10'),JSON[_0x834e('0x13')](_0x363786));if(_0x363786[_0x834e('0x14')]){if(_0x363786[_0x834e('0x14')][_0x834e('0x15')]===0x1f4){logger['error'](_0x834e('0xf'),_0x3e16d2,_0x363786[_0x834e('0x14')]['message']);return _0x2e69e2(_0x363786[_0x834e('0x14')][_0x834e('0x16')]);}logger[_0x834e('0x14')](_0x834e('0xf'),_0x3e16d2,_0x363786['error'][_0x834e('0x16')]);return _0x3a3ef6(_0x363786[_0x834e('0x14')]['message']);}else{logger[_0x834e('0xe')]('UserMailQueue,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('UserMailQueue,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x258ac3,_0x3e7a2f){var _0x209cd9=function(_0x3d5ac1){while(--_0x3d5ac1){_0x258ac3['push'](_0x258ac3['shift']());}};_0x209cd9(++_0x3e7a2f);}(_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']('UserMailQueue,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index a5fe0d4..3437991 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 _0x2114=['../../components/auth/service','../../components/interaction/service','./userNotification.controller','post','isAuthenticated','util','express','Router'];(function(_0x2a295d,_0x43f2a1){var _0x25dc6d=function(_0x452b1d){while(--_0x452b1d){_0x2a295d['push'](_0x2a295d['shift']());}};_0x25dc6d(++_0x43f2a1);}(_0x2114,0x1dd));var _0x4211=function(_0x2a55f8,_0x540ac4){_0x2a55f8=_0x2a55f8-0x0;var _0x245efd=_0x2114[_0x2a55f8];return _0x245efd;};'use strict';var multer=require('multer');var util=require(_0x4211('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4211('0x1'));var router=express[_0x4211('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x4211('0x3'));var interaction=require(_0x4211('0x4'));var config=require('../../config/environment');var controller=require(_0x4211('0x5'));router[_0x4211('0x6')]('/',auth[_0x4211('0x7')](),controller['sendUserNotification']);module['exports']=router; \ No newline at end of file +var _0xc7b1=['../../components/interaction/service','./userNotification.controller','post','isAuthenticated','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x5c4887,_0x282565){var _0x365b8e=function(_0x224da6){while(--_0x224da6){_0x5c4887['push'](_0x5c4887['shift']());}};_0x365b8e(++_0x282565);}(_0xc7b1,0xc0));var _0x1c7b=function(_0x380a3f,_0x202483){_0x380a3f=_0x380a3f-0x0;var _0x2b4eca=_0xc7b1[_0x380a3f];return _0x2b4eca;};'use strict';var multer=require(_0x1c7b('0x0'));var util=require(_0x1c7b('0x1'));var path=require(_0x1c7b('0x2'));var timeout=require(_0x1c7b('0x3'));var express=require(_0x1c7b('0x4'));var router=express['Router']();var fs_extra=require(_0x1c7b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1c7b('0x6'));var config=require('../../config/environment');var controller=require(_0x1c7b('0x7'));router[_0x1c7b('0x8')]('/',auth[_0x1c7b('0x9')](),controller['sendUserNotification']);module[_0x1c7b('0xa')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index c72a018..f49c88d 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 _0xf90b=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x491030,_0x393f19){var _0x48544e=function(_0x2cb89a){while(--_0x2cb89a){_0x491030['push'](_0x491030['shift']());}};_0x48544e(++_0x393f19);}(_0xf90b,0x1cf));var _0xbf90=function(_0xaaa111,_0x3e714a){_0xaaa111=_0xaaa111-0x0;var _0x2a33d4=_0xf90b[_0xaaa111];return _0x2a33d4;};'use strict';var Sequelize=require(_0xbf90('0x0'));module[_0xbf90('0x1')]={'body':{'type':Sequelize[_0xbf90('0x2')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0xbf90('0x2')]},'recipientsDescription':{'type':Sequelize[_0xbf90('0x3')]},'beep':{'type':Sequelize[_0xbf90('0x4')]}}; \ No newline at end of file +var _0x477c=['TEXT','BOOLEAN','sequelize','exports','STRING'];(function(_0x4bad3e,_0x5c88a7){var _0x4ebdb6=function(_0x1ec99b){while(--_0x1ec99b){_0x4bad3e['push'](_0x4bad3e['shift']());}};_0x4ebdb6(++_0x5c88a7);}(_0x477c,0x133));var _0xc477=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x477c[_0x4e676e];return _0x336a3c;};'use strict';var Sequelize=require(_0xc477('0x0'));module[_0xc477('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0xc477('0x2')]},'recipientsId':{'type':Sequelize[_0xc477('0x3')]},'recipientsDescription':{'type':Sequelize[_0xc477('0x2')]},'beep':{'type':Sequelize[_0xc477('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index abbb924..901fc9b 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 _0xf5c9=['name','sendUserNotification','text','body','hasOwnProperty','TemplateId','ValidationError','view','Sequelize','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','smsqueue','voicequeue','whatsappqueue','team','user','includes','toLowerCase','senderName','fullname','isEmpty','recipientsDescription','beep','SenderId','recipientsId','join','sequelize','transaction','forEach','recipient','userNotification:send','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','model','union','queue','Queue','ids','getAgents','map','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack'];(function(_0x5dc929,_0x2bb616){var _0x3c610b=function(_0x3ccf8b){while(--_0x3ccf8b){_0x5dc929['push'](_0x5dc929['shift']());}};_0x3c610b(++_0x2bb616);}(_0xf5c9,0x1b8));var _0x9f5c=function(_0x69db80,_0x188d9d){_0x69db80=_0x69db80-0x0;var _0x170879=_0xf5c9[_0x69db80];return _0x170879;};'use strict';var emlformat=require(_0x9f5c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9f5c('0x1'));var rp=require('request-promise');var moment=require(_0x9f5c('0x2'));var BPromise=require(_0x9f5c('0x3'));var Mustache=require(_0x9f5c('0x4'));var util=require(_0x9f5c('0x5'));var path=require(_0x9f5c('0x6'));var sox=require(_0x9f5c('0x7'));var csv=require(_0x9f5c('0x8'));var ejs=require(_0x9f5c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9f5c('0xa'));var squel=require(_0x9f5c('0xb'));var crypto=require('crypto');var jsforce=require(_0x9f5c('0xc'));var deskjs=require(_0x9f5c('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9f5c('0xe'));var Redis=require(_0x9f5c('0xf'));var authService=require(_0x9f5c('0x10'));var qs=require(_0x9f5c('0x11'));var as=require(_0x9f5c('0x12'));var hardwareService=require(_0x9f5c('0x13'));var logger=require(_0x9f5c('0x14'))('api');var utils=require(_0x9f5c('0x15'));var config=require(_0x9f5c('0x16'));var licenseUtil=require(_0x9f5c('0x17'));var db=require(_0x9f5c('0x18'))['db'];config[_0x9f5c('0x19')]=_[_0x9f5c('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9f5c('0x1b'))(new Redis(config[_0x9f5c('0x19')]));require('./userNotification.socket')[_0x9f5c('0x1c')](socket);function respondWithStatusCode(_0x5940cd,_0x2597a5){_0x2597a5=_0x2597a5||0xcc;return function(_0x3c939f){if(_0x3c939f){return _0x5940cd[_0x9f5c('0x1d')](_0x2597a5);}return _0x5940cd['status'](_0x2597a5)[_0x9f5c('0x1e')]();};}function respondWithResult(_0x378f21,_0x4665c6){_0x4665c6=_0x4665c6||0xc8;return function(_0x3b6939){if(_0x3b6939){return _0x378f21[_0x9f5c('0x1f')](_0x4665c6)[_0x9f5c('0x20')](_0x3b6939);}};}function respondWithFilteredResult(_0x2a9018,_0x39a4d5){return function(_0x22b9bb){if(_0x22b9bb){var _0x3a92b9=typeof _0x39a4d5[_0x9f5c('0x21')]===_0x9f5c('0x22')&&typeof _0x39a4d5[_0x9f5c('0x23')]===_0x9f5c('0x22');var _0x1f58f5=_0x22b9bb[_0x9f5c('0x24')];var _0x3f553f=_0x3a92b9?0x0:_0x39a4d5[_0x9f5c('0x21')];var _0x25c8df=_0x3a92b9?_0x22b9bb['count']:_0x39a4d5[_0x9f5c('0x21')]+_0x39a4d5[_0x9f5c('0x23')];var _0x3d8897;if(_0x25c8df>=_0x1f58f5){_0x25c8df=_0x1f58f5;_0x3d8897=0xc8;}else{_0x3d8897=0xce;}_0x2a9018['status'](_0x3d8897);return _0x2a9018[_0x9f5c('0x25')](_0x9f5c('0x26'),_0x3f553f+'-'+_0x25c8df+'/'+_0x1f58f5)[_0x9f5c('0x20')](_0x22b9bb);}return null;};}function patchUpdates(_0x4033cf){return function(_0xfcdf5){try{jsonpatch['apply'](_0xfcdf5,_0x4033cf,!![]);}catch(_0x7b20f7){return BPromise[_0x9f5c('0x27')](_0x7b20f7);}return _0xfcdf5[_0x9f5c('0x28')]();};}function saveUpdates(_0x19d23b,_0x4830a5){return function(_0x5b7f7a){if(_0x5b7f7a){return _0x5b7f7a[_0x9f5c('0x29')](_0x19d23b)[_0x9f5c('0x2a')](function(_0x8fdb9){return _0x8fdb9;});}return null;};}function removeEntity(_0x1030cf,_0x19d74c){return function(_0xe8edcb){if(_0xe8edcb){return _0xe8edcb[_0x9f5c('0x2b')]()[_0x9f5c('0x2a')](function(){_0x1030cf[_0x9f5c('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x378536,_0x4b36bf){return function(_0x57cf9f){if(!_0x57cf9f){_0x378536['sendStatus'](0x194);}return _0x57cf9f;};}function handleError(_0x58b184,_0x255243){_0x255243=_0x255243||0x1f4;return function(_0x2de122){logger['error'](_0x2de122[_0x9f5c('0x2c')]);if(_0x2de122[_0x9f5c('0x2d')]){delete _0x2de122[_0x9f5c('0x2d')];}_0x58b184[_0x9f5c('0x1f')](_0x255243)['send'](_0x2de122);};}exports[_0x9f5c('0x2e')]=function(_0xa917b3,_0x1e0767,_0x567b45){if(!_0xa917b3['body']['hasOwnProperty'](_0x9f5c('0x2f'))&&!_0xa917b3[_0x9f5c('0x30')][_0x9f5c('0x31')](_0x9f5c('0x32'))){throw new db['Sequelize'][(_0x9f5c('0x33'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0xa917b3[_0x9f5c('0x30')][_0x9f5c('0x31')](_0x9f5c('0x32'))&&!_0xa917b3[_0x9f5c('0x30')][_0x9f5c('0x31')](_0x9f5c('0x34'))){throw new db[(_0x9f5c('0x35'))][(_0x9f5c('0x33'))](_0x9f5c('0x36'));}if(!_0xa917b3['body'][_0x9f5c('0x31')](_0x9f5c('0x37'))){throw new db['Sequelize'][(_0x9f5c('0x33'))](_0x9f5c('0x38'));}else{try{var _0xb23dba=JSON[_0x9f5c('0x39')](_0xa917b3[_0x9f5c('0x30')]['recipients']);}catch(_0x464325){logger[_0x9f5c('0x3a')](_0x464325);throw new db[(_0x9f5c('0x35'))]['ValidationError'](_0x9f5c('0x3b'));}var _0x4ee16c=[_0x9f5c('0x3c'),_0x9f5c('0x3d'),_0x9f5c('0x3e'),'openchannelqueue',_0x9f5c('0x3f'),_0x9f5c('0x40'),_0x9f5c('0x41'),_0x9f5c('0x42'),_0x9f5c('0x43')];if(_['some'](_0xb23dba,function(_0x7c23e0){return!_[_0x9f5c('0x44')](_0x4ee16c,_0x7c23e0['model'][_0x9f5c('0x45')]());})){throw new db[(_0x9f5c('0x35'))][(_0x9f5c('0x33'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x4fb4e2={};_0x4fb4e2[_0x9f5c('0x46')]=_0xa917b3['body']['hasOwnProperty']('senderName')?_0xa917b3['body'][_0x9f5c('0x46')]:_0xa917b3['user'][_0x9f5c('0x47')];_0x4fb4e2['recipientsDescription']=_[_0x9f5c('0x48')](_0xa917b3['body'][_0x9f5c('0x49')])?null:_0xa917b3['body'][_0x9f5c('0x49')];_0x4fb4e2[_0x9f5c('0x4a')]=_0xa917b3['body'][_0x9f5c('0x4a')]||![];_0x4fb4e2[_0x9f5c('0x4b')]=_0xa917b3[_0x9f5c('0x43')]['id'];return getContent(_0xa917b3['body'])[_0x9f5c('0x2a')](function(_0x26f700){_0x4fb4e2[_0x9f5c('0x30')]=_0x26f700;return getRecipients(_0xb23dba);})[_0x9f5c('0x2a')](function(_0x361a0e){_0x4fb4e2[_0x9f5c('0x4c')]=_['sortBy'](_0x361a0e)[_0x9f5c('0x4d')](',');return db[_0x9f5c('0x4e')][_0x9f5c('0x4f')](function(_0x31aba1){return db['UserNotification']['create'](_0x4fb4e2,{'raw':!![],'transaction':_0x31aba1})['then'](function(_0x113ead){var _0x56a8f1={'sender':_0x4fb4e2[_0x9f5c('0x46')],'description':_0x4fb4e2[_0x9f5c('0x49')],'content':_0x4fb4e2['body'],'beep':_0x4fb4e2[_0x9f5c('0x4a')]};_0x361a0e[_0x9f5c('0x50')](function(_0x59ec6a){_0x56a8f1[_0x9f5c('0x51')]=_0x59ec6a;socket['emit'](_0x9f5c('0x52'),_0x56a8f1);});return _0x113ead;});});})[_0x9f5c('0x2a')](respondWithResult(_0x1e0767,0xc9))[_0x9f5c('0x53')](handleError(_0x1e0767,null));};function getContent(_0x522d41){return new BPromise(function(_0x3b89d5,_0x19b5b6){if(_0x522d41[_0x9f5c('0x2f')]){_0x3b89d5(_0x522d41['text']);return;}return db[_0x9f5c('0x54')][_0x9f5c('0x55')]({'attributes':[_0x9f5c('0x56')],'where':{'id':_0x522d41[_0x9f5c('0x32')]},'raw':!![]})[_0x9f5c('0x2a')](function(_0x2e0966){if(!_0x2e0966)throw new db[(_0x9f5c('0x35'))][(_0x9f5c('0x33'))](_0x9f5c('0x57'));var _0x191ab5=Mustache[_0x9f5c('0x58')](_0x2e0966[_0x9f5c('0x56')],_0x522d41[_0x9f5c('0x34')]);_0x3b89d5(_0x191ab5);})['catch'](function(_0x51a116){_0x19b5b6(_0x51a116);});});}function getRecipients(_0x55b6c8){return new BPromise(function(_0x58e68d,_0x567c0f){var _0x31f414=[];var _0x296ba0=[];_0x55b6c8[_0x9f5c('0x50')](function(_0x4e7f9b){var _0x4ad361=_[_0x9f5c('0x59')](_0x4e7f9b[_0x9f5c('0x5a')]['toLowerCase']());if(_0x4ad361==='User'){_0x31f414=_[_0x9f5c('0x5b')](_0x31f414,_0x4e7f9b['ids']);}else{if(_[_0x9f5c('0x44')](_0x4ad361,_0x9f5c('0x5c')))_0x4ad361=_0x4ad361['replace'](_0x9f5c('0x5c'),_0x9f5c('0x5d'));_0x4e7f9b[_0x9f5c('0x5e')]['forEach'](function(_0x4d96cb){_0x296ba0['push'](getAgents(_0x4ad361,_0x4d96cb));});}});return BPromise['all'](_0x296ba0)[_0x9f5c('0x2a')](function(_0x51e5b6){_0x31f414=_[_0x9f5c('0x5b')](_0x31f414,_['flatten'](_0x51e5b6));_0x58e68d(_0x31f414);})[_0x9f5c('0x53')](function(_0x53fcac){_0x567c0f(_0x53fcac);});});}function getAgents(_0x1bd97a,_0x50516b){return new BPromise(function(_0x3706a1,_0x4f7542){return db[_0x1bd97a]['findOne']({'where':{'id':_0x50516b}})['then'](function(_0x233599){return _0x233599[_0x9f5c('0x5f')]({'attributes':['id'],'raw':!![]})[_0x9f5c('0x2a')](function(_0x4b2a3a){var _0x51ee75=_[_0x9f5c('0x60')](_0x4b2a3a,'id');_0x3706a1(_0x51ee75);});})['catch'](function(_0x38f404){_0x4f7542(_0x38f404);});});} \ No newline at end of file +var _0xd6c9=['voicequeue','whatsappqueue','team','user','some','includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','isEmpty','recipientsDescription','beep','SenderId','recipientsId','sequelize','transaction','UserNotification','create','forEach','emit','userNotification:send','catch','text','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','union','queue','replace','Queue','push','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','./userNotification.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','name','body','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','parse','chatqueue','faxqueue','openchannelqueue','smsqueue'];(function(_0x4599b6,_0x40c254){var _0x2e014c=function(_0x3c4d90){while(--_0x3c4d90){_0x4599b6['push'](_0x4599b6['shift']());}};_0x2e014c(++_0x40c254);}(_0xd6c9,0xe8));var _0x9d6c=function(_0x59fbe4,_0x3904b4){_0x59fbe4=_0x59fbe4-0x0;var _0x31a4aa=_0xd6c9[_0x59fbe4];return _0x31a4aa;};'use strict';var emlformat=require(_0x9d6c('0x0'));var rimraf=require(_0x9d6c('0x1'));var zipdir=require(_0x9d6c('0x2'));var jsonpatch=require(_0x9d6c('0x3'));var rp=require(_0x9d6c('0x4'));var moment=require('moment');var BPromise=require(_0x9d6c('0x5'));var Mustache=require(_0x9d6c('0x6'));var util=require('util');var path=require('path');var sox=require(_0x9d6c('0x7'));var csv=require('to-csv');var ejs=require(_0x9d6c('0x8'));var fs=require('fs');var fs_extra=require(_0x9d6c('0x9'));var _=require(_0x9d6c('0xa'));var squel=require(_0x9d6c('0xb'));var crypto=require('crypto');var jsforce=require(_0x9d6c('0xc'));var deskjs=require(_0x9d6c('0xd'));var toCsv=require(_0x9d6c('0xe'));var querystring=require(_0x9d6c('0xf'));var Papa=require(_0x9d6c('0x10'));var Redis=require(_0x9d6c('0x11'));var authService=require(_0x9d6c('0x12'));var qs=require(_0x9d6c('0x13'));var as=require(_0x9d6c('0x14'));var hardwareService=require(_0x9d6c('0x15'));var logger=require(_0x9d6c('0x16'))(_0x9d6c('0x17'));var utils=require('../../config/utils');var config=require(_0x9d6c('0x18'));var licenseUtil=require(_0x9d6c('0x19'));var db=require('../../mysqldb')['db'];config[_0x9d6c('0x1a')]=_[_0x9d6c('0x1b')](config[_0x9d6c('0x1a')],{'host':_0x9d6c('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9d6c('0x1d'))[_0x9d6c('0x1e')](socket);function respondWithStatusCode(_0x37ca64,_0x563f79){_0x563f79=_0x563f79||0xcc;return function(_0x39a68a){if(_0x39a68a){return _0x37ca64['sendStatus'](_0x563f79);}return _0x37ca64[_0x9d6c('0x1f')](_0x563f79)[_0x9d6c('0x20')]();};}function respondWithResult(_0x37cc9e,_0x1403cf){_0x1403cf=_0x1403cf||0xc8;return function(_0x5a6c81){if(_0x5a6c81){return _0x37cc9e[_0x9d6c('0x1f')](_0x1403cf)[_0x9d6c('0x21')](_0x5a6c81);}};}function respondWithFilteredResult(_0x24fb15,_0x30b447){return function(_0xa584a1){if(_0xa584a1){var _0x34dab4=typeof _0x30b447[_0x9d6c('0x22')]===_0x9d6c('0x23')&&typeof _0x30b447[_0x9d6c('0x24')]===_0x9d6c('0x23');var _0x56937b=_0xa584a1[_0x9d6c('0x25')];var _0xe8d931=_0x34dab4?0x0:_0x30b447['offset'];var _0x5a8e24=_0x34dab4?_0xa584a1[_0x9d6c('0x25')]:_0x30b447[_0x9d6c('0x22')]+_0x30b447['limit'];var _0x33ebf6;if(_0x5a8e24>=_0x56937b){_0x5a8e24=_0x56937b;_0x33ebf6=0xc8;}else{_0x33ebf6=0xce;}_0x24fb15['status'](_0x33ebf6);return _0x24fb15[_0x9d6c('0x26')](_0x9d6c('0x27'),_0xe8d931+'-'+_0x5a8e24+'/'+_0x56937b)['json'](_0xa584a1);}return null;};}function patchUpdates(_0x52474a){return function(_0x4ac13d){try{jsonpatch[_0x9d6c('0x28')](_0x4ac13d,_0x52474a,!![]);}catch(_0x40638f){return BPromise[_0x9d6c('0x29')](_0x40638f);}return _0x4ac13d[_0x9d6c('0x2a')]();};}function saveUpdates(_0x31ea47,_0x581144){return function(_0x47b1c3){if(_0x47b1c3){return _0x47b1c3[_0x9d6c('0x2b')](_0x31ea47)[_0x9d6c('0x2c')](function(_0x3a76d8){return _0x3a76d8;});}return null;};}function removeEntity(_0x4568e1,_0xa91823){return function(_0x1ff5bb){if(_0x1ff5bb){return _0x1ff5bb['destroy']()[_0x9d6c('0x2c')](function(){_0x4568e1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3de2aa,_0x7a674c){return function(_0x32893d){if(!_0x32893d){_0x3de2aa[_0x9d6c('0x2d')](0x194);}return _0x32893d;};}function handleError(_0x7436ac,_0xa51561){_0xa51561=_0xa51561||0x1f4;return function(_0x39dcaa){logger[_0x9d6c('0x2e')](_0x39dcaa['stack']);if(_0x39dcaa[_0x9d6c('0x2f')]){delete _0x39dcaa[_0x9d6c('0x2f')];}_0x7436ac['status'](_0xa51561)['send'](_0x39dcaa);};}exports['sendUserNotification']=function(_0x2ff82e,_0xa8657e,_0x264200){if(!_0x2ff82e[_0x9d6c('0x30')][_0x9d6c('0x31')]('text')&&!_0x2ff82e['body'][_0x9d6c('0x31')](_0x9d6c('0x32'))){throw new db[(_0x9d6c('0x33'))][(_0x9d6c('0x34'))](_0x9d6c('0x35'));}else{if(_0x2ff82e[_0x9d6c('0x30')]['hasOwnProperty'](_0x9d6c('0x32'))&&!_0x2ff82e['body'][_0x9d6c('0x31')](_0x9d6c('0x36'))){throw new db[(_0x9d6c('0x33'))][(_0x9d6c('0x34'))](_0x9d6c('0x37'));}if(!_0x2ff82e[_0x9d6c('0x30')]['hasOwnProperty'](_0x9d6c('0x38'))){throw new db[(_0x9d6c('0x33'))]['ValidationError']('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x15c816=JSON[_0x9d6c('0x39')](_0x2ff82e[_0x9d6c('0x30')][_0x9d6c('0x38')]);}catch(_0x4f1ca1){logger[_0x9d6c('0x2e')](_0x4f1ca1);throw new db[(_0x9d6c('0x33'))]['ValidationError']('Invalid\x20\x27recipients\x27\x20object');}var _0x4b0fc9=[_0x9d6c('0x3a'),_0x9d6c('0x3b'),'mailqueue',_0x9d6c('0x3c'),_0x9d6c('0x3d'),_0x9d6c('0x3e'),_0x9d6c('0x3f'),_0x9d6c('0x40'),_0x9d6c('0x41')];if(_[_0x9d6c('0x42')](_0x15c816,function(_0x3b7fee){return!_[_0x9d6c('0x43')](_0x4b0fc9,_0x3b7fee[_0x9d6c('0x44')]['toLowerCase']());})){throw new db[(_0x9d6c('0x33'))][(_0x9d6c('0x34'))](_0x9d6c('0x45'));}}}var _0x21a5aa={};_0x21a5aa[_0x9d6c('0x46')]=_0x2ff82e[_0x9d6c('0x30')][_0x9d6c('0x31')](_0x9d6c('0x46'))?_0x2ff82e['body'][_0x9d6c('0x46')]:_0x2ff82e[_0x9d6c('0x41')]['fullname'];_0x21a5aa['recipientsDescription']=_[_0x9d6c('0x47')](_0x2ff82e[_0x9d6c('0x30')]['recipientsDescription'])?null:_0x2ff82e['body'][_0x9d6c('0x48')];_0x21a5aa[_0x9d6c('0x49')]=_0x2ff82e[_0x9d6c('0x30')][_0x9d6c('0x49')]||![];_0x21a5aa[_0x9d6c('0x4a')]=_0x2ff82e[_0x9d6c('0x41')]['id'];return getContent(_0x2ff82e[_0x9d6c('0x30')])['then'](function(_0xded6fc){_0x21a5aa[_0x9d6c('0x30')]=_0xded6fc;return getRecipients(_0x15c816);})[_0x9d6c('0x2c')](function(_0x352bd2){_0x21a5aa[_0x9d6c('0x4b')]=_['sortBy'](_0x352bd2)['join'](',');return db[_0x9d6c('0x4c')][_0x9d6c('0x4d')](function(_0x13c7a7){return db[_0x9d6c('0x4e')][_0x9d6c('0x4f')](_0x21a5aa,{'raw':!![],'transaction':_0x13c7a7})[_0x9d6c('0x2c')](function(_0x288644){var _0x3f4589={'sender':_0x21a5aa[_0x9d6c('0x46')],'description':_0x21a5aa[_0x9d6c('0x48')],'content':_0x21a5aa[_0x9d6c('0x30')],'beep':_0x21a5aa[_0x9d6c('0x49')]};_0x352bd2[_0x9d6c('0x50')](function(_0x284a85){_0x3f4589['recipient']=_0x284a85;socket[_0x9d6c('0x51')](_0x9d6c('0x52'),_0x3f4589);});return _0x288644;});});})[_0x9d6c('0x2c')](respondWithResult(_0xa8657e,0xc9))[_0x9d6c('0x53')](handleError(_0xa8657e,null));};function getContent(_0x4880d5){return new BPromise(function(_0xc8df7a,_0x34f10c){if(_0x4880d5['text']){_0xc8df7a(_0x4880d5[_0x9d6c('0x54')]);return;}return db[_0x9d6c('0x55')][_0x9d6c('0x56')]({'attributes':[_0x9d6c('0x57')],'where':{'id':_0x4880d5[_0x9d6c('0x32')]},'raw':!![]})[_0x9d6c('0x2c')](function(_0x1d3f10){if(!_0x1d3f10)throw new db[(_0x9d6c('0x33'))][(_0x9d6c('0x34'))](_0x9d6c('0x58'));var _0x3d3bcf=Mustache[_0x9d6c('0x59')](_0x1d3f10['html'],_0x4880d5[_0x9d6c('0x36')]);_0xc8df7a(_0x3d3bcf);})[_0x9d6c('0x53')](function(_0x5590e9){_0x34f10c(_0x5590e9);});});}function getRecipients(_0x5abd5b){return new BPromise(function(_0x5f42a1,_0x33d281){var _0x2f5f22=[];var _0x425d7e=[];_0x5abd5b['forEach'](function(_0x3193f6){var _0x1c81e7=_[_0x9d6c('0x5a')](_0x3193f6['model']['toLowerCase']());if(_0x1c81e7==='User'){_0x2f5f22=_[_0x9d6c('0x5b')](_0x2f5f22,_0x3193f6['ids']);}else{if(_[_0x9d6c('0x43')](_0x1c81e7,_0x9d6c('0x5c')))_0x1c81e7=_0x1c81e7[_0x9d6c('0x5d')](_0x9d6c('0x5c'),_0x9d6c('0x5e'));_0x3193f6['ids'][_0x9d6c('0x50')](function(_0x3d27da){_0x425d7e[_0x9d6c('0x5f')](getAgents(_0x1c81e7,_0x3d27da));});}});return BPromise['all'](_0x425d7e)[_0x9d6c('0x2c')](function(_0x3c93d8){_0x2f5f22=_[_0x9d6c('0x5b')](_0x2f5f22,_['flatten'](_0x3c93d8));_0x5f42a1(_0x2f5f22);})[_0x9d6c('0x53')](function(_0x311402){_0x33d281(_0x311402);});});}function getAgents(_0x36d443,_0x3fbf2a){return new BPromise(function(_0x20b085,_0x42ef8b){return db[_0x36d443]['findOne']({'where':{'id':_0x3fbf2a}})[_0x9d6c('0x2c')](function(_0x3cfbc4){return _0x3cfbc4[_0x9d6c('0x60')]({'attributes':['id'],'raw':!![]})[_0x9d6c('0x2c')](function(_0x1ca5a3){var _0x1f182d=_[_0x9d6c('0x61')](_0x1ca5a3,'id');_0x20b085(_0x1f182d);});})[_0x9d6c('0x53')](function(_0x2d6f02){_0x42ef8b(_0x2d6f02);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 40a4e60..808da50 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 _0xf42e=['save','update','exports','events','UserNotification'];(function(_0x8307e3,_0x48eb78){var _0x492db9=function(_0x1284f7){while(--_0x1284f7){_0x8307e3['push'](_0x8307e3['shift']());}};_0x492db9(++_0x48eb78);}(_0xf42e,0x157));var _0xef42=function(_0x251468,_0xbb8228){_0x251468=_0x251468-0x0;var _0xf3f44f=_0xf42e[_0x251468];return _0xf3f44f;};'use strict';var EventEmitter=require(_0xef42('0x0'));var UserNotification=require('../../mysqldb')['db'][_0xef42('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xef42('0x2'),'afterUpdate':_0xef42('0x3'),'afterDestroy':'remove'};function emitEvent(_0x12f078){return function(_0x22e4f7,_0x294e9e,_0x3b1f4c){UserNotificationEvents['emit'](_0x12f078+':'+_0x22e4f7['id'],_0x22e4f7);UserNotificationEvents['emit'](_0x12f078,_0x22e4f7);_0x3b1f4c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0xef42('0x4')]=UserNotificationEvents; \ No newline at end of file +var _0x53e2=['emit','hasOwnProperty','../../mysqldb','UserNotification','setMaxListeners','update'];(function(_0x4d78dc,_0x3830c6){var _0x309d51=function(_0x3d74c2){while(--_0x3d74c2){_0x4d78dc['push'](_0x4d78dc['shift']());}};_0x309d51(++_0x3830c6);}(_0x53e2,0x104));var _0x253e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x53e2[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0x253e('0x0'))['db'][_0x253e('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x253e('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x253e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x489c82){return function(_0x814d12,_0x2b16ac,_0x4ccf0b){UserNotificationEvents['emit'](_0x489c82+':'+_0x814d12['id'],_0x814d12);UserNotificationEvents[_0x253e('0x4')](_0x489c82,_0x814d12);_0x4ccf0b(null);};}for(var e in events){if(events[_0x253e('0x5')](e)){var event=events[e];UserNotification['hook'](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 67d0b48..5f8a199 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 _0x34f6=['api','moment','bluebird','path','rimraf','../../config/environment','exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x405960,_0x3ce278){var _0xd00bcd=function(_0x3ba0e9){while(--_0x3ba0e9){_0x405960['push'](_0x405960['shift']());}};_0xd00bcd(++_0x3ce278);}(_0x34f6,0x8e));var _0x634f=function(_0x14c043,_0x4bebc3){_0x14c043=_0x14c043-0x0;var _0x3e29c8=_0x34f6[_0x14c043];return _0x3e29c8;};'use strict';var _=require(_0x634f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x634f('0x1'));var moment=require(_0x634f('0x2'));var BPromise=require(_0x634f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x634f('0x4'));var rimraf=require(_0x634f('0x5'));var config=require(_0x634f('0x6'));var attributes=require('./userNotification.attributes');module[_0x634f('0x7')]=function(_0xd1a187,_0x40abe4){return _0xd1a187[_0x634f('0x8')](_0x634f('0x9'),attributes,{'tableName':_0x634f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x634f('0xb'),'collate':_0x634f('0xc')});}; \ No newline at end of file +var _0x130d=['define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports'];(function(_0x49f786,_0x307037){var _0x44b69d=function(_0x326fc2){while(--_0x326fc2){_0x49f786['push'](_0x49f786['shift']());}};_0x44b69d(++_0x307037);}(_0x130d,0x1f2));var _0xd130=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x130d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd130('0x0'));var util=require(_0xd130('0x1'));var logger=require(_0xd130('0x2'))(_0xd130('0x3'));var moment=require(_0xd130('0x4'));var BPromise=require(_0xd130('0x5'));var rp=require(_0xd130('0x6'));var fs=require('fs');var path=require(_0xd130('0x7'));var rimraf=require(_0xd130('0x8'));var config=require(_0xd130('0x9'));var attributes=require(_0xd130('0xa'));module[_0xd130('0xb')]=function(_0x38e738,_0x4cbb53){return _0x38e738[_0xd130('0xc')](_0xd130('0xd'),attributes,{'tableName':_0xd130('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd130('0xf'),'collate':_0xd130('0x10')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 931770a..1706159 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 _0x26e9=['code','message','UserNotification,\x20%s,\x20%s','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','request\x20sent','debug','stringify','error'];(function(_0x43269e,_0xdb1160){var _0x17823f=function(_0x1faaea){while(--_0x1faaea){_0x43269e['push'](_0x43269e['shift']());}};_0x17823f(++_0xdb1160);}(_0x26e9,0x1a6));var _0x926e=function(_0x16ae34,_0x1dc6d){_0x16ae34=_0x16ae34-0x0;var _0x184836=_0x26e9[_0x16ae34];return _0x184836;};'use strict';var _=require(_0x926e('0x0'));var util=require('util');var moment=require(_0x926e('0x1'));var BPromise=require(_0x926e('0x2'));var rs=require(_0x926e('0x3'));var fs=require('fs');var Redis=require(_0x926e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x926e('0x5'));var logger=require(_0x926e('0x6'))(_0x926e('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x926e('0x8')][_0x926e('0x9')]({'port':0x232a});config[_0x926e('0xa')]=_[_0x926e('0xb')](config[_0x926e('0xa')],{'host':_0x926e('0xc'),'port':0x18eb});var socket=require(_0x926e('0xd'))(new Redis(config[_0x926e('0xa')]));require(_0x926e('0xe'))[_0x926e('0xf')](socket);function respondWithRpcPromise(_0x1be89a,_0x9e6391,_0x28c153){return new BPromise(function(_0x20a115,_0x35c7d2){return client['request'](_0x1be89a,_0x28c153)['then'](function(_0x2a9136){logger['info']('UserNotification,\x20%s,\x20%s',_0x9e6391,_0x926e('0x10'));logger[_0x926e('0x11')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x9e6391,_0x926e('0x10'),JSON[_0x926e('0x12')](_0x2a9136));if(_0x2a9136['error']){if(_0x2a9136[_0x926e('0x13')][_0x926e('0x14')]===0x1f4){logger['error']('UserNotification,\x20%s,\x20%s',_0x9e6391,_0x2a9136[_0x926e('0x13')][_0x926e('0x15')]);return _0x35c7d2(_0x2a9136[_0x926e('0x13')]['message']);}logger[_0x926e('0x13')](_0x926e('0x16'),_0x9e6391,_0x2a9136['error'][_0x926e('0x15')]);return _0x20a115(_0x2a9136[_0x926e('0x13')][_0x926e('0x15')]);}else{logger[_0x926e('0x17')](_0x926e('0x16'),_0x9e6391,_0x926e('0x10'));_0x20a115(_0x2a9136[_0x926e('0x18')][_0x926e('0x15')]);}})[_0x926e('0x19')](function(_0x4f6bf1){logger['error'](_0x926e('0x16'),_0x9e6391,_0x4f6bf1);_0x35c7d2(_0x4f6bf1);});});} \ No newline at end of file +var _0x0460=['then','info','UserNotification,\x20%s,\x20%s','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','defaults','./userNotification.socket','register','request'];(function(_0x119629,_0x246787){var _0x49a771=function(_0x23624c){while(--_0x23624c){_0x119629['push'](_0x119629['shift']());}};_0x49a771(++_0x246787);}(_0x0460,0x1b2));var _0x0046=function(_0x9d5442,_0x33e9ab){_0x9d5442=_0x9d5442-0x0;var _0x5331b1=_0x0460[_0x9d5442];return _0x5331b1;};'use strict';var _=require(_0x0046('0x0'));var util=require(_0x0046('0x1'));var moment=require(_0x0046('0x2'));var BPromise=require(_0x0046('0x3'));var rs=require(_0x0046('0x4'));var fs=require('fs');var Redis=require(_0x0046('0x5'));var db=require(_0x0046('0x6'))['db'];var utils=require(_0x0046('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x0046('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0046('0x9')][_0x0046('0xa')]({'port':0x232a});config[_0x0046('0xb')]=_[_0x0046('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0046('0xb')]));require(_0x0046('0xd'))[_0x0046('0xe')](socket);function respondWithRpcPromise(_0x27b9a9,_0xc8b8fd,_0x57f259){return new BPromise(function(_0x4e4827,_0x4dfa4f){return client[_0x0046('0xf')](_0x27b9a9,_0x57f259)[_0x0046('0x10')](function(_0x5a197a){logger[_0x0046('0x11')](_0x0046('0x12'),_0xc8b8fd,'request\x20sent');logger['debug'](_0x0046('0x13'),_0xc8b8fd,_0x0046('0x14'),JSON['stringify'](_0x5a197a));if(_0x5a197a[_0x0046('0x15')]){if(_0x5a197a[_0x0046('0x15')]['code']===0x1f4){logger[_0x0046('0x15')](_0x0046('0x12'),_0xc8b8fd,_0x5a197a[_0x0046('0x15')][_0x0046('0x16')]);return _0x4dfa4f(_0x5a197a[_0x0046('0x15')][_0x0046('0x16')]);}logger[_0x0046('0x15')](_0x0046('0x12'),_0xc8b8fd,_0x5a197a['error']['message']);return _0x4e4827(_0x5a197a['error'][_0x0046('0x16')]);}else{logger[_0x0046('0x11')](_0x0046('0x12'),_0xc8b8fd,'request\x20sent');_0x4e4827(_0x5a197a[_0x0046('0x17')]['message']);}})[_0x0046('0x18')](function(_0x2f00bc){logger[_0x0046('0x15')]('UserNotification,\x20%s,\x20%s',_0xc8b8fd,_0x2f00bc);_0x4dfa4f(_0x2f00bc);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index aa37d25..cfa3d99 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 _0x5246=['userNotification:','./userNotification.events','save','remove','emit','removeListener','register','length'];(function(_0x29c8c4,_0x2cdf25){var _0xf11b18=function(_0x2e7fea){while(--_0x2e7fea){_0x29c8c4['push'](_0x29c8c4['shift']());}};_0xf11b18(++_0x2cdf25);}(_0x5246,0x1e9));var _0x6524=function(_0x44ac39,_0x596c6e){_0x44ac39=_0x44ac39-0x0;var _0xa43387=_0x5246[_0x44ac39];return _0xa43387;};'use strict';var UserNotificationEvents=require(_0x6524('0x0'));var events=[_0x6524('0x1'),_0x6524('0x2'),'update'];function createListener(_0x162894,_0xbfec36){return function(_0x5c07bd){_0xbfec36[_0x6524('0x3')](_0x162894,_0x5c07bd);};}function removeListener(_0x378b22,_0x1173c8){return function(){UserNotificationEvents[_0x6524('0x4')](_0x378b22,_0x1173c8);};}exports[_0x6524('0x5')]=function(_0x5db805){for(var _0x280b76=0x0,_0x3fff25=events[_0x6524('0x6')];_0x280b76<_0x3fff25;_0x280b76++){var _0x63bcc5=events[_0x280b76];var _0x3dc5af=createListener(_0x6524('0x7')+_0x63bcc5,_0x5db805);UserNotificationEvents['on'](_0x63bcc5,_0x3dc5af);}}; \ No newline at end of file +var _0x7411=['length','userNotification:','save','remove','update','removeListener','register'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x7411,0x191));var _0x1741=function(_0xf352f5,_0x374af5){_0xf352f5=_0xf352f5-0x0;var _0x291d58=_0x7411[_0xf352f5];return _0x291d58;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0x1741('0x0'),_0x1741('0x1'),_0x1741('0x2')];function createListener(_0x2d9587,_0x1cbacf){return function(_0x5af198){_0x1cbacf['emit'](_0x2d9587,_0x5af198);};}function removeListener(_0x1b6846,_0x2c4212){return function(){UserNotificationEvents[_0x1741('0x3')](_0x1b6846,_0x2c4212);};}exports[_0x1741('0x4')]=function(_0x1fd16){for(var _0x1b5abd=0x0,_0x18b782=events[_0x1741('0x5')];_0x1b5abd<_0x18b782;_0x1b5abd++){var _0x5a6f74=events[_0x1b5abd];var _0x28cce7=createListener(_0x1741('0x6')+_0x5a6f74,_0x1fd16);UserNotificationEvents['on'](_0x5a6f74,_0x28cce7);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index a1b3dbf..2ea9247 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x4e56a2,_0x5a241c){var _0x1e819c=function(_0x5f0f13){while(--_0x5f0f13){_0x4e56a2['push'](_0x4e56a2['shift']());}};_0x1e819c(++_0x5a241c);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x63bdd2,_0x4509bf){var _0x5d9db7=function(_0x1ae0d7){while(--_0x1ae0d7){_0x63bdd2['push'](_0x63bdd2['shift']());}};_0x5d9db7(++_0x4509bf);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 526e1ac..0be36cf 100644 --- a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js +++ b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcd45=['sequelize'];(function(_0x232eb7,_0x199b07){var _0xd7fb8=function(_0x149ed6){while(--_0x149ed6){_0x232eb7['push'](_0x232eb7['shift']());}};_0xd7fb8(++_0x199b07);}(_0xcd45,0x140));var _0x5cd4=function(_0x15a694,_0x2a6b74){_0x15a694=_0x15a694-0x0;var _0x2d7ad2=_0xcd45[_0x15a694];return _0x2d7ad2;};'use strict';var Sequelize=require(_0x5cd4('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x6d4d=['sequelize','INTEGER'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x6d4d,0x86));var _0xd6d4=function(_0x512e84,_0x2234b8){_0x512e84=_0x512e84-0x0;var _0x58a7f0=_0x6d4d[_0x512e84];return _0x58a7f0;};'use strict';var Sequelize=require(_0xd6d4('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xd6d4('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 125c73c..fa73ff4 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 _0x440b=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','user_has_openchannel_queues','util','../../config/logger'];(function(_0x233aa1,_0x37af6d){var _0x4e670d=function(_0x2fca54){while(--_0x2fca54){_0x233aa1['push'](_0x233aa1['shift']());}};_0x4e670d(++_0x37af6d);}(_0x440b,0x196));var _0xb440=function(_0x436db1,_0x3866f3){_0x436db1=_0x436db1-0x0;var _0x1493c7=_0x440b[_0x436db1];return _0x1493c7;};'use strict';var _=require('lodash');var util=require(_0xb440('0x0'));var logger=require(_0xb440('0x1'))(_0xb440('0x2'));var moment=require(_0xb440('0x3'));var BPromise=require(_0xb440('0x4'));var rp=require(_0xb440('0x5'));var fs=require('fs');var path=require(_0xb440('0x6'));var rimraf=require(_0xb440('0x7'));var config=require(_0xb440('0x8'));var attributes=require(_0xb440('0x9'));module[_0xb440('0xa')]=function(_0x2a2c81,_0x17949e){return _0x2a2c81['define']('UserOpenchannelQueue',attributes,{'tableName':_0xb440('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5a0f=['../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x4cda09,_0x3011dc){var _0x42d0e9=function(_0x55bc8a){while(--_0x55bc8a){_0x4cda09['push'](_0x4cda09['shift']());}};_0x42d0e9(++_0x3011dc);}(_0x5a0f,0x15b));var _0xf5a0=function(_0x31bbb2,_0x13f99b){_0x31bbb2=_0x31bbb2-0x0;var _0x1353a1=_0x5a0f[_0x31bbb2];return _0x1353a1;};'use strict';var _=require('lodash');var util=require(_0xf5a0('0x0'));var logger=require(_0xf5a0('0x1'))('api');var moment=require(_0xf5a0('0x2'));var BPromise=require(_0xf5a0('0x3'));var rp=require(_0xf5a0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf5a0('0x5'));var attributes=require(_0xf5a0('0x6'));module[_0xf5a0('0x7')]=function(_0x353332,_0x1da7f2){return _0x353332[_0xf5a0('0x8')](_0xf5a0('0x9'),attributes,{'tableName':_0xf5a0('0xa'),'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 5e0bc62..decfaaf 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 _0xc2ee=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','UserOpenchannelQueue,\x20%s,\x20%s','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc2ee,0x118));var _0xec2e=function(_0x4bc881,_0x5aea4e){_0x4bc881=_0x4bc881-0x0;var _0x593ad5=_0xc2ee[_0x4bc881];return _0x593ad5;};'use strict';var _=require(_0xec2e('0x0'));var util=require(_0xec2e('0x1'));var moment=require(_0xec2e('0x2'));var BPromise=require(_0xec2e('0x3'));var rs=require(_0xec2e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xec2e('0x5'))['db'];var utils=require(_0xec2e('0x6'));var logger=require(_0xec2e('0x7'))('rpc');var config=require(_0xec2e('0x8'));var jayson=require(_0xec2e('0x9'));var client=jayson[_0xec2e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44c18c,_0x37739a,_0xfa9e43){return new BPromise(function(_0x25d88f,_0x249123){return client['request'](_0x44c18c,_0xfa9e43)[_0xec2e('0xb')](function(_0x48081b){logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x37739a,'request\x20sent');logger[_0xec2e('0xc')](_0xec2e('0xd'),_0x37739a,_0xec2e('0xe'),JSON['stringify'](_0x48081b));if(_0x48081b[_0xec2e('0xf')]){if(_0x48081b['error'][_0xec2e('0x10')]===0x1f4){logger[_0xec2e('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x37739a,_0x48081b[_0xec2e('0xf')]['message']);return _0x249123(_0x48081b[_0xec2e('0xf')]['message']);}logger[_0xec2e('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x37739a,_0x48081b[_0xec2e('0xf')][_0xec2e('0x11')]);return _0x25d88f(_0x48081b['error']['message']);}else{logger['info'](_0xec2e('0x12'),_0x37739a,_0xec2e('0xe'));_0x25d88f(_0x48081b['result'][_0xec2e('0x11')]);}})[_0xec2e('0x13')](function(_0x5ad441){logger[_0xec2e('0xf')](_0xec2e('0x12'),_0x37739a,_0x5ad441);_0x249123(_0x5ad441);});});} \ No newline at end of file +var _0xf4fe=['randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','lodash','moment'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xf4fe,0x174));var _0xef4f=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0xf4fe[_0xa6cc5c];return _0x44803d;};'use strict';var _=require(_0xef4f('0x0'));var util=require('util');var moment=require(_0xef4f('0x1'));var BPromise=require('bluebird');var rs=require(_0xef4f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xef4f('0x3'))(_0xef4f('0x4'));var config=require(_0xef4f('0x5'));var jayson=require(_0xef4f('0x6'));var client=jayson['client'][_0xef4f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x655ef6,_0x39d19b,_0x41fc40){return new BPromise(function(_0x275bda,_0x10b829){return client['request'](_0x655ef6,_0x41fc40)[_0xef4f('0x8')](function(_0x4e7ea0){logger[_0xef4f('0x9')](_0xef4f('0xa'),_0x39d19b,_0xef4f('0xb'));logger[_0xef4f('0xc')](_0xef4f('0xd'),_0x39d19b,_0xef4f('0xb'),JSON['stringify'](_0x4e7ea0));if(_0x4e7ea0[_0xef4f('0xe')]){if(_0x4e7ea0[_0xef4f('0xe')][_0xef4f('0xf')]===0x1f4){logger[_0xef4f('0xe')](_0xef4f('0xa'),_0x39d19b,_0x4e7ea0['error']['message']);return _0x10b829(_0x4e7ea0['error']['message']);}logger[_0xef4f('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x39d19b,_0x4e7ea0[_0xef4f('0xe')][_0xef4f('0x10')]);return _0x275bda(_0x4e7ea0[_0xef4f('0xe')]['message']);}else{logger[_0xef4f('0x9')](_0xef4f('0xa'),_0x39d19b,_0xef4f('0xb'));_0x275bda(_0x4e7ea0['result'][_0xef4f('0x10')]);}})['catch'](function(_0x58bb24){logger['error'](_0xef4f('0xa'),_0x39d19b,_0x58bb24);_0x10b829(_0x58bb24);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 5b30ba2..581858e 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 _0xff76=['getResources','post','create','/:id/clone','clone','addSections','addResources','put','/:id','update','delete','destroy','removeSections','removeResources','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','show','/:id/sections','getSections','/:id/resources'];(function(_0x17416c,_0x50f76f){var _0x35832e=function(_0xed5b6f){while(--_0xed5b6f){_0x17416c['push'](_0x17416c['shift']());}};_0x35832e(++_0x50f76f);}(_0xff76,0x87));var _0x6ff7=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0xff76[_0x266618];return _0x54dbf5;};'use strict';var multer=require(_0x6ff7('0x0'));var util=require(_0x6ff7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6ff7('0x2'));var router=express['Router']();var fs_extra=require(_0x6ff7('0x3'));var auth=require(_0x6ff7('0x4'));var interaction=require(_0x6ff7('0x5'));var config=require(_0x6ff7('0x6'));var controller=require('./userProfile.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x6ff7('0x7')](_0x6ff7('0x8'),auth[_0x6ff7('0x9')](),controller[_0x6ff7('0xa')]);router[_0x6ff7('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x6ff7('0xb')]);router[_0x6ff7('0x7')](_0x6ff7('0xc'),auth[_0x6ff7('0x9')](),controller[_0x6ff7('0xd')]);router[_0x6ff7('0x7')](_0x6ff7('0xe'),auth['isAuthenticated'](),controller[_0x6ff7('0xf')]);router[_0x6ff7('0x10')]('/',auth[_0x6ff7('0x9')](),controller[_0x6ff7('0x11')]);router[_0x6ff7('0x10')](_0x6ff7('0x12'),auth[_0x6ff7('0x9')](),controller[_0x6ff7('0x13')]);router[_0x6ff7('0x10')](_0x6ff7('0xc'),auth[_0x6ff7('0x9')](),controller[_0x6ff7('0x14')]);router[_0x6ff7('0x10')]('/:id/resources',auth[_0x6ff7('0x9')](),controller[_0x6ff7('0x15')]);router[_0x6ff7('0x16')](_0x6ff7('0x17'),auth[_0x6ff7('0x9')](),controller[_0x6ff7('0x18')]);router[_0x6ff7('0x19')](_0x6ff7('0x17'),auth[_0x6ff7('0x9')](),controller[_0x6ff7('0x1a')]);router['delete'](_0x6ff7('0xc'),auth[_0x6ff7('0x9')](),controller[_0x6ff7('0x1b')]);router[_0x6ff7('0x19')](_0x6ff7('0xe'),auth[_0x6ff7('0x9')](),controller[_0x6ff7('0x1c')]);module[_0x6ff7('0x1d')]=router; \ No newline at end of file +var _0x03ba=['./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getSections','/:id/resources','getResources','post','create','clone','/:id/sections','addResources','put','update','destroy','delete','removeSections','removeResources','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4a6953,_0x226a21){var _0x4c1f52=function(_0x4380eb){while(--_0x4380eb){_0x4a6953['push'](_0x4a6953['shift']());}};_0x4c1f52(++_0x226a21);}(_0x03ba,0x1c4));var _0xa03b=function(_0x5b04ac,_0x14b9b5){_0x5b04ac=_0x5b04ac-0x0;var _0x106281=_0x03ba[_0x5b04ac];return _0x106281;};'use strict';var multer=require(_0xa03b('0x0'));var util=require(_0xa03b('0x1'));var path=require(_0xa03b('0x2'));var timeout=require(_0xa03b('0x3'));var express=require(_0xa03b('0x4'));var router=express[_0xa03b('0x5')]();var fs_extra=require(_0xa03b('0x6'));var auth=require(_0xa03b('0x7'));var interaction=require(_0xa03b('0x8'));var config=require(_0xa03b('0x9'));var controller=require(_0xa03b('0xa'));router[_0xa03b('0xb')]('/',auth[_0xa03b('0xc')](),controller[_0xa03b('0xd')]);router['get'](_0xa03b('0xe'),auth[_0xa03b('0xc')](),controller[_0xa03b('0xf')]);router[_0xa03b('0xb')](_0xa03b('0x10'),auth['isAuthenticated'](),controller[_0xa03b('0x11')]);router['get']('/:id/sections',auth[_0xa03b('0xc')](),controller[_0xa03b('0x12')]);router[_0xa03b('0xb')](_0xa03b('0x13'),auth[_0xa03b('0xc')](),controller[_0xa03b('0x14')]);router[_0xa03b('0x15')]('/',auth[_0xa03b('0xc')](),controller[_0xa03b('0x16')]);router[_0xa03b('0x15')]('/:id/clone',auth[_0xa03b('0xc')](),controller[_0xa03b('0x17')]);router[_0xa03b('0x15')](_0xa03b('0x18'),auth[_0xa03b('0xc')](),controller['addSections']);router[_0xa03b('0x15')](_0xa03b('0x13'),auth[_0xa03b('0xc')](),controller[_0xa03b('0x19')]);router[_0xa03b('0x1a')](_0xa03b('0x10'),auth[_0xa03b('0xc')](),controller[_0xa03b('0x1b')]);router['delete'](_0xa03b('0x10'),auth[_0xa03b('0xc')](),controller[_0xa03b('0x1c')]);router[_0xa03b('0x1d')]('/:id/sections',auth[_0xa03b('0xc')](),controller[_0xa03b('0x1e')]);router[_0xa03b('0x1d')]('/:id/resources',auth[_0xa03b('0xc')](),controller[_0xa03b('0x1f')]);module[_0xa03b('0x20')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 0d58382..839f0af 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 _0x50f9=['name','crudPermissions','join','getDataValue','BOOLEAN','exports','STRING'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x50f9,0x1a9));var _0x950f=function(_0x5e0081,_0x4364cd){_0x5e0081=_0x5e0081-0x0;var _0x10a21a=_0x50f9[_0x5e0081];return _0x10a21a;};'use strict';var Sequelize=require('sequelize');module[_0x950f('0x0')]={'name':{'type':Sequelize[_0x950f('0x1')],'allowNull':![],'unique':_0x950f('0x2')},'crudPermissions':{'type':Sequelize[_0x950f('0x1')],'set':function(_0x29728b){this['setDataValue'](_0x950f('0x3'),_0x29728b?_0x29728b[_0x950f('0x4')](''):[]);},'get':function(){return this['getDataValue'](_0x950f('0x3'))?this[_0x950f('0x5')]('crudPermissions')['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x950f('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x950f('0x6')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x950f('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x950f('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x950f('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x950f('0x6')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x7198=['exports','STRING','name','crudPermissions','join','getDataValue','split','BOOLEAN'];(function(_0x4c32f5,_0x3dbbf1){var _0x19cae9=function(_0x3c77cd){while(--_0x3c77cd){_0x4c32f5['push'](_0x4c32f5['shift']());}};_0x19cae9(++_0x3dbbf1);}(_0x7198,0x1b0));var _0x8719=function(_0x38d914,_0x10124c){_0x38d914=_0x38d914-0x0;var _0x218083=_0x7198[_0x38d914];return _0x218083;};'use strict';var Sequelize=require('sequelize');module[_0x8719('0x0')]={'name':{'type':Sequelize[_0x8719('0x1')],'allowNull':![],'unique':_0x8719('0x2')},'crudPermissions':{'type':Sequelize[_0x8719('0x1')],'set':function(_0x4abf2c){this['setDataValue'](_0x8719('0x3'),_0x4abf2c?_0x4abf2c[_0x8719('0x4')](''):[]);},'get':function(){return this[_0x8719('0x5')](_0x8719('0x3'))?this['getDataValue'](_0x8719('0x3'))[_0x8719('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x8719('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x8719('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x8719('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x8719('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x8719('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x8719('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x8719('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 8290b2e..497c095 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 _0x6257=['omit','updatedAt','createdAt','sequelize','transaction','UserProfileSection','findAll','each','autoAssociation','UserProfileResource','userProfileId','Resources','update','describe','addSections','push','removeSections','enabled','includes','sectionId','isEmpty','subsections','forEach','resourceId','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','hasOwnProperty','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','zip-dir','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/logger','../../config/license/util','redis','localhost','socket.io-emitter','./userProfile.socket','register','status','end','json','offset','limit','set','Content-Range','apply','reject','save','destroy','sendStatus','error','stack','name','send','index','map','UserProfile','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','order','sort','pick','filter','where','merge','VIRTUAL','count','then','includeAll','include','rows','catch','show','params','find','create','body','clone','get'];(function(_0x2689f6,_0x330104){var _0x287f08=function(_0x2a790b){while(--_0x2a790b){_0x2689f6['push'](_0x2689f6['shift']());}};_0x287f08(++_0x330104);}(_0x6257,0x1d4));var _0x7625=function(_0x42daa3,_0x4949a0){_0x42daa3=_0x42daa3-0x0;var _0x25be6c=_0x6257[_0x42daa3];return _0x25be6c;};'use strict';var emlformat=require(_0x7625('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7625('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7625('0x2'));var BPromise=require(_0x7625('0x3'));var Mustache=require(_0x7625('0x4'));var util=require(_0x7625('0x5'));var path=require(_0x7625('0x6'));var sox=require(_0x7625('0x7'));var csv=require(_0x7625('0x8'));var ejs=require(_0x7625('0x9'));var fs=require('fs');var fs_extra=require(_0x7625('0xa'));var _=require(_0x7625('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7625('0xc'));var deskjs=require(_0x7625('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7625('0xe'));var Papa=require(_0x7625('0xf'));var Redis=require(_0x7625('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7625('0x11'));var as=require(_0x7625('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7625('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7625('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x7625('0x15')],{'host':_0x7625('0x16'),'port':0x18eb});var socket=require(_0x7625('0x17'))(new Redis(config[_0x7625('0x15')]));require(_0x7625('0x18'))[_0x7625('0x19')](socket);function respondWithStatusCode(_0x53a914,_0x50c5a1){_0x50c5a1=_0x50c5a1||0xcc;return function(_0x42f087){if(_0x42f087){return _0x53a914['sendStatus'](_0x50c5a1);}return _0x53a914[_0x7625('0x1a')](_0x50c5a1)[_0x7625('0x1b')]();};}function respondWithResult(_0x27b598,_0x5a66fd){_0x5a66fd=_0x5a66fd||0xc8;return function(_0x4c58ed){if(_0x4c58ed){return _0x27b598[_0x7625('0x1a')](_0x5a66fd)[_0x7625('0x1c')](_0x4c58ed);}};}function respondWithFilteredResult(_0x125737,_0x36cc19){return function(_0x6ca44e){if(_0x6ca44e){var _0x2c8013=typeof _0x36cc19[_0x7625('0x1d')]==='undefined'&&typeof _0x36cc19[_0x7625('0x1e')]==='undefined';var _0xde024d=_0x6ca44e['count'];var _0x4ba21a=_0x2c8013?0x0:_0x36cc19[_0x7625('0x1d')];var _0x5e9d9e=_0x2c8013?_0x6ca44e['count']:_0x36cc19[_0x7625('0x1d')]+_0x36cc19[_0x7625('0x1e')];var _0x510877;if(_0x5e9d9e>=_0xde024d){_0x5e9d9e=_0xde024d;_0x510877=0xc8;}else{_0x510877=0xce;}_0x125737[_0x7625('0x1a')](_0x510877);return _0x125737[_0x7625('0x1f')](_0x7625('0x20'),_0x4ba21a+'-'+_0x5e9d9e+'/'+_0xde024d)['json'](_0x6ca44e);}return null;};}function patchUpdates(_0x25b19c){return function(_0xfafa34){try{jsonpatch[_0x7625('0x21')](_0xfafa34,_0x25b19c,!![]);}catch(_0x424f8b){return BPromise[_0x7625('0x22')](_0x424f8b);}return _0xfafa34[_0x7625('0x23')]();};}function saveUpdates(_0x1514f7,_0x1832e3){return function(_0x26c976){if(_0x26c976){return _0x26c976['update'](_0x1514f7)['then'](function(_0x562fe1){return _0x562fe1;});}return null;};}function removeEntity(_0x4ceba3,_0x487316){return function(_0x477caf){if(_0x477caf){return _0x477caf[_0x7625('0x24')]()['then'](function(){_0x4ceba3[_0x7625('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x293391,_0x1dfdd1){return function(_0x4a34b8){if(!_0x4a34b8){_0x293391[_0x7625('0x25')](0x194);}return _0x4a34b8;};}function handleError(_0x48f047,_0x22b8a6){_0x22b8a6=_0x22b8a6||0x1f4;return function(_0x5a54f1){logger[_0x7625('0x26')](_0x5a54f1[_0x7625('0x27')]);if(_0x5a54f1[_0x7625('0x28')]){delete _0x5a54f1[_0x7625('0x28')];}_0x48f047[_0x7625('0x1a')](_0x22b8a6)[_0x7625('0x29')](_0x5a54f1);};}exports[_0x7625('0x2a')]=function(_0x3736fb,_0x48758c){var _0x5ef7eb={},_0x461664={},_0xc7aa53={'count':0x0,'rows':[]};var _0x5ea946=_[_0x7625('0x2b')](db[_0x7625('0x2c')][_0x7625('0x2d')],function(_0x37e7ea){return{'name':_0x37e7ea[_0x7625('0x2e')],'type':_0x37e7ea[_0x7625('0x2f')][_0x7625('0x30')]};});_0x461664['model']=_[_0x7625('0x2b')](_0x5ea946,'name');_0x461664[_0x7625('0x31')]=_[_0x7625('0x32')](_0x3736fb[_0x7625('0x31')]);_0x461664[_0x7625('0x33')]=_[_0x7625('0x34')](_0x461664[_0x7625('0x35')],_0x461664[_0x7625('0x31')]);_0x5ef7eb[_0x7625('0x36')]=_[_0x7625('0x34')](_0x461664[_0x7625('0x35')],qs[_0x7625('0x37')](_0x3736fb[_0x7625('0x31')][_0x7625('0x37')]));_0x5ef7eb[_0x7625('0x36')]=_0x5ef7eb[_0x7625('0x36')][_0x7625('0x38')]?_0x5ef7eb['attributes']:_0x461664['model'];if(!_0x3736fb[_0x7625('0x31')]['hasOwnProperty']('nolimit')){_0x5ef7eb[_0x7625('0x1e')]=qs[_0x7625('0x1e')](_0x3736fb['query'][_0x7625('0x1e')]);_0x5ef7eb[_0x7625('0x1d')]=qs[_0x7625('0x1d')](_0x3736fb[_0x7625('0x31')][_0x7625('0x1d')]);}_0x5ef7eb[_0x7625('0x39')]=qs['sort'](_0x3736fb['query'][_0x7625('0x3a')]);_0x5ef7eb['where']=qs['filters'](_[_0x7625('0x3b')](_0x3736fb[_0x7625('0x31')],_0x461664[_0x7625('0x33')]),_0x5ea946);if(_0x3736fb[_0x7625('0x31')][_0x7625('0x3c')]){_0x5ef7eb[_0x7625('0x3d')]=_[_0x7625('0x3e')](_0x5ef7eb['where'],{'$or':_[_0x7625('0x2b')](_0x5ea946,function(_0x5b8cf0){if(_0x5b8cf0[_0x7625('0x2f')]!==_0x7625('0x3f')){var _0x587917={};_0x587917[_0x5b8cf0['name']]={'$like':'%'+_0x3736fb[_0x7625('0x31')]['filter']+'%'};return _0x587917;}})});}_0x5ef7eb=_['merge']({},_0x5ef7eb,_0x3736fb['options']);var _0x5ad763={'where':_0x5ef7eb[_0x7625('0x3d')]};return db[_0x7625('0x2c')][_0x7625('0x40')](_0x5ad763)[_0x7625('0x41')](function(_0x5eeee4){_0xc7aa53[_0x7625('0x40')]=_0x5eeee4;if(_0x3736fb[_0x7625('0x31')][_0x7625('0x42')]){_0x5ef7eb[_0x7625('0x43')]=[{'all':!![]}];}return db[_0x7625('0x2c')]['findAll'](_0x5ef7eb);})['then'](function(_0x4eb88f){_0xc7aa53[_0x7625('0x44')]=_0x4eb88f;return _0xc7aa53;})[_0x7625('0x41')](respondWithFilteredResult(_0x48758c,_0x5ef7eb))[_0x7625('0x45')](handleError(_0x48758c,null));};exports[_0x7625('0x46')]=function(_0x482a6b,_0x201d0d){var _0x58a626={'raw':![],'where':{'id':_0x482a6b[_0x7625('0x47')]['id']}},_0x220477={};_0x220477[_0x7625('0x35')]=_[_0x7625('0x32')](db[_0x7625('0x2c')]['rawAttributes']);_0x220477['query']=_[_0x7625('0x32')](_0x482a6b['query']);_0x220477[_0x7625('0x33')]=_[_0x7625('0x34')](_0x220477[_0x7625('0x35')],_0x220477[_0x7625('0x31')]);_0x58a626['attributes']=_[_0x7625('0x34')](_0x220477['model'],qs[_0x7625('0x37')](_0x482a6b[_0x7625('0x31')][_0x7625('0x37')]));_0x58a626[_0x7625('0x36')]=_0x58a626['attributes']['length']?_0x58a626['attributes']:_0x220477[_0x7625('0x35')];if(_0x482a6b['query'][_0x7625('0x42')]){_0x58a626[_0x7625('0x43')]=[{'all':!![]}];}_0x58a626=_[_0x7625('0x3e')]({},_0x58a626,_0x482a6b['options']);return db['UserProfile'][_0x7625('0x48')](_0x58a626)[_0x7625('0x41')](handleEntityNotFound(_0x201d0d,null))[_0x7625('0x41')](respondWithResult(_0x201d0d,null))[_0x7625('0x45')](handleError(_0x201d0d,null));};exports['create']=function(_0x464f2e,_0x426510){return db['UserProfile'][_0x7625('0x49')](_0x464f2e[_0x7625('0x4a')],{})[_0x7625('0x41')](respondWithResult(_0x426510,0xc9))[_0x7625('0x45')](handleError(_0x426510,null));};exports[_0x7625('0x4b')]=function(_0x48a93a,_0x33f897){var _0x90c4a0={'where':{'id':_0x48a93a[_0x7625('0x47')]['id']}},_0x3d41b9={};_0x3d41b9[_0x7625('0x35')]=_['keys'](db[_0x7625('0x2c')][_0x7625('0x2d')]);_0x90c4a0[_0x7625('0x36')]=_['intersection'](_0x3d41b9[_0x7625('0x35')],qs[_0x7625('0x37')](_0x48a93a[_0x7625('0x31')]['fields']));_0x90c4a0[_0x7625('0x36')]=_0x90c4a0[_0x7625('0x36')]['length']?_0x90c4a0[_0x7625('0x36')]:_0x3d41b9[_0x7625('0x35')];if(_0x48a93a[_0x7625('0x31')][_0x7625('0x42')]){_0x90c4a0[_0x7625('0x43')]=[{'all':!![]}];}_0x90c4a0=_[_0x7625('0x3e')]({},_0x90c4a0,_0x48a93a['options']);return db[_0x7625('0x2c')][_0x7625('0x48')](_0x90c4a0)[_0x7625('0x41')](handleEntityNotFound(_0x33f897,null))[_0x7625('0x41')](function(_0x37d3a0){if(_0x37d3a0){var _0x462aa3=_0x37d3a0[_0x7625('0x4c')]({'plain':!![]});_0x462aa3=qs[_0x7625('0x4d')](_0x462aa3,['id','createdAt',_0x7625('0x4e'),'crudPermissions']);_0x48a93a['body']=_[_0x7625('0x4d')](_0x48a93a[_0x7625('0x4a')],['id',_0x7625('0x4f'),_0x7625('0x4e')]);return db[_0x7625('0x50')][_0x7625('0x51')](function(_0x338daa){return db[_0x7625('0x2c')][_0x7625('0x49')](_['merge'](_0x462aa3,_0x48a93a[_0x7625('0x4a')]),{'include':_0x48a93a['query']['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x338daa})[_0x7625('0x41')](function(_0x2a033b){var _0x43675c=_0x2a033b[_0x7625('0x4c')]({'plain':!![]});return db[_0x7625('0x52')][_0x7625('0x53')]({'where':{'userProfileId':_0x48a93a[_0x7625('0x47')]['id']},'raw':!![]})['then'](function(_0x53ebd9){if(_0x53ebd9){return BPromise[_0x7625('0x54')](_0x53ebd9,function(_0x5580a5){return new BPromise(function(_0xf935d0,_0x3b8266){if(_0x5580a5[_0x7625('0x55')]===null||_0x5580a5[_0x7625('0x55')]===0x1)_0xf935d0(null);return db[_0x7625('0x56')][_0x7625('0x53')]({'where':{'sectionId':_0x5580a5['id']},'raw':!![]})[_0x7625('0x41')](function(_0x27fee6){var _0x5c3121=_['map'](_0x27fee6,function(_0x43824c){return qs[_0x7625('0x4d')](_0x43824c,['id',_0x7625('0x4f'),_0x7625('0x4e'),'sectionId']);});_0xf935d0(_0x5c3121);})[_0x7625('0x45')](function(_0x3789db){_0x3b8266(_0x3789db);});})[_0x7625('0x41')](function(_0x27c0b8){var _0x4524f1=qs[_0x7625('0x4d')](_0x5580a5,['id','createdAt','updatedAt']);_0x4524f1[_0x7625('0x57')]=_0x43675c['id'];if(_0x27c0b8)_0x4524f1[_0x7625('0x58')]=_0x27c0b8;return _0x4524f1;})['then'](function(_0x468080){return db[_0x7625('0x52')][_0x7625('0x49')](_0x468080,{'include':[{'model':db[_0x7625('0x56')],'as':_0x7625('0x58')}],'raw':!![],'transaction':_0x338daa});});})['then'](function(){return _0x43675c;});}});});});}})[_0x7625('0x41')](respondWithResult(_0x33f897,0xc9))[_0x7625('0x45')](handleError(_0x33f897,null));};exports[_0x7625('0x59')]=function(_0x31a9b8,_0x3026b9){if(_0x31a9b8[_0x7625('0x4a')]['id']){delete _0x31a9b8[_0x7625('0x4a')]['id'];}return db[_0x7625('0x2c')][_0x7625('0x48')]({'where':{'id':_0x31a9b8['params']['id']}})['then'](handleEntityNotFound(_0x3026b9,null))[_0x7625('0x41')](saveUpdates(_0x31a9b8[_0x7625('0x4a')],null))[_0x7625('0x41')](respondWithResult(_0x3026b9,null))[_0x7625('0x45')](handleError(_0x3026b9,null));};exports[_0x7625('0x24')]=function(_0xa65903,_0x233f7c){return db['UserProfile'][_0x7625('0x48')]({'where':{'id':_0xa65903[_0x7625('0x47')]['id']}})[_0x7625('0x41')](handleEntityNotFound(_0x233f7c,null))['then'](removeEntity(_0x233f7c,null))[_0x7625('0x45')](handleError(_0x233f7c,null));};exports[_0x7625('0x5a')]=function(_0x5a313b,_0x55a0e4){return db[_0x7625('0x2c')][_0x7625('0x5a')]()[_0x7625('0x41')](respondWithResult(_0x55a0e4,null))[_0x7625('0x45')](handleError(_0x55a0e4,null));};exports[_0x7625('0x5b')]=function(_0x2f18ef,_0x3aeda9){var _0x4f2bd1=_0x2f18ef[_0x7625('0x4a')];return db['UserProfile'][_0x7625('0x48')]({'where':{'id':_0x2f18ef[_0x7625('0x47')]['id']}})[_0x7625('0x41')](handleEntityNotFound(_0x3aeda9,null))[_0x7625('0x41')](function(_0x3bc2f2){if(_0x3bc2f2){return db[_0x7625('0x50')][_0x7625('0x51')](function(_0xdc3530){return db[_0x7625('0x52')][_0x7625('0x24')]({'where':{'userProfileId':_0x2f18ef[_0x7625('0x47')]['id'],'sectionId':_[_0x7625('0x2b')](_0x4f2bd1,function(_0x273e15){return _0x273e15['sectionId'];})},'transaction':_0xdc3530})[_0x7625('0x41')](function(){var _0x3aca5a=_[_0x7625('0x2b')](_0x4f2bd1,function(_0x7ed77c){_0x7ed77c[_0x7625('0x57')]=_0x2f18ef[_0x7625('0x47')]['id'];return _0x7ed77c;});var _0x19d26c=[];return BPromise[_0x7625('0x54')](_0x3aca5a,function(_0xeb1d4){return db[_0x7625('0x52')][_0x7625('0x49')](_0xeb1d4,{'include':[{'model':db['UserProfileResource'],'as':_0x7625('0x58')}],'raw':!![],'transaction':_0xdc3530})[_0x7625('0x41')](function(_0x1d5752){_0x19d26c[_0x7625('0x5c')](_0x1d5752[_0x7625('0x4c')]({'plain':!![]}));});})[_0x7625('0x41')](function(){return _0x19d26c;});});});}})[_0x7625('0x41')](function(_0x36d825){return _0x36d825;})[_0x7625('0x41')](respondWithResult(_0x3aeda9,null))[_0x7625('0x45')](handleError(_0x3aeda9,null));};exports[_0x7625('0x5d')]=function(_0x429439,_0x24e4de){var _0x393f3c;return db['UserProfile']['find']({'where':{'id':_0x429439['params']['id']},'attributes':['id',_0x7625('0x28')]})[_0x7625('0x41')](handleEntityNotFound(_0x24e4de,null))[_0x7625('0x41')](function(_0x399f45){if(_0x399f45){_0x393f3c=_0x399f45;return db[_0x7625('0x52')][_0x7625('0x24')]({'where':{'userProfileId':_0x429439[_0x7625('0x47')]['id'],'sectionId':_0x429439[_0x7625('0x31')]['ids']}});}})[_0x7625('0x41')](function(){return _0x393f3c;})[_0x7625('0x41')](respondWithStatusCode(_0x24e4de,null))['catch'](handleError(_0x24e4de,null));};exports['getSections']=function(_0x3ede07,_0x47ffdd){var _0x2ecfa9=[];var _0x495a6b=[];return db['UserProfileSection'][_0x7625('0x53')]({'where':{'userProfileId':_0x3ede07[_0x7625('0x47')]['id']},'raw':!![]})['then'](function(_0x51ebbd){_0x2ecfa9=_[_0x7625('0x3c')](_0x51ebbd,function(_0x39a0f7){return _0x39a0f7[_0x7625('0x5e')]===0x1||_[_0x7625('0x5f')]([0x3eb,0x709],_0x39a0f7[_0x7625('0x60')]);});if(!_[_0x7625('0x61')](_0x2ecfa9)){return _[_0x7625('0x2b')](_0x2ecfa9,function(_0x42e8d1){return _0x42e8d1['sectionId'];});}else{return;}})[_0x7625('0x41')](function(_0x20f5aa){if(_0x20f5aa)_0x495a6b=_0x20f5aa;if(_[_0x7625('0x5f')](_0x495a6b,0x64)){var _0x42f5b7=_[_0x7625('0x48')](_0x2ecfa9,{'sectionId':0x64});return hasDefaultDashboard(_0x42f5b7)[_0x7625('0x41')](function(_0x5229fc){return _['map'](_0x2ecfa9,function(_0x3b7dfc){if(_0x3b7dfc[_0x7625('0x60')]===0x64){_0x3b7dfc['subsections']=_0x5229fc;}return _0x3b7dfc;});});}else{return;}})[_0x7625('0x41')](function(_0x23e7d0){if(_0x23e7d0)_0x2ecfa9=_0x23e7d0;if(_[_0x7625('0x5f')](_0x495a6b,0x3eb)){var _0x980e69=_[_0x7625('0x48')](_0x2ecfa9,{'sectionId':0x3eb});return getCustomDashboards(_0x980e69)[_0x7625('0x41')](function(_0x2efe30){return _[_0x7625('0x2b')](_0x2ecfa9,function(_0x4ef3b3){if(_0x980e69[_0x7625('0x5e')]){if(_0x4ef3b3[_0x7625('0x60')]===0x3eb){_0x4ef3b3[_0x7625('0x62')]=_0x2efe30;}}else{if(_0x4ef3b3[_0x7625('0x60')]===0x64){_0x4ef3b3[_0x7625('0x62')]=_0x2efe30;}}return _0x4ef3b3;});});}else{return;}})['then'](function(_0xd0fbfa){if(_0xd0fbfa)_0x2ecfa9=_0xd0fbfa;if(_['includes'](_0x495a6b,0x709)){var _0x3f2d94=_[_0x7625('0x48')](_0x2ecfa9,{'sectionId':0x709});return getPlugins(_0x3f2d94)['then'](function(_0x57bd38){if(_0x3f2d94[_0x7625('0x5e')]){return _[_0x7625('0x2b')](_0x2ecfa9,function(_0x5bd158){if(_0x5bd158[_0x7625('0x60')]===0x709){_0x5bd158['subsections']=_0x57bd38;}return _0x5bd158;});}else{var _0x2ccb59={'sectionId':0x76c,'enabled':0x1,'subsections':_0x57bd38};var _0xa93e7e=_[_0x7625('0x2b')](_0x2ecfa9);_0xa93e7e[_0x7625('0x5c')](_0x2ccb59);return _0xa93e7e;}});}else{return;}})[_0x7625('0x41')](function(_0x23ec4f){if(_0x23ec4f)_0x2ecfa9=_0x23ec4f;return _[_0x7625('0x3c')](_0x2ecfa9,['enabled',0x1]);})[_0x7625('0x41')](respondWithResult(_0x47ffdd,null))['catch'](handleError(_0x47ffdd,null));};function hasDefaultDashboard(_0x1d1293){var _0x24138d=[0x65];return new BPromise(function(_0x417d78,_0x76fe84){try{if(_0x1d1293[_0x7625('0x55')]){_0x417d78(_0x24138d);}else{return db['UserProfileResource']['findOne']({'where':{'sectionId':_0x1d1293['id']},'raw':!![]})[_0x7625('0x41')](function(_0x4f6593){_0x4f6593?_0x417d78(_0x24138d):_0x417d78();});}}catch(_0x17a0d2){_0x76fe84(_0x17a0d2);}});}function getCustomDashboards(_0x3e894e){var _0x127f26=[];return new BPromise(function(_0x37fb3b,_0x17f39f){try{if(_0x3e894e[_0x7625('0x55')]){return db['Dashboard'][_0x7625('0x53')]({'raw':!![]})[_0x7625('0x41')](function(_0x48ae31){_0x48ae31['forEach'](function(_0x2db078){_0x127f26[_0x7625('0x5c')](_0x2db078['id']+0x1869f);});_0x37fb3b(_0x127f26);});}else{return db[_0x7625('0x56')][_0x7625('0x53')]({'where':{'sectionId':_0x3e894e['id']},'raw':!![]})[_0x7625('0x41')](function(_0x59da9c){_0x59da9c[_0x7625('0x63')](function(_0x3e1737){_0x127f26[_0x7625('0x5c')](_0x3e1737[_0x7625('0x64')]+0x1869f);});_0x37fb3b(_0x127f26);});}}catch(_0x473f0e){_0x17f39f(_0x473f0e);}});}function getPlugins(_0x3bf57d){var _0x29fba9=[];return new BPromise(function(_0x3e3a06,_0x749f6b){try{if(_0x3bf57d[_0x7625('0x55')]){return db['Plugin'][_0x7625('0x53')]({'raw':!![]})[_0x7625('0x41')](function(_0x39cc30){_0x39cc30['forEach'](function(_0x46f972){_0x29fba9[_0x7625('0x5c')](_0x46f972['id']+0x15b38);});_0x3e3a06(_0x29fba9);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x3bf57d['id']},'raw':!![]})[_0x7625('0x41')](function(_0x500346){_0x500346[_0x7625('0x63')](function(_0x43be0d){_0x29fba9['push'](_0x43be0d['resourceId']+0x15b38);});_0x3e3a06(_0x29fba9);});}}catch(_0x57d10f){_0x749f6b(_0x57d10f);}});}exports['addResources']=function(_0x303ef7,_0x1493b4){return db[_0x7625('0x2c')][_0x7625('0x48')]({'where':{'id':_0x303ef7[_0x7625('0x47')]['id']}})[_0x7625('0x41')](handleEntityNotFound(_0x1493b4,null))[_0x7625('0x41')](function(_0x2b4665){if(_0x2b4665){return db[_0x7625('0x50')][_0x7625('0x51')](function(_0x330b4c){return db[_0x7625('0x52')]['findAll']({'where':{'userProfileId':_0x303ef7['params']['id']},'attributes':['id'],'raw':!![]})[_0x7625('0x41')](function(_0x577f98){if(_0x577f98){return db[_0x7625('0x52')][_0x7625('0x24')]({'where':{'userProfileId':_0x303ef7[_0x7625('0x47')]['id'],'id':_[_0x7625('0x2b')](_0x577f98,function(_0x2919a2){return _0x2919a2['id'];})},'transaction':_0x330b4c});}})[_0x7625('0x41')](function(_0x591686){var _0x342f29=_[_0x7625('0x2b')](_0x303ef7[_0x7625('0x4a')],function(_0x53358f){_0x53358f[_0x7625('0x57')]=_0x303ef7[_0x7625('0x47')]['id'];return _0x53358f;});return db[_0x7625('0x52')]['bulkCreate'](_0x342f29,{'raw':!![],'transaction':_0x330b4c});})[_0x7625('0x41')](function(_0x3e5a6d){var _0x2dd038=_[_0x7625('0x3c')](_[_0x7625('0x2b')](_0x3e5a6d,function(_0x579b7c){return _0x579b7c['get']({'plain':!![]});}),{'includeAll':![]});if(_0x2dd038){return db[_0x7625('0x52')]['findAll']({'where':{'userProfileId':_0x303ef7[_0x7625('0x47')]['id'],'sectionId':_[_0x7625('0x2b')](_0x2dd038,function(_0x1275f6){return _0x1275f6[_0x7625('0x60')];})},'attributes':['id',_0x7625('0x60')],'raw':!![]})[_0x7625('0x41')](function(_0x18c662){var _0x3ca9e7=_[_0x7625('0x2b')](_0x303ef7[_0x7625('0x4a')],function(_0x3bb539){_0x3bb539[_0x7625('0x57')]=_0x303ef7['params']['id'];return _0x3bb539;});return db[_0x7625('0x56')][_0x7625('0x65')](_0x3ca9e7,{'raw':!![],'transaction':_0x330b4c});});}})[_0x7625('0x45')](handleError(_0x1493b4,null));});}})[_0x7625('0x41')](function(_0x5e841a){var _0x405ef9=_[_0x7625('0x2b')](_0x5e841a,function(_0x155017){return _0x155017[_0x7625('0x4c')]({'plain':!![]});});})[_0x7625('0x41')](respondWithResult(_0x1493b4,null))[_0x7625('0x45')](handleError(_0x1493b4,null));};exports['removeResources']=function(_0x308f7c,_0x20492f,_0x2fb164){return db[_0x7625('0x2c')][_0x7625('0x48')]({'where':{'id':_0x308f7c[_0x7625('0x47')]['id']}})[_0x7625('0x41')](handleEntityNotFound(_0x20492f,null))[_0x7625('0x41')](function(_0x1f5858){if(_0x1f5858){return _0x1f5858[_0x7625('0x66')](_0x308f7c[_0x7625('0x31')]['ids']);}})['then'](respondWithStatusCode(_0x20492f,null))[_0x7625('0x45')](handleError(_0x20492f,null));};exports[_0x7625('0x67')]=function(_0x2c8519,_0x4b10df){var _0x59c5d2={};if(!_0x2c8519[_0x7625('0x31')][_0x7625('0x68')])throw new Error(_0x7625('0x69'));if(!_0x2c8519['query'][_0x7625('0x6a')](_0x7625('0x6b'))){_0x59c5d2[_0x7625('0x1e')]=qs[_0x7625('0x1e')](_0x2c8519[_0x7625('0x31')][_0x7625('0x1e')]);_0x59c5d2[_0x7625('0x1d')]=qs['offset'](_0x2c8519[_0x7625('0x31')]['offset']);}return db[_0x7625('0x2c')][_0x7625('0x48')]({'where':{'id':_0x2c8519[_0x7625('0x47')]['id']}})[_0x7625('0x41')](function(_0x45a19d){if(!_0x45a19d)throw new Error(_0x7625('0x6c')+_0x2c8519[_0x7625('0x47')]['id']);return db['UserProfile'][_0x7625('0x67')](_0x2c8519);})[_0x7625('0x41')](respondWithFilteredResult(_0x4b10df,_0x59c5d2))['catch'](handleError(_0x4b10df,null));}; \ No newline at end of file +var _0x6901=['Resources','UserProfileSection','describe','addSections','push','removeSections','getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','resourceId','Plugin','addResources','userProfileId','bulkCreate','removeResources','ids','getResources','section','Missing\x20section\x20parameter','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','zip-dir','fast-json-patch','bluebird','mustache','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','name','send','index','map','UserProfile','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','clone','get','crudPermissions','createdAt','sequelize','transaction','each','autoAssociation','UserProfileResource','sectionId','omit','updatedAt'];(function(_0x433057,_0x519616){var _0x2fc400=function(_0x5a59b9){while(--_0x5a59b9){_0x433057['push'](_0x433057['shift']());}};_0x2fc400(++_0x519616);}(_0x6901,0x100));var _0x1690=function(_0x437f4a,_0x2fdc3b){_0x437f4a=_0x437f4a-0x0;var _0x140337=_0x6901[_0x437f4a];return _0x140337;};'use strict';var emlformat=require(_0x1690('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1690('0x1'));var jsonpatch=require(_0x1690('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1690('0x3'));var Mustache=require(_0x1690('0x4'));var util=require('util');var path=require('path');var sox=require(_0x1690('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1690('0x6'));var _=require(_0x1690('0x7'));var squel=require(_0x1690('0x8'));var crypto=require(_0x1690('0x9'));var jsforce=require(_0x1690('0xa'));var deskjs=require(_0x1690('0xb'));var toCsv=require('to-csv');var querystring=require(_0x1690('0xc'));var Papa=require(_0x1690('0xd'));var Redis=require(_0x1690('0xe'));var authService=require(_0x1690('0xf'));var qs=require(_0x1690('0x10'));var as=require(_0x1690('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1690('0x12'))(_0x1690('0x13'));var utils=require('../../config/utils');var config=require(_0x1690('0x14'));var licenseUtil=require(_0x1690('0x15'));var db=require(_0x1690('0x16'))['db'];config[_0x1690('0x17')]=_[_0x1690('0x18')](config[_0x1690('0x17')],{'host':_0x1690('0x19'),'port':0x18eb});var socket=require(_0x1690('0x1a'))(new Redis(config[_0x1690('0x17')]));require(_0x1690('0x1b'))['register'](socket);function respondWithStatusCode(_0x2adcb3,_0x2d4e75){_0x2d4e75=_0x2d4e75||0xcc;return function(_0x11e9bf){if(_0x11e9bf){return _0x2adcb3['sendStatus'](_0x2d4e75);}return _0x2adcb3['status'](_0x2d4e75)[_0x1690('0x1c')]();};}function respondWithResult(_0x575010,_0x1e2061){_0x1e2061=_0x1e2061||0xc8;return function(_0x5295b6){if(_0x5295b6){return _0x575010['status'](_0x1e2061)[_0x1690('0x1d')](_0x5295b6);}};}function respondWithFilteredResult(_0x55bb34,_0x36c250){return function(_0x2e1696){if(_0x2e1696){var _0x58435b=typeof _0x36c250[_0x1690('0x1e')]===_0x1690('0x1f')&&typeof _0x36c250[_0x1690('0x20')]===_0x1690('0x1f');var _0x4d06e7=_0x2e1696[_0x1690('0x21')];var _0x4d2fb9=_0x58435b?0x0:_0x36c250[_0x1690('0x1e')];var _0x2be44b=_0x58435b?_0x2e1696[_0x1690('0x21')]:_0x36c250[_0x1690('0x1e')]+_0x36c250[_0x1690('0x20')];var _0x8f5ceb;if(_0x2be44b>=_0x4d06e7){_0x2be44b=_0x4d06e7;_0x8f5ceb=0xc8;}else{_0x8f5ceb=0xce;}_0x55bb34[_0x1690('0x22')](_0x8f5ceb);return _0x55bb34[_0x1690('0x23')](_0x1690('0x24'),_0x4d2fb9+'-'+_0x2be44b+'/'+_0x4d06e7)[_0x1690('0x1d')](_0x2e1696);}return null;};}function patchUpdates(_0x74cb9){return function(_0x44986d){try{jsonpatch[_0x1690('0x25')](_0x44986d,_0x74cb9,!![]);}catch(_0x3e24e5){return BPromise[_0x1690('0x26')](_0x3e24e5);}return _0x44986d[_0x1690('0x27')]();};}function saveUpdates(_0x395d81,_0x1b7fc1){return function(_0x592104){if(_0x592104){return _0x592104[_0x1690('0x28')](_0x395d81)[_0x1690('0x29')](function(_0x5c1cf8){return _0x5c1cf8;});}return null;};}function removeEntity(_0x34a818,_0x1c1b7b){return function(_0x252e88){if(_0x252e88){return _0x252e88[_0x1690('0x2a')]()['then'](function(){_0x34a818[_0x1690('0x22')](0xcc)[_0x1690('0x1c')]();});}};}function handleEntityNotFound(_0x32dd95,_0x1d7ae2){return function(_0x214679){if(!_0x214679){_0x32dd95[_0x1690('0x2b')](0x194);}return _0x214679;};}function handleError(_0x4fb78c,_0x48febb){_0x48febb=_0x48febb||0x1f4;return function(_0x12961e){logger['error'](_0x12961e['stack']);if(_0x12961e['name']){delete _0x12961e[_0x1690('0x2c')];}_0x4fb78c[_0x1690('0x22')](_0x48febb)[_0x1690('0x2d')](_0x12961e);};}exports[_0x1690('0x2e')]=function(_0x2bd32e,_0x3022f7){var _0x2ff0d5={},_0x52760b={},_0x3ead2e={'count':0x0,'rows':[]};var _0x45cddb=_[_0x1690('0x2f')](db[_0x1690('0x30')][_0x1690('0x31')],function(_0x2579ce){return{'name':_0x2579ce[_0x1690('0x32')],'type':_0x2579ce['type'][_0x1690('0x33')]};});_0x52760b[_0x1690('0x34')]=_['map'](_0x45cddb,_0x1690('0x2c'));_0x52760b[_0x1690('0x35')]=_[_0x1690('0x36')](_0x2bd32e[_0x1690('0x35')]);_0x52760b[_0x1690('0x37')]=_[_0x1690('0x38')](_0x52760b[_0x1690('0x34')],_0x52760b[_0x1690('0x35')]);_0x2ff0d5['attributes']=_[_0x1690('0x38')](_0x52760b[_0x1690('0x34')],qs[_0x1690('0x39')](_0x2bd32e[_0x1690('0x35')]['fields']));_0x2ff0d5['attributes']=_0x2ff0d5[_0x1690('0x3a')][_0x1690('0x3b')]?_0x2ff0d5[_0x1690('0x3a')]:_0x52760b[_0x1690('0x34')];if(!_0x2bd32e[_0x1690('0x35')][_0x1690('0x3c')]('nolimit')){_0x2ff0d5[_0x1690('0x20')]=qs[_0x1690('0x20')](_0x2bd32e['query'][_0x1690('0x20')]);_0x2ff0d5['offset']=qs['offset'](_0x2bd32e[_0x1690('0x35')][_0x1690('0x1e')]);}_0x2ff0d5['order']=qs['sort'](_0x2bd32e[_0x1690('0x35')][_0x1690('0x3d')]);_0x2ff0d5[_0x1690('0x3e')]=qs[_0x1690('0x37')](_[_0x1690('0x3f')](_0x2bd32e[_0x1690('0x35')],_0x52760b[_0x1690('0x37')]),_0x45cddb);if(_0x2bd32e[_0x1690('0x35')]['filter']){_0x2ff0d5[_0x1690('0x3e')]=_['merge'](_0x2ff0d5[_0x1690('0x3e')],{'$or':_[_0x1690('0x2f')](_0x45cddb,function(_0x1e6242){if(_0x1e6242['type']!==_0x1690('0x40')){var _0x9b3489={};_0x9b3489[_0x1e6242[_0x1690('0x2c')]]={'$like':'%'+_0x2bd32e['query'][_0x1690('0x41')]+'%'};return _0x9b3489;}})});}_0x2ff0d5=_[_0x1690('0x42')]({},_0x2ff0d5,_0x2bd32e[_0x1690('0x43')]);var _0x37f620={'where':_0x2ff0d5['where']};return db['UserProfile'][_0x1690('0x21')](_0x37f620)[_0x1690('0x29')](function(_0x2a39c2){_0x3ead2e[_0x1690('0x21')]=_0x2a39c2;if(_0x2bd32e['query'][_0x1690('0x44')]){_0x2ff0d5[_0x1690('0x45')]=[{'all':!![]}];}return db[_0x1690('0x30')][_0x1690('0x46')](_0x2ff0d5);})['then'](function(_0x5e3c68){_0x3ead2e['rows']=_0x5e3c68;return _0x3ead2e;})[_0x1690('0x29')](respondWithFilteredResult(_0x3022f7,_0x2ff0d5))[_0x1690('0x47')](handleError(_0x3022f7,null));};exports[_0x1690('0x48')]=function(_0x4bc829,_0x1c18d3){var _0xf248c0={'raw':![],'where':{'id':_0x4bc829[_0x1690('0x49')]['id']}},_0x4dd5ff={};_0x4dd5ff[_0x1690('0x34')]=_['keys'](db[_0x1690('0x30')]['rawAttributes']);_0x4dd5ff[_0x1690('0x35')]=_[_0x1690('0x36')](_0x4bc829[_0x1690('0x35')]);_0x4dd5ff[_0x1690('0x37')]=_[_0x1690('0x38')](_0x4dd5ff[_0x1690('0x34')],_0x4dd5ff[_0x1690('0x35')]);_0xf248c0[_0x1690('0x3a')]=_[_0x1690('0x38')](_0x4dd5ff[_0x1690('0x34')],qs[_0x1690('0x39')](_0x4bc829[_0x1690('0x35')][_0x1690('0x39')]));_0xf248c0[_0x1690('0x3a')]=_0xf248c0['attributes']['length']?_0xf248c0[_0x1690('0x3a')]:_0x4dd5ff['model'];if(_0x4bc829[_0x1690('0x35')][_0x1690('0x44')]){_0xf248c0[_0x1690('0x45')]=[{'all':!![]}];}_0xf248c0=_[_0x1690('0x42')]({},_0xf248c0,_0x4bc829['options']);return db[_0x1690('0x30')][_0x1690('0x4a')](_0xf248c0)[_0x1690('0x29')](handleEntityNotFound(_0x1c18d3,null))[_0x1690('0x29')](respondWithResult(_0x1c18d3,null))['catch'](handleError(_0x1c18d3,null));};exports[_0x1690('0x4b')]=function(_0x537c58,_0x36fb1d){return db['UserProfile']['create'](_0x537c58[_0x1690('0x4c')],{})['then'](respondWithResult(_0x36fb1d,0xc9))[_0x1690('0x47')](handleError(_0x36fb1d,null));};exports[_0x1690('0x4d')]=function(_0x37943b,_0x219b7c){var _0x33ef29={'where':{'id':_0x37943b[_0x1690('0x49')]['id']}},_0x3d4d95={};_0x3d4d95[_0x1690('0x34')]=_['keys'](db['UserProfile'][_0x1690('0x31')]);_0x33ef29['attributes']=_['intersection'](_0x3d4d95[_0x1690('0x34')],qs[_0x1690('0x39')](_0x37943b[_0x1690('0x35')]['fields']));_0x33ef29['attributes']=_0x33ef29['attributes'][_0x1690('0x3b')]?_0x33ef29['attributes']:_0x3d4d95[_0x1690('0x34')];if(_0x37943b[_0x1690('0x35')][_0x1690('0x44')]){_0x33ef29[_0x1690('0x45')]=[{'all':!![]}];}_0x33ef29=_[_0x1690('0x42')]({},_0x33ef29,_0x37943b['options']);return db[_0x1690('0x30')][_0x1690('0x4a')](_0x33ef29)[_0x1690('0x29')](handleEntityNotFound(_0x219b7c,null))[_0x1690('0x29')](function(_0x2e3e8a){if(_0x2e3e8a){var _0x17c5ab=_0x2e3e8a[_0x1690('0x4e')]({'plain':!![]});_0x17c5ab=qs['omit'](_0x17c5ab,['id','createdAt','updatedAt',_0x1690('0x4f')]);_0x37943b[_0x1690('0x4c')]=_['omit'](_0x37943b['body'],['id',_0x1690('0x50'),'updatedAt']);return db[_0x1690('0x51')][_0x1690('0x52')](function(_0x535c53){return db[_0x1690('0x30')][_0x1690('0x4b')](_['merge'](_0x17c5ab,_0x37943b[_0x1690('0x4c')]),{'include':_0x37943b[_0x1690('0x35')][_0x1690('0x44')]?[{'all':!![]}]:undefined,'transaction':_0x535c53})['then'](function(_0x28d2dd){var _0x35e73c=_0x28d2dd[_0x1690('0x4e')]({'plain':!![]});return db['UserProfileSection'][_0x1690('0x46')]({'where':{'userProfileId':_0x37943b['params']['id']},'raw':!![]})['then'](function(_0x372908){if(_0x372908){return BPromise[_0x1690('0x53')](_0x372908,function(_0x2dc53c){return new BPromise(function(_0x2ff810,_0x1e5f24){if(_0x2dc53c[_0x1690('0x54')]===null||_0x2dc53c[_0x1690('0x54')]===0x1)_0x2ff810(null);return db[_0x1690('0x55')]['findAll']({'where':{'sectionId':_0x2dc53c['id']},'raw':!![]})[_0x1690('0x29')](function(_0x3d4c3d){var _0x35b9ab=_[_0x1690('0x2f')](_0x3d4c3d,function(_0x56bbc1){return qs['omit'](_0x56bbc1,['id',_0x1690('0x50'),'updatedAt',_0x1690('0x56')]);});_0x2ff810(_0x35b9ab);})[_0x1690('0x47')](function(_0x2afa21){_0x1e5f24(_0x2afa21);});})[_0x1690('0x29')](function(_0x4db8e9){var _0x45e4fc=qs[_0x1690('0x57')](_0x2dc53c,['id',_0x1690('0x50'),_0x1690('0x58')]);_0x45e4fc['userProfileId']=_0x35e73c['id'];if(_0x4db8e9)_0x45e4fc[_0x1690('0x59')]=_0x4db8e9;return _0x45e4fc;})[_0x1690('0x29')](function(_0x5dfe8c){return db[_0x1690('0x5a')][_0x1690('0x4b')](_0x5dfe8c,{'include':[{'model':db[_0x1690('0x55')],'as':'Resources'}],'raw':!![],'transaction':_0x535c53});});})[_0x1690('0x29')](function(){return _0x35e73c;});}});});});}})[_0x1690('0x29')](respondWithResult(_0x219b7c,0xc9))[_0x1690('0x47')](handleError(_0x219b7c,null));};exports['update']=function(_0x2e8373,_0x2f755){if(_0x2e8373[_0x1690('0x4c')]['id']){delete _0x2e8373[_0x1690('0x4c')]['id'];}return db[_0x1690('0x30')][_0x1690('0x4a')]({'where':{'id':_0x2e8373['params']['id']}})[_0x1690('0x29')](handleEntityNotFound(_0x2f755,null))[_0x1690('0x29')](saveUpdates(_0x2e8373[_0x1690('0x4c')],null))[_0x1690('0x29')](respondWithResult(_0x2f755,null))[_0x1690('0x47')](handleError(_0x2f755,null));};exports['destroy']=function(_0x3d7217,_0x5a09ac){return db['UserProfile'][_0x1690('0x4a')]({'where':{'id':_0x3d7217[_0x1690('0x49')]['id']}})[_0x1690('0x29')](handleEntityNotFound(_0x5a09ac,null))[_0x1690('0x29')](removeEntity(_0x5a09ac,null))['catch'](handleError(_0x5a09ac,null));};exports[_0x1690('0x5b')]=function(_0x45d2cc,_0x276bb7){return db[_0x1690('0x30')][_0x1690('0x5b')]()['then'](respondWithResult(_0x276bb7,null))[_0x1690('0x47')](handleError(_0x276bb7,null));};exports[_0x1690('0x5c')]=function(_0x179de2,_0x574770){var _0x56705b=_0x179de2[_0x1690('0x4c')];return db['UserProfile'][_0x1690('0x4a')]({'where':{'id':_0x179de2['params']['id']}})['then'](handleEntityNotFound(_0x574770,null))[_0x1690('0x29')](function(_0x1e832b){if(_0x1e832b){return db['sequelize']['transaction'](function(_0x222530){return db[_0x1690('0x5a')][_0x1690('0x2a')]({'where':{'userProfileId':_0x179de2[_0x1690('0x49')]['id'],'sectionId':_['map'](_0x56705b,function(_0x53a5e7){return _0x53a5e7[_0x1690('0x56')];})},'transaction':_0x222530})[_0x1690('0x29')](function(){var _0x3e5cea=_['map'](_0x56705b,function(_0x3cd2fa){_0x3cd2fa['userProfileId']=_0x179de2[_0x1690('0x49')]['id'];return _0x3cd2fa;});var _0x3ef521=[];return BPromise[_0x1690('0x53')](_0x3e5cea,function(_0x3fe463){return db[_0x1690('0x5a')][_0x1690('0x4b')](_0x3fe463,{'include':[{'model':db[_0x1690('0x55')],'as':_0x1690('0x59')}],'raw':!![],'transaction':_0x222530})[_0x1690('0x29')](function(_0x583cef){_0x3ef521[_0x1690('0x5d')](_0x583cef[_0x1690('0x4e')]({'plain':!![]}));});})['then'](function(){return _0x3ef521;});});});}})[_0x1690('0x29')](function(_0x514208){return _0x514208;})[_0x1690('0x29')](respondWithResult(_0x574770,null))[_0x1690('0x47')](handleError(_0x574770,null));};exports[_0x1690('0x5e')]=function(_0x5779f7,_0x15ccd2){var _0x133fb4;return db['UserProfile'][_0x1690('0x4a')]({'where':{'id':_0x5779f7['params']['id']},'attributes':['id',_0x1690('0x2c')]})[_0x1690('0x29')](handleEntityNotFound(_0x15ccd2,null))[_0x1690('0x29')](function(_0x2bde92){if(_0x2bde92){_0x133fb4=_0x2bde92;return db['UserProfileSection'][_0x1690('0x2a')]({'where':{'userProfileId':_0x5779f7[_0x1690('0x49')]['id'],'sectionId':_0x5779f7['query']['ids']}});}})[_0x1690('0x29')](function(){return _0x133fb4;})[_0x1690('0x29')](respondWithStatusCode(_0x15ccd2,null))[_0x1690('0x47')](handleError(_0x15ccd2,null));};exports[_0x1690('0x5f')]=function(_0x277f57,_0x55b44b){var _0x2671f0=[];var _0x55a6d2=[];return db['UserProfileSection'][_0x1690('0x46')]({'where':{'userProfileId':_0x277f57[_0x1690('0x49')]['id']},'raw':!![]})[_0x1690('0x29')](function(_0x15572c){_0x2671f0=_[_0x1690('0x41')](_0x15572c,function(_0x3ea1cd){return _0x3ea1cd[_0x1690('0x60')]===0x1||_[_0x1690('0x61')]([0x3eb,0x709],_0x3ea1cd[_0x1690('0x56')]);});if(!_[_0x1690('0x62')](_0x2671f0)){return _[_0x1690('0x2f')](_0x2671f0,function(_0x250faf){return _0x250faf[_0x1690('0x56')];});}else{return;}})['then'](function(_0x42ead8){if(_0x42ead8)_0x55a6d2=_0x42ead8;if(_['includes'](_0x55a6d2,0x64)){var _0x29859b=_[_0x1690('0x4a')](_0x2671f0,{'sectionId':0x64});return hasDefaultDashboard(_0x29859b)['then'](function(_0x358afc){return _[_0x1690('0x2f')](_0x2671f0,function(_0x4e7b6b){if(_0x4e7b6b['sectionId']===0x64){_0x4e7b6b[_0x1690('0x63')]=_0x358afc;}return _0x4e7b6b;});});}else{return;}})[_0x1690('0x29')](function(_0x5e93f6){if(_0x5e93f6)_0x2671f0=_0x5e93f6;if(_[_0x1690('0x61')](_0x55a6d2,0x3eb)){var _0x21b1ce=_[_0x1690('0x4a')](_0x2671f0,{'sectionId':0x3eb});return getCustomDashboards(_0x21b1ce)[_0x1690('0x29')](function(_0x393cd8){return _[_0x1690('0x2f')](_0x2671f0,function(_0xa59d45){if(_0x21b1ce[_0x1690('0x60')]){if(_0xa59d45[_0x1690('0x56')]===0x3eb){_0xa59d45['subsections']=_0x393cd8;}}else{if(_0xa59d45[_0x1690('0x56')]===0x64){_0xa59d45[_0x1690('0x63')]=_0x393cd8;}}return _0xa59d45;});});}else{return;}})[_0x1690('0x29')](function(_0xf7e2f4){if(_0xf7e2f4)_0x2671f0=_0xf7e2f4;if(_[_0x1690('0x61')](_0x55a6d2,0x709)){var _0x2bfce1=_[_0x1690('0x4a')](_0x2671f0,{'sectionId':0x709});return getPlugins(_0x2bfce1)[_0x1690('0x29')](function(_0xcb3f08){if(_0x2bfce1[_0x1690('0x60')]){return _[_0x1690('0x2f')](_0x2671f0,function(_0x9f8ade){if(_0x9f8ade[_0x1690('0x56')]===0x709){_0x9f8ade[_0x1690('0x63')]=_0xcb3f08;}return _0x9f8ade;});}else{var _0x2cf91a={'sectionId':0x76c,'enabled':0x1,'subsections':_0xcb3f08};var _0x2ac77e=_['map'](_0x2671f0);_0x2ac77e[_0x1690('0x5d')](_0x2cf91a);return _0x2ac77e;}});}else{return;}})['then'](function(_0x2694b5){if(_0x2694b5)_0x2671f0=_0x2694b5;return _[_0x1690('0x41')](_0x2671f0,[_0x1690('0x60'),0x1]);})[_0x1690('0x29')](respondWithResult(_0x55b44b,null))[_0x1690('0x47')](handleError(_0x55b44b,null));};function hasDefaultDashboard(_0x55ff77){var _0x14a73a=[0x65];return new BPromise(function(_0x4dca59,_0x1419a9){try{if(_0x55ff77[_0x1690('0x54')]){_0x4dca59(_0x14a73a);}else{return db[_0x1690('0x55')][_0x1690('0x64')]({'where':{'sectionId':_0x55ff77['id']},'raw':!![]})[_0x1690('0x29')](function(_0x7b9e3c){_0x7b9e3c?_0x4dca59(_0x14a73a):_0x4dca59();});}}catch(_0x58ad55){_0x1419a9(_0x58ad55);}});}function getCustomDashboards(_0x576e9c){var _0x4da656=[];return new BPromise(function(_0x285239,_0x4189ad){try{if(_0x576e9c[_0x1690('0x54')]){return db[_0x1690('0x65')][_0x1690('0x46')]({'raw':!![]})[_0x1690('0x29')](function(_0x546f56){_0x546f56[_0x1690('0x66')](function(_0x239a67){_0x4da656['push'](_0x239a67['id']+0x1869f);});_0x285239(_0x4da656);});}else{return db[_0x1690('0x55')][_0x1690('0x46')]({'where':{'sectionId':_0x576e9c['id']},'raw':!![]})[_0x1690('0x29')](function(_0x321e71){_0x321e71[_0x1690('0x66')](function(_0x276fe0){_0x4da656[_0x1690('0x5d')](_0x276fe0[_0x1690('0x67')]+0x1869f);});_0x285239(_0x4da656);});}}catch(_0x33a30e){_0x4189ad(_0x33a30e);}});}function getPlugins(_0x878394){var _0x335996=[];return new BPromise(function(_0x36f7f9,_0x522c67){try{if(_0x878394[_0x1690('0x54')]){return db[_0x1690('0x68')]['findAll']({'raw':!![]})[_0x1690('0x29')](function(_0x379f5){_0x379f5['forEach'](function(_0x1b225e){_0x335996[_0x1690('0x5d')](_0x1b225e['id']+0x15b38);});_0x36f7f9(_0x335996);});}else{return db['UserProfileResource'][_0x1690('0x46')]({'where':{'sectionId':_0x878394['id']},'raw':!![]})[_0x1690('0x29')](function(_0x451dd5){_0x451dd5[_0x1690('0x66')](function(_0x3ad28b){_0x335996[_0x1690('0x5d')](_0x3ad28b[_0x1690('0x67')]+0x15b38);});_0x36f7f9(_0x335996);});}}catch(_0x2df0e7){_0x522c67(_0x2df0e7);}});}exports[_0x1690('0x69')]=function(_0xb9843f,_0x383e7e){return db[_0x1690('0x30')][_0x1690('0x4a')]({'where':{'id':_0xb9843f[_0x1690('0x49')]['id']}})[_0x1690('0x29')](handleEntityNotFound(_0x383e7e,null))['then'](function(_0xc40ced){if(_0xc40ced){return db[_0x1690('0x51')][_0x1690('0x52')](function(_0x45f3e7){return db[_0x1690('0x5a')][_0x1690('0x46')]({'where':{'userProfileId':_0xb9843f['params']['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x5130fb){if(_0x5130fb){return db['UserProfileSection'][_0x1690('0x2a')]({'where':{'userProfileId':_0xb9843f[_0x1690('0x49')]['id'],'id':_[_0x1690('0x2f')](_0x5130fb,function(_0x59d567){return _0x59d567['id'];})},'transaction':_0x45f3e7});}})[_0x1690('0x29')](function(_0x11887d){var _0xd6dcee=_[_0x1690('0x2f')](_0xb9843f[_0x1690('0x4c')],function(_0x3ee1b4){_0x3ee1b4[_0x1690('0x6a')]=_0xb9843f[_0x1690('0x49')]['id'];return _0x3ee1b4;});return db[_0x1690('0x5a')][_0x1690('0x6b')](_0xd6dcee,{'raw':!![],'transaction':_0x45f3e7});})[_0x1690('0x29')](function(_0x32374d){var _0x4a27c2=_[_0x1690('0x41')](_[_0x1690('0x2f')](_0x32374d,function(_0x4f01d8){return _0x4f01d8[_0x1690('0x4e')]({'plain':!![]});}),{'includeAll':![]});if(_0x4a27c2){return db['UserProfileSection'][_0x1690('0x46')]({'where':{'userProfileId':_0xb9843f[_0x1690('0x49')]['id'],'sectionId':_[_0x1690('0x2f')](_0x4a27c2,function(_0x2c9256){return _0x2c9256[_0x1690('0x56')];})},'attributes':['id',_0x1690('0x56')],'raw':!![]})['then'](function(_0x2ab1f8){var _0x5496dd=_[_0x1690('0x2f')](_0xb9843f['body'],function(_0x29b66d){_0x29b66d[_0x1690('0x6a')]=_0xb9843f[_0x1690('0x49')]['id'];return _0x29b66d;});return db[_0x1690('0x55')][_0x1690('0x6b')](_0x5496dd,{'raw':!![],'transaction':_0x45f3e7});});}})[_0x1690('0x47')](handleError(_0x383e7e,null));});}})[_0x1690('0x29')](function(_0xeecdb9){var _0x157fa8=_[_0x1690('0x2f')](_0xeecdb9,function(_0x109c1c){return _0x109c1c[_0x1690('0x4e')]({'plain':!![]});});})[_0x1690('0x29')](respondWithResult(_0x383e7e,null))['catch'](handleError(_0x383e7e,null));};exports['removeResources']=function(_0x2a2d5c,_0x2d7f1d,_0x3a633e){return db[_0x1690('0x30')][_0x1690('0x4a')]({'where':{'id':_0x2a2d5c[_0x1690('0x49')]['id']}})[_0x1690('0x29')](handleEntityNotFound(_0x2d7f1d,null))[_0x1690('0x29')](function(_0x2fe94d){if(_0x2fe94d){return _0x2fe94d[_0x1690('0x6c')](_0x2a2d5c[_0x1690('0x35')][_0x1690('0x6d')]);}})[_0x1690('0x29')](respondWithStatusCode(_0x2d7f1d,null))[_0x1690('0x47')](handleError(_0x2d7f1d,null));};exports[_0x1690('0x6e')]=function(_0x254761,_0x241f63){var _0x2598cc={};if(!_0x254761[_0x1690('0x35')][_0x1690('0x6f')])throw new Error(_0x1690('0x70'));if(!_0x254761[_0x1690('0x35')]['hasOwnProperty'](_0x1690('0x71'))){_0x2598cc[_0x1690('0x20')]=qs[_0x1690('0x20')](_0x254761[_0x1690('0x35')][_0x1690('0x20')]);_0x2598cc[_0x1690('0x1e')]=qs['offset'](_0x254761[_0x1690('0x35')][_0x1690('0x1e')]);}return db[_0x1690('0x30')][_0x1690('0x4a')]({'where':{'id':_0x254761[_0x1690('0x49')]['id']}})[_0x1690('0x29')](function(_0x4379ca){if(!_0x4379ca)throw new Error(_0x1690('0x72')+_0x254761[_0x1690('0x49')]['id']);return db[_0x1690('0x30')][_0x1690('0x6e')](_0x254761);})[_0x1690('0x29')](respondWithFilteredResult(_0x241f63,_0x2598cc))[_0x1690('0x47')](handleError(_0x241f63,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index c4c9f0d..b607e9c 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 _0xd046=['update','hasOwnProperty','hook','../../mysqldb','UserProfile','setMaxListeners'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd046,0x129));var _0x6d04=function(_0x25beba,_0x5e340c){_0x25beba=_0x25beba-0x0;var _0x254add=_0xd046[_0x25beba];return _0x254add;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x6d04('0x0'))['db'][_0x6d04('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x6d04('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6d04('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4d3747){return function(_0x33720a,_0x4d2121,_0x174d65){UserProfileEvents['emit'](_0x4d3747+':'+_0x33720a['id'],_0x33720a);UserProfileEvents['emit'](_0x4d3747,_0x33720a);_0x174d65(null);};}for(var e in events){if(events[_0x6d04('0x4')](e)){var event=events[e];UserProfile[_0x6d04('0x5')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file +var _0xcedf=['setMaxListeners','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','UserProfile'];(function(_0x5497d3,_0x193adf){var _0x42f1ef=function(_0x83263f){while(--_0x83263f){_0x5497d3['push'](_0x5497d3['shift']());}};_0x42f1ef(++_0x193adf);}(_0xcedf,0x1b6));var _0xfced=function(_0x5ec6d9,_0xc1413a){_0x5ec6d9=_0x5ec6d9-0x0;var _0x4d0a8d=_0xcedf[_0x5ec6d9];return _0x4d0a8d;};'use strict';var EventEmitter=require(_0xfced('0x0'));var UserProfile=require(_0xfced('0x1'))['db'][_0xfced('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xfced('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfced('0x4'),'afterDestroy':_0xfced('0x5')};function emitEvent(_0x4c426b){return function(_0x5b16af,_0x1dad76,_0x4a86d5){UserProfileEvents[_0xfced('0x6')](_0x4c426b+':'+_0x5b16af['id'],_0x5b16af);UserProfileEvents['emit'](_0x4c426b,_0x5b16af);_0x4a86d5(null);};}for(var e in events){if(events[_0xfced('0x7')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0xfced('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 368f99d..94fed76 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 _0x687b=['chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','inboundroutes','internalroutes','outboundroutes','VoiceContext','VoiceMail','Agents','membername','User','role','Telephones','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','type','chanspies','voiceprefixes','ivrcampaigns','Campaign','MailQueue','mailaccounts','MailAccount','mailsubstatuses','openchannelqueues','openchannelaccounts','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','agents','telephones','Users','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','FreshdeskAccount','sugarcrmaccounts','DeskAccount','zohoaccounts','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','customdashboards','Dashboard','Pause','scheduler','Schedule','sounds','Sound','tags','Tag','templates','Template','triggers','Trigger','Trunk','variables','Variable','Plugin','Reports','AnalyticMetric','toUpperCase','Sequelize','QueryTypes','SELECT','select','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','UserProfile','user_profiles','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','push','UserProfileSection','find','params','all','ignore','union','length','autoAssociation','rawAttributes','keys','filters','attributes','intersection','fields','nolimit','offset','order','sort','pick','merge','key','foreignKey','options','includeAll','include','findAll','forEach','reportType','reportId','custom','CustomReports','count','rows','color','tag','ThroughTags','openTabs','true','sms','dataValues','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','models','filter','value','then','associatedResources','map','catch','model','name','UserProfileResource','field','AnalyticExtractedReport','resourceId','toLowerCase','squareprojects','SquareProject','odbc','childModel','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projects','JscriptyProject','contacts','CmContact','Lists','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField'];(function(_0x4262b7,_0x40bbad){var _0x25c115=function(_0x2b6c5e){while(--_0x2b6c5e){_0x4262b7['push'](_0x4262b7['shift']());}};_0x25c115(++_0x40bbad);}(_0x687b,0x14a));var _0xb687=function(_0x4eb893,_0x1b650c){_0x4eb893=_0x4eb893-0x0;var _0x113080=_0x687b[_0x4eb893];return _0x113080;};'use strict';var _=require(_0xb687('0x0'));var attributes=require(_0xb687('0x1'));var qs=require(_0xb687('0x2'));var squel=require(_0xb687('0x3'));module['exports']=function(_0x5e5f06){var _0x35069a=_0x5e5f06[_0xb687('0x4')];function _0x36c468(_0x31bd0d,_0x46e5b3){return new Promise(function(_0x194c55,_0x16ccf3){if(!_0x46e5b3)return _0x194c55(null);var _0xf43a1f=_0x46e5b3[_0xb687('0x5')]?{[_0x46e5b3[_0xb687('0x5')]['field']]:_0x46e5b3[_0xb687('0x5')][_0xb687('0x6')]}:undefined;return _0x35069a[_0x31bd0d]['findAll']({'where':_0xf43a1f,'raw':!![]})[_0xb687('0x7')](function(_0x21e3ab){_0x46e5b3[_0xb687('0x8')]=_[_0xb687('0x9')](_0x21e3ab,'id');_0x194c55(_0x46e5b3);})[_0xb687('0xa')](function(_0x309d84){_0x16ccf3(_0x309d84);});});}function _0x3e6271(_0xaf4727,_0x5e61e){return new Promise(function(_0x5103b9,_0x226e56){var _0xbeb5cc=_0xaf4727[_0xb687('0x5')]?{[_0xaf4727[_0xb687('0x5')]['field']]:_0xaf4727['filter'][_0xb687('0x6')]}:undefined;return _0x35069a[_0xaf4727[_0xb687('0xb')]]['findAll']({'where':_0xbeb5cc,'raw':!![]})[_0xb687('0x7')](function(_0x2f1ac0){_0x5e61e[_0xb687('0x8')]=_[_0xb687('0x9')](_0x2f1ac0,function(_0x838dd4){return _0x838dd4[_0xb687('0xc')];});_0x5103b9(_0x5e61e);})[_0xb687('0xa')](function(_0x141375){_0x226e56(_0x141375);});});}function _0x263085(_0x2c7a18,_0x25124a,_0x19bb29){if(!_0x25124a)return Promise['resolve'](null);return new Promise(function(_0x214b06,_0x328301){return _0x35069a[_0xb687('0xd')]['findAll']({'where':{'sectionId':_0x25124a['id']},'raw':!![]})['then'](function(_0x12eff1){if(_0x2c7a18[_0xb687('0xe')]&&_0x2c7a18[_0xb687('0xe')]!=='id'){_0x25124a['associatedResources']=_[_0xb687('0x9')](_0x12eff1,function(_0x481f1d){return _0x481f1d[_0x2c7a18[_0xb687('0xe')]];});}else{if(_0x19bb29===_0xb687('0xf')){_0x25124a[_0xb687('0x8')]=_[_0xb687('0x9')](_0x12eff1,function(_0x49d5a1){return{'id':_0x49d5a1[_0xb687('0x10')],'type':_0x49d5a1['type']};});}else{_0x25124a[_0xb687('0x8')]=_[_0xb687('0x9')](_0x12eff1,function(_0x274241){return _0x274241['resourceId'];});}}_0x214b06(_0x25124a);})[_0xb687('0xa')](function(_0x491623){_0x328301(_0x491623);});});}function _0xa95e91(_0x16cdcb,_0xbf6c58){var _0x38866c={'parentSections':[]};switch(_0x16cdcb[_0xb687('0x11')]()){case _0xb687('0x12'):_0x38866c['childModel']=_0xb687('0x13');break;case _0xb687('0x14'):_0x38866c[_0xb687('0x15')]=_0xb687('0x16');break;case _0xb687('0x17'):_0x38866c[_0xb687('0x15')]=_0xb687('0x18');_0x38866c[_0xb687('0x19')]=[{'name':_0xb687('0x1a'),'field':_0xb687('0xc'),'foreignKey':'projectName'}];break;case _0xb687('0x1b'):_0x38866c[_0xb687('0x15')]=_0xb687('0x1c');break;case _0xb687('0x1d'):_0x38866c[_0xb687('0x15')]=_0xb687('0x1e');_0x38866c['parentSections']=[{'name':_0xb687('0x1f'),'field':'id','foreignKey':'ListId'}];break;case _0xb687('0x20'):_0x38866c[_0xb687('0x15')]=_0xb687('0x21');break;case _0xb687('0x22'):_0x38866c[_0xb687('0x15')]=_0xb687('0x23');break;case _0xb687('0x24'):_0x38866c['childModel']=_0xb687('0x25');break;case _0xb687('0x26'):_0x38866c[_0xb687('0x15')]=_0xb687('0x27');break;case _0xb687('0x28'):_0x38866c[_0xb687('0x15')]=_0xb687('0x29');break;case _0xb687('0x2a'):_0x38866c[_0xb687('0x15')]=_0xb687('0x2b');break;case _0xb687('0x2c'):_0x38866c['childModel']='FaxAccount';break;case _0xb687('0x2d'):case _0xb687('0x2e'):case _0xb687('0x2f'):_0x38866c[_0xb687('0x15')]='VoiceExtension';break;case'contexts':_0x38866c[_0xb687('0x15')]=_0xb687('0x30');break;case'voicemails':_0x38866c[_0xb687('0x15')]=_0xb687('0x31');break;case'voicerecordings':_0x38866c[_0xb687('0x15')]='VoiceRecording';_0x38866c[_0xb687('0x19')]=[{'name':_0xb687('0x32'),'field':_0xb687('0xc'),'foreignKey':_0xb687('0x33'),'model':_0xb687('0x34'),'filter':{'field':_0xb687('0x35'),'value':['agent']}},{'name':_0xb687('0x36'),'field':_0xb687('0xc'),'foreignKey':_0xb687('0x33'),'model':_0xb687('0x34'),'filter':{'field':'role','value':[_0xb687('0x37')]}},{'name':_0xb687('0x38'),'field':_0xb687('0xc'),'foreignKey':_0xb687('0x39'),'model':_0xb687('0x3a'),'filter':{'field':'type','value':[_0xb687('0x3b')]}},{'name':_0xb687('0x3c'),'field':_0xb687('0xc'),'foreignKey':_0xb687('0x39'),'model':_0xb687('0x3a'),'filter':{'field':_0xb687('0x3d'),'value':['outbound']}}];break;case'musiconholds':_0x38866c[_0xb687('0x15')]='VoiceMusicOnHold';break;case _0xb687('0x3e'):_0x38866c[_0xb687('0x15')]='VoiceChanSpy';break;case _0xb687('0x3f'):_0x38866c[_0xb687('0x15')]='VoicePrefix';break;case _0xb687('0x40'):_0x38866c[_0xb687('0x15')]=_0xb687('0x41');break;case'mailqueues':_0x38866c[_0xb687('0x15')]=_0xb687('0x42');break;case _0xb687('0x43'):_0x38866c[_0xb687('0x15')]=_0xb687('0x44');break;case _0xb687('0x45'):_0x38866c[_0xb687('0x15')]='MailSubstatus';break;case _0xb687('0x46'):_0x38866c['childModel']='OpenchannelQueue';break;case _0xb687('0x47'):_0x38866c[_0xb687('0x15')]='OpenchannelAccount';break;case _0xb687('0x48'):_0x38866c['childModel']=_0xb687('0x49');break;case _0xb687('0x4a'):_0x38866c['childModel']=_0xb687('0x4b');break;case _0xb687('0x4c'):_0x38866c['childModel']=_0xb687('0x4d');break;case _0xb687('0x4e'):_0x38866c[_0xb687('0x15')]=_0xb687('0x4f');break;case _0xb687('0x50'):_0x38866c[_0xb687('0x15')]=_0xb687('0x51');break;case _0xb687('0x52'):case _0xb687('0x53'):_0x38866c[_0xb687('0x15')]=_0xb687('0x3a');if(_0xbf6c58){_0x38866c[_0xb687('0x19')]=[{'name':'VoiceQueues'},{'name':_0xb687('0x3c')}];}break;case'users':case _0xb687('0x54'):case _0xb687('0x55'):_0x38866c[_0xb687('0x15')]=_0xb687('0x34');if(_0xbf6c58){_0x38866c[_0xb687('0x19')]=[{'name':_0xb687('0x56'),'filter':{'field':'role','value':['admin',_0xb687('0x57')]},'ignore':!![]},{'name':_0xb687('0x32')},{'name':_0xb687('0x36')}];}break;case _0xb687('0x58'):_0x38866c['childModel']=_0xb687('0x59');break;case _0xb687('0x5a'):_0x38866c[_0xb687('0x15')]=_0xb687('0x5b');break;case'freshdeskaccounts':_0x38866c[_0xb687('0x15')]=_0xb687('0x5c');break;case _0xb687('0x5d'):_0x38866c[_0xb687('0x15')]='SugarcrmAccount';break;case'deskaccounts':_0x38866c[_0xb687('0x15')]=_0xb687('0x5e');break;case _0xb687('0x5f'):_0x38866c['childModel']='ZohoAccount';break;case _0xb687('0x60'):_0x38866c[_0xb687('0x15')]=_0xb687('0x34');break;case _0xb687('0x61'):_0x38866c[_0xb687('0x15')]=_0xb687('0x62');break;case _0xb687('0x63'):_0x38866c[_0xb687('0x15')]='Disposition';break;case _0xb687('0x64'):_0x38866c[_0xb687('0x15')]=_0xb687('0x65');break;case'intervals':_0x38866c['childModel']='Interval';break;case'pauses':_0x38866c[_0xb687('0x15')]=_0xb687('0x66');break;case _0xb687('0x67'):_0x38866c[_0xb687('0x15')]=_0xb687('0x68');break;case _0xb687('0x69'):_0x38866c[_0xb687('0x15')]=_0xb687('0x6a');break;case _0xb687('0x6b'):_0x38866c[_0xb687('0x15')]=_0xb687('0x6c');break;case _0xb687('0x6d'):_0x38866c[_0xb687('0x15')]=_0xb687('0x6e');break;case _0xb687('0x6f'):_0x38866c[_0xb687('0x15')]=_0xb687('0x70');break;case'trunks':_0x38866c['childModel']=_0xb687('0x71');break;case _0xb687('0x72'):_0x38866c[_0xb687('0x15')]=_0xb687('0x73');break;case'plugins':_0x38866c[_0xb687('0x15')]=_0xb687('0x74');break;case'extractedreports':_0x38866c[_0xb687('0x15')]='AnalyticExtractedReport';_0x38866c[_0xb687('0x19')]=[{'name':_0xb687('0x75'),'field':'id','foreignKey':'reportId'}];break;case'metrics':_0x38866c[_0xb687('0x15')]=_0xb687('0x76');break;}return _0x38866c;}function _0x5ea8fd(_0x1da4d1,_0x318be6){var _0x3cd364=_0x1da4d1['charAt'](0x0)[_0xb687('0x77')]()+_0x1da4d1['slice'](0x1);var _0xb20c08={'type':_0x35069a[_0xb687('0x78')][_0xb687('0x79')][_0xb687('0x7a')],'raw':!![]};return new Promise(function(_0x819b63,_0x49b403){var _0x4e163c=squel[_0xb687('0x7b')]()['field']('ui.'+_0x3cd364+'InteractionId','id')['field'](_0xb687('0x7c'))[_0xb687('0x7d')](_0xb687('0x7e')+_0x1da4d1+_0xb687('0x7f'),'ui')[_0xb687('0x80')](_0xb687('0x81'),_0x318be6['id']);return _0x35069a[_0xb687('0x82')][_0xb687('0x83')](_0x4e163c[_0xb687('0x84')](),_0xb20c08)[_0xb687('0x7')](function(_0x132e3a){_0x318be6[_0x3cd364+'OpenTabs']=_0x132e3a;_0x819b63(_0x132e3a);})['catch'](function(_0x2714c6){_0x49b403(_0x2714c6);});});}return _0x5e5f06['define'](_0xb687('0x85'),attributes,{'tableName':_0xb687('0x86'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x1c031f){var _0x3ebaa2={'raw':![],'where':{}};var _0x3475cc={};var _0x4b5f75={'count':0x0,'rows':[]};var _0x22da49=_0x1c031f['query'][_0xb687('0x87')];var _0x293281=_0x1c031f[_0xb687('0x83')][_0xb687('0x88')]||![];var _0x3fe455=_0xa95e91(_0x22da49,_0x293281);if(!_0x3fe455[_0xb687('0x15')])throw new Error(_0xb687('0x89')+_0x22da49+'\x27');var _0x5deb7a=[{'name':_0x22da49}];if(!_[_0xb687('0x8a')](_0x3fe455[_0xb687('0x19')]))_0x5deb7a=_0x3fe455[_0xb687('0x19')];var _0x36bb4b=[];for(var _0x258caf=0x0;_0x258caf<_0x5deb7a['length'];_0x258caf++){_0x36bb4b[_0xb687('0x8b')](_0x35069a[_0xb687('0x8c')][_0xb687('0x8d')]({'where':{'userProfileId':_0x1c031f[_0xb687('0x8e')]['id'],'name':_0x5deb7a[_0x258caf][_0xb687('0xc')]},'raw':!![]}));}return Promise[_0xb687('0x8f')](_0x36bb4b)[_0xb687('0x7')](function(_0x377456){var _0x177ea4=_[_0xb687('0x5')](_0x377456,function(_0x1c167c){return _0x1c167c?_0x1c167c:undefined;});var _0x48838a=_[_0xb687('0x5')](_0x5deb7a,[_0xb687('0x90'),!![]]);var _0x1915da=_[_0xb687('0x8a')](_0x177ea4)&&_['isEmpty'](_0x48838a)?null:_[_0xb687('0x91')](_0x48838a,_0x177ea4);if(!_0x1915da)return null;var _0x1a6075=[];for(var _0x53b00a=0x0;_0x53b00a<_0x1915da[_0xb687('0x92')];_0x53b00a++){var _0x1acfed=_[_0xb687('0x8d')](_0x5deb7a,function(_0x5eeb75){return _0x1915da[_0x53b00a]?_0x5eeb75[_0xb687('0xc')]===_0x1915da[_0x53b00a][_0xb687('0xc')]:null;});if(_0x1acfed){if(_0x1915da[_0x53b00a]['ignore']){_0x1a6075[_0xb687('0x8b')](_0x36c468(_0x3fe455[_0xb687('0x15')],_0x1915da[_0x53b00a]));}else{if(!_0x1915da[_0x53b00a][_0xb687('0x93')]){_0x1a6075[_0xb687('0x8b')](_0x263085(_0x1acfed,_0x1915da[_0x53b00a],_0x3fe455['childModel']));}else{if(_0x1acfed[_0xb687('0xb')]){_0x1a6075[_0xb687('0x8b')](_0x3e6271(_0x1acfed,_0x1915da[_0x53b00a]));}}}}}return Promise['all'](_0x1a6075);})[_0xb687('0x7')](function(_0x1736ef){var _0x52285e=_0x1736ef;var _0x533837=null;if(_0x52285e){_0x533837=_0x52285e[_0xb687('0x92')]===0x1?_0x52285e[0x0]:null;}if(!_0x533837&&!_0x52285e)return _0x4b5f75;var _0x5370bc=_0x35069a[_0x3fe455[_0xb687('0x15')]][_0xb687('0x94')];_0x3475cc[_0xb687('0xb')]=_[_0xb687('0x95')](_0x5370bc);_0x3475cc[_0xb687('0x83')]=_[_0xb687('0x95')](_0x1c031f[_0xb687('0x83')]);_0x3475cc[_0xb687('0x96')]=_['intersection'](_0x3475cc[_0xb687('0xb')],_0x3475cc[_0xb687('0x83')]);_0x3ebaa2[_0xb687('0x97')]=_[_0xb687('0x98')](_0x3475cc[_0xb687('0xb')],qs[_0xb687('0x99')](_0x1c031f['query'][_0xb687('0x99')]));_0x3ebaa2[_0xb687('0x97')]=_0x3ebaa2['attributes'][_0xb687('0x92')]?_0x3ebaa2[_0xb687('0x97')]:_0x3475cc[_0xb687('0xb')];if(!_0x1c031f[_0xb687('0x83')]['hasOwnProperty'](_0xb687('0x9a'))){_0x3ebaa2['limit']=qs['limit'](_0x1c031f[_0xb687('0x83')]['limit']);_0x3ebaa2['offset']=qs[_0xb687('0x9b')](_0x1c031f['query'][_0xb687('0x9b')]);}_0x3ebaa2[_0xb687('0x9c')]=qs['sort'](_0x1c031f[_0xb687('0x83')][_0xb687('0x9d')]);_0x3ebaa2['where']=qs[_0xb687('0x96')](_[_0xb687('0x9e')](_0x1c031f[_0xb687('0x83')],_0x3475cc[_0xb687('0x96')]));if(_0x1c031f[_0xb687('0x83')][_0xb687('0x5')]){_0x3ebaa2[_0xb687('0x80')]=_[_0xb687('0x9f')](_0x3ebaa2[_0xb687('0x80')],{'$or':_[_0xb687('0x9')](_0x5370bc,function(_0x3a7a4a){if(_0x3a7a4a['type'][_0xb687('0xa0')]!=='VIRTUAL'){var _0x5a00c7={};_0x5a00c7[_0x3a7a4a[_0xb687('0xe')]]={'$like':'%'+_0x1c031f[_0xb687('0x83')][_0xb687('0x5')]+'%'};return _0x5a00c7;}})});}var _0xfecb8d=[];var _0x3a7339=null;var _0x594254={};if(_0x533837){_0x3a7339=_['find'](_0x5deb7a,[_0xb687('0xc'),_0x533837[_0xb687('0xc')]]);if(_0x3a7339[_0xb687('0xe')]){_0x594254={};if(_0x3fe455[_0xb687('0x15')]==='AnalyticExtractedReport'){_0x594254[_0x3a7339[_0xb687('0xa1')]]=_[_0xb687('0x9')](_0x533837[_0xb687('0x8')],'id');}else{_0x594254[_0x3a7339[_0xb687('0xa1')]]=_0x533837[_0xb687('0x8')];}_0xfecb8d[_0xb687('0x8b')](_0x594254);}else{_0x3ebaa2[_0xb687('0x80')]['id']=_0x533837[_0xb687('0x8')];}}else{for(var _0xfc0eee=0x0;_0xfc0eee<_0x52285e['length'];_0xfc0eee++){_0x3a7339=_[_0xb687('0x8d')](_0x5deb7a,[_0xb687('0xc'),_0x52285e[_0xfc0eee][_0xb687('0xc')]]);if(_0x3a7339[_0xb687('0xe')]){_0x594254={};_0x594254[_0x3a7339[_0xb687('0xa1')]]=_0x52285e[_0xfc0eee]['associatedResources'];_0xfecb8d[_0xb687('0x8b')](_0x594254);}else{if(!_0x3ebaa2[_0xb687('0x80')]['id'])_0x3ebaa2['where']['id']=[];_0x52285e[_0xfc0eee][_0xb687('0x8')]['forEach'](function(_0x32760c){_0x3ebaa2[_0xb687('0x80')]['id']['push'](_0x32760c);});}}}if(!_[_0xb687('0x8a')](_0xfecb8d)){_0x3ebaa2[_0xb687('0x80')]=_['merge'](_0x3ebaa2[_0xb687('0x80')],{'$and':{'$or':_0xfecb8d}});}_0x3ebaa2=_[_0xb687('0x9f')]({},_0x3ebaa2,_0x1c031f[_0xb687('0xa2')]);if(_0x533837&&!_0x533837[_0xb687('0x93')]&&_0x3fe455[_0xb687('0x15')]===_0xb687('0xf')){if(_0x1c031f['query'][_0xb687('0xa3')]){_0x3ebaa2[_0xb687('0xa4')]=[{'all':!![]}];}return _0x35069a[_0x3fe455[_0xb687('0x15')]][_0xb687('0xa5')](_0x3ebaa2)[_0xb687('0x7')](function(_0x465b81){var _0x233230=[];_0x465b81[_0xb687('0xa6')](function(_0x801bf9){var _0x361222;switch(_0x801bf9[_0xb687('0xa7')]){case'default':_0x361222=_[_0xb687('0x8d')](_0x533837['associatedResources'],function(_0x3d98e2){return _0x3d98e2['id']===_0x801bf9[_0xb687('0xa8')]&&_0x3d98e2['type']==='DefaultReports';});break;case _0xb687('0xa9'):_0x361222=_[_0xb687('0x8d')](_0x533837[_0xb687('0x8')],function(_0x33c3f4){return _0x33c3f4['id']===_0x801bf9[_0xb687('0xa8')]&&_0x33c3f4[_0xb687('0x3d')]===_0xb687('0xaa');});break;}if(_0x361222)_0x233230[_0xb687('0x8b')](_0x801bf9);});_0x4b5f75[_0xb687('0xab')]=_0x233230[_0xb687('0x92')];_0x4b5f75[_0xb687('0xac')]=_0x233230;return _0x4b5f75;});}else{return _0x35069a[_0x3fe455[_0xb687('0x15')]][_0xb687('0xab')]({'where':_0x3ebaa2[_0xb687('0x80')]})[_0xb687('0x7')](function(_0x3f45b7){_0x4b5f75['count']=_0x3f45b7;if(_0x1c031f['query'][_0xb687('0xa3')]){if(_0x3fe455['childModel']==='CmContact'){_0x3ebaa2[_0xb687('0xa4')]=[{'model':_0x35069a[_0xb687('0x6c')],'as':'Tags','attributes':['id',_0xb687('0xc'),_0xb687('0xad')],'required':_0x1c031f['query'][_0xb687('0xae')]?!![]:![]},{'model':_0x35069a[_0xb687('0x6c')],'as':_0xb687('0xaf'),'attributes':['id',_0xb687('0xc'),_0xb687('0xad')],'through':_0x1c031f[_0xb687('0x83')][_0xb687('0xae')]?{'attributes':[],'where':{'TagId':_0x1c031f[_0xb687('0x83')][_0xb687('0xae')]||undefined}}:{},'required':_0x1c031f['query'][_0xb687('0xae')]?!![]:![]}];}else{_0x3ebaa2[_0xb687('0xa4')]=[{'all':!![]}];}}return _0x35069a[_0x3fe455['childModel']][_0xb687('0xa5')](_0x3ebaa2);})['then'](function(_0x37af7e){_0x4b5f75[_0xb687('0xac')]=_0x37af7e;if(_0x22da49==='Agents'&&_0x1c031f[_0xb687('0x83')][_0xb687('0xb0')]===_0xb687('0xb1')){var _0x45d0ab=[];for(var _0x446b2b=0x0;_0x446b2b<_0x4b5f75[_0xb687('0xac')][_0xb687('0x92')];_0x446b2b++){_0x45d0ab['push'](_0x5ea8fd('chat',_0x4b5f75[_0xb687('0xac')][_0x446b2b]['dataValues']));_0x45d0ab[_0xb687('0x8b')](_0x5ea8fd(_0xb687('0xb2'),_0x4b5f75[_0xb687('0xac')][_0x446b2b][_0xb687('0xb3')]));_0x45d0ab['push'](_0x5ea8fd(_0xb687('0xb4'),_0x4b5f75[_0xb687('0xac')][_0x446b2b]['dataValues']));_0x45d0ab[_0xb687('0x8b')](_0x5ea8fd(_0xb687('0xb5'),_0x4b5f75[_0xb687('0xac')][_0x446b2b][_0xb687('0xb3')]));_0x45d0ab[_0xb687('0x8b')](_0x5ea8fd(_0xb687('0xb6'),_0x4b5f75['rows'][_0x446b2b][_0xb687('0xb3')]));_0x45d0ab[_0xb687('0x8b')](_0x5ea8fd(_0xb687('0xb7'),_0x4b5f75[_0xb687('0xac')][_0x446b2b][_0xb687('0xb3')]));}return Promise[_0xb687('0x8f')](_0x45d0ab)[_0xb687('0x7')](function(){return _0x4b5f75;});}return _0x4b5f75;});}});}}});}; \ No newline at end of file +var _0x3a6d=['queue','VoiceQueue','inbound','type','musiconholds','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','MailAccount','mailsubstatuses','MailSubstatus','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','QueueCampaigns','users','agents','User','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','customdashboards','Dashboard','scheduler','Schedule','sounds','Sound','tags','Tag','templates','triggers','Trigger','trunks','variables','Variable','plugins','extractedreports','Reports','reportId','AnalyticMetric','toUpperCase','slice','QueryTypes','select','InteractionId','ui.createdAt','from','user_has_','_interactions','where','sequelize','query','toString','OpenTabs','define','UserProfile','section','isEmpty','push','UserProfileSection','find','all','ignore','union','length','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','pick','key','VIRTUAL','foreignKey','forEach','merge','options','autoAssociation','includeAll','default','DefaultReports','custom','CustomReports','count','include','ThroughTags','color','tag','rows','true','chat','dataValues','sms','fax','openchannel','whatsapp','lodash','./userProfile.attributes','squel','exports','models','filter','field','value','findAll','then','associatedResources','map','catch','model','name','UserProfileResource','AnalyticExtractedReport','resourceId','squareprojects','SquareProject','odbc','childModel','squarerecordings','SquareRecording','parentSections','SquareProjects','projects','JscriptyProject','contacts','CmContact','ListId','lists','CmList','CmCompany','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','faxaccounts','FaxAccount','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','role','agent','Telephones','telephone','VoiceQueues'];(function(_0x3f4891,_0x4e6f62){var _0x54f2d8=function(_0x2b11ee){while(--_0x2b11ee){_0x3f4891['push'](_0x3f4891['shift']());}};_0x54f2d8(++_0x4e6f62);}(_0x3a6d,0x143));var _0xd3a6=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x3a6d[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xd3a6('0x0'));var attributes=require(_0xd3a6('0x1'));var qs=require('../../components/parsers/qs');var squel=require(_0xd3a6('0x2'));module[_0xd3a6('0x3')]=function(_0x31619a){var _0x37a8f2=_0x31619a[_0xd3a6('0x4')];function _0x585473(_0x1cb966,_0x27d641){return new Promise(function(_0x1e44bd,_0x1fc450){if(!_0x27d641)return _0x1e44bd(null);var _0x25b042=_0x27d641[_0xd3a6('0x5')]?{[_0x27d641['filter'][_0xd3a6('0x6')]]:_0x27d641[_0xd3a6('0x5')][_0xd3a6('0x7')]}:undefined;return _0x37a8f2[_0x1cb966][_0xd3a6('0x8')]({'where':_0x25b042,'raw':!![]})[_0xd3a6('0x9')](function(_0xa67661){_0x27d641[_0xd3a6('0xa')]=_[_0xd3a6('0xb')](_0xa67661,'id');_0x1e44bd(_0x27d641);})[_0xd3a6('0xc')](function(_0x5ab5a9){_0x1fc450(_0x5ab5a9);});});}function _0x172513(_0x1a00f7,_0x3f4d74){return new Promise(function(_0x225399,_0x2bd4f0){var _0x517a3b=_0x1a00f7['filter']?{[_0x1a00f7['filter'][_0xd3a6('0x6')]]:_0x1a00f7[_0xd3a6('0x5')][_0xd3a6('0x7')]}:undefined;return _0x37a8f2[_0x1a00f7[_0xd3a6('0xd')]][_0xd3a6('0x8')]({'where':_0x517a3b,'raw':!![]})[_0xd3a6('0x9')](function(_0xa56452){_0x3f4d74['associatedResources']=_[_0xd3a6('0xb')](_0xa56452,function(_0xf5ace5){return _0xf5ace5[_0xd3a6('0xe')];});_0x225399(_0x3f4d74);})['catch'](function(_0x3c2399){_0x2bd4f0(_0x3c2399);});});}function _0x305b61(_0x1781f6,_0x57d826,_0x3498d5){if(!_0x57d826)return Promise['resolve'](null);return new Promise(function(_0x518b6d,_0x28b63c){return _0x37a8f2[_0xd3a6('0xf')][_0xd3a6('0x8')]({'where':{'sectionId':_0x57d826['id']},'raw':!![]})[_0xd3a6('0x9')](function(_0x22fb05){if(_0x1781f6[_0xd3a6('0x6')]&&_0x1781f6[_0xd3a6('0x6')]!=='id'){_0x57d826['associatedResources']=_[_0xd3a6('0xb')](_0x22fb05,function(_0x4e78ec){return _0x4e78ec[_0x1781f6[_0xd3a6('0x6')]];});}else{if(_0x3498d5===_0xd3a6('0x10')){_0x57d826[_0xd3a6('0xa')]=_[_0xd3a6('0xb')](_0x22fb05,function(_0x465d25){return{'id':_0x465d25[_0xd3a6('0x11')],'type':_0x465d25['type']};});}else{_0x57d826[_0xd3a6('0xa')]=_[_0xd3a6('0xb')](_0x22fb05,function(_0x57cf15){return _0x57cf15['resourceId'];});}}_0x518b6d(_0x57d826);})['catch'](function(_0x573870){_0x28b63c(_0x573870);});});}function _0x5c9075(_0x98a12a,_0x400982){var _0x3d0b28={'parentSections':[]};switch(_0x98a12a['toLowerCase']()){case _0xd3a6('0x12'):_0x3d0b28['childModel']=_0xd3a6('0x13');break;case _0xd3a6('0x14'):_0x3d0b28[_0xd3a6('0x15')]='SquareOdbc';break;case _0xd3a6('0x16'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x17');_0x3d0b28[_0xd3a6('0x18')]=[{'name':_0xd3a6('0x19'),'field':_0xd3a6('0xe'),'foreignKey':'projectName'}];break;case _0xd3a6('0x1a'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x1b');break;case _0xd3a6('0x1c'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x1d');_0x3d0b28['parentSections']=[{'name':'Lists','field':'id','foreignKey':_0xd3a6('0x1e')}];break;case _0xd3a6('0x1f'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x20');break;case'companies':_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x21');break;case'globalcustomfields':_0x3d0b28[_0xd3a6('0x15')]='CmCustomField';break;case _0xd3a6('0x22'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x23');break;case _0xd3a6('0x24'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x25');break;case _0xd3a6('0x26'):_0x3d0b28['childModel']='FaxQueue';break;case _0xd3a6('0x27'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x28');break;case'inboundroutes':case _0xd3a6('0x29'):case _0xd3a6('0x2a'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x2b');break;case _0xd3a6('0x2c'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x2d');break;case _0xd3a6('0x2e'):_0x3d0b28['childModel']=_0xd3a6('0x2f');break;case _0xd3a6('0x30'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x31');_0x3d0b28[_0xd3a6('0x18')]=[{'name':_0xd3a6('0x32'),'field':'name','foreignKey':_0xd3a6('0x33'),'model':'User','filter':{'field':_0xd3a6('0x34'),'value':[_0xd3a6('0x35')]}},{'name':_0xd3a6('0x36'),'field':_0xd3a6('0xe'),'foreignKey':'membername','model':'User','filter':{'field':_0xd3a6('0x34'),'value':[_0xd3a6('0x37')]}},{'name':_0xd3a6('0x38'),'field':'name','foreignKey':_0xd3a6('0x39'),'model':_0xd3a6('0x3a'),'filter':{'field':'type','value':[_0xd3a6('0x3b')]}},{'name':'QueueCampaigns','field':_0xd3a6('0xe'),'foreignKey':_0xd3a6('0x39'),'model':'VoiceQueue','filter':{'field':_0xd3a6('0x3c'),'value':['outbound']}}];break;case _0xd3a6('0x3d'):_0x3d0b28[_0xd3a6('0x15')]='VoiceMusicOnHold';break;case _0xd3a6('0x3e'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x3f');break;case _0xd3a6('0x40'):_0x3d0b28['childModel']=_0xd3a6('0x41');break;case _0xd3a6('0x42'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x43');break;case _0xd3a6('0x44'):_0x3d0b28['childModel']=_0xd3a6('0x45');break;case'mailaccounts':_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x46');break;case _0xd3a6('0x47'):_0x3d0b28['childModel']=_0xd3a6('0x48');break;case'openchannelqueues':_0x3d0b28[_0xd3a6('0x15')]='OpenchannelQueue';break;case _0xd3a6('0x49'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x4a');break;case _0xd3a6('0x4b'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x4c');break;case _0xd3a6('0x4d'):_0x3d0b28['childModel']=_0xd3a6('0x4e');break;case _0xd3a6('0x4f'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x50');break;case'whatsappaccounts':_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x51');break;case _0xd3a6('0x52'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x53');break;case _0xd3a6('0x54'):case _0xd3a6('0x55'):_0x3d0b28[_0xd3a6('0x15')]='VoiceQueue';if(_0x400982){_0x3d0b28[_0xd3a6('0x18')]=[{'name':_0xd3a6('0x38')},{'name':_0xd3a6('0x56')}];}break;case _0xd3a6('0x57'):case _0xd3a6('0x58'):case'telephones':_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x59');if(_0x400982){_0x3d0b28[_0xd3a6('0x18')]=[{'name':_0xd3a6('0x5a'),'filter':{'field':_0xd3a6('0x34'),'value':[_0xd3a6('0x5b'),_0xd3a6('0x5c')]},'ignore':!![]},{'name':_0xd3a6('0x32')},{'name':'Telephones'}];}break;case _0xd3a6('0x5d'):_0x3d0b28['childModel']=_0xd3a6('0x5e');break;case _0xd3a6('0x5f'):_0x3d0b28['childModel']=_0xd3a6('0x60');break;case _0xd3a6('0x61'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x62');break;case _0xd3a6('0x63'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x64');break;case _0xd3a6('0x65'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x66');break;case'zohoaccounts':_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x67');break;case _0xd3a6('0x68'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x59');break;case _0xd3a6('0x69'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x6a');break;case _0xd3a6('0x6b'):_0x3d0b28[_0xd3a6('0x15')]='Disposition';break;case _0xd3a6('0x6c'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x6d');break;case'intervals':_0x3d0b28[_0xd3a6('0x15')]='Interval';break;case'pauses':_0x3d0b28['childModel']='Pause';break;case _0xd3a6('0x6e'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x6f');break;case _0xd3a6('0x70'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x71');break;case _0xd3a6('0x72'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x73');break;case _0xd3a6('0x74'):_0x3d0b28['childModel']='Template';break;case _0xd3a6('0x75'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x76');break;case _0xd3a6('0x77'):_0x3d0b28[_0xd3a6('0x15')]='Trunk';break;case _0xd3a6('0x78'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x79');break;case _0xd3a6('0x7a'):_0x3d0b28['childModel']='Plugin';break;case _0xd3a6('0x7b'):_0x3d0b28[_0xd3a6('0x15')]='AnalyticExtractedReport';_0x3d0b28[_0xd3a6('0x18')]=[{'name':_0xd3a6('0x7c'),'field':'id','foreignKey':_0xd3a6('0x7d')}];break;case'metrics':_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x7e');break;}return _0x3d0b28;}function _0x5dc8fd(_0x10b56f,_0x3c4fa9){var _0x5134fa=_0x10b56f['charAt'](0x0)[_0xd3a6('0x7f')]()+_0x10b56f[_0xd3a6('0x80')](0x1);var _0x4e02fb={'type':_0x37a8f2['Sequelize'][_0xd3a6('0x81')]['SELECT'],'raw':!![]};return new Promise(function(_0x3354cf,_0x3b5f26){var _0x5b1fc9=squel[_0xd3a6('0x82')]()['field']('ui.'+_0x5134fa+_0xd3a6('0x83'),'id')['field'](_0xd3a6('0x84'))[_0xd3a6('0x85')](_0xd3a6('0x86')+_0x10b56f+_0xd3a6('0x87'),'ui')[_0xd3a6('0x88')]('ui.UserId\x20=\x20?',_0x3c4fa9['id']);return _0x37a8f2[_0xd3a6('0x89')][_0xd3a6('0x8a')](_0x5b1fc9[_0xd3a6('0x8b')](),_0x4e02fb)[_0xd3a6('0x9')](function(_0x52a65e){_0x3c4fa9[_0x5134fa+_0xd3a6('0x8c')]=_0x52a65e;_0x3354cf(_0x52a65e);})[_0xd3a6('0xc')](function(_0x911ff0){_0x3b5f26(_0x911ff0);});});}return _0x31619a[_0xd3a6('0x8d')](_0xd3a6('0x8e'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x49cc6e){var _0x24115a={'raw':![],'where':{}};var _0x49bec2={};var _0xd2f49={'count':0x0,'rows':[]};var _0x2a1d67=_0x49cc6e[_0xd3a6('0x8a')][_0xd3a6('0x8f')];var _0x3c6b26=_0x49cc6e['query']['mergeResources']||![];var _0x20e881=_0x5c9075(_0x2a1d67,_0x3c6b26);if(!_0x20e881['childModel'])throw new Error('Invalid\x20section\x20\x27'+_0x2a1d67+'\x27');var _0xf8b715=[{'name':_0x2a1d67}];if(!_[_0xd3a6('0x90')](_0x20e881[_0xd3a6('0x18')]))_0xf8b715=_0x20e881[_0xd3a6('0x18')];var _0x3818fd=[];for(var _0x3f79cd=0x0;_0x3f79cd<_0xf8b715['length'];_0x3f79cd++){_0x3818fd[_0xd3a6('0x91')](_0x37a8f2[_0xd3a6('0x92')][_0xd3a6('0x93')]({'where':{'userProfileId':_0x49cc6e['params']['id'],'name':_0xf8b715[_0x3f79cd][_0xd3a6('0xe')]},'raw':!![]}));}return Promise[_0xd3a6('0x94')](_0x3818fd)['then'](function(_0x224b20){var _0x5a7749=_[_0xd3a6('0x5')](_0x224b20,function(_0x2c3b55){return _0x2c3b55?_0x2c3b55:undefined;});var _0x26748e=_['filter'](_0xf8b715,[_0xd3a6('0x95'),!![]]);var _0x4c1204=_[_0xd3a6('0x90')](_0x5a7749)&&_[_0xd3a6('0x90')](_0x26748e)?null:_[_0xd3a6('0x96')](_0x26748e,_0x5a7749);if(!_0x4c1204)return null;var _0x5287f0=[];for(var _0x17cb54=0x0;_0x17cb54<_0x4c1204[_0xd3a6('0x97')];_0x17cb54++){var _0x532b07=_[_0xd3a6('0x93')](_0xf8b715,function(_0x25c2f8){return _0x4c1204[_0x17cb54]?_0x25c2f8[_0xd3a6('0xe')]===_0x4c1204[_0x17cb54][_0xd3a6('0xe')]:null;});if(_0x532b07){if(_0x4c1204[_0x17cb54][_0xd3a6('0x95')]){_0x5287f0[_0xd3a6('0x91')](_0x585473(_0x20e881['childModel'],_0x4c1204[_0x17cb54]));}else{if(!_0x4c1204[_0x17cb54]['autoAssociation']){_0x5287f0[_0xd3a6('0x91')](_0x305b61(_0x532b07,_0x4c1204[_0x17cb54],_0x20e881[_0xd3a6('0x15')]));}else{if(_0x532b07[_0xd3a6('0xd')]){_0x5287f0[_0xd3a6('0x91')](_0x172513(_0x532b07,_0x4c1204[_0x17cb54]));}}}}}return Promise['all'](_0x5287f0);})[_0xd3a6('0x9')](function(_0x2a1495){var _0x377f28=_0x2a1495;var _0x477feb=null;if(_0x377f28){_0x477feb=_0x377f28['length']===0x1?_0x377f28[0x0]:null;}if(!_0x477feb&&!_0x377f28)return _0xd2f49;var _0x30815f=_0x37a8f2[_0x20e881['childModel']][_0xd3a6('0x98')];_0x49bec2[_0xd3a6('0xd')]=_[_0xd3a6('0x99')](_0x30815f);_0x49bec2[_0xd3a6('0x8a')]=_[_0xd3a6('0x99')](_0x49cc6e[_0xd3a6('0x8a')]);_0x49bec2[_0xd3a6('0x9a')]=_[_0xd3a6('0x9b')](_0x49bec2[_0xd3a6('0xd')],_0x49bec2[_0xd3a6('0x8a')]);_0x24115a[_0xd3a6('0x9c')]=_[_0xd3a6('0x9b')](_0x49bec2['model'],qs[_0xd3a6('0x9d')](_0x49cc6e['query'][_0xd3a6('0x9d')]));_0x24115a[_0xd3a6('0x9c')]=_0x24115a[_0xd3a6('0x9c')]['length']?_0x24115a[_0xd3a6('0x9c')]:_0x49bec2[_0xd3a6('0xd')];if(!_0x49cc6e['query'][_0xd3a6('0x9e')](_0xd3a6('0x9f'))){_0x24115a[_0xd3a6('0xa0')]=qs[_0xd3a6('0xa0')](_0x49cc6e[_0xd3a6('0x8a')][_0xd3a6('0xa0')]);_0x24115a[_0xd3a6('0xa1')]=qs[_0xd3a6('0xa1')](_0x49cc6e['query'][_0xd3a6('0xa1')]);}_0x24115a[_0xd3a6('0xa2')]=qs[_0xd3a6('0xa3')](_0x49cc6e[_0xd3a6('0x8a')][_0xd3a6('0xa3')]);_0x24115a[_0xd3a6('0x88')]=qs[_0xd3a6('0x9a')](_[_0xd3a6('0xa4')](_0x49cc6e[_0xd3a6('0x8a')],_0x49bec2[_0xd3a6('0x9a')]));if(_0x49cc6e[_0xd3a6('0x8a')]['filter']){_0x24115a[_0xd3a6('0x88')]=_['merge'](_0x24115a[_0xd3a6('0x88')],{'$or':_[_0xd3a6('0xb')](_0x30815f,function(_0x5e9dda){if(_0x5e9dda[_0xd3a6('0x3c')][_0xd3a6('0xa5')]!==_0xd3a6('0xa6')){var _0x13beb2={};_0x13beb2[_0x5e9dda[_0xd3a6('0x6')]]={'$like':'%'+_0x49cc6e[_0xd3a6('0x8a')][_0xd3a6('0x5')]+'%'};return _0x13beb2;}})});}var _0x2bed51=[];var _0xa62210=null;var _0xf95987={};if(_0x477feb){_0xa62210=_[_0xd3a6('0x93')](_0xf8b715,['name',_0x477feb[_0xd3a6('0xe')]]);if(_0xa62210[_0xd3a6('0x6')]){_0xf95987={};if(_0x20e881[_0xd3a6('0x15')]===_0xd3a6('0x10')){_0xf95987[_0xa62210[_0xd3a6('0xa7')]]=_[_0xd3a6('0xb')](_0x477feb['associatedResources'],'id');}else{_0xf95987[_0xa62210[_0xd3a6('0xa7')]]=_0x477feb[_0xd3a6('0xa')];}_0x2bed51['push'](_0xf95987);}else{_0x24115a[_0xd3a6('0x88')]['id']=_0x477feb['associatedResources'];}}else{for(var _0x310a4f=0x0;_0x310a4f<_0x377f28[_0xd3a6('0x97')];_0x310a4f++){_0xa62210=_['find'](_0xf8b715,[_0xd3a6('0xe'),_0x377f28[_0x310a4f][_0xd3a6('0xe')]]);if(_0xa62210[_0xd3a6('0x6')]){_0xf95987={};_0xf95987[_0xa62210[_0xd3a6('0xa7')]]=_0x377f28[_0x310a4f]['associatedResources'];_0x2bed51['push'](_0xf95987);}else{if(!_0x24115a[_0xd3a6('0x88')]['id'])_0x24115a[_0xd3a6('0x88')]['id']=[];_0x377f28[_0x310a4f][_0xd3a6('0xa')][_0xd3a6('0xa8')](function(_0x154fb1){_0x24115a['where']['id'][_0xd3a6('0x91')](_0x154fb1);});}}}if(!_[_0xd3a6('0x90')](_0x2bed51)){_0x24115a[_0xd3a6('0x88')]=_[_0xd3a6('0xa9')](_0x24115a[_0xd3a6('0x88')],{'$and':{'$or':_0x2bed51}});}_0x24115a=_[_0xd3a6('0xa9')]({},_0x24115a,_0x49cc6e[_0xd3a6('0xaa')]);if(_0x477feb&&!_0x477feb[_0xd3a6('0xab')]&&_0x20e881[_0xd3a6('0x15')]===_0xd3a6('0x10')){if(_0x49cc6e[_0xd3a6('0x8a')][_0xd3a6('0xac')]){_0x24115a['include']=[{'all':!![]}];}return _0x37a8f2[_0x20e881['childModel']]['findAll'](_0x24115a)[_0xd3a6('0x9')](function(_0x18ba56){var _0x58bf33=[];_0x18ba56[_0xd3a6('0xa8')](function(_0x29126f){var _0x339f68;switch(_0x29126f['reportType']){case _0xd3a6('0xad'):_0x339f68=_[_0xd3a6('0x93')](_0x477feb[_0xd3a6('0xa')],function(_0x2b39cb){return _0x2b39cb['id']===_0x29126f['reportId']&&_0x2b39cb['type']===_0xd3a6('0xae');});break;case _0xd3a6('0xaf'):_0x339f68=_[_0xd3a6('0x93')](_0x477feb['associatedResources'],function(_0x4d95f5){return _0x4d95f5['id']===_0x29126f[_0xd3a6('0x7d')]&&_0x4d95f5[_0xd3a6('0x3c')]===_0xd3a6('0xb0');});break;}if(_0x339f68)_0x58bf33['push'](_0x29126f);});_0xd2f49[_0xd3a6('0xb1')]=_0x58bf33[_0xd3a6('0x97')];_0xd2f49['rows']=_0x58bf33;return _0xd2f49;});}else{return _0x37a8f2[_0x20e881[_0xd3a6('0x15')]]['count']({'where':_0x24115a[_0xd3a6('0x88')]})[_0xd3a6('0x9')](function(_0x3834ba){_0xd2f49[_0xd3a6('0xb1')]=_0x3834ba;if(_0x49cc6e['query']['includeAll']){if(_0x20e881[_0xd3a6('0x15')]===_0xd3a6('0x1d')){_0x24115a[_0xd3a6('0xb2')]=[{'model':_0x37a8f2['Tag'],'as':'Tags','attributes':['id',_0xd3a6('0xe'),'color'],'required':_0x49cc6e[_0xd3a6('0x8a')]['tag']?!![]:![]},{'model':_0x37a8f2[_0xd3a6('0x73')],'as':_0xd3a6('0xb3'),'attributes':['id',_0xd3a6('0xe'),_0xd3a6('0xb4')],'through':_0x49cc6e[_0xd3a6('0x8a')][_0xd3a6('0xb5')]?{'attributes':[],'where':{'TagId':_0x49cc6e[_0xd3a6('0x8a')][_0xd3a6('0xb5')]||undefined}}:{},'required':_0x49cc6e[_0xd3a6('0x8a')]['tag']?!![]:![]}];}else{_0x24115a['include']=[{'all':!![]}];}}return _0x37a8f2[_0x20e881['childModel']][_0xd3a6('0x8')](_0x24115a);})[_0xd3a6('0x9')](function(_0x31a6fb){_0xd2f49[_0xd3a6('0xb6')]=_0x31a6fb;if(_0x2a1d67===_0xd3a6('0x32')&&_0x49cc6e[_0xd3a6('0x8a')]['openTabs']===_0xd3a6('0xb7')){var _0x339674=[];for(var _0x4e643b=0x0;_0x4e643b<_0xd2f49[_0xd3a6('0xb6')][_0xd3a6('0x97')];_0x4e643b++){_0x339674[_0xd3a6('0x91')](_0x5dc8fd(_0xd3a6('0xb8'),_0xd2f49[_0xd3a6('0xb6')][_0x4e643b][_0xd3a6('0xb9')]));_0x339674[_0xd3a6('0x91')](_0x5dc8fd(_0xd3a6('0xba'),_0xd2f49[_0xd3a6('0xb6')][_0x4e643b][_0xd3a6('0xb9')]));_0x339674['push'](_0x5dc8fd(_0xd3a6('0xbb'),_0xd2f49['rows'][_0x4e643b][_0xd3a6('0xb9')]));_0x339674['push'](_0x5dc8fd('mail',_0xd2f49[_0xd3a6('0xb6')][_0x4e643b][_0xd3a6('0xb9')]));_0x339674['push'](_0x5dc8fd(_0xd3a6('0xbc'),_0xd2f49['rows'][_0x4e643b][_0xd3a6('0xb9')]));_0x339674[_0xd3a6('0x91')](_0x5dc8fd(_0xd3a6('0xbd'),_0xd2f49[_0xd3a6('0xb6')][_0x4e643b]['dataValues']));}return Promise[_0xd3a6('0x94')](_0x339674)[_0xd3a6('0x9')](function(){return _0xd2f49;});}return _0xd2f49;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index fc06454..f150373 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 _0x2015=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x2015,0x193));var _0x5201=function(_0x55381a,_0x317711){_0x55381a=_0x55381a-0x0;var _0x5f3754=_0x2015[_0x55381a];return _0x5f3754;};'use strict';var _=require(_0x5201('0x0'));var util=require(_0x5201('0x1'));var moment=require(_0x5201('0x2'));var BPromise=require(_0x5201('0x3'));var rs=require(_0x5201('0x4'));var fs=require('fs');var Redis=require(_0x5201('0x5'));var db=require(_0x5201('0x6'))['db'];var utils=require(_0x5201('0x7'));var logger=require('../../config/logger')(_0x5201('0x8'));var config=require(_0x5201('0x9'));var jayson=require(_0x5201('0xa'));var client=jayson[_0x5201('0xb')][_0x5201('0xc')]({'port':0x232a});config[_0x5201('0xd')]=_[_0x5201('0xe')](config[_0x5201('0xd')],{'host':_0x5201('0xf'),'port':0x18eb});var socket=require(_0x5201('0x10'))(new Redis(config['redis']));require(_0x5201('0x11'))[_0x5201('0x12')](socket);function respondWithRpcPromise(_0x48b93d,_0x26e0d1,_0x28cb95){return new BPromise(function(_0x86a0c8,_0x47aa66){return client[_0x5201('0x13')](_0x48b93d,_0x28cb95)[_0x5201('0x14')](function(_0x356a38){logger[_0x5201('0x15')](_0x5201('0x16'),_0x26e0d1,_0x5201('0x17'));logger[_0x5201('0x18')](_0x5201('0x19'),_0x26e0d1,_0x5201('0x17'),JSON[_0x5201('0x1a')](_0x356a38));if(_0x356a38[_0x5201('0x1b')]){if(_0x356a38[_0x5201('0x1b')]['code']===0x1f4){logger[_0x5201('0x1b')](_0x5201('0x16'),_0x26e0d1,_0x356a38['error']['message']);return _0x47aa66(_0x356a38[_0x5201('0x1b')][_0x5201('0x1c')]);}logger[_0x5201('0x1b')]('UserProfile,\x20%s,\x20%s',_0x26e0d1,_0x356a38['error'][_0x5201('0x1c')]);return _0x86a0c8(_0x356a38['error'][_0x5201('0x1c')]);}else{logger['info'](_0x5201('0x16'),_0x26e0d1,'request\x20sent');_0x86a0c8(_0x356a38[_0x5201('0x1d')][_0x5201('0x1c')]);}})[_0x5201('0x1e')](function(_0x23d13e){logger['error']('UserProfile,\x20%s,\x20%s',_0x26e0d1,_0x23d13e);_0x47aa66(_0x23d13e);});});} \ No newline at end of file +var _0xe626=['debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','localhost','socket.io-emitter','register','then','info','UserProfile,\x20%s,\x20%s','request\x20sent'];(function(_0x3df327,_0xeae0dd){var _0x25db3f=function(_0x31b55a){while(--_0x31b55a){_0x3df327['push'](_0x3df327['shift']());}};_0x25db3f(++_0xeae0dd);}(_0xe626,0x9d));var _0x6e62=function(_0x24b118,_0x193275){_0x24b118=_0x24b118-0x0;var _0x24e285=_0xe626[_0x24b118];return _0x24e285;};'use strict';var _=require(_0x6e62('0x0'));var util=require(_0x6e62('0x1'));var moment=require(_0x6e62('0x2'));var BPromise=require(_0x6e62('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6e62('0x4'));var db=require(_0x6e62('0x5'))['db'];var utils=require(_0x6e62('0x6'));var logger=require(_0x6e62('0x7'))(_0x6e62('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x6e62('0x9')]({'port':0x232a});config[_0x6e62('0xa')]=_['defaults'](config[_0x6e62('0xa')],{'host':_0x6e62('0xb'),'port':0x18eb});var socket=require(_0x6e62('0xc'))(new Redis(config[_0x6e62('0xa')]));require('./userProfile.socket')[_0x6e62('0xd')](socket);function respondWithRpcPromise(_0x3d677f,_0x4e25d3,_0x2fbfd0){return new BPromise(function(_0x4c3b6b,_0x1f2693){return client['request'](_0x3d677f,_0x2fbfd0)[_0x6e62('0xe')](function(_0x4fc5a8){logger[_0x6e62('0xf')](_0x6e62('0x10'),_0x4e25d3,_0x6e62('0x11'));logger[_0x6e62('0x12')](_0x6e62('0x13'),_0x4e25d3,_0x6e62('0x11'),JSON[_0x6e62('0x14')](_0x4fc5a8));if(_0x4fc5a8['error']){if(_0x4fc5a8['error'][_0x6e62('0x15')]===0x1f4){logger[_0x6e62('0x16')]('UserProfile,\x20%s,\x20%s',_0x4e25d3,_0x4fc5a8[_0x6e62('0x16')][_0x6e62('0x17')]);return _0x1f2693(_0x4fc5a8[_0x6e62('0x16')][_0x6e62('0x17')]);}logger['error'](_0x6e62('0x10'),_0x4e25d3,_0x4fc5a8[_0x6e62('0x16')][_0x6e62('0x17')]);return _0x4c3b6b(_0x4fc5a8[_0x6e62('0x16')][_0x6e62('0x17')]);}else{logger[_0x6e62('0xf')](_0x6e62('0x10'),_0x4e25d3,_0x6e62('0x11'));_0x4c3b6b(_0x4fc5a8[_0x6e62('0x18')][_0x6e62('0x17')]);}})['catch'](function(_0x1f5ee7){logger[_0x6e62('0x16')]('UserProfile,\x20%s,\x20%s',_0x4e25d3,_0x1f5ee7);_0x1f2693(_0x1f5ee7);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 3878faa..9c707d8 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 _0x76d4=['emit','length','userProfile:','./userProfile.events','save'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x76d4,0x1a2));var _0x476d=function(_0xd80de1,_0x518a43){_0xd80de1=_0xd80de1-0x0;var _0x3c47a2=_0x76d4[_0xd80de1];return _0x3c47a2;};'use strict';var UserProfileEvents=require(_0x476d('0x0'));var events=[_0x476d('0x1'),'remove','update'];function createListener(_0x1c202c,_0x44e9b7){return function(_0x1fd15d){_0x44e9b7[_0x476d('0x2')](_0x1c202c,_0x1fd15d);};}function removeListener(_0x2bb62a,_0x9f909d){return function(){UserProfileEvents['removeListener'](_0x2bb62a,_0x9f909d);};}exports['register']=function(_0x44fc42){for(var _0xc7aa00=0x0,_0x327461=events[_0x476d('0x3')];_0xc7aa00<_0x327461;_0xc7aa00++){var _0x1ab385=events[_0xc7aa00];var _0x503a06=createListener(_0x476d('0x4')+_0x1ab385,_0x44fc42);UserProfileEvents['on'](_0x1ab385,_0x503a06);}}; \ No newline at end of file +var _0xbb3a=['register','./userProfile.events','save','remove','update','emit','removeListener'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbb3a,0x166));var _0xabb3=function(_0xb5272c,_0x4016d6){_0xb5272c=_0xb5272c-0x0;var _0x434e80=_0xbb3a[_0xb5272c];return _0x434e80;};'use strict';var UserProfileEvents=require(_0xabb3('0x0'));var events=[_0xabb3('0x1'),_0xabb3('0x2'),_0xabb3('0x3')];function createListener(_0x43e16f,_0x541721){return function(_0x19a4de){_0x541721[_0xabb3('0x4')](_0x43e16f,_0x19a4de);};}function removeListener(_0x57c61a,_0x4b8c88){return function(){UserProfileEvents[_0xabb3('0x5')](_0x57c61a,_0x4b8c88);};}exports[_0xabb3('0x6')]=function(_0x8c3649){for(var _0x526939=0x0,_0x357b80=events['length'];_0x526939<_0x357b80;_0x526939++){var _0x3a4cc2=events[_0x526939];var _0x18444c=createListener('userProfile:'+_0x3a4cc2,_0x8c3649);UserProfileEvents['on'](_0x3a4cc2,_0x18444c);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 0aabc2b..0b5825d 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 _0x5a3e=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./userProfileResource.controller','get','isAuthenticated','/describe','/:id','show','post','create','put'];(function(_0x3f899a,_0x496627){var _0x3978a6=function(_0x3ad6c6){while(--_0x3ad6c6){_0x3f899a['push'](_0x3f899a['shift']());}};_0x3978a6(++_0x496627);}(_0x5a3e,0x11b));var _0xe5a3=function(_0x3f537f,_0x22321a){_0x3f537f=_0x3f537f-0x0;var _0x513189=_0x5a3e[_0x3f537f];return _0x513189;};'use strict';var multer=require(_0xe5a3('0x0'));var util=require(_0xe5a3('0x1'));var path=require(_0xe5a3('0x2'));var timeout=require(_0xe5a3('0x3'));var express=require(_0xe5a3('0x4'));var router=express[_0xe5a3('0x5')]();var fs_extra=require(_0xe5a3('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xe5a3('0x7'));var config=require('../../config/environment');var controller=require(_0xe5a3('0x8'));router[_0xe5a3('0x9')]('/',auth[_0xe5a3('0xa')](),controller['index']);router[_0xe5a3('0x9')](_0xe5a3('0xb'),auth[_0xe5a3('0xa')](),controller['describe']);router[_0xe5a3('0x9')](_0xe5a3('0xc'),auth['isAuthenticated'](),controller[_0xe5a3('0xd')]);router[_0xe5a3('0xe')]('/',auth[_0xe5a3('0xa')](),controller[_0xe5a3('0xf')]);router[_0xe5a3('0x10')](_0xe5a3('0xc'),auth[_0xe5a3('0xa')](),controller['update']);router[_0xe5a3('0x11')](_0xe5a3('0xc'),auth[_0xe5a3('0xa')](),controller[_0xe5a3('0x12')]);module[_0xe5a3('0x13')]=router; \ No newline at end of file +var _0x8293=['fs-extra','../../components/interaction/service','../../config/environment','./userProfileResource.controller','isAuthenticated','get','/describe','describe','show','post','create','put','/:id','update','delete','multer','util','path','connect-timeout','express','Router'];(function(_0x186bb2,_0x40e1a0){var _0x5ef25d=function(_0x33bd5f){while(--_0x33bd5f){_0x186bb2['push'](_0x186bb2['shift']());}};_0x5ef25d(++_0x40e1a0);}(_0x8293,0xe1));var _0x3829=function(_0x5caf56,_0x3a2515){_0x5caf56=_0x5caf56-0x0;var _0x21a472=_0x8293[_0x5caf56];return _0x21a472;};'use strict';var multer=require(_0x3829('0x0'));var util=require(_0x3829('0x1'));var path=require(_0x3829('0x2'));var timeout=require(_0x3829('0x3'));var express=require(_0x3829('0x4'));var router=express[_0x3829('0x5')]();var fs_extra=require(_0x3829('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3829('0x7'));var config=require(_0x3829('0x8'));var controller=require(_0x3829('0x9'));router['get']('/',auth[_0x3829('0xa')](),controller['index']);router[_0x3829('0xb')](_0x3829('0xc'),auth[_0x3829('0xa')](),controller[_0x3829('0xd')]);router['get']('/:id',auth[_0x3829('0xa')](),controller[_0x3829('0xe')]);router[_0x3829('0xf')]('/',auth[_0x3829('0xa')](),controller[_0x3829('0x10')]);router[_0x3829('0x11')](_0x3829('0x12'),auth['isAuthenticated'](),controller[_0x3829('0x13')]);router[_0x3829('0x14')](_0x3829('0x12'),auth[_0x3829('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 16542b0..36fc6a5 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 _0x8bba=['STRING','INTEGER','sequelize'];(function(_0x3bfbfc,_0x239629){var _0x4986ce=function(_0x3bf2b5){while(--_0x3bf2b5){_0x3bfbfc['push'](_0x3bfbfc['shift']());}};_0x4986ce(++_0x239629);}(_0x8bba,0x10d));var _0xa8bb=function(_0x10f6e8,_0x351db6){_0x10f6e8=_0x10f6e8-0x0;var _0x35bb3c=_0x8bba[_0x10f6e8];return _0x35bb3c;};'use strict';var Sequelize=require(_0xa8bb('0x0'));module['exports']={'name':{'type':Sequelize[_0xa8bb('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xa8bb('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xa8bb('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x4772=['INTEGER','sequelize','exports','STRING'];(function(_0xdd1797,_0x416285){var _0x7ebad5=function(_0x193c02){while(--_0x193c02){_0xdd1797['push'](_0xdd1797['shift']());}};_0x7ebad5(++_0x416285);}(_0x4772,0x165));var _0x2477=function(_0x2ebd82,_0x24fe88){_0x2ebd82=_0x2ebd82-0x0;var _0x570aa2=_0x4772[_0x2ebd82];return _0x570aa2;};'use strict';var Sequelize=require(_0x2477('0x0'));module[_0x2477('0x1')]={'name':{'type':Sequelize[_0x2477('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x2477('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x2477('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 4afe9e7..3293487 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 _0x2a07=['index','map','UserProfileResource','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','catch','show','params','fields','includeAll','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','error','name','send'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2a07,0x74));var _0x72a0=function(_0x4459b8,_0x3271b8){_0x4459b8=_0x4459b8-0x0;var _0x4a4b07=_0x2a07[_0x4459b8];return _0x4a4b07;};'use strict';var emlformat=require(_0x72a0('0x0'));var rimraf=require(_0x72a0('0x1'));var zipdir=require(_0x72a0('0x2'));var jsonpatch=require(_0x72a0('0x3'));var rp=require(_0x72a0('0x4'));var moment=require('moment');var BPromise=require(_0x72a0('0x5'));var Mustache=require(_0x72a0('0x6'));var util=require(_0x72a0('0x7'));var path=require(_0x72a0('0x8'));var sox=require(_0x72a0('0x9'));var csv=require(_0x72a0('0xa'));var ejs=require(_0x72a0('0xb'));var fs=require('fs');var fs_extra=require(_0x72a0('0xc'));var _=require(_0x72a0('0xd'));var squel=require(_0x72a0('0xe'));var crypto=require(_0x72a0('0xf'));var jsforce=require(_0x72a0('0x10'));var deskjs=require(_0x72a0('0x11'));var toCsv=require(_0x72a0('0xa'));var querystring=require(_0x72a0('0x12'));var Papa=require(_0x72a0('0x13'));var Redis=require('ioredis');var authService=require(_0x72a0('0x14'));var qs=require(_0x72a0('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x72a0('0x16'));var logger=require(_0x72a0('0x17'))(_0x72a0('0x18'));var utils=require(_0x72a0('0x19'));var config=require(_0x72a0('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x72a0('0x1b'))['db'];function respondWithStatusCode(_0x335b9f,_0x123ca4){_0x123ca4=_0x123ca4||0xcc;return function(_0xf91a82){if(_0xf91a82){return _0x335b9f[_0x72a0('0x1c')](_0x123ca4);}return _0x335b9f[_0x72a0('0x1d')](_0x123ca4)[_0x72a0('0x1e')]();};}function respondWithResult(_0x5e0b5f,_0x4930c5){_0x4930c5=_0x4930c5||0xc8;return function(_0xe103dc){if(_0xe103dc){return _0x5e0b5f[_0x72a0('0x1d')](_0x4930c5)[_0x72a0('0x1f')](_0xe103dc);}};}function respondWithFilteredResult(_0x1d1133,_0x23b001){return function(_0x3f3d62){if(_0x3f3d62){var _0x4ab55e=typeof _0x23b001[_0x72a0('0x20')]===_0x72a0('0x21')&&typeof _0x23b001[_0x72a0('0x22')]===_0x72a0('0x21');var _0x2d1e95=_0x3f3d62['count'];var _0x100d8f=_0x4ab55e?0x0:_0x23b001[_0x72a0('0x20')];var _0x131b73=_0x4ab55e?_0x3f3d62['count']:_0x23b001[_0x72a0('0x20')]+_0x23b001[_0x72a0('0x22')];var _0x30899b;if(_0x131b73>=_0x2d1e95){_0x131b73=_0x2d1e95;_0x30899b=0xc8;}else{_0x30899b=0xce;}_0x1d1133[_0x72a0('0x1d')](_0x30899b);return _0x1d1133['set'](_0x72a0('0x23'),_0x100d8f+'-'+_0x131b73+'/'+_0x2d1e95)['json'](_0x3f3d62);}return null;};}function patchUpdates(_0x3d0607){return function(_0x315413){try{jsonpatch[_0x72a0('0x24')](_0x315413,_0x3d0607,!![]);}catch(_0x5c7479){return BPromise[_0x72a0('0x25')](_0x5c7479);}return _0x315413[_0x72a0('0x26')]();};}function saveUpdates(_0x1d22d8,_0x3d1965){return function(_0x5d6145){if(_0x5d6145){return _0x5d6145[_0x72a0('0x27')](_0x1d22d8)[_0x72a0('0x28')](function(_0x1ddd54){return _0x1ddd54;});}return null;};}function removeEntity(_0x23b918,_0x3022b0){return function(_0x174b1b){if(_0x174b1b){return _0x174b1b['destroy']()['then'](function(){_0x23b918[_0x72a0('0x1d')](0xcc)[_0x72a0('0x1e')]();});}};}function handleEntityNotFound(_0x123df4,_0x1504ed){return function(_0xf5cb49){if(!_0xf5cb49){_0x123df4[_0x72a0('0x1c')](0x194);}return _0xf5cb49;};}function handleError(_0xa5bda0,_0x15922a){_0x15922a=_0x15922a||0x1f4;return function(_0xee99e2){logger[_0x72a0('0x29')](_0xee99e2['stack']);if(_0xee99e2[_0x72a0('0x2a')]){delete _0xee99e2[_0x72a0('0x2a')];}_0xa5bda0[_0x72a0('0x1d')](_0x15922a)[_0x72a0('0x2b')](_0xee99e2);};}exports[_0x72a0('0x2c')]=function(_0x177a3a,_0x432179){var _0x12eda2={},_0x23c96a={},_0x916733={'count':0x0,'rows':[]};var _0x4ba037=_[_0x72a0('0x2d')](db[_0x72a0('0x2e')][_0x72a0('0x2f')],function(_0xfbe9b3){return{'name':_0xfbe9b3[_0x72a0('0x30')],'type':_0xfbe9b3[_0x72a0('0x31')][_0x72a0('0x32')]};});_0x23c96a['model']=_[_0x72a0('0x2d')](_0x4ba037,_0x72a0('0x2a'));_0x23c96a[_0x72a0('0x33')]=_[_0x72a0('0x34')](_0x177a3a[_0x72a0('0x33')]);_0x23c96a[_0x72a0('0x35')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],_0x23c96a['query']);_0x12eda2[_0x72a0('0x38')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],qs['fields'](_0x177a3a[_0x72a0('0x33')]['fields']));_0x12eda2[_0x72a0('0x38')]=_0x12eda2[_0x72a0('0x38')][_0x72a0('0x39')]?_0x12eda2[_0x72a0('0x38')]:_0x23c96a[_0x72a0('0x37')];if(!_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3a')](_0x72a0('0x3b'))){_0x12eda2[_0x72a0('0x22')]=qs[_0x72a0('0x22')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x22')]);_0x12eda2['offset']=qs[_0x72a0('0x20')](_0x177a3a['query'][_0x72a0('0x20')]);}_0x12eda2[_0x72a0('0x3c')]=qs[_0x72a0('0x3d')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3d')]);_0x12eda2[_0x72a0('0x3e')]=qs[_0x72a0('0x35')](_[_0x72a0('0x3f')](_0x177a3a[_0x72a0('0x33')],_0x23c96a['filters']),_0x4ba037);if(_0x177a3a['query'][_0x72a0('0x40')]){_0x12eda2[_0x72a0('0x3e')]=_[_0x72a0('0x41')](_0x12eda2[_0x72a0('0x3e')],{'$or':_[_0x72a0('0x2d')](_0x4ba037,function(_0x512a06){if(_0x512a06[_0x72a0('0x31')]!==_0x72a0('0x42')){var _0x582c90={};_0x582c90[_0x512a06[_0x72a0('0x2a')]]={'$like':'%'+_0x177a3a['query']['filter']+'%'};return _0x582c90;}})});}_0x12eda2=_['merge']({},_0x12eda2,_0x177a3a[_0x72a0('0x43')]);var _0x49633b={'where':_0x12eda2[_0x72a0('0x3e')]};return db[_0x72a0('0x2e')][_0x72a0('0x44')](_0x49633b)[_0x72a0('0x28')](function(_0x4bf56e){_0x916733['count']=_0x4bf56e;if(_0x177a3a['query']['includeAll']){_0x12eda2[_0x72a0('0x45')]=[{'all':!![]}];}return db[_0x72a0('0x2e')]['findAll'](_0x12eda2);})[_0x72a0('0x28')](function(_0x35d790){_0x916733['rows']=_0x35d790;return _0x916733;})[_0x72a0('0x28')](respondWithFilteredResult(_0x432179,_0x12eda2))[_0x72a0('0x46')](handleError(_0x432179,null));};exports[_0x72a0('0x47')]=function(_0xe4abe1,_0x340153){var _0x341451={'raw':![],'where':{'id':_0xe4abe1[_0x72a0('0x48')]['id']}},_0x50eb7f={};_0x50eb7f['model']=_[_0x72a0('0x34')](db['UserProfileResource'][_0x72a0('0x2f')]);_0x50eb7f[_0x72a0('0x33')]=_['keys'](_0xe4abe1[_0x72a0('0x33')]);_0x50eb7f['filters']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],_0x50eb7f[_0x72a0('0x33')]);_0x341451['attributes']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],qs[_0x72a0('0x49')](_0xe4abe1['query']['fields']));_0x341451[_0x72a0('0x38')]=_0x341451['attributes'][_0x72a0('0x39')]?_0x341451[_0x72a0('0x38')]:_0x50eb7f[_0x72a0('0x37')];if(_0xe4abe1[_0x72a0('0x33')][_0x72a0('0x4a')]){_0x341451[_0x72a0('0x45')]=[{'all':!![]}];}_0x341451=_[_0x72a0('0x41')]({},_0x341451,_0xe4abe1[_0x72a0('0x43')]);return db[_0x72a0('0x2e')]['find'](_0x341451)[_0x72a0('0x28')](handleEntityNotFound(_0x340153,null))[_0x72a0('0x28')](respondWithResult(_0x340153,null))[_0x72a0('0x46')](handleError(_0x340153,null));};exports[_0x72a0('0x4b')]=function(_0x3a669d,_0x304400){return db[_0x72a0('0x2e')]['create'](_0x3a669d['body'],{})[_0x72a0('0x28')](respondWithResult(_0x304400,0xc9))[_0x72a0('0x46')](handleError(_0x304400,null));};exports[_0x72a0('0x27')]=function(_0x3cab6a,_0x35a6ad){if(_0x3cab6a[_0x72a0('0x4c')]['id']){delete _0x3cab6a[_0x72a0('0x4c')]['id'];}return db[_0x72a0('0x2e')][_0x72a0('0x4d')]({'where':{'id':_0x3cab6a[_0x72a0('0x48')]['id']}})['then'](handleEntityNotFound(_0x35a6ad,null))[_0x72a0('0x28')](saveUpdates(_0x3cab6a[_0x72a0('0x4c')],null))[_0x72a0('0x28')](respondWithResult(_0x35a6ad,null))[_0x72a0('0x46')](handleError(_0x35a6ad,null));};exports[_0x72a0('0x4e')]=function(_0x5c1570,_0x143410){return db['UserProfileResource']['find']({'where':{'id':_0x5c1570[_0x72a0('0x48')]['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x143410,null))[_0x72a0('0x28')](removeEntity(_0x143410,null))[_0x72a0('0x46')](handleError(_0x143410,null));};exports[_0x72a0('0x4f')]=function(_0x50c8d7,_0xc0f323){return db[_0x72a0('0x2e')]['describe']()['then'](respondWithResult(_0xc0f323,null))[_0x72a0('0x46')](handleError(_0xc0f323,null));}; \ No newline at end of file +var _0x781d=['sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','destroy','then','error','name','send','index','map','UserProfileResource','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','where','filters','filter','merge','VIRTUAL','includeAll','catch','show','params','rawAttributes','options','body','find','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x781d,0x14a));var _0xd781=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x781d[_0x618414];return _0x21c19a;};'use strict';var emlformat=require(_0xd781('0x0'));var rimraf=require(_0xd781('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd781('0x2'));var moment=require(_0xd781('0x3'));var BPromise=require(_0xd781('0x4'));var Mustache=require(_0xd781('0x5'));var util=require(_0xd781('0x6'));var path=require(_0xd781('0x7'));var sox=require(_0xd781('0x8'));var csv=require(_0xd781('0x9'));var ejs=require(_0xd781('0xa'));var fs=require('fs');var fs_extra=require(_0xd781('0xb'));var _=require('lodash');var squel=require(_0xd781('0xc'));var crypto=require(_0xd781('0xd'));var jsforce=require(_0xd781('0xe'));var deskjs=require(_0xd781('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd781('0x10'));var Papa=require('papaparse');var Redis=require(_0xd781('0x11'));var authService=require(_0xd781('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd781('0x13'));var hardwareService=require(_0xd781('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xd781('0x15'));var config=require(_0xd781('0x16'));var licenseUtil=require(_0xd781('0x17'));var db=require(_0xd781('0x18'))['db'];function respondWithStatusCode(_0xbea78b,_0x1f2f1e){_0x1f2f1e=_0x1f2f1e||0xcc;return function(_0xc7758f){if(_0xc7758f){return _0xbea78b[_0xd781('0x19')](_0x1f2f1e);}return _0xbea78b[_0xd781('0x1a')](_0x1f2f1e)[_0xd781('0x1b')]();};}function respondWithResult(_0xd454e7,_0x587953){_0x587953=_0x587953||0xc8;return function(_0x477bdc){if(_0x477bdc){return _0xd454e7[_0xd781('0x1a')](_0x587953)['json'](_0x477bdc);}};}function respondWithFilteredResult(_0x3a1f48,_0x48bffc){return function(_0x294e5a){if(_0x294e5a){var _0x22d787=typeof _0x48bffc[_0xd781('0x1c')]===_0xd781('0x1d')&&typeof _0x48bffc[_0xd781('0x1e')]===_0xd781('0x1d');var _0x501b0d=_0x294e5a['count'];var _0x1407fc=_0x22d787?0x0:_0x48bffc[_0xd781('0x1c')];var _0x395d9c=_0x22d787?_0x294e5a[_0xd781('0x1f')]:_0x48bffc[_0xd781('0x1c')]+_0x48bffc[_0xd781('0x1e')];var _0x260aa8;if(_0x395d9c>=_0x501b0d){_0x395d9c=_0x501b0d;_0x260aa8=0xc8;}else{_0x260aa8=0xce;}_0x3a1f48[_0xd781('0x1a')](_0x260aa8);return _0x3a1f48['set'](_0xd781('0x20'),_0x1407fc+'-'+_0x395d9c+'/'+_0x501b0d)[_0xd781('0x21')](_0x294e5a);}return null;};}function patchUpdates(_0x1036d3){return function(_0x103758){try{jsonpatch[_0xd781('0x22')](_0x103758,_0x1036d3,!![]);}catch(_0x274665){return BPromise[_0xd781('0x23')](_0x274665);}return _0x103758['save']();};}function saveUpdates(_0xe0c65f,_0x4e2c56){return function(_0x567fdf){if(_0x567fdf){return _0x567fdf[_0xd781('0x24')](_0xe0c65f)['then'](function(_0x175ba6){return _0x175ba6;});}return null;};}function removeEntity(_0x101480,_0x395087){return function(_0x31bf57){if(_0x31bf57){return _0x31bf57[_0xd781('0x25')]()[_0xd781('0x26')](function(){_0x101480[_0xd781('0x1a')](0xcc)[_0xd781('0x1b')]();});}};}function handleEntityNotFound(_0x10940b,_0x5662db){return function(_0x529ca1){if(!_0x529ca1){_0x10940b[_0xd781('0x19')](0x194);}return _0x529ca1;};}function handleError(_0x849587,_0xdad0b1){_0xdad0b1=_0xdad0b1||0x1f4;return function(_0x57b41e){logger[_0xd781('0x27')](_0x57b41e['stack']);if(_0x57b41e['name']){delete _0x57b41e[_0xd781('0x28')];}_0x849587['status'](_0xdad0b1)[_0xd781('0x29')](_0x57b41e);};}exports[_0xd781('0x2a')]=function(_0x5c3848,_0x5b6b9d){var _0x43cc74={},_0x5b0464={},_0x296a0b={'count':0x0,'rows':[]};var _0x4a3bd3=_[_0xd781('0x2b')](db[_0xd781('0x2c')]['rawAttributes'],function(_0x54521e){return{'name':_0x54521e[_0xd781('0x2d')],'type':_0x54521e[_0xd781('0x2e')][_0xd781('0x2f')]};});_0x5b0464['model']=_['map'](_0x4a3bd3,_0xd781('0x28'));_0x5b0464[_0xd781('0x30')]=_[_0xd781('0x31')](_0x5c3848['query']);_0x5b0464['filters']=_[_0xd781('0x32')](_0x5b0464[_0xd781('0x33')],_0x5b0464['query']);_0x43cc74[_0xd781('0x34')]=_[_0xd781('0x32')](_0x5b0464['model'],qs[_0xd781('0x35')](_0x5c3848[_0xd781('0x30')][_0xd781('0x35')]));_0x43cc74[_0xd781('0x34')]=_0x43cc74['attributes'][_0xd781('0x36')]?_0x43cc74[_0xd781('0x34')]:_0x5b0464[_0xd781('0x33')];if(!_0x5c3848[_0xd781('0x30')]['hasOwnProperty'](_0xd781('0x37'))){_0x43cc74[_0xd781('0x1e')]=qs['limit'](_0x5c3848[_0xd781('0x30')]['limit']);_0x43cc74[_0xd781('0x1c')]=qs[_0xd781('0x1c')](_0x5c3848['query'][_0xd781('0x1c')]);}_0x43cc74[_0xd781('0x38')]=qs['sort'](_0x5c3848[_0xd781('0x30')]['sort']);_0x43cc74[_0xd781('0x39')]=qs[_0xd781('0x3a')](_['pick'](_0x5c3848[_0xd781('0x30')],_0x5b0464[_0xd781('0x3a')]),_0x4a3bd3);if(_0x5c3848['query'][_0xd781('0x3b')]){_0x43cc74[_0xd781('0x39')]=_[_0xd781('0x3c')](_0x43cc74['where'],{'$or':_[_0xd781('0x2b')](_0x4a3bd3,function(_0x22b94e){if(_0x22b94e[_0xd781('0x2e')]!==_0xd781('0x3d')){var _0x2e8218={};_0x2e8218[_0x22b94e[_0xd781('0x28')]]={'$like':'%'+_0x5c3848[_0xd781('0x30')][_0xd781('0x3b')]+'%'};return _0x2e8218;}})});}_0x43cc74=_[_0xd781('0x3c')]({},_0x43cc74,_0x5c3848['options']);var _0x2a60d6={'where':_0x43cc74['where']};return db[_0xd781('0x2c')][_0xd781('0x1f')](_0x2a60d6)['then'](function(_0x1a5833){_0x296a0b[_0xd781('0x1f')]=_0x1a5833;if(_0x5c3848[_0xd781('0x30')][_0xd781('0x3e')]){_0x43cc74['include']=[{'all':!![]}];}return db[_0xd781('0x2c')]['findAll'](_0x43cc74);})[_0xd781('0x26')](function(_0xcdaacf){_0x296a0b['rows']=_0xcdaacf;return _0x296a0b;})['then'](respondWithFilteredResult(_0x5b6b9d,_0x43cc74))[_0xd781('0x3f')](handleError(_0x5b6b9d,null));};exports[_0xd781('0x40')]=function(_0x15b49d,_0x23bbab){var _0x53aba6={'raw':![],'where':{'id':_0x15b49d[_0xd781('0x41')]['id']}},_0x46e7f6={};_0x46e7f6['model']=_['keys'](db[_0xd781('0x2c')][_0xd781('0x42')]);_0x46e7f6[_0xd781('0x30')]=_['keys'](_0x15b49d['query']);_0x46e7f6[_0xd781('0x3a')]=_[_0xd781('0x32')](_0x46e7f6[_0xd781('0x33')],_0x46e7f6[_0xd781('0x30')]);_0x53aba6[_0xd781('0x34')]=_[_0xd781('0x32')](_0x46e7f6['model'],qs['fields'](_0x15b49d[_0xd781('0x30')][_0xd781('0x35')]));_0x53aba6[_0xd781('0x34')]=_0x53aba6[_0xd781('0x34')][_0xd781('0x36')]?_0x53aba6['attributes']:_0x46e7f6[_0xd781('0x33')];if(_0x15b49d[_0xd781('0x30')][_0xd781('0x3e')]){_0x53aba6['include']=[{'all':!![]}];}_0x53aba6=_[_0xd781('0x3c')]({},_0x53aba6,_0x15b49d[_0xd781('0x43')]);return db[_0xd781('0x2c')]['find'](_0x53aba6)[_0xd781('0x26')](handleEntityNotFound(_0x23bbab,null))[_0xd781('0x26')](respondWithResult(_0x23bbab,null))['catch'](handleError(_0x23bbab,null));};exports['create']=function(_0x13a907,_0x16d16e){return db[_0xd781('0x2c')]['create'](_0x13a907[_0xd781('0x44')],{})[_0xd781('0x26')](respondWithResult(_0x16d16e,0xc9))[_0xd781('0x3f')](handleError(_0x16d16e,null));};exports[_0xd781('0x24')]=function(_0x336d30,_0x3828ad){if(_0x336d30[_0xd781('0x44')]['id']){delete _0x336d30['body']['id'];}return db[_0xd781('0x2c')][_0xd781('0x45')]({'where':{'id':_0x336d30[_0xd781('0x41')]['id']}})['then'](handleEntityNotFound(_0x3828ad,null))[_0xd781('0x26')](saveUpdates(_0x336d30[_0xd781('0x44')],null))['then'](respondWithResult(_0x3828ad,null))[_0xd781('0x3f')](handleError(_0x3828ad,null));};exports[_0xd781('0x25')]=function(_0x41caac,_0x207546){return db[_0xd781('0x2c')]['find']({'where':{'id':_0x41caac[_0xd781('0x41')]['id']}})['then'](handleEntityNotFound(_0x207546,null))[_0xd781('0x26')](removeEntity(_0x207546,null))['catch'](handleError(_0x207546,null));};exports[_0xd781('0x46')]=function(_0x17a46e,_0x4f9e37){return db[_0xd781('0x2c')]['describe']()['then'](respondWithResult(_0x4f9e37,null))['catch'](handleError(_0x4f9e37,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 5775aa2..1e16291 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 _0xfa24=['resourceId','sectionId','util','../../config/logger','api','moment','request-promise','rimraf','exports','define','user_profile_has_resources'];(function(_0x55245a,_0x79539f){var _0x447d3e=function(_0xb2135){while(--_0xb2135){_0x55245a['push'](_0x55245a['shift']());}};_0x447d3e(++_0x79539f);}(_0xfa24,0x1c5));var _0x4fa2=function(_0x566168,_0x4c39af){_0x566168=_0x566168-0x0;var _0x4e1f7a=_0xfa24[_0x566168];return _0x4e1f7a;};'use strict';var _=require('lodash');var util=require(_0x4fa2('0x0'));var logger=require(_0x4fa2('0x1'))(_0x4fa2('0x2'));var moment=require(_0x4fa2('0x3'));var BPromise=require('bluebird');var rp=require(_0x4fa2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4fa2('0x5'));var config=require('../../config/environment');var attributes=require('./userProfileResource.attributes');module[_0x4fa2('0x6')]=function(_0x2041b4,_0x2f4182){return _0x2041b4[_0x4fa2('0x7')]('UserProfileResource',attributes,{'tableName':_0x4fa2('0x8'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x4fa2('0x9'),_0x4fa2('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7e1b=['define','UserProfileResource','compositeIndex','resourceId','lodash','api','moment','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports'];(function(_0x4c789b,_0x5b43a7){var _0x3c5e02=function(_0x8af805){while(--_0x8af805){_0x4c789b['push'](_0x4c789b['shift']());}};_0x3c5e02(++_0x5b43a7);}(_0x7e1b,0xba));var _0xb7e1=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x7e1b[_0x24f31b];return _0x488401;};'use strict';var _=require(_0xb7e1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb7e1('0x1'));var moment=require(_0xb7e1('0x2'));var BPromise=require('bluebird');var rp=require(_0xb7e1('0x3'));var fs=require('fs');var path=require(_0xb7e1('0x4'));var rimraf=require(_0xb7e1('0x5'));var config=require(_0xb7e1('0x6'));var attributes=require(_0xb7e1('0x7'));module[_0xb7e1('0x8')]=function(_0x155819,_0x48e1f4){return _0x155819[_0xb7e1('0x9')](_0xb7e1('0xa'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0xb7e1('0xb'),'fields':[_0xb7e1('0xc'),'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 de3cd5f..789415a 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 _0x219b=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x3fa99d,_0x2b743b){var _0x33a1f5=function(_0x427e51){while(--_0x427e51){_0x3fa99d['push'](_0x3fa99d['shift']());}};_0x33a1f5(++_0x2b743b);}(_0x219b,0xed));var _0xb219=function(_0x3ce807,_0x318b6b){_0x3ce807=_0x3ce807-0x0;var _0x20988d=_0x219b[_0x3ce807];return _0x20988d;};'use strict';var _=require(_0xb219('0x0'));var util=require('util');var moment=require(_0xb219('0x1'));var BPromise=require(_0xb219('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb219('0x3'))['db'];var utils=require(_0xb219('0x4'));var logger=require(_0xb219('0x5'))(_0xb219('0x6'));var config=require(_0xb219('0x7'));var jayson=require(_0xb219('0x8'));var client=jayson[_0xb219('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2996c4,_0x46750f,_0xb7956){return new BPromise(function(_0x425f1f,_0x582240){return client[_0xb219('0xa')](_0x2996c4,_0xb7956)['then'](function(_0x102a80){logger[_0xb219('0xb')](_0xb219('0xc'),_0x46750f,_0xb219('0xd'));logger[_0xb219('0xe')](_0xb219('0xf'),_0x46750f,'request\x20sent',JSON[_0xb219('0x10')](_0x102a80));if(_0x102a80[_0xb219('0x11')]){if(_0x102a80[_0xb219('0x11')][_0xb219('0x12')]===0x1f4){logger['error'](_0xb219('0xc'),_0x46750f,_0x102a80[_0xb219('0x11')][_0xb219('0x13')]);return _0x582240(_0x102a80[_0xb219('0x11')]['message']);}logger[_0xb219('0x11')](_0xb219('0xc'),_0x46750f,_0x102a80[_0xb219('0x11')][_0xb219('0x13')]);return _0x425f1f(_0x102a80['error'][_0xb219('0x13')]);}else{logger['info'](_0xb219('0xc'),_0x46750f,'request\x20sent');_0x425f1f(_0x102a80[_0xb219('0x14')][_0xb219('0x13')]);}})[_0xb219('0x15')](function(_0x49ae28){logger['error'](_0xb219('0xc'),_0x46750f,_0x49ae28);_0x582240(_0x49ae28);});});} \ No newline at end of file +var _0xe672=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x35931e,_0x94f9a2){var _0x11850a=function(_0x36bd64){while(--_0x36bd64){_0x35931e['push'](_0x35931e['shift']());}};_0x11850a(++_0x94f9a2);}(_0xe672,0x1e4));var _0x2e67=function(_0x43602a,_0x8633c4){_0x43602a=_0x43602a-0x0;var _0x36ce11=_0xe672[_0x43602a];return _0x36ce11;};'use strict';var _=require(_0x2e67('0x0'));var util=require('util');var moment=require(_0x2e67('0x1'));var BPromise=require(_0x2e67('0x2'));var rs=require(_0x2e67('0x3'));var fs=require('fs');var Redis=require(_0x2e67('0x4'));var db=require(_0x2e67('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2e67('0x6'));var config=require(_0x2e67('0x7'));var jayson=require(_0x2e67('0x8'));var client=jayson[_0x2e67('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494f9b,_0x37dc36,_0x1d2188){return new BPromise(function(_0x25ebe1,_0x2b60df){return client['request'](_0x494f9b,_0x1d2188)[_0x2e67('0xa')](function(_0x1a126c){logger[_0x2e67('0xb')](_0x2e67('0xc'),_0x37dc36,_0x2e67('0xd'));logger[_0x2e67('0xe')](_0x2e67('0xf'),_0x37dc36,_0x2e67('0xd'),JSON[_0x2e67('0x10')](_0x1a126c));if(_0x1a126c[_0x2e67('0x11')]){if(_0x1a126c[_0x2e67('0x11')][_0x2e67('0x12')]===0x1f4){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x37dc36,_0x1a126c[_0x2e67('0x11')][_0x2e67('0x13')]);return _0x2b60df(_0x1a126c[_0x2e67('0x11')][_0x2e67('0x13')]);}logger[_0x2e67('0x11')](_0x2e67('0xc'),_0x37dc36,_0x1a126c[_0x2e67('0x11')][_0x2e67('0x13')]);return _0x25ebe1(_0x1a126c['error']['message']);}else{logger[_0x2e67('0xb')]('UserProfileResource,\x20%s,\x20%s',_0x37dc36,_0x2e67('0xd'));_0x25ebe1(_0x1a126c['result']['message']);}})[_0x2e67('0x14')](function(_0x32c7fc){logger[_0x2e67('0x11')](_0x2e67('0xc'),_0x37dc36,_0x32c7fc);_0x2b60df(_0x32c7fc);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 95efcd9..6c0cd6a 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 _0x2bcf=['get','/describe','describe','/:id','show','post','create','update','delete','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','isAuthenticated'];(function(_0x39e7f2,_0x233b72){var _0x3c3b2e=function(_0x505126){while(--_0x505126){_0x39e7f2['push'](_0x39e7f2['shift']());}};_0x3c3b2e(++_0x233b72);}(_0x2bcf,0x8f));var _0xf2bc=function(_0x48168a,_0xf9dfe5){_0x48168a=_0x48168a-0x0;var _0x346d98=_0x2bcf[_0x48168a];return _0x346d98;};'use strict';var multer=require(_0xf2bc('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf2bc('0x1'));var router=express[_0xf2bc('0x2')]();var fs_extra=require(_0xf2bc('0x3'));var auth=require(_0xf2bc('0x4'));var interaction=require(_0xf2bc('0x5'));var config=require(_0xf2bc('0x6'));var controller=require(_0xf2bc('0x7'));router['get']('/',auth[_0xf2bc('0x8')](),controller['index']);router[_0xf2bc('0x9')](_0xf2bc('0xa'),auth[_0xf2bc('0x8')](),controller[_0xf2bc('0xb')]);router[_0xf2bc('0x9')](_0xf2bc('0xc'),auth[_0xf2bc('0x8')](),controller[_0xf2bc('0xd')]);router[_0xf2bc('0xe')]('/',auth[_0xf2bc('0x8')](),controller[_0xf2bc('0xf')]);router['put'](_0xf2bc('0xc'),auth[_0xf2bc('0x8')](),controller[_0xf2bc('0x10')]);router[_0xf2bc('0x11')](_0xf2bc('0xc'),auth[_0xf2bc('0x8')](),controller['destroy']);module[_0xf2bc('0x12')]=router; \ No newline at end of file +var _0xe04b=['describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./userProfileSection.controller','isAuthenticated','index','get','/describe'];(function(_0x17c5a6,_0x3b324c){var _0x4a6a6d=function(_0x17bde6){while(--_0x17bde6){_0x17c5a6['push'](_0x17c5a6['shift']());}};_0x4a6a6d(++_0x3b324c);}(_0xe04b,0x1d8));var _0xbe04=function(_0xdbbbcd,_0x5f2401){_0xdbbbcd=_0xdbbbcd-0x0;var _0x148a67=_0xe04b[_0xdbbbcd];return _0x148a67;};'use strict';var multer=require(_0xbe04('0x0'));var util=require(_0xbe04('0x1'));var path=require('path');var timeout=require(_0xbe04('0x2'));var express=require(_0xbe04('0x3'));var router=express['Router']();var fs_extra=require(_0xbe04('0x4'));var auth=require(_0xbe04('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbe04('0x6'));var controller=require(_0xbe04('0x7'));router['get']('/',auth[_0xbe04('0x8')](),controller[_0xbe04('0x9')]);router[_0xbe04('0xa')](_0xbe04('0xb'),auth['isAuthenticated'](),controller[_0xbe04('0xc')]);router['get'](_0xbe04('0xd'),auth[_0xbe04('0x8')](),controller[_0xbe04('0xe')]);router[_0xbe04('0xf')]('/',auth['isAuthenticated'](),controller[_0xbe04('0x10')]);router[_0xbe04('0x11')](_0xbe04('0xd'),auth[_0xbe04('0x8')](),controller[_0xbe04('0x12')]);router[_0xbe04('0x13')]('/:id',auth[_0xbe04('0x8')](),controller[_0xbe04('0x14')]);module[_0xbe04('0x15')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 210aad4..7875264 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 _0xeb74=['INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split','sequelize','exports','STRING'];(function(_0x513dd0,_0x2e3dbd){var _0x5210da=function(_0x58a005){while(--_0x58a005){_0x513dd0['push'](_0x513dd0['shift']());}};_0x5210da(++_0x2e3dbd);}(_0xeb74,0xe3));var _0x4eb7=function(_0x232012,_0x58f0b0){_0x232012=_0x232012-0x0;var _0x3f57cc=_0xeb74[_0x232012];return _0x3f57cc;};'use strict';var Sequelize=require(_0x4eb7('0x0'));module[_0x4eb7('0x1')]={'name':{'type':Sequelize[_0x4eb7('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x4eb7('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x4eb7('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x4eb7('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x4eb7('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x35c7ca){this[_0x4eb7('0x5')](_0x4eb7('0x6'),_0x35c7ca?_0x35c7ca[_0x4eb7('0x7')](''):[]);},'get':function(){return this[_0x4eb7('0x8')]('crudPermissions')?this[_0x4eb7('0x8')]('crudPermissions')[_0x4eb7('0x9')](''):[];}}}; \ No newline at end of file +var _0x36ee=['getDataValue','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join'];(function(_0x41e8b6,_0x306cc2){var _0x13f112=function(_0x484f85){while(--_0x484f85){_0x41e8b6['push'](_0x41e8b6['shift']());}};_0x13f112(++_0x306cc2);}(_0x36ee,0xe8));var _0xe36e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x36ee[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe36e('0x0')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0xe36e('0x1')],'allowNull':![]},'enabled':{'type':Sequelize[_0xe36e('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xe36e('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xe36e('0x0')],'set':function(_0x567a84){this[_0xe36e('0x3')](_0xe36e('0x4'),_0x567a84?_0x567a84[_0xe36e('0x5')](''):[]);},'get':function(){return this[_0xe36e('0x6')](_0xe36e('0x4'))?this[_0xe36e('0x6')](_0xe36e('0x4'))['split'](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 6e117d0..946fd21 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 _0x9a02=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','UserProfileSection','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','rows','catch','show','params','rawAttributes','intersection','include','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x179170,_0x414a7a){var _0x2e0aac=function(_0x32ca3f){while(--_0x32ca3f){_0x179170['push'](_0x179170['shift']());}};_0x2e0aac(++_0x414a7a);}(_0x9a02,0x81));var _0x29a0=function(_0x44792a,_0x3eb437){_0x44792a=_0x44792a-0x0;var _0x5d0e98=_0x9a02[_0x44792a];return _0x5d0e98;};'use strict';var emlformat=require(_0x29a0('0x0'));var rimraf=require(_0x29a0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x29a0('0x2'));var rp=require(_0x29a0('0x3'));var moment=require(_0x29a0('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x29a0('0x5'));var path=require(_0x29a0('0x6'));var sox=require('sox');var csv=require(_0x29a0('0x7'));var ejs=require(_0x29a0('0x8'));var fs=require('fs');var fs_extra=require(_0x29a0('0x9'));var _=require(_0x29a0('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x29a0('0x7'));var querystring=require('querystring');var Papa=require(_0x29a0('0xb'));var Redis=require('ioredis');var authService=require(_0x29a0('0xc'));var qs=require(_0x29a0('0xd'));var as=require(_0x29a0('0xe'));var hardwareService=require(_0x29a0('0xf'));var logger=require('../../config/logger')(_0x29a0('0x10'));var utils=require(_0x29a0('0x11'));var config=require(_0x29a0('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x29a0('0x13'))['db'];function respondWithStatusCode(_0x1dd968,_0x119b7f){_0x119b7f=_0x119b7f||0xcc;return function(_0x5ae3fd){if(_0x5ae3fd){return _0x1dd968[_0x29a0('0x14')](_0x119b7f);}return _0x1dd968[_0x29a0('0x15')](_0x119b7f)[_0x29a0('0x16')]();};}function respondWithResult(_0x330f3d,_0x492c11){_0x492c11=_0x492c11||0xc8;return function(_0x508558){if(_0x508558){return _0x330f3d[_0x29a0('0x15')](_0x492c11)[_0x29a0('0x17')](_0x508558);}};}function respondWithFilteredResult(_0xe170b8,_0x358e3d){return function(_0x223cb8){if(_0x223cb8){var _0x5cccb6=typeof _0x358e3d[_0x29a0('0x18')]===_0x29a0('0x19')&&typeof _0x358e3d[_0x29a0('0x1a')]==='undefined';var _0xf90d47=_0x223cb8[_0x29a0('0x1b')];var _0x1cc541=_0x5cccb6?0x0:_0x358e3d['offset'];var _0xf54f29=_0x5cccb6?_0x223cb8['count']:_0x358e3d[_0x29a0('0x18')]+_0x358e3d[_0x29a0('0x1a')];var _0x137854;if(_0xf54f29>=_0xf90d47){_0xf54f29=_0xf90d47;_0x137854=0xc8;}else{_0x137854=0xce;}_0xe170b8[_0x29a0('0x15')](_0x137854);return _0xe170b8[_0x29a0('0x1c')](_0x29a0('0x1d'),_0x1cc541+'-'+_0xf54f29+'/'+_0xf90d47)[_0x29a0('0x17')](_0x223cb8);}return null;};}function patchUpdates(_0x29978d){return function(_0x6d485c){try{jsonpatch[_0x29a0('0x1e')](_0x6d485c,_0x29978d,!![]);}catch(_0xb534fb){return BPromise['reject'](_0xb534fb);}return _0x6d485c[_0x29a0('0x1f')]();};}function saveUpdates(_0x43006c,_0x47f172){return function(_0x18bf9e){if(_0x18bf9e){return _0x18bf9e[_0x29a0('0x20')](_0x43006c)[_0x29a0('0x21')](function(_0x1174eb){return _0x1174eb;});}return null;};}function removeEntity(_0x505d3c,_0x3ee0da){return function(_0x5d2490){if(_0x5d2490){return _0x5d2490[_0x29a0('0x22')]()['then'](function(){_0x505d3c[_0x29a0('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a77cb,_0xf288c8){return function(_0x563975){if(!_0x563975){_0x5a77cb['sendStatus'](0x194);}return _0x563975;};}function handleError(_0x1e82e9,_0x18fcae){_0x18fcae=_0x18fcae||0x1f4;return function(_0x257a68){logger['error'](_0x257a68[_0x29a0('0x23')]);if(_0x257a68[_0x29a0('0x24')]){delete _0x257a68[_0x29a0('0x24')];}_0x1e82e9[_0x29a0('0x15')](_0x18fcae)[_0x29a0('0x25')](_0x257a68);};}exports[_0x29a0('0x26')]=function(_0x1a0668,_0x32dd1e){var _0x2a9053={},_0x3af9e8={},_0x5f2cfa={'count':0x0,'rows':[]};var _0x406621=_[_0x29a0('0x27')](db[_0x29a0('0x28')]['rawAttributes'],function(_0x30a812){return{'name':_0x30a812[_0x29a0('0x29')],'type':_0x30a812[_0x29a0('0x2a')][_0x29a0('0x2b')]};});_0x3af9e8[_0x29a0('0x2c')]=_['map'](_0x406621,'name');_0x3af9e8[_0x29a0('0x2d')]=_[_0x29a0('0x2e')](_0x1a0668[_0x29a0('0x2d')]);_0x3af9e8[_0x29a0('0x2f')]=_['intersection'](_0x3af9e8[_0x29a0('0x2c')],_0x3af9e8['query']);_0x2a9053[_0x29a0('0x30')]=_['intersection'](_0x3af9e8[_0x29a0('0x2c')],qs[_0x29a0('0x31')](_0x1a0668[_0x29a0('0x2d')][_0x29a0('0x31')]));_0x2a9053[_0x29a0('0x30')]=_0x2a9053[_0x29a0('0x30')][_0x29a0('0x32')]?_0x2a9053[_0x29a0('0x30')]:_0x3af9e8[_0x29a0('0x2c')];if(!_0x1a0668[_0x29a0('0x2d')][_0x29a0('0x33')](_0x29a0('0x34'))){_0x2a9053[_0x29a0('0x1a')]=qs[_0x29a0('0x1a')](_0x1a0668[_0x29a0('0x2d')][_0x29a0('0x1a')]);_0x2a9053['offset']=qs[_0x29a0('0x18')](_0x1a0668[_0x29a0('0x2d')][_0x29a0('0x18')]);}_0x2a9053[_0x29a0('0x35')]=qs[_0x29a0('0x36')](_0x1a0668[_0x29a0('0x2d')][_0x29a0('0x36')]);_0x2a9053['where']=qs[_0x29a0('0x2f')](_[_0x29a0('0x37')](_0x1a0668['query'],_0x3af9e8[_0x29a0('0x2f')]),_0x406621);if(_0x1a0668['query']['filter']){_0x2a9053[_0x29a0('0x38')]=_['merge'](_0x2a9053[_0x29a0('0x38')],{'$or':_[_0x29a0('0x27')](_0x406621,function(_0x1f9d71){if(_0x1f9d71[_0x29a0('0x2a')]!==_0x29a0('0x39')){var _0x2fa553={};_0x2fa553[_0x1f9d71[_0x29a0('0x24')]]={'$like':'%'+_0x1a0668[_0x29a0('0x2d')][_0x29a0('0x3a')]+'%'};return _0x2fa553;}})});}_0x2a9053=_[_0x29a0('0x3b')]({},_0x2a9053,_0x1a0668[_0x29a0('0x3c')]);var _0x52a0ee={'where':_0x2a9053[_0x29a0('0x38')]};return db[_0x29a0('0x28')]['count'](_0x52a0ee)[_0x29a0('0x21')](function(_0x364cfc){_0x5f2cfa[_0x29a0('0x1b')]=_0x364cfc;if(_0x1a0668[_0x29a0('0x2d')][_0x29a0('0x3d')]){_0x2a9053['include']=[{'all':!![]}];}return db[_0x29a0('0x28')]['findAll'](_0x2a9053);})[_0x29a0('0x21')](function(_0x2eb874){_0x5f2cfa[_0x29a0('0x3e')]=_0x2eb874;return _0x5f2cfa;})[_0x29a0('0x21')](respondWithFilteredResult(_0x32dd1e,_0x2a9053))[_0x29a0('0x3f')](handleError(_0x32dd1e,null));};exports[_0x29a0('0x40')]=function(_0x522ee6,_0x409c2f){var _0x275967={'raw':![],'where':{'id':_0x522ee6[_0x29a0('0x41')]['id']}},_0x2d5979={};_0x2d5979[_0x29a0('0x2c')]=_[_0x29a0('0x2e')](db['UserProfileSection'][_0x29a0('0x42')]);_0x2d5979[_0x29a0('0x2d')]=_['keys'](_0x522ee6[_0x29a0('0x2d')]);_0x2d5979[_0x29a0('0x2f')]=_[_0x29a0('0x43')](_0x2d5979[_0x29a0('0x2c')],_0x2d5979[_0x29a0('0x2d')]);_0x275967[_0x29a0('0x30')]=_['intersection'](_0x2d5979[_0x29a0('0x2c')],qs[_0x29a0('0x31')](_0x522ee6[_0x29a0('0x2d')][_0x29a0('0x31')]));_0x275967[_0x29a0('0x30')]=_0x275967[_0x29a0('0x30')][_0x29a0('0x32')]?_0x275967[_0x29a0('0x30')]:_0x2d5979[_0x29a0('0x2c')];if(_0x522ee6[_0x29a0('0x2d')][_0x29a0('0x3d')]){_0x275967[_0x29a0('0x44')]=[{'all':!![]}];}_0x275967=_['merge']({},_0x275967,_0x522ee6[_0x29a0('0x3c')]);return db['UserProfileSection']['find'](_0x275967)[_0x29a0('0x21')](handleEntityNotFound(_0x409c2f,null))[_0x29a0('0x21')](respondWithResult(_0x409c2f,null))[_0x29a0('0x3f')](handleError(_0x409c2f,null));};exports[_0x29a0('0x45')]=function(_0x2f8789,_0x1a974e){return db[_0x29a0('0x28')]['create'](_0x2f8789['body'],{})[_0x29a0('0x21')](respondWithResult(_0x1a974e,0xc9))[_0x29a0('0x3f')](handleError(_0x1a974e,null));};exports[_0x29a0('0x20')]=function(_0x21b45c,_0x17be84){if(_0x21b45c[_0x29a0('0x46')]['id']){delete _0x21b45c[_0x29a0('0x46')]['id'];}return db[_0x29a0('0x28')][_0x29a0('0x47')]({'where':{'id':_0x21b45c[_0x29a0('0x41')]['id']}})[_0x29a0('0x21')](handleEntityNotFound(_0x17be84,null))[_0x29a0('0x21')](saveUpdates(_0x21b45c['body'],null))[_0x29a0('0x21')](respondWithResult(_0x17be84,null))[_0x29a0('0x3f')](handleError(_0x17be84,null));};exports[_0x29a0('0x22')]=function(_0x2699c0,_0x37ece0){return db['UserProfileSection'][_0x29a0('0x47')]({'where':{'id':_0x2699c0[_0x29a0('0x41')]['id']}})['then'](handleEntityNotFound(_0x37ece0,null))[_0x29a0('0x21')](removeEntity(_0x37ece0,null))[_0x29a0('0x3f')](handleError(_0x37ece0,null));};exports[_0x29a0('0x48')]=function(_0x505eb8,_0x17c0a4){return db['UserProfileSection'][_0x29a0('0x48')]()['then'](respondWithResult(_0x17c0a4,null))[_0x29a0('0x3f')](handleError(_0x17c0a4,null));}; \ No newline at end of file +var _0x9614=['squel','crypto','jsforce','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','offset','limit','undefined','count','set','apply','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','UserProfileSection','includeAll','include','findAll','rows','show','find','catch','create','body','update','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash'];(function(_0x5557e9,_0x55cf12){var _0x4d731f=function(_0x33fc5c){while(--_0x33fc5c){_0x5557e9['push'](_0x5557e9['shift']());}};_0x4d731f(++_0x55cf12);}(_0x9614,0x179));var _0x4961=function(_0x329437,_0x1de73a){_0x329437=_0x329437-0x0;var _0x3789d9=_0x9614[_0x329437];return _0x3789d9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4961('0x0'));var zipdir=require(_0x4961('0x1'));var jsonpatch=require(_0x4961('0x2'));var rp=require(_0x4961('0x3'));var moment=require(_0x4961('0x4'));var BPromise=require(_0x4961('0x5'));var Mustache=require(_0x4961('0x6'));var util=require(_0x4961('0x7'));var path=require(_0x4961('0x8'));var sox=require('sox');var csv=require(_0x4961('0x9'));var ejs=require(_0x4961('0xa'));var fs=require('fs');var fs_extra=require(_0x4961('0xb'));var _=require(_0x4961('0xc'));var squel=require(_0x4961('0xd'));var crypto=require(_0x4961('0xe'));var jsforce=require(_0x4961('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x4961('0x9'));var querystring=require(_0x4961('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4961('0x11'));var as=require(_0x4961('0x12'));var hardwareService=require(_0x4961('0x13'));var logger=require('../../config/logger')(_0x4961('0x14'));var utils=require(_0x4961('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4961('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc0be1a,_0x51262a){_0x51262a=_0x51262a||0xcc;return function(_0x1ce7e5){if(_0x1ce7e5){return _0xc0be1a[_0x4961('0x17')](_0x51262a);}return _0xc0be1a['status'](_0x51262a)[_0x4961('0x18')]();};}function respondWithResult(_0x87968c,_0x57c88c){_0x57c88c=_0x57c88c||0xc8;return function(_0x29240e){if(_0x29240e){return _0x87968c[_0x4961('0x19')](_0x57c88c)[_0x4961('0x1a')](_0x29240e);}};}function respondWithFilteredResult(_0x2ca8dd,_0x2579a8){return function(_0x453ff9){if(_0x453ff9){var _0x39153a=typeof _0x2579a8[_0x4961('0x1b')]==='undefined'&&typeof _0x2579a8[_0x4961('0x1c')]===_0x4961('0x1d');var _0x3184a5=_0x453ff9[_0x4961('0x1e')];var _0xe054d9=_0x39153a?0x0:_0x2579a8[_0x4961('0x1b')];var _0x39cf38=_0x39153a?_0x453ff9[_0x4961('0x1e')]:_0x2579a8[_0x4961('0x1b')]+_0x2579a8[_0x4961('0x1c')];var _0x3282e1;if(_0x39cf38>=_0x3184a5){_0x39cf38=_0x3184a5;_0x3282e1=0xc8;}else{_0x3282e1=0xce;}_0x2ca8dd[_0x4961('0x19')](_0x3282e1);return _0x2ca8dd[_0x4961('0x1f')]('Content-Range',_0xe054d9+'-'+_0x39cf38+'/'+_0x3184a5)[_0x4961('0x1a')](_0x453ff9);}return null;};}function patchUpdates(_0x9bc5ee){return function(_0x2009ee){try{jsonpatch[_0x4961('0x20')](_0x2009ee,_0x9bc5ee,!![]);}catch(_0x2c5236){return BPromise[_0x4961('0x21')](_0x2c5236);}return _0x2009ee[_0x4961('0x22')]();};}function saveUpdates(_0x1ce17d,_0xfffbf){return function(_0x423f9b){if(_0x423f9b){return _0x423f9b['update'](_0x1ce17d)[_0x4961('0x23')](function(_0x115825){return _0x115825;});}return null;};}function removeEntity(_0x49f1f6,_0x5afcf3){return function(_0x3927cf){if(_0x3927cf){return _0x3927cf[_0x4961('0x24')]()['then'](function(){_0x49f1f6[_0x4961('0x19')](0xcc)[_0x4961('0x18')]();});}};}function handleEntityNotFound(_0x54eedd,_0x5a8129){return function(_0x28fe5b){if(!_0x28fe5b){_0x54eedd[_0x4961('0x17')](0x194);}return _0x28fe5b;};}function handleError(_0x3235cc,_0x4a1854){_0x4a1854=_0x4a1854||0x1f4;return function(_0x3533d4){logger[_0x4961('0x25')](_0x3533d4[_0x4961('0x26')]);if(_0x3533d4[_0x4961('0x27')]){delete _0x3533d4[_0x4961('0x27')];}_0x3235cc[_0x4961('0x19')](_0x4a1854)[_0x4961('0x28')](_0x3533d4);};}exports[_0x4961('0x29')]=function(_0x5e8b8e,_0x99ddd4){var _0x5a4c82={},_0x11a4c7={},_0x388043={'count':0x0,'rows':[]};var _0x94bc33=_[_0x4961('0x2a')](db['UserProfileSection'][_0x4961('0x2b')],function(_0x6b6785){return{'name':_0x6b6785[_0x4961('0x2c')],'type':_0x6b6785[_0x4961('0x2d')][_0x4961('0x2e')]};});_0x11a4c7[_0x4961('0x2f')]=_['map'](_0x94bc33,_0x4961('0x27'));_0x11a4c7[_0x4961('0x30')]=_[_0x4961('0x31')](_0x5e8b8e[_0x4961('0x30')]);_0x11a4c7[_0x4961('0x32')]=_[_0x4961('0x33')](_0x11a4c7[_0x4961('0x2f')],_0x11a4c7[_0x4961('0x30')]);_0x5a4c82['attributes']=_[_0x4961('0x33')](_0x11a4c7['model'],qs[_0x4961('0x34')](_0x5e8b8e['query'][_0x4961('0x34')]));_0x5a4c82[_0x4961('0x35')]=_0x5a4c82[_0x4961('0x35')][_0x4961('0x36')]?_0x5a4c82['attributes']:_0x11a4c7[_0x4961('0x2f')];if(!_0x5e8b8e[_0x4961('0x30')][_0x4961('0x37')](_0x4961('0x38'))){_0x5a4c82[_0x4961('0x1c')]=qs['limit'](_0x5e8b8e[_0x4961('0x30')][_0x4961('0x1c')]);_0x5a4c82['offset']=qs[_0x4961('0x1b')](_0x5e8b8e[_0x4961('0x30')][_0x4961('0x1b')]);}_0x5a4c82[_0x4961('0x39')]=qs[_0x4961('0x3a')](_0x5e8b8e[_0x4961('0x30')]['sort']);_0x5a4c82['where']=qs['filters'](_[_0x4961('0x3b')](_0x5e8b8e[_0x4961('0x30')],_0x11a4c7[_0x4961('0x32')]),_0x94bc33);if(_0x5e8b8e[_0x4961('0x30')][_0x4961('0x3c')]){_0x5a4c82[_0x4961('0x3d')]=_[_0x4961('0x3e')](_0x5a4c82[_0x4961('0x3d')],{'$or':_['map'](_0x94bc33,function(_0x1c6b2b){if(_0x1c6b2b[_0x4961('0x2d')]!==_0x4961('0x3f')){var _0x245c32={};_0x245c32[_0x1c6b2b[_0x4961('0x27')]]={'$like':'%'+_0x5e8b8e['query'][_0x4961('0x3c')]+'%'};return _0x245c32;}})});}_0x5a4c82=_[_0x4961('0x3e')]({},_0x5a4c82,_0x5e8b8e[_0x4961('0x40')]);var _0x4bd9c3={'where':_0x5a4c82[_0x4961('0x3d')]};return db[_0x4961('0x41')][_0x4961('0x1e')](_0x4bd9c3)[_0x4961('0x23')](function(_0x5c6801){_0x388043[_0x4961('0x1e')]=_0x5c6801;if(_0x5e8b8e[_0x4961('0x30')][_0x4961('0x42')]){_0x5a4c82[_0x4961('0x43')]=[{'all':!![]}];}return db[_0x4961('0x41')][_0x4961('0x44')](_0x5a4c82);})[_0x4961('0x23')](function(_0x24e5f3){_0x388043[_0x4961('0x45')]=_0x24e5f3;return _0x388043;})[_0x4961('0x23')](respondWithFilteredResult(_0x99ddd4,_0x5a4c82))['catch'](handleError(_0x99ddd4,null));};exports[_0x4961('0x46')]=function(_0x4f6ff4,_0xd0cc63){var _0x2987a2={'raw':![],'where':{'id':_0x4f6ff4['params']['id']}},_0x53e1b6={};_0x53e1b6[_0x4961('0x2f')]=_['keys'](db[_0x4961('0x41')]['rawAttributes']);_0x53e1b6[_0x4961('0x30')]=_[_0x4961('0x31')](_0x4f6ff4[_0x4961('0x30')]);_0x53e1b6[_0x4961('0x32')]=_['intersection'](_0x53e1b6[_0x4961('0x2f')],_0x53e1b6[_0x4961('0x30')]);_0x2987a2[_0x4961('0x35')]=_[_0x4961('0x33')](_0x53e1b6['model'],qs['fields'](_0x4f6ff4[_0x4961('0x30')]['fields']));_0x2987a2['attributes']=_0x2987a2[_0x4961('0x35')][_0x4961('0x36')]?_0x2987a2[_0x4961('0x35')]:_0x53e1b6[_0x4961('0x2f')];if(_0x4f6ff4[_0x4961('0x30')][_0x4961('0x42')]){_0x2987a2[_0x4961('0x43')]=[{'all':!![]}];}_0x2987a2=_[_0x4961('0x3e')]({},_0x2987a2,_0x4f6ff4[_0x4961('0x40')]);return db[_0x4961('0x41')][_0x4961('0x47')](_0x2987a2)[_0x4961('0x23')](handleEntityNotFound(_0xd0cc63,null))[_0x4961('0x23')](respondWithResult(_0xd0cc63,null))[_0x4961('0x48')](handleError(_0xd0cc63,null));};exports['create']=function(_0x29035e,_0x10d73a){return db[_0x4961('0x41')][_0x4961('0x49')](_0x29035e[_0x4961('0x4a')],{})[_0x4961('0x23')](respondWithResult(_0x10d73a,0xc9))[_0x4961('0x48')](handleError(_0x10d73a,null));};exports[_0x4961('0x4b')]=function(_0x4385a1,_0x4eae33){if(_0x4385a1['body']['id']){delete _0x4385a1[_0x4961('0x4a')]['id'];}return db['UserProfileSection'][_0x4961('0x47')]({'where':{'id':_0x4385a1[_0x4961('0x4c')]['id']}})[_0x4961('0x23')](handleEntityNotFound(_0x4eae33,null))[_0x4961('0x23')](saveUpdates(_0x4385a1['body'],null))[_0x4961('0x23')](respondWithResult(_0x4eae33,null))['catch'](handleError(_0x4eae33,null));};exports['destroy']=function(_0x53dc99,_0x49a27c){return db[_0x4961('0x41')][_0x4961('0x47')]({'where':{'id':_0x53dc99[_0x4961('0x4c')]['id']}})[_0x4961('0x23')](handleEntityNotFound(_0x49a27c,null))['then'](removeEntity(_0x49a27c,null))[_0x4961('0x48')](handleError(_0x49a27c,null));};exports[_0x4961('0x4d')]=function(_0x4277f8,_0x185933){return db[_0x4961('0x41')]['describe']()['then'](respondWithResult(_0x185933,null))[_0x4961('0x48')](handleError(_0x185933,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 3476ec6..c13bfa2 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 _0x6463=['request-promise','rimraf','../../config/environment','./userProfileSection.attributes','user_profile_has_sections','compositeIndex','userProfileId','util','../../config/logger','api','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6463,0xb7));var _0x3646=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6463[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x3646('0x0'));var logger=require(_0x3646('0x1'))(_0x3646('0x2'));var moment=require(_0x3646('0x3'));var BPromise=require('bluebird');var rp=require(_0x3646('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3646('0x5'));var config=require(_0x3646('0x6'));var attributes=require(_0x3646('0x7'));module['exports']=function(_0x6a6798,_0x3de8e2){return _0x6a6798['define']('UserProfileSection',attributes,{'tableName':_0x3646('0x8'),'paranoid':![],'indexes':[{'name':_0x3646('0x9'),'fields':['sectionId',_0x3646('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8556=['path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','user_profile_has_sections','compositeIndex','userProfileId','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x36c26e,_0x4a64a3){var _0x546071=function(_0x500d02){while(--_0x500d02){_0x36c26e['push'](_0x36c26e['shift']());}};_0x546071(++_0x4a64a3);}(_0x8556,0x1da));var _0x6855=function(_0x5c6403,_0xb08818){_0x5c6403=_0x5c6403-0x0;var _0x523367=_0x8556[_0x5c6403];return _0x523367;};'use strict';var _=require(_0x6855('0x0'));var util=require(_0x6855('0x1'));var logger=require(_0x6855('0x2'))('api');var moment=require(_0x6855('0x3'));var BPromise=require(_0x6855('0x4'));var rp=require(_0x6855('0x5'));var fs=require('fs');var path=require(_0x6855('0x6'));var rimraf=require(_0x6855('0x7'));var config=require(_0x6855('0x8'));var attributes=require(_0x6855('0x9'));module[_0x6855('0xa')]=function(_0x346b22,_0x2b02bf){return _0x346b22[_0x6855('0xb')]('UserProfileSection',attributes,{'tableName':_0x6855('0xc'),'paranoid':![],'indexes':[{'name':_0x6855('0xd'),'fields':['sectionId',_0x6855('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 0435352..16eee21 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 _0x7534=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0xe9a2b2,_0x7aa94c){var _0x3c9fec=function(_0x5bc56c){while(--_0x5bc56c){_0xe9a2b2['push'](_0xe9a2b2['shift']());}};_0x3c9fec(++_0x7aa94c);}(_0x7534,0x121));var _0x4753=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x7534[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x4753('0x0'));var util=require(_0x4753('0x1'));var moment=require(_0x4753('0x2'));var BPromise=require(_0x4753('0x3'));var rs=require(_0x4753('0x4'));var fs=require('fs');var Redis=require(_0x4753('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4753('0x6'));var logger=require(_0x4753('0x7'))(_0x4753('0x8'));var config=require('../../config/environment');var jayson=require(_0x4753('0x9'));var client=jayson[_0x4753('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x261069,_0x2964d7,_0x378a20){return new BPromise(function(_0x2f4c7b,_0x2949fb){return client[_0x4753('0xb')](_0x261069,_0x378a20)[_0x4753('0xc')](function(_0x2f2ccd){logger['info'](_0x4753('0xd'),_0x2964d7,_0x4753('0xe'));logger['debug']('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x2964d7,_0x4753('0xe'),JSON[_0x4753('0xf')](_0x2f2ccd));if(_0x2f2ccd[_0x4753('0x10')]){if(_0x2f2ccd[_0x4753('0x10')]['code']===0x1f4){logger[_0x4753('0x10')](_0x4753('0xd'),_0x2964d7,_0x2f2ccd['error'][_0x4753('0x11')]);return _0x2949fb(_0x2f2ccd[_0x4753('0x10')]['message']);}logger['error']('UserProfileSection,\x20%s,\x20%s',_0x2964d7,_0x2f2ccd['error'][_0x4753('0x11')]);return _0x2f4c7b(_0x2f2ccd[_0x4753('0x10')][_0x4753('0x11')]);}else{logger[_0x4753('0x12')](_0x4753('0xd'),_0x2964d7,_0x4753('0xe'));_0x2f4c7b(_0x2f2ccd[_0x4753('0x13')]['message']);}})[_0x4753('0x14')](function(_0x18ed2d){logger[_0x4753('0x10')](_0x4753('0xd'),_0x2964d7,_0x18ed2d);_0x2949fb(_0x18ed2d);});});} \ No newline at end of file +var _0x2d39=['stringify','error','code','message','info','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s'];(function(_0xe92f5b,_0x5c5b57){var _0x27854b=function(_0x578fdd){while(--_0x578fdd){_0xe92f5b['push'](_0xe92f5b['shift']());}};_0x27854b(++_0x5c5b57);}(_0x2d39,0x11e));var _0x92d3=function(_0x20bb55,_0x58e943){_0x20bb55=_0x20bb55-0x0;var _0x47b801=_0x2d39[_0x20bb55];return _0x47b801;};'use strict';var _=require(_0x92d3('0x0'));var util=require('util');var moment=require(_0x92d3('0x1'));var BPromise=require(_0x92d3('0x2'));var rs=require(_0x92d3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x92d3('0x4'))['db'];var utils=require(_0x92d3('0x5'));var logger=require(_0x92d3('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x92d3('0x7'));var client=jayson[_0x92d3('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cfaf8,_0x5cd9aa,_0x40c576){return new BPromise(function(_0x286d8d,_0xa63b22){return client['request'](_0x1cfaf8,_0x40c576)[_0x92d3('0x9')](function(_0x58d51d){logger['info'](_0x92d3('0xa'),_0x5cd9aa,_0x92d3('0xb'));logger[_0x92d3('0xc')](_0x92d3('0xd'),_0x5cd9aa,'request\x20sent',JSON[_0x92d3('0xe')](_0x58d51d));if(_0x58d51d['error']){if(_0x58d51d[_0x92d3('0xf')][_0x92d3('0x10')]===0x1f4){logger[_0x92d3('0xf')](_0x92d3('0xa'),_0x5cd9aa,_0x58d51d[_0x92d3('0xf')][_0x92d3('0x11')]);return _0xa63b22(_0x58d51d[_0x92d3('0xf')][_0x92d3('0x11')]);}logger[_0x92d3('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x5cd9aa,_0x58d51d[_0x92d3('0xf')][_0x92d3('0x11')]);return _0x286d8d(_0x58d51d['error'][_0x92d3('0x11')]);}else{logger[_0x92d3('0x12')](_0x92d3('0xa'),_0x5cd9aa,_0x92d3('0xb'));_0x286d8d(_0x58d51d['result'][_0x92d3('0x11')]);}})[_0x92d3('0x13')](function(_0x10e8e5){logger[_0x92d3('0xf')](_0x92d3('0xa'),_0x5cd9aa,_0x10e8e5);_0xa63b22(_0x10e8e5);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 546380f..6b9f115 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(_0x20f4ba,_0x4ddd29){var _0x2f6570=function(_0x5a6ab9){while(--_0x5a6ab9){_0x20f4ba['push'](_0x20f4ba['shift']());}};_0x2f6570(++_0x4ddd29);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5017e8,_0x44bf12){var _0x4f36f0=function(_0x41dd76){while(--_0x41dd76){_0x5017e8['push'](_0x5017e8['shift']());}};_0x4f36f0(++_0x44bf12);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 345326d..3084b70 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 _0xf20b=['INTEGER'];(function(_0x5c4186,_0x201cce){var _0x179372=function(_0x5450ff){while(--_0x5450ff){_0x5c4186['push'](_0x5c4186['shift']());}};_0x179372(++_0x201cce);}(_0xf20b,0x1da));var _0xbf20=function(_0x40ba3d,_0x66258c){_0x40ba3d=_0x40ba3d-0x0;var _0x419690=_0xf20b[_0x40ba3d];return _0x419690;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xbf20('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1b00=['INTEGER','sequelize'];(function(_0xbed6a6,_0x2c7518){var _0x53614d=function(_0x5d8917){while(--_0x5d8917){_0xbed6a6['push'](_0xbed6a6['shift']());}};_0x53614d(++_0x2c7518);}(_0x1b00,0xc7));var _0x01b0=function(_0x210f6c,_0x3684e7){_0x210f6c=_0x210f6c-0x0;var _0x2c07db=_0x1b00[_0x210f6c];return _0x2c07db;};'use strict';var Sequelize=require(_0x01b0('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x01b0('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 51807b7..cbc1cec 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 _0xce68=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./userSmsQueue.attributes','user_has_sms_queues','lodash','../../config/logger'];(function(_0x22a97c,_0x183076){var _0xe65c1=function(_0x284699){while(--_0x284699){_0x22a97c['push'](_0x22a97c['shift']());}};_0xe65c1(++_0x183076);}(_0xce68,0x10c));var _0x8ce6=function(_0x36211f,_0xf7c80c){_0x36211f=_0x36211f-0x0;var _0xdd3e04=_0xce68[_0x36211f];return _0xdd3e04;};'use strict';var _=require(_0x8ce6('0x0'));var util=require('util');var logger=require(_0x8ce6('0x1'))(_0x8ce6('0x2'));var moment=require(_0x8ce6('0x3'));var BPromise=require(_0x8ce6('0x4'));var rp=require(_0x8ce6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8ce6('0x6'));var config=require(_0x8ce6('0x7'));var attributes=require(_0x8ce6('0x8'));module['exports']=function(_0x116e0a,_0x10b3ca){return _0x116e0a['define']('UserSmsQueue',attributes,{'tableName':_0x8ce6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf40b=['request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','define','UserSmsQueue','user_has_sms_queues','util','../../config/logger','api','moment'];(function(_0x1342e5,_0x1950f4){var _0x16af23=function(_0x225400){while(--_0x225400){_0x1342e5['push'](_0x1342e5['shift']());}};_0x16af23(++_0x1950f4);}(_0xf40b,0xb0));var _0xbf40=function(_0x1e7aff,_0x1c843b){_0x1e7aff=_0x1e7aff-0x0;var _0x2a16bf=_0xf40b[_0x1e7aff];return _0x2a16bf;};'use strict';var _=require('lodash');var util=require(_0xbf40('0x0'));var logger=require(_0xbf40('0x1'))(_0xbf40('0x2'));var moment=require(_0xbf40('0x3'));var BPromise=require('bluebird');var rp=require(_0xbf40('0x4'));var fs=require('fs');var path=require(_0xbf40('0x5'));var rimraf=require(_0xbf40('0x6'));var config=require(_0xbf40('0x7'));var attributes=require(_0xbf40('0x8'));module['exports']=function(_0x2e74b5,_0xbe1c47){return _0x2e74b5[_0xbf40('0x9')](_0xbf40('0xa'),attributes,{'tableName':_0xbf40('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 06b68b4..6f309bd 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 _0xe23c=['request','info','UserSmsQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x5b0fcc,_0x449df1){var _0x16eb1e=function(_0x24a12f){while(--_0x24a12f){_0x5b0fcc['push'](_0x5b0fcc['shift']());}};_0x16eb1e(++_0x449df1);}(_0xe23c,0x16a));var _0xce23=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0xe23c[_0x1da527];return _0x40fc7c;};'use strict';var _=require(_0xce23('0x0'));var util=require(_0xce23('0x1'));var moment=require(_0xce23('0x2'));var BPromise=require(_0xce23('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xce23('0x4'));var db=require(_0xce23('0x5'))['db'];var utils=require(_0xce23('0x6'));var logger=require(_0xce23('0x7'))(_0xce23('0x8'));var config=require(_0xce23('0x9'));var jayson=require(_0xce23('0xa'));var client=jayson['client'][_0xce23('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x337ca5,_0x29bedc,_0x552ae4){return new BPromise(function(_0x5329cb,_0x258704){return client[_0xce23('0xc')](_0x337ca5,_0x552ae4)['then'](function(_0x51c534){logger[_0xce23('0xd')](_0xce23('0xe'),_0x29bedc,'request\x20sent');logger[_0xce23('0xf')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x29bedc,_0xce23('0x10'),JSON[_0xce23('0x11')](_0x51c534));if(_0x51c534[_0xce23('0x12')]){if(_0x51c534[_0xce23('0x12')]['code']===0x1f4){logger[_0xce23('0x12')](_0xce23('0xe'),_0x29bedc,_0x51c534[_0xce23('0x12')]['message']);return _0x258704(_0x51c534['error']['message']);}logger[_0xce23('0x12')](_0xce23('0xe'),_0x29bedc,_0x51c534['error'][_0xce23('0x13')]);return _0x5329cb(_0x51c534[_0xce23('0x12')][_0xce23('0x13')]);}else{logger[_0xce23('0xd')](_0xce23('0xe'),_0x29bedc,_0xce23('0x10'));_0x5329cb(_0x51c534[_0xce23('0x14')][_0xce23('0x13')]);}})[_0xce23('0x15')](function(_0xcb3700){logger[_0xce23('0x12')](_0xce23('0xe'),_0x29bedc,_0xcb3700);_0x258704(_0xcb3700);});});} \ No newline at end of file +var _0xcc83=['message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4fb815,_0x4191c7){var _0x295e42=function(_0x2a1082){while(--_0x2a1082){_0x4fb815['push'](_0x4fb815['shift']());}};_0x295e42(++_0x4191c7);}(_0xcc83,0x157));var _0x3cc8=function(_0x27a4e0,_0x4816f5){_0x27a4e0=_0x27a4e0-0x0;var _0x2b57c7=_0xcc83[_0x27a4e0];return _0x2b57c7;};'use strict';var _=require('lodash');var util=require(_0x3cc8('0x0'));var moment=require(_0x3cc8('0x1'));var BPromise=require(_0x3cc8('0x2'));var rs=require(_0x3cc8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3cc8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3cc8('0x5'))(_0x3cc8('0x6'));var config=require(_0x3cc8('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3cc8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x502700,_0x37c9cc,_0x2d78be){return new BPromise(function(_0x48c8eb,_0xcb5e1){return client[_0x3cc8('0x9')](_0x502700,_0x2d78be)[_0x3cc8('0xa')](function(_0x440dd2){logger['info'](_0x3cc8('0xb'),_0x37c9cc,_0x3cc8('0xc'));logger['debug'](_0x3cc8('0xd'),_0x37c9cc,'request\x20sent',JSON[_0x3cc8('0xe')](_0x440dd2));if(_0x440dd2[_0x3cc8('0xf')]){if(_0x440dd2[_0x3cc8('0xf')][_0x3cc8('0x10')]===0x1f4){logger[_0x3cc8('0xf')](_0x3cc8('0xb'),_0x37c9cc,_0x440dd2[_0x3cc8('0xf')][_0x3cc8('0x11')]);return _0xcb5e1(_0x440dd2[_0x3cc8('0xf')][_0x3cc8('0x11')]);}logger['error'](_0x3cc8('0xb'),_0x37c9cc,_0x440dd2[_0x3cc8('0xf')][_0x3cc8('0x11')]);return _0x48c8eb(_0x440dd2[_0x3cc8('0xf')][_0x3cc8('0x11')]);}else{logger['info'](_0x3cc8('0xb'),_0x37c9cc,_0x3cc8('0xc'));_0x48c8eb(_0x440dd2[_0x3cc8('0x12')]['message']);}})[_0x3cc8('0x13')](function(_0x6941b3){logger[_0x3cc8('0xf')](_0x3cc8('0xb'),_0x37c9cc,_0x6941b3);_0xcb5e1(_0x6941b3);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 540f790..79b73f0 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 _0xf577=['exports','INTEGER','sequelize'];(function(_0x217301,_0x4218f0){var _0x5da5b9=function(_0x1b5d25){while(--_0x1b5d25){_0x217301['push'](_0x217301['shift']());}};_0x5da5b9(++_0x4218f0);}(_0xf577,0x92));var _0x7f57=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0xf577[_0x1a72f3];return _0x57ef47;};'use strict';var Sequelize=require(_0x7f57('0x0'));module[_0x7f57('0x1')]={'UserId':{'type':Sequelize[_0x7f57('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x7f57('0x2')]}}; \ No newline at end of file +var _0x1249=['INTEGER'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x1249,0x1aa));var _0x9124=function(_0x189081,_0x5c63b9){_0x189081=_0x189081-0x0;var _0x1fb834=_0x1249[_0x189081];return _0x1fb834;};'use strict';var Sequelize=require('sequelize');module['exports']={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x9124('0x0')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index a4dda5b..55e01f2 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(_0x223532,_0x430392){var _0x261d46=function(_0x3cae03){while(--_0x3cae03){_0x223532['push'](_0x223532['shift']());}};_0x261d46(++_0x430392);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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(_0x41c8f2,_0x4713f7){var _0x53e568=function(_0x34358a){while(--_0x34358a){_0x41c8f2['push'](_0x41c8f2['shift']());}};_0x53e568(++_0x4713f7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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 6b7a037..9b52b8e 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x3f350d,_0x44892b){var _0xd9c5c9=function(_0x2d0cdd){while(--_0x2d0cdd){_0x3f350d['push'](_0x3f350d['shift']());}};_0xd9c5c9(++_0x44892b);}(_0x70e0,0x17b));var _0x070e=function(_0x6d3a2f,_0xd23d2c){_0x6d3a2f=_0x6d3a2f-0x0;var _0x38520f=_0x70e0[_0x6d3a2f];return _0x38520f;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x5f33ec,_0x3e6fde){var _0x104c6b=function(_0x310fe6){while(--_0x310fe6){_0x5f33ec['push'](_0x5f33ec['shift']());}};_0x104c6b(++_0x3e6fde);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x23c73d,_0x357b21){_0x23c73d=_0x23c73d-0x0;var _0x36ba47=_0xcb91[_0x23c73d];return _0x36ba47;};'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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index bdea249..6410c56 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 _0x55d0=['exports','INTEGER'];(function(_0x2c41d6,_0x14b935){var _0x59cd8a=function(_0x300190){while(--_0x300190){_0x2c41d6['push'](_0x2c41d6['shift']());}};_0x59cd8a(++_0x14b935);}(_0x55d0,0x1ee));var _0x055d=function(_0x50b1c5,_0x1cf2a9){_0x50b1c5=_0x50b1c5-0x0;var _0x344f99=_0x55d0[_0x50b1c5];return _0x344f99;};'use strict';var Sequelize=require('sequelize');module[_0x055d('0x0')]={'penalty':{'type':Sequelize[_0x055d('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf8b2=['exports','INTEGER','sequelize'];(function(_0x32a73d,_0x5cdbc9){var _0x4d4942=function(_0x1a68c7){while(--_0x1a68c7){_0x32a73d['push'](_0x32a73d['shift']());}};_0x4d4942(++_0x5cdbc9);}(_0xf8b2,0x15e));var _0x2f8b=function(_0x29e683,_0x31f631){_0x29e683=_0x29e683-0x0;var _0x5a100c=_0xf8b2[_0x29e683];return _0x5a100c;};'use strict';var Sequelize=require(_0x2f8b('0x0'));module[_0x2f8b('0x1')]={'penalty':{'type':Sequelize[_0x2f8b('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 8f734f1..d0a4f2d 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 _0x858a=['../../config/environment','./userVoiceQueue.attributes','UserVoiceQueue','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x5be3cc,_0x5ae1b7){var _0x445d64=function(_0x2ba0fb){while(--_0x2ba0fb){_0x5be3cc['push'](_0x5be3cc['shift']());}};_0x445d64(++_0x5ae1b7);}(_0x858a,0xdf));var _0xa858=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x858a[_0x24061a];return _0x82054e;};'use strict';var _=require(_0xa858('0x0'));var util=require('util');var logger=require(_0xa858('0x1'))(_0xa858('0x2'));var moment=require(_0xa858('0x3'));var BPromise=require(_0xa858('0x4'));var rp=require(_0xa858('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa858('0x6'));var config=require(_0xa858('0x7'));var attributes=require(_0xa858('0x8'));module['exports']=function(_0x49ff04,_0x5f0290){return _0x49ff04['define'](_0xa858('0x9'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1fee=['exports','user_has_voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes'];(function(_0xcce960,_0x706200){var _0x5e5597=function(_0x567734){while(--_0x567734){_0xcce960['push'](_0xcce960['shift']());}};_0x5e5597(++_0x706200);}(_0x1fee,0x12e));var _0xe1fe=function(_0x36e831,_0x448d5e){_0x36e831=_0x36e831-0x0;var _0x201465=_0x1fee[_0x36e831];return _0x201465;};'use strict';var _=require(_0xe1fe('0x0'));var util=require(_0xe1fe('0x1'));var logger=require(_0xe1fe('0x2'))(_0xe1fe('0x3'));var moment=require(_0xe1fe('0x4'));var BPromise=require('bluebird');var rp=require(_0xe1fe('0x5'));var fs=require('fs');var path=require(_0xe1fe('0x6'));var rimraf=require(_0xe1fe('0x7'));var config=require(_0xe1fe('0x8'));var attributes=require(_0xe1fe('0x9'));module[_0xe1fe('0xa')]=function(_0x8b3fd,_0x3c5fb1){return _0x8b3fd['define']('UserVoiceQueue',attributes,{'tableName':_0xe1fe('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 99bd0bd..23e7aad 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 _0xcd01=['catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserVoiceQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result'];(function(_0x36e3e9,_0x25d82d){var _0x2e0623=function(_0x3a5760){while(--_0x3a5760){_0x36e3e9['push'](_0x36e3e9['shift']());}};_0x2e0623(++_0x25d82d);}(_0xcd01,0x1cf));var _0x1cd0=function(_0x18ee78,_0x5d1bf2){_0x18ee78=_0x18ee78-0x0;var _0x581884=_0xcd01[_0x18ee78];return _0x581884;};'use strict';var _=require(_0x1cd0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1cd0('0x1'));var rs=require(_0x1cd0('0x2'));var fs=require('fs');var Redis=require(_0x1cd0('0x3'));var db=require(_0x1cd0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1cd0('0x5'))(_0x1cd0('0x6'));var config=require(_0x1cd0('0x7'));var jayson=require(_0x1cd0('0x8'));var client=jayson[_0x1cd0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d10d9,_0x65c475,_0x541dab){return new BPromise(function(_0x1209bd,_0x55e41b){return client[_0x1cd0('0xa')](_0x2d10d9,_0x541dab)[_0x1cd0('0xb')](function(_0x28f464){logger[_0x1cd0('0xc')](_0x1cd0('0xd'),_0x65c475,'request\x20sent');logger[_0x1cd0('0xe')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x65c475,_0x1cd0('0xf'),JSON[_0x1cd0('0x10')](_0x28f464));if(_0x28f464['error']){if(_0x28f464[_0x1cd0('0x11')]['code']===0x1f4){logger[_0x1cd0('0x11')](_0x1cd0('0xd'),_0x65c475,_0x28f464['error']['message']);return _0x55e41b(_0x28f464[_0x1cd0('0x11')][_0x1cd0('0x12')]);}logger['error'](_0x1cd0('0xd'),_0x65c475,_0x28f464[_0x1cd0('0x11')][_0x1cd0('0x12')]);return _0x1209bd(_0x28f464[_0x1cd0('0x11')][_0x1cd0('0x12')]);}else{logger[_0x1cd0('0xc')](_0x1cd0('0xd'),_0x65c475,_0x1cd0('0xf'));_0x1209bd(_0x28f464[_0x1cd0('0x13')][_0x1cd0('0x12')]);}})[_0x1cd0('0x14')](function(_0x3a34ad){logger[_0x1cd0('0x11')](_0x1cd0('0xd'),_0x65c475,_0x3a34ad);_0x55e41b(_0x3a34ad);});});} \ No newline at end of file +var _0xe373=['request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserVoiceQueue,\x20%s,\x20%s'];(function(_0x5061ad,_0x4b076b){var _0x4ce894=function(_0xf9ad6d){while(--_0xf9ad6d){_0x5061ad['push'](_0x5061ad['shift']());}};_0x4ce894(++_0x4b076b);}(_0xe373,0x125));var _0x3e37=function(_0x2c5cd8,_0x3f462a){_0x2c5cd8=_0x2c5cd8-0x0;var _0x2e610b=_0xe373[_0x2c5cd8];return _0x2e610b;};'use strict';var _=require(_0x3e37('0x0'));var util=require('util');var moment=require(_0x3e37('0x1'));var BPromise=require(_0x3e37('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3e37('0x3'));var db=require(_0x3e37('0x4'))['db'];var utils=require(_0x3e37('0x5'));var logger=require(_0x3e37('0x6'))(_0x3e37('0x7'));var config=require(_0x3e37('0x8'));var jayson=require(_0x3e37('0x9'));var client=jayson[_0x3e37('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xce557e,_0x500ea4,_0x114510){return new BPromise(function(_0x2ff1fb,_0x5a875b){return client[_0x3e37('0xb')](_0xce557e,_0x114510)[_0x3e37('0xc')](function(_0x1d411e){logger[_0x3e37('0xd')](_0x3e37('0xe'),_0x500ea4,_0x3e37('0xf'));logger[_0x3e37('0x10')](_0x3e37('0x11'),_0x500ea4,_0x3e37('0xf'),JSON[_0x3e37('0x12')](_0x1d411e));if(_0x1d411e[_0x3e37('0x13')]){if(_0x1d411e[_0x3e37('0x13')]['code']===0x1f4){logger[_0x3e37('0x13')](_0x3e37('0xe'),_0x500ea4,_0x1d411e[_0x3e37('0x13')][_0x3e37('0x14')]);return _0x5a875b(_0x1d411e[_0x3e37('0x13')][_0x3e37('0x14')]);}logger[_0x3e37('0x13')]('UserVoiceQueue,\x20%s,\x20%s',_0x500ea4,_0x1d411e['error']['message']);return _0x2ff1fb(_0x1d411e[_0x3e37('0x13')][_0x3e37('0x14')]);}else{logger[_0x3e37('0xd')](_0x3e37('0xe'),_0x500ea4,_0x3e37('0xf'));_0x2ff1fb(_0x1d411e[_0x3e37('0x15')][_0x3e37('0x14')]);}})['catch'](function(_0x13d6d4){logger[_0x3e37('0x13')](_0x3e37('0xe'),_0x500ea4,_0x13d6d4);_0x5a875b(_0x13d6d4);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 44de1be..c384ab7 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x3d0528,_0x21a0b7){var _0x4ebb2d=function(_0x536ec8){while(--_0x536ec8){_0x3d0528['push'](_0x3d0528['shift']());}};_0x4ebb2d(++_0x21a0b7);}(_0x9c44,0x178));var _0x49c4=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x9c44[_0x1d9aa0];return _0x226868;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x1e28a1,_0x4fb2e0){var _0x408d2d=function(_0x4f2120){while(--_0x4f2120){_0x1e28a1['push'](_0x1e28a1['shift']());}};_0x408d2d(++_0x4fb2e0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index d9dafc7..f7b98e7 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 _0x7253=['sequelize','exports','Required\x20by\x20Asterisk','STRING','queue_interface','INTEGER'];(function(_0x290a56,_0x5c540a){var _0x89610=function(_0x4e901f){while(--_0x4e901f){_0x290a56['push'](_0x290a56['shift']());}};_0x89610(++_0x5c540a);}(_0x7253,0x1f2));var _0x3725=function(_0x1cd414,_0x2bcd9e){_0x1cd414=_0x1cd414-0x0;var _0x4048d6=_0x7253[_0x1cd414];return _0x4048d6;};'use strict';var Sequelize=require(_0x3725('0x0'));module[_0x3725('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x3725('0x2')},'membername':{'type':Sequelize[_0x3725('0x3')],'allowNull':![],'comment':_0x3725('0x2')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x3725('0x3')],'allowNull':![],'unique':_0x3725('0x4'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x3725('0x3')],'allowNull':![],'unique':_0x3725('0x4'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x3725('0x2')},'paused':{'type':Sequelize[_0x3725('0x5')](0xb),'defaultValue':0x0,'comment':_0x3725('0x2')}}; \ No newline at end of file +var _0x5291=['queue_interface','Required\x20by\x20Asterisk','sequelize','exports','INTEGER','STRING'];(function(_0x36bff5,_0x3156cb){var _0x80ade5=function(_0x5eee65){while(--_0x5eee65){_0x36bff5['push'](_0x36bff5['shift']());}};_0x80ade5(++_0x3156cb);}(_0x5291,0xda));var _0x1529=function(_0x184bf2,_0xf1db7f){_0x184bf2=_0x184bf2-0x0;var _0x2748c8=_0x5291[_0x184bf2];return _0x2748c8;};'use strict';var Sequelize=require(_0x1529('0x0'));module[_0x1529('0x1')]={'uniqueid':{'type':Sequelize[_0x1529('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0x1529('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x1529('0x3')],'allowNull':![],'unique':_0x1529('0x4'),'comment':_0x1529('0x5')},'VoiceQueueId':{'type':Sequelize[_0x1529('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1529('0x4'),'comment':_0x1529('0x5')},'penalty':{'type':Sequelize[_0x1529('0x2')](0xb),'defaultValue':0x0,'comment':_0x1529('0x5')},'paused':{'type':Sequelize[_0x1529('0x2')](0xb),'defaultValue':0x0,'comment':_0x1529('0x5')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index d8fcc2a..9b592db 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 _0x6814=['exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update','remove','emit','hook'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x6814,0x1c3));var _0x4681=function(_0x546bf5,_0x1a3a2e){_0x546bf5=_0x546bf5-0x0;var _0xc7dc0f=_0x6814[_0x546bf5];return _0xc7dc0f;};'use strict';var EventEmitter=require(_0x4681('0x0'));var UserVoiceQueueRt=require(_0x4681('0x1'))['db'][_0x4681('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x4681('0x3')](0x0);var events={'afterCreate':_0x4681('0x4'),'afterUpdate':_0x4681('0x5'),'afterDestroy':_0x4681('0x6')};function emitEvent(_0x21141a){return function(_0x9b7381,_0x4ebf6d,_0x49b2dd){UserVoiceQueueRtEvents[_0x4681('0x7')](_0x21141a+':'+_0x9b7381['id'],_0x9b7381);UserVoiceQueueRtEvents[_0x4681('0x7')](_0x21141a,_0x9b7381);_0x49b2dd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x4681('0x8')](e,emitEvent(event));}}module[_0x4681('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x8b1a=['exports','events','UserVoiceQueueRt','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x82d46a,_0x2eafa5){var _0x46dfd6=function(_0x4edc4a){while(--_0x4edc4a){_0x82d46a['push'](_0x82d46a['shift']());}};_0x46dfd6(++_0x2eafa5);}(_0x8b1a,0x10f));var _0xa8b1=function(_0x2682fd,_0xc583be){_0x2682fd=_0x2682fd-0x0;var _0x485276=_0x8b1a[_0x2682fd];return _0x485276;};'use strict';var EventEmitter=require(_0xa8b1('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0xa8b1('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xa8b1('0x2')](0x0);var events={'afterCreate':_0xa8b1('0x3'),'afterUpdate':_0xa8b1('0x4'),'afterDestroy':_0xa8b1('0x5')};function emitEvent(_0x2bc743){return function(_0x427f77,_0x53d8ef,_0x5da654){UserVoiceQueueRtEvents[_0xa8b1('0x6')](_0x2bc743+':'+_0x427f77['id'],_0x427f77);UserVoiceQueueRtEvents[_0xa8b1('0x6')](_0x2bc743,_0x427f77);_0x5da654(null);};}for(var e in events){if(events[_0xa8b1('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0xa8b1('0x8')](e,emitEvent(event));}}module[_0xa8b1('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index dca5c69..070aa0d 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 _0x17c0=['request-promise','path','rimraf','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','api','moment','bluebird'];(function(_0x579f0a,_0x443a5c){var _0x46d205=function(_0x1f9b04){while(--_0x1f9b04){_0x579f0a['push'](_0x579f0a['shift']());}};_0x46d205(++_0x443a5c);}(_0x17c0,0xc8));var _0x017c=function(_0x531d15,_0x599af5){_0x531d15=_0x531d15-0x0;var _0x271a18=_0x17c0[_0x531d15];return _0x271a18;};'use strict';var _=require(_0x017c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x017c('0x1'));var moment=require(_0x017c('0x2'));var BPromise=require(_0x017c('0x3'));var rp=require(_0x017c('0x4'));var fs=require('fs');var path=require(_0x017c('0x5'));var rimraf=require(_0x017c('0x6'));var config=require('../../config/environment');var attributes=require(_0x017c('0x7'));module[_0x017c('0x8')]=function(_0x2e2cdc,_0x31bc41){return _0x2e2cdc[_0x017c('0x9')](_0x017c('0xa'),attributes,{'tableName':_0x017c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc959=['user_has_voice_queues_rt','lodash','util','moment','bluebird','path','../../config/environment','./userVoiceQueueRt.attributes','define','UserVoiceQueueRt'];(function(_0x42d508,_0x265ea3){var _0x88fd77=function(_0x1307af){while(--_0x1307af){_0x42d508['push'](_0x42d508['shift']());}};_0x88fd77(++_0x265ea3);}(_0xc959,0x1af));var _0x9c95=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xc959[_0x32f7d7];return _0x133d09;};'use strict';var _=require(_0x9c95('0x0'));var util=require(_0x9c95('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9c95('0x2'));var BPromise=require(_0x9c95('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c95('0x4'));var rimraf=require('rimraf');var config=require(_0x9c95('0x5'));var attributes=require(_0x9c95('0x6'));module['exports']=function(_0x1e83d0,_0x45672c){return _0x1e83d0[_0x9c95('0x7')](_0x9c95('0x8'),attributes,{'tableName':_0x9c95('0x9'),'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 19e2677..8cbe7b2 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 _0x614f=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','request','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','UserVoiceQueueRt','findAll','options','raw','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','stringify','lodash','util','moment'];(function(_0x2a0012,_0x4418d6){var _0x5c1087=function(_0x12e6f7){while(--_0x12e6f7){_0x2a0012['push'](_0x2a0012['shift']());}};_0x5c1087(++_0x4418d6);}(_0x614f,0x1c5));var _0xf614=function(_0x4910b7,_0x206c59){_0x4910b7=_0x4910b7-0x0;var _0xb3f9ae=_0x614f[_0x4910b7];return _0xb3f9ae;};'use strict';var _=require(_0xf614('0x0'));var util=require(_0xf614('0x1'));var moment=require(_0xf614('0x2'));var BPromise=require('bluebird');var rs=require(_0xf614('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf614('0x4'))['db'];var utils=require(_0xf614('0x5'));var logger=require(_0xf614('0x6'))(_0xf614('0x7'));var config=require(_0xf614('0x8'));var jayson=require(_0xf614('0x9'));var client=jayson[_0xf614('0xa')]['http']({'port':0x232a});config[_0xf614('0xb')]=_[_0xf614('0xc')](config[_0xf614('0xb')],{'host':_0xf614('0xd'),'port':0x18eb});var socket=require(_0xf614('0xe'))(new Redis(config[_0xf614('0xb')]));require(_0xf614('0xf'))['register'](socket);function respondWithRpcPromise(_0x14a706,_0x1505e3,_0x11637c){return new BPromise(function(_0x4c0592,_0x2984d8){return client[_0xf614('0x10')](_0x14a706,_0x11637c)[_0xf614('0x11')](function(_0x2da38b){logger['info'](_0xf614('0x12'),_0x1505e3,_0xf614('0x13'));logger[_0xf614('0x14')](_0xf614('0x15'),_0x1505e3,_0xf614('0x13'),JSON['stringify'](_0x2da38b));if(_0x2da38b['error']){if(_0x2da38b[_0xf614('0x16')][_0xf614('0x17')]===0x1f4){logger[_0xf614('0x16')](_0xf614('0x12'),_0x1505e3,_0x2da38b['error']['message']);return _0x2984d8(_0x2da38b[_0xf614('0x16')]['message']);}logger['error'](_0xf614('0x12'),_0x1505e3,_0x2da38b[_0xf614('0x16')][_0xf614('0x18')]);return _0x4c0592(_0x2da38b[_0xf614('0x16')][_0xf614('0x18')]);}else{logger[_0xf614('0x19')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x1505e3,_0xf614('0x13'));_0x4c0592(_0x2da38b[_0xf614('0x1a')]['message']);}})[_0xf614('0x1b')](function(_0x567bcc){logger['error'](_0xf614('0x12'),_0x1505e3,_0x567bcc);_0x2984d8(_0x567bcc);});});}exports['GetVoiceQueueRtPauses']=function(_0x5696c6){var _0x20fb08=this;return new Promise(function(_0xa721df,_0x5022d7){return db[_0xf614('0x1c')][_0xf614('0x1d')]({'raw':_0x5696c6[_0xf614('0x1e')]?_0x5696c6[_0xf614('0x1e')][_0xf614('0x1f')]===undefined?!![]:![]:!![],'where':_0x5696c6['options']?_0x5696c6['options']['where']||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0xf614('0x20')]['fn']('IF',db[_0xf614('0x20')][_0xf614('0x21')](_0xf614('0x22')))),_0xf614('0x23')]]})[_0xf614('0x11')](function(_0x350f6b){logger[_0xf614('0x19')](_0xf614('0x24'),_0x5696c6);logger[_0xf614('0x14')]('GetVoiceQueueRtPauses',_0x5696c6,JSON[_0xf614('0x25')](_0x350f6b));_0xa721df(_0x350f6b);})[_0xf614('0x1b')](function(_0x50b25f){logger[_0xf614('0x16')]('GetVoiceQueueRtPauses',_0x50b25f['message'],_0x5696c6);_0x5022d7(_0x20fb08[_0xf614('0x16')](0x1f4,_0x50b25f[_0xf614('0x18')]));});});}; \ No newline at end of file +var _0x750d=['then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','message','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register'];(function(_0x506079,_0x2fac62){var _0x4365b2=function(_0x45dcfc){while(--_0x45dcfc){_0x506079['push'](_0x506079['shift']());}};_0x4365b2(++_0x2fac62);}(_0x750d,0x13b));var _0xd750=function(_0x3e8eb3,_0x12d894){_0x3e8eb3=_0x3e8eb3-0x0;var _0x2c222a=_0x750d[_0x3e8eb3];return _0x2c222a;};'use strict';var _=require(_0xd750('0x0'));var util=require('util');var moment=require(_0xd750('0x1'));var BPromise=require(_0xd750('0x2'));var rs=require(_0xd750('0x3'));var fs=require('fs');var Redis=require(_0xd750('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd750('0x5'));var logger=require(_0xd750('0x6'))(_0xd750('0x7'));var config=require('../../config/environment');var jayson=require(_0xd750('0x8'));var client=jayson[_0xd750('0x9')]['http']({'port':0x232a});config[_0xd750('0xa')]=_[_0xd750('0xb')](config[_0xd750('0xa')],{'host':_0xd750('0xc'),'port':0x18eb});var socket=require(_0xd750('0xd'))(new Redis(config['redis']));require('./userVoiceQueueRt.socket')[_0xd750('0xe')](socket);function respondWithRpcPromise(_0x450b75,_0x30d820,_0x6ab90c){return new BPromise(function(_0x267278,_0x5e448c){return client['request'](_0x450b75,_0x6ab90c)[_0xd750('0xf')](function(_0x20fd64){logger[_0xd750('0x10')](_0xd750('0x11'),_0x30d820,_0xd750('0x12'));logger[_0xd750('0x13')](_0xd750('0x14'),_0x30d820,'request\x20sent',JSON['stringify'](_0x20fd64));if(_0x20fd64[_0xd750('0x15')]){if(_0x20fd64[_0xd750('0x15')]['code']===0x1f4){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x30d820,_0x20fd64[_0xd750('0x15')]['message']);return _0x5e448c(_0x20fd64[_0xd750('0x15')][_0xd750('0x16')]);}logger[_0xd750('0x15')](_0xd750('0x11'),_0x30d820,_0x20fd64['error'][_0xd750('0x16')]);return _0x267278(_0x20fd64[_0xd750('0x15')][_0xd750('0x16')]);}else{logger[_0xd750('0x10')](_0xd750('0x11'),_0x30d820,_0xd750('0x12'));_0x267278(_0x20fd64['result'][_0xd750('0x16')]);}})['catch'](function(_0x3028cc){logger[_0xd750('0x15')](_0xd750('0x11'),_0x30d820,_0x3028cc);_0x5e448c(_0x3028cc);});});}exports[_0xd750('0x17')]=function(_0x643511){var _0x5996ac=this;return new Promise(function(_0xcc768,_0x50b2b0){return db[_0xd750('0x18')][_0xd750('0x19')]({'raw':_0x643511[_0xd750('0x1a')]?_0x643511[_0xd750('0x1a')][_0xd750('0x1b')]===undefined?!![]:![]:!![],'where':_0x643511['options']?_0x643511['options'][_0xd750('0x1c')]||null:null,'attributes':[[db[_0xd750('0x1d')]['fn'](_0xd750('0x1e'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xd750('0x1f')))),_0xd750('0x20')]]})[_0xd750('0xf')](function(_0x37f828){logger[_0xd750('0x10')](_0xd750('0x17'),_0x643511);logger[_0xd750('0x13')]('GetVoiceQueueRtPauses',_0x643511,JSON['stringify'](_0x37f828));_0xcc768(_0x37f828);})['catch'](function(_0x4db9f5){logger[_0xd750('0x15')](_0xd750('0x17'),_0x4db9f5[_0xd750('0x16')],_0x643511);_0x50b2b0(_0x5996ac[_0xd750('0x15')](0x1f4,_0x4db9f5[_0xd750('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 9388b62..b932d77 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 _0x7da7=['save','remove','register','userVoiceQueueRt:','./userVoiceQueueRt.events'];(function(_0x1a1cef,_0xd15501){var _0x531762=function(_0x1d3810){while(--_0x1d3810){_0x1a1cef['push'](_0x1a1cef['shift']());}};_0x531762(++_0xd15501);}(_0x7da7,0x10d));var _0x77da=function(_0x2af29a,_0x4f44bc){_0x2af29a=_0x2af29a-0x0;var _0x5ef02f=_0x7da7[_0x2af29a];return _0x5ef02f;};'use strict';var UserVoiceQueueRtEvents=require(_0x77da('0x0'));var events=[_0x77da('0x1'),_0x77da('0x2'),'update'];function createListener(_0x59892b,_0x37667b){return function(_0xaaefb1){_0x37667b['emit'](_0x59892b,_0xaaefb1);};}function removeListener(_0x3a9fa6,_0x37b3d9){return function(){UserVoiceQueueRtEvents['removeListener'](_0x3a9fa6,_0x37b3d9);};}exports[_0x77da('0x3')]=function(_0xc54a12){for(var _0x47da81=0x0,_0x30afe0=events['length'];_0x47da81<_0x30afe0;_0x47da81++){var _0x1191de=events[_0x47da81];var _0x13992e=createListener(_0x77da('0x4')+_0x1191de,_0xc54a12);UserVoiceQueueRtEvents['on'](_0x1191de,_0x13992e);}}; \ No newline at end of file +var _0xbea5=['emit','removeListener','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','update'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xbea5,0x177));var _0x5bea=function(_0x3522c8,_0x1e7c82){_0x3522c8=_0x3522c8-0x0;var _0x22f498=_0xbea5[_0x3522c8];return _0x22f498;};'use strict';var UserVoiceQueueRtEvents=require(_0x5bea('0x0'));var events=[_0x5bea('0x1'),'remove',_0x5bea('0x2')];function createListener(_0x45cd6f,_0x24c5f6){return function(_0x2837be){_0x24c5f6[_0x5bea('0x3')](_0x45cd6f,_0x2837be);};}function removeListener(_0x528183,_0x5cd985){return function(){UserVoiceQueueRtEvents[_0x5bea('0x4')](_0x528183,_0x5cd985);};}exports['register']=function(_0x156737){for(var _0x51ac31=0x0,_0x487888=events[_0x5bea('0x5')];_0x51ac31<_0x487888;_0x51ac31++){var _0x581c55=events[_0x51ac31];var _0x4b204d=createListener(_0x5bea('0x6')+_0x581c55,_0x156737);UserVoiceQueueRtEvents['on'](_0x581c55,_0x4b204d);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index ff79df5..3cca321 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x5d27ce,_0x5efbdb){var _0x1e33d2=function(_0x309940){while(--_0x309940){_0x5d27ce['push'](_0x5d27ce['shift']());}};_0x1e33d2(++_0x5efbdb);}(_0x70e0,0x17b));var _0x070e=function(_0x4ec4df,_0x4e6057){_0x4ec4df=_0x4ec4df-0x0;var _0x26ad1f=_0x70e0[_0x4ec4df];return _0x26ad1f;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x1d95d3,_0xadc054){var _0x379fc1=function(_0x2fe900){while(--_0x2fe900){_0x1d95d3['push'](_0x1d95d3['shift']());}};_0x379fc1(++_0xadc054);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x111e94,_0x31c837){_0x111e94=_0x111e94-0x0;var _0x3de107=_0xcb91[_0x111e94];return _0x3de107;};'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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 7553bb4..b4349ae 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 _0x39c8=['INTEGER','exports'];(function(_0x42af8d,_0x146e1a){var _0x2a2754=function(_0x2b7d26){while(--_0x2b7d26){_0x42af8d['push'](_0x42af8d['shift']());}};_0x2a2754(++_0x146e1a);}(_0x39c8,0x17d));var _0x839c=function(_0x1cfe2e,_0x1ebbcd){_0x1cfe2e=_0x1cfe2e-0x0;var _0x39233f=_0x39c8[_0x1cfe2e];return _0x39233f;};'use strict';var Sequelize=require('sequelize');module[_0x839c('0x0')]={'penalty':{'type':Sequelize[_0x839c('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd709=['exports','INTEGER','sequelize'];(function(_0x541f64,_0x222e09){var _0x2458f9=function(_0xdf2893){while(--_0xdf2893){_0x541f64['push'](_0x541f64['shift']());}};_0x2458f9(++_0x222e09);}(_0xd709,0x7d));var _0x9d70=function(_0x22f86f,_0xad1d43){_0x22f86f=_0x22f86f-0x0;var _0x486673=_0xd709[_0x22f86f];return _0x486673;};'use strict';var Sequelize=require(_0x9d70('0x0'));module[_0x9d70('0x1')]={'penalty':{'type':Sequelize[_0x9d70('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 048b538..e3c5424 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 _0xa5a2=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','UserWhatsappQueue','lodash'];(function(_0x1bc013,_0x7771c6){var _0x55df36=function(_0x1c02e0){while(--_0x1c02e0){_0x1bc013['push'](_0x1bc013['shift']());}};_0x55df36(++_0x7771c6);}(_0xa5a2,0x121));var _0x2a5a=function(_0x52bc24,_0x4a5a3f){_0x52bc24=_0x52bc24-0x0;var _0x39af1c=_0xa5a2[_0x52bc24];return _0x39af1c;};'use strict';var _=require(_0x2a5a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2a5a('0x1'));var moment=require(_0x2a5a('0x2'));var BPromise=require(_0x2a5a('0x3'));var rp=require(_0x2a5a('0x4'));var fs=require('fs');var path=require(_0x2a5a('0x5'));var rimraf=require(_0x2a5a('0x6'));var config=require(_0x2a5a('0x7'));var attributes=require('./userWhatsappQueue.attributes');module[_0x2a5a('0x8')]=function(_0x4c408a,_0x39842){return _0x4c408a['define'](_0x2a5a('0x9'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcc95=['api','moment','bluebird','request-promise','path','../../config/environment','./userWhatsappQueue.attributes','exports','lodash','util'];(function(_0x43b10d,_0x2f0aba){var _0xdc3f91=function(_0x2ea0f4){while(--_0x2ea0f4){_0x43b10d['push'](_0x43b10d['shift']());}};_0xdc3f91(++_0x2f0aba);}(_0xcc95,0x8a));var _0x5cc9=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0xcc95[_0x24259d];return _0x5a701;};'use strict';var _=require(_0x5cc9('0x0'));var util=require(_0x5cc9('0x1'));var logger=require('../../config/logger')(_0x5cc9('0x2'));var moment=require(_0x5cc9('0x3'));var BPromise=require(_0x5cc9('0x4'));var rp=require(_0x5cc9('0x5'));var fs=require('fs');var path=require(_0x5cc9('0x6'));var rimraf=require('rimraf');var config=require(_0x5cc9('0x7'));var attributes=require(_0x5cc9('0x8'));module[_0x5cc9('0x9')]=function(_0x43550f,_0x2709ba){return _0x43550f['define']('UserWhatsappQueue',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 40ba09e..5937831 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 _0xdc08=['jayson/promise','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x27bd45,_0x1f0aae){var _0x202374=function(_0x56cc6d){while(--_0x56cc6d){_0x27bd45['push'](_0x27bd45['shift']());}};_0x202374(++_0x1f0aae);}(_0xdc08,0x1d7));var _0x8dc0=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xdc08[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0x8dc0('0x0'));var util=require(_0x8dc0('0x1'));var moment=require(_0x8dc0('0x2'));var BPromise=require(_0x8dc0('0x3'));var rs=require(_0x8dc0('0x4'));var fs=require('fs');var Redis=require(_0x8dc0('0x5'));var db=require(_0x8dc0('0x6'))['db'];var utils=require(_0x8dc0('0x7'));var logger=require('../../config/logger')(_0x8dc0('0x8'));var config=require('../../config/environment');var jayson=require(_0x8dc0('0x9'));var client=jayson[_0x8dc0('0xa')][_0x8dc0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39eef2,_0x24c9dc,_0x44b542){return new BPromise(function(_0x2f5d3d,_0x280438){return client[_0x8dc0('0xc')](_0x39eef2,_0x44b542)[_0x8dc0('0xd')](function(_0x3511e9){logger[_0x8dc0('0xe')](_0x8dc0('0xf'),_0x24c9dc,_0x8dc0('0x10'));logger[_0x8dc0('0x11')](_0x8dc0('0x12'),_0x24c9dc,_0x8dc0('0x10'),JSON[_0x8dc0('0x13')](_0x3511e9));if(_0x3511e9[_0x8dc0('0x14')]){if(_0x3511e9[_0x8dc0('0x14')][_0x8dc0('0x15')]===0x1f4){logger['error'](_0x8dc0('0xf'),_0x24c9dc,_0x3511e9[_0x8dc0('0x14')][_0x8dc0('0x16')]);return _0x280438(_0x3511e9['error']['message']);}logger['error'](_0x8dc0('0xf'),_0x24c9dc,_0x3511e9[_0x8dc0('0x14')][_0x8dc0('0x16')]);return _0x2f5d3d(_0x3511e9[_0x8dc0('0x14')][_0x8dc0('0x16')]);}else{logger[_0x8dc0('0xe')]('UserWhatsappQueue,\x20%s,\x20%s',_0x24c9dc,_0x8dc0('0x10'));_0x2f5d3d(_0x3511e9[_0x8dc0('0x17')]['message']);}})['catch'](function(_0x1318e4){logger[_0x8dc0('0x14')](_0x8dc0('0xf'),_0x24c9dc,_0x1318e4);_0x280438(_0x1318e4);});});} \ No newline at end of file +var _0x320c=['request','then','info','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x46e1ef,_0x1ebbc2){var _0x34c79d=function(_0x1df960){while(--_0x1df960){_0x46e1ef['push'](_0x46e1ef['shift']());}};_0x34c79d(++_0x1ebbc2);}(_0x320c,0x1a4));var _0xc320=function(_0x5b1c7c,_0x241733){_0x5b1c7c=_0x5b1c7c-0x0;var _0x344bdd=_0x320c[_0x5b1c7c];return _0x344bdd;};'use strict';var _=require('lodash');var util=require(_0xc320('0x0'));var moment=require(_0xc320('0x1'));var BPromise=require(_0xc320('0x2'));var rs=require(_0xc320('0x3'));var fs=require('fs');var Redis=require(_0xc320('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc320('0x5'));var logger=require(_0xc320('0x6'))(_0xc320('0x7'));var config=require(_0xc320('0x8'));var jayson=require(_0xc320('0x9'));var client=jayson[_0xc320('0xa')][_0xc320('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d760c,_0x1a646d,_0x56becf){return new BPromise(function(_0x333587,_0x406475){return client[_0xc320('0xc')](_0x1d760c,_0x56becf)[_0xc320('0xd')](function(_0x30dc72){logger[_0xc320('0xe')]('UserWhatsappQueue,\x20%s,\x20%s',_0x1a646d,'request\x20sent');logger[_0xc320('0xf')](_0xc320('0x10'),_0x1a646d,'request\x20sent',JSON[_0xc320('0x11')](_0x30dc72));if(_0x30dc72[_0xc320('0x12')]){if(_0x30dc72[_0xc320('0x12')]['code']===0x1f4){logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x1a646d,_0x30dc72[_0xc320('0x12')][_0xc320('0x13')]);return _0x406475(_0x30dc72[_0xc320('0x12')][_0xc320('0x13')]);}logger['error'](_0xc320('0x14'),_0x1a646d,_0x30dc72[_0xc320('0x12')][_0xc320('0x13')]);return _0x333587(_0x30dc72[_0xc320('0x12')][_0xc320('0x13')]);}else{logger[_0xc320('0xe')](_0xc320('0x14'),_0x1a646d,_0xc320('0x15'));_0x333587(_0x30dc72[_0xc320('0x16')][_0xc320('0x13')]);}})[_0xc320('0x17')](function(_0x28b7e8){logger['error'](_0xc320('0x14'),_0x1a646d,_0x28b7e8);_0x406475(_0x28b7e8);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 3c4a5e0..b507917 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 _0x291c=['/:id','show','post','create','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','isAuthenticated'];(function(_0x19d982,_0x270be8){var _0x31b099=function(_0x358a5f){while(--_0x358a5f){_0x19d982['push'](_0x19d982['shift']());}};_0x31b099(++_0x270be8);}(_0x291c,0x137));var _0xc291=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x291c[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0xc291('0x0'));var util=require(_0xc291('0x1'));var path=require(_0xc291('0x2'));var timeout=require(_0xc291('0x3'));var express=require(_0xc291('0x4'));var router=express[_0xc291('0x5')]();var fs_extra=require(_0xc291('0x6'));var auth=require(_0xc291('0x7'));var interaction=require(_0xc291('0x8'));var config=require(_0xc291('0x9'));var controller=require(_0xc291('0xa'));router['get']('/',auth[_0xc291('0xb')](),controller['index']);router['get'](_0xc291('0xc'),auth[_0xc291('0xb')](),controller[_0xc291('0xd')]);router[_0xc291('0xe')]('/',auth['isAuthenticated'](),controller[_0xc291('0xf')]);router[_0xc291('0x10')](_0xc291('0xc'),auth[_0xc291('0xb')](),controller[_0xc291('0x11')]);router[_0xc291('0x12')](_0xc291('0xc'),auth[_0xc291('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb2ef=['Router','fs-extra','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','multer','util','path','express'];(function(_0x256d6a,_0x2f002f){var _0x460058=function(_0x195be7){while(--_0x195be7){_0x256d6a['push'](_0x256d6a['shift']());}};_0x460058(++_0x2f002f);}(_0xb2ef,0xa7));var _0xfb2e=function(_0x27c6bd,_0x540372){_0x27c6bd=_0x27c6bd-0x0;var _0x3bd051=_0xb2ef[_0x27c6bd];return _0x3bd051;};'use strict';var multer=require(_0xfb2e('0x0'));var util=require(_0xfb2e('0x1'));var path=require(_0xfb2e('0x2'));var timeout=require('connect-timeout');var express=require(_0xfb2e('0x3'));var router=express[_0xfb2e('0x4')]();var fs_extra=require(_0xfb2e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfb2e('0x6'));var config=require(_0xfb2e('0x7'));var controller=require(_0xfb2e('0x8'));router[_0xfb2e('0x9')]('/',auth[_0xfb2e('0xa')](),controller[_0xfb2e('0xb')]);router[_0xfb2e('0x9')](_0xfb2e('0xc'),auth[_0xfb2e('0xa')](),controller[_0xfb2e('0xd')]);router['post']('/',auth[_0xfb2e('0xa')](),controller[_0xfb2e('0xe')]);router[_0xfb2e('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xfb2e('0x10')]);router[_0xfb2e('0x11')]('/:id',auth[_0xfb2e('0xa')](),controller[_0xfb2e('0x12')]);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 29bad87..32f443c 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 _0x6fc3=['exports','STRING','name','sequelize'];(function(_0x58ac9b,_0x35dc04){var _0x12a47d=function(_0x2af5ce){while(--_0x2af5ce){_0x58ac9b['push'](_0x58ac9b['shift']());}};_0x12a47d(++_0x35dc04);}(_0x6fc3,0x117));var _0x36fc=function(_0x1fb8ff,_0x45d567){_0x1fb8ff=_0x1fb8ff-0x0;var _0x36a951=_0x6fc3[_0x1fb8ff];return _0x36a951;};'use strict';var Sequelize=require(_0x36fc('0x0'));module[_0x36fc('0x1')]={'name':{'type':Sequelize[_0x36fc('0x2')],'unique':_0x36fc('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x36fc('0x2')]}}; \ No newline at end of file +var _0xd756=['name','sequelize','STRING'];(function(_0x119f21,_0x57717a){var _0xf35465=function(_0x11ed2f){while(--_0x11ed2f){_0x119f21['push'](_0x119f21['shift']());}};_0xf35465(++_0x57717a);}(_0xd756,0xa3));var _0x6d75=function(_0x327665,_0x5dec8d){_0x327665=_0x327665-0x0;var _0x4d5109=_0xd756[_0x327665];return _0x4d5109;};'use strict';var Sequelize=require(_0x6d75('0x0'));module['exports']={'name':{'type':Sequelize[_0x6d75('0x1')],'unique':_0x6d75('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6d75('0x1')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 68ec950..ca203d4 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 _0x685b=['../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','then','destroy','get','Variables','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','Variable','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','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','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x470aae,_0x4bbc63){var _0x2e4495=function(_0x75afe0){while(--_0x75afe0){_0x470aae['push'](_0x470aae['shift']());}};_0x2e4495(++_0x4bbc63);}(_0x685b,0x95));var _0xb685=function(_0x2a5042,_0x307d04){_0x2a5042=_0x2a5042-0x0;var _0x4bc22f=_0x685b[_0x2a5042];return _0x4bc22f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb685('0x0'));var zipdir=require(_0xb685('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb685('0x2'));var util=require(_0xb685('0x3'));var path=require(_0xb685('0x4'));var sox=require(_0xb685('0x5'));var csv=require(_0xb685('0x6'));var ejs=require(_0xb685('0x7'));var fs=require('fs');var fs_extra=require(_0xb685('0x8'));var _=require(_0xb685('0x9'));var squel=require(_0xb685('0xa'));var crypto=require(_0xb685('0xb'));var jsforce=require(_0xb685('0xc'));var deskjs=require(_0xb685('0xd'));var toCsv=require(_0xb685('0x6'));var querystring=require(_0xb685('0xe'));var Papa=require(_0xb685('0xf'));var Redis=require(_0xb685('0x10'));var authService=require(_0xb685('0x11'));var qs=require(_0xb685('0x12'));var as=require(_0xb685('0x13'));var hardwareService=require(_0xb685('0x14'));var logger=require('../../config/logger')(_0xb685('0x15'));var utils=require(_0xb685('0x16'));var config=require(_0xb685('0x17'));var licenseUtil=require(_0xb685('0x18'));var db=require(_0xb685('0x19'))['db'];function respondWithStatusCode(_0x43bd4b,_0x329431){_0x329431=_0x329431||0xcc;return function(_0x202530){if(_0x202530){return _0x43bd4b['sendStatus'](_0x329431);}return _0x43bd4b[_0xb685('0x1a')](_0x329431)[_0xb685('0x1b')]();};}function respondWithResult(_0x5bc3c5,_0x2fa10f){_0x2fa10f=_0x2fa10f||0xc8;return function(_0x5e386e){if(_0x5e386e){return _0x5bc3c5[_0xb685('0x1a')](_0x2fa10f)[_0xb685('0x1c')](_0x5e386e);}};}function respondWithFilteredResult(_0x59b43f,_0x291330){return function(_0x58cb4b){if(_0x58cb4b){var _0x44e558=typeof _0x291330[_0xb685('0x1d')]===_0xb685('0x1e')&&typeof _0x291330[_0xb685('0x1f')]===_0xb685('0x1e');var _0x550fff=_0x58cb4b[_0xb685('0x20')];var _0x44cc1=_0x44e558?0x0:_0x291330[_0xb685('0x1d')];var _0x2af921=_0x44e558?_0x58cb4b[_0xb685('0x20')]:_0x291330[_0xb685('0x1d')]+_0x291330[_0xb685('0x1f')];var _0x28b777;if(_0x2af921>=_0x550fff){_0x2af921=_0x550fff;_0x28b777=0xc8;}else{_0x28b777=0xce;}_0x59b43f[_0xb685('0x1a')](_0x28b777);return _0x59b43f['set'](_0xb685('0x21'),_0x44cc1+'-'+_0x2af921+'/'+_0x550fff)['json'](_0x58cb4b);}return null;};}function patchUpdates(_0x546d4d){return function(_0x4da36c){try{jsonpatch[_0xb685('0x22')](_0x4da36c,_0x546d4d,!![]);}catch(_0x40af9c){return BPromise['reject'](_0x40af9c);}return _0x4da36c[_0xb685('0x23')]();};}function saveUpdates(_0x342bce,_0x181e59){return function(_0x51f571){if(_0x51f571){return _0x51f571['update'](_0x342bce)[_0xb685('0x24')](function(_0xebc20f){return _0xebc20f;});}return null;};}function removeEntity(_0x1dceb3,_0x2c1744){return function(_0x11d47c){if(_0x11d47c){return _0x11d47c[_0xb685('0x25')]()[_0xb685('0x24')](function(){var _0x4eac52=_0x11d47c[_0xb685('0x26')]({'plain':!![]});var _0x178c7e=_0xb685('0x27');return db['UserProfileResource'][_0xb685('0x25')]({'where':{'type':_0x178c7e,'resourceId':_0x4eac52['id']}})['then'](function(){return _0x11d47c;});})['then'](function(){_0x1dceb3[_0xb685('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56dc21,_0xbc826c){return function(_0x3d19b7){if(!_0x3d19b7){_0x56dc21[_0xb685('0x28')](0x194);}return _0x3d19b7;};}function handleError(_0x403624,_0xce3f3f){_0xce3f3f=_0xce3f3f||0x1f4;return function(_0x46d0d0){logger['error'](_0x46d0d0[_0xb685('0x29')]);if(_0x46d0d0[_0xb685('0x2a')]){delete _0x46d0d0['name'];}_0x403624[_0xb685('0x1a')](_0xce3f3f)[_0xb685('0x2b')](_0x46d0d0);};}exports[_0xb685('0x2c')]=function(_0x195f02,_0x3c4f9c){var _0x40348b={},_0x559040={},_0x365609={'count':0x0,'rows':[]};var _0x352159=_[_0xb685('0x2d')](db['Variable'][_0xb685('0x2e')],function(_0x556b21){return{'name':_0x556b21[_0xb685('0x2f')],'type':_0x556b21[_0xb685('0x30')][_0xb685('0x31')]};});_0x559040['model']=_[_0xb685('0x2d')](_0x352159,_0xb685('0x2a'));_0x559040[_0xb685('0x32')]=_['keys'](_0x195f02[_0xb685('0x32')]);_0x559040[_0xb685('0x33')]=_[_0xb685('0x34')](_0x559040[_0xb685('0x35')],_0x559040[_0xb685('0x32')]);_0x40348b[_0xb685('0x36')]=_['intersection'](_0x559040[_0xb685('0x35')],qs[_0xb685('0x37')](_0x195f02[_0xb685('0x32')]['fields']));_0x40348b[_0xb685('0x36')]=_0x40348b[_0xb685('0x36')][_0xb685('0x38')]?_0x40348b[_0xb685('0x36')]:_0x559040[_0xb685('0x35')];if(!_0x195f02[_0xb685('0x32')][_0xb685('0x39')](_0xb685('0x3a'))){_0x40348b[_0xb685('0x1f')]=qs[_0xb685('0x1f')](_0x195f02[_0xb685('0x32')][_0xb685('0x1f')]);_0x40348b[_0xb685('0x1d')]=qs['offset'](_0x195f02['query']['offset']);}_0x40348b[_0xb685('0x3b')]=qs[_0xb685('0x3c')](_0x195f02[_0xb685('0x32')][_0xb685('0x3c')]);_0x40348b[_0xb685('0x3d')]=qs[_0xb685('0x33')](_[_0xb685('0x3e')](_0x195f02[_0xb685('0x32')],_0x559040[_0xb685('0x33')]),_0x352159);if(_0x195f02[_0xb685('0x32')][_0xb685('0x3f')]){_0x40348b[_0xb685('0x3d')]=_['merge'](_0x40348b['where'],{'$or':_['map'](_0x352159,function(_0x597106){if(_0x597106[_0xb685('0x30')]!==_0xb685('0x40')){var _0x16d280={};_0x16d280[_0x597106[_0xb685('0x2a')]]={'$like':'%'+_0x195f02[_0xb685('0x32')][_0xb685('0x3f')]+'%'};return _0x16d280;}})});}_0x40348b=_[_0xb685('0x41')]({},_0x40348b,_0x195f02[_0xb685('0x42')]);var _0x38882f={'where':_0x40348b[_0xb685('0x3d')]};return db['Variable'][_0xb685('0x20')](_0x38882f)[_0xb685('0x24')](function(_0x2fa130){_0x365609['count']=_0x2fa130;if(_0x195f02[_0xb685('0x32')][_0xb685('0x43')]){_0x40348b[_0xb685('0x44')]=[{'all':!![]}];}return db['Variable'][_0xb685('0x45')](_0x40348b);})[_0xb685('0x24')](function(_0x58daf1){_0x365609[_0xb685('0x46')]=_0x58daf1;return _0x365609;})[_0xb685('0x24')](respondWithFilteredResult(_0x3c4f9c,_0x40348b))[_0xb685('0x47')](handleError(_0x3c4f9c,null));};exports[_0xb685('0x48')]=function(_0x5444fd,_0x257044){var _0x5a3d83={'raw':!![],'where':{'id':_0x5444fd[_0xb685('0x49')]['id']}},_0x61ac5b={};_0x61ac5b['model']=_[_0xb685('0x4a')](db['Variable'][_0xb685('0x2e')]);_0x61ac5b['query']=_['keys'](_0x5444fd[_0xb685('0x32')]);_0x61ac5b['filters']=_[_0xb685('0x34')](_0x61ac5b[_0xb685('0x35')],_0x61ac5b[_0xb685('0x32')]);_0x5a3d83[_0xb685('0x36')]=_[_0xb685('0x34')](_0x61ac5b[_0xb685('0x35')],qs['fields'](_0x5444fd[_0xb685('0x32')][_0xb685('0x37')]));_0x5a3d83['attributes']=_0x5a3d83[_0xb685('0x36')][_0xb685('0x38')]?_0x5a3d83[_0xb685('0x36')]:_0x61ac5b[_0xb685('0x35')];if(_0x5444fd[_0xb685('0x32')][_0xb685('0x43')]){_0x5a3d83[_0xb685('0x44')]=[{'all':!![]}];}_0x5a3d83=_[_0xb685('0x41')]({},_0x5a3d83,_0x5444fd[_0xb685('0x42')]);return db[_0xb685('0x4b')][_0xb685('0x4c')](_0x5a3d83)['then'](handleEntityNotFound(_0x257044,null))[_0xb685('0x24')](respondWithResult(_0x257044,null))['catch'](handleError(_0x257044,null));};exports[_0xb685('0x4d')]=function(_0x5a7e62,_0x50e161){return db[_0xb685('0x4b')][_0xb685('0x4d')](_0x5a7e62[_0xb685('0x4e')],{})[_0xb685('0x24')](function(_0xbd4d7a){var _0x306358=_0x5a7e62[_0xb685('0x4f')]['get']({'plain':!![]});if(!_0x306358)throw new Error(_0xb685('0x50'));if(_0x306358['role']===_0xb685('0x4f')){var _0x868db=_0xbd4d7a[_0xb685('0x26')]({'plain':!![]});var _0x1af83b=_0xb685('0x27');return db[_0xb685('0x51')][_0xb685('0x4c')]({'where':{'name':_0x1af83b,'userProfileId':_0x306358[_0xb685('0x52')]},'raw':!![]})[_0xb685('0x24')](function(_0x5727b2){if(_0x5727b2&&_0x5727b2[_0xb685('0x53')]===0x0){return db[_0xb685('0x54')][_0xb685('0x4d')]({'name':_0x868db[_0xb685('0x2a')],'resourceId':_0x868db['id'],'type':_0x5727b2[_0xb685('0x2a')],'sectionId':_0x5727b2['id']},{})['then'](function(){return _0xbd4d7a;});}else{return _0xbd4d7a;}})[_0xb685('0x47')](function(_0x53fcb2){logger[_0xb685('0x55')](_0xb685('0x56'),_0x53fcb2);throw _0x53fcb2;});}return _0xbd4d7a;})[_0xb685('0x24')](respondWithResult(_0x50e161,0xc9))['catch'](handleError(_0x50e161,null));};exports['update']=function(_0x5a5f7d,_0x31ef0b){if(_0x5a5f7d[_0xb685('0x4e')]['id']){delete _0x5a5f7d['body']['id'];}return db[_0xb685('0x4b')][_0xb685('0x4c')]({'where':{'id':_0x5a5f7d[_0xb685('0x49')]['id']}})[_0xb685('0x24')](handleEntityNotFound(_0x31ef0b,null))[_0xb685('0x24')](saveUpdates(_0x5a5f7d[_0xb685('0x4e')],null))[_0xb685('0x24')](respondWithResult(_0x31ef0b,null))[_0xb685('0x47')](handleError(_0x31ef0b,null));};exports[_0xb685('0x25')]=function(_0x343160,_0x3d72be){return db[_0xb685('0x4b')][_0xb685('0x4c')]({'where':{'id':_0x343160[_0xb685('0x49')]['id']}})['then'](handleEntityNotFound(_0x3d72be,null))[_0xb685('0x24')](removeEntity(_0x3d72be,null))[_0xb685('0x47')](handleError(_0x3d72be,null));}; \ No newline at end of file +var _0xeb36=['where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','Variable','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','moment','path','sox','to-csv','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Variables','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','nolimit','sort'];(function(_0x3c5687,_0x123151){var _0x20051c=function(_0x3f269d){while(--_0x3f269d){_0x3c5687['push'](_0x3c5687['shift']());}};_0x20051c(++_0x123151);}(_0xeb36,0xb8));var _0x6eb3=function(_0x499396,_0x33a919){_0x499396=_0x499396-0x0;var _0x542891=_0xeb36[_0x499396];return _0x542891;};'use strict';var emlformat=require(_0x6eb3('0x0'));var rimraf=require(_0x6eb3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6eb3('0x2'));var rp=require('request-promise');var moment=require(_0x6eb3('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x6eb3('0x4'));var sox=require(_0x6eb3('0x5'));var csv=require(_0x6eb3('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6eb3('0x7'));var jsforce=require(_0x6eb3('0x8'));var deskjs=require(_0x6eb3('0x9'));var toCsv=require('to-csv');var querystring=require(_0x6eb3('0xa'));var Papa=require('papaparse');var Redis=require(_0x6eb3('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x6eb3('0xc'));var as=require(_0x6eb3('0xd'));var hardwareService=require(_0x6eb3('0xe'));var logger=require(_0x6eb3('0xf'))('api');var utils=require(_0x6eb3('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x6eb3('0x11'));var db=require(_0x6eb3('0x12'))['db'];function respondWithStatusCode(_0x4b1dd9,_0x56d46e){_0x56d46e=_0x56d46e||0xcc;return function(_0x711b69){if(_0x711b69){return _0x4b1dd9[_0x6eb3('0x13')](_0x56d46e);}return _0x4b1dd9['status'](_0x56d46e)[_0x6eb3('0x14')]();};}function respondWithResult(_0x5ac936,_0x180a46){_0x180a46=_0x180a46||0xc8;return function(_0x3c6abb){if(_0x3c6abb){return _0x5ac936[_0x6eb3('0x15')](_0x180a46)[_0x6eb3('0x16')](_0x3c6abb);}};}function respondWithFilteredResult(_0x2cb362,_0x1b27fa){return function(_0x2ced98){if(_0x2ced98){var _0x3057de=typeof _0x1b27fa['offset']==='undefined'&&typeof _0x1b27fa[_0x6eb3('0x17')]===_0x6eb3('0x18');var _0x3f3b10=_0x2ced98['count'];var _0x16f6d7=_0x3057de?0x0:_0x1b27fa[_0x6eb3('0x19')];var _0x5b326f=_0x3057de?_0x2ced98[_0x6eb3('0x1a')]:_0x1b27fa[_0x6eb3('0x19')]+_0x1b27fa[_0x6eb3('0x17')];var _0x364654;if(_0x5b326f>=_0x3f3b10){_0x5b326f=_0x3f3b10;_0x364654=0xc8;}else{_0x364654=0xce;}_0x2cb362[_0x6eb3('0x15')](_0x364654);return _0x2cb362[_0x6eb3('0x1b')](_0x6eb3('0x1c'),_0x16f6d7+'-'+_0x5b326f+'/'+_0x3f3b10)[_0x6eb3('0x16')](_0x2ced98);}return null;};}function patchUpdates(_0x58687c){return function(_0x393d5a){try{jsonpatch[_0x6eb3('0x1d')](_0x393d5a,_0x58687c,!![]);}catch(_0x39bb61){return BPromise[_0x6eb3('0x1e')](_0x39bb61);}return _0x393d5a[_0x6eb3('0x1f')]();};}function saveUpdates(_0x3b2a53,_0xc4fae9){return function(_0x47698e){if(_0x47698e){return _0x47698e[_0x6eb3('0x20')](_0x3b2a53)[_0x6eb3('0x21')](function(_0x17d54e){return _0x17d54e;});}return null;};}function removeEntity(_0x238ed0,_0x2d6812){return function(_0x1b3b31){if(_0x1b3b31){return _0x1b3b31[_0x6eb3('0x22')]()['then'](function(){var _0x157e2d=_0x1b3b31[_0x6eb3('0x23')]({'plain':!![]});var _0x497884=_0x6eb3('0x24');return db[_0x6eb3('0x25')][_0x6eb3('0x22')]({'where':{'type':_0x497884,'resourceId':_0x157e2d['id']}})[_0x6eb3('0x21')](function(){return _0x1b3b31;});})[_0x6eb3('0x21')](function(){_0x238ed0[_0x6eb3('0x15')](0xcc)[_0x6eb3('0x14')]();});}};}function handleEntityNotFound(_0x56e2ed,_0x4294fb){return function(_0x5c9084){if(!_0x5c9084){_0x56e2ed[_0x6eb3('0x13')](0x194);}return _0x5c9084;};}function handleError(_0x43b9f3,_0x2ababf){_0x2ababf=_0x2ababf||0x1f4;return function(_0x47c450){logger[_0x6eb3('0x26')](_0x47c450[_0x6eb3('0x27')]);if(_0x47c450[_0x6eb3('0x28')]){delete _0x47c450['name'];}_0x43b9f3[_0x6eb3('0x15')](_0x2ababf)[_0x6eb3('0x29')](_0x47c450);};}exports[_0x6eb3('0x2a')]=function(_0xbb7ba,_0x13780c){var _0x55ddf1={},_0x3553c3={},_0x159eb4={'count':0x0,'rows':[]};var _0x36151c=_[_0x6eb3('0x2b')](db['Variable'][_0x6eb3('0x2c')],function(_0x26ef6b){return{'name':_0x26ef6b[_0x6eb3('0x2d')],'type':_0x26ef6b['type'][_0x6eb3('0x2e')]};});_0x3553c3[_0x6eb3('0x2f')]=_[_0x6eb3('0x2b')](_0x36151c,'name');_0x3553c3[_0x6eb3('0x30')]=_[_0x6eb3('0x31')](_0xbb7ba[_0x6eb3('0x30')]);_0x3553c3['filters']=_['intersection'](_0x3553c3[_0x6eb3('0x2f')],_0x3553c3['query']);_0x55ddf1['attributes']=_[_0x6eb3('0x32')](_0x3553c3[_0x6eb3('0x2f')],qs['fields'](_0xbb7ba[_0x6eb3('0x30')][_0x6eb3('0x33')]));_0x55ddf1[_0x6eb3('0x34')]=_0x55ddf1[_0x6eb3('0x34')][_0x6eb3('0x35')]?_0x55ddf1[_0x6eb3('0x34')]:_0x3553c3[_0x6eb3('0x2f')];if(!_0xbb7ba[_0x6eb3('0x30')]['hasOwnProperty'](_0x6eb3('0x36'))){_0x55ddf1['limit']=qs[_0x6eb3('0x17')](_0xbb7ba[_0x6eb3('0x30')][_0x6eb3('0x17')]);_0x55ddf1['offset']=qs[_0x6eb3('0x19')](_0xbb7ba[_0x6eb3('0x30')][_0x6eb3('0x19')]);}_0x55ddf1['order']=qs[_0x6eb3('0x37')](_0xbb7ba[_0x6eb3('0x30')][_0x6eb3('0x37')]);_0x55ddf1[_0x6eb3('0x38')]=qs[_0x6eb3('0x39')](_['pick'](_0xbb7ba[_0x6eb3('0x30')],_0x3553c3[_0x6eb3('0x39')]),_0x36151c);if(_0xbb7ba[_0x6eb3('0x30')][_0x6eb3('0x3a')]){_0x55ddf1[_0x6eb3('0x38')]=_[_0x6eb3('0x3b')](_0x55ddf1[_0x6eb3('0x38')],{'$or':_[_0x6eb3('0x2b')](_0x36151c,function(_0x4e0888){if(_0x4e0888[_0x6eb3('0x3c')]!==_0x6eb3('0x3d')){var _0x12d158={};_0x12d158[_0x4e0888[_0x6eb3('0x28')]]={'$like':'%'+_0xbb7ba['query'][_0x6eb3('0x3a')]+'%'};return _0x12d158;}})});}_0x55ddf1=_['merge']({},_0x55ddf1,_0xbb7ba[_0x6eb3('0x3e')]);var _0x4edb56={'where':_0x55ddf1[_0x6eb3('0x38')]};return db['Variable']['count'](_0x4edb56)['then'](function(_0x1745df){_0x159eb4[_0x6eb3('0x1a')]=_0x1745df;if(_0xbb7ba[_0x6eb3('0x30')][_0x6eb3('0x3f')]){_0x55ddf1[_0x6eb3('0x40')]=[{'all':!![]}];}return db[_0x6eb3('0x41')][_0x6eb3('0x42')](_0x55ddf1);})[_0x6eb3('0x21')](function(_0x1e909d){_0x159eb4[_0x6eb3('0x43')]=_0x1e909d;return _0x159eb4;})[_0x6eb3('0x21')](respondWithFilteredResult(_0x13780c,_0x55ddf1))[_0x6eb3('0x44')](handleError(_0x13780c,null));};exports['show']=function(_0x1698df,_0x494231){var _0x48417f={'raw':!![],'where':{'id':_0x1698df[_0x6eb3('0x45')]['id']}},_0x1b62c9={};_0x1b62c9[_0x6eb3('0x2f')]=_[_0x6eb3('0x31')](db[_0x6eb3('0x41')][_0x6eb3('0x2c')]);_0x1b62c9['query']=_[_0x6eb3('0x31')](_0x1698df[_0x6eb3('0x30')]);_0x1b62c9[_0x6eb3('0x39')]=_[_0x6eb3('0x32')](_0x1b62c9[_0x6eb3('0x2f')],_0x1b62c9[_0x6eb3('0x30')]);_0x48417f['attributes']=_[_0x6eb3('0x32')](_0x1b62c9[_0x6eb3('0x2f')],qs[_0x6eb3('0x33')](_0x1698df['query']['fields']));_0x48417f[_0x6eb3('0x34')]=_0x48417f[_0x6eb3('0x34')][_0x6eb3('0x35')]?_0x48417f[_0x6eb3('0x34')]:_0x1b62c9[_0x6eb3('0x2f')];if(_0x1698df['query'][_0x6eb3('0x3f')]){_0x48417f[_0x6eb3('0x40')]=[{'all':!![]}];}_0x48417f=_[_0x6eb3('0x3b')]({},_0x48417f,_0x1698df['options']);return db[_0x6eb3('0x41')][_0x6eb3('0x46')](_0x48417f)[_0x6eb3('0x21')](handleEntityNotFound(_0x494231,null))[_0x6eb3('0x21')](respondWithResult(_0x494231,null))[_0x6eb3('0x44')](handleError(_0x494231,null));};exports[_0x6eb3('0x47')]=function(_0x1b3c25,_0x3ff778){return db['Variable'][_0x6eb3('0x47')](_0x1b3c25[_0x6eb3('0x48')],{})['then'](function(_0x3d5be0){var _0x31f271=_0x1b3c25[_0x6eb3('0x49')][_0x6eb3('0x23')]({'plain':!![]});if(!_0x31f271)throw new Error(_0x6eb3('0x4a'));if(_0x31f271[_0x6eb3('0x4b')]===_0x6eb3('0x49')){var _0x1dc982=_0x3d5be0[_0x6eb3('0x23')]({'plain':!![]});var _0x326c59=_0x6eb3('0x24');return db[_0x6eb3('0x4c')]['find']({'where':{'name':_0x326c59,'userProfileId':_0x31f271[_0x6eb3('0x4d')]},'raw':!![]})[_0x6eb3('0x21')](function(_0x28a72d){if(_0x28a72d&&_0x28a72d[_0x6eb3('0x4e')]===0x0){return db[_0x6eb3('0x25')]['create']({'name':_0x1dc982[_0x6eb3('0x28')],'resourceId':_0x1dc982['id'],'type':_0x28a72d['name'],'sectionId':_0x28a72d['id']},{})[_0x6eb3('0x21')](function(){return _0x3d5be0;});}else{return _0x3d5be0;}})[_0x6eb3('0x44')](function(_0x5c798f){logger[_0x6eb3('0x26')](_0x6eb3('0x4f'),_0x5c798f);throw _0x5c798f;});}return _0x3d5be0;})[_0x6eb3('0x21')](respondWithResult(_0x3ff778,0xc9))[_0x6eb3('0x44')](handleError(_0x3ff778,null));};exports[_0x6eb3('0x20')]=function(_0x3fa3c7,_0xd8672a){if(_0x3fa3c7[_0x6eb3('0x48')]['id']){delete _0x3fa3c7[_0x6eb3('0x48')]['id'];}return db[_0x6eb3('0x41')][_0x6eb3('0x46')]({'where':{'id':_0x3fa3c7['params']['id']}})['then'](handleEntityNotFound(_0xd8672a,null))[_0x6eb3('0x21')](saveUpdates(_0x3fa3c7[_0x6eb3('0x48')],null))[_0x6eb3('0x21')](respondWithResult(_0xd8672a,null))[_0x6eb3('0x44')](handleError(_0xd8672a,null));};exports[_0x6eb3('0x22')]=function(_0x4c16c5,_0x2251d0){return db['Variable']['find']({'where':{'id':_0x4c16c5[_0x6eb3('0x45')]['id']}})[_0x6eb3('0x21')](handleEntityNotFound(_0x2251d0,null))[_0x6eb3('0x21')](removeEntity(_0x2251d0,null))[_0x6eb3('0x44')](handleError(_0x2251d0,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 62c41ce..5b0f719 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 _0x7623=['./variable.attributes','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x7623,0x76));var _0x3762=function(_0x596de3,_0xf801c0){_0x596de3=_0x596de3-0x0;var _0xbf541f=_0x7623[_0x596de3];return _0xbf541f;};'use strict';var _=require(_0x3762('0x0'));var util=require('util');var logger=require(_0x3762('0x1'))(_0x3762('0x2'));var moment=require(_0x3762('0x3'));var BPromise=require(_0x3762('0x4'));var rp=require(_0x3762('0x5'));var fs=require('fs');var path=require(_0x3762('0x6'));var rimraf=require(_0x3762('0x7'));var config=require('../../config/environment');var attributes=require(_0x3762('0x8'));module['exports']=function(_0x4627f9,_0x546633){return _0x4627f9['define']('Variable',attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaba7=['bluebird','request-promise','path','../../config/environment','./variable.attributes','exports','define','Variable','lodash','util','../../config/logger','moment'];(function(_0x3a833e,_0x5a1878){var _0xdff445=function(_0x1715a3){while(--_0x1715a3){_0x3a833e['push'](_0x3a833e['shift']());}};_0xdff445(++_0x5a1878);}(_0xaba7,0x1f4));var _0x7aba=function(_0x337d3a,_0x297363){_0x337d3a=_0x337d3a-0x0;var _0x3bc3be=_0xaba7[_0x337d3a];return _0x3bc3be;};'use strict';var _=require(_0x7aba('0x0'));var util=require(_0x7aba('0x1'));var logger=require(_0x7aba('0x2'))('api');var moment=require(_0x7aba('0x3'));var BPromise=require(_0x7aba('0x4'));var rp=require(_0x7aba('0x5'));var fs=require('fs');var path=require(_0x7aba('0x6'));var rimraf=require('rimraf');var config=require(_0x7aba('0x7'));var attributes=require(_0x7aba('0x8'));module[_0x7aba('0x9')]=function(_0x1c4114,_0xd3ee54){return _0x1c4114[_0x7aba('0xa')](_0x7aba('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 685a345..a0d7136 100644 --- a/server/api/variable/variable.rpc.js +++ b/server/api/variable/variable.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['info','request\x20sent','debug','stringify','error','code','message','Variable,\x20%s,\x20%s','result','catch','ShowVariable','find','options','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x1dd4de,_0x189290){var _0xf23408=function(_0x1b47e2){while(--_0x1b47e2){_0x1dd4de['push'](_0x1dd4de['shift']());}};_0xf23408(++_0x189290);}(_0x5fc3,0xa8));var _0x35fc=function(_0x47c5bf,_0x45977e){_0x47c5bf=_0x47c5bf-0x0;var _0x11b779=_0x5fc3[_0x47c5bf];return _0x11b779;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Variable,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Variable,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Variable,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}exports[_0x35fc('0x16')]=function(_0x553677){var _0x41e165=this;return new Promise(function(_0x363e47,_0x2e513b){return db['Variable'][_0x35fc('0x17')]({'raw':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x19')]||null:null,'attributes':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1a')]||null:null,'include':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x553677['options'][_0x35fc('0x1b')],function(_0xd5399f){return{'model':db[_0xd5399f[_0x35fc('0x1d')]],'as':_0xd5399f['as'],'attributes':_0xd5399f[_0x35fc('0x1a')],'include':_0xd5399f[_0x35fc('0x1b')]?_['map'](_0xd5399f[_0x35fc('0x1b')],function(_0x4c587a){return{'model':db[_0x4c587a['model']],'as':_0x4c587a['as'],'attributes':_0x4c587a[_0x35fc('0x1a')],'include':_0x4c587a[_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x4c587a['include'],function(_0x4086e9){return{'model':db[_0x4086e9['model']],'as':_0x4086e9['as'],'attributes':_0x4086e9[_0x35fc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x35fc('0xb')](function(_0x5cb986){logger['info'](_0x35fc('0x16'),_0x553677);logger['debug'](_0x35fc('0x16'),_0x553677,JSON[_0x35fc('0xf')](_0x5cb986));_0x363e47(_0x5cb986);})['catch'](function(_0x26b7cb){logger[_0x35fc('0x10')](_0x35fc('0x16'),_0x26b7cb[_0x35fc('0x12')],_0x553677);_0x2e513b(_0x41e165[_0x35fc('0x10')](0x1f4,_0x26b7cb[_0x35fc('0x12')]));});});}; \ No newline at end of file +var _0x3e74=['catch','Variable','find','options','raw','where','attributes','include','map','model','then','ShowVariable','stringify','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','Variable,\x20%s,\x20%s','message','info'];(function(_0x219729,_0x19f07d){var _0x35c464=function(_0x3c412c){while(--_0x3c412c){_0x219729['push'](_0x219729['shift']());}};_0x35c464(++_0x19f07d);}(_0x3e74,0x175));var _0x43e7=function(_0x77eae7,_0x372be0){_0x77eae7=_0x77eae7-0x0;var _0x6b99ad=_0x3e74[_0x77eae7];return _0x6b99ad;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('Variable,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('Variable,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('Variable,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});}exports['ShowVariable']=function(_0x446986){var _0x1ca758=this;return new Promise(function(_0x9037d3,_0x140657){return db[_0x43e7('0x12')][_0x43e7('0x13')]({'raw':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x15')]===undefined?!![]:![]:!![],'where':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x16')]||null:null,'attributes':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x17')]||null:null,'include':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x18')]?_[_0x43e7('0x19')](_0x446986[_0x43e7('0x14')][_0x43e7('0x18')],function(_0x2f4cb4){return{'model':db[_0x2f4cb4['model']],'as':_0x2f4cb4['as'],'attributes':_0x2f4cb4[_0x43e7('0x17')],'include':_0x2f4cb4['include']?_['map'](_0x2f4cb4[_0x43e7('0x18')],function(_0x43f4ff){return{'model':db[_0x43f4ff['model']],'as':_0x43f4ff['as'],'attributes':_0x43f4ff[_0x43e7('0x17')],'include':_0x43f4ff['include']?_[_0x43e7('0x19')](_0x43f4ff['include'],function(_0x1af208){return{'model':db[_0x1af208[_0x43e7('0x1a')]],'as':_0x1af208['as'],'attributes':_0x1af208[_0x43e7('0x17')]};}):[]};}):[]};}):[]:[]})[_0x43e7('0x1b')](function(_0x51f4d7){logger['info'](_0x43e7('0x1c'),_0x446986);logger['debug'](_0x43e7('0x1c'),_0x446986,JSON[_0x43e7('0x1d')](_0x51f4d7));_0x9037d3(_0x51f4d7);})[_0x43e7('0x11')](function(_0xb1fc63){logger['error'](_0x43e7('0x1c'),_0xb1fc63[_0x43e7('0xf')],_0x446986);_0x140657(_0x1ca758[_0x43e7('0xd')](0x1f4,_0xb1fc63[_0x43e7('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index ef4d4a9..3c57f13 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 _0x042b=['/pull','pull','/migrations','exports','express','../../components/auth/service','./version.controller','get','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset'];(function(_0x30b8b8,_0x7c008){var _0x4286a9=function(_0x2a1d44){while(--_0x2a1d44){_0x30b8b8['push'](_0x30b8b8['shift']());}};_0x4286a9(++_0x7c008);}(_0x042b,0x100));var _0xb042=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x042b[_0x5b644e];return _0x49c6bf;};'use strict';var express=require(_0xb042('0x0'));var router=express['Router']();var auth=require(_0xb042('0x1'));var controller=require(_0xb042('0x2'));router[_0xb042('0x3')]('/',controller['index']);router['get'](_0xb042('0x4'),auth[_0xb042('0x5')](),auth[_0xb042('0x6')](),controller[_0xb042('0x7')]);router[_0xb042('0x3')](_0xb042('0x8'),auth[_0xb042('0x5')](),auth[_0xb042('0x6')](),controller[_0xb042('0x9')]);router[_0xb042('0x3')](_0xb042('0xa'),auth[_0xb042('0x5')](),auth[_0xb042('0x6')](),controller[_0xb042('0xb')]);router['get']('/restart',auth['isAuthenticated'](),controller['restart']);router[_0xb042('0x3')](_0xb042('0xc'),controller['migrations']);module[_0xb042('0xd')]=router; \ No newline at end of file +var _0xaa59=['isAuthenticated','canUpdate','fetch','/reset','reset','/pull','pull','/restart','restart','/migrations','migrations','exports','express','Router','./version.controller','get','index'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xaa59,0x1e8));var _0x9aa5=function(_0x1aca1f,_0x505a9f){_0x1aca1f=_0x1aca1f-0x0;var _0xf390e3=_0xaa59[_0x1aca1f];return _0xf390e3;};'use strict';var express=require(_0x9aa5('0x0'));var router=express[_0x9aa5('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x9aa5('0x2'));router[_0x9aa5('0x3')]('/',controller[_0x9aa5('0x4')]);router[_0x9aa5('0x3')]('/fetch',auth[_0x9aa5('0x5')](),auth[_0x9aa5('0x6')](),controller[_0x9aa5('0x7')]);router['get'](_0x9aa5('0x8'),auth[_0x9aa5('0x5')](),auth['canUpdate'](),controller[_0x9aa5('0x9')]);router[_0x9aa5('0x3')](_0x9aa5('0xa'),auth['isAuthenticated'](),auth[_0x9aa5('0x6')](),controller[_0x9aa5('0xb')]);router[_0x9aa5('0x3')](_0x9aa5('0xc'),auth['isAuthenticated'](),controller[_0x9aa5('0xd')]);router[_0x9aa5('0x3')](_0x9aa5('0xe'),controller[_0x9aa5('0xf')]);module[_0x9aa5('0x10')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 952bd6e..f3f0f02 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 _0x0cb0=['sort','Migration','sequelize','getQueryInterface','constructor','map','Database\x20migrated\x20successfully\x20from\x20version\x20','last','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','pkginfo','version','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','index','query','latest','fetch','tags','exports','2.0.0','json','status','origin','error','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','info','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','join','server','migrations','length','replace','.js','push'];(function(_0x11c090,_0x7d8e4e){var _0x444c13=function(_0x2fd312){while(--_0x2fd312){_0x11c090['push'](_0x11c090['shift']());}};_0x444c13(++_0x7d8e4e);}(_0x0cb0,0x143));var _0x00cb=function(_0x54358e,_0xfdc442){_0x54358e=_0x54358e-0x0;var _0x517670=_0x0cb0[_0x54358e];return _0x517670;};'use strict';var Umzug=require(_0x00cb('0x0'));var path=require(_0x00cb('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x00cb('0x2'))(module,_0x00cb('0x3'));var compareVersions=require('compare-versions');var exec=require('child_process')['exec'];var db=require(_0x00cb('0x4'))['db'];var config=require(_0x00cb('0x5'));var pm2=require(_0x00cb('0x6'));var logger=require(_0x00cb('0x7'))(_0x00cb('0x8'));var git=require(_0x00cb('0x9'))(config[_0x00cb('0xa')]);exports[_0x00cb('0xb')]=function(_0xf00e37,_0x52b8fa){var _0x26da89={'current':module['exports'][_0x00cb('0x3')],'phonebar':0x2};if(_0xf00e37[_0x00cb('0xc')]&&_0xf00e37[_0x00cb('0xc')][_0x00cb('0xd')]){return git[_0x00cb('0xe')]()[_0x00cb('0xf')](function(_0xdce64f,_0x1d3f09){_0x26da89[_0x00cb('0xd')]=(_0xdce64f?module[_0x00cb('0x10')]['version']:_0x1d3f09[_0x00cb('0xd')])||_0x00cb('0x11');return _0x52b8fa['status'](0xc8)[_0x00cb('0x12')](_0x26da89);});}else{return _0x52b8fa[_0x00cb('0x13')](0xc8)[_0x00cb('0x12')](_0x26da89);}};exports[_0x00cb('0xe')]=function(_0x32450a,_0x5175d8){return git[_0x00cb('0xe')]([_0x00cb('0x14'),'master'],function(_0x1b93be){if(_0x1b93be){logger[_0x00cb('0x15')](_0x1b93be);return _0x5175d8['status'](0x1f4)[_0x00cb('0x12')](_0x1b93be);}logger['info'](_0x00cb('0x16'));return _0x5175d8['status'](0xc8)[_0x00cb('0x12')]({'output':_0x00cb('0x17')});});};exports['reset']=function(_0x31011e,_0x42c74c){return git[_0x00cb('0x18')]([_0x00cb('0x19'),'FETCH_HEAD'],function(_0x512c3a){if(_0x512c3a){logger[_0x00cb('0x15')](_0x512c3a);return _0x42c74c[_0x00cb('0x13')](0x1f4)['json'](_0x512c3a);}logger['info'](_0x00cb('0x1a'));return _0x42c74c['status'](0xc8)[_0x00cb('0x12')]({'output':_0x00cb('0x1b')});});};exports[_0x00cb('0x1c')]=function(_0x317579,_0x43268c){exec('npm\x20install\x20--production',function(_0x4c43dd,_0x57d71c,_0x365e2c){logger[_0x00cb('0x1d')](_0x57d71c);logger[_0x00cb('0x1d')](_0x365e2c);if(_0x4c43dd){logger[_0x00cb('0x15')](_0x4c43dd);return _0x43268c[_0x00cb('0x13')](0x1f4)[_0x00cb('0x12')](_0x4c43dd);}return _0x43268c['status'](0xc8)['json']({'output':_0x57d71c});});};exports['restart']=function(_0x31645b,_0x208d06){return pm2['restart'](_0x00cb('0x1e'))[_0x00cb('0x1f')](function(_0x3f9f47){logger[_0x00cb('0x1d')](_0x00cb('0x20'),_0x3f9f47);return _0x208d06[_0x00cb('0x13')](0xc8)[_0x00cb('0x12')]({'output':_0x00cb('0x21')});})['catch'](function(_0x2d5d4d){logger[_0x00cb('0x15')](_0x2d5d4d);return _0x208d06[_0x00cb('0x13')](0x1f4)['json'](_0x2d5d4d);});};exports['migrations']=function(_0x2bccb9,_0x2f76a8){var _0x3f92d6=fs['readdirSync'](path[_0x00cb('0x22')](config[_0x00cb('0xa')],_0x00cb('0x23'),_0x00cb('0x24')));var _0x30359e=[];for(var _0x351694=0x0;_0x351694<_0x3f92d6[_0x00cb('0x25')];_0x351694++){var _0x50ae93=_0x3f92d6[_0x351694][_0x00cb('0x26')](_0x00cb('0x27'),'');if(compareVersions(module[_0x00cb('0x10')][_0x00cb('0x3')],_0x50ae93)===-0x1){_0x30359e[_0x00cb('0x28')](_0x50ae93);}}if(_0x30359e[_0x00cb('0x25')]){var _0x4313b4=_0x30359e[_0x00cb('0x29')](compareVersions);var _0x45fe6a=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x00cb('0x2a')],'modelName':_0x00cb('0x2a'),'columnName':_0x00cb('0x3')},'migrations':{'params':[db[_0x00cb('0x2b')][_0x00cb('0x2c')](),db['sequelize'][_0x00cb('0x2d')],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[_0x00cb('0x22')](config[_0x00cb('0xa')],_0x00cb('0x23'),_0x00cb('0x24')),'pattern':/\.js$/}});_0x45fe6a['up']({'migrations':_[_0x00cb('0x2e')](_0x4313b4,function(_0x3f0b85){return _0x3f0b85+_0x00cb('0x27');})})[_0x00cb('0x1f')](function(){return _0x2f76a8[_0x00cb('0x13')](0xc8)[_0x00cb('0x12')]({'output':_0x00cb('0x2f')+module[_0x00cb('0x10')]['version']+'\x20to\x20'+_[_0x00cb('0x30')](_0x4313b4),'migrations':_[_0x00cb('0x22')](_0x4313b4)});})[_0x00cb('0x31')](function(_0x4800bb){if(_0x4800bb instanceof db[_0x00cb('0x2b')][_0x00cb('0x32')]){return _0x2f76a8[_0x00cb('0x13')](0xc8)[_0x00cb('0x12')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x2f76a8['status'](0x1f4)[_0x00cb('0x12')](_0x4800bb);}});}else{return _0x2f76a8[_0x00cb('0x13')](0xc8)[_0x00cb('0x12')]({'output':_0x00cb('0x33')});}}; \ No newline at end of file +var _0x5942=['simple-git','root','index','exports','query','fetch','tags','latest','2.0.0','json','status','origin','error','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','info','git\x20reset\x20--hard\x20FETCH_HEAD','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','join','server','replace','push','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','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update'];(function(_0x249de2,_0x5f3ba3){var _0x80eeba=function(_0x587b9c){while(--_0x587b9c){_0x249de2['push'](_0x249de2['shift']());}};_0x80eeba(++_0x5f3ba3);}(_0x5942,0x19c));var _0x2594=function(_0x2be63a,_0x44d8b5){_0x2be63a=_0x2be63a-0x0;var _0x2bd7c2=_0x5942[_0x2be63a];return _0x2bd7c2;};'use strict';var Umzug=require(_0x2594('0x0'));var path=require(_0x2594('0x1'));var fs=require('fs');var _=require(_0x2594('0x2'));var pkginfo=require(_0x2594('0x3'))(module,_0x2594('0x4'));var compareVersions=require('compare-versions');var exec=require(_0x2594('0x5'))[_0x2594('0x6')];var db=require(_0x2594('0x7'))['db'];var config=require(_0x2594('0x8'));var pm2=require(_0x2594('0x9'));var logger=require(_0x2594('0xa'))(_0x2594('0xb'));var git=require(_0x2594('0xc'))(config[_0x2594('0xd')]);exports[_0x2594('0xe')]=function(_0x1dd0fc,_0x9e220c){var _0x362627={'current':module[_0x2594('0xf')][_0x2594('0x4')],'phonebar':0x2};if(_0x1dd0fc[_0x2594('0x10')]&&_0x1dd0fc[_0x2594('0x10')]['latest']){return git[_0x2594('0x11')]()[_0x2594('0x12')](function(_0x3a1797,_0x478250){_0x362627[_0x2594('0x13')]=(_0x3a1797?module[_0x2594('0xf')]['version']:_0x478250[_0x2594('0x13')])||_0x2594('0x14');return _0x9e220c['status'](0xc8)[_0x2594('0x15')](_0x362627);});}else{return _0x9e220c[_0x2594('0x16')](0xc8)[_0x2594('0x15')](_0x362627);}};exports[_0x2594('0x11')]=function(_0x2ce8b5,_0x47613c){return git[_0x2594('0x11')]([_0x2594('0x17'),'master'],function(_0x4aa52b){if(_0x4aa52b){logger[_0x2594('0x18')](_0x4aa52b);return _0x47613c['status'](0x1f4)['json'](_0x4aa52b);}logger['info'](_0x2594('0x19'));return _0x47613c['status'](0xc8)[_0x2594('0x15')]({'output':_0x2594('0x1a')});});};exports[_0x2594('0x1b')]=function(_0x40a5a0,_0x598012){return git[_0x2594('0x1b')]([_0x2594('0x1c'),'FETCH_HEAD'],function(_0x16e94f){if(_0x16e94f){logger[_0x2594('0x18')](_0x16e94f);return _0x598012['status'](0x1f4)[_0x2594('0x15')](_0x16e94f);}logger[_0x2594('0x1d')](_0x2594('0x1e'));return _0x598012['status'](0xc8)[_0x2594('0x15')]({'output':'git\x20reset\x20--hard'});});};exports['pull']=function(_0x40b24b,_0x4ac5d0){exec('npm\x20install\x20--production',function(_0x5f2f49,_0x36a81c,_0x545751){logger['info'](_0x36a81c);logger[_0x2594('0x1d')](_0x545751);if(_0x5f2f49){logger['error'](_0x5f2f49);return _0x4ac5d0['status'](0x1f4)[_0x2594('0x15')](_0x5f2f49);}return _0x4ac5d0[_0x2594('0x16')](0xc8)[_0x2594('0x15')]({'output':_0x36a81c});});};exports[_0x2594('0x1f')]=function(_0x34ef39,_0xbaec56){return pm2[_0x2594('0x1f')](_0x2594('0x20'))[_0x2594('0x21')](function(_0x3b8414){logger[_0x2594('0x1d')]('pm2\x20restart\x20motion\x20%s',_0x3b8414);return _0xbaec56[_0x2594('0x16')](0xc8)[_0x2594('0x15')]({'output':_0x2594('0x22')});})[_0x2594('0x23')](function(_0x2f4954){logger[_0x2594('0x18')](_0x2f4954);return _0xbaec56[_0x2594('0x16')](0x1f4)[_0x2594('0x15')](_0x2f4954);});};exports[_0x2594('0x24')]=function(_0x37594c,_0x306adb){var _0x1262b9=fs['readdirSync'](path[_0x2594('0x25')](config[_0x2594('0xd')],_0x2594('0x26'),'migrations'));var _0x22176c=[];for(var _0x5e2e80=0x0;_0x5e2e80<_0x1262b9['length'];_0x5e2e80++){var _0x21c2f4=_0x1262b9[_0x5e2e80][_0x2594('0x27')]('.js','');if(compareVersions(module['exports'][_0x2594('0x4')],_0x21c2f4)===-0x1){_0x22176c[_0x2594('0x28')](_0x21c2f4);}}if(_0x22176c[_0x2594('0x29')]){var _0x44852f=_0x22176c[_0x2594('0x2a')](compareVersions);var _0x5c6bfc=new Umzug({'storage':_0x2594('0x2b'),'storageOptions':{'model':db[_0x2594('0x2c')],'modelName':_0x2594('0x2c'),'columnName':'version'},'migrations':{'params':[db[_0x2594('0x2b')][_0x2594('0x2d')](),db[_0x2594('0x2b')][_0x2594('0x2e')],function(){throw new Error(_0x2594('0x2f'));}],'path':path['join'](config[_0x2594('0xd')],_0x2594('0x26'),_0x2594('0x24')),'pattern':/\.js$/}});_0x5c6bfc['up']({'migrations':_[_0x2594('0x30')](_0x44852f,function(_0x783079){return _0x783079+'.js';})})[_0x2594('0x21')](function(){return _0x306adb[_0x2594('0x16')](0xc8)[_0x2594('0x15')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x2594('0xf')][_0x2594('0x4')]+_0x2594('0x31')+_[_0x2594('0x32')](_0x44852f),'migrations':_[_0x2594('0x25')](_0x44852f)});})[_0x2594('0x23')](function(_0x1b0b13){if(_0x1b0b13 instanceof db[_0x2594('0x2b')][_0x2594('0x33')]){return _0x306adb[_0x2594('0x16')](0xc8)[_0x2594('0x15')]({'output':_0x2594('0x34')});}else{return _0x306adb[_0x2594('0x16')](0x1f4)[_0x2594('0x15')](_0x1b0b13);}});}else{return _0x306adb['status'](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 3d5420d..cf0c21c 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 _0x288b=['index','describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get'];(function(_0x1c4751,_0x240af3){var _0x287cbc=function(_0x408b73){while(--_0x408b73){_0x1c4751['push'](_0x1c4751['shift']());}};_0x287cbc(++_0x240af3);}(_0x288b,0x182));var _0xb288=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x288b[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xb288('0x0'));var util=require('util');var path=require(_0xb288('0x1'));var timeout=require('connect-timeout');var express=require(_0xb288('0x2'));var router=express[_0xb288('0x3')]();var fs_extra=require(_0xb288('0x4'));var auth=require(_0xb288('0x5'));var interaction=require(_0xb288('0x6'));var config=require(_0xb288('0x7'));var controller=require(_0xb288('0x8'));router[_0xb288('0x9')]('/',auth['isAuthenticated'](),controller[_0xb288('0xa')]);router[_0xb288('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xb288('0xb')]);router['get'](_0xb288('0xc'),auth[_0xb288('0xd')](),controller[_0xb288('0xe')]);router[_0xb288('0xf')]('/',auth[_0xb288('0xd')](),controller[_0xb288('0x10')]);router[_0xb288('0x11')](_0xb288('0xc'),auth[_0xb288('0xd')](),controller[_0xb288('0x12')]);router[_0xb288('0x13')](_0xb288('0xc'),auth[_0xb288('0xd')](),controller[_0xb288('0x14')]);module[_0xb288('0x15')]=router; \ No newline at end of file +var _0xa139=['./voiceAgentReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x2c2773,_0x2bc6c4){var _0x256a98=function(_0x27c570){while(--_0x27c570){_0x2c2773['push'](_0x2c2773['shift']());}};_0x256a98(++_0x2bc6c4);}(_0xa139,0x1c5));var _0x9a13=function(_0x17a89a,_0x4c26d5){_0x17a89a=_0x17a89a-0x0;var _0x59dcf9=_0xa139[_0x17a89a];return _0x59dcf9;};'use strict';var multer=require(_0x9a13('0x0'));var util=require(_0x9a13('0x1'));var path=require(_0x9a13('0x2'));var timeout=require(_0x9a13('0x3'));var express=require(_0x9a13('0x4'));var router=express[_0x9a13('0x5')]();var fs_extra=require(_0x9a13('0x6'));var auth=require(_0x9a13('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x9a13('0x8'));var controller=require(_0x9a13('0x9'));router[_0x9a13('0xa')]('/',auth[_0x9a13('0xb')](),controller[_0x9a13('0xc')]);router[_0x9a13('0xa')](_0x9a13('0xd'),auth[_0x9a13('0xb')](),controller['describe']);router['get'](_0x9a13('0xe'),auth[_0x9a13('0xb')](),controller[_0x9a13('0xf')]);router[_0x9a13('0x10')]('/',auth[_0x9a13('0xb')](),controller[_0x9a13('0x11')]);router[_0x9a13('0x12')](_0x9a13('0xe'),auth[_0x9a13('0xb')](),controller['update']);router[_0x9a13('0x13')](_0x9a13('0xe'),auth[_0x9a13('0xb')](),controller['destroy']);module[_0x9a13('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 7f1633e..0af98a0 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 _0x1c7c=['exports','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0x4e490e,_0x4b08d8){var _0x95446=function(_0x5d1790){while(--_0x5d1790){_0x4e490e['push'](_0x4e490e['shift']());}};_0x95446(++_0x4b08d8);}(_0x1c7c,0x164));var _0xc1c7=function(_0x2b2be6,_0x21a4ea){_0x2b2be6=_0x2b2be6-0x0;var _0x1c8620=_0x1c7c[_0x2b2be6];return _0x1c8620;};'use strict';var Sequelize=require(_0xc1c7('0x0'));module[_0xc1c7('0x1')]={'type':{'type':Sequelize[_0xc1c7('0x2')]},'uniqueid':{'type':Sequelize[_0xc1c7('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xc1c7('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xc1c7('0x2')]},'membername':{'type':Sequelize[_0xc1c7('0x2')]},'agentcalledAt':{'type':Sequelize[_0xc1c7('0x3')]},'agentconnectAt':{'type':Sequelize[_0xc1c7('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xc1c7('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xc1c7('0x3')]},'agentdumpAt':{'type':Sequelize[_0xc1c7('0x3')]},'holdtime':{'type':Sequelize[_0xc1c7('0x4')]},'agentcomplete':{'type':Sequelize[_0xc1c7('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xc1c7('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xc1c7('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xc1c7('0x4')]},'agentacw':{'type':Sequelize[_0xc1c7('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xc1c7('0x4')]},'reason':{'type':Sequelize[_0xc1c7('0x2')]},'lastevent':{'type':Sequelize[_0xc1c7('0x2')]},'channel':{'type':Sequelize[_0xc1c7('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xc1c7('0x2')]},'connectedlinenum':{'type':Sequelize[_0xc1c7('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xc1c7('0x2')]},'accountcode':{'type':Sequelize[_0xc1c7('0x2')]},'context':{'type':Sequelize[_0xc1c7('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xc1c7('0x2')]},'destchannel':{'type':Sequelize[_0xc1c7('0x2')]},'destchannelstate':{'type':Sequelize[_0xc1c7('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xc1c7('0x2')]},'destcalleridnum':{'type':Sequelize[_0xc1c7('0x2')]},'destcalleridname':{'type':Sequelize[_0xc1c7('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xc1c7('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xc1c7('0x2')]},'destlanguage':{'type':Sequelize[_0xc1c7('0x2')]},'destaccountcode':{'type':Sequelize[_0xc1c7('0x2')]},'destcontext':{'type':Sequelize[_0xc1c7('0x2')]},'destexten':{'type':Sequelize[_0xc1c7('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xc1c7('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xc1c7('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xc1c7('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xc1c7('0x2')],'comment':_0xc1c7('0x6')},'transferexten':{'type':Sequelize[_0xc1c7('0x2')]},'transferuniqueid':{'type':Sequelize[_0xc1c7('0x2')]},'agententerreason':{'type':Sequelize[_0xc1c7('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb4f8=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','exports'];(function(_0x1cbc6f,_0x2aa534){var _0x823729=function(_0x2c3ef2){while(--_0x2c3ef2){_0x1cbc6f['push'](_0x1cbc6f['shift']());}};_0x823729(++_0x2aa534);}(_0xb4f8,0x83));var _0x8b4f=function(_0x2f9467,_0x40576f){_0x2f9467=_0x2f9467-0x0;var _0x39894c=_0xb4f8[_0x2f9467];return _0x39894c;};'use strict';var Sequelize=require('sequelize');module[_0x8b4f('0x0')]={'type':{'type':Sequelize[_0x8b4f('0x1')]},'uniqueid':{'type':Sequelize[_0x8b4f('0x1')]},'calleridnum':{'type':Sequelize[_0x8b4f('0x1')]},'calleridname':{'type':Sequelize[_0x8b4f('0x1')]},'queue':{'type':Sequelize[_0x8b4f('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x8b4f('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x8b4f('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x8b4f('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x8b4f('0x2')]},'agentdumpAt':{'type':Sequelize[_0x8b4f('0x2')]},'holdtime':{'type':Sequelize[_0x8b4f('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x8b4f('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x8b4f('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x8b4f('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x8b4f('0x3')]},'reason':{'type':Sequelize[_0x8b4f('0x1')]},'lastevent':{'type':Sequelize[_0x8b4f('0x1')]},'channel':{'type':Sequelize[_0x8b4f('0x1')]},'channelstate':{'type':Sequelize[_0x8b4f('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x8b4f('0x1')]},'connectedlinename':{'type':Sequelize[_0x8b4f('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x8b4f('0x1')]},'context':{'type':Sequelize[_0x8b4f('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x8b4f('0x1')]},'destchannel':{'type':Sequelize[_0x8b4f('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x8b4f('0x1')]},'destcalleridnum':{'type':Sequelize[_0x8b4f('0x1')]},'destcalleridname':{'type':Sequelize[_0x8b4f('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x8b4f('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x8b4f('0x1')]},'destaccountcode':{'type':Sequelize[_0x8b4f('0x1')]},'destcontext':{'type':Sequelize[_0x8b4f('0x1')]},'destexten':{'type':Sequelize[_0x8b4f('0x1')]},'destpriority':{'type':Sequelize[_0x8b4f('0x1')]},'destuniqueid':{'type':Sequelize[_0x8b4f('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x8b4f('0x1')]},'transfer':{'type':Sequelize[_0x8b4f('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x8b4f('0x1')],'comment':_0x8b4f('0x5')},'transferexten':{'type':Sequelize[_0x8b4f('0x1')]},'transferuniqueid':{'type':Sequelize[_0x8b4f('0x1')]},'agententerreason':{'type':Sequelize[_0x8b4f('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 6abb4db..9301a0f 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(_0x556927,_0x34b53f){var _0x5f1235=function(_0x4f4e44){while(--_0x4f4e44){_0x556927['push'](_0x556927['shift']());}};_0x5f1235(++_0x34b53f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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 550aeaf..ecabd5b 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 _0x2bd8=['bluebird','request-promise','path','rimraf','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','lodash','../../config/logger','api','moment'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x2bd8,0x130));var _0x82bd=function(_0x487a1a,_0x409dd3){_0x487a1a=_0x487a1a-0x0;var _0x1b4bb6=_0x2bd8[_0x487a1a];return _0x1b4bb6;};'use strict';var _=require(_0x82bd('0x0'));var util=require('util');var logger=require(_0x82bd('0x1'))(_0x82bd('0x2'));var moment=require(_0x82bd('0x3'));var BPromise=require(_0x82bd('0x4'));var rp=require(_0x82bd('0x5'));var fs=require('fs');var path=require(_0x82bd('0x6'));var rimraf=require(_0x82bd('0x7'));var config=require('../../config/environment');var attributes=require(_0x82bd('0x8'));module[_0x82bd('0x9')]=function(_0x3bf810,_0x5ceb60){return _0x3bf810[_0x82bd('0xa')](_0x82bd('0xb'),attributes,{'tableName':_0x82bd('0xc'),'paranoid':![],'indexes':[{'fields':[_0x82bd('0xd'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9576=['request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','api'];(function(_0x36357e,_0x7ff1f3){var _0x22e6c9=function(_0xbf2dc0){while(--_0xbf2dc0){_0x36357e['push'](_0x36357e['shift']());}};_0x22e6c9(++_0x7ff1f3);}(_0x9576,0x182));var _0x6957=function(_0x59512c,_0x28ca39){_0x59512c=_0x59512c-0x0;var _0x808131=_0x9576[_0x59512c];return _0x808131;};'use strict';var _=require(_0x6957('0x0'));var util=require(_0x6957('0x1'));var logger=require(_0x6957('0x2'))(_0x6957('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6957('0x4'));var fs=require('fs');var path=require(_0x6957('0x5'));var rimraf=require(_0x6957('0x6'));var config=require(_0x6957('0x7'));var attributes=require(_0x6957('0x8'));module[_0x6957('0x9')]=function(_0x2eb79e,_0x49e08a){return _0x2eb79e[_0x6957('0xa')](_0x6957('0xb'),attributes,{'tableName':_0x6957('0xc'),'paranoid':![],'indexes':[{'fields':[_0x6957('0xd'),_0x6957('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 14cf6c2..e7da126 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 _0x8856=['options','raw','stringify','update','where','limit','then','UpdateVoiceAgentReport','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body'];(function(_0x2d3a4d,_0x47561e){var _0x3a94a3=function(_0x2f48da){while(--_0x2f48da){_0x2d3a4d['push'](_0x2d3a4d['shift']());}};_0x3a94a3(++_0x47561e);}(_0x8856,0x1ac));var _0x6885=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8856[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6885('0x0'));var util=require('util');var moment=require(_0x6885('0x1'));var BPromise=require(_0x6885('0x2'));var rs=require(_0x6885('0x3'));var fs=require('fs');var Redis=require(_0x6885('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6885('0x5'));var logger=require(_0x6885('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6885('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x545c54,_0x44a6ef,_0x1f7423){return new BPromise(function(_0x5a65a1,_0x44e439){return client['request'](_0x545c54,_0x1f7423)['then'](function(_0x288977){logger[_0x6885('0x8')](_0x6885('0x9'),_0x44a6ef,_0x6885('0xa'));logger[_0x6885('0xb')](_0x6885('0xc'),_0x44a6ef,_0x6885('0xa'),JSON['stringify'](_0x288977));if(_0x288977[_0x6885('0xd')]){if(_0x288977[_0x6885('0xd')][_0x6885('0xe')]===0x1f4){logger[_0x6885('0xd')](_0x6885('0x9'),_0x44a6ef,_0x288977[_0x6885('0xd')][_0x6885('0xf')]);return _0x44e439(_0x288977[_0x6885('0xd')][_0x6885('0xf')]);}logger[_0x6885('0xd')](_0x6885('0x9'),_0x44a6ef,_0x288977[_0x6885('0xd')][_0x6885('0xf')]);return _0x5a65a1(_0x288977['error'][_0x6885('0xf')]);}else{logger[_0x6885('0x8')](_0x6885('0x9'),_0x44a6ef,'request\x20sent');_0x5a65a1(_0x288977[_0x6885('0x10')][_0x6885('0xf')]);}})[_0x6885('0x11')](function(_0x51e0ce){logger[_0x6885('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x44a6ef,_0x51e0ce);_0x44e439(_0x51e0ce);});});}exports[_0x6885('0x12')]=function(_0x2045f4){var _0x503aac=this;return new Promise(function(_0x23909a,_0xf55198){return db[_0x6885('0x13')][_0x6885('0x14')](_0x2045f4[_0x6885('0x15')],{'raw':_0x2045f4['options']?_0x2045f4[_0x6885('0x16')][_0x6885('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x710082){logger[_0x6885('0x8')]('CreateVoiceAgentReport',_0x2045f4);logger[_0x6885('0xb')](_0x6885('0x12'),_0x2045f4,JSON[_0x6885('0x18')](_0x710082));_0x23909a(_0x710082);})['catch'](function(_0x34a249){logger[_0x6885('0xd')](_0x6885('0x12'),_0x34a249[_0x6885('0xf')],_0x2045f4);_0xf55198(_0x503aac[_0x6885('0xd')](0x1f4,_0x34a249[_0x6885('0xf')]));});});};exports['UpdateVoiceAgentReport']=function(_0x2bacf2){var _0x3aba8e=this;return new Promise(function(_0x5887ae,_0x4984b9){return db['VoiceAgentReport'][_0x6885('0x19')](_0x2bacf2[_0x6885('0x15')],{'raw':_0x2bacf2[_0x6885('0x16')]?_0x2bacf2[_0x6885('0x16')][_0x6885('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2bacf2[_0x6885('0x16')]?_0x2bacf2[_0x6885('0x16')][_0x6885('0x1a')]||null:null,'attributes':_0x2bacf2['options']?_0x2bacf2['options']['attributes']||null:null,'limit':_0x2bacf2[_0x6885('0x16')]?_0x2bacf2[_0x6885('0x16')][_0x6885('0x1b')]||null:null})[_0x6885('0x1c')](function(_0x3a2198){logger[_0x6885('0x8')]('UpdateVoiceAgentReport',_0x2bacf2);logger[_0x6885('0xb')](_0x6885('0x1d'),_0x2bacf2,JSON[_0x6885('0x18')](_0x3a2198));_0x5887ae(_0x3a2198);})[_0x6885('0x11')](function(_0x1bd706){logger[_0x6885('0xd')](_0x6885('0x1d'),_0x1bd706[_0x6885('0xf')],_0x2bacf2);_0x4984b9(_0x3aba8e['error'](0x1f4,_0x1bd706['message']));});});}; \ No newline at end of file +var _0xfe80=['result','CreateVoiceAgentReport','create','body','options','raw','debug','catch','UpdateVoiceAgentReport','update','where','info','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','client','request','then','VoiceAgentReport,\x20%s,\x20%s','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x35e507,_0x171e16){var _0x51b71b=function(_0x20a51e){while(--_0x20a51e){_0x35e507['push'](_0x35e507['shift']());}};_0x51b71b(++_0x171e16);}(_0xfe80,0x194));var _0x0fe8=function(_0x2dbd40,_0x1a1931){_0x2dbd40=_0x2dbd40-0x0;var _0x92aa93=_0xfe80[_0x2dbd40];return _0x92aa93;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0fe8('0x0'));var BPromise=require(_0x0fe8('0x1'));var rs=require(_0x0fe8('0x2'));var fs=require('fs');var Redis=require(_0x0fe8('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0fe8('0x4'))(_0x0fe8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0fe8('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x148a25,_0x31133a,_0x4728b1){return new BPromise(function(_0x2627e9,_0x3969e3){return client[_0x0fe8('0x7')](_0x148a25,_0x4728b1)[_0x0fe8('0x8')](function(_0x281c02){logger['info'](_0x0fe8('0x9'),_0x31133a,'request\x20sent');logger['debug'](_0x0fe8('0xa'),_0x31133a,_0x0fe8('0xb'),JSON[_0x0fe8('0xc')](_0x281c02));if(_0x281c02[_0x0fe8('0xd')]){if(_0x281c02[_0x0fe8('0xd')][_0x0fe8('0xe')]===0x1f4){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x31133a,_0x281c02['error']['message']);return _0x3969e3(_0x281c02[_0x0fe8('0xd')][_0x0fe8('0xf')]);}logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x31133a,_0x281c02[_0x0fe8('0xd')]['message']);return _0x2627e9(_0x281c02['error'][_0x0fe8('0xf')]);}else{logger['info'](_0x0fe8('0x9'),_0x31133a,_0x0fe8('0xb'));_0x2627e9(_0x281c02[_0x0fe8('0x10')][_0x0fe8('0xf')]);}})['catch'](function(_0x24f4b6){logger['error'](_0x0fe8('0x9'),_0x31133a,_0x24f4b6);_0x3969e3(_0x24f4b6);});});}exports[_0x0fe8('0x11')]=function(_0x5160d4){var _0x3f0def=this;return new Promise(function(_0x3fa88a,_0x5e70fa){return db['VoiceAgentReport'][_0x0fe8('0x12')](_0x5160d4[_0x0fe8('0x13')],{'raw':_0x5160d4[_0x0fe8('0x14')]?_0x5160d4[_0x0fe8('0x14')][_0x0fe8('0x15')]===undefined?!![]:![]:!![]})[_0x0fe8('0x8')](function(_0x1404b5){logger['info']('CreateVoiceAgentReport',_0x5160d4);logger[_0x0fe8('0x16')](_0x0fe8('0x11'),_0x5160d4,JSON[_0x0fe8('0xc')](_0x1404b5));_0x3fa88a(_0x1404b5);})[_0x0fe8('0x17')](function(_0x55a63b){logger[_0x0fe8('0xd')](_0x0fe8('0x11'),_0x55a63b[_0x0fe8('0xf')],_0x5160d4);_0x5e70fa(_0x3f0def[_0x0fe8('0xd')](0x1f4,_0x55a63b['message']));});});};exports[_0x0fe8('0x18')]=function(_0xb875d9){var _0x1d8ab4=this;return new Promise(function(_0x1fa17c,_0x34a457){return db['VoiceAgentReport'][_0x0fe8('0x19')](_0xb875d9['body'],{'raw':_0xb875d9['options']?_0xb875d9[_0x0fe8('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb875d9[_0x0fe8('0x14')]?_0xb875d9[_0x0fe8('0x14')][_0x0fe8('0x1a')]||null:null,'attributes':_0xb875d9[_0x0fe8('0x14')]?_0xb875d9[_0x0fe8('0x14')]['attributes']||null:null,'limit':_0xb875d9[_0x0fe8('0x14')]?_0xb875d9[_0x0fe8('0x14')]['limit']||null:null})[_0x0fe8('0x8')](function(_0x1b9644){logger[_0x0fe8('0x1b')](_0x0fe8('0x18'),_0xb875d9);logger['debug'](_0x0fe8('0x18'),_0xb875d9,JSON['stringify'](_0x1b9644));_0x1fa17c(_0x1b9644);})[_0x0fe8('0x17')](function(_0x4fbb15){logger['error'](_0x0fe8('0x18'),_0x4fbb15[_0x0fe8('0xf')],_0xb875d9);_0x34a457(_0x1d8ab4[_0x0fe8('0xd')](0x1f4,_0x4fbb15[_0x0fe8('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 094f17b..be27b43 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 _0x80d9=['get','/:id','show','post','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','index','isAuthenticated','describe'];(function(_0x25453d,_0x5be777){var _0x55e03e=function(_0x465fb4){while(--_0x465fb4){_0x25453d['push'](_0x25453d['shift']());}};_0x55e03e(++_0x5be777);}(_0x80d9,0x15c));var _0x980d=function(_0x174e0f,_0x2aede2){_0x174e0f=_0x174e0f-0x0;var _0xc0de=_0x80d9[_0x174e0f];return _0xc0de;};'use strict';var multer=require(_0x980d('0x0'));var util=require('util');var path=require(_0x980d('0x1'));var timeout=require(_0x980d('0x2'));var express=require(_0x980d('0x3'));var router=express['Router']();var fs_extra=require(_0x980d('0x4'));var auth=require(_0x980d('0x5'));var interaction=require(_0x980d('0x6'));var config=require(_0x980d('0x7'));var controller=require(_0x980d('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x980d('0x9')]);router['get']('/describe',auth[_0x980d('0xa')](),controller[_0x980d('0xb')]);router[_0x980d('0xc')](_0x980d('0xd'),auth[_0x980d('0xa')](),controller[_0x980d('0xe')]);router[_0x980d('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x980d('0xd'),auth[_0x980d('0xa')](),controller['update']);router[_0x980d('0x10')]('/:id',auth[_0x980d('0xa')](),controller['destroy']);module[_0x980d('0x11')]=router; \ No newline at end of file +var _0x4c4e=['fs-extra','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','put','delete','destroy','multer','path','connect-timeout','express'];(function(_0x1c8307,_0x436ce5){var _0x5d4e8e=function(_0x1bf043){while(--_0x1bf043){_0x1c8307['push'](_0x1c8307['shift']());}};_0x5d4e8e(++_0x436ce5);}(_0x4c4e,0x152));var _0xe4c4=function(_0x49809a,_0x343f85){_0x49809a=_0x49809a-0x0;var _0xb9f22a=_0x4c4e[_0x49809a];return _0xb9f22a;};'use strict';var multer=require(_0xe4c4('0x0'));var util=require('util');var path=require(_0xe4c4('0x1'));var timeout=require(_0xe4c4('0x2'));var express=require(_0xe4c4('0x3'));var router=express['Router']();var fs_extra=require(_0xe4c4('0x4'));var auth=require(_0xe4c4('0x5'));var interaction=require(_0xe4c4('0x6'));var config=require('../../config/environment');var controller=require(_0xe4c4('0x7'));router['get']('/',auth[_0xe4c4('0x8')](),controller[_0xe4c4('0x9')]);router[_0xe4c4('0xa')](_0xe4c4('0xb'),auth[_0xe4c4('0x8')](),controller[_0xe4c4('0xc')]);router[_0xe4c4('0xa')](_0xe4c4('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xe4c4('0xe')]('/',auth[_0xe4c4('0x8')](),controller[_0xe4c4('0xf')]);router[_0xe4c4('0x10')](_0xe4c4('0xd'),auth[_0xe4c4('0x8')](),controller['update']);router[_0xe4c4('0x11')](_0xe4c4('0xd'),auth[_0xe4c4('0x8')](),controller[_0xe4c4('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index a7eb9f2..022311b 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 _0x066e=['DATE','INTEGER','sequelize','ENUM','inbound','internal','inbound-fax','outbound-fax','STRING','TEXT'];(function(_0x4cf6f8,_0x4f07e0){var _0x2f4c25=function(_0x1afbe0){while(--_0x1afbe0){_0x4cf6f8['push'](_0x4cf6f8['shift']());}};_0x2f4c25(++_0x4f07e0);}(_0x066e,0xca));var _0xe066=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0x066e[_0x10004e];return _0x5af990;};'use strict';var Sequelize=require(_0xe066('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xe066('0x1')](_0xe066('0x2'),_0xe066('0x3'),'outbound',_0xe066('0x4'),_0xe066('0x5'),'dialer')},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xe066('0x6')]},'source':{'type':Sequelize[_0xe066('0x6')]},'destination':{'type':Sequelize[_0xe066('0x6')]},'destinationcontext':{'type':Sequelize[_0xe066('0x6')]},'callerid':{'type':Sequelize[_0xe066('0x6')]},'channel':{'type':Sequelize[_0xe066('0x6')]},'destinationchannel':{'type':Sequelize[_0xe066('0x6')]},'lastapplication':{'type':Sequelize[_0xe066('0x6')]},'lastdata':{'type':Sequelize[_0xe066('0x7')]},'starttime':{'type':Sequelize[_0xe066('0x8')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xe066('0x8')]},'endtime':{'type':Sequelize[_0xe066('0x8')]},'duration':{'type':Sequelize[_0xe066('0x9')]},'billableseconds':{'type':Sequelize[_0xe066('0x9')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xe066('0x6')]},'amaflags':{'type':Sequelize[_0xe066('0x6')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0xe066('0x6')]},'note':{'type':Sequelize[_0xe066('0x6')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc42f=['inbound','outbound','dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM'];(function(_0x1bfc7b,_0x360a77){var _0x3004cf=function(_0x3dde42){while(--_0x3dde42){_0x1bfc7b['push'](_0x1bfc7b['shift']());}};_0x3004cf(++_0x360a77);}(_0xc42f,0xb0));var _0xfc42=function(_0x2fc13a,_0x463f42){_0x2fc13a=_0x2fc13a-0x0;var _0x17a77d=_0xc42f[_0x2fc13a];return _0x17a77d;};'use strict';var Sequelize=require(_0xfc42('0x0'));module[_0xfc42('0x1')]={'uniqueid':{'type':Sequelize[_0xfc42('0x2')]},'type':{'type':Sequelize[_0xfc42('0x3')](_0xfc42('0x4'),'internal',_0xfc42('0x5'),'inbound-fax','outbound-fax',_0xfc42('0x6'))},'tag':{'type':Sequelize[_0xfc42('0x2')]},'accountcode':{'type':Sequelize[_0xfc42('0x2')]},'source':{'type':Sequelize[_0xfc42('0x2')]},'destination':{'type':Sequelize[_0xfc42('0x2')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xfc42('0x2')]},'channel':{'type':Sequelize[_0xfc42('0x2')]},'destinationchannel':{'type':Sequelize[_0xfc42('0x2')]},'lastapplication':{'type':Sequelize[_0xfc42('0x2')]},'lastdata':{'type':Sequelize[_0xfc42('0x7')]},'starttime':{'type':Sequelize[_0xfc42('0x8')]},'systemanswertime':{'type':Sequelize[_0xfc42('0x8')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xfc42('0x8')]},'duration':{'type':Sequelize[_0xfc42('0x9')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xfc42('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xfc42('0x2')]},'amaflags':{'type':Sequelize[_0xfc42('0x2')]},'userfield':{'type':Sequelize[_0xfc42('0x2')]},'userDisposition':{'type':Sequelize[_0xfc42('0x2')]},'userSecondDisposition':{'type':Sequelize[_0xfc42('0x2')]},'userThirdDisposition':{'type':Sequelize[_0xfc42('0x2')]},'note':{'type':Sequelize[_0xfc42('0x2')]},'prefix':{'type':Sequelize[_0xfc42('0x2')]},'routeid':{'type':Sequelize[_0xfc42('0x9')]},'sipcallid':{'type':Sequelize[_0xfc42('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 76b8ad6..6d61bd7 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 _0xadb5=['filter','VIRTUAL','merge','options','includeAll','include','fullname','User','findAll','rows','show','rawAttributes','length','find','catch','body','params','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters'];(function(_0x3042c5,_0x36cb88){var _0x7cd140=function(_0x4cdcd8){while(--_0x4cdcd8){_0x3042c5['push'](_0x3042c5['shift']());}};_0x7cd140(++_0x36cb88);}(_0xadb5,0xad));var _0x5adb=function(_0x2ac9f2,_0x539664){_0x2ac9f2=_0x2ac9f2-0x0;var _0xaebe2a=_0xadb5[_0x2ac9f2];return _0xaebe2a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['VoiceCallReport']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'attributes':['id',_0x5adb('0x26'),_0x5adb('0x40'),'alias'],'model':db['User'],'as':_0x5adb('0x41')}];}return db['VoiceCallReport'][_0x5adb('0x42')](_0x5d457e);})[_0x5adb('0x22')](function(_0x299746){_0x1eac55[_0x5adb('0x43')]=_0x299746;return _0x1eac55;})[_0x5adb('0x22')](respondWithFilteredResult(_0x49992e,_0x5d457e))['catch'](handleError(_0x49992e,null));};exports[_0x5adb('0x44')]=function(_0x565b03,_0x508690){var _0x4160ad={'raw':!![],'where':{'id':_0x565b03['params']['id']}},_0x1a256c={};_0x1a256c[_0x5adb('0x2e')]=_[_0x5adb('0x30')](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x1a256c[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x565b03[_0x5adb('0x2f')]);_0x1a256c['filters']=_['intersection'](_0x1a256c[_0x5adb('0x2e')],_0x1a256c[_0x5adb('0x2f')]);_0x4160ad[_0x5adb('0x32')]=_[_0x5adb('0x31')](_0x1a256c['model'],qs['fields'](_0x565b03[_0x5adb('0x2f')][_0x5adb('0x33')]));_0x4160ad[_0x5adb('0x32')]=_0x4160ad[_0x5adb('0x32')][_0x5adb('0x46')]?_0x4160ad['attributes']:_0x1a256c[_0x5adb('0x2e')];if(_0x565b03[_0x5adb('0x2f')]['includeAll']){_0x4160ad[_0x5adb('0x3f')]=[{'all':!![]}];}_0x4160ad=_[_0x5adb('0x3c')]({},_0x4160ad,_0x565b03[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')][_0x5adb('0x47')](_0x4160ad)[_0x5adb('0x22')](handleEntityNotFound(_0x508690,null))[_0x5adb('0x22')](respondWithResult(_0x508690,null))[_0x5adb('0x48')](handleError(_0x508690,null));};exports['create']=function(_0x3a925b,_0x57dc8b){return db['VoiceCallReport']['create'](_0x3a925b[_0x5adb('0x49')],{})[_0x5adb('0x22')](respondWithResult(_0x57dc8b,0xc9))[_0x5adb('0x48')](handleError(_0x57dc8b,null));};exports['destroy']=function(_0x2ad69d,_0x5cbab5){return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'id':_0x2ad69d[_0x5adb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5cbab5,null))[_0x5adb('0x22')](removeEntity(_0x5cbab5,null))['catch'](handleError(_0x5cbab5,null));};exports[_0x5adb('0x4b')]=function(_0x6dc067,_0x55c535){return db[_0x5adb('0x2a')][_0x5adb('0x4b')]()[_0x5adb('0x22')](respondWithResult(_0x55c535,null))[_0x5adb('0x48')](handleError(_0x55c535,null));};exports[_0x5adb('0x21')]=function(_0x4cb36c,_0x36b847){if(_0x4cb36c[_0x5adb('0x49')][_0x5adb('0x4c')]){delete _0x4cb36c[_0x5adb('0x49')]['uniqueid'];}return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'uniqueid':_0x4cb36c[_0x5adb('0x4a')]['id'],'UserId':{'$or':[null,_0x4cb36c['user']['id']]}}})[_0x5adb('0x22')](handleEntityNotFound(_0x36b847,null))[_0x5adb('0x22')](saveUpdates(_0x4cb36c[_0x5adb('0x49')],null))[_0x5adb('0x22')](respondWithResult(_0x36b847,null))['catch'](handleError(_0x36b847,null));}; \ No newline at end of file +var _0x5f66=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','fullname','alias','User','rows','catch','show','params','find','create','body','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x5f66,0x1a0));var _0x65f6=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5f66[_0x432682];return _0x463d05;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'attributes':['id',_0x65f6('0x23'),_0x65f6('0x3c'),_0x65f6('0x3d')],'model':db[_0x65f6('0x3e')],'as':_0x65f6('0x3e')}];}return db[_0x65f6('0x27')]['findAll'](_0x4ac04b);})[_0x65f6('0x21')](function(_0x400ed2){_0x266cfe[_0x65f6('0x3f')]=_0x400ed2;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))[_0x65f6('0x40')](handleError(_0x559330,null));};exports[_0x65f6('0x41')]=function(_0xe0b72d,_0x2e91e8){var _0x461393={'raw':!![],'where':{'id':_0xe0b72d[_0x65f6('0x42')]['id']}},_0x2abbed={};_0x2abbed[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x2abbed[_0x65f6('0x2c')]=_['keys'](_0xe0b72d[_0x65f6('0x2c')]);_0x2abbed[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],_0x2abbed['query']);_0x461393[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],qs['fields'](_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2f')]));_0x461393[_0x65f6('0x30')]=_0x461393[_0x65f6('0x30')]['length']?_0x461393[_0x65f6('0x30')]:_0x2abbed['model'];if(_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x461393['include']=[{'all':!![]}];}_0x461393=_[_0x65f6('0x37')]({},_0x461393,_0xe0b72d['options']);return db[_0x65f6('0x27')][_0x65f6('0x43')](_0x461393)[_0x65f6('0x21')](handleEntityNotFound(_0x2e91e8,null))[_0x65f6('0x21')](respondWithResult(_0x2e91e8,null))[_0x65f6('0x40')](handleError(_0x2e91e8,null));};exports[_0x65f6('0x44')]=function(_0x4d30c5,_0x51bf6c){return db[_0x65f6('0x27')][_0x65f6('0x44')](_0x4d30c5[_0x65f6('0x45')],{})[_0x65f6('0x21')](respondWithResult(_0x51bf6c,0xc9))[_0x65f6('0x40')](handleError(_0x51bf6c,null));};exports[_0x65f6('0x20')]=function(_0x149c28,_0x41690c){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x149c28[_0x65f6('0x42')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x41690c,null))[_0x65f6('0x21')](removeEntity(_0x41690c,null))['catch'](handleError(_0x41690c,null));};exports[_0x65f6('0x46')]=function(_0x42d453,_0x49ba5a){return db[_0x65f6('0x27')][_0x65f6('0x46')]()['then'](respondWithResult(_0x49ba5a,null))[_0x65f6('0x40')](handleError(_0x49ba5a,null));};exports['update']=function(_0x247be3,_0x3b241f){if(_0x247be3[_0x65f6('0x45')]['uniqueid']){delete _0x247be3[_0x65f6('0x45')][_0x65f6('0x47')];}return db['VoiceCallReport'][_0x65f6('0x43')]({'where':{'uniqueid':_0x247be3[_0x65f6('0x42')]['id'],'UserId':{'$or':[null,_0x247be3['user']['id']]}}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b241f,null))[_0x65f6('0x21')](saveUpdates(_0x247be3[_0x65f6('0x45')],null))[_0x65f6('0x21')](respondWithResult(_0x3b241f,null))[_0x65f6('0x40')](handleError(_0x3b241f,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index fb413f5..b487e6e 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 _0x6316=['../../config/environment','./voiceCallReport.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1c6339,_0x1df082){var _0x1f0c63=function(_0x3e62d9){while(--_0x3e62d9){_0x1c6339['push'](_0x1c6339['shift']());}};_0x1f0c63(++_0x1df082);}(_0x6316,0x170));var _0x6631=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6316[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x6631('0x0'));var util=require(_0x6631('0x1'));var logger=require(_0x6631('0x2'))(_0x6631('0x3'));var moment=require(_0x6631('0x4'));var BPromise=require(_0x6631('0x5'));var rp=require(_0x6631('0x6'));var fs=require('fs');var path=require(_0x6631('0x7'));var rimraf=require(_0x6631('0x8'));var config=require(_0x6631('0x9'));var attributes=require(_0x6631('0xa'));module[_0x6631('0xb')]=function(_0x59869d,_0xacfcf2){return _0x59869d[_0x6631('0xc')]('VoiceCallReport',attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9386=['request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','lodash','util','api','moment','bluebird'];(function(_0x836465,_0x5442ae){var _0x2150ea=function(_0x4f4bc2){while(--_0x4f4bc2){_0x836465['push'](_0x836465['shift']());}};_0x2150ea(++_0x5442ae);}(_0x9386,0x6b));var _0x6938=function(_0x4f01f8,_0x4386eb){_0x4f01f8=_0x4f01f8-0x0;var _0x385831=_0x9386[_0x4f01f8];return _0x385831;};'use strict';var _=require(_0x6938('0x0'));var util=require(_0x6938('0x1'));var logger=require('../../config/logger')(_0x6938('0x2'));var moment=require(_0x6938('0x3'));var BPromise=require(_0x6938('0x4'));var rp=require(_0x6938('0x5'));var fs=require('fs');var path=require(_0x6938('0x6'));var rimraf=require(_0x6938('0x7'));var config=require(_0x6938('0x8'));var attributes=require(_0x6938('0x9'));module[_0x6938('0xa')]=function(_0x55b42f,_0x4698ce){return _0x55b42f[_0x6938('0xb')](_0x6938('0xc'),attributes,{'tableName':_0x6938('0xd'),'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 ceeee77..a4b81bd 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 _0x5aff=['message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','attributes','map','include','model','stringify','body','CreateVoiceCallReport','UpdateVoiceCallReport','where','limit','lodash','util','moment','bluebird','jayson/promise','client','request','then','info','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','VoiceCallReport,\x20%s,\x20%s'];(function(_0x38698d,_0x5a08d3){var _0x53cbd8=function(_0x466a52){while(--_0x466a52){_0x38698d['push'](_0x38698d['shift']());}};_0x53cbd8(++_0x5a08d3);}(_0x5aff,0x1f2));var _0xf5af=function(_0x21a8eb,_0x2d3ca6){_0x21a8eb=_0x21a8eb-0x0;var _0x1b53fc=_0x5aff[_0x21a8eb];return _0x1b53fc;};'use strict';var _=require(_0xf5af('0x0'));var util=require(_0xf5af('0x1'));var moment=require(_0xf5af('0x2'));var BPromise=require(_0xf5af('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xf5af('0x4'));var client=jayson[_0xf5af('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x368c01,_0x575e67,_0x103dbd){return new BPromise(function(_0x1e9abf,_0x6e8397){return client[_0xf5af('0x6')](_0x368c01,_0x103dbd)[_0xf5af('0x7')](function(_0x55a54d){logger[_0xf5af('0x8')]('VoiceCallReport,\x20%s,\x20%s',_0x575e67,'request\x20sent');logger[_0xf5af('0x9')](_0xf5af('0xa'),_0x575e67,_0xf5af('0xb'),JSON['stringify'](_0x55a54d));if(_0x55a54d[_0xf5af('0xc')]){if(_0x55a54d['error']['code']===0x1f4){logger[_0xf5af('0xc')](_0xf5af('0xd'),_0x575e67,_0x55a54d['error'][_0xf5af('0xe')]);return _0x6e8397(_0x55a54d['error'][_0xf5af('0xe')]);}logger[_0xf5af('0xc')](_0xf5af('0xd'),_0x575e67,_0x55a54d['error'][_0xf5af('0xe')]);return _0x1e9abf(_0x55a54d['error'][_0xf5af('0xe')]);}else{logger['info'](_0xf5af('0xd'),_0x575e67,_0xf5af('0xb'));_0x1e9abf(_0x55a54d[_0xf5af('0xf')][_0xf5af('0xe')]);}})[_0xf5af('0x10')](function(_0xa45e05){logger['error'](_0xf5af('0xd'),_0x575e67,_0xa45e05);_0x6e8397(_0xa45e05);});});}exports[_0xf5af('0x11')]=function(_0x5efb54){var _0x3213b4=this;return new Promise(function(_0x865df5,_0x78f611){return db[_0xf5af('0x12')][_0xf5af('0x13')]({'raw':_0x5efb54[_0xf5af('0x14')]?_0x5efb54[_0xf5af('0x14')][_0xf5af('0x15')]===undefined?!![]:![]:!![],'where':_0x5efb54[_0xf5af('0x14')]?_0x5efb54[_0xf5af('0x14')]['where']||null:null,'attributes':_0x5efb54['options']?_0x5efb54[_0xf5af('0x14')][_0xf5af('0x16')]||null:null,'limit':_0x5efb54['options']?_0x5efb54[_0xf5af('0x14')]['limit']||null:null,'include':_0x5efb54[_0xf5af('0x14')]?_0x5efb54['options']['include']?_[_0xf5af('0x17')](_0x5efb54['options'][_0xf5af('0x18')],function(_0x202706){return{'model':db[_0x202706[_0xf5af('0x19')]],'as':_0x202706['as'],'attributes':_0x202706['attributes'],'include':_0x202706[_0xf5af('0x18')]?_[_0xf5af('0x17')](_0x202706[_0xf5af('0x18')],function(_0x1e0c2b){return{'model':db[_0x1e0c2b[_0xf5af('0x19')]],'as':_0x1e0c2b['as'],'attributes':_0x1e0c2b[_0xf5af('0x16')],'include':_0x1e0c2b['include']?_['map'](_0x1e0c2b[_0xf5af('0x18')],function(_0x347ba4){return{'model':db[_0x347ba4['model']],'as':_0x347ba4['as'],'attributes':_0x347ba4['attributes']};}):[]};}):[]};}):[]:[]})[_0xf5af('0x7')](function(_0x28ad45){logger[_0xf5af('0x8')](_0xf5af('0x11'),_0x5efb54);logger[_0xf5af('0x9')](_0xf5af('0x11'),_0x5efb54,JSON[_0xf5af('0x1a')](_0x28ad45));_0x865df5(_0x28ad45);})[_0xf5af('0x10')](function(_0x1c2fc8){logger[_0xf5af('0xc')](_0xf5af('0x11'),_0x1c2fc8[_0xf5af('0xe')],_0x5efb54);_0x78f611(_0x3213b4['error'](0x1f4,_0x1c2fc8[_0xf5af('0xe')]));});});};exports['CreateVoiceCallReport']=function(_0x1efdee){var _0x1d36ca=this;return new Promise(function(_0x4c7ec2,_0x2b83b7){return db[_0xf5af('0x12')]['create'](_0x1efdee[_0xf5af('0x1b')],{'raw':_0x1efdee[_0xf5af('0x14')]?_0x1efdee[_0xf5af('0x14')][_0xf5af('0x15')]===undefined?!![]:![]:!![]})['then'](function(_0x1bff33){logger['info'](_0xf5af('0x1c'),_0x1efdee);logger[_0xf5af('0x9')](_0xf5af('0x1c'),_0x1efdee,JSON[_0xf5af('0x1a')](_0x1bff33));_0x4c7ec2(_0x1bff33);})[_0xf5af('0x10')](function(_0x373cbb){logger['error'](_0xf5af('0x1c'),_0x373cbb[_0xf5af('0xe')],_0x1efdee);_0x2b83b7(_0x1d36ca[_0xf5af('0xc')](0x1f4,_0x373cbb['message']));});});};exports[_0xf5af('0x1d')]=function(_0x3223f7){var _0x3f8a5a=this;return new Promise(function(_0x1897a6,_0x35c3c9){return db[_0xf5af('0x12')]['update'](_0x3223f7[_0xf5af('0x1b')],{'raw':_0x3223f7[_0xf5af('0x14')]?_0x3223f7[_0xf5af('0x14')][_0xf5af('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3223f7[_0xf5af('0x14')]?_0x3223f7[_0xf5af('0x14')][_0xf5af('0x1e')]||null:null,'attributes':_0x3223f7[_0xf5af('0x14')]?_0x3223f7['options'][_0xf5af('0x16')]||null:null,'limit':_0x3223f7['options']?_0x3223f7[_0xf5af('0x14')][_0xf5af('0x1f')]||null:null})[_0xf5af('0x7')](function(_0x53bab9){logger[_0xf5af('0x8')](_0xf5af('0x1d'),_0x3223f7);logger[_0xf5af('0x9')]('UpdateVoiceCallReport',_0x3223f7,JSON[_0xf5af('0x1a')](_0x53bab9));_0x1897a6(_0x53bab9);})[_0xf5af('0x10')](function(_0x24f1e5){logger['error'](_0xf5af('0x1d'),_0x24f1e5[_0xf5af('0xe')],_0x3223f7);_0x35c3c9(_0x3f8a5a['error'](0x1f4,_0x24f1e5[_0xf5af('0xe')]));});});}; \ No newline at end of file +var _0xcf0a=['VoiceCallReport','create','body','UpdateVoiceCallReport','update','where','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetVoiceCallReport','findAll','options','raw','attributes','limit','include','model','map','CreateVoiceCallReport'];(function(_0xd7cea4,_0x125f5e){var _0x15bff0=function(_0x49b472){while(--_0x49b472){_0xd7cea4['push'](_0xd7cea4['shift']());}};_0x15bff0(++_0x125f5e);}(_0xcf0a,0x1e7));var _0xacf0=function(_0x4917d4,_0x3fdd01){_0x4917d4=_0x4917d4-0x0;var _0x382f7d=_0xcf0a[_0x4917d4];return _0x382f7d;};'use strict';var _=require(_0xacf0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xacf0('0x1'));var rs=require(_0xacf0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xacf0('0x3'))['db'];var utils=require(_0xacf0('0x4'));var logger=require('../../config/logger')(_0xacf0('0x5'));var config=require(_0xacf0('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xacf0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x43e131,_0x4d5ed4,_0x277c67){return new BPromise(function(_0x5067f9,_0x517c58){return client[_0xacf0('0x8')](_0x43e131,_0x277c67)[_0xacf0('0x9')](function(_0x111319){logger[_0xacf0('0xa')](_0xacf0('0xb'),_0x4d5ed4,'request\x20sent');logger[_0xacf0('0xc')](_0xacf0('0xd'),_0x4d5ed4,'request\x20sent',JSON[_0xacf0('0xe')](_0x111319));if(_0x111319[_0xacf0('0xf')]){if(_0x111319[_0xacf0('0xf')][_0xacf0('0x10')]===0x1f4){logger[_0xacf0('0xf')](_0xacf0('0xb'),_0x4d5ed4,_0x111319[_0xacf0('0xf')]['message']);return _0x517c58(_0x111319[_0xacf0('0xf')][_0xacf0('0x11')]);}logger[_0xacf0('0xf')](_0xacf0('0xb'),_0x4d5ed4,_0x111319[_0xacf0('0xf')][_0xacf0('0x11')]);return _0x5067f9(_0x111319[_0xacf0('0xf')]['message']);}else{logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x4d5ed4,_0xacf0('0x12'));_0x5067f9(_0x111319[_0xacf0('0x13')][_0xacf0('0x11')]);}})[_0xacf0('0x14')](function(_0x252e74){logger[_0xacf0('0xf')](_0xacf0('0xb'),_0x4d5ed4,_0x252e74);_0x517c58(_0x252e74);});});}exports[_0xacf0('0x15')]=function(_0x26fbeb){var _0x3dfc22=this;return new Promise(function(_0x2c250d,_0x5a8fd9){return db['VoiceCallReport'][_0xacf0('0x16')]({'raw':_0x26fbeb['options']?_0x26fbeb[_0xacf0('0x17')][_0xacf0('0x18')]===undefined?!![]:![]:!![],'where':_0x26fbeb[_0xacf0('0x17')]?_0x26fbeb['options']['where']||null:null,'attributes':_0x26fbeb[_0xacf0('0x17')]?_0x26fbeb[_0xacf0('0x17')][_0xacf0('0x19')]||null:null,'limit':_0x26fbeb[_0xacf0('0x17')]?_0x26fbeb[_0xacf0('0x17')][_0xacf0('0x1a')]||null:null,'include':_0x26fbeb[_0xacf0('0x17')]?_0x26fbeb[_0xacf0('0x17')][_0xacf0('0x1b')]?_['map'](_0x26fbeb['options'][_0xacf0('0x1b')],function(_0x5e6bee){return{'model':db[_0x5e6bee[_0xacf0('0x1c')]],'as':_0x5e6bee['as'],'attributes':_0x5e6bee[_0xacf0('0x19')],'include':_0x5e6bee[_0xacf0('0x1b')]?_['map'](_0x5e6bee[_0xacf0('0x1b')],function(_0x2b46d9){return{'model':db[_0x2b46d9[_0xacf0('0x1c')]],'as':_0x2b46d9['as'],'attributes':_0x2b46d9['attributes'],'include':_0x2b46d9[_0xacf0('0x1b')]?_[_0xacf0('0x1d')](_0x2b46d9[_0xacf0('0x1b')],function(_0x255f4f){return{'model':db[_0x255f4f[_0xacf0('0x1c')]],'as':_0x255f4f['as'],'attributes':_0x255f4f['attributes']};}):[]};}):[]};}):[]:[]})[_0xacf0('0x9')](function(_0xc410a9){logger[_0xacf0('0xa')](_0xacf0('0x15'),_0x26fbeb);logger[_0xacf0('0xc')](_0xacf0('0x15'),_0x26fbeb,JSON[_0xacf0('0xe')](_0xc410a9));_0x2c250d(_0xc410a9);})['catch'](function(_0x111640){logger['error']('GetVoiceCallReport',_0x111640['message'],_0x26fbeb);_0x5a8fd9(_0x3dfc22[_0xacf0('0xf')](0x1f4,_0x111640['message']));});});};exports[_0xacf0('0x1e')]=function(_0x588d9f){var _0x4b21da=this;return new Promise(function(_0x21c031,_0x6e9d82){return db[_0xacf0('0x1f')][_0xacf0('0x20')](_0x588d9f[_0xacf0('0x21')],{'raw':_0x588d9f[_0xacf0('0x17')]?_0x588d9f[_0xacf0('0x17')][_0xacf0('0x18')]===undefined?!![]:![]:!![]})[_0xacf0('0x9')](function(_0x36def8){logger[_0xacf0('0xa')](_0xacf0('0x1e'),_0x588d9f);logger[_0xacf0('0xc')](_0xacf0('0x1e'),_0x588d9f,JSON[_0xacf0('0xe')](_0x36def8));_0x21c031(_0x36def8);})[_0xacf0('0x14')](function(_0x248a87){logger['error'](_0xacf0('0x1e'),_0x248a87['message'],_0x588d9f);_0x6e9d82(_0x4b21da[_0xacf0('0xf')](0x1f4,_0x248a87[_0xacf0('0x11')]));});});};exports[_0xacf0('0x22')]=function(_0x873a90){var _0x394682=this;return new Promise(function(_0x37efa0,_0x2d9179){return db[_0xacf0('0x1f')][_0xacf0('0x23')](_0x873a90[_0xacf0('0x21')],{'raw':_0x873a90[_0xacf0('0x17')]?_0x873a90['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x873a90['options']?_0x873a90[_0xacf0('0x17')][_0xacf0('0x24')]||null:null,'attributes':_0x873a90[_0xacf0('0x17')]?_0x873a90[_0xacf0('0x17')][_0xacf0('0x19')]||null:null,'limit':_0x873a90[_0xacf0('0x17')]?_0x873a90[_0xacf0('0x17')][_0xacf0('0x1a')]||null:null})['then'](function(_0x1a267e){logger[_0xacf0('0xa')]('UpdateVoiceCallReport',_0x873a90);logger[_0xacf0('0xc')](_0xacf0('0x22'),_0x873a90,JSON[_0xacf0('0xe')](_0x1a267e));_0x37efa0(_0x1a267e);})['catch'](function(_0x4b0645){logger['error'](_0xacf0('0x22'),_0x4b0645[_0xacf0('0x11')],_0x873a90);_0x2d9179(_0x394682[_0xacf0('0xf')](0x1f4,_0x4b0645[_0xacf0('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 300de21..1dd733d 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 _0x6513=['../../config/environment','./voiceChanSpy.controller','isAuthenticated','get','/:id','post','create','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service'];(function(_0x5d06a2,_0xb58c21){var _0x2cb426=function(_0x308144){while(--_0x308144){_0x5d06a2['push'](_0x5d06a2['shift']());}};_0x2cb426(++_0xb58c21);}(_0x6513,0x17a));var _0x3651=function(_0xf0bc07,_0x510ebf){_0xf0bc07=_0xf0bc07-0x0;var _0x1c50c2=_0x6513[_0xf0bc07];return _0x1c50c2;};'use strict';var multer=require(_0x3651('0x0'));var util=require(_0x3651('0x1'));var path=require(_0x3651('0x2'));var timeout=require(_0x3651('0x3'));var express=require(_0x3651('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3651('0x5'));var config=require(_0x3651('0x6'));var controller=require(_0x3651('0x7'));router['get']('/',auth[_0x3651('0x8')](),controller['index']);router[_0x3651('0x9')](_0x3651('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x3651('0xb')]('/',auth[_0x3651('0x8')](),controller[_0x3651('0xc')]);router['put'](_0x3651('0xa'),auth[_0x3651('0x8')](),controller[_0x3651('0xd')]);router['delete'](_0x3651('0xa'),auth['isAuthenticated'](),controller[_0x3651('0xe')]);module[_0x3651('0xf')]=router; \ No newline at end of file +var _0x87c4=['get','isAuthenticated','index','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceChanSpy.controller'];(function(_0x28d661,_0x2f9212){var _0x45873a=function(_0x499c42){while(--_0x499c42){_0x28d661['push'](_0x28d661['shift']());}};_0x45873a(++_0x2f9212);}(_0x87c4,0x19a));var _0x487c=function(_0x48e0e3,_0x448060){_0x48e0e3=_0x48e0e3-0x0;var _0x3c7450=_0x87c4[_0x48e0e3];return _0x3c7450;};'use strict';var multer=require(_0x487c('0x0'));var util=require(_0x487c('0x1'));var path=require(_0x487c('0x2'));var timeout=require(_0x487c('0x3'));var express=require(_0x487c('0x4'));var router=express[_0x487c('0x5')]();var fs_extra=require(_0x487c('0x6'));var auth=require(_0x487c('0x7'));var interaction=require(_0x487c('0x8'));var config=require('../../config/environment');var controller=require(_0x487c('0x9'));router[_0x487c('0xa')]('/',auth[_0x487c('0xb')](),controller[_0x487c('0xc')]);router[_0x487c('0xa')]('/:id',auth[_0x487c('0xb')](),controller['show']);router[_0x487c('0xd')]('/',auth[_0x487c('0xb')](),controller[_0x487c('0xe')]);router[_0x487c('0xf')](_0x487c('0x10'),auth[_0x487c('0xb')](),controller[_0x487c('0x11')]);router[_0x487c('0x12')](_0x487c('0x10'),auth[_0x487c('0xb')](),controller[_0x487c('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 6c07a55..ff79934 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 _0x0e4e=['name','setDataValue','join','getDataValue','options','split','BOOLEAN','exports','STRING'];(function(_0x183fc2,_0x373657){var _0x3a51ef=function(_0x25f0b3){while(--_0x25f0b3){_0x183fc2['push'](_0x183fc2['shift']());}};_0x3a51ef(++_0x373657);}(_0x0e4e,0xfa));var _0xe0e4=function(_0x29eb10,_0x190cb3){_0x29eb10=_0x29eb10-0x0;var _0x5371a2=_0x0e4e[_0x29eb10];return _0x5371a2;};'use strict';var Sequelize=require('sequelize');module[_0xe0e4('0x0')]={'name':{'type':Sequelize[_0xe0e4('0x1')]},'prefix':{'type':Sequelize[_0xe0e4('0x1')],'unique':_0xe0e4('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0xe0e4('0x1')],'set':function(_0x9b9d2b){this[_0xe0e4('0x3')]('options',_0x9b9d2b?_0x9b9d2b[_0xe0e4('0x4')](''):[]);},'get':function(){return this[_0xe0e4('0x5')]('options')?this[_0xe0e4('0x5')](_0xe0e4('0x6'))[_0xe0e4('0x7')](''):[];}},'auth':{'type':Sequelize[_0xe0e4('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0xe0e4('0x1')]},'record':{'type':Sequelize[_0xe0e4('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xe0e4('0x1')]},'description':{'type':Sequelize[_0xe0e4('0x1')]}}; \ No newline at end of file +var _0xfa7e=['options','join','getDataValue','split','BOOLEAN','exports','STRING','name'];(function(_0x37f84a,_0x2c81f5){var _0x5c1d26=function(_0x11b10e){while(--_0x11b10e){_0x37f84a['push'](_0x37f84a['shift']());}};_0x5c1d26(++_0x2c81f5);}(_0xfa7e,0xf5));var _0xefa7=function(_0x5c6994,_0x19ad9a){_0x5c6994=_0x5c6994-0x0;var _0x1d5c84=_0xfa7e[_0x5c6994];return _0x1d5c84;};'use strict';var Sequelize=require('sequelize');module[_0xefa7('0x0')]={'name':{'type':Sequelize[_0xefa7('0x1')]},'prefix':{'type':Sequelize[_0xefa7('0x1')],'unique':_0xefa7('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0xefa7('0x1')],'set':function(_0x4f30ef){this['setDataValue'](_0xefa7('0x3'),_0x4f30ef?_0x4f30ef[_0xefa7('0x4')](''):[]);},'get':function(){return this['getDataValue'](_0xefa7('0x3'))?this[_0xefa7('0x5')](_0xefa7('0x3'))[_0xefa7('0x6')](''):[];}},'auth':{'type':Sequelize[_0xefa7('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0xefa7('0x1')]},'record':{'type':Sequelize[_0xefa7('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xefa7('0x1')]},'description':{'type':Sequelize[_0xefa7('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 7bdb086..324eefb 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 _0xcb18=['role','get','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','set','Content-Range','apply','reject','save','destroy','then','ChanSpies','error','stack','name','send','index','VoiceChanSpy','rawAttributes','fieldName','type','key','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','filter','options','includeAll','include','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x164738,_0x294ea3){var _0x202fd9=function(_0x2383d8){while(--_0x2383d8){_0x164738['push'](_0x164738['shift']());}};_0x202fd9(++_0x294ea3);}(_0xcb18,0x159));var _0x8cb1=function(_0x4ae24e,_0x579d9f){_0x4ae24e=_0x4ae24e-0x0;var _0x386083=_0xcb18[_0x4ae24e];return _0x386083;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8cb1('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8cb1('0x1'));var moment=require('moment');var BPromise=require(_0x8cb1('0x2'));var Mustache=require(_0x8cb1('0x3'));var util=require(_0x8cb1('0x4'));var path=require(_0x8cb1('0x5'));var sox=require(_0x8cb1('0x6'));var csv=require(_0x8cb1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8cb1('0x8'));var _=require(_0x8cb1('0x9'));var squel=require('squel');var crypto=require(_0x8cb1('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x8cb1('0xb'));var toCsv=require(_0x8cb1('0x7'));var querystring=require('querystring');var Papa=require(_0x8cb1('0xc'));var Redis=require(_0x8cb1('0xd'));var authService=require(_0x8cb1('0xe'));var qs=require(_0x8cb1('0xf'));var as=require(_0x8cb1('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8cb1('0x11'))(_0x8cb1('0x12'));var utils=require(_0x8cb1('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x8cb1('0x14'));var db=require(_0x8cb1('0x15'))['db'];function respondWithStatusCode(_0xe1f6d5,_0x14bb49){_0x14bb49=_0x14bb49||0xcc;return function(_0x38b148){if(_0x38b148){return _0xe1f6d5[_0x8cb1('0x16')](_0x14bb49);}return _0xe1f6d5['status'](_0x14bb49)[_0x8cb1('0x17')]();};}function respondWithResult(_0x5d6bbe,_0xacc6db){_0xacc6db=_0xacc6db||0xc8;return function(_0x2fe7a3){if(_0x2fe7a3){return _0x5d6bbe[_0x8cb1('0x18')](_0xacc6db)[_0x8cb1('0x19')](_0x2fe7a3);}};}function respondWithFilteredResult(_0x2a3e22,_0x1f9014){return function(_0x576470){if(_0x576470){var _0x1f34f8=typeof _0x1f9014['offset']==='undefined'&&typeof _0x1f9014['limit']===_0x8cb1('0x1a');var _0x450d05=_0x576470[_0x8cb1('0x1b')];var _0x49d1ef=_0x1f34f8?0x0:_0x1f9014[_0x8cb1('0x1c')];var _0x14c1fa=_0x1f34f8?_0x576470['count']:_0x1f9014['offset']+_0x1f9014['limit'];var _0x2ecfe5;if(_0x14c1fa>=_0x450d05){_0x14c1fa=_0x450d05;_0x2ecfe5=0xc8;}else{_0x2ecfe5=0xce;}_0x2a3e22['status'](_0x2ecfe5);return _0x2a3e22[_0x8cb1('0x1d')](_0x8cb1('0x1e'),_0x49d1ef+'-'+_0x14c1fa+'/'+_0x450d05)[_0x8cb1('0x19')](_0x576470);}return null;};}function patchUpdates(_0x9b64e9){return function(_0x5f3b9c){try{jsonpatch[_0x8cb1('0x1f')](_0x5f3b9c,_0x9b64e9,!![]);}catch(_0x5df496){return BPromise[_0x8cb1('0x20')](_0x5df496);}return _0x5f3b9c[_0x8cb1('0x21')]();};}function saveUpdates(_0x14c649,_0x5c3554){return function(_0x3bc045){if(_0x3bc045){return _0x3bc045['update'](_0x14c649)['then'](function(_0x4a6569){return _0x4a6569;});}return null;};}function removeEntity(_0x33cb0e,_0x5d34d4){return function(_0x19886c){if(_0x19886c){return _0x19886c[_0x8cb1('0x22')]()[_0x8cb1('0x23')](function(){var _0x497d72=_0x19886c['get']({'plain':!![]});var _0x3e8fd1=_0x8cb1('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x3e8fd1,'resourceId':_0x497d72['id']}})[_0x8cb1('0x23')](function(){return _0x19886c;});})['then'](function(){_0x33cb0e[_0x8cb1('0x18')](0xcc)[_0x8cb1('0x17')]();});}};}function handleEntityNotFound(_0xe9ef53,_0xb8b995){return function(_0x318eb2){if(!_0x318eb2){_0xe9ef53[_0x8cb1('0x16')](0x194);}return _0x318eb2;};}function handleError(_0x145a38,_0x353e9f){_0x353e9f=_0x353e9f||0x1f4;return function(_0x26f399){logger[_0x8cb1('0x25')](_0x26f399[_0x8cb1('0x26')]);if(_0x26f399['name']){delete _0x26f399[_0x8cb1('0x27')];}_0x145a38[_0x8cb1('0x18')](_0x353e9f)[_0x8cb1('0x28')](_0x26f399);};}exports[_0x8cb1('0x29')]=function(_0x2325f2,_0x447f68){var _0x56169b={},_0x475898={},_0x389790={'count':0x0,'rows':[]};var _0x203cb3=_['map'](db[_0x8cb1('0x2a')][_0x8cb1('0x2b')],function(_0x499992){return{'name':_0x499992[_0x8cb1('0x2c')],'type':_0x499992[_0x8cb1('0x2d')][_0x8cb1('0x2e')]};});_0x475898[_0x8cb1('0x2f')]=_[_0x8cb1('0x30')](_0x203cb3,_0x8cb1('0x27'));_0x475898['query']=_[_0x8cb1('0x31')](_0x2325f2[_0x8cb1('0x32')]);_0x475898[_0x8cb1('0x33')]=_['intersection'](_0x475898[_0x8cb1('0x2f')],_0x475898[_0x8cb1('0x32')]);_0x56169b[_0x8cb1('0x34')]=_[_0x8cb1('0x35')](_0x475898['model'],qs[_0x8cb1('0x36')](_0x2325f2[_0x8cb1('0x32')][_0x8cb1('0x36')]));_0x56169b[_0x8cb1('0x34')]=_0x56169b[_0x8cb1('0x34')][_0x8cb1('0x37')]?_0x56169b[_0x8cb1('0x34')]:_0x475898[_0x8cb1('0x2f')];if(!_0x2325f2['query'][_0x8cb1('0x38')](_0x8cb1('0x39'))){_0x56169b['limit']=qs[_0x8cb1('0x3a')](_0x2325f2['query'][_0x8cb1('0x3a')]);_0x56169b[_0x8cb1('0x1c')]=qs['offset'](_0x2325f2['query'][_0x8cb1('0x1c')]);}_0x56169b[_0x8cb1('0x3b')]=qs[_0x8cb1('0x3c')](_0x2325f2[_0x8cb1('0x32')][_0x8cb1('0x3c')]);_0x56169b[_0x8cb1('0x3d')]=qs['filters'](_[_0x8cb1('0x3e')](_0x2325f2[_0x8cb1('0x32')],_0x475898[_0x8cb1('0x33')]),_0x203cb3);if(_0x2325f2[_0x8cb1('0x32')]['filter']){_0x56169b[_0x8cb1('0x3d')]=_[_0x8cb1('0x3f')](_0x56169b[_0x8cb1('0x3d')],{'$or':_['map'](_0x203cb3,function(_0xa6fbf0){if(_0xa6fbf0[_0x8cb1('0x2d')]!=='VIRTUAL'){var _0x40ba19={};_0x40ba19[_0xa6fbf0['name']]={'$like':'%'+_0x2325f2[_0x8cb1('0x32')][_0x8cb1('0x40')]+'%'};return _0x40ba19;}})});}_0x56169b=_['merge']({},_0x56169b,_0x2325f2[_0x8cb1('0x41')]);var _0x5b70b4={'where':_0x56169b[_0x8cb1('0x3d')]};return db['VoiceChanSpy']['count'](_0x5b70b4)[_0x8cb1('0x23')](function(_0x1e10a6){_0x389790['count']=_0x1e10a6;if(_0x2325f2[_0x8cb1('0x32')][_0x8cb1('0x42')]){_0x56169b[_0x8cb1('0x43')]=[{'all':!![]}];}return db['VoiceChanSpy']['findAll'](_0x56169b);})['then'](function(_0x43c9ce){_0x389790['rows']=_0x43c9ce;return _0x389790;})[_0x8cb1('0x23')](respondWithFilteredResult(_0x447f68,_0x56169b))[_0x8cb1('0x44')](handleError(_0x447f68,null));};exports[_0x8cb1('0x45')]=function(_0x256d2b,_0x30929c){var _0x23dff6={'raw':![],'where':{'id':_0x256d2b[_0x8cb1('0x46')]['id']}},_0x5701cd={};_0x5701cd[_0x8cb1('0x2f')]=_[_0x8cb1('0x31')](db['VoiceChanSpy'][_0x8cb1('0x2b')]);_0x5701cd[_0x8cb1('0x32')]=_[_0x8cb1('0x31')](_0x256d2b[_0x8cb1('0x32')]);_0x5701cd[_0x8cb1('0x33')]=_[_0x8cb1('0x35')](_0x5701cd[_0x8cb1('0x2f')],_0x5701cd['query']);_0x23dff6[_0x8cb1('0x34')]=_[_0x8cb1('0x35')](_0x5701cd['model'],qs[_0x8cb1('0x36')](_0x256d2b[_0x8cb1('0x32')][_0x8cb1('0x36')]));_0x23dff6[_0x8cb1('0x34')]=_0x23dff6['attributes'][_0x8cb1('0x37')]?_0x23dff6['attributes']:_0x5701cd[_0x8cb1('0x2f')];if(_0x256d2b[_0x8cb1('0x32')][_0x8cb1('0x42')]){_0x23dff6[_0x8cb1('0x43')]=[{'all':!![]}];}_0x23dff6=_['merge']({},_0x23dff6,_0x256d2b[_0x8cb1('0x41')]);return db['VoiceChanSpy']['find'](_0x23dff6)[_0x8cb1('0x23')](handleEntityNotFound(_0x30929c,null))[_0x8cb1('0x23')](respondWithResult(_0x30929c,null))[_0x8cb1('0x44')](handleError(_0x30929c,null));};exports[_0x8cb1('0x47')]=function(_0x1acb87,_0x436fff){return db[_0x8cb1('0x2a')][_0x8cb1('0x47')](_0x1acb87[_0x8cb1('0x48')],{})['then'](function(_0x1fe5ab){var _0x4db780=_0x1acb87[_0x8cb1('0x49')]['get']({'plain':!![]});if(!_0x4db780)throw new Error(_0x8cb1('0x4a'));if(_0x4db780[_0x8cb1('0x4b')]==='user'){var _0x574183=_0x1fe5ab[_0x8cb1('0x4c')]({'plain':!![]});var _0x596f35=_0x8cb1('0x24');return db[_0x8cb1('0x4d')][_0x8cb1('0x4e')]({'where':{'name':_0x596f35,'userProfileId':_0x4db780[_0x8cb1('0x4f')]},'raw':!![]})['then'](function(_0x3b2799){if(_0x3b2799&&_0x3b2799[_0x8cb1('0x50')]===0x0){return db[_0x8cb1('0x51')][_0x8cb1('0x47')]({'name':_0x574183[_0x8cb1('0x27')],'resourceId':_0x574183['id'],'type':_0x3b2799[_0x8cb1('0x27')],'sectionId':_0x3b2799['id']},{})[_0x8cb1('0x23')](function(){return _0x1fe5ab;});}else{return _0x1fe5ab;}})['catch'](function(_0x2d563d){logger['error'](_0x8cb1('0x52'),_0x2d563d);throw _0x2d563d;});}return _0x1fe5ab;})[_0x8cb1('0x23')](respondWithResult(_0x436fff,0xc9))['catch'](handleError(_0x436fff,null));};exports[_0x8cb1('0x53')]=function(_0xbcc789,_0x249470){if(_0xbcc789[_0x8cb1('0x48')]['id']){delete _0xbcc789['body']['id'];}return db[_0x8cb1('0x2a')][_0x8cb1('0x4e')]({'where':{'id':_0xbcc789[_0x8cb1('0x46')]['id']}})[_0x8cb1('0x23')](handleEntityNotFound(_0x249470,null))['then'](saveUpdates(_0xbcc789[_0x8cb1('0x48')],null))[_0x8cb1('0x23')](respondWithResult(_0x249470,null))[_0x8cb1('0x44')](handleError(_0x249470,null));};exports[_0x8cb1('0x22')]=function(_0x161aeb,_0x180b92){return db['VoiceChanSpy'][_0x8cb1('0x4e')]({'where':{'id':_0x161aeb[_0x8cb1('0x46')]['id']}})[_0x8cb1('0x23')](handleEntityNotFound(_0x180b92,null))[_0x8cb1('0x23')](removeEntity(_0x180b92,null))[_0x8cb1('0x44')](handleError(_0x180b92,null));}; \ No newline at end of file +var _0x684c=['includeAll','rows','params','catch','create','body','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','destroy','eml-format','rimraf','fast-json-patch','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','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','count','offset','limit','set','Content-Range','apply','reject','ChanSpies','UserProfileResource','then','error','name','send','index','map','VoiceChanSpy','fieldName','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options'];(function(_0x432465,_0x30ce18){var _0x589592=function(_0x21e15c){while(--_0x21e15c){_0x432465['push'](_0x432465['shift']());}};_0x589592(++_0x30ce18);}(_0x684c,0x1b3));var _0xc684=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x684c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc684('0x0'));var rimraf=require(_0xc684('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc684('0x2'));var rp=require(_0xc684('0x3'));var moment=require(_0xc684('0x4'));var BPromise=require(_0xc684('0x5'));var Mustache=require(_0xc684('0x6'));var util=require('util');var path=require(_0xc684('0x7'));var sox=require(_0xc684('0x8'));var csv=require(_0xc684('0x9'));var ejs=require(_0xc684('0xa'));var fs=require('fs');var fs_extra=require(_0xc684('0xb'));var _=require(_0xc684('0xc'));var squel=require(_0xc684('0xd'));var crypto=require(_0xc684('0xe'));var jsforce=require(_0xc684('0xf'));var deskjs=require(_0xc684('0x10'));var toCsv=require(_0xc684('0x9'));var querystring=require(_0xc684('0x11'));var Papa=require(_0xc684('0x12'));var Redis=require(_0xc684('0x13'));var authService=require(_0xc684('0x14'));var qs=require(_0xc684('0x15'));var as=require(_0xc684('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc684('0x17'))(_0xc684('0x18'));var utils=require(_0xc684('0x19'));var config=require(_0xc684('0x1a'));var licenseUtil=require(_0xc684('0x1b'));var db=require(_0xc684('0x1c'))['db'];function respondWithStatusCode(_0x4f3ff9,_0x3004a6){_0x3004a6=_0x3004a6||0xcc;return function(_0x10cc25){if(_0x10cc25){return _0x4f3ff9['sendStatus'](_0x3004a6);}return _0x4f3ff9['status'](_0x3004a6)[_0xc684('0x1d')]();};}function respondWithResult(_0x34cfd7,_0x32d5da){_0x32d5da=_0x32d5da||0xc8;return function(_0x2ad4f1){if(_0x2ad4f1){return _0x34cfd7[_0xc684('0x1e')](_0x32d5da)[_0xc684('0x1f')](_0x2ad4f1);}};}function respondWithFilteredResult(_0x4f26f7,_0x56d76f){return function(_0x43235d){if(_0x43235d){var _0x599c93=typeof _0x56d76f['offset']==='undefined'&&typeof _0x56d76f['limit']==='undefined';var _0x264cb5=_0x43235d[_0xc684('0x20')];var _0x3b6f5e=_0x599c93?0x0:_0x56d76f[_0xc684('0x21')];var _0x1c3af5=_0x599c93?_0x43235d['count']:_0x56d76f[_0xc684('0x21')]+_0x56d76f[_0xc684('0x22')];var _0x4afdd0;if(_0x1c3af5>=_0x264cb5){_0x1c3af5=_0x264cb5;_0x4afdd0=0xc8;}else{_0x4afdd0=0xce;}_0x4f26f7[_0xc684('0x1e')](_0x4afdd0);return _0x4f26f7[_0xc684('0x23')](_0xc684('0x24'),_0x3b6f5e+'-'+_0x1c3af5+'/'+_0x264cb5)['json'](_0x43235d);}return null;};}function patchUpdates(_0x62c4e5){return function(_0x11a159){try{jsonpatch[_0xc684('0x25')](_0x11a159,_0x62c4e5,!![]);}catch(_0xe7aadb){return BPromise[_0xc684('0x26')](_0xe7aadb);}return _0x11a159['save']();};}function saveUpdates(_0x13d43f,_0x39f39a){return function(_0x1fb8b0){if(_0x1fb8b0){return _0x1fb8b0['update'](_0x13d43f)['then'](function(_0x5a7b2e){return _0x5a7b2e;});}return null;};}function removeEntity(_0x41162b,_0x15ce5d){return function(_0xd2a943){if(_0xd2a943){return _0xd2a943['destroy']()['then'](function(){var _0x4e68e0=_0xd2a943['get']({'plain':!![]});var _0x27c7cc=_0xc684('0x27');return db[_0xc684('0x28')]['destroy']({'where':{'type':_0x27c7cc,'resourceId':_0x4e68e0['id']}})[_0xc684('0x29')](function(){return _0xd2a943;});})['then'](function(){_0x41162b[_0xc684('0x1e')](0xcc)[_0xc684('0x1d')]();});}};}function handleEntityNotFound(_0x13e09d,_0x49dad1){return function(_0x1f8e85){if(!_0x1f8e85){_0x13e09d['sendStatus'](0x194);}return _0x1f8e85;};}function handleError(_0x279998,_0x640ca1){_0x640ca1=_0x640ca1||0x1f4;return function(_0x210dcd){logger[_0xc684('0x2a')](_0x210dcd['stack']);if(_0x210dcd[_0xc684('0x2b')]){delete _0x210dcd[_0xc684('0x2b')];}_0x279998[_0xc684('0x1e')](_0x640ca1)[_0xc684('0x2c')](_0x210dcd);};}exports[_0xc684('0x2d')]=function(_0x1e029c,_0x10db0d){var _0x3abd2d={},_0x4df4d4={},_0x5c47ab={'count':0x0,'rows':[]};var _0x4e1d09=_[_0xc684('0x2e')](db[_0xc684('0x2f')]['rawAttributes'],function(_0x4e46c2){return{'name':_0x4e46c2[_0xc684('0x30')],'type':_0x4e46c2['type'][_0xc684('0x31')]};});_0x4df4d4[_0xc684('0x32')]=_[_0xc684('0x2e')](_0x4e1d09,'name');_0x4df4d4['query']=_[_0xc684('0x33')](_0x1e029c[_0xc684('0x34')]);_0x4df4d4['filters']=_['intersection'](_0x4df4d4[_0xc684('0x32')],_0x4df4d4[_0xc684('0x34')]);_0x3abd2d[_0xc684('0x35')]=_[_0xc684('0x36')](_0x4df4d4[_0xc684('0x32')],qs[_0xc684('0x37')](_0x1e029c['query'][_0xc684('0x37')]));_0x3abd2d['attributes']=_0x3abd2d['attributes'][_0xc684('0x38')]?_0x3abd2d[_0xc684('0x35')]:_0x4df4d4['model'];if(!_0x1e029c['query'][_0xc684('0x39')](_0xc684('0x3a'))){_0x3abd2d[_0xc684('0x22')]=qs[_0xc684('0x22')](_0x1e029c[_0xc684('0x34')]['limit']);_0x3abd2d[_0xc684('0x21')]=qs[_0xc684('0x21')](_0x1e029c['query']['offset']);}_0x3abd2d[_0xc684('0x3b')]=qs[_0xc684('0x3c')](_0x1e029c[_0xc684('0x34')][_0xc684('0x3c')]);_0x3abd2d[_0xc684('0x3d')]=qs[_0xc684('0x3e')](_[_0xc684('0x3f')](_0x1e029c['query'],_0x4df4d4['filters']),_0x4e1d09);if(_0x1e029c[_0xc684('0x34')][_0xc684('0x40')]){_0x3abd2d['where']=_['merge'](_0x3abd2d['where'],{'$or':_[_0xc684('0x2e')](_0x4e1d09,function(_0x4a9320){if(_0x4a9320[_0xc684('0x41')]!==_0xc684('0x42')){var _0x2649ee={};_0x2649ee[_0x4a9320['name']]={'$like':'%'+_0x1e029c[_0xc684('0x34')]['filter']+'%'};return _0x2649ee;}})});}_0x3abd2d=_[_0xc684('0x43')]({},_0x3abd2d,_0x1e029c[_0xc684('0x44')]);var _0x380e7c={'where':_0x3abd2d[_0xc684('0x3d')]};return db['VoiceChanSpy'][_0xc684('0x20')](_0x380e7c)[_0xc684('0x29')](function(_0xd9eae7){_0x5c47ab[_0xc684('0x20')]=_0xd9eae7;if(_0x1e029c[_0xc684('0x34')][_0xc684('0x45')]){_0x3abd2d['include']=[{'all':!![]}];}return db[_0xc684('0x2f')]['findAll'](_0x3abd2d);})['then'](function(_0x46c6ad){_0x5c47ab[_0xc684('0x46')]=_0x46c6ad;return _0x5c47ab;})[_0xc684('0x29')](respondWithFilteredResult(_0x10db0d,_0x3abd2d))['catch'](handleError(_0x10db0d,null));};exports['show']=function(_0x4f288b,_0x4ebd3e){var _0x4d0586={'raw':![],'where':{'id':_0x4f288b[_0xc684('0x47')]['id']}},_0x189b26={};_0x189b26[_0xc684('0x32')]=_['keys'](db[_0xc684('0x2f')]['rawAttributes']);_0x189b26[_0xc684('0x34')]=_['keys'](_0x4f288b[_0xc684('0x34')]);_0x189b26[_0xc684('0x3e')]=_[_0xc684('0x36')](_0x189b26[_0xc684('0x32')],_0x189b26[_0xc684('0x34')]);_0x4d0586['attributes']=_[_0xc684('0x36')](_0x189b26[_0xc684('0x32')],qs[_0xc684('0x37')](_0x4f288b[_0xc684('0x34')][_0xc684('0x37')]));_0x4d0586[_0xc684('0x35')]=_0x4d0586[_0xc684('0x35')][_0xc684('0x38')]?_0x4d0586[_0xc684('0x35')]:_0x189b26['model'];if(_0x4f288b[_0xc684('0x34')][_0xc684('0x45')]){_0x4d0586['include']=[{'all':!![]}];}_0x4d0586=_[_0xc684('0x43')]({},_0x4d0586,_0x4f288b['options']);return db[_0xc684('0x2f')]['find'](_0x4d0586)[_0xc684('0x29')](handleEntityNotFound(_0x4ebd3e,null))[_0xc684('0x29')](respondWithResult(_0x4ebd3e,null))[_0xc684('0x48')](handleError(_0x4ebd3e,null));};exports[_0xc684('0x49')]=function(_0x1bfd8d,_0x1fde57){return db[_0xc684('0x2f')][_0xc684('0x49')](_0x1bfd8d[_0xc684('0x4a')],{})[_0xc684('0x29')](function(_0x4abd04){var _0x16951f=_0x1bfd8d[_0xc684('0x4b')]['get']({'plain':!![]});if(!_0x16951f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16951f['role']===_0xc684('0x4b')){var _0x1304a2=_0x4abd04[_0xc684('0x4c')]({'plain':!![]});var _0x34b2cd=_0xc684('0x27');return db[_0xc684('0x4d')]['find']({'where':{'name':_0x34b2cd,'userProfileId':_0x16951f[_0xc684('0x4e')]},'raw':!![]})[_0xc684('0x29')](function(_0x16f039){if(_0x16f039&&_0x16f039[_0xc684('0x4f')]===0x0){return db[_0xc684('0x28')]['create']({'name':_0x1304a2[_0xc684('0x2b')],'resourceId':_0x1304a2['id'],'type':_0x16f039[_0xc684('0x2b')],'sectionId':_0x16f039['id']},{})['then'](function(){return _0x4abd04;});}else{return _0x4abd04;}})[_0xc684('0x48')](function(_0x7af88c){logger[_0xc684('0x2a')](_0xc684('0x50'),_0x7af88c);throw _0x7af88c;});}return _0x4abd04;})[_0xc684('0x29')](respondWithResult(_0x1fde57,0xc9))['catch'](handleError(_0x1fde57,null));};exports[_0xc684('0x51')]=function(_0x4d3484,_0x3c6f05){if(_0x4d3484[_0xc684('0x4a')]['id']){delete _0x4d3484[_0xc684('0x4a')]['id'];}return db[_0xc684('0x2f')][_0xc684('0x52')]({'where':{'id':_0x4d3484[_0xc684('0x47')]['id']}})[_0xc684('0x29')](handleEntityNotFound(_0x3c6f05,null))[_0xc684('0x29')](saveUpdates(_0x4d3484[_0xc684('0x4a')],null))['then'](respondWithResult(_0x3c6f05,null))['catch'](handleError(_0x3c6f05,null));};exports[_0xc684('0x53')]=function(_0x49218e,_0x2b2d54){return db['VoiceChanSpy']['find']({'where':{'id':_0x49218e[_0xc684('0x47')]['id']}})[_0xc684('0x29')](handleEntityNotFound(_0x2b2d54,null))[_0xc684('0x29')](removeEntity(_0x2b2d54,null))[_0xc684('0x48')](handleError(_0x2b2d54,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 58d362f..69d6794 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 _0x2ec5=['bulkCreate','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','from-sip','format','%s%s','prefix','push','Set','CDR(type)=%s','chanspy','${UNIQUEID}.%s,a','recordingFormat','auth','merge','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','concat','internal','findAll','agent','then','catch','exports','models','define','voice_chanspy','length','VoiceExtension'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x2ec5,0x9a));var _0x52ec=function(_0x33d251,_0x71aab6){_0x33d251=_0x33d251-0x0;var _0x17d3c8=_0x2ec5[_0x33d251];return _0x17d3c8;};'use strict';var _=require(_0x52ec('0x0'));var util=require(_0x52ec('0x1'));var BPromise=require(_0x52ec('0x2'));var attributes=require(_0x52ec('0x3'));var getUserApplications=function(_0x3e0456,_0x4db35f,_0x5c31dd){var _0x248442=0x1;var _0x5093b2=[];var _0x25f574={'context':_0x4db35f['context']||_0x52ec('0x4'),'exten':util[_0x52ec('0x5')](_0x52ec('0x6'),_0x3e0456[_0x52ec('0x7')],_0x5c31dd),'type':'system','isApp':![],'ChanSpyId':_0x3e0456['id'],'UserId':_0x4db35f['id']};_0x5093b2[_0x52ec('0x8')](_['merge']({'app':_0x52ec('0x9'),'appdata':util[_0x52ec('0x5')](_0x52ec('0xa'),_0x52ec('0xb')),'priority':_0x248442++},_0x25f574));if(_0x3e0456['record']){_0x5093b2[_0x52ec('0x8')](_['merge']({'app':'MixMonitor','appdata':util[_0x52ec('0x5')](_0x52ec('0xc'),_0x3e0456[_0x52ec('0xd')]),'priority':_0x248442++},_0x25f574));}if(_0x3e0456[_0x52ec('0xe')]){_0x5093b2[_0x52ec('0x8')](_[_0x52ec('0xf')]({'app':_0x52ec('0x10'),'appdata':_0x3e0456[_0x52ec('0x11')],'priority':_0x248442++},_0x25f574));}_0x5093b2[_0x52ec('0x8')](_[_0x52ec('0xf')]({'app':_0x52ec('0x12'),'appdata':util[_0x52ec('0x5')](_0x52ec('0x13'),_0x4db35f[_0x52ec('0x14')],_0x3e0456[_0x52ec('0x15')]?_0x3e0456[_0x52ec('0x15')][_0x52ec('0x16')](''):''),'priority':_0x248442++},_0x25f574));if(_0x3e0456['record']){_0x5093b2['push'](_['merge']({'app':_0x52ec('0x17'),'priority':_0x248442++},_0x25f574));}return _0x5093b2;};var getChanSpyApplications=function(_0xb3d7b7,_0x1d4016){var _0x449bfa=[];for(var _0x106793=0x0,_0x44e167=0x1;_0x106793<_0x1d4016['length'];_0x106793++,_0x44e167=0x1){_0x449bfa=_0x449bfa[_0x52ec('0x18')](getUserApplications(_0xb3d7b7,_0x1d4016[_0x106793],_0x1d4016[_0x106793][_0x52ec('0x19')]));if(_0x1d4016[_0x106793]['internal']!=_0x1d4016[_0x106793]['name']){_0x449bfa=_0x449bfa[_0x52ec('0x18')](getUserApplications(_0xb3d7b7,_0x1d4016[_0x106793],_0x1d4016[_0x106793]['name']));}}return _0x449bfa;};var getChanSpyPromise=function(_0x3736d8,_0x326da4){return new BPromise(function(_0x51d683,_0x3c8c0a){return _0x3736d8['User'][_0x52ec('0x1a')]({'attributes':['id',_0x52ec('0x14'),_0x52ec('0x19')],'where':{'role':_0x52ec('0x1b'),'chanspy':!![]},'raw':!![]})[_0x52ec('0x1c')](function(_0x3dc06f){if(_0x3dc06f){return _0x51d683(getChanSpyApplications(_0x326da4,_0x3dc06f));}return _0x51d683([]);})[_0x52ec('0x1d')](function(_0x401362){_0x3c8c0a(_0x401362);});});};module[_0x52ec('0x1e')]=function(_0x421455,_0x3d8724){var _0x38e9cd=_0x421455[_0x52ec('0x1f')];return _0x421455[_0x52ec('0x20')]('VoiceChanSpy',attributes,{'tableName':_0x52ec('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x15b6f5,_0x5e2e5f,_0x56f8a2){return getChanSpyPromise(_0x38e9cd,_0x15b6f5)[_0x52ec('0x1c')](function(_0x533f80){if(_0x533f80&&_0x533f80[_0x52ec('0x22')]){return _0x38e9cd[_0x52ec('0x23')][_0x52ec('0x24')](_0x533f80);}})[_0x52ec('0x1c')](function(){_0x56f8a2();})[_0x52ec('0x1d')](function(_0x514c6a){_0x56f8a2(_0x514c6a);});},'afterUpdate':function(_0xa0826d,_0x26bdbf,_0x5d9264){return _0x38e9cd['VoiceExtension'][_0x52ec('0x25')]({'where':{'ChanSpyId':_0xa0826d['id']}})[_0x52ec('0x1c')](function(){return getChanSpyPromise(_0x38e9cd,_0xa0826d);})[_0x52ec('0x1c')](function(_0x493138){if(_0x493138&&_0x493138[_0x52ec('0x22')]){return _0x38e9cd['VoiceExtension'][_0x52ec('0x24')](_0x493138);}})[_0x52ec('0x1c')](function(){_0x5d9264();})['catch'](function(_0x14eb79){_0x5d9264(_0x14eb79);});},'afterDestroy':function(_0xf13ff5,_0x8e8a47,_0x4583ed){return _0x38e9cd[_0x52ec('0x23')]['destroy']({'where':{'ChanSpyId':_0xf13ff5['id']}})[_0x52ec('0x1c')](function(){_0x4583ed();})[_0x52ec('0x1d')](function(_0xaa5958){_0x4583ed(_0xaa5958);});}}});}; \ No newline at end of file +var _0x1b38=['record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','Authenticate','password','ChanSpy','options','StopMixMonitor','length','concat','internal','name','User','findAll','agent','then','catch','VoiceChanSpy','voice_chanspy','VoiceExtension','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','chanspy'];(function(_0x33fa11,_0x1c91c0){var _0x5c290f=function(_0x516660){while(--_0x516660){_0x33fa11['push'](_0x33fa11['shift']());}};_0x5c290f(++_0x1c91c0);}(_0x1b38,0x13e));var _0x81b3=function(_0x3fb372,_0x2d9fc4){_0x3fb372=_0x3fb372-0x0;var _0x4d7b70=_0x1b38[_0x3fb372];return _0x4d7b70;};'use strict';var _=require(_0x81b3('0x0'));var util=require(_0x81b3('0x1'));var BPromise=require(_0x81b3('0x2'));var attributes=require(_0x81b3('0x3'));var getUserApplications=function(_0x470dfb,_0x5ee8d1,_0x1f1ea3){var _0x462097=0x1;var _0x14e2a4=[];var _0x4699d0={'context':_0x5ee8d1[_0x81b3('0x4')]||_0x81b3('0x5'),'exten':util[_0x81b3('0x6')](_0x81b3('0x7'),_0x470dfb[_0x81b3('0x8')],_0x1f1ea3),'type':_0x81b3('0x9'),'isApp':![],'ChanSpyId':_0x470dfb['id'],'UserId':_0x5ee8d1['id']};_0x14e2a4[_0x81b3('0xa')](_[_0x81b3('0xb')]({'app':_0x81b3('0xc'),'appdata':util[_0x81b3('0x6')](_0x81b3('0xd'),_0x81b3('0xe')),'priority':_0x462097++},_0x4699d0));if(_0x470dfb[_0x81b3('0xf')]){_0x14e2a4['push'](_[_0x81b3('0xb')]({'app':_0x81b3('0x10'),'appdata':util['format'](_0x81b3('0x11'),_0x470dfb[_0x81b3('0x12')]),'priority':_0x462097++},_0x4699d0));}if(_0x470dfb['auth']){_0x14e2a4[_0x81b3('0xa')](_[_0x81b3('0xb')]({'app':_0x81b3('0x13'),'appdata':_0x470dfb[_0x81b3('0x14')],'priority':_0x462097++},_0x4699d0));}_0x14e2a4['push'](_[_0x81b3('0xb')]({'app':_0x81b3('0x15'),'appdata':util[_0x81b3('0x6')]('SIP/%s,%s',_0x5ee8d1['name'],_0x470dfb['options']?_0x470dfb[_0x81b3('0x16')]['join'](''):''),'priority':_0x462097++},_0x4699d0));if(_0x470dfb[_0x81b3('0xf')]){_0x14e2a4[_0x81b3('0xa')](_[_0x81b3('0xb')]({'app':_0x81b3('0x17'),'priority':_0x462097++},_0x4699d0));}return _0x14e2a4;};var getChanSpyApplications=function(_0xe4bac4,_0x5aa458){var _0x1c71d9=[];for(var _0x4ef03e=0x0,_0x25b00a=0x1;_0x4ef03e<_0x5aa458[_0x81b3('0x18')];_0x4ef03e++,_0x25b00a=0x1){_0x1c71d9=_0x1c71d9[_0x81b3('0x19')](getUserApplications(_0xe4bac4,_0x5aa458[_0x4ef03e],_0x5aa458[_0x4ef03e][_0x81b3('0x1a')]));if(_0x5aa458[_0x4ef03e][_0x81b3('0x1a')]!=_0x5aa458[_0x4ef03e]['name']){_0x1c71d9=_0x1c71d9[_0x81b3('0x19')](getUserApplications(_0xe4bac4,_0x5aa458[_0x4ef03e],_0x5aa458[_0x4ef03e][_0x81b3('0x1b')]));}}return _0x1c71d9;};var getChanSpyPromise=function(_0x4c9e58,_0x53f224){return new BPromise(function(_0x12c251,_0x3c99b2){return _0x4c9e58[_0x81b3('0x1c')][_0x81b3('0x1d')]({'attributes':['id','name','internal'],'where':{'role':_0x81b3('0x1e'),'chanspy':!![]},'raw':!![]})[_0x81b3('0x1f')](function(_0x4a8522){if(_0x4a8522){return _0x12c251(getChanSpyApplications(_0x53f224,_0x4a8522));}return _0x12c251([]);})[_0x81b3('0x20')](function(_0x4b87e3){_0x3c99b2(_0x4b87e3);});});};module['exports']=function(_0x19fc5e,_0x15fc28){var _0x5c63b8=_0x19fc5e['models'];return _0x19fc5e['define'](_0x81b3('0x21'),attributes,{'tableName':_0x81b3('0x22'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4c3072,_0x2f4ff3,_0x555e2a){return getChanSpyPromise(_0x5c63b8,_0x4c3072)['then'](function(_0x2bf6bd){if(_0x2bf6bd&&_0x2bf6bd[_0x81b3('0x18')]){return _0x5c63b8[_0x81b3('0x23')]['bulkCreate'](_0x2bf6bd);}})[_0x81b3('0x1f')](function(){_0x555e2a();})[_0x81b3('0x20')](function(_0xf05736){_0x555e2a(_0xf05736);});},'afterUpdate':function(_0x53d987,_0x1800c2,_0x3b0537){return _0x5c63b8[_0x81b3('0x23')][_0x81b3('0x24')]({'where':{'ChanSpyId':_0x53d987['id']}})[_0x81b3('0x1f')](function(){return getChanSpyPromise(_0x5c63b8,_0x53d987);})[_0x81b3('0x1f')](function(_0x518c6b){if(_0x518c6b&&_0x518c6b['length']){return _0x5c63b8[_0x81b3('0x23')]['bulkCreate'](_0x518c6b);}})['then'](function(){_0x3b0537();})[_0x81b3('0x20')](function(_0x4ef307){_0x3b0537(_0x4ef307);});},'afterDestroy':function(_0x595ef7,_0x56b5f9,_0x2d0af7){return _0x5c63b8[_0x81b3('0x23')][_0x81b3('0x24')]({'where':{'ChanSpyId':_0x595ef7['id']}})[_0x81b3('0x1f')](function(){_0x2d0af7();})['catch'](function(_0x59774c){_0x2d0af7(_0x59774c);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index dd74c97..a0d2aed 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 _0xd87e=['stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s'];(function(_0x2706da,_0x3856f5){var _0x3ba87e=function(_0x479a79){while(--_0x479a79){_0x2706da['push'](_0x2706da['shift']());}};_0x3ba87e(++_0x3856f5);}(_0xd87e,0x1bf));var _0xed87=function(_0x18e1a1,_0x5426d6){_0x18e1a1=_0x18e1a1-0x0;var _0x3613d0=_0xd87e[_0x18e1a1];return _0x3613d0;};'use strict';var _=require(_0xed87('0x0'));var util=require(_0xed87('0x1'));var moment=require('moment');var BPromise=require(_0xed87('0x2'));var rs=require(_0xed87('0x3'));var fs=require('fs');var Redis=require(_0xed87('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xed87('0x5'));var logger=require('../../config/logger')(_0xed87('0x6'));var config=require(_0xed87('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xed87('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5da793,_0xa33c67,_0x42fef6){return new BPromise(function(_0x33e1c1,_0x2f348a){return client['request'](_0x5da793,_0x42fef6)[_0xed87('0x9')](function(_0x3dce4b){logger[_0xed87('0xa')](_0xed87('0xb'),_0xa33c67,_0xed87('0xc'));logger[_0xed87('0xd')](_0xed87('0xe'),_0xa33c67,'request\x20sent',JSON[_0xed87('0xf')](_0x3dce4b));if(_0x3dce4b[_0xed87('0x10')]){if(_0x3dce4b['error'][_0xed87('0x11')]===0x1f4){logger[_0xed87('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0xa33c67,_0x3dce4b['error'][_0xed87('0x12')]);return _0x2f348a(_0x3dce4b[_0xed87('0x10')][_0xed87('0x12')]);}logger[_0xed87('0x10')](_0xed87('0xb'),_0xa33c67,_0x3dce4b[_0xed87('0x10')]['message']);return _0x33e1c1(_0x3dce4b[_0xed87('0x10')][_0xed87('0x12')]);}else{logger[_0xed87('0xa')](_0xed87('0xb'),_0xa33c67,_0xed87('0xc'));_0x33e1c1(_0x3dce4b[_0xed87('0x13')][_0xed87('0x12')]);}})[_0xed87('0x14')](function(_0x385859){logger['error'](_0xed87('0xb'),_0xa33c67,_0x385859);_0x2f348a(_0x385859);});});} \ No newline at end of file +var _0x593e=['then','info','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','VoiceChanSpy,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x59bde3,_0x22752f){var _0x326574=function(_0x45bb19){while(--_0x45bb19){_0x59bde3['push'](_0x59bde3['shift']());}};_0x326574(++_0x22752f);}(_0x593e,0xcb));var _0xe593=function(_0x3c65ff,_0x40b129){_0x3c65ff=_0x3c65ff-0x0;var _0x1bb362=_0x593e[_0x3c65ff];return _0x1bb362;};'use strict';var _=require(_0xe593('0x0'));var util=require(_0xe593('0x1'));var moment=require(_0xe593('0x2'));var BPromise=require(_0xe593('0x3'));var rs=require(_0xe593('0x4'));var fs=require('fs');var Redis=require(_0xe593('0x5'));var db=require(_0xe593('0x6'))['db'];var utils=require(_0xe593('0x7'));var logger=require('../../config/logger')(_0xe593('0x8'));var config=require(_0xe593('0x9'));var jayson=require(_0xe593('0xa'));var client=jayson[_0xe593('0xb')][_0xe593('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x14cff3,_0x1cda29,_0x307dad){return new BPromise(function(_0x169c08,_0x265099){return client['request'](_0x14cff3,_0x307dad)[_0xe593('0xd')](function(_0x4091db){logger[_0xe593('0xe')]('VoiceChanSpy,\x20%s,\x20%s',_0x1cda29,'request\x20sent');logger[_0xe593('0xf')](_0xe593('0x10'),_0x1cda29,_0xe593('0x11'),JSON['stringify'](_0x4091db));if(_0x4091db[_0xe593('0x12')]){if(_0x4091db[_0xe593('0x12')][_0xe593('0x13')]===0x1f4){logger[_0xe593('0x12')](_0xe593('0x14'),_0x1cda29,_0x4091db[_0xe593('0x12')][_0xe593('0x15')]);return _0x265099(_0x4091db[_0xe593('0x12')][_0xe593('0x15')]);}logger[_0xe593('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x1cda29,_0x4091db[_0xe593('0x12')][_0xe593('0x15')]);return _0x169c08(_0x4091db['error'][_0xe593('0x15')]);}else{logger[_0xe593('0xe')]('VoiceChanSpy,\x20%s,\x20%s',_0x1cda29,_0xe593('0x11'));_0x169c08(_0x4091db[_0xe593('0x16')][_0xe593('0x15')]);}})[_0xe593('0x17')](function(_0x3408ec){logger[_0xe593('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x1cda29,_0x3408ec);_0x265099(_0x3408ec);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 5cec12c..25c5a89 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 _0xa90f=['./voiceContext.controller','get','isAuthenticated','index','/:id','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x27a1e0,_0x3ff2cb){var _0x1ca624=function(_0x435802){while(--_0x435802){_0x27a1e0['push'](_0x27a1e0['shift']());}};_0x1ca624(++_0x3ff2cb);}(_0xa90f,0x197));var _0xfa90=function(_0x527a53,_0x3265d6){_0x527a53=_0x527a53-0x0;var _0x2332f5=_0xa90f[_0x527a53];return _0x2332f5;};'use strict';var multer=require(_0xfa90('0x0'));var util=require(_0xfa90('0x1'));var path=require(_0xfa90('0x2'));var timeout=require(_0xfa90('0x3'));var express=require('express');var router=express[_0xfa90('0x4')]();var fs_extra=require(_0xfa90('0x5'));var auth=require(_0xfa90('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfa90('0x7'));router[_0xfa90('0x8')]('/',auth[_0xfa90('0x9')](),controller[_0xfa90('0xa')]);router[_0xfa90('0x8')](_0xfa90('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xfa90('0xc')]('/',auth[_0xfa90('0x9')](),controller['create']);router[_0xfa90('0xd')]('/:id',auth[_0xfa90('0x9')](),controller[_0xfa90('0xe')]);router[_0xfa90('0xf')]('/:id',auth[_0xfa90('0x9')](),controller[_0xfa90('0x10')]);module[_0xfa90('0x11')]=router; \ No newline at end of file +var _0x3a21=['index','show','post','create','delete','/:id','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x6dd5c,_0x4bfc19){var _0x5a87fa=function(_0x3b068b){while(--_0x3b068b){_0x6dd5c['push'](_0x6dd5c['shift']());}};_0x5a87fa(++_0x4bfc19);}(_0x3a21,0x15e));var _0x13a2=function(_0x5ae361,_0x3eca7c){_0x5ae361=_0x5ae361-0x0;var _0x4da594=_0x3a21[_0x5ae361];return _0x4da594;};'use strict';var multer=require(_0x13a2('0x0'));var util=require(_0x13a2('0x1'));var path=require(_0x13a2('0x2'));var timeout=require('connect-timeout');var express=require(_0x13a2('0x3'));var router=express[_0x13a2('0x4')]();var fs_extra=require(_0x13a2('0x5'));var auth=require(_0x13a2('0x6'));var interaction=require(_0x13a2('0x7'));var config=require(_0x13a2('0x8'));var controller=require('./voiceContext.controller');router['get']('/',auth[_0x13a2('0x9')](),controller[_0x13a2('0xa')]);router['get']('/:id',auth[_0x13a2('0x9')](),controller[_0x13a2('0xb')]);router[_0x13a2('0xc')]('/',auth[_0x13a2('0x9')](),controller[_0x13a2('0xd')]);router['put']('/:id',auth[_0x13a2('0x9')](),controller['update']);router[_0x13a2('0xe')](_0x13a2('0xf'),auth['isAuthenticated'](),controller[_0x13a2('0x10')]);module[_0x13a2('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 574c63d..463cfe6 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 _0xbb9a=['name','STRING','BOOLEAN','sequelize','exports'];(function(_0x2647d8,_0x2ee9e2){var _0x1dba20=function(_0xecc2d5){while(--_0xecc2d5){_0x2647d8['push'](_0x2647d8['shift']());}};_0x1dba20(++_0x2ee9e2);}(_0xbb9a,0xcb));var _0xabb9=function(_0x1c3104,_0x5c82ca){_0x1c3104=_0x1c3104-0x0;var _0x1efb48=_0xbb9a[_0x1c3104];return _0x1efb48;};'use strict';var Sequelize=require(_0xabb9('0x0'));module[_0xabb9('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xabb9('0x2')},'description':{'type':Sequelize[_0xabb9('0x3')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xabb9('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x453d=['BOOLEAN','sequelize','STRING'];(function(_0x15ec4e,_0x40b7e0){var _0xb5e5dd=function(_0x42bdd7){while(--_0x42bdd7){_0x15ec4e['push'](_0x15ec4e['shift']());}};_0xb5e5dd(++_0x40b7e0);}(_0x453d,0x1cc));var _0xd453=function(_0x2dcc0d,_0x38061e){_0x2dcc0d=_0x2dcc0d-0x0;var _0x22c783=_0x453d[_0x2dcc0d];return _0x22c783;};'use strict';var Sequelize=require(_0xd453('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0xd453('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xd453('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 3546176..4b100e2 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 _0xa03e=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','get','Contexts','UserProfileResource','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','VoiceContext','includeAll','include','findAll','rows','show','params','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','eml-format','rimraf','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x250adf,_0x156694){var _0x535b5d=function(_0x41083b){while(--_0x41083b){_0x250adf['push'](_0x250adf['shift']());}};_0x535b5d(++_0x156694);}(_0xa03e,0x132));var _0xea03=function(_0x4f50b2,_0x12ff8a){_0x4f50b2=_0x4f50b2-0x0;var _0x56c65c=_0xa03e[_0x4f50b2];return _0x56c65c;};'use strict';var emlformat=require(_0xea03('0x0'));var rimraf=require(_0xea03('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xea03('0x2'));var util=require(_0xea03('0x3'));var path=require(_0xea03('0x4'));var sox=require(_0xea03('0x5'));var csv=require(_0xea03('0x6'));var ejs=require(_0xea03('0x7'));var fs=require('fs');var fs_extra=require(_0xea03('0x8'));var _=require(_0xea03('0x9'));var squel=require(_0xea03('0xa'));var crypto=require(_0xea03('0xb'));var jsforce=require(_0xea03('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xea03('0xd'));var Papa=require(_0xea03('0xe'));var Redis=require(_0xea03('0xf'));var authService=require(_0xea03('0x10'));var qs=require(_0xea03('0x11'));var as=require(_0xea03('0x12'));var hardwareService=require(_0xea03('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xea03('0x14'));var config=require(_0xea03('0x15'));var licenseUtil=require(_0xea03('0x16'));var db=require(_0xea03('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xea03('0x18')][_0xea03('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x3fa711,_0x325026,_0x3d6fdd,_0xf5621f){return new BPromise(function(_0x7347e,_0x1d0e7e){var _0x5b1896=_0xf5621f||client;return _0x5b1896[_0xea03('0x1a')](_0x3fa711,_0x3d6fdd)[_0xea03('0x1b')](function(_0x270212){logger[_0xea03('0x1c')](_0xea03('0x1d'),_0x325026,_0xea03('0x1e'));logger[_0xea03('0x1f')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x325026,_0xea03('0x1e'),JSON[_0xea03('0x20')](_0x270212));if(_0x270212[_0xea03('0x21')]){if(_0x270212[_0xea03('0x21')][_0xea03('0x22')]===0x1f4){logger[_0xea03('0x21')](_0xea03('0x1d'),_0x325026,_0x270212[_0xea03('0x21')]['message']);return _0x1d0e7e(_0x270212[_0xea03('0x21')]['message']);}logger[_0xea03('0x21')](_0xea03('0x1d'),_0x325026,_0x270212[_0xea03('0x21')][_0xea03('0x23')]);return _0x7347e(_0x270212['error'][_0xea03('0x23')]);}else{logger[_0xea03('0x1c')](_0xea03('0x1d'),_0x325026,'request\x20sent');_0x7347e(_0x270212[_0xea03('0x24')]['message']);}})[_0xea03('0x25')](function(_0x1044d6){logger[_0xea03('0x21')](_0xea03('0x1d'),_0x325026,_0x1044d6);_0x1d0e7e(_0x1044d6);});});}function respondWithStatusCode(_0x1d0120,_0x35214c){_0x35214c=_0x35214c||0xcc;return function(_0x132bca){if(_0x132bca){return _0x1d0120['sendStatus'](_0x35214c);}return _0x1d0120['status'](_0x35214c)[_0xea03('0x26')]();};}function respondWithResult(_0x3ba488,_0x4f8e3f){_0x4f8e3f=_0x4f8e3f||0xc8;return function(_0x72a722){if(_0x72a722){return _0x3ba488[_0xea03('0x27')](_0x4f8e3f)[_0xea03('0x28')](_0x72a722);}};}function respondWithFilteredResult(_0x18474e,_0x2c93a3){return function(_0x5a848c){if(_0x5a848c){var _0x974acc=typeof _0x2c93a3[_0xea03('0x29')]===_0xea03('0x2a')&&typeof _0x2c93a3[_0xea03('0x2b')]==='undefined';var _0x1e4499=_0x5a848c[_0xea03('0x2c')];var _0x25263f=_0x974acc?0x0:_0x2c93a3[_0xea03('0x29')];var _0x5a7511=_0x974acc?_0x5a848c[_0xea03('0x2c')]:_0x2c93a3['offset']+_0x2c93a3[_0xea03('0x2b')];var _0x11a8e0;if(_0x5a7511>=_0x1e4499){_0x5a7511=_0x1e4499;_0x11a8e0=0xc8;}else{_0x11a8e0=0xce;}_0x18474e[_0xea03('0x27')](_0x11a8e0);return _0x18474e[_0xea03('0x2d')](_0xea03('0x2e'),_0x25263f+'-'+_0x5a7511+'/'+_0x1e4499)['json'](_0x5a848c);}return null;};}function patchUpdates(_0x4da22f){return function(_0x18e253){try{jsonpatch[_0xea03('0x2f')](_0x18e253,_0x4da22f,!![]);}catch(_0x316b14){return BPromise[_0xea03('0x30')](_0x316b14);}return _0x18e253[_0xea03('0x31')]();};}function saveUpdates(_0x571391,_0x2d3956){return function(_0x57266c){if(_0x57266c){return _0x57266c[_0xea03('0x32')](_0x571391)[_0xea03('0x1b')](function(_0x580e32){return _0x580e32;});}return null;};}function removeEntity(_0x4dac32,_0x30fce4){return function(_0x54f1f4){if(_0x54f1f4){return _0x54f1f4['destroy']()['then'](function(){var _0x3ab9d2=_0x54f1f4[_0xea03('0x33')]({'plain':!![]});var _0x9874f=_0xea03('0x34');return db[_0xea03('0x35')][_0xea03('0x36')]({'where':{'type':_0x9874f,'resourceId':_0x3ab9d2['id']}})['then'](function(){return _0x54f1f4;});})[_0xea03('0x1b')](function(){_0x4dac32['status'](0xcc)[_0xea03('0x26')]();});}};}function handleEntityNotFound(_0x1aafe5,_0x2dde60){return function(_0x124a08){if(!_0x124a08){_0x1aafe5[_0xea03('0x37')](0x194);}return _0x124a08;};}function handleError(_0x2160a1,_0x35829b){_0x35829b=_0x35829b||0x1f4;return function(_0x4db4ed){logger[_0xea03('0x21')](_0x4db4ed[_0xea03('0x38')]);if(_0x4db4ed[_0xea03('0x39')]){delete _0x4db4ed[_0xea03('0x39')];}_0x2160a1[_0xea03('0x27')](_0x35829b)[_0xea03('0x3a')](_0x4db4ed);};}exports[_0xea03('0x3b')]=function(_0x13e193,_0x4c817a){var _0x225f8c={},_0x318412={},_0x52639f={'count':0x0,'rows':[]};var _0x338049=_[_0xea03('0x3c')](db['VoiceContext'][_0xea03('0x3d')],function(_0x46f78d){return{'name':_0x46f78d[_0xea03('0x3e')],'type':_0x46f78d[_0xea03('0x3f')]['key']};});_0x318412[_0xea03('0x40')]=_[_0xea03('0x3c')](_0x338049,_0xea03('0x39'));_0x318412[_0xea03('0x41')]=_[_0xea03('0x42')](_0x13e193[_0xea03('0x41')]);_0x318412['filters']=_[_0xea03('0x43')](_0x318412['model'],_0x318412['query']);_0x225f8c[_0xea03('0x44')]=_['intersection'](_0x318412['model'],qs[_0xea03('0x45')](_0x13e193['query'][_0xea03('0x45')]));_0x225f8c[_0xea03('0x44')]=_0x225f8c[_0xea03('0x44')][_0xea03('0x46')]?_0x225f8c[_0xea03('0x44')]:_0x318412['model'];if(!_0x13e193['query'][_0xea03('0x47')]('nolimit')){_0x225f8c[_0xea03('0x2b')]=qs[_0xea03('0x2b')](_0x13e193[_0xea03('0x41')][_0xea03('0x2b')]);_0x225f8c[_0xea03('0x29')]=qs[_0xea03('0x29')](_0x13e193['query'][_0xea03('0x29')]);}_0x225f8c[_0xea03('0x48')]=qs['sort'](_0x13e193[_0xea03('0x41')][_0xea03('0x49')]);_0x225f8c[_0xea03('0x4a')]=qs['filters'](_[_0xea03('0x4b')](_0x13e193[_0xea03('0x41')],_0x318412[_0xea03('0x4c')]),_0x338049);if(_0x13e193[_0xea03('0x41')][_0xea03('0x4d')]){_0x225f8c[_0xea03('0x4a')]=_[_0xea03('0x4e')](_0x225f8c['where'],{'$or':_[_0xea03('0x3c')](_0x338049,function(_0x3b8057){if(_0x3b8057[_0xea03('0x3f')]!==_0xea03('0x4f')){var _0x1fee7d={};_0x1fee7d[_0x3b8057[_0xea03('0x39')]]={'$like':'%'+_0x13e193['query'][_0xea03('0x4d')]+'%'};return _0x1fee7d;}})});}_0x225f8c=_['merge']({},_0x225f8c,_0x13e193[_0xea03('0x50')]);var _0x19a7c3={'where':_0x225f8c[_0xea03('0x4a')]};return db[_0xea03('0x51')][_0xea03('0x2c')](_0x19a7c3)[_0xea03('0x1b')](function(_0x2dca13){_0x52639f[_0xea03('0x2c')]=_0x2dca13;if(_0x13e193[_0xea03('0x41')][_0xea03('0x52')]){_0x225f8c[_0xea03('0x53')]=[{'all':!![]}];}return db[_0xea03('0x51')][_0xea03('0x54')](_0x225f8c);})[_0xea03('0x1b')](function(_0x4b3624){_0x52639f[_0xea03('0x55')]=_0x4b3624;return _0x52639f;})[_0xea03('0x1b')](respondWithFilteredResult(_0x4c817a,_0x225f8c))[_0xea03('0x25')](handleError(_0x4c817a,null));};exports[_0xea03('0x56')]=function(_0x1980a1,_0x368f58){var _0x479fb8={'raw':![],'where':{'id':_0x1980a1[_0xea03('0x57')]['id']}},_0xbb9ec2={};_0xbb9ec2[_0xea03('0x40')]=_['keys'](db[_0xea03('0x51')][_0xea03('0x3d')]);_0xbb9ec2['query']=_[_0xea03('0x42')](_0x1980a1[_0xea03('0x41')]);_0xbb9ec2['filters']=_[_0xea03('0x43')](_0xbb9ec2[_0xea03('0x40')],_0xbb9ec2['query']);_0x479fb8[_0xea03('0x44')]=_['intersection'](_0xbb9ec2[_0xea03('0x40')],qs[_0xea03('0x45')](_0x1980a1['query'][_0xea03('0x45')]));_0x479fb8[_0xea03('0x44')]=_0x479fb8[_0xea03('0x44')][_0xea03('0x46')]?_0x479fb8[_0xea03('0x44')]:_0xbb9ec2['model'];if(_0x1980a1[_0xea03('0x41')][_0xea03('0x52')]){_0x479fb8[_0xea03('0x53')]=[{'all':!![]}];}_0x479fb8=_[_0xea03('0x4e')]({},_0x479fb8,_0x1980a1['options']);return db['VoiceContext'][_0xea03('0x58')](_0x479fb8)[_0xea03('0x1b')](handleEntityNotFound(_0x368f58,null))[_0xea03('0x1b')](respondWithResult(_0x368f58,null))[_0xea03('0x25')](handleError(_0x368f58,null));};exports[_0xea03('0x59')]=function(_0x5f4f1a,_0x58d356,_0x1d6282){var _0x3130fe;return db[_0xea03('0x51')][_0xea03('0x59')](_0x5f4f1a[_0xea03('0x5a')],{'raw':!![]})[_0xea03('0x1b')](function(_0x56ab5a){_0x3130fe=_0x56ab5a;return db[_0xea03('0x51')][_0xea03('0x54')]({'raw':!![]});})[_0xea03('0x1b')](function(_0x4cb969){var _0x538954=fs[_0xea03('0x5b')](path[_0xea03('0x5c')](config[_0xea03('0x5d')],_0xea03('0x5e')),_0xea03('0x5f'));var _0x2e32af=ejs[_0xea03('0x60')](_0x538954,{'contexts':_0x4cb969||[]});fs[_0xea03('0x61')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x2e32af);})[_0xea03('0x1b')](function(){return respondWithRpcPromise(_0xea03('0x62'),_0xea03('0x59'),{'module':'chan_sip.so'});})[_0xea03('0x1b')](function(){var _0x379023=_0x5f4f1a[_0xea03('0x63')][_0xea03('0x33')]({'plain':!![]});if(!_0x379023)throw new Error(_0xea03('0x64'));if(_0x379023[_0xea03('0x65')]===_0xea03('0x63')){var _0x1bed3f=_0x3130fe[_0xea03('0x33')]({'plain':!![]});return db[_0xea03('0x66')][_0xea03('0x58')]({'where':{'name':_0xea03('0x34'),'userProfileId':_0x379023[_0xea03('0x67')]},'raw':!![]})[_0xea03('0x1b')](function(_0x3726cd){if(_0x3726cd&&_0x3726cd[_0xea03('0x68')]===0x0){return db[_0xea03('0x35')][_0xea03('0x59')]({'name':_0x1bed3f['name'],'resourceId':_0x1bed3f['id'],'type':_0x3726cd[_0xea03('0x39')],'sectionId':_0x3726cd['id']},{})['then'](function(){return _0x3130fe;});}else{return _0x3130fe;}})[_0xea03('0x25')](function(_0x4d0017){logger[_0xea03('0x21')](_0xea03('0x69'),_0x4d0017);throw _0x4d0017;});}return _0x3130fe;})[_0xea03('0x1b')](respondWithResult(_0x58d356,0xc9))[_0xea03('0x25')](handleError(_0x58d356,null));};exports[_0xea03('0x32')]=function(_0x1725db,_0x2552ca,_0x4e8798){var _0x212b8e;return db[_0xea03('0x51')][_0xea03('0x58')]({'where':{'id':_0x1725db[_0xea03('0x57')]['id']}})['then'](handleEntityNotFound(_0x2552ca,null))[_0xea03('0x1b')](saveUpdates(_0x1725db[_0xea03('0x5a')],null))['then'](function(_0x5f5b8c){if(_0x5f5b8c){_0x212b8e=_0x5f5b8c;return db[_0xea03('0x51')][_0xea03('0x54')]({'raw':!![]});}})[_0xea03('0x1b')](function(_0x538fee){var _0x4cc83a=fs[_0xea03('0x5b')](path['join'](config[_0xea03('0x5d')],_0xea03('0x5e')),_0xea03('0x5f'));var _0x4dafcb=ejs[_0xea03('0x60')](_0x4cc83a,{'contexts':_0x538fee||[]});fs[_0xea03('0x61')](_0xea03('0x6a'),_0x4dafcb);})[_0xea03('0x1b')](function(){return respondWithRpcPromise(_0xea03('0x62'),_0xea03('0x32'),{'module':_0xea03('0x6b')});})[_0xea03('0x1b')](function(){return _0x212b8e;})[_0xea03('0x1b')](respondWithResult(_0x2552ca,null))[_0xea03('0x25')](handleError(_0x2552ca,null));};exports[_0xea03('0x36')]=function(_0x24e30b,_0x23e217,_0x167a83){var _0x4f0d92;return db[_0xea03('0x51')][_0xea03('0x58')]({'where':{'id':_0x24e30b['params']['id']}})['then'](handleEntityNotFound(_0x23e217,null))[_0xea03('0x1b')](removeEntity(_0x23e217,null))[_0xea03('0x1b')](function(){return db['VoiceContext'][_0xea03('0x54')]({'raw':!![]});})[_0xea03('0x1b')](function(_0xf30f08){var _0x39ef8b=fs[_0xea03('0x5b')](path[_0xea03('0x5c')](config[_0xea03('0x5d')],_0xea03('0x5e')),_0xea03('0x5f'));var _0x3a5f7d=ejs[_0xea03('0x60')](_0x39ef8b,{'contexts':_0xf30f08});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x3a5f7d);return respondWithRpcPromise(_0xea03('0x62'),'destroy',{'module':_0xea03('0x6b')});})[_0xea03('0x25')](handleError(_0x23e217,null));}; \ No newline at end of file +var _0x4043=['message','result','catch','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','reject','save','update','destroy','get','UserProfileResource','stack','name','send','index','map','VoiceContext','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','intersection','find','create','body','root','server/files/templates/context.ejs','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Contexts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','utf8','join','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','code','error'];(function(_0x1b3a72,_0x3a1f98){var _0x8b247f=function(_0x17cc35){while(--_0x17cc35){_0x1b3a72['push'](_0x1b3a72['shift']());}};_0x8b247f(++_0x3a1f98);}(_0x4043,0x1f3));var _0x3404=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4043[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x3404('0x0'));var rimraf=require(_0x3404('0x1'));var zipdir=require(_0x3404('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3404('0x3'));var BPromise=require(_0x3404('0x4'));var Mustache=require(_0x3404('0x5'));var util=require(_0x3404('0x6'));var path=require(_0x3404('0x7'));var sox=require(_0x3404('0x8'));var csv=require('to-csv');var ejs=require(_0x3404('0x9'));var fs=require('fs');var fs_extra=require(_0x3404('0xa'));var _=require('lodash');var squel=require(_0x3404('0xb'));var crypto=require(_0x3404('0xc'));var jsforce=require(_0x3404('0xd'));var deskjs=require(_0x3404('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3404('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3404('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3404('0x11'));var logger=require(_0x3404('0x12'))(_0x3404('0x13'));var utils=require(_0x3404('0x14'));var config=require(_0x3404('0x15'));var licenseUtil=require(_0x3404('0x16'));var db=require(_0x3404('0x17'))['db'];var jayson=require(_0x3404('0x18'));var client=jayson[_0x3404('0x19')][_0x3404('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x2e7aeb,_0x4a8df1,_0x47f938,_0x1aaaa3){return new BPromise(function(_0x850a4,_0x2267e5){var _0x3a3968=_0x1aaaa3||client;return _0x3a3968[_0x3404('0x1b')](_0x2e7aeb,_0x47f938)[_0x3404('0x1c')](function(_0x51917e){logger[_0x3404('0x1d')](_0x3404('0x1e'),_0x4a8df1,_0x3404('0x1f'));logger[_0x3404('0x20')](_0x3404('0x21'),_0x4a8df1,_0x3404('0x1f'),JSON['stringify'](_0x51917e));if(_0x51917e['error']){if(_0x51917e['error'][_0x3404('0x22')]===0x1f4){logger[_0x3404('0x23')]('VoiceContext,\x20%s,\x20%s',_0x4a8df1,_0x51917e[_0x3404('0x23')][_0x3404('0x24')]);return _0x2267e5(_0x51917e[_0x3404('0x23')][_0x3404('0x24')]);}logger[_0x3404('0x23')](_0x3404('0x1e'),_0x4a8df1,_0x51917e[_0x3404('0x23')][_0x3404('0x24')]);return _0x850a4(_0x51917e['error']['message']);}else{logger[_0x3404('0x1d')](_0x3404('0x1e'),_0x4a8df1,'request\x20sent');_0x850a4(_0x51917e[_0x3404('0x25')][_0x3404('0x24')]);}})[_0x3404('0x26')](function(_0x41927f){logger[_0x3404('0x23')](_0x3404('0x1e'),_0x4a8df1,_0x41927f);_0x2267e5(_0x41927f);});});}function respondWithStatusCode(_0x3358dd,_0x7a8559){_0x7a8559=_0x7a8559||0xcc;return function(_0x419b25){if(_0x419b25){return _0x3358dd[_0x3404('0x27')](_0x7a8559);}return _0x3358dd[_0x3404('0x28')](_0x7a8559)[_0x3404('0x29')]();};}function respondWithResult(_0x130319,_0x588089){_0x588089=_0x588089||0xc8;return function(_0x390ef9){if(_0x390ef9){return _0x130319[_0x3404('0x28')](_0x588089)[_0x3404('0x2a')](_0x390ef9);}};}function respondWithFilteredResult(_0x553603,_0x4ebf61){return function(_0x21f4cc){if(_0x21f4cc){var _0x169c05=typeof _0x4ebf61['offset']==='undefined'&&typeof _0x4ebf61[_0x3404('0x2b')]===_0x3404('0x2c');var _0x575105=_0x21f4cc[_0x3404('0x2d')];var _0x2941da=_0x169c05?0x0:_0x4ebf61[_0x3404('0x2e')];var _0x81e1f4=_0x169c05?_0x21f4cc[_0x3404('0x2d')]:_0x4ebf61[_0x3404('0x2e')]+_0x4ebf61[_0x3404('0x2b')];var _0x4ba380;if(_0x81e1f4>=_0x575105){_0x81e1f4=_0x575105;_0x4ba380=0xc8;}else{_0x4ba380=0xce;}_0x553603[_0x3404('0x28')](_0x4ba380);return _0x553603[_0x3404('0x2f')](_0x3404('0x30'),_0x2941da+'-'+_0x81e1f4+'/'+_0x575105)[_0x3404('0x2a')](_0x21f4cc);}return null;};}function patchUpdates(_0x1f45a1){return function(_0x4c5a31){try{jsonpatch['apply'](_0x4c5a31,_0x1f45a1,!![]);}catch(_0x57397f){return BPromise[_0x3404('0x31')](_0x57397f);}return _0x4c5a31[_0x3404('0x32')]();};}function saveUpdates(_0x4d58a8,_0x26e4f1){return function(_0x4e3564){if(_0x4e3564){return _0x4e3564[_0x3404('0x33')](_0x4d58a8)[_0x3404('0x1c')](function(_0x171e44){return _0x171e44;});}return null;};}function removeEntity(_0x2ee3d1,_0x2edd74){return function(_0x375f19){if(_0x375f19){return _0x375f19[_0x3404('0x34')]()[_0x3404('0x1c')](function(){var _0x55508d=_0x375f19[_0x3404('0x35')]({'plain':!![]});var _0x36fedd='Contexts';return db[_0x3404('0x36')][_0x3404('0x34')]({'where':{'type':_0x36fedd,'resourceId':_0x55508d['id']}})[_0x3404('0x1c')](function(){return _0x375f19;});})[_0x3404('0x1c')](function(){_0x2ee3d1[_0x3404('0x28')](0xcc)[_0x3404('0x29')]();});}};}function handleEntityNotFound(_0x149bf3,_0x413cfb){return function(_0x2b30ca){if(!_0x2b30ca){_0x149bf3[_0x3404('0x27')](0x194);}return _0x2b30ca;};}function handleError(_0x27a651,_0x3b9dd2){_0x3b9dd2=_0x3b9dd2||0x1f4;return function(_0x8f3b5f){logger[_0x3404('0x23')](_0x8f3b5f[_0x3404('0x37')]);if(_0x8f3b5f[_0x3404('0x38')]){delete _0x8f3b5f[_0x3404('0x38')];}_0x27a651[_0x3404('0x28')](_0x3b9dd2)[_0x3404('0x39')](_0x8f3b5f);};}exports[_0x3404('0x3a')]=function(_0x58cdf0,_0x2a006f){var _0x2ef3de={},_0x4c41c7={},_0x291dab={'count':0x0,'rows':[]};var _0x45ec77=_[_0x3404('0x3b')](db[_0x3404('0x3c')]['rawAttributes'],function(_0x567ba5){return{'name':_0x567ba5[_0x3404('0x3d')],'type':_0x567ba5[_0x3404('0x3e')][_0x3404('0x3f')]};});_0x4c41c7[_0x3404('0x40')]=_[_0x3404('0x3b')](_0x45ec77,'name');_0x4c41c7[_0x3404('0x41')]=_[_0x3404('0x42')](_0x58cdf0[_0x3404('0x41')]);_0x4c41c7[_0x3404('0x43')]=_['intersection'](_0x4c41c7[_0x3404('0x40')],_0x4c41c7['query']);_0x2ef3de[_0x3404('0x44')]=_['intersection'](_0x4c41c7[_0x3404('0x40')],qs[_0x3404('0x45')](_0x58cdf0[_0x3404('0x41')][_0x3404('0x45')]));_0x2ef3de[_0x3404('0x44')]=_0x2ef3de[_0x3404('0x44')][_0x3404('0x46')]?_0x2ef3de['attributes']:_0x4c41c7[_0x3404('0x40')];if(!_0x58cdf0[_0x3404('0x41')][_0x3404('0x47')](_0x3404('0x48'))){_0x2ef3de['limit']=qs[_0x3404('0x2b')](_0x58cdf0['query'][_0x3404('0x2b')]);_0x2ef3de['offset']=qs[_0x3404('0x2e')](_0x58cdf0[_0x3404('0x41')][_0x3404('0x2e')]);}_0x2ef3de['order']=qs[_0x3404('0x49')](_0x58cdf0[_0x3404('0x41')][_0x3404('0x49')]);_0x2ef3de[_0x3404('0x4a')]=qs[_0x3404('0x43')](_[_0x3404('0x4b')](_0x58cdf0[_0x3404('0x41')],_0x4c41c7[_0x3404('0x43')]),_0x45ec77);if(_0x58cdf0['query'][_0x3404('0x4c')]){_0x2ef3de[_0x3404('0x4a')]=_[_0x3404('0x4d')](_0x2ef3de['where'],{'$or':_[_0x3404('0x3b')](_0x45ec77,function(_0x388f2b){if(_0x388f2b['type']!==_0x3404('0x4e')){var _0x44b2d2={};_0x44b2d2[_0x388f2b['name']]={'$like':'%'+_0x58cdf0[_0x3404('0x41')][_0x3404('0x4c')]+'%'};return _0x44b2d2;}})});}_0x2ef3de=_[_0x3404('0x4d')]({},_0x2ef3de,_0x58cdf0[_0x3404('0x4f')]);var _0x1c28ff={'where':_0x2ef3de[_0x3404('0x4a')]};return db[_0x3404('0x3c')][_0x3404('0x2d')](_0x1c28ff)[_0x3404('0x1c')](function(_0x5ba43c){_0x291dab[_0x3404('0x2d')]=_0x5ba43c;if(_0x58cdf0['query'][_0x3404('0x50')]){_0x2ef3de[_0x3404('0x51')]=[{'all':!![]}];}return db[_0x3404('0x3c')][_0x3404('0x52')](_0x2ef3de);})['then'](function(_0x1ecd51){_0x291dab[_0x3404('0x53')]=_0x1ecd51;return _0x291dab;})[_0x3404('0x1c')](respondWithFilteredResult(_0x2a006f,_0x2ef3de))[_0x3404('0x26')](handleError(_0x2a006f,null));};exports[_0x3404('0x54')]=function(_0x4856ff,_0x1d497c){var _0x1b6810={'raw':![],'where':{'id':_0x4856ff['params']['id']}},_0x5c66ff={};_0x5c66ff[_0x3404('0x40')]=_[_0x3404('0x42')](db[_0x3404('0x3c')]['rawAttributes']);_0x5c66ff['query']=_[_0x3404('0x42')](_0x4856ff[_0x3404('0x41')]);_0x5c66ff['filters']=_[_0x3404('0x55')](_0x5c66ff[_0x3404('0x40')],_0x5c66ff['query']);_0x1b6810[_0x3404('0x44')]=_[_0x3404('0x55')](_0x5c66ff[_0x3404('0x40')],qs[_0x3404('0x45')](_0x4856ff[_0x3404('0x41')]['fields']));_0x1b6810['attributes']=_0x1b6810[_0x3404('0x44')]['length']?_0x1b6810[_0x3404('0x44')]:_0x5c66ff[_0x3404('0x40')];if(_0x4856ff[_0x3404('0x41')][_0x3404('0x50')]){_0x1b6810[_0x3404('0x51')]=[{'all':!![]}];}_0x1b6810=_[_0x3404('0x4d')]({},_0x1b6810,_0x4856ff['options']);return db['VoiceContext'][_0x3404('0x56')](_0x1b6810)[_0x3404('0x1c')](handleEntityNotFound(_0x1d497c,null))[_0x3404('0x1c')](respondWithResult(_0x1d497c,null))[_0x3404('0x26')](handleError(_0x1d497c,null));};exports[_0x3404('0x57')]=function(_0x18090d,_0xf3b766,_0x536f76){var _0x5a8049;return db[_0x3404('0x3c')]['create'](_0x18090d[_0x3404('0x58')],{'raw':!![]})['then'](function(_0x4b6902){_0x5a8049=_0x4b6902;return db[_0x3404('0x3c')][_0x3404('0x52')]({'raw':!![]});})[_0x3404('0x1c')](function(_0x2b92b5){var _0x1b8f43=fs['readFileSync'](path['join'](config[_0x3404('0x59')],_0x3404('0x5a')),'utf8');var _0x5b54a8=ejs[_0x3404('0x5b')](_0x1b8f43,{'contexts':_0x2b92b5||[]});fs[_0x3404('0x5c')](_0x3404('0x5d'),_0x5b54a8);})[_0x3404('0x1c')](function(){return respondWithRpcPromise(_0x3404('0x5e'),_0x3404('0x57'),{'module':_0x3404('0x5f')});})['then'](function(){var _0x2f99c0=_0x18090d['user'][_0x3404('0x35')]({'plain':!![]});if(!_0x2f99c0)throw new Error(_0x3404('0x60'));if(_0x2f99c0[_0x3404('0x61')]===_0x3404('0x62')){var _0x2ae37f=_0x5a8049['get']({'plain':!![]});return db[_0x3404('0x63')][_0x3404('0x56')]({'where':{'name':_0x3404('0x64'),'userProfileId':_0x2f99c0[_0x3404('0x65')]},'raw':!![]})['then'](function(_0x4c21a9){if(_0x4c21a9&&_0x4c21a9[_0x3404('0x66')]===0x0){return db[_0x3404('0x36')][_0x3404('0x57')]({'name':_0x2ae37f[_0x3404('0x38')],'resourceId':_0x2ae37f['id'],'type':_0x4c21a9['name'],'sectionId':_0x4c21a9['id']},{})[_0x3404('0x1c')](function(){return _0x5a8049;});}else{return _0x5a8049;}})[_0x3404('0x26')](function(_0x31e2f1){logger[_0x3404('0x23')](_0x3404('0x67'),_0x31e2f1);throw _0x31e2f1;});}return _0x5a8049;})[_0x3404('0x1c')](respondWithResult(_0xf3b766,0xc9))['catch'](handleError(_0xf3b766,null));};exports['update']=function(_0x5b59b4,_0x205a45,_0x27a3cb){var _0x1b78b3;return db[_0x3404('0x3c')]['find']({'where':{'id':_0x5b59b4[_0x3404('0x68')]['id']}})[_0x3404('0x1c')](handleEntityNotFound(_0x205a45,null))['then'](saveUpdates(_0x5b59b4[_0x3404('0x58')],null))[_0x3404('0x1c')](function(_0x2ea506){if(_0x2ea506){_0x1b78b3=_0x2ea506;return db[_0x3404('0x3c')][_0x3404('0x52')]({'raw':!![]});}})[_0x3404('0x1c')](function(_0x3058c9){var _0x5e58ea=fs['readFileSync'](path['join'](config[_0x3404('0x59')],_0x3404('0x5a')),_0x3404('0x69'));var _0x6b7a66=ejs[_0x3404('0x5b')](_0x5e58ea,{'contexts':_0x3058c9||[]});fs['writeFileSync'](_0x3404('0x5d'),_0x6b7a66);})[_0x3404('0x1c')](function(){return respondWithRpcPromise(_0x3404('0x5e'),_0x3404('0x33'),{'module':'chan_sip.so'});})['then'](function(){return _0x1b78b3;})[_0x3404('0x1c')](respondWithResult(_0x205a45,null))[_0x3404('0x26')](handleError(_0x205a45,null));};exports[_0x3404('0x34')]=function(_0x412e05,_0x304d05,_0x126d58){var _0x24bab4;return db[_0x3404('0x3c')][_0x3404('0x56')]({'where':{'id':_0x412e05[_0x3404('0x68')]['id']}})[_0x3404('0x1c')](handleEntityNotFound(_0x304d05,null))[_0x3404('0x1c')](removeEntity(_0x304d05,null))[_0x3404('0x1c')](function(){return db['VoiceContext'][_0x3404('0x52')]({'raw':!![]});})['then'](function(_0x266f40){var _0x2ba3b2=fs['readFileSync'](path[_0x3404('0x6a')](config[_0x3404('0x59')],_0x3404('0x5a')),'utf8');var _0xac0cff=ejs['render'](_0x2ba3b2,{'contexts':_0x266f40});fs[_0x3404('0x5c')](_0x3404('0x5d'),_0xac0cff);return respondWithRpcPromise(_0x3404('0x5e'),_0x3404('0x34'),{'module':_0x3404('0x5f')});})[_0x3404('0x26')](handleError(_0x304d05,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 99e9649..57a20a3 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 _0xa322=['api','bluebird','request-promise','path','exports','voice_contexts','lodash','util','../../config/logger'];(function(_0x1d8468,_0x524250){var _0x3c7e0a=function(_0x3120ac){while(--_0x3120ac){_0x1d8468['push'](_0x1d8468['shift']());}};_0x3c7e0a(++_0x524250);}(_0xa322,0x15c));var _0x2a32=function(_0x56e839,_0x4786fc){_0x56e839=_0x56e839-0x0;var _0x18e7b7=_0xa322[_0x56e839];return _0x18e7b7;};'use strict';var _=require(_0x2a32('0x0'));var util=require(_0x2a32('0x1'));var logger=require(_0x2a32('0x2'))(_0x2a32('0x3'));var moment=require('moment');var BPromise=require(_0x2a32('0x4'));var rp=require(_0x2a32('0x5'));var fs=require('fs');var path=require(_0x2a32('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceContext.attributes');module[_0x2a32('0x7')]=function(_0x4bf3a8,_0x27145f){return _0x4bf3a8['define']('VoiceContext',attributes,{'tableName':_0x2a32('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed22=['../../config/environment','./voiceContext.attributes','voice_contexts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x540bd7,_0x283b6e){var _0x4d39d7=function(_0x4ce047){while(--_0x4ce047){_0x540bd7['push'](_0x540bd7['shift']());}};_0x4d39d7(++_0x283b6e);}(_0xed22,0x87));var _0x2ed2=function(_0x2f2a5c,_0x4cd034){_0x2f2a5c=_0x2f2a5c-0x0;var _0x33f574=_0xed22[_0x2f2a5c];return _0x33f574;};'use strict';var _=require(_0x2ed2('0x0'));var util=require(_0x2ed2('0x1'));var logger=require(_0x2ed2('0x2'))(_0x2ed2('0x3'));var moment=require(_0x2ed2('0x4'));var BPromise=require(_0x2ed2('0x5'));var rp=require(_0x2ed2('0x6'));var fs=require('fs');var path=require(_0x2ed2('0x7'));var rimraf=require(_0x2ed2('0x8'));var config=require(_0x2ed2('0x9'));var attributes=require(_0x2ed2('0xa'));module['exports']=function(_0x1d8a36,_0x15ee88){return _0x1d8a36['define']('VoiceContext',attributes,{'tableName':_0x2ed2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 6b5e075..19e49ab 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 _0x1d90=['message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0x1d90,0x13e));var _0x01d9=function(_0x3b22f0,_0x3463fd){_0x3b22f0=_0x3b22f0-0x0;var _0x55bf4d=_0x1d90[_0x3b22f0];return _0x55bf4d;};'use strict';var _=require(_0x01d9('0x0'));var util=require('util');var moment=require(_0x01d9('0x1'));var BPromise=require('bluebird');var rs=require(_0x01d9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x01d9('0x3'))['db'];var utils=require(_0x01d9('0x4'));var logger=require('../../config/logger')(_0x01d9('0x5'));var config=require(_0x01d9('0x6'));var jayson=require(_0x01d9('0x7'));var client=jayson['client'][_0x01d9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1664eb,_0x31c11d,_0x598409){return new BPromise(function(_0xef9d5b,_0x479447){return client['request'](_0x1664eb,_0x598409)[_0x01d9('0x9')](function(_0x2b8e06){logger[_0x01d9('0xa')]('VoiceContext,\x20%s,\x20%s',_0x31c11d,_0x01d9('0xb'));logger[_0x01d9('0xc')](_0x01d9('0xd'),_0x31c11d,'request\x20sent',JSON[_0x01d9('0xe')](_0x2b8e06));if(_0x2b8e06[_0x01d9('0xf')]){if(_0x2b8e06[_0x01d9('0xf')][_0x01d9('0x10')]===0x1f4){logger[_0x01d9('0xf')](_0x01d9('0x11'),_0x31c11d,_0x2b8e06[_0x01d9('0xf')][_0x01d9('0x12')]);return _0x479447(_0x2b8e06[_0x01d9('0xf')][_0x01d9('0x12')]);}logger[_0x01d9('0xf')](_0x01d9('0x11'),_0x31c11d,_0x2b8e06['error'][_0x01d9('0x12')]);return _0xef9d5b(_0x2b8e06[_0x01d9('0xf')][_0x01d9('0x12')]);}else{logger[_0x01d9('0xa')]('VoiceContext,\x20%s,\x20%s',_0x31c11d,_0x01d9('0xb'));_0xef9d5b(_0x2b8e06[_0x01d9('0x13')][_0x01d9('0x12')]);}})[_0x01d9('0x14')](function(_0x147911){logger['error'](_0x01d9('0x11'),_0x31c11d,_0x147911);_0x479447(_0x147911);});});} \ No newline at end of file +var _0x6bc4=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','catch','util'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x6bc4,0x164));var _0x46bc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6bc4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x46bc('0x0'));var moment=require('moment');var BPromise=require(_0x46bc('0x1'));var rs=require(_0x46bc('0x2'));var fs=require('fs');var Redis=require(_0x46bc('0x3'));var db=require(_0x46bc('0x4'))['db'];var utils=require(_0x46bc('0x5'));var logger=require(_0x46bc('0x6'))('rpc');var config=require(_0x46bc('0x7'));var jayson=require(_0x46bc('0x8'));var client=jayson['client'][_0x46bc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19be50,_0x17710b,_0x75614){return new BPromise(function(_0x3c89e9,_0x3842b3){return client['request'](_0x19be50,_0x75614)[_0x46bc('0xa')](function(_0x28b7e1){logger['info'](_0x46bc('0xb'),_0x17710b,'request\x20sent');logger[_0x46bc('0xc')](_0x46bc('0xd'),_0x17710b,'request\x20sent',JSON[_0x46bc('0xe')](_0x28b7e1));if(_0x28b7e1[_0x46bc('0xf')]){if(_0x28b7e1['error'][_0x46bc('0x10')]===0x1f4){logger['error'](_0x46bc('0xb'),_0x17710b,_0x28b7e1[_0x46bc('0xf')][_0x46bc('0x11')]);return _0x3842b3(_0x28b7e1['error'][_0x46bc('0x11')]);}logger[_0x46bc('0xf')](_0x46bc('0xb'),_0x17710b,_0x28b7e1[_0x46bc('0xf')]['message']);return _0x3c89e9(_0x28b7e1[_0x46bc('0xf')][_0x46bc('0x11')]);}else{logger[_0x46bc('0x12')]('VoiceContext,\x20%s,\x20%s',_0x17710b,_0x46bc('0x13'));_0x3c89e9(_0x28b7e1['result'][_0x46bc('0x11')]);}})[_0x46bc('0x14')](function(_0x4c6de8){logger[_0x46bc('0xf')](_0x46bc('0xb'),_0x17710b,_0x4c6de8);_0x3842b3(_0x4c6de8);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 07622b4..1e10f33 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 _0x1c2d=['/:id','show','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe'];(function(_0x89100d,_0x59c43d){var _0x15974a=function(_0x2fb1ac){while(--_0x2fb1ac){_0x89100d['push'](_0x89100d['shift']());}};_0x15974a(++_0x59c43d);}(_0x1c2d,0x142));var _0xd1c2=function(_0x41a58f,_0x507593){_0x41a58f=_0x41a58f-0x0;var _0x138039=_0x1c2d[_0x41a58f];return _0x138039;};'use strict';var multer=require(_0xd1c2('0x0'));var util=require(_0xd1c2('0x1'));var path=require(_0xd1c2('0x2'));var timeout=require(_0xd1c2('0x3'));var express=require(_0xd1c2('0x4'));var router=express[_0xd1c2('0x5')]();var fs_extra=require(_0xd1c2('0x6'));var auth=require(_0xd1c2('0x7'));var interaction=require(_0xd1c2('0x8'));var config=require(_0xd1c2('0x9'));var controller=require('./voiceDialReport.controller');router[_0xd1c2('0xa')]('/',auth[_0xd1c2('0xb')](),controller[_0xd1c2('0xc')]);router[_0xd1c2('0xa')]('/describe',auth[_0xd1c2('0xb')](),controller[_0xd1c2('0xd')]);router['get'](_0xd1c2('0xe'),auth[_0xd1c2('0xb')](),controller[_0xd1c2('0xf')]);router['post']('/',auth[_0xd1c2('0xb')](),controller[_0xd1c2('0x10')]);router[_0xd1c2('0x11')](_0xd1c2('0xe'),auth[_0xd1c2('0xb')](),controller[_0xd1c2('0x12')]);router['delete'](_0xd1c2('0xe'),auth['isAuthenticated'](),controller[_0xd1c2('0x13')]);module[_0xd1c2('0x14')]=router; \ No newline at end of file +var _0x4221=['update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voiceDialReport.controller','get','/describe','isAuthenticated','/:id','show','post','create'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x4221,0x1a1));var _0x1422=function(_0x4234ed,_0x1ac5d4){_0x4234ed=_0x4234ed-0x0;var _0xe4e6c0=_0x4221[_0x4234ed];return _0xe4e6c0;};'use strict';var multer=require(_0x1422('0x0'));var util=require('util');var path=require(_0x1422('0x1'));var timeout=require(_0x1422('0x2'));var express=require(_0x1422('0x3'));var router=express[_0x1422('0x4')]();var fs_extra=require(_0x1422('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1422('0x6'));var config=require('../../config/environment');var controller=require(_0x1422('0x7'));router[_0x1422('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1422('0x8')](_0x1422('0x9'),auth[_0x1422('0xa')](),controller['describe']);router['get'](_0x1422('0xb'),auth[_0x1422('0xa')](),controller[_0x1422('0xc')]);router[_0x1422('0xd')]('/',auth[_0x1422('0xa')](),controller[_0x1422('0xe')]);router['put'](_0x1422('0xb'),auth[_0x1422('0xa')](),controller[_0x1422('0xf')]);router[_0x1422('0x10')](_0x1422('0xb'),auth[_0x1422('0xa')](),controller['destroy']);module[_0x1422('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 234a733..9de319d 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 _0x34e8=['sequelize','exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x2b3431,_0x310129){var _0x4a2192=function(_0x443ed2){while(--_0x443ed2){_0x2b3431['push'](_0x2b3431['shift']());}};_0x4a2192(++_0x310129);}(_0x34e8,0x12c));var _0x834e=function(_0x257fa6,_0x44a500){_0x257fa6=_0x257fa6-0x0;var _0x27c5e1=_0x34e8[_0x257fa6];return _0x27c5e1;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'privilege':{'type':Sequelize[_0x834e('0x2')]},'channel':{'type':Sequelize[_0x834e('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x834e('0x2')]},'calleridnum':{'type':Sequelize[_0x834e('0x2')]},'calleridname':{'type':Sequelize[_0x834e('0x2')]},'connectedlinenum':{'type':Sequelize[_0x834e('0x2')]},'connectedlinename':{'type':Sequelize[_0x834e('0x2')]},'language':{'type':Sequelize[_0x834e('0x2')]},'accountcode':{'type':Sequelize[_0x834e('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x834e('0x2')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x834e('0x2')]},'linkedid':{'type':Sequelize[_0x834e('0x2')]},'destchannel':{'type':Sequelize[_0x834e('0x2')]},'destchannelstate':{'type':Sequelize[_0x834e('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x834e('0x2')]},'destcalleridnum':{'type':Sequelize[_0x834e('0x2')]},'destcalleridname':{'type':Sequelize[_0x834e('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x834e('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x834e('0x2')]},'destlanguage':{'type':Sequelize[_0x834e('0x2')]},'destaccountcode':{'type':Sequelize[_0x834e('0x2')]},'destcontext':{'type':Sequelize[_0x834e('0x2')]},'destexten':{'type':Sequelize[_0x834e('0x2')]},'destpriority':{'type':Sequelize[_0x834e('0x3')]},'destuniqueid':{'type':Sequelize[_0x834e('0x2')]},'destlinkedid':{'type':Sequelize[_0x834e('0x2')]},'dialstring':{'type':Sequelize[_0x834e('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x834e('0x4')]},'answertime':{'type':Sequelize[_0x834e('0x4')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x834e('0x2')],'comment':_0x834e('0x5')},'routeId':{'type':Sequelize[_0x834e('0x3')]},'duration':{'type':Sequelize[_0x834e('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x834e('0x3')]}}; \ No newline at end of file +var _0x9957=['INTEGER','DATE','called,connect,complete','sequelize','exports','STRING'];(function(_0x409904,_0x3e71){var _0x5862bb=function(_0x495703){while(--_0x495703){_0x409904['push'](_0x409904['shift']());}};_0x5862bb(++_0x3e71);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'privilege':{'type':Sequelize[_0x7995('0x2')]},'channel':{'type':Sequelize[_0x7995('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x7995('0x2')]},'calleridnum':{'type':Sequelize[_0x7995('0x2')]},'calleridname':{'type':Sequelize[_0x7995('0x2')]},'connectedlinenum':{'type':Sequelize[_0x7995('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x7995('0x2')]},'accountcode':{'type':Sequelize[_0x7995('0x2')]},'context':{'type':Sequelize[_0x7995('0x2')]},'exten':{'type':Sequelize[_0x7995('0x2')]},'priority':{'type':Sequelize[_0x7995('0x3')]},'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x7995('0x2')]},'destchannelstate':{'type':Sequelize[_0x7995('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x7995('0x2')]},'destcalleridname':{'type':Sequelize[_0x7995('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x7995('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x7995('0x2')]},'destlanguage':{'type':Sequelize[_0x7995('0x2')]},'destaccountcode':{'type':Sequelize[_0x7995('0x2')]},'destcontext':{'type':Sequelize[_0x7995('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x7995('0x3')]},'destuniqueid':{'type':Sequelize[_0x7995('0x2')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x7995('0x2')]},'dialstatus':{'type':Sequelize[_0x7995('0x2')]},'starttime':{'type':Sequelize[_0x7995('0x4')]},'answertime':{'type':Sequelize[_0x7995('0x4')]},'endtime':{'type':Sequelize[_0x7995('0x4')]},'lastevent':{'type':Sequelize[_0x7995('0x2')],'comment':_0x7995('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0x7995('0x3')]},'billableseconds':{'type':Sequelize[_0x7995('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 5dacf1a..440ba60 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 _0x64d7=['json','limit','undefined','offset','count','set','apply','reject','save','update','then','destroy','error','name','send','index','VoiceDialReport','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','rawAttributes','keys','create','body','params','describe','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','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'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x64d7,0x11f));var _0x764d=function(_0x3e32d6,_0x37c0bb){_0x3e32d6=_0x3e32d6-0x0;var _0x52af90=_0x64d7[_0x3e32d6];return _0x52af90;};'use strict';var emlformat=require(_0x764d('0x0'));var rimraf=require(_0x764d('0x1'));var zipdir=require(_0x764d('0x2'));var jsonpatch=require(_0x764d('0x3'));var rp=require(_0x764d('0x4'));var moment=require(_0x764d('0x5'));var BPromise=require(_0x764d('0x6'));var Mustache=require(_0x764d('0x7'));var util=require(_0x764d('0x8'));var path=require(_0x764d('0x9'));var sox=require(_0x764d('0xa'));var csv=require(_0x764d('0xb'));var ejs=require(_0x764d('0xc'));var fs=require('fs');var fs_extra=require(_0x764d('0xd'));var _=require(_0x764d('0xe'));var squel=require(_0x764d('0xf'));var crypto=require(_0x764d('0x10'));var jsforce=require(_0x764d('0x11'));var deskjs=require(_0x764d('0x12'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x764d('0x13'));var Redis=require(_0x764d('0x14'));var authService=require(_0x764d('0x15'));var qs=require(_0x764d('0x16'));var as=require(_0x764d('0x17'));var hardwareService=require(_0x764d('0x18'));var logger=require(_0x764d('0x19'))(_0x764d('0x1a'));var utils=require(_0x764d('0x1b'));var config=require('../../config/environment');var licenseUtil=require(_0x764d('0x1c'));var db=require(_0x764d('0x1d'))['db'];function respondWithStatusCode(_0x380b39,_0x20032c){_0x20032c=_0x20032c||0xcc;return function(_0x495090){if(_0x495090){return _0x380b39[_0x764d('0x1e')](_0x20032c);}return _0x380b39[_0x764d('0x1f')](_0x20032c)[_0x764d('0x20')]();};}function respondWithResult(_0x4fcf40,_0x4387f8){_0x4387f8=_0x4387f8||0xc8;return function(_0x39a6cb){if(_0x39a6cb){return _0x4fcf40[_0x764d('0x1f')](_0x4387f8)[_0x764d('0x21')](_0x39a6cb);}};}function respondWithFilteredResult(_0x51faba,_0x38cce8){return function(_0x5201f0){if(_0x5201f0){var _0x5bb79a=typeof _0x38cce8['offset']==='undefined'&&typeof _0x38cce8[_0x764d('0x22')]===_0x764d('0x23');var _0x282954=_0x5201f0['count'];var _0x81310a=_0x5bb79a?0x0:_0x38cce8[_0x764d('0x24')];var _0x4ab0fe=_0x5bb79a?_0x5201f0[_0x764d('0x25')]:_0x38cce8[_0x764d('0x24')]+_0x38cce8[_0x764d('0x22')];var _0x3ae3d2;if(_0x4ab0fe>=_0x282954){_0x4ab0fe=_0x282954;_0x3ae3d2=0xc8;}else{_0x3ae3d2=0xce;}_0x51faba['status'](_0x3ae3d2);return _0x51faba[_0x764d('0x26')]('Content-Range',_0x81310a+'-'+_0x4ab0fe+'/'+_0x282954)[_0x764d('0x21')](_0x5201f0);}return null;};}function patchUpdates(_0x4fea92){return function(_0x24be02){try{jsonpatch[_0x764d('0x27')](_0x24be02,_0x4fea92,!![]);}catch(_0x39b437){return BPromise[_0x764d('0x28')](_0x39b437);}return _0x24be02[_0x764d('0x29')]();};}function saveUpdates(_0x54df20,_0x32eddb){return function(_0x4896b0){if(_0x4896b0){return _0x4896b0[_0x764d('0x2a')](_0x54df20)[_0x764d('0x2b')](function(_0x3606f7){return _0x3606f7;});}return null;};}function removeEntity(_0x377cfd,_0x2cc840){return function(_0x2099e0){if(_0x2099e0){return _0x2099e0[_0x764d('0x2c')]()['then'](function(){_0x377cfd['status'](0xcc)[_0x764d('0x20')]();});}};}function handleEntityNotFound(_0x2cb5e5,_0x1df406){return function(_0x4c879f){if(!_0x4c879f){_0x2cb5e5[_0x764d('0x1e')](0x194);}return _0x4c879f;};}function handleError(_0x82d2b6,_0x1339d5){_0x1339d5=_0x1339d5||0x1f4;return function(_0x1f961a){logger[_0x764d('0x2d')](_0x1f961a['stack']);if(_0x1f961a[_0x764d('0x2e')]){delete _0x1f961a[_0x764d('0x2e')];}_0x82d2b6['status'](_0x1339d5)[_0x764d('0x2f')](_0x1f961a);};}exports[_0x764d('0x30')]=function(_0x4f4a8e,_0x437163){var _0x138a19={},_0x3ce0dd={},_0x12f6b8={'count':0x0,'rows':[]};var _0x1f9654=_['map'](db[_0x764d('0x31')]['rawAttributes'],function(_0xcf7953){return{'name':_0xcf7953['fieldName'],'type':_0xcf7953[_0x764d('0x32')][_0x764d('0x33')]};});_0x3ce0dd[_0x764d('0x34')]=_[_0x764d('0x35')](_0x1f9654,_0x764d('0x2e'));_0x3ce0dd[_0x764d('0x36')]=_['keys'](_0x4f4a8e[_0x764d('0x36')]);_0x3ce0dd[_0x764d('0x37')]=_[_0x764d('0x38')](_0x3ce0dd[_0x764d('0x34')],_0x3ce0dd['query']);_0x138a19[_0x764d('0x39')]=_[_0x764d('0x38')](_0x3ce0dd['model'],qs['fields'](_0x4f4a8e[_0x764d('0x36')][_0x764d('0x3a')]));_0x138a19[_0x764d('0x39')]=_0x138a19[_0x764d('0x39')][_0x764d('0x3b')]?_0x138a19[_0x764d('0x39')]:_0x3ce0dd[_0x764d('0x34')];if(!_0x4f4a8e[_0x764d('0x36')][_0x764d('0x3c')](_0x764d('0x3d'))){_0x138a19[_0x764d('0x22')]=qs['limit'](_0x4f4a8e[_0x764d('0x36')][_0x764d('0x22')]);_0x138a19[_0x764d('0x24')]=qs['offset'](_0x4f4a8e[_0x764d('0x36')][_0x764d('0x24')]);}_0x138a19[_0x764d('0x3e')]=qs[_0x764d('0x3f')](_0x4f4a8e[_0x764d('0x36')]['sort']);_0x138a19[_0x764d('0x40')]=qs[_0x764d('0x37')](_[_0x764d('0x41')](_0x4f4a8e[_0x764d('0x36')],_0x3ce0dd[_0x764d('0x37')]),_0x1f9654);if(_0x4f4a8e[_0x764d('0x36')][_0x764d('0x42')]){_0x138a19[_0x764d('0x40')]=_['merge'](_0x138a19[_0x764d('0x40')],{'$or':_[_0x764d('0x35')](_0x1f9654,function(_0x3f987f){if(_0x3f987f[_0x764d('0x32')]!=='VIRTUAL'){var _0x5da237={};_0x5da237[_0x3f987f[_0x764d('0x2e')]]={'$like':'%'+_0x4f4a8e['query'][_0x764d('0x42')]+'%'};return _0x5da237;}})});}_0x138a19=_[_0x764d('0x43')]({},_0x138a19,_0x4f4a8e[_0x764d('0x44')]);var _0x1c0c6e={'where':_0x138a19['where']};return db[_0x764d('0x31')][_0x764d('0x25')](_0x1c0c6e)[_0x764d('0x2b')](function(_0x4220fa){_0x12f6b8[_0x764d('0x25')]=_0x4220fa;if(_0x4f4a8e['query'][_0x764d('0x45')]){_0x138a19[_0x764d('0x46')]=[{'all':!![]}];}return db['VoiceDialReport'][_0x764d('0x47')](_0x138a19);})[_0x764d('0x2b')](function(_0x39d22c){_0x12f6b8[_0x764d('0x48')]=_0x39d22c;return _0x12f6b8;})[_0x764d('0x2b')](respondWithFilteredResult(_0x437163,_0x138a19))[_0x764d('0x49')](handleError(_0x437163,null));};exports['show']=function(_0x5d96b0,_0x150930){var _0x414455={'raw':!![],'where':{'id':_0x5d96b0['params']['id']}},_0x49dab4={};_0x49dab4[_0x764d('0x34')]=_['keys'](db[_0x764d('0x31')][_0x764d('0x4a')]);_0x49dab4[_0x764d('0x36')]=_[_0x764d('0x4b')](_0x5d96b0[_0x764d('0x36')]);_0x49dab4[_0x764d('0x37')]=_[_0x764d('0x38')](_0x49dab4['model'],_0x49dab4['query']);_0x414455[_0x764d('0x39')]=_[_0x764d('0x38')](_0x49dab4[_0x764d('0x34')],qs[_0x764d('0x3a')](_0x5d96b0[_0x764d('0x36')][_0x764d('0x3a')]));_0x414455[_0x764d('0x39')]=_0x414455[_0x764d('0x39')][_0x764d('0x3b')]?_0x414455[_0x764d('0x39')]:_0x49dab4[_0x764d('0x34')];if(_0x5d96b0[_0x764d('0x36')]['includeAll']){_0x414455[_0x764d('0x46')]=[{'all':!![]}];}_0x414455=_['merge']({},_0x414455,_0x5d96b0[_0x764d('0x44')]);return db[_0x764d('0x31')]['find'](_0x414455)['then'](handleEntityNotFound(_0x150930,null))['then'](respondWithResult(_0x150930,null))[_0x764d('0x49')](handleError(_0x150930,null));};exports[_0x764d('0x4c')]=function(_0x40782a,_0x463a8c){return db['VoiceDialReport'][_0x764d('0x4c')](_0x40782a['body'],{})[_0x764d('0x2b')](respondWithResult(_0x463a8c,0xc9))[_0x764d('0x49')](handleError(_0x463a8c,null));};exports[_0x764d('0x2a')]=function(_0x1669da,_0x99d5e7){if(_0x1669da[_0x764d('0x4d')]['id']){delete _0x1669da[_0x764d('0x4d')]['id'];}return db[_0x764d('0x31')]['find']({'where':{'id':_0x1669da['params']['id']}})[_0x764d('0x2b')](handleEntityNotFound(_0x99d5e7,null))['then'](saveUpdates(_0x1669da[_0x764d('0x4d')],null))['then'](respondWithResult(_0x99d5e7,null))['catch'](handleError(_0x99d5e7,null));};exports['destroy']=function(_0x27dcb5,_0x4cd1a9){return db[_0x764d('0x31')]['find']({'where':{'id':_0x27dcb5[_0x764d('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4cd1a9,null))[_0x764d('0x2b')](removeEntity(_0x4cd1a9,null))[_0x764d('0x49')](handleError(_0x4cd1a9,null));};exports[_0x764d('0x4f')]=function(_0x374cf9,_0x1f43d3){return db[_0x764d('0x31')][_0x764d('0x4f')]()[_0x764d('0x2b')](respondWithResult(_0x1f43d3,null))[_0x764d('0x49')](handleError(_0x1f43d3,null));}; \ No newline at end of file +var _0xad9c=['sort','where','pick','filters','filter','merge','options','include','findAll','rows','catch','params','length','includeAll','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','end','error','stack','name','map','VoiceDialReport','rawAttributes','fieldName','type','model','keys','query','intersection','fields','attributes','nolimit','order'];(function(_0x441d3a,_0x49bed8){var _0x32a7c3=function(_0x34dcaf){while(--_0x34dcaf){_0x441d3a['push'](_0x441d3a['shift']());}};_0x32a7c3(++_0x49bed8);}(_0xad9c,0xa3));var _0xcad9=function(_0x262057,_0x22e694){_0x262057=_0x262057-0x0;var _0x42e59a=_0xad9c[_0x262057];return _0x42e59a;};'use strict';var emlformat=require(_0xcad9('0x0'));var rimraf=require(_0xcad9('0x1'));var zipdir=require(_0xcad9('0x2'));var jsonpatch=require(_0xcad9('0x3'));var rp=require('request-promise');var moment=require(_0xcad9('0x4'));var BPromise=require(_0xcad9('0x5'));var Mustache=require('mustache');var util=require(_0xcad9('0x6'));var path=require(_0xcad9('0x7'));var sox=require(_0xcad9('0x8'));var csv=require(_0xcad9('0x9'));var ejs=require(_0xcad9('0xa'));var fs=require('fs');var fs_extra=require(_0xcad9('0xb'));var _=require(_0xcad9('0xc'));var squel=require(_0xcad9('0xd'));var crypto=require(_0xcad9('0xe'));var jsforce=require(_0xcad9('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xcad9('0x9'));var querystring=require(_0xcad9('0x10'));var Papa=require(_0xcad9('0x11'));var Redis=require(_0xcad9('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xcad9('0x13'));var as=require(_0xcad9('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcad9('0x15'))(_0xcad9('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xcad9('0x17'));var db=require(_0xcad9('0x18'))['db'];function respondWithStatusCode(_0x44387b,_0x18f306){_0x18f306=_0x18f306||0xcc;return function(_0x455dd7){if(_0x455dd7){return _0x44387b[_0xcad9('0x19')](_0x18f306);}return _0x44387b[_0xcad9('0x1a')](_0x18f306)['end']();};}function respondWithResult(_0xbf5e8a,_0x2a2fed){_0x2a2fed=_0x2a2fed||0xc8;return function(_0x184fd0){if(_0x184fd0){return _0xbf5e8a[_0xcad9('0x1a')](_0x2a2fed)['json'](_0x184fd0);}};}function respondWithFilteredResult(_0x607458,_0x2e639a){return function(_0xea684d){if(_0xea684d){var _0x3a6465=typeof _0x2e639a[_0xcad9('0x1b')]===_0xcad9('0x1c')&&typeof _0x2e639a[_0xcad9('0x1d')]===_0xcad9('0x1c');var _0x4c0dd6=_0xea684d[_0xcad9('0x1e')];var _0x33b26b=_0x3a6465?0x0:_0x2e639a[_0xcad9('0x1b')];var _0x252540=_0x3a6465?_0xea684d['count']:_0x2e639a['offset']+_0x2e639a[_0xcad9('0x1d')];var _0x1b8167;if(_0x252540>=_0x4c0dd6){_0x252540=_0x4c0dd6;_0x1b8167=0xc8;}else{_0x1b8167=0xce;}_0x607458[_0xcad9('0x1a')](_0x1b8167);return _0x607458[_0xcad9('0x1f')](_0xcad9('0x20'),_0x33b26b+'-'+_0x252540+'/'+_0x4c0dd6)['json'](_0xea684d);}return null;};}function patchUpdates(_0x109aca){return function(_0x14275b){try{jsonpatch[_0xcad9('0x21')](_0x14275b,_0x109aca,!![]);}catch(_0x16b0e9){return BPromise['reject'](_0x16b0e9);}return _0x14275b['save']();};}function saveUpdates(_0x41b612,_0x33ca47){return function(_0x551404){if(_0x551404){return _0x551404['update'](_0x41b612)[_0xcad9('0x22')](function(_0x15ae0e){return _0x15ae0e;});}return null;};}function removeEntity(_0x124c16,_0x3a879d){return function(_0x4704e7){if(_0x4704e7){return _0x4704e7[_0xcad9('0x23')]()[_0xcad9('0x22')](function(){_0x124c16[_0xcad9('0x1a')](0xcc)[_0xcad9('0x24')]();});}};}function handleEntityNotFound(_0x39f148,_0x376c28){return function(_0x46b130){if(!_0x46b130){_0x39f148['sendStatus'](0x194);}return _0x46b130;};}function handleError(_0x3f4627,_0x45f2e3){_0x45f2e3=_0x45f2e3||0x1f4;return function(_0x236b96){logger[_0xcad9('0x25')](_0x236b96[_0xcad9('0x26')]);if(_0x236b96['name']){delete _0x236b96[_0xcad9('0x27')];}_0x3f4627[_0xcad9('0x1a')](_0x45f2e3)['send'](_0x236b96);};}exports['index']=function(_0x3c5124,_0x564ea0){var _0x43d4ca={},_0x54beea={},_0x95c51f={'count':0x0,'rows':[]};var _0x9bc33d=_[_0xcad9('0x28')](db[_0xcad9('0x29')][_0xcad9('0x2a')],function(_0x50a108){return{'name':_0x50a108[_0xcad9('0x2b')],'type':_0x50a108[_0xcad9('0x2c')]['key']};});_0x54beea[_0xcad9('0x2d')]=_[_0xcad9('0x28')](_0x9bc33d,_0xcad9('0x27'));_0x54beea['query']=_[_0xcad9('0x2e')](_0x3c5124[_0xcad9('0x2f')]);_0x54beea['filters']=_[_0xcad9('0x30')](_0x54beea[_0xcad9('0x2d')],_0x54beea[_0xcad9('0x2f')]);_0x43d4ca['attributes']=_['intersection'](_0x54beea[_0xcad9('0x2d')],qs[_0xcad9('0x31')](_0x3c5124[_0xcad9('0x2f')][_0xcad9('0x31')]));_0x43d4ca[_0xcad9('0x32')]=_0x43d4ca['attributes']['length']?_0x43d4ca[_0xcad9('0x32')]:_0x54beea['model'];if(!_0x3c5124[_0xcad9('0x2f')]['hasOwnProperty'](_0xcad9('0x33'))){_0x43d4ca['limit']=qs[_0xcad9('0x1d')](_0x3c5124[_0xcad9('0x2f')][_0xcad9('0x1d')]);_0x43d4ca['offset']=qs[_0xcad9('0x1b')](_0x3c5124[_0xcad9('0x2f')][_0xcad9('0x1b')]);}_0x43d4ca[_0xcad9('0x34')]=qs[_0xcad9('0x35')](_0x3c5124[_0xcad9('0x2f')][_0xcad9('0x35')]);_0x43d4ca[_0xcad9('0x36')]=qs['filters'](_[_0xcad9('0x37')](_0x3c5124['query'],_0x54beea[_0xcad9('0x38')]),_0x9bc33d);if(_0x3c5124[_0xcad9('0x2f')][_0xcad9('0x39')]){_0x43d4ca[_0xcad9('0x36')]=_[_0xcad9('0x3a')](_0x43d4ca[_0xcad9('0x36')],{'$or':_[_0xcad9('0x28')](_0x9bc33d,function(_0x7fc48e){if(_0x7fc48e['type']!=='VIRTUAL'){var _0x907960={};_0x907960[_0x7fc48e['name']]={'$like':'%'+_0x3c5124[_0xcad9('0x2f')][_0xcad9('0x39')]+'%'};return _0x907960;}})});}_0x43d4ca=_[_0xcad9('0x3a')]({},_0x43d4ca,_0x3c5124[_0xcad9('0x3b')]);var _0x5db7c7={'where':_0x43d4ca[_0xcad9('0x36')]};return db['VoiceDialReport'][_0xcad9('0x1e')](_0x5db7c7)[_0xcad9('0x22')](function(_0x5b0749){_0x95c51f[_0xcad9('0x1e')]=_0x5b0749;if(_0x3c5124[_0xcad9('0x2f')]['includeAll']){_0x43d4ca[_0xcad9('0x3c')]=[{'all':!![]}];}return db[_0xcad9('0x29')][_0xcad9('0x3d')](_0x43d4ca);})[_0xcad9('0x22')](function(_0xafb391){_0x95c51f[_0xcad9('0x3e')]=_0xafb391;return _0x95c51f;})[_0xcad9('0x22')](respondWithFilteredResult(_0x564ea0,_0x43d4ca))[_0xcad9('0x3f')](handleError(_0x564ea0,null));};exports['show']=function(_0x5645c8,_0x45a5f5){var _0x5cc1ee={'raw':!![],'where':{'id':_0x5645c8[_0xcad9('0x40')]['id']}},_0x3db4f6={};_0x3db4f6['model']=_[_0xcad9('0x2e')](db['VoiceDialReport'][_0xcad9('0x2a')]);_0x3db4f6[_0xcad9('0x2f')]=_[_0xcad9('0x2e')](_0x5645c8['query']);_0x3db4f6[_0xcad9('0x38')]=_[_0xcad9('0x30')](_0x3db4f6[_0xcad9('0x2d')],_0x3db4f6[_0xcad9('0x2f')]);_0x5cc1ee[_0xcad9('0x32')]=_['intersection'](_0x3db4f6[_0xcad9('0x2d')],qs[_0xcad9('0x31')](_0x5645c8['query'][_0xcad9('0x31')]));_0x5cc1ee[_0xcad9('0x32')]=_0x5cc1ee[_0xcad9('0x32')][_0xcad9('0x41')]?_0x5cc1ee['attributes']:_0x3db4f6[_0xcad9('0x2d')];if(_0x5645c8[_0xcad9('0x2f')][_0xcad9('0x42')]){_0x5cc1ee[_0xcad9('0x3c')]=[{'all':!![]}];}_0x5cc1ee=_[_0xcad9('0x3a')]({},_0x5cc1ee,_0x5645c8[_0xcad9('0x3b')]);return db[_0xcad9('0x29')][_0xcad9('0x43')](_0x5cc1ee)['then'](handleEntityNotFound(_0x45a5f5,null))[_0xcad9('0x22')](respondWithResult(_0x45a5f5,null))['catch'](handleError(_0x45a5f5,null));};exports[_0xcad9('0x44')]=function(_0x5c75f5,_0x4e3a70){return db['VoiceDialReport']['create'](_0x5c75f5[_0xcad9('0x45')],{})['then'](respondWithResult(_0x4e3a70,0xc9))[_0xcad9('0x3f')](handleError(_0x4e3a70,null));};exports[_0xcad9('0x46')]=function(_0x4c9148,_0x3a07de){if(_0x4c9148[_0xcad9('0x45')]['id']){delete _0x4c9148[_0xcad9('0x45')]['id'];}return db[_0xcad9('0x29')][_0xcad9('0x43')]({'where':{'id':_0x4c9148[_0xcad9('0x40')]['id']}})[_0xcad9('0x22')](handleEntityNotFound(_0x3a07de,null))[_0xcad9('0x22')](saveUpdates(_0x4c9148['body'],null))[_0xcad9('0x22')](respondWithResult(_0x3a07de,null))['catch'](handleError(_0x3a07de,null));};exports[_0xcad9('0x23')]=function(_0x30ff90,_0x7de469){return db[_0xcad9('0x29')][_0xcad9('0x43')]({'where':{'id':_0x30ff90[_0xcad9('0x40')]['id']}})['then'](handleEntityNotFound(_0x7de469,null))[_0xcad9('0x22')](removeEntity(_0x7de469,null))['catch'](handleError(_0x7de469,null));};exports[_0xcad9('0x47')]=function(_0xe2b063,_0x3b9dff){return db[_0xcad9('0x29')][_0xcad9('0x47')]()[_0xcad9('0x22')](respondWithResult(_0x3b9dff,null))[_0xcad9('0x3f')](handleError(_0x3b9dff,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 8afc39d..e35045d 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 _0x6a6c=['util','api','bluebird','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','uniqueid','lodash'];(function(_0xbaf28b,_0x277aee){var _0x36337a=function(_0x6e36a4){while(--_0x6e36a4){_0xbaf28b['push'](_0xbaf28b['shift']());}};_0x36337a(++_0x277aee);}(_0x6a6c,0x199));var _0xc6a6=function(_0x375986,_0xadf42){_0x375986=_0x375986-0x0;var _0x5ed68c=_0x6a6c[_0x375986];return _0x5ed68c;};'use strict';var _=require(_0xc6a6('0x0'));var util=require(_0xc6a6('0x1'));var logger=require('../../config/logger')(_0xc6a6('0x2'));var moment=require('moment');var BPromise=require(_0xc6a6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc6a6('0x4'));var rimraf=require(_0xc6a6('0x5'));var config=require(_0xc6a6('0x6'));var attributes=require(_0xc6a6('0x7'));module[_0xc6a6('0x8')]=function(_0x539ec0,_0xb00b28){return _0x539ec0['define']('VoiceDialReport',attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0xc6a6('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5b91=['api','moment','bluebird','rimraf','../../config/environment','./voiceDialReport.attributes','exports','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger'];(function(_0x10537f,_0x26090f){var _0x4a6a9a=function(_0x2b0e34){while(--_0x2b0e34){_0x10537f['push'](_0x10537f['shift']());}};_0x4a6a9a(++_0x26090f);}(_0x5b91,0x128));var _0x15b9=function(_0x14a0a0,_0x45d0cf){_0x14a0a0=_0x14a0a0-0x0;var _0x56b651=_0x5b91[_0x14a0a0];return _0x56b651;};'use strict';var _=require(_0x15b9('0x0'));var util=require(_0x15b9('0x1'));var logger=require(_0x15b9('0x2'))(_0x15b9('0x3'));var moment=require(_0x15b9('0x4'));var BPromise=require(_0x15b9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x15b9('0x6'));var config=require(_0x15b9('0x7'));var attributes=require(_0x15b9('0x8'));module[_0x15b9('0x9')]=function(_0x49ebb3,_0x24009b){return _0x49ebb3['define'](_0x15b9('0xa'),attributes,{'tableName':_0x15b9('0xb'),'paranoid':![],'indexes':[{'fields':[_0x15b9('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 2fb6f8c..de4e573 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 _0x8292=['info','create','body','options','raw','debug','CreateVoiceDialReport','UpdateVoiceDialReport','update','where','attributes','limit','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','VoiceDialReport,\x20%s,\x20%s','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x3f9ac8,_0x5ed025){var _0x4ec19e=function(_0x29cf99){while(--_0x29cf99){_0x3f9ac8['push'](_0x3f9ac8['shift']());}};_0x4ec19e(++_0x5ed025);}(_0x8292,0xad));var _0x2829=function(_0x246148,_0x1358ee){_0x246148=_0x246148-0x0;var _0x453d94=_0x8292[_0x246148];return _0x453d94;};'use strict';var _=require(_0x2829('0x0'));var util=require(_0x2829('0x1'));var moment=require(_0x2829('0x2'));var BPromise=require('bluebird');var rs=require(_0x2829('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2829('0x4'))['db'];var utils=require(_0x2829('0x5'));var logger=require(_0x2829('0x6'))(_0x2829('0x7'));var config=require(_0x2829('0x8'));var jayson=require(_0x2829('0x9'));var client=jayson[_0x2829('0xa')][_0x2829('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x622eb,_0x335662,_0x1b3e78){return new BPromise(function(_0x4c84ac,_0xbd78ca){return client['request'](_0x622eb,_0x1b3e78)[_0x2829('0xc')](function(_0x221a6c){logger['info'](_0x2829('0xd'),_0x335662,_0x2829('0xe'));logger['debug'](_0x2829('0xf'),_0x335662,'request\x20sent',JSON[_0x2829('0x10')](_0x221a6c));if(_0x221a6c[_0x2829('0x11')]){if(_0x221a6c[_0x2829('0x11')]['code']===0x1f4){logger['error'](_0x2829('0xd'),_0x335662,_0x221a6c[_0x2829('0x11')][_0x2829('0x12')]);return _0xbd78ca(_0x221a6c[_0x2829('0x11')][_0x2829('0x12')]);}logger[_0x2829('0x11')](_0x2829('0xd'),_0x335662,_0x221a6c[_0x2829('0x11')]['message']);return _0x4c84ac(_0x221a6c[_0x2829('0x11')][_0x2829('0x12')]);}else{logger[_0x2829('0x13')](_0x2829('0xd'),_0x335662,_0x2829('0xe'));_0x4c84ac(_0x221a6c['result'][_0x2829('0x12')]);}})['catch'](function(_0x43556c){logger[_0x2829('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x335662,_0x43556c);_0xbd78ca(_0x43556c);});});}exports['CreateVoiceDialReport']=function(_0x2c201e){var _0x1b44df=this;return new Promise(function(_0x9da2d6,_0x1af50b){return db['VoiceDialReport'][_0x2829('0x14')](_0x2c201e[_0x2829('0x15')],{'raw':_0x2c201e[_0x2829('0x16')]?_0x2c201e['options'][_0x2829('0x17')]===undefined?!![]:![]:!![]})[_0x2829('0xc')](function(_0x264be6){logger['info']('CreateVoiceDialReport',_0x2c201e);logger[_0x2829('0x18')]('CreateVoiceDialReport',_0x2c201e,JSON['stringify'](_0x264be6));_0x9da2d6(_0x264be6);})['catch'](function(_0x294093){logger['error'](_0x2829('0x19'),_0x294093['message'],_0x2c201e);_0x1af50b(_0x1b44df[_0x2829('0x11')](0x1f4,_0x294093[_0x2829('0x12')]));});});};exports[_0x2829('0x1a')]=function(_0x133eef){var _0xcd0d87=this;return new Promise(function(_0x3b48aa,_0x593eee){return db['VoiceDialReport'][_0x2829('0x1b')](_0x133eef[_0x2829('0x15')],{'raw':_0x133eef[_0x2829('0x16')]?_0x133eef[_0x2829('0x16')][_0x2829('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x133eef[_0x2829('0x16')]?_0x133eef['options'][_0x2829('0x1c')]||null:null,'attributes':_0x133eef[_0x2829('0x16')]?_0x133eef[_0x2829('0x16')][_0x2829('0x1d')]||null:null,'limit':_0x133eef[_0x2829('0x16')]?_0x133eef[_0x2829('0x16')][_0x2829('0x1e')]||null:null})['then'](function(_0x5ec3ba){logger['info'](_0x2829('0x1a'),_0x133eef);logger['debug'](_0x2829('0x1a'),_0x133eef,JSON[_0x2829('0x10')](_0x5ec3ba));_0x3b48aa(_0x5ec3ba);})[_0x2829('0x1f')](function(_0x2653ae){logger['error']('UpdateVoiceDialReport',_0x2653ae[_0x2829('0x12')],_0x133eef);_0x593eee(_0xcd0d87['error'](0x1f4,_0x2653ae['message']));});});}; \ No newline at end of file +var _0xedc7=['VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','VoiceDialReport','body','CreateVoiceDialReport','UpdateVoiceDialReport','options','raw','where','attributes','limit','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info'];(function(_0x3e0f2e,_0x187d0b){var _0x4a562a=function(_0x579096){while(--_0x579096){_0x3e0f2e['push'](_0x3e0f2e['shift']());}};_0x4a562a(++_0x187d0b);}(_0xedc7,0x13b));var _0x7edc=function(_0x4570d5,_0x115f91){_0x4570d5=_0x4570d5-0x0;var _0x314a34=_0xedc7[_0x4570d5];return _0x314a34;};'use strict';var _=require(_0x7edc('0x0'));var util=require(_0x7edc('0x1'));var moment=require(_0x7edc('0x2'));var BPromise=require(_0x7edc('0x3'));var rs=require(_0x7edc('0x4'));var fs=require('fs');var Redis=require(_0x7edc('0x5'));var db=require(_0x7edc('0x6'))['db'];var utils=require(_0x7edc('0x7'));var logger=require('../../config/logger')(_0x7edc('0x8'));var config=require('../../config/environment');var jayson=require(_0x7edc('0x9'));var client=jayson[_0x7edc('0xa')][_0x7edc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x178d96,_0x5a9e59,_0x5770a9){return new BPromise(function(_0x4681ea,_0x2eac6a){return client[_0x7edc('0xc')](_0x178d96,_0x5770a9)[_0x7edc('0xd')](function(_0x4437d9){logger[_0x7edc('0xe')](_0x7edc('0xf'),_0x5a9e59,_0x7edc('0x10'));logger[_0x7edc('0x11')](_0x7edc('0x12'),_0x5a9e59,_0x7edc('0x10'),JSON['stringify'](_0x4437d9));if(_0x4437d9[_0x7edc('0x13')]){if(_0x4437d9[_0x7edc('0x13')]['code']===0x1f4){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x5a9e59,_0x4437d9[_0x7edc('0x13')]['message']);return _0x2eac6a(_0x4437d9[_0x7edc('0x13')][_0x7edc('0x14')]);}logger[_0x7edc('0x13')](_0x7edc('0xf'),_0x5a9e59,_0x4437d9[_0x7edc('0x13')][_0x7edc('0x14')]);return _0x4681ea(_0x4437d9[_0x7edc('0x13')][_0x7edc('0x14')]);}else{logger[_0x7edc('0xe')]('VoiceDialReport,\x20%s,\x20%s',_0x5a9e59,_0x7edc('0x10'));_0x4681ea(_0x4437d9[_0x7edc('0x15')][_0x7edc('0x14')]);}})[_0x7edc('0x16')](function(_0x2ec9e4){logger[_0x7edc('0x13')]('VoiceDialReport,\x20%s,\x20%s',_0x5a9e59,_0x2ec9e4);_0x2eac6a(_0x2ec9e4);});});}exports['CreateVoiceDialReport']=function(_0x593674){var _0x29e885=this;return new Promise(function(_0x157031,_0x218be6){return db[_0x7edc('0x17')]['create'](_0x593674[_0x7edc('0x18')],{'raw':_0x593674['options']?_0x593674['options']['raw']===undefined?!![]:![]:!![]})[_0x7edc('0xd')](function(_0x4b1f1a){logger[_0x7edc('0xe')](_0x7edc('0x19'),_0x593674);logger[_0x7edc('0x11')](_0x7edc('0x19'),_0x593674,JSON['stringify'](_0x4b1f1a));_0x157031(_0x4b1f1a);})['catch'](function(_0x6907fb){logger['error'](_0x7edc('0x19'),_0x6907fb['message'],_0x593674);_0x218be6(_0x29e885[_0x7edc('0x13')](0x1f4,_0x6907fb['message']));});});};exports[_0x7edc('0x1a')]=function(_0x30cc32){var _0x4a0d0d=this;return new Promise(function(_0x35739f,_0x3d627c){return db['VoiceDialReport']['update'](_0x30cc32[_0x7edc('0x18')],{'raw':_0x30cc32[_0x7edc('0x1b')]?_0x30cc32[_0x7edc('0x1b')][_0x7edc('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30cc32['options']?_0x30cc32[_0x7edc('0x1b')][_0x7edc('0x1d')]||null:null,'attributes':_0x30cc32['options']?_0x30cc32[_0x7edc('0x1b')][_0x7edc('0x1e')]||null:null,'limit':_0x30cc32['options']?_0x30cc32[_0x7edc('0x1b')][_0x7edc('0x1f')]||null:null})[_0x7edc('0xd')](function(_0x56e719){logger['info']('UpdateVoiceDialReport',_0x30cc32);logger['debug'](_0x7edc('0x1a'),_0x30cc32,JSON[_0x7edc('0x20')](_0x56e719));_0x35739f(_0x56e719);})[_0x7edc('0x16')](function(_0x577f63){logger['error'](_0x7edc('0x1a'),_0x577f63[_0x7edc('0x14')],_0x30cc32);_0x3d627c(_0x4a0d0d[_0x7edc('0x13')](0x1f4,_0x577f63[_0x7edc('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index da94fc2..4a749b1 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 _0xda5e=['multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','post','create','addApplications','put','/:id','destroy','exports'];(function(_0xb03c3,_0x46c612){var _0x21501f=function(_0x40fbe4){while(--_0x40fbe4){_0xb03c3['push'](_0xb03c3['shift']());}};_0x21501f(++_0x46c612);}(_0xda5e,0x70));var _0xeda5=function(_0x2f6063,_0x4a6ed9){_0x2f6063=_0x2f6063-0x0;var _0x20a2f3=_0xda5e[_0x2f6063];return _0x20a2f3;};'use strict';var multer=require(_0xeda5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xeda5('0x1'));var express=require(_0xeda5('0x2'));var router=express[_0xeda5('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xeda5('0x4'));var config=require(_0xeda5('0x5'));var controller=require('./voiceExtension.controller');router[_0xeda5('0x6')]('/',auth['isAuthenticated'](),controller[_0xeda5('0x7')]);router[_0xeda5('0x6')]('/:id',auth[_0xeda5('0x8')](),controller['show']);router[_0xeda5('0x9')]('/',auth[_0xeda5('0x8')](),controller[_0xeda5('0xa')]);router[_0xeda5('0x9')]('/:id/applications',auth[_0xeda5('0x8')](),controller[_0xeda5('0xb')]);router[_0xeda5('0xc')](_0xeda5('0xd'),auth[_0xeda5('0x8')](),controller['update']);router['delete'](_0xeda5('0xd'),auth[_0xeda5('0x8')](),controller[_0xeda5('0xe')]);module[_0xeda5('0xf')]=router; \ No newline at end of file +var _0xff35=['index','/:id','show','post','create','/:id/applications','addApplications','put','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated'];(function(_0x116a48,_0x45d1d7){var _0x176a29=function(_0x59a921){while(--_0x59a921){_0x116a48['push'](_0x116a48['shift']());}};_0x176a29(++_0x45d1d7);}(_0xff35,0x181));var _0x5ff3=function(_0x3849eb,_0x5f9348){_0x3849eb=_0x3849eb-0x0;var _0x5c5ad3=_0xff35[_0x3849eb];return _0x5c5ad3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5ff3('0x0'));var timeout=require(_0x5ff3('0x1'));var express=require(_0x5ff3('0x2'));var router=express[_0x5ff3('0x3')]();var fs_extra=require(_0x5ff3('0x4'));var auth=require(_0x5ff3('0x5'));var interaction=require(_0x5ff3('0x6'));var config=require(_0x5ff3('0x7'));var controller=require(_0x5ff3('0x8'));router[_0x5ff3('0x9')]('/',auth[_0x5ff3('0xa')](),controller[_0x5ff3('0xb')]);router[_0x5ff3('0x9')](_0x5ff3('0xc'),auth['isAuthenticated'](),controller[_0x5ff3('0xd')]);router[_0x5ff3('0xe')]('/',auth['isAuthenticated'](),controller[_0x5ff3('0xf')]);router[_0x5ff3('0xe')](_0x5ff3('0x10'),auth['isAuthenticated'](),controller[_0x5ff3('0x11')]);router[_0x5ff3('0x12')](_0x5ff3('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x5ff3('0x13')](_0x5ff3('0xc'),auth[_0x5ff3('0xa')](),controller[_0x5ff3('0x14')]);module[_0x5ff3('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 642c05e..50ab830 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 _0xc8df=['outbound','internal','inbound-fax','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','compositeIndex','STRING','NoOp','ENUM'];(function(_0x2211ed,_0x1bca0b){var _0x4d78cc=function(_0x467b59){while(--_0x467b59){_0x2211ed['push'](_0x2211ed['shift']());}};_0x4d78cc(++_0x1bca0b);}(_0xc8df,0x7c));var _0xfc8d=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xc8df[_0x122096];return _0x3d1966;};'use strict';var Sequelize=require('sequelize');module['exports']={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xfc8d('0x0'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xfc8d('0x1')],'allowNull':![],'unique':_0xfc8d('0x0')},'priority':{'type':Sequelize[_0xfc8d('0x1')],'allowNull':![],'defaultValue':'1','unique':_0xfc8d('0x0')},'tag':{'type':Sequelize[_0xfc8d('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xfc8d('0x1')],'allowNull':![],'defaultValue':_0xfc8d('0x2')},'appdata':{'type':Sequelize[_0xfc8d('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xfc8d('0x3')]('inbound',_0xfc8d('0x4'),_0xfc8d('0x5'),_0xfc8d('0x6'),_0xfc8d('0x7'),_0xfc8d('0x8'),_0xfc8d('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0xfc8d('0x1')]},'interval':{'type':Sequelize[_0xfc8d('0x1')],'allowNull':![],'defaultValue':_0xfc8d('0xa')},'IntervalId':{'type':Sequelize[_0xfc8d('0xb')]},'isApp':{'type':Sequelize[_0xfc8d('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xfc8d('0x1')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0xfc8d('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xfc8d('0xb')]},'recordingFormat':{'type':Sequelize[_0xfc8d('0x1')],'defaultValue':'wav'},'answer':{'type':Sequelize[_0xfc8d('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0xfc8d('0xd')],'get':function(_0x59d910){return this[_0xfc8d('0xe')](_0xfc8d('0xf'));}},'alias':{'type':Sequelize[_0xfc8d('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x1acd=['INTEGER','BOOLEAN','wav','getDataValue','exten','sequelize','exports','compositeIndex','STRING','NoOp','inbound','outbound','internal','inbound-fax','outbound-fax','any','*,*,*,*'];(function(_0x2a0a34,_0x1e3529){var _0x41a8c3=function(_0x5610ab){while(--_0x5610ab){_0x2a0a34['push'](_0x2a0a34['shift']());}};_0x41a8c3(++_0x1e3529);}(_0x1acd,0xf3));var _0xd1ac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1acd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd1ac('0x0'));module[_0xd1ac('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd1ac('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xd1ac('0x3')],'allowNull':![],'unique':_0xd1ac('0x2')},'priority':{'type':Sequelize[_0xd1ac('0x3')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0xd1ac('0x3')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xd1ac('0x3')],'allowNull':![],'defaultValue':_0xd1ac('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0xd1ac('0x5'),_0xd1ac('0x6'),_0xd1ac('0x7'),_0xd1ac('0x8'),_0xd1ac('0x9'),'system',_0xd1ac('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0xd1ac('0x3')]},'interval':{'type':Sequelize[_0xd1ac('0x3')],'allowNull':![],'defaultValue':_0xd1ac('0xb')},'IntervalId':{'type':Sequelize[_0xd1ac('0xc')]},'isApp':{'type':Sequelize[_0xd1ac('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0xd1ac('0x3')],'allowNull':!![]},'record':{'type':Sequelize[_0xd1ac('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xd1ac('0xc')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0xd1ac('0xe')},'answer':{'type':Sequelize[_0xd1ac('0xd')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5a4dd8){return this[_0xd1ac('0xf')](_0xd1ac('0x10'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 55f174a..4099bfd 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 _0x6170=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','findOne','sequelize','VoiceExtensionId','isApp','createRouting','log','LOG\x20~\x20.then\x20~\x20routing','bulkCreate','cast(priority\x20as\x20unsigned)','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','find','type','name','destroy','then','stack','send','index','VoiceExtension','rawAttributes','fieldName','key','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','includeAll','include','catch','show','params','keys','length','create','body','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId'];(function(_0x3e0ab1,_0x955570){var _0x26744a=function(_0x41d40f){while(--_0x41d40f){_0x3e0ab1['push'](_0x3e0ab1['shift']());}};_0x26744a(++_0x955570);}(_0x6170,0x17d));var _0x0617=function(_0x722d44,_0x245ca0){_0x722d44=_0x722d44-0x0;var _0x4fd74b=_0x6170[_0x722d44];return _0x4fd74b;};'use strict';var _=require(_0x0617('0x0'));var Redis=require(_0x0617('0x1'));var qs=require(_0x0617('0x2'));var logger=require(_0x0617('0x3'))('api');var config=require(_0x0617('0x4'));var db=require(_0x0617('0x5'))['db'];config[_0x0617('0x6')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0617('0x7'))(new Redis(config['redis']));require(_0x0617('0x8'))[_0x0617('0x9')](socket);function respondWithStatusCode(_0x1f0aaa,_0x3562ee){_0x3562ee=_0x3562ee||0xcc;return function(_0x7b2c3e){if(_0x7b2c3e){return _0x1f0aaa[_0x0617('0xa')](_0x3562ee);}return _0x1f0aaa[_0x0617('0xb')](_0x3562ee)[_0x0617('0xc')]();};}function respondWithResult(_0x3a98a6,_0x2c0b7b){_0x2c0b7b=_0x2c0b7b||0xc8;return function(_0x442e9f){if(_0x442e9f){return _0x3a98a6['status'](_0x2c0b7b)[_0x0617('0xd')](_0x442e9f);}};}function respondWithFilteredResult(_0x1f0203,_0x310e85){return function(_0x5c6c2b){if(_0x5c6c2b){var _0x401860=typeof _0x310e85[_0x0617('0xe')]===_0x0617('0xf')&&typeof _0x310e85['limit']===_0x0617('0xf');var _0x3235d9=_0x5c6c2b[_0x0617('0x10')];var _0x254e59=_0x401860?0x0:_0x310e85[_0x0617('0xe')];var _0x330864=_0x401860?_0x5c6c2b[_0x0617('0x10')]:_0x310e85['offset']+_0x310e85[_0x0617('0x11')];var _0x5d6f08;if(_0x330864>=_0x3235d9){_0x330864=_0x3235d9;_0x5d6f08=0xc8;}else{_0x5d6f08=0xce;}_0x1f0203['status'](_0x5d6f08);return _0x1f0203[_0x0617('0x12')](_0x0617('0x13'),_0x254e59+'-'+_0x330864+'/'+_0x3235d9)[_0x0617('0xd')](_0x5c6c2b);}return null;};}function removeEntity(_0x8de1e2){return function(_0x3d69aa){if(_0x3d69aa){return _0x3d69aa['destroy']()['then'](function(){var _0x15c98b=_0x3d69aa[_0x0617('0x14')]({'plain':!![]});var _0x365256=[{'name':_0x0617('0x15'),'value':_0x0617('0x16'),'ignore':![]},{'name':_0x0617('0x17'),'value':_0x0617('0x18'),'ignore':![]},{'name':_0x0617('0x19'),'value':_0x0617('0x1a'),'ignore':![]}];var _0x5605be=_(_0x365256)[_0x0617('0x1b')](_0x0617('0x1c'))[_0x0617('0x1d')]('value')[_0x0617('0x1e')]();if(_[_0x0617('0x1f')](_0x5605be,_0x15c98b['type'])){return;}var _0xd33c73=_[_0x0617('0x20')](_0x365256,['value',_0x15c98b[_0x0617('0x21')]])[_0x0617('0x22')];return db['UserProfileResource'][_0x0617('0x23')]({'where':{'type':_0xd33c73,'resourceId':_0x15c98b['id']}})[_0x0617('0x24')](function(){return _0x3d69aa;});})[_0x0617('0x24')](function(){_0x8de1e2[_0x0617('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5989b8){return function(_0x312397){if(!_0x312397){_0x5989b8[_0x0617('0xa')](0x194);}return _0x312397;};}function handleError(_0x4ebe42,_0x193b81){_0x193b81=_0x193b81||0x1f4;return function(_0x40df17){logger['error'](_0x40df17[_0x0617('0x25')]);if(_0x40df17['name']){delete _0x40df17[_0x0617('0x22')];}_0x4ebe42[_0x0617('0xb')](_0x193b81)[_0x0617('0x26')](_0x40df17);};}exports[_0x0617('0x27')]=function(_0x903c59,_0x269238){var _0x32ef28={},_0x2080dd={},_0x2c8f6a={'count':0x0,'rows':[]};var _0x2a58ba=_['map'](db[_0x0617('0x28')][_0x0617('0x29')],function(_0x1ff68e){return{'name':_0x1ff68e[_0x0617('0x2a')],'type':_0x1ff68e[_0x0617('0x21')][_0x0617('0x2b')]};});_0x2080dd['model']=_[_0x0617('0x1d')](_0x2a58ba,_0x0617('0x22'));_0x2080dd['query']=_['keys'](_0x903c59[_0x0617('0x2c')]);_0x2080dd[_0x0617('0x2d')]=_[_0x0617('0x2e')](_0x2080dd[_0x0617('0x2f')],_0x2080dd['query']);_0x32ef28['attributes']=_['intersection'](_0x2080dd[_0x0617('0x2f')],qs[_0x0617('0x30')](_0x903c59[_0x0617('0x2c')][_0x0617('0x30')]));_0x32ef28[_0x0617('0x31')]=_0x32ef28[_0x0617('0x31')]['length']?_0x32ef28[_0x0617('0x31')]:_0x2080dd[_0x0617('0x2f')];if(!_0x903c59[_0x0617('0x2c')][_0x0617('0x32')](_0x0617('0x33'))){_0x32ef28['limit']=qs[_0x0617('0x11')](_0x903c59[_0x0617('0x2c')]['limit']);_0x32ef28[_0x0617('0xe')]=qs[_0x0617('0xe')](_0x903c59[_0x0617('0x2c')][_0x0617('0xe')]);}_0x32ef28[_0x0617('0x34')]=qs[_0x0617('0x35')](_0x903c59['query']['sort']);_0x32ef28[_0x0617('0x36')]=qs[_0x0617('0x2d')](_[_0x0617('0x37')](_0x903c59['query'],_0x2080dd[_0x0617('0x2d')]),_0x2a58ba);if(_0x903c59[_0x0617('0x2c')]['filter']){_0x32ef28['where']=_[_0x0617('0x38')](_0x32ef28[_0x0617('0x36')],{'$or':_[_0x0617('0x1d')](_0x2a58ba,function(_0x59e9d5){if(_0x59e9d5[_0x0617('0x21')]!=='VIRTUAL'){var _0x2e6370={};_0x2e6370[_0x59e9d5[_0x0617('0x22')]]={'$like':'%'+_0x903c59[_0x0617('0x2c')][_0x0617('0x1b')]+'%'};return _0x2e6370;}})});}_0x32ef28=_[_0x0617('0x38')]({},_0x32ef28,_0x903c59[_0x0617('0x39')]);var _0xf525f1={'where':_0x32ef28[_0x0617('0x36')]};return db[_0x0617('0x28')]['count'](_0xf525f1)['then'](function(_0x470bf3){_0x2c8f6a[_0x0617('0x10')]=_0x470bf3;if(_0x903c59[_0x0617('0x2c')][_0x0617('0x3a')]){_0x32ef28[_0x0617('0x3b')]=[{'all':!![]}];}return db[_0x0617('0x28')]['findAll'](_0x32ef28);})[_0x0617('0x24')](function(_0x2dcf37){_0x2c8f6a['rows']=_0x2dcf37;return _0x2c8f6a;})[_0x0617('0x24')](respondWithFilteredResult(_0x269238,_0x32ef28))[_0x0617('0x3c')](handleError(_0x269238,null));};exports[_0x0617('0x3d')]=function(_0x54d830,_0x435105){var _0xcce827={'raw':![],'where':{'id':_0x54d830[_0x0617('0x3e')]['id']}},_0x3b93ce={};_0x3b93ce[_0x0617('0x2f')]=_[_0x0617('0x3f')](db['VoiceExtension'][_0x0617('0x29')]);_0x3b93ce['query']=_[_0x0617('0x3f')](_0x54d830[_0x0617('0x2c')]);_0x3b93ce[_0x0617('0x2d')]=_[_0x0617('0x2e')](_0x3b93ce['model'],_0x3b93ce[_0x0617('0x2c')]);_0xcce827[_0x0617('0x31')]=_[_0x0617('0x2e')](_0x3b93ce[_0x0617('0x2f')],qs[_0x0617('0x30')](_0x54d830[_0x0617('0x2c')][_0x0617('0x30')]));_0xcce827['attributes']=_0xcce827[_0x0617('0x31')][_0x0617('0x40')]?_0xcce827[_0x0617('0x31')]:_0x3b93ce[_0x0617('0x2f')];if(_0x54d830[_0x0617('0x2c')][_0x0617('0x3a')]){_0xcce827[_0x0617('0x3b')]=[{'all':!![]}];}_0xcce827=_[_0x0617('0x38')]({},_0xcce827,_0x54d830[_0x0617('0x39')]);return db[_0x0617('0x28')][_0x0617('0x20')](_0xcce827)[_0x0617('0x24')](handleEntityNotFound(_0x435105,null))['then'](respondWithResult(_0x435105,null))[_0x0617('0x3c')](handleError(_0x435105,null));};exports[_0x0617('0x23')]=function(_0x364def,_0x207400){return db[_0x0617('0x28')][_0x0617('0x20')]({'where':{'id':_0x364def[_0x0617('0x3e')]['id']}})['then'](handleEntityNotFound(_0x207400,null))[_0x0617('0x24')](removeEntity(_0x207400,null))['catch'](handleError(_0x207400,null));};exports[_0x0617('0x41')]=function(_0x71ded,_0xcf9834){if(_0x71ded[_0x0617('0x42')]['type']==='outbound'&&!_['startsWith'](_0x71ded[_0x0617('0x42')][_0x0617('0x43')],'_')){_0x71ded[_0x0617('0x42')][_0x0617('0x43')]='_'[_0x0617('0x44')](_0x71ded['body'][_0x0617('0x43')]);}return db[_0x0617('0x28')]['create'](_0x71ded[_0x0617('0x42')],{'raw':![]})[_0x0617('0x24')](function(_0x55b1c4){var _0x1c5a3d=_0x71ded[_0x0617('0x45')][_0x0617('0x14')]({'plain':!![]});if(!_0x1c5a3d)throw new Error(_0x0617('0x46'));if(_0x1c5a3d[_0x0617('0x47')]===_0x0617('0x45')){var _0x5da9d7=_0x55b1c4[_0x0617('0x14')]({'plain':!![]});var _0x5e5b8b=[{'name':_0x0617('0x15'),'value':_0x0617('0x16')},{'name':_0x0617('0x17'),'value':_0x0617('0x18')},{'name':_0x0617('0x19'),'value':'internal'}];var _0x266f91=_[_0x0617('0x20')](_0x5e5b8b,[_0x0617('0x1e'),_0x5da9d7[_0x0617('0x21')]])['name'];return db[_0x0617('0x48')]['find']({'where':{'name':_0x266f91,'userProfileId':_0x1c5a3d[_0x0617('0x49')]},'raw':!![]})['then'](function(_0x15606d){if(_0x15606d&&_0x15606d[_0x0617('0x4a')]===0x0){return db['UserProfileResource'][_0x0617('0x41')]({'name':_0x5da9d7['name'],'resourceId':_0x5da9d7['id'],'type':_0x15606d[_0x0617('0x22')],'sectionId':_0x15606d['id']},{})['then'](function(){return _0x55b1c4;});}else{return _0x55b1c4;}})[_0x0617('0x3c')](function(_0x4beee2){logger['error'](_0x0617('0x4b'),_0x4beee2);throw _0x4beee2;});}return _0x55b1c4;})[_0x0617('0x24')](respondWithResult(_0xcf9834,0xc9))[_0x0617('0x3c')](handleError(_0xcf9834,null));};exports[_0x0617('0x4c')]=function(_0x1d42f1,_0x4d3684){if(_0x1d42f1['body']['id']){delete _0x1d42f1['body']['id'];}return db[_0x0617('0x28')][_0x0617('0x20')]({'where':{'id':_0x1d42f1[_0x0617('0x3e')]['id']}})[_0x0617('0x24')](handleEntityNotFound(_0x4d3684,null))[_0x0617('0x24')](function(_0x115257){if(_0x115257){return db[_0x0617('0x28')][_0x0617('0x4c')](_[_0x0617('0x37')](_0x1d42f1[_0x0617('0x42')],[_0x0617('0x43'),'context','description',_0x0617('0x4d'),_0x0617('0x4e'),_0x0617('0x4f'),_0x0617('0x50')]),{'where':{'context':_0x115257['context'],'exten':_0x115257['exten']},'individualHooks':!![]})[_0x0617('0x24')](function(_0x9e50e7){return _0x9e50e7;});}return null;})[_0x0617('0x24')](respondWithStatusCode(_0x4d3684,null))[_0x0617('0x3c')](handleError(_0x4d3684,null));};exports[_0x0617('0x51')]=function(_0x25126d,_0x46986c){return db[_0x0617('0x28')][_0x0617('0x52')]({'where':{'id':_0x25126d[_0x0617('0x3e')]['id']}})[_0x0617('0x24')](function(_0x5e7a67){if(_0x5e7a67){return db[_0x0617('0x53')]['transaction'](function(_0xb3a1f0){return db[_0x0617('0x28')][_0x0617('0x23')]({'where':{'VoiceExtensionId':_0x25126d[_0x0617('0x3e')]['id']},'transaction':_0xb3a1f0})[_0x0617('0x24')](function(){var _0x79ac67=_['map'](_0x25126d[_0x0617('0x42')],function(_0x5ef573){_0x5ef573[_0x0617('0x54')]=_0x25126d[_0x0617('0x3e')]['id'];_0x5ef573[_0x0617('0x55')]=!![];return _0x5ef573;});return _0x5e7a67[_0x0617('0x56')](_0x79ac67);})[_0x0617('0x24')](function(_0x352c1c){console[_0x0617('0x57')](_0x0617('0x58'),_0x352c1c);return db[_0x0617('0x28')][_0x0617('0x59')](_0x352c1c,{'transaction':_0xb3a1f0});});})[_0x0617('0x24')](function(){return db['VoiceExtension']['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x25126d[_0x0617('0x3e')]['id']},'order':_0x0617('0x5a')});});}})['then'](respondWithResult(_0x46986c,null))[_0x0617('0x3c')](handleError(_0x46986c,null));}; \ No newline at end of file +var _0xd35f=['findAll','rows','catch','show','params','create','body','startsWith','exten','concat','user','role','OutboundRoutes','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','recordingFormat','cutdigits','mandatoryDisposition','alias','findOne','sequelize','transaction','VoiceExtensionId','isApp','log','LOG\x20~\x20.then\x20~\x20routing','bulkCreate','findAndCountAll','lodash','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','limit','count','Content-Range','destroy','then','get','inbound','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','name','UserProfileResource','stack','index','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','VoiceExtension','includeAll','include'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0xd35f,0xd2));var _0xfd35=function(_0x364a36,_0x1e2677){_0x364a36=_0x364a36-0x0;var _0x5cd6fa=_0xd35f[_0x364a36];return _0x5cd6fa;};'use strict';var _=require(_0xfd35('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xfd35('0x1'))('api');var config=require(_0xfd35('0x2'));var db=require(_0xfd35('0x3'))['db'];config['redis']=_[_0xfd35('0x4')](config[_0xfd35('0x5')],{'host':_0xfd35('0x6'),'port':0x18eb});var socket=require(_0xfd35('0x7'))(new Redis(config[_0xfd35('0x5')]));require('./voiceExtension.socket')[_0xfd35('0x8')](socket);function respondWithStatusCode(_0x11ed40,_0xa2395c){_0xa2395c=_0xa2395c||0xcc;return function(_0x39337f){if(_0x39337f){return _0x11ed40[_0xfd35('0x9')](_0xa2395c);}return _0x11ed40['status'](_0xa2395c)[_0xfd35('0xa')]();};}function respondWithResult(_0x1da506,_0x58d938){_0x58d938=_0x58d938||0xc8;return function(_0x51df18){if(_0x51df18){return _0x1da506[_0xfd35('0xb')](_0x58d938)[_0xfd35('0xc')](_0x51df18);}};}function respondWithFilteredResult(_0x320a21,_0x3f9ed){return function(_0x1b29f2){if(_0x1b29f2){var _0x55979d=typeof _0x3f9ed[_0xfd35('0xd')]==='undefined'&&typeof _0x3f9ed[_0xfd35('0xe')]==='undefined';var _0x47d196=_0x1b29f2[_0xfd35('0xf')];var _0x3030d5=_0x55979d?0x0:_0x3f9ed['offset'];var _0xbd3e8f=_0x55979d?_0x1b29f2[_0xfd35('0xf')]:_0x3f9ed[_0xfd35('0xd')]+_0x3f9ed[_0xfd35('0xe')];var _0x47c7f6;if(_0xbd3e8f>=_0x47d196){_0xbd3e8f=_0x47d196;_0x47c7f6=0xc8;}else{_0x47c7f6=0xce;}_0x320a21[_0xfd35('0xb')](_0x47c7f6);return _0x320a21['set'](_0xfd35('0x10'),_0x3030d5+'-'+_0xbd3e8f+'/'+_0x47d196)[_0xfd35('0xc')](_0x1b29f2);}return null;};}function removeEntity(_0x13a5c2){return function(_0x10c637){if(_0x10c637){return _0x10c637[_0xfd35('0x11')]()[_0xfd35('0x12')](function(){var _0x313080=_0x10c637[_0xfd35('0x13')]({'plain':!![]});var _0x3b3723=[{'name':'InboundRoutes','value':_0xfd35('0x14'),'ignore':![]},{'name':'OutboundRoutes','value':_0xfd35('0x15'),'ignore':![]},{'name':_0xfd35('0x16'),'value':_0xfd35('0x17'),'ignore':![]}];var _0x41473d=_(_0x3b3723)[_0xfd35('0x18')](_0xfd35('0x19'))[_0xfd35('0x1a')](_0xfd35('0x1b'))[_0xfd35('0x1b')]();if(_[_0xfd35('0x1c')](_0x41473d,_0x313080[_0xfd35('0x1d')])){return;}var _0x1b79ef=_[_0xfd35('0x1e')](_0x3b3723,['value',_0x313080[_0xfd35('0x1d')]])[_0xfd35('0x1f')];return db[_0xfd35('0x20')][_0xfd35('0x11')]({'where':{'type':_0x1b79ef,'resourceId':_0x313080['id']}})['then'](function(){return _0x10c637;});})[_0xfd35('0x12')](function(){_0x13a5c2[_0xfd35('0xb')](0xcc)[_0xfd35('0xa')]();});}};}function handleEntityNotFound(_0x46f893){return function(_0x28942b){if(!_0x28942b){_0x46f893[_0xfd35('0x9')](0x194);}return _0x28942b;};}function handleError(_0x2e6c1b,_0x39d830){_0x39d830=_0x39d830||0x1f4;return function(_0x16f804){logger['error'](_0x16f804[_0xfd35('0x21')]);if(_0x16f804['name']){delete _0x16f804[_0xfd35('0x1f')];}_0x2e6c1b[_0xfd35('0xb')](_0x39d830)['send'](_0x16f804);};}exports[_0xfd35('0x22')]=function(_0x3fb963,_0x55d1e5){var _0x5f1679={},_0x2954a2={},_0x333d68={'count':0x0,'rows':[]};var _0x2b1eae=_[_0xfd35('0x1a')](db['VoiceExtension'][_0xfd35('0x23')],function(_0x5bf9fb){return{'name':_0x5bf9fb['fieldName'],'type':_0x5bf9fb['type'][_0xfd35('0x24')]};});_0x2954a2[_0xfd35('0x25')]=_[_0xfd35('0x1a')](_0x2b1eae,_0xfd35('0x1f'));_0x2954a2[_0xfd35('0x26')]=_[_0xfd35('0x27')](_0x3fb963[_0xfd35('0x26')]);_0x2954a2[_0xfd35('0x28')]=_[_0xfd35('0x29')](_0x2954a2[_0xfd35('0x25')],_0x2954a2[_0xfd35('0x26')]);_0x5f1679[_0xfd35('0x2a')]=_[_0xfd35('0x29')](_0x2954a2[_0xfd35('0x25')],qs['fields'](_0x3fb963[_0xfd35('0x26')][_0xfd35('0x2b')]));_0x5f1679[_0xfd35('0x2a')]=_0x5f1679[_0xfd35('0x2a')][_0xfd35('0x2c')]?_0x5f1679[_0xfd35('0x2a')]:_0x2954a2['model'];if(!_0x3fb963[_0xfd35('0x26')][_0xfd35('0x2d')](_0xfd35('0x2e'))){_0x5f1679[_0xfd35('0xe')]=qs[_0xfd35('0xe')](_0x3fb963['query'][_0xfd35('0xe')]);_0x5f1679['offset']=qs[_0xfd35('0xd')](_0x3fb963[_0xfd35('0x26')][_0xfd35('0xd')]);}_0x5f1679[_0xfd35('0x2f')]=qs[_0xfd35('0x30')](_0x3fb963[_0xfd35('0x26')][_0xfd35('0x30')]);_0x5f1679[_0xfd35('0x31')]=qs[_0xfd35('0x28')](_[_0xfd35('0x32')](_0x3fb963[_0xfd35('0x26')],_0x2954a2[_0xfd35('0x28')]),_0x2b1eae);if(_0x3fb963[_0xfd35('0x26')][_0xfd35('0x18')]){_0x5f1679[_0xfd35('0x31')]=_['merge'](_0x5f1679[_0xfd35('0x31')],{'$or':_[_0xfd35('0x1a')](_0x2b1eae,function(_0x2884ea){if(_0x2884ea[_0xfd35('0x1d')]!==_0xfd35('0x33')){var _0x55947b={};_0x55947b[_0x2884ea[_0xfd35('0x1f')]]={'$like':'%'+_0x3fb963[_0xfd35('0x26')][_0xfd35('0x18')]+'%'};return _0x55947b;}})});}_0x5f1679=_[_0xfd35('0x34')]({},_0x5f1679,_0x3fb963[_0xfd35('0x35')]);var _0x196512={'where':_0x5f1679['where']};return db[_0xfd35('0x36')][_0xfd35('0xf')](_0x196512)[_0xfd35('0x12')](function(_0x2f2182){_0x333d68[_0xfd35('0xf')]=_0x2f2182;if(_0x3fb963[_0xfd35('0x26')][_0xfd35('0x37')]){_0x5f1679[_0xfd35('0x38')]=[{'all':!![]}];}return db[_0xfd35('0x36')][_0xfd35('0x39')](_0x5f1679);})[_0xfd35('0x12')](function(_0x5eff13){_0x333d68[_0xfd35('0x3a')]=_0x5eff13;return _0x333d68;})[_0xfd35('0x12')](respondWithFilteredResult(_0x55d1e5,_0x5f1679))[_0xfd35('0x3b')](handleError(_0x55d1e5,null));};exports[_0xfd35('0x3c')]=function(_0x4cfbdf,_0xf8f488){var _0x588d57={'raw':![],'where':{'id':_0x4cfbdf[_0xfd35('0x3d')]['id']}},_0x41245a={};_0x41245a[_0xfd35('0x25')]=_[_0xfd35('0x27')](db[_0xfd35('0x36')][_0xfd35('0x23')]);_0x41245a[_0xfd35('0x26')]=_['keys'](_0x4cfbdf[_0xfd35('0x26')]);_0x41245a['filters']=_[_0xfd35('0x29')](_0x41245a[_0xfd35('0x25')],_0x41245a[_0xfd35('0x26')]);_0x588d57['attributes']=_[_0xfd35('0x29')](_0x41245a[_0xfd35('0x25')],qs[_0xfd35('0x2b')](_0x4cfbdf[_0xfd35('0x26')][_0xfd35('0x2b')]));_0x588d57[_0xfd35('0x2a')]=_0x588d57[_0xfd35('0x2a')][_0xfd35('0x2c')]?_0x588d57[_0xfd35('0x2a')]:_0x41245a[_0xfd35('0x25')];if(_0x4cfbdf[_0xfd35('0x26')]['includeAll']){_0x588d57[_0xfd35('0x38')]=[{'all':!![]}];}_0x588d57=_['merge']({},_0x588d57,_0x4cfbdf[_0xfd35('0x35')]);return db['VoiceExtension'][_0xfd35('0x1e')](_0x588d57)[_0xfd35('0x12')](handleEntityNotFound(_0xf8f488,null))[_0xfd35('0x12')](respondWithResult(_0xf8f488,null))[_0xfd35('0x3b')](handleError(_0xf8f488,null));};exports[_0xfd35('0x11')]=function(_0x16afb9,_0x50660b){return db[_0xfd35('0x36')][_0xfd35('0x1e')]({'where':{'id':_0x16afb9[_0xfd35('0x3d')]['id']}})['then'](handleEntityNotFound(_0x50660b,null))[_0xfd35('0x12')](removeEntity(_0x50660b,null))[_0xfd35('0x3b')](handleError(_0x50660b,null));};exports[_0xfd35('0x3e')]=function(_0x4d3727,_0x35feab){if(_0x4d3727[_0xfd35('0x3f')][_0xfd35('0x1d')]===_0xfd35('0x15')&&!_[_0xfd35('0x40')](_0x4d3727[_0xfd35('0x3f')][_0xfd35('0x41')],'_')){_0x4d3727['body'][_0xfd35('0x41')]='_'[_0xfd35('0x42')](_0x4d3727[_0xfd35('0x3f')][_0xfd35('0x41')]);}return db[_0xfd35('0x36')]['create'](_0x4d3727[_0xfd35('0x3f')],{'raw':![]})[_0xfd35('0x12')](function(_0x4f2b27){var _0x3b4e9d=_0x4d3727[_0xfd35('0x43')]['get']({'plain':!![]});if(!_0x3b4e9d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3b4e9d[_0xfd35('0x44')]===_0xfd35('0x43')){var _0x421187=_0x4f2b27[_0xfd35('0x13')]({'plain':!![]});var _0xa933a1=[{'name':'InboundRoutes','value':_0xfd35('0x14')},{'name':_0xfd35('0x45'),'value':_0xfd35('0x15')},{'name':'InternalRoutes','value':_0xfd35('0x17')}];var _0x18c602=_[_0xfd35('0x1e')](_0xa933a1,['value',_0x421187[_0xfd35('0x1d')]])[_0xfd35('0x1f')];return db[_0xfd35('0x46')][_0xfd35('0x1e')]({'where':{'name':_0x18c602,'userProfileId':_0x3b4e9d[_0xfd35('0x47')]},'raw':!![]})[_0xfd35('0x12')](function(_0x2b5113){if(_0x2b5113&&_0x2b5113['autoAssociation']===0x0){return db[_0xfd35('0x20')][_0xfd35('0x3e')]({'name':_0x421187[_0xfd35('0x1f')],'resourceId':_0x421187['id'],'type':_0x2b5113[_0xfd35('0x1f')],'sectionId':_0x2b5113['id']},{})['then'](function(){return _0x4f2b27;});}else{return _0x4f2b27;}})[_0xfd35('0x3b')](function(_0x47b176){logger[_0xfd35('0x48')](_0xfd35('0x49'),_0x47b176);throw _0x47b176;});}return _0x4f2b27;})[_0xfd35('0x12')](respondWithResult(_0x35feab,0xc9))[_0xfd35('0x3b')](handleError(_0x35feab,null));};exports[_0xfd35('0x4a')]=function(_0x5f4282,_0x231e32){if(_0x5f4282[_0xfd35('0x3f')]['id']){delete _0x5f4282[_0xfd35('0x3f')]['id'];}return db[_0xfd35('0x36')][_0xfd35('0x1e')]({'where':{'id':_0x5f4282[_0xfd35('0x3d')]['id']}})[_0xfd35('0x12')](handleEntityNotFound(_0x231e32,null))['then'](function(_0x57821b){if(_0x57821b){return db['VoiceExtension'][_0xfd35('0x4a')](_[_0xfd35('0x32')](_0x5f4282['body'],[_0xfd35('0x41'),_0xfd35('0x4b'),'description',_0xfd35('0x4c'),_0xfd35('0x4d'),_0xfd35('0x4e'),_0xfd35('0x4f')]),{'where':{'context':_0x57821b['context'],'exten':_0x57821b[_0xfd35('0x41')]},'individualHooks':!![]})[_0xfd35('0x12')](function(_0x27142c){return _0x27142c;});}return null;})[_0xfd35('0x12')](respondWithStatusCode(_0x231e32,null))[_0xfd35('0x3b')](handleError(_0x231e32,null));};exports['addApplications']=function(_0x6d9918,_0x3d9e48){return db['VoiceExtension'][_0xfd35('0x50')]({'where':{'id':_0x6d9918['params']['id']}})[_0xfd35('0x12')](function(_0x3e3a5c){if(_0x3e3a5c){return db[_0xfd35('0x51')][_0xfd35('0x52')](function(_0x374b7a){return db[_0xfd35('0x36')]['destroy']({'where':{'VoiceExtensionId':_0x6d9918[_0xfd35('0x3d')]['id']},'transaction':_0x374b7a})[_0xfd35('0x12')](function(){var _0x2dd8a7=_[_0xfd35('0x1a')](_0x6d9918[_0xfd35('0x3f')],function(_0x87f24f){_0x87f24f[_0xfd35('0x53')]=_0x6d9918['params']['id'];_0x87f24f[_0xfd35('0x54')]=!![];return _0x87f24f;});return _0x3e3a5c['createRouting'](_0x2dd8a7);})[_0xfd35('0x12')](function(_0x443812){console[_0xfd35('0x55')](_0xfd35('0x56'),_0x443812);return db[_0xfd35('0x36')][_0xfd35('0x57')](_0x443812,{'transaction':_0x374b7a});});})[_0xfd35('0x12')](function(){return db[_0xfd35('0x36')][_0xfd35('0x58')]({'where':{'isApp':!![],'VoiceExtensionId':_0x6d9918['params']['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})['then'](respondWithResult(_0x3d9e48,null))[_0xfd35('0x3b')](handleError(_0x3d9e48,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 9fe57ea..f0955e6 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 _0xd97a=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners','update'];(function(_0x3a0a70,_0x586139){var _0x3501b8=function(_0x32a123){while(--_0x32a123){_0x3a0a70['push'](_0x3a0a70['shift']());}};_0x3501b8(++_0x586139);}(_0xd97a,0x7d));var _0xad97=function(_0x45d4ae,_0x4d96dc){_0x45d4ae=_0x45d4ae-0x0;var _0x3fabfb=_0xd97a[_0x45d4ae];return _0x3fabfb;};'use strict';var EventEmitter=require(_0xad97('0x0'));var VoiceExtension=require(_0xad97('0x1'))['db'][_0xad97('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xad97('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xad97('0x4'),'afterDestroy':_0xad97('0x5')};function emitEvent(_0x149b04){return function(_0x4800f6,_0x5d078c,_0x22a5f7){VoiceExtensionEvents[_0xad97('0x6')](_0x149b04+':'+_0x4800f6['id'],_0x4800f6);VoiceExtensionEvents[_0xad97('0x6')](_0x149b04,_0x4800f6);_0x22a5f7(null);};}for(var e in events){if(events[_0xad97('0x7')](e)){var event=events[e];VoiceExtension[_0xad97('0x8')](e,emitEvent(event));}}module[_0xad97('0x9')]=VoiceExtensionEvents; \ No newline at end of file +var _0xc255=['exports','events','../../mysqldb','VoiceExtension','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x2222fb,_0x40c407){var _0x27cf1a=function(_0x29b6f6){while(--_0x29b6f6){_0x2222fb['push'](_0x2222fb['shift']());}};_0x27cf1a(++_0x40c407);}(_0xc255,0x1e1));var _0x5c25=function(_0x470bfb,_0x389787){_0x470bfb=_0x470bfb-0x0;var _0x2f5d97=_0xc255[_0x470bfb];return _0x2f5d97;};'use strict';var EventEmitter=require(_0x5c25('0x0'));var VoiceExtension=require(_0x5c25('0x1'))['db'][_0x5c25('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x5c25('0x3')](0x0);var events={'afterCreate':_0x5c25('0x4'),'afterUpdate':'update','afterDestroy':_0x5c25('0x5')};function emitEvent(_0x2786f1){return function(_0x58f9ce,_0x3bd6b9,_0x30e186){VoiceExtensionEvents['emit'](_0x2786f1+':'+_0x58f9ce['id'],_0x58f9ce);VoiceExtensionEvents[_0x5c25('0x6')](_0x2786f1,_0x58f9ce);_0x30e186(null);};}for(var e in events){if(events[_0x5c25('0x7')](e)){var event=events[e];VoiceExtension[_0x5c25('0x8')](e,emitEvent(event));}}module[_0x5c25('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 895c9e5..cd214da 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 _0x21ec=['CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','trunk','timeout','url','split','length','name','param','phone','prefix','SIP','join','options','none','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','filter','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','queue','playback','includes','app','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appdata','priority','last','catch','define','voice_extensions','get','concat','Hangup','exports','Set','type','context','NoOp','alias','CDR(routeAlias)=','No\x20alias\x20set','exten','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound'];(function(_0x1c7d88,_0x13ebd8){var _0x1974c0=function(_0x1321c0){while(--_0x1321c0){_0x1c7d88['push'](_0x1c7d88['shift']());}};_0x1974c0(++_0x13ebd8);}(_0x21ec,0xf1));var _0xc21e=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x21ec[_0x138adb];return _0x1b27f2;};'use strict';var _=require('lodash');var attributes=require('./voiceExtension.attributes');module[_0xc21e('0x0')]=function(_0x1fc5e1){var _0x5d80b5=_0x1fc5e1['models'];function _0xd07969(_0x3ab156){var _0x4da759=0x2;var _0x2496b2=[{'type':_0x3ab156['type'],'app':_0xc21e('0x1'),'appdata':'CDR(type)='+_0x3ab156[_0xc21e('0x2')],'context':_0x3ab156[_0xc21e('0x3')],'exten':_0x3ab156['exten'],'priority':_0x4da759++,'VoiceExtensionId':_0x3ab156['id']},{'type':_0x3ab156['type'],'app':_0x3ab156['alias']?'Set':_0xc21e('0x4'),'appdata':_0x3ab156[_0xc21e('0x5')]?_0xc21e('0x6')+_0x3ab156['alias']:_0xc21e('0x7'),'context':_0x3ab156[_0xc21e('0x3')],'exten':_0x3ab156[_0xc21e('0x8')],'priority':_0x4da759++,'VoiceExtensionId':_0x3ab156['id']}];if(_0x3ab156[_0xc21e('0x2')]===_0xc21e('0x9')){_0x2496b2[_0xc21e('0xa')]({'type':_0xc21e('0x9'),'app':'Set','appdata':_0xc21e('0xb')+_0x3ab156['id'],'context':_0x3ab156[_0xc21e('0x3')],'exten':_0x3ab156[_0xc21e('0x8')],'priority':_0x4da759++,'VoiceExtensionId':_0x3ab156['id']});}_0x2496b2['push']({'type':_0x3ab156[_0xc21e('0x2')],'app':'Set','appdata':_0xc21e('0xc'),'context':_0x3ab156[_0xc21e('0x3')],'exten':_0x3ab156[_0xc21e('0x8')],'priority':_0x4da759++,'VoiceExtensionId':_0x3ab156['id']},{'type':_0x3ab156[_0xc21e('0x2')],'app':'Set','appdata':_0xc21e('0xd'),'context':_0x3ab156[_0xc21e('0x3')],'exten':_0x3ab156[_0xc21e('0x8')],'priority':_0x4da759++,'VoiceExtensionId':_0x3ab156['id']},{'type':_0x3ab156[_0xc21e('0x2')],'app':_0xc21e('0x1'),'appdata':_0xc21e('0xe'),'context':_0x3ab156['context'],'exten':_0x3ab156[_0xc21e('0x8')],'priority':_0x4da759++,'VoiceExtensionId':_0x3ab156['id']});return _0x2496b2;}function _0x56de56(_0x433eee){var _0x26688e=0x2;var _0x333462=[{'type':_0xc21e('0xf'),'app':_0xc21e('0x1'),'appdata':_0xc21e('0x10'),'context':_0x433eee[_0xc21e('0x3')],'exten':_0x433eee[_0xc21e('0x8')],'priority':_0x26688e++,'VoiceExtensionId':_0x433eee['id']},{'type':_0xc21e('0xf'),'app':_0x433eee[_0xc21e('0x5')]?_0xc21e('0x1'):_0xc21e('0x4'),'appdata':_0x433eee['alias']?_0xc21e('0x6')+_0x433eee['alias']:_0xc21e('0x7'),'context':_0x433eee[_0xc21e('0x3')],'exten':_0x433eee[_0xc21e('0x8')],'priority':_0x26688e++,'VoiceExtensionId':_0x433eee['id']},{'type':'outbound','app':_0xc21e('0x1'),'appdata':_0xc21e('0x11')+(_0x433eee[_0xc21e('0x12')]?_0xc21e('0x13')+_0x433eee[_0xc21e('0x12')]+'}':_0xc21e('0x14')),'context':_0x433eee[_0xc21e('0x3')],'exten':_0x433eee['exten'],'priority':_0x26688e++,'VoiceExtensionId':_0x433eee['id']},{'type':_0xc21e('0xf'),'app':_0xc21e('0x1'),'appdata':_0xc21e('0xb')+_0x433eee['id'],'context':_0x433eee[_0xc21e('0x3')],'exten':_0x433eee[_0xc21e('0x8')],'priority':_0x26688e++,'VoiceExtensionId':_0x433eee['id']},{'type':_0xc21e('0xf'),'app':_0xc21e('0x15'),'appdata':_0xc21e('0x16')+(_0x26688e+0x2)+_0xc21e('0x17')+(_0x26688e+0x1)+')','context':_0x433eee[_0xc21e('0x3')],'exten':_0x433eee[_0xc21e('0x8')],'priority':_0x26688e++,'VoiceExtensionId':_0x433eee['id']},{'type':_0xc21e('0xf'),'app':'Set','appdata':_0x433eee[_0xc21e('0x12')]?_0xc21e('0x18')+_0x433eee[_0xc21e('0x12')]+'}':_0xc21e('0x19'),'context':_0x433eee[_0xc21e('0x3')],'exten':_0x433eee[_0xc21e('0x8')],'priority':_0x26688e++,'VoiceExtensionId':_0x433eee['id']},{'type':_0xc21e('0xf'),'app':'Set','appdata':_0xc21e('0xc'),'context':_0x433eee[_0xc21e('0x3')],'exten':_0x433eee['exten'],'priority':_0x26688e++,'VoiceExtensionId':_0x433eee['id']},{'type':_0xc21e('0xf'),'app':_0xc21e('0x1'),'appdata':_0xc21e('0xd'),'context':_0x433eee[_0xc21e('0x3')],'exten':_0x433eee[_0xc21e('0x8')],'priority':_0x26688e++,'VoiceExtensionId':_0x433eee['id']},{'type':_0xc21e('0xf'),'app':_0xc21e('0x1'),'appdata':_0xc21e('0xe'),'context':_0x433eee[_0xc21e('0x3')],'exten':_0x433eee[_0xc21e('0x8')],'priority':_0x26688e++,'VoiceExtensionId':_0x433eee['id']},{'type':_0xc21e('0xf'),'app':_0xc21e('0x1'),'appdata':_0xc21e('0x1a')+_0x433eee['id'],'context':_0x433eee['context'],'exten':_0x433eee[_0xc21e('0x8')],'priority':_0x26688e++,'VoiceExtensionId':_0x433eee['id']}];if(_0x433eee[_0xc21e('0x1b')](_0xc21e('0x1c'))&&_0x433eee[_0xc21e('0x1c')]!=='none'){_0x333462[_0xc21e('0xa')]({'type':_0xc21e('0xf'),'app':_0xc21e('0x1'),'appdata':_0xc21e('0x1d'),'context':_0x433eee[_0xc21e('0x3')],'exten':_0x433eee['exten'],'priority':_0x26688e++,'VoiceExtensionId':_0x433eee['id']},{'type':'outbound','app':'Set','appdata':_0xc21e('0x1e')+_0x433eee['recordingFormat']||'wav','context':_0x433eee[_0xc21e('0x3')],'exten':_0x433eee[_0xc21e('0x8')],'priority':_0x26688e++,'VoiceExtensionId':_0x433eee['id']});}return _0x333462;}function _0x1022c2(_0x3d6554,_0x1911f4){var _0x430a8b=[{'name':_0xc21e('0x1f'),'param':0x0},{'name':_0xc21e('0x20'),'param':0x1},{'name':'options','param':0x2},{'name':_0xc21e('0x21'),'param':0x3}];var _0x43af2a={};var _0x55688f=_0x1911f4[_0xc21e('0x22')](',');var _0x593d08=[];for(var _0x4e7b96=0x0;_0x4e7b96<_0x430a8b[_0xc21e('0x23')];_0x4e7b96++){switch(_0x430a8b[_0x4e7b96][_0xc21e('0x24')]){case _0xc21e('0x1f'):_0x43af2a[_0xc21e('0x1f')]=_0x55688f[_0x430a8b[_0x4e7b96][_0xc21e('0x25')]][_0xc21e('0x22')]('/')[0x1];_0x43af2a[_0xc21e('0x26')]=_0x55688f[_0x430a8b[_0x4e7b96]['param']][_0xc21e('0x22')]('/')[0x2];_0x43af2a[_0xc21e('0x27')]=_0x43af2a[_0xc21e('0x26')]?_0x43af2a['phone'][_0xc21e('0x22')]('$')[0x0]:undefined;_0x43af2a[_0xc21e('0x26')]=_0x3d6554[_0xc21e('0x12')]?(_0x43af2a[_0xc21e('0x27')]||'')+_0xc21e('0x13')+_0x3d6554['cutdigits']+'}':(_0x43af2a[_0xc21e('0x27')]||'')+_0xc21e('0x14');_0x593d08[_0x430a8b[_0x4e7b96][_0xc21e('0x25')]]=[_0xc21e('0x28'),_0x43af2a[_0xc21e('0x1f')],_0x43af2a[_0xc21e('0x26')]][_0xc21e('0x29')]('/');break;case'options':_0x43af2a[_0xc21e('0x2a')]=_0x55688f[_0x430a8b[_0x4e7b96][_0xc21e('0x25')]];if(_0x3d6554['recordingFormat']!==_0xc21e('0x2b')){if(_0x43af2a['options'][_0xc21e('0x2c')](_0xc21e('0x2d'))<0x0){_0x43af2a[_0xc21e('0x2a')]+=_0xc21e('0x2d');}}else{_0x43af2a[_0xc21e('0x2a')]=_0x43af2a[_0xc21e('0x2a')][_0xc21e('0x2e')](_0xc21e('0x2d'),'');}_0x593d08[_0x430a8b[_0x4e7b96][_0xc21e('0x25')]]=_0x43af2a[_0xc21e('0x2a')];break;default:_0x593d08[_0x430a8b[_0x4e7b96]['param']]=_0x55688f[_0x430a8b[_0x4e7b96][_0xc21e('0x25')]];}}return _0x593d08[_0xc21e('0x29')](',');}function _0x45cfc1(_0x842794,_0x1f54e4,_0x136987){return new Promise(function(_0xf92609,_0x157ebb){var _0xd53d31=[];if(_[_0xc21e('0x2f')](_0x1f54e4))return _0xf92609(_0xd53d31);_0x5d80b5['Interval'][_0xc21e('0x30')]({'attributes':['id',_0xc21e('0x31'),_0xc21e('0x32')],'raw':!![]})[_0xc21e('0x33')](function(_0x12ff98){for(var _0x20dc27=0x0,_0x97bae=0x0;_0x20dc27<_0x1f54e4['length'];_0x20dc27++,_0x97bae=0x0){var _0x4bc190=_0x1f54e4[_0x20dc27];var _0x31187f=[];var _0x2a2146=[];delete _0x4bc190['id'];if(_0x4bc190[_0xc21e('0x31')]!==_0xc21e('0x34')){_0x4bc190[_0xc21e('0x35')]=[_0x4bc190[_0xc21e('0x31')]];}else{_0x4bc190['intervals']=_0x4bc190['IntervalId']?_[_0xc21e('0x36')](_[_0xc21e('0x37')](_0x12ff98,{'IntervalId':_0x4bc190[_0xc21e('0x32')]}),_0xc21e('0x31')):[];}_0x4bc190['context']=_0x842794[_0xc21e('0x3')];_0x4bc190[_0xc21e('0x8')]=_0x842794['exten'];if(_0x4bc190['type'])_0x4bc190['type']=_0x4bc190['type'][_0xc21e('0x38')]();if(_0x842794[_0xc21e('0x2')]===_0xc21e('0xf')){if(_0x4bc190['hasOwnProperty'](_0xc21e('0x39'))&&_0x4bc190[_0xc21e('0x39')]&&_0x4bc190[_0xc21e('0x39')]!=='--'){_0x31187f['push']({'type':_0x4bc190[_0xc21e('0x2')][_0xc21e('0x38')](),'app':'Set','appdata':_0xc21e('0x3a')+_0x4bc190[_0xc21e('0x39')],'context':_0x842794[_0xc21e('0x3')],'exten':_0x842794[_0xc21e('0x8')],'priority':_0x4bc190[_0xc21e('0x35')][_0xc21e('0x23')]+_0x136987+_0x97bae++,'VoiceExtensionId':_0x842794['id']});}_0x31187f[_0xc21e('0xa')]({'type':_0x4bc190[_0xc21e('0x2')][_0xc21e('0x38')](),'app':_0xc21e('0x15'),'appdata':_0xc21e('0x3b')+(_0x4bc190[_0xc21e('0x3c')]?_0xc21e('0x3d')+_0x4bc190['callerID']+')':_0xc21e('0x3e')),'context':_0x842794['context'],'exten':_0x842794[_0xc21e('0x8')],'priority':_0x4bc190[_0xc21e('0x35')][_0xc21e('0x23')]+_0x136987+_0x97bae++,'VoiceExtensionId':_0x842794['id']});}else{if(_0x4bc190['hasOwnProperty']('answer')){if([_0xc21e('0x3f'),_0xc21e('0x40')][_0xc21e('0x41')](_0x4bc190[_0xc21e('0x42')][_0xc21e('0x38')]())&&_0x4bc190[_0xc21e('0x43')]!==_0xc21e('0x44')){if(_0x4bc190[_0xc21e('0x45')]){_0x31187f[_0xc21e('0xa')]({'type':_0x4bc190['type'][_0xc21e('0x38')](),'app':_0xc21e('0x15'),'appdata':_0xc21e('0x46'),'context':_0x842794[_0xc21e('0x3')],'exten':_0x842794['exten'],'priority':_0x4bc190['intervals'][_0xc21e('0x23')]+_0x136987+_0x97bae++,'VoiceExtensionId':_0x842794['id']});_0x31187f[_0xc21e('0xa')]({'type':_0x4bc190['type']['toLowerCase'](),'app':_0xc21e('0x1'),'appdata':_0xc21e('0x47'),'context':_0x842794['context'],'exten':_0x842794[_0xc21e('0x8')],'priority':_0x4bc190['intervals'][_0xc21e('0x23')]+_0x136987+_0x97bae++,'VoiceExtensionId':_0x842794['id']});}else{_0x31187f[_0xc21e('0xa')]({'type':_0x4bc190[_0xc21e('0x2')]['toLowerCase'](),'app':_0xc21e('0x15'),'appdata':_0xc21e('0x48'),'context':_0x842794[_0xc21e('0x3')],'exten':_0x842794[_0xc21e('0x8')],'priority':_0x4bc190[_0xc21e('0x35')][_0xc21e('0x23')]+_0x136987+_0x97bae++,'VoiceExtensionId':_0x842794['id']});_0x31187f[_0xc21e('0xa')]({'type':_0x4bc190['type'][_0xc21e('0x38')](),'app':'Set','appdata':_0xc21e('0x49'),'context':_0x842794[_0xc21e('0x3')],'exten':_0x842794['exten'],'priority':_0x4bc190['intervals']['length']+_0x136987+_0x97bae++,'VoiceExtensionId':_0x842794['id']});}}}}for(var _0x1d8481=0x0;_0x1d8481<_0x4bc190[_0xc21e('0x35')][_0xc21e('0x23')];_0x1d8481++){var _0x4917ea=_0x136987+_0x4bc190['intervals'][_0xc21e('0x23')];var _0x113c1e=_0x1d8481===_0x4bc190['intervals']['length']-0x1?_0x136987+_0x31187f[_0xc21e('0x23')]+_0x2a2146[_0xc21e('0x23')]+0x2:_0x136987+_0x1d8481+0x1;_0x31187f[_0xc21e('0x4a')](_0x1d8481,0x0,{'type':_0x842794['type'],'app':_0xc21e('0x4b'),'appdata':_0x4bc190[_0xc21e('0x35')][_0x1d8481]+'?'+_0x842794[_0xc21e('0x3')]+',${EXTEN},'+_0x4917ea+':'+_0x842794[_0xc21e('0x3')]+_0xc21e('0x4c')+_0x113c1e,'exten':_0x842794[_0xc21e('0x8')],'context':_0x842794[_0xc21e('0x3')],'priority':_0x136987+_0x1d8481,'VoiceExtensionId':_0x842794['id']});}if(_0x4bc190[_0xc21e('0x43')]==='outboundDial')_0x4bc190[_0xc21e('0x4d')]=_0x1022c2(_0x842794,_0x4bc190[_0xc21e('0x4d')]);_0x4bc190[_0xc21e('0x4e')]=_0x31187f['length']?_[_0xc21e('0x4f')](_0x31187f)['priority']+0x1:_0x136987;_0xd53d31=_['concat'](_0xd53d31,_0x31187f,[_0x4bc190],_0x2a2146);_0x136987=_['last'](_0xd53d31)['priority']+0x1;}return _0xf92609(_0xd53d31);})[_0xc21e('0x50')](function(_0x216650){_0x157ebb(_0x216650);});});}return _0x1fc5e1[_0xc21e('0x51')]('VoiceExtension',attributes,{'tableName':_0xc21e('0x52'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0xdaafb2){var _0x2a80ae=this[_0xc21e('0x53')]({'plain':!![]});var _0x3a0dff=_0x2a80ae[_0xc21e('0x2')]===_0xc21e('0xf')?_0x56de56(_0x2a80ae):_0xd07969(_0x2a80ae);return _0x45cfc1(_0x2a80ae,_0xdaafb2,_['last'](_0x3a0dff)[_0xc21e('0x4e')]+0x1)['then'](function(_0x35ebfe){var _0x38f44d=_[_0xc21e('0x54')](_0x3a0dff,_0x35ebfe);_0x38f44d[_0xc21e('0xa')]({'type':_0x2a80ae[_0xc21e('0x2')],'app':_0xc21e('0x55'),'exten':_0x2a80ae[_0xc21e('0x8')],'context':_0x2a80ae[_0xc21e('0x3')],'priority':_[_0xc21e('0x4f')](_0x38f44d)[_0xc21e('0x4e')]+0x1,'VoiceExtensionId':_0x2a80ae['id']});return _0x38f44d;});}}});}; \ No newline at end of file +var _0x0f17=['outbound','CDR(type)=outbound','CDR(routeAlias)=','cutdigits','${EXTEN:','${EXTEN}','):Goto(','CDR(prefix)=noprefix','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','options','url','split','length','param','prefix','phone','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','interval','*,*,*,*','intervals','IntervalId','map','toLowerCase','tag','CDR(tag)=','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','queue','playback','includes','appType','custom','answer','XCALLY-MOTION-ANSWER=1','ExecIf','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','catch','define','VoiceExtension','then','concat','Hangup','lodash','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','exten','alias','NoOp','No\x20alias\x20set','inbound','CDR(routeid)=','push','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0f17,0x8b));var _0x70f1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0f17[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x70f1('0x0'));var attributes=require(_0x70f1('0x1'));module[_0x70f1('0x2')]=function(_0x584254){var _0x331ae3=_0x584254[_0x70f1('0x3')];function _0x1aa52f(_0x390087){var _0x428227=0x2;var _0x4679e7=[{'type':_0x390087[_0x70f1('0x4')],'app':_0x70f1('0x5'),'appdata':_0x70f1('0x6')+_0x390087[_0x70f1('0x4')],'context':_0x390087[_0x70f1('0x7')],'exten':_0x390087[_0x70f1('0x8')],'priority':_0x428227++,'VoiceExtensionId':_0x390087['id']},{'type':_0x390087['type'],'app':_0x390087[_0x70f1('0x9')]?'Set':_0x70f1('0xa'),'appdata':_0x390087[_0x70f1('0x9')]?'CDR(routeAlias)='+_0x390087[_0x70f1('0x9')]:_0x70f1('0xb'),'context':_0x390087[_0x70f1('0x7')],'exten':_0x390087['exten'],'priority':_0x428227++,'VoiceExtensionId':_0x390087['id']}];if(_0x390087[_0x70f1('0x4')]===_0x70f1('0xc')){_0x4679e7['push']({'type':_0x70f1('0xc'),'app':_0x70f1('0x5'),'appdata':_0x70f1('0xd')+_0x390087['id'],'context':_0x390087[_0x70f1('0x7')],'exten':_0x390087[_0x70f1('0x8')],'priority':_0x428227++,'VoiceExtensionId':_0x390087['id']});}_0x4679e7[_0x70f1('0xe')]({'type':_0x390087[_0x70f1('0x4')],'app':_0x70f1('0x5'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x390087[_0x70f1('0x7')],'exten':_0x390087['exten'],'priority':_0x428227++,'VoiceExtensionId':_0x390087['id']},{'type':_0x390087[_0x70f1('0x4')],'app':'Set','appdata':_0x70f1('0xf'),'context':_0x390087[_0x70f1('0x7')],'exten':_0x390087[_0x70f1('0x8')],'priority':_0x428227++,'VoiceExtensionId':_0x390087['id']},{'type':_0x390087[_0x70f1('0x4')],'app':_0x70f1('0x5'),'appdata':_0x70f1('0x10'),'context':_0x390087[_0x70f1('0x7')],'exten':_0x390087['exten'],'priority':_0x428227++,'VoiceExtensionId':_0x390087['id']});return _0x4679e7;}function _0xfb67f1(_0x4f6952){var _0x947fce=0x2;var _0x2bed93=[{'type':_0x70f1('0x11'),'app':_0x70f1('0x5'),'appdata':_0x70f1('0x12'),'context':_0x4f6952['context'],'exten':_0x4f6952[_0x70f1('0x8')],'priority':_0x947fce++,'VoiceExtensionId':_0x4f6952['id']},{'type':_0x70f1('0x11'),'app':_0x4f6952[_0x70f1('0x9')]?'Set':_0x70f1('0xa'),'appdata':_0x4f6952[_0x70f1('0x9')]?_0x70f1('0x13')+_0x4f6952[_0x70f1('0x9')]:'No\x20alias\x20set','context':_0x4f6952[_0x70f1('0x7')],'exten':_0x4f6952['exten'],'priority':_0x947fce++,'VoiceExtensionId':_0x4f6952['id']},{'type':_0x70f1('0x11'),'app':'Set','appdata':'CDR(destination)='+(_0x4f6952[_0x70f1('0x14')]?_0x70f1('0x15')+_0x4f6952[_0x70f1('0x14')]+'}':_0x70f1('0x16')),'context':_0x4f6952[_0x70f1('0x7')],'exten':_0x4f6952['exten'],'priority':_0x947fce++,'VoiceExtensionId':_0x4f6952['id']},{'type':_0x70f1('0x11'),'app':_0x70f1('0x5'),'appdata':_0x70f1('0xd')+_0x4f6952['id'],'context':_0x4f6952['context'],'exten':_0x4f6952[_0x70f1('0x8')],'priority':_0x947fce++,'VoiceExtensionId':_0x4f6952['id']},{'type':'outbound','app':'ExecIf','appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x947fce+0x2)+_0x70f1('0x17')+(_0x947fce+0x1)+')','context':_0x4f6952[_0x70f1('0x7')],'exten':_0x4f6952[_0x70f1('0x8')],'priority':_0x947fce++,'VoiceExtensionId':_0x4f6952['id']},{'type':_0x70f1('0x11'),'app':_0x70f1('0x5'),'appdata':_0x4f6952[_0x70f1('0x14')]?'CDR(prefix)=${EXTEN:0:'+_0x4f6952['cutdigits']+'}':_0x70f1('0x18'),'context':_0x4f6952[_0x70f1('0x7')],'exten':_0x4f6952[_0x70f1('0x8')],'priority':_0x947fce++,'VoiceExtensionId':_0x4f6952['id']},{'type':_0x70f1('0x11'),'app':_0x70f1('0x5'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x4f6952[_0x70f1('0x7')],'exten':_0x4f6952[_0x70f1('0x8')],'priority':_0x947fce++,'VoiceExtensionId':_0x4f6952['id']},{'type':_0x70f1('0x11'),'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x4f6952[_0x70f1('0x7')],'exten':_0x4f6952['exten'],'priority':_0x947fce++,'VoiceExtensionId':_0x4f6952['id']},{'type':_0x70f1('0x11'),'app':_0x70f1('0x5'),'appdata':'MONITOR_OPTIONS=ab','context':_0x4f6952[_0x70f1('0x7')],'exten':_0x4f6952[_0x70f1('0x8')],'priority':_0x947fce++,'VoiceExtensionId':_0x4f6952['id']},{'type':'outbound','app':_0x70f1('0x5'),'appdata':'outboundrouteid='+_0x4f6952['id'],'context':_0x4f6952[_0x70f1('0x7')],'exten':_0x4f6952[_0x70f1('0x8')],'priority':_0x947fce++,'VoiceExtensionId':_0x4f6952['id']}];if(_0x4f6952[_0x70f1('0x19')]('recordingFormat')&&_0x4f6952[_0x70f1('0x1a')]!==_0x70f1('0x1b')){_0x2bed93[_0x70f1('0xe')]({'type':_0x70f1('0x11'),'app':_0x70f1('0x5'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x4f6952[_0x70f1('0x7')],'exten':_0x4f6952[_0x70f1('0x8')],'priority':_0x947fce++,'VoiceExtensionId':_0x4f6952['id']},{'type':'outbound','app':'Set','appdata':_0x70f1('0x1c')+_0x4f6952[_0x70f1('0x1a')]||_0x70f1('0x1d'),'context':_0x4f6952[_0x70f1('0x7')],'exten':_0x4f6952[_0x70f1('0x8')],'priority':_0x947fce++,'VoiceExtensionId':_0x4f6952['id']});}return _0x2bed93;}function _0xb8a75b(_0x18c5b3,_0x4fc542){var _0x37ba81=[{'name':_0x70f1('0x1e'),'param':0x0},{'name':'timeout','param':0x1},{'name':_0x70f1('0x1f'),'param':0x2},{'name':_0x70f1('0x20'),'param':0x3}];var _0x13370c={};var _0x3376e8=_0x4fc542[_0x70f1('0x21')](',');var _0x2684d2=[];for(var _0x2e8d78=0x0;_0x2e8d78<_0x37ba81[_0x70f1('0x22')];_0x2e8d78++){switch(_0x37ba81[_0x2e8d78]['name']){case'trunk':_0x13370c[_0x70f1('0x1e')]=_0x3376e8[_0x37ba81[_0x2e8d78][_0x70f1('0x23')]][_0x70f1('0x21')]('/')[0x1];_0x13370c['phone']=_0x3376e8[_0x37ba81[_0x2e8d78]['param']][_0x70f1('0x21')]('/')[0x2];_0x13370c[_0x70f1('0x24')]=_0x13370c[_0x70f1('0x25')]?_0x13370c[_0x70f1('0x25')][_0x70f1('0x21')]('$')[0x0]:undefined;_0x13370c[_0x70f1('0x25')]=_0x18c5b3[_0x70f1('0x14')]?(_0x13370c['prefix']||'')+_0x70f1('0x15')+_0x18c5b3['cutdigits']+'}':(_0x13370c['prefix']||'')+_0x70f1('0x16');_0x2684d2[_0x37ba81[_0x2e8d78]['param']]=['SIP',_0x13370c[_0x70f1('0x1e')],_0x13370c['phone']][_0x70f1('0x26')]('/');break;case _0x70f1('0x1f'):_0x13370c[_0x70f1('0x1f')]=_0x3376e8[_0x37ba81[_0x2e8d78][_0x70f1('0x23')]];if(_0x18c5b3[_0x70f1('0x1a')]!==_0x70f1('0x1b')){if(_0x13370c[_0x70f1('0x1f')][_0x70f1('0x27')](_0x70f1('0x28'))<0x0){_0x13370c[_0x70f1('0x1f')]+='U(xcally-mixmonitor-context)';}}else{_0x13370c[_0x70f1('0x1f')]=_0x13370c[_0x70f1('0x1f')][_0x70f1('0x29')]('U(xcally-mixmonitor-context)','');}_0x2684d2[_0x37ba81[_0x2e8d78][_0x70f1('0x23')]]=_0x13370c[_0x70f1('0x1f')];break;default:_0x2684d2[_0x37ba81[_0x2e8d78]['param']]=_0x3376e8[_0x37ba81[_0x2e8d78][_0x70f1('0x23')]];}}return _0x2684d2[_0x70f1('0x26')](',');}function _0x519425(_0x28f0bf,_0x3af2cf,_0x2aa207){return new Promise(function(_0x447b98,_0x27b82a){var _0x82262a=[];if(_[_0x70f1('0x2a')](_0x3af2cf))return _0x447b98(_0x82262a);_0x331ae3[_0x70f1('0x2b')]['findAll']({'attributes':['id',_0x70f1('0x2c'),'IntervalId'],'raw':!![]})['then'](function(_0x46098d){for(var _0x5627c1=0x0,_0x231d53=0x0;_0x5627c1<_0x3af2cf[_0x70f1('0x22')];_0x5627c1++,_0x231d53=0x0){var _0x1cbf80=_0x3af2cf[_0x5627c1];var _0x465746=[];var _0x5537d8=[];delete _0x1cbf80['id'];if(_0x1cbf80[_0x70f1('0x2c')]!==_0x70f1('0x2d')){_0x1cbf80[_0x70f1('0x2e')]=[_0x1cbf80['interval']];}else{_0x1cbf80['intervals']=_0x1cbf80[_0x70f1('0x2f')]?_[_0x70f1('0x30')](_['filter'](_0x46098d,{'IntervalId':_0x1cbf80[_0x70f1('0x2f')]}),'interval'):[];}_0x1cbf80[_0x70f1('0x7')]=_0x28f0bf['context'];_0x1cbf80[_0x70f1('0x8')]=_0x28f0bf[_0x70f1('0x8')];if(_0x1cbf80['type'])_0x1cbf80[_0x70f1('0x4')]=_0x1cbf80[_0x70f1('0x4')][_0x70f1('0x31')]();if(_0x28f0bf[_0x70f1('0x4')]===_0x70f1('0x11')){if(_0x1cbf80[_0x70f1('0x19')](_0x70f1('0x32'))&&_0x1cbf80['tag']&&_0x1cbf80[_0x70f1('0x32')]!=='--'){_0x465746[_0x70f1('0xe')]({'type':_0x1cbf80[_0x70f1('0x4')][_0x70f1('0x31')](),'app':'Set','appdata':_0x70f1('0x33')+_0x1cbf80[_0x70f1('0x32')],'context':_0x28f0bf[_0x70f1('0x7')],'exten':_0x28f0bf[_0x70f1('0x8')],'priority':_0x1cbf80[_0x70f1('0x2e')][_0x70f1('0x22')]+_0x2aa207+_0x231d53++,'VoiceExtensionId':_0x28f0bf['id']});}_0x465746[_0x70f1('0xe')]({'type':_0x1cbf80['type']['toLowerCase'](),'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x1cbf80[_0x70f1('0x34')]?_0x70f1('0x35')+_0x1cbf80[_0x70f1('0x34')]+')':_0x70f1('0x36')),'context':_0x28f0bf[_0x70f1('0x7')],'exten':_0x28f0bf[_0x70f1('0x8')],'priority':_0x1cbf80[_0x70f1('0x2e')][_0x70f1('0x22')]+_0x2aa207+_0x231d53++,'VoiceExtensionId':_0x28f0bf['id']});}else{if(_0x1cbf80['hasOwnProperty']('answer')){if([_0x70f1('0x37'),_0x70f1('0x38')][_0x70f1('0x39')](_0x1cbf80['app'][_0x70f1('0x31')]())&&_0x1cbf80[_0x70f1('0x3a')]!==_0x70f1('0x3b')){if(_0x1cbf80[_0x70f1('0x3c')]){_0x465746[_0x70f1('0xe')]({'type':_0x1cbf80[_0x70f1('0x4')][_0x70f1('0x31')](),'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x28f0bf[_0x70f1('0x7')],'exten':_0x28f0bf[_0x70f1('0x8')],'priority':_0x1cbf80[_0x70f1('0x2e')][_0x70f1('0x22')]+_0x2aa207+_0x231d53++,'VoiceExtensionId':_0x28f0bf['id']});_0x465746[_0x70f1('0xe')]({'type':_0x1cbf80[_0x70f1('0x4')]['toLowerCase'](),'app':'Set','appdata':_0x70f1('0x3d'),'context':_0x28f0bf[_0x70f1('0x7')],'exten':_0x28f0bf[_0x70f1('0x8')],'priority':_0x1cbf80['intervals'][_0x70f1('0x22')]+_0x2aa207+_0x231d53++,'VoiceExtensionId':_0x28f0bf['id']});}else{_0x465746[_0x70f1('0xe')]({'type':_0x1cbf80['type'][_0x70f1('0x31')](),'app':_0x70f1('0x3e'),'appdata':_0x70f1('0x3f'),'context':_0x28f0bf[_0x70f1('0x7')],'exten':_0x28f0bf[_0x70f1('0x8')],'priority':_0x1cbf80['intervals'][_0x70f1('0x22')]+_0x2aa207+_0x231d53++,'VoiceExtensionId':_0x28f0bf['id']});_0x465746['push']({'type':_0x1cbf80['type'][_0x70f1('0x31')](),'app':_0x70f1('0x5'),'appdata':_0x70f1('0x40'),'context':_0x28f0bf['context'],'exten':_0x28f0bf[_0x70f1('0x8')],'priority':_0x1cbf80[_0x70f1('0x2e')][_0x70f1('0x22')]+_0x2aa207+_0x231d53++,'VoiceExtensionId':_0x28f0bf['id']});}}}}for(var _0x409420=0x0;_0x409420<_0x1cbf80[_0x70f1('0x2e')][_0x70f1('0x22')];_0x409420++){var _0x463e76=_0x2aa207+_0x1cbf80[_0x70f1('0x2e')][_0x70f1('0x22')];var _0x1cd39e=_0x409420===_0x1cbf80[_0x70f1('0x2e')][_0x70f1('0x22')]-0x1?_0x2aa207+_0x465746[_0x70f1('0x22')]+_0x5537d8[_0x70f1('0x22')]+0x2:_0x2aa207+_0x409420+0x1;_0x465746[_0x70f1('0x41')](_0x409420,0x0,{'type':_0x28f0bf['type'],'app':_0x70f1('0x42'),'appdata':_0x1cbf80[_0x70f1('0x2e')][_0x409420]+'?'+_0x28f0bf['context']+_0x70f1('0x43')+_0x463e76+':'+_0x28f0bf[_0x70f1('0x7')]+_0x70f1('0x43')+_0x1cd39e,'exten':_0x28f0bf['exten'],'context':_0x28f0bf[_0x70f1('0x7')],'priority':_0x2aa207+_0x409420,'VoiceExtensionId':_0x28f0bf['id']});}if(_0x1cbf80[_0x70f1('0x3a')]===_0x70f1('0x44'))_0x1cbf80['appdata']=_0xb8a75b(_0x28f0bf,_0x1cbf80[_0x70f1('0x45')]);_0x1cbf80[_0x70f1('0x46')]=_0x465746[_0x70f1('0x22')]?_[_0x70f1('0x47')](_0x465746)[_0x70f1('0x46')]+0x1:_0x2aa207;_0x82262a=_['concat'](_0x82262a,_0x465746,[_0x1cbf80],_0x5537d8);_0x2aa207=_[_0x70f1('0x47')](_0x82262a)[_0x70f1('0x46')]+0x1;}return _0x447b98(_0x82262a);})[_0x70f1('0x48')](function(_0x3916b2){_0x27b82a(_0x3916b2);});});}return _0x584254[_0x70f1('0x49')](_0x70f1('0x4a'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x403572){var _0xde6208=this['get']({'plain':!![]});var _0x299548=_0xde6208['type']===_0x70f1('0x11')?_0xfb67f1(_0xde6208):_0x1aa52f(_0xde6208);return _0x519425(_0xde6208,_0x403572,_['last'](_0x299548)['priority']+0x1)[_0x70f1('0x4b')](function(_0x443b85){var _0x9139be=_[_0x70f1('0x4c')](_0x299548,_0x443b85);_0x9139be[_0x70f1('0xe')]({'type':_0xde6208[_0x70f1('0x4')],'app':_0x70f1('0x4d'),'exten':_0xde6208['exten'],'context':_0xde6208[_0x70f1('0x7')],'priority':_[_0x70f1('0x47')](_0x9139be)[_0x70f1('0x46')]+0x1,'VoiceExtensionId':_0xde6208['id']});return _0x9139be;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index d3997f7..e2c72a0 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 _0x87d8=['localhost','socket.io-emitter','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','raw','options','where','attributes','limit','map','include','model','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x3d3ec8,_0x13489c){var _0x580e4c=function(_0x2cc7bf){while(--_0x2cc7bf){_0x3d3ec8['push'](_0x3d3ec8['shift']());}};_0x580e4c(++_0x13489c);}(_0x87d8,0x1a9));var _0x887d=function(_0xeead8a,_0x3d2400){_0xeead8a=_0xeead8a-0x0;var _0x24742c=_0x87d8[_0xeead8a];return _0x24742c;};'use strict';var _=require('lodash');var util=require(_0x887d('0x0'));var moment=require(_0x887d('0x1'));var BPromise=require(_0x887d('0x2'));var rs=require(_0x887d('0x3'));var fs=require('fs');var Redis=require(_0x887d('0x4'));var db=require(_0x887d('0x5'))['db'];var utils=require(_0x887d('0x6'));var logger=require(_0x887d('0x7'))(_0x887d('0x8'));var config=require(_0x887d('0x9'));var jayson=require(_0x887d('0xa'));var client=jayson[_0x887d('0xb')][_0x887d('0xc')]({'port':0x232a});config[_0x887d('0xd')]=_[_0x887d('0xe')](config['redis'],{'host':_0x887d('0xf'),'port':0x18eb});var socket=require(_0x887d('0x10'))(new Redis(config['redis']));require('./voiceExtension.socket')['register'](socket);function respondWithRpcPromise(_0x56c73a,_0x4396d8,_0x31488d){return new BPromise(function(_0x1f745a,_0x3db821){return client['request'](_0x56c73a,_0x31488d)['then'](function(_0x1aba20){logger[_0x887d('0x11')](_0x887d('0x12'),_0x4396d8,_0x887d('0x13'));logger[_0x887d('0x14')](_0x887d('0x15'),_0x4396d8,_0x887d('0x13'),JSON[_0x887d('0x16')](_0x1aba20));if(_0x1aba20['error']){if(_0x1aba20[_0x887d('0x17')][_0x887d('0x18')]===0x1f4){logger[_0x887d('0x17')]('VoiceExtension,\x20%s,\x20%s',_0x4396d8,_0x1aba20[_0x887d('0x17')][_0x887d('0x19')]);return _0x3db821(_0x1aba20['error']['message']);}logger['error'](_0x887d('0x12'),_0x4396d8,_0x1aba20[_0x887d('0x17')]['message']);return _0x1f745a(_0x1aba20[_0x887d('0x17')][_0x887d('0x19')]);}else{logger[_0x887d('0x11')]('VoiceExtension,\x20%s,\x20%s',_0x4396d8,_0x887d('0x13'));_0x1f745a(_0x1aba20[_0x887d('0x1a')]['message']);}})[_0x887d('0x1b')](function(_0x54481b){logger[_0x887d('0x17')](_0x887d('0x12'),_0x4396d8,_0x54481b);_0x3db821(_0x54481b);});});}exports[_0x887d('0x1c')]=function(_0x99ca6){var _0x2c5a10=this;return new Promise(function(_0x378edb,_0x2efaa8){return db[_0x887d('0x1d')][_0x887d('0x1e')]({'raw':_0x99ca6['options']?_0x99ca6['options'][_0x887d('0x1f')]===undefined?!![]:![]:!![],'where':_0x99ca6['options']?_0x99ca6[_0x887d('0x20')][_0x887d('0x21')]||null:null,'attributes':_0x99ca6[_0x887d('0x20')]?_0x99ca6[_0x887d('0x20')][_0x887d('0x22')]||null:null,'limit':_0x99ca6[_0x887d('0x20')]?_0x99ca6['options'][_0x887d('0x23')]||null:null,'include':_0x99ca6[_0x887d('0x20')]?_0x99ca6['options']['include']?_[_0x887d('0x24')](_0x99ca6[_0x887d('0x20')][_0x887d('0x25')],function(_0x36d9fd){return{'model':db[_0x36d9fd['model']],'as':_0x36d9fd['as'],'attributes':_0x36d9fd[_0x887d('0x22')],'include':_0x36d9fd[_0x887d('0x25')]?_[_0x887d('0x24')](_0x36d9fd['include'],function(_0x2c4883){return{'model':db[_0x2c4883[_0x887d('0x26')]],'as':_0x2c4883['as'],'attributes':_0x2c4883[_0x887d('0x22')],'include':_0x2c4883['include']?_['map'](_0x2c4883[_0x887d('0x25')],function(_0x6bca0){return{'model':db[_0x6bca0['model']],'as':_0x6bca0['as'],'attributes':_0x6bca0['attributes']};}):[]};}):[]};}):[]:[]})[_0x887d('0x27')](function(_0x5768c0){logger[_0x887d('0x11')](_0x887d('0x1c'),_0x99ca6);logger['debug'](_0x887d('0x1c'),_0x99ca6,JSON[_0x887d('0x16')](_0x5768c0));_0x378edb(_0x5768c0);})['catch'](function(_0x5edbe5){logger['error'](_0x887d('0x1c'),_0x5edbe5[_0x887d('0x19')],_0x99ca6);_0x2efaa8(_0x2c5a10[_0x887d('0x17')](0x1f4,_0x5edbe5[_0x887d('0x19')]));});});}; \ No newline at end of file +var _0x972c=['result','catch','GetVoiceExtension','findAll','options','raw','where','include','model','attributes','map','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','register','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x54cc8e,_0x51dd90){var _0x336b92=function(_0x56f6a6){while(--_0x56f6a6){_0x54cc8e['push'](_0x54cc8e['shift']());}};_0x336b92(++_0x51dd90);}(_0x972c,0xf2));var _0xc972=function(_0x48d048,_0x448394){_0x48d048=_0x48d048-0x0;var _0xd295e5=_0x972c[_0x48d048];return _0xd295e5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc972('0x0'));var BPromise=require(_0xc972('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc972('0x2'));var db=require(_0xc972('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc972('0x4'));var config=require(_0xc972('0x5'));var jayson=require(_0xc972('0x6'));var client=jayson['client'][_0xc972('0x7')]({'port':0x232a});config['redis']=_[_0xc972('0x8')](config[_0xc972('0x9')],{'host':_0xc972('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceExtension.socket')[_0xc972('0xb')](socket);function respondWithRpcPromise(_0x4c4903,_0x3053d6,_0x16993d){return new BPromise(function(_0x32cb5b,_0x423926){return client[_0xc972('0xc')](_0x4c4903,_0x16993d)[_0xc972('0xd')](function(_0x233d36){logger['info'](_0xc972('0xe'),_0x3053d6,_0xc972('0xf'));logger[_0xc972('0x10')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x3053d6,_0xc972('0xf'),JSON[_0xc972('0x11')](_0x233d36));if(_0x233d36[_0xc972('0x12')]){if(_0x233d36['error'][_0xc972('0x13')]===0x1f4){logger[_0xc972('0x12')](_0xc972('0xe'),_0x3053d6,_0x233d36[_0xc972('0x12')]['message']);return _0x423926(_0x233d36[_0xc972('0x12')][_0xc972('0x14')]);}logger[_0xc972('0x12')](_0xc972('0xe'),_0x3053d6,_0x233d36[_0xc972('0x12')][_0xc972('0x14')]);return _0x32cb5b(_0x233d36[_0xc972('0x12')][_0xc972('0x14')]);}else{logger[_0xc972('0x15')](_0xc972('0xe'),_0x3053d6,_0xc972('0xf'));_0x32cb5b(_0x233d36[_0xc972('0x16')][_0xc972('0x14')]);}})[_0xc972('0x17')](function(_0x3dffe5){logger[_0xc972('0x12')]('VoiceExtension,\x20%s,\x20%s',_0x3053d6,_0x3dffe5);_0x423926(_0x3dffe5);});});}exports[_0xc972('0x18')]=function(_0x20cb18){var _0x3c8bda=this;return new Promise(function(_0x267d6c,_0x486340){return db['VoiceExtension'][_0xc972('0x19')]({'raw':_0x20cb18[_0xc972('0x1a')]?_0x20cb18['options'][_0xc972('0x1b')]===undefined?!![]:![]:!![],'where':_0x20cb18[_0xc972('0x1a')]?_0x20cb18[_0xc972('0x1a')][_0xc972('0x1c')]||null:null,'attributes':_0x20cb18[_0xc972('0x1a')]?_0x20cb18[_0xc972('0x1a')]['attributes']||null:null,'limit':_0x20cb18[_0xc972('0x1a')]?_0x20cb18['options']['limit']||null:null,'include':_0x20cb18[_0xc972('0x1a')]?_0x20cb18[_0xc972('0x1a')][_0xc972('0x1d')]?_['map'](_0x20cb18[_0xc972('0x1a')][_0xc972('0x1d')],function(_0xf115da){return{'model':db[_0xf115da[_0xc972('0x1e')]],'as':_0xf115da['as'],'attributes':_0xf115da[_0xc972('0x1f')],'include':_0xf115da[_0xc972('0x1d')]?_[_0xc972('0x20')](_0xf115da[_0xc972('0x1d')],function(_0x3610d7){return{'model':db[_0x3610d7[_0xc972('0x1e')]],'as':_0x3610d7['as'],'attributes':_0x3610d7[_0xc972('0x1f')],'include':_0x3610d7[_0xc972('0x1d')]?_[_0xc972('0x20')](_0x3610d7[_0xc972('0x1d')],function(_0x5ad71d){return{'model':db[_0x5ad71d[_0xc972('0x1e')]],'as':_0x5ad71d['as'],'attributes':_0x5ad71d['attributes']};}):[]};}):[]};}):[]:[]})[_0xc972('0xd')](function(_0x4efef1){logger[_0xc972('0x15')](_0xc972('0x18'),_0x20cb18);logger[_0xc972('0x10')](_0xc972('0x18'),_0x20cb18,JSON[_0xc972('0x11')](_0x4efef1));_0x267d6c(_0x4efef1);})['catch'](function(_0xdbc068){logger[_0xc972('0x12')](_0xc972('0x18'),_0xdbc068[_0xc972('0x14')],_0x20cb18);_0x486340(_0x3c8bda['error'](0x1f4,_0xdbc068[_0xc972('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 57b500a..692b0aa 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 _0x1cb9=['update','emit','removeListener','register','length','./voiceExtension.events','remove'];(function(_0x30cd7e,_0x4db10a){var _0x462a02=function(_0x157d81){while(--_0x157d81){_0x30cd7e['push'](_0x30cd7e['shift']());}};_0x462a02(++_0x4db10a);}(_0x1cb9,0x14e));var _0x91cb=function(_0x33daf9,_0x278cc7){_0x33daf9=_0x33daf9-0x0;var _0x584e5d=_0x1cb9[_0x33daf9];return _0x584e5d;};'use strict';var VoiceExtensionEvents=require(_0x91cb('0x0'));var events=['save',_0x91cb('0x1'),_0x91cb('0x2')];function createListener(_0x2b1894,_0x351bdb){return function(_0x57ea48){_0x351bdb[_0x91cb('0x3')](_0x2b1894,_0x57ea48);};}function removeListener(_0x2b7314,_0x5652cd){return function(){VoiceExtensionEvents[_0x91cb('0x4')](_0x2b7314,_0x5652cd);};}exports[_0x91cb('0x5')]=function(_0x186dc3){for(var _0x28543e=0x0,_0x3b9d98=events[_0x91cb('0x6')];_0x28543e<_0x3b9d98;_0x28543e++){var _0x4c1f56=events[_0x28543e];var _0x15c517=createListener('voiceExtension:'+_0x4c1f56,_0x186dc3);VoiceExtensionEvents['on'](_0x4c1f56,_0x15c517);}}; \ No newline at end of file +var _0x814b=['removeListener','register','length','voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x8c1005,_0x1f3f16){var _0x175354=function(_0xd0e9c4){while(--_0xd0e9c4){_0x8c1005['push'](_0x8c1005['shift']());}};_0x175354(++_0x1f3f16);}(_0x814b,0x1a2));var _0xb814=function(_0x423e15,_0x12b2b2){_0x423e15=_0x423e15-0x0;var _0x184279=_0x814b[_0x423e15];return _0x184279;};'use strict';var VoiceExtensionEvents=require(_0xb814('0x0'));var events=[_0xb814('0x1'),_0xb814('0x2'),_0xb814('0x3')];function createListener(_0xfbb64b,_0x477725){return function(_0x4a98af){_0x477725[_0xb814('0x4')](_0xfbb64b,_0x4a98af);};}function removeListener(_0x3e1e9,_0x258866){return function(){VoiceExtensionEvents[_0xb814('0x5')](_0x3e1e9,_0x258866);};}exports[_0xb814('0x6')]=function(_0x322a70){for(var _0x53e507=0x0,_0x3b0829=events[_0xb814('0x7')];_0x53e507<_0x3b0829;_0x53e507++){var _0x5c8539=events[_0x53e507];var _0x271af9=createListener(_0xb814('0x8')+_0x5c8539,_0x322a70);VoiceExtensionEvents['on'](_0x5c8539,_0x271af9);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index f15d562..ff68f92 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 _0x1261=['isAuthenticated','show','/:id/messages','post','create','/:id','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','index','get'];(function(_0x15586f,_0x109c03){var _0x113148=function(_0x352346){while(--_0x352346){_0x15586f['push'](_0x15586f['shift']());}};_0x113148(++_0x109c03);}(_0x1261,0x144));var _0x1126=function(_0x5e6aad,_0x3cdddd){_0x5e6aad=_0x5e6aad-0x0;var _0x55deab=_0x1261[_0x5e6aad];return _0x55deab;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var fs_extra=require(_0x1126('0x5'));var auth=require(_0x1126('0x6'));var interaction=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var controller=require(_0x1126('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1126('0xa')]);router[_0x1126('0xb')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0xd')]);router[_0x1126('0xb')](_0x1126('0xe'),auth[_0x1126('0xc')](),controller['getMessages']);router[_0x1126('0xf')]('/',auth[_0x1126('0xc')](),controller[_0x1126('0x10')]);router['put'](_0x1126('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x1126('0x12')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0x13')]);module[_0x1126('0x14')]=router; \ No newline at end of file +var _0xc4aa=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','/:id/messages','getMessages','create','put','delete'];(function(_0x2221f0,_0x2a1654){var _0x408219=function(_0x10311d){while(--_0x10311d){_0x2221f0['push'](_0x2221f0['shift']());}};_0x408219(++_0x2a1654);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xc4aa[_0x42cae2];return _0x5f256f;};'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['show']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['post']('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xe')]);router[_0xac4a('0xf')]('/:id',auth[_0xac4a('0x9')](),controller['update']);router[_0xac4a('0x10')]('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0x11')]);module[_0xac4a('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 184efbd..d961c8c 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 _0xcce7=['contest_mailbox','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','fullname','mailbox','sequelize','exports','STRING','from-voicemail'];(function(_0x27c6f5,_0x5ed072){var _0x2c7a90=function(_0x5d1541){while(--_0x5d1541){_0x27c6f5['push'](_0x27c6f5['shift']());}};_0x2c7a90(++_0x5ed072);}(_0xcce7,0x1cc));var _0x7cce=function(_0x4e8653,_0xb3260b){_0x4e8653=_0x4e8653-0x0;var _0x55a5e2=_0xcce7[_0x4e8653];return _0x55a5e2;};'use strict';var Sequelize=require(_0x7cce('0x0'));module[_0x7cce('0x1')]={'customer_id':{'type':Sequelize[_0x7cce('0x2')]},'context':{'type':Sequelize[_0x7cce('0x2')],'defaultValue':_0x7cce('0x3'),'unique':_0x7cce('0x4')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x7cce('0x2')]},'email':{'type':Sequelize[_0x7cce('0x2')],'validate':{'isEmail':!![]},'set':function(_0x5f13f0){this['setDataValue']('email',typeof _0x5f13f0===_0x7cce('0x5')&&_0x5f13f0[_0x7cce('0x6')]()?_0x5f13f0[_0x7cce('0x6')]():null);}},'pager':{'type':Sequelize[_0x7cce('0x2')]},'tz':{'type':Sequelize[_0x7cce('0x2')],'defaultValue':_0x7cce('0x7')},'attach':{'type':Sequelize[_0x7cce('0x8')]('yes','no'),'defaultValue':_0x7cce('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x7cce('0x8')]('yes','no'),'defaultValue':_0x7cce('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x7cce('0x2')]},'callback':{'type':Sequelize[_0x7cce('0x2')]},'review':{'type':Sequelize[_0x7cce('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x7cce('0x8')](_0x7cce('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x7cce('0x8')](_0x7cce('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x7cce('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x7cce('0x8')](_0x7cce('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x7cce('0x8')](_0x7cce('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x7cce('0x8')](_0x7cce('0x9'),'no'),'defaultValue':_0x7cce('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x7cce('0x8')](_0x7cce('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x7cce('0x8')](_0x7cce('0x9'),'no'),'defaultValue':_0x7cce('0x9'),'allowNull':![]},'stamp':{'type':_0x7cce('0xb')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x7cce('0x2')]},'maxsecs':{'type':Sequelize[_0x7cce('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x7cce('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x7cce('0xd')],'get':function(){return this['getDataValue'](_0x7cce('0xe'))+'\x20-\x20'+this['getDataValue'](_0x7cce('0xf'));}}}; \ No newline at end of file +var _0x240e=['VIRTUAL','getDataValue','\x20-\x20','mailbox','sequelize','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','yes','ENUM','INTEGER'];(function(_0x2690dc,_0x307e24){var _0x4e924e=function(_0x2f45d7){while(--_0x2f45d7){_0x2690dc['push'](_0x2690dc['shift']());}};_0x4e924e(++_0x307e24);}(_0x240e,0x1c4));var _0xe240=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x240e[_0x138f59];return _0x3d114d;};'use strict';var Sequelize=require(_0xe240('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0xe240('0x1')]},'context':{'type':Sequelize[_0xe240('0x1')],'defaultValue':_0xe240('0x2'),'unique':_0xe240('0x3')},'mailbox':{'type':Sequelize[_0xe240('0x1')],'defaultValue':'','allowNull':![],'unique':_0xe240('0x3')},'password':{'type':Sequelize[_0xe240('0x1')]},'fullname':{'type':Sequelize[_0xe240('0x1')]},'email':{'type':Sequelize[_0xe240('0x1')],'validate':{'isEmail':!![]},'set':function(_0x48cb7a){this[_0xe240('0x4')](_0xe240('0x5'),typeof _0x48cb7a===_0xe240('0x6')&&_0x48cb7a[_0xe240('0x7')]()?_0x48cb7a[_0xe240('0x7')]():null);}},'pager':{'type':Sequelize[_0xe240('0x1')]},'tz':{'type':Sequelize[_0xe240('0x1')],'defaultValue':_0xe240('0x8')},'attach':{'type':Sequelize['ENUM'](_0xe240('0x9'),'no'),'defaultValue':_0xe240('0x9'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0xe240('0x1')]},'callback':{'type':Sequelize[_0xe240('0x1')]},'review':{'type':Sequelize['ENUM'](_0xe240('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xe240('0xa')](_0xe240('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xe240('0xa')](_0xe240('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xe240('0xa')](_0xe240('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xe240('0xa')](_0xe240('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xe240('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xe240('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0xe240('0xa')](_0xe240('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xe240('0xa')](_0xe240('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xe240('0xa')]('yes','no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0xe240('0x1')]},'maxsecs':{'type':Sequelize[_0xe240('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xe240('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xe240('0xc')],'get':function(){return this[_0xe240('0xd')]('fullname')+_0xe240('0xe')+this[_0xe240('0xd')](_0xe240('0xf'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 67a0eec..7a6cdb7 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 _0x236c=['fs-extra','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','Voicemails','UserProfileResource','error','name','send','index','map','VoiceMail','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','rows','catch','show','params','rawAttributes','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','VoiceMailMessage','mailbox','findAndCountAll','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs'];(function(_0x20c447,_0x179e12){var _0x2c94c5=function(_0x2c7b0a){while(--_0x2c7b0a){_0x20c447['push'](_0x20c447['shift']());}};_0x2c94c5(++_0x179e12);}(_0x236c,0x155));var _0xc236=function(_0x36888d,_0x22988e){_0x36888d=_0x36888d-0x0;var _0x14f524=_0x236c[_0x36888d];return _0x14f524;};'use strict';var emlformat=require(_0xc236('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc236('0x1'));var jsonpatch=require(_0xc236('0x2'));var rp=require(_0xc236('0x3'));var moment=require(_0xc236('0x4'));var BPromise=require(_0xc236('0x5'));var Mustache=require('mustache');var util=require(_0xc236('0x6'));var path=require(_0xc236('0x7'));var sox=require(_0xc236('0x8'));var csv=require(_0xc236('0x9'));var ejs=require(_0xc236('0xa'));var fs=require('fs');var fs_extra=require(_0xc236('0xb'));var _=require('lodash');var squel=require(_0xc236('0xc'));var crypto=require(_0xc236('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc236('0xe'));var Papa=require('papaparse');var Redis=require(_0xc236('0xf'));var authService=require(_0xc236('0x10'));var qs=require(_0xc236('0x11'));var as=require(_0xc236('0x12'));var hardwareService=require(_0xc236('0x13'));var logger=require('../../config/logger')(_0xc236('0x14'));var utils=require(_0xc236('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc236('0x16'));var db=require(_0xc236('0x17'))['db'];function respondWithStatusCode(_0x5ee3a5,_0x5b9638){_0x5b9638=_0x5b9638||0xcc;return function(_0x5bce83){if(_0x5bce83){return _0x5ee3a5['sendStatus'](_0x5b9638);}return _0x5ee3a5[_0xc236('0x18')](_0x5b9638)[_0xc236('0x19')]();};}function respondWithResult(_0x2184c9,_0x71bce2){_0x71bce2=_0x71bce2||0xc8;return function(_0x5052db){if(_0x5052db){return _0x2184c9[_0xc236('0x18')](_0x71bce2)['json'](_0x5052db);}};}function respondWithFilteredResult(_0x5221bf,_0x9a65e8){return function(_0x32f2fd){if(_0x32f2fd){var _0x443a46=typeof _0x9a65e8[_0xc236('0x1a')]===_0xc236('0x1b')&&typeof _0x9a65e8['limit']==='undefined';var _0x57355b=_0x32f2fd[_0xc236('0x1c')];var _0x76f45=_0x443a46?0x0:_0x9a65e8[_0xc236('0x1a')];var _0x541a20=_0x443a46?_0x32f2fd[_0xc236('0x1c')]:_0x9a65e8['offset']+_0x9a65e8['limit'];var _0x1eafba;if(_0x541a20>=_0x57355b){_0x541a20=_0x57355b;_0x1eafba=0xc8;}else{_0x1eafba=0xce;}_0x5221bf[_0xc236('0x18')](_0x1eafba);return _0x5221bf[_0xc236('0x1d')](_0xc236('0x1e'),_0x76f45+'-'+_0x541a20+'/'+_0x57355b)[_0xc236('0x1f')](_0x32f2fd);}return null;};}function patchUpdates(_0x27c6ab){return function(_0x3f0e2f){try{jsonpatch[_0xc236('0x20')](_0x3f0e2f,_0x27c6ab,!![]);}catch(_0x54ffac){return BPromise[_0xc236('0x21')](_0x54ffac);}return _0x3f0e2f[_0xc236('0x22')]();};}function saveUpdates(_0x4a9006,_0x208c3f){return function(_0x34d73a){if(_0x34d73a){return _0x34d73a[_0xc236('0x23')](_0x4a9006)[_0xc236('0x24')](function(_0x27afba){return _0x27afba;});}return null;};}function removeEntity(_0x21fab8,_0x3a315b){return function(_0xf921e6){if(_0xf921e6){return _0xf921e6[_0xc236('0x25')]()[_0xc236('0x24')](function(){var _0x17cb3b=_0xf921e6['get']({'plain':!![]});var _0x308cd6=_0xc236('0x26');return db[_0xc236('0x27')][_0xc236('0x25')]({'where':{'type':_0x308cd6,'resourceId':_0x17cb3b['id']}})['then'](function(){return _0xf921e6;});})[_0xc236('0x24')](function(){_0x21fab8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x15ead8,_0x4eace8){return function(_0x36e578){if(!_0x36e578){_0x15ead8['sendStatus'](0x194);}return _0x36e578;};}function handleError(_0x54365,_0x5c79d6){_0x5c79d6=_0x5c79d6||0x1f4;return function(_0x423842){logger[_0xc236('0x28')](_0x423842['stack']);if(_0x423842['name']){delete _0x423842[_0xc236('0x29')];}_0x54365[_0xc236('0x18')](_0x5c79d6)[_0xc236('0x2a')](_0x423842);};}exports[_0xc236('0x2b')]=function(_0x5f3891,_0x4e3262){var _0x28ffa5={},_0x53b767={},_0x2c756f={'count':0x0,'rows':[]};var _0x4ddc87=_[_0xc236('0x2c')](db[_0xc236('0x2d')]['rawAttributes'],function(_0x5a5ec3){return{'name':_0x5a5ec3[_0xc236('0x2e')],'type':_0x5a5ec3[_0xc236('0x2f')][_0xc236('0x30')]};});_0x53b767[_0xc236('0x31')]=_[_0xc236('0x2c')](_0x4ddc87,_0xc236('0x29'));_0x53b767[_0xc236('0x32')]=_[_0xc236('0x33')](_0x5f3891[_0xc236('0x32')]);_0x53b767['filters']=_['intersection'](_0x53b767['model'],_0x53b767[_0xc236('0x32')]);_0x28ffa5[_0xc236('0x34')]=_[_0xc236('0x35')](_0x53b767[_0xc236('0x31')],qs[_0xc236('0x36')](_0x5f3891[_0xc236('0x32')][_0xc236('0x36')]));_0x28ffa5['attributes']=_0x28ffa5[_0xc236('0x34')][_0xc236('0x37')]?_0x28ffa5[_0xc236('0x34')]:_0x53b767['model'];if(!_0x5f3891[_0xc236('0x32')][_0xc236('0x38')](_0xc236('0x39'))){_0x28ffa5[_0xc236('0x3a')]=qs['limit'](_0x5f3891[_0xc236('0x32')][_0xc236('0x3a')]);_0x28ffa5[_0xc236('0x1a')]=qs[_0xc236('0x1a')](_0x5f3891[_0xc236('0x32')][_0xc236('0x1a')]);}_0x28ffa5[_0xc236('0x3b')]=qs[_0xc236('0x3c')](_0x5f3891[_0xc236('0x32')][_0xc236('0x3c')]);_0x28ffa5[_0xc236('0x3d')]=qs[_0xc236('0x3e')](_[_0xc236('0x3f')](_0x5f3891[_0xc236('0x32')],_0x53b767[_0xc236('0x3e')]),_0x4ddc87);if(_0x5f3891[_0xc236('0x32')][_0xc236('0x40')]){_0x28ffa5['where']=_['merge'](_0x28ffa5['where'],{'$or':_['map'](_0x4ddc87,function(_0x369a79){if(_0x369a79['type']!==_0xc236('0x41')){var _0x361526={};_0x361526[_0x369a79[_0xc236('0x29')]]={'$like':'%'+_0x5f3891[_0xc236('0x32')][_0xc236('0x40')]+'%'};return _0x361526;}})});}_0x28ffa5=_[_0xc236('0x42')]({},_0x28ffa5,_0x5f3891[_0xc236('0x43')]);var _0x201ba3={'where':_0x28ffa5[_0xc236('0x3d')]};return db[_0xc236('0x2d')][_0xc236('0x1c')](_0x201ba3)[_0xc236('0x24')](function(_0x3b2f2f){_0x2c756f[_0xc236('0x1c')]=_0x3b2f2f;if(_0x5f3891[_0xc236('0x32')]['includeAll']){_0x28ffa5[_0xc236('0x44')]=[{'all':!![]}];}return db[_0xc236('0x2d')]['findAll'](_0x28ffa5);})[_0xc236('0x24')](function(_0x5b0bc5){_0x2c756f[_0xc236('0x45')]=_0x5b0bc5;return _0x2c756f;})['then'](respondWithFilteredResult(_0x4e3262,_0x28ffa5))[_0xc236('0x46')](handleError(_0x4e3262,null));};exports[_0xc236('0x47')]=function(_0x8d04c9,_0x479e02){var _0x11e3dd={'raw':!![],'where':{'id':_0x8d04c9[_0xc236('0x48')]['id']}},_0x429e08={};_0x429e08['model']=_[_0xc236('0x33')](db[_0xc236('0x2d')][_0xc236('0x49')]);_0x429e08[_0xc236('0x32')]=_[_0xc236('0x33')](_0x8d04c9[_0xc236('0x32')]);_0x429e08['filters']=_[_0xc236('0x35')](_0x429e08['model'],_0x429e08[_0xc236('0x32')]);_0x11e3dd[_0xc236('0x34')]=_[_0xc236('0x35')](_0x429e08[_0xc236('0x31')],qs[_0xc236('0x36')](_0x8d04c9[_0xc236('0x32')][_0xc236('0x36')]));_0x11e3dd['attributes']=_0x11e3dd[_0xc236('0x34')]['length']?_0x11e3dd[_0xc236('0x34')]:_0x429e08[_0xc236('0x31')];if(_0x8d04c9['query'][_0xc236('0x4a')]){_0x11e3dd[_0xc236('0x44')]=[{'all':!![]}];}_0x11e3dd=_[_0xc236('0x42')]({},_0x11e3dd,_0x8d04c9[_0xc236('0x43')]);return db[_0xc236('0x2d')][_0xc236('0x4b')](_0x11e3dd)[_0xc236('0x24')](handleEntityNotFound(_0x479e02,null))['then'](respondWithResult(_0x479e02,null))['catch'](handleError(_0x479e02,null));};exports[_0xc236('0x4c')]=function(_0x2afed2,_0x510f7f){return db[_0xc236('0x2d')][_0xc236('0x4c')](_0x2afed2[_0xc236('0x4d')],{})[_0xc236('0x24')](function(_0x45fa20){var _0x1683f4=_0x2afed2[_0xc236('0x4e')][_0xc236('0x4f')]({'plain':!![]});if(!_0x1683f4)throw new Error(_0xc236('0x50'));if(_0x1683f4['role']===_0xc236('0x4e')){var _0x307663=_0x45fa20[_0xc236('0x4f')]({'plain':!![]});var _0x447a83=_0xc236('0x26');return db[_0xc236('0x51')][_0xc236('0x4b')]({'where':{'name':_0x447a83,'userProfileId':_0x1683f4['userProfileId']},'raw':!![]})[_0xc236('0x24')](function(_0x3788ff){if(_0x3788ff&&_0x3788ff[_0xc236('0x52')]===0x0){return db[_0xc236('0x27')]['create']({'name':_0x307663[_0xc236('0x29')],'resourceId':_0x307663['id'],'type':_0x3788ff[_0xc236('0x29')],'sectionId':_0x3788ff['id']},{})[_0xc236('0x24')](function(){return _0x45fa20;});}else{return _0x45fa20;}})[_0xc236('0x46')](function(_0x9d81c8){logger['error'](_0xc236('0x53'),_0x9d81c8);throw _0x9d81c8;});}return _0x45fa20;})['then'](respondWithResult(_0x510f7f,0xc9))[_0xc236('0x46')](handleError(_0x510f7f,null));};exports[_0xc236('0x23')]=function(_0x3f9e85,_0x15defc){if(_0x3f9e85[_0xc236('0x4d')]['id']){delete _0x3f9e85['body']['id'];}return db['VoiceMail'][_0xc236('0x4b')]({'where':{'id':_0x3f9e85[_0xc236('0x48')]['id']}})[_0xc236('0x24')](handleEntityNotFound(_0x15defc,null))[_0xc236('0x24')](saveUpdates(_0x3f9e85[_0xc236('0x4d')],null))[_0xc236('0x24')](respondWithResult(_0x15defc,null))[_0xc236('0x46')](handleError(_0x15defc,null));};exports[_0xc236('0x25')]=function(_0x24af08,_0x2d27e7){return db['VoiceMail']['find']({'where':{'id':_0x24af08[_0xc236('0x48')]['id']}})[_0xc236('0x24')](handleEntityNotFound(_0x2d27e7,null))[_0xc236('0x24')](removeEntity(_0x2d27e7,null))[_0xc236('0x46')](handleError(_0x2d27e7,null));};exports['getMessages']=function(_0x94fc7,_0x460076,_0x56e476){return db[_0xc236('0x2d')][_0xc236('0x54')]({'where':{'id':_0x94fc7[_0xc236('0x48')]['id']}})[_0xc236('0x24')](handleEntityNotFound(_0x460076,null))['then'](function(_0x1558dd){var _0xec00da;var _0x35955c={},_0x2602f8={};_0x2602f8[_0xc236('0x31')]=_[_0xc236('0x33')](db[_0xc236('0x55')]['rawAttributes']);_0x2602f8[_0xc236('0x32')]=_['keys'](_0x94fc7[_0xc236('0x32')]);_0x2602f8[_0xc236('0x3e')]=_[_0xc236('0x35')](_0x2602f8[_0xc236('0x31')],_0x2602f8['query']);_0x35955c[_0xc236('0x34')]=_[_0xc236('0x35')](_0x2602f8[_0xc236('0x31')],qs['fields'](_0x94fc7[_0xc236('0x32')][_0xc236('0x36')]));_0x35955c[_0xc236('0x34')]=_0x35955c[_0xc236('0x34')][_0xc236('0x37')]?_0x35955c[_0xc236('0x34')]:_0x2602f8['model'];if(!_0x94fc7['query'][_0xc236('0x38')](_0xc236('0x39'))){_0x35955c[_0xc236('0x3a')]=qs[_0xc236('0x3a')](_0x94fc7[_0xc236('0x32')][_0xc236('0x3a')]);_0x35955c[_0xc236('0x1a')]=qs['offset'](_0x94fc7['query']['offset']);}_0x35955c[_0xc236('0x3b')]=qs[_0xc236('0x3c')](_0x94fc7[_0xc236('0x32')][_0xc236('0x3c')]);_0x35955c['where']=qs['filters'](_['pick'](_0x94fc7['query'],_0x2602f8[_0xc236('0x3e')]));if(_0x94fc7['query'][_0xc236('0x40')]){_0x35955c['where']=_[_0xc236('0x42')](_0x35955c[_0xc236('0x3d')],{'$or':_[_0xc236('0x2c')](_0x35955c[_0xc236('0x34')],function(_0x26d708){var _0x169e73={};_0x169e73[_0x26d708]={'$like':'%'+_0x94fc7[_0xc236('0x32')]['filter']+'%'};return _0x169e73;})});}_0x35955c[_0xc236('0x3d')]=_['merge'](_0x35955c[_0xc236('0x3d')],{'mailboxuser':_0x1558dd[_0xc236('0x56')]});_0x35955c=_[_0xc236('0x42')]({},_0x35955c,_0x94fc7[_0xc236('0x43')]);return db[_0xc236('0x55')][_0xc236('0x57')](_0x35955c)['then'](respondWithFilteredResult(_0x460076,_0x35955c));})[_0xc236('0x46')](handleError(_0x460076,null));}; \ No newline at end of file +var _0xae60=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','filter','merge','options','VoiceMail','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','order','pick','mailbox','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x2843d2,_0x27cfa5){var _0x214d1b=function(_0x2859bc){while(--_0x2859bc){_0x2843d2['push'](_0x2843d2['shift']());}};_0x214d1b(++_0x27cfa5);}(_0xae60,0x1c7));var _0x0ae6=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xae60[_0x2070da];return _0x4f9fe1;};'use strict';var emlformat=require(_0x0ae6('0x0'));var rimraf=require(_0x0ae6('0x1'));var zipdir=require(_0x0ae6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0ae6('0x3'));var moment=require(_0x0ae6('0x4'));var BPromise=require(_0x0ae6('0x5'));var Mustache=require('mustache');var util=require(_0x0ae6('0x6'));var path=require(_0x0ae6('0x7'));var sox=require('sox');var csv=require(_0x0ae6('0x8'));var ejs=require(_0x0ae6('0x9'));var fs=require('fs');var fs_extra=require(_0x0ae6('0xa'));var _=require(_0x0ae6('0xb'));var squel=require(_0x0ae6('0xc'));var crypto=require(_0x0ae6('0xd'));var jsforce=require(_0x0ae6('0xe'));var deskjs=require(_0x0ae6('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0ae6('0x10'));var Papa=require(_0x0ae6('0x11'));var Redis=require(_0x0ae6('0x12'));var authService=require(_0x0ae6('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0ae6('0x14'));var hardwareService=require(_0x0ae6('0x15'));var logger=require(_0x0ae6('0x16'))(_0x0ae6('0x17'));var utils=require(_0x0ae6('0x18'));var config=require(_0x0ae6('0x19'));var licenseUtil=require(_0x0ae6('0x1a'));var db=require(_0x0ae6('0x1b'))['db'];function respondWithStatusCode(_0x3b05a4,_0x30f8f9){_0x30f8f9=_0x30f8f9||0xcc;return function(_0x1aefd5){if(_0x1aefd5){return _0x3b05a4[_0x0ae6('0x1c')](_0x30f8f9);}return _0x3b05a4[_0x0ae6('0x1d')](_0x30f8f9)[_0x0ae6('0x1e')]();};}function respondWithResult(_0x4d2da8,_0x3809c6){_0x3809c6=_0x3809c6||0xc8;return function(_0x10c3bc){if(_0x10c3bc){return _0x4d2da8[_0x0ae6('0x1d')](_0x3809c6)[_0x0ae6('0x1f')](_0x10c3bc);}};}function respondWithFilteredResult(_0xce3e23,_0x3a1e26){return function(_0x151144){if(_0x151144){var _0x3b64ac=typeof _0x3a1e26[_0x0ae6('0x20')]===_0x0ae6('0x21')&&typeof _0x3a1e26[_0x0ae6('0x22')]===_0x0ae6('0x21');var _0xa97151=_0x151144[_0x0ae6('0x23')];var _0xda4f01=_0x3b64ac?0x0:_0x3a1e26[_0x0ae6('0x20')];var _0x2fdf25=_0x3b64ac?_0x151144[_0x0ae6('0x23')]:_0x3a1e26[_0x0ae6('0x20')]+_0x3a1e26[_0x0ae6('0x22')];var _0x26b369;if(_0x2fdf25>=_0xa97151){_0x2fdf25=_0xa97151;_0x26b369=0xc8;}else{_0x26b369=0xce;}_0xce3e23[_0x0ae6('0x1d')](_0x26b369);return _0xce3e23['set'](_0x0ae6('0x24'),_0xda4f01+'-'+_0x2fdf25+'/'+_0xa97151)[_0x0ae6('0x1f')](_0x151144);}return null;};}function patchUpdates(_0x140a3b){return function(_0x1027c2){try{jsonpatch[_0x0ae6('0x25')](_0x1027c2,_0x140a3b,!![]);}catch(_0xb4e6af){return BPromise[_0x0ae6('0x26')](_0xb4e6af);}return _0x1027c2[_0x0ae6('0x27')]();};}function saveUpdates(_0x515f3d,_0x39b22e){return function(_0x2a6484){if(_0x2a6484){return _0x2a6484[_0x0ae6('0x28')](_0x515f3d)[_0x0ae6('0x29')](function(_0x31ad85){return _0x31ad85;});}return null;};}function removeEntity(_0x4eba72,_0x296a9d){return function(_0x4e1242){if(_0x4e1242){return _0x4e1242[_0x0ae6('0x2a')]()[_0x0ae6('0x29')](function(){var _0x3c43d8=_0x4e1242[_0x0ae6('0x2b')]({'plain':!![]});var _0x5b86fe=_0x0ae6('0x2c');return db[_0x0ae6('0x2d')]['destroy']({'where':{'type':_0x5b86fe,'resourceId':_0x3c43d8['id']}})['then'](function(){return _0x4e1242;});})[_0x0ae6('0x29')](function(){_0x4eba72[_0x0ae6('0x1d')](0xcc)[_0x0ae6('0x1e')]();});}};}function handleEntityNotFound(_0x4fe77b,_0x3b5f8f){return function(_0xb68cbe){if(!_0xb68cbe){_0x4fe77b[_0x0ae6('0x1c')](0x194);}return _0xb68cbe;};}function handleError(_0x4df796,_0x2428b2){_0x2428b2=_0x2428b2||0x1f4;return function(_0x29fef3){logger[_0x0ae6('0x2e')](_0x29fef3[_0x0ae6('0x2f')]);if(_0x29fef3[_0x0ae6('0x30')]){delete _0x29fef3[_0x0ae6('0x30')];}_0x4df796['status'](_0x2428b2)['send'](_0x29fef3);};}exports[_0x0ae6('0x31')]=function(_0x419384,_0x4e6df8){var _0x4a06f1={},_0x1ca059={},_0x278577={'count':0x0,'rows':[]};var _0x714c6d=_[_0x0ae6('0x32')](db['VoiceMail'][_0x0ae6('0x33')],function(_0x429f06){return{'name':_0x429f06[_0x0ae6('0x34')],'type':_0x429f06['type'][_0x0ae6('0x35')]};});_0x1ca059[_0x0ae6('0x36')]=_[_0x0ae6('0x32')](_0x714c6d,_0x0ae6('0x30'));_0x1ca059[_0x0ae6('0x37')]=_[_0x0ae6('0x38')](_0x419384[_0x0ae6('0x37')]);_0x1ca059[_0x0ae6('0x39')]=_[_0x0ae6('0x3a')](_0x1ca059[_0x0ae6('0x36')],_0x1ca059['query']);_0x4a06f1[_0x0ae6('0x3b')]=_[_0x0ae6('0x3a')](_0x1ca059['model'],qs[_0x0ae6('0x3c')](_0x419384[_0x0ae6('0x37')][_0x0ae6('0x3c')]));_0x4a06f1['attributes']=_0x4a06f1[_0x0ae6('0x3b')]['length']?_0x4a06f1['attributes']:_0x1ca059[_0x0ae6('0x36')];if(!_0x419384[_0x0ae6('0x37')][_0x0ae6('0x3d')](_0x0ae6('0x3e'))){_0x4a06f1[_0x0ae6('0x22')]=qs['limit'](_0x419384['query'][_0x0ae6('0x22')]);_0x4a06f1['offset']=qs[_0x0ae6('0x20')](_0x419384['query'][_0x0ae6('0x20')]);}_0x4a06f1['order']=qs[_0x0ae6('0x3f')](_0x419384[_0x0ae6('0x37')][_0x0ae6('0x3f')]);_0x4a06f1[_0x0ae6('0x40')]=qs['filters'](_['pick'](_0x419384[_0x0ae6('0x37')],_0x1ca059[_0x0ae6('0x39')]),_0x714c6d);if(_0x419384[_0x0ae6('0x37')]['filter']){_0x4a06f1[_0x0ae6('0x40')]=_['merge'](_0x4a06f1[_0x0ae6('0x40')],{'$or':_[_0x0ae6('0x32')](_0x714c6d,function(_0x460e3f){if(_0x460e3f[_0x0ae6('0x41')]!==_0x0ae6('0x42')){var _0x1f8258={};_0x1f8258[_0x460e3f['name']]={'$like':'%'+_0x419384[_0x0ae6('0x37')][_0x0ae6('0x43')]+'%'};return _0x1f8258;}})});}_0x4a06f1=_[_0x0ae6('0x44')]({},_0x4a06f1,_0x419384[_0x0ae6('0x45')]);var _0x1ad562={'where':_0x4a06f1[_0x0ae6('0x40')]};return db[_0x0ae6('0x46')][_0x0ae6('0x23')](_0x1ad562)['then'](function(_0x38faeb){_0x278577[_0x0ae6('0x23')]=_0x38faeb;if(_0x419384[_0x0ae6('0x37')][_0x0ae6('0x47')]){_0x4a06f1[_0x0ae6('0x48')]=[{'all':!![]}];}return db[_0x0ae6('0x46')][_0x0ae6('0x49')](_0x4a06f1);})[_0x0ae6('0x29')](function(_0xb38cbb){_0x278577[_0x0ae6('0x4a')]=_0xb38cbb;return _0x278577;})[_0x0ae6('0x29')](respondWithFilteredResult(_0x4e6df8,_0x4a06f1))[_0x0ae6('0x4b')](handleError(_0x4e6df8,null));};exports[_0x0ae6('0x4c')]=function(_0x85d9ce,_0x201e95){var _0x16d225={'raw':!![],'where':{'id':_0x85d9ce[_0x0ae6('0x4d')]['id']}},_0x4235de={};_0x4235de['model']=_[_0x0ae6('0x38')](db[_0x0ae6('0x46')][_0x0ae6('0x33')]);_0x4235de[_0x0ae6('0x37')]=_[_0x0ae6('0x38')](_0x85d9ce[_0x0ae6('0x37')]);_0x4235de['filters']=_[_0x0ae6('0x3a')](_0x4235de[_0x0ae6('0x36')],_0x4235de[_0x0ae6('0x37')]);_0x16d225[_0x0ae6('0x3b')]=_['intersection'](_0x4235de['model'],qs['fields'](_0x85d9ce[_0x0ae6('0x37')][_0x0ae6('0x3c')]));_0x16d225[_0x0ae6('0x3b')]=_0x16d225['attributes'][_0x0ae6('0x4e')]?_0x16d225[_0x0ae6('0x3b')]:_0x4235de['model'];if(_0x85d9ce[_0x0ae6('0x37')][_0x0ae6('0x47')]){_0x16d225['include']=[{'all':!![]}];}_0x16d225=_[_0x0ae6('0x44')]({},_0x16d225,_0x85d9ce[_0x0ae6('0x45')]);return db['VoiceMail'][_0x0ae6('0x4f')](_0x16d225)[_0x0ae6('0x29')](handleEntityNotFound(_0x201e95,null))[_0x0ae6('0x29')](respondWithResult(_0x201e95,null))['catch'](handleError(_0x201e95,null));};exports[_0x0ae6('0x50')]=function(_0x21de54,_0x46075a){return db[_0x0ae6('0x46')][_0x0ae6('0x50')](_0x21de54[_0x0ae6('0x51')],{})[_0x0ae6('0x29')](function(_0x5ababa){var _0x5afd3b=_0x21de54[_0x0ae6('0x52')][_0x0ae6('0x2b')]({'plain':!![]});if(!_0x5afd3b)throw new Error(_0x0ae6('0x53'));if(_0x5afd3b['role']===_0x0ae6('0x52')){var _0x51df5c=_0x5ababa['get']({'plain':!![]});var _0x23454a=_0x0ae6('0x2c');return db[_0x0ae6('0x54')]['find']({'where':{'name':_0x23454a,'userProfileId':_0x5afd3b[_0x0ae6('0x55')]},'raw':!![]})[_0x0ae6('0x29')](function(_0x31a4db){if(_0x31a4db&&_0x31a4db[_0x0ae6('0x56')]===0x0){return db[_0x0ae6('0x2d')][_0x0ae6('0x50')]({'name':_0x51df5c[_0x0ae6('0x30')],'resourceId':_0x51df5c['id'],'type':_0x31a4db[_0x0ae6('0x30')],'sectionId':_0x31a4db['id']},{})[_0x0ae6('0x29')](function(){return _0x5ababa;});}else{return _0x5ababa;}})[_0x0ae6('0x4b')](function(_0x1cc515){logger[_0x0ae6('0x2e')](_0x0ae6('0x57'),_0x1cc515);throw _0x1cc515;});}return _0x5ababa;})[_0x0ae6('0x29')](respondWithResult(_0x46075a,0xc9))[_0x0ae6('0x4b')](handleError(_0x46075a,null));};exports['update']=function(_0x4cbe19,_0x30a9f1){if(_0x4cbe19[_0x0ae6('0x51')]['id']){delete _0x4cbe19[_0x0ae6('0x51')]['id'];}return db[_0x0ae6('0x46')][_0x0ae6('0x4f')]({'where':{'id':_0x4cbe19[_0x0ae6('0x4d')]['id']}})[_0x0ae6('0x29')](handleEntityNotFound(_0x30a9f1,null))[_0x0ae6('0x29')](saveUpdates(_0x4cbe19[_0x0ae6('0x51')],null))[_0x0ae6('0x29')](respondWithResult(_0x30a9f1,null))[_0x0ae6('0x4b')](handleError(_0x30a9f1,null));};exports[_0x0ae6('0x2a')]=function(_0x16a311,_0x2babcc){return db[_0x0ae6('0x46')][_0x0ae6('0x4f')]({'where':{'id':_0x16a311[_0x0ae6('0x4d')]['id']}})[_0x0ae6('0x29')](handleEntityNotFound(_0x2babcc,null))['then'](removeEntity(_0x2babcc,null))[_0x0ae6('0x4b')](handleError(_0x2babcc,null));};exports[_0x0ae6('0x58')]=function(_0x15191e,_0x578125,_0x2648de){return db[_0x0ae6('0x46')][_0x0ae6('0x59')]({'where':{'id':_0x15191e[_0x0ae6('0x4d')]['id']}})[_0x0ae6('0x29')](handleEntityNotFound(_0x578125,null))[_0x0ae6('0x29')](function(_0x5ec716){var _0x456d2a;var _0x2132d6={},_0x1c53bf={};_0x1c53bf[_0x0ae6('0x36')]=_[_0x0ae6('0x38')](db[_0x0ae6('0x5a')][_0x0ae6('0x33')]);_0x1c53bf[_0x0ae6('0x37')]=_[_0x0ae6('0x38')](_0x15191e['query']);_0x1c53bf['filters']=_[_0x0ae6('0x3a')](_0x1c53bf[_0x0ae6('0x36')],_0x1c53bf['query']);_0x2132d6['attributes']=_[_0x0ae6('0x3a')](_0x1c53bf[_0x0ae6('0x36')],qs[_0x0ae6('0x3c')](_0x15191e[_0x0ae6('0x37')][_0x0ae6('0x3c')]));_0x2132d6[_0x0ae6('0x3b')]=_0x2132d6[_0x0ae6('0x3b')]['length']?_0x2132d6[_0x0ae6('0x3b')]:_0x1c53bf['model'];if(!_0x15191e[_0x0ae6('0x37')][_0x0ae6('0x3d')]('nolimit')){_0x2132d6[_0x0ae6('0x22')]=qs[_0x0ae6('0x22')](_0x15191e[_0x0ae6('0x37')]['limit']);_0x2132d6[_0x0ae6('0x20')]=qs['offset'](_0x15191e[_0x0ae6('0x37')][_0x0ae6('0x20')]);}_0x2132d6[_0x0ae6('0x5b')]=qs[_0x0ae6('0x3f')](_0x15191e['query']['sort']);_0x2132d6[_0x0ae6('0x40')]=qs[_0x0ae6('0x39')](_[_0x0ae6('0x5c')](_0x15191e[_0x0ae6('0x37')],_0x1c53bf[_0x0ae6('0x39')]));if(_0x15191e[_0x0ae6('0x37')]['filter']){_0x2132d6['where']=_[_0x0ae6('0x44')](_0x2132d6[_0x0ae6('0x40')],{'$or':_[_0x0ae6('0x32')](_0x2132d6[_0x0ae6('0x3b')],function(_0x2bafcc){var _0x15f38f={};_0x15f38f[_0x2bafcc]={'$like':'%'+_0x15191e[_0x0ae6('0x37')][_0x0ae6('0x43')]+'%'};return _0x15f38f;})});}_0x2132d6['where']=_[_0x0ae6('0x44')](_0x2132d6[_0x0ae6('0x40')],{'mailboxuser':_0x5ec716[_0x0ae6('0x5d')]});_0x2132d6=_[_0x0ae6('0x44')]({},_0x2132d6,_0x15191e[_0x0ae6('0x45')]);return db[_0x0ae6('0x5a')]['findAndCountAll'](_0x2132d6)['then'](respondWithFilteredResult(_0x578125,_0x2132d6));})[_0x0ae6('0x4b')](handleError(_0x578125,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index f3f93db..dc69f11 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 _0x8dce=['../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','context','lodash','bluebird','path'];(function(_0x163f07,_0x4dcb41){var _0x56427a=function(_0x126e04){while(--_0x126e04){_0x163f07['push'](_0x163f07['shift']());}};_0x56427a(++_0x4dcb41);}(_0x8dce,0x11b));var _0xe8dc=function(_0x17a7d7,_0x428e0d){_0x17a7d7=_0x17a7d7-0x0;var _0x5d18f3=_0x8dce[_0x17a7d7];return _0x5d18f3;};'use strict';var _=require(_0xe8dc('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xe8dc('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe8dc('0x2'));var rimraf=require('rimraf');var config=require(_0xe8dc('0x3'));var attributes=require(_0xe8dc('0x4'));module[_0xe8dc('0x5')]=function(_0x20edec,_0x1cd8b9){return _0x20edec[_0xe8dc('0x6')](_0xe8dc('0x7'),attributes,{'tableName':_0xe8dc('0x8'),'paranoid':![],'indexes':[{'name':_0xe8dc('0x9'),'fields':['mailbox',_0xe8dc('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8834=['../../config/environment','exports','define','voice_voicemail','mailbox','context','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x118005,_0x3f3def){var _0x3b1c50=function(_0x557950){while(--_0x557950){_0x118005['push'](_0x118005['shift']());}};_0x3b1c50(++_0x3f3def);}(_0x8834,0x1c9));var _0x4883=function(_0x3692a5,_0xf715e8){_0x3692a5=_0x3692a5-0x0;var _0x1472d3=_0x8834[_0x3692a5];return _0x1472d3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4883('0x0'))('api');var moment=require(_0x4883('0x1'));var BPromise=require(_0x4883('0x2'));var rp=require(_0x4883('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4883('0x4'));var config=require(_0x4883('0x5'));var attributes=require('./voiceMail.attributes');module[_0x4883('0x6')]=function(_0x2c8b09,_0x1c282a){return _0x2c8b09[_0x4883('0x7')]('VoiceMail',attributes,{'tableName':_0x4883('0x8'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x4883('0x9'),_0x4883('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index ccb8e91..cb013b5 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 _0xb695=['stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','info','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s'];(function(_0x1e6a0a,_0x529017){var _0x400508=function(_0x21bbe9){while(--_0x21bbe9){_0x1e6a0a['push'](_0x1e6a0a['shift']());}};_0x400508(++_0x529017);}(_0xb695,0x7d));var _0x5b69=function(_0x2a93e6,_0x5ecfbd){_0x2a93e6=_0x2a93e6-0x0;var _0x5a11c5=_0xb695[_0x2a93e6];return _0x5a11c5;};'use strict';var _=require(_0x5b69('0x0'));var util=require(_0x5b69('0x1'));var moment=require(_0x5b69('0x2'));var BPromise=require('bluebird');var rs=require(_0x5b69('0x3'));var fs=require('fs');var Redis=require(_0x5b69('0x4'));var db=require(_0x5b69('0x5'))['db'];var utils=require(_0x5b69('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x5b69('0x7'));var client=jayson[_0x5b69('0x8')][_0x5b69('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x309793,_0x3f3978,_0x5af98a){return new BPromise(function(_0x157a62,_0x415db9){return client[_0x5b69('0xa')](_0x309793,_0x5af98a)['then'](function(_0x5516c9){logger[_0x5b69('0xb')]('VoiceMail,\x20%s,\x20%s',_0x3f3978,_0x5b69('0xc'));logger[_0x5b69('0xd')](_0x5b69('0xe'),_0x3f3978,_0x5b69('0xc'),JSON[_0x5b69('0xf')](_0x5516c9));if(_0x5516c9['error']){if(_0x5516c9['error']['code']===0x1f4){logger['error']('VoiceMail,\x20%s,\x20%s',_0x3f3978,_0x5516c9[_0x5b69('0x10')]['message']);return _0x415db9(_0x5516c9[_0x5b69('0x10')][_0x5b69('0x11')]);}logger[_0x5b69('0x10')]('VoiceMail,\x20%s,\x20%s',_0x3f3978,_0x5516c9[_0x5b69('0x10')][_0x5b69('0x11')]);return _0x157a62(_0x5516c9[_0x5b69('0x10')][_0x5b69('0x11')]);}else{logger[_0x5b69('0xb')]('VoiceMail,\x20%s,\x20%s',_0x3f3978,'request\x20sent');_0x157a62(_0x5516c9[_0x5b69('0x12')][_0x5b69('0x11')]);}})[_0x5b69('0x13')](function(_0x47c282){logger['error']('VoiceMail,\x20%s,\x20%s',_0x3f3978,_0x47c282);_0x415db9(_0x47c282);});});} \ No newline at end of file +var _0xc7f5=['info','result','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','http','request','then','VoiceMail,\x20%s,\x20%s','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xc7f5,0x92));var _0x5c7f=function(_0x2dcf8b,_0x477184){_0x2dcf8b=_0x2dcf8b-0x0;var _0x287c68=_0xc7f5[_0x2dcf8b];return _0x287c68;};'use strict';var _=require(_0x5c7f('0x0'));var util=require('util');var moment=require(_0x5c7f('0x1'));var BPromise=require(_0x5c7f('0x2'));var rs=require(_0x5c7f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5c7f('0x4'));var logger=require('../../config/logger')(_0x5c7f('0x5'));var config=require(_0x5c7f('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5c7f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1bda6d,_0x14f1d6,_0x45033e){return new BPromise(function(_0x4c19c3,_0x2729a3){return client[_0x5c7f('0x8')](_0x1bda6d,_0x45033e)[_0x5c7f('0x9')](function(_0x4dc650){logger['info'](_0x5c7f('0xa'),_0x14f1d6,'request\x20sent');logger['debug'](_0x5c7f('0xb'),_0x14f1d6,_0x5c7f('0xc'),JSON[_0x5c7f('0xd')](_0x4dc650));if(_0x4dc650[_0x5c7f('0xe')]){if(_0x4dc650['error']['code']===0x1f4){logger[_0x5c7f('0xe')](_0x5c7f('0xa'),_0x14f1d6,_0x4dc650[_0x5c7f('0xe')][_0x5c7f('0xf')]);return _0x2729a3(_0x4dc650[_0x5c7f('0xe')][_0x5c7f('0xf')]);}logger[_0x5c7f('0xe')]('VoiceMail,\x20%s,\x20%s',_0x14f1d6,_0x4dc650[_0x5c7f('0xe')][_0x5c7f('0xf')]);return _0x4c19c3(_0x4dc650[_0x5c7f('0xe')][_0x5c7f('0xf')]);}else{logger[_0x5c7f('0x10')](_0x5c7f('0xa'),_0x14f1d6,_0x5c7f('0xc'));_0x4c19c3(_0x4dc650[_0x5c7f('0x11')][_0x5c7f('0xf')]);}})['catch'](function(_0x470fe0){logger[_0x5c7f('0xe')]('VoiceMail,\x20%s,\x20%s',_0x14f1d6,_0x470fe0);_0x2729a3(_0x470fe0);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 58ab76d..3ac0de6 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 _0x4f1e=['../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','download','post','create','/:id','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x313760,_0x2bae9a){var _0x39932c=function(_0x526f15){while(--_0x526f15){_0x313760['push'](_0x313760['shift']());}};_0x39932c(++_0x2bae9a);}(_0x4f1e,0xf1));var _0xe4f1=function(_0x253670,_0x1d2eac){_0x253670=_0x253670-0x0;var _0x5895ce=_0x4f1e[_0x253670];return _0x5895ce;};'use strict';var multer=require(_0xe4f1('0x0'));var util=require(_0xe4f1('0x1'));var path=require(_0xe4f1('0x2'));var timeout=require(_0xe4f1('0x3'));var express=require(_0xe4f1('0x4'));var router=express['Router']();var fs_extra=require(_0xe4f1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe4f1('0x6'));var config=require(_0xe4f1('0x7'));var controller=require(_0xe4f1('0x8'));router[_0xe4f1('0x9')]('/',auth[_0xe4f1('0xa')](),controller[_0xe4f1('0xb')]);router[_0xe4f1('0x9')]('/:id',auth[_0xe4f1('0xa')](),controller['show']);router['get']('/:id/download',auth[_0xe4f1('0xa')](),controller[_0xe4f1('0xc')]);router[_0xe4f1('0xd')]('/',auth[_0xe4f1('0xa')](),controller[_0xe4f1('0xe')]);router['put'](_0xe4f1('0xf'),auth['isAuthenticated'](),controller[_0xe4f1('0x10')]);router[_0xe4f1('0x11')](_0xe4f1('0xf'),auth[_0xe4f1('0xa')](),controller['destroy']);module[_0xe4f1('0x12')]=router; \ No newline at end of file +var _0x0ee1=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','/:id','/:id/download','download','create','put','destroy','multer','util','path'];(function(_0xc51235,_0x52c411){var _0x48ed80=function(_0x1fe7a4){while(--_0x1fe7a4){_0xc51235['push'](_0xc51235['shift']());}};_0x48ed80(++_0x52c411);}(_0x0ee1,0x1bf));var _0x10ee=function(_0xf9cb7a,_0x155fd9){_0xf9cb7a=_0xf9cb7a-0x0;var _0x337245=_0x0ee1[_0xf9cb7a];return _0x337245;};'use strict';var multer=require(_0x10ee('0x0'));var util=require(_0x10ee('0x1'));var path=require(_0x10ee('0x2'));var timeout=require(_0x10ee('0x3'));var express=require(_0x10ee('0x4'));var router=express['Router']();var fs_extra=require(_0x10ee('0x5'));var auth=require(_0x10ee('0x6'));var interaction=require(_0x10ee('0x7'));var config=require(_0x10ee('0x8'));var controller=require(_0x10ee('0x9'));router[_0x10ee('0xa')]('/',auth[_0x10ee('0xb')](),controller['index']);router[_0x10ee('0xa')](_0x10ee('0xc'),auth[_0x10ee('0xb')](),controller['show']);router['get'](_0x10ee('0xd'),auth['isAuthenticated'](),controller[_0x10ee('0xe')]);router['post']('/',auth[_0x10ee('0xb')](),controller[_0x10ee('0xf')]);router[_0x10ee('0x10')]('/:id',auth[_0x10ee('0xb')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x10ee('0x11')]);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 9f1558d..f3d06b6 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 _0x1bbb=['TIMESTAMP','sequelize','VIRTUAL','INTEGER','STRING','BLOB'];(function(_0x53a0a7,_0x381c85){var _0x115caf=function(_0x15065f){while(--_0x15065f){_0x53a0a7['push'](_0x53a0a7['shift']());}};_0x115caf(++_0x381c85);}(_0x1bbb,0x187));var _0xb1bb=function(_0x4ea9cb,_0x35536e){_0x4ea9cb=_0x4ea9cb-0x0;var _0x392dd6=_0x1bbb[_0x4ea9cb];return _0x392dd6;};'use strict';var Sequelize=require(_0xb1bb('0x0'));module['exports']={'name':{'type':Sequelize[_0xb1bb('0x1')],'get':function(_0x2da2a2){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0xb1bb('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xb1bb('0x3')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xb1bb('0x3')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0xb1bb('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0xb1bb('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xb1bb('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0xb1bb('0x4')]('long'),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0xb1bb('0x3')],'defaultValue':''},'stamp':{'type':_0xb1bb('0x5'),'defaultValue':Sequelize['literal']('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0xbe0a=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP'];(function(_0x332b1a,_0x255af2){var _0x3f2400=function(_0x24316e){while(--_0x24316e){_0x332b1a['push'](_0x332b1a['shift']());}};_0x3f2400(++_0x255af2);}(_0xbe0a,0xde));var _0xabe0=function(_0x2cb00d,_0x320ca2){_0x2cb00d=_0x2cb00d-0x0;var _0x49179d=_0xbe0a[_0x2cb00d];return _0x49179d;};'use strict';var Sequelize=require('sequelize');module[_0xabe0('0x0')]={'name':{'type':Sequelize[_0xabe0('0x1')],'get':function(_0x323822){return this[_0xabe0('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xabe0('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xabe0('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0xabe0('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xabe0('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xabe0('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xabe0('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xabe0('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xabe0('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xabe0('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xabe0('0x5')](_0xabe0('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0xabe0('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xabe0('0x4')],'defaultValue':''},'stamp':{'type':_0xabe0('0x7'),'defaultValue':Sequelize[_0xabe0('0x8')](_0xabe0('0x9'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index a39cd48..aebb188 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 _0x3d4b=['recording','msg_id','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','.wav\x22','eml-format','rimraf','zip-dir','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','differenceBy','keys','query','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','VoiceMailMessage','includeAll','include','findAll','show','catch','create','body','find','params'];(function(_0x2ca2d0,_0x3ea8e4){var _0x521c23=function(_0x5b0731){while(--_0x5b0731){_0x2ca2d0['push'](_0x2ca2d0['shift']());}};_0x521c23(++_0x3ea8e4);}(_0x3d4b,0x164));var _0xb3d4=function(_0x491d95,_0x6e0c5b){_0x491d95=_0x491d95-0x0;var _0x446ebd=_0x3d4b[_0x491d95];return _0x446ebd;};'use strict';var emlformat=require(_0xb3d4('0x0'));var rimraf=require(_0xb3d4('0x1'));var zipdir=require(_0xb3d4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb3d4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb3d4('0x4'));var util=require('util');var path=require(_0xb3d4('0x5'));var sox=require(_0xb3d4('0x6'));var csv=require(_0xb3d4('0x7'));var ejs=require(_0xb3d4('0x8'));var fs=require('fs');var fs_extra=require(_0xb3d4('0x9'));var _=require('lodash');var squel=require(_0xb3d4('0xa'));var crypto=require(_0xb3d4('0xb'));var jsforce=require(_0xb3d4('0xc'));var deskjs=require(_0xb3d4('0xd'));var toCsv=require(_0xb3d4('0x7'));var querystring=require(_0xb3d4('0xe'));var Papa=require(_0xb3d4('0xf'));var Redis=require(_0xb3d4('0x10'));var authService=require(_0xb3d4('0x11'));var qs=require(_0xb3d4('0x12'));var as=require(_0xb3d4('0x13'));var hardwareService=require(_0xb3d4('0x14'));var logger=require(_0xb3d4('0x15'))(_0xb3d4('0x16'));var utils=require(_0xb3d4('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xb3d4('0x18'));var db=require(_0xb3d4('0x19'))['db'];function respondWithStatusCode(_0x12ab31,_0x396fe1){_0x396fe1=_0x396fe1||0xcc;return function(_0x36c514){if(_0x36c514){return _0x12ab31['sendStatus'](_0x396fe1);}return _0x12ab31[_0xb3d4('0x1a')](_0x396fe1)[_0xb3d4('0x1b')]();};}function respondWithResult(_0x5bbbf7,_0x4c34f5){_0x4c34f5=_0x4c34f5||0xc8;return function(_0x101e3e){if(_0x101e3e){return _0x5bbbf7[_0xb3d4('0x1a')](_0x4c34f5)['json'](_0x101e3e);}};}function respondWithFilteredResult(_0x5cc12e,_0x620e17){return function(_0x4fba72){if(_0x4fba72){var _0x377155=typeof _0x620e17[_0xb3d4('0x1c')]===_0xb3d4('0x1d')&&typeof _0x620e17[_0xb3d4('0x1e')]===_0xb3d4('0x1d');var _0x3e5832=_0x4fba72[_0xb3d4('0x1f')];var _0xdb5579=_0x377155?0x0:_0x620e17['offset'];var _0x3151a5=_0x377155?_0x4fba72[_0xb3d4('0x1f')]:_0x620e17['offset']+_0x620e17[_0xb3d4('0x1e')];var _0x486b85;if(_0x3151a5>=_0x3e5832){_0x3151a5=_0x3e5832;_0x486b85=0xc8;}else{_0x486b85=0xce;}_0x5cc12e[_0xb3d4('0x1a')](_0x486b85);return _0x5cc12e[_0xb3d4('0x20')](_0xb3d4('0x21'),_0xdb5579+'-'+_0x3151a5+'/'+_0x3e5832)[_0xb3d4('0x22')](_0x4fba72);}return null;};}function patchUpdates(_0x5bce8a){return function(_0x2896bb){try{jsonpatch[_0xb3d4('0x23')](_0x2896bb,_0x5bce8a,!![]);}catch(_0x20866d){return BPromise[_0xb3d4('0x24')](_0x20866d);}return _0x2896bb[_0xb3d4('0x25')]();};}function saveUpdates(_0x2cd036,_0xe4843d){return function(_0x48c608){if(_0x48c608){return _0x48c608[_0xb3d4('0x26')](_0x2cd036)[_0xb3d4('0x27')](function(_0x493033){return _0x493033;});}return null;};}function removeEntity(_0x48d254,_0x366b27){return function(_0x34c9c0){if(_0x34c9c0){return _0x34c9c0[_0xb3d4('0x28')]()[_0xb3d4('0x27')](function(){_0x48d254[_0xb3d4('0x1a')](0xcc)[_0xb3d4('0x1b')]();});}};}function handleEntityNotFound(_0x3c3f18,_0x37ad39){return function(_0x346a8c){if(!_0x346a8c){_0x3c3f18[_0xb3d4('0x29')](0x194);}return _0x346a8c;};}function handleError(_0x4bb9dd,_0x437669){_0x437669=_0x437669||0x1f4;return function(_0x1e203a){logger[_0xb3d4('0x2a')](_0x1e203a[_0xb3d4('0x2b')]);if(_0x1e203a[_0xb3d4('0x2c')]){delete _0x1e203a[_0xb3d4('0x2c')];}_0x4bb9dd[_0xb3d4('0x1a')](_0x437669)[_0xb3d4('0x2d')](_0x1e203a);};}exports[_0xb3d4('0x2e')]=function(_0x414da0,_0x4aa00a){var _0x30eaeb={},_0x2626d7={},_0x20fc74={'count':0x0,'rows':[]};var _0x11d11d=_[_0xb3d4('0x2f')](db['VoiceMailMessage'][_0xb3d4('0x30')],function(_0x44da8b){return{'name':_0x44da8b[_0xb3d4('0x31')],'type':_0x44da8b[_0xb3d4('0x32')][_0xb3d4('0x33')]};});_0x2626d7[_0xb3d4('0x34')]=_[_0xb3d4('0x35')](_[_0xb3d4('0x2f')](_0x11d11d,_0xb3d4('0x2c')),['name']);_0x2626d7['query']=_[_0xb3d4('0x36')](_0x414da0[_0xb3d4('0x37')]);_0x2626d7[_0xb3d4('0x38')]=_[_0xb3d4('0x39')](_0x2626d7['model'],_0x2626d7[_0xb3d4('0x37')]);_0x30eaeb['attributes']=_[_0xb3d4('0x39')](_0x2626d7[_0xb3d4('0x34')],qs[_0xb3d4('0x3a')](_0x414da0['query'][_0xb3d4('0x3a')]));_0x30eaeb[_0xb3d4('0x3b')]=_0x30eaeb[_0xb3d4('0x3b')][_0xb3d4('0x3c')]?_0x30eaeb['attributes']:_0x2626d7[_0xb3d4('0x34')];if(!_0x414da0[_0xb3d4('0x37')]['hasOwnProperty'](_0xb3d4('0x3d'))){_0x30eaeb[_0xb3d4('0x1e')]=qs[_0xb3d4('0x1e')](_0x414da0[_0xb3d4('0x37')][_0xb3d4('0x1e')]);_0x30eaeb[_0xb3d4('0x1c')]=qs[_0xb3d4('0x1c')](_0x414da0['query']['offset']);}_0x30eaeb['order']=qs[_0xb3d4('0x3e')](_0x414da0[_0xb3d4('0x37')]['sort']);_0x30eaeb[_0xb3d4('0x3f')]=qs['filters'](_[_0xb3d4('0x40')](_0x414da0[_0xb3d4('0x37')],_0x2626d7['filters']),_0x11d11d);if(_0x414da0['query'][_0xb3d4('0x41')]){_0x30eaeb[_0xb3d4('0x3f')]=_['merge'](_0x30eaeb[_0xb3d4('0x3f')],{'$or':_[_0xb3d4('0x2f')](_0x11d11d,function(_0x2f444f){if(_0x2f444f['type']!==_0xb3d4('0x42')){var _0x268d0d={};_0x268d0d[_0x2f444f[_0xb3d4('0x2c')]]={'$like':'%'+_0x414da0[_0xb3d4('0x37')]['filter']+'%'};return _0x268d0d;}})});}_0x30eaeb=_[_0xb3d4('0x43')]({},_0x30eaeb,_0x414da0[_0xb3d4('0x44')]);var _0x5bccd7={'where':_0x30eaeb[_0xb3d4('0x3f')]};return db[_0xb3d4('0x45')][_0xb3d4('0x1f')](_0x5bccd7)[_0xb3d4('0x27')](function(_0xb96a82){_0x20fc74[_0xb3d4('0x1f')]=_0xb96a82;if(_0x414da0[_0xb3d4('0x37')][_0xb3d4('0x46')]){_0x30eaeb[_0xb3d4('0x47')]=[{'all':!![]}];}return db[_0xb3d4('0x45')][_0xb3d4('0x48')](_0x30eaeb);})[_0xb3d4('0x27')](function(_0x9ef747){_0x20fc74['rows']=_0x9ef747;return _0x20fc74;})[_0xb3d4('0x27')](respondWithFilteredResult(_0x4aa00a,_0x30eaeb))['catch'](handleError(_0x4aa00a,null));};exports[_0xb3d4('0x49')]=function(_0x4edf6d,_0x42d4fd){var _0x2d53b7={'raw':!![],'where':{'id':_0x4edf6d['params']['id']}},_0x5b6303={};_0x5b6303[_0xb3d4('0x34')]=_[_0xb3d4('0x36')](db[_0xb3d4('0x45')][_0xb3d4('0x30')]);_0x5b6303[_0xb3d4('0x37')]=_['keys'](_0x4edf6d['query']);_0x5b6303[_0xb3d4('0x38')]=_[_0xb3d4('0x39')](_0x5b6303[_0xb3d4('0x34')],_0x5b6303[_0xb3d4('0x37')]);_0x2d53b7[_0xb3d4('0x3b')]=_[_0xb3d4('0x39')](_0x5b6303[_0xb3d4('0x34')],qs[_0xb3d4('0x3a')](_0x4edf6d[_0xb3d4('0x37')][_0xb3d4('0x3a')]));_0x2d53b7['attributes']=_0x2d53b7[_0xb3d4('0x3b')][_0xb3d4('0x3c')]?_0x2d53b7[_0xb3d4('0x3b')]:_0x5b6303['model'];if(_0x4edf6d[_0xb3d4('0x37')][_0xb3d4('0x46')]){_0x2d53b7[_0xb3d4('0x47')]=[{'all':!![]}];}_0x2d53b7=_[_0xb3d4('0x43')]({},_0x2d53b7,_0x4edf6d['options']);return db[_0xb3d4('0x45')]['find'](_0x2d53b7)[_0xb3d4('0x27')](handleEntityNotFound(_0x42d4fd,null))[_0xb3d4('0x27')](respondWithResult(_0x42d4fd,null))[_0xb3d4('0x4a')](handleError(_0x42d4fd,null));};exports[_0xb3d4('0x4b')]=function(_0x46d08b,_0x264fdc){return db['VoiceMailMessage'][_0xb3d4('0x4b')](_0x46d08b[_0xb3d4('0x4c')],{})[_0xb3d4('0x27')](respondWithResult(_0x264fdc,0xc9))[_0xb3d4('0x4a')](handleError(_0x264fdc,null));};exports['update']=function(_0x28a1bb,_0x339026){if(_0x28a1bb[_0xb3d4('0x4c')]['id']){delete _0x28a1bb['body']['id'];}return db['VoiceMailMessage'][_0xb3d4('0x4d')]({'where':{'id':_0x28a1bb[_0xb3d4('0x4e')]['id']}})[_0xb3d4('0x27')](handleEntityNotFound(_0x339026,null))[_0xb3d4('0x27')](saveUpdates(_0x28a1bb[_0xb3d4('0x4c')],null))[_0xb3d4('0x27')](respondWithResult(_0x339026,null))[_0xb3d4('0x4a')](handleError(_0x339026,null));};exports[_0xb3d4('0x28')]=function(_0x5b75a7,_0x2495bb){return db['VoiceMailMessage']['find']({'where':{'id':_0x5b75a7[_0xb3d4('0x4e')]['id']}})[_0xb3d4('0x27')](handleEntityNotFound(_0x2495bb,null))[_0xb3d4('0x27')](removeEntity(_0x2495bb,null))[_0xb3d4('0x4a')](handleError(_0x2495bb,null));};exports['download']=function(_0x2d8ad8,_0x1b5519,_0x46b5b0){return db[_0xb3d4('0x45')][_0xb3d4('0x4d')]({'where':{'id':_0x2d8ad8[_0xb3d4('0x4e')]['id']},'attributes':['id',_0xb3d4('0x4f'),_0xb3d4('0x50')]})[_0xb3d4('0x27')](handleEntityNotFound(_0x1b5519,null))['then'](function(_0x3d310d){if(_0x3d310d){if(!_0x3d310d[_0xb3d4('0x4f')]){throw new db['Sequelize'][(_0xb3d4('0x51'))](_0xb3d4('0x52'));}var _0x5a1035={'Content-Type':_0xb3d4('0x53'),'Content-Disposition':_0xb3d4('0x54')};if(_0x3d310d[_0xb3d4('0x50')]){_0x5a1035[_0xb3d4('0x55')]='attachment;\x20filename=\x22'+_0x3d310d[_0xb3d4('0x50')]+_0xb3d4('0x56');}_0x1b5519[_0xb3d4('0x20')](_0x5a1035);return _0x1b5519['send'](new Buffer(_0x3d310d['recording']));}})[_0xb3d4('0x4a')](handleError(_0x1b5519,null));}; \ No newline at end of file +var _0x67c9=['audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','reject','update','destroy','then','end','name','send','index','map','VoiceMailMessage','type','model','differenceBy','keys','query','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','merge','options','includeAll','include','rows','catch','show','rawAttributes','length','create','body','find','params','msg_id','recording','ValidationError'];(function(_0x31991b,_0xaf75d2){var _0x307304=function(_0x2f36c5){while(--_0x2f36c5){_0x31991b['push'](_0x31991b['shift']());}};_0x307304(++_0xaf75d2);}(_0x67c9,0x1df));var _0x967c=function(_0x319cb9,_0x4b8d35){_0x319cb9=_0x319cb9-0x0;var _0x1735fc=_0x67c9[_0x319cb9];return _0x1735fc;};'use strict';var emlformat=require(_0x967c('0x0'));var rimraf=require(_0x967c('0x1'));var zipdir=require(_0x967c('0x2'));var jsonpatch=require(_0x967c('0x3'));var rp=require('request-promise');var moment=require(_0x967c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x967c('0x5'));var util=require(_0x967c('0x6'));var path=require(_0x967c('0x7'));var sox=require(_0x967c('0x8'));var csv=require(_0x967c('0x9'));var ejs=require(_0x967c('0xa'));var fs=require('fs');var fs_extra=require(_0x967c('0xb'));var _=require(_0x967c('0xc'));var squel=require(_0x967c('0xd'));var crypto=require(_0x967c('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x967c('0x9'));var querystring=require(_0x967c('0xf'));var Papa=require(_0x967c('0x10'));var Redis=require(_0x967c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x967c('0x12'));var as=require(_0x967c('0x13'));var hardwareService=require(_0x967c('0x14'));var logger=require(_0x967c('0x15'))(_0x967c('0x16'));var utils=require(_0x967c('0x17'));var config=require(_0x967c('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x967c('0x19'))['db'];function respondWithStatusCode(_0x4824f9,_0x3b5f13){_0x3b5f13=_0x3b5f13||0xcc;return function(_0x489dac){if(_0x489dac){return _0x4824f9['sendStatus'](_0x3b5f13);}return _0x4824f9[_0x967c('0x1a')](_0x3b5f13)['end']();};}function respondWithResult(_0x8c226a,_0x2a1e3e){_0x2a1e3e=_0x2a1e3e||0xc8;return function(_0x15cb91){if(_0x15cb91){return _0x8c226a['status'](_0x2a1e3e)['json'](_0x15cb91);}};}function respondWithFilteredResult(_0x46543c,_0x55f0df){return function(_0x49fa2c){if(_0x49fa2c){var _0x521025=typeof _0x55f0df[_0x967c('0x1b')]===_0x967c('0x1c')&&typeof _0x55f0df[_0x967c('0x1d')]===_0x967c('0x1c');var _0x3d53d4=_0x49fa2c[_0x967c('0x1e')];var _0x305951=_0x521025?0x0:_0x55f0df[_0x967c('0x1b')];var _0x12d5a2=_0x521025?_0x49fa2c[_0x967c('0x1e')]:_0x55f0df['offset']+_0x55f0df[_0x967c('0x1d')];var _0x425fe2;if(_0x12d5a2>=_0x3d53d4){_0x12d5a2=_0x3d53d4;_0x425fe2=0xc8;}else{_0x425fe2=0xce;}_0x46543c['status'](_0x425fe2);return _0x46543c[_0x967c('0x1f')](_0x967c('0x20'),_0x305951+'-'+_0x12d5a2+'/'+_0x3d53d4)[_0x967c('0x21')](_0x49fa2c);}return null;};}function patchUpdates(_0x2f4a00){return function(_0x493859){try{jsonpatch['apply'](_0x493859,_0x2f4a00,!![]);}catch(_0x380672){return BPromise[_0x967c('0x22')](_0x380672);}return _0x493859['save']();};}function saveUpdates(_0x125f83,_0x1ec029){return function(_0x1f185d){if(_0x1f185d){return _0x1f185d[_0x967c('0x23')](_0x125f83)['then'](function(_0x425721){return _0x425721;});}return null;};}function removeEntity(_0x5949d4,_0x256d9e){return function(_0x120c96){if(_0x120c96){return _0x120c96[_0x967c('0x24')]()[_0x967c('0x25')](function(){_0x5949d4[_0x967c('0x1a')](0xcc)[_0x967c('0x26')]();});}};}function handleEntityNotFound(_0x9a19da,_0x399a51){return function(_0x1dc844){if(!_0x1dc844){_0x9a19da['sendStatus'](0x194);}return _0x1dc844;};}function handleError(_0x2228fd,_0x4eb8fd){_0x4eb8fd=_0x4eb8fd||0x1f4;return function(_0x36680b){logger['error'](_0x36680b['stack']);if(_0x36680b[_0x967c('0x27')]){delete _0x36680b[_0x967c('0x27')];}_0x2228fd[_0x967c('0x1a')](_0x4eb8fd)[_0x967c('0x28')](_0x36680b);};}exports[_0x967c('0x29')]=function(_0xb29f6b,_0x44d00b){var _0x2a2683={},_0x4a6f26={},_0x3188f9={'count':0x0,'rows':[]};var _0x573b93=_[_0x967c('0x2a')](db[_0x967c('0x2b')]['rawAttributes'],function(_0x33b43a){return{'name':_0x33b43a['fieldName'],'type':_0x33b43a[_0x967c('0x2c')]['key']};});_0x4a6f26[_0x967c('0x2d')]=_[_0x967c('0x2e')](_[_0x967c('0x2a')](_0x573b93,'name'),['name']);_0x4a6f26['query']=_[_0x967c('0x2f')](_0xb29f6b[_0x967c('0x30')]);_0x4a6f26[_0x967c('0x31')]=_['intersection'](_0x4a6f26['model'],_0x4a6f26[_0x967c('0x30')]);_0x2a2683[_0x967c('0x32')]=_[_0x967c('0x33')](_0x4a6f26['model'],qs[_0x967c('0x34')](_0xb29f6b['query'][_0x967c('0x34')]));_0x2a2683[_0x967c('0x32')]=_0x2a2683[_0x967c('0x32')]['length']?_0x2a2683[_0x967c('0x32')]:_0x4a6f26[_0x967c('0x2d')];if(!_0xb29f6b['query']['hasOwnProperty'](_0x967c('0x35'))){_0x2a2683['limit']=qs[_0x967c('0x1d')](_0xb29f6b[_0x967c('0x30')]['limit']);_0x2a2683['offset']=qs[_0x967c('0x1b')](_0xb29f6b[_0x967c('0x30')][_0x967c('0x1b')]);}_0x2a2683[_0x967c('0x36')]=qs[_0x967c('0x37')](_0xb29f6b[_0x967c('0x30')][_0x967c('0x37')]);_0x2a2683[_0x967c('0x38')]=qs[_0x967c('0x31')](_[_0x967c('0x39')](_0xb29f6b[_0x967c('0x30')],_0x4a6f26[_0x967c('0x31')]),_0x573b93);if(_0xb29f6b[_0x967c('0x30')]['filter']){_0x2a2683[_0x967c('0x38')]=_['merge'](_0x2a2683[_0x967c('0x38')],{'$or':_[_0x967c('0x2a')](_0x573b93,function(_0x334769){if(_0x334769[_0x967c('0x2c')]!=='VIRTUAL'){var _0x309c15={};_0x309c15[_0x334769[_0x967c('0x27')]]={'$like':'%'+_0xb29f6b['query']['filter']+'%'};return _0x309c15;}})});}_0x2a2683=_[_0x967c('0x3a')]({},_0x2a2683,_0xb29f6b[_0x967c('0x3b')]);var _0x4e4dec={'where':_0x2a2683[_0x967c('0x38')]};return db[_0x967c('0x2b')][_0x967c('0x1e')](_0x4e4dec)[_0x967c('0x25')](function(_0x5854b9){_0x3188f9['count']=_0x5854b9;if(_0xb29f6b['query'][_0x967c('0x3c')]){_0x2a2683[_0x967c('0x3d')]=[{'all':!![]}];}return db['VoiceMailMessage']['findAll'](_0x2a2683);})['then'](function(_0x31fe16){_0x3188f9[_0x967c('0x3e')]=_0x31fe16;return _0x3188f9;})['then'](respondWithFilteredResult(_0x44d00b,_0x2a2683))[_0x967c('0x3f')](handleError(_0x44d00b,null));};exports[_0x967c('0x40')]=function(_0x34a2ad,_0x2e2e28){var _0x34522c={'raw':!![],'where':{'id':_0x34a2ad['params']['id']}},_0x53468d={};_0x53468d[_0x967c('0x2d')]=_[_0x967c('0x2f')](db[_0x967c('0x2b')][_0x967c('0x41')]);_0x53468d['query']=_[_0x967c('0x2f')](_0x34a2ad[_0x967c('0x30')]);_0x53468d['filters']=_[_0x967c('0x33')](_0x53468d[_0x967c('0x2d')],_0x53468d[_0x967c('0x30')]);_0x34522c[_0x967c('0x32')]=_[_0x967c('0x33')](_0x53468d[_0x967c('0x2d')],qs[_0x967c('0x34')](_0x34a2ad[_0x967c('0x30')][_0x967c('0x34')]));_0x34522c['attributes']=_0x34522c[_0x967c('0x32')][_0x967c('0x42')]?_0x34522c[_0x967c('0x32')]:_0x53468d[_0x967c('0x2d')];if(_0x34a2ad[_0x967c('0x30')][_0x967c('0x3c')]){_0x34522c[_0x967c('0x3d')]=[{'all':!![]}];}_0x34522c=_[_0x967c('0x3a')]({},_0x34522c,_0x34a2ad[_0x967c('0x3b')]);return db['VoiceMailMessage']['find'](_0x34522c)[_0x967c('0x25')](handleEntityNotFound(_0x2e2e28,null))[_0x967c('0x25')](respondWithResult(_0x2e2e28,null))[_0x967c('0x3f')](handleError(_0x2e2e28,null));};exports['create']=function(_0x23867d,_0x2daaca){return db[_0x967c('0x2b')][_0x967c('0x43')](_0x23867d[_0x967c('0x44')],{})['then'](respondWithResult(_0x2daaca,0xc9))[_0x967c('0x3f')](handleError(_0x2daaca,null));};exports[_0x967c('0x23')]=function(_0x153154,_0x3c4611){if(_0x153154[_0x967c('0x44')]['id']){delete _0x153154['body']['id'];}return db[_0x967c('0x2b')][_0x967c('0x45')]({'where':{'id':_0x153154[_0x967c('0x46')]['id']}})[_0x967c('0x25')](handleEntityNotFound(_0x3c4611,null))[_0x967c('0x25')](saveUpdates(_0x153154['body'],null))[_0x967c('0x25')](respondWithResult(_0x3c4611,null))['catch'](handleError(_0x3c4611,null));};exports[_0x967c('0x24')]=function(_0xccd4e6,_0x2b487c){return db[_0x967c('0x2b')][_0x967c('0x45')]({'where':{'id':_0xccd4e6[_0x967c('0x46')]['id']}})[_0x967c('0x25')](handleEntityNotFound(_0x2b487c,null))[_0x967c('0x25')](removeEntity(_0x2b487c,null))['catch'](handleError(_0x2b487c,null));};exports['download']=function(_0x1b29b4,_0x5d1132,_0x1c4e33){return db[_0x967c('0x2b')][_0x967c('0x45')]({'where':{'id':_0x1b29b4[_0x967c('0x46')]['id']},'attributes':['id','recording',_0x967c('0x47')]})[_0x967c('0x25')](handleEntityNotFound(_0x5d1132,null))[_0x967c('0x25')](function(_0x26f314){if(_0x26f314){if(!_0x26f314[_0x967c('0x48')]){throw new db['Sequelize'][(_0x967c('0x49'))]('VoiceMailMessage\x20not\x20found');}var _0x5e626e={'Content-Type':_0x967c('0x4a'),'Content-Disposition':_0x967c('0x4b')};if(_0x26f314[_0x967c('0x47')]){_0x5e626e[_0x967c('0x4c')]=_0x967c('0x4d')+_0x26f314[_0x967c('0x47')]+_0x967c('0x4e');}_0x5d1132['set'](_0x5e626e);return _0x5d1132['send'](new Buffer(_0x26f314[_0x967c('0x48')]));}})[_0x967c('0x3f')](handleError(_0x5d1132,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index c3cf156..cea3b88 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 _0x6a51=['moment','bluebird','request-promise','path','rimraf','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x6a51,0x164));var _0x16a5=function(_0x5c8827,_0x5bc5d7){_0x5c8827=_0x5c8827-0x0;var _0x50ffd5=_0x6a51[_0x5c8827];return _0x50ffd5;};'use strict';var _=require(_0x16a5('0x0'));var util=require(_0x16a5('0x1'));var logger=require(_0x16a5('0x2'))(_0x16a5('0x3'));var moment=require(_0x16a5('0x4'));var BPromise=require(_0x16a5('0x5'));var rp=require(_0x16a5('0x6'));var fs=require('fs');var path=require(_0x16a5('0x7'));var rimraf=require(_0x16a5('0x8'));var config=require('../../config/environment');var attributes=require(_0x16a5('0x9'));module[_0x16a5('0xa')]=function(_0x5b5870,_0x4fa8f6){return _0x5b5870[_0x16a5('0xb')](_0x16a5('0xc'),attributes,{'tableName':_0x16a5('0xd'),'paranoid':![],'indexes':[{'name':_0x16a5('0xe'),'fields':[_0x16a5('0xe')]}],'timestamps':![]});}; \ No newline at end of file +var _0xc05d=['api','bluebird','request-promise','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','dir','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc05d,0x195));var _0xdc05=function(_0x233de7,_0x31e254){_0x233de7=_0x233de7-0x0;var _0x17775f=_0xc05d[_0x233de7];return _0x17775f;};'use strict';var _=require(_0xdc05('0x0'));var util=require(_0xdc05('0x1'));var logger=require('../../config/logger')(_0xdc05('0x2'));var moment=require('moment');var BPromise=require(_0xdc05('0x3'));var rp=require(_0xdc05('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdc05('0x5'));var attributes=require(_0xdc05('0x6'));module[_0xdc05('0x7')]=function(_0x29e779,_0x576f2a){return _0x29e779[_0xdc05('0x8')](_0xdc05('0x9'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0xdc05('0xa'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 6e82bb6..af48b7c 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 _0xa3f1=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','stringify','error','code','VoiceMailMessage,\x20%s,\x20%s','message'];(function(_0xb41102,_0x107c3f){var _0x42d7cf=function(_0x36aa9d){while(--_0x36aa9d){_0xb41102['push'](_0xb41102['shift']());}};_0x42d7cf(++_0x107c3f);}(_0xa3f1,0x11d));var _0x1a3f=function(_0xfb18d7,_0x3ca73a){_0xfb18d7=_0xfb18d7-0x0;var _0x49c2e4=_0xa3f1[_0xfb18d7];return _0x49c2e4;};'use strict';var _=require(_0x1a3f('0x0'));var util=require('util');var moment=require(_0x1a3f('0x1'));var BPromise=require(_0x1a3f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a3f('0x3'));var db=require(_0x1a3f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1a3f('0x5'))(_0x1a3f('0x6'));var config=require(_0x1a3f('0x7'));var jayson=require(_0x1a3f('0x8'));var client=jayson['client'][_0x1a3f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x24317b,_0x5eb785,_0x159c6f){return new BPromise(function(_0x3d9063,_0x3d8c9d){return client[_0x1a3f('0xa')](_0x24317b,_0x159c6f)[_0x1a3f('0xb')](function(_0x4d59b5){logger[_0x1a3f('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x5eb785,_0x1a3f('0xd'));logger['debug']('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x5eb785,'request\x20sent',JSON[_0x1a3f('0xe')](_0x4d59b5));if(_0x4d59b5[_0x1a3f('0xf')]){if(_0x4d59b5[_0x1a3f('0xf')][_0x1a3f('0x10')]===0x1f4){logger['error'](_0x1a3f('0x11'),_0x5eb785,_0x4d59b5[_0x1a3f('0xf')][_0x1a3f('0x12')]);return _0x3d8c9d(_0x4d59b5[_0x1a3f('0xf')]['message']);}logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x5eb785,_0x4d59b5[_0x1a3f('0xf')]['message']);return _0x3d9063(_0x4d59b5['error'][_0x1a3f('0x12')]);}else{logger[_0x1a3f('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x5eb785,_0x1a3f('0xd'));_0x3d9063(_0x4d59b5['result']['message']);}})['catch'](function(_0x43bc1a){logger[_0x1a3f('0xf')](_0x1a3f('0x11'),_0x5eb785,_0x43bc1a);_0x3d8c9d(_0x43bc1a);});});} \ No newline at end of file +var _0x471c=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4b2b03,_0xbf34ee){var _0x1bf0ed=function(_0x562785){while(--_0x562785){_0x4b2b03['push'](_0x4b2b03['shift']());}};_0x1bf0ed(++_0xbf34ee);}(_0x471c,0x1e2));var _0xc471=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x471c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc471('0x0'));var util=require(_0xc471('0x1'));var moment=require('moment');var BPromise=require(_0xc471('0x2'));var rs=require(_0xc471('0x3'));var fs=require('fs');var Redis=require(_0xc471('0x4'));var db=require(_0xc471('0x5'))['db'];var utils=require(_0xc471('0x6'));var logger=require('../../config/logger')(_0xc471('0x7'));var config=require(_0xc471('0x8'));var jayson=require(_0xc471('0x9'));var client=jayson[_0xc471('0xa')][_0xc471('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b8f7a,_0x5227d8,_0xbb83a6){return new BPromise(function(_0x38cbe9,_0x38a9c0){return client[_0xc471('0xc')](_0x4b8f7a,_0xbb83a6)[_0xc471('0xd')](function(_0x28b929){logger[_0xc471('0xe')](_0xc471('0xf'),_0x5227d8,_0xc471('0x10'));logger['debug'](_0xc471('0x11'),_0x5227d8,_0xc471('0x10'),JSON[_0xc471('0x12')](_0x28b929));if(_0x28b929[_0xc471('0x13')]){if(_0x28b929[_0xc471('0x13')][_0xc471('0x14')]===0x1f4){logger[_0xc471('0x13')](_0xc471('0xf'),_0x5227d8,_0x28b929[_0xc471('0x13')][_0xc471('0x15')]);return _0x38a9c0(_0x28b929[_0xc471('0x13')][_0xc471('0x15')]);}logger[_0xc471('0x13')](_0xc471('0xf'),_0x5227d8,_0x28b929[_0xc471('0x13')][_0xc471('0x15')]);return _0x38cbe9(_0x28b929[_0xc471('0x13')][_0xc471('0x15')]);}else{logger['info'](_0xc471('0xf'),_0x5227d8,'request\x20sent');_0x38cbe9(_0x28b929[_0xc471('0x16')][_0xc471('0x15')]);}})[_0xc471('0x17')](function(_0x21519e){logger['error'](_0xc471('0xf'),_0x5227d8,_0x21519e);_0x38a9c0(_0x21519e);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 370aa93..b5cd3b1 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 _0xcb07=['Router','../../components/auth/service','./voiceMusicOnHold.controller','get','isAuthenticated','/:id','show','getSounds','create','post','addSound','put','update','delete','/:id/sounds/:id2','removeSound','multer','path','connect-timeout','express'];(function(_0x5a8aa3,_0x2294d5){var _0x5d0458=function(_0x62d096){while(--_0x62d096){_0x5a8aa3['push'](_0x5a8aa3['shift']());}};_0x5d0458(++_0x2294d5);}(_0xcb07,0xb0));var _0x7cb0=function(_0x504c88,_0x1c3016){_0x504c88=_0x504c88-0x0;var _0xb5611e=_0xcb07[_0x504c88];return _0xb5611e;};'use strict';var multer=require(_0x7cb0('0x0'));var util=require('util');var path=require(_0x7cb0('0x1'));var timeout=require(_0x7cb0('0x2'));var express=require(_0x7cb0('0x3'));var router=express[_0x7cb0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7cb0('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7cb0('0x6'));router[_0x7cb0('0x7')]('/',auth[_0x7cb0('0x8')](),controller['index']);router[_0x7cb0('0x7')](_0x7cb0('0x9'),auth[_0x7cb0('0x8')](),controller[_0x7cb0('0xa')]);router[_0x7cb0('0x7')]('/:id/sounds',auth[_0x7cb0('0x8')](),controller[_0x7cb0('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7cb0('0xc')]);router[_0x7cb0('0xd')]('/:id/sounds',auth[_0x7cb0('0x8')](),controller[_0x7cb0('0xe')]);router[_0x7cb0('0xf')](_0x7cb0('0x9'),auth[_0x7cb0('0x8')](),controller[_0x7cb0('0x10')]);router[_0x7cb0('0x11')](_0x7cb0('0x9'),auth[_0x7cb0('0x8')](),controller['destroy']);router[_0x7cb0('0x11')](_0x7cb0('0x12'),auth['isAuthenticated'](),controller[_0x7cb0('0x13')]);module['exports']=router; \ No newline at end of file +var _0x90a8=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds','getSounds','post','create','addSound','put','removeSound','exports','multer','util','connect-timeout'];(function(_0x5caf7e,_0x52e1bc){var _0x5c3435=function(_0xb77e11){while(--_0xb77e11){_0x5caf7e['push'](_0x5caf7e['shift']());}};_0x5c3435(++_0x52e1bc);}(_0x90a8,0xad));var _0x890a=function(_0x45442d,_0x39546e){_0x45442d=_0x45442d-0x0;var _0x289f00=_0x90a8[_0x45442d];return _0x289f00;};'use strict';var multer=require(_0x890a('0x0'));var util=require(_0x890a('0x1'));var path=require('path');var timeout=require(_0x890a('0x2'));var express=require(_0x890a('0x3'));var router=express[_0x890a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x890a('0x5'));var interaction=require(_0x890a('0x6'));var config=require(_0x890a('0x7'));var controller=require(_0x890a('0x8'));router[_0x890a('0x9')]('/',auth[_0x890a('0xa')](),controller[_0x890a('0xb')]);router[_0x890a('0x9')](_0x890a('0xc'),auth[_0x890a('0xa')](),controller[_0x890a('0xd')]);router['get'](_0x890a('0xe'),auth['isAuthenticated'](),controller[_0x890a('0xf')]);router[_0x890a('0x10')]('/',auth['isAuthenticated'](),controller[_0x890a('0x11')]);router['post'](_0x890a('0xe'),auth[_0x890a('0xa')](),controller[_0x890a('0x12')]);router[_0x890a('0x13')](_0x890a('0xc'),auth[_0x890a('0xa')](),controller['update']);router['delete'](_0x890a('0xc'),auth[_0x890a('0xa')](),controller['destroy']);router['delete']('/:id/sounds/:id2',auth[_0x890a('0xa')](),controller[_0x890a('0x14')]);module[_0x890a('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 7152709..a7a7610 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 _0x7278=['alpha','TIMESTAMP','BOOLEAN','exports','STRING','files','mp3nb','quietmp3nb','quietmp3','mp3'];(function(_0x14ad3a,_0x3a58ed){var _0x3bcb12=function(_0x19d07f){while(--_0x19d07f){_0x14ad3a['push'](_0x14ad3a['shift']());}};_0x3bcb12(++_0x3a58ed);}(_0x7278,0x11b));var _0x8727=function(_0x5c5fca,_0x3332b8){_0x5c5fca=_0x5c5fca-0x0;var _0x1721de=_0x7278[_0x5c5fca];return _0x1721de;};'use strict';var Sequelize=require('sequelize');module[_0x8727('0x0')]={'name':{'type':Sequelize[_0x8727('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize['ENUM']('custom',_0x8727('0x2'),_0x8727('0x3'),_0x8727('0x4'),_0x8727('0x5'),_0x8727('0x6')),'allowNull':!![],'defaultValue':_0x8727('0x2')},'directory':{'type':Sequelize[_0x8727('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x8727('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x8727('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x8727('0x1')],'allowNull':!![],'defaultValue':_0x8727('0x7')},'format':{'type':Sequelize[_0x8727('0x1')],'allowNull':!![]},'stamp':{'type':_0x8727('0x8')},'defaultEntry':{'type':Sequelize[_0x8727('0x9')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd682=['sequelize','STRING','ENUM','custom','files','mp3nb','quietmp3','alpha','TIMESTAMP','BOOLEAN'];(function(_0x40c7e0,_0x1e97bc){var _0x4e9787=function(_0x3fc279){while(--_0x3fc279){_0x40c7e0['push'](_0x40c7e0['shift']());}};_0x4e9787(++_0x1e97bc);}(_0xd682,0x1b8));var _0x2d68=function(_0x412e27,_0x20a978){_0x412e27=_0x412e27-0x0;var _0x53da42=_0xd682[_0x412e27];return _0x53da42;};'use strict';var Sequelize=require(_0x2d68('0x0'));module['exports']={'name':{'type':Sequelize[_0x2d68('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x2d68('0x2')](_0x2d68('0x3'),_0x2d68('0x4'),_0x2d68('0x5'),'quietmp3nb',_0x2d68('0x6'),'mp3'),'allowNull':!![],'defaultValue':_0x2d68('0x4')},'directory':{'type':Sequelize[_0x2d68('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x2d68('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x2d68('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x2d68('0x1')],'allowNull':!![],'defaultValue':_0x2d68('0x7')},'format':{'type':Sequelize[_0x2d68('0x1')],'allowNull':!![]},'stamp':{'type':_0x2d68('0x8')},'defaultEntry':{'type':Sequelize[_0x2d68('0x9')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 962e9eb..e9f0395 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 _0xdf33=['send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','include','findAll','catch','show','params','keys','fields','includeAll','find','update','body','create','transaction','files','directory','root','server/files/moh','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','readdirSync','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','join','server/files/sounds/converted','%s.%s','basename','extname','symlinkSync','removeSound','id2','format','getSounds','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','destroy','get','MusicOnHolds','UserProfileResource','stack','name'];(function(_0x38af48,_0x400460){var _0x445384=function(_0x464435){while(--_0x464435){_0x38af48['push'](_0x38af48['shift']());}};_0x445384(++_0x400460);}(_0xdf33,0xb5));var _0x3df3=function(_0x237a01,_0x4d01a0){_0x237a01=_0x237a01-0x0;var _0x54c038=_0xdf33[_0x237a01];return _0x54c038;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3df3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3df3('0x1'));var rp=require(_0x3df3('0x2'));var moment=require(_0x3df3('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3df3('0x4'));var path=require(_0x3df3('0x5'));var sox=require(_0x3df3('0x6'));var csv=require(_0x3df3('0x7'));var ejs=require(_0x3df3('0x8'));var fs=require('fs');var fs_extra=require(_0x3df3('0x9'));var _=require('lodash');var squel=require(_0x3df3('0xa'));var crypto=require('crypto');var jsforce=require(_0x3df3('0xb'));var deskjs=require(_0x3df3('0xc'));var toCsv=require(_0x3df3('0x7'));var querystring=require(_0x3df3('0xd'));var Papa=require(_0x3df3('0xe'));var Redis=require(_0x3df3('0xf'));var authService=require(_0x3df3('0x10'));var qs=require(_0x3df3('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3df3('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x3df3('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x3df3('0x14'));var db=require(_0x3df3('0x15'))['db'];function respondWithStatusCode(_0x443938,_0x253df9){_0x253df9=_0x253df9||0xcc;return function(_0x47a69c){if(_0x47a69c){return _0x443938[_0x3df3('0x16')](_0x253df9);}return _0x443938[_0x3df3('0x17')](_0x253df9)[_0x3df3('0x18')]();};}function respondWithResult(_0x54d2fb,_0x811839){_0x811839=_0x811839||0xc8;return function(_0xb52784){if(_0xb52784){return _0x54d2fb[_0x3df3('0x17')](_0x811839)['json'](_0xb52784);}};}function respondWithFilteredResult(_0x48f882,_0x18e2cc){return function(_0x2aefef){if(_0x2aefef){var _0x33ac4d=typeof _0x18e2cc[_0x3df3('0x19')]===_0x3df3('0x1a')&&typeof _0x18e2cc[_0x3df3('0x1b')]===_0x3df3('0x1a');var _0x3d3d51=_0x2aefef['count'];var _0x5103a6=_0x33ac4d?0x0:_0x18e2cc[_0x3df3('0x19')];var _0x5dc4c6=_0x33ac4d?_0x2aefef[_0x3df3('0x1c')]:_0x18e2cc[_0x3df3('0x19')]+_0x18e2cc[_0x3df3('0x1b')];var _0x1d9a23;if(_0x5dc4c6>=_0x3d3d51){_0x5dc4c6=_0x3d3d51;_0x1d9a23=0xc8;}else{_0x1d9a23=0xce;}_0x48f882[_0x3df3('0x17')](_0x1d9a23);return _0x48f882[_0x3df3('0x1d')](_0x3df3('0x1e'),_0x5103a6+'-'+_0x5dc4c6+'/'+_0x3d3d51)[_0x3df3('0x1f')](_0x2aefef);}return null;};}function patchUpdates(_0x1d5914){return function(_0x3644b3){try{jsonpatch['apply'](_0x3644b3,_0x1d5914,!![]);}catch(_0x348589){return BPromise[_0x3df3('0x20')](_0x348589);}return _0x3644b3[_0x3df3('0x21')]();};}function saveUpdates(_0x2b67bb,_0x4da4f8){return function(_0x40147d){if(_0x40147d){return _0x40147d['update'](_0x2b67bb)[_0x3df3('0x22')](function(_0x20cbb4){return _0x20cbb4;});}return null;};}function removeEntity(_0x1052bf,_0x11b31c){return function(_0x274220){if(_0x274220){return _0x274220[_0x3df3('0x23')]()[_0x3df3('0x22')](function(){var _0x1c6513=_0x274220[_0x3df3('0x24')]({'plain':!![]});var _0x353646=_0x3df3('0x25');return db[_0x3df3('0x26')][_0x3df3('0x23')]({'where':{'type':_0x353646,'resourceId':_0x1c6513['id']}})['then'](function(){return _0x274220;});})[_0x3df3('0x22')](function(){_0x1052bf['status'](0xcc)[_0x3df3('0x18')]();});}};}function handleEntityNotFound(_0x167d19,_0x14b352){return function(_0x4d5abf){if(!_0x4d5abf){_0x167d19['sendStatus'](0x194);}return _0x4d5abf;};}function handleError(_0x3d7403,_0x3dd338){_0x3dd338=_0x3dd338||0x1f4;return function(_0x5b55f6){logger['error'](_0x5b55f6[_0x3df3('0x27')]);if(_0x5b55f6[_0x3df3('0x28')]){delete _0x5b55f6[_0x3df3('0x28')];}_0x3d7403[_0x3df3('0x17')](_0x3dd338)[_0x3df3('0x29')](_0x5b55f6);};}exports[_0x3df3('0x2a')]=function(_0x513935,_0x36a917){var _0x19dced={},_0xe471ea={},_0x457200={'count':0x0,'rows':[]};var _0x2dc491=_[_0x3df3('0x2b')](db[_0x3df3('0x2c')][_0x3df3('0x2d')],function(_0x135509){return{'name':_0x135509[_0x3df3('0x2e')],'type':_0x135509['type'][_0x3df3('0x2f')]};});_0xe471ea[_0x3df3('0x30')]=_['map'](_0x2dc491,_0x3df3('0x28'));_0xe471ea[_0x3df3('0x31')]=_['keys'](_0x513935[_0x3df3('0x31')]);_0xe471ea[_0x3df3('0x32')]=_[_0x3df3('0x33')](_0xe471ea['model'],_0xe471ea[_0x3df3('0x31')]);_0x19dced[_0x3df3('0x34')]=_[_0x3df3('0x33')](_0xe471ea['model'],qs['fields'](_0x513935[_0x3df3('0x31')]['fields']));_0x19dced[_0x3df3('0x34')]=_0x19dced[_0x3df3('0x34')][_0x3df3('0x35')]?_0x19dced[_0x3df3('0x34')]:_0xe471ea[_0x3df3('0x30')];if(!_0x513935['query'][_0x3df3('0x36')](_0x3df3('0x37'))){_0x19dced['limit']=qs[_0x3df3('0x1b')](_0x513935[_0x3df3('0x31')][_0x3df3('0x1b')]);_0x19dced['offset']=qs[_0x3df3('0x19')](_0x513935[_0x3df3('0x31')][_0x3df3('0x19')]);}_0x19dced[_0x3df3('0x38')]=qs['sort'](_0x513935['query'][_0x3df3('0x39')]);delete _0x513935[_0x3df3('0x31')][_0x3df3('0x39')];_0x19dced[_0x3df3('0x3a')]=qs[_0x3df3('0x32')](_['pick'](_0x513935['query'],_0xe471ea['filters']),_0x2dc491);if(_0x513935[_0x3df3('0x31')][_0x3df3('0x3b')]){_0x19dced[_0x3df3('0x3a')]=_[_0x3df3('0x3c')](_0x19dced['where'],{'$or':_[_0x3df3('0x2b')](_0x2dc491,function(_0x2b908b){if(_0x2b908b[_0x3df3('0x3d')]!==_0x3df3('0x3e')){var _0x371ba0={};_0x371ba0[_0x2b908b[_0x3df3('0x28')]]={'$like':'%'+_0x513935[_0x3df3('0x31')][_0x3df3('0x3b')]+'%'};return _0x371ba0;}})});}_0x19dced=_[_0x3df3('0x3c')]({},_0x19dced,_0x513935[_0x3df3('0x3f')]);var _0x194dc5={'where':_0x19dced[_0x3df3('0x3a')]};return db[_0x3df3('0x2c')][_0x3df3('0x1c')](_0x194dc5)['then'](function(_0x147ada){_0x457200['count']=_0x147ada;if(_0x513935['query']['includeAll']){_0x19dced[_0x3df3('0x40')]=[{'all':!![]}];}return db[_0x3df3('0x2c')][_0x3df3('0x41')](_0x19dced);})[_0x3df3('0x22')](function(_0x2a4802){_0x457200['rows']=_0x2a4802;return _0x457200;})[_0x3df3('0x22')](respondWithFilteredResult(_0x36a917,_0x19dced))[_0x3df3('0x42')](handleError(_0x36a917,null));};exports[_0x3df3('0x43')]=function(_0x32bbd8,_0x2863c7){var _0x17ae82={'raw':![],'where':{'id':_0x32bbd8[_0x3df3('0x44')]['id']}},_0x2eb83b={};_0x2eb83b[_0x3df3('0x30')]=_['keys'](db[_0x3df3('0x2c')][_0x3df3('0x2d')]);_0x2eb83b[_0x3df3('0x31')]=_[_0x3df3('0x45')](_0x32bbd8[_0x3df3('0x31')]);_0x2eb83b['filters']=_[_0x3df3('0x33')](_0x2eb83b[_0x3df3('0x30')],_0x2eb83b[_0x3df3('0x31')]);_0x17ae82[_0x3df3('0x34')]=_['intersection'](_0x2eb83b[_0x3df3('0x30')],qs[_0x3df3('0x46')](_0x32bbd8[_0x3df3('0x31')][_0x3df3('0x46')]));_0x17ae82['attributes']=_0x17ae82[_0x3df3('0x34')][_0x3df3('0x35')]?_0x17ae82[_0x3df3('0x34')]:_0x2eb83b[_0x3df3('0x30')];if(_0x32bbd8['query'][_0x3df3('0x47')]){_0x17ae82[_0x3df3('0x40')]=[{'all':!![]}];}_0x17ae82=_[_0x3df3('0x3c')]({},_0x17ae82,_0x32bbd8[_0x3df3('0x3f')]);return db[_0x3df3('0x2c')][_0x3df3('0x48')](_0x17ae82)[_0x3df3('0x22')](handleEntityNotFound(_0x2863c7,null))[_0x3df3('0x22')](respondWithResult(_0x2863c7,null))[_0x3df3('0x42')](handleError(_0x2863c7,null));};exports[_0x3df3('0x49')]=function(_0x35e658,_0x704741){if(_0x35e658[_0x3df3('0x4a')]['id']){delete _0x35e658[_0x3df3('0x4a')]['id'];}return db['VoiceMusicOnHold'][_0x3df3('0x48')]({'where':{'id':_0x35e658[_0x3df3('0x44')]['id']}})[_0x3df3('0x22')](handleEntityNotFound(_0x704741,null))['then'](saveUpdates(_0x35e658['body'],null))[_0x3df3('0x22')](respondWithResult(_0x704741,null))[_0x3df3('0x42')](handleError(_0x704741,null));};exports[_0x3df3('0x4b')]=function(_0x53c176,_0x8a8779,_0x52f778){return db['sequelize'][_0x3df3('0x4c')](function(_0x41175a){if(_0x53c176[_0x3df3('0x4a')]['mode']===_0x3df3('0x4d')){_0x53c176['body'][_0x3df3('0x4e')]=path['join'](config[_0x3df3('0x4f')],_0x3df3('0x50'),_0x53c176[_0x3df3('0x4a')][_0x3df3('0x28')]);}return db[_0x3df3('0x2c')][_0x3df3('0x4b')](_0x53c176[_0x3df3('0x4a')],{'transaction':_0x41175a})[_0x3df3('0x22')](function(_0x15eee7){if(_0x53c176['body']['mode']===_0x3df3('0x4d')){fs[_0x3df3('0x51')](_0x15eee7[_0x3df3('0x4e')],parseInt(_0x3df3('0x52'),0x8));}var _0x249e4a=_0x53c176[_0x3df3('0x53')][_0x3df3('0x24')]({'plain':!![]});if(!_0x249e4a)throw new Error(_0x3df3('0x54'));if(_0x249e4a[_0x3df3('0x55')]===_0x3df3('0x53')){var _0x10bcc8=_0x15eee7[_0x3df3('0x24')]({'plain':!![]});return db['UserProfileSection'][_0x3df3('0x48')]({'where':{'name':_0x3df3('0x25'),'userProfileId':_0x249e4a[_0x3df3('0x56')]},'raw':!![]})['then'](function(_0x3209f0){if(_0x3209f0&&_0x3209f0['autoAssociation']===0x0){return db['UserProfileResource'][_0x3df3('0x4b')]({'name':_0x10bcc8[_0x3df3('0x28')],'resourceId':_0x10bcc8['id'],'type':_0x3209f0[_0x3df3('0x28')],'sectionId':_0x3209f0['id']},{})[_0x3df3('0x22')](function(){return _0x15eee7;});}else{return _0x15eee7;}})[_0x3df3('0x42')](function(_0x3afa85){logger['error'](_0x3df3('0x57'),_0x3afa85);});}return _0x15eee7;});})['then'](respondWithResult(_0x8a8779,0xc9))[_0x3df3('0x42')](handleError(_0x8a8779,null));};exports['destroy']=function(_0x27f479,_0x7c3289,_0xb3da50){var _0x595a13;return db['VoiceMusicOnHold'][_0x3df3('0x48')]({'where':{'id':_0x27f479[_0x3df3('0x44')]['id']}})['then'](function(_0x4fd32d){if(_0x4fd32d){return db[_0x3df3('0x58')][_0x3df3('0x4c')](function(_0x58bb82){return _0x4fd32d[_0x3df3('0x23')]({'transaction':_0x58bb82,'raw':!![]})[_0x3df3('0x22')](function(_0x23bba3){if(_0x23bba3['directory']){fs[_0x3df3('0x59')](_0x23bba3[_0x3df3('0x4e')])['forEach'](function(_0x9639d6){fs[_0x3df3('0x5a')](path['join'](_0x23bba3[_0x3df3('0x4e')],_0x9639d6));});fs[_0x3df3('0x5b')](_0x23bba3['directory']);}return _0x23bba3;});})[_0x3df3('0x42')](function(_0x10ecd1){throw new db[(_0x3df3('0x5c'))][(_0x3df3('0x5d'))](_0x10ecd1[_0x3df3('0x5e')]);});}})[_0x3df3('0x22')](handleEntityNotFound(_0x7c3289,null))[_0x3df3('0x22')](removeEntity(_0x7c3289,null))[_0x3df3('0x42')](handleError(_0x7c3289,null));};exports[_0x3df3('0x5f')]=function(_0xfc3a80,_0x3b3a26,_0x4595d4){return db[_0x3df3('0x58')][_0x3df3('0x4c')](function(_0x523255){var _0x2d87a3;return db[_0x3df3('0x2c')][_0x3df3('0x48')]({'where':{'id':_0xfc3a80[_0x3df3('0x44')]['id']}})[_0x3df3('0x22')](function(_0x46a877){if(_0x46a877){_0x2d87a3=_0x46a877;return _0x46a877[_0x3df3('0x5f')](_0xfc3a80[_0x3df3('0x4a')]['id'],{'transaction':_0x523255});}})[_0x3df3('0x22')](function(_0xe07efa){if(_0xe07efa){return db[_0x3df3('0x60')][_0x3df3('0x61')]({'where':{'id':_0xfc3a80['body']['id']},'attributes':['id',_0x3df3('0x28'),_0x3df3('0x62'),_0x3df3('0x63'),_0x3df3('0x64')],'raw':!![]});}})[_0x3df3('0x22')](function(_0x240f8a){if(_0x240f8a){var _0x47ad59=path[_0x3df3('0x65')](config[_0x3df3('0x4f')],_0x3df3('0x66'),util['format'](_0x3df3('0x67'),path[_0x3df3('0x68')](_0x240f8a[_0x3df3('0x62')],path[_0x3df3('0x69')](_0x240f8a[_0x3df3('0x62')])),_0x240f8a[_0x3df3('0x63')]));var _0x254dd0=path[_0x3df3('0x65')](config[_0x3df3('0x4f')],_0x3df3('0x50'),_0x2d87a3[_0x3df3('0x28')],util['format'](_0x3df3('0x67'),_0x240f8a[_0x3df3('0x28')],_0x240f8a[_0x3df3('0x63')]));fs[_0x3df3('0x6a')](_0x47ad59,_0x254dd0);return _0x240f8a;}})['catch'](function(_0x3b0b40){throw new db[(_0x3df3('0x5c'))][(_0x3df3('0x5d'))](_0x3b0b40['message']);});})[_0x3df3('0x22')](handleEntityNotFound(_0x3b3a26,null))['then'](respondWithResult(_0x3b3a26,0xc9))['catch'](handleError(_0x3b3a26,null));};exports[_0x3df3('0x6b')]=function(_0x1f5b33,_0x49e648,_0x37b702){return db[_0x3df3('0x58')]['transaction'](function(_0x43db9e){var _0xa02925;return db[_0x3df3('0x2c')]['findOne']({'where':{'id':_0x1f5b33[_0x3df3('0x44')]['id']}})[_0x3df3('0x22')](handleEntityNotFound(_0x49e648,null))[_0x3df3('0x22')](function(_0x1ec9c5){if(_0x1ec9c5){_0xa02925=_0x1ec9c5;return _0x1ec9c5[_0x3df3('0x6b')](_0x1f5b33['params'][_0x3df3('0x6c')]);}})[_0x3df3('0x22')](function(_0x1ceb0c){if(_0x1ceb0c){return db[_0x3df3('0x60')][_0x3df3('0x61')]({'where':{'id':_0x1f5b33[_0x3df3('0x44')]['id2']},'attributes':['id','name',_0x3df3('0x62'),_0x3df3('0x63'),_0x3df3('0x64')],'raw':!![]});}})[_0x3df3('0x22')](function(_0x4c86c9){if(_0x4c86c9){fs[_0x3df3('0x5a')](path[_0x3df3('0x65')](_0xa02925['directory'],util[_0x3df3('0x6d')]('%s.%s',_0x4c86c9['name'],_0x4c86c9[_0x3df3('0x63')])));return _0x4c86c9;}})[_0x3df3('0x42')](function(_0x4939de){throw new db[(_0x3df3('0x5c'))][(_0x3df3('0x5d'))](_0x4939de[_0x3df3('0x5e')]);});})[_0x3df3('0x22')](handleEntityNotFound(_0x49e648,null))[_0x3df3('0x22')](respondWithStatusCode(_0x49e648,0xcc))['catch'](handleError(_0x49e648,null));};exports[_0x3df3('0x6e')]=function(_0x4c1811,_0xf17f2e,_0x25b5db){var _0x3c1037={};var _0x104b05={};var _0x398b63;var _0x4b2b23;return db[_0x3df3('0x2c')][_0x3df3('0x61')]({'where':{'id':_0x4c1811['params']['id']}})[_0x3df3('0x22')](handleEntityNotFound(_0xf17f2e,null))[_0x3df3('0x22')](function(_0x48d28a){if(_0x48d28a){_0x398b63=_0x48d28a;_0x104b05[_0x3df3('0x30')]=_[_0x3df3('0x45')](db['Sound']['rawAttributes']);_0x104b05['query']=_[_0x3df3('0x45')](_0x4c1811[_0x3df3('0x31')]);_0x104b05['filters']=_[_0x3df3('0x33')](_0x104b05[_0x3df3('0x30')],_0x104b05[_0x3df3('0x31')]);_0x3c1037['attributes']=_[_0x3df3('0x33')](_0x104b05['model'],qs[_0x3df3('0x46')](_0x4c1811[_0x3df3('0x31')][_0x3df3('0x46')]));_0x3c1037[_0x3df3('0x34')]=_0x3c1037[_0x3df3('0x34')]['length']?_0x3c1037[_0x3df3('0x34')]:_0x104b05[_0x3df3('0x30')];_0x3c1037[_0x3df3('0x38')]=qs[_0x3df3('0x39')](_0x4c1811[_0x3df3('0x31')]['sort']);_0x3c1037['where']=qs[_0x3df3('0x32')](_['pick'](_0x4c1811[_0x3df3('0x31')],_0x104b05[_0x3df3('0x32')]));if(_0x4c1811['query'][_0x3df3('0x3b')]){_0x3c1037[_0x3df3('0x3a')]=_[_0x3df3('0x3c')](_0x3c1037['where'],{'$or':_[_0x3df3('0x2b')](_0x3c1037[_0x3df3('0x34')],function(_0x3cf74d){var _0x2324f5={};_0x2324f5[_0x3cf74d]={'$like':'%'+_0x4c1811['query'][_0x3df3('0x3b')]+'%'};return _0x2324f5;})});}_0x3c1037=_[_0x3df3('0x3c')]({},_0x3c1037,_0x4c1811[_0x3df3('0x3f')]);return _0x398b63[_0x3df3('0x6e')](_0x3c1037);}})['then'](function(_0x9bd959){if(_0x9bd959){_0x4b2b23=_0x9bd959['length'];if(!_0x4c1811[_0x3df3('0x31')][_0x3df3('0x36')](_0x3df3('0x37'))){_0x3c1037[_0x3df3('0x1b')]=qs[_0x3df3('0x1b')](_0x4c1811[_0x3df3('0x31')][_0x3df3('0x1b')]);_0x3c1037[_0x3df3('0x19')]=qs['offset'](_0x4c1811[_0x3df3('0x31')][_0x3df3('0x19')]);}return _0x398b63[_0x3df3('0x6e')](_0x3c1037);}})[_0x3df3('0x22')](function(_0x227eed){if(_0x227eed){return _0x227eed?{'count':_0x4b2b23,'rows':_0x227eed}:null;}})[_0x3df3('0x22')](respondWithResult(_0xf17f2e,null))[_0x3df3('0x42')](handleError(_0xf17f2e,null));}; \ No newline at end of file +var _0x6f1d=['mkdirSync','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','UserProfileResource','error','transaction','readdirSync','forEach','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','%s.%s','basename','extname','format','symlinkSync','removeSound','id2','unlinkSync','getSounds','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','MusicOnHolds','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','findAll','rows','show','params','catch','body','find','create','sequelize','mode','files','directory','join','root','server/files/moh'];(function(_0x4f37d4,_0x5907d2){var _0x5f1efe=function(_0x5afebd){while(--_0x5afebd){_0x4f37d4['push'](_0x4f37d4['shift']());}};_0x5f1efe(++_0x5907d2);}(_0x6f1d,0x177));var _0xd6f1=function(_0x3ac49b,_0x4ee6c8){_0x3ac49b=_0x3ac49b-0x0;var _0x1453df=_0x6f1d[_0x3ac49b];return _0x1453df;};'use strict';var emlformat=require(_0xd6f1('0x0'));var rimraf=require(_0xd6f1('0x1'));var zipdir=require(_0xd6f1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd6f1('0x3'));var BPromise=require(_0xd6f1('0x4'));var Mustache=require(_0xd6f1('0x5'));var util=require(_0xd6f1('0x6'));var path=require(_0xd6f1('0x7'));var sox=require('sox');var csv=require(_0xd6f1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd6f1('0x9'));var _=require(_0xd6f1('0xa'));var squel=require('squel');var crypto=require(_0xd6f1('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd6f1('0xc'));var toCsv=require(_0xd6f1('0x8'));var querystring=require(_0xd6f1('0xd'));var Papa=require(_0xd6f1('0xe'));var Redis=require(_0xd6f1('0xf'));var authService=require(_0xd6f1('0x10'));var qs=require(_0xd6f1('0x11'));var as=require(_0xd6f1('0x12'));var hardwareService=require(_0xd6f1('0x13'));var logger=require(_0xd6f1('0x14'))(_0xd6f1('0x15'));var utils=require(_0xd6f1('0x16'));var config=require(_0xd6f1('0x17'));var licenseUtil=require(_0xd6f1('0x18'));var db=require(_0xd6f1('0x19'))['db'];function respondWithStatusCode(_0x315af7,_0x5ba2e9){_0x5ba2e9=_0x5ba2e9||0xcc;return function(_0x27abad){if(_0x27abad){return _0x315af7[_0xd6f1('0x1a')](_0x5ba2e9);}return _0x315af7[_0xd6f1('0x1b')](_0x5ba2e9)[_0xd6f1('0x1c')]();};}function respondWithResult(_0x5f2ec6,_0x44503d){_0x44503d=_0x44503d||0xc8;return function(_0x5c0bb2){if(_0x5c0bb2){return _0x5f2ec6[_0xd6f1('0x1b')](_0x44503d)[_0xd6f1('0x1d')](_0x5c0bb2);}};}function respondWithFilteredResult(_0xba2f5c,_0x3b7037){return function(_0x108264){if(_0x108264){var _0x28ab1e=typeof _0x3b7037['offset']===_0xd6f1('0x1e')&&typeof _0x3b7037[_0xd6f1('0x1f')]===_0xd6f1('0x1e');var _0x2c9c14=_0x108264[_0xd6f1('0x20')];var _0x3fdedb=_0x28ab1e?0x0:_0x3b7037[_0xd6f1('0x21')];var _0x2cb562=_0x28ab1e?_0x108264[_0xd6f1('0x20')]:_0x3b7037[_0xd6f1('0x21')]+_0x3b7037['limit'];var _0xb6a2e;if(_0x2cb562>=_0x2c9c14){_0x2cb562=_0x2c9c14;_0xb6a2e=0xc8;}else{_0xb6a2e=0xce;}_0xba2f5c['status'](_0xb6a2e);return _0xba2f5c[_0xd6f1('0x22')](_0xd6f1('0x23'),_0x3fdedb+'-'+_0x2cb562+'/'+_0x2c9c14)[_0xd6f1('0x1d')](_0x108264);}return null;};}function patchUpdates(_0x565a53){return function(_0x32225f){try{jsonpatch[_0xd6f1('0x24')](_0x32225f,_0x565a53,!![]);}catch(_0x4e209d){return BPromise[_0xd6f1('0x25')](_0x4e209d);}return _0x32225f['save']();};}function saveUpdates(_0x286d79,_0x56614f){return function(_0x4f7af9){if(_0x4f7af9){return _0x4f7af9[_0xd6f1('0x26')](_0x286d79)[_0xd6f1('0x27')](function(_0x1971b6){return _0x1971b6;});}return null;};}function removeEntity(_0x2d3e8d,_0x4a26d7){return function(_0x5c379d){if(_0x5c379d){return _0x5c379d[_0xd6f1('0x28')]()['then'](function(){var _0x42bc94=_0x5c379d[_0xd6f1('0x29')]({'plain':!![]});var _0x430fa6=_0xd6f1('0x2a');return db['UserProfileResource'][_0xd6f1('0x28')]({'where':{'type':_0x430fa6,'resourceId':_0x42bc94['id']}})[_0xd6f1('0x27')](function(){return _0x5c379d;});})[_0xd6f1('0x27')](function(){_0x2d3e8d[_0xd6f1('0x1b')](0xcc)[_0xd6f1('0x1c')]();});}};}function handleEntityNotFound(_0x54e8a7,_0x330dc5){return function(_0x38b29f){if(!_0x38b29f){_0x54e8a7['sendStatus'](0x194);}return _0x38b29f;};}function handleError(_0x218548,_0x562bd7){_0x562bd7=_0x562bd7||0x1f4;return function(_0x11372b){logger['error'](_0x11372b[_0xd6f1('0x2b')]);if(_0x11372b[_0xd6f1('0x2c')]){delete _0x11372b[_0xd6f1('0x2c')];}_0x218548[_0xd6f1('0x1b')](_0x562bd7)[_0xd6f1('0x2d')](_0x11372b);};}exports[_0xd6f1('0x2e')]=function(_0x338977,_0x678559){var _0x50ab9d={},_0x3704d9={},_0x5b6622={'count':0x0,'rows':[]};var _0x267132=_[_0xd6f1('0x2f')](db[_0xd6f1('0x30')][_0xd6f1('0x31')],function(_0x31c57f){return{'name':_0x31c57f[_0xd6f1('0x32')],'type':_0x31c57f[_0xd6f1('0x33')]['key']};});_0x3704d9[_0xd6f1('0x34')]=_[_0xd6f1('0x2f')](_0x267132,_0xd6f1('0x2c'));_0x3704d9[_0xd6f1('0x35')]=_[_0xd6f1('0x36')](_0x338977['query']);_0x3704d9[_0xd6f1('0x37')]=_[_0xd6f1('0x38')](_0x3704d9[_0xd6f1('0x34')],_0x3704d9['query']);_0x50ab9d[_0xd6f1('0x39')]=_[_0xd6f1('0x38')](_0x3704d9[_0xd6f1('0x34')],qs[_0xd6f1('0x3a')](_0x338977[_0xd6f1('0x35')]['fields']));_0x50ab9d[_0xd6f1('0x39')]=_0x50ab9d[_0xd6f1('0x39')][_0xd6f1('0x3b')]?_0x50ab9d[_0xd6f1('0x39')]:_0x3704d9['model'];if(!_0x338977[_0xd6f1('0x35')][_0xd6f1('0x3c')](_0xd6f1('0x3d'))){_0x50ab9d[_0xd6f1('0x1f')]=qs['limit'](_0x338977[_0xd6f1('0x35')]['limit']);_0x50ab9d['offset']=qs[_0xd6f1('0x21')](_0x338977['query'][_0xd6f1('0x21')]);}_0x50ab9d[_0xd6f1('0x3e')]=qs[_0xd6f1('0x3f')](_0x338977['query'][_0xd6f1('0x3f')]);delete _0x338977['query'][_0xd6f1('0x3f')];_0x50ab9d[_0xd6f1('0x40')]=qs[_0xd6f1('0x37')](_[_0xd6f1('0x41')](_0x338977[_0xd6f1('0x35')],_0x3704d9[_0xd6f1('0x37')]),_0x267132);if(_0x338977['query']['filter']){_0x50ab9d[_0xd6f1('0x40')]=_[_0xd6f1('0x42')](_0x50ab9d[_0xd6f1('0x40')],{'$or':_['map'](_0x267132,function(_0x2453aa){if(_0x2453aa[_0xd6f1('0x33')]!=='VIRTUAL'){var _0x150cff={};_0x150cff[_0x2453aa[_0xd6f1('0x2c')]]={'$like':'%'+_0x338977[_0xd6f1('0x35')][_0xd6f1('0x43')]+'%'};return _0x150cff;}})});}_0x50ab9d=_[_0xd6f1('0x42')]({},_0x50ab9d,_0x338977[_0xd6f1('0x44')]);var _0x3552f5={'where':_0x50ab9d[_0xd6f1('0x40')]};return db[_0xd6f1('0x30')][_0xd6f1('0x20')](_0x3552f5)[_0xd6f1('0x27')](function(_0xccab2c){_0x5b6622['count']=_0xccab2c;if(_0x338977['query'][_0xd6f1('0x45')]){_0x50ab9d['include']=[{'all':!![]}];}return db[_0xd6f1('0x30')][_0xd6f1('0x46')](_0x50ab9d);})[_0xd6f1('0x27')](function(_0x58b0c4){_0x5b6622[_0xd6f1('0x47')]=_0x58b0c4;return _0x5b6622;})[_0xd6f1('0x27')](respondWithFilteredResult(_0x678559,_0x50ab9d))['catch'](handleError(_0x678559,null));};exports[_0xd6f1('0x48')]=function(_0x3bc363,_0x2924a4){var _0x3165b9={'raw':![],'where':{'id':_0x3bc363[_0xd6f1('0x49')]['id']}},_0x5a3494={};_0x5a3494[_0xd6f1('0x34')]=_[_0xd6f1('0x36')](db['VoiceMusicOnHold']['rawAttributes']);_0x5a3494[_0xd6f1('0x35')]=_[_0xd6f1('0x36')](_0x3bc363[_0xd6f1('0x35')]);_0x5a3494['filters']=_[_0xd6f1('0x38')](_0x5a3494[_0xd6f1('0x34')],_0x5a3494['query']);_0x3165b9['attributes']=_['intersection'](_0x5a3494['model'],qs[_0xd6f1('0x3a')](_0x3bc363['query'][_0xd6f1('0x3a')]));_0x3165b9[_0xd6f1('0x39')]=_0x3165b9[_0xd6f1('0x39')][_0xd6f1('0x3b')]?_0x3165b9[_0xd6f1('0x39')]:_0x5a3494['model'];if(_0x3bc363['query'][_0xd6f1('0x45')]){_0x3165b9['include']=[{'all':!![]}];}_0x3165b9=_[_0xd6f1('0x42')]({},_0x3165b9,_0x3bc363[_0xd6f1('0x44')]);return db[_0xd6f1('0x30')]['find'](_0x3165b9)[_0xd6f1('0x27')](handleEntityNotFound(_0x2924a4,null))['then'](respondWithResult(_0x2924a4,null))[_0xd6f1('0x4a')](handleError(_0x2924a4,null));};exports['update']=function(_0x27482e,_0x9336fb){if(_0x27482e[_0xd6f1('0x4b')]['id']){delete _0x27482e[_0xd6f1('0x4b')]['id'];}return db[_0xd6f1('0x30')][_0xd6f1('0x4c')]({'where':{'id':_0x27482e['params']['id']}})[_0xd6f1('0x27')](handleEntityNotFound(_0x9336fb,null))[_0xd6f1('0x27')](saveUpdates(_0x27482e[_0xd6f1('0x4b')],null))[_0xd6f1('0x27')](respondWithResult(_0x9336fb,null))['catch'](handleError(_0x9336fb,null));};exports[_0xd6f1('0x4d')]=function(_0x20b668,_0xfe5183,_0x3144f9){return db[_0xd6f1('0x4e')]['transaction'](function(_0x12a7c4){if(_0x20b668[_0xd6f1('0x4b')][_0xd6f1('0x4f')]===_0xd6f1('0x50')){_0x20b668['body'][_0xd6f1('0x51')]=path[_0xd6f1('0x52')](config[_0xd6f1('0x53')],_0xd6f1('0x54'),_0x20b668[_0xd6f1('0x4b')]['name']);}return db[_0xd6f1('0x30')][_0xd6f1('0x4d')](_0x20b668[_0xd6f1('0x4b')],{'transaction':_0x12a7c4})[_0xd6f1('0x27')](function(_0x147555){if(_0x20b668[_0xd6f1('0x4b')][_0xd6f1('0x4f')]==='files'){fs[_0xd6f1('0x55')](_0x147555['directory'],parseInt(_0xd6f1('0x56'),0x8));}var _0xcb0e18=_0x20b668['user']['get']({'plain':!![]});if(!_0xcb0e18)throw new Error(_0xd6f1('0x57'));if(_0xcb0e18[_0xd6f1('0x58')]===_0xd6f1('0x59')){var _0x3c2655=_0x147555[_0xd6f1('0x29')]({'plain':!![]});return db[_0xd6f1('0x5a')]['find']({'where':{'name':'MusicOnHolds','userProfileId':_0xcb0e18[_0xd6f1('0x5b')]},'raw':!![]})['then'](function(_0x3a98b8){if(_0x3a98b8&&_0x3a98b8['autoAssociation']===0x0){return db[_0xd6f1('0x5c')][_0xd6f1('0x4d')]({'name':_0x3c2655['name'],'resourceId':_0x3c2655['id'],'type':_0x3a98b8[_0xd6f1('0x2c')],'sectionId':_0x3a98b8['id']},{})[_0xd6f1('0x27')](function(){return _0x147555;});}else{return _0x147555;}})['catch'](function(_0x231e32){logger[_0xd6f1('0x5d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x231e32);});}return _0x147555;});})[_0xd6f1('0x27')](respondWithResult(_0xfe5183,0xc9))[_0xd6f1('0x4a')](handleError(_0xfe5183,null));};exports[_0xd6f1('0x28')]=function(_0x5ed690,_0x5ee16f,_0x4925a8){var _0xd49da9;return db[_0xd6f1('0x30')][_0xd6f1('0x4c')]({'where':{'id':_0x5ed690[_0xd6f1('0x49')]['id']}})[_0xd6f1('0x27')](function(_0x112d93){if(_0x112d93){return db[_0xd6f1('0x4e')][_0xd6f1('0x5e')](function(_0x291251){return _0x112d93[_0xd6f1('0x28')]({'transaction':_0x291251,'raw':!![]})[_0xd6f1('0x27')](function(_0x5b146e){if(_0x5b146e['directory']){fs[_0xd6f1('0x5f')](_0x5b146e['directory'])[_0xd6f1('0x60')](function(_0x409684){fs['unlinkSync'](path[_0xd6f1('0x52')](_0x5b146e['directory'],_0x409684));});fs['rmdirSync'](_0x5b146e['directory']);}return _0x5b146e;});})['catch'](function(_0x347ebb){throw new db[(_0xd6f1('0x61'))][(_0xd6f1('0x62'))](_0x347ebb[_0xd6f1('0x63')]);});}})[_0xd6f1('0x27')](handleEntityNotFound(_0x5ee16f,null))[_0xd6f1('0x27')](removeEntity(_0x5ee16f,null))[_0xd6f1('0x4a')](handleError(_0x5ee16f,null));};exports[_0xd6f1('0x64')]=function(_0x125046,_0x1975be,_0x37e781){return db[_0xd6f1('0x4e')][_0xd6f1('0x5e')](function(_0x2f7a1a){var _0x3875f9;return db[_0xd6f1('0x30')][_0xd6f1('0x4c')]({'where':{'id':_0x125046[_0xd6f1('0x49')]['id']}})[_0xd6f1('0x27')](function(_0x51498b){if(_0x51498b){_0x3875f9=_0x51498b;return _0x51498b[_0xd6f1('0x64')](_0x125046[_0xd6f1('0x4b')]['id'],{'transaction':_0x2f7a1a});}})[_0xd6f1('0x27')](function(_0x568fd2){if(_0x568fd2){return db[_0xd6f1('0x65')][_0xd6f1('0x66')]({'where':{'id':_0x125046[_0xd6f1('0x4b')]['id']},'attributes':['id','name',_0xd6f1('0x67'),_0xd6f1('0x68'),_0xd6f1('0x69')],'raw':!![]});}})['then'](function(_0x53896f){if(_0x53896f){var _0x4a2004=path[_0xd6f1('0x52')](config[_0xd6f1('0x53')],'server/files/sounds/converted',util['format'](_0xd6f1('0x6a'),path[_0xd6f1('0x6b')](_0x53896f[_0xd6f1('0x67')],path[_0xd6f1('0x6c')](_0x53896f['save_name'])),_0x53896f['converted_format']));var _0x4f3cd6=path[_0xd6f1('0x52')](config[_0xd6f1('0x53')],_0xd6f1('0x54'),_0x3875f9['name'],util[_0xd6f1('0x6d')](_0xd6f1('0x6a'),_0x53896f['name'],_0x53896f['converted_format']));fs[_0xd6f1('0x6e')](_0x4a2004,_0x4f3cd6);return _0x53896f;}})[_0xd6f1('0x4a')](function(_0x43aeee){throw new db[(_0xd6f1('0x61'))][(_0xd6f1('0x62'))](_0x43aeee[_0xd6f1('0x63')]);});})['then'](handleEntityNotFound(_0x1975be,null))[_0xd6f1('0x27')](respondWithResult(_0x1975be,0xc9))['catch'](handleError(_0x1975be,null));};exports[_0xd6f1('0x6f')]=function(_0x4bfa99,_0x2678c6,_0x53c665){return db[_0xd6f1('0x4e')][_0xd6f1('0x5e')](function(_0x5d1631){var _0xec02af;return db[_0xd6f1('0x30')][_0xd6f1('0x66')]({'where':{'id':_0x4bfa99[_0xd6f1('0x49')]['id']}})[_0xd6f1('0x27')](handleEntityNotFound(_0x2678c6,null))['then'](function(_0x5db02c){if(_0x5db02c){_0xec02af=_0x5db02c;return _0x5db02c[_0xd6f1('0x6f')](_0x4bfa99[_0xd6f1('0x49')]['id2']);}})[_0xd6f1('0x27')](function(_0x48466a){if(_0x48466a){return db[_0xd6f1('0x65')]['findOne']({'where':{'id':_0x4bfa99[_0xd6f1('0x49')][_0xd6f1('0x70')]},'attributes':['id',_0xd6f1('0x2c'),_0xd6f1('0x67'),_0xd6f1('0x68'),_0xd6f1('0x69')],'raw':!![]});}})[_0xd6f1('0x27')](function(_0x36c8b0){if(_0x36c8b0){fs[_0xd6f1('0x71')](path[_0xd6f1('0x52')](_0xec02af[_0xd6f1('0x51')],util[_0xd6f1('0x6d')](_0xd6f1('0x6a'),_0x36c8b0[_0xd6f1('0x2c')],_0x36c8b0['converted_format'])));return _0x36c8b0;}})[_0xd6f1('0x4a')](function(_0x47080d){throw new db[(_0xd6f1('0x61'))]['ValidationError'](_0x47080d[_0xd6f1('0x63')]);});})[_0xd6f1('0x27')](handleEntityNotFound(_0x2678c6,null))['then'](respondWithStatusCode(_0x2678c6,0xcc))['catch'](handleError(_0x2678c6,null));};exports[_0xd6f1('0x72')]=function(_0x487a29,_0x44c957,_0x130c23){var _0x1996cd={};var _0x51c438={};var _0x1800e3;var _0x1064ae;return db['VoiceMusicOnHold'][_0xd6f1('0x66')]({'where':{'id':_0x487a29[_0xd6f1('0x49')]['id']}})[_0xd6f1('0x27')](handleEntityNotFound(_0x44c957,null))[_0xd6f1('0x27')](function(_0x3ee68e){if(_0x3ee68e){_0x1800e3=_0x3ee68e;_0x51c438[_0xd6f1('0x34')]=_[_0xd6f1('0x36')](db['Sound'][_0xd6f1('0x31')]);_0x51c438['query']=_['keys'](_0x487a29[_0xd6f1('0x35')]);_0x51c438[_0xd6f1('0x37')]=_[_0xd6f1('0x38')](_0x51c438[_0xd6f1('0x34')],_0x51c438['query']);_0x1996cd[_0xd6f1('0x39')]=_[_0xd6f1('0x38')](_0x51c438['model'],qs[_0xd6f1('0x3a')](_0x487a29[_0xd6f1('0x35')][_0xd6f1('0x3a')]));_0x1996cd[_0xd6f1('0x39')]=_0x1996cd[_0xd6f1('0x39')][_0xd6f1('0x3b')]?_0x1996cd['attributes']:_0x51c438[_0xd6f1('0x34')];_0x1996cd[_0xd6f1('0x3e')]=qs['sort'](_0x487a29[_0xd6f1('0x35')][_0xd6f1('0x3f')]);_0x1996cd['where']=qs['filters'](_[_0xd6f1('0x41')](_0x487a29[_0xd6f1('0x35')],_0x51c438[_0xd6f1('0x37')]));if(_0x487a29[_0xd6f1('0x35')][_0xd6f1('0x43')]){_0x1996cd[_0xd6f1('0x40')]=_[_0xd6f1('0x42')](_0x1996cd[_0xd6f1('0x40')],{'$or':_[_0xd6f1('0x2f')](_0x1996cd[_0xd6f1('0x39')],function(_0x45963d){var _0x38b33b={};_0x38b33b[_0x45963d]={'$like':'%'+_0x487a29[_0xd6f1('0x35')][_0xd6f1('0x43')]+'%'};return _0x38b33b;})});}_0x1996cd=_['merge']({},_0x1996cd,_0x487a29[_0xd6f1('0x44')]);return _0x1800e3[_0xd6f1('0x72')](_0x1996cd);}})[_0xd6f1('0x27')](function(_0x5607d1){if(_0x5607d1){_0x1064ae=_0x5607d1['length'];if(!_0x487a29['query'][_0xd6f1('0x3c')](_0xd6f1('0x3d'))){_0x1996cd[_0xd6f1('0x1f')]=qs['limit'](_0x487a29[_0xd6f1('0x35')][_0xd6f1('0x1f')]);_0x1996cd[_0xd6f1('0x21')]=qs[_0xd6f1('0x21')](_0x487a29[_0xd6f1('0x35')][_0xd6f1('0x21')]);}return _0x1800e3['getSounds'](_0x1996cd);}})[_0xd6f1('0x27')](function(_0x570b2c){if(_0x570b2c){return _0x570b2c?{'count':_0x1064ae,'rows':_0x570b2c}:null;}})[_0xd6f1('0x27')](respondWithResult(_0x44c957,null))[_0xd6f1('0x4a')](handleError(_0x44c957,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index ebf14ad..2d265ad 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 _0xb3d9=['voice_musiconhold','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','VoiceMusicOnHold'];(function(_0x2776b9,_0x320d90){var _0x587bc6=function(_0x32c3e3){while(--_0x32c3e3){_0x2776b9['push'](_0x2776b9['shift']());}};_0x587bc6(++_0x320d90);}(_0xb3d9,0x1a5));var _0x9b3d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb3d9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x9b3d('0x0'));var util=require(_0x9b3d('0x1'));var logger=require('../../config/logger')(_0x9b3d('0x2'));var moment=require(_0x9b3d('0x3'));var BPromise=require(_0x9b3d('0x4'));var rp=require(_0x9b3d('0x5'));var fs=require('fs');var path=require(_0x9b3d('0x6'));var rimraf=require(_0x9b3d('0x7'));var config=require(_0x9b3d('0x8'));var attributes=require('./voiceMusicOnHold.attributes');module[_0x9b3d('0x9')]=function(_0x2b7524,_0xde53f9){return _0x2b7524['define'](_0x9b3d('0xa'),attributes,{'tableName':_0x9b3d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd239=['lodash','api','bluebird','request-promise','path','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold'];(function(_0x5eede8,_0x549104){var _0x551f6d=function(_0x11418c){while(--_0x11418c){_0x5eede8['push'](_0x5eede8['shift']());}};_0x551f6d(++_0x549104);}(_0xd239,0x82));var _0x9d23=function(_0x4e7c1a,_0x356c24){_0x4e7c1a=_0x4e7c1a-0x0;var _0xfe44dd=_0xd239[_0x4e7c1a];return _0xfe44dd;};'use strict';var _=require(_0x9d23('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9d23('0x1'));var moment=require('moment');var BPromise=require(_0x9d23('0x2'));var rp=require(_0x9d23('0x3'));var fs=require('fs');var path=require(_0x9d23('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9d23('0x5'));module[_0x9d23('0x6')]=function(_0x96c93f,_0x1e7364){return _0x96c93f[_0x9d23('0x7')](_0x9d23('0x8'),attributes,{'tableName':_0x9d23('0x9'),'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 0ec62bf..50d3ee4 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x47b6bb,_0x48ac24){var _0x276587=function(_0x3fdde4){while(--_0x3fdde4){_0x47b6bb['push'](_0x47b6bb['shift']());}};_0x276587(++_0x48ac24);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x687ddc,_0x2092fa){_0x687ddc=_0x687ddc-0x0;var _0x441991=_0xcb91[_0x687ddc];return _0x441991;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file +var _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(_0x128df4,_0x1d4a84){var _0x1e8e3a=function(_0x1b7d94){while(--_0x1b7d94){_0x128df4['push'](_0x128df4['shift']());}};_0x1e8e3a(++_0x1d4a84);}(_0x9c44,0x178));var _0x49c4=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x9c44[_0x273c39];return _0x46d6b5;};'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 diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 190ec01..46d0282 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 _0xa566=['../../config/environment','get','isAuthenticated','/:id','show','/:id/users','/:id/teams','post','create','addAgents','addTeams','put','update','delete','destroy','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0xa566,0x1c1));var _0x6a56=function(_0x2398b9,_0x235238){_0x2398b9=_0x2398b9-0x0;var _0xd79e9c=_0xa566[_0x2398b9];return _0xd79e9c;};'use strict';var multer=require(_0x6a56('0x0'));var util=require(_0x6a56('0x1'));var path=require(_0x6a56('0x2'));var timeout=require('connect-timeout');var express=require(_0x6a56('0x3'));var router=express[_0x6a56('0x4')]();var fs_extra=require(_0x6a56('0x5'));var auth=require(_0x6a56('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6a56('0x7'));var controller=require('./voicePrefix.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x6a56('0x8')]('/describe',auth[_0x6a56('0x9')](),controller['describe']);router[_0x6a56('0x8')](_0x6a56('0xa'),auth['isAuthenticated'](),controller[_0x6a56('0xb')]);router[_0x6a56('0x8')](_0x6a56('0xc'),auth[_0x6a56('0x9')](),controller['getAgents']);router[_0x6a56('0x8')](_0x6a56('0xd'),auth['isAuthenticated'](),controller['getTeams']);router[_0x6a56('0xe')]('/',auth[_0x6a56('0x9')](),controller[_0x6a56('0xf')]);router[_0x6a56('0xe')](_0x6a56('0xc'),auth[_0x6a56('0x9')](),controller[_0x6a56('0x10')]);router['post'](_0x6a56('0xd'),auth[_0x6a56('0x9')](),controller[_0x6a56('0x11')]);router[_0x6a56('0x12')](_0x6a56('0xa'),auth['isAuthenticated'](),controller[_0x6a56('0x13')]);router[_0x6a56('0x14')](_0x6a56('0xa'),auth[_0x6a56('0x9')](),controller[_0x6a56('0x15')]);router['delete']('/:id/users',auth[_0x6a56('0x9')](),controller[_0x6a56('0x16')]);router['delete'](_0x6a56('0xd'),auth[_0x6a56('0x9')](),controller['removeTeams']);module[_0x6a56('0x17')]=router; \ No newline at end of file +var _0xbfda=['getTeams','post','create','/:id/users','addAgents','put','update','delete','destroy','removeAgents','removeTeams','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id','isAuthenticated','show','getAgents','/:id/teams'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xbfda,0x1dc));var _0xabfd=function(_0x19cfac,_0x3745dc){_0x19cfac=_0x19cfac-0x0;var _0x25d2a5=_0xbfda[_0x19cfac];return _0x25d2a5;};'use strict';var multer=require(_0xabfd('0x0'));var util=require(_0xabfd('0x1'));var path=require(_0xabfd('0x2'));var timeout=require('connect-timeout');var express=require(_0xabfd('0x3'));var router=express['Router']();var fs_extra=require(_0xabfd('0x4'));var auth=require(_0xabfd('0x5'));var interaction=require(_0xabfd('0x6'));var config=require(_0xabfd('0x7'));var controller=require('./voicePrefix.controller');router[_0xabfd('0x8')]('/',auth['isAuthenticated'](),controller[_0xabfd('0x9')]);router['get'](_0xabfd('0xa'),auth['isAuthenticated'](),controller[_0xabfd('0xb')]);router[_0xabfd('0x8')](_0xabfd('0xc'),auth[_0xabfd('0xd')](),controller[_0xabfd('0xe')]);router[_0xabfd('0x8')]('/:id/users',auth[_0xabfd('0xd')](),controller[_0xabfd('0xf')]);router[_0xabfd('0x8')](_0xabfd('0x10'),auth[_0xabfd('0xd')](),controller[_0xabfd('0x11')]);router[_0xabfd('0x12')]('/',auth[_0xabfd('0xd')](),controller[_0xabfd('0x13')]);router[_0xabfd('0x12')](_0xabfd('0x14'),auth[_0xabfd('0xd')](),controller[_0xabfd('0x15')]);router['post'](_0xabfd('0x10'),auth[_0xabfd('0xd')](),controller['addTeams']);router[_0xabfd('0x16')](_0xabfd('0xc'),auth[_0xabfd('0xd')](),controller[_0xabfd('0x17')]);router[_0xabfd('0x18')](_0xabfd('0xc'),auth[_0xabfd('0xd')](),controller[_0xabfd('0x19')]);router[_0xabfd('0x18')]('/:id/users',auth[_0xabfd('0xd')](),controller[_0xabfd('0x1a')]);router[_0xabfd('0x18')](_0xabfd('0x10'),auth[_0xabfd('0xd')](),controller[_0xabfd('0x1b')]);module[_0xabfd('0x1c')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index c797ff4..fcc076e 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 _0x5271=['VIRTUAL','getDataValue','sequelize','exports','STRING','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5271,0x1a0));var _0x1527=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0x5271[_0xc8a931];return _0x28bd27;};'use strict';var Sequelize=require(_0x1527('0x0'));module[_0x1527('0x1')]={'name':{'type':Sequelize[_0x1527('0x2')],'allowNull':![],'unique':_0x1527('0x3')},'prefix':{'type':Sequelize[_0x1527('0x4')],'get':function(_0x601067){return'system-'+this[_0x1527('0x5')](_0x1527('0x3'))+'-';}},'description':{'type':Sequelize[_0x1527('0x2')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x259f=['sequelize','exports','STRING','name','VIRTUAL','system-','getDataValue'];(function(_0x105671,_0x17f306){var _0x2c078c=function(_0x9e4884){while(--_0x9e4884){_0x105671['push'](_0x105671['shift']());}};_0x2c078c(++_0x17f306);}(_0x259f,0x10a));var _0xf259=function(_0x5072df,_0x4b6d2c){_0x5072df=_0x5072df-0x0;var _0x80cc8d=_0x259f[_0x5072df];return _0x80cc8d;};'use strict';var Sequelize=require(_0xf259('0x0'));module[_0xf259('0x1')]={'name':{'type':Sequelize[_0xf259('0x2')],'allowNull':![],'unique':_0xf259('0x3')},'prefix':{'type':Sequelize[_0xf259('0x4')],'get':function(_0x85b9aa){return _0xf259('0x5')+this[_0xf259('0x6')]('name')+'-';}},'description':{'type':Sequelize[_0xf259('0x2')]},'callerIdAll':{'type':Sequelize[_0xf259('0x2')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index fa69aab..2109916 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 _0xbbbc=['filters','filter','merge','options','VoicePrefix','includeAll','include','findAll','rows','catch','show','params','find','describe','create','sequelize','transaction','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','VoicePrefixes','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','system','priority','NoOp','Voice\x20Prefix','VoicePrefixId','Extensions\x20creation\x20failed','prefix','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','context','${EXTEN:','charAt','system-','update','findById','addAgents','ids','omit','body','emit','userVoicePrefix:save','removeAgents','isArray','findOne','pick','getAgents','Team','getTeams','hasOwnProperty','addTeams','Agents','online','interface','flatMap','each','TeamVoicePrefix','findOrCreate','forEach','removeTeams','field','from','join','user_has_teams','VoicePrefixId\x20=\x20?','clone','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','userVoicePrefix:remove','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','status','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where'];(function(_0x5409d4,_0x4c6d9b){var _0x121e21=function(_0x2f855b){while(--_0x2f855b){_0x5409d4['push'](_0x5409d4['shift']());}};_0x121e21(++_0x4c6d9b);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x1cafae,_0x5eae36){_0x1cafae=_0x1cafae-0x0;var _0x23af44=_0xbbbc[_0x1cafae];return _0x23af44;};'use strict';var emlformat=require(_0xcbbb('0x0'));var rimraf=require(_0xcbbb('0x1'));var zipdir=require(_0xcbbb('0x2'));var jsonpatch=require(_0xcbbb('0x3'));var rp=require(_0xcbbb('0x4'));var moment=require(_0xcbbb('0x5'));var BPromise=require(_0xcbbb('0x6'));var Mustache=require('mustache');var util=require(_0xcbbb('0x7'));var path=require(_0xcbbb('0x8'));var sox=require(_0xcbbb('0x9'));var csv=require(_0xcbbb('0xa'));var ejs=require(_0xcbbb('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcbbb('0xc'));var squel=require(_0xcbbb('0xd'));var crypto=require(_0xcbbb('0xe'));var jsforce=require(_0xcbbb('0xf'));var deskjs=require(_0xcbbb('0x10'));var toCsv=require(_0xcbbb('0xa'));var querystring=require(_0xcbbb('0x11'));var Papa=require('papaparse');var Redis=require(_0xcbbb('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcbbb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcbbb('0x14'))('api');var utils=require(_0xcbbb('0x15'));var config=require(_0xcbbb('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcbbb('0x17'))['db'];config['redis']=_[_0xcbbb('0x18')](config['redis'],{'host':_0xcbbb('0x19'),'port':0x18eb});var socket=require(_0xcbbb('0x1a'))(new Redis(config[_0xcbbb('0x1b')]));require('./voicePrefix.socket')[_0xcbbb('0x1c')](socket);function respondWithStatusCode(_0x3ff767,_0x8a325c){_0x8a325c=_0x8a325c||0xcc;return function(_0x273e13){if(_0x273e13){return _0x3ff767['sendStatus'](_0x8a325c);}return _0x3ff767['status'](_0x8a325c)[_0xcbbb('0x1d')]();};}function respondWithResult(_0x30297d,_0xf76038){_0xf76038=_0xf76038||0xc8;return function(_0x188698){if(_0x188698){return _0x30297d['status'](_0xf76038)[_0xcbbb('0x1e')](_0x188698);}};}function respondWithFilteredResult(_0x4ff973,_0x1fbfb1){return function(_0x3436af){if(_0x3436af){var _0x3572bb=typeof _0x1fbfb1['offset']==='undefined'&&typeof _0x1fbfb1['limit']===_0xcbbb('0x1f');var _0x3ae91b=_0x3436af[_0xcbbb('0x20')];var _0x25e92f=_0x3572bb?0x0:_0x1fbfb1[_0xcbbb('0x21')];var _0x1cca90=_0x3572bb?_0x3436af[_0xcbbb('0x20')]:_0x1fbfb1[_0xcbbb('0x21')]+_0x1fbfb1[_0xcbbb('0x22')];var _0x2d4335;if(_0x1cca90>=_0x3ae91b){_0x1cca90=_0x3ae91b;_0x2d4335=0xc8;}else{_0x2d4335=0xce;}_0x4ff973['status'](_0x2d4335);return _0x4ff973[_0xcbbb('0x23')](_0xcbbb('0x24'),_0x25e92f+'-'+_0x1cca90+'/'+_0x3ae91b)[_0xcbbb('0x1e')](_0x3436af);}return null;};}function patchUpdates(_0x42aaf1){return function(_0x258d1f){try{jsonpatch[_0xcbbb('0x25')](_0x258d1f,_0x42aaf1,!![]);}catch(_0x297eae){return BPromise[_0xcbbb('0x26')](_0x297eae);}return _0x258d1f[_0xcbbb('0x27')]();};}function saveUpdates(_0x5e3970,_0xf39ddd){return function(_0x4490c1){if(_0x4490c1){return _0x4490c1['update'](_0x5e3970)[_0xcbbb('0x28')](function(_0x4ffa80){return _0x4ffa80;});}return null;};}function removeEntity(_0x48dfc4,_0x575d56){return function(_0x32e070){if(_0x32e070){return _0x32e070['destroy']()['then'](function(){var _0x5499a1=_0x32e070[_0xcbbb('0x29')]({'plain':!![]});var _0x55e1d8='VoicePrefixes';return db[_0xcbbb('0x2a')][_0xcbbb('0x2b')]({'where':{'type':_0x55e1d8,'resourceId':_0x5499a1['id']}})[_0xcbbb('0x28')](function(){return _0x32e070;});})[_0xcbbb('0x28')](function(){_0x48dfc4[_0xcbbb('0x2c')](0xcc)[_0xcbbb('0x1d')]();});}};}function handleEntityNotFound(_0x3d4c0d,_0x1c986d){return function(_0x2a023f){if(!_0x2a023f){_0x3d4c0d[_0xcbbb('0x2d')](0x194);}return _0x2a023f;};}function handleError(_0x1c2ac9,_0xeb8cd8){_0xeb8cd8=_0xeb8cd8||0x1f4;return function(_0xfa973b){logger[_0xcbbb('0x2e')](_0xfa973b[_0xcbbb('0x2f')]);if(_0xfa973b[_0xcbbb('0x30')]){delete _0xfa973b[_0xcbbb('0x30')];}_0x1c2ac9[_0xcbbb('0x2c')](_0xeb8cd8)['send'](_0xfa973b);};}exports[_0xcbbb('0x31')]=function(_0x203a34,_0x5332f9){var _0xec2761={},_0x539dcf={},_0x2d37d3={'count':0x0,'rows':[]};var _0x1fb05e=_[_0xcbbb('0x32')](db['VoicePrefix'][_0xcbbb('0x33')],function(_0xa4743b){return{'name':_0xa4743b[_0xcbbb('0x34')],'type':_0xa4743b[_0xcbbb('0x35')][_0xcbbb('0x36')]};});_0x539dcf[_0xcbbb('0x37')]=_[_0xcbbb('0x32')](_0x1fb05e,_0xcbbb('0x30'));_0x539dcf[_0xcbbb('0x38')]=_[_0xcbbb('0x39')](_0x203a34['query']);_0x539dcf['filters']=_['intersection'](_0x539dcf['model'],_0x539dcf[_0xcbbb('0x38')]);_0xec2761[_0xcbbb('0x3a')]=_[_0xcbbb('0x3b')](_0x539dcf[_0xcbbb('0x37')],qs[_0xcbbb('0x3c')](_0x203a34[_0xcbbb('0x38')][_0xcbbb('0x3c')]));_0xec2761[_0xcbbb('0x3a')]=_0xec2761[_0xcbbb('0x3a')][_0xcbbb('0x3d')]?_0xec2761[_0xcbbb('0x3a')]:_0x539dcf[_0xcbbb('0x37')];if(!_0x203a34['query']['hasOwnProperty'](_0xcbbb('0x3e'))){_0xec2761['limit']=qs['limit'](_0x203a34['query'][_0xcbbb('0x22')]);_0xec2761[_0xcbbb('0x21')]=qs[_0xcbbb('0x21')](_0x203a34[_0xcbbb('0x38')][_0xcbbb('0x21')]);}_0xec2761[_0xcbbb('0x3f')]=qs[_0xcbbb('0x40')](_0x203a34[_0xcbbb('0x38')][_0xcbbb('0x40')]);_0xec2761[_0xcbbb('0x41')]=qs[_0xcbbb('0x42')](_['pick'](_0x203a34[_0xcbbb('0x38')],_0x539dcf['filters']),_0x1fb05e);if(_0x203a34[_0xcbbb('0x38')][_0xcbbb('0x43')]){_0xec2761[_0xcbbb('0x41')]=_[_0xcbbb('0x44')](_0xec2761[_0xcbbb('0x41')],{'$or':_[_0xcbbb('0x32')](_0x1fb05e,function(_0x5651fd){if(_0x5651fd['type']!=='VIRTUAL'){var _0xda1973={};_0xda1973[_0x5651fd[_0xcbbb('0x30')]]={'$like':'%'+_0x203a34[_0xcbbb('0x38')][_0xcbbb('0x43')]+'%'};return _0xda1973;}})});}_0xec2761=_[_0xcbbb('0x44')]({},_0xec2761,_0x203a34[_0xcbbb('0x45')]);var _0x2b45ee={'where':_0xec2761['where']};return db[_0xcbbb('0x46')][_0xcbbb('0x20')](_0x2b45ee)['then'](function(_0x15b3bc){_0x2d37d3[_0xcbbb('0x20')]=_0x15b3bc;if(_0x203a34[_0xcbbb('0x38')][_0xcbbb('0x47')]){_0xec2761[_0xcbbb('0x48')]=[{'all':!![]}];}return db['VoicePrefix'][_0xcbbb('0x49')](_0xec2761);})['then'](function(_0x520448){_0x2d37d3[_0xcbbb('0x4a')]=_0x520448;return _0x2d37d3;})[_0xcbbb('0x28')](respondWithFilteredResult(_0x5332f9,_0xec2761))[_0xcbbb('0x4b')](handleError(_0x5332f9,null));};exports[_0xcbbb('0x4c')]=function(_0xb5391d,_0x406e1c){var _0x2040bf={'raw':![],'where':{'id':_0xb5391d[_0xcbbb('0x4d')]['id']}},_0x3ba75e={};_0x3ba75e[_0xcbbb('0x37')]=_[_0xcbbb('0x39')](db[_0xcbbb('0x46')][_0xcbbb('0x33')]);_0x3ba75e[_0xcbbb('0x38')]=_['keys'](_0xb5391d[_0xcbbb('0x38')]);_0x3ba75e[_0xcbbb('0x42')]=_[_0xcbbb('0x3b')](_0x3ba75e[_0xcbbb('0x37')],_0x3ba75e['query']);_0x2040bf['attributes']=_['intersection'](_0x3ba75e[_0xcbbb('0x37')],qs[_0xcbbb('0x3c')](_0xb5391d[_0xcbbb('0x38')][_0xcbbb('0x3c')]));_0x2040bf[_0xcbbb('0x3a')]=_0x2040bf[_0xcbbb('0x3a')][_0xcbbb('0x3d')]?_0x2040bf['attributes']:_0x3ba75e[_0xcbbb('0x37')];if(_0xb5391d[_0xcbbb('0x38')][_0xcbbb('0x47')]){_0x2040bf[_0xcbbb('0x48')]=[{'all':!![]}];}_0x2040bf=_['merge']({},_0x2040bf,_0xb5391d[_0xcbbb('0x45')]);return db[_0xcbbb('0x46')][_0xcbbb('0x4e')](_0x2040bf)[_0xcbbb('0x28')](handleEntityNotFound(_0x406e1c,null))['then'](respondWithResult(_0x406e1c,null))['catch'](handleError(_0x406e1c,null));};exports[_0xcbbb('0x2b')]=function(_0x421137,_0x3dc052){return db['VoicePrefix']['find']({'where':{'id':_0x421137['params']['id']}})[_0xcbbb('0x28')](handleEntityNotFound(_0x3dc052,null))[_0xcbbb('0x28')](removeEntity(_0x3dc052,null))['catch'](handleError(_0x3dc052,null));};exports[_0xcbbb('0x4f')]=function(_0x35bb94,_0x2dc313){return db[_0xcbbb('0x46')]['describe']()[_0xcbbb('0x28')](respondWithResult(_0x2dc313,null))[_0xcbbb('0x4b')](handleError(_0x2dc313,null));};exports[_0xcbbb('0x50')]=function(_0x3526f5,_0xb267da){var _0x3679f4;return db[_0xcbbb('0x51')][_0xcbbb('0x52')](function(_0x2d3990){return db[_0xcbbb('0x46')][_0xcbbb('0x50')](_0x3526f5['body'],{'transaction':_0x2d3990})['then'](function(_0x3fb0bd){_0x3679f4=_0x3fb0bd[_0xcbbb('0x29')]({'plain':!![]});return db[_0xcbbb('0x53')]['find']({'where':{'id':_0x3679f4[_0xcbbb('0x54')]},'raw':!![]})['then'](function(_0x2a9958){return createVoicePrefixExtensions(_0x3679f4,_0x2a9958,_0x2d3990);});});})[_0xcbbb('0x28')](function(){var _0x317633=_0x3526f5[_0xcbbb('0x55')][_0xcbbb('0x29')]({'plain':!![]});if(!_0x317633)throw new Error(_0xcbbb('0x56'));if(_0x317633['role']==='user'){var _0x4cc098=_0x3679f4;return db[_0xcbbb('0x57')][_0xcbbb('0x4e')]({'where':{'name':_0xcbbb('0x58'),'userProfileId':_0x317633[_0xcbbb('0x59')]},'raw':!![]})[_0xcbbb('0x28')](function(_0x30bc24){if(_0x30bc24&&_0x30bc24[_0xcbbb('0x5a')]===0x0){return db[_0xcbbb('0x2a')][_0xcbbb('0x50')]({'name':_0x4cc098[_0xcbbb('0x30')],'resourceId':_0x4cc098['id'],'type':_0x30bc24[_0xcbbb('0x30')],'sectionId':_0x30bc24['id']},{})[_0xcbbb('0x28')](function(){return _0x3679f4;});}else{return _0x3679f4;}})[_0xcbbb('0x4b')](function(_0x48d295){logger[_0xcbbb('0x2e')](_0xcbbb('0x5b'),_0x48d295);throw _0x48d295;});}return _0x3679f4;})[_0xcbbb('0x28')](respondWithResult(_0xb267da,null))['catch'](handleError(_0xb267da,null));};function Extension(_0x17d714,_0x1dbf9b,_0x5501d5,_0x26f0e6){this['context']=_0xcbbb('0x5c');this[_0xcbbb('0x5d')]=_0x17d714;this['app']=_0x5501d5;this[_0xcbbb('0x35')]=_0xcbbb('0x5e');this['description']='Voice\x20Prefix\x20Extension';this[_0xcbbb('0x5f')]=_0x1dbf9b;this['appdata']=_0x26f0e6;}function createVoicePrefixExtensions(_0x411bc6,_0x4c56fe,_0xb68922){return new BPromise(function(_0x3849d8,_0x20aaa9){var _0x4b4bb7=new Extension(formatPrefixName(_0x411bc6['prefix']),0x1,_0xcbbb('0x60'),_0xcbbb('0x61'));_0x4b4bb7['VoicePrefixId']=_0x411bc6['id'];return db[_0xcbbb('0x53')][_0xcbbb('0x50')](_0x4b4bb7,{'transaction':_0xb68922})[_0xcbbb('0x28')](function(_0x556e48){var _0xe347c6=_0x556e48[_0xcbbb('0x29')]({'plain':!![]});var _0x12ef00=_[_0xcbbb('0x32')](addVoicePrefixExtensions(_0x411bc6,_0x4c56fe),function(_0xf13e52){_0xf13e52[_0xcbbb('0x54')]=_0xe347c6['id'];_0xf13e52[_0xcbbb('0x62')]=_0x411bc6['id'];return _0xf13e52;});return db['VoiceExtension']['bulkCreate'](_0x12ef00,{'transaction':_0xb68922})[_0xcbbb('0x28')](function(_0x2469e5){if(!_0x2469e5){return _0x20aaa9(_0xcbbb('0x63'));}else{return _0x3849d8(_0x2469e5);}})[_0xcbbb('0x4b')](function(_0x4bc7cc){return _0x20aaa9(_0x4bc7cc);});});;});};function addVoicePrefixExtensions(_0x5c6bf7,_0x3781df){var _0x4f6529=[];var _0x5ea915=formatPrefixName(_0x5c6bf7[_0xcbbb('0x64')]);_0x4f6529[_0xcbbb('0x65')](new Extension(_0x5ea915,0x2,_0xcbbb('0x66'),_0xcbbb('0x67')+_0x5c6bf7[_0xcbbb('0x30')]));if(_0x5c6bf7[_0xcbbb('0x68')]){_0x4f6529[_0xcbbb('0x65')](new Extension(_0x5ea915,0x3,'Set',_0xcbbb('0x69')+_0x5c6bf7['callerIdAll']));}else{_0x4f6529[_0xcbbb('0x65')](new Extension(_0x5ea915,0x3,'NoOp',_0xcbbb('0x6a')));}_0x4f6529[_0xcbbb('0x65')](new Extension(_0x5ea915,0x4,_0xcbbb('0x6b'),_0x3781df[_0xcbbb('0x6c')]+','+_0xcbbb('0x6d')+(0x8+_0x5c6bf7[_0xcbbb('0x30')][_0xcbbb('0x3d')])+'}'+','+0x1));return _0x4f6529;}function formatPrefixName(_0x619340){var _0x4ff7db='_';for(var _0x57d776=0x0;_0x57d776<_0x619340[_0xcbbb('0x3d')];_0x57d776++){if(_0x619340[_0xcbbb('0x6e')](_0x57d776)=='-'){_0x4ff7db+=_0x619340[_0xcbbb('0x6e')](_0x57d776);}else{_0x4ff7db+='['+_0x619340[_0xcbbb('0x6e')](_0x57d776)+']';}}_0x4ff7db+='.';return _0x4ff7db;}exports['update']=function(_0x583c33,_0x590fc6,_0x6060d){var _0x2f0db8=_0x583c33['body'];_0x2f0db8[_0xcbbb('0x64')]=_0xcbbb('0x6f')+_0x2f0db8['name']+'-';return db[_0xcbbb('0x51')][_0xcbbb('0x52')](function(_0x4e2198){return db[_0xcbbb('0x46')][_0xcbbb('0x70')](_0x2f0db8,{'where':{'id':_0x2f0db8['id']},'transaction':_0x4e2198})[_0xcbbb('0x28')](function(){return db['VoiceExtension']['destroy']({'where':{'VoicePrefixId':_0x2f0db8['id']},'transaction':_0x4e2198})[_0xcbbb('0x28')](function(){return db[_0xcbbb('0x53')][_0xcbbb('0x4e')]({'where':{'id':_0x2f0db8['VoiceExtensionId']},'raw':!![]})['then'](function(_0x128d79){return createVoicePrefixExtensions(_0x2f0db8,_0x128d79,_0x4e2198);});});});})[_0xcbbb('0x28')](function(){return db[_0xcbbb('0x46')][_0xcbbb('0x71')](_0x2f0db8['id']);})[_0xcbbb('0x28')](respondWithResult(_0x590fc6,null))[_0xcbbb('0x4b')](handleError(_0x590fc6,null));};exports[_0xcbbb('0x72')]=function(_0x194b4b,_0x3e401d,_0x305344){return db[_0xcbbb('0x46')]['find']({'where':{'id':_0x194b4b[_0xcbbb('0x4d')]['id']}})[_0xcbbb('0x28')](handleEntityNotFound(_0x3e401d,null))[_0xcbbb('0x28')](function(_0x3ad059){if(_0x3ad059){return _0x3ad059[_0xcbbb('0x72')](_0x194b4b['body'][_0xcbbb('0x73')],_[_0xcbbb('0x74')](_0x194b4b[_0xcbbb('0x75')],[_0xcbbb('0x73'),'id'])||{})['spread'](function(_0x264c34){for(var _0x22de60=0x0;_0x22de60<_0x194b4b[_0xcbbb('0x75')]['ids']['length'];_0x22de60+=0x1){socket[_0xcbbb('0x76')](_0xcbbb('0x77'),{'UserId':Number(_0x194b4b[_0xcbbb('0x75')][_0xcbbb('0x73')][_0x22de60]),'VoicePrefixId':Number(_0x194b4b['params']['id'])});}return _0x264c34;});}})[_0xcbbb('0x28')](respondWithResult(_0x3e401d,null))[_0xcbbb('0x4b')](handleError(_0x3e401d,null));};exports[_0xcbbb('0x78')]=function(_0x349674,_0x42a9d3,_0x5706e6){return db['VoicePrefix'][_0xcbbb('0x4e')]({'where':{'id':_0x349674[_0xcbbb('0x4d')]['id']}})[_0xcbbb('0x28')](handleEntityNotFound(_0x42a9d3,null))[_0xcbbb('0x28')](function(_0x14eaec){if(_0x14eaec){return _0x14eaec[_0xcbbb('0x78')](_0x349674['query'][_0xcbbb('0x73')])[_0xcbbb('0x28')](function(){if(_[_0xcbbb('0x79')](_0x349674[_0xcbbb('0x38')][_0xcbbb('0x73')])){for(var _0x2b1277=0x0;_0x2b1277<_0x349674[_0xcbbb('0x38')]['ids']['length'];_0x2b1277+=0x1){socket[_0xcbbb('0x76')]('userVoicePrefix:remove',{'UserId':Number(_0x349674['query'][_0xcbbb('0x73')][_0x2b1277]),'VoicePrefixId':Number(_0x349674['params']['id'])});}}else{socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x349674[_0xcbbb('0x38')]['ids']),'VoicePrefixId':Number(_0x349674[_0xcbbb('0x4d')]['id'])});}});}})['then'](respondWithStatusCode(_0x42a9d3,null))['catch'](handleError(_0x42a9d3,null));};exports['getAgents']=function(_0x4de2dd,_0x1c9dd2,_0x14c60b){var _0x56b09b={};var _0x4bb903={};var _0x130f91;var _0x1bffe9;return db['VoicePrefix'][_0xcbbb('0x7a')]({'where':{'id':_0x4de2dd[_0xcbbb('0x4d')]['id']}})[_0xcbbb('0x28')](handleEntityNotFound(_0x1c9dd2,null))[_0xcbbb('0x28')](function(_0x24b949){if(_0x24b949){_0x130f91=_0x24b949;_0x4bb903[_0xcbbb('0x37')]=_[_0xcbbb('0x39')](db['User'][_0xcbbb('0x33')]);_0x4bb903[_0xcbbb('0x38')]=_['keys'](_0x4de2dd[_0xcbbb('0x38')]);_0x4bb903[_0xcbbb('0x42')]=_[_0xcbbb('0x3b')](_0x4bb903[_0xcbbb('0x37')],_0x4bb903[_0xcbbb('0x38')]);_0x56b09b[_0xcbbb('0x3a')]=_['intersection'](_0x4bb903['model'],qs[_0xcbbb('0x3c')](_0x4de2dd[_0xcbbb('0x38')][_0xcbbb('0x3c')]));_0x56b09b[_0xcbbb('0x3a')]=_0x56b09b[_0xcbbb('0x3a')]['length']?_0x56b09b[_0xcbbb('0x3a')]:_0x4bb903[_0xcbbb('0x37')];_0x56b09b[_0xcbbb('0x3f')]=qs[_0xcbbb('0x40')](_0x4de2dd[_0xcbbb('0x38')][_0xcbbb('0x40')]);_0x56b09b[_0xcbbb('0x41')]=qs[_0xcbbb('0x42')](_[_0xcbbb('0x7b')](_0x4de2dd[_0xcbbb('0x38')],_0x4bb903[_0xcbbb('0x42')]));if(_0x4de2dd['query']['filter']){_0x56b09b[_0xcbbb('0x41')]=_[_0xcbbb('0x44')](_0x56b09b[_0xcbbb('0x41')],{'$or':_[_0xcbbb('0x32')](_0x56b09b[_0xcbbb('0x3a')],function(_0x4a964b){var _0x1d7b6b={};_0x1d7b6b[_0x4a964b]={'$like':'%'+_0x4de2dd[_0xcbbb('0x38')]['filter']+'%'};return _0x1d7b6b;})});}_0x56b09b=_['merge']({},_0x56b09b,_0x4de2dd[_0xcbbb('0x45')]);return _0x130f91['getAgents'](_0x56b09b);}})[_0xcbbb('0x28')](function(_0x1a5dd3){if(_0x1a5dd3){_0x1bffe9=_0x1a5dd3[_0xcbbb('0x3d')];if(!_0x4de2dd[_0xcbbb('0x38')]['hasOwnProperty']('nolimit')){_0x56b09b[_0xcbbb('0x22')]=qs[_0xcbbb('0x22')](_0x4de2dd['query'][_0xcbbb('0x22')]);_0x56b09b[_0xcbbb('0x21')]=qs[_0xcbbb('0x21')](_0x4de2dd[_0xcbbb('0x38')][_0xcbbb('0x21')]);}return _0x130f91[_0xcbbb('0x7c')](_0x56b09b);}})[_0xcbbb('0x28')](function(_0x49f482){if(_0x49f482){return _0x49f482?{'count':_0x1bffe9,'rows':_0x49f482}:null;}})[_0xcbbb('0x28')](respondWithResult(_0x1c9dd2,null))[_0xcbbb('0x4b')](handleError(_0x1c9dd2,null));};exports['getTeams']=function(_0x10667e,_0x549d6c,_0x7a604f){var _0x10f932={};var _0x736484={};var _0x369b6f;var _0x4dc485;return db[_0xcbbb('0x46')][_0xcbbb('0x7a')]({'where':{'id':_0x10667e[_0xcbbb('0x4d')]['id']}})[_0xcbbb('0x28')](handleEntityNotFound(_0x549d6c,null))[_0xcbbb('0x28')](function(_0x4a5a59){if(_0x4a5a59){_0x369b6f=_0x4a5a59;_0x736484['model']=_[_0xcbbb('0x39')](db[_0xcbbb('0x7d')][_0xcbbb('0x33')]);_0x736484[_0xcbbb('0x38')]=_[_0xcbbb('0x39')](_0x10667e['query']);_0x736484['filters']=_[_0xcbbb('0x3b')](_0x736484[_0xcbbb('0x37')],_0x736484[_0xcbbb('0x38')]);_0x10f932[_0xcbbb('0x3a')]=_[_0xcbbb('0x3b')](_0x736484['model'],qs[_0xcbbb('0x3c')](_0x10667e[_0xcbbb('0x38')][_0xcbbb('0x3c')]));_0x10f932['attributes']=_0x10f932[_0xcbbb('0x3a')][_0xcbbb('0x3d')]?_0x10f932[_0xcbbb('0x3a')]:_0x736484[_0xcbbb('0x37')];_0x10f932[_0xcbbb('0x3f')]=qs[_0xcbbb('0x40')](_0x10667e[_0xcbbb('0x38')][_0xcbbb('0x40')]);_0x10f932['where']=qs[_0xcbbb('0x42')](_['pick'](_0x10667e['query'],_0x736484['filters']));if(_0x10667e[_0xcbbb('0x38')]['filter']){_0x10f932[_0xcbbb('0x41')]=_[_0xcbbb('0x44')](_0x10f932['where'],{'$or':_[_0xcbbb('0x32')](_0x10f932[_0xcbbb('0x3a')],function(_0x4bf0b3){var _0x4314d3={};_0x4314d3[_0x4bf0b3]={'$like':'%'+_0x10667e[_0xcbbb('0x38')][_0xcbbb('0x43')]+'%'};return _0x4314d3;})});}_0x10f932=_['merge']({},_0x10f932,_0x10667e[_0xcbbb('0x45')]);return _0x369b6f[_0xcbbb('0x7e')](_0x10f932);}})[_0xcbbb('0x28')](function(_0x2da472){if(_0x2da472){_0x4dc485=_0x2da472[_0xcbbb('0x3d')];if(!_0x10667e[_0xcbbb('0x38')][_0xcbbb('0x7f')](_0xcbbb('0x3e'))){_0x10f932[_0xcbbb('0x22')]=qs['limit'](_0x10667e[_0xcbbb('0x38')][_0xcbbb('0x22')]);_0x10f932[_0xcbbb('0x21')]=qs['offset'](_0x10667e['query'][_0xcbbb('0x21')]);}return _0x369b6f['getTeams'](_0x10f932);}})[_0xcbbb('0x28')](function(_0x198899){if(_0x198899){return _0x198899?{'count':_0x4dc485,'rows':_0x198899}:null;}})['then'](respondWithResult(_0x549d6c,null))[_0xcbbb('0x4b')](handleError(_0x549d6c,null));};exports[_0xcbbb('0x80')]=function(_0x59d833,_0x39951f,_0x283bc8){var _0x2754d1=_0x59d833[_0xcbbb('0x75')][_0xcbbb('0x73')];var _0x458b66;return db['Team'][_0xcbbb('0x49')]({'where':{'id':_0x2754d1},'attributes':['id'],'include':[{'model':db['User'],'as':_0xcbbb('0x81'),'attributes':['id',_0xcbbb('0x30'),_0xcbbb('0x82'),'voicePause',_0xcbbb('0x83')],'raw':!![]}]})['then'](function(_0x32993d){if(_0x32993d){_0x458b66=_0x32993d;var _0x962f3f=_[_0xcbbb('0x84')](_0x32993d,function(_0x55ca6b){var _0x287b25=_0x55ca6b['get']({'plain':!![]});return _0x287b25[_0xcbbb('0x81')];});return db[_0xcbbb('0x46')][_0xcbbb('0x4e')]({'where':{'id':_0x59d833[_0xcbbb('0x4d')]['id']}})['then'](function(_0x16991b){return db['sequelize'][_0xcbbb('0x52')](function(_0xd01dff){return _0x16991b[_0xcbbb('0x80')](_0x2754d1,{'transaction':_0xd01dff})[_0xcbbb('0x28')](function(){return BPromise[_0xcbbb('0x85')](_0x458b66,function(_0x3ab011){return db[_0xcbbb('0x86')]['upsert']({'TeamId':_0x3ab011['id'],'VoicePrefixId':_0x59d833[_0xcbbb('0x4d')]['id']},{'transaction':_0xd01dff});});})[_0xcbbb('0x28')](function(){return BPromise[_0xcbbb('0x85')](_0x962f3f,function(_0x354314){return db['UserVoicePrefix'][_0xcbbb('0x87')]({'where':{'UserId':_0x354314['id'],'VoicePrefixId':_0x59d833[_0xcbbb('0x4d')]['id']},'transaction':_0xd01dff});});})[_0xcbbb('0x28')](function(){_0x962f3f[_0xcbbb('0x88')](function(_0x3fc8da){socket[_0xcbbb('0x76')]('userVoicePrefix:save',{'UserId':_0x3fc8da['id'],'VoicePrefixId':_0x16991b['id']});});});});});}})[_0xcbbb('0x28')](respondWithStatusCode(_0x39951f,null))[_0xcbbb('0x4b')](handleError(_0x39951f,null));};exports[_0xcbbb('0x89')]=function(_0x23bda8,_0x233c44,_0x26545e){return db[_0xcbbb('0x7d')][_0xcbbb('0x49')]({'where':{'id':_0x23bda8['query'][_0xcbbb('0x73')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xcbbb('0x81'),'attributes':['id'],'raw':!![]}]})[_0xcbbb('0x28')](handleEntityNotFound(_0x233c44,null))[_0xcbbb('0x28')](function(_0x510bc9){var _0x1ce1c4=_[_0xcbbb('0x32')](_0x510bc9,'id');var _0x7fc4ea=[];var _0xde4f2b=[];var _0xabe61=squel['select']();_0xabe61[_0xcbbb('0x8a')]('tq.TeamId')[_0xcbbb('0x8b')]('team_has_voice_prefixes','tq')[_0xcbbb('0x8c')](_0xcbbb('0x8d'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xcbbb('0x41')](_0xcbbb('0x8e'),_0x23bda8[_0xcbbb('0x4d')]['id']);for(var _0x3a3e73=0x0;_0x3a3e73<_0x510bc9[_0xcbbb('0x3d')];_0x3a3e73+=0x1){let _0x517af0=_0x510bc9[_0x3a3e73];for(var _0x4312c3=0x0;_0x4312c3<_0x517af0[_0xcbbb('0x81')][_0xcbbb('0x3d')];_0x4312c3+=0x1){let _0x1b34ac=_0x517af0[_0xcbbb('0x81')][_0x4312c3];var _0x402d10=_0xabe61[_0xcbbb('0x8f')]();_0x402d10[_0xcbbb('0x41')]('ut.UserId\x20=\x20?',_0x1b34ac['id']);_0xde4f2b['push'](db[_0xcbbb('0x51')]['query'](_0x402d10[_0xcbbb('0x90')](),{'type':db[_0xcbbb('0x51')][_0xcbbb('0x91')][_0xcbbb('0x92')]})[_0xcbbb('0x28')](function(_0x2129d8){if(_0x2129d8[_0xcbbb('0x3d')]===0x1){return _0x1b34ac['id'];}else{var _0x274e33=_[_0xcbbb('0x93')](_[_0xcbbb('0x32')](_0x2129d8,_0xcbbb('0x94')),function(_0x1c8981){return _[_0xcbbb('0x95')](_0x1ce1c4,_0x1c8981);});if(_0x274e33){return _0x1b34ac['id'];}}}));}}return BPromise[_0xcbbb('0x96')](_0xde4f2b)[_0xcbbb('0x28')](function(_0x4bcb5d){_0x7fc4ea=_(_0x7fc4ea)[_0xcbbb('0x97')](_0x4bcb5d)[_0xcbbb('0x98')]()[_0xcbbb('0x99')]();return db[_0xcbbb('0x46')]['find']({'where':{'id':_0x23bda8[_0xcbbb('0x4d')]['id']}})[_0xcbbb('0x28')](function(_0x40fc06){return db[_0xcbbb('0x51')][_0xcbbb('0x52')](function(_0x357810){return _0x40fc06['removeTeams'](_0x23bda8[_0xcbbb('0x38')][_0xcbbb('0x73')],{'transaction':_0x357810})['then'](function(){if(!_[_0xcbbb('0x9a')](_0x7fc4ea)){return _0x40fc06[_0xcbbb('0x78')](_0x7fc4ea,{'transaction':_0x357810});}})[_0xcbbb('0x28')](function(){_0x7fc4ea[_0xcbbb('0x88')](function(_0x49e6e1){socket['emit'](_0xcbbb('0x9b'),{'UserId':_0x49e6e1,'VoicePrefixId':_0x40fc06['id']});});});});});});})[_0xcbbb('0x28')](respondWithStatusCode(_0x233c44,null))[_0xcbbb('0x4b')](handleError(_0x233c44,null));}; \ No newline at end of file +var _0x7d25=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','end','json','limit','undefined','count','offset','status','set','Content-Range','apply','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','error','stack','name','send','index','map','rawAttributes','type','key','query','keys','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','VoicePrefix','includeAll','findAll','catch','show','include','find','describe','transaction','create','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','context','app','system','description','appdata','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','prefix','push','Set','CDR(prefix)=','callerIdAll','NoOp','goto','${EXTEN:','charAt','system-','sequelize','findById','addAgents','params','omit','spread','ids','userVoicePrefix:save','removeAgents','isArray','emit','userVoicePrefix:remove','getAgents','User','getTeams','findOne','addTeams','Agents','online','interface','each','upsert','forEach','removeTeams','Team','field','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','all','union','value','isEmpty','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x4e4003,_0x58aaf7){var _0x3ad762=function(_0x5c168e){while(--_0x5c168e){_0x4e4003['push'](_0x4e4003['shift']());}};_0x3ad762(++_0x58aaf7);}(_0x7d25,0x8a));var _0x57d2=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0x7d25[_0x4ed520];return _0x4415a6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x57d2('0x0'));var zipdir=require(_0x57d2('0x1'));var jsonpatch=require(_0x57d2('0x2'));var rp=require(_0x57d2('0x3'));var moment=require(_0x57d2('0x4'));var BPromise=require(_0x57d2('0x5'));var Mustache=require(_0x57d2('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x57d2('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x57d2('0x8'));var squel=require(_0x57d2('0x9'));var crypto=require(_0x57d2('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x57d2('0xb'));var querystring=require('querystring');var Papa=require(_0x57d2('0xc'));var Redis=require(_0x57d2('0xd'));var authService=require(_0x57d2('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x57d2('0xf'));var hardwareService=require(_0x57d2('0x10'));var logger=require(_0x57d2('0x11'))(_0x57d2('0x12'));var utils=require(_0x57d2('0x13'));var config=require(_0x57d2('0x14'));var licenseUtil=require(_0x57d2('0x15'));var db=require(_0x57d2('0x16'))['db'];config[_0x57d2('0x17')]=_[_0x57d2('0x18')](config[_0x57d2('0x17')],{'host':_0x57d2('0x19'),'port':0x18eb});var socket=require(_0x57d2('0x1a'))(new Redis(config[_0x57d2('0x17')]));require(_0x57d2('0x1b'))[_0x57d2('0x1c')](socket);function respondWithStatusCode(_0x5382d9,_0x5b940e){_0x5b940e=_0x5b940e||0xcc;return function(_0x6fad35){if(_0x6fad35){return _0x5382d9[_0x57d2('0x1d')](_0x5b940e);}return _0x5382d9['status'](_0x5b940e)[_0x57d2('0x1e')]();};}function respondWithResult(_0x319489,_0x4bb8f7){_0x4bb8f7=_0x4bb8f7||0xc8;return function(_0x3e12c6){if(_0x3e12c6){return _0x319489['status'](_0x4bb8f7)[_0x57d2('0x1f')](_0x3e12c6);}};}function respondWithFilteredResult(_0x4b4fe0,_0x2ab5f0){return function(_0x7d4cf1){if(_0x7d4cf1){var _0x2ecfdf=typeof _0x2ab5f0['offset']==='undefined'&&typeof _0x2ab5f0[_0x57d2('0x20')]===_0x57d2('0x21');var _0x2662cd=_0x7d4cf1[_0x57d2('0x22')];var _0x5b1b9d=_0x2ecfdf?0x0:_0x2ab5f0[_0x57d2('0x23')];var _0xcf924f=_0x2ecfdf?_0x7d4cf1['count']:_0x2ab5f0['offset']+_0x2ab5f0[_0x57d2('0x20')];var _0x326d49;if(_0xcf924f>=_0x2662cd){_0xcf924f=_0x2662cd;_0x326d49=0xc8;}else{_0x326d49=0xce;}_0x4b4fe0[_0x57d2('0x24')](_0x326d49);return _0x4b4fe0[_0x57d2('0x25')](_0x57d2('0x26'),_0x5b1b9d+'-'+_0xcf924f+'/'+_0x2662cd)[_0x57d2('0x1f')](_0x7d4cf1);}return null;};}function patchUpdates(_0x32c7c8){return function(_0x31d2cf){try{jsonpatch[_0x57d2('0x27')](_0x31d2cf,_0x32c7c8,!![]);}catch(_0x26718e){return BPromise[_0x57d2('0x28')](_0x26718e);}return _0x31d2cf[_0x57d2('0x29')]();};}function saveUpdates(_0x12ff19,_0x473df2){return function(_0x5327ea){if(_0x5327ea){return _0x5327ea[_0x57d2('0x2a')](_0x12ff19)[_0x57d2('0x2b')](function(_0x3c7de8){return _0x3c7de8;});}return null;};}function removeEntity(_0x452d5e,_0x4363b3){return function(_0x5058be){if(_0x5058be){return _0x5058be[_0x57d2('0x2c')]()[_0x57d2('0x2b')](function(){var _0x995928=_0x5058be[_0x57d2('0x2d')]({'plain':!![]});var _0x18d500=_0x57d2('0x2e');return db[_0x57d2('0x2f')]['destroy']({'where':{'type':_0x18d500,'resourceId':_0x995928['id']}})[_0x57d2('0x2b')](function(){return _0x5058be;});})[_0x57d2('0x2b')](function(){_0x452d5e[_0x57d2('0x24')](0xcc)[_0x57d2('0x1e')]();});}};}function handleEntityNotFound(_0x1957a6,_0x7c33f3){return function(_0x1dd6cb){if(!_0x1dd6cb){_0x1957a6[_0x57d2('0x1d')](0x194);}return _0x1dd6cb;};}function handleError(_0x1d2bdb,_0x2cf9d9){_0x2cf9d9=_0x2cf9d9||0x1f4;return function(_0x574589){logger[_0x57d2('0x30')](_0x574589[_0x57d2('0x31')]);if(_0x574589[_0x57d2('0x32')]){delete _0x574589[_0x57d2('0x32')];}_0x1d2bdb['status'](_0x2cf9d9)[_0x57d2('0x33')](_0x574589);};}exports[_0x57d2('0x34')]=function(_0x21152e,_0x290c2d){var _0xb3051c={},_0x40f3f2={},_0x3cbc4b={'count':0x0,'rows':[]};var _0x36c0d7=_[_0x57d2('0x35')](db['VoicePrefix'][_0x57d2('0x36')],function(_0x213c99){return{'name':_0x213c99['fieldName'],'type':_0x213c99[_0x57d2('0x37')][_0x57d2('0x38')]};});_0x40f3f2['model']=_[_0x57d2('0x35')](_0x36c0d7,_0x57d2('0x32'));_0x40f3f2[_0x57d2('0x39')]=_[_0x57d2('0x3a')](_0x21152e[_0x57d2('0x39')]);_0x40f3f2['filters']=_['intersection'](_0x40f3f2['model'],_0x40f3f2['query']);_0xb3051c[_0x57d2('0x3b')]=_[_0x57d2('0x3c')](_0x40f3f2[_0x57d2('0x3d')],qs[_0x57d2('0x3e')](_0x21152e[_0x57d2('0x39')]['fields']));_0xb3051c[_0x57d2('0x3b')]=_0xb3051c['attributes'][_0x57d2('0x3f')]?_0xb3051c[_0x57d2('0x3b')]:_0x40f3f2[_0x57d2('0x3d')];if(!_0x21152e['query'][_0x57d2('0x40')](_0x57d2('0x41'))){_0xb3051c['limit']=qs[_0x57d2('0x20')](_0x21152e[_0x57d2('0x39')][_0x57d2('0x20')]);_0xb3051c[_0x57d2('0x23')]=qs[_0x57d2('0x23')](_0x21152e[_0x57d2('0x39')]['offset']);}_0xb3051c[_0x57d2('0x42')]=qs['sort'](_0x21152e[_0x57d2('0x39')][_0x57d2('0x43')]);_0xb3051c[_0x57d2('0x44')]=qs[_0x57d2('0x45')](_[_0x57d2('0x46')](_0x21152e['query'],_0x40f3f2[_0x57d2('0x45')]),_0x36c0d7);if(_0x21152e[_0x57d2('0x39')]['filter']){_0xb3051c[_0x57d2('0x44')]=_[_0x57d2('0x47')](_0xb3051c[_0x57d2('0x44')],{'$or':_['map'](_0x36c0d7,function(_0x226e56){if(_0x226e56[_0x57d2('0x37')]!==_0x57d2('0x48')){var _0x3281c9={};_0x3281c9[_0x226e56['name']]={'$like':'%'+_0x21152e['query'][_0x57d2('0x49')]+'%'};return _0x3281c9;}})});}_0xb3051c=_[_0x57d2('0x47')]({},_0xb3051c,_0x21152e[_0x57d2('0x4a')]);var _0x5795e7={'where':_0xb3051c['where']};return db[_0x57d2('0x4b')]['count'](_0x5795e7)[_0x57d2('0x2b')](function(_0x1bb8ad){_0x3cbc4b[_0x57d2('0x22')]=_0x1bb8ad;if(_0x21152e[_0x57d2('0x39')][_0x57d2('0x4c')]){_0xb3051c['include']=[{'all':!![]}];}return db[_0x57d2('0x4b')][_0x57d2('0x4d')](_0xb3051c);})['then'](function(_0x775f8c){_0x3cbc4b['rows']=_0x775f8c;return _0x3cbc4b;})[_0x57d2('0x2b')](respondWithFilteredResult(_0x290c2d,_0xb3051c))[_0x57d2('0x4e')](handleError(_0x290c2d,null));};exports[_0x57d2('0x4f')]=function(_0x323273,_0x58aa4e){var _0x541772={'raw':![],'where':{'id':_0x323273['params']['id']}},_0x3d8256={};_0x3d8256['model']=_[_0x57d2('0x3a')](db['VoicePrefix']['rawAttributes']);_0x3d8256[_0x57d2('0x39')]=_['keys'](_0x323273[_0x57d2('0x39')]);_0x3d8256['filters']=_[_0x57d2('0x3c')](_0x3d8256['model'],_0x3d8256['query']);_0x541772[_0x57d2('0x3b')]=_[_0x57d2('0x3c')](_0x3d8256[_0x57d2('0x3d')],qs[_0x57d2('0x3e')](_0x323273[_0x57d2('0x39')][_0x57d2('0x3e')]));_0x541772['attributes']=_0x541772[_0x57d2('0x3b')][_0x57d2('0x3f')]?_0x541772[_0x57d2('0x3b')]:_0x3d8256[_0x57d2('0x3d')];if(_0x323273[_0x57d2('0x39')][_0x57d2('0x4c')]){_0x541772[_0x57d2('0x50')]=[{'all':!![]}];}_0x541772=_[_0x57d2('0x47')]({},_0x541772,_0x323273['options']);return db[_0x57d2('0x4b')][_0x57d2('0x51')](_0x541772)['then'](handleEntityNotFound(_0x58aa4e,null))[_0x57d2('0x2b')](respondWithResult(_0x58aa4e,null))['catch'](handleError(_0x58aa4e,null));};exports['destroy']=function(_0x1a1dc7,_0x31f404){return db[_0x57d2('0x4b')][_0x57d2('0x51')]({'where':{'id':_0x1a1dc7['params']['id']}})[_0x57d2('0x2b')](handleEntityNotFound(_0x31f404,null))[_0x57d2('0x2b')](removeEntity(_0x31f404,null))['catch'](handleError(_0x31f404,null));};exports['describe']=function(_0xd7c79f,_0xb02f43){return db[_0x57d2('0x4b')][_0x57d2('0x52')]()[_0x57d2('0x2b')](respondWithResult(_0xb02f43,null))[_0x57d2('0x4e')](handleError(_0xb02f43,null));};exports['create']=function(_0x4b377f,_0x5a5edb){var _0x30482c;return db['sequelize'][_0x57d2('0x53')](function(_0x2ef710){return db['VoicePrefix'][_0x57d2('0x54')](_0x4b377f[_0x57d2('0x55')],{'transaction':_0x2ef710})[_0x57d2('0x2b')](function(_0x557f79){_0x30482c=_0x557f79[_0x57d2('0x2d')]({'plain':!![]});return db[_0x57d2('0x56')][_0x57d2('0x51')]({'where':{'id':_0x30482c[_0x57d2('0x57')]},'raw':!![]})[_0x57d2('0x2b')](function(_0x2e90eb){return createVoicePrefixExtensions(_0x30482c,_0x2e90eb,_0x2ef710);});});})[_0x57d2('0x2b')](function(){var _0x2b93c4=_0x4b377f[_0x57d2('0x58')]['get']({'plain':!![]});if(!_0x2b93c4)throw new Error(_0x57d2('0x59'));if(_0x2b93c4[_0x57d2('0x5a')]===_0x57d2('0x58')){var _0x5e3289=_0x30482c;return db[_0x57d2('0x5b')][_0x57d2('0x51')]({'where':{'name':_0x57d2('0x2e'),'userProfileId':_0x2b93c4['userProfileId']},'raw':!![]})['then'](function(_0x56ddfd){if(_0x56ddfd&&_0x56ddfd[_0x57d2('0x5c')]===0x0){return db['UserProfileResource'][_0x57d2('0x54')]({'name':_0x5e3289['name'],'resourceId':_0x5e3289['id'],'type':_0x56ddfd[_0x57d2('0x32')],'sectionId':_0x56ddfd['id']},{})['then'](function(){return _0x30482c;});}else{return _0x30482c;}})[_0x57d2('0x4e')](function(_0x430f85){logger[_0x57d2('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x430f85);throw _0x430f85;});}return _0x30482c;})['then'](respondWithResult(_0x5a5edb,null))[_0x57d2('0x4e')](handleError(_0x5a5edb,null));};function Extension(_0x2c1710,_0x3b57fa,_0x227a02,_0x3e5d71){this[_0x57d2('0x5d')]='from-sip';this['exten']=_0x2c1710;this[_0x57d2('0x5e')]=_0x227a02;this[_0x57d2('0x37')]=_0x57d2('0x5f');this[_0x57d2('0x60')]='Voice\x20Prefix\x20Extension';this['priority']=_0x3b57fa;this[_0x57d2('0x61')]=_0x3e5d71;}function createVoicePrefixExtensions(_0x301e43,_0x4f6b8a,_0xad397){return new BPromise(function(_0x28fcdb,_0x15e3b6){var _0x472e5d=new Extension(formatPrefixName(_0x301e43['prefix']),0x1,'NoOp','Voice\x20Prefix');_0x472e5d['VoicePrefixId']=_0x301e43['id'];return db[_0x57d2('0x56')][_0x57d2('0x54')](_0x472e5d,{'transaction':_0xad397})[_0x57d2('0x2b')](function(_0xa57b70){var _0xd13626=_0xa57b70[_0x57d2('0x2d')]({'plain':!![]});var _0x2737ab=_['map'](addVoicePrefixExtensions(_0x301e43,_0x4f6b8a),function(_0x35808a){_0x35808a['VoiceExtensionId']=_0xd13626['id'];_0x35808a[_0x57d2('0x62')]=_0x301e43['id'];return _0x35808a;});return db['VoiceExtension'][_0x57d2('0x63')](_0x2737ab,{'transaction':_0xad397})[_0x57d2('0x2b')](function(_0x453e6c){if(!_0x453e6c){return _0x15e3b6(_0x57d2('0x64'));}else{return _0x28fcdb(_0x453e6c);}})[_0x57d2('0x4e')](function(_0x145370){return _0x15e3b6(_0x145370);});});;});};function addVoicePrefixExtensions(_0x5e697c,_0x2a481c){var _0x24d3bf=[];var _0x27b27a=formatPrefixName(_0x5e697c[_0x57d2('0x65')]);_0x24d3bf[_0x57d2('0x66')](new Extension(_0x27b27a,0x2,_0x57d2('0x67'),_0x57d2('0x68')+_0x5e697c[_0x57d2('0x32')]));if(_0x5e697c[_0x57d2('0x69')]){_0x24d3bf['push'](new Extension(_0x27b27a,0x3,_0x57d2('0x67'),'PREFIX-CALLERIDALL='+_0x5e697c['callerIdAll']));}else{_0x24d3bf['push'](new Extension(_0x27b27a,0x3,_0x57d2('0x6a'),'No\x20callerid\x20available'));}_0x24d3bf[_0x57d2('0x66')](new Extension(_0x27b27a,0x4,_0x57d2('0x6b'),_0x2a481c['context']+','+_0x57d2('0x6c')+(0x8+_0x5e697c[_0x57d2('0x32')][_0x57d2('0x3f')])+'}'+','+0x1));return _0x24d3bf;}function formatPrefixName(_0x13741f){var _0x5eb7a3='_';for(var _0x3afeb9=0x0;_0x3afeb9<_0x13741f[_0x57d2('0x3f')];_0x3afeb9++){if(_0x13741f['charAt'](_0x3afeb9)=='-'){_0x5eb7a3+=_0x13741f['charAt'](_0x3afeb9);}else{_0x5eb7a3+='['+_0x13741f[_0x57d2('0x6d')](_0x3afeb9)+']';}}_0x5eb7a3+='.';return _0x5eb7a3;}exports[_0x57d2('0x2a')]=function(_0x481c6b,_0x46c7de,_0x5a1283){var _0x360ee0=_0x481c6b[_0x57d2('0x55')];_0x360ee0[_0x57d2('0x65')]=_0x57d2('0x6e')+_0x360ee0[_0x57d2('0x32')]+'-';return db[_0x57d2('0x6f')][_0x57d2('0x53')](function(_0x3bec6f){return db[_0x57d2('0x4b')][_0x57d2('0x2a')](_0x360ee0,{'where':{'id':_0x360ee0['id']},'transaction':_0x3bec6f})[_0x57d2('0x2b')](function(){return db['VoiceExtension'][_0x57d2('0x2c')]({'where':{'VoicePrefixId':_0x360ee0['id']},'transaction':_0x3bec6f})[_0x57d2('0x2b')](function(){return db[_0x57d2('0x56')][_0x57d2('0x51')]({'where':{'id':_0x360ee0[_0x57d2('0x57')]},'raw':!![]})[_0x57d2('0x2b')](function(_0x42666b){return createVoicePrefixExtensions(_0x360ee0,_0x42666b,_0x3bec6f);});});});})[_0x57d2('0x2b')](function(){return db[_0x57d2('0x4b')][_0x57d2('0x70')](_0x360ee0['id']);})[_0x57d2('0x2b')](respondWithResult(_0x46c7de,null))[_0x57d2('0x4e')](handleError(_0x46c7de,null));};exports[_0x57d2('0x71')]=function(_0x26da1b,_0x1bf74a,_0x144229){return db['VoicePrefix'][_0x57d2('0x51')]({'where':{'id':_0x26da1b[_0x57d2('0x72')]['id']}})['then'](handleEntityNotFound(_0x1bf74a,null))[_0x57d2('0x2b')](function(_0x17b3c1){if(_0x17b3c1){return _0x17b3c1[_0x57d2('0x71')](_0x26da1b[_0x57d2('0x55')]['ids'],_[_0x57d2('0x73')](_0x26da1b['body'],['ids','id'])||{})[_0x57d2('0x74')](function(_0x4f30e8){for(var _0x282457=0x0;_0x282457<_0x26da1b[_0x57d2('0x55')][_0x57d2('0x75')][_0x57d2('0x3f')];_0x282457+=0x1){socket['emit'](_0x57d2('0x76'),{'UserId':Number(_0x26da1b[_0x57d2('0x55')][_0x57d2('0x75')][_0x282457]),'VoicePrefixId':Number(_0x26da1b[_0x57d2('0x72')]['id'])});}return _0x4f30e8;});}})[_0x57d2('0x2b')](respondWithResult(_0x1bf74a,null))[_0x57d2('0x4e')](handleError(_0x1bf74a,null));};exports[_0x57d2('0x77')]=function(_0x41ca89,_0x1d147f,_0x261850){return db['VoicePrefix'][_0x57d2('0x51')]({'where':{'id':_0x41ca89[_0x57d2('0x72')]['id']}})[_0x57d2('0x2b')](handleEntityNotFound(_0x1d147f,null))[_0x57d2('0x2b')](function(_0x468990){if(_0x468990){return _0x468990[_0x57d2('0x77')](_0x41ca89[_0x57d2('0x39')][_0x57d2('0x75')])[_0x57d2('0x2b')](function(){if(_[_0x57d2('0x78')](_0x41ca89[_0x57d2('0x39')][_0x57d2('0x75')])){for(var _0x54edaf=0x0;_0x54edaf<_0x41ca89['query'][_0x57d2('0x75')][_0x57d2('0x3f')];_0x54edaf+=0x1){socket[_0x57d2('0x79')](_0x57d2('0x7a'),{'UserId':Number(_0x41ca89[_0x57d2('0x39')]['ids'][_0x54edaf]),'VoicePrefixId':Number(_0x41ca89['params']['id'])});}}else{socket[_0x57d2('0x79')](_0x57d2('0x7a'),{'UserId':Number(_0x41ca89[_0x57d2('0x39')][_0x57d2('0x75')]),'VoicePrefixId':Number(_0x41ca89[_0x57d2('0x72')]['id'])});}});}})[_0x57d2('0x2b')](respondWithStatusCode(_0x1d147f,null))['catch'](handleError(_0x1d147f,null));};exports[_0x57d2('0x7b')]=function(_0x2f5625,_0x5bb7cd,_0x4913c0){var _0x5ac6ee={};var _0x5b3cc6={};var _0xa557d6;var _0x4a7e00;return db[_0x57d2('0x4b')]['findOne']({'where':{'id':_0x2f5625[_0x57d2('0x72')]['id']}})[_0x57d2('0x2b')](handleEntityNotFound(_0x5bb7cd,null))[_0x57d2('0x2b')](function(_0x1dbe31){if(_0x1dbe31){_0xa557d6=_0x1dbe31;_0x5b3cc6[_0x57d2('0x3d')]=_['keys'](db[_0x57d2('0x7c')][_0x57d2('0x36')]);_0x5b3cc6[_0x57d2('0x39')]=_['keys'](_0x2f5625[_0x57d2('0x39')]);_0x5b3cc6[_0x57d2('0x45')]=_[_0x57d2('0x3c')](_0x5b3cc6[_0x57d2('0x3d')],_0x5b3cc6[_0x57d2('0x39')]);_0x5ac6ee[_0x57d2('0x3b')]=_[_0x57d2('0x3c')](_0x5b3cc6['model'],qs['fields'](_0x2f5625['query'][_0x57d2('0x3e')]));_0x5ac6ee[_0x57d2('0x3b')]=_0x5ac6ee[_0x57d2('0x3b')]['length']?_0x5ac6ee[_0x57d2('0x3b')]:_0x5b3cc6[_0x57d2('0x3d')];_0x5ac6ee[_0x57d2('0x42')]=qs[_0x57d2('0x43')](_0x2f5625[_0x57d2('0x39')][_0x57d2('0x43')]);_0x5ac6ee[_0x57d2('0x44')]=qs[_0x57d2('0x45')](_['pick'](_0x2f5625[_0x57d2('0x39')],_0x5b3cc6[_0x57d2('0x45')]));if(_0x2f5625[_0x57d2('0x39')][_0x57d2('0x49')]){_0x5ac6ee['where']=_['merge'](_0x5ac6ee[_0x57d2('0x44')],{'$or':_['map'](_0x5ac6ee[_0x57d2('0x3b')],function(_0x598d62){var _0x3a35d7={};_0x3a35d7[_0x598d62]={'$like':'%'+_0x2f5625[_0x57d2('0x39')][_0x57d2('0x49')]+'%'};return _0x3a35d7;})});}_0x5ac6ee=_['merge']({},_0x5ac6ee,_0x2f5625[_0x57d2('0x4a')]);return _0xa557d6['getAgents'](_0x5ac6ee);}})[_0x57d2('0x2b')](function(_0xe71357){if(_0xe71357){_0x4a7e00=_0xe71357[_0x57d2('0x3f')];if(!_0x2f5625[_0x57d2('0x39')][_0x57d2('0x40')](_0x57d2('0x41'))){_0x5ac6ee[_0x57d2('0x20')]=qs[_0x57d2('0x20')](_0x2f5625[_0x57d2('0x39')][_0x57d2('0x20')]);_0x5ac6ee[_0x57d2('0x23')]=qs[_0x57d2('0x23')](_0x2f5625[_0x57d2('0x39')][_0x57d2('0x23')]);}return _0xa557d6[_0x57d2('0x7b')](_0x5ac6ee);}})['then'](function(_0x3a7d89){if(_0x3a7d89){return _0x3a7d89?{'count':_0x4a7e00,'rows':_0x3a7d89}:null;}})[_0x57d2('0x2b')](respondWithResult(_0x5bb7cd,null))[_0x57d2('0x4e')](handleError(_0x5bb7cd,null));};exports[_0x57d2('0x7d')]=function(_0x4d83cf,_0x93bc52,_0x362b77){var _0x2728ba={};var _0x4f6585={};var _0x34f39a;var _0x1a90cb;return db[_0x57d2('0x4b')][_0x57d2('0x7e')]({'where':{'id':_0x4d83cf[_0x57d2('0x72')]['id']}})[_0x57d2('0x2b')](handleEntityNotFound(_0x93bc52,null))[_0x57d2('0x2b')](function(_0x1ba236){if(_0x1ba236){_0x34f39a=_0x1ba236;_0x4f6585[_0x57d2('0x3d')]=_[_0x57d2('0x3a')](db['Team']['rawAttributes']);_0x4f6585[_0x57d2('0x39')]=_[_0x57d2('0x3a')](_0x4d83cf[_0x57d2('0x39')]);_0x4f6585[_0x57d2('0x45')]=_['intersection'](_0x4f6585[_0x57d2('0x3d')],_0x4f6585[_0x57d2('0x39')]);_0x2728ba[_0x57d2('0x3b')]=_[_0x57d2('0x3c')](_0x4f6585[_0x57d2('0x3d')],qs['fields'](_0x4d83cf['query']['fields']));_0x2728ba['attributes']=_0x2728ba['attributes'][_0x57d2('0x3f')]?_0x2728ba['attributes']:_0x4f6585[_0x57d2('0x3d')];_0x2728ba[_0x57d2('0x42')]=qs['sort'](_0x4d83cf[_0x57d2('0x39')]['sort']);_0x2728ba[_0x57d2('0x44')]=qs[_0x57d2('0x45')](_[_0x57d2('0x46')](_0x4d83cf[_0x57d2('0x39')],_0x4f6585['filters']));if(_0x4d83cf[_0x57d2('0x39')]['filter']){_0x2728ba['where']=_[_0x57d2('0x47')](_0x2728ba[_0x57d2('0x44')],{'$or':_[_0x57d2('0x35')](_0x2728ba[_0x57d2('0x3b')],function(_0x127224){var _0x47ee55={};_0x47ee55[_0x127224]={'$like':'%'+_0x4d83cf[_0x57d2('0x39')][_0x57d2('0x49')]+'%'};return _0x47ee55;})});}_0x2728ba=_[_0x57d2('0x47')]({},_0x2728ba,_0x4d83cf[_0x57d2('0x4a')]);return _0x34f39a[_0x57d2('0x7d')](_0x2728ba);}})[_0x57d2('0x2b')](function(_0x4773a4){if(_0x4773a4){_0x1a90cb=_0x4773a4[_0x57d2('0x3f')];if(!_0x4d83cf['query']['hasOwnProperty'](_0x57d2('0x41'))){_0x2728ba['limit']=qs[_0x57d2('0x20')](_0x4d83cf[_0x57d2('0x39')][_0x57d2('0x20')]);_0x2728ba[_0x57d2('0x23')]=qs[_0x57d2('0x23')](_0x4d83cf['query'][_0x57d2('0x23')]);}return _0x34f39a['getTeams'](_0x2728ba);}})[_0x57d2('0x2b')](function(_0x888a75){if(_0x888a75){return _0x888a75?{'count':_0x1a90cb,'rows':_0x888a75}:null;}})[_0x57d2('0x2b')](respondWithResult(_0x93bc52,null))[_0x57d2('0x4e')](handleError(_0x93bc52,null));};exports[_0x57d2('0x7f')]=function(_0x37608b,_0x5cb4b6,_0xa4b4fd){var _0x3c9d18=_0x37608b[_0x57d2('0x55')][_0x57d2('0x75')];var _0x55f7df;return db['Team']['findAll']({'where':{'id':_0x3c9d18},'attributes':['id'],'include':[{'model':db[_0x57d2('0x7c')],'as':_0x57d2('0x80'),'attributes':['id',_0x57d2('0x32'),_0x57d2('0x81'),'voicePause',_0x57d2('0x82')],'raw':!![]}]})[_0x57d2('0x2b')](function(_0x178706){if(_0x178706){_0x55f7df=_0x178706;var _0xa92185=_['flatMap'](_0x178706,function(_0x3865c7){var _0x1d9c66=_0x3865c7[_0x57d2('0x2d')]({'plain':!![]});return _0x1d9c66[_0x57d2('0x80')];});return db['VoicePrefix'][_0x57d2('0x51')]({'where':{'id':_0x37608b['params']['id']}})['then'](function(_0x5a4689){return db[_0x57d2('0x6f')][_0x57d2('0x53')](function(_0x488dcd){return _0x5a4689['addTeams'](_0x3c9d18,{'transaction':_0x488dcd})[_0x57d2('0x2b')](function(){return BPromise[_0x57d2('0x83')](_0x55f7df,function(_0x23a448){return db['TeamVoicePrefix'][_0x57d2('0x84')]({'TeamId':_0x23a448['id'],'VoicePrefixId':_0x37608b[_0x57d2('0x72')]['id']},{'transaction':_0x488dcd});});})[_0x57d2('0x2b')](function(){return BPromise[_0x57d2('0x83')](_0xa92185,function(_0xa269b5){return db['UserVoicePrefix']['findOrCreate']({'where':{'UserId':_0xa269b5['id'],'VoicePrefixId':_0x37608b[_0x57d2('0x72')]['id']},'transaction':_0x488dcd});});})[_0x57d2('0x2b')](function(){_0xa92185[_0x57d2('0x85')](function(_0x434389){socket['emit'](_0x57d2('0x76'),{'UserId':_0x434389['id'],'VoicePrefixId':_0x5a4689['id']});});});});});}})[_0x57d2('0x2b')](respondWithStatusCode(_0x5cb4b6,null))['catch'](handleError(_0x5cb4b6,null));};exports[_0x57d2('0x86')]=function(_0x29b37c,_0x531b42,_0x120e28){return db[_0x57d2('0x87')][_0x57d2('0x4d')]({'where':{'id':_0x29b37c[_0x57d2('0x39')][_0x57d2('0x75')]},'attributes':['id'],'include':[{'model':db[_0x57d2('0x7c')],'as':_0x57d2('0x80'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x531b42,null))[_0x57d2('0x2b')](function(_0x2809c1){var _0x5444bf=_[_0x57d2('0x35')](_0x2809c1,'id');var _0x3da7ba=[];var _0x2fc3b5=[];var _0x41ba89=squel['select']();_0x41ba89[_0x57d2('0x88')]('tq.TeamId')[_0x57d2('0x89')](_0x57d2('0x8a'),'tq')[_0x57d2('0x8b')](_0x57d2('0x8c'),'ut',_0x57d2('0x8d'))[_0x57d2('0x44')](_0x57d2('0x8e'),_0x29b37c[_0x57d2('0x72')]['id']);for(var _0x112218=0x0;_0x112218<_0x2809c1[_0x57d2('0x3f')];_0x112218+=0x1){let _0x57314b=_0x2809c1[_0x112218];for(var _0x3acffd=0x0;_0x3acffd<_0x57314b[_0x57d2('0x80')]['length'];_0x3acffd+=0x1){let _0x447051=_0x57314b[_0x57d2('0x80')][_0x3acffd];var _0x511494=_0x41ba89[_0x57d2('0x8f')]();_0x511494[_0x57d2('0x44')](_0x57d2('0x90'),_0x447051['id']);_0x2fc3b5[_0x57d2('0x66')](db['sequelize'][_0x57d2('0x39')](_0x511494[_0x57d2('0x91')](),{'type':db['sequelize'][_0x57d2('0x92')][_0x57d2('0x93')]})[_0x57d2('0x2b')](function(_0x13aec4){if(_0x13aec4[_0x57d2('0x3f')]===0x1){return _0x447051['id'];}else{var _0x4e3497=_[_0x57d2('0x94')](_[_0x57d2('0x35')](_0x13aec4,'TeamId'),function(_0xb122b9){return _[_0x57d2('0x95')](_0x5444bf,_0xb122b9);});if(_0x4e3497){return _0x447051['id'];}}}));}}return BPromise[_0x57d2('0x96')](_0x2fc3b5)['then'](function(_0xdc5333){_0x3da7ba=_(_0x3da7ba)[_0x57d2('0x97')](_0xdc5333)['compact']()[_0x57d2('0x98')]();return db[_0x57d2('0x4b')][_0x57d2('0x51')]({'where':{'id':_0x29b37c[_0x57d2('0x72')]['id']}})[_0x57d2('0x2b')](function(_0x456ed3){return db['sequelize'][_0x57d2('0x53')](function(_0x376cea){return _0x456ed3[_0x57d2('0x86')](_0x29b37c[_0x57d2('0x39')][_0x57d2('0x75')],{'transaction':_0x376cea})[_0x57d2('0x2b')](function(){if(!_[_0x57d2('0x99')](_0x3da7ba)){return _0x456ed3[_0x57d2('0x77')](_0x3da7ba,{'transaction':_0x376cea});}})[_0x57d2('0x2b')](function(){_0x3da7ba['forEach'](function(_0x5b7f18){socket[_0x57d2('0x79')]('userVoicePrefix:remove',{'UserId':_0x5b7f18,'VoicePrefixId':_0x456ed3['id']});});});});});});})[_0x57d2('0x2b')](respondWithStatusCode(_0x531b42,null))['catch'](handleError(_0x531b42,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 418178f..10a7af0 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 _0x2fa7=['hasOwnProperty','hook','exports','../../mysqldb','VoicePrefix','setMaxListeners','update','remove','emit'];(function(_0x580165,_0x4f0714){var _0x5e29e3=function(_0x143c84){while(--_0x143c84){_0x580165['push'](_0x580165['shift']());}};_0x5e29e3(++_0x4f0714);}(_0x2fa7,0xf6));var _0x72fa=function(_0x17914e,_0x4e1951){_0x17914e=_0x17914e-0x0;var _0x530659=_0x2fa7[_0x17914e];return _0x530659;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x72fa('0x0'))['db'][_0x72fa('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x72fa('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x72fa('0x3'),'afterDestroy':_0x72fa('0x4')};function emitEvent(_0x1f8e44){return function(_0x1945ec,_0x2475b8,_0x1c2f0d){VoicePrefixEvents['emit'](_0x1f8e44+':'+_0x1945ec['id'],_0x1945ec);VoicePrefixEvents[_0x72fa('0x5')](_0x1f8e44,_0x1945ec);_0x1c2f0d(null);};}for(var e in events){if(events[_0x72fa('0x6')](e)){var event=events[e];VoicePrefix[_0x72fa('0x7')](e,emitEvent(event));}}module[_0x72fa('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0x3732=['../../mysqldb','VoicePrefix','save','remove','emit','hook','exports','events'];(function(_0x297a9c,_0x2c5459){var _0x376fd2=function(_0x856370){while(--_0x856370){_0x297a9c['push'](_0x297a9c['shift']());}};_0x376fd2(++_0x2c5459);}(_0x3732,0x19f));var _0x2373=function(_0x550580,_0x2797db){_0x550580=_0x550580-0x0;var _0x21b5dd=_0x3732[_0x550580];return _0x21b5dd;};'use strict';var EventEmitter=require(_0x2373('0x0'));var VoicePrefix=require(_0x2373('0x1'))['db'][_0x2373('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2373('0x3'),'afterUpdate':'update','afterDestroy':_0x2373('0x4')};function emitEvent(_0x5da03c){return function(_0x14c3e3,_0x9f992e,_0x5c7792){VoicePrefixEvents['emit'](_0x5da03c+':'+_0x14c3e3['id'],_0x14c3e3);VoicePrefixEvents[_0x2373('0x5')](_0x5da03c,_0x14c3e3);_0x5c7792(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x2373('0x6')](e,emitEvent(event));}}module[_0x2373('0x7')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 42f9149..0bc9009 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 _0x020d=['lodash','../../config/logger','api','path','../../config/environment','./voicePrefix.attributes','exports','define','voice_prefixes'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x020d,0x183));var _0xd020=function(_0x4c7740,_0x41d113){_0x4c7740=_0x4c7740-0x0;var _0x4c5edc=_0x020d[_0x4c7740];return _0x4c5edc;};'use strict';var _=require(_0xd020('0x0'));var util=require('util');var logger=require(_0xd020('0x1'))(_0xd020('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd020('0x3'));var rimraf=require('rimraf');var config=require(_0xd020('0x4'));var attributes=require(_0xd020('0x5'));module[_0xd020('0x6')]=function(_0x449c04,_0x59caa6){return _0x449c04[_0xd020('0x7')]('VoicePrefix',attributes,{'tableName':_0xd020('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x39fe=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x39fe,0x168));var _0xe39f=function(_0x3b85ec,_0x512f8a){_0x3b85ec=_0x3b85ec-0x0;var _0x38574e=_0x39fe[_0x3b85ec];return _0x38574e;};'use strict';var _=require(_0xe39f('0x0'));var util=require(_0xe39f('0x1'));var logger=require(_0xe39f('0x2'))(_0xe39f('0x3'));var moment=require(_0xe39f('0x4'));var BPromise=require(_0xe39f('0x5'));var rp=require(_0xe39f('0x6'));var fs=require('fs');var path=require(_0xe39f('0x7'));var rimraf=require(_0xe39f('0x8'));var config=require(_0xe39f('0x9'));var attributes=require(_0xe39f('0xa'));module[_0xe39f('0xb')]=function(_0x5062c4,_0x28b340){return _0x5062c4[_0xe39f('0xc')](_0xe39f('0xd'),attributes,{'tableName':_0xe39f('0xe'),'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 a7281fa..3dec866 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 _0xc61d=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','error','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xc61d,0xfb));var _0xdc61=function(_0x15568a,_0xbbbf6e){_0x15568a=_0x15568a-0x0;var _0x43780f=_0xc61d[_0x15568a];return _0x43780f;};'use strict';var _=require(_0xdc61('0x0'));var util=require(_0xdc61('0x1'));var moment=require(_0xdc61('0x2'));var BPromise=require(_0xdc61('0x3'));var rs=require(_0xdc61('0x4'));var fs=require('fs');var Redis=require(_0xdc61('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdc61('0x6'));var logger=require(_0xdc61('0x7'))('rpc');var config=require(_0xdc61('0x8'));var jayson=require(_0xdc61('0x9'));var client=jayson[_0xdc61('0xa')][_0xdc61('0xb')]({'port':0x232a});config[_0xdc61('0xc')]=_[_0xdc61('0xd')](config[_0xdc61('0xc')],{'host':_0xdc61('0xe'),'port':0x18eb});var socket=require(_0xdc61('0xf'))(new Redis(config[_0xdc61('0xc')]));require('./voicePrefix.socket')[_0xdc61('0x10')](socket);function respondWithRpcPromise(_0x1682d1,_0x175405,_0x333f0b){return new BPromise(function(_0xf27275,_0x55fe79){return client[_0xdc61('0x11')](_0x1682d1,_0x333f0b)['then'](function(_0x403725){logger['info'](_0xdc61('0x12'),_0x175405,_0xdc61('0x13'));logger[_0xdc61('0x14')](_0xdc61('0x15'),_0x175405,_0xdc61('0x13'),JSON['stringify'](_0x403725));if(_0x403725[_0xdc61('0x16')]){if(_0x403725[_0xdc61('0x16')]['code']===0x1f4){logger[_0xdc61('0x16')](_0xdc61('0x12'),_0x175405,_0x403725[_0xdc61('0x16')][_0xdc61('0x17')]);return _0x55fe79(_0x403725[_0xdc61('0x16')][_0xdc61('0x17')]);}logger[_0xdc61('0x16')](_0xdc61('0x12'),_0x175405,_0x403725[_0xdc61('0x16')]['message']);return _0xf27275(_0x403725[_0xdc61('0x16')][_0xdc61('0x17')]);}else{logger[_0xdc61('0x18')](_0xdc61('0x12'),_0x175405,_0xdc61('0x13'));_0xf27275(_0x403725[_0xdc61('0x19')][_0xdc61('0x17')]);}})['catch'](function(_0x49354d){logger['error'](_0xdc61('0x12'),_0x175405,_0x49354d);_0x55fe79(_0x49354d);});});} \ No newline at end of file +var _0xd43e=['request','then','request\x20sent','debug','stringify','error','code','message','info','VoicePrefix,\x20%s,\x20%s','result','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./voicePrefix.socket','register'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xd43e,0x88));var _0xed43=function(_0x497326,_0x3d0598){_0x497326=_0x497326-0x0;var _0x1c6553=_0xd43e[_0x497326];return _0x1c6553;};'use strict';var _=require(_0xed43('0x0'));var util=require('util');var moment=require(_0xed43('0x1'));var BPromise=require(_0xed43('0x2'));var rs=require(_0xed43('0x3'));var fs=require('fs');var Redis=require(_0xed43('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xed43('0x5'))(_0xed43('0x6'));var config=require(_0xed43('0x7'));var jayson=require(_0xed43('0x8'));var client=jayson['client'][_0xed43('0x9')]({'port':0x232a});config[_0xed43('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xed43('0xb'))(new Redis(config[_0xed43('0xa')]));require(_0xed43('0xc'))[_0xed43('0xd')](socket);function respondWithRpcPromise(_0x3cad15,_0x5dbd4b,_0x2d698a){return new BPromise(function(_0x428fb2,_0x4dd64f){return client[_0xed43('0xe')](_0x3cad15,_0x2d698a)[_0xed43('0xf')](function(_0xb026ab){logger['info']('VoicePrefix,\x20%s,\x20%s',_0x5dbd4b,_0xed43('0x10'));logger[_0xed43('0x11')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x5dbd4b,_0xed43('0x10'),JSON[_0xed43('0x12')](_0xb026ab));if(_0xb026ab[_0xed43('0x13')]){if(_0xb026ab[_0xed43('0x13')][_0xed43('0x14')]===0x1f4){logger[_0xed43('0x13')]('VoicePrefix,\x20%s,\x20%s',_0x5dbd4b,_0xb026ab[_0xed43('0x13')]['message']);return _0x4dd64f(_0xb026ab[_0xed43('0x13')]['message']);}logger[_0xed43('0x13')]('VoicePrefix,\x20%s,\x20%s',_0x5dbd4b,_0xb026ab['error'][_0xed43('0x15')]);return _0x428fb2(_0xb026ab['error'][_0xed43('0x15')]);}else{logger[_0xed43('0x16')](_0xed43('0x17'),_0x5dbd4b,'request\x20sent');_0x428fb2(_0xb026ab[_0xed43('0x18')][_0xed43('0x15')]);}})['catch'](function(_0x594458){logger[_0xed43('0x13')](_0xed43('0x17'),_0x5dbd4b,_0x594458);_0x4dd64f(_0x594458);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index f09e6ce..3543476 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 _0x1c8a=['removeListener','voicePrefix:','./voicePrefix.events','save','remove','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1c8a,0x140));var _0xa1c8=function(_0x30df46,_0x4921d6){_0x30df46=_0x30df46-0x0;var _0x52629f=_0x1c8a[_0x30df46];return _0x52629f;};'use strict';var VoicePrefixEvents=require(_0xa1c8('0x0'));var events=[_0xa1c8('0x1'),_0xa1c8('0x2'),_0xa1c8('0x3')];function createListener(_0x2eb128,_0x50af02){return function(_0x250aa9){_0x50af02['emit'](_0x2eb128,_0x250aa9);};}function removeListener(_0x122813,_0x1cdee0){return function(){VoicePrefixEvents[_0xa1c8('0x4')](_0x122813,_0x1cdee0);};}exports['register']=function(_0x331282){for(var _0x14b85c=0x0,_0x14d2f0=events['length'];_0x14b85c<_0x14d2f0;_0x14b85c++){var _0x32993e=events[_0x14b85c];var _0xf93962=createListener(_0xa1c8('0x5')+_0x32993e,_0x331282);VoicePrefixEvents['on'](_0x32993e,_0xf93962);}}; \ No newline at end of file +var _0xcb18=['remove','emit','removeListener','register','voicePrefix:'];(function(_0x585886,_0x36611c){var _0x341624=function(_0x23008b){while(--_0x23008b){_0x585886['push'](_0x585886['shift']());}};_0x341624(++_0x36611c);}(_0xcb18,0x159));var _0x8cb1=function(_0x45c9ae,_0x4de6be){_0x45c9ae=_0x45c9ae-0x0;var _0x16a8eb=_0xcb18[_0x45c9ae];return _0x16a8eb;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=['save',_0x8cb1('0x0'),'update'];function createListener(_0x3df352,_0x50513d){return function(_0x5e800d){_0x50513d[_0x8cb1('0x1')](_0x3df352,_0x5e800d);};}function removeListener(_0x87b1d3,_0x15d761){return function(){VoicePrefixEvents[_0x8cb1('0x2')](_0x87b1d3,_0x15d761);};}exports[_0x8cb1('0x3')]=function(_0x503927){for(var _0x355d91=0x0,_0x335e41=events['length'];_0x355d91<_0x335e41;_0x355d91++){var _0x186f71=events[_0x355d91];var _0x510e92=createListener(_0x8cb1('0x4')+_0x186f71,_0x503927);VoicePrefixEvents['on'](_0x186f71,_0x510e92);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 5409a11..bef9bf2 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 _0x0be1=['removeTeams','delete','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','index','isAuthenticated','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','getMembers','/:id/lists','getLists','/:id/blacklists','post','create','/:id/clone','clone','addTeams','addAgents','addBlackLists','put','/:id','update','destroy'];(function(_0x4be4d8,_0x47c03f){var _0x1c3737=function(_0x32e734){while(--_0x32e734){_0x4be4d8['push'](_0x4be4d8['shift']());}};_0x1c3737(++_0x47c03f);}(_0x0be1,0x156));var _0x10be=function(_0x2543d6,_0x3a5e78){_0x2543d6=_0x2543d6-0x0;var _0x55213c=_0x0be1[_0x2543d6];return _0x55213c;};'use strict';var multer=require(_0x10be('0x0'));var util=require(_0x10be('0x1'));var path=require(_0x10be('0x2'));var timeout=require(_0x10be('0x3'));var express=require(_0x10be('0x4'));var router=express[_0x10be('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x10be('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x10be('0x7'));var controller=require('./voiceQueue.controller');router[_0x10be('0x8')]('/',auth['isAuthenticated'](),controller[_0x10be('0x9')]);router[_0x10be('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x10be('0x8')]('/:id/hoppers',auth[_0x10be('0xa')](),controller[_0x10be('0xb')]);router['get'](_0x10be('0xc'),auth[_0x10be('0xa')](),controller[_0x10be('0xd')]);router[_0x10be('0x8')](_0x10be('0xe'),auth[_0x10be('0xa')](),controller['getHopperFinals']);router[_0x10be('0x8')](_0x10be('0xf'),auth[_0x10be('0xa')](),controller[_0x10be('0x10')]);router['get'](_0x10be('0x11'),auth[_0x10be('0xa')](),controller[_0x10be('0x12')]);router['get'](_0x10be('0x13'),auth[_0x10be('0xa')](),controller[_0x10be('0x14')]);router[_0x10be('0x8')]('/:id/members',auth[_0x10be('0xa')](),controller[_0x10be('0x15')]);router['get'](_0x10be('0x16'),auth['isAuthenticated'](),controller[_0x10be('0x17')]);router[_0x10be('0x8')](_0x10be('0x18'),auth[_0x10be('0xa')](),controller['getBlackLists']);router[_0x10be('0x19')]('/',auth[_0x10be('0xa')](),controller[_0x10be('0x1a')]);router['post'](_0x10be('0x1b'),auth[_0x10be('0xa')](),controller[_0x10be('0x1c')]);router[_0x10be('0x19')](_0x10be('0x11'),auth[_0x10be('0xa')](),controller[_0x10be('0x1d')]);router['post'](_0x10be('0x13'),auth[_0x10be('0xa')](),controller[_0x10be('0x1e')]);router['post']('/:id/lists',auth[_0x10be('0xa')](),controller['addLists']);router[_0x10be('0x19')](_0x10be('0x18'),auth['isAuthenticated'](),controller[_0x10be('0x1f')]);router[_0x10be('0x20')](_0x10be('0x21'),auth[_0x10be('0xa')](),controller[_0x10be('0x22')]);router['delete']('/:id',auth[_0x10be('0xa')](),controller[_0x10be('0x23')]);router['delete'](_0x10be('0x11'),auth[_0x10be('0xa')](),controller[_0x10be('0x24')]);router[_0x10be('0x25')](_0x10be('0x13'),auth[_0x10be('0xa')](),controller[_0x10be('0x26')]);router[_0x10be('0x25')]('/:id/lists',auth[_0x10be('0xa')](),controller[_0x10be('0x27')]);router[_0x10be('0x25')](_0x10be('0x18'),auth['isAuthenticated'](),controller[_0x10be('0x28')]);module[_0x10be('0x29')]=router; \ No newline at end of file +var _0x684c=['/:id/clone','clone','addTeams','addAgents','addLists','addBlackLists','/:id','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueue.controller','get','isAuthenticated','index','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create'];(function(_0x275850,_0x11cf6c){var _0x10d32e=function(_0x5097db){while(--_0x5097db){_0x275850['push'](_0x275850['shift']());}};_0x10d32e(++_0x11cf6c);}(_0x684c,0x6f));var _0xc684=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x684c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc684('0x0'));var util=require(_0xc684('0x1'));var path=require(_0xc684('0x2'));var timeout=require(_0xc684('0x3'));var express=require(_0xc684('0x4'));var router=express[_0xc684('0x5')]();var fs_extra=require(_0xc684('0x6'));var auth=require(_0xc684('0x7'));var interaction=require(_0xc684('0x8'));var config=require('../../config/environment');var controller=require(_0xc684('0x9'));router[_0xc684('0xa')]('/',auth[_0xc684('0xb')](),controller[_0xc684('0xc')]);router[_0xc684('0xa')]('/:id',auth[_0xc684('0xb')](),controller[_0xc684('0xd')]);router[_0xc684('0xa')]('/:id/hoppers',auth[_0xc684('0xb')](),controller[_0xc684('0xe')]);router[_0xc684('0xa')](_0xc684('0xf'),auth['isAuthenticated'](),controller[_0xc684('0x10')]);router[_0xc684('0xa')](_0xc684('0x11'),auth[_0xc684('0xb')](),controller[_0xc684('0x12')]);router['get'](_0xc684('0x13'),auth['isAuthenticated'](),controller[_0xc684('0x14')]);router[_0xc684('0xa')](_0xc684('0x15'),auth['isAuthenticated'](),controller[_0xc684('0x16')]);router[_0xc684('0xa')](_0xc684('0x17'),auth[_0xc684('0xb')](),controller[_0xc684('0x18')]);router[_0xc684('0xa')](_0xc684('0x19'),auth[_0xc684('0xb')](),controller[_0xc684('0x1a')]);router['get'](_0xc684('0x1b'),auth['isAuthenticated'](),controller[_0xc684('0x1c')]);router[_0xc684('0xa')](_0xc684('0x1d'),auth[_0xc684('0xb')](),controller[_0xc684('0x1e')]);router[_0xc684('0x1f')]('/',auth['isAuthenticated'](),controller[_0xc684('0x20')]);router['post'](_0xc684('0x21'),auth[_0xc684('0xb')](),controller[_0xc684('0x22')]);router[_0xc684('0x1f')](_0xc684('0x15'),auth[_0xc684('0xb')](),controller[_0xc684('0x23')]);router[_0xc684('0x1f')](_0xc684('0x17'),auth[_0xc684('0xb')](),controller[_0xc684('0x24')]);router[_0xc684('0x1f')](_0xc684('0x1b'),auth[_0xc684('0xb')](),controller[_0xc684('0x25')]);router['post'](_0xc684('0x1d'),auth[_0xc684('0xb')](),controller[_0xc684('0x26')]);router['put'](_0xc684('0x27'),auth['isAuthenticated'](),controller[_0xc684('0x28')]);router[_0xc684('0x29')](_0xc684('0x27'),auth[_0xc684('0xb')](),controller[_0xc684('0x2a')]);router['delete'](_0xc684('0x15'),auth[_0xc684('0xb')](),controller[_0xc684('0x2b')]);router[_0xc684('0x29')](_0xc684('0x17'),auth[_0xc684('0xb')](),controller[_0xc684('0x2c')]);router[_0xc684('0x29')](_0xc684('0x1b'),auth[_0xc684('0xb')](),controller[_0xc684('0x2d')]);router['delete'](_0xc684('0x1d'),auth['isAuthenticated'](),controller[_0xc684('0x2e')]);module[_0xc684('0x2f')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 49d1da4..e8a917e 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 _0xe599=['leastrecent','random','rrmemory','wrandom','rrordered','ringall','setDataValue','strategy','type','getDataValue','dialMethod','booked','roundrobin','predictive','power','INTEGER','yes','TEXT','join','periodic_announce','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\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','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','outbound'];(function(_0x67a673,_0x4ef400){var _0x521ccd=function(_0x31677d){while(--_0x31677d){_0x67a673['push'](_0x67a673['shift']());}};_0x521ccd(++_0x4ef400);}(_0xe599,0x1e5));var _0x9e59=function(_0x3cf4a0,_0x30e765){_0x3cf4a0=_0x3cf4a0-0x0;var _0x5b1969=_0xe599[_0x3cf4a0];return _0x5b1969;};'use strict';var Sequelize=require(_0x9e59('0x0'));module[_0x9e59('0x1')]={'name':{'type':Sequelize[_0x9e59('0x2')],'allowNull':![],'unique':_0x9e59('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x9e59('0x4')](_0x9e59('0x5'),_0x9e59('0x6')),'allowNull':![],'defaultValue':_0x9e59('0x5')},'musiconhold':{'type':Sequelize[_0x9e59('0x2')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x9e59('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x9e59('0x4')]('rr','ringall',_0x9e59('0x7'),'fewestcalls',_0x9e59('0x8'),_0x9e59('0x9'),'linear',_0x9e59('0xa'),_0x9e59('0xb')),'allowNull':![],'defaultValue':_0x9e59('0xc'),'set':function(_0x1a6a13){this[_0x9e59('0xd')](_0x9e59('0xe'),_0x1a6a13?_0x1a6a13:'rrmemory');},'get':function(){var _0x312bc6=this['getDataValue'](_0x9e59('0xf'));var _0x26fc0b=this[_0x9e59('0x10')](_0x9e59('0x11'));var _0x5e1487=this[_0x9e59('0x10')](_0x9e59('0xe'));if(_0x312bc6==='inbound'){return _0x5e1487;}if(_0x26fc0b===_0x9e59('0x12')&&_0x5e1487===_0x9e59('0x9')||_0x26fc0b===_0x9e59('0x12')&&_0x5e1487===_0x9e59('0x13')){return _0x5e1487;}if(_0x26fc0b==='progressive'||_0x26fc0b===_0x9e59('0x14')||_0x26fc0b===_0x9e59('0x15')){return _0x5e1487;}return null;}},'servicelevel':{'type':Sequelize[_0x9e59('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x9e59('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x9e59('0x16')](0xb)},'timeout':{'type':Sequelize[_0x9e59('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x9e59('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x9e59('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x9e59('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x9e59('0x4')](_0x9e59('0x17'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x9e59('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0x9e59('0x4')](_0x9e59('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x9e59('0x4')](_0x9e59('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x9e59('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x9e59('0x4')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x9e59('0x4')](_0x9e59('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x9e59('0x4')](_0x9e59('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x9e59('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x9e59('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x9e59('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x9e59('0x4')](_0x9e59('0x17'),'no'),'defaultValue':_0x9e59('0x17')},'announce_holdtime':{'type':Sequelize[_0x9e59('0x4')](_0x9e59('0x17'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x9e59('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0x9e59('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x9e59('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x9e59('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x9e59('0x2')]},'queue_youarenext':{'type':Sequelize[_0x9e59('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x9e59('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x9e59('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x9e59('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x9e59('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x9e59('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x9e59('0x2')]},'queue_quantity1':{'type':Sequelize[_0x9e59('0x2')]},'queue_quantity2':{'type':Sequelize[_0x9e59('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x9e59('0x2')]},'queue_less_than':{'type':Sequelize[_0x9e59('0x2')]},'periodic_announce':{'type':Sequelize[_0x9e59('0x18')],'set':function(_0x22b036){this[_0x9e59('0xd')]('periodic_announce',_0x22b036?_0x22b036[_0x9e59('0x19')](','):[]);},'get':function(){return this[_0x9e59('0x10')](_0x9e59('0x1a'))?this[_0x9e59('0x10')](_0x9e59('0x1a'))[_0x9e59('0x1b')](','):[];}},'joinempty':{'type':Sequelize[_0x9e59('0x2')],'defaultValue':_0x9e59('0x17'),'set':function(_0x38b71c){this['setDataValue'](_0x9e59('0x1c'),_0x38b71c?_0x38b71c['join'](','):undefined);},'get':function(){return this[_0x9e59('0x10')](_0x9e59('0x1c'))?this[_0x9e59('0x10')](_0x9e59('0x1c'))[_0x9e59('0x1b')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x9e59('0x2')],'defaultValue':'no','set':function(_0x37bc00){this[_0x9e59('0xd')](_0x9e59('0x1d'),_0x37bc00?_0x37bc00[_0x9e59('0x19')](','):undefined);},'get':function(){return this[_0x9e59('0x10')](_0x9e59('0x1d'))?this[_0x9e59('0x10')](_0x9e59('0x1d'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x9e59('0x4')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x9e59('0x4')](_0x9e59('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x9e59('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x9e59('0x2')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x9e59('0x1e')],'defaultValue':0x0,'set':function(_0x4e2006){this[_0x9e59('0xd')](_0x9e59('0x1f'),_0x4e2006);if(_0x4e2006){if(this['getDataValue']('wrapuptime')<0x2){this['setDataValue'](_0x9e59('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x9e59('0x1e')],'defaultValue':0x0,'comment':_0x9e59('0x21')},'dialMethod':{'type':Sequelize[_0x9e59('0x4')](_0x9e59('0x22'),'progressive',_0x9e59('0x15'),_0x9e59('0x14'),_0x9e59('0x12')),'defaultValue':_0x9e59('0x23'),'comment':_0x9e59('0x24')},'dialLimitChannel':{'type':Sequelize[_0x9e59('0x16')](0x4)[_0x9e59('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x9e59('0x26')},'dialLimitQueue':{'type':Sequelize[_0x9e59('0x16')](0x4)[_0x9e59('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x9e59('0x27')},'dialPowerLevel':{'type':Sequelize[_0x9e59('0x28')](0x2)[_0x9e59('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x9e59('0x29'),'dropRate'),'defaultValue':_0x9e59('0x2a'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x9e59('0x28')](0x2)[_0x9e59('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x9e59('0x2b')},'dialPredictiveInterval':{'type':Sequelize[_0x9e59('0x16')](0x3)[_0x9e59('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x9e59('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize[_0x9e59('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x9e59('0x16')](0x3)[_0x9e59('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x9e59('0x2')],'defaultValue':_0x9e59('0x2d'),'comment':_0x9e59('0x2e')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x9e59('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9e59('0x2f')},'dialQueueProject':{'type':Sequelize[_0x9e59('0x2')],'comment':_0x9e59('0x30')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9e59('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9e59('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x9e59('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x9e59('0x16')](0x3)[_0x9e59('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9e59('0x32')},'dialBusyRetryFrequency':{'type':Sequelize[_0x9e59('0x16')](0x5)[_0x9e59('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9e59('0x25')],'defaultValue':0x3,'comment':_0x9e59('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x9e59('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x9e59('0x16')](0x3)[_0x9e59('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x9e59('0x34')},'dialTimezone':{'type':Sequelize[_0x9e59('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x9e59('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0x9e59('0x35'),_0x9e59('0x36')),'defaultValue':_0x9e59('0x37')},'dialAMDActive':{'type':Sequelize[_0x9e59('0x1e')],'defaultValue':0x0,'comment':_0x9e59('0x38')},'dialAMDInitialSilence':{'type':Sequelize[_0x9e59('0x16')](0x9)[_0x9e59('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x9e59('0x39')},'dialAMDGreeting':{'type':Sequelize[_0x9e59('0x16')](0x9)[_0x9e59('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x9e59('0x3a')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x9e59('0x16')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x9e59('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x9e59('0x16')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x9e59('0x16')](0x9)[_0x9e59('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x9e59('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x9e59('0x16')](0x9)[_0x9e59('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x9e59('0x3d')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x9e59('0x16')](0x9)[_0x9e59('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x9e59('0x3e')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x9e59('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x9e59('0x3f')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x9e59('0x16')](0x9)[_0x9e59('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9e59('0x40')},'dialRecallMeTimeout':{'type':Sequelize[_0x9e59('0x16')](0x5)[_0x9e59('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x9e59('0x1e')],'defaultValue':0x0,'comment':_0x9e59('0x41')},'dialOrderByScheduledAt':{'type':Sequelize[_0x9e59('0x4')](_0x9e59('0x42'),_0x9e59('0x43')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x9e59('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x9e59('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x9e59('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x9e59('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9e59('0x44')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x9e59('0x16')](0x3)[_0x9e59('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9e59('0x45')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x9e59('0x16')](0x5)[_0x9e59('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9e59('0x46')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9e59('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9e59('0x47')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9e59('0x48')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x9e59('0x16')](0x3)[_0x9e59('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x9e59('0x16')](0x5)[_0x9e59('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9e59('0x49')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9e59('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9e59('0x4a')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x9e59('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9e59('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x9e59('0x16')](0x3)[_0x9e59('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9e59('0x4c')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x9e59('0x16')](0x5)[_0x9e59('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9e59('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9e59('0x16')],'allowNull':!![],'comment':_0x9e59('0x4e')},'mandatoryDisposition':{'type':Sequelize[_0x9e59('0x1e')],'defaultValue':![],'comment':_0x9e59('0x4f'),'set':function(_0x830b77){if(!_0x830b77)this[_0x9e59('0xd')](_0x9e59('0x50'),null);this[_0x9e59('0xd')](_0x9e59('0x51'),_0x830b77);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x9e59('0x16')](0x3)[_0x9e59('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0x4812=['ASC','BOOLEAN','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#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','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','name','ENUM','inbound','outbound','STRING','ringall','leastrecent','fewestcalls','random','rrmemory','linear','setDataValue','strategy','getDataValue','type','dialMethod','booked','roundrobin','progressive','predictive','INTEGER','yes','all','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime','Active/Disactive\x20Campaign','preview','power','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)','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)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC'];(function(_0xea27ad,_0x2364c1){var _0x23e858=function(_0x58b583){while(--_0x58b583){_0xea27ad['push'](_0xea27ad['shift']());}};_0x23e858(++_0x2364c1);}(_0x4812,0x10a));var _0x2481=function(_0x369e60,_0x13e87d){_0x369e60=_0x369e60-0x0;var _0x3f31f6=_0x4812[_0x369e60];return _0x3f31f6;};'use strict';var Sequelize=require(_0x2481('0x0'));module[_0x2481('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2481('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x2481('0x3')](_0x2481('0x4'),_0x2481('0x5')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x2481('0x6')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x2481('0x6')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x2481('0x7'),_0x2481('0x8'),_0x2481('0x9'),_0x2481('0xa'),_0x2481('0xb'),_0x2481('0xc'),'wrandom','rrordered'),'allowNull':![],'defaultValue':_0x2481('0x7'),'set':function(_0xd6b18b){this[_0x2481('0xd')](_0x2481('0xe'),_0xd6b18b?_0xd6b18b:_0x2481('0xb'));},'get':function(){var _0x5922e5=this[_0x2481('0xf')](_0x2481('0x10'));var _0x264fe5=this[_0x2481('0xf')](_0x2481('0x11'));var _0x256da9=this['getDataValue'](_0x2481('0xe'));if(_0x5922e5===_0x2481('0x4')){return _0x256da9;}if(_0x264fe5===_0x2481('0x12')&&_0x256da9===_0x2481('0xb')||_0x264fe5===_0x2481('0x12')&&_0x256da9===_0x2481('0x13')){return _0x256da9;}if(_0x264fe5===_0x2481('0x14')||_0x264fe5===_0x2481('0x15')||_0x264fe5==='power'){return _0x256da9;}return null;}},'servicelevel':{'type':Sequelize[_0x2481('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x2481('0x6')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x2481('0x16')](0xb)},'timeout':{'type':Sequelize[_0x2481('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x2481('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x2481('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x2481('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x2481('0x3')]('yes','no'),'defaultValue':_0x2481('0x17')},'autopause':{'type':Sequelize['ENUM'](_0x2481('0x17'),'no',_0x2481('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x2481('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0x2481('0x3')](_0x2481('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x2481('0x3')](_0x2481('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x2481('0x3')](_0x2481('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x2481('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x2481('0x3')](_0x2481('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x2481('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x2481('0x6')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x2481('0x6')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x2481('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x2481('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x2481('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x2481('0x3')](_0x2481('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x2481('0x17'),'no'),'defaultValue':_0x2481('0x17')},'announce_holdtime':{'type':Sequelize[_0x2481('0x3')](_0x2481('0x17'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x2481('0x6')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x2481('0x3')](_0x2481('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0x2481('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x2481('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x2481('0x6')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x2481('0x6')]},'queue_youarenext':{'type':Sequelize[_0x2481('0x6')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x2481('0x6')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x2481('0x6')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x2481('0x6')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x2481('0x6')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x2481('0x6')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x2481('0x6')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x2481('0x6')]},'queue_periodic_announce':{'type':Sequelize[_0x2481('0x6')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0x2481('0x19')],'set':function(_0xd87f0f){this['setDataValue'](_0x2481('0x1a'),_0xd87f0f?_0xd87f0f[_0x2481('0x1b')](','):[]);},'get':function(){return this['getDataValue'](_0x2481('0x1a'))?this[_0x2481('0xf')](_0x2481('0x1a'))[_0x2481('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0x2481('0x6')],'defaultValue':'yes','set':function(_0x1ab6f0){this[_0x2481('0xd')]('joinempty',_0x1ab6f0?_0x1ab6f0['join'](','):undefined);},'get':function(){return this[_0x2481('0xf')](_0x2481('0x1d'))?this[_0x2481('0xf')]('joinempty')[_0x2481('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x2481('0x6')],'defaultValue':'no','set':function(_0x4375fe){this[_0x2481('0xd')]('leavewhenempty',_0x4375fe?_0x4375fe[_0x2481('0x1b')](','):undefined);},'get':function(){return this[_0x2481('0xf')](_0x2481('0x1e'))?this[_0x2481('0xf')](_0x2481('0x1e'))[_0x2481('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x2481('0x3')](_0x2481('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x2481('0x3')](_0x2481('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x2481('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x2481('0x3')](_0x2481('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x2481('0x6')]},'description':{'type':Sequelize[_0x2481('0x6')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x21b9f6){this[_0x2481('0xd')](_0x2481('0x1f'),_0x21b9f6);if(_0x21b9f6){if(this[_0x2481('0xf')](_0x2481('0x20'))<0x2){this[_0x2481('0xd')](_0x2481('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x2481('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x2481('0x21')},'dialMethod':{'type':Sequelize[_0x2481('0x3')](_0x2481('0x22'),_0x2481('0x14'),_0x2481('0x23'),'predictive',_0x2481('0x12')),'defaultValue':_0x2481('0x14'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x2481('0x16')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x2481('0x24')},'dialLimitQueue':{'type':Sequelize[_0x2481('0x16')](0x4)[_0x2481('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x2481('0x26')},'dialPowerLevel':{'type':Sequelize[_0x2481('0x27')](0x2)[_0x2481('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x2481('0x28')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x2481('0x29'),'dropRate'),'defaultValue':_0x2481('0x2a'),'comment':_0x2481('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x2481('0x27')](0x2)[_0x2481('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x2481('0x2c')},'dialPredictiveInterval':{'type':Sequelize[_0x2481('0x16')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x2481('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0x2481('0x6')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x2481('0x16')](0x3)[_0x2481('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x2481('0x2e'),'comment':_0x2481('0x2f')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x2481('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2481('0x30')},'dialQueueProject':{'type':Sequelize[_0x2481('0x6')],'comment':_0x2481('0x31')},'dialCongestionMaxRetry':{'type':Sequelize[_0x2481('0x16')](0x3)[_0x2481('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2481('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x2481('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x2481('0x16')](0x3)[_0x2481('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2481('0x33')},'dialBusyRetryFrequency':{'type':Sequelize[_0x2481('0x16')](0x5)[_0x2481('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x2481('0x16')](0x3)[_0x2481('0x25')],'defaultValue':0x3,'comment':_0x2481('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x2481('0x16')](0x5)[_0x2481('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2481('0x35')},'dialGlobalMaxRetry':{'type':Sequelize[_0x2481('0x16')](0x3)[_0x2481('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x2481('0x36')},'dialTimezone':{'type':Sequelize[_0x2481('0x6')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x2481('0x37')},'dialPrefix':{'type':Sequelize[_0x2481('0x6')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x2481('0x3')]('always',_0x2481('0x38'),_0x2481('0x39')),'defaultValue':_0x2481('0x3a')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x2481('0x3b')},'dialAMDInitialSilence':{'type':Sequelize[_0x2481('0x16')](0x9)[_0x2481('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x2481('0x3c')},'dialAMDGreeting':{'type':Sequelize[_0x2481('0x16')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x2481('0x3d')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x2481('0x16')](0x9)[_0x2481('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x2481('0x3e')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x2481('0x16')](0x9)[_0x2481('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x2481('0x16')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x2481('0x3f')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x2481('0x16')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x2481('0x40')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x2481('0x16')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x2481('0x41')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x2481('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x2481('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2481('0x42')},'dialRecallMeTimeout':{'type':Sequelize[_0x2481('0x16')](0x5)[_0x2481('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x2481('0x43')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x2481('0x44')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x2481('0x45'),_0x2481('0x46')),'defaultValue':_0x2481('0x45')},'dialQueueProject2':{'type':Sequelize[_0x2481('0x6')],'comment':_0x2481('0x31')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x2481('0x47')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x2481('0x47')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x2481('0x16')](0x3)[_0x2481('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2481('0x48')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x2481('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2481('0x49')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x2481('0x16')](0x3)[_0x2481('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2481('0x4a')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x2481('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2481('0x4b')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2481('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x2481('0x16')](0x5)[_0x2481('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2481('0x4c')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x2481('0x16')](0x3)[_0x2481('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x2481('0x16')](0x5)[_0x2481('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x2481('0x16')](0x3)[_0x2481('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2481('0x4d')},'dialMachineRetryFrequency':{'type':Sequelize[_0x2481('0x16')](0x5)[_0x2481('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2481('0x4e')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x2481('0x16')](0x3)[_0x2481('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x2481('0x16')](0x5)[_0x2481('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2481('0x4f')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2481('0x16')],'allowNull':!![],'comment':_0x2481('0x50')},'mandatoryDisposition':{'type':Sequelize[_0x2481('0x47')],'defaultValue':![],'comment':_0x2481('0x51'),'set':function(_0x46df45){if(!_0x46df45)this[_0x2481('0xd')](_0x2481('0x52'),null);this[_0x2481('0xd')](_0x2481('0x53'),_0x46df45);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x2481('0x16')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x2481('0x16')](0x3)[_0x2481('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index ddf29e4..dc4a788 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 _0xf090=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','filter','map','value','includes','type','find','name','stack','send','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','options','VoiceQueue','include','rows','catch','show','create','body','role','user','outbound','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','clone','params','includeAll','omit','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getHoppers','findOne','CmHopper','nolimit','VoiceQueueId','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','flatMap','penalty','TeamVoiceQueue','each','UserVoiceQueueRt','upsert','isNil','interface','format','voicePause','emit','userVoiceQueue:save','ids','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','QueryTypes','TeamId','all','union','compact','transaction','removeTeams','isEmpty','removeAgents','forEach','userVoiceQueue:remove','addAgents','spread','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','phone','NOW()','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','phone\x20IS\x20NOT\x20NULL','COALESCE(phone,\x27\x27)','removeLists','getBlackLists','addBlackLists','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x5e6961,_0xaca2eb){var _0x550fbf=function(_0x5f4090){while(--_0x5f4090){_0x5e6961['push'](_0x5e6961['shift']());}};_0x550fbf(++_0xaca2eb);}(_0xf090,0xa7));var _0x0f09=function(_0x402593,_0x5b380a){_0x402593=_0x402593-0x0;var _0x6dd1c5=_0xf090[_0x402593];return _0x6dd1c5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0f09('0x0'));var zipdir=require(_0x0f09('0x1'));var jsonpatch=require(_0x0f09('0x2'));var rp=require(_0x0f09('0x3'));var moment=require(_0x0f09('0x4'));var BPromise=require(_0x0f09('0x5'));var Mustache=require('mustache');var util=require(_0x0f09('0x6'));var path=require('path');var sox=require(_0x0f09('0x7'));var csv=require(_0x0f09('0x8'));var ejs=require(_0x0f09('0x9'));var fs=require('fs');var fs_extra=require(_0x0f09('0xa'));var _=require(_0x0f09('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0f09('0xc'));var deskjs=require(_0x0f09('0xd'));var toCsv=require(_0x0f09('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0f09('0xe'));var authService=require(_0x0f09('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x0f09('0x10'));var hardwareService=require(_0x0f09('0x11'));var logger=require(_0x0f09('0x12'))(_0x0f09('0x13'));var utils=require(_0x0f09('0x14'));var config=require(_0x0f09('0x15'));var licenseUtil=require(_0x0f09('0x16'));var db=require(_0x0f09('0x17'))['db'];config['redis']=_['defaults'](config[_0x0f09('0x18')],{'host':_0x0f09('0x19'),'port':0x18eb});var socket=require(_0x0f09('0x1a'))(new Redis(config[_0x0f09('0x18')]));require(_0x0f09('0x1b'))[_0x0f09('0x1c')](socket);function respondWithStatusCode(_0x49fc7c,_0x442aba){_0x442aba=_0x442aba||0xcc;return function(_0xe3c4a8){if(_0xe3c4a8){return _0x49fc7c[_0x0f09('0x1d')](_0x442aba);}return _0x49fc7c[_0x0f09('0x1e')](_0x442aba)[_0x0f09('0x1f')]();};}function respondWithResult(_0x86afdf,_0xc63d33){_0xc63d33=_0xc63d33||0xc8;return function(_0x4ac1dd){if(_0x4ac1dd){return _0x86afdf[_0x0f09('0x1e')](_0xc63d33)['json'](_0x4ac1dd);}};}function respondWithFilteredResult(_0x2d0b7c,_0x324a8e){return function(_0x2fb8ff){if(_0x2fb8ff){var _0x19db2a=typeof _0x324a8e[_0x0f09('0x20')]==='undefined'&&typeof _0x324a8e[_0x0f09('0x21')]===_0x0f09('0x22');var _0x4679d8=_0x2fb8ff[_0x0f09('0x23')];var _0x2f50f8=_0x19db2a?0x0:_0x324a8e['offset'];var _0x3e1f02=_0x19db2a?_0x2fb8ff[_0x0f09('0x23')]:_0x324a8e[_0x0f09('0x20')]+_0x324a8e[_0x0f09('0x21')];var _0x2381a1;if(_0x3e1f02>=_0x4679d8){_0x3e1f02=_0x4679d8;_0x2381a1=0xc8;}else{_0x2381a1=0xce;}_0x2d0b7c['status'](_0x2381a1);return _0x2d0b7c[_0x0f09('0x24')](_0x0f09('0x25'),_0x2f50f8+'-'+_0x3e1f02+'/'+_0x4679d8)[_0x0f09('0x26')](_0x2fb8ff);}return null;};}function patchUpdates(_0x41ff18){return function(_0x3d47be){try{jsonpatch[_0x0f09('0x27')](_0x3d47be,_0x41ff18,!![]);}catch(_0x233b29){return BPromise['reject'](_0x233b29);}return _0x3d47be[_0x0f09('0x28')]();};}function saveUpdates(_0x3079c5,_0x11d5d0){return function(_0x4474d6){if(_0x4474d6){return _0x4474d6['update'](_0x3079c5)[_0x0f09('0x29')](function(_0x14e77c){return _0x14e77c;});}return null;};}function removeEntity(_0x585452,_0x3059bb){return function(_0x3056ce){if(_0x3056ce){return _0x3056ce[_0x0f09('0x2a')]()[_0x0f09('0x29')](function(){var _0x2d9669=_0x3056ce[_0x0f09('0x2b')]({'plain':!![]});var _0x457b09=[{'name':_0x0f09('0x2c'),'value':_0x0f09('0x2d'),'ignore':![]},{'name':_0x0f09('0x2e'),'value':'outbound','ignore':![]}];var _0xe36040=_(_0x457b09)[_0x0f09('0x2f')]('ignore')[_0x0f09('0x30')]('value')[_0x0f09('0x31')]();if(_[_0x0f09('0x32')](_0xe36040,_0x2d9669[_0x0f09('0x33')])){return;}var _0x42b03d=_[_0x0f09('0x34')](_0x457b09,['value',_0x2d9669[_0x0f09('0x33')]])[_0x0f09('0x35')];return db['UserProfileResource']['destroy']({'where':{'type':_0x42b03d,'resourceId':_0x2d9669['id']}})[_0x0f09('0x29')](function(){return _0x3056ce;});})[_0x0f09('0x29')](function(){_0x585452[_0x0f09('0x1e')](0xcc)[_0x0f09('0x1f')]();});}};}function handleEntityNotFound(_0x1a03b9,_0x1f387b){return function(_0x56bd2a){if(!_0x56bd2a){_0x1a03b9[_0x0f09('0x1d')](0x194);}return _0x56bd2a;};}function handleError(_0x366d1e,_0x3cf235){_0x3cf235=_0x3cf235||0x1f4;return function(_0x2edc1a){logger['error'](_0x2edc1a[_0x0f09('0x36')]);if(_0x2edc1a[_0x0f09('0x35')]){delete _0x2edc1a[_0x0f09('0x35')];}_0x366d1e[_0x0f09('0x1e')](_0x3cf235)[_0x0f09('0x37')](_0x2edc1a);};}exports['index']=function(_0x29dc44,_0x151145){var _0x5d95e5={},_0x3af9f0={},_0x3eeaab={'count':0x0,'rows':[]};var _0x35867f=_['map'](db['VoiceQueue'][_0x0f09('0x38')],function(_0x551e5e){return{'name':_0x551e5e[_0x0f09('0x39')],'type':_0x551e5e[_0x0f09('0x33')]['key']};});_0x3af9f0[_0x0f09('0x3a')]=_[_0x0f09('0x30')](_0x35867f,_0x0f09('0x35'));_0x3af9f0[_0x0f09('0x3b')]=_[_0x0f09('0x3c')](_0x29dc44[_0x0f09('0x3b')]);_0x3af9f0['filters']=_[_0x0f09('0x3d')](_0x3af9f0[_0x0f09('0x3a')],_0x3af9f0[_0x0f09('0x3b')]);_0x5d95e5[_0x0f09('0x3e')]=_['intersection'](_0x3af9f0[_0x0f09('0x3a')],qs[_0x0f09('0x3f')](_0x29dc44[_0x0f09('0x3b')][_0x0f09('0x3f')]));_0x5d95e5[_0x0f09('0x3e')]=_0x5d95e5['attributes'][_0x0f09('0x40')]?_0x5d95e5[_0x0f09('0x3e')]:_0x3af9f0[_0x0f09('0x3a')];if(!_0x29dc44[_0x0f09('0x3b')][_0x0f09('0x41')]('nolimit')){_0x5d95e5[_0x0f09('0x21')]=qs[_0x0f09('0x21')](_0x29dc44[_0x0f09('0x3b')]['limit']);_0x5d95e5[_0x0f09('0x20')]=qs['offset'](_0x29dc44[_0x0f09('0x3b')][_0x0f09('0x20')]);}_0x5d95e5[_0x0f09('0x42')]=qs[_0x0f09('0x43')](_0x29dc44[_0x0f09('0x3b')]['sort']);_0x5d95e5[_0x0f09('0x44')]=qs[_0x0f09('0x45')](_[_0x0f09('0x46')](_0x29dc44[_0x0f09('0x3b')],_0x3af9f0[_0x0f09('0x45')]),_0x35867f);if(_0x29dc44['query'][_0x0f09('0x2f')]){_0x5d95e5[_0x0f09('0x44')]=_[_0x0f09('0x47')](_0x5d95e5[_0x0f09('0x44')],{'$or':_['map'](_0x35867f,function(_0x2d6e43){if(_0x2d6e43[_0x0f09('0x33')]!==_0x0f09('0x48')){var _0x918e72={};_0x918e72[_0x2d6e43[_0x0f09('0x35')]]={'$like':'%'+_0x29dc44['query'][_0x0f09('0x2f')]+'%'};return _0x918e72;}})});}_0x5d95e5=_[_0x0f09('0x47')]({},_0x5d95e5,_0x29dc44[_0x0f09('0x49')]);var _0xb62b1b={'where':_0x5d95e5[_0x0f09('0x44')]};return db[_0x0f09('0x4a')][_0x0f09('0x23')](_0xb62b1b)['then'](function(_0x2bd8f7){_0x3eeaab[_0x0f09('0x23')]=_0x2bd8f7;if(_0x29dc44[_0x0f09('0x3b')]['includeAll']){_0x5d95e5[_0x0f09('0x4b')]=[{'all':!![]}];}return db['VoiceQueue']['findAll'](_0x5d95e5);})[_0x0f09('0x29')](function(_0xe361c2){_0x3eeaab[_0x0f09('0x4c')]=_0xe361c2;return _0x3eeaab;})[_0x0f09('0x29')](respondWithFilteredResult(_0x151145,_0x5d95e5))[_0x0f09('0x4d')](handleError(_0x151145,null));};exports[_0x0f09('0x4e')]=function(_0x180ee2,_0x20f1ba){var _0x290757={'raw':![],'where':{'id':_0x180ee2['params']['id']}},_0x33eb9f={};_0x33eb9f[_0x0f09('0x3a')]=_['keys'](db[_0x0f09('0x4a')][_0x0f09('0x38')]);_0x33eb9f[_0x0f09('0x3b')]=_['keys'](_0x180ee2['query']);_0x33eb9f['filters']=_[_0x0f09('0x3d')](_0x33eb9f['model'],_0x33eb9f[_0x0f09('0x3b')]);_0x290757[_0x0f09('0x3e')]=_[_0x0f09('0x3d')](_0x33eb9f[_0x0f09('0x3a')],qs[_0x0f09('0x3f')](_0x180ee2[_0x0f09('0x3b')][_0x0f09('0x3f')]));_0x290757[_0x0f09('0x3e')]=_0x290757[_0x0f09('0x3e')][_0x0f09('0x40')]?_0x290757[_0x0f09('0x3e')]:_0x33eb9f['model'];if(_0x180ee2[_0x0f09('0x3b')]['includeAll']){_0x290757['include']=[{'all':!![]}];}_0x290757=_[_0x0f09('0x47')]({},_0x290757,_0x180ee2[_0x0f09('0x49')]);return db[_0x0f09('0x4a')][_0x0f09('0x34')](_0x290757)[_0x0f09('0x29')](handleEntityNotFound(_0x20f1ba,null))[_0x0f09('0x29')](respondWithResult(_0x20f1ba,null))[_0x0f09('0x4d')](handleError(_0x20f1ba,null));};exports[_0x0f09('0x4f')]=function(_0x75d357,_0x3d29cd){return db['VoiceQueue'][_0x0f09('0x4f')](_0x75d357[_0x0f09('0x50')],{})[_0x0f09('0x29')](function(_0x23f478){var _0x243054=_0x75d357['user'][_0x0f09('0x2b')]({'plain':!![]});if(!_0x243054)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x243054[_0x0f09('0x51')]===_0x0f09('0x52')){var _0x2d16eb=_0x23f478['get']({'plain':!![]});var _0x227008=[{'name':_0x0f09('0x2c'),'value':_0x0f09('0x2d')},{'name':_0x0f09('0x2e'),'value':_0x0f09('0x53')}];var _0x35c183=_[_0x0f09('0x34')](_0x227008,[_0x0f09('0x31'),_0x2d16eb[_0x0f09('0x33')]])[_0x0f09('0x35')];return db[_0x0f09('0x54')][_0x0f09('0x34')]({'where':{'name':_0x35c183,'userProfileId':_0x243054[_0x0f09('0x55')]},'raw':!![]})[_0x0f09('0x29')](function(_0x5f2544){if(_0x5f2544&&_0x5f2544[_0x0f09('0x56')]===0x0){return db[_0x0f09('0x57')][_0x0f09('0x4f')]({'name':_0x2d16eb[_0x0f09('0x35')],'resourceId':_0x2d16eb['id'],'type':_0x5f2544[_0x0f09('0x35')],'sectionId':_0x5f2544['id']},{})[_0x0f09('0x29')](function(){return _0x23f478;});}else{return _0x23f478;}})['catch'](function(_0x43141c){logger[_0x0f09('0x58')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x43141c);throw _0x43141c;});}return _0x23f478;})['then'](respondWithResult(_0x3d29cd,0xc9))['catch'](handleError(_0x3d29cd,null));};exports[_0x0f09('0x59')]=function(_0x3964e2,_0x512d3e){var _0x962db0={'where':{'id':_0x3964e2[_0x0f09('0x5a')]['id']}},_0x3591ca={};_0x3591ca[_0x0f09('0x3a')]=_[_0x0f09('0x3c')](db[_0x0f09('0x4a')][_0x0f09('0x38')]);_0x962db0[_0x0f09('0x3e')]=_[_0x0f09('0x3d')](_0x3591ca[_0x0f09('0x3a')],qs[_0x0f09('0x3f')](_0x3964e2[_0x0f09('0x3b')][_0x0f09('0x3f')]));_0x962db0[_0x0f09('0x3e')]=_0x962db0[_0x0f09('0x3e')][_0x0f09('0x40')]?_0x962db0[_0x0f09('0x3e')]:_0x3591ca[_0x0f09('0x3a')];if(_0x3964e2[_0x0f09('0x3b')][_0x0f09('0x5b')]){_0x962db0[_0x0f09('0x4b')]=[{'all':!![]}];}_0x962db0=_[_0x0f09('0x47')]({},_0x962db0,_0x3964e2[_0x0f09('0x49')]);return db['VoiceQueue'][_0x0f09('0x34')](_0x962db0)[_0x0f09('0x29')](handleEntityNotFound(_0x512d3e,null))[_0x0f09('0x29')](function(_0x54d24f){if(_0x54d24f){var _0x2b6b55=_0x54d24f[_0x0f09('0x2b')]({'plain':!![]});_0x2b6b55=qs[_0x0f09('0x5c')](_0x2b6b55,['id',_0x0f09('0x5d'),'updatedAt']);_0x3964e2[_0x0f09('0x50')]=_[_0x0f09('0x5c')](_0x3964e2[_0x0f09('0x50')],['id',_0x0f09('0x5d'),_0x0f09('0x5e')]);return db[_0x0f09('0x4a')][_0x0f09('0x4f')](_['merge'](_0x2b6b55,_0x3964e2['body']),{'include':_0x3964e2[_0x0f09('0x3b')][_0x0f09('0x5b')]?[{'all':!![]}]:undefined})[_0x0f09('0x29')](function(_0x56e68c){var _0xbe0ac6=_0x3964e2[_0x0f09('0x52')][_0x0f09('0x2b')]({'plain':!![]});if(!_0xbe0ac6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xbe0ac6[_0x0f09('0x51')]===_0x0f09('0x52')){var _0x49134e=_0x56e68c[_0x0f09('0x2b')]({'plain':!![]});var _0x17058d=[{'name':_0x0f09('0x2c'),'value':_0x0f09('0x2d')},{'name':_0x0f09('0x2e'),'value':'outbound'}];var _0x1acd3f=_[_0x0f09('0x34')](_0x17058d,[_0x0f09('0x31'),_0x49134e['type']])['name'];return db['UserProfileSection'][_0x0f09('0x34')]({'where':{'name':_0x1acd3f,'userProfileId':_0xbe0ac6[_0x0f09('0x55')]},'raw':!![]})[_0x0f09('0x29')](function(_0x2de3b4){if(_0x2de3b4&&_0x2de3b4[_0x0f09('0x56')]===0x0){return db[_0x0f09('0x57')][_0x0f09('0x4f')]({'name':_0x49134e['name'],'resourceId':_0x49134e['id'],'type':_0x2de3b4[_0x0f09('0x35')],'sectionId':_0x2de3b4['id']},{})[_0x0f09('0x29')](function(){return _0x56e68c;});}else{return _0x56e68c;}})[_0x0f09('0x4d')](function(_0x189e60){logger[_0x0f09('0x58')](_0x0f09('0x5f'),_0x189e60);throw _0x189e60;});}return _0x56e68c;});}})['then'](respondWithResult(_0x512d3e,0xc9))[_0x0f09('0x4d')](handleError(_0x512d3e,null));};exports[_0x0f09('0x60')]=function(_0x1ddfe2,_0x5b618f){if(_0x1ddfe2['body']['id']){delete _0x1ddfe2['body']['id'];}return db[_0x0f09('0x4a')][_0x0f09('0x34')]({'where':{'id':_0x1ddfe2[_0x0f09('0x5a')]['id']}})[_0x0f09('0x29')](handleEntityNotFound(_0x5b618f,null))[_0x0f09('0x29')](saveUpdates(_0x1ddfe2['body'],null))[_0x0f09('0x29')](respondWithResult(_0x5b618f,null))[_0x0f09('0x4d')](handleError(_0x5b618f,null));};exports['destroy']=function(_0x2694d1,_0x54d9c1){return db['VoiceQueue'][_0x0f09('0x34')]({'where':{'id':_0x2694d1[_0x0f09('0x5a')]['id']}})[_0x0f09('0x29')](handleEntityNotFound(_0x54d9c1,null))[_0x0f09('0x29')](removeEntity(_0x54d9c1,null))[_0x0f09('0x4d')](handleError(_0x54d9c1,null));};exports[_0x0f09('0x61')]=function(_0xc3c6fa,_0x21aad7,_0x1379be){var _0x27cbdb={'raw':![],'where':{}};var _0x2402b5={};var _0x1935a1={'count':0x0,'rows':[]};return db[_0x0f09('0x4a')][_0x0f09('0x62')]({'where':{'id':_0xc3c6fa['params']['id']}})[_0x0f09('0x29')](handleEntityNotFound(_0x21aad7,null))[_0x0f09('0x29')](function(_0x2fa478){if(_0x2fa478){_0x2402b5['model']=_[_0x0f09('0x3c')](db[_0x0f09('0x63')][_0x0f09('0x38')]);_0x2402b5[_0x0f09('0x3b')]=_[_0x0f09('0x3c')](_0xc3c6fa[_0x0f09('0x3b')]);_0x2402b5[_0x0f09('0x45')]=_[_0x0f09('0x3d')](_0x2402b5[_0x0f09('0x3a')],_0x2402b5[_0x0f09('0x3b')]);_0x27cbdb[_0x0f09('0x3e')]=_['intersection'](_0x2402b5[_0x0f09('0x3a')],qs[_0x0f09('0x3f')](_0xc3c6fa[_0x0f09('0x3b')][_0x0f09('0x3f')]));_0x27cbdb[_0x0f09('0x3e')]=_0x27cbdb[_0x0f09('0x3e')][_0x0f09('0x40')]?_0x27cbdb[_0x0f09('0x3e')]:_0x2402b5['model'];if(!_0xc3c6fa[_0x0f09('0x3b')]['hasOwnProperty'](_0x0f09('0x64'))){_0x27cbdb[_0x0f09('0x21')]=qs[_0x0f09('0x21')](_0xc3c6fa[_0x0f09('0x3b')][_0x0f09('0x21')]);_0x27cbdb[_0x0f09('0x20')]=qs['offset'](_0xc3c6fa[_0x0f09('0x3b')]['offset']);}_0x27cbdb[_0x0f09('0x42')]=qs['sort'](_0xc3c6fa['query'][_0x0f09('0x43')]);_0x27cbdb[_0x0f09('0x44')]=qs[_0x0f09('0x45')](_['pick'](_0xc3c6fa[_0x0f09('0x3b')],_0x2402b5[_0x0f09('0x45')]));_0x27cbdb['where'][_0x0f09('0x65')]=_0x2fa478['id'];if(_0xc3c6fa['query']['filter']){_0x27cbdb['where']=_[_0x0f09('0x47')](_0x27cbdb[_0x0f09('0x44')],{'$or':_['map'](_0x27cbdb[_0x0f09('0x3e')],function(_0x181ebd){var _0x201138={};_0x201138[_0x181ebd]={'$like':'%'+_0xc3c6fa[_0x0f09('0x3b')][_0x0f09('0x2f')]+'%'};return _0x201138;})});}_0x27cbdb=_[_0x0f09('0x47')]({},_0x27cbdb,_0xc3c6fa[_0x0f09('0x49')]);return db[_0x0f09('0x63')][_0x0f09('0x23')]({'where':_0x27cbdb['where']})[_0x0f09('0x29')](function(_0x1df810){_0x1935a1[_0x0f09('0x23')]=_0x1df810;if(_0xc3c6fa['query'][_0x0f09('0x5b')]){_0x27cbdb[_0x0f09('0x4b')]=[{'all':!![]}];}return db[_0x0f09('0x63')][_0x0f09('0x66')](_0x27cbdb);})[_0x0f09('0x29')](function(_0x70a2d8){_0x1935a1[_0x0f09('0x4c')]=_0x70a2d8;return _0x1935a1;});}})[_0x0f09('0x29')](respondWithFilteredResult(_0x21aad7,_0x27cbdb))[_0x0f09('0x4d')](handleError(_0x21aad7,null));};exports[_0x0f09('0x67')]=function(_0x4b0314,_0x4d413f,_0x5606ca){var _0x22316c={'raw':!![],'where':{}};var _0x2c58b0={};var _0x53b227={'count':0x0,'rows':[]};return db[_0x0f09('0x4a')]['findOne']({'where':{'id':_0x4b0314[_0x0f09('0x5a')]['id']}})[_0x0f09('0x29')](handleEntityNotFound(_0x4d413f,null))[_0x0f09('0x29')](function(_0x201a72){if(_0x201a72){_0x2c58b0[_0x0f09('0x3a')]=_[_0x0f09('0x3c')](db[_0x0f09('0x68')][_0x0f09('0x38')]);_0x2c58b0[_0x0f09('0x3b')]=_['keys'](_0x4b0314[_0x0f09('0x3b')]);_0x2c58b0['filters']=_[_0x0f09('0x3d')](_0x2c58b0[_0x0f09('0x3a')],_0x2c58b0[_0x0f09('0x3b')]);_0x22316c[_0x0f09('0x3e')]=_[_0x0f09('0x3d')](_0x2c58b0[_0x0f09('0x3a')],qs[_0x0f09('0x3f')](_0x4b0314[_0x0f09('0x3b')][_0x0f09('0x3f')]));_0x22316c[_0x0f09('0x3e')]=_0x22316c[_0x0f09('0x3e')]['length']?_0x22316c[_0x0f09('0x3e')]:_0x2c58b0[_0x0f09('0x3a')];if(!_0x4b0314['query'][_0x0f09('0x41')]('nolimit')){_0x22316c[_0x0f09('0x21')]=qs['limit'](_0x4b0314[_0x0f09('0x3b')][_0x0f09('0x21')]);_0x22316c['offset']=qs['offset'](_0x4b0314[_0x0f09('0x3b')][_0x0f09('0x20')]);}_0x22316c[_0x0f09('0x42')]=qs['sort'](_0x4b0314['query'][_0x0f09('0x43')]);_0x22316c[_0x0f09('0x44')]=qs['filters'](_[_0x0f09('0x46')](_0x4b0314['query'],_0x2c58b0[_0x0f09('0x45')]));_0x22316c['where'][_0x0f09('0x65')]=_0x201a72['id'];if(_0x4b0314[_0x0f09('0x3b')]['filter']){_0x22316c['where']=_[_0x0f09('0x47')](_0x22316c[_0x0f09('0x44')],{'$or':_['map'](_0x22316c[_0x0f09('0x3e')],function(_0x577e06){var _0xf1f2fc={};_0xf1f2fc[_0x577e06]={'$like':'%'+_0x4b0314[_0x0f09('0x3b')]['filter']+'%'};return _0xf1f2fc;})});}_0x22316c=_[_0x0f09('0x47')]({},_0x22316c,_0x4b0314[_0x0f09('0x49')]);return db[_0x0f09('0x68')][_0x0f09('0x23')]({'where':_0x22316c[_0x0f09('0x44')]})['then'](function(_0x5c92a9){_0x53b227['count']=_0x5c92a9;if(_0x4b0314[_0x0f09('0x3b')]['includeAll']){_0x22316c[_0x0f09('0x4b')]=[{'all':!![]}];}return db[_0x0f09('0x68')][_0x0f09('0x66')](_0x22316c);})[_0x0f09('0x29')](function(_0x27030f){_0x53b227['rows']=_0x27030f;return _0x53b227;});}})['then'](respondWithFilteredResult(_0x4d413f,_0x22316c))[_0x0f09('0x4d')](handleError(_0x4d413f,null));};exports[_0x0f09('0x69')]=function(_0x2b500a,_0x34a33d,_0x29ee00){var _0x427ea9={'raw':!![],'where':{}};var _0xe75be3={};var _0x241ba3={'count':0x0,'rows':[]};return db[_0x0f09('0x4a')][_0x0f09('0x62')]({'where':{'id':_0x2b500a['params']['id']}})[_0x0f09('0x29')](handleEntityNotFound(_0x34a33d,null))[_0x0f09('0x29')](function(_0x438136){if(_0x438136){_0xe75be3[_0x0f09('0x3a')]=_[_0x0f09('0x3c')](db[_0x0f09('0x6a')][_0x0f09('0x38')]);_0xe75be3[_0x0f09('0x3b')]=_['keys'](_0x2b500a[_0x0f09('0x3b')]);_0xe75be3[_0x0f09('0x45')]=_[_0x0f09('0x3d')](_0xe75be3['model'],_0xe75be3[_0x0f09('0x3b')]);_0x427ea9[_0x0f09('0x3e')]=_[_0x0f09('0x3d')](_0xe75be3[_0x0f09('0x3a')],qs['fields'](_0x2b500a[_0x0f09('0x3b')][_0x0f09('0x3f')]));_0x427ea9[_0x0f09('0x3e')]=_0x427ea9['attributes'][_0x0f09('0x40')]?_0x427ea9[_0x0f09('0x3e')]:_0xe75be3[_0x0f09('0x3a')];if(!_0x2b500a[_0x0f09('0x3b')][_0x0f09('0x41')]('nolimit')){_0x427ea9[_0x0f09('0x21')]=qs[_0x0f09('0x21')](_0x2b500a['query'][_0x0f09('0x21')]);_0x427ea9[_0x0f09('0x20')]=qs[_0x0f09('0x20')](_0x2b500a[_0x0f09('0x3b')]['offset']);}_0x427ea9['order']=qs[_0x0f09('0x43')](_0x2b500a[_0x0f09('0x3b')][_0x0f09('0x43')]);_0x427ea9[_0x0f09('0x44')]=qs[_0x0f09('0x45')](_['pick'](_0x2b500a[_0x0f09('0x3b')],_0xe75be3[_0x0f09('0x45')]));_0x427ea9[_0x0f09('0x44')][_0x0f09('0x65')]=_0x438136['id'];if(_0x2b500a[_0x0f09('0x3b')]['filter']){_0x427ea9[_0x0f09('0x44')]=_[_0x0f09('0x47')](_0x427ea9[_0x0f09('0x44')],{'$or':_[_0x0f09('0x30')](_0x427ea9[_0x0f09('0x3e')],function(_0x443ea5){var _0x32bd76={};_0x32bd76[_0x443ea5]={'$like':'%'+_0x2b500a[_0x0f09('0x3b')][_0x0f09('0x2f')]+'%'};return _0x32bd76;})});}_0x427ea9=_[_0x0f09('0x47')]({},_0x427ea9,_0x2b500a[_0x0f09('0x49')]);return db['CmHopperFinal']['count']({'where':_0x427ea9[_0x0f09('0x44')]})[_0x0f09('0x29')](function(_0x2ba5b8){_0x241ba3[_0x0f09('0x23')]=_0x2ba5b8;if(_0x2b500a[_0x0f09('0x3b')][_0x0f09('0x5b')]){_0x427ea9[_0x0f09('0x4b')]=[{'all':!![]}];}return db[_0x0f09('0x6a')][_0x0f09('0x66')](_0x427ea9);})[_0x0f09('0x29')](function(_0x189e5c){_0x241ba3[_0x0f09('0x4c')]=_0x189e5c;return _0x241ba3;});}})['then'](respondWithFilteredResult(_0x34a33d,_0x427ea9))[_0x0f09('0x4d')](handleError(_0x34a33d,null));};exports[_0x0f09('0x6b')]=function(_0x2e6e80,_0x4ea2bc,_0x33d2f8){var _0xdb8dbc={'raw':!![],'where':{}};var _0x5b817f={};var _0x556f9a={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x0f09('0x62')]({'where':{'id':_0x2e6e80[_0x0f09('0x5a')]['id']}})[_0x0f09('0x29')](handleEntityNotFound(_0x4ea2bc,null))[_0x0f09('0x29')](function(_0xd7b227){if(_0xd7b227){_0x5b817f[_0x0f09('0x3a')]=_[_0x0f09('0x3c')](db[_0x0f09('0x6c')][_0x0f09('0x38')]);_0x5b817f[_0x0f09('0x3b')]=_[_0x0f09('0x3c')](_0x2e6e80[_0x0f09('0x3b')]);_0x5b817f['filters']=_['intersection'](_0x5b817f['model'],_0x5b817f[_0x0f09('0x3b')]);_0xdb8dbc[_0x0f09('0x3e')]=_[_0x0f09('0x3d')](_0x5b817f['model'],qs['fields'](_0x2e6e80['query']['fields']));_0xdb8dbc['attributes']=_0xdb8dbc['attributes'][_0x0f09('0x40')]?_0xdb8dbc[_0x0f09('0x3e')]:_0x5b817f[_0x0f09('0x3a')];if(!_0x2e6e80[_0x0f09('0x3b')]['hasOwnProperty'](_0x0f09('0x64'))){_0xdb8dbc['limit']=qs[_0x0f09('0x21')](_0x2e6e80[_0x0f09('0x3b')][_0x0f09('0x21')]);_0xdb8dbc[_0x0f09('0x20')]=qs[_0x0f09('0x20')](_0x2e6e80[_0x0f09('0x3b')][_0x0f09('0x20')]);}_0xdb8dbc[_0x0f09('0x42')]=qs[_0x0f09('0x43')](_0x2e6e80['query']['sort']);_0xdb8dbc[_0x0f09('0x44')]=qs['filters'](_['pick'](_0x2e6e80[_0x0f09('0x3b')],_0x5b817f[_0x0f09('0x45')]));_0xdb8dbc[_0x0f09('0x44')][_0x0f09('0x65')]=_0xd7b227['id'];if(_0x2e6e80[_0x0f09('0x3b')][_0x0f09('0x2f')]){_0xdb8dbc[_0x0f09('0x44')]=_[_0x0f09('0x47')](_0xdb8dbc[_0x0f09('0x44')],{'$or':_[_0x0f09('0x30')](_0xdb8dbc[_0x0f09('0x3e')],function(_0x4d1c65){var _0x490356={};_0x490356[_0x4d1c65]={'$like':'%'+_0x2e6e80[_0x0f09('0x3b')][_0x0f09('0x2f')]+'%'};return _0x490356;})});}_0xdb8dbc=_['merge']({},_0xdb8dbc,_0x2e6e80['options']);return db[_0x0f09('0x6c')]['count']({'where':_0xdb8dbc['where']})[_0x0f09('0x29')](function(_0x510811){_0x556f9a['count']=_0x510811;if(_0x2e6e80['query'][_0x0f09('0x5b')]){_0xdb8dbc[_0x0f09('0x4b')]=[{'all':!![]}];}return db[_0x0f09('0x6c')][_0x0f09('0x66')](_0xdb8dbc);})['then'](function(_0x3c916a){_0x556f9a[_0x0f09('0x4c')]=_0x3c916a;return _0x556f9a;});}})[_0x0f09('0x29')](respondWithFilteredResult(_0x4ea2bc,_0xdb8dbc))[_0x0f09('0x4d')](handleError(_0x4ea2bc,null));};exports[_0x0f09('0x6d')]=function(_0x370931,_0x35549b,_0x27cfa4){var _0x5b8767={};var _0x4b7015={};var _0x50006a;var _0x151e77;return db['VoiceQueue']['findOne']({'where':{'id':_0x370931['params']['id']}})[_0x0f09('0x29')](handleEntityNotFound(_0x35549b,null))[_0x0f09('0x29')](function(_0x3e22e9){if(_0x3e22e9){_0x50006a=_0x3e22e9;_0x4b7015['model']=_['keys'](db[_0x0f09('0x6e')]['rawAttributes']);_0x4b7015[_0x0f09('0x3b')]=_[_0x0f09('0x3c')](_0x370931[_0x0f09('0x3b')]);_0x4b7015[_0x0f09('0x45')]=_[_0x0f09('0x3d')](_0x4b7015[_0x0f09('0x3a')],_0x4b7015[_0x0f09('0x3b')]);_0x5b8767[_0x0f09('0x3e')]=_['intersection'](_0x4b7015[_0x0f09('0x3a')],qs['fields'](_0x370931['query']['fields']));_0x5b8767[_0x0f09('0x3e')]=_0x5b8767['attributes'][_0x0f09('0x40')]?_0x5b8767[_0x0f09('0x3e')]:_0x4b7015[_0x0f09('0x3a')];_0x5b8767['order']=qs['sort'](_0x370931[_0x0f09('0x3b')][_0x0f09('0x43')]);_0x5b8767[_0x0f09('0x44')]=qs[_0x0f09('0x45')](_[_0x0f09('0x46')](_0x370931[_0x0f09('0x3b')],_0x4b7015['filters']));if(_0x370931[_0x0f09('0x3b')]['filter']){_0x5b8767[_0x0f09('0x44')]=_[_0x0f09('0x47')](_0x5b8767['where'],{'$or':_['map'](_0x5b8767['attributes'],function(_0x166def){var _0x74941d={};_0x74941d[_0x166def]={'$like':'%'+_0x370931[_0x0f09('0x3b')]['filter']+'%'};return _0x74941d;})});}_0x5b8767=_['merge']({},_0x5b8767,_0x370931['options']);return _0x50006a[_0x0f09('0x6d')](_0x5b8767);}})[_0x0f09('0x29')](function(_0x2c45ed){if(_0x2c45ed){_0x151e77=_0x2c45ed[_0x0f09('0x40')];if(!_0x370931[_0x0f09('0x3b')][_0x0f09('0x41')]('nolimit')){_0x5b8767['limit']=qs[_0x0f09('0x21')](_0x370931[_0x0f09('0x3b')][_0x0f09('0x21')]);_0x5b8767[_0x0f09('0x20')]=qs['offset'](_0x370931['query']['offset']);}return _0x50006a[_0x0f09('0x6d')](_0x5b8767);}})[_0x0f09('0x29')](function(_0x376255){if(_0x376255){return _0x376255?{'count':_0x151e77,'rows':_0x376255}:null;}})['then'](respondWithResult(_0x35549b,null))[_0x0f09('0x4d')](handleError(_0x35549b,null));};exports[_0x0f09('0x6f')]=function(_0x6ec118,_0x2a468c,_0x1c043c){var _0x22ffa3=_0x6ec118[_0x0f09('0x50')][_0x0f09('0x70')];var _0x382f37=_[_0x0f09('0x30')](_0x22ffa3,'id');return db[_0x0f09('0x6e')][_0x0f09('0x66')]({'where':{'id':_0x382f37},'attributes':['id'],'include':[{'model':db[_0x0f09('0x71')],'as':_0x0f09('0x72'),'attributes':['id','name',_0x0f09('0x73'),'voicePause','interface'],'raw':!![]}]})[_0x0f09('0x29')](function(_0x29a61b){if(_0x29a61b){var _0x4b07c4=_[_0x0f09('0x74')](_0x29a61b,function(_0x552385){var _0x5cfc11=_0x552385['get']({'plain':!![]});_0x5cfc11[_0x0f09('0x72')]['forEach'](function(_0x1d1a5b){_0x1d1a5b[_0x0f09('0x75')]=_['find'](_0x22ffa3,{'id':_0x5cfc11['id']})[_0x0f09('0x75')];});return _0x5cfc11[_0x0f09('0x72')];});return db[_0x0f09('0x4a')][_0x0f09('0x34')]({'where':{'id':_0x6ec118['params']['id']}})[_0x0f09('0x29')](function(_0x293a93){return db['sequelize']['transaction'](function(_0x42bc30){return _0x293a93['addTeams'](_0x382f37,{'transaction':_0x42bc30})['then'](function(){return BPromise['each'](_0x22ffa3,function(_0x51cad9){return db[_0x0f09('0x76')]['upsert']({'TeamId':_0x51cad9['id'],'VoiceQueueId':_0x6ec118[_0x0f09('0x5a')]['id'],'penalty':_0x51cad9[_0x0f09('0x75')]},{'transaction':_0x42bc30});});})[_0x0f09('0x29')](function(){return BPromise['each'](_0x4b07c4,function(_0x49a7df){return db['UserVoiceQueue']['findOrCreate']({'where':{'UserId':_0x49a7df['id'],'VoiceQueueId':_0x6ec118[_0x0f09('0x5a')]['id']},'defaults':{'penalty':_0x49a7df[_0x0f09('0x75')]},'transaction':_0x42bc30});});})['then'](function(){return BPromise[_0x0f09('0x77')](_[_0x0f09('0x2f')](_0x4b07c4,{'online':!![]}),function(_0x4eeee1){return db[_0x0f09('0x78')][_0x0f09('0x79')]({'membername':_0x4eeee1[_0x0f09('0x35')],'UserId':_0x4eeee1['id'],'queue_name':_0x293a93[_0x0f09('0x35')],'VoiceQueueId':_0x293a93['id'],'interface':_[_0x0f09('0x7a')](_0x4eeee1[_0x0f09('0x7b')])?util[_0x0f09('0x7c')]('SIP/%s',_0x4eeee1[_0x0f09('0x35')]):_0x4eeee1['interface'],'paused':_0x4eeee1[_0x0f09('0x7d')]||![],'penalty':_0x4eeee1['penalty']},{'transaction':_0x42bc30});});})[_0x0f09('0x29')](function(){_0x4b07c4['forEach'](function(_0x13a9b9){socket[_0x0f09('0x7e')](_0x0f09('0x7f'),{'UserId':_0x13a9b9['id'],'VoiceQueueId':_0x293a93['id']});});});});});}})[_0x0f09('0x29')](respondWithStatusCode(_0x2a468c,null))[_0x0f09('0x4d')](handleError(_0x2a468c,null));};exports['removeTeams']=function(_0x1014ad,_0x5a3f94,_0x20faf8){return db[_0x0f09('0x6e')][_0x0f09('0x66')]({'where':{'id':_0x1014ad[_0x0f09('0x3b')][_0x0f09('0x80')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0f09('0x72'),'attributes':['id'],'raw':!![]}]})[_0x0f09('0x29')](handleEntityNotFound(_0x5a3f94,null))[_0x0f09('0x29')](function(_0xfeb19c){var _0x53d5d9=_['map'](_0xfeb19c,'id');var _0x21bedb=[];var _0x44f47c=[];var _0x32e832=squel[_0x0f09('0x81')]();_0x32e832[_0x0f09('0x82')](_0x0f09('0x83'))['from'](_0x0f09('0x84'),'tq')[_0x0f09('0x85')](_0x0f09('0x86'),'ut',_0x0f09('0x87'))[_0x0f09('0x44')](_0x0f09('0x88'),_0x1014ad[_0x0f09('0x5a')]['id']);for(var _0x53c30a=0x0;_0x53c30a<_0xfeb19c[_0x0f09('0x40')];_0x53c30a+=0x1){let _0xbe7488=_0xfeb19c[_0x53c30a];for(var _0x524592=0x0;_0x524592<_0xbe7488[_0x0f09('0x72')][_0x0f09('0x40')];_0x524592+=0x1){let _0x123a5e=_0xbe7488[_0x0f09('0x72')][_0x524592];var _0x11804b=_0x32e832[_0x0f09('0x59')]();_0x11804b[_0x0f09('0x44')](_0x0f09('0x89'),_0x123a5e['id']);_0x44f47c[_0x0f09('0x8a')](db['sequelize'][_0x0f09('0x3b')](_0x11804b['toString'](),{'type':db[_0x0f09('0x8b')][_0x0f09('0x8c')]['SELECT']})[_0x0f09('0x29')](function(_0x4acc1c){if(_0x4acc1c['length']===0x1){return _0x123a5e['id'];}else{var _0x26d47f=_['every'](_[_0x0f09('0x30')](_0x4acc1c,_0x0f09('0x8d')),function(_0x158b18){return _[_0x0f09('0x32')](_0x53d5d9,_0x158b18);});if(_0x26d47f){return _0x123a5e['id'];}}}));}}return BPromise[_0x0f09('0x8e')](_0x44f47c)[_0x0f09('0x29')](function(_0x492218){_0x21bedb=_(_0x21bedb)[_0x0f09('0x8f')](_0x492218)[_0x0f09('0x90')]()[_0x0f09('0x31')]();return db[_0x0f09('0x4a')]['find']({'where':{'id':_0x1014ad[_0x0f09('0x5a')]['id']}})[_0x0f09('0x29')](function(_0x366f86){return db['sequelize'][_0x0f09('0x91')](function(_0x382789){return _0x366f86[_0x0f09('0x92')](_0x1014ad[_0x0f09('0x3b')][_0x0f09('0x80')],{'transaction':_0x382789})[_0x0f09('0x29')](function(){if(!_[_0x0f09('0x93')](_0x21bedb)){return _0x366f86[_0x0f09('0x94')](_0x21bedb,{'transaction':_0x382789})[_0x0f09('0x29')](function(){return db[_0x0f09('0x78')]['destroy']({'where':{'VoiceQueueId':_0x1014ad['params']['id'],'UserId':_0x21bedb},'transaction':_0x382789});});}})[_0x0f09('0x29')](function(){_0x21bedb[_0x0f09('0x95')](function(_0x29e41b){socket['emit'](_0x0f09('0x96'),{'UserId':_0x29e41b,'VoiceQueueId':_0x366f86['id']});});});});});});})[_0x0f09('0x29')](respondWithStatusCode(_0x5a3f94,null))['catch'](handleError(_0x5a3f94,null));};exports[_0x0f09('0x97')]=function(_0x1d2cc1,_0x28d9be,_0x5f5047){var _0x467ae7,_0x457342;return db[_0x0f09('0x4a')]['find']({'where':{'id':_0x1d2cc1['params']['id']}})[_0x0f09('0x29')](handleEntityNotFound(_0x28d9be,null))[_0x0f09('0x29')](function(_0x48379c){if(_0x48379c){_0x457342=_0x48379c;return _0x48379c[_0x0f09('0x97')](_0x1d2cc1[_0x0f09('0x50')]['ids'],_['omit'](_0x1d2cc1[_0x0f09('0x50')],[_0x0f09('0x80'),'id'])||{})[_0x0f09('0x98')](function(_0x114ff8){for(var _0x21cb28=0x0;_0x21cb28<_0x1d2cc1[_0x0f09('0x50')][_0x0f09('0x80')][_0x0f09('0x40')];_0x21cb28+=0x1){socket['emit'](_0x0f09('0x7f'),{'UserId':Number(_0x1d2cc1[_0x0f09('0x50')][_0x0f09('0x80')][_0x21cb28]),'VoiceQueueId':Number(_0x1d2cc1['params']['id'])});}return _0x114ff8;});}})['then'](function(_0x188767){_0x467ae7=_0x188767||[];if(_0x457342){return db['User'][_0x0f09('0x66')]({'where':{'id':_0x1d2cc1[_0x0f09('0x50')][_0x0f09('0x80')]},'attributes':['id','name',_0x0f09('0x73'),_0x0f09('0x7d'),'interface'],'raw':!![]});}})['then'](function(_0x23d9ec){if(!_[_0x0f09('0x93')](_0x23d9ec)){var _0x193b98=[];for(var _0x22ccc5=0x0;_0x22ccc5<_0x23d9ec[_0x0f09('0x40')];_0x22ccc5++){if(_0x23d9ec[_0x22ccc5][_0x0f09('0x73')]){_0x193b98[_0x0f09('0x8a')](db[_0x0f09('0x78')][_0x0f09('0x79')]({'membername':_0x23d9ec[_0x22ccc5][_0x0f09('0x35')],'UserId':_0x23d9ec[_0x22ccc5]['id'],'queue_name':_0x457342[_0x0f09('0x35')],'VoiceQueueId':_0x457342['id'],'interface':_[_0x0f09('0x7a')](_0x23d9ec[_0x22ccc5][_0x0f09('0x7b')])?util['format']('SIP/%s',_0x23d9ec[_0x22ccc5][_0x0f09('0x35')]):_0x23d9ec[_0x22ccc5]['interface'],'paused':_0x23d9ec[_0x22ccc5][_0x0f09('0x7d')]||![],'penalty':_0x1d2cc1[_0x0f09('0x50')][_0x0f09('0x75')]||0x0}));}}return BPromise[_0x0f09('0x8e')](_0x193b98);}})[_0x0f09('0x29')](function(){return _0x467ae7;})[_0x0f09('0x29')](respondWithResult(_0x28d9be,null))[_0x0f09('0x4d')](handleError(_0x28d9be,null));};exports['removeAgents']=function(_0x37b69c,_0x182fc5,_0x9d186e){return db[_0x0f09('0x4a')][_0x0f09('0x34')]({'where':{'id':_0x37b69c[_0x0f09('0x5a')]['id']}})[_0x0f09('0x29')](handleEntityNotFound(_0x182fc5,null))[_0x0f09('0x29')](function(_0x4e1e92){if(_0x4e1e92){return _0x4e1e92['removeAgents'](_0x37b69c['query'][_0x0f09('0x80')])[_0x0f09('0x29')](function(){if(_[_0x0f09('0x99')](_0x37b69c[_0x0f09('0x3b')][_0x0f09('0x80')])){for(var _0x3c83a9=0x0;_0x3c83a9<_0x37b69c[_0x0f09('0x3b')][_0x0f09('0x80')][_0x0f09('0x40')];_0x3c83a9+=0x1){socket[_0x0f09('0x7e')](_0x0f09('0x96'),{'UserId':Number(_0x37b69c[_0x0f09('0x3b')][_0x0f09('0x80')][_0x3c83a9]),'VoiceQueueId':Number(_0x37b69c[_0x0f09('0x5a')]['id'])});}}else{socket['emit'](_0x0f09('0x96'),{'UserId':Number(_0x37b69c['query']['ids']),'VoiceQueueId':Number(_0x37b69c[_0x0f09('0x5a')]['id'])});}});}})['then'](function(_0x8d23e2){return db[_0x0f09('0x78')][_0x0f09('0x2a')]({'where':{'VoiceQueueId':_0x37b69c[_0x0f09('0x5a')]['id'],'UserId':_0x37b69c[_0x0f09('0x3b')]['ids']}})['then'](function(){return _0x8d23e2;});})['then'](respondWithStatusCode(_0x182fc5,null))[_0x0f09('0x4d')](handleError(_0x182fc5,null));};exports['getAgents']=function(_0x597226,_0x25863a,_0x51436d){var _0x43e941={};var _0x114820={};var _0x63e2e7;var _0x473275;return db[_0x0f09('0x4a')][_0x0f09('0x62')]({'where':{'id':_0x597226[_0x0f09('0x5a')]['id']}})[_0x0f09('0x29')](handleEntityNotFound(_0x25863a,null))['then'](function(_0x3e6f11){if(_0x3e6f11){_0x63e2e7=_0x3e6f11;_0x114820['model']=_[_0x0f09('0x3c')](db[_0x0f09('0x71')]['rawAttributes']);_0x114820['query']=_[_0x0f09('0x3c')](_0x597226[_0x0f09('0x3b')]);_0x114820[_0x0f09('0x45')]=_[_0x0f09('0x3d')](_0x114820[_0x0f09('0x3a')],_0x114820[_0x0f09('0x3b')]);_0x43e941[_0x0f09('0x3e')]=_['intersection'](_0x114820[_0x0f09('0x3a')],qs[_0x0f09('0x3f')](_0x597226[_0x0f09('0x3b')][_0x0f09('0x3f')]));_0x43e941['attributes']=_0x43e941[_0x0f09('0x3e')]['length']?_0x43e941['attributes']:_0x114820[_0x0f09('0x3a')];_0x43e941[_0x0f09('0x42')]=qs[_0x0f09('0x43')](_0x597226[_0x0f09('0x3b')][_0x0f09('0x43')]);_0x43e941['where']=qs[_0x0f09('0x45')](_['pick'](_0x597226['query'],_0x114820[_0x0f09('0x45')]));if(_0x597226[_0x0f09('0x3b')]['filter']){_0x43e941[_0x0f09('0x44')]=_[_0x0f09('0x47')](_0x43e941['where'],{'$or':_[_0x0f09('0x30')](_0x43e941[_0x0f09('0x3e')],function(_0x1800b9){var _0x3e0dd7={};_0x3e0dd7[_0x1800b9]={'$like':'%'+_0x597226[_0x0f09('0x3b')][_0x0f09('0x2f')]+'%'};return _0x3e0dd7;})});}_0x43e941=_[_0x0f09('0x47')]({},_0x43e941,_0x597226['options']);return _0x63e2e7['getAgents'](_0x43e941);}})[_0x0f09('0x29')](function(_0x523bad){if(_0x523bad){_0x473275=_0x523bad[_0x0f09('0x40')];if(!_0x597226['query'][_0x0f09('0x41')](_0x0f09('0x64'))){_0x43e941[_0x0f09('0x21')]=qs[_0x0f09('0x21')](_0x597226['query'][_0x0f09('0x21')]);_0x43e941[_0x0f09('0x20')]=qs[_0x0f09('0x20')](_0x597226[_0x0f09('0x3b')][_0x0f09('0x20')]);}return _0x63e2e7[_0x0f09('0x9a')](_0x43e941);}})[_0x0f09('0x29')](function(_0x14f50a){if(_0x14f50a){return _0x14f50a?{'count':_0x473275,'rows':_0x14f50a}:null;}})[_0x0f09('0x29')](respondWithResult(_0x25863a,null))[_0x0f09('0x4d')](handleError(_0x25863a,null));};exports[_0x0f09('0x9b')]=function(_0x162d5c,_0x29527b,_0x28c182){var _0x183855={};var _0xe074f={};var _0x38c900;var _0x141d00;return db[_0x0f09('0x4a')][_0x0f09('0x62')]({'where':{'id':_0x162d5c[_0x0f09('0x5a')]['id']}})[_0x0f09('0x29')](handleEntityNotFound(_0x29527b,null))[_0x0f09('0x29')](function(_0x386bd9){if(_0x386bd9){_0x38c900=_0x386bd9;_0xe074f[_0x0f09('0x3a')]=_['keys'](db[_0x0f09('0x78')][_0x0f09('0x38')]);_0xe074f[_0x0f09('0x3b')]=_[_0x0f09('0x3c')](_0x162d5c[_0x0f09('0x3b')]);_0xe074f[_0x0f09('0x45')]=_['intersection'](_0xe074f[_0x0f09('0x3a')],_0xe074f[_0x0f09('0x3b')]);_0x183855[_0x0f09('0x3e')]=_[_0x0f09('0x3d')](_0xe074f['model'],qs[_0x0f09('0x3f')](_0x162d5c[_0x0f09('0x3b')][_0x0f09('0x3f')]));_0x183855[_0x0f09('0x3e')]=_0x183855[_0x0f09('0x3e')][_0x0f09('0x40')]?_0x183855[_0x0f09('0x3e')]:_0xe074f[_0x0f09('0x3a')];_0x183855['order']=qs[_0x0f09('0x43')](_0x162d5c['query'][_0x0f09('0x43')]);_0x183855[_0x0f09('0x44')]=qs[_0x0f09('0x45')](_[_0x0f09('0x46')](_0x162d5c[_0x0f09('0x3b')],_0xe074f[_0x0f09('0x45')]));if(_0x162d5c[_0x0f09('0x3b')][_0x0f09('0x2f')]){_0x183855[_0x0f09('0x44')]=_[_0x0f09('0x47')](_0x183855['where'],{'$or':_[_0x0f09('0x30')](_0x183855['attributes'],function(_0x38c342){var _0x2b8e51={};_0x2b8e51[_0x38c342]={'$like':'%'+_0x162d5c[_0x0f09('0x3b')][_0x0f09('0x2f')]+'%'};return _0x2b8e51;})});}_0x183855=_[_0x0f09('0x47')]({},_0x183855,_0x162d5c[_0x0f09('0x49')]);return _0x38c900['getMembers'](_0x183855);}})[_0x0f09('0x29')](function(_0x3f64cd){if(_0x3f64cd){_0x141d00=_0x3f64cd[_0x0f09('0x40')];if(!_0x162d5c['query'][_0x0f09('0x41')](_0x0f09('0x64'))){_0x183855['limit']=qs[_0x0f09('0x21')](_0x162d5c['query'][_0x0f09('0x21')]);_0x183855[_0x0f09('0x20')]=qs['offset'](_0x162d5c[_0x0f09('0x3b')][_0x0f09('0x20')]);}return _0x38c900[_0x0f09('0x9b')](_0x183855);}})['then'](function(_0x22508e){return _0x22508e?{'count':_0x141d00,'rows':_0x22508e}:null;})[_0x0f09('0x29')](respondWithResult(_0x29527b,null))[_0x0f09('0x4d')](handleError(_0x29527b,null));};exports[_0x0f09('0x9c')]=function(_0x5937a1,_0xcb47fa,_0x121324){var _0x380a76={};var _0x5e30da={};var _0x5c16bf;var _0x3a9b81;return db[_0x0f09('0x4a')][_0x0f09('0x62')]({'where':{'id':_0x5937a1[_0x0f09('0x5a')]['id']}})['then'](handleEntityNotFound(_0xcb47fa,null))['then'](function(_0x3da2a){if(_0x3da2a){_0x5c16bf=_0x3da2a;_0x5e30da['model']=_[_0x0f09('0x3c')](db[_0x0f09('0x9d')][_0x0f09('0x38')]);_0x5e30da[_0x0f09('0x3b')]=_[_0x0f09('0x3c')](_0x5937a1['query']);_0x5e30da['filters']=_[_0x0f09('0x3d')](_0x5e30da[_0x0f09('0x3a')],_0x5e30da[_0x0f09('0x3b')]);_0x380a76[_0x0f09('0x3e')]=_[_0x0f09('0x3d')](_0x5e30da[_0x0f09('0x3a')],qs[_0x0f09('0x3f')](_0x5937a1['query']['fields']));_0x380a76[_0x0f09('0x3e')]=_0x380a76[_0x0f09('0x3e')]['length']?_0x380a76[_0x0f09('0x3e')]:_0x5e30da['model'];_0x380a76['order']=qs[_0x0f09('0x43')](_0x5937a1[_0x0f09('0x3b')][_0x0f09('0x43')]);_0x380a76[_0x0f09('0x44')]=qs[_0x0f09('0x45')](_['pick'](_0x5937a1['query'],_0x5e30da[_0x0f09('0x45')]));if(_0x5937a1[_0x0f09('0x3b')][_0x0f09('0x2f')]){_0x380a76[_0x0f09('0x44')]=_[_0x0f09('0x47')](_0x380a76[_0x0f09('0x44')],{'$or':_[_0x0f09('0x30')](_0x380a76[_0x0f09('0x3e')],function(_0x12cf4e){var _0x5783e0={};_0x5783e0[_0x12cf4e]={'$like':'%'+_0x5937a1['query'][_0x0f09('0x2f')]+'%'};return _0x5783e0;})});}_0x380a76=_['merge']({},_0x380a76,_0x5937a1[_0x0f09('0x49')]);return _0x5c16bf[_0x0f09('0x9c')](_0x380a76);}})['then'](function(_0x1488a0){if(_0x1488a0){_0x3a9b81=_0x1488a0[_0x0f09('0x40')];if(!_0x5937a1[_0x0f09('0x3b')][_0x0f09('0x41')](_0x0f09('0x64'))){_0x380a76[_0x0f09('0x21')]=qs[_0x0f09('0x21')](_0x5937a1['query']['limit']);_0x380a76[_0x0f09('0x20')]=qs[_0x0f09('0x20')](_0x5937a1['query'][_0x0f09('0x20')]);}return _0x5c16bf['getLists'](_0x380a76);}})[_0x0f09('0x29')](function(_0x33aaf8){if(_0x33aaf8){return _0x33aaf8?{'count':_0x3a9b81,'rows':_0x33aaf8}:null;}})[_0x0f09('0x29')](respondWithResult(_0xcb47fa,null))[_0x0f09('0x4d')](handleError(_0xcb47fa,null));};exports[_0x0f09('0x9e')]=function(_0x58e19d,_0x2c4a76,_0x2fe9b0){var _0x3b0f23,_0x10b262;return db['VoiceQueue'][_0x0f09('0x34')]({'where':{'id':_0x58e19d[_0x0f09('0x5a')]['id']}})[_0x0f09('0x29')](handleEntityNotFound(_0x2c4a76,null))['then'](function(_0x34f068){if(_0x34f068){_0x10b262=_0x34f068;return _0x34f068[_0x0f09('0x9e')](_0x58e19d[_0x0f09('0x50')]['ids'],_[_0x0f09('0x5c')](_0x58e19d[_0x0f09('0x50')],['ids','id'])||{});}return null;})[_0x0f09('0x98')](function(_0x405681){var _0x34f60b;_0x3b0f23=_0x405681||[];var _0xe8f1a8=[];if(_0x405681){for(var _0x27a70e=0x0;_0x27a70e<_0x405681[_0x0f09('0x40')];_0x27a70e+=0x1){var _0x114157=_0x405681[_0x27a70e]['get']({'plain':!![]});_0x10b262['dialCheckDuplicateType']=_0x58e19d[_0x0f09('0x50')][_0x0f09('0x9f')]?_0x58e19d[_0x0f09('0x50')][_0x0f09('0x9f')]:_0x10b262[_0x0f09('0x9f')];switch(_0x10b262['dialCheckDuplicateType']){case _0x0f09('0xa0'):_0x34f60b=squel[_0x0f09('0xa1')]()[_0x0f09('0xa2')](_0x0f09('0xa3'))[_0x0f09('0xa4')](['phone',_0x0f09('0xa5'),_0x0f09('0xa6'),_0x0f09('0xa7'),_0x0f09('0x65'),_0x0f09('0x5d'),_0x0f09('0x5e')],squel[_0x0f09('0x81')]()['field'](_0x0f09('0xa8'),'phone')[_0x0f09('0x82')](_0x0f09('0xa9'),_0x0f09('0xa5'))[_0x0f09('0x82')]('id',_0x0f09('0xa6'))[_0x0f09('0x82')](_0x114157[_0x0f09('0xaa')][_0x0f09('0xab')](),_0x0f09('0xa7'))[_0x0f09('0x82')](_0x58e19d[_0x0f09('0x5a')]['id'][_0x0f09('0xab')](),_0x0f09('0x65'))['field'](_0x0f09('0xa9'),_0x0f09('0x5d'))[_0x0f09('0x82')](_0x0f09('0xa9'),_0x0f09('0x5e'))['from'](_0x0f09('0xac'))['where'](_0x0f09('0xad'))[_0x0f09('0x44')](_0x0f09('0xae'),_0x114157['CmListId'][_0x0f09('0xab')]())[_0x0f09('0x44')]('phone\x20IS\x20NOT\x20NULL')[_0x0f09('0x44')](_0x0f09('0xaf'),squel['select']()[_0x0f09('0x82')](_0x0f09('0xb0'))[_0x0f09('0xb1')](_0x0f09('0xb2'))[_0x0f09('0x44')](_0x0f09('0x88'),_0x58e19d['params']['id'][_0x0f09('0xab')]()))[_0x0f09('0x44')](_0x0f09('0xaf'),squel['select']()[_0x0f09('0x82')]('COALESCE(phone,\x27\x27)')[_0x0f09('0xb1')]('cm_hopper')['where'](_0x0f09('0x88'),_0x58e19d[_0x0f09('0x5a')]['id'][_0x0f09('0xab')]())))['toString']();break;case'onlyIfOpen':_0x34f60b=squel[_0x0f09('0xa1')]()['into'](_0x0f09('0xa3'))[_0x0f09('0xa4')]([_0x0f09('0xa8'),_0x0f09('0xa5'),_0x0f09('0xa6'),_0x0f09('0xa7'),_0x0f09('0x65'),_0x0f09('0x5d'),_0x0f09('0x5e')],squel['select']()[_0x0f09('0x82')](_0x0f09('0xa8'),'phone')[_0x0f09('0x82')](_0x0f09('0xa9'),_0x0f09('0xa5'))[_0x0f09('0x82')]('id',_0x0f09('0xa6'))['field'](_0x114157['CmListId'][_0x0f09('0xab')](),_0x0f09('0xa7'))['field'](_0x58e19d['params']['id']['toString'](),_0x0f09('0x65'))['field'](_0x0f09('0xa9'),'createdAt')[_0x0f09('0x82')](_0x0f09('0xa9'),'updatedAt')['from']('cm_contacts')[_0x0f09('0x44')](_0x0f09('0xad'))[_0x0f09('0x44')](_0x0f09('0xae'),_0x114157[_0x0f09('0xaa')][_0x0f09('0xab')]())['where'](_0x0f09('0xb3'))[_0x0f09('0x44')](_0x0f09('0xaf'),squel[_0x0f09('0x81')]()[_0x0f09('0x82')](_0x0f09('0xb4'))[_0x0f09('0xb1')](_0x0f09('0xa3'))[_0x0f09('0x44')](_0x0f09('0x88'),_0x58e19d[_0x0f09('0x5a')]['id'][_0x0f09('0xab')]())))[_0x0f09('0xab')]();break;default:_0x34f60b=squel[_0x0f09('0xa1')]()[_0x0f09('0xa2')](_0x0f09('0xa3'))['fromQuery'](['phone',_0x0f09('0xa5'),_0x0f09('0xa6'),'ListId',_0x0f09('0x65'),_0x0f09('0x5d'),_0x0f09('0x5e')],squel[_0x0f09('0x81')]()[_0x0f09('0x82')](_0x0f09('0xa8'),_0x0f09('0xa8'))[_0x0f09('0x82')](_0x0f09('0xa9'),_0x0f09('0xa5'))[_0x0f09('0x82')]('id',_0x0f09('0xa6'))[_0x0f09('0x82')](_0x114157[_0x0f09('0xaa')]['toString'](),_0x0f09('0xa7'))[_0x0f09('0x82')](_0x58e19d['params']['id'][_0x0f09('0xab')](),'VoiceQueueId')[_0x0f09('0x82')]('NOW()','createdAt')[_0x0f09('0x82')](_0x0f09('0xa9'),_0x0f09('0x5e'))[_0x0f09('0xb1')](_0x0f09('0xac'))['where']('deletedAt\x20IS\x20NULL')[_0x0f09('0x44')](_0x0f09('0xae'),_0x114157[_0x0f09('0xaa')][_0x0f09('0xab')]())['where'](_0x0f09('0xb3')))['toString']();}_0xe8f1a8['push'](db[_0x0f09('0x8b')][_0x0f09('0x3b')](_0x34f60b));}return BPromise['all'](_0xe8f1a8);}})[_0x0f09('0x29')](function(){return _0x3b0f23;})[_0x0f09('0x29')](respondWithResult(_0x2c4a76,null))['catch'](handleError(_0x2c4a76,null));};exports[_0x0f09('0xb5')]=function(_0x51b96c,_0xa63ae2,_0x29b7b0){return db['VoiceQueue']['find']({'where':{'id':_0x51b96c['params']['id']}})[_0x0f09('0x29')](handleEntityNotFound(_0xa63ae2,null))[_0x0f09('0x29')](function(_0x5860c4){if(_0x5860c4){return _0x5860c4[_0x0f09('0xb5')](_0x51b96c[_0x0f09('0x3b')]['ids']);}})[_0x0f09('0x29')](function(_0x84f818){if(_0x84f818){return db['CmHopper'][_0x0f09('0x2a')]({'where':{'ListId':_0x51b96c['query'][_0x0f09('0x80')],'VoiceQueueId':_0x51b96c[_0x0f09('0x5a')]['id']}})['then'](function(){return _0x84f818;});}})[_0x0f09('0x29')](respondWithStatusCode(_0xa63ae2,null))[_0x0f09('0x4d')](handleError(_0xa63ae2,null));};exports[_0x0f09('0xb6')]=function(_0x3cea04,_0x5853a6,_0x413f89){var _0x164769={};var _0x2dc913={};var _0x17d7e7;var _0x5382a1;return db[_0x0f09('0x4a')][_0x0f09('0x62')]({'where':{'id':_0x3cea04[_0x0f09('0x5a')]['id']}})[_0x0f09('0x29')](handleEntityNotFound(_0x5853a6,null))['then'](function(_0x292e28){if(_0x292e28){_0x17d7e7=_0x292e28;_0x2dc913[_0x0f09('0x3a')]=_[_0x0f09('0x3c')](db['CmList']['rawAttributes']);_0x2dc913['query']=_['keys'](_0x3cea04['query']);_0x2dc913[_0x0f09('0x45')]=_[_0x0f09('0x3d')](_0x2dc913['model'],_0x2dc913[_0x0f09('0x3b')]);_0x164769['attributes']=_[_0x0f09('0x3d')](_0x2dc913[_0x0f09('0x3a')],qs[_0x0f09('0x3f')](_0x3cea04[_0x0f09('0x3b')][_0x0f09('0x3f')]));_0x164769[_0x0f09('0x3e')]=_0x164769['attributes'][_0x0f09('0x40')]?_0x164769[_0x0f09('0x3e')]:_0x2dc913[_0x0f09('0x3a')];_0x164769[_0x0f09('0x42')]=qs['sort'](_0x3cea04[_0x0f09('0x3b')][_0x0f09('0x43')]);_0x164769[_0x0f09('0x44')]=qs[_0x0f09('0x45')](_[_0x0f09('0x46')](_0x3cea04['query'],_0x2dc913[_0x0f09('0x45')]));if(_0x3cea04[_0x0f09('0x3b')][_0x0f09('0x2f')]){_0x164769[_0x0f09('0x44')]=_[_0x0f09('0x47')](_0x164769[_0x0f09('0x44')],{'$or':_[_0x0f09('0x30')](_0x164769['attributes'],function(_0x4e4fbb){var _0x436863={};_0x436863[_0x4e4fbb]={'$like':'%'+_0x3cea04['query'][_0x0f09('0x2f')]+'%'};return _0x436863;})});}_0x164769=_[_0x0f09('0x47')]({},_0x164769,_0x3cea04[_0x0f09('0x49')]);return _0x17d7e7[_0x0f09('0xb6')](_0x164769);}})[_0x0f09('0x29')](function(_0x1397e9){if(_0x1397e9){_0x5382a1=_0x1397e9[_0x0f09('0x40')];if(!_0x3cea04['query'][_0x0f09('0x41')]('nolimit')){_0x164769[_0x0f09('0x21')]=qs['limit'](_0x3cea04['query'][_0x0f09('0x21')]);_0x164769[_0x0f09('0x20')]=qs[_0x0f09('0x20')](_0x3cea04[_0x0f09('0x3b')][_0x0f09('0x20')]);}return _0x17d7e7[_0x0f09('0xb6')](_0x164769);}})[_0x0f09('0x29')](function(_0x1b5d77){if(_0x1b5d77){return _0x1b5d77?{'count':_0x5382a1,'rows':_0x1b5d77}:null;}})[_0x0f09('0x29')](respondWithResult(_0x5853a6,null))[_0x0f09('0x4d')](handleError(_0x5853a6,null));};exports[_0x0f09('0xb7')]=function(_0x45dd85,_0x3ad2d0,_0x488770){var _0x1b9716,_0x5b1eb5;return db[_0x0f09('0x4a')][_0x0f09('0x34')]({'where':{'id':_0x45dd85['params']['id']}})[_0x0f09('0x29')](handleEntityNotFound(_0x3ad2d0,null))['then'](function(_0x21529c){if(_0x21529c){_0x5b1eb5=_0x21529c;return _0x21529c[_0x0f09('0xb7')](_0x45dd85[_0x0f09('0x50')]['ids'],_[_0x0f09('0x5c')](_0x45dd85[_0x0f09('0x50')],[_0x0f09('0x80'),'id'])||{});}return null;})[_0x0f09('0x98')](function(_0x2e888b){var _0x45151e;_0x1b9716=_0x2e888b||[];var _0x3d9421=[];if(_0x2e888b){for(var _0x225155=0x0;_0x225155<_0x2e888b[_0x0f09('0x40')];_0x225155+=0x1){var _0x1e13fc=_0x2e888b[_0x225155][_0x0f09('0x2b')]({'plain':!![]});_0x45151e=squel[_0x0f09('0xa1')]()['into']('cm_hopper_black')[_0x0f09('0xa4')]([_0x0f09('0xa8'),'ContactId',_0x0f09('0xa7'),'VoiceQueueId',_0x0f09('0x5d'),_0x0f09('0x5e')],squel[_0x0f09('0x81')]()['field'](_0x0f09('0xa8'),_0x0f09('0xa8'))['field']('id',_0x0f09('0xa6'))[_0x0f09('0x82')](_0x1e13fc[_0x0f09('0xaa')][_0x0f09('0xab')](),_0x0f09('0xa7'))[_0x0f09('0x82')](_0x45dd85[_0x0f09('0x5a')]['id']['toString'](),_0x0f09('0x65'))[_0x0f09('0x82')](_0x0f09('0xa9'),_0x0f09('0x5d'))[_0x0f09('0x82')](_0x0f09('0xa9'),'updatedAt')[_0x0f09('0xb1')](_0x0f09('0xac'))[_0x0f09('0x44')](_0x0f09('0xad'))[_0x0f09('0x44')](_0x0f09('0xae'),_0x1e13fc[_0x0f09('0xaa')]['toString']())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x0f09('0xab')]();_0x3d9421[_0x0f09('0x8a')](db[_0x0f09('0x8b')][_0x0f09('0x3b')](_0x45151e));}return BPromise[_0x0f09('0x8e')](_0x3d9421);}})[_0x0f09('0x29')](function(){return _0x1b9716;})[_0x0f09('0x29')](respondWithResult(_0x3ad2d0,null))[_0x0f09('0x4d')](handleError(_0x3ad2d0,null));};exports[_0x0f09('0xb8')]=function(_0x5b8550,_0x2f753a,_0x1ff64c){return db['VoiceQueue']['find']({'where':{'id':_0x5b8550[_0x0f09('0x5a')]['id']}})[_0x0f09('0x29')](handleEntityNotFound(_0x2f753a,null))[_0x0f09('0x29')](function(_0x5d6d3b){if(_0x5d6d3b){return _0x5d6d3b[_0x0f09('0xb8')](_0x5b8550[_0x0f09('0x3b')][_0x0f09('0x80')]);}})['then'](function(_0x1a2ca3){if(_0x1a2ca3){return db['CmHopperBlack'][_0x0f09('0x2a')]({'where':{'ListId':_0x5b8550[_0x0f09('0x3b')]['ids'],'VoiceQueueId':_0x5b8550['params']['id']}})[_0x0f09('0x29')](function(){return _0x1a2ca3;});}})[_0x0f09('0x29')](respondWithStatusCode(_0x2f753a,null))[_0x0f09('0x4d')](handleError(_0x2f753a,null));}; \ No newline at end of file +var _0x07e9=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','outbound','find','userProfileId','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','includeAll','omit','updatedAt','createdAt','VoiceQueues','UserProfileSection','update','CmHopper','nolimit','VoiceQueueId','rows','findOne','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','interface','flatMap','forEach','penalty','sequelize','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','emit','removeTeams','ids','select','field','tq.TeamId','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','all','isEmpty','removeAgents','userVoiceQueue:remove','spread','userVoiceQueue:save','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','ContactId','ListId','phone','scheduledAt','toString','NOW()','from','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_contacts','deletedAt\x20IS\x20NULL','push','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','inbound','QueueCampaigns','filter','ignore','map','value','includes','type','name','UserProfileResource','stack','send','index','rawAttributes','key','query','keys','filters','fields','attributes','length','model','hasOwnProperty','order','sort','where','pick','VIRTUAL','merge','options','VoiceQueue','include','findAll','show','params','intersection','create','body','user','get'];(function(_0x3d34f0,_0x4a5dc0){var _0x135ecd=function(_0x9a81d5){while(--_0x9a81d5){_0x3d34f0['push'](_0x3d34f0['shift']());}};_0x135ecd(++_0x4a5dc0);}(_0x07e9,0x65));var _0x907e=function(_0x2663ac,_0x3521b5){_0x2663ac=_0x2663ac-0x0;var _0x353b70=_0x07e9[_0x2663ac];return _0x353b70;};'use strict';var emlformat=require(_0x907e('0x0'));var rimraf=require(_0x907e('0x1'));var zipdir=require(_0x907e('0x2'));var jsonpatch=require(_0x907e('0x3'));var rp=require('request-promise');var moment=require(_0x907e('0x4'));var BPromise=require(_0x907e('0x5'));var Mustache=require(_0x907e('0x6'));var util=require(_0x907e('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x907e('0x8'));var fs=require('fs');var fs_extra=require(_0x907e('0x9'));var _=require(_0x907e('0xa'));var squel=require(_0x907e('0xb'));var crypto=require('crypto');var jsforce=require(_0x907e('0xc'));var deskjs=require(_0x907e('0xd'));var toCsv=require('to-csv');var querystring=require(_0x907e('0xe'));var Papa=require(_0x907e('0xf'));var Redis=require(_0x907e('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x907e('0x11'));var logger=require(_0x907e('0x12'))(_0x907e('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x907e('0x14'))['db'];config[_0x907e('0x15')]=_[_0x907e('0x16')](config[_0x907e('0x15')],{'host':_0x907e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceQueue.socket')[_0x907e('0x18')](socket);function respondWithStatusCode(_0x530db2,_0x353d5b){_0x353d5b=_0x353d5b||0xcc;return function(_0x186d2d){if(_0x186d2d){return _0x530db2[_0x907e('0x19')](_0x353d5b);}return _0x530db2[_0x907e('0x1a')](_0x353d5b)[_0x907e('0x1b')]();};}function respondWithResult(_0x293e81,_0x215ac6){_0x215ac6=_0x215ac6||0xc8;return function(_0x46d2c7){if(_0x46d2c7){return _0x293e81[_0x907e('0x1a')](_0x215ac6)[_0x907e('0x1c')](_0x46d2c7);}};}function respondWithFilteredResult(_0x2d0e04,_0x5a2b43){return function(_0x4e5831){if(_0x4e5831){var _0x5c62b3=typeof _0x5a2b43[_0x907e('0x1d')]===_0x907e('0x1e')&&typeof _0x5a2b43[_0x907e('0x1f')]===_0x907e('0x1e');var _0xca88ac=_0x4e5831['count'];var _0x5375e6=_0x5c62b3?0x0:_0x5a2b43[_0x907e('0x1d')];var _0x43922a=_0x5c62b3?_0x4e5831[_0x907e('0x20')]:_0x5a2b43[_0x907e('0x1d')]+_0x5a2b43[_0x907e('0x1f')];var _0x1ce1e2;if(_0x43922a>=_0xca88ac){_0x43922a=_0xca88ac;_0x1ce1e2=0xc8;}else{_0x1ce1e2=0xce;}_0x2d0e04[_0x907e('0x1a')](_0x1ce1e2);return _0x2d0e04[_0x907e('0x21')](_0x907e('0x22'),_0x5375e6+'-'+_0x43922a+'/'+_0xca88ac)[_0x907e('0x1c')](_0x4e5831);}return null;};}function patchUpdates(_0x28d5c8){return function(_0x13c60e){try{jsonpatch[_0x907e('0x23')](_0x13c60e,_0x28d5c8,!![]);}catch(_0x55a364){return BPromise['reject'](_0x55a364);}return _0x13c60e[_0x907e('0x24')]();};}function saveUpdates(_0x4a8f31,_0x2c2776){return function(_0x7fdff5){if(_0x7fdff5){return _0x7fdff5['update'](_0x4a8f31)[_0x907e('0x25')](function(_0x4e7946){return _0x4e7946;});}return null;};}function removeEntity(_0x274ae3,_0x2b7b64){return function(_0x423ea8){if(_0x423ea8){return _0x423ea8[_0x907e('0x26')]()[_0x907e('0x25')](function(){var _0x4f20fa=_0x423ea8['get']({'plain':!![]});var _0x143e43=[{'name':'VoiceQueues','value':_0x907e('0x27'),'ignore':![]},{'name':_0x907e('0x28'),'value':'outbound','ignore':![]}];var _0x35ec20=_(_0x143e43)[_0x907e('0x29')](_0x907e('0x2a'))[_0x907e('0x2b')](_0x907e('0x2c'))[_0x907e('0x2c')]();if(_[_0x907e('0x2d')](_0x35ec20,_0x4f20fa[_0x907e('0x2e')])){return;}var _0x549dab=_['find'](_0x143e43,['value',_0x4f20fa[_0x907e('0x2e')]])[_0x907e('0x2f')];return db[_0x907e('0x30')][_0x907e('0x26')]({'where':{'type':_0x549dab,'resourceId':_0x4f20fa['id']}})[_0x907e('0x25')](function(){return _0x423ea8;});})[_0x907e('0x25')](function(){_0x274ae3[_0x907e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19e95e,_0x147cfe){return function(_0x3aea14){if(!_0x3aea14){_0x19e95e['sendStatus'](0x194);}return _0x3aea14;};}function handleError(_0xeb3546,_0x328292){_0x328292=_0x328292||0x1f4;return function(_0x4492e8){logger['error'](_0x4492e8[_0x907e('0x31')]);if(_0x4492e8[_0x907e('0x2f')]){delete _0x4492e8[_0x907e('0x2f')];}_0xeb3546[_0x907e('0x1a')](_0x328292)[_0x907e('0x32')](_0x4492e8);};}exports[_0x907e('0x33')]=function(_0x12bd1a,_0x419374){var _0x564a2b={},_0x1c032e={},_0x28bb9b={'count':0x0,'rows':[]};var _0x3db155=_[_0x907e('0x2b')](db['VoiceQueue'][_0x907e('0x34')],function(_0x29b7e4){return{'name':_0x29b7e4['fieldName'],'type':_0x29b7e4[_0x907e('0x2e')][_0x907e('0x35')]};});_0x1c032e['model']=_[_0x907e('0x2b')](_0x3db155,_0x907e('0x2f'));_0x1c032e[_0x907e('0x36')]=_[_0x907e('0x37')](_0x12bd1a[_0x907e('0x36')]);_0x1c032e[_0x907e('0x38')]=_['intersection'](_0x1c032e['model'],_0x1c032e[_0x907e('0x36')]);_0x564a2b['attributes']=_['intersection'](_0x1c032e['model'],qs[_0x907e('0x39')](_0x12bd1a[_0x907e('0x36')][_0x907e('0x39')]));_0x564a2b[_0x907e('0x3a')]=_0x564a2b['attributes'][_0x907e('0x3b')]?_0x564a2b[_0x907e('0x3a')]:_0x1c032e[_0x907e('0x3c')];if(!_0x12bd1a['query'][_0x907e('0x3d')]('nolimit')){_0x564a2b[_0x907e('0x1f')]=qs[_0x907e('0x1f')](_0x12bd1a[_0x907e('0x36')]['limit']);_0x564a2b[_0x907e('0x1d')]=qs[_0x907e('0x1d')](_0x12bd1a[_0x907e('0x36')][_0x907e('0x1d')]);}_0x564a2b[_0x907e('0x3e')]=qs[_0x907e('0x3f')](_0x12bd1a['query'][_0x907e('0x3f')]);_0x564a2b[_0x907e('0x40')]=qs[_0x907e('0x38')](_[_0x907e('0x41')](_0x12bd1a['query'],_0x1c032e[_0x907e('0x38')]),_0x3db155);if(_0x12bd1a['query'][_0x907e('0x29')]){_0x564a2b['where']=_['merge'](_0x564a2b[_0x907e('0x40')],{'$or':_[_0x907e('0x2b')](_0x3db155,function(_0x135486){if(_0x135486[_0x907e('0x2e')]!==_0x907e('0x42')){var _0x38b95d={};_0x38b95d[_0x135486['name']]={'$like':'%'+_0x12bd1a[_0x907e('0x36')][_0x907e('0x29')]+'%'};return _0x38b95d;}})});}_0x564a2b=_[_0x907e('0x43')]({},_0x564a2b,_0x12bd1a[_0x907e('0x44')]);var _0x2c97da={'where':_0x564a2b[_0x907e('0x40')]};return db[_0x907e('0x45')][_0x907e('0x20')](_0x2c97da)['then'](function(_0x30add2){_0x28bb9b[_0x907e('0x20')]=_0x30add2;if(_0x12bd1a['query']['includeAll']){_0x564a2b[_0x907e('0x46')]=[{'all':!![]}];}return db[_0x907e('0x45')][_0x907e('0x47')](_0x564a2b);})[_0x907e('0x25')](function(_0x1fbd71){_0x28bb9b['rows']=_0x1fbd71;return _0x28bb9b;})[_0x907e('0x25')](respondWithFilteredResult(_0x419374,_0x564a2b))['catch'](handleError(_0x419374,null));};exports[_0x907e('0x48')]=function(_0x3d9168,_0x251fe4){var _0x5a8095={'raw':![],'where':{'id':_0x3d9168[_0x907e('0x49')]['id']}},_0x51c51f={};_0x51c51f[_0x907e('0x3c')]=_['keys'](db[_0x907e('0x45')]['rawAttributes']);_0x51c51f['query']=_[_0x907e('0x37')](_0x3d9168[_0x907e('0x36')]);_0x51c51f[_0x907e('0x38')]=_[_0x907e('0x4a')](_0x51c51f[_0x907e('0x3c')],_0x51c51f[_0x907e('0x36')]);_0x5a8095[_0x907e('0x3a')]=_[_0x907e('0x4a')](_0x51c51f[_0x907e('0x3c')],qs[_0x907e('0x39')](_0x3d9168[_0x907e('0x36')][_0x907e('0x39')]));_0x5a8095[_0x907e('0x3a')]=_0x5a8095[_0x907e('0x3a')]['length']?_0x5a8095[_0x907e('0x3a')]:_0x51c51f[_0x907e('0x3c')];if(_0x3d9168['query']['includeAll']){_0x5a8095['include']=[{'all':!![]}];}_0x5a8095=_[_0x907e('0x43')]({},_0x5a8095,_0x3d9168[_0x907e('0x44')]);return db[_0x907e('0x45')]['find'](_0x5a8095)['then'](handleEntityNotFound(_0x251fe4,null))[_0x907e('0x25')](respondWithResult(_0x251fe4,null))['catch'](handleError(_0x251fe4,null));};exports[_0x907e('0x4b')]=function(_0xd6ab62,_0x2965e1){return db[_0x907e('0x45')][_0x907e('0x4b')](_0xd6ab62[_0x907e('0x4c')],{})['then'](function(_0x2ae360){var _0x721d89=_0xd6ab62[_0x907e('0x4d')][_0x907e('0x4e')]({'plain':!![]});if(!_0x721d89)throw new Error(_0x907e('0x4f'));if(_0x721d89[_0x907e('0x50')]===_0x907e('0x4d')){var _0xdc9578=_0x2ae360['get']({'plain':!![]});var _0x56321e=[{'name':'VoiceQueues','value':'inbound'},{'name':_0x907e('0x28'),'value':_0x907e('0x51')}];var _0x2df6d1=_[_0x907e('0x52')](_0x56321e,['value',_0xdc9578[_0x907e('0x2e')]])[_0x907e('0x2f')];return db['UserProfileSection'][_0x907e('0x52')]({'where':{'name':_0x2df6d1,'userProfileId':_0x721d89[_0x907e('0x53')]},'raw':!![]})[_0x907e('0x25')](function(_0x451a91){if(_0x451a91&&_0x451a91['autoAssociation']===0x0){return db[_0x907e('0x30')][_0x907e('0x4b')]({'name':_0xdc9578[_0x907e('0x2f')],'resourceId':_0xdc9578['id'],'type':_0x451a91[_0x907e('0x2f')],'sectionId':_0x451a91['id']},{})['then'](function(){return _0x2ae360;});}else{return _0x2ae360;}})[_0x907e('0x54')](function(_0x294ad9){logger[_0x907e('0x55')](_0x907e('0x56'),_0x294ad9);throw _0x294ad9;});}return _0x2ae360;})['then'](respondWithResult(_0x2965e1,0xc9))[_0x907e('0x54')](handleError(_0x2965e1,null));};exports[_0x907e('0x57')]=function(_0x329f02,_0x55083b){var _0x39480c={'where':{'id':_0x329f02[_0x907e('0x49')]['id']}},_0x5436b4={};_0x5436b4[_0x907e('0x3c')]=_[_0x907e('0x37')](db[_0x907e('0x45')][_0x907e('0x34')]);_0x39480c[_0x907e('0x3a')]=_['intersection'](_0x5436b4['model'],qs[_0x907e('0x39')](_0x329f02[_0x907e('0x36')][_0x907e('0x39')]));_0x39480c[_0x907e('0x3a')]=_0x39480c[_0x907e('0x3a')][_0x907e('0x3b')]?_0x39480c[_0x907e('0x3a')]:_0x5436b4['model'];if(_0x329f02[_0x907e('0x36')][_0x907e('0x58')]){_0x39480c['include']=[{'all':!![]}];}_0x39480c=_[_0x907e('0x43')]({},_0x39480c,_0x329f02[_0x907e('0x44')]);return db['VoiceQueue'][_0x907e('0x52')](_0x39480c)['then'](handleEntityNotFound(_0x55083b,null))[_0x907e('0x25')](function(_0x141c5b){if(_0x141c5b){var _0x1bbfdf=_0x141c5b[_0x907e('0x4e')]({'plain':!![]});_0x1bbfdf=qs[_0x907e('0x59')](_0x1bbfdf,['id','createdAt',_0x907e('0x5a')]);_0x329f02[_0x907e('0x4c')]=_[_0x907e('0x59')](_0x329f02[_0x907e('0x4c')],['id',_0x907e('0x5b'),_0x907e('0x5a')]);return db[_0x907e('0x45')][_0x907e('0x4b')](_[_0x907e('0x43')](_0x1bbfdf,_0x329f02[_0x907e('0x4c')]),{'include':_0x329f02[_0x907e('0x36')]['includeAll']?[{'all':!![]}]:undefined})[_0x907e('0x25')](function(_0x22f514){var _0x2cfac0=_0x329f02[_0x907e('0x4d')]['get']({'plain':!![]});if(!_0x2cfac0)throw new Error(_0x907e('0x4f'));if(_0x2cfac0[_0x907e('0x50')]===_0x907e('0x4d')){var _0x35601c=_0x22f514[_0x907e('0x4e')]({'plain':!![]});var _0x10b789=[{'name':_0x907e('0x5c'),'value':_0x907e('0x27')},{'name':_0x907e('0x28'),'value':_0x907e('0x51')}];var _0x116623=_[_0x907e('0x52')](_0x10b789,['value',_0x35601c[_0x907e('0x2e')]])[_0x907e('0x2f')];return db[_0x907e('0x5d')][_0x907e('0x52')]({'where':{'name':_0x116623,'userProfileId':_0x2cfac0['userProfileId']},'raw':!![]})[_0x907e('0x25')](function(_0x4b5630){if(_0x4b5630&&_0x4b5630['autoAssociation']===0x0){return db['UserProfileResource'][_0x907e('0x4b')]({'name':_0x35601c[_0x907e('0x2f')],'resourceId':_0x35601c['id'],'type':_0x4b5630['name'],'sectionId':_0x4b5630['id']},{})[_0x907e('0x25')](function(){return _0x22f514;});}else{return _0x22f514;}})[_0x907e('0x54')](function(_0x382c19){logger[_0x907e('0x55')](_0x907e('0x56'),_0x382c19);throw _0x382c19;});}return _0x22f514;});}})['then'](respondWithResult(_0x55083b,0xc9))[_0x907e('0x54')](handleError(_0x55083b,null));};exports[_0x907e('0x5e')]=function(_0x56cad2,_0x5a7674){if(_0x56cad2['body']['id']){delete _0x56cad2['body']['id'];}return db['VoiceQueue'][_0x907e('0x52')]({'where':{'id':_0x56cad2[_0x907e('0x49')]['id']}})[_0x907e('0x25')](handleEntityNotFound(_0x5a7674,null))[_0x907e('0x25')](saveUpdates(_0x56cad2[_0x907e('0x4c')],null))['then'](respondWithResult(_0x5a7674,null))['catch'](handleError(_0x5a7674,null));};exports[_0x907e('0x26')]=function(_0x15a9ba,_0x27de00){return db[_0x907e('0x45')][_0x907e('0x52')]({'where':{'id':_0x15a9ba['params']['id']}})[_0x907e('0x25')](handleEntityNotFound(_0x27de00,null))[_0x907e('0x25')](removeEntity(_0x27de00,null))['catch'](handleError(_0x27de00,null));};exports['getHoppers']=function(_0x16b3c3,_0x34d7d1,_0xd4418d){var _0x519305={'raw':![],'where':{}};var _0x3fc403={};var _0x53d5e4={'count':0x0,'rows':[]};return db[_0x907e('0x45')]['findOne']({'where':{'id':_0x16b3c3['params']['id']}})[_0x907e('0x25')](handleEntityNotFound(_0x34d7d1,null))[_0x907e('0x25')](function(_0x3f2530){if(_0x3f2530){_0x3fc403[_0x907e('0x3c')]=_[_0x907e('0x37')](db[_0x907e('0x5f')]['rawAttributes']);_0x3fc403[_0x907e('0x36')]=_['keys'](_0x16b3c3[_0x907e('0x36')]);_0x3fc403['filters']=_[_0x907e('0x4a')](_0x3fc403[_0x907e('0x3c')],_0x3fc403[_0x907e('0x36')]);_0x519305[_0x907e('0x3a')]=_[_0x907e('0x4a')](_0x3fc403[_0x907e('0x3c')],qs['fields'](_0x16b3c3[_0x907e('0x36')]['fields']));_0x519305['attributes']=_0x519305[_0x907e('0x3a')]['length']?_0x519305['attributes']:_0x3fc403[_0x907e('0x3c')];if(!_0x16b3c3['query'][_0x907e('0x3d')](_0x907e('0x60'))){_0x519305[_0x907e('0x1f')]=qs[_0x907e('0x1f')](_0x16b3c3[_0x907e('0x36')][_0x907e('0x1f')]);_0x519305['offset']=qs[_0x907e('0x1d')](_0x16b3c3[_0x907e('0x36')][_0x907e('0x1d')]);}_0x519305[_0x907e('0x3e')]=qs[_0x907e('0x3f')](_0x16b3c3[_0x907e('0x36')]['sort']);_0x519305[_0x907e('0x40')]=qs[_0x907e('0x38')](_['pick'](_0x16b3c3[_0x907e('0x36')],_0x3fc403[_0x907e('0x38')]));_0x519305[_0x907e('0x40')][_0x907e('0x61')]=_0x3f2530['id'];if(_0x16b3c3[_0x907e('0x36')][_0x907e('0x29')]){_0x519305[_0x907e('0x40')]=_[_0x907e('0x43')](_0x519305[_0x907e('0x40')],{'$or':_[_0x907e('0x2b')](_0x519305[_0x907e('0x3a')],function(_0x14dbc1){var _0x27c5c9={};_0x27c5c9[_0x14dbc1]={'$like':'%'+_0x16b3c3['query'][_0x907e('0x29')]+'%'};return _0x27c5c9;})});}_0x519305=_[_0x907e('0x43')]({},_0x519305,_0x16b3c3[_0x907e('0x44')]);return db[_0x907e('0x5f')][_0x907e('0x20')]({'where':_0x519305[_0x907e('0x40')]})['then'](function(_0x4be4fd){_0x53d5e4[_0x907e('0x20')]=_0x4be4fd;if(_0x16b3c3['query'][_0x907e('0x58')]){_0x519305[_0x907e('0x46')]=[{'all':!![]}];}return db[_0x907e('0x5f')][_0x907e('0x47')](_0x519305);})[_0x907e('0x25')](function(_0x5ae67f){_0x53d5e4[_0x907e('0x62')]=_0x5ae67f;return _0x53d5e4;});}})[_0x907e('0x25')](respondWithFilteredResult(_0x34d7d1,_0x519305))[_0x907e('0x54')](handleError(_0x34d7d1,null));};exports['getHopperHistories']=function(_0x22138b,_0x35e86b,_0x15d0c5){var _0x498bec={'raw':!![],'where':{}};var _0x46e940={};var _0x5affee={'count':0x0,'rows':[]};return db[_0x907e('0x45')][_0x907e('0x63')]({'where':{'id':_0x22138b['params']['id']}})[_0x907e('0x25')](handleEntityNotFound(_0x35e86b,null))[_0x907e('0x25')](function(_0x134e96){if(_0x134e96){_0x46e940[_0x907e('0x3c')]=_[_0x907e('0x37')](db[_0x907e('0x64')][_0x907e('0x34')]);_0x46e940['query']=_[_0x907e('0x37')](_0x22138b[_0x907e('0x36')]);_0x46e940['filters']=_[_0x907e('0x4a')](_0x46e940[_0x907e('0x3c')],_0x46e940['query']);_0x498bec['attributes']=_['intersection'](_0x46e940[_0x907e('0x3c')],qs[_0x907e('0x39')](_0x22138b[_0x907e('0x36')][_0x907e('0x39')]));_0x498bec['attributes']=_0x498bec['attributes'][_0x907e('0x3b')]?_0x498bec[_0x907e('0x3a')]:_0x46e940['model'];if(!_0x22138b['query']['hasOwnProperty']('nolimit')){_0x498bec[_0x907e('0x1f')]=qs[_0x907e('0x1f')](_0x22138b[_0x907e('0x36')][_0x907e('0x1f')]);_0x498bec[_0x907e('0x1d')]=qs[_0x907e('0x1d')](_0x22138b[_0x907e('0x36')][_0x907e('0x1d')]);}_0x498bec['order']=qs[_0x907e('0x3f')](_0x22138b[_0x907e('0x36')][_0x907e('0x3f')]);_0x498bec[_0x907e('0x40')]=qs[_0x907e('0x38')](_[_0x907e('0x41')](_0x22138b[_0x907e('0x36')],_0x46e940[_0x907e('0x38')]));_0x498bec[_0x907e('0x40')][_0x907e('0x61')]=_0x134e96['id'];if(_0x22138b[_0x907e('0x36')][_0x907e('0x29')]){_0x498bec[_0x907e('0x40')]=_['merge'](_0x498bec['where'],{'$or':_[_0x907e('0x2b')](_0x498bec[_0x907e('0x3a')],function(_0x1dd6e2){var _0x253803={};_0x253803[_0x1dd6e2]={'$like':'%'+_0x22138b[_0x907e('0x36')][_0x907e('0x29')]+'%'};return _0x253803;})});}_0x498bec=_[_0x907e('0x43')]({},_0x498bec,_0x22138b[_0x907e('0x44')]);return db[_0x907e('0x64')][_0x907e('0x20')]({'where':_0x498bec[_0x907e('0x40')]})[_0x907e('0x25')](function(_0x52cbcf){_0x5affee[_0x907e('0x20')]=_0x52cbcf;if(_0x22138b[_0x907e('0x36')][_0x907e('0x58')]){_0x498bec[_0x907e('0x46')]=[{'all':!![]}];}return db[_0x907e('0x64')][_0x907e('0x47')](_0x498bec);})[_0x907e('0x25')](function(_0x503c47){_0x5affee[_0x907e('0x62')]=_0x503c47;return _0x5affee;});}})[_0x907e('0x25')](respondWithFilteredResult(_0x35e86b,_0x498bec))['catch'](handleError(_0x35e86b,null));};exports['getHopperFinals']=function(_0x1683fa,_0x511aab,_0x46f681){var _0x32211c={'raw':!![],'where':{}};var _0x69056e={};var _0xe4d717={'count':0x0,'rows':[]};return db[_0x907e('0x45')][_0x907e('0x63')]({'where':{'id':_0x1683fa[_0x907e('0x49')]['id']}})[_0x907e('0x25')](handleEntityNotFound(_0x511aab,null))[_0x907e('0x25')](function(_0x4a3ef1){if(_0x4a3ef1){_0x69056e[_0x907e('0x3c')]=_[_0x907e('0x37')](db['CmHopperFinal'][_0x907e('0x34')]);_0x69056e[_0x907e('0x36')]=_[_0x907e('0x37')](_0x1683fa[_0x907e('0x36')]);_0x69056e[_0x907e('0x38')]=_[_0x907e('0x4a')](_0x69056e[_0x907e('0x3c')],_0x69056e[_0x907e('0x36')]);_0x32211c[_0x907e('0x3a')]=_[_0x907e('0x4a')](_0x69056e[_0x907e('0x3c')],qs[_0x907e('0x39')](_0x1683fa[_0x907e('0x36')][_0x907e('0x39')]));_0x32211c[_0x907e('0x3a')]=_0x32211c[_0x907e('0x3a')]['length']?_0x32211c[_0x907e('0x3a')]:_0x69056e[_0x907e('0x3c')];if(!_0x1683fa[_0x907e('0x36')][_0x907e('0x3d')](_0x907e('0x60'))){_0x32211c['limit']=qs[_0x907e('0x1f')](_0x1683fa[_0x907e('0x36')][_0x907e('0x1f')]);_0x32211c[_0x907e('0x1d')]=qs[_0x907e('0x1d')](_0x1683fa['query'][_0x907e('0x1d')]);}_0x32211c[_0x907e('0x3e')]=qs[_0x907e('0x3f')](_0x1683fa[_0x907e('0x36')]['sort']);_0x32211c[_0x907e('0x40')]=qs['filters'](_[_0x907e('0x41')](_0x1683fa[_0x907e('0x36')],_0x69056e['filters']));_0x32211c[_0x907e('0x40')][_0x907e('0x61')]=_0x4a3ef1['id'];if(_0x1683fa[_0x907e('0x36')][_0x907e('0x29')]){_0x32211c[_0x907e('0x40')]=_[_0x907e('0x43')](_0x32211c[_0x907e('0x40')],{'$or':_[_0x907e('0x2b')](_0x32211c['attributes'],function(_0x21d51d){var _0x1e1936={};_0x1e1936[_0x21d51d]={'$like':'%'+_0x1683fa[_0x907e('0x36')][_0x907e('0x29')]+'%'};return _0x1e1936;})});}_0x32211c=_[_0x907e('0x43')]({},_0x32211c,_0x1683fa[_0x907e('0x44')]);return db[_0x907e('0x65')][_0x907e('0x20')]({'where':_0x32211c['where']})['then'](function(_0x1e9bcb){_0xe4d717[_0x907e('0x20')]=_0x1e9bcb;if(_0x1683fa['query']['includeAll']){_0x32211c[_0x907e('0x46')]=[{'all':!![]}];}return db[_0x907e('0x65')][_0x907e('0x47')](_0x32211c);})['then'](function(_0x497e6d){_0xe4d717['rows']=_0x497e6d;return _0xe4d717;});}})[_0x907e('0x25')](respondWithFilteredResult(_0x511aab,_0x32211c))[_0x907e('0x54')](handleError(_0x511aab,null));};exports[_0x907e('0x66')]=function(_0x47bcbe,_0x104466,_0x5bed80){var _0x380225={'raw':!![],'where':{}};var _0x3a3a08={};var _0x300853={'count':0x0,'rows':[]};return db[_0x907e('0x45')][_0x907e('0x63')]({'where':{'id':_0x47bcbe[_0x907e('0x49')]['id']}})[_0x907e('0x25')](handleEntityNotFound(_0x104466,null))[_0x907e('0x25')](function(_0x4117a5){if(_0x4117a5){_0x3a3a08[_0x907e('0x3c')]=_[_0x907e('0x37')](db[_0x907e('0x67')][_0x907e('0x34')]);_0x3a3a08[_0x907e('0x36')]=_[_0x907e('0x37')](_0x47bcbe[_0x907e('0x36')]);_0x3a3a08[_0x907e('0x38')]=_[_0x907e('0x4a')](_0x3a3a08[_0x907e('0x3c')],_0x3a3a08[_0x907e('0x36')]);_0x380225[_0x907e('0x3a')]=_[_0x907e('0x4a')](_0x3a3a08[_0x907e('0x3c')],qs[_0x907e('0x39')](_0x47bcbe[_0x907e('0x36')]['fields']));_0x380225[_0x907e('0x3a')]=_0x380225['attributes'][_0x907e('0x3b')]?_0x380225['attributes']:_0x3a3a08[_0x907e('0x3c')];if(!_0x47bcbe['query'][_0x907e('0x3d')]('nolimit')){_0x380225['limit']=qs['limit'](_0x47bcbe['query'][_0x907e('0x1f')]);_0x380225['offset']=qs[_0x907e('0x1d')](_0x47bcbe['query'][_0x907e('0x1d')]);}_0x380225[_0x907e('0x3e')]=qs[_0x907e('0x3f')](_0x47bcbe['query'][_0x907e('0x3f')]);_0x380225[_0x907e('0x40')]=qs[_0x907e('0x38')](_[_0x907e('0x41')](_0x47bcbe[_0x907e('0x36')],_0x3a3a08[_0x907e('0x38')]));_0x380225[_0x907e('0x40')][_0x907e('0x61')]=_0x4117a5['id'];if(_0x47bcbe[_0x907e('0x36')]['filter']){_0x380225['where']=_[_0x907e('0x43')](_0x380225[_0x907e('0x40')],{'$or':_[_0x907e('0x2b')](_0x380225[_0x907e('0x3a')],function(_0x199ffc){var _0x1bf18d={};_0x1bf18d[_0x199ffc]={'$like':'%'+_0x47bcbe['query'][_0x907e('0x29')]+'%'};return _0x1bf18d;})});}_0x380225=_[_0x907e('0x43')]({},_0x380225,_0x47bcbe[_0x907e('0x44')]);return db[_0x907e('0x67')][_0x907e('0x20')]({'where':_0x380225[_0x907e('0x40')]})[_0x907e('0x25')](function(_0x5cbede){_0x300853[_0x907e('0x20')]=_0x5cbede;if(_0x47bcbe[_0x907e('0x36')][_0x907e('0x58')]){_0x380225[_0x907e('0x46')]=[{'all':!![]}];}return db[_0x907e('0x67')][_0x907e('0x47')](_0x380225);})[_0x907e('0x25')](function(_0x34daeb){_0x300853[_0x907e('0x62')]=_0x34daeb;return _0x300853;});}})[_0x907e('0x25')](respondWithFilteredResult(_0x104466,_0x380225))[_0x907e('0x54')](handleError(_0x104466,null));};exports[_0x907e('0x68')]=function(_0x3476f8,_0x3a6af8,_0x2cacb1){var _0x23a64b={};var _0x3f445e={};var _0x817b50;var _0x3b4f11;return db[_0x907e('0x45')][_0x907e('0x63')]({'where':{'id':_0x3476f8['params']['id']}})[_0x907e('0x25')](handleEntityNotFound(_0x3a6af8,null))[_0x907e('0x25')](function(_0x353a68){if(_0x353a68){_0x817b50=_0x353a68;_0x3f445e['model']=_[_0x907e('0x37')](db[_0x907e('0x69')][_0x907e('0x34')]);_0x3f445e[_0x907e('0x36')]=_['keys'](_0x3476f8['query']);_0x3f445e[_0x907e('0x38')]=_[_0x907e('0x4a')](_0x3f445e[_0x907e('0x3c')],_0x3f445e['query']);_0x23a64b['attributes']=_[_0x907e('0x4a')](_0x3f445e[_0x907e('0x3c')],qs[_0x907e('0x39')](_0x3476f8[_0x907e('0x36')]['fields']));_0x23a64b[_0x907e('0x3a')]=_0x23a64b['attributes']['length']?_0x23a64b[_0x907e('0x3a')]:_0x3f445e[_0x907e('0x3c')];_0x23a64b['order']=qs['sort'](_0x3476f8['query'][_0x907e('0x3f')]);_0x23a64b[_0x907e('0x40')]=qs['filters'](_[_0x907e('0x41')](_0x3476f8[_0x907e('0x36')],_0x3f445e['filters']));if(_0x3476f8['query'][_0x907e('0x29')]){_0x23a64b[_0x907e('0x40')]=_[_0x907e('0x43')](_0x23a64b[_0x907e('0x40')],{'$or':_[_0x907e('0x2b')](_0x23a64b[_0x907e('0x3a')],function(_0x14d586){var _0x3946cf={};_0x3946cf[_0x14d586]={'$like':'%'+_0x3476f8[_0x907e('0x36')]['filter']+'%'};return _0x3946cf;})});}_0x23a64b=_[_0x907e('0x43')]({},_0x23a64b,_0x3476f8[_0x907e('0x44')]);return _0x817b50[_0x907e('0x68')](_0x23a64b);}})[_0x907e('0x25')](function(_0x157969){if(_0x157969){_0x3b4f11=_0x157969[_0x907e('0x3b')];if(!_0x3476f8[_0x907e('0x36')][_0x907e('0x3d')]('nolimit')){_0x23a64b['limit']=qs['limit'](_0x3476f8[_0x907e('0x36')]['limit']);_0x23a64b[_0x907e('0x1d')]=qs['offset'](_0x3476f8[_0x907e('0x36')][_0x907e('0x1d')]);}return _0x817b50[_0x907e('0x68')](_0x23a64b);}})[_0x907e('0x25')](function(_0x31ff7c){if(_0x31ff7c){return _0x31ff7c?{'count':_0x3b4f11,'rows':_0x31ff7c}:null;}})[_0x907e('0x25')](respondWithResult(_0x3a6af8,null))[_0x907e('0x54')](handleError(_0x3a6af8,null));};exports[_0x907e('0x6a')]=function(_0x12af9b,_0x430b08,_0x37e25e){var _0x345e6a=_0x12af9b[_0x907e('0x4c')][_0x907e('0x6b')];var _0x272aed=_[_0x907e('0x2b')](_0x345e6a,'id');return db[_0x907e('0x69')]['findAll']({'where':{'id':_0x272aed},'attributes':['id'],'include':[{'model':db[_0x907e('0x6c')],'as':_0x907e('0x6d'),'attributes':['id','name',_0x907e('0x6e'),_0x907e('0x6f'),_0x907e('0x70')],'raw':!![]}]})[_0x907e('0x25')](function(_0x20828e){if(_0x20828e){var _0x4d4e69=_[_0x907e('0x71')](_0x20828e,function(_0x5a8a25){var _0x1f159d=_0x5a8a25[_0x907e('0x4e')]({'plain':!![]});_0x1f159d['Agents'][_0x907e('0x72')](function(_0x564648){_0x564648[_0x907e('0x73')]=_[_0x907e('0x52')](_0x345e6a,{'id':_0x1f159d['id']})[_0x907e('0x73')];});return _0x1f159d['Agents'];});return db[_0x907e('0x45')]['find']({'where':{'id':_0x12af9b[_0x907e('0x49')]['id']}})[_0x907e('0x25')](function(_0xba4df2){return db[_0x907e('0x74')]['transaction'](function(_0x12511e){return _0xba4df2[_0x907e('0x6a')](_0x272aed,{'transaction':_0x12511e})[_0x907e('0x25')](function(){return BPromise[_0x907e('0x75')](_0x345e6a,function(_0x363134){return db['TeamVoiceQueue']['upsert']({'TeamId':_0x363134['id'],'VoiceQueueId':_0x12af9b[_0x907e('0x49')]['id'],'penalty':_0x363134[_0x907e('0x73')]},{'transaction':_0x12511e});});})[_0x907e('0x25')](function(){return BPromise[_0x907e('0x75')](_0x4d4e69,function(_0xf03fba){return db[_0x907e('0x76')][_0x907e('0x77')]({'where':{'UserId':_0xf03fba['id'],'VoiceQueueId':_0x12af9b[_0x907e('0x49')]['id']},'defaults':{'penalty':_0xf03fba[_0x907e('0x73')]},'transaction':_0x12511e});});})[_0x907e('0x25')](function(){return BPromise[_0x907e('0x75')](_[_0x907e('0x29')](_0x4d4e69,{'online':!![]}),function(_0x185754){return db[_0x907e('0x78')][_0x907e('0x79')]({'membername':_0x185754[_0x907e('0x2f')],'UserId':_0x185754['id'],'queue_name':_0xba4df2[_0x907e('0x2f')],'VoiceQueueId':_0xba4df2['id'],'interface':_[_0x907e('0x7a')](_0x185754[_0x907e('0x70')])?util[_0x907e('0x7b')](_0x907e('0x7c'),_0x185754[_0x907e('0x2f')]):_0x185754[_0x907e('0x70')],'paused':_0x185754[_0x907e('0x6f')]||![],'penalty':_0x185754[_0x907e('0x73')]},{'transaction':_0x12511e});});})[_0x907e('0x25')](function(){_0x4d4e69[_0x907e('0x72')](function(_0x410de5){socket[_0x907e('0x7d')]('userVoiceQueue:save',{'UserId':_0x410de5['id'],'VoiceQueueId':_0xba4df2['id']});});});});});}})[_0x907e('0x25')](respondWithStatusCode(_0x430b08,null))[_0x907e('0x54')](handleError(_0x430b08,null));};exports[_0x907e('0x7e')]=function(_0x5be8f2,_0x3b7516,_0x1e6249){return db[_0x907e('0x69')][_0x907e('0x47')]({'where':{'id':_0x5be8f2[_0x907e('0x36')][_0x907e('0x7f')]},'attributes':['id'],'include':[{'model':db[_0x907e('0x6c')],'as':_0x907e('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x907e('0x25')](handleEntityNotFound(_0x3b7516,null))[_0x907e('0x25')](function(_0x3e45e4){var _0x386afd=_[_0x907e('0x2b')](_0x3e45e4,'id');var _0xbf5778=[];var _0x5f0ecb=[];var _0x59bd8f=squel[_0x907e('0x80')]();_0x59bd8f[_0x907e('0x81')](_0x907e('0x82'))['from'](_0x907e('0x83'),'tq')[_0x907e('0x84')](_0x907e('0x85'),'ut',_0x907e('0x86'))[_0x907e('0x40')]('VoiceQueueId\x20=\x20?',_0x5be8f2['params']['id']);for(var _0x309550=0x0;_0x309550<_0x3e45e4['length'];_0x309550+=0x1){let _0x118a55=_0x3e45e4[_0x309550];for(var _0x1accbc=0x0;_0x1accbc<_0x118a55[_0x907e('0x6d')][_0x907e('0x3b')];_0x1accbc+=0x1){let _0x363f47=_0x118a55[_0x907e('0x6d')][_0x1accbc];var _0x2c1f66=_0x59bd8f[_0x907e('0x57')]();_0x2c1f66['where'](_0x907e('0x87'),_0x363f47['id']);_0x5f0ecb['push'](db[_0x907e('0x74')][_0x907e('0x36')](_0x2c1f66['toString'](),{'type':db[_0x907e('0x74')][_0x907e('0x88')][_0x907e('0x89')]})['then'](function(_0x540aa5){if(_0x540aa5['length']===0x1){return _0x363f47['id'];}else{var _0x3de6d9=_[_0x907e('0x8a')](_[_0x907e('0x2b')](_0x540aa5,_0x907e('0x8b')),function(_0x3bd3d8){return _[_0x907e('0x2d')](_0x386afd,_0x3bd3d8);});if(_0x3de6d9){return _0x363f47['id'];}}}));}}return BPromise[_0x907e('0x8c')](_0x5f0ecb)[_0x907e('0x25')](function(_0x7ad732){_0xbf5778=_(_0xbf5778)['union'](_0x7ad732)['compact']()['value']();return db[_0x907e('0x45')][_0x907e('0x52')]({'where':{'id':_0x5be8f2['params']['id']}})['then'](function(_0x22a4eb){return db[_0x907e('0x74')]['transaction'](function(_0x2ee465){return _0x22a4eb[_0x907e('0x7e')](_0x5be8f2[_0x907e('0x36')][_0x907e('0x7f')],{'transaction':_0x2ee465})['then'](function(){if(!_[_0x907e('0x8d')](_0xbf5778)){return _0x22a4eb[_0x907e('0x8e')](_0xbf5778,{'transaction':_0x2ee465})[_0x907e('0x25')](function(){return db[_0x907e('0x78')][_0x907e('0x26')]({'where':{'VoiceQueueId':_0x5be8f2[_0x907e('0x49')]['id'],'UserId':_0xbf5778},'transaction':_0x2ee465});});}})[_0x907e('0x25')](function(){_0xbf5778['forEach'](function(_0xd7f75c){socket[_0x907e('0x7d')](_0x907e('0x8f'),{'UserId':_0xd7f75c,'VoiceQueueId':_0x22a4eb['id']});});});});});});})[_0x907e('0x25')](respondWithStatusCode(_0x3b7516,null))['catch'](handleError(_0x3b7516,null));};exports['addAgents']=function(_0x5fe159,_0x38c337,_0xf48ef8){var _0x2ac6fc,_0x2eb3ac;return db['VoiceQueue'][_0x907e('0x52')]({'where':{'id':_0x5fe159[_0x907e('0x49')]['id']}})['then'](handleEntityNotFound(_0x38c337,null))[_0x907e('0x25')](function(_0xe03053){if(_0xe03053){_0x2eb3ac=_0xe03053;return _0xe03053['addAgents'](_0x5fe159['body'][_0x907e('0x7f')],_[_0x907e('0x59')](_0x5fe159[_0x907e('0x4c')],[_0x907e('0x7f'),'id'])||{})[_0x907e('0x90')](function(_0x4f127f){for(var _0x383a4a=0x0;_0x383a4a<_0x5fe159[_0x907e('0x4c')][_0x907e('0x7f')][_0x907e('0x3b')];_0x383a4a+=0x1){socket[_0x907e('0x7d')](_0x907e('0x91'),{'UserId':Number(_0x5fe159[_0x907e('0x4c')]['ids'][_0x383a4a]),'VoiceQueueId':Number(_0x5fe159['params']['id'])});}return _0x4f127f;});}})[_0x907e('0x25')](function(_0x25baeb){_0x2ac6fc=_0x25baeb||[];if(_0x2eb3ac){return db[_0x907e('0x6c')]['findAll']({'where':{'id':_0x5fe159[_0x907e('0x4c')]['ids']},'attributes':['id',_0x907e('0x2f'),_0x907e('0x6e'),'voicePause',_0x907e('0x70')],'raw':!![]});}})[_0x907e('0x25')](function(_0x3850a3){if(!_[_0x907e('0x8d')](_0x3850a3)){var _0xac54e6=[];for(var _0x536946=0x0;_0x536946<_0x3850a3['length'];_0x536946++){if(_0x3850a3[_0x536946][_0x907e('0x6e')]){_0xac54e6['push'](db[_0x907e('0x78')]['upsert']({'membername':_0x3850a3[_0x536946][_0x907e('0x2f')],'UserId':_0x3850a3[_0x536946]['id'],'queue_name':_0x2eb3ac[_0x907e('0x2f')],'VoiceQueueId':_0x2eb3ac['id'],'interface':_['isNil'](_0x3850a3[_0x536946]['interface'])?util[_0x907e('0x7b')](_0x907e('0x7c'),_0x3850a3[_0x536946][_0x907e('0x2f')]):_0x3850a3[_0x536946]['interface'],'paused':_0x3850a3[_0x536946][_0x907e('0x6f')]||![],'penalty':_0x5fe159[_0x907e('0x4c')]['penalty']||0x0}));}}return BPromise[_0x907e('0x8c')](_0xac54e6);}})[_0x907e('0x25')](function(){return _0x2ac6fc;})[_0x907e('0x25')](respondWithResult(_0x38c337,null))[_0x907e('0x54')](handleError(_0x38c337,null));};exports[_0x907e('0x8e')]=function(_0x54686d,_0x12d637,_0x56f724){return db[_0x907e('0x45')]['find']({'where':{'id':_0x54686d[_0x907e('0x49')]['id']}})['then'](handleEntityNotFound(_0x12d637,null))['then'](function(_0x585805){if(_0x585805){return _0x585805[_0x907e('0x8e')](_0x54686d['query'][_0x907e('0x7f')])[_0x907e('0x25')](function(){if(_[_0x907e('0x92')](_0x54686d['query'][_0x907e('0x7f')])){for(var _0x44c055=0x0;_0x44c055<_0x54686d[_0x907e('0x36')]['ids'][_0x907e('0x3b')];_0x44c055+=0x1){socket[_0x907e('0x7d')](_0x907e('0x8f'),{'UserId':Number(_0x54686d['query'][_0x907e('0x7f')][_0x44c055]),'VoiceQueueId':Number(_0x54686d[_0x907e('0x49')]['id'])});}}else{socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x54686d[_0x907e('0x36')][_0x907e('0x7f')]),'VoiceQueueId':Number(_0x54686d[_0x907e('0x49')]['id'])});}});}})[_0x907e('0x25')](function(_0xfb57a2){return db[_0x907e('0x78')][_0x907e('0x26')]({'where':{'VoiceQueueId':_0x54686d[_0x907e('0x49')]['id'],'UserId':_0x54686d[_0x907e('0x36')][_0x907e('0x7f')]}})[_0x907e('0x25')](function(){return _0xfb57a2;});})[_0x907e('0x25')](respondWithStatusCode(_0x12d637,null))['catch'](handleError(_0x12d637,null));};exports['getAgents']=function(_0x499f70,_0x3c1312,_0x4eb70c){var _0x434f3d={};var _0x1c53f5={};var _0x278297;var _0x1f65da;return db[_0x907e('0x45')][_0x907e('0x63')]({'where':{'id':_0x499f70[_0x907e('0x49')]['id']}})['then'](handleEntityNotFound(_0x3c1312,null))[_0x907e('0x25')](function(_0x3fe03b){if(_0x3fe03b){_0x278297=_0x3fe03b;_0x1c53f5['model']=_['keys'](db[_0x907e('0x6c')][_0x907e('0x34')]);_0x1c53f5['query']=_[_0x907e('0x37')](_0x499f70[_0x907e('0x36')]);_0x1c53f5[_0x907e('0x38')]=_[_0x907e('0x4a')](_0x1c53f5[_0x907e('0x3c')],_0x1c53f5[_0x907e('0x36')]);_0x434f3d[_0x907e('0x3a')]=_[_0x907e('0x4a')](_0x1c53f5[_0x907e('0x3c')],qs['fields'](_0x499f70[_0x907e('0x36')]['fields']));_0x434f3d[_0x907e('0x3a')]=_0x434f3d[_0x907e('0x3a')][_0x907e('0x3b')]?_0x434f3d['attributes']:_0x1c53f5[_0x907e('0x3c')];_0x434f3d[_0x907e('0x3e')]=qs[_0x907e('0x3f')](_0x499f70[_0x907e('0x36')][_0x907e('0x3f')]);_0x434f3d[_0x907e('0x40')]=qs[_0x907e('0x38')](_[_0x907e('0x41')](_0x499f70[_0x907e('0x36')],_0x1c53f5[_0x907e('0x38')]));if(_0x499f70[_0x907e('0x36')][_0x907e('0x29')]){_0x434f3d[_0x907e('0x40')]=_[_0x907e('0x43')](_0x434f3d[_0x907e('0x40')],{'$or':_['map'](_0x434f3d[_0x907e('0x3a')],function(_0x1db699){var _0xdb564e={};_0xdb564e[_0x1db699]={'$like':'%'+_0x499f70[_0x907e('0x36')]['filter']+'%'};return _0xdb564e;})});}_0x434f3d=_[_0x907e('0x43')]({},_0x434f3d,_0x499f70[_0x907e('0x44')]);return _0x278297['getAgents'](_0x434f3d);}})[_0x907e('0x25')](function(_0x161fba){if(_0x161fba){_0x1f65da=_0x161fba[_0x907e('0x3b')];if(!_0x499f70['query'][_0x907e('0x3d')](_0x907e('0x60'))){_0x434f3d['limit']=qs[_0x907e('0x1f')](_0x499f70[_0x907e('0x36')][_0x907e('0x1f')]);_0x434f3d['offset']=qs[_0x907e('0x1d')](_0x499f70[_0x907e('0x36')]['offset']);}return _0x278297[_0x907e('0x93')](_0x434f3d);}})['then'](function(_0x53b31d){if(_0x53b31d){return _0x53b31d?{'count':_0x1f65da,'rows':_0x53b31d}:null;}})[_0x907e('0x25')](respondWithResult(_0x3c1312,null))['catch'](handleError(_0x3c1312,null));};exports['getMembers']=function(_0x4c0158,_0x1f5de7,_0x16694a){var _0x5aa7bb={};var _0x909086={};var _0x206112;var _0x47923d;return db[_0x907e('0x45')]['findOne']({'where':{'id':_0x4c0158['params']['id']}})[_0x907e('0x25')](handleEntityNotFound(_0x1f5de7,null))[_0x907e('0x25')](function(_0x47bebc){if(_0x47bebc){_0x206112=_0x47bebc;_0x909086[_0x907e('0x3c')]=_[_0x907e('0x37')](db[_0x907e('0x78')]['rawAttributes']);_0x909086[_0x907e('0x36')]=_[_0x907e('0x37')](_0x4c0158[_0x907e('0x36')]);_0x909086[_0x907e('0x38')]=_['intersection'](_0x909086[_0x907e('0x3c')],_0x909086[_0x907e('0x36')]);_0x5aa7bb[_0x907e('0x3a')]=_[_0x907e('0x4a')](_0x909086[_0x907e('0x3c')],qs[_0x907e('0x39')](_0x4c0158[_0x907e('0x36')][_0x907e('0x39')]));_0x5aa7bb['attributes']=_0x5aa7bb[_0x907e('0x3a')][_0x907e('0x3b')]?_0x5aa7bb[_0x907e('0x3a')]:_0x909086[_0x907e('0x3c')];_0x5aa7bb[_0x907e('0x3e')]=qs['sort'](_0x4c0158[_0x907e('0x36')][_0x907e('0x3f')]);_0x5aa7bb[_0x907e('0x40')]=qs[_0x907e('0x38')](_['pick'](_0x4c0158['query'],_0x909086['filters']));if(_0x4c0158[_0x907e('0x36')][_0x907e('0x29')]){_0x5aa7bb['where']=_['merge'](_0x5aa7bb[_0x907e('0x40')],{'$or':_[_0x907e('0x2b')](_0x5aa7bb[_0x907e('0x3a')],function(_0x3e8e13){var _0x5def15={};_0x5def15[_0x3e8e13]={'$like':'%'+_0x4c0158[_0x907e('0x36')][_0x907e('0x29')]+'%'};return _0x5def15;})});}_0x5aa7bb=_[_0x907e('0x43')]({},_0x5aa7bb,_0x4c0158[_0x907e('0x44')]);return _0x206112[_0x907e('0x94')](_0x5aa7bb);}})[_0x907e('0x25')](function(_0x3220ea){if(_0x3220ea){_0x47923d=_0x3220ea[_0x907e('0x3b')];if(!_0x4c0158[_0x907e('0x36')][_0x907e('0x3d')](_0x907e('0x60'))){_0x5aa7bb[_0x907e('0x1f')]=qs[_0x907e('0x1f')](_0x4c0158[_0x907e('0x36')]['limit']);_0x5aa7bb[_0x907e('0x1d')]=qs[_0x907e('0x1d')](_0x4c0158['query'][_0x907e('0x1d')]);}return _0x206112[_0x907e('0x94')](_0x5aa7bb);}})['then'](function(_0x1c7354){return _0x1c7354?{'count':_0x47923d,'rows':_0x1c7354}:null;})[_0x907e('0x25')](respondWithResult(_0x1f5de7,null))['catch'](handleError(_0x1f5de7,null));};exports[_0x907e('0x95')]=function(_0x3955cf,_0x5b7b40,_0x2fb6e8){var _0x16c963={};var _0x26127a={};var _0x399741;var _0x40a11e;return db[_0x907e('0x45')][_0x907e('0x63')]({'where':{'id':_0x3955cf[_0x907e('0x49')]['id']}})[_0x907e('0x25')](handleEntityNotFound(_0x5b7b40,null))[_0x907e('0x25')](function(_0x3b9c0b){if(_0x3b9c0b){_0x399741=_0x3b9c0b;_0x26127a[_0x907e('0x3c')]=_['keys'](db[_0x907e('0x96')][_0x907e('0x34')]);_0x26127a[_0x907e('0x36')]=_[_0x907e('0x37')](_0x3955cf[_0x907e('0x36')]);_0x26127a[_0x907e('0x38')]=_[_0x907e('0x4a')](_0x26127a[_0x907e('0x3c')],_0x26127a[_0x907e('0x36')]);_0x16c963[_0x907e('0x3a')]=_[_0x907e('0x4a')](_0x26127a[_0x907e('0x3c')],qs['fields'](_0x3955cf['query'][_0x907e('0x39')]));_0x16c963['attributes']=_0x16c963[_0x907e('0x3a')]['length']?_0x16c963['attributes']:_0x26127a[_0x907e('0x3c')];_0x16c963[_0x907e('0x3e')]=qs[_0x907e('0x3f')](_0x3955cf[_0x907e('0x36')]['sort']);_0x16c963[_0x907e('0x40')]=qs[_0x907e('0x38')](_[_0x907e('0x41')](_0x3955cf[_0x907e('0x36')],_0x26127a[_0x907e('0x38')]));if(_0x3955cf[_0x907e('0x36')][_0x907e('0x29')]){_0x16c963[_0x907e('0x40')]=_[_0x907e('0x43')](_0x16c963[_0x907e('0x40')],{'$or':_[_0x907e('0x2b')](_0x16c963['attributes'],function(_0xee55e1){var _0x34e20c={};_0x34e20c[_0xee55e1]={'$like':'%'+_0x3955cf[_0x907e('0x36')][_0x907e('0x29')]+'%'};return _0x34e20c;})});}_0x16c963=_[_0x907e('0x43')]({},_0x16c963,_0x3955cf['options']);return _0x399741[_0x907e('0x95')](_0x16c963);}})[_0x907e('0x25')](function(_0x506fd0){if(_0x506fd0){_0x40a11e=_0x506fd0[_0x907e('0x3b')];if(!_0x3955cf[_0x907e('0x36')][_0x907e('0x3d')](_0x907e('0x60'))){_0x16c963[_0x907e('0x1f')]=qs[_0x907e('0x1f')](_0x3955cf[_0x907e('0x36')][_0x907e('0x1f')]);_0x16c963['offset']=qs['offset'](_0x3955cf[_0x907e('0x36')]['offset']);}return _0x399741['getLists'](_0x16c963);}})[_0x907e('0x25')](function(_0x66d940){if(_0x66d940){return _0x66d940?{'count':_0x40a11e,'rows':_0x66d940}:null;}})[_0x907e('0x25')](respondWithResult(_0x5b7b40,null))['catch'](handleError(_0x5b7b40,null));};exports[_0x907e('0x97')]=function(_0x502bc5,_0x3f7d26,_0x1eb738){var _0x505c23,_0x43777d;return db[_0x907e('0x45')][_0x907e('0x52')]({'where':{'id':_0x502bc5[_0x907e('0x49')]['id']}})['then'](handleEntityNotFound(_0x3f7d26,null))[_0x907e('0x25')](function(_0x3126a8){if(_0x3126a8){_0x43777d=_0x3126a8;return _0x3126a8[_0x907e('0x97')](_0x502bc5[_0x907e('0x4c')]['ids'],_['omit'](_0x502bc5[_0x907e('0x4c')],[_0x907e('0x7f'),'id'])||{});}return null;})[_0x907e('0x90')](function(_0x30e205){var _0x330d1d;_0x505c23=_0x30e205||[];var _0x47b1e7=[];if(_0x30e205){for(var _0x2fa96d=0x0;_0x2fa96d<_0x30e205[_0x907e('0x3b')];_0x2fa96d+=0x1){var _0x43798a=_0x30e205[_0x2fa96d][_0x907e('0x4e')]({'plain':!![]});_0x43777d[_0x907e('0x98')]=_0x502bc5[_0x907e('0x4c')][_0x907e('0x98')]?_0x502bc5['body'][_0x907e('0x98')]:_0x43777d['dialCheckDuplicateType'];switch(_0x43777d[_0x907e('0x98')]){case'always':_0x330d1d=squel[_0x907e('0x99')]()[_0x907e('0x9a')](_0x907e('0x9b'))[_0x907e('0x9c')](['phone','scheduledAt',_0x907e('0x9d'),_0x907e('0x9e'),'VoiceQueueId',_0x907e('0x5b'),_0x907e('0x5a')],squel[_0x907e('0x80')]()[_0x907e('0x81')](_0x907e('0x9f'),_0x907e('0x9f'))['field']('NOW()',_0x907e('0xa0'))[_0x907e('0x81')]('id','ContactId')[_0x907e('0x81')](_0x43798a['CmListId'][_0x907e('0xa1')](),_0x907e('0x9e'))['field'](_0x502bc5[_0x907e('0x49')]['id'][_0x907e('0xa1')](),_0x907e('0x61'))[_0x907e('0x81')](_0x907e('0xa2'),_0x907e('0x5b'))['field'](_0x907e('0xa2'),'updatedAt')[_0x907e('0xa3')]('cm_contacts')[_0x907e('0x40')]('deletedAt\x20IS\x20NULL')[_0x907e('0x40')](_0x907e('0xa4'),_0x43798a[_0x907e('0xa5')][_0x907e('0xa1')]())[_0x907e('0x40')](_0x907e('0xa6'))[_0x907e('0x40')](_0x907e('0xa7'),squel[_0x907e('0x80')]()[_0x907e('0x81')]('COALESCE(calleridnum,\x27\x27)')['from'](_0x907e('0xa8'))['where'](_0x907e('0xa9'),_0x502bc5['params']['id'][_0x907e('0xa1')]()))[_0x907e('0x40')](_0x907e('0xa7'),squel[_0x907e('0x80')]()[_0x907e('0x81')](_0x907e('0xaa'))[_0x907e('0xa3')]('cm_hopper')[_0x907e('0x40')](_0x907e('0xa9'),_0x502bc5[_0x907e('0x49')]['id'][_0x907e('0xa1')]())))['toString']();break;case _0x907e('0xab'):_0x330d1d=squel[_0x907e('0x99')]()[_0x907e('0x9a')](_0x907e('0x9b'))[_0x907e('0x9c')]([_0x907e('0x9f'),_0x907e('0xa0'),_0x907e('0x9d'),'ListId',_0x907e('0x61'),_0x907e('0x5b'),'updatedAt'],squel['select']()[_0x907e('0x81')](_0x907e('0x9f'),_0x907e('0x9f'))[_0x907e('0x81')](_0x907e('0xa2'),_0x907e('0xa0'))[_0x907e('0x81')]('id',_0x907e('0x9d'))[_0x907e('0x81')](_0x43798a[_0x907e('0xa5')][_0x907e('0xa1')](),_0x907e('0x9e'))[_0x907e('0x81')](_0x502bc5['params']['id'][_0x907e('0xa1')](),_0x907e('0x61'))[_0x907e('0x81')]('NOW()',_0x907e('0x5b'))[_0x907e('0x81')](_0x907e('0xa2'),_0x907e('0x5a'))[_0x907e('0xa3')]('cm_contacts')[_0x907e('0x40')]('deletedAt\x20IS\x20NULL')[_0x907e('0x40')](_0x907e('0xa4'),_0x43798a[_0x907e('0xa5')]['toString']())[_0x907e('0x40')]('phone\x20IS\x20NOT\x20NULL')[_0x907e('0x40')](_0x907e('0xa7'),squel['select']()[_0x907e('0x81')]('COALESCE(phone,\x27\x27)')[_0x907e('0xa3')]('cm_hopper')['where'](_0x907e('0xa9'),_0x502bc5[_0x907e('0x49')]['id']['toString']())))[_0x907e('0xa1')]();break;default:_0x330d1d=squel['insert']()[_0x907e('0x9a')]('cm_hopper')[_0x907e('0x9c')](['phone','scheduledAt',_0x907e('0x9d'),'ListId','VoiceQueueId',_0x907e('0x5b'),'updatedAt'],squel[_0x907e('0x80')]()[_0x907e('0x81')](_0x907e('0x9f'),'phone')[_0x907e('0x81')](_0x907e('0xa2'),_0x907e('0xa0'))['field']('id',_0x907e('0x9d'))['field'](_0x43798a[_0x907e('0xa5')][_0x907e('0xa1')](),_0x907e('0x9e'))[_0x907e('0x81')](_0x502bc5['params']['id']['toString'](),_0x907e('0x61'))[_0x907e('0x81')]('NOW()',_0x907e('0x5b'))[_0x907e('0x81')](_0x907e('0xa2'),_0x907e('0x5a'))['from'](_0x907e('0xac'))[_0x907e('0x40')](_0x907e('0xad'))['where'](_0x907e('0xa4'),_0x43798a['CmListId'][_0x907e('0xa1')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x907e('0xa1')]();}_0x47b1e7[_0x907e('0xae')](db[_0x907e('0x74')][_0x907e('0x36')](_0x330d1d));}return BPromise['all'](_0x47b1e7);}})[_0x907e('0x25')](function(){return _0x505c23;})['then'](respondWithResult(_0x3f7d26,null))['catch'](handleError(_0x3f7d26,null));};exports[_0x907e('0xaf')]=function(_0x1866ab,_0x4caf0d,_0x55db9d){return db[_0x907e('0x45')][_0x907e('0x52')]({'where':{'id':_0x1866ab[_0x907e('0x49')]['id']}})[_0x907e('0x25')](handleEntityNotFound(_0x4caf0d,null))['then'](function(_0x4cbdfe){if(_0x4cbdfe){return _0x4cbdfe[_0x907e('0xaf')](_0x1866ab[_0x907e('0x36')][_0x907e('0x7f')]);}})[_0x907e('0x25')](function(_0x2dcef2){if(_0x2dcef2){return db[_0x907e('0x5f')]['destroy']({'where':{'ListId':_0x1866ab[_0x907e('0x36')][_0x907e('0x7f')],'VoiceQueueId':_0x1866ab[_0x907e('0x49')]['id']}})['then'](function(){return _0x2dcef2;});}})[_0x907e('0x25')](respondWithStatusCode(_0x4caf0d,null))[_0x907e('0x54')](handleError(_0x4caf0d,null));};exports[_0x907e('0xb0')]=function(_0x4766a3,_0x5e925e,_0x287b6){var _0x326ae7={};var _0x3c610f={};var _0x2d3234;var _0x1db873;return db[_0x907e('0x45')][_0x907e('0x63')]({'where':{'id':_0x4766a3[_0x907e('0x49')]['id']}})[_0x907e('0x25')](handleEntityNotFound(_0x5e925e,null))[_0x907e('0x25')](function(_0x50afaf){if(_0x50afaf){_0x2d3234=_0x50afaf;_0x3c610f[_0x907e('0x3c')]=_[_0x907e('0x37')](db['CmList'][_0x907e('0x34')]);_0x3c610f[_0x907e('0x36')]=_[_0x907e('0x37')](_0x4766a3['query']);_0x3c610f[_0x907e('0x38')]=_[_0x907e('0x4a')](_0x3c610f['model'],_0x3c610f[_0x907e('0x36')]);_0x326ae7['attributes']=_[_0x907e('0x4a')](_0x3c610f[_0x907e('0x3c')],qs[_0x907e('0x39')](_0x4766a3[_0x907e('0x36')][_0x907e('0x39')]));_0x326ae7[_0x907e('0x3a')]=_0x326ae7[_0x907e('0x3a')][_0x907e('0x3b')]?_0x326ae7['attributes']:_0x3c610f[_0x907e('0x3c')];_0x326ae7['order']=qs[_0x907e('0x3f')](_0x4766a3['query'][_0x907e('0x3f')]);_0x326ae7['where']=qs[_0x907e('0x38')](_[_0x907e('0x41')](_0x4766a3[_0x907e('0x36')],_0x3c610f[_0x907e('0x38')]));if(_0x4766a3[_0x907e('0x36')][_0x907e('0x29')]){_0x326ae7[_0x907e('0x40')]=_[_0x907e('0x43')](_0x326ae7[_0x907e('0x40')],{'$or':_[_0x907e('0x2b')](_0x326ae7[_0x907e('0x3a')],function(_0x5bf90e){var _0x42c426={};_0x42c426[_0x5bf90e]={'$like':'%'+_0x4766a3['query'][_0x907e('0x29')]+'%'};return _0x42c426;})});}_0x326ae7=_[_0x907e('0x43')]({},_0x326ae7,_0x4766a3['options']);return _0x2d3234[_0x907e('0xb0')](_0x326ae7);}})['then'](function(_0x167674){if(_0x167674){_0x1db873=_0x167674[_0x907e('0x3b')];if(!_0x4766a3[_0x907e('0x36')]['hasOwnProperty'](_0x907e('0x60'))){_0x326ae7[_0x907e('0x1f')]=qs[_0x907e('0x1f')](_0x4766a3[_0x907e('0x36')][_0x907e('0x1f')]);_0x326ae7[_0x907e('0x1d')]=qs[_0x907e('0x1d')](_0x4766a3[_0x907e('0x36')][_0x907e('0x1d')]);}return _0x2d3234[_0x907e('0xb0')](_0x326ae7);}})[_0x907e('0x25')](function(_0x2e527f){if(_0x2e527f){return _0x2e527f?{'count':_0x1db873,'rows':_0x2e527f}:null;}})['then'](respondWithResult(_0x5e925e,null))['catch'](handleError(_0x5e925e,null));};exports[_0x907e('0xb1')]=function(_0x1d85a9,_0x13ce25,_0x55b148){var _0x328b27,_0x36b88e;return db[_0x907e('0x45')]['find']({'where':{'id':_0x1d85a9[_0x907e('0x49')]['id']}})['then'](handleEntityNotFound(_0x13ce25,null))[_0x907e('0x25')](function(_0x3198d6){if(_0x3198d6){_0x36b88e=_0x3198d6;return _0x3198d6['addBlackLists'](_0x1d85a9[_0x907e('0x4c')][_0x907e('0x7f')],_[_0x907e('0x59')](_0x1d85a9[_0x907e('0x4c')],['ids','id'])||{});}return null;})['spread'](function(_0x16911d){var _0x37289e;_0x328b27=_0x16911d||[];var _0x5e0919=[];if(_0x16911d){for(var _0x4b2ee2=0x0;_0x4b2ee2<_0x16911d[_0x907e('0x3b')];_0x4b2ee2+=0x1){var _0xff6bad=_0x16911d[_0x4b2ee2][_0x907e('0x4e')]({'plain':!![]});_0x37289e=squel[_0x907e('0x99')]()[_0x907e('0x9a')](_0x907e('0xb2'))[_0x907e('0x9c')]([_0x907e('0x9f'),'ContactId',_0x907e('0x9e'),_0x907e('0x61'),_0x907e('0x5b'),_0x907e('0x5a')],squel[_0x907e('0x80')]()[_0x907e('0x81')](_0x907e('0x9f'),_0x907e('0x9f'))[_0x907e('0x81')]('id',_0x907e('0x9d'))[_0x907e('0x81')](_0xff6bad[_0x907e('0xa5')][_0x907e('0xa1')](),'ListId')[_0x907e('0x81')](_0x1d85a9[_0x907e('0x49')]['id'][_0x907e('0xa1')](),'VoiceQueueId')[_0x907e('0x81')](_0x907e('0xa2'),_0x907e('0x5b'))[_0x907e('0x81')]('NOW()',_0x907e('0x5a'))['from']('cm_contacts')[_0x907e('0x40')](_0x907e('0xad'))['where'](_0x907e('0xa4'),_0xff6bad[_0x907e('0xa5')][_0x907e('0xa1')]())[_0x907e('0x40')](_0x907e('0xa6')))['toString']();_0x5e0919[_0x907e('0xae')](db['sequelize'][_0x907e('0x36')](_0x37289e));}return BPromise[_0x907e('0x8c')](_0x5e0919);}})[_0x907e('0x25')](function(){return _0x328b27;})['then'](respondWithResult(_0x13ce25,null))[_0x907e('0x54')](handleError(_0x13ce25,null));};exports[_0x907e('0xb3')]=function(_0x1fc5d9,_0x294d5b,_0x426e92){return db[_0x907e('0x45')][_0x907e('0x52')]({'where':{'id':_0x1fc5d9[_0x907e('0x49')]['id']}})[_0x907e('0x25')](handleEntityNotFound(_0x294d5b,null))[_0x907e('0x25')](function(_0x115e8b){if(_0x115e8b){return _0x115e8b[_0x907e('0xb3')](_0x1fc5d9['query'][_0x907e('0x7f')]);}})[_0x907e('0x25')](function(_0x2a008c){if(_0x2a008c){return db[_0x907e('0x67')]['destroy']({'where':{'ListId':_0x1fc5d9[_0x907e('0x36')][_0x907e('0x7f')],'VoiceQueueId':_0x1fc5d9[_0x907e('0x49')]['id']}})[_0x907e('0x25')](function(){return _0x2a008c;});}})[_0x907e('0x25')](respondWithStatusCode(_0x294d5b,null))['catch'](handleError(_0x294d5b,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 13999e0..210271b 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 _0xc2f1=['hasOwnProperty','events','setMaxListeners','save','update','emit'];(function(_0x198446,_0x119c8f){var _0x38d7b7=function(_0x293752){while(--_0x293752){_0x198446['push'](_0x198446['shift']());}};_0x38d7b7(++_0x119c8f);}(_0xc2f1,0xbb));var _0x1c2f=function(_0x5a9d33,_0x1177a0){_0x5a9d33=_0x5a9d33-0x0;var _0x128fa5=_0xc2f1[_0x5a9d33];return _0x128fa5;};'use strict';var EventEmitter=require(_0x1c2f('0x0'));var VoiceQueue=require('../../mysqldb')['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x1c2f('0x1')](0x0);var events={'afterCreate':_0x1c2f('0x2'),'afterUpdate':_0x1c2f('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3b55b5){return function(_0x352560,_0x47f4c4,_0x124b48){VoiceQueueEvents[_0x1c2f('0x4')](_0x3b55b5+':'+_0x352560['id'],_0x352560);VoiceQueueEvents[_0x1c2f('0x4')](_0x3b55b5,_0x352560);_0x124b48(null);};}for(var e in events){if(events[_0x1c2f('0x5')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file +var _0x1d9a=['save','update','remove','emit','hook','exports','events','../../mysqldb','VoiceQueue','setMaxListeners'];(function(_0x232d09,_0x30a518){var _0x454385=function(_0x3a5fdd){while(--_0x3a5fdd){_0x232d09['push'](_0x232d09['shift']());}};_0x454385(++_0x30a518);}(_0x1d9a,0x15a));var _0xa1d9=function(_0x12b43e,_0x1fae05){_0x12b43e=_0x12b43e-0x0;var _0x556c0b=_0x1d9a[_0x12b43e];return _0x556c0b;};'use strict';var EventEmitter=require(_0xa1d9('0x0'));var VoiceQueue=require(_0xa1d9('0x1'))['db'][_0xa1d9('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xa1d9('0x3')](0x0);var events={'afterCreate':_0xa1d9('0x4'),'afterUpdate':_0xa1d9('0x5'),'afterDestroy':_0xa1d9('0x6')};function emitEvent(_0x3612cc){return function(_0x2ab0e9,_0x4478eb,_0xe70a1c){VoiceQueueEvents[_0xa1d9('0x7')](_0x3612cc+':'+_0x2ab0e9['id'],_0x2ab0e9);VoiceQueueEvents[_0xa1d9('0x7')](_0x3612cc,_0x2ab0e9);_0xe70a1c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0xa1d9('0x8')](e,emitEvent(event));}}module[_0xa1d9('0x9')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index dc3cbd8..6aa8503 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 _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x536c66,_0x570b6b){var _0x221d57=function(_0x34af51){while(--_0x34af51){_0x536c66['push'](_0x536c66['shift']());}};_0x221d57(++_0x570b6b);}(_0x008c,0x188));var _0xc008=function(_0x31df6f,_0x380e73){_0x31df6f=_0x31df6f-0x0;var _0x31e353=_0x008c[_0x31df6f];return _0x31e353;};'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')]('VoiceQueue',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueue.attributes','exports','VoiceQueue','util'];(function(_0x2a5477,_0x180d79){var _0x44e186=function(_0x20e9ea){while(--_0x20e9ea){_0x2a5477['push'](_0x2a5477['shift']());}};_0x44e186(++_0x180d79);}(_0xedd9,0xfc));var _0x9edd=function(_0x1f9ad3,_0x435646){_0x1f9ad3=_0x1f9ad3-0x0;var _0x1c9b6a=_0xedd9[_0x1f9ad3];return _0x1c9b6a;};'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 diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index bcc6a16..c7a9490 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 _0x043f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./voiceQueue.socket','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVoiceQueue','VoiceQueue','options','raw','where','attributes','limit','include','map','model','ShowVoiceQueue','find'];(function(_0xe759db,_0x13b73b){var _0x1a7792=function(_0x23d34c){while(--_0x23d34c){_0xe759db['push'](_0xe759db['shift']());}};_0x1a7792(++_0x13b73b);}(_0x043f,0x19a));var _0xf043=function(_0x2d607b,_0x455193){_0x2d607b=_0x2d607b-0x0;var _0x5be31d=_0x043f[_0x2d607b];return _0x5be31d;};'use strict';var _=require(_0xf043('0x0'));var util=require(_0xf043('0x1'));var moment=require(_0xf043('0x2'));var BPromise=require(_0xf043('0x3'));var rs=require(_0xf043('0x4'));var fs=require('fs');var Redis=require(_0xf043('0x5'));var db=require(_0xf043('0x6'))['db'];var utils=require(_0xf043('0x7'));var logger=require(_0xf043('0x8'))('rpc');var config=require(_0xf043('0x9'));var jayson=require(_0xf043('0xa'));var client=jayson[_0xf043('0xb')][_0xf043('0xc')]({'port':0x232a});config[_0xf043('0xd')]=_[_0xf043('0xe')](config[_0xf043('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xf043('0xf'))(new Redis(config[_0xf043('0xd')]));require(_0xf043('0x10'))['register'](socket);function respondWithRpcPromise(_0xf5fc7a,_0x36bedc,_0x26eeb0){return new BPromise(function(_0x3f6ccd,_0x2ed124){return client[_0xf043('0x11')](_0xf5fc7a,_0x26eeb0)[_0xf043('0x12')](function(_0x4cd0ff){logger[_0xf043('0x13')](_0xf043('0x14'),_0x36bedc,_0xf043('0x15'));logger[_0xf043('0x16')](_0xf043('0x17'),_0x36bedc,'request\x20sent',JSON[_0xf043('0x18')](_0x4cd0ff));if(_0x4cd0ff[_0xf043('0x19')]){if(_0x4cd0ff[_0xf043('0x19')][_0xf043('0x1a')]===0x1f4){logger[_0xf043('0x19')](_0xf043('0x14'),_0x36bedc,_0x4cd0ff[_0xf043('0x19')][_0xf043('0x1b')]);return _0x2ed124(_0x4cd0ff[_0xf043('0x19')]['message']);}logger[_0xf043('0x19')]('VoiceQueue,\x20%s,\x20%s',_0x36bedc,_0x4cd0ff[_0xf043('0x19')][_0xf043('0x1b')]);return _0x3f6ccd(_0x4cd0ff[_0xf043('0x19')][_0xf043('0x1b')]);}else{logger['info'](_0xf043('0x14'),_0x36bedc,_0xf043('0x15'));_0x3f6ccd(_0x4cd0ff['result'][_0xf043('0x1b')]);}})[_0xf043('0x1c')](function(_0x2e3a00){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x36bedc,_0x2e3a00);_0x2ed124(_0x2e3a00);});});}exports[_0xf043('0x1d')]=function(_0x249bc9){var _0x12ab9b=this;return new Promise(function(_0x87d964,_0x32e103){return db[_0xf043('0x1e')]['findAll']({'raw':_0x249bc9['options']?_0x249bc9[_0xf043('0x1f')][_0xf043('0x20')]===undefined?!![]:![]:!![],'where':_0x249bc9[_0xf043('0x1f')]?_0x249bc9['options'][_0xf043('0x21')]||null:null,'attributes':_0x249bc9[_0xf043('0x1f')]?_0x249bc9['options'][_0xf043('0x22')]||null:null,'limit':_0x249bc9['options']?_0x249bc9[_0xf043('0x1f')][_0xf043('0x23')]||null:null,'include':_0x249bc9[_0xf043('0x1f')]?_0x249bc9['options'][_0xf043('0x24')]?_[_0xf043('0x25')](_0x249bc9[_0xf043('0x1f')][_0xf043('0x24')],function(_0x5a875){return{'model':db[_0x5a875[_0xf043('0x26')]],'as':_0x5a875['as'],'attributes':_0x5a875[_0xf043('0x22')],'include':_0x5a875['include']?_[_0xf043('0x25')](_0x5a875['include'],function(_0x54062c){return{'model':db[_0x54062c['model']],'as':_0x54062c['as'],'attributes':_0x54062c[_0xf043('0x22')],'include':_0x54062c[_0xf043('0x24')]?_[_0xf043('0x25')](_0x54062c[_0xf043('0x24')],function(_0x1cbb54){return{'model':db[_0x1cbb54[_0xf043('0x26')]],'as':_0x1cbb54['as'],'attributes':_0x1cbb54[_0xf043('0x22')]};}):[]};}):[]};}):[]:[]})[_0xf043('0x12')](function(_0x397e46){logger[_0xf043('0x13')](_0xf043('0x1d'),_0x249bc9);logger[_0xf043('0x16')](_0xf043('0x1d'),_0x249bc9,JSON[_0xf043('0x18')](_0x397e46));_0x87d964(_0x397e46);})[_0xf043('0x1c')](function(_0x2c820f){logger[_0xf043('0x19')](_0xf043('0x1d'),_0x2c820f[_0xf043('0x1b')],_0x249bc9);_0x32e103(_0x12ab9b[_0xf043('0x19')](0x1f4,_0x2c820f['message']));});});};exports[_0xf043('0x27')]=function(_0x1bb34){var _0x2e2778=this;return new Promise(function(_0x501a12,_0x2015fd){return db[_0xf043('0x1e')][_0xf043('0x28')]({'raw':_0x1bb34[_0xf043('0x1f')]?_0x1bb34['options'][_0xf043('0x20')]===undefined?!![]:![]:!![],'where':_0x1bb34['options']?_0x1bb34['options'][_0xf043('0x21')]||null:null,'attributes':_0x1bb34[_0xf043('0x1f')]?_0x1bb34[_0xf043('0x1f')]['attributes']||null:null,'include':_0x1bb34[_0xf043('0x1f')]?_0x1bb34['options'][_0xf043('0x24')]?_[_0xf043('0x25')](_0x1bb34[_0xf043('0x1f')]['include'],function(_0x52e58d){return{'model':db[_0x52e58d['model']],'as':_0x52e58d['as'],'attributes':_0x52e58d[_0xf043('0x22')],'include':_0x52e58d[_0xf043('0x24')]?_[_0xf043('0x25')](_0x52e58d[_0xf043('0x24')],function(_0x4ad401){return{'model':db[_0x4ad401[_0xf043('0x26')]],'as':_0x4ad401['as'],'attributes':_0x4ad401[_0xf043('0x22')],'include':_0x4ad401[_0xf043('0x24')]?_['map'](_0x4ad401[_0xf043('0x24')],function(_0x135a41){return{'model':db[_0x135a41[_0xf043('0x26')]],'as':_0x135a41['as'],'attributes':_0x135a41[_0xf043('0x22')]};}):[]};}):[]};}):[]:[]})[_0xf043('0x12')](function(_0x2159b3){logger[_0xf043('0x13')](_0xf043('0x27'),_0x1bb34);logger['debug'](_0xf043('0x27'),_0x1bb34,JSON[_0xf043('0x18')](_0x2159b3));_0x501a12(_0x2159b3);})[_0xf043('0x1c')](function(_0x5678b9){logger[_0xf043('0x19')](_0xf043('0x27'),_0x5678b9[_0xf043('0x1b')],_0x1bb34);_0x2015fd(_0x2e2778[_0xf043('0x19')](0x1f4,_0x5678b9[_0xf043('0x1b')]));});});}; \ No newline at end of file +var _0xc2ad=['request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','VoiceQueue','findAll','options','where','attributes','limit','include','map','model','GetVoiceQueue','catch','find','raw','ShowVoiceQueue','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s'];(function(_0x530756,_0x2d5015){var _0x37b932=function(_0x5f25f0){while(--_0x5f25f0){_0x530756['push'](_0x530756['shift']());}};_0x37b932(++_0x2d5015);}(_0xc2ad,0xe8));var _0xdc2a=function(_0x5dd058,_0x58fb39){_0x5dd058=_0x5dd058-0x0;var _0x471b8b=_0xc2ad[_0x5dd058];return _0x471b8b;};'use strict';var _=require('lodash');var util=require(_0xdc2a('0x0'));var moment=require(_0xdc2a('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdc2a('0x2'));var db=require(_0xdc2a('0x3'))['db'];var utils=require(_0xdc2a('0x4'));var logger=require(_0xdc2a('0x5'))(_0xdc2a('0x6'));var config=require(_0xdc2a('0x7'));var jayson=require(_0xdc2a('0x8'));var client=jayson[_0xdc2a('0x9')][_0xdc2a('0xa')]({'port':0x232a});config[_0xdc2a('0xb')]=_[_0xdc2a('0xc')](config[_0xdc2a('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xdc2a('0xd'))(new Redis(config[_0xdc2a('0xb')]));require(_0xdc2a('0xe'))[_0xdc2a('0xf')](socket);function respondWithRpcPromise(_0x2619a7,_0x25e2e4,_0x688d3c){return new BPromise(function(_0x400ec9,_0x12f8fe){return client[_0xdc2a('0x10')](_0x2619a7,_0x688d3c)[_0xdc2a('0x11')](function(_0x3aa604){logger[_0xdc2a('0x12')](_0xdc2a('0x13'),_0x25e2e4,_0xdc2a('0x14'));logger[_0xdc2a('0x15')](_0xdc2a('0x16'),_0x25e2e4,_0xdc2a('0x14'),JSON[_0xdc2a('0x17')](_0x3aa604));if(_0x3aa604[_0xdc2a('0x18')]){if(_0x3aa604[_0xdc2a('0x18')][_0xdc2a('0x19')]===0x1f4){logger[_0xdc2a('0x18')](_0xdc2a('0x13'),_0x25e2e4,_0x3aa604[_0xdc2a('0x18')][_0xdc2a('0x1a')]);return _0x12f8fe(_0x3aa604[_0xdc2a('0x18')][_0xdc2a('0x1a')]);}logger['error'](_0xdc2a('0x13'),_0x25e2e4,_0x3aa604[_0xdc2a('0x18')][_0xdc2a('0x1a')]);return _0x400ec9(_0x3aa604['error'][_0xdc2a('0x1a')]);}else{logger[_0xdc2a('0x12')]('VoiceQueue,\x20%s,\x20%s',_0x25e2e4,_0xdc2a('0x14'));_0x400ec9(_0x3aa604[_0xdc2a('0x1b')][_0xdc2a('0x1a')]);}})['catch'](function(_0x1c3a46){logger[_0xdc2a('0x18')](_0xdc2a('0x13'),_0x25e2e4,_0x1c3a46);_0x12f8fe(_0x1c3a46);});});}exports['GetVoiceQueue']=function(_0x5eb77c){var _0x4bef9c=this;return new Promise(function(_0x297e9d,_0x47a0d8){return db[_0xdc2a('0x1c')][_0xdc2a('0x1d')]({'raw':_0x5eb77c['options']?_0x5eb77c[_0xdc2a('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x5eb77c[_0xdc2a('0x1e')]?_0x5eb77c['options'][_0xdc2a('0x1f')]||null:null,'attributes':_0x5eb77c[_0xdc2a('0x1e')]?_0x5eb77c[_0xdc2a('0x1e')][_0xdc2a('0x20')]||null:null,'limit':_0x5eb77c['options']?_0x5eb77c['options'][_0xdc2a('0x21')]||null:null,'include':_0x5eb77c[_0xdc2a('0x1e')]?_0x5eb77c['options'][_0xdc2a('0x22')]?_[_0xdc2a('0x23')](_0x5eb77c[_0xdc2a('0x1e')][_0xdc2a('0x22')],function(_0x3810e6){return{'model':db[_0x3810e6[_0xdc2a('0x24')]],'as':_0x3810e6['as'],'attributes':_0x3810e6[_0xdc2a('0x20')],'include':_0x3810e6[_0xdc2a('0x22')]?_['map'](_0x3810e6[_0xdc2a('0x22')],function(_0x3722f5){return{'model':db[_0x3722f5['model']],'as':_0x3722f5['as'],'attributes':_0x3722f5[_0xdc2a('0x20')],'include':_0x3722f5[_0xdc2a('0x22')]?_[_0xdc2a('0x23')](_0x3722f5[_0xdc2a('0x22')],function(_0x22cf83){return{'model':db[_0x22cf83['model']],'as':_0x22cf83['as'],'attributes':_0x22cf83[_0xdc2a('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f4edc){logger[_0xdc2a('0x12')](_0xdc2a('0x25'),_0x5eb77c);logger['debug'](_0xdc2a('0x25'),_0x5eb77c,JSON[_0xdc2a('0x17')](_0x4f4edc));_0x297e9d(_0x4f4edc);})[_0xdc2a('0x26')](function(_0x43d0f2){logger[_0xdc2a('0x18')](_0xdc2a('0x25'),_0x43d0f2[_0xdc2a('0x1a')],_0x5eb77c);_0x47a0d8(_0x4bef9c[_0xdc2a('0x18')](0x1f4,_0x43d0f2[_0xdc2a('0x1a')]));});});};exports['ShowVoiceQueue']=function(_0x4754ee){var _0x4bef6c=this;return new Promise(function(_0x2dfcbc,_0x136243){return db[_0xdc2a('0x1c')][_0xdc2a('0x27')]({'raw':_0x4754ee[_0xdc2a('0x1e')]?_0x4754ee['options'][_0xdc2a('0x28')]===undefined?!![]:![]:!![],'where':_0x4754ee[_0xdc2a('0x1e')]?_0x4754ee[_0xdc2a('0x1e')][_0xdc2a('0x1f')]||null:null,'attributes':_0x4754ee[_0xdc2a('0x1e')]?_0x4754ee[_0xdc2a('0x1e')][_0xdc2a('0x20')]||null:null,'include':_0x4754ee[_0xdc2a('0x1e')]?_0x4754ee[_0xdc2a('0x1e')][_0xdc2a('0x22')]?_[_0xdc2a('0x23')](_0x4754ee[_0xdc2a('0x1e')][_0xdc2a('0x22')],function(_0x102adf){return{'model':db[_0x102adf[_0xdc2a('0x24')]],'as':_0x102adf['as'],'attributes':_0x102adf['attributes'],'include':_0x102adf[_0xdc2a('0x22')]?_[_0xdc2a('0x23')](_0x102adf[_0xdc2a('0x22')],function(_0x35a166){return{'model':db[_0x35a166[_0xdc2a('0x24')]],'as':_0x35a166['as'],'attributes':_0x35a166[_0xdc2a('0x20')],'include':_0x35a166[_0xdc2a('0x22')]?_[_0xdc2a('0x23')](_0x35a166[_0xdc2a('0x22')],function(_0x4457c4){return{'model':db[_0x4457c4[_0xdc2a('0x24')]],'as':_0x4457c4['as'],'attributes':_0x4457c4[_0xdc2a('0x20')]};}):[]};}):[]};}):[]:[]})[_0xdc2a('0x11')](function(_0x6a308f){logger[_0xdc2a('0x12')](_0xdc2a('0x29'),_0x4754ee);logger[_0xdc2a('0x15')](_0xdc2a('0x29'),_0x4754ee,JSON[_0xdc2a('0x17')](_0x6a308f));_0x2dfcbc(_0x6a308f);})[_0xdc2a('0x26')](function(_0x43b62f){logger[_0xdc2a('0x18')](_0xdc2a('0x29'),_0x43b62f[_0xdc2a('0x1a')],_0x4754ee);_0x136243(_0x4bef6c[_0xdc2a('0x18')](0x1f4,_0x43b62f['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 6608fe1..bada8a4 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 _0x2cb5=['length','./voiceQueue.events','save','emit','removeListener'];(function(_0x3e6729,_0x16d4af){var _0x535bcd=function(_0x5e6c5f){while(--_0x5e6c5f){_0x3e6729['push'](_0x3e6729['shift']());}};_0x535bcd(++_0x16d4af);}(_0x2cb5,0xb5));var _0x52cb=function(_0x3ae2b2,_0x2d936f){_0x3ae2b2=_0x3ae2b2-0x0;var _0x1dbf00=_0x2cb5[_0x3ae2b2];return _0x1dbf00;};'use strict';var VoiceQueueEvents=require(_0x52cb('0x0'));var events=[_0x52cb('0x1'),'remove','update'];function createListener(_0x3fd07e,_0x5d9da8){return function(_0x2e8e58){_0x5d9da8[_0x52cb('0x2')](_0x3fd07e,_0x2e8e58);};}function removeListener(_0x3d0e2b,_0x5571e3){return function(){VoiceQueueEvents[_0x52cb('0x3')](_0x3d0e2b,_0x5571e3);};}exports['register']=function(_0x16396b){for(var _0x4dc007=0x0,_0x5baa41=events[_0x52cb('0x4')];_0x4dc007<_0x5baa41;_0x4dc007++){var _0x27424e=events[_0x4dc007];var _0x3742fc=createListener('voiceQueue:'+_0x27424e,_0x16396b);VoiceQueueEvents['on'](_0x27424e,_0x3742fc);}}; \ No newline at end of file +var _0x08dd=['removeListener','length','voiceQueue:','save','update','emit'];(function(_0x273dc5,_0x268a81){var _0x46dae7=function(_0x263d62){while(--_0x263d62){_0x273dc5['push'](_0x273dc5['shift']());}};_0x46dae7(++_0x268a81);}(_0x08dd,0x183));var _0xd08d=function(_0x454cbf,_0x202eac){_0x454cbf=_0x454cbf-0x0;var _0x1b702c=_0x08dd[_0x454cbf];return _0x1b702c;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0xd08d('0x0'),'remove',_0xd08d('0x1')];function createListener(_0x1cd06f,_0x2ff809){return function(_0x2406b6){_0x2ff809[_0xd08d('0x2')](_0x1cd06f,_0x2406b6);};}function removeListener(_0x26aa1c,_0x2ab604){return function(){VoiceQueueEvents[_0xd08d('0x3')](_0x26aa1c,_0x2ab604);};}exports['register']=function(_0x56d007){for(var _0x523ae1=0x0,_0x3558aa=events[_0xd08d('0x4')];_0x523ae1<_0x3558aa;_0x523ae1++){var _0x5d6b72=events[_0x523ae1];var _0x25309e=createListener(_0xd08d('0x5')+_0x5d6b72,_0x56d007);VoiceQueueEvents['on'](_0x5d6b72,_0x25309e);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 7c542d0..518da30 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 _0xe344=['show','post','create','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','describe','getVoiceQueuesReport','/:id'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe344,0x151));var _0x4e34=function(_0x10b4a6,_0x15a756){_0x10b4a6=_0x10b4a6-0x0;var _0x33ed4b=_0xe344[_0x10b4a6];return _0x33ed4b;};'use strict';var multer=require(_0x4e34('0x0'));var util=require(_0x4e34('0x1'));var path=require(_0x4e34('0x2'));var timeout=require('connect-timeout');var express=require(_0x4e34('0x3'));var router=express[_0x4e34('0x4')]();var fs_extra=require(_0x4e34('0x5'));var auth=require(_0x4e34('0x6'));var interaction=require(_0x4e34('0x7'));var config=require(_0x4e34('0x8'));var controller=require(_0x4e34('0x9'));router[_0x4e34('0xa')]('/',auth[_0x4e34('0xb')](),controller['index']);router[_0x4e34('0xa')]('/describe',auth[_0x4e34('0xb')](),controller[_0x4e34('0xc')]);router[_0x4e34('0xa')]('/index',auth[_0x4e34('0xb')](),controller[_0x4e34('0xd')]);router[_0x4e34('0xa')](_0x4e34('0xe'),auth[_0x4e34('0xb')](),controller[_0x4e34('0xf')]);router[_0x4e34('0x10')]('/',auth['isAuthenticated'](),controller[_0x4e34('0x11')]);router[_0x4e34('0x12')]('/:id',auth[_0x4e34('0xb')](),controller[_0x4e34('0x13')]);router[_0x4e34('0x14')](_0x4e34('0xe'),auth[_0x4e34('0xb')](),controller['destroy']);module[_0x4e34('0x15')]=router; \ No newline at end of file +var _0x0f98=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','/describe','describe','/index','getVoiceQueuesReport','/:id','show','post','create','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra'];(function(_0x3a9661,_0x530b12){var _0x5bb119=function(_0x1278f){while(--_0x1278f){_0x3a9661['push'](_0x3a9661['shift']());}};_0x5bb119(++_0x530b12);}(_0x0f98,0x103));var _0x80f9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0f98[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x80f9('0x0'));var path=require(_0x80f9('0x1'));var timeout=require(_0x80f9('0x2'));var express=require('express');var router=express[_0x80f9('0x3')]();var fs_extra=require(_0x80f9('0x4'));var auth=require(_0x80f9('0x5'));var interaction=require(_0x80f9('0x6'));var config=require(_0x80f9('0x7'));var controller=require(_0x80f9('0x8'));router[_0x80f9('0x9')]('/',auth[_0x80f9('0xa')](),controller['index']);router[_0x80f9('0x9')](_0x80f9('0xb'),auth[_0x80f9('0xa')](),controller[_0x80f9('0xc')]);router[_0x80f9('0x9')](_0x80f9('0xd'),auth[_0x80f9('0xa')](),controller[_0x80f9('0xe')]);router[_0x80f9('0x9')](_0x80f9('0xf'),auth[_0x80f9('0xa')](),controller[_0x80f9('0x10')]);router[_0x80f9('0x11')]('/',auth['isAuthenticated'](),controller[_0x80f9('0x12')]);router['put'](_0x80f9('0xf'),auth[_0x80f9('0xa')](),controller['update']);router[_0x80f9('0x13')]('/:id',auth[_0x80f9('0xa')](),controller[_0x80f9('0x14')]);module[_0x80f9('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index d408848..96f668a 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 _0x934d=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','holdtime'];(function(_0x574f8a,_0x47c0b7){var _0x40606f=function(_0xb2e776){while(--_0xb2e776){_0x574f8a['push'](_0x574f8a['shift']());}};_0x40606f(++_0x47c0b7);}(_0x934d,0x14d));var _0xd934=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0x934d[_0x4e6ae6];return _0x23c108;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xd934('0x0'));module[_0xd934('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xd934('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xd934('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0xd934('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0xd934('0x3')],'set':function(_0x75d245){var _0x180d12=moment(_0x75d245);var _0x3511cf=moment(this[_0xd934('0x4')](_0xd934('0x5')))[_0xd934('0x6')](_0xd934('0x7'));var _0x2f3510=_0x180d12[_0xd934('0x8')](_0x3511cf,_0xd934('0x9'));this[_0xd934('0xa')]('queuecallerleaveAt',_0x75d245);this[_0xd934('0xa')](_0xd934('0xb'),_0x2f3510||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0xd934('0xc')]},'queuecallerabandon':{'type':Sequelize[_0xd934('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xd934('0x3')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xd934('0x3')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xd934('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0xd934('0x2')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0xd934('0xc')]},'channel':{'type':Sequelize[_0xd934('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xd934('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xd934('0x2')]},'exten':{'type':Sequelize[_0xd934('0x2')]},'priority':{'type':Sequelize[_0xd934('0x2')]},'holdtime':{'type':Sequelize[_0xd934('0xc')]},'mohtime':{'type':Sequelize[_0xd934('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xd934('0x2')]},'transfer':{'type':Sequelize[_0xd934('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xd934('0x2')],'comment':_0xd934('0xe')},'transferexten':{'type':Sequelize[_0xd934('0x2')]},'transferuniqueid':{'type':Sequelize[_0xd934('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xd934('0x2')]},'thirdDisposition':{'type':Sequelize[_0xd934('0x2')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x3bf4=['getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE'];(function(_0x2d555f,_0x3f2876){var _0x14a1b1=function(_0xf6a217){while(--_0xf6a217){_0x2d555f['push'](_0x2d555f['shift']());}};_0x14a1b1(++_0x3f2876);}(_0x3bf4,0xd3));var _0x43bf=function(_0x4a591c,_0x48e5d9){_0x4a591c=_0x4a591c-0x0;var _0xacfe93=_0x3bf4[_0x4a591c];return _0xacfe93;};'use strict';var Sequelize=require(_0x43bf('0x0'));var moment=require(_0x43bf('0x1'));module[_0x43bf('0x2')]={'type':{'type':Sequelize[_0x43bf('0x3')]},'uniqueid':{'type':Sequelize[_0x43bf('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x43bf('0x3')]},'queue':{'type':Sequelize[_0x43bf('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x43bf('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x43bf('0x4')],'set':function(_0x198a99){var _0x1dd905=moment(_0x198a99);var _0x3cc040=moment(this[_0x43bf('0x5')](_0x43bf('0x6')))[_0x43bf('0x7')](_0x43bf('0x8'));var _0x2bb9d5=_0x1dd905[_0x43bf('0x9')](_0x3cc040,_0x43bf('0xa'));this[_0x43bf('0xb')](_0x43bf('0xc'),_0x198a99);this['setDataValue'](_0x43bf('0xd'),_0x2bb9d5||null);}},'position':{'type':Sequelize[_0x43bf('0xe')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x43bf('0xf')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x43bf('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x43bf('0xf')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x43bf('0x4')]},'queuecallerexit':{'type':Sequelize[_0x43bf('0xf')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x43bf('0x3')],'comment':_0x43bf('0x10')},'originalposition':{'type':Sequelize[_0x43bf('0xe')]},'channel':{'type':Sequelize[_0x43bf('0x3')]},'connectedlinenum':{'type':Sequelize[_0x43bf('0x3')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x43bf('0x3')]},'context':{'type':Sequelize[_0x43bf('0x3')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x43bf('0x3')]},'holdtime':{'type':Sequelize[_0x43bf('0xe')]},'mohtime':{'type':Sequelize[_0x43bf('0xe')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x43bf('0xf')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x43bf('0xf')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x43bf('0x3')],'comment':_0x43bf('0x11')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x43bf('0x3')]},'disposition':{'type':Sequelize[_0x43bf('0x3')]},'secondDisposition':{'type':Sequelize[_0x43bf('0x3')]},'thirdDisposition':{'type':Sequelize[_0x43bf('0x3')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 7fc12c5..61a2e86 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 _0xcfa1=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','stack','name','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','getVoiceQueuesReport','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring'];(function(_0x567ec1,_0x8f295f){var _0xd9378=function(_0x3b7df1){while(--_0x3b7df1){_0x567ec1['push'](_0x567ec1['shift']());}};_0xd9378(++_0x8f295f);}(_0xcfa1,0x181));var _0x1cfa=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xcfa1[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x1cfa('0x0'));var rimraf=require(_0x1cfa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1cfa('0x2'));var rp=require('request-promise');var moment=require(_0x1cfa('0x3'));var BPromise=require(_0x1cfa('0x4'));var Mustache=require('mustache');var util=require(_0x1cfa('0x5'));var path=require(_0x1cfa('0x6'));var sox=require(_0x1cfa('0x7'));var csv=require(_0x1cfa('0x8'));var ejs=require(_0x1cfa('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1cfa('0xa'));var squel=require(_0x1cfa('0xb'));var crypto=require('crypto');var jsforce=require(_0x1cfa('0xc'));var deskjs=require(_0x1cfa('0xd'));var toCsv=require(_0x1cfa('0x8'));var querystring=require(_0x1cfa('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1cfa('0xf'));var qs=require(_0x1cfa('0x10'));var as=require(_0x1cfa('0x11'));var hardwareService=require(_0x1cfa('0x12'));var logger=require(_0x1cfa('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x1cfa('0x14'));var licenseUtil=require(_0x1cfa('0x15'));var db=require(_0x1cfa('0x16'))['db'];config[_0x1cfa('0x17')]=_['defaults'](config[_0x1cfa('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x1cfa('0x18'))(new Redis(config[_0x1cfa('0x17')]));require(_0x1cfa('0x19'))[_0x1cfa('0x1a')](socket);function respondWithStatusCode(_0x3449b3,_0x274366){_0x274366=_0x274366||0xcc;return function(_0x35a685){if(_0x35a685){return _0x3449b3[_0x1cfa('0x1b')](_0x274366);}return _0x3449b3[_0x1cfa('0x1c')](_0x274366)[_0x1cfa('0x1d')]();};}function respondWithResult(_0x35068c,_0x5edf90){_0x5edf90=_0x5edf90||0xc8;return function(_0x2a2aa4){if(_0x2a2aa4){return _0x35068c['status'](_0x5edf90)[_0x1cfa('0x1e')](_0x2a2aa4);}};}function respondWithFilteredResult(_0x1dd537,_0x2f265b){return function(_0x14693b){if(_0x14693b){var _0x6675d8=typeof _0x2f265b[_0x1cfa('0x1f')]===_0x1cfa('0x20')&&typeof _0x2f265b[_0x1cfa('0x21')]===_0x1cfa('0x20');var _0x56959c=_0x14693b['count'];var _0x22d80a=_0x6675d8?0x0:_0x2f265b['offset'];var _0x1b109d=_0x6675d8?_0x14693b[_0x1cfa('0x22')]:_0x2f265b[_0x1cfa('0x1f')]+_0x2f265b['limit'];var _0x3d8da7;if(_0x1b109d>=_0x56959c){_0x1b109d=_0x56959c;_0x3d8da7=0xc8;}else{_0x3d8da7=0xce;}_0x1dd537[_0x1cfa('0x1c')](_0x3d8da7);return _0x1dd537[_0x1cfa('0x23')](_0x1cfa('0x24'),_0x22d80a+'-'+_0x1b109d+'/'+_0x56959c)[_0x1cfa('0x1e')](_0x14693b);}return null;};}function patchUpdates(_0x20941e){return function(_0x2c8c85){try{jsonpatch[_0x1cfa('0x25')](_0x2c8c85,_0x20941e,!![]);}catch(_0x2664fb){return BPromise['reject'](_0x2664fb);}return _0x2c8c85['save']();};}function saveUpdates(_0x37f92d,_0x29e57e){return function(_0x4a0c29){if(_0x4a0c29){return _0x4a0c29[_0x1cfa('0x26')](_0x37f92d)[_0x1cfa('0x27')](function(_0x4ab1e1){return _0x4ab1e1;});}return null;};}function removeEntity(_0x484aaa,_0x480cd4){return function(_0x28c8c1){if(_0x28c8c1){return _0x28c8c1[_0x1cfa('0x28')]()[_0x1cfa('0x27')](function(){_0x484aaa[_0x1cfa('0x1c')](0xcc)[_0x1cfa('0x1d')]();});}};}function handleEntityNotFound(_0x4d9ea1,_0x4b234d){return function(_0x4c5bc0){if(!_0x4c5bc0){_0x4d9ea1['sendStatus'](0x194);}return _0x4c5bc0;};}function handleError(_0x218686,_0x3c523b){_0x3c523b=_0x3c523b||0x1f4;return function(_0x36b2e7){logger['error'](_0x36b2e7[_0x1cfa('0x29')]);if(_0x36b2e7[_0x1cfa('0x2a')]){delete _0x36b2e7[_0x1cfa('0x2a')];}_0x218686[_0x1cfa('0x1c')](_0x3c523b)['send'](_0x36b2e7);};}exports[_0x1cfa('0x2b')]=function(_0x500c00,_0x5d58fb){var _0x254b20={},_0x8af5ba={},_0x342ec6={'count':0x0,'rows':[]};var _0x3eee66=_[_0x1cfa('0x2c')](db[_0x1cfa('0x2d')][_0x1cfa('0x2e')],function(_0x498259){return{'name':_0x498259[_0x1cfa('0x2f')],'type':_0x498259[_0x1cfa('0x30')][_0x1cfa('0x31')]};});_0x8af5ba[_0x1cfa('0x32')]=_['map'](_0x3eee66,_0x1cfa('0x2a'));_0x8af5ba[_0x1cfa('0x33')]=_[_0x1cfa('0x34')](_0x500c00[_0x1cfa('0x33')]);_0x8af5ba[_0x1cfa('0x35')]=_[_0x1cfa('0x36')](_0x8af5ba[_0x1cfa('0x32')],_0x8af5ba[_0x1cfa('0x33')]);_0x254b20[_0x1cfa('0x37')]=_['intersection'](_0x8af5ba[_0x1cfa('0x32')],qs[_0x1cfa('0x38')](_0x500c00[_0x1cfa('0x33')][_0x1cfa('0x38')]));_0x254b20[_0x1cfa('0x37')]=_0x254b20[_0x1cfa('0x37')][_0x1cfa('0x39')]?_0x254b20['attributes']:_0x8af5ba['model'];if(!_0x500c00[_0x1cfa('0x33')][_0x1cfa('0x3a')](_0x1cfa('0x3b'))){_0x254b20['limit']=qs[_0x1cfa('0x21')](_0x500c00[_0x1cfa('0x33')][_0x1cfa('0x21')]);_0x254b20[_0x1cfa('0x1f')]=qs[_0x1cfa('0x1f')](_0x500c00[_0x1cfa('0x33')][_0x1cfa('0x1f')]);}_0x254b20[_0x1cfa('0x3c')]=qs[_0x1cfa('0x3d')](_0x500c00['query'][_0x1cfa('0x3d')]);_0x254b20[_0x1cfa('0x3e')]=qs[_0x1cfa('0x35')](_[_0x1cfa('0x3f')](_0x500c00['query'],_0x8af5ba[_0x1cfa('0x35')]),_0x3eee66);if(_0x500c00[_0x1cfa('0x33')][_0x1cfa('0x40')]){_0x254b20['where']=_[_0x1cfa('0x41')](_0x254b20[_0x1cfa('0x3e')],{'$or':_['map'](_0x3eee66,function(_0x52f0d3){if(_0x52f0d3[_0x1cfa('0x30')]!==_0x1cfa('0x42')){var _0x495250={};_0x495250[_0x52f0d3['name']]={'$like':'%'+_0x500c00[_0x1cfa('0x33')][_0x1cfa('0x40')]+'%'};return _0x495250;}})});}_0x254b20=_[_0x1cfa('0x41')]({},_0x254b20,_0x500c00[_0x1cfa('0x43')]);var _0x3804e8={'where':_0x254b20[_0x1cfa('0x3e')]};return db[_0x1cfa('0x2d')][_0x1cfa('0x22')](_0x3804e8)[_0x1cfa('0x27')](function(_0x3e3630){_0x342ec6[_0x1cfa('0x22')]=_0x3e3630;if(_0x500c00['query'][_0x1cfa('0x44')]){_0x254b20[_0x1cfa('0x45')]=[{'all':!![]}];}return db[_0x1cfa('0x2d')][_0x1cfa('0x46')](_0x254b20);})[_0x1cfa('0x27')](function(_0x517548){_0x342ec6[_0x1cfa('0x47')]=_0x517548;return _0x342ec6;})[_0x1cfa('0x27')](respondWithFilteredResult(_0x5d58fb,_0x254b20))[_0x1cfa('0x48')](handleError(_0x5d58fb,null));};exports[_0x1cfa('0x49')]=function(_0x3524d4,_0x423f4d){var _0x214c07={'raw':![],'where':{'id':_0x3524d4[_0x1cfa('0x4a')]['id']}},_0x229829={};_0x229829[_0x1cfa('0x32')]=_[_0x1cfa('0x34')](db[_0x1cfa('0x2d')][_0x1cfa('0x2e')]);_0x229829['query']=_['keys'](_0x3524d4[_0x1cfa('0x33')]);_0x229829[_0x1cfa('0x35')]=_['intersection'](_0x229829[_0x1cfa('0x32')],_0x229829[_0x1cfa('0x33')]);_0x214c07['attributes']=_[_0x1cfa('0x36')](_0x229829['model'],qs['fields'](_0x3524d4['query'][_0x1cfa('0x38')]));_0x214c07['attributes']=_0x214c07[_0x1cfa('0x37')][_0x1cfa('0x39')]?_0x214c07['attributes']:_0x229829[_0x1cfa('0x32')];if(_0x3524d4[_0x1cfa('0x33')][_0x1cfa('0x44')]){_0x214c07['include']=[{'all':!![]}];}_0x214c07=_[_0x1cfa('0x41')]({},_0x214c07,_0x3524d4[_0x1cfa('0x43')]);return db['VoiceQueueReport'][_0x1cfa('0x4b')](_0x214c07)[_0x1cfa('0x27')](handleEntityNotFound(_0x423f4d,null))[_0x1cfa('0x27')](respondWithResult(_0x423f4d,null))['catch'](handleError(_0x423f4d,null));};exports[_0x1cfa('0x4c')]=function(_0x55063d,_0xec23a0){return db['VoiceQueueReport'][_0x1cfa('0x4c')](_0x55063d[_0x1cfa('0x4d')],{})[_0x1cfa('0x27')](respondWithResult(_0xec23a0,0xc9))[_0x1cfa('0x48')](handleError(_0xec23a0,null));};exports[_0x1cfa('0x26')]=function(_0x1ab9fe,_0x3dcddd){if(_0x1ab9fe[_0x1cfa('0x4d')]['id']){delete _0x1ab9fe[_0x1cfa('0x4d')]['id'];}return db[_0x1cfa('0x2d')]['find']({'where':{'id':_0x1ab9fe[_0x1cfa('0x4a')]['id']}})[_0x1cfa('0x27')](handleEntityNotFound(_0x3dcddd,null))[_0x1cfa('0x27')](saveUpdates(_0x1ab9fe['body'],null))[_0x1cfa('0x27')](respondWithResult(_0x3dcddd,null))['catch'](handleError(_0x3dcddd,null));};exports[_0x1cfa('0x28')]=function(_0x140703,_0x4285e8){return db[_0x1cfa('0x2d')][_0x1cfa('0x4b')]({'where':{'id':_0x140703[_0x1cfa('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4285e8,null))[_0x1cfa('0x27')](removeEntity(_0x4285e8,null))[_0x1cfa('0x48')](handleError(_0x4285e8,null));};exports[_0x1cfa('0x4e')]=function(_0xc87961,_0x47d550){return db[_0x1cfa('0x2d')]['describe']()[_0x1cfa('0x27')](respondWithResult(_0x47d550,null))[_0x1cfa('0x48')](handleError(_0x47d550,null));};exports['getVoiceQueuesReport']=function(_0xa22341,_0x582735){var _0x4606b9={},_0x4f8a7c={},_0x4cd712={'count':0x0,'rows':[]};_0x4f8a7c['model']=_['keys'](db['VoiceQueueReport'][_0x1cfa('0x2e')]);_0x4f8a7c[_0x1cfa('0x33')]=_[_0x1cfa('0x34')](_0xa22341[_0x1cfa('0x33')]);_0x4f8a7c['filters']=_[_0x1cfa('0x36')](_0x4f8a7c[_0x1cfa('0x32')],_0x4f8a7c[_0x1cfa('0x33')]);_0x4606b9['attributes']=_[_0x1cfa('0x36')](_0x4f8a7c['model'],qs[_0x1cfa('0x38')](_0xa22341[_0x1cfa('0x33')][_0x1cfa('0x38')]));_0x4606b9['attributes']=_0x4606b9[_0x1cfa('0x37')]['length']?_0x4606b9['attributes']:_0x4f8a7c['model'];if(!_0xa22341[_0x1cfa('0x33')][_0x1cfa('0x3a')](_0x1cfa('0x3b'))){_0x4606b9[_0x1cfa('0x21')]=qs[_0x1cfa('0x21')](_0xa22341[_0x1cfa('0x33')][_0x1cfa('0x21')]);_0x4606b9[_0x1cfa('0x1f')]=qs[_0x1cfa('0x1f')](_0xa22341['query'][_0x1cfa('0x1f')]);}_0x4606b9[_0x1cfa('0x3c')]=qs['sort'](_0xa22341[_0x1cfa('0x33')][_0x1cfa('0x3d')]);_0x4606b9['where']=qs[_0x1cfa('0x35')](_[_0x1cfa('0x3f')](_0xa22341[_0x1cfa('0x33')],_0x4f8a7c[_0x1cfa('0x35')]));if(_0xa22341[_0x1cfa('0x33')]['filter']){_0x4606b9[_0x1cfa('0x3e')]=_[_0x1cfa('0x41')](_0x4606b9[_0x1cfa('0x3e')],{'$or':_['map'](_0x4606b9['attributes'],function(_0x31fe8a){var _0x45cf7f={};_0x45cf7f[_0x31fe8a]={'$like':'%'+_0xa22341['query'][_0x1cfa('0x40')]+'%'};return _0x45cf7f;})});}_0x4606b9=_[_0x1cfa('0x41')]({},_0x4606b9,_0xa22341['options']);var _0x9e877c={'where':_0x4606b9[_0x1cfa('0x3e')]};return db['VoiceQueueReport']['count'](_0x9e877c)['then'](function(_0x3ee788){_0x4cd712['count']=_0x3ee788;if(_0xa22341[_0x1cfa('0x33')][_0x1cfa('0x44')]){_0x4606b9['include']=[{'all':!![]}];}return db[_0x1cfa('0x2d')][_0x1cfa('0x46')](_0x4606b9);})['then'](function(_0x150f94){_0x4cd712['rows']=_0x150f94;return _0x4cd712;})['then'](respondWithFilteredResult(_0x582735,_0x4606b9,_0x1cfa('0x4f')))[_0x1cfa('0x48')](handleError(_0x582735,null,_0x1cfa('0x4f')));}; \ No newline at end of file +var _0x4bad=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','register','status','json','undefined','count','offset','set','apply','save','update','then','destroy','end','sendStatus','error','send','index','key','map','name','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','type','merge','options','includeAll','include','VoiceQueueReport','rows','catch','show','params','keys','length','find','create','body','describe','rawAttributes','findAll','getVoiceQueuesReport','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x2ca012,_0x477ca6){var _0x1bd467=function(_0x5bba5f){while(--_0x5bba5f){_0x2ca012['push'](_0x2ca012['shift']());}};_0x1bd467(++_0x477ca6);}(_0x4bad,0x1db));var _0xd4ba=function(_0x4905e0,_0x1725a3){_0x4905e0=_0x4905e0-0x0;var _0x43c90e=_0x4bad[_0x4905e0];return _0x43c90e;};'use strict';var emlformat=require(_0xd4ba('0x0'));var rimraf=require(_0xd4ba('0x1'));var zipdir=require(_0xd4ba('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd4ba('0x3'));var moment=require('moment');var BPromise=require(_0xd4ba('0x4'));var Mustache=require(_0xd4ba('0x5'));var util=require(_0xd4ba('0x6'));var path=require(_0xd4ba('0x7'));var sox=require(_0xd4ba('0x8'));var csv=require('to-csv');var ejs=require(_0xd4ba('0x9'));var fs=require('fs');var fs_extra=require(_0xd4ba('0xa'));var _=require('lodash');var squel=require(_0xd4ba('0xb'));var crypto=require(_0xd4ba('0xc'));var jsforce=require(_0xd4ba('0xd'));var deskjs=require(_0xd4ba('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd4ba('0xf'));var Papa=require(_0xd4ba('0x10'));var Redis=require(_0xd4ba('0x11'));var authService=require(_0xd4ba('0x12'));var qs=require(_0xd4ba('0x13'));var as=require(_0xd4ba('0x14'));var hardwareService=require(_0xd4ba('0x15'));var logger=require('../../config/logger')(_0xd4ba('0x16'));var utils=require(_0xd4ba('0x17'));var config=require(_0xd4ba('0x18'));var licenseUtil=require(_0xd4ba('0x19'));var db=require('../../mysqldb')['db'];config[_0xd4ba('0x1a')]=_[_0xd4ba('0x1b')](config[_0xd4ba('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xd4ba('0x1c'))(new Redis(config[_0xd4ba('0x1a')]));require('./voiceQueueReport.socket')[_0xd4ba('0x1d')](socket);function respondWithStatusCode(_0x5344d8,_0x25d00c){_0x25d00c=_0x25d00c||0xcc;return function(_0x4bf8af){if(_0x4bf8af){return _0x5344d8['sendStatus'](_0x25d00c);}return _0x5344d8[_0xd4ba('0x1e')](_0x25d00c)['end']();};}function respondWithResult(_0x53c67c,_0x4e6ab5){_0x4e6ab5=_0x4e6ab5||0xc8;return function(_0x16fd51){if(_0x16fd51){return _0x53c67c['status'](_0x4e6ab5)[_0xd4ba('0x1f')](_0x16fd51);}};}function respondWithFilteredResult(_0x5455c8,_0x37ee14){return function(_0x5a8462){if(_0x5a8462){var _0x513d2d=typeof _0x37ee14['offset']===_0xd4ba('0x20')&&typeof _0x37ee14['limit']==='undefined';var _0x5ea99b=_0x5a8462[_0xd4ba('0x21')];var _0x442d01=_0x513d2d?0x0:_0x37ee14['offset'];var _0x3c7e36=_0x513d2d?_0x5a8462['count']:_0x37ee14[_0xd4ba('0x22')]+_0x37ee14['limit'];var _0x2876ca;if(_0x3c7e36>=_0x5ea99b){_0x3c7e36=_0x5ea99b;_0x2876ca=0xc8;}else{_0x2876ca=0xce;}_0x5455c8['status'](_0x2876ca);return _0x5455c8[_0xd4ba('0x23')]('Content-Range',_0x442d01+'-'+_0x3c7e36+'/'+_0x5ea99b)['json'](_0x5a8462);}return null;};}function patchUpdates(_0xe993fa){return function(_0x5367a9){try{jsonpatch[_0xd4ba('0x24')](_0x5367a9,_0xe993fa,!![]);}catch(_0x3efc63){return BPromise['reject'](_0x3efc63);}return _0x5367a9[_0xd4ba('0x25')]();};}function saveUpdates(_0x5383ab,_0x411314){return function(_0x7331fc){if(_0x7331fc){return _0x7331fc[_0xd4ba('0x26')](_0x5383ab)[_0xd4ba('0x27')](function(_0x5d3029){return _0x5d3029;});}return null;};}function removeEntity(_0x47aa69,_0x428c7a){return function(_0x229c46){if(_0x229c46){return _0x229c46[_0xd4ba('0x28')]()[_0xd4ba('0x27')](function(){_0x47aa69[_0xd4ba('0x1e')](0xcc)[_0xd4ba('0x29')]();});}};}function handleEntityNotFound(_0x4b0e12,_0x51cbad){return function(_0x276a7b){if(!_0x276a7b){_0x4b0e12[_0xd4ba('0x2a')](0x194);}return _0x276a7b;};}function handleError(_0x3c1c8a,_0x18f577){_0x18f577=_0x18f577||0x1f4;return function(_0x24b4a){logger[_0xd4ba('0x2b')](_0x24b4a['stack']);if(_0x24b4a['name']){delete _0x24b4a['name'];}_0x3c1c8a[_0xd4ba('0x1e')](_0x18f577)[_0xd4ba('0x2c')](_0x24b4a);};}exports[_0xd4ba('0x2d')]=function(_0x5622de,_0x4922cc){var _0x553871={},_0x2492be={},_0x52433f={'count':0x0,'rows':[]};var _0x5dad56=_['map'](db['VoiceQueueReport']['rawAttributes'],function(_0x31244d){return{'name':_0x31244d['fieldName'],'type':_0x31244d['type'][_0xd4ba('0x2e')]};});_0x2492be['model']=_[_0xd4ba('0x2f')](_0x5dad56,_0xd4ba('0x30'));_0x2492be['query']=_['keys'](_0x5622de[_0xd4ba('0x31')]);_0x2492be[_0xd4ba('0x32')]=_[_0xd4ba('0x33')](_0x2492be[_0xd4ba('0x34')],_0x2492be[_0xd4ba('0x31')]);_0x553871['attributes']=_[_0xd4ba('0x33')](_0x2492be[_0xd4ba('0x34')],qs['fields'](_0x5622de[_0xd4ba('0x31')][_0xd4ba('0x35')]));_0x553871[_0xd4ba('0x36')]=_0x553871[_0xd4ba('0x36')]['length']?_0x553871[_0xd4ba('0x36')]:_0x2492be[_0xd4ba('0x34')];if(!_0x5622de[_0xd4ba('0x31')][_0xd4ba('0x37')](_0xd4ba('0x38'))){_0x553871[_0xd4ba('0x39')]=qs[_0xd4ba('0x39')](_0x5622de['query'][_0xd4ba('0x39')]);_0x553871['offset']=qs['offset'](_0x5622de[_0xd4ba('0x31')][_0xd4ba('0x22')]);}_0x553871[_0xd4ba('0x3a')]=qs[_0xd4ba('0x3b')](_0x5622de[_0xd4ba('0x31')][_0xd4ba('0x3b')]);_0x553871[_0xd4ba('0x3c')]=qs['filters'](_[_0xd4ba('0x3d')](_0x5622de['query'],_0x2492be[_0xd4ba('0x32')]),_0x5dad56);if(_0x5622de[_0xd4ba('0x31')][_0xd4ba('0x3e')]){_0x553871[_0xd4ba('0x3c')]=_['merge'](_0x553871['where'],{'$or':_[_0xd4ba('0x2f')](_0x5dad56,function(_0x201486){if(_0x201486[_0xd4ba('0x3f')]!=='VIRTUAL'){var _0x4eb9cd={};_0x4eb9cd[_0x201486[_0xd4ba('0x30')]]={'$like':'%'+_0x5622de[_0xd4ba('0x31')]['filter']+'%'};return _0x4eb9cd;}})});}_0x553871=_[_0xd4ba('0x40')]({},_0x553871,_0x5622de[_0xd4ba('0x41')]);var _0x1b9c6e={'where':_0x553871['where']};return db['VoiceQueueReport']['count'](_0x1b9c6e)[_0xd4ba('0x27')](function(_0x4eec84){_0x52433f[_0xd4ba('0x21')]=_0x4eec84;if(_0x5622de[_0xd4ba('0x31')][_0xd4ba('0x42')]){_0x553871[_0xd4ba('0x43')]=[{'all':!![]}];}return db[_0xd4ba('0x44')]['findAll'](_0x553871);})['then'](function(_0xd8b7af){_0x52433f[_0xd4ba('0x45')]=_0xd8b7af;return _0x52433f;})['then'](respondWithFilteredResult(_0x4922cc,_0x553871))[_0xd4ba('0x46')](handleError(_0x4922cc,null));};exports[_0xd4ba('0x47')]=function(_0x428696,_0x41cf0e){var _0x6beca8={'raw':![],'where':{'id':_0x428696[_0xd4ba('0x48')]['id']}},_0x4eaf9d={};_0x4eaf9d[_0xd4ba('0x34')]=_[_0xd4ba('0x49')](db[_0xd4ba('0x44')]['rawAttributes']);_0x4eaf9d[_0xd4ba('0x31')]=_[_0xd4ba('0x49')](_0x428696[_0xd4ba('0x31')]);_0x4eaf9d[_0xd4ba('0x32')]=_['intersection'](_0x4eaf9d[_0xd4ba('0x34')],_0x4eaf9d['query']);_0x6beca8[_0xd4ba('0x36')]=_['intersection'](_0x4eaf9d[_0xd4ba('0x34')],qs[_0xd4ba('0x35')](_0x428696[_0xd4ba('0x31')]['fields']));_0x6beca8[_0xd4ba('0x36')]=_0x6beca8[_0xd4ba('0x36')][_0xd4ba('0x4a')]?_0x6beca8[_0xd4ba('0x36')]:_0x4eaf9d[_0xd4ba('0x34')];if(_0x428696[_0xd4ba('0x31')][_0xd4ba('0x42')]){_0x6beca8[_0xd4ba('0x43')]=[{'all':!![]}];}_0x6beca8=_[_0xd4ba('0x40')]({},_0x6beca8,_0x428696[_0xd4ba('0x41')]);return db[_0xd4ba('0x44')][_0xd4ba('0x4b')](_0x6beca8)[_0xd4ba('0x27')](handleEntityNotFound(_0x41cf0e,null))[_0xd4ba('0x27')](respondWithResult(_0x41cf0e,null))[_0xd4ba('0x46')](handleError(_0x41cf0e,null));};exports[_0xd4ba('0x4c')]=function(_0x19be91,_0x3a19b2){return db['VoiceQueueReport']['create'](_0x19be91['body'],{})[_0xd4ba('0x27')](respondWithResult(_0x3a19b2,0xc9))['catch'](handleError(_0x3a19b2,null));};exports[_0xd4ba('0x26')]=function(_0x36611a,_0x290876){if(_0x36611a[_0xd4ba('0x4d')]['id']){delete _0x36611a['body']['id'];}return db[_0xd4ba('0x44')]['find']({'where':{'id':_0x36611a[_0xd4ba('0x48')]['id']}})[_0xd4ba('0x27')](handleEntityNotFound(_0x290876,null))[_0xd4ba('0x27')](saveUpdates(_0x36611a[_0xd4ba('0x4d')],null))[_0xd4ba('0x27')](respondWithResult(_0x290876,null))[_0xd4ba('0x46')](handleError(_0x290876,null));};exports[_0xd4ba('0x28')]=function(_0x409720,_0x1a60e0){return db['VoiceQueueReport'][_0xd4ba('0x4b')]({'where':{'id':_0x409720['params']['id']}})[_0xd4ba('0x27')](handleEntityNotFound(_0x1a60e0,null))[_0xd4ba('0x27')](removeEntity(_0x1a60e0,null))[_0xd4ba('0x46')](handleError(_0x1a60e0,null));};exports[_0xd4ba('0x4e')]=function(_0x57cd88,_0x3846ec){return db[_0xd4ba('0x44')]['describe']()['then'](respondWithResult(_0x3846ec,null))[_0xd4ba('0x46')](handleError(_0x3846ec,null));};exports['getVoiceQueuesReport']=function(_0x1049fc,_0x4d14d0){var _0xaf541e={},_0x4b6f52={},_0x10f8bb={'count':0x0,'rows':[]};_0x4b6f52[_0xd4ba('0x34')]=_[_0xd4ba('0x49')](db['VoiceQueueReport'][_0xd4ba('0x4f')]);_0x4b6f52[_0xd4ba('0x31')]=_[_0xd4ba('0x49')](_0x1049fc[_0xd4ba('0x31')]);_0x4b6f52['filters']=_['intersection'](_0x4b6f52['model'],_0x4b6f52['query']);_0xaf541e['attributes']=_[_0xd4ba('0x33')](_0x4b6f52[_0xd4ba('0x34')],qs[_0xd4ba('0x35')](_0x1049fc['query'][_0xd4ba('0x35')]));_0xaf541e[_0xd4ba('0x36')]=_0xaf541e[_0xd4ba('0x36')]['length']?_0xaf541e['attributes']:_0x4b6f52[_0xd4ba('0x34')];if(!_0x1049fc[_0xd4ba('0x31')]['hasOwnProperty'](_0xd4ba('0x38'))){_0xaf541e[_0xd4ba('0x39')]=qs[_0xd4ba('0x39')](_0x1049fc[_0xd4ba('0x31')]['limit']);_0xaf541e['offset']=qs[_0xd4ba('0x22')](_0x1049fc[_0xd4ba('0x31')][_0xd4ba('0x22')]);}_0xaf541e[_0xd4ba('0x3a')]=qs['sort'](_0x1049fc[_0xd4ba('0x31')][_0xd4ba('0x3b')]);_0xaf541e[_0xd4ba('0x3c')]=qs[_0xd4ba('0x32')](_[_0xd4ba('0x3d')](_0x1049fc['query'],_0x4b6f52['filters']));if(_0x1049fc['query'][_0xd4ba('0x3e')]){_0xaf541e[_0xd4ba('0x3c')]=_[_0xd4ba('0x40')](_0xaf541e[_0xd4ba('0x3c')],{'$or':_['map'](_0xaf541e[_0xd4ba('0x36')],function(_0x584a86){var _0x1c9795={};_0x1c9795[_0x584a86]={'$like':'%'+_0x1049fc['query'][_0xd4ba('0x3e')]+'%'};return _0x1c9795;})});}_0xaf541e=_['merge']({},_0xaf541e,_0x1049fc[_0xd4ba('0x41')]);var _0x52870d={'where':_0xaf541e[_0xd4ba('0x3c')]};return db[_0xd4ba('0x44')][_0xd4ba('0x21')](_0x52870d)[_0xd4ba('0x27')](function(_0x48be6d){_0x10f8bb[_0xd4ba('0x21')]=_0x48be6d;if(_0x1049fc['query'][_0xd4ba('0x42')]){_0xaf541e['include']=[{'all':!![]}];}return db['VoiceQueueReport'][_0xd4ba('0x50')](_0xaf541e);})[_0xd4ba('0x27')](function(_0x4faa6c){_0x10f8bb['rows']=_0x4faa6c;return _0x10f8bb;})[_0xd4ba('0x27')](respondWithFilteredResult(_0x4d14d0,_0xaf541e,_0xd4ba('0x51')))[_0xd4ba('0x46')](handleError(_0x4d14d0,null,_0xd4ba('0x51')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 3d4b882..0f66129 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 _0xf9e6=['hook','../../mysqldb','VoiceQueueReport','update','remove','emit'];(function(_0x1256fe,_0x2c61f8){var _0x9ca70f=function(_0x2c8355){while(--_0x2c8355){_0x1256fe['push'](_0x1256fe['shift']());}};_0x9ca70f(++_0x2c61f8);}(_0xf9e6,0x1a5));var _0x6f9e=function(_0x5afc06,_0x3a4f12){_0x5afc06=_0x5afc06-0x0;var _0x4b82ec=_0xf9e6[_0x5afc06];return _0x4b82ec;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0x6f9e('0x0'))['db'][_0x6f9e('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x6f9e('0x2'),'afterDestroy':_0x6f9e('0x3')};function emitEvent(_0x112e6f){return function(_0x1b5145,_0x429498,_0x36e3bc){VoiceQueueReportEvents['emit'](_0x112e6f+':'+_0x1b5145['id'],_0x1b5145);VoiceQueueReportEvents[_0x6f9e('0x4')](_0x112e6f,_0x1b5145);_0x36e3bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x6f9e('0x5')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0x9cce=['exports','events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x592cbc,_0x5ec030){var _0x39b8d9=function(_0x39055c){while(--_0x39055c){_0x592cbc['push'](_0x592cbc['shift']());}};_0x39b8d9(++_0x5ec030);}(_0x9cce,0x157));var _0xe9cc=function(_0x352f87,_0x53388d){_0x352f87=_0x352f87-0x0;var _0x74143e=_0x9cce[_0x352f87];return _0x74143e;};'use strict';var EventEmitter=require(_0xe9cc('0x0'));var VoiceQueueReport=require(_0xe9cc('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xe9cc('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe9cc('0x3'),'afterDestroy':_0xe9cc('0x4')};function emitEvent(_0x5d4716){return function(_0x493393,_0x55f5c7,_0x2a4c3b){VoiceQueueReportEvents[_0xe9cc('0x5')](_0x5d4716+':'+_0x493393['id'],_0x493393);VoiceQueueReportEvents[_0xe9cc('0x5')](_0x5d4716,_0x493393);_0x2a4c3b(null);};}for(var e in events){if(events[_0xe9cc('0x6')](e)){var event=events[e];VoiceQueueReport[_0xe9cc('0x7')](e,emitEvent(event));}}module[_0xe9cc('0x8')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 0492b61..c6d9349 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 _0x510f=['request-promise','rimraf','../../config/environment','./voiceQueueReport.attributes','define','VoiceQueueReport','report_queue','lodash','util','../../config/logger','api','bluebird'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x510f,0x163));var _0xf510=function(_0x27f146,_0x5515bf){_0x27f146=_0x27f146-0x0;var _0xd45e2a=_0x510f[_0x27f146];return _0xd45e2a;};'use strict';var _=require(_0xf510('0x0'));var util=require(_0xf510('0x1'));var logger=require(_0xf510('0x2'))(_0xf510('0x3'));var moment=require('moment');var BPromise=require(_0xf510('0x4'));var rp=require(_0xf510('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf510('0x6'));var config=require(_0xf510('0x7'));var attributes=require(_0xf510('0x8'));module['exports']=function(_0x5d37a3,_0x23da28){return _0x5d37a3[_0xf510('0x9')](_0xf510('0xa'),attributes,{'tableName':_0xf510('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9123=['lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./voiceQueueReport.attributes','exports','VoiceQueueReport','calleridnum'];(function(_0x4a5f39,_0x22ef39){var _0x6299ee=function(_0x2e1429){while(--_0x2e1429){_0x4a5f39['push'](_0x4a5f39['shift']());}};_0x6299ee(++_0x22ef39);}(_0x9123,0xb0));var _0x3912=function(_0x2de738,_0x1b4c12){_0x2de738=_0x2de738-0x0;var _0x356ad1=_0x9123[_0x2de738];return _0x356ad1;};'use strict';var _=require(_0x3912('0x0'));var util=require(_0x3912('0x1'));var logger=require(_0x3912('0x2'))(_0x3912('0x3'));var moment=require('moment');var BPromise=require(_0x3912('0x4'));var rp=require(_0x3912('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3912('0x6'));var attributes=require(_0x3912('0x7'));module[_0x3912('0x8')]=function(_0x1bfb84,_0x29c5bc){return _0x1bfb84['define'](_0x3912('0x9'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x3912('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 17e673a..6546ace 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 _0x5a31=['http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueueReport,\x20%s,\x20%s','message','info','request\x20sent','result','catch','GetVoiceQueueReport','findAll','options','raw','where','attributes','include','map','model','VoiceQueueReport','create','body','CreateVoiceQueueReport','update','limit','UpdateVoiceQueueReport','lodash','moment','randomstring','ioredis','jayson/promise'];(function(_0x4c507d,_0x4916be){var _0x437712=function(_0x2cacc5){while(--_0x2cacc5){_0x4c507d['push'](_0x4c507d['shift']());}};_0x437712(++_0x4916be);}(_0x5a31,0x195));var _0x15a3=function(_0x4e39be,_0x62d24a){_0x4e39be=_0x4e39be-0x0;var _0x342159=_0x5a31[_0x4e39be];return _0x342159;};'use strict';var _=require(_0x15a3('0x0'));var util=require('util');var moment=require(_0x15a3('0x1'));var BPromise=require('bluebird');var rs=require(_0x15a3('0x2'));var fs=require('fs');var Redis=require(_0x15a3('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x15a3('0x4'));var client=jayson['client'][_0x15a3('0x5')]({'port':0x232a});config[_0x15a3('0x6')]=_[_0x15a3('0x7')](config[_0x15a3('0x6')],{'host':_0x15a3('0x8'),'port':0x18eb});var socket=require(_0x15a3('0x9'))(new Redis(config[_0x15a3('0x6')]));require(_0x15a3('0xa'))[_0x15a3('0xb')](socket);function respondWithRpcPromise(_0x359601,_0x56139f,_0x173c48){return new BPromise(function(_0x1b7a35,_0x5dc9e1){return client[_0x15a3('0xc')](_0x359601,_0x173c48)[_0x15a3('0xd')](function(_0x3dba83){logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x56139f,'request\x20sent');logger[_0x15a3('0xe')](_0x15a3('0xf'),_0x56139f,'request\x20sent',JSON[_0x15a3('0x10')](_0x3dba83));if(_0x3dba83['error']){if(_0x3dba83[_0x15a3('0x11')][_0x15a3('0x12')]===0x1f4){logger[_0x15a3('0x11')](_0x15a3('0x13'),_0x56139f,_0x3dba83[_0x15a3('0x11')][_0x15a3('0x14')]);return _0x5dc9e1(_0x3dba83[_0x15a3('0x11')][_0x15a3('0x14')]);}logger[_0x15a3('0x11')](_0x15a3('0x13'),_0x56139f,_0x3dba83[_0x15a3('0x11')][_0x15a3('0x14')]);return _0x1b7a35(_0x3dba83[_0x15a3('0x11')]['message']);}else{logger[_0x15a3('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0x56139f,_0x15a3('0x16'));_0x1b7a35(_0x3dba83[_0x15a3('0x17')][_0x15a3('0x14')]);}})[_0x15a3('0x18')](function(_0x4d2096){logger[_0x15a3('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x56139f,_0x4d2096);_0x5dc9e1(_0x4d2096);});});}exports[_0x15a3('0x19')]=function(_0x580fc1){var _0x59ded4=this;return new Promise(function(_0x4d5bd3,_0x1162bd){return db['VoiceQueueReport'][_0x15a3('0x1a')]({'raw':_0x580fc1[_0x15a3('0x1b')]?_0x580fc1[_0x15a3('0x1b')][_0x15a3('0x1c')]===undefined?!![]:![]:!![],'where':_0x580fc1[_0x15a3('0x1b')]?_0x580fc1[_0x15a3('0x1b')][_0x15a3('0x1d')]||null:null,'attributes':_0x580fc1[_0x15a3('0x1b')]?_0x580fc1['options'][_0x15a3('0x1e')]||null:null,'limit':_0x580fc1[_0x15a3('0x1b')]?_0x580fc1[_0x15a3('0x1b')]['limit']||null:null,'include':_0x580fc1[_0x15a3('0x1b')]?_0x580fc1['options'][_0x15a3('0x1f')]?_[_0x15a3('0x20')](_0x580fc1[_0x15a3('0x1b')][_0x15a3('0x1f')],function(_0x5d42d5){return{'model':db[_0x5d42d5['model']],'as':_0x5d42d5['as'],'attributes':_0x5d42d5[_0x15a3('0x1e')],'include':_0x5d42d5['include']?_['map'](_0x5d42d5[_0x15a3('0x1f')],function(_0x444399){return{'model':db[_0x444399[_0x15a3('0x21')]],'as':_0x444399['as'],'attributes':_0x444399[_0x15a3('0x1e')],'include':_0x444399[_0x15a3('0x1f')]?_[_0x15a3('0x20')](_0x444399[_0x15a3('0x1f')],function(_0x2cac00){return{'model':db[_0x2cac00[_0x15a3('0x21')]],'as':_0x2cac00['as'],'attributes':_0x2cac00[_0x15a3('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x15a3('0xd')](function(_0x2ab58a){logger['info'](_0x15a3('0x19'),_0x580fc1);logger[_0x15a3('0xe')](_0x15a3('0x19'),_0x580fc1,JSON[_0x15a3('0x10')](_0x2ab58a));_0x4d5bd3(_0x2ab58a);})[_0x15a3('0x18')](function(_0x48582){logger[_0x15a3('0x11')](_0x15a3('0x19'),_0x48582[_0x15a3('0x14')],_0x580fc1);_0x1162bd(_0x59ded4['error'](0x1f4,_0x48582[_0x15a3('0x14')]));});});};exports['CreateVoiceQueueReport']=function(_0x308dd9){var _0xae5ebc=this;return new Promise(function(_0x3cc48d,_0x4f5fe0){return db[_0x15a3('0x22')][_0x15a3('0x23')](_0x308dd9[_0x15a3('0x24')],{'raw':_0x308dd9['options']?_0x308dd9[_0x15a3('0x1b')][_0x15a3('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x27d67f){logger[_0x15a3('0x15')](_0x15a3('0x25'),_0x308dd9);logger[_0x15a3('0xe')](_0x15a3('0x25'),_0x308dd9,JSON[_0x15a3('0x10')](_0x27d67f));_0x3cc48d(_0x27d67f);})['catch'](function(_0x25a4b5){logger['error'](_0x15a3('0x25'),_0x25a4b5[_0x15a3('0x14')],_0x308dd9);_0x4f5fe0(_0xae5ebc[_0x15a3('0x11')](0x1f4,_0x25a4b5[_0x15a3('0x14')]));});});};exports['UpdateVoiceQueueReport']=function(_0x4dea7a){var _0x8911ce=this;return new Promise(function(_0x2b18b8,_0x1d8692){return db[_0x15a3('0x22')][_0x15a3('0x26')](_0x4dea7a[_0x15a3('0x24')],{'raw':_0x4dea7a['options']?_0x4dea7a[_0x15a3('0x1b')][_0x15a3('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4dea7a['options']?_0x4dea7a[_0x15a3('0x1b')][_0x15a3('0x1d')]||null:null,'attributes':_0x4dea7a[_0x15a3('0x1b')]?_0x4dea7a['options'][_0x15a3('0x1e')]||null:null,'limit':_0x4dea7a[_0x15a3('0x1b')]?_0x4dea7a[_0x15a3('0x1b')][_0x15a3('0x27')]||null:null})[_0x15a3('0xd')](function(_0x479617){logger[_0x15a3('0x15')](_0x15a3('0x28'),_0x4dea7a);logger[_0x15a3('0xe')](_0x15a3('0x28'),_0x4dea7a,JSON[_0x15a3('0x10')](_0x479617));_0x2b18b8(_0x479617);})[_0x15a3('0x18')](function(_0x35d027){logger['error'](_0x15a3('0x28'),_0x35d027['message'],_0x4dea7a);_0x1d8692(_0x8911ce[_0x15a3('0x11')](0x1f4,_0x35d027[_0x15a3('0x14')]));});});}; \ No newline at end of file +var _0xc0ca=['request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','VoiceQueueReport','findAll','options','raw','attributes','limit','map','include','model','GetVoiceQueueReport','create','body','CreateVoiceQueueReport','UpdateVoiceQueueReport','update','where','then','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','VoiceQueueReport,\x20%s,\x20%s'];(function(_0x3e3217,_0x518c13){var _0x425fac=function(_0x22a925){while(--_0x22a925){_0x3e3217['push'](_0x3e3217['shift']());}};_0x425fac(++_0x518c13);}(_0xc0ca,0xfc));var _0xac0c=function(_0x2f6cbd,_0x5d7246){_0x2f6cbd=_0x2f6cbd-0x0;var _0xf02334=_0xc0ca[_0x2f6cbd];return _0xf02334;};'use strict';var _=require(_0xac0c('0x0'));var util=require(_0xac0c('0x1'));var moment=require(_0xac0c('0x2'));var BPromise=require('bluebird');var rs=require(_0xac0c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xac0c('0x4'))['db'];var utils=require(_0xac0c('0x5'));var logger=require(_0xac0c('0x6'))(_0xac0c('0x7'));var config=require(_0xac0c('0x8'));var jayson=require(_0xac0c('0x9'));var client=jayson[_0xac0c('0xa')][_0xac0c('0xb')]({'port':0x232a});config[_0xac0c('0xc')]=_[_0xac0c('0xd')](config[_0xac0c('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xac0c('0xe'))(new Redis(config[_0xac0c('0xc')]));require(_0xac0c('0xf'))[_0xac0c('0x10')](socket);function respondWithRpcPromise(_0x1aebdb,_0x538c66,_0x1ce7d9){return new BPromise(function(_0x1999ed,_0x264854){return client['request'](_0x1aebdb,_0x1ce7d9)['then'](function(_0x12b86b){logger['info'](_0xac0c('0x11'),_0x538c66,_0xac0c('0x12'));logger[_0xac0c('0x13')](_0xac0c('0x14'),_0x538c66,'request\x20sent',JSON[_0xac0c('0x15')](_0x12b86b));if(_0x12b86b['error']){if(_0x12b86b[_0xac0c('0x16')][_0xac0c('0x17')]===0x1f4){logger[_0xac0c('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x538c66,_0x12b86b['error'][_0xac0c('0x18')]);return _0x264854(_0x12b86b[_0xac0c('0x16')][_0xac0c('0x18')]);}logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x538c66,_0x12b86b[_0xac0c('0x16')][_0xac0c('0x18')]);return _0x1999ed(_0x12b86b[_0xac0c('0x16')][_0xac0c('0x18')]);}else{logger[_0xac0c('0x19')](_0xac0c('0x11'),_0x538c66,_0xac0c('0x12'));_0x1999ed(_0x12b86b[_0xac0c('0x1a')][_0xac0c('0x18')]);}})[_0xac0c('0x1b')](function(_0x4571f1){logger[_0xac0c('0x16')](_0xac0c('0x11'),_0x538c66,_0x4571f1);_0x264854(_0x4571f1);});});}exports['GetVoiceQueueReport']=function(_0xfaa21e){var _0x48d81b=this;return new Promise(function(_0x1a0a09,_0x34aaf7){return db[_0xac0c('0x1c')][_0xac0c('0x1d')]({'raw':_0xfaa21e[_0xac0c('0x1e')]?_0xfaa21e[_0xac0c('0x1e')][_0xac0c('0x1f')]===undefined?!![]:![]:!![],'where':_0xfaa21e[_0xac0c('0x1e')]?_0xfaa21e[_0xac0c('0x1e')]['where']||null:null,'attributes':_0xfaa21e[_0xac0c('0x1e')]?_0xfaa21e[_0xac0c('0x1e')][_0xac0c('0x20')]||null:null,'limit':_0xfaa21e[_0xac0c('0x1e')]?_0xfaa21e['options'][_0xac0c('0x21')]||null:null,'include':_0xfaa21e[_0xac0c('0x1e')]?_0xfaa21e[_0xac0c('0x1e')]['include']?_[_0xac0c('0x22')](_0xfaa21e['options'][_0xac0c('0x23')],function(_0x4e3206){return{'model':db[_0x4e3206[_0xac0c('0x24')]],'as':_0x4e3206['as'],'attributes':_0x4e3206[_0xac0c('0x20')],'include':_0x4e3206[_0xac0c('0x23')]?_[_0xac0c('0x22')](_0x4e3206['include'],function(_0x4e1f34){return{'model':db[_0x4e1f34[_0xac0c('0x24')]],'as':_0x4e1f34['as'],'attributes':_0x4e1f34[_0xac0c('0x20')],'include':_0x4e1f34['include']?_['map'](_0x4e1f34['include'],function(_0x323319){return{'model':db[_0x323319[_0xac0c('0x24')]],'as':_0x323319['as'],'attributes':_0x323319[_0xac0c('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x261202){logger[_0xac0c('0x19')](_0xac0c('0x25'),_0xfaa21e);logger[_0xac0c('0x13')]('GetVoiceQueueReport',_0xfaa21e,JSON[_0xac0c('0x15')](_0x261202));_0x1a0a09(_0x261202);})['catch'](function(_0x3dd492){logger['error'](_0xac0c('0x25'),_0x3dd492[_0xac0c('0x18')],_0xfaa21e);_0x34aaf7(_0x48d81b[_0xac0c('0x16')](0x1f4,_0x3dd492[_0xac0c('0x18')]));});});};exports['CreateVoiceQueueReport']=function(_0x1316c3){var _0x992836=this;return new Promise(function(_0x5a6c77,_0x288df2){return db[_0xac0c('0x1c')][_0xac0c('0x26')](_0x1316c3[_0xac0c('0x27')],{'raw':_0x1316c3[_0xac0c('0x1e')]?_0x1316c3[_0xac0c('0x1e')][_0xac0c('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x54f27a){logger['info'](_0xac0c('0x28'),_0x1316c3);logger[_0xac0c('0x13')]('CreateVoiceQueueReport',_0x1316c3,JSON[_0xac0c('0x15')](_0x54f27a));_0x5a6c77(_0x54f27a);})[_0xac0c('0x1b')](function(_0x47dbb5){logger[_0xac0c('0x16')]('CreateVoiceQueueReport',_0x47dbb5[_0xac0c('0x18')],_0x1316c3);_0x288df2(_0x992836[_0xac0c('0x16')](0x1f4,_0x47dbb5[_0xac0c('0x18')]));});});};exports[_0xac0c('0x29')]=function(_0x42730a){var _0xc468c5=this;return new Promise(function(_0xfde512,_0x12984a){return db['VoiceQueueReport'][_0xac0c('0x2a')](_0x42730a[_0xac0c('0x27')],{'raw':_0x42730a[_0xac0c('0x1e')]?_0x42730a[_0xac0c('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42730a[_0xac0c('0x1e')]?_0x42730a[_0xac0c('0x1e')][_0xac0c('0x2b')]||null:null,'attributes':_0x42730a['options']?_0x42730a[_0xac0c('0x1e')][_0xac0c('0x20')]||null:null,'limit':_0x42730a['options']?_0x42730a[_0xac0c('0x1e')][_0xac0c('0x21')]||null:null})[_0xac0c('0x2c')](function(_0x4f52a7){logger[_0xac0c('0x19')]('UpdateVoiceQueueReport',_0x42730a);logger['debug'](_0xac0c('0x29'),_0x42730a,JSON[_0xac0c('0x15')](_0x4f52a7));_0xfde512(_0x4f52a7);})[_0xac0c('0x1b')](function(_0x92aee4){logger[_0xac0c('0x16')](_0xac0c('0x29'),_0x92aee4[_0xac0c('0x18')],_0x42730a);_0x12984a(_0xc468c5['error'](0x1f4,_0x92aee4['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index f6e5cac..e3c5729 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 _0xfde9=['register','length','voiceQueueReport:','./voiceQueueReport.events','save','remove','update','emit','removeListener'];(function(_0x1c5950,_0x49e128){var _0x2b720a=function(_0x4454f1){while(--_0x4454f1){_0x1c5950['push'](_0x1c5950['shift']());}};_0x2b720a(++_0x49e128);}(_0xfde9,0x66));var _0x9fde=function(_0x21c6b8,_0x16d6f6){_0x21c6b8=_0x21c6b8-0x0;var _0x39d474=_0xfde9[_0x21c6b8];return _0x39d474;};'use strict';var VoiceQueueReportEvents=require(_0x9fde('0x0'));var events=[_0x9fde('0x1'),_0x9fde('0x2'),_0x9fde('0x3')];function createListener(_0x34a99e,_0x55975f){return function(_0x455bd0){_0x55975f[_0x9fde('0x4')](_0x34a99e,_0x455bd0);};}function removeListener(_0x5d496f,_0x27e0d3){return function(){VoiceQueueReportEvents[_0x9fde('0x5')](_0x5d496f,_0x27e0d3);};}exports[_0x9fde('0x6')]=function(_0x2e512a){for(var _0x23419b=0x0,_0x26f710=events[_0x9fde('0x7')];_0x23419b<_0x26f710;_0x23419b++){var _0x138672=events[_0x23419b];var _0x230ca0=createListener(_0x9fde('0x8')+_0x138672,_0x2e512a);VoiceQueueReportEvents['on'](_0x138672,_0x230ca0);}}; \ No newline at end of file +var _0x010a=['register','voiceQueueReport:','save','update','emit','removeListener'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x010a,0x1f4));var _0xa010=function(_0x4c4cbc,_0x5cc924){_0x4c4cbc=_0x4c4cbc-0x0;var _0x7608c3=_0x010a[_0x4c4cbc];return _0x7608c3;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0xa010('0x0'),'remove',_0xa010('0x1')];function createListener(_0x105330,_0x4cc67a){return function(_0x47652c){_0x4cc67a[_0xa010('0x2')](_0x105330,_0x47652c);};}function removeListener(_0x2c0c40,_0x17fe51){return function(){VoiceQueueReportEvents[_0xa010('0x3')](_0x2c0c40,_0x17fe51);};}exports[_0xa010('0x4')]=function(_0x198d67){for(var _0x1f2f47=0x0,_0x39235c=events['length'];_0x1f2f47<_0x39235c;_0x1f2f47++){var _0x45f03=events[_0x1f2f47];var _0x368806=createListener(_0xa010('0x5')+_0x45f03,_0x198d67);VoiceQueueReportEvents['on'](_0x45f03,_0x368806);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index b4c0397..0db71a1 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 _0x9489=['path','connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util'];(function(_0x1f5d77,_0x3408a5){var _0x35fbb4=function(_0x5160c8){while(--_0x5160c8){_0x1f5d77['push'](_0x1f5d77['shift']());}};_0x35fbb4(++_0x3408a5);}(_0x9489,0xb2));var _0x9948=function(_0x58a501,_0x529159){_0x58a501=_0x58a501-0x0;var _0x1d48a8=_0x9489[_0x58a501];return _0x1d48a8;};'use strict';var multer=require(_0x9948('0x0'));var util=require(_0x9948('0x1'));var path=require(_0x9948('0x2'));var timeout=require(_0x9948('0x3'));var express=require(_0x9948('0x4'));var router=express[_0x9948('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9948('0x6'));var config=require('../../config/environment');var controller=require('./voiceQueuesLog.controller');router[_0x9948('0x7')]('/',auth[_0x9948('0x8')](),controller[_0x9948('0x9')]);router[_0x9948('0x7')](_0x9948('0xa'),auth[_0x9948('0x8')](),controller[_0x9948('0xb')]);router[_0x9948('0xc')]('/',auth[_0x9948('0x8')](),controller['create']);router[_0x9948('0xd')](_0x9948('0xa'),auth[_0x9948('0x8')](),controller[_0x9948('0xe')]);router[_0x9948('0xf')](_0x9948('0xa'),auth[_0x9948('0x8')](),controller[_0x9948('0x10')]);module[_0x9948('0x11')]=router; \ No newline at end of file +var _0xc7e6=['util','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','isAuthenticated','post','create','put','update','delete','destroy','exports','multer'];(function(_0x2fdba5,_0x541898){var _0x2089c1=function(_0x506b33){while(--_0x506b33){_0x2fdba5['push'](_0x2fdba5['shift']());}};_0x2089c1(++_0x541898);}(_0xc7e6,0x1ef));var _0x6c7e=function(_0x5285d0,_0x3d424c){_0x5285d0=_0x5285d0-0x0;var _0x4dd0a2=_0xc7e6[_0x5285d0];return _0x4dd0a2;};'use strict';var multer=require(_0x6c7e('0x0'));var util=require(_0x6c7e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6c7e('0x2')]();var fs_extra=require(_0x6c7e('0x3'));var auth=require(_0x6c7e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6c7e('0x5'));var controller=require('./voiceQueuesLog.controller');router[_0x6c7e('0x6')]('/',auth['isAuthenticated'](),controller[_0x6c7e('0x7')]);router['get']('/:id',auth[_0x6c7e('0x8')](),controller['show']);router[_0x6c7e('0x9')]('/',auth[_0x6c7e('0x8')](),controller[_0x6c7e('0xa')]);router[_0x6c7e('0xb')]('/:id',auth[_0x6c7e('0x8')](),controller[_0x6c7e('0xc')]);router[_0x6c7e('0xd')]('/:id',auth[_0x6c7e('0x8')](),controller[_0x6c7e('0xe')]);module[_0x6c7e('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index e42a194..38afdfb 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 _0x289f=['sequelize','exports','STRING','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x1e9ee9,_0x27fa48){var _0x15227c=function(_0x2f8f9e){while(--_0x2f8f9e){_0x1e9ee9['push'](_0x1e9ee9['shift']());}};_0x15227c(++_0x27fa48);}(_0x289f,0x7d));var _0xf289=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0x289f[_0x3740fe];return _0x55492b;};'use strict';var Sequelize=require(_0xf289('0x0'));var moment=require('moment');module[_0xf289('0x1')]={'time':{'type':Sequelize[_0xf289('0x2')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xf289('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xf289('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xf289('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xf289('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xf289('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xf289('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xf289('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xf289('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0xf289('0x3')](_0xf289('0x4'))}}; \ No newline at end of file +var _0xaa40=['exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize'];(function(_0xec359a,_0x5981db){var _0x49b5b8=function(_0x2b310c){while(--_0x2b310c){_0xec359a['push'](_0xec359a['shift']());}};_0x49b5b8(++_0x5981db);}(_0xaa40,0x107));var _0x0aa4=function(_0x365962,_0x4d168c){_0x365962=_0x365962-0x0;var _0xeb69e4=_0xaa40[_0x365962];return _0xeb69e4;};'use strict';var Sequelize=require(_0x0aa4('0x0'));var moment=require('moment');module[_0x0aa4('0x1')]={'time':{'type':Sequelize[_0x0aa4('0x2')]},'callid':{'type':Sequelize[_0x0aa4('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x0aa4('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x0aa4('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x0aa4('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x0aa4('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x0aa4('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x0aa4('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x0aa4('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x0aa4('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x0aa4('0x3')],'allowNull':![],'defaultValue':moment()[_0x0aa4('0x4')](_0x0aa4('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 3d50ee0..884d41f 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 _0xb759=['sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','end','error','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceQueuesLog','includeAll','include','findAll','then','rows','catch','show','params','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x13b79a,_0x56ef21){var _0x37e0fe=function(_0x1722ad){while(--_0x1722ad){_0x13b79a['push'](_0x13b79a['shift']());}};_0x37e0fe(++_0x56ef21);}(_0xb759,0x1bf));var _0x9b75=function(_0x54f951,_0x164138){_0x54f951=_0x54f951-0x0;var _0x4ab32c=_0xb759[_0x54f951];return _0x4ab32c;};'use strict';var emlformat=require(_0x9b75('0x0'));var rimraf=require(_0x9b75('0x1'));var zipdir=require(_0x9b75('0x2'));var jsonpatch=require(_0x9b75('0x3'));var rp=require(_0x9b75('0x4'));var moment=require('moment');var BPromise=require(_0x9b75('0x5'));var Mustache=require(_0x9b75('0x6'));var util=require(_0x9b75('0x7'));var path=require(_0x9b75('0x8'));var sox=require(_0x9b75('0x9'));var csv=require(_0x9b75('0xa'));var ejs=require(_0x9b75('0xb'));var fs=require('fs');var fs_extra=require(_0x9b75('0xc'));var _=require(_0x9b75('0xd'));var squel=require(_0x9b75('0xe'));var crypto=require(_0x9b75('0xf'));var jsforce=require(_0x9b75('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x9b75('0xa'));var querystring=require(_0x9b75('0x11'));var Papa=require(_0x9b75('0x12'));var Redis=require(_0x9b75('0x13'));var authService=require(_0x9b75('0x14'));var qs=require(_0x9b75('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9b75('0x16'));var logger=require('../../config/logger')(_0x9b75('0x17'));var utils=require(_0x9b75('0x18'));var config=require(_0x9b75('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x9b75('0x1a'))['db'];function respondWithStatusCode(_0x48957d,_0x3069f2){_0x3069f2=_0x3069f2||0xcc;return function(_0x2053ba){if(_0x2053ba){return _0x48957d[_0x9b75('0x1b')](_0x3069f2);}return _0x48957d[_0x9b75('0x1c')](_0x3069f2)['end']();};}function respondWithResult(_0x3f39b9,_0x48f9cb){_0x48f9cb=_0x48f9cb||0xc8;return function(_0x436943){if(_0x436943){return _0x3f39b9['status'](_0x48f9cb)[_0x9b75('0x1d')](_0x436943);}};}function respondWithFilteredResult(_0x51552c,_0x269e9e){return function(_0x5683e4){if(_0x5683e4){var _0xc09bc4=typeof _0x269e9e[_0x9b75('0x1e')]==='undefined'&&typeof _0x269e9e[_0x9b75('0x1f')]===_0x9b75('0x20');var _0x1ba6b0=_0x5683e4['count'];var _0x263f6e=_0xc09bc4?0x0:_0x269e9e[_0x9b75('0x1e')];var _0x59afb8=_0xc09bc4?_0x5683e4[_0x9b75('0x21')]:_0x269e9e[_0x9b75('0x1e')]+_0x269e9e[_0x9b75('0x1f')];var _0x2ee008;if(_0x59afb8>=_0x1ba6b0){_0x59afb8=_0x1ba6b0;_0x2ee008=0xc8;}else{_0x2ee008=0xce;}_0x51552c[_0x9b75('0x1c')](_0x2ee008);return _0x51552c[_0x9b75('0x22')](_0x9b75('0x23'),_0x263f6e+'-'+_0x59afb8+'/'+_0x1ba6b0)[_0x9b75('0x1d')](_0x5683e4);}return null;};}function patchUpdates(_0x4f7add){return function(_0x4f503d){try{jsonpatch[_0x9b75('0x24')](_0x4f503d,_0x4f7add,!![]);}catch(_0x1b9f1a){return BPromise['reject'](_0x1b9f1a);}return _0x4f503d[_0x9b75('0x25')]();};}function saveUpdates(_0x27be2e,_0x3b7040){return function(_0x4af101){if(_0x4af101){return _0x4af101[_0x9b75('0x26')](_0x27be2e)['then'](function(_0x1d324a){return _0x1d324a;});}return null;};}function removeEntity(_0x455651,_0xf84a12){return function(_0x15ab17){if(_0x15ab17){return _0x15ab17['destroy']()['then'](function(){_0x455651[_0x9b75('0x1c')](0xcc)[_0x9b75('0x27')]();});}};}function handleEntityNotFound(_0x5ad49c,_0x3326d5){return function(_0x1cffe3){if(!_0x1cffe3){_0x5ad49c[_0x9b75('0x1b')](0x194);}return _0x1cffe3;};}function handleError(_0x106e14,_0x235971){_0x235971=_0x235971||0x1f4;return function(_0x426d42){logger[_0x9b75('0x28')](_0x426d42['stack']);if(_0x426d42[_0x9b75('0x29')]){delete _0x426d42['name'];}_0x106e14['status'](_0x235971)[_0x9b75('0x2a')](_0x426d42);};}exports[_0x9b75('0x2b')]=function(_0x3e4f8b,_0x44dec7){var _0x141e4c={},_0x12f3e2={},_0x2d2c3e={'count':0x0,'rows':[]};var _0x4190b3=_['map'](db['VoiceQueuesLog'][_0x9b75('0x2c')],function(_0x29fca4){return{'name':_0x29fca4[_0x9b75('0x2d')],'type':_0x29fca4[_0x9b75('0x2e')][_0x9b75('0x2f')]};});_0x12f3e2[_0x9b75('0x30')]=_[_0x9b75('0x31')](_0x4190b3,_0x9b75('0x29'));_0x12f3e2[_0x9b75('0x32')]=_[_0x9b75('0x33')](_0x3e4f8b[_0x9b75('0x32')]);_0x12f3e2[_0x9b75('0x34')]=_[_0x9b75('0x35')](_0x12f3e2[_0x9b75('0x30')],_0x12f3e2[_0x9b75('0x32')]);_0x141e4c[_0x9b75('0x36')]=_[_0x9b75('0x35')](_0x12f3e2[_0x9b75('0x30')],qs[_0x9b75('0x37')](_0x3e4f8b[_0x9b75('0x32')][_0x9b75('0x37')]));_0x141e4c[_0x9b75('0x36')]=_0x141e4c[_0x9b75('0x36')][_0x9b75('0x38')]?_0x141e4c[_0x9b75('0x36')]:_0x12f3e2[_0x9b75('0x30')];if(!_0x3e4f8b['query']['hasOwnProperty'](_0x9b75('0x39'))){_0x141e4c[_0x9b75('0x1f')]=qs[_0x9b75('0x1f')](_0x3e4f8b['query'][_0x9b75('0x1f')]);_0x141e4c[_0x9b75('0x1e')]=qs['offset'](_0x3e4f8b[_0x9b75('0x32')][_0x9b75('0x1e')]);}_0x141e4c[_0x9b75('0x3a')]=qs['sort'](_0x3e4f8b['query'][_0x9b75('0x3b')]);_0x141e4c[_0x9b75('0x3c')]=qs[_0x9b75('0x34')](_[_0x9b75('0x3d')](_0x3e4f8b[_0x9b75('0x32')],_0x12f3e2[_0x9b75('0x34')]),_0x4190b3);if(_0x3e4f8b['query'][_0x9b75('0x3e')]){_0x141e4c[_0x9b75('0x3c')]=_[_0x9b75('0x3f')](_0x141e4c[_0x9b75('0x3c')],{'$or':_[_0x9b75('0x31')](_0x4190b3,function(_0x1ed72a){if(_0x1ed72a['type']!==_0x9b75('0x40')){var _0x518004={};_0x518004[_0x1ed72a['name']]={'$like':'%'+_0x3e4f8b[_0x9b75('0x32')][_0x9b75('0x3e')]+'%'};return _0x518004;}})});}_0x141e4c=_[_0x9b75('0x3f')]({},_0x141e4c,_0x3e4f8b[_0x9b75('0x41')]);var _0x451b9={'where':_0x141e4c[_0x9b75('0x3c')]};return db[_0x9b75('0x42')]['count'](_0x451b9)['then'](function(_0x57ad50){_0x2d2c3e[_0x9b75('0x21')]=_0x57ad50;if(_0x3e4f8b[_0x9b75('0x32')][_0x9b75('0x43')]){_0x141e4c[_0x9b75('0x44')]=[{'all':!![]}];}return db[_0x9b75('0x42')][_0x9b75('0x45')](_0x141e4c);})[_0x9b75('0x46')](function(_0x2c41a5){_0x2d2c3e[_0x9b75('0x47')]=_0x2c41a5;return _0x2d2c3e;})[_0x9b75('0x46')](respondWithFilteredResult(_0x44dec7,_0x141e4c))[_0x9b75('0x48')](handleError(_0x44dec7,null));};exports[_0x9b75('0x49')]=function(_0x3f7c9e,_0x585bec){var _0xa1e44={'raw':!![],'where':{'id':_0x3f7c9e[_0x9b75('0x4a')]['id']}},_0x1bfb7f={};_0x1bfb7f[_0x9b75('0x30')]=_['keys'](db['VoiceQueuesLog'][_0x9b75('0x2c')]);_0x1bfb7f[_0x9b75('0x32')]=_[_0x9b75('0x33')](_0x3f7c9e[_0x9b75('0x32')]);_0x1bfb7f[_0x9b75('0x34')]=_[_0x9b75('0x35')](_0x1bfb7f[_0x9b75('0x30')],_0x1bfb7f['query']);_0xa1e44[_0x9b75('0x36')]=_[_0x9b75('0x35')](_0x1bfb7f['model'],qs[_0x9b75('0x37')](_0x3f7c9e[_0x9b75('0x32')][_0x9b75('0x37')]));_0xa1e44[_0x9b75('0x36')]=_0xa1e44[_0x9b75('0x36')]['length']?_0xa1e44['attributes']:_0x1bfb7f['model'];if(_0x3f7c9e[_0x9b75('0x32')]['includeAll']){_0xa1e44['include']=[{'all':!![]}];}_0xa1e44=_[_0x9b75('0x3f')]({},_0xa1e44,_0x3f7c9e[_0x9b75('0x41')]);return db[_0x9b75('0x42')]['find'](_0xa1e44)['then'](handleEntityNotFound(_0x585bec,null))['then'](respondWithResult(_0x585bec,null))[_0x9b75('0x48')](handleError(_0x585bec,null));};exports['create']=function(_0x47fdee,_0x18a068){return db[_0x9b75('0x42')][_0x9b75('0x4b')](_0x47fdee[_0x9b75('0x4c')],{})[_0x9b75('0x46')](respondWithResult(_0x18a068,0xc9))[_0x9b75('0x48')](handleError(_0x18a068,null));};exports[_0x9b75('0x26')]=function(_0x453ab8,_0x102c33){if(_0x453ab8[_0x9b75('0x4c')]['id']){delete _0x453ab8[_0x9b75('0x4c')]['id'];}return db[_0x9b75('0x42')][_0x9b75('0x4d')]({'where':{'id':_0x453ab8[_0x9b75('0x4a')]['id']}})[_0x9b75('0x46')](handleEntityNotFound(_0x102c33,null))[_0x9b75('0x46')](saveUpdates(_0x453ab8[_0x9b75('0x4c')],null))[_0x9b75('0x46')](respondWithResult(_0x102c33,null))[_0x9b75('0x48')](handleError(_0x102c33,null));};exports[_0x9b75('0x4e')]=function(_0x2fd647,_0x22d902){return db['VoiceQueuesLog'][_0x9b75('0x4d')]({'where':{'id':_0x2fd647[_0x9b75('0x4a')]['id']}})[_0x9b75('0x46')](handleEntityNotFound(_0x22d902,null))[_0x9b75('0x46')](removeEntity(_0x22d902,null))[_0x9b75('0x48')](handleError(_0x22d902,null));}; \ No newline at end of file +var _0x304a=['catch','show','rawAttributes','intersection','find','body','update','destroy','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','VoiceQueuesLog','fieldName','type','key','keys','query','filters','model','attributes','fields','length','order','sort','where','pick','merge','map','VIRTUAL','filter','options','includeAll','include'];(function(_0x2e249d,_0x41b7e7){var _0x1faa37=function(_0x1422b4){while(--_0x1422b4){_0x2e249d['push'](_0x2e249d['shift']());}};_0x1faa37(++_0x41b7e7);}(_0x304a,0x12d));var _0xa304=function(_0xca81f,_0x27286f){_0xca81f=_0xca81f-0x0;var _0x56294e=_0x304a[_0xca81f];return _0x56294e;};'use strict';var emlformat=require(_0xa304('0x0'));var rimraf=require(_0xa304('0x1'));var zipdir=require(_0xa304('0x2'));var jsonpatch=require(_0xa304('0x3'));var rp=require(_0xa304('0x4'));var moment=require(_0xa304('0x5'));var BPromise=require(_0xa304('0x6'));var Mustache=require(_0xa304('0x7'));var util=require(_0xa304('0x8'));var path=require('path');var sox=require(_0xa304('0x9'));var csv=require(_0xa304('0xa'));var ejs=require(_0xa304('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa304('0xc'));var deskjs=require(_0xa304('0xd'));var toCsv=require(_0xa304('0xa'));var querystring=require(_0xa304('0xe'));var Papa=require(_0xa304('0xf'));var Redis=require(_0xa304('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa304('0x11'));var as=require(_0xa304('0x12'));var hardwareService=require(_0xa304('0x13'));var logger=require('../../config/logger')(_0xa304('0x14'));var utils=require(_0xa304('0x15'));var config=require(_0xa304('0x16'));var licenseUtil=require(_0xa304('0x17'));var db=require(_0xa304('0x18'))['db'];function respondWithStatusCode(_0x27b6ac,_0xad9be4){_0xad9be4=_0xad9be4||0xcc;return function(_0x2dfd9e){if(_0x2dfd9e){return _0x27b6ac[_0xa304('0x19')](_0xad9be4);}return _0x27b6ac[_0xa304('0x1a')](_0xad9be4)[_0xa304('0x1b')]();};}function respondWithResult(_0xd2bd9d,_0x337197){_0x337197=_0x337197||0xc8;return function(_0x3917ae){if(_0x3917ae){return _0xd2bd9d[_0xa304('0x1a')](_0x337197)[_0xa304('0x1c')](_0x3917ae);}};}function respondWithFilteredResult(_0x4637a7,_0x13f670){return function(_0x2269fe){if(_0x2269fe){var _0x4f0d5c=typeof _0x13f670[_0xa304('0x1d')]==='undefined'&&typeof _0x13f670[_0xa304('0x1e')]==='undefined';var _0x19aa5e=_0x2269fe[_0xa304('0x1f')];var _0x23c1c9=_0x4f0d5c?0x0:_0x13f670[_0xa304('0x1d')];var _0x12e22f=_0x4f0d5c?_0x2269fe[_0xa304('0x1f')]:_0x13f670[_0xa304('0x1d')]+_0x13f670['limit'];var _0x516f5b;if(_0x12e22f>=_0x19aa5e){_0x12e22f=_0x19aa5e;_0x516f5b=0xc8;}else{_0x516f5b=0xce;}_0x4637a7[_0xa304('0x1a')](_0x516f5b);return _0x4637a7[_0xa304('0x20')](_0xa304('0x21'),_0x23c1c9+'-'+_0x12e22f+'/'+_0x19aa5e)[_0xa304('0x1c')](_0x2269fe);}return null;};}function patchUpdates(_0x325349){return function(_0x3602ac){try{jsonpatch[_0xa304('0x22')](_0x3602ac,_0x325349,!![]);}catch(_0x449a5e){return BPromise[_0xa304('0x23')](_0x449a5e);}return _0x3602ac[_0xa304('0x24')]();};}function saveUpdates(_0x19ef2e,_0x34eb88){return function(_0x186830){if(_0x186830){return _0x186830['update'](_0x19ef2e)[_0xa304('0x25')](function(_0x3293f5){return _0x3293f5;});}return null;};}function removeEntity(_0x354354,_0x36c3c2){return function(_0x2205b9){if(_0x2205b9){return _0x2205b9['destroy']()['then'](function(){_0x354354[_0xa304('0x1a')](0xcc)[_0xa304('0x1b')]();});}};}function handleEntityNotFound(_0x2509b3,_0x3d233a){return function(_0x386307){if(!_0x386307){_0x2509b3[_0xa304('0x19')](0x194);}return _0x386307;};}function handleError(_0x517111,_0x27ee19){_0x27ee19=_0x27ee19||0x1f4;return function(_0x353c0e){logger['error'](_0x353c0e[_0xa304('0x26')]);if(_0x353c0e[_0xa304('0x27')]){delete _0x353c0e['name'];}_0x517111[_0xa304('0x1a')](_0x27ee19)[_0xa304('0x28')](_0x353c0e);};}exports[_0xa304('0x29')]=function(_0x39d57f,_0x580a01){var _0x18a06f={},_0x33e4d4={},_0x469b72={'count':0x0,'rows':[]};var _0x2901b3=_['map'](db[_0xa304('0x2a')]['rawAttributes'],function(_0x27a979){return{'name':_0x27a979[_0xa304('0x2b')],'type':_0x27a979[_0xa304('0x2c')][_0xa304('0x2d')]};});_0x33e4d4['model']=_['map'](_0x2901b3,_0xa304('0x27'));_0x33e4d4['query']=_[_0xa304('0x2e')](_0x39d57f[_0xa304('0x2f')]);_0x33e4d4[_0xa304('0x30')]=_['intersection'](_0x33e4d4[_0xa304('0x31')],_0x33e4d4[_0xa304('0x2f')]);_0x18a06f[_0xa304('0x32')]=_['intersection'](_0x33e4d4[_0xa304('0x31')],qs[_0xa304('0x33')](_0x39d57f['query'][_0xa304('0x33')]));_0x18a06f[_0xa304('0x32')]=_0x18a06f[_0xa304('0x32')][_0xa304('0x34')]?_0x18a06f[_0xa304('0x32')]:_0x33e4d4[_0xa304('0x31')];if(!_0x39d57f[_0xa304('0x2f')]['hasOwnProperty']('nolimit')){_0x18a06f[_0xa304('0x1e')]=qs[_0xa304('0x1e')](_0x39d57f[_0xa304('0x2f')][_0xa304('0x1e')]);_0x18a06f[_0xa304('0x1d')]=qs[_0xa304('0x1d')](_0x39d57f[_0xa304('0x2f')][_0xa304('0x1d')]);}_0x18a06f[_0xa304('0x35')]=qs[_0xa304('0x36')](_0x39d57f[_0xa304('0x2f')]['sort']);_0x18a06f[_0xa304('0x37')]=qs[_0xa304('0x30')](_[_0xa304('0x38')](_0x39d57f[_0xa304('0x2f')],_0x33e4d4['filters']),_0x2901b3);if(_0x39d57f[_0xa304('0x2f')]['filter']){_0x18a06f[_0xa304('0x37')]=_[_0xa304('0x39')](_0x18a06f[_0xa304('0x37')],{'$or':_[_0xa304('0x3a')](_0x2901b3,function(_0x6fee0){if(_0x6fee0[_0xa304('0x2c')]!==_0xa304('0x3b')){var _0x381560={};_0x381560[_0x6fee0[_0xa304('0x27')]]={'$like':'%'+_0x39d57f[_0xa304('0x2f')][_0xa304('0x3c')]+'%'};return _0x381560;}})});}_0x18a06f=_[_0xa304('0x39')]({},_0x18a06f,_0x39d57f[_0xa304('0x3d')]);var _0x1cb75d={'where':_0x18a06f[_0xa304('0x37')]};return db[_0xa304('0x2a')]['count'](_0x1cb75d)[_0xa304('0x25')](function(_0x1a2713){_0x469b72['count']=_0x1a2713;if(_0x39d57f['query'][_0xa304('0x3e')]){_0x18a06f[_0xa304('0x3f')]=[{'all':!![]}];}return db[_0xa304('0x2a')]['findAll'](_0x18a06f);})['then'](function(_0x425159){_0x469b72['rows']=_0x425159;return _0x469b72;})[_0xa304('0x25')](respondWithFilteredResult(_0x580a01,_0x18a06f))[_0xa304('0x40')](handleError(_0x580a01,null));};exports[_0xa304('0x41')]=function(_0x79553d,_0x4699f0){var _0xa8d9f9={'raw':!![],'where':{'id':_0x79553d['params']['id']}},_0x53e1c1={};_0x53e1c1['model']=_[_0xa304('0x2e')](db['VoiceQueuesLog'][_0xa304('0x42')]);_0x53e1c1[_0xa304('0x2f')]=_[_0xa304('0x2e')](_0x79553d[_0xa304('0x2f')]);_0x53e1c1[_0xa304('0x30')]=_[_0xa304('0x43')](_0x53e1c1[_0xa304('0x31')],_0x53e1c1['query']);_0xa8d9f9['attributes']=_[_0xa304('0x43')](_0x53e1c1[_0xa304('0x31')],qs[_0xa304('0x33')](_0x79553d[_0xa304('0x2f')][_0xa304('0x33')]));_0xa8d9f9['attributes']=_0xa8d9f9['attributes']['length']?_0xa8d9f9[_0xa304('0x32')]:_0x53e1c1[_0xa304('0x31')];if(_0x79553d[_0xa304('0x2f')][_0xa304('0x3e')]){_0xa8d9f9[_0xa304('0x3f')]=[{'all':!![]}];}_0xa8d9f9=_[_0xa304('0x39')]({},_0xa8d9f9,_0x79553d['options']);return db[_0xa304('0x2a')][_0xa304('0x44')](_0xa8d9f9)[_0xa304('0x25')](handleEntityNotFound(_0x4699f0,null))[_0xa304('0x25')](respondWithResult(_0x4699f0,null))[_0xa304('0x40')](handleError(_0x4699f0,null));};exports['create']=function(_0x1a5e16,_0x2a5c9a){return db[_0xa304('0x2a')]['create'](_0x1a5e16[_0xa304('0x45')],{})['then'](respondWithResult(_0x2a5c9a,0xc9))[_0xa304('0x40')](handleError(_0x2a5c9a,null));};exports[_0xa304('0x46')]=function(_0x4e04c2,_0xbfb120){if(_0x4e04c2[_0xa304('0x45')]['id']){delete _0x4e04c2[_0xa304('0x45')]['id'];}return db['VoiceQueuesLog'][_0xa304('0x44')]({'where':{'id':_0x4e04c2['params']['id']}})['then'](handleEntityNotFound(_0xbfb120,null))[_0xa304('0x25')](saveUpdates(_0x4e04c2[_0xa304('0x45')],null))['then'](respondWithResult(_0xbfb120,null))[_0xa304('0x40')](handleError(_0xbfb120,null));};exports[_0xa304('0x47')]=function(_0x11ae93,_0x24f9fc){return db['VoiceQueuesLog']['find']({'where':{'id':_0x11ae93[_0xa304('0x48')]['id']}})['then'](handleEntityNotFound(_0x24f9fc,null))[_0xa304('0x25')](removeEntity(_0x24f9fc,null))[_0xa304('0x40')](handleError(_0x24f9fc,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 21d0d29..610a077 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 _0xeb32=['event','lodash','util','../../config/logger','api','moment','path','rimraf','./voiceQueuesLog.attributes','VoiceQueuesLog','voice_queues_log','event_dtm'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xeb32,0x169));var _0x2eb3=function(_0xe1a39a,_0x2134a8){_0xe1a39a=_0xe1a39a-0x0;var _0x53eb9e=_0xeb32[_0xe1a39a];return _0x53eb9e;};'use strict';var _=require(_0x2eb3('0x0'));var util=require(_0x2eb3('0x1'));var logger=require(_0x2eb3('0x2'))(_0x2eb3('0x3'));var moment=require(_0x2eb3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2eb3('0x5'));var rimraf=require(_0x2eb3('0x6'));var config=require('../../config/environment');var attributes=require(_0x2eb3('0x7'));module['exports']=function(_0x3c008d,_0x2ab75f){return _0x3c008d['define'](_0x2eb3('0x8'),attributes,{'tableName':_0x2eb3('0x9'),'paranoid':![],'indexes':[{'name':_0x2eb3('0xa'),'fields':[_0x2eb3('0xb'),'dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0xa7aa=['api','moment','bluebird','request-promise','../../config/environment','voice_queues_log','event_dtm','event','dtm','util','../../config/logger'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xa7aa,0x8d));var _0xaa7a=function(_0x172ccc,_0x2e4da5){_0x172ccc=_0x172ccc-0x0;var _0x14c2d2=_0xa7aa[_0x172ccc];return _0x14c2d2;};'use strict';var _=require('lodash');var util=require(_0xaa7a('0x0'));var logger=require(_0xaa7a('0x1'))(_0xaa7a('0x2'));var moment=require(_0xaa7a('0x3'));var BPromise=require(_0xaa7a('0x4'));var rp=require(_0xaa7a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xaa7a('0x6'));var attributes=require('./voiceQueuesLog.attributes');module['exports']=function(_0x5675f3,_0x4159ec){return _0x5675f3['define']('VoiceQueuesLog',attributes,{'tableName':_0xaa7a('0x7'),'paranoid':![],'indexes':[{'name':_0xaa7a('0x8'),'fields':[_0xaa7a('0x9'),_0xaa7a('0xa')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index d4b9669..680002e 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 _0xc459=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','bluebird'];(function(_0x432627,_0x107bbe){var _0x2b35df=function(_0x459afd){while(--_0x459afd){_0x432627['push'](_0x432627['shift']());}};_0x2b35df(++_0x107bbe);}(_0xc459,0x1d9));var _0x9c45=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc459[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x9c45('0x0'));var moment=require('moment');var BPromise=require(_0x9c45('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9c45('0x2'));var db=require(_0x9c45('0x3'))['db'];var utils=require(_0x9c45('0x4'));var logger=require(_0x9c45('0x5'))(_0x9c45('0x6'));var config=require('../../config/environment');var jayson=require(_0x9c45('0x7'));var client=jayson[_0x9c45('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7189fc,_0x2d52c4,_0x587b23){return new BPromise(function(_0x2dd755,_0x4ab58f){return client[_0x9c45('0x9')](_0x7189fc,_0x587b23)['then'](function(_0x253be8){logger[_0x9c45('0xa')](_0x9c45('0xb'),_0x2d52c4,_0x9c45('0xc'));logger[_0x9c45('0xd')](_0x9c45('0xe'),_0x2d52c4,_0x9c45('0xc'),JSON[_0x9c45('0xf')](_0x253be8));if(_0x253be8[_0x9c45('0x10')]){if(_0x253be8[_0x9c45('0x10')][_0x9c45('0x11')]===0x1f4){logger[_0x9c45('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0x2d52c4,_0x253be8[_0x9c45('0x10')][_0x9c45('0x12')]);return _0x4ab58f(_0x253be8[_0x9c45('0x10')][_0x9c45('0x12')]);}logger[_0x9c45('0x10')](_0x9c45('0xb'),_0x2d52c4,_0x253be8[_0x9c45('0x10')][_0x9c45('0x12')]);return _0x2dd755(_0x253be8[_0x9c45('0x10')][_0x9c45('0x12')]);}else{logger[_0x9c45('0xa')](_0x9c45('0xb'),_0x2d52c4,_0x9c45('0xc'));_0x2dd755(_0x253be8['result'][_0x9c45('0x12')]);}})['catch'](function(_0x22a821){logger[_0x9c45('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0x2d52c4,_0x22a821);_0x4ab58f(_0x22a821);});});} \ No newline at end of file +var _0xf9b2=['lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','result'];(function(_0x102662,_0x355699){var _0x3b0762=function(_0x2040d0){while(--_0x2040d0){_0x102662['push'](_0x102662['shift']());}};_0x3b0762(++_0x355699);}(_0xf9b2,0x9a));var _0x2f9b=function(_0x34e684,_0x30feb5){_0x34e684=_0x34e684-0x0;var _0x4e9039=_0xf9b2[_0x34e684];return _0x4e9039;};'use strict';var _=require(_0x2f9b('0x0'));var util=require(_0x2f9b('0x1'));var moment=require(_0x2f9b('0x2'));var BPromise=require(_0x2f9b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2f9b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2f9b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x2f9b('0x6'));var jayson=require(_0x2f9b('0x7'));var client=jayson[_0x2f9b('0x8')][_0x2f9b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xae8281,_0x329642,_0xcf6aea){return new BPromise(function(_0x4bf726,_0x21a47e){return client[_0x2f9b('0xa')](_0xae8281,_0xcf6aea)[_0x2f9b('0xb')](function(_0x5dfcbf){logger[_0x2f9b('0xc')]('VoiceQueuesLog,\x20%s,\x20%s',_0x329642,_0x2f9b('0xd'));logger[_0x2f9b('0xe')](_0x2f9b('0xf'),_0x329642,_0x2f9b('0xd'),JSON[_0x2f9b('0x10')](_0x5dfcbf));if(_0x5dfcbf[_0x2f9b('0x11')]){if(_0x5dfcbf['error'][_0x2f9b('0x12')]===0x1f4){logger[_0x2f9b('0x11')](_0x2f9b('0x13'),_0x329642,_0x5dfcbf[_0x2f9b('0x11')]['message']);return _0x21a47e(_0x5dfcbf[_0x2f9b('0x11')][_0x2f9b('0x14')]);}logger['error'](_0x2f9b('0x13'),_0x329642,_0x5dfcbf[_0x2f9b('0x11')]['message']);return _0x4bf726(_0x5dfcbf['error'][_0x2f9b('0x14')]);}else{logger[_0x2f9b('0xc')](_0x2f9b('0x13'),_0x329642,_0x2f9b('0xd'));_0x4bf726(_0x5dfcbf[_0x2f9b('0x15')]['message']);}})['catch'](function(_0x1fedfa){logger[_0x2f9b('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x329642,_0x1fedfa);_0x21a47e(_0x1fedfa);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 3ab69c9..598bbe5 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 _0x42bf=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','download','/:id/downloads','/:id/transcribe','downloadTranscribe','create','post','put','update','destroy','exports'];(function(_0x174dd6,_0x20f9ea){var _0x3a5b0=function(_0xd10fc){while(--_0xd10fc){_0x174dd6['push'](_0x174dd6['shift']());}};_0x3a5b0(++_0x20f9ea);}(_0x42bf,0x1ee));var _0xf42b=function(_0x1cef8b,_0x12db19){_0x1cef8b=_0x1cef8b-0x0;var _0x3c814c=_0x42bf[_0x1cef8b];return _0x3c814c;};'use strict';var multer=require(_0xf42b('0x0'));var util=require(_0xf42b('0x1'));var path=require(_0xf42b('0x2'));var timeout=require(_0xf42b('0x3'));var express=require(_0xf42b('0x4'));var router=express[_0xf42b('0x5')]();var fs_extra=require(_0xf42b('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf42b('0x7'));var config=require('../../config/environment');var controller=require(_0xf42b('0x8'));router[_0xf42b('0x9')]('/',auth[_0xf42b('0xa')](),controller[_0xf42b('0xb')]);router['get'](_0xf42b('0xc'),auth[_0xf42b('0xa')](),controller[_0xf42b('0xd')]);router[_0xf42b('0x9')](_0xf42b('0xe'),auth['isAuthenticated'](),controller[_0xf42b('0xf')]);router[_0xf42b('0x9')]('/:id/download',auth[_0xf42b('0xa')](),controller[_0xf42b('0x10')]);router['get'](_0xf42b('0x11'),controller['downloads']);router['get'](_0xf42b('0x12'),auth[_0xf42b('0xa')](),controller[_0xf42b('0x13')]);router['post']('/',auth[_0xf42b('0xa')](),controller[_0xf42b('0x14')]);router[_0xf42b('0x15')](_0xf42b('0x12'),auth[_0xf42b('0xa')](),controller['runTranscribe']);router[_0xf42b('0x16')](_0xf42b('0xe'),auth['isAuthenticated'](),controller[_0xf42b('0x17')]);router['delete'](_0xf42b('0xe'),auth[_0xf42b('0xa')](),controller[_0xf42b('0x18')]);module[_0xf42b('0x19')]=router; \ No newline at end of file +var _0xbf2c=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/download','download','/:id/downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','update','delete','destroy','exports','multer','util','express','Router'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xbf2c,0x114));var _0xcbf2=function(_0x3bcf96,_0x31a36b){_0x3bcf96=_0x3bcf96-0x0;var _0x5b406d=_0xbf2c[_0x3bcf96];return _0x5b406d;};'use strict';var multer=require(_0xcbf2('0x0'));var util=require(_0xcbf2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcbf2('0x2'));var router=express[_0xcbf2('0x3')]();var fs_extra=require(_0xcbf2('0x4'));var auth=require(_0xcbf2('0x5'));var interaction=require(_0xcbf2('0x6'));var config=require(_0xcbf2('0x7'));var controller=require(_0xcbf2('0x8'));router['get']('/',auth[_0xcbf2('0x9')](),controller[_0xcbf2('0xa')]);router[_0xcbf2('0xb')](_0xcbf2('0xc'),auth[_0xcbf2('0x9')](),controller['describe']);router[_0xcbf2('0xb')](_0xcbf2('0xd'),auth[_0xcbf2('0x9')](),controller[_0xcbf2('0xe')]);router[_0xcbf2('0xb')](_0xcbf2('0xf'),auth[_0xcbf2('0x9')](),controller[_0xcbf2('0x10')]);router['get'](_0xcbf2('0x11'),controller['downloads']);router[_0xcbf2('0xb')](_0xcbf2('0x12'),auth[_0xcbf2('0x9')](),controller[_0xcbf2('0x13')]);router[_0xcbf2('0x14')]('/',auth['isAuthenticated'](),controller[_0xcbf2('0x15')]);router[_0xcbf2('0x14')](_0xcbf2('0x12'),auth[_0xcbf2('0x9')](),controller[_0xcbf2('0x16')]);router[_0xcbf2('0x17')](_0xcbf2('0xd'),auth['isAuthenticated'](),controller[_0xcbf2('0x18')]);router[_0xcbf2('0x19')](_0xcbf2('0xd'),auth[_0xcbf2('0x9')](),controller[_0xcbf2('0x1a')]);module[_0xcbf2('0x1b')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 92266aa..63242f0 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(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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 49e5690..181ef97 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 _0xf2ed=['runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','findOne','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','Name','bucket','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','crypto','desk.js','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','filters','intersection','fields','attributes','length','nolimit','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','keys','find','create','body','catch','params','describe','../../components/encryptor','uniqueid','%s.cypher','existsSync','decryptFile','secrets','recording','value','ValidationError','VoiceRecording\x20not\x20found','filename','download','extname','unlink','message','downloads','sequelize','MD5','col','push','$and','Sequelize','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','end','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','Location','Bucket','location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','transcribeName','TranscriptionJob','TranscriptionJobStatus','runTranscribe','Voice\x20Recording\x20not\x20found','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured'];(function(_0x410f3,_0x2cb61f){var _0x44cf03=function(_0x51baaa){while(--_0x51baaa){_0x410f3['push'](_0x410f3['shift']());}};_0x44cf03(++_0x2cb61f);}(_0xf2ed,0xb9));var _0xdf2e=function(_0x347f4e,_0x51235d){_0x347f4e=_0x347f4e-0x0;var _0x32164d=_0xf2ed[_0x347f4e];return _0x32164d;};'use strict';var emlformat=require(_0xdf2e('0x0'));var rimraf=require(_0xdf2e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdf2e('0x2'));var rp=require(_0xdf2e('0x3'));var moment=require(_0xdf2e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdf2e('0x5'));var util=require(_0xdf2e('0x6'));var path=require(_0xdf2e('0x7'));var sox=require(_0xdf2e('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdf2e('0x9'));var _=require(_0xdf2e('0xa'));var squel=require('squel');var crypto=require(_0xdf2e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xdf2e('0xc'));var toCsv=require('to-csv');var querystring=require(_0xdf2e('0xd'));var Papa=require(_0xdf2e('0xe'));var AWS=require(_0xdf2e('0xf'));var uuidv4=require(_0xdf2e('0x10'));var Redis=require(_0xdf2e('0x11'));var authService=require(_0xdf2e('0x12'));var qs=require(_0xdf2e('0x13'));var as=require(_0xdf2e('0x14'));var hardwareService=require(_0xdf2e('0x15'));var logger=require(_0xdf2e('0x16'))(_0xdf2e('0x17'));var utils=require(_0xdf2e('0x18'));var config=require(_0xdf2e('0x19'));var licenseUtil=require(_0xdf2e('0x1a'));var db=require(_0xdf2e('0x1b'))['db'];function respondWithStatusCode(_0x4b2284,_0xba4019){_0xba4019=_0xba4019||0xcc;return function(_0x362f65){if(_0x362f65){return _0x4b2284['sendStatus'](_0xba4019);}return _0x4b2284[_0xdf2e('0x1c')](_0xba4019)['end']();};}function respondWithResult(_0x49fb54,_0x96c7a9){_0x96c7a9=_0x96c7a9||0xc8;return function(_0x45c5af){if(_0x45c5af){return _0x49fb54[_0xdf2e('0x1c')](_0x96c7a9)[_0xdf2e('0x1d')](_0x45c5af);}};}function respondWithFilteredResult(_0x19563c,_0x1a2ae9){return function(_0x5672cb){if(_0x5672cb){var _0x14c652=typeof _0x1a2ae9[_0xdf2e('0x1e')]===_0xdf2e('0x1f')&&typeof _0x1a2ae9[_0xdf2e('0x20')]==='undefined';var _0x57e023=_0x5672cb[_0xdf2e('0x21')];var _0x5250eb=_0x14c652?0x0:_0x1a2ae9['offset'];var _0x2ec7bc=_0x14c652?_0x5672cb[_0xdf2e('0x21')]:_0x1a2ae9['offset']+_0x1a2ae9[_0xdf2e('0x20')];var _0x4c0ea0;if(_0x2ec7bc>=_0x57e023){_0x2ec7bc=_0x57e023;_0x4c0ea0=0xc8;}else{_0x4c0ea0=0xce;}_0x19563c[_0xdf2e('0x1c')](_0x4c0ea0);return _0x19563c[_0xdf2e('0x22')](_0xdf2e('0x23'),_0x5250eb+'-'+_0x2ec7bc+'/'+_0x57e023)['json'](_0x5672cb);}return null;};}function patchUpdates(_0x5a1997){return function(_0xa0e70f){try{jsonpatch[_0xdf2e('0x24')](_0xa0e70f,_0x5a1997,!![]);}catch(_0x1e8fe8){return BPromise[_0xdf2e('0x25')](_0x1e8fe8);}return _0xa0e70f[_0xdf2e('0x26')]();};}function saveUpdates(_0x4c4700,_0x5a4bdd){return function(_0x53df45){if(_0x53df45){return _0x53df45[_0xdf2e('0x27')](_0x4c4700)[_0xdf2e('0x28')](function(_0x36da1e){return _0x36da1e;});}return null;};}function removeEntity(_0x5d8734,_0x4e43a9){return function(_0x44a1b5){if(_0x44a1b5){return _0x44a1b5[_0xdf2e('0x29')]()[_0xdf2e('0x28')](function(){_0x5d8734[_0xdf2e('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x156b35,_0x530aa2){return function(_0x39085c){if(!_0x39085c){_0x156b35['sendStatus'](0x194);}return _0x39085c;};}function handleError(_0x103900,_0x5838e2){_0x5838e2=_0x5838e2||0x1f4;return function(_0x4f539d){logger['error'](_0x4f539d[_0xdf2e('0x2a')]);if(_0x4f539d[_0xdf2e('0x2b')]){delete _0x4f539d[_0xdf2e('0x2b')];}_0x103900[_0xdf2e('0x1c')](_0x5838e2)[_0xdf2e('0x2c')](_0x4f539d);};}exports[_0xdf2e('0x2d')]=function(_0x5d8003,_0x1bef0d){var _0x4c4eda={},_0x5c95a0={},_0x5d11f2={'count':0x0,'rows':[]};var _0x3103af=_[_0xdf2e('0x2e')](db[_0xdf2e('0x2f')][_0xdf2e('0x30')],function(_0xb362a){return{'name':_0xb362a[_0xdf2e('0x31')],'type':_0xb362a[_0xdf2e('0x32')][_0xdf2e('0x33')]};});_0x5c95a0[_0xdf2e('0x34')]=_[_0xdf2e('0x35')](_[_0xdf2e('0x2e')](_0x3103af,_0xdf2e('0x2b')),[_0xdf2e('0x36')]);_0x5c95a0[_0xdf2e('0x37')]=_['keys'](_0x5d8003[_0xdf2e('0x37')]);_0x5c95a0[_0xdf2e('0x38')]=_['intersection'](_0x5c95a0[_0xdf2e('0x34')],_0x5c95a0[_0xdf2e('0x37')]);_0x4c4eda['attributes']=_[_0xdf2e('0x39')](_0x5c95a0['model'],qs[_0xdf2e('0x3a')](_0x5d8003[_0xdf2e('0x37')][_0xdf2e('0x3a')]));_0x4c4eda[_0xdf2e('0x3b')]=_0x4c4eda['attributes'][_0xdf2e('0x3c')]?_0x4c4eda[_0xdf2e('0x3b')]:_0x5c95a0['model'];if(!_0x5d8003[_0xdf2e('0x37')]['hasOwnProperty'](_0xdf2e('0x3d'))){_0x4c4eda[_0xdf2e('0x20')]=qs[_0xdf2e('0x20')](_0x5d8003[_0xdf2e('0x37')][_0xdf2e('0x20')]);_0x4c4eda[_0xdf2e('0x1e')]=qs['offset'](_0x5d8003[_0xdf2e('0x37')][_0xdf2e('0x1e')]);}_0x4c4eda['order']=qs[_0xdf2e('0x3e')](_0x5d8003[_0xdf2e('0x37')][_0xdf2e('0x3e')]);_0x4c4eda[_0xdf2e('0x3f')]=qs[_0xdf2e('0x38')](_['pick'](_0x5d8003['query'],_0x5c95a0[_0xdf2e('0x38')]),_0x3103af);if(_0x5d8003[_0xdf2e('0x37')]['filter']){_0x4c4eda[_0xdf2e('0x3f')]=_[_0xdf2e('0x40')](_0x4c4eda[_0xdf2e('0x3f')],{'$or':_['map'](_0x3103af,function(_0x29f3cd){if(_0x29f3cd[_0xdf2e('0x32')]!==_0xdf2e('0x41')){var _0x95b2ab={};_0x95b2ab[_0x29f3cd['name']]={'$like':'%'+_0x5d8003['query'][_0xdf2e('0x42')]+'%'};return _0x95b2ab;}})});}_0x4c4eda=_[_0xdf2e('0x40')]({},_0x4c4eda,_0x5d8003['options']);var _0x2e8185={'where':_0x4c4eda[_0xdf2e('0x3f')]};return db[_0xdf2e('0x2f')][_0xdf2e('0x21')](_0x2e8185)[_0xdf2e('0x28')](function(_0x378646){_0x5d11f2[_0xdf2e('0x21')]=_0x378646;if(_0x5d8003[_0xdf2e('0x37')][_0xdf2e('0x43')]){_0x4c4eda[_0xdf2e('0x44')]=[{'all':!![]}];}return db[_0xdf2e('0x2f')][_0xdf2e('0x45')](_0x4c4eda);})['then'](function(_0x45b334){_0x5d11f2[_0xdf2e('0x46')]=_0x45b334;return _0x5d11f2;})['then'](respondWithFilteredResult(_0x1bef0d,_0x4c4eda))['catch'](handleError(_0x1bef0d,null));};exports[_0xdf2e('0x47')]=function(_0x3e13ec,_0x290d8e){var _0x2c1fd4={'raw':![],'where':{'id':_0x3e13ec['params']['id']}},_0x1e1365={};_0x1e1365['model']=_[_0xdf2e('0x48')](db[_0xdf2e('0x2f')][_0xdf2e('0x30')]);_0x1e1365[_0xdf2e('0x37')]=_[_0xdf2e('0x48')](_0x3e13ec[_0xdf2e('0x37')]);_0x1e1365[_0xdf2e('0x38')]=_[_0xdf2e('0x39')](_0x1e1365[_0xdf2e('0x34')],_0x1e1365[_0xdf2e('0x37')]);_0x2c1fd4['attributes']=_[_0xdf2e('0x39')](_0x1e1365['model'],qs[_0xdf2e('0x3a')](_0x3e13ec[_0xdf2e('0x37')][_0xdf2e('0x3a')]));_0x2c1fd4['attributes']=_0x2c1fd4[_0xdf2e('0x3b')][_0xdf2e('0x3c')]?_0x2c1fd4['attributes']:_0x1e1365[_0xdf2e('0x34')];if(_0x3e13ec[_0xdf2e('0x37')]['includeAll']){_0x2c1fd4[_0xdf2e('0x44')]=[{'all':!![]}];}_0x2c1fd4=_['merge']({},_0x2c1fd4,_0x3e13ec['options']);return db[_0xdf2e('0x2f')][_0xdf2e('0x49')](_0x2c1fd4)[_0xdf2e('0x28')](handleEntityNotFound(_0x290d8e,null))[_0xdf2e('0x28')](respondWithResult(_0x290d8e,null))['catch'](handleError(_0x290d8e,null));};exports[_0xdf2e('0x4a')]=function(_0x1520ca,_0x1c66ab){return db[_0xdf2e('0x2f')][_0xdf2e('0x4a')](_0x1520ca[_0xdf2e('0x4b')],{})[_0xdf2e('0x28')](respondWithResult(_0x1c66ab,0xc9))[_0xdf2e('0x4c')](handleError(_0x1c66ab,null));};exports[_0xdf2e('0x27')]=function(_0x2143e6,_0x50d83d){if(_0x2143e6[_0xdf2e('0x4b')]['id']){delete _0x2143e6[_0xdf2e('0x4b')]['id'];}return db[_0xdf2e('0x2f')]['find']({'where':{'id':_0x2143e6[_0xdf2e('0x4d')]['id']}})[_0xdf2e('0x28')](handleEntityNotFound(_0x50d83d,null))[_0xdf2e('0x28')](saveUpdates(_0x2143e6[_0xdf2e('0x4b')],null))[_0xdf2e('0x28')](respondWithResult(_0x50d83d,null))[_0xdf2e('0x4c')](handleError(_0x50d83d,null));};exports[_0xdf2e('0x4e')]=function(_0x3602a4,_0x5e01fa){return db['VoiceRecording'][_0xdf2e('0x4e')]()[_0xdf2e('0x28')](respondWithResult(_0x5e01fa,null))['catch'](handleError(_0x5e01fa,null));};exports['download']=function(_0x784148,_0x5b0ceb,_0x40b4cf){var _0x2381b6=require(_0xdf2e('0x4f'));var _0x5c709a=![];var _0x5e6b6e={};if(_0x784148['query']['type']&&_0x784148['query']['type']===_0xdf2e('0x50')){_0x5e6b6e['uniqueid']=_0x784148[_0xdf2e('0x4d')]['id'];}else{_0x5e6b6e['id']=_0x784148[_0xdf2e('0x4d')]['id'];}return db[_0xdf2e('0x2f')]['find']({'where':_0x5e6b6e,'attributes':['id','value'],'raw':!![]})[_0xdf2e('0x28')](handleEntityNotFound(_0x5b0ceb,null))[_0xdf2e('0x28')](function(_0x2e715b){if(_0x2e715b){var _0x10199f=_0x2e715b['value'];var _0x5a0702=util['format'](_0xdf2e('0x51'),_0x10199f);if(fs[_0xdf2e('0x52')](_0x5a0702)){_0x5c709a=!![];return _0x2381b6[_0xdf2e('0x53')](_0x5a0702,_0x10199f,config[_0xdf2e('0x54')][_0xdf2e('0x55')])[_0xdf2e('0x28')](function(){return _0x2e715b;});}return _0x2e715b;}})[_0xdf2e('0x28')](function(_0x2581b2){if(_0x2581b2){var _0x3429b0=_0x2581b2[_0xdf2e('0x56')];if(!fs[_0xdf2e('0x52')](_0x3429b0)){throw new db['Sequelize'][(_0xdf2e('0x57'))](_0xdf2e('0x58'));}if(_0x2581b2[_0xdf2e('0x59')]){return _0x5b0ceb[_0xdf2e('0x5a')](_0x3429b0,_0x2581b2['filename']+path[_0xdf2e('0x5b')](_0x3429b0),function(){if(_0x5c709a){fs[_0xdf2e('0x5c')](_0x3429b0);}});}else{return _0x5b0ceb[_0xdf2e('0x5a')](_0x3429b0,function(_0x8ca33b){if(_0x5c709a){fs[_0xdf2e('0x5c')](_0x3429b0);}});}}})[_0xdf2e('0x4c')](function(_0x28cb0a){if(_0x28cb0a[_0xdf2e('0x5d')]===_0xdf2e('0x58')){_0x5b0ceb['status'](0x194)[_0xdf2e('0x2c')]('Not\x20found');}else{return handleError(_0x5b0ceb,null);}});};exports[_0xdf2e('0x5e')]=function(_0x8f903c,_0x3a39e1,_0xa5e581){var _0x1bf602=require(_0xdf2e('0x4f'));var _0x135fd1=![];var _0x5b730f={'$and':[db[_0xdf2e('0x5f')][_0xdf2e('0x3f')](db[_0xdf2e('0x5f')]['fn'](_0xdf2e('0x60'),db[_0xdf2e('0x5f')][_0xdf2e('0x61')](_0xdf2e('0x50'))),_0x8f903c[_0xdf2e('0x37')]['token'])]};if(_0x8f903c[_0xdf2e('0x37')][_0xdf2e('0x32')]&&_0x8f903c['query'][_0xdf2e('0x32')]===_0xdf2e('0x50')){_0x5b730f['$and'][_0xdf2e('0x62')]({'uniqueid':_0x8f903c[_0xdf2e('0x4d')]['id']});}else{_0x5b730f[_0xdf2e('0x63')][_0xdf2e('0x62')]({'id':_0x8f903c[_0xdf2e('0x4d')]['id']});}return db[_0xdf2e('0x2f')][_0xdf2e('0x49')]({'where':_0x5b730f,'attributes':['id',_0xdf2e('0x56')],'raw':!![]})[_0xdf2e('0x28')](handleEntityNotFound(_0x3a39e1,null))[_0xdf2e('0x28')](function(_0x1d5a7d){if(_0x1d5a7d){var _0x360fb4=util[_0xdf2e('0x36')](_0xdf2e('0x51'),_0x1d5a7d[_0xdf2e('0x56')]);if(fs[_0xdf2e('0x52')](_0x360fb4)){_0x135fd1=!![];return _0x1bf602['decryptFile'](_0x360fb4,_0x1d5a7d[_0xdf2e('0x56')],config[_0xdf2e('0x54')][_0xdf2e('0x55')])[_0xdf2e('0x28')](function(){return _0x1d5a7d;});}return _0x1d5a7d;}})[_0xdf2e('0x28')](function(_0x1f9a16){if(_0x1f9a16){if(!fs['existsSync'](_0x1f9a16[_0xdf2e('0x56')])){throw new db[(_0xdf2e('0x64'))]['ValidationError'](_0xdf2e('0x58'));}if(_0x1f9a16[_0xdf2e('0x59')]){return _0x3a39e1[_0xdf2e('0x5a')](_0x1f9a16[_0xdf2e('0x56')],_0x1f9a16['filename']+path[_0xdf2e('0x5b')](_0x1f9a16[_0xdf2e('0x56')]),function(){if(_0x135fd1){fs['unlink'](_0x1f9a16[_0xdf2e('0x56')]);}});}else{return _0x3a39e1[_0xdf2e('0x5a')](_0x1f9a16[_0xdf2e('0x56')],function(_0x17b4d5){if(_0x135fd1){fs['unlink'](_0x1f9a16[_0xdf2e('0x56')]);}});}}})[_0xdf2e('0x4c')](handleError(_0x3a39e1,null));};exports[_0xdf2e('0x29')]=function(_0x2744db,_0x232812){return db[_0xdf2e('0x2f')][_0xdf2e('0x49')]({'where':{'id':_0x2744db[_0xdf2e('0x4d')]['id']}})['then'](function(_0x3da99a){if(_['isNil'](_0x3da99a)){throw new ReferenceError(_0xdf2e('0x65'));}return _0x3da99a;})['then'](function(_0x280f64){var _0x356c22=_0x280f64[_0xdf2e('0x56')];logger[_0xdf2e('0x66')](_0xdf2e('0x67'),_0x356c22);if(!_[_0xdf2e('0x68')](_0x280f64[_0xdf2e('0x56')])&&fs[_0xdf2e('0x52')](_0x356c22)){logger[_0xdf2e('0x66')](_0xdf2e('0x69')+_0x356c22+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xdf2e('0x6a')](_0x356c22);}_0x356c22=_0x356c22+_0xdf2e('0x6b');if(!_[_0xdf2e('0x68')](_0x280f64[_0xdf2e('0x56')])&&fs['existsSync'](_0x356c22)){logger['info'](_0xdf2e('0x69')+_0x356c22+_0xdf2e('0x6c'));fs[_0xdf2e('0x6a')](_0x356c22);}return _0x280f64;})[_0xdf2e('0x28')](function(_0x31566b){if(!_0x31566b)throw new InternalError();return _0x31566b['destroy']();})[_0xdf2e('0x28')](function(){_0x232812[_0xdf2e('0x1c')](0xcc)[_0xdf2e('0x6d')]();})[_0xdf2e('0x4c')](handleError(_0x232812,null));};function getBucketslist(_0x9f8d7,_0x4b292b,_0x2251b4){return new Promise(function(_0x367bb6,_0x4dc57c){var _0x1c1281=new AWS['S3']({'accessKeyId':_0x4b292b,'secretAccessKey':_0x9f8d7,'region':_0x2251b4});_0x1c1281[_0xdf2e('0x6e')]({},function(_0x3f74b1,_0x4bfdc4){if(_0x3f74b1){return _0x4dc57c(_0x3f74b1);}else{return _0x367bb6(_0x4bfdc4);}});});}function createBucket(_0x39f39d,_0xa02c09,_0x29d4af,_0xc9a58f){return new Promise(function(_0x1bcc99,_0x258c5b){var _0x556bd1=new AWS['S3']({'accessKeyId':_0xa02c09,'secretAccessKey':_0x39f39d,'region':_0x29d4af});_0x556bd1[_0xdf2e('0x6f')]({'Bucket':_0xc9a58f},function(_0x1fcaec,_0xb40b47){if(_0x1fcaec){return _0x258c5b(_0x1fcaec);}else{return _0x1bcc99(_0xb40b47);}});});}function uploadFile(_0x51909d,_0x1a7ec7,_0x3ecd01,_0x3e9ec7,_0x7b598b,_0x25f0fe){return new Promise(function(_0x1f57a0,_0x42ebfb){var _0xb40bd4=new AWS['S3']({'accessKeyId':_0x1a7ec7,'secretAccessKey':_0x51909d,'region':_0x3ecd01});_0xb40bd4[_0xdf2e('0x70')]({'Bucket':_0x3e9ec7,'Key':_0x7b598b,'Body':_0x25f0fe},function(_0x52b2be,_0x26720f){if(_0x52b2be){return _0x42ebfb(_0x52b2be);}else{return _0x1f57a0(_0x26720f);}});});}function startTranscribe(_0x410093,_0x44a65b,_0x479359,_0x9bfb2c,_0x334176,_0x3c5f6f){return new Promise(function(_0xfdae93,_0x4c037d){var _0x18859b=new AWS[(_0xdf2e('0x71'))]({'accessKeyId':_0x44a65b,'secretAccessKey':_0x410093,'region':_0x479359});_0x18859b[_0xdf2e('0x72')]({'TranscriptionJobName':_0x9bfb2c,'LanguageCode':_0x334176,'Media':{'MediaFileUri':_0x3c5f6f}},function(_0xc53ebb,_0x1d67ce){if(_0xc53ebb){return _0x4c037d(_0xc53ebb);}else{return _0xfdae93(_0x1d67ce);}});});}function transcribe(_0x25a3b5,_0x2061fa,_0x5b9c8b,_0x217b3a,_0x22925a,_0x1d9c09,_0x1923ea){return new Promise(function(_0x4b8532,_0x179f37){var _0x5a7b55={};logger[_0xdf2e('0x66')](util[_0xdf2e('0x36')](_0xdf2e('0x73'),_0x25a3b5,_0x22925a));return uploadFile(_0x2061fa,_0x5b9c8b,_0x217b3a,_0x22925a,path[_0xdf2e('0x74')](_0x1d9c09),fs[_0xdf2e('0x75')](_0x1d9c09))[_0xdf2e('0x28')](function(_0x817fc0){logger[_0xdf2e('0x66')](util['format']('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x25a3b5,_0x22925a,_0x817fc0[_0xdf2e('0x76')]));_0x5a7b55['bucket']=_0x817fc0[_0xdf2e('0x77')];_0x5a7b55[_0xdf2e('0x78')]=_0x817fc0['Location'];logger[_0xdf2e('0x66')](util[_0xdf2e('0x36')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x25a3b5));return startTranscribe(_0x2061fa,_0x5b9c8b,_0x217b3a,uuidv4(),_0x1923ea,_0x817fc0[_0xdf2e('0x76')]);})['then'](function(_0x59e5c0){logger[_0xdf2e('0x66')](util['format'](_0xdf2e('0x79'),_0x25a3b5,_0x59e5c0['TranscriptionJob'][_0xdf2e('0x7a')]));_0x5a7b55[_0xdf2e('0x7b')]=_0x59e5c0[_0xdf2e('0x7c')][_0xdf2e('0x7a')];_0x5a7b55['transcribeStatus']=_0x59e5c0['TranscriptionJob'][_0xdf2e('0x7d')];return _0x4b8532(_0x5a7b55);})[_0xdf2e('0x4c')](function(_0x5feaf4){return _0x179f37(_0x5feaf4);});});}exports[_0xdf2e('0x7e')]=function(_0x5a3415,_0x275e2a,_0xfb8050){var _0x570874;var _0x1b09c9;var _0x4dd732;var _0x2acf3e=require(_0xdf2e('0x4f'));return db[_0xdf2e('0x2f')]['findOne']({'where':{'id':_0x5a3415[_0xdf2e('0x4d')]['id']}})[_0xdf2e('0x28')](function(_0x27fb9d){if(_0x27fb9d){var _0x2d36ab=util[_0xdf2e('0x36')](_0xdf2e('0x51'),_0x27fb9d[_0xdf2e('0x56')]);if(fs[_0xdf2e('0x52')](_0x2d36ab)){cypher=!![];return _0x2acf3e[_0xdf2e('0x53')](_0x2d36ab,_0x27fb9d['value'],config[_0xdf2e('0x54')]['recording'])[_0xdf2e('0x28')](function(){return _0x27fb9d;});}return _0x27fb9d;}})['then'](function(_0x2589eb){if(!_0x2589eb){throw new db[(_0xdf2e('0x64'))][(_0xdf2e('0x57'))](_0xdf2e('0x7f'));}_0x1b09c9=_0x2589eb;return db['Setting']['findOne']({'where':{'id':0x1}});})[_0xdf2e('0x28')](handleEntityNotFound(_0x275e2a,null))[_0xdf2e('0x28')](function(_0x220d81){if(_0x220d81){_0x570874=_0x220d81;if(!_0x570874[_0xdf2e('0x80')]||!_0x570874[_0xdf2e('0x81')]||!_0x570874[_0xdf2e('0x82')]||!_0x570874[_0xdf2e('0x83')]||!_0x570874['bucket']){throw new db[(_0xdf2e('0x64'))]['ValidationError'](_0xdf2e('0x84'));}if(_0x5a3415[_0xdf2e('0x4b')][_0xdf2e('0x85')]&&(!_0x570874[_0xdf2e('0x86')]||!_0x570874[_0xdf2e('0x87')]||!_0x570874[_0xdf2e('0x88')]||!_0x570874['language']||!_0x570874['bucket'])){throw new db[(_0xdf2e('0x64'))]['ValidationError'](_0xdf2e('0x89'));}return db['CloudProvider'][_0xdf2e('0x8a')]({'where':{'id':_0x570874[_0xdf2e('0x81')]}});}})['then'](function(_0x218ed9){if(!_0x218ed9){throw new db[(_0xdf2e('0x64'))]['ValidationError'](_0xdf2e('0x8b'));}if(!_0x218ed9[_0xdf2e('0x8c')]||!_0x218ed9[_0xdf2e('0x8d')]){throw new db['Sequelize'][(_0xdf2e('0x57'))]('Cloud\x20Provider\x20not\x20configured');}_0x4dd732=_0x218ed9;return getBucketslist(_0x4dd732[_0xdf2e('0x8c')],_0x4dd732[_0xdf2e('0x8d')],_0x570874[_0xdf2e('0x82')]);})[_0xdf2e('0x28')](function(_0x35093c){if(_0x35093c&&_0x35093c[_0xdf2e('0x8e')]){var _0x456e90=_[_0xdf2e('0x49')](_0x35093c[_0xdf2e('0x8e')],function(_0x2cb9cc){return _0x2cb9cc[_0xdf2e('0x8f')]===_0x570874[_0xdf2e('0x90')];});if(!_0x456e90){logger['info'](util[_0xdf2e('0x36')](_0xdf2e('0x91'),_0x5a3415['params']['id'],_0x570874[_0xdf2e('0x90')]));return createBucket(_0x4dd732[_0xdf2e('0x8c')],_0x4dd732[_0xdf2e('0x8d')],_0x570874['transcribeRegion'],_0x570874[_0xdf2e('0x90')]);}logger[_0xdf2e('0x66')](util['format'](_0xdf2e('0x92'),_0x5a3415[_0xdf2e('0x4d')]['id'],_0x570874[_0xdf2e('0x90')]));return;}})['then'](function(_0x14222b){if(_0x1b09c9[_0xdf2e('0x93')]===_0xdf2e('0x94')){return transcribe(_0x5a3415[_0xdf2e('0x4d')]['id'],_0x4dd732[_0xdf2e('0x8c')],_0x4dd732[_0xdf2e('0x8d')],_0x570874[_0xdf2e('0x82')],_0x570874[_0xdf2e('0x90')],_0x1b09c9[_0xdf2e('0x56')],_0x570874['language']);}else{logger[_0xdf2e('0x66')](util[_0xdf2e('0x36')](_0xdf2e('0x95'),_0x5a3415[_0xdf2e('0x4d')]['id']));return{'transcribeStatus':_0xdf2e('0x96')};}})[_0xdf2e('0x28')](function(_0x5ae707){if(_0x5ae707){_0x5ae707[_0xdf2e('0x97')]=_0x5a3415['body']['runSentiment'];return _0x1b09c9['updateAttributes'](_0x5ae707);}})[_0xdf2e('0x28')](respondWithResult(_0x275e2a,null))[_0xdf2e('0x4c')](handleError(_0x275e2a,null));};function writeFile(_0x2e0dc8,_0x1fc463){return new Promise(function(_0x1a2cb0,_0x1134d6){fs[_0xdf2e('0x98')](_0x1fc463,_0x2e0dc8,function(_0x2a2fd1,_0x560bb3){if(_0x2a2fd1){return _0x1134d6(_0x2a2fd1);}else{return _0x1a2cb0(_0x560bb3);}});});}exports[_0xdf2e('0x99')]=function(_0x2fb121,_0x34b450,_0xdc65f7){return db[_0xdf2e('0x2f')][_0xdf2e('0x8a')]({'where':{'id':_0x2fb121[_0xdf2e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x34b450))[_0xdf2e('0x28')](function(_0x3dcadf){if(_0x3dcadf&&_0x3dcadf[_0xdf2e('0x9a')]){var _0x5dfee1=_0x3dcadf[_0xdf2e('0x9a')];var _0x10a7ee=config[_0xdf2e('0x9b')]+_0xdf2e('0x9c')+_0x3dcadf['id']+_0xdf2e('0x9d');if(fs[_0xdf2e('0x52')](_0x10a7ee)){return _0x10a7ee;}return writeFile(_0x5dfee1,_0x10a7ee)[_0xdf2e('0x28')](function(){return _0x10a7ee;});}else{throw new db[(_0xdf2e('0x64'))][(_0xdf2e('0x57'))](_0xdf2e('0x9e'));}})[_0xdf2e('0x28')](function(_0x2d55fd){return _0x34b450['download'](_0x2d55fd);})['catch'](handleError(_0x34b450));}; \ No newline at end of file +var _0xeee9=['listBuckets','createBucket','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','Bucket','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','findOne','%s.cypher','transcribe','transcribeRegion','language','bucket','runSentiment','sentiment','sentimentAccountId','sentimentRegion','CloudProvider','transcribeAccountId','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','fileText','root','/server/files/transcribes/transcribe_','.txt','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','uuid/v4','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','then','end','stack','name','index','map','VoiceRecording','rawAttributes','type','model','differenceBy','format','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','update','body','describe','download','../../components/encryptor','uniqueid','value','existsSync','secrets','Sequelize','VoiceRecording\x20not\x20found','filename','unlink','Not\x20found','downloads','sequelize','MD5','col','token','$and','decryptFile','recording','ValidationError','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione'];(function(_0x2e4c14,_0x4dbcd7){var _0x2580b0=function(_0x39e497){while(--_0x39e497){_0x2e4c14['push'](_0x2e4c14['shift']());}};_0x2580b0(++_0x4dbcd7);}(_0xeee9,0x147));var _0x9eee=function(_0x24c87b,_0x47f034){_0x24c87b=_0x24c87b-0x0;var _0x1299c2=_0xeee9[_0x24c87b];return _0x1299c2;};'use strict';var emlformat=require(_0x9eee('0x0'));var rimraf=require(_0x9eee('0x1'));var zipdir=require(_0x9eee('0x2'));var jsonpatch=require(_0x9eee('0x3'));var rp=require('request-promise');var moment=require(_0x9eee('0x4'));var BPromise=require(_0x9eee('0x5'));var Mustache=require(_0x9eee('0x6'));var util=require('util');var path=require(_0x9eee('0x7'));var sox=require('sox');var csv=require(_0x9eee('0x8'));var ejs=require(_0x9eee('0x9'));var fs=require('fs');var fs_extra=require(_0x9eee('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9eee('0xb'));var jsforce=require(_0x9eee('0xc'));var deskjs=require(_0x9eee('0xd'));var toCsv=require(_0x9eee('0x8'));var querystring=require(_0x9eee('0xe'));var Papa=require(_0x9eee('0xf'));var AWS=require(_0x9eee('0x10'));var uuidv4=require(_0x9eee('0x11'));var Redis=require('ioredis');var authService=require(_0x9eee('0x12'));var qs=require(_0x9eee('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9eee('0x14'));var utils=require(_0x9eee('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9eee('0x16'));var db=require(_0x9eee('0x17'))['db'];function respondWithStatusCode(_0x17aef7,_0x56c671){_0x56c671=_0x56c671||0xcc;return function(_0xe77905){if(_0xe77905){return _0x17aef7['sendStatus'](_0x56c671);}return _0x17aef7['status'](_0x56c671)['end']();};}function respondWithResult(_0x4ae217,_0x128745){_0x128745=_0x128745||0xc8;return function(_0x1e65fc){if(_0x1e65fc){return _0x4ae217[_0x9eee('0x18')](_0x128745)[_0x9eee('0x19')](_0x1e65fc);}};}function respondWithFilteredResult(_0x2a4f54,_0x3a306b){return function(_0xdcacdd){if(_0xdcacdd){var _0x45b2d8=typeof _0x3a306b[_0x9eee('0x1a')]==='undefined'&&typeof _0x3a306b[_0x9eee('0x1b')]===_0x9eee('0x1c');var _0x345dd8=_0xdcacdd[_0x9eee('0x1d')];var _0x1ec2f1=_0x45b2d8?0x0:_0x3a306b[_0x9eee('0x1a')];var _0x43d0ed=_0x45b2d8?_0xdcacdd[_0x9eee('0x1d')]:_0x3a306b[_0x9eee('0x1a')]+_0x3a306b[_0x9eee('0x1b')];var _0xca1d41;if(_0x43d0ed>=_0x345dd8){_0x43d0ed=_0x345dd8;_0xca1d41=0xc8;}else{_0xca1d41=0xce;}_0x2a4f54['status'](_0xca1d41);return _0x2a4f54[_0x9eee('0x1e')](_0x9eee('0x1f'),_0x1ec2f1+'-'+_0x43d0ed+'/'+_0x345dd8)[_0x9eee('0x19')](_0xdcacdd);}return null;};}function patchUpdates(_0x2ff210){return function(_0xc74dee){try{jsonpatch[_0x9eee('0x20')](_0xc74dee,_0x2ff210,!![]);}catch(_0xa06947){return BPromise[_0x9eee('0x21')](_0xa06947);}return _0xc74dee[_0x9eee('0x22')]();};}function saveUpdates(_0x76c7d2,_0x494f94){return function(_0x216e3c){if(_0x216e3c){return _0x216e3c['update'](_0x76c7d2)['then'](function(_0x371156){return _0x371156;});}return null;};}function removeEntity(_0x48c768,_0x1d16e2){return function(_0x201aa1){if(_0x201aa1){return _0x201aa1[_0x9eee('0x23')]()[_0x9eee('0x24')](function(){_0x48c768['status'](0xcc)[_0x9eee('0x25')]();});}};}function handleEntityNotFound(_0x466e59,_0x34d587){return function(_0x13a303){if(!_0x13a303){_0x466e59['sendStatus'](0x194);}return _0x13a303;};}function handleError(_0x427bd5,_0x4bbce2){_0x4bbce2=_0x4bbce2||0x1f4;return function(_0x15dc83){logger['error'](_0x15dc83[_0x9eee('0x26')]);if(_0x15dc83[_0x9eee('0x27')]){delete _0x15dc83[_0x9eee('0x27')];}_0x427bd5[_0x9eee('0x18')](_0x4bbce2)['send'](_0x15dc83);};}exports[_0x9eee('0x28')]=function(_0x55f2c0,_0x49ce7b){var _0x5e5ec5={},_0x34764b={},_0x2fc06f={'count':0x0,'rows':[]};var _0x3396ee=_[_0x9eee('0x29')](db[_0x9eee('0x2a')][_0x9eee('0x2b')],function(_0x1e8460){return{'name':_0x1e8460['fieldName'],'type':_0x1e8460[_0x9eee('0x2c')]['key']};});_0x34764b[_0x9eee('0x2d')]=_[_0x9eee('0x2e')](_[_0x9eee('0x29')](_0x3396ee,'name'),[_0x9eee('0x2f')]);_0x34764b[_0x9eee('0x30')]=_[_0x9eee('0x31')](_0x55f2c0['query']);_0x34764b['filters']=_[_0x9eee('0x32')](_0x34764b[_0x9eee('0x2d')],_0x34764b[_0x9eee('0x30')]);_0x5e5ec5[_0x9eee('0x33')]=_[_0x9eee('0x32')](_0x34764b[_0x9eee('0x2d')],qs['fields'](_0x55f2c0[_0x9eee('0x30')][_0x9eee('0x34')]));_0x5e5ec5[_0x9eee('0x33')]=_0x5e5ec5[_0x9eee('0x33')][_0x9eee('0x35')]?_0x5e5ec5[_0x9eee('0x33')]:_0x34764b[_0x9eee('0x2d')];if(!_0x55f2c0[_0x9eee('0x30')][_0x9eee('0x36')](_0x9eee('0x37'))){_0x5e5ec5['limit']=qs['limit'](_0x55f2c0[_0x9eee('0x30')][_0x9eee('0x1b')]);_0x5e5ec5[_0x9eee('0x1a')]=qs['offset'](_0x55f2c0[_0x9eee('0x30')][_0x9eee('0x1a')]);}_0x5e5ec5[_0x9eee('0x38')]=qs[_0x9eee('0x39')](_0x55f2c0[_0x9eee('0x30')]['sort']);_0x5e5ec5[_0x9eee('0x3a')]=qs[_0x9eee('0x3b')](_['pick'](_0x55f2c0[_0x9eee('0x30')],_0x34764b['filters']),_0x3396ee);if(_0x55f2c0[_0x9eee('0x30')][_0x9eee('0x3c')]){_0x5e5ec5[_0x9eee('0x3a')]=_[_0x9eee('0x3d')](_0x5e5ec5[_0x9eee('0x3a')],{'$or':_[_0x9eee('0x29')](_0x3396ee,function(_0x3e8186){if(_0x3e8186['type']!==_0x9eee('0x3e')){var _0x3d8b07={};_0x3d8b07[_0x3e8186[_0x9eee('0x27')]]={'$like':'%'+_0x55f2c0[_0x9eee('0x30')][_0x9eee('0x3c')]+'%'};return _0x3d8b07;}})});}_0x5e5ec5=_['merge']({},_0x5e5ec5,_0x55f2c0['options']);var _0x38744e={'where':_0x5e5ec5['where']};return db[_0x9eee('0x2a')][_0x9eee('0x1d')](_0x38744e)[_0x9eee('0x24')](function(_0x3a90a9){_0x2fc06f['count']=_0x3a90a9;if(_0x55f2c0[_0x9eee('0x30')][_0x9eee('0x3f')]){_0x5e5ec5[_0x9eee('0x40')]=[{'all':!![]}];}return db['VoiceRecording']['findAll'](_0x5e5ec5);})['then'](function(_0x233750){_0x2fc06f[_0x9eee('0x41')]=_0x233750;return _0x2fc06f;})[_0x9eee('0x24')](respondWithFilteredResult(_0x49ce7b,_0x5e5ec5))[_0x9eee('0x42')](handleError(_0x49ce7b,null));};exports[_0x9eee('0x43')]=function(_0x52eb5a,_0x1b46a7){var _0x3652b4={'raw':![],'where':{'id':_0x52eb5a[_0x9eee('0x44')]['id']}},_0x528db2={};_0x528db2[_0x9eee('0x2d')]=_[_0x9eee('0x31')](db[_0x9eee('0x2a')]['rawAttributes']);_0x528db2[_0x9eee('0x30')]=_['keys'](_0x52eb5a[_0x9eee('0x30')]);_0x528db2[_0x9eee('0x3b')]=_[_0x9eee('0x32')](_0x528db2[_0x9eee('0x2d')],_0x528db2[_0x9eee('0x30')]);_0x3652b4[_0x9eee('0x33')]=_[_0x9eee('0x32')](_0x528db2[_0x9eee('0x2d')],qs[_0x9eee('0x34')](_0x52eb5a['query'][_0x9eee('0x34')]));_0x3652b4[_0x9eee('0x33')]=_0x3652b4[_0x9eee('0x33')][_0x9eee('0x35')]?_0x3652b4[_0x9eee('0x33')]:_0x528db2['model'];if(_0x52eb5a[_0x9eee('0x30')]['includeAll']){_0x3652b4[_0x9eee('0x40')]=[{'all':!![]}];}_0x3652b4=_[_0x9eee('0x3d')]({},_0x3652b4,_0x52eb5a[_0x9eee('0x45')]);return db[_0x9eee('0x2a')][_0x9eee('0x46')](_0x3652b4)[_0x9eee('0x24')](handleEntityNotFound(_0x1b46a7,null))['then'](respondWithResult(_0x1b46a7,null))['catch'](handleError(_0x1b46a7,null));};exports[_0x9eee('0x47')]=function(_0x444bfc,_0x13617b){return db['VoiceRecording'][_0x9eee('0x47')](_0x444bfc['body'],{})[_0x9eee('0x24')](respondWithResult(_0x13617b,0xc9))[_0x9eee('0x42')](handleError(_0x13617b,null));};exports[_0x9eee('0x48')]=function(_0x296b4b,_0x19f2da){if(_0x296b4b[_0x9eee('0x49')]['id']){delete _0x296b4b['body']['id'];}return db[_0x9eee('0x2a')][_0x9eee('0x46')]({'where':{'id':_0x296b4b[_0x9eee('0x44')]['id']}})[_0x9eee('0x24')](handleEntityNotFound(_0x19f2da,null))[_0x9eee('0x24')](saveUpdates(_0x296b4b[_0x9eee('0x49')],null))[_0x9eee('0x24')](respondWithResult(_0x19f2da,null))[_0x9eee('0x42')](handleError(_0x19f2da,null));};exports[_0x9eee('0x4a')]=function(_0xa27e29,_0x28ac15){return db[_0x9eee('0x2a')][_0x9eee('0x4a')]()[_0x9eee('0x24')](respondWithResult(_0x28ac15,null))['catch'](handleError(_0x28ac15,null));};exports[_0x9eee('0x4b')]=function(_0x3ac272,_0x4044f6,_0x5ba06c){var _0x4011ac=require(_0x9eee('0x4c'));var _0x443ad3=![];var _0x55dfc3={};if(_0x3ac272['query'][_0x9eee('0x2c')]&&_0x3ac272[_0x9eee('0x30')][_0x9eee('0x2c')]===_0x9eee('0x4d')){_0x55dfc3['uniqueid']=_0x3ac272[_0x9eee('0x44')]['id'];}else{_0x55dfc3['id']=_0x3ac272[_0x9eee('0x44')]['id'];}return db['VoiceRecording'][_0x9eee('0x46')]({'where':_0x55dfc3,'attributes':['id',_0x9eee('0x4e')],'raw':!![]})[_0x9eee('0x24')](handleEntityNotFound(_0x4044f6,null))[_0x9eee('0x24')](function(_0x194d5e){if(_0x194d5e){var _0x3c4394=_0x194d5e['value'];var _0x3805d5=util[_0x9eee('0x2f')]('%s.cypher',_0x3c4394);if(fs[_0x9eee('0x4f')](_0x3805d5)){_0x443ad3=!![];return _0x4011ac['decryptFile'](_0x3805d5,_0x3c4394,config[_0x9eee('0x50')]['recording'])[_0x9eee('0x24')](function(){return _0x194d5e;});}return _0x194d5e;}})[_0x9eee('0x24')](function(_0x2bb09b){if(_0x2bb09b){var _0x29edf4=_0x2bb09b[_0x9eee('0x4e')];if(!fs[_0x9eee('0x4f')](_0x29edf4)){throw new db[(_0x9eee('0x51'))]['ValidationError'](_0x9eee('0x52'));}if(_0x2bb09b[_0x9eee('0x53')]){return _0x4044f6[_0x9eee('0x4b')](_0x29edf4,_0x2bb09b[_0x9eee('0x53')]+path['extname'](_0x29edf4),function(){if(_0x443ad3){fs[_0x9eee('0x54')](_0x29edf4);}});}else{return _0x4044f6[_0x9eee('0x4b')](_0x29edf4,function(_0x4eab81){if(_0x443ad3){fs[_0x9eee('0x54')](_0x29edf4);}});}}})[_0x9eee('0x42')](function(_0x42ac61){if(_0x42ac61['message']===_0x9eee('0x52')){_0x4044f6[_0x9eee('0x18')](0x194)['send'](_0x9eee('0x55'));}else{return handleError(_0x4044f6,null);}});};exports[_0x9eee('0x56')]=function(_0x826773,_0xb9cbef,_0x36f935){var _0x410337=require(_0x9eee('0x4c'));var _0x2972f1=![];var _0xd11ec3={'$and':[db['sequelize'][_0x9eee('0x3a')](db[_0x9eee('0x57')]['fn'](_0x9eee('0x58'),db[_0x9eee('0x57')][_0x9eee('0x59')](_0x9eee('0x4d'))),_0x826773[_0x9eee('0x30')][_0x9eee('0x5a')])]};if(_0x826773[_0x9eee('0x30')][_0x9eee('0x2c')]&&_0x826773[_0x9eee('0x30')][_0x9eee('0x2c')]==='uniqueid'){_0xd11ec3[_0x9eee('0x5b')]['push']({'uniqueid':_0x826773[_0x9eee('0x44')]['id']});}else{_0xd11ec3[_0x9eee('0x5b')]['push']({'id':_0x826773['params']['id']});}return db[_0x9eee('0x2a')][_0x9eee('0x46')]({'where':_0xd11ec3,'attributes':['id',_0x9eee('0x4e')],'raw':!![]})[_0x9eee('0x24')](handleEntityNotFound(_0xb9cbef,null))['then'](function(_0x50a88c){if(_0x50a88c){var _0x6eed9e=util[_0x9eee('0x2f')]('%s.cypher',_0x50a88c['value']);if(fs[_0x9eee('0x4f')](_0x6eed9e)){_0x2972f1=!![];return _0x410337[_0x9eee('0x5c')](_0x6eed9e,_0x50a88c[_0x9eee('0x4e')],config[_0x9eee('0x50')][_0x9eee('0x5d')])[_0x9eee('0x24')](function(){return _0x50a88c;});}return _0x50a88c;}})[_0x9eee('0x24')](function(_0x1b633d){if(_0x1b633d){if(!fs[_0x9eee('0x4f')](_0x1b633d[_0x9eee('0x4e')])){throw new db[(_0x9eee('0x51'))][(_0x9eee('0x5e'))]('VoiceRecording\x20not\x20found');}if(_0x1b633d[_0x9eee('0x53')]){return _0xb9cbef['download'](_0x1b633d[_0x9eee('0x4e')],_0x1b633d[_0x9eee('0x53')]+path['extname'](_0x1b633d[_0x9eee('0x4e')]),function(){if(_0x2972f1){fs[_0x9eee('0x54')](_0x1b633d[_0x9eee('0x4e')]);}});}else{return _0xb9cbef[_0x9eee('0x4b')](_0x1b633d[_0x9eee('0x4e')],function(_0x2172d0){if(_0x2972f1){fs[_0x9eee('0x54')](_0x1b633d[_0x9eee('0x4e')]);}});}}})[_0x9eee('0x42')](handleError(_0xb9cbef,null));};exports[_0x9eee('0x23')]=function(_0x3d79e8,_0x4f6c8b){return db[_0x9eee('0x2a')][_0x9eee('0x46')]({'where':{'id':_0x3d79e8[_0x9eee('0x44')]['id']}})[_0x9eee('0x24')](function(_0x2eeb56){if(_[_0x9eee('0x5f')](_0x2eeb56)){throw new ReferenceError(_0x9eee('0x60'));}return _0x2eeb56;})[_0x9eee('0x24')](function(_0x343843){var _0x39f08c=_0x343843['value'];logger[_0x9eee('0x61')](_0x9eee('0x62'),_0x39f08c);if(!_[_0x9eee('0x5f')](_0x343843[_0x9eee('0x4e')])&&fs[_0x9eee('0x4f')](_0x39f08c)){logger[_0x9eee('0x61')](_0x9eee('0x63')+_0x39f08c+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x39f08c);}_0x39f08c=_0x39f08c+_0x9eee('0x64');if(!_[_0x9eee('0x5f')](_0x343843[_0x9eee('0x4e')])&&fs['existsSync'](_0x39f08c)){logger[_0x9eee('0x61')](_0x9eee('0x63')+_0x39f08c+_0x9eee('0x65'));fs['unlinkSync'](_0x39f08c);}return _0x343843;})[_0x9eee('0x24')](function(_0x396d25){if(!_0x396d25)throw new InternalError();return _0x396d25[_0x9eee('0x23')]();})[_0x9eee('0x24')](function(){_0x4f6c8b[_0x9eee('0x18')](0xcc)[_0x9eee('0x25')]();})[_0x9eee('0x42')](handleError(_0x4f6c8b,null));};function getBucketslist(_0x2e9366,_0x1319d2,_0x16bcb5){return new Promise(function(_0xb40a69,_0x2b306e){var _0x265155=new AWS['S3']({'accessKeyId':_0x1319d2,'secretAccessKey':_0x2e9366,'region':_0x16bcb5});_0x265155[_0x9eee('0x66')]({},function(_0x2d554c,_0x1b6ea3){if(_0x2d554c){return _0x2b306e(_0x2d554c);}else{return _0xb40a69(_0x1b6ea3);}});});}function createBucket(_0x20132d,_0x5af72e,_0x4383a2,_0x477f97){return new Promise(function(_0x864f2d,_0x4c5de4){var _0x15740d=new AWS['S3']({'accessKeyId':_0x5af72e,'secretAccessKey':_0x20132d,'region':_0x4383a2});_0x15740d[_0x9eee('0x67')]({'Bucket':_0x477f97},function(_0x33cb38,_0x1e098e){if(_0x33cb38){return _0x4c5de4(_0x33cb38);}else{return _0x864f2d(_0x1e098e);}});});}function uploadFile(_0x3a6535,_0x3d7c27,_0x43066d,_0x9d8d98,_0x4a8ac0,_0x4c598e){return new Promise(function(_0x48163a,_0x5cad3b){var _0x3f938e=new AWS['S3']({'accessKeyId':_0x3d7c27,'secretAccessKey':_0x3a6535,'region':_0x43066d});_0x3f938e['upload']({'Bucket':_0x9d8d98,'Key':_0x4a8ac0,'Body':_0x4c598e},function(_0x4feb58,_0x5ff4df){if(_0x4feb58){return _0x5cad3b(_0x4feb58);}else{return _0x48163a(_0x5ff4df);}});});}function startTranscribe(_0x6b1c2c,_0x313658,_0x45f403,_0x390c29,_0x4bf1a6,_0x583617){return new Promise(function(_0xe98c75,_0x1d91ed){var _0x1cf889=new AWS[(_0x9eee('0x68'))]({'accessKeyId':_0x313658,'secretAccessKey':_0x6b1c2c,'region':_0x45f403});_0x1cf889[_0x9eee('0x69')]({'TranscriptionJobName':_0x390c29,'LanguageCode':_0x4bf1a6,'Media':{'MediaFileUri':_0x583617}},function(_0x370f67,_0x1e88a8){if(_0x370f67){return _0x1d91ed(_0x370f67);}else{return _0xe98c75(_0x1e88a8);}});});}function transcribe(_0xbb7d1b,_0x4f303e,_0x5e3840,_0x24ff40,_0x4ebc03,_0x36e021,_0x303cc2){return new Promise(function(_0xd2763f,_0xa86835){var _0x300f76={};logger[_0x9eee('0x61')](util[_0x9eee('0x2f')](_0x9eee('0x6a'),_0xbb7d1b,_0x4ebc03));return uploadFile(_0x4f303e,_0x5e3840,_0x24ff40,_0x4ebc03,path[_0x9eee('0x6b')](_0x36e021),fs[_0x9eee('0x6c')](_0x36e021))['then'](function(_0x38de9f){logger[_0x9eee('0x61')](util[_0x9eee('0x2f')](_0x9eee('0x6d'),_0xbb7d1b,_0x4ebc03,_0x38de9f[_0x9eee('0x6e')]));_0x300f76['bucket']=_0x38de9f[_0x9eee('0x6f')];_0x300f76['location']=_0x38de9f[_0x9eee('0x6e')];logger[_0x9eee('0x61')](util[_0x9eee('0x2f')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0xbb7d1b));return startTranscribe(_0x4f303e,_0x5e3840,_0x24ff40,uuidv4(),_0x303cc2,_0x38de9f[_0x9eee('0x6e')]);})[_0x9eee('0x24')](function(_0x2a9b79){logger[_0x9eee('0x61')](util[_0x9eee('0x2f')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0xbb7d1b,_0x2a9b79[_0x9eee('0x70')]['TranscriptionJobName']));_0x300f76['transcribeName']=_0x2a9b79[_0x9eee('0x70')][_0x9eee('0x71')];_0x300f76[_0x9eee('0x72')]=_0x2a9b79[_0x9eee('0x70')][_0x9eee('0x73')];return _0xd2763f(_0x300f76);})[_0x9eee('0x42')](function(_0x5cc1e6){return _0xa86835(_0x5cc1e6);});});}exports['runTranscribe']=function(_0x2bbe7b,_0x17f80e,_0x196c12){var _0x36d7aa;var _0x31244b;var _0x2f9ee1;var _0x26a294=require('../../components/encryptor');return db[_0x9eee('0x2a')][_0x9eee('0x74')]({'where':{'id':_0x2bbe7b[_0x9eee('0x44')]['id']}})[_0x9eee('0x24')](function(_0x4802bd){if(_0x4802bd){var _0x338e9f=util[_0x9eee('0x2f')](_0x9eee('0x75'),_0x4802bd[_0x9eee('0x4e')]);if(fs['existsSync'](_0x338e9f)){cypher=!![];return _0x26a294[_0x9eee('0x5c')](_0x338e9f,_0x4802bd[_0x9eee('0x4e')],config[_0x9eee('0x50')]['recording'])[_0x9eee('0x24')](function(){return _0x4802bd;});}return _0x4802bd;}})[_0x9eee('0x24')](function(_0x481ff0){if(!_0x481ff0){throw new db['Sequelize'][(_0x9eee('0x5e'))]('Voice\x20Recording\x20not\x20found');}_0x31244b=_0x481ff0;return db['Setting'][_0x9eee('0x74')]({'where':{'id':0x1}});})[_0x9eee('0x24')](handleEntityNotFound(_0x17f80e,null))['then'](function(_0x2943a2){if(_0x2943a2){_0x36d7aa=_0x2943a2;if(!_0x36d7aa[_0x9eee('0x76')]||!_0x36d7aa['transcribeAccountId']||!_0x36d7aa[_0x9eee('0x77')]||!_0x36d7aa[_0x9eee('0x78')]||!_0x36d7aa[_0x9eee('0x79')]){throw new db[(_0x9eee('0x51'))][(_0x9eee('0x5e'))]('Transcribe\x20not\x20configured');}if(_0x2bbe7b[_0x9eee('0x49')][_0x9eee('0x7a')]&&(!_0x36d7aa[_0x9eee('0x7b')]||!_0x36d7aa[_0x9eee('0x7c')]||!_0x36d7aa[_0x9eee('0x7d')]||!_0x36d7aa[_0x9eee('0x78')]||!_0x36d7aa['bucket'])){throw new db[(_0x9eee('0x51'))][(_0x9eee('0x5e'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0x9eee('0x7e')][_0x9eee('0x74')]({'where':{'id':_0x36d7aa[_0x9eee('0x7f')]}});}})['then'](function(_0x5d2014){if(!_0x5d2014){throw new db[(_0x9eee('0x51'))][(_0x9eee('0x5e'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x5d2014[_0x9eee('0x80')]||!_0x5d2014[_0x9eee('0x81')]){throw new db['Sequelize'][(_0x9eee('0x5e'))](_0x9eee('0x82'));}_0x2f9ee1=_0x5d2014;return getBucketslist(_0x2f9ee1['data1'],_0x2f9ee1[_0x9eee('0x81')],_0x36d7aa[_0x9eee('0x77')]);})[_0x9eee('0x24')](function(_0x3fdfca){if(_0x3fdfca&&_0x3fdfca[_0x9eee('0x83')]){var _0xd3fb70=_['find'](_0x3fdfca[_0x9eee('0x83')],function(_0x2e8c6a){return _0x2e8c6a['Name']===_0x36d7aa['bucket'];});if(!_0xd3fb70){logger[_0x9eee('0x61')](util[_0x9eee('0x2f')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x2bbe7b[_0x9eee('0x44')]['id'],_0x36d7aa['bucket']));return createBucket(_0x2f9ee1['data1'],_0x2f9ee1[_0x9eee('0x81')],_0x36d7aa[_0x9eee('0x77')],_0x36d7aa[_0x9eee('0x79')]);}logger[_0x9eee('0x61')](util['format'](_0x9eee('0x84'),_0x2bbe7b['params']['id'],_0x36d7aa[_0x9eee('0x79')]));return;}})[_0x9eee('0x24')](function(_0x5d099e){if(_0x31244b['transcribeStatus']===_0x9eee('0x85')){return transcribe(_0x2bbe7b['params']['id'],_0x2f9ee1[_0x9eee('0x80')],_0x2f9ee1[_0x9eee('0x81')],_0x36d7aa['transcribeRegion'],_0x36d7aa['bucket'],_0x31244b[_0x9eee('0x4e')],_0x36d7aa[_0x9eee('0x78')]);}else{logger[_0x9eee('0x61')](util[_0x9eee('0x2f')](_0x9eee('0x86'),_0x2bbe7b['params']['id']));return{'transcribeStatus':_0x9eee('0x87')};}})[_0x9eee('0x24')](function(_0x4fa091){if(_0x4fa091){_0x4fa091[_0x9eee('0x88')]=_0x2bbe7b[_0x9eee('0x49')][_0x9eee('0x7a')];return _0x31244b[_0x9eee('0x89')](_0x4fa091);}})[_0x9eee('0x24')](respondWithResult(_0x17f80e,null))[_0x9eee('0x42')](handleError(_0x17f80e,null));};function writeFile(_0xe92c33,_0x3fcfcc){return new Promise(function(_0x2f1994,_0x16f940){fs[_0x9eee('0x8a')](_0x3fcfcc,_0xe92c33,function(_0x432e93,_0xf61ef2){if(_0x432e93){return _0x16f940(_0x432e93);}else{return _0x2f1994(_0xf61ef2);}});});}exports['downloadTranscribe']=function(_0x49a101,_0x49cd9a,_0x294884){return db[_0x9eee('0x2a')][_0x9eee('0x74')]({'where':{'id':_0x49a101[_0x9eee('0x44')]['id']}})[_0x9eee('0x24')](handleEntityNotFound(_0x49cd9a))[_0x9eee('0x24')](function(_0x2dca1d){if(_0x2dca1d&&_0x2dca1d[_0x9eee('0x8b')]){var _0x481162=_0x2dca1d[_0x9eee('0x8b')];var _0x288a83=config[_0x9eee('0x8c')]+_0x9eee('0x8d')+_0x2dca1d['id']+_0x9eee('0x8e');if(fs['existsSync'](_0x288a83)){return _0x288a83;}return writeFile(_0x481162,_0x288a83)[_0x9eee('0x24')](function(){return _0x288a83;});}else{throw new db[(_0x9eee('0x51'))][(_0x9eee('0x5e'))]('Transcript\x20not\x20available');}})[_0x9eee('0x24')](function(_0x4bc1aa){return _0x49cd9a[_0x9eee('0x4b')](_0x4bc1aa);})[_0x9eee('0x42')](handleError(_0x49cd9a));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index e8b4bee..6a5a71f 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 _0x30f7=['bluebird','request-promise','../../config/environment','./voiceRecording.attributes','exports','define','uniqueid','lodash','util','api','moment'];(function(_0xa0bc7e,_0x5c1d08){var _0x5b7799=function(_0x3d0b60){while(--_0x3d0b60){_0xa0bc7e['push'](_0xa0bc7e['shift']());}};_0x5b7799(++_0x5c1d08);}(_0x30f7,0x8b));var _0x730f=function(_0x13b658,_0x3e2200){_0x13b658=_0x13b658-0x0;var _0x3544ca=_0x30f7[_0x13b658];return _0x3544ca;};'use strict';var _=require(_0x730f('0x0'));var util=require(_0x730f('0x1'));var logger=require('../../config/logger')(_0x730f('0x2'));var moment=require(_0x730f('0x3'));var BPromise=require(_0x730f('0x4'));var rp=require(_0x730f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x730f('0x6'));var attributes=require(_0x730f('0x7'));module[_0x730f('0x8')]=function(_0x4f8190,_0x542a98){return _0x4f8190[_0x730f('0x9')]('VoiceRecording',attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x730f('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x285b=['./voiceRecording.attributes','exports','define','voice_recordings','uniqueid','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x528f00,_0x2ba04c){var _0x1b371a=function(_0x549e5a){while(--_0x549e5a){_0x528f00['push'](_0x528f00['shift']());}};_0x1b371a(++_0x2ba04c);}(_0x285b,0x171));var _0xb285=function(_0x26b239,_0x3046bf){_0x26b239=_0x26b239-0x0;var _0x55b915=_0x285b[_0x26b239];return _0x55b915;};'use strict';var _=require(_0xb285('0x0'));var util=require('util');var logger=require(_0xb285('0x1'))(_0xb285('0x2'));var moment=require('moment');var BPromise=require(_0xb285('0x3'));var rp=require(_0xb285('0x4'));var fs=require('fs');var path=require(_0xb285('0x5'));var rimraf=require(_0xb285('0x6'));var config=require(_0xb285('0x7'));var attributes=require(_0xb285('0x8'));module[_0xb285('0x9')]=function(_0xe785ea,_0x333dfb){return _0xe785ea[_0xb285('0xa')]('VoiceRecording',attributes,{'tableName':_0xb285('0xb'),'paranoid':![],'indexes':[{'name':_0xb285('0xc'),'fields':[_0xb285('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 8c9d202..8ad1078 100644 --- a/server/api/voiceRecording/voiceRecording.rpc.js +++ b/server/api/voiceRecording/voiceRecording.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7b84=['VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','raw','where','attributes','limit','UpdateVoiceRecording','CreateVoiceRecording','Setting','findOne','callRecordingEncryption','create','body','existsSync','value','format','%s.cypher','recording','unlink','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x7b84,0x17c));var _0x47b8=function(_0x3819b9,_0x4192c4){_0x3819b9=_0x3819b9-0x0;var _0x57be52=_0x7b84[_0x3819b9];return _0x57be52;};'use strict';var _=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var moment=require(_0x47b8('0x2'));var BPromise=require(_0x47b8('0x3'));var rs=require(_0x47b8('0x4'));var fs=require('fs');var Redis=require(_0x47b8('0x5'));var db=require(_0x47b8('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x47b8('0x7'))(_0x47b8('0x8'));var config=require(_0x47b8('0x9'));var jayson=require(_0x47b8('0xa'));var client=jayson[_0x47b8('0xb')][_0x47b8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53e656,_0x3867ca,_0x3ce846){return new BPromise(function(_0x46245a,_0xb845c9){return client[_0x47b8('0xd')](_0x53e656,_0x3ce846)[_0x47b8('0xe')](function(_0x24d240){logger[_0x47b8('0xf')](_0x47b8('0x10'),_0x3867ca,_0x47b8('0x11'));logger[_0x47b8('0x12')](_0x47b8('0x13'),_0x3867ca,_0x47b8('0x11'),JSON[_0x47b8('0x14')](_0x24d240));if(_0x24d240[_0x47b8('0x15')]){if(_0x24d240[_0x47b8('0x15')][_0x47b8('0x16')]===0x1f4){logger[_0x47b8('0x15')](_0x47b8('0x10'),_0x3867ca,_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);return _0xb845c9(_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);}logger[_0x47b8('0x15')](_0x47b8('0x10'),_0x3867ca,_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);return _0x46245a(_0x24d240['error'][_0x47b8('0x17')]);}else{logger[_0x47b8('0xf')](_0x47b8('0x10'),_0x3867ca,_0x47b8('0x11'));_0x46245a(_0x24d240[_0x47b8('0x18')][_0x47b8('0x17')]);}})[_0x47b8('0x19')](function(_0x5ad3ae){logger[_0x47b8('0x15')]('VoiceRecording,\x20%s,\x20%s',_0x3867ca,_0x5ad3ae);_0xb845c9(_0x5ad3ae);});});}exports['UpdateVoiceRecording']=function(_0x4f7317){var _0x299195=this;return new Promise(function(_0x36faf1,_0x2797ac){return db['VoiceRecording']['update'](_0x4f7317['body'],{'raw':_0x4f7317[_0x47b8('0x1a')]?_0x4f7317['options'][_0x47b8('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f7317[_0x47b8('0x1a')]?_0x4f7317[_0x47b8('0x1a')][_0x47b8('0x1c')]||null:null,'attributes':_0x4f7317['options']?_0x4f7317[_0x47b8('0x1a')][_0x47b8('0x1d')]||null:null,'limit':_0x4f7317[_0x47b8('0x1a')]?_0x4f7317[_0x47b8('0x1a')][_0x47b8('0x1e')]||null:null})[_0x47b8('0xe')](function(_0x54f6bc){logger[_0x47b8('0xf')](_0x47b8('0x1f'),_0x4f7317);logger['debug'](_0x47b8('0x1f'),_0x4f7317,JSON[_0x47b8('0x14')](_0x54f6bc));_0x36faf1(_0x54f6bc);})[_0x47b8('0x19')](function(_0x142fb6){logger['error'](_0x47b8('0x1f'),_0x142fb6[_0x47b8('0x17')],_0x4f7317);_0x2797ac(_0x299195[_0x47b8('0x15')](0x1f4,_0x142fb6[_0x47b8('0x17')]));});});};exports[_0x47b8('0x20')]=function(_0xbf5ce9){var _0x40918f=this;return new Promise(function(_0x568c1e,_0x43fd49){var _0x1f719a=require('../../components/encryptor');var _0x195a66;return db[_0x47b8('0x21')][_0x47b8('0x22')]({'attributes':['id',_0x47b8('0x23')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x162d96){_0x195a66=_0x162d96;return db['VoiceRecording'][_0x47b8('0x24')](_0xbf5ce9[_0x47b8('0x25')]);})[_0x47b8('0xe')](function(_0x2e540d){if(_0x195a66['callRecordingEncryption']&&fs[_0x47b8('0x26')](_0x2e540d[_0x47b8('0x27')])){var _0x402e7c=util[_0x47b8('0x28')](_0x47b8('0x29'),_0x2e540d[_0x47b8('0x27')]);return _0x1f719a['encryptFile'](_0x2e540d['value'],_0x402e7c,config['secrets'][_0x47b8('0x2a')])[_0x47b8('0xe')](function(){fs[_0x47b8('0x2b')](_0x2e540d['value']);logger['info']('CreateVoiceRecording\x20file\x20encrypted');return _0x2e540d;});}return _0x2e540d;})['then'](function(_0x347769){logger[_0x47b8('0xf')](_0x47b8('0x20'),_0xbf5ce9);logger[_0x47b8('0x12')](_0x47b8('0x20'),_0xbf5ce9,JSON[_0x47b8('0x14')](_0x347769));_0x568c1e(_0x347769);})[_0x47b8('0x19')](function(_0x460dcc){logger[_0x47b8('0x15')]('CreateVoiceRecording',_0x460dcc['message'],_0xbf5ce9);_0x43fd49(_0x40918f[_0x47b8('0x15')](0x1f4,_0x460dcc[_0x47b8('0x17')]));});});}; \ No newline at end of file +var _0x90b1=['request','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','limit','then','../../components/encryptor','findOne','callRecordingEncryption','create','existsSync','%s.cypher','encryptFile','value','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','http'];(function(_0x555ebb,_0x4b1b68){var _0x3c0a4a=function(_0x312e2f){while(--_0x312e2f){_0x555ebb['push'](_0x555ebb['shift']());}};_0x3c0a4a(++_0x4b1b68);}(_0x90b1,0x1bb));var _0x190b=function(_0x3fd7ab,_0x3dd0bc){_0x3fd7ab=_0x3fd7ab-0x0;var _0x56cb4b=_0x90b1[_0x3fd7ab];return _0x56cb4b;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var moment=require(_0x190b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x190b('0x3'));var db=require(_0x190b('0x4'))['db'];var utils=require(_0x190b('0x5'));var logger=require(_0x190b('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x190b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x34a689,_0x3b57f7,_0x626aa1){return new BPromise(function(_0x311161,_0x802924){return client[_0x190b('0x8')](_0x34a689,_0x626aa1)['then'](function(_0x14b93d){logger[_0x190b('0x9')](_0x190b('0xa'),_0x3b57f7,_0x190b('0xb'));logger[_0x190b('0xc')](_0x190b('0xd'),_0x3b57f7,_0x190b('0xb'),JSON[_0x190b('0xe')](_0x14b93d));if(_0x14b93d['error']){if(_0x14b93d[_0x190b('0xf')][_0x190b('0x10')]===0x1f4){logger['error'](_0x190b('0xa'),_0x3b57f7,_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);return _0x802924(_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);}logger[_0x190b('0xf')](_0x190b('0xa'),_0x3b57f7,_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);return _0x311161(_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);}else{logger[_0x190b('0x9')](_0x190b('0xa'),_0x3b57f7,_0x190b('0xb'));_0x311161(_0x14b93d[_0x190b('0x12')][_0x190b('0x11')]);}})[_0x190b('0x13')](function(_0x5c63d9){logger[_0x190b('0xf')]('VoiceRecording,\x20%s,\x20%s',_0x3b57f7,_0x5c63d9);_0x802924(_0x5c63d9);});});}exports[_0x190b('0x14')]=function(_0x21e458){var _0x56d07a=this;return new Promise(function(_0x16c009,_0x50a3c4){return db[_0x190b('0x15')][_0x190b('0x16')](_0x21e458[_0x190b('0x17')],{'raw':_0x21e458[_0x190b('0x18')]?_0x21e458[_0x190b('0x18')][_0x190b('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21e458['options']?_0x21e458[_0x190b('0x18')][_0x190b('0x1a')]||null:null,'attributes':_0x21e458['options']?_0x21e458[_0x190b('0x18')]['attributes']||null:null,'limit':_0x21e458['options']?_0x21e458[_0x190b('0x18')][_0x190b('0x1b')]||null:null})[_0x190b('0x1c')](function(_0x4c0b6e){logger[_0x190b('0x9')](_0x190b('0x14'),_0x21e458);logger[_0x190b('0xc')](_0x190b('0x14'),_0x21e458,JSON[_0x190b('0xe')](_0x4c0b6e));_0x16c009(_0x4c0b6e);})[_0x190b('0x13')](function(_0x1bce97){logger['error']('UpdateVoiceRecording',_0x1bce97[_0x190b('0x11')],_0x21e458);_0x50a3c4(_0x56d07a[_0x190b('0xf')](0x1f4,_0x1bce97['message']));});});};exports['CreateVoiceRecording']=function(_0x3260d5){var _0x4e2a93=this;return new Promise(function(_0x328e5e,_0x3b6aaf){var _0x51f8b4=require(_0x190b('0x1d'));var _0x1deea6;return db['Setting'][_0x190b('0x1e')]({'attributes':['id',_0x190b('0x1f')],'where':{'id':0x1},'raw':!![]})[_0x190b('0x1c')](function(_0x494f3f){_0x1deea6=_0x494f3f;return db['VoiceRecording'][_0x190b('0x20')](_0x3260d5['body']);})[_0x190b('0x1c')](function(_0x19e421){if(_0x1deea6['callRecordingEncryption']&&fs[_0x190b('0x21')](_0x19e421['value'])){var _0x40d060=util['format'](_0x190b('0x22'),_0x19e421['value']);return _0x51f8b4[_0x190b('0x23')](_0x19e421[_0x190b('0x24')],_0x40d060,config['secrets'][_0x190b('0x25')])[_0x190b('0x1c')](function(){fs[_0x190b('0x26')](_0x19e421[_0x190b('0x24')]);logger[_0x190b('0x9')](_0x190b('0x27'));return _0x19e421;});}return _0x19e421;})[_0x190b('0x1c')](function(_0x248919){logger['info']('CreateVoiceRecording',_0x3260d5);logger[_0x190b('0xc')](_0x190b('0x28'),_0x3260d5,JSON['stringify'](_0x248919));_0x328e5e(_0x248919);})[_0x190b('0x13')](function(_0x2dcd39){logger[_0x190b('0xf')](_0x190b('0x28'),_0x2dcd39[_0x190b('0x11')],_0x3260d5);_0x3b6aaf(_0x4e2a93[_0x190b('0xf')](0x1f4,_0x2dcd39[_0x190b('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 2c6e064..c849f93 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 _0xabd3=['destroy','exports','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','create','put','/:id','update','delete'];(function(_0x5b3024,_0x1051bb){var _0x216e39=function(_0x244e11){while(--_0x244e11){_0x5b3024['push'](_0x5b3024['shift']());}};_0x216e39(++_0x1051bb);}(_0xabd3,0x1de));var _0x3abd=function(_0x4d2f00,_0x4e94d5){_0x4d2f00=_0x4d2f00-0x0;var _0x2d7b7f=_0xabd3[_0x4d2f00];return _0x2d7b7f;};'use strict';var multer=require(_0x3abd('0x0'));var util=require('util');var path=require(_0x3abd('0x1'));var timeout=require('connect-timeout');var express=require(_0x3abd('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3abd('0x3'));var interaction=require(_0x3abd('0x4'));var config=require(_0x3abd('0x5'));var controller=require('./voiceTransferReport.controller');router[_0x3abd('0x6')]('/',auth[_0x3abd('0x7')](),controller[_0x3abd('0x8')]);router[_0x3abd('0x6')]('/describe',auth[_0x3abd('0x7')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x3abd('0x9')]);router['post']('/',auth[_0x3abd('0x7')](),controller[_0x3abd('0xa')]);router[_0x3abd('0xb')](_0x3abd('0xc'),auth[_0x3abd('0x7')](),controller[_0x3abd('0xd')]);router[_0x3abd('0xe')](_0x3abd('0xc'),auth[_0x3abd('0x7')](),controller[_0x3abd('0xf')]);module[_0x3abd('0x10')]=router; \ No newline at end of file +var _0x7326=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','delete','destroy','multer','util'];(function(_0x2b0d7d,_0x3f9a3e){var _0xa8709c=function(_0x178048){while(--_0x178048){_0x2b0d7d['push'](_0x2b0d7d['shift']());}};_0xa8709c(++_0x3f9a3e);}(_0x7326,0x14e));var _0x6732=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x7326[_0x5b561d];return _0x431060;};'use strict';var multer=require(_0x6732('0x0'));var util=require(_0x6732('0x1'));var path=require(_0x6732('0x2'));var timeout=require(_0x6732('0x3'));var express=require(_0x6732('0x4'));var router=express['Router']();var fs_extra=require(_0x6732('0x5'));var auth=require(_0x6732('0x6'));var interaction=require(_0x6732('0x7'));var config=require(_0x6732('0x8'));var controller=require(_0x6732('0x9'));router[_0x6732('0xa')]('/',auth[_0x6732('0xb')](),controller[_0x6732('0xc')]);router[_0x6732('0xa')](_0x6732('0xd'),auth[_0x6732('0xb')](),controller[_0x6732('0xe')]);router['get'](_0x6732('0xf'),auth['isAuthenticated'](),controller[_0x6732('0x10')]);router[_0x6732('0x11')]('/',auth[_0x6732('0xb')](),controller['create']);router['put'](_0x6732('0xf'),auth[_0x6732('0xb')](),controller[_0x6732('0x12')]);router[_0x6732('0x13')](_0x6732('0xf'),auth[_0x6732('0xb')](),controller[_0x6732('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index d8be331..dd16301 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 _0xe197=['ENUM','blind','attended','STRING','sequelize','exports'];(function(_0x546b4d,_0x35b70b){var _0x3dd7a1=function(_0x5b1476){while(--_0x5b1476){_0x546b4d['push'](_0x546b4d['shift']());}};_0x3dd7a1(++_0x35b70b);}(_0xe197,0x190));var _0x7e19=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe197[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x7e19('0x0'));var moment=require('moment');module[_0x7e19('0x1')]={'type':{'type':Sequelize[_0x7e19('0x2')](_0x7e19('0x3'),_0x7e19('0x4'))},'result':{'type':Sequelize[_0x7e19('0x5')]},'transfererchannel':{'type':Sequelize[_0x7e19('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x7e19('0x5')]},'transferercalleridname':{'type':Sequelize[_0x7e19('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x7e19('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x7e19('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x7e19('0x5')]},'transferercontext':{'type':Sequelize[_0x7e19('0x5')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x7e19('0x5')]},'transfereechannel':{'type':Sequelize[_0x7e19('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x7e19('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x7e19('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x7e19('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x7e19('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x7e19('0x5')]},'transfereecontext':{'type':Sequelize[_0x7e19('0x5')]},'transfereeexten':{'type':Sequelize[_0x7e19('0x5')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize['ENUM']('Yes','No')},'context':{'type':Sequelize[_0x7e19('0x5')]},'extension':{'type':Sequelize[_0x7e19('0x5')]}}; \ No newline at end of file +var _0x906b=['moment','exports','ENUM','blind','attended','STRING','Yes','sequelize'];(function(_0xf3cbad,_0x201fdb){var _0x27866f=function(_0x143bc4){while(--_0x143bc4){_0xf3cbad['push'](_0xf3cbad['shift']());}};_0x27866f(++_0x201fdb);}(_0x906b,0xb7));var _0xb906=function(_0x210d7f,_0x2abe4f){_0x210d7f=_0x210d7f-0x0;var _0x42d687=_0x906b[_0x210d7f];return _0x42d687;};'use strict';var Sequelize=require(_0xb906('0x0'));var moment=require(_0xb906('0x1'));module[_0xb906('0x2')]={'type':{'type':Sequelize[_0xb906('0x3')](_0xb906('0x4'),_0xb906('0x5'))},'result':{'type':Sequelize[_0xb906('0x6')]},'transfererchannel':{'type':Sequelize[_0xb906('0x6')]},'transferercalleridnum':{'type':Sequelize[_0xb906('0x6')]},'transferercalleridname':{'type':Sequelize[_0xb906('0x6')]},'transfererconnectedlinenum':{'type':Sequelize[_0xb906('0x6')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0xb906('0x6')]},'transferercontext':{'type':Sequelize[_0xb906('0x6')]},'transfererexten':{'type':Sequelize[_0xb906('0x6')]},'transfererlinkedid':{'type':Sequelize[_0xb906('0x6')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0xb906('0x6')]},'transfereecalleridname':{'type':Sequelize[_0xb906('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0xb906('0x6')]},'transfereeaccountcode':{'type':Sequelize[_0xb906('0x6')]},'transfereecontext':{'type':Sequelize[_0xb906('0x6')]},'transfereeexten':{'type':Sequelize[_0xb906('0x6')]},'transfereelinkedid':{'type':Sequelize[_0xb906('0x6')]},'isexternal':{'type':Sequelize['ENUM'](_0xb906('0x7'),'No')},'context':{'type':Sequelize[_0xb906('0x6')]},'extension':{'type':Sequelize[_0xb906('0x6')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index e2e92fa..bb09d92 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 _0xe8c5=['find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','sendStatus','error','stack','name','VoiceTransferReport','fieldName','key','model','query','keys','filters','attributes','length','sort','where','pick','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','intersection','fields'];(function(_0x5ec3fa,_0xb78b4c){var _0x56aebe=function(_0x192f73){while(--_0x192f73){_0x5ec3fa['push'](_0x5ec3fa['shift']());}};_0x56aebe(++_0xb78b4c);}(_0xe8c5,0x171));var _0x5e8c=function(_0x2b7131,_0x1c5d88){_0x2b7131=_0x2b7131-0x0;var _0xabc9ff=_0xe8c5[_0x2b7131];return _0xabc9ff;};'use strict';var emlformat=require(_0x5e8c('0x0'));var rimraf=require(_0x5e8c('0x1'));var zipdir=require(_0x5e8c('0x2'));var jsonpatch=require(_0x5e8c('0x3'));var rp=require(_0x5e8c('0x4'));var moment=require(_0x5e8c('0x5'));var BPromise=require(_0x5e8c('0x6'));var Mustache=require(_0x5e8c('0x7'));var util=require(_0x5e8c('0x8'));var path=require(_0x5e8c('0x9'));var sox=require('sox');var csv=require(_0x5e8c('0xa'));var ejs=require(_0x5e8c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5e8c('0xc'));var squel=require(_0x5e8c('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5e8c('0xe'));var toCsv=require(_0x5e8c('0xa'));var querystring=require(_0x5e8c('0xf'));var Papa=require(_0x5e8c('0x10'));var Redis=require(_0x5e8c('0x11'));var authService=require(_0x5e8c('0x12'));var qs=require(_0x5e8c('0x13'));var as=require(_0x5e8c('0x14'));var hardwareService=require(_0x5e8c('0x15'));var logger=require(_0x5e8c('0x16'))('api');var utils=require(_0x5e8c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5e8c('0x18'));var db=require(_0x5e8c('0x19'))['db'];function respondWithStatusCode(_0x3f7412,_0x1a151a){_0x1a151a=_0x1a151a||0xcc;return function(_0x4fe89b){if(_0x4fe89b){return _0x3f7412['sendStatus'](_0x1a151a);}return _0x3f7412[_0x5e8c('0x1a')](_0x1a151a)['end']();};}function respondWithResult(_0x4336d7,_0x44e3c5){_0x44e3c5=_0x44e3c5||0xc8;return function(_0x5dec74){if(_0x5dec74){return _0x4336d7[_0x5e8c('0x1a')](_0x44e3c5)[_0x5e8c('0x1b')](_0x5dec74);}};}function respondWithFilteredResult(_0x33ebb1,_0x42c959){return function(_0x32c3b5){if(_0x32c3b5){var _0x2c25e9=typeof _0x42c959[_0x5e8c('0x1c')]===_0x5e8c('0x1d')&&typeof _0x42c959[_0x5e8c('0x1e')]===_0x5e8c('0x1d');var _0x23bb02=_0x32c3b5[_0x5e8c('0x1f')];var _0xe87312=_0x2c25e9?0x0:_0x42c959['offset'];var _0xd85092=_0x2c25e9?_0x32c3b5[_0x5e8c('0x1f')]:_0x42c959['offset']+_0x42c959[_0x5e8c('0x1e')];var _0x2c264b;if(_0xd85092>=_0x23bb02){_0xd85092=_0x23bb02;_0x2c264b=0xc8;}else{_0x2c264b=0xce;}_0x33ebb1[_0x5e8c('0x1a')](_0x2c264b);return _0x33ebb1[_0x5e8c('0x20')](_0x5e8c('0x21'),_0xe87312+'-'+_0xd85092+'/'+_0x23bb02)[_0x5e8c('0x1b')](_0x32c3b5);}return null;};}function patchUpdates(_0x43f058){return function(_0xa36f4c){try{jsonpatch['apply'](_0xa36f4c,_0x43f058,!![]);}catch(_0x44f6f1){return BPromise[_0x5e8c('0x22')](_0x44f6f1);}return _0xa36f4c[_0x5e8c('0x23')]();};}function saveUpdates(_0x2adc52,_0x955ba0){return function(_0x5b5a25){if(_0x5b5a25){return _0x5b5a25[_0x5e8c('0x24')](_0x2adc52)[_0x5e8c('0x25')](function(_0x4e0a94){return _0x4e0a94;});}return null;};}function removeEntity(_0x3d2363,_0x13dcd9){return function(_0x500555){if(_0x500555){return _0x500555[_0x5e8c('0x26')]()[_0x5e8c('0x25')](function(){_0x3d2363[_0x5e8c('0x1a')](0xcc)[_0x5e8c('0x27')]();});}};}function handleEntityNotFound(_0x53b6de,_0x1c17c5){return function(_0x463b7f){if(!_0x463b7f){_0x53b6de[_0x5e8c('0x28')](0x194);}return _0x463b7f;};}function handleError(_0x786596,_0x182159){_0x182159=_0x182159||0x1f4;return function(_0x50eac7){logger[_0x5e8c('0x29')](_0x50eac7[_0x5e8c('0x2a')]);if(_0x50eac7[_0x5e8c('0x2b')]){delete _0x50eac7['name'];}_0x786596[_0x5e8c('0x1a')](_0x182159)['send'](_0x50eac7);};}exports['index']=function(_0x360a29,_0x325686){var _0x40e811={},_0x40384f={},_0x10958d={'count':0x0,'rows':[]};var _0x52ae07=_['map'](db[_0x5e8c('0x2c')]['rawAttributes'],function(_0x4a3383){return{'name':_0x4a3383[_0x5e8c('0x2d')],'type':_0x4a3383['type'][_0x5e8c('0x2e')]};});_0x40384f[_0x5e8c('0x2f')]=_['map'](_0x52ae07,_0x5e8c('0x2b'));_0x40384f[_0x5e8c('0x30')]=_[_0x5e8c('0x31')](_0x360a29[_0x5e8c('0x30')]);_0x40384f[_0x5e8c('0x32')]=_['intersection'](_0x40384f[_0x5e8c('0x2f')],_0x40384f[_0x5e8c('0x30')]);_0x40e811[_0x5e8c('0x33')]=_['intersection'](_0x40384f[_0x5e8c('0x2f')],qs['fields'](_0x360a29[_0x5e8c('0x30')]['fields']));_0x40e811[_0x5e8c('0x33')]=_0x40e811[_0x5e8c('0x33')][_0x5e8c('0x34')]?_0x40e811[_0x5e8c('0x33')]:_0x40384f[_0x5e8c('0x2f')];if(!_0x360a29[_0x5e8c('0x30')]['hasOwnProperty']('nolimit')){_0x40e811[_0x5e8c('0x1e')]=qs[_0x5e8c('0x1e')](_0x360a29[_0x5e8c('0x30')]['limit']);_0x40e811[_0x5e8c('0x1c')]=qs[_0x5e8c('0x1c')](_0x360a29[_0x5e8c('0x30')][_0x5e8c('0x1c')]);}_0x40e811['order']=qs[_0x5e8c('0x35')](_0x360a29[_0x5e8c('0x30')][_0x5e8c('0x35')]);_0x40e811[_0x5e8c('0x36')]=qs[_0x5e8c('0x32')](_[_0x5e8c('0x37')](_0x360a29[_0x5e8c('0x30')],_0x40384f[_0x5e8c('0x32')]),_0x52ae07);if(_0x360a29[_0x5e8c('0x30')]['filter']){_0x40e811[_0x5e8c('0x36')]=_['merge'](_0x40e811[_0x5e8c('0x36')],{'$or':_['map'](_0x52ae07,function(_0x49f3f0){if(_0x49f3f0[_0x5e8c('0x38')]!==_0x5e8c('0x39')){var _0x590475={};_0x590475[_0x49f3f0['name']]={'$like':'%'+_0x360a29[_0x5e8c('0x30')]['filter']+'%'};return _0x590475;}})});}_0x40e811=_[_0x5e8c('0x3a')]({},_0x40e811,_0x360a29[_0x5e8c('0x3b')]);var _0x27360d={'where':_0x40e811[_0x5e8c('0x36')]};return db['VoiceTransferReport']['count'](_0x27360d)[_0x5e8c('0x25')](function(_0xb2f023){_0x10958d[_0x5e8c('0x1f')]=_0xb2f023;if(_0x360a29[_0x5e8c('0x30')][_0x5e8c('0x3c')]){_0x40e811[_0x5e8c('0x3d')]=[{'all':!![]}];}return db[_0x5e8c('0x2c')][_0x5e8c('0x3e')](_0x40e811);})[_0x5e8c('0x25')](function(_0x54fa83){_0x10958d[_0x5e8c('0x3f')]=_0x54fa83;return _0x10958d;})[_0x5e8c('0x25')](respondWithFilteredResult(_0x325686,_0x40e811))[_0x5e8c('0x40')](handleError(_0x325686,null));};exports['show']=function(_0x1228f0,_0x2bc9e2){var _0x280581={'raw':!![],'where':{'id':_0x1228f0[_0x5e8c('0x41')]['id']}},_0x3afb4={};_0x3afb4[_0x5e8c('0x2f')]=_['keys'](db[_0x5e8c('0x2c')][_0x5e8c('0x42')]);_0x3afb4[_0x5e8c('0x30')]=_[_0x5e8c('0x31')](_0x1228f0[_0x5e8c('0x30')]);_0x3afb4[_0x5e8c('0x32')]=_[_0x5e8c('0x43')](_0x3afb4[_0x5e8c('0x2f')],_0x3afb4[_0x5e8c('0x30')]);_0x280581['attributes']=_[_0x5e8c('0x43')](_0x3afb4[_0x5e8c('0x2f')],qs['fields'](_0x1228f0['query'][_0x5e8c('0x44')]));_0x280581['attributes']=_0x280581[_0x5e8c('0x33')]['length']?_0x280581['attributes']:_0x3afb4[_0x5e8c('0x2f')];if(_0x1228f0[_0x5e8c('0x30')][_0x5e8c('0x3c')]){_0x280581[_0x5e8c('0x3d')]=[{'all':!![]}];}_0x280581=_['merge']({},_0x280581,_0x1228f0['options']);return db[_0x5e8c('0x2c')][_0x5e8c('0x45')](_0x280581)[_0x5e8c('0x25')](handleEntityNotFound(_0x2bc9e2,null))[_0x5e8c('0x25')](respondWithResult(_0x2bc9e2,null))[_0x5e8c('0x40')](handleError(_0x2bc9e2,null));};exports[_0x5e8c('0x46')]=function(_0x1b764f,_0x9a37f9){return db[_0x5e8c('0x2c')]['create'](_0x1b764f[_0x5e8c('0x47')],{})[_0x5e8c('0x25')](respondWithResult(_0x9a37f9,0xc9))[_0x5e8c('0x40')](handleError(_0x9a37f9,null));};exports['update']=function(_0x4b7a66,_0x3a27f9){if(_0x4b7a66[_0x5e8c('0x47')]['id']){delete _0x4b7a66['body']['id'];}return db[_0x5e8c('0x2c')][_0x5e8c('0x45')]({'where':{'id':_0x4b7a66[_0x5e8c('0x41')]['id']}})[_0x5e8c('0x25')](handleEntityNotFound(_0x3a27f9,null))[_0x5e8c('0x25')](saveUpdates(_0x4b7a66['body'],null))[_0x5e8c('0x25')](respondWithResult(_0x3a27f9,null))[_0x5e8c('0x40')](handleError(_0x3a27f9,null));};exports[_0x5e8c('0x26')]=function(_0x43cdb3,_0x4399a2){return db['VoiceTransferReport'][_0x5e8c('0x45')]({'where':{'id':_0x43cdb3['params']['id']}})[_0x5e8c('0x25')](handleEntityNotFound(_0x4399a2,null))[_0x5e8c('0x25')](removeEntity(_0x4399a2,null))[_0x5e8c('0x40')](handleError(_0x4399a2,null));};exports[_0x5e8c('0x48')]=function(_0x21d271,_0x534736){return db[_0x5e8c('0x2c')]['describe']()[_0x5e8c('0x25')](respondWithResult(_0x534736,null))[_0x5e8c('0x40')](handleError(_0x534736,null));}; \ No newline at end of file +var _0xe129=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','VoiceTransferReport','rows','catch','params','options','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x232cc5,_0x49cce0){var _0x270ad1=function(_0x286598){while(--_0x286598){_0x232cc5['push'](_0x232cc5['shift']());}};_0x270ad1(++_0x49cce0);}(_0xe129,0x8f));var _0x9e12=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe129[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9e12('0x0'));var zipdir=require(_0x9e12('0x1'));var jsonpatch=require(_0x9e12('0x2'));var rp=require(_0x9e12('0x3'));var moment=require(_0x9e12('0x4'));var BPromise=require(_0x9e12('0x5'));var Mustache=require(_0x9e12('0x6'));var util=require(_0x9e12('0x7'));var path=require(_0x9e12('0x8'));var sox=require(_0x9e12('0x9'));var csv=require(_0x9e12('0xa'));var ejs=require(_0x9e12('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9e12('0xc'));var squel=require(_0x9e12('0xd'));var crypto=require(_0x9e12('0xe'));var jsforce=require(_0x9e12('0xf'));var deskjs=require(_0x9e12('0x10'));var toCsv=require(_0x9e12('0xa'));var querystring=require(_0x9e12('0x11'));var Papa=require(_0x9e12('0x12'));var Redis=require(_0x9e12('0x13'));var authService=require(_0x9e12('0x14'));var qs=require(_0x9e12('0x15'));var as=require(_0x9e12('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x9e12('0x17'));var config=require(_0x9e12('0x18'));var licenseUtil=require(_0x9e12('0x19'));var db=require(_0x9e12('0x1a'))['db'];function respondWithStatusCode(_0x39ee9a,_0x10f8d2){_0x10f8d2=_0x10f8d2||0xcc;return function(_0x25c973){if(_0x25c973){return _0x39ee9a[_0x9e12('0x1b')](_0x10f8d2);}return _0x39ee9a[_0x9e12('0x1c')](_0x10f8d2)['end']();};}function respondWithResult(_0x191db6,_0x819490){_0x819490=_0x819490||0xc8;return function(_0x21c35b){if(_0x21c35b){return _0x191db6[_0x9e12('0x1c')](_0x819490)[_0x9e12('0x1d')](_0x21c35b);}};}function respondWithFilteredResult(_0x28acbe,_0x5a96c4){return function(_0x8e00a4){if(_0x8e00a4){var _0x2b4f6b=typeof _0x5a96c4[_0x9e12('0x1e')]===_0x9e12('0x1f')&&typeof _0x5a96c4[_0x9e12('0x20')]==='undefined';var _0x470113=_0x8e00a4[_0x9e12('0x21')];var _0x40d8d5=_0x2b4f6b?0x0:_0x5a96c4[_0x9e12('0x1e')];var _0x4d88b=_0x2b4f6b?_0x8e00a4[_0x9e12('0x21')]:_0x5a96c4['offset']+_0x5a96c4[_0x9e12('0x20')];var _0x5065d1;if(_0x4d88b>=_0x470113){_0x4d88b=_0x470113;_0x5065d1=0xc8;}else{_0x5065d1=0xce;}_0x28acbe[_0x9e12('0x1c')](_0x5065d1);return _0x28acbe[_0x9e12('0x22')]('Content-Range',_0x40d8d5+'-'+_0x4d88b+'/'+_0x470113)[_0x9e12('0x1d')](_0x8e00a4);}return null;};}function patchUpdates(_0x1bba81){return function(_0x145518){try{jsonpatch[_0x9e12('0x23')](_0x145518,_0x1bba81,!![]);}catch(_0x38ccb9){return BPromise[_0x9e12('0x24')](_0x38ccb9);}return _0x145518[_0x9e12('0x25')]();};}function saveUpdates(_0x5eb74f,_0x3ee6a7){return function(_0x15b79a){if(_0x15b79a){return _0x15b79a[_0x9e12('0x26')](_0x5eb74f)[_0x9e12('0x27')](function(_0x25037a){return _0x25037a;});}return null;};}function removeEntity(_0x18292b,_0x15a683){return function(_0x2d45dd){if(_0x2d45dd){return _0x2d45dd[_0x9e12('0x28')]()[_0x9e12('0x27')](function(){_0x18292b[_0x9e12('0x1c')](0xcc)[_0x9e12('0x29')]();});}};}function handleEntityNotFound(_0x5cb60b,_0x3fdced){return function(_0x37c84b){if(!_0x37c84b){_0x5cb60b[_0x9e12('0x1b')](0x194);}return _0x37c84b;};}function handleError(_0x2ded27,_0x1a1337){_0x1a1337=_0x1a1337||0x1f4;return function(_0x1b4465){logger[_0x9e12('0x2a')](_0x1b4465[_0x9e12('0x2b')]);if(_0x1b4465['name']){delete _0x1b4465[_0x9e12('0x2c')];}_0x2ded27[_0x9e12('0x1c')](_0x1a1337)[_0x9e12('0x2d')](_0x1b4465);};}exports[_0x9e12('0x2e')]=function(_0x11c4ce,_0x19e2f0){var _0x4be360={},_0x21273e={},_0x3df1ef={'count':0x0,'rows':[]};var _0x35530f=_[_0x9e12('0x2f')](db['VoiceTransferReport'][_0x9e12('0x30')],function(_0x5b9824){return{'name':_0x5b9824[_0x9e12('0x31')],'type':_0x5b9824[_0x9e12('0x32')][_0x9e12('0x33')]};});_0x21273e[_0x9e12('0x34')]=_[_0x9e12('0x2f')](_0x35530f,_0x9e12('0x2c'));_0x21273e[_0x9e12('0x35')]=_[_0x9e12('0x36')](_0x11c4ce[_0x9e12('0x35')]);_0x21273e[_0x9e12('0x37')]=_[_0x9e12('0x38')](_0x21273e[_0x9e12('0x34')],_0x21273e[_0x9e12('0x35')]);_0x4be360[_0x9e12('0x39')]=_[_0x9e12('0x38')](_0x21273e['model'],qs[_0x9e12('0x3a')](_0x11c4ce[_0x9e12('0x35')][_0x9e12('0x3a')]));_0x4be360['attributes']=_0x4be360[_0x9e12('0x39')][_0x9e12('0x3b')]?_0x4be360[_0x9e12('0x39')]:_0x21273e[_0x9e12('0x34')];if(!_0x11c4ce[_0x9e12('0x35')][_0x9e12('0x3c')](_0x9e12('0x3d'))){_0x4be360[_0x9e12('0x20')]=qs['limit'](_0x11c4ce[_0x9e12('0x35')][_0x9e12('0x20')]);_0x4be360[_0x9e12('0x1e')]=qs['offset'](_0x11c4ce[_0x9e12('0x35')][_0x9e12('0x1e')]);}_0x4be360[_0x9e12('0x3e')]=qs[_0x9e12('0x3f')](_0x11c4ce[_0x9e12('0x35')]['sort']);_0x4be360[_0x9e12('0x40')]=qs[_0x9e12('0x37')](_[_0x9e12('0x41')](_0x11c4ce[_0x9e12('0x35')],_0x21273e[_0x9e12('0x37')]),_0x35530f);if(_0x11c4ce[_0x9e12('0x35')][_0x9e12('0x42')]){_0x4be360['where']=_[_0x9e12('0x43')](_0x4be360['where'],{'$or':_[_0x9e12('0x2f')](_0x35530f,function(_0x3ad01b){if(_0x3ad01b['type']!==_0x9e12('0x44')){var _0x29c414={};_0x29c414[_0x3ad01b[_0x9e12('0x2c')]]={'$like':'%'+_0x11c4ce['query']['filter']+'%'};return _0x29c414;}})});}_0x4be360=_[_0x9e12('0x43')]({},_0x4be360,_0x11c4ce['options']);var _0x2006b7={'where':_0x4be360[_0x9e12('0x40')]};return db['VoiceTransferReport'][_0x9e12('0x21')](_0x2006b7)[_0x9e12('0x27')](function(_0x265720){_0x3df1ef['count']=_0x265720;if(_0x11c4ce[_0x9e12('0x35')][_0x9e12('0x45')]){_0x4be360[_0x9e12('0x46')]=[{'all':!![]}];}return db[_0x9e12('0x47')]['findAll'](_0x4be360);})['then'](function(_0x53171d){_0x3df1ef[_0x9e12('0x48')]=_0x53171d;return _0x3df1ef;})['then'](respondWithFilteredResult(_0x19e2f0,_0x4be360))[_0x9e12('0x49')](handleError(_0x19e2f0,null));};exports['show']=function(_0x410129,_0x163e6d){var _0x4b91c5={'raw':!![],'where':{'id':_0x410129[_0x9e12('0x4a')]['id']}},_0x3a76e4={};_0x3a76e4[_0x9e12('0x34')]=_[_0x9e12('0x36')](db[_0x9e12('0x47')]['rawAttributes']);_0x3a76e4[_0x9e12('0x35')]=_['keys'](_0x410129[_0x9e12('0x35')]);_0x3a76e4['filters']=_[_0x9e12('0x38')](_0x3a76e4[_0x9e12('0x34')],_0x3a76e4[_0x9e12('0x35')]);_0x4b91c5[_0x9e12('0x39')]=_['intersection'](_0x3a76e4['model'],qs['fields'](_0x410129[_0x9e12('0x35')][_0x9e12('0x3a')]));_0x4b91c5['attributes']=_0x4b91c5[_0x9e12('0x39')]['length']?_0x4b91c5[_0x9e12('0x39')]:_0x3a76e4[_0x9e12('0x34')];if(_0x410129['query'][_0x9e12('0x45')]){_0x4b91c5['include']=[{'all':!![]}];}_0x4b91c5=_[_0x9e12('0x43')]({},_0x4b91c5,_0x410129[_0x9e12('0x4b')]);return db[_0x9e12('0x47')]['find'](_0x4b91c5)['then'](handleEntityNotFound(_0x163e6d,null))[_0x9e12('0x27')](respondWithResult(_0x163e6d,null))[_0x9e12('0x49')](handleError(_0x163e6d,null));};exports[_0x9e12('0x4c')]=function(_0x8429ce,_0x24e8c2){return db['VoiceTransferReport']['create'](_0x8429ce[_0x9e12('0x4d')],{})['then'](respondWithResult(_0x24e8c2,0xc9))[_0x9e12('0x49')](handleError(_0x24e8c2,null));};exports[_0x9e12('0x26')]=function(_0x6f2b89,_0x48ca32){if(_0x6f2b89[_0x9e12('0x4d')]['id']){delete _0x6f2b89[_0x9e12('0x4d')]['id'];}return db['VoiceTransferReport'][_0x9e12('0x4e')]({'where':{'id':_0x6f2b89[_0x9e12('0x4a')]['id']}})[_0x9e12('0x27')](handleEntityNotFound(_0x48ca32,null))[_0x9e12('0x27')](saveUpdates(_0x6f2b89['body'],null))[_0x9e12('0x27')](respondWithResult(_0x48ca32,null))[_0x9e12('0x49')](handleError(_0x48ca32,null));};exports[_0x9e12('0x28')]=function(_0x4b7b91,_0x5600ff){return db['VoiceTransferReport'][_0x9e12('0x4e')]({'where':{'id':_0x4b7b91[_0x9e12('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5600ff,null))[_0x9e12('0x27')](removeEntity(_0x5600ff,null))[_0x9e12('0x49')](handleError(_0x5600ff,null));};exports['describe']=function(_0x3c844e,_0x1f7a83){return db[_0x9e12('0x47')][_0x9e12('0x4f')]()[_0x9e12('0x27')](respondWithResult(_0x1f7a83,null))['catch'](handleError(_0x1f7a83,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 41f2f00..3f0c2ea 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 _0xe803=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','VoiceTransferReport','report_call_transfer'];(function(_0x421cf8,_0x23152c){var _0x145c48=function(_0x565862){while(--_0x565862){_0x421cf8['push'](_0x421cf8['shift']());}};_0x145c48(++_0x23152c);}(_0xe803,0x118));var _0x3e80=function(_0x1cb495,_0x179047){_0x1cb495=_0x1cb495-0x0;var _0xaf4acb=_0xe803[_0x1cb495];return _0xaf4acb;};'use strict';var _=require('lodash');var util=require(_0x3e80('0x0'));var logger=require(_0x3e80('0x1'))('api');var moment=require(_0x3e80('0x2'));var BPromise=require('bluebird');var rp=require(_0x3e80('0x3'));var fs=require('fs');var path=require(_0x3e80('0x4'));var rimraf=require(_0x3e80('0x5'));var config=require(_0x3e80('0x6'));var attributes=require(_0x3e80('0x7'));module['exports']=function(_0x5abc90,_0x43d980){return _0x5abc90['define'](_0x3e80('0x8'),attributes,{'tableName':_0x3e80('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0aec=['./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xed798f,_0x43a4a2){var _0x427fd9=function(_0xe8bd10){while(--_0xe8bd10){_0xed798f['push'](_0xed798f['shift']());}};_0x427fd9(++_0x43a4a2);}(_0x0aec,0x87));var _0xc0ae=function(_0x1d8687,_0x212ee9){_0x1d8687=_0x1d8687-0x0;var _0x4a4a03=_0x0aec[_0x1d8687];return _0x4a4a03;};'use strict';var _=require('lodash');var util=require(_0xc0ae('0x0'));var logger=require(_0xc0ae('0x1'))(_0xc0ae('0x2'));var moment=require(_0xc0ae('0x3'));var BPromise=require(_0xc0ae('0x4'));var rp=require(_0xc0ae('0x5'));var fs=require('fs');var path=require(_0xc0ae('0x6'));var rimraf=require(_0xc0ae('0x7'));var config=require('../../config/environment');var attributes=require(_0xc0ae('0x8'));module[_0xc0ae('0x9')]=function(_0x3460a7,_0x515ca9){return _0x3460a7[_0xc0ae('0xa')](_0xc0ae('0xb'),attributes,{'tableName':_0xc0ae('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 6ee9ea2..a33f89b 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 _0x134c=['VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3c7cc4,_0x358aa5){var _0x2ccad1=function(_0xcaa069){while(--_0xcaa069){_0x3c7cc4['push'](_0x3c7cc4['shift']());}};_0x2ccad1(++_0x358aa5);}(_0x134c,0x1a2));var _0xc134=function(_0x2575eb,_0x456f3f){_0x2575eb=_0x2575eb-0x0;var _0x1c49da=_0x134c[_0x2575eb];return _0x1c49da;};'use strict';var _=require(_0xc134('0x0'));var util=require('util');var moment=require(_0xc134('0x1'));var BPromise=require('bluebird');var rs=require(_0xc134('0x2'));var fs=require('fs');var Redis=require(_0xc134('0x3'));var db=require(_0xc134('0x4'))['db'];var utils=require(_0xc134('0x5'));var logger=require(_0xc134('0x6'))(_0xc134('0x7'));var config=require(_0xc134('0x8'));var jayson=require(_0xc134('0x9'));var client=jayson[_0xc134('0xa')][_0xc134('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x280700,_0x17d262,_0x5122dd){return new BPromise(function(_0x291c6c,_0x237845){return client['request'](_0x280700,_0x5122dd)[_0xc134('0xc')](function(_0x432cef){logger[_0xc134('0xd')](_0xc134('0xe'),_0x17d262,_0xc134('0xf'));logger[_0xc134('0x10')](_0xc134('0x11'),_0x17d262,'request\x20sent',JSON[_0xc134('0x12')](_0x432cef));if(_0x432cef[_0xc134('0x13')]){if(_0x432cef[_0xc134('0x13')]['code']===0x1f4){logger[_0xc134('0x13')](_0xc134('0xe'),_0x17d262,_0x432cef[_0xc134('0x13')]['message']);return _0x237845(_0x432cef[_0xc134('0x13')][_0xc134('0x14')]);}logger[_0xc134('0x13')](_0xc134('0xe'),_0x17d262,_0x432cef[_0xc134('0x13')][_0xc134('0x14')]);return _0x291c6c(_0x432cef[_0xc134('0x13')][_0xc134('0x14')]);}else{logger[_0xc134('0xd')](_0xc134('0xe'),_0x17d262,_0xc134('0xf'));_0x291c6c(_0x432cef[_0xc134('0x15')][_0xc134('0x14')]);}})['catch'](function(_0x10deff){logger[_0xc134('0x13')](_0xc134('0xe'),_0x17d262,_0x10deff);_0x237845(_0x10deff);});});}exports[_0xc134('0x16')]=function(_0x53e31d){var _0x25a274=this;return new Promise(function(_0x9ff4b7,_0x3a8e5f){return db[_0xc134('0x17')][_0xc134('0x18')](_0x53e31d[_0xc134('0x19')],{'raw':_0x53e31d[_0xc134('0x1a')]?_0x53e31d[_0xc134('0x1a')][_0xc134('0x1b')]===undefined?!![]:![]:!![]})[_0xc134('0xc')](function(_0x4d4e5f){logger[_0xc134('0xd')](_0xc134('0x16'),_0x53e31d);logger[_0xc134('0x10')](_0xc134('0x16'),_0x53e31d,JSON[_0xc134('0x12')](_0x4d4e5f));_0x9ff4b7(_0x4d4e5f);})[_0xc134('0x1c')](function(_0x38869b){logger[_0xc134('0x13')]('CreateVoiceTransferReport',_0x38869b[_0xc134('0x14')],_0x53e31d);_0x3a8e5f(_0x25a274[_0xc134('0x13')](0x1f4,_0x38869b['message']));});});}; \ No newline at end of file +var _0xa0d8=['util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','options','raw','CreateVoiceTransferReport','stringify','lodash'];(function(_0x337af1,_0x2b1114){var _0x13040d=function(_0x3aa68a){while(--_0x3aa68a){_0x337af1['push'](_0x337af1['shift']());}};_0x13040d(++_0x2b1114);}(_0xa0d8,0x19d));var _0x8a0d=function(_0x5d3b5e,_0x4e9cf6){_0x5d3b5e=_0x5d3b5e-0x0;var _0x44f917=_0xa0d8[_0x5d3b5e];return _0x44f917;};'use strict';var _=require(_0x8a0d('0x0'));var util=require(_0x8a0d('0x1'));var moment=require(_0x8a0d('0x2'));var BPromise=require(_0x8a0d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a0d('0x4'));var db=require(_0x8a0d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8a0d('0x6'))(_0x8a0d('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8a0d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x69d3b7,_0x37963d,_0x12068d){return new BPromise(function(_0x41c013,_0x124967){return client[_0x8a0d('0x9')](_0x69d3b7,_0x12068d)[_0x8a0d('0xa')](function(_0x313c36){logger[_0x8a0d('0xb')](_0x8a0d('0xc'),_0x37963d,_0x8a0d('0xd'));logger[_0x8a0d('0xe')](_0x8a0d('0xf'),_0x37963d,'request\x20sent',JSON['stringify'](_0x313c36));if(_0x313c36[_0x8a0d('0x10')]){if(_0x313c36['error']['code']===0x1f4){logger[_0x8a0d('0x10')](_0x8a0d('0xc'),_0x37963d,_0x313c36[_0x8a0d('0x10')][_0x8a0d('0x11')]);return _0x124967(_0x313c36[_0x8a0d('0x10')][_0x8a0d('0x11')]);}logger[_0x8a0d('0x10')](_0x8a0d('0xc'),_0x37963d,_0x313c36['error'][_0x8a0d('0x11')]);return _0x41c013(_0x313c36[_0x8a0d('0x10')]['message']);}else{logger[_0x8a0d('0xb')](_0x8a0d('0xc'),_0x37963d,'request\x20sent');_0x41c013(_0x313c36[_0x8a0d('0x12')][_0x8a0d('0x11')]);}})['catch'](function(_0x5d739f){logger['error'](_0x8a0d('0xc'),_0x37963d,_0x5d739f);_0x124967(_0x5d739f);});});}exports['CreateVoiceTransferReport']=function(_0x5c2f39){var _0x3abf97=this;return new Promise(function(_0x43eb08,_0x1a2813){return db['VoiceTransferReport']['create'](_0x5c2f39['body'],{'raw':_0x5c2f39[_0x8a0d('0x13')]?_0x5c2f39[_0x8a0d('0x13')][_0x8a0d('0x14')]===undefined?!![]:![]:!![]})[_0x8a0d('0xa')](function(_0x20177e){logger['info']('CreateVoiceTransferReport',_0x5c2f39);logger[_0x8a0d('0xe')](_0x8a0d('0x15'),_0x5c2f39,JSON[_0x8a0d('0x16')](_0x20177e));_0x43eb08(_0x20177e);})['catch'](function(_0x18cbf3){logger[_0x8a0d('0x10')](_0x8a0d('0x15'),_0x18cbf3['message'],_0x5c2f39);_0x1a2813(_0x3abf97[_0x8a0d('0x10')](0x1f4,_0x18cbf3[_0x8a0d('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 7afa94a..c20c6ef 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 _0xb235=['/originate','isAuthenticated','originate','/answer','canUpdate','answer','/hold','/unhold','unhold','/calls','/transfer','transfer','express','Router','../../components/auth/service','./webbar.controller','post'];(function(_0x68bb73,_0x18b417){var _0x558663=function(_0x1edba7){while(--_0x1edba7){_0x68bb73['push'](_0x68bb73['shift']());}};_0x558663(++_0x18b417);}(_0xb235,0x171));var _0x5b23=function(_0x10b4f2,_0x2d4ec8){_0x10b4f2=_0x10b4f2-0x0;var _0x1d9640=_0xb235[_0x10b4f2];return _0x1d9640;};'use strict';var express=require(_0x5b23('0x0'));var router=express[_0x5b23('0x1')]();var auth=require(_0x5b23('0x2'));var controller=require(_0x5b23('0x3'));router[_0x5b23('0x4')](_0x5b23('0x5'),auth[_0x5b23('0x6')](),auth['canUpdate'](),controller[_0x5b23('0x7')]);router[_0x5b23('0x4')]('/hangup',auth[_0x5b23('0x6')](),auth['canUpdate'](),controller['hangup']);router[_0x5b23('0x4')](_0x5b23('0x8'),auth[_0x5b23('0x6')](),auth[_0x5b23('0x9')](),controller[_0x5b23('0xa')]);router[_0x5b23('0x4')](_0x5b23('0xb'),auth[_0x5b23('0x6')](),auth[_0x5b23('0x9')](),controller['hold']);router['post'](_0x5b23('0xc'),auth[_0x5b23('0x6')](),auth[_0x5b23('0x9')](),controller[_0x5b23('0xd')]);router[_0x5b23('0x4')](_0x5b23('0xe'),auth[_0x5b23('0x6')](),auth[_0x5b23('0x9')](),controller['calls']);router['post'](_0x5b23('0xf'),auth[_0x5b23('0x6')](),auth[_0x5b23('0x9')](),controller[_0x5b23('0x10')]);module['exports']=router; \ No newline at end of file +var _0x03c1=['Router','../../components/auth/service','./webbar.controller','post','/originate','canUpdate','originate','isAuthenticated','hangup','/answer','hold','unhold','calls','transfer','express'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x03c1,0x149));var _0x103c=function(_0xa03344,_0x581292){_0xa03344=_0xa03344-0x0;var _0x38acfd=_0x03c1[_0xa03344];return _0x38acfd;};'use strict';var express=require(_0x103c('0x0'));var router=express[_0x103c('0x1')]();var auth=require(_0x103c('0x2'));var controller=require(_0x103c('0x3'));router[_0x103c('0x4')](_0x103c('0x5'),auth['isAuthenticated'](),auth[_0x103c('0x6')](),controller[_0x103c('0x7')]);router[_0x103c('0x4')]('/hangup',auth[_0x103c('0x8')](),auth[_0x103c('0x6')](),controller[_0x103c('0x9')]);router['post'](_0x103c('0xa'),auth['isAuthenticated'](),auth[_0x103c('0x6')](),controller['answer']);router[_0x103c('0x4')]('/hold',auth[_0x103c('0x8')](),auth[_0x103c('0x6')](),controller[_0x103c('0xb')]);router['post']('/unhold',auth['isAuthenticated'](),auth[_0x103c('0x6')](),controller[_0x103c('0xc')]);router[_0x103c('0x4')]('/calls',auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x103c('0xd')]);router[_0x103c('0x4')]('/transfer',auth[_0x103c('0x8')](),auth['canUpdate'](),controller[_0x103c('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index c10a77d..de19e97 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 _0xd3d1=['send','NotFound','request','then','error','code','message','result','catch','User','findOne','agent','VoiceChannels','filter','rows','UserId','length','sessionId\x20','originate','originate\x20fired:','body','json','callNumber','callerId','entityFound:','format','user:%s','webbar:originate','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer','userId','webbar:answer','answer\x20executed!','hold','hold\x20fired:','sessionId','webbar:hold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','all','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','callNumber\x20is\x20required','string','sessionId\x20is\x20required','info','handleError:','stack','name','status'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0xd3d1,0x172));var _0x1d3d=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xd3d1[_0x13d07a];return _0x5ee0ee;};'use strict';var path=require(_0x1d3d('0x0'));var fs=require('fs');var _=require(_0x1d3d('0x1'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var util=require(_0x1d3d('0x2'));var BPromise=require(_0x1d3d('0x3'));var jayson=require(_0x1d3d('0x4'));var amiClient=jayson[_0x1d3d('0x5')][_0x1d3d('0x6')]({'port':0x232a});var logger=require(_0x1d3d('0x7'))(_0x1d3d('0x8'));var Redis=require(_0x1d3d('0x9'));config[_0x1d3d('0xa')]=_[_0x1d3d('0xb')](config[_0x1d3d('0xa')],{'host':_0x1d3d('0xc'),'port':0x18eb});var io=require(_0x1d3d('0xd'))(new Redis(config[_0x1d3d('0xa')]));var Schema=require(_0x1d3d('0xe'));var originateValidation=new Schema({'userId':{'type':_0x1d3d('0xf'),'required':[!![],_0x1d3d('0x10')]},'callNumber':{'type':'string','required':[!![],_0x1d3d('0x11')]},'callerId':{'type':_0x1d3d('0x12')},'callbackUrl':{'type':_0x1d3d('0x12')}});var hangupValidation=new Schema({'userId':{'type':_0x1d3d('0xf'),'required':[!![],_0x1d3d('0x10')]},'sessionId':{'type':_0x1d3d('0x12'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x1d3d('0xf'),'required':[!![],_0x1d3d('0x10')]},'sessionId':{'type':_0x1d3d('0x12'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x1d3d('0xf'),'required':[!![],_0x1d3d('0x10')]},'sessionId':{'type':'string','required':[!![],_0x1d3d('0x13')]},'transferNumber':{'type':_0x1d3d('0x12'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x1d3d('0x10')]},'sessionId':{'type':_0x1d3d('0x12'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x1d3d('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x1d3d('0x12'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0x1d3d('0x10')]}});var conferenceValidation=new Schema({'userId':{'type':_0x1d3d('0xf'),'required':[!![],_0x1d3d('0x10')]}});function emit(_0x24bb8c,_0x21c2e4,_0x1bdbdc){logger[_0x1d3d('0x14')](_0x24bb8c,_0x21c2e4,JSON['stringify'](_0x1bdbdc));io['to'](_0x24bb8c)['emit'](_0x21c2e4,_0x1bdbdc);}function handleError(_0x316ab4){return function(_0xe0a583){console['log'](_0x1d3d('0x15'),_0xe0a583,_0xe0a583 instanceof RangeError);logger['error'](_0xe0a583[_0x1d3d('0x16')]);if(_0xe0a583 instanceof RangeError){if(_0xe0a583[_0x1d3d('0x17')]){delete _0xe0a583[_0x1d3d('0x17')];}_0x316ab4[_0x1d3d('0x18')](0x194)['send'](_0xe0a583);}else{if(_0xe0a583[_0x1d3d('0x17')]){delete _0xe0a583['name'];}_0x316ab4['status'](0x1f4)[_0x1d3d('0x19')](_0xe0a583);}};}function checkError(){return function(_0x2bfac3){if(!_0x2bfac3){throw new RangeError(_0x1d3d('0x1a'));}return _0x2bfac3;};}function respondWithRpcPromise(_0x344a03,_0xa6f180){return new BPromise(function(_0xe4afa2,_0x471df5){var _0xa55c43=amiClient;return _0xa55c43[_0x1d3d('0x1b')](_0x344a03,_0xa6f180)[_0x1d3d('0x1c')](function(_0x1610a6){if(_0x1610a6['error']){if(_0x1610a6[_0x1d3d('0x1d')][_0x1d3d('0x1e')]===0x1f4){return _0x471df5(_0x1610a6['error'][_0x1d3d('0x1f')]);}return _0xe4afa2(_0x1610a6['error'][_0x1d3d('0x1f')]);}else{_0xe4afa2(_0x1610a6[_0x1d3d('0x20')]);}})[_0x1d3d('0x21')](function(_0x4235fd){_0x471df5(_0x4235fd);});});}function getAgent(_0x44e03e){return db[_0x1d3d('0x22')][_0x1d3d('0x23')]({'where':{'id':_0x44e03e,'role':_0x1d3d('0x24')}})[_0x1d3d('0x1c')](checkError());}function getAgentCheckSession(_0x2df7b7,_0x172dbd){return new BPromise(function(_0x4f0aa7,_0x3f5681){var _0x5b2986=respondWithRpcPromise(_0x1d3d('0x25'));var _0x2bcc2=getAgent(_0x2df7b7);Promise['all']([_0x5b2986,_0x2bcc2])[_0x1d3d('0x1c')](function(_0x16b7b3){var _0x3cb011=_0x16b7b3[0x0];var _0x2a3812=_0x16b7b3[0x1];var _0x4abbfc=_[_0x1d3d('0x26')](_0x3cb011[_0x1d3d('0x27')],function(_0x5d1b6c){return _0x5d1b6c[_0x1d3d('0x28')]==_0x2a3812['id']&&_0x5d1b6c['sessionId']==_0x172dbd;});if(_0x4abbfc[_0x1d3d('0x29')]==0x1){_0x4f0aa7(_0x2a3812);}else{_0x3f5681(new RangeError(_0x1d3d('0x2a')+_0x172dbd+'\x20not\x20found!'));}});});}exports[_0x1d3d('0x2b')]=function(_0x192f60,_0x102b70){logger[_0x1d3d('0x14')](_0x1d3d('0x2c'),_0x192f60[_0x1d3d('0x2d')]);var _0x4fc03a=originateValidation[_0x1d3d('0xe')](_0x192f60[_0x1d3d('0x2d')]);if(_0x4fc03a['length']>0x0){return _0x102b70[_0x1d3d('0x18')](0x190)[_0x1d3d('0x2e')](_0x4fc03a);}var _0x4017b2=_0x192f60[_0x1d3d('0x2d')]['userId'];var _0x4a1e67=_0x192f60[_0x1d3d('0x2d')][_0x1d3d('0x2f')];var _0x47a8e3=_0x192f60[_0x1d3d('0x2d')][_0x1d3d('0x30')];var _0x2888f9=_0x192f60[_0x1d3d('0x2d')]['callbackUrl'];return getAgent(_0x4017b2)['then'](function(_0x29fa6c){logger['info'](_0x1d3d('0x31'),_0x29fa6c[_0x1d3d('0x17')]);emit(util[_0x1d3d('0x32')](_0x1d3d('0x33'),_0x29fa6c[_0x1d3d('0x17')]),_0x1d3d('0x34'),{'callNumber':_0x4a1e67,'callerId':_0x47a8e3,'callbackUrl':_0x2888f9});return _0x102b70[_0x1d3d('0x18')](0xc8)[_0x1d3d('0x2e')]({'error':![],'message':'originate\x20executed!'});})[_0x1d3d('0x21')](handleError(_0x102b70));};exports['hangup']=function(_0x58ae8e,_0x206e4c){logger['info'](_0x1d3d('0x35'),_0x58ae8e[_0x1d3d('0x2d')]);var _0x182083=hangupValidation[_0x1d3d('0xe')](_0x58ae8e['body']);if(_0x182083['length']>0x0){return _0x206e4c[_0x1d3d('0x18')](0x190)['json'](_0x182083);}var _0x290853=_0x58ae8e[_0x1d3d('0x2d')]['userId'];var _0x1ad7a6=_0x58ae8e[_0x1d3d('0x2d')]['sessionId'];return getAgent(_0x290853)[_0x1d3d('0x1c')](function(_0x40f8ca){logger[_0x1d3d('0x14')](_0x1d3d('0x31'),_0x40f8ca[_0x1d3d('0x17')]);emit(util[_0x1d3d('0x32')]('user:%s',_0x40f8ca[_0x1d3d('0x17')]),_0x1d3d('0x36'),{'sessionId':_0x1ad7a6});return _0x206e4c[_0x1d3d('0x18')](0xc8)[_0x1d3d('0x2e')]({'error':![],'message':_0x1d3d('0x37')});})['catch'](handleError(_0x206e4c));};exports[_0x1d3d('0x38')]=function(_0x2ccba6,_0x1c0cc6){logger[_0x1d3d('0x14')]('answer\x20fired:',_0x2ccba6[_0x1d3d('0x2d')]);var _0x977ea8=answerValidation[_0x1d3d('0xe')](_0x2ccba6[_0x1d3d('0x2d')]);if(_0x977ea8[_0x1d3d('0x29')]>0x0){return _0x1c0cc6['status'](0x190)['json'](_0x977ea8);}var _0x229f48=_0x2ccba6[_0x1d3d('0x2d')][_0x1d3d('0x39')];var _0x66efd=_0x2ccba6[_0x1d3d('0x2d')]['sessionId'];return getAgent(_0x229f48)[_0x1d3d('0x1c')](function(_0x557a25){logger[_0x1d3d('0x14')](_0x1d3d('0x31'),_0x557a25[_0x1d3d('0x17')]);emit(util[_0x1d3d('0x32')]('user:%s',_0x557a25[_0x1d3d('0x17')]),_0x1d3d('0x3a'),{'sessionId':_0x66efd});return _0x1c0cc6[_0x1d3d('0x18')](0xc8)[_0x1d3d('0x2e')]({'error':![],'message':_0x1d3d('0x3b')});})[_0x1d3d('0x21')](handleError(_0x1c0cc6));};exports[_0x1d3d('0x3c')]=function(_0x55aa8a,_0x3c5ccf){logger['info'](_0x1d3d('0x3d'),_0x55aa8a[_0x1d3d('0x2d')]);var _0x5e8ec0=holdValidation[_0x1d3d('0xe')](_0x55aa8a['body']);if(_0x5e8ec0[_0x1d3d('0x29')]>0x0){return _0x3c5ccf['status'](0x190)[_0x1d3d('0x2e')](_0x5e8ec0);}var _0xebd1f4=_0x55aa8a[_0x1d3d('0x2d')][_0x1d3d('0x39')];var _0xea9cf2=_0x55aa8a[_0x1d3d('0x2d')][_0x1d3d('0x3e')];return getAgent(_0xebd1f4)[_0x1d3d('0x1c')](function(_0x59e88a){logger['info']('entityFound:',_0x59e88a[_0x1d3d('0x17')]);emit(util[_0x1d3d('0x32')](_0x1d3d('0x33'),_0x59e88a[_0x1d3d('0x17')]),_0x1d3d('0x3f'),{'sessionId':_0xea9cf2});return _0x3c5ccf[_0x1d3d('0x18')](0xc8)['json']({'error':![],'message':'hold\x20executed!'});})['catch'](handleError(_0x3c5ccf));};exports['unhold']=function(_0x3dc5ca,_0x21620d){logger[_0x1d3d('0x14')](_0x1d3d('0x40'),_0x3dc5ca[_0x1d3d('0x2d')]);var _0x363f4c=unholdValidation[_0x1d3d('0xe')](_0x3dc5ca[_0x1d3d('0x2d')]);if(_0x363f4c[_0x1d3d('0x29')]>0x0){return _0x21620d[_0x1d3d('0x18')](0x190)[_0x1d3d('0x2e')](_0x363f4c);}var _0xb88d59=_0x3dc5ca[_0x1d3d('0x2d')][_0x1d3d('0x39')];var _0x311b05=_0x3dc5ca['body'][_0x1d3d('0x3e')];return getAgent(_0xb88d59)[_0x1d3d('0x1c')](function(_0x1bbfc8){logger[_0x1d3d('0x14')]('entityFound:',_0x1bbfc8[_0x1d3d('0x17')]);emit(util['format']('user:%s',_0x1bbfc8[_0x1d3d('0x17')]),_0x1d3d('0x41'),{'sessionId':_0x311b05});return _0x21620d['status'](0xc8)[_0x1d3d('0x2e')]({'error':![],'message':_0x1d3d('0x42')});})['catch'](handleError(_0x21620d));};exports[_0x1d3d('0x43')]=function(_0x7af4dd,_0x15d9b4){logger[_0x1d3d('0x14')](_0x1d3d('0x44'),_0x15d9b4[_0x1d3d('0x2d')]);var _0x213b0b=callsValidation[_0x1d3d('0xe')](_0x7af4dd[_0x1d3d('0x2d')]);if(_0x213b0b['length']>0x0){return _0x15d9b4[_0x1d3d('0x18')](0x190)['json'](_0x213b0b);}var _0x482c31=_0x7af4dd['body']['userId'];var _0x17c3ab=respondWithRpcPromise(_0x1d3d('0x25'));var _0x32aaa2=getAgent(_0x482c31);return Promise[_0x1d3d('0x45')]([_0x17c3ab,_0x32aaa2])['then'](function(_0xecfc7e){var _0x480439=_0xecfc7e[0x0];var _0x44273d=_0xecfc7e[0x1];var _0xd3f336=_['filter'](_0x480439[_0x1d3d('0x27')],function(_0x45419e){return _0x45419e['UserId']==_0x44273d['id'];});return _0x15d9b4[_0x1d3d('0x18')](0xc8)[_0x1d3d('0x2e')]({'count':_0xd3f336[_0x1d3d('0x29')],'rows':_0xd3f336});})[_0x1d3d('0x21')](handleError(_0x15d9b4));};exports[_0x1d3d('0x46')]=function(_0x16e757,_0x4e47d5){logger[_0x1d3d('0x14')](_0x1d3d('0x47'),_0x16e757[_0x1d3d('0x2d')]);var _0x1183c0=conferenceValidation[_0x1d3d('0xe')](_0x16e757['body']);if(_0x1183c0[_0x1d3d('0x29')]>0x0){return _0x4e47d5['status'](0x190)[_0x1d3d('0x2e')](_0x1183c0);}var _0x5dcad1=_0x16e757[_0x1d3d('0x2d')][_0x1d3d('0x39')];return getAgent(_0x5dcad1)[_0x1d3d('0x1c')](function(_0x1711ee){logger[_0x1d3d('0x14')](_0x1d3d('0x31'),_0x1711ee[_0x1d3d('0x17')]);emit(util['format'](_0x1d3d('0x33'),_0x1711ee[_0x1d3d('0x17')]),_0x1d3d('0x48'));return _0x4e47d5[_0x1d3d('0x18')](0xc8)[_0x1d3d('0x2e')]({'error':![],'message':_0x1d3d('0x49')});})['catch'](handleError(_0x4e47d5));};exports[_0x1d3d('0x4a')]=function(_0x2ca216,_0xa8891a){logger[_0x1d3d('0x14')](_0x1d3d('0x4b'),_0x2ca216['body']);var _0xe83c1d=transferValidation[_0x1d3d('0xe')](_0x2ca216[_0x1d3d('0x2d')]);if(_0xe83c1d['length']>0x0){return _0xa8891a[_0x1d3d('0x18')](0x190)['json'](_0xe83c1d);}var _0x2ee6ca=_0x2ca216['body'][_0x1d3d('0x39')];var _0x378878=_0x2ca216[_0x1d3d('0x2d')]['sessionId'];var _0x389330=_0x2ca216[_0x1d3d('0x2d')][_0x1d3d('0x4c')];return getAgent(_0x2ee6ca)['then'](function(_0x19a126){logger[_0x1d3d('0x14')](_0x1d3d('0x31'),_0x19a126['name']);emit(util[_0x1d3d('0x32')](_0x1d3d('0x33'),_0x19a126[_0x1d3d('0x17')]),_0x1d3d('0x4d'),{'sessionId':_0x378878,'transferNumber':_0x389330});return _0xa8891a[_0x1d3d('0x18')](0xc8)['json']({'error':![],'message':_0x1d3d('0x4e')});})[_0x1d3d('0x21')](handleError(_0xa8891a));}; \ No newline at end of file +var _0x402f=['json','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','originate\x20executed!','hangup\x20fired:','sessionId','webbar:hangup','hangup\x20executed!','answer\x20fired:','userId','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls\x20fired:','VoiceChannels','all','filter','catch','conference','conference\x20fired:','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','../../mysqldb','bluebird','jayson/promise','client','../../config/logger','ioredis','redis','defaults','localhost','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','status','send','NotFound','request','then','code','message','result','User','findOne','rows','UserId','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','length'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x402f,0x6f));var _0xf402=function(_0x470721,_0x393598){_0x470721=_0x470721-0x0;var _0x548773=_0x402f[_0x470721];return _0x548773;};'use strict';var path=require(_0xf402('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0xf402('0x1'))['db'];var config=require('../../config/environment');var util=require('util');var BPromise=require(_0xf402('0x2'));var jayson=require(_0xf402('0x3'));var amiClient=jayson[_0xf402('0x4')]['http']({'port':0x232a});var logger=require(_0xf402('0x5'))('webbarapi');var Redis=require(_0xf402('0x6'));config[_0xf402('0x7')]=_[_0xf402('0x8')](config[_0xf402('0x7')],{'host':_0xf402('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Schema=require(_0xf402('0xa'));var originateValidation=new Schema({'userId':{'type':_0xf402('0xb'),'required':[!![],_0xf402('0xc')]},'callNumber':{'type':_0xf402('0xd'),'required':[!![],_0xf402('0xe')]},'callerId':{'type':_0xf402('0xd')},'callbackUrl':{'type':_0xf402('0xd')}});var hangupValidation=new Schema({'userId':{'type':_0xf402('0xb'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xf402('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xf402('0xd'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':'string','required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0xf402('0xb'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xf402('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xf402('0xb'),'required':[!![],_0xf402('0xc')]},'sessionId':{'type':_0xf402('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0xf402('0xc')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0xf402('0xc')]}});function emit(_0x5e38d8,_0x5cc240,_0x545d1a){logger[_0xf402('0xf')](_0x5e38d8,_0x5cc240,JSON[_0xf402('0x10')](_0x545d1a));io['to'](_0x5e38d8)[_0xf402('0x11')](_0x5cc240,_0x545d1a);}function handleError(_0x4629b7){return function(_0x2fbe36){console[_0xf402('0x12')](_0xf402('0x13'),_0x2fbe36,_0x2fbe36 instanceof RangeError);logger[_0xf402('0x14')](_0x2fbe36[_0xf402('0x15')]);if(_0x2fbe36 instanceof RangeError){if(_0x2fbe36[_0xf402('0x16')]){delete _0x2fbe36['name'];}_0x4629b7[_0xf402('0x17')](0x194)[_0xf402('0x18')](_0x2fbe36);}else{if(_0x2fbe36[_0xf402('0x16')]){delete _0x2fbe36[_0xf402('0x16')];}_0x4629b7[_0xf402('0x17')](0x1f4)[_0xf402('0x18')](_0x2fbe36);}};}function checkError(){return function(_0x2d476a){if(!_0x2d476a){throw new RangeError(_0xf402('0x19'));}return _0x2d476a;};}function respondWithRpcPromise(_0x16a05b,_0x499113){return new BPromise(function(_0x3cfe38,_0x4ffe46){var _0x297a68=amiClient;return _0x297a68[_0xf402('0x1a')](_0x16a05b,_0x499113)[_0xf402('0x1b')](function(_0x477709){if(_0x477709[_0xf402('0x14')]){if(_0x477709[_0xf402('0x14')][_0xf402('0x1c')]===0x1f4){return _0x4ffe46(_0x477709[_0xf402('0x14')][_0xf402('0x1d')]);}return _0x3cfe38(_0x477709[_0xf402('0x14')][_0xf402('0x1d')]);}else{_0x3cfe38(_0x477709[_0xf402('0x1e')]);}})['catch'](function(_0x3285bd){_0x4ffe46(_0x3285bd);});});}function getAgent(_0x16c21c){return db[_0xf402('0x1f')][_0xf402('0x20')]({'where':{'id':_0x16c21c,'role':'agent'}})['then'](checkError());}function getAgentCheckSession(_0x3e26d3,_0x3f837e){return new BPromise(function(_0x3a6a8d,_0xb7c8e4){var _0x32f1dc=respondWithRpcPromise('VoiceChannels');var _0x39a38a=getAgent(_0x3e26d3);Promise['all']([_0x32f1dc,_0x39a38a])[_0xf402('0x1b')](function(_0xe3dc2f){var _0x45ead3=_0xe3dc2f[0x0];var _0xb28d88=_0xe3dc2f[0x1];var _0xd82d61=_['filter'](_0x45ead3[_0xf402('0x21')],function(_0x3720c6){return _0x3720c6[_0xf402('0x22')]==_0xb28d88['id']&&_0x3720c6['sessionId']==_0x3f837e;});if(_0xd82d61['length']==0x1){_0x3a6a8d(_0xb28d88);}else{_0xb7c8e4(new RangeError(_0xf402('0x23')+_0x3f837e+_0xf402('0x24')));}});});}exports[_0xf402('0x25')]=function(_0x221d6d,_0x162cce){logger['info'](_0xf402('0x26'),_0x221d6d[_0xf402('0x27')]);var _0x44aa26=originateValidation[_0xf402('0xa')](_0x221d6d[_0xf402('0x27')]);if(_0x44aa26[_0xf402('0x28')]>0x0){return _0x162cce['status'](0x190)[_0xf402('0x29')](_0x44aa26);}var _0x209eae=_0x221d6d[_0xf402('0x27')]['userId'];var _0x5704a2=_0x221d6d[_0xf402('0x27')][_0xf402('0x2a')];var _0x106721=_0x221d6d['body'][_0xf402('0x2b')];var _0x335b34=_0x221d6d[_0xf402('0x27')][_0xf402('0x2c')];return getAgent(_0x209eae)[_0xf402('0x1b')](function(_0x2c4217){logger['info'](_0xf402('0x2d'),_0x2c4217[_0xf402('0x16')]);emit(util[_0xf402('0x2e')](_0xf402('0x2f'),_0x2c4217[_0xf402('0x16')]),'webbar:originate',{'callNumber':_0x5704a2,'callerId':_0x106721,'callbackUrl':_0x335b34});return _0x162cce[_0xf402('0x17')](0xc8)[_0xf402('0x29')]({'error':![],'message':_0xf402('0x30')});})['catch'](handleError(_0x162cce));};exports['hangup']=function(_0x66f414,_0x52e99b){logger[_0xf402('0xf')](_0xf402('0x31'),_0x66f414['body']);var _0x18c3c8=hangupValidation[_0xf402('0xa')](_0x66f414[_0xf402('0x27')]);if(_0x18c3c8[_0xf402('0x28')]>0x0){return _0x52e99b[_0xf402('0x17')](0x190)[_0xf402('0x29')](_0x18c3c8);}var _0x141631=_0x66f414[_0xf402('0x27')]['userId'];var _0x4e62b=_0x66f414[_0xf402('0x27')][_0xf402('0x32')];return getAgent(_0x141631)[_0xf402('0x1b')](function(_0x2fb923){logger['info'](_0xf402('0x2d'),_0x2fb923['name']);emit(util[_0xf402('0x2e')](_0xf402('0x2f'),_0x2fb923[_0xf402('0x16')]),_0xf402('0x33'),{'sessionId':_0x4e62b});return _0x52e99b[_0xf402('0x17')](0xc8)[_0xf402('0x29')]({'error':![],'message':_0xf402('0x34')});})['catch'](handleError(_0x52e99b));};exports['answer']=function(_0x352753,_0x22d601){logger[_0xf402('0xf')](_0xf402('0x35'),_0x352753[_0xf402('0x27')]);var _0x1fe222=answerValidation['validate'](_0x352753[_0xf402('0x27')]);if(_0x1fe222[_0xf402('0x28')]>0x0){return _0x22d601[_0xf402('0x17')](0x190)[_0xf402('0x29')](_0x1fe222);}var _0x50c439=_0x352753[_0xf402('0x27')][_0xf402('0x36')];var _0x299af2=_0x352753[_0xf402('0x27')][_0xf402('0x32')];return getAgent(_0x50c439)[_0xf402('0x1b')](function(_0x47c1e3){logger[_0xf402('0xf')](_0xf402('0x2d'),_0x47c1e3['name']);emit(util['format'](_0xf402('0x2f'),_0x47c1e3[_0xf402('0x16')]),'webbar:answer',{'sessionId':_0x299af2});return _0x22d601[_0xf402('0x17')](0xc8)[_0xf402('0x29')]({'error':![],'message':_0xf402('0x37')});})['catch'](handleError(_0x22d601));};exports[_0xf402('0x38')]=function(_0x48fd97,_0x6bddd8){logger['info'](_0xf402('0x39'),_0x48fd97[_0xf402('0x27')]);var _0x59ae4f=holdValidation['validate'](_0x48fd97[_0xf402('0x27')]);if(_0x59ae4f[_0xf402('0x28')]>0x0){return _0x6bddd8['status'](0x190)['json'](_0x59ae4f);}var _0x213c51=_0x48fd97[_0xf402('0x27')][_0xf402('0x36')];var _0xe53177=_0x48fd97[_0xf402('0x27')][_0xf402('0x32')];return getAgent(_0x213c51)[_0xf402('0x1b')](function(_0xf91b26){logger[_0xf402('0xf')]('entityFound:',_0xf91b26[_0xf402('0x16')]);emit(util[_0xf402('0x2e')](_0xf402('0x2f'),_0xf91b26['name']),_0xf402('0x3a'),{'sessionId':_0xe53177});return _0x6bddd8[_0xf402('0x17')](0xc8)[_0xf402('0x29')]({'error':![],'message':_0xf402('0x3b')});})['catch'](handleError(_0x6bddd8));};exports[_0xf402('0x3c')]=function(_0x411fa3,_0x206601){logger[_0xf402('0xf')](_0xf402('0x3d'),_0x411fa3[_0xf402('0x27')]);var _0x19eb1f=unholdValidation[_0xf402('0xa')](_0x411fa3[_0xf402('0x27')]);if(_0x19eb1f[_0xf402('0x28')]>0x0){return _0x206601[_0xf402('0x17')](0x190)[_0xf402('0x29')](_0x19eb1f);}var _0xfa0ef4=_0x411fa3['body']['userId'];var _0x2a304c=_0x411fa3['body']['sessionId'];return getAgent(_0xfa0ef4)['then'](function(_0xb0a9e7){logger[_0xf402('0xf')]('entityFound:',_0xb0a9e7[_0xf402('0x16')]);emit(util[_0xf402('0x2e')](_0xf402('0x2f'),_0xb0a9e7[_0xf402('0x16')]),_0xf402('0x3e'),{'sessionId':_0x2a304c});return _0x206601[_0xf402('0x17')](0xc8)[_0xf402('0x29')]({'error':![],'message':_0xf402('0x3f')});})['catch'](handleError(_0x206601));};exports['calls']=function(_0x3b8dff,_0x14d955){logger['info'](_0xf402('0x40'),_0x14d955[_0xf402('0x27')]);var _0x49b1d6=callsValidation['validate'](_0x3b8dff[_0xf402('0x27')]);if(_0x49b1d6['length']>0x0){return _0x14d955[_0xf402('0x17')](0x190)['json'](_0x49b1d6);}var _0x192d35=_0x3b8dff[_0xf402('0x27')]['userId'];var _0x4a1ca7=respondWithRpcPromise(_0xf402('0x41'));var _0x4159e2=getAgent(_0x192d35);return Promise[_0xf402('0x42')]([_0x4a1ca7,_0x4159e2])[_0xf402('0x1b')](function(_0x3e5de4){var _0x43378c=_0x3e5de4[0x0];var _0x4bb648=_0x3e5de4[0x1];var _0xe0b662=_[_0xf402('0x43')](_0x43378c[_0xf402('0x21')],function(_0x483d47){return _0x483d47[_0xf402('0x22')]==_0x4bb648['id'];});return _0x14d955[_0xf402('0x17')](0xc8)[_0xf402('0x29')]({'count':_0xe0b662['length'],'rows':_0xe0b662});})[_0xf402('0x44')](handleError(_0x14d955));};exports[_0xf402('0x45')]=function(_0x57a27e,_0x16508f){logger[_0xf402('0xf')](_0xf402('0x46'),_0x57a27e[_0xf402('0x27')]);var _0x4b9ab1=conferenceValidation[_0xf402('0xa')](_0x57a27e[_0xf402('0x27')]);if(_0x4b9ab1['length']>0x0){return _0x16508f[_0xf402('0x17')](0x190)[_0xf402('0x29')](_0x4b9ab1);}var _0x5bc9b7=_0x57a27e[_0xf402('0x27')]['userId'];return getAgent(_0x5bc9b7)[_0xf402('0x1b')](function(_0x559272){logger[_0xf402('0xf')](_0xf402('0x2d'),_0x559272[_0xf402('0x16')]);emit(util['format'](_0xf402('0x2f'),_0x559272[_0xf402('0x16')]),'webbar:conference');return _0x16508f['status'](0xc8)['json']({'error':![],'message':'conference\x20executed!'});})[_0xf402('0x44')](handleError(_0x16508f));};exports[_0xf402('0x47')]=function(_0x6fb6d2,_0xffbac5){logger['info'](_0xf402('0x48'),_0x6fb6d2[_0xf402('0x27')]);var _0x385a95=transferValidation[_0xf402('0xa')](_0x6fb6d2[_0xf402('0x27')]);if(_0x385a95[_0xf402('0x28')]>0x0){return _0xffbac5[_0xf402('0x17')](0x190)[_0xf402('0x29')](_0x385a95);}var _0x16f1ec=_0x6fb6d2[_0xf402('0x27')][_0xf402('0x36')];var _0x5dc335=_0x6fb6d2[_0xf402('0x27')][_0xf402('0x32')];var _0x387a44=_0x6fb6d2[_0xf402('0x27')][_0xf402('0x49')];return getAgent(_0x16f1ec)[_0xf402('0x1b')](function(_0xfddb50){logger[_0xf402('0xf')](_0xf402('0x2d'),_0xfddb50['name']);emit(util[_0xf402('0x2e')](_0xf402('0x2f'),_0xfddb50[_0xf402('0x16')]),_0xf402('0x4a'),{'sessionId':_0x5dc335,'transferNumber':_0x387a44});return _0xffbac5['status'](0xc8)['json']({'error':![],'message':_0xf402('0x4b')});})['catch'](handleError(_0xffbac5));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index c08e5d0..8d53743 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 _0x0598=['put','update','delete','destroy','/:id/canned_answers','removeAgents','multer','util','connect-timeout','fs-extra','../../components/auth/service','get','isAuthenticated','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','getAgents','/:id/applications','getApplications','post','addDisposition','/:id/users','addAgents','addApplications','/:id/notify'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x0598,0x92));var _0x8059=function(_0x32ed7b,_0x22a032){_0x32ed7b=_0x32ed7b-0x0;var _0x295d2c=_0x0598[_0x32ed7b];return _0x295d2c;};'use strict';var multer=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var path=require('path');var timeout=require(_0x8059('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8059('0x3'));var auth=require(_0x8059('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./whatsappAccount.controller');router[_0x8059('0x5')]('/',auth[_0x8059('0x6')](),controller['index']);router['get'](_0x8059('0x7'),auth[_0x8059('0x6')](),controller[_0x8059('0x8')]);router[_0x8059('0x5')]('/:id',auth['isAuthenticated'](),controller[_0x8059('0x9')]);router[_0x8059('0x5')](_0x8059('0xa'),auth[_0x8059('0x6')](),controller[_0x8059('0xb')]);router['get']('/:id/canned_answers',auth[_0x8059('0x6')](),controller[_0x8059('0xc')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x8059('0xd')]);router[_0x8059('0x5')](_0x8059('0xe'),auth[_0x8059('0x6')](),controller[_0x8059('0xf')]);router['post']('/',auth[_0x8059('0x6')](),controller['create']);router[_0x8059('0x10')]('/:id/dispositions',auth[_0x8059('0x6')](),controller[_0x8059('0x11')]);router[_0x8059('0x10')]('/:id/canned_answers',auth['isAuthenticated'](),controller['addAnswer']);router[_0x8059('0x10')](_0x8059('0x12'),auth[_0x8059('0x6')](),controller[_0x8059('0x13')]);router[_0x8059('0x10')]('/:id/applications',auth[_0x8059('0x6')](),controller[_0x8059('0x14')]);router[_0x8059('0x10')](_0x8059('0x15'),controller['notify']);router[_0x8059('0x10')]('/:id/send',auth[_0x8059('0x6')](),controller['send']);router[_0x8059('0x16')]('/:id',auth[_0x8059('0x6')](),controller[_0x8059('0x17')]);router[_0x8059('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x8059('0x19')]);router[_0x8059('0x18')](_0x8059('0xa'),auth[_0x8059('0x6')](),controller['removeDispositions']);router[_0x8059('0x18')](_0x8059('0x1a'),auth[_0x8059('0x6')](),controller['removeAnswers']);router[_0x8059('0x18')](_0x8059('0x12'),auth[_0x8059('0x6')](),controller[_0x8059('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x5c3c=['../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','describe','show','/:id/dispositions','/:id/canned_answers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addAgents','addApplications','/:id/notify','notify','/:id/send','send','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x1c00e1,_0x43a1ea){var _0x5a3598=function(_0x386920){while(--_0x386920){_0x1c00e1['push'](_0x1c00e1['shift']());}};_0x5a3598(++_0x43a1ea);}(_0x5c3c,0x132));var _0xc5c3=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0x5c3c[_0x2f1762];return _0x8ab21;};'use strict';var multer=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var path=require(_0xc5c3('0x2'));var timeout=require(_0xc5c3('0x3'));var express=require('express');var router=express[_0xc5c3('0x4')]();var fs_extra=require(_0xc5c3('0x5'));var auth=require(_0xc5c3('0x6'));var interaction=require(_0xc5c3('0x7'));var config=require(_0xc5c3('0x8'));var controller=require(_0xc5c3('0x9'));router[_0xc5c3('0xa')]('/',auth[_0xc5c3('0xb')](),controller[_0xc5c3('0xc')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xc5c3('0xd')]);router[_0xc5c3('0xa')]('/:id',auth[_0xc5c3('0xb')](),controller[_0xc5c3('0xe')]);router['get'](_0xc5c3('0xf'),auth[_0xc5c3('0xb')](),controller['getDispositions']);router[_0xc5c3('0xa')](_0xc5c3('0x10'),auth[_0xc5c3('0xb')](),controller['getAnswers']);router[_0xc5c3('0xa')](_0xc5c3('0x11'),auth['isAuthenticated'](),controller[_0xc5c3('0x12')]);router[_0xc5c3('0xa')](_0xc5c3('0x13'),auth['isAuthenticated'](),controller[_0xc5c3('0x14')]);router[_0xc5c3('0x15')]('/',auth[_0xc5c3('0xb')](),controller[_0xc5c3('0x16')]);router[_0xc5c3('0x15')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xc5c3('0x17')]);router[_0xc5c3('0x15')](_0xc5c3('0x10'),auth[_0xc5c3('0xb')](),controller['addAnswer']);router['post'](_0xc5c3('0x11'),auth['isAuthenticated'](),controller[_0xc5c3('0x18')]);router[_0xc5c3('0x15')](_0xc5c3('0x13'),auth[_0xc5c3('0xb')](),controller[_0xc5c3('0x19')]);router['post'](_0xc5c3('0x1a'),controller[_0xc5c3('0x1b')]);router[_0xc5c3('0x15')](_0xc5c3('0x1c'),auth['isAuthenticated'](),controller[_0xc5c3('0x1d')]);router[_0xc5c3('0x1e')](_0xc5c3('0x1f'),auth[_0xc5c3('0xb')](),controller[_0xc5c3('0x20')]);router['delete'](_0xc5c3('0x1f'),auth[_0xc5c3('0xb')](),controller[_0xc5c3('0x21')]);router[_0xc5c3('0x22')](_0xc5c3('0xf'),auth[_0xc5c3('0xb')](),controller[_0xc5c3('0x23')]);router['delete']('/:id/canned_answers',auth[_0xc5c3('0xb')](),controller[_0xc5c3('0x24')]);router['delete']('/:id/users',auth[_0xc5c3('0xb')](),controller[_0xc5c3('0x25')]);module[_0xc5c3('0x26')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 73eda9f..f30b56a 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 _0x8a12=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDisposition','sequelize','randomstring','STRING','name','generate','twilio','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER'];(function(_0x588011,_0x5e9d11){var _0x3b3773=function(_0x4cca54){while(--_0x4cca54){_0x588011['push'](_0x588011['shift']());}};_0x3b3773(++_0x5e9d11);}(_0x8a12,0x148));var _0x28a1=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x8a12[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x28a1('0x0'));var rs=require(_0x28a1('0x1'));module['exports']={'name':{'type':Sequelize[_0x28a1('0x2')],'unique':_0x28a1('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x28a1('0x2')],'defaultValue':function(){return rs[_0x28a1('0x4')]();}},'phone':{'type':Sequelize[_0x28a1('0x2')]},'type':{'type':Sequelize['ENUM'](_0x28a1('0x5'))},'accountSid':{'type':Sequelize[_0x28a1('0x2')]},'authToken':{'type':Sequelize[_0x28a1('0x2')]},'notificationTemplate':{'type':Sequelize[_0x28a1('0x6')],'defaultValue':function(){return _0x28a1('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x28a1('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x28a1('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x28a1('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x28a1('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x28a1('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x28a1('0x9')],'comment':_0x28a1('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x28a1('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x52452b){if(!_0x52452b){this[_0x28a1('0xb')]('mandatoryDispositionPauseId',null);}this['setDataValue'](_0x28a1('0xc'),_0x52452b);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2827=['randomstring','exports','STRING','generate','twilio','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize'];(function(_0x263721,_0x13b7e1){var _0x17daff=function(_0x22cfef){while(--_0x22cfef){_0x263721['push'](_0x263721['shift']());}};_0x17daff(++_0x13b7e1);}(_0x2827,0x117));var _0x7282=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2827[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x7282('0x0'));var rs=require(_0x7282('0x1'));module[_0x7282('0x2')]={'name':{'type':Sequelize[_0x7282('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x7282('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x7282('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x7282('0x3')],'defaultValue':function(){return rs[_0x7282('0x4')]();}},'phone':{'type':Sequelize[_0x7282('0x3')]},'type':{'type':Sequelize['ENUM'](_0x7282('0x5'))},'accountSid':{'type':Sequelize[_0x7282('0x3')]},'authToken':{'type':Sequelize[_0x7282('0x3')]},'notificationTemplate':{'type':Sequelize[_0x7282('0x6')],'defaultValue':function(){return _0x7282('0x7');}},'notificationSound':{'type':Sequelize[_0x7282('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x7282('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7282('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7282('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7282('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7282('0x9')],'comment':_0x7282('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x7282('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x206073){if(!_0x206073){this[_0x7282('0xb')](_0x7282('0xc'),null);}this[_0x7282('0xb')](_0x7282('0xd'),_0x206073);}},'description':{'type':Sequelize[_0x7282('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index f097a7f..32fca8e 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 _0xd0cd=['whatsapp:','Body','messageId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','omit','contact','WhatsappInteraction','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','WhatsappMessage','ContactId','AttachmentId','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','text/xml','to\x20is\x20mandatory','List','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','client','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','WhatsappAccounts','UserProfileResource','stack','name','send','index','Pause','map','WhatsappAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','include','findAll','rows','catch','show','mandatoryDispositionPause','keys','includeAll','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','addDisposition','WhatsappAccountId','Disposition','getDispositions','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addAgents','spread','removeAgents','isArray','emit','userWhatsappAccount:remove','User','getAgents','sequelize','transaction','WhatsappApplication','findAndCountAll','priority','getApplications','notify','whatsapp','Applications','account','applications','asc','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','ListId','twilio','From','replace'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd0cd,0xe7));var _0xdd0c=function(_0x17ff72,_0x5a05c9){_0x17ff72=_0x17ff72-0x0;var _0x4b987c=_0xd0cd[_0x17ff72];return _0x4b987c;};'use strict';var emlformat=require(_0xdd0c('0x0'));var rimraf=require(_0xdd0c('0x1'));var zipdir=require(_0xdd0c('0x2'));var jsonpatch=require(_0xdd0c('0x3'));var rp=require('request-promise');var moment=require(_0xdd0c('0x4'));var BPromise=require(_0xdd0c('0x5'));var Mustache=require(_0xdd0c('0x6'));var util=require(_0xdd0c('0x7'));var path=require(_0xdd0c('0x8'));var sox=require(_0xdd0c('0x9'));var csv=require(_0xdd0c('0xa'));var ejs=require(_0xdd0c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xdd0c('0xc'));var crypto=require(_0xdd0c('0xd'));var jsforce=require(_0xdd0c('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdd0c('0xf'));var Papa=require(_0xdd0c('0x10'));var Redis=require(_0xdd0c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdd0c('0x12'));var as=require(_0xdd0c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdd0c('0x14'))(_0xdd0c('0x15'));var utils=require(_0xdd0c('0x16'));var config=require(_0xdd0c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xdd0c('0x18'))['db'];config[_0xdd0c('0x19')]=_[_0xdd0c('0x1a')](config[_0xdd0c('0x19')],{'host':_0xdd0c('0x1b'),'port':0x18eb});var socket=require(_0xdd0c('0x1c'))(new Redis(config[_0xdd0c('0x19')]));require(_0xdd0c('0x1d'))[_0xdd0c('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0xdd0c('0x1f')]['http']({'port':0x232c});function respondWithRpcPromise(_0x32cd62,_0x206f1c,_0x2e26a0,_0x5c05e1){return new BPromise(function(_0x55855a,_0x5785ce){var _0x2b9806=_0x5c05e1||client;return _0x2b9806[_0xdd0c('0x20')](_0x32cd62,_0x2e26a0)[_0xdd0c('0x21')](function(_0x551dc2){logger[_0xdd0c('0x22')](_0xdd0c('0x23'),_0x206f1c,_0xdd0c('0x24'));logger[_0xdd0c('0x25')](_0xdd0c('0x26'),_0x206f1c,_0xdd0c('0x24'),JSON[_0xdd0c('0x27')](_0x551dc2));if(_0x551dc2[_0xdd0c('0x28')]){if(_0x551dc2[_0xdd0c('0x28')][_0xdd0c('0x29')]===0x1f4){logger[_0xdd0c('0x28')](_0xdd0c('0x23'),_0x206f1c,_0x551dc2[_0xdd0c('0x28')]['message']);return _0x5785ce(_0x551dc2[_0xdd0c('0x28')][_0xdd0c('0x2a')]);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x206f1c,_0x551dc2[_0xdd0c('0x28')]['message']);return _0x55855a(_0x551dc2[_0xdd0c('0x28')][_0xdd0c('0x2a')]);}else{logger[_0xdd0c('0x22')]('WhatsappAccount,\x20%s,\x20%s',_0x206f1c,'request\x20sent');_0x55855a(_0x551dc2[_0xdd0c('0x2b')][_0xdd0c('0x2a')]);}})['catch'](function(_0x195988){logger[_0xdd0c('0x28')](_0xdd0c('0x23'),_0x206f1c,_0x195988);_0x5785ce(_0x195988);});});}function respondWithStatusCode(_0x18a6c8,_0x38a5c9){_0x38a5c9=_0x38a5c9||0xcc;return function(_0x4bf380){if(_0x4bf380){return _0x18a6c8[_0xdd0c('0x2c')](_0x38a5c9);}return _0x18a6c8[_0xdd0c('0x2d')](_0x38a5c9)[_0xdd0c('0x2e')]();};}function respondWithResult(_0x40147c,_0x1ad3da){_0x1ad3da=_0x1ad3da||0xc8;return function(_0x351031){if(_0x351031){return _0x40147c[_0xdd0c('0x2d')](_0x1ad3da)[_0xdd0c('0x2f')](_0x351031);}};}function respondWithFilteredResult(_0x4e0e93,_0x5e8677){return function(_0x5d59da){if(_0x5d59da){var _0xe91a4f=typeof _0x5e8677['offset']===_0xdd0c('0x30')&&typeof _0x5e8677[_0xdd0c('0x31')]==='undefined';var _0x1c935c=_0x5d59da['count'];var _0x4cd420=_0xe91a4f?0x0:_0x5e8677['offset'];var _0x18dfa2=_0xe91a4f?_0x5d59da[_0xdd0c('0x32')]:_0x5e8677[_0xdd0c('0x33')]+_0x5e8677[_0xdd0c('0x31')];var _0x3d9738;if(_0x18dfa2>=_0x1c935c){_0x18dfa2=_0x1c935c;_0x3d9738=0xc8;}else{_0x3d9738=0xce;}_0x4e0e93[_0xdd0c('0x2d')](_0x3d9738);return _0x4e0e93[_0xdd0c('0x34')](_0xdd0c('0x35'),_0x4cd420+'-'+_0x18dfa2+'/'+_0x1c935c)[_0xdd0c('0x2f')](_0x5d59da);}return null;};}function patchUpdates(_0x41bbc8){return function(_0x25cac1){try{jsonpatch[_0xdd0c('0x36')](_0x25cac1,_0x41bbc8,!![]);}catch(_0xb2a2e7){return BPromise[_0xdd0c('0x37')](_0xb2a2e7);}return _0x25cac1[_0xdd0c('0x38')]();};}function saveUpdates(_0x2bf3b4,_0x4b974f){return function(_0x4a4486){if(_0x4a4486){return _0x4a4486[_0xdd0c('0x39')](_0x2bf3b4)[_0xdd0c('0x21')](function(_0xdb9205){return _0xdb9205;});}return null;};}function removeEntity(_0x3f311e,_0x916105){return function(_0x4c7022){if(_0x4c7022){return _0x4c7022[_0xdd0c('0x3a')]()[_0xdd0c('0x21')](function(){var _0x1bb1a6=_0x4c7022['get']({'plain':!![]});var _0x65d2b3=_0xdd0c('0x3b');return db[_0xdd0c('0x3c')]['destroy']({'where':{'type':_0x65d2b3,'resourceId':_0x1bb1a6['id']}})['then'](function(){return _0x4c7022;});})[_0xdd0c('0x21')](function(){_0x3f311e['status'](0xcc)[_0xdd0c('0x2e')]();});}};}function handleEntityNotFound(_0x7a57ac,_0x5aa213){return function(_0x224a5a){if(!_0x224a5a){_0x7a57ac[_0xdd0c('0x2c')](0x194);}return _0x224a5a;};}function handleError(_0x5ee0ab,_0x29d4c4){_0x29d4c4=_0x29d4c4||0x1f4;return function(_0x151df5){logger['error'](_0x151df5[_0xdd0c('0x3d')]);if(_0x151df5[_0xdd0c('0x3e')]){delete _0x151df5['name'];}_0x5ee0ab[_0xdd0c('0x2d')](_0x29d4c4)[_0xdd0c('0x3f')](_0x151df5);};}exports[_0xdd0c('0x40')]=function(_0x266bab,_0x3477c7){var _0x21bdaa={'include':[{'model':db[_0xdd0c('0x41')],'as':'mandatoryDispositionPause'}]},_0x2b6f38={},_0x57e059={'count':0x0,'rows':[]};var _0x299009=_[_0xdd0c('0x42')](db[_0xdd0c('0x43')][_0xdd0c('0x44')],function(_0x3b9627){return{'name':_0x3b9627[_0xdd0c('0x45')],'type':_0x3b9627[_0xdd0c('0x46')][_0xdd0c('0x47')]};});_0x2b6f38[_0xdd0c('0x48')]=_[_0xdd0c('0x42')](_0x299009,_0xdd0c('0x3e'));_0x2b6f38[_0xdd0c('0x49')]=_['keys'](_0x266bab[_0xdd0c('0x49')]);_0x2b6f38[_0xdd0c('0x4a')]=_['intersection'](_0x2b6f38['model'],_0x2b6f38[_0xdd0c('0x49')]);_0x21bdaa[_0xdd0c('0x4b')]=_[_0xdd0c('0x4c')](_0x2b6f38[_0xdd0c('0x48')],qs[_0xdd0c('0x4d')](_0x266bab[_0xdd0c('0x49')][_0xdd0c('0x4d')]));_0x21bdaa[_0xdd0c('0x4b')]=_0x21bdaa['attributes'][_0xdd0c('0x4e')]?_0x21bdaa[_0xdd0c('0x4b')]:_0x2b6f38[_0xdd0c('0x48')];if(!_0x266bab[_0xdd0c('0x49')][_0xdd0c('0x4f')](_0xdd0c('0x50'))){_0x21bdaa['limit']=qs[_0xdd0c('0x31')](_0x266bab[_0xdd0c('0x49')][_0xdd0c('0x31')]);_0x21bdaa['offset']=qs[_0xdd0c('0x33')](_0x266bab[_0xdd0c('0x49')][_0xdd0c('0x33')]);}_0x21bdaa[_0xdd0c('0x51')]=qs[_0xdd0c('0x52')](_0x266bab[_0xdd0c('0x49')]['sort']);_0x21bdaa[_0xdd0c('0x53')]=qs['filters'](_[_0xdd0c('0x54')](_0x266bab['query'],_0x2b6f38[_0xdd0c('0x4a')]),_0x299009);if(_0x266bab[_0xdd0c('0x49')][_0xdd0c('0x55')]){_0x21bdaa[_0xdd0c('0x53')]=_[_0xdd0c('0x56')](_0x21bdaa['where'],{'$or':_[_0xdd0c('0x42')](_0x299009,function(_0x595860){if(_0x595860[_0xdd0c('0x46')]!=='VIRTUAL'){var _0x31aac7={};_0x31aac7[_0x595860[_0xdd0c('0x3e')]]={'$like':'%'+_0x266bab[_0xdd0c('0x49')][_0xdd0c('0x55')]+'%'};return _0x31aac7;}})});}_0x21bdaa=_['merge']({},_0x21bdaa,_0x266bab['options']);var _0x25e8ef={'where':_0x21bdaa[_0xdd0c('0x53')]};return db[_0xdd0c('0x43')][_0xdd0c('0x32')](_0x25e8ef)['then'](function(_0x1a2f7f){_0x57e059[_0xdd0c('0x32')]=_0x1a2f7f;if(_0x266bab['query']['includeAll']){_0x21bdaa[_0xdd0c('0x57')]=[{'all':!![]}];}return db[_0xdd0c('0x43')][_0xdd0c('0x58')](_0x21bdaa);})['then'](function(_0x20acee){_0x57e059[_0xdd0c('0x59')]=_0x20acee;return _0x57e059;})['then'](respondWithFilteredResult(_0x3477c7,_0x21bdaa))[_0xdd0c('0x5a')](handleError(_0x3477c7,null));};exports[_0xdd0c('0x5b')]=function(_0x1ff4b0,_0x1cbe65){var _0x4b8c10={'raw':![],'where':{'id':_0x1ff4b0['params']['id']},'include':[{'model':db[_0xdd0c('0x41')],'as':_0xdd0c('0x5c')}]},_0x166a7b={};_0x166a7b[_0xdd0c('0x48')]=_['keys'](db[_0xdd0c('0x43')]['rawAttributes']);_0x166a7b[_0xdd0c('0x49')]=_[_0xdd0c('0x5d')](_0x1ff4b0[_0xdd0c('0x49')]);_0x166a7b[_0xdd0c('0x4a')]=_[_0xdd0c('0x4c')](_0x166a7b[_0xdd0c('0x48')],_0x166a7b['query']);_0x4b8c10['attributes']=_['intersection'](_0x166a7b[_0xdd0c('0x48')],qs[_0xdd0c('0x4d')](_0x1ff4b0['query'][_0xdd0c('0x4d')]));_0x4b8c10['attributes']=_0x4b8c10[_0xdd0c('0x4b')][_0xdd0c('0x4e')]?_0x4b8c10[_0xdd0c('0x4b')]:_0x166a7b[_0xdd0c('0x48')];if(_0x1ff4b0[_0xdd0c('0x49')][_0xdd0c('0x5e')]){_0x4b8c10[_0xdd0c('0x57')]=[{'all':!![]}];}_0x4b8c10=_['merge']({},_0x4b8c10,_0x1ff4b0[_0xdd0c('0x5f')]);return db[_0xdd0c('0x43')]['find'](_0x4b8c10)[_0xdd0c('0x21')](handleEntityNotFound(_0x1cbe65,null))[_0xdd0c('0x21')](respondWithResult(_0x1cbe65,null))[_0xdd0c('0x5a')](handleError(_0x1cbe65,null));};exports[_0xdd0c('0x60')]=function(_0x3b4811,_0x4c3423){return db[_0xdd0c('0x43')][_0xdd0c('0x60')](_0x3b4811[_0xdd0c('0x61')],{})['then'](function(_0x1430a5){var _0x48baf8=_0x3b4811[_0xdd0c('0x62')][_0xdd0c('0x63')]({'plain':!![]});if(!_0x48baf8)throw new Error(_0xdd0c('0x64'));if(_0x48baf8[_0xdd0c('0x65')]===_0xdd0c('0x62')){var _0xbd865c=_0x1430a5[_0xdd0c('0x63')]({'plain':!![]});var _0x4df0d4=_0xdd0c('0x3b');return db[_0xdd0c('0x66')]['find']({'where':{'name':_0x4df0d4,'userProfileId':_0x48baf8['userProfileId']},'raw':!![]})['then'](function(_0x5247b7){if(_0x5247b7&&_0x5247b7['autoAssociation']===0x0){return db[_0xdd0c('0x3c')][_0xdd0c('0x60')]({'name':_0xbd865c[_0xdd0c('0x3e')],'resourceId':_0xbd865c['id'],'type':_0x5247b7['name'],'sectionId':_0x5247b7['id']},{})[_0xdd0c('0x21')](function(){return _0x1430a5;});}else{return _0x1430a5;}})[_0xdd0c('0x5a')](function(_0x3631bd){logger[_0xdd0c('0x28')](_0xdd0c('0x67'),_0x3631bd);throw _0x3631bd;});}return _0x1430a5;})['then'](respondWithResult(_0x4c3423,0xc9))[_0xdd0c('0x5a')](handleError(_0x4c3423,null));};exports[_0xdd0c('0x39')]=function(_0x41f1c6,_0x3c70d5){if(_0x41f1c6[_0xdd0c('0x61')]['id']){delete _0x41f1c6['body']['id'];}return db[_0xdd0c('0x43')][_0xdd0c('0x68')]({'where':{'id':_0x41f1c6[_0xdd0c('0x69')]['id']},'include':[{'model':db[_0xdd0c('0x41')],'as':_0xdd0c('0x5c')}]})['then'](handleEntityNotFound(_0x3c70d5,null))['then'](saveUpdates(_0x41f1c6[_0xdd0c('0x61')],null))[_0xdd0c('0x21')](respondWithResult(_0x3c70d5,null))[_0xdd0c('0x5a')](handleError(_0x3c70d5,null));};exports['destroy']=function(_0x1854be,_0x2c8402){return db[_0xdd0c('0x43')][_0xdd0c('0x68')]({'where':{'id':_0x1854be['params']['id']}})[_0xdd0c('0x21')](handleEntityNotFound(_0x2c8402,null))[_0xdd0c('0x21')](removeEntity(_0x2c8402,null))[_0xdd0c('0x5a')](handleError(_0x2c8402,null));};exports['describe']=function(_0xfe5d24,_0x95f49c){return db[_0xdd0c('0x43')]['describe']()[_0xdd0c('0x21')](respondWithResult(_0x95f49c,null))[_0xdd0c('0x5a')](handleError(_0x95f49c,null));};exports[_0xdd0c('0x6a')]=function(_0x5d2b2a,_0x31411e,_0x477741){if(_0x5d2b2a[_0xdd0c('0x61')]['id']){delete _0x5d2b2a['body']['id'];}return db[_0xdd0c('0x43')][_0xdd0c('0x68')]({'where':{'id':_0x5d2b2a[_0xdd0c('0x69')]['id']}})[_0xdd0c('0x21')](handleEntityNotFound(_0x31411e,null))['then'](function(_0x522902){if(_0x522902){_0x5d2b2a[_0xdd0c('0x61')][_0xdd0c('0x6b')]=_0x522902['id'];return db[_0xdd0c('0x6c')][_0xdd0c('0x60')](_0x5d2b2a[_0xdd0c('0x61')]);}})[_0xdd0c('0x21')](respondWithResult(_0x31411e,null))[_0xdd0c('0x5a')](handleError(_0x31411e,null));};exports[_0xdd0c('0x6d')]=function(_0x35d9e7,_0x2fc8cc,_0x7f814f){var _0x3eac5f={'raw':![],'where':{}};var _0x49cfa9={};var _0x5a5dce={'count':0x0,'rows':[]};return db[_0xdd0c('0x43')]['findOne']({'where':{'id':_0x35d9e7[_0xdd0c('0x69')]['id']}})['then'](handleEntityNotFound(_0x2fc8cc,null))['then'](function(_0xa340f7){if(_0xa340f7){_0x49cfa9[_0xdd0c('0x48')]=_[_0xdd0c('0x5d')](db[_0xdd0c('0x6c')][_0xdd0c('0x44')]);_0x49cfa9[_0xdd0c('0x49')]=_[_0xdd0c('0x5d')](_0x35d9e7[_0xdd0c('0x49')]);_0x49cfa9['filters']=_[_0xdd0c('0x4c')](_0x49cfa9[_0xdd0c('0x48')],_0x49cfa9['query']);_0x3eac5f[_0xdd0c('0x4b')]=_[_0xdd0c('0x4c')](_0x49cfa9[_0xdd0c('0x48')],qs[_0xdd0c('0x4d')](_0x35d9e7[_0xdd0c('0x49')][_0xdd0c('0x4d')]));_0x3eac5f['attributes']=_0x3eac5f[_0xdd0c('0x4b')]['length']?_0x3eac5f[_0xdd0c('0x4b')]:_0x49cfa9[_0xdd0c('0x48')];if(!_0x35d9e7['query'][_0xdd0c('0x4f')]('nolimit')){_0x3eac5f['limit']=qs[_0xdd0c('0x31')](_0x35d9e7[_0xdd0c('0x49')]['limit']);_0x3eac5f[_0xdd0c('0x33')]=qs[_0xdd0c('0x33')](_0x35d9e7[_0xdd0c('0x49')][_0xdd0c('0x33')]);}_0x3eac5f['order']=qs['sort'](_0x35d9e7[_0xdd0c('0x49')]['sort']);_0x3eac5f[_0xdd0c('0x53')]=qs[_0xdd0c('0x4a')](_['pick'](_0x35d9e7[_0xdd0c('0x49')],_0x49cfa9[_0xdd0c('0x4a')]));_0x3eac5f['where'][_0xdd0c('0x6b')]=_0xa340f7['id'];if(_0x35d9e7[_0xdd0c('0x49')][_0xdd0c('0x55')]){_0x3eac5f[_0xdd0c('0x53')]=_['merge'](_0x3eac5f[_0xdd0c('0x53')],{'$or':_[_0xdd0c('0x42')](_0x3eac5f[_0xdd0c('0x4b')],function(_0x194409){var _0x1df73e={};_0x1df73e[_0x194409]={'$like':'%'+_0x35d9e7[_0xdd0c('0x49')][_0xdd0c('0x55')]+'%'};return _0x1df73e;})});}_0x3eac5f=_[_0xdd0c('0x56')]({},_0x3eac5f,_0x35d9e7[_0xdd0c('0x5f')]);return db[_0xdd0c('0x6c')][_0xdd0c('0x32')]({'where':_0x3eac5f[_0xdd0c('0x53')]})[_0xdd0c('0x21')](function(_0x2237d5){_0x5a5dce[_0xdd0c('0x32')]=_0x2237d5;if(_0x35d9e7['query'][_0xdd0c('0x5e')]){_0x3eac5f[_0xdd0c('0x57')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x3eac5f);})[_0xdd0c('0x21')](function(_0x4cc7a0){_0x5a5dce[_0xdd0c('0x59')]=_0x4cc7a0;return _0x5a5dce;});}})['then'](respondWithFilteredResult(_0x2fc8cc,_0x3eac5f))[_0xdd0c('0x5a')](handleError(_0x2fc8cc,null));};exports['removeDispositions']=function(_0xf75b50,_0x3f3875,_0x138730){return db[_0xdd0c('0x43')]['find']({'where':{'id':_0xf75b50['params']['id']}})[_0xdd0c('0x21')](handleEntityNotFound(_0x3f3875,null))[_0xdd0c('0x21')](function(_0x142b92){if(_0x142b92){return _0x142b92[_0xdd0c('0x6e')](_0xf75b50[_0xdd0c('0x49')][_0xdd0c('0x6f')]);}})[_0xdd0c('0x21')](respondWithStatusCode(_0x3f3875,null))[_0xdd0c('0x5a')](handleError(_0x3f3875,null));};exports[_0xdd0c('0x70')]=function(_0x38ebf2,_0x4ce568,_0xb5a7f5){if(_0x38ebf2['body']['id']){delete _0x38ebf2[_0xdd0c('0x61')]['id'];}return db[_0xdd0c('0x43')][_0xdd0c('0x68')]({'where':{'id':_0x38ebf2['params']['id']}})['then'](handleEntityNotFound(_0x4ce568,null))[_0xdd0c('0x21')](function(_0x282f65){if(_0x282f65){_0x38ebf2[_0xdd0c('0x61')][_0xdd0c('0x6b')]=_0x282f65['id'];return db[_0xdd0c('0x71')][_0xdd0c('0x60')](_0x38ebf2['body']);}})[_0xdd0c('0x21')](respondWithResult(_0x4ce568,null))[_0xdd0c('0x5a')](handleError(_0x4ce568,null));};exports[_0xdd0c('0x72')]=function(_0x5e0e82,_0x15192d,_0x7b0995){var _0x277fbc={'raw':![],'where':{}};var _0x4c8d3c={};var _0x586e18={'count':0x0,'rows':[]};return db[_0xdd0c('0x43')][_0xdd0c('0x73')]({'where':{'id':_0x5e0e82['params']['id']}})['then'](handleEntityNotFound(_0x15192d,null))[_0xdd0c('0x21')](function(_0x22d239){if(_0x22d239){_0x4c8d3c[_0xdd0c('0x48')]=_[_0xdd0c('0x5d')](db[_0xdd0c('0x71')]['rawAttributes']);_0x4c8d3c[_0xdd0c('0x49')]=_[_0xdd0c('0x5d')](_0x5e0e82[_0xdd0c('0x49')]);_0x4c8d3c['filters']=_[_0xdd0c('0x4c')](_0x4c8d3c['model'],_0x4c8d3c[_0xdd0c('0x49')]);_0x277fbc[_0xdd0c('0x4b')]=_[_0xdd0c('0x4c')](_0x4c8d3c[_0xdd0c('0x48')],qs[_0xdd0c('0x4d')](_0x5e0e82[_0xdd0c('0x49')][_0xdd0c('0x4d')]));_0x277fbc['attributes']=_0x277fbc[_0xdd0c('0x4b')][_0xdd0c('0x4e')]?_0x277fbc[_0xdd0c('0x4b')]:_0x4c8d3c[_0xdd0c('0x48')];if(!_0x5e0e82[_0xdd0c('0x49')][_0xdd0c('0x4f')](_0xdd0c('0x50'))){_0x277fbc[_0xdd0c('0x31')]=qs[_0xdd0c('0x31')](_0x5e0e82[_0xdd0c('0x49')][_0xdd0c('0x31')]);_0x277fbc[_0xdd0c('0x33')]=qs[_0xdd0c('0x33')](_0x5e0e82[_0xdd0c('0x49')][_0xdd0c('0x33')]);}_0x277fbc[_0xdd0c('0x51')]=qs[_0xdd0c('0x52')](_0x5e0e82['query'][_0xdd0c('0x52')]);_0x277fbc[_0xdd0c('0x53')]=qs[_0xdd0c('0x4a')](_['pick'](_0x5e0e82[_0xdd0c('0x49')],_0x4c8d3c[_0xdd0c('0x4a')]));_0x277fbc[_0xdd0c('0x53')][_0xdd0c('0x6b')]=_0x22d239['id'];if(_0x5e0e82[_0xdd0c('0x49')][_0xdd0c('0x55')]){_0x277fbc[_0xdd0c('0x53')]=_[_0xdd0c('0x56')](_0x277fbc[_0xdd0c('0x53')],{'$or':_[_0xdd0c('0x42')](_0x277fbc[_0xdd0c('0x4b')],function(_0x53f983){var _0x486dd7={};_0x486dd7[_0x53f983]={'$like':'%'+_0x5e0e82[_0xdd0c('0x49')][_0xdd0c('0x55')]+'%'};return _0x486dd7;})});}_0x277fbc=_[_0xdd0c('0x56')]({},_0x277fbc,_0x5e0e82[_0xdd0c('0x5f')]);return db[_0xdd0c('0x71')]['count']({'where':_0x277fbc[_0xdd0c('0x53')]})[_0xdd0c('0x21')](function(_0x399516){_0x586e18[_0xdd0c('0x32')]=_0x399516;if(_0x5e0e82[_0xdd0c('0x49')]['includeAll']){_0x277fbc[_0xdd0c('0x57')]=[{'all':!![]}];}return db[_0xdd0c('0x71')][_0xdd0c('0x58')](_0x277fbc);})['then'](function(_0x57ed9d){_0x586e18[_0xdd0c('0x59')]=_0x57ed9d;return _0x586e18;});}})['then'](respondWithFilteredResult(_0x15192d,_0x277fbc))[_0xdd0c('0x5a')](handleError(_0x15192d,null));};exports[_0xdd0c('0x74')]=function(_0x5e9e71,_0x182765,_0x468145){return db[_0xdd0c('0x43')][_0xdd0c('0x68')]({'where':{'id':_0x5e9e71[_0xdd0c('0x69')]['id']}})[_0xdd0c('0x21')](handleEntityNotFound(_0x182765,null))[_0xdd0c('0x21')](function(_0x1dff25){if(_0x1dff25){return _0x1dff25[_0xdd0c('0x74')](_0x5e9e71[_0xdd0c('0x49')]['ids']);}})[_0xdd0c('0x21')](respondWithStatusCode(_0x182765,null))['catch'](handleError(_0x182765,null));};exports['addAgents']=function(_0x425675,_0x51ba9d,_0x19fcc1){return db['WhatsappAccount'][_0xdd0c('0x68')]({'where':{'id':_0x425675[_0xdd0c('0x69')]['id']}})[_0xdd0c('0x21')](handleEntityNotFound(_0x51ba9d,null))[_0xdd0c('0x21')](function(_0x40a7a0){if(_0x40a7a0){return _0x40a7a0[_0xdd0c('0x75')](_0x425675[_0xdd0c('0x61')][_0xdd0c('0x6f')],_['omit'](_0x425675[_0xdd0c('0x61')],['ids','id'])||{})[_0xdd0c('0x76')](function(_0x22389b){for(var _0x5e0387=0x0;_0x5e0387<_0x425675[_0xdd0c('0x61')][_0xdd0c('0x6f')][_0xdd0c('0x4e')];_0x5e0387+=0x1){socket['emit']('userWhatsappAccount:save',{'UserId':Number(_0x425675[_0xdd0c('0x61')]['ids'][_0x5e0387]),'WhatsappAccountId':Number(_0x425675['params']['id'])});}return _0x22389b;});}})[_0xdd0c('0x21')](respondWithResult(_0x51ba9d,null))['catch'](handleError(_0x51ba9d,null));};exports[_0xdd0c('0x77')]=function(_0x24a622,_0x45dc21,_0x17d87d){return db['WhatsappAccount'][_0xdd0c('0x68')]({'where':{'id':_0x24a622[_0xdd0c('0x69')]['id']}})[_0xdd0c('0x21')](handleEntityNotFound(_0x45dc21,null))[_0xdd0c('0x21')](function(_0x22df70){if(_0x22df70){return _0x22df70[_0xdd0c('0x77')](_0x24a622[_0xdd0c('0x49')]['ids'])[_0xdd0c('0x21')](function(){if(_[_0xdd0c('0x78')](_0x24a622[_0xdd0c('0x49')][_0xdd0c('0x6f')])){for(var _0x4b54e8=0x0;_0x4b54e8<_0x24a622[_0xdd0c('0x49')][_0xdd0c('0x6f')][_0xdd0c('0x4e')];_0x4b54e8+=0x1){socket[_0xdd0c('0x79')](_0xdd0c('0x7a'),{'UserId':Number(_0x24a622['query']['ids'][_0x4b54e8]),'WhatsappAccountId':Number(_0x24a622[_0xdd0c('0x69')]['id'])});}}else{socket['emit']('userWhatsappAccount:remove',{'UserId':Number(_0x24a622[_0xdd0c('0x49')]['ids']),'WhatsappAccountId':Number(_0x24a622[_0xdd0c('0x69')]['id'])});}});}})[_0xdd0c('0x21')](respondWithStatusCode(_0x45dc21,null))[_0xdd0c('0x5a')](handleError(_0x45dc21,null));};exports['getAgents']=function(_0x10ab99,_0x4f3eda,_0x2fe9fd){var _0x373c52={};var _0x5072b6={};var _0x2411bf;var _0x2743b7;return db['WhatsappAccount'][_0xdd0c('0x73')]({'where':{'id':_0x10ab99[_0xdd0c('0x69')]['id']}})[_0xdd0c('0x21')](handleEntityNotFound(_0x4f3eda,null))[_0xdd0c('0x21')](function(_0x3a148a){if(_0x3a148a){_0x2411bf=_0x3a148a;_0x5072b6[_0xdd0c('0x48')]=_[_0xdd0c('0x5d')](db[_0xdd0c('0x7b')][_0xdd0c('0x44')]);_0x5072b6[_0xdd0c('0x49')]=_['keys'](_0x10ab99[_0xdd0c('0x49')]);_0x5072b6['filters']=_[_0xdd0c('0x4c')](_0x5072b6[_0xdd0c('0x48')],_0x5072b6[_0xdd0c('0x49')]);_0x373c52[_0xdd0c('0x4b')]=_['intersection'](_0x5072b6[_0xdd0c('0x48')],qs[_0xdd0c('0x4d')](_0x10ab99[_0xdd0c('0x49')][_0xdd0c('0x4d')]));_0x373c52['attributes']=_0x373c52[_0xdd0c('0x4b')][_0xdd0c('0x4e')]?_0x373c52[_0xdd0c('0x4b')]:_0x5072b6['model'];_0x373c52[_0xdd0c('0x51')]=qs[_0xdd0c('0x52')](_0x10ab99[_0xdd0c('0x49')][_0xdd0c('0x52')]);_0x373c52[_0xdd0c('0x53')]=qs[_0xdd0c('0x4a')](_['pick'](_0x10ab99['query'],_0x5072b6['filters']));if(_0x10ab99['query'][_0xdd0c('0x55')]){_0x373c52[_0xdd0c('0x53')]=_[_0xdd0c('0x56')](_0x373c52[_0xdd0c('0x53')],{'$or':_[_0xdd0c('0x42')](_0x373c52[_0xdd0c('0x4b')],function(_0x3d9137){var _0x4b1a6c={};_0x4b1a6c[_0x3d9137]={'$like':'%'+_0x10ab99[_0xdd0c('0x49')][_0xdd0c('0x55')]+'%'};return _0x4b1a6c;})});}_0x373c52=_[_0xdd0c('0x56')]({},_0x373c52,_0x10ab99['options']);return _0x2411bf[_0xdd0c('0x7c')](_0x373c52);}})[_0xdd0c('0x21')](function(_0x490369){if(_0x490369){_0x2743b7=_0x490369['length'];if(!_0x10ab99[_0xdd0c('0x49')][_0xdd0c('0x4f')]('nolimit')){_0x373c52[_0xdd0c('0x31')]=qs[_0xdd0c('0x31')](_0x10ab99[_0xdd0c('0x49')]['limit']);_0x373c52[_0xdd0c('0x33')]=qs[_0xdd0c('0x33')](_0x10ab99['query'][_0xdd0c('0x33')]);}return _0x2411bf[_0xdd0c('0x7c')](_0x373c52);}})[_0xdd0c('0x21')](function(_0x17ddbe){if(_0x17ddbe){return _0x17ddbe?{'count':_0x2743b7,'rows':_0x17ddbe}:null;}})[_0xdd0c('0x21')](respondWithResult(_0x4f3eda,null))[_0xdd0c('0x5a')](handleError(_0x4f3eda,null));};exports['addApplications']=function(_0x147be9,_0x2d2f13,_0xd9cf65){return db[_0xdd0c('0x43')][_0xdd0c('0x73')]({'where':{'id':_0x147be9['params']['id']}})[_0xdd0c('0x21')](handleEntityNotFound(_0x2d2f13,null))['then'](function(_0x3957e8){if(_0x3957e8){return db[_0xdd0c('0x7d')][_0xdd0c('0x7e')](function(_0x5d8c7a){return db[_0xdd0c('0x7f')]['destroy']({'where':{'WhatsappAccountId':_0x147be9[_0xdd0c('0x69')]['id']},'transaction':_0x5d8c7a})['then'](function(_0x9d2883){var _0x42dcf4=_['map'](_0x147be9[_0xdd0c('0x61')],function(_0x396454){_0x396454[_0xdd0c('0x6b')]=_0x147be9[_0xdd0c('0x69')]['id'];return _0x396454;});return db[_0xdd0c('0x7f')]['bulkCreate'](_0x42dcf4,{'transaction':_0x5d8c7a});});})[_0xdd0c('0x21')](function(){return db[_0xdd0c('0x7f')][_0xdd0c('0x80')]({'where':{'WhatsappAccountId':_0x147be9[_0xdd0c('0x69')]['id']},'order':_0xdd0c('0x81')});});}})[_0xdd0c('0x21')](respondWithResult(_0x2d2f13,null))['catch'](handleError(_0x2d2f13,null));};exports['getApplications']=function(_0x28197f,_0x5c031f,_0xc4c2cc){var _0x47a83c={};var _0x3826ce={};var _0x40226e;var _0x30b16a;return db['WhatsappAccount'][_0xdd0c('0x73')]({'where':{'id':_0x28197f['params']['id']}})[_0xdd0c('0x21')](handleEntityNotFound(_0x5c031f,null))[_0xdd0c('0x21')](function(_0x5e4c55){if(_0x5e4c55){_0x40226e=_0x5e4c55;_0x3826ce[_0xdd0c('0x48')]=_[_0xdd0c('0x5d')](db[_0xdd0c('0x7f')][_0xdd0c('0x44')]);_0x3826ce[_0xdd0c('0x49')]=_[_0xdd0c('0x5d')](_0x28197f[_0xdd0c('0x49')]);_0x3826ce[_0xdd0c('0x4a')]=_[_0xdd0c('0x4c')](_0x3826ce['model'],_0x3826ce[_0xdd0c('0x49')]);_0x47a83c[_0xdd0c('0x4b')]=_['intersection'](_0x3826ce[_0xdd0c('0x48')],qs[_0xdd0c('0x4d')](_0x28197f[_0xdd0c('0x49')][_0xdd0c('0x4d')]));_0x47a83c['attributes']=_0x47a83c[_0xdd0c('0x4b')]['length']?_0x47a83c[_0xdd0c('0x4b')]:_0x3826ce['model'];_0x47a83c['order']=qs[_0xdd0c('0x52')](_0x28197f[_0xdd0c('0x49')]['sort']);_0x47a83c[_0xdd0c('0x53')]=qs[_0xdd0c('0x4a')](_[_0xdd0c('0x54')](_0x28197f['query'],_0x3826ce[_0xdd0c('0x4a')]));if(_0x28197f[_0xdd0c('0x49')][_0xdd0c('0x55')]){_0x47a83c[_0xdd0c('0x53')]=_[_0xdd0c('0x56')](_0x47a83c[_0xdd0c('0x53')],{'$or':_[_0xdd0c('0x42')](_0x47a83c[_0xdd0c('0x4b')],function(_0x45e584){var _0xcca9f6={};_0xcca9f6[_0x45e584]={'$like':'%'+_0x28197f[_0xdd0c('0x49')][_0xdd0c('0x55')]+'%'};return _0xcca9f6;})});}_0x47a83c=_[_0xdd0c('0x56')]({},_0x47a83c,_0x28197f[_0xdd0c('0x5f')]);return _0x40226e['getApplications'](_0x47a83c);}})['then'](function(_0x225d08){if(_0x225d08){_0x30b16a=_0x225d08[_0xdd0c('0x4e')];if(!_0x28197f[_0xdd0c('0x49')]['hasOwnProperty'](_0xdd0c('0x50'))){_0x47a83c['limit']=qs[_0xdd0c('0x31')](_0x28197f[_0xdd0c('0x49')]['limit']);_0x47a83c[_0xdd0c('0x33')]=qs['offset'](_0x28197f['query'][_0xdd0c('0x33')]);}return _0x40226e[_0xdd0c('0x82')](_0x47a83c);}})['then'](function(_0x807528){if(_0x807528){return _0x807528?{'count':_0x30b16a,'rows':_0x807528}:null;}})[_0xdd0c('0x21')](respondWithResult(_0x5c031f,null))[_0xdd0c('0x5a')](handleError(_0x5c031f,null));};exports[_0xdd0c('0x83')]=function(_0x156deb,_0x4d97bc,_0x34ccce){var _0x4feff4={'channel':_0xdd0c('0x84')};var _0x15ffeb=[];var _0x1bf59f=[];var _0x25b37c={};return db[_0xdd0c('0x43')]['find']({'where':{'id':_0x156deb[_0xdd0c('0x69')]['id']},'include':[{'model':db[_0xdd0c('0x7f')],'as':_0xdd0c('0x85')}]})[_0xdd0c('0x21')](handleEntityNotFound(_0x4d97bc,null))[_0xdd0c('0x21')](function(_0x7b5c03){_0x4feff4[_0xdd0c('0x86')]=_0x7b5c03;_0x4feff4[_0xdd0c('0x87')]=_['orderBy'](_0x7b5c03['Applications'],[_0xdd0c('0x81')],[_0xdd0c('0x88')]);if(_0x4feff4[_0xdd0c('0x86')][_0xdd0c('0x85')]){delete _0x4feff4[_0xdd0c('0x86')][_0xdd0c('0x85')];}return db[_0xdd0c('0x89')][_0xdd0c('0x8a')]();})[_0xdd0c('0x21')](function(_0x519bdd){if(!_0x519bdd){throw new db[(_0xdd0c('0x8b'))][(_0xdd0c('0x8c'))](_0xdd0c('0x8d'));}_0x15ffeb=_[_0xdd0c('0x8e')](_[_0xdd0c('0x5d')](_0x519bdd),['createdAt',_0xdd0c('0x8f')]);_0x1bf59f=_[_0xdd0c('0x8e')](_[_0xdd0c('0x5d')](_0x519bdd),[_0xdd0c('0x90'),'updatedAt','CompanyId',_0xdd0c('0x91')]);_0x4feff4[_0xdd0c('0x61')]={'mapKey':'mobile'};if(_0x4feff4[_0xdd0c('0x86')][_0xdd0c('0x46')]&&_0x4feff4['account'][_0xdd0c('0x46')]===_0xdd0c('0x92')){_0x4feff4[_0xdd0c('0x61')]['from']=_0x156deb[_0xdd0c('0x61')][_0xdd0c('0x93')][_0xdd0c('0x94')](_0xdd0c('0x95'),'');_0x4feff4[_0xdd0c('0x61')][_0xdd0c('0x61')]=_0x156deb[_0xdd0c('0x61')][_0xdd0c('0x96')];_0x4feff4[_0xdd0c('0x61')][_0xdd0c('0x97')]=_0x156deb['body']['MessageSid'];}if(_0x4feff4[_0xdd0c('0x61')]['id']){delete _0x4feff4[_0xdd0c('0x61')]['id'];}if(_['isNil'](_0x4feff4[_0xdd0c('0x61')][_0xdd0c('0x98')])){throw new db['Sequelize'][(_0xdd0c('0x8c'))](_0xdd0c('0x99'));}if(_[_0xdd0c('0x9a')](_0x4feff4[_0xdd0c('0x61')][_0xdd0c('0x61')])||_0x4feff4['body'][_0xdd0c('0x61')]===''){throw new db[(_0xdd0c('0x8b'))][(_0xdd0c('0x8c'))](_0xdd0c('0x9b'));}if(_[_0xdd0c('0x9a')](_0x4feff4['body'][_0xdd0c('0x9c')])){throw new db['Sequelize'][(_0xdd0c('0x8c'))](_0xdd0c('0x9d')+_0x1bf59f);}if(!_['includes'](_0x1bf59f,_0x4feff4[_0xdd0c('0x61')][_0xdd0c('0x9c')])){throw new db['Sequelize'][(_0xdd0c('0x8c'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1bf59f);}_0x25b37c[_0x4feff4[_0xdd0c('0x61')][_0xdd0c('0x9c')]]=_0x4feff4[_0xdd0c('0x61')]['from'];return db[_0xdd0c('0x9e')][_0xdd0c('0x68')]({'where':{'id':_0x4feff4[_0xdd0c('0x86')][_0xdd0c('0x91')]},'include':[{'model':db[_0xdd0c('0x89')],'as':_0xdd0c('0x9f'),'where':_0x25b37c,'limit':0x1,'order':[[_0xdd0c('0x8f'),_0xdd0c('0xa0')]]}]});})[_0xdd0c('0x21')](handleEntityNotFound(_0x4d97bc,null))[_0xdd0c('0x21')](function(_0x4be5d0){if(_0x4be5d0){_0x4feff4[_0xdd0c('0xa1')]=_[_0xdd0c('0xa2')](_0x4be5d0,[_0xdd0c('0x9f')]);if(_0x4be5d0['Contacts']['length']){return _0x4be5d0[_0xdd0c('0x9f')][0x0];}var _0x466a14=_['defaults'](_0x4feff4['body'],{'firstName':_0x4feff4[_0xdd0c('0x61')][_0xdd0c('0x98')],'ListId':_0x4be5d0['id']});_0x466a14[_0x4feff4[_0xdd0c('0x61')][_0xdd0c('0x9c')]]=_0x4feff4[_0xdd0c('0x61')][_0xdd0c('0x98')];return db[_0xdd0c('0x89')][_0xdd0c('0x60')](_0x466a14,{'fields':_0x15ffeb,'raw':!![]});}})[_0xdd0c('0x21')](handleEntityNotFound(_0x4d97bc,null))[_0xdd0c('0x21')](function(_0x117551){if(_0x117551){_0x4feff4[_0xdd0c('0xa3')]=_0x117551;var _0x2bf9d0={'ContactId':_0x117551['id'],'phone':_0x4feff4[_0xdd0c('0x61')][_0xdd0c('0x98')],'WhatsappAccountId':_0x156deb['params']['id']};var _0x5c3178={'ContactId':_0x117551['id'],'WhatsappAccountId':_0x156deb[_0xdd0c('0x69')]['id'],'closed':![]};return db[_0xdd0c('0xa4')]['find']({'where':_0x5c3178})[_0xdd0c('0x21')](function(_0x4fe70f){if(_0x4fe70f){return[_0x4fe70f,![]];}return db[_0xdd0c('0xa4')][_0xdd0c('0x60')](_0x2bf9d0)[_0xdd0c('0x21')](function(_0xf89120){return[_0xf89120,!![]];});});}})[_0xdd0c('0x76')](function(_0x1f75e2,_0x81dec5){_0x4feff4[_0xdd0c('0xa5')]=_0x1f75e2[_0xdd0c('0x63')]({'plain':!![]});_0x4feff4[_0xdd0c('0xa5')][_0xdd0c('0xa6')]=![];if(_0x81dec5){if(_0x4feff4[_0xdd0c('0x86')][_0xdd0c('0xa7')]){_0x4feff4['applications'][_0xdd0c('0xa8')]({'id':0x0,'priority':_0x4feff4[_0xdd0c('0x87')][_0xdd0c('0x4e')]+0x1,'app':_0xdd0c('0xa9'),'appdata':_0xdd0c('0xaa'),'interval':_0xdd0c('0xab')});}_0x4feff4[_0xdd0c('0xa5')][_0xdd0c('0xa6')]=!![];}return db[_0xdd0c('0xac')][_0xdd0c('0x60')]({'phone':_0x4feff4['body'][_0xdd0c('0x98')],'messageId':_0x4feff4[_0xdd0c('0x61')][_0xdd0c('0x97')],'body':_0x4feff4['body'][_0xdd0c('0x61')],'WhatsappAccountId':_0x156deb[_0xdd0c('0x69')]['id'],'WhatsappInteractionId':_0x1f75e2['id'],'direction':'in','ContactId':_0x1f75e2[_0xdd0c('0xad')],'AttachmentId':_0x4feff4['body'][_0xdd0c('0xae')]});})['then'](function(_0x13ce17){_0x4feff4[_0xdd0c('0x2a')]=_0x13ce17;if(_0x4feff4[_0xdd0c('0xa5')][_0xdd0c('0xaf')]){return db[_0xdd0c('0x7b')][_0xdd0c('0x68')]({'attributes':['id','name'],'where':{'id':_0x4feff4[_0xdd0c('0xa5')]['UserId']}})['then'](function(_0x4fd2eb){if(_0x4fd2eb){_0x4feff4[_0xdd0c('0x87')][_0xdd0c('0xb0')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4fd2eb[_0xdd0c('0x3e')]+','+(_0x4feff4[_0xdd0c('0x86')][_0xdd0c('0xb1')]||0xa),'interval':_0xdd0c('0xab')});}return respondWithRpcPromise(_0xdd0c('0xb2'),_0xdd0c('0xb3'),_0x4feff4);});}return respondWithRpcPromise('Start',_0xdd0c('0xb3'),_0x4feff4);})[_0xdd0c('0x21')](function(_0x1217d8){if(_0x1217d8){var _0x1509c5=0xc8;var _0x447c91=_0xdd0c('0xb4');logger[_0xdd0c('0x22')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x447c91,_0x1509c5,'entity\x20found');logger[_0xdd0c('0x25')](_0xdd0c('0xb5'),_0x447c91,_0x1509c5,_0xdd0c('0xb6'),JSON[_0xdd0c('0x27')](_0x1217d8));if(_0x4feff4['account'][_0xdd0c('0x46')]===_0xdd0c('0x92')){return _0x4d97bc[_0xdd0c('0x2d')](_0x1509c5)['set'](_0xdd0c('0xb7'),_0xdd0c('0xb8'))[_0xdd0c('0x3f')]('\x0a');}else{return _0x4d97bc[_0xdd0c('0x2d')](_0x1509c5)[_0xdd0c('0x2f')](_0x1217d8);}}})[_0xdd0c('0x5a')](handleError(_0x4d97bc,null));};exports[_0xdd0c('0x3f')]=function(_0x54846e,_0x34cbe5,_0x13ea6c){var _0x5bc7a,_0x24fcab,_0x263bf4;if(_[_0xdd0c('0x9a')](_0x54846e[_0xdd0c('0x61')][_0xdd0c('0x61')])||_0x54846e[_0xdd0c('0x61')]['body']===''){throw new db[(_0xdd0c('0x8b'))][(_0xdd0c('0x8c'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xdd0c('0x9a')](_0x54846e[_0xdd0c('0x61')]['to'])){throw new db[(_0xdd0c('0x8b'))][(_0xdd0c('0x8c'))](_0xdd0c('0xb9'));}_0x5bc7a=_0x54846e[_0xdd0c('0x61')]['to'];return db[_0xdd0c('0x43')][_0xdd0c('0x68')]({'where':{'id':_0x54846e['params']['id']},'include':[{'model':db[_0xdd0c('0x9e')],'as':_0xdd0c('0xba'),'include':[{'model':db['CmContact'],'as':_0xdd0c('0x9f'),'where':{'mobile':_0x5bc7a},'limit':0x1,'order':[['updatedAt',_0xdd0c('0xa0')]]}]}]})[_0xdd0c('0x21')](handleEntityNotFound(_0x34cbe5,null))[_0xdd0c('0x21')](function(_0x34125d){if(_0x34125d&&_0x34125d['List']){_0x24fcab=_0x34125d[_0xdd0c('0x63')]({'plain':!![]});if(_0x24fcab['List']&&_0x24fcab[_0xdd0c('0xba')][_0xdd0c('0x9f')][_0xdd0c('0x4e')]){return _0x24fcab['List'][_0xdd0c('0x9f')][0x0];}return db['CmContact'][_0xdd0c('0x60')](_[_0xdd0c('0x1a')](_0x54846e[_0xdd0c('0x61')],{'firstName':_0x5bc7a,'mobile':_0x5bc7a,'phone':_0x5bc7a,'ListId':_0x24fcab[_0xdd0c('0x91')]}));}})[_0xdd0c('0x21')](handleEntityNotFound(_0x34cbe5,null))[_0xdd0c('0x21')](function(_0x406cbe){if(_0x406cbe){_0x263bf4=_0x406cbe;return db[_0xdd0c('0xa4')][_0xdd0c('0x68')]({'where':{'ContactId':_0x263bf4['id'],'closed':![],'WhatsappAccountId':_0x24fcab['id']}})['then'](function(_0x18da9b){if(_0x18da9b){return[_0x18da9b,![]];}return db['WhatsappInteraction'][_0xdd0c('0x60')]({'UserId':_0x54846e[_0xdd0c('0x62')]['id'],'ContactId':_0x263bf4['id'],'WhatsappAccountId':_0x24fcab['id'],'phone':_0x5bc7a,'firstMsgDirection':_0xdd0c('0xbb'),'Messages':[_['merge'](_0x54846e[_0xdd0c('0x61')],{'read':![],'body':_0x54846e['body']['body'],'phone':_0x5bc7a,'WhatsappAccountId':_0x24fcab['id'],'UserId':_0x54846e[_0xdd0c('0x62')]['id'],'ContactId':_0x263bf4['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0xdd0c('0xbc')}]})[_0xdd0c('0x21')](function(_0x4fad4a){return[_0x4fad4a,!![]];});});}})['spread'](function(_0x1c4bde,_0x233068){if(_0x233068){return _0x1c4bde;}return db[_0xdd0c('0xac')][_0xdd0c('0x60')](_[_0xdd0c('0x56')](_0x54846e[_0xdd0c('0x61')],{'read':![],'body':_0x54846e[_0xdd0c('0x61')]['body'],'phone':_0x5bc7a,'WhatsappAccountId':_0x24fcab['id'],'WhatsappInteractionId':_0x1c4bde['id'],'UserId':_0x54846e[_0xdd0c('0x62')]['id'],'ContactId':_0x263bf4['id']}))['then'](function(_0x45104e){_0x1c4bde['dataValues'][_0xdd0c('0xbc')]=[];_0x1c4bde['dataValues'][_0xdd0c('0xbc')][_0xdd0c('0xa8')](_0x45104e[_0xdd0c('0xbd')]);return _0x1c4bde;});})[_0xdd0c('0x21')](respondWithResult(_0x34cbe5,null))['catch'](handleError(_0x34cbe5,null));}; \ No newline at end of file +var _0x2434=['jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','WhatsappAccounts','UserProfileResource','stack','name','index','Pause','WhatsappAccount','rawAttributes','type','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','include','findAll','rows','show','params','includeAll','find','create','user','get','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','mandatoryDispositionPause','destroy','describe','addDisposition','WhatsappAccountId','Disposition','findOne','length','nolimit','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','WhatsappApplication','findAndCountAll','priority','getApplications','notify','Applications','account','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','ListId','mobile','twilio','from','From','replace','whatsapp:','Body','messageId','MessageSid','isNil','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','list','WhatsappInteraction','interaction','created','autoclose','applications','push','close','unmanaged','WhatsappMessage','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','entity\x20found','Content-Type','text/xml','send','\x0a','json','body\x20is\x20mandatory\x20and\x20not\x20empty','CmList','List','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappAccount.socket','register'];(function(_0x1e33b2,_0x3f2813){var _0x29733d=function(_0x55f8e9){while(--_0x55f8e9){_0x1e33b2['push'](_0x1e33b2['shift']());}};_0x29733d(++_0x3f2813);}(_0x2434,0x15a));var _0x4243=function(_0xd1788c,_0x4830a2){_0xd1788c=_0xd1788c-0x0;var _0x9ce47f=_0x2434[_0xd1788c];return _0x9ce47f;};'use strict';var emlformat=require(_0x4243('0x0'));var rimraf=require(_0x4243('0x1'));var zipdir=require(_0x4243('0x2'));var jsonpatch=require(_0x4243('0x3'));var rp=require('request-promise');var moment=require(_0x4243('0x4'));var BPromise=require(_0x4243('0x5'));var Mustache=require(_0x4243('0x6'));var util=require(_0x4243('0x7'));var path=require(_0x4243('0x8'));var sox=require(_0x4243('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4243('0xa'));var _=require(_0x4243('0xb'));var squel=require(_0x4243('0xc'));var crypto=require(_0x4243('0xd'));var jsforce=require(_0x4243('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4243('0xf'));var querystring=require(_0x4243('0x10'));var Papa=require(_0x4243('0x11'));var Redis=require('ioredis');var authService=require(_0x4243('0x12'));var qs=require(_0x4243('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4243('0x14'));var logger=require(_0x4243('0x15'))(_0x4243('0x16'));var utils=require(_0x4243('0x17'));var config=require(_0x4243('0x18'));var licenseUtil=require(_0x4243('0x19'));var db=require(_0x4243('0x1a'))['db'];config[_0x4243('0x1b')]=_[_0x4243('0x1c')](config[_0x4243('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x4243('0x1d'))(new Redis(config[_0x4243('0x1b')]));require(_0x4243('0x1e'))[_0x4243('0x1f')](socket);var jayson=require(_0x4243('0x20'));var client=jayson[_0x4243('0x21')][_0x4243('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x2802bb,_0x49c7d1,_0x197781,_0x4c5639){return new BPromise(function(_0x42dcb6,_0x516f42){var _0x2ad140=_0x4c5639||client;return _0x2ad140[_0x4243('0x23')](_0x2802bb,_0x197781)[_0x4243('0x24')](function(_0xe7827d){logger[_0x4243('0x25')](_0x4243('0x26'),_0x49c7d1,_0x4243('0x27'));logger[_0x4243('0x28')](_0x4243('0x29'),_0x49c7d1,'request\x20sent',JSON[_0x4243('0x2a')](_0xe7827d));if(_0xe7827d[_0x4243('0x2b')]){if(_0xe7827d[_0x4243('0x2b')][_0x4243('0x2c')]===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x49c7d1,_0xe7827d['error']['message']);return _0x516f42(_0xe7827d[_0x4243('0x2b')][_0x4243('0x2d')]);}logger['error'](_0x4243('0x26'),_0x49c7d1,_0xe7827d[_0x4243('0x2b')][_0x4243('0x2d')]);return _0x42dcb6(_0xe7827d[_0x4243('0x2b')][_0x4243('0x2d')]);}else{logger['info'](_0x4243('0x26'),_0x49c7d1,_0x4243('0x27'));_0x42dcb6(_0xe7827d['result'][_0x4243('0x2d')]);}})[_0x4243('0x2e')](function(_0x3114f0){logger[_0x4243('0x2b')](_0x4243('0x26'),_0x49c7d1,_0x3114f0);_0x516f42(_0x3114f0);});});}function respondWithStatusCode(_0x33745e,_0xfc7426){_0xfc7426=_0xfc7426||0xcc;return function(_0x503bd3){if(_0x503bd3){return _0x33745e[_0x4243('0x2f')](_0xfc7426);}return _0x33745e[_0x4243('0x30')](_0xfc7426)[_0x4243('0x31')]();};}function respondWithResult(_0x260342,_0x18c7bc){_0x18c7bc=_0x18c7bc||0xc8;return function(_0x534e56){if(_0x534e56){return _0x260342[_0x4243('0x30')](_0x18c7bc)['json'](_0x534e56);}};}function respondWithFilteredResult(_0x3809fa,_0x48173b){return function(_0x38f2b2){if(_0x38f2b2){var _0x558465=typeof _0x48173b[_0x4243('0x32')]===_0x4243('0x33')&&typeof _0x48173b[_0x4243('0x34')]==='undefined';var _0x1dbec1=_0x38f2b2[_0x4243('0x35')];var _0x1cd847=_0x558465?0x0:_0x48173b[_0x4243('0x32')];var _0xf4697=_0x558465?_0x38f2b2['count']:_0x48173b[_0x4243('0x32')]+_0x48173b[_0x4243('0x34')];var _0x486bf8;if(_0xf4697>=_0x1dbec1){_0xf4697=_0x1dbec1;_0x486bf8=0xc8;}else{_0x486bf8=0xce;}_0x3809fa[_0x4243('0x30')](_0x486bf8);return _0x3809fa[_0x4243('0x36')](_0x4243('0x37'),_0x1cd847+'-'+_0xf4697+'/'+_0x1dbec1)['json'](_0x38f2b2);}return null;};}function patchUpdates(_0x5f5219){return function(_0x3983c3){try{jsonpatch[_0x4243('0x38')](_0x3983c3,_0x5f5219,!![]);}catch(_0x578c8c){return BPromise[_0x4243('0x39')](_0x578c8c);}return _0x3983c3[_0x4243('0x3a')]();};}function saveUpdates(_0x465dab,_0x442e73){return function(_0x5275be){if(_0x5275be){return _0x5275be[_0x4243('0x3b')](_0x465dab)[_0x4243('0x24')](function(_0x4825c3){return _0x4825c3;});}return null;};}function removeEntity(_0x1b98cc,_0x4fce24){return function(_0x14a1db){if(_0x14a1db){return _0x14a1db['destroy']()[_0x4243('0x24')](function(){var _0x35e51c=_0x14a1db['get']({'plain':!![]});var _0x3e557b=_0x4243('0x3c');return db[_0x4243('0x3d')]['destroy']({'where':{'type':_0x3e557b,'resourceId':_0x35e51c['id']}})[_0x4243('0x24')](function(){return _0x14a1db;});})[_0x4243('0x24')](function(){_0x1b98cc['status'](0xcc)[_0x4243('0x31')]();});}};}function handleEntityNotFound(_0x2cd3e2,_0x5f18c0){return function(_0x26b5f5){if(!_0x26b5f5){_0x2cd3e2[_0x4243('0x2f')](0x194);}return _0x26b5f5;};}function handleError(_0xbdbab1,_0x5207f3){_0x5207f3=_0x5207f3||0x1f4;return function(_0x36cbf9){logger['error'](_0x36cbf9[_0x4243('0x3e')]);if(_0x36cbf9[_0x4243('0x3f')]){delete _0x36cbf9[_0x4243('0x3f')];}_0xbdbab1[_0x4243('0x30')](_0x5207f3)['send'](_0x36cbf9);};}exports[_0x4243('0x40')]=function(_0x46945e,_0x10ba7b){var _0x1a08ed={'include':[{'model':db[_0x4243('0x41')],'as':'mandatoryDispositionPause'}]},_0x4d207e={},_0x254236={'count':0x0,'rows':[]};var _0x2d5762=_['map'](db[_0x4243('0x42')][_0x4243('0x43')],function(_0x887c3e){return{'name':_0x887c3e['fieldName'],'type':_0x887c3e[_0x4243('0x44')]['key']};});_0x4d207e[_0x4243('0x45')]=_[_0x4243('0x46')](_0x2d5762,_0x4243('0x3f'));_0x4d207e['query']=_[_0x4243('0x47')](_0x46945e[_0x4243('0x48')]);_0x4d207e[_0x4243('0x49')]=_[_0x4243('0x4a')](_0x4d207e[_0x4243('0x45')],_0x4d207e['query']);_0x1a08ed[_0x4243('0x4b')]=_[_0x4243('0x4a')](_0x4d207e['model'],qs['fields'](_0x46945e[_0x4243('0x48')][_0x4243('0x4c')]));_0x1a08ed[_0x4243('0x4b')]=_0x1a08ed[_0x4243('0x4b')]['length']?_0x1a08ed[_0x4243('0x4b')]:_0x4d207e[_0x4243('0x45')];if(!_0x46945e[_0x4243('0x48')][_0x4243('0x4d')]('nolimit')){_0x1a08ed[_0x4243('0x34')]=qs[_0x4243('0x34')](_0x46945e['query'][_0x4243('0x34')]);_0x1a08ed[_0x4243('0x32')]=qs[_0x4243('0x32')](_0x46945e[_0x4243('0x48')]['offset']);}_0x1a08ed[_0x4243('0x4e')]=qs[_0x4243('0x4f')](_0x46945e[_0x4243('0x48')]['sort']);_0x1a08ed[_0x4243('0x50')]=qs[_0x4243('0x49')](_['pick'](_0x46945e['query'],_0x4d207e[_0x4243('0x49')]),_0x2d5762);if(_0x46945e[_0x4243('0x48')][_0x4243('0x51')]){_0x1a08ed[_0x4243('0x50')]=_['merge'](_0x1a08ed[_0x4243('0x50')],{'$or':_['map'](_0x2d5762,function(_0x44c6b7){if(_0x44c6b7[_0x4243('0x44')]!==_0x4243('0x52')){var _0x3e6859={};_0x3e6859[_0x44c6b7[_0x4243('0x3f')]]={'$like':'%'+_0x46945e['query'][_0x4243('0x51')]+'%'};return _0x3e6859;}})});}_0x1a08ed=_[_0x4243('0x53')]({},_0x1a08ed,_0x46945e[_0x4243('0x54')]);var _0x544339={'where':_0x1a08ed[_0x4243('0x50')]};return db['WhatsappAccount'][_0x4243('0x35')](_0x544339)['then'](function(_0xfb21f){_0x254236[_0x4243('0x35')]=_0xfb21f;if(_0x46945e[_0x4243('0x48')]['includeAll']){_0x1a08ed[_0x4243('0x55')]=[{'all':!![]}];}return db[_0x4243('0x42')][_0x4243('0x56')](_0x1a08ed);})['then'](function(_0x377806){_0x254236[_0x4243('0x57')]=_0x377806;return _0x254236;})[_0x4243('0x24')](respondWithFilteredResult(_0x10ba7b,_0x1a08ed))[_0x4243('0x2e')](handleError(_0x10ba7b,null));};exports[_0x4243('0x58')]=function(_0x1bd867,_0x1e90e0){var _0x4c23c4={'raw':![],'where':{'id':_0x1bd867[_0x4243('0x59')]['id']},'include':[{'model':db[_0x4243('0x41')],'as':'mandatoryDispositionPause'}]},_0x46ee80={};_0x46ee80[_0x4243('0x45')]=_[_0x4243('0x47')](db[_0x4243('0x42')][_0x4243('0x43')]);_0x46ee80['query']=_[_0x4243('0x47')](_0x1bd867[_0x4243('0x48')]);_0x46ee80[_0x4243('0x49')]=_['intersection'](_0x46ee80[_0x4243('0x45')],_0x46ee80[_0x4243('0x48')]);_0x4c23c4[_0x4243('0x4b')]=_[_0x4243('0x4a')](_0x46ee80[_0x4243('0x45')],qs[_0x4243('0x4c')](_0x1bd867[_0x4243('0x48')][_0x4243('0x4c')]));_0x4c23c4[_0x4243('0x4b')]=_0x4c23c4['attributes']['length']?_0x4c23c4['attributes']:_0x46ee80[_0x4243('0x45')];if(_0x1bd867['query'][_0x4243('0x5a')]){_0x4c23c4['include']=[{'all':!![]}];}_0x4c23c4=_[_0x4243('0x53')]({},_0x4c23c4,_0x1bd867[_0x4243('0x54')]);return db[_0x4243('0x42')][_0x4243('0x5b')](_0x4c23c4)['then'](handleEntityNotFound(_0x1e90e0,null))[_0x4243('0x24')](respondWithResult(_0x1e90e0,null))[_0x4243('0x2e')](handleError(_0x1e90e0,null));};exports[_0x4243('0x5c')]=function(_0xdbdfec,_0x47e838){return db[_0x4243('0x42')]['create'](_0xdbdfec['body'],{})[_0x4243('0x24')](function(_0x442eb3){var _0xb248c7=_0xdbdfec[_0x4243('0x5d')][_0x4243('0x5e')]({'plain':!![]});if(!_0xb248c7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb248c7[_0x4243('0x5f')]===_0x4243('0x5d')){var _0x460f28=_0x442eb3[_0x4243('0x5e')]({'plain':!![]});var _0x1b6f3d=_0x4243('0x3c');return db['UserProfileSection'][_0x4243('0x5b')]({'where':{'name':_0x1b6f3d,'userProfileId':_0xb248c7[_0x4243('0x60')]},'raw':!![]})[_0x4243('0x24')](function(_0x3dea33){if(_0x3dea33&&_0x3dea33[_0x4243('0x61')]===0x0){return db[_0x4243('0x3d')][_0x4243('0x5c')]({'name':_0x460f28['name'],'resourceId':_0x460f28['id'],'type':_0x3dea33[_0x4243('0x3f')],'sectionId':_0x3dea33['id']},{})[_0x4243('0x24')](function(){return _0x442eb3;});}else{return _0x442eb3;}})[_0x4243('0x2e')](function(_0x294736){logger[_0x4243('0x2b')](_0x4243('0x62'),_0x294736);throw _0x294736;});}return _0x442eb3;})[_0x4243('0x24')](respondWithResult(_0x47e838,0xc9))['catch'](handleError(_0x47e838,null));};exports[_0x4243('0x3b')]=function(_0x55dd82,_0x9f993b){if(_0x55dd82[_0x4243('0x63')]['id']){delete _0x55dd82[_0x4243('0x63')]['id'];}return db[_0x4243('0x42')][_0x4243('0x5b')]({'where':{'id':_0x55dd82[_0x4243('0x59')]['id']},'include':[{'model':db['Pause'],'as':_0x4243('0x64')}]})[_0x4243('0x24')](handleEntityNotFound(_0x9f993b,null))[_0x4243('0x24')](saveUpdates(_0x55dd82[_0x4243('0x63')],null))[_0x4243('0x24')](respondWithResult(_0x9f993b,null))[_0x4243('0x2e')](handleError(_0x9f993b,null));};exports[_0x4243('0x65')]=function(_0x262f6f,_0x10334e){return db[_0x4243('0x42')][_0x4243('0x5b')]({'where':{'id':_0x262f6f[_0x4243('0x59')]['id']}})['then'](handleEntityNotFound(_0x10334e,null))[_0x4243('0x24')](removeEntity(_0x10334e,null))[_0x4243('0x2e')](handleError(_0x10334e,null));};exports[_0x4243('0x66')]=function(_0x52ffbe,_0x4db352){return db[_0x4243('0x42')]['describe']()[_0x4243('0x24')](respondWithResult(_0x4db352,null))['catch'](handleError(_0x4db352,null));};exports[_0x4243('0x67')]=function(_0xafaac6,_0x513f9d,_0x1dc70b){if(_0xafaac6['body']['id']){delete _0xafaac6[_0x4243('0x63')]['id'];}return db[_0x4243('0x42')]['find']({'where':{'id':_0xafaac6[_0x4243('0x59')]['id']}})[_0x4243('0x24')](handleEntityNotFound(_0x513f9d,null))[_0x4243('0x24')](function(_0x196d1a){if(_0x196d1a){_0xafaac6['body'][_0x4243('0x68')]=_0x196d1a['id'];return db[_0x4243('0x69')][_0x4243('0x5c')](_0xafaac6[_0x4243('0x63')]);}})[_0x4243('0x24')](respondWithResult(_0x513f9d,null))[_0x4243('0x2e')](handleError(_0x513f9d,null));};exports['getDispositions']=function(_0x20f1b0,_0x3c9462,_0x3f7beb){var _0x5262ac={'raw':![],'where':{}};var _0x4979de={};var _0xd77660={'count':0x0,'rows':[]};return db[_0x4243('0x42')][_0x4243('0x6a')]({'where':{'id':_0x20f1b0[_0x4243('0x59')]['id']}})[_0x4243('0x24')](handleEntityNotFound(_0x3c9462,null))[_0x4243('0x24')](function(_0x412165){if(_0x412165){_0x4979de[_0x4243('0x45')]=_[_0x4243('0x47')](db[_0x4243('0x69')]['rawAttributes']);_0x4979de[_0x4243('0x48')]=_['keys'](_0x20f1b0[_0x4243('0x48')]);_0x4979de[_0x4243('0x49')]=_['intersection'](_0x4979de[_0x4243('0x45')],_0x4979de['query']);_0x5262ac[_0x4243('0x4b')]=_[_0x4243('0x4a')](_0x4979de['model'],qs['fields'](_0x20f1b0['query'][_0x4243('0x4c')]));_0x5262ac[_0x4243('0x4b')]=_0x5262ac[_0x4243('0x4b')][_0x4243('0x6b')]?_0x5262ac['attributes']:_0x4979de[_0x4243('0x45')];if(!_0x20f1b0[_0x4243('0x48')]['hasOwnProperty'](_0x4243('0x6c'))){_0x5262ac[_0x4243('0x34')]=qs[_0x4243('0x34')](_0x20f1b0[_0x4243('0x48')]['limit']);_0x5262ac['offset']=qs[_0x4243('0x32')](_0x20f1b0[_0x4243('0x48')]['offset']);}_0x5262ac[_0x4243('0x4e')]=qs[_0x4243('0x4f')](_0x20f1b0[_0x4243('0x48')][_0x4243('0x4f')]);_0x5262ac[_0x4243('0x50')]=qs[_0x4243('0x49')](_[_0x4243('0x6d')](_0x20f1b0[_0x4243('0x48')],_0x4979de[_0x4243('0x49')]));_0x5262ac[_0x4243('0x50')]['WhatsappAccountId']=_0x412165['id'];if(_0x20f1b0[_0x4243('0x48')][_0x4243('0x51')]){_0x5262ac[_0x4243('0x50')]=_[_0x4243('0x53')](_0x5262ac[_0x4243('0x50')],{'$or':_[_0x4243('0x46')](_0x5262ac[_0x4243('0x4b')],function(_0x11abf7){var _0x442d1d={};_0x442d1d[_0x11abf7]={'$like':'%'+_0x20f1b0[_0x4243('0x48')][_0x4243('0x51')]+'%'};return _0x442d1d;})});}_0x5262ac=_[_0x4243('0x53')]({},_0x5262ac,_0x20f1b0[_0x4243('0x54')]);return db[_0x4243('0x69')][_0x4243('0x35')]({'where':_0x5262ac['where']})['then'](function(_0x2536cf){_0xd77660[_0x4243('0x35')]=_0x2536cf;if(_0x20f1b0[_0x4243('0x48')][_0x4243('0x5a')]){_0x5262ac['include']=[{'all':!![]}];}return db[_0x4243('0x69')][_0x4243('0x56')](_0x5262ac);})['then'](function(_0x1597d3){_0xd77660[_0x4243('0x57')]=_0x1597d3;return _0xd77660;});}})[_0x4243('0x24')](respondWithFilteredResult(_0x3c9462,_0x5262ac))['catch'](handleError(_0x3c9462,null));};exports[_0x4243('0x6e')]=function(_0x2ffbc3,_0x55047b,_0x2b451d){return db[_0x4243('0x42')][_0x4243('0x5b')]({'where':{'id':_0x2ffbc3[_0x4243('0x59')]['id']}})[_0x4243('0x24')](handleEntityNotFound(_0x55047b,null))[_0x4243('0x24')](function(_0x4cc450){if(_0x4cc450){return _0x4cc450[_0x4243('0x6e')](_0x2ffbc3[_0x4243('0x48')][_0x4243('0x6f')]);}})[_0x4243('0x24')](respondWithStatusCode(_0x55047b,null))[_0x4243('0x2e')](handleError(_0x55047b,null));};exports[_0x4243('0x70')]=function(_0x494f7e,_0x5bfdb0,_0x2e301c){if(_0x494f7e[_0x4243('0x63')]['id']){delete _0x494f7e[_0x4243('0x63')]['id'];}return db[_0x4243('0x42')][_0x4243('0x5b')]({'where':{'id':_0x494f7e[_0x4243('0x59')]['id']}})[_0x4243('0x24')](handleEntityNotFound(_0x5bfdb0,null))[_0x4243('0x24')](function(_0x4af611){if(_0x4af611){_0x494f7e['body'][_0x4243('0x68')]=_0x4af611['id'];return db[_0x4243('0x71')]['create'](_0x494f7e[_0x4243('0x63')]);}})[_0x4243('0x24')](respondWithResult(_0x5bfdb0,null))[_0x4243('0x2e')](handleError(_0x5bfdb0,null));};exports[_0x4243('0x72')]=function(_0x304fee,_0x59ef3c,_0x357b43){var _0x168f85={'raw':![],'where':{}};var _0x501904={};var _0x80ec7={'count':0x0,'rows':[]};return db[_0x4243('0x42')][_0x4243('0x6a')]({'where':{'id':_0x304fee[_0x4243('0x59')]['id']}})[_0x4243('0x24')](handleEntityNotFound(_0x59ef3c,null))[_0x4243('0x24')](function(_0xd72c41){if(_0xd72c41){_0x501904[_0x4243('0x45')]=_[_0x4243('0x47')](db[_0x4243('0x71')][_0x4243('0x43')]);_0x501904[_0x4243('0x48')]=_[_0x4243('0x47')](_0x304fee['query']);_0x501904[_0x4243('0x49')]=_[_0x4243('0x4a')](_0x501904[_0x4243('0x45')],_0x501904[_0x4243('0x48')]);_0x168f85[_0x4243('0x4b')]=_['intersection'](_0x501904[_0x4243('0x45')],qs[_0x4243('0x4c')](_0x304fee[_0x4243('0x48')]['fields']));_0x168f85['attributes']=_0x168f85['attributes'][_0x4243('0x6b')]?_0x168f85[_0x4243('0x4b')]:_0x501904[_0x4243('0x45')];if(!_0x304fee['query']['hasOwnProperty'](_0x4243('0x6c'))){_0x168f85[_0x4243('0x34')]=qs['limit'](_0x304fee[_0x4243('0x48')]['limit']);_0x168f85['offset']=qs['offset'](_0x304fee['query'][_0x4243('0x32')]);}_0x168f85[_0x4243('0x4e')]=qs['sort'](_0x304fee['query']['sort']);_0x168f85[_0x4243('0x50')]=qs[_0x4243('0x49')](_['pick'](_0x304fee['query'],_0x501904[_0x4243('0x49')]));_0x168f85[_0x4243('0x50')][_0x4243('0x68')]=_0xd72c41['id'];if(_0x304fee['query'][_0x4243('0x51')]){_0x168f85[_0x4243('0x50')]=_[_0x4243('0x53')](_0x168f85[_0x4243('0x50')],{'$or':_[_0x4243('0x46')](_0x168f85[_0x4243('0x4b')],function(_0xc15c88){var _0x28c256={};_0x28c256[_0xc15c88]={'$like':'%'+_0x304fee[_0x4243('0x48')]['filter']+'%'};return _0x28c256;})});}_0x168f85=_[_0x4243('0x53')]({},_0x168f85,_0x304fee[_0x4243('0x54')]);return db['CannedAnswer'][_0x4243('0x35')]({'where':_0x168f85[_0x4243('0x50')]})[_0x4243('0x24')](function(_0x3fde94){_0x80ec7[_0x4243('0x35')]=_0x3fde94;if(_0x304fee[_0x4243('0x48')][_0x4243('0x5a')]){_0x168f85[_0x4243('0x55')]=[{'all':!![]}];}return db[_0x4243('0x71')][_0x4243('0x56')](_0x168f85);})['then'](function(_0x41cde9){_0x80ec7[_0x4243('0x57')]=_0x41cde9;return _0x80ec7;});}})[_0x4243('0x24')](respondWithFilteredResult(_0x59ef3c,_0x168f85))['catch'](handleError(_0x59ef3c,null));};exports[_0x4243('0x73')]=function(_0x363573,_0x979a5e,_0x46082c){return db[_0x4243('0x42')]['find']({'where':{'id':_0x363573[_0x4243('0x59')]['id']}})['then'](handleEntityNotFound(_0x979a5e,null))[_0x4243('0x24')](function(_0x4b7b9e){if(_0x4b7b9e){return _0x4b7b9e[_0x4243('0x73')](_0x363573[_0x4243('0x48')][_0x4243('0x6f')]);}})[_0x4243('0x24')](respondWithStatusCode(_0x979a5e,null))[_0x4243('0x2e')](handleError(_0x979a5e,null));};exports[_0x4243('0x74')]=function(_0x5529e0,_0x128201,_0xa36043){return db[_0x4243('0x42')][_0x4243('0x5b')]({'where':{'id':_0x5529e0[_0x4243('0x59')]['id']}})['then'](handleEntityNotFound(_0x128201,null))[_0x4243('0x24')](function(_0x2855a4){if(_0x2855a4){return _0x2855a4[_0x4243('0x74')](_0x5529e0[_0x4243('0x63')]['ids'],_[_0x4243('0x75')](_0x5529e0[_0x4243('0x63')],[_0x4243('0x6f'),'id'])||{})[_0x4243('0x76')](function(_0x4956b1){for(var _0x5a8aed=0x0;_0x5a8aed<_0x5529e0[_0x4243('0x63')][_0x4243('0x6f')][_0x4243('0x6b')];_0x5a8aed+=0x1){socket[_0x4243('0x77')](_0x4243('0x78'),{'UserId':Number(_0x5529e0[_0x4243('0x63')]['ids'][_0x5a8aed]),'WhatsappAccountId':Number(_0x5529e0[_0x4243('0x59')]['id'])});}return _0x4956b1;});}})['then'](respondWithResult(_0x128201,null))[_0x4243('0x2e')](handleError(_0x128201,null));};exports['removeAgents']=function(_0x59a087,_0x5eb152,_0x5b126d){return db[_0x4243('0x42')][_0x4243('0x5b')]({'where':{'id':_0x59a087[_0x4243('0x59')]['id']}})[_0x4243('0x24')](handleEntityNotFound(_0x5eb152,null))[_0x4243('0x24')](function(_0x569d8d){if(_0x569d8d){return _0x569d8d['removeAgents'](_0x59a087[_0x4243('0x48')][_0x4243('0x6f')])[_0x4243('0x24')](function(){if(_[_0x4243('0x79')](_0x59a087[_0x4243('0x48')][_0x4243('0x6f')])){for(var _0x6ada21=0x0;_0x6ada21<_0x59a087['query'][_0x4243('0x6f')]['length'];_0x6ada21+=0x1){socket['emit'](_0x4243('0x7a'),{'UserId':Number(_0x59a087[_0x4243('0x48')][_0x4243('0x6f')][_0x6ada21]),'WhatsappAccountId':Number(_0x59a087[_0x4243('0x59')]['id'])});}}else{socket[_0x4243('0x77')]('userWhatsappAccount:remove',{'UserId':Number(_0x59a087[_0x4243('0x48')][_0x4243('0x6f')]),'WhatsappAccountId':Number(_0x59a087[_0x4243('0x59')]['id'])});}});}})['then'](respondWithStatusCode(_0x5eb152,null))[_0x4243('0x2e')](handleError(_0x5eb152,null));};exports[_0x4243('0x7b')]=function(_0x1558fb,_0x3cca3e,_0x30bf3f){var _0x1f82b7={};var _0x1007a5={};var _0x322e45;var _0x51b244;return db[_0x4243('0x42')][_0x4243('0x6a')]({'where':{'id':_0x1558fb[_0x4243('0x59')]['id']}})['then'](handleEntityNotFound(_0x3cca3e,null))[_0x4243('0x24')](function(_0x11244c){if(_0x11244c){_0x322e45=_0x11244c;_0x1007a5[_0x4243('0x45')]=_[_0x4243('0x47')](db[_0x4243('0x7c')][_0x4243('0x43')]);_0x1007a5['query']=_[_0x4243('0x47')](_0x1558fb['query']);_0x1007a5[_0x4243('0x49')]=_[_0x4243('0x4a')](_0x1007a5['model'],_0x1007a5[_0x4243('0x48')]);_0x1f82b7[_0x4243('0x4b')]=_['intersection'](_0x1007a5[_0x4243('0x45')],qs[_0x4243('0x4c')](_0x1558fb['query']['fields']));_0x1f82b7['attributes']=_0x1f82b7[_0x4243('0x4b')]['length']?_0x1f82b7['attributes']:_0x1007a5[_0x4243('0x45')];_0x1f82b7[_0x4243('0x4e')]=qs['sort'](_0x1558fb[_0x4243('0x48')]['sort']);_0x1f82b7[_0x4243('0x50')]=qs[_0x4243('0x49')](_[_0x4243('0x6d')](_0x1558fb[_0x4243('0x48')],_0x1007a5[_0x4243('0x49')]));if(_0x1558fb[_0x4243('0x48')][_0x4243('0x51')]){_0x1f82b7[_0x4243('0x50')]=_[_0x4243('0x53')](_0x1f82b7[_0x4243('0x50')],{'$or':_['map'](_0x1f82b7[_0x4243('0x4b')],function(_0x44ea33){var _0x144b06={};_0x144b06[_0x44ea33]={'$like':'%'+_0x1558fb['query'][_0x4243('0x51')]+'%'};return _0x144b06;})});}_0x1f82b7=_['merge']({},_0x1f82b7,_0x1558fb[_0x4243('0x54')]);return _0x322e45[_0x4243('0x7b')](_0x1f82b7);}})[_0x4243('0x24')](function(_0x1e53c2){if(_0x1e53c2){_0x51b244=_0x1e53c2[_0x4243('0x6b')];if(!_0x1558fb[_0x4243('0x48')][_0x4243('0x4d')]('nolimit')){_0x1f82b7[_0x4243('0x34')]=qs[_0x4243('0x34')](_0x1558fb['query'][_0x4243('0x34')]);_0x1f82b7[_0x4243('0x32')]=qs[_0x4243('0x32')](_0x1558fb['query'][_0x4243('0x32')]);}return _0x322e45[_0x4243('0x7b')](_0x1f82b7);}})['then'](function(_0x5831a4){if(_0x5831a4){return _0x5831a4?{'count':_0x51b244,'rows':_0x5831a4}:null;}})[_0x4243('0x24')](respondWithResult(_0x3cca3e,null))['catch'](handleError(_0x3cca3e,null));};exports[_0x4243('0x7d')]=function(_0x55b859,_0x521d5c,_0x449880){return db[_0x4243('0x42')][_0x4243('0x6a')]({'where':{'id':_0x55b859['params']['id']}})['then'](handleEntityNotFound(_0x521d5c,null))[_0x4243('0x24')](function(_0x241a78){if(_0x241a78){return db[_0x4243('0x7e')][_0x4243('0x7f')](function(_0x4ffe6f){return db[_0x4243('0x80')][_0x4243('0x65')]({'where':{'WhatsappAccountId':_0x55b859[_0x4243('0x59')]['id']},'transaction':_0x4ffe6f})[_0x4243('0x24')](function(_0x56a7df){var _0x18ff1e=_[_0x4243('0x46')](_0x55b859[_0x4243('0x63')],function(_0x4c74a7){_0x4c74a7[_0x4243('0x68')]=_0x55b859[_0x4243('0x59')]['id'];return _0x4c74a7;});return db[_0x4243('0x80')]['bulkCreate'](_0x18ff1e,{'transaction':_0x4ffe6f});});})[_0x4243('0x24')](function(){return db[_0x4243('0x80')][_0x4243('0x81')]({'where':{'WhatsappAccountId':_0x55b859[_0x4243('0x59')]['id']},'order':_0x4243('0x82')});});}})[_0x4243('0x24')](respondWithResult(_0x521d5c,null))['catch'](handleError(_0x521d5c,null));};exports['getApplications']=function(_0xa30de5,_0x4653b8,_0x487942){var _0x1db79d={};var _0x579c8f={};var _0x3f4aa6;var _0x24c427;return db['WhatsappAccount'][_0x4243('0x6a')]({'where':{'id':_0xa30de5[_0x4243('0x59')]['id']}})[_0x4243('0x24')](handleEntityNotFound(_0x4653b8,null))[_0x4243('0x24')](function(_0x4699d6){if(_0x4699d6){_0x3f4aa6=_0x4699d6;_0x579c8f['model']=_[_0x4243('0x47')](db[_0x4243('0x80')][_0x4243('0x43')]);_0x579c8f['query']=_[_0x4243('0x47')](_0xa30de5[_0x4243('0x48')]);_0x579c8f['filters']=_[_0x4243('0x4a')](_0x579c8f[_0x4243('0x45')],_0x579c8f[_0x4243('0x48')]);_0x1db79d[_0x4243('0x4b')]=_['intersection'](_0x579c8f[_0x4243('0x45')],qs[_0x4243('0x4c')](_0xa30de5[_0x4243('0x48')][_0x4243('0x4c')]));_0x1db79d[_0x4243('0x4b')]=_0x1db79d['attributes']['length']?_0x1db79d[_0x4243('0x4b')]:_0x579c8f[_0x4243('0x45')];_0x1db79d[_0x4243('0x4e')]=qs[_0x4243('0x4f')](_0xa30de5[_0x4243('0x48')][_0x4243('0x4f')]);_0x1db79d[_0x4243('0x50')]=qs['filters'](_[_0x4243('0x6d')](_0xa30de5[_0x4243('0x48')],_0x579c8f['filters']));if(_0xa30de5[_0x4243('0x48')]['filter']){_0x1db79d[_0x4243('0x50')]=_[_0x4243('0x53')](_0x1db79d['where'],{'$or':_['map'](_0x1db79d[_0x4243('0x4b')],function(_0x5d41bc){var _0x37473b={};_0x37473b[_0x5d41bc]={'$like':'%'+_0xa30de5['query'][_0x4243('0x51')]+'%'};return _0x37473b;})});}_0x1db79d=_[_0x4243('0x53')]({},_0x1db79d,_0xa30de5['options']);return _0x3f4aa6[_0x4243('0x83')](_0x1db79d);}})['then'](function(_0x22ade4){if(_0x22ade4){_0x24c427=_0x22ade4[_0x4243('0x6b')];if(!_0xa30de5[_0x4243('0x48')][_0x4243('0x4d')](_0x4243('0x6c'))){_0x1db79d['limit']=qs[_0x4243('0x34')](_0xa30de5['query'][_0x4243('0x34')]);_0x1db79d['offset']=qs[_0x4243('0x32')](_0xa30de5['query'][_0x4243('0x32')]);}return _0x3f4aa6[_0x4243('0x83')](_0x1db79d);}})[_0x4243('0x24')](function(_0x21489c){if(_0x21489c){return _0x21489c?{'count':_0x24c427,'rows':_0x21489c}:null;}})['then'](respondWithResult(_0x4653b8,null))['catch'](handleError(_0x4653b8,null));};exports[_0x4243('0x84')]=function(_0x13a5cb,_0x56f929,_0x198a3d){var _0x2cbf26={'channel':'whatsapp'};var _0x263d71=[];var _0x2e078c=[];var _0x112178={};return db[_0x4243('0x42')]['find']({'where':{'id':_0x13a5cb[_0x4243('0x59')]['id']},'include':[{'model':db[_0x4243('0x80')],'as':_0x4243('0x85')}]})[_0x4243('0x24')](handleEntityNotFound(_0x56f929,null))[_0x4243('0x24')](function(_0x481da2){_0x2cbf26['account']=_0x481da2;_0x2cbf26['applications']=_['orderBy'](_0x481da2[_0x4243('0x85')],[_0x4243('0x82')],['asc']);if(_0x2cbf26[_0x4243('0x86')][_0x4243('0x85')]){delete _0x2cbf26[_0x4243('0x86')][_0x4243('0x85')];}return db[_0x4243('0x87')][_0x4243('0x66')]();})[_0x4243('0x24')](function(_0x5bc391){if(!_0x5bc391){throw new db[(_0x4243('0x88'))][(_0x4243('0x89'))](_0x4243('0x8a'));}_0x263d71=_[_0x4243('0x8b')](_[_0x4243('0x47')](_0x5bc391),['createdAt',_0x4243('0x8c')]);_0x2e078c=_[_0x4243('0x8b')](_[_0x4243('0x47')](_0x5bc391),[_0x4243('0x8d'),'updatedAt','CompanyId',_0x4243('0x8e')]);_0x2cbf26[_0x4243('0x63')]={'mapKey':_0x4243('0x8f')};if(_0x2cbf26[_0x4243('0x86')][_0x4243('0x44')]&&_0x2cbf26[_0x4243('0x86')]['type']===_0x4243('0x90')){_0x2cbf26[_0x4243('0x63')][_0x4243('0x91')]=_0x13a5cb[_0x4243('0x63')][_0x4243('0x92')][_0x4243('0x93')](_0x4243('0x94'),'');_0x2cbf26[_0x4243('0x63')]['body']=_0x13a5cb[_0x4243('0x63')][_0x4243('0x95')];_0x2cbf26['body'][_0x4243('0x96')]=_0x13a5cb[_0x4243('0x63')][_0x4243('0x97')];}if(_0x2cbf26[_0x4243('0x63')]['id']){delete _0x2cbf26[_0x4243('0x63')]['id'];}if(_[_0x4243('0x98')](_0x2cbf26['body']['from'])){throw new db[(_0x4243('0x88'))][(_0x4243('0x89'))](_0x4243('0x99'));}if(_[_0x4243('0x98')](_0x2cbf26[_0x4243('0x63')][_0x4243('0x63')])||_0x2cbf26[_0x4243('0x63')][_0x4243('0x63')]===''){throw new db[(_0x4243('0x88'))][(_0x4243('0x89'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x2cbf26['body']['mapKey'])){throw new db[(_0x4243('0x88'))][(_0x4243('0x89'))](_0x4243('0x9a')+_0x2e078c);}if(!_[_0x4243('0x9b')](_0x2e078c,_0x2cbf26[_0x4243('0x63')][_0x4243('0x9c')])){throw new db[(_0x4243('0x88'))][(_0x4243('0x89'))](_0x4243('0x9d')+_0x2e078c);}_0x112178[_0x2cbf26[_0x4243('0x63')]['mapKey']]=_0x2cbf26[_0x4243('0x63')][_0x4243('0x91')];return db['CmList']['find']({'where':{'id':_0x2cbf26[_0x4243('0x86')][_0x4243('0x8e')]},'include':[{'model':db['CmContact'],'as':_0x4243('0x9e'),'where':_0x112178,'limit':0x1,'order':[[_0x4243('0x8c'),_0x4243('0x9f')]]}]});})['then'](handleEntityNotFound(_0x56f929,null))[_0x4243('0x24')](function(_0x17c327){if(_0x17c327){_0x2cbf26[_0x4243('0xa0')]=_[_0x4243('0x75')](_0x17c327,[_0x4243('0x9e')]);if(_0x17c327['Contacts'][_0x4243('0x6b')]){return _0x17c327['Contacts'][0x0];}var _0x415e2c=_['defaults'](_0x2cbf26[_0x4243('0x63')],{'firstName':_0x2cbf26[_0x4243('0x63')][_0x4243('0x91')],'ListId':_0x17c327['id']});_0x415e2c[_0x2cbf26['body'][_0x4243('0x9c')]]=_0x2cbf26[_0x4243('0x63')][_0x4243('0x91')];return db[_0x4243('0x87')][_0x4243('0x5c')](_0x415e2c,{'fields':_0x263d71,'raw':!![]});}})[_0x4243('0x24')](handleEntityNotFound(_0x56f929,null))[_0x4243('0x24')](function(_0x381454){if(_0x381454){_0x2cbf26['contact']=_0x381454;var _0x24be15={'ContactId':_0x381454['id'],'phone':_0x2cbf26[_0x4243('0x63')]['from'],'WhatsappAccountId':_0x13a5cb[_0x4243('0x59')]['id']};var _0x344fe8={'ContactId':_0x381454['id'],'WhatsappAccountId':_0x13a5cb['params']['id'],'closed':![]};return db['WhatsappInteraction']['find']({'where':_0x344fe8})[_0x4243('0x24')](function(_0x113067){if(_0x113067){return[_0x113067,![]];}return db[_0x4243('0xa1')][_0x4243('0x5c')](_0x24be15)[_0x4243('0x24')](function(_0x17022c){return[_0x17022c,!![]];});});}})[_0x4243('0x76')](function(_0x535e0b,_0x459878){_0x2cbf26[_0x4243('0xa2')]=_0x535e0b[_0x4243('0x5e')]({'plain':!![]});_0x2cbf26[_0x4243('0xa2')][_0x4243('0xa3')]=![];if(_0x459878){if(_0x2cbf26[_0x4243('0x86')][_0x4243('0xa4')]){_0x2cbf26[_0x4243('0xa5')][_0x4243('0xa6')]({'id':0x0,'priority':_0x2cbf26[_0x4243('0xa5')][_0x4243('0x6b')]+0x1,'app':_0x4243('0xa7'),'appdata':_0x4243('0xa8'),'interval':'*,*,*,*'});}_0x2cbf26[_0x4243('0xa2')][_0x4243('0xa3')]=!![];}return db[_0x4243('0xa9')][_0x4243('0x5c')]({'phone':_0x2cbf26[_0x4243('0x63')][_0x4243('0x91')],'messageId':_0x2cbf26[_0x4243('0x63')][_0x4243('0x96')],'body':_0x2cbf26['body'][_0x4243('0x63')],'WhatsappAccountId':_0x13a5cb[_0x4243('0x59')]['id'],'WhatsappInteractionId':_0x535e0b['id'],'direction':'in','ContactId':_0x535e0b[_0x4243('0xaa')],'AttachmentId':_0x2cbf26['body'][_0x4243('0xab')]});})[_0x4243('0x24')](function(_0x46cd48){_0x2cbf26[_0x4243('0x2d')]=_0x46cd48;if(_0x2cbf26[_0x4243('0xa2')][_0x4243('0xac')]){return db[_0x4243('0x7c')][_0x4243('0x5b')]({'attributes':['id',_0x4243('0x3f')],'where':{'id':_0x2cbf26[_0x4243('0xa2')][_0x4243('0xac')]}})[_0x4243('0x24')](function(_0x569c4f){if(_0x569c4f){_0x2cbf26[_0x4243('0xa5')][_0x4243('0xad')]({'id':0x0,'priority':0x0,'app':_0x4243('0xae'),'appdata':_0x569c4f[_0x4243('0x3f')]+','+(_0x2cbf26[_0x4243('0x86')][_0x4243('0xaf')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x4243('0xb0'),'startRouting',_0x2cbf26);});}return respondWithRpcPromise('Start',_0x4243('0xb1'),_0x2cbf26);})[_0x4243('0x24')](function(_0x356839){if(_0x356839){var _0x30f34b=0xc8;var _0x44b01b='receiveMessage';logger[_0x4243('0x25')](_0x4243('0x29'),_0x44b01b,_0x30f34b,_0x4243('0xb2'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x44b01b,_0x30f34b,_0x4243('0xb2'),JSON['stringify'](_0x356839));if(_0x2cbf26[_0x4243('0x86')][_0x4243('0x44')]===_0x4243('0x90')){return _0x56f929[_0x4243('0x30')](_0x30f34b)['set'](_0x4243('0xb3'),_0x4243('0xb4'))[_0x4243('0xb5')](_0x4243('0xb6'));}else{return _0x56f929[_0x4243('0x30')](_0x30f34b)[_0x4243('0xb7')](_0x356839);}}})[_0x4243('0x2e')](handleError(_0x56f929,null));};exports[_0x4243('0xb5')]=function(_0x2cb65b,_0x20e6e1,_0x502d33){var _0x2a4db6,_0x215b2d,_0xb7d720;if(_[_0x4243('0x98')](_0x2cb65b['body'][_0x4243('0x63')])||_0x2cb65b['body'][_0x4243('0x63')]===''){throw new db['Sequelize'][(_0x4243('0x89'))](_0x4243('0xb8'));}if(_[_0x4243('0x98')](_0x2cb65b[_0x4243('0x63')]['to'])){throw new db[(_0x4243('0x88'))][(_0x4243('0x89'))]('to\x20is\x20mandatory');}_0x2a4db6=_0x2cb65b[_0x4243('0x63')]['to'];return db[_0x4243('0x42')][_0x4243('0x5b')]({'where':{'id':_0x2cb65b['params']['id']},'include':[{'model':db[_0x4243('0xb9')],'as':_0x4243('0xba'),'include':[{'model':db[_0x4243('0x87')],'as':_0x4243('0x9e'),'where':{'mobile':_0x2a4db6},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x4243('0x24')](handleEntityNotFound(_0x20e6e1,null))[_0x4243('0x24')](function(_0x4b2291){if(_0x4b2291&&_0x4b2291['List']){_0x215b2d=_0x4b2291['get']({'plain':!![]});if(_0x215b2d['List']&&_0x215b2d['List'][_0x4243('0x9e')][_0x4243('0x6b')]){return _0x215b2d['List'][_0x4243('0x9e')][0x0];}return db[_0x4243('0x87')]['create'](_['defaults'](_0x2cb65b[_0x4243('0x63')],{'firstName':_0x2a4db6,'mobile':_0x2a4db6,'phone':_0x2a4db6,'ListId':_0x215b2d[_0x4243('0x8e')]}));}})['then'](handleEntityNotFound(_0x20e6e1,null))[_0x4243('0x24')](function(_0x2a72e9){if(_0x2a72e9){_0xb7d720=_0x2a72e9;return db[_0x4243('0xa1')][_0x4243('0x5b')]({'where':{'ContactId':_0xb7d720['id'],'closed':![],'WhatsappAccountId':_0x215b2d['id']}})[_0x4243('0x24')](function(_0xde3eca){if(_0xde3eca){return[_0xde3eca,![]];}return db[_0x4243('0xa1')][_0x4243('0x5c')]({'UserId':_0x2cb65b['user']['id'],'ContactId':_0xb7d720['id'],'WhatsappAccountId':_0x215b2d['id'],'phone':_0x2a4db6,'firstMsgDirection':'out','Messages':[_['merge'](_0x2cb65b[_0x4243('0x63')],{'read':![],'body':_0x2cb65b[_0x4243('0x63')][_0x4243('0x63')],'phone':_0x2a4db6,'WhatsappAccountId':_0x215b2d['id'],'UserId':_0x2cb65b['user']['id'],'ContactId':_0xb7d720['id']})]},{'include':[{'model':db[_0x4243('0xa9')],'as':_0x4243('0xbb')}]})[_0x4243('0x24')](function(_0x5ed783){return[_0x5ed783,!![]];});});}})['spread'](function(_0x5d4cd2,_0x4f2c2c){if(_0x4f2c2c){return _0x5d4cd2;}return db[_0x4243('0xa9')][_0x4243('0x5c')](_[_0x4243('0x53')](_0x2cb65b[_0x4243('0x63')],{'read':![],'body':_0x2cb65b['body'][_0x4243('0x63')],'phone':_0x2a4db6,'WhatsappAccountId':_0x215b2d['id'],'WhatsappInteractionId':_0x5d4cd2['id'],'UserId':_0x2cb65b[_0x4243('0x5d')]['id'],'ContactId':_0xb7d720['id']}))[_0x4243('0x24')](function(_0x5e6d18){_0x5d4cd2['dataValues'][_0x4243('0xbb')]=[];_0x5d4cd2[_0x4243('0xbc')]['Messages'][_0x4243('0xa6')](_0x5e6d18[_0x4243('0xbc')]);return _0x5d4cd2;});})['then'](respondWithResult(_0x20e6e1,null))[_0x4243('0x2e')](handleError(_0x20e6e1,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index d602d3c..8d154eb 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 _0x471c=['../../mysqldb','WhatsappAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x2e8e65,_0x4bd506){var _0x36a5af=function(_0x255e4c){while(--_0x255e4c){_0x2e8e65['push'](_0x2e8e65['shift']());}};_0x36a5af(++_0x4bd506);}(_0x471c,0xbd));var _0xc471=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x471c[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xc471('0x0'));var WhatsappAccount=require(_0xc471('0x1'))['db'][_0xc471('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xc471('0x3')](0x0);var events={'afterCreate':_0xc471('0x4'),'afterUpdate':'update','afterDestroy':_0xc471('0x5')};function emitEvent(_0x16d3f4){return function(_0xa83331,_0x1911ed,_0x3ad3f8){WhatsappAccountEvents[_0xc471('0x6')](_0x16d3f4+':'+_0xa83331['id'],_0xa83331);WhatsappAccountEvents['emit'](_0x16d3f4,_0xa83331);_0x3ad3f8(null);};}for(var e in events){if(events[_0xc471('0x7')](e)){var event=events[e];WhatsappAccount[_0xc471('0x8')](e,emitEvent(event));}}module[_0xc471('0x9')]=WhatsappAccountEvents; \ No newline at end of file +var _0xf061=['update','emit','hasOwnProperty','hook','events','../../mysqldb','WhatsappAccount','save'];(function(_0x17092b,_0x2ab52c){var _0x16a6a3=function(_0x3f3bee){while(--_0x3f3bee){_0x17092b['push'](_0x17092b['shift']());}};_0x16a6a3(++_0x2ab52c);}(_0xf061,0x1d4));var _0x1f06=function(_0x580d42,_0x172d66){_0x580d42=_0x580d42-0x0;var _0x527515=_0xf061[_0x580d42];return _0x527515;};'use strict';var EventEmitter=require(_0x1f06('0x0'));var WhatsappAccount=require(_0x1f06('0x1'))['db'][_0x1f06('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1f06('0x3'),'afterUpdate':_0x1f06('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2fa1b9){return function(_0x28a1f7,_0x4d0674,_0x505dd8){WhatsappAccountEvents[_0x1f06('0x5')](_0x2fa1b9+':'+_0x28a1f7['id'],_0x28a1f7);WhatsappAccountEvents[_0x1f06('0x5')](_0x2fa1b9,_0x28a1f7);_0x505dd8(null);};}for(var e in events){if(events[_0x1f06('0x6')](e)){var event=events[e];WhatsappAccount[_0x1f06('0x7')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 6fca6c8..1999fbb 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 _0x0494=['request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','lodash','util','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0494,0x1d1));var _0x4049=function(_0x75ac65,_0x588b06){_0x75ac65=_0x75ac65-0x0;var _0x5c8774=_0x0494[_0x75ac65];return _0x5c8774;};'use strict';var _=require(_0x4049('0x0'));var util=require(_0x4049('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4049('0x2'));var BPromise=require('bluebird');var rp=require(_0x4049('0x3'));var fs=require('fs');var path=require(_0x4049('0x4'));var rimraf=require(_0x4049('0x5'));var config=require(_0x4049('0x6'));var attributes=require(_0x4049('0x7'));module[_0x4049('0x8')]=function(_0x5eb86e,_0x4762c6){return _0x5eb86e['define']('WhatsappAccount',attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf3c5=['whatsapp_accounts','util','../../config/logger','bluebird','request-promise','path','./whatsappAccount.attributes','define'];(function(_0x27879a,_0x1ccc32){var _0x36013e=function(_0x4ed5ea){while(--_0x4ed5ea){_0x27879a['push'](_0x27879a['shift']());}};_0x36013e(++_0x1ccc32);}(_0xf3c5,0xe1));var _0x5f3c=function(_0x139a23,_0x184a3f){_0x139a23=_0x139a23-0x0;var _0x4da424=_0xf3c5[_0x139a23];return _0x4da424;};'use strict';var _=require('lodash');var util=require(_0x5f3c('0x0'));var logger=require(_0x5f3c('0x1'))('api');var moment=require('moment');var BPromise=require(_0x5f3c('0x2'));var rp=require(_0x5f3c('0x3'));var fs=require('fs');var path=require(_0x5f3c('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5f3c('0x5'));module['exports']=function(_0x567e8b,_0x4afd57){return _0x567e8b[_0x5f3c('0x6')]('WhatsappAccount',attributes,{'tableName':_0x5f3c('0x7'),'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 c7c2f8c..ec68795 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 _0x8a85=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','where','attributes','include','model','map','util','bluebird'];(function(_0x3479d8,_0x464cb3){var _0x192371=function(_0x34b9c9){while(--_0x34b9c9){_0x3479d8['push'](_0x3479d8['shift']());}};_0x192371(++_0x464cb3);}(_0x8a85,0x64));var _0x58a8=function(_0x52489d,_0x5f0e9a){_0x52489d=_0x52489d-0x0;var _0x57e5b2=_0x8a85[_0x52489d];return _0x57e5b2;};'use strict';var _=require('lodash');var util=require(_0x58a8('0x0'));var moment=require('moment');var BPromise=require(_0x58a8('0x1'));var rs=require(_0x58a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x58a8('0x3'));var logger=require(_0x58a8('0x4'))(_0x58a8('0x5'));var config=require(_0x58a8('0x6'));var jayson=require(_0x58a8('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x58a8('0x8')]=_[_0x58a8('0x9')](config[_0x58a8('0x8')],{'host':_0x58a8('0xa'),'port':0x18eb});var socket=require(_0x58a8('0xb'))(new Redis(config['redis']));require(_0x58a8('0xc'))[_0x58a8('0xd')](socket);function respondWithRpcPromise(_0x8d980c,_0x562560,_0x4c6acf){return new BPromise(function(_0x478821,_0x87b49c){return client[_0x58a8('0xe')](_0x8d980c,_0x4c6acf)[_0x58a8('0xf')](function(_0x2dac73){logger[_0x58a8('0x10')](_0x58a8('0x11'),_0x562560,_0x58a8('0x12'));logger[_0x58a8('0x13')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x562560,_0x58a8('0x12'),JSON[_0x58a8('0x14')](_0x2dac73));if(_0x2dac73[_0x58a8('0x15')]){if(_0x2dac73[_0x58a8('0x15')]['code']===0x1f4){logger[_0x58a8('0x15')](_0x58a8('0x11'),_0x562560,_0x2dac73[_0x58a8('0x15')]['message']);return _0x87b49c(_0x2dac73[_0x58a8('0x15')][_0x58a8('0x16')]);}logger[_0x58a8('0x15')](_0x58a8('0x11'),_0x562560,_0x2dac73[_0x58a8('0x15')]['message']);return _0x478821(_0x2dac73[_0x58a8('0x15')]['message']);}else{logger[_0x58a8('0x10')](_0x58a8('0x11'),_0x562560,_0x58a8('0x12'));_0x478821(_0x2dac73[_0x58a8('0x17')][_0x58a8('0x16')]);}})[_0x58a8('0x18')](function(_0x5aabf6){logger['error'](_0x58a8('0x11'),_0x562560,_0x5aabf6);_0x87b49c(_0x5aabf6);});});}exports[_0x58a8('0x19')]=function(_0x3271ae){var _0x8781b3=this;return new Promise(function(_0x3fb74b,_0x1b54d5){return db[_0x58a8('0x1a')][_0x58a8('0x1b')]({'raw':_0x3271ae[_0x58a8('0x1c')]?_0x3271ae[_0x58a8('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x3271ae[_0x58a8('0x1c')]?_0x3271ae['options'][_0x58a8('0x1d')]||null:null,'attributes':_0x3271ae['options']?_0x3271ae[_0x58a8('0x1c')][_0x58a8('0x1e')]||null:null,'include':_0x3271ae[_0x58a8('0x1c')]?_0x3271ae[_0x58a8('0x1c')][_0x58a8('0x1f')]?_['map'](_0x3271ae[_0x58a8('0x1c')][_0x58a8('0x1f')],function(_0x219d19){return{'model':db[_0x219d19[_0x58a8('0x20')]],'as':_0x219d19['as'],'attributes':_0x219d19['attributes'],'include':_0x219d19['include']?_[_0x58a8('0x21')](_0x219d19[_0x58a8('0x1f')],function(_0x5f2827){return{'model':db[_0x5f2827[_0x58a8('0x20')]],'as':_0x5f2827['as'],'attributes':_0x5f2827[_0x58a8('0x1e')],'include':_0x5f2827[_0x58a8('0x1f')]?_[_0x58a8('0x21')](_0x5f2827[_0x58a8('0x1f')],function(_0x1b3bf1){return{'model':db[_0x1b3bf1[_0x58a8('0x20')]],'as':_0x1b3bf1['as'],'attributes':_0x1b3bf1[_0x58a8('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf863ac){logger[_0x58a8('0x10')](_0x58a8('0x19'),_0x3271ae);logger[_0x58a8('0x13')](_0x58a8('0x19'),_0x3271ae,JSON['stringify'](_0xf863ac));_0x3fb74b(_0xf863ac);})[_0x58a8('0x18')](function(_0x238c7b){logger[_0x58a8('0x15')](_0x58a8('0x19'),_0x238c7b['message'],_0x3271ae);_0x1b54d5(_0x8781b3[_0x58a8('0x15')](0x1f4,_0x238c7b[_0x58a8('0x16')]));});});}; \ No newline at end of file +var _0xf799=['result','catch','find','options','raw','where','attributes','model','include','map','ShowWhatsappAccount','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0xf799,0x1c7));var _0x9f79=function(_0x2525f1,_0x47034f){_0x2525f1=_0x2525f1-0x0;var _0x13c1b5=_0xf799[_0x2525f1];return _0x13c1b5;};'use strict';var _=require('lodash');var util=require(_0x9f79('0x0'));var moment=require(_0x9f79('0x1'));var BPromise=require(_0x9f79('0x2'));var rs=require(_0x9f79('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f79('0x4'))['db'];var utils=require(_0x9f79('0x5'));var logger=require(_0x9f79('0x6'))(_0x9f79('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9f79('0x8')]['http']({'port':0x232a});config[_0x9f79('0x9')]=_[_0x9f79('0xa')](config[_0x9f79('0x9')],{'host':_0x9f79('0xb'),'port':0x18eb});var socket=require(_0x9f79('0xc'))(new Redis(config[_0x9f79('0x9')]));require(_0x9f79('0xd'))[_0x9f79('0xe')](socket);function respondWithRpcPromise(_0x4eba09,_0x4e4366,_0x3aeb5b){return new BPromise(function(_0x471ef7,_0x5a5253){return client[_0x9f79('0xf')](_0x4eba09,_0x3aeb5b)[_0x9f79('0x10')](function(_0x291363){logger[_0x9f79('0x11')](_0x9f79('0x12'),_0x4e4366,'request\x20sent');logger[_0x9f79('0x13')](_0x9f79('0x14'),_0x4e4366,'request\x20sent',JSON[_0x9f79('0x15')](_0x291363));if(_0x291363[_0x9f79('0x16')]){if(_0x291363['error'][_0x9f79('0x17')]===0x1f4){logger[_0x9f79('0x16')](_0x9f79('0x12'),_0x4e4366,_0x291363[_0x9f79('0x16')][_0x9f79('0x18')]);return _0x5a5253(_0x291363['error'][_0x9f79('0x18')]);}logger['error'](_0x9f79('0x12'),_0x4e4366,_0x291363[_0x9f79('0x16')][_0x9f79('0x18')]);return _0x471ef7(_0x291363[_0x9f79('0x16')][_0x9f79('0x18')]);}else{logger[_0x9f79('0x11')]('WhatsappAccount,\x20%s,\x20%s',_0x4e4366,_0x9f79('0x19'));_0x471ef7(_0x291363[_0x9f79('0x1a')][_0x9f79('0x18')]);}})[_0x9f79('0x1b')](function(_0x2f7c1b){logger[_0x9f79('0x16')](_0x9f79('0x12'),_0x4e4366,_0x2f7c1b);_0x5a5253(_0x2f7c1b);});});}exports['ShowWhatsappAccount']=function(_0x1020d4){var _0x4cdc40=this;return new Promise(function(_0x2950a6,_0x5c6246){return db['WhatsappAccount'][_0x9f79('0x1c')]({'raw':_0x1020d4[_0x9f79('0x1d')]?_0x1020d4[_0x9f79('0x1d')][_0x9f79('0x1e')]===undefined?!![]:![]:!![],'where':_0x1020d4[_0x9f79('0x1d')]?_0x1020d4[_0x9f79('0x1d')][_0x9f79('0x1f')]||null:null,'attributes':_0x1020d4[_0x9f79('0x1d')]?_0x1020d4[_0x9f79('0x1d')][_0x9f79('0x20')]||null:null,'include':_0x1020d4[_0x9f79('0x1d')]?_0x1020d4[_0x9f79('0x1d')]['include']?_['map'](_0x1020d4[_0x9f79('0x1d')]['include'],function(_0x21539a){return{'model':db[_0x21539a[_0x9f79('0x21')]],'as':_0x21539a['as'],'attributes':_0x21539a[_0x9f79('0x20')],'include':_0x21539a[_0x9f79('0x22')]?_[_0x9f79('0x23')](_0x21539a['include'],function(_0x451acc){return{'model':db[_0x451acc[_0x9f79('0x21')]],'as':_0x451acc['as'],'attributes':_0x451acc[_0x9f79('0x20')],'include':_0x451acc[_0x9f79('0x22')]?_[_0x9f79('0x23')](_0x451acc['include'],function(_0x37bef1){return{'model':db[_0x37bef1[_0x9f79('0x21')]],'as':_0x37bef1['as'],'attributes':_0x37bef1[_0x9f79('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9f79('0x10')](function(_0x131f40){logger[_0x9f79('0x11')](_0x9f79('0x24'),_0x1020d4);logger[_0x9f79('0x13')](_0x9f79('0x24'),_0x1020d4,JSON[_0x9f79('0x15')](_0x131f40));_0x2950a6(_0x131f40);})[_0x9f79('0x1b')](function(_0x1ee2c9){logger[_0x9f79('0x16')](_0x9f79('0x24'),_0x1ee2c9[_0x9f79('0x18')],_0x1020d4);_0x5c6246(_0x4cdc40[_0x9f79('0x16')](0x1f4,_0x1ee2c9[_0x9f79('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 5491244..bdac1d2 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 _0xc778=['register','length','./whatsappAccount.events','save','remove','update','removeListener'];(function(_0x40e540,_0x4919d3){var _0x4a2229=function(_0x2c779c){while(--_0x2c779c){_0x40e540['push'](_0x40e540['shift']());}};_0x4a2229(++_0x4919d3);}(_0xc778,0xd4));var _0x8c77=function(_0x263c16,_0x3e337b){_0x263c16=_0x263c16-0x0;var _0xe1138=_0xc778[_0x263c16];return _0xe1138;};'use strict';var WhatsappAccountEvents=require(_0x8c77('0x0'));var events=[_0x8c77('0x1'),_0x8c77('0x2'),_0x8c77('0x3')];function createListener(_0x297b75,_0x5e5cf4){return function(_0x71d394){_0x5e5cf4['emit'](_0x297b75,_0x71d394);};}function removeListener(_0x55be39,_0x5bde8c){return function(){WhatsappAccountEvents[_0x8c77('0x4')](_0x55be39,_0x5bde8c);};}exports[_0x8c77('0x5')]=function(_0x32aa81){for(var _0x55edc2=0x0,_0x8d9224=events[_0x8c77('0x6')];_0x55edc2<_0x8d9224;_0x55edc2++){var _0x182f23=events[_0x55edc2];var _0x5610de=createListener('whatsappAccount:'+_0x182f23,_0x32aa81);WhatsappAccountEvents['on'](_0x182f23,_0x5610de);}}; \ No newline at end of file +var _0xc78f=['length','whatsappAccount:','./whatsappAccount.events','remove','emit','register'];(function(_0x357c47,_0x5512fd){var _0x3309b4=function(_0x1f1a47){while(--_0x1f1a47){_0x357c47['push'](_0x357c47['shift']());}};_0x3309b4(++_0x5512fd);}(_0xc78f,0x10a));var _0xfc78=function(_0x5e1a6e,_0x39e9b7){_0x5e1a6e=_0x5e1a6e-0x0;var _0x48d8ff=_0xc78f[_0x5e1a6e];return _0x48d8ff;};'use strict';var WhatsappAccountEvents=require(_0xfc78('0x0'));var events=['save',_0xfc78('0x1'),'update'];function createListener(_0x115a77,_0x534555){return function(_0x3e1e19){_0x534555[_0xfc78('0x2')](_0x115a77,_0x3e1e19);};}function removeListener(_0x6f4edf,_0x1c6c74){return function(){WhatsappAccountEvents['removeListener'](_0x6f4edf,_0x1c6c74);};}exports[_0xfc78('0x3')]=function(_0x2b0a85){for(var _0x1779f5=0x0,_0x10a46b=events[_0xfc78('0x4')];_0x1779f5<_0x10a46b;_0x1779f5++){var _0x558bd7=events[_0x1779f5];var _0x2128d0=createListener(_0xfc78('0x5')+_0x558bd7,_0x2b0a85);WhatsappAccountEvents['on'](_0x558bd7,_0x2128d0);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index dc42b8a..038810a 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 _0x8031=['put','update','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','index','/:id','isAuthenticated','show','post','create'];(function(_0x5e6938,_0x44fa9c){var _0xd9b062=function(_0x183000){while(--_0x183000){_0x5e6938['push'](_0x5e6938['shift']());}};_0xd9b062(++_0x44fa9c);}(_0x8031,0x193));var _0x1803=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x8031[_0x2dadb9];return _0x2f0097;};'use strict';var multer=require(_0x1803('0x0'));var util=require(_0x1803('0x1'));var path=require(_0x1803('0x2'));var timeout=require(_0x1803('0x3'));var express=require('express');var router=express[_0x1803('0x4')]();var fs_extra=require(_0x1803('0x5'));var auth=require(_0x1803('0x6'));var interaction=require(_0x1803('0x7'));var config=require(_0x1803('0x8'));var controller=require(_0x1803('0x9'));router[_0x1803('0xa')]('/',auth['isAuthenticated'](),controller[_0x1803('0xb')]);router['get'](_0x1803('0xc'),auth[_0x1803('0xd')](),controller[_0x1803('0xe')]);router[_0x1803('0xf')]('/',auth[_0x1803('0xd')](),controller[_0x1803('0x10')]);router[_0x1803('0x11')](_0x1803('0xc'),auth[_0x1803('0xd')](),controller[_0x1803('0x12')]);router[_0x1803('0x13')](_0x1803('0xc'),auth[_0x1803('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xfe7a=['../../config/environment','./whatsappApplication.controller','isAuthenticated','index','get','put','/:id','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x163040,_0x38a58c){var _0x364667=function(_0x3b104f){while(--_0x3b104f){_0x163040['push'](_0x163040['shift']());}};_0x364667(++_0x38a58c);}(_0xfe7a,0x17f));var _0xafe7=function(_0x559fe6,_0x4db925){_0x559fe6=_0x559fe6-0x0;var _0x590fb0=_0xfe7a[_0x559fe6];return _0x590fb0;};'use strict';var multer=require(_0xafe7('0x0'));var util=require(_0xafe7('0x1'));var path=require(_0xafe7('0x2'));var timeout=require(_0xafe7('0x3'));var express=require(_0xafe7('0x4'));var router=express[_0xafe7('0x5')]();var fs_extra=require(_0xafe7('0x6'));var auth=require(_0xafe7('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xafe7('0x8'));var controller=require(_0xafe7('0x9'));router['get']('/',auth[_0xafe7('0xa')](),controller[_0xafe7('0xb')]);router[_0xafe7('0xc')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xafe7('0xa')](),controller['create']);router[_0xafe7('0xd')](_0xafe7('0xe'),auth[_0xafe7('0xa')](),controller[_0xafe7('0xf')]);router['delete'](_0xafe7('0xe'),auth['isAuthenticated'](),controller[_0xafe7('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 4f88e79..ee384f0 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 _0xefee=['sequelize','exports','INTEGER','TEXT','STRING','*,*,*,*'];(function(_0x4e7bb0,_0x4bbf44){var _0x1f96f3=function(_0x5f570f){while(--_0x5f570f){_0x4e7bb0['push'](_0x4e7bb0['shift']());}};_0x1f96f3(++_0x4bbf44);}(_0xefee,0xd8));var _0xeefe=function(_0x3184ee,_0x5d3e06){_0x3184ee=_0x3184ee-0x0;var _0x17a1c9=_0xefee[_0x3184ee];return _0x17a1c9;};'use strict';var Sequelize=require(_0xeefe('0x0'));module[_0xeefe('0x1')]={'priority':{'type':Sequelize[_0xeefe('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xeefe('0x3')]()},'description':{'type':Sequelize[_0xeefe('0x4')]},'interval':{'type':Sequelize[_0xeefe('0x4')],'defaultValue':_0xeefe('0x5')}}; \ No newline at end of file +var _0x2e77=['STRING','TEXT','*,*,*,*','sequelize','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x2e77,0xc6));var _0x72e7=function(_0x11bb1c,_0x51b84b){_0x11bb1c=_0x11bb1c-0x0;var _0x3a592c=_0x2e77[_0x11bb1c];return _0x3a592c;};'use strict';var Sequelize=require(_0x72e7('0x0'));module[_0x72e7('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x72e7('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x72e7('0x3')]()},'description':{'type':Sequelize[_0x72e7('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x72e7('0x4')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 17dba0c..4e7d730 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 _0x62f1=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','sendStatus','end','json','offset','undefined','count','limit','status','set','apply','reject','save','update','then','stack','name','send','rawAttributes','fieldName','type','map','query','filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','merge','options','WhatsappApplication','includeAll','include','rows','show','params','keys','create','body','catch','find','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto'];(function(_0x53684b,_0x29d497){var _0x2444e8=function(_0x1f91a0){while(--_0x1f91a0){_0x53684b['push'](_0x53684b['shift']());}};_0x2444e8(++_0x29d497);}(_0x62f1,0x112));var _0x162f=function(_0x15456c,_0x420b80){_0x15456c=_0x15456c-0x0;var _0x51849c=_0x62f1[_0x15456c];return _0x51849c;};'use strict';var emlformat=require(_0x162f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x162f('0x1'));var jsonpatch=require(_0x162f('0x2'));var rp=require(_0x162f('0x3'));var moment=require(_0x162f('0x4'));var BPromise=require(_0x162f('0x5'));var Mustache=require(_0x162f('0x6'));var util=require(_0x162f('0x7'));var path=require(_0x162f('0x8'));var sox=require(_0x162f('0x9'));var csv=require(_0x162f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x162f('0xb'));var _=require(_0x162f('0xc'));var squel=require('squel');var crypto=require(_0x162f('0xd'));var jsforce=require(_0x162f('0xe'));var deskjs=require(_0x162f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x162f('0x10'));var Papa=require(_0x162f('0x11'));var Redis=require(_0x162f('0x12'));var authService=require(_0x162f('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x162f('0x14'));var hardwareService=require(_0x162f('0x15'));var logger=require(_0x162f('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x162f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x6ae441,_0x361048){_0x361048=_0x361048||0xcc;return function(_0x4561d2){if(_0x4561d2){return _0x6ae441[_0x162f('0x18')](_0x361048);}return _0x6ae441['status'](_0x361048)[_0x162f('0x19')]();};}function respondWithResult(_0x2bf9f0,_0x3daa69){_0x3daa69=_0x3daa69||0xc8;return function(_0x130db8){if(_0x130db8){return _0x2bf9f0['status'](_0x3daa69)[_0x162f('0x1a')](_0x130db8);}};}function respondWithFilteredResult(_0x4e48e1,_0x250983){return function(_0x2d90ad){if(_0x2d90ad){var _0x40a284=typeof _0x250983[_0x162f('0x1b')]==='undefined'&&typeof _0x250983['limit']===_0x162f('0x1c');var _0xa03e71=_0x2d90ad[_0x162f('0x1d')];var _0x1ee433=_0x40a284?0x0:_0x250983[_0x162f('0x1b')];var _0x750506=_0x40a284?_0x2d90ad[_0x162f('0x1d')]:_0x250983['offset']+_0x250983[_0x162f('0x1e')];var _0x53ac47;if(_0x750506>=_0xa03e71){_0x750506=_0xa03e71;_0x53ac47=0xc8;}else{_0x53ac47=0xce;}_0x4e48e1[_0x162f('0x1f')](_0x53ac47);return _0x4e48e1[_0x162f('0x20')]('Content-Range',_0x1ee433+'-'+_0x750506+'/'+_0xa03e71)[_0x162f('0x1a')](_0x2d90ad);}return null;};}function patchUpdates(_0x236ef5){return function(_0x57796d){try{jsonpatch[_0x162f('0x21')](_0x57796d,_0x236ef5,!![]);}catch(_0x436a5a){return BPromise[_0x162f('0x22')](_0x436a5a);}return _0x57796d[_0x162f('0x23')]();};}function saveUpdates(_0x5dc1a7,_0xdab3e){return function(_0x246aff){if(_0x246aff){return _0x246aff[_0x162f('0x24')](_0x5dc1a7)[_0x162f('0x25')](function(_0x422241){return _0x422241;});}return null;};}function removeEntity(_0x1512b0,_0xbcbe11){return function(_0x331d0d){if(_0x331d0d){return _0x331d0d['destroy']()[_0x162f('0x25')](function(){_0x1512b0[_0x162f('0x1f')](0xcc)[_0x162f('0x19')]();});}};}function handleEntityNotFound(_0x16f5e2,_0x59482e){return function(_0x2fc293){if(!_0x2fc293){_0x16f5e2['sendStatus'](0x194);}return _0x2fc293;};}function handleError(_0x1e25d5,_0x54e4e1){_0x54e4e1=_0x54e4e1||0x1f4;return function(_0x2cd181){logger['error'](_0x2cd181[_0x162f('0x26')]);if(_0x2cd181['name']){delete _0x2cd181[_0x162f('0x27')];}_0x1e25d5[_0x162f('0x1f')](_0x54e4e1)[_0x162f('0x28')](_0x2cd181);};}exports['index']=function(_0x4bb880,_0x4c58ff){var _0x580e13={},_0x3f9247={},_0x1b0f5b={'count':0x0,'rows':[]};var _0x4c4049=_['map'](db['WhatsappApplication'][_0x162f('0x29')],function(_0x5089c7){return{'name':_0x5089c7[_0x162f('0x2a')],'type':_0x5089c7[_0x162f('0x2b')]['key']};});_0x3f9247['model']=_[_0x162f('0x2c')](_0x4c4049,_0x162f('0x27'));_0x3f9247[_0x162f('0x2d')]=_['keys'](_0x4bb880[_0x162f('0x2d')]);_0x3f9247[_0x162f('0x2e')]=_[_0x162f('0x2f')](_0x3f9247[_0x162f('0x30')],_0x3f9247['query']);_0x580e13['attributes']=_[_0x162f('0x2f')](_0x3f9247['model'],qs[_0x162f('0x31')](_0x4bb880['query']['fields']));_0x580e13['attributes']=_0x580e13['attributes'][_0x162f('0x32')]?_0x580e13[_0x162f('0x33')]:_0x3f9247[_0x162f('0x30')];if(!_0x4bb880['query'][_0x162f('0x34')](_0x162f('0x35'))){_0x580e13['limit']=qs[_0x162f('0x1e')](_0x4bb880[_0x162f('0x2d')][_0x162f('0x1e')]);_0x580e13['offset']=qs[_0x162f('0x1b')](_0x4bb880['query'][_0x162f('0x1b')]);}_0x580e13['order']=qs[_0x162f('0x36')](_0x4bb880['query'][_0x162f('0x36')]);_0x580e13[_0x162f('0x37')]=qs['filters'](_[_0x162f('0x38')](_0x4bb880['query'],_0x3f9247[_0x162f('0x2e')]),_0x4c4049);if(_0x4bb880[_0x162f('0x2d')]['filter']){_0x580e13[_0x162f('0x37')]=_['merge'](_0x580e13[_0x162f('0x37')],{'$or':_['map'](_0x4c4049,function(_0x5f4b3f){if(_0x5f4b3f[_0x162f('0x2b')]!==_0x162f('0x39')){var _0x4a328f={};_0x4a328f[_0x5f4b3f[_0x162f('0x27')]]={'$like':'%'+_0x4bb880['query']['filter']+'%'};return _0x4a328f;}})});}_0x580e13=_[_0x162f('0x3a')]({},_0x580e13,_0x4bb880[_0x162f('0x3b')]);var _0x59ca49={'where':_0x580e13[_0x162f('0x37')]};return db[_0x162f('0x3c')][_0x162f('0x1d')](_0x59ca49)[_0x162f('0x25')](function(_0x2fa18e){_0x1b0f5b['count']=_0x2fa18e;if(_0x4bb880[_0x162f('0x2d')][_0x162f('0x3d')]){_0x580e13[_0x162f('0x3e')]=[{'all':!![]}];}return db[_0x162f('0x3c')]['findAll'](_0x580e13);})[_0x162f('0x25')](function(_0x146daa){_0x1b0f5b[_0x162f('0x3f')]=_0x146daa;return _0x1b0f5b;})[_0x162f('0x25')](respondWithFilteredResult(_0x4c58ff,_0x580e13))['catch'](handleError(_0x4c58ff,null));};exports[_0x162f('0x40')]=function(_0xc2143e,_0x52c8c3){var _0x8c8443={'raw':!![],'where':{'id':_0xc2143e[_0x162f('0x41')]['id']}},_0x21dd30={};_0x21dd30[_0x162f('0x30')]=_[_0x162f('0x42')](db[_0x162f('0x3c')][_0x162f('0x29')]);_0x21dd30['query']=_[_0x162f('0x42')](_0xc2143e[_0x162f('0x2d')]);_0x21dd30['filters']=_[_0x162f('0x2f')](_0x21dd30[_0x162f('0x30')],_0x21dd30['query']);_0x8c8443[_0x162f('0x33')]=_[_0x162f('0x2f')](_0x21dd30[_0x162f('0x30')],qs[_0x162f('0x31')](_0xc2143e[_0x162f('0x2d')][_0x162f('0x31')]));_0x8c8443[_0x162f('0x33')]=_0x8c8443[_0x162f('0x33')][_0x162f('0x32')]?_0x8c8443[_0x162f('0x33')]:_0x21dd30[_0x162f('0x30')];if(_0xc2143e[_0x162f('0x2d')][_0x162f('0x3d')]){_0x8c8443[_0x162f('0x3e')]=[{'all':!![]}];}_0x8c8443=_['merge']({},_0x8c8443,_0xc2143e[_0x162f('0x3b')]);return db[_0x162f('0x3c')]['find'](_0x8c8443)['then'](handleEntityNotFound(_0x52c8c3,null))[_0x162f('0x25')](respondWithResult(_0x52c8c3,null))['catch'](handleError(_0x52c8c3,null));};exports[_0x162f('0x43')]=function(_0x5d06c1,_0x1e936b){return db['WhatsappApplication'][_0x162f('0x43')](_0x5d06c1[_0x162f('0x44')],{})[_0x162f('0x25')](respondWithResult(_0x1e936b,0xc9))[_0x162f('0x45')](handleError(_0x1e936b,null));};exports[_0x162f('0x24')]=function(_0xf74671,_0x466136){if(_0xf74671[_0x162f('0x44')]['id']){delete _0xf74671[_0x162f('0x44')]['id'];}return db['WhatsappApplication'][_0x162f('0x46')]({'where':{'id':_0xf74671[_0x162f('0x41')]['id']}})['then'](handleEntityNotFound(_0x466136,null))[_0x162f('0x25')](saveUpdates(_0xf74671[_0x162f('0x44')],null))[_0x162f('0x25')](respondWithResult(_0x466136,null))[_0x162f('0x45')](handleError(_0x466136,null));};exports[_0x162f('0x47')]=function(_0x487835,_0x232348){return db[_0x162f('0x3c')][_0x162f('0x46')]({'where':{'id':_0x487835[_0x162f('0x41')]['id']}})[_0x162f('0x25')](handleEntityNotFound(_0x232348,null))['then'](removeEntity(_0x232348,null))['catch'](handleError(_0x232348,null));}; \ No newline at end of file +var _0xffc0=['../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','WhatsappApplication','rawAttributes','type','key','model','map','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','show','params','length','find','catch','create','body','destroy','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x35952a,_0xe7809f){var _0x158a2d=function(_0x254c9a){while(--_0x254c9a){_0x35952a['push'](_0x35952a['shift']());}};_0x158a2d(++_0xe7809f);}(_0xffc0,0x1a0));var _0x0ffc=function(_0x4851bb,_0x5b6fe8){_0x4851bb=_0x4851bb-0x0;var _0x4c0e25=_0xffc0[_0x4851bb];return _0x4c0e25;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0ffc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0ffc('0x1'));var rp=require(_0x0ffc('0x2'));var moment=require(_0x0ffc('0x3'));var BPromise=require(_0x0ffc('0x4'));var Mustache=require(_0x0ffc('0x5'));var util=require(_0x0ffc('0x6'));var path=require(_0x0ffc('0x7'));var sox=require('sox');var csv=require(_0x0ffc('0x8'));var ejs=require(_0x0ffc('0x9'));var fs=require('fs');var fs_extra=require(_0x0ffc('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0ffc('0xb'));var jsforce=require(_0x0ffc('0xc'));var deskjs=require(_0x0ffc('0xd'));var toCsv=require(_0x0ffc('0x8'));var querystring=require('querystring');var Papa=require(_0x0ffc('0xe'));var Redis=require(_0x0ffc('0xf'));var authService=require(_0x0ffc('0x10'));var qs=require(_0x0ffc('0x11'));var as=require(_0x0ffc('0x12'));var hardwareService=require(_0x0ffc('0x13'));var logger=require(_0x0ffc('0x14'))(_0x0ffc('0x15'));var utils=require('../../config/utils');var config=require(_0x0ffc('0x16'));var licenseUtil=require(_0x0ffc('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19e514,_0xbf12d1){_0xbf12d1=_0xbf12d1||0xcc;return function(_0x9622fe){if(_0x9622fe){return _0x19e514['sendStatus'](_0xbf12d1);}return _0x19e514[_0x0ffc('0x18')](_0xbf12d1)[_0x0ffc('0x19')]();};}function respondWithResult(_0x47a80b,_0x2095df){_0x2095df=_0x2095df||0xc8;return function(_0x137908){if(_0x137908){return _0x47a80b[_0x0ffc('0x18')](_0x2095df)[_0x0ffc('0x1a')](_0x137908);}};}function respondWithFilteredResult(_0x20edfc,_0x5034bc){return function(_0x35af98){if(_0x35af98){var _0x565921=typeof _0x5034bc[_0x0ffc('0x1b')]===_0x0ffc('0x1c')&&typeof _0x5034bc['limit']===_0x0ffc('0x1c');var _0x577e89=_0x35af98['count'];var _0x5b0018=_0x565921?0x0:_0x5034bc['offset'];var _0x314dab=_0x565921?_0x35af98[_0x0ffc('0x1d')]:_0x5034bc[_0x0ffc('0x1b')]+_0x5034bc[_0x0ffc('0x1e')];var _0x294f34;if(_0x314dab>=_0x577e89){_0x314dab=_0x577e89;_0x294f34=0xc8;}else{_0x294f34=0xce;}_0x20edfc['status'](_0x294f34);return _0x20edfc['set'](_0x0ffc('0x1f'),_0x5b0018+'-'+_0x314dab+'/'+_0x577e89)['json'](_0x35af98);}return null;};}function patchUpdates(_0x49e690){return function(_0x60ac9d){try{jsonpatch[_0x0ffc('0x20')](_0x60ac9d,_0x49e690,!![]);}catch(_0x49faaa){return BPromise[_0x0ffc('0x21')](_0x49faaa);}return _0x60ac9d[_0x0ffc('0x22')]();};}function saveUpdates(_0x27ae43,_0x527fd4){return function(_0x4ffd80){if(_0x4ffd80){return _0x4ffd80[_0x0ffc('0x23')](_0x27ae43)[_0x0ffc('0x24')](function(_0x418150){return _0x418150;});}return null;};}function removeEntity(_0x948451,_0x46b4e6){return function(_0x4d4294){if(_0x4d4294){return _0x4d4294['destroy']()[_0x0ffc('0x24')](function(){_0x948451['status'](0xcc)[_0x0ffc('0x19')]();});}};}function handleEntityNotFound(_0x5ad1b4,_0x25e3c0){return function(_0x136b0a){if(!_0x136b0a){_0x5ad1b4[_0x0ffc('0x25')](0x194);}return _0x136b0a;};}function handleError(_0x1265f5,_0x3968cc){_0x3968cc=_0x3968cc||0x1f4;return function(_0x34bce1){logger[_0x0ffc('0x26')](_0x34bce1[_0x0ffc('0x27')]);if(_0x34bce1['name']){delete _0x34bce1[_0x0ffc('0x28')];}_0x1265f5[_0x0ffc('0x18')](_0x3968cc)['send'](_0x34bce1);};}exports['index']=function(_0x40166f,_0x5f3a01){var _0x13c425={},_0x5d3cff={},_0x4ece4f={'count':0x0,'rows':[]};var _0x22eafd=_['map'](db[_0x0ffc('0x29')][_0x0ffc('0x2a')],function(_0x28c608){return{'name':_0x28c608['fieldName'],'type':_0x28c608[_0x0ffc('0x2b')][_0x0ffc('0x2c')]};});_0x5d3cff[_0x0ffc('0x2d')]=_[_0x0ffc('0x2e')](_0x22eafd,'name');_0x5d3cff[_0x0ffc('0x2f')]=_[_0x0ffc('0x30')](_0x40166f[_0x0ffc('0x2f')]);_0x5d3cff['filters']=_[_0x0ffc('0x31')](_0x5d3cff['model'],_0x5d3cff[_0x0ffc('0x2f')]);_0x13c425['attributes']=_[_0x0ffc('0x31')](_0x5d3cff[_0x0ffc('0x2d')],qs['fields'](_0x40166f[_0x0ffc('0x2f')][_0x0ffc('0x32')]));_0x13c425[_0x0ffc('0x33')]=_0x13c425[_0x0ffc('0x33')]['length']?_0x13c425[_0x0ffc('0x33')]:_0x5d3cff[_0x0ffc('0x2d')];if(!_0x40166f[_0x0ffc('0x2f')][_0x0ffc('0x34')](_0x0ffc('0x35'))){_0x13c425[_0x0ffc('0x1e')]=qs[_0x0ffc('0x1e')](_0x40166f['query'][_0x0ffc('0x1e')]);_0x13c425[_0x0ffc('0x1b')]=qs[_0x0ffc('0x1b')](_0x40166f[_0x0ffc('0x2f')]['offset']);}_0x13c425[_0x0ffc('0x36')]=qs[_0x0ffc('0x37')](_0x40166f[_0x0ffc('0x2f')][_0x0ffc('0x37')]);_0x13c425['where']=qs[_0x0ffc('0x38')](_[_0x0ffc('0x39')](_0x40166f[_0x0ffc('0x2f')],_0x5d3cff[_0x0ffc('0x38')]),_0x22eafd);if(_0x40166f[_0x0ffc('0x2f')][_0x0ffc('0x3a')]){_0x13c425[_0x0ffc('0x3b')]=_[_0x0ffc('0x3c')](_0x13c425[_0x0ffc('0x3b')],{'$or':_['map'](_0x22eafd,function(_0x1d23d4){if(_0x1d23d4[_0x0ffc('0x2b')]!==_0x0ffc('0x3d')){var _0x2d5d00={};_0x2d5d00[_0x1d23d4['name']]={'$like':'%'+_0x40166f[_0x0ffc('0x2f')][_0x0ffc('0x3a')]+'%'};return _0x2d5d00;}})});}_0x13c425=_[_0x0ffc('0x3c')]({},_0x13c425,_0x40166f[_0x0ffc('0x3e')]);var _0x2f9f98={'where':_0x13c425[_0x0ffc('0x3b')]};return db[_0x0ffc('0x29')][_0x0ffc('0x1d')](_0x2f9f98)[_0x0ffc('0x24')](function(_0x5cf45e){_0x4ece4f[_0x0ffc('0x1d')]=_0x5cf45e;if(_0x40166f[_0x0ffc('0x2f')][_0x0ffc('0x3f')]){_0x13c425[_0x0ffc('0x40')]=[{'all':!![]}];}return db['WhatsappApplication']['findAll'](_0x13c425);})['then'](function(_0x28105d){_0x4ece4f['rows']=_0x28105d;return _0x4ece4f;})[_0x0ffc('0x24')](respondWithFilteredResult(_0x5f3a01,_0x13c425))['catch'](handleError(_0x5f3a01,null));};exports[_0x0ffc('0x41')]=function(_0x1cb958,_0x50c005){var _0x54070c={'raw':!![],'where':{'id':_0x1cb958[_0x0ffc('0x42')]['id']}},_0x1bf431={};_0x1bf431['model']=_[_0x0ffc('0x30')](db[_0x0ffc('0x29')]['rawAttributes']);_0x1bf431['query']=_[_0x0ffc('0x30')](_0x1cb958['query']);_0x1bf431[_0x0ffc('0x38')]=_['intersection'](_0x1bf431['model'],_0x1bf431['query']);_0x54070c[_0x0ffc('0x33')]=_['intersection'](_0x1bf431[_0x0ffc('0x2d')],qs[_0x0ffc('0x32')](_0x1cb958[_0x0ffc('0x2f')]['fields']));_0x54070c[_0x0ffc('0x33')]=_0x54070c[_0x0ffc('0x33')][_0x0ffc('0x43')]?_0x54070c[_0x0ffc('0x33')]:_0x1bf431[_0x0ffc('0x2d')];if(_0x1cb958[_0x0ffc('0x2f')][_0x0ffc('0x3f')]){_0x54070c[_0x0ffc('0x40')]=[{'all':!![]}];}_0x54070c=_['merge']({},_0x54070c,_0x1cb958[_0x0ffc('0x3e')]);return db[_0x0ffc('0x29')][_0x0ffc('0x44')](_0x54070c)['then'](handleEntityNotFound(_0x50c005,null))[_0x0ffc('0x24')](respondWithResult(_0x50c005,null))[_0x0ffc('0x45')](handleError(_0x50c005,null));};exports[_0x0ffc('0x46')]=function(_0x2b16f7,_0x4a146f){return db[_0x0ffc('0x29')][_0x0ffc('0x46')](_0x2b16f7['body'],{})[_0x0ffc('0x24')](respondWithResult(_0x4a146f,0xc9))[_0x0ffc('0x45')](handleError(_0x4a146f,null));};exports['update']=function(_0x57e328,_0x18b774){if(_0x57e328[_0x0ffc('0x47')]['id']){delete _0x57e328[_0x0ffc('0x47')]['id'];}return db['WhatsappApplication']['find']({'where':{'id':_0x57e328[_0x0ffc('0x42')]['id']}})['then'](handleEntityNotFound(_0x18b774,null))[_0x0ffc('0x24')](saveUpdates(_0x57e328[_0x0ffc('0x47')],null))[_0x0ffc('0x24')](respondWithResult(_0x18b774,null))[_0x0ffc('0x45')](handleError(_0x18b774,null));};exports[_0x0ffc('0x48')]=function(_0x4a879a,_0x1b73b5){return db[_0x0ffc('0x29')][_0x0ffc('0x44')]({'where':{'id':_0x4a879a[_0x0ffc('0x42')]['id']}})['then'](handleEntityNotFound(_0x1b73b5,null))['then'](removeEntity(_0x1b73b5,null))[_0x0ffc('0x45')](handleError(_0x1b73b5,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 63dc23c..5ff3e60 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 _0x7579=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./whatsappApplication.attributes','define','whatsapp_applications'];(function(_0x4b29bf,_0x1e1602){var _0x4cb7c5=function(_0x3009ba){while(--_0x3009ba){_0x4b29bf['push'](_0x4b29bf['shift']());}};_0x4cb7c5(++_0x1e1602);}(_0x7579,0x1e2));var _0x9757=function(_0x539efb,_0x594ed6){_0x539efb=_0x539efb-0x0;var _0x5de1c7=_0x7579[_0x539efb];return _0x5de1c7;};'use strict';var _=require(_0x9757('0x0'));var util=require(_0x9757('0x1'));var logger=require(_0x9757('0x2'))(_0x9757('0x3'));var moment=require(_0x9757('0x4'));var BPromise=require(_0x9757('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9757('0x6'));var rimraf=require(_0x9757('0x7'));var config=require(_0x9757('0x8'));var attributes=require(_0x9757('0x9'));module['exports']=function(_0x2aede4,_0x80e411){return _0x2aede4[_0x9757('0xa')]('WhatsappApplication',attributes,{'tableName':_0x9757('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9757('0xc')});}; \ No newline at end of file +var _0xd2ea=['./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x3eba3f,_0x1fa13e){var _0x11a78d=function(_0x27529d){while(--_0x27529d){_0x3eba3f['push'](_0x3eba3f['shift']());}};_0x11a78d(++_0x1fa13e);}(_0xd2ea,0x15f));var _0xad2e=function(_0x559e79,_0x13c437){_0x559e79=_0x559e79-0x0;var _0x49dd80=_0xd2ea[_0x559e79];return _0x49dd80;};'use strict';var _=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var logger=require(_0xad2e('0x2'))(_0xad2e('0x3'));var moment=require(_0xad2e('0x4'));var BPromise=require('bluebird');var rp=require(_0xad2e('0x5'));var fs=require('fs');var path=require(_0xad2e('0x6'));var rimraf=require(_0xad2e('0x7'));var config=require(_0xad2e('0x8'));var attributes=require(_0xad2e('0x9'));module[_0xad2e('0xa')]=function(_0x29e97f,_0x592e8b){return _0x29e97f[_0xad2e('0xb')](_0xad2e('0xc'),attributes,{'tableName':_0xad2e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xad2e('0xe')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 6a24cf4..b8c8e68 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 _0xac9d=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x51000d,_0x44aae9){var _0x33f1c3=function(_0x1405df){while(--_0x1405df){_0x51000d['push'](_0x51000d['shift']());}};_0x33f1c3(++_0x44aae9);}(_0xac9d,0x14d));var _0xdac9=function(_0x42b8f5,_0x4b9730){_0x42b8f5=_0x42b8f5-0x0;var _0x31ca50=_0xac9d[_0x42b8f5];return _0x31ca50;};'use strict';var _=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var moment=require(_0xdac9('0x2'));var BPromise=require(_0xdac9('0x3'));var rs=require(_0xdac9('0x4'));var fs=require('fs');var Redis=require(_0xdac9('0x5'));var db=require(_0xdac9('0x6'))['db'];var utils=require(_0xdac9('0x7'));var logger=require('../../config/logger')(_0xdac9('0x8'));var config=require('../../config/environment');var jayson=require(_0xdac9('0x9'));var client=jayson[_0xdac9('0xa')][_0xdac9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x776b6c,_0x1c78c5,_0x39f560){return new BPromise(function(_0x5531af,_0x2b1d6f){return client['request'](_0x776b6c,_0x39f560)[_0xdac9('0xc')](function(_0x3a013b){logger[_0xdac9('0xd')](_0xdac9('0xe'),_0x1c78c5,_0xdac9('0xf'));logger[_0xdac9('0x10')](_0xdac9('0x11'),_0x1c78c5,_0xdac9('0xf'),JSON[_0xdac9('0x12')](_0x3a013b));if(_0x3a013b['error']){if(_0x3a013b[_0xdac9('0x13')][_0xdac9('0x14')]===0x1f4){logger['error'](_0xdac9('0xe'),_0x1c78c5,_0x3a013b[_0xdac9('0x13')][_0xdac9('0x15')]);return _0x2b1d6f(_0x3a013b['error'][_0xdac9('0x15')]);}logger[_0xdac9('0x13')](_0xdac9('0xe'),_0x1c78c5,_0x3a013b['error']['message']);return _0x5531af(_0x3a013b[_0xdac9('0x13')][_0xdac9('0x15')]);}else{logger['info'](_0xdac9('0xe'),_0x1c78c5,_0xdac9('0xf'));_0x5531af(_0x3a013b[_0xdac9('0x16')][_0xdac9('0x15')]);}})[_0xdac9('0x17')](function(_0x393acc){logger[_0xdac9('0x13')](_0xdac9('0xe'),_0x1c78c5,_0x393acc);_0x2b1d6f(_0x393acc);});});} \ No newline at end of file +var _0xda55=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0x5c7e30,_0x462ed3){var _0x2f309a=function(_0x430f51){while(--_0x430f51){_0x5c7e30['push'](_0x5c7e30['shift']());}};_0x2f309a(++_0x462ed3);}(_0xda55,0x6d));var _0x5da5=function(_0x2d6ab8,_0x1b6b82){_0x2d6ab8=_0x2d6ab8-0x0;var _0x339c56=_0xda55[_0x2d6ab8];return _0x339c56;};'use strict';var _=require(_0x5da5('0x0'));var util=require(_0x5da5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5da5('0x2'));var fs=require('fs');var Redis=require(_0x5da5('0x3'));var db=require(_0x5da5('0x4'))['db'];var utils=require(_0x5da5('0x5'));var logger=require(_0x5da5('0x6'))('rpc');var config=require(_0x5da5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5da5('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fd877,_0x267469,_0x71b187){return new BPromise(function(_0x46290d,_0x3debdf){return client[_0x5da5('0x9')](_0x2fd877,_0x71b187)[_0x5da5('0xa')](function(_0x302795){logger['info'](_0x5da5('0xb'),_0x267469,_0x5da5('0xc'));logger[_0x5da5('0xd')](_0x5da5('0xe'),_0x267469,_0x5da5('0xc'),JSON[_0x5da5('0xf')](_0x302795));if(_0x302795[_0x5da5('0x10')]){if(_0x302795['error'][_0x5da5('0x11')]===0x1f4){logger[_0x5da5('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0x267469,_0x302795[_0x5da5('0x10')][_0x5da5('0x12')]);return _0x3debdf(_0x302795[_0x5da5('0x10')][_0x5da5('0x12')]);}logger[_0x5da5('0x10')](_0x5da5('0xb'),_0x267469,_0x302795['error']['message']);return _0x46290d(_0x302795['error'][_0x5da5('0x12')]);}else{logger[_0x5da5('0x13')](_0x5da5('0xb'),_0x267469,_0x5da5('0xc'));_0x46290d(_0x302795[_0x5da5('0x14')][_0x5da5('0x12')]);}})[_0x5da5('0x15')](function(_0x4a952a){logger[_0x5da5('0x10')](_0x5da5('0xb'),_0x267469,_0x4a952a);_0x3debdf(_0x4a952a);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 8204dea..ebb9e41 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(_0xe3b9a9,_0x5d87d6){var _0x28cfe9=function(_0x528bc1){while(--_0x528bc1){_0xe3b9a9['push'](_0xe3b9a9['shift']());}};_0x28cfe9(++_0x5d87d6);}(_0x90b5,0x139));var _0x590b=function(_0x283022,_0x237ab9){_0x283022=_0x283022-0x0;var _0x223c8a=_0x90b5[_0x283022];return _0x223c8a;};'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 _0xc6ac=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','update','delete','whatsappinteraction:destroy','destroy','/:id/tags','exports','multer','util','path'];(function(_0x394b76,_0x923c90){var _0x45ce23=function(_0x24d77c){while(--_0x24d77c){_0x394b76['push'](_0x394b76['shift']());}};_0x45ce23(++_0x923c90);}(_0xc6ac,0x15b));var _0xcc6a=function(_0xac2260,_0xfc4cda){_0xac2260=_0xac2260-0x0;var _0x43d7be=_0xc6ac[_0xac2260];return _0x43d7be;};'use strict';var multer=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var path=require(_0xcc6a('0x2'));var timeout=require(_0xcc6a('0x3'));var express=require(_0xcc6a('0x4'));var router=express[_0xcc6a('0x5')]();var fs_extra=require(_0xcc6a('0x6'));var auth=require(_0xcc6a('0x7'));var interaction=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var controller=require(_0xcc6a('0xa'));router[_0xcc6a('0xb')]('/',auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xd')]);router['get'](_0xcc6a('0xe'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xf')]);router['get'](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x11')]);router[_0xcc6a('0xb')](_0xcc6a('0x12'),auth['isAuthenticated'](),controller[_0xcc6a('0x13')]);router[_0xcc6a('0xb')](_0xcc6a('0x14'),auth['isAuthenticated'](),controller[_0xcc6a('0x15')]);router[_0xcc6a('0x16')]('/',auth[_0xcc6a('0xc')](),controller['create']);router['post'](_0xcc6a('0x12'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x17')]);router['post']('/:id/tags',auth[_0xcc6a('0xc')](),interaction[_0xcc6a('0x18')](_0xcc6a('0x19'),_0xcc6a('0x1a')),controller[_0xcc6a('0x1b')]);router[_0xcc6a('0x1c')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),interaction['tracked']('whatsapp','whatsappinteraction:update'),controller[_0xcc6a('0x1d')]);router[_0xcc6a('0x1e')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),interaction[_0xcc6a('0x18')](_0xcc6a('0x19'),_0xcc6a('0x1f')),controller[_0xcc6a('0x20')]);router[_0xcc6a('0x1e')](_0xcc6a('0x21'),auth[_0xcc6a('0xc')](),controller['removeTags']);module[_0xcc6a('0x22')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 5a0a2c4..0646b89 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 _0xe181=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x5c59e9,_0x253541){var _0x56b0b3=function(_0xeb6ad2){while(--_0xeb6ad2){_0x5c59e9['push'](_0x5c59e9['shift']());}};_0x56b0b3(++_0x253541);}(_0xe181,0x68));var _0x1e18=function(_0x5c6aeb,_0x1a3eda){_0x5c6aeb=_0x5c6aeb-0x0;var _0x518281=_0xe181[_0x5c6aeb];return _0x518281;};'use strict';var Sequelize=require(_0x1e18('0x0'));var moment=require('moment');module[_0x1e18('0x1')]={'closed':{'type':Sequelize[_0x1e18('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1e18('0x3')]},'disposition':{'type':Sequelize[_0x1e18('0x4')]},'secondDisposition':{'type':Sequelize[_0x1e18('0x4')]},'thirdDisposition':{'type':Sequelize[_0x1e18('0x4')]},'note':{'type':Sequelize[_0x1e18('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x1e18('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1e18('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x1e18('0x5')]('in',_0x1e18('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x1e18('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x9829=['DATE','STRING','ENUM','out','sequelize','moment','exports','BOOLEAN'];(function(_0x57cc22,_0x2d351f){var _0x6f7bdc=function(_0x4935b5){while(--_0x4935b5){_0x57cc22['push'](_0x57cc22['shift']());}};_0x6f7bdc(++_0x2d351f);}(_0x9829,0xc4));var _0x9982=function(_0x313c96,_0x3cee6e){_0x313c96=_0x313c96-0x0;var _0x522f53=_0x9829[_0x313c96];return _0x522f53;};'use strict';var Sequelize=require(_0x9982('0x0'));var moment=require(_0x9982('0x1'));module[_0x9982('0x2')]={'closed':{'type':Sequelize[_0x9982('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9982('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x9982('0x5')]},'thirdDisposition':{'type':Sequelize[_0x9982('0x5')]},'note':{'type':Sequelize[_0x9982('0x5')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x9982('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x9982('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x9982('0x6')]('in',_0x9982('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 d58846f..ebd024f 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 _0xd24d=['CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','body','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','createdAt','parse','$gte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','SELECT','clone','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','user','i.WhatsappAccountId\x20IS\x20NULL','agent','toString','keyBy','merge','WhatsappInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','ui.WhatsappInteractionId\x20IN\x20?','sequelize','groupBy','all','rows','show','rawAttributes','include','create','params','describe','addMessage','ids','getMessages','findOne','nolimit','pick','WhatsappInteractionId','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','findAll','addTags','setTags','omit','spread','whatsappInteractionTags:save','removeTags','download','unix','join','root','files','tmp','server','attachments','format','CmContact','Contact','firstName','lastName','Attachment','WhatsappMessage','Messages','secret','WhatsappAccount','Account','mkdirSync','Whatsapp','Owner','N.A.','closed','closedAt','createReadStream','pipe','createWriteStream','direction','out','System','views','downloadInteraction.ejs','transcript-','log','err','unlinkSync','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','Users','fullname','TagIds','Tags','split','forEach','push','catch','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','select','field','color','from','tools_tags','u.id','ui.WhatsappInteractionId','users','whatsapp_interactions','left_join','cm_contacts','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','having','`\x20=\x200','`\x20>\x200','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','end','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User'];(function(_0x16693e,_0x12e88c){var _0x51612=function(_0x18b579){while(--_0x18b579){_0x16693e['push'](_0x16693e['shift']());}};_0x51612(++_0x12e88c);}(_0xd24d,0x168));var _0xdd24=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd24d[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xdd24('0x0'));var rimraf=require(_0xdd24('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdd24('0x2'));var moment=require(_0xdd24('0x3'));var BPromise=require(_0xdd24('0x4'));var Mustache=require(_0xdd24('0x5'));var util=require(_0xdd24('0x6'));var path=require(_0xdd24('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdd24('0x8'));var _=require(_0xdd24('0x9'));var squel=require(_0xdd24('0xa'));var crypto=require(_0xdd24('0xb'));var jsforce=require(_0xdd24('0xc'));var deskjs=require(_0xdd24('0xd'));var toCsv=require(_0xdd24('0xe'));var querystring=require('querystring');var Papa=require(_0xdd24('0xf'));var Redis=require(_0xdd24('0x10'));var authService=require(_0xdd24('0x11'));var qs=require(_0xdd24('0x12'));var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require(_0xdd24('0x13'));var logger=require(_0xdd24('0x14'))(_0xdd24('0x15'));var utils=require(_0xdd24('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xdd24('0x17'));var db=require(_0xdd24('0x18'))['db'];config['redis']=_[_0xdd24('0x19')](config[_0xdd24('0x1a')],{'host':_0xdd24('0x1b'),'port':0x18eb});var socket=require(_0xdd24('0x1c'))(new Redis(config['redis']));require(_0xdd24('0x1d'))[_0xdd24('0x1e')](socket);function respondWithStatusCode(_0x1760ee,_0xf70c6d){_0xf70c6d=_0xf70c6d||0xcc;return function(_0x460646){if(_0x460646){return _0x1760ee[_0xdd24('0x1f')](_0xf70c6d);}return _0x1760ee[_0xdd24('0x20')](_0xf70c6d)['end']();};}function respondWithResult(_0x492138,_0x479ff1){_0x479ff1=_0x479ff1||0xc8;return function(_0x2faeb7){if(_0x2faeb7){return _0x492138['status'](_0x479ff1)[_0xdd24('0x21')](_0x2faeb7);}};}function respondWithFilteredResult(_0x5c8bd6,_0x55bb59){return function(_0x2b708e){if(_0x2b708e){var _0x47b8e1=typeof _0x55bb59['offset']===_0xdd24('0x22')&&typeof _0x55bb59['limit']===_0xdd24('0x22');var _0xa9a59d=_0x2b708e[_0xdd24('0x23')];var _0x4ecea2=_0x47b8e1?0x0:_0x55bb59['offset'];var _0x23a503=_0x47b8e1?_0x2b708e[_0xdd24('0x23')]:_0x55bb59[_0xdd24('0x24')]+_0x55bb59[_0xdd24('0x25')];var _0x5905b4;if(_0x23a503>=_0xa9a59d){_0x23a503=_0xa9a59d;_0x5905b4=0xc8;}else{_0x5905b4=0xce;}_0x5c8bd6[_0xdd24('0x20')](_0x5905b4);return _0x5c8bd6[_0xdd24('0x26')](_0xdd24('0x27'),_0x4ecea2+'-'+_0x23a503+'/'+_0xa9a59d)[_0xdd24('0x21')](_0x2b708e);}return null;};}function patchUpdates(_0xdefcc9){return function(_0x411dc8){try{jsonpatch['apply'](_0x411dc8,_0xdefcc9,!![]);}catch(_0x232d21){return BPromise[_0xdd24('0x28')](_0x232d21);}return _0x411dc8[_0xdd24('0x29')]();};}function saveUpdates(_0x166bb9,_0x76bdd5){return function(_0x29df01){if(_0x29df01){return _0x29df01[_0xdd24('0x2a')](_0x166bb9)['then'](function(_0x2e0f4d){return _0x2e0f4d;});}return null;};}function removeEntity(_0x60a37c,_0x4a3d22){return function(_0x19d091){if(_0x19d091){return _0x19d091[_0xdd24('0x2b')]()[_0xdd24('0x2c')](function(){_0x60a37c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x457453,_0x5fbf21){return function(_0x290322){if(!_0x290322){_0x457453[_0xdd24('0x1f')](0x194);}return _0x290322;};}function handleError(_0x4c34c9,_0xbedc8c){_0xbedc8c=_0xbedc8c||0x1f4;return function(_0x1a3a3a){logger[_0xdd24('0x2d')](_0x1a3a3a[_0xdd24('0x2e')]);if(_0x1a3a3a[_0xdd24('0x2f')]){delete _0x1a3a3a['name'];}_0x4c34c9[_0xdd24('0x20')](_0xbedc8c)[_0xdd24('0x30')](_0x1a3a3a);};}function getInteractionUsers(_0x21c033,_0x1833c0){return new BPromise(function(_0x5065bc,_0x17e593){try{if(_0x1833c0[_0x21c033['id']]){_0x21c033[_0xdd24('0x31')]=_['map'](_0x1833c0[_0x21c033['id']],function(_0x316aa6){return{'id':_0x316aa6['id'],'fullname':_0x316aa6[_0xdd24('0x32')]};});}}catch(_0x1d46fe){_0x17e593(_0x1d46fe);}_0x5065bc(_0x21c033);});}function getInteractionTags(_0x548830,_0x486a13){return new BPromise(function(_0x4d2042,_0xb0965c){try{if(_0x548830[_0xdd24('0x33')]){_0x548830[_0xdd24('0x34')]=[];_0x548830[_0xdd24('0x33')][_0xdd24('0x35')](',')[_0xdd24('0x36')](function(_0x56fc75){_0x548830[_0xdd24('0x34')][_0xdd24('0x37')](_0x486a13[_0x56fc75]);});}delete _0x548830[_0xdd24('0x33')];}catch(_0x42a1e2){_0xb0965c(_0x42a1e2);}_0x4d2042(_0x548830);});}function updateWhatsappInteraction(_0x55e1a5,_0x11a383,_0x1c51f4){return new BPromise(function(_0x1e5e2c,_0xe86418){return getInteractionUsers(_0x55e1a5,_0x1c51f4)[_0xdd24('0x2c')](function(_0x11b24c){return getInteractionTags(_0x11b24c,_0x11a383);})[_0xdd24('0x2c')](function(_0x4648c9){_0x1e5e2c(_0x4648c9);})[_0xdd24('0x38')](function(_0x357dfd){_0xe86418(_0x357dfd);});});}exports[_0xdd24('0x39')]=function(_0x27cb5f,_0x4b43e6){var _0x5ea7e9={},_0x3e3b86={},_0x1b038c={'count':0x0,'rows':[]};var _0x10adde=_[_0xdd24('0x3a')](db['WhatsappInteraction']['rawAttributes'],function(_0x3cbbfe){return{'name':_0x3cbbfe[_0xdd24('0x3b')],'type':_0x3cbbfe[_0xdd24('0x3c')][_0xdd24('0x3d')]};});_0x3e3b86[_0xdd24('0x3e')]=_[_0xdd24('0x3a')](_0x10adde,_0xdd24('0x2f'));_0x3e3b86[_0xdd24('0x3f')]=_[_0xdd24('0x40')](_0x27cb5f[_0xdd24('0x3f')]);_0x3e3b86[_0xdd24('0x41')]=_[_0xdd24('0x42')](_0x3e3b86[_0xdd24('0x3e')],_0x3e3b86['query']);_0x5ea7e9[_0xdd24('0x43')]=_[_0xdd24('0x42')](_0x3e3b86[_0xdd24('0x3e')],qs['fields'](_0x27cb5f[_0xdd24('0x3f')][_0xdd24('0x44')]));_0x5ea7e9[_0xdd24('0x43')]=_0x5ea7e9[_0xdd24('0x43')][_0xdd24('0x45')]?_0x5ea7e9['attributes']:_0x3e3b86['model'];if(!_0x27cb5f[_0xdd24('0x3f')][_0xdd24('0x46')]('nolimit')){_0x5ea7e9[_0xdd24('0x25')]=qs[_0xdd24('0x25')](_0x27cb5f['query'][_0xdd24('0x25')]);_0x5ea7e9[_0xdd24('0x24')]=qs[_0xdd24('0x24')](_0x27cb5f[_0xdd24('0x3f')][_0xdd24('0x24')]);}_0x5ea7e9[_0xdd24('0x47')]=qs[_0xdd24('0x48')](_0x27cb5f[_0xdd24('0x3f')][_0xdd24('0x48')]);_0x5ea7e9[_0xdd24('0x49')]=qs[_0xdd24('0x41')](_['pick'](_0x27cb5f['query'],_0x3e3b86[_0xdd24('0x41')]),_0x10adde);var _0x239600=[];var _0x5de760=squel[_0xdd24('0x4a')]()[_0xdd24('0x4b')]('id')[_0xdd24('0x4b')]('name')[_0xdd24('0x4b')](_0xdd24('0x4c'))[_0xdd24('0x4d')](_0xdd24('0x4e'));var _0x76593a=squel[_0xdd24('0x4a')]()[_0xdd24('0x4b')](_0xdd24('0x4f'))[_0xdd24('0x4b')]('u.fullname')[_0xdd24('0x4b')](_0xdd24('0x50'))[_0xdd24('0x4d')]('user_has_whatsapp_interactions','ui')['left_join'](_0xdd24('0x51'),'u','u.id\x20=\x20ui.UserId');var _0x505b4f=squel['select']()['from'](_0xdd24('0x52'),'i')[_0xdd24('0x53')](_0xdd24('0x54'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0xdd24('0x51'),'o',_0xdd24('0x55'))[_0xdd24('0x53')](_0xdd24('0x56'),'a',_0xdd24('0x57'))[_0xdd24('0x53')]('whatsapp_messages','me',_0xdd24('0x58'))[_0xdd24('0x53')](_0xdd24('0x59'),'it',_0xdd24('0x5a'))[_0xdd24('0x53')]('tools_tags','t',_0xdd24('0x5b'));var _0x68a12b=squel[_0xdd24('0x5c')]();var _0x2bd8ad=[];var _0x26f615=squel[_0xdd24('0x5c')]();var _0x2c3612;if(_0x27cb5f['query'][_0xdd24('0x5d')]){_0x2c3612=as[_0xdd24('0x5e')](_0x27cb5f[_0xdd24('0x3f')][_0xdd24('0x5d')]);var _0x29f7b6=_0x2c3612[_0xdd24('0x5f')];for(var _0x3a7121=0x0;_0x3a7121<_0x2c3612[_0xdd24('0x60')][_0xdd24('0x45')];_0x3a7121++){var _0x420791=_0x2c3612['conditions'][_0x3a7121];var _0x12ef8c='i';var _0x3b5972=_[_0xdd24('0x61')](_0x10adde,[_0xdd24('0x2f'),_0x420791[_0xdd24('0x4b')]]);if(!_0x3b5972){switch(_0x420791[_0xdd24('0x4b')]){case'unreadMessages':if(_0x420791['value']==0x1){_0x505b4f[_0xdd24('0x62')]('`'+_0x420791['field']+_0xdd24('0x63'));}else{_0x505b4f[_0xdd24('0x62')]('`'+_0x420791[_0xdd24('0x4b')]+_0xdd24('0x64'));}break;case'Contact':if(_0x420791[_0xdd24('0x65')]===_0xdd24('0x66')){if(_0x420791[_0xdd24('0x67')][_0xdd24('0x35')]('\x20')['length']>0x1){_0x68a12b[_0x29f7b6](_0xdd24('0x68'),qs['getFullTextValue'](_0x420791[_0xdd24('0x67')]),null);}else{var _0x4e70da='%'+_0x420791['value']+'%';_0x68a12b[_0x29f7b6](_0xdd24('0x69'),_0x4e70da,_0x4e70da,_0x4e70da);}}else{_0x3b5972=_[_0xdd24('0x61')](_0x10adde,[_0xdd24('0x2f'),_0xdd24('0x6a')]);_0x420791[_0xdd24('0x4b')]=_0xdd24('0x6a');_0x54d400=as['buildExpression'](_0x12ef8c,_0x3b5972['type'],_0x420791);_0x68a12b[_0x29f7b6](_0x54d400[_0xdd24('0x6b')],_0x54d400['value'][_0xdd24('0x6c')],_0x54d400[_0xdd24('0x67')][_0xdd24('0x6d')]);}break;case _0xdd24('0x6e'):var _0x3d5c68=_0x420791[_0xdd24('0x67')][_0xdd24('0x35')](',')[_0xdd24('0x3a')](function(_0x354d9a){return Number(_0x354d9a);});_0x3d5c68['forEach'](function(_0x5caa3c){_0x26f615['or'](_0xdd24('0x6f'),'%,'+_0x5caa3c+',%');});_0x2bd8ad=_[_0xdd24('0x70')](_0x2bd8ad,_0x3d5c68);break;case _0xdd24('0x71'):if(_0x420791['operator']===_0xdd24('0x66')){_0x68a12b[_0x29f7b6](_0xdd24('0x72'),'%'+_0x420791[_0xdd24('0x67')]+'%',null);}else{_0x3b5972=_['find'](_0x10adde,[_0xdd24('0x2f'),'UserId']);_0x420791[_0xdd24('0x4b')]=_0xdd24('0x73');_0x54d400=as[_0xdd24('0x74')](_0x12ef8c,_0x3b5972[_0xdd24('0x3c')],_0x420791);_0x68a12b[_0x29f7b6](_0x54d400[_0xdd24('0x6b')],_0x54d400['value'][_0xdd24('0x6c')],_0x54d400[_0xdd24('0x67')][_0xdd24('0x6d')]);}break;case _0xdd24('0x75'):_0x54d400=as[_0xdd24('0x74')]('me',null,_0x420791);_0x68a12b[_0x29f7b6](_0x54d400[_0xdd24('0x6b')],_0x54d400[_0xdd24('0x67')]['start'],_0x54d400[_0xdd24('0x67')][_0xdd24('0x6d')]);break;}}else{var _0x54d400=as[_0xdd24('0x74')](_0x12ef8c,_0x3b5972['type'],_0x420791);_0x68a12b[_0x29f7b6](_0x54d400[_0xdd24('0x6b')],_0x54d400[_0xdd24('0x67')][_0xdd24('0x6c')],_0x54d400[_0xdd24('0x67')][_0xdd24('0x6d')]);}}}else{var _0x5e863b=_(_0x27cb5f['query'])[_0xdd24('0x40')]()['map'](function(_0x31c59a){return _['some'](_0x10adde,[_0xdd24('0x2f'),_0x31c59a])?_0x31c59a:undefined;})['compact']()[_0xdd24('0x67')]();if(!_[_0xdd24('0x76')](_0x5e863b)){_0x5e863b['forEach'](function(_0x4a962e){if(_0x4a962e===_0xdd24('0x77')){_0x505b4f[_0xdd24('0x49')](_0xdd24('0x78'),[]['concat'](_0x27cb5f[_0xdd24('0x3f')][_0x4a962e]));}else if(_0x4a962e===_0xdd24('0x79')){var _0x369fc2=JSON[_0xdd24('0x7a')](_0x27cb5f[_0xdd24('0x3f')][_0x4a962e])[_0xdd24('0x7b')];var _0x5d30ed=JSON[_0xdd24('0x7a')](_0x27cb5f['query'][_0x4a962e])['$lte'];_0x505b4f[_0xdd24('0x49')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x369fc2,_0x5d30ed);}else{if(_0x27cb5f[_0xdd24('0x3f')][_0x4a962e]===_0xdd24('0x7c')){_0x505b4f[_0xdd24('0x49')]('i.'+_0x4a962e+_0xdd24('0x7d'));}else{_0x505b4f[_0xdd24('0x49')]('i.'+_0x4a962e+_0xdd24('0x7e'),_0x27cb5f[_0xdd24('0x3f')][_0x4a962e]);}}});}if(_0x27cb5f['query'][_0xdd24('0x7f')]){if(_0x27cb5f[_0xdd24('0x3f')][_0xdd24('0x7f')]==0x1){_0x505b4f['having'](_0xdd24('0x80'));}else{_0x505b4f[_0xdd24('0x62')](_0xdd24('0x81'));}}if(_0x27cb5f['query'][_0xdd24('0x82')]){_0x2bd8ad=_[_0xdd24('0x83')](_0x27cb5f['query'][_0xdd24('0x82')])?_0x27cb5f[_0xdd24('0x3f')]['tag']:new Array(_0x27cb5f['query'][_0xdd24('0x82')]);_0x2bd8ad['forEach'](function(_0x98e6b0){_0x26f615['or'](_0xdd24('0x6f'),'%,'+_0x98e6b0+',%');});}if(_0x27cb5f['query'][_0xdd24('0x84')]){var _0x245ba2=_0x27cb5f[_0xdd24('0x3f')]['filter'][_0xdd24('0x85')]('\x5c','\x5c\x5c')[_0xdd24('0x85')](/'/g,'\x27\x27');if(qs[_0xdd24('0x86')](_0x245ba2)){_0x68a12b['or'](_0xdd24('0x87'),_0x245ba2+'%')['or'](_0xdd24('0x88'),_0x245ba2+'%');}else{_0x68a12b['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x245ba2))['or'](_0xdd24('0x89'),_0x245ba2+'%');}}}_0x505b4f[_0xdd24('0x49')](_0x68a12b);_0x505b4f[_0xdd24('0x8a')]('i.id');var _0x46c858={'type':db['Sequelize']['QueryTypes'][_0xdd24('0x8b')],'raw':!![]};var _0x58e18a=_0x505b4f[_0xdd24('0x8c')]();_0x58e18a[_0xdd24('0x4b')]('i.id');_0x58e18a[_0xdd24('0x4b')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xdd24('0x8d'));if(_0x5ea7e9['order']){_0x5ea7e9['order']['forEach'](function(_0x40c7ff){var _0x2127c1=_0x40c7ff[0x0]===_0xdd24('0x8e')?_0x40c7ff[0x0]:'i.'+_0x40c7ff[0x0];_0x505b4f['order'](_0x2127c1,_0x40c7ff[0x1]===_0xdd24('0x8f')?![]:!![]);});}if(!_[_0xdd24('0x76')](_0x2bd8ad)){_0x505b4f[_0xdd24('0x62')](_0x26f615);_0x58e18a['where'](_0xdd24('0x90'),_0x2bd8ad);}BPromise[_0xdd24('0x91')]()['then'](function(){if(!_0x2c3612){if(_0x27cb5f[_0xdd24('0x3f')][_0xdd24('0x77')])return;_0x58e18a[_0xdd24('0x49')](_0xdd24('0x92'));_0x505b4f[_0xdd24('0x49')](_0xdd24('0x92'));return;}if(_0x27cb5f['user'][_0xdd24('0x93')]!=='agent')return;return _0x27cb5f[_0xdd24('0x94')]['getWhatsappAccounts']({'attributes':['id'],'raw':!![]})[_0xdd24('0x2c')](function(_0x5927d1){if(_[_0xdd24('0x76')](_0x5927d1)){_0x58e18a[_0xdd24('0x49')](_0xdd24('0x95'));_0x505b4f['where'](_0xdd24('0x95'));}else{_0x58e18a[_0xdd24('0x49')]('i.WhatsappAccountId\x20IN\x20?',_['map'](_0x5927d1,'id'));_0x505b4f[_0xdd24('0x49')](_0xdd24('0x78'),_['map'](_0x5927d1,'id'));}});})[_0xdd24('0x2c')](function(){if(_0x27cb5f[_0xdd24('0x94')][_0xdd24('0x93')]===_0xdd24('0x96')&&!_0x2c3612&&!_0x27cb5f[_0xdd24('0x3f')]['WhatsappAccountId'])return[];return db['sequelize']['query'](_0x58e18a[_0xdd24('0x97')](),_0x46c858);})[_0xdd24('0x2c')](function(_0x355853){_0x1b038c[_0xdd24('0x23')]=_0x355853[_0xdd24('0x45')];if(_0x1b038c[_0xdd24('0x23')]===0x0)return[];return db['sequelize'][_0xdd24('0x3f')](_0x5de760[_0xdd24('0x97')](),_0x46c858)[_0xdd24('0x2c')](function(_0x5b0489){_0x239600=_[_0xdd24('0x98')](_0x5b0489,'id');_0x46c858=_[_0xdd24('0x99')](_0x46c858,{'model':db[_0xdd24('0x9a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x27cb5f[_0xdd24('0x3f')]['fields']){_0x5ea7e9[_0xdd24('0x43')]['forEach'](function(_0x4f6081){_0x505b4f[_0xdd24('0x4b')]('i.'+_0x4f6081);});}else{_0x505b4f[_0xdd24('0x4b')](_0xdd24('0x9b'),'unreadMessages');_0x505b4f[_0xdd24('0x4b')](_0xdd24('0x9c'),'Account.key');_0x505b4f['field'](_0xdd24('0x9d'),'Account.mandatoryDisposition');_0x505b4f[_0xdd24('0x4b')]('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',_0xdd24('0x8e'));_0x505b4f[_0xdd24('0x4b')](_0xdd24('0x9e'));_0x505b4f[_0xdd24('0x4b')](_0xdd24('0x9f'),'Contact.firstName');_0x505b4f[_0xdd24('0x4b')](_0xdd24('0xa0'),_0xdd24('0xa1'));_0x505b4f[_0xdd24('0x4b')](_0xdd24('0xa2'),_0xdd24('0xa3'));_0x505b4f[_0xdd24('0x4b')]('c.phone',_0xdd24('0xa4'));_0x505b4f[_0xdd24('0x4b')](_0xdd24('0xa5'),_0xdd24('0xa6'));_0x505b4f[_0xdd24('0x4b')](_0xdd24('0xa7'),_0xdd24('0xa8'));_0x505b4f['field'](_0xdd24('0xa9'),_0xdd24('0xaa'));_0x505b4f[_0xdd24('0x4b')](_0xdd24('0xab'),'Owner.internal');_0x505b4f[_0xdd24('0x4b')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xdd24('0x33'));}if(_0x5ea7e9['limit'])_0x505b4f['limit'](_0x5ea7e9[_0xdd24('0x25')]);if(_0x5ea7e9[_0xdd24('0x24')])_0x505b4f[_0xdd24('0x24')](_0x5ea7e9[_0xdd24('0x24')]);return db['sequelize']['query'](_0x505b4f[_0xdd24('0x97')](),_0x46c858);})[_0xdd24('0x2c')](function(_0x86dc81){if(_0x86dc81[_0xdd24('0x45')]>0x0)_0x76593a[_0xdd24('0x49')](_0xdd24('0xac'),_[_0xdd24('0x3a')](_0x86dc81,'id'));return db[_0xdd24('0xad')][_0xdd24('0x3f')](_0x76593a[_0xdd24('0x97')](),_0x46c858)[_0xdd24('0x2c')](function(_0xbc15c4){var _0x54e657=_[_0xdd24('0xae')](_0xbc15c4,'WhatsappInteractionId');var _0x32ad15=[];_0x86dc81[_0xdd24('0x36')](function(_0x248ab9){_0x32ad15[_0xdd24('0x37')](updateWhatsappInteraction(_0x248ab9,_0x239600,_0x54e657));});return BPromise[_0xdd24('0xaf')](_0x32ad15);});});})[_0xdd24('0x2c')](function(_0x114680){_0x1b038c[_0xdd24('0xb0')]=_0x114680;return _0x1b038c;})['then'](respondWithFilteredResult(_0x4b43e6,_0x5ea7e9))[_0xdd24('0x38')](handleError(_0x4b43e6,null));};exports[_0xdd24('0xb1')]=function(_0x4d749c,_0x4655ee){var _0x4835d9={'raw':![],'where':{'id':_0x4d749c['params']['id']}},_0x35fb0f={};_0x35fb0f['model']=_['keys'](db[_0xdd24('0x9a')][_0xdd24('0xb2')]);_0x35fb0f[_0xdd24('0x3f')]=_['keys'](_0x4d749c[_0xdd24('0x3f')]);_0x35fb0f[_0xdd24('0x41')]=_['intersection'](_0x35fb0f[_0xdd24('0x3e')],_0x35fb0f[_0xdd24('0x3f')]);_0x4835d9[_0xdd24('0x43')]=_[_0xdd24('0x42')](_0x35fb0f['model'],qs[_0xdd24('0x44')](_0x4d749c[_0xdd24('0x3f')][_0xdd24('0x44')]));_0x4835d9[_0xdd24('0x43')]=_0x4835d9['attributes']['length']?_0x4835d9[_0xdd24('0x43')]:_0x35fb0f[_0xdd24('0x3e')];if(_0x4d749c[_0xdd24('0x3f')]['includeAll']){_0x4835d9[_0xdd24('0xb3')]=[{'all':!![]}];}_0x4835d9=_[_0xdd24('0x99')]({},_0x4835d9,_0x4d749c['options']);return db[_0xdd24('0x9a')][_0xdd24('0x61')](_0x4835d9)[_0xdd24('0x2c')](handleEntityNotFound(_0x4655ee,null))[_0xdd24('0x2c')](respondWithResult(_0x4655ee,null))[_0xdd24('0x38')](handleError(_0x4655ee,null));};exports[_0xdd24('0xb4')]=function(_0xa9494f,_0x86c3f6){return db[_0xdd24('0x9a')][_0xdd24('0xb4')](_0xa9494f[_0xdd24('0x75')],{})[_0xdd24('0x2c')](respondWithResult(_0x86c3f6,0xc9))[_0xdd24('0x38')](handleError(_0x86c3f6,null));};exports['update']=function(_0xe0ef5c,_0x11c64f){if(_0xe0ef5c[_0xdd24('0x75')]['id']){delete _0xe0ef5c[_0xdd24('0x75')]['id'];}return db['WhatsappInteraction'][_0xdd24('0x61')]({'where':{'id':_0xe0ef5c[_0xdd24('0xb5')]['id']}})[_0xdd24('0x2c')](handleEntityNotFound(_0x11c64f,null))[_0xdd24('0x2c')](saveUpdates(_0xe0ef5c[_0xdd24('0x75')],null))[_0xdd24('0x2c')](respondWithResult(_0x11c64f,null))[_0xdd24('0x38')](handleError(_0x11c64f,null));};exports['destroy']=function(_0x45fdc5,_0x4b40a0){return db[_0xdd24('0x9a')][_0xdd24('0x61')]({'where':{'id':_0x45fdc5[_0xdd24('0xb5')]['id']}})[_0xdd24('0x2c')](handleEntityNotFound(_0x4b40a0,null))[_0xdd24('0x2c')](removeEntity(_0x4b40a0,null))[_0xdd24('0x38')](handleError(_0x4b40a0,null));};exports[_0xdd24('0xb6')]=function(_0x4ee0b8,_0x4311dd){return db[_0xdd24('0x9a')][_0xdd24('0xb6')]()['then'](respondWithResult(_0x4311dd,null))[_0xdd24('0x38')](handleError(_0x4311dd,null));};exports[_0xdd24('0xb7')]=function(_0x58d9cc,_0x49c95d,_0x5dc718){return db['WhatsappMessage'][_0xdd24('0x61')]({'where':{'id':_0x58d9cc[_0xdd24('0xb5')]['id']}})[_0xdd24('0x2c')](handleEntityNotFound(_0x49c95d,null))[_0xdd24('0x2c')](function(_0x54a35e){if(_0x54a35e){return _0x54a35e[_0xdd24('0xb7')](_0x58d9cc[_0xdd24('0x75')]['ids'],_['omit'](_0x58d9cc[_0xdd24('0x75')],[_0xdd24('0xb8'),'id'])||{});}})[_0xdd24('0x2c')](respondWithResult(_0x49c95d,null))[_0xdd24('0x38')](handleError(_0x49c95d,null));};exports[_0xdd24('0xb9')]=function(_0x5592eb,_0x369a10,_0x5dfad8){var _0x85988e={'raw':![],'where':{}};var _0x4b1e88={};var _0x4227e1={'count':0x0,'rows':[]};return db[_0xdd24('0x9a')][_0xdd24('0xba')]({'where':{'id':_0x5592eb[_0xdd24('0xb5')]['id']}})['then'](handleEntityNotFound(_0x369a10,null))[_0xdd24('0x2c')](function(_0x346b9c){if(_0x346b9c){_0x4b1e88[_0xdd24('0x3e')]=_[_0xdd24('0x40')](db['WhatsappMessage']['rawAttributes']);_0x4b1e88['query']=_[_0xdd24('0x40')](_0x5592eb[_0xdd24('0x3f')]);_0x4b1e88[_0xdd24('0x41')]=_[_0xdd24('0x42')](_0x4b1e88[_0xdd24('0x3e')],_0x4b1e88[_0xdd24('0x3f')]);_0x85988e[_0xdd24('0x43')]=_[_0xdd24('0x42')](_0x4b1e88[_0xdd24('0x3e')],qs[_0xdd24('0x44')](_0x5592eb[_0xdd24('0x3f')][_0xdd24('0x44')]));_0x85988e[_0xdd24('0x43')]=_0x85988e[_0xdd24('0x43')][_0xdd24('0x45')]?_0x85988e[_0xdd24('0x43')]:_0x4b1e88[_0xdd24('0x3e')];if(!_0x5592eb[_0xdd24('0x3f')][_0xdd24('0x46')](_0xdd24('0xbb'))){_0x85988e[_0xdd24('0x25')]=qs['limit'](_0x5592eb[_0xdd24('0x3f')][_0xdd24('0x25')]);_0x85988e[_0xdd24('0x24')]=qs['offset'](_0x5592eb[_0xdd24('0x3f')][_0xdd24('0x24')]);}_0x85988e[_0xdd24('0x47')]=qs[_0xdd24('0x48')](_0x5592eb[_0xdd24('0x3f')][_0xdd24('0x48')]);_0x85988e['where']=qs[_0xdd24('0x41')](_[_0xdd24('0xbc')](_0x5592eb[_0xdd24('0x3f')],_0x4b1e88['filters']));_0x85988e[_0xdd24('0x49')][_0xdd24('0xbd')]=_0x346b9c['id'];if(_0x5592eb[_0xdd24('0x3f')][_0xdd24('0x84')]){_0x85988e[_0xdd24('0x49')]=_[_0xdd24('0x99')](_0x85988e[_0xdd24('0x49')],{'$or':_[_0xdd24('0x3a')](_0x85988e[_0xdd24('0x43')],function(_0x23dddc){var _0xd3f15f={};_0xd3f15f[_0x23dddc]={'$like':'%'+_0x5592eb[_0xdd24('0x3f')][_0xdd24('0x84')]+'%'};return _0xd3f15f;})});}if(_0x5592eb[_0xdd24('0x3f')][_0xdd24('0x7b')]){var _0x25ca98=_0x5592eb['query'][_0xdd24('0x7b')][_0xdd24('0x35')](',');var _0xc2f74={};_0xc2f74[_0x25ca98[0x0]]={'$gte':moment(_0x25ca98[0x1])['format'](_0xdd24('0xbe'))};_0x85988e[_0xdd24('0x49')]=_[_0xdd24('0x99')](_0x85988e['where'],_0xc2f74);}_0x85988e=_[_0xdd24('0x99')]({},_0x85988e,_0x5592eb[_0xdd24('0xbf')]);return db['WhatsappMessage'][_0xdd24('0x23')]({'where':_0x85988e[_0xdd24('0x49')]})[_0xdd24('0x2c')](function(_0x2f1c2b){_0x4227e1[_0xdd24('0x23')]=_0x2f1c2b;if(_0x5592eb[_0xdd24('0x3f')][_0xdd24('0xc0')]){_0x85988e[_0xdd24('0xb3')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xdd24('0xc1')](_0x85988e);})[_0xdd24('0x2c')](function(_0x4b7d46){_0x4227e1[_0xdd24('0xb0')]=_0x4b7d46;return _0x4227e1;});}})['then'](respondWithFilteredResult(_0x369a10,_0x85988e))[_0xdd24('0x38')](handleError(_0x369a10,null));};exports[_0xdd24('0xc2')]=function(_0xb93bc9,_0x5c94b4,_0x7d73e5){return db[_0xdd24('0x9a')][_0xdd24('0x61')]({'where':{'id':_0xb93bc9['params']['id']}})['then'](handleEntityNotFound(_0x5c94b4,null))[_0xdd24('0x2c')](function(_0x3f7038){if(_0x3f7038){return _0x3f7038[_0xdd24('0xc3')](_0xb93bc9[_0xdd24('0x75')][_0xdd24('0xb8')],_[_0xdd24('0xc4')](_0xb93bc9[_0xdd24('0x75')],[_0xdd24('0xb8'),'id'])||{})[_0xdd24('0xc5')](function(){return db[_0xdd24('0x6e')][_0xdd24('0xc1')]({'attributes':['id',_0xdd24('0x2f'),_0xdd24('0x4c')],'where':{'id':_0xb93bc9[_0xdd24('0x75')][_0xdd24('0xb8')]}});})['then'](function(_0x40cd63){socket['emit'](_0xdd24('0xc6'),{'id':Number(_0xb93bc9['params']['id']),'tags':_0x40cd63||[]});return{'id':Number(_0xb93bc9[_0xdd24('0xb5')]['id']),'tags':_0x40cd63||[]};});}})[_0xdd24('0x2c')](respondWithResult(_0x5c94b4,null))[_0xdd24('0x38')](handleError(_0x5c94b4,null));};exports[_0xdd24('0xc7')]=function(_0x2e477c,_0x1fa91b,_0x23af07){return db['WhatsappInteraction'][_0xdd24('0x61')]({'where':{'id':_0x2e477c[_0xdd24('0xb5')]['id']}})['then'](handleEntityNotFound(_0x1fa91b,null))[_0xdd24('0x2c')](function(_0x21decd){if(_0x21decd){return _0x21decd[_0xdd24('0xc7')](_0x2e477c['query'][_0xdd24('0xb8')]);}})['then'](respondWithStatusCode(_0x1fa91b,null))[_0xdd24('0x38')](handleError(_0x1fa91b,null));};exports[_0xdd24('0xc8')]=function(_0x1ccfd3,_0x42c525){var _0x10e956=moment()[_0xdd24('0xc9')]()[_0xdd24('0x97')]();var _0x5a3b01=path[_0xdd24('0xca')](config[_0xdd24('0xcb')],'server',_0xdd24('0xcc'),_0xdd24('0xcd'));var _0xc57d81=path[_0xdd24('0xca')](config[_0xdd24('0xcb')],_0xdd24('0xce'),_0xdd24('0xcc'),_0xdd24('0xcf'));var _0x500990=path[_0xdd24('0xca')](_0x5a3b01,_0x10e956);var _0x3daeb5=util[_0xdd24('0xd0')]('transcript-%d-%s.zip',_0x1ccfd3[_0xdd24('0xb5')]['id'],_0x10e956);var _0x3938d3=path[_0xdd24('0xca')](_0x5a3b01,_0x3daeb5);var _0x39561e=[];_0x39561e[_0xdd24('0x37')]({'model':db['User'],'as':'User','attributes':['id',_0xdd24('0x32')],'raw':!![]});_0x39561e[_0xdd24('0x37')]({'model':db[_0xdd24('0xd1')],'as':_0xdd24('0xd2'),'attributes':['id',_0xdd24('0xd3'),_0xdd24('0xd4')],'raw':!![]});if(_0x1ccfd3[_0xdd24('0x3f')][_0xdd24('0xcf')]){_0x39561e[_0xdd24('0x37')]({'model':db[_0xdd24('0xd5')],'as':_0xdd24('0xd5'),'raw':!![]});}var _0x6e8e0b=[{'model':db[_0xdd24('0xd6')],'as':_0xdd24('0xd7'),'attributes':['id',_0xdd24('0x75'),_0xdd24('0x79'),'direction',_0xdd24('0xd8'),_0xdd24('0x7f')],'include':_0x39561e}];_0x6e8e0b[_0xdd24('0x37')]({'model':db[_0xdd24('0xd9')],'as':_0xdd24('0xda'),'attributes':['id',_0xdd24('0x2f')]});_0x6e8e0b[_0xdd24('0x37')]({'model':db[_0xdd24('0x71')],'as':'Owner','attributes':['id',_0xdd24('0x32')]});return db[_0xdd24('0x9a')][_0xdd24('0x61')]({'where':{'id':_0x1ccfd3['params']['id']},'include':_0x6e8e0b})['then'](handleEntityNotFound(_0x42c525,null))[_0xdd24('0x2c')](function(_0xfc393d){if(_0xfc393d){var _0x3e13dd=_0xfc393d['get']({'plain':!![]});fs[_0xdd24('0xdb')](_0x500990);var _0x136d5c={'channel':_0xdd24('0xdc'),'account':_0x3e13dd[_0xdd24('0xda')][_0xdd24('0x2f')],'agent':_0x3e13dd[_0xdd24('0xdd')]?_0x3e13dd['Owner'][_0xdd24('0x32')]:_0xdd24('0xde'),'createdAt':moment(_0x3e13dd[_0xdd24('0x79')])[_0xdd24('0xd0')](_0xdd24('0xbe'))[_0xdd24('0x97')](),'closedAt':_0x3e13dd[_0xdd24('0xdf')]?moment(_0x3e13dd[_0xdd24('0xe0')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xdd24('0x97')]():'','disposition':_0x3e13dd['disposition'],'messages':_(_0x3e13dd['Messages'])[_0xdd24('0x84')]({'secret':![]})['map'](function(_0x592467){if(_0x592467['Attachment']){var _0x17bdbb=path[_0xdd24('0xca')](_0xc57d81,_0x592467[_0xdd24('0xd5')]['basename']);if(fs['existsSync'](_0x17bdbb)){fs[_0xdd24('0xe1')](_0x17bdbb)[_0xdd24('0xe2')](fs[_0xdd24('0xe3')](path['join'](_0x500990,_0x592467['Attachment']['basename'])));}}return{'date':moment(_0x592467['createdAt'])[_0xdd24('0xd0')](_0xdd24('0xbe'))['toString'](),'sender':_0x592467[_0xdd24('0xe4')]===_0xdd24('0xe5')?_0x592467[_0xdd24('0x71')]?_0x592467['User'][_0xdd24('0x32')]:_0xdd24('0xe6'):_0x592467['Contact'][_0xdd24('0xd3')]+(_0x592467[_0xdd24('0xd2')][_0xdd24('0xd4')]?'\x20'+_0x592467['Contact'][_0xdd24('0xd4')]:''),'body':_0x592467[_0xdd24('0xd5')]?_0x592467[_0xdd24('0xd5')]['basename']:_0x592467[_0xdd24('0x75')],'direction':_0x592467['direction']===_0xdd24('0xe5')?'A':'C','secret':_0x592467[_0xdd24('0xd8')],'read':_0x592467['read'],'attachment':_0x592467[_0xdd24('0xd5')]};})['value']()};return ejs['renderFile'](path[_0xdd24('0xca')](config['root'],_0xdd24('0xce'),_0xdd24('0xe7'),_0xdd24('0xe8')),{'interaction':_0x136d5c})[_0xdd24('0x2c')](function(_0x2c795f){var _0x49b666=path[_0xdd24('0xca')](_0x500990,_0xdd24('0xe9')+_0x3e13dd['id']+'-'+_0x10e956+'.pdf');var _0x5868d0={'path':_0x49b666,'channel':_0xdd24('0xdc'),'interactionId':_0x3e13dd['id']};return pdf['createPdfFromHTML'](_0x2c795f,_0x5868d0);})[_0xdd24('0x2c')](function(){return new BPromise(function(_0x28e9d5,_0x4736f9){zipdir(_0x500990,{'saveTo':_0x3938d3},function(_0x2bac36,_0x5211c8){if(_0x2bac36)return _0x4736f9(_0x2bac36);return _0x28e9d5(_0x5211c8);});})[_0xdd24('0x2c')](function(){return new BPromise(function(_0x180f46,_0xdfaf4e){rimraf(_0x500990,function(_0x281c4c){if(_0x281c4c)_0xdfaf4e(_0x281c4c);return _0x180f46();});});})[_0xdd24('0x2c')](function(){return _0x42c525[_0xdd24('0xc8')](_0x3938d3,_0x3daeb5,function(_0x2cf7d5){if(_0x2cf7d5){console[_0xdd24('0xea')](_0xdd24('0xeb'),_0x2cf7d5);}else{fs[_0xdd24('0xec')](_0x3938d3);}});});});}else{return _0x42c525[_0xdd24('0x1f')](0xc8);}})[_0xdd24('0x38')](handleError(_0x42c525,null));}; \ No newline at end of file +var _0x383a=['register','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','map','fullname','TagIds','split','forEach','Tags','index','WhatsappInteraction','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','select','field','color','from','u.id','u.fullname','ui.WhatsappInteractionId','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20>\x200','Contact','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','some','compact','isEmpty','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','i.id','QueryTypes','SELECT','contactName','DESC','t.id\x20IN\x20?','WhatsappAccountId','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','i.WhatsappAccountId\x20IN\x20?','sequelize','toString','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','WhatsappInteractionId','push','all','show','params','include','merge','catch','create','find','addMessage','WhatsappMessage','ids','omit','getMessages','rawAttributes','format','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','findAll','rows','addTags','spread','emit','whatsappInteractionTags:save','removeTags','download','unix','join','root','files','tmp','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','direction','secret','WhatsappAccount','Account','get','mkdirSync','Whatsapp','Owner','N.A.','closed','disposition','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','server','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','unlinkSync','rimraf','zip-dir','moment','mustache','util','path','ejs','fs-extra','lodash','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket'];(function(_0x3da612,_0x332456){var _0x1a9d1d=function(_0x5ca0d0){while(--_0x5ca0d0){_0x3da612['push'](_0x3da612['shift']());}};_0x1a9d1d(++_0x332456);}(_0x383a,0x1ad));var _0xa383=function(_0x41bd33,_0x8dd533){_0x41bd33=_0x41bd33-0x0;var _0x1ef83a=_0x383a[_0x41bd33];return _0x1ef83a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa383('0x0'));var zipdir=require(_0xa383('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa383('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xa383('0x3'));var util=require(_0xa383('0x4'));var path=require(_0xa383('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa383('0x6'));var fs=require('fs');var fs_extra=require(_0xa383('0x7'));var _=require(_0xa383('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa383('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa383('0xa'));var authService=require(_0xa383('0xb'));var qs=require('../../components/parsers/qs');var as=require(_0xa383('0xc'));var pdf=require(_0xa383('0xd'));var hardwareService=require(_0xa383('0xe'));var logger=require('../../config/logger')(_0xa383('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa383('0x10'));var db=require(_0xa383('0x11'))['db'];config[_0xa383('0x12')]=_[_0xa383('0x13')](config['redis'],{'host':_0xa383('0x14'),'port':0x18eb});var socket=require(_0xa383('0x15'))(new Redis(config[_0xa383('0x12')]));require(_0xa383('0x16'))[_0xa383('0x17')](socket);function respondWithStatusCode(_0x1fcb20,_0x1c655c){_0x1c655c=_0x1c655c||0xcc;return function(_0x83a77a){if(_0x83a77a){return _0x1fcb20['sendStatus'](_0x1c655c);}return _0x1fcb20['status'](_0x1c655c)[_0xa383('0x18')]();};}function respondWithResult(_0x2d8794,_0xe2e956){_0xe2e956=_0xe2e956||0xc8;return function(_0x2f2fd8){if(_0x2f2fd8){return _0x2d8794['status'](_0xe2e956)[_0xa383('0x19')](_0x2f2fd8);}};}function respondWithFilteredResult(_0x5d491c,_0x287b82){return function(_0x81eab0){if(_0x81eab0){var _0x2ccaf7=typeof _0x287b82[_0xa383('0x1a')]===_0xa383('0x1b')&&typeof _0x287b82[_0xa383('0x1c')]===_0xa383('0x1b');var _0x2649b0=_0x81eab0[_0xa383('0x1d')];var _0x113ff0=_0x2ccaf7?0x0:_0x287b82['offset'];var _0x5d87f9=_0x2ccaf7?_0x81eab0['count']:_0x287b82[_0xa383('0x1a')]+_0x287b82[_0xa383('0x1c')];var _0x5e0ba5;if(_0x5d87f9>=_0x2649b0){_0x5d87f9=_0x2649b0;_0x5e0ba5=0xc8;}else{_0x5e0ba5=0xce;}_0x5d491c[_0xa383('0x1e')](_0x5e0ba5);return _0x5d491c['set'](_0xa383('0x1f'),_0x113ff0+'-'+_0x5d87f9+'/'+_0x2649b0)[_0xa383('0x19')](_0x81eab0);}return null;};}function patchUpdates(_0x4db308){return function(_0x433d85){try{jsonpatch[_0xa383('0x20')](_0x433d85,_0x4db308,!![]);}catch(_0x4cc53b){return BPromise[_0xa383('0x21')](_0x4cc53b);}return _0x433d85[_0xa383('0x22')]();};}function saveUpdates(_0x37bacb,_0xd2c369){return function(_0x398cd5){if(_0x398cd5){return _0x398cd5[_0xa383('0x23')](_0x37bacb)['then'](function(_0x23d22b){return _0x23d22b;});}return null;};}function removeEntity(_0x28add7,_0x90148c){return function(_0x2ffa5d){if(_0x2ffa5d){return _0x2ffa5d[_0xa383('0x24')]()[_0xa383('0x25')](function(){_0x28add7[_0xa383('0x1e')](0xcc)[_0xa383('0x18')]();});}};}function handleEntityNotFound(_0x553d45,_0x3b671a){return function(_0x25ce4f){if(!_0x25ce4f){_0x553d45[_0xa383('0x26')](0x194);}return _0x25ce4f;};}function handleError(_0x1db1ac,_0x2640f4){_0x2640f4=_0x2640f4||0x1f4;return function(_0x26c28a){logger[_0xa383('0x27')](_0x26c28a[_0xa383('0x28')]);if(_0x26c28a[_0xa383('0x29')]){delete _0x26c28a[_0xa383('0x29')];}_0x1db1ac[_0xa383('0x1e')](_0x2640f4)['send'](_0x26c28a);};}function getInteractionUsers(_0x4d0ecb,_0xd11504){return new BPromise(function(_0x2e4ba5,_0x390bbe){try{if(_0xd11504[_0x4d0ecb['id']]){_0x4d0ecb['Users']=_[_0xa383('0x2a')](_0xd11504[_0x4d0ecb['id']],function(_0x2468c1){return{'id':_0x2468c1['id'],'fullname':_0x2468c1[_0xa383('0x2b')]};});}}catch(_0x1394c5){_0x390bbe(_0x1394c5);}_0x2e4ba5(_0x4d0ecb);});}function getInteractionTags(_0x56866d,_0x32f851){return new BPromise(function(_0x36de27,_0x302d5b){try{if(_0x56866d[_0xa383('0x2c')]){_0x56866d['Tags']=[];_0x56866d[_0xa383('0x2c')][_0xa383('0x2d')](',')[_0xa383('0x2e')](function(_0xfbff18){_0x56866d[_0xa383('0x2f')]['push'](_0x32f851[_0xfbff18]);});}delete _0x56866d[_0xa383('0x2c')];}catch(_0x39060a){_0x302d5b(_0x39060a);}_0x36de27(_0x56866d);});}function updateWhatsappInteraction(_0x1110fe,_0x402472,_0x59381a){return new BPromise(function(_0x24d74c,_0x46a43e){return getInteractionUsers(_0x1110fe,_0x59381a)['then'](function(_0x129e13){return getInteractionTags(_0x129e13,_0x402472);})[_0xa383('0x25')](function(_0x2eb5c2){_0x24d74c(_0x2eb5c2);})['catch'](function(_0x115a00){_0x46a43e(_0x115a00);});});}exports[_0xa383('0x30')]=function(_0x10afeb,_0x91b4c4){var _0x503cc8={},_0x269cc1={},_0x50869c={'count':0x0,'rows':[]};var _0x238ac4=_[_0xa383('0x2a')](db[_0xa383('0x31')]['rawAttributes'],function(_0x307cb4){return{'name':_0x307cb4[_0xa383('0x32')],'type':_0x307cb4[_0xa383('0x33')][_0xa383('0x34')]};});_0x269cc1[_0xa383('0x35')]=_[_0xa383('0x2a')](_0x238ac4,'name');_0x269cc1[_0xa383('0x36')]=_[_0xa383('0x37')](_0x10afeb[_0xa383('0x36')]);_0x269cc1['filters']=_[_0xa383('0x38')](_0x269cc1[_0xa383('0x35')],_0x269cc1['query']);_0x503cc8[_0xa383('0x39')]=_['intersection'](_0x269cc1['model'],qs[_0xa383('0x3a')](_0x10afeb[_0xa383('0x36')]['fields']));_0x503cc8[_0xa383('0x39')]=_0x503cc8[_0xa383('0x39')][_0xa383('0x3b')]?_0x503cc8[_0xa383('0x39')]:_0x269cc1['model'];if(!_0x10afeb[_0xa383('0x36')][_0xa383('0x3c')](_0xa383('0x3d'))){_0x503cc8[_0xa383('0x1c')]=qs[_0xa383('0x1c')](_0x10afeb['query'][_0xa383('0x1c')]);_0x503cc8[_0xa383('0x1a')]=qs[_0xa383('0x1a')](_0x10afeb['query'][_0xa383('0x1a')]);}_0x503cc8[_0xa383('0x3e')]=qs[_0xa383('0x3f')](_0x10afeb[_0xa383('0x36')][_0xa383('0x3f')]);_0x503cc8[_0xa383('0x40')]=qs[_0xa383('0x41')](_['pick'](_0x10afeb[_0xa383('0x36')],_0x269cc1['filters']),_0x238ac4);var _0x331f14=[];var _0x48a387=squel[_0xa383('0x42')]()['field']('id')[_0xa383('0x43')](_0xa383('0x29'))[_0xa383('0x43')](_0xa383('0x44'))[_0xa383('0x45')]('tools_tags');var _0x3411a3=squel[_0xa383('0x42')]()[_0xa383('0x43')](_0xa383('0x46'))['field'](_0xa383('0x47'))[_0xa383('0x43')](_0xa383('0x48'))['from']('user_has_whatsapp_interactions','ui')[_0xa383('0x49')](_0xa383('0x4a'),'u',_0xa383('0x4b'));var _0x33e177=squel[_0xa383('0x42')]()[_0xa383('0x45')](_0xa383('0x4c'),'i')[_0xa383('0x49')](_0xa383('0x4d'),'c',_0xa383('0x4e'))[_0xa383('0x49')](_0xa383('0x4a'),'o','o.id\x20=\x20i.UserId')[_0xa383('0x49')](_0xa383('0x4f'),'a',_0xa383('0x50'))['left_join']('whatsapp_messages','me','me.WhatsappInteractionId\x20=\x20i.id')[_0xa383('0x49')]('whatsapp_interaction_has_tags','it','it.WhatsappInteractionId\x20=\x20i.id')[_0xa383('0x49')](_0xa383('0x51'),'t',_0xa383('0x52'));var _0x9cbb43=squel[_0xa383('0x53')]();var _0x339bf6=[];var _0x2c393b=squel[_0xa383('0x53')]();var _0x25e61c;if(_0x10afeb['query'][_0xa383('0x54')]){_0x25e61c=as[_0xa383('0x55')](_0x10afeb['query']['search']);var _0x5248c4=_0x25e61c[_0xa383('0x56')];for(var _0xa9719b=0x0;_0xa9719b<_0x25e61c[_0xa383('0x57')][_0xa383('0x3b')];_0xa9719b++){var _0x4e47fc=_0x25e61c[_0xa383('0x57')][_0xa9719b];var _0x1858a9='i';var _0x8cd84=_['find'](_0x238ac4,['name',_0x4e47fc[_0xa383('0x43')]]);if(!_0x8cd84){switch(_0x4e47fc[_0xa383('0x43')]){case _0xa383('0x58'):if(_0x4e47fc[_0xa383('0x59')]==0x1){_0x33e177['having']('`'+_0x4e47fc[_0xa383('0x43')]+'`\x20=\x200');}else{_0x33e177[_0xa383('0x5a')]('`'+_0x4e47fc[_0xa383('0x43')]+_0xa383('0x5b'));}break;case _0xa383('0x5c'):if(_0x4e47fc['operator']==='$substring'){if(_0x4e47fc[_0xa383('0x59')][_0xa383('0x2d')]('\x20')[_0xa383('0x3b')]>0x1){_0x9cbb43[_0x5248c4]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xa383('0x5d')](_0x4e47fc[_0xa383('0x59')]),null);}else{var _0x51d440='%'+_0x4e47fc[_0xa383('0x59')]+'%';_0x9cbb43[_0x5248c4](_0xa383('0x5e'),_0x51d440,_0x51d440,_0x51d440);}}else{_0x8cd84=_['find'](_0x238ac4,[_0xa383('0x29'),_0xa383('0x5f')]);_0x4e47fc[_0xa383('0x43')]=_0xa383('0x5f');_0x348b17=as[_0xa383('0x60')](_0x1858a9,_0x8cd84['type'],_0x4e47fc);_0x9cbb43[_0x5248c4](_0x348b17[_0xa383('0x61')],_0x348b17[_0xa383('0x59')]['start'],_0x348b17['value'][_0xa383('0x18')]);}break;case _0xa383('0x62'):var _0x53c587=_0x4e47fc[_0xa383('0x59')][_0xa383('0x2d')](',')[_0xa383('0x2a')](function(_0x2ba23a){return Number(_0x2ba23a);});_0x53c587[_0xa383('0x2e')](function(_0x4a565d){_0x2c393b['or'](_0xa383('0x63'),'%,'+_0x4a565d+',%');});_0x339bf6=_['union'](_0x339bf6,_0x53c587);break;case _0xa383('0x64'):if(_0x4e47fc[_0xa383('0x65')]===_0xa383('0x66')){_0x9cbb43[_0x5248c4](_0xa383('0x67'),'%'+_0x4e47fc[_0xa383('0x59')]+'%',null);}else{_0x8cd84=_['find'](_0x238ac4,[_0xa383('0x29'),'UserId']);_0x4e47fc['field']=_0xa383('0x68');_0x348b17=as[_0xa383('0x60')](_0x1858a9,_0x8cd84['type'],_0x4e47fc);_0x9cbb43[_0x5248c4](_0x348b17[_0xa383('0x61')],_0x348b17['value'][_0xa383('0x69')],_0x348b17[_0xa383('0x59')]['end']);}break;case _0xa383('0x6a'):_0x348b17=as[_0xa383('0x60')]('me',null,_0x4e47fc);_0x9cbb43[_0x5248c4](_0x348b17[_0xa383('0x61')],_0x348b17[_0xa383('0x59')][_0xa383('0x69')],_0x348b17[_0xa383('0x59')]['end']);break;}}else{var _0x348b17=as[_0xa383('0x60')](_0x1858a9,_0x8cd84[_0xa383('0x33')],_0x4e47fc);_0x9cbb43[_0x5248c4](_0x348b17['text'],_0x348b17[_0xa383('0x59')][_0xa383('0x69')],_0x348b17[_0xa383('0x59')][_0xa383('0x18')]);}}}else{var _0x20de90=_(_0x10afeb[_0xa383('0x36')])[_0xa383('0x37')]()[_0xa383('0x2a')](function(_0x1378bf){return _[_0xa383('0x6b')](_0x238ac4,['name',_0x1378bf])?_0x1378bf:undefined;})[_0xa383('0x6c')]()[_0xa383('0x59')]();if(!_[_0xa383('0x6d')](_0x20de90)){_0x20de90[_0xa383('0x2e')](function(_0x2644ed){if(_0x2644ed==='WhatsappAccountId'){_0x33e177['where']('i.WhatsappAccountId\x20IN\x20?',[][_0xa383('0x6e')](_0x10afeb[_0xa383('0x36')][_0x2644ed]));}else if(_0x2644ed===_0xa383('0x6f')){var _0x1303b6=JSON[_0xa383('0x70')](_0x10afeb[_0xa383('0x36')][_0x2644ed])[_0xa383('0x71')];var _0x5b7cde=JSON[_0xa383('0x70')](_0x10afeb[_0xa383('0x36')][_0x2644ed])[_0xa383('0x72')];_0x33e177['where'](_0xa383('0x73'),_0x1303b6,_0x5b7cde);}else{if(_0x10afeb[_0xa383('0x36')][_0x2644ed]===_0xa383('0x74')){_0x33e177[_0xa383('0x40')]('i.'+_0x2644ed+_0xa383('0x75'));}else{_0x33e177[_0xa383('0x40')]('i.'+_0x2644ed+_0xa383('0x76'),_0x10afeb[_0xa383('0x36')][_0x2644ed]);}}});}if(_0x10afeb['query'][_0xa383('0x77')]){if(_0x10afeb['query'][_0xa383('0x77')]==0x1){_0x33e177['having'](_0xa383('0x78'));}else{_0x33e177[_0xa383('0x5a')](_0xa383('0x79'));}}if(_0x10afeb['query'][_0xa383('0x7a')]){_0x339bf6=_[_0xa383('0x7b')](_0x10afeb[_0xa383('0x36')][_0xa383('0x7a')])?_0x10afeb['query'][_0xa383('0x7a')]:new Array(_0x10afeb['query'][_0xa383('0x7a')]);_0x339bf6[_0xa383('0x2e')](function(_0x460f4d){_0x2c393b['or'](_0xa383('0x63'),'%,'+_0x460f4d+',%');});}if(_0x10afeb[_0xa383('0x36')][_0xa383('0x7c')]){var _0x381270=_0x10afeb[_0xa383('0x36')][_0xa383('0x7c')]['replace']('\x5c','\x5c\x5c')[_0xa383('0x7d')](/'/g,'\x27\x27');if(qs[_0xa383('0x7e')](_0x381270)){_0x9cbb43['or'](_0xa383('0x7f'),_0x381270+'%')['or'](_0xa383('0x80'),_0x381270+'%');}else{_0x9cbb43['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xa383('0x5d')](_0x381270))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x381270+'%');}}}_0x33e177[_0xa383('0x40')](_0x9cbb43);_0x33e177['group'](_0xa383('0x81'));var _0x331108={'type':db['Sequelize'][_0xa383('0x82')][_0xa383('0x83')],'raw':!![]};var _0x14dcfd=_0x33e177['clone']();_0x14dcfd['field']('i.id');_0x14dcfd[_0xa383('0x43')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xa383('0x58'));if(_0x503cc8[_0xa383('0x3e')]){_0x503cc8['order'][_0xa383('0x2e')](function(_0x4e5021){var _0x37c773=_0x4e5021[0x0]===_0xa383('0x84')?_0x4e5021[0x0]:'i.'+_0x4e5021[0x0];_0x33e177[_0xa383('0x3e')](_0x37c773,_0x4e5021[0x1]===_0xa383('0x85')?![]:!![]);});}if(!_[_0xa383('0x6d')](_0x339bf6)){_0x33e177[_0xa383('0x5a')](_0x2c393b);_0x14dcfd[_0xa383('0x40')](_0xa383('0x86'),_0x339bf6);}BPromise['resolve']()[_0xa383('0x25')](function(){if(!_0x25e61c){if(_0x10afeb['query'][_0xa383('0x87')])return;_0x14dcfd[_0xa383('0x40')](_0xa383('0x88'));_0x33e177[_0xa383('0x40')](_0xa383('0x88'));return;}if(_0x10afeb[_0xa383('0x89')]['role']!==_0xa383('0x8a'))return;return _0x10afeb['user'][_0xa383('0x8b')]({'attributes':['id'],'raw':!![]})[_0xa383('0x25')](function(_0x32fe47){if(_[_0xa383('0x6d')](_0x32fe47)){_0x14dcfd[_0xa383('0x40')](_0xa383('0x8c'));_0x33e177[_0xa383('0x40')](_0xa383('0x8c'));}else{_0x14dcfd[_0xa383('0x40')](_0xa383('0x8d'),_[_0xa383('0x2a')](_0x32fe47,'id'));_0x33e177[_0xa383('0x40')]('i.WhatsappAccountId\x20IN\x20?',_[_0xa383('0x2a')](_0x32fe47,'id'));}});})[_0xa383('0x25')](function(){if(_0x10afeb[_0xa383('0x89')]['role']===_0xa383('0x8a')&&!_0x25e61c&&!_0x10afeb['query'][_0xa383('0x87')])return[];return db[_0xa383('0x8e')][_0xa383('0x36')](_0x14dcfd[_0xa383('0x8f')](),_0x331108);})[_0xa383('0x25')](function(_0x9d99e){_0x50869c[_0xa383('0x1d')]=_0x9d99e['length'];if(_0x50869c[_0xa383('0x1d')]===0x0)return[];return db[_0xa383('0x8e')]['query'](_0x48a387[_0xa383('0x8f')](),_0x331108)[_0xa383('0x25')](function(_0x54b4ab){_0x331f14=_['keyBy'](_0x54b4ab,'id');_0x331108=_['merge'](_0x331108,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x10afeb[_0xa383('0x36')][_0xa383('0x3a')]){_0x503cc8[_0xa383('0x39')]['forEach'](function(_0x4a77b4){_0x33e177[_0xa383('0x43')]('i.'+_0x4a77b4);});}else{_0x33e177[_0xa383('0x43')](_0xa383('0x90'),_0xa383('0x58'));_0x33e177[_0xa383('0x43')]('a.key','Account.key');_0x33e177['field']('a.mandatoryDisposition',_0xa383('0x91'));_0x33e177[_0xa383('0x43')](_0xa383('0x92'),_0xa383('0x84'));_0x33e177[_0xa383('0x43')]('i.*');_0x33e177['field'](_0xa383('0x93'),_0xa383('0x94'));_0x33e177[_0xa383('0x43')](_0xa383('0x95'),'Contact.lastName');_0x33e177[_0xa383('0x43')](_0xa383('0x96'),'Contact.email');_0x33e177[_0xa383('0x43')](_0xa383('0x97'),_0xa383('0x98'));_0x33e177[_0xa383('0x43')](_0xa383('0x99'),_0xa383('0x9a'));_0x33e177[_0xa383('0x43')](_0xa383('0x9b'),_0xa383('0x9c'));_0x33e177[_0xa383('0x43')](_0xa383('0x9d'),_0xa383('0x9e'));_0x33e177[_0xa383('0x43')]('o.internal',_0xa383('0x9f'));_0x33e177[_0xa383('0x43')](_0xa383('0xa0'),_0xa383('0x2c'));}if(_0x503cc8['limit'])_0x33e177['limit'](_0x503cc8[_0xa383('0x1c')]);if(_0x503cc8[_0xa383('0x1a')])_0x33e177['offset'](_0x503cc8['offset']);return db[_0xa383('0x8e')][_0xa383('0x36')](_0x33e177[_0xa383('0x8f')](),_0x331108);})[_0xa383('0x25')](function(_0x5cda08){if(_0x5cda08['length']>0x0)_0x3411a3[_0xa383('0x40')]('ui.WhatsappInteractionId\x20IN\x20?',_['map'](_0x5cda08,'id'));return db[_0xa383('0x8e')][_0xa383('0x36')](_0x3411a3['toString'](),_0x331108)[_0xa383('0x25')](function(_0x5eb8b9){var _0x1ada9e=_[_0xa383('0xa1')](_0x5eb8b9,_0xa383('0xa2'));var _0x847bd0=[];_0x5cda08[_0xa383('0x2e')](function(_0x4d2270){_0x847bd0[_0xa383('0xa3')](updateWhatsappInteraction(_0x4d2270,_0x331f14,_0x1ada9e));});return BPromise[_0xa383('0xa4')](_0x847bd0);});});})['then'](function(_0x533ac9){_0x50869c['rows']=_0x533ac9;return _0x50869c;})['then'](respondWithFilteredResult(_0x91b4c4,_0x503cc8))['catch'](handleError(_0x91b4c4,null));};exports[_0xa383('0xa5')]=function(_0x582b55,_0x4489d5){var _0x31b2ec={'raw':![],'where':{'id':_0x582b55[_0xa383('0xa6')]['id']}},_0x31f1da={};_0x31f1da['model']=_['keys'](db[_0xa383('0x31')]['rawAttributes']);_0x31f1da[_0xa383('0x36')]=_[_0xa383('0x37')](_0x582b55[_0xa383('0x36')]);_0x31f1da['filters']=_[_0xa383('0x38')](_0x31f1da['model'],_0x31f1da[_0xa383('0x36')]);_0x31b2ec[_0xa383('0x39')]=_[_0xa383('0x38')](_0x31f1da[_0xa383('0x35')],qs[_0xa383('0x3a')](_0x582b55[_0xa383('0x36')][_0xa383('0x3a')]));_0x31b2ec[_0xa383('0x39')]=_0x31b2ec[_0xa383('0x39')][_0xa383('0x3b')]?_0x31b2ec[_0xa383('0x39')]:_0x31f1da[_0xa383('0x35')];if(_0x582b55[_0xa383('0x36')]['includeAll']){_0x31b2ec[_0xa383('0xa7')]=[{'all':!![]}];}_0x31b2ec=_[_0xa383('0xa8')]({},_0x31b2ec,_0x582b55['options']);return db[_0xa383('0x31')]['find'](_0x31b2ec)['then'](handleEntityNotFound(_0x4489d5,null))[_0xa383('0x25')](respondWithResult(_0x4489d5,null))[_0xa383('0xa9')](handleError(_0x4489d5,null));};exports[_0xa383('0xaa')]=function(_0x1fe063,_0x26754b){return db[_0xa383('0x31')][_0xa383('0xaa')](_0x1fe063[_0xa383('0x6a')],{})['then'](respondWithResult(_0x26754b,0xc9))['catch'](handleError(_0x26754b,null));};exports['update']=function(_0x226617,_0x59ce33){if(_0x226617[_0xa383('0x6a')]['id']){delete _0x226617[_0xa383('0x6a')]['id'];}return db[_0xa383('0x31')][_0xa383('0xab')]({'where':{'id':_0x226617[_0xa383('0xa6')]['id']}})[_0xa383('0x25')](handleEntityNotFound(_0x59ce33,null))[_0xa383('0x25')](saveUpdates(_0x226617[_0xa383('0x6a')],null))[_0xa383('0x25')](respondWithResult(_0x59ce33,null))[_0xa383('0xa9')](handleError(_0x59ce33,null));};exports[_0xa383('0x24')]=function(_0x360b84,_0x27b33c){return db[_0xa383('0x31')][_0xa383('0xab')]({'where':{'id':_0x360b84[_0xa383('0xa6')]['id']}})[_0xa383('0x25')](handleEntityNotFound(_0x27b33c,null))[_0xa383('0x25')](removeEntity(_0x27b33c,null))['catch'](handleError(_0x27b33c,null));};exports['describe']=function(_0x198089,_0x7480e4){return db[_0xa383('0x31')]['describe']()['then'](respondWithResult(_0x7480e4,null))[_0xa383('0xa9')](handleError(_0x7480e4,null));};exports[_0xa383('0xac')]=function(_0x2ccc27,_0x131ab3,_0x5e301b){return db[_0xa383('0xad')][_0xa383('0xab')]({'where':{'id':_0x2ccc27[_0xa383('0xa6')]['id']}})['then'](handleEntityNotFound(_0x131ab3,null))[_0xa383('0x25')](function(_0x59c605){if(_0x59c605){return _0x59c605[_0xa383('0xac')](_0x2ccc27['body'][_0xa383('0xae')],_[_0xa383('0xaf')](_0x2ccc27[_0xa383('0x6a')],[_0xa383('0xae'),'id'])||{});}})['then'](respondWithResult(_0x131ab3,null))[_0xa383('0xa9')](handleError(_0x131ab3,null));};exports[_0xa383('0xb0')]=function(_0x595caa,_0x340bdb,_0x381414){var _0x518229={'raw':![],'where':{}};var _0x100d3b={};var _0xadd757={'count':0x0,'rows':[]};return db[_0xa383('0x31')]['findOne']({'where':{'id':_0x595caa['params']['id']}})['then'](handleEntityNotFound(_0x340bdb,null))['then'](function(_0x4582b8){if(_0x4582b8){_0x100d3b['model']=_['keys'](db[_0xa383('0xad')][_0xa383('0xb1')]);_0x100d3b[_0xa383('0x36')]=_[_0xa383('0x37')](_0x595caa['query']);_0x100d3b[_0xa383('0x41')]=_[_0xa383('0x38')](_0x100d3b[_0xa383('0x35')],_0x100d3b[_0xa383('0x36')]);_0x518229[_0xa383('0x39')]=_[_0xa383('0x38')](_0x100d3b[_0xa383('0x35')],qs[_0xa383('0x3a')](_0x595caa[_0xa383('0x36')]['fields']));_0x518229[_0xa383('0x39')]=_0x518229['attributes']['length']?_0x518229['attributes']:_0x100d3b['model'];if(!_0x595caa[_0xa383('0x36')][_0xa383('0x3c')](_0xa383('0x3d'))){_0x518229[_0xa383('0x1c')]=qs['limit'](_0x595caa['query'][_0xa383('0x1c')]);_0x518229[_0xa383('0x1a')]=qs[_0xa383('0x1a')](_0x595caa[_0xa383('0x36')][_0xa383('0x1a')]);}_0x518229[_0xa383('0x3e')]=qs[_0xa383('0x3f')](_0x595caa[_0xa383('0x36')][_0xa383('0x3f')]);_0x518229[_0xa383('0x40')]=qs[_0xa383('0x41')](_['pick'](_0x595caa[_0xa383('0x36')],_0x100d3b['filters']));_0x518229[_0xa383('0x40')]['WhatsappInteractionId']=_0x4582b8['id'];if(_0x595caa[_0xa383('0x36')][_0xa383('0x7c')]){_0x518229['where']=_[_0xa383('0xa8')](_0x518229['where'],{'$or':_[_0xa383('0x2a')](_0x518229[_0xa383('0x39')],function(_0x34d251){var _0x57baaa={};_0x57baaa[_0x34d251]={'$like':'%'+_0x595caa[_0xa383('0x36')]['filter']+'%'};return _0x57baaa;})});}if(_0x595caa['query'][_0xa383('0x71')]){var _0xa0db57=_0x595caa[_0xa383('0x36')]['$gte'][_0xa383('0x2d')](',');var _0x2103c7={};_0x2103c7[_0xa0db57[0x0]]={'$gte':moment(_0xa0db57[0x1])[_0xa383('0xb2')](_0xa383('0xb3'))};_0x518229[_0xa383('0x40')]=_[_0xa383('0xa8')](_0x518229[_0xa383('0x40')],_0x2103c7);}_0x518229=_['merge']({},_0x518229,_0x595caa[_0xa383('0xb4')]);return db[_0xa383('0xad')][_0xa383('0x1d')]({'where':_0x518229[_0xa383('0x40')]})[_0xa383('0x25')](function(_0x57ac29){_0xadd757[_0xa383('0x1d')]=_0x57ac29;if(_0x595caa['query'][_0xa383('0xb5')]){_0x518229[_0xa383('0xa7')]=[{'all':!![]}];}return db[_0xa383('0xad')][_0xa383('0xb6')](_0x518229);})[_0xa383('0x25')](function(_0x2f27e3){_0xadd757[_0xa383('0xb7')]=_0x2f27e3;return _0xadd757;});}})[_0xa383('0x25')](respondWithFilteredResult(_0x340bdb,_0x518229))[_0xa383('0xa9')](handleError(_0x340bdb,null));};exports[_0xa383('0xb8')]=function(_0x2316e8,_0x33fc6e,_0xee3240){return db[_0xa383('0x31')]['find']({'where':{'id':_0x2316e8[_0xa383('0xa6')]['id']}})[_0xa383('0x25')](handleEntityNotFound(_0x33fc6e,null))['then'](function(_0x10d656){if(_0x10d656){return _0x10d656['setTags'](_0x2316e8[_0xa383('0x6a')][_0xa383('0xae')],_['omit'](_0x2316e8[_0xa383('0x6a')],['ids','id'])||{})[_0xa383('0xb9')](function(){return db[_0xa383('0x62')][_0xa383('0xb6')]({'attributes':['id',_0xa383('0x29'),'color'],'where':{'id':_0x2316e8['body'][_0xa383('0xae')]}});})['then'](function(_0x1ebd88){socket[_0xa383('0xba')](_0xa383('0xbb'),{'id':Number(_0x2316e8['params']['id']),'tags':_0x1ebd88||[]});return{'id':Number(_0x2316e8[_0xa383('0xa6')]['id']),'tags':_0x1ebd88||[]};});}})[_0xa383('0x25')](respondWithResult(_0x33fc6e,null))[_0xa383('0xa9')](handleError(_0x33fc6e,null));};exports[_0xa383('0xbc')]=function(_0x1e17bd,_0x4e143d,_0x548946){return db[_0xa383('0x31')][_0xa383('0xab')]({'where':{'id':_0x1e17bd[_0xa383('0xa6')]['id']}})['then'](handleEntityNotFound(_0x4e143d,null))[_0xa383('0x25')](function(_0x1af3c6){if(_0x1af3c6){return _0x1af3c6['removeTags'](_0x1e17bd[_0xa383('0x36')][_0xa383('0xae')]);}})['then'](respondWithStatusCode(_0x4e143d,null))[_0xa383('0xa9')](handleError(_0x4e143d,null));};exports[_0xa383('0xbd')]=function(_0x1f9134,_0x469fa7){var _0x194db4=moment()[_0xa383('0xbe')]()[_0xa383('0x8f')]();var _0x3b32a8=path[_0xa383('0xbf')](config[_0xa383('0xc0')],'server',_0xa383('0xc1'),_0xa383('0xc2'));var _0x24b59b=path[_0xa383('0xbf')](config[_0xa383('0xc0')],'server','files',_0xa383('0xc3'));var _0xf17630=path['join'](_0x3b32a8,_0x194db4);var _0x27dc5b=util['format'](_0xa383('0xc4'),_0x1f9134[_0xa383('0xa6')]['id'],_0x194db4);var _0x50c551=path[_0xa383('0xbf')](_0x3b32a8,_0x27dc5b);var _0x38a26c=[];_0x38a26c[_0xa383('0xa3')]({'model':db[_0xa383('0x64')],'as':_0xa383('0x64'),'attributes':['id','fullname'],'raw':!![]});_0x38a26c['push']({'model':db[_0xa383('0xc5')],'as':'Contact','attributes':['id',_0xa383('0xc6'),_0xa383('0xc7')],'raw':!![]});if(_0x1f9134['query'][_0xa383('0xc3')]){_0x38a26c[_0xa383('0xa3')]({'model':db[_0xa383('0xc8')],'as':_0xa383('0xc8'),'raw':!![]});}var _0x4fae25=[{'model':db['WhatsappMessage'],'as':'Messages','attributes':['id',_0xa383('0x6a'),_0xa383('0x6f'),_0xa383('0xc9'),_0xa383('0xca'),_0xa383('0x77')],'include':_0x38a26c}];_0x4fae25[_0xa383('0xa3')]({'model':db[_0xa383('0xcb')],'as':_0xa383('0xcc'),'attributes':['id',_0xa383('0x29')]});_0x4fae25[_0xa383('0xa3')]({'model':db[_0xa383('0x64')],'as':'Owner','attributes':['id',_0xa383('0x2b')]});return db[_0xa383('0x31')][_0xa383('0xab')]({'where':{'id':_0x1f9134[_0xa383('0xa6')]['id']},'include':_0x4fae25})['then'](handleEntityNotFound(_0x469fa7,null))[_0xa383('0x25')](function(_0x2af097){if(_0x2af097){var _0x7fdae0=_0x2af097[_0xa383('0xcd')]({'plain':!![]});fs[_0xa383('0xce')](_0xf17630);var _0x2cb356={'channel':_0xa383('0xcf'),'account':_0x7fdae0[_0xa383('0xcc')][_0xa383('0x29')],'agent':_0x7fdae0[_0xa383('0xd0')]?_0x7fdae0[_0xa383('0xd0')][_0xa383('0x2b')]:_0xa383('0xd1'),'createdAt':moment(_0x7fdae0[_0xa383('0x6f')])[_0xa383('0xb2')](_0xa383('0xb3'))['toString'](),'closedAt':_0x7fdae0[_0xa383('0xd2')]?moment(_0x7fdae0['closedAt'])['format'](_0xa383('0xb3'))[_0xa383('0x8f')]():'','disposition':_0x7fdae0[_0xa383('0xd3')],'messages':_(_0x7fdae0[_0xa383('0xd4')])[_0xa383('0x7c')]({'secret':![]})['map'](function(_0x1eb1e7){if(_0x1eb1e7[_0xa383('0xc8')]){var _0x13497d=path[_0xa383('0xbf')](_0x24b59b,_0x1eb1e7['Attachment'][_0xa383('0xd5')]);if(fs[_0xa383('0xd6')](_0x13497d)){fs[_0xa383('0xd7')](_0x13497d)[_0xa383('0xd8')](fs[_0xa383('0xd9')](path[_0xa383('0xbf')](_0xf17630,_0x1eb1e7[_0xa383('0xc8')][_0xa383('0xd5')])));}}return{'date':moment(_0x1eb1e7[_0xa383('0x6f')])['format'](_0xa383('0xb3'))['toString'](),'sender':_0x1eb1e7[_0xa383('0xc9')]===_0xa383('0xda')?_0x1eb1e7[_0xa383('0x64')]?_0x1eb1e7[_0xa383('0x64')][_0xa383('0x2b')]:_0xa383('0xdb'):_0x1eb1e7[_0xa383('0x5c')]['firstName']+(_0x1eb1e7[_0xa383('0x5c')][_0xa383('0xc7')]?'\x20'+_0x1eb1e7[_0xa383('0x5c')][_0xa383('0xc7')]:''),'body':_0x1eb1e7['Attachment']?_0x1eb1e7[_0xa383('0xc8')][_0xa383('0xd5')]:_0x1eb1e7[_0xa383('0x6a')],'direction':_0x1eb1e7[_0xa383('0xc9')]==='out'?'A':'C','secret':_0x1eb1e7[_0xa383('0xca')],'read':_0x1eb1e7[_0xa383('0x77')],'attachment':_0x1eb1e7['Attachment']};})[_0xa383('0x59')]()};return ejs['renderFile'](path[_0xa383('0xbf')](config[_0xa383('0xc0')],_0xa383('0xdc'),'views',_0xa383('0xdd')),{'interaction':_0x2cb356})[_0xa383('0x25')](function(_0xd69118){var _0x4d6768=path[_0xa383('0xbf')](_0xf17630,'transcript-'+_0x7fdae0['id']+'-'+_0x194db4+_0xa383('0xde'));var _0xef5e47={'path':_0x4d6768,'channel':_0xa383('0xcf'),'interactionId':_0x7fdae0['id']};return pdf[_0xa383('0xdf')](_0xd69118,_0xef5e47);})[_0xa383('0x25')](function(){return new BPromise(function(_0x219f4b,_0x2c1ec4){zipdir(_0xf17630,{'saveTo':_0x50c551},function(_0x2e5107,_0x416b61){if(_0x2e5107)return _0x2c1ec4(_0x2e5107);return _0x219f4b(_0x416b61);});})[_0xa383('0x25')](function(){return new BPromise(function(_0x10aba5,_0x5565ab){rimraf(_0xf17630,function(_0x5f0c07){if(_0x5f0c07)_0x5565ab(_0x5f0c07);return _0x10aba5();});});})[_0xa383('0x25')](function(){return _0x469fa7[_0xa383('0xbd')](_0x50c551,_0x27dc5b,function(_0x4be491){if(_0x4be491){console[_0xa383('0xe0')]('err',_0x4be491);}else{fs[_0xa383('0xe1')](_0x50c551);}});});});}else{return _0x469fa7[_0xa383('0x26')](0xc8);}})['catch'](handleError(_0x469fa7,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 79701d1..d736ab4 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 _0x5d31=['../../mysqldb','WhatsappInteraction','setMaxListeners','remove','getUsers','then','setDataValue','map','emit','catch','hasOwnProperty','hook','exports'];(function(_0x268956,_0x532ceb){var _0x5b051e=function(_0x2481ad){while(--_0x2481ad){_0x268956['push'](_0x268956['shift']());}};_0x5b051e(++_0x532ceb);}(_0x5d31,0xf7));var _0x15d3=function(_0x4acb73,_0xb4f550){_0x4acb73=_0x4acb73-0x0;var _0x1598e7=_0x5d31[_0x4acb73];return _0x1598e7;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0x15d3('0x0'))['db'][_0x15d3('0x1')];var WhatsappMessage=require(_0x15d3('0x0'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x15d3('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x15d3('0x3')};function emitEvent(_0x2a8bbe){return function(_0x16bee7,_0x242755,_0x5ebd77){_0x16bee7[_0x15d3('0x4')]({'attributes':['id'],'raw':!![]})[_0x15d3('0x5')](function(_0x41a5f4){_0x16bee7[_0x15d3('0x6')]('Users',_0x41a5f4[_0x15d3('0x7')](function(_0x511f14){return{'id':_0x511f14['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x16bee7['id'],'direction':'in','read':![]},'raw':!![]});})[_0x15d3('0x5')](function(_0x4e158f){_0x16bee7[_0x15d3('0x6')]('unreadMessages',_0x4e158f['length']);WhatsappInteractionEvents[_0x15d3('0x8')](_0x2a8bbe+':'+_0x16bee7['id'],_0x16bee7);WhatsappInteractionEvents[_0x15d3('0x8')](_0x2a8bbe,_0x16bee7);_0x5ebd77(null);})[_0x15d3('0x9')](_0x5ebd77(null));};}for(var e in events){if(events[_0x15d3('0xa')](e)){var event=events[e];WhatsappInteraction[_0x15d3('0xb')](e,emitEvent(event));}}module[_0x15d3('0xc')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x4c71=['setDataValue','Users','map','then','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','getUsers'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x4c71,0x12b));var _0x14c7=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x4c71[_0x2070da];return _0x4f9fe1;};'use strict';var EventEmitter=require(_0x14c7('0x0'));var WhatsappInteraction=require(_0x14c7('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x14c7('0x1'))['db'][_0x14c7('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x14c7('0x3')](0x0);var events={'afterCreate':_0x14c7('0x4'),'afterUpdate':_0x14c7('0x5'),'afterDestroy':'remove'};function emitEvent(_0x10a777){return function(_0xd22e73,_0x24fd35,_0x3c6929){_0xd22e73[_0x14c7('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3f1868){_0xd22e73[_0x14c7('0x7')](_0x14c7('0x8'),_0x3f1868[_0x14c7('0x9')](function(_0x2f19cc){return{'id':_0x2f19cc['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0xd22e73['id'],'direction':'in','read':![]},'raw':!![]});})[_0x14c7('0xa')](function(_0x4f2d04){_0xd22e73[_0x14c7('0x7')](_0x14c7('0xb'),_0x4f2d04['length']);WhatsappInteractionEvents[_0x14c7('0xc')](_0x10a777+':'+_0xd22e73['id'],_0xd22e73);WhatsappInteractionEvents[_0x14c7('0xc')](_0x10a777,_0xd22e73);_0x3c6929(null);})[_0x14c7('0xd')](_0x3c6929(null));};}for(var e in events){if(events[_0x14c7('0xe')](e)){var event=events[e];WhatsappInteraction[_0x14c7('0xf')](e,emitEvent(event));}}module[_0x14c7('0x10')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 4e9229d..21be513 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 _0xab46=['api','moment','request-promise','path','rimraf','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','closedAt'];(function(_0x1d65bd,_0x5052b5){var _0x22e0e9=function(_0x549416){while(--_0x549416){_0x1d65bd['push'](_0x1d65bd['shift']());}};_0x22e0e9(++_0x5052b5);}(_0xab46,0x190));var _0x6ab4=function(_0x2b0690,_0x4f742f){_0x2b0690=_0x2b0690-0x0;var _0x82be1=_0xab46[_0x2b0690];return _0x82be1;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x6ab4('0x0'));var moment=require(_0x6ab4('0x1'));var BPromise=require('bluebird');var rp=require(_0x6ab4('0x2'));var fs=require('fs');var path=require(_0x6ab4('0x3'));var rimraf=require(_0x6ab4('0x4'));var config=require('../../config/environment');var attributes=require(_0x6ab4('0x5'));module[_0x6ab4('0x6')]=function(_0x379870,_0xcc1983){return _0x379870[_0x6ab4('0x7')](_0x6ab4('0x8'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1320ae,_0x85691e,_0x4e4ce0){if(_0x1320ae['changed']('closed')){_0x1320ae[_0x6ab4('0x9')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x4e4ce0(null,_0x1320ae);}}});}; \ No newline at end of file +var _0xe511=['../../config/logger','moment','bluebird','path','rimraf','exports','WhatsappInteraction','whatsapp_interactions','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x59342a,_0x16827b){var _0x17abc9=function(_0x2f7bfc){while(--_0x2f7bfc){_0x59342a['push'](_0x59342a['shift']());}};_0x17abc9(++_0x16827b);}(_0xe511,0x143));var _0x1e51=function(_0x4d3b39,_0x4ec5ad){_0x4d3b39=_0x4d3b39-0x0;var _0x3f92ca=_0xe511[_0x4d3b39];return _0x3f92ca;};'use strict';var _=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var logger=require(_0x1e51('0x2'))('api');var moment=require(_0x1e51('0x3'));var BPromise=require(_0x1e51('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1e51('0x5'));var rimraf=require(_0x1e51('0x6'));var config=require('../../config/environment');var attributes=require('./whatsappInteraction.attributes');module[_0x1e51('0x7')]=function(_0x1ce775,_0x45de70){return _0x1ce775['define'](_0x1e51('0x8'),attributes,{'tableName':_0x1e51('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5c8a01,_0x1aea2d,_0xe4d52c){if(_0x5c8a01['changed'](_0x1e51('0xa'))){_0x5c8a01[_0x1e51('0xb')]=moment()['format'](_0x1e51('0xc'));}_0xe4d52c(null,_0x5c8a01);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index cdf7a3d..c24423e 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 _0x7534=['redis','localhost','./whatsappInteraction.socket','request','then','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','find','addTags','ids','omit','spread','AddTags','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5b7447,_0x16990d){var _0x56a750=function(_0xf805d){while(--_0xf805d){_0x5b7447['push'](_0x5b7447['shift']());}};_0x56a750(++_0x16990d);}(_0x7534,0x15d));var _0x4753=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x7534[_0x432682];return _0x463d05;};'use strict';var _=require(_0x4753('0x0'));var util=require(_0x4753('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4753('0x2'));var fs=require('fs');var Redis=require(_0x4753('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4753('0x4'));var logger=require(_0x4753('0x5'))(_0x4753('0x6'));var config=require(_0x4753('0x7'));var jayson=require(_0x4753('0x8'));var client=jayson[_0x4753('0x9')][_0x4753('0xa')]({'port':0x232a});config[_0x4753('0xb')]=_['defaults'](config[_0x4753('0xb')],{'host':_0x4753('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4753('0xb')]));require(_0x4753('0xd'))['register'](socket);function respondWithRpcPromise(_0x3e4827,_0x246018,_0x2b0d2b){return new BPromise(function(_0x4bce4a,_0x322d59){return client[_0x4753('0xe')](_0x3e4827,_0x2b0d2b)[_0x4753('0xf')](function(_0x21bc34){logger['info'](_0x4753('0x10'),_0x246018,_0x4753('0x11'));logger[_0x4753('0x12')](_0x4753('0x13'),_0x246018,_0x4753('0x11'),JSON[_0x4753('0x14')](_0x21bc34));if(_0x21bc34[_0x4753('0x15')]){if(_0x21bc34[_0x4753('0x15')][_0x4753('0x16')]===0x1f4){logger[_0x4753('0x15')](_0x4753('0x10'),_0x246018,_0x21bc34[_0x4753('0x15')][_0x4753('0x17')]);return _0x322d59(_0x21bc34[_0x4753('0x15')][_0x4753('0x17')]);}logger[_0x4753('0x15')](_0x4753('0x10'),_0x246018,_0x21bc34[_0x4753('0x15')][_0x4753('0x17')]);return _0x4bce4a(_0x21bc34[_0x4753('0x15')][_0x4753('0x17')]);}else{logger[_0x4753('0x18')](_0x4753('0x10'),_0x246018,_0x4753('0x11'));_0x4bce4a(_0x21bc34[_0x4753('0x19')][_0x4753('0x17')]);}})[_0x4753('0x1a')](function(_0x225002){logger[_0x4753('0x15')](_0x4753('0x10'),_0x246018,_0x225002);_0x322d59(_0x225002);});});}exports[_0x4753('0x1b')]=function(_0x271291){var _0x2d2581=this;return new Promise(function(_0x8b513f,_0x4ab4b5){return db[_0x4753('0x1c')][_0x4753('0x1d')](_0x271291[_0x4753('0x1e')],{'raw':_0x271291['options']?_0x271291[_0x4753('0x1f')][_0x4753('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x271291[_0x4753('0x1f')]?_0x271291[_0x4753('0x1f')][_0x4753('0x21')]||null:null,'attributes':_0x271291['options']?_0x271291[_0x4753('0x1f')]['attributes']||null:null,'limit':_0x271291['options']?_0x271291['options']['limit']||null:null})[_0x4753('0xf')](function(_0x4745a7){logger[_0x4753('0x18')](_0x4753('0x1b'),_0x271291);logger[_0x4753('0x12')](_0x4753('0x1b'),_0x271291,JSON[_0x4753('0x14')](_0x4745a7));_0x8b513f(_0x4745a7);})[_0x4753('0x1a')](function(_0x36bf99){logger['error']('UpdateWhatsappInteraction',_0x36bf99['message'],_0x271291);_0x4ab4b5(_0x2d2581[_0x4753('0x15')](0x1f4,_0x36bf99['message']));});});};exports['AddTagsToWhatsappInteraction']=function(_0x5717b0){return new Promise(function(_0x285105,_0x42728a){return db[_0x4753('0x1c')][_0x4753('0x22')]({'where':_0x5717b0['options']?_0x5717b0['options'][_0x4753('0x21')]||null:null})[_0x4753('0xf')](function(_0x4aeba4){if(_0x4aeba4){return _0x4aeba4[_0x4753('0x23')](_0x5717b0['body'][_0x4753('0x24')],_[_0x4753('0x25')](_0x5717b0[_0x4753('0x1e')],[_0x4753('0x24'),'id'])||{});}})[_0x4753('0x26')](function(_0x13d680){logger[_0x4753('0x18')](_0x4753('0x27'),_0x5717b0);logger[_0x4753('0x12')](_0x4753('0x27'),_0x5717b0,JSON[_0x4753('0x14')](_0x13d680));_0x285105(_0x13d680);})['catch'](function(_0x1b877e){logger[_0x4753('0x15')](_0x4753('0x27'),_0x1b877e[_0x4753('0x17')],_0x5717b0);_0x42728a(_this['error'](0x1f4,_0x1b877e['message']));});});}; \ No newline at end of file +var _0x2a61=['find','addTags','ids','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','http','redis','defaults','localhost','./whatsappInteraction.socket','register','request','then','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','WhatsappInteraction','update','body','options','attributes','limit','UpdateWhatsappInteraction','stringify','AddTagsToWhatsappInteraction'];(function(_0x2195d1,_0xd71034){var _0x10f225=function(_0x8cc75c){while(--_0x8cc75c){_0x2195d1['push'](_0x2195d1['shift']());}};_0x10f225(++_0xd71034);}(_0x2a61,0x1f3));var _0x12a6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2a61[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0x12a6('0x0'));var moment=require(_0x12a6('0x1'));var BPromise=require(_0x12a6('0x2'));var rs=require(_0x12a6('0x3'));var fs=require('fs');var Redis=require(_0x12a6('0x4'));var db=require(_0x12a6('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x12a6('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x12a6('0x7')]({'port':0x232a});config[_0x12a6('0x8')]=_[_0x12a6('0x9')](config[_0x12a6('0x8')],{'host':_0x12a6('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x12a6('0x8')]));require(_0x12a6('0xb'))[_0x12a6('0xc')](socket);function respondWithRpcPromise(_0x5a9686,_0x330c83,_0x1569c1){return new BPromise(function(_0x1af20a,_0x4a7c03){return client[_0x12a6('0xd')](_0x5a9686,_0x1569c1)[_0x12a6('0xe')](function(_0x42a26a){logger['info'](_0x12a6('0xf'),_0x330c83,_0x12a6('0x10'));logger[_0x12a6('0x11')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x330c83,'request\x20sent',JSON['stringify'](_0x42a26a));if(_0x42a26a['error']){if(_0x42a26a[_0x12a6('0x12')][_0x12a6('0x13')]===0x1f4){logger[_0x12a6('0x12')]('WhatsappInteraction,\x20%s,\x20%s',_0x330c83,_0x42a26a[_0x12a6('0x12')][_0x12a6('0x14')]);return _0x4a7c03(_0x42a26a['error'][_0x12a6('0x14')]);}logger['error'](_0x12a6('0xf'),_0x330c83,_0x42a26a[_0x12a6('0x12')][_0x12a6('0x14')]);return _0x1af20a(_0x42a26a['error'][_0x12a6('0x14')]);}else{logger[_0x12a6('0x15')](_0x12a6('0xf'),_0x330c83,'request\x20sent');_0x1af20a(_0x42a26a[_0x12a6('0x16')][_0x12a6('0x14')]);}})[_0x12a6('0x17')](function(_0x12748b){logger[_0x12a6('0x12')](_0x12a6('0xf'),_0x330c83,_0x12748b);_0x4a7c03(_0x12748b);});});}exports['UpdateWhatsappInteraction']=function(_0x1c17ba){var _0x25ff9f=this;return new Promise(function(_0x1bb722,_0x2c4184){return db[_0x12a6('0x18')][_0x12a6('0x19')](_0x1c17ba[_0x12a6('0x1a')],{'raw':_0x1c17ba[_0x12a6('0x1b')]?_0x1c17ba[_0x12a6('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c17ba[_0x12a6('0x1b')]?_0x1c17ba['options']['where']||null:null,'attributes':_0x1c17ba[_0x12a6('0x1b')]?_0x1c17ba[_0x12a6('0x1b')][_0x12a6('0x1c')]||null:null,'limit':_0x1c17ba['options']?_0x1c17ba[_0x12a6('0x1b')][_0x12a6('0x1d')]||null:null})['then'](function(_0x2b6327){logger['info'](_0x12a6('0x1e'),_0x1c17ba);logger['debug']('UpdateWhatsappInteraction',_0x1c17ba,JSON[_0x12a6('0x1f')](_0x2b6327));_0x1bb722(_0x2b6327);})[_0x12a6('0x17')](function(_0x205740){logger[_0x12a6('0x12')]('UpdateWhatsappInteraction',_0x205740[_0x12a6('0x14')],_0x1c17ba);_0x2c4184(_0x25ff9f[_0x12a6('0x12')](0x1f4,_0x205740[_0x12a6('0x14')]));});});};exports[_0x12a6('0x20')]=function(_0x22a3f9){return new Promise(function(_0x39d6a7,_0x277f17){return db[_0x12a6('0x18')][_0x12a6('0x21')]({'where':_0x22a3f9[_0x12a6('0x1b')]?_0x22a3f9[_0x12a6('0x1b')]['where']||null:null})['then'](function(_0x3b1fe1){if(_0x3b1fe1){return _0x3b1fe1[_0x12a6('0x22')](_0x22a3f9[_0x12a6('0x1a')][_0x12a6('0x23')],_['omit'](_0x22a3f9[_0x12a6('0x1a')],[_0x12a6('0x23'),'id'])||{});}})[_0x12a6('0x24')](function(_0x373f54){logger['info']('AddTags',_0x22a3f9);logger[_0x12a6('0x11')](_0x12a6('0x25'),_0x22a3f9,JSON[_0x12a6('0x1f')](_0x373f54));_0x39d6a7(_0x373f54);})[_0x12a6('0x17')](function(_0x4f1487){logger['error'](_0x12a6('0x25'),_0x4f1487[_0x12a6('0x14')],_0x22a3f9);_0x277f17(_this[_0x12a6('0x12')](0x1f4,_0x4f1487[_0x12a6('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 60df275..4748e68 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 _0xb7e9=['register','length','whatsappInteraction:','./whatsappInteraction.events','remove','update','removeListener'];(function(_0x8ba19a,_0x1d2b2b){var _0x2bd8b4=function(_0xee823f){while(--_0xee823f){_0x8ba19a['push'](_0x8ba19a['shift']());}};_0x2bd8b4(++_0x1d2b2b);}(_0xb7e9,0x16f));var _0x9b7e=function(_0x4612df,_0x37a8f7){_0x4612df=_0x4612df-0x0;var _0x2804c6=_0xb7e9[_0x4612df];return _0x2804c6;};'use strict';var WhatsappInteractionEvents=require(_0x9b7e('0x0'));var events=['save',_0x9b7e('0x1'),_0x9b7e('0x2')];function createListener(_0x266d6e,_0x2559d5){return function(_0x118ea1){_0x2559d5['emit'](_0x266d6e,_0x118ea1);};}function removeListener(_0x27f306,_0x228584){return function(){WhatsappInteractionEvents[_0x9b7e('0x3')](_0x27f306,_0x228584);};}exports[_0x9b7e('0x4')]=function(_0x5264ad){for(var _0x4e40eb=0x0,_0x364744=events[_0x9b7e('0x5')];_0x4e40eb<_0x364744;_0x4e40eb++){var _0x36e6fd=events[_0x4e40eb];var _0x112935=createListener(_0x9b7e('0x6')+_0x36e6fd,_0x5264ad);WhatsappInteractionEvents['on'](_0x36e6fd,_0x112935);}}; \ No newline at end of file +var _0x7387=['register','length','./whatsappInteraction.events','remove','update','emit'];(function(_0x48ee41,_0x3f9fc2){var _0x198f62=function(_0x2508ef){while(--_0x2508ef){_0x48ee41['push'](_0x48ee41['shift']());}};_0x198f62(++_0x3f9fc2);}(_0x7387,0x12e));var _0x7738=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x7387[_0x178e48];return _0x440d7e;};'use strict';var WhatsappInteractionEvents=require(_0x7738('0x0'));var events=['save',_0x7738('0x1'),_0x7738('0x2')];function createListener(_0x285225,_0x55df58){return function(_0x5b9430){_0x55df58[_0x7738('0x3')](_0x285225,_0x5b9430);};}function removeListener(_0xb3689a,_0x8ead4){return function(){WhatsappInteractionEvents['removeListener'](_0xb3689a,_0x8ead4);};}exports[_0x7738('0x4')]=function(_0x50a0e2){for(var _0x3b9cc8=0x0,_0x3958f1=events[_0x7738('0x5')];_0x3b9cc8<_0x3958f1;_0x3b9cc8++){var _0x55fdd4=events[_0x3b9cc8];var _0x329c3e=createListener('whatsappInteraction:'+_0x55fdd4,_0x50a0e2);WhatsappInteractionEvents['on'](_0x55fdd4,_0x329c3e);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index b41dac3..c93e18d 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 _0x3d79=['delete','destroy','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','post','whatsappmessage:create','create','/:id/status','put','update','/:id/accept','accept','/:id/reject'];(function(_0x47cc40,_0x3b3d9b){var _0x4623c0=function(_0x3a6179){while(--_0x3a6179){_0x47cc40['push'](_0x47cc40['shift']());}};_0x4623c0(++_0x3b3d9b);}(_0x3d79,0xd1));var _0x93d7=function(_0x4b8a74,_0x15aa68){_0x4b8a74=_0x4b8a74-0x0;var _0x2bc85a=_0x3d79[_0x4b8a74];return _0x2bc85a;};'use strict';var multer=require(_0x93d7('0x0'));var util=require(_0x93d7('0x1'));var path=require(_0x93d7('0x2'));var timeout=require(_0x93d7('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x93d7('0x4'));var interaction=require(_0x93d7('0x5'));var config=require(_0x93d7('0x6'));var controller=require('./whatsappMessage.controller');router[_0x93d7('0x7')]('/',auth[_0x93d7('0x8')](),controller['index']);router['get']('/describe',auth[_0x93d7('0x8')](),controller[_0x93d7('0x9')]);router[_0x93d7('0x7')](_0x93d7('0xa'),auth['isAuthenticated'](),controller[_0x93d7('0xb')]);router[_0x93d7('0xc')]('/',auth[_0x93d7('0x8')](),interaction['tracked']('whatsapp',_0x93d7('0xd')),controller[_0x93d7('0xe')]);router['post'](_0x93d7('0xf'),controller['status']);router[_0x93d7('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x93d7('0x11')]);router[_0x93d7('0x10')](_0x93d7('0x12'),auth[_0x93d7('0x8')](),controller[_0x93d7('0x13')]);router['put'](_0x93d7('0x14'),auth['isAuthenticated'](),controller['reject']);router[_0x93d7('0x15')](_0x93d7('0xa'),auth['isAuthenticated'](),controller[_0x93d7('0x16')]);module['exports']=router; \ No newline at end of file +var _0x9a4c=['/:id/status','status','put','update','/:id/accept','/:id/reject','reject','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','tracked','whatsapp','create'];(function(_0x500789,_0x1ffb8d){var _0xe05b0c=function(_0x133d14){while(--_0x133d14){_0x500789['push'](_0x500789['shift']());}};_0xe05b0c(++_0x1ffb8d);}(_0x9a4c,0xb0));var _0xc9a4=function(_0x12512f,_0x19c37d){_0x12512f=_0x12512f-0x0;var _0x3583ba=_0x9a4c[_0x12512f];return _0x3583ba;};'use strict';var multer=require(_0xc9a4('0x0'));var util=require(_0xc9a4('0x1'));var path=require(_0xc9a4('0x2'));var timeout=require(_0xc9a4('0x3'));var express=require(_0xc9a4('0x4'));var router=express[_0xc9a4('0x5')]();var fs_extra=require(_0xc9a4('0x6'));var auth=require(_0xc9a4('0x7'));var interaction=require(_0xc9a4('0x8'));var config=require(_0xc9a4('0x9'));var controller=require(_0xc9a4('0xa'));router['get']('/',auth[_0xc9a4('0xb')](),controller[_0xc9a4('0xc')]);router[_0xc9a4('0xd')](_0xc9a4('0xe'),auth[_0xc9a4('0xb')](),controller[_0xc9a4('0xf')]);router[_0xc9a4('0xd')](_0xc9a4('0x10'),auth[_0xc9a4('0xb')](),controller['show']);router['post']('/',auth[_0xc9a4('0xb')](),interaction[_0xc9a4('0x11')](_0xc9a4('0x12'),'whatsappmessage:create'),controller[_0xc9a4('0x13')]);router['post'](_0xc9a4('0x14'),controller[_0xc9a4('0x15')]);router[_0xc9a4('0x16')](_0xc9a4('0x10'),auth[_0xc9a4('0xb')](),controller[_0xc9a4('0x17')]);router['put'](_0xc9a4('0x18'),auth[_0xc9a4('0xb')](),controller['accept']);router[_0xc9a4('0x16')](_0xc9a4('0x19'),auth[_0xc9a4('0xb')](),controller[_0xc9a4('0x1a')]);router['delete'](_0xc9a4('0x10'),auth[_0xc9a4('0xb')](),controller['destroy']);module[_0xc9a4('0x1b')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 958d095..5e3aabe 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 _0xcf58=['medium','BOOLEAN','ENUM','out','STRING','DATE','TEXT','sequelize','exports'];(function(_0x454e6d,_0x1e1f38){var _0x4bc294=function(_0x2c803a){while(--_0x2c803a){_0x454e6d['push'](_0x454e6d['shift']());}};_0x4bc294(++_0x1e1f38);}(_0xcf58,0x193));var _0x8cf5=function(_0x3db351,_0x4002ff){_0x3db351=_0x3db351-0x0;var _0x3c466f=_0xcf58[_0x3db351];return _0x3c466f;};'use strict';var Sequelize=require(_0x8cf5('0x0'));module[_0x8cf5('0x1')]={'body':{'type':Sequelize['TEXT'](_0x8cf5('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x8cf5('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8cf5('0x4')]('in',_0x8cf5('0x5')),'defaultValue':_0x8cf5('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x8cf5('0x6')](0xbe)},'phone':{'type':Sequelize[_0x8cf5('0x6')]},'readAt':{'type':Sequelize[_0x8cf5('0x7')]},'secret':{'type':Sequelize[_0x8cf5('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x8cf5('0x6')]},'providerResponse':{'type':Sequelize[_0x8cf5('0x8')]}}; \ No newline at end of file +var _0xc8c3=['STRING','sequelize','exports','TEXT','ENUM','out','DATE','BOOLEAN'];(function(_0x4f5c07,_0x81096b){var _0x204647=function(_0x113212){while(--_0x113212){_0x4f5c07['push'](_0x4f5c07['shift']());}};_0x204647(++_0x81096b);}(_0xc8c3,0x1c1));var _0x3c8c=function(_0x11ba83,_0xd5611a){_0x11ba83=_0x11ba83-0x0;var _0x3f3925=_0xc8c3[_0x11ba83];return _0x3f3925;};'use strict';var Sequelize=require(_0x3c8c('0x0'));module[_0x3c8c('0x1')]={'body':{'type':Sequelize[_0x3c8c('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x3c8c('0x3')]('in',_0x3c8c('0x4')),'defaultValue':_0x3c8c('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x3c8c('0x5')]},'secret':{'type':Sequelize[_0x3c8c('0x6')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x3c8c('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 7f183c0..526d0f6 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 _0xffb3=['[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','ContactId','sequelize','contact','fullname','email','internal','SIP/%s','channel','event','accept','acceptmessage','WhatsappInteraction','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','User','interface','motionChannel','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','messageId','MessageStatus','read','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','jayson/promise','http','client','then','info','WhatsappMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','index','WhatsappMessage','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','describe','whatsapp-interactions','whatsapp','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','format','interaction'];(function(_0x10ec33,_0x29824d){var _0x54d0fc=function(_0x22665c){while(--_0x22665c){_0x10ec33['push'](_0x10ec33['shift']());}};_0x54d0fc(++_0x29824d);}(_0xffb3,0xb2));var _0x3ffb=function(_0x361751,_0x1cdc76){_0x361751=_0x361751-0x0;var _0x65769b=_0xffb3[_0x361751];return _0x65769b;};'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('./whatsappMessage.socket')[_0x3ffb('0x1e')](socket);var jayson=require(_0x3ffb('0x1f'));var client=jayson['client'][_0x3ffb('0x20')]({'port':0x232c});var client9002=jayson[_0x3ffb('0x21')][_0x3ffb('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x20efe9,_0x416392,_0x2a5fe2,_0xaccabf){return new BPromise(function(_0x29af07,_0x34c7ff){var _0x2a3178=_0xaccabf||client;return _0x2a3178['request'](_0x20efe9,_0x2a5fe2)[_0x3ffb('0x22')](function(_0x1ff650){logger[_0x3ffb('0x23')](_0x3ffb('0x24'),_0x416392,'request\x20sent');logger[_0x3ffb('0x25')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x416392,_0x3ffb('0x26'),JSON[_0x3ffb('0x27')](_0x1ff650));if(_0x1ff650[_0x3ffb('0x28')]){if(_0x1ff650[_0x3ffb('0x28')]['code']===0x1f4){logger[_0x3ffb('0x28')](_0x3ffb('0x24'),_0x416392,_0x1ff650[_0x3ffb('0x28')]['message']);return _0x34c7ff(_0x1ff650[_0x3ffb('0x28')]['message']);}logger[_0x3ffb('0x28')](_0x3ffb('0x24'),_0x416392,_0x1ff650[_0x3ffb('0x28')][_0x3ffb('0x29')]);return _0x29af07(_0x1ff650[_0x3ffb('0x28')][_0x3ffb('0x29')]);}else{logger['info'](_0x3ffb('0x24'),_0x416392,_0x3ffb('0x26'));_0x29af07(_0x1ff650[_0x3ffb('0x2a')][_0x3ffb('0x29')]);}})[_0x3ffb('0x2b')](function(_0x50dac6){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x416392,_0x50dac6);_0x34c7ff(_0x50dac6);});});}function respondWithStatusCode(_0x29d98e,_0x5c3900){_0x5c3900=_0x5c3900||0xcc;return function(_0xfa8b48){if(_0xfa8b48){return _0x29d98e[_0x3ffb('0x2c')](_0x5c3900);}return _0x29d98e[_0x3ffb('0x2d')](_0x5c3900)['end']();};}function respondWithResult(_0x127548,_0x56be80){_0x56be80=_0x56be80||0xc8;return function(_0x1cdbfa){if(_0x1cdbfa){return _0x127548[_0x3ffb('0x2d')](_0x56be80)[_0x3ffb('0x2e')](_0x1cdbfa);}};}function respondWithFilteredResult(_0x1bd7e6,_0x43c269){return function(_0x5a4f50){if(_0x5a4f50){var _0x4ad9bd=typeof _0x43c269[_0x3ffb('0x2f')]===_0x3ffb('0x30')&&typeof _0x43c269[_0x3ffb('0x31')]===_0x3ffb('0x30');var _0x1327e8=_0x5a4f50['count'];var _0x5ad14f=_0x4ad9bd?0x0:_0x43c269[_0x3ffb('0x2f')];var _0x5bd730=_0x4ad9bd?_0x5a4f50[_0x3ffb('0x32')]:_0x43c269['offset']+_0x43c269[_0x3ffb('0x31')];var _0x39cac7;if(_0x5bd730>=_0x1327e8){_0x5bd730=_0x1327e8;_0x39cac7=0xc8;}else{_0x39cac7=0xce;}_0x1bd7e6['status'](_0x39cac7);return _0x1bd7e6[_0x3ffb('0x33')](_0x3ffb('0x34'),_0x5ad14f+'-'+_0x5bd730+'/'+_0x1327e8)[_0x3ffb('0x2e')](_0x5a4f50);}return null;};}function patchUpdates(_0x591a30){return function(_0x3931c3){try{jsonpatch[_0x3ffb('0x35')](_0x3931c3,_0x591a30,!![]);}catch(_0x5a08e4){return BPromise[_0x3ffb('0x36')](_0x5a08e4);}return _0x3931c3[_0x3ffb('0x37')]();};}function saveUpdates(_0x3c8698,_0x21e5e6){return function(_0x5139de){if(_0x5139de){return _0x5139de[_0x3ffb('0x38')](_0x3c8698)[_0x3ffb('0x22')](function(_0x34821c){return _0x34821c;});}return null;};}function removeEntity(_0x3612c8,_0x38b975){return function(_0x3b7457){if(_0x3b7457){return _0x3b7457[_0x3ffb('0x39')]()['then'](function(){_0x3612c8[_0x3ffb('0x2d')](0xcc)[_0x3ffb('0x3a')]();});}};}function handleEntityNotFound(_0x5609b4,_0x52191b){return function(_0x1c728e){if(!_0x1c728e){_0x5609b4[_0x3ffb('0x2c')](0x194);}return _0x1c728e;};}function handleError(_0x280cd4,_0x1cea15){_0x1cea15=_0x1cea15||0x1f4;return function(_0x2fdcf0){logger['error'](_0x2fdcf0[_0x3ffb('0x3b')]);if(_0x2fdcf0[_0x3ffb('0x3c')]){delete _0x2fdcf0[_0x3ffb('0x3c')];}_0x280cd4[_0x3ffb('0x2d')](_0x1cea15)[_0x3ffb('0x3d')](_0x2fdcf0);};}exports[_0x3ffb('0x3e')]=function(_0x2bb0f4,_0x4397d3){var _0x3cc03a={},_0x23a814={},_0x16a1f3={'count':0x0,'rows':[]};var _0x2520b5=_['map'](db[_0x3ffb('0x3f')]['rawAttributes'],function(_0x4141e3){return{'name':_0x4141e3['fieldName'],'type':_0x4141e3[_0x3ffb('0x40')][_0x3ffb('0x41')]};});_0x23a814['model']=_[_0x3ffb('0x42')](_0x2520b5,'name');_0x23a814[_0x3ffb('0x43')]=_[_0x3ffb('0x44')](_0x2bb0f4[_0x3ffb('0x43')]);_0x23a814['filters']=_[_0x3ffb('0x45')](_0x23a814[_0x3ffb('0x46')],_0x23a814['query']);_0x3cc03a[_0x3ffb('0x47')]=_['intersection'](_0x23a814[_0x3ffb('0x46')],qs[_0x3ffb('0x48')](_0x2bb0f4[_0x3ffb('0x43')][_0x3ffb('0x48')]));_0x3cc03a[_0x3ffb('0x47')]=_0x3cc03a[_0x3ffb('0x47')][_0x3ffb('0x49')]?_0x3cc03a[_0x3ffb('0x47')]:_0x23a814[_0x3ffb('0x46')];if(!_0x2bb0f4[_0x3ffb('0x43')][_0x3ffb('0x4a')](_0x3ffb('0x4b'))){_0x3cc03a[_0x3ffb('0x31')]=qs[_0x3ffb('0x31')](_0x2bb0f4[_0x3ffb('0x43')][_0x3ffb('0x31')]);_0x3cc03a[_0x3ffb('0x2f')]=qs[_0x3ffb('0x2f')](_0x2bb0f4[_0x3ffb('0x43')][_0x3ffb('0x2f')]);}_0x3cc03a[_0x3ffb('0x4c')]=qs[_0x3ffb('0x4d')](_0x2bb0f4[_0x3ffb('0x43')]['sort']);_0x3cc03a[_0x3ffb('0x4e')]=qs['filters'](_[_0x3ffb('0x4f')](_0x2bb0f4[_0x3ffb('0x43')],_0x23a814[_0x3ffb('0x50')]),_0x2520b5);if(_0x2bb0f4[_0x3ffb('0x43')][_0x3ffb('0x51')]){_0x3cc03a['where']=_[_0x3ffb('0x52')](_0x3cc03a['where'],{'$or':_[_0x3ffb('0x42')](_0x2520b5,function(_0x241c11){if(_0x241c11[_0x3ffb('0x40')]!==_0x3ffb('0x53')){var _0x51e82d={};_0x51e82d[_0x241c11[_0x3ffb('0x3c')]]={'$like':'%'+_0x2bb0f4['query'][_0x3ffb('0x51')]+'%'};return _0x51e82d;}})});}_0x3cc03a=_[_0x3ffb('0x52')]({},_0x3cc03a,_0x2bb0f4[_0x3ffb('0x54')]);var _0xdc99bc={'where':_0x3cc03a[_0x3ffb('0x4e')]};return db['WhatsappMessage']['count'](_0xdc99bc)[_0x3ffb('0x22')](function(_0x2b18aa){_0x16a1f3[_0x3ffb('0x32')]=_0x2b18aa;if(_0x2bb0f4[_0x3ffb('0x43')][_0x3ffb('0x55')]){_0x3cc03a[_0x3ffb('0x56')]=[{'all':!![]}];}return db[_0x3ffb('0x3f')][_0x3ffb('0x57')](_0x3cc03a);})[_0x3ffb('0x22')](function(_0x202146){_0x16a1f3[_0x3ffb('0x58')]=_0x202146;return _0x16a1f3;})[_0x3ffb('0x22')](respondWithFilteredResult(_0x4397d3,_0x3cc03a))[_0x3ffb('0x2b')](handleError(_0x4397d3,null));};exports[_0x3ffb('0x59')]=function(_0x2dc104,_0x1c1d08){var _0xbac9ec={'raw':!![],'where':{'id':_0x2dc104[_0x3ffb('0x5a')]['id']}},_0x83f224={};_0x83f224[_0x3ffb('0x46')]=_[_0x3ffb('0x44')](db['WhatsappMessage'][_0x3ffb('0x5b')]);_0x83f224[_0x3ffb('0x43')]=_[_0x3ffb('0x44')](_0x2dc104[_0x3ffb('0x43')]);_0x83f224[_0x3ffb('0x50')]=_[_0x3ffb('0x45')](_0x83f224[_0x3ffb('0x46')],_0x83f224[_0x3ffb('0x43')]);_0xbac9ec['attributes']=_[_0x3ffb('0x45')](_0x83f224['model'],qs['fields'](_0x2dc104['query']['fields']));_0xbac9ec['attributes']=_0xbac9ec[_0x3ffb('0x47')][_0x3ffb('0x49')]?_0xbac9ec['attributes']:_0x83f224[_0x3ffb('0x46')];if(_0x2dc104[_0x3ffb('0x43')][_0x3ffb('0x55')]){_0xbac9ec[_0x3ffb('0x56')]=[{'all':!![]}];}_0xbac9ec=_[_0x3ffb('0x52')]({},_0xbac9ec,_0x2dc104[_0x3ffb('0x54')]);return db[_0x3ffb('0x3f')][_0x3ffb('0x5c')](_0xbac9ec)[_0x3ffb('0x22')](handleEntityNotFound(_0x1c1d08,null))['then'](respondWithResult(_0x1c1d08,null))[_0x3ffb('0x2b')](handleError(_0x1c1d08,null));};exports['create']=function(_0x907e24,_0x4748e3){return db[_0x3ffb('0x3f')][_0x3ffb('0x5d')](_0x907e24[_0x3ffb('0x5e')],{})['then'](respondWithResult(_0x4748e3,0xc9))[_0x3ffb('0x2b')](handleError(_0x4748e3,null));};exports['update']=function(_0x5b5349,_0x33abd9){if(_0x5b5349[_0x3ffb('0x5e')]['id']){delete _0x5b5349[_0x3ffb('0x5e')]['id'];}return db['WhatsappMessage'][_0x3ffb('0x5c')]({'where':{'id':_0x5b5349[_0x3ffb('0x5a')]['id']}})['then'](handleEntityNotFound(_0x33abd9,null))[_0x3ffb('0x22')](saveUpdates(_0x5b5349[_0x3ffb('0x5e')],null))[_0x3ffb('0x22')](respondWithResult(_0x33abd9,null))[_0x3ffb('0x2b')](handleError(_0x33abd9,null));};exports['destroy']=function(_0x24ebf6,_0x25ecb0){return db[_0x3ffb('0x3f')][_0x3ffb('0x5c')]({'where':{'id':_0x24ebf6['params']['id']}})[_0x3ffb('0x22')](handleEntityNotFound(_0x25ecb0,null))[_0x3ffb('0x22')](removeEntity(_0x25ecb0,null))[_0x3ffb('0x2b')](handleError(_0x25ecb0,null));};exports['describe']=function(_0x10a5dd,_0x4ea433){return db['WhatsappMessage'][_0x3ffb('0x5f')]()[_0x3ffb('0x22')](respondWithResult(_0x4ea433,null))[_0x3ffb('0x2b')](handleError(_0x4ea433,null));};var interaction_log=require(_0x3ffb('0x17'))(_0x3ffb('0x60'));exports['accept']=function(_0x451443,_0x3cd648,_0x4f5aeb){var _0x35429d={'agent':{},'channel':_0x3ffb('0x61')};if(_0x451443[_0x3ffb('0x5e')]['id']){delete _0x451443[_0x3ffb('0x5e')]['id'];}_0x451443['body']['read']=!![];_0x451443[_0x3ffb('0x5e')][_0x3ffb('0x62')]=moment()['format'](_0x3ffb('0x63'));_0x451443['body'][_0x3ffb('0x64')]=_0x451443['body'][_0x3ffb('0x64')]||_0x451443[_0x3ffb('0x65')]['id'];_0x35429d[_0x3ffb('0x66')]['id']=_0x451443['body'][_0x3ffb('0x64')];return db[_0x3ffb('0x3f')]['find']({'where':{'id':_0x451443[_0x3ffb('0x5a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3cd648,null))[_0x3ffb('0x22')](saveUpdates(_0x451443[_0x3ffb('0x5e')],null))[_0x3ffb('0x22')](function(_0x27b957){if(_0x27b957){_0x35429d[_0x3ffb('0x29')]=_0x27b957[_0x3ffb('0x67')]({'plain':!![]});return db['WhatsappInteraction'][_0x3ffb('0x5c')]({'where':{'id':_0x27b957['WhatsappInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x3cd648,null))[_0x3ffb('0x22')](function(_0xc35d0f){if(_0xc35d0f){return _0xc35d0f[_0x3ffb('0x38')]({'UserId':_0x451443['body'][_0x3ffb('0x64')],'read1stAt':_['isNil'](_0xc35d0f['read1stAt'])?moment()[_0x3ffb('0x68')](_0x3ffb('0x63')):undefined});}return null;})['then'](function(_0x27eb5f){if(_0x27eb5f){_0x35429d[_0x3ffb('0x69')]=_0x27eb5f['get']({'plain':!![]});interaction_log[_0x3ffb('0x23')](_0x3ffb('0x6a'),_0x451443[_0x3ffb('0x65')]['id'],_0x451443[_0x3ffb('0x65')][_0x3ffb('0x3c')],_0x451443[_0x3ffb('0x65')]['role'],_0x35429d[_0x3ffb('0x69')]['id'],_0x451443[_0x3ffb('0x5e')]?JSON['stringify'](_0x451443[_0x3ffb('0x5e')]):_0x3ffb('0x6b'));return respondWithRpcPromise(_0x3ffb('0x6c'),'acceptMessage',_0x35429d);}return null;})[_0x3ffb('0x22')](function(_0x24aeaa){var _0x6f044b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x24aeaa[_0x3ffb('0x29')][_0x3ffb('0x6d')];return db[_0x3ffb('0x6e')][_0x3ffb('0x43')](_0x6f044b,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x3ffb('0x22')](function(_0x4f5df1){return _0x4f5df1;});})['then'](function(_0x1d66e9){if(_0x1d66e9){_0x35429d[_0x3ffb('0x29')][_0x3ffb('0x6f')]=_0x1d66e9[0x0];if(!_0x451443[_0x3ffb('0x5e')][_0x3ffb('0x64')])return;return db['User']['find']({'where':{'id':_0x451443[_0x3ffb('0x5e')][_0x3ffb('0x64')],'role':'agent'},'attributes':['id',_0x3ffb('0x3c'),_0x3ffb('0x70'),_0x3ffb('0x71'),_0x3ffb('0x72')],'raw':!![]});}return null;})[_0x3ffb('0x22')](function(_0x590366){if(!_0x590366)return null;_0x35429d[_0x3ffb('0x29')]['agent']=_0x590366;return _0x35429d;})[_0x3ffb('0x22')](function(_0x1ee91f){if(_0x1ee91f){if(_0x451443['body']['manual']){_0x35429d[_0x3ffb('0x29')]['interface']=util[_0x3ffb('0x68')](_0x3ffb('0x73'),_0x451443[_0x3ffb('0x65')][_0x3ffb('0x3c')]);_0x35429d[_0x3ffb('0x29')][_0x3ffb('0x74')]=_0x35429d[_0x3ffb('0x74')];_0x35429d[_0x3ffb('0x29')]['motionChannel']=_0x35429d['channel'];_0x35429d['message'][_0x3ffb('0x75')]=_0x3ffb('0x76');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x3ffb('0x77'),'message':_0x35429d['message']},client9002)[_0x3ffb('0x22')](function(){return _0x35429d;});}return _0x35429d;}return null;})[_0x3ffb('0x22')](respondWithResult(_0x3cd648,null))[_0x3ffb('0x2b')](handleError(_0x3cd648,null));};var interaction_log=require(_0x3ffb('0x17'))('whatsapp-interactions');exports[_0x3ffb('0x36')]=function(_0xea75ed,_0x269f5d,_0x1c53fc){var _0x200c02={'agent':{},'channel':_0x3ffb('0x61')};if(_0xea75ed['body']['id']){delete _0xea75ed['body']['id'];}_0xea75ed[_0x3ffb('0x5e')][_0x3ffb('0x64')]=_0xea75ed[_0x3ffb('0x5e')][_0x3ffb('0x64')]||_0xea75ed[_0x3ffb('0x65')]['id'];_0x200c02[_0x3ffb('0x66')]['id']=_0xea75ed[_0x3ffb('0x5e')][_0x3ffb('0x64')];return db[_0x3ffb('0x3f')][_0x3ffb('0x5c')]({'where':{'id':_0xea75ed[_0x3ffb('0x5a')]['id'],'UserId':null}})[_0x3ffb('0x22')](handleEntityNotFound(_0x269f5d,null))[_0x3ffb('0x22')](function(_0x2cc8f1){if(_0x2cc8f1){_0x200c02['message']=_0x2cc8f1[_0x3ffb('0x67')]({'plain':!![]});return db[_0x3ffb('0x78')][_0x3ffb('0x5c')]({'where':{'id':_0x2cc8f1[_0x3ffb('0x79')]}});}return null;})[_0x3ffb('0x22')](handleEntityNotFound(_0x269f5d,null))['then'](function(_0xd5bf51){if(_0xd5bf51){_0x200c02['interaction']=_0xd5bf51['get']({'plain':!![]});interaction_log['info'](_0x3ffb('0x7a'),_0xea75ed[_0x3ffb('0x65')]['id'],_0xea75ed[_0x3ffb('0x65')][_0x3ffb('0x3c')],_0xea75ed[_0x3ffb('0x65')][_0x3ffb('0x7b')],_0x200c02[_0x3ffb('0x69')]['id'],_0xea75ed['body']?JSON[_0x3ffb('0x27')](_0xea75ed[_0x3ffb('0x5e')]):_0x3ffb('0x6b'));return respondWithRpcPromise(_0x3ffb('0x7c'),_0x3ffb('0x7d'),_0x200c02);}return null;})['then'](function(_0x52864a){var _0x1adb18='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x52864a[_0x3ffb('0x29')][_0x3ffb('0x6d')];return db[_0x3ffb('0x6e')][_0x3ffb('0x43')](_0x1adb18,{'type':db[_0x3ffb('0x7e')][_0x3ffb('0x7f')][_0x3ffb('0x80')],'raw':!![]})['then'](function(_0x2c9b8d){return _0x2c9b8d;});})[_0x3ffb('0x22')](function(_0x553198){if(_0x553198){_0x200c02['message'][_0x3ffb('0x6f')]=_0x553198[0x0];if(!_0xea75ed[_0x3ffb('0x5e')][_0x3ffb('0x64')])return;return db[_0x3ffb('0x81')][_0x3ffb('0x5c')]({'where':{'id':_0xea75ed[_0x3ffb('0x5e')][_0x3ffb('0x64')],'role':_0x3ffb('0x66')},'attributes':['id','name',_0x3ffb('0x70'),'email',_0x3ffb('0x72')],'raw':!![]});}return null;})[_0x3ffb('0x22')](function(_0x506d85){if(!_0x506d85)return null;_0x200c02[_0x3ffb('0x29')][_0x3ffb('0x66')]=_0x506d85;return _0x200c02;})[_0x3ffb('0x22')](function(_0x56488e){if(_0x56488e){_0x56488e[_0x3ffb('0x29')][_0x3ffb('0x82')]=util[_0x3ffb('0x68')](_0x3ffb('0x73'),_0xea75ed[_0x3ffb('0x65')][_0x3ffb('0x3c')]);_0x56488e[_0x3ffb('0x29')][_0x3ffb('0x74')]=_0x200c02[_0x3ffb('0x74')];_0x56488e[_0x3ffb('0x29')][_0x3ffb('0x83')]=_0x200c02[_0x3ffb('0x74')];_0x56488e['message']['event']=_0x3ffb('0x36');respondWithRpcPromise('EventManager','EventManager',{'event':_0x3ffb('0x84'),'message':_0x56488e[_0x3ffb('0x29')]},client9002);return _0x200c02;}return null;})[_0x3ffb('0x22')](respondWithResult(_0x269f5d,null))[_0x3ffb('0x2b')](handleError(_0x269f5d,null));};exports[_0x3ffb('0x2d')]=function(_0x31e60b,_0x409d35,_0x479504){if(_0x31e60b[_0x3ffb('0x5e')]['id']){delete _0x31e60b[_0x3ffb('0x5e')]['id'];}var _0x4da906;return db['WhatsappMessage'][_0x3ffb('0x5c')]({'where':{'id':_0x31e60b[_0x3ffb('0x5a')]['id']}})[_0x3ffb('0x22')](handleEntityNotFound(_0x409d35,null))[_0x3ffb('0x22')](function(_0x21cf27){if(_0x21cf27){_0x4da906=_0x21cf27;return db[_0x3ffb('0x85')][_0x3ffb('0x5c')]({'where':{'id':_0x21cf27[_0x3ffb('0x86')]}});}})[_0x3ffb('0x22')](handleEntityNotFound(_0x409d35,null))[_0x3ffb('0x22')](function(_0x2fbe32){if(_0x2fbe32){logger[_0x3ffb('0x25')](_0x3ffb('0x87'),_0x3ffb('0x2d'),'received\x20delivery\x20report\x20from',_0x2fbe32[_0x3ffb('0x40')],util[_0x3ffb('0x88')](_0x31e60b[_0x3ffb('0x5e')],{'showHidden':![],'depth':null}));switch(_0x2fbe32[_0x3ffb('0x40')]){case _0x3ffb('0x89'):if(_0x31e60b[_0x3ffb('0x5e')][_0x3ffb('0x8a')]&&_0x31e60b[_0x3ffb('0x5e')][_0x3ffb('0x8a')]===_0x4da906[_0x3ffb('0x8b')]&&_0x31e60b[_0x3ffb('0x5e')]['MessageStatus']&&_0x31e60b[_0x3ffb('0x5e')][_0x3ffb('0x8c')]===_0x3ffb('0x8d')){return _0x4da906[_0x3ffb('0x38')]({'read':!![]});}else{logger[_0x3ffb('0x28')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x3ffb('0x2d'),_0x3ffb('0x89'),util['inspect'](_0x31e60b[_0x3ffb('0x5e')],{'showHidden':![],'depth':null}));}break;}return _0x4da906;}})[_0x3ffb('0x22')](respondWithResult(_0x409d35,null))[_0x3ffb('0x2b')](handleError(_0x409d35,null));}; \ No newline at end of file +var _0x0d6a=['hasOwnProperty','nolimit','order','sort','where','pick','merge','includeAll','include','WhatsappMessage','findAll','rows','params','rawAttributes','options','find','create','body','describe','accept','whatsapp','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','ContactId','contact','User','fullname','email','internal','interface','channel','event','EventManager','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','sequelize','Sequelize','QueryTypes','SELECT','SIP/%s','WhatsappAccount','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','then','info','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','name','send','index','map','type','key','query','keys','filters','model','attributes','intersection','fields','length'];(function(_0x1b24fa,_0x436522){var _0x2852bd=function(_0x187de7){while(--_0x187de7){_0x1b24fa['push'](_0x1b24fa['shift']());}};_0x2852bd(++_0x436522);}(_0x0d6a,0xc9));var _0xa0d6=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0x0d6a[_0x5d80de];return _0x1c7556;};'use strict';var emlformat=require(_0xa0d6('0x0'));var rimraf=require(_0xa0d6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa0d6('0x2'));var rp=require(_0xa0d6('0x3'));var moment=require(_0xa0d6('0x4'));var BPromise=require(_0xa0d6('0x5'));var Mustache=require(_0xa0d6('0x6'));var util=require(_0xa0d6('0x7'));var path=require(_0xa0d6('0x8'));var sox=require(_0xa0d6('0x9'));var csv=require(_0xa0d6('0xa'));var ejs=require(_0xa0d6('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa0d6('0xc'));var squel=require(_0xa0d6('0xd'));var crypto=require(_0xa0d6('0xe'));var jsforce=require(_0xa0d6('0xf'));var deskjs=require(_0xa0d6('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa0d6('0x11'));var Papa=require('papaparse');var Redis=require(_0xa0d6('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa0d6('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa0d6('0x14'));var logger=require(_0xa0d6('0x15'))(_0xa0d6('0x16'));var utils=require(_0xa0d6('0x17'));var config=require(_0xa0d6('0x18'));var licenseUtil=require(_0xa0d6('0x19'));var db=require('../../mysqldb')['db'];config[_0xa0d6('0x1a')]=_[_0xa0d6('0x1b')](config[_0xa0d6('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xa0d6('0x1c'))(new Redis(config[_0xa0d6('0x1a')]));require(_0xa0d6('0x1d'))[_0xa0d6('0x1e')](socket);var jayson=require(_0xa0d6('0x1f'));var client=jayson[_0xa0d6('0x20')][_0xa0d6('0x21')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x39e63f,_0x3f8ed3,_0xb21e34,_0x3ee9d9){return new BPromise(function(_0x1e8b82,_0x1985e6){var _0x82e7b6=_0x3ee9d9||client;return _0x82e7b6['request'](_0x39e63f,_0xb21e34)[_0xa0d6('0x22')](function(_0x4723b4){logger[_0xa0d6('0x23')]('WhatsappMessage,\x20%s,\x20%s',_0x3f8ed3,_0xa0d6('0x24'));logger['debug'](_0xa0d6('0x25'),_0x3f8ed3,'request\x20sent',JSON[_0xa0d6('0x26')](_0x4723b4));if(_0x4723b4[_0xa0d6('0x27')]){if(_0x4723b4[_0xa0d6('0x27')][_0xa0d6('0x28')]===0x1f4){logger[_0xa0d6('0x27')](_0xa0d6('0x29'),_0x3f8ed3,_0x4723b4['error'][_0xa0d6('0x2a')]);return _0x1985e6(_0x4723b4[_0xa0d6('0x27')]['message']);}logger[_0xa0d6('0x27')]('WhatsappMessage,\x20%s,\x20%s',_0x3f8ed3,_0x4723b4['error'][_0xa0d6('0x2a')]);return _0x1e8b82(_0x4723b4[_0xa0d6('0x27')][_0xa0d6('0x2a')]);}else{logger[_0xa0d6('0x23')](_0xa0d6('0x29'),_0x3f8ed3,_0xa0d6('0x24'));_0x1e8b82(_0x4723b4[_0xa0d6('0x2b')][_0xa0d6('0x2a')]);}})[_0xa0d6('0x2c')](function(_0x338b17){logger['error'](_0xa0d6('0x29'),_0x3f8ed3,_0x338b17);_0x1985e6(_0x338b17);});});}function respondWithStatusCode(_0x16753e,_0x621e42){_0x621e42=_0x621e42||0xcc;return function(_0x2656c5){if(_0x2656c5){return _0x16753e[_0xa0d6('0x2d')](_0x621e42);}return _0x16753e[_0xa0d6('0x2e')](_0x621e42)[_0xa0d6('0x2f')]();};}function respondWithResult(_0x437150,_0xcb7cf2){_0xcb7cf2=_0xcb7cf2||0xc8;return function(_0x28abb2){if(_0x28abb2){return _0x437150[_0xa0d6('0x2e')](_0xcb7cf2)[_0xa0d6('0x30')](_0x28abb2);}};}function respondWithFilteredResult(_0x414b84,_0x382a37){return function(_0x11b38c){if(_0x11b38c){var _0x19b932=typeof _0x382a37[_0xa0d6('0x31')]===_0xa0d6('0x32')&&typeof _0x382a37[_0xa0d6('0x33')]===_0xa0d6('0x32');var _0x184a5a=_0x11b38c[_0xa0d6('0x34')];var _0xa62bf6=_0x19b932?0x0:_0x382a37[_0xa0d6('0x31')];var _0x4a30e1=_0x19b932?_0x11b38c[_0xa0d6('0x34')]:_0x382a37['offset']+_0x382a37[_0xa0d6('0x33')];var _0x266675;if(_0x4a30e1>=_0x184a5a){_0x4a30e1=_0x184a5a;_0x266675=0xc8;}else{_0x266675=0xce;}_0x414b84[_0xa0d6('0x2e')](_0x266675);return _0x414b84['set'](_0xa0d6('0x35'),_0xa62bf6+'-'+_0x4a30e1+'/'+_0x184a5a)[_0xa0d6('0x30')](_0x11b38c);}return null;};}function patchUpdates(_0x5e7084){return function(_0x28f597){try{jsonpatch[_0xa0d6('0x36')](_0x28f597,_0x5e7084,!![]);}catch(_0x556746){return BPromise[_0xa0d6('0x37')](_0x556746);}return _0x28f597[_0xa0d6('0x38')]();};}function saveUpdates(_0x52bb7c,_0x54fbfb){return function(_0x2e48dc){if(_0x2e48dc){return _0x2e48dc[_0xa0d6('0x39')](_0x52bb7c)['then'](function(_0xac9125){return _0xac9125;});}return null;};}function removeEntity(_0x2f8a3c,_0x4d5dc4){return function(_0xe323b1){if(_0xe323b1){return _0xe323b1[_0xa0d6('0x3a')]()['then'](function(){_0x2f8a3c[_0xa0d6('0x2e')](0xcc)[_0xa0d6('0x2f')]();});}};}function handleEntityNotFound(_0x49c2f7,_0x4ce5c5){return function(_0x3c23ec){if(!_0x3c23ec){_0x49c2f7[_0xa0d6('0x2d')](0x194);}return _0x3c23ec;};}function handleError(_0xd13f64,_0x4369fd){_0x4369fd=_0x4369fd||0x1f4;return function(_0x5aba86){logger[_0xa0d6('0x27')](_0x5aba86['stack']);if(_0x5aba86[_0xa0d6('0x3b')]){delete _0x5aba86[_0xa0d6('0x3b')];}_0xd13f64[_0xa0d6('0x2e')](_0x4369fd)[_0xa0d6('0x3c')](_0x5aba86);};}exports[_0xa0d6('0x3d')]=function(_0x3f5969,_0xbe949e){var _0x3e5664={},_0x598e84={},_0xc2b8a3={'count':0x0,'rows':[]};var _0x3c0d5f=_[_0xa0d6('0x3e')](db['WhatsappMessage']['rawAttributes'],function(_0x15e690){return{'name':_0x15e690['fieldName'],'type':_0x15e690[_0xa0d6('0x3f')][_0xa0d6('0x40')]};});_0x598e84['model']=_[_0xa0d6('0x3e')](_0x3c0d5f,_0xa0d6('0x3b'));_0x598e84[_0xa0d6('0x41')]=_[_0xa0d6('0x42')](_0x3f5969[_0xa0d6('0x41')]);_0x598e84[_0xa0d6('0x43')]=_['intersection'](_0x598e84[_0xa0d6('0x44')],_0x598e84[_0xa0d6('0x41')]);_0x3e5664[_0xa0d6('0x45')]=_[_0xa0d6('0x46')](_0x598e84[_0xa0d6('0x44')],qs['fields'](_0x3f5969[_0xa0d6('0x41')][_0xa0d6('0x47')]));_0x3e5664['attributes']=_0x3e5664[_0xa0d6('0x45')][_0xa0d6('0x48')]?_0x3e5664[_0xa0d6('0x45')]:_0x598e84[_0xa0d6('0x44')];if(!_0x3f5969[_0xa0d6('0x41')][_0xa0d6('0x49')](_0xa0d6('0x4a'))){_0x3e5664[_0xa0d6('0x33')]=qs['limit'](_0x3f5969['query'][_0xa0d6('0x33')]);_0x3e5664[_0xa0d6('0x31')]=qs[_0xa0d6('0x31')](_0x3f5969[_0xa0d6('0x41')][_0xa0d6('0x31')]);}_0x3e5664[_0xa0d6('0x4b')]=qs[_0xa0d6('0x4c')](_0x3f5969[_0xa0d6('0x41')][_0xa0d6('0x4c')]);_0x3e5664[_0xa0d6('0x4d')]=qs['filters'](_[_0xa0d6('0x4e')](_0x3f5969[_0xa0d6('0x41')],_0x598e84[_0xa0d6('0x43')]),_0x3c0d5f);if(_0x3f5969[_0xa0d6('0x41')]['filter']){_0x3e5664[_0xa0d6('0x4d')]=_[_0xa0d6('0x4f')](_0x3e5664[_0xa0d6('0x4d')],{'$or':_[_0xa0d6('0x3e')](_0x3c0d5f,function(_0x3bfbe4){if(_0x3bfbe4['type']!=='VIRTUAL'){var _0x82e50d={};_0x82e50d[_0x3bfbe4[_0xa0d6('0x3b')]]={'$like':'%'+_0x3f5969[_0xa0d6('0x41')]['filter']+'%'};return _0x82e50d;}})});}_0x3e5664=_[_0xa0d6('0x4f')]({},_0x3e5664,_0x3f5969['options']);var _0x177e11={'where':_0x3e5664[_0xa0d6('0x4d')]};return db['WhatsappMessage'][_0xa0d6('0x34')](_0x177e11)[_0xa0d6('0x22')](function(_0x3739df){_0xc2b8a3['count']=_0x3739df;if(_0x3f5969[_0xa0d6('0x41')][_0xa0d6('0x50')]){_0x3e5664[_0xa0d6('0x51')]=[{'all':!![]}];}return db[_0xa0d6('0x52')][_0xa0d6('0x53')](_0x3e5664);})[_0xa0d6('0x22')](function(_0x12594e){_0xc2b8a3[_0xa0d6('0x54')]=_0x12594e;return _0xc2b8a3;})[_0xa0d6('0x22')](respondWithFilteredResult(_0xbe949e,_0x3e5664))[_0xa0d6('0x2c')](handleError(_0xbe949e,null));};exports['show']=function(_0x577fea,_0xcde9fe){var _0x29e9fd={'raw':!![],'where':{'id':_0x577fea[_0xa0d6('0x55')]['id']}},_0x413b23={};_0x413b23[_0xa0d6('0x44')]=_[_0xa0d6('0x42')](db['WhatsappMessage'][_0xa0d6('0x56')]);_0x413b23['query']=_[_0xa0d6('0x42')](_0x577fea[_0xa0d6('0x41')]);_0x413b23[_0xa0d6('0x43')]=_['intersection'](_0x413b23[_0xa0d6('0x44')],_0x413b23[_0xa0d6('0x41')]);_0x29e9fd[_0xa0d6('0x45')]=_[_0xa0d6('0x46')](_0x413b23['model'],qs[_0xa0d6('0x47')](_0x577fea[_0xa0d6('0x41')][_0xa0d6('0x47')]));_0x29e9fd['attributes']=_0x29e9fd[_0xa0d6('0x45')]['length']?_0x29e9fd['attributes']:_0x413b23[_0xa0d6('0x44')];if(_0x577fea[_0xa0d6('0x41')][_0xa0d6('0x50')]){_0x29e9fd[_0xa0d6('0x51')]=[{'all':!![]}];}_0x29e9fd=_[_0xa0d6('0x4f')]({},_0x29e9fd,_0x577fea[_0xa0d6('0x57')]);return db[_0xa0d6('0x52')][_0xa0d6('0x58')](_0x29e9fd)['then'](handleEntityNotFound(_0xcde9fe,null))['then'](respondWithResult(_0xcde9fe,null))[_0xa0d6('0x2c')](handleError(_0xcde9fe,null));};exports['create']=function(_0x1ac398,_0x2f7534){return db[_0xa0d6('0x52')][_0xa0d6('0x59')](_0x1ac398[_0xa0d6('0x5a')],{})[_0xa0d6('0x22')](respondWithResult(_0x2f7534,0xc9))['catch'](handleError(_0x2f7534,null));};exports[_0xa0d6('0x39')]=function(_0x578ef7,_0x557b0c){if(_0x578ef7[_0xa0d6('0x5a')]['id']){delete _0x578ef7[_0xa0d6('0x5a')]['id'];}return db[_0xa0d6('0x52')]['find']({'where':{'id':_0x578ef7[_0xa0d6('0x55')]['id']}})[_0xa0d6('0x22')](handleEntityNotFound(_0x557b0c,null))[_0xa0d6('0x22')](saveUpdates(_0x578ef7[_0xa0d6('0x5a')],null))[_0xa0d6('0x22')](respondWithResult(_0x557b0c,null))['catch'](handleError(_0x557b0c,null));};exports[_0xa0d6('0x3a')]=function(_0x7380ee,_0x3bf2fa){return db[_0xa0d6('0x52')][_0xa0d6('0x58')]({'where':{'id':_0x7380ee[_0xa0d6('0x55')]['id']}})[_0xa0d6('0x22')](handleEntityNotFound(_0x3bf2fa,null))['then'](removeEntity(_0x3bf2fa,null))['catch'](handleError(_0x3bf2fa,null));};exports[_0xa0d6('0x5b')]=function(_0x2ec7be,_0x2e0d76){return db[_0xa0d6('0x52')][_0xa0d6('0x5b')]()[_0xa0d6('0x22')](respondWithResult(_0x2e0d76,null))['catch'](handleError(_0x2e0d76,null));};var interaction_log=require(_0xa0d6('0x15'))('whatsapp-interactions');exports[_0xa0d6('0x5c')]=function(_0x12e2d9,_0x5d9fae,_0x35fea9){var _0x507d94={'agent':{},'channel':_0xa0d6('0x5d')};if(_0x12e2d9['body']['id']){delete _0x12e2d9[_0xa0d6('0x5a')]['id'];}_0x12e2d9['body']['read']=!![];_0x12e2d9[_0xa0d6('0x5a')]['readAt']=moment()[_0xa0d6('0x5e')](_0xa0d6('0x5f'));_0x12e2d9[_0xa0d6('0x5a')]['UserId']=_0x12e2d9[_0xa0d6('0x5a')][_0xa0d6('0x60')]||_0x12e2d9[_0xa0d6('0x61')]['id'];_0x507d94[_0xa0d6('0x62')]['id']=_0x12e2d9['body'][_0xa0d6('0x60')];return db[_0xa0d6('0x52')][_0xa0d6('0x58')]({'where':{'id':_0x12e2d9[_0xa0d6('0x55')]['id'],'UserId':null}})[_0xa0d6('0x22')](handleEntityNotFound(_0x5d9fae,null))[_0xa0d6('0x22')](saveUpdates(_0x12e2d9[_0xa0d6('0x5a')],null))[_0xa0d6('0x22')](function(_0x38a0ae){if(_0x38a0ae){_0x507d94[_0xa0d6('0x2a')]=_0x38a0ae[_0xa0d6('0x63')]({'plain':!![]});return db[_0xa0d6('0x64')]['find']({'where':{'id':_0x38a0ae[_0xa0d6('0x65')]}});}return null;})[_0xa0d6('0x22')](handleEntityNotFound(_0x5d9fae,null))[_0xa0d6('0x22')](function(_0x3f308b){if(_0x3f308b){return _0x3f308b[_0xa0d6('0x39')]({'UserId':_0x12e2d9[_0xa0d6('0x5a')]['UserId'],'read1stAt':_[_0xa0d6('0x66')](_0x3f308b[_0xa0d6('0x67')])?moment()[_0xa0d6('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xa0d6('0x22')](function(_0xf6ab33){if(_0xf6ab33){_0x507d94[_0xa0d6('0x68')]=_0xf6ab33['get']({'plain':!![]});interaction_log[_0xa0d6('0x23')](_0xa0d6('0x69'),_0x12e2d9[_0xa0d6('0x61')]['id'],_0x12e2d9[_0xa0d6('0x61')][_0xa0d6('0x3b')],_0x12e2d9[_0xa0d6('0x61')][_0xa0d6('0x6a')],_0x507d94['interaction']['id'],_0x12e2d9['body']?JSON['stringify'](_0x12e2d9[_0xa0d6('0x5a')]):_0xa0d6('0x6b'));return respondWithRpcPromise(_0xa0d6('0x6c'),'acceptMessage',_0x507d94);}return null;})[_0xa0d6('0x22')](function(_0x5a9aa3){var _0x3ca5cf='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5a9aa3['message'][_0xa0d6('0x6d')];return db['sequelize'][_0xa0d6('0x41')](_0x3ca5cf,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0xa0d6('0x22')](function(_0x5f4e63){return _0x5f4e63;});})['then'](function(_0x5e02fa){if(_0x5e02fa){_0x507d94[_0xa0d6('0x2a')][_0xa0d6('0x6e')]=_0x5e02fa[0x0];if(!_0x12e2d9[_0xa0d6('0x5a')][_0xa0d6('0x60')])return;return db[_0xa0d6('0x6f')][_0xa0d6('0x58')]({'where':{'id':_0x12e2d9[_0xa0d6('0x5a')][_0xa0d6('0x60')],'role':_0xa0d6('0x62')},'attributes':['id',_0xa0d6('0x3b'),_0xa0d6('0x70'),_0xa0d6('0x71'),_0xa0d6('0x72')],'raw':!![]});}return null;})['then'](function(_0x1cb860){if(!_0x1cb860)return null;_0x507d94['message'][_0xa0d6('0x62')]=_0x1cb860;return _0x507d94;})['then'](function(_0xf2bf5d){if(_0xf2bf5d){if(_0x12e2d9[_0xa0d6('0x5a')]['manual']){_0x507d94[_0xa0d6('0x2a')][_0xa0d6('0x73')]=util[_0xa0d6('0x5e')]('SIP/%s',_0x12e2d9[_0xa0d6('0x61')][_0xa0d6('0x3b')]);_0x507d94[_0xa0d6('0x2a')][_0xa0d6('0x74')]=_0x507d94[_0xa0d6('0x74')];_0x507d94['message']['motionChannel']=_0x507d94[_0xa0d6('0x74')];_0x507d94['message'][_0xa0d6('0x75')]=_0xa0d6('0x5c');return respondWithRpcPromise(_0xa0d6('0x76'),'EventManager',{'event':'acceptmessage','message':_0x507d94['message']},client9002)[_0xa0d6('0x22')](function(){return _0x507d94;});}return _0x507d94;}return null;})[_0xa0d6('0x22')](respondWithResult(_0x5d9fae,null))['catch'](handleError(_0x5d9fae,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports[_0xa0d6('0x37')]=function(_0x393595,_0x3b56d1,_0x50859c){var _0x2b49d9={'agent':{},'channel':_0xa0d6('0x5d')};if(_0x393595[_0xa0d6('0x5a')]['id']){delete _0x393595[_0xa0d6('0x5a')]['id'];}_0x393595[_0xa0d6('0x5a')][_0xa0d6('0x60')]=_0x393595[_0xa0d6('0x5a')][_0xa0d6('0x60')]||_0x393595[_0xa0d6('0x61')]['id'];_0x2b49d9[_0xa0d6('0x62')]['id']=_0x393595['body'][_0xa0d6('0x60')];return db[_0xa0d6('0x52')][_0xa0d6('0x58')]({'where':{'id':_0x393595[_0xa0d6('0x55')]['id'],'UserId':null}})[_0xa0d6('0x22')](handleEntityNotFound(_0x3b56d1,null))[_0xa0d6('0x22')](function(_0x59612b){if(_0x59612b){_0x2b49d9[_0xa0d6('0x2a')]=_0x59612b[_0xa0d6('0x63')]({'plain':!![]});return db['WhatsappInteraction'][_0xa0d6('0x58')]({'where':{'id':_0x59612b[_0xa0d6('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x3b56d1,null))['then'](function(_0x205f79){if(_0x205f79){_0x2b49d9[_0xa0d6('0x68')]=_0x205f79[_0xa0d6('0x63')]({'plain':!![]});interaction_log[_0xa0d6('0x23')](_0xa0d6('0x77'),_0x393595[_0xa0d6('0x61')]['id'],_0x393595[_0xa0d6('0x61')][_0xa0d6('0x3b')],_0x393595['user']['role'],_0x2b49d9[_0xa0d6('0x68')]['id'],_0x393595['body']?JSON['stringify'](_0x393595[_0xa0d6('0x5a')]):'null');return respondWithRpcPromise(_0xa0d6('0x78'),'rejectMessage',_0x2b49d9);}return null;})[_0xa0d6('0x22')](function(_0x17124c){var _0x2b2ec4='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x17124c[_0xa0d6('0x2a')][_0xa0d6('0x6d')];return db[_0xa0d6('0x79')][_0xa0d6('0x41')](_0x2b2ec4,{'type':db[_0xa0d6('0x7a')][_0xa0d6('0x7b')][_0xa0d6('0x7c')],'raw':!![]})[_0xa0d6('0x22')](function(_0x29c8e1){return _0x29c8e1;});})[_0xa0d6('0x22')](function(_0x5ed71e){if(_0x5ed71e){_0x2b49d9[_0xa0d6('0x2a')][_0xa0d6('0x6e')]=_0x5ed71e[0x0];if(!_0x393595['body'][_0xa0d6('0x60')])return;return db[_0xa0d6('0x6f')][_0xa0d6('0x58')]({'where':{'id':_0x393595[_0xa0d6('0x5a')][_0xa0d6('0x60')],'role':_0xa0d6('0x62')},'attributes':['id','name',_0xa0d6('0x70'),_0xa0d6('0x71'),_0xa0d6('0x72')],'raw':!![]});}return null;})['then'](function(_0x3446bd){if(!_0x3446bd)return null;_0x2b49d9[_0xa0d6('0x2a')]['agent']=_0x3446bd;return _0x2b49d9;})[_0xa0d6('0x22')](function(_0x331160){if(_0x331160){_0x331160['message'][_0xa0d6('0x73')]=util[_0xa0d6('0x5e')](_0xa0d6('0x7d'),_0x393595[_0xa0d6('0x61')][_0xa0d6('0x3b')]);_0x331160[_0xa0d6('0x2a')]['channel']=_0x2b49d9['channel'];_0x331160['message']['motionChannel']=_0x2b49d9[_0xa0d6('0x74')];_0x331160[_0xa0d6('0x2a')]['event']='reject';respondWithRpcPromise(_0xa0d6('0x76'),_0xa0d6('0x76'),{'event':'rejectmessage','message':_0x331160[_0xa0d6('0x2a')]},client9002);return _0x2b49d9;}return null;})[_0xa0d6('0x22')](respondWithResult(_0x3b56d1,null))[_0xa0d6('0x2c')](handleError(_0x3b56d1,null));};exports['status']=function(_0xc817fb,_0xc67fde,_0x46bf9c){if(_0xc817fb[_0xa0d6('0x5a')]['id']){delete _0xc817fb[_0xa0d6('0x5a')]['id'];}var _0x43e13e;return db[_0xa0d6('0x52')]['find']({'where':{'id':_0xc817fb['params']['id']}})['then'](handleEntityNotFound(_0xc67fde,null))[_0xa0d6('0x22')](function(_0x3dae5b){if(_0x3dae5b){_0x43e13e=_0x3dae5b;return db[_0xa0d6('0x7e')][_0xa0d6('0x58')]({'where':{'id':_0x3dae5b[_0xa0d6('0x7f')]}});}})[_0xa0d6('0x22')](handleEntityNotFound(_0xc67fde,null))['then'](function(_0x122bfe){if(_0x122bfe){logger[_0xa0d6('0x80')](_0xa0d6('0x81'),'status',_0xa0d6('0x82'),_0x122bfe[_0xa0d6('0x3f')],util['inspect'](_0xc817fb[_0xa0d6('0x5a')],{'showHidden':![],'depth':null}));switch(_0x122bfe[_0xa0d6('0x3f')]){case _0xa0d6('0x83'):if(_0xc817fb[_0xa0d6('0x5a')][_0xa0d6('0x84')]&&_0xc817fb['body'][_0xa0d6('0x84')]===_0x43e13e['messageId']&&_0xc817fb[_0xa0d6('0x5a')][_0xa0d6('0x85')]&&_0xc817fb['body']['MessageStatus']===_0xa0d6('0x86')){return _0x43e13e[_0xa0d6('0x39')]({'read':!![]});}else{logger[_0xa0d6('0x27')](_0xa0d6('0x87'),'status','twilio',util[_0xa0d6('0x88')](_0xc817fb[_0xa0d6('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x43e13e;}})['then'](respondWithResult(_0xc67fde,null))[_0xa0d6('0x2c')](handleError(_0xc67fde,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index d4f041a..f495818 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 _0x0427=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','WhatsappMessage'];(function(_0x7d090d,_0x5934a1){var _0x55665b=function(_0x4b8f35){while(--_0x4b8f35){_0x7d090d['push'](_0x7d090d['shift']());}};_0x55665b(++_0x5934a1);}(_0x0427,0x137));var _0x7042=function(_0x50b66a,_0x47f3f0){_0x50b66a=_0x50b66a-0x0;var _0x31d202=_0x0427[_0x50b66a];return _0x31d202;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require('../../mysqldb')['db'][_0x7042('0x0')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x7042('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7042('0x2'),'afterDestroy':_0x7042('0x3')};function emitEvent(_0xae8bc2){return function(_0x1db1f3,_0xa72963,_0x343a69){WhatsappMessageEvents[_0x7042('0x4')](_0xae8bc2+':'+_0x1db1f3['id'],_0x1db1f3);WhatsappMessageEvents['emit'](_0xae8bc2,_0x1db1f3);_0x343a69(null);};}for(var e in events){if(events[_0x7042('0x5')](e)){var event=events[e];WhatsappMessage[_0x7042('0x6')](e,emitEvent(event));}}module[_0x7042('0x7')]=WhatsappMessageEvents; \ No newline at end of file +var _0x7072=['save','update','emit','hasOwnProperty','hook','exports','../../mysqldb','WhatsappMessage','setMaxListeners'];(function(_0xdb3bd7,_0x2a2cd0){var _0x4c071d=function(_0x1f8a04){while(--_0x1f8a04){_0xdb3bd7['push'](_0xdb3bd7['shift']());}};_0x4c071d(++_0x2a2cd0);}(_0x7072,0x138));var _0x2707=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0x7072[_0x1eda20];return _0x31b953;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x2707('0x0'))['db'][_0x2707('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x2707('0x2')](0x0);var events={'afterCreate':_0x2707('0x3'),'afterUpdate':_0x2707('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5af54f){return function(_0xfdfa7a,_0x5f3c1c,_0xd36287){WhatsappMessageEvents[_0x2707('0x5')](_0x5af54f+':'+_0xfdfa7a['id'],_0xfdfa7a);WhatsappMessageEvents[_0x2707('0x5')](_0x5af54f,_0xfdfa7a);_0xd36287(null);};}for(var e in events){if(events[_0x2707('0x6')](e)){var event=events[e];WhatsappMessage[_0x2707('0x7')](e,emitEvent(event));}}module[_0x2707('0x8')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index f8e8355..0690a19 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 _0x17b6=['phone','accountSid','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','then','sid','inspect','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','utf8mb4','utf8mb4_unicode_ci','lodash','util','request-promise','path','rimraf','./whatsappMessage.attributes','exports','define','messageId','body','FULLTEXT','get','toLowerCase','direction','out','secret','isNil','UserId','WhatsappInteraction','findOne','update','createdAt','catch','WhatsappAccount','find','WhatsappAccountId','type','twilio','authToken'];(function(_0x19eef0,_0x54ec94){var _0x406d5d=function(_0x33916e){while(--_0x33916e){_0x19eef0['push'](_0x19eef0['shift']());}};_0x406d5d(++_0x54ec94);}(_0x17b6,0xf7));var _0x617b=function(_0x299433,_0x490876){_0x299433=_0x299433-0x0;var _0x3b1444=_0x17b6[_0x299433];return _0x3b1444;};'use strict';var _=require(_0x617b('0x0'));var util=require(_0x617b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x617b('0x2'));var fs=require('fs');var path=require(_0x617b('0x3'));var rimraf=require(_0x617b('0x4'));var config=require('../../config/environment');var attributes=require(_0x617b('0x5'));module[_0x617b('0x6')]=function(_0x4a4940,_0x3088f3){return _0x4a4940[_0x617b('0x7')]('WhatsappMessage',attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x617b('0x8'),'fields':[_0x617b('0x8')]},{'name':'fti_whatsapp_messages','fields':[_0x617b('0x9')],'type':_0x617b('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xbd6050,_0x45271c,_0x2bac6d){var _0x460de9=_0x4a4940['models'];var _0x53e6aa=_0xbd6050[_0x617b('0xb')]({'plain':!![]});if(_0x53e6aa['direction'][_0x617b('0xc')]()==='in'||_0x53e6aa[_0x617b('0xd')]['toLowerCase']()===_0x617b('0xe')&&!_0x53e6aa[_0x617b('0xf')]&&!_[_0x617b('0x10')](_0x53e6aa[_0x617b('0x11')])){_0x460de9[_0x617b('0x12')][_0x617b('0x13')]({'where':{'id':_0x53e6aa['WhatsappInteractionId']}})['then'](function(_0x1df79a){if(_0x1df79a){_0x1df79a[_0x617b('0x14')]({'lastMsgAt':_0x53e6aa[_0x617b('0x15')],'lastMsgDirection':_0x53e6aa[_0x617b('0xd')][_0x617b('0xc')]()});}})[_0x617b('0x16')](function(_0xea2332){console['error'](_0xea2332);});}if(_0x53e6aa[_0x617b('0xd')]==='out'&&!_0x53e6aa[_0x617b('0xf')]){var _0x130a90;_0x460de9[_0x617b('0x17')][_0x617b('0x18')]({'where':{'id':_0x53e6aa[_0x617b('0x19')]},'raw':!![]})['then'](function(_0x3549b1){_0x130a90=_0x3549b1;if(_0x130a90&&_0x130a90[_0x617b('0x1a')]){switch(_0x130a90['type']){case _0x617b('0x1b'):var _0x34c7a9=require(_0x617b('0x1b'));if(_0x130a90['accountSid']&&_0x130a90[_0x617b('0x1c')]&&_0x130a90[_0x617b('0x1d')]){var _0x929744=new _0x34c7a9(_0x130a90[_0x617b('0x1e')],_0x130a90[_0x617b('0x1c')]);_0x929744[_0x617b('0x1f')][_0x617b('0x20')]({'body':_0x53e6aa[_0x617b('0x9')],'to':_0x617b('0x21')+_0x53e6aa['phone'],'from':_0x617b('0x21')+_0x130a90[_0x617b('0x1d')],'statusCallback':_0x130a90[_0x617b('0x22')]+_0x617b('0x23')+_0x53e6aa['id']+_0x617b('0x24')+_0x130a90[_0x617b('0x25')]})[_0x617b('0x26')](function(_0x57fdca){if(_0x57fdca[_0x617b('0x27')]){return _0xbd6050[_0x617b('0x14')]({'messageId':_0x57fdca[_0x617b('0x27')]});}})[_0x617b('0x16')](function(_0x2674bc){logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x617b('0x1b'),util[_0x617b('0x28')](_0x2674bc,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x617b('0x29'),_0x617b('0x2a'),_0x617b('0x1b'),_0x617b('0x2b'));}break;}}})['finally'](function(){_0x2bac6d();});}else{_0x2bac6d();}}},'charset':_0x617b('0x2c'),'collate':_0x617b('0x2d')});}; \ No newline at end of file +var _0xe46f=['util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','get','direction','toLowerCase','secret','isNil','WhatsappInteraction','WhatsappInteractionId','then','update','createdAt','error','out','WhatsappAccount','find','type','twilio','authToken','phone','accountSid','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4_unicode_ci'];(function(_0x37a8d8,_0x172e04){var _0x56e093=function(_0x2f7452){while(--_0x2f7452){_0x37a8d8['push'](_0x37a8d8['shift']());}};_0x56e093(++_0x172e04);}(_0xe46f,0x157));var _0xfe46=function(_0xf237f7,_0xb11ac){_0xf237f7=_0xf237f7-0x0;var _0x2c183b=_0xe46f[_0xf237f7];return _0x2c183b;};'use strict';var _=require('lodash');var util=require(_0xfe46('0x0'));var logger=require(_0xfe46('0x1'))(_0xfe46('0x2'));var moment=require(_0xfe46('0x3'));var BPromise=require(_0xfe46('0x4'));var rp=require(_0xfe46('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfe46('0x6'));var attributes=require(_0xfe46('0x7'));module[_0xfe46('0x8')]=function(_0x11803e,_0x752d09){return _0x11803e[_0xfe46('0x9')](_0xfe46('0xa'),attributes,{'tableName':_0xfe46('0xb'),'paranoid':![],'indexes':[{'name':_0xfe46('0xc'),'fields':['messageId']},{'name':_0xfe46('0xd'),'fields':[_0xfe46('0xe')],'type':_0xfe46('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x30e113,_0x325796,_0x3eb9fe){var _0x5fd1a1=_0x11803e['models'];var _0x46ed94=_0x30e113[_0xfe46('0x10')]({'plain':!![]});if(_0x46ed94[_0xfe46('0x11')][_0xfe46('0x12')]()==='in'||_0x46ed94[_0xfe46('0x11')]['toLowerCase']()==='out'&&!_0x46ed94[_0xfe46('0x13')]&&!_[_0xfe46('0x14')](_0x46ed94['UserId'])){_0x5fd1a1[_0xfe46('0x15')]['findOne']({'where':{'id':_0x46ed94[_0xfe46('0x16')]}})[_0xfe46('0x17')](function(_0x4907de){if(_0x4907de){_0x4907de[_0xfe46('0x18')]({'lastMsgAt':_0x46ed94[_0xfe46('0x19')],'lastMsgDirection':_0x46ed94['direction']['toLowerCase']()});}})['catch'](function(_0xef3786){console[_0xfe46('0x1a')](_0xef3786);});}if(_0x46ed94[_0xfe46('0x11')]===_0xfe46('0x1b')&&!_0x46ed94[_0xfe46('0x13')]){var _0x3ede94;_0x5fd1a1[_0xfe46('0x1c')][_0xfe46('0x1d')]({'where':{'id':_0x46ed94['WhatsappAccountId']},'raw':!![]})[_0xfe46('0x17')](function(_0x56786a){_0x3ede94=_0x56786a;if(_0x3ede94&&_0x3ede94[_0xfe46('0x1e')]){switch(_0x3ede94[_0xfe46('0x1e')]){case _0xfe46('0x1f'):var _0x13bcc7=require(_0xfe46('0x1f'));if(_0x3ede94['accountSid']&&_0x3ede94[_0xfe46('0x20')]&&_0x3ede94[_0xfe46('0x21')]){var _0x16135d=new _0x13bcc7(_0x3ede94[_0xfe46('0x22')],_0x3ede94[_0xfe46('0x20')]);_0x16135d['messages'][_0xfe46('0x23')]({'body':_0x46ed94['body'],'to':_0xfe46('0x24')+_0x46ed94[_0xfe46('0x21')],'from':_0xfe46('0x24')+_0x3ede94[_0xfe46('0x21')],'statusCallback':_0x3ede94[_0xfe46('0x25')]+_0xfe46('0x26')+_0x46ed94['id']+_0xfe46('0x27')+_0x3ede94[_0xfe46('0x28')]})[_0xfe46('0x17')](function(_0x447c81){if(_0x447c81[_0xfe46('0x29')]){return _0x30e113[_0xfe46('0x18')]({'messageId':_0x447c81['sid']});}})[_0xfe46('0x2a')](function(_0xb68081){logger[_0xfe46('0x1a')](_0xfe46('0x2b'),_0xfe46('0x2c'),'twilio',util[_0xfe46('0x2d')](_0xb68081,{'showHidden':![],'depth':null}));});}else{logger[_0xfe46('0x1a')](_0xfe46('0x2b'),_0xfe46('0x2c'),_0xfe46('0x1f'),_0xfe46('0x2e'));}break;}}})[_0xfe46('0x2f')](function(){_0x3eb9fe();});}else{_0x3eb9fe();}}},'charset':'utf8mb4','collate':_0xfe46('0x30')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 1df08c6..594afa4 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 _0xe55b=['WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreateWhatsappMessage','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','info'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xe55b,0x15f));var _0xbe55=function(_0x4fb6b6,_0x5eb1c7){_0x4fb6b6=_0x4fb6b6-0x0;var _0x3ea470=_0xe55b[_0x4fb6b6];return _0x3ea470;};'use strict';var _=require(_0xbe55('0x0'));var util=require(_0xbe55('0x1'));var moment=require(_0xbe55('0x2'));var BPromise=require(_0xbe55('0x3'));var rs=require(_0xbe55('0x4'));var fs=require('fs');var Redis=require(_0xbe55('0x5'));var db=require(_0xbe55('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xbe55('0x7'))(_0xbe55('0x8'));var config=require(_0xbe55('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xbe55('0xa')][_0xbe55('0xb')]({'port':0x232a});config[_0xbe55('0xc')]=_[_0xbe55('0xd')](config[_0xbe55('0xc')],{'host':_0xbe55('0xe'),'port':0x18eb});var socket=require(_0xbe55('0xf'))(new Redis(config[_0xbe55('0xc')]));require(_0xbe55('0x10'))[_0xbe55('0x11')](socket);function respondWithRpcPromise(_0x4c7f76,_0x5e2542,_0x527737){return new BPromise(function(_0x1ac384,_0x2de826){return client[_0xbe55('0x12')](_0x4c7f76,_0x527737)[_0xbe55('0x13')](function(_0x10166e){logger[_0xbe55('0x14')](_0xbe55('0x15'),_0x5e2542,_0xbe55('0x16'));logger[_0xbe55('0x17')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x5e2542,_0xbe55('0x16'),JSON[_0xbe55('0x18')](_0x10166e));if(_0x10166e['error']){if(_0x10166e[_0xbe55('0x19')][_0xbe55('0x1a')]===0x1f4){logger[_0xbe55('0x19')](_0xbe55('0x15'),_0x5e2542,_0x10166e[_0xbe55('0x19')][_0xbe55('0x1b')]);return _0x2de826(_0x10166e[_0xbe55('0x19')][_0xbe55('0x1b')]);}logger[_0xbe55('0x19')](_0xbe55('0x15'),_0x5e2542,_0x10166e[_0xbe55('0x19')][_0xbe55('0x1b')]);return _0x1ac384(_0x10166e[_0xbe55('0x19')]['message']);}else{logger[_0xbe55('0x14')](_0xbe55('0x15'),_0x5e2542,_0xbe55('0x16'));_0x1ac384(_0x10166e['result']['message']);}})[_0xbe55('0x1c')](function(_0x15b8e0){logger['error'](_0xbe55('0x15'),_0x5e2542,_0x15b8e0);_0x2de826(_0x15b8e0);});});}exports[_0xbe55('0x1d')]=function(_0x110102){var _0x5d9035=this;return new Promise(function(_0x8b277f,_0x1ee997){return db['WhatsappMessage']['create'](_0x110102['body'],{'raw':_0x110102[_0xbe55('0x1e')]?_0x110102['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4ed791){logger['info']('CreateWhatsappMessage',_0x110102);logger[_0xbe55('0x17')](_0xbe55('0x1d'),_0x110102,JSON['stringify'](_0x4ed791));_0x8b277f(_0x4ed791);})[_0xbe55('0x1c')](function(_0x5c1312){logger['error'](_0xbe55('0x1d'),_0x5c1312[_0xbe55('0x1b')],_0x110102);_0x1ee997(_0x5d9035[_0xbe55('0x19')](0x1f4,_0x5c1312[_0xbe55('0x1b')]));});});}; \ No newline at end of file +var _0x5d67=['error','code','message','result','catch','CreateWhatsappMessage','body','options','raw','then','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x5ddb5f,_0x62dc79){var _0x5b6825=function(_0x402d34){while(--_0x402d34){_0x5ddb5f['push'](_0x5ddb5f['shift']());}};_0x5b6825(++_0x62dc79);}(_0x5d67,0x15f));var _0x75d6=function(_0x3fbd66,_0x26be2f){_0x3fbd66=_0x3fbd66-0x0;var _0x78d3d9=_0x5d67[_0x3fbd66];return _0x78d3d9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x75d6('0x0'));var BPromise=require(_0x75d6('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x75d6('0x2'));var db=require(_0x75d6('0x3'))['db'];var utils=require(_0x75d6('0x4'));var logger=require(_0x75d6('0x5'))(_0x75d6('0x6'));var config=require(_0x75d6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x75d6('0x8')][_0x75d6('0x9')]({'port':0x232a});config[_0x75d6('0xa')]=_[_0x75d6('0xb')](config['redis'],{'host':_0x75d6('0xc'),'port':0x18eb});var socket=require(_0x75d6('0xd'))(new Redis(config[_0x75d6('0xa')]));require(_0x75d6('0xe'))[_0x75d6('0xf')](socket);function respondWithRpcPromise(_0x1a57d3,_0xbaad2f,_0x3883bf){return new BPromise(function(_0x4b7e01,_0x2b4b51){return client['request'](_0x1a57d3,_0x3883bf)['then'](function(_0x15e191){logger[_0x75d6('0x10')](_0x75d6('0x11'),_0xbaad2f,_0x75d6('0x12'));logger[_0x75d6('0x13')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xbaad2f,_0x75d6('0x12'),JSON[_0x75d6('0x14')](_0x15e191));if(_0x15e191[_0x75d6('0x15')]){if(_0x15e191['error'][_0x75d6('0x16')]===0x1f4){logger[_0x75d6('0x15')](_0x75d6('0x11'),_0xbaad2f,_0x15e191[_0x75d6('0x15')]['message']);return _0x2b4b51(_0x15e191[_0x75d6('0x15')][_0x75d6('0x17')]);}logger[_0x75d6('0x15')](_0x75d6('0x11'),_0xbaad2f,_0x15e191['error'][_0x75d6('0x17')]);return _0x4b7e01(_0x15e191['error'][_0x75d6('0x17')]);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0xbaad2f,_0x75d6('0x12'));_0x4b7e01(_0x15e191[_0x75d6('0x18')]['message']);}})[_0x75d6('0x19')](function(_0x2b44bf){logger[_0x75d6('0x15')](_0x75d6('0x11'),_0xbaad2f,_0x2b44bf);_0x2b4b51(_0x2b44bf);});});}exports[_0x75d6('0x1a')]=function(_0x3c7570){var _0x4bd929=this;return new Promise(function(_0x316d72,_0xac41c8){return db['WhatsappMessage']['create'](_0x3c7570[_0x75d6('0x1b')],{'raw':_0x3c7570[_0x75d6('0x1c')]?_0x3c7570[_0x75d6('0x1c')][_0x75d6('0x1d')]===undefined?!![]:![]:!![]})[_0x75d6('0x1e')](function(_0x5d7dc4){logger[_0x75d6('0x10')](_0x75d6('0x1a'),_0x3c7570);logger[_0x75d6('0x13')](_0x75d6('0x1a'),_0x3c7570,JSON['stringify'](_0x5d7dc4));_0x316d72(_0x5d7dc4);})[_0x75d6('0x19')](function(_0x560a9c){logger[_0x75d6('0x15')](_0x75d6('0x1a'),_0x560a9c[_0x75d6('0x17')],_0x3c7570);_0xac41c8(_0x4bd929[_0x75d6('0x15')](0x1f4,_0x560a9c[_0x75d6('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 8f460fa..fbd53f1 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 _0xd598=['save','remove','update','emit','removeListener','length','whatsappMessage:','./whatsappMessage.events'];(function(_0x120e0f,_0x323b9e){var _0x5ed585=function(_0xe33ef4){while(--_0xe33ef4){_0x120e0f['push'](_0x120e0f['shift']());}};_0x5ed585(++_0x323b9e);}(_0xd598,0x1a7));var _0x8d59=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xd598[_0x2dafbe];return _0x58a45a;};'use strict';var WhatsappMessageEvents=require(_0x8d59('0x0'));var events=[_0x8d59('0x1'),_0x8d59('0x2'),_0x8d59('0x3')];function createListener(_0x4d89da,_0x955142){return function(_0x38da20){_0x955142[_0x8d59('0x4')](_0x4d89da,_0x38da20);};}function removeListener(_0x4ad213,_0x4fa0c4){return function(){WhatsappMessageEvents[_0x8d59('0x5')](_0x4ad213,_0x4fa0c4);};}exports['register']=function(_0x573f83){for(var _0x136f73=0x0,_0x10fef6=events[_0x8d59('0x6')];_0x136f73<_0x10fef6;_0x136f73++){var _0x3eaecc=events[_0x136f73];var _0x1f0331=createListener(_0x8d59('0x7')+_0x3eaecc,_0x573f83);WhatsappMessageEvents['on'](_0x3eaecc,_0x1f0331);}}; \ No newline at end of file +var _0xefb8=['register','length','whatsappMessage:','remove','emit','removeListener'];(function(_0x5756c6,_0x58290a){var _0x4b5806=function(_0x193246){while(--_0x193246){_0x5756c6['push'](_0x5756c6['shift']());}};_0x4b5806(++_0x58290a);}(_0xefb8,0xf3));var _0x8efb=function(_0x2e20a8,_0x341bf4){_0x2e20a8=_0x2e20a8-0x0;var _0x48df32=_0xefb8[_0x2e20a8];return _0x48df32;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=['save',_0x8efb('0x0'),'update'];function createListener(_0x90bfd,_0x7dea6b){return function(_0x424df0){_0x7dea6b[_0x8efb('0x1')](_0x90bfd,_0x424df0);};}function removeListener(_0x1d2bf5,_0x658655){return function(){WhatsappMessageEvents[_0x8efb('0x2')](_0x1d2bf5,_0x658655);};}exports[_0x8efb('0x3')]=function(_0x1cb869){for(var _0x331c23=0x0,_0x29ac69=events[_0x8efb('0x4')];_0x331c23<_0x29ac69;_0x331c23++){var _0x3a80f3=events[_0x331c23];var _0x58a3b4=createListener(_0x8efb('0x5')+_0x3a80f3,_0x1cb869);WhatsappMessageEvents['on'](_0x3a80f3,_0x58a3b4);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 5f6e79e..73b0119 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 _0x14da=['Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','delete','destroy','removeTeams','exports','multer','util','path','express'];(function(_0x580d0e,_0x1e5f43){var _0xb51111=function(_0x4718e7){while(--_0x4718e7){_0x580d0e['push'](_0x580d0e['shift']());}};_0xb51111(++_0x1e5f43);}(_0x14da,0x6c));var _0xa14d=function(_0x2ddfd9,_0x5877d0){_0x2ddfd9=_0x2ddfd9-0x0;var _0x2668f0=_0x14da[_0x2ddfd9];return _0x2668f0;};'use strict';var multer=require(_0xa14d('0x0'));var util=require(_0xa14d('0x1'));var path=require(_0xa14d('0x2'));var timeout=require('connect-timeout');var express=require(_0xa14d('0x3'));var router=express[_0xa14d('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa14d('0x5'));var config=require(_0xa14d('0x6'));var controller=require('./whatsappQueue.controller');router[_0xa14d('0x7')]('/',auth[_0xa14d('0x8')](),controller[_0xa14d('0x9')]);router['get'](_0xa14d('0xa'),auth[_0xa14d('0x8')](),controller[_0xa14d('0xb')]);router['get'](_0xa14d('0xc'),auth[_0xa14d('0x8')](),controller[_0xa14d('0xd')]);router['get'](_0xa14d('0xe'),auth[_0xa14d('0x8')](),controller[_0xa14d('0xf')]);router[_0xa14d('0x7')]('/:id/teams',auth[_0xa14d('0x8')](),controller[_0xa14d('0x10')]);router['get'](_0xa14d('0x11'),auth[_0xa14d('0x8')](),controller[_0xa14d('0x12')]);router[_0xa14d('0x13')]('/',auth['isAuthenticated'](),controller[_0xa14d('0x14')]);router[_0xa14d('0x13')]('/:id/teams',auth[_0xa14d('0x8')](),controller[_0xa14d('0x15')]);router[_0xa14d('0x13')](_0xa14d('0x11'),auth[_0xa14d('0x8')](),controller[_0xa14d('0x16')]);router[_0xa14d('0x17')](_0xa14d('0xc'),auth[_0xa14d('0x8')](),controller['update']);router[_0xa14d('0x18')](_0xa14d('0xc'),auth[_0xa14d('0x8')](),controller[_0xa14d('0x19')]);router[_0xa14d('0x18')]('/:id/teams',auth[_0xa14d('0x8')](),controller[_0xa14d('0x1a')]);router[_0xa14d('0x18')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xa14d('0x1b')]=router; \ No newline at end of file +var _0xeed4=['multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','delete','removeTeams','exports'];(function(_0x58db4e,_0x439d8d){var _0x40139a=function(_0x34cae4){while(--_0x34cae4){_0x58db4e['push'](_0x58db4e['shift']());}};_0x40139a(++_0x439d8d);}(_0xeed4,0x1cb));var _0x4eed=function(_0x169d7f,_0x129afd){_0x169d7f=_0x169d7f-0x0;var _0x28e8c=_0xeed4[_0x169d7f];return _0x28e8c;};'use strict';var multer=require(_0x4eed('0x0'));var util=require('util');var path=require(_0x4eed('0x1'));var timeout=require(_0x4eed('0x2'));var express=require(_0x4eed('0x3'));var router=express[_0x4eed('0x4')]();var fs_extra=require(_0x4eed('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4eed('0x6'));var config=require(_0x4eed('0x7'));var controller=require(_0x4eed('0x8'));router[_0x4eed('0x9')]('/',auth[_0x4eed('0xa')](),controller[_0x4eed('0xb')]);router[_0x4eed('0x9')](_0x4eed('0xc'),auth[_0x4eed('0xa')](),controller[_0x4eed('0xd')]);router[_0x4eed('0x9')](_0x4eed('0xe'),auth['isAuthenticated'](),controller[_0x4eed('0xf')]);router[_0x4eed('0x9')]('/:id/members',auth[_0x4eed('0xa')](),controller['getMembers']);router[_0x4eed('0x9')](_0x4eed('0x10'),auth['isAuthenticated'](),controller[_0x4eed('0x11')]);router[_0x4eed('0x9')](_0x4eed('0x12'),auth['isAuthenticated'](),controller[_0x4eed('0x13')]);router[_0x4eed('0x14')]('/',auth[_0x4eed('0xa')](),controller['create']);router[_0x4eed('0x14')](_0x4eed('0x10'),auth['isAuthenticated'](),controller[_0x4eed('0x15')]);router[_0x4eed('0x14')](_0x4eed('0x12'),auth[_0x4eed('0xa')](),controller[_0x4eed('0x16')]);router[_0x4eed('0x17')](_0x4eed('0xe'),auth[_0x4eed('0xa')](),controller['update']);router[_0x4eed('0x18')]('/:id',auth[_0x4eed('0xa')](),controller['destroy']);router[_0x4eed('0x18')](_0x4eed('0x10'),auth[_0x4eed('0xa')](),controller[_0x4eed('0x19')]);router[_0x4eed('0x18')](_0x4eed('0x12'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x4eed('0x1a')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index b0a9fef..a6cea43 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 _0xf9f7=['exports','STRING','name','INTEGER','ENUM','roundrobin','sequelize'];(function(_0x5aef2f,_0x2c25db){var _0x30313d=function(_0x1d970b){while(--_0x1d970b){_0x5aef2f['push'](_0x5aef2f['shift']());}};_0x30313d(++_0x2c25db);}(_0xf9f7,0xdf));var _0x7f9f=function(_0x3797d9,_0x1ce1c7){_0x3797d9=_0x3797d9-0x0;var _0x2d1c0d=_0xf9f7[_0x3797d9];return _0x2d1c0d;};'use strict';var Sequelize=require(_0x7f9f('0x0'));module[_0x7f9f('0x1')]={'name':{'type':Sequelize[_0x7f9f('0x2')],'unique':_0x7f9f('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x7f9f('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7f9f('0x5')]('rrmemory','beepall',_0x7f9f('0x6'))},'description':{'type':Sequelize[_0x7f9f('0x2')]}}; \ No newline at end of file +var _0xf290=['ENUM','rrmemory','beepall','roundrobin','STRING','exports','name'];(function(_0x1e5f76,_0x288ae4){var _0x452f4e=function(_0x3e6643){while(--_0x3e6643){_0x1e5f76['push'](_0x1e5f76['shift']());}};_0x452f4e(++_0x288ae4);}(_0xf290,0xde));var _0x0f29=function(_0x270adf,_0x1daaa3){_0x270adf=_0x270adf-0x0;var _0x29eda9=_0xf290[_0x270adf];return _0x29eda9;};'use strict';var Sequelize=require('sequelize');module[_0x0f29('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x0f29('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0f29('0x2')](_0x0f29('0x3'),_0x0f29('0x4'),_0x0f29('0x5'))},'description':{'type':Sequelize[_0x0f29('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index be64ab4..d7b5e8d 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 _0xa181=['Team','addTeams','Agents','online','voicePause','flatMap','sequelize','transaction','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','ids','isEmpty','removeAgents','addAgents','omit','userWhatsappQueue:remove','getAgents','findOne','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','then','WhatsappQueues','UserProfileResource','destroy','error','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','rows','catch','show','params','include','find','create','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','getMembers','UserWhatsappQueue','order','findAll','User','findAndCountAll','UserId','agent','whatsappPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams'];(function(_0x2cc386,_0x105121){var _0x731ae4=function(_0x35cfad){while(--_0x35cfad){_0x2cc386['push'](_0x2cc386['shift']());}};_0x731ae4(++_0x105121);}(_0xa181,0x14f));var _0x1a18=function(_0x4ddaa6,_0x3370a6){_0x4ddaa6=_0x4ddaa6-0x0;var _0x598359=_0xa181[_0x4ddaa6];return _0x598359;};'use strict';var emlformat=require(_0x1a18('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1a18('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1a18('0x2'));var moment=require('moment');var BPromise=require(_0x1a18('0x3'));var Mustache=require(_0x1a18('0x4'));var util=require(_0x1a18('0x5'));var path=require(_0x1a18('0x6'));var sox=require(_0x1a18('0x7'));var csv=require('to-csv');var ejs=require(_0x1a18('0x8'));var fs=require('fs');var fs_extra=require(_0x1a18('0x9'));var _=require(_0x1a18('0xa'));var squel=require(_0x1a18('0xb'));var crypto=require(_0x1a18('0xc'));var jsforce=require(_0x1a18('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1a18('0xe'));var querystring=require(_0x1a18('0xf'));var Papa=require(_0x1a18('0x10'));var Redis=require(_0x1a18('0x11'));var authService=require(_0x1a18('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1a18('0x13'));var hardwareService=require(_0x1a18('0x14'));var logger=require(_0x1a18('0x15'))('api');var utils=require(_0x1a18('0x16'));var config=require(_0x1a18('0x17'));var licenseUtil=require(_0x1a18('0x18'));var db=require(_0x1a18('0x19'))['db'];config[_0x1a18('0x1a')]=_[_0x1a18('0x1b')](config[_0x1a18('0x1a')],{'host':_0x1a18('0x1c'),'port':0x18eb});var socket=require(_0x1a18('0x1d'))(new Redis(config[_0x1a18('0x1a')]));require(_0x1a18('0x1e'))[_0x1a18('0x1f')](socket);function respondWithStatusCode(_0x475360,_0x32a1b2){_0x32a1b2=_0x32a1b2||0xcc;return function(_0x3b29de){if(_0x3b29de){return _0x475360[_0x1a18('0x20')](_0x32a1b2);}return _0x475360[_0x1a18('0x21')](_0x32a1b2)[_0x1a18('0x22')]();};}function respondWithResult(_0x3b44de,_0x5d78ec){_0x5d78ec=_0x5d78ec||0xc8;return function(_0x11c193){if(_0x11c193){return _0x3b44de[_0x1a18('0x21')](_0x5d78ec)[_0x1a18('0x23')](_0x11c193);}};}function respondWithFilteredResult(_0x225159,_0x4166ea){return function(_0x33dcf2){if(_0x33dcf2){var _0xf98b08=typeof _0x4166ea[_0x1a18('0x24')]===_0x1a18('0x25')&&typeof _0x4166ea['limit']===_0x1a18('0x25');var _0x5deb2e=_0x33dcf2[_0x1a18('0x26')];var _0x4b0986=_0xf98b08?0x0:_0x4166ea[_0x1a18('0x24')];var _0x1e8fab=_0xf98b08?_0x33dcf2[_0x1a18('0x26')]:_0x4166ea[_0x1a18('0x24')]+_0x4166ea[_0x1a18('0x27')];var _0x241df4;if(_0x1e8fab>=_0x5deb2e){_0x1e8fab=_0x5deb2e;_0x241df4=0xc8;}else{_0x241df4=0xce;}_0x225159[_0x1a18('0x21')](_0x241df4);return _0x225159[_0x1a18('0x28')]('Content-Range',_0x4b0986+'-'+_0x1e8fab+'/'+_0x5deb2e)['json'](_0x33dcf2);}return null;};}function patchUpdates(_0x1c4d9a){return function(_0x50834b){try{jsonpatch[_0x1a18('0x29')](_0x50834b,_0x1c4d9a,!![]);}catch(_0x2122fe){return BPromise[_0x1a18('0x2a')](_0x2122fe);}return _0x50834b[_0x1a18('0x2b')]();};}function saveUpdates(_0x4d42a9,_0x47bbe4){return function(_0x5602ba){if(_0x5602ba){return _0x5602ba['update'](_0x4d42a9)[_0x1a18('0x2c')](function(_0x5aa5ca){return _0x5aa5ca;});}return null;};}function removeEntity(_0x159266,_0x791c0c){return function(_0x3da051){if(_0x3da051){return _0x3da051['destroy']()[_0x1a18('0x2c')](function(){var _0x3b3bd9=_0x3da051['get']({'plain':!![]});var _0x24b41e=_0x1a18('0x2d');return db[_0x1a18('0x2e')][_0x1a18('0x2f')]({'where':{'type':_0x24b41e,'resourceId':_0x3b3bd9['id']}})[_0x1a18('0x2c')](function(){return _0x3da051;});})[_0x1a18('0x2c')](function(){_0x159266['status'](0xcc)[_0x1a18('0x22')]();});}};}function handleEntityNotFound(_0x552820,_0x1f25a6){return function(_0x504ae6){if(!_0x504ae6){_0x552820[_0x1a18('0x20')](0x194);}return _0x504ae6;};}function handleError(_0x1704bc,_0xf3ad28){_0xf3ad28=_0xf3ad28||0x1f4;return function(_0x4b7c72){logger[_0x1a18('0x30')](_0x4b7c72[_0x1a18('0x31')]);if(_0x4b7c72[_0x1a18('0x32')]){delete _0x4b7c72[_0x1a18('0x32')];}_0x1704bc['status'](_0xf3ad28)[_0x1a18('0x33')](_0x4b7c72);};}exports[_0x1a18('0x34')]=function(_0x13bbf6,_0x3da682){var _0x2dbca5={},_0x273a59={},_0x123c40={'count':0x0,'rows':[]};var _0x168ce6=_[_0x1a18('0x35')](db[_0x1a18('0x36')][_0x1a18('0x37')],function(_0x4da39b){return{'name':_0x4da39b[_0x1a18('0x38')],'type':_0x4da39b['type'][_0x1a18('0x39')]};});_0x273a59['model']=_['map'](_0x168ce6,_0x1a18('0x32'));_0x273a59[_0x1a18('0x3a')]=_[_0x1a18('0x3b')](_0x13bbf6['query']);_0x273a59[_0x1a18('0x3c')]=_[_0x1a18('0x3d')](_0x273a59[_0x1a18('0x3e')],_0x273a59[_0x1a18('0x3a')]);_0x2dbca5['attributes']=_['intersection'](_0x273a59[_0x1a18('0x3e')],qs[_0x1a18('0x3f')](_0x13bbf6[_0x1a18('0x3a')][_0x1a18('0x3f')]));_0x2dbca5['attributes']=_0x2dbca5[_0x1a18('0x40')][_0x1a18('0x41')]?_0x2dbca5[_0x1a18('0x40')]:_0x273a59[_0x1a18('0x3e')];if(!_0x13bbf6['query'][_0x1a18('0x42')](_0x1a18('0x43'))){_0x2dbca5['limit']=qs[_0x1a18('0x27')](_0x13bbf6[_0x1a18('0x3a')][_0x1a18('0x27')]);_0x2dbca5[_0x1a18('0x24')]=qs[_0x1a18('0x24')](_0x13bbf6[_0x1a18('0x3a')]['offset']);}_0x2dbca5['order']=qs[_0x1a18('0x44')](_0x13bbf6[_0x1a18('0x3a')]['sort']);_0x2dbca5[_0x1a18('0x45')]=qs['filters'](_[_0x1a18('0x46')](_0x13bbf6[_0x1a18('0x3a')],_0x273a59[_0x1a18('0x3c')]),_0x168ce6);if(_0x13bbf6[_0x1a18('0x3a')][_0x1a18('0x47')]){_0x2dbca5[_0x1a18('0x45')]=_[_0x1a18('0x48')](_0x2dbca5[_0x1a18('0x45')],{'$or':_[_0x1a18('0x35')](_0x168ce6,function(_0x4db333){if(_0x4db333[_0x1a18('0x49')]!==_0x1a18('0x4a')){var _0x12cdc2={};_0x12cdc2[_0x4db333[_0x1a18('0x32')]]={'$like':'%'+_0x13bbf6[_0x1a18('0x3a')]['filter']+'%'};return _0x12cdc2;}})});}_0x2dbca5=_[_0x1a18('0x48')]({},_0x2dbca5,_0x13bbf6[_0x1a18('0x4b')]);var _0x1f32fa={'where':_0x2dbca5['where']};return db[_0x1a18('0x36')][_0x1a18('0x26')](_0x1f32fa)['then'](function(_0x503908){_0x123c40[_0x1a18('0x26')]=_0x503908;if(_0x13bbf6[_0x1a18('0x3a')][_0x1a18('0x4c')]){_0x2dbca5['include']=[{'all':!![]}];}return db[_0x1a18('0x36')]['findAll'](_0x2dbca5);})[_0x1a18('0x2c')](function(_0x3d08c2){_0x123c40[_0x1a18('0x4d')]=_0x3d08c2;return _0x123c40;})[_0x1a18('0x2c')](respondWithFilteredResult(_0x3da682,_0x2dbca5))[_0x1a18('0x4e')](handleError(_0x3da682,null));};exports[_0x1a18('0x4f')]=function(_0x2aac12,_0x4b6c24){var _0x13182e={'raw':!![],'where':{'id':_0x2aac12[_0x1a18('0x50')]['id']}},_0x1c584e={};_0x1c584e[_0x1a18('0x3e')]=_['keys'](db[_0x1a18('0x36')][_0x1a18('0x37')]);_0x1c584e['query']=_[_0x1a18('0x3b')](_0x2aac12[_0x1a18('0x3a')]);_0x1c584e['filters']=_['intersection'](_0x1c584e[_0x1a18('0x3e')],_0x1c584e[_0x1a18('0x3a')]);_0x13182e['attributes']=_[_0x1a18('0x3d')](_0x1c584e['model'],qs[_0x1a18('0x3f')](_0x2aac12['query'][_0x1a18('0x3f')]));_0x13182e[_0x1a18('0x40')]=_0x13182e[_0x1a18('0x40')]['length']?_0x13182e[_0x1a18('0x40')]:_0x1c584e['model'];if(_0x2aac12[_0x1a18('0x3a')][_0x1a18('0x4c')]){_0x13182e[_0x1a18('0x51')]=[{'all':!![]}];}_0x13182e=_[_0x1a18('0x48')]({},_0x13182e,_0x2aac12['options']);return db[_0x1a18('0x36')][_0x1a18('0x52')](_0x13182e)[_0x1a18('0x2c')](handleEntityNotFound(_0x4b6c24,null))[_0x1a18('0x2c')](respondWithResult(_0x4b6c24,null))[_0x1a18('0x4e')](handleError(_0x4b6c24,null));};exports['create']=function(_0x50c637,_0x563e78){return db[_0x1a18('0x36')][_0x1a18('0x53')](_0x50c637['body'],{})['then'](function(_0x270afd){var _0x1f1c73=_0x50c637[_0x1a18('0x54')][_0x1a18('0x55')]({'plain':!![]});if(!_0x1f1c73)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1f1c73[_0x1a18('0x56')]===_0x1a18('0x54')){var _0x1a35d7=_0x270afd[_0x1a18('0x55')]({'plain':!![]});var _0x1dd9b8='WhatsappQueues';return db[_0x1a18('0x57')][_0x1a18('0x52')]({'where':{'name':_0x1dd9b8,'userProfileId':_0x1f1c73[_0x1a18('0x58')]},'raw':!![]})[_0x1a18('0x2c')](function(_0x5ca0a1){if(_0x5ca0a1&&_0x5ca0a1[_0x1a18('0x59')]===0x0){return db[_0x1a18('0x2e')][_0x1a18('0x53')]({'name':_0x1a35d7[_0x1a18('0x32')],'resourceId':_0x1a35d7['id'],'type':_0x5ca0a1[_0x1a18('0x32')],'sectionId':_0x5ca0a1['id']},{})['then'](function(){return _0x270afd;});}else{return _0x270afd;}})['catch'](function(_0x3ba625){logger[_0x1a18('0x30')](_0x1a18('0x5a'),_0x3ba625);throw _0x3ba625;});}return _0x270afd;})[_0x1a18('0x2c')](respondWithResult(_0x563e78,0xc9))[_0x1a18('0x4e')](handleError(_0x563e78,null));};exports[_0x1a18('0x5b')]=function(_0x166e9c,_0x4db558){if(_0x166e9c[_0x1a18('0x5c')]['id']){delete _0x166e9c[_0x1a18('0x5c')]['id'];}return db[_0x1a18('0x36')]['find']({'where':{'id':_0x166e9c[_0x1a18('0x50')]['id']}})[_0x1a18('0x2c')](handleEntityNotFound(_0x4db558,null))[_0x1a18('0x2c')](saveUpdates(_0x166e9c[_0x1a18('0x5c')],null))[_0x1a18('0x2c')](respondWithResult(_0x4db558,null))['catch'](handleError(_0x4db558,null));};exports[_0x1a18('0x2f')]=function(_0x529587,_0x5b0d6e){return db['WhatsappQueue'][_0x1a18('0x52')]({'where':{'id':_0x529587[_0x1a18('0x50')]['id']}})[_0x1a18('0x2c')](handleEntityNotFound(_0x5b0d6e,null))['then'](removeEntity(_0x5b0d6e,null))[_0x1a18('0x4e')](handleError(_0x5b0d6e,null));};exports[_0x1a18('0x5d')]=function(_0x4203fd,_0x34b11b){return db['WhatsappQueue'][_0x1a18('0x5d')]()[_0x1a18('0x2c')](respondWithResult(_0x34b11b,null))['catch'](handleError(_0x34b11b,null));};exports[_0x1a18('0x5e')]=function(_0x48a9b3,_0x5762b9,_0x49c0d2){var _0x496843={'raw':!![],'where':{}},_0x28e70c={},_0x224ea2;return db[_0x1a18('0x36')]['findOne']({'where':{'id':_0x48a9b3['params']['id']}})[_0x1a18('0x2c')](handleEntityNotFound(_0x5762b9,null))['then'](function(_0x3d7c5c){if(_0x3d7c5c){_0x224ea2=_0x3d7c5c[_0x1a18('0x55')]({'plain':!![]});_0x28e70c['model']=_[_0x1a18('0x3b')](db[_0x1a18('0x5f')][_0x1a18('0x37')]);_0x28e70c[_0x1a18('0x3a')]=_['keys'](_0x48a9b3[_0x1a18('0x3a')]);_0x28e70c[_0x1a18('0x3c')]=_[_0x1a18('0x3d')](_0x28e70c[_0x1a18('0x3e')],_0x28e70c[_0x1a18('0x3a')]);_0x496843[_0x1a18('0x40')]=_[_0x1a18('0x3d')](_0x28e70c[_0x1a18('0x3e')],qs['fields'](_0x48a9b3[_0x1a18('0x3a')][_0x1a18('0x3f')]));_0x496843[_0x1a18('0x40')]=_0x496843[_0x1a18('0x40')][_0x1a18('0x41')]?_0x496843[_0x1a18('0x40')]:_0x28e70c[_0x1a18('0x3e')];if(!_0x48a9b3['query'][_0x1a18('0x42')](_0x1a18('0x43'))){_0x496843[_0x1a18('0x27')]=qs[_0x1a18('0x27')](_0x48a9b3['query'][_0x1a18('0x27')]);_0x496843[_0x1a18('0x24')]=qs[_0x1a18('0x24')](_0x48a9b3['query'][_0x1a18('0x24')]);}_0x496843[_0x1a18('0x60')]=qs[_0x1a18('0x44')](_0x48a9b3['query']['sort']);_0x496843[_0x1a18('0x45')]=qs[_0x1a18('0x3c')](_[_0x1a18('0x46')](_0x48a9b3[_0x1a18('0x3a')],_0x28e70c[_0x1a18('0x3c')]));_0x496843[_0x1a18('0x45')]['WhatsappQueueId']=_0x3d7c5c['id'];if(_0x48a9b3['query'][_0x1a18('0x47')]){_0x496843[_0x1a18('0x45')]=_[_0x1a18('0x48')](_0x496843[_0x1a18('0x45')],{'$or':_[_0x1a18('0x35')](_0x496843[_0x1a18('0x40')],function(_0x109c26){var _0x1fa8f9={};_0x1fa8f9[_0x109c26]={'$like':'%'+_0x48a9b3[_0x1a18('0x3a')]['filter']+'%'};return _0x1fa8f9;})});}_0x496843=_['merge']({},_0x496843,_0x48a9b3[_0x1a18('0x4b')]);return db['UserWhatsappQueue'][_0x1a18('0x61')](_0x496843);}})[_0x1a18('0x2c')](function(_0x3def6c){if(_0x3def6c){return db[_0x1a18('0x62')][_0x1a18('0x63')]({'where':{'id':_[_0x1a18('0x35')](_0x3def6c,_0x1a18('0x64')),'role':_0x1a18('0x65')},'attributes':['id','name',_0x1a18('0x66'),'updatedAt',_0x1a18('0x67')]});}})['then'](function(_0xb85f98){if(_0xb85f98){return{'count':_0xb85f98[_0x1a18('0x26')],'rows':_[_0x1a18('0x35')](_0xb85f98[_0x1a18('0x4d')],function(_0x451a56){return{'membername':_0x451a56[_0x1a18('0x32')],'UserId':_0x451a56['id'],'queue_name':_0x224ea2[_0x1a18('0x32')],'WhatsappQueueId':_0x224ea2['id'],'interface':util[_0x1a18('0x68')](_0x1a18('0x69'),_0x1a18('0x6a'),_0x451a56[_0x1a18('0x32')]),'penalty':0x0,'paused':_0x451a56[_0x1a18('0x66')],'createdAt':_0x451a56[_0x1a18('0x67')],'updatedAt':_0x451a56[_0x1a18('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1a18('0x2c')](respondWithFilteredResult(_0x5762b9,_0x496843))['catch'](handleError(_0x5762b9,null));};exports[_0x1a18('0x6c')]=function(_0xbe8df3,_0x136c25,_0x42edc4){var _0x1db770={};var _0x4c3949={};var _0x45933c;var _0x5679fb;return db[_0x1a18('0x36')]['findOne']({'where':{'id':_0xbe8df3[_0x1a18('0x50')]['id']}})['then'](handleEntityNotFound(_0x136c25,null))[_0x1a18('0x2c')](function(_0x2fb77c){if(_0x2fb77c){_0x45933c=_0x2fb77c;_0x4c3949[_0x1a18('0x3e')]=_[_0x1a18('0x3b')](db[_0x1a18('0x6d')][_0x1a18('0x37')]);_0x4c3949[_0x1a18('0x3a')]=_[_0x1a18('0x3b')](_0xbe8df3[_0x1a18('0x3a')]);_0x4c3949[_0x1a18('0x3c')]=_[_0x1a18('0x3d')](_0x4c3949[_0x1a18('0x3e')],_0x4c3949[_0x1a18('0x3a')]);_0x1db770[_0x1a18('0x40')]=_['intersection'](_0x4c3949[_0x1a18('0x3e')],qs[_0x1a18('0x3f')](_0xbe8df3[_0x1a18('0x3a')][_0x1a18('0x3f')]));_0x1db770[_0x1a18('0x40')]=_0x1db770[_0x1a18('0x40')][_0x1a18('0x41')]?_0x1db770['attributes']:_0x4c3949[_0x1a18('0x3e')];_0x1db770['order']=qs[_0x1a18('0x44')](_0xbe8df3[_0x1a18('0x3a')]['sort']);_0x1db770[_0x1a18('0x45')]=qs['filters'](_['pick'](_0xbe8df3[_0x1a18('0x3a')],_0x4c3949[_0x1a18('0x3c')]));if(_0xbe8df3[_0x1a18('0x3a')][_0x1a18('0x47')]){_0x1db770[_0x1a18('0x45')]=_[_0x1a18('0x48')](_0x1db770['where'],{'$or':_[_0x1a18('0x35')](_0x1db770['attributes'],function(_0x558d8b){var _0x11767b={};_0x11767b[_0x558d8b]={'$like':'%'+_0xbe8df3[_0x1a18('0x3a')][_0x1a18('0x47')]+'%'};return _0x11767b;})});}_0x1db770=_[_0x1a18('0x48')]({},_0x1db770,_0xbe8df3[_0x1a18('0x4b')]);return _0x45933c[_0x1a18('0x6c')](_0x1db770);}})[_0x1a18('0x2c')](function(_0x4403ee){if(_0x4403ee){_0x5679fb=_0x4403ee[_0x1a18('0x41')];if(!_0xbe8df3['query']['hasOwnProperty'](_0x1a18('0x43'))){_0x1db770[_0x1a18('0x27')]=qs[_0x1a18('0x27')](_0xbe8df3[_0x1a18('0x3a')][_0x1a18('0x27')]);_0x1db770[_0x1a18('0x24')]=qs['offset'](_0xbe8df3['query'][_0x1a18('0x24')]);}return _0x45933c[_0x1a18('0x6c')](_0x1db770);}})[_0x1a18('0x2c')](function(_0x7be912){if(_0x7be912){return _0x7be912?{'count':_0x5679fb,'rows':_0x7be912}:null;}})[_0x1a18('0x2c')](respondWithResult(_0x136c25,null))['catch'](handleError(_0x136c25,null));};exports[_0x1a18('0x6e')]=function(_0x4ab74c,_0x567d8d,_0x25b1ab){var _0x4ac11a=_0x4ab74c[_0x1a18('0x5c')]['ids'];return db[_0x1a18('0x6d')][_0x1a18('0x61')]({'where':{'id':_0x4ac11a},'attributes':['id'],'include':[{'model':db['User'],'as':_0x1a18('0x6f'),'attributes':['id',_0x1a18('0x32'),_0x1a18('0x70'),_0x1a18('0x71'),'interface'],'raw':!![]}]})['then'](function(_0x30cb74){if(_0x30cb74){var _0x2d4767=_[_0x1a18('0x72')](_0x30cb74,function(_0x304d72){var _0x375bc4=_0x304d72[_0x1a18('0x55')]({'plain':!![]});return _0x375bc4['Agents'];});return db[_0x1a18('0x36')][_0x1a18('0x52')]({'where':{'id':_0x4ab74c[_0x1a18('0x50')]['id']}})[_0x1a18('0x2c')](function(_0x5df70c){return db[_0x1a18('0x73')][_0x1a18('0x74')](function(_0xce0e36){return _0x5df70c[_0x1a18('0x6e')](_0x4ac11a,{'transaction':_0xce0e36})[_0x1a18('0x2c')](function(){return BPromise['each'](_0x2d4767,function(_0x4cc659){return db['UserWhatsappQueue']['findOrCreate']({'where':{'UserId':_0x4cc659['id'],'WhatsappQueueId':_0x4ab74c[_0x1a18('0x50')]['id']},'transaction':_0xce0e36});});})[_0x1a18('0x2c')](function(){_0x2d4767[_0x1a18('0x75')](function(_0x2d3709){socket[_0x1a18('0x76')](_0x1a18('0x77'),{'UserId':_0x2d3709['id'],'WhatsappQueueId':_0x5df70c['id']});});});});});}})['then'](respondWithStatusCode(_0x567d8d,null))[_0x1a18('0x4e')](handleError(_0x567d8d,null));};exports[_0x1a18('0x78')]=function(_0x442668,_0x31b72f,_0x50f148){return db[_0x1a18('0x6d')][_0x1a18('0x61')]({'where':{'id':_0x442668[_0x1a18('0x3a')]['ids']},'attributes':['id'],'include':[{'model':db[_0x1a18('0x62')],'as':_0x1a18('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x1a18('0x2c')](handleEntityNotFound(_0x31b72f,null))[_0x1a18('0x2c')](function(_0x382002){var _0x4723fa=_[_0x1a18('0x35')](_0x382002,'id');var _0x4ec65c=[];var _0xbc9c78=[];var _0x28b448=squel[_0x1a18('0x79')]();_0x28b448[_0x1a18('0x7a')](_0x1a18('0x7b'))[_0x1a18('0x7c')](_0x1a18('0x7d'),'tq')[_0x1a18('0x7e')](_0x1a18('0x7f'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x1a18('0x45')](_0x1a18('0x80'),_0x442668[_0x1a18('0x50')]['id']);for(var _0xcadb9e=0x0;_0xcadb9e<_0x382002[_0x1a18('0x41')];_0xcadb9e+=0x1){let _0x2f5052=_0x382002[_0xcadb9e];for(var _0x356349=0x0;_0x356349<_0x2f5052['Agents']['length'];_0x356349+=0x1){let _0x4dcf6f=_0x2f5052['Agents'][_0x356349];var _0x4cbcfb=_0x28b448[_0x1a18('0x81')]();_0x4cbcfb[_0x1a18('0x45')](_0x1a18('0x82'),_0x4dcf6f['id']);_0xbc9c78['push'](db['sequelize']['query'](_0x4cbcfb[_0x1a18('0x83')](),{'type':db[_0x1a18('0x73')][_0x1a18('0x84')][_0x1a18('0x85')]})[_0x1a18('0x2c')](function(_0x5771ba){if(_0x5771ba[_0x1a18('0x41')]===0x1){return _0x4dcf6f['id'];}else{var _0x4b2d3a=_[_0x1a18('0x86')](_[_0x1a18('0x35')](_0x5771ba,_0x1a18('0x87')),function(_0x575088){return _['includes'](_0x4723fa,_0x575088);});if(_0x4b2d3a){return _0x4dcf6f['id'];}}}));}}return BPromise[_0x1a18('0x88')](_0xbc9c78)['then'](function(_0xdb7163){_0x4ec65c=_(_0x4ec65c)[_0x1a18('0x89')](_0xdb7163)[_0x1a18('0x8a')]()[_0x1a18('0x8b')]();return db[_0x1a18('0x36')]['find']({'where':{'id':_0x442668['params']['id']}})[_0x1a18('0x2c')](function(_0x21a0dc){return db[_0x1a18('0x73')]['transaction'](function(_0x4c2673){return _0x21a0dc[_0x1a18('0x78')](_0x442668[_0x1a18('0x3a')][_0x1a18('0x8c')],{'transaction':_0x4c2673})[_0x1a18('0x2c')](function(){if(!_[_0x1a18('0x8d')](_0x4ec65c)){return _0x21a0dc[_0x1a18('0x8e')](_0x4ec65c,{'transaction':_0x4c2673});}})[_0x1a18('0x2c')](function(){_0x4ec65c['forEach'](function(_0x120f5d){socket[_0x1a18('0x76')]('userWhatsappQueue:remove',{'UserId':_0x120f5d,'WhatsappQueueId':_0x21a0dc['id']});});});});});});})[_0x1a18('0x2c')](respondWithStatusCode(_0x31b72f,null))['catch'](handleError(_0x31b72f,null));};exports[_0x1a18('0x8f')]=function(_0x11a77a,_0x1a0d2f,_0x2676ec){return db['WhatsappQueue'][_0x1a18('0x52')]({'where':{'id':_0x11a77a[_0x1a18('0x50')]['id']}})[_0x1a18('0x2c')](handleEntityNotFound(_0x1a0d2f,null))['then'](function(_0xe704eb){if(_0xe704eb){return _0xe704eb[_0x1a18('0x8f')](_0x11a77a[_0x1a18('0x5c')][_0x1a18('0x8c')],_[_0x1a18('0x90')](_0x11a77a[_0x1a18('0x5c')],[_0x1a18('0x8c'),'id'])||{})['spread'](function(_0x16aa00){for(var _0x45bedc=0x0;_0x45bedc<_0x11a77a['body'][_0x1a18('0x8c')][_0x1a18('0x41')];_0x45bedc+=0x1){socket['emit'](_0x1a18('0x77'),{'UserId':Number(_0x11a77a[_0x1a18('0x5c')][_0x1a18('0x8c')][_0x45bedc]),'WhatsappQueueId':Number(_0x11a77a[_0x1a18('0x50')]['id'])});}return _0x16aa00;});}})[_0x1a18('0x2c')](respondWithResult(_0x1a0d2f,null))[_0x1a18('0x4e')](handleError(_0x1a0d2f,null));};exports[_0x1a18('0x8e')]=function(_0x392f7e,_0x5b2fe7,_0x15f7b3){return db[_0x1a18('0x36')]['find']({'where':{'id':_0x392f7e['params']['id']}})[_0x1a18('0x2c')](handleEntityNotFound(_0x5b2fe7,null))[_0x1a18('0x2c')](function(_0x322dba){if(_0x322dba){return _0x322dba[_0x1a18('0x8e')](_0x392f7e[_0x1a18('0x3a')]['ids'])[_0x1a18('0x2c')](function(){if(_['isArray'](_0x392f7e[_0x1a18('0x3a')]['ids'])){for(var _0x507246=0x0;_0x507246<_0x392f7e['query']['ids'][_0x1a18('0x41')];_0x507246+=0x1){socket[_0x1a18('0x76')](_0x1a18('0x91'),{'UserId':Number(_0x392f7e[_0x1a18('0x3a')][_0x1a18('0x8c')][_0x507246]),'WhatsappQueueId':Number(_0x392f7e['params']['id'])});}}else{socket['emit'](_0x1a18('0x91'),{'UserId':Number(_0x392f7e[_0x1a18('0x3a')][_0x1a18('0x8c')]),'WhatsappQueueId':Number(_0x392f7e[_0x1a18('0x50')]['id'])});}});}})[_0x1a18('0x2c')](respondWithStatusCode(_0x5b2fe7,null))['catch'](handleError(_0x5b2fe7,null));};exports[_0x1a18('0x92')]=function(_0x2ef7ca,_0x38aaea,_0x4ec965){var _0x507e65={};var _0x359a9c={};var _0x533ac7;var _0x23cb55;return db['WhatsappQueue'][_0x1a18('0x93')]({'where':{'id':_0x2ef7ca[_0x1a18('0x50')]['id']}})['then'](handleEntityNotFound(_0x38aaea,null))['then'](function(_0x5d5623){if(_0x5d5623){_0x533ac7=_0x5d5623;_0x359a9c[_0x1a18('0x3e')]=_[_0x1a18('0x3b')](db[_0x1a18('0x62')][_0x1a18('0x37')]);_0x359a9c[_0x1a18('0x3a')]=_[_0x1a18('0x3b')](_0x2ef7ca[_0x1a18('0x3a')]);_0x359a9c[_0x1a18('0x3c')]=_[_0x1a18('0x3d')](_0x359a9c[_0x1a18('0x3e')],_0x359a9c[_0x1a18('0x3a')]);_0x507e65[_0x1a18('0x40')]=_[_0x1a18('0x3d')](_0x359a9c[_0x1a18('0x3e')],qs[_0x1a18('0x3f')](_0x2ef7ca[_0x1a18('0x3a')][_0x1a18('0x3f')]));_0x507e65[_0x1a18('0x40')]=_0x507e65[_0x1a18('0x40')][_0x1a18('0x41')]?_0x507e65[_0x1a18('0x40')]:_0x359a9c[_0x1a18('0x3e')];_0x507e65[_0x1a18('0x60')]=qs[_0x1a18('0x44')](_0x2ef7ca[_0x1a18('0x3a')][_0x1a18('0x44')]);_0x507e65[_0x1a18('0x45')]=qs[_0x1a18('0x3c')](_[_0x1a18('0x46')](_0x2ef7ca[_0x1a18('0x3a')],_0x359a9c[_0x1a18('0x3c')]));if(_0x2ef7ca[_0x1a18('0x3a')]['filter']){_0x507e65[_0x1a18('0x45')]=_[_0x1a18('0x48')](_0x507e65[_0x1a18('0x45')],{'$or':_['map'](_0x507e65[_0x1a18('0x40')],function(_0x1723f4){var _0x4c95c5={};_0x4c95c5[_0x1723f4]={'$like':'%'+_0x2ef7ca[_0x1a18('0x3a')][_0x1a18('0x47')]+'%'};return _0x4c95c5;})});}_0x507e65=_['merge']({},_0x507e65,_0x2ef7ca[_0x1a18('0x4b')]);return _0x533ac7[_0x1a18('0x92')](_0x507e65);}})['then'](function(_0x1bedca){if(_0x1bedca){_0x23cb55=_0x1bedca[_0x1a18('0x41')];if(!_0x2ef7ca[_0x1a18('0x3a')][_0x1a18('0x42')](_0x1a18('0x43'))){_0x507e65[_0x1a18('0x27')]=qs[_0x1a18('0x27')](_0x2ef7ca[_0x1a18('0x3a')][_0x1a18('0x27')]);_0x507e65['offset']=qs['offset'](_0x2ef7ca[_0x1a18('0x3a')][_0x1a18('0x24')]);}return _0x533ac7[_0x1a18('0x92')](_0x507e65);}})[_0x1a18('0x2c')](function(_0x46462e){if(_0x46462e){return _0x46462e?{'count':_0x23cb55,'rows':_0x46462e}:null;}})[_0x1a18('0x2c')](respondWithResult(_0x38aaea,null))[_0x1a18('0x4e')](handleError(_0x38aaea,null));}; \ No newline at end of file +var _0x6011=['sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappQueue.socket','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','update','then','destroy','get','WhatsappQueues','stack','name','index','map','WhatsappQueue','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','UserWhatsappQueue','WhatsappQueueId','User','findAndCountAll','agent','updatedAt','format','SIP','whatsappPause','createdAt','getTeams','Team','ids','online','voicePause','interface','flatMap','Agents','sequelize','transaction','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','isArray','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0xf9fd03,_0x3ea33c){var _0x287128=function(_0x7c8d5e){while(--_0x7c8d5e){_0xf9fd03['push'](_0xf9fd03['shift']());}};_0x287128(++_0x3ea33c);}(_0x6011,0x84));var _0x1601=function(_0x7b03b7,_0x36211c){_0x7b03b7=_0x7b03b7-0x0;var _0x16adb7=_0x6011[_0x7b03b7];return _0x16adb7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1601('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1601('0x1'));var rp=require(_0x1601('0x2'));var moment=require(_0x1601('0x3'));var BPromise=require(_0x1601('0x4'));var Mustache=require(_0x1601('0x5'));var util=require('util');var path=require('path');var sox=require(_0x1601('0x6'));var csv=require('to-csv');var ejs=require(_0x1601('0x7'));var fs=require('fs');var fs_extra=require(_0x1601('0x8'));var _=require(_0x1601('0x9'));var squel=require(_0x1601('0xa'));var crypto=require(_0x1601('0xb'));var jsforce=require(_0x1601('0xc'));var deskjs=require(_0x1601('0xd'));var toCsv=require(_0x1601('0xe'));var querystring=require(_0x1601('0xf'));var Papa=require('papaparse');var Redis=require(_0x1601('0x10'));var authService=require(_0x1601('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1601('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1601('0x13'));var utils=require(_0x1601('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x1601('0x15'));var db=require(_0x1601('0x16'))['db'];config[_0x1601('0x17')]=_['defaults'](config['redis'],{'host':_0x1601('0x18'),'port':0x18eb});var socket=require(_0x1601('0x19'))(new Redis(config[_0x1601('0x17')]));require(_0x1601('0x1a'))['register'](socket);function respondWithStatusCode(_0x1819e9,_0x5823c7){_0x5823c7=_0x5823c7||0xcc;return function(_0x100778){if(_0x100778){return _0x1819e9[_0x1601('0x1b')](_0x5823c7);}return _0x1819e9[_0x1601('0x1c')](_0x5823c7)[_0x1601('0x1d')]();};}function respondWithResult(_0x20ccd2,_0x51082a){_0x51082a=_0x51082a||0xc8;return function(_0xc4144f){if(_0xc4144f){return _0x20ccd2[_0x1601('0x1c')](_0x51082a)[_0x1601('0x1e')](_0xc4144f);}};}function respondWithFilteredResult(_0x207fc2,_0x57f1c3){return function(_0x4e5c57){if(_0x4e5c57){var _0x1f5284=typeof _0x57f1c3[_0x1601('0x1f')]==='undefined'&&typeof _0x57f1c3[_0x1601('0x20')]===_0x1601('0x21');var _0x28c4a3=_0x4e5c57[_0x1601('0x22')];var _0x2ac2fe=_0x1f5284?0x0:_0x57f1c3[_0x1601('0x1f')];var _0x84ce50=_0x1f5284?_0x4e5c57['count']:_0x57f1c3[_0x1601('0x1f')]+_0x57f1c3[_0x1601('0x20')];var _0x11d2db;if(_0x84ce50>=_0x28c4a3){_0x84ce50=_0x28c4a3;_0x11d2db=0xc8;}else{_0x11d2db=0xce;}_0x207fc2[_0x1601('0x1c')](_0x11d2db);return _0x207fc2[_0x1601('0x23')]('Content-Range',_0x2ac2fe+'-'+_0x84ce50+'/'+_0x28c4a3)[_0x1601('0x1e')](_0x4e5c57);}return null;};}function patchUpdates(_0x5651f9){return function(_0x2e2158){try{jsonpatch[_0x1601('0x24')](_0x2e2158,_0x5651f9,!![]);}catch(_0x170a9f){return BPromise['reject'](_0x170a9f);}return _0x2e2158[_0x1601('0x25')]();};}function saveUpdates(_0x23d3fd,_0x105e98){return function(_0x2a4ccb){if(_0x2a4ccb){return _0x2a4ccb[_0x1601('0x26')](_0x23d3fd)[_0x1601('0x27')](function(_0x27a7d0){return _0x27a7d0;});}return null;};}function removeEntity(_0x547b96,_0x37e6d2){return function(_0x11de8d){if(_0x11de8d){return _0x11de8d[_0x1601('0x28')]()[_0x1601('0x27')](function(){var _0x5d3f9b=_0x11de8d[_0x1601('0x29')]({'plain':!![]});var _0x3e14d2=_0x1601('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x3e14d2,'resourceId':_0x5d3f9b['id']}})[_0x1601('0x27')](function(){return _0x11de8d;});})['then'](function(){_0x547b96[_0x1601('0x1c')](0xcc)[_0x1601('0x1d')]();});}};}function handleEntityNotFound(_0x16c6b0,_0x431638){return function(_0x24bc6b){if(!_0x24bc6b){_0x16c6b0[_0x1601('0x1b')](0x194);}return _0x24bc6b;};}function handleError(_0x2082ae,_0x48b50f){_0x48b50f=_0x48b50f||0x1f4;return function(_0x5b9225){logger['error'](_0x5b9225[_0x1601('0x2b')]);if(_0x5b9225[_0x1601('0x2c')]){delete _0x5b9225[_0x1601('0x2c')];}_0x2082ae[_0x1601('0x1c')](_0x48b50f)['send'](_0x5b9225);};}exports[_0x1601('0x2d')]=function(_0x5b291d,_0xbd2450){var _0x486a2d={},_0x5d4aab={},_0xb54c0b={'count':0x0,'rows':[]};var _0x124711=_[_0x1601('0x2e')](db[_0x1601('0x2f')]['rawAttributes'],function(_0x317557){return{'name':_0x317557[_0x1601('0x30')],'type':_0x317557[_0x1601('0x31')][_0x1601('0x32')]};});_0x5d4aab[_0x1601('0x33')]=_[_0x1601('0x2e')](_0x124711,_0x1601('0x2c'));_0x5d4aab[_0x1601('0x34')]=_[_0x1601('0x35')](_0x5b291d['query']);_0x5d4aab['filters']=_[_0x1601('0x36')](_0x5d4aab[_0x1601('0x33')],_0x5d4aab[_0x1601('0x34')]);_0x486a2d[_0x1601('0x37')]=_[_0x1601('0x36')](_0x5d4aab[_0x1601('0x33')],qs[_0x1601('0x38')](_0x5b291d[_0x1601('0x34')][_0x1601('0x38')]));_0x486a2d[_0x1601('0x37')]=_0x486a2d['attributes']['length']?_0x486a2d[_0x1601('0x37')]:_0x5d4aab[_0x1601('0x33')];if(!_0x5b291d[_0x1601('0x34')][_0x1601('0x39')](_0x1601('0x3a'))){_0x486a2d[_0x1601('0x20')]=qs[_0x1601('0x20')](_0x5b291d['query'][_0x1601('0x20')]);_0x486a2d['offset']=qs['offset'](_0x5b291d['query'][_0x1601('0x1f')]);}_0x486a2d[_0x1601('0x3b')]=qs[_0x1601('0x3c')](_0x5b291d[_0x1601('0x34')][_0x1601('0x3c')]);_0x486a2d[_0x1601('0x3d')]=qs['filters'](_[_0x1601('0x3e')](_0x5b291d[_0x1601('0x34')],_0x5d4aab[_0x1601('0x3f')]),_0x124711);if(_0x5b291d[_0x1601('0x34')][_0x1601('0x40')]){_0x486a2d['where']=_[_0x1601('0x41')](_0x486a2d['where'],{'$or':_[_0x1601('0x2e')](_0x124711,function(_0x4ffc0d){if(_0x4ffc0d[_0x1601('0x31')]!==_0x1601('0x42')){var _0x2eaffe={};_0x2eaffe[_0x4ffc0d[_0x1601('0x2c')]]={'$like':'%'+_0x5b291d[_0x1601('0x34')]['filter']+'%'};return _0x2eaffe;}})});}_0x486a2d=_[_0x1601('0x41')]({},_0x486a2d,_0x5b291d[_0x1601('0x43')]);var _0x171d04={'where':_0x486a2d[_0x1601('0x3d')]};return db[_0x1601('0x2f')][_0x1601('0x22')](_0x171d04)[_0x1601('0x27')](function(_0x2030a6){_0xb54c0b[_0x1601('0x22')]=_0x2030a6;if(_0x5b291d[_0x1601('0x34')][_0x1601('0x44')]){_0x486a2d['include']=[{'all':!![]}];}return db[_0x1601('0x2f')][_0x1601('0x45')](_0x486a2d);})['then'](function(_0x45cf2f){_0xb54c0b[_0x1601('0x46')]=_0x45cf2f;return _0xb54c0b;})[_0x1601('0x27')](respondWithFilteredResult(_0xbd2450,_0x486a2d))[_0x1601('0x47')](handleError(_0xbd2450,null));};exports[_0x1601('0x48')]=function(_0x426424,_0x260532){var _0x4cea6c={'raw':!![],'where':{'id':_0x426424[_0x1601('0x49')]['id']}},_0x2d1077={};_0x2d1077[_0x1601('0x33')]=_[_0x1601('0x35')](db[_0x1601('0x2f')][_0x1601('0x4a')]);_0x2d1077[_0x1601('0x34')]=_[_0x1601('0x35')](_0x426424[_0x1601('0x34')]);_0x2d1077[_0x1601('0x3f')]=_['intersection'](_0x2d1077['model'],_0x2d1077['query']);_0x4cea6c[_0x1601('0x37')]=_[_0x1601('0x36')](_0x2d1077['model'],qs[_0x1601('0x38')](_0x426424['query'][_0x1601('0x38')]));_0x4cea6c[_0x1601('0x37')]=_0x4cea6c[_0x1601('0x37')][_0x1601('0x4b')]?_0x4cea6c[_0x1601('0x37')]:_0x2d1077['model'];if(_0x426424[_0x1601('0x34')][_0x1601('0x44')]){_0x4cea6c[_0x1601('0x4c')]=[{'all':!![]}];}_0x4cea6c=_[_0x1601('0x41')]({},_0x4cea6c,_0x426424['options']);return db['WhatsappQueue'][_0x1601('0x4d')](_0x4cea6c)['then'](handleEntityNotFound(_0x260532,null))['then'](respondWithResult(_0x260532,null))[_0x1601('0x47')](handleError(_0x260532,null));};exports[_0x1601('0x4e')]=function(_0x1bc1a0,_0x10a99f){return db[_0x1601('0x2f')][_0x1601('0x4e')](_0x1bc1a0['body'],{})[_0x1601('0x27')](function(_0x5bbd0a){var _0x16319d=_0x1bc1a0['user'][_0x1601('0x29')]({'plain':!![]});if(!_0x16319d)throw new Error(_0x1601('0x4f'));if(_0x16319d[_0x1601('0x50')]==='user'){var _0x20e2ce=_0x5bbd0a['get']({'plain':!![]});var _0x1fb0fc=_0x1601('0x2a');return db['UserProfileSection'][_0x1601('0x4d')]({'where':{'name':_0x1fb0fc,'userProfileId':_0x16319d['userProfileId']},'raw':!![]})['then'](function(_0xda606f){if(_0xda606f&&_0xda606f[_0x1601('0x51')]===0x0){return db[_0x1601('0x52')][_0x1601('0x4e')]({'name':_0x20e2ce[_0x1601('0x2c')],'resourceId':_0x20e2ce['id'],'type':_0xda606f[_0x1601('0x2c')],'sectionId':_0xda606f['id']},{})[_0x1601('0x27')](function(){return _0x5bbd0a;});}else{return _0x5bbd0a;}})[_0x1601('0x47')](function(_0x5874ab){logger['error'](_0x1601('0x53'),_0x5874ab);throw _0x5874ab;});}return _0x5bbd0a;})['then'](respondWithResult(_0x10a99f,0xc9))[_0x1601('0x47')](handleError(_0x10a99f,null));};exports[_0x1601('0x26')]=function(_0x2984a5,_0x50ff56){if(_0x2984a5['body']['id']){delete _0x2984a5[_0x1601('0x54')]['id'];}return db['WhatsappQueue']['find']({'where':{'id':_0x2984a5[_0x1601('0x49')]['id']}})[_0x1601('0x27')](handleEntityNotFound(_0x50ff56,null))[_0x1601('0x27')](saveUpdates(_0x2984a5[_0x1601('0x54')],null))['then'](respondWithResult(_0x50ff56,null))[_0x1601('0x47')](handleError(_0x50ff56,null));};exports[_0x1601('0x28')]=function(_0x5bbbc6,_0x24fc05){return db[_0x1601('0x2f')][_0x1601('0x4d')]({'where':{'id':_0x5bbbc6[_0x1601('0x49')]['id']}})[_0x1601('0x27')](handleEntityNotFound(_0x24fc05,null))['then'](removeEntity(_0x24fc05,null))[_0x1601('0x47')](handleError(_0x24fc05,null));};exports[_0x1601('0x55')]=function(_0x1be233,_0x30a947){return db['WhatsappQueue']['describe']()[_0x1601('0x27')](respondWithResult(_0x30a947,null))[_0x1601('0x47')](handleError(_0x30a947,null));};exports['getMembers']=function(_0x533b36,_0x43b5b3,_0x31f945){var _0x55ce21={'raw':!![],'where':{}},_0x39e0db={},_0x5ee931;return db[_0x1601('0x2f')][_0x1601('0x56')]({'where':{'id':_0x533b36['params']['id']}})[_0x1601('0x27')](handleEntityNotFound(_0x43b5b3,null))[_0x1601('0x27')](function(_0x1c0a58){if(_0x1c0a58){_0x5ee931=_0x1c0a58['get']({'plain':!![]});_0x39e0db[_0x1601('0x33')]=_[_0x1601('0x35')](db[_0x1601('0x57')][_0x1601('0x4a')]);_0x39e0db[_0x1601('0x34')]=_[_0x1601('0x35')](_0x533b36['query']);_0x39e0db[_0x1601('0x3f')]=_[_0x1601('0x36')](_0x39e0db[_0x1601('0x33')],_0x39e0db[_0x1601('0x34')]);_0x55ce21[_0x1601('0x37')]=_[_0x1601('0x36')](_0x39e0db[_0x1601('0x33')],qs[_0x1601('0x38')](_0x533b36[_0x1601('0x34')]['fields']));_0x55ce21['attributes']=_0x55ce21[_0x1601('0x37')][_0x1601('0x4b')]?_0x55ce21[_0x1601('0x37')]:_0x39e0db[_0x1601('0x33')];if(!_0x533b36['query'][_0x1601('0x39')](_0x1601('0x3a'))){_0x55ce21[_0x1601('0x20')]=qs['limit'](_0x533b36['query']['limit']);_0x55ce21['offset']=qs[_0x1601('0x1f')](_0x533b36['query']['offset']);}_0x55ce21[_0x1601('0x3b')]=qs[_0x1601('0x3c')](_0x533b36[_0x1601('0x34')][_0x1601('0x3c')]);_0x55ce21['where']=qs['filters'](_['pick'](_0x533b36[_0x1601('0x34')],_0x39e0db[_0x1601('0x3f')]));_0x55ce21[_0x1601('0x3d')][_0x1601('0x58')]=_0x1c0a58['id'];if(_0x533b36['query']['filter']){_0x55ce21[_0x1601('0x3d')]=_[_0x1601('0x41')](_0x55ce21[_0x1601('0x3d')],{'$or':_[_0x1601('0x2e')](_0x55ce21['attributes'],function(_0x32fd1c){var _0x3ecb67={};_0x3ecb67[_0x32fd1c]={'$like':'%'+_0x533b36[_0x1601('0x34')][_0x1601('0x40')]+'%'};return _0x3ecb67;})});}_0x55ce21=_['merge']({},_0x55ce21,_0x533b36[_0x1601('0x43')]);return db[_0x1601('0x57')][_0x1601('0x45')](_0x55ce21);}})[_0x1601('0x27')](function(_0xcf5319){if(_0xcf5319){return db[_0x1601('0x59')][_0x1601('0x5a')]({'where':{'id':_[_0x1601('0x2e')](_0xcf5319,'UserId'),'role':_0x1601('0x5b')},'attributes':['id',_0x1601('0x2c'),'whatsappPause',_0x1601('0x5c'),'createdAt']});}})[_0x1601('0x27')](function(_0x3a3408){if(_0x3a3408){return{'count':_0x3a3408['count'],'rows':_[_0x1601('0x2e')](_0x3a3408['rows'],function(_0x33d00c){return{'membername':_0x33d00c[_0x1601('0x2c')],'UserId':_0x33d00c['id'],'queue_name':_0x5ee931[_0x1601('0x2c')],'WhatsappQueueId':_0x5ee931['id'],'interface':util[_0x1601('0x5d')]('%s/%s',_0x1601('0x5e'),_0x33d00c[_0x1601('0x2c')]),'penalty':0x0,'paused':_0x33d00c[_0x1601('0x5f')],'createdAt':_0x33d00c[_0x1601('0x60')],'updatedAt':_0x33d00c[_0x1601('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1601('0x27')](respondWithFilteredResult(_0x43b5b3,_0x55ce21))[_0x1601('0x47')](handleError(_0x43b5b3,null));};exports[_0x1601('0x61')]=function(_0x4ecb88,_0x15b81b,_0x5d3752){var _0x2540b0={};var _0x258d34={};var _0x57f9a8;var _0x470f93;return db[_0x1601('0x2f')][_0x1601('0x56')]({'where':{'id':_0x4ecb88[_0x1601('0x49')]['id']}})[_0x1601('0x27')](handleEntityNotFound(_0x15b81b,null))[_0x1601('0x27')](function(_0x438fcb){if(_0x438fcb){_0x57f9a8=_0x438fcb;_0x258d34['model']=_[_0x1601('0x35')](db[_0x1601('0x62')]['rawAttributes']);_0x258d34[_0x1601('0x34')]=_[_0x1601('0x35')](_0x4ecb88[_0x1601('0x34')]);_0x258d34[_0x1601('0x3f')]=_[_0x1601('0x36')](_0x258d34[_0x1601('0x33')],_0x258d34[_0x1601('0x34')]);_0x2540b0[_0x1601('0x37')]=_[_0x1601('0x36')](_0x258d34[_0x1601('0x33')],qs[_0x1601('0x38')](_0x4ecb88[_0x1601('0x34')]['fields']));_0x2540b0[_0x1601('0x37')]=_0x2540b0[_0x1601('0x37')][_0x1601('0x4b')]?_0x2540b0[_0x1601('0x37')]:_0x258d34[_0x1601('0x33')];_0x2540b0[_0x1601('0x3b')]=qs['sort'](_0x4ecb88[_0x1601('0x34')][_0x1601('0x3c')]);_0x2540b0[_0x1601('0x3d')]=qs['filters'](_['pick'](_0x4ecb88[_0x1601('0x34')],_0x258d34[_0x1601('0x3f')]));if(_0x4ecb88[_0x1601('0x34')][_0x1601('0x40')]){_0x2540b0['where']=_[_0x1601('0x41')](_0x2540b0[_0x1601('0x3d')],{'$or':_['map'](_0x2540b0['attributes'],function(_0x1c1368){var _0x1dd463={};_0x1dd463[_0x1c1368]={'$like':'%'+_0x4ecb88[_0x1601('0x34')][_0x1601('0x40')]+'%'};return _0x1dd463;})});}_0x2540b0=_[_0x1601('0x41')]({},_0x2540b0,_0x4ecb88[_0x1601('0x43')]);return _0x57f9a8['getTeams'](_0x2540b0);}})[_0x1601('0x27')](function(_0x1cb31b){if(_0x1cb31b){_0x470f93=_0x1cb31b[_0x1601('0x4b')];if(!_0x4ecb88['query'][_0x1601('0x39')](_0x1601('0x3a'))){_0x2540b0['limit']=qs[_0x1601('0x20')](_0x4ecb88[_0x1601('0x34')][_0x1601('0x20')]);_0x2540b0[_0x1601('0x1f')]=qs[_0x1601('0x1f')](_0x4ecb88['query'][_0x1601('0x1f')]);}return _0x57f9a8[_0x1601('0x61')](_0x2540b0);}})[_0x1601('0x27')](function(_0x3417c9){if(_0x3417c9){return _0x3417c9?{'count':_0x470f93,'rows':_0x3417c9}:null;}})['then'](respondWithResult(_0x15b81b,null))[_0x1601('0x47')](handleError(_0x15b81b,null));};exports['addTeams']=function(_0x258e73,_0x1fe1ef,_0x1b1e5c){var _0x14c2c9=_0x258e73[_0x1601('0x54')][_0x1601('0x63')];return db[_0x1601('0x62')][_0x1601('0x45')]({'where':{'id':_0x14c2c9},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x1601('0x2c'),_0x1601('0x64'),_0x1601('0x65'),_0x1601('0x66')],'raw':!![]}]})[_0x1601('0x27')](function(_0x28608a){if(_0x28608a){var _0x3f302b=_[_0x1601('0x67')](_0x28608a,function(_0xfa90f9){var _0x31862f=_0xfa90f9[_0x1601('0x29')]({'plain':!![]});return _0x31862f[_0x1601('0x68')];});return db[_0x1601('0x2f')][_0x1601('0x4d')]({'where':{'id':_0x258e73['params']['id']}})[_0x1601('0x27')](function(_0x170d08){return db[_0x1601('0x69')][_0x1601('0x6a')](function(_0x3092cb){return _0x170d08['addTeams'](_0x14c2c9,{'transaction':_0x3092cb})['then'](function(){return BPromise['each'](_0x3f302b,function(_0x526a4f){return db[_0x1601('0x57')][_0x1601('0x6b')]({'where':{'UserId':_0x526a4f['id'],'WhatsappQueueId':_0x258e73['params']['id']},'transaction':_0x3092cb});});})[_0x1601('0x27')](function(){_0x3f302b[_0x1601('0x6c')](function(_0x23969d){socket[_0x1601('0x6d')](_0x1601('0x6e'),{'UserId':_0x23969d['id'],'WhatsappQueueId':_0x170d08['id']});});});});});}})[_0x1601('0x27')](respondWithStatusCode(_0x1fe1ef,null))[_0x1601('0x47')](handleError(_0x1fe1ef,null));};exports[_0x1601('0x6f')]=function(_0x4df11d,_0x1c2b47,_0x5e93d6){return db[_0x1601('0x62')]['findAll']({'where':{'id':_0x4df11d[_0x1601('0x34')]['ids']},'attributes':['id'],'include':[{'model':db[_0x1601('0x59')],'as':_0x1601('0x68'),'attributes':['id'],'raw':!![]}]})[_0x1601('0x27')](handleEntityNotFound(_0x1c2b47,null))['then'](function(_0x14e223){var _0x485674=_['map'](_0x14e223,'id');var _0x2bb23b=[];var _0x304e4c=[];var _0x43616e=squel[_0x1601('0x70')]();_0x43616e[_0x1601('0x71')](_0x1601('0x72'))[_0x1601('0x73')](_0x1601('0x74'),'tq')[_0x1601('0x75')]('user_has_teams','ut',_0x1601('0x76'))[_0x1601('0x3d')](_0x1601('0x77'),_0x4df11d[_0x1601('0x49')]['id']);for(var _0x12129b=0x0;_0x12129b<_0x14e223[_0x1601('0x4b')];_0x12129b+=0x1){let _0x1c1a88=_0x14e223[_0x12129b];for(var _0x1880cb=0x0;_0x1880cb<_0x1c1a88[_0x1601('0x68')]['length'];_0x1880cb+=0x1){let _0x56bced=_0x1c1a88['Agents'][_0x1880cb];var _0x3af48b=_0x43616e[_0x1601('0x78')]();_0x3af48b[_0x1601('0x3d')](_0x1601('0x79'),_0x56bced['id']);_0x304e4c['push'](db[_0x1601('0x69')]['query'](_0x3af48b[_0x1601('0x7a')](),{'type':db[_0x1601('0x69')][_0x1601('0x7b')][_0x1601('0x7c')]})['then'](function(_0x3e5b73){if(_0x3e5b73[_0x1601('0x4b')]===0x1){return _0x56bced['id'];}else{var _0x26a843=_[_0x1601('0x7d')](_[_0x1601('0x2e')](_0x3e5b73,_0x1601('0x7e')),function(_0x5d639e){return _[_0x1601('0x7f')](_0x485674,_0x5d639e);});if(_0x26a843){return _0x56bced['id'];}}}));}}return BPromise[_0x1601('0x80')](_0x304e4c)[_0x1601('0x27')](function(_0x1da9ed){_0x2bb23b=_(_0x2bb23b)[_0x1601('0x81')](_0x1da9ed)[_0x1601('0x82')]()['value']();return db[_0x1601('0x2f')]['find']({'where':{'id':_0x4df11d['params']['id']}})[_0x1601('0x27')](function(_0xb1ffc6){return db[_0x1601('0x69')][_0x1601('0x6a')](function(_0x2e36f5){return _0xb1ffc6[_0x1601('0x6f')](_0x4df11d[_0x1601('0x34')][_0x1601('0x63')],{'transaction':_0x2e36f5})[_0x1601('0x27')](function(){if(!_[_0x1601('0x83')](_0x2bb23b)){return _0xb1ffc6[_0x1601('0x84')](_0x2bb23b,{'transaction':_0x2e36f5});}})[_0x1601('0x27')](function(){_0x2bb23b[_0x1601('0x6c')](function(_0x566de0){socket[_0x1601('0x6d')](_0x1601('0x85'),{'UserId':_0x566de0,'WhatsappQueueId':_0xb1ffc6['id']});});});});});});})[_0x1601('0x27')](respondWithStatusCode(_0x1c2b47,null))[_0x1601('0x47')](handleError(_0x1c2b47,null));};exports['addAgents']=function(_0x247451,_0x2fac08,_0x382a92){return db[_0x1601('0x2f')][_0x1601('0x4d')]({'where':{'id':_0x247451['params']['id']}})['then'](handleEntityNotFound(_0x2fac08,null))[_0x1601('0x27')](function(_0x1400a9){if(_0x1400a9){return _0x1400a9[_0x1601('0x86')](_0x247451[_0x1601('0x54')][_0x1601('0x63')],_[_0x1601('0x87')](_0x247451[_0x1601('0x54')],[_0x1601('0x63'),'id'])||{})['spread'](function(_0x411009){for(var _0x5dd052=0x0;_0x5dd052<_0x247451[_0x1601('0x54')][_0x1601('0x63')][_0x1601('0x4b')];_0x5dd052+=0x1){socket[_0x1601('0x6d')](_0x1601('0x6e'),{'UserId':Number(_0x247451[_0x1601('0x54')][_0x1601('0x63')][_0x5dd052]),'WhatsappQueueId':Number(_0x247451[_0x1601('0x49')]['id'])});}return _0x411009;});}})['then'](respondWithResult(_0x2fac08,null))['catch'](handleError(_0x2fac08,null));};exports[_0x1601('0x84')]=function(_0x4f93c4,_0x543e41,_0x568094){return db[_0x1601('0x2f')][_0x1601('0x4d')]({'where':{'id':_0x4f93c4[_0x1601('0x49')]['id']}})['then'](handleEntityNotFound(_0x543e41,null))[_0x1601('0x27')](function(_0x4c02be){if(_0x4c02be){return _0x4c02be[_0x1601('0x84')](_0x4f93c4[_0x1601('0x34')][_0x1601('0x63')])[_0x1601('0x27')](function(){if(_[_0x1601('0x88')](_0x4f93c4[_0x1601('0x34')][_0x1601('0x63')])){for(var _0x2e11d7=0x0;_0x2e11d7<_0x4f93c4[_0x1601('0x34')]['ids']['length'];_0x2e11d7+=0x1){socket[_0x1601('0x6d')](_0x1601('0x85'),{'UserId':Number(_0x4f93c4[_0x1601('0x34')][_0x1601('0x63')][_0x2e11d7]),'WhatsappQueueId':Number(_0x4f93c4[_0x1601('0x49')]['id'])});}}else{socket[_0x1601('0x6d')](_0x1601('0x85'),{'UserId':Number(_0x4f93c4[_0x1601('0x34')]['ids']),'WhatsappQueueId':Number(_0x4f93c4[_0x1601('0x49')]['id'])});}});}})[_0x1601('0x27')](respondWithStatusCode(_0x543e41,null))[_0x1601('0x47')](handleError(_0x543e41,null));};exports['getAgents']=function(_0x503842,_0x49e9fc,_0x242d8d){var _0x3ad5c4={};var _0x5a8461={};var _0x58e3d3;var _0x27b583;return db[_0x1601('0x2f')][_0x1601('0x56')]({'where':{'id':_0x503842[_0x1601('0x49')]['id']}})[_0x1601('0x27')](handleEntityNotFound(_0x49e9fc,null))[_0x1601('0x27')](function(_0x80fae4){if(_0x80fae4){_0x58e3d3=_0x80fae4;_0x5a8461[_0x1601('0x33')]=_[_0x1601('0x35')](db[_0x1601('0x59')][_0x1601('0x4a')]);_0x5a8461[_0x1601('0x34')]=_[_0x1601('0x35')](_0x503842[_0x1601('0x34')]);_0x5a8461['filters']=_[_0x1601('0x36')](_0x5a8461[_0x1601('0x33')],_0x5a8461['query']);_0x3ad5c4['attributes']=_['intersection'](_0x5a8461[_0x1601('0x33')],qs[_0x1601('0x38')](_0x503842[_0x1601('0x34')][_0x1601('0x38')]));_0x3ad5c4['attributes']=_0x3ad5c4[_0x1601('0x37')][_0x1601('0x4b')]?_0x3ad5c4[_0x1601('0x37')]:_0x5a8461[_0x1601('0x33')];_0x3ad5c4['order']=qs['sort'](_0x503842['query']['sort']);_0x3ad5c4[_0x1601('0x3d')]=qs[_0x1601('0x3f')](_[_0x1601('0x3e')](_0x503842[_0x1601('0x34')],_0x5a8461[_0x1601('0x3f')]));if(_0x503842['query'][_0x1601('0x40')]){_0x3ad5c4[_0x1601('0x3d')]=_['merge'](_0x3ad5c4[_0x1601('0x3d')],{'$or':_['map'](_0x3ad5c4['attributes'],function(_0x1dfc86){var _0x5c7865={};_0x5c7865[_0x1dfc86]={'$like':'%'+_0x503842[_0x1601('0x34')][_0x1601('0x40')]+'%'};return _0x5c7865;})});}_0x3ad5c4=_[_0x1601('0x41')]({},_0x3ad5c4,_0x503842[_0x1601('0x43')]);return _0x58e3d3[_0x1601('0x89')](_0x3ad5c4);}})['then'](function(_0x24f9cd){if(_0x24f9cd){_0x27b583=_0x24f9cd[_0x1601('0x4b')];if(!_0x503842[_0x1601('0x34')]['hasOwnProperty'](_0x1601('0x3a'))){_0x3ad5c4['limit']=qs[_0x1601('0x20')](_0x503842[_0x1601('0x34')]['limit']);_0x3ad5c4[_0x1601('0x1f')]=qs[_0x1601('0x1f')](_0x503842[_0x1601('0x34')]['offset']);}return _0x58e3d3['getAgents'](_0x3ad5c4);}})[_0x1601('0x27')](function(_0x129b73){if(_0x129b73){return _0x129b73?{'count':_0x27b583,'rows':_0x129b73}:null;}})[_0x1601('0x27')](respondWithResult(_0x49e9fc,null))['catch'](handleError(_0x49e9fc,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 2aa5be4..db89372 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 _0xadf0=['emit','hook','exports','events','WhatsappQueue','remove'];(function(_0x2e0c6c,_0x2e2d51){var _0xe36e65=function(_0x5920dd){while(--_0x5920dd){_0x2e0c6c['push'](_0x2e0c6c['shift']());}};_0xe36e65(++_0x2e2d51);}(_0xadf0,0x18f));var _0x0adf=function(_0x4f1547,_0x24f64d){_0x4f1547=_0x4f1547-0x0;var _0x264e02=_0xadf0[_0x4f1547];return _0x264e02;};'use strict';var EventEmitter=require(_0x0adf('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x0adf('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x0adf('0x2')};function emitEvent(_0x2c8cb6){return function(_0x3b7ba3,_0x613b75,_0x11ee5f){WhatsappQueueEvents[_0x0adf('0x3')](_0x2c8cb6+':'+_0x3b7ba3['id'],_0x3b7ba3);WhatsappQueueEvents[_0x0adf('0x3')](_0x2c8cb6,_0x3b7ba3);_0x11ee5f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x0adf('0x4')](e,emitEvent(event));}}module[_0x0adf('0x5')]=WhatsappQueueEvents; \ No newline at end of file +var _0xa1e4=['../../mysqldb','WhatsappQueue','setMaxListeners','save','emit','hasOwnProperty','exports','events'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xa1e4,0x157));var _0x4a1e=function(_0x3a556e,_0x32191b){_0x3a556e=_0x3a556e-0x0;var _0xfe3a36=_0xa1e4[_0x3a556e];return _0xfe3a36;};'use strict';var EventEmitter=require(_0x4a1e('0x0'));var WhatsappQueue=require(_0x4a1e('0x1'))['db'][_0x4a1e('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x4a1e('0x3')](0x0);var events={'afterCreate':_0x4a1e('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4d737a){return function(_0x3be23a,_0x1430d8,_0x6ec5d2){WhatsappQueueEvents[_0x4a1e('0x5')](_0x4d737a+':'+_0x3be23a['id'],_0x3be23a);WhatsappQueueEvents[_0x4a1e('0x5')](_0x4d737a,_0x3be23a);_0x6ec5d2(null);};}for(var e in events){if(events[_0x4a1e('0x6')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x4a1e('0x7')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 7faa950..45ce9b3 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 _0x5688=['rimraf','./whatsappQueue.attributes','exports','WhatsappQueue','whatsapp_queues','lodash','util','api','moment','bluebird','request-promise'];(function(_0x3bef93,_0x1e9105){var _0x43ccb5=function(_0xccfffe){while(--_0xccfffe){_0x3bef93['push'](_0x3bef93['shift']());}};_0x43ccb5(++_0x1e9105);}(_0x5688,0x1e9));var _0x8568=function(_0x30f395,_0x3629b5){_0x30f395=_0x30f395-0x0;var _0x2ea0ee=_0x5688[_0x30f395];return _0x2ea0ee;};'use strict';var _=require(_0x8568('0x0'));var util=require(_0x8568('0x1'));var logger=require('../../config/logger')(_0x8568('0x2'));var moment=require(_0x8568('0x3'));var BPromise=require(_0x8568('0x4'));var rp=require(_0x8568('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8568('0x6'));var config=require('../../config/environment');var attributes=require(_0x8568('0x7'));module[_0x8568('0x8')]=function(_0x3ddfb6,_0x160515){return _0x3ddfb6['define'](_0x8568('0x9'),attributes,{'tableName':_0x8568('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x92a5=['util','../../config/logger','api','bluebird','path','rimraf','./whatsappQueue.attributes','define','WhatsappQueue','whatsapp_queues','lodash'];(function(_0x28d2d2,_0x5723e5){var _0x41a8db=function(_0x54bf80){while(--_0x54bf80){_0x28d2d2['push'](_0x28d2d2['shift']());}};_0x41a8db(++_0x5723e5);}(_0x92a5,0x1ac));var _0x592a=function(_0x4a4bfa,_0x2c4d6c){_0x4a4bfa=_0x4a4bfa-0x0;var _0x19a08b=_0x92a5[_0x4a4bfa];return _0x19a08b;};'use strict';var _=require(_0x592a('0x0'));var util=require(_0x592a('0x1'));var logger=require(_0x592a('0x2'))(_0x592a('0x3'));var moment=require('moment');var BPromise=require(_0x592a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x592a('0x5'));var rimraf=require(_0x592a('0x6'));var config=require('../../config/environment');var attributes=require(_0x592a('0x7'));module['exports']=function(_0x29cc02,_0x54a655){return _0x29cc02[_0x592a('0x8')](_0x592a('0x9'),attributes,{'tableName':_0x592a('0xa'),'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 c01779f..a67b035 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 _0xf1c2=['then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetWhatsappQueue','WhatsappQueue','options','raw','where','limit','include','map','model','attributes','debug','ShowWhatsappQueue','find','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','request'];(function(_0x459a51,_0x4daea){var _0x266234=function(_0x2bb3cd){while(--_0x2bb3cd){_0x459a51['push'](_0x459a51['shift']());}};_0x266234(++_0x4daea);}(_0xf1c2,0x65));var _0x2f1c=function(_0x1bd323,_0x1c16ab){_0x1bd323=_0x1bd323-0x0;var _0x13097b=_0xf1c2[_0x1bd323];return _0x13097b;};'use strict';var _=require(_0x2f1c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2f1c('0x1'));var rs=require(_0x2f1c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2f1c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2f1c('0x4'))(_0x2f1c('0x5'));var config=require(_0x2f1c('0x6'));var jayson=require(_0x2f1c('0x7'));var client=jayson[_0x2f1c('0x8')][_0x2f1c('0x9')]({'port':0x232a});config[_0x2f1c('0xa')]=_[_0x2f1c('0xb')](config[_0x2f1c('0xa')],{'host':_0x2f1c('0xc'),'port':0x18eb});var socket=require(_0x2f1c('0xd'))(new Redis(config[_0x2f1c('0xa')]));require(_0x2f1c('0xe'))['register'](socket);function respondWithRpcPromise(_0x124457,_0x57cae2,_0x584539){return new BPromise(function(_0x1ec54c,_0x265499){return client[_0x2f1c('0xf')](_0x124457,_0x584539)[_0x2f1c('0x10')](function(_0x3a349a){logger[_0x2f1c('0x11')](_0x2f1c('0x12'),_0x57cae2,_0x2f1c('0x13'));logger['debug'](_0x2f1c('0x14'),_0x57cae2,'request\x20sent',JSON[_0x2f1c('0x15')](_0x3a349a));if(_0x3a349a[_0x2f1c('0x16')]){if(_0x3a349a[_0x2f1c('0x16')][_0x2f1c('0x17')]===0x1f4){logger[_0x2f1c('0x16')]('WhatsappQueue,\x20%s,\x20%s',_0x57cae2,_0x3a349a[_0x2f1c('0x16')][_0x2f1c('0x18')]);return _0x265499(_0x3a349a[_0x2f1c('0x16')]['message']);}logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x57cae2,_0x3a349a['error'][_0x2f1c('0x18')]);return _0x1ec54c(_0x3a349a[_0x2f1c('0x16')][_0x2f1c('0x18')]);}else{logger[_0x2f1c('0x11')]('WhatsappQueue,\x20%s,\x20%s',_0x57cae2,'request\x20sent');_0x1ec54c(_0x3a349a['result']['message']);}})['catch'](function(_0x25efe8){logger[_0x2f1c('0x16')](_0x2f1c('0x12'),_0x57cae2,_0x25efe8);_0x265499(_0x25efe8);});});}exports[_0x2f1c('0x19')]=function(_0x319a92){var _0x3d82e3=this;return new Promise(function(_0x419a88,_0x86dbaa){return db[_0x2f1c('0x1a')]['findAll']({'raw':_0x319a92['options']?_0x319a92[_0x2f1c('0x1b')][_0x2f1c('0x1c')]===undefined?!![]:![]:!![],'where':_0x319a92[_0x2f1c('0x1b')]?_0x319a92[_0x2f1c('0x1b')][_0x2f1c('0x1d')]||null:null,'attributes':_0x319a92[_0x2f1c('0x1b')]?_0x319a92[_0x2f1c('0x1b')]['attributes']||null:null,'limit':_0x319a92[_0x2f1c('0x1b')]?_0x319a92['options'][_0x2f1c('0x1e')]||null:null,'include':_0x319a92[_0x2f1c('0x1b')]?_0x319a92[_0x2f1c('0x1b')][_0x2f1c('0x1f')]?_[_0x2f1c('0x20')](_0x319a92['options'][_0x2f1c('0x1f')],function(_0x2538d2){return{'model':db[_0x2538d2[_0x2f1c('0x21')]],'as':_0x2538d2['as'],'attributes':_0x2538d2[_0x2f1c('0x22')],'include':_0x2538d2[_0x2f1c('0x1f')]?_[_0x2f1c('0x20')](_0x2538d2['include'],function(_0x3ee5f6){return{'model':db[_0x3ee5f6['model']],'as':_0x3ee5f6['as'],'attributes':_0x3ee5f6[_0x2f1c('0x22')],'include':_0x3ee5f6[_0x2f1c('0x1f')]?_[_0x2f1c('0x20')](_0x3ee5f6['include'],function(_0x226d65){return{'model':db[_0x226d65[_0x2f1c('0x21')]],'as':_0x226d65['as'],'attributes':_0x226d65[_0x2f1c('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf05b40){logger[_0x2f1c('0x11')](_0x2f1c('0x19'),_0x319a92);logger[_0x2f1c('0x23')]('GetWhatsappQueue',_0x319a92,JSON[_0x2f1c('0x15')](_0xf05b40));_0x419a88(_0xf05b40);})['catch'](function(_0x43c9a0){logger[_0x2f1c('0x16')](_0x2f1c('0x19'),_0x43c9a0[_0x2f1c('0x18')],_0x319a92);_0x86dbaa(_0x3d82e3[_0x2f1c('0x16')](0x1f4,_0x43c9a0['message']));});});};exports[_0x2f1c('0x24')]=function(_0xb6652f){var _0x5f56ca=this;return new Promise(function(_0x7c88b4,_0x50a185){return db[_0x2f1c('0x1a')][_0x2f1c('0x25')]({'raw':_0xb6652f['options']?_0xb6652f[_0x2f1c('0x1b')][_0x2f1c('0x1c')]===undefined?!![]:![]:!![],'where':_0xb6652f[_0x2f1c('0x1b')]?_0xb6652f['options'][_0x2f1c('0x1d')]||null:null,'attributes':_0xb6652f[_0x2f1c('0x1b')]?_0xb6652f['options']['attributes']||null:null,'include':_0xb6652f[_0x2f1c('0x1b')]?_0xb6652f[_0x2f1c('0x1b')][_0x2f1c('0x1f')]?_[_0x2f1c('0x20')](_0xb6652f[_0x2f1c('0x1b')][_0x2f1c('0x1f')],function(_0x1ccd91){return{'model':db[_0x1ccd91['model']],'as':_0x1ccd91['as'],'attributes':_0x1ccd91[_0x2f1c('0x22')],'include':_0x1ccd91[_0x2f1c('0x1f')]?_[_0x2f1c('0x20')](_0x1ccd91[_0x2f1c('0x1f')],function(_0x2a5480){return{'model':db[_0x2a5480['model']],'as':_0x2a5480['as'],'attributes':_0x2a5480[_0x2f1c('0x22')],'include':_0x2a5480['include']?_[_0x2f1c('0x20')](_0x2a5480[_0x2f1c('0x1f')],function(_0x34976d){return{'model':db[_0x34976d[_0x2f1c('0x21')]],'as':_0x34976d['as'],'attributes':_0x34976d[_0x2f1c('0x22')]};}):[]};}):[]};}):[]:[]})[_0x2f1c('0x10')](function(_0x142232){logger[_0x2f1c('0x11')](_0x2f1c('0x24'),_0xb6652f);logger['debug']('ShowWhatsappQueue',_0xb6652f,JSON[_0x2f1c('0x15')](_0x142232));_0x7c88b4(_0x142232);})[_0x2f1c('0x26')](function(_0x2e9296){logger[_0x2f1c('0x16')](_0x2f1c('0x24'),_0x2e9296[_0x2f1c('0x18')],_0xb6652f);_0x50a185(_0x5f56ca[_0x2f1c('0x16')](0x1f4,_0x2e9296[_0x2f1c('0x18')]));});});}; \ No newline at end of file +var _0x91dd=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./whatsappQueue.socket','request','then','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','WhatsappQueue','findAll','options','raw','where','attributes','include','model','map','GetWhatsappQueue','ShowWhatsappQueue','find','moment'];(function(_0xd4cf1e,_0x1467a6){var _0x1940a9=function(_0x36e6df){while(--_0x36e6df){_0xd4cf1e['push'](_0xd4cf1e['shift']());}};_0x1940a9(++_0x1467a6);}(_0x91dd,0x171));var _0xd91d=function(_0x3b5895,_0x33d1d9){_0x3b5895=_0x3b5895-0x0;var _0xa2ce18=_0x91dd[_0x3b5895];return _0xa2ce18;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd91d('0x0'));var BPromise=require(_0xd91d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd91d('0x2'));var db=require(_0xd91d('0x3'))['db'];var utils=require(_0xd91d('0x4'));var logger=require(_0xd91d('0x5'))(_0xd91d('0x6'));var config=require(_0xd91d('0x7'));var jayson=require(_0xd91d('0x8'));var client=jayson[_0xd91d('0x9')][_0xd91d('0xa')]({'port':0x232a});config[_0xd91d('0xb')]=_['defaults'](config[_0xd91d('0xb')],{'host':_0xd91d('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd91d('0xb')]));require(_0xd91d('0xd'))['register'](socket);function respondWithRpcPromise(_0x32ed30,_0x3d1827,_0x3b85fc){return new BPromise(function(_0x453780,_0x1324c6){return client[_0xd91d('0xe')](_0x32ed30,_0x3b85fc)[_0xd91d('0xf')](function(_0x164846){logger['info'](_0xd91d('0x10'),_0x3d1827,_0xd91d('0x11'));logger[_0xd91d('0x12')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x3d1827,_0xd91d('0x11'),JSON[_0xd91d('0x13')](_0x164846));if(_0x164846[_0xd91d('0x14')]){if(_0x164846[_0xd91d('0x14')]['code']===0x1f4){logger['error'](_0xd91d('0x10'),_0x3d1827,_0x164846[_0xd91d('0x14')][_0xd91d('0x15')]);return _0x1324c6(_0x164846[_0xd91d('0x14')]['message']);}logger['error'](_0xd91d('0x10'),_0x3d1827,_0x164846[_0xd91d('0x14')][_0xd91d('0x15')]);return _0x453780(_0x164846['error'][_0xd91d('0x15')]);}else{logger[_0xd91d('0x16')](_0xd91d('0x10'),_0x3d1827,_0xd91d('0x11'));_0x453780(_0x164846[_0xd91d('0x17')][_0xd91d('0x15')]);}})[_0xd91d('0x18')](function(_0x9995ed){logger[_0xd91d('0x14')](_0xd91d('0x10'),_0x3d1827,_0x9995ed);_0x1324c6(_0x9995ed);});});}exports['GetWhatsappQueue']=function(_0x297944){var _0x4b9bf3=this;return new Promise(function(_0x2d6998,_0xc975a0){return db[_0xd91d('0x19')][_0xd91d('0x1a')]({'raw':_0x297944[_0xd91d('0x1b')]?_0x297944[_0xd91d('0x1b')][_0xd91d('0x1c')]===undefined?!![]:![]:!![],'where':_0x297944[_0xd91d('0x1b')]?_0x297944[_0xd91d('0x1b')][_0xd91d('0x1d')]||null:null,'attributes':_0x297944['options']?_0x297944['options'][_0xd91d('0x1e')]||null:null,'limit':_0x297944['options']?_0x297944[_0xd91d('0x1b')]['limit']||null:null,'include':_0x297944[_0xd91d('0x1b')]?_0x297944[_0xd91d('0x1b')][_0xd91d('0x1f')]?_['map'](_0x297944[_0xd91d('0x1b')][_0xd91d('0x1f')],function(_0x1b6343){return{'model':db[_0x1b6343['model']],'as':_0x1b6343['as'],'attributes':_0x1b6343[_0xd91d('0x1e')],'include':_0x1b6343[_0xd91d('0x1f')]?_['map'](_0x1b6343[_0xd91d('0x1f')],function(_0x3497db){return{'model':db[_0x3497db[_0xd91d('0x20')]],'as':_0x3497db['as'],'attributes':_0x3497db[_0xd91d('0x1e')],'include':_0x3497db['include']?_[_0xd91d('0x21')](_0x3497db[_0xd91d('0x1f')],function(_0x262010){return{'model':db[_0x262010[_0xd91d('0x20')]],'as':_0x262010['as'],'attributes':_0x262010[_0xd91d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xd91d('0xf')](function(_0x219fd7){logger['info']('GetWhatsappQueue',_0x297944);logger[_0xd91d('0x12')]('GetWhatsappQueue',_0x297944,JSON[_0xd91d('0x13')](_0x219fd7));_0x2d6998(_0x219fd7);})[_0xd91d('0x18')](function(_0x58d017){logger[_0xd91d('0x14')](_0xd91d('0x22'),_0x58d017[_0xd91d('0x15')],_0x297944);_0xc975a0(_0x4b9bf3['error'](0x1f4,_0x58d017[_0xd91d('0x15')]));});});};exports[_0xd91d('0x23')]=function(_0xe1a215){var _0x3263ff=this;return new Promise(function(_0x3623ca,_0x142162){return db[_0xd91d('0x19')][_0xd91d('0x24')]({'raw':_0xe1a215[_0xd91d('0x1b')]?_0xe1a215['options'][_0xd91d('0x1c')]===undefined?!![]:![]:!![],'where':_0xe1a215[_0xd91d('0x1b')]?_0xe1a215[_0xd91d('0x1b')][_0xd91d('0x1d')]||null:null,'attributes':_0xe1a215[_0xd91d('0x1b')]?_0xe1a215[_0xd91d('0x1b')][_0xd91d('0x1e')]||null:null,'include':_0xe1a215[_0xd91d('0x1b')]?_0xe1a215['options']['include']?_[_0xd91d('0x21')](_0xe1a215[_0xd91d('0x1b')][_0xd91d('0x1f')],function(_0x307bc8){return{'model':db[_0x307bc8[_0xd91d('0x20')]],'as':_0x307bc8['as'],'attributes':_0x307bc8[_0xd91d('0x1e')],'include':_0x307bc8[_0xd91d('0x1f')]?_[_0xd91d('0x21')](_0x307bc8[_0xd91d('0x1f')],function(_0x5d91e7){return{'model':db[_0x5d91e7['model']],'as':_0x5d91e7['as'],'attributes':_0x5d91e7[_0xd91d('0x1e')],'include':_0x5d91e7[_0xd91d('0x1f')]?_[_0xd91d('0x21')](_0x5d91e7[_0xd91d('0x1f')],function(_0x1e9d8e){return{'model':db[_0x1e9d8e['model']],'as':_0x1e9d8e['as'],'attributes':_0x1e9d8e[_0xd91d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xd91d('0xf')](function(_0xdb7216){logger['info'](_0xd91d('0x23'),_0xe1a215);logger[_0xd91d('0x12')](_0xd91d('0x23'),_0xe1a215,JSON[_0xd91d('0x13')](_0xdb7216));_0x3623ca(_0xdb7216);})[_0xd91d('0x18')](function(_0x5a5e97){logger[_0xd91d('0x14')](_0xd91d('0x23'),_0x5a5e97[_0xd91d('0x15')],_0xe1a215);_0x142162(_0x3263ff['error'](0x1f4,_0x5a5e97[_0xd91d('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 5a190f3..a862d6d 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 _0x1a7a=['length','whatsappQueue:','./whatsappQueue.events','save','remove','update','emit','register'];(function(_0x182ada,_0x18f1c5){var _0x1f2372=function(_0x87d7a0){while(--_0x87d7a0){_0x182ada['push'](_0x182ada['shift']());}};_0x1f2372(++_0x18f1c5);}(_0x1a7a,0x1e2));var _0xa1a7=function(_0x4bc532,_0x42f9c5){_0x4bc532=_0x4bc532-0x0;var _0x2b20f1=_0x1a7a[_0x4bc532];return _0x2b20f1;};'use strict';var WhatsappQueueEvents=require(_0xa1a7('0x0'));var events=[_0xa1a7('0x1'),_0xa1a7('0x2'),_0xa1a7('0x3')];function createListener(_0x333a33,_0x2c8db6){return function(_0x501ff6){_0x2c8db6[_0xa1a7('0x4')](_0x333a33,_0x501ff6);};}function removeListener(_0x143b84,_0x35973a){return function(){WhatsappQueueEvents['removeListener'](_0x143b84,_0x35973a);};}exports[_0xa1a7('0x5')]=function(_0x40aedd){for(var _0x4c2b3f=0x0,_0x17b28a=events[_0xa1a7('0x6')];_0x4c2b3f<_0x17b28a;_0x4c2b3f++){var _0x531181=events[_0x4c2b3f];var _0x53d611=createListener(_0xa1a7('0x7')+_0x531181,_0x40aedd);WhatsappQueueEvents['on'](_0x531181,_0x53d611);}}; \ No newline at end of file +var _0xfc50=['length','./whatsappQueue.events','save','remove','emit','removeListener','register'];(function(_0x132538,_0x4c4cbd){var _0x4c5012=function(_0x28513c){while(--_0x28513c){_0x132538['push'](_0x132538['shift']());}};_0x4c5012(++_0x4c4cbd);}(_0xfc50,0x1c8));var _0x0fc5=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xfc50[_0x6131cd];return _0x47e916;};'use strict';var WhatsappQueueEvents=require(_0x0fc5('0x0'));var events=[_0x0fc5('0x1'),_0x0fc5('0x2'),'update'];function createListener(_0x24080f,_0x215f17){return function(_0x35af3f){_0x215f17[_0x0fc5('0x3')](_0x24080f,_0x35af3f);};}function removeListener(_0x3f4404,_0x3d162c){return function(){WhatsappQueueEvents[_0x0fc5('0x4')](_0x3f4404,_0x3d162c);};}exports[_0x0fc5('0x5')]=function(_0x250923){for(var _0x3d5847=0x0,_0x10d597=events[_0x0fc5('0x6')];_0x3d5847<_0x10d597;_0x3d5847++){var _0x292dc8=events[_0x3d5847];var _0x48c49e=createListener('whatsappQueue:'+_0x292dc8,_0x250923);WhatsappQueueEvents['on'](_0x292dc8,_0x48c49e);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 2819f23..ad190b8 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 _0x892c=['path','connect-timeout','fs-extra','../../components/interaction/service','./whatsappQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer'];(function(_0x3eaf7e,_0x261237){var _0x2e38d6=function(_0x5f4075){while(--_0x5f4075){_0x3eaf7e['push'](_0x3eaf7e['shift']());}};_0x2e38d6(++_0x261237);}(_0x892c,0x12f));var _0xc892=function(_0x3ba00e,_0xbd1c3d){_0x3ba00e=_0x3ba00e-0x0;var _0x33cb79=_0x892c[_0x3ba00e];return _0x33cb79;};'use strict';var multer=require(_0xc892('0x0'));var util=require('util');var path=require(_0xc892('0x1'));var timeout=require(_0xc892('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc892('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xc892('0x4'));var config=require('../../config/environment');var controller=require(_0xc892('0x5'));router['get']('/',auth[_0xc892('0x6')](),controller[_0xc892('0x7')]);router[_0xc892('0x8')](_0xc892('0x9'),auth[_0xc892('0x6')](),controller[_0xc892('0xa')]);router[_0xc892('0x8')](_0xc892('0xb'),auth['isAuthenticated'](),controller[_0xc892('0xc')]);router[_0xc892('0xd')]('/',auth[_0xc892('0x6')](),controller[_0xc892('0xe')]);router[_0xc892('0xf')](_0xc892('0xb'),auth[_0xc892('0x6')](),controller[_0xc892('0x10')]);router['delete'](_0xc892('0xb'),auth[_0xc892('0x6')](),controller[_0xc892('0x11')]);module[_0xc892('0x12')]=router; \ No newline at end of file +var _0x3c52=['post','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/:id','show'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0x3c52,0xa5));var _0x23c5=function(_0x189c04,_0x1ff750){_0x189c04=_0x189c04-0x0;var _0x5735e6=_0x3c52[_0x189c04];return _0x5735e6;};'use strict';var multer=require(_0x23c5('0x0'));var util=require(_0x23c5('0x1'));var path=require(_0x23c5('0x2'));var timeout=require(_0x23c5('0x3'));var express=require(_0x23c5('0x4'));var router=express[_0x23c5('0x5')]();var fs_extra=require(_0x23c5('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x23c5('0x7'));var config=require(_0x23c5('0x8'));var controller=require(_0x23c5('0x9'));router[_0x23c5('0xa')]('/',auth[_0x23c5('0xb')](),controller[_0x23c5('0xc')]);router['get']('/describe',auth[_0x23c5('0xb')](),controller['describe']);router['get'](_0x23c5('0xd'),auth[_0x23c5('0xb')](),controller[_0x23c5('0xe')]);router[_0x23c5('0xf')]('/',auth[_0x23c5('0xb')](),controller[_0x23c5('0x10')]);router['put'](_0x23c5('0xd'),auth[_0x23c5('0xb')](),controller[_0x23c5('0x11')]);router['delete'](_0x23c5('0xd'),auth[_0x23c5('0xb')](),controller[_0x23c5('0x12')]);module[_0x23c5('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index eb7b7d2..d3e0c04 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x1cb362,_0xd28fae){var _0xaef9e6=function(_0x423c85){while(--_0x423c85){_0x1cb362['push'](_0x1cb362['shift']());}};_0xaef9e6(++_0xd28fae);}(_0x7a54,0x106));var _0x47a5=function(_0x4ace6a,_0x5c0e7e){_0x4ace6a=_0x4ace6a-0x0;var _0x5a0359=_0x7a54[_0x4ace6a];return _0x5a0359;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x4cd49f,_0x35cfb1){var _0x843fd3=function(_0x427659){while(--_0x427659){_0x4cd49f['push'](_0x4cd49f['shift']());}};_0x843fd3(++_0x35cfb1);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index a84bedd..1a9fd9a 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(_0x3bad67,_0x6b3dcd){var _0x4c9f8c=function(_0x44d853){while(--_0x44d853){_0x3bad67['push'](_0x3bad67['shift']());}};_0x4c9f8c(++_0x6b3dcd);}(_0x69d3,0xda));var _0x369d=function(_0x46cc62,_0x428b8a){_0x46cc62=_0x46cc62-0x0;var _0x31397d=_0x69d3[_0x46cc62];return _0x31397d;};'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 _0xae60=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','index','WhatsappQueueReport','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x11f640,_0x482aa3){var _0x3f6283=function(_0x1923a8){while(--_0x1923a8){_0x11f640['push'](_0x11f640['shift']());}};_0x3f6283(++_0x482aa3);}(_0xae60,0x1c7));var _0x0ae6=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xae60[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0x0ae6('0x0'));var rimraf=require(_0x0ae6('0x1'));var zipdir=require(_0x0ae6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0ae6('0x3'));var moment=require(_0x0ae6('0x4'));var BPromise=require(_0x0ae6('0x5'));var Mustache=require('mustache');var util=require(_0x0ae6('0x6'));var path=require(_0x0ae6('0x7'));var sox=require('sox');var csv=require(_0x0ae6('0x8'));var ejs=require(_0x0ae6('0x9'));var fs=require('fs');var fs_extra=require(_0x0ae6('0xa'));var _=require(_0x0ae6('0xb'));var squel=require(_0x0ae6('0xc'));var crypto=require(_0x0ae6('0xd'));var jsforce=require(_0x0ae6('0xe'));var deskjs=require(_0x0ae6('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0ae6('0x10'));var Papa=require(_0x0ae6('0x11'));var Redis=require(_0x0ae6('0x12'));var authService=require(_0x0ae6('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0ae6('0x14'));var hardwareService=require(_0x0ae6('0x15'));var logger=require(_0x0ae6('0x16'))(_0x0ae6('0x17'));var utils=require(_0x0ae6('0x18'));var config=require(_0x0ae6('0x19'));var licenseUtil=require(_0x0ae6('0x1a'));var db=require(_0x0ae6('0x1b'))['db'];function respondWithStatusCode(_0x3b05a4,_0x30f8f9){_0x30f8f9=_0x30f8f9||0xcc;return function(_0x1aefd5){if(_0x1aefd5){return _0x3b05a4[_0x0ae6('0x1c')](_0x30f8f9);}return _0x3b05a4[_0x0ae6('0x1d')](_0x30f8f9)[_0x0ae6('0x1e')]();};}function respondWithResult(_0x4d2da8,_0x3809c6){_0x3809c6=_0x3809c6||0xc8;return function(_0x10c3bc){if(_0x10c3bc){return _0x4d2da8[_0x0ae6('0x1d')](_0x3809c6)[_0x0ae6('0x1f')](_0x10c3bc);}};}function respondWithFilteredResult(_0xce3e23,_0x3a1e26){return function(_0x151144){if(_0x151144){var _0x3b64ac=typeof _0x3a1e26[_0x0ae6('0x20')]===_0x0ae6('0x21')&&typeof _0x3a1e26[_0x0ae6('0x22')]===_0x0ae6('0x21');var _0xa97151=_0x151144[_0x0ae6('0x23')];var _0xda4f01=_0x3b64ac?0x0:_0x3a1e26[_0x0ae6('0x20')];var _0x2fdf25=_0x3b64ac?_0x151144[_0x0ae6('0x23')]:_0x3a1e26[_0x0ae6('0x20')]+_0x3a1e26[_0x0ae6('0x22')];var _0x26b369;if(_0x2fdf25>=_0xa97151){_0x2fdf25=_0xa97151;_0x26b369=0xc8;}else{_0x26b369=0xce;}_0xce3e23[_0x0ae6('0x1d')](_0x26b369);return _0xce3e23['set'](_0x0ae6('0x24'),_0xda4f01+'-'+_0x2fdf25+'/'+_0xa97151)[_0x0ae6('0x1f')](_0x151144);}return null;};}function patchUpdates(_0x140a3b){return function(_0x1027c2){try{jsonpatch[_0x0ae6('0x25')](_0x1027c2,_0x140a3b,!![]);}catch(_0xb4e6af){return BPromise[_0x0ae6('0x26')](_0xb4e6af);}return _0x1027c2[_0x0ae6('0x27')]();};}function saveUpdates(_0x515f3d,_0x39b22e){return function(_0x2a6484){if(_0x2a6484){return _0x2a6484[_0x0ae6('0x28')](_0x515f3d)[_0x0ae6('0x29')](function(_0x31ad85){return _0x31ad85;});}return null;};}function removeEntity(_0x4eba72,_0x296a9d){return function(_0x4e1242){if(_0x4e1242){return _0x4e1242[_0x0ae6('0x2a')]()[_0x0ae6('0x29')](function(){_0x4eba72[_0x0ae6('0x1d')](0xcc)[_0x0ae6('0x1e')]();});}};}function handleEntityNotFound(_0x5b86fe,_0x3630e6){return function(_0x2dcdb7){if(!_0x2dcdb7){_0x5b86fe['sendStatus'](0x194);}return _0x2dcdb7;};}function handleError(_0x55dbe1,_0x44eb95){_0x44eb95=_0x44eb95||0x1f4;return function(_0x3255a7){logger[_0x0ae6('0x2b')](_0x3255a7['stack']);if(_0x3255a7[_0x0ae6('0x2c')]){delete _0x3255a7[_0x0ae6('0x2c')];}_0x55dbe1[_0x0ae6('0x1d')](_0x44eb95)['send'](_0x3255a7);};}exports[_0x0ae6('0x2d')]=function(_0x29fef3,_0x449c33){var _0x232fbd={},_0x14eed5={},_0x257af5={'count':0x0,'rows':[]};var _0x4fc7bd=_['map'](db[_0x0ae6('0x2e')][_0x0ae6('0x2f')],function(_0x4e6df8){return{'name':_0x4e6df8['fieldName'],'type':_0x4e6df8[_0x0ae6('0x30')][_0x0ae6('0x31')]};});_0x14eed5[_0x0ae6('0x32')]=_[_0x0ae6('0x33')](_0x4fc7bd,'name');_0x14eed5[_0x0ae6('0x34')]=_[_0x0ae6('0x35')](_0x29fef3[_0x0ae6('0x34')]);_0x14eed5['filters']=_[_0x0ae6('0x36')](_0x14eed5[_0x0ae6('0x32')],_0x14eed5[_0x0ae6('0x34')]);_0x232fbd[_0x0ae6('0x37')]=_[_0x0ae6('0x36')](_0x14eed5[_0x0ae6('0x32')],qs[_0x0ae6('0x38')](_0x29fef3[_0x0ae6('0x34')][_0x0ae6('0x38')]));_0x232fbd[_0x0ae6('0x37')]=_0x232fbd['attributes'][_0x0ae6('0x39')]?_0x232fbd[_0x0ae6('0x37')]:_0x14eed5['model'];if(!_0x29fef3[_0x0ae6('0x34')][_0x0ae6('0x3a')](_0x0ae6('0x3b'))){_0x232fbd['limit']=qs[_0x0ae6('0x22')](_0x29fef3['query']['limit']);_0x232fbd[_0x0ae6('0x20')]=qs[_0x0ae6('0x20')](_0x29fef3[_0x0ae6('0x34')][_0x0ae6('0x20')]);}_0x232fbd[_0x0ae6('0x3c')]=qs['sort'](_0x29fef3['query'][_0x0ae6('0x3d')]);_0x232fbd['where']=qs[_0x0ae6('0x3e')](_['pick'](_0x29fef3[_0x0ae6('0x34')],_0x14eed5['filters']),_0x4fc7bd);if(_0x29fef3[_0x0ae6('0x34')][_0x0ae6('0x3f')]){_0x232fbd[_0x0ae6('0x40')]=_[_0x0ae6('0x41')](_0x232fbd['where'],{'$or':_['map'](_0x4fc7bd,function(_0x43414c){if(_0x43414c[_0x0ae6('0x30')]!==_0x0ae6('0x42')){var _0x59480a={};_0x59480a[_0x43414c[_0x0ae6('0x2c')]]={'$like':'%'+_0x29fef3['query'][_0x0ae6('0x3f')]+'%'};return _0x59480a;}})});}_0x232fbd=_[_0x0ae6('0x41')]({},_0x232fbd,_0x29fef3[_0x0ae6('0x43')]);var _0x19403c={'where':_0x232fbd[_0x0ae6('0x40')]};return db[_0x0ae6('0x2e')]['count'](_0x19403c)[_0x0ae6('0x29')](function(_0x601ef9){_0x257af5[_0x0ae6('0x23')]=_0x601ef9;if(_0x29fef3[_0x0ae6('0x34')][_0x0ae6('0x44')]){_0x232fbd[_0x0ae6('0x45')]=[{'all':!![]}];}return db[_0x0ae6('0x2e')][_0x0ae6('0x46')](_0x232fbd);})['then'](function(_0x38faeb){_0x257af5[_0x0ae6('0x47')]=_0x38faeb;return _0x257af5;})[_0x0ae6('0x29')](respondWithFilteredResult(_0x449c33,_0x232fbd))[_0x0ae6('0x48')](handleError(_0x449c33,null));};exports[_0x0ae6('0x49')]=function(_0x167ed1,_0x24c021){var _0x21431e={'raw':!![],'where':{'id':_0x167ed1[_0x0ae6('0x4a')]['id']}},_0xb38cbb={};_0xb38cbb[_0x0ae6('0x32')]=_[_0x0ae6('0x35')](db[_0x0ae6('0x2e')][_0x0ae6('0x2f')]);_0xb38cbb[_0x0ae6('0x34')]=_[_0x0ae6('0x35')](_0x167ed1[_0x0ae6('0x34')]);_0xb38cbb[_0x0ae6('0x3e')]=_['intersection'](_0xb38cbb[_0x0ae6('0x32')],_0xb38cbb[_0x0ae6('0x34')]);_0x21431e[_0x0ae6('0x37')]=_[_0x0ae6('0x36')](_0xb38cbb[_0x0ae6('0x32')],qs[_0x0ae6('0x38')](_0x167ed1['query'][_0x0ae6('0x38')]));_0x21431e[_0x0ae6('0x37')]=_0x21431e[_0x0ae6('0x37')][_0x0ae6('0x39')]?_0x21431e['attributes']:_0xb38cbb['model'];if(_0x167ed1['query'][_0x0ae6('0x44')]){_0x21431e[_0x0ae6('0x45')]=[{'all':!![]}];}_0x21431e=_[_0x0ae6('0x41')]({},_0x21431e,_0x167ed1['options']);return db[_0x0ae6('0x2e')][_0x0ae6('0x4b')](_0x21431e)['then'](handleEntityNotFound(_0x24c021,null))[_0x0ae6('0x29')](respondWithResult(_0x24c021,null))[_0x0ae6('0x48')](handleError(_0x24c021,null));};exports['create']=function(_0x354efd,_0x3d1e75){return db['WhatsappQueueReport'][_0x0ae6('0x4c')](_0x354efd[_0x0ae6('0x4d')],{})[_0x0ae6('0x29')](respondWithResult(_0x3d1e75,0xc9))['catch'](handleError(_0x3d1e75,null));};exports[_0x0ae6('0x28')]=function(_0x21de54,_0x46075a){if(_0x21de54[_0x0ae6('0x4d')]['id']){delete _0x21de54[_0x0ae6('0x4d')]['id'];}return db[_0x0ae6('0x2e')][_0x0ae6('0x4b')]({'where':{'id':_0x21de54['params']['id']}})['then'](handleEntityNotFound(_0x46075a,null))[_0x0ae6('0x29')](saveUpdates(_0x21de54[_0x0ae6('0x4d')],null))[_0x0ae6('0x29')](respondWithResult(_0x46075a,null))['catch'](handleError(_0x46075a,null));};exports[_0x0ae6('0x2a')]=function(_0x51df5c,_0x582a5e){return db[_0x0ae6('0x2e')][_0x0ae6('0x4b')]({'where':{'id':_0x51df5c[_0x0ae6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x582a5e,null))[_0x0ae6('0x29')](removeEntity(_0x582a5e,null))[_0x0ae6('0x48')](handleError(_0x582a5e,null));};exports[_0x0ae6('0x4e')]=function(_0x327b55,_0x173acd){return db[_0x0ae6('0x2e')][_0x0ae6('0x4e')]()[_0x0ae6('0x29')](respondWithResult(_0x173acd,null))[_0x0ae6('0x48')](handleError(_0x173acd,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 48c50fb..636f750 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 _0xc49b=['report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./whatsappQueueReport.attributes','exports','WhatsappQueueReport'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xc49b,0x19a));var _0xbc49=function(_0x455aed,_0x1eefd2){_0x455aed=_0x455aed-0x0;var _0xfc3a2a=_0xc49b[_0x455aed];return _0xfc3a2a;};'use strict';var _=require(_0xbc49('0x0'));var util=require(_0xbc49('0x1'));var logger=require(_0xbc49('0x2'))(_0xbc49('0x3'));var moment=require(_0xbc49('0x4'));var BPromise=require(_0xbc49('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbc49('0x6'));var config=require('../../config/environment');var attributes=require(_0xbc49('0x7'));module[_0xbc49('0x8')]=function(_0x5c4168,_0x56d6b3){return _0x5c4168['define'](_0xbc49('0x9'),attributes,{'tableName':_0xbc49('0xa'),'paranoid':![],'indexes':[{'name':_0xbc49('0xb'),'fields':[_0xbc49('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8bde=['uniqueid','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define','report_whatsapp_queue'];(function(_0x5b012e,_0x5cb94c){var _0xd6daf0=function(_0x1e9d33){while(--_0x1e9d33){_0x5b012e['push'](_0x5b012e['shift']());}};_0xd6daf0(++_0x5cb94c);}(_0x8bde,0x169));var _0xe8bd=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x8bde[_0x4fde08];return _0x12e725;};'use strict';var _=require('lodash');var util=require(_0xe8bd('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xe8bd('0x1'));var BPromise=require(_0xe8bd('0x2'));var rp=require(_0xe8bd('0x3'));var fs=require('fs');var path=require(_0xe8bd('0x4'));var rimraf=require(_0xe8bd('0x5'));var config=require(_0xe8bd('0x6'));var attributes=require(_0xe8bd('0x7'));module[_0xe8bd('0x8')]=function(_0x104cb4,_0x5dcde6){return _0x104cb4[_0xe8bd('0x9')]('WhatsappQueueReport',attributes,{'tableName':_0xe8bd('0xa'),'paranoid':![],'indexes':[{'name':_0xe8bd('0xb'),'fields':[_0xe8bd('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 6a19732..5abdaf3 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 _0x8062=['UpdateWhatsappQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','WhatsappQueueReport,\x20%s,\x20%s','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','then','update','where','limit'];(function(_0xecf3cb,_0x289cfc){var _0x59f179=function(_0x3f9187){while(--_0x3f9187){_0xecf3cb['push'](_0xecf3cb['shift']());}};_0x59f179(++_0x289cfc);}(_0x8062,0x109));var _0x2806=function(_0x7b4397,_0x50ab04){_0x7b4397=_0x7b4397-0x0;var _0x16de0b=_0x8062[_0x7b4397];return _0x16de0b;};'use strict';var _=require(_0x2806('0x0'));var util=require('util');var moment=require(_0x2806('0x1'));var BPromise=require(_0x2806('0x2'));var rs=require(_0x2806('0x3'));var fs=require('fs');var Redis=require(_0x2806('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2806('0x5'));var logger=require(_0x2806('0x6'))(_0x2806('0x7'));var config=require(_0x2806('0x8'));var jayson=require(_0x2806('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x24577f,_0xcb00b3,_0x4963fe){return new BPromise(function(_0x3db7ad,_0x13f70b){return client[_0x2806('0xa')](_0x24577f,_0x4963fe)['then'](function(_0x94e78f){logger[_0x2806('0xb')](_0x2806('0xc'),_0xcb00b3,'request\x20sent');logger[_0x2806('0xd')](_0x2806('0xe'),_0xcb00b3,_0x2806('0xf'),JSON[_0x2806('0x10')](_0x94e78f));if(_0x94e78f[_0x2806('0x11')]){if(_0x94e78f['error'][_0x2806('0x12')]===0x1f4){logger[_0x2806('0x11')](_0x2806('0xc'),_0xcb00b3,_0x94e78f['error'][_0x2806('0x13')]);return _0x13f70b(_0x94e78f[_0x2806('0x11')][_0x2806('0x13')]);}logger[_0x2806('0x11')](_0x2806('0xc'),_0xcb00b3,_0x94e78f['error']['message']);return _0x3db7ad(_0x94e78f['error']['message']);}else{logger[_0x2806('0xb')]('WhatsappQueueReport,\x20%s,\x20%s',_0xcb00b3,_0x2806('0xf'));_0x3db7ad(_0x94e78f[_0x2806('0x14')][_0x2806('0x13')]);}})[_0x2806('0x15')](function(_0x16f48a){logger[_0x2806('0x11')](_0x2806('0xc'),_0xcb00b3,_0x16f48a);_0x13f70b(_0x16f48a);});});}exports[_0x2806('0x16')]=function(_0x19dd33){var _0x3873f6=this;return new Promise(function(_0x4fafbf,_0x5cfad0){return db[_0x2806('0x17')][_0x2806('0x18')](_0x19dd33[_0x2806('0x19')],{'raw':_0x19dd33[_0x2806('0x1a')]?_0x19dd33[_0x2806('0x1a')][_0x2806('0x1b')]===undefined?!![]:![]:!![]})[_0x2806('0x1c')](function(_0x38f774){logger['info'](_0x2806('0x16'),_0x19dd33);logger['debug'](_0x2806('0x16'),_0x19dd33,JSON[_0x2806('0x10')](_0x38f774));_0x4fafbf(_0x38f774);})[_0x2806('0x15')](function(_0x5367dc){logger[_0x2806('0x11')]('CreateWhatsappQueueReport',_0x5367dc[_0x2806('0x13')],_0x19dd33);_0x5cfad0(_0x3873f6[_0x2806('0x11')](0x1f4,_0x5367dc[_0x2806('0x13')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x13cd11){var _0x3b2b43=this;return new Promise(function(_0x1071d9,_0x14a609){return db[_0x2806('0x17')][_0x2806('0x1d')](_0x13cd11['body'],{'raw':_0x13cd11[_0x2806('0x1a')]?_0x13cd11['options'][_0x2806('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13cd11[_0x2806('0x1a')]?_0x13cd11[_0x2806('0x1a')][_0x2806('0x1e')]||null:null,'attributes':_0x13cd11[_0x2806('0x1a')]?_0x13cd11[_0x2806('0x1a')]['attributes']||null:null,'limit':_0x13cd11['options']?_0x13cd11[_0x2806('0x1a')][_0x2806('0x1f')]||null:null})[_0x2806('0x1c')](function(_0x120b77){logger[_0x2806('0xb')](_0x2806('0x20'),_0x13cd11);logger['debug']('UpdateWhatsappQueueReport',_0x13cd11,JSON['stringify'](_0x120b77));_0x1071d9(_0x120b77);})[_0x2806('0x15')](function(_0x8bada){logger['error'](_0x2806('0x20'),_0x8bada[_0x2806('0x13')],_0x13cd11);_0x14a609(_0x3b2b43['error'](0x1f4,_0x8bada[_0x2806('0x13')]));});});}; \ No newline at end of file +var _0x10a9=['stringify','error','code','message','info','request\x20sent','result','catch','WhatsappQueueReport','create','options','then','CreateWhatsappQueueReport','update','where','attributes','limit','UpdateWhatsappQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','WhatsappQueueReport,\x20%s,\x20%s','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x1a06c7,_0x7a82f7){var _0x464d01=function(_0x4500ad){while(--_0x4500ad){_0x1a06c7['push'](_0x1a06c7['shift']());}};_0x464d01(++_0x7a82f7);}(_0x10a9,0xb7));var _0x910a=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x10a9[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x910a('0x0'));var util=require(_0x910a('0x1'));var moment=require(_0x910a('0x2'));var BPromise=require(_0x910a('0x3'));var rs=require(_0x910a('0x4'));var fs=require('fs');var Redis=require(_0x910a('0x5'));var db=require(_0x910a('0x6'))['db'];var utils=require(_0x910a('0x7'));var logger=require('../../config/logger')(_0x910a('0x8'));var config=require(_0x910a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x910a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2138e4,_0x112bc6,_0x454fa5){return new BPromise(function(_0x5bcd73,_0xa08d68){return client[_0x910a('0xb')](_0x2138e4,_0x454fa5)['then'](function(_0x597bd4){logger['info'](_0x910a('0xc'),_0x112bc6,'request\x20sent');logger[_0x910a('0xd')](_0x910a('0xe'),_0x112bc6,'request\x20sent',JSON[_0x910a('0xf')](_0x597bd4));if(_0x597bd4[_0x910a('0x10')]){if(_0x597bd4[_0x910a('0x10')][_0x910a('0x11')]===0x1f4){logger[_0x910a('0x10')](_0x910a('0xc'),_0x112bc6,_0x597bd4[_0x910a('0x10')]['message']);return _0xa08d68(_0x597bd4[_0x910a('0x10')][_0x910a('0x12')]);}logger[_0x910a('0x10')](_0x910a('0xc'),_0x112bc6,_0x597bd4[_0x910a('0x10')][_0x910a('0x12')]);return _0x5bcd73(_0x597bd4['error'][_0x910a('0x12')]);}else{logger[_0x910a('0x13')](_0x910a('0xc'),_0x112bc6,_0x910a('0x14'));_0x5bcd73(_0x597bd4[_0x910a('0x15')][_0x910a('0x12')]);}})[_0x910a('0x16')](function(_0x5a1c24){logger[_0x910a('0x10')](_0x910a('0xc'),_0x112bc6,_0x5a1c24);_0xa08d68(_0x5a1c24);});});}exports['CreateWhatsappQueueReport']=function(_0xad6c1f){var _0x283f59=this;return new Promise(function(_0x37c790,_0x2438ba){return db[_0x910a('0x17')][_0x910a('0x18')](_0xad6c1f['body'],{'raw':_0xad6c1f[_0x910a('0x19')]?_0xad6c1f[_0x910a('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x910a('0x1a')](function(_0x1b9533){logger[_0x910a('0x13')]('CreateWhatsappQueueReport',_0xad6c1f);logger[_0x910a('0xd')]('CreateWhatsappQueueReport',_0xad6c1f,JSON[_0x910a('0xf')](_0x1b9533));_0x37c790(_0x1b9533);})[_0x910a('0x16')](function(_0x236730){logger[_0x910a('0x10')](_0x910a('0x1b'),_0x236730[_0x910a('0x12')],_0xad6c1f);_0x2438ba(_0x283f59[_0x910a('0x10')](0x1f4,_0x236730[_0x910a('0x12')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x96f84c){var _0x1739d7=this;return new Promise(function(_0x2d05b7,_0x1a6dbc){return db[_0x910a('0x17')][_0x910a('0x1c')](_0x96f84c['body'],{'raw':_0x96f84c[_0x910a('0x19')]?_0x96f84c['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x96f84c[_0x910a('0x19')]?_0x96f84c[_0x910a('0x19')][_0x910a('0x1d')]||null:null,'attributes':_0x96f84c[_0x910a('0x19')]?_0x96f84c[_0x910a('0x19')][_0x910a('0x1e')]||null:null,'limit':_0x96f84c['options']?_0x96f84c[_0x910a('0x19')][_0x910a('0x1f')]||null:null})['then'](function(_0xec2821){logger[_0x910a('0x13')](_0x910a('0x20'),_0x96f84c);logger[_0x910a('0xd')](_0x910a('0x20'),_0x96f84c,JSON[_0x910a('0xf')](_0xec2821));_0x2d05b7(_0xec2821);})['catch'](function(_0x4ff706){logger[_0x910a('0x10')](_0x910a('0x20'),_0x4ff706[_0x910a('0x12')],_0x96f84c);_0x1a6dbc(_0x1739d7['error'](0x1f4,_0x4ff706[_0x910a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 1d36ccf..4914ce1 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 _0x8b51=['show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./whatsappTransferReport.controller','get','/describe','isAuthenticated','describe','/:id'];(function(_0x1be30a,_0x2f13de){var _0x44604c=function(_0x205ea2){while(--_0x205ea2){_0x1be30a['push'](_0x1be30a['shift']());}};_0x44604c(++_0x2f13de);}(_0x8b51,0x1e7));var _0x18b5=function(_0xdd59a8,_0x53026d){_0xdd59a8=_0xdd59a8-0x0;var _0x5dc7ff=_0x8b51[_0xdd59a8];return _0x5dc7ff;};'use strict';var multer=require(_0x18b5('0x0'));var util=require(_0x18b5('0x1'));var path=require(_0x18b5('0x2'));var timeout=require(_0x18b5('0x3'));var express=require(_0x18b5('0x4'));var router=express['Router']();var fs_extra=require(_0x18b5('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x18b5('0x6'));var controller=require(_0x18b5('0x7'));router[_0x18b5('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x18b5('0x8')](_0x18b5('0x9'),auth[_0x18b5('0xa')](),controller[_0x18b5('0xb')]);router[_0x18b5('0x8')](_0x18b5('0xc'),auth[_0x18b5('0xa')](),controller[_0x18b5('0xd')]);router[_0x18b5('0xe')]('/',auth[_0x18b5('0xa')](),controller[_0x18b5('0xf')]);router[_0x18b5('0x10')](_0x18b5('0xc'),auth[_0x18b5('0xa')](),controller['update']);router[_0x18b5('0x11')](_0x18b5('0xc'),auth[_0x18b5('0xa')](),controller[_0x18b5('0x12')]);module[_0x18b5('0x13')]=router; \ No newline at end of file +var _0x4b58=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0xc7f885,_0x1f8b90){var _0x2e146c=function(_0x48b8ec){while(--_0x48b8ec){_0xc7f885['push'](_0xc7f885['shift']());}};_0x2e146c(++_0x1f8b90);}(_0x4b58,0x67));var _0x84b5=function(_0x2e8dd7,_0x2d334e){_0x2e8dd7=_0x2e8dd7-0x0;var _0x164ddb=_0x4b58[_0x2e8dd7];return _0x164ddb;};'use strict';var multer=require(_0x84b5('0x0'));var util=require(_0x84b5('0x1'));var path=require(_0x84b5('0x2'));var timeout=require(_0x84b5('0x3'));var express=require(_0x84b5('0x4'));var router=express[_0x84b5('0x5')]();var fs_extra=require(_0x84b5('0x6'));var auth=require(_0x84b5('0x7'));var interaction=require(_0x84b5('0x8'));var config=require(_0x84b5('0x9'));var controller=require('./whatsappTransferReport.controller');router[_0x84b5('0xa')]('/',auth[_0x84b5('0xb')](),controller['index']);router['get'](_0x84b5('0xc'),auth[_0x84b5('0xb')](),controller[_0x84b5('0xd')]);router[_0x84b5('0xa')](_0x84b5('0xe'),auth[_0x84b5('0xb')](),controller[_0x84b5('0xf')]);router[_0x84b5('0x10')]('/',auth[_0x84b5('0xb')](),controller[_0x84b5('0x11')]);router['put'](_0x84b5('0xe'),auth[_0x84b5('0xb')](),controller[_0x84b5('0x12')]);router[_0x84b5('0x13')](_0x84b5('0xe'),auth[_0x84b5('0xb')](),controller[_0x84b5('0x14')]);module[_0x84b5('0x15')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 29a4086..a62c7ae 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 _0x4cdf=['exports','STRING','ENUM','account','agent','DATE','sequelize'];(function(_0x11c716,_0x52d5e6){var _0x11fbb1=function(_0x188a3d){while(--_0x188a3d){_0x11c716['push'](_0x11c716['shift']());}};_0x11fbb1(++_0x52d5e6);}(_0x4cdf,0x180));var _0xf4cd=function(_0xf35981,_0x309063){_0xf35981=_0xf35981-0x0;var _0x19fb26=_0x4cdf[_0xf35981];return _0x19fb26;};'use strict';var Sequelize=require(_0xf4cd('0x0'));module[_0xf4cd('0x1')]={'uniqueid':{'type':Sequelize[_0xf4cd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf4cd('0x3')](_0xf4cd('0x4'),_0xf4cd('0x5'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xf4cd('0x6')]}}; \ No newline at end of file +var _0x8814=['sequelize','ENUM','agent','queue','DATE'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x8814,0x1b8));var _0x4881=function(_0x3b5ad9,_0x223867){_0x3b5ad9=_0x3b5ad9-0x0;var _0x611ae9=_0x8814[_0x3b5ad9];return _0x611ae9;};'use strict';var Sequelize=require(_0x4881('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x4881('0x1')]('account',_0x4881('0x2'),_0x4881('0x3')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x4881('0x4')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index d780854..3696203 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 _0xd3d3=['jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','map','WhatsappTransferReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','name','merge','include','rows','catch','show','params','rawAttributes','options','create','body','find','destroy','describe','zip-dir','fast-json-patch','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto'];(function(_0x310eb9,_0x1aed15){var _0x28915c=function(_0x457fd6){while(--_0x457fd6){_0x310eb9['push'](_0x310eb9['shift']());}};_0x28915c(++_0x1aed15);}(_0xd3d3,0x19a));var _0x3d3d=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xd3d3[_0x16b9ed];return _0x66b1f8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3d3d('0x0'));var jsonpatch=require(_0x3d3d('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3d3d('0x2'));var util=require(_0x3d3d('0x3'));var path=require(_0x3d3d('0x4'));var sox=require('sox');var csv=require(_0x3d3d('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3d3d('0x6'));var _=require(_0x3d3d('0x7'));var squel=require(_0x3d3d('0x8'));var crypto=require(_0x3d3d('0x9'));var jsforce=require(_0x3d3d('0xa'));var deskjs=require(_0x3d3d('0xb'));var toCsv=require(_0x3d3d('0x5'));var querystring=require('querystring');var Papa=require(_0x3d3d('0xc'));var Redis=require(_0x3d3d('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x3d3d('0xe'));var as=require(_0x3d3d('0xf'));var hardwareService=require(_0x3d3d('0x10'));var logger=require(_0x3d3d('0x11'))(_0x3d3d('0x12'));var utils=require(_0x3d3d('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x3d3d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1cb5f3,_0xe37fe6){_0xe37fe6=_0xe37fe6||0xcc;return function(_0x12cef1){if(_0x12cef1){return _0x1cb5f3['sendStatus'](_0xe37fe6);}return _0x1cb5f3[_0x3d3d('0x15')](_0xe37fe6)[_0x3d3d('0x16')]();};}function respondWithResult(_0x25305d,_0x553f92){_0x553f92=_0x553f92||0xc8;return function(_0x32ca75){if(_0x32ca75){return _0x25305d[_0x3d3d('0x15')](_0x553f92)[_0x3d3d('0x17')](_0x32ca75);}};}function respondWithFilteredResult(_0x16274f,_0xb02393){return function(_0x22bb7d){if(_0x22bb7d){var _0x3840b8=typeof _0xb02393['offset']===_0x3d3d('0x18')&&typeof _0xb02393[_0x3d3d('0x19')]===_0x3d3d('0x18');var _0x5a3bcd=_0x22bb7d[_0x3d3d('0x1a')];var _0x4658b9=_0x3840b8?0x0:_0xb02393[_0x3d3d('0x1b')];var _0x94eba2=_0x3840b8?_0x22bb7d[_0x3d3d('0x1a')]:_0xb02393[_0x3d3d('0x1b')]+_0xb02393[_0x3d3d('0x19')];var _0x4eff34;if(_0x94eba2>=_0x5a3bcd){_0x94eba2=_0x5a3bcd;_0x4eff34=0xc8;}else{_0x4eff34=0xce;}_0x16274f[_0x3d3d('0x15')](_0x4eff34);return _0x16274f['set'](_0x3d3d('0x1c'),_0x4658b9+'-'+_0x94eba2+'/'+_0x5a3bcd)[_0x3d3d('0x17')](_0x22bb7d);}return null;};}function patchUpdates(_0x5691d9){return function(_0x5ede83){try{jsonpatch[_0x3d3d('0x1d')](_0x5ede83,_0x5691d9,!![]);}catch(_0x2cafd4){return BPromise[_0x3d3d('0x1e')](_0x2cafd4);}return _0x5ede83[_0x3d3d('0x1f')]();};}function saveUpdates(_0x49685a,_0x4291cb){return function(_0xf88a7e){if(_0xf88a7e){return _0xf88a7e[_0x3d3d('0x20')](_0x49685a)['then'](function(_0x388900){return _0x388900;});}return null;};}function removeEntity(_0x288002,_0x1dbb69){return function(_0x557bab){if(_0x557bab){return _0x557bab['destroy']()[_0x3d3d('0x21')](function(){_0x288002[_0x3d3d('0x15')](0xcc)[_0x3d3d('0x16')]();});}};}function handleEntityNotFound(_0x25854e,_0x58e7b4){return function(_0x421d04){if(!_0x421d04){_0x25854e[_0x3d3d('0x22')](0x194);}return _0x421d04;};}function handleError(_0x665253,_0x16d8af){_0x16d8af=_0x16d8af||0x1f4;return function(_0x30c4ee){logger[_0x3d3d('0x23')](_0x30c4ee[_0x3d3d('0x24')]);if(_0x30c4ee['name']){delete _0x30c4ee['name'];}_0x665253['status'](_0x16d8af)['send'](_0x30c4ee);};}exports['index']=function(_0x51c8fb,_0xfda534){var _0x8dadd6={},_0x41464f={},_0x45a836={'count':0x0,'rows':[]};var _0x3bd2a2=_[_0x3d3d('0x25')](db[_0x3d3d('0x26')]['rawAttributes'],function(_0xecbe5b){return{'name':_0xecbe5b[_0x3d3d('0x27')],'type':_0xecbe5b[_0x3d3d('0x28')][_0x3d3d('0x29')]};});_0x41464f[_0x3d3d('0x2a')]=_[_0x3d3d('0x25')](_0x3bd2a2,'name');_0x41464f[_0x3d3d('0x2b')]=_[_0x3d3d('0x2c')](_0x51c8fb[_0x3d3d('0x2b')]);_0x41464f[_0x3d3d('0x2d')]=_[_0x3d3d('0x2e')](_0x41464f['model'],_0x41464f['query']);_0x8dadd6[_0x3d3d('0x2f')]=_[_0x3d3d('0x2e')](_0x41464f[_0x3d3d('0x2a')],qs[_0x3d3d('0x30')](_0x51c8fb['query']['fields']));_0x8dadd6[_0x3d3d('0x2f')]=_0x8dadd6[_0x3d3d('0x2f')][_0x3d3d('0x31')]?_0x8dadd6[_0x3d3d('0x2f')]:_0x41464f[_0x3d3d('0x2a')];if(!_0x51c8fb[_0x3d3d('0x2b')][_0x3d3d('0x32')](_0x3d3d('0x33'))){_0x8dadd6[_0x3d3d('0x19')]=qs[_0x3d3d('0x19')](_0x51c8fb[_0x3d3d('0x2b')]['limit']);_0x8dadd6[_0x3d3d('0x1b')]=qs[_0x3d3d('0x1b')](_0x51c8fb[_0x3d3d('0x2b')][_0x3d3d('0x1b')]);}_0x8dadd6[_0x3d3d('0x34')]=qs[_0x3d3d('0x35')](_0x51c8fb[_0x3d3d('0x2b')][_0x3d3d('0x35')]);_0x8dadd6[_0x3d3d('0x36')]=qs['filters'](_['pick'](_0x51c8fb[_0x3d3d('0x2b')],_0x41464f[_0x3d3d('0x2d')]),_0x3bd2a2);if(_0x51c8fb['query'][_0x3d3d('0x37')]){_0x8dadd6[_0x3d3d('0x36')]=_['merge'](_0x8dadd6[_0x3d3d('0x36')],{'$or':_[_0x3d3d('0x25')](_0x3bd2a2,function(_0x3b2e12){if(_0x3b2e12[_0x3d3d('0x28')]!=='VIRTUAL'){var _0x1cf7d2={};_0x1cf7d2[_0x3b2e12[_0x3d3d('0x38')]]={'$like':'%'+_0x51c8fb[_0x3d3d('0x2b')][_0x3d3d('0x37')]+'%'};return _0x1cf7d2;}})});}_0x8dadd6=_[_0x3d3d('0x39')]({},_0x8dadd6,_0x51c8fb['options']);var _0x101edb={'where':_0x8dadd6[_0x3d3d('0x36')]};return db['WhatsappTransferReport'][_0x3d3d('0x1a')](_0x101edb)[_0x3d3d('0x21')](function(_0x3c37a4){_0x45a836['count']=_0x3c37a4;if(_0x51c8fb[_0x3d3d('0x2b')]['includeAll']){_0x8dadd6[_0x3d3d('0x3a')]=[{'all':!![]}];}return db[_0x3d3d('0x26')]['findAll'](_0x8dadd6);})[_0x3d3d('0x21')](function(_0x130686){_0x45a836[_0x3d3d('0x3b')]=_0x130686;return _0x45a836;})[_0x3d3d('0x21')](respondWithFilteredResult(_0xfda534,_0x8dadd6))[_0x3d3d('0x3c')](handleError(_0xfda534,null));};exports[_0x3d3d('0x3d')]=function(_0x56711f,_0x478f40){var _0x51d381={'raw':!![],'where':{'id':_0x56711f[_0x3d3d('0x3e')]['id']}},_0xe5e1={};_0xe5e1[_0x3d3d('0x2a')]=_[_0x3d3d('0x2c')](db[_0x3d3d('0x26')][_0x3d3d('0x3f')]);_0xe5e1['query']=_[_0x3d3d('0x2c')](_0x56711f[_0x3d3d('0x2b')]);_0xe5e1[_0x3d3d('0x2d')]=_[_0x3d3d('0x2e')](_0xe5e1['model'],_0xe5e1[_0x3d3d('0x2b')]);_0x51d381['attributes']=_[_0x3d3d('0x2e')](_0xe5e1[_0x3d3d('0x2a')],qs[_0x3d3d('0x30')](_0x56711f[_0x3d3d('0x2b')]['fields']));_0x51d381[_0x3d3d('0x2f')]=_0x51d381[_0x3d3d('0x2f')]['length']?_0x51d381[_0x3d3d('0x2f')]:_0xe5e1['model'];if(_0x56711f['query']['includeAll']){_0x51d381[_0x3d3d('0x3a')]=[{'all':!![]}];}_0x51d381=_['merge']({},_0x51d381,_0x56711f[_0x3d3d('0x40')]);return db['WhatsappTransferReport']['find'](_0x51d381)['then'](handleEntityNotFound(_0x478f40,null))[_0x3d3d('0x21')](respondWithResult(_0x478f40,null))[_0x3d3d('0x3c')](handleError(_0x478f40,null));};exports['create']=function(_0x226cec,_0x5cd51b){return db[_0x3d3d('0x26')][_0x3d3d('0x41')](_0x226cec[_0x3d3d('0x42')],{})[_0x3d3d('0x21')](respondWithResult(_0x5cd51b,0xc9))[_0x3d3d('0x3c')](handleError(_0x5cd51b,null));};exports[_0x3d3d('0x20')]=function(_0x1825e8,_0x437782){if(_0x1825e8[_0x3d3d('0x42')]['id']){delete _0x1825e8[_0x3d3d('0x42')]['id'];}return db['WhatsappTransferReport'][_0x3d3d('0x43')]({'where':{'id':_0x1825e8[_0x3d3d('0x3e')]['id']}})[_0x3d3d('0x21')](handleEntityNotFound(_0x437782,null))[_0x3d3d('0x21')](saveUpdates(_0x1825e8[_0x3d3d('0x42')],null))['then'](respondWithResult(_0x437782,null))[_0x3d3d('0x3c')](handleError(_0x437782,null));};exports[_0x3d3d('0x44')]=function(_0xbad206,_0x196040){return db[_0x3d3d('0x26')][_0x3d3d('0x43')]({'where':{'id':_0xbad206['params']['id']}})[_0x3d3d('0x21')](handleEntityNotFound(_0x196040,null))['then'](removeEntity(_0x196040,null))[_0x3d3d('0x3c')](handleError(_0x196040,null));};exports[_0x3d3d('0x45')]=function(_0x4a1fb2,_0x5519ad){return db['WhatsappTransferReport'][_0x3d3d('0x45')]()[_0x3d3d('0x21')](respondWithResult(_0x5519ad,null))['catch'](handleError(_0x5519ad,null));}; \ No newline at end of file +var _0x77de=['body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','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','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','then','destroy','stack','name','send','index','map','WhatsappTransferReport','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','length','merge','find','create'];(function(_0x50ce31,_0x1a50ef){var _0x12e8b5=function(_0x24b60b){while(--_0x24b60b){_0x50ce31['push'](_0x50ce31['shift']());}};_0x12e8b5(++_0x1a50ef);}(_0x77de,0x1d0));var _0xe77d=function(_0x24392f,_0x15a3e5){_0x24392f=_0x24392f-0x0;var _0x591e33=_0x77de[_0x24392f];return _0x591e33;};'use strict';var emlformat=require(_0xe77d('0x0'));var rimraf=require(_0xe77d('0x1'));var zipdir=require(_0xe77d('0x2'));var jsonpatch=require(_0xe77d('0x3'));var rp=require('request-promise');var moment=require(_0xe77d('0x4'));var BPromise=require(_0xe77d('0x5'));var Mustache=require(_0xe77d('0x6'));var util=require(_0xe77d('0x7'));var path=require(_0xe77d('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe77d('0x9'));var fs=require('fs');var fs_extra=require(_0xe77d('0xa'));var _=require(_0xe77d('0xb'));var squel=require(_0xe77d('0xc'));var crypto=require(_0xe77d('0xd'));var jsforce=require(_0xe77d('0xe'));var deskjs=require(_0xe77d('0xf'));var toCsv=require(_0xe77d('0x10'));var querystring=require(_0xe77d('0x11'));var Papa=require('papaparse');var Redis=require(_0xe77d('0x12'));var authService=require(_0xe77d('0x13'));var qs=require(_0xe77d('0x14'));var as=require(_0xe77d('0x15'));var hardwareService=require(_0xe77d('0x16'));var logger=require(_0xe77d('0x17'))(_0xe77d('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2bd0dc,_0x304a37){_0x304a37=_0x304a37||0xcc;return function(_0x1dc084){if(_0x1dc084){return _0x2bd0dc[_0xe77d('0x19')](_0x304a37);}return _0x2bd0dc[_0xe77d('0x1a')](_0x304a37)[_0xe77d('0x1b')]();};}function respondWithResult(_0x229257,_0x23385a){_0x23385a=_0x23385a||0xc8;return function(_0x35a6d4){if(_0x35a6d4){return _0x229257['status'](_0x23385a)['json'](_0x35a6d4);}};}function respondWithFilteredResult(_0x2907af,_0x4be4ce){return function(_0xef102d){if(_0xef102d){var _0x37c44d=typeof _0x4be4ce['offset']===_0xe77d('0x1c')&&typeof _0x4be4ce[_0xe77d('0x1d')]===_0xe77d('0x1c');var _0x81ee3e=_0xef102d[_0xe77d('0x1e')];var _0x5a3846=_0x37c44d?0x0:_0x4be4ce[_0xe77d('0x1f')];var _0x5d3b11=_0x37c44d?_0xef102d[_0xe77d('0x1e')]:_0x4be4ce[_0xe77d('0x1f')]+_0x4be4ce['limit'];var _0x535d98;if(_0x5d3b11>=_0x81ee3e){_0x5d3b11=_0x81ee3e;_0x535d98=0xc8;}else{_0x535d98=0xce;}_0x2907af['status'](_0x535d98);return _0x2907af[_0xe77d('0x20')](_0xe77d('0x21'),_0x5a3846+'-'+_0x5d3b11+'/'+_0x81ee3e)[_0xe77d('0x22')](_0xef102d);}return null;};}function patchUpdates(_0x2cdc01){return function(_0x267bf0){try{jsonpatch[_0xe77d('0x23')](_0x267bf0,_0x2cdc01,!![]);}catch(_0x2ec821){return BPromise[_0xe77d('0x24')](_0x2ec821);}return _0x267bf0['save']();};}function saveUpdates(_0x557928,_0x522f93){return function(_0x2a6953){if(_0x2a6953){return _0x2a6953['update'](_0x557928)[_0xe77d('0x25')](function(_0x34a063){return _0x34a063;});}return null;};}function removeEntity(_0x38a451,_0x36f0ad){return function(_0x18d5ab){if(_0x18d5ab){return _0x18d5ab[_0xe77d('0x26')]()[_0xe77d('0x25')](function(){_0x38a451['status'](0xcc)[_0xe77d('0x1b')]();});}};}function handleEntityNotFound(_0x363837,_0x3b9fa0){return function(_0x3e5061){if(!_0x3e5061){_0x363837[_0xe77d('0x19')](0x194);}return _0x3e5061;};}function handleError(_0x536a78,_0x539281){_0x539281=_0x539281||0x1f4;return function(_0x4eb01f){logger['error'](_0x4eb01f[_0xe77d('0x27')]);if(_0x4eb01f[_0xe77d('0x28')]){delete _0x4eb01f[_0xe77d('0x28')];}_0x536a78[_0xe77d('0x1a')](_0x539281)[_0xe77d('0x29')](_0x4eb01f);};}exports[_0xe77d('0x2a')]=function(_0x506c3a,_0x49b30d){var _0x35dcc2={},_0x57ebfe={},_0x273766={'count':0x0,'rows':[]};var _0x5d0d5c=_[_0xe77d('0x2b')](db[_0xe77d('0x2c')]['rawAttributes'],function(_0x568aa1){return{'name':_0x568aa1[_0xe77d('0x2d')],'type':_0x568aa1[_0xe77d('0x2e')][_0xe77d('0x2f')]};});_0x57ebfe[_0xe77d('0x30')]=_[_0xe77d('0x2b')](_0x5d0d5c,_0xe77d('0x28'));_0x57ebfe[_0xe77d('0x31')]=_['keys'](_0x506c3a[_0xe77d('0x31')]);_0x57ebfe[_0xe77d('0x32')]=_['intersection'](_0x57ebfe['model'],_0x57ebfe[_0xe77d('0x31')]);_0x35dcc2[_0xe77d('0x33')]=_[_0xe77d('0x34')](_0x57ebfe['model'],qs[_0xe77d('0x35')](_0x506c3a[_0xe77d('0x31')][_0xe77d('0x35')]));_0x35dcc2[_0xe77d('0x33')]=_0x35dcc2[_0xe77d('0x33')]['length']?_0x35dcc2[_0xe77d('0x33')]:_0x57ebfe[_0xe77d('0x30')];if(!_0x506c3a['query'][_0xe77d('0x36')](_0xe77d('0x37'))){_0x35dcc2[_0xe77d('0x1d')]=qs[_0xe77d('0x1d')](_0x506c3a[_0xe77d('0x31')]['limit']);_0x35dcc2[_0xe77d('0x1f')]=qs[_0xe77d('0x1f')](_0x506c3a['query']['offset']);}_0x35dcc2[_0xe77d('0x38')]=qs[_0xe77d('0x39')](_0x506c3a['query'][_0xe77d('0x39')]);_0x35dcc2['where']=qs[_0xe77d('0x32')](_[_0xe77d('0x3a')](_0x506c3a[_0xe77d('0x31')],_0x57ebfe['filters']),_0x5d0d5c);if(_0x506c3a[_0xe77d('0x31')][_0xe77d('0x3b')]){_0x35dcc2[_0xe77d('0x3c')]=_['merge'](_0x35dcc2['where'],{'$or':_[_0xe77d('0x2b')](_0x5d0d5c,function(_0x316901){if(_0x316901['type']!==_0xe77d('0x3d')){var _0x15c17f={};_0x15c17f[_0x316901[_0xe77d('0x28')]]={'$like':'%'+_0x506c3a['query'][_0xe77d('0x3b')]+'%'};return _0x15c17f;}})});}_0x35dcc2=_['merge']({},_0x35dcc2,_0x506c3a[_0xe77d('0x3e')]);var _0x358e9f={'where':_0x35dcc2['where']};return db[_0xe77d('0x2c')]['count'](_0x358e9f)[_0xe77d('0x25')](function(_0x293ad6){_0x273766[_0xe77d('0x1e')]=_0x293ad6;if(_0x506c3a[_0xe77d('0x31')][_0xe77d('0x3f')]){_0x35dcc2[_0xe77d('0x40')]=[{'all':!![]}];}return db[_0xe77d('0x2c')]['findAll'](_0x35dcc2);})[_0xe77d('0x25')](function(_0xeab8a3){_0x273766[_0xe77d('0x41')]=_0xeab8a3;return _0x273766;})[_0xe77d('0x25')](respondWithFilteredResult(_0x49b30d,_0x35dcc2))[_0xe77d('0x42')](handleError(_0x49b30d,null));};exports[_0xe77d('0x43')]=function(_0x2c5b94,_0x466bc8){var _0xe1e879={'raw':!![],'where':{'id':_0x2c5b94[_0xe77d('0x44')]['id']}},_0x3c693e={};_0x3c693e[_0xe77d('0x30')]=_[_0xe77d('0x45')](db[_0xe77d('0x2c')][_0xe77d('0x46')]);_0x3c693e[_0xe77d('0x31')]=_[_0xe77d('0x45')](_0x2c5b94['query']);_0x3c693e['filters']=_['intersection'](_0x3c693e[_0xe77d('0x30')],_0x3c693e[_0xe77d('0x31')]);_0xe1e879[_0xe77d('0x33')]=_['intersection'](_0x3c693e[_0xe77d('0x30')],qs['fields'](_0x2c5b94[_0xe77d('0x31')][_0xe77d('0x35')]));_0xe1e879['attributes']=_0xe1e879[_0xe77d('0x33')][_0xe77d('0x47')]?_0xe1e879[_0xe77d('0x33')]:_0x3c693e[_0xe77d('0x30')];if(_0x2c5b94[_0xe77d('0x31')][_0xe77d('0x3f')]){_0xe1e879[_0xe77d('0x40')]=[{'all':!![]}];}_0xe1e879=_[_0xe77d('0x48')]({},_0xe1e879,_0x2c5b94[_0xe77d('0x3e')]);return db[_0xe77d('0x2c')][_0xe77d('0x49')](_0xe1e879)['then'](handleEntityNotFound(_0x466bc8,null))[_0xe77d('0x25')](respondWithResult(_0x466bc8,null))[_0xe77d('0x42')](handleError(_0x466bc8,null));};exports[_0xe77d('0x4a')]=function(_0x27b5a9,_0x40050e){return db[_0xe77d('0x2c')][_0xe77d('0x4a')](_0x27b5a9[_0xe77d('0x4b')],{})[_0xe77d('0x25')](respondWithResult(_0x40050e,0xc9))[_0xe77d('0x42')](handleError(_0x40050e,null));};exports['update']=function(_0x4e73e0,_0x312464){if(_0x4e73e0[_0xe77d('0x4b')]['id']){delete _0x4e73e0[_0xe77d('0x4b')]['id'];}return db[_0xe77d('0x2c')][_0xe77d('0x49')]({'where':{'id':_0x4e73e0[_0xe77d('0x44')]['id']}})[_0xe77d('0x25')](handleEntityNotFound(_0x312464,null))[_0xe77d('0x25')](saveUpdates(_0x4e73e0[_0xe77d('0x4b')],null))['then'](respondWithResult(_0x312464,null))[_0xe77d('0x42')](handleError(_0x312464,null));};exports[_0xe77d('0x26')]=function(_0x13485c,_0x587b03){return db['WhatsappTransferReport'][_0xe77d('0x49')]({'where':{'id':_0x13485c[_0xe77d('0x44')]['id']}})[_0xe77d('0x25')](handleEntityNotFound(_0x587b03,null))[_0xe77d('0x25')](removeEntity(_0x587b03,null))[_0xe77d('0x42')](handleError(_0x587b03,null));};exports['describe']=function(_0x4091ce,_0x3e170f){return db[_0xe77d('0x2c')][_0xe77d('0x4c')]()[_0xe77d('0x25')](respondWithResult(_0x3e170f,null))[_0xe77d('0x42')](handleError(_0x3e170f,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 9139d2b..3545c65 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 _0xc9f5=['rimraf','./whatsappTransferReport.attributes','define','WhatsappTransferReport','uniqueid','lodash','../../config/logger','moment','bluebird'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xc9f5,0x1e2));var _0x5c9f=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0xc9f5[_0xd1d19a];return _0x52a79d;};'use strict';var _=require(_0x5c9f('0x0'));var util=require('util');var logger=require(_0x5c9f('0x1'))('api');var moment=require(_0x5c9f('0x2'));var BPromise=require(_0x5c9f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5c9f('0x4'));var config=require('../../config/environment');var attributes=require(_0x5c9f('0x5'));module['exports']=function(_0x110228,_0x3007eb){return _0x110228[_0x5c9f('0x6')](_0x5c9f('0x7'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x5c9f('0x8'),'fields':[_0x5c9f('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x211a=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','WhatsappTransferReport','report_whatsapp_transfer','uniqueid'];(function(_0x396ead,_0x2b4d16){var _0x4a55a1=function(_0x971acc){while(--_0x971acc){_0x396ead['push'](_0x396ead['shift']());}};_0x4a55a1(++_0x2b4d16);}(_0x211a,0x138));var _0xa211=function(_0x1861d2,_0x217fde){_0x1861d2=_0x1861d2-0x0;var _0x4a3f68=_0x211a[_0x1861d2];return _0x4a3f68;};'use strict';var _=require(_0xa211('0x0'));var util=require('util');var logger=require(_0xa211('0x1'))(_0xa211('0x2'));var moment=require(_0xa211('0x3'));var BPromise=require(_0xa211('0x4'));var rp=require(_0xa211('0x5'));var fs=require('fs');var path=require(_0xa211('0x6'));var rimraf=require(_0xa211('0x7'));var config=require(_0xa211('0x8'));var attributes=require('./whatsappTransferReport.attributes');module[_0xa211('0x9')]=function(_0x500786,_0x5e21a6){return _0x500786['define'](_0xa211('0xa'),attributes,{'tableName':_0xa211('0xb'),'paranoid':![],'indexes':[{'name':_0xa211('0xc'),'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 5e9e78b..684654c 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 _0xc129=['WhatsappTransferReport,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc129,0x1ba));var _0x9c12=function(_0x1e354d,_0x4cdd11){_0x1e354d=_0x1e354d-0x0;var _0x25445d=_0xc129[_0x1e354d];return _0x25445d;};'use strict';var _=require(_0x9c12('0x0'));var util=require(_0x9c12('0x1'));var moment=require(_0x9c12('0x2'));var BPromise=require('bluebird');var rs=require(_0x9c12('0x3'));var fs=require('fs');var Redis=require(_0x9c12('0x4'));var db=require(_0x9c12('0x5'))['db'];var utils=require(_0x9c12('0x6'));var logger=require('../../config/logger')(_0x9c12('0x7'));var config=require(_0x9c12('0x8'));var jayson=require(_0x9c12('0x9'));var client=jayson[_0x9c12('0xa')][_0x9c12('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x518b1f,_0x21603a,_0x6315fb){return new BPromise(function(_0x4ae752,_0x599d5f){return client[_0x9c12('0xc')](_0x518b1f,_0x6315fb)[_0x9c12('0xd')](function(_0x280cd8){logger['info']('WhatsappTransferReport,\x20%s,\x20%s',_0x21603a,'request\x20sent');logger['debug'](_0x9c12('0xe'),_0x21603a,'request\x20sent',JSON[_0x9c12('0xf')](_0x280cd8));if(_0x280cd8['error']){if(_0x280cd8['error'][_0x9c12('0x10')]===0x1f4){logger[_0x9c12('0x11')](_0x9c12('0x12'),_0x21603a,_0x280cd8['error'][_0x9c12('0x13')]);return _0x599d5f(_0x280cd8[_0x9c12('0x11')][_0x9c12('0x13')]);}logger[_0x9c12('0x11')](_0x9c12('0x12'),_0x21603a,_0x280cd8[_0x9c12('0x11')][_0x9c12('0x13')]);return _0x4ae752(_0x280cd8[_0x9c12('0x11')][_0x9c12('0x13')]);}else{logger['info'](_0x9c12('0x12'),_0x21603a,_0x9c12('0x14'));_0x4ae752(_0x280cd8[_0x9c12('0x15')][_0x9c12('0x13')]);}})[_0x9c12('0x16')](function(_0x33317a){logger['error'](_0x9c12('0x12'),_0x21603a,_0x33317a);_0x599d5f(_0x33317a);});});} \ No newline at end of file +var _0x34e1=['http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1627ae,_0x2aaa24){var _0x34b38f=function(_0x5c4332){while(--_0x5c4332){_0x1627ae['push'](_0x1627ae['shift']());}};_0x34b38f(++_0x2aaa24);}(_0x34e1,0xcd));var _0x134e=function(_0x2ae998,_0x35812b){_0x2ae998=_0x2ae998-0x0;var _0xecaa88=_0x34e1[_0x2ae998];return _0xecaa88;};'use strict';var _=require(_0x134e('0x0'));var util=require(_0x134e('0x1'));var moment=require('moment');var BPromise=require(_0x134e('0x2'));var rs=require(_0x134e('0x3'));var fs=require('fs');var Redis=require(_0x134e('0x4'));var db=require(_0x134e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x134e('0x6'))(_0x134e('0x7'));var config=require(_0x134e('0x8'));var jayson=require(_0x134e('0x9'));var client=jayson[_0x134e('0xa')][_0x134e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x357811,_0x3cdcac,_0x32ffeb){return new BPromise(function(_0x1dbfe0,_0x56f1a1){return client[_0x134e('0xc')](_0x357811,_0x32ffeb)[_0x134e('0xd')](function(_0x4358a8){logger[_0x134e('0xe')](_0x134e('0xf'),_0x3cdcac,_0x134e('0x10'));logger[_0x134e('0x11')](_0x134e('0x12'),_0x3cdcac,_0x134e('0x10'),JSON['stringify'](_0x4358a8));if(_0x4358a8[_0x134e('0x13')]){if(_0x4358a8[_0x134e('0x13')][_0x134e('0x14')]===0x1f4){logger[_0x134e('0x13')]('WhatsappTransferReport,\x20%s,\x20%s',_0x3cdcac,_0x4358a8[_0x134e('0x13')][_0x134e('0x15')]);return _0x56f1a1(_0x4358a8[_0x134e('0x13')][_0x134e('0x15')]);}logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x3cdcac,_0x4358a8[_0x134e('0x13')][_0x134e('0x15')]);return _0x1dbfe0(_0x4358a8['error'][_0x134e('0x15')]);}else{logger[_0x134e('0xe')](_0x134e('0xf'),_0x3cdcac,'request\x20sent');_0x1dbfe0(_0x4358a8[_0x134e('0x16')][_0x134e('0x15')]);}})[_0x134e('0x17')](function(_0x19436a){logger['error'](_0x134e('0xf'),_0x3cdcac,_0x19436a);_0x56f1a1(_0x19436a);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 1ceae45..337d42e 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa32b=['./config/seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/environment','app','./config/pm2','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sync','listen','then','start','info','Online\x20apps:','filter','online','name','join','map','status','seedDB'];(function(_0x407688,_0x3af4ad){var _0x397992=function(_0x237a27){while(--_0x237a27){_0x407688['push'](_0x407688['shift']());}};_0x397992(++_0x3af4ad);}(_0xa32b,0x10c));var _0xba32=function(_0x4d515d,_0x108c96){_0x4d515d=_0x4d515d-0x0;var _0x58fe07=_0xa32b[_0x4d515d];return _0x58fe07;};'use strict';var _=require(_0xba32('0x0'));var mysqldb=require(_0xba32('0x1'));var rpc=require('./rpc');var config=require(_0xba32('0x2'));var logger=require('./config/logger')(_0xba32('0x3'));var pm2=require(_0xba32('0x4'));var pm2Config=require('./config/pm2/config');var schedule=require(_0xba32('0x5'));var chat=require(_0xba32('0x6'));var whatsapp=require(_0xba32('0x7'));var transcribe=require(_0xba32('0x8'));function main(){return mysqldb['db']['sequelize'][_0xba32('0x9')]()['then'](function(){return rpc[_0xba32('0xa')]();})[_0xba32('0xb')](function(_0x43ffba){logger['info'](_0x43ffba);return chat['start']();})[_0xba32('0xb')](function(){return whatsapp[_0xba32('0xc')]();})[_0xba32('0xb')](function(){return schedule['start']();})[_0xba32('0xb')](function(){return transcribe['start']();})[_0xba32('0xb')](function(_0x6a5337){logger['info'](_0x6a5337);return pm2[_0xba32('0xc')](pm2Config);})[_0xba32('0xb')](function(_0x57dcc4){logger[_0xba32('0xd')](_0xba32('0xe'),_['map'](_[_0xba32('0xf')](_0x57dcc4,{'status':_0xba32('0x10')}),_0xba32('0x11'))[_0xba32('0x12')]());logger[_0xba32('0xd')]('Offline\x20apps:',_[_0xba32('0x13')](_[_0xba32('0xf')](_0x57dcc4,function(_0x2f1e18){return _0x2f1e18[_0xba32('0x14')]!==_0xba32('0x10');}),_0xba32('0x11'))['join']()||'None');config[_0xba32('0x15')]&&require(_0xba32('0x16'))[_0xba32('0x17')]();require(_0xba32('0x18'))[_0xba32('0x17')]();})[_0xba32('0x19')](function(_0x1f965a){logger[_0xba32('0x1a')](_0xba32('0x1b'),_0x1f965a);process[_0xba32('0x1c')](0x1);});}main(); \ No newline at end of file +var _0x81c4=['Offline\x20apps:','filter','None','seedDB','./config/seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule/chat','./config/schedule/transcribe','sequelize','then','info','start','Online\x20apps:','map','online','join'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x81c4,0x91));var _0x481c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x81c4[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var mysqldb=require(_0x481c('0x0'));var rpc=require(_0x481c('0x1'));var config=require(_0x481c('0x2'));var logger=require(_0x481c('0x3'))(_0x481c('0x4'));var pm2=require(_0x481c('0x5'));var pm2Config=require(_0x481c('0x6'));var schedule=require('./config/schedule');var chat=require(_0x481c('0x7'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x481c('0x8'));function main(){return mysqldb['db'][_0x481c('0x9')]['sync']()[_0x481c('0xa')](function(){return rpc['listen']();})[_0x481c('0xa')](function(_0x10c9a9){logger[_0x481c('0xb')](_0x10c9a9);return chat[_0x481c('0xc')]();})[_0x481c('0xa')](function(){return whatsapp['start']();})[_0x481c('0xa')](function(){return schedule['start']();})[_0x481c('0xa')](function(){return transcribe[_0x481c('0xc')]();})['then'](function(_0x134602){logger[_0x481c('0xb')](_0x134602);return pm2[_0x481c('0xc')](pm2Config);})['then'](function(_0x581a13){logger[_0x481c('0xb')](_0x481c('0xd'),_[_0x481c('0xe')](_['filter'](_0x581a13,{'status':_0x481c('0xf')}),'name')[_0x481c('0x10')]());logger['info'](_0x481c('0x11'),_[_0x481c('0xe')](_[_0x481c('0x12')](_0x581a13,function(_0x4c02d4){return _0x4c02d4['status']!==_0x481c('0xf');}),'name')['join']()||_0x481c('0x13'));config[_0x481c('0x14')]&&require(_0x481c('0x15'))[_0x481c('0x16')]();require(_0x481c('0x17'))[_0x481c('0x16')]();})[_0x481c('0x18')](function(_0x140244){logger[_0x481c('0x19')](_0x481c('0x1a'),_0x140244);process['exit'](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index db14060..dfeef4e 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 _0x3658=['use','user','ChatInteraction','findOne','params','closed','disposition','then','status','unmanaged','json','catch','isAuthenticated','headers','authorization','startsWith','Basic','find','authenticate','pass','Wrong\x20credentials.','Bearer','apikey','getUuid','query','User','sub','allowedLoginAttempts','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','Unknown\x20authorization\x20format','User\x20object\x20not\x20found.','getLicense','update','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','redirect','/dashboards/general','send','retrieveApiKey','isNil','generateApiKey','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','Sequelize','split','length','splice','unshift','encryptString','promisify','secret','payload','options','verify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','session','role','fullname','name','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','pauseType','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','downloadOmnichannelInteractions','downloadAttachments','isChatInteractionAuthorized'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x3658,0x1c3));var _0x8365=function(_0x13a65f,_0x276270){_0x13a65f=_0x13a65f-0x0;var _0x40cc4f=_0x3658[_0x13a65f];return _0x40cc4f;};'use strict';var db=require(_0x8365('0x0'))['db'];var config=require(_0x8365('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require('../../config/license/util');var encryptor=require(_0x8365('0x2'));var _=require(_0x8365('0x3'));var jwt=require(_0x8365('0x4'));var expressJwt=require(_0x8365('0x5'));var compose=require(_0x8365('0x6'));var basicAuth=require(_0x8365('0x7'));var crypto=require(_0x8365('0x8'));var BPromise=require(_0x8365('0x9'));var util=require(_0x8365('0xa'));var moment=require(_0x8365('0xb'));var validateJwt=expressJwt({'secret':config[_0x8365('0xc')][_0x8365('0xd')]});var userAttributes=['id',_0x8365('0xe'),_0x8365('0xf'),_0x8365('0x10'),_0x8365('0x11'),_0x8365('0x12'),_0x8365('0x13'),_0x8365('0x14'),_0x8365('0x15'),_0x8365('0x16'),_0x8365('0x17'),_0x8365('0x18'),_0x8365('0x19'),'smsPause','openchannelPause',_0x8365('0x1a'),'showWebBar','lastLoginAt','lastPauseAt',_0x8365('0x1b'),_0x8365('0x1c'),_0x8365('0x1d'),_0x8365('0x1e'),_0x8365('0x1f'),_0x8365('0x20'),_0x8365('0x21'),_0x8365('0x22'),_0x8365('0x23'),_0x8365('0x24'),'phoneBarExpires','phoneBarPrefixRequired',_0x8365('0x25'),_0x8365('0x26'),_0x8365('0x27'),_0x8365('0x28'),_0x8365('0x29'),'privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings',_0x8365('0x2a'),_0x8365('0x2b')];exports[_0x8365('0x2c')]=function(){return this['isAuthenticated'](!![])[_0x8365('0x2d')](function(_0x380aa7,_0x1d149e,_0x1142a5){if(_0x380aa7[_0x8365('0x2e')]){_0x1142a5();}else{return db[_0x8365('0x2f')][_0x8365('0x30')]({'where':{'id':_0x380aa7[_0x8365('0x31')]['id']},'attributes':['id',_0x8365('0x32'),_0x8365('0x33')],'raw':!![]})[_0x8365('0x34')](function(_0x14c25f){if(_0x14c25f&&_0x14c25f['closed']){return _0x1d149e[_0x8365('0x35')](_0x14c25f[_0x8365('0x33')]===_0x8365('0x36')?0x195:0x193)[_0x8365('0x37')]({'message':_0x14c25f[_0x8365('0x33')]===_0x8365('0x36')?'Unmanaged.':'Forbidden.'});}else{_0x1142a5();}})[_0x8365('0x38')](function(_0x5ac348){_0x1142a5(_0x5ac348);});}});};exports[_0x8365('0x39')]=function isAuthenticated(_0x26fd2f){return compose()['use'](function(_0xdaf052,_0x2a45ea,_0xf6e3e7){var _0x1f4048;if(_0xdaf052[_0x8365('0x3a')][_0x8365('0x3b')]){if(_[_0x8365('0x3c')](_0xdaf052[_0x8365('0x3a')][_0x8365('0x3b')],_0x8365('0x3d'))){var _0x1f0992=basicAuth(_0xdaf052);db['User'][_0x8365('0x3e')]({'where':{'name':_0x1f0992['name']}})[_0x8365('0x34')](function(_0x1a4c7a){if(!_0x1a4c7a||!_0x1a4c7a[_0x8365('0x3f')](_0x1f0992[_0x8365('0x40')])){return _0x2a45ea['status'](0x191)['json']({'message':_0x8365('0x41')});}_0xdaf052[_0x8365('0x2e')]={'id':_0x1a4c7a['id']};_0xf6e3e7();})[_0x8365('0x38')](function(_0x50fb1b){_0xf6e3e7(_0x50fb1b);});}else if(_[_0x8365('0x3c')](_0xdaf052[_0x8365('0x3a')][_0x8365('0x3b')],_0x8365('0x42'))){validateJwt(_0xdaf052,_0x2a45ea,_0xf6e3e7);}else{if(_0x26fd2f){_0xf6e3e7();}else{return _0x2a45ea[_0x8365('0x35')](0x193)[_0x8365('0x37')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0xdaf052['query'][_0x8365('0x43')]){try{var _0x2ff69f={'audience':hardwareConf[_0x8365('0x44')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0xdaf052[_0x8365('0x45')][_0x8365('0x43')],_0x2ff69f)[_0x8365('0x34')](function(_0x14758a){return db[_0x8365('0x46')][_0x8365('0x3e')]({'where':{'id':_0x14758a[_0x8365('0x47')]}})[_0x8365('0x34')](function(_0x3ae8aa){_0x1f4048=_0x3ae8aa;return db['Setting'][_0x8365('0x30')]({'where':{'id':0x1},'attributes':[_0x8365('0x48'),'blockDuration'],'raw':!![]});})[_0x8365('0x34')](function(_0x3891e4){if(!_0x1f4048||!_['isEqual'](_0x1f4048[_0x8365('0x49')],_0x14758a[_0x8365('0x4a')])){return _0x2a45ea[_0x8365('0x35')](0x191)[_0x8365('0x37')]({'message':_0x8365('0x4b')});}if(_0x1f4048[_0x8365('0x4c')]){return _0x2a45ea['status'](0x191)['json']({'message':_0x8365('0x4d')});}if(_0x1f4048[_0x8365('0x4e')]){if(_0x3891e4['blockDuration']>0x0){if(moment(_0x1f4048[_0x8365('0x4f')])[_0x8365('0x50')](_0x3891e4['blockDuration'],_0x8365('0x51'))>moment()){return _0x2a45ea[_0x8365('0x35')](0x191)[_0x8365('0x37')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x2a45ea[_0x8365('0x35')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}}_0xdaf052[_0x8365('0x2e')]={'id':_0x1f4048['id']};_0xf6e3e7();});})[_0x8365('0x38')](function(){return _0x2a45ea['status'](0x191)['json']({'message':_0x8365('0x4d')});});}catch(_0x422a58){_0xf6e3e7(_0x422a58);}}else if(_0x26fd2f){_0xf6e3e7();}else{return _0x2a45ea[_0x8365('0x35')](0x193)['json']({'message':_0x8365('0x52')});}})[_0x8365('0x2d')](function(_0x3b89fd,_0x272abd,_0x25e61a){if(_0x3b89fd['user']){db[_0x8365('0x46')][_0x8365('0x3e')]({'where':{'id':_0x3b89fd['user']['id']},'attributes':userAttributes})[_0x8365('0x34')](function(_0xccc2e5){if(!_0xccc2e5){return _0x272abd[_0x8365('0x35')](0x194)['json']({'message':'User\x20not\x20found.'});}_0x3b89fd[_0x8365('0x2e')]=_0xccc2e5;_0x25e61a();})[_0x8365('0x38')](function(_0xee211f){_0x25e61a(_0xee211f);});}else if(_0x26fd2f){_0x25e61a();}else{return _0x272abd[_0x8365('0x35')](0x194)[_0x8365('0x37')]({'message':_0x8365('0x53')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0x8365('0x2d')](function(_0x5a7527,_0x36e9f1,_0x15655f){return licenseUtil[_0x8365('0x54')]()[_0x8365('0x34')](function(_0x251240){if(_0x251240[_0x8365('0x55')]){_0x15655f();}else{return _0x36e9f1['status'](0x193)['json']({'message':_0x8365('0x56')});}})[_0x8365('0x38')](function(_0x4da365){_0x15655f(_0x4da365);});});};exports[_0x8365('0x57')]=function(_0x5b0fbd,_0x2d66ed,_0x25f39a){_0x5b0fbd['isMiddleware']=!![];return _0x25f39a();};exports[_0x8365('0x58')]=function signToken(_0x158b0f){return signJwt(_0x158b0f);};exports[_0x8365('0x59')]=function(_0x13506b,_0x11f93d){if(!_0x13506b[_0x8365('0x2e')]){return _0x11f93d[_0x8365('0x35')](0x194)[_0x8365('0x37')]({'message':_0x8365('0x5a')});}var _0x10ac89={'payload':{'id':_0x13506b[_0x8365('0x2e')]['id'],'role':_0x13506b[_0x8365('0x2e')][_0x8365('0xe')]},'options':{'expiresIn':0x15180}};return signJwt(_0x10ac89)['then'](function(_0x3ca931){_0x11f93d['cookie']('motion.token',_0x3ca931);_0x11f93d[_0x8365('0x5b')](_0x8365('0x5c'));})['catch'](function(_0x1c2036){return _0x11f93d[_0x8365('0x35')](0x1f4)[_0x8365('0x5d')](_0x1c2036);});};exports[_0x8365('0x5e')]=function(_0x19d6f6){if(_['isNil'](_0x19d6f6['apiKeyNonce'])||_[_0x8365('0x5f')](_0x19d6f6['apiKeyIat'])){return null;}else{return createJwt(_0x19d6f6);}};exports[_0x8365('0x60')]=function(_0x7b423f){_0x7b423f[_0x8365('0x49')]=generateNonce();_0x7b423f[_0x8365('0x61')]=generateIssuedAt();return createJwt(_0x7b423f);};exports[_0x8365('0x62')]=function(_0x963711,_0x40ebfc){var _0x2d9ced=_0x963711[_0x8365('0x45')][_0x8365('0x43')];if(_0x2d9ced){var _0x3673cc={'nonce':_0x40ebfc['apiKeyNonce'],'iat':_0x40ebfc[_0x8365('0x61')],'audience':hardwareConf[_0x8365('0x44')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x2d9ced,_0x3673cc)[_0x8365('0x34')](function(){return generateApiKey(_0x40ebfc);});}else{throw{'message':_0x8365('0x63')};}};exports['validatePasswordPattern']=function(_0x3a43ab){var _0x5372b6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x5372b6['test'](_0x3a43ab))throw new db['Sequelize'][(_0x8365('0x64'))](_0x8365('0x65'));return;};exports[_0x8365('0x66')]=function(_0x4623f4,_0x4df0b1,_0xa693d6){var _0x18f388=encryptor['decryptString'](_0x4df0b1)['split'](',');for(var _0x3e2e8a=0x0;_0x3e2e8a<_0xa693d6;_0x3e2e8a++){if(!_0x18f388[_0x3e2e8a])break;if(_0x4623f4[_0x8365('0x67')]()===_0x18f388[_0x3e2e8a][_0x8365('0x67')]()){var _0x152b66=util[_0x8365('0x68')](_0x8365('0x69'),_0xa693d6);if(_0xa693d6===0x1){_0x152b66=_0x8365('0x6a');}throw new db[(_0x8365('0x6b'))][(_0x8365('0x64'))](_0x152b66);}}return;};exports['updatePasswordsHistory']=function(_0x2593eb,_0x1f3274){var _0x5f0a0e=_0x1f3274?encryptor['decryptString'](_0x1f3274)[_0x8365('0x6c')](','):[];if(_0x5f0a0e[_0x8365('0x6d')]===0x5){_0x5f0a0e[_0x8365('0x6e')](-0x1,0x1);}_0x5f0a0e[_0x8365('0x6f')](_0x2593eb);return encryptor[_0x8365('0x70')](_0x5f0a0e['join'](','));};function signJwt(_0x3da9a8){var _0x51ab95=BPromise[_0x8365('0x71')](jwt['sign'],{'context':jwt});var _0xd6269e=_0x3da9a8[_0x8365('0x72')]||config[_0x8365('0xc')][_0x8365('0xd')];return new BPromise(function(_0x206bf1,_0x4b32b6){_0x51ab95(_0x3da9a8[_0x8365('0x73')],_0xd6269e,_0x3da9a8[_0x8365('0x74')])[_0x8365('0x34')](function(_0x554b93){_0x206bf1(_0x554b93);})[_0x8365('0x38')](function(_0xf09d91){_0x4b32b6(_0xf09d91);});});}function verifyJwt(_0x5d9a1c,_0x3a1d7d,_0x409d10){var _0x3e3382=BPromise[_0x8365('0x71')](jwt[_0x8365('0x75')],{'context':jwt});var _0x4cbfe1=_0x409d10||config[_0x8365('0xc')][_0x8365('0xd')];return new BPromise(function(_0x8d4b05,_0x1045f5){_0x3e3382(_0x5d9a1c,_0x4cbfe1,_0x3a1d7d)[_0x8365('0x34')](function(_0x389cd3){_0x8d4b05(_0x389cd3);})['catch'](function(_0x256e6e){_0x1045f5(_0x256e6e);});});}function generateNonce(){return crypto[_0x8365('0x76')](0x10)[_0x8365('0x77')](_0x8365('0x78'));}function generateIssuedAt(){return Math[_0x8365('0x79')](Date[_0x8365('0x7a')]()/0x3e8)['toString']();}function createJwt(_0x403094){var _0x14cbf4={'payload':{'iat':_0x403094[_0x8365('0x61')],'nonce':_0x403094[_0x8365('0x49')]},'options':{'algorithm':_0x8365('0x7b'),'subject':_0x403094['id']['toString'](),'issuer':hardwareConf[_0x8365('0x44')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x14cbf4)[_0x8365('0x34')](function(_0x40fbf7){return{'iat':_0x403094[_0x8365('0x61')],'nonce':_0x403094[_0x8365('0x49')],'token':_0x40fbf7};});} \ No newline at end of file +var _0x7c62=['startsWith','Bearer','Unknown\x20authorization\x20format','query','getUuid','apikey','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','User\x20object\x20not\x20found.','getLicense','update','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','redirect','/dashboards/general','send','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','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','unshift','encryptString','join','sign','session','payload','verify','randomBytes','toString','hex','floor','HS512','../../mysqldb','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','fullname','internal','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','passwordResetAt','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','isChatInteractionAuthorized','use','user','ChatInteraction','findOne','params','closed','disposition','then','status','json','unmanaged','Unmanaged.','Forbidden.','isAuthenticated','headers','authorization','Basic','User','find','pass','Wrong\x20credentials.','catch'];(function(_0x10b799,_0x5b0289){var _0x5368c9=function(_0x143d82){while(--_0x143d82){_0x10b799['push'](_0x10b799['shift']());}};_0x5368c9(++_0x5b0289);}(_0x7c62,0xb5));var _0x27c6=function(_0x52592f,_0x48d73d){_0x52592f=_0x52592f-0x0;var _0x2d9f1a=_0x7c62[_0x52592f];return _0x2d9f1a;};'use strict';var db=require(_0x27c6('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0x27c6('0x1'));var encryptor=require(_0x27c6('0x2'));var _=require(_0x27c6('0x3'));var jwt=require(_0x27c6('0x4'));var expressJwt=require(_0x27c6('0x5'));var compose=require(_0x27c6('0x6'));var basicAuth=require(_0x27c6('0x7'));var crypto=require(_0x27c6('0x8'));var BPromise=require(_0x27c6('0x9'));var util=require(_0x27c6('0xa'));var moment=require(_0x27c6('0xb'));var validateJwt=expressJwt({'secret':config[_0x27c6('0xc')]['session']});var userAttributes=['id','role',_0x27c6('0xd'),'name',_0x27c6('0xe'),'email','userpic',_0x27c6('0xf'),_0x27c6('0x10'),_0x27c6('0x11'),_0x27c6('0x12'),_0x27c6('0x13'),_0x27c6('0x14'),_0x27c6('0x15'),'openchannelPause',_0x27c6('0x16'),_0x27c6('0x17'),_0x27c6('0x18'),_0x27c6('0x19'),'crudPermissions','allowmessenger',_0x27c6('0x1a'),'alias',_0x27c6('0x1b'),_0x27c6('0x1c'),_0x27c6('0x1d'),'phoneBarEnableRecording',_0x27c6('0x1e'),'phoneBarEnableSettings',_0x27c6('0x1f'),_0x27c6('0x20'),_0x27c6('0x21'),_0x27c6('0x22'),'hotdesk','interface',_0x27c6('0x23'),_0x27c6('0x24'),_0x27c6('0x25'),_0x27c6('0x26'),_0x27c6('0x27'),_0x27c6('0x28'),_0x27c6('0x29')];exports[_0x27c6('0x2a')]=function(){return this['isAuthenticated'](!![])[_0x27c6('0x2b')](function(_0x4aed5d,_0x26f8a5,_0x5bc456){if(_0x4aed5d[_0x27c6('0x2c')]){_0x5bc456();}else{return db[_0x27c6('0x2d')][_0x27c6('0x2e')]({'where':{'id':_0x4aed5d[_0x27c6('0x2f')]['id']},'attributes':['id',_0x27c6('0x30'),_0x27c6('0x31')],'raw':!![]})[_0x27c6('0x32')](function(_0xaebc9d){if(_0xaebc9d&&_0xaebc9d[_0x27c6('0x30')]){return _0x26f8a5[_0x27c6('0x33')](_0xaebc9d[_0x27c6('0x31')]==='unmanaged'?0x195:0x193)[_0x27c6('0x34')]({'message':_0xaebc9d['disposition']===_0x27c6('0x35')?_0x27c6('0x36'):_0x27c6('0x37')});}else{_0x5bc456();}})['catch'](function(_0x5c5440){_0x5bc456(_0x5c5440);});}});};exports[_0x27c6('0x38')]=function isAuthenticated(_0x4fe8ca){return compose()[_0x27c6('0x2b')](function(_0x23df5d,_0x200d2b,_0x1713d3){var _0x597379;if(_0x23df5d[_0x27c6('0x39')][_0x27c6('0x3a')]){if(_['startsWith'](_0x23df5d['headers'][_0x27c6('0x3a')],_0x27c6('0x3b'))){var _0x1a5625=basicAuth(_0x23df5d);db[_0x27c6('0x3c')][_0x27c6('0x3d')]({'where':{'name':_0x1a5625['name']}})[_0x27c6('0x32')](function(_0x4c8ed6){if(!_0x4c8ed6||!_0x4c8ed6['authenticate'](_0x1a5625[_0x27c6('0x3e')])){return _0x200d2b['status'](0x191)[_0x27c6('0x34')]({'message':_0x27c6('0x3f')});}_0x23df5d[_0x27c6('0x2c')]={'id':_0x4c8ed6['id']};_0x1713d3();})[_0x27c6('0x40')](function(_0x4856b4){_0x1713d3(_0x4856b4);});}else if(_[_0x27c6('0x41')](_0x23df5d[_0x27c6('0x39')][_0x27c6('0x3a')],_0x27c6('0x42'))){validateJwt(_0x23df5d,_0x200d2b,_0x1713d3);}else{if(_0x4fe8ca){_0x1713d3();}else{return _0x200d2b[_0x27c6('0x33')](0x193)[_0x27c6('0x34')]({'message':_0x27c6('0x43')});}}}else if(_0x23df5d[_0x27c6('0x44')]['apikey']){try{var _0x13571f={'audience':hardwareConf[_0x27c6('0x45')](),'issuer':hardwareConf[_0x27c6('0x45')]()};verifyJwt(_0x23df5d['query'][_0x27c6('0x46')],_0x13571f)[_0x27c6('0x32')](function(_0x2998d2){return db[_0x27c6('0x3c')][_0x27c6('0x3d')]({'where':{'id':_0x2998d2['sub']}})[_0x27c6('0x32')](function(_0x343593){_0x597379=_0x343593;return db[_0x27c6('0x47')]['findOne']({'where':{'id':0x1},'attributes':[_0x27c6('0x48'),_0x27c6('0x49')],'raw':!![]});})[_0x27c6('0x32')](function(_0x327b4c){if(!_0x597379||!_[_0x27c6('0x4a')](_0x597379[_0x27c6('0x4b')],_0x2998d2['nonce'])){return _0x200d2b[_0x27c6('0x33')](0x191)[_0x27c6('0x34')]({'message':_0x27c6('0x4c')});}if(_0x597379[_0x27c6('0x4d')]){return _0x200d2b['status'](0x191)[_0x27c6('0x34')]({'message':_0x27c6('0x4e')});}if(_0x597379[_0x27c6('0x4f')]){if(_0x327b4c[_0x27c6('0x49')]>0x0){if(moment(_0x597379[_0x27c6('0x50')])[_0x27c6('0x51')](_0x327b4c[_0x27c6('0x49')],_0x27c6('0x52'))>moment()){return _0x200d2b['status'](0x191)['json']({'message':_0x27c6('0x4e')});}}else{return _0x200d2b[_0x27c6('0x33')](0x191)[_0x27c6('0x34')]({'message':_0x27c6('0x4e')});}}_0x23df5d[_0x27c6('0x2c')]={'id':_0x597379['id']};_0x1713d3();});})[_0x27c6('0x40')](function(){return _0x200d2b[_0x27c6('0x33')](0x191)[_0x27c6('0x34')]({'message':_0x27c6('0x4e')});});}catch(_0x3fdeba){_0x1713d3(_0x3fdeba);}}else if(_0x4fe8ca){_0x1713d3();}else{return _0x200d2b[_0x27c6('0x33')](0x193)['json']({'message':_0x27c6('0x43')});}})[_0x27c6('0x2b')](function(_0x1f5293,_0xb071d6,_0x3e2189){if(_0x1f5293['user']){db[_0x27c6('0x3c')][_0x27c6('0x3d')]({'where':{'id':_0x1f5293[_0x27c6('0x2c')]['id']},'attributes':userAttributes})[_0x27c6('0x32')](function(_0x199d10){if(!_0x199d10){return _0xb071d6['status'](0x194)[_0x27c6('0x34')]({'message':'User\x20not\x20found.'});}_0x1f5293['user']=_0x199d10;_0x3e2189();})['catch'](function(_0x56ed26){_0x3e2189(_0x56ed26);});}else if(_0x4fe8ca){_0x3e2189();}else{return _0xb071d6[_0x27c6('0x33')](0x194)[_0x27c6('0x34')]({'message':_0x27c6('0x53')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0x27c6('0x2b')](function(_0x34de41,_0x1e0622,_0xb6bb4c){return licenseUtil[_0x27c6('0x54')]()['then'](function(_0x2593b1){if(_0x2593b1[_0x27c6('0x55')]){_0xb6bb4c();}else{return _0x1e0622[_0x27c6('0x33')](0x193)[_0x27c6('0x34')]({'message':_0x27c6('0x56')});}})[_0x27c6('0x40')](function(_0x560c20){_0xb6bb4c(_0x560c20);});});};exports[_0x27c6('0x57')]=function(_0x1b5c5e,_0x2b6ba4,_0x4688fa){_0x1b5c5e['isMiddleware']=!![];return _0x4688fa();};exports[_0x27c6('0x58')]=function signToken(_0x2d4adb){return signJwt(_0x2d4adb);};exports[_0x27c6('0x59')]=function(_0x127e50,_0xb6ce72){if(!_0x127e50[_0x27c6('0x2c')]){return _0xb6ce72['status'](0x194)[_0x27c6('0x34')]({'message':_0x27c6('0x5a')});}var _0xc69384={'payload':{'id':_0x127e50[_0x27c6('0x2c')]['id'],'role':_0x127e50['user']['role']},'options':{'expiresIn':0x15180}};return signJwt(_0xc69384)[_0x27c6('0x32')](function(_0x51a7b1){_0xb6ce72['cookie']('motion.token',_0x51a7b1);_0xb6ce72[_0x27c6('0x5b')](_0x27c6('0x5c'));})[_0x27c6('0x40')](function(_0x430a57){return _0xb6ce72[_0x27c6('0x33')](0x1f4)[_0x27c6('0x5d')](_0x430a57);});};exports['retrieveApiKey']=function(_0x4d9b89){if(_[_0x27c6('0x5e')](_0x4d9b89[_0x27c6('0x4b')])||_[_0x27c6('0x5e')](_0x4d9b89['apiKeyIat'])){return null;}else{return createJwt(_0x4d9b89);}};exports[_0x27c6('0x5f')]=function(_0x2e1e81){_0x2e1e81[_0x27c6('0x4b')]=generateNonce();_0x2e1e81[_0x27c6('0x60')]=generateIssuedAt();return createJwt(_0x2e1e81);};exports[_0x27c6('0x61')]=function(_0x3cce5d,_0x465a06){var _0x29b597=_0x3cce5d[_0x27c6('0x44')][_0x27c6('0x46')];if(_0x29b597){var _0x23ca67={'nonce':_0x465a06[_0x27c6('0x4b')],'iat':_0x465a06['apiKeyIat'],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x29b597,_0x23ca67)['then'](function(){return generateApiKey(_0x465a06);});}else{throw{'message':_0x27c6('0x62')};}};exports[_0x27c6('0x63')]=function(_0x595210){var _0x2d5b31=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x2d5b31['test'](_0x595210))throw new db[(_0x27c6('0x64'))][(_0x27c6('0x65'))](_0x27c6('0x66'));return;};exports[_0x27c6('0x67')]=function(_0x4a4898,_0x3f1049,_0x7fa23d){var _0x2fbd55=encryptor[_0x27c6('0x68')](_0x3f1049)[_0x27c6('0x69')](',');for(var _0x3b9bf4=0x0;_0x3b9bf4<_0x7fa23d;_0x3b9bf4++){if(!_0x2fbd55[_0x3b9bf4])break;if(_0x4a4898[_0x27c6('0x6a')]()===_0x2fbd55[_0x3b9bf4][_0x27c6('0x6a')]()){var _0x3ce703=util[_0x27c6('0x6b')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x7fa23d);if(_0x7fa23d===0x1){_0x3ce703=_0x27c6('0x6c');}throw new db['Sequelize'][(_0x27c6('0x65'))](_0x3ce703);}}return;};exports[_0x27c6('0x6d')]=function(_0x1c7d76,_0x183ab3){var _0x75a79a=_0x183ab3?encryptor['decryptString'](_0x183ab3)[_0x27c6('0x69')](','):[];if(_0x75a79a[_0x27c6('0x6e')]===0x5){_0x75a79a['splice'](-0x1,0x1);}_0x75a79a[_0x27c6('0x6f')](_0x1c7d76);return encryptor[_0x27c6('0x70')](_0x75a79a[_0x27c6('0x71')](','));};function signJwt(_0x471e59){var _0x1b2929=BPromise['promisify'](jwt[_0x27c6('0x72')],{'context':jwt});var _0x3df3fd=_0x471e59['secret']||config[_0x27c6('0xc')][_0x27c6('0x73')];return new BPromise(function(_0x102caf,_0x5d2f47){_0x1b2929(_0x471e59[_0x27c6('0x74')],_0x3df3fd,_0x471e59['options'])[_0x27c6('0x32')](function(_0x272f28){_0x102caf(_0x272f28);})[_0x27c6('0x40')](function(_0x1f0d2f){_0x5d2f47(_0x1f0d2f);});});}function verifyJwt(_0x2ab86e,_0x1480e0,_0x4bffa7){var _0x19e494=BPromise['promisify'](jwt[_0x27c6('0x75')],{'context':jwt});var _0xc541f9=_0x4bffa7||config['secrets'][_0x27c6('0x73')];return new BPromise(function(_0x139942,_0x583de2){_0x19e494(_0x2ab86e,_0xc541f9,_0x1480e0)[_0x27c6('0x32')](function(_0x808cf4){_0x139942(_0x808cf4);})[_0x27c6('0x40')](function(_0x439836){_0x583de2(_0x439836);});});}function generateNonce(){return crypto[_0x27c6('0x76')](0x10)[_0x27c6('0x77')](_0x27c6('0x78'));}function generateIssuedAt(){return Math[_0x27c6('0x79')](Date['now']()/0x3e8)[_0x27c6('0x77')]();}function createJwt(_0x23b7e8){var _0x1e9680={'payload':{'iat':_0x23b7e8['apiKeyIat'],'nonce':_0x23b7e8['apiKeyNonce']},'options':{'algorithm':_0x27c6('0x7a'),'subject':_0x23b7e8['id']['toString'](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0x27c6('0x45')]()}};return signJwt(_0x1e9680)[_0x27c6('0x32')](function(_0x40ec8e){return{'iat':_0x23b7e8[_0x27c6('0x60')],'nonce':_0x23b7e8[_0x27c6('0x4b')],'token':_0x40ec8e};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 44a5967..7114c97 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 _0x713f=['indexOf','hasOwnProperty','createReadStream','createWriteStream','data','update','binary','write','end','final','close','unlink','decryptFile','createDecipher','encryptString','secret','createCipher','utf8','base64','decryptString','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers'];(function(_0x172660,_0x260d9b){var _0x83204f=function(_0x4d6c80){while(--_0x4d6c80){_0x172660['push'](_0x172660['shift']());}};_0x83204f(++_0x260d9b);}(_0x713f,0x1c4));var _0xf713=function(_0x6826ae,_0x50b70b){_0x6826ae=_0x6826ae-0x0;var _0x4e0cf8=_0x713f[_0x6826ae];return _0x4e0cf8;};'use strict';var crypto=require(_0xf713('0x0'));var fs=require('fs');var BPromise=require(_0xf713('0x1'));var _=require(_0xf713('0x2'));var config=require(_0xf713('0x3'));var logger=require(_0xf713('0x4'))(_0xf713('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xf713('0x6')][_0xf713('0x7')],'algorithm':_0xf713('0x8')};const fileOptions={'algorithm':_0xf713('0x9')};if(config['encrypt']&&config[_0xf713('0xa')]['algorithm']){var isSupported=isAlgorithmSupported(config['encrypt'][_0xf713('0xb')]);if(isSupported){fileOptions[_0xf713('0xb')]=config[_0xf713('0xa')][_0xf713('0xb')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xf713('0xc')](',\x20');logger[_0xf713('0xd')](config[_0xf713('0xa')]['algorithm'],_0xf713('0xe'),supportedAlgorithms);}}function isASupportedCipher(_0x4633f2){return AES_SUPPORTED_RX['test'](_0x4633f2);}function getSupportedCiphers(){return crypto[_0xf713('0xf')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x20e932){return getSupportedCiphers()[_0xf713('0x10')](_0x20e932)>-0x1;}function combineOptions(_0x3b459e){var _0x4bea5e={};for(var _0x113470 in fileOptions){if(fileOptions['hasOwnProperty'](_0x113470)){_0x4bea5e[_0x113470]=fileOptions[_0x113470];}}if(_0x3b459e){for(var _0x13b88c in _0x3b459e){if(_0x3b459e[_0xf713('0x11')](_0x13b88c)){_0x4bea5e[_0x13b88c]=_0x3b459e[_0x13b88c];}}}return _0x4bea5e;}exports['encryptFile']=function(_0x2291a5,_0x4f9538,_0x48dd3c,_0x25f9dd){return new BPromise(function(_0x47e97a,_0x2fe9d9){_0x25f9dd=combineOptions(_0x25f9dd);var _0x34c3ef=new Buffer(_0x48dd3c);var _0x4d1a3d=fs[_0xf713('0x12')](_0x2291a5);var _0x33587b=fs[_0xf713('0x13')](_0x4f9538);var _0x28936c=crypto['createCipher'](_0x25f9dd['algorithm'],_0x34c3ef);_0x4d1a3d['on'](_0xf713('0x14'),function(_0x5ab2bc){var _0x2eaf5b=new Buffer(_0x28936c[_0xf713('0x15')](_0x5ab2bc),_0xf713('0x16'));_0x33587b[_0xf713('0x17')](_0x2eaf5b);});_0x4d1a3d['on'](_0xf713('0x18'),function(){try{var _0x49fdfc=new Buffer(_0x28936c[_0xf713('0x19')]('binary'),'binary');_0x33587b[_0xf713('0x17')](_0x49fdfc);_0x33587b[_0xf713('0x18')]();_0x33587b['on'](_0xf713('0x1a'),function(){return _0x47e97a(_0x4f9538);});}catch(_0x1ce26e){fs[_0xf713('0x1b')](_0x4f9538);return _0x2fe9d9(_0x1ce26e);}});});};exports[_0xf713('0x1c')]=function(_0x28bf7c,_0x188ec8,_0xe1ee8c,_0xa9597b){return new BPromise(function(_0x524382,_0x2916c3){_0xa9597b=combineOptions(_0xa9597b);var _0x1f580b=new Buffer(_0xe1ee8c);var _0x4ae3cf=fs[_0xf713('0x12')](_0x28bf7c);var _0x1e406c=fs['createWriteStream'](_0x188ec8);var _0x825dbf=crypto[_0xf713('0x1d')](_0xa9597b[_0xf713('0xb')],_0x1f580b);_0x4ae3cf['on'](_0xf713('0x14'),function(_0x40b3de){var _0x184d4e=new Buffer(_0x825dbf[_0xf713('0x15')](_0x40b3de),_0xf713('0x16'));_0x1e406c[_0xf713('0x17')](_0x184d4e);});_0x4ae3cf['on'](_0xf713('0x18'),function(){try{var _0xd70ba2=new Buffer(_0x825dbf[_0xf713('0x19')](_0xf713('0x16')),_0xf713('0x16'));_0x1e406c[_0xf713('0x17')](_0xd70ba2);_0x1e406c['end']();_0x1e406c['on'](_0xf713('0x1a'),function(){return _0x524382(_0x188ec8);});}catch(_0x5b6291){fs[_0xf713('0x1b')](_0x188ec8);return _0x2916c3(_0x5b6291);}});});};exports[_0xf713('0x1e')]=function(_0x3fffa3,_0x7c9a0c,_0x486b05){var _0x506dfa=_0x486b05||stringOptions['algorithm'];var _0x2025e5=_0x7c9a0c||stringOptions[_0xf713('0x1f')];var _0x595836=crypto[_0xf713('0x20')](_0x506dfa,_0x2025e5);var _0x57114d=_0x595836['update'](_0x3fffa3,_0xf713('0x21'),_0xf713('0x22'));_0x57114d+=_0x595836[_0xf713('0x19')](_0xf713('0x22'));return _0x57114d;};exports[_0xf713('0x23')]=function(_0x3b0fde,_0x3d5012,_0x46fb7b){var _0x346924=_0x46fb7b||stringOptions[_0xf713('0xb')];var _0x22365c=_0x3d5012||stringOptions[_0xf713('0x1f')];var _0x4eb9ee=crypto[_0xf713('0x1d')](_0x346924,_0x22365c);var _0x1ee0d6=_0x4eb9ee[_0xf713('0x15')](_0x3b0fde,_0xf713('0x22'),_0xf713('0x21'));_0x1ee0d6+=_0x4eb9ee['final'](_0xf713('0x21'));return _0x1ee0d6;}; \ No newline at end of file +var _0xaeb2=['write','final','binary','end','close','createReadStream','createWriteStream','createDecipher','encryptString','utf8','base64','decryptString','secret','crypto','lodash','../../config/environment','../../config/logger','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','error','test','getCiphers','filter','indexOf','hasOwnProperty','createCipher','data','update'];(function(_0x4d938c,_0x957d2e){var _0x245628=function(_0x439b57){while(--_0x439b57){_0x4d938c['push'](_0x4d938c['shift']());}};_0x245628(++_0x957d2e);}(_0xaeb2,0x16d));var _0x2aeb=function(_0x5a3234,_0x520408){_0x5a3234=_0x5a3234-0x0;var _0x359190=_0xaeb2[_0x5a3234];return _0x359190;};'use strict';var crypto=require(_0x2aeb('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0x2aeb('0x1'));var config=require(_0x2aeb('0x2'));var logger=require(_0x2aeb('0x3'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x2aeb('0x4')][_0x2aeb('0x5')],'algorithm':_0x2aeb('0x6')};const fileOptions={'algorithm':_0x2aeb('0x7')};if(config[_0x2aeb('0x8')]&&config[_0x2aeb('0x8')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0x2aeb('0x8')]['algorithm']);if(isSupported){fileOptions[_0x2aeb('0x9')]=config[_0x2aeb('0x8')][_0x2aeb('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0x2aeb('0xa')](config[_0x2aeb('0x8')][_0x2aeb('0x9')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0xb4643){return AES_SUPPORTED_RX[_0x2aeb('0xb')](_0xb4643);}function getSupportedCiphers(){return crypto[_0x2aeb('0xc')]()[_0x2aeb('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x11b39f){return getSupportedCiphers()[_0x2aeb('0xe')](_0x11b39f)>-0x1;}function combineOptions(_0x4158b3){var _0x24e18d={};for(var _0x892009 in fileOptions){if(fileOptions[_0x2aeb('0xf')](_0x892009)){_0x24e18d[_0x892009]=fileOptions[_0x892009];}}if(_0x4158b3){for(var _0x193580 in _0x4158b3){if(_0x4158b3[_0x2aeb('0xf')](_0x193580)){_0x24e18d[_0x193580]=_0x4158b3[_0x193580];}}}return _0x24e18d;}exports['encryptFile']=function(_0x51c486,_0x1ea251,_0x4c2aff,_0x4f4c27){return new BPromise(function(_0x4c9b35,_0x20ba43){_0x4f4c27=combineOptions(_0x4f4c27);var _0x2bc4f0=new Buffer(_0x4c2aff);var _0x25aac9=fs['createReadStream'](_0x51c486);var _0x4954de=fs['createWriteStream'](_0x1ea251);var _0xb923d7=crypto[_0x2aeb('0x10')](_0x4f4c27[_0x2aeb('0x9')],_0x2bc4f0);_0x25aac9['on'](_0x2aeb('0x11'),function(_0x510175){var _0x255c52=new Buffer(_0xb923d7[_0x2aeb('0x12')](_0x510175),'binary');_0x4954de[_0x2aeb('0x13')](_0x255c52);});_0x25aac9['on']('end',function(){try{var _0x50fcb9=new Buffer(_0xb923d7[_0x2aeb('0x14')](_0x2aeb('0x15')),_0x2aeb('0x15'));_0x4954de['write'](_0x50fcb9);_0x4954de[_0x2aeb('0x16')]();_0x4954de['on'](_0x2aeb('0x17'),function(){return _0x4c9b35(_0x1ea251);});}catch(_0x2a525f){fs['unlink'](_0x1ea251);return _0x20ba43(_0x2a525f);}});});};exports['decryptFile']=function(_0x552741,_0x1ce9c2,_0x27d3e7,_0x351764){return new BPromise(function(_0x579d89,_0x1259b4){_0x351764=combineOptions(_0x351764);var _0x37229f=new Buffer(_0x27d3e7);var _0x20fa89=fs[_0x2aeb('0x18')](_0x552741);var _0x2b15e0=fs[_0x2aeb('0x19')](_0x1ce9c2);var _0xd92b3f=crypto[_0x2aeb('0x1a')](_0x351764[_0x2aeb('0x9')],_0x37229f);_0x20fa89['on'](_0x2aeb('0x11'),function(_0x203382){var _0x5917f7=new Buffer(_0xd92b3f[_0x2aeb('0x12')](_0x203382),'binary');_0x2b15e0[_0x2aeb('0x13')](_0x5917f7);});_0x20fa89['on']('end',function(){try{var _0x5b5a13=new Buffer(_0xd92b3f['final']('binary'),_0x2aeb('0x15'));_0x2b15e0[_0x2aeb('0x13')](_0x5b5a13);_0x2b15e0[_0x2aeb('0x16')]();_0x2b15e0['on'](_0x2aeb('0x17'),function(){return _0x579d89(_0x1ce9c2);});}catch(_0x35cf3f){fs['unlink'](_0x1ce9c2);return _0x1259b4(_0x35cf3f);}});});};exports[_0x2aeb('0x1b')]=function(_0x5e984e,_0xac0370,_0x3af407){var _0x5a8bea=_0x3af407||stringOptions[_0x2aeb('0x9')];var _0x1c709a=_0xac0370||stringOptions['secret'];var _0x1f4335=crypto['createCipher'](_0x5a8bea,_0x1c709a);var _0x1f76f0=_0x1f4335[_0x2aeb('0x12')](_0x5e984e,_0x2aeb('0x1c'),_0x2aeb('0x1d'));_0x1f76f0+=_0x1f4335[_0x2aeb('0x14')]('base64');return _0x1f76f0;};exports[_0x2aeb('0x1e')]=function(_0xd6cffb,_0x1bcd71,_0x4a3498){var _0x17cdb8=_0x4a3498||stringOptions['algorithm'];var _0x16e0a6=_0x1bcd71||stringOptions[_0x2aeb('0x1f')];var _0x175294=crypto[_0x2aeb('0x1a')](_0x17cdb8,_0x16e0a6);var _0xb65bba=_0x175294[_0x2aeb('0x12')](_0xd6cffb,_0x2aeb('0x1d'),_0x2aeb('0x1c'));_0xb65bba+=_0x175294[_0x2aeb('0x14')](_0x2aeb('0x1c'));return _0xb65bba;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 4957db4..1e89175 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 _0x1c87=['csv','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','split','then','splitSizeCsv','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','length','range','isInteger','push','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.csv','existsSync','join','mkdirSync','%s.%s','writeFileSync','zip'];(function(_0x2fb87e,_0x483324){var _0x5de4c1=function(_0x4464b5){while(--_0x4464b5){_0x2fb87e['push'](_0x2fb87e['shift']());}};_0x5de4c1(++_0x483324);}(_0x1c87,0xc3));var _0x71c8=function(_0x3cb7d1,_0x1542e6){_0x3cb7d1=_0x3cb7d1-0x0;var _0x3bc31a=_0x1c87[_0x3cb7d1];return _0x3bc31a;};'use strict';var util=require(_0x71c8('0x0'));var path=require(_0x71c8('0x1'));var _=require('lodash');var csv=require(_0x71c8('0x2'));var fs=require('fs');var BPromise=require(_0x71c8('0x3'));var zipdir=require(_0x71c8('0x4'));var rimraf=require(_0x71c8('0x5'));var db=require(_0x71c8('0x6'))['db'];var dbH=require('../../mysqldb')[_0x71c8('0x7')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x71c8('0x8')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x71c8('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3534ae,_0x4746a2){var _0xf39a73={'status':_0x3534ae};var _0x4b5007={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4746a2){_0xf39a73[_0x71c8('0x9')]=_0x4746a2;}return db[_0x71c8('0xa')][_0x71c8('0xb')](_0xf39a73,_0x4b5007);}function main(){var _0xb54775=0x1388;var _0x45ca97;logger[_0x71c8('0xc')](util[_0x71c8('0xd')](_0x71c8('0xe'),EXTRACTED_REPORT_ID,_0x71c8('0xf')));return db[_0x71c8('0x10')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x71c8('0x11'),'splitSizeCsv']})[_0x71c8('0x12')](function(_0x1a3daa){if(_0x1a3daa){_0x45ca97=_0x1a3daa;_0xb54775=_0x45ca97[_0x71c8('0x13')]||0x1388;}})[_0x71c8('0x12')](function(){return dbH[_0x71c8('0x14')][_0x71c8('0x15')](util['format'](_0x71c8('0x16'),QUERY),{'type':dbH[_0x71c8('0x14')][_0x71c8('0x17')]['SELECT']});})[_0x71c8('0x12')](function(_0xd32cd4){if(!_0xd32cd4[0x0][_0x71c8('0x18')]){return analyticExtractedReport(_0x71c8('0x19'));}var _0x231643=[];var _0x211b2e=0x0;if(_0x45ca97[_0x71c8('0x11')]){if(_0xd32cd4&&_0xd32cd4[_0x71c8('0x1a')]){var _0x5c80a8=_[_0x71c8('0x1b')](_0xd32cd4[0x0][_0x71c8('0x18')]/_0xb54775);var _0xe9ccc0=Number[_0x71c8('0x1c')](_0xd32cd4[0x0]['num']/_0xb54775)?_0xd32cd4[0x0]['num']%_0xb54775:0x0;_0x5c80a8['forEach'](function(_0x43a200){if(_0x43a200>0x0){_0x211b2e+=_0xb54775;}_0x231643[_0x71c8('0x1d')](dbH['sequelize'][_0x71c8('0x15')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xb54775,_0x211b2e),{'type':dbH[_0x71c8('0x14')][_0x71c8('0x17')][_0x71c8('0x1e')]}));});if(_0xe9ccc0>0x0){_0x211b2e+=_0xb54775;_0x231643[_0x71c8('0x1d')](dbH[_0x71c8('0x14')][_0x71c8('0x15')](util[_0x71c8('0xd')](_0x71c8('0x1f'),QUERY,_0xe9ccc0,_0x211b2e),{'type':dbH[_0x71c8('0x14')][_0x71c8('0x17')]['SELECT']}));}}}else{_0x231643[_0x71c8('0x1d')](dbH[_0x71c8('0x14')][_0x71c8('0x15')](QUERY,{'type':dbH[_0x71c8('0x14')][_0x71c8('0x17')]['SELECT']}));}var _0x4bbc10=path[_0x71c8('0x20')](PATH);var _0x46bfd3=path['basename'](PATH,_0x71c8('0x21'));var _0x295466=_0x45ca97[_0x71c8('0x11')]&&_0x231643['length']>0x1;var _0x5660f1=[];if(!fs[_0x71c8('0x22')](path[_0x71c8('0x23')](_0x4bbc10,_0x46bfd3))&&_0x295466){fs[_0x71c8('0x24')](path[_0x71c8('0x23')](_0x4bbc10,_0x46bfd3));}return BPromise['each'](_0x231643,function(_0x21c2aa){_0x5660f1[_0x71c8('0x1d')](_0x21c2aa);})['then'](function(){for(var _0xc89337=0x0;_0xc89337<_0x5660f1['length'];_0xc89337+=0x1){var _0x213188;var _0x1ce3de=_0x5660f1[_0xc89337];if(_0x295466){_0x213188=path[_0x71c8('0x23')](_0x4bbc10,_0x46bfd3,util[_0x71c8('0xd')]('%s%d.%s',_0x46bfd3,_0xc89337,'csv'));}else{_0x213188=path[_0x71c8('0x23')](_0x4bbc10,util[_0x71c8('0xd')](_0x71c8('0x25'),_0x46bfd3,'csv'));}fs[_0x71c8('0x26')](_0x213188,csv(_0x1ce3de));}})[_0x71c8('0x12')](function(){if(_0x295466){return new Promise(function(_0xc9a16c){zipdir(path[_0x71c8('0x23')](_0x4bbc10,_0x46bfd3),{'saveTo':path['join'](_0x4bbc10,util[_0x71c8('0xd')](_0x71c8('0x25'),_0x46bfd3,_0x71c8('0x27')))},function(_0x6ed109,_0xce6166){rimraf(path['join'](_0x4bbc10,_0x46bfd3),function(){});_0xc9a16c('zip\x20finished');});});}})[_0x71c8('0x12')](function(){logger[_0x71c8('0xc')](util[_0x71c8('0xd')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x71c8('0xf')));return analyticExtractedReport('Completed',_0x295466?util['format']('%s.%s',_0x46bfd3,_0x295466?_0x71c8('0x27'):_0x71c8('0x28')):null);});})[_0x71c8('0x29')](function(_0x5d2ec9){logger[_0x71c8('0xc')](util[_0x71c8('0xd')](_0x71c8('0x2a'),EXTRACTED_REPORT_ID,_0x71c8('0xf')),util[_0x71c8('0x2b')](_0x5d2ec9,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x71c8('0x2c'));})[_0x71c8('0x2d')](function(){process[_0x71c8('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x1a63=['Failed','finally','util','path','lodash','to-csv','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','split','splitSizeCsv','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','Empty','range','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','length','existsSync','join','mkdirSync','%s%d.%s','%s.%s','csv','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format'];(function(_0x3b0b07,_0xc927c6){var _0x198e38=function(_0x19377d){while(--_0x19377d){_0x3b0b07['push'](_0x3b0b07['shift']());}};_0x198e38(++_0xc927c6);}(_0x1a63,0x192));var _0x31a6=function(_0x4de184,_0x2c7f5d){_0x4de184=_0x4de184-0x0;var _0x233a76=_0x1a63[_0x4de184];return _0x233a76;};'use strict';var util=require(_0x31a6('0x0'));var path=require(_0x31a6('0x1'));var _=require(_0x31a6('0x2'));var csv=require(_0x31a6('0x3'));var fs=require('fs');var BPromise=require(_0x31a6('0x4'));var zipdir=require(_0x31a6('0x5'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0x31a6('0x6'))[_0x31a6('0x7')];var logger=require(_0x31a6('0x8'))(_0x31a6('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x31a6('0xa')][0x2]);var QUERY=process[_0x31a6('0xa')][0x3];var PATH=process[_0x31a6('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xd5d761,_0x794f93){var _0x3bde1e={'status':_0xd5d761};var _0x632eee={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x794f93){_0x3bde1e[_0x31a6('0xb')]=_0x794f93;}return db['AnalyticExtractedReport'][_0x31a6('0xc')](_0x3bde1e,_0x632eee);}function main(){var _0x4885b4=0x1388;var _0xb6ff9a;logger[_0x31a6('0xd')](util[_0x31a6('0xe')](_0x31a6('0xf'),EXTRACTED_REPORT_ID,_0x31a6('0x10')));return db[_0x31a6('0x11')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x31a6('0x12'),_0x31a6('0x13')]})[_0x31a6('0x14')](function(_0x22d5fb){if(_0x22d5fb){_0xb6ff9a=_0x22d5fb;_0x4885b4=_0xb6ff9a['splitSizeCsv']||0x1388;}})[_0x31a6('0x14')](function(){return dbH['sequelize'][_0x31a6('0x15')](util[_0x31a6('0xe')](_0x31a6('0x16'),QUERY),{'type':dbH[_0x31a6('0x17')][_0x31a6('0x18')][_0x31a6('0x19')]});})[_0x31a6('0x14')](function(_0x45e075){if(!_0x45e075[0x0][_0x31a6('0x1a')]){return analyticExtractedReport(_0x31a6('0x1b'));}var _0x2ee73e=[];var _0x5aed42=0x0;if(_0xb6ff9a[_0x31a6('0x12')]){if(_0x45e075&&_0x45e075['length']){var _0x133a4e=_[_0x31a6('0x1c')](_0x45e075[0x0][_0x31a6('0x1a')]/_0x4885b4);var _0xa35903=Number[_0x31a6('0x1d')](_0x45e075[0x0]['num']/_0x4885b4)?_0x45e075[0x0][_0x31a6('0x1a')]%_0x4885b4:0x0;_0x133a4e['forEach'](function(_0x5915de){if(_0x5915de>0x0){_0x5aed42+=_0x4885b4;}_0x2ee73e[_0x31a6('0x1e')](dbH[_0x31a6('0x17')][_0x31a6('0x15')](util[_0x31a6('0xe')](_0x31a6('0x1f'),QUERY,_0x4885b4,_0x5aed42),{'type':dbH['sequelize']['QueryTypes'][_0x31a6('0x19')]}));});if(_0xa35903>0x0){_0x5aed42+=_0x4885b4;_0x2ee73e[_0x31a6('0x1e')](dbH[_0x31a6('0x17')][_0x31a6('0x15')](util[_0x31a6('0xe')](_0x31a6('0x1f'),QUERY,_0xa35903,_0x5aed42),{'type':dbH[_0x31a6('0x17')]['QueryTypes'][_0x31a6('0x19')]}));}}}else{_0x2ee73e[_0x31a6('0x1e')](dbH['sequelize']['query'](QUERY,{'type':dbH[_0x31a6('0x17')][_0x31a6('0x18')][_0x31a6('0x19')]}));}var _0x96fcb1=path[_0x31a6('0x20')](PATH);var _0x2514be=path[_0x31a6('0x21')](PATH,_0x31a6('0x22'));var _0x297a24=_0xb6ff9a[_0x31a6('0x12')]&&_0x2ee73e[_0x31a6('0x23')]>0x1;var _0x4c3382=[];if(!fs[_0x31a6('0x24')](path[_0x31a6('0x25')](_0x96fcb1,_0x2514be))&&_0x297a24){fs[_0x31a6('0x26')](path[_0x31a6('0x25')](_0x96fcb1,_0x2514be));}return BPromise['each'](_0x2ee73e,function(_0x55036c){_0x4c3382['push'](_0x55036c);})['then'](function(){for(var _0x45663d=0x0;_0x45663d<_0x4c3382[_0x31a6('0x23')];_0x45663d+=0x1){var _0x51b0f1;var _0x230806=_0x4c3382[_0x45663d];if(_0x297a24){_0x51b0f1=path[_0x31a6('0x25')](_0x96fcb1,_0x2514be,util[_0x31a6('0xe')](_0x31a6('0x27'),_0x2514be,_0x45663d,'csv'));}else{_0x51b0f1=path[_0x31a6('0x25')](_0x96fcb1,util[_0x31a6('0xe')](_0x31a6('0x28'),_0x2514be,_0x31a6('0x29')));}fs[_0x31a6('0x2a')](_0x51b0f1,csv(_0x230806));}})['then'](function(){if(_0x297a24){return new Promise(function(_0x3d803a){zipdir(path[_0x31a6('0x25')](_0x96fcb1,_0x2514be),{'saveTo':path[_0x31a6('0x25')](_0x96fcb1,util[_0x31a6('0xe')]('%s.%s',_0x2514be,_0x31a6('0x2b')))},function(_0xdaffa9,_0x42e40c){rimraf(path[_0x31a6('0x25')](_0x96fcb1,_0x2514be),function(){});_0x3d803a(_0x31a6('0x2c'));});});}})[_0x31a6('0x14')](function(){logger[_0x31a6('0xd')](util[_0x31a6('0xe')](_0x31a6('0x2d'),EXTRACTED_REPORT_ID,_0x31a6('0x10')));return analyticExtractedReport('Completed',_0x297a24?util[_0x31a6('0xe')](_0x31a6('0x28'),_0x2514be,_0x297a24?'zip':_0x31a6('0x29')):null);});})[_0x31a6('0x2e')](function(_0x573586){logger[_0x31a6('0xd')](util[_0x31a6('0xe')](_0x31a6('0x2f'),EXTRACTED_REPORT_ID,_0x31a6('0x10')),util['inspect'](_0x573586,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x31a6('0x30'));})[_0x31a6('0x31')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 580277a..d87eda5 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 _0xb6f1=['zip\x20finished','info','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','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','channel','YYYY-MM-DD','Arial','center','Interaction\x20Transcript','header','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','end','createPdfFromHTML','path','lodash','html-to-pdfmake','zip-dir','rimraf','jsdom','window','bluebird','../../mysqldb','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','pick','toString','fill','length','auto','body','concat','chunk','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','endDate','push','pageBreak','before','margin','footer','right','num','split','then','isInteger','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','QueryTypes','SELECT','dirname','.pdf','existsSync','join','mkdirSync','each','flatten','createPdfKitDocument','%s%d.%s','%s.%s','pdf','all','zip'];(function(_0x524731,_0x5bcd0a){var _0x2dcf54=function(_0x248c0b){while(--_0x248c0b){_0x524731['push'](_0x524731['shift']());}};_0x2dcf54(++_0x5bcd0a);}(_0xb6f1,0x71));var _0x1b6f=function(_0x3e961c,_0x5747e7){_0x3e961c=_0x3e961c-0x0;var _0x474f9c=_0xb6f1[_0x3e961c];return _0x474f9c;};'use strict';var _=require(_0x1b6f('0x0'));var fs=require('fs');var util=require('util');var path=require('path');var moment=require('moment');var htmlToPdfmake=require(_0x1b6f('0x1'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0x1b6f('0x2'));var rimraf=require(_0x1b6f('0x3'));var JSDOM=require(_0x1b6f('0x4'))['JSDOM'];var window=new JSDOM('')[_0x1b6f('0x5')];var BPromise=require(_0x1b6f('0x6'));var db=require(_0x1b6f('0x7'))['db'];var dbH=require(_0x1b6f('0x7'))['dbH'];var logger=require('../../config/logger')(_0x1b6f('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x1b6f('0x9')][0x2]);var QUERY=process[_0x1b6f('0x9')][0x3];var PATH=process[_0x1b6f('0x9')][0x4];var NAME=process[_0x1b6f('0x9')][0x5];var FORMAT=_0x1b6f('0xa');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x351f0a,_0x163050){var _0x209baf={'status':_0x351f0a};var _0x5e965f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x163050){_0x209baf[_0x1b6f('0xb')]=_0x163050;}return db[_0x1b6f('0xc')][_0x1b6f('0xd')](_0x209baf,_0x5e965f);}function getHeaders(_0x5f1535){return _[_0x1b6f('0xe')](_0x5f1535,function(_0x2bb4fe){return{'text':_0x2bb4fe,'style':_0x1b6f('0xf')};});}function getRows(_0x5f3c10,_0x49bcd7){return _[_0x1b6f('0xe')](_0x49bcd7,function(_0x16bdbe){return _(_0x16bdbe)[_0x1b6f('0x10')](_0x5f3c10)[_0x1b6f('0xe')](function(_0x12f37a){return _0x12f37a?_[_0x1b6f('0x11')](_0x12f37a):'';})['value']();});}function createTable(_0x2e443d,_0x586ccb){var _0x5285a1={'widths':_[_0x1b6f('0x12')](Array(_0x2e443d[_0x1b6f('0x13')]),0x91),'heights':function(_0x420d2b){return _0x420d2b===0x0?_0x1b6f('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x6a8ec4=getHeaders(_0x2e443d);_0x5285a1[_0x1b6f('0x15')]['push'](_0x6a8ec4);var _0x267478=getRows(_0x2e443d,_0x586ccb);_0x5285a1[_0x1b6f('0x15')]=_0x5285a1[_0x1b6f('0x15')][_0x1b6f('0x16')](_0x267478);return _0x5285a1;}function createTables(_0x303efb){var _0x3eb80d=[];var _0x548fb9=_[_0x1b6f('0x17')](Object['keys'](_0x303efb[0x0]),0x5);_0x548fb9[_0x1b6f('0x18')](function(_0x431bcb){_0x3eb80d['push'](createTable(_0x431bcb,_0x303efb));});return _0x3eb80d;}function getPDFDocDefinition(_0x3865bc){var _0x29a5ca=util[_0x1b6f('0x19')](_0x1b6f('0x1a'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT['startDate'])['format'](FORMAT),moment(EXTRACTED_REPORT[_0x1b6f('0x1b')])[_0x1b6f('0x19')](FORMAT));var _0x3d7628=[];for(var _0x2a53ef=0x0;_0x2a53ef<_0x3865bc[_0x1b6f('0x13')];_0x2a53ef++){var _0x1fafcc=[];if(_0x2a53ef===0x0){_0x1fafcc[_0x1b6f('0x1c')]({'text':_0x29a5ca,'style':'header'});}var _0x270806={'table':_0x3865bc[_0x2a53ef]};if(_0x2a53ef>0x0){_0x270806[_0x1b6f('0x1d')]=_0x1b6f('0x1e');_0x270806[_0x1b6f('0x1f')]=[0x0,0x46,0x0,0x0];}_0x1fafcc[_0x1b6f('0x1c')](_0x270806);_0x3d7628[_0x1b6f('0x1c')](_0x1fafcc);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x3d7628,'footer':function(_0x42fba6,_0x4f0b76){return{'text':_0x42fba6['toString']()+'\x20/\x20'+_0x4f0b76,'style':_0x1b6f('0x20')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0x1b6f('0x21'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x178dab){var _0x263f9d=0x1388;var _0x359bc8;if(!_0x178dab[0x0][_0x1b6f('0x22')]){return analyticExtractedReport('Empty');}return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x1b6f('0x23'),'splitSizePdf']})[_0x1b6f('0x24')](function(_0x4d05e8){if(_0x4d05e8){_0x359bc8=_0x4d05e8;_0x263f9d=_0x359bc8['splitSizePdf']||0x3e8;}})[_0x1b6f('0x24')](function(){var _0x45d358=[];var _0x26c621=0x0;if(_0x359bc8[_0x1b6f('0x23')]){if(_0x178dab&&_0x178dab[_0x1b6f('0x13')]){var _0x1ab081=_['range'](_0x178dab[0x0][_0x1b6f('0x22')]/_0x263f9d);var _0x25c9ca=Number[_0x1b6f('0x25')](_0x178dab[0x0]['num']/_0x263f9d)?_0x178dab[0x0]['num']%_0x263f9d:0x0;_0x1ab081[_0x1b6f('0x18')](function(_0x34cb6b){if(_0x34cb6b>0x0){_0x26c621+=_0x263f9d;}_0x45d358[_0x1b6f('0x1c')](dbH['sequelize']['query'](util['format'](_0x1b6f('0x26'),QUERY,_0x263f9d,_0x26c621),{'type':dbH[_0x1b6f('0x27')][_0x1b6f('0x28')][_0x1b6f('0x29')]}));});if(_0x25c9ca>0x0){_0x26c621+=_0x263f9d;_0x45d358[_0x1b6f('0x1c')](dbH['sequelize']['query'](util[_0x1b6f('0x19')](_0x1b6f('0x26'),QUERY,_0x25c9ca,_0x26c621),{'type':dbH[_0x1b6f('0x27')][_0x1b6f('0x28')][_0x1b6f('0x29')]}));}}}else{_0x45d358['push'](dbH[_0x1b6f('0x27')]['query'](QUERY,{'type':dbH[_0x1b6f('0x27')]['QueryTypes'][_0x1b6f('0x29')]}));}var _0x5a8f09=path[_0x1b6f('0x2a')](PATH);var _0x14685f=path['basename'](PATH,_0x1b6f('0x2b'));var _0xad21cd=_0x359bc8[_0x1b6f('0x23')]&&_0x45d358[_0x1b6f('0x13')]>0x1;var _0xd5f15d=[];if(!fs[_0x1b6f('0x2c')](path[_0x1b6f('0x2d')](_0x5a8f09,_0x14685f))&&_0xad21cd){fs[_0x1b6f('0x2e')](path['join'](_0x5a8f09,_0x14685f));}return BPromise[_0x1b6f('0x2f')](_0x45d358,function(_0x494b0e){_0xd5f15d[_0x1b6f('0x1c')](_0x494b0e);})['then'](function(){var _0x4d3749=[];for(var _0x430a17=0x0;_0x430a17<_0xd5f15d['length'];_0x430a17+=0x1){var _0x3157f9=_0xd5f15d[_0x430a17];var _0x552fba=createTables(_[_0x1b6f('0x30')](_0x3157f9));var _0x360466;var _0x397a11=getPDFDocDefinition(_0x552fba);var _0x15c46c=getPDFPrinter();var _0x3c67c1=_0x15c46c[_0x1b6f('0x31')](_0x397a11);if(_0xad21cd){_0x360466=path['join'](_0x5a8f09,_0x14685f,util[_0x1b6f('0x19')](_0x1b6f('0x32'),_0x14685f,_0x430a17,'pdf'));}else{_0x360466=path[_0x1b6f('0x2d')](_0x5a8f09,util[_0x1b6f('0x19')](_0x1b6f('0x33'),_0x14685f,_0x1b6f('0x34')));}_0x4d3749[_0x1b6f('0x1c')](writePDFDocument(_0x3c67c1,_0x360466));}return Promise[_0x1b6f('0x35')](_0x4d3749);})[_0x1b6f('0x24')](function(){if(_0xad21cd){return new Promise(function(_0x5e3e08){zipdir(path[_0x1b6f('0x2d')](_0x5a8f09,_0x14685f),{'saveTo':path[_0x1b6f('0x2d')](_0x5a8f09,util[_0x1b6f('0x19')]('%s.%s',_0x14685f,_0x1b6f('0x36')))},function(){rimraf(path[_0x1b6f('0x2d')](_0x5a8f09,_0x14685f),function(){});_0x5e3e08(_0x1b6f('0x37'));});});}})[_0x1b6f('0x24')](function(){if(!_0xad21cd)return;rimraf(path['join'](_0x5a8f09,_0x14685f),function(){});})[_0x1b6f('0x24')](function(){logger[_0x1b6f('0x38')](util[_0x1b6f('0x19')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x1b6f('0x39')));return analyticExtractedReport(_0x1b6f('0x3a'),_0xad21cd?util[_0x1b6f('0x19')](_0x1b6f('0x33'),_0x14685f,_0xad21cd?_0x1b6f('0x36'):'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0x1b6f('0x19')](_0x1b6f('0x3b'),EXTRACTED_REPORT_ID,_0x1b6f('0x39')));return db[_0x1b6f('0xc')][_0x1b6f('0x3c')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x1b6f('0x24')](function(_0x2263ed){EXTRACTED_REPORT=_0x2263ed;return dbH[_0x1b6f('0x27')][_0x1b6f('0x3d')](util[_0x1b6f('0x19')](_0x1b6f('0x3e'),QUERY),{'type':dbH['sequelize'][_0x1b6f('0x28')][_0x1b6f('0x29')]});})[_0x1b6f('0x24')](extractReport)['catch'](function(_0x1e7a48){logger[_0x1b6f('0x38')](util[_0x1b6f('0x19')](_0x1b6f('0x3f'),EXTRACTED_REPORT_ID,'PDF'),util[_0x1b6f('0x40')](_0x1e7a48,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x1b6f('0x41'));})[_0x1b6f('0x42')](function(){process[_0x1b6f('0x43')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x5b9c5f=new PdfPrinter({'Arial':{'normal':__dirname+_0x1b6f('0x44'),'bold':__dirname+_0x1b6f('0x45'),'italics':__dirname+_0x1b6f('0x46'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x5b9c5f;}function getPDFDocDefinitionFromHTML(_0x49623a,_0x1d8533){var _0x579019=util[_0x1b6f('0x19')]('%s\x20#%d',_0x1d8533[_0x1b6f('0x47')],_0x1d8533['interactionId']);var _0x45cd0c=moment()[_0x1b6f('0x19')](_0x1b6f('0x48'))[_0x1b6f('0x11')]();var _0x32f98d=htmlToPdfmake(_0x49623a,{'window':window,'tableAutoSize':!![]});return{'content':[_0x32f98d],'defaultStyle':{'font':_0x1b6f('0x49')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x1b6f('0x4a'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x1b6f('0x4a'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x1b6f('0x4a')}},'header':function(){return[{'text':_0x1b6f('0x4b'),'style':_0x1b6f('0x4c')}];},'footer':function(_0x561ee5,_0x2f6208){return[{'text':util[_0x1b6f('0x19')](_0x1b6f('0x4d'),_0x579019,_0x561ee5,_0x2f6208,_0x45cd0c),'style':_0x1b6f('0x20')}];}};}function writePDFDocument(_0x5a70d4,_0x47d278){return new Promise(function(_0x5ec46b,_0x27d74f){var _0x3e6443=_0x5a70d4[_0x1b6f('0x4e')](fs[_0x1b6f('0x4f')](_0x47d278));_0x3e6443['on']('finish',function(){_0x5ec46b(_0x1b6f('0x50'));});_0x3e6443['on']('error',function(_0x4c34c3){_0x27d74f(_0x4c34c3);});_0x5a70d4[_0x1b6f('0x51')]();});}exports[_0x1b6f('0x52')]=function(_0x493e19,_0x56304a){var _0x1d6279=getPDFPrinter();var _0x477576=getPDFDocDefinitionFromHTML(_0x493e19,_0x56304a);var _0x32ddea=_0x1d6279[_0x1b6f('0x31')](_0x477576);return writePDFDocument(_0x32ddea,_0x56304a[_0x1b6f('0x53')])['catch'](function(_0x49b671){throw _0x49b671;});}; \ No newline at end of file +var _0xe228=['body','push','keys','format','endDate','header','pageBreak','before','margin','landscape','\x20/\x20','footer','Arial','black','num','Setting','find','splitSizePdf','then','split','isInteger','forEach','query','sequelize','QueryTypes','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.pdf','existsSync','mkdirSync','join','each','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','pipe','createWriteStream','finish','error','end','createPdfFromHTML','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','window','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','pick','toString','fill','length'];(function(_0x165194,_0x31a93e){var _0x2975f0=function(_0x49ae22){while(--_0x49ae22){_0x165194['push'](_0x165194['shift']());}};_0x2975f0(++_0x31a93e);}(_0xe228,0x99));var _0x8e22=function(_0x3bd900,_0x5f0108){_0x3bd900=_0x3bd900-0x0;var _0x475130=_0xe228[_0x3bd900];return _0x475130;};'use strict';var _=require(_0x8e22('0x0'));var fs=require('fs');var util=require(_0x8e22('0x1'));var path=require(_0x8e22('0x2'));var moment=require(_0x8e22('0x3'));var htmlToPdfmake=require(_0x8e22('0x4'));var PdfPrinter=require(_0x8e22('0x5'));var zipdir=require(_0x8e22('0x6'));var rimraf=require(_0x8e22('0x7'));var JSDOM=require(_0x8e22('0x8'))['JSDOM'];var window=new JSDOM('')[_0x8e22('0x9')];var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var dbH=require(_0x8e22('0xa'))[_0x8e22('0xb')];var logger=require(_0x8e22('0xc'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x8e22('0xd')][0x2]);var QUERY=process[_0x8e22('0xd')][0x3];var PATH=process[_0x8e22('0xd')][0x4];var NAME=process[_0x8e22('0xd')][0x5];var FORMAT=_0x8e22('0xe');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x3106b9,_0x71653){var _0x34fe1e={'status':_0x3106b9};var _0x5dc79a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x71653){_0x34fe1e[_0x8e22('0xf')]=_0x71653;}return db[_0x8e22('0x10')][_0x8e22('0x11')](_0x34fe1e,_0x5dc79a);}function getHeaders(_0x5d7ad9){return _[_0x8e22('0x12')](_0x5d7ad9,function(_0x5794ed){return{'text':_0x5794ed,'style':'tableHeader'};});}function getRows(_0x34bba5,_0x449d5f){return _['map'](_0x449d5f,function(_0x3d3ac0){return _(_0x3d3ac0)[_0x8e22('0x13')](_0x34bba5)[_0x8e22('0x12')](function(_0x520e41){return _0x520e41?_[_0x8e22('0x14')](_0x520e41):'';})['value']();});}function createTable(_0x2f1938,_0x399248){var _0x563045={'widths':_[_0x8e22('0x15')](Array(_0x2f1938[_0x8e22('0x16')]),0x91),'heights':function(_0x2907c4){return _0x2907c4===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x4eb6ee=getHeaders(_0x2f1938);_0x563045[_0x8e22('0x17')][_0x8e22('0x18')](_0x4eb6ee);var _0x1b75bb=getRows(_0x2f1938,_0x399248);_0x563045[_0x8e22('0x17')]=_0x563045[_0x8e22('0x17')]['concat'](_0x1b75bb);return _0x563045;}function createTables(_0x28f7a4){var _0x45933e=[];var _0x12873b=_['chunk'](Object[_0x8e22('0x19')](_0x28f7a4[0x0]),0x5);_0x12873b['forEach'](function(_0xc60730){_0x45933e[_0x8e22('0x18')](createTable(_0xc60730,_0x28f7a4));});return _0x45933e;}function getPDFDocDefinition(_0x429ee9){var _0x498c56=util[_0x8e22('0x1a')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT['startDate'])[_0x8e22('0x1a')](FORMAT),moment(EXTRACTED_REPORT[_0x8e22('0x1b')])[_0x8e22('0x1a')](FORMAT));var _0x48356a=[];for(var _0x28e6ab=0x0;_0x28e6ab<_0x429ee9[_0x8e22('0x16')];_0x28e6ab++){var _0x20c506=[];if(_0x28e6ab===0x0){_0x20c506['push']({'text':_0x498c56,'style':_0x8e22('0x1c')});}var _0x1132c2={'table':_0x429ee9[_0x28e6ab]};if(_0x28e6ab>0x0){_0x1132c2[_0x8e22('0x1d')]=_0x8e22('0x1e');_0x1132c2[_0x8e22('0x1f')]=[0x0,0x46,0x0,0x0];}_0x20c506[_0x8e22('0x18')](_0x1132c2);_0x48356a['push'](_0x20c506);}return{'pageSize':'A4','pageOrientation':_0x8e22('0x20'),'content':_0x48356a,'footer':function(_0x6cf667,_0xb64d58){return{'text':_0x6cf667[_0x8e22('0x14')]()+_0x8e22('0x21')+_0xb64d58,'style':_0x8e22('0x22')};},'defaultStyle':{'font':_0x8e22('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x8e22('0x24')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0xe12e0e){var _0x286476=0x1388;var _0x3b7cf1;if(!_0xe12e0e[0x0][_0x8e22('0x25')]){return analyticExtractedReport('Empty');}return db[_0x8e22('0x26')][_0x8e22('0x27')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x8e22('0x28')]})[_0x8e22('0x29')](function(_0x2b1171){if(_0x2b1171){_0x3b7cf1=_0x2b1171;_0x286476=_0x3b7cf1[_0x8e22('0x28')]||0x3e8;}})['then'](function(){var _0xb9aefd=[];var _0x2c7467=0x0;if(_0x3b7cf1[_0x8e22('0x2a')]){if(_0xe12e0e&&_0xe12e0e[_0x8e22('0x16')]){var _0x2a5ea8=_['range'](_0xe12e0e[0x0][_0x8e22('0x25')]/_0x286476);var _0x4bd1db=Number[_0x8e22('0x2b')](_0xe12e0e[0x0][_0x8e22('0x25')]/_0x286476)?_0xe12e0e[0x0][_0x8e22('0x25')]%_0x286476:0x0;_0x2a5ea8[_0x8e22('0x2c')](function(_0x32eade){if(_0x32eade>0x0){_0x2c7467+=_0x286476;}_0xb9aefd[_0x8e22('0x18')](dbH['sequelize'][_0x8e22('0x2d')](util[_0x8e22('0x1a')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x286476,_0x2c7467),{'type':dbH[_0x8e22('0x2e')][_0x8e22('0x2f')][_0x8e22('0x30')]}));});if(_0x4bd1db>0x0){_0x2c7467+=_0x286476;_0xb9aefd[_0x8e22('0x18')](dbH[_0x8e22('0x2e')][_0x8e22('0x2d')](util[_0x8e22('0x1a')](_0x8e22('0x31'),QUERY,_0x4bd1db,_0x2c7467),{'type':dbH[_0x8e22('0x2e')][_0x8e22('0x2f')][_0x8e22('0x30')]}));}}}else{_0xb9aefd[_0x8e22('0x18')](dbH[_0x8e22('0x2e')]['query'](QUERY,{'type':dbH[_0x8e22('0x2e')][_0x8e22('0x2f')]['SELECT']}));}var _0x171866=path[_0x8e22('0x32')](PATH);var _0x1d2c95=path[_0x8e22('0x33')](PATH,_0x8e22('0x34'));var _0x26620d=_0x3b7cf1[_0x8e22('0x2a')]&&_0xb9aefd[_0x8e22('0x16')]>0x1;var _0x1e461c=[];if(!fs[_0x8e22('0x35')](path['join'](_0x171866,_0x1d2c95))&&_0x26620d){fs[_0x8e22('0x36')](path[_0x8e22('0x37')](_0x171866,_0x1d2c95));}return BPromise[_0x8e22('0x38')](_0xb9aefd,function(_0x24b3c7){_0x1e461c[_0x8e22('0x18')](_0x24b3c7);})['then'](function(){var _0x120749=[];for(var _0x1b0952=0x0;_0x1b0952<_0x1e461c[_0x8e22('0x16')];_0x1b0952+=0x1){var _0x1e53f8=_0x1e461c[_0x1b0952];var _0x32a29c=createTables(_['flatten'](_0x1e53f8));var _0x4684ce;var _0x31b0ed=getPDFDocDefinition(_0x32a29c);var _0x48329d=getPDFPrinter();var _0x1fd6f5=_0x48329d[_0x8e22('0x39')](_0x31b0ed);if(_0x26620d){_0x4684ce=path['join'](_0x171866,_0x1d2c95,util[_0x8e22('0x1a')](_0x8e22('0x3a'),_0x1d2c95,_0x1b0952,_0x8e22('0x3b')));}else{_0x4684ce=path[_0x8e22('0x37')](_0x171866,util[_0x8e22('0x1a')](_0x8e22('0x3c'),_0x1d2c95,_0x8e22('0x3b')));}_0x120749[_0x8e22('0x18')](writePDFDocument(_0x1fd6f5,_0x4684ce));}return Promise[_0x8e22('0x3d')](_0x120749);})[_0x8e22('0x29')](function(){if(_0x26620d){return new Promise(function(_0x5b800c){zipdir(path['join'](_0x171866,_0x1d2c95),{'saveTo':path[_0x8e22('0x37')](_0x171866,util[_0x8e22('0x1a')](_0x8e22('0x3c'),_0x1d2c95,_0x8e22('0x3e')))},function(){rimraf(path[_0x8e22('0x37')](_0x171866,_0x1d2c95),function(){});_0x5b800c(_0x8e22('0x3f'));});});}})[_0x8e22('0x29')](function(){if(!_0x26620d)return;rimraf(path[_0x8e22('0x37')](_0x171866,_0x1d2c95),function(){});})['then'](function(){logger[_0x8e22('0x40')](util[_0x8e22('0x1a')](_0x8e22('0x41'),EXTRACTED_REPORT_ID,_0x8e22('0x42')));return analyticExtractedReport(_0x8e22('0x43'),_0x26620d?util[_0x8e22('0x1a')](_0x8e22('0x3c'),_0x1d2c95,_0x26620d?'zip':_0x8e22('0x3b')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x8e22('0x40')](util[_0x8e22('0x1a')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x8e22('0x42')));return db['AnalyticExtractedReport'][_0x8e22('0x44')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x8e22('0x29')](function(_0x2f0853){EXTRACTED_REPORT=_0x2f0853;return dbH[_0x8e22('0x2e')][_0x8e22('0x2d')](util[_0x8e22('0x1a')](_0x8e22('0x45'),QUERY),{'type':dbH[_0x8e22('0x2e')][_0x8e22('0x2f')][_0x8e22('0x30')]});})[_0x8e22('0x29')](extractReport)[_0x8e22('0x46')](function(_0xeace23){logger['info'](util['format'](_0x8e22('0x47'),EXTRACTED_REPORT_ID,_0x8e22('0x42')),util['inspect'](_0xeace23,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x8e22('0x48'));})[_0x8e22('0x49')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x1f1f1a=new PdfPrinter({'Arial':{'normal':__dirname+_0x8e22('0x4a'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x8e22('0x4b'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x1f1f1a;}function getPDFDocDefinitionFromHTML(_0x58429b,_0x5f3df1){var _0x363124=util[_0x8e22('0x1a')](_0x8e22('0x4c'),_0x5f3df1[_0x8e22('0x4d')],_0x5f3df1[_0x8e22('0x4e')]);var _0x45d34c=moment()['format'](_0x8e22('0x4f'))[_0x8e22('0x14')]();var _0x116326=htmlToPdfmake(_0x58429b,{'window':window,'tableAutoSize':!![]});return{'content':[_0x116326],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x8e22('0x50'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x8e22('0x50'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0x8e22('0x51'),'style':_0x8e22('0x1c')}];},'footer':function(_0x2d6dea,_0x1d1109){return[{'text':util['format']('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x363124,_0x2d6dea,_0x1d1109,_0x45d34c),'style':_0x8e22('0x22')}];}};}function writePDFDocument(_0x28b4c1,_0x258ad9){return new Promise(function(_0x280c54,_0x85f0f1){var _0x1f9856=_0x28b4c1[_0x8e22('0x52')](fs[_0x8e22('0x53')](_0x258ad9));_0x1f9856['on'](_0x8e22('0x54'),function(){_0x280c54(_0x8e22('0x54'));});_0x1f9856['on'](_0x8e22('0x55'),function(_0x460a6a){_0x85f0f1(_0x460a6a);});_0x28b4c1[_0x8e22('0x56')]();});}exports[_0x8e22('0x57')]=function(_0xd2be8f,_0x35a1ee){var _0x5448a2=getPDFPrinter();var _0x874013=getPDFDocDefinitionFromHTML(_0xd2be8f,_0x35a1ee);var _0x1078e3=_0x5448a2[_0x8e22('0x39')](_0x874013);return writePDFDocument(_0x1078e3,_0x35a1ee['path'])['catch'](function(_0x11deb8){throw _0x11deb8;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index c47dcb8..051f8eb 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 _0xd876=['dbH','../../config/logger','analytics','argv','savename','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','then','splitSizeXlsx','sequelize','query','QueryTypes','SELECT','num','Empty','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','existsSync','join','each','%s%d.%s','%s.%s','xlsx','writeFileSync','binary','zip\x20finished','info','zip','catch','inspect','Failed','finally','util','lodash','json2xls','rimraf','../../mysqldb'];(function(_0x2fffff,_0x415518){var _0x4f2a2c=function(_0x32c77b){while(--_0x32c77b){_0x2fffff['push'](_0x2fffff['shift']());}};_0x4f2a2c(++_0x415518);}(_0xd876,0x11b));var _0x6d87=function(_0x30adce,_0x3b5c40){_0x30adce=_0x30adce-0x0;var _0x388c1f=_0xd876[_0x30adce];return _0x388c1f;};'use strict';var util=require(_0x6d87('0x0'));var path=require('path');var _=require(_0x6d87('0x1'));var fs=require('fs');var json2xls=require(_0x6d87('0x2'));var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0x6d87('0x3'));var db=require(_0x6d87('0x4'))['db'];var dbH=require(_0x6d87('0x4'))[_0x6d87('0x5')];var logger=require(_0x6d87('0x6'))(_0x6d87('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x6d87('0x8')][0x2]);var QUERY=process[_0x6d87('0x8')][0x3];var PATH=process[_0x6d87('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x551df7,_0x561107){var _0x45c084={'status':_0x551df7};var _0x392c46={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x561107){_0x45c084[_0x6d87('0x9')]=_0x561107;}return db['AnalyticExtractedReport'][_0x6d87('0xa')](_0x45c084,_0x392c46);}function main(){var _0x7287f2=0x1388;var _0x38c6ad;logger['info'](util[_0x6d87('0xb')](_0x6d87('0xc'),EXTRACTED_REPORT_ID,_0x6d87('0xd')));return db[_0x6d87('0xe')][_0x6d87('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x6d87('0x10'),'splitSizeXlsx']})[_0x6d87('0x11')](function(_0x5a989f){if(_0x5a989f){_0x38c6ad=_0x5a989f;_0x7287f2=_0x38c6ad[_0x6d87('0x12')]||0x1388;}})['then'](function(){return dbH[_0x6d87('0x13')][_0x6d87('0x14')](util[_0x6d87('0xb')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize'][_0x6d87('0x15')][_0x6d87('0x16')]});})['then'](function(_0x21d69c){if(!_0x21d69c[0x0][_0x6d87('0x17')]){return analyticExtractedReport(_0x6d87('0x18'));}var _0x484bc4=[];var _0x1198c9=0x0;if(_0x38c6ad[_0x6d87('0x10')]){if(_0x21d69c&&_0x21d69c[_0x6d87('0x19')]){var _0x399b2b=_[_0x6d87('0x1a')](_0x21d69c[0x0][_0x6d87('0x17')]/_0x7287f2);var _0x2118ff=Number[_0x6d87('0x1b')](_0x21d69c[0x0]['num']/_0x7287f2)?_0x21d69c[0x0][_0x6d87('0x17')]%_0x7287f2:0x0;_0x399b2b[_0x6d87('0x1c')](function(_0x318aae){if(_0x318aae>0x0){_0x1198c9+=_0x7287f2;}_0x484bc4[_0x6d87('0x1d')](dbH[_0x6d87('0x13')][_0x6d87('0x14')](util[_0x6d87('0xb')](_0x6d87('0x1e'),QUERY,_0x7287f2,_0x1198c9),{'type':dbH['sequelize'][_0x6d87('0x15')][_0x6d87('0x16')]}));});if(_0x2118ff>0x0){_0x1198c9+=_0x7287f2;_0x484bc4[_0x6d87('0x1d')](dbH[_0x6d87('0x13')][_0x6d87('0x14')](util[_0x6d87('0xb')](_0x6d87('0x1e'),QUERY,_0x2118ff,_0x1198c9),{'type':dbH['sequelize'][_0x6d87('0x15')][_0x6d87('0x16')]}));}}}else{_0x484bc4[_0x6d87('0x1d')](dbH[_0x6d87('0x13')][_0x6d87('0x14')](QUERY,{'type':dbH[_0x6d87('0x13')]['QueryTypes'][_0x6d87('0x16')]}));}var _0x2c28c2=path[_0x6d87('0x1f')](PATH);var _0x4ac153=path[_0x6d87('0x20')](PATH,'.xlsx');var _0x4d98d8=_0x38c6ad[_0x6d87('0x10')]&&_0x484bc4[_0x6d87('0x19')]>0x1;var _0x152125=[];if(!fs[_0x6d87('0x21')](path[_0x6d87('0x22')](_0x2c28c2,_0x4ac153))&&_0x4d98d8){fs['mkdirSync'](path['join'](_0x2c28c2,_0x4ac153));}return BPromise[_0x6d87('0x23')](_0x484bc4,function(_0x9bde89){_0x152125['push'](_0x9bde89);})[_0x6d87('0x11')](function(){for(var _0x521107=0x0;_0x521107<_0x152125[_0x6d87('0x19')];_0x521107+=0x1){var _0x5aa9f3;var _0x43b2a8=_0x152125[_0x521107];if(_0x4d98d8){_0x5aa9f3=path[_0x6d87('0x22')](_0x2c28c2,_0x4ac153,util[_0x6d87('0xb')](_0x6d87('0x24'),_0x4ac153,_0x521107,'xlsx'));}else{_0x5aa9f3=path['join'](_0x2c28c2,util[_0x6d87('0xb')](_0x6d87('0x25'),_0x4ac153,_0x6d87('0x26')));}fs[_0x6d87('0x27')](_0x5aa9f3,json2xls(_0x43b2a8),_0x6d87('0x28'));}})['then'](function(){if(_0x4d98d8){return new Promise(function(_0x505132){zipdir(path['join'](_0x2c28c2,_0x4ac153),{'saveTo':path['join'](_0x2c28c2,util['format']('%s.%s',_0x4ac153,'zip'))},function(_0x3473ff,_0x5348f8){rimraf(path['join'](_0x2c28c2,_0x4ac153),function(){});_0x505132(_0x6d87('0x29'));});});}})[_0x6d87('0x11')](function(){logger[_0x6d87('0x2a')](util[_0x6d87('0xb')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport('Completed',_0x4d98d8?util['format'](_0x6d87('0x25'),_0x4ac153,_0x4d98d8?_0x6d87('0x2b'):_0x6d87('0x26')):null);});})[_0x6d87('0x2c')](function(_0x5acfe9){logger['info'](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x6d87('0xd')),util[_0x6d87('0x2d')](_0x5acfe9,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x6d87('0x2e'));})[_0x6d87('0x2f')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x2c91=['num','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','push','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','writeFileSync','binary','%s.%s','zip','zip\x20finished','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','find','split','splitSizeXlsx','then','sequelize','query','format','Empty','length','range'];(function(_0x17667c,_0x217e6e){var _0x4b35c3=function(_0x4abed1){while(--_0x4abed1){_0x17667c['push'](_0x17667c['shift']());}};_0x4b35c3(++_0x217e6e);}(_0x2c91,0x158));var _0x12c9=function(_0x399eef,_0x248e70){_0x399eef=_0x399eef-0x0;var _0x1cbe04=_0x2c91[_0x399eef];return _0x1cbe04;};'use strict';var util=require(_0x12c9('0x0'));var path=require(_0x12c9('0x1'));var _=require(_0x12c9('0x2'));var fs=require('fs');var json2xls=require(_0x12c9('0x3'));var BPromise=require(_0x12c9('0x4'));var zipdir=require(_0x12c9('0x5'));var rimraf=require(_0x12c9('0x6'));var db=require(_0x12c9('0x7'))['db'];var dbH=require('../../mysqldb')[_0x12c9('0x8')];var logger=require(_0x12c9('0x9'))(_0x12c9('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x12c9('0xb')][0x2]);var QUERY=process[_0x12c9('0xb')][0x3];var PATH=process[_0x12c9('0xb')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3e30ed,_0x55c40a){var _0x283633={'status':_0x3e30ed};var _0x2cbffe={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x55c40a){_0x283633['savename']=_0x55c40a;}return db[_0x12c9('0xc')][_0x12c9('0xd')](_0x283633,_0x2cbffe);}function main(){var _0x4fa1de=0x1388;var _0x6addcf;logger[_0x12c9('0xe')](util['format'](_0x12c9('0xf'),EXTRACTED_REPORT_ID,_0x12c9('0x10')));return db['Setting'][_0x12c9('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x12c9('0x12'),_0x12c9('0x13')]})[_0x12c9('0x14')](function(_0x278da5){if(_0x278da5){_0x6addcf=_0x278da5;_0x4fa1de=_0x6addcf[_0x12c9('0x13')]||0x1388;}})['then'](function(){return dbH[_0x12c9('0x15')][_0x12c9('0x16')](util[_0x12c9('0x17')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize']['QueryTypes']['SELECT']});})['then'](function(_0x9fa35){if(!_0x9fa35[0x0]['num']){return analyticExtractedReport(_0x12c9('0x18'));}var _0x4460d5=[];var _0x1d7716=0x0;if(_0x6addcf[_0x12c9('0x12')]){if(_0x9fa35&&_0x9fa35[_0x12c9('0x19')]){var _0x529a6a=_[_0x12c9('0x1a')](_0x9fa35[0x0][_0x12c9('0x1b')]/_0x4fa1de);var _0x1890d4=Number[_0x12c9('0x1c')](_0x9fa35[0x0][_0x12c9('0x1b')]/_0x4fa1de)?_0x9fa35[0x0][_0x12c9('0x1b')]%_0x4fa1de:0x0;_0x529a6a[_0x12c9('0x1d')](function(_0x374cf7){if(_0x374cf7>0x0){_0x1d7716+=_0x4fa1de;}_0x4460d5['push'](dbH[_0x12c9('0x15')]['query'](util[_0x12c9('0x17')](_0x12c9('0x1e'),QUERY,_0x4fa1de,_0x1d7716),{'type':dbH[_0x12c9('0x15')][_0x12c9('0x1f')][_0x12c9('0x20')]}));});if(_0x1890d4>0x0){_0x1d7716+=_0x4fa1de;_0x4460d5['push'](dbH[_0x12c9('0x15')][_0x12c9('0x16')](util[_0x12c9('0x17')](_0x12c9('0x1e'),QUERY,_0x1890d4,_0x1d7716),{'type':dbH[_0x12c9('0x15')][_0x12c9('0x1f')][_0x12c9('0x20')]}));}}}else{_0x4460d5[_0x12c9('0x21')](dbH[_0x12c9('0x15')][_0x12c9('0x16')](QUERY,{'type':dbH[_0x12c9('0x15')]['QueryTypes'][_0x12c9('0x20')]}));}var _0x1599a8=path[_0x12c9('0x22')](PATH);var _0x1aa6a8=path[_0x12c9('0x23')](PATH,_0x12c9('0x24'));var _0x2f03be=_0x6addcf[_0x12c9('0x12')]&&_0x4460d5[_0x12c9('0x19')]>0x1;var _0x3ed911=[];if(!fs[_0x12c9('0x25')](path[_0x12c9('0x26')](_0x1599a8,_0x1aa6a8))&&_0x2f03be){fs[_0x12c9('0x27')](path[_0x12c9('0x26')](_0x1599a8,_0x1aa6a8));}return BPromise[_0x12c9('0x28')](_0x4460d5,function(_0x4141db){_0x3ed911[_0x12c9('0x21')](_0x4141db);})[_0x12c9('0x14')](function(){for(var _0x9a8f1e=0x0;_0x9a8f1e<_0x3ed911[_0x12c9('0x19')];_0x9a8f1e+=0x1){var _0x5c02fb;var _0x44636d=_0x3ed911[_0x9a8f1e];if(_0x2f03be){_0x5c02fb=path[_0x12c9('0x26')](_0x1599a8,_0x1aa6a8,util[_0x12c9('0x17')](_0x12c9('0x29'),_0x1aa6a8,_0x9a8f1e,_0x12c9('0x2a')));}else{_0x5c02fb=path[_0x12c9('0x26')](_0x1599a8,util[_0x12c9('0x17')]('%s.%s',_0x1aa6a8,_0x12c9('0x2a')));}fs[_0x12c9('0x2b')](_0x5c02fb,json2xls(_0x44636d),_0x12c9('0x2c'));}})[_0x12c9('0x14')](function(){if(_0x2f03be){return new Promise(function(_0x34ff2e){zipdir(path['join'](_0x1599a8,_0x1aa6a8),{'saveTo':path[_0x12c9('0x26')](_0x1599a8,util['format'](_0x12c9('0x2d'),_0x1aa6a8,_0x12c9('0x2e')))},function(_0x1763fd,_0xadd087){rimraf(path[_0x12c9('0x26')](_0x1599a8,_0x1aa6a8),function(){});_0x34ff2e(_0x12c9('0x2f'));});});}})[_0x12c9('0x14')](function(){logger[_0x12c9('0xe')](util[_0x12c9('0x17')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x12c9('0x30'),_0x2f03be?util[_0x12c9('0x17')](_0x12c9('0x2d'),_0x1aa6a8,_0x2f03be?_0x12c9('0x2e'):_0x12c9('0x2a')):null);});})[_0x12c9('0x31')](function(_0x410841){logger['info'](util[_0x12c9('0x17')](_0x12c9('0x32'),EXTRACTED_REPORT_ID,_0x12c9('0x10')),util['inspect'](_0x410841,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x12c9('0x33'));})[_0x12c9('0x34')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 12e61ad..407a3e3 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 _0x50f3=['queue','playback','hasOwnProperty','priority','extensions','extension','find','push','type','Set','CDR(type)=%s','context','VoiceExtensionId','inbound','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','${EXTEN:','ExecIf','):Goto(','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','intervals','IntervalId','tag','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','length','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','models','Interval','findAll','VoiceExtension','then','map','exten','filter','groupBy'];(function(_0x17f329,_0x35ab19){var _0x45d603=function(_0x49388c){while(--_0x49388c){_0x17f329['push'](_0x17f329['shift']());}};_0x45d603(++_0x35ab19);}(_0x50f3,0x106));var _0x350f=function(_0x3239cf,_0x1509de){_0x3239cf=_0x3239cf-0x0;var _0x225e6d=_0x50f3[_0x3239cf];return _0x225e6d;};'use strict';var _=require(_0x350f('0x0'));var util=require('util');function rewrite(_0x37eef5,_0x22066c){var _0xee03bd=this;return _0x37eef5[_0x350f('0x1')][_0x350f('0x2')][_0x350f('0x3')]({'raw':!![]})['then'](function(_0x5bfd23){_0xee03bd['intervals']=_0x5bfd23;return _0x37eef5[_0x350f('0x1')][_0x350f('0x4')][_0x350f('0x3')]({'where':{'IntervalId':_0x22066c['IntervalId']},'raw':!![]});})[_0x350f('0x5')](function(_0x32884c){return _0x37eef5['models'][_0x350f('0x4')][_0x350f('0x3')]({'where':{'exten':{'$in':_['uniq'](_[_0x350f('0x6')](_0x32884c,_0x350f('0x7')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})['then'](function(_0x3ffce4){var _0x26de71=_[_0x350f('0x8')](_0x3ffce4,{'priority':'1'});var _0x59c595=_[_0x350f('0x8')](_0x3ffce4,{'isApp':0x1});var _0x28a321=_[_0x350f('0x9')](_0x59c595,_0x350f('0x7'));var _0x26dbf3=[_0x350f('0xa'),_0x350f('0xb')];var _0x216eff=[];var _0x2ca070=[];for(var _0x4a774d in _0x28a321){if(_0x28a321[_0x350f('0xc')](_0x4a774d)){_0xee03bd[_0x350f('0xd')]=0x2;_0xee03bd[_0x350f('0xe')]=[];_0xee03bd[_0x350f('0xf')]=_[_0x350f('0x10')](_0x26de71,{'exten':_0x28a321[_0x4a774d][0x0]['exten']});_0xee03bd[_0x350f('0xe')][_0x350f('0x11')]({'type':_0x28a321[_0x4a774d][0x0][_0x350f('0x12')],'app':_0x350f('0x13'),'appdata':util['format'](_0x350f('0x14'),_0x28a321[_0x4a774d][0x0][_0x350f('0x12')]),'context':_0x28a321[_0x4a774d][0x0][_0x350f('0x15')],'exten':_0x28a321[_0x4a774d][0x0][_0x350f('0x7')],'priority':_0xee03bd[_0x350f('0xd')]++,'VoiceExtensionId':_0x28a321[_0x4a774d][0x0][_0x350f('0x16')]});if(_0x28a321[_0x4a774d][0x0][_0x350f('0x12')]===_0x350f('0x17')){_0xee03bd[_0x350f('0xe')][_0x350f('0x11')]({'type':_0x28a321[_0x4a774d][0x0][_0x350f('0x12')],'app':_0x350f('0x13'),'appdata':_0x350f('0x18')+_0x28a321[_0x4a774d][0x0][_0x350f('0x16')],'context':_0x28a321[_0x4a774d][0x0]['context'],'exten':_0x28a321[_0x4a774d][0x0][_0x350f('0x7')],'priority':_0xee03bd[_0x350f('0xd')]++,'VoiceExtensionId':_0x28a321[_0x4a774d][0x0][_0x350f('0x16')]});}else if(_0x28a321[_0x4a774d][0x0][_0x350f('0x12')]===_0x350f('0x19')){if(_0xee03bd['extension']){_0xee03bd['extensions']['push']({'type':_0x28a321[_0x4a774d][0x0][_0x350f('0x12')],'app':_0x350f('0x13'),'appdata':_0x350f('0x1a')+(_0xee03bd[_0x350f('0xf')][_0x350f('0x1b')]?_0x350f('0x1c')+_0xee03bd[_0x350f('0xf')][_0x350f('0x1b')]+'}':'${EXTEN}'),'context':_0x28a321[_0x4a774d][0x0][_0x350f('0x15')],'exten':_0x28a321[_0x4a774d][0x0][_0x350f('0x7')],'priority':_0xee03bd[_0x350f('0xd')]++,'VoiceExtensionId':_0x28a321[_0x4a774d][0x0][_0x350f('0x16')]});}_0xee03bd[_0x350f('0xe')][_0x350f('0x11')]({'type':_0x28a321[_0x4a774d][0x0][_0x350f('0x12')],'app':_0x350f('0x13'),'appdata':'CDR(routeid)='+_0x28a321[_0x4a774d][0x0][_0x350f('0x16')],'context':_0x28a321[_0x4a774d][0x0]['context'],'exten':_0x28a321[_0x4a774d][0x0][_0x350f('0x7')],'priority':_0xee03bd[_0x350f('0xd')]++,'VoiceExtensionId':_0x28a321[_0x4a774d][0x0][_0x350f('0x16')]});var _0x16087a=_0xee03bd[_0x350f('0xd')]++;_0xee03bd[_0x350f('0xe')][_0x350f('0x11')]({'type':_0x28a321[_0x4a774d][0x0][_0x350f('0x12')],'app':_0x350f('0x1d'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x16087a+0x2)+_0x350f('0x1e')+(_0x16087a+0x1)+')','context':_0x28a321[_0x4a774d][0x0][_0x350f('0x15')],'exten':_0x28a321[_0x4a774d][0x0][_0x350f('0x7')],'priority':_0x16087a,'VoiceExtensionId':_0x28a321[_0x4a774d][0x0][_0x350f('0x16')]});if(_0xee03bd[_0x350f('0xf')]){_0xee03bd[_0x350f('0xe')][_0x350f('0x11')]({'type':_0x28a321[_0x4a774d][0x0][_0x350f('0x12')],'app':_0x350f('0x13'),'appdata':_0xee03bd[_0x350f('0xf')][_0x350f('0x1b')]?'CDR(prefix)=${EXTEN:0:'+_0xee03bd[_0x350f('0xf')][_0x350f('0x1b')]+'}':_0x350f('0x1f'),'context':_0x28a321[_0x4a774d][0x0]['context'],'exten':_0x28a321[_0x4a774d][0x0][_0x350f('0x7')],'priority':_0xee03bd[_0x350f('0xd')]++,'VoiceExtensionId':_0x28a321[_0x4a774d][0x0][_0x350f('0x16')]});}_0xee03bd[_0x350f('0xe')][_0x350f('0x11')]({'type':_0x28a321[_0x4a774d][0x0]['type'],'app':'Set','appdata':'outboundrouteid='+_0x28a321[_0x4a774d][0x0][_0x350f('0x16')],'context':_0x28a321[_0x4a774d][0x0][_0x350f('0x15')],'exten':_0x28a321[_0x4a774d][0x0][_0x350f('0x7')],'priority':_0xee03bd[_0x350f('0xd')]++,'VoiceExtensionId':_0x28a321[_0x4a774d][0x0]['VoiceExtensionId']});if(_0xee03bd[_0x350f('0xf')]&&_0xee03bd[_0x350f('0xf')][_0x350f('0xc')](_0x350f('0x20'))&&_0xee03bd[_0x350f('0xf')][_0x350f('0x20')]!==_0x350f('0x21')){_0xee03bd['extensions'][_0x350f('0x11')]({'type':_0x28a321[_0x4a774d][0x0][_0x350f('0x12')],'app':'Set','appdata':_0x350f('0x22'),'context':_0x28a321[_0x4a774d][0x0][_0x350f('0x15')],'exten':_0x28a321[_0x4a774d][0x0][_0x350f('0x7')],'priority':_0xee03bd['priority']++,'VoiceExtensionId':_0x28a321[_0x4a774d][0x0][_0x350f('0x16')]});_0xee03bd[_0x350f('0xe')][_0x350f('0x11')]({'type':_0x28a321[_0x4a774d][0x0][_0x350f('0x12')],'app':_0x350f('0x13'),'appdata':_0x350f('0x23')+_0xee03bd[_0x350f('0xf')][_0x350f('0x20')]||'wav','context':_0x28a321[_0x4a774d][0x0][_0x350f('0x15')],'exten':_0x28a321[_0x4a774d][0x0][_0x350f('0x7')],'priority':_0xee03bd[_0x350f('0xd')]++,'VoiceExtensionId':_0x28a321[_0x4a774d][0x0][_0x350f('0x16')]});}}_0xee03bd[_0x350f('0xe')][_0x350f('0x11')]({'type':_0x28a321[_0x4a774d][0x0][_0x350f('0x12')],'app':_0x350f('0x13'),'appdata':_0x350f('0x24'),'context':_0x28a321[_0x4a774d][0x0][_0x350f('0x15')],'exten':_0x28a321[_0x4a774d][0x0][_0x350f('0x7')],'priority':_0xee03bd[_0x350f('0xd')]++,'VoiceExtensionId':_0x28a321[_0x4a774d][0x0][_0x350f('0x16')]});_0xee03bd[_0x350f('0xe')][_0x350f('0x11')]({'type':_0x28a321[_0x4a774d][0x0][_0x350f('0x12')],'app':_0x350f('0x13'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x28a321[_0x4a774d][0x0]['context'],'exten':_0x28a321[_0x4a774d][0x0][_0x350f('0x7')],'priority':_0xee03bd[_0x350f('0xd')]++,'VoiceExtensionId':_0x28a321[_0x4a774d][0x0][_0x350f('0x16')]});_0xee03bd['extensions']['push']({'type':_0x28a321[_0x4a774d][0x0][_0x350f('0x12')],'app':_0x350f('0x13'),'appdata':'MONITOR_OPTIONS=ab','context':_0x28a321[_0x4a774d][0x0][_0x350f('0x15')],'exten':_0x28a321[_0x4a774d][0x0][_0x350f('0x7')],'priority':_0xee03bd[_0x350f('0xd')]++,'VoiceExtensionId':_0x28a321[_0x4a774d][0x0][_0x350f('0x16')]});for(var _0x272cb4=0x0,_0xa6bc25=0x0;_0x272cb4<_0x28a321[_0x4a774d]['length'];_0x272cb4+=0x1,_0xa6bc25=0x0){var _0xf1e104=_0x28a321[_0x4a774d][_0x272cb4];if(_0xf1e104[_0x350f('0x12')]){_0xf1e104[_0x350f('0x12')]=_0xf1e104['type'][_0x350f('0x25')]();}var _0x31bcb1=[];var _0x38c59f=[];delete _0xf1e104['id'];delete _0xf1e104[_0x350f('0x26')];delete _0xf1e104[_0x350f('0x27')];var _0x9922a4=_0xf1e104[_0x350f('0x28')]!==_0x350f('0x29')?[_0xf1e104[_0x350f('0x28')]]:_0xf1e104['IntervalId']?_[_0x350f('0x6')](_['filter'](_0xee03bd[_0x350f('0x2a')],{'IntervalId':_0xf1e104[_0x350f('0x2b')]}),_0x350f('0x28')):[];if(_0xf1e104[_0x350f('0xc')](_0x350f('0x2c'))){if(_0xf1e104[_0x350f('0x2c')]&&_0xf1e104[_0x350f('0x2c')]!=='--'){_0x31bcb1[_0x350f('0x11')]({'type':_0xf1e104[_0x350f('0x12')],'app':_0x350f('0x13'),'appdata':'CDR(tag)='+_0xf1e104['tag'],'context':_0xf1e104['context'],'exten':_0xf1e104[_0x350f('0x7')],'priority':_0x9922a4['length']+_0xee03bd['priority']+_0xa6bc25++,'VoiceExtensionId':_0xf1e104['VoiceExtensionId']});}}if(_0xf1e104[_0x350f('0x12')]===_0x350f('0x19')&&_0xf1e104[_0x350f('0xc')](_0x350f('0x2d'))){if(_0xf1e104[_0x350f('0x2d')]){_0x31bcb1[_0x350f('0x11')]({'type':_0xf1e104[_0x350f('0x12')],'app':'ExecIf','appdata':_0x350f('0x2e')+_0xf1e104[_0x350f('0x2d')]+')','context':_0xf1e104[_0x350f('0x15')],'exten':_0xf1e104[_0x350f('0x7')],'priority':_0x9922a4[_0x350f('0x2f')]+_0xee03bd['priority']+_0xa6bc25++,'VoiceExtensionId':_0xf1e104['VoiceExtensionId']});}else{_0x31bcb1[_0x350f('0x11')]({'type':_0xf1e104[_0x350f('0x12')],'app':_0x350f('0x1d'),'appdata':_0x350f('0x30'),'context':_0xf1e104[_0x350f('0x15')],'exten':_0xf1e104['exten'],'priority':_0x9922a4[_0x350f('0x2f')]+_0xee03bd[_0x350f('0xd')]+_0xa6bc25++,'VoiceExtensionId':_0xf1e104[_0x350f('0x16')]});}}if(_0xf1e104['hasOwnProperty']('answer')){if(_0x26dbf3[_0x350f('0x31')](_0xf1e104['app'][_0x350f('0x25')]())>=0x0&&_0xf1e104['appType']!==_0x350f('0x32')){if(_0xf1e104[_0x350f('0x33')]){_0x31bcb1['push']({'type':_0xf1e104[_0x350f('0x12')],'app':_0x350f('0x1d'),'appdata':_0x350f('0x34'),'context':_0xf1e104[_0x350f('0x15')],'exten':_0xf1e104[_0x350f('0x7')],'priority':_0x9922a4[_0x350f('0x2f')]+_0xee03bd[_0x350f('0xd')]+_0xa6bc25++,'VoiceExtensionId':_0xf1e104[_0x350f('0x16')]});_0x31bcb1['push']({'type':_0xf1e104['type'],'app':_0x350f('0x13'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0xf1e104[_0x350f('0x15')],'exten':_0xf1e104['exten'],'priority':_0x9922a4[_0x350f('0x2f')]+_0xee03bd[_0x350f('0xd')]+_0xa6bc25++,'VoiceExtensionId':_0xf1e104[_0x350f('0x16')]});}else{_0x31bcb1[_0x350f('0x11')]({'type':_0xf1e104[_0x350f('0x12')],'app':_0x350f('0x1d'),'appdata':_0x350f('0x35'),'context':_0xf1e104[_0x350f('0x15')],'exten':_0xf1e104['exten'],'priority':_0x9922a4['length']+_0xee03bd[_0x350f('0xd')]+_0xa6bc25++,'VoiceExtensionId':_0xf1e104['VoiceExtensionId']});_0x31bcb1['push']({'type':_0xf1e104[_0x350f('0x12')],'app':_0x350f('0x13'),'appdata':_0x350f('0x36'),'context':_0xf1e104[_0x350f('0x15')],'exten':_0xf1e104[_0x350f('0x7')],'priority':_0x9922a4[_0x350f('0x2f')]+_0xee03bd[_0x350f('0xd')]+_0xa6bc25++,'VoiceExtensionId':_0xf1e104[_0x350f('0x16')]});}}}for(var _0x334c8f=0x0;_0x334c8f<_0x9922a4[_0x350f('0x2f')];_0x334c8f+=0x1){var _0x41bcdc=_0xee03bd[_0x350f('0xd')]+_0x9922a4['length'];var _0x44e09d=_0x334c8f===_0x9922a4[_0x350f('0x2f')]-0x1?_0xee03bd[_0x350f('0xd')]+_0x31bcb1[_0x350f('0x2f')]+_0x38c59f[_0x350f('0x2f')]+0x2:_0xee03bd['priority']+_0x334c8f+0x1;_0x31bcb1[_0x350f('0x37')](_0x334c8f,0x0,{'type':_0xf1e104['type'],'app':_0x350f('0x38'),'appdata':_0x9922a4[_0x334c8f]+'?'+_0xf1e104[_0x350f('0x15')]+_0x350f('0x39')+_0x41bcdc+':'+_0xf1e104['context']+_0x350f('0x39')+_0x44e09d,'exten':_0xf1e104['exten'],'context':_0xf1e104[_0x350f('0x15')],'priority':_0xee03bd[_0x350f('0xd')]+_0x334c8f,'VoiceExtensionId':_0x28a321[_0x4a774d][0x0][_0x350f('0x16')]});}_0xf1e104[_0x350f('0xd')]=_0x31bcb1['length']?_[_0x350f('0x3a')](_0x31bcb1)[_0x350f('0xd')]+0x1:_0xee03bd[_0x350f('0xd')];_0xee03bd[_0x350f('0xd')]=(_0x38c59f['length']?_[_0x350f('0x3a')](_0x38c59f)[_0x350f('0xd')]:_0xf1e104[_0x350f('0xd')])+0x1;_0xee03bd[_0x350f('0xe')]=_[_0x350f('0x3b')](_0xee03bd['extensions'],_0x31bcb1,[_0xf1e104],_0x38c59f);}_0xee03bd[_0x350f('0xe')]['push']({'type':_0x28a321[_0x4a774d][0x0][_0x350f('0x12')],'app':_0x350f('0x3c'),'exten':_0x28a321[_0x4a774d][0x0]['exten'],'context':_0x28a321[_0x4a774d][0x0][_0x350f('0x15')],'priority':_0xee03bd[_0x350f('0xd')],'VoiceExtensionId':_0x28a321[_0x4a774d][0x0][_0x350f('0x16')]});_0x216eff[_0x350f('0x11')](_0x28a321[_0x4a774d][0x0][_0x350f('0x16')]);_0x2ca070=_[_0x350f('0x3b')](_0x2ca070,_0xee03bd[_0x350f('0xe')]);}}return _0x37eef5[_0x350f('0x3d')](function(_0x569681){return _0x37eef5[_0x350f('0x1')][_0x350f('0x4')][_0x350f('0x3e')]({'where':{'VoiceExtensionId':{'$in':_0x216eff}},'transaction':_0x569681})[_0x350f('0x5')](function(_0x1121f8){return _0x37eef5[_0x350f('0x1')][_0x350f('0x4')][_0x350f('0x3f')](_[_0x350f('0x40')](_0x2ca070,_0x350f('0xd')),{'transaction':_0x569681});});});})[_0x350f('0x41')](function(_0x56bf43){console[_0x350f('0x42')](_0x56bf43);});}exports[_0x350f('0x43')]=rewrite; \ No newline at end of file +var _0x254d=['bulkCreate','sortBy','catch','error','lodash','util','Interval','findAll','then','intervals','VoiceExtension','IntervalId','models','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','exten','queue','playback','hasOwnProperty','find','extensions','CDR(type)=%s','type','context','priority','push','Set','CDR(routeid)=','VoiceExtensionId','outbound','extension','CDR(destination)=','cutdigits','${EXTEN:','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','interval','*,*,*,*','map','tag','CDR(tag)=','callerID','indexOf','appType','answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','Hangup'];(function(_0x4c6e7b,_0x46d268){var _0x436174=function(_0x5c64b9){while(--_0x5c64b9){_0x4c6e7b['push'](_0x4c6e7b['shift']());}};_0x436174(++_0x46d268);}(_0x254d,0x8a));var _0xd254=function(_0x26bf51,_0x5e261a){_0x26bf51=_0x26bf51-0x0;var _0x503415=_0x254d[_0x26bf51];return _0x503415;};'use strict';var _=require(_0xd254('0x0'));var util=require(_0xd254('0x1'));function rewrite(_0x117fc0,_0x127b0e){var _0x443d23=this;return _0x117fc0['models'][_0xd254('0x2')][_0xd254('0x3')]({'raw':!![]})[_0xd254('0x4')](function(_0x1447a8){_0x443d23[_0xd254('0x5')]=_0x1447a8;return _0x117fc0['models'][_0xd254('0x6')][_0xd254('0x3')]({'where':{'IntervalId':_0x127b0e[_0xd254('0x7')]},'raw':!![]});})[_0xd254('0x4')](function(_0x3fccc7){return _0x117fc0[_0xd254('0x8')]['VoiceExtension']['findAll']({'where':{'exten':{'$in':_['uniq'](_['map'](_0x3fccc7,'exten'))}},'order':[{'raw':_0xd254('0x9')}],'raw':!![]});})['then'](function(_0x2eec2d){var _0x343cf8=_[_0xd254('0xa')](_0x2eec2d,{'priority':'1'});var _0x5117a1=_['filter'](_0x2eec2d,{'isApp':0x1});var _0x4151b4=_[_0xd254('0xb')](_0x5117a1,_0xd254('0xc'));var _0x3d18a9=[_0xd254('0xd'),_0xd254('0xe')];var _0x3a192d=[];var _0xde587c=[];for(var _0x195125 in _0x4151b4){if(_0x4151b4[_0xd254('0xf')](_0x195125)){_0x443d23['priority']=0x2;_0x443d23['extensions']=[];_0x443d23['extension']=_[_0xd254('0x10')](_0x343cf8,{'exten':_0x4151b4[_0x195125][0x0]['exten']});_0x443d23[_0xd254('0x11')]['push']({'type':_0x4151b4[_0x195125][0x0]['type'],'app':'Set','appdata':util['format'](_0xd254('0x12'),_0x4151b4[_0x195125][0x0][_0xd254('0x13')]),'context':_0x4151b4[_0x195125][0x0][_0xd254('0x14')],'exten':_0x4151b4[_0x195125][0x0]['exten'],'priority':_0x443d23[_0xd254('0x15')]++,'VoiceExtensionId':_0x4151b4[_0x195125][0x0]['VoiceExtensionId']});if(_0x4151b4[_0x195125][0x0]['type']==='inbound'){_0x443d23['extensions'][_0xd254('0x16')]({'type':_0x4151b4[_0x195125][0x0][_0xd254('0x13')],'app':_0xd254('0x17'),'appdata':_0xd254('0x18')+_0x4151b4[_0x195125][0x0][_0xd254('0x19')],'context':_0x4151b4[_0x195125][0x0][_0xd254('0x14')],'exten':_0x4151b4[_0x195125][0x0]['exten'],'priority':_0x443d23['priority']++,'VoiceExtensionId':_0x4151b4[_0x195125][0x0][_0xd254('0x19')]});}else if(_0x4151b4[_0x195125][0x0][_0xd254('0x13')]===_0xd254('0x1a')){if(_0x443d23[_0xd254('0x1b')]){_0x443d23[_0xd254('0x11')][_0xd254('0x16')]({'type':_0x4151b4[_0x195125][0x0][_0xd254('0x13')],'app':_0xd254('0x17'),'appdata':_0xd254('0x1c')+(_0x443d23['extension'][_0xd254('0x1d')]?_0xd254('0x1e')+_0x443d23['extension'][_0xd254('0x1d')]+'}':'${EXTEN}'),'context':_0x4151b4[_0x195125][0x0][_0xd254('0x14')],'exten':_0x4151b4[_0x195125][0x0]['exten'],'priority':_0x443d23[_0xd254('0x15')]++,'VoiceExtensionId':_0x4151b4[_0x195125][0x0][_0xd254('0x19')]});}_0x443d23[_0xd254('0x11')][_0xd254('0x16')]({'type':_0x4151b4[_0x195125][0x0]['type'],'app':_0xd254('0x17'),'appdata':_0xd254('0x18')+_0x4151b4[_0x195125][0x0][_0xd254('0x19')],'context':_0x4151b4[_0x195125][0x0][_0xd254('0x14')],'exten':_0x4151b4[_0x195125][0x0]['exten'],'priority':_0x443d23['priority']++,'VoiceExtensionId':_0x4151b4[_0x195125][0x0][_0xd254('0x19')]});var _0x24cb55=_0x443d23[_0xd254('0x15')]++;_0x443d23[_0xd254('0x11')][_0xd254('0x16')]({'type':_0x4151b4[_0x195125][0x0][_0xd254('0x13')],'app':_0xd254('0x1f'),'appdata':_0xd254('0x20')+(_0x24cb55+0x2)+'):Goto('+(_0x24cb55+0x1)+')','context':_0x4151b4[_0x195125][0x0][_0xd254('0x14')],'exten':_0x4151b4[_0x195125][0x0][_0xd254('0xc')],'priority':_0x24cb55,'VoiceExtensionId':_0x4151b4[_0x195125][0x0][_0xd254('0x19')]});if(_0x443d23[_0xd254('0x1b')]){_0x443d23[_0xd254('0x11')][_0xd254('0x16')]({'type':_0x4151b4[_0x195125][0x0][_0xd254('0x13')],'app':'Set','appdata':_0x443d23[_0xd254('0x1b')]['cutdigits']?_0xd254('0x21')+_0x443d23[_0xd254('0x1b')][_0xd254('0x1d')]+'}':_0xd254('0x22'),'context':_0x4151b4[_0x195125][0x0][_0xd254('0x14')],'exten':_0x4151b4[_0x195125][0x0][_0xd254('0xc')],'priority':_0x443d23[_0xd254('0x15')]++,'VoiceExtensionId':_0x4151b4[_0x195125][0x0]['VoiceExtensionId']});}_0x443d23[_0xd254('0x11')][_0xd254('0x16')]({'type':_0x4151b4[_0x195125][0x0]['type'],'app':_0xd254('0x17'),'appdata':'outboundrouteid='+_0x4151b4[_0x195125][0x0][_0xd254('0x19')],'context':_0x4151b4[_0x195125][0x0]['context'],'exten':_0x4151b4[_0x195125][0x0][_0xd254('0xc')],'priority':_0x443d23[_0xd254('0x15')]++,'VoiceExtensionId':_0x4151b4[_0x195125][0x0]['VoiceExtensionId']});if(_0x443d23[_0xd254('0x1b')]&&_0x443d23[_0xd254('0x1b')][_0xd254('0xf')](_0xd254('0x23'))&&_0x443d23[_0xd254('0x1b')][_0xd254('0x23')]!==_0xd254('0x24')){_0x443d23[_0xd254('0x11')][_0xd254('0x16')]({'type':_0x4151b4[_0x195125][0x0][_0xd254('0x13')],'app':_0xd254('0x17'),'appdata':_0xd254('0x25'),'context':_0x4151b4[_0x195125][0x0]['context'],'exten':_0x4151b4[_0x195125][0x0][_0xd254('0xc')],'priority':_0x443d23[_0xd254('0x15')]++,'VoiceExtensionId':_0x4151b4[_0x195125][0x0][_0xd254('0x19')]});_0x443d23[_0xd254('0x11')][_0xd254('0x16')]({'type':_0x4151b4[_0x195125][0x0]['type'],'app':_0xd254('0x17'),'appdata':_0xd254('0x26')+_0x443d23[_0xd254('0x1b')][_0xd254('0x23')]||_0xd254('0x27'),'context':_0x4151b4[_0x195125][0x0]['context'],'exten':_0x4151b4[_0x195125][0x0][_0xd254('0xc')],'priority':_0x443d23[_0xd254('0x15')]++,'VoiceExtensionId':_0x4151b4[_0x195125][0x0][_0xd254('0x19')]});}}_0x443d23[_0xd254('0x11')][_0xd254('0x16')]({'type':_0x4151b4[_0x195125][0x0][_0xd254('0x13')],'app':_0xd254('0x17'),'appdata':_0xd254('0x28'),'context':_0x4151b4[_0x195125][0x0][_0xd254('0x14')],'exten':_0x4151b4[_0x195125][0x0][_0xd254('0xc')],'priority':_0x443d23[_0xd254('0x15')]++,'VoiceExtensionId':_0x4151b4[_0x195125][0x0]['VoiceExtensionId']});_0x443d23[_0xd254('0x11')][_0xd254('0x16')]({'type':_0x4151b4[_0x195125][0x0][_0xd254('0x13')],'app':'Set','appdata':_0xd254('0x29'),'context':_0x4151b4[_0x195125][0x0][_0xd254('0x14')],'exten':_0x4151b4[_0x195125][0x0][_0xd254('0xc')],'priority':_0x443d23['priority']++,'VoiceExtensionId':_0x4151b4[_0x195125][0x0][_0xd254('0x19')]});_0x443d23[_0xd254('0x11')][_0xd254('0x16')]({'type':_0x4151b4[_0x195125][0x0]['type'],'app':'Set','appdata':_0xd254('0x2a'),'context':_0x4151b4[_0x195125][0x0]['context'],'exten':_0x4151b4[_0x195125][0x0]['exten'],'priority':_0x443d23['priority']++,'VoiceExtensionId':_0x4151b4[_0x195125][0x0]['VoiceExtensionId']});for(var _0x177020=0x0,_0x3ef068=0x0;_0x177020<_0x4151b4[_0x195125][_0xd254('0x2b')];_0x177020+=0x1,_0x3ef068=0x0){var _0x2f642d=_0x4151b4[_0x195125][_0x177020];if(_0x2f642d[_0xd254('0x13')]){_0x2f642d['type']=_0x2f642d[_0xd254('0x13')][_0xd254('0x2c')]();}var _0x200264=[];var _0x1b952f=[];delete _0x2f642d['id'];delete _0x2f642d[_0xd254('0x2d')];delete _0x2f642d['updatedAt'];var _0x53ee5d=_0x2f642d[_0xd254('0x2e')]!==_0xd254('0x2f')?[_0x2f642d[_0xd254('0x2e')]]:_0x2f642d[_0xd254('0x7')]?_[_0xd254('0x30')](_[_0xd254('0xa')](_0x443d23[_0xd254('0x5')],{'IntervalId':_0x2f642d['IntervalId']}),_0xd254('0x2e')):[];if(_0x2f642d['hasOwnProperty']('tag')){if(_0x2f642d['tag']&&_0x2f642d[_0xd254('0x31')]!=='--'){_0x200264[_0xd254('0x16')]({'type':_0x2f642d[_0xd254('0x13')],'app':_0xd254('0x17'),'appdata':_0xd254('0x32')+_0x2f642d['tag'],'context':_0x2f642d['context'],'exten':_0x2f642d[_0xd254('0xc')],'priority':_0x53ee5d['length']+_0x443d23[_0xd254('0x15')]+_0x3ef068++,'VoiceExtensionId':_0x2f642d['VoiceExtensionId']});}}if(_0x2f642d[_0xd254('0x13')]===_0xd254('0x1a')&&_0x2f642d[_0xd254('0xf')](_0xd254('0x33'))){if(_0x2f642d[_0xd254('0x33')]){_0x200264['push']({'type':_0x2f642d[_0xd254('0x13')],'app':_0xd254('0x1f'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x2f642d[_0xd254('0x33')]+')','context':_0x2f642d['context'],'exten':_0x2f642d[_0xd254('0xc')],'priority':_0x53ee5d['length']+_0x443d23['priority']+_0x3ef068++,'VoiceExtensionId':_0x2f642d[_0xd254('0x19')]});}else{_0x200264[_0xd254('0x16')]({'type':_0x2f642d['type'],'app':_0xd254('0x1f'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x2f642d[_0xd254('0x14')],'exten':_0x2f642d['exten'],'priority':_0x53ee5d[_0xd254('0x2b')]+_0x443d23['priority']+_0x3ef068++,'VoiceExtensionId':_0x2f642d[_0xd254('0x19')]});}}if(_0x2f642d[_0xd254('0xf')]('answer')){if(_0x3d18a9[_0xd254('0x34')](_0x2f642d['app'][_0xd254('0x2c')]())>=0x0&&_0x2f642d[_0xd254('0x35')]!=='custom'){if(_0x2f642d[_0xd254('0x36')]){_0x200264[_0xd254('0x16')]({'type':_0x2f642d[_0xd254('0x13')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x2f642d[_0xd254('0x14')],'exten':_0x2f642d[_0xd254('0xc')],'priority':_0x53ee5d['length']+_0x443d23[_0xd254('0x15')]+_0x3ef068++,'VoiceExtensionId':_0x2f642d[_0xd254('0x19')]});_0x200264['push']({'type':_0x2f642d['type'],'app':_0xd254('0x17'),'appdata':_0xd254('0x37'),'context':_0x2f642d[_0xd254('0x14')],'exten':_0x2f642d[_0xd254('0xc')],'priority':_0x53ee5d['length']+_0x443d23['priority']+_0x3ef068++,'VoiceExtensionId':_0x2f642d['VoiceExtensionId']});}else{_0x200264[_0xd254('0x16')]({'type':_0x2f642d[_0xd254('0x13')],'app':_0xd254('0x1f'),'appdata':_0xd254('0x38'),'context':_0x2f642d['context'],'exten':_0x2f642d[_0xd254('0xc')],'priority':_0x53ee5d[_0xd254('0x2b')]+_0x443d23[_0xd254('0x15')]+_0x3ef068++,'VoiceExtensionId':_0x2f642d[_0xd254('0x19')]});_0x200264[_0xd254('0x16')]({'type':_0x2f642d[_0xd254('0x13')],'app':_0xd254('0x17'),'appdata':_0xd254('0x39'),'context':_0x2f642d[_0xd254('0x14')],'exten':_0x2f642d[_0xd254('0xc')],'priority':_0x53ee5d['length']+_0x443d23[_0xd254('0x15')]+_0x3ef068++,'VoiceExtensionId':_0x2f642d[_0xd254('0x19')]});}}}for(var _0x501d65=0x0;_0x501d65<_0x53ee5d[_0xd254('0x2b')];_0x501d65+=0x1){var _0x2d6066=_0x443d23[_0xd254('0x15')]+_0x53ee5d[_0xd254('0x2b')];var _0x3dcae6=_0x501d65===_0x53ee5d[_0xd254('0x2b')]-0x1?_0x443d23['priority']+_0x200264[_0xd254('0x2b')]+_0x1b952f[_0xd254('0x2b')]+0x2:_0x443d23[_0xd254('0x15')]+_0x501d65+0x1;_0x200264['splice'](_0x501d65,0x0,{'type':_0x2f642d[_0xd254('0x13')],'app':_0xd254('0x3a'),'appdata':_0x53ee5d[_0x501d65]+'?'+_0x2f642d[_0xd254('0x14')]+',${EXTEN},'+_0x2d6066+':'+_0x2f642d[_0xd254('0x14')]+_0xd254('0x3b')+_0x3dcae6,'exten':_0x2f642d[_0xd254('0xc')],'context':_0x2f642d[_0xd254('0x14')],'priority':_0x443d23['priority']+_0x501d65,'VoiceExtensionId':_0x4151b4[_0x195125][0x0][_0xd254('0x19')]});}_0x2f642d[_0xd254('0x15')]=_0x200264['length']?_[_0xd254('0x3c')](_0x200264)[_0xd254('0x15')]+0x1:_0x443d23[_0xd254('0x15')];_0x443d23[_0xd254('0x15')]=(_0x1b952f[_0xd254('0x2b')]?_[_0xd254('0x3c')](_0x1b952f)[_0xd254('0x15')]:_0x2f642d[_0xd254('0x15')])+0x1;_0x443d23[_0xd254('0x11')]=_[_0xd254('0x3d')](_0x443d23['extensions'],_0x200264,[_0x2f642d],_0x1b952f);}_0x443d23[_0xd254('0x11')]['push']({'type':_0x4151b4[_0x195125][0x0][_0xd254('0x13')],'app':_0xd254('0x3e'),'exten':_0x4151b4[_0x195125][0x0][_0xd254('0xc')],'context':_0x4151b4[_0x195125][0x0][_0xd254('0x14')],'priority':_0x443d23[_0xd254('0x15')],'VoiceExtensionId':_0x4151b4[_0x195125][0x0][_0xd254('0x19')]});_0x3a192d[_0xd254('0x16')](_0x4151b4[_0x195125][0x0][_0xd254('0x19')]);_0xde587c=_[_0xd254('0x3d')](_0xde587c,_0x443d23['extensions']);}}return _0x117fc0['transaction'](function(_0x43dbe6){return _0x117fc0[_0xd254('0x8')]['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':{'$in':_0x3a192d}},'transaction':_0x43dbe6})[_0xd254('0x4')](function(_0x5defcc){return _0x117fc0[_0xd254('0x8')][_0xd254('0x6')][_0xd254('0x3f')](_[_0xd254('0x40')](_0xde587c,_0xd254('0x15')),{'transaction':_0x43dbe6});});});})[_0xd254('0x41')](function(_0x3a587f){console[_0xd254('0x42')](_0x3a587f);});}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 e5be6e7..7f4df6a 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 _0xbba5=['findAll','outbound','dialCheckDuplicateType','CmList','always','sequelize','VoiceQueueId','then','onlyIfOpen','query','BlackLists','all','Campaign','Lists','get','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','contact:csv_','resolve','emit','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','CSV\x20import\x20process\x20stopped!','createReadStream','pause','CSV\x20parsed\x20correctly!','info','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','papaparse','ioredis','../../../mysqldb','../../../config/environment','redis','defaults','localhost','register','argv','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','isNil','errors','map','message','join','hasOwnProperty','data','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','ListId','length','duplicate','Duplicate\x20Contact','create','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','inspect','insert','into','cm_hopper','fromQuery','updatedAt','field','toString','NOW()','createdAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','select','\x20=\x20?','ContactId','scheduledAt','id\x20IN\x20?','str','phone\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','cm_hopper_black'];(function(_0x50388b,_0x276225){var _0x6037b=function(_0x584277){while(--_0x584277){_0x50388b['push'](_0x50388b['shift']());}};_0x6037b(++_0x276225);}(_0xbba5,0x15b));var _0x5bba=function(_0x3fa3b6,_0x562fb9){_0x3fa3b6=_0x3fa3b6-0x0;var _0x3c1efb=_0xbba5[_0x3fa3b6];return _0x3c1efb;};'use strict';var BPromise=require(_0x5bba('0x0'));var util=require(_0x5bba('0x1'));var _=require(_0x5bba('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require(_0x5bba('0x3'));var Redis=require(_0x5bba('0x4'));var db=require(_0x5bba('0x5'))['db'];var config=require(_0x5bba('0x6'));var logger=require('../../../config/logger')('api');config[_0x5bba('0x7')]=_[_0x5bba('0x8')](config[_0x5bba('0x7')],{'host':_0x5bba('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5bba('0x7')]));require('../../../api/cmContact/cmContact.socket')[_0x5bba('0xa')](socket);try{if(!process['argv'][0x2]||process[_0x5bba('0xb')][0x2]===_0x5bba('0xc')||process[_0x5bba('0xb')][0x2]===_0x5bba('0xd')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process['argv'][0x2];if(!process[_0x5bba('0xb')][0x3]||process[_0x5bba('0xb')][0x3]===_0x5bba('0xc')||process[_0x5bba('0xb')][0x3]==='null'||!process[_0x5bba('0xb')][0x4]||process[_0x5bba('0xb')][0x4]===_0x5bba('0xc')||process[_0x5bba('0xb')][0x4]===_0x5bba('0xd')){throw new Error(_0x5bba('0xe'));}var FIELDS=_[_0x5bba('0xf')](process['argv'][0x3]['split'](','),process[_0x5bba('0xb')][0x4][_0x5bba('0x10')](','));if(!process[_0x5bba('0xb')][0x5]||process[_0x5bba('0xb')][0x5]==='undefined'||process[_0x5bba('0xb')][0x5]===_0x5bba('0xd')){throw new Error(_0x5bba('0x11'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x5bba('0xb')][0x6]&&process[_0x5bba('0xb')][0x6]!==_0x5bba('0xc')&&process[_0x5bba('0xb')][0x6]!==_0x5bba('0xd')?process[_0x5bba('0xb')][0x6]:null;var DUPLICATES=process[_0x5bba('0xb')][0x7]&&process['argv'][0x7]!==_0x5bba('0xc')&&process[_0x5bba('0xb')][0x7]!==_0x5bba('0xd')?process[_0x5bba('0xb')][0x7]:null;if(!process[_0x5bba('0xb')][0x8]||process[_0x5bba('0xb')][0x8]===_0x5bba('0xc')||process[_0x5bba('0xb')][0x8]===_0x5bba('0xd')){throw new Error(_0x5bba('0x12'));}var SOCKET_TIMESTAMP=process[_0x5bba('0xb')][0x8];}catch(_0x12393e){logger[_0x5bba('0x13')](_0x12393e);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(_0x4480b9,_0x44884d,_0x2d93ab,_0x3da12b){var _0x5483eb={'message':_0x44884d};_0x5483eb[_0x4480b9]=!![];if(_0x2d93ab){_0x5483eb[_0x5bba('0x14')]=_0x2d93ab;}if(_0x3da12b){_0x5483eb['index']=_0x3da12b;}return _0x5483eb;}function isEmail(_0x2b5479){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'](_0x2b5479);}function checkRow(_0x298f8d,_0x36c0f4,_0x3506df){return new BPromise(function(_0x261b97,_0x3ae4bf){if(_[_0x5bba('0x15')](_0x298f8d)){return _0x3ae4bf(handleCheckRowError(_0x5bba('0x13'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x3506df));}if(_0x298f8d[_0x5bba('0x16')]&&_0x298f8d[_0x5bba('0x16')]['length']){var _0x136a6a=_[_0x5bba('0x17')](_0x298f8d[_0x5bba('0x16')],_0x5bba('0x18'))[_0x5bba('0x19')](';');return _0x3ae4bf(handleCheckRowError(_0x5bba('0x13'),_0x136a6a,null,_0x3506df));}var _0x3166ef={};for(var _0x213bac in FIELDS){if(FIELDS[_0x5bba('0x1a')](_0x213bac)&&FIELDS[_0x213bac]){_0x3166ef[_0x213bac]=_0x298f8d[_0x5bba('0x1b')][0x0][FIELDS[_0x213bac]]||_0x298f8d['data'][0x0]['\ufeff'+FIELDS[_0x213bac]];}}if(!_0x3166ef['firstName']){return _0x3ae4bf(handleCheckRowError(_0x5bba('0x13'),_0x5bba('0x1c'),null,_0x3506df));}if(!_0x3166ef[_0x5bba('0x1d')]){return _0x3ae4bf(handleCheckRowError(_0x5bba('0x13'),_0x5bba('0x1e'),null,_0x3506df));}if(_0x3166ef[_0x5bba('0x1f')]){var _0x36d8f7=moment(_0x3166ef['birthDate'],_0x5bba('0x20'));if(!_0x36d8f7[_0x5bba('0x21')]()){return _0x3ae4bf(handleCheckRowError('error','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x3506df));}}if(_0x3166ef[_0x5bba('0x22')]){if(!isEmail(_0x3166ef[_0x5bba('0x22')])){return _0x3ae4bf(handleCheckRowError('error',_0x5bba('0x23'),null,_0x3506df));}}_0x3166ef[_0x5bba('0x24')]=LISTID;_0x3166ef['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x5bba('0x25')]&&_0x36c0f4){var _0x17b639={};for(var _0x3247d3=0x0,_0x2c36b2=DUPLICATES[_0x5bba('0x25')];_0x3247d3<_0x2c36b2;_0x3247d3+=0x1){_0x17b639[DUPLICATES[_0x3247d3]]=_0x3166ef[DUPLICATES[_0x3247d3]];}var _0x29c5ff=_['find'](_0x36c0f4,_0x17b639);if(_0x29c5ff){return _0x3ae4bf(handleCheckRowError(_0x5bba('0x26'),_0x5bba('0x27'),_0x29c5ff,_0x3506df));}}return db['CmContact'][_0x5bba('0x28')](_0x3166ef,{'raw':!![],'hooks':![],'fields':_['keys'](_0x3166ef)})['then'](function(_0x18799e){if(DUPLICATES&&DUPLICATES[_0x5bba('0x25')]&&_0x36c0f4){_0x36c0f4[_0x5bba('0x29')](_[_0x5bba('0x2a')](_0x3166ef,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x18799e['id'];return _0x261b97();})[_0x5bba('0x2b')](function(_0x5c8367){return _0x3ae4bf(handleCheckRowError('error',_0x5bba('0x2c')+(_0x5c8367[_0x5bba('0x18')]||JSON[_0x5bba('0x2d')](_0x5c8367)),null,_0x3506df));});});}function checkHopper(){function _0x1ab4b1(){return function(_0x250c2c){logger[_0x5bba('0x13')](_0x5bba('0x2e'),'checkHopper',util[_0x5bba('0x2f')](_0x250c2c,{'showHidden':![],'depth':null}));};}var _0x46f0d8=function(_0x51dacd,_0x60b54d){var _0x4402d7=squel[_0x5bba('0x30')]()[_0x5bba('0x31')](_0x5bba('0x32'))[_0x5bba('0x33')]([_0x5bba('0x1d'),'scheduledAt','ContactId',_0x5bba('0x24'),_0x60b54d,'createdAt',_0x5bba('0x34')],squel['select']()[_0x5bba('0x35')](_0x5bba('0x1d'),_0x5bba('0x1d'))[_0x5bba('0x35')]('NOW()','scheduledAt')[_0x5bba('0x35')]('id','ContactId')['field'](LISTID[_0x5bba('0x36')](),_0x5bba('0x24'))['field'](_0x51dacd['id']['toString'](),_0x60b54d)['field'](_0x5bba('0x37'),_0x5bba('0x38'))[_0x5bba('0x35')](_0x5bba('0x37'),_0x5bba('0x34'))[_0x5bba('0x39')](_0x5bba('0x3a'))[_0x5bba('0x3b')](_0x5bba('0x3c'))['where'](_0x5bba('0x3d'),LISTID[_0x5bba('0x36')]())[_0x5bba('0x3b')](_0x5bba('0x3e'))[_0x5bba('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel[_0x5bba('0x3f')]()[_0x5bba('0x35')](_0x5bba('0x1d'))['from'](_0x5bba('0x32'))['where'](_0x60b54d+_0x5bba('0x40'),_0x51dacd['id'][_0x5bba('0x36')]())))[_0x5bba('0x36')]();return _0x4402d7;};var _0x6422ef=function(_0x9ebb67,_0x137e8f){var _0x4e3a91=squel[_0x5bba('0x30')]()[_0x5bba('0x31')](_0x5bba('0x32'))[_0x5bba('0x33')]([_0x5bba('0x1d'),'scheduledAt',_0x5bba('0x41'),_0x5bba('0x24'),_0x137e8f,'createdAt',_0x5bba('0x34')],squel[_0x5bba('0x3f')]()['field'](_0x5bba('0x1d'),_0x5bba('0x1d'))['field'](_0x5bba('0x37'),_0x5bba('0x42'))[_0x5bba('0x35')]('id','ContactId')['field'](LISTID[_0x5bba('0x36')](),_0x5bba('0x24'))['field'](_0x9ebb67['id'][_0x5bba('0x36')](),_0x137e8f)[_0x5bba('0x35')]('NOW()',_0x5bba('0x38'))['field'](_0x5bba('0x37'),_0x5bba('0x34'))[_0x5bba('0x39')](_0x5bba('0x3a'))[_0x5bba('0x3b')]('deletedAt\x20IS\x20NULL')['where'](_0x5bba('0x3d'),LISTID[_0x5bba('0x36')]())[_0x5bba('0x3b')](_0x5bba('0x43'),squel[_0x5bba('0x44')](hopperContacts))['where'](_0x5bba('0x3e'))[_0x5bba('0x3b')](_0x5bba('0x45'),squel[_0x5bba('0x3f')]()['field'](_0x5bba('0x46'))[_0x5bba('0x39')](_0x5bba('0x47'))[_0x5bba('0x3b')](_0x137e8f+'\x20=\x20?',_0x9ebb67['id'][_0x5bba('0x36')]()))[_0x5bba('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field']('phone')[_0x5bba('0x39')](_0x5bba('0x32'))[_0x5bba('0x3b')](_0x137e8f+_0x5bba('0x40'),_0x9ebb67['id']['toString']())))[_0x5bba('0x36')]();return _0x4e3a91;};function _0x290cf3(_0x32e58a,_0x2bfe19){var _0x356e7c=squel[_0x5bba('0x30')]()[_0x5bba('0x31')](_0x5bba('0x32'))[_0x5bba('0x33')](['phone',_0x5bba('0x42'),'ContactId',_0x5bba('0x24'),_0x2bfe19,'createdAt',_0x5bba('0x34')],squel[_0x5bba('0x3f')]()[_0x5bba('0x35')](_0x5bba('0x1d'),_0x5bba('0x1d'))[_0x5bba('0x35')](_0x5bba('0x37'),'scheduledAt')[_0x5bba('0x35')]('id','ContactId')[_0x5bba('0x35')](LISTID[_0x5bba('0x36')](),_0x5bba('0x24'))['field'](_0x32e58a['id'][_0x5bba('0x36')](),_0x2bfe19)[_0x5bba('0x35')](_0x5bba('0x37'),_0x5bba('0x38'))[_0x5bba('0x35')](_0x5bba('0x37'),_0x5bba('0x34'))[_0x5bba('0x39')](_0x5bba('0x3a'))[_0x5bba('0x3b')]('deletedAt\x20IS\x20NULL')['where'](_0x5bba('0x3d'),LISTID[_0x5bba('0x36')]())[_0x5bba('0x3b')](_0x5bba('0x43'),squel['str'](hopperContacts))[_0x5bba('0x3b')](_0x5bba('0x3e')))[_0x5bba('0x36')]();return _0x356e7c;}function _0x2df302(_0x3c9a56,_0x23c015){var _0x334992=squel[_0x5bba('0x30')]()[_0x5bba('0x31')](_0x5bba('0x48'))[_0x5bba('0x33')]([_0x5bba('0x1d'),_0x5bba('0x41'),_0x5bba('0x24'),_0x23c015,_0x5bba('0x38'),'updatedAt'],squel[_0x5bba('0x3f')]()['field'](_0x5bba('0x1d'),_0x5bba('0x1d'))[_0x5bba('0x35')]('id','ContactId')[_0x5bba('0x35')](LISTID[_0x5bba('0x36')](),'ListId')[_0x5bba('0x35')](_0x3c9a56['id'][_0x5bba('0x36')](),_0x23c015)['field']('NOW()',_0x5bba('0x38'))[_0x5bba('0x35')](_0x5bba('0x37'),_0x5bba('0x34'))['from'](_0x5bba('0x3a'))['where'](_0x5bba('0x3c'))[_0x5bba('0x3b')](_0x5bba('0x3d'),LISTID[_0x5bba('0x36')]())[_0x5bba('0x3b')](_0x5bba('0x43'),squel[_0x5bba('0x44')](hopperContacts))[_0x5bba('0x3b')](_0x5bba('0x3e')))[_0x5bba('0x36')]();return _0x334992;}return db['VoiceQueue'][_0x5bba('0x49')]({'where':{'type':_0x5bba('0x4a')},'attributes':['id',_0x5bba('0x4b')],'include':[{'model':db[_0x5bba('0x4c')],'as':'Lists','where':{'id':LISTID}}]})['then'](function(_0x3ee5d7){var _0x3f08b1=[];if(_0x3ee5d7){var _0x2c6737;for(var _0x39352b=0x0,_0x5e93d4;_0x39352b<_0x3ee5d7[_0x5bba('0x25')];_0x39352b+=0x1){_0x5e93d4=_0x3ee5d7[_0x39352b]['get']({'plain':!![]});switch(_0x5e93d4[_0x5bba('0x4b')]){case _0x5bba('0x4d'):_0x3f08b1[_0x5bba('0x29')](db[_0x5bba('0x4e')]['query'](_0x6422ef(_0x5e93d4,_0x5bba('0x4f')))[_0x5bba('0x50')](function(){})['catch'](_0x1ab4b1()));break;case _0x5bba('0x51'):_0x3f08b1[_0x5bba('0x29')](db[_0x5bba('0x4e')][_0x5bba('0x52')](_0x46f0d8(_0x5e93d4,_0x5bba('0x4f')))['then'](function(){})[_0x5bba('0x2b')](_0x1ab4b1()));break;default:_0x3f08b1[_0x5bba('0x29')](db[_0x5bba('0x4e')][_0x5bba('0x52')](_0x290cf3(_0x5e93d4,_0x5bba('0x4f')))[_0x5bba('0x50')](function(){})[_0x5bba('0x2b')](_0x1ab4b1()));}}}return _0x3f08b1;})['all']()[_0x5bba('0x50')](function(){return db['VoiceQueue'][_0x5bba('0x49')]({'where':{'type':_0x5bba('0x4a')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x5bba('0x53'),'where':{'id':LISTID}}]})['then'](function(_0x47cd5d){var _0x3a2848=[];if(_0x47cd5d){var _0x56bee5;for(var _0x427967=0x0,_0x39264b;_0x427967<_0x47cd5d['length'];_0x427967+=0x1){_0x39264b=_0x47cd5d[_0x427967]['get']({'plain':!![]});_0x3a2848[_0x5bba('0x29')](db[_0x5bba('0x4e')][_0x5bba('0x52')](_0x2df302(_0x39264b,'VoiceQueueId'))[_0x5bba('0x50')](function(){})[_0x5bba('0x2b')](_0x1ab4b1()));}}return _0x3a2848;})[_0x5bba('0x54')]();})[_0x5bba('0x50')](function(){return db[_0x5bba('0x55')][_0x5bba('0x49')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x5bba('0x4c')],'as':_0x5bba('0x56'),'where':{'id':LISTID}}]})[_0x5bba('0x50')](function(_0x49d500){var _0x2c29e5=[];if(_0x49d500){for(var _0x565cba=0x0,_0x5be1e3;_0x565cba<_0x49d500[_0x5bba('0x25')];_0x565cba+=0x1){_0x5be1e3=_0x49d500[_0x565cba][_0x5bba('0x57')]({'plain':!![]});switch(_0x5be1e3[_0x5bba('0x4b')]){case'always':_0x2c29e5['push'](db[_0x5bba('0x4e')]['query'](_0x6422ef(_0x5be1e3,_0x5bba('0x58')))[_0x5bba('0x50')](function(){})['catch'](_0x1ab4b1()));break;case _0x5bba('0x51'):_0x2c29e5[_0x5bba('0x29')](db['sequelize'][_0x5bba('0x52')](_0x46f0d8(_0x5be1e3,_0x5bba('0x58')))['then'](function(){})[_0x5bba('0x2b')](_0x1ab4b1()));break;default:_0x2c29e5[_0x5bba('0x29')](db[_0x5bba('0x4e')]['query'](_0x290cf3(_0x5be1e3,_0x5bba('0x58')))[_0x5bba('0x50')](function(){})[_0x5bba('0x2b')](_0x1ab4b1()));}}}return _0x2c29e5;})['all']();})[_0x5bba('0x50')](function(){return db['Campaign'][_0x5bba('0x49')]({'attributes':['id'],'include':[{'model':db[_0x5bba('0x4c')],'as':_0x5bba('0x53'),'where':{'id':LISTID}}]})['then'](function(_0x3e19ae){var _0x31f847=[];if(_0x3e19ae){for(var _0x4480d7=0x0,_0x36e6cf;_0x4480d7<_0x3e19ae[_0x5bba('0x25')];_0x4480d7+=0x1){_0x36e6cf=_0x3e19ae[_0x4480d7][_0x5bba('0x57')]({'plain':!![]});_0x31f847[_0x5bba('0x29')](db[_0x5bba('0x4e')][_0x5bba('0x52')](_0x2df302(_0x36e6cf,_0x5bba('0x58')))[_0x5bba('0x50')](function(){})['catch'](_0x1ab4b1()));}}return _0x31f847;})[_0x5bba('0x54')]();})[_0x5bba('0x2b')](function(_0x2f3055){logger[_0x5bba('0x13')](_0x5bba('0x59'),_0x5bba('0x5a'),_0x2f3055[_0x5bba('0x18')]);});}var processPromises=function(_0x375c4c){return BPromise[_0x5bba('0x54')](promises)[_0x5bba('0x50')](function(_0x4165bd){})['catch'](function(_0x57569c){logger[_0x5bba('0x13')](_0x5bba('0x5b'),JSON[_0x5bba('0x2d')](_0x57569c));})[_0x5bba('0x5c')](function(){socket['emit'](_0x5bba('0x5d')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x375c4c){return _0x375c4c['resume']();}});};var endCsv=function(){return BPromise[_0x5bba('0x5e')]()[_0x5bba('0x50')](function(){if(hopperContacts){return checkHopper();}})[_0x5bba('0x50')](function(){socket[_0x5bba('0x5f')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x5bba('0x60')](FILEPATH);}catch(_0x247260){logger[_0x5bba('0x13')](_0x5bba('0x61'),JSON['stringify'](_0x247260));}finally{process[_0x5bba('0x62')](0x0);}});};process['on']('SIGINT',function(){logger['info'](_0x5bba('0x63'));endCsv();});function main(){return BPromise[_0x5bba('0x5e')]()[_0x5bba('0x50')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x5bba('0x10')](',');return db['CmContact'][_0x5bba('0x49')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x316365){var _0x55fd2d=fs[_0x5bba('0x64')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x55fd2d,{'header':!![],'skipEmptyLines':!![],'step':function(_0x33c50d,_0x4e0cbb){total+=0x1;var _0x4a66ed=total;promises[_0x5bba('0x29')](checkRow(_0x33c50d,_0x316365,_0x4a66ed)[_0x5bba('0x50')](function(){success+=0x1;})[_0x5bba('0x2b')](function(_0xbf0915){if(_0xbf0915[_0x5bba('0x13')]){errors+=0x1;delete _0xbf0915[_0x5bba('0x13')];}else if(_0xbf0915['duplicate']){duplicates+=0x1;delete _0xbf0915[_0x5bba('0x26')];}rows[_0x5bba('0x29')](_0xbf0915);}));if(total%0xc8===0x0){_0x4e0cbb[_0x5bba('0x65')]();return processPromises(_0x4e0cbb);}},'complete':function(){return processPromises()[_0x5bba('0x50')](function(){logger['info'](_0x5bba('0x66'));endCsv();});},'error':function(_0x52039d,_0x99a84c){logger[_0x5bba('0x67')]('CSV\x20parse\x20error',JSON[_0x5bba('0x2d')](_0x52039d));endCsv();}});})[_0x5bba('0x2b')](function(_0x29f419){logger[_0x5bba('0x13')](_0x5bba('0x68'),JSON[_0x5bba('0x2d')](_0x29f419));});}main(); \ No newline at end of file +var _0x606e=['bluebird','util','lodash','squel','papaparse','ioredis','../../../config/environment','../../../config/logger','api','defaults','redis','localhost','socket.io-emitter','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','test','isNil','errors','map','message','hasOwnProperty','data','firstName','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','length','find','duplicate','CmContact','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','from','where','ListId\x20=\x20?','toString','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','insert','cm_contacts','deletedAt\x20IS\x20NULL','id\x20IN\x20?','calleridnum','cm_hopper_final','str','VoiceQueue','findAll','dialCheckDuplicateType','Lists','get','always','sequelize','query','VoiceQueueId','onlyIfOpen','outbound','CmList','BlackLists','all','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','emit','contact:csv_','Unable\x20to\x20delete\x20temp\x20file:','exit','CSV\x20import\x20process\x20stopped!','createReadStream','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:'];(function(_0x4085c7,_0x1f0d36){var _0x18099f=function(_0x115b84){while(--_0x115b84){_0x4085c7['push'](_0x4085c7['shift']());}};_0x18099f(++_0x1f0d36);}(_0x606e,0x6c));var _0xe606=function(_0x386c3e,_0x44a375){_0x386c3e=_0x386c3e-0x0;var _0x4b8e13=_0x606e[_0x386c3e];return _0x4b8e13;};'use strict';var BPromise=require(_0xe606('0x0'));var util=require(_0xe606('0x1'));var _=require(_0xe606('0x2'));var fs=require('fs');var squel=require(_0xe606('0x3'));var Papa=require(_0xe606('0x4'));var Redis=require(_0xe606('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0xe606('0x6'));var logger=require(_0xe606('0x7'))(_0xe606('0x8'));config['redis']=_[_0xe606('0x9')](config[_0xe606('0xa')],{'host':_0xe606('0xb'),'port':0x18eb});var socket=require(_0xe606('0xc'))(new Redis(config[_0xe606('0xa')]));require('../../../api/cmContact/cmContact.socket')['register'](socket);try{if(!process[_0xe606('0xd')][0x2]||process[_0xe606('0xd')][0x2]===_0xe606('0xe')||process[_0xe606('0xd')][0x2]==='null'){throw new Error(_0xe606('0xf'));}var FILEPATH=process[_0xe606('0xd')][0x2];if(!process[_0xe606('0xd')][0x3]||process[_0xe606('0xd')][0x3]===_0xe606('0xe')||process[_0xe606('0xd')][0x3]===_0xe606('0x10')||!process[_0xe606('0xd')][0x4]||process[_0xe606('0xd')][0x4]===_0xe606('0xe')||process[_0xe606('0xd')][0x4]===_0xe606('0x10')){throw new Error(_0xe606('0x11'));}var FIELDS=_[_0xe606('0x12')](process[_0xe606('0xd')][0x3][_0xe606('0x13')](','),process['argv'][0x4][_0xe606('0x13')](','));if(!process[_0xe606('0xd')][0x5]||process[_0xe606('0xd')][0x5]==='undefined'||process[_0xe606('0xd')][0x5]===_0xe606('0x10')){throw new Error(_0xe606('0x14'));}var LISTID=process[_0xe606('0xd')][0x5];var COMPANYID=process[_0xe606('0xd')][0x6]&&process[_0xe606('0xd')][0x6]!=='undefined'&&process[_0xe606('0xd')][0x6]!=='null'?process[_0xe606('0xd')][0x6]:null;var DUPLICATES=process[_0xe606('0xd')][0x7]&&process[_0xe606('0xd')][0x7]!==_0xe606('0xe')&&process['argv'][0x7]!==_0xe606('0x10')?process['argv'][0x7]:null;if(!process[_0xe606('0xd')][0x8]||process['argv'][0x8]==='undefined'||process[_0xe606('0xd')][0x8]==='null'){throw new Error(_0xe606('0x15'));}var SOCKET_TIMESTAMP=process[_0xe606('0xd')][0x8];}catch(_0x396b57){logger[_0xe606('0x16')](_0x396b57);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(_0x27197d,_0x3fd674,_0x536b6f,_0x4031ed){var _0xa9bb0b={'message':_0x3fd674};_0xa9bb0b[_0x27197d]=!![];if(_0x536b6f){_0xa9bb0b[_0xe606('0x17')]=_0x536b6f;}if(_0x4031ed){_0xa9bb0b['index']=_0x4031ed;}return _0xa9bb0b;}function isEmail(_0x34b8de){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))*$/[_0xe606('0x18')](_0x34b8de);}function checkRow(_0x9cee08,_0x27f1ea,_0x2868f9){return new BPromise(function(_0x29b190,_0x207861){if(_[_0xe606('0x19')](_0x9cee08)){return _0x207861(handleCheckRowError(_0xe606('0x16'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x2868f9));}if(_0x9cee08[_0xe606('0x1a')]&&_0x9cee08[_0xe606('0x1a')]['length']){var _0x3713b1=_[_0xe606('0x1b')](_0x9cee08['errors'],_0xe606('0x1c'))['join'](';');return _0x207861(handleCheckRowError('error',_0x3713b1,null,_0x2868f9));}var _0x453848={};for(var _0x5632f0 in FIELDS){if(FIELDS[_0xe606('0x1d')](_0x5632f0)&&FIELDS[_0x5632f0]){_0x453848[_0x5632f0]=_0x9cee08['data'][0x0][FIELDS[_0x5632f0]]||_0x9cee08[_0xe606('0x1e')][0x0]['\ufeff'+FIELDS[_0x5632f0]];}}if(!_0x453848[_0xe606('0x1f')]){return _0x207861(handleCheckRowError(_0xe606('0x16'),'firstName\x20not\x20specified!',null,_0x2868f9));}if(!_0x453848['phone']){return _0x207861(handleCheckRowError(_0xe606('0x16'),_0xe606('0x20'),null,_0x2868f9));}if(_0x453848[_0xe606('0x21')]){var _0x2ebf6c=moment(_0x453848[_0xe606('0x21')],'YYYY-MM-DD');if(!_0x2ebf6c[_0xe606('0x22')]()){return _0x207861(handleCheckRowError(_0xe606('0x16'),_0xe606('0x23'),null,_0x2868f9));}}if(_0x453848['email']){if(!isEmail(_0x453848[_0xe606('0x24')])){return _0x207861(handleCheckRowError(_0xe606('0x16'),_0xe606('0x25'),null,_0x2868f9));}}_0x453848[_0xe606('0x26')]=LISTID;_0x453848[_0xe606('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xe606('0x28')]&&_0x27f1ea){var _0x1a8454={};for(var _0x4d4e97=0x0,_0x493df8=DUPLICATES[_0xe606('0x28')];_0x4d4e97<_0x493df8;_0x4d4e97+=0x1){_0x1a8454[DUPLICATES[_0x4d4e97]]=_0x453848[DUPLICATES[_0x4d4e97]];}var _0x236959=_[_0xe606('0x29')](_0x27f1ea,_0x1a8454);if(_0x236959){return _0x207861(handleCheckRowError(_0xe606('0x2a'),'Duplicate\x20Contact',_0x236959,_0x2868f9));}}return db[_0xe606('0x2b')]['create'](_0x453848,{'raw':!![],'hooks':![],'fields':_[_0xe606('0x2c')](_0x453848)})[_0xe606('0x2d')](function(_0x36e2e6){if(DUPLICATES&&DUPLICATES['length']&&_0x27f1ea){_0x27f1ea[_0xe606('0x2e')](_[_0xe606('0x2f')](_0x453848,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x36e2e6['id'];return _0x29b190();})[_0xe606('0x30')](function(_0x42d75f){return _0x207861(handleCheckRowError(_0xe606('0x16'),_0xe606('0x31')+(_0x42d75f['message']||JSON[_0xe606('0x32')](_0x42d75f)),null,_0x2868f9));});});}function checkHopper(){function _0x13a990(){return function(_0x5a8649){logger['error'](_0xe606('0x33'),_0xe606('0x34'),util[_0xe606('0x35')](_0x5a8649,{'showHidden':![],'depth':null}));};}var _0x36f917=function(_0x9c0a6b,_0x2aa5db){var _0x79c2a6=squel['insert']()[_0xe606('0x36')](_0xe606('0x37'))[_0xe606('0x38')]([_0xe606('0x39'),_0xe606('0x3a'),_0xe606('0x3b'),_0xe606('0x26'),_0x2aa5db,_0xe606('0x3c'),_0xe606('0x3d')],squel[_0xe606('0x3e')]()[_0xe606('0x3f')](_0xe606('0x39'),_0xe606('0x39'))[_0xe606('0x3f')](_0xe606('0x40'),_0xe606('0x3a'))[_0xe606('0x3f')]('id','ContactId')['field'](LISTID['toString'](),_0xe606('0x26'))[_0xe606('0x3f')](_0x9c0a6b['id']['toString'](),_0x2aa5db)[_0xe606('0x3f')](_0xe606('0x40'),_0xe606('0x3c'))[_0xe606('0x3f')](_0xe606('0x40'),_0xe606('0x3d'))[_0xe606('0x41')]('cm_contacts')[_0xe606('0x42')]('deletedAt\x20IS\x20NULL')[_0xe606('0x42')](_0xe606('0x43'),LISTID[_0xe606('0x44')]())[_0xe606('0x42')](_0xe606('0x45'))[_0xe606('0x42')](_0xe606('0x46'),squel[_0xe606('0x3e')]()[_0xe606('0x3f')](_0xe606('0x39'))['from'](_0xe606('0x37'))[_0xe606('0x42')](_0x2aa5db+_0xe606('0x47'),_0x9c0a6b['id'][_0xe606('0x44')]())))[_0xe606('0x44')]();return _0x79c2a6;};var _0x21d631=function(_0x161e0a,_0x1fe449){var _0x3a7ea7=squel[_0xe606('0x48')]()[_0xe606('0x36')](_0xe606('0x37'))[_0xe606('0x38')](['phone',_0xe606('0x3a'),'ContactId','ListId',_0x1fe449,'createdAt',_0xe606('0x3d')],squel[_0xe606('0x3e')]()[_0xe606('0x3f')]('phone','phone')[_0xe606('0x3f')]('NOW()',_0xe606('0x3a'))['field']('id','ContactId')[_0xe606('0x3f')](LISTID[_0xe606('0x44')](),_0xe606('0x26'))[_0xe606('0x3f')](_0x161e0a['id']['toString'](),_0x1fe449)[_0xe606('0x3f')](_0xe606('0x40'),'createdAt')['field']('NOW()',_0xe606('0x3d'))['from'](_0xe606('0x49'))[_0xe606('0x42')](_0xe606('0x4a'))[_0xe606('0x42')]('ListId\x20=\x20?',LISTID['toString']())[_0xe606('0x42')](_0xe606('0x4b'),squel['str'](hopperContacts))[_0xe606('0x42')](_0xe606('0x45'))[_0xe606('0x42')](_0xe606('0x46'),squel[_0xe606('0x3e')]()[_0xe606('0x3f')](_0xe606('0x4c'))[_0xe606('0x41')](_0xe606('0x4d'))['where'](_0x1fe449+_0xe606('0x47'),_0x161e0a['id'][_0xe606('0x44')]()))[_0xe606('0x42')](_0xe606('0x46'),squel['select']()[_0xe606('0x3f')](_0xe606('0x39'))[_0xe606('0x41')](_0xe606('0x37'))['where'](_0x1fe449+_0xe606('0x47'),_0x161e0a['id'][_0xe606('0x44')]())))['toString']();return _0x3a7ea7;};function _0x18e94e(_0x17a5d0,_0x599141){var _0x24aa72=squel['insert']()[_0xe606('0x36')](_0xe606('0x37'))[_0xe606('0x38')](['phone','scheduledAt',_0xe606('0x3b'),_0xe606('0x26'),_0x599141,_0xe606('0x3c'),_0xe606('0x3d')],squel[_0xe606('0x3e')]()[_0xe606('0x3f')](_0xe606('0x39'),_0xe606('0x39'))[_0xe606('0x3f')](_0xe606('0x40'),_0xe606('0x3a'))[_0xe606('0x3f')]('id',_0xe606('0x3b'))['field'](LISTID[_0xe606('0x44')](),_0xe606('0x26'))[_0xe606('0x3f')](_0x17a5d0['id'][_0xe606('0x44')](),_0x599141)[_0xe606('0x3f')](_0xe606('0x40'),_0xe606('0x3c'))[_0xe606('0x3f')](_0xe606('0x40'),_0xe606('0x3d'))[_0xe606('0x41')]('cm_contacts')[_0xe606('0x42')](_0xe606('0x4a'))[_0xe606('0x42')](_0xe606('0x43'),LISTID[_0xe606('0x44')]())[_0xe606('0x42')](_0xe606('0x4b'),squel[_0xe606('0x4e')](hopperContacts))[_0xe606('0x42')](_0xe606('0x45')))[_0xe606('0x44')]();return _0x24aa72;}function _0x2ab72a(_0x2815af,_0x1bb9ad){var _0x1af0ec=squel['insert']()['into']('cm_hopper_black')['fromQuery']([_0xe606('0x39'),'ContactId','ListId',_0x1bb9ad,_0xe606('0x3c'),_0xe606('0x3d')],squel[_0xe606('0x3e')]()['field'](_0xe606('0x39'),_0xe606('0x39'))[_0xe606('0x3f')]('id','ContactId')[_0xe606('0x3f')](LISTID[_0xe606('0x44')](),_0xe606('0x26'))[_0xe606('0x3f')](_0x2815af['id']['toString'](),_0x1bb9ad)['field'](_0xe606('0x40'),'createdAt')[_0xe606('0x3f')](_0xe606('0x40'),_0xe606('0x3d'))['from'](_0xe606('0x49'))[_0xe606('0x42')](_0xe606('0x4a'))[_0xe606('0x42')](_0xe606('0x43'),LISTID[_0xe606('0x44')]())[_0xe606('0x42')](_0xe606('0x4b'),squel[_0xe606('0x4e')](hopperContacts))[_0xe606('0x42')](_0xe606('0x45')))[_0xe606('0x44')]();return _0x1af0ec;}return db[_0xe606('0x4f')][_0xe606('0x50')]({'where':{'type':'outbound'},'attributes':['id',_0xe606('0x51')],'include':[{'model':db['CmList'],'as':_0xe606('0x52'),'where':{'id':LISTID}}]})[_0xe606('0x2d')](function(_0x166233){var _0x1cc8a2=[];if(_0x166233){var _0x1aa907;for(var _0x2d310a=0x0,_0xdf43a0;_0x2d310a<_0x166233[_0xe606('0x28')];_0x2d310a+=0x1){_0xdf43a0=_0x166233[_0x2d310a][_0xe606('0x53')]({'plain':!![]});switch(_0xdf43a0[_0xe606('0x51')]){case _0xe606('0x54'):_0x1cc8a2[_0xe606('0x2e')](db[_0xe606('0x55')][_0xe606('0x56')](_0x21d631(_0xdf43a0,_0xe606('0x57')))[_0xe606('0x2d')](function(){})[_0xe606('0x30')](_0x13a990()));break;case _0xe606('0x58'):_0x1cc8a2[_0xe606('0x2e')](db['sequelize'][_0xe606('0x56')](_0x36f917(_0xdf43a0,'VoiceQueueId'))[_0xe606('0x2d')](function(){})[_0xe606('0x30')](_0x13a990()));break;default:_0x1cc8a2[_0xe606('0x2e')](db[_0xe606('0x55')][_0xe606('0x56')](_0x18e94e(_0xdf43a0,_0xe606('0x57')))[_0xe606('0x2d')](function(){})[_0xe606('0x30')](_0x13a990()));}}}return _0x1cc8a2;})['all']()[_0xe606('0x2d')](function(){return db[_0xe606('0x4f')][_0xe606('0x50')]({'where':{'type':_0xe606('0x59')},'attributes':['id'],'include':[{'model':db[_0xe606('0x5a')],'as':_0xe606('0x5b'),'where':{'id':LISTID}}]})[_0xe606('0x2d')](function(_0x5d41bc){var _0x46d779=[];if(_0x5d41bc){var _0x47772c;for(var _0x2a988a=0x0,_0x4e9c1e;_0x2a988a<_0x5d41bc['length'];_0x2a988a+=0x1){_0x4e9c1e=_0x5d41bc[_0x2a988a]['get']({'plain':!![]});_0x46d779[_0xe606('0x2e')](db[_0xe606('0x55')]['query'](_0x2ab72a(_0x4e9c1e,_0xe606('0x57')))[_0xe606('0x2d')](function(){})[_0xe606('0x30')](_0x13a990()));}}return _0x46d779;})[_0xe606('0x5c')]();})['then'](function(){return db[_0xe606('0x5d')][_0xe606('0x50')]({'attributes':['id',_0xe606('0x51')],'include':[{'model':db[_0xe606('0x5a')],'as':'Lists','where':{'id':LISTID}}]})[_0xe606('0x2d')](function(_0x55822c){var _0x515e96=[];if(_0x55822c){for(var _0x133fff=0x0,_0x50c0b4;_0x133fff<_0x55822c[_0xe606('0x28')];_0x133fff+=0x1){_0x50c0b4=_0x55822c[_0x133fff][_0xe606('0x53')]({'plain':!![]});switch(_0x50c0b4[_0xe606('0x51')]){case _0xe606('0x54'):_0x515e96['push'](db[_0xe606('0x55')]['query'](_0x21d631(_0x50c0b4,'CampaignId'))[_0xe606('0x2d')](function(){})[_0xe606('0x30')](_0x13a990()));break;case _0xe606('0x58'):_0x515e96['push'](db[_0xe606('0x55')]['query'](_0x36f917(_0x50c0b4,_0xe606('0x5e')))[_0xe606('0x2d')](function(){})[_0xe606('0x30')](_0x13a990()));break;default:_0x515e96['push'](db[_0xe606('0x55')][_0xe606('0x56')](_0x18e94e(_0x50c0b4,_0xe606('0x5e')))[_0xe606('0x2d')](function(){})[_0xe606('0x30')](_0x13a990()));}}}return _0x515e96;})['all']();})['then'](function(){return db[_0xe606('0x5d')][_0xe606('0x50')]({'attributes':['id'],'include':[{'model':db[_0xe606('0x5a')],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0x1357b7){var _0x5359aa=[];if(_0x1357b7){for(var _0x23e6b3=0x0,_0x2118cf;_0x23e6b3<_0x1357b7['length'];_0x23e6b3+=0x1){_0x2118cf=_0x1357b7[_0x23e6b3]['get']({'plain':!![]});_0x5359aa[_0xe606('0x2e')](db[_0xe606('0x55')][_0xe606('0x56')](_0x2ab72a(_0x2118cf,_0xe606('0x5e')))['then'](function(){})[_0xe606('0x30')](_0x13a990()));}}return _0x5359aa;})[_0xe606('0x5c')]();})[_0xe606('0x30')](function(_0x20d893){logger[_0xe606('0x16')](_0xe606('0x5f'),_0xe606('0x60'),_0x20d893[_0xe606('0x1c')]);});}var processPromises=function(_0x5be3bd){return BPromise[_0xe606('0x5c')](promises)[_0xe606('0x2d')](function(_0x391190){})[_0xe606('0x30')](function(_0x569203){logger[_0xe606('0x16')](_0xe606('0x61'),JSON[_0xe606('0x32')](_0x569203));})['finally'](function(){socket[_0xe606('0x62')](_0xe606('0x63')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5be3bd){return _0x5be3bd['resume']();}});};var endCsv=function(){return BPromise['resolve']()['then'](function(){if(hopperContacts){return checkHopper();}})[_0xe606('0x2d')](function(){socket['emit'](_0xe606('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x37e0df){logger['error'](_0xe606('0x64'),JSON[_0xe606('0x32')](_0x37e0df));}finally{process[_0xe606('0x65')](0x0);}});};process['on']('SIGINT',function(){logger['info'](_0xe606('0x66'));endCsv();});function main(){return BPromise['resolve']()[_0xe606('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xe606('0x13')](',');return db['CmContact'][_0xe606('0x50')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xe606('0x2d')](function(_0x26f938){var _0x37cde6=fs[_0xe606('0x67')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x37cde6,{'header':!![],'skipEmptyLines':!![],'step':function(_0x3a01e6,_0x19abcc){total+=0x1;var _0x4e37ae=total;promises[_0xe606('0x2e')](checkRow(_0x3a01e6,_0x26f938,_0x4e37ae)['then'](function(){success+=0x1;})[_0xe606('0x30')](function(_0x590e7b){if(_0x590e7b[_0xe606('0x16')]){errors+=0x1;delete _0x590e7b[_0xe606('0x16')];}else if(_0x590e7b[_0xe606('0x2a')]){duplicates+=0x1;delete _0x590e7b[_0xe606('0x2a')];}rows[_0xe606('0x2e')](_0x590e7b);}));if(total%0xc8===0x0){_0x19abcc['pause']();return processPromises(_0x19abcc);}},'complete':function(){return processPromises()[_0xe606('0x2d')](function(){logger[_0xe606('0x68')](_0xe606('0x69'));endCsv();});},'error':function(_0x526eea,_0x5a249a){logger[_0xe606('0x68')](_0xe606('0x6a'),JSON[_0xe606('0x32')](_0x526eea));endCsv();}});})[_0xe606('0x30')](function(_0x15e75d){logger[_0xe606('0x16')](_0xe606('0x6b'),JSON[_0xe606('0x32')](_0x15e75d));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 2023980..7f700e5 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 _0x5eca=['bluebird','squel','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','format','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.id','cm_contacts.createdAt','cm_hopper_black','ListId','cm_contacts','\x20=\x20?','concat','CompanyId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','push','code','sequelize','query','spread','main','stringify','send','start','binding','root','server/files/tmp','.csv','keys','parse','createReadStream','data','length','rows','errors','hasOwnProperty','trim','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','email','dateOfBirth','YYYY-MM-DD','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','abort','SystemError','step','duplicates','cm_contacts_','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','campaigns_has_cm_lists','CampaignId','campaigns_has_cm_blacklists','campaigns','then','finish','affectedRows','unlink','exit','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x5eca,0x10e));var _0xa5ec=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x5eca[_0x4b369d];return _0x571a98;};'use strict';var fs=require('fs');var path=require(_0xa5ec('0x0'));var _=require(_0xa5ec('0x1'));var Papa=require(_0xa5ec('0x2'));var util=require(_0xa5ec('0x3'));var BPromise=require(_0xa5ec('0x4'));var moment=require('moment');var squel=require(_0xa5ec('0x5'));var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require(_0xa5ec('0x6'));var logger=require(_0xa5ec('0x7'))(_0xa5ec('0x8'));config[_0xa5ec('0x9')]=_[_0xa5ec('0xa')](config[_0xa5ec('0x9')],{'host':_0xa5ec('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa5ec('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xa5ec('0xc')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0xf7dec8){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'](_0xf7dec8);}function selectNotIn(_0x6fd3f,_0x26bb2c,_0x414d21,_0x4f94e8,_0x266c43){return squel[_0xa5ec('0xd')]()[_0xa5ec('0xe')](_0xa5ec('0xf'))[_0xa5ec('0x10')](_0x4f94e8)[_0xa5ec('0x11')](_0x26bb2c,null,_0x26bb2c+_0xa5ec('0x12')+_0x4f94e8+'.'+_0x414d21)[_0xa5ec('0x13')](_0x4f94e8+'.'+_0x414d21+_0xa5ec('0x14')+_0x6fd3f+'.'+_0x414d21)[_0xa5ec('0x13')](_0x26bb2c+_0xa5ec('0x15')+_0x266c43[_0xa5ec('0x11')]()+')');}function insertCmHopper(_0x41a861,_0x58c1d7,_0x21c65a,_0x241d2b,_0x3d6801){var _0x2432b8=[_0xa5ec('0x16'),_0xa5ec('0x17'),'cm_contacts.id',_0xa5ec('0x18'),_0x58c1d7+'.'+_0x241d2b,'cm_contacts.createdAt',_0xa5ec('0x19'),_0xa5ec('0x1a'),_0xa5ec('0x1b'),'\x22'+_0x3d6801+'\x22'];return squel[_0xa5ec('0x1c')]()[_0xa5ec('0x1d')](_0xa5ec('0x1e'))[_0xa5ec('0x1f')]([_0xa5ec('0xf'),_0xa5ec('0x20'),_0xa5ec('0x21'),'ListId',_0x241d2b,_0xa5ec('0x22'),_0xa5ec('0x23'),_0xa5ec('0x24'),_0xa5ec('0x25'),_0xa5ec('0x26')],squel[_0xa5ec('0xd')]()[_0xa5ec('0x27')](_0x2432b8)[_0xa5ec('0x10')](_0x58c1d7)[_0xa5ec('0x11')]('cm_contacts',null,_0xa5ec('0x28')+_0x58c1d7+_0xa5ec('0x29'))[_0xa5ec('0x11')](_0x21c65a,null,_0x21c65a+_0xa5ec('0x12')+_0x58c1d7+'.'+_0x241d2b)[_0xa5ec('0x13')](_0x58c1d7+_0xa5ec('0x2a'),_0x41a861)[_0xa5ec('0x13')](_0xa5ec('0x2b'),NOW)[_0xa5ec('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x58c1d7,_0x21c65a,_0x241d2b,'cm_hopper',[_0xa5ec('0x2c'),'\x22onlyIfOpen\x22']))[_0xa5ec('0x13')](_0xa5ec('0x2d'),selectNotIn(_0x58c1d7,_0x21c65a,_0x241d2b,'cm_hopper',[_0xa5ec('0x2c')])))[_0xa5ec('0x2e')]();}function insertCmHopperBlack(_0x4ff18c,_0x4643aa,_0x12bfbb,_0x59b076){var _0x3d7f55=['cm_contacts.phone',_0xa5ec('0x2f'),_0xa5ec('0x18'),_0x4643aa+'.'+_0x59b076,_0xa5ec('0x30'),_0xa5ec('0x19')];return squel[_0xa5ec('0x1c')]()[_0xa5ec('0x1d')](_0xa5ec('0x31'))[_0xa5ec('0x1f')]([_0xa5ec('0xf'),_0xa5ec('0x21'),_0xa5ec('0x32'),_0x59b076,'createdAt','updatedAt'],squel[_0xa5ec('0xd')]()[_0xa5ec('0x27')](_0x3d7f55)[_0xa5ec('0x10')](_0x4643aa)[_0xa5ec('0x11')](_0xa5ec('0x33'),null,_0xa5ec('0x28')+_0x4643aa+'.CmListId')[_0xa5ec('0x11')](_0x12bfbb,null,_0x12bfbb+_0xa5ec('0x12')+_0x4643aa+'.'+_0x59b076)['where'](_0x4643aa+_0xa5ec('0x2a'),_0x4ff18c)[_0xa5ec('0x13')](_0xa5ec('0x2b'),NOW)[_0xa5ec('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xa5ec('0xd')]()[_0xa5ec('0xe')](_0xa5ec('0xf'))[_0xa5ec('0x10')]('cm_hopper_black')[_0xa5ec('0x13')]('ListId\x20=\x20?',_0x4ff18c)[_0xa5ec('0x13')](_0x59b076+_0xa5ec('0x34'),_0x4643aa+'.'+_0x59b076)))['toString']();}function insertCmContact(_0x49dda9,_0x121e6d,_0x2e1b44,_0x142959){var _0x21e4f6=_[_0xa5ec('0x35')](_['keys'](_0x142959),[_0xa5ec('0x32'),_0xa5ec('0x36'),_0xa5ec('0x22'),_0xa5ec('0x23')]);return squel[_0xa5ec('0x1c')]()[_0xa5ec('0x1d')]('cm_contacts')[_0xa5ec('0x1f')](_0x21e4f6,squel['select']()[_0xa5ec('0x27')](_0x21e4f6)[_0xa5ec('0x10')](_0x121e6d)[_0xa5ec('0x13')]('('+_0x2e1b44[_0xa5ec('0x11')](',')+_0xa5ec('0x37'),squel['select']()[_0xa5ec('0x27')](_0x2e1b44)[_0xa5ec('0x10')](_0xa5ec('0x33'))[_0xa5ec('0x13')](_0xa5ec('0x38'),_0x49dda9)[_0xa5ec('0x13')](_0xa5ec('0x39')))['where'](_0xa5ec('0x3a'),squel[_0xa5ec('0xd')]()['field'](_0xa5ec('0x3b'),_0xa5ec('0x3c'))[_0xa5ec('0x10')](_0x121e6d)[_0xa5ec('0x3d')](_0x2e1b44[_0xa5ec('0x11')](','))))[_0xa5ec('0x2e')]();}function handleStop(){logger[_0xa5ec('0x3e')](_0xa5ec('0x3f'));stopped=!![];}function handleUncaughtException(_0x3d2a3c){logger[_0xa5ec('0x40')](_0x3d2a3c[_0xa5ec('0x41')]);process['exit'](0x1);}function handleError(_0x59d8d8,_0x5e05b2){stats['errors'][_0xa5ec('0x42')]({'name':_0x5e05b2[_0xa5ec('0x43')],'message':_0x5e05b2[_0xa5ec('0x41')],'row':_0x59d8d8});}function handleQuery(_0x1ac7c4){logger[_0xa5ec('0x3e')](_0x1ac7c4);return db[_0xa5ec('0x44')][_0xa5ec('0x45')](_0x1ac7c4)[_0xa5ec('0x46')](function(_0x56dfa4){results[_0xa5ec('0x42')](_0x56dfa4);})['catch'](function(_0x79e3dd){logger[_0xa5ec('0x40')](_0x79e3dd['message']);});}function main(_0x4e6a16,_0x9dc0be,_0x177d57,_0x42c9cf){logger[_0xa5ec('0x3e')](_0xa5ec('0x47'),_0x4e6a16,JSON[_0xa5ec('0x48')](_0x9dc0be));process[_0xa5ec('0x49')](_0xa5ec('0x4a'));var _0x2e1144=_0x9dc0be[_0xa5ec('0x4b')];var _0x55bd6c=_0x9dc0be['socket_timestamp'];var _0x2de9cc=path[_0xa5ec('0x11')](config[_0xa5ec('0x4c')],_0xa5ec('0x4d'),_0x55bd6c+_0xa5ec('0x4e'));var _0x136324=_[_0xa5ec('0x4f')](_0x2e1144)['join']();logger[_0xa5ec('0x3e')]('header',_0x136324);fs['writeFileSync'](_0x2de9cc,_0x136324+'\x0a');Papa[_0xa5ec('0x50')](fs[_0xa5ec('0x51')](_0x4e6a16),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1c5e4d,_0x4da390){try{for(var _0x3f5e4b=0x0,_0x55c3c7=[];_0x3f5e4b<_0x1c5e4d[_0xa5ec('0x52')][_0xa5ec('0x53')];_0x3f5e4b++){stats[_0xa5ec('0x54')]+=0x1;if(_0x1c5e4d[_0xa5ec('0x55')][_0x3f5e4b]){handleError(_0x1c5e4d[_0xa5ec('0x52')][_0x3f5e4b],_0x1c5e4d[_0xa5ec('0x55')][_0x3f5e4b]);}else{var _0x51488c=[];for(var _0x485f07 in _0x2e1144){if(_0x2e1144[_0xa5ec('0x56')](_0x485f07)){if(_0x1c5e4d['data'][_0x3f5e4b][_0x2e1144[_0x485f07]]){var _0x17f08a=_[_0xa5ec('0x57')](_0x1c5e4d['data'][_0x3f5e4b][_0x2e1144[_0x485f07]]['replace'](/"/g,'\x27'));switch(_0x485f07){case _0xa5ec('0x20'):var _0x1ce39b=moment(_0x17f08a,_0xa5ec('0x58'),!![]);if(_0x1ce39b[_0xa5ec('0x59')]()){_0x55c3c7['push']('\x22'+_0x17f08a+'\x22');}else{_0x51488c['push'](_0xa5ec('0x5a'));}break;case _0xa5ec('0x24'):var _0x185bea=parseInt(_0x17f08a);_0x17f08a=_[_0xa5ec('0x5b')](_0x185bea)||_0x185bea<0x0||_0x185bea>0x4?_0x42c9cf?0x3:0x2:_0x185bea;_0x55c3c7[_0xa5ec('0x42')]('\x22'+_0x17f08a+'\x22');break;case _0xa5ec('0x25'):var _0x10fddc=parseInt(_0x17f08a);if(_[_0xa5ec('0x5c')](_0x10fddc)&&_[_0xa5ec('0x5d')](_0x177d57,_0x10fddc)){_0x55c3c7[_0xa5ec('0x42')]('\x22'+_0x10fddc+'\x22');}else{_0x51488c[_0xa5ec('0x42')]('agent\x20not\x20exists');}break;case _0xa5ec('0x5e'):if(isEmail(_0x17f08a)){_0x55c3c7[_0xa5ec('0x42')]('\x22'+_0x17f08a+'\x22');}else{_0x51488c['push']('email\x20wrong\x20format');}break;case _0xa5ec('0x5f'):var _0x4cddc3=moment(_0x17f08a,_0xa5ec('0x60'),!![]);if(_0x4cddc3[_0xa5ec('0x59')]()){_0x55c3c7[_0xa5ec('0x42')]('\x22'+_0x17f08a+'\x22');}else{_0x51488c['push']('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x55c3c7['push']('\x22'+_0x17f08a+'\x22');}}else{switch(_0x485f07){case _0xa5ec('0x61'):case'phone':_0x51488c['push'](_0x485f07+_0xa5ec('0x62'));break;default:_0x55c3c7[_0xa5ec('0x42')]('\x22\x22');}}}}if(_0x51488c[_0xa5ec('0x53')]){handleError(_0x1c5e4d[_0xa5ec('0x52')][_0x3f5e4b],{'code':_0xa5ec('0x63'),'message':_0x51488c[_0xa5ec('0x11')]()});}else{fs[_0xa5ec('0x64')](_0x2de9cc,_0x55c3c7[_0xa5ec('0x11')]()+'\x0a');}_0x55c3c7=[];}if(!(stats[_0xa5ec('0x54')]%0xc8)){socket[_0xa5ec('0x65')](_0xa5ec('0x66')+_0x55bd6c,stats);stats[_0xa5ec('0x55')]=[];}}if(stopped){logger[_0xa5ec('0x3e')]('Abort\x20parser');_0x4da390[_0xa5ec('0x67')]();}}catch(_0x2f0bc7){handleError(_0x1c5e4d[_0xa5ec('0x52')][_0x3f5e4b],{'code':_0xa5ec('0x68'),'message':_0x2f0bc7['message']});logger[_0xa5ec('0x40')](_0xa5ec('0x69'),_0x2f0bc7[_0xa5ec('0x41')]);}},'complete':function(){try{var _0x537c22=[];var _0x1da76c=_0xa5ec('0x33');if(_0x9dc0be[_0xa5ec('0x6a')]&&_0x9dc0be[_0xa5ec('0x6a')][_0xa5ec('0x53')]){_0x1da76c=_0xa5ec('0x6b')+_0x55bd6c;_0x537c22['push']('CREATE\x20TABLE\x20'+_0x1da76c+_0xa5ec('0x6c'));}var _0x4d82a0=util[_0xa5ec('0xc')](_0xa5ec('0x6d'),_0x2de9cc,_0x1da76c,_0x136324,_0x9dc0be['ListId'],_0x9dc0be[_0xa5ec('0x36')]||null,NOW,NOW);if(_[_0xa5ec('0x6e')](_0x2e1144[_0xa5ec('0x20')])){_0x4d82a0+=_0xa5ec('0x6f');}_0x537c22[_0xa5ec('0x42')](_0x4d82a0);if(_0x9dc0be[_0xa5ec('0x6a')]&&_0x9dc0be[_0xa5ec('0x6a')][_0xa5ec('0x53')]){_0x537c22[_0xa5ec('0x42')](insertCmContact(_0x9dc0be[_0xa5ec('0x32')],_0x1da76c,_0x9dc0be[_0xa5ec('0x6a')],_0x2e1144));_0x537c22[_0xa5ec('0x42')]('DROP\x20TABLE\x20'+_0x1da76c+';');}_0x537c22[_0xa5ec('0x42')](insertCmHopper(_0x9dc0be[_0xa5ec('0x32')],_0xa5ec('0x70'),_0xa5ec('0x71'),'VoiceQueueId',_0x42c9cf));_0x537c22['push'](insertCmHopperBlack(_0x9dc0be[_0xa5ec('0x32')],'voice_queues_has_cm_blacklists',_0xa5ec('0x71'),_0xa5ec('0x72')));_0x537c22[_0xa5ec('0x42')](insertCmHopper(_0x9dc0be[_0xa5ec('0x32')],_0xa5ec('0x73'),'campaigns',_0xa5ec('0x74'),_0x42c9cf));_0x537c22[_0xa5ec('0x42')](insertCmHopperBlack(_0x9dc0be['ListId'],_0xa5ec('0x75'),_0xa5ec('0x76'),_0xa5ec('0x74')));BPromise['each'](_0x537c22,handleQuery)[_0xa5ec('0x77')](function(_0x1f08cd){stats[_0xa5ec('0x78')]=!![];stats['affectedRows']=_0x9dc0be[_0xa5ec('0x6a')]&&_0x9dc0be[_0xa5ec('0x6a')]['length']?results[0x2][_0xa5ec('0x79')]:results[0x0][_0xa5ec('0x79')];socket[_0xa5ec('0x65')](_0xa5ec('0x66')+_0x55bd6c,stats);fs[_0xa5ec('0x7a')](_0x4e6a16);fs[_0xa5ec('0x7a')](_0x2de9cc);process[_0xa5ec('0x7b')](0x0);})['catch'](function(_0x4e880d){logger['error'](_0x4e880d['message']);process[_0xa5ec('0x7b')](0x1);});}catch(_0x1c78de){logger['error'](_0xa5ec('0x7c'),_0x1c78de[_0xa5ec('0x41')]);process[_0xa5ec('0x7b')](0x1);}},'error':function(_0x37b500,_0x2bf398,_0x104ed4,_0x45685d){throw new Error(_0x45685d);}});}function validate(){if(process[_0xa5ec('0x7d')]&&process[_0xa5ec('0x7d')]['length']<0x4){throw new Error(_0xa5ec('0x7e'));}var _0x205b22=path[_0xa5ec('0x11')](config[_0xa5ec('0x4c')],_0xa5ec('0x4d'),process['argv'][0x2]);if(!fs[_0xa5ec('0x7f')](_0x205b22)){throw new Error(_0xa5ec('0x80'));}var _0x1135e9={};try{_0x1135e9=JSON[_0xa5ec('0x50')](process[_0xa5ec('0x7d')][0x3]);if(!_0x1135e9[_0xa5ec('0x4b')]){throw new Error(_0xa5ec('0x81'));}if(!_0x1135e9[_0xa5ec('0x4b')][_0xa5ec('0xf')]){throw new Error(_0xa5ec('0x82'));}if(!_0x1135e9[_0xa5ec('0x4b')]['firstName']){throw new Error(_0xa5ec('0x83'));}var _0x5e6db5=0x0;if(_0x1135e9['binding'][_0xa5ec('0x25')]){_0x5e6db5=0x1;}if(!_0x1135e9['ListId']){throw new Error(_0xa5ec('0x84'));}}catch(_0x179cd4){throw new Error(_0xa5ec('0x85'));}var _0x38e6ad=[];try{_0x38e6ad=_['map'](JSON[_0xa5ec('0x50')](process[_0xa5ec('0x7d')][0x4]),'id');}catch(_0x29771d){logger['info'](_0xa5ec('0x86'));}main(_0x205b22,_0x1135e9,_0x38e6ad,_0x5e6db5);}validate();process['on'](_0xa5ec('0x87'),handleStop);process['on'](_0xa5ec('0x88'),handleUncaughtException); \ No newline at end of file +var _0x4128=['binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','../../../mysqldb','../../../config/logger','import','defaults','socket.io-emitter','redis','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','toString','cm_contacts.phone','cm_hopper_black','join','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','concat',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','MIN(id)','info','Received\x20SIGINT','error','message','errors','push','code','sequelize','spread','catch','main','stringify','start','binding','socket_timestamp','server/files/tmp','.csv','keys','header','writeFileSync','parse','createReadStream','rows','data','hasOwnProperty','trim','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','firstName','\x20not\x20specified','length','SystemRow','appendFileSync','contact:import:','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId','isNil',',\x20scheduledAt\x20=\x20NOW()','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns_has_cm_blacklists','campaigns','CampaignId','each','then','finish','emit','unlink','exit','complete','arguments\x20\x20\x20','root','argv','existsSync','file\x20doesn\x27t\x20exists'];(function(_0x2f5b91,_0x40f255){var _0x2fa9b2=function(_0x3f94d4){while(--_0x3f94d4){_0x2f5b91['push'](_0x2f5b91['shift']());}};_0x2fa9b2(++_0x40f255);}(_0x4128,0x1a5));var _0x8412=function(_0x1a6de3,_0x583ebd){_0x1a6de3=_0x1a6de3-0x0;var _0x220273=_0x4128[_0x1a6de3];return _0x220273;};'use strict';var fs=require('fs');var path=require(_0x8412('0x0'));var _=require(_0x8412('0x1'));var Papa=require(_0x8412('0x2'));var util=require(_0x8412('0x3'));var BPromise=require(_0x8412('0x4'));var moment=require(_0x8412('0x5'));var squel=require(_0x8412('0x6'));var Redis=require('ioredis');var db=require(_0x8412('0x7'))['db'];var config=require('../../../config/environment');var logger=require(_0x8412('0x8'))(_0x8412('0x9'));config['redis']=_[_0x8412('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8412('0xb'))(new Redis(config[_0x8412('0xc')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x8412('0xd')](_0x8412('0xe'));function isEmail(_0x51dbb0){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))*$/[_0x8412('0xf')](_0x51dbb0);}function selectNotIn(_0x26e754,_0x3e2d9a,_0xc05c,_0x1a3701,_0x52c16b){return squel[_0x8412('0x10')]()[_0x8412('0x11')](_0x8412('0x12'))[_0x8412('0x13')](_0x1a3701)['join'](_0x3e2d9a,null,_0x3e2d9a+'.id\x20=\x20'+_0x1a3701+'.'+_0xc05c)[_0x8412('0x14')](_0x1a3701+'.'+_0xc05c+_0x8412('0x15')+_0x26e754+'.'+_0xc05c)[_0x8412('0x14')](_0x3e2d9a+_0x8412('0x16')+_0x52c16b['join']()+')');}function insertCmHopper(_0x3d7721,_0x4b6a0c,_0x124532,_0x1ff35f,_0x22c5bf){var _0x5e7021=['cm_contacts.phone',_0x8412('0x17'),_0x8412('0x18'),_0x8412('0x19'),_0x4b6a0c+'.'+_0x1ff35f,'cm_contacts.createdAt',_0x8412('0x1a'),_0x8412('0x1b'),_0x8412('0x1c'),'\x22'+_0x22c5bf+'\x22'];return squel[_0x8412('0x1d')]()[_0x8412('0x1e')]('cm_hopper')[_0x8412('0x1f')](['phone',_0x8412('0x20'),_0x8412('0x21'),_0x8412('0x22'),_0x1ff35f,_0x8412('0x23'),_0x8412('0x24'),_0x8412('0x25'),_0x8412('0x26'),_0x8412('0x27')],squel[_0x8412('0x10')]()[_0x8412('0x28')](_0x5e7021)['from'](_0x4b6a0c)['join'](_0x8412('0x29'),null,_0x8412('0x2a')+_0x4b6a0c+'.CmListId')['join'](_0x124532,null,_0x124532+'.id\x20=\x20'+_0x4b6a0c+'.'+_0x1ff35f)[_0x8412('0x14')](_0x4b6a0c+'.CmListId\x20=\x20?',_0x3d7721)[_0x8412('0x14')](_0x8412('0x2b'),NOW)['where'](_0x8412('0x2c'),selectNotIn(_0x4b6a0c,_0x124532,_0x1ff35f,_0x8412('0x2d'),[_0x8412('0x2e'),'\x22onlyIfOpen\x22']))['where'](_0x8412('0x2c'),selectNotIn(_0x4b6a0c,_0x124532,_0x1ff35f,_0x8412('0x2d'),[_0x8412('0x2e')])))[_0x8412('0x2f')]();}function insertCmHopperBlack(_0x5d0696,_0x28a117,_0x2d32cf,_0x52ef89){var _0x59a5e2=[_0x8412('0x30'),_0x8412('0x18'),'cm_contacts.ListId',_0x28a117+'.'+_0x52ef89,'cm_contacts.createdAt',_0x8412('0x1a')];return squel[_0x8412('0x1d')]()[_0x8412('0x1e')](_0x8412('0x31'))[_0x8412('0x1f')]([_0x8412('0x12'),_0x8412('0x21'),_0x8412('0x22'),_0x52ef89,'createdAt',_0x8412('0x24')],squel['select']()[_0x8412('0x28')](_0x59a5e2)[_0x8412('0x13')](_0x28a117)[_0x8412('0x32')](_0x8412('0x29'),null,_0x8412('0x2a')+_0x28a117+_0x8412('0x33'))[_0x8412('0x32')](_0x2d32cf,null,_0x2d32cf+_0x8412('0x34')+_0x28a117+'.'+_0x52ef89)[_0x8412('0x14')](_0x28a117+_0x8412('0x35'),_0x5d0696)[_0x8412('0x14')](_0x8412('0x2b'),NOW)[_0x8412('0x14')](_0x8412('0x2c'),squel[_0x8412('0x10')]()[_0x8412('0x11')]('phone')[_0x8412('0x13')]('cm_hopper_black')[_0x8412('0x14')](_0x8412('0x36'),_0x5d0696)['where'](_0x52ef89+_0x8412('0x37'),_0x28a117+'.'+_0x52ef89)))[_0x8412('0x2f')]();}function insertCmContact(_0x5a6c5e,_0x4cf94e,_0x1145f7,_0x18a24b){var _0x141b9e=_[_0x8412('0x38')](_['keys'](_0x18a24b),[_0x8412('0x22'),'CompanyId',_0x8412('0x23'),'updatedAt']);return squel['insert']()[_0x8412('0x1e')]('cm_contacts')[_0x8412('0x1f')](_0x141b9e,squel[_0x8412('0x10')]()[_0x8412('0x28')](_0x141b9e)[_0x8412('0x13')](_0x4cf94e)['where']('('+_0x1145f7[_0x8412('0x32')](',')+_0x8412('0x39'),squel[_0x8412('0x10')]()[_0x8412('0x28')](_0x1145f7)['from']('cm_contacts')[_0x8412('0x14')](_0x8412('0x36'),_0x5a6c5e)[_0x8412('0x14')](_0x8412('0x3a')))[_0x8412('0x14')]('id\x20IN\x20?',squel[_0x8412('0x10')]()[_0x8412('0x11')](_0x8412('0x3b'),'min_id')['from'](_0x4cf94e)['group'](_0x1145f7['join'](','))))[_0x8412('0x2f')]();}function handleStop(){logger[_0x8412('0x3c')](_0x8412('0x3d'));stopped=!![];}function handleUncaughtException(_0x1ff175){logger[_0x8412('0x3e')](_0x1ff175[_0x8412('0x3f')]);process['exit'](0x1);}function handleError(_0x5a8d4f,_0x32a131){stats[_0x8412('0x40')][_0x8412('0x41')]({'name':_0x32a131[_0x8412('0x42')],'message':_0x32a131[_0x8412('0x3f')],'row':_0x5a8d4f});}function handleQuery(_0x3a8649){logger[_0x8412('0x3c')](_0x3a8649);return db[_0x8412('0x43')]['query'](_0x3a8649)[_0x8412('0x44')](function(_0x22febb){results[_0x8412('0x41')](_0x22febb);})[_0x8412('0x45')](function(_0x112614){logger['error'](_0x112614[_0x8412('0x3f')]);});}function main(_0x54e1ba,_0x26c1f3,_0x338bfd,_0x311fe7){logger[_0x8412('0x3c')](_0x8412('0x46'),_0x54e1ba,JSON[_0x8412('0x47')](_0x26c1f3));process['send'](_0x8412('0x48'));var _0x3c96ee=_0x26c1f3[_0x8412('0x49')];var _0x10728c=_0x26c1f3[_0x8412('0x4a')];var _0x1b7122=path[_0x8412('0x32')](config['root'],_0x8412('0x4b'),_0x10728c+_0x8412('0x4c'));var _0x11e3ae=_[_0x8412('0x4d')](_0x3c96ee)[_0x8412('0x32')]();logger['info'](_0x8412('0x4e'),_0x11e3ae);fs[_0x8412('0x4f')](_0x1b7122,_0x11e3ae+'\x0a');Papa[_0x8412('0x50')](fs[_0x8412('0x51')](_0x54e1ba),{'header':!![],'skipEmptyLines':!![],'step':function(_0x10f62b,_0x209594){try{for(var _0x4e7de4=0x0,_0x46bb5e=[];_0x4e7de4<_0x10f62b['data']['length'];_0x4e7de4++){stats[_0x8412('0x52')]+=0x1;if(_0x10f62b[_0x8412('0x40')][_0x4e7de4]){handleError(_0x10f62b[_0x8412('0x53')][_0x4e7de4],_0x10f62b[_0x8412('0x40')][_0x4e7de4]);}else{var _0x243e42=[];for(var _0x3ec581 in _0x3c96ee){if(_0x3c96ee[_0x8412('0x54')](_0x3ec581)){if(_0x10f62b[_0x8412('0x53')][_0x4e7de4][_0x3c96ee[_0x3ec581]]){var _0x2874a3=_[_0x8412('0x55')](_0x10f62b['data'][_0x4e7de4][_0x3c96ee[_0x3ec581]]['replace'](/"/g,'\x27'));switch(_0x3ec581){case _0x8412('0x20'):var _0x5be7c3=moment(_0x2874a3,_0x8412('0xe'),!![]);if(_0x5be7c3[_0x8412('0x56')]()){_0x46bb5e[_0x8412('0x41')]('\x22'+_0x2874a3+'\x22');}else{_0x243e42[_0x8412('0x41')](_0x8412('0x57'));}break;case _0x8412('0x25'):var _0x4878c6=parseInt(_0x2874a3);_0x2874a3=_[_0x8412('0x58')](_0x4878c6)||_0x4878c6<0x0||_0x4878c6>0x4?_0x311fe7?0x3:0x2:_0x4878c6;_0x46bb5e[_0x8412('0x41')]('\x22'+_0x2874a3+'\x22');break;case _0x8412('0x26'):var _0x4e4a18=parseInt(_0x2874a3);if(_[_0x8412('0x59')](_0x4e4a18)&&_['includes'](_0x338bfd,_0x4e4a18)){_0x46bb5e[_0x8412('0x41')]('\x22'+_0x4e4a18+'\x22');}else{_0x243e42[_0x8412('0x41')](_0x8412('0x5a'));}break;case _0x8412('0x5b'):if(isEmail(_0x2874a3)){_0x46bb5e[_0x8412('0x41')]('\x22'+_0x2874a3+'\x22');}else{_0x243e42[_0x8412('0x41')](_0x8412('0x5c'));}break;case _0x8412('0x5d'):var _0x2a8228=moment(_0x2874a3,'YYYY-MM-DD',!![]);if(_0x2a8228['isValid']()){_0x46bb5e[_0x8412('0x41')]('\x22'+_0x2874a3+'\x22');}else{_0x243e42[_0x8412('0x41')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x46bb5e['push']('\x22'+_0x2874a3+'\x22');}}else{switch(_0x3ec581){case _0x8412('0x5e'):case _0x8412('0x12'):_0x243e42['push'](_0x3ec581+_0x8412('0x5f'));break;default:_0x46bb5e[_0x8412('0x41')]('\x22\x22');}}}}if(_0x243e42[_0x8412('0x60')]){handleError(_0x10f62b[_0x8412('0x53')][_0x4e7de4],{'code':_0x8412('0x61'),'message':_0x243e42['join']()});}else{fs[_0x8412('0x62')](_0x1b7122,_0x46bb5e[_0x8412('0x32')]()+'\x0a');}_0x46bb5e=[];}if(!(stats['rows']%0xc8)){socket['emit'](_0x8412('0x63')+_0x10728c,stats);stats[_0x8412('0x40')]=[];}}if(stopped){logger[_0x8412('0x3c')]('Abort\x20parser');_0x209594[_0x8412('0x64')]();}}catch(_0x193785){handleError(_0x10f62b[_0x8412('0x53')][_0x4e7de4],{'code':_0x8412('0x65'),'message':_0x193785['message']});logger['error'](_0x8412('0x66'),_0x193785['message']);}},'complete':function(){try{var _0x4e6316=[];var _0x3f8833='cm_contacts';if(_0x26c1f3[_0x8412('0x67')]&&_0x26c1f3['duplicates']['length']){_0x3f8833=_0x8412('0x68')+_0x10728c;_0x4e6316['push'](_0x8412('0x69')+_0x3f8833+_0x8412('0x6a'));}var _0x4d92b7=util[_0x8412('0xd')](_0x8412('0x6b'),_0x1b7122,_0x3f8833,_0x11e3ae,_0x26c1f3[_0x8412('0x22')],_0x26c1f3[_0x8412('0x6c')]||null,NOW,NOW);if(_[_0x8412('0x6d')](_0x3c96ee[_0x8412('0x20')])){_0x4d92b7+=_0x8412('0x6e');}_0x4e6316['push'](_0x4d92b7);if(_0x26c1f3['duplicates']&&_0x26c1f3['duplicates'][_0x8412('0x60')]){_0x4e6316['push'](insertCmContact(_0x26c1f3[_0x8412('0x22')],_0x3f8833,_0x26c1f3[_0x8412('0x67')],_0x3c96ee));_0x4e6316['push']('DROP\x20TABLE\x20'+_0x3f8833+';');}_0x4e6316[_0x8412('0x41')](insertCmHopper(_0x26c1f3[_0x8412('0x22')],_0x8412('0x6f'),_0x8412('0x70'),_0x8412('0x71'),_0x311fe7));_0x4e6316[_0x8412('0x41')](insertCmHopperBlack(_0x26c1f3[_0x8412('0x22')],_0x8412('0x72'),_0x8412('0x70'),_0x8412('0x71')));_0x4e6316[_0x8412('0x41')](insertCmHopper(_0x26c1f3[_0x8412('0x22')],_0x8412('0x73'),'campaigns','CampaignId',_0x311fe7));_0x4e6316['push'](insertCmHopperBlack(_0x26c1f3[_0x8412('0x22')],_0x8412('0x74'),_0x8412('0x75'),_0x8412('0x76')));BPromise[_0x8412('0x77')](_0x4e6316,handleQuery)[_0x8412('0x78')](function(_0x316bf1){stats[_0x8412('0x79')]=!![];stats['affectedRows']=_0x26c1f3[_0x8412('0x67')]&&_0x26c1f3[_0x8412('0x67')][_0x8412('0x60')]?results[0x2]['affectedRows']:results[0x0]['affectedRows'];socket[_0x8412('0x7a')](_0x8412('0x63')+_0x10728c,stats);fs[_0x8412('0x7b')](_0x54e1ba);fs[_0x8412('0x7b')](_0x1b7122);process[_0x8412('0x7c')](0x0);})[_0x8412('0x45')](function(_0x501ab3){logger[_0x8412('0x3e')](_0x501ab3[_0x8412('0x3f')]);process['exit'](0x1);});}catch(_0x565a19){logger[_0x8412('0x3e')](_0x8412('0x7d'),_0x565a19[_0x8412('0x3f')]);process[_0x8412('0x7c')](0x1);}},'error':function(_0xc28579,_0x16d272,_0x1f631f,_0x4e5bdb){throw new Error(_0x4e5bdb);}});}function validate(){if(process['argv']&&process['argv'][_0x8412('0x60')]<0x4){throw new Error(_0x8412('0x7e'));}var _0x1c0380=path['join'](config[_0x8412('0x7f')],_0x8412('0x4b'),process[_0x8412('0x80')][0x2]);if(!fs[_0x8412('0x81')](_0x1c0380)){throw new Error(_0x8412('0x82'));}var _0x4d1a5e={};try{_0x4d1a5e=JSON[_0x8412('0x50')](process[_0x8412('0x80')][0x3]);if(!_0x4d1a5e[_0x8412('0x49')]){throw new Error(_0x8412('0x83'));}if(!_0x4d1a5e[_0x8412('0x49')][_0x8412('0x12')]){throw new Error(_0x8412('0x84'));}if(!_0x4d1a5e[_0x8412('0x49')][_0x8412('0x5e')]){throw new Error('firstName\x20is\x20mandatory');}var _0x4867b8=0x0;if(_0x4d1a5e['binding'][_0x8412('0x26')]){_0x4867b8=0x1;}if(!_0x4d1a5e['ListId']){throw new Error(_0x8412('0x85'));}}catch(_0x5211f1){throw new Error('body\x20id\x20mandatory');}var _0x536b27=[];try{_0x536b27=_[_0x8412('0x86')](JSON[_0x8412('0x50')](process[_0x8412('0x80')][0x4]),'id');}catch(_0x3f7a45){logger[_0x8412('0x3c')](_0x8412('0x87'));}main(_0x1c0380,_0x4d1a5e,_0x536b27,_0x4867b8);}validate();process['on'](_0x8412('0x88'),handleStop);process['on'](_0x8412('0x89'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 99367f1..b53a445 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 _0x622b=['Billable\x20Time','getSubjects','[xCALLY\x20Ticket]','toLowerCase','inbound','push','variable','queue','calleridnum','outbound','string','Outbound\x20Call','voice','***\x20Call\x20Info\x20***','keyValue','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','agentcompleteAt','holdtime','destcalleridnum','Member\x20Name','UniqueId','Date','starttime','Answer\x20Time','Complete\x20Time','endtime','Duration'];(function(_0x2f3e03,_0x505530){var _0x5a0a1f=function(_0x3f344a){while(--_0x3f344a){_0x2f3e03['push'](_0x2f3e03['shift']());}};_0x5a0a1f(++_0x505530);}(_0x622b,0x141));var _0xb622=function(_0x591781,_0x8e0ed2){_0x591781=_0x591781-0x0;var _0x315bd9=_0x622b[_0x591781];return _0x315bd9;};'use strict';exports[_0xb622('0x0')]=function(_0x31574e,_0x23d136){var _0x18ea0a=[{'type':'string','content':_0xb622('0x1'),'variableName':null}];switch(_0x31574e['toLowerCase']()){case'voice':switch(_0x23d136[_0xb622('0x2')]()){case _0xb622('0x3'):_0x18ea0a[_0xb622('0x4')]({'type':_0xb622('0x5'),'content':'','variableName':_0xb622('0x6')});_0x18ea0a['push']({'type':_0xb622('0x5'),'content':'','variableName':_0xb622('0x7')});break;case _0xb622('0x8'):_0x18ea0a[_0xb622('0x4')]({'type':_0xb622('0x9'),'content':_0xb622('0xa'),'variableName':null});_0x18ea0a[_0xb622('0x4')]({'type':_0xb622('0x5'),'content':'','variableName':'destcalleridnum'});break;}}return _0x18ea0a;};exports['getDescriptions']=function(_0x58ccbc,_0xb1d7cc){var _0x4f6fb1=[];switch(_0x58ccbc[_0xb622('0x2')]()){case _0xb622('0xb'):switch(_0xb1d7cc[_0xb622('0x2')]()){case _0xb622('0x3'):_0x4f6fb1=[{'type':_0xb622('0x9'),'content':_0xb622('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0xb622('0xd'),'content':'','key':'Caller\x20Number','keyType':_0xb622('0x5'),'variableName':_0xb622('0x7')},{'type':_0xb622('0xd'),'content':'','key':_0xb622('0xe'),'keyType':_0xb622('0x5'),'variableName':_0xb622('0xf')},{'type':_0xb622('0xd'),'content':'','key':_0xb622('0x10'),'keyType':'variable','variableName':_0xb622('0x11')},{'type':_0xb622('0xd'),'content':'','key':_0xb622('0x12'),'keyType':'variable','variableName':_0xb622('0x6')},{'type':_0xb622('0xd'),'content':'','key':'UniqueId','keyType':_0xb622('0x5'),'variableName':'uniqueid'},{'type':'keyValue','content':'','key':'Date','keyType':'variable','variableName':_0xb622('0x13')},{'type':_0xb622('0x9'),'content':_0xb622('0x14'),'key':null,'keyType':null,'variableName':null},{'type':_0xb622('0xd'),'content':'','key':_0xb622('0x15'),'keyType':_0xb622('0x5'),'variableName':_0xb622('0x16')},{'type':_0xb622('0xd'),'content':'','key':_0xb622('0x17'),'keyType':_0xb622('0x5'),'variableName':'destcalleridnum'},{'type':_0xb622('0x9'),'content':_0xb622('0x18'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xb622('0x19'),'keyType':'variable','variableName':_0xb622('0x13')},{'type':_0xb622('0xd'),'content':'','key':_0xb622('0x1a'),'keyType':_0xb622('0x5'),'variableName':_0xb622('0x1b')},{'type':_0xb622('0xd'),'content':'','key':'Agent\x20Complete','keyType':'variable','variableName':_0xb622('0x1c')},{'type':_0xb622('0xd'),'content':'','key':'Hold\x20Time','keyType':_0xb622('0x5'),'variableName':_0xb622('0x1d')},{'type':'keyValue','content':'','key':'Talk\x20Time','keyType':'variable','variableName':'talktime'}];break;case _0xb622('0x8'):_0x4f6fb1=[{'type':'string','content':_0xb622('0xc'),'variableName':null},{'type':_0xb622('0xd'),'content':'','key':'Called\x20Number','keyType':_0xb622('0x5'),'keyContent':'','variableName':_0xb622('0x1e')},{'type':_0xb622('0xd'),'content':'','key':_0xb622('0x1f'),'keyType':_0xb622('0x5'),'keyContent':'','variableName':'membername'},{'type':'keyValue','content':'','key':_0xb622('0x20'),'keyType':_0xb622('0x5'),'keyContent':'','variableName':'uniqueid'},{'type':_0xb622('0xd'),'content':'','key':_0xb622('0x21'),'keyType':_0xb622('0x5'),'keyContent':'','variableName':_0xb622('0x22')},{'type':_0xb622('0x9'),'content':_0xb622('0x18')},{'type':_0xb622('0xd'),'content':'','key':_0xb622('0x23'),'keyType':_0xb622('0x5'),'keyContent':'','variableName':'answertime'},{'type':_0xb622('0xd'),'content':'','key':_0xb622('0x24'),'keyType':_0xb622('0x5'),'keyContent':'','variableName':_0xb622('0x25')},{'type':_0xb622('0xd'),'content':'','key':_0xb622('0x26'),'keyType':'variable','keyContent':'','variableName':'duration'},{'type':_0xb622('0xd'),'content':'','key':_0xb622('0x27'),'keyType':_0xb622('0x5'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x4f6fb1;}; \ No newline at end of file +var _0x2eb3=['Agent\x20Complete','agentcompleteAt','Hold\x20Time','Talk\x20Time','Called\x20Number','Member\x20Name','membername','starttime','Answer\x20Time','answertime','endtime','Duration','duration','Billable\x20Time','getSubjects','[xCALLY\x20Ticket]','toLowerCase','voice','push','variable','queue','calleridnum','outbound','string','Outbound\x20Call','destcalleridnum','getDescriptions','inbound','***\x20Call\x20Info\x20***','Caller\x20Number','keyValue','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt'];(function(_0x16bb4b,_0x5fe431){var _0x8aeb84=function(_0x36ba6e){while(--_0x36ba6e){_0x16bb4b['push'](_0x16bb4b['shift']());}};_0x8aeb84(++_0x5fe431);}(_0x2eb3,0x15e));var _0x32eb=function(_0x40490a,_0xc5de74){_0x40490a=_0x40490a-0x0;var _0x376ff0=_0x2eb3[_0x40490a];return _0x376ff0;};'use strict';exports[_0x32eb('0x0')]=function(_0x1e9b3f,_0x262897){var _0x542fcc=[{'type':'string','content':_0x32eb('0x1'),'variableName':null}];switch(_0x1e9b3f[_0x32eb('0x2')]()){case _0x32eb('0x3'):switch(_0x262897['toLowerCase']()){case'inbound':_0x542fcc[_0x32eb('0x4')]({'type':_0x32eb('0x5'),'content':'','variableName':_0x32eb('0x6')});_0x542fcc[_0x32eb('0x4')]({'type':_0x32eb('0x5'),'content':'','variableName':_0x32eb('0x7')});break;case _0x32eb('0x8'):_0x542fcc['push']({'type':_0x32eb('0x9'),'content':_0x32eb('0xa'),'variableName':null});_0x542fcc[_0x32eb('0x4')]({'type':_0x32eb('0x5'),'content':'','variableName':_0x32eb('0xb')});break;}}return _0x542fcc;};exports[_0x32eb('0xc')]=function(_0x12be92,_0xea4c9d){var _0x542679=[];switch(_0x12be92['toLowerCase']()){case _0x32eb('0x3'):switch(_0xea4c9d['toLowerCase']()){case _0x32eb('0xd'):_0x542679=[{'type':_0x32eb('0x9'),'content':_0x32eb('0xe'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x32eb('0xf'),'keyType':_0x32eb('0x5'),'variableName':_0x32eb('0x7')},{'type':_0x32eb('0x10'),'content':'','key':_0x32eb('0x11'),'keyType':_0x32eb('0x5'),'variableName':_0x32eb('0x12')},{'type':_0x32eb('0x10'),'content':'','key':_0x32eb('0x13'),'keyType':'variable','variableName':_0x32eb('0x14')},{'type':_0x32eb('0x10'),'content':'','key':_0x32eb('0x15'),'keyType':'variable','variableName':_0x32eb('0x6')},{'type':_0x32eb('0x10'),'content':'','key':_0x32eb('0x16'),'keyType':_0x32eb('0x5'),'variableName':_0x32eb('0x17')},{'type':_0x32eb('0x10'),'content':'','key':_0x32eb('0x18'),'keyType':'variable','variableName':_0x32eb('0x19')},{'type':_0x32eb('0x9'),'content':_0x32eb('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':_0x32eb('0x10'),'content':'','key':_0x32eb('0x1b'),'keyType':'variable','variableName':_0x32eb('0x1c')},{'type':_0x32eb('0x10'),'content':'','key':_0x32eb('0x1d'),'keyType':'variable','variableName':_0x32eb('0xb')},{'type':_0x32eb('0x9'),'content':_0x32eb('0x1e'),'key':null,'keyType':null,'variableName':null},{'type':_0x32eb('0x10'),'content':'','key':_0x32eb('0x1f'),'keyType':_0x32eb('0x5'),'variableName':_0x32eb('0x19')},{'type':_0x32eb('0x10'),'content':'','key':_0x32eb('0x20'),'keyType':'variable','variableName':_0x32eb('0x21')},{'type':_0x32eb('0x10'),'content':'','key':_0x32eb('0x22'),'keyType':_0x32eb('0x5'),'variableName':_0x32eb('0x23')},{'type':_0x32eb('0x10'),'content':'','key':_0x32eb('0x24'),'keyType':_0x32eb('0x5'),'variableName':'holdtime'},{'type':'keyValue','content':'','key':_0x32eb('0x25'),'keyType':_0x32eb('0x5'),'variableName':'talktime'}];break;case _0x32eb('0x8'):_0x542679=[{'type':'string','content':_0x32eb('0xe'),'variableName':null},{'type':_0x32eb('0x10'),'content':'','key':_0x32eb('0x26'),'keyType':'variable','keyContent':'','variableName':_0x32eb('0xb')},{'type':'keyValue','content':'','key':_0x32eb('0x27'),'keyType':'variable','keyContent':'','variableName':_0x32eb('0x28')},{'type':_0x32eb('0x10'),'content':'','key':_0x32eb('0x16'),'keyType':_0x32eb('0x5'),'keyContent':'','variableName':_0x32eb('0x17')},{'type':_0x32eb('0x10'),'content':'','key':'Date','keyType':_0x32eb('0x5'),'keyContent':'','variableName':_0x32eb('0x29')},{'type':_0x32eb('0x9'),'content':_0x32eb('0x1e')},{'type':_0x32eb('0x10'),'content':'','key':_0x32eb('0x2a'),'keyType':_0x32eb('0x5'),'keyContent':'','variableName':_0x32eb('0x2b')},{'type':_0x32eb('0x10'),'content':'','key':'Complete\x20Time','keyType':_0x32eb('0x5'),'keyContent':'','variableName':_0x32eb('0x2c')},{'type':'keyValue','content':'','key':_0x32eb('0x2d'),'keyType':_0x32eb('0x5'),'keyContent':'','variableName':_0x32eb('0x2e')},{'type':'keyValue','content':'','key':_0x32eb('0x2f'),'keyType':_0x32eb('0x5'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x542679;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index ae9b1b0..d2f64f1 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 _0xbe71=['chat-interactions','upperFirst','InteractionId','unknown','toLowerCase','toUpperCase','name','role','null','Interaction','then','update','info','catch','user','query','clone','omit','body','html','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions'];(function(_0x53d016,_0x3a6556){var _0x339ebc=function(_0x63e239){while(--_0x63e239){_0x53d016['push'](_0x53d016['shift']());}};_0x339ebc(++_0x3a6556);}(_0xbe71,0x12e));var _0x1be7=function(_0x35bad0,_0x21927d){_0x35bad0=_0x35bad0-0x0;var _0x4fe50f=_0xbe71[_0x35bad0];return _0x4fe50f;};'use strict';var _=require(_0x1be7('0x0'));var db=require(_0x1be7('0x1'))['db'];var loggers={'openchannel':require(_0x1be7('0x2'))(_0x1be7('0x3')),'mail':require(_0x1be7('0x2'))(_0x1be7('0x4')),'fax':require(_0x1be7('0x2'))(_0x1be7('0x5')),'sms':require(_0x1be7('0x2'))('sms-interactions'),'chat':require(_0x1be7('0x2'))(_0x1be7('0x6')),'whatsapp':require(_0x1be7('0x2'))('whatsapp-interactions')};function getInteractionId(_0x4afd3a,_0x5a9657,_0xbc7217){if(_0x4afd3a&&_0x4afd3a[_[_0x1be7('0x7')](_0xbc7217)+_0x1be7('0x8')]){return _0x4afd3a[_[_0x1be7('0x7')](_0xbc7217)+_0x1be7('0x8')];}else if(_0x4afd3a&&_0x4afd3a['id']){return _0x4afd3a['id'];}else if(_0x5a9657&&_0x5a9657['id']){return _0x5a9657['id'];}else{return _0x1be7('0x9');}}function log(_0x563395,_0xae241a,_0x167707,_0x2227f9,_0x2de471,_0x50358a){loggers[_0x2de471[_0x1be7('0xa')]()][_0x563395]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x50358a[_0x1be7('0xb')](),_0xae241a?_0xae241a['id']:null,_0xae241a?_0xae241a[_0x1be7('0xc')]:null,_0xae241a?_0xae241a[_0x1be7('0xd')]:null,getInteractionId(_0x167707,_0x2227f9,_0x2de471),_0x167707?JSON['stringify'](_0x167707):_0x1be7('0xe'));}function updateUser(_0x55fd2a,_0x1040eb,_0x175ed7,_0x1fe3ec,_0xccc982){db[_[_0x1be7('0x7')](_0x1fe3ec)+_0x1be7('0xf')]['findOne']({'where':{'id':getInteractionId(_0x1040eb,_0x175ed7,_0x1fe3ec)}})[_0x1be7('0x10')](function(_0x18ab48){if(_0x18ab48){return _0x18ab48[_0x1be7('0x11')]({'UserId':_0x55fd2a?_0x55fd2a['id']:null});}})[_0x1be7('0x10')](function(_0x2d24f4){if(_0x2d24f4){log(_0x1be7('0x12'),_0x55fd2a,_0x1040eb,_0x175ed7,_0x1fe3ec,_0xccc982);}})[_0x1be7('0x13')](function(){log('error',_0x55fd2a,_0x1040eb,_0x175ed7,_0x1fe3ec,_0xccc982);});}exports['tracked']=function(_0x1f3b6e,_0x16b74d){return function(_0x11f4a2,_0x12b469,_0x428924){var _0x4908bb=_0x11f4a2[_0x1be7('0x14')];var _0x54dd58={};var _0x8b8be=_0x11f4a2[_0x1be7('0x15')];if(_0x54dd58){_0x54dd58=_[_0x1be7('0x16')](_0x11f4a2['body']);_0x54dd58=_[_0x1be7('0x17')](_0x54dd58,[_0x1be7('0x18'),_0x1be7('0x19'),'phone',_0x1be7('0x1a'),_0x1be7('0x1b')]);}updateUser(_0x4908bb,_0x54dd58,_0x8b8be,_0x1f3b6e,_0x16b74d);_0x428924(null);};}; \ No newline at end of file +var _0x3f6d=['error','tracked','user','clone','omit','phone','mobile','../../mysqldb','openchannel-interactions','../../config/logger','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','null','then','info'];(function(_0x45bee0,_0x42bf09){var _0x1fcfd5=function(_0x235b6a){while(--_0x235b6a){_0x45bee0['push'](_0x45bee0['shift']());}};_0x1fcfd5(++_0x42bf09);}(_0x3f6d,0xee));var _0xd3f6=function(_0x22bb3d,_0x472b68){_0x22bb3d=_0x22bb3d-0x0;var _0x1916f8=_0x3f6d[_0x22bb3d];return _0x1916f8;};'use strict';var _=require('lodash');var db=require(_0xd3f6('0x0'))['db'];var loggers={'openchannel':require('../../config/logger')(_0xd3f6('0x1')),'mail':require(_0xd3f6('0x2'))('mail-interactions'),'fax':require(_0xd3f6('0x2'))('fax-interactions'),'sms':require(_0xd3f6('0x2'))(_0xd3f6('0x3')),'chat':require(_0xd3f6('0x2'))(_0xd3f6('0x4')),'whatsapp':require(_0xd3f6('0x2'))(_0xd3f6('0x5'))};function getInteractionId(_0x34f10a,_0x2dedf1,_0x56af62){if(_0x34f10a&&_0x34f10a[_[_0xd3f6('0x6')](_0x56af62)+_0xd3f6('0x7')]){return _0x34f10a[_['upperFirst'](_0x56af62)+_0xd3f6('0x7')];}else if(_0x34f10a&&_0x34f10a['id']){return _0x34f10a['id'];}else if(_0x2dedf1&&_0x2dedf1['id']){return _0x2dedf1['id'];}else{return'unknown';}}function log(_0x1eea39,_0x2bae23,_0x32614b,_0x4def00,_0x4d7946,_0x2cb6bf){loggers[_0x4d7946['toLowerCase']()][_0x1eea39](_0xd3f6('0x8'),_0x2cb6bf['toUpperCase'](),_0x2bae23?_0x2bae23['id']:null,_0x2bae23?_0x2bae23[_0xd3f6('0x9')]:null,_0x2bae23?_0x2bae23[_0xd3f6('0xa')]:null,getInteractionId(_0x32614b,_0x4def00,_0x4d7946),_0x32614b?JSON['stringify'](_0x32614b):_0xd3f6('0xb'));}function updateUser(_0x4e94f1,_0x2a1c72,_0x5be05d,_0x2760de,_0x520e8d){db[_[_0xd3f6('0x6')](_0x2760de)+'Interaction']['findOne']({'where':{'id':getInteractionId(_0x2a1c72,_0x5be05d,_0x2760de)}})[_0xd3f6('0xc')](function(_0x5a3565){if(_0x5a3565){return _0x5a3565['update']({'UserId':_0x4e94f1?_0x4e94f1['id']:null});}})[_0xd3f6('0xc')](function(_0x1c3437){if(_0x1c3437){log(_0xd3f6('0xd'),_0x4e94f1,_0x2a1c72,_0x5be05d,_0x2760de,_0x520e8d);}})['catch'](function(){log(_0xd3f6('0xe'),_0x4e94f1,_0x2a1c72,_0x5be05d,_0x2760de,_0x520e8d);});}exports[_0xd3f6('0xf')]=function(_0x15d148,_0x8b3d36){return function(_0x37c3e3,_0xf7f5b6,_0x40600d){var _0x5b4660=_0x37c3e3[_0xd3f6('0x10')];var _0x37fbff={};var _0x22c8b5=_0x37c3e3['query'];if(_0x37fbff){_0x37fbff=_[_0xd3f6('0x11')](_0x37c3e3['body']);_0x37fbff=_[_0xd3f6('0x12')](_0x37fbff,['body','html',_0xd3f6('0x13'),'fax',_0xd3f6('0x14')]);}updateUser(_0x5b4660,_0x37fbff,_0x22c8b5,_0x15d148,_0x8b3d36);_0x40600d(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 1d032b3..4a825c5 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 _0xcdec=['final','utf8','parse','hasOwnProperty','use','License','count','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64'];(function(_0x2a4d83,_0x2f548c){var _0x1f223d=function(_0x513327){while(--_0x513327){_0x2a4d83['push'](_0x2a4d83['shift']());}};_0x1f223d(++_0x2f548c);}(_0xcdec,0xd4));var _0xccde=function(_0x526dce,_0x3c6d1e){_0x526dce=_0x526dce-0x0;var _0x48db32=_0xcdec[_0x526dce];return _0x48db32;};'use strict';var crypto=require('crypto');var util=require(_0xccde('0x0'));var compose=require(_0xccde('0x1'));var db=require(_0xccde('0x2'))['db'];var config=require(_0xccde('0x3'));function getValueFromLicense(_0x51e5f1,_0x14ff40){if(_0x51e5f1&&_0x14ff40){if(_0x14ff40[_0xccde('0x4')]&&_0x14ff40[_0xccde('0x5')]){var _0x3d8d8f=_0x14ff40[_0xccde('0x4')];var _0x61f919=_0x14ff40[_0xccde('0x5')];var _0x333b63=_0x3d8d8f['split']('-')[0x4];var _0x2c1497=_0x3d8d8f['split']('-')[0x0];var _0x18cf63=crypto[_0xccde('0x6')](_0xccde('0x7'),util[_0xccde('0x8')](_0xccde('0x9'),_0x333b63,_0x3d8d8f,_0x2c1497));var _0x56a0bc=_0x18cf63[_0xccde('0xa')](_0x61f919,_0xccde('0xb'),'utf8');_0x56a0bc+=_0x18cf63[_0xccde('0xc')](_0xccde('0xd'));var _0x2b93e7=JSON[_0xccde('0xe')](_0x56a0bc);return _0x2b93e7[_0xccde('0xf')](_0x51e5f1)?_0x2b93e7[_0x51e5f1]:null;}}return null;}function isLimit(_0x1092d6,_0x59391c,_0x45958b,_0x55a1ca){var _0x57f95d=_0x59391c;return compose()[_0xccde('0x10')](function(_0x394608,_0x18e2cf,_0x22ab29){return db[_0xccde('0x11')]['findOne']({'where':{'id':0x1},'raw':!![]})['then'](function(_0x58776f){var _0x23825f=getValueFromLicense(_0x1092d6,_0x58776f);return _0x23825f?_0x23825f:_0x57f95d;})['then'](function(_0x30a3de){_0x57f95d=_0x30a3de;return _0x45958b[_0xccde('0x12')](_0x55a1ca);})[_0xccde('0x13')](function(_0x2d882d){if(_0x2d882d>=_0x57f95d){return _0x18e2cf[_0xccde('0x14')](0x193)[_0xccde('0x15')]({'message':util[_0xccde('0x8')](_0xccde('0x16'),_0x1092d6)});}_0x22ab29();})[_0xccde('0x17')](function(_0x1ccebf){_0x22ab29(_0x1ccebf);});});}function isUserLimit(){return isLimit(_0xccde('0x18'),0x1,db[_0xccde('0x19')],{'where':{'$or':[{'role':_0xccde('0x1a')},{'role':_0xccde('0x1b')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0x4331=['hasOwnProperty','License','findOne','then','count','json','User','user','isUserLimit','crypto','util','../../config/environment','license','data1','split','createDecipher','format','base64','utf8','final','parse'];(function(_0x8412d3,_0x5b96a6){var _0x1c18de=function(_0x48cd8a){while(--_0x48cd8a){_0x8412d3['push'](_0x8412d3['shift']());}};_0x1c18de(++_0x5b96a6);}(_0x4331,0x9c));var _0x1433=function(_0x28e502,_0x3e36c5){_0x28e502=_0x28e502-0x0;var _0x2fd662=_0x4331[_0x28e502];return _0x2fd662;};'use strict';var crypto=require(_0x1433('0x0'));var util=require(_0x1433('0x1'));var compose=require('composable-middleware');var db=require('../../mysqldb')['db'];var config=require(_0x1433('0x2'));function getValueFromLicense(_0x155b46,_0x38db9b){if(_0x155b46&&_0x38db9b){if(_0x38db9b['data1']&&_0x38db9b[_0x1433('0x3')]){var _0x29e51e=_0x38db9b[_0x1433('0x4')];var _0x4ba616=_0x38db9b[_0x1433('0x3')];var _0x1ca7ab=_0x29e51e[_0x1433('0x5')]('-')[0x4];var _0x69d683=_0x29e51e[_0x1433('0x5')]('-')[0x0];var _0x136501=crypto[_0x1433('0x6')]('aes-256-ctr',util[_0x1433('0x7')]('%s:%s:%s',_0x1ca7ab,_0x29e51e,_0x69d683));var _0x573d11=_0x136501['update'](_0x4ba616,_0x1433('0x8'),_0x1433('0x9'));_0x573d11+=_0x136501[_0x1433('0xa')](_0x1433('0x9'));var _0x19b1f7=JSON[_0x1433('0xb')](_0x573d11);return _0x19b1f7[_0x1433('0xc')](_0x155b46)?_0x19b1f7[_0x155b46]:null;}}return null;}function isLimit(_0x1010cf,_0x43b5f7,_0x40e607,_0x2d7763){var _0x22d29d=_0x43b5f7;return compose()['use'](function(_0xe6b533,_0x3954f6,_0x121c07){return db[_0x1433('0xd')][_0x1433('0xe')]({'where':{'id':0x1},'raw':!![]})[_0x1433('0xf')](function(_0x5379fa){var _0x4bd3e7=getValueFromLicense(_0x1010cf,_0x5379fa);return _0x4bd3e7?_0x4bd3e7:_0x22d29d;})[_0x1433('0xf')](function(_0x209b65){_0x22d29d=_0x209b65;return _0x40e607[_0x1433('0x10')](_0x2d7763);})[_0x1433('0xf')](function(_0x1828f8){if(_0x1828f8>=_0x22d29d){return _0x3954f6['status'](0x193)[_0x1433('0x11')]({'message':util[_0x1433('0x7')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x1010cf)});}_0x121c07();})['catch'](function(_0xad4d8c){_0x121c07(_0xad4d8c);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x1433('0x12')],{'where':{'$or':[{'role':'admin'},{'role':_0x1433('0x13')}]}});}exports[_0x1433('0x14')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 7bb5e20..7b6d665 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 _0xf627=['operator','$between','value','includes','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','$notIn','\x20OR\x20','\x20IS\x20NULL)','IN\x20?','NOT\x20IN\x20?','$eq','$ne','<>\x20?','$substring','$startsWith','$endsWith','$lt','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','$in','start','pop','utcOffset','hours','minutes','lodash','parseSearch','startsWith','replace','[$and]','split','length','slice','forEach','shift','match','filter','indexOf','conditions','push','buildExpression','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf627,0x197));var _0x7f62=function(_0x41fa54,_0x3bd8ca){_0x41fa54=_0x41fa54-0x0;var _0x392954=_0xf627[_0x41fa54];return _0x392954;};'use strict';var _=require(_0x7f62('0x0'));var moment=require('moment');exports[_0x7f62('0x1')]=function(_0x4ace75){var _0x2cf47a={'conditions':[]};_0x2cf47a['sqlOperator']=_[_0x7f62('0x2')](_0x4ace75,'[$or]')?'or':'and';var _0x2dbf70=_0x4ace75[_0x7f62('0x3')](_0x7f62('0x4'),'')[_0x7f62('0x3')]('[$or]','')[_0x7f62('0x5')]('||');for(var _0x294b8b=0x0;_0x294b8b<_0x2dbf70[_0x7f62('0x6')];_0x294b8b++){var _0x4d6472=_0x2dbf70[_0x294b8b][_0x7f62('0x5')](':=');var _0x2b994c=_0x4d6472[0x0];var _0x3de895=_0x4d6472[_0x7f62('0x7')](0x1);_0x3de895[_0x7f62('0x8')](function(_0x11861f){var _0x1fa61=_0x11861f[_0x7f62('0x5')]('[')[_0x7f62('0x9')]();var _0x5ea80b=_0x11861f[_0x7f62('0xa')](/\[(.*?)\]/g);_0x5ea80b[_0x7f62('0x8')](function(_0x860b18){var _0x17ef68=_0x860b18['split']('[')[_0x7f62('0xb')](function(_0x3e5aa9){return _0x3e5aa9[_0x7f62('0xc')](']')>-0x1;})['map'](function(_0x4e395d){return _0x4e395d[_0x7f62('0x5')](']')[0x0];})[0x0];_0x2cf47a[_0x7f62('0xd')][_0x7f62('0xe')]({'field':_0x2b994c,'operator':_0x1fa61,'value':_0x17ef68});});});}return _0x2cf47a;};exports[_0x7f62('0xf')]=function(_0x54f13c,_0x231456,_0x45d460){var _0x2a18ec={};if(_0x231456===_0x7f62('0x10')){if(_0x45d460['operator']==='$eq'){_0x45d460[_0x7f62('0x11')]=_0x7f62('0x12');_0x45d460[_0x7f62('0x13')]+=','+_0x45d460[_0x7f62('0x13')];}else if(_[_0x7f62('0x14')]([_0x7f62('0x15'),_0x7f62('0x16')],_0x45d460[_0x7f62('0x11')])){_0x45d460[_0x7f62('0x13')]=moment(_0x45d460[_0x7f62('0x13')])[_0x7f62('0x17')](0x1,_0x7f62('0x18'))[_0x7f62('0x19')](_0x7f62('0x1a'));}}if(_0x45d460[_0x7f62('0x1b')]){_0x231456=_0x45d460['castTo'];_0x2a18ec[_0x7f62('0x1c')]=_0x7f62('0x1d')+_0x54f13c+'.'+_0x45d460[_0x7f62('0x1e')]+'\x20AS\x20'+_0x45d460['castTo']+')\x20'+parseOperator(_0x45d460[_0x7f62('0x11')]);}else{_0x2a18ec[_0x7f62('0x1c')]=_0x54f13c+'.'+_0x45d460[_0x7f62('0x1e')]+'\x20'+parseOperator(_0x45d460[_0x7f62('0x11')]);}if(_[_0x7f62('0x14')](['$ne',_0x7f62('0x1f')],_0x45d460[_0x7f62('0x11')]))_0x2a18ec[_0x7f62('0x1c')]='('+_0x2a18ec[_0x7f62('0x1c')]+_0x7f62('0x20')+_0x54f13c+'.'+_0x45d460[_0x7f62('0x1e')]+_0x7f62('0x21');_0x2a18ec[_0x7f62('0x13')]=parseValue(_0x231456,_0x45d460[_0x7f62('0x11')],_0x45d460[_0x7f62('0x13')]);return _0x2a18ec;};function parseOperator(_0x14ced9){var _0x5e1bab;switch(_0x14ced9){case'$in':_0x5e1bab=_0x7f62('0x22');break;case _0x7f62('0x1f'):_0x5e1bab=_0x7f62('0x23');break;case _0x7f62('0x24'):_0x5e1bab='=\x20?';break;case _0x7f62('0x25'):_0x5e1bab=_0x7f62('0x26');break;case _0x7f62('0x27'):case _0x7f62('0x28'):case _0x7f62('0x29'):_0x5e1bab='LIKE\x20?';break;case _0x7f62('0x2a'):_0x5e1bab='<\x20?';break;case _0x7f62('0x15'):_0x5e1bab='>\x20?';break;case'$lte':_0x5e1bab=_0x7f62('0x2b');break;case _0x7f62('0x2c'):_0x5e1bab=_0x7f62('0x2d');break;case _0x7f62('0x12'):_0x5e1bab=_0x7f62('0x2e');break;}return _0x5e1bab;}function parseValue(_0x4d7eda,_0x1cce63,_0x3a30d7){var _0x4a2a6f={'start':undefined,'end':undefined};switch(_0x1cce63){case _0x7f62('0x2f'):case _0x7f62('0x1f'):_0x4a2a6f['start']=_0x3a30d7[_0x7f62('0x5')](',');break;case _0x7f62('0x27'):_0x4a2a6f[_0x7f62('0x30')]='%'+_0x3a30d7+'%';break;case _0x7f62('0x28'):_0x4a2a6f['start']=_0x3a30d7+'%';break;case _0x7f62('0x29'):_0x4a2a6f[_0x7f62('0x30')]='%'+_0x3a30d7;break;case _0x7f62('0x12'):var _0x5e26b4=_0x3a30d7[_0x7f62('0x5')](',');var _0x3a30d7=_0x5e26b4[_0x7f62('0x9')]();var _0x1770b1=_0x5e26b4[_0x7f62('0x31')]();if(_0x4d7eda==='DATE'){_0x3a30d7=moment(_0x3a30d7)['utcOffset'](0x0,!![])[_0x7f62('0x19')]();_0x1770b1=moment(_0x1770b1)[_0x7f62('0x32')](0x0,!![])[_0x7f62('0x17')](0x17,_0x7f62('0x33'))['add'](0x3b,_0x7f62('0x34'))[_0x7f62('0x17')](0x3b,'seconds')[_0x7f62('0x19')]();}_0x4a2a6f={'start':_0x3a30d7,'end':_0x1770b1};break;default:_0x4a2a6f[_0x7f62('0x30')]=_0x3a30d7;break;}return _0x4a2a6f;} \ No newline at end of file +var _0x50d7=['$ne','$notIn','\x20OR\x20','$in','IN\x20?','=\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','$gt','>\x20?','<=\x20?','$gte','$between','BETWEEN\x20?\x20AND\x20?','start','utcOffset','hours','minutes','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','[$and]','replace','split','length','shift','match','forEach','indexOf','conditions','push','buildExpression','DATE','operator','$eq','value','includes','$lte','add','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20'];(function(_0xef01fc,_0x161731){var _0x20cd53=function(_0x47e11d){while(--_0x47e11d){_0xef01fc['push'](_0xef01fc['shift']());}};_0x20cd53(++_0x161731);}(_0x50d7,0x1c7));var _0x750d=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x50d7[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0x750d('0x0'));var moment=require(_0x750d('0x1'));exports[_0x750d('0x2')]=function(_0x425c75){var _0x17d179={'conditions':[]};_0x17d179[_0x750d('0x3')]=_[_0x750d('0x4')](_0x425c75,_0x750d('0x5'))?'or':'and';var _0x4cd626=_0x425c75['replace'](_0x750d('0x6'),'')[_0x750d('0x7')](_0x750d('0x5'),'')[_0x750d('0x8')]('||');for(var _0x38b470=0x0;_0x38b470<_0x4cd626[_0x750d('0x9')];_0x38b470++){var _0x1bbd4b=_0x4cd626[_0x38b470][_0x750d('0x8')](':=');var _0xc36269=_0x1bbd4b[0x0];var _0x4e8e8e=_0x1bbd4b['slice'](0x1);_0x4e8e8e['forEach'](function(_0x1f8ac2){var _0x52e06f=_0x1f8ac2[_0x750d('0x8')]('[')[_0x750d('0xa')]();var _0x4d3938=_0x1f8ac2[_0x750d('0xb')](/\[(.*?)\]/g);_0x4d3938[_0x750d('0xc')](function(_0x3ca680){var _0x17b35b=_0x3ca680[_0x750d('0x8')]('[')['filter'](function(_0x4a40a8){return _0x4a40a8[_0x750d('0xd')](']')>-0x1;})['map'](function(_0x597510){return _0x597510[_0x750d('0x8')](']')[0x0];})[0x0];_0x17d179[_0x750d('0xe')][_0x750d('0xf')]({'field':_0xc36269,'operator':_0x52e06f,'value':_0x17b35b});});});}return _0x17d179;};exports[_0x750d('0x10')]=function(_0x427483,_0x1210f0,_0x40a26c){var _0x4648b2={};if(_0x1210f0===_0x750d('0x11')){if(_0x40a26c[_0x750d('0x12')]===_0x750d('0x13')){_0x40a26c[_0x750d('0x12')]='$between';_0x40a26c[_0x750d('0x14')]+=','+_0x40a26c['value'];}else if(_[_0x750d('0x15')](['$gt',_0x750d('0x16')],_0x40a26c[_0x750d('0x12')])){_0x40a26c[_0x750d('0x14')]=moment(_0x40a26c['value'])[_0x750d('0x17')](0x1,'days')[_0x750d('0x18')](_0x750d('0x19'));}}if(_0x40a26c[_0x750d('0x1a')]){_0x1210f0=_0x40a26c[_0x750d('0x1a')];_0x4648b2[_0x750d('0x1b')]=_0x750d('0x1c')+_0x427483+'.'+_0x40a26c[_0x750d('0x1d')]+_0x750d('0x1e')+_0x40a26c[_0x750d('0x1a')]+')\x20'+parseOperator(_0x40a26c[_0x750d('0x12')]);}else{_0x4648b2['text']=_0x427483+'.'+_0x40a26c[_0x750d('0x1d')]+'\x20'+parseOperator(_0x40a26c['operator']);}if(_['includes']([_0x750d('0x1f'),_0x750d('0x20')],_0x40a26c['operator']))_0x4648b2['text']='('+_0x4648b2[_0x750d('0x1b')]+_0x750d('0x21')+_0x427483+'.'+_0x40a26c[_0x750d('0x1d')]+'\x20IS\x20NULL)';_0x4648b2[_0x750d('0x14')]=parseValue(_0x1210f0,_0x40a26c[_0x750d('0x12')],_0x40a26c[_0x750d('0x14')]);return _0x4648b2;};function parseOperator(_0x135875){var _0x2670ce;switch(_0x135875){case _0x750d('0x22'):_0x2670ce=_0x750d('0x23');break;case'$notIn':_0x2670ce='NOT\x20IN\x20?';break;case _0x750d('0x13'):_0x2670ce=_0x750d('0x24');break;case _0x750d('0x1f'):_0x2670ce='<>\x20?';break;case _0x750d('0x25'):case _0x750d('0x26'):case _0x750d('0x27'):_0x2670ce=_0x750d('0x28');break;case _0x750d('0x29'):_0x2670ce=_0x750d('0x2a');break;case _0x750d('0x2b'):_0x2670ce=_0x750d('0x2c');break;case _0x750d('0x16'):_0x2670ce=_0x750d('0x2d');break;case _0x750d('0x2e'):_0x2670ce='>=\x20?';break;case _0x750d('0x2f'):_0x2670ce=_0x750d('0x30');break;}return _0x2670ce;}function parseValue(_0x5e63c6,_0x271bcc,_0x4ad966){var _0x555b26={'start':undefined,'end':undefined};switch(_0x271bcc){case _0x750d('0x22'):case _0x750d('0x20'):_0x555b26[_0x750d('0x31')]=_0x4ad966[_0x750d('0x8')](',');break;case _0x750d('0x25'):_0x555b26['start']='%'+_0x4ad966+'%';break;case'$startsWith':_0x555b26['start']=_0x4ad966+'%';break;case _0x750d('0x27'):_0x555b26[_0x750d('0x31')]='%'+_0x4ad966;break;case _0x750d('0x2f'):var _0xe11e4f=_0x4ad966[_0x750d('0x8')](',');var _0x4ad966=_0xe11e4f[_0x750d('0xa')]();var _0x4da7f0=_0xe11e4f['pop']();if(_0x5e63c6===_0x750d('0x11')){_0x4ad966=moment(_0x4ad966)[_0x750d('0x32')](0x0,!![])[_0x750d('0x18')]();_0x4da7f0=moment(_0x4da7f0)[_0x750d('0x32')](0x0,!![])[_0x750d('0x17')](0x17,_0x750d('0x33'))['add'](0x3b,_0x750d('0x34'))['add'](0x3b,_0x750d('0x35'))['format']();}_0x555b26={'start':_0x4ad966,'end':_0x4da7f0};break;default:_0x555b26[_0x750d('0x31')]=_0x4ad966;break;}return _0x555b26;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 3d334b2..5784d7f 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 _0x11c2=['filters','isEmpty','forOwn','isPlainObject','$gte','format','utc','$lte','subtract','name','uniqueid','isArray','limit','offset','sort','map','priority','unsigned','substr','DESC','cast','col','omit','length','isObject','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','join','query','$id','intersection','model','fields','attributes','nolimit','order','where','pick','filter','merge','type','lower','options','lodash','sequelize','moment','parse','keys','includes','split'];(function(_0x218972,_0x1f9794){var _0x1bb1a8=function(_0x3fb962){while(--_0x3fb962){_0x218972['push'](_0x218972['shift']());}};_0x1bb1a8(++_0x1f9794);}(_0x11c2,0xdd));var _0x211c=function(_0x211065,_0xa90ee4){_0x211065=_0x211065-0x0;var _0x1a37b0=_0x11c2[_0x211065];return _0x1a37b0;};'use strict';var _=require(_0x211c('0x0'));var sequelize=require(_0x211c('0x1'));var moment=require(_0x211c('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x351052){var _0x51d705=['ne'];try{var _0x24738f=JSON[_0x211c('0x3')](_0x351052);var _0x5705ab=Object[_0x211c('0x4')](_0x24738f)[0x0];return _0x51d705[_0x211c('0x5')](_0x5705ab);}catch(_0x294b13){return![];}}function getOperatorValue(_0x4b8f30){var _0x41a797=JSON[_0x211c('0x3')](_0x4b8f30);var _0x31d173=Object['keys'](_0x41a797)[0x0];var _0x2a3bb9=_0x41a797[_0x31d173];return{['$'+_0x31d173]:_0x2a3bb9};}exports['fields']=function(_0x4bb8b5){var _0xced2b=null;if(_0x4bb8b5){_0xced2b=_0x4bb8b5[_0x211c('0x6')](',');}return _0xced2b;};exports[_0x211c('0x7')]=function(_0x176fb6,_0x37742e){var _0x533ccb={};if(!_[_0x211c('0x8')](_0x176fb6)){_[_0x211c('0x9')](_0x176fb6,function(_0x3b6fc7,_0x1a4154){try{if(_0x37742e){var _0xfea441=_['find'](_0x37742e,{'name':_0x1a4154})||{};if(hasSequelizeOperator(_0x3b6fc7)){_0x533ccb[_0x1a4154]=getOperatorValue(_0x3b6fc7);}else if(_0xfea441['type']==='DATE'&&_[_0x211c('0xa')](_0x3b6fc7)){var _0x419c24=JSON['parse'](_0x3b6fc7);var _0x3bf2fc={'$gte':moment(moment(_0x419c24[_0x211c('0xb')])[_0x211c('0xc')]('YYYY-MM-DD'))[_0x211c('0xd')]()[_0x211c('0xc')](),'$lte':moment(moment(_0x419c24[_0x211c('0xe')])[_0x211c('0xc')]('YYYY-MM-DD'))[_0x211c('0xd')]()[_0x211c('0xf')](0x1,'s')[_0x211c('0xc')]()};_0x533ccb[_0x1a4154]=_0x3bf2fc;}else if(_0xfea441[_0x211c('0x10')]===_0x211c('0x11')){_0x533ccb[_0x1a4154]=_0x3b6fc7;}else{_0x533ccb[_0x1a4154]=_[_0x211c('0x12')](_0x3b6fc7)?_0x3b6fc7:JSON[_0x211c('0x3')](_0x3b6fc7);}}else{_0x533ccb[_0x1a4154]=_['isArray'](_0x3b6fc7)?_0x3b6fc7:JSON[_0x211c('0x3')](_0x3b6fc7);}}catch(_0x2cfcb1){_0x533ccb[_0x1a4154]=_0x3b6fc7['split'](',');}});}return _0x533ccb;};exports[_0x211c('0x13')]=function(_0x29053d){_0x29053d=parseInt(_0x29053d,0xa);if(!_0x29053d||_0x29053d<0x0){_0x29053d=LIMIT_VALUE;}return _0x29053d;};exports[_0x211c('0x14')]=function(_0x14ec79){_0x14ec79=parseInt(_0x14ec79,0xa);if(!_0x14ec79||_0x14ec79<0x0){_0x14ec79=0x0;}return _0x14ec79;};exports[_0x211c('0x15')]=function(_0x493a0e){var _0x2807e5,_0x1f9663=null;if(_0x493a0e){_0x2807e5=_0x493a0e[_0x211c('0x6')](',');_0x1f9663=_[_0x211c('0x16')](_0x2807e5,function(_0x529206){if(_0x529206['indexOf']('-')===0x0){return[_0x529206===_0x211c('0x17')?sequelize['cast'](sequelize['col']('priority'),_0x211c('0x18')):_0x529206[_0x211c('0x19')](0x1),_0x211c('0x1a')];}else{return[_0x529206===_0x211c('0x17')?sequelize[_0x211c('0x1b')](sequelize[_0x211c('0x1c')](_0x211c('0x17')),_0x211c('0x18')):_0x529206,'ASC'];}});}return _0x1f9663;};exports[_0x211c('0x1d')]=function(_0xc3208e,_0xeb3398){if(_[_0x211c('0x8')](_0xc3208e)){return _0xc3208e;}if(_[_0x211c('0x12')](_0xc3208e)){for(var _0x9e7739=0x0;_0x9e7739<_0xc3208e[_0x211c('0x1e')];_0x9e7739+=0x1){_0xc3208e[_0x9e7739]=this[_0x211c('0x1d')](_0xc3208e[_0x9e7739],_0xeb3398);}return _0xc3208e;}if(!_[_0x211c('0x1f')](_0xc3208e)){return _0xc3208e;}if(_['isString'](_0xeb3398)){_0xeb3398=[_0xeb3398];}if(!_[_0x211c('0x12')](_0xeb3398)){return _0xc3208e;}for(var _0x26c642=0x0;_0x26c642<_0xeb3398['length'];_0x26c642+=0x1){_[_0x211c('0x20')](_0xc3208e,_0xeb3398[_0x26c642]);}for(var _0xb40e3d in _0xc3208e){if(_0xc3208e[_0x211c('0x21')](_0xb40e3d)){_0xc3208e[_0xb40e3d]=this[_0x211c('0x1d')](_0xc3208e[_0xb40e3d],_0xeb3398);}}return _0xc3208e;};exports[_0x211c('0x22')]=function(_0x4f91c7){return _0x4f91c7[_0x211c('0x23')](RegExp(_0x211c('0x24')))?!![]:![];};exports[_0x211c('0x25')]=function(_0xc8fc5d){return _0xc8fc5d[_0x211c('0x23')](/^\S+@\S+$/)?!![]:![];};exports[_0x211c('0x26')]=function(_0x332ec0){var _0x725a35=[];_0x332ec0['split'](/[ ,]+/)[_0x211c('0x27')](function(_0x3b8d1f){_0x3b8d1f=_0x3b8d1f[_0x211c('0x28')](/([^:]")"+/g,'$1');_0x3b8d1f='+'+_0x3b8d1f+'*';if(_0x3b8d1f[_0x211c('0x5')]('@'))_0x3b8d1f='\x22'+_0x3b8d1f+'\x22';_0x725a35['push'](_0x3b8d1f);});return _0x725a35[_0x211c('0x29')]('\x20');};exports['getOptions']=function(_0x542868,_0x1295c5,_0x7cdc24){var _0xcdcadc={},_0x2cde54={};if(_0x1295c5[_0x211c('0x2a')]['$id']){_0x1295c5[_0x211c('0x2a')]['id']=_0x1295c5[_0x211c('0x2a')]['$id'];delete _0x1295c5[_0x211c('0x2a')][_0x211c('0x2b')];}_0xcdcadc['model']=_[_0x211c('0x16')](_0x542868,_0x211c('0x10'));_0xcdcadc[_0x211c('0x2a')]=_[_0x211c('0x4')](_0x1295c5['query']);_0xcdcadc['filters']=_[_0x211c('0x2c')](_0xcdcadc[_0x211c('0x2d')],_0xcdcadc[_0x211c('0x2a')]);_0x2cde54['attributes']=_[_0x211c('0x2c')](_0xcdcadc['model'],this[_0x211c('0x2e')](_0x1295c5[_0x211c('0x2a')][_0x211c('0x2e')]));_0x2cde54['attributes']=_0x2cde54['attributes']['length']?_0x2cde54[_0x211c('0x2f')]:_0xcdcadc[_0x211c('0x2d')];if(!_0x1295c5[_0x211c('0x2a')][_0x211c('0x21')](_0x211c('0x30'))){_0x2cde54[_0x211c('0x13')]=this[_0x211c('0x13')](_0x1295c5[_0x211c('0x2a')][_0x211c('0x13')]);_0x2cde54[_0x211c('0x14')]=this[_0x211c('0x14')](_0x1295c5[_0x211c('0x2a')]['offset']);}_0x2cde54[_0x211c('0x31')]=this['sort'](_0x1295c5[_0x211c('0x2a')][_0x211c('0x15')]);_0x2cde54[_0x211c('0x32')]=this['filters'](_[_0x211c('0x33')](_0x1295c5[_0x211c('0x2a')],_0xcdcadc[_0x211c('0x7')]),_0x542868);if(_0x1295c5[_0x211c('0x2a')][_0x211c('0x34')]){_0x2cde54[_0x211c('0x32')]=_[_0x211c('0x35')](_0x2cde54['where'],{'$or':_['map'](_0x542868,function(_0x25729c){if(_0x25729c[_0x211c('0x36')]!=='VIRTUAL'){if(_0x7cdc24){return sequelize[_0x211c('0x32')](sequelize['fn'](_0x211c('0x37'),sequelize[_0x211c('0x1c')](_0x25729c[_0x211c('0x10')])),{'$like':sequelize['fn'](_0x211c('0x37'),'%'+_0x1295c5[_0x211c('0x2a')]['filter']+'%')});}else{var _0x660471={};_0x660471[_0x25729c[_0x211c('0x10')]]={'$like':'%'+_0x1295c5[_0x211c('0x2a')]['filter']+'%'};return _0x660471;}}})});}_0x2cde54=_[_0x211c('0x35')]({},_0x2cde54,_0x1295c5[_0x211c('0x38')]);return _0x2cde54;}; \ No newline at end of file +var _0x2c32=['length','omit','isObject','isString','unset','isNumeric','match','^[+]?[0-9]*$','getFullTextValue','forEach','replace','push','join','getOptions','query','$id','model','intersection','attributes','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','name','options','sequelize','parse','keys','includes','fields','split','filters','isEmpty','forOwn','DATE','isPlainObject','YYYY-MM-DD','utc','$lte','format','isArray','limit','offset','sort','map','indexOf','priority','cast','col','unsigned','ASC'];(function(_0x4071cc,_0x2ba75f){var _0x2f2f8c=function(_0x5bd564){while(--_0x5bd564){_0x4071cc['push'](_0x4071cc['shift']());}};_0x2f2f8c(++_0x2ba75f);}(_0x2c32,0x16e));var _0x22c3=function(_0x56a387,_0x304d8c){_0x56a387=_0x56a387-0x0;var _0x4f9535=_0x2c32[_0x56a387];return _0x4f9535;};'use strict';var _=require('lodash');var sequelize=require(_0x22c3('0x0'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x969e82){var _0xc8e895=['ne'];try{var _0x3d3d58=JSON[_0x22c3('0x1')](_0x969e82);var _0x3bff1b=Object[_0x22c3('0x2')](_0x3d3d58)[0x0];return _0xc8e895[_0x22c3('0x3')](_0x3bff1b);}catch(_0x20fbfd){return![];}}function getOperatorValue(_0x3ccfdc){var _0x3b7eae=JSON[_0x22c3('0x1')](_0x3ccfdc);var _0x2e68db=Object[_0x22c3('0x2')](_0x3b7eae)[0x0];var _0x35cb67=_0x3b7eae[_0x2e68db];return{['$'+_0x2e68db]:_0x35cb67};}exports[_0x22c3('0x4')]=function(_0x47a6ee){var _0x54a9ee=null;if(_0x47a6ee){_0x54a9ee=_0x47a6ee[_0x22c3('0x5')](',');}return _0x54a9ee;};exports[_0x22c3('0x6')]=function(_0x31d660,_0x51dafd){var _0x373fcb={};if(!_[_0x22c3('0x7')](_0x31d660)){_[_0x22c3('0x8')](_0x31d660,function(_0x6f0abd,_0x50631f){try{if(_0x51dafd){var _0x2b524b=_['find'](_0x51dafd,{'name':_0x50631f})||{};if(hasSequelizeOperator(_0x6f0abd)){_0x373fcb[_0x50631f]=getOperatorValue(_0x6f0abd);}else if(_0x2b524b['type']===_0x22c3('0x9')&&_[_0x22c3('0xa')](_0x6f0abd)){var _0x49cb81=JSON['parse'](_0x6f0abd);var _0x2e2b1a={'$gte':moment(moment(_0x49cb81['$gte'])['format'](_0x22c3('0xb')))[_0x22c3('0xc')]()['format'](),'$lte':moment(moment(_0x49cb81[_0x22c3('0xd')])[_0x22c3('0xe')](_0x22c3('0xb')))[_0x22c3('0xc')]()['subtract'](0x1,'s')[_0x22c3('0xe')]()};_0x373fcb[_0x50631f]=_0x2e2b1a;}else if(_0x2b524b['name']==='uniqueid'){_0x373fcb[_0x50631f]=_0x6f0abd;}else{_0x373fcb[_0x50631f]=_[_0x22c3('0xf')](_0x6f0abd)?_0x6f0abd:JSON['parse'](_0x6f0abd);}}else{_0x373fcb[_0x50631f]=_[_0x22c3('0xf')](_0x6f0abd)?_0x6f0abd:JSON[_0x22c3('0x1')](_0x6f0abd);}}catch(_0x525d31){_0x373fcb[_0x50631f]=_0x6f0abd[_0x22c3('0x5')](',');}});}return _0x373fcb;};exports[_0x22c3('0x10')]=function(_0xfe55fa){_0xfe55fa=parseInt(_0xfe55fa,0xa);if(!_0xfe55fa||_0xfe55fa<0x0){_0xfe55fa=LIMIT_VALUE;}return _0xfe55fa;};exports[_0x22c3('0x11')]=function(_0x1a552f){_0x1a552f=parseInt(_0x1a552f,0xa);if(!_0x1a552f||_0x1a552f<0x0){_0x1a552f=0x0;}return _0x1a552f;};exports[_0x22c3('0x12')]=function(_0x1ae8aa){var _0x6549fe,_0x3cdd69=null;if(_0x1ae8aa){_0x6549fe=_0x1ae8aa['split'](',');_0x3cdd69=_[_0x22c3('0x13')](_0x6549fe,function(_0xf94db){if(_0xf94db[_0x22c3('0x14')]('-')===0x0){return[_0xf94db===_0x22c3('0x15')?sequelize[_0x22c3('0x16')](sequelize[_0x22c3('0x17')]('priority'),_0x22c3('0x18')):_0xf94db['substr'](0x1),'DESC'];}else{return[_0xf94db===_0x22c3('0x15')?sequelize[_0x22c3('0x16')](sequelize[_0x22c3('0x17')]('priority'),'unsigned'):_0xf94db,_0x22c3('0x19')];}});}return _0x3cdd69;};exports['omit']=function(_0x5e8c43,_0x5117e4){if(_[_0x22c3('0x7')](_0x5e8c43)){return _0x5e8c43;}if(_['isArray'](_0x5e8c43)){for(var _0x5f5e0b=0x0;_0x5f5e0b<_0x5e8c43[_0x22c3('0x1a')];_0x5f5e0b+=0x1){_0x5e8c43[_0x5f5e0b]=this[_0x22c3('0x1b')](_0x5e8c43[_0x5f5e0b],_0x5117e4);}return _0x5e8c43;}if(!_[_0x22c3('0x1c')](_0x5e8c43)){return _0x5e8c43;}if(_[_0x22c3('0x1d')](_0x5117e4)){_0x5117e4=[_0x5117e4];}if(!_[_0x22c3('0xf')](_0x5117e4)){return _0x5e8c43;}for(var _0x26f4e3=0x0;_0x26f4e3<_0x5117e4['length'];_0x26f4e3+=0x1){_[_0x22c3('0x1e')](_0x5e8c43,_0x5117e4[_0x26f4e3]);}for(var _0x3523a3 in _0x5e8c43){if(_0x5e8c43['hasOwnProperty'](_0x3523a3)){_0x5e8c43[_0x3523a3]=this['omit'](_0x5e8c43[_0x3523a3],_0x5117e4);}}return _0x5e8c43;};exports[_0x22c3('0x1f')]=function(_0x402b1b){return _0x402b1b[_0x22c3('0x20')](RegExp(_0x22c3('0x21')))?!![]:![];};exports['isEmail']=function(_0x4aae35){return _0x4aae35['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x22c3('0x22')]=function(_0x255fb9){var _0x1d5aae=[];_0x255fb9[_0x22c3('0x5')](/[ ,]+/)[_0x22c3('0x23')](function(_0x3789b8){_0x3789b8=_0x3789b8[_0x22c3('0x24')](/([^:]")"+/g,'$1');_0x3789b8='+'+_0x3789b8+'*';if(_0x3789b8[_0x22c3('0x3')]('@'))_0x3789b8='\x22'+_0x3789b8+'\x22';_0x1d5aae[_0x22c3('0x25')](_0x3789b8);});return _0x1d5aae[_0x22c3('0x26')]('\x20');};exports[_0x22c3('0x27')]=function(_0x4230ce,_0x669c82,_0x59bf50){var _0x48712b={},_0x43ac46={};if(_0x669c82[_0x22c3('0x28')][_0x22c3('0x29')]){_0x669c82[_0x22c3('0x28')]['id']=_0x669c82[_0x22c3('0x28')][_0x22c3('0x29')];delete _0x669c82[_0x22c3('0x28')][_0x22c3('0x29')];}_0x48712b[_0x22c3('0x2a')]=_[_0x22c3('0x13')](_0x4230ce,'name');_0x48712b[_0x22c3('0x28')]=_['keys'](_0x669c82[_0x22c3('0x28')]);_0x48712b[_0x22c3('0x6')]=_[_0x22c3('0x2b')](_0x48712b['model'],_0x48712b['query']);_0x43ac46['attributes']=_[_0x22c3('0x2b')](_0x48712b[_0x22c3('0x2a')],this[_0x22c3('0x4')](_0x669c82[_0x22c3('0x28')][_0x22c3('0x4')]));_0x43ac46['attributes']=_0x43ac46[_0x22c3('0x2c')][_0x22c3('0x1a')]?_0x43ac46[_0x22c3('0x2c')]:_0x48712b[_0x22c3('0x2a')];if(!_0x669c82[_0x22c3('0x28')][_0x22c3('0x2d')](_0x22c3('0x2e'))){_0x43ac46[_0x22c3('0x10')]=this[_0x22c3('0x10')](_0x669c82[_0x22c3('0x28')]['limit']);_0x43ac46[_0x22c3('0x11')]=this['offset'](_0x669c82['query'][_0x22c3('0x11')]);}_0x43ac46[_0x22c3('0x2f')]=this[_0x22c3('0x12')](_0x669c82[_0x22c3('0x28')][_0x22c3('0x12')]);_0x43ac46[_0x22c3('0x30')]=this[_0x22c3('0x6')](_[_0x22c3('0x31')](_0x669c82[_0x22c3('0x28')],_0x48712b[_0x22c3('0x6')]),_0x4230ce);if(_0x669c82['query'][_0x22c3('0x32')]){_0x43ac46[_0x22c3('0x30')]=_[_0x22c3('0x33')](_0x43ac46[_0x22c3('0x30')],{'$or':_[_0x22c3('0x13')](_0x4230ce,function(_0x33d490){if(_0x33d490[_0x22c3('0x34')]!==_0x22c3('0x35')){if(_0x59bf50){return sequelize[_0x22c3('0x30')](sequelize['fn']('lower',sequelize['col'](_0x33d490[_0x22c3('0x36')])),{'$like':sequelize['fn']('lower','%'+_0x669c82[_0x22c3('0x28')][_0x22c3('0x32')]+'%')});}else{var _0x27f1fa={};_0x27f1fa[_0x33d490[_0x22c3('0x36')]]={'$like':'%'+_0x669c82['query'][_0x22c3('0x32')]+'%'};return _0x27f1fa;}}})});}_0x43ac46=_[_0x22c3('0x33')]({},_0x43ac46,_0x669c82[_0x22c3('0x37')]);return _0x43ac46;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 51a9e0b..a8589c7 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4924=['production','set','appPath','join','public','development','client','use','split','static','root','engine','ejs','renderFile','view\x20engine','html','urlencoded','50mb','initialize','express','body-parser','passport','cors','moment','../mysqldb','default','get','env'];(function(_0x454766,_0x5dc262){var _0x24cc1a=function(_0x16b9b1){while(--_0x16b9b1){_0x454766['push'](_0x454766['shift']());}};_0x24cc1a(++_0x5dc262);}(_0x4924,0xd7));var _0x4492=function(_0x2af160,_0x765b1){_0x2af160=_0x2af160-0x0;var _0x439d67=_0x4924[_0x2af160];return _0x439d67;};'use strict';var express=require(_0x4492('0x0'));var favicon=require('serve-favicon');var bodyParser=require(_0x4492('0x1'));var methodOverride=require('method-override');var cookieParser=require('cookie-parser');var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x4492('0x2'));var cors=require(_0x4492('0x3'));var moment=require(_0x4492('0x4'));var config=require('./environment');var db=require(_0x4492('0x5'))['db'];exports[_0x4492('0x6')]=function(_0x1cf255){var _0x1e3a86=_0x1cf255[_0x4492('0x7')](_0x4492('0x8'));if(_0x1e3a86===_0x4492('0x9')){_0x1cf255[_0x4492('0xa')](_0x4492('0xb'),path[_0x4492('0xc')](config['root'],_0x4492('0xd')));}if(_0x1e3a86===_0x4492('0xe')||_0x1e3a86==='test'){_0x1cf255[_0x4492('0xa')](_0x4492('0xb'),path[_0x4492('0xc')](config['root'],_0x4492('0xf')));_0x1cf255[_0x4492('0x10')](errorHandler());}_0x1cf255[_0x4492('0xa')]('json\x20replacer',function(_0x275954,_0x37bba3){if(this[_0x275954]instanceof Date){_0x37bba3=this[_0x275954]['toISOString']()[_0x4492('0x11')]('.')[0x0]+'Z';}return _0x37bba3;});_0x1cf255[_0x4492('0x10')](express[_0x4492('0x12')](_0x1cf255['get'](_0x4492('0xb'))));_0x1cf255['set']('views',config[_0x4492('0x13')]+'/server/views');_0x1cf255[_0x4492('0x14')]('html',require(_0x4492('0x15'))[_0x4492('0x16')]);_0x1cf255[_0x4492('0xa')](_0x4492('0x17'),_0x4492('0x18'));_0x1cf255['use'](bodyParser[_0x4492('0x19')]({'limit':_0x4492('0x1a'),'extended':!![]}));_0x1cf255[_0x4492('0x10')](bodyParser['json']({'limit':_0x4492('0x1a')}));_0x1cf255['use'](cors());_0x1cf255[_0x4492('0x10')](methodOverride());_0x1cf255[_0x4492('0x10')](cookieParser());_0x1cf255[_0x4492('0x10')](passport[_0x4492('0x1b')]());}; \ No newline at end of file +var _0x4004=['path','passport','moment','./environment','../mysqldb','default','get','env','production','appPath','join','public','test','root','use','set','json\x20replacer','static','views','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','50mb','initialize','serve-favicon','body-parser','method-override','cookie-parser','errorhandler'];(function(_0x942eca,_0x1d0181){var _0x589c16=function(_0x235ca1){while(--_0x235ca1){_0x942eca['push'](_0x942eca['shift']());}};_0x589c16(++_0x1d0181);}(_0x4004,0x1a8));var _0x4400=function(_0x1e0ca5,_0x57fd4f){_0x1e0ca5=_0x1e0ca5-0x0;var _0x410923=_0x4004[_0x1e0ca5];return _0x410923;};'use strict';var express=require('express');var favicon=require(_0x4400('0x0'));var bodyParser=require(_0x4400('0x1'));var methodOverride=require(_0x4400('0x2'));var cookieParser=require(_0x4400('0x3'));var errorHandler=require(_0x4400('0x4'));var path=require(_0x4400('0x5'));var passport=require(_0x4400('0x6'));var cors=require('cors');var moment=require(_0x4400('0x7'));var config=require(_0x4400('0x8'));var db=require(_0x4400('0x9'))['db'];exports[_0x4400('0xa')]=function(_0x2ac372){var _0x3850cb=_0x2ac372[_0x4400('0xb')](_0x4400('0xc'));if(_0x3850cb===_0x4400('0xd')){_0x2ac372['set'](_0x4400('0xe'),path[_0x4400('0xf')](config['root'],_0x4400('0x10')));}if(_0x3850cb==='development'||_0x3850cb===_0x4400('0x11')){_0x2ac372['set']('appPath',path[_0x4400('0xf')](config[_0x4400('0x12')],'client'));_0x2ac372[_0x4400('0x13')](errorHandler());}_0x2ac372[_0x4400('0x14')](_0x4400('0x15'),function(_0x405681,_0x5c85a7){if(this[_0x405681]instanceof Date){_0x5c85a7=this[_0x405681]['toISOString']()['split']('.')[0x0]+'Z';}return _0x5c85a7;});_0x2ac372[_0x4400('0x13')](express[_0x4400('0x16')](_0x2ac372[_0x4400('0xb')](_0x4400('0xe'))));_0x2ac372[_0x4400('0x14')](_0x4400('0x17'),config[_0x4400('0x12')]+_0x4400('0x18'));_0x2ac372[_0x4400('0x19')](_0x4400('0x1a'),require(_0x4400('0x1b'))[_0x4400('0x1c')]);_0x2ac372[_0x4400('0x14')](_0x4400('0x1d'),'html');_0x2ac372[_0x4400('0x13')](bodyParser[_0x4400('0x1e')]({'limit':_0x4400('0x1f'),'extended':!![]}));_0x2ac372[_0x4400('0x13')](bodyParser['json']({'limit':_0x4400('0x1f')}));_0x2ac372['use'](cors());_0x2ac372[_0x4400('0x13')](methodOverride());_0x2ac372[_0x4400('0x13')](cookieParser());_0x2ac372[_0x4400('0x13')](passport[_0x4400('0x20')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index ebe9688..46aa6b2 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 _0xe7a4=['concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','model','join','createHash','md5','update','digest','hex','getUuid','platform','test','licenseToken','dmidecode\x20--string\x20system-uuid','replace','hostname','macAddress','ipAddress','substring','bimedia-machine-uuid','child_process','execSync','../environment','orderBy','length','family','IPv4','internal'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xe7a4,0x16d));var _0x4e7a=function(_0x2def1d,_0x4d425c){_0x2def1d=_0x2def1d-0x0;var _0x2b3643=_0xe7a4[_0x2def1d];return _0x2b3643;};'use strict';var _=require('lodash');var os=require('os');var crypto=require('crypto');var machine=require(_0x4e7a('0x0'));var exec=require(_0x4e7a('0x1'))[_0x4e7a('0x2')];var config=require(_0x4e7a('0x3'));function getInterfaces(){var _0x41d656=[];var _0x211cff=os['networkInterfaces']();var _0x42fda8=_[_0x4e7a('0x4')](_['keys'](_0x211cff));for(var _0x61511f=0x0;_0x61511f<_0x42fda8[_0x4e7a('0x5')];_0x61511f++){var _0x10fb2a=_0x211cff[_0x42fda8[_0x61511f]]['filter'](function(_0x304aef){return _0x304aef[_0x4e7a('0x6')]===_0x4e7a('0x7')&&_0x304aef[_0x4e7a('0x8')]===![];});_0x41d656=_0x41d656[_0x4e7a('0x9')](_0x10fb2a);}return _0x41d656;}function getFirstInterface(){var _0xa4a03d=_[_0x4e7a('0xa')](getInterfaces());return{'macAddress':_0xa4a03d&&_0xa4a03d[_0x4e7a('0xb')]?_0xa4a03d[_0x4e7a('0xb')]:_0x4e7a('0xc'),'ipAddress':_0xa4a03d&&_0xa4a03d[_0x4e7a('0xd')]?_0xa4a03d[_0x4e7a('0xd')]:_0x4e7a('0xe')};}exports[_0x4e7a('0xf')]=getFirstInterface;function getCPUhash(){var _0x8b6b89=_['orderBy'](os[_0x4e7a('0x10')]()['map'](function(_0x548ecf){return _0x548ecf[_0x4e7a('0x11')];}))[_0x4e7a('0x12')](':');return crypto[_0x4e7a('0x13')](_0x4e7a('0x14'))[_0x4e7a('0x15')](_0x8b6b89)[_0x4e7a('0x16')](_0x4e7a('0x17'));}exports[_0x4e7a('0x18')]=function(){var _0x1b530f=os[_0x4e7a('0x19')]();var _0x23095e=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x23095e[_0x4e7a('0x1a')](config[_0x4e7a('0x1b')])){return config['licenseToken'];}else if(_0x1b530f==='win32'){return exec(_0x4e7a('0x1c'),{'encoding':'utf8'})[_0x4e7a('0x1d')]('\x0d\x0a','');}else{var _0x66950d=getFirstInterface();var _0xe2eb4b=getCPUhash();var _0x5ace30=_0xe2eb4b+'|'+os[_0x4e7a('0x1e')]()+'|'+_0x66950d[_0x4e7a('0x1f')]+'|'+_0x66950d[_0x4e7a('0x20')];var _0x4e4044=crypto[_0x4e7a('0x13')](_0x4e7a('0x14'))['update'](_0x5ace30)['digest'](_0x4e7a('0x17'));return _0x4e4044[_0x4e7a('0x21')](0x0,0x8)+'-'+_0x4e4044[_0x4e7a('0x21')](0x8,0xc)+'-'+_0x4e4044[_0x4e7a('0x21')](0xc,0x10)+'-'+_0x4e4044[_0x4e7a('0x21')](0x10,0x14)+'-'+_0x4e4044[_0x4e7a('0x21')](0x14);}}; \ No newline at end of file +var _0xbb3f=['test','win32','dmidecode\x20--string\x20system-uuid','replace','hostname','macAddress','ipAddress','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','keys','length','filter','family','internal','concat','mac','00:00:00:00:00:00','address','127.0.0.1','cpus','map','join','createHash','md5','update','digest','hex','getUuid','licenseToken'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0xbb3f,0x1dc));var _0xfbb3=function(_0x50e7fa,_0x2748f5){_0x50e7fa=_0x50e7fa-0x0;var _0x23cb6e=_0xbb3f[_0x50e7fa];return _0x23cb6e;};'use strict';var _=require(_0xfbb3('0x0'));var os=require('os');var crypto=require(_0xfbb3('0x1'));var machine=require(_0xfbb3('0x2'));var exec=require(_0xfbb3('0x3'))[_0xfbb3('0x4')];var config=require(_0xfbb3('0x5'));function getInterfaces(){var _0x3dc756=[];var _0x57e62a=os[_0xfbb3('0x6')]();var _0x27be7a=_[_0xfbb3('0x7')](_[_0xfbb3('0x8')](_0x57e62a));for(var _0x4d04a8=0x0;_0x4d04a8<_0x27be7a[_0xfbb3('0x9')];_0x4d04a8++){var _0x45ce19=_0x57e62a[_0x27be7a[_0x4d04a8]][_0xfbb3('0xa')](function(_0x14a499){return _0x14a499[_0xfbb3('0xb')]==='IPv4'&&_0x14a499[_0xfbb3('0xc')]===![];});_0x3dc756=_0x3dc756[_0xfbb3('0xd')](_0x45ce19);}return _0x3dc756;}function getFirstInterface(){var _0x5095e1=_['head'](getInterfaces());return{'macAddress':_0x5095e1&&_0x5095e1[_0xfbb3('0xe')]?_0x5095e1[_0xfbb3('0xe')]:_0xfbb3('0xf'),'ipAddress':_0x5095e1&&_0x5095e1[_0xfbb3('0x10')]?_0x5095e1[_0xfbb3('0x10')]:_0xfbb3('0x11')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0xbf2ebd=_['orderBy'](os[_0xfbb3('0x12')]()[_0xfbb3('0x13')](function(_0x4801e4){return _0x4801e4['model'];}))[_0xfbb3('0x14')](':');return crypto[_0xfbb3('0x15')](_0xfbb3('0x16'))[_0xfbb3('0x17')](_0xbf2ebd)[_0xfbb3('0x18')](_0xfbb3('0x19'));}exports[_0xfbb3('0x1a')]=function(){var _0xc52a02=os['platform']();var _0x276b0a=/[0-9a-f-]{36}/;if(config[_0xfbb3('0x1b')]&&_0x276b0a[_0xfbb3('0x1c')](config[_0xfbb3('0x1b')])){return config[_0xfbb3('0x1b')];}else if(_0xc52a02===_0xfbb3('0x1d')){return exec(_0xfbb3('0x1e'),{'encoding':'utf8'})[_0xfbb3('0x1f')]('\x0d\x0a','');}else{var _0x22d060=getFirstInterface();var _0x58b6f6=getCPUhash();var _0x225071=_0x58b6f6+'|'+os[_0xfbb3('0x20')]()+'|'+_0x22d060[_0xfbb3('0x21')]+'|'+_0x22d060[_0xfbb3('0x22')];var _0x1d176d=crypto[_0xfbb3('0x15')](_0xfbb3('0x16'))[_0xfbb3('0x17')](_0x225071)[_0xfbb3('0x18')](_0xfbb3('0x19'));return _0x1d176d[_0xfbb3('0x23')](0x0,0x8)+'-'+_0x1d176d[_0xfbb3('0x23')](0x8,0xc)+'-'+_0x1d176d[_0xfbb3('0x23')](0xc,0x10)+'-'+_0x1d176d[_0xfbb3('0x23')](0x10,0x14)+'-'+_0x1d176d['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index b2a25c9..559ddbf 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 _0xc55d=['message','getUuid','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','bluebird','version','../../mysqldb','../../components/encryptor','./hardware','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','data1','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','error'];(function(_0x2b2b97,_0x22e065){var _0x5f4835=function(_0x4d7761){while(--_0x4d7761){_0x2b2b97['push'](_0x2b2b97['shift']());}};_0x5f4835(++_0x22e065);}(_0xc55d,0x12d));var _0xdc55=function(_0x49ea92,_0x455e9d){_0x49ea92=_0x49ea92-0x0;var _0x27174e=_0xc55d[_0x49ea92];return _0x27174e;};'use strict';var util=require(_0xdc55('0x0'));var moment=require(_0xdc55('0x1'));var rp=require('request-promise');var BPromise=require(_0xdc55('0x2'));var pkginfo=require('pkginfo')(module,_0xdc55('0x3'));var db=require(_0xdc55('0x4'))['db'];var encryptor=require(_0xdc55('0x5'));var hardware=require(_0xdc55('0x6'));var logger=require('../logger')(_0xdc55('0x7'));var HOST=_0xdc55('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x168d60){return new BPromise(function(_0x6a07e1,_0x31fd83){var _0x14c2ec=util[_0xdc55('0x9')](_0xdc55('0xa'),HOST,_0x168d60,module[_0xdc55('0xb')][_0xdc55('0x3')]);if(oldToken){_0x14c2ec=util[_0xdc55('0x9')](_0xdc55('0xc'),HOST,_0x168d60,module[_0xdc55('0xb')][_0xdc55('0x3')],oldToken);}var _0x952f33={'uri':_0x14c2ec,'method':_0xdc55('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x952f33)[_0xdc55('0xe')](function(_0xbe6c4b){_0x6a07e1(_0xbe6c4b);})[_0xdc55('0xf')](function(_0x6f58ea){_0x31fd83(_0x6f58ea);});});}function manageLicense(_0x593d84,_0x10739d){var _0x25ce58=_0x10739d['get']({'plain':!![]});if(!isOldTokenSent&&_0x25ce58[_0xdc55('0x10')]!==_0x593d84&&!_0x25ce58[_0xdc55('0x11')]){oldToken=_0x25ce58[_0xdc55('0x10')];}httpRequest(_0x593d84)['then'](function(_0x2e6418){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x2e6418['active']){isOldTokenSent=![];if(!_0x25ce58[_0xdc55('0x7')]&&_0x25ce58[_0xdc55('0x7')]!=_0x2e6418['license']||_0x25ce58[_0xdc55('0x7')]&&_0x25ce58[_0xdc55('0x11')]){logger['info'](_0xdc55('0x12'));}if(_0x25ce58[_0xdc55('0x7')]&&!_0x25ce58['data2']&&_0x25ce58[_0xdc55('0x7')]!=_0x2e6418[_0xdc55('0x7')]){logger[_0xdc55('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x25ce58[_0xdc55('0x7')]&&!_0x25ce58[_0xdc55('0x11')]&&_0x25ce58[_0xdc55('0x7')]==_0x2e6418[_0xdc55('0x7')]){return _0x10739d;}return _0x10739d[_0xdc55('0x14')]({'data1':_0x593d84,'data2':null,'license':_0x2e6418[_0xdc55('0x7')]});}else{if(_0x2e6418[_0xdc55('0x7')]||_0x25ce58[_0xdc55('0x7')]){if(!_0x25ce58[_0xdc55('0x11')]){if(_0x25ce58[_0xdc55('0x10')]==_0x593d84){GRAY_PERIOD_REASON=_0xdc55('0x15');logger[_0xdc55('0x13')](_0xdc55('0x16'));}else{GRAY_PERIOD_REASON=_0xdc55('0x17');logger[_0xdc55('0x13')](_0xdc55('0x18'),_0x25ce58['data1'],_0x593d84);}logger[_0xdc55('0x13')](_0xdc55('0x19'),GRAY_PERIOD_REASON[_0xdc55('0x1a')](),moment()['format'](_0xdc55('0x1b')));return _0x10739d[_0xdc55('0x14')]({'data2':encryptor[_0xdc55('0x1c')](moment()['format']('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0xdc55('0x1d')](encryptor[_0xdc55('0x1e')](_0x25ce58['data2']),'days')>DAYS){logger[_0xdc55('0x13')]('DEMO\x20START\x20AT\x20%s',moment()[_0xdc55('0x9')](_0xdc55('0x1b')));isOldTokenSent=![];return _0x10739d[_0xdc55('0x14')]({'data1':_0x593d84,'data2':null,'license':null});}}}else{if(_0x25ce58['data1']!=_0x593d84){logger[_0xdc55('0x13')](_0xdc55('0x18'),_0x25ce58['data1'],_0x593d84);return _0x10739d[_0xdc55('0x14')]({'data1':_0x593d84,'data2':null,'license':null});}}}return _0x10739d;})[_0xdc55('0xe')](function(_0x10cb14){_0x10739d=_0x10cb14;})['catch'](function(_0x2b2551){logger[_0xdc55('0x1f')](_0x2b2551[_0xdc55('0x20')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0xdc55('0x21')](),_0x10739d);},TIME);});}function defaultLicense(){var _0x5c053c=hardware[_0xdc55('0x21')]();if(_0x5c053c){return db['License']['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x5c053c}})[_0xdc55('0x22')](function(_0x2a0a1b,_0x1abab1){logger[_0xdc55('0x13')](_0xdc55('0x23'),_0x5c053c);manageLicense(_0x5c053c,_0x2a0a1b);})[_0xdc55('0xf')](function(_0x246808){logger[_0xdc55('0x1f')](_0x246808[_0xdc55('0x20')]);});}}exports[_0xdc55('0x24')]=defaultLicense; \ No newline at end of file +var _0x6b8f=['Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','decryptString','days','DEMO\x20START\x20AT\x20%s','error','message','finally','License','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','pkginfo','version','../../mysqldb','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','catch','data1','data2','then','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED'];(function(_0x1d3047,_0x3c1a42){var _0x13850f=function(_0x3106a9){while(--_0x3106a9){_0x1d3047['push'](_0x1d3047['shift']());}};_0x13850f(++_0x3c1a42);}(_0x6b8f,0xa6));var _0xf6b8=function(_0x4432ba,_0x767e85){_0x4432ba=_0x4432ba-0x0;var _0x335fab=_0x6b8f[_0x4432ba];return _0x335fab;};'use strict';var util=require(_0xf6b8('0x0'));var moment=require(_0xf6b8('0x1'));var rp=require(_0xf6b8('0x2'));var BPromise=require('bluebird');var pkginfo=require(_0xf6b8('0x3'))(module,_0xf6b8('0x4'));var db=require(_0xf6b8('0x5'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0xf6b8('0x6'));var logger=require(_0xf6b8('0x7'))(_0xf6b8('0x8'));var HOST=_0xf6b8('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x3131cd){return new BPromise(function(_0x38dbe9,_0x5186b5){var _0x38c4b8=util[_0xf6b8('0xa')](_0xf6b8('0xb'),HOST,_0x3131cd,module[_0xf6b8('0xc')]['version']);if(oldToken){_0x38c4b8=util[_0xf6b8('0xa')](_0xf6b8('0xd'),HOST,_0x3131cd,module[_0xf6b8('0xc')][_0xf6b8('0x4')],oldToken);}var _0x4ae654={'uri':_0x38c4b8,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x4ae654)['then'](function(_0x35ab1a){_0x38dbe9(_0x35ab1a);})[_0xf6b8('0xe')](function(_0x202c9e){_0x5186b5(_0x202c9e);});});}function manageLicense(_0x2ccc74,_0x1b803f){var _0x203507=_0x1b803f['get']({'plain':!![]});if(!isOldTokenSent&&_0x203507[_0xf6b8('0xf')]!==_0x2ccc74&&!_0x203507[_0xf6b8('0x10')]){oldToken=_0x203507[_0xf6b8('0xf')];}httpRequest(_0x2ccc74)[_0xf6b8('0x11')](function(_0x2066fc){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x2066fc[_0xf6b8('0x12')]){isOldTokenSent=![];if(!_0x203507['license']&&_0x203507[_0xf6b8('0x8')]!=_0x2066fc[_0xf6b8('0x8')]||_0x203507[_0xf6b8('0x8')]&&_0x203507[_0xf6b8('0x10')]){logger[_0xf6b8('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x203507[_0xf6b8('0x8')]&&!_0x203507[_0xf6b8('0x10')]&&_0x203507['license']!=_0x2066fc['license']){logger[_0xf6b8('0x13')](_0xf6b8('0x14'));}if(_0x203507[_0xf6b8('0x8')]&&!_0x203507['data2']&&_0x203507['license']==_0x2066fc[_0xf6b8('0x8')]){return _0x1b803f;}return _0x1b803f[_0xf6b8('0x15')]({'data1':_0x2ccc74,'data2':null,'license':_0x2066fc[_0xf6b8('0x8')]});}else{if(_0x2066fc[_0xf6b8('0x8')]||_0x203507[_0xf6b8('0x8')]){if(!_0x203507['data2']){if(_0x203507[_0xf6b8('0xf')]==_0x2ccc74){GRAY_PERIOD_REASON=_0xf6b8('0x16');logger['info'](_0xf6b8('0x17'));}else{GRAY_PERIOD_REASON=_0xf6b8('0x18');logger['info'](_0xf6b8('0x19'),_0x203507['data1'],_0x2ccc74);}logger[_0xf6b8('0x13')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0xf6b8('0x1a')](),moment()[_0xf6b8('0xa')](_0xf6b8('0x1b')));return _0x1b803f[_0xf6b8('0x15')]({'data2':encryptor[_0xf6b8('0x1c')](moment()[_0xf6b8('0xa')](_0xf6b8('0x1b')))});}else{if(moment()['diff'](encryptor[_0xf6b8('0x1d')](_0x203507[_0xf6b8('0x10')]),_0xf6b8('0x1e'))>DAYS){logger[_0xf6b8('0x13')](_0xf6b8('0x1f'),moment()[_0xf6b8('0xa')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x1b803f[_0xf6b8('0x15')]({'data1':_0x2ccc74,'data2':null,'license':null});}}}else{if(_0x203507['data1']!=_0x2ccc74){logger[_0xf6b8('0x13')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x203507[_0xf6b8('0xf')],_0x2ccc74);return _0x1b803f[_0xf6b8('0x15')]({'data1':_0x2ccc74,'data2':null,'license':null});}}}return _0x1b803f;})[_0xf6b8('0x11')](function(_0x3c8f8d){_0x1b803f=_0x3c8f8d;})[_0xf6b8('0xe')](function(_0xac2fa5){logger[_0xf6b8('0x20')](_0xac2fa5[_0xf6b8('0x21')]);})[_0xf6b8('0x22')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x1b803f);},TIME);});}function defaultLicense(){var _0x3c8221=hardware['getUuid']();if(_0x3c8221){return db[_0xf6b8('0x23')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x3c8221}})['spread'](function(_0x317484,_0x48f60d){logger[_0xf6b8('0x13')](_0xf6b8('0x24'),_0x3c8221);manageLicense(_0x3c8221,_0x317484);})[_0xf6b8('0xe')](function(_0x445bd9){logger[_0xf6b8('0x20')](_0x445bd9[_0xf6b8('0x21')]);});}}exports[_0xf6b8('0x25')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 1c71c63..2b028e4 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 _0xcb6f=['format','parse','demo','getUuid','gray','deadline','add','days','grayReason','machineUuid','message','User','findAll','role','sequelize','col','count','admin','user','telephone','telephones','forEach','pick','countBy','License\x20limit\x20reached\x20for\x20telephones','exports','util','moment','bluebird','./hardware','../../components/encryptor','Demo\x20license','2027-01-01T00:00:00.000Z','Breaking\x20license','License','find','defaults','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString'];(function(_0x58ba62,_0x252d9f){var _0x57628f=function(_0x5ba07b){while(--_0x5ba07b){_0x58ba62['push'](_0x58ba62['shift']());}};_0x57628f(++_0x252d9f);}(_0xcb6f,0x163));var _0xfcb6=function(_0x4ae02f,_0x4bd01b){_0x4ae02f=_0x4ae02f-0x0;var _0x426f7d=_0xcb6f[_0x4ae02f];return _0x426f7d;};'use strict';var util=require(_0xfcb6('0x0'));var _=require('lodash');var moment=require(_0xfcb6('0x1'));var BPromise=require(_0xfcb6('0x2'));var hardware=require(_0xfcb6('0x3'));var encryptor=require(_0xfcb6('0x4'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xfcb6('0x5'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xfcb6('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xfcb6('0x7'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x16a311){return new BPromise(function(_0x109686,_0x3481d3){return db[_0xfcb6('0x8')][_0xfcb6('0x9')](_[_0xfcb6('0xa')](_0x16a311,{'raw':!![],'where':{'id':0x1}}))[_0xfcb6('0xb')](function(_0x12dcc7){return checkLicense(_0x12dcc7,null);})['then'](function(_0x4558c7){_0x109686(_0x4558c7);return;})[_0xfcb6('0xc')](function(_0x19cdb6){_0x3481d3(_0x19cdb6);});});}function checkLicense(_0x40bbb3,_0xd65ac2){if(!_0x40bbb3){demoLicense[_0xfcb6('0xd')]=_0x40bbb3[_0xfcb6('0xe')];return demoLicense;}try{var _0x554cc9=_0xd65ac2||_0x40bbb3[_0xfcb6('0xf')];if(_[_0xfcb6('0x10')](_0x554cc9)){throw new Error(_0xfcb6('0x11'));}var _0x1a43b2=_0x40bbb3[_0xfcb6('0xe')];var _0xe91c73=_0x40bbb3[_0xfcb6('0x12')];var _0x54ef7c=_0x1a43b2[_0xfcb6('0x13')]('-')[0x4];var _0x94caff=_0x1a43b2[_0xfcb6('0x13')]('-')[0x0];var _0x159f14=encryptor[_0xfcb6('0x14')](_0x554cc9,util[_0xfcb6('0x15')]('%s:%s:%s',_0x54ef7c,_0x1a43b2,_0x94caff));var _0x39b0a5=JSON[_0xfcb6('0x16')](_0x159f14);_0x39b0a5[_0xfcb6('0x17')]=![];_0x39b0a5[_0xfcb6('0xd')]=_0x1a43b2;_0x39b0a5['machineUuid']=hardware[_0xfcb6('0x18')]();if(_0xe91c73){var _0x480fa2=encryptor['decryptString'](_0xe91c73);_0x39b0a5[_0xfcb6('0x19')]=_0x480fa2;_0x39b0a5[_0xfcb6('0x1a')]=moment(_0x480fa2)[_0xfcb6('0x1b')](0x7,_0xfcb6('0x1c'))[_0xfcb6('0x15')]();_0x39b0a5[_0xfcb6('0x1d')]=_0x39b0a5[_0xfcb6('0xd')]!=_0x39b0a5[_0xfcb6('0x1e')]?'changed':'disabled';}return _0x39b0a5;}catch(_0x1f5ed9){breakingLicense[_0xfcb6('0xd')]=_0x40bbb3['data1'];breakingLicense[_0xfcb6('0x1f')]=_0x1f5ed9['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x7ef30d,_0x33398e){getLicense()[_0xfcb6('0xb')](function(_0x57ccb){return db[_0xfcb6('0x20')][_0xfcb6('0x21')]({'attributes':[_0xfcb6('0x22'),[db['sequelize']['fn']('COUNT',db[_0xfcb6('0x23')][_0xfcb6('0x24')]('role')),_0xfcb6('0x25')]],'group':_0xfcb6('0x22'),'where':{'role':{'$or':[_0xfcb6('0x26'),_0xfcb6('0x27'),_0xfcb6('0x28')]}},'raw':!![]})[_0xfcb6('0xb')](function(_0x192350){var _0x26749f={'user':_0x57ccb['users']||0x0,'telephone':_0x57ccb[_0xfcb6('0x29')]||0x0};_0x192350[_0xfcb6('0x2a')](function(_0x2f03d3){var _0x44e144=_0x2f03d3[_0xfcb6('0x22')]===_0xfcb6('0x26')?'user':_0x2f03d3['role'];_0x26749f[_0x44e144]-=_0x2f03d3[_0xfcb6('0x25')];if(_0x26749f[_0x44e144]<0x0)_0x26749f[_0x44e144]=0x0;});_0x7ef30d(_0x26749f);return;});})[_0xfcb6('0xc')](function(_0x5d8548){_0x33398e(_0x5d8548);});});}function checkUserLimits(_0x403682){return new BPromise(function(_0x56f598,_0x106927){getLimits()[_0xfcb6('0xb')](function(_0x2f1e5b){var _0x3999a1=_[_0xfcb6('0x2b')](_[_0xfcb6('0x2c')](_0x403682,_0xfcb6('0x22')),[_0xfcb6('0x26'),'user',_0xfcb6('0x28')]);var _0x5a17fe=(_0x3999a1[_0xfcb6('0x26')]||0x0)+(_0x3999a1['user']||0x0);var _0x4e51d6=_0x3999a1[_0xfcb6('0x28')]||0x0;if(_0x5a17fe>_0x2f1e5b[_0xfcb6('0x27')])return _0x106927('License\x20limit\x20reached\x20for\x20users');if(_0x4e51d6>_0x2f1e5b[_0xfcb6('0x28')])return _0x106927(_0xfcb6('0x2d'));return _0x56f598();})[_0xfcb6('0xc')](function(_0x466c39){_0x106927(_0x466c39);});});}module[_0xfcb6('0x2e')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xb934=['sequelize','COUNT','count','admin','telephone','users','pick','user','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','bluebird','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','License','find','defaults','then','catch','uuid','data1','license','isEmpty','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','deadline','add','grayReason','message','User','findAll','role'];(function(_0x20dd43,_0x59d01a){var _0x36e1d5=function(_0x2a1dde){while(--_0x2a1dde){_0x20dd43['push'](_0x20dd43['shift']());}};_0x36e1d5(++_0x59d01a);}(_0xb934,0x14a));var _0x4b93=function(_0x38558a,_0x2b6e15){_0x38558a=_0x38558a-0x0;var _0x14ff8b=_0xb934[_0x38558a];return _0x14ff8b;};'use strict';var util=require(_0x4b93('0x0'));var _=require(_0x4b93('0x1'));var moment=require('moment');var BPromise=require(_0x4b93('0x2'));var hardware=require('./hardware');var encryptor=require('../../components/encryptor');var db=require(_0x4b93('0x3'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x4b93('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x4b93('0x5'),'machineUuid':hardware[_0x4b93('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x4b93('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0x4b93('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x32bc36){return new BPromise(function(_0x43a089,_0x3bba66){return db[_0x4b93('0x7')][_0x4b93('0x8')](_[_0x4b93('0x9')](_0x32bc36,{'raw':!![],'where':{'id':0x1}}))[_0x4b93('0xa')](function(_0x2be0d8){return checkLicense(_0x2be0d8,null);})['then'](function(_0x2333ae){_0x43a089(_0x2333ae);return;})[_0x4b93('0xb')](function(_0x483d57){_0x3bba66(_0x483d57);});});}function checkLicense(_0x26ba46,_0x4de78e){if(!_0x26ba46){demoLicense[_0x4b93('0xc')]=_0x26ba46[_0x4b93('0xd')];return demoLicense;}try{var _0x19fd81=_0x4de78e||_0x26ba46[_0x4b93('0xe')];if(_[_0x4b93('0xf')](_0x19fd81)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x5da3e9=_0x26ba46[_0x4b93('0xd')];var _0x99c81=_0x26ba46['data2'];var _0x23ee0d=_0x5da3e9[_0x4b93('0x10')]('-')[0x4];var _0x343aad=_0x5da3e9[_0x4b93('0x10')]('-')[0x0];var _0x3a0e97=encryptor[_0x4b93('0x11')](_0x19fd81,util[_0x4b93('0x12')](_0x4b93('0x13'),_0x23ee0d,_0x5da3e9,_0x343aad));var _0x42103f=JSON[_0x4b93('0x14')](_0x3a0e97);_0x42103f[_0x4b93('0x15')]=![];_0x42103f['uuid']=_0x5da3e9;_0x42103f[_0x4b93('0x16')]=hardware[_0x4b93('0x6')]();if(_0x99c81){var _0x3f1dfd=encryptor[_0x4b93('0x11')](_0x99c81);_0x42103f['gray']=_0x3f1dfd;_0x42103f[_0x4b93('0x17')]=moment(_0x3f1dfd)[_0x4b93('0x18')](0x7,'days')['format']();_0x42103f[_0x4b93('0x19')]=_0x42103f[_0x4b93('0xc')]!=_0x42103f[_0x4b93('0x16')]?'changed':'disabled';}return _0x42103f;}catch(_0x290a85){breakingLicense[_0x4b93('0xc')]=_0x26ba46[_0x4b93('0xd')];breakingLicense['message']=_0x290a85[_0x4b93('0x1a')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x4d8e9b,_0x2ffd11){getLicense()[_0x4b93('0xa')](function(_0x5b87ca){return db[_0x4b93('0x1b')][_0x4b93('0x1c')]({'attributes':[_0x4b93('0x1d'),[db[_0x4b93('0x1e')]['fn'](_0x4b93('0x1f'),db[_0x4b93('0x1e')]['col'](_0x4b93('0x1d'))),_0x4b93('0x20')]],'group':_0x4b93('0x1d'),'where':{'role':{'$or':[_0x4b93('0x21'),'user',_0x4b93('0x22')]}},'raw':!![]})[_0x4b93('0xa')](function(_0x1de6fd){var _0x4be0a8={'user':_0x5b87ca[_0x4b93('0x23')]||0x0,'telephone':_0x5b87ca['telephones']||0x0};_0x1de6fd['forEach'](function(_0xc3f464){var _0x5454d3=_0xc3f464['role']===_0x4b93('0x21')?'user':_0xc3f464[_0x4b93('0x1d')];_0x4be0a8[_0x5454d3]-=_0xc3f464[_0x4b93('0x20')];if(_0x4be0a8[_0x5454d3]<0x0)_0x4be0a8[_0x5454d3]=0x0;});_0x4d8e9b(_0x4be0a8);return;});})[_0x4b93('0xb')](function(_0x50917f){_0x2ffd11(_0x50917f);});});}function checkUserLimits(_0x6ba95a){return new BPromise(function(_0x27d0d0,_0x2e66c){getLimits()[_0x4b93('0xa')](function(_0x1014fc){var _0x61d4a7=_[_0x4b93('0x24')](_['countBy'](_0x6ba95a,_0x4b93('0x1d')),[_0x4b93('0x21'),_0x4b93('0x25'),'telephone']);var _0x4bdadd=(_0x61d4a7[_0x4b93('0x21')]||0x0)+(_0x61d4a7[_0x4b93('0x25')]||0x0);var _0x551088=_0x61d4a7[_0x4b93('0x22')]||0x0;if(_0x4bdadd>_0x1014fc[_0x4b93('0x25')])return _0x2e66c('License\x20limit\x20reached\x20for\x20users');if(_0x551088>_0x1014fc[_0x4b93('0x22')])return _0x2e66c(_0x4b93('0x26'));return _0x27d0d0();})['catch'](function(_0x59bfee){_0x2e66c(_0x59bfee);});});}module[_0x4b93('0x27')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index a6e7641..40bcadc 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 _0x2da6=['app-id','secret','exports','http://localhost:9000','myappanuglar-secret'];(function(_0x56390c,_0x375614){var _0x211c76=function(_0x5abe86){while(--_0x5abe86){_0x56390c['push'](_0x56390c['shift']());}};_0x211c76(++_0x375614);}(_0x2da6,0x1dd));var _0x62da=function(_0x8414bd,_0xa7a3e7){_0x8414bd=_0x8414bd-0x0;var _0xeba3ff=_0x2da6[_0x8414bd];return _0xeba3ff;};'use strict';module[_0x62da('0x0')]={'DOMAIN':_0x62da('0x1'),'SESSION_SECRET':_0x62da('0x2'),'GOOGLE_ID':_0x62da('0x3'),'GOOGLE_SECRET':_0x62da('0x4'),'DEBUG':''}; \ No newline at end of file +var _0xfb11=['exports','myappanuglar-secret','app-id'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xfb11[_0x2bf141];return _0x48277b;};'use strict';module[_0x1fb1('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x1fb1('0x1'),'GOOGLE_ID':_0x1fb1('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 5b965a5..14f939f 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x729d=['error','info','Console','debugLevel','moment','winston','path','join','/var','log','xcally','format','%s-%s.log','message','replace','{{{','}}}','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','exports','Logger','transports','File'];(function(_0x5b6375,_0x563718){var _0x4045b4=function(_0x314db8){while(--_0x314db8){_0x5b6375['push'](_0x5b6375['shift']());}};_0x4045b4(++_0x563718);}(_0x729d,0x1e4));var _0xd729=function(_0x242a4f,_0x369c57){_0x242a4f=_0x242a4f-0x0;var _0x122117=_0x729d[_0x242a4f];return _0x122117;};'use strict';var moment=require(_0xd729('0x0'));var winston=require(_0xd729('0x1'));var util=require('util');var path=require(_0xd729('0x2'));var debugLevel='INFO';function filename(_0x1dd989,_0x272e89){return path[_0xd729('0x3')](_0xd729('0x4'),_0xd729('0x5'),_0xd729('0x6'),util[_0xd729('0x7')](_0xd729('0x8'),_0x1dd989,_0x272e89));}function formatter(_0x142abb,_0x5080c1){_0x5080c1[_0xd729('0x9')]=_0x5080c1['message'][_0xd729('0xa')](/@@{/g,_0xd729('0xb'))['replace'](/}@@/g,_0xd729('0xc'))[_0xd729('0xa')](/@{/g,'{{')['replace'](/}@/g,'}}');return util['format']('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xd729('0x7')](_0xd729('0xd')),_0x5080c1[_0xd729('0xe')][_0xd729('0xf')](),_0x142abb,_0x5080c1[_0xd729('0x9')]);}module[_0xd729('0x10')]=function(_0x1d44f6){return new winston[(_0xd729('0x11'))]({'transports':[new winston[(_0xd729('0x12'))][(_0xd729('0x13'))]({'name':util[_0xd729('0x7')]('%s-%s',_0x1d44f6,_0xd729('0x14')),'filename':filename(_0x1d44f6,_0xd729('0x14')),'level':_0xd729('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x47f256){return formatter(_0x1d44f6,_0x47f256);}}),new winston[(_0xd729('0x12'))][(_0xd729('0x13'))]({'name':util[_0xd729('0x7')]('%s-%s',_0x1d44f6,_0xd729('0x15')),'filename':filename(_0x1d44f6,_0xd729('0x15')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x54c47f){return formatter(_0x1d44f6,_0x54c47f);}}),new winston[(_0xd729('0x12'))][(_0xd729('0x16'))]({'level':process['env'][_0xd729('0x17')]||debugLevel,'json':![],'formatter':function(_0xf9d9c6){return formatter(_0x1d44f6,_0xf9d9c6);}})]});}; \ No newline at end of file +var _0x8913=['replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','exports','Logger','transports','%s-%s','error','File','info','Console','moment','util','path','log','xcally','format','%s-%s.log','message'];(function(_0x2b69e7,_0x31b0de){var _0x288421=function(_0x570419){while(--_0x570419){_0x2b69e7['push'](_0x2b69e7['shift']());}};_0x288421(++_0x31b0de);}(_0x8913,0xdf));var _0x3891=function(_0x1cb66d,_0x2d4e36){_0x1cb66d=_0x1cb66d-0x0;var _0x11441c=_0x8913[_0x1cb66d];return _0x11441c;};'use strict';var moment=require(_0x3891('0x0'));var winston=require('winston');var util=require(_0x3891('0x1'));var path=require(_0x3891('0x2'));var debugLevel='INFO';function filename(_0x18193a,_0x11be20){return path['join']('/var',_0x3891('0x3'),_0x3891('0x4'),util[_0x3891('0x5')](_0x3891('0x6'),_0x18193a,_0x11be20));}function formatter(_0x1a424c,_0x534f20){_0x534f20[_0x3891('0x7')]=_0x534f20[_0x3891('0x7')][_0x3891('0x8')](/@@{/g,'{{{')[_0x3891('0x8')](/}@@/g,_0x3891('0x9'))['replace'](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x3891('0x5')](_0x3891('0xa'),moment()['format'](_0x3891('0xb')),_0x534f20[_0x3891('0xc')]['toUpperCase'](),_0x1a424c,_0x534f20[_0x3891('0x7')]);}module[_0x3891('0xd')]=function(_0x3f6194){return new winston[(_0x3891('0xe'))]({'transports':[new winston[(_0x3891('0xf'))]['File']({'name':util['format'](_0x3891('0x10'),_0x3f6194,'error'),'filename':filename(_0x3f6194,_0x3891('0x11')),'level':_0x3891('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x42498b){return formatter(_0x3f6194,_0x42498b);}}),new winston['transports'][(_0x3891('0x12'))]({'name':util['format'](_0x3891('0x10'),_0x3f6194,_0x3891('0x13')),'filename':filename(_0x3f6194,_0x3891('0x13')),'level':_0x3891('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x35f8e4){return formatter(_0x3f6194,_0x35f8e4);}}),new winston[(_0x3891('0xf'))][(_0x3891('0x14'))]({'level':process['env']['debugLevel']||debugLevel,'json':![],'formatter':function(_0x17f55){return formatter(_0x3f6194,_0x17f55);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 6d31478..06fc597 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 _0x4a88=['../../services/ami/index.js','agi','../../services/agi/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','join','../../services/express/index.js','ami'];(function(_0x49ec6b,_0x2a47d5){var _0xfd7f04=function(_0x537611){while(--_0x537611){_0x49ec6b['push'](_0x49ec6b['shift']());}};_0xfd7f04(++_0x2a47d5);}(_0x4a88,0x1b5));var _0x84a8=function(_0x5e75de,_0x18e748){_0x5e75de=_0x5e75de-0x0;var _0x555fa3=_0x4a88[_0x5e75de];return _0x555fa3;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':'express','script':path[_0x84a8('0x0')](__dirname,_0x84a8('0x1'))},{'name':_0x84a8('0x2'),'script':path[_0x84a8('0x0')](__dirname,_0x84a8('0x3'))},{'name':_0x84a8('0x4'),'script':path[_0x84a8('0x0')](__dirname,_0x84a8('0x5'))},{'name':'email','script':path[_0x84a8('0x0')](__dirname,'../../services/email/index.js')},{'name':_0x84a8('0x6'),'script':path['join'](__dirname,_0x84a8('0x7'))},{'name':_0x84a8('0x8'),'script':path[_0x84a8('0x0')](__dirname,_0x84a8('0x9'))}]};module[_0x84a8('0xa')]=config; \ No newline at end of file +var _0x0aea=['../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','path','express','join','../../services/ami/index.js'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x0aea,0x6a));var _0xa0ae=function(_0x4e5552,_0x19ec4e){_0x4e5552=_0x4e5552-0x0;var _0x60a338=_0x0aea[_0x4e5552];return _0x60a338;};'use strict';var path=require(_0xa0ae('0x0'));var os=require('os');var config={'apps':[{'name':_0xa0ae('0x1'),'script':path[_0xa0ae('0x2')](__dirname,'../../services/express/index.js')},{'name':'ami','script':path[_0xa0ae('0x2')](__dirname,_0xa0ae('0x3'))},{'name':'agi','script':path[_0xa0ae('0x2')](__dirname,_0xa0ae('0x4'))},{'name':_0xa0ae('0x5'),'script':path['join'](__dirname,_0xa0ae('0x6'))},{'name':_0xa0ae('0x7'),'script':path[_0xa0ae('0x2')](__dirname,_0xa0ae('0x8'))},{'name':_0xa0ae('0x9'),'script':path['join'](__dirname,_0xa0ae('0xa'))}]};module['exports']=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index f88c7d0..d6e12fc 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 _0x1bfe=['disconnect','restart','list','describe','delete','dump','saved','pm2','bluebird','connect','connected','then','stop'];(function(_0x4c445a,_0x4ee80f){var _0x2f611c=function(_0x4f3699){while(--_0x4f3699){_0x4c445a['push'](_0x4c445a['shift']());}};_0x2f611c(++_0x4ee80f);}(_0x1bfe,0x89));var _0xe1bf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x1bfe[_0x2f5ac5];return _0x37c9a8;};'use strict';var pm2=require(_0xe1bf('0x0'));var BPromise=require(_0xe1bf('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x126319,_0x253f07){return pm2[_0xe1bf('0x2')](function(_0x243fad){if(_0x243fad){return _0x253f07(_0x243fad);}return _0x126319(_0xe1bf('0x3'));});});};exports['start']=function(_0x372de7){return connect()[_0xe1bf('0x4')](function(){return new BPromise(function(_0x5019ba,_0x4cb20c){return pm2['start'](_0x372de7,function(_0x14c739,_0x26270f){if(_0x14c739){return _0x4cb20c(_0x14c739);}pm2['disconnect']();return _0x5019ba(_0x26270f);});});});};exports[_0xe1bf('0x5')]=function(_0x56ae54){return connect()[_0xe1bf('0x4')](function(){return new BPromise(function(_0x4b21d5,_0x563d5f){return pm2[_0xe1bf('0x5')](_0x56ae54,function(_0x5aa684,_0x4189a6){if(_0x5aa684){return _0x563d5f(_0x5aa684);}pm2[_0xe1bf('0x6')]();return _0x4b21d5(_0x4189a6);});});});};exports[_0xe1bf('0x7')]=function(_0x3da270){return connect()[_0xe1bf('0x4')](function(){return new BPromise(function(_0x5ed471,_0x45c1e7){return pm2[_0xe1bf('0x7')](_0x3da270,function(_0x12975f,_0x1f669c){if(_0x12975f){return _0x45c1e7(_0x12975f);}pm2[_0xe1bf('0x6')]();return _0x5ed471(_0x1f669c);});});});};exports['list']=function(){return connect()[_0xe1bf('0x4')](function(){return new BPromise(function(_0x332135,_0x2a3179){return pm2[_0xe1bf('0x8')](function(_0xbcc8f1,_0x613ed8){if(_0xbcc8f1){return _0x2a3179(_0xbcc8f1);}pm2[_0xe1bf('0x6')]();return _0x332135(_0x613ed8);});});});};exports[_0xe1bf('0x9')]=function(_0x48a9b2){return connect()[_0xe1bf('0x4')](function(){return new BPromise(function(_0x10efc9,_0x1e3b21){return pm2[_0xe1bf('0x9')](_0x48a9b2,function(_0x46efe5,_0x41bf30){if(_0x46efe5){return _0x1e3b21(_0x46efe5);}pm2['disconnect']();return _0x10efc9(_0x41bf30);});});});};exports[_0xe1bf('0xa')]=function(_0x33969a){return connect()[_0xe1bf('0x4')](function(){return new BPromise(function(_0x5b4223,_0x24573d){return pm2[_0xe1bf('0xa')](_0x33969a,function(_0x453bca,_0x2daa9b){if(_0x453bca){return _0x24573d(_0x453bca);}pm2['disconnect']();return _0x5b4223(_0x2daa9b);});});});};exports['dump']=function(){return connect()[_0xe1bf('0x4')](function(){return new BPromise(function(_0xed2e71,_0x207841){return pm2[_0xe1bf('0xb')](function(_0x341d7d){if(_0x341d7d){return _0x207841(_0x341d7d);}return _0xed2e71(_0xe1bf('0xc'));});});});}; \ No newline at end of file +var _0x139e=['delete','dump','saved','pm2','bluebird','./config','connect','start','disconnect','stop','then','restart','list','describe'];(function(_0x49197b,_0x354a27){var _0x39df92=function(_0x2547e3){while(--_0x2547e3){_0x49197b['push'](_0x49197b['shift']());}};_0x39df92(++_0x354a27);}(_0x139e,0x137));var _0xe139=function(_0x5261ac,_0x2193fa){_0x5261ac=_0x5261ac-0x0;var _0x1e904e=_0x139e[_0x5261ac];return _0x1e904e;};'use strict';var pm2=require(_0xe139('0x0'));var BPromise=require(_0xe139('0x1'));var config=require(_0xe139('0x2'));function connect(){return new BPromise(function(_0x541abd,_0x85a42e){return pm2[_0xe139('0x3')](function(_0xe86aaa){if(_0xe86aaa){return _0x85a42e(_0xe86aaa);}return _0x541abd('connected');});});};exports['start']=function(_0x530b60){return connect()['then'](function(){return new BPromise(function(_0x1d3f16,_0x52d3df){return pm2[_0xe139('0x4')](_0x530b60,function(_0x2b62c6,_0x5dfbd8){if(_0x2b62c6){return _0x52d3df(_0x2b62c6);}pm2[_0xe139('0x5')]();return _0x1d3f16(_0x5dfbd8);});});});};exports[_0xe139('0x6')]=function(_0xdbb43f){return connect()[_0xe139('0x7')](function(){return new BPromise(function(_0x55ddd4,_0x1e27ac){return pm2['stop'](_0xdbb43f,function(_0x43138e,_0x2d69c1){if(_0x43138e){return _0x1e27ac(_0x43138e);}pm2[_0xe139('0x5')]();return _0x55ddd4(_0x2d69c1);});});});};exports['restart']=function(_0x392312){return connect()[_0xe139('0x7')](function(){return new BPromise(function(_0x36cf46,_0x201477){return pm2[_0xe139('0x8')](_0x392312,function(_0x1007e5,_0x5e8aea){if(_0x1007e5){return _0x201477(_0x1007e5);}pm2[_0xe139('0x5')]();return _0x36cf46(_0x5e8aea);});});});};exports[_0xe139('0x9')]=function(){return connect()[_0xe139('0x7')](function(){return new BPromise(function(_0xe34fcd,_0x24ac63){return pm2[_0xe139('0x9')](function(_0x4e1534,_0x984602){if(_0x4e1534){return _0x24ac63(_0x4e1534);}pm2[_0xe139('0x5')]();return _0xe34fcd(_0x984602);});});});};exports[_0xe139('0xa')]=function(_0x5280a1){return connect()[_0xe139('0x7')](function(){return new BPromise(function(_0x3cb987,_0x2c9ad3){return pm2[_0xe139('0xa')](_0x5280a1,function(_0x13383e,_0x2f9792){if(_0x13383e){return _0x2c9ad3(_0x13383e);}pm2[_0xe139('0x5')]();return _0x3cb987(_0x2f9792);});});});};exports[_0xe139('0xb')]=function(_0x492daf){return connect()['then'](function(){return new BPromise(function(_0x27e650,_0x319860){return pm2[_0xe139('0xb')](_0x492daf,function(_0x22be82,_0xcfe479){if(_0x22be82){return _0x319860(_0x22be82);}pm2['disconnect']();return _0x27e650(_0xcfe479);});});});};exports[_0xe139('0xc')]=function(){return connect()[_0xe139('0x7')](function(){return new BPromise(function(_0x2bef2d,_0x4c1778){return pm2[_0xe139('0xc')](function(_0x25d77c){if(_0x25d77c){return _0x4c1778(_0x25d77c);}return _0x2bef2d(_0xe139('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index b0a5709..810df84 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 _0x1bb9=['info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','ioredis','../../config/environment','../../mysqldb','schedule','redis','defaults','Setting','find','chatTimeout','ChatInteraction','findAll','minutes','length','map','[CHAT]\x20Interactions\x20to\x20close:','join','timeout','YYYY-MM-DD\x20HH:mm:ss','then'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0x1bb9,0x182));var _0x91bb=function(_0x516ffb,_0x5b5b42){_0x516ffb=_0x516ffb-0x0;var _0x319667=_0x1bb9[_0x516ffb];return _0x319667;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require(_0x91bb('0x0'));var util=require('util');var config=require(_0x91bb('0x1'));var db=require(_0x91bb('0x2'))['db'];var logger=require('../logger')(_0x91bb('0x3'));config[_0x91bb('0x4')]=_[_0x91bb('0x5')](config[_0x91bb('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x91bb('0x4')]));function closeInteractions(){var _0x2aa49b=0x0;var _0x4ce8d4=[];return db[_0x91bb('0x6')][_0x91bb('0x7')]({'raw':!![],'attributes':['id',_0x91bb('0x8')],'where':{'id':0x1}})['then'](function(_0x5d8878){_0x2aa49b=_0x5d8878['chatTimeout'];if(_0x2aa49b){return db[_0x91bb('0x9')][_0x91bb('0xa')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x5d8878[_0x91bb('0x8')],_0x91bb('0xb'))}}});}else{return[];}})['then'](function(_0x4c9a05){if(_0x4c9a05&&_0x4c9a05[_0x91bb('0xc')]){_0x4ce8d4=_[_0x91bb('0xd')](_0x4c9a05||[],'id');logger['info'](_0x91bb('0xe'),_0x4ce8d4[_0x91bb('0xf')]());return db['ChatInteraction']['update']({'closeReason':'system','disposition':_0x91bb('0x10'),'closed':!![],'closedAt':moment()['format'](_0x91bb('0x11'))},{'where':{'id':_0x4ce8d4}});}})[_0x91bb('0x12')](function(){if(_0x4ce8d4&&_0x4ce8d4[_0x91bb('0xc')]){logger[_0x91bb('0x13')](_0x91bb('0x14'),_0x4ce8d4['join']());for(var _0x3ac8b2=0x0;_0x3ac8b2<_0x4ce8d4[_0x91bb('0xc')];_0x3ac8b2++){io[_0x91bb('0x15')](_0x91bb('0x16'),{'id':_0x4ce8d4[_0x3ac8b2],'closed':!![]});}}})[_0x91bb('0x17')](function(_0xf5c1fe){logger[_0x91bb('0x18')](_0x91bb('0x19'),_0xf5c1fe?util[_0x91bb('0x1a')](_0xf5c1fe,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x1369=['subtract','minutes','then','length','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','YYYY-MM-DD\x20HH:mm:ss','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','[CHAT]\x20Error\x20closing\x20interactions','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','schedule','redis','localhost','socket.io-emitter','find','chatTimeout','ChatInteraction','findAll','lastMsgAt'];(function(_0x41397b,_0x481d0e){var _0x5f4677=function(_0x4a0b5b){while(--_0x4a0b5b){_0x41397b['push'](_0x41397b['shift']());}};_0x5f4677(++_0x481d0e);}(_0x1369,0xbc));var _0x9136=function(_0x191b5d,_0x415035){_0x191b5d=_0x191b5d-0x0;var _0x3c8216=_0x1369[_0x191b5d];return _0x3c8216;};'use strict';var _=require(_0x9136('0x0'));var moment=require(_0x9136('0x1'));var Redis=require(_0x9136('0x2'));var util=require(_0x9136('0x3'));var config=require(_0x9136('0x4'));var db=require(_0x9136('0x5'))['db'];var logger=require('../logger')(_0x9136('0x6'));config[_0x9136('0x7')]=_['defaults'](config['redis'],{'host':_0x9136('0x8'),'port':0x18eb});var io=require(_0x9136('0x9'))(new Redis(config[_0x9136('0x7')]));function closeInteractions(){var _0x24bf39=0x0;var _0x1f18ee=[];return db['Setting'][_0x9136('0xa')]({'raw':!![],'attributes':['id',_0x9136('0xb')],'where':{'id':0x1}})['then'](function(_0x2eebc9){_0x24bf39=_0x2eebc9[_0x9136('0xb')];if(_0x24bf39){return db[_0x9136('0xc')][_0x9136('0xd')]({'raw':!![],'attributes':['id',_0x9136('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x9136('0xf')](_0x2eebc9[_0x9136('0xb')],_0x9136('0x10'))}}});}else{return[];}})[_0x9136('0x11')](function(_0x43ec73){if(_0x43ec73&&_0x43ec73[_0x9136('0x12')]){_0x1f18ee=_['map'](_0x43ec73||[],'id');logger['info'](_0x9136('0x13'),_0x1f18ee[_0x9136('0x14')]());return db['ChatInteraction'][_0x9136('0x15')]({'closeReason':_0x9136('0x16'),'disposition':'timeout','closed':!![],'closedAt':moment()['format'](_0x9136('0x17'))},{'where':{'id':_0x1f18ee}});}})['then'](function(){if(_0x1f18ee&&_0x1f18ee['length']){logger[_0x9136('0x18')](_0x9136('0x19'),_0x1f18ee[_0x9136('0x14')]());for(var _0x9ab35e=0x0;_0x9ab35e<_0x1f18ee[_0x9136('0x12')];_0x9ab35e++){io['emit'](_0x9136('0x1a'),{'id':_0x1f18ee[_0x9ab35e],'closed':!![]});}}})['catch'](function(_0x218c49){logger['error'](_0x9136('0x1b'),_0x218c49?util['inspect'](_0x218c49,{'showHidden':![],'depth':null}):'');});}exports[_0x9136('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 89c6484..8f08438 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 _0x729d=['pass','format','\x22%s\x22\x20<%s>','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','zip','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','SendMail','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport','no\x20report\x20id','findAll','MailServerOut','jobs','map','toString','keyBy','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','run\x20job','active','isBetween','startAt','endAt','add','cron','start','add\x20cron','stop\x20cron','update\x20cron','run','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','user'];(function(_0x2f20f8,_0x54a3f2){var _0xfcb1b7=function(_0xfd0c0d){while(--_0xfd0c0d){_0x2f20f8['push'](_0x2f20f8['shift']());}};_0xfcb1b7(++_0x54a3f2);}(_0x729d,0xaa));var _0xd729=function(_0x54b396,_0x3612ee){_0x54b396=_0x54b396-0x0;var _0x532e6d=_0x729d[_0x54b396];return _0x532e6d;};'use strict';var fs=require('fs');var util=require(_0xd729('0x0'));var path=require(_0xd729('0x1'));var _=require(_0xd729('0x2'));var moment=require(_0xd729('0x3'));var CronJobManager=require(_0xd729('0x4'));var jayson=require(_0xd729('0x5'));var BPromise=require(_0xd729('0x6'));var logger=require(_0xd729('0x7'))(_0xd729('0x8'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0xd729('0x9'));var client=jayson[_0xd729('0xa')][_0xd729('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x19de42,_0x5c60dc){return function(){logger[_0xd729('0xc')](_0xd729('0xd'),_0x19de42[_0xd729('0xe')]);var _0xa1e827=!![];var _0x520bd8={'tls':{'rejectUnauthorized':![]}};if(_0x19de42[_0xd729('0xf')][_0xd729('0x10')][_0xd729('0x11')]){_0x520bd8[_0xd729('0x11')]=_0x19de42[_0xd729('0xf')][_0xd729('0x10')][_0xd729('0x11')];}else{_0x520bd8[_0xd729('0x12')]=_0x19de42[_0xd729('0xf')]['Smtp'][_0xd729('0x12')];_0x520bd8[_0xd729('0x13')]=_0x19de42[_0xd729('0xf')][_0xd729('0x10')][_0xd729('0x13')];_0x520bd8[_0xd729('0x14')]=_0x19de42[_0xd729('0xf')][_0xd729('0x10')][_0xd729('0x14')];}if(_0x19de42['MailAccount']['Smtp'][_0xd729('0x15')]){_0x520bd8[_0xd729('0x16')]={'user':_0x19de42['MailAccount'][_0xd729('0x10')][_0xd729('0x17')],'pass':_0x19de42[_0xd729('0xf')]['Smtp'][_0xd729('0x18')]};}var _0x157c21={'account':_0x520bd8,'message':{'from':util[_0xd729('0x19')](_0xd729('0x1a'),_0x19de42[_0xd729('0xf')][_0xd729('0x1b')],_0x19de42[_0xd729('0xf')][_0xd729('0xe')]||_0x19de42[_0xd729('0xf')][_0xd729('0x10')]['user']),'to':_0x19de42['email'],'cc':_0x19de42['cc'],'bcc':_0x19de42[_0xd729('0x1c')],'subject':util[_0xd729('0x19')](_0xd729('0x1d'),_0x5c60dc[_0xd729('0x1b')],_0x19de42[_0xd729('0x1e')],_0x19de42[_0xd729('0x1f')])}};var _0x476d85=path[_0xd729('0x20')](__dirname,_0xd729('0x21'));var _0x3aa912=_0x5c60dc[_0xd729('0x22')];var _0x264732=util['format'](_0xd729('0x23'),path[_0xd729('0x24')](_0x5c60dc[_0xd729('0x22')],path[_0xd729('0x25')](_0x5c60dc[_0xd729('0x22')])),_0xd729('0x26'));var _0x99665e=path[_0xd729('0x20')](_0x476d85,_0x3aa912);var _0x3475f7=path[_0xd729('0x20')](_0x476d85,_0x264732);if(fs[_0xd729('0x27')](_0x99665e)){_0x5c60dc[_0xd729('0x28')]=_0xd729('0x29');_0x157c21[_0xd729('0x2a')][_0xd729('0x2b')]=[{'filename':_0x3aa912,'path':_0x99665e}];_0x157c21[_0xd729('0x2a')][_0xd729('0x2c')]=util[_0xd729('0x19')](_0xd729('0x2d'),JSON[_0xd729('0x2e')](_0x5c60dc,null,0x2));}else if(fs[_0xd729('0x27')](_0x3475f7)){_0x5c60dc[_0xd729('0x28')]='Sent';_0x157c21[_0xd729('0x2a')][_0xd729('0x2b')]=[{'filename':_0x264732,'path':_0x3475f7}];}else{_0x157c21['message'][_0xd729('0x2c')]=_0xd729('0x2f');if(!_0x19de42[_0xd729('0x30')]){_0xa1e827=![];logger[_0xd729('0xc')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0xa1e827){return client['request'](_0xd729('0x31'),_0x157c21)[_0xd729('0x32')](function(_0x372fc8){if(_0x372fc8[_0xd729('0x33')]){return logger[_0xd729('0x33')](_0xd729('0x34'),JSON[_0xd729('0x2e')](_0x372fc8));}return logger[_0xd729('0xc')](_0xd729('0x35'));})[_0xd729('0x36')](function(_0x118b63){return logger[_0xd729('0x33')]('error\x20mail',JSON[_0xd729('0x2e')](_0x118b63));});}};}function handleError(){return function(_0x1b4cdb){return logger[_0xd729('0x33')](JSON['stringify'](_0x1b4cdb));};}function handleResult(_0x6c2bf9){return function(_0x39b7af){logger['info'](_0xd729('0x37'),JSON[_0xd729('0x2e')](_0x39b7af));if(_0x6c2bf9[_0xd729('0xf')]&&_0x6c2bf9[_0xd729('0xf')]['Smtp']&&!_[_0xd729('0x38')](_0x6c2bf9[_0xd729('0xe')])){setTimeout(handleSendEmail(_0x6c2bf9,_0x39b7af),0x3c*0x3e8);}};}function handleJob(_0x58ba09){return function(){try{if(_[_0xd729('0x38')](_0x58ba09[_0xd729('0x1e')])){return logger[_0xd729('0xc')](_0xd729('0x39'));}if(_[_0xd729('0x38')](_0x58ba09[_0xd729('0x1f')])){return logger['info'](_0xd729('0x3a'));}var _0x7f8f2e={'startDate':moment()[_0xd729('0x3b')](_0x58ba09['subtractNumber'],_0x58ba09['subtractUnit'])['format'](_0xd729('0x3c')),'endDate':moment()[_0xd729('0x19')](_0xd729('0x3c')),'type':_0xd729('0x3d'),'output':_0x58ba09[_0xd729('0x3e')],'name':_0x58ba09[_0xd729('0x1b')]};if(!_[_0xd729('0x38')](_0x58ba09[_0xd729('0x3f')])){logger['info'](_0xd729('0x40'),_0x58ba09[_0xd729('0x3f')]);return analyticDefaultReportController['runReport']({'id':_0x58ba09['DefaultReportId']},_0x7f8f2e)[_0xd729('0x32')](handleResult(_0x58ba09))[_0xd729('0x36')](handleError());}if(!_['isNil'](_0x58ba09[_0xd729('0x41')])){logger[_0xd729('0xc')](_0xd729('0x42'),_0x58ba09[_0xd729('0x41')]);return analyticCustomReportController[_0xd729('0x43')]({'id':_0x58ba09[_0xd729('0x41')]},_0x7f8f2e)['then'](handleResult(_0x58ba09))[_0xd729('0x36')](handleError());}}catch(_0x2adcf7){logger['error'](JSON[_0xd729('0x2e')](_0x2adcf7));}return logger[_0xd729('0xc')](_0xd729('0x44'));};}function getJobs(_0x2727b3){var _0xfabed7={};if(_0x2727b3){_0xfabed7['id']=_0x2727b3;}return db['Schedule'][_0xd729('0x45')]({'where':_0xfabed7,'include':[{'model':db[_0xd729('0xf')],'attributes':['id',_0xd729('0x1b'),_0xd729('0xe')],'include':[{'model':db[_0xd729('0x46')],'as':_0xd729('0x10')}]}]})[_0xd729('0x32')](function(_0x12230b){var _0x410f65=_['keys'](manager[_0xd729('0x47')]);var _0x5a2bd5=_[_0xd729('0x48')](_0x12230b,function(_0x2ed8ff){return _0x2ed8ff['id'][_0xd729('0x49')]();});var _0x33ed12=_[_0xd729('0x4a')](_0x12230b,function(_0x10a164){return _0x10a164['id']['toString']();});var _0x470c1e=_0x2727b3?_0x5a2bd5:_[_0xd729('0x4b')](_0x5a2bd5,_0x410f65);var _0x173169=_[_0xd729('0x4c')](_0x5a2bd5,_0x410f65);var _0x25c014=_[_0xd729('0x4b')](_0x410f65,_0x5a2bd5);var _0x473761;var _0x15cd8c;for(_0x473761=0x0;_0x473761<_0x25c014[_0xd729('0x4d')]&&!_0x2727b3;_0x473761+=0x1){_0x15cd8c=_0x25c014[_0x473761][_0xd729('0x49')]();if(manager[_0xd729('0x4e')](_0x15cd8c)){manager[_0xd729('0x4f')](_0x15cd8c);manager[_0xd729('0x50')](_0x15cd8c);logger[_0xd729('0xc')](_0xd729('0x51'),_0x15cd8c);}}logger[_0xd729('0xc')](_0xd729('0x52'),JSON[_0xd729('0x2e')](_0x470c1e));for(_0x473761=0x0;_0x473761<_0x470c1e[_0xd729('0x4d')];_0x473761+=0x1){_0x15cd8c=_0x470c1e[_0x473761][_0xd729('0x49')]();logger[_0xd729('0xc')](_0xd729('0x53'),_0x15cd8c);if(_0x2727b3){logger[_0xd729('0xc')](_0xd729('0x54'),_0x2727b3);logger[_0xd729('0xc')](JSON[_0xd729('0x2e')](_0x33ed12[_0x15cd8c]));BPromise['resolve']()['then'](handleJob(_0x33ed12[_0x15cd8c]));logger[_0xd729('0xc')](_0xd729('0x55'),_0x33ed12[_0x15cd8c][_0xd729('0x1b')],_0x33ed12[_0x15cd8c]['cron']);}else if(_0x33ed12[_0x15cd8c]['cron']&&_0x33ed12[_0x15cd8c][_0xd729('0x56')]&&moment()[_0xd729('0x57')](_0x33ed12[_0x15cd8c][_0xd729('0x58')],_0x33ed12[_0x15cd8c][_0xd729('0x59')])){manager[_0xd729('0x5a')](_0x15cd8c,_0x33ed12[_0x15cd8c][_0xd729('0x5b')],handleJob(_0x33ed12[_0x15cd8c]));manager[_0xd729('0x5c')](_0x15cd8c);logger[_0xd729('0xc')](_0xd729('0x5d'),_0x33ed12[_0x15cd8c][_0xd729('0x1b')],_0x33ed12[_0x15cd8c][_0xd729('0x5b')]);}else if(manager[_0xd729('0x4e')](_0x15cd8c)){manager['stop'](_0x15cd8c);manager['deleteJob'](_0x15cd8c);logger['info'](_0xd729('0x5e'),_0x33ed12[_0x15cd8c]['name'],_0x33ed12[_0x15cd8c][_0xd729('0x5b')]);}}for(_0x473761=0x0,_0x15cd8c;_0x473761<_0x173169[_0xd729('0x4d')]&&!_0x2727b3;_0x473761+=0x1){_0x15cd8c=_0x173169[_0x473761]['toString']();if(manager[_0xd729('0x4e')](_0x15cd8c)){if(_0x33ed12[_0x15cd8c]['cron']&&_0x33ed12[_0x15cd8c][_0xd729('0x56')]&&moment()[_0xd729('0x57')](_0x33ed12[_0x15cd8c]['startAt'],_0x33ed12[_0x15cd8c][_0xd729('0x59')])){manager['update'](_0x15cd8c,_0x33ed12[_0x15cd8c][_0xd729('0x5b')],handleJob(_0x33ed12[_0x15cd8c]));logger['info'](_0xd729('0x5f'),_0x33ed12[_0x15cd8c][_0xd729('0x1b')],_0x33ed12[_0x15cd8c][_0xd729('0x5b')]);}else{manager[_0xd729('0x4f')](_0x15cd8c);manager[_0xd729('0x50')](_0x15cd8c);logger[_0xd729('0xc')](_0xd729('0x5e'),_0x33ed12[_0x15cd8c][_0xd729('0x1b')],_0x33ed12[_0x15cd8c][_0xd729('0x5b')]);}}}})['catch'](function(_0x268145){logger[_0xd729('0x33')](JSON['stringify'](_0x268145));});}exports[_0xd729('0x60')]=function(_0x38feee){return getJobs(_0x38feee);};exports[_0xd729('0x5c')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xbcb6=['join','../../files/reports','savename','%s.%s','basename','extname','zip','existsSync','status','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','map','toString','keyBy','difference','intersection','length','exists','stop','deleteJob','toRun','my\x20id','cron','active','isBetween','startAt','endAt','start','add\x20cron','stop\x20cron','update','update\x20cron','util','path','lodash','moment','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','\x22%s\x22\x20<%s>','name','bcc','format','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit'];(function(_0x1a2853,_0xba99a1){var _0x3a885f=function(_0x419436){while(--_0x419436){_0x1a2853['push'](_0x1a2853['shift']());}};_0x3a885f(++_0xba99a1);}(_0xbcb6,0x1a7));var _0x6bcb=function(_0x1830ce,_0x305798){_0x1830ce=_0x1830ce-0x0;var _0x2bce9f=_0xbcb6[_0x1830ce];return _0x2bce9f;};'use strict';var fs=require('fs');var util=require(_0x6bcb('0x0'));var path=require(_0x6bcb('0x1'));var _=require(_0x6bcb('0x2'));var moment=require(_0x6bcb('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require(_0x6bcb('0x4'));var BPromise=require(_0x6bcb('0x5'));var logger=require(_0x6bcb('0x6'))(_0x6bcb('0x7'));var db=require(_0x6bcb('0x8'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x6bcb('0x9'));var client=jayson[_0x6bcb('0xa')][_0x6bcb('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x162d38,_0x530f85){return function(){logger[_0x6bcb('0xc')](_0x6bcb('0xd'),_0x162d38[_0x6bcb('0xe')]);var _0x215eff=!![];var _0x39fb85={'tls':{'rejectUnauthorized':![]}};if(_0x162d38[_0x6bcb('0xf')][_0x6bcb('0x10')]['service']){_0x39fb85[_0x6bcb('0x11')]=_0x162d38[_0x6bcb('0xf')][_0x6bcb('0x10')][_0x6bcb('0x11')];}else{_0x39fb85[_0x6bcb('0x12')]=_0x162d38[_0x6bcb('0xf')][_0x6bcb('0x10')][_0x6bcb('0x12')];_0x39fb85[_0x6bcb('0x13')]=_0x162d38[_0x6bcb('0xf')]['Smtp'][_0x6bcb('0x13')];_0x39fb85[_0x6bcb('0x14')]=_0x162d38['MailAccount'][_0x6bcb('0x10')][_0x6bcb('0x14')];}if(_0x162d38[_0x6bcb('0xf')]['Smtp'][_0x6bcb('0x15')]){_0x39fb85[_0x6bcb('0x16')]={'user':_0x162d38[_0x6bcb('0xf')][_0x6bcb('0x10')][_0x6bcb('0x17')],'pass':_0x162d38[_0x6bcb('0xf')]['Smtp'][_0x6bcb('0x18')]};}var _0x41c832={'account':_0x39fb85,'message':{'from':util['format'](_0x6bcb('0x19'),_0x162d38[_0x6bcb('0xf')][_0x6bcb('0x1a')],_0x162d38['MailAccount'][_0x6bcb('0xe')]||_0x162d38[_0x6bcb('0xf')][_0x6bcb('0x10')]['user']),'to':_0x162d38[_0x6bcb('0xe')],'cc':_0x162d38['cc'],'bcc':_0x162d38[_0x6bcb('0x1b')],'subject':util[_0x6bcb('0x1c')](_0x6bcb('0x1d'),_0x530f85[_0x6bcb('0x1a')],_0x162d38[_0x6bcb('0x1e')],_0x162d38[_0x6bcb('0x1f')])}};var _0x48097e=path[_0x6bcb('0x20')](__dirname,_0x6bcb('0x21'));var _0x51b122=_0x530f85[_0x6bcb('0x22')];var _0x30a21c=util[_0x6bcb('0x1c')](_0x6bcb('0x23'),path[_0x6bcb('0x24')](_0x530f85['savename'],path[_0x6bcb('0x25')](_0x530f85[_0x6bcb('0x22')])),_0x6bcb('0x26'));var _0x3f0057=path[_0x6bcb('0x20')](_0x48097e,_0x51b122);var _0x19e993=path[_0x6bcb('0x20')](_0x48097e,_0x30a21c);if(fs[_0x6bcb('0x27')](_0x3f0057)){_0x530f85[_0x6bcb('0x28')]='Sent';_0x41c832[_0x6bcb('0x29')][_0x6bcb('0x2a')]=[{'filename':_0x51b122,'path':_0x3f0057}];_0x41c832['message'][_0x6bcb('0x2b')]=util[_0x6bcb('0x1c')](_0x6bcb('0x2c'),JSON[_0x6bcb('0x2d')](_0x530f85,null,0x2));}else if(fs[_0x6bcb('0x27')](_0x19e993)){_0x530f85[_0x6bcb('0x28')]='Sent';_0x41c832[_0x6bcb('0x29')][_0x6bcb('0x2a')]=[{'filename':_0x30a21c,'path':_0x19e993}];}else{_0x41c832['message']['text']='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x162d38[_0x6bcb('0x2e')]){_0x215eff=![];logger['info'](_0x6bcb('0x2f'));}}if(_0x215eff){return client['request']('SendMail',_0x41c832)[_0x6bcb('0x30')](function(_0x263ac8){if(_0x263ac8['error']){return logger[_0x6bcb('0x31')](_0x6bcb('0x32'),JSON['stringify'](_0x263ac8));}return logger[_0x6bcb('0xc')](_0x6bcb('0x33'));})[_0x6bcb('0x34')](function(_0x133dee){return logger[_0x6bcb('0x31')](_0x6bcb('0x32'),JSON[_0x6bcb('0x2d')](_0x133dee));});}};}function handleError(){return function(_0x2b9d0f){return logger[_0x6bcb('0x31')](JSON['stringify'](_0x2b9d0f));};}function handleResult(_0x218d9e){return function(_0x1c6a21){logger['info'](_0x6bcb('0x35'),JSON[_0x6bcb('0x2d')](_0x1c6a21));if(_0x218d9e[_0x6bcb('0xf')]&&_0x218d9e[_0x6bcb('0xf')]['Smtp']&&!_[_0x6bcb('0x36')](_0x218d9e['email'])){setTimeout(handleSendEmail(_0x218d9e,_0x1c6a21),0x3c*0x3e8);}};}function handleJob(_0x3ccbf2){return function(){try{if(_['isNil'](_0x3ccbf2[_0x6bcb('0x1e')])){return logger[_0x6bcb('0xc')](_0x6bcb('0x37'));}if(_[_0x6bcb('0x36')](_0x3ccbf2[_0x6bcb('0x1f')])){return logger['info']('subtractUnit\x20null\x20or\x20undefined');}var _0x55dc78={'startDate':moment()[_0x6bcb('0x38')](_0x3ccbf2[_0x6bcb('0x1e')],_0x3ccbf2['subtractUnit'])['format'](_0x6bcb('0x39')),'endDate':moment()[_0x6bcb('0x1c')](_0x6bcb('0x39')),'type':_0x6bcb('0x3a'),'output':_0x3ccbf2[_0x6bcb('0x3b')],'name':_0x3ccbf2[_0x6bcb('0x1a')]};if(!_['isNil'](_0x3ccbf2['DefaultReportId'])){logger[_0x6bcb('0xc')](_0x6bcb('0x3c'),_0x3ccbf2['DefaultReportId']);return analyticDefaultReportController['runReport']({'id':_0x3ccbf2[_0x6bcb('0x3d')]},_0x55dc78)[_0x6bcb('0x30')](handleResult(_0x3ccbf2))[_0x6bcb('0x34')](handleError());}if(!_[_0x6bcb('0x36')](_0x3ccbf2[_0x6bcb('0x3e')])){logger[_0x6bcb('0xc')](_0x6bcb('0x3f'),_0x3ccbf2['CustomReportId']);return analyticCustomReportController[_0x6bcb('0x40')]({'id':_0x3ccbf2[_0x6bcb('0x3e')]},_0x55dc78)[_0x6bcb('0x30')](handleResult(_0x3ccbf2))[_0x6bcb('0x34')](handleError());}}catch(_0x8ac23f){logger[_0x6bcb('0x31')](JSON[_0x6bcb('0x2d')](_0x8ac23f));}return logger['info'](_0x6bcb('0x41'));};}function getJobs(_0x8e087a){var _0x480a93={};if(_0x8e087a){_0x480a93['id']=_0x8e087a;}return db[_0x6bcb('0x42')][_0x6bcb('0x43')]({'where':_0x480a93,'include':[{'model':db[_0x6bcb('0xf')],'attributes':['id',_0x6bcb('0x1a'),_0x6bcb('0xe')],'include':[{'model':db[_0x6bcb('0x44')],'as':_0x6bcb('0x10')}]}]})[_0x6bcb('0x30')](function(_0x2027c6){var _0xdd7a7c=_[_0x6bcb('0x45')](manager['jobs']);var _0x452c7f=_[_0x6bcb('0x46')](_0x2027c6,function(_0x30c5de){return _0x30c5de['id'][_0x6bcb('0x47')]();});var _0xa911b2=_[_0x6bcb('0x48')](_0x2027c6,function(_0x1fb5a1){return _0x1fb5a1['id'][_0x6bcb('0x47')]();});var _0x331f18=_0x8e087a?_0x452c7f:_[_0x6bcb('0x49')](_0x452c7f,_0xdd7a7c);var _0x16b846=_[_0x6bcb('0x4a')](_0x452c7f,_0xdd7a7c);var _0x3898ef=_[_0x6bcb('0x49')](_0xdd7a7c,_0x452c7f);var _0x17330a;var _0x1cbca1;for(_0x17330a=0x0;_0x17330a<_0x3898ef[_0x6bcb('0x4b')]&&!_0x8e087a;_0x17330a+=0x1){_0x1cbca1=_0x3898ef[_0x17330a]['toString']();if(manager[_0x6bcb('0x4c')](_0x1cbca1)){manager[_0x6bcb('0x4d')](_0x1cbca1);manager[_0x6bcb('0x4e')](_0x1cbca1);logger[_0x6bcb('0xc')]('delete\x20cron',_0x1cbca1);}}logger[_0x6bcb('0xc')](_0x6bcb('0x4f'),JSON[_0x6bcb('0x2d')](_0x331f18));for(_0x17330a=0x0;_0x17330a<_0x331f18[_0x6bcb('0x4b')];_0x17330a+=0x1){_0x1cbca1=_0x331f18[_0x17330a]['toString']();logger[_0x6bcb('0xc')]('index',_0x1cbca1);if(_0x8e087a){logger[_0x6bcb('0xc')](_0x6bcb('0x50'),_0x8e087a);logger[_0x6bcb('0xc')](JSON['stringify'](_0xa911b2[_0x1cbca1]));BPromise['resolve']()['then'](handleJob(_0xa911b2[_0x1cbca1]));logger[_0x6bcb('0xc')]('run\x20job',_0xa911b2[_0x1cbca1][_0x6bcb('0x1a')],_0xa911b2[_0x1cbca1][_0x6bcb('0x51')]);}else if(_0xa911b2[_0x1cbca1][_0x6bcb('0x51')]&&_0xa911b2[_0x1cbca1][_0x6bcb('0x52')]&&moment()[_0x6bcb('0x53')](_0xa911b2[_0x1cbca1][_0x6bcb('0x54')],_0xa911b2[_0x1cbca1][_0x6bcb('0x55')])){manager['add'](_0x1cbca1,_0xa911b2[_0x1cbca1][_0x6bcb('0x51')],handleJob(_0xa911b2[_0x1cbca1]));manager[_0x6bcb('0x56')](_0x1cbca1);logger[_0x6bcb('0xc')](_0x6bcb('0x57'),_0xa911b2[_0x1cbca1][_0x6bcb('0x1a')],_0xa911b2[_0x1cbca1][_0x6bcb('0x51')]);}else if(manager[_0x6bcb('0x4c')](_0x1cbca1)){manager[_0x6bcb('0x4d')](_0x1cbca1);manager[_0x6bcb('0x4e')](_0x1cbca1);logger[_0x6bcb('0xc')](_0x6bcb('0x58'),_0xa911b2[_0x1cbca1][_0x6bcb('0x1a')],_0xa911b2[_0x1cbca1][_0x6bcb('0x51')]);}}for(_0x17330a=0x0,_0x1cbca1;_0x17330a<_0x16b846[_0x6bcb('0x4b')]&&!_0x8e087a;_0x17330a+=0x1){_0x1cbca1=_0x16b846[_0x17330a][_0x6bcb('0x47')]();if(manager[_0x6bcb('0x4c')](_0x1cbca1)){if(_0xa911b2[_0x1cbca1][_0x6bcb('0x51')]&&_0xa911b2[_0x1cbca1][_0x6bcb('0x52')]&&moment()[_0x6bcb('0x53')](_0xa911b2[_0x1cbca1][_0x6bcb('0x54')],_0xa911b2[_0x1cbca1][_0x6bcb('0x55')])){manager[_0x6bcb('0x59')](_0x1cbca1,_0xa911b2[_0x1cbca1][_0x6bcb('0x51')],handleJob(_0xa911b2[_0x1cbca1]));logger[_0x6bcb('0xc')](_0x6bcb('0x5a'),_0xa911b2[_0x1cbca1]['name'],_0xa911b2[_0x1cbca1][_0x6bcb('0x51')]);}else{manager[_0x6bcb('0x4d')](_0x1cbca1);manager[_0x6bcb('0x4e')](_0x1cbca1);logger[_0x6bcb('0xc')](_0x6bcb('0x58'),_0xa911b2[_0x1cbca1]['name'],_0xa911b2[_0x1cbca1][_0x6bcb('0x51')]);}}}})[_0x6bcb('0x34')](function(_0xa8c2fd){logger[_0x6bcb('0x31')](JSON[_0x6bcb('0x2d')](_0xa8c2fd));});}exports['run']=function(_0x191b4b){return getJobs(_0x191b4b);};exports[_0x6bcb('0x56')]=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 6a92c3c..0cf2bc5 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 _0x2bb0=['Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','language','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','Sentiment\x20Analysis\x20not\x20requested','findOne','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','forEach','push','start','lodash','aws-sdk','request-promise','bluebird','transcribe','TranscribeService','Comprehend','detectSentiment','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data1','data2','transcribeRegion','transcribeName','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','TranscriptFileUri','format','Transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','ValidationError','sentiment','sentimentAccountId','sentimentRegion','bucket','Sequelize','Transcript\x20not\x20available'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x2bb0,0xf3));var _0x02bb=function(_0xdda3db,_0x624166){_0xdda3db=_0xdda3db-0x0;var _0x441fa8=_0x2bb0[_0xdda3db];return _0x441fa8;};var _=require(_0x02bb('0x0'));var AWS=require(_0x02bb('0x1'));var rp=require(_0x02bb('0x2'));var util=require('util');var BPromise=require(_0x02bb('0x3'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0x02bb('0x4'));function getTranscriptionJob(_0x500cd1,_0x1dff97,_0xe8fdaa,_0x8e4057){return new Promise(function(_0x390ff7,_0x43dbb7){var _0x16bb7c=new AWS[(_0x02bb('0x5'))]({'accessKeyId':_0x1dff97,'secretAccessKey':_0x500cd1,'region':_0xe8fdaa});_0x16bb7c['getTranscriptionJob']({'TranscriptionJobName':_0x8e4057},function(_0x6d064a,_0x15e425){if(_0x6d064a){return _0x43dbb7(_0x6d064a);}else{return _0x390ff7(_0x15e425);}});});}function sentiment(_0x23f816,_0x4c5124,_0x3d28d5,_0x5a4a7f,_0x3edabe){return new Promise(function(_0x1863ec,_0x4d3418){var _0x3f861e=new AWS[(_0x02bb('0x6'))]({'accessKeyId':_0x4c5124,'secretAccessKey':_0x23f816,'region':_0x3d28d5});_0x3f861e[_0x02bb('0x7')]({'Text':_0x5a4a7f,'LanguageCode':_0x3edabe['substring'](0x0,0x2)},function(_0x2de7a2,_0x4e409d){if(_0x2de7a2){return _0x4d3418(_0x2de7a2);}else{return _0x1863ec(_0x4e409d);}});});}function checkTranscribeJob(_0x3fa733,_0x294078,_0x1079f9){var _0x5c8728;return new BPromise(function(_0x16330c,_0x40c5d0){logger[_0x02bb('0x8')](util['format'](_0x02bb('0x9'),_0x3fa733['id'],_0x3fa733['transcribeName']));return getTranscriptionJob(_0x1079f9[_0x02bb('0xa')],_0x1079f9[_0x02bb('0xb')],_0x294078[_0x02bb('0xc')],_0x3fa733[_0x02bb('0xd')])[_0x02bb('0xe')](function(_0x224e90){logger['info'](util['format'](_0x02bb('0xf'),_0x3fa733['id'],_0x3fa733[_0x02bb('0xd')],_0x224e90[_0x02bb('0x10')][_0x02bb('0x11')]));if(!_0x3fa733[_0x02bb('0x12')]){switch(_0x224e90[_0x02bb('0x10')]['TranscriptionJobStatus']){case _0x02bb('0x13'):var _0x4b3f78={'transcribeStatus':_0x224e90[_0x02bb('0x10')][_0x02bb('0x11')],'fileUri':_0x224e90[_0x02bb('0x10')]['Transcript'][_0x02bb('0x14')]};logger[_0x02bb('0x8')](util[_0x02bb('0x15')]('[RECORDING:%d]\x20Get\x20transcript',_0x3fa733['id']));return rp({'uri':_0x224e90[_0x02bb('0x10')][_0x02bb('0x16')]['TranscriptFileUri'],'json':!![]})[_0x02bb('0xe')](function(_0x4b9b16){logger[_0x02bb('0x8')](util[_0x02bb('0x15')](_0x02bb('0x17'),_0x3fa733['id']));if(_0x4b9b16&&_0x4b9b16[_0x02bb('0x18')]&&_0x4b9b16[_0x02bb('0x18')][_0x02bb('0x19')]&&_0x4b9b16[_0x02bb('0x18')]['transcripts']['length']){_0x4b3f78[_0x02bb('0x12')]='';for(var _0x5ac511=0x0;_0x5ac511<_0x4b9b16[_0x02bb('0x18')][_0x02bb('0x19')][_0x02bb('0x1a')];_0x5ac511++){_0x4b3f78['fileText']+=_0x4b9b16[_0x02bb('0x18')][_0x02bb('0x19')][_0x5ac511]['transcript']+'';}}return _0x3fa733[_0x02bb('0x1b')](_0x4b3f78);})[_0x02bb('0xe')](function(){logger[_0x02bb('0x8')](util[_0x02bb('0x15')](_0x02bb('0x1c'),_0x3fa733['id']));if(!_0x3fa733[_0x02bb('0x1d')]){throw new db['Sequelize'][(_0x02bb('0x1e'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x294078[_0x02bb('0x1f')]||!_0x294078[_0x02bb('0x20')]||!_0x294078[_0x02bb('0x21')]||!_0x294078['language']||!_0x294078[_0x02bb('0x22')]){throw new db[(_0x02bb('0x23'))][(_0x02bb('0x1e'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x4b3f78[_0x02bb('0x12')]){throw new Error(_0x02bb('0x24'));}if(_0x294078[_0x02bb('0x20')]===_0x1079f9['id']){return _0x1079f9;}else{return db['CloudProvider']['findOne']({'where':{'id':_settings[_0x02bb('0x20')]}});}})['then'](function(_0x5a9014){if(!_0x5a9014){throw new db[(_0x02bb('0x23'))][(_0x02bb('0x1e'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x5a9014[_0x02bb('0xa')]||!_0x5a9014[_0x02bb('0xb')]){throw new db[(_0x02bb('0x23'))]['ValidationError'](_0x02bb('0x25'));}_0x5c8728=_0x5a9014;logger[_0x02bb('0x8')](util[_0x02bb('0x15')](_0x02bb('0x26'),_0x3fa733['id']));return sentiment(_0x5c8728[_0x02bb('0xa')],_0x5c8728[_0x02bb('0xb')],_0x294078[_0x02bb('0x21')],_0x4b3f78[_0x02bb('0x12')],_0x294078[_0x02bb('0x27')]);})[_0x02bb('0xe')](function(_0x5e1b7b){logger[_0x02bb('0x8')](util[_0x02bb('0x15')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x3fa733['id']));return _0x3fa733[_0x02bb('0x1b')]({'sentiment':_0x5e1b7b[_0x02bb('0x28')],'sPositive':_0x5e1b7b[_0x02bb('0x29')][_0x02bb('0x2a')],'sNegative':_0x5e1b7b['SentimentScore'][_0x02bb('0x2b')],'sMixed':_0x5e1b7b['SentimentScore'][_0x02bb('0x2c')],'sNeutral':_0x5e1b7b[_0x02bb('0x29')][_0x02bb('0x2d')]});})[_0x02bb('0xe')](function(){logger[_0x02bb('0x8')](util[_0x02bb('0x15')](_0x02bb('0x1c'),_0x3fa733['id']));_0x16330c();});case'FAILED':return _0x3fa733[_0x02bb('0x1b')]({'transcribeStatus':_0x02bb('0x2e'),'failureReason':_0x224e90['TranscriptionJob'][_0x02bb('0x2f')]})[_0x02bb('0xe')](function(){logger[_0x02bb('0x8')](util[_0x02bb('0x15')](_0x02bb('0x1c'),_0x3fa733['id']));_0x16330c();});default:logger[_0x02bb('0x8')](util['format'](_0x02bb('0x30'),_0x3fa733['id']));break;}}else{return BPromise['resolve']()[_0x02bb('0xe')](function(){if(!_0x3fa733[_0x02bb('0x1d')]){throw new db[(_0x02bb('0x23'))][(_0x02bb('0x1e'))](_0x02bb('0x31'));}if(!_0x294078[_0x02bb('0x1f')]||!_0x294078[_0x02bb('0x20')]||!_0x294078[_0x02bb('0x21')]||!_0x294078[_0x02bb('0x27')]||!_0x294078['bucket']){throw new db[(_0x02bb('0x23'))][(_0x02bb('0x1e'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x3fa733[_0x02bb('0x12')]){throw new Error(_0x02bb('0x24'));}if(_0x294078['sentimentAccountId']===_0x1079f9['id']){return _0x1079f9;}else{return db['CloudProvider'][_0x02bb('0x32')]({'where':{'id':_settings[_0x02bb('0x20')]}});}})[_0x02bb('0xe')](function(_0x430f3a){if(!_0x430f3a){throw new db[(_0x02bb('0x23'))][(_0x02bb('0x1e'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x430f3a[_0x02bb('0xa')]||!_0x430f3a['data2']){throw new db['Sequelize'][(_0x02bb('0x1e'))](_0x02bb('0x25'));}_0x5c8728=_0x430f3a;logger['info'](util[_0x02bb('0x15')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x3fa733['id']));return sentiment(_0x5c8728[_0x02bb('0xa')],_0x5c8728[_0x02bb('0xb')],_0x294078[_0x02bb('0x21')],_0x3fa733['fileText'],_0x294078['language']);})['then'](function(_0x51a006){logger[_0x02bb('0x8')](util[_0x02bb('0x15')](_0x02bb('0x33'),_0x3fa733['id']));return _0x3fa733['update']({'sentiment':_0x51a006[_0x02bb('0x28')],'sPositive':_0x51a006[_0x02bb('0x29')][_0x02bb('0x2a')],'sNegative':_0x51a006['SentimentScore'][_0x02bb('0x2b')],'sMixed':_0x51a006[_0x02bb('0x29')][_0x02bb('0x2c')],'sNeutral':_0x51a006[_0x02bb('0x29')][_0x02bb('0x2d')],'transcribeStatus':'COMPLETED'});})['then'](function(){logger[_0x02bb('0x8')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x3fa733['id']));_0x16330c();});}})[_0x02bb('0x34')](function(_0x11236b){if(_0x11236b){if(!_0x11236b['name']||_0x11236b[_0x02bb('0x35')]!==_0x02bb('0x36')){logger[_0x02bb('0x37')](util['format'](_0x02bb('0x38'),_0x3fa733['id']),util[_0x02bb('0x39')](_0x11236b,{'showHidden':![],'depth':null}));}}_0x16330c();});});}function checkTranscribe(){var _0x3a6e48;var _0x1ed878;var _0x14b866;return db[_0x02bb('0x3a')][_0x02bb('0x3b')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0x02bb('0xe')](function(_0x1c1070){if(!_0x1c1070||!_0x1c1070[_0x02bb('0x1a')]){throw new db[(_0x02bb('0x23'))]['ValidationError'](_0x02bb('0x3c'));}_0x3a6e48=_0x1c1070;return db[_0x02bb('0x3d')][_0x02bb('0x32')]({'where':{'id':0x1}});})[_0x02bb('0xe')](function(_0x1f3c06){if(!_0x1f3c06){throw new db[(_0x02bb('0x23'))][(_0x02bb('0x1e'))](_0x02bb('0x3e'));}_0x1ed878=_0x1f3c06;if(!_0x1ed878[_0x02bb('0x4')]||!_0x1ed878[_0x02bb('0x3f')]||!_0x1ed878[_0x02bb('0xc')]||!_0x1ed878['language']||!_0x1ed878[_0x02bb('0x22')]){throw new db['Sequelize'][(_0x02bb('0x1e'))](_0x02bb('0x40'));}return db[_0x02bb('0x41')][_0x02bb('0x32')]({'where':{'id':_0x1ed878[_0x02bb('0x3f')]}});})[_0x02bb('0xe')](function(_0x2ed640){if(!_0x2ed640){throw new db[(_0x02bb('0x23'))]['ValidationError'](_0x02bb('0x42'));}if(!_0x2ed640[_0x02bb('0xa')]||!_0x2ed640[_0x02bb('0xb')]){throw new db[(_0x02bb('0x23'))][(_0x02bb('0x1e'))](_0x02bb('0x25'));}_0x14b866=_0x2ed640;var _0x4f3de6=[];_0x3a6e48[_0x02bb('0x43')](function(_0x22ad38){_0x4f3de6[_0x02bb('0x44')](checkTranscribeJob(_0x22ad38,_0x1ed878,_0x14b866));});return BPromise['all'](_0x4f3de6);})[_0x02bb('0x34')](function(_0x59df6e){if(_0x59df6e){if(!_0x59df6e[_0x02bb('0x35')]||_0x59df6e[_0x02bb('0x35')]!==_0x02bb('0x36')){logger[_0x02bb('0x37')](util[_0x02bb('0x39')](_0x59df6e,{'showHidden':![],'depth':null}));}}});}exports[_0x02bb('0x45')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xd136=['inspect','VoiceRecording','findAll','No\x20transcribe\x20job\x20to\x20check','Setting','findOne','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','all','error','start','aws-sdk','request-promise','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','substring','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','info','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','results','transcripts','length','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','language','bucket','Sequelize','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','update','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','catch','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis'];(function(_0x511ff0,_0x5f7232){var _0x5ddae4=function(_0x2bc913){while(--_0x2bc913){_0x511ff0['push'](_0x511ff0['shift']());}};_0x5ddae4(++_0x5f7232);}(_0xd136,0x94));var _0x6d13=function(_0x1c8a79,_0x3ad5a2){_0x1c8a79=_0x1c8a79-0x0;var _0x4b3e97=_0xd136[_0x1c8a79];return _0x4b3e97;};var _=require('lodash');var AWS=require(_0x6d13('0x0'));var rp=require(_0x6d13('0x1'));var util=require('util');var BPromise=require(_0x6d13('0x2'));var db=require(_0x6d13('0x3'))['db'];var logger=require(_0x6d13('0x4'))(_0x6d13('0x5'));function getTranscriptionJob(_0xec09ab,_0x387947,_0x276099,_0x18fa4f){return new Promise(function(_0x147026,_0x4aabef){var _0x335482=new AWS[(_0x6d13('0x6'))]({'accessKeyId':_0x387947,'secretAccessKey':_0xec09ab,'region':_0x276099});_0x335482['getTranscriptionJob']({'TranscriptionJobName':_0x18fa4f},function(_0x598021,_0x1af16f){if(_0x598021){return _0x4aabef(_0x598021);}else{return _0x147026(_0x1af16f);}});});}function sentiment(_0x1f7d07,_0x240dba,_0x2216d7,_0x5c8282,_0x4f494b){return new Promise(function(_0x1a3613,_0x600fa9){var _0x1cf1e1=new AWS['Comprehend']({'accessKeyId':_0x240dba,'secretAccessKey':_0x1f7d07,'region':_0x2216d7});_0x1cf1e1['detectSentiment']({'Text':_0x5c8282,'LanguageCode':_0x4f494b[_0x6d13('0x7')](0x0,0x2)},function(_0x2a2120,_0x28fe97){if(_0x2a2120){return _0x600fa9(_0x2a2120);}else{return _0x1a3613(_0x28fe97);}});});}function checkTranscribeJob(_0x47d637,_0x1b4cc3,_0x5ef7e6){var _0x37d3c1;return new BPromise(function(_0x2b53e8,_0x5a07f8){logger['info'](util['format'](_0x6d13('0x8'),_0x47d637['id'],_0x47d637[_0x6d13('0x9')]));return getTranscriptionJob(_0x5ef7e6[_0x6d13('0xa')],_0x5ef7e6[_0x6d13('0xb')],_0x1b4cc3[_0x6d13('0xc')],_0x47d637['transcribeName'])[_0x6d13('0xd')](function(_0x405368){logger[_0x6d13('0xe')](util[_0x6d13('0xf')](_0x6d13('0x10'),_0x47d637['id'],_0x47d637[_0x6d13('0x9')],_0x405368[_0x6d13('0x11')][_0x6d13('0x12')]));if(!_0x47d637[_0x6d13('0x13')]){switch(_0x405368['TranscriptionJob'][_0x6d13('0x12')]){case _0x6d13('0x14'):var _0x78eef7={'transcribeStatus':_0x405368[_0x6d13('0x11')][_0x6d13('0x12')],'fileUri':_0x405368[_0x6d13('0x11')][_0x6d13('0x15')][_0x6d13('0x16')]};logger[_0x6d13('0xe')](util[_0x6d13('0xf')](_0x6d13('0x17'),_0x47d637['id']));return rp({'uri':_0x405368[_0x6d13('0x11')][_0x6d13('0x15')][_0x6d13('0x16')],'json':!![]})[_0x6d13('0xd')](function(_0x208876){logger['info'](util[_0x6d13('0xf')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x47d637['id']));if(_0x208876&&_0x208876[_0x6d13('0x18')]&&_0x208876[_0x6d13('0x18')][_0x6d13('0x19')]&&_0x208876['results'][_0x6d13('0x19')][_0x6d13('0x1a')]){_0x78eef7[_0x6d13('0x13')]='';for(var _0x4366a0=0x0;_0x4366a0<_0x208876[_0x6d13('0x18')][_0x6d13('0x19')][_0x6d13('0x1a')];_0x4366a0++){_0x78eef7[_0x6d13('0x13')]+=_0x208876['results'][_0x6d13('0x19')][_0x4366a0]['transcript']+'';}}return _0x47d637['update'](_0x78eef7);})[_0x6d13('0xd')](function(){logger['info'](util[_0x6d13('0xf')](_0x6d13('0x1b'),_0x47d637['id']));if(!_0x47d637[_0x6d13('0x1c')]){throw new db['Sequelize'][(_0x6d13('0x1d'))](_0x6d13('0x1e'));}if(!_0x1b4cc3['sentiment']||!_0x1b4cc3[_0x6d13('0x1f')]||!_0x1b4cc3[_0x6d13('0x20')]||!_0x1b4cc3[_0x6d13('0x21')]||!_0x1b4cc3[_0x6d13('0x22')]){throw new db[(_0x6d13('0x23'))][(_0x6d13('0x1d'))](_0x6d13('0x24'));}if(!_0x78eef7[_0x6d13('0x13')]){throw new Error('Transcript\x20not\x20available');}if(_0x1b4cc3[_0x6d13('0x1f')]===_0x5ef7e6['id']){return _0x5ef7e6;}else{return db[_0x6d13('0x25')]['findOne']({'where':{'id':_settings[_0x6d13('0x1f')]}});}})[_0x6d13('0xd')](function(_0x19eb67){if(!_0x19eb67){throw new db['Sequelize'][(_0x6d13('0x1d'))](_0x6d13('0x26'));}if(!_0x19eb67[_0x6d13('0xa')]||!_0x19eb67[_0x6d13('0xb')]){throw new db[(_0x6d13('0x23'))][(_0x6d13('0x1d'))](_0x6d13('0x27'));}_0x37d3c1=_0x19eb67;logger['info'](util[_0x6d13('0xf')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x47d637['id']));return sentiment(_0x37d3c1[_0x6d13('0xa')],_0x37d3c1[_0x6d13('0xb')],_0x1b4cc3[_0x6d13('0x20')],_0x78eef7[_0x6d13('0x13')],_0x1b4cc3[_0x6d13('0x21')]);})[_0x6d13('0xd')](function(_0x4d7223){logger['info'](util[_0x6d13('0xf')](_0x6d13('0x28'),_0x47d637['id']));return _0x47d637[_0x6d13('0x29')]({'sentiment':_0x4d7223[_0x6d13('0x2a')],'sPositive':_0x4d7223[_0x6d13('0x2b')][_0x6d13('0x2c')],'sNegative':_0x4d7223['SentimentScore'][_0x6d13('0x2d')],'sMixed':_0x4d7223[_0x6d13('0x2b')][_0x6d13('0x2e')],'sNeutral':_0x4d7223[_0x6d13('0x2b')][_0x6d13('0x2f')]});})[_0x6d13('0xd')](function(){logger[_0x6d13('0xe')](util[_0x6d13('0xf')](_0x6d13('0x1b'),_0x47d637['id']));_0x2b53e8();});case _0x6d13('0x30'):return _0x47d637['update']({'transcribeStatus':'FAILED','failureReason':_0x405368[_0x6d13('0x11')]['FailureReason']})['then'](function(){logger[_0x6d13('0xe')](util[_0x6d13('0xf')](_0x6d13('0x1b'),_0x47d637['id']));_0x2b53e8();});default:logger['info'](util[_0x6d13('0xf')](_0x6d13('0x31'),_0x47d637['id']));break;}}else{return BPromise[_0x6d13('0x32')]()['then'](function(){if(!_0x47d637[_0x6d13('0x1c')]){throw new db['Sequelize'][(_0x6d13('0x1d'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x1b4cc3['sentiment']||!_0x1b4cc3[_0x6d13('0x1f')]||!_0x1b4cc3[_0x6d13('0x20')]||!_0x1b4cc3['language']||!_0x1b4cc3['bucket']){throw new db[(_0x6d13('0x23'))][(_0x6d13('0x1d'))](_0x6d13('0x24'));}if(!_0x47d637[_0x6d13('0x13')]){throw new Error('Transcript\x20not\x20available');}if(_0x1b4cc3[_0x6d13('0x1f')]===_0x5ef7e6['id']){return _0x5ef7e6;}else{return db[_0x6d13('0x25')]['findOne']({'where':{'id':_settings[_0x6d13('0x1f')]}});}})[_0x6d13('0xd')](function(_0x42a347){if(!_0x42a347){throw new db[(_0x6d13('0x23'))][(_0x6d13('0x1d'))](_0x6d13('0x26'));}if(!_0x42a347[_0x6d13('0xa')]||!_0x42a347['data2']){throw new db[(_0x6d13('0x23'))][(_0x6d13('0x1d'))](_0x6d13('0x27'));}_0x37d3c1=_0x42a347;logger[_0x6d13('0xe')](util[_0x6d13('0xf')](_0x6d13('0x33'),_0x47d637['id']));return sentiment(_0x37d3c1[_0x6d13('0xa')],_0x37d3c1['data2'],_0x1b4cc3[_0x6d13('0x20')],_0x47d637['fileText'],_0x1b4cc3[_0x6d13('0x21')]);})[_0x6d13('0xd')](function(_0x223b03){logger[_0x6d13('0xe')](util[_0x6d13('0xf')](_0x6d13('0x28'),_0x47d637['id']));return _0x47d637[_0x6d13('0x29')]({'sentiment':_0x223b03[_0x6d13('0x2a')],'sPositive':_0x223b03['SentimentScore'][_0x6d13('0x2c')],'sNegative':_0x223b03['SentimentScore'][_0x6d13('0x2d')],'sMixed':_0x223b03[_0x6d13('0x2b')][_0x6d13('0x2e')],'sNeutral':_0x223b03[_0x6d13('0x2b')][_0x6d13('0x2f')],'transcribeStatus':_0x6d13('0x14')});})[_0x6d13('0xd')](function(){logger[_0x6d13('0xe')](util[_0x6d13('0xf')](_0x6d13('0x1b'),_0x47d637['id']));_0x2b53e8();});}})[_0x6d13('0x34')](function(_0x479b50){if(_0x479b50){if(!_0x479b50[_0x6d13('0x35')]||_0x479b50[_0x6d13('0x35')]!==_0x6d13('0x36')){logger['error'](util['format'](_0x6d13('0x37'),_0x47d637['id']),util[_0x6d13('0x38')](_0x479b50,{'showHidden':![],'depth':null}));}}_0x2b53e8();});});}function checkTranscribe(){var _0x2492b5;var _0x5b00c6;var _0x3ac978;return db[_0x6d13('0x39')][_0x6d13('0x3a')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0x6d13('0xd')](function(_0x122adb){if(!_0x122adb||!_0x122adb['length']){throw new db['Sequelize'][(_0x6d13('0x1d'))](_0x6d13('0x3b'));}_0x2492b5=_0x122adb;return db[_0x6d13('0x3c')][_0x6d13('0x3d')]({'where':{'id':0x1}});})[_0x6d13('0xd')](function(_0x3d3244){if(!_0x3d3244){throw new db['Sequelize']['ValidationError'](_0x6d13('0x3e'));}_0x5b00c6=_0x3d3244;if(!_0x5b00c6[_0x6d13('0x5')]||!_0x5b00c6[_0x6d13('0x3f')]||!_0x5b00c6[_0x6d13('0xc')]||!_0x5b00c6[_0x6d13('0x21')]||!_0x5b00c6['bucket']){throw new db[(_0x6d13('0x23'))]['ValidationError'](_0x6d13('0x40'));}return db[_0x6d13('0x25')][_0x6d13('0x3d')]({'where':{'id':_0x5b00c6['transcribeAccountId']}});})[_0x6d13('0xd')](function(_0x53854e){if(!_0x53854e){throw new db['Sequelize'][(_0x6d13('0x1d'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x53854e[_0x6d13('0xa')]||!_0x53854e['data2']){throw new db[(_0x6d13('0x23'))]['ValidationError'](_0x6d13('0x27'));}_0x3ac978=_0x53854e;var _0x42f131=[];_0x2492b5['forEach'](function(_0x95e9c6){_0x42f131['push'](checkTranscribeJob(_0x95e9c6,_0x5b00c6,_0x3ac978));});return BPromise[_0x6d13('0x41')](_0x42f131);})[_0x6d13('0x34')](function(_0x2daf24){if(_0x2daf24){if(!_0x2daf24[_0x6d13('0x35')]||_0x2daf24['name']!==_0x6d13('0x36')){logger[_0x6d13('0x42')](util[_0x6d13('0x38')](_0x2daf24,{'showHidden':![],'depth':null}));}}});}exports[_0x6d13('0x43')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index bcfe98c..0dbb442 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 _0xa00e=['defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','then','length','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','format','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','lodash','ioredis','util','../../config/environment','../logger','schedule','redis'];(function(_0x4f5bfb,_0x455bf1){var _0x396a42=function(_0x4284be){while(--_0x4284be){_0x4f5bfb['push'](_0x4f5bfb['shift']());}};_0x396a42(++_0x455bf1);}(_0xa00e,0x161));var _0xea00=function(_0x13c8c8,_0x596ea4){_0x13c8c8=_0x13c8c8-0x0;var _0x224535=_0xa00e[_0x13c8c8];return _0x224535;};'use strict';var _=require(_0xea00('0x0'));var moment=require('moment');var Redis=require(_0xea00('0x1'));var util=require(_0xea00('0x2'));var config=require(_0xea00('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0xea00('0x4'))(_0xea00('0x5'));config[_0xea00('0x6')]=_[_0xea00('0x7')](config[_0xea00('0x6')],{'host':_0xea00('0x8'),'port':0x18eb});var io=require(_0xea00('0x9'))(new Redis(config[_0xea00('0x6')]));function closeInteractions(){var _0x58c6f7=[];return db[_0xea00('0xa')][_0xea00('0xb')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,'hours')}}})[_0xea00('0xc')](function(_0x4535ed){if(_0x4535ed&&_0x4535ed[_0xea00('0xd')]){_0x58c6f7=_['map'](_0x4535ed||[],'id');logger['info'](_0xea00('0xe'),_0x58c6f7[_0xea00('0xf')]());return db[_0xea00('0xa')][_0xea00('0x10')]({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0xea00('0x11')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x58c6f7}});}})['then'](function(){if(_0x58c6f7&&_0x58c6f7[_0xea00('0xd')]){logger['info'](_0xea00('0x12'),_0x58c6f7[_0xea00('0xf')]());for(var _0x5d77e6=0x0;_0x5d77e6<_0x58c6f7[_0xea00('0xd')];_0x5d77e6++){io[_0xea00('0x13')](_0xea00('0x14'),{'id':_0x58c6f7[_0x5d77e6],'closed':!![]});}}})[_0xea00('0x15')](function(_0x5b3f18){logger['error'](_0xea00('0x16'),_0x5b3f18?util[_0xea00('0x17')](_0x5b3f18,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xe41f=['format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','redis','localhost','socket.io-emitter','WhatsappInteraction','findAll','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','system'];(function(_0x564c74,_0x504669){var _0xb815a3=function(_0x37cc39){while(--_0x37cc39){_0x564c74['push'](_0x564c74['shift']());}};_0xb815a3(++_0x504669);}(_0xe41f,0xb7));var _0xfe41=function(_0x4245ae,_0x594e15){_0x4245ae=_0x4245ae-0x0;var _0x2b2f79=_0xe41f[_0x4245ae];return _0x2b2f79;};'use strict';var _=require(_0xfe41('0x0'));var moment=require(_0xfe41('0x1'));var Redis=require(_0xfe41('0x2'));var util=require(_0xfe41('0x3'));var config=require(_0xfe41('0x4'));var db=require(_0xfe41('0x5'))['db'];var logger=require(_0xfe41('0x6'))('schedule');config[_0xfe41('0x7')]=_['defaults'](config['redis'],{'host':_0xfe41('0x8'),'port':0x18eb});var io=require(_0xfe41('0x9'))(new Redis(config[_0xfe41('0x7')]));function closeInteractions(){var _0x3b5aa2=[];return db[_0xfe41('0xa')][_0xfe41('0xb')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0xfe41('0xc'))}}})[_0xfe41('0xd')](function(_0x1f1d8b){if(_0x1f1d8b&&_0x1f1d8b[_0xfe41('0xe')]){_0x3b5aa2=_[_0xfe41('0xf')](_0x1f1d8b||[],'id');logger[_0xfe41('0x10')](_0xfe41('0x11'),_0x3b5aa2[_0xfe41('0x12')]());return db[_0xfe41('0xa')]['update']({'closeReason':_0xfe41('0x13'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0xfe41('0x14')](_0xfe41('0x15'))},{'where':{'id':_0x3b5aa2}});}})[_0xfe41('0xd')](function(){if(_0x3b5aa2&&_0x3b5aa2[_0xfe41('0xe')]){logger[_0xfe41('0x10')](_0xfe41('0x16'),_0x3b5aa2[_0xfe41('0x12')]());for(var _0x4739bc=0x0;_0x4739bc<_0x3b5aa2[_0xfe41('0xe')];_0x4739bc++){io[_0xfe41('0x17')](_0xfe41('0x18'),{'id':_0x3b5aa2[_0x4739bc],'closed':!![]});}}})[_0xfe41('0x19')](function(_0x1bb69a){logger[_0xfe41('0x1a')](_0xfe41('0x1b'),_0x1bb69a?util[_0xfe41('0x1c')](_0x1bb69a,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index e5ea9b3..f5be37c 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb61a=['now','Innocenzo','CmContact','destroy','bulkCreate','then','log','finished\x20populating','contacts1','hopper1','contacts2','CmHopper','../mysqldb','push','Biondo','innocenzo.biondo','@xcally.com'];(function(_0x2d1d3f,_0xc53e18){var _0x5ee450=function(_0x5885f7){while(--_0x5885f7){_0x2d1d3f['push'](_0x2d1d3f['shift']());}};_0x5ee450(++_0xc53e18);}(_0xb61a,0x10b));var _0xab61=function(_0x424c4d,_0x3a3937){_0x424c4d=_0x424c4d-0x0;var _0x4c7b2c=_0xb61a[_0x424c4d];return _0x4c7b2c;};'use strict';var util=require('util');var db=require(_0xab61('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xab61('0x1')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xab61('0x2')+i,'phone':0xf879fb460+i,'email':_0xab61('0x3')+i+_0xab61('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xab61('0x1')]({'id':i,'active':![],'scheduledat':Date[_0xab61('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xab61('0x5')](),'updatedAt':Date[_0xab61('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xab61('0x1')]({'id':i,'firstName':_0xab61('0x6')+i,'lastName':_0xab61('0x2')+i,'phone':0xf879fb460+i,'email':_0xab61('0x3')+i+_0xab61('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0xab61('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xab61('0x5')](),'updatedAt':Date[_0xab61('0x5')]()});}db[_0xab61('0x7')][_0xab61('0x8')]({'where':{}})['then'](function(){return db[_0xab61('0x7')][_0xab61('0x9')](contacts);})[_0xab61('0xa')](function(){console[_0xab61('0xb')](_0xab61('0xc'),_0xab61('0xd'));return db['CmHopper'][_0xab61('0x8')]({'where':{}});})['then'](function(){return db['CmHopper'][_0xab61('0x9')](hopper);})[_0xab61('0xa')](function(){console[_0xab61('0xb')](_0xab61('0xc'),_0xab61('0xe'));return db[_0xab61('0x7')][_0xab61('0x9')](contacts2);})[_0xab61('0xa')](function(){console['log'](_0xab61('0xc'),_0xab61('0xf'));return db[_0xab61('0x10')][_0xab61('0x9')](hopper2);})['then'](function(){console[_0xab61('0xb')](_0xab61('0xc'),'hopper2');})['catch'](function(_0x2185cb){console[_0xab61('0xb')](_0x2185cb);}); \ No newline at end of file +var _0x828b=['CmContact','destroy','then','finished\x20populating','contacts1','CmHopper','bulkCreate','hopper1','log','contacts2','hopper2','util','../mysqldb','push','Biondo','innocenzo.biondo','@xcally.com','now','Innocenzo'];(function(_0x388e15,_0x45b424){var _0x476c16=function(_0x2926e0){while(--_0x2926e0){_0x388e15['push'](_0x388e15['shift']());}};_0x476c16(++_0x45b424);}(_0x828b,0x161));var _0xb828=function(_0x54da5b,_0x12fd71){_0x54da5b=_0x54da5b-0x0;var _0x285d3b=_0x828b[_0x54da5b];return _0x285d3b;};'use strict';var util=require(_0xb828('0x0'));var db=require(_0xb828('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xb828('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xb828('0x3')+i,'phone':0xf879fb460+i,'email':_0xb828('0x4')+i+_0xb828('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xb828('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xb828('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xb828('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xb828('0x2')]({'id':i,'firstName':_0xb828('0x7')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xb828('0x4')+i+_0xb828('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xb828('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xb828('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}db[_0xb828('0x8')][_0xb828('0x9')]({'where':{}})['then'](function(){return db[_0xb828('0x8')]['bulkCreate'](contacts);})[_0xb828('0xa')](function(){console['log'](_0xb828('0xb'),_0xb828('0xc'));return db[_0xb828('0xd')]['destroy']({'where':{}});})[_0xb828('0xa')](function(){return db[_0xb828('0xd')][_0xb828('0xe')](hopper);})['then'](function(){console['log']('finished\x20populating',_0xb828('0xf'));return db['CmContact']['bulkCreate'](contacts2);})[_0xb828('0xa')](function(){console[_0xb828('0x10')](_0xb828('0xb'),_0xb828('0x11'));return db[_0xb828('0xd')][_0xb828('0xe')](hopper2);})[_0xb828('0xa')](function(){console[_0xb828('0x10')](_0xb828('0xb'),_0xb828('0x12'));})['catch'](function(_0x2075c5){console[_0xb828('0x10')](_0x2075c5);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 589bbe4..24f8d54 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1266=['yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','User','bulkCreate','log','add\x20user','catch','util','../mysqldb','push','format','%s%s','agent','password','friend','udp','wss','all'];(function(_0x224436,_0x13088b){var _0x3c694a=function(_0x5b9648){while(--_0x5b9648){_0x224436['push'](_0x224436['shift']());}};_0x3c694a(++_0x13088b);}(_0x1266,0x8d));var _0x6126=function(_0x158194,_0x346941){_0x158194=_0x158194-0x0;var _0x8f045c=_0x1266[_0x158194];return _0x8f045c;};'use strict';var util=require(_0x6126('0x0'));var db=require(_0x6126('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x6126('0x2')]({'name':util[_0x6126('0x3')](_0x6126('0x4'),'agent',i),'fullname':util[_0x6126('0x3')](_0x6126('0x4'),_0x6126('0x5'),i),'email':util[_0x6126('0x3')]('%s%s@xcally.com',_0x6126('0x5'),i),'role':_0x6126('0x5'),'password':_0x6126('0x6'),'internal':0xfa0+i,'type':_0x6126('0x7'),'transport':[_0x6126('0x8'),'ws',_0x6126('0x9')],'disallow':[_0x6126('0xa')],'allow':['ulaw'],'defaultuser':util[_0x6126('0x3')](_0x6126('0x4'),_0x6126('0x5'),i),'encryption':_0x6126('0xb'),'avpf':'yes','force_avp':_0x6126('0xb'),'icesupport':_0x6126('0xb'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x6126('0xc'),'dtlsprivatekey':_0x6126('0xd'),'dtlssetup':'actpass','callerid':util[_0x6126('0x3')]('\x22%s\x22\x20<%s>',util[_0x6126('0x3')](_0x6126('0x4'),_0x6126('0x5'),i),0xfa0+i)});}db[_0x6126('0xe')][_0x6126('0xf')](users)['then'](function(){console[_0x6126('0x10')](_0x6126('0x11'));})[_0x6126('0x12')](function(_0x1a9bab){console['log'](_0x1a9bab);}); \ No newline at end of file +var _0xdfe8=['push','format','agent','%s%s','%s%s@xcally.com','password','wss','all','yes','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','then','log','add\x20user','catch'];(function(_0x5f4d0a,_0x214e68){var _0x1b8c80=function(_0x54d74c){while(--_0x54d74c){_0x5f4d0a['push'](_0x5f4d0a['shift']());}};_0x1b8c80(++_0x214e68);}(_0xdfe8,0x69));var _0x8dfe=function(_0x297eea,_0x5060be){_0x297eea=_0x297eea-0x0;var _0x1c42d2=_0xdfe8[_0x297eea];return _0x1c42d2;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x8dfe('0x0')]({'name':util[_0x8dfe('0x1')]('%s%s',_0x8dfe('0x2'),i),'fullname':util[_0x8dfe('0x1')](_0x8dfe('0x3'),_0x8dfe('0x2'),i),'email':util['format'](_0x8dfe('0x4'),_0x8dfe('0x2'),i),'role':_0x8dfe('0x2'),'password':_0x8dfe('0x5'),'internal':0xfa0+i,'type':'friend','transport':['udp','ws',_0x8dfe('0x6')],'disallow':[_0x8dfe('0x7')],'allow':['ulaw'],'defaultuser':util[_0x8dfe('0x1')](_0x8dfe('0x3'),'agent',i),'encryption':'yes','avpf':_0x8dfe('0x8'),'force_avp':_0x8dfe('0x8'),'icesupport':'yes','dtlsenable':_0x8dfe('0x8'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x8dfe('0x9'),'dtlssetup':'actpass','callerid':util['format'](_0x8dfe('0xa'),util['format'](_0x8dfe('0x3'),'agent',i),0xfa0+i)});}db['User']['bulkCreate'](users)[_0x8dfe('0xb')](function(){console[_0x8dfe('0xc')](_0x8dfe('0xd'));})[_0x8dfe('0xe')](function(_0x190f72){console[_0x8dfe('0xc')](_0x190f72);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 57b7cdf..818fd81 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7f0=['connectedAt','log','SocketIO\x20','nsp','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','Agents','User','name','role','agent','telephone','type','ivr','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','then','map','Campaign','where','format','user:%s','handshake','find','query','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','admin','voice:inbound','voice:outbound','include','VoiceQueue','push','ChatQueue','FaxQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','userProfileId','SmsQueue','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','length','chat','fax','mail','openchannel','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','user_has_chat_interactions:remove','emit','user_has_mail_interactions:remove','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','WhatsappInteractions','removeWhatsappInteractions','catch','default','connection','address','request','remotePort'];(function(_0x77a4b3,_0x5c8dfc){var _0x170299=function(_0x2a0fcd){while(--_0x2a0fcd){_0x77a4b3['push'](_0x77a4b3['shift']());}};_0x170299(++_0x5c8dfc);}(_0xb7f0,0x1eb));var _0x0b7f=function(_0x264ca3,_0x65b645){_0x264ca3=_0x264ca3-0x0;var _0x156d1e=_0xb7f0[_0x264ca3];return _0x156d1e;};'use strict';var _=require(_0x0b7f('0x0'));var util=require(_0x0b7f('0x1'));var BPromise=require(_0x0b7f('0x2'));var db=require(_0x0b7f('0x3'))['db'];var config=require('./environment');var queryQueues={'attributes':['id','name'],'include':[{'as':_0x0b7f('0x4'),'model':db[_0x0b7f('0x5')],'attributes':['id',_0x0b7f('0x6'),_0x0b7f('0x7')],'raw':!![],'where':{'role':_0x0b7f('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x0b7f('0x6')],'where':{'role':_0x0b7f('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0x0b7f('0x6')]};var queryAgents={'raw':!![],'attributes':['id',_0x0b7f('0x6')],'where':{'role':_0x0b7f('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x0b7f('0xa')],'where':{'type':_0x0b7f('0xb')}};function getAssociatedResources(_0x5ed192,_0x1332d4,_0x3b44bd){return db['UserProfileSection']['findOne']({'where':{'name':_0x5ed192,'userProfileId':_0x1332d4},'raw':!![]})['then'](function(_0x255197){if(_0x255197){if(_0x255197[_0x0b7f('0xc')]){switch(_0x5ed192){case _0x0b7f('0xd'):case _0x0b7f('0xe'):case _0x0b7f('0xf'):case _0x0b7f('0x10'):case _0x0b7f('0x11'):case _0x0b7f('0x12'):case _0x0b7f('0x13'):return db[_0x3b44bd][_0x0b7f('0x14')](queryQueues);case _0x0b7f('0x15'):return db[_0x3b44bd]['findAll'](queryTelephones);case _0x0b7f('0x16'):return db[_0x3b44bd][_0x0b7f('0x14')](queryTrunks);case _0x0b7f('0x17'):return db[_0x3b44bd][_0x0b7f('0x14')](queryCampaigns);}}else{return db[_0x0b7f('0x18')][_0x0b7f('0x14')]({'attributes':[_0x0b7f('0x19')],'where':{'sectionId':_0x255197['id']},'raw':!![]})[_0x0b7f('0x1a')](function(_0x5a2b0b){if(_0x5a2b0b){var _0x20e15d={'where':{'id':_[_0x0b7f('0x1b')](_0x5a2b0b,_0x0b7f('0x19'))},'raw':!![]};switch(_0x3b44bd){case _0x0b7f('0x5'):_0x20e15d['where'][_0x0b7f('0x7')]=_0x0b7f('0x9');break;case _0x0b7f('0x1c'):_0x20e15d[_0x0b7f('0x1d')][_0x0b7f('0xa')]='ivr';break;}return db[_0x3b44bd][_0x0b7f('0x14')](_0x20e15d);}else{return[];}});}}else{return[];}})['then'](function(_0x5b9062){return _0x5b9062;});}function joinOrLeaveQueues(_0x36a619,_0x30a8b2,_0x2d4e0f,_0x34b5fe){_0x36a619[_0x30a8b2](util[_0x0b7f('0x1e')]('%s:queue:%s',_0x2d4e0f,_0x34b5fe['name']));if(_0x34b5fe[_0x0b7f('0x4')]){for(var _0x3ca024=0x0;_0x3ca024<_0x34b5fe[_0x0b7f('0x4')]['length'];_0x3ca024+=0x1){_0x36a619[_0x30a8b2](util[_0x0b7f('0x1e')](_0x0b7f('0x1f'),_0x34b5fe[_0x0b7f('0x4')][_0x3ca024][_0x0b7f('0x6')]));}}}function joinOrLeave(_0x1bda2b,_0x44a0ae,_0x459389){var _0x45ab0e;if(_0x1bda2b[_0x0b7f('0x20')]['query']['id']){db[_0x0b7f('0x5')][_0x0b7f('0x21')]({'attributes':['id','name','role','userProfileId'],'where':{'id':_0x1bda2b[_0x0b7f('0x20')][_0x0b7f('0x22')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x0b7f('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x0b7f('0x24')],'as':_0x0b7f('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x0b7f('0x26')],'as':_0x0b7f('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x0b7f('0x28')],'as':_0x0b7f('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x0b7f('0x2a')],'as':_0x0b7f('0x2b'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})['then'](function(_0x3ea675){if(_0x3ea675){_0x45ab0e=_0x3ea675;_0x1bda2b[_0x44a0ae](util['format'](_0x0b7f('0x1f'),_0x3ea675[_0x0b7f('0x6')]));var _0x38dff9=[];switch(_0x3ea675[_0x0b7f('0x7')]){case _0x0b7f('0x2c'):_0x1bda2b[_0x44a0ae](_0x0b7f('0x2d'));_0x1bda2b[_0x44a0ae](_0x0b7f('0x2e'));if(queryQueues['hasOwnProperty']('include')){delete queryQueues[_0x0b7f('0x2f')];}_0x38dff9['push'](db[_0x0b7f('0x30')][_0x0b7f('0x14')](queryQueues));_0x38dff9[_0x0b7f('0x31')](db[_0x0b7f('0x32')][_0x0b7f('0x14')](queryQueues));_0x38dff9[_0x0b7f('0x31')](db[_0x0b7f('0x33')][_0x0b7f('0x14')](queryQueues));_0x38dff9[_0x0b7f('0x31')](db['SmsQueue']['findAll'](queryQueues));_0x38dff9[_0x0b7f('0x31')](db[_0x0b7f('0x34')][_0x0b7f('0x14')](queryQueues));_0x38dff9[_0x0b7f('0x31')](db[_0x0b7f('0x35')][_0x0b7f('0x14')](queryQueues));_0x38dff9[_0x0b7f('0x31')](db[_0x0b7f('0x36')][_0x0b7f('0x14')](queryQueues));_0x38dff9['push'](db['User'][_0x0b7f('0x14')](queryTelephones));_0x38dff9['push'](db[_0x0b7f('0x37')]['findAll'](queryTrunks));_0x38dff9[_0x0b7f('0x31')](db[_0x0b7f('0x1c')][_0x0b7f('0x14')](queryCampaigns));_0x38dff9[_0x0b7f('0x31')](db[_0x0b7f('0x5')][_0x0b7f('0x14')](queryAgents));break;case _0x0b7f('0x38'):_0x1bda2b[_0x44a0ae](_0x0b7f('0x2d'));_0x1bda2b[_0x44a0ae](_0x0b7f('0x2e'));_0x38dff9['push'](getAssociatedResources('VoiceQueues',_0x3ea675['userProfileId'],_0x0b7f('0x30')));_0x38dff9['push'](getAssociatedResources(_0x0b7f('0xe'),_0x3ea675[_0x0b7f('0x39')],_0x0b7f('0x32')));_0x38dff9[_0x0b7f('0x31')](getAssociatedResources(_0x0b7f('0xf'),_0x3ea675['userProfileId'],_0x0b7f('0x33')));_0x38dff9[_0x0b7f('0x31')](getAssociatedResources(_0x0b7f('0x10'),_0x3ea675[_0x0b7f('0x39')],_0x0b7f('0x3a')));_0x38dff9['push'](getAssociatedResources(_0x0b7f('0x11'),_0x3ea675[_0x0b7f('0x39')],_0x0b7f('0x34')));_0x38dff9[_0x0b7f('0x31')](getAssociatedResources(_0x0b7f('0x12'),_0x3ea675[_0x0b7f('0x39')],_0x0b7f('0x35')));_0x38dff9[_0x0b7f('0x31')](getAssociatedResources(_0x0b7f('0x13'),_0x3ea675[_0x0b7f('0x39')],_0x0b7f('0x36')));_0x38dff9[_0x0b7f('0x31')](getAssociatedResources(_0x0b7f('0x15'),_0x3ea675['userProfileId'],'User'));_0x38dff9[_0x0b7f('0x31')](getAssociatedResources(_0x0b7f('0x16'),_0x3ea675[_0x0b7f('0x39')],_0x0b7f('0x37')));_0x38dff9[_0x0b7f('0x31')](getAssociatedResources(_0x0b7f('0x17'),_0x3ea675['userProfileId'],_0x0b7f('0x1c')));_0x38dff9[_0x0b7f('0x31')](db[_0x0b7f('0x5')][_0x0b7f('0x14')](queryAgents));break;case'agent':_0x1bda2b[_0x44a0ae](_0x0b7f('0x2d'));_0x1bda2b[_0x44a0ae]('voice:outbound');_0x38dff9[_0x0b7f('0x31')](_0x3ea675[_0x0b7f('0x3b')]({'attributes':['id',_0x0b7f('0x6')]}));_0x38dff9[_0x0b7f('0x31')](_0x3ea675[_0x0b7f('0x3c')]({'attributes':['id','name']}));_0x38dff9[_0x0b7f('0x31')](_0x3ea675[_0x0b7f('0x3d')]({'attributes':['id',_0x0b7f('0x6')]}));_0x38dff9[_0x0b7f('0x31')](_0x3ea675[_0x0b7f('0x3e')]({'attributes':['id',_0x0b7f('0x6')]}));_0x38dff9[_0x0b7f('0x31')](_0x3ea675[_0x0b7f('0x3f')]({'attributes':['id',_0x0b7f('0x6')]}));_0x38dff9[_0x0b7f('0x31')](_0x3ea675[_0x0b7f('0x40')]({'attributes':['id',_0x0b7f('0x6')]}));_0x38dff9[_0x0b7f('0x31')](_0x3ea675['getWhatsappQueues']({'attributes':['id',_0x0b7f('0x6')]}));break;}return BPromise[_0x0b7f('0x41')](_0x38dff9);}})[_0x0b7f('0x1a')](function(_0x12fd2){if(_0x12fd2&&_0x12fd2[_0x0b7f('0x42')]){for(var _0x273228=0x0;_0x273228<_0x12fd2[_0x0b7f('0x42')];_0x273228+=0x1){for(var _0x50a586=0x0;_0x50a586<_0x12fd2[_0x273228]['length'];_0x50a586+=0x1){switch(_0x273228){case 0x0:joinOrLeaveQueues(_0x1bda2b,_0x44a0ae,'voice',_0x12fd2[_0x273228][_0x50a586]);break;case 0x1:joinOrLeaveQueues(_0x1bda2b,_0x44a0ae,_0x0b7f('0x43'),_0x12fd2[_0x273228][_0x50a586]);break;case 0x2:joinOrLeaveQueues(_0x1bda2b,_0x44a0ae,_0x0b7f('0x44'),_0x12fd2[_0x273228][_0x50a586]);break;case 0x3:joinOrLeaveQueues(_0x1bda2b,_0x44a0ae,'sms',_0x12fd2[_0x273228][_0x50a586]);break;case 0x4:joinOrLeaveQueues(_0x1bda2b,_0x44a0ae,_0x0b7f('0x45'),_0x12fd2[_0x273228][_0x50a586]);break;case 0x5:joinOrLeaveQueues(_0x1bda2b,_0x44a0ae,_0x0b7f('0x46'),_0x12fd2[_0x273228][_0x50a586]);break;case 0x6:joinOrLeaveQueues(_0x1bda2b,_0x44a0ae,'whatsapp',_0x12fd2[_0x273228][_0x50a586]);break;case 0x7:if(_0x45ab0e[_0x0b7f('0x7')]!=='agent')_0x1bda2b[_0x44a0ae](util[_0x0b7f('0x1e')]('telephone:%s',_0x12fd2[_0x273228][_0x50a586][_0x0b7f('0x6')]));break;case 0x8:if(_0x45ab0e[_0x0b7f('0x7')]!==_0x0b7f('0x8'))_0x1bda2b[_0x44a0ae](util[_0x0b7f('0x1e')](_0x0b7f('0x47'),_0x12fd2[_0x273228][_0x50a586][_0x0b7f('0x6')]));break;case 0x9:if(_0x45ab0e[_0x0b7f('0x7')]!==_0x0b7f('0x8'))_0x1bda2b[_0x44a0ae](util[_0x0b7f('0x1e')](_0x0b7f('0x48'),_0x12fd2[_0x273228][_0x50a586][_0x0b7f('0xa')],_0x12fd2[_0x273228][_0x50a586][_0x0b7f('0x6')]));break;case 0xa:_0x1bda2b[_0x44a0ae](util[_0x0b7f('0x1e')](_0x0b7f('0x1f'),_0x12fd2[_0x273228][_0x50a586]['name']));break;}}}}})[_0x0b7f('0x1a')](function(){if(_0x44a0ae===_0x0b7f('0x49')){var _0x2943fe=_[_0x0b7f('0x1b')](_0x45ab0e[_0x0b7f('0x23')],'id');return _0x45ab0e[_0x0b7f('0x4a')](_0x2943fe)['then'](function(){for(var _0x1d239e=0x0;_0x1d239e<_0x2943fe['length'];_0x1d239e+=0x1){_0x459389['emit'](_0x0b7f('0x4b'),{'ChatInteractionId':Number(_0x2943fe[_0x1d239e]),'UserId':Number(_0x45ab0e['id'])});}});}})['then'](function(){if(_0x44a0ae==='leave'){var _0x5a91c0=_[_0x0b7f('0x1b')](_0x45ab0e[_0x0b7f('0x25')],'id');return _0x45ab0e['removeMailInteractions'](_0x5a91c0)['then'](function(){for(var _0x16b509=0x0;_0x16b509<_0x5a91c0[_0x0b7f('0x42')];_0x16b509+=0x1){_0x459389[_0x0b7f('0x4c')](_0x0b7f('0x4d'),{'MailInteractionId':Number(_0x5a91c0[_0x16b509]),'UserId':Number(_0x45ab0e['id'])});}});}})[_0x0b7f('0x1a')](function(){if(_0x44a0ae===_0x0b7f('0x49')){var _0x20eeae=_['map'](_0x45ab0e['FaxInteractions'],'id');return _0x45ab0e['removeFaxInteractions'](_0x20eeae)[_0x0b7f('0x1a')](function(){for(var _0x2d06de=0x0;_0x2d06de<_0x20eeae[_0x0b7f('0x42')];_0x2d06de+=0x1){_0x459389[_0x0b7f('0x4c')](_0x0b7f('0x4e'),{'FaxInteractionId':Number(_0x20eeae[_0x2d06de]),'UserId':Number(_0x45ab0e['id'])});}});}})[_0x0b7f('0x1a')](function(){if(_0x44a0ae===_0x0b7f('0x49')){var _0x32ee33=_[_0x0b7f('0x1b')](_0x45ab0e['SmsInteractions'],'id');return _0x45ab0e[_0x0b7f('0x4f')](_0x32ee33)['then'](function(){for(var _0x3fee23=0x0;_0x3fee23<_0x32ee33[_0x0b7f('0x42')];_0x3fee23+=0x1){_0x459389['emit'](_0x0b7f('0x50'),{'SmsInteractionId':Number(_0x32ee33[_0x3fee23]),'UserId':Number(_0x45ab0e['id'])});}});}})['then'](function(){if(_0x44a0ae==='leave'){var _0x31041b=_[_0x0b7f('0x1b')](_0x45ab0e[_0x0b7f('0x2b')],'id');return _0x45ab0e[_0x0b7f('0x51')](_0x31041b)[_0x0b7f('0x1a')](function(){for(var _0x396353=0x0;_0x396353<_0x31041b[_0x0b7f('0x42')];_0x396353+=0x1){_0x459389[_0x0b7f('0x4c')](_0x0b7f('0x52'),{'OpenchannelInteractionId':Number(_0x31041b[_0x396353]),'UserId':Number(_0x45ab0e['id'])});}});}})[_0x0b7f('0x1a')](function(){if(_0x44a0ae===_0x0b7f('0x49')){var _0x21369c=_[_0x0b7f('0x1b')](_0x45ab0e[_0x0b7f('0x53')],'id');return _0x45ab0e[_0x0b7f('0x54')](_0x21369c)[_0x0b7f('0x1a')](function(){for(var _0x527ef3=0x0;_0x527ef3<_0x21369c[_0x0b7f('0x42')];_0x527ef3+=0x1){_0x459389[_0x0b7f('0x4c')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x21369c[_0x527ef3]),'UserId':Number(_0x45ab0e['id'])});}});}})[_0x0b7f('0x55')](function(_0x43b607){_0x1bda2b['log'](_0x43b607);});}}function onDisconnect(_0x2cc10e,_0xebf333){joinOrLeave(_0x2cc10e,'leave',_0xebf333);}function onConnect(_0x3058a9){joinOrLeave(_0x3058a9,'join');}exports[_0x0b7f('0x56')]=function(_0x308684){_0x308684['on'](_0x0b7f('0x57'),function(_0xf17807){_0xf17807['setMaxListeners'](0x0);_0xf17807[_0x0b7f('0x58')]=_0xf17807[_0x0b7f('0x59')]['connection']['remoteAddress']+':'+_0xf17807[_0x0b7f('0x59')][_0x0b7f('0x57')][_0x0b7f('0x5a')];_0xf17807[_0x0b7f('0x5b')]=new Date();_0xf17807[_0x0b7f('0x5c')]=function(_0x11d745){console[_0x0b7f('0x5c')](_0x0b7f('0x5d')+_0xf17807[_0x0b7f('0x5e')][_0x0b7f('0x6')]+'['+_0xf17807[_0x0b7f('0x58')]+']',_0x11d745);};_0xf17807['on']('disconnect',function(){onDisconnect(_0xf17807,_0x308684);_0xf17807[_0x0b7f('0x5c')](_0x0b7f('0x5f'));});onConnect(_0xf17807);_0xf17807['log'](_0x0b7f('0x60'));});}; \ No newline at end of file +var _0x1107=['log','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','name','Agents','role','agent','telephone','type','ivr','UserProfileSection','then','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','User','where','%s:queue:%s','length','format','user:%s','handshake','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','hasOwnProperty','include','push','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','Campaign','user','voice:outbound','VoiceQueue','ChatQueue','voice:inbound','getChatQueues','getFaxQueues','getOpenchannelQueues','all','voice','chat','fax','sms','mail','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','emit','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch'];(function(_0x8a431a,_0x13c750){var _0x50b105=function(_0xfe5fb6){while(--_0xfe5fb6){_0x8a431a['push'](_0x8a431a['shift']());}};_0x50b105(++_0x13c750);}(_0x1107,0xd8));var _0x7110=function(_0x3bbd21,_0x23f22d){_0x3bbd21=_0x3bbd21-0x0;var _0x11908b=_0x1107[_0x3bbd21];return _0x11908b;};'use strict';var _=require(_0x7110('0x0'));var util=require(_0x7110('0x1'));var BPromise=require(_0x7110('0x2'));var db=require('../mysqldb')['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x7110('0x3')],'include':[{'as':_0x7110('0x4'),'model':db['User'],'attributes':['id',_0x7110('0x3'),_0x7110('0x5')],'raw':!![],'where':{'role':_0x7110('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x7110('0x3')],'where':{'role':_0x7110('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0x7110('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0x7110('0x3')],'where':{'role':_0x7110('0x6')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x7110('0x3'),_0x7110('0x8')],'where':{'type':_0x7110('0x9')}};function getAssociatedResources(_0x466351,_0x271466,_0x4960b1){return db[_0x7110('0xa')]['findOne']({'where':{'name':_0x466351,'userProfileId':_0x271466},'raw':!![]})[_0x7110('0xb')](function(_0x19d729){if(_0x19d729){if(_0x19d729['autoAssociation']){switch(_0x466351){case _0x7110('0xc'):case _0x7110('0xd'):case _0x7110('0xe'):case _0x7110('0xf'):case _0x7110('0x10'):case _0x7110('0x11'):case _0x7110('0x12'):return db[_0x4960b1][_0x7110('0x13')](queryQueues);case _0x7110('0x14'):return db[_0x4960b1]['findAll'](queryTelephones);case _0x7110('0x15'):return db[_0x4960b1]['findAll'](queryTrunks);case _0x7110('0x16'):return db[_0x4960b1]['findAll'](queryCampaigns);}}else{return db[_0x7110('0x17')][_0x7110('0x13')]({'attributes':[_0x7110('0x18')],'where':{'sectionId':_0x19d729['id']},'raw':!![]})[_0x7110('0xb')](function(_0x26fe8a){if(_0x26fe8a){var _0x1a8f7f={'where':{'id':_[_0x7110('0x19')](_0x26fe8a,'resourceId')},'raw':!![]};switch(_0x4960b1){case _0x7110('0x1a'):_0x1a8f7f['where'][_0x7110('0x5')]=_0x7110('0x7');break;case'Campaign':_0x1a8f7f[_0x7110('0x1b')][_0x7110('0x8')]=_0x7110('0x9');break;}return db[_0x4960b1]['findAll'](_0x1a8f7f);}else{return[];}});}}else{return[];}})['then'](function(_0x25cc51){return _0x25cc51;});}function joinOrLeaveQueues(_0x13c8ea,_0x388c84,_0x21cc2e,_0x2adfc7){_0x13c8ea[_0x388c84](util['format'](_0x7110('0x1c'),_0x21cc2e,_0x2adfc7[_0x7110('0x3')]));if(_0x2adfc7[_0x7110('0x4')]){for(var _0x264250=0x0;_0x264250<_0x2adfc7[_0x7110('0x4')][_0x7110('0x1d')];_0x264250+=0x1){_0x13c8ea[_0x388c84](util[_0x7110('0x1e')](_0x7110('0x1f'),_0x2adfc7['Agents'][_0x264250][_0x7110('0x3')]));}}}function joinOrLeave(_0x5e22d9,_0x3bd510,_0xcf45c){var _0x2373b4;if(_0x5e22d9[_0x7110('0x20')]['query']['id']){db[_0x7110('0x1a')][_0x7110('0x21')]({'attributes':['id',_0x7110('0x3'),'role',_0x7110('0x22')],'where':{'id':_0x5e22d9['handshake']['query']['id']},'include':[{'model':db[_0x7110('0x23')],'as':_0x7110('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x7110('0x25')],'as':_0x7110('0x26'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x7110('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x7110('0x28')],'as':_0x7110('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x7110('0x2a')],'as':_0x7110('0x2b'),'attributes':['id'],'raw':!![]},{'model':db[_0x7110('0x2c')],'as':_0x7110('0x2d'),'attributes':['id'],'raw':!![]}]})[_0x7110('0xb')](function(_0x1b163a){if(_0x1b163a){_0x2373b4=_0x1b163a;_0x5e22d9[_0x3bd510](util[_0x7110('0x1e')](_0x7110('0x1f'),_0x1b163a[_0x7110('0x3')]));var _0x5aedc2=[];switch(_0x1b163a['role']){case _0x7110('0x2e'):_0x5e22d9[_0x3bd510]('voice:inbound');_0x5e22d9[_0x3bd510]('voice:outbound');if(queryQueues[_0x7110('0x2f')](_0x7110('0x30'))){delete queryQueues['include'];}_0x5aedc2[_0x7110('0x31')](db['VoiceQueue'][_0x7110('0x13')](queryQueues));_0x5aedc2[_0x7110('0x31')](db['ChatQueue'][_0x7110('0x13')](queryQueues));_0x5aedc2[_0x7110('0x31')](db[_0x7110('0x32')]['findAll'](queryQueues));_0x5aedc2[_0x7110('0x31')](db[_0x7110('0x33')][_0x7110('0x13')](queryQueues));_0x5aedc2[_0x7110('0x31')](db[_0x7110('0x34')][_0x7110('0x13')](queryQueues));_0x5aedc2[_0x7110('0x31')](db[_0x7110('0x35')][_0x7110('0x13')](queryQueues));_0x5aedc2['push'](db['WhatsappQueue'][_0x7110('0x13')](queryQueues));_0x5aedc2['push'](db[_0x7110('0x1a')][_0x7110('0x13')](queryTelephones));_0x5aedc2[_0x7110('0x31')](db[_0x7110('0x36')]['findAll'](queryTrunks));_0x5aedc2['push'](db[_0x7110('0x37')]['findAll'](queryCampaigns));_0x5aedc2[_0x7110('0x31')](db[_0x7110('0x1a')]['findAll'](queryAgents));break;case _0x7110('0x38'):_0x5e22d9[_0x3bd510]('voice:inbound');_0x5e22d9[_0x3bd510](_0x7110('0x39'));_0x5aedc2[_0x7110('0x31')](getAssociatedResources(_0x7110('0xc'),_0x1b163a[_0x7110('0x22')],_0x7110('0x3a')));_0x5aedc2['push'](getAssociatedResources(_0x7110('0xd'),_0x1b163a[_0x7110('0x22')],_0x7110('0x3b')));_0x5aedc2[_0x7110('0x31')](getAssociatedResources(_0x7110('0xe'),_0x1b163a[_0x7110('0x22')],'FaxQueue'));_0x5aedc2[_0x7110('0x31')](getAssociatedResources(_0x7110('0xf'),_0x1b163a[_0x7110('0x22')],'SmsQueue'));_0x5aedc2['push'](getAssociatedResources('MailQueues',_0x1b163a[_0x7110('0x22')],_0x7110('0x34')));_0x5aedc2[_0x7110('0x31')](getAssociatedResources(_0x7110('0x11'),_0x1b163a['userProfileId'],_0x7110('0x35')));_0x5aedc2[_0x7110('0x31')](getAssociatedResources('WhatsappQueues',_0x1b163a[_0x7110('0x22')],'WhatsappQueue'));_0x5aedc2['push'](getAssociatedResources('Telephones',_0x1b163a[_0x7110('0x22')],'User'));_0x5aedc2[_0x7110('0x31')](getAssociatedResources(_0x7110('0x15'),_0x1b163a[_0x7110('0x22')],'Trunk'));_0x5aedc2[_0x7110('0x31')](getAssociatedResources('IvrCampaigns',_0x1b163a[_0x7110('0x22')],_0x7110('0x37')));_0x5aedc2[_0x7110('0x31')](db[_0x7110('0x1a')][_0x7110('0x13')](queryAgents));break;case _0x7110('0x6'):_0x5e22d9[_0x3bd510](_0x7110('0x3c'));_0x5e22d9[_0x3bd510]('voice:outbound');_0x5aedc2[_0x7110('0x31')](_0x1b163a['getVoiceQueues']({'attributes':['id',_0x7110('0x3')]}));_0x5aedc2['push'](_0x1b163a[_0x7110('0x3d')]({'attributes':['id',_0x7110('0x3')]}));_0x5aedc2['push'](_0x1b163a[_0x7110('0x3e')]({'attributes':['id',_0x7110('0x3')]}));_0x5aedc2[_0x7110('0x31')](_0x1b163a['getSmsQueues']({'attributes':['id','name']}));_0x5aedc2[_0x7110('0x31')](_0x1b163a['getMailQueues']({'attributes':['id',_0x7110('0x3')]}));_0x5aedc2[_0x7110('0x31')](_0x1b163a[_0x7110('0x3f')]({'attributes':['id',_0x7110('0x3')]}));_0x5aedc2[_0x7110('0x31')](_0x1b163a['getWhatsappQueues']({'attributes':['id',_0x7110('0x3')]}));break;}return BPromise[_0x7110('0x40')](_0x5aedc2);}})[_0x7110('0xb')](function(_0x15b2ca){if(_0x15b2ca&&_0x15b2ca['length']){for(var _0x1bb7f3=0x0;_0x1bb7f3<_0x15b2ca[_0x7110('0x1d')];_0x1bb7f3+=0x1){for(var _0x4ca881=0x0;_0x4ca881<_0x15b2ca[_0x1bb7f3]['length'];_0x4ca881+=0x1){switch(_0x1bb7f3){case 0x0:joinOrLeaveQueues(_0x5e22d9,_0x3bd510,_0x7110('0x41'),_0x15b2ca[_0x1bb7f3][_0x4ca881]);break;case 0x1:joinOrLeaveQueues(_0x5e22d9,_0x3bd510,_0x7110('0x42'),_0x15b2ca[_0x1bb7f3][_0x4ca881]);break;case 0x2:joinOrLeaveQueues(_0x5e22d9,_0x3bd510,_0x7110('0x43'),_0x15b2ca[_0x1bb7f3][_0x4ca881]);break;case 0x3:joinOrLeaveQueues(_0x5e22d9,_0x3bd510,_0x7110('0x44'),_0x15b2ca[_0x1bb7f3][_0x4ca881]);break;case 0x4:joinOrLeaveQueues(_0x5e22d9,_0x3bd510,_0x7110('0x45'),_0x15b2ca[_0x1bb7f3][_0x4ca881]);break;case 0x5:joinOrLeaveQueues(_0x5e22d9,_0x3bd510,'openchannel',_0x15b2ca[_0x1bb7f3][_0x4ca881]);break;case 0x6:joinOrLeaveQueues(_0x5e22d9,_0x3bd510,_0x7110('0x46'),_0x15b2ca[_0x1bb7f3][_0x4ca881]);break;case 0x7:if(_0x2373b4['role']!==_0x7110('0x6'))_0x5e22d9[_0x3bd510](util['format'](_0x7110('0x47'),_0x15b2ca[_0x1bb7f3][_0x4ca881][_0x7110('0x3')]));break;case 0x8:if(_0x2373b4[_0x7110('0x5')]!=='agent')_0x5e22d9[_0x3bd510](util[_0x7110('0x1e')](_0x7110('0x48'),_0x15b2ca[_0x1bb7f3][_0x4ca881]['name']));break;case 0x9:if(_0x2373b4[_0x7110('0x5')]!==_0x7110('0x6'))_0x5e22d9[_0x3bd510](util[_0x7110('0x1e')](_0x7110('0x49'),_0x15b2ca[_0x1bb7f3][_0x4ca881][_0x7110('0x8')],_0x15b2ca[_0x1bb7f3][_0x4ca881][_0x7110('0x3')]));break;case 0xa:_0x5e22d9[_0x3bd510](util[_0x7110('0x1e')](_0x7110('0x1f'),_0x15b2ca[_0x1bb7f3][_0x4ca881]['name']));break;}}}}})[_0x7110('0xb')](function(){if(_0x3bd510===_0x7110('0x4a')){var _0x29ffe6=_[_0x7110('0x19')](_0x2373b4['ChatInteractions'],'id');return _0x2373b4['removeChatInteractions'](_0x29ffe6)[_0x7110('0xb')](function(){for(var _0x26976d=0x0;_0x26976d<_0x29ffe6[_0x7110('0x1d')];_0x26976d+=0x1){_0xcf45c[_0x7110('0x4b')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x29ffe6[_0x26976d]),'UserId':Number(_0x2373b4['id'])});}});}})['then'](function(){if(_0x3bd510===_0x7110('0x4a')){var _0x3d7ad6=_[_0x7110('0x19')](_0x2373b4[_0x7110('0x26')],'id');return _0x2373b4[_0x7110('0x4c')](_0x3d7ad6)[_0x7110('0xb')](function(){for(var _0xa28592=0x0;_0xa28592<_0x3d7ad6['length'];_0xa28592+=0x1){_0xcf45c[_0x7110('0x4b')](_0x7110('0x4d'),{'MailInteractionId':Number(_0x3d7ad6[_0xa28592]),'UserId':Number(_0x2373b4['id'])});}});}})[_0x7110('0xb')](function(){if(_0x3bd510==='leave'){var _0x106ea4=_[_0x7110('0x19')](_0x2373b4[_0x7110('0x27')],'id');return _0x2373b4[_0x7110('0x4e')](_0x106ea4)[_0x7110('0xb')](function(){for(var _0x5c9b76=0x0;_0x5c9b76<_0x106ea4[_0x7110('0x1d')];_0x5c9b76+=0x1){_0xcf45c[_0x7110('0x4b')](_0x7110('0x4f'),{'FaxInteractionId':Number(_0x106ea4[_0x5c9b76]),'UserId':Number(_0x2373b4['id'])});}});}})[_0x7110('0xb')](function(){if(_0x3bd510===_0x7110('0x4a')){var _0x2102fd=_[_0x7110('0x19')](_0x2373b4[_0x7110('0x29')],'id');return _0x2373b4[_0x7110('0x50')](_0x2102fd)[_0x7110('0xb')](function(){for(var _0x64b6df=0x0;_0x64b6df<_0x2102fd['length'];_0x64b6df+=0x1){_0xcf45c[_0x7110('0x4b')](_0x7110('0x51'),{'SmsInteractionId':Number(_0x2102fd[_0x64b6df]),'UserId':Number(_0x2373b4['id'])});}});}})[_0x7110('0xb')](function(){if(_0x3bd510===_0x7110('0x4a')){var _0x9f41ab=_[_0x7110('0x19')](_0x2373b4['OpenchannelInteractions'],'id');return _0x2373b4[_0x7110('0x52')](_0x9f41ab)[_0x7110('0xb')](function(){for(var _0x444025=0x0;_0x444025<_0x9f41ab[_0x7110('0x1d')];_0x444025+=0x1){_0xcf45c[_0x7110('0x4b')](_0x7110('0x53'),{'OpenchannelInteractionId':Number(_0x9f41ab[_0x444025]),'UserId':Number(_0x2373b4['id'])});}});}})[_0x7110('0xb')](function(){if(_0x3bd510===_0x7110('0x4a')){var _0x3b17b4=_[_0x7110('0x19')](_0x2373b4[_0x7110('0x2d')],'id');return _0x2373b4[_0x7110('0x54')](_0x3b17b4)[_0x7110('0xb')](function(){for(var _0xfb36c1=0x0;_0xfb36c1<_0x3b17b4[_0x7110('0x1d')];_0xfb36c1+=0x1){_0xcf45c[_0x7110('0x4b')](_0x7110('0x55'),{'WhatsappInteractionId':Number(_0x3b17b4[_0xfb36c1]),'UserId':Number(_0x2373b4['id'])});}});}})[_0x7110('0x56')](function(_0x364a42){_0x5e22d9[_0x7110('0x57')](_0x364a42);});}}function onDisconnect(_0xb8f1d7,_0x5ec978){joinOrLeave(_0xb8f1d7,_0x7110('0x4a'),_0x5ec978);}function onConnect(_0x1112f7){joinOrLeave(_0x1112f7,_0x7110('0x58'));}exports[_0x7110('0x59')]=function(_0xc58606){_0xc58606['on'](_0x7110('0x5a'),function(_0x2d3f96){_0x2d3f96[_0x7110('0x5b')](0x0);_0x2d3f96[_0x7110('0x5c')]=_0x2d3f96[_0x7110('0x5d')][_0x7110('0x5a')][_0x7110('0x5e')]+':'+_0x2d3f96[_0x7110('0x5d')]['connection'][_0x7110('0x5f')];_0x2d3f96[_0x7110('0x60')]=new Date();_0x2d3f96[_0x7110('0x57')]=function(_0x34de8b){console[_0x7110('0x57')]('SocketIO\x20'+_0x2d3f96[_0x7110('0x61')][_0x7110('0x3')]+'['+_0x2d3f96[_0x7110('0x5c')]+']',_0x34de8b);};_0x2d3f96['on'](_0x7110('0x62'),function(){onDisconnect(_0x2d3f96,_0xc58606);_0x2d3f96[_0x7110('0x57')](_0x7110('0x63'));});onConnect(_0x2d3f96);_0x2d3f96[_0x7110('0x57')](_0x7110('0x64'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 328fe41..8904fdb 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 _0xce6a=['code','catch','get','channel','motionChannel','event','direction','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','query','Sequelize','QueryTypes','SELECT','then','UserId','User','find','name','internal','interface','format','agent','outgoingmessage','opened','changed','closed','substatus','fullname','length','hasOwnProperty','model','hook','toLowerCase','condition','util','../logger','triggers','lodash','client','http','Chat','afterCreate','newinteraction','ChatInteraction','afterUpdate','ChatMessage','newmessage','SmsInteraction','Sms','closedinteraction','SmsMessage','Whatsapp','WhatsappInteraction','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','EventManager','info','Trigger,\x20%s','error'];(function(_0x315dde,_0x5c2ef1){var _0x33e25f=function(_0x1a64b7){while(--_0x1a64b7){_0x315dde['push'](_0x315dde['shift']());}};_0x33e25f(++_0x5c2ef1);}(_0xce6a,0x65));var _0xace6=function(_0x34c939,_0x21f633){_0x34c939=_0x34c939-0x0;var _0x45e0b2=_0xce6a[_0x34c939];return _0x45e0b2;};'use strict';var util=require(_0xace6('0x0'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var logger=require(_0xace6('0x1'))(_0xace6('0x2'));var _=require(_0xace6('0x3'));var client=jayson[_0xace6('0x4')][_0xace6('0x5')]({'port':0x232a});var triggers=[{'channel':_0xace6('0x6'),'model':'ChatInteraction','event':_0xace6('0x7'),'condition':_0xace6('0x8'),'callback':afterCreate},{'channel':_0xace6('0x6'),'model':_0xace6('0x9'),'event':_0xace6('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xace6('0x6'),'model':_0xace6('0xb'),'event':'afterCreate','condition':_0xace6('0xc'),'callback':afterCreateMessage},{'channel':'Sms','model':_0xace6('0xd'),'event':_0xace6('0x7'),'condition':_0xace6('0x8'),'callback':afterCreate},{'channel':_0xace6('0xe'),'model':_0xace6('0xd'),'event':_0xace6('0xa'),'condition':_0xace6('0xf'),'callback':afterUpdate},{'channel':_0xace6('0xe'),'model':_0xace6('0x10'),'event':_0xace6('0x7'),'condition':_0xace6('0xc'),'callback':afterCreateMessage},{'channel':_0xace6('0x11'),'model':_0xace6('0x12'),'event':_0xace6('0x7'),'condition':_0xace6('0x8'),'callback':afterCreate},{'channel':_0xace6('0x11'),'model':_0xace6('0x12'),'event':_0xace6('0xa'),'condition':_0xace6('0xf'),'callback':afterUpdate},{'channel':'Whatsapp','model':'WhatsappMessage','event':_0xace6('0x7'),'condition':_0xace6('0xc'),'callback':afterCreateMessage},{'channel':_0xace6('0x13'),'model':_0xace6('0x14'),'event':'afterCreate','condition':_0xace6('0x8'),'callback':afterCreate},{'channel':_0xace6('0x13'),'model':'FaxInteraction','event':_0xace6('0xa'),'condition':_0xace6('0xf'),'callback':afterUpdate},{'channel':_0xace6('0x13'),'model':_0xace6('0x15'),'event':_0xace6('0x7'),'condition':_0xace6('0xc'),'callback':afterCreateMessage},{'channel':'Mail','model':'MailInteraction','event':_0xace6('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xace6('0x16'),'model':_0xace6('0x17'),'event':_0xace6('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Mail','model':_0xace6('0x18'),'event':_0xace6('0x7'),'condition':_0xace6('0xc'),'callback':afterCreateMessage},{'channel':_0xace6('0x19'),'model':_0xace6('0x1a'),'event':_0xace6('0x7'),'condition':_0xace6('0x8'),'callback':afterCreate},{'channel':'Openchannel','model':_0xace6('0x1a'),'event':_0xace6('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xace6('0x19'),'model':'OpenchannelMessage','event':_0xace6('0x7'),'condition':_0xace6('0xc'),'callback':afterCreateMessage}];function request(_0x4bee93){return client['request'](_0xace6('0x1b'),_0x4bee93)['then'](function(_0x2c718b){logger[_0xace6('0x1c')](_0xace6('0x1d'),'EventManager',_0x2c718b);if(_0x2c718b[_0xace6('0x1e')]){if(_0x2c718b[_0xace6('0x1e')][_0xace6('0x1f')]===0x1f4){logger['error'](_0xace6('0x1d'),_0xace6('0x1b'),_0x2c718b[_0xace6('0x1e')]);}}})[_0xace6('0x20')](function(_0x46c71d){logger[_0xace6('0x1e')](_0xace6('0x1d'),_0xace6('0x1b'),_0x46c71d);});}function afterCreateMessage(_0xe6212d,_0x4d8de9){return function(_0x4c0efa,_0x37b77e){_0x4c0efa=_0x4c0efa[_0xace6('0x21')]({'plain':!![]});_0x4c0efa[_0xace6('0x22')]=_0xe6212d;_0x4c0efa[_0xace6('0x23')]=_0xe6212d;_0x4c0efa[_0xace6('0x24')]=_0x4c0efa[_0xace6('0x25')];var _0x35b536=_0xace6('0x26')+_0x4c0efa[_0xace6('0x27')];return db[_0xace6('0x28')][_0xace6('0x29')](_0x35b536,{'type':db[_0xace6('0x2a')][_0xace6('0x2b')][_0xace6('0x2c')],'raw':!![]})[_0xace6('0x2d')](function(_0x490e3c){return _0x490e3c;})[_0xace6('0x2d')](function(_0x2daf7b){if(_0x2daf7b){_0x4c0efa['contact']=_0x2daf7b[0x0];}if(_0x4c0efa[_0xace6('0x2e')]){return db[_0xace6('0x2f')][_0xace6('0x30')]({'where':{'id':_0x4c0efa[_0xace6('0x2e')]},'attributes':['id',_0xace6('0x31'),'fullname','email',_0xace6('0x32')],'raw':!![]})['then'](function(_0x261e71){_0x4c0efa[_0xace6('0x33')]=util[_0xace6('0x34')]('SIP/%s',_0x261e71['name']);_0x4c0efa[_0xace6('0x22')]=_0xe6212d;_0x4c0efa[_0xace6('0x35')]=_0x261e71;return request({'event':'incomingmessage','message':_0x4c0efa});})[_0xace6('0x20')](function(_0x1fcaa8){console[_0xace6('0x1e')](_0x1fcaa8);});}else{return request({'event':_0xace6('0x36'),'message':_0x4c0efa});}});};}function afterCreate(_0x4a8024,_0x28fafb){return function(_0x390ce1,_0x39a580){_0x390ce1=_0x390ce1[_0xace6('0x21')]({'plain':!![]});_0x390ce1[_0xace6('0x22')]=_0x4a8024;_0x390ce1[_0xace6('0x23')]=_0x4a8024;_0x390ce1[_0xace6('0x24')]=_0xace6('0x37');var _0xdc0a44=_0xace6('0x26')+_0x390ce1['ContactId'];return db['sequelize'][_0xace6('0x29')](_0xdc0a44,{'type':db[_0xace6('0x2a')]['QueryTypes']['SELECT'],'raw':!![]})[_0xace6('0x2d')](function(_0x562c7f){return _0x562c7f;})['then'](function(_0x52de41){if(_0x52de41){_0x390ce1['contact']=_0x52de41[0x0];}return request({'event':_0x28fafb,'message':_0x390ce1});});};}function afterUpdate(_0x575306){return function(_0x182a92){var _0x3f3a22=_0x182a92[_0xace6('0x38')](_0xace6('0x39'))&&_0x182a92['closed'];var _0x488daf=_0x182a92['changed']('substatus');if(_0x3f3a22||_0x488daf){var _0x13e5d5=_0x3f3a22?_0xace6('0xf'):_0xace6('0x3a');var _0x335e66=_0x182a92[_0xace6('0x21')]({'plain':!![]});_0x335e66[_0xace6('0x22')]=_0x575306;_0x335e66[_0xace6('0x23')]=_0x575306;_0x335e66[_0xace6('0x24')]=_0x3f3a22?_0xace6('0x39'):'substatus';var _0x8df431=_0xace6('0x26')+_0x335e66['ContactId'];return db['sequelize'][_0xace6('0x29')](_0x8df431,{'type':db[_0xace6('0x2a')][_0xace6('0x2b')][_0xace6('0x2c')],'raw':!![]})[_0xace6('0x2d')](function(_0x150c2a){if(_0x150c2a){_0x335e66['contact']=_0x150c2a[0x0];}if(_0x335e66['UserId']){return db[_0xace6('0x2f')][_0xace6('0x30')]({'where':{'id':_0x335e66[_0xace6('0x2e')]},'attributes':['id',_0xace6('0x31'),_0xace6('0x3b'),'email',_0xace6('0x32')],'raw':!![]})[_0xace6('0x2d')](function(_0xbfe6c4){_0x335e66[_0xace6('0x33')]=util['format']('SIP/%s',_0xbfe6c4['name']);_0x335e66[_0xace6('0x35')]=_0xbfe6c4;return request({'event':_0x13e5d5,'message':_0x335e66});})['catch'](function(_0x3e645f){console[_0xace6('0x1e')](_0x3e645f);});}else{return request({'event':_0x13e5d5,'message':_0x335e66});}});}};}exports['default']=function(){for(var _0x30bd8a=0x0;_0x30bd8a=_0x4193bf[_0xdb07('0x14')]){throw Error(_0xdb07('0x15'));}_0x4ee6cd(_0x522545);})[_0xdb07('0x16')](function(_0x44f791){_0x363c3c(_0x44f791);});});}; \ No newline at end of file +var _0x6979=['isUndefined','updateAttributes','agent','User','then','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','./license/util','voice','mail','sms','openchannel','toLowerCase','clearBlockUser'];(function(_0x24df34,_0x50aa1a){var _0x3980e8=function(_0x24c43f){while(--_0x24c43f){_0x24df34['push'](_0x24df34['shift']());}};_0x3980e8(++_0x50aa1a);}(_0x6979,0xa1));var _0x9697=function(_0x49a613,_0x27ad0b){_0x49a613=_0x49a613-0x0;var _0x4ed260=_0x6979[_0x49a613];return _0x4ed260;};'use strict';var _=require(_0x9697('0x0'));var BPromise=require(_0x9697('0x1'));var db=require(_0x9697('0x2'))['db'];var util=require(_0x9697('0x3'));var channels=[_0x9697('0x4'),_0x9697('0x5'),'chat','fax',_0x9697('0x6'),'whatsapp',_0x9697('0x7')];exports['getChannels']=function(){return channels;};exports['isValidChannel']=function(_0x439c97){_0x439c97=_0x439c97[_0x9697('0x8')]();return _['includes'](channels,_0x439c97);};exports[_0x9697('0x9')]=function(_0x58fa71,_0x2ab944,_0x1d7d84,_0x59e817){var _0x3a4a5e={'loginAttempts':_0x2ab944,'blocked':_0x1d7d84};if(!_[_0x9697('0xa')](_0x59e817)){_0x3a4a5e['blockedAt']=_0x59e817;}return _0x58fa71[_0x9697('0xb')](_0x3a4a5e);};exports['getLicense']=function(_0x1e79b4){return new BPromise(function(_0x23bb19,_0xe996e2){var _0x57f768=0x0;if(_0x1e79b4['role']!==_0x9697('0xc')){_0x23bb19(_0x1e79b4);}db[_0x9697('0xd')]['count']({'where':{'role':_0x9697('0xc'),'online':!![],'id':{'$ne':_0x1e79b4['id']}}})[_0x9697('0xe')](function(_0x53fa98){_0x57f768=_0x53fa98;return util[_0x9697('0xf')]();})[_0x9697('0xe')](function(_0x6454c9){if(_0x6454c9&&_0x6454c9[_0x9697('0x10')]&&_0x57f768>=_0x6454c9[_0x9697('0x10')]){throw Error(_0x9697('0x11'));}_0x23bb19(_0x1e79b4);})[_0x9697('0x12')](function(_0x1e5e3b){_0xe996e2(_0x1e5e3b);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index f72647e..f4d47d4 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x50c2=['render','status','send','404'];(function(_0x3869fa,_0x16ef3f){var _0x209652=function(_0x527167){while(--_0x527167){_0x3869fa['push'](_0x3869fa['shift']());}};_0x209652(++_0x16ef3f);}(_0x50c2,0x127));var _0x250c=function(_0x3a28e2,_0x58325a){_0x3a28e2=_0x3a28e2-0x0;var _0xfd325a=_0x50c2[_0x3a28e2];return _0xfd325a;};'use strict';module['exports'][0x194]=function pageNotFound(_0x3cb382,_0x2811c8){var _0x441239=_0x250c('0x0');var _0x3ab150=0x194;var _0x5b9fd9={'status':_0x3ab150};_0x2811c8['status'](_0x5b9fd9['status']);_0x2811c8[_0x250c('0x1')](_0x441239,{},function(_0x5c0d5f,_0x1c96b5){if(_0x5c0d5f){return _0x2811c8[_0x250c('0x2')](_0x5b9fd9[_0x250c('0x2')])['json'](_0x5b9fd9);}_0x2811c8[_0x250c('0x3')](_0x1c96b5);});}; \ No newline at end of file +var _0x6379=['404','status','render','json','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6379,0xc7));var _0x9637=function(_0x1d0a89,_0x11eda8){_0x1d0a89=_0x1d0a89-0x0;var _0x29a843=_0x6379[_0x1d0a89];return _0x29a843;};'use strict';module[_0x9637('0x0')][0x194]=function pageNotFound(_0xfb5d15,_0x366c3f){var _0x38eb25=_0x9637('0x1');var _0x568c7e=0x194;var _0x1d46dc={'status':_0x568c7e};_0x366c3f[_0x9637('0x2')](_0x1d46dc[_0x9637('0x2')]);_0x366c3f[_0x9637('0x3')](_0x38eb25,{},function(_0x46c912,_0x4c75b1){if(_0x46c912){return _0x366c3f[_0x9637('0x2')](_0x1d46dc[_0x9637('0x2')])[_0x9637('0x4')](_0x1d46dc);}_0x366c3f['send'](_0x4c75b1);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 627c6e8..397aaed 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa571=['../api/openchannelTransferReport/openchannelTransferReport.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','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappTransferReport','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','User','hasOne','Recordings','UserId','hasMany','VoiceQueuesRt','Extensions','cascade','CmHopperFinal','HopperFinals','HopperHistory','ReportAgentPreview','OpenchannelInteractions','ChatInteractions','FaxInteraction','FaxInteractions','MailInteractions','WhatsappInteraction','WhatsappInteractions','UserNotifications','belongsTo','userProfileId','belongsToMany','chat_group_has_users','Contacts','Lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','MailQueue','UserMailQueue','ChatQueues','FaxQueues','OpenchannelQueues','cm_user_has_lists','ChatWebsite','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','SpiedAgents','ChanSpyId','Applications','Sounds','CmHopper','Hoppers','VoiceQueueId','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','VoiceRecording','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','ContactId','MailAccountId','Imap','Smtp','Dispositions','Answers','Interactions','List','TemplateId','user_has_mail_accounts','team_has_mail_queues','MailInteractionId','Account','Contact','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','Interaction','ChatOfflineMessage','ChatOfflineMessageId','restrict','ListId','Dashboard','Items','FaxAccountId','Exntensions','TagId','FaxInteractionId','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccountId','sms_interaction_has_tags','SmsInteractionId','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','ChatWebsiteId','ProactiveActions','ChatApplication','Agent','Queue','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','UserChatQueue','team_has_chat_queues','ChatInternalMessage','ChatGroupId','Website','HopperHistories','Company','cm_user_has_contacts','cm_contact_has_tags','CampaignId','OwnerId','All','Any','OneAny','AutomationAnyId','Actions','ParentId','Intervals','MailApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','moh_has_sounds','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','AnalyticMetric','MetricId','Configurations','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','SalesforceAccount','Subject','Description','Field','Variable','VariableId','SugarcrmConfiguration','DeskField','int_desk_configuration_has_tags','ZohoConfiguration','ZendeskAccount','ZendeskField','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','ServicenowConfiguration','Dynamics365Field','Dynamics365Account','FreshsalesConfiguration','FreshsalesField','ToId','JscriptyQuestionReport','SessionId','JscriptyAnswerReport','ProjectId','user_has_square_projects','MailQueues','SmsQueues','WhatsappQueues','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToMailAccountId','ToAccount','FromChatWebsiteId','ToChatQueueId','ToQueue','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','FromSmsAccountId','CmCustomField','CustomFields','Queues','UserProfileSection','UserProfileSections','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappQueueReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','team_has_whatsapp_queues','../config/environment','sequelize','lodash','jstz','defaultsDeep','xcall','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','motion2','xC@LL1234','username','password','options','VoiceChanSpy','import','VoiceContext','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelQueue','OpenchannelQueueReport','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','Disposition','../api/disposition/disposition.model','Condition','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','Tag','../api/tag/tag.model','Template','Trigger','../api/trigger/trigger.model','../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','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','FreshdeskConfiguration','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','ServicenowAccount','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport'];(function(_0x291d66,_0x40f811){var _0x1830e9=function(_0x398b6f){while(--_0x398b6f){_0x291d66['push'](_0x291d66['shift']());}};_0x1830e9(++_0x40f811);}(_0xa571,0x107));var _0x1a57=function(_0x11b134,_0x316589){_0x11b134=_0x11b134-0x0;var _0x3c2d37=_0xa571[_0x11b134];return _0x3c2d37;};'use strict';var config=require(_0x1a57('0x0'));var Sequelize=require(_0x1a57('0x1'));var _=require(_0x1a57('0x2'));var jstz=require(_0x1a57('0x3'));var timezone=jstz['determine']();config[_0x1a57('0x1')]=_[_0x1a57('0x4')](config['sequelize'],{'database':'motion2','username':_0x1a57('0x5'),'password':'xC@LL1234','options':{'host':_0x1a57('0x6'),'port':0xcea,'dialect':_0x1a57('0x7'),'dialectOptions':{'charset':_0x1a57('0x8')},'logging':![],'timezone':timezone[_0x1a57('0x9')](),'define':{'charset':_0x1a57('0xa'),'collate':_0x1a57('0xb')}}});config['sequelizeHistory']=_[_0x1a57('0x4')](config[_0x1a57('0xc')],{'database':_0x1a57('0xd'),'username':'xcall','password':_0x1a57('0xe'),'options':{'host':_0x1a57('0x6'),'port':0xcea,'dialect':_0x1a57('0x7'),'dialectOptions':{'charset':_0x1a57('0x8')},'logging':![],'timezone':timezone[_0x1a57('0x9')](),'define':{'charset':_0x1a57('0xa'),'collate':_0x1a57('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x1a57('0x1')]['database'],config['sequelize'][_0x1a57('0xf')],config[_0x1a57('0x1')][_0x1a57('0x10')],config['sequelize'][_0x1a57('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x1a57('0xc')]['database'],config[_0x1a57('0xc')]['username'],config[_0x1a57('0xc')][_0x1a57('0x10')],config[_0x1a57('0xc')][_0x1a57('0x11')])};db['User']=db[_0x1a57('0x1')]['import']('../api/user/user.model');db[_0x1a57('0x12')]=db[_0x1a57('0x1')][_0x1a57('0x13')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0x1a57('0x14')]=db[_0x1a57('0x1')][_0x1a57('0x13')]('../api/voiceContext/voiceContext.model');db[_0x1a57('0x15')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x16'));db[_0x1a57('0x17')]=db['sequelize']['import'](_0x1a57('0x18'));db[_0x1a57('0x19')]=db[_0x1a57('0x1')]['import']('../api/voiceQueue/voiceQueue.model');db['VoiceRecording']=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x1a'));db[_0x1a57('0x1b')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x1c'));db[_0x1a57('0x1d')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x1e'));db[_0x1a57('0x1f')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x20'));db[_0x1a57('0x21')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x22'));db[_0x1a57('0x23')]=db[_0x1a57('0x1')][_0x1a57('0x13')]('../api/voiceDialReport/voiceDialReport.model');db['VoiceAgentReport']=db[_0x1a57('0x1')][_0x1a57('0x13')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0x1a57('0x24')]=db['sequelize'][_0x1a57('0x13')](_0x1a57('0x25'));db['MemberReport']=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x26'));db[_0x1a57('0x27')]=db['sequelize'][_0x1a57('0x13')](_0x1a57('0x28'));db[_0x1a57('0x29')]=db[_0x1a57('0x1')]['import'](_0x1a57('0x2a'));db[_0x1a57('0x2b')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x2c'));db[_0x1a57('0x2d')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x2e'));db['UserChatQueue']=db[_0x1a57('0x1')][_0x1a57('0x13')]('../api/userChatQueue/userChatQueue.model');db['UserMailQueue']=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x2f'));db[_0x1a57('0x30')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x31'));db[_0x1a57('0x32')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x33'));db[_0x1a57('0x34')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x35'));db[_0x1a57('0x36')]=db[_0x1a57('0x1')][_0x1a57('0x13')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0x1a57('0x37')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x38'));db[_0x1a57('0x39')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x3a'));db[_0x1a57('0x3b')]=db['sequelize']['import']('../api/mailAccount/mailAccount.model');db['MailQueue']=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x3c'));db['MailSubstatus']=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x3d'));db[_0x1a57('0x3e')]=db['sequelize'][_0x1a57('0x13')]('../api/mailInteraction/mailInteraction.model');db[_0x1a57('0x3f')]=db[_0x1a57('0x1')][_0x1a57('0x13')]('../api/mailMessage/mailMessage.model');db[_0x1a57('0x40')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x41'));db[_0x1a57('0x42')]=db['sequelize'][_0x1a57('0x13')]('../api/mailQueueReport/mailQueueReport.model');db['Dashboard']=db[_0x1a57('0x1')]['import'](_0x1a57('0x43'));db[_0x1a57('0x44')]=db[_0x1a57('0x1')]['import'](_0x1a57('0x45'));db[_0x1a57('0x46')]=db[_0x1a57('0x1')][_0x1a57('0x13')]('../api/faxAccount/faxAccount.model');db[_0x1a57('0x47')]=db[_0x1a57('0x1')]['import'](_0x1a57('0x48'));db['FaxInteraction']=db['sequelize'][_0x1a57('0x13')](_0x1a57('0x49'));db[_0x1a57('0x4a')]=db[_0x1a57('0x1')]['import'](_0x1a57('0x4b'));db[_0x1a57('0x4c')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x4d'));db['FaxQueueReport']=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x4e'));db[_0x1a57('0x4f')]=db['sequelize'][_0x1a57('0x13')]('../api/smsAccount/smsAccount.model');db[_0x1a57('0x50')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x51'));db[_0x1a57('0x52')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x53'));db[_0x1a57('0x54')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x55'));db[_0x1a57('0x56')]=db['sequelize'][_0x1a57('0x13')](_0x1a57('0x57'));db[_0x1a57('0x58')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x59'));db[_0x1a57('0x5a')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x5b'));db[_0x1a57('0x5c')]=db['sequelize'][_0x1a57('0x13')](_0x1a57('0x5d'));db['OpenchannelMessage']=db[_0x1a57('0x1')][_0x1a57('0x13')]('../api/openchannelMessage/openchannelMessage.model');db[_0x1a57('0x5e')]=db[_0x1a57('0x1')]['import']('../api/openchannelQueue/openchannelQueue.model');db['ChatWebsite']=db[_0x1a57('0x1')][_0x1a57('0x13')]('../api/chatWebsite/chatWebsite.model');db[_0x1a57('0x5f')]=db[_0x1a57('0x1')]['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db['ChatApplication']=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x60'));db[_0x1a57('0x61')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x62'));db[_0x1a57('0x63')]=db['sequelize']['import']('../api/chatMessage/chatMessage.model');db['ChatOfflineMessage']=db['sequelize'][_0x1a57('0x13')](_0x1a57('0x64'));db[_0x1a57('0x65')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x66'));db[_0x1a57('0x67')]=db[_0x1a57('0x1')]['import']('../api/chatGroup/chatGroup.model');db['ChatProactiveAction']=db[_0x1a57('0x1')]['import'](_0x1a57('0x68'));db[_0x1a57('0x69')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x6a'));db[_0x1a57('0x6b')]=db[_0x1a57('0x1')]['import']('../api/cmContact/cmContact.model');db['CmHopper']=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x6c'));db[_0x1a57('0x6d')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x6e'));db['CmHopperFinal']=db['sequelize'][_0x1a57('0x13')](_0x1a57('0x6f'));db[_0x1a57('0x70')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x71'));db['ReportAgentPreview']=db['sequelize'][_0x1a57('0x13')](_0x1a57('0x72'));db['CmCustomField']=db['sequelize'][_0x1a57('0x13')](_0x1a57('0x73'));db[_0x1a57('0x74')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x75'));db[_0x1a57('0x76')]=db['sequelize']['import'](_0x1a57('0x77'));db[_0x1a57('0x78')]=db[_0x1a57('0x1')][_0x1a57('0x13')]('../api/cannedAnswer/cannedAnswer.model');db[_0x1a57('0x79')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x7a'));db[_0x1a57('0x7b')]=db['sequelize']['import']('../api/condition/condition.model');db[_0x1a57('0x7c')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x7d'));db[_0x1a57('0x7e')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x7f'));db['Cdr']=db[_0x1a57('0x1')][_0x1a57('0x13')]('../api/cdr/cdr.model');db['VoiceQueuesLog']=db[_0x1a57('0x1')]['import'](_0x1a57('0x80'));db[_0x1a57('0x81')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x82'));db[_0x1a57('0x83')]=db[_0x1a57('0x1')][_0x1a57('0x13')]('../api/sound/sound.model');db[_0x1a57('0x84')]=db[_0x1a57('0x1')]['import'](_0x1a57('0x85'));db[_0x1a57('0x86')]=db[_0x1a57('0x1')]['import']('../api/template/template.model');db[_0x1a57('0x87')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x88'));db['Variable']=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x89'));db[_0x1a57('0x8a')]=db[_0x1a57('0x1')]['import'](_0x1a57('0x8b'));db[_0x1a57('0x8c')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x8d'));db[_0x1a57('0x8e')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x8f'));db[_0x1a57('0x90')]=db[_0x1a57('0x1')]['import'](_0x1a57('0x91'));db[_0x1a57('0x92')]=db['sequelize'][_0x1a57('0x13')](_0x1a57('0x93'));db['AnalyticMetric']=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x94'));db[_0x1a57('0x95')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x96'));db[_0x1a57('0x97')]=db['sequelize'][_0x1a57('0x13')](_0x1a57('0x98'));db['SalesforceAccount']=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x99'));db[_0x1a57('0x9a')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x9b'));db[_0x1a57('0x9c')]=db[_0x1a57('0x1')]['import'](_0x1a57('0x9d'));db[_0x1a57('0x9e')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x9f'));db['SugarcrmConfiguration']=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0xa0'));db[_0x1a57('0xa1')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0xa2'));db[_0x1a57('0xa3')]=db['sequelize'][_0x1a57('0x13')](_0x1a57('0xa4'));db[_0x1a57('0xa5')]=db[_0x1a57('0x1')]['import']('../api/intDeskConfiguration/intDeskConfiguration.model');db['DeskField']=db['sequelize']['import'](_0x1a57('0xa6'));db[_0x1a57('0xa7')]=db['sequelize'][_0x1a57('0x13')](_0x1a57('0xa8'));db['ZohoConfiguration']=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0xa9'));db[_0x1a57('0xaa')]=db['sequelize'][_0x1a57('0x13')](_0x1a57('0xab'));db['ZendeskAccount']=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0xac'));db[_0x1a57('0xad')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0xae'));db['ZendeskField']=db[_0x1a57('0x1')]['import'](_0x1a57('0xaf'));db[_0x1a57('0xb0')]=db[_0x1a57('0x1')][_0x1a57('0x13')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0x1a57('0xb1')]=db[_0x1a57('0x1')][_0x1a57('0x13')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x1a57('0xb2')]=db[_0x1a57('0x1')][_0x1a57('0x13')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0x1a57('0xb3')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0xb4'));db[_0x1a57('0xb5')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0xb6'));db[_0x1a57('0xb7')]=db[_0x1a57('0x1')][_0x1a57('0x13')]('../api/intVtigerField/intVtigerField.model');db[_0x1a57('0xb8')]=db['sequelize'][_0x1a57('0x13')]('../api/intServicenowAccount/intServicenowAccount.model');db['ServicenowConfiguration']=db['sequelize']['import'](_0x1a57('0xb9'));db[_0x1a57('0xba')]=db[_0x1a57('0x1')]['import'](_0x1a57('0xbb'));db['Dynamics365Account']=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0xbc'));db[_0x1a57('0xbd')]=db[_0x1a57('0x1')][_0x1a57('0x13')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db['Dynamics365Field']=db[_0x1a57('0x1')]['import'](_0x1a57('0xbe'));db[_0x1a57('0xbf')]=db['sequelize'][_0x1a57('0x13')](_0x1a57('0xc0'));db['FreshsalesConfiguration']=db[_0x1a57('0x1')][_0x1a57('0x13')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db['FreshsalesField']=db[_0x1a57('0x1')]['import'](_0x1a57('0xc1'));db[_0x1a57('0x8a')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0x8b'));db[_0x1a57('0xc2')]=db[_0x1a57('0x1')]['import'](_0x1a57('0xc3'));db[_0x1a57('0xc4')]=db[_0x1a57('0x1')]['import']('../api/chatQueueReport/chatQueueReport.model');db['ChatInternalMessage']=db[_0x1a57('0x1')][_0x1a57('0x13')]('../api/chatInternalMessage/chatInternalMessage.model');db['JscriptyAnswerReport']=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0xc5'));db['JscriptyQuestionReport']=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0xc6'));db[_0x1a57('0xc7')]=db['sequelize'][_0x1a57('0x13')](_0x1a57('0xc8'));db[_0x1a57('0xc9')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0xca'));db[_0x1a57('0xcb')]=db[_0x1a57('0x1')][_0x1a57('0x13')]('../api/squareReport/squareReport.model');db[_0x1a57('0xcc')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0xcd'));db[_0x1a57('0xce')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0xcf'));db[_0x1a57('0xd0')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0xd1'));db[_0x1a57('0xd2')]=db['sequelize'][_0x1a57('0x13')](_0x1a57('0xd3'));db[_0x1a57('0xd4')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0xd5'));db['SquareRecording']=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0xd6'));db[_0x1a57('0xd7')]=db[_0x1a57('0x1')]['import'](_0x1a57('0xd8'));db[_0x1a57('0xd9')]=db['sequelize'][_0x1a57('0x13')](_0x1a57('0xda'));db[_0x1a57('0xdb')]=db[_0x1a57('0x1')]['import']('../api/license/license.model');db[_0x1a57('0xdc')]=db[_0x1a57('0x1')]['import'](_0x1a57('0xdd'));db[_0x1a57('0xde')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0xdf'));db[_0x1a57('0xe0')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0xe1'));db[_0x1a57('0xe2')]=db[_0x1a57('0x1')][_0x1a57('0x13')]('../api/plugin/plugin.model');db[_0x1a57('0xe3')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0xe4'));db[_0x1a57('0xe5')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0xe6'));db[_0x1a57('0xe7')]=db['sequelize'][_0x1a57('0x13')](_0x1a57('0xe8'));db[_0x1a57('0xe9')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0xea'));db[_0x1a57('0xeb')]=db['sequelize'][_0x1a57('0x13')](_0x1a57('0xec'));db[_0x1a57('0xed')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0xee'));db[_0x1a57('0xef')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0xf0'));db[_0x1a57('0xf1')]=db['sequelize']['import'](_0x1a57('0xf2'));db['UserProfileSection']=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0xf3'));db[_0x1a57('0xf4')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0xf5'));db[_0x1a57('0xf6')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0xf7'));db[_0x1a57('0xf8')]=db[_0x1a57('0x1')]['import']('../api/whatsappAccount/whatsappAccount.model');db[_0x1a57('0xf9')]=db['sequelize'][_0x1a57('0x13')](_0x1a57('0xfa'));db['WhatsappInteraction']=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0xfb'));db[_0x1a57('0xfc')]=db[_0x1a57('0x1')][_0x1a57('0x13')](_0x1a57('0xfd'));db['WhatsappQueueReport']=db[_0x1a57('0x1')][_0x1a57('0x13')]('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0x1a57('0xfe')]=db[_0x1a57('0x1')][_0x1a57('0x13')]('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0x1a57('0xff')]=db['sequelize']['import'](_0x1a57('0x100'));db['CloudProvider']=db['sequelize'][_0x1a57('0x13')](_0x1a57('0x101'));db[_0x1a57('0x102')]=db[_0x1a57('0x1')]['import'](_0x1a57('0x103'));db[_0x1a57('0x104')]=db['sequelize'][_0x1a57('0x13')](_0x1a57('0x105'));db[_0x1a57('0x106')]=db[_0x1a57('0x1')]['import']('../api/userVoicePrefix/userVoicePrefix.model');db[_0x1a57('0x107')][_0x1a57('0x108')](db[_0x1a57('0x1d')],{'as':_0x1a57('0x1d'),'onDelete':'cascade','foreignKey':'UserId'});db[_0x1a57('0x107')]['hasMany'](db['VoiceRecording'],{'as':_0x1a57('0x109'),'foreignKey':_0x1a57('0x10a')});db[_0x1a57('0x107')][_0x1a57('0x10b')](db[_0x1a57('0x2b')],{'as':_0x1a57('0x10c'),'foreignKey':_0x1a57('0x10a')});db[_0x1a57('0x107')][_0x1a57('0x10b')](db[_0x1a57('0x15')],{'as':_0x1a57('0x10d'),'onDelete':_0x1a57('0x10e'),'hooks':!![]});db[_0x1a57('0x107')]['hasMany'](db[_0x1a57('0x10f')],{'as':_0x1a57('0x110'),'foreignKey':_0x1a57('0x10a')});db[_0x1a57('0x107')][_0x1a57('0x10b')](db[_0x1a57('0x70')],{'as':_0x1a57('0x111'),'foreignKey':_0x1a57('0x10a')});db[_0x1a57('0x107')][_0x1a57('0x10b')](db['ReportAgentPreview'],{'as':_0x1a57('0x112'),'foreignKey':_0x1a57('0x10a')});db[_0x1a57('0x107')][_0x1a57('0x10b')](db[_0x1a57('0x5c')],{'as':_0x1a57('0x113'),'foreignKey':_0x1a57('0x10a')});db[_0x1a57('0x107')]['hasMany'](db[_0x1a57('0x61')],{'as':_0x1a57('0x114'),'foreignKey':'UserId'});db[_0x1a57('0x107')][_0x1a57('0x10b')](db[_0x1a57('0x52')],{'as':'SmsInteractions','foreignKey':_0x1a57('0x10a')});db['User'][_0x1a57('0x10b')](db[_0x1a57('0x115')],{'as':_0x1a57('0x116'),'foreignKey':_0x1a57('0x10a')});db[_0x1a57('0x107')]['hasMany'](db[_0x1a57('0x3e')],{'as':_0x1a57('0x117'),'foreignKey':_0x1a57('0x10a')});db[_0x1a57('0x107')][_0x1a57('0x10b')](db[_0x1a57('0x118')],{'as':_0x1a57('0x119'),'foreignKey':_0x1a57('0x10a')});db[_0x1a57('0x107')][_0x1a57('0x10b')](db[_0x1a57('0xf6')],{'as':_0x1a57('0x11a'),'foreignKey':'SenderId'});db['User'][_0x1a57('0x11b')](db['UserProfile'],{'as':_0x1a57('0xf1'),'foreignKey':_0x1a57('0x11c')});db['User'][_0x1a57('0x11d')](db[_0x1a57('0x67')],{'as':'Groups','through':_0x1a57('0x11e')});db['User'][_0x1a57('0x11d')](db[_0x1a57('0x6b')],{'as':_0x1a57('0x11f'),'through':'cm_user_has_contacts'});db[_0x1a57('0x107')][_0x1a57('0x11d')](db[_0x1a57('0xed')],{'as':_0x1a57('0x120'),'through':'cm_user_has_lists'});db[_0x1a57('0x107')][_0x1a57('0x11d')](db['Team'],{'through':_0x1a57('0x121')});db[_0x1a57('0x107')][_0x1a57('0x11d')](db[_0x1a57('0x3e')],{'as':'MailInteractions','through':_0x1a57('0x122')});db[_0x1a57('0x107')][_0x1a57('0x11d')](db['ChatInteraction'],{'as':_0x1a57('0x114'),'through':_0x1a57('0x123')});db[_0x1a57('0x107')]['belongsToMany'](db['FaxInteraction'],{'as':_0x1a57('0x116'),'through':_0x1a57('0x124')});db[_0x1a57('0x107')]['belongsToMany'](db[_0x1a57('0x52')],{'as':'SmsInteractions','through':_0x1a57('0x125')});db['User']['belongsToMany'](db[_0x1a57('0x5c')],{'as':_0x1a57('0x113'),'through':_0x1a57('0x126')});db[_0x1a57('0x107')][_0x1a57('0x11d')](db[_0x1a57('0x118')],{'as':_0x1a57('0x119'),'through':_0x1a57('0x127')});db['User']['belongsToMany'](db['VoiceQueue'],{'as':_0x1a57('0x128'),'through':'UserVoiceQueue','required':![]});db[_0x1a57('0x107')]['belongsToMany'](db[_0x1a57('0xef')],{'as':_0x1a57('0x129'),'through':_0x1a57('0x106'),'required':![]});db[_0x1a57('0x107')][_0x1a57('0x11d')](db[_0x1a57('0x12a')],{'as':'MailQueues','through':_0x1a57('0x12b'),'required':![]});db[_0x1a57('0x107')][_0x1a57('0x11d')](db[_0x1a57('0x65')],{'as':_0x1a57('0x12c'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0x1a57('0x107')]['belongsToMany'](db[_0x1a57('0x4c')],{'as':_0x1a57('0x12d'),'through':_0x1a57('0x30'),'required':![]});db[_0x1a57('0x107')]['belongsToMany'](db[_0x1a57('0x56')],{'as':'SmsQueues','through':'UserSmsQueue','required':![]});db[_0x1a57('0x107')][_0x1a57('0x11d')](db[_0x1a57('0x5e')],{'as':_0x1a57('0x12e'),'through':'UserOpenchannelQueue','required':![]});db['User'][_0x1a57('0x11d')](db[_0x1a57('0xff')],{'as':'WhatsappQueues','through':_0x1a57('0x36'),'required':![]});db['User'][_0x1a57('0x11d')](db[_0x1a57('0xed')],{'through':_0x1a57('0x12f')});db[_0x1a57('0x107')][_0x1a57('0x11d')](db[_0x1a57('0x130')],{'as':_0x1a57('0x131'),'through':_0x1a57('0x132')});db[_0x1a57('0x107')][_0x1a57('0x11d')](db[_0x1a57('0x46')],{'as':_0x1a57('0x133'),'through':_0x1a57('0x134')});db[_0x1a57('0x107')][_0x1a57('0x11d')](db['MailAccount'],{'as':'MailAccounts','through':'user_has_mail_accounts'});db[_0x1a57('0x107')][_0x1a57('0x11d')](db[_0x1a57('0x58')],{'as':'OpenchannelAccounts','through':'user_has_openchannel_accounts'});db[_0x1a57('0x107')][_0x1a57('0x11d')](db[_0x1a57('0x4f')],{'as':_0x1a57('0x135'),'through':_0x1a57('0x136')});db['User'][_0x1a57('0x11d')](db[_0x1a57('0xf8')],{'as':_0x1a57('0x137'),'through':_0x1a57('0x138')});db[_0x1a57('0x107')][_0x1a57('0x11d')](db[_0x1a57('0xd4')],{'as':_0x1a57('0x139'),'through':'user_has_square_projects'});db['VoiceChanSpy']['hasMany'](db[_0x1a57('0x15')],{'as':_0x1a57('0x13a'),'onDelete':_0x1a57('0x10e'),'foreignKey':_0x1a57('0x13b')});db[_0x1a57('0x14')][_0x1a57('0x10b')](db[_0x1a57('0x15')],{'onDelete':_0x1a57('0x10e')});db[_0x1a57('0x15')]['hasMany'](db[_0x1a57('0x15')],{'as':_0x1a57('0x13c'),'onDelete':_0x1a57('0x10e')});db[_0x1a57('0x17')]['belongsToMany'](db[_0x1a57('0x83')],{'as':_0x1a57('0x13d'),'through':'moh_has_sounds'});db[_0x1a57('0x19')][_0x1a57('0x10b')](db[_0x1a57('0x2b')],{'as':'Members','foreignKey':'VoiceQueueId'});db[_0x1a57('0x19')][_0x1a57('0x10b')](db[_0x1a57('0x13e')],{'as':_0x1a57('0x13f'),'foreignKey':_0x1a57('0x140')});db[_0x1a57('0x19')][_0x1a57('0x10b')](db['CmHopperFinal'],{'as':_0x1a57('0x110'),'foreignKey':_0x1a57('0x140')});db[_0x1a57('0x19')][_0x1a57('0x10b')](db[_0x1a57('0x70')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db[_0x1a57('0x19')][_0x1a57('0x10b')](db[_0x1a57('0x112')],{'as':_0x1a57('0x112'),'foreignKey':_0x1a57('0x140')});db['VoiceQueue'][_0x1a57('0x10b')](db[_0x1a57('0x6d')],{'as':_0x1a57('0x141'),'foreignKey':_0x1a57('0x140')});db[_0x1a57('0x19')][_0x1a57('0x10b')](db[_0x1a57('0xc7')],{'as':_0x1a57('0x142'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x1a57('0x11b')](db[_0x1a57('0x27')],{'as':_0x1a57('0x27'),'foreignKey':_0x1a57('0x143')});db[_0x1a57('0x19')]['belongsTo'](db['Trunk'],{'as':_0x1a57('0x144'),'foreignKey':_0x1a57('0x145')});db[_0x1a57('0x19')][_0x1a57('0x11b')](db['Interval'],{'as':'Interval','foreignKey':_0x1a57('0x146')});db[_0x1a57('0x19')][_0x1a57('0x11b')](db[_0x1a57('0x7e')],{'as':_0x1a57('0x147'),'foreignKey':_0x1a57('0x148')});db[_0x1a57('0x19')]['belongsToMany'](db[_0x1a57('0xed')],{'as':'Lists','through':_0x1a57('0x149')});db[_0x1a57('0x19')][_0x1a57('0x11d')](db[_0x1a57('0x107')],{'as':_0x1a57('0x14a'),'through':_0x1a57('0x2d')});db['VoiceQueue'][_0x1a57('0x11d')](db['Team'],{'as':_0x1a57('0x14b'),'through':'TeamVoiceQueue'});db[_0x1a57('0x19')][_0x1a57('0x11d')](db['CmList'],{'as':_0x1a57('0x14c'),'through':_0x1a57('0x14d')});db[_0x1a57('0x14e')][_0x1a57('0x11b')](db['User'],{'as':_0x1a57('0x107'),'foreignKey':_0x1a57('0x10a')});db[_0x1a57('0x1b')][_0x1a57('0x11b')](db[_0x1a57('0x107')],{'as':'User','foreignKey':_0x1a57('0x10a')});db[_0x1a57('0x1d')][_0x1a57('0x10b')](db[_0x1a57('0x1f')],{'as':_0x1a57('0x14f'),'onDelete':_0x1a57('0x10e'),'foreignKey':_0x1a57('0x150'),'sourceKey':_0x1a57('0x151')});db[_0x1a57('0x1f')]['belongsTo'](db[_0x1a57('0x1d')],{'foreignKey':'mailboxuser','targetKey':_0x1a57('0x151')});db[_0x1a57('0x21')]['hasMany'](db[_0x1a57('0x24')],{'as':_0x1a57('0x152'),'foreignKey':_0x1a57('0x153'),'constraints':![]});db[_0x1a57('0x21')]['hasMany'](db[_0x1a57('0x154')],{'as':_0x1a57('0x155'),'foreignKey':'uniqueid','constraints':![]});db[_0x1a57('0x21')][_0x1a57('0x11b')](db[_0x1a57('0x107')],{'as':_0x1a57('0x107'),'foreignKey':_0x1a57('0x10a')});db[_0x1a57('0x21')][_0x1a57('0x11b')](db[_0x1a57('0x6b')],{'as':'Contact','foreignKey':_0x1a57('0x156')});db['MailServerIn'][_0x1a57('0x11b')](db[_0x1a57('0x3b')],{'as':_0x1a57('0x3b'),'foreignKey':_0x1a57('0x157')});db[_0x1a57('0x39')][_0x1a57('0x11b')](db[_0x1a57('0x3b')],{'as':_0x1a57('0x3b'),'foreignKey':'MailAccountId'});db[_0x1a57('0x3b')][_0x1a57('0x108')](db[_0x1a57('0x37')],{'as':_0x1a57('0x158'),'onDelete':_0x1a57('0x10e')});db[_0x1a57('0x3b')]['hasOne'](db[_0x1a57('0x39')],{'as':_0x1a57('0x159'),'onDelete':_0x1a57('0x10e')});db[_0x1a57('0x3b')]['hasMany'](db[_0x1a57('0x79')],{'as':_0x1a57('0x15a'),'foreignKey':'MailAccountId','onDelete':_0x1a57('0x10e')});db['MailAccount']['hasMany'](db[_0x1a57('0x78')],{'as':_0x1a57('0x15b'),'foreignKey':'MailAccountId'});db[_0x1a57('0x3b')][_0x1a57('0x10b')](db[_0x1a57('0x3f')],{'as':_0x1a57('0x14f'),'foreignKey':_0x1a57('0x157')});db[_0x1a57('0x3b')][_0x1a57('0x10b')](db[_0x1a57('0x3e')],{'as':_0x1a57('0x15c')});db['MailAccount'][_0x1a57('0x10b')](db[_0x1a57('0x40')],{'as':_0x1a57('0x13c')});db[_0x1a57('0x3b')][_0x1a57('0x11b')](db[_0x1a57('0xed')],{'as':_0x1a57('0x15d'),'foreignKey':'ListId'});db[_0x1a57('0x3b')][_0x1a57('0x11b')](db[_0x1a57('0x86')],{'as':'Template','foreignKey':_0x1a57('0x15e')});db[_0x1a57('0x3b')][_0x1a57('0x11b')](db['Pause'],{'as':_0x1a57('0x147'),'foreignKey':'mandatoryDispositionPauseId'});db['MailAccount']['belongsToMany'](db[_0x1a57('0x107')],{'as':_0x1a57('0x14a'),'through':_0x1a57('0x15f')});db[_0x1a57('0x12a')]['belongsToMany'](db[_0x1a57('0x107')],{'as':_0x1a57('0x14a'),'through':_0x1a57('0x12b')});db['MailQueue'][_0x1a57('0x11d')](db[_0x1a57('0xd9')],{'through':_0x1a57('0x160'),'as':_0x1a57('0x14b')});db['MailInteraction'][_0x1a57('0x10b')](db[_0x1a57('0x3f')],{'as':_0x1a57('0x14f'),'onDelete':'cascade','foreignKey':_0x1a57('0x161')});db[_0x1a57('0x3e')][_0x1a57('0x11b')](db[_0x1a57('0x3b')],{'as':_0x1a57('0x162'),'foreignKey':_0x1a57('0x157')});db[_0x1a57('0x3e')][_0x1a57('0x11b')](db['CmContact'],{'as':_0x1a57('0x163'),'foreignKey':_0x1a57('0x156')});db[_0x1a57('0x3e')][_0x1a57('0x11b')](db[_0x1a57('0x107')],{'as':'Owner','foreignKey':_0x1a57('0x10a')});db['MailInteraction'][_0x1a57('0x11d')](db[_0x1a57('0x84')],{'through':_0x1a57('0x164'),'as':_0x1a57('0x165')});db[_0x1a57('0x3e')]['belongsToMany'](db['Tag'],{'through':_0x1a57('0x164'),'as':_0x1a57('0x166')});db['MailInteraction'][_0x1a57('0x11d')](db[_0x1a57('0x107')],{'as':_0x1a57('0x167'),'through':'user_has_mail_interactions','foreignKey':'MailInteractionId'});db['MailMessage'][_0x1a57('0x10b')](db['Attachment'],{'as':_0x1a57('0x168'),'onDelete':'cascade'});db[_0x1a57('0x3f')][_0x1a57('0x11b')](db[_0x1a57('0x107')],{'as':'User'});db['MailMessage'][_0x1a57('0x11b')](db[_0x1a57('0x6b')],{'onDelete':_0x1a57('0x10e'),'as':_0x1a57('0x163')});db['MailMessage']['belongsTo'](db[_0x1a57('0x3e')],{'as':_0x1a57('0x169'),'foreignKey':'MailInteractionId'});db[_0x1a57('0x3f')][_0x1a57('0x11b')](db[_0x1a57('0x3b')],{'as':_0x1a57('0x162'),'foreignKey':_0x1a57('0x157')});db['MailMessage']['belongsTo'](db[_0x1a57('0x130')],{'as':_0x1a57('0x130'),'foreignKey':'ChatWebsiteId'});db[_0x1a57('0x3f')]['belongsTo'](db['ChatOfflineMessage'],{'as':_0x1a57('0x16a'),'foreignKey':_0x1a57('0x16b')});db[_0x1a57('0x40')][_0x1a57('0x11b')](db['User'],{'onDelete':_0x1a57('0x16c')});db[_0x1a57('0x40')][_0x1a57('0x11b')](db[_0x1a57('0x12a')],{'onDelete':'restrict'});db[_0x1a57('0x40')][_0x1a57('0x11b')](db[_0x1a57('0x3b')],{'onDelete':_0x1a57('0x16c')});db[_0x1a57('0x40')][_0x1a57('0x11b')](db[_0x1a57('0x7c')],{'onDelete':'restrict','foreignKey':_0x1a57('0x146')});db[_0x1a57('0x40')][_0x1a57('0x11b')](db[_0x1a57('0x84')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x1a57('0x42')][_0x1a57('0x11b')](db[_0x1a57('0x3b')],{});db[_0x1a57('0x42')][_0x1a57('0x11b')](db[_0x1a57('0xed')],{'as':_0x1a57('0x15d'),'foreignKey':_0x1a57('0x16d')});db['MailQueueReport']['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0x1a57('0x156')});db[_0x1a57('0x42')]['belongsTo'](db[_0x1a57('0x3e')],{});db[_0x1a57('0x42')][_0x1a57('0x11b')](db[_0x1a57('0x3f')],{});db[_0x1a57('0x42')][_0x1a57('0x11b')](db[_0x1a57('0x107')],{});db[_0x1a57('0x42')][_0x1a57('0x11b')](db[_0x1a57('0x12a')],{});db[_0x1a57('0x16e')][_0x1a57('0x10b')](db[_0x1a57('0x44')],{'as':_0x1a57('0x16f'),'onDelete':_0x1a57('0x10e')});db[_0x1a57('0x46')][_0x1a57('0x10b')](db['Disposition'],{'as':_0x1a57('0x15a'),'foreignKey':_0x1a57('0x170'),'onDelete':_0x1a57('0x10e')});db['FaxAccount']['hasMany'](db[_0x1a57('0x78')],{'as':_0x1a57('0x15b'),'foreignKey':_0x1a57('0x170')});db[_0x1a57('0x46')][_0x1a57('0x10b')](db['FaxInteraction'],{'as':_0x1a57('0x15c')});db[_0x1a57('0x46')][_0x1a57('0x10b')](db['FaxApplication'],{'as':'Applications'});db[_0x1a57('0x46')][_0x1a57('0x10b')](db[_0x1a57('0x15')],{'as':_0x1a57('0x171'),'onDelete':_0x1a57('0x10e')});db[_0x1a57('0x46')][_0x1a57('0x10b')](db[_0x1a57('0x4a')],{'as':_0x1a57('0x14f')});db['FaxAccount']['belongsTo'](db['Trunk'],{'as':_0x1a57('0x27')});db[_0x1a57('0x46')][_0x1a57('0x11b')](db[_0x1a57('0xed')],{'as':_0x1a57('0x15d'),'foreignKey':_0x1a57('0x16d')});db[_0x1a57('0x46')][_0x1a57('0x11b')](db[_0x1a57('0x7e')],{'as':_0x1a57('0x147'),'foreignKey':_0x1a57('0x148')});db[_0x1a57('0x46')][_0x1a57('0x11d')](db[_0x1a57('0x107')],{'as':_0x1a57('0x14a'),'through':_0x1a57('0x134')});db[_0x1a57('0x47')]['belongsTo'](db[_0x1a57('0x107')],{'onDelete':_0x1a57('0x16c')});db['FaxApplication'][_0x1a57('0x11b')](db[_0x1a57('0x4c')],{'onDelete':'restrict'});db[_0x1a57('0x47')]['belongsTo'](db[_0x1a57('0x46')],{'onDelete':_0x1a57('0x16c')});db[_0x1a57('0x47')][_0x1a57('0x11b')](db['Tag'],{'onDelete':_0x1a57('0x16c'),'foreignKey':_0x1a57('0x172')});db[_0x1a57('0x115')]['hasMany'](db[_0x1a57('0x4a')],{'as':_0x1a57('0x14f'),'onDelete':'cascade','foreignKey':_0x1a57('0x173')});db[_0x1a57('0x115')][_0x1a57('0x11b')](db['FaxAccount'],{'as':'Account','foreignKey':_0x1a57('0x170')});db['FaxInteraction'][_0x1a57('0x11b')](db[_0x1a57('0x6b')],{'as':_0x1a57('0x163'),'foreignKey':_0x1a57('0x156')});db[_0x1a57('0x115')]['belongsTo'](db[_0x1a57('0x107')],{'as':_0x1a57('0x174'),'foreignKey':_0x1a57('0x10a')});db['FaxInteraction'][_0x1a57('0x11d')](db[_0x1a57('0x84')],{'through':_0x1a57('0x175'),'as':_0x1a57('0x165')});db['FaxInteraction'][_0x1a57('0x11d')](db[_0x1a57('0x84')],{'through':_0x1a57('0x175'),'as':_0x1a57('0x166')});db[_0x1a57('0x115')][_0x1a57('0x11d')](db[_0x1a57('0x107')],{'as':'Users','through':_0x1a57('0x124'),'foreignKey':'FaxInteractionId'});db[_0x1a57('0x4a')][_0x1a57('0x11b')](db[_0x1a57('0x107')],{'onDelete':_0x1a57('0x10e'),'as':_0x1a57('0x107')});db[_0x1a57('0x4a')][_0x1a57('0x11b')](db[_0x1a57('0x115')],{'as':'Interaction','foreignKey':_0x1a57('0x173')});db[_0x1a57('0x4a')][_0x1a57('0x11b')](db[_0x1a57('0x6b')],{'onDelete':_0x1a57('0x10e'),'as':_0x1a57('0x163')});db[_0x1a57('0x4a')][_0x1a57('0x11b')](db[_0x1a57('0xe0')],{'as':_0x1a57('0xe0'),'foreignKey':_0x1a57('0x176')});db[_0x1a57('0x4a')][_0x1a57('0x11b')](db['FaxAccount'],{'as':_0x1a57('0x162'),'foreignKey':_0x1a57('0x170')});db['FaxQueue'][_0x1a57('0x11d')](db[_0x1a57('0x107')],{'as':_0x1a57('0x14a'),'through':'UserFaxQueue'});db[_0x1a57('0x4c')][_0x1a57('0x11d')](db[_0x1a57('0xd9')],{'through':_0x1a57('0x177'),'as':_0x1a57('0x14b')});db[_0x1a57('0x178')][_0x1a57('0x11b')](db['FaxAccount'],{});db[_0x1a57('0x178')]['belongsTo'](db[_0x1a57('0xed')],{'as':_0x1a57('0x15d'),'foreignKey':'ListId'});db['FaxQueueReport'][_0x1a57('0x11b')](db['CmContact'],{'as':'Contact','foreignKey':_0x1a57('0x156')});db[_0x1a57('0x178')][_0x1a57('0x11b')](db[_0x1a57('0x115')],{});db['FaxQueueReport'][_0x1a57('0x11b')](db[_0x1a57('0x4a')],{});db[_0x1a57('0x178')][_0x1a57('0x11b')](db[_0x1a57('0x107')],{});db[_0x1a57('0x178')][_0x1a57('0x11b')](db[_0x1a57('0x4c')],{});db[_0x1a57('0x4f')]['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':_0x1a57('0x179'),'onDelete':_0x1a57('0x10e')});db['SmsAccount'][_0x1a57('0x10b')](db[_0x1a57('0x78')],{'as':_0x1a57('0x15b'),'foreignKey':_0x1a57('0x179')});db[_0x1a57('0x4f')][_0x1a57('0x10b')](db[_0x1a57('0x54')],{'as':'Messages','foreignKey':_0x1a57('0x179')});db['SmsAccount']['hasMany'](db['SmsInteraction'],{'as':_0x1a57('0x15c')});db[_0x1a57('0x4f')][_0x1a57('0x10b')](db['SmsApplication'],{'as':_0x1a57('0x13c')});db[_0x1a57('0x4f')][_0x1a57('0x11b')](db[_0x1a57('0xed')],{'as':'List','foreignKey':_0x1a57('0x16d')});db['SmsAccount']['belongsTo'](db['Pause'],{'as':_0x1a57('0x147'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x1a57('0x4f')]['belongsToMany'](db['User'],{'as':'Agents','through':'user_has_sms_accounts'});db[_0x1a57('0x50')]['belongsTo'](db[_0x1a57('0x107')],{'onDelete':'restrict'});db[_0x1a57('0x50')][_0x1a57('0x11b')](db['SmsQueue'],{'onDelete':_0x1a57('0x16c')});db[_0x1a57('0x50')][_0x1a57('0x11b')](db[_0x1a57('0x4f')],{'onDelete':'restrict'});db[_0x1a57('0x50')]['belongsTo'](db['Interval'],{'onDelete':_0x1a57('0x16c'),'foreignKey':'IntervalId'});db[_0x1a57('0x50')][_0x1a57('0x11b')](db['Tag'],{'onDelete':_0x1a57('0x16c'),'foreignKey':_0x1a57('0x172')});db[_0x1a57('0x52')][_0x1a57('0x10b')](db[_0x1a57('0x54')],{'as':_0x1a57('0x14f'),'onDelete':'cascade','foreignKey':'SmsInteractionId'});db[_0x1a57('0x52')][_0x1a57('0x11b')](db[_0x1a57('0x4f')],{'as':'Account','foreignKey':_0x1a57('0x179')});db['SmsInteraction'][_0x1a57('0x11b')](db[_0x1a57('0x6b')],{'as':_0x1a57('0x163'),'foreignKey':_0x1a57('0x156')});db[_0x1a57('0x52')][_0x1a57('0x11b')](db[_0x1a57('0x107')],{'as':_0x1a57('0x174'),'foreignKey':_0x1a57('0x10a')});db[_0x1a57('0x52')]['belongsToMany'](db[_0x1a57('0x84')],{'through':'sms_interaction_has_tags','as':_0x1a57('0x165')});db[_0x1a57('0x52')][_0x1a57('0x11d')](db[_0x1a57('0x84')],{'through':_0x1a57('0x17a'),'as':_0x1a57('0x166')});db[_0x1a57('0x52')][_0x1a57('0x11d')](db['User'],{'as':_0x1a57('0x167'),'through':_0x1a57('0x125'),'foreignKey':_0x1a57('0x17b')});db['SmsMessage'][_0x1a57('0x11b')](db[_0x1a57('0x107')],{'as':_0x1a57('0x107')});db[_0x1a57('0x54')][_0x1a57('0x11b')](db['CmContact'],{'onDelete':_0x1a57('0x10e'),'as':'Contact'});db[_0x1a57('0x54')][_0x1a57('0x11b')](db['SmsInteraction'],{'onDelete':'cascade','as':_0x1a57('0x169'),'foreignKey':'SmsInteractionId'});db[_0x1a57('0x54')]['belongsTo'](db[_0x1a57('0x4f')],{'as':'Account','foreignKey':'SmsAccountId'});db['SmsQueue'][_0x1a57('0x11d')](db[_0x1a57('0x107')],{'as':_0x1a57('0x14a'),'through':_0x1a57('0x32'),'foreignKey':'SmsQueueId'});db[_0x1a57('0x56')]['belongsToMany'](db[_0x1a57('0xd9')],{'through':_0x1a57('0x17c'),'as':_0x1a57('0x14b')});db[_0x1a57('0x58')][_0x1a57('0x10b')](db[_0x1a57('0x79')],{'as':_0x1a57('0x15a'),'foreignKey':_0x1a57('0x17d'),'onDelete':'cascade'});db[_0x1a57('0x58')]['hasMany'](db[_0x1a57('0x78')],{'as':_0x1a57('0x15b'),'foreignKey':'OpenchannelAccountId'});db[_0x1a57('0x58')][_0x1a57('0x10b')](db[_0x1a57('0x5c')],{'as':_0x1a57('0x15c'),'foreignKey':_0x1a57('0x17d')});db[_0x1a57('0x58')][_0x1a57('0x10b')](db[_0x1a57('0x17e')],{'as':_0x1a57('0x14f'),'foreignKey':_0x1a57('0x17d')});db[_0x1a57('0x58')][_0x1a57('0x10b')](db[_0x1a57('0x5a')],{'as':'Applications','foreignKey':_0x1a57('0x17d')});db['OpenchannelAccount'][_0x1a57('0x11b')](db[_0x1a57('0xed')],{'as':_0x1a57('0x15d'),'foreignKey':_0x1a57('0x16d')});db[_0x1a57('0x58')][_0x1a57('0x11b')](db[_0x1a57('0x7e')],{'as':_0x1a57('0x147'),'foreignKey':_0x1a57('0x148')});db['OpenchannelAccount'][_0x1a57('0x11d')](db[_0x1a57('0x107')],{'as':_0x1a57('0x14a'),'through':'user_has_openchannel_accounts'});db[_0x1a57('0x5a')][_0x1a57('0x11b')](db[_0x1a57('0x107')],{'onDelete':_0x1a57('0x16c')});db[_0x1a57('0x5a')][_0x1a57('0x11b')](db[_0x1a57('0x5e')],{'onDelete':_0x1a57('0x16c'),'foreignKey':_0x1a57('0x17f')});db['OpenchannelApplication'][_0x1a57('0x11b')](db[_0x1a57('0x58')],{'onDelete':'restrict','foreignKey':_0x1a57('0x17d')});db[_0x1a57('0x5a')][_0x1a57('0x11b')](db['Interval'],{'onDelete':_0x1a57('0x16c'),'foreignKey':'IntervalId'});db[_0x1a57('0x5a')][_0x1a57('0x11b')](db[_0x1a57('0x84')],{'onDelete':_0x1a57('0x16c'),'foreignKey':_0x1a57('0x172')});db[_0x1a57('0x5c')]['hasMany'](db[_0x1a57('0x17e')],{'as':'Messages','onDelete':_0x1a57('0x10e'),'foreignKey':'OpenchannelInteractionId'});db[_0x1a57('0x5c')]['belongsTo'](db[_0x1a57('0x58')],{'as':_0x1a57('0x162'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelInteraction'][_0x1a57('0x11b')](db['CmContact'],{'as':'Contact','foreignKey':_0x1a57('0x156')});db[_0x1a57('0x5c')][_0x1a57('0x11b')](db[_0x1a57('0x107')],{'as':_0x1a57('0x174'),'foreignKey':_0x1a57('0x10a')});db[_0x1a57('0x5c')][_0x1a57('0x11d')](db[_0x1a57('0x84')],{'through':_0x1a57('0x180'),'as':_0x1a57('0x165')});db[_0x1a57('0x5c')][_0x1a57('0x11d')](db[_0x1a57('0x84')],{'through':'openchannel_interaction_has_tags','as':_0x1a57('0x166')});db[_0x1a57('0x5c')][_0x1a57('0x11d')](db[_0x1a57('0x107')],{'as':'Users','through':_0x1a57('0x126'),'foreignKey':'OpenchannelInteractionId'});db[_0x1a57('0x17e')][_0x1a57('0x11b')](db['User'],{'onDelete':'cascade','as':_0x1a57('0x107')});db[_0x1a57('0x17e')]['belongsTo'](db[_0x1a57('0x6b')],{'onDelete':'cascade','as':_0x1a57('0x163')});db[_0x1a57('0x17e')][_0x1a57('0x11b')](db['OpenchannelInteraction'],{'onDelete':_0x1a57('0x10e'),'as':_0x1a57('0x169'),'foreignKey':_0x1a57('0x181')});db[_0x1a57('0x17e')][_0x1a57('0x11b')](db[_0x1a57('0xe0')],{'as':_0x1a57('0xe0'),'foreignKey':'AttachmentId'});db[_0x1a57('0x17e')]['belongsTo'](db[_0x1a57('0x58')],{'as':_0x1a57('0x162'),'foreignKey':_0x1a57('0x17d')});db[_0x1a57('0x5e')][_0x1a57('0x11d')](db['User'],{'as':_0x1a57('0x14a'),'through':_0x1a57('0x34'),'foreignKey':_0x1a57('0x17f')});db[_0x1a57('0x5e')]['belongsToMany'](db['Team'],{'through':'team_has_openchannel_queues','as':_0x1a57('0x14b')});db[_0x1a57('0x130')][_0x1a57('0x10b')](db[_0x1a57('0x79')],{'as':'Dispositions','foreignKey':_0x1a57('0x182'),'onDelete':_0x1a57('0x10e')});db[_0x1a57('0x130')][_0x1a57('0x10b')](db['CannedAnswer'],{'as':_0x1a57('0x15b'),'foreignKey':_0x1a57('0x182')});db['ChatWebsite'][_0x1a57('0x10b')](db['ChatProactiveAction'],{'as':_0x1a57('0x183')});db[_0x1a57('0x130')]['hasMany'](db[_0x1a57('0x61')],{'as':_0x1a57('0x15c')});db[_0x1a57('0x130')]['hasMany'](db[_0x1a57('0x184')],{'as':_0x1a57('0x13c')});db[_0x1a57('0x130')]['hasMany'](db['ChatMessage'],{'as':_0x1a57('0x14f')});db[_0x1a57('0x130')][_0x1a57('0x11b')](db[_0x1a57('0xed')],{'as':_0x1a57('0x15d'),'foreignKey':'ListId'});db[_0x1a57('0x130')][_0x1a57('0x11b')](db[_0x1a57('0x7c')],{'as':_0x1a57('0x7c'),'foreignKey':_0x1a57('0x146')});db[_0x1a57('0x130')][_0x1a57('0x11b')](db[_0x1a57('0x3b')],{'as':'MailAccount','foreignKey':_0x1a57('0x157')});db[_0x1a57('0x130')][_0x1a57('0x11b')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x1a57('0x148')});db['ChatWebsite']['belongsToMany'](db[_0x1a57('0x107')],{'as':_0x1a57('0x14a'),'through':'user_has_chat_websites'});db['OpenchannelQueueReport']['belongsTo'](db[_0x1a57('0x58')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0x1a57('0xed')],{'as':_0x1a57('0x15d'),'foreignKey':_0x1a57('0x16d')});db[_0x1a57('0x5f')][_0x1a57('0x11b')](db[_0x1a57('0x6b')],{'as':_0x1a57('0x163'),'foreignKey':_0x1a57('0x156')});db[_0x1a57('0x5f')][_0x1a57('0x11b')](db[_0x1a57('0x5c')],{});db['OpenchannelQueueReport'][_0x1a57('0x11b')](db[_0x1a57('0x17e')],{});db[_0x1a57('0x5f')][_0x1a57('0x11b')](db[_0x1a57('0x107')],{});db['OpenchannelQueueReport'][_0x1a57('0x11b')](db['OpenchannelQueue'],{});db[_0x1a57('0x184')]['belongsTo'](db[_0x1a57('0x107')],{'as':_0x1a57('0x185'),'foreignKey':_0x1a57('0x10a'),'onDelete':_0x1a57('0x16c')});db[_0x1a57('0x184')]['belongsTo'](db[_0x1a57('0x65')],{'as':_0x1a57('0x186'),'foreignKey':_0x1a57('0x187'),'onDelete':_0x1a57('0x16c')});db[_0x1a57('0x184')]['belongsTo'](db[_0x1a57('0x130')],{'as':'Website','foreignKey':'ChatWebsiteId','onDelete':_0x1a57('0x16c')});db['ChatApplication'][_0x1a57('0x11b')](db[_0x1a57('0x84')],{'onDelete':_0x1a57('0x16c'),'foreignKey':_0x1a57('0x172')});db[_0x1a57('0x61')]['hasMany'](db[_0x1a57('0x63')],{'as':_0x1a57('0x14f'),'onDelete':_0x1a57('0x10e'),'foreignKey':_0x1a57('0x188')});db['ChatInteraction'][_0x1a57('0x11b')](db[_0x1a57('0x130')],{'as':_0x1a57('0x162'),'foreignKey':_0x1a57('0x182')});db[_0x1a57('0x61')]['belongsTo'](db['CmContact'],{'as':_0x1a57('0x163'),'foreignKey':_0x1a57('0x156')});db[_0x1a57('0x61')][_0x1a57('0x11b')](db['User'],{'as':_0x1a57('0x174'),'foreignKey':_0x1a57('0x10a')});db['ChatInteraction'][_0x1a57('0x11d')](db['Tag'],{'through':_0x1a57('0x189'),'as':'Tags'});db['ChatInteraction'][_0x1a57('0x11d')](db[_0x1a57('0x84')],{'through':'chat_interaction_has_tags','as':_0x1a57('0x166')});db[_0x1a57('0x61')][_0x1a57('0x11d')](db[_0x1a57('0x107')],{'as':_0x1a57('0x167'),'through':'user_has_chat_interactions','foreignKey':_0x1a57('0x188')});db['ChatMessage'][_0x1a57('0x11b')](db[_0x1a57('0x107')],{'onDelete':_0x1a57('0x10e'),'as':_0x1a57('0x107')});db['ChatMessage'][_0x1a57('0x11b')](db[_0x1a57('0x6b')],{'onDelete':_0x1a57('0x10e'),'as':_0x1a57('0x163'),'foreignKey':_0x1a57('0x156')});db[_0x1a57('0x63')][_0x1a57('0x11b')](db['ChatInteraction'],{'onDelete':_0x1a57('0x10e'),'as':_0x1a57('0x169'),'foreignKey':_0x1a57('0x188')});db[_0x1a57('0x63')]['belongsTo'](db['Attachment'],{'as':_0x1a57('0xe0'),'foreignKey':_0x1a57('0x176')});db['ChatMessage'][_0x1a57('0x11b')](db[_0x1a57('0x130')],{'as':_0x1a57('0x162'),'foreignKey':'ChatWebsiteId'});db[_0x1a57('0x16a')][_0x1a57('0x10b')](db[_0x1a57('0xe0')],{'as':_0x1a57('0x168'),'foreignKey':_0x1a57('0x16b'),'onDelete':_0x1a57('0x10e'),'hooks':!![]});db['ChatOfflineMessage'][_0x1a57('0x11b')](db[_0x1a57('0x6b')],{'onDelete':_0x1a57('0x10e'),'as':_0x1a57('0x163'),'foreignKey':_0x1a57('0x156')});db['ChatOfflineMessage'][_0x1a57('0x11b')](db['ChatWebsite'],{'as':_0x1a57('0x162'),'foreignKey':_0x1a57('0x182')});db[_0x1a57('0x65')]['belongsToMany'](db['User'],{'as':_0x1a57('0x14a'),'through':_0x1a57('0x18a'),'hooks':!![]});db[_0x1a57('0x65')][_0x1a57('0x11d')](db['Team'],{'through':_0x1a57('0x18b'),'as':_0x1a57('0x14b')});db[_0x1a57('0x67')][_0x1a57('0x10b')](db[_0x1a57('0x18c')],{'as':_0x1a57('0x14f'),'foreignKey':_0x1a57('0x18d'),'onDelete':_0x1a57('0x10e')});db['ChatGroup'][_0x1a57('0x11d')](db['User'],{'as':'Members','through':_0x1a57('0x11e')});db['ChatProactiveAction'][_0x1a57('0x11b')](db[_0x1a57('0x130')],{'as':_0x1a57('0x18e'),'foreignKey':_0x1a57('0x182')});db[_0x1a57('0x69')][_0x1a57('0x10b')](db[_0x1a57('0x6b')],{'as':_0x1a57('0x11f'),'foreignKey':'CompanyId'});db[_0x1a57('0x6b')][_0x1a57('0x10b')](db[_0x1a57('0x13e')],{'as':_0x1a57('0x13f'),'foreignKey':_0x1a57('0x156')});db['CmContact']['hasMany'](db[_0x1a57('0x10f')],{'as':_0x1a57('0x110'),'foreignKey':_0x1a57('0x156')});db[_0x1a57('0x6b')]['hasMany'](db['CmHopperHistory'],{'as':_0x1a57('0x18f'),'foreignKey':_0x1a57('0x156')});db['CmContact'][_0x1a57('0x10b')](db['ReportAgentPreview'],{'as':_0x1a57('0x112'),'foreignKey':_0x1a57('0x156')});db[_0x1a57('0x6b')][_0x1a57('0x10b')](db['JscriptySessionReport'],{'as':_0x1a57('0x142'),'foreignKey':'ContactId'});db[_0x1a57('0x6b')][_0x1a57('0x10b')](db[_0x1a57('0x5c')],{'as':_0x1a57('0x113'),'foreignKey':_0x1a57('0x156'),'onDelete':'restrict'});db['CmContact'][_0x1a57('0x10b')](db['ChatInteraction'],{'as':_0x1a57('0x114'),'foreignKey':'ContactId','onDelete':_0x1a57('0x16c')});db['CmContact'][_0x1a57('0x10b')](db[_0x1a57('0x52')],{'as':'SmsInteractions','foreignKey':_0x1a57('0x156'),'onDelete':'restrict'});db[_0x1a57('0x6b')][_0x1a57('0x10b')](db[_0x1a57('0x115')],{'as':'FaxInteractions','foreignKey':_0x1a57('0x156'),'onDelete':_0x1a57('0x16c')});db['CmContact']['hasMany'](db[_0x1a57('0x3e')],{'as':'MailInteractions','foreignKey':_0x1a57('0x156'),'onDelete':_0x1a57('0x16c')});db[_0x1a57('0x6b')][_0x1a57('0x11b')](db[_0x1a57('0x69')],{'as':_0x1a57('0x190'),'foreignKey':'CompanyId'});db['CmContact'][_0x1a57('0x11b')](db[_0x1a57('0xed')],{'as':_0x1a57('0x15d'),'foreignKey':_0x1a57('0x16d'),'onDelete':_0x1a57('0x10e')});db[_0x1a57('0x6b')][_0x1a57('0x11d')](db[_0x1a57('0x107')],{'as':_0x1a57('0x167'),'through':_0x1a57('0x191')});db['CmContact'][_0x1a57('0x11d')](db[_0x1a57('0x84')],{'as':_0x1a57('0x165'),'through':_0x1a57('0x192')});db[_0x1a57('0x6b')]['belongsToMany'](db[_0x1a57('0x84')],{'through':'cm_contact_has_tags','as':'ThroughTags'});db[_0x1a57('0x13e')][_0x1a57('0x11b')](db[_0x1a57('0x6b')],{'as':_0x1a57('0x163'),'foreignKey':'ContactId','onDelete':_0x1a57('0x10e')});db['CmHopper'][_0x1a57('0x11b')](db[_0x1a57('0xed')],{'as':_0x1a57('0x15d'),'foreignKey':_0x1a57('0x16d'),'onDelete':_0x1a57('0x10e')});db[_0x1a57('0x13e')][_0x1a57('0x11b')](db[_0x1a57('0x107')],{'as':_0x1a57('0x185'),'foreignKey':_0x1a57('0x10a')});db['CmHopper'][_0x1a57('0x11b')](db[_0x1a57('0x19')],{'as':_0x1a57('0x186'),'foreignKey':_0x1a57('0x140'),'onDelete':'cascade'});db[_0x1a57('0x13e')][_0x1a57('0x11b')](db[_0x1a57('0xdc')],{'as':'Campaign','foreignKey':_0x1a57('0x193'),'onDelete':_0x1a57('0x10e')});db[_0x1a57('0x13e')][_0x1a57('0x11b')](db['User'],{'as':_0x1a57('0x174'),'foreignKey':_0x1a57('0x194')});db[_0x1a57('0x6d')]['belongsTo'](db[_0x1a57('0x6b')],{'as':_0x1a57('0x163'),'foreignKey':'ContactId','onDelete':_0x1a57('0x10e')});db[_0x1a57('0x6d')][_0x1a57('0x11b')](db[_0x1a57('0xed')],{'as':_0x1a57('0x15d'),'foreignKey':_0x1a57('0x16d'),'onDelete':'cascade'});db['CmHopperBlack'][_0x1a57('0x11b')](db['VoiceQueue'],{'as':_0x1a57('0x186'),'foreignKey':_0x1a57('0x140'),'onDelete':_0x1a57('0x10e')});db[_0x1a57('0x6d')][_0x1a57('0x11b')](db['Campaign'],{'as':_0x1a57('0xdc'),'foreignKey':_0x1a57('0x193'),'onDelete':_0x1a57('0x10e')});db['Automation'][_0x1a57('0x10b')](db[_0x1a57('0x7b')],{'as':{'plural':_0x1a57('0x195'),'singular':'OneAll'},'foreignKey':'AutomationAllId','onDelete':_0x1a57('0x10e'),'hooks':!![]});db[_0x1a57('0x76')][_0x1a57('0x10b')](db['Condition'],{'as':{'plural':_0x1a57('0x196'),'singular':_0x1a57('0x197')},'foreignKey':_0x1a57('0x198'),'onDelete':'cascade','hooks':!![]});db[_0x1a57('0x76')][_0x1a57('0x10b')](db['Action'],{'as':_0x1a57('0x199'),'foreignKey':'AutomationId','onDelete':_0x1a57('0x10e'),'hooks':!![]});db[_0x1a57('0x79')][_0x1a57('0x10b')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x1a57('0x19a'),'onDelete':_0x1a57('0x10e')});db[_0x1a57('0x7c')][_0x1a57('0x10b')](db[_0x1a57('0x7c')],{'as':_0x1a57('0x19b'),'foreignKey':_0x1a57('0x146'),'onDelete':'cascade','hooks':!![],'required':![]});db['Interval']['hasMany'](db[_0x1a57('0x15')],{'as':_0x1a57('0x10d'),'foreignKey':_0x1a57('0x146'),'onDelete':_0x1a57('0x16c')});db[_0x1a57('0x7c')]['hasMany'](db['MailApplication'],{'as':_0x1a57('0x19c'),'foreignKey':_0x1a57('0x146')});db[_0x1a57('0x7c')][_0x1a57('0x10b')](db[_0x1a57('0x184')],{'as':'ChatApplications','foreignKey':_0x1a57('0x146')});db[_0x1a57('0x7c')][_0x1a57('0x10b')](db[_0x1a57('0x47')],{'as':_0x1a57('0x19d'),'foreignKey':'IntervalId'});db[_0x1a57('0x7c')]['hasMany'](db[_0x1a57('0x50')],{'as':_0x1a57('0x19e'),'foreignKey':_0x1a57('0x146')});db[_0x1a57('0x81')][_0x1a57('0x11b')](db[_0x1a57('0x3b')],{});db['Schedule'][_0x1a57('0x11b')](db[_0x1a57('0x90')],{'foreignKey':_0x1a57('0x19f')});db[_0x1a57('0x81')][_0x1a57('0x11b')](db[_0x1a57('0x8e')],{'foreignKey':_0x1a57('0x1a0')});db[_0x1a57('0x83')][_0x1a57('0x11d')](db[_0x1a57('0x17')],{'as':'Mohs','through':_0x1a57('0x1a1'),'onDelete':_0x1a57('0x16c')});db[_0x1a57('0x84')]['belongsToMany'](db[_0x1a57('0x6b')],{'through':_0x1a57('0x192')});db[_0x1a57('0x84')][_0x1a57('0x11d')](db[_0x1a57('0x61')],{'through':'chat_interaction_has_tags'});db[_0x1a57('0x84')]['belongsToMany'](db[_0x1a57('0x3e')],{'through':_0x1a57('0x164')});db[_0x1a57('0x84')][_0x1a57('0x11d')](db['SmsInteraction'],{'through':'sms_interaction_has_tags'});db[_0x1a57('0x84')][_0x1a57('0x11d')](db[_0x1a57('0x115')],{'through':_0x1a57('0x175')});db[_0x1a57('0x84')][_0x1a57('0x11d')](db[_0x1a57('0x5c')],{'through':_0x1a57('0x180')});db[_0x1a57('0x84')][_0x1a57('0x11d')](db[_0x1a57('0x118')],{'through':_0x1a57('0x1a2')});db[_0x1a57('0x87')][_0x1a57('0x10b')](db['Condition'],{'as':{'plural':_0x1a57('0x1a3'),'singular':_0x1a57('0x1a4')},'foreignKey':_0x1a57('0x1a5'),'onDelete':_0x1a57('0x10e'),'hooks':!![]});db['Trigger']['hasMany'](db[_0x1a57('0x7b')],{'as':{'plural':_0x1a57('0x1a6'),'singular':_0x1a57('0x1a7')},'foreignKey':_0x1a57('0x1a8'),'onDelete':_0x1a57('0x10e'),'hooks':!![]});db[_0x1a57('0x87')][_0x1a57('0x10b')](db[_0x1a57('0x74')],{'as':'Actions','foreignKey':_0x1a57('0x1a9'),'onDelete':'cascade','hooks':!![]});db[_0x1a57('0x8e')][_0x1a57('0x10b')](db[_0x1a57('0x95')],{'as':'Fields','onDelete':'cascade','foreignKey':'CustomReportId','hooks':!![]});db[_0x1a57('0x90')][_0x1a57('0x10b')](db[_0x1a57('0x95')],{'as':_0x1a57('0x1aa'),'onDelete':_0x1a57('0x10e'),'foreignKey':'DefaultReportId'});db[_0x1a57('0x1ab')]['hasMany'](db[_0x1a57('0x95')],{'as':_0x1a57('0x1aa'),'onDelete':_0x1a57('0x10e'),'foreignKey':_0x1a57('0x1ac')});db[_0x1a57('0x95')]['belongsTo'](db[_0x1a57('0x1ab')],{'foreignKey':_0x1a57('0x1ac')});db['SalesforceAccount'][_0x1a57('0x10b')](db['SalesforceConfiguration'],{'as':_0x1a57('0x1ad'),'onDelete':'cascade','foreignKey':_0x1a57('0x1ae')});db['SalesforceConfiguration'][_0x1a57('0x10b')](db[_0x1a57('0x9c')],{'as':_0x1a57('0x1af'),'onDelete':_0x1a57('0x10e'),'foreignKey':_0x1a57('0x1b0')});db[_0x1a57('0x9a')][_0x1a57('0x10b')](db[_0x1a57('0x9c')],{'as':_0x1a57('0x1b1'),'onDelete':_0x1a57('0x10e'),'foreignKey':_0x1a57('0x1b2')});db['SalesforceConfiguration'][_0x1a57('0x10b')](db[_0x1a57('0x9c')],{'as':_0x1a57('0x1aa'),'onDelete':_0x1a57('0x10e'),'foreignKey':_0x1a57('0x1b3')});db[_0x1a57('0x9a')][_0x1a57('0x11b')](db[_0x1a57('0x1b4')],{'as':_0x1a57('0x162'),'foreignKey':_0x1a57('0x1ae')});db[_0x1a57('0x9c')][_0x1a57('0x10b')](db['SalesforceField'],{'as':_0x1a57('0x1b5'),'foreignKey':_0x1a57('0x1b0')});db[_0x1a57('0x9c')][_0x1a57('0x10b')](db[_0x1a57('0x9c')],{'as':_0x1a57('0x1b6'),'foreignKey':_0x1a57('0x1b2')});db[_0x1a57('0x9c')][_0x1a57('0x10b')](db[_0x1a57('0x9c')],{'as':_0x1a57('0x1b7'),'foreignKey':'FieldId'});db[_0x1a57('0x9c')][_0x1a57('0x11b')](db[_0x1a57('0x1b8')],{'as':_0x1a57('0x1b8'),'foreignKey':_0x1a57('0x1b9')});db[_0x1a57('0x9e')][_0x1a57('0x10b')](db[_0x1a57('0x1ba')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x1a57('0x1ae')});db[_0x1a57('0x1ba')][_0x1a57('0x10b')](db[_0x1a57('0xa1')],{'as':'Subjects','onDelete':_0x1a57('0x10e'),'foreignKey':_0x1a57('0x1b0')});db[_0x1a57('0x1ba')]['hasMany'](db[_0x1a57('0xa1')],{'as':_0x1a57('0x1b1'),'onDelete':_0x1a57('0x10e'),'foreignKey':_0x1a57('0x1b2')});db[_0x1a57('0x1ba')]['hasMany'](db[_0x1a57('0xa1')],{'as':_0x1a57('0x1aa'),'onDelete':_0x1a57('0x10e'),'foreignKey':'FieldId'});db[_0x1a57('0x1ba')]['belongsTo'](db[_0x1a57('0x9e')],{'as':_0x1a57('0x162'),'foreignKey':_0x1a57('0x1ae')});db['SugarcrmField'][_0x1a57('0x10b')](db[_0x1a57('0xa1')],{'as':_0x1a57('0x1b5'),'foreignKey':'SubjectId'});db['SugarcrmField'][_0x1a57('0x10b')](db[_0x1a57('0xa1')],{'as':_0x1a57('0x1b6'),'foreignKey':_0x1a57('0x1b2')});db[_0x1a57('0xa1')][_0x1a57('0x10b')](db[_0x1a57('0xa1')],{'as':_0x1a57('0x1b7'),'foreignKey':_0x1a57('0x1b3')});db[_0x1a57('0xa1')]['belongsTo'](db[_0x1a57('0x1b8')],{'as':'Variable','foreignKey':'VariableId'});db[_0x1a57('0xa3')][_0x1a57('0x10b')](db[_0x1a57('0xa5')],{'as':'Configurations','onDelete':_0x1a57('0x10e'),'foreignKey':'AccountId'});db[_0x1a57('0xa5')][_0x1a57('0x10b')](db[_0x1a57('0x1bb')],{'as':'Subjects','onDelete':_0x1a57('0x10e'),'foreignKey':_0x1a57('0x1b0')});db[_0x1a57('0xa5')][_0x1a57('0x10b')](db['DeskField'],{'as':_0x1a57('0x1b1'),'onDelete':_0x1a57('0x10e'),'foreignKey':_0x1a57('0x1b2')});db[_0x1a57('0xa5')][_0x1a57('0x10b')](db['DeskField'],{'as':_0x1a57('0x1aa'),'onDelete':_0x1a57('0x10e'),'foreignKey':'FieldId'});db[_0x1a57('0xa5')]['belongsTo'](db[_0x1a57('0xa3')],{'as':'Account','foreignKey':'AccountId'});db[_0x1a57('0xa5')]['belongsToMany'](db[_0x1a57('0x84')],{'through':_0x1a57('0x1bc')});db[_0x1a57('0x1bb')][_0x1a57('0x10b')](db[_0x1a57('0x1bb')],{'as':_0x1a57('0x1b5'),'foreignKey':_0x1a57('0x1b0')});db[_0x1a57('0x1bb')][_0x1a57('0x10b')](db['DeskField'],{'as':_0x1a57('0x1b6'),'foreignKey':_0x1a57('0x1b2')});db[_0x1a57('0x1bb')][_0x1a57('0x10b')](db[_0x1a57('0x1bb')],{'as':_0x1a57('0x1b7'),'foreignKey':_0x1a57('0x1b3')});db[_0x1a57('0x1bb')]['belongsTo'](db[_0x1a57('0x1b8')],{'as':_0x1a57('0x1b8'),'foreignKey':_0x1a57('0x1b9')});db[_0x1a57('0xa7')][_0x1a57('0x10b')](db[_0x1a57('0x1bd')],{'as':_0x1a57('0x1ad'),'onDelete':_0x1a57('0x10e'),'foreignKey':'AccountId'});db[_0x1a57('0x1bd')][_0x1a57('0x10b')](db['ZohoField'],{'as':'Subjects','onDelete':_0x1a57('0x10e'),'foreignKey':_0x1a57('0x1b0')});db[_0x1a57('0x1bd')]['hasMany'](db['ZohoField'],{'as':_0x1a57('0x1b1'),'onDelete':_0x1a57('0x10e'),'foreignKey':'DescriptionId'});db[_0x1a57('0x1bd')][_0x1a57('0x10b')](db['ZohoField'],{'as':'Fields','onDelete':_0x1a57('0x10e'),'foreignKey':'FieldId'});db['ZohoConfiguration'][_0x1a57('0x11b')](db[_0x1a57('0xa7')],{'as':_0x1a57('0x162'),'foreignKey':_0x1a57('0x1ae')});db[_0x1a57('0xaa')]['hasMany'](db[_0x1a57('0xaa')],{'as':_0x1a57('0x1b5'),'foreignKey':_0x1a57('0x1b0')});db['ZohoField'][_0x1a57('0x10b')](db['ZohoField'],{'as':'Description','foreignKey':_0x1a57('0x1b2')});db[_0x1a57('0xaa')][_0x1a57('0x10b')](db[_0x1a57('0xaa')],{'as':'Field','foreignKey':_0x1a57('0x1b3')});db[_0x1a57('0xaa')]['belongsTo'](db['Variable'],{'as':_0x1a57('0x1b8'),'foreignKey':'VariableId'});db[_0x1a57('0x1be')][_0x1a57('0x10b')](db[_0x1a57('0xad')],{'as':'Configurations','onDelete':_0x1a57('0x10e'),'foreignKey':_0x1a57('0x1ae')});db[_0x1a57('0xad')]['hasMany'](db[_0x1a57('0x1bf')],{'as':_0x1a57('0x1af'),'foreignKey':'SubjectId'});db[_0x1a57('0xad')]['hasMany'](db[_0x1a57('0x1bf')],{'as':_0x1a57('0x1b1'),'foreignKey':_0x1a57('0x1b2')});db[_0x1a57('0xad')][_0x1a57('0x10b')](db[_0x1a57('0x1bf')],{'as':_0x1a57('0x1aa'),'foreignKey':'FieldId'});db[_0x1a57('0xad')]['belongsTo'](db[_0x1a57('0x1be')],{'as':_0x1a57('0x162'),'foreignKey':_0x1a57('0x1ae')});db[_0x1a57('0xad')][_0x1a57('0x11d')](db['Tag'],{'through':_0x1a57('0x1c0')});db[_0x1a57('0x1bf')]['hasMany'](db['ZendeskField'],{'as':_0x1a57('0x1b5'),'foreignKey':'SubjectId'});db[_0x1a57('0x1bf')]['hasMany'](db[_0x1a57('0x1bf')],{'as':_0x1a57('0x1b6'),'foreignKey':'DescriptionId'});db[_0x1a57('0x1bf')][_0x1a57('0x10b')](db[_0x1a57('0x1bf')],{'as':_0x1a57('0x1b7'),'foreignKey':_0x1a57('0x1b3')});db[_0x1a57('0x1bf')][_0x1a57('0x11b')](db[_0x1a57('0x1b8')],{'as':'Variable','foreignKey':_0x1a57('0x1b9')});db[_0x1a57('0xb0')][_0x1a57('0x10b')](db['FreshdeskConfiguration'],{'as':_0x1a57('0x1ad'),'onDelete':_0x1a57('0x10e'),'foreignKey':'AccountId'});db[_0x1a57('0xb1')][_0x1a57('0x10b')](db[_0x1a57('0xb2')],{'as':_0x1a57('0x1af'),'onDelete':_0x1a57('0x10e'),'foreignKey':_0x1a57('0x1b0')});db[_0x1a57('0xb1')][_0x1a57('0x10b')](db[_0x1a57('0xb2')],{'as':_0x1a57('0x1b1'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x1a57('0xb1')]['hasMany'](db[_0x1a57('0xb2')],{'as':_0x1a57('0x1aa'),'onDelete':_0x1a57('0x10e'),'foreignKey':'FieldId'});db['FreshdeskConfiguration'][_0x1a57('0x11b')](db[_0x1a57('0xb0')],{'as':_0x1a57('0x162'),'foreignKey':_0x1a57('0x1ae')});db[_0x1a57('0xb1')]['belongsToMany'](db[_0x1a57('0x84')],{'through':_0x1a57('0x1c1')});db['FreshdeskField'][_0x1a57('0x10b')](db[_0x1a57('0xb2')],{'as':_0x1a57('0x1b5'),'foreignKey':_0x1a57('0x1b0')});db[_0x1a57('0xb2')][_0x1a57('0x10b')](db[_0x1a57('0xb2')],{'as':_0x1a57('0x1b6'),'foreignKey':_0x1a57('0x1b2')});db['FreshdeskField'][_0x1a57('0x10b')](db[_0x1a57('0xb2')],{'as':_0x1a57('0x1b7'),'foreignKey':'FieldId'});db[_0x1a57('0xb2')][_0x1a57('0x11b')](db[_0x1a57('0x1b8')],{'as':_0x1a57('0x1b8'),'foreignKey':'VariableId'});db[_0x1a57('0xb3')][_0x1a57('0x10b')](db[_0x1a57('0xb5')],{'as':_0x1a57('0x1ad'),'onDelete':_0x1a57('0x10e'),'foreignKey':_0x1a57('0x1ae')});db[_0x1a57('0xb5')][_0x1a57('0x10b')](db[_0x1a57('0xb7')],{'as':_0x1a57('0x1af'),'foreignKey':_0x1a57('0x1b0')});db[_0x1a57('0xb5')][_0x1a57('0x10b')](db[_0x1a57('0xb7')],{'as':_0x1a57('0x1b1'),'foreignKey':_0x1a57('0x1b2')});db['VtigerConfiguration'][_0x1a57('0x10b')](db[_0x1a57('0xb7')],{'as':'Fields','foreignKey':_0x1a57('0x1b3')});db[_0x1a57('0xb5')]['belongsTo'](db[_0x1a57('0xb3')],{'as':_0x1a57('0x162'),'foreignKey':_0x1a57('0x1ae')});db[_0x1a57('0xb7')]['hasMany'](db[_0x1a57('0xb7')],{'as':_0x1a57('0x1b5'),'foreignKey':_0x1a57('0x1b0')});db[_0x1a57('0xb7')][_0x1a57('0x10b')](db[_0x1a57('0xb7')],{'as':_0x1a57('0x1b6'),'foreignKey':_0x1a57('0x1b2')});db['VtigerField']['hasMany'](db[_0x1a57('0xb7')],{'as':'Field','foreignKey':_0x1a57('0x1b3')});db[_0x1a57('0xb7')][_0x1a57('0x11b')](db['Variable'],{'as':'Variable','foreignKey':_0x1a57('0x1b9')});db[_0x1a57('0xb8')][_0x1a57('0x10b')](db[_0x1a57('0x1c2')],{'as':_0x1a57('0x1ad'),'onDelete':'cascade','foreignKey':_0x1a57('0x1ae')});db[_0x1a57('0x1c2')][_0x1a57('0x10b')](db['ServicenowField'],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x1a57('0x1c2')][_0x1a57('0x10b')](db['ServicenowField'],{'as':_0x1a57('0x1b1'),'foreignKey':_0x1a57('0x1b2')});db[_0x1a57('0x1c2')]['hasMany'](db[_0x1a57('0xba')],{'as':_0x1a57('0x1aa'),'foreignKey':_0x1a57('0x1b3')});db[_0x1a57('0x1c2')][_0x1a57('0x11b')](db[_0x1a57('0xb8')],{'as':_0x1a57('0x162'),'foreignKey':'AccountId'});db[_0x1a57('0xba')][_0x1a57('0x10b')](db[_0x1a57('0xba')],{'as':_0x1a57('0x1b5'),'foreignKey':_0x1a57('0x1b0')});db[_0x1a57('0xba')][_0x1a57('0x10b')](db[_0x1a57('0xba')],{'as':_0x1a57('0x1b6'),'foreignKey':'DescriptionId'});db[_0x1a57('0xba')][_0x1a57('0x10b')](db[_0x1a57('0xba')],{'as':_0x1a57('0x1b7'),'foreignKey':'FieldId'});db['ServicenowField'][_0x1a57('0x11b')](db[_0x1a57('0x1b8')],{'as':_0x1a57('0x1b8'),'foreignKey':'VariableId'});db['Dynamics365Account'][_0x1a57('0x10b')](db[_0x1a57('0xbd')],{'as':_0x1a57('0x1ad'),'onDelete':_0x1a57('0x10e'),'foreignKey':'AccountId'});db[_0x1a57('0xbd')][_0x1a57('0x10b')](db[_0x1a57('0x1c3')],{'as':_0x1a57('0x1af'),'onDelete':_0x1a57('0x10e'),'foreignKey':_0x1a57('0x1b0')});db[_0x1a57('0xbd')]['hasMany'](db['Dynamics365Field'],{'as':_0x1a57('0x1b1'),'onDelete':_0x1a57('0x10e'),'foreignKey':_0x1a57('0x1b2')});db[_0x1a57('0xbd')][_0x1a57('0x10b')](db[_0x1a57('0x1c3')],{'as':_0x1a57('0x1aa'),'onDelete':_0x1a57('0x10e'),'foreignKey':_0x1a57('0x1b3')});db[_0x1a57('0xbd')][_0x1a57('0x11b')](db[_0x1a57('0x1c4')],{'as':_0x1a57('0x162'),'foreignKey':_0x1a57('0x1ae')});db[_0x1a57('0x1c3')][_0x1a57('0x10b')](db[_0x1a57('0x1c3')],{'as':_0x1a57('0x1b5'),'foreignKey':'SubjectId'});db['Dynamics365Field'][_0x1a57('0x10b')](db[_0x1a57('0x1c3')],{'as':_0x1a57('0x1b6'),'foreignKey':'DescriptionId'});db[_0x1a57('0x1c3')][_0x1a57('0x10b')](db[_0x1a57('0x1c3')],{'as':'Field','foreignKey':_0x1a57('0x1b3')});db[_0x1a57('0x1c3')][_0x1a57('0x11b')](db[_0x1a57('0x1b8')],{'as':_0x1a57('0x1b8'),'foreignKey':_0x1a57('0x1b9')});db[_0x1a57('0xbf')]['hasMany'](db['FreshsalesConfiguration'],{'as':_0x1a57('0x1ad'),'onDelete':_0x1a57('0x10e'),'foreignKey':_0x1a57('0x1ae')});db['FreshsalesConfiguration'][_0x1a57('0x10b')](db['FreshsalesField'],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x1a57('0x1c5')]['hasMany'](db[_0x1a57('0x1c6')],{'as':_0x1a57('0x1b1'),'foreignKey':_0x1a57('0x1b2')});db['FreshsalesConfiguration']['hasMany'](db['FreshsalesField'],{'as':_0x1a57('0x1aa'),'foreignKey':_0x1a57('0x1b3')});db['FreshsalesConfiguration'][_0x1a57('0x11b')](db[_0x1a57('0xbf')],{'as':_0x1a57('0x162'),'foreignKey':'AccountId'});db[_0x1a57('0x1c6')]['hasMany'](db[_0x1a57('0x1c6')],{'as':_0x1a57('0x1b5'),'foreignKey':'SubjectId'});db[_0x1a57('0x1c6')]['hasMany'](db[_0x1a57('0x1c6')],{'as':_0x1a57('0x1b6'),'foreignKey':_0x1a57('0x1b2')});db[_0x1a57('0x1c6')][_0x1a57('0x10b')](db[_0x1a57('0x1c6')],{'as':_0x1a57('0x1b7'),'foreignKey':_0x1a57('0x1b3')});db[_0x1a57('0x1c6')]['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db[_0x1a57('0xc4')]['belongsTo'](db[_0x1a57('0x130')],{});db[_0x1a57('0xc4')]['belongsTo'](db['CmList'],{'as':_0x1a57('0x15d'),'foreignKey':_0x1a57('0x16d')});db[_0x1a57('0xc4')][_0x1a57('0x11b')](db[_0x1a57('0x6b')],{'as':'Contact','foreignKey':_0x1a57('0x156')});db[_0x1a57('0xc4')][_0x1a57('0x11b')](db[_0x1a57('0x61')],{});db['ChatQueueReport'][_0x1a57('0x11b')](db[_0x1a57('0x63')],{});db['ChatQueueReport'][_0x1a57('0x11b')](db[_0x1a57('0x107')],{});db[_0x1a57('0xc4')][_0x1a57('0x11b')](db[_0x1a57('0x65')],{});db[_0x1a57('0x18c')]['belongsTo'](db['User'],{'onDelete':'cascade','foreignKey':'FromId'});db[_0x1a57('0x18c')][_0x1a57('0x11b')](db[_0x1a57('0x107')],{'onDelete':_0x1a57('0x10e'),'foreignKey':_0x1a57('0x1c7')});db['JscriptySessionReport'][_0x1a57('0x10b')](db[_0x1a57('0x1c8')],{'foreignKey':_0x1a57('0x1c9'),'onDelete':_0x1a57('0x10e')});db[_0x1a57('0xc7')][_0x1a57('0x10b')](db[_0x1a57('0x1ca')],{'foreignKey':_0x1a57('0x1c9'),'onDelete':_0x1a57('0x10e')});db[_0x1a57('0xc9')][_0x1a57('0x11b')](db[_0x1a57('0x4f')],{});db['SmsQueueReport'][_0x1a57('0x11b')](db[_0x1a57('0xed')],{'as':'List','foreignKey':_0x1a57('0x16d')});db[_0x1a57('0xc9')][_0x1a57('0x11b')](db[_0x1a57('0x6b')],{'as':_0x1a57('0x163'),'foreignKey':'ContactId'});db[_0x1a57('0xc9')][_0x1a57('0x11b')](db['SmsInteraction'],{});db['SmsQueueReport'][_0x1a57('0x11b')](db[_0x1a57('0x54')],{});db['SmsQueueReport'][_0x1a57('0x11b')](db[_0x1a57('0x107')],{});db['SmsQueueReport'][_0x1a57('0x11b')](db[_0x1a57('0x56')],{});db[_0x1a57('0xce')][_0x1a57('0x10b')](db[_0x1a57('0xc7')],{'foreignKey':_0x1a57('0x1cb')});db[_0x1a57('0xce')]['hasMany'](db[_0x1a57('0x1c8')],{'foreignKey':'ProjectId'});db['JscriptyProject'][_0x1a57('0x10b')](db[_0x1a57('0x1ca')],{'foreignKey':_0x1a57('0x1cb')});db[_0x1a57('0xd4')][_0x1a57('0x11d')](db[_0x1a57('0x107')],{'as':_0x1a57('0x167'),'through':_0x1a57('0x1cc')});db[_0x1a57('0xd9')][_0x1a57('0x11d')](db[_0x1a57('0x107')],{'as':_0x1a57('0x14a'),'through':'user_has_teams'});db['Team'][_0x1a57('0x11d')](db[_0x1a57('0x19')],{'through':'TeamVoiceQueue','as':_0x1a57('0x128')});db['Team']['belongsToMany'](db['MailQueue'],{'through':_0x1a57('0x160'),'as':_0x1a57('0x1cd')});db[_0x1a57('0xd9')][_0x1a57('0x11d')](db[_0x1a57('0x65')],{'through':_0x1a57('0x18b'),'as':_0x1a57('0x12c')});db[_0x1a57('0xd9')][_0x1a57('0x11d')](db[_0x1a57('0x4c')],{'through':'team_has_fax_queues','as':_0x1a57('0x12d')});db[_0x1a57('0xd9')][_0x1a57('0x11d')](db[_0x1a57('0x56')],{'through':_0x1a57('0x17c'),'as':_0x1a57('0x1ce')});db[_0x1a57('0xd9')][_0x1a57('0x11d')](db[_0x1a57('0x5e')],{'through':'team_has_openchannel_queues','as':_0x1a57('0x12e')});db[_0x1a57('0xd9')][_0x1a57('0x11d')](db[_0x1a57('0xff')],{'through':'team_has_whatsapp_queues','as':_0x1a57('0x1cf')});db[_0x1a57('0xd9')][_0x1a57('0x11d')](db[_0x1a57('0xef')],{'through':_0x1a57('0x104'),'as':_0x1a57('0x129')});db[_0x1a57('0xdc')]['hasMany'](db[_0x1a57('0x13e')],{'as':_0x1a57('0x13f'),'foreignKey':'CampaignId'});db['Campaign']['hasMany'](db['CmHopperFinal'],{'as':_0x1a57('0x110'),'foreignKey':_0x1a57('0x193')});db[_0x1a57('0xdc')][_0x1a57('0x10b')](db[_0x1a57('0x70')],{'as':_0x1a57('0x18f'),'foreignKey':_0x1a57('0x193')});db[_0x1a57('0xdc')][_0x1a57('0x10b')](db[_0x1a57('0x6d')],{'as':'HopperBlacks','foreignKey':_0x1a57('0x193')});db[_0x1a57('0xdc')][_0x1a57('0x11b')](db[_0x1a57('0x27')],{'as':_0x1a57('0x27'),'foreignKey':'TrunkId'});db[_0x1a57('0xdc')][_0x1a57('0x11b')](db[_0x1a57('0x27')],{'as':_0x1a57('0x144'),'foreignKey':_0x1a57('0x145')});db[_0x1a57('0xdc')][_0x1a57('0x11b')](db[_0x1a57('0x7c')],{'as':'Interval','foreignKey':'IntervalId'});db['Campaign']['belongsTo'](db[_0x1a57('0xd4')],{'as':_0x1a57('0xd4'),'foreignKey':'SquareProjectId'});db[_0x1a57('0xdc')][_0x1a57('0x11d')](db['CmList'],{'as':_0x1a57('0x120'),'through':_0x1a57('0x1d0')});db[_0x1a57('0xdc')][_0x1a57('0x11d')](db[_0x1a57('0xed')],{'as':'BlackLists','through':_0x1a57('0x1d1')});db[_0x1a57('0xe0')][_0x1a57('0x11b')](db['ChatOfflineMessage'],{'as':_0x1a57('0x16a'),'foreignKey':_0x1a57('0x16b')});db[_0x1a57('0xe3')][_0x1a57('0x11b')](db[_0x1a57('0x3f')],{});db['MailTransferReport'][_0x1a57('0x11b')](db[_0x1a57('0x3e')],{});db[_0x1a57('0xe3')][_0x1a57('0x11b')](db['MailAccount'],{'foreignKey':_0x1a57('0x1d2'),'as':_0x1a57('0x1d3')});db['MailTransferReport'][_0x1a57('0x11b')](db[_0x1a57('0x107')],{'foreignKey':_0x1a57('0x1d4'),'as':_0x1a57('0x1d5')});db[_0x1a57('0xe3')][_0x1a57('0x11b')](db[_0x1a57('0x107')],{'foreignKey':_0x1a57('0x1d6'),'as':_0x1a57('0x1d7')});db[_0x1a57('0xe3')]['belongsTo'](db[_0x1a57('0x12a')],{'foreignKey':_0x1a57('0x1d8'),'as':'ToQueue'});db['MailTransferReport'][_0x1a57('0x11b')](db['MailAccount'],{'foreignKey':_0x1a57('0x1d9'),'as':_0x1a57('0x1da')});db[_0x1a57('0xe5')][_0x1a57('0x11b')](db['ChatMessage'],{});db[_0x1a57('0xe5')][_0x1a57('0x11b')](db['ChatInteraction'],{});db[_0x1a57('0xe5')]['belongsTo'](db[_0x1a57('0x130')],{'foreignKey':_0x1a57('0x1db'),'as':_0x1a57('0x1d3')});db[_0x1a57('0xe5')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x1a57('0x1d5')});db[_0x1a57('0xe5')][_0x1a57('0x11b')](db[_0x1a57('0x107')],{'foreignKey':_0x1a57('0x1d6'),'as':_0x1a57('0x1d7')});db[_0x1a57('0xe5')]['belongsTo'](db[_0x1a57('0x65')],{'foreignKey':_0x1a57('0x1dc'),'as':_0x1a57('0x1dd')});db[_0x1a57('0xe5')][_0x1a57('0x11b')](db[_0x1a57('0x130')],{'foreignKey':'ToChatWebsiteId','as':_0x1a57('0x1da')});db[_0x1a57('0xe7')]['belongsTo'](db[_0x1a57('0x4a')],{});db[_0x1a57('0xe7')]['belongsTo'](db[_0x1a57('0x115')],{});db[_0x1a57('0xe7')][_0x1a57('0x11b')](db[_0x1a57('0x46')],{'foreignKey':'FromFaxAccountId','as':'FromAccount'});db[_0x1a57('0xe7')][_0x1a57('0x11b')](db['User'],{'foreignKey':_0x1a57('0x1d4'),'as':_0x1a57('0x1d5')});db[_0x1a57('0xe7')]['belongsTo'](db['User'],{'foreignKey':_0x1a57('0x1d6'),'as':_0x1a57('0x1d7')});db[_0x1a57('0xe7')][_0x1a57('0x11b')](db[_0x1a57('0x4c')],{'foreignKey':_0x1a57('0x1de'),'as':_0x1a57('0x1dd')});db['FaxTransferReport']['belongsTo'](db[_0x1a57('0x46')],{'foreignKey':_0x1a57('0x1df'),'as':_0x1a57('0x1da')});db[_0x1a57('0xe9')]['belongsTo'](db[_0x1a57('0x17e')],{});db[_0x1a57('0xe9')][_0x1a57('0x11b')](db['OpenchannelInteraction'],{});db[_0x1a57('0xe9')][_0x1a57('0x11b')](db[_0x1a57('0x58')],{'foreignKey':_0x1a57('0x1e0'),'as':'FromAccount'});db[_0x1a57('0xe9')][_0x1a57('0x11b')](db[_0x1a57('0x107')],{'foreignKey':'FromUserId','as':_0x1a57('0x1d5')});db[_0x1a57('0xe9')][_0x1a57('0x11b')](db[_0x1a57('0x107')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x1a57('0xe9')]['belongsTo'](db[_0x1a57('0x5e')],{'foreignKey':_0x1a57('0x1e1'),'as':_0x1a57('0x1dd')});db[_0x1a57('0xe9')][_0x1a57('0x11b')](db['OpenchannelAccount'],{'foreignKey':'ToOpenchannelAccountId','as':_0x1a57('0x1da')});db['SmsTransferReport'][_0x1a57('0x11b')](db['SmsMessage'],{});db[_0x1a57('0xeb')]['belongsTo'](db[_0x1a57('0x52')],{});db['SmsTransferReport'][_0x1a57('0x11b')](db[_0x1a57('0x4f')],{'foreignKey':_0x1a57('0x1e2'),'as':_0x1a57('0x1d3')});db[_0x1a57('0xeb')][_0x1a57('0x11b')](db[_0x1a57('0x107')],{'foreignKey':_0x1a57('0x1d4'),'as':_0x1a57('0x1d5')});db[_0x1a57('0xeb')][_0x1a57('0x11b')](db[_0x1a57('0x107')],{'foreignKey':_0x1a57('0x1d6'),'as':_0x1a57('0x1d7')});db[_0x1a57('0xeb')][_0x1a57('0x11b')](db[_0x1a57('0x56')],{'foreignKey':'ToSmsQueueId','as':'ToQueue'});db[_0x1a57('0xeb')]['belongsTo'](db[_0x1a57('0x4f')],{'foreignKey':'ToSmsAccountId','as':_0x1a57('0x1da')});db[_0x1a57('0xed')]['hasMany'](db[_0x1a57('0x79')],{'as':_0x1a57('0x15a'),'foreignKey':_0x1a57('0x16d'),'onDelete':'cascade'});db[_0x1a57('0xed')][_0x1a57('0x10b')](db[_0x1a57('0x1e3')],{'as':_0x1a57('0x1e4'),'foreignKey':'ListId'});db['CmList']['hasMany'](db['CmContact'],{'as':'Contacts','onDelete':_0x1a57('0x10e'),'foreignKey':_0x1a57('0x16d')});db['CmList'][_0x1a57('0x10b')](db[_0x1a57('0x10f')],{'as':_0x1a57('0x110'),'foreignKey':_0x1a57('0x16d')});db[_0x1a57('0xed')][_0x1a57('0x10b')](db[_0x1a57('0x70')],{'as':_0x1a57('0x111'),'foreignKey':_0x1a57('0x16d')});db['CmList'][_0x1a57('0x10b')](db[_0x1a57('0x112')],{'as':_0x1a57('0x112'),'foreignKey':_0x1a57('0x16d')});db[_0x1a57('0xed')][_0x1a57('0x11d')](db[_0x1a57('0x19')],{'as':_0x1a57('0x1e5'),'through':_0x1a57('0x149')});db[_0x1a57('0xed')]['belongsToMany'](db['User'],{'as':_0x1a57('0x14a'),'through':_0x1a57('0x12f')});db[_0x1a57('0xef')]['hasMany'](db[_0x1a57('0x15')],{'as':_0x1a57('0x10d'),'onDelete':'cascade'});db[_0x1a57('0xef')][_0x1a57('0x11d')](db[_0x1a57('0x107')],{'as':_0x1a57('0x14a'),'through':'UserVoicePrefix'});db[_0x1a57('0xef')][_0x1a57('0x11d')](db[_0x1a57('0xd9')],{'through':_0x1a57('0x104'),'as':_0x1a57('0x14b')});db[_0x1a57('0xf1')]['hasMany'](db[_0x1a57('0x107')],{'as':_0x1a57('0x167'),'foreignKey':_0x1a57('0x11c')});db[_0x1a57('0xf1')][_0x1a57('0x10b')](db[_0x1a57('0x1e6')],{'as':_0x1a57('0x1e7'),'foreignKey':_0x1a57('0x11c'),'onDelete':_0x1a57('0x10e')});db[_0x1a57('0x1e6')]['hasMany'](db[_0x1a57('0xf4')],{'as':'Resources','foreignKey':_0x1a57('0x1e8'),'onDelete':_0x1a57('0x10e')});db['WhatsappAccount'][_0x1a57('0x10b')](db['Disposition'],{'as':_0x1a57('0x15a'),'foreignKey':_0x1a57('0x1e9'),'onDelete':_0x1a57('0x10e')});db[_0x1a57('0xf8')][_0x1a57('0x10b')](db[_0x1a57('0x78')],{'as':_0x1a57('0x15b'),'foreignKey':_0x1a57('0x1e9')});db[_0x1a57('0xf8')][_0x1a57('0x10b')](db[_0x1a57('0xfc')],{'as':'Messages','foreignKey':_0x1a57('0x1e9')});db[_0x1a57('0xf8')][_0x1a57('0x10b')](db[_0x1a57('0x118')],{'as':_0x1a57('0x15c')});db[_0x1a57('0xf8')]['hasMany'](db[_0x1a57('0xf9')],{'as':_0x1a57('0x13c')});db[_0x1a57('0xf8')][_0x1a57('0x11b')](db['CmList'],{'as':'List','foreignKey':_0x1a57('0x16d')});db[_0x1a57('0xf8')][_0x1a57('0x11b')](db['Pause'],{'as':_0x1a57('0x147'),'foreignKey':_0x1a57('0x148')});db['WhatsappAccount']['belongsToMany'](db[_0x1a57('0x107')],{'as':_0x1a57('0x14a'),'through':_0x1a57('0x138')});db['WhatsappApplication']['belongsTo'](db[_0x1a57('0x107')],{'onDelete':_0x1a57('0x16c')});db[_0x1a57('0xf9')][_0x1a57('0x11b')](db['WhatsappQueue'],{'onDelete':_0x1a57('0x16c')});db['WhatsappApplication'][_0x1a57('0x11b')](db[_0x1a57('0xf8')],{'onDelete':_0x1a57('0x16c')});db[_0x1a57('0xf9')][_0x1a57('0x11b')](db[_0x1a57('0x7c')],{'onDelete':_0x1a57('0x16c'),'foreignKey':_0x1a57('0x146')});db[_0x1a57('0xf9')][_0x1a57('0x11b')](db[_0x1a57('0x84')],{'onDelete':_0x1a57('0x16c'),'foreignKey':_0x1a57('0x172')});db[_0x1a57('0x118')][_0x1a57('0x10b')](db[_0x1a57('0xfc')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x1a57('0x1ea')});db['WhatsappInteraction']['belongsTo'](db[_0x1a57('0xf8')],{'as':_0x1a57('0x162'),'foreignKey':_0x1a57('0x1e9')});db[_0x1a57('0x118')][_0x1a57('0x11b')](db['CmContact'],{'as':_0x1a57('0x163'),'foreignKey':_0x1a57('0x156')});db[_0x1a57('0x118')][_0x1a57('0x11b')](db[_0x1a57('0x107')],{'as':'Owner','foreignKey':_0x1a57('0x10a')});db[_0x1a57('0x118')]['belongsToMany'](db[_0x1a57('0x84')],{'through':_0x1a57('0x1a2'),'as':_0x1a57('0x165')});db[_0x1a57('0x118')][_0x1a57('0x11d')](db[_0x1a57('0x84')],{'through':_0x1a57('0x1a2'),'as':_0x1a57('0x166')});db['WhatsappInteraction'][_0x1a57('0x11d')](db[_0x1a57('0x107')],{'as':_0x1a57('0x167'),'through':_0x1a57('0x127'),'foreignKey':_0x1a57('0x1ea')});db[_0x1a57('0xfc')]['belongsTo'](db[_0x1a57('0x107')],{'as':_0x1a57('0x107')});db[_0x1a57('0xfc')][_0x1a57('0x11b')](db['CmContact'],{'onDelete':'cascade','as':_0x1a57('0x163')});db[_0x1a57('0xfc')][_0x1a57('0x11b')](db[_0x1a57('0x118')],{'onDelete':_0x1a57('0x10e'),'as':_0x1a57('0x169'),'foreignKey':_0x1a57('0x1ea')});db[_0x1a57('0xfc')][_0x1a57('0x11b')](db[_0x1a57('0xf8')],{'as':_0x1a57('0x162'),'foreignKey':_0x1a57('0x1e9')});db[_0x1a57('0x1eb')][_0x1a57('0x11b')](db['WhatsappAccount'],{});db['WhatsappQueueReport'][_0x1a57('0x11b')](db[_0x1a57('0xed')],{'as':_0x1a57('0x15d'),'foreignKey':_0x1a57('0x16d')});db[_0x1a57('0x1eb')][_0x1a57('0x11b')](db[_0x1a57('0x6b')],{'as':'Contact','foreignKey':_0x1a57('0x156')});db[_0x1a57('0x1eb')]['belongsTo'](db['WhatsappInteraction'],{});db['WhatsappQueueReport'][_0x1a57('0x11b')](db[_0x1a57('0xff')],{});db[_0x1a57('0x1eb')][_0x1a57('0x11b')](db[_0x1a57('0xfc')],{});db[_0x1a57('0x1eb')]['belongsTo'](db[_0x1a57('0x107')],{});db[_0x1a57('0xfe')]['belongsTo'](db['WhatsappMessage'],{});db[_0x1a57('0xfe')][_0x1a57('0x11b')](db[_0x1a57('0x118')],{});db[_0x1a57('0xfe')]['belongsTo'](db[_0x1a57('0xf8')],{'foreignKey':_0x1a57('0x1ec'),'as':_0x1a57('0x1d3')});db[_0x1a57('0xfe')][_0x1a57('0x11b')](db['WhatsappAccount'],{'foreignKey':_0x1a57('0x1ed'),'as':_0x1a57('0x1da')});db[_0x1a57('0xfe')][_0x1a57('0x11b')](db['WhatsappQueue'],{'foreignKey':_0x1a57('0x1ee'),'as':_0x1a57('0x1dd')});db[_0x1a57('0xfe')][_0x1a57('0x11b')](db[_0x1a57('0x107')],{'foreignKey':'FromUserId','as':_0x1a57('0x1d5')});db[_0x1a57('0xfe')][_0x1a57('0x11b')](db[_0x1a57('0x107')],{'foreignKey':_0x1a57('0x1d6'),'as':'ToAgent'});db[_0x1a57('0xff')][_0x1a57('0x11d')](db[_0x1a57('0x107')],{'as':_0x1a57('0x14a'),'through':_0x1a57('0x36'),'foreignKey':_0x1a57('0x1ef')});db[_0x1a57('0xff')][_0x1a57('0x11d')](db[_0x1a57('0xd9')],{'through':_0x1a57('0x1f0'),'as':_0x1a57('0x14b')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x5c00=['CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','../api/automation/automation.model','CannedAnswer','Disposition','../api/disposition/disposition.model','Condition','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','Sound','../api/template/template.model','Trigger','../api/trigger/trigger.model','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','Setting','../api/setting/setting.model','SquareOdbc','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','Team','../api/team/team.model','../api/license/license.model','Campaign','../api/campaign/campaign.model','../api/migration/migration.model','Attachment','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','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','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','hasOne','VoiceMail','cascade','UserId','hasMany','VoiceRecording','Recordings','UserVoiceQueueRt','VoiceQueuesRt','Extensions','ReportAgentPreview','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_fax_interactions','user_has_sms_interactions','OpenchannelInteraction','VoiceQueues','MailQueue','ChatQueue','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccount','OpenchannelAccounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','SpiedAgents','ChanSpyId','Applications','Sounds','Members','VoiceQueueId','HopperFinals','HopperHistories','JscriptySessionReport','JscriptySessions','TrunkId','TrunkBackup','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Agents','Teams','TeamVoiceQueue','BlackLists','voice_queues_has_cm_blacklists','VoiceMailMessage','Messages','mailboxuser','mailbox','AgentReports','uniqueid','Contact','MailAccountId','Imap','Smtp','Dispositions','Answers','Interactions','List','ListId','Template','TemplateId','team_has_mail_queues','MailInteractionId','Account','Owner','Tag','mail_interaction_has_tags','Tags','ThroughTags','Users','Interaction','ChatWebsiteId','ChatOfflineMessageId','restrict','FaxAccountId','Exntensions','TagId','fax_interaction_has_tags','FaxInteractionId','team_has_fax_queues','ContactId','SmsAccountId','SmsInteractionId','SmsQueueId','OpenchannelAccountId','user_has_openchannel_accounts','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','AttachmentId','team_has_openchannel_queues','Queue','ChatQueueId','Website','chat_interaction_has_tags','user_has_chat_interactions','ChatInteractionId','Attachments','UserChatQueue','team_has_chat_queues','ChatGroupId','CompanyId','Company','cm_user_has_contacts','cm_contact_has_tags','Agent','CampaignId','OwnerId','Automation','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','Intervals','ChatApplications','FaxApplications','SmsApplications','Schedule','AnalyticCustomReport','CustomReportId','Mohs','moh_has_sounds','sms_interaction_has_tags','whatsapp_interaction_has_tags','AllConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','MetricId','SalesforceAccount','Configurations','AccountId','SalesforceField','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Field','Variable','VariableId','SugarcrmAccount','Subject','Description','DeskField','int_desk_configuration_has_tags','int_zendesk_configuration_has_tags','FreshdeskField','FreshdeskAccount','int_freshdesk_configuration_has_tags','VtigerAccount','VtigerField','ServicenowConfiguration','ServicenowField','ToId','SessionId','ProjectId','JscriptyProject','user_has_square_projects','team_has_sms_queues','team_has_whatsapp_queues','VoicePrefixes','Hoppers','HopperBlacks','TrunkBackupId','SquareProjectId','Lists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToQueue','ToMailAccountId','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','ToAccount','FromFaxAccountId','ToAgent','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsAccountId','CmCustomField','CustomFields','Queues','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','user_has_whatsapp_interactions','ToQueueId','WhatsappQueueId','exports','../config/environment','sequelize','lodash','determine','defaultsDeep','motion2','xcall','127.0.0.1','mysql','utf8mb4','name','utf8_general_ci','sequelizeHistory','xC@LL1234','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','VoiceQueue','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../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','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model'];(function(_0x490527,_0x189a2a){var _0x52aba7=function(_0x511771){while(--_0x511771){_0x490527['push'](_0x490527['shift']());}};_0x52aba7(++_0x189a2a);}(_0x5c00,0x17e));var _0x05c0=function(_0x27c25f,_0x4ff5fe){_0x27c25f=_0x27c25f-0x0;var _0x2da4c4=_0x5c00[_0x27c25f];return _0x2da4c4;};'use strict';var config=require(_0x05c0('0x0'));var Sequelize=require(_0x05c0('0x1'));var _=require(_0x05c0('0x2'));var jstz=require('jstz');var timezone=jstz[_0x05c0('0x3')]();config['sequelize']=_[_0x05c0('0x4')](config[_0x05c0('0x1')],{'database':_0x05c0('0x5'),'username':_0x05c0('0x6'),'password':'xC@LL1234','options':{'host':_0x05c0('0x7'),'port':0xcea,'dialect':_0x05c0('0x8'),'dialectOptions':{'charset':_0x05c0('0x9')},'logging':![],'timezone':timezone[_0x05c0('0xa')](),'define':{'charset':'utf8','collate':_0x05c0('0xb')}}});config[_0x05c0('0xc')]=_[_0x05c0('0x4')](config['sequelizeHistory'],{'database':_0x05c0('0x5'),'username':_0x05c0('0x6'),'password':_0x05c0('0xd'),'options':{'host':_0x05c0('0x7'),'port':0xcea,'dialect':_0x05c0('0x8'),'dialectOptions':{'charset':_0x05c0('0x9')},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':_0x05c0('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x05c0('0xe')],config[_0x05c0('0x1')][_0x05c0('0xf')],config['sequelize'][_0x05c0('0x10')],config['sequelize'][_0x05c0('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x05c0('0xc')][_0x05c0('0xe')],config[_0x05c0('0xc')][_0x05c0('0xf')],config[_0x05c0('0xc')][_0x05c0('0x10')],config[_0x05c0('0xc')]['options'])};db[_0x05c0('0x12')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x14'));db[_0x05c0('0x15')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x16'));db[_0x05c0('0x17')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0x18'));db[_0x05c0('0x19')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0x1a'));db[_0x05c0('0x1b')]=db[_0x05c0('0x1')][_0x05c0('0x13')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0x05c0('0x1c')]=db[_0x05c0('0x1')]['import']('../api/voiceQueue/voiceQueue.model');db['VoiceRecording']=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x1d'));db[_0x05c0('0x1e')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x1f'));db['VoiceMail']=db[_0x05c0('0x1')][_0x05c0('0x13')]('../api/voiceMail/voiceMail.model');db['VoiceMailMessage']=db['sequelize']['import']('../api/voiceMailMessage/voiceMailMessage.model');db[_0x05c0('0x20')]=db[_0x05c0('0x1')]['import'](_0x05c0('0x21'));db[_0x05c0('0x22')]=db[_0x05c0('0x1')][_0x05c0('0x13')]('../api/voiceDialReport/voiceDialReport.model');db[_0x05c0('0x23')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x24'));db[_0x05c0('0x25')]=db[_0x05c0('0x1')]['import']('../api/voiceQueueReport/voiceQueueReport.model');db[_0x05c0('0x26')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x27'));db[_0x05c0('0x28')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x29'));db[_0x05c0('0x2a')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x2b'));db['UserVoiceQueueRt']=db['sequelize'][_0x05c0('0x13')](_0x05c0('0x2c'));db[_0x05c0('0x2d')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0x2e'));db['UserChatQueue']=db[_0x05c0('0x1')]['import'](_0x05c0('0x2f'));db[_0x05c0('0x30')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x31'));db[_0x05c0('0x32')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x33'));db[_0x05c0('0x34')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x35'));db[_0x05c0('0x36')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x37'));db[_0x05c0('0x38')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x39'));db[_0x05c0('0x3a')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x3b'));db[_0x05c0('0x3c')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x3d'));db[_0x05c0('0x3e')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x3f'));db['MailQueue']=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x40'));db[_0x05c0('0x41')]=db['sequelize']['import'](_0x05c0('0x42'));db[_0x05c0('0x43')]=db[_0x05c0('0x1')]['import'](_0x05c0('0x44'));db[_0x05c0('0x45')]=db[_0x05c0('0x1')][_0x05c0('0x13')]('../api/mailMessage/mailMessage.model');db[_0x05c0('0x46')]=db[_0x05c0('0x1')]['import'](_0x05c0('0x47'));db[_0x05c0('0x48')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x49'));db[_0x05c0('0x4a')]=db[_0x05c0('0x1')]['import']('../api/dashboard/dashboard.model');db[_0x05c0('0x4b')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x4c'));db[_0x05c0('0x4d')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0x4e'));db[_0x05c0('0x4f')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x50'));db[_0x05c0('0x51')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0x52'));db[_0x05c0('0x53')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x54'));db[_0x05c0('0x55')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x56'));db[_0x05c0('0x57')]=db['sequelize']['import'](_0x05c0('0x58'));db[_0x05c0('0x59')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x5a'));db[_0x05c0('0x5b')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0x5c'));db[_0x05c0('0x5d')]=db[_0x05c0('0x1')]['import'](_0x05c0('0x5e'));db[_0x05c0('0x5f')]=db[_0x05c0('0x1')][_0x05c0('0x13')]('../api/smsMessage/smsMessage.model');db[_0x05c0('0x60')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x61'));db['OpenchannelAccount']=db[_0x05c0('0x1')][_0x05c0('0x13')]('../api/openchannelAccount/openchannelAccount.model');db[_0x05c0('0x62')]=db['sequelize']['import'](_0x05c0('0x63'));db['OpenchannelInteraction']=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x64'));db[_0x05c0('0x65')]=db[_0x05c0('0x1')][_0x05c0('0x13')]('../api/openchannelMessage/openchannelMessage.model');db[_0x05c0('0x66')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0x67'));db[_0x05c0('0x68')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x69'));db[_0x05c0('0x6a')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x05c0('0x6b')]=db[_0x05c0('0x1')]['import']('../api/chatApplication/chatApplication.model');db[_0x05c0('0x6c')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x6d'));db[_0x05c0('0x6e')]=db[_0x05c0('0x1')][_0x05c0('0x13')]('../api/chatMessage/chatMessage.model');db[_0x05c0('0x6f')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x70'));db['ChatQueue']=db[_0x05c0('0x1')]['import'](_0x05c0('0x71'));db[_0x05c0('0x72')]=db['sequelize'][_0x05c0('0x13')]('../api/chatGroup/chatGroup.model');db[_0x05c0('0x73')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x74'));db[_0x05c0('0x75')]=db[_0x05c0('0x1')]['import'](_0x05c0('0x76'));db[_0x05c0('0x77')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x78'));db[_0x05c0('0x79')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0x7a'));db[_0x05c0('0x7b')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x7c'));db[_0x05c0('0x7d')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x7e'));db[_0x05c0('0x7f')]=db[_0x05c0('0x1')]['import']('../api/cmHopperHistory/cmHopperHistory.model');db['ReportAgentPreview']=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x80'));db['CmCustomField']=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x81'));db[_0x05c0('0x82')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x83'));db['Automation']=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x84'));db[_0x05c0('0x85')]=db['sequelize']['import']('../api/cannedAnswer/cannedAnswer.model');db[_0x05c0('0x86')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x87'));db[_0x05c0('0x88')]=db[_0x05c0('0x1')][_0x05c0('0x13')]('../api/condition/condition.model');db[_0x05c0('0x89')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x8a'));db[_0x05c0('0x8b')]=db['sequelize']['import'](_0x05c0('0x8c'));db[_0x05c0('0x8d')]=db['sequelize'][_0x05c0('0x13')]('../api/cdr/cdr.model');db['VoiceQueuesLog']=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x8e'));db['Schedule']=db['sequelize'][_0x05c0('0x13')](_0x05c0('0x8f'));db[_0x05c0('0x90')]=db['sequelize']['import']('../api/sound/sound.model');db['Tag']=db['sequelize'][_0x05c0('0x13')]('../api/tag/tag.model');db['Template']=db['sequelize'][_0x05c0('0x13')](_0x05c0('0x91'));db[_0x05c0('0x92')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0x93'));db['Variable']=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x94'));db[_0x05c0('0x95')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0x96'));db[_0x05c0('0x97')]=db[_0x05c0('0x1')][_0x05c0('0x13')]('../api/integrationReport/integrationReport.model');db['AnalyticCustomReport']=db[_0x05c0('0x1')]['import'](_0x05c0('0x98'));db[_0x05c0('0x99')]=db['sequelize'][_0x05c0('0x13')]('../api/analyticDefaultReport/analyticDefaultReport.model');db['AnalyticExtractedReport']=db['sequelize']['import'](_0x05c0('0x9a'));db[_0x05c0('0x9b')]=db[_0x05c0('0x1')][_0x05c0('0x13')]('../api/analyticMetric/analyticMetric.model');db[_0x05c0('0x9c')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x9d'));db[_0x05c0('0x9e')]=db['sequelize'][_0x05c0('0x13')]('../api/analyticTreeReport/analyticTreeReport.model');db['SalesforceAccount']=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x9f'));db[_0x05c0('0xa0')]=db[_0x05c0('0x1')][_0x05c0('0x13')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db['SalesforceField']=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xa1'));db['SugarcrmAccount']=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xa2'));db[_0x05c0('0xa3')]=db[_0x05c0('0x1')][_0x05c0('0x13')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x05c0('0xa4')]=db[_0x05c0('0x1')]['import'](_0x05c0('0xa5'));db[_0x05c0('0xa6')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0xa7'));db[_0x05c0('0xa8')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xa9'));db['DeskField']=db[_0x05c0('0x1')]['import'](_0x05c0('0xaa'));db[_0x05c0('0xab')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xac'));db[_0x05c0('0xad')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xae'));db[_0x05c0('0xaf')]=db['sequelize'][_0x05c0('0x13')]('../api/intZohoField/intZohoField.model');db[_0x05c0('0xb0')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0xb1'));db[_0x05c0('0xb2')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xb3'));db[_0x05c0('0xb4')]=db[_0x05c0('0x1')][_0x05c0('0x13')]('../api/intZendeskField/intZendeskField.model');db['FreshdeskAccount']=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xb5'));db[_0x05c0('0xb6')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xb7'));db['FreshdeskField']=db[_0x05c0('0x1')]['import'](_0x05c0('0xb8'));db['VtigerAccount']=db[_0x05c0('0x1')]['import'](_0x05c0('0xb9'));db[_0x05c0('0xba')]=db['sequelize'][_0x05c0('0x13')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db['VtigerField']=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xbb'));db[_0x05c0('0xbc')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xbd'));db['ServicenowConfiguration']=db['sequelize']['import']('../api/intServicenowConfiguration/intServicenowConfiguration.model');db['ServicenowField']=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xbe'));db[_0x05c0('0xbf')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0xc0'));db[_0x05c0('0xc1')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xc2'));db[_0x05c0('0xc3')]=db[_0x05c0('0x1')][_0x05c0('0x13')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x05c0('0xc4')]=db['sequelize'][_0x05c0('0x13')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0x05c0('0xc5')]=db[_0x05c0('0x1')]['import'](_0x05c0('0xc6'));db[_0x05c0('0xc7')]=db['sequelize'][_0x05c0('0x13')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0x05c0('0x95')]=db[_0x05c0('0x1')][_0x05c0('0x13')]('../api/integration/integration.model');db['Network']=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xc8'));db[_0x05c0('0xc9')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xca'));db[_0x05c0('0xcb')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xcc'));db[_0x05c0('0xcd')]=db[_0x05c0('0x1')][_0x05c0('0x13')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0x05c0('0xce')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0xcf'));db['JscriptySessionReport']=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xd0'));db[_0x05c0('0xd1')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xd2'));db[_0x05c0('0xd3')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0xd4'));db[_0x05c0('0xd5')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xd6'));db['JscriptyProject']=db[_0x05c0('0x1')][_0x05c0('0x13')]('../api/jscriptyProject/jscriptyProject.model');db[_0x05c0('0xd7')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0xd8'));db[_0x05c0('0xd9')]=db['sequelize'][_0x05c0('0x13')]('../api/squareOdbc/squareOdbc.model');db[_0x05c0('0xda')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xdb'));db[_0x05c0('0xdc')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xdd'));db['SquareMessage']=db[_0x05c0('0x1')][_0x05c0('0x13')]('../api/squareMessage/squareMessage.model');db[_0x05c0('0xde')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xdf'));db['License']=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xe0'));db[_0x05c0('0xe1')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0xe2'));db['Migration']=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xe3'));db[_0x05c0('0xe4')]=db[_0x05c0('0x1')][_0x05c0('0x13')]('../api/attachment/attachment.model');db[_0x05c0('0xe5')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0xe6'));db[_0x05c0('0xe7')]=db[_0x05c0('0x1')]['import'](_0x05c0('0xe8'));db[_0x05c0('0xe9')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0xea'));db[_0x05c0('0xeb')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0xec'));db[_0x05c0('0xed')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xee'));db[_0x05c0('0xef')]=db[_0x05c0('0x1')]['import'](_0x05c0('0xf0'));db[_0x05c0('0xf1')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xf2'));db[_0x05c0('0xf3')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xf4'));db[_0x05c0('0xf5')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0xf6'));db[_0x05c0('0xf7')]=db[_0x05c0('0x1')]['import'](_0x05c0('0xf8'));db[_0x05c0('0xf9')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xfa'));db[_0x05c0('0xfb')]=db['sequelize']['import'](_0x05c0('0xfc'));db[_0x05c0('0xfd')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xfe'));db[_0x05c0('0xff')]=db['sequelize']['import'](_0x05c0('0x100'));db[_0x05c0('0x101')]=db[_0x05c0('0x1')]['import'](_0x05c0('0x102'));db[_0x05c0('0x103')]=db[_0x05c0('0x1')]['import'](_0x05c0('0x104'));db[_0x05c0('0x105')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x106'));db[_0x05c0('0x107')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x108'));db[_0x05c0('0x109')]=db['sequelize'][_0x05c0('0x13')]('../api/whatsappQueue/whatsappQueue.model');db[_0x05c0('0x10a')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0x10b'));db['TeamVoiceQueue']=db[_0x05c0('0x1')]['import'](_0x05c0('0x10c'));db[_0x05c0('0x10d')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x10e'));db[_0x05c0('0x10f')]=db['sequelize']['import']('../api/userVoicePrefix/userVoicePrefix.model');db[_0x05c0('0x12')][_0x05c0('0x110')](db[_0x05c0('0x111')],{'as':_0x05c0('0x111'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x113')});db[_0x05c0('0x12')][_0x05c0('0x114')](db[_0x05c0('0x115')],{'as':_0x05c0('0x116'),'foreignKey':_0x05c0('0x113')});db[_0x05c0('0x12')]['hasMany'](db[_0x05c0('0x117')],{'as':_0x05c0('0x118'),'foreignKey':_0x05c0('0x113')});db['User'][_0x05c0('0x114')](db[_0x05c0('0x19')],{'as':_0x05c0('0x119'),'onDelete':'cascade','hooks':!![]});db['User'][_0x05c0('0x114')](db[_0x05c0('0x7d')],{'as':'HopperFinals','foreignKey':_0x05c0('0x113')});db[_0x05c0('0x12')]['hasMany'](db[_0x05c0('0x7f')],{'as':'HopperHistory','foreignKey':_0x05c0('0x113')});db[_0x05c0('0x12')][_0x05c0('0x114')](db[_0x05c0('0x11a')],{'as':'ReportAgentPreview','foreignKey':_0x05c0('0x113')});db[_0x05c0('0x12')][_0x05c0('0x114')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','foreignKey':_0x05c0('0x113')});db['User'][_0x05c0('0x114')](db['ChatInteraction'],{'as':_0x05c0('0x11b'),'foreignKey':_0x05c0('0x113')});db[_0x05c0('0x12')][_0x05c0('0x114')](db[_0x05c0('0x5d')],{'as':_0x05c0('0x11c'),'foreignKey':'UserId'});db['User'][_0x05c0('0x114')](db['FaxInteraction'],{'as':_0x05c0('0x11d'),'foreignKey':_0x05c0('0x113')});db[_0x05c0('0x12')][_0x05c0('0x114')](db[_0x05c0('0x43')],{'as':_0x05c0('0x11e'),'foreignKey':'UserId'});db[_0x05c0('0x12')][_0x05c0('0x114')](db[_0x05c0('0x101')],{'as':_0x05c0('0x11f'),'foreignKey':'UserId'});db[_0x05c0('0x12')][_0x05c0('0x114')](db[_0x05c0('0xfb')],{'as':'UserNotifications','foreignKey':'SenderId'});db['User'][_0x05c0('0x120')](db[_0x05c0('0xf5')],{'as':_0x05c0('0xf5'),'foreignKey':_0x05c0('0x121')});db[_0x05c0('0x12')][_0x05c0('0x122')](db['ChatGroup'],{'as':_0x05c0('0x123'),'through':_0x05c0('0x124')});db[_0x05c0('0x12')][_0x05c0('0x122')](db[_0x05c0('0x77')],{'as':_0x05c0('0x125'),'through':'cm_user_has_contacts'});db['User'][_0x05c0('0x122')](db['CmList'],{'as':'Lists','through':_0x05c0('0x126')});db[_0x05c0('0x12')][_0x05c0('0x122')](db[_0x05c0('0xde')],{'through':_0x05c0('0x127')});db[_0x05c0('0x12')][_0x05c0('0x122')](db[_0x05c0('0x43')],{'as':'MailInteractions','through':_0x05c0('0x128')});db[_0x05c0('0x12')][_0x05c0('0x122')](db[_0x05c0('0x6c')],{'as':_0x05c0('0x11b'),'through':'user_has_chat_interactions'});db['User'][_0x05c0('0x122')](db[_0x05c0('0x51')],{'as':_0x05c0('0x11d'),'through':_0x05c0('0x129')});db['User']['belongsToMany'](db[_0x05c0('0x5d')],{'as':_0x05c0('0x11c'),'through':_0x05c0('0x12a')});db[_0x05c0('0x12')][_0x05c0('0x122')](db[_0x05c0('0x12b')],{'as':'OpenchannelInteractions','through':'user_has_openchannel_interactions'});db[_0x05c0('0x12')]['belongsToMany'](db[_0x05c0('0x101')],{'as':'WhatsappInteractions','through':'user_has_whatsapp_interactions'});db[_0x05c0('0x12')][_0x05c0('0x122')](db[_0x05c0('0x1c')],{'as':_0x05c0('0x12c'),'through':_0x05c0('0x2d'),'required':![]});db[_0x05c0('0x12')]['belongsToMany'](db['VoicePrefix'],{'as':'VoicePrefixes','through':_0x05c0('0x10f'),'required':![]});db[_0x05c0('0x12')][_0x05c0('0x122')](db[_0x05c0('0x12d')],{'as':'MailQueues','through':_0x05c0('0x30'),'required':![]});db['User'][_0x05c0('0x122')](db[_0x05c0('0x12e')],{'as':_0x05c0('0x12f'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0x05c0('0x12')]['belongsToMany'](db[_0x05c0('0x55')],{'as':_0x05c0('0x130'),'through':_0x05c0('0x32'),'required':![]});db[_0x05c0('0x12')]['belongsToMany'](db[_0x05c0('0x60')],{'as':_0x05c0('0x131'),'through':_0x05c0('0x34'),'required':![]});db[_0x05c0('0x12')]['belongsToMany'](db['OpenchannelQueue'],{'as':_0x05c0('0x132'),'through':'UserOpenchannelQueue','required':![]});db[_0x05c0('0x12')][_0x05c0('0x122')](db[_0x05c0('0x109')],{'as':_0x05c0('0x133'),'through':_0x05c0('0x38'),'required':![]});db['User'][_0x05c0('0x122')](db[_0x05c0('0xf1')],{'through':'cm_user_has_lists'});db[_0x05c0('0x12')][_0x05c0('0x122')](db[_0x05c0('0x68')],{'as':_0x05c0('0x134'),'through':_0x05c0('0x135')});db[_0x05c0('0x12')][_0x05c0('0x122')](db[_0x05c0('0x4d')],{'as':'FaxAccounts','through':_0x05c0('0x136')});db['User'][_0x05c0('0x122')](db['MailAccount'],{'as':_0x05c0('0x137'),'through':_0x05c0('0x138')});db[_0x05c0('0x12')][_0x05c0('0x122')](db[_0x05c0('0x139')],{'as':_0x05c0('0x13a'),'through':'user_has_openchannel_accounts'});db[_0x05c0('0x12')][_0x05c0('0x122')](db[_0x05c0('0x59')],{'as':_0x05c0('0x13b'),'through':_0x05c0('0x13c')});db[_0x05c0('0x12')][_0x05c0('0x122')](db[_0x05c0('0xfd')],{'as':_0x05c0('0x13d'),'through':_0x05c0('0x13e')});db[_0x05c0('0x12')][_0x05c0('0x122')](db[_0x05c0('0xda')],{'as':_0x05c0('0x13f'),'through':'user_has_square_projects'});db[_0x05c0('0x15')][_0x05c0('0x114')](db[_0x05c0('0x19')],{'as':_0x05c0('0x140'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x141')});db[_0x05c0('0x17')][_0x05c0('0x114')](db[_0x05c0('0x19')],{'onDelete':_0x05c0('0x112')});db[_0x05c0('0x19')]['hasMany'](db[_0x05c0('0x19')],{'as':_0x05c0('0x142'),'onDelete':'cascade'});db[_0x05c0('0x1b')]['belongsToMany'](db['Sound'],{'as':_0x05c0('0x143'),'through':'moh_has_sounds'});db[_0x05c0('0x1c')][_0x05c0('0x114')](db[_0x05c0('0x117')],{'as':_0x05c0('0x144'),'foreignKey':_0x05c0('0x145')});db[_0x05c0('0x1c')][_0x05c0('0x114')](db[_0x05c0('0x79')],{'as':'Hoppers','foreignKey':_0x05c0('0x145')});db['VoiceQueue']['hasMany'](db['CmHopperFinal'],{'as':_0x05c0('0x146'),'foreignKey':_0x05c0('0x145')});db[_0x05c0('0x1c')][_0x05c0('0x114')](db[_0x05c0('0x7f')],{'as':_0x05c0('0x147'),'foreignKey':'VoiceQueueId'});db[_0x05c0('0x1c')][_0x05c0('0x114')](db[_0x05c0('0x11a')],{'as':_0x05c0('0x11a'),'foreignKey':_0x05c0('0x145')});db[_0x05c0('0x1c')]['hasMany'](db[_0x05c0('0x7b')],{'as':'HopperBlacks','foreignKey':_0x05c0('0x145')});db[_0x05c0('0x1c')][_0x05c0('0x114')](db[_0x05c0('0x148')],{'as':_0x05c0('0x149'),'foreignKey':_0x05c0('0x145')});db[_0x05c0('0x1c')][_0x05c0('0x120')](db[_0x05c0('0x28')],{'as':_0x05c0('0x28'),'foreignKey':_0x05c0('0x14a')});db[_0x05c0('0x1c')][_0x05c0('0x120')](db[_0x05c0('0x28')],{'as':_0x05c0('0x14b'),'foreignKey':'TrunkBackupId'});db[_0x05c0('0x1c')]['belongsTo'](db[_0x05c0('0x89')],{'as':_0x05c0('0x89'),'foreignKey':_0x05c0('0x14c')});db['VoiceQueue'][_0x05c0('0x120')](db[_0x05c0('0x8b')],{'as':_0x05c0('0x14d'),'foreignKey':_0x05c0('0x14e')});db[_0x05c0('0x1c')][_0x05c0('0x122')](db['CmList'],{'as':'Lists','through':'voice_queues_has_cm_lists'});db[_0x05c0('0x1c')][_0x05c0('0x122')](db['User'],{'as':_0x05c0('0x14f'),'through':_0x05c0('0x2d')});db['VoiceQueue'][_0x05c0('0x122')](db[_0x05c0('0xde')],{'as':_0x05c0('0x150'),'through':_0x05c0('0x151')});db[_0x05c0('0x1c')][_0x05c0('0x122')](db[_0x05c0('0xf1')],{'as':_0x05c0('0x152'),'through':_0x05c0('0x153')});db[_0x05c0('0x115')][_0x05c0('0x120')](db[_0x05c0('0x12')],{'as':_0x05c0('0x12'),'foreignKey':_0x05c0('0x113')});db[_0x05c0('0x1e')][_0x05c0('0x120')](db['User'],{'as':'User','foreignKey':_0x05c0('0x113')});db[_0x05c0('0x111')]['hasMany'](db[_0x05c0('0x154')],{'as':_0x05c0('0x155'),'onDelete':_0x05c0('0x112'),'foreignKey':'mailboxuser','sourceKey':'mailbox'});db['VoiceMailMessage'][_0x05c0('0x120')](db[_0x05c0('0x111')],{'foreignKey':_0x05c0('0x156'),'targetKey':_0x05c0('0x157')});db[_0x05c0('0x20')][_0x05c0('0x114')](db[_0x05c0('0x25')],{'as':'QueueCalls','foreignKey':'uniqueid','constraints':![]});db[_0x05c0('0x20')]['hasMany'](db[_0x05c0('0x23')],{'as':_0x05c0('0x158'),'foreignKey':_0x05c0('0x159'),'constraints':![]});db[_0x05c0('0x20')]['belongsTo'](db['User'],{'as':'User','foreignKey':_0x05c0('0x113')});db[_0x05c0('0x20')]['belongsTo'](db[_0x05c0('0x77')],{'as':_0x05c0('0x15a'),'foreignKey':'ContactId'});db['MailServerIn'][_0x05c0('0x120')](db[_0x05c0('0x3e')],{'as':'MailAccount','foreignKey':_0x05c0('0x15b')});db[_0x05c0('0x3c')][_0x05c0('0x120')](db[_0x05c0('0x3e')],{'as':_0x05c0('0x3e'),'foreignKey':_0x05c0('0x15b')});db[_0x05c0('0x3e')][_0x05c0('0x110')](db['MailServerIn'],{'as':_0x05c0('0x15c'),'onDelete':_0x05c0('0x112')});db[_0x05c0('0x3e')][_0x05c0('0x110')](db[_0x05c0('0x3c')],{'as':_0x05c0('0x15d'),'onDelete':'cascade'});db[_0x05c0('0x3e')]['hasMany'](db[_0x05c0('0x86')],{'as':_0x05c0('0x15e'),'foreignKey':'MailAccountId','onDelete':'cascade'});db[_0x05c0('0x3e')]['hasMany'](db[_0x05c0('0x85')],{'as':_0x05c0('0x15f'),'foreignKey':_0x05c0('0x15b')});db['MailAccount'][_0x05c0('0x114')](db[_0x05c0('0x45')],{'as':_0x05c0('0x155'),'foreignKey':_0x05c0('0x15b')});db['MailAccount'][_0x05c0('0x114')](db[_0x05c0('0x43')],{'as':_0x05c0('0x160')});db[_0x05c0('0x3e')][_0x05c0('0x114')](db['MailApplication'],{'as':_0x05c0('0x142')});db[_0x05c0('0x3e')][_0x05c0('0x120')](db['CmList'],{'as':_0x05c0('0x161'),'foreignKey':_0x05c0('0x162')});db[_0x05c0('0x3e')][_0x05c0('0x120')](db[_0x05c0('0x163')],{'as':_0x05c0('0x163'),'foreignKey':_0x05c0('0x164')});db[_0x05c0('0x3e')][_0x05c0('0x120')](db['Pause'],{'as':_0x05c0('0x14d'),'foreignKey':_0x05c0('0x14e')});db[_0x05c0('0x3e')][_0x05c0('0x122')](db[_0x05c0('0x12')],{'as':_0x05c0('0x14f'),'through':'user_has_mail_accounts'});db[_0x05c0('0x12d')][_0x05c0('0x122')](db[_0x05c0('0x12')],{'as':_0x05c0('0x14f'),'through':_0x05c0('0x30')});db['MailQueue'][_0x05c0('0x122')](db[_0x05c0('0xde')],{'through':_0x05c0('0x165'),'as':_0x05c0('0x150')});db['MailInteraction'][_0x05c0('0x114')](db['MailMessage'],{'as':_0x05c0('0x155'),'onDelete':'cascade','foreignKey':_0x05c0('0x166')});db[_0x05c0('0x43')]['belongsTo'](db['MailAccount'],{'as':_0x05c0('0x167'),'foreignKey':_0x05c0('0x15b')});db['MailInteraction']['belongsTo'](db[_0x05c0('0x77')],{'as':_0x05c0('0x15a'),'foreignKey':'ContactId'});db[_0x05c0('0x43')][_0x05c0('0x120')](db['User'],{'as':_0x05c0('0x168'),'foreignKey':'UserId'});db[_0x05c0('0x43')]['belongsToMany'](db[_0x05c0('0x169')],{'through':_0x05c0('0x16a'),'as':_0x05c0('0x16b')});db[_0x05c0('0x43')][_0x05c0('0x122')](db['Tag'],{'through':_0x05c0('0x16a'),'as':_0x05c0('0x16c')});db[_0x05c0('0x43')][_0x05c0('0x122')](db[_0x05c0('0x12')],{'as':_0x05c0('0x16d'),'through':'user_has_mail_interactions','foreignKey':_0x05c0('0x166')});db[_0x05c0('0x45')][_0x05c0('0x114')](db[_0x05c0('0xe4')],{'as':'Attachments','onDelete':'cascade'});db[_0x05c0('0x45')][_0x05c0('0x120')](db[_0x05c0('0x12')],{'as':'User'});db[_0x05c0('0x45')][_0x05c0('0x120')](db[_0x05c0('0x77')],{'onDelete':'cascade','as':_0x05c0('0x15a')});db[_0x05c0('0x45')][_0x05c0('0x120')](db[_0x05c0('0x43')],{'as':_0x05c0('0x16e'),'foreignKey':_0x05c0('0x166')});db['MailMessage'][_0x05c0('0x120')](db[_0x05c0('0x3e')],{'as':'Account','foreignKey':_0x05c0('0x15b')});db[_0x05c0('0x45')][_0x05c0('0x120')](db[_0x05c0('0x68')],{'as':_0x05c0('0x68'),'foreignKey':_0x05c0('0x16f')});db[_0x05c0('0x45')][_0x05c0('0x120')](db[_0x05c0('0x6f')],{'as':_0x05c0('0x6f'),'foreignKey':_0x05c0('0x170')});db[_0x05c0('0x46')]['belongsTo'](db[_0x05c0('0x12')],{'onDelete':'restrict'});db['MailApplication'][_0x05c0('0x120')](db[_0x05c0('0x12d')],{'onDelete':_0x05c0('0x171')});db[_0x05c0('0x46')][_0x05c0('0x120')](db[_0x05c0('0x3e')],{'onDelete':'restrict'});db[_0x05c0('0x46')][_0x05c0('0x120')](db['Interval'],{'onDelete':_0x05c0('0x171'),'foreignKey':'IntervalId'});db[_0x05c0('0x46')][_0x05c0('0x120')](db[_0x05c0('0x169')],{'onDelete':_0x05c0('0x171'),'foreignKey':'TagId'});db[_0x05c0('0x48')][_0x05c0('0x120')](db['MailAccount'],{});db[_0x05c0('0x48')]['belongsTo'](db['CmList'],{'as':_0x05c0('0x161'),'foreignKey':_0x05c0('0x162')});db['MailQueueReport']['belongsTo'](db[_0x05c0('0x77')],{'as':_0x05c0('0x15a'),'foreignKey':'ContactId'});db[_0x05c0('0x48')][_0x05c0('0x120')](db[_0x05c0('0x43')],{});db[_0x05c0('0x48')][_0x05c0('0x120')](db[_0x05c0('0x45')],{});db[_0x05c0('0x48')][_0x05c0('0x120')](db['User'],{});db[_0x05c0('0x48')][_0x05c0('0x120')](db[_0x05c0('0x12d')],{});db[_0x05c0('0x4a')][_0x05c0('0x114')](db[_0x05c0('0x4b')],{'as':'Items','onDelete':'cascade'});db['FaxAccount'][_0x05c0('0x114')](db[_0x05c0('0x86')],{'as':'Dispositions','foreignKey':_0x05c0('0x172'),'onDelete':_0x05c0('0x112')});db[_0x05c0('0x4d')][_0x05c0('0x114')](db['CannedAnswer'],{'as':_0x05c0('0x15f'),'foreignKey':'FaxAccountId'});db[_0x05c0('0x4d')][_0x05c0('0x114')](db[_0x05c0('0x51')],{'as':_0x05c0('0x160')});db[_0x05c0('0x4d')]['hasMany'](db[_0x05c0('0x4f')],{'as':_0x05c0('0x142')});db['FaxAccount'][_0x05c0('0x114')](db[_0x05c0('0x19')],{'as':_0x05c0('0x173'),'onDelete':_0x05c0('0x112')});db['FaxAccount'][_0x05c0('0x114')](db[_0x05c0('0x53')],{'as':_0x05c0('0x155')});db[_0x05c0('0x4d')][_0x05c0('0x120')](db[_0x05c0('0x28')],{'as':_0x05c0('0x28')});db[_0x05c0('0x4d')][_0x05c0('0x120')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x05c0('0x4d')]['belongsTo'](db[_0x05c0('0x8b')],{'as':_0x05c0('0x14d'),'foreignKey':_0x05c0('0x14e')});db[_0x05c0('0x4d')][_0x05c0('0x122')](db[_0x05c0('0x12')],{'as':_0x05c0('0x14f'),'through':'user_has_fax_accounts'});db[_0x05c0('0x4f')][_0x05c0('0x120')](db[_0x05c0('0x12')],{'onDelete':_0x05c0('0x171')});db['FaxApplication']['belongsTo'](db['FaxQueue'],{'onDelete':_0x05c0('0x171')});db[_0x05c0('0x4f')][_0x05c0('0x120')](db[_0x05c0('0x4d')],{'onDelete':_0x05c0('0x171')});db[_0x05c0('0x4f')][_0x05c0('0x120')](db[_0x05c0('0x169')],{'onDelete':_0x05c0('0x171'),'foreignKey':_0x05c0('0x174')});db[_0x05c0('0x51')][_0x05c0('0x114')](db[_0x05c0('0x53')],{'as':'Messages','onDelete':_0x05c0('0x112'),'foreignKey':'FaxInteractionId'});db['FaxInteraction'][_0x05c0('0x120')](db[_0x05c0('0x4d')],{'as':_0x05c0('0x167'),'foreignKey':_0x05c0('0x172')});db['FaxInteraction']['belongsTo'](db[_0x05c0('0x77')],{'as':_0x05c0('0x15a'),'foreignKey':'ContactId'});db['FaxInteraction'][_0x05c0('0x120')](db[_0x05c0('0x12')],{'as':_0x05c0('0x168'),'foreignKey':'UserId'});db[_0x05c0('0x51')][_0x05c0('0x122')](db[_0x05c0('0x169')],{'through':_0x05c0('0x175'),'as':_0x05c0('0x16b')});db[_0x05c0('0x51')][_0x05c0('0x122')](db['Tag'],{'through':_0x05c0('0x175'),'as':_0x05c0('0x16c')});db[_0x05c0('0x51')][_0x05c0('0x122')](db['User'],{'as':_0x05c0('0x16d'),'through':_0x05c0('0x129'),'foreignKey':'FaxInteractionId'});db['FaxMessage'][_0x05c0('0x120')](db[_0x05c0('0x12')],{'onDelete':_0x05c0('0x112'),'as':'User'});db[_0x05c0('0x53')][_0x05c0('0x120')](db[_0x05c0('0x51')],{'as':'Interaction','foreignKey':_0x05c0('0x176')});db[_0x05c0('0x53')][_0x05c0('0x120')](db[_0x05c0('0x77')],{'onDelete':_0x05c0('0x112'),'as':_0x05c0('0x15a')});db[_0x05c0('0x53')]['belongsTo'](db[_0x05c0('0xe4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x05c0('0x53')]['belongsTo'](db[_0x05c0('0x4d')],{'as':_0x05c0('0x167'),'foreignKey':_0x05c0('0x172')});db['FaxQueue'][_0x05c0('0x122')](db[_0x05c0('0x12')],{'as':_0x05c0('0x14f'),'through':_0x05c0('0x32')});db[_0x05c0('0x55')][_0x05c0('0x122')](db[_0x05c0('0xde')],{'through':_0x05c0('0x177'),'as':_0x05c0('0x150')});db['FaxQueueReport'][_0x05c0('0x120')](db[_0x05c0('0x4d')],{});db[_0x05c0('0x57')][_0x05c0('0x120')](db[_0x05c0('0xf1')],{'as':_0x05c0('0x161'),'foreignKey':_0x05c0('0x162')});db[_0x05c0('0x57')]['belongsTo'](db[_0x05c0('0x77')],{'as':_0x05c0('0x15a'),'foreignKey':_0x05c0('0x178')});db[_0x05c0('0x57')][_0x05c0('0x120')](db[_0x05c0('0x51')],{});db['FaxQueueReport']['belongsTo'](db['FaxMessage'],{});db[_0x05c0('0x57')][_0x05c0('0x120')](db['User'],{});db[_0x05c0('0x57')][_0x05c0('0x120')](db['FaxQueue'],{});db[_0x05c0('0x59')]['hasMany'](db[_0x05c0('0x86')],{'as':'Dispositions','foreignKey':_0x05c0('0x179'),'onDelete':'cascade'});db[_0x05c0('0x59')][_0x05c0('0x114')](db['CannedAnswer'],{'as':_0x05c0('0x15f'),'foreignKey':_0x05c0('0x179')});db['SmsAccount'][_0x05c0('0x114')](db[_0x05c0('0x5f')],{'as':_0x05c0('0x155'),'foreignKey':_0x05c0('0x179')});db[_0x05c0('0x59')][_0x05c0('0x114')](db[_0x05c0('0x5d')],{'as':_0x05c0('0x160')});db[_0x05c0('0x59')]['hasMany'](db[_0x05c0('0x5b')],{'as':'Applications'});db[_0x05c0('0x59')][_0x05c0('0x120')](db[_0x05c0('0xf1')],{'as':_0x05c0('0x161'),'foreignKey':_0x05c0('0x162')});db[_0x05c0('0x59')][_0x05c0('0x120')](db[_0x05c0('0x8b')],{'as':'mandatoryDispositionPause','foreignKey':_0x05c0('0x14e')});db['SmsAccount'][_0x05c0('0x122')](db[_0x05c0('0x12')],{'as':_0x05c0('0x14f'),'through':_0x05c0('0x13c')});db['SmsApplication'][_0x05c0('0x120')](db[_0x05c0('0x12')],{'onDelete':'restrict'});db[_0x05c0('0x5b')][_0x05c0('0x120')](db[_0x05c0('0x60')],{'onDelete':'restrict'});db[_0x05c0('0x5b')]['belongsTo'](db[_0x05c0('0x59')],{'onDelete':_0x05c0('0x171')});db[_0x05c0('0x5b')][_0x05c0('0x120')](db[_0x05c0('0x89')],{'onDelete':'restrict','foreignKey':_0x05c0('0x14c')});db[_0x05c0('0x5b')][_0x05c0('0x120')](db['Tag'],{'onDelete':'restrict','foreignKey':'TagId'});db['SmsInteraction'][_0x05c0('0x114')](db[_0x05c0('0x5f')],{'as':_0x05c0('0x155'),'onDelete':_0x05c0('0x112'),'foreignKey':'SmsInteractionId'});db[_0x05c0('0x5d')]['belongsTo'](db[_0x05c0('0x59')],{'as':_0x05c0('0x167'),'foreignKey':_0x05c0('0x179')});db[_0x05c0('0x5d')][_0x05c0('0x120')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db['SmsInteraction'][_0x05c0('0x120')](db[_0x05c0('0x12')],{'as':_0x05c0('0x168'),'foreignKey':_0x05c0('0x113')});db[_0x05c0('0x5d')][_0x05c0('0x122')](db['Tag'],{'through':'sms_interaction_has_tags','as':'Tags'});db[_0x05c0('0x5d')]['belongsToMany'](db[_0x05c0('0x169')],{'through':'sms_interaction_has_tags','as':_0x05c0('0x16c')});db[_0x05c0('0x5d')][_0x05c0('0x122')](db[_0x05c0('0x12')],{'as':_0x05c0('0x16d'),'through':_0x05c0('0x12a'),'foreignKey':_0x05c0('0x17a')});db[_0x05c0('0x5f')][_0x05c0('0x120')](db[_0x05c0('0x12')],{'as':_0x05c0('0x12')});db[_0x05c0('0x5f')][_0x05c0('0x120')](db[_0x05c0('0x77')],{'onDelete':'cascade','as':'Contact'});db[_0x05c0('0x5f')][_0x05c0('0x120')](db[_0x05c0('0x5d')],{'onDelete':_0x05c0('0x112'),'as':_0x05c0('0x16e'),'foreignKey':_0x05c0('0x17a')});db[_0x05c0('0x5f')]['belongsTo'](db[_0x05c0('0x59')],{'as':_0x05c0('0x167'),'foreignKey':_0x05c0('0x179')});db['SmsQueue'][_0x05c0('0x122')](db['User'],{'as':_0x05c0('0x14f'),'through':_0x05c0('0x34'),'foreignKey':_0x05c0('0x17b')});db[_0x05c0('0x60')]['belongsToMany'](db['Team'],{'through':'team_has_sms_queues','as':'Teams'});db['OpenchannelAccount'][_0x05c0('0x114')](db[_0x05c0('0x86')],{'as':_0x05c0('0x15e'),'foreignKey':_0x05c0('0x17c'),'onDelete':_0x05c0('0x112')});db[_0x05c0('0x139')][_0x05c0('0x114')](db[_0x05c0('0x85')],{'as':'Answers','foreignKey':_0x05c0('0x17c')});db[_0x05c0('0x139')][_0x05c0('0x114')](db[_0x05c0('0x12b')],{'as':_0x05c0('0x160'),'foreignKey':_0x05c0('0x17c')});db['OpenchannelAccount'][_0x05c0('0x114')](db['OpenchannelMessage'],{'as':_0x05c0('0x155'),'foreignKey':'OpenchannelAccountId'});db[_0x05c0('0x139')][_0x05c0('0x114')](db[_0x05c0('0x62')],{'as':_0x05c0('0x142'),'foreignKey':_0x05c0('0x17c')});db[_0x05c0('0x139')][_0x05c0('0x120')](db['CmList'],{'as':'List','foreignKey':_0x05c0('0x162')});db['OpenchannelAccount'][_0x05c0('0x120')](db[_0x05c0('0x8b')],{'as':_0x05c0('0x14d'),'foreignKey':_0x05c0('0x14e')});db[_0x05c0('0x139')][_0x05c0('0x122')](db[_0x05c0('0x12')],{'as':'Agents','through':_0x05c0('0x17d')});db['OpenchannelApplication'][_0x05c0('0x120')](db[_0x05c0('0x12')],{'onDelete':_0x05c0('0x171')});db['OpenchannelApplication'][_0x05c0('0x120')](db['OpenchannelQueue'],{'onDelete':_0x05c0('0x171'),'foreignKey':_0x05c0('0x17e')});db[_0x05c0('0x62')][_0x05c0('0x120')](db[_0x05c0('0x139')],{'onDelete':'restrict','foreignKey':_0x05c0('0x17c')});db['OpenchannelApplication'][_0x05c0('0x120')](db['Interval'],{'onDelete':_0x05c0('0x171'),'foreignKey':_0x05c0('0x14c')});db[_0x05c0('0x62')][_0x05c0('0x120')](db[_0x05c0('0x169')],{'onDelete':_0x05c0('0x171'),'foreignKey':'TagId'});db[_0x05c0('0x12b')][_0x05c0('0x114')](db[_0x05c0('0x65')],{'as':'Messages','onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x17f')});db[_0x05c0('0x12b')][_0x05c0('0x120')](db[_0x05c0('0x139')],{'as':_0x05c0('0x167'),'foreignKey':_0x05c0('0x17c')});db['OpenchannelInteraction']['belongsTo'](db[_0x05c0('0x77')],{'as':'Contact','foreignKey':'ContactId'});db[_0x05c0('0x12b')][_0x05c0('0x120')](db[_0x05c0('0x12')],{'as':_0x05c0('0x168'),'foreignKey':_0x05c0('0x113')});db['OpenchannelInteraction'][_0x05c0('0x122')](db[_0x05c0('0x169')],{'through':'openchannel_interaction_has_tags','as':_0x05c0('0x16b')});db[_0x05c0('0x12b')]['belongsToMany'](db[_0x05c0('0x169')],{'through':_0x05c0('0x180'),'as':'ThroughTags'});db['OpenchannelInteraction'][_0x05c0('0x122')](db[_0x05c0('0x12')],{'as':'Users','through':_0x05c0('0x181'),'foreignKey':'OpenchannelInteractionId'});db[_0x05c0('0x65')][_0x05c0('0x120')](db[_0x05c0('0x12')],{'onDelete':_0x05c0('0x112'),'as':_0x05c0('0x12')});db[_0x05c0('0x65')][_0x05c0('0x120')](db[_0x05c0('0x77')],{'onDelete':'cascade','as':_0x05c0('0x15a')});db['OpenchannelMessage'][_0x05c0('0x120')](db[_0x05c0('0x12b')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x05c0('0x17f')});db[_0x05c0('0x65')][_0x05c0('0x120')](db[_0x05c0('0xe4')],{'as':_0x05c0('0xe4'),'foreignKey':_0x05c0('0x182')});db[_0x05c0('0x65')][_0x05c0('0x120')](db[_0x05c0('0x139')],{'as':_0x05c0('0x167'),'foreignKey':_0x05c0('0x17c')});db[_0x05c0('0x66')][_0x05c0('0x122')](db[_0x05c0('0x12')],{'as':'Agents','through':_0x05c0('0x36'),'foreignKey':'OpenchannelQueueId'});db[_0x05c0('0x66')]['belongsToMany'](db[_0x05c0('0xde')],{'through':_0x05c0('0x183'),'as':_0x05c0('0x150')});db['ChatWebsite'][_0x05c0('0x114')](db[_0x05c0('0x86')],{'as':_0x05c0('0x15e'),'foreignKey':_0x05c0('0x16f'),'onDelete':_0x05c0('0x112')});db[_0x05c0('0x68')][_0x05c0('0x114')](db[_0x05c0('0x85')],{'as':_0x05c0('0x15f'),'foreignKey':_0x05c0('0x16f')});db[_0x05c0('0x68')][_0x05c0('0x114')](db[_0x05c0('0x73')],{'as':'ProactiveActions'});db['ChatWebsite'][_0x05c0('0x114')](db[_0x05c0('0x6c')],{'as':'Interactions'});db[_0x05c0('0x68')][_0x05c0('0x114')](db[_0x05c0('0x6b')],{'as':_0x05c0('0x142')});db['ChatWebsite'][_0x05c0('0x114')](db['ChatMessage'],{'as':_0x05c0('0x155')});db[_0x05c0('0x68')]['belongsTo'](db[_0x05c0('0xf1')],{'as':_0x05c0('0x161'),'foreignKey':_0x05c0('0x162')});db[_0x05c0('0x68')][_0x05c0('0x120')](db['Interval'],{'as':'Interval','foreignKey':_0x05c0('0x14c')});db[_0x05c0('0x68')][_0x05c0('0x120')](db[_0x05c0('0x3e')],{'as':'MailAccount','foreignKey':_0x05c0('0x15b')});db[_0x05c0('0x68')]['belongsTo'](db[_0x05c0('0x8b')],{'as':_0x05c0('0x14d'),'foreignKey':_0x05c0('0x14e')});db[_0x05c0('0x68')][_0x05c0('0x122')](db[_0x05c0('0x12')],{'as':_0x05c0('0x14f'),'through':_0x05c0('0x135')});db[_0x05c0('0x6a')][_0x05c0('0x120')](db[_0x05c0('0x139')],{});db[_0x05c0('0x6a')][_0x05c0('0x120')](db[_0x05c0('0xf1')],{'as':_0x05c0('0x161'),'foreignKey':_0x05c0('0x162')});db[_0x05c0('0x6a')][_0x05c0('0x120')](db[_0x05c0('0x77')],{'as':_0x05c0('0x15a'),'foreignKey':_0x05c0('0x178')});db['OpenchannelQueueReport']['belongsTo'](db[_0x05c0('0x12b')],{});db[_0x05c0('0x6a')][_0x05c0('0x120')](db[_0x05c0('0x65')],{});db[_0x05c0('0x6a')][_0x05c0('0x120')](db[_0x05c0('0x12')],{});db[_0x05c0('0x6a')][_0x05c0('0x120')](db['OpenchannelQueue'],{});db[_0x05c0('0x6b')][_0x05c0('0x120')](db[_0x05c0('0x12')],{'as':'Agent','foreignKey':_0x05c0('0x113'),'onDelete':_0x05c0('0x171')});db[_0x05c0('0x6b')]['belongsTo'](db['ChatQueue'],{'as':_0x05c0('0x184'),'foreignKey':_0x05c0('0x185'),'onDelete':_0x05c0('0x171')});db[_0x05c0('0x6b')]['belongsTo'](db[_0x05c0('0x68')],{'as':_0x05c0('0x186'),'foreignKey':_0x05c0('0x16f'),'onDelete':_0x05c0('0x171')});db[_0x05c0('0x6b')][_0x05c0('0x120')](db[_0x05c0('0x169')],{'onDelete':_0x05c0('0x171'),'foreignKey':'TagId'});db[_0x05c0('0x6c')][_0x05c0('0x114')](db[_0x05c0('0x6e')],{'as':_0x05c0('0x155'),'onDelete':'cascade','foreignKey':'ChatInteractionId'});db[_0x05c0('0x6c')]['belongsTo'](db[_0x05c0('0x68')],{'as':_0x05c0('0x167'),'foreignKey':_0x05c0('0x16f')});db[_0x05c0('0x6c')][_0x05c0('0x120')](db[_0x05c0('0x77')],{'as':_0x05c0('0x15a'),'foreignKey':_0x05c0('0x178')});db[_0x05c0('0x6c')][_0x05c0('0x120')](db[_0x05c0('0x12')],{'as':_0x05c0('0x168'),'foreignKey':_0x05c0('0x113')});db[_0x05c0('0x6c')][_0x05c0('0x122')](db[_0x05c0('0x169')],{'through':'chat_interaction_has_tags','as':_0x05c0('0x16b')});db[_0x05c0('0x6c')][_0x05c0('0x122')](db[_0x05c0('0x169')],{'through':_0x05c0('0x187'),'as':'ThroughTags'});db[_0x05c0('0x6c')][_0x05c0('0x122')](db[_0x05c0('0x12')],{'as':_0x05c0('0x16d'),'through':_0x05c0('0x188'),'foreignKey':_0x05c0('0x189')});db[_0x05c0('0x6e')][_0x05c0('0x120')](db['User'],{'onDelete':_0x05c0('0x112'),'as':'User'});db[_0x05c0('0x6e')][_0x05c0('0x120')](db[_0x05c0('0x77')],{'onDelete':_0x05c0('0x112'),'as':_0x05c0('0x15a'),'foreignKey':_0x05c0('0x178')});db['ChatMessage'][_0x05c0('0x120')](db[_0x05c0('0x6c')],{'onDelete':_0x05c0('0x112'),'as':'Interaction','foreignKey':_0x05c0('0x189')});db[_0x05c0('0x6e')]['belongsTo'](db['Attachment'],{'as':_0x05c0('0xe4'),'foreignKey':_0x05c0('0x182')});db['ChatMessage'][_0x05c0('0x120')](db[_0x05c0('0x68')],{'as':'Account','foreignKey':_0x05c0('0x16f')});db[_0x05c0('0x6f')]['hasMany'](db[_0x05c0('0xe4')],{'as':_0x05c0('0x18a'),'foreignKey':'ChatOfflineMessageId','onDelete':'cascade','hooks':!![]});db[_0x05c0('0x6f')][_0x05c0('0x120')](db[_0x05c0('0x77')],{'onDelete':'cascade','as':_0x05c0('0x15a'),'foreignKey':_0x05c0('0x178')});db[_0x05c0('0x6f')]['belongsTo'](db['ChatWebsite'],{'as':_0x05c0('0x167'),'foreignKey':_0x05c0('0x16f')});db[_0x05c0('0x12e')]['belongsToMany'](db[_0x05c0('0x12')],{'as':'Agents','through':_0x05c0('0x18b'),'hooks':!![]});db[_0x05c0('0x12e')][_0x05c0('0x122')](db[_0x05c0('0xde')],{'through':_0x05c0('0x18c'),'as':'Teams'});db[_0x05c0('0x72')][_0x05c0('0x114')](db[_0x05c0('0xcb')],{'as':_0x05c0('0x155'),'foreignKey':_0x05c0('0x18d'),'onDelete':_0x05c0('0x112')});db[_0x05c0('0x72')]['belongsToMany'](db['User'],{'as':_0x05c0('0x144'),'through':'chat_group_has_users'});db['ChatProactiveAction'][_0x05c0('0x120')](db[_0x05c0('0x68')],{'as':'Website','foreignKey':_0x05c0('0x16f')});db[_0x05c0('0x75')][_0x05c0('0x114')](db[_0x05c0('0x77')],{'as':_0x05c0('0x125'),'foreignKey':_0x05c0('0x18e')});db[_0x05c0('0x77')][_0x05c0('0x114')](db['CmHopper'],{'as':'Hoppers','foreignKey':_0x05c0('0x178')});db[_0x05c0('0x77')][_0x05c0('0x114')](db[_0x05c0('0x7d')],{'as':_0x05c0('0x146'),'foreignKey':_0x05c0('0x178')});db['CmContact'][_0x05c0('0x114')](db[_0x05c0('0x7f')],{'as':_0x05c0('0x147'),'foreignKey':_0x05c0('0x178')});db[_0x05c0('0x77')][_0x05c0('0x114')](db[_0x05c0('0x11a')],{'as':_0x05c0('0x11a'),'foreignKey':'ContactId'});db[_0x05c0('0x77')][_0x05c0('0x114')](db[_0x05c0('0x148')],{'as':'JscriptySessions','foreignKey':_0x05c0('0x178')});db['CmContact'][_0x05c0('0x114')](db[_0x05c0('0x12b')],{'as':'OpenchannelInteractions','foreignKey':_0x05c0('0x178'),'onDelete':_0x05c0('0x171')});db[_0x05c0('0x77')]['hasMany'](db[_0x05c0('0x6c')],{'as':_0x05c0('0x11b'),'foreignKey':_0x05c0('0x178'),'onDelete':'restrict'});db[_0x05c0('0x77')][_0x05c0('0x114')](db[_0x05c0('0x5d')],{'as':'SmsInteractions','foreignKey':_0x05c0('0x178'),'onDelete':_0x05c0('0x171')});db[_0x05c0('0x77')]['hasMany'](db[_0x05c0('0x51')],{'as':'FaxInteractions','foreignKey':_0x05c0('0x178'),'onDelete':_0x05c0('0x171')});db[_0x05c0('0x77')][_0x05c0('0x114')](db[_0x05c0('0x43')],{'as':_0x05c0('0x11e'),'foreignKey':_0x05c0('0x178'),'onDelete':_0x05c0('0x171')});db[_0x05c0('0x77')][_0x05c0('0x120')](db['CmCompany'],{'as':_0x05c0('0x18f'),'foreignKey':_0x05c0('0x18e')});db[_0x05c0('0x77')][_0x05c0('0x120')](db['CmList'],{'as':_0x05c0('0x161'),'foreignKey':'ListId','onDelete':_0x05c0('0x112')});db[_0x05c0('0x77')][_0x05c0('0x122')](db[_0x05c0('0x12')],{'as':_0x05c0('0x16d'),'through':_0x05c0('0x190')});db[_0x05c0('0x77')]['belongsToMany'](db[_0x05c0('0x169')],{'as':_0x05c0('0x16b'),'through':_0x05c0('0x191')});db[_0x05c0('0x77')][_0x05c0('0x122')](db[_0x05c0('0x169')],{'through':'cm_contact_has_tags','as':_0x05c0('0x16c')});db['CmHopper'][_0x05c0('0x120')](db['CmContact'],{'as':_0x05c0('0x15a'),'foreignKey':_0x05c0('0x178'),'onDelete':'cascade'});db[_0x05c0('0x79')][_0x05c0('0x120')](db[_0x05c0('0xf1')],{'as':_0x05c0('0x161'),'foreignKey':_0x05c0('0x162'),'onDelete':_0x05c0('0x112')});db[_0x05c0('0x79')][_0x05c0('0x120')](db[_0x05c0('0x12')],{'as':_0x05c0('0x192'),'foreignKey':_0x05c0('0x113')});db['CmHopper'][_0x05c0('0x120')](db[_0x05c0('0x1c')],{'as':_0x05c0('0x184'),'foreignKey':_0x05c0('0x145'),'onDelete':'cascade'});db[_0x05c0('0x79')]['belongsTo'](db[_0x05c0('0xe1')],{'as':_0x05c0('0xe1'),'foreignKey':_0x05c0('0x193'),'onDelete':'cascade'});db[_0x05c0('0x79')]['belongsTo'](db['User'],{'as':_0x05c0('0x168'),'foreignKey':_0x05c0('0x194')});db[_0x05c0('0x7b')][_0x05c0('0x120')](db[_0x05c0('0x77')],{'as':_0x05c0('0x15a'),'foreignKey':'ContactId','onDelete':_0x05c0('0x112')});db[_0x05c0('0x7b')][_0x05c0('0x120')](db['CmList'],{'as':_0x05c0('0x161'),'foreignKey':_0x05c0('0x162'),'onDelete':_0x05c0('0x112')});db['CmHopperBlack'][_0x05c0('0x120')](db[_0x05c0('0x1c')],{'as':_0x05c0('0x184'),'foreignKey':_0x05c0('0x145'),'onDelete':_0x05c0('0x112')});db[_0x05c0('0x7b')]['belongsTo'](db['Campaign'],{'as':_0x05c0('0xe1'),'foreignKey':_0x05c0('0x193'),'onDelete':_0x05c0('0x112')});db[_0x05c0('0x195')][_0x05c0('0x114')](db[_0x05c0('0x88')],{'as':{'plural':_0x05c0('0x196'),'singular':_0x05c0('0x197')},'foreignKey':_0x05c0('0x198'),'onDelete':'cascade','hooks':!![]});db[_0x05c0('0x195')][_0x05c0('0x114')](db[_0x05c0('0x88')],{'as':{'plural':_0x05c0('0x199'),'singular':_0x05c0('0x19a')},'foreignKey':_0x05c0('0x19b'),'onDelete':_0x05c0('0x112'),'hooks':!![]});db[_0x05c0('0x195')]['hasMany'](db[_0x05c0('0x82')],{'as':_0x05c0('0x19c'),'foreignKey':_0x05c0('0x19d'),'onDelete':'cascade','hooks':!![]});db['Disposition'][_0x05c0('0x114')](db[_0x05c0('0x86')],{'as':_0x05c0('0x15e'),'foreignKey':'ParentId','onDelete':_0x05c0('0x112')});db['Interval'][_0x05c0('0x114')](db[_0x05c0('0x89')],{'as':_0x05c0('0x19e'),'foreignKey':_0x05c0('0x14c'),'onDelete':_0x05c0('0x112'),'hooks':!![],'required':![]});db[_0x05c0('0x89')][_0x05c0('0x114')](db[_0x05c0('0x19')],{'as':_0x05c0('0x119'),'foreignKey':'IntervalId','onDelete':'restrict'});db[_0x05c0('0x89')][_0x05c0('0x114')](db[_0x05c0('0x46')],{'as':'MailApplications','foreignKey':_0x05c0('0x14c')});db['Interval'][_0x05c0('0x114')](db['ChatApplication'],{'as':_0x05c0('0x19f'),'foreignKey':_0x05c0('0x14c')});db[_0x05c0('0x89')][_0x05c0('0x114')](db['FaxApplication'],{'as':_0x05c0('0x1a0'),'foreignKey':_0x05c0('0x14c')});db[_0x05c0('0x89')][_0x05c0('0x114')](db['SmsApplication'],{'as':_0x05c0('0x1a1'),'foreignKey':_0x05c0('0x14c')});db[_0x05c0('0x1a2')][_0x05c0('0x120')](db[_0x05c0('0x3e')],{});db[_0x05c0('0x1a2')][_0x05c0('0x120')](db[_0x05c0('0x99')],{'foreignKey':'DefaultReportId'});db[_0x05c0('0x1a2')]['belongsTo'](db[_0x05c0('0x1a3')],{'foreignKey':_0x05c0('0x1a4')});db[_0x05c0('0x90')][_0x05c0('0x122')](db[_0x05c0('0x1b')],{'as':_0x05c0('0x1a5'),'through':_0x05c0('0x1a6'),'onDelete':_0x05c0('0x171')});db[_0x05c0('0x169')][_0x05c0('0x122')](db['CmContact'],{'through':_0x05c0('0x191')});db[_0x05c0('0x169')]['belongsToMany'](db[_0x05c0('0x6c')],{'through':_0x05c0('0x187')});db[_0x05c0('0x169')][_0x05c0('0x122')](db[_0x05c0('0x43')],{'through':_0x05c0('0x16a')});db[_0x05c0('0x169')][_0x05c0('0x122')](db[_0x05c0('0x5d')],{'through':_0x05c0('0x1a7')});db['Tag'][_0x05c0('0x122')](db['FaxInteraction'],{'through':_0x05c0('0x175')});db['Tag'][_0x05c0('0x122')](db[_0x05c0('0x12b')],{'through':_0x05c0('0x180')});db[_0x05c0('0x169')]['belongsToMany'](db[_0x05c0('0x101')],{'through':_0x05c0('0x1a8')});db[_0x05c0('0x92')]['hasMany'](db[_0x05c0('0x88')],{'as':{'plural':_0x05c0('0x1a9'),'singular':'AllCondition'},'foreignKey':'TriggerAllId','onDelete':_0x05c0('0x112'),'hooks':!![]});db['Trigger'][_0x05c0('0x114')](db[_0x05c0('0x88')],{'as':{'plural':'AnyConditions','singular':_0x05c0('0x1aa')},'foreignKey':_0x05c0('0x1ab'),'onDelete':'cascade','hooks':!![]});db[_0x05c0('0x92')][_0x05c0('0x114')](db['Action'],{'as':'Actions','foreignKey':_0x05c0('0x1ac'),'onDelete':'cascade','hooks':!![]});db[_0x05c0('0x1a3')][_0x05c0('0x114')](db['AnalyticFieldReport'],{'as':_0x05c0('0x1ad'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1a4'),'hooks':!![]});db['AnalyticDefaultReport'][_0x05c0('0x114')](db[_0x05c0('0x9c')],{'as':'Fields','onDelete':'cascade','foreignKey':'DefaultReportId'});db['AnalyticMetric'][_0x05c0('0x114')](db[_0x05c0('0x9c')],{'as':_0x05c0('0x1ad'),'onDelete':_0x05c0('0x112'),'foreignKey':'MetricId'});db[_0x05c0('0x9c')][_0x05c0('0x120')](db[_0x05c0('0x9b')],{'foreignKey':_0x05c0('0x1ae')});db[_0x05c0('0x1af')][_0x05c0('0x114')](db[_0x05c0('0xa0')],{'as':_0x05c0('0x1b0'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b1')});db[_0x05c0('0xa0')][_0x05c0('0x114')](db[_0x05c0('0x1b2')],{'as':_0x05c0('0x1b3'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b4')});db['SalesforceConfiguration'][_0x05c0('0x114')](db[_0x05c0('0x1b2')],{'as':_0x05c0('0x1b5'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b6')});db[_0x05c0('0xa0')][_0x05c0('0x114')](db[_0x05c0('0x1b2')],{'as':_0x05c0('0x1ad'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b7')});db['SalesforceConfiguration'][_0x05c0('0x120')](db[_0x05c0('0x1af')],{'as':'Account','foreignKey':'AccountId'});db['SalesforceField'][_0x05c0('0x114')](db['SalesforceField'],{'as':'Subject','foreignKey':_0x05c0('0x1b4')});db[_0x05c0('0x1b2')][_0x05c0('0x114')](db[_0x05c0('0x1b2')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x05c0('0x1b2')][_0x05c0('0x114')](db['SalesforceField'],{'as':_0x05c0('0x1b8'),'foreignKey':_0x05c0('0x1b7')});db[_0x05c0('0x1b2')][_0x05c0('0x120')](db[_0x05c0('0x1b9')],{'as':'Variable','foreignKey':_0x05c0('0x1ba')});db[_0x05c0('0x1bb')]['hasMany'](db[_0x05c0('0xa3')],{'as':_0x05c0('0x1b0'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b1')});db['SugarcrmConfiguration'][_0x05c0('0x114')](db[_0x05c0('0xa4')],{'as':_0x05c0('0x1b3'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b4')});db['SugarcrmConfiguration'][_0x05c0('0x114')](db[_0x05c0('0xa4')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x05c0('0x1b6')});db['SugarcrmConfiguration'][_0x05c0('0x114')](db['SugarcrmField'],{'as':_0x05c0('0x1ad'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b7')});db['SugarcrmConfiguration'][_0x05c0('0x120')](db[_0x05c0('0x1bb')],{'as':_0x05c0('0x167'),'foreignKey':_0x05c0('0x1b1')});db[_0x05c0('0xa4')][_0x05c0('0x114')](db[_0x05c0('0xa4')],{'as':_0x05c0('0x1bc'),'foreignKey':'SubjectId'});db['SugarcrmField'][_0x05c0('0x114')](db['SugarcrmField'],{'as':_0x05c0('0x1bd'),'foreignKey':'DescriptionId'});db[_0x05c0('0xa4')][_0x05c0('0x114')](db['SugarcrmField'],{'as':_0x05c0('0x1b8'),'foreignKey':_0x05c0('0x1b7')});db[_0x05c0('0xa4')][_0x05c0('0x120')](db[_0x05c0('0x1b9')],{'as':'Variable','foreignKey':'VariableId'});db[_0x05c0('0xa6')]['hasMany'](db['DeskConfiguration'],{'as':_0x05c0('0x1b0'),'onDelete':_0x05c0('0x112'),'foreignKey':'AccountId'});db['DeskConfiguration'][_0x05c0('0x114')](db[_0x05c0('0x1be')],{'as':_0x05c0('0x1b3'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x05c0('0xa8')][_0x05c0('0x114')](db[_0x05c0('0x1be')],{'as':'Descriptions','onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b6')});db[_0x05c0('0xa8')][_0x05c0('0x114')](db[_0x05c0('0x1be')],{'as':_0x05c0('0x1ad'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b7')});db['DeskConfiguration']['belongsTo'](db['DeskAccount'],{'as':_0x05c0('0x167'),'foreignKey':'AccountId'});db[_0x05c0('0xa8')]['belongsToMany'](db['Tag'],{'through':_0x05c0('0x1bf')});db[_0x05c0('0x1be')]['hasMany'](db['DeskField'],{'as':'Subject','foreignKey':_0x05c0('0x1b4')});db[_0x05c0('0x1be')][_0x05c0('0x114')](db[_0x05c0('0x1be')],{'as':_0x05c0('0x1bd'),'foreignKey':'DescriptionId'});db[_0x05c0('0x1be')]['hasMany'](db['DeskField'],{'as':_0x05c0('0x1b8'),'foreignKey':_0x05c0('0x1b7')});db[_0x05c0('0x1be')]['belongsTo'](db[_0x05c0('0x1b9')],{'as':_0x05c0('0x1b9'),'foreignKey':_0x05c0('0x1ba')});db[_0x05c0('0xab')][_0x05c0('0x114')](db[_0x05c0('0xad')],{'as':_0x05c0('0x1b0'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b1')});db[_0x05c0('0xad')][_0x05c0('0x114')](db[_0x05c0('0xaf')],{'as':_0x05c0('0x1b3'),'onDelete':_0x05c0('0x112'),'foreignKey':'SubjectId'});db['ZohoConfiguration']['hasMany'](db[_0x05c0('0xaf')],{'as':_0x05c0('0x1b5'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b6')});db[_0x05c0('0xad')][_0x05c0('0x114')](db[_0x05c0('0xaf')],{'as':_0x05c0('0x1ad'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b7')});db[_0x05c0('0xad')][_0x05c0('0x120')](db['ZohoAccount'],{'as':_0x05c0('0x167'),'foreignKey':_0x05c0('0x1b1')});db[_0x05c0('0xaf')][_0x05c0('0x114')](db['ZohoField'],{'as':_0x05c0('0x1bc'),'foreignKey':_0x05c0('0x1b4')});db[_0x05c0('0xaf')][_0x05c0('0x114')](db[_0x05c0('0xaf')],{'as':_0x05c0('0x1bd'),'foreignKey':_0x05c0('0x1b6')});db['ZohoField']['hasMany'](db[_0x05c0('0xaf')],{'as':'Field','foreignKey':_0x05c0('0x1b7')});db[_0x05c0('0xaf')][_0x05c0('0x120')](db[_0x05c0('0x1b9')],{'as':_0x05c0('0x1b9'),'foreignKey':'VariableId'});db[_0x05c0('0xb0')][_0x05c0('0x114')](db[_0x05c0('0xb2')],{'as':_0x05c0('0x1b0'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b1')});db[_0x05c0('0xb2')][_0x05c0('0x114')](db[_0x05c0('0xb4')],{'as':_0x05c0('0x1b3'),'foreignKey':'SubjectId'});db['ZendeskConfiguration']['hasMany'](db[_0x05c0('0xb4')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x05c0('0x114')](db[_0x05c0('0xb4')],{'as':_0x05c0('0x1ad'),'foreignKey':_0x05c0('0x1b7')});db[_0x05c0('0xb2')][_0x05c0('0x120')](db[_0x05c0('0xb0')],{'as':_0x05c0('0x167'),'foreignKey':'AccountId'});db[_0x05c0('0xb2')][_0x05c0('0x122')](db['Tag'],{'through':_0x05c0('0x1c0')});db['ZendeskField'][_0x05c0('0x114')](db[_0x05c0('0xb4')],{'as':_0x05c0('0x1bc'),'foreignKey':_0x05c0('0x1b4')});db['ZendeskField'][_0x05c0('0x114')](db['ZendeskField'],{'as':'Description','foreignKey':_0x05c0('0x1b6')});db[_0x05c0('0xb4')]['hasMany'](db[_0x05c0('0xb4')],{'as':_0x05c0('0x1b8'),'foreignKey':_0x05c0('0x1b7')});db[_0x05c0('0xb4')][_0x05c0('0x120')](db[_0x05c0('0x1b9')],{'as':_0x05c0('0x1b9'),'foreignKey':_0x05c0('0x1ba')});db['FreshdeskAccount'][_0x05c0('0x114')](db['FreshdeskConfiguration'],{'as':_0x05c0('0x1b0'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b1')});db[_0x05c0('0xb6')]['hasMany'](db[_0x05c0('0x1c1')],{'as':_0x05c0('0x1b3'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b4')});db[_0x05c0('0xb6')][_0x05c0('0x114')](db[_0x05c0('0x1c1')],{'as':'Descriptions','onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b6')});db[_0x05c0('0xb6')][_0x05c0('0x114')](db[_0x05c0('0x1c1')],{'as':_0x05c0('0x1ad'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b7')});db[_0x05c0('0xb6')][_0x05c0('0x120')](db[_0x05c0('0x1c2')],{'as':_0x05c0('0x167'),'foreignKey':_0x05c0('0x1b1')});db['FreshdeskConfiguration'][_0x05c0('0x122')](db[_0x05c0('0x169')],{'through':_0x05c0('0x1c3')});db[_0x05c0('0x1c1')]['hasMany'](db['FreshdeskField'],{'as':'Subject','foreignKey':_0x05c0('0x1b4')});db[_0x05c0('0x1c1')][_0x05c0('0x114')](db['FreshdeskField'],{'as':_0x05c0('0x1bd'),'foreignKey':_0x05c0('0x1b6')});db[_0x05c0('0x1c1')][_0x05c0('0x114')](db[_0x05c0('0x1c1')],{'as':'Field','foreignKey':_0x05c0('0x1b7')});db[_0x05c0('0x1c1')][_0x05c0('0x120')](db['Variable'],{'as':_0x05c0('0x1b9'),'foreignKey':_0x05c0('0x1ba')});db[_0x05c0('0x1c4')][_0x05c0('0x114')](db[_0x05c0('0xba')],{'as':'Configurations','onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b1')});db['VtigerConfiguration'][_0x05c0('0x114')](db[_0x05c0('0x1c5')],{'as':'Subjects','foreignKey':_0x05c0('0x1b4')});db[_0x05c0('0xba')]['hasMany'](db['VtigerField'],{'as':_0x05c0('0x1b5'),'foreignKey':_0x05c0('0x1b6')});db[_0x05c0('0xba')][_0x05c0('0x114')](db[_0x05c0('0x1c5')],{'as':_0x05c0('0x1ad'),'foreignKey':'FieldId'});db[_0x05c0('0xba')][_0x05c0('0x120')](db[_0x05c0('0x1c4')],{'as':_0x05c0('0x167'),'foreignKey':_0x05c0('0x1b1')});db[_0x05c0('0x1c5')][_0x05c0('0x114')](db[_0x05c0('0x1c5')],{'as':_0x05c0('0x1bc'),'foreignKey':'SubjectId'});db['VtigerField'][_0x05c0('0x114')](db[_0x05c0('0x1c5')],{'as':'Description','foreignKey':_0x05c0('0x1b6')});db[_0x05c0('0x1c5')][_0x05c0('0x114')](db['VtigerField'],{'as':_0x05c0('0x1b8'),'foreignKey':_0x05c0('0x1b7')});db[_0x05c0('0x1c5')][_0x05c0('0x120')](db[_0x05c0('0x1b9')],{'as':_0x05c0('0x1b9'),'foreignKey':_0x05c0('0x1ba')});db[_0x05c0('0xbc')]['hasMany'](db[_0x05c0('0x1c6')],{'as':'Configurations','onDelete':_0x05c0('0x112'),'foreignKey':'AccountId'});db[_0x05c0('0x1c6')][_0x05c0('0x114')](db[_0x05c0('0x1c7')],{'as':_0x05c0('0x1b3'),'foreignKey':'SubjectId'});db['ServicenowConfiguration'][_0x05c0('0x114')](db['ServicenowField'],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ServicenowConfiguration']['hasMany'](db[_0x05c0('0x1c7')],{'as':_0x05c0('0x1ad'),'foreignKey':_0x05c0('0x1b7')});db[_0x05c0('0x1c6')][_0x05c0('0x120')](db[_0x05c0('0xbc')],{'as':_0x05c0('0x167'),'foreignKey':_0x05c0('0x1b1')});db[_0x05c0('0x1c7')][_0x05c0('0x114')](db[_0x05c0('0x1c7')],{'as':_0x05c0('0x1bc'),'foreignKey':_0x05c0('0x1b4')});db[_0x05c0('0x1c7')]['hasMany'](db[_0x05c0('0x1c7')],{'as':_0x05c0('0x1bd'),'foreignKey':_0x05c0('0x1b6')});db[_0x05c0('0x1c7')][_0x05c0('0x114')](db['ServicenowField'],{'as':'Field','foreignKey':_0x05c0('0x1b7')});db[_0x05c0('0x1c7')]['belongsTo'](db[_0x05c0('0x1b9')],{'as':_0x05c0('0x1b9'),'foreignKey':_0x05c0('0x1ba')});db[_0x05c0('0xbf')][_0x05c0('0x114')](db[_0x05c0('0xc1')],{'as':_0x05c0('0x1b0'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b1')});db['Dynamics365Configuration'][_0x05c0('0x114')](db[_0x05c0('0xc3')],{'as':_0x05c0('0x1b3'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b4')});db['Dynamics365Configuration'][_0x05c0('0x114')](db[_0x05c0('0xc3')],{'as':_0x05c0('0x1b5'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b6')});db[_0x05c0('0xc1')][_0x05c0('0x114')](db[_0x05c0('0xc3')],{'as':'Fields','onDelete':_0x05c0('0x112'),'foreignKey':'FieldId'});db[_0x05c0('0xc1')]['belongsTo'](db[_0x05c0('0xbf')],{'as':'Account','foreignKey':_0x05c0('0x1b1')});db[_0x05c0('0xc3')][_0x05c0('0x114')](db['Dynamics365Field'],{'as':'Subject','foreignKey':_0x05c0('0x1b4')});db[_0x05c0('0xc3')][_0x05c0('0x114')](db[_0x05c0('0xc3')],{'as':_0x05c0('0x1bd'),'foreignKey':_0x05c0('0x1b6')});db[_0x05c0('0xc3')][_0x05c0('0x114')](db['Dynamics365Field'],{'as':_0x05c0('0x1b8'),'foreignKey':_0x05c0('0x1b7')});db['Dynamics365Field'][_0x05c0('0x120')](db[_0x05c0('0x1b9')],{'as':_0x05c0('0x1b9'),'foreignKey':'VariableId'});db[_0x05c0('0xc4')][_0x05c0('0x114')](db[_0x05c0('0xc5')],{'as':_0x05c0('0x1b0'),'onDelete':'cascade','foreignKey':_0x05c0('0x1b1')});db[_0x05c0('0xc5')][_0x05c0('0x114')](db['FreshsalesField'],{'as':_0x05c0('0x1b3'),'foreignKey':_0x05c0('0x1b4')});db['FreshsalesConfiguration'][_0x05c0('0x114')](db[_0x05c0('0xc7')],{'as':'Descriptions','foreignKey':_0x05c0('0x1b6')});db[_0x05c0('0xc5')][_0x05c0('0x114')](db[_0x05c0('0xc7')],{'as':_0x05c0('0x1ad'),'foreignKey':'FieldId'});db[_0x05c0('0xc5')][_0x05c0('0x120')](db[_0x05c0('0xc4')],{'as':_0x05c0('0x167'),'foreignKey':_0x05c0('0x1b1')});db[_0x05c0('0xc7')]['hasMany'](db['FreshsalesField'],{'as':_0x05c0('0x1bc'),'foreignKey':_0x05c0('0x1b4')});db[_0x05c0('0xc7')][_0x05c0('0x114')](db[_0x05c0('0xc7')],{'as':_0x05c0('0x1bd'),'foreignKey':_0x05c0('0x1b6')});db['FreshsalesField'][_0x05c0('0x114')](db[_0x05c0('0xc7')],{'as':_0x05c0('0x1b8'),'foreignKey':'FieldId'});db[_0x05c0('0xc7')]['belongsTo'](db[_0x05c0('0x1b9')],{'as':'Variable','foreignKey':_0x05c0('0x1ba')});db[_0x05c0('0xc9')][_0x05c0('0x120')](db['ChatWebsite'],{});db[_0x05c0('0xc9')]['belongsTo'](db['CmList'],{'as':_0x05c0('0x161'),'foreignKey':_0x05c0('0x162')});db[_0x05c0('0xc9')][_0x05c0('0x120')](db[_0x05c0('0x77')],{'as':'Contact','foreignKey':_0x05c0('0x178')});db[_0x05c0('0xc9')]['belongsTo'](db[_0x05c0('0x6c')],{});db[_0x05c0('0xc9')][_0x05c0('0x120')](db[_0x05c0('0x6e')],{});db['ChatQueueReport'][_0x05c0('0x120')](db['User'],{});db[_0x05c0('0xc9')][_0x05c0('0x120')](db['ChatQueue'],{});db[_0x05c0('0xcb')]['belongsTo'](db[_0x05c0('0x12')],{'onDelete':_0x05c0('0x112'),'foreignKey':'FromId'});db['ChatInternalMessage']['belongsTo'](db[_0x05c0('0x12')],{'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1c8')});db[_0x05c0('0x148')][_0x05c0('0x114')](db[_0x05c0('0xce')],{'foreignKey':_0x05c0('0x1c9'),'onDelete':_0x05c0('0x112')});db[_0x05c0('0x148')]['hasMany'](db[_0x05c0('0xcd')],{'foreignKey':_0x05c0('0x1c9'),'onDelete':_0x05c0('0x112')});db[_0x05c0('0xd1')][_0x05c0('0x120')](db['SmsAccount'],{});db[_0x05c0('0xd1')][_0x05c0('0x120')](db[_0x05c0('0xf1')],{'as':_0x05c0('0x161'),'foreignKey':'ListId'});db[_0x05c0('0xd1')]['belongsTo'](db[_0x05c0('0x77')],{'as':_0x05c0('0x15a'),'foreignKey':'ContactId'});db[_0x05c0('0xd1')][_0x05c0('0x120')](db[_0x05c0('0x5d')],{});db[_0x05c0('0xd1')][_0x05c0('0x120')](db[_0x05c0('0x5f')],{});db[_0x05c0('0xd1')][_0x05c0('0x120')](db[_0x05c0('0x12')],{});db[_0x05c0('0xd1')][_0x05c0('0x120')](db[_0x05c0('0x60')],{});db['JscriptyProject'][_0x05c0('0x114')](db[_0x05c0('0x148')],{'foreignKey':_0x05c0('0x1ca')});db[_0x05c0('0x1cb')][_0x05c0('0x114')](db[_0x05c0('0xce')],{'foreignKey':'ProjectId'});db[_0x05c0('0x1cb')][_0x05c0('0x114')](db['JscriptyAnswerReport'],{'foreignKey':_0x05c0('0x1ca')});db[_0x05c0('0xda')][_0x05c0('0x122')](db['User'],{'as':_0x05c0('0x16d'),'through':_0x05c0('0x1cc')});db['Team']['belongsToMany'](db[_0x05c0('0x12')],{'as':_0x05c0('0x14f'),'through':_0x05c0('0x127')});db['Team'][_0x05c0('0x122')](db['VoiceQueue'],{'through':_0x05c0('0x151'),'as':_0x05c0('0x12c')});db[_0x05c0('0xde')][_0x05c0('0x122')](db[_0x05c0('0x12d')],{'through':_0x05c0('0x165'),'as':'MailQueues'});db[_0x05c0('0xde')][_0x05c0('0x122')](db['ChatQueue'],{'through':_0x05c0('0x18c'),'as':_0x05c0('0x12f')});db[_0x05c0('0xde')][_0x05c0('0x122')](db[_0x05c0('0x55')],{'through':_0x05c0('0x177'),'as':'FaxQueues'});db[_0x05c0('0xde')][_0x05c0('0x122')](db[_0x05c0('0x60')],{'through':_0x05c0('0x1cd'),'as':_0x05c0('0x131')});db[_0x05c0('0xde')][_0x05c0('0x122')](db[_0x05c0('0x66')],{'through':_0x05c0('0x183'),'as':_0x05c0('0x132')});db['Team']['belongsToMany'](db[_0x05c0('0x109')],{'through':_0x05c0('0x1ce'),'as':_0x05c0('0x133')});db[_0x05c0('0xde')]['belongsToMany'](db[_0x05c0('0xf3')],{'through':'TeamVoicePrefix','as':_0x05c0('0x1cf')});db[_0x05c0('0xe1')][_0x05c0('0x114')](db[_0x05c0('0x79')],{'as':_0x05c0('0x1d0'),'foreignKey':_0x05c0('0x193')});db[_0x05c0('0xe1')][_0x05c0('0x114')](db[_0x05c0('0x7d')],{'as':_0x05c0('0x146'),'foreignKey':_0x05c0('0x193')});db[_0x05c0('0xe1')][_0x05c0('0x114')](db[_0x05c0('0x7f')],{'as':_0x05c0('0x147'),'foreignKey':'CampaignId'});db[_0x05c0('0xe1')][_0x05c0('0x114')](db[_0x05c0('0x7b')],{'as':_0x05c0('0x1d1'),'foreignKey':_0x05c0('0x193')});db[_0x05c0('0xe1')]['belongsTo'](db[_0x05c0('0x28')],{'as':_0x05c0('0x28'),'foreignKey':_0x05c0('0x14a')});db['Campaign'][_0x05c0('0x120')](db['Trunk'],{'as':_0x05c0('0x14b'),'foreignKey':_0x05c0('0x1d2')});db[_0x05c0('0xe1')][_0x05c0('0x120')](db[_0x05c0('0x89')],{'as':_0x05c0('0x89'),'foreignKey':_0x05c0('0x14c')});db[_0x05c0('0xe1')][_0x05c0('0x120')](db[_0x05c0('0xda')],{'as':'SquareProject','foreignKey':_0x05c0('0x1d3')});db[_0x05c0('0xe1')][_0x05c0('0x122')](db[_0x05c0('0xf1')],{'as':_0x05c0('0x1d4'),'through':'campaigns_has_cm_lists'});db[_0x05c0('0xe1')][_0x05c0('0x122')](db[_0x05c0('0xf1')],{'as':'BlackLists','through':'campaigns_has_cm_blacklists'});db['Attachment'][_0x05c0('0x120')](db[_0x05c0('0x6f')],{'as':_0x05c0('0x6f'),'foreignKey':'ChatOfflineMessageId'});db[_0x05c0('0xe7')]['belongsTo'](db[_0x05c0('0x45')],{});db[_0x05c0('0xe7')][_0x05c0('0x120')](db['MailInteraction'],{});db[_0x05c0('0xe7')][_0x05c0('0x120')](db[_0x05c0('0x3e')],{'foreignKey':_0x05c0('0x1d5'),'as':_0x05c0('0x1d6')});db['MailTransferReport'][_0x05c0('0x120')](db[_0x05c0('0x12')],{'foreignKey':_0x05c0('0x1d7'),'as':_0x05c0('0x1d8')});db['MailTransferReport'][_0x05c0('0x120')](db[_0x05c0('0x12')],{'foreignKey':_0x05c0('0x1d9'),'as':'ToAgent'});db[_0x05c0('0xe7')][_0x05c0('0x120')](db[_0x05c0('0x12d')],{'foreignKey':'ToMailQueueId','as':_0x05c0('0x1da')});db['MailTransferReport'][_0x05c0('0x120')](db[_0x05c0('0x3e')],{'foreignKey':_0x05c0('0x1db'),'as':'ToAccount'});db['ChatTransferReport'][_0x05c0('0x120')](db[_0x05c0('0x6e')],{});db[_0x05c0('0xe9')][_0x05c0('0x120')](db[_0x05c0('0x6c')],{});db[_0x05c0('0xe9')][_0x05c0('0x120')](db[_0x05c0('0x68')],{'foreignKey':_0x05c0('0x1dc'),'as':_0x05c0('0x1d6')});db['ChatTransferReport'][_0x05c0('0x120')](db[_0x05c0('0x12')],{'foreignKey':_0x05c0('0x1d7'),'as':_0x05c0('0x1d8')});db['ChatTransferReport'][_0x05c0('0x120')](db[_0x05c0('0x12')],{'foreignKey':_0x05c0('0x1d9'),'as':'ToAgent'});db['ChatTransferReport'][_0x05c0('0x120')](db[_0x05c0('0x12e')],{'foreignKey':_0x05c0('0x1dd'),'as':_0x05c0('0x1da')});db[_0x05c0('0xe9')][_0x05c0('0x120')](db[_0x05c0('0x68')],{'foreignKey':_0x05c0('0x1de'),'as':_0x05c0('0x1df')});db[_0x05c0('0xeb')][_0x05c0('0x120')](db[_0x05c0('0x53')],{});db['FaxTransferReport'][_0x05c0('0x120')](db[_0x05c0('0x51')],{});db['FaxTransferReport']['belongsTo'](db[_0x05c0('0x4d')],{'foreignKey':_0x05c0('0x1e0'),'as':_0x05c0('0x1d6')});db[_0x05c0('0xeb')]['belongsTo'](db[_0x05c0('0x12')],{'foreignKey':_0x05c0('0x1d7'),'as':_0x05c0('0x1d8')});db[_0x05c0('0xeb')]['belongsTo'](db[_0x05c0('0x12')],{'foreignKey':_0x05c0('0x1d9'),'as':_0x05c0('0x1e1')});db[_0x05c0('0xeb')][_0x05c0('0x120')](db[_0x05c0('0x55')],{'foreignKey':_0x05c0('0x1e2'),'as':_0x05c0('0x1da')});db[_0x05c0('0xeb')][_0x05c0('0x120')](db[_0x05c0('0x4d')],{'foreignKey':_0x05c0('0x1e3'),'as':_0x05c0('0x1df')});db['OpenchannelTransferReport'][_0x05c0('0x120')](db['OpenchannelMessage'],{});db[_0x05c0('0xed')][_0x05c0('0x120')](db[_0x05c0('0x12b')],{});db[_0x05c0('0xed')][_0x05c0('0x120')](db[_0x05c0('0x139')],{'foreignKey':_0x05c0('0x1e4'),'as':_0x05c0('0x1d6')});db['OpenchannelTransferReport'][_0x05c0('0x120')](db[_0x05c0('0x12')],{'foreignKey':_0x05c0('0x1d7'),'as':_0x05c0('0x1d8')});db[_0x05c0('0xed')][_0x05c0('0x120')](db[_0x05c0('0x12')],{'foreignKey':_0x05c0('0x1d9'),'as':'ToAgent'});db['OpenchannelTransferReport']['belongsTo'](db[_0x05c0('0x66')],{'foreignKey':_0x05c0('0x1e5'),'as':_0x05c0('0x1da')});db['OpenchannelTransferReport'][_0x05c0('0x120')](db[_0x05c0('0x139')],{'foreignKey':_0x05c0('0x1e6'),'as':_0x05c0('0x1df')});db['SmsTransferReport']['belongsTo'](db[_0x05c0('0x5f')],{});db[_0x05c0('0xef')][_0x05c0('0x120')](db['SmsInteraction'],{});db[_0x05c0('0xef')][_0x05c0('0x120')](db[_0x05c0('0x59')],{'foreignKey':_0x05c0('0x1e7'),'as':_0x05c0('0x1d6')});db[_0x05c0('0xef')][_0x05c0('0x120')](db[_0x05c0('0x12')],{'foreignKey':_0x05c0('0x1d7'),'as':_0x05c0('0x1d8')});db[_0x05c0('0xef')]['belongsTo'](db['User'],{'foreignKey':_0x05c0('0x1d9'),'as':'ToAgent'});db[_0x05c0('0xef')][_0x05c0('0x120')](db[_0x05c0('0x60')],{'foreignKey':'ToSmsQueueId','as':'ToQueue'});db[_0x05c0('0xef')][_0x05c0('0x120')](db['SmsAccount'],{'foreignKey':_0x05c0('0x1e8'),'as':_0x05c0('0x1df')});db['CmList'][_0x05c0('0x114')](db['Disposition'],{'as':_0x05c0('0x15e'),'foreignKey':_0x05c0('0x162'),'onDelete':_0x05c0('0x112')});db[_0x05c0('0xf1')][_0x05c0('0x114')](db[_0x05c0('0x1e9')],{'as':_0x05c0('0x1ea'),'foreignKey':_0x05c0('0x162')});db[_0x05c0('0xf1')][_0x05c0('0x114')](db[_0x05c0('0x77')],{'as':_0x05c0('0x125'),'onDelete':'cascade','foreignKey':_0x05c0('0x162')});db[_0x05c0('0xf1')][_0x05c0('0x114')](db['CmHopperFinal'],{'as':_0x05c0('0x146'),'foreignKey':_0x05c0('0x162')});db[_0x05c0('0xf1')][_0x05c0('0x114')](db[_0x05c0('0x7f')],{'as':'HopperHistory','foreignKey':'ListId'});db[_0x05c0('0xf1')][_0x05c0('0x114')](db[_0x05c0('0x11a')],{'as':_0x05c0('0x11a'),'foreignKey':_0x05c0('0x162')});db[_0x05c0('0xf1')][_0x05c0('0x122')](db[_0x05c0('0x1c')],{'as':_0x05c0('0x1eb'),'through':'voice_queues_has_cm_lists'});db[_0x05c0('0xf1')][_0x05c0('0x122')](db[_0x05c0('0x12')],{'as':_0x05c0('0x14f'),'through':'cm_user_has_lists'});db[_0x05c0('0xf3')][_0x05c0('0x114')](db[_0x05c0('0x19')],{'as':_0x05c0('0x119'),'onDelete':'cascade'});db[_0x05c0('0xf3')][_0x05c0('0x122')](db[_0x05c0('0x12')],{'as':_0x05c0('0x14f'),'through':_0x05c0('0x10f')});db[_0x05c0('0xf3')][_0x05c0('0x122')](db[_0x05c0('0xde')],{'through':_0x05c0('0x10d'),'as':_0x05c0('0x150')});db[_0x05c0('0xf5')][_0x05c0('0x114')](db[_0x05c0('0x12')],{'as':_0x05c0('0x16d'),'foreignKey':_0x05c0('0x121')});db[_0x05c0('0xf5')]['hasMany'](db['UserProfileSection'],{'as':_0x05c0('0x1ec'),'foreignKey':_0x05c0('0x121'),'onDelete':'cascade'});db[_0x05c0('0xf7')]['hasMany'](db['UserProfileResource'],{'as':_0x05c0('0x1ed'),'foreignKey':_0x05c0('0x1ee'),'onDelete':_0x05c0('0x112')});db['WhatsappAccount']['hasMany'](db[_0x05c0('0x86')],{'as':_0x05c0('0x15e'),'foreignKey':'WhatsappAccountId','onDelete':'cascade'});db[_0x05c0('0xfd')][_0x05c0('0x114')](db[_0x05c0('0x85')],{'as':_0x05c0('0x15f'),'foreignKey':'WhatsappAccountId'});db[_0x05c0('0xfd')][_0x05c0('0x114')](db[_0x05c0('0x103')],{'as':_0x05c0('0x155'),'foreignKey':_0x05c0('0x1ef')});db[_0x05c0('0xfd')][_0x05c0('0x114')](db[_0x05c0('0x101')],{'as':_0x05c0('0x160')});db['WhatsappAccount'][_0x05c0('0x114')](db[_0x05c0('0xff')],{'as':'Applications'});db[_0x05c0('0xfd')][_0x05c0('0x120')](db['CmList'],{'as':'List','foreignKey':_0x05c0('0x162')});db[_0x05c0('0xfd')][_0x05c0('0x120')](db[_0x05c0('0x8b')],{'as':_0x05c0('0x14d'),'foreignKey':_0x05c0('0x14e')});db[_0x05c0('0xfd')][_0x05c0('0x122')](db[_0x05c0('0x12')],{'as':_0x05c0('0x14f'),'through':_0x05c0('0x13e')});db[_0x05c0('0xff')][_0x05c0('0x120')](db[_0x05c0('0x12')],{'onDelete':_0x05c0('0x171')});db[_0x05c0('0xff')][_0x05c0('0x120')](db[_0x05c0('0x109')],{'onDelete':_0x05c0('0x171')});db[_0x05c0('0xff')][_0x05c0('0x120')](db[_0x05c0('0xfd')],{'onDelete':_0x05c0('0x171')});db[_0x05c0('0xff')]['belongsTo'](db[_0x05c0('0x89')],{'onDelete':_0x05c0('0x171'),'foreignKey':_0x05c0('0x14c')});db[_0x05c0('0xff')][_0x05c0('0x120')](db['Tag'],{'onDelete':_0x05c0('0x171'),'foreignKey':_0x05c0('0x174')});db['WhatsappInteraction'][_0x05c0('0x114')](db[_0x05c0('0x103')],{'as':_0x05c0('0x155'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1f0')});db['WhatsappInteraction'][_0x05c0('0x120')](db[_0x05c0('0xfd')],{'as':_0x05c0('0x167'),'foreignKey':_0x05c0('0x1ef')});db[_0x05c0('0x101')][_0x05c0('0x120')](db['CmContact'],{'as':_0x05c0('0x15a'),'foreignKey':_0x05c0('0x178')});db[_0x05c0('0x101')][_0x05c0('0x120')](db[_0x05c0('0x12')],{'as':_0x05c0('0x168'),'foreignKey':_0x05c0('0x113')});db[_0x05c0('0x101')][_0x05c0('0x122')](db[_0x05c0('0x169')],{'through':_0x05c0('0x1a8'),'as':'Tags'});db['WhatsappInteraction'][_0x05c0('0x122')](db[_0x05c0('0x169')],{'through':_0x05c0('0x1a8'),'as':_0x05c0('0x16c')});db['WhatsappInteraction'][_0x05c0('0x122')](db[_0x05c0('0x12')],{'as':_0x05c0('0x16d'),'through':_0x05c0('0x1f1'),'foreignKey':'WhatsappInteractionId'});db[_0x05c0('0x103')][_0x05c0('0x120')](db[_0x05c0('0x12')],{'as':'User'});db[_0x05c0('0x103')][_0x05c0('0x120')](db[_0x05c0('0x77')],{'onDelete':_0x05c0('0x112'),'as':_0x05c0('0x15a')});db[_0x05c0('0x103')][_0x05c0('0x120')](db[_0x05c0('0x101')],{'onDelete':_0x05c0('0x112'),'as':'Interaction','foreignKey':_0x05c0('0x1f0')});db['WhatsappMessage'][_0x05c0('0x120')](db['WhatsappAccount'],{'as':_0x05c0('0x167'),'foreignKey':'WhatsappAccountId'});db[_0x05c0('0x105')]['belongsTo'](db[_0x05c0('0xfd')],{});db['WhatsappQueueReport'][_0x05c0('0x120')](db[_0x05c0('0xf1')],{'as':'List','foreignKey':_0x05c0('0x162')});db[_0x05c0('0x105')][_0x05c0('0x120')](db[_0x05c0('0x77')],{'as':_0x05c0('0x15a'),'foreignKey':_0x05c0('0x178')});db[_0x05c0('0x105')][_0x05c0('0x120')](db[_0x05c0('0x101')],{});db[_0x05c0('0x105')][_0x05c0('0x120')](db[_0x05c0('0x109')],{});db[_0x05c0('0x105')]['belongsTo'](db['WhatsappMessage'],{});db[_0x05c0('0x105')][_0x05c0('0x120')](db[_0x05c0('0x12')],{});db[_0x05c0('0x107')]['belongsTo'](db['WhatsappMessage'],{});db['WhatsappTransferReport']['belongsTo'](db[_0x05c0('0x101')],{});db[_0x05c0('0x107')][_0x05c0('0x120')](db['WhatsappAccount'],{'foreignKey':'FromWhatsappAccountId','as':_0x05c0('0x1d6')});db['WhatsappTransferReport'][_0x05c0('0x120')](db[_0x05c0('0xfd')],{'foreignKey':'ToWhatsappAccountId','as':_0x05c0('0x1df')});db[_0x05c0('0x107')][_0x05c0('0x120')](db['WhatsappQueue'],{'foreignKey':_0x05c0('0x1f2'),'as':_0x05c0('0x1da')});db['WhatsappTransferReport'][_0x05c0('0x120')](db[_0x05c0('0x12')],{'foreignKey':_0x05c0('0x1d7'),'as':_0x05c0('0x1d8')});db[_0x05c0('0x107')][_0x05c0('0x120')](db[_0x05c0('0x12')],{'foreignKey':_0x05c0('0x1d9'),'as':_0x05c0('0x1e1')});db[_0x05c0('0x109')][_0x05c0('0x122')](db[_0x05c0('0x12')],{'as':'Agents','through':_0x05c0('0x38'),'foreignKey':_0x05c0('0x1f3')});db[_0x05c0('0x109')][_0x05c0('0x122')](db[_0x05c0('0xde')],{'through':_0x05c0('0x1ce'),'as':'Teams'});module[_0x05c0('0x1f4')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index f5bd348..e721f8d 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2408=['logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','format','statusCode','responseTime','name','agent_id','agent_name','test','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','/api/voice/recordings','/api/voice/mails','./api/voiceMail','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/memberReport','/api/trunks','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','/api/mail/queues','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','/api/mail/applications','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','/api/chat/groups','./api/chatGroup','/api/cm/companies','./api/cmCompany','/api/cm/hopper','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','/api/networks','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','./api/jscriptyAnswerReport','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','./api/squareMessage','/api/teams','/api/license','./api/license','/api/campaigns','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','./api/openchannelTransferReport','./api/smsTransferReport','./api/cmList','/api/voice/prefixes','./api/voicePrefix','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','./api/userProfileResource','/api/userNotifications','./api/userNotification','./api/whatsappAccount','/api/whatsapp/applications','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/rpc','./api/rpc','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','/index.html','newPassword','apiKey','firstName','lastName','street','phone','mobile','fax','email','clientId','securityToken','tenantId','token','channelSecret','accessTokenSecret','authToken','consumerKey','consumerSecret','calleridname','exten','vidaooApiKey','clientEmail','privateKey','secretaccesskey','key','pass','localstationid','dsn','registry','oldPassword','length','isPlainObject','isString','replace','@@{','includes','lodash','path','express','express-winston','./errors','./config/environment','./config/logger','default','use','\x20body=%s','body','method','headers','x-forwarded-for','connection','remoteAddress','url','user','role','inspect'];(function(_0x1e1c56,_0x5a3618){var _0x1d4348=function(_0x59879f){while(--_0x59879f){_0x1e1c56['push'](_0x1e1c56['shift']());}};_0x1d4348(++_0x5a3618);}(_0x2408,0x126));var _0x8240=function(_0x18782f,_0xe4d75a){_0x18782f=_0x18782f-0x0;var _0x2cbda6=_0x2408[_0x18782f];return _0x2cbda6;};'use strict';var _=require(_0x8240('0x0'));var path=require(_0x8240('0x1'));var express=require(_0x8240('0x2'));var ewinston=require(_0x8240('0x3'));var util=require('util');var errors=require(_0x8240('0x4'));var config=require(_0x8240('0x5'));var logger=require(_0x8240('0x6'))('api');var authLogger=require('./config/logger')('auth');exports[_0x8240('0x7')]=function(_0x5bbbc5){_0x5bbbc5[_0x8240('0x8')](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x1bd427,_0x26405b){var _0xd5734c='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_['isEmpty'](_0x1bd427['body'])){_0xd5734c+=_0x8240('0x9');var _0x243fde=_0x1bd427[_0x8240('0xa')];maskSensitiveData(_0x243fde);}return util['format'](_0xd5734c,_0x1bd427[_0x8240('0xb')],_0x1bd427[_0x8240('0xc')]['x-forwarded-for']?_0x1bd427[_0x8240('0xc')][_0x8240('0xd')]:_0x1bd427[_0x8240('0xe')][_0x8240('0xf')]||_0x1bd427['ip'],_0x1bd427[_0x8240('0x10')],_0x26405b['statusCode'],_0x26405b['responseTime'],_0x1bd427[_0x8240('0x11')]?_0x1bd427[_0x8240('0x11')]['id']:null,_0x1bd427[_0x8240('0x11')]?_0x1bd427[_0x8240('0x11')]['name']:null,_0x1bd427[_0x8240('0x11')]?_0x1bd427[_0x8240('0x11')][_0x8240('0x12')]:null,_0x243fde?util[_0x8240('0x13')](_0x243fde,![],null):'');}}));_0x5bbbc5[_0x8240('0x8')](ewinston[_0x8240('0x14')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x51d7a2,_0x12b5e3){var _0x1ce5ee=_0x8240('0x15');if(_0x51d7a2[_0x8240('0xa')]&&_0x51d7a2[_0x8240('0xa')][_0x8240('0x16')]&&_0x51d7a2['body']['agent_id']){_0x1ce5ee='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x8240('0x17')](_0x1ce5ee,_0x51d7a2[_0x8240('0xb')],_0x51d7a2[_0x8240('0xc')]['x-forwarded-for']?_0x51d7a2[_0x8240('0xc')][_0x8240('0xd')]:_0x51d7a2[_0x8240('0xe')][_0x8240('0xf')]||_0x51d7a2['ip'],_0x51d7a2[_0x8240('0x10')],_0x12b5e3[_0x8240('0x18')],_0x12b5e3[_0x8240('0x19')],_0x51d7a2[_0x8240('0x11')]?_0x51d7a2['user']['id']:null,_0x51d7a2['user']?_0x51d7a2[_0x8240('0x11')][_0x8240('0x1a')]:null,_0x51d7a2[_0x8240('0x11')]?_0x51d7a2['user'][_0x8240('0x12')]:null,_0x51d7a2['body']&&_0x51d7a2['body'][_0x8240('0x16')]?_0x51d7a2[_0x8240('0xa')][_0x8240('0x16')]:'other',_0x51d7a2[_0x8240('0xa')]&&_0x51d7a2[_0x8240('0xa')][_0x8240('0x1b')]?_0x51d7a2['body']['agent_id']:'',_0x51d7a2['body']&&_0x51d7a2[_0x8240('0xa')][_0x8240('0x1c')]?_0x51d7a2[_0x8240('0xa')][_0x8240('0x1c')]:'');},'ignoreRoute':function(_0x16885e){var _0x10bc75=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x10bc75[_0x8240('0x1d')](_0x16885e[_0x8240('0x10')]);}}));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x1e'),require(_0x8240('0x1f')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x20'),require(_0x8240('0x21')));_0x5bbbc5['use'](_0x8240('0x22'),require('./api/voiceContext'));_0x5bbbc5['use'](_0x8240('0x23'),require(_0x8240('0x24')));_0x5bbbc5['use'](_0x8240('0x25'),require(_0x8240('0x26')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x27'),require('./api/voiceQueue'));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x28'),require('./api/voiceRecording'));_0x5bbbc5[_0x8240('0x8')]('/api/screen/recordings',require('./api/screenRecording'));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x29'),require(_0x8240('0x2a')));_0x5bbbc5[_0x8240('0x8')]('/api/voice/mails/messages',require('./api/voiceMailMessage'));_0x5bbbc5['use'](_0x8240('0x2b'),require(_0x8240('0x2c')));_0x5bbbc5[_0x8240('0x8')]('/api/voice/dials/reports',require('./api/voiceDialReport'));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x2d'),require(_0x8240('0x2e')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x2f'),require('./api/voiceQueueReport'));_0x5bbbc5['use']('/api/members/reports',require(_0x8240('0x30')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x31'),require('./api/trunk'));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x32'),require('./api/voiceTransferReport'));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x33'),require(_0x8240('0x34')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x35'),require('./api/mailAccount'));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x36'),require(_0x8240('0x37')));_0x5bbbc5[_0x8240('0x8')]('/api/mail/substatuses',require(_0x8240('0x38')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x39'),require(_0x8240('0x3a')));_0x5bbbc5[_0x8240('0x8')]('/api/mail/messages',require(_0x8240('0x3b')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x3c'),require('./api/mailApplication'));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x3d'),require(_0x8240('0x3e')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x3f'),require(_0x8240('0x40')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x41'),require('./api/dashboardItem'));_0x5bbbc5[_0x8240('0x8')]('/api/fax/accounts',require('./api/faxAccount'));_0x5bbbc5['use'](_0x8240('0x42'),require(_0x8240('0x43')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x44'),require(_0x8240('0x45')));_0x5bbbc5[_0x8240('0x8')]('/api/fax/messages',require(_0x8240('0x46')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x47'),require(_0x8240('0x48')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x49'),require('./api/faxQueueReport'));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x4a'),require(_0x8240('0x4b')));_0x5bbbc5['use'](_0x8240('0x4c'),require(_0x8240('0x4d')));_0x5bbbc5['use'](_0x8240('0x4e'),require(_0x8240('0x4f')));_0x5bbbc5[_0x8240('0x8')]('/api/sms/messages',require(_0x8240('0x50')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x51'),require(_0x8240('0x52')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x53'),require(_0x8240('0x54')));_0x5bbbc5[_0x8240('0x8')]('/api/openchannel/applications',require(_0x8240('0x55')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x56'),require(_0x8240('0x57')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x58'),require(_0x8240('0x59')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x5a'),require('./api/openchannelQueue'));_0x5bbbc5['use'](_0x8240('0x5b'),require(_0x8240('0x5c')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x5d'),require('./api/openchannelQueueReport'));_0x5bbbc5[_0x8240('0x8')]('/api/chat/applications',require('./api/chatApplication'));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x5e'),require(_0x8240('0x5f')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x60'),require(_0x8240('0x61')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x62'),require('./api/chatOfflineMessage'));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x63'),require('./api/chatQueue'));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x64'),require(_0x8240('0x65')));_0x5bbbc5['use']('/api/chat/proactive_actions',require('./api/chatProactiveAction'));_0x5bbbc5['use'](_0x8240('0x66'),require(_0x8240('0x67')));_0x5bbbc5[_0x8240('0x8')]('/api/cm/contacts',require('./api/cmContact'));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x68'),require('./api/cmHopper'));_0x5bbbc5['use']('/api/cm/hopper_black',require(_0x8240('0x69')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x6a'),require('./api/cmHopperFinal'));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x6b'),require(_0x8240('0x6c')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x6d'),require(_0x8240('0x6e')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x6f'),require(_0x8240('0x70')));_0x5bbbc5['use'](_0x8240('0x71'),require(_0x8240('0x72')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x73'),require(_0x8240('0x74')));_0x5bbbc5['use'](_0x8240('0x75'),require('./api/disposition'));_0x5bbbc5['use']('/api/conditions',require(_0x8240('0x76')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x77'),require(_0x8240('0x78')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x79'),require(_0x8240('0x7a')));_0x5bbbc5[_0x8240('0x8')]('/api/cdr',require('./api/cdr'));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x7b'),require('./api/voiceQueuesLog'));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x7c'),require(_0x8240('0x7d')));_0x5bbbc5[_0x8240('0x8')]('/api/sounds',require(_0x8240('0x7e')));_0x5bbbc5[_0x8240('0x8')]('/api/tags',require(_0x8240('0x7f')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x80'),require(_0x8240('0x81')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x82'),require(_0x8240('0x83')));_0x5bbbc5['use'](_0x8240('0x84'),require('./api/variable'));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x85'),require(_0x8240('0x86')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x87'),require(_0x8240('0x88')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x89'),require(_0x8240('0x8a')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x8b'),require(_0x8240('0x8c')));_0x5bbbc5['use'](_0x8240('0x8d'),require('./api/analyticExtractedReport'));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x8e'),require(_0x8240('0x8f')));_0x5bbbc5['use'](_0x8240('0x90'),require(_0x8240('0x91')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x92'),require('./api/analyticTreeReport'));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x93'),require(_0x8240('0x94')));_0x5bbbc5[_0x8240('0x8')]('/api/integrations/salesforce/configurations',require('./api/intSalesforceConfiguration'));_0x5bbbc5['use'](_0x8240('0x95'),require(_0x8240('0x96')));_0x5bbbc5['use'](_0x8240('0x97'),require('./api/intSugarcrmAccount'));_0x5bbbc5[_0x8240('0x8')]('/api/integrations/sugarcrm/configurations',require(_0x8240('0x98')));_0x5bbbc5['use'](_0x8240('0x99'),require('./api/intSugarcrmField'));_0x5bbbc5['use']('/api/integrations/desk/accounts',require('./api/intDeskAccount'));_0x5bbbc5['use'](_0x8240('0x9a'),require(_0x8240('0x9b')));_0x5bbbc5[_0x8240('0x8')]('/api/integrations/desk/fields',require('./api/intDeskField'));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x9c'),require(_0x8240('0x9d')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x9e'),require(_0x8240('0x9f')));_0x5bbbc5['use'](_0x8240('0xa0'),require(_0x8240('0xa1')));_0x5bbbc5['use'](_0x8240('0xa2'),require(_0x8240('0xa3')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0xa4'),require('./api/intZendeskConfiguration'));_0x5bbbc5[_0x8240('0x8')](_0x8240('0xa5'),require(_0x8240('0xa6')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0xa7'),require('./api/intFreshdeskAccount'));_0x5bbbc5['use'](_0x8240('0xa8'),require(_0x8240('0xa9')));_0x5bbbc5[_0x8240('0x8')]('/api/integrations/freshdesk/fields',require('./api/intFreshdeskField'));_0x5bbbc5[_0x8240('0x8')](_0x8240('0xaa'),require(_0x8240('0xab')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0xac'),require(_0x8240('0xad')));_0x5bbbc5[_0x8240('0x8')]('/api/integrations/vtiger/fields',require('./api/intVtigerField'));_0x5bbbc5['use'](_0x8240('0xae'),require(_0x8240('0xaf')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0xb0'),require(_0x8240('0xb1')));_0x5bbbc5['use']('/api/integrations/servicenow/fields',require('./api/intServicenowField'));_0x5bbbc5[_0x8240('0x8')]('/api/integrations/dynamics365/accounts',require(_0x8240('0xb2')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0xb3'),require(_0x8240('0xb4')));_0x5bbbc5['use'](_0x8240('0xb5'),require(_0x8240('0xb6')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0xb7'),require(_0x8240('0xb8')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0xb9'),require(_0x8240('0xba')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0xbb'),require('./api/intFreshsalesField'));_0x5bbbc5['use'](_0x8240('0xbc'),require('./api/network'));_0x5bbbc5[_0x8240('0x8')](_0x8240('0xbd'),require(_0x8240('0xbe')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0xbf'),require(_0x8240('0xc0')));_0x5bbbc5[_0x8240('0x8')]('/api/jscripty/answers/reports',require(_0x8240('0xc1')));_0x5bbbc5[_0x8240('0x8')]('/api/jscripty/questions/reports',require(_0x8240('0xc2')));_0x5bbbc5['use'](_0x8240('0xc3'),require(_0x8240('0xc4')));_0x5bbbc5[_0x8240('0x8')]('/api/sms/reports/queue',require(_0x8240('0xc5')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0xc6'),require(_0x8240('0xc7')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0xc8'),require('./api/squareReportDetail'));_0x5bbbc5[_0x8240('0x8')]('/api/jscripty/projects',require('./api/jscriptyProject'));_0x5bbbc5[_0x8240('0x8')](_0x8240('0xc9'),require(_0x8240('0xca')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0xcb'),require(_0x8240('0xcc')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0xcd'),require(_0x8240('0xce')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0xcf'),require(_0x8240('0xd0')));_0x5bbbc5[_0x8240('0x8')]('/api/square/messages',require(_0x8240('0xd1')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0xd2'),require('./api/team'));_0x5bbbc5['use'](_0x8240('0xd3'),require(_0x8240('0xd4')));_0x5bbbc5['use'](_0x8240('0xd5'),require('./api/campaign'));_0x5bbbc5[_0x8240('0x8')](_0x8240('0xd6'),require(_0x8240('0xd7')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0xd8'),require(_0x8240('0xd9')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0xda'),require('./api/plugin'));_0x5bbbc5['use'](_0x8240('0xdb'),require(_0x8240('0xdc')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0xdd'),require(_0x8240('0xde')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0xdf'),require(_0x8240('0xe0')));_0x5bbbc5[_0x8240('0x8')]('/api/openchannel/reports/transfer',require(_0x8240('0xe1')));_0x5bbbc5['use']('/api/sms/reports/transfer',require(_0x8240('0xe2')));_0x5bbbc5['use']('/api/cm/lists',require(_0x8240('0xe3')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0xe4'),require(_0x8240('0xe5')));_0x5bbbc5[_0x8240('0x8')]('/api/userProfiles',require(_0x8240('0xe6')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0xe7'),require(_0x8240('0xe8')));_0x5bbbc5[_0x8240('0x8')]('/api/userProfile/resources',require(_0x8240('0xe9')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0xea'),require(_0x8240('0xeb')));_0x5bbbc5[_0x8240('0x8')]('/api/whatsapp/accounts',require(_0x8240('0xec')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0xed'),require('./api/whatsappApplication'));_0x5bbbc5['use'](_0x8240('0xee'),require(_0x8240('0xef')));_0x5bbbc5[_0x8240('0x8')]('/api/whatsapp/messages',require('./api/whatsappMessage'));_0x5bbbc5[_0x8240('0x8')]('/api/whatsapp/reports/queue',require(_0x8240('0xf0')));_0x5bbbc5['use'](_0x8240('0xf1'),require(_0x8240('0xf2')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0xf3'),require(_0x8240('0xf4')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0xf5'),require('./api/cloudProvider'));_0x5bbbc5[_0x8240('0x8')]('/api/realtime',require(_0x8240('0xf6')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0xf7'),require(_0x8240('0xf8')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0xf9'),require(_0x8240('0xfa')));_0x5bbbc5['use'](_0x8240('0xfb'),require(_0x8240('0xfc')));_0x5bbbc5['use'](_0x8240('0xfd'),require(_0x8240('0xfe')));_0x5bbbc5[_0x8240('0x8')]('/api/version',require(_0x8240('0xff')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x100'),require(_0x8240('0x101')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x102'),require(_0x8240('0x103')));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x104'),require(_0x8240('0x105')));_0x5bbbc5['use'](_0x8240('0x106'),express[_0x8240('0x107')](path[_0x8240('0x108')](config[_0x8240('0x109')],_0x8240('0x106'))));_0x5bbbc5['use'](_0x8240('0x10a'),express['static'](path[_0x8240('0x108')](config[_0x8240('0x109')],_0x8240('0x10a'))));_0x5bbbc5[_0x8240('0x8')]('/demo',express['static'](path[_0x8240('0x108')](config[_0x8240('0x109')],_0x8240('0x10b'))));_0x5bbbc5['use'](_0x8240('0x10c'),express['static'](path['join'](config[_0x8240('0x109')],'snippet',_0x8240('0x10d'))));_0x5bbbc5[_0x8240('0x8')](_0x8240('0x10e'),express[_0x8240('0x107')](path[_0x8240('0x108')](config['root'],_0x8240('0x10f'))));_0x5bbbc5[_0x8240('0x110')](_0x8240('0x111'))[_0x8240('0x112')](errors[0x194]);_0x5bbbc5[_0x8240('0x110')]('/*')[_0x8240('0x112')](function(_0x847a7d,_0x53dc22){_0x53dc22[_0x8240('0x113')](path[_0x8240('0x114')](_0x5bbbc5[_0x8240('0x112')]('appPath')+_0x8240('0x115')));});};var sensitiveFields=['username','password',_0x8240('0x116'),_0x8240('0x117'),_0x8240('0x118'),_0x8240('0x119'),_0x8240('0x11a'),_0x8240('0x11b'),_0x8240('0x11c'),_0x8240('0x11d'),_0x8240('0x11e'),_0x8240('0x11f'),'clientSecret',_0x8240('0x120'),'code','accessKey',_0x8240('0x121'),_0x8240('0x122'),_0x8240('0x123'),'accessToken',_0x8240('0x124'),_0x8240('0x125'),_0x8240('0x126'),_0x8240('0x127'),'membername',_0x8240('0x128'),'calleridnum',_0x8240('0x129'),_0x8240('0x12a'),_0x8240('0x12b'),_0x8240('0x12c'),'accesskeyid',_0x8240('0x12d'),_0x8240('0x12e'),_0x8240('0x11'),_0x8240('0x12f'),'accountSid',_0x8240('0x130'),_0x8240('0x131'),'secret',_0x8240('0x132'),_0x8240('0x133')];function maskSensitiveData(_0x50e490){var _0x305d8b=/(?!^)[\s\S](?!$)/g;if(!_['isPlainObject'](_0x50e490))return;for(var _0x45ef00 in _0x50e490){if(_['isArray'](_0x50e490[_0x45ef00])){for(var _0x4ab105=0x0;_0x4ab105<_0x50e490[_0x45ef00][_0x8240('0x134')];_0x4ab105++){maskSensitiveData(_0x50e490[_0x45ef00][_0x4ab105]);}}else if(_[_0x8240('0x135')](_0x50e490[_0x45ef00])){maskSensitiveData(_0x50e490[_0x45ef00]);}else if(_[_0x8240('0x136')](_0x50e490[_0x45ef00])){_0x50e490[_0x45ef00]=_0x50e490[_0x45ef00][_0x8240('0x137')](/{{{/g,_0x8240('0x138'))[_0x8240('0x137')](/}}}/g,'}@@')[_0x8240('0x137')](/{{/g,'@{')[_0x8240('0x137')](/}}/g,'}@');if(_[_0x8240('0x139')](sensitiveFields,_0x45ef00)){_0x50e490[_0x45ef00]=_0x50e490[_0x45ef00][_0x8240('0x137')](_0x305d8b,'*');}}}} \ No newline at end of file +var _0x8079=['./api/intFreshdeskConfiguration','./api/intFreshdeskField','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','./api/squareReportDetail','/api/settings','./api/squareOdbc','/api/square/projects','./api/squareProject','./api/squareRecording','./api/squareMessage','/api/teams','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','./api/voicePrefix','/api/userProfiles','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','/api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','/api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/webbar','static','join','root','/apidoc','/www','/demo','/snippet','3.0.0','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','/index.html','password','firstName','lastName','street','phone','mobile','email','clientId','securityToken','accessKey','token','channelSecret','accessToken','accessTokenSecret','consumerSecret','membername','calleridname','calleridnum','vidaooApiKey','clientEmail','privateKey','secretaccesskey','key','pass','accountSid','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','lodash','express','express-winston','util','./config/logger','api','default','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','\x20body=%s','body','method','headers','x-forwarded-for','remoteAddress','url','responseTime','user','role','%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)','format','connection','statusCode','name','other','agent_id','agent_name','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','./api/voiceQueue','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','/api/mail/queues','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','./api/mailMessage','/api/mail/applications','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','./api/dashboardItem','./api/faxApplication','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','/api/chat/websites','./api/chatWebsite','/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/chatQueue','/api/chat/groups','./api/chatGroup','/api/cm/companies','./api/cmCompany','./api/cmContact','./api/cmHopper','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','/api/automations','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','./api/condition','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/triggers','./api/trigger','/api/variables','/api/integrations','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations'];(function(_0x328e00,_0x61ef39){var _0x5d6bec=function(_0x524666){while(--_0x524666){_0x328e00['push'](_0x328e00['shift']());}};_0x5d6bec(++_0x61ef39);}(_0x8079,0x1d1));var _0x9807=function(_0x296754,_0x5befe9){_0x296754=_0x296754-0x0;var _0x1d9f1d=_0x8079[_0x296754];return _0x1d9f1d;};'use strict';var _=require(_0x9807('0x0'));var path=require('path');var express=require(_0x9807('0x1'));var ewinston=require(_0x9807('0x2'));var util=require(_0x9807('0x3'));var errors=require('./errors');var config=require('./config/environment');var logger=require(_0x9807('0x4'))(_0x9807('0x5'));var authLogger=require(_0x9807('0x4'))('auth');exports[_0x9807('0x6')]=function(_0x4f02bd){_0x4f02bd[_0x9807('0x7')](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x483173,_0x399b17){var _0x295db4=_0x9807('0x8');if(!_['isEmpty'](_0x483173['body'])){_0x295db4+=_0x9807('0x9');var _0x368f32=_0x483173[_0x9807('0xa')];maskSensitiveData(_0x368f32);}return util['format'](_0x295db4,_0x483173[_0x9807('0xb')],_0x483173[_0x9807('0xc')][_0x9807('0xd')]?_0x483173['headers'][_0x9807('0xd')]:_0x483173['connection'][_0x9807('0xe')]||_0x483173['ip'],_0x483173[_0x9807('0xf')],_0x399b17['statusCode'],_0x399b17[_0x9807('0x10')],_0x483173['user']?_0x483173['user']['id']:null,_0x483173[_0x9807('0x11')]?_0x483173['user']['name']:null,_0x483173[_0x9807('0x11')]?_0x483173[_0x9807('0x11')][_0x9807('0x12')]:null,_0x368f32?util['inspect'](_0x368f32,![],null):'');}}));_0x4f02bd['use'](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x145288,_0x2e4d7a){var _0x898100=_0x9807('0x13');if(_0x145288[_0x9807('0xa')]&&_0x145288['body']['device']&&_0x145288[_0x9807('0xa')]['agent_id']){_0x898100=_0x9807('0x14');}return util[_0x9807('0x15')](_0x898100,_0x145288['method'],_0x145288['headers'][_0x9807('0xd')]?_0x145288[_0x9807('0xc')]['x-forwarded-for']:_0x145288[_0x9807('0x16')]['remoteAddress']||_0x145288['ip'],_0x145288[_0x9807('0xf')],_0x2e4d7a[_0x9807('0x17')],_0x2e4d7a[_0x9807('0x10')],_0x145288[_0x9807('0x11')]?_0x145288[_0x9807('0x11')]['id']:null,_0x145288[_0x9807('0x11')]?_0x145288['user'][_0x9807('0x18')]:null,_0x145288[_0x9807('0x11')]?_0x145288['user'][_0x9807('0x12')]:null,_0x145288[_0x9807('0xa')]&&_0x145288[_0x9807('0xa')]['device']?_0x145288[_0x9807('0xa')]['device']:_0x9807('0x19'),_0x145288['body']&&_0x145288[_0x9807('0xa')]['agent_id']?_0x145288[_0x9807('0xa')][_0x9807('0x1a')]:'',_0x145288[_0x9807('0xa')]&&_0x145288[_0x9807('0xa')]['agent_name']?_0x145288[_0x9807('0xa')][_0x9807('0x1b')]:'');},'ignoreRoute':function(_0x493eea){var _0x4cedab=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x4cedab['test'](_0x493eea[_0x9807('0xf')]);}}));_0x4f02bd[_0x9807('0x7')](_0x9807('0x1c'),require(_0x9807('0x1d')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x1e'),require(_0x9807('0x1f')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x20'),require(_0x9807('0x21')));_0x4f02bd[_0x9807('0x7')]('/api/voice/extensions',require(_0x9807('0x22')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x23'),require('./api/voiceMusicOnHold'));_0x4f02bd['use'](_0x9807('0x24'),require(_0x9807('0x25')));_0x4f02bd[_0x9807('0x7')]('/api/voice/recordings',require(_0x9807('0x26')));_0x4f02bd[_0x9807('0x7')]('/api/screen/recordings',require(_0x9807('0x27')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x28'),require(_0x9807('0x29')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x2a'),require(_0x9807('0x2b')));_0x4f02bd['use'](_0x9807('0x2c'),require(_0x9807('0x2d')));_0x4f02bd[_0x9807('0x7')]('/api/voice/dials/reports',require(_0x9807('0x2e')));_0x4f02bd['use'](_0x9807('0x2f'),require('./api/voiceAgentReport'));_0x4f02bd[_0x9807('0x7')](_0x9807('0x30'),require(_0x9807('0x31')));_0x4f02bd[_0x9807('0x7')]('/api/members/reports',require(_0x9807('0x32')));_0x4f02bd['use'](_0x9807('0x33'),require(_0x9807('0x34')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x35'),require('./api/voiceTransferReport'));_0x4f02bd[_0x9807('0x7')](_0x9807('0x36'),require(_0x9807('0x37')));_0x4f02bd[_0x9807('0x7')]('/api/mail/accounts',require(_0x9807('0x38')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x39'),require(_0x9807('0x3a')));_0x4f02bd[_0x9807('0x7')]('/api/mail/substatuses',require(_0x9807('0x3b')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x3c'),require('./api/mailInteraction'));_0x4f02bd['use']('/api/mail/messages',require(_0x9807('0x3d')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x3e'),require('./api/mailApplication'));_0x4f02bd[_0x9807('0x7')](_0x9807('0x3f'),require(_0x9807('0x40')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x41'),require('./api/dashboard'));_0x4f02bd[_0x9807('0x7')](_0x9807('0x42'),require(_0x9807('0x43')));_0x4f02bd['use']('/api/fax/accounts',require('./api/faxAccount'));_0x4f02bd['use']('/api/fax/applications',require(_0x9807('0x44')));_0x4f02bd[_0x9807('0x7')]('/api/fax/interactions',require('./api/faxInteraction'));_0x4f02bd[_0x9807('0x7')](_0x9807('0x45'),require(_0x9807('0x46')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x47'),require(_0x9807('0x48')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x49'),require(_0x9807('0x4a')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x4b'),require(_0x9807('0x4c')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x4d'),require(_0x9807('0x4e')));_0x4f02bd[_0x9807('0x7')]('/api/sms/interactions',require('./api/smsInteraction'));_0x4f02bd[_0x9807('0x7')](_0x9807('0x4f'),require(_0x9807('0x50')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x51'),require(_0x9807('0x52')));_0x4f02bd['use'](_0x9807('0x53'),require(_0x9807('0x54')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x55'),require('./api/openchannelApplication'));_0x4f02bd[_0x9807('0x7')](_0x9807('0x56'),require(_0x9807('0x57')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x58'),require(_0x9807('0x59')));_0x4f02bd['use'](_0x9807('0x5a'),require('./api/openchannelQueue'));_0x4f02bd[_0x9807('0x7')](_0x9807('0x5b'),require(_0x9807('0x5c')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x5d'),require(_0x9807('0x5e')));_0x4f02bd['use'](_0x9807('0x5f'),require(_0x9807('0x60')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x61'),require('./api/chatInteraction'));_0x4f02bd[_0x9807('0x7')](_0x9807('0x62'),require(_0x9807('0x63')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x64'),require(_0x9807('0x65')));_0x4f02bd[_0x9807('0x7')]('/api/chat/queues',require(_0x9807('0x66')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x67'),require(_0x9807('0x68')));_0x4f02bd[_0x9807('0x7')]('/api/chat/proactive_actions',require('./api/chatProactiveAction'));_0x4f02bd[_0x9807('0x7')](_0x9807('0x69'),require(_0x9807('0x6a')));_0x4f02bd[_0x9807('0x7')]('/api/cm/contacts',require(_0x9807('0x6b')));_0x4f02bd[_0x9807('0x7')]('/api/cm/hopper',require(_0x9807('0x6c')));_0x4f02bd[_0x9807('0x7')]('/api/cm/hopper_black',require('./api/cmHopperBlack'));_0x4f02bd[_0x9807('0x7')](_0x9807('0x6d'),require(_0x9807('0x6e')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x6f'),require(_0x9807('0x70')));_0x4f02bd['use'](_0x9807('0x71'),require('./api/cmCustomField'));_0x4f02bd[_0x9807('0x7')](_0x9807('0x72'),require('./api/action'));_0x4f02bd[_0x9807('0x7')](_0x9807('0x73'),require('./api/automation'));_0x4f02bd[_0x9807('0x7')](_0x9807('0x74'),require(_0x9807('0x75')));_0x4f02bd['use']('/api/dispositions',require(_0x9807('0x76')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x77'),require(_0x9807('0x78')));_0x4f02bd[_0x9807('0x7')]('/api/intervals',require('./api/interval'));_0x4f02bd[_0x9807('0x7')]('/api/pauses',require(_0x9807('0x79')));_0x4f02bd['use'](_0x9807('0x7a'),require(_0x9807('0x7b')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x7c'),require(_0x9807('0x7d')));_0x4f02bd['use'](_0x9807('0x7e'),require(_0x9807('0x7f')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x80'),require(_0x9807('0x81')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x82'),require(_0x9807('0x83')));_0x4f02bd[_0x9807('0x7')]('/api/templates',require('./api/template'));_0x4f02bd[_0x9807('0x7')](_0x9807('0x84'),require(_0x9807('0x85')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x86'),require('./api/variable'));_0x4f02bd[_0x9807('0x7')](_0x9807('0x87'),require('./api/integration'));_0x4f02bd[_0x9807('0x7')](_0x9807('0x88'),require(_0x9807('0x89')));_0x4f02bd['use'](_0x9807('0x8a'),require(_0x9807('0x8b')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x8c'),require(_0x9807('0x8d')));_0x4f02bd['use'](_0x9807('0x8e'),require(_0x9807('0x8f')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x90'),require(_0x9807('0x91')));_0x4f02bd['use'](_0x9807('0x92'),require(_0x9807('0x93')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x94'),require(_0x9807('0x95')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x96'),require('./api/intSalesforceAccount'));_0x4f02bd[_0x9807('0x7')](_0x9807('0x97'),require('./api/intSalesforceConfiguration'));_0x4f02bd['use'](_0x9807('0x98'),require(_0x9807('0x99')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x9a'),require('./api/intSugarcrmAccount'));_0x4f02bd['use']('/api/integrations/sugarcrm/configurations',require(_0x9807('0x9b')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x9c'),require(_0x9807('0x9d')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x9e'),require('./api/intDeskAccount'));_0x4f02bd['use'](_0x9807('0x9f'),require(_0x9807('0xa0')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xa1'),require('./api/intDeskField'));_0x4f02bd[_0x9807('0x7')](_0x9807('0xa2'),require(_0x9807('0xa3')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xa4'),require('./api/intZohoConfiguration'));_0x4f02bd['use'](_0x9807('0xa5'),require(_0x9807('0xa6')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xa7'),require(_0x9807('0xa8')));_0x4f02bd[_0x9807('0x7')]('/api/integrations/zendesk/configurations',require(_0x9807('0xa9')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xaa'),require('./api/intZendeskField'));_0x4f02bd['use'](_0x9807('0xab'),require('./api/intFreshdeskAccount'));_0x4f02bd['use'](_0x9807('0xac'),require(_0x9807('0xad')));_0x4f02bd['use']('/api/integrations/freshdesk/fields',require(_0x9807('0xae')));_0x4f02bd[_0x9807('0x7')]('/api/integrations/vtiger/accounts',require(_0x9807('0xaf')));_0x4f02bd[_0x9807('0x7')]('/api/integrations/vtiger/configurations',require(_0x9807('0xb0')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xb1'),require(_0x9807('0xb2')));_0x4f02bd['use'](_0x9807('0xb3'),require(_0x9807('0xb4')));_0x4f02bd['use'](_0x9807('0xb5'),require('./api/intServicenowConfiguration'));_0x4f02bd[_0x9807('0x7')](_0x9807('0xb6'),require('./api/intServicenowField'));_0x4f02bd[_0x9807('0x7')](_0x9807('0xb7'),require(_0x9807('0xb8')));_0x4f02bd['use']('/api/integrations/dynamics365/configurations',require(_0x9807('0xb9')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xba'),require(_0x9807('0xbb')));_0x4f02bd['use']('/api/integrations/freshsales/accounts',require('./api/intFreshsalesAccount'));_0x4f02bd['use'](_0x9807('0xbc'),require(_0x9807('0xbd')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xbe'),require(_0x9807('0xbf')));_0x4f02bd['use'](_0x9807('0xc0'),require(_0x9807('0xc1')));_0x4f02bd['use'](_0x9807('0xc2'),require(_0x9807('0xc3')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xc4'),require(_0x9807('0xc5')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xc6'),require('./api/jscriptyAnswerReport'));_0x4f02bd[_0x9807('0x7')](_0x9807('0xc7'),require('./api/jscriptyQuestionReport'));_0x4f02bd[_0x9807('0x7')](_0x9807('0xc8'),require(_0x9807('0xc9')));_0x4f02bd['use'](_0x9807('0xca'),require(_0x9807('0xcb')));_0x4f02bd['use'](_0x9807('0xcc'),require(_0x9807('0xcd')));_0x4f02bd[_0x9807('0x7')]('/api/square/details/reports',require(_0x9807('0xce')));_0x4f02bd[_0x9807('0x7')]('/api/jscripty/projects',require('./api/jscriptyProject'));_0x4f02bd[_0x9807('0x7')](_0x9807('0xcf'),require('./api/setting'));_0x4f02bd[_0x9807('0x7')]('/api/square/odbc',require(_0x9807('0xd0')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xd1'),require(_0x9807('0xd2')));_0x4f02bd[_0x9807('0x7')]('/api/square/recordings',require(_0x9807('0xd3')));_0x4f02bd[_0x9807('0x7')]('/api/square/messages',require(_0x9807('0xd4')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xd5'),require('./api/team'));_0x4f02bd[_0x9807('0x7')](_0x9807('0xd6'),require(_0x9807('0xd7')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xd8'),require(_0x9807('0xd9')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xda'),require(_0x9807('0xdb')));_0x4f02bd['use'](_0x9807('0xdc'),require('./api/attachment'));_0x4f02bd[_0x9807('0x7')]('/api/plugins',require(_0x9807('0xdd')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xde'),require(_0x9807('0xdf')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xe0'),require(_0x9807('0xe1')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xe2'),require(_0x9807('0xe3')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xe4'),require(_0x9807('0xe5')));_0x4f02bd['use'](_0x9807('0xe6'),require('./api/smsTransferReport'));_0x4f02bd[_0x9807('0x7')](_0x9807('0xe7'),require('./api/cmList'));_0x4f02bd[_0x9807('0x7')]('/api/voice/prefixes',require(_0x9807('0xe8')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xe9'),require(_0x9807('0xea')));_0x4f02bd['use']('/api/userProfile/sections',require(_0x9807('0xeb')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xec'),require(_0x9807('0xed')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xee'),require(_0x9807('0xef')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xf0'),require(_0x9807('0xf1')));_0x4f02bd['use']('/api/whatsapp/applications',require(_0x9807('0xf2')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xf3'),require(_0x9807('0xf4')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xf5'),require(_0x9807('0xf6')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xf7'),require(_0x9807('0xf8')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xf9'),require(_0x9807('0xfa')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xfb'),require('./api/whatsappQueue'));_0x4f02bd[_0x9807('0x7')](_0x9807('0xfc'),require(_0x9807('0xfd')));_0x4f02bd['use'](_0x9807('0xfe'),require('./api/realtime'));_0x4f02bd[_0x9807('0x7')](_0x9807('0xff'),require(_0x9807('0x100')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x101'),require('./api/authGoogle'));_0x4f02bd[_0x9807('0x7')](_0x9807('0x102'),require('./api/jira'));_0x4f02bd['use'](_0x9807('0x103'),require(_0x9807('0x104')));_0x4f02bd['use'](_0x9807('0x105'),require(_0x9807('0x106')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x107'),require(_0x9807('0x108')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x109'),require('./api/pm2'));_0x4f02bd[_0x9807('0x7')]('/api/webbar',require(_0x9807('0x10a')));_0x4f02bd[_0x9807('0x7')]('/apidoc',express[_0x9807('0x10b')](path[_0x9807('0x10c')](config[_0x9807('0x10d')],_0x9807('0x10e'))));_0x4f02bd[_0x9807('0x7')](_0x9807('0x10f'),express[_0x9807('0x10b')](path[_0x9807('0x10c')](config['root'],_0x9807('0x10f'))));_0x4f02bd['use']('/demo',express[_0x9807('0x10b')](path[_0x9807('0x10c')](config[_0x9807('0x10d')],_0x9807('0x110'))));_0x4f02bd[_0x9807('0x7')](_0x9807('0x111'),express[_0x9807('0x10b')](path[_0x9807('0x10c')](config[_0x9807('0x10d')],'snippet',_0x9807('0x112'))));_0x4f02bd[_0x9807('0x7')]('/plugins',express[_0x9807('0x10b')](path[_0x9807('0x10c')](config['root'],_0x9807('0x113'))));_0x4f02bd[_0x9807('0x114')](_0x9807('0x115'))[_0x9807('0x116')](errors[0x194]);_0x4f02bd[_0x9807('0x114')]('/*')[_0x9807('0x116')](function(_0x1bcf23,_0x2d7cf8){_0x2d7cf8['sendFile'](path[_0x9807('0x117')](_0x4f02bd[_0x9807('0x116')]('appPath')+_0x9807('0x118')));});};var sensitiveFields=['username',_0x9807('0x119'),'newPassword','apiKey',_0x9807('0x11a'),_0x9807('0x11b'),_0x9807('0x11c'),_0x9807('0x11d'),_0x9807('0x11e'),'fax',_0x9807('0x11f'),_0x9807('0x120'),'clientSecret',_0x9807('0x121'),'code',_0x9807('0x122'),'tenantId',_0x9807('0x123'),_0x9807('0x124'),_0x9807('0x125'),_0x9807('0x126'),'authToken','consumerKey',_0x9807('0x127'),_0x9807('0x128'),_0x9807('0x129'),_0x9807('0x12a'),'exten',_0x9807('0x12b'),_0x9807('0x12c'),_0x9807('0x12d'),'accesskeyid',_0x9807('0x12e'),_0x9807('0x12f'),'user',_0x9807('0x130'),_0x9807('0x131'),_0x9807('0x132'),_0x9807('0x133'),_0x9807('0x134'),_0x9807('0x135'),_0x9807('0x136')];function maskSensitiveData(_0x2ab757){var _0x168cc2=/(?!^)[\s\S](?!$)/g;if(!_[_0x9807('0x137')](_0x2ab757))return;for(var _0x1d9de7 in _0x2ab757){if(_[_0x9807('0x138')](_0x2ab757[_0x1d9de7])){for(var _0x4b2e75=0x0;_0x4b2e75<_0x2ab757[_0x1d9de7][_0x9807('0x139')];_0x4b2e75++){maskSensitiveData(_0x2ab757[_0x1d9de7][_0x4b2e75]);}}else if(_[_0x9807('0x137')](_0x2ab757[_0x1d9de7])){maskSensitiveData(_0x2ab757[_0x1d9de7]);}else if(_[_0x9807('0x13a')](_0x2ab757[_0x1d9de7])){_0x2ab757[_0x1d9de7]=_0x2ab757[_0x1d9de7][_0x9807('0x13b')](/{{{/g,_0x9807('0x13c'))[_0x9807('0x13b')](/}}}/g,_0x9807('0x13d'))[_0x9807('0x13b')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x9807('0x13e')](sensitiveFields,_0x1d9de7)){_0x2ab757[_0x1d9de7]=_0x2ab757[_0x1d9de7]['replace'](_0x168cc2,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 585b39c..1e1c044 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1bc1=['../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','rpc','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/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc'];(function(_0x235ae2,_0x3becb0){var _0x31fa64=function(_0x5d076e){while(--_0x5d076e){_0x235ae2['push'](_0x235ae2['shift']());}};_0x31fa64(++_0x3becb0);}(_0x1bc1,0xea));var _0x11bc=function(_0x5c07c0,_0x22ed9d){_0x5c07c0=_0x5c07c0-0x0;var _0x30e97f=_0x1bc1[_0x5c07c0];return _0x30e97f;};'use strict';var jayson=require(_0x11bc('0x0'));var BPromise=require(_0x11bc('0x1'));var _=require(_0x11bc('0x2'));var config=require(_0x11bc('0x3'));exports[_0x11bc('0x4')]=function(){return new BPromise(function(_0x4ceb25,_0xa44da3){var _0x3ccbe7={};_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x6')));_0x3ccbe7=_['merge'](_0x3ccbe7,require(_0x11bc('0x7')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x8')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x9')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0xa')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0xb')));_0x3ccbe7=_['merge'](_0x3ccbe7,require(_0x11bc('0xc')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x3ccbe7=_['merge'](_0x3ccbe7,require(_0x11bc('0xd')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require('../api/trunk/trunk.rpc'));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0xe')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0xf')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x10')));_0x3ccbe7=_['merge'](_0x3ccbe7,require('../api/mailAccount/mailAccount.rpc'));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x11')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x12')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require('../api/mailMessage/mailMessage.rpc'));_0x3ccbe7=_['merge'](_0x3ccbe7,require(_0x11bc('0x13')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x14')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x15')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x16')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x17')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require('../api/faxMessage/faxMessage.rpc'));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x18')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x19')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x1a')));_0x3ccbe7=_['merge'](_0x3ccbe7,require(_0x11bc('0x1b')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x1c')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x1d')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x1e')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x1f')));_0x3ccbe7=_['merge'](_0x3ccbe7,require(_0x11bc('0x20')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x21')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x22')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x23')));_0x3ccbe7=_['merge'](_0x3ccbe7,require(_0x11bc('0x24')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x25')));_0x3ccbe7=_['merge'](_0x3ccbe7,require('../api/cmContact/cmContact.rpc'));_0x3ccbe7=_['merge'](_0x3ccbe7,require(_0x11bc('0x26')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x27')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x28')));_0x3ccbe7=_['merge'](_0x3ccbe7,require(_0x11bc('0x29')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x2a')));_0x3ccbe7=_['merge'](_0x3ccbe7,require(_0x11bc('0x2b')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x2c')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x2d')));_0x3ccbe7=_['merge'](_0x3ccbe7,require(_0x11bc('0x2e')));_0x3ccbe7=_['merge'](_0x3ccbe7,require('../api/variable/variable.rpc'));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x2f')));_0x3ccbe7=_['merge'](_0x3ccbe7,require(_0x11bc('0x30')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x31')));_0x3ccbe7=_['merge'](_0x3ccbe7,require(_0x11bc('0x32')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x33')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x34')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x35')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x36')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x37')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x38')));_0x3ccbe7=_['merge'](_0x3ccbe7,require(_0x11bc('0x39')));_0x3ccbe7=_['merge'](_0x3ccbe7,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require('../api/squareReport/squareReport.rpc'));_0x3ccbe7=_['merge'](_0x3ccbe7,require(_0x11bc('0x3a')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x3b')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require('../api/squareOdbc/squareOdbc.rpc'));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x3c')));_0x3ccbe7=_['merge'](_0x3ccbe7,require(_0x11bc('0x3d')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x3e')));_0x3ccbe7=_['merge'](_0x3ccbe7,require(_0x11bc('0x3f')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x40')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x41')));_0x3ccbe7=_['merge'](_0x3ccbe7,require(_0x11bc('0x42')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x43')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x44')));_0x3ccbe7=_[_0x11bc('0x5')](_0x3ccbe7,require(_0x11bc('0x45')));_0x3ccbe7=_['merge'](_0x3ccbe7,require(_0x11bc('0x46')));var _0x4f7c1e=jayson['server'](_0x3ccbe7)[_0x11bc('0x47')]();var _0x5b3372=config[_0x11bc('0x48')]['port']||config[_0x11bc('0x49')]+0x1;var _0x1b963a=config[_0x11bc('0x48')]['ip']||_0x11bc('0x4a');_0x4f7c1e['on'](_0x11bc('0x4b'),function(_0x30a741){return _0xa44da3(_0x30a741);});_0x4f7c1e[_0x11bc('0x4')](_0x5b3372,_0x1b963a,function(){console[_0x11bc('0x4c')](_0x11bc('0x4d'),_0x1b963a,_0x5b3372);require(_0x11bc('0x4e'))[_0x11bc('0x4f')]();return _0x4ceb25(_0x11bc('0x50')+_0x1b963a+':'+_0x5b3372);});});}; \ No newline at end of file +var _0x3f58=['../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','jayson/promise','lodash','../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/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0x3f58,0x1f0));var _0x83f5=function(_0x57c481,_0x2661a2){_0x57c481=_0x57c481-0x0;var _0x475a13=_0x3f58[_0x57c481];return _0x475a13;};'use strict';var jayson=require(_0x83f5('0x0'));var BPromise=require('bluebird');var _=require(_0x83f5('0x1'));var config=require(_0x83f5('0x2'));exports[_0x83f5('0x3')]=function(){return new BPromise(function(_0xf9b596,_0x2cc256){var _0x598c14={};_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x5')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x6')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x7')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x8')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x9')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0xa')));_0x598c14=_['merge'](_0x598c14,require(_0x83f5('0xb')));_0x598c14=_['merge'](_0x598c14,require(_0x83f5('0xc')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0xd')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require('../api/trunk/trunk.rpc'));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0xe')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0xf')));_0x598c14=_['merge'](_0x598c14,require(_0x83f5('0x10')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require('../api/mailAccount/mailAccount.rpc'));_0x598c14=_['merge'](_0x598c14,require(_0x83f5('0x11')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require('../api/mailInteraction/mailInteraction.rpc'));_0x598c14=_['merge'](_0x598c14,require('../api/mailMessage/mailMessage.rpc'));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x12')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x13')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x14')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x15')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require('../api/faxInteraction/faxInteraction.rpc'));_0x598c14=_['merge'](_0x598c14,require(_0x83f5('0x16')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x17')));_0x598c14=_['merge'](_0x598c14,require(_0x83f5('0x18')));_0x598c14=_['merge'](_0x598c14,require('../api/smsAccount/smsAccount.rpc'));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x19')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x1a')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x1b')));_0x598c14=_['merge'](_0x598c14,require(_0x83f5('0x1c')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x1d')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x1e')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x1f')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x20')));_0x598c14=_['merge'](_0x598c14,require('../api/chatQueue/chatQueue.rpc'));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require('../api/cmContact/cmContact.rpc'));_0x598c14=_['merge'](_0x598c14,require(_0x83f5('0x21')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x22')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x23')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x24')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x25')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x26')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x27')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x28')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x29')));_0x598c14=_['merge'](_0x598c14,require(_0x83f5('0x2a')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x2b')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x598c14=_['merge'](_0x598c14,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x598c14=_['merge'](_0x598c14,require(_0x83f5('0x2c')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x2d')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x2e')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x2f')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x30')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x31')));_0x598c14=_['merge'](_0x598c14,require(_0x83f5('0x32')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x33')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x34')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x35')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x36')));_0x598c14=_['merge'](_0x598c14,require(_0x83f5('0x37')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x38')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x39')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x3a')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x3b')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x3c')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require('../api/attachment/attachment.rpc'));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x3d')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x3e')));_0x598c14=_['merge'](_0x598c14,require(_0x83f5('0x3f')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x40')));_0x598c14=_['merge'](_0x598c14,require(_0x83f5('0x41')));var _0xf7cdad=jayson[_0x83f5('0x42')](_0x598c14)[_0x83f5('0x43')]();var _0x276141=config[_0x83f5('0x44')]['port']||config[_0x83f5('0x45')]+0x1;var _0x1ce35b=config[_0x83f5('0x44')]['ip']||_0x83f5('0x46');_0xf7cdad['on'](_0x83f5('0x47'),function(_0x4e7e9b){return _0x2cc256(_0x4e7e9b);});_0xf7cdad[_0x83f5('0x3')](_0x276141,_0x1ce35b,function(){console[_0x83f5('0x48')](_0x83f5('0x49'),_0x1ce35b,_0x276141);require(_0x83f5('0x4a'))[_0x83f5('0x4b')]();return _0xf9b596('RPC\x20listening\x20on\x20'+_0x1ce35b+':'+_0x276141);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 6caa49b..4cfd3de 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 _0x3396=['label','util','lodash','EventEmitter','./reply','call','setEncoding','utf8','setTimeout','headers','emit','toLowerCase','substring','520-Invalid','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','substr','startsWith','split','length','match','error','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','sendRequest','sync','prototype','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','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','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','sayDigits','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','noop'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x3396,0x17d));var _0x6339=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3396[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x6339('0x0'));var _=require(_0x6339('0x1'));var EventEmitter=require('events')[_0x6339('0x2')];var AGIReply=require(_0x6339('0x3'));var AGIError=require('./error');function AGIChannel(_0x2b59a6){var _0x3e5a53=this,_0x2cca4f=new AGIReply(),_0x26d847=![],_0x26ff49={};EventEmitter[_0x6339('0x4')](_0x3e5a53);_0x2b59a6[_0x6339('0x5')](_0x6339('0x6'));_0x2b59a6[_0x6339('0x7')](0x8*0x3c*0x3c*0x3e8);_0x2cca4f['setEncoding'](_0x6339('0x6'));_0x2cca4f['on'](_0x6339('0x8'),function(_0x1b009c){for(var _0xda783 in _0x1b009c){_0x3e5a53[_0xda783]=_0x1b009c[_0xda783];}_0x3e5a53[_0x6339('0x9')]('ready');});_0x2cca4f['on']('line',function(_0x88de32){if(_0x88de32[_0x6339('0xa')]()=='hangup'){_0x3e5a53[_0x6339('0x9')]('hangup');return;}if(_0x88de32[_0x6339('0xb')](0x0,0xb)==_0x6339('0xc')){_0x26d847=!![];}if(_0x26d847){_0x26ff49['rx']+=_0x88de32+'\x0a';if(_0x88de32['search'](_0x6339('0xd'))!=-0x1){_0x26d847=![];}}else{_0x26ff49['rx']=_0x88de32;}if(_0x26d847){return;}if(typeof _0x26ff49['cb']==_0x6339('0xe')){var _0x5f2197=_0x26ff49['rx'][_0x6339('0xb')](0x0,0x3),_0x26c651=null,_0x1f3c82=null;_0x5f2197=parseInt(_0x5f2197);if(isNaN(_0x5f2197)){_0x26ff49['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x6339('0xf')});return;}if(_0x5f2197!=0xc8){_0x26ff49['cb'](null,{'code':_0x5f2197,'result':-0x1,'extra':'KO'});return;}_0x26c651=_0x26ff49['rx'][_0x6339('0xb')](0x4)[_0x6339('0x10')](_0x6339('0x11'),'');if(_0x26c651['indexOf']('\x20')!=-0x1){_0x26c651=_0x26c651[_0x6339('0x12')](0x0,_0x26c651['indexOf']('\x20'));}if(_[_0x6339('0x13')](_0x26c651,'-1')){_0x26c651=parseInt(_0x26c651);}_0x1f3c82=_0x26ff49['rx'][_0x6339('0x14')]('\x20');if(_0x1f3c82['length']==0x3){_0x1f3c82=_0x1f3c82[0x2]['substring'](0x1,_0x1f3c82[0x2][_0x6339('0x15')]-0x1);}else if(_0x1f3c82[_0x6339('0x15')]>0x3){var _0x3638a8=/\((.+)\)/;var _0x3fb4ae=_0x26ff49['rx'][_0x6339('0x16')](_0x3638a8);if(_0x3fb4ae){_0x1f3c82=_0x3fb4ae[0x1];}else{_0x1f3c82=null;}}else{_0x1f3c82=null;}_0x26ff49['cb'](null,{'code':_0x5f2197,'result':_0x26c651,'extra':_0x1f3c82});}});_0x2b59a6['on']('error',function(_0x373ba2){_0x3e5a53[_0x6339('0x9')](_0x6339('0x17'),new AGIError('E_AGI_SOCKET_ERROR',_0x373ba2['code']));});_0x2b59a6['on']('close',function(){_0x3e5a53[_0x6339('0x9')](_0x6339('0x18'),new AGIError(_0x6339('0x19')));});_0x2b59a6['on']('timeout',function(){_0x3e5a53[_0x6339('0x9')](_0x6339('0x1a'),new AGIError(_0x6339('0x1b')));_0x2b59a6[_0x6339('0x1c')]();});_0x2b59a6[_0x6339('0x1d')](_0x2cca4f);this[_0x6339('0x1e')]=function(_0x49303b,_0x96e14){var _0x49303b=_0x49303b||'',_0x96e14=typeof _0x96e14==_0x6339('0xe')?_0x96e14:new Function();_0x26ff49={'tx':_0x49303b,'rx':'','cb':_0x96e14};_0x2b59a6[_0x6339('0x1f')](_0x49303b+'\x0a');},this[_0x6339('0x18')]=function(){_0x2b59a6[_0x6339('0x1c')]();};}util[_0x6339('0x20')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x6339('0x21')]=function(_0x4e1244){return this[_0x6339('0x1e')][_0x6339('0x22')](this,_0x4e1244);};AGIChannel[_0x6339('0x23')]['answer']=function(){return this[_0x6339('0x21')](_0x6339('0x24'));};AGIChannel[_0x6339('0x23')][_0x6339('0x25')]=function(_0x550ac8,_0x18fc39,_0x17469f){_0x550ac8=_0x550ac8===undefined?_0x6339('0x26'):_0x550ac8;_0x18fc39=_0x18fc39===undefined?'5':_0x18fc39;_0x17469f=_0x17469f===undefined?'1':_0x17469f;return this[_0x6339('0x21')](util[_0x6339('0x27')](_0x6339('0x28'),_0x550ac8,_0x18fc39*0x3e8,_0x17469f));};AGIChannel[_0x6339('0x23')]['noop']=function(_0x474a51){_0x474a51=_0x474a51||_0x6339('0x29');return this[_0x6339('0x21')](util[_0x6339('0x27')]('VERBOSE\x20\x22%s\x22',_0x474a51));};AGIChannel[_0x6339('0x23')][_0x6339('0x2a')]=function(_0xf7ca1d,_0x344630){if(_[_0x6339('0x2b')](_0x344630)){return this[_0x6339('0x21')](util['format'](_0x6339('0x2c'),_0xf7ca1d,_0x344630[_0x6339('0x2d')](',')));}return this['sendRequest'](util[_0x6339('0x27')](_0x6339('0x2c'),_0xf7ca1d,_0x344630));};AGIChannel[_0x6339('0x23')][_0x6339('0x2e')]=function(_0x25aae8){return this[_0x6339('0x21')](util['format'](_0x6339('0x2f'),_0x25aae8));};AGIChannel[_0x6339('0x23')][_0x6339('0x30')]=function(_0x4a9781){return this[_0x6339('0x21')](util[_0x6339('0x27')](_0x6339('0x31'),_0x4a9781));};AGIChannel[_0x6339('0x23')][_0x6339('0x32')]=function(_0xb12b26){return this[_0x6339('0x21')](util[_0x6339('0x27')](_0x6339('0x33'),_0xb12b26));};AGIChannel['prototype'][_0x6339('0x34')]=function(){return this[_0x6339('0x21')]('HANGUP');};AGIChannel[_0x6339('0x23')][_0x6339('0x35')]=function(_0x4bc94e,_0x345010){var _0x331480=_[_0x6339('0x36')](_0x345010)||_[_0x6339('0x37')](_0x345010)?_0x345010[_0x6339('0x38')]():_0x345010;return this[_0x6339('0x21')](util[_0x6339('0x27')](_0x6339('0x39'),_0x4bc94e,_0x331480?_0x331480['toString']()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x6339('0x23')][_0x6339('0x3a')]=function(_0x37bf40,_0x350dfc){return this['sendRequest'](util['format']('SAY\x20NUMBER\x20%s\x20%s',_0x37bf40,_0x350dfc));};AGIChannel[_0x6339('0x23')][_0x6339('0x3b')]=function(_0x2fcddb,_0x34e26a){return this['sendRequest'](util[_0x6339('0x27')](_0x6339('0x3c'),_0x2fcddb,_0x34e26a));};AGIChannel[_0x6339('0x23')]['sayPhonetic']=function(_0x32a657,_0x4110e2){return this[_0x6339('0x21')](util[_0x6339('0x27')](_0x6339('0x3d'),_0x32a657,_0x4110e2));};AGIChannel[_0x6339('0x23')]['continueAt']=function(_0x3cc1fd,_0x3d1979,_0x394e76){_0x3d1979=_0x3d1979||this[_0x6339('0x3e')];_0x394e76=_0x394e76||0x1;this['setContext'](_0x3cc1fd);this[_0x6339('0x30')](_0x3d1979);this[_0x6339('0x32')](_0x394e76);return this['noop'](util[_0x6339('0x27')](_0x6339('0x3f'),_0x3cc1fd,_0x3d1979,_0x394e76));};AGIChannel[_0x6339('0x23')][_0x6339('0x40')]=function(_0x3ea5da){return this[_0x6339('0x21')](util[_0x6339('0x27')](_0x6339('0x41'),_0x3ea5da));};AGIChannel['prototype'][_0x6339('0x42')]=function(_0x461783,_0xfd9fb9,_0x1ac651,_0x4d0306,_0x299a7f,_0x2a2e7a){_0xfd9fb9=_0xfd9fb9||_0x6339('0x43');_0x1ac651=_0x1ac651||'';_0x4d0306=_0x4d0306===undefined?-0x1:_0x4d0306==='-1'?-0x1:_0x4d0306*0x3e8;_0x299a7f=_0x299a7f===undefined?'':'s='+_0x299a7f;_0x2a2e7a=_0x2a2e7a?_0x6339('0x44'):'';return this[_0x6339('0x21')](util[_0x6339('0x27')](_0x6339('0x45'),_0x461783,_0xfd9fb9,_0x1ac651,_0x4d0306,_0x2a2e7a,_0x299a7f));};AGIChannel[_0x6339('0x23')]['streamFile']=function(_0x529535,_0x252dad){_0x252dad=_0x252dad||'';return this[_0x6339('0x21')](util['format'](_0x6339('0x46'),_0x529535,_0x252dad));};AGIChannel[_0x6339('0x23')][_0x6339('0x47')]=function(_0x14b25b){return this['exec'](_0x6339('0x48'),_0x14b25b);};AGIChannel['prototype'][_0x6339('0x49')]=function(_0x42de05){return this[_0x6339('0x2a')]('WAIT',_0x42de05);};AGIChannel['prototype'][_0x6339('0x17')]=function(_0x2d94e6,_0x496aff){this[_0x6339('0x4a')](util[_0x6339('0x27')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x2d94e6['id'],_0x2d94e6[_0x6339('0x4b')],_0x496aff));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file +var _0xd706=['code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','command','write','destroy','inherits','prototype','sync','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','sendRequest','VERBOSE\x20\x22%s\x22','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setPriority','SET\x20PRIORITY\x20%s','setVariable','isNumber','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','setExtension','GOTO\x20%s\x20%s\x20%s','getVariable','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','exec','AGI','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','./reply','call','setEncoding','utf8','setTimeout','headers','hangup','emit','substring','520-Invalid','search','function','no\x20code','replace','indexOf','startsWith','split','length','error','E_AGI_SOCKET_ERROR'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd706,0x115));var _0x6d70=function(_0x1bdc19,_0x406dd3){_0x1bdc19=_0x1bdc19-0x0;var _0x23f947=_0xd706[_0x1bdc19];return _0x23f947;};'use strict';var util=require(_0x6d70('0x0'));var _=require(_0x6d70('0x1'));var EventEmitter=require(_0x6d70('0x2'))['EventEmitter'];var AGIReply=require(_0x6d70('0x3'));var AGIError=require('./error');function AGIChannel(_0x1fdbec){var _0x512beb=this,_0x4a6af3=new AGIReply(),_0x333383=![],_0x24a4a9={};EventEmitter[_0x6d70('0x4')](_0x512beb);_0x1fdbec[_0x6d70('0x5')](_0x6d70('0x6'));_0x1fdbec[_0x6d70('0x7')](0x8*0x3c*0x3c*0x3e8);_0x4a6af3[_0x6d70('0x5')](_0x6d70('0x6'));_0x4a6af3['on'](_0x6d70('0x8'),function(_0x408b54){for(var _0x385eec in _0x408b54){_0x512beb[_0x385eec]=_0x408b54[_0x385eec];}_0x512beb['emit']('ready');});_0x4a6af3['on']('line',function(_0x1bcbdd){if(_0x1bcbdd['toLowerCase']()==_0x6d70('0x9')){_0x512beb[_0x6d70('0xa')](_0x6d70('0x9'));return;}if(_0x1bcbdd[_0x6d70('0xb')](0x0,0xb)==_0x6d70('0xc')){_0x333383=!![];}if(_0x333383){_0x24a4a9['rx']+=_0x1bcbdd+'\x0a';if(_0x1bcbdd[_0x6d70('0xd')]('520\x20End\x20of\x20proper')!=-0x1){_0x333383=![];}}else{_0x24a4a9['rx']=_0x1bcbdd;}if(_0x333383){return;}if(typeof _0x24a4a9['cb']==_0x6d70('0xe')){var _0xdbc562=_0x24a4a9['rx'][_0x6d70('0xb')](0x0,0x3),_0x2f93be=null,_0x2d75a8=null;_0xdbc562=parseInt(_0xdbc562);if(isNaN(_0xdbc562)){_0x24a4a9['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x6d70('0xf')});return;}if(_0xdbc562!=0xc8){_0x24a4a9['cb'](null,{'code':_0xdbc562,'result':-0x1,'extra':'KO'});return;}_0x2f93be=_0x24a4a9['rx'][_0x6d70('0xb')](0x4)[_0x6d70('0x10')]('result=','');if(_0x2f93be[_0x6d70('0x11')]('\x20')!=-0x1){_0x2f93be=_0x2f93be['substr'](0x0,_0x2f93be[_0x6d70('0x11')]('\x20'));}if(_[_0x6d70('0x12')](_0x2f93be,'-1')){_0x2f93be=parseInt(_0x2f93be);}_0x2d75a8=_0x24a4a9['rx'][_0x6d70('0x13')]('\x20');if(_0x2d75a8[_0x6d70('0x14')]==0x3){_0x2d75a8=_0x2d75a8[0x2][_0x6d70('0xb')](0x1,_0x2d75a8[0x2][_0x6d70('0x14')]-0x1);}else if(_0x2d75a8[_0x6d70('0x14')]>0x3){var _0x1d1799=/\((.+)\)/;var _0x2c24ef=_0x24a4a9['rx']['match'](_0x1d1799);if(_0x2c24ef){_0x2d75a8=_0x2c24ef[0x1];}else{_0x2d75a8=null;}}else{_0x2d75a8=null;}_0x24a4a9['cb'](null,{'code':_0xdbc562,'result':_0x2f93be,'extra':_0x2d75a8});}});_0x1fdbec['on']('error',function(_0x2a1e1a){_0x512beb['emit'](_0x6d70('0x15'),new AGIError(_0x6d70('0x16'),_0x2a1e1a[_0x6d70('0x17')]));});_0x1fdbec['on'](_0x6d70('0x18'),function(){_0x512beb[_0x6d70('0xa')]('close',new AGIError(_0x6d70('0x19')));});_0x1fdbec['on'](_0x6d70('0x1a'),function(){_0x512beb['emit'](_0x6d70('0x1a'),new AGIError(_0x6d70('0x1b')));_0x1fdbec['destroy']();});_0x1fdbec['pipe'](_0x4a6af3);this[_0x6d70('0x1c')]=function(_0x173850,_0x20c5e1){var _0x173850=_0x173850||'',_0x20c5e1=typeof _0x20c5e1==_0x6d70('0xe')?_0x20c5e1:new Function();_0x24a4a9={'tx':_0x173850,'rx':'','cb':_0x20c5e1};_0x1fdbec[_0x6d70('0x1d')](_0x173850+'\x0a');},this[_0x6d70('0x18')]=function(){_0x1fdbec[_0x6d70('0x1e')]();};}util[_0x6d70('0x1f')](AGIChannel,EventEmitter);AGIChannel[_0x6d70('0x20')]['sendRequest']=function(_0x367e5c){return this[_0x6d70('0x1c')][_0x6d70('0x21')](this,_0x367e5c);};AGIChannel['prototype']['answer']=function(){return this['sendRequest'](_0x6d70('0x22'));};AGIChannel[_0x6d70('0x20')][_0x6d70('0x23')]=function(_0x14efc0,_0x1b2993,_0x483a84){_0x14efc0=_0x14efc0===undefined?_0x6d70('0x24'):_0x14efc0;_0x1b2993=_0x1b2993===undefined?'5':_0x1b2993;_0x483a84=_0x483a84===undefined?'1':_0x483a84;return this['sendRequest'](util[_0x6d70('0x25')](_0x6d70('0x26'),_0x14efc0,_0x1b2993*0x3e8,_0x483a84));};AGIChannel[_0x6d70('0x20')][_0x6d70('0x27')]=function(_0x30d12e){_0x30d12e=_0x30d12e||_0x6d70('0x28');return this[_0x6d70('0x29')](util['format'](_0x6d70('0x2a'),_0x30d12e));};AGIChannel[_0x6d70('0x20')]['exec']=function(_0x311fc3,_0x5d0022){if(_[_0x6d70('0x2b')](_0x5d0022)){return this[_0x6d70('0x29')](util[_0x6d70('0x25')](_0x6d70('0x2c'),_0x311fc3,_0x5d0022['join'](',')));}return this['sendRequest'](util[_0x6d70('0x25')](_0x6d70('0x2c'),_0x311fc3,_0x5d0022));};AGIChannel[_0x6d70('0x20')][_0x6d70('0x2d')]=function(_0x3afde8){return this['sendRequest'](util[_0x6d70('0x25')](_0x6d70('0x2e'),_0x3afde8));};AGIChannel['prototype']['setExtension']=function(_0x21ee66){return this[_0x6d70('0x29')](util[_0x6d70('0x25')]('SET\x20EXTENSION\x20%s',_0x21ee66));};AGIChannel[_0x6d70('0x20')][_0x6d70('0x2f')]=function(_0x1fd867){return this[_0x6d70('0x29')](util[_0x6d70('0x25')](_0x6d70('0x30'),_0x1fd867));};AGIChannel[_0x6d70('0x20')][_0x6d70('0x9')]=function(){return this[_0x6d70('0x29')]('HANGUP');};AGIChannel['prototype'][_0x6d70('0x31')]=function(_0x3d1a19,_0x5c9c8f){var _0x11398a=_['isBoolean'](_0x5c9c8f)||_[_0x6d70('0x32')](_0x5c9c8f)?_0x5c9c8f[_0x6d70('0x33')]():_0x5c9c8f;return this[_0x6d70('0x29')](util['format']('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x3d1a19,_0x11398a?_0x11398a[_0x6d70('0x33')]()[_0x6d70('0x10')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x6d70('0x20')][_0x6d70('0x34')]=function(_0x479520,_0x4e5f0c){return this['sendRequest'](util[_0x6d70('0x25')](_0x6d70('0x35'),_0x479520,_0x4e5f0c));};AGIChannel[_0x6d70('0x20')][_0x6d70('0x36')]=function(_0x5c3e71,_0x1b1434){return this[_0x6d70('0x29')](util[_0x6d70('0x25')](_0x6d70('0x37'),_0x5c3e71,_0x1b1434));};AGIChannel[_0x6d70('0x20')][_0x6d70('0x38')]=function(_0x21cc53,_0x260f32){return this['sendRequest'](util['format'](_0x6d70('0x39'),_0x21cc53,_0x260f32));};AGIChannel[_0x6d70('0x20')][_0x6d70('0x3a')]=function(_0x370e74,_0x3d7c96,_0x509971){_0x3d7c96=_0x3d7c96||this['extension'];_0x509971=_0x509971||0x1;this[_0x6d70('0x2d')](_0x370e74);this[_0x6d70('0x3b')](_0x3d7c96);this[_0x6d70('0x2f')](_0x509971);return this[_0x6d70('0x27')](util[_0x6d70('0x25')](_0x6d70('0x3c'),_0x370e74,_0x3d7c96,_0x509971));};AGIChannel[_0x6d70('0x20')][_0x6d70('0x3d')]=function(_0x7b69f6){return this[_0x6d70('0x29')](util[_0x6d70('0x25')]('GET\x20VARIABLE\x20\x22%s\x22',_0x7b69f6));};AGIChannel[_0x6d70('0x20')][_0x6d70('0x3e')]=function(_0x53da8f,_0x399c9d,_0xf1b3af,_0xa64566,_0x5c18d4,_0x4fe084){_0x399c9d=_0x399c9d||_0x6d70('0x3f');_0xf1b3af=_0xf1b3af||'';_0xa64566=_0xa64566===undefined?-0x1:_0xa64566==='-1'?-0x1:_0xa64566*0x3e8;_0x5c18d4=_0x5c18d4===undefined?'':'s='+_0x5c18d4;_0x4fe084=_0x4fe084?_0x6d70('0x40'):'';return this[_0x6d70('0x29')](util[_0x6d70('0x25')](_0x6d70('0x41'),_0x53da8f,_0x399c9d,_0xf1b3af,_0xa64566,_0x4fe084,_0x5c18d4));};AGIChannel[_0x6d70('0x20')][_0x6d70('0x42')]=function(_0x54c978,_0xd52e03){_0xd52e03=_0xd52e03||'';return this[_0x6d70('0x29')](util[_0x6d70('0x25')](_0x6d70('0x43'),_0x54c978,_0xd52e03));};AGIChannel[_0x6d70('0x20')][_0x6d70('0x44')]=function(_0x3e7620){return this[_0x6d70('0x45')](_0x6d70('0x46'),_0x3e7620);};AGIChannel[_0x6d70('0x20')]['wait']=function(_0x39a658){return this[_0x6d70('0x45')](_0x6d70('0x47'),_0x39a658);};AGIChannel[_0x6d70('0x20')][_0x6d70('0x15')]=function(_0x8f7aaf,_0x2c9c78){this[_0x6d70('0x27')](util[_0x6d70('0x25')](_0x6d70('0x48'),_0x8f7aaf['id'],_0x8f7aaf[_0x6d70('0x49')],_0x2c9c78));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x6d70('0x4a')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 02231de..bcaafe2 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 _0xe10f=['Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','apply','message','exports','util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0xe10f,0xd8));var _0xfe10=function(_0x2e9c58,_0x223c43){_0x2e9c58=_0x2e9c58-0x0;var _0x2ddbc0=_0xe10f[_0x2e9c58];return _0x2ddbc0;};'use strict';var util=require(_0xfe10('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0xfe10('0x1'),'E_AGI_SERVER_ERROR':_0xfe10('0x2'),'E_AGI_SERVER_CLOSE':_0xfe10('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0xfe10('0x4'),'E_AGI_SOCKET_ERROR':_0xfe10('0x5'),'E_AGI_SOCKET_CLOSE':_0xfe10('0x6'),'E_AGI_SOCKET_TIMEOUT':_0xfe10('0x7'),'E_AGI_COMMAND_EMPTY':_0xfe10('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xfe10('0x9'),'E_AGI_IVR_ENTRY':_0xfe10('0xa')};function AGIError(_0x3a5652){var _0x3a5652=_0x3a5652||null,_0x5c417b=_0x5c417b||[],_0x286365=0x1,_0x189ba0='';if(!error[_0x3a5652]){_0x3a5652='E_AGI_UNDEFINED';}_0x5c417b['push'](error[_0x3a5652]);while(arguments[_0x286365]){_0x5c417b[_0xfe10('0xb')](arguments[_0x286365]);_0x286365++;}_0x189ba0=util[_0xfe10('0xc')][_0xfe10('0xd')](util,_0x5c417b);this[_0xfe10('0xe')]=_0x189ba0;this['name']=_0x3a5652;}module[_0xfe10('0xf')]=AGIError; \ No newline at end of file +var _0xdf18=['util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message','exports'];(function(_0x5a6949,_0x428667){var _0x523b4d=function(_0x31e02a){while(--_0x31e02a){_0x5a6949['push'](_0x5a6949['shift']());}};_0x523b4d(++_0x428667);}(_0xdf18,0xc3));var _0x8df1=function(_0x2c4ef4,_0x21ffd7){_0x2c4ef4=_0x2c4ef4-0x0;var _0xb5b9f0=_0xdf18[_0x2c4ef4];return _0xb5b9f0;};'use strict';var util=require(_0x8df1('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0x8df1('0x1'),'E_AGI_SERVER_ERROR':_0x8df1('0x2'),'E_AGI_SERVER_CLOSE':_0x8df1('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x8df1('0x4'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x8df1('0x5'),'E_AGI_SOCKET_TIMEOUT':_0x8df1('0x6'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x8df1('0x7'),'E_AGI_IVR_ENTRY':_0x8df1('0x8')};function AGIError(_0x4729bf){var _0x4729bf=_0x4729bf||null,_0x3e6035=_0x3e6035||[],_0x22bff1=0x1,_0x235dae='';if(!error[_0x4729bf]){_0x4729bf=_0x8df1('0x9');}_0x3e6035[_0x8df1('0xa')](error[_0x4729bf]);while(arguments[_0x22bff1]){_0x3e6035[_0x8df1('0xa')](arguments[_0x22bff1]);_0x22bff1++;}_0x235dae=util[_0x8df1('0xb')][_0x8df1('0xc')](util,_0x3e6035);this[_0x8df1('0xd')]=_0x235dae;this['name']=_0x4729bf;}module[_0x8df1('0xe')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index b4592b0..b6080a7 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 _0xb2ab=['max\x20retry\x20reach','exports','lodash','../../../config/logger','agi','menu','getdigits','getsecretdigits','edges','numberOfEdges','prototype','vertices','addEdge','push','size','getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','default','invalid'];(function(_0x1f16de,_0x548eb9){var _0x36cd80=function(_0x4e1a45){while(--_0x4e1a45){_0x1f16de['push'](_0x1f16de['shift']());}};_0x36cd80(++_0x548eb9);}(_0xb2ab,0x8e));var _0xbb2a=function(_0x1c19c9,_0x584c49){_0x1c19c9=_0x1c19c9-0x0;var _0x42bd44=_0xb2ab[_0x1c19c9];return _0x42bd44;};'use strict';var _=require(_0xbb2a('0x0'));var logger=require(_0xbb2a('0x1'))(_0xbb2a('0x2'));var verticesWithRetry=[_0xbb2a('0x3'),_0xbb2a('0x4'),_0xbb2a('0x5')];var Graph=function(){this['vertices']={};this[_0xbb2a('0x6')]={};this[_0xbb2a('0x7')]=0x0;};Graph[_0xbb2a('0x8')]['addVertex']=function(_0x37ca5b){this[_0xbb2a('0x9')][_0x37ca5b['id']]=_0x37ca5b;this[_0xbb2a('0x6')][_0x37ca5b['id']]=[];};Graph[_0xbb2a('0x8')][_0xbb2a('0xa')]=function(_0x473506,_0x241f8c,_0x52b4ac){this[_0xbb2a('0x6')][_0x473506][_0xbb2a('0xb')]({'target':_0x241f8c,'condition':_0x52b4ac});this['numberOfEdges']+=0x1;};Graph['prototype'][_0xbb2a('0xc')]=function(){return _[_0xbb2a('0xc')](this[_0xbb2a('0x9')]);};Graph[_0xbb2a('0x8')]['relations']=function(){return this[_0xbb2a('0x7')];};Graph[_0xbb2a('0x8')][_0xbb2a('0xd')]=function(_0x3a0ff1){return this['vertices'][_0x3a0ff1];};Graph[_0xbb2a('0x8')][_0xbb2a('0xe')]=function(_0xc715f8,_0x41ab3b){if(!this['vertices'][_0xc715f8]){return logger[_0xbb2a('0xf')](_0xbb2a('0x10'));}var _0x30ac40=_0x41ab3b(this['vertices'][_0xc715f8]);if(!_0x30ac40){return logger['info'](_0xbb2a('0x11'));}if(this[_0xbb2a('0x6')][_0xc715f8]['length']===0x0){return logger[_0xbb2a('0xf')](_0xbb2a('0x12'));}for(var _0x43d486=0x0,_0x10ac3a=[],_0x44a506=![];_0x43d486\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','port','listening','connection','lodash','syncho','util','moment','agi','./mailRpc','./graph','./vertices','defaults','127.0.0.1','nextTick','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','format','message','error','[%s]\x20%s','name','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toJson','root','hasOwnProperty','retry','addVertex','mxCell','isArray','length','source','target','addEdge','value','catch','indexOf','substring','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s'];(function(_0x8ab849,_0x67b6b){var _0x5d78b0=function(_0x5b70f0){while(--_0x5b70f0){_0x8ab849['push'](_0x8ab849['shift']());}};_0x5d78b0(++_0x67b6b);}(_0x58ab,0x126));var _0xb58a=function(_0x57dce9,_0x161481){_0x57dce9=_0x57dce9-0x0;var _0x1f343e=_0x58ab[_0x57dce9];return _0x1f343e;};'use strict';var parser=require('xml2json');var _=require(_0xb58a('0x0'));var syncho=require(_0xb58a('0x1'));var util=require(_0xb58a('0x2'));var moment=require(_0xb58a('0x3'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0xb58a('0x4'));var utilLicense=require('../../config/license/util');var rpc=require('./rpc');var mailRpc=require(_0xb58a('0x5'));var Graph=require(_0xb58a('0x6'));var Vertices=require(_0xb58a('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xb58a('0x4')]=_[_0xb58a('0x8')](config[_0xb58a('0x4')],{'ip':_0xb58a('0x9'),'port':0x11dd});function connectionHandler(_0x2c41a5){process[_0xb58a('0xa')](function(){syncho(function(){try{setChannelVariables(_0x2c41a5);agiHandler(_0x2c41a5);}catch(_0x5a7ef2){logger['error'](_0x5a7ef2[_0xb58a('0xb')]);}});});}function listeningHandler(){console['log'](_0xb58a('0xc'),config[_0xb58a('0x4')]['port']);logger[_0xb58a('0xd')](util[_0xb58a('0xe')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0xb58a('0x4')]['ip'],config[_0xb58a('0x4')]['port']));}function errorHandler(_0x9c085c){if(_0x9c085c&&_0x9c085c['name']&&_0x9c085c[_0xb58a('0xf')]){logger[_0xb58a('0x10')](util[_0xb58a('0xe')](_0xb58a('0x11'),_0x9c085c[_0xb58a('0x12')],_0x9c085c[_0xb58a('0xf')]));}else{logger[_0xb58a('0x10')](util['format'](_0xb58a('0x13'),_0x9c085c[_0xb58a('0xb')]));}}function closeHandler(){logger[_0xb58a('0xd')](util[_0xb58a('0xe')](_0xb58a('0x14'),this[_0xb58a('0x15')],this[_0xb58a('0x16')],this[_0xb58a('0x17')],this[_0xb58a('0x18')],this['uniqueid']));try{createSquareReport(this);}catch(_0x36b886){logger['error'](_0x36b886[_0xb58a('0xb')]);}}function timeoutHandler(){logger['info'](util['format']('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this['calleridname'],this[_0xb58a('0x17')],this[_0xb58a('0x18')],this[_0xb58a('0x19')]));}function hangupHandler(){logger['info'](util[_0xb58a('0xe')](_0xb58a('0x1a'),this[_0xb58a('0x15')],this[_0xb58a('0x16')],this['callerid'],this['dnid'],this[_0xb58a('0x19')]));this['evtHangup']=!![];}function getRoot(_0x4fe4b9){return parser[_0xb58a('0x1b')](_0x4fe4b9,{'object':!![]})['mxGraphModel'][_0xb58a('0x1c')];}function addVertex(_0x279fb2,_0x180549,_0x523411){_0x180549['agicommand']=_0x523411;if(_0x180549[_0xb58a('0x1d')](_0xb58a('0x1e'))){_0x180549['maxRetry']=parseInt(_0x180549[_0xb58a('0x1e')],0xa);}_0x279fb2[_0xb58a('0x1f')](_['omit'](_0x180549,_0xb58a('0x20')));}function initGraph(_0x4e90fe,_0x5fa7fd){var _0x583863=new Graph();for(var _0x11c731 in _0x4e90fe){if(_0x4e90fe[_0xb58a('0x1d')](_0x11c731)){if(_[_0xb58a('0x21')](_0x4e90fe[_0x11c731])){for(var _0x38b914=0x0;_0x38b914<_0x4e90fe[_0x11c731][_0xb58a('0x22')];_0x38b914+=0x1){addVertex(_0x583863,_0x4e90fe[_0x11c731][_0x38b914],_0x11c731);}}else{addVertex(_0x583863,_0x4e90fe[_0x11c731],_0x11c731);}}}for(var _0x4e7c71=0x0;_0x4e7c71<_0x5fa7fd[_0xb58a('0x22')];_0x4e7c71+=0x1){if(_0x5fa7fd[_0x4e7c71][_0xb58a('0x23')]&&_0x5fa7fd[_0x4e7c71][_0xb58a('0x24')]){_0x583863[_0xb58a('0x25')](_0x5fa7fd[_0x4e7c71][_0xb58a('0x23')],_0x5fa7fd[_0x4e7c71]['target'],_0x5fa7fd[_0x4e7c71][_0xb58a('0x26')]);}}return _0x583863;}function getSquareProject(_0x539986,_0xbaaf1f){rpc['getSquareProject'](_0x539986)['then'](function(_0x2eb1af){_0xbaaf1f(null,_0x2eb1af);})[_0xb58a('0x27')](function(_0x1f54e7){_0xbaaf1f(null,_0x1f54e7);});}function createSquareReport(_0x55f63c,_0x33c228){rpc['createSquareReport'](_0x55f63c)['then'](function(_0x4e48c4){if(_0x33c228){_0x33c228(null,_0x4e48c4);}})['catch'](function(_0x46c7a2){if(_0x33c228){_0x33c228(null,_0x46c7a2);}});}function setChannelVariables(_0x4cf42c){for(var _0x5dbd99 in _0x4cf42c){if(_0x4cf42c[_0xb58a('0x1d')](_0x5dbd99)){if(_0x5dbd99[_0xb58a('0x28')]('agi_')===0x0){_0x4cf42c[_0x5dbd99[_0xb58a('0x29')](0x4)]=_0x4cf42c[_0x5dbd99];delete _0x4cf42c[_0x5dbd99];}}}}function getLogFromObject(_0x4f7cc8){return util['inspect'](_0x4f7cc8,{'showHidden':![],'depth':null});}function agiHandler(_0x3e4514){var _0x37ea22,_0x38bd9f,_0x3e0527,_0x36e441,_0x4a5455;logger[_0xb58a('0x2a')](_0xb58a('0x2b'),JSON[_0xb58a('0x2c')](_0x3e4514,null,0x2));logger[_0xb58a('0xd')](util[_0xb58a('0xe')](_0xb58a('0x2d'),_0x3e4514[_0xb58a('0x15')],_0x3e4514[_0xb58a('0x16')],_0x3e4514[_0xb58a('0x17')],_0x3e4514[_0xb58a('0x18')],_0x3e4514[_0xb58a('0x19')]));_0x3e4514['on']('error',errorHandler);_0x3e4514['on'](_0xb58a('0x2e'),closeHandler);_0x3e4514['on'](_0xb58a('0x2f'),timeoutHandler);_0x3e4514[_0xb58a('0x30')]=![];_0x3e4514['on'](_0xb58a('0x31'),hangupHandler);var _0x564593=getSquareProject[_0xb58a('0x32')](null,_0x3e4514[_0xb58a('0x15')]);if(_0x564593){if(_0x564593[_0xb58a('0x33')]){_0x37ea22=getRoot(_0x564593[_0xb58a('0x33')]);if(_0x37ea22&&_0x37ea22[_0xb58a('0x34')]){logger[_0xb58a('0x2a')](_0xb58a('0x1c'),JSON[_0xb58a('0x2c')](_0x37ea22,null,0x2));_0x3e4514[_0xb58a('0x35')]=moment()['format'](_0xb58a('0x36'));_0x38bd9f=initGraph(_[_0xb58a('0x37')](_0x37ea22,_0xb58a('0x20')),_0x37ea22[_0xb58a('0x20')]);_0x3e0527=new Vertices(_0x3e4514,rpc,mailRpc);logger[_0xb58a('0xd')](util['format']('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3e4514[_0xb58a('0x15')],_0x3e4514['calleridname'],_0x3e4514[_0xb58a('0x17')],_0x3e4514['dnid'],_0x3e4514[_0xb58a('0x19')]));_0x38bd9f['traverseBFS'](_0x37ea22[_0xb58a('0x34')]['id'],function(_0x4d8f90){try{_0x4d8f90=_0x3e0527[_0xb58a('0x38')](_0x4d8f90);logger[_0xb58a('0x2a')](_0xb58a('0x39'),JSON['stringify'](_0x4d8f90,null,0x2));if(_0x4d8f90[_0xb58a('0x3a')]===_0xb58a('0x3b')){logger['info'](_0xb58a('0x3c'));_0x3e4514['context']=_0x4d8f90[_0xb58a('0x3d')]||_0x3e4514[_0xb58a('0x3d')];_0x3e4514[_0xb58a('0x3e')]=_0x4d8f90['extension'];_0x3e4514[_0xb58a('0x3f')]=_0x4d8f90[_0xb58a('0x3f')]?_0x4d8f90['priority']-0x1:0x1;return null;}else if(_0x4d8f90&&_0x3e0527[_0x4d8f90['agicommand']]){_0x4a5455=_0x3e0527[_0x4d8f90[_0xb58a('0x3a')]](_0x4d8f90);logger['info'](_0xb58a('0x40'),JSON['stringify'](_0x4a5455,null,0x2));if(_0x4a5455&&_0x4a5455[_0xb58a('0x41')]===AGI_CODE_SUCCESS&&_0x4a5455['result']!==AGI_RESULT_ERROR&&!_0x3e4514[_0xb58a('0x30')]){logger[_0xb58a('0x2a')](_0xb58a('0x40'),getLogFromObject(_0x4a5455));return _[_0xb58a('0x42')](_0x4a5455[_0xb58a('0x43')])?null:_0x4a5455['result']['toString']();}else{logger['error'](_0xb58a('0x40'),getLogFromObject(_0x4a5455));return null;}}else{logger['error'](_0xb58a('0x44'));return null;}}catch(_0x23c717){logger['error'](_0x23c717['stack']);return null;}});if(_0x37ea22['finally']){logger['info'](util[_0xb58a('0xe')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3e4514[_0xb58a('0x15')],_0x3e4514[_0xb58a('0x16')],_0x3e4514[_0xb58a('0x17')],_0x3e4514[_0xb58a('0x18')],_0x3e4514['uniqueid']));_0x38bd9f[_0xb58a('0x45')](_0x37ea22[_0xb58a('0x46')]['id'],function(_0x14e194){try{_0x14e194=_0x3e0527[_0xb58a('0x38')](_0x14e194);logger[_0xb58a('0x2a')](_0xb58a('0x39'),JSON[_0xb58a('0x2c')](_0x14e194,null,0x2));if(_0x14e194&&_0x3e0527[_0x14e194[_0xb58a('0x3a')]]){_0x4a5455=_0x3e0527[_0x14e194[_0xb58a('0x3a')]](_0x14e194);if(_0x4a5455){logger[_0xb58a('0x2a')](_0xb58a('0x40'),getLogFromObject(_0x4a5455));return _['isUndefined'](_0x4a5455[_0xb58a('0x43')])?null:_0x4a5455[_0xb58a('0x43')][_0xb58a('0x47')]();}else{logger[_0xb58a('0x10')](_0xb58a('0x40'),getLogFromObject(_0x4a5455));return null;}}else{logger['error'](_0xb58a('0x44'));return null;}}catch(_0x5dcc62){logger[_0xb58a('0x10')](_0x5dcc62[_0xb58a('0xb')]);return null;}});}logger['info'](util['format'](_0xb58a('0x48'),_0x3e4514[_0xb58a('0x15')],_0x3e4514['calleridname'],_0x3e4514[_0xb58a('0x17')],_0x3e4514[_0xb58a('0x18')],_0x3e4514[_0xb58a('0x19')]));logger[_0xb58a('0xd')](util[_0xb58a('0xe')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x3e4514[_0xb58a('0x3d')],_0x3e4514[_0xb58a('0x3e')],parseInt(_0x3e4514[_0xb58a('0x3f')],0xa)+0x1));_0x3e4514[_0xb58a('0x49')](_0x3e4514[_0xb58a('0x3d')],_0x3e4514[_0xb58a('0x3e')],parseInt(_0x3e4514['priority'],0xa)+0x1);_0x3e4514[_0xb58a('0x2e')]();}}else{logger[_0xb58a('0x10')](util['format'](_0xb58a('0x4a'),_0x3e4514[_0xb58a('0x15')]));_0x3e4514['continueAt'](_0x3e4514[_0xb58a('0x3d')],_0x3e4514['extension'],parseInt(_0x3e4514[_0xb58a('0x3f')],0xa)+0x1);_0x3e4514[_0xb58a('0x2e')]();}}else{logger['error'](util[_0xb58a('0xe')](_0xb58a('0x4b'),_0x3e4514['arg_1']));_0x3e4514[_0xb58a('0x49')](_0x3e4514['context'],_0x3e4514[_0xb58a('0x3e')],parseInt(_0x3e4514['priority'],0xa)+0x1);_0x3e4514[_0xb58a('0x2e')]();}}function main(){var _0x3bd954;return utilLicense[_0xb58a('0x4c')]()['then'](function(_0xb8455){if(_0xb8455){if(_0xb8455['voice']){if(_0xb8455[_0xb58a('0x4d')]&&_0xb8455[_0xb58a('0x4d')]>0x0){logger['info'](util[_0xb58a('0xe')](_0xb58a('0x4e'),_0xb8455['callysquare']));_0x3bd954=_0xb8455[_0xb58a('0x4d')];}else{logger['info']('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0xb58a('0xd')](_0xb58a('0x4f'));_0x3bd954=-0x1;}}})['catch'](function(_0x4587a0){logger[_0xb58a('0x10')](_0xb58a('0x50'),_0x4587a0[_0xb58a('0xb')]);})[_0xb58a('0x46')](function(){var _0x447b5a=require(_0xb58a('0x51'))(config['agi'][_0xb58a('0x52')],config[_0xb58a('0x4')]['ip'],_0x3bd954);_0x447b5a['on'](_0xb58a('0x10'),errorHandler);_0x447b5a['on'](_0xb58a('0x53'),listeningHandler);_0x447b5a['on'](_0xb58a('0x54'),connectionHandler);_0x447b5a['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0xcc29=['toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','Project\x20%s\x20not\x20published','continueAt','Project\x20%s\x20not\x20found','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','syncho','util','moment','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./graph','./vertices','127.0.0.1','nextTick','error','stack','log','port','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','format','name','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','agicommand','hasOwnProperty','maxRetry','addVertex','mxCell','isArray','length','source','target','addEdge','getSquareProject','then','catch','createSquareReport','indexOf','agi_','substring','inspect','debug','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','sync','production','root','stringify','joinAt','YYYY-MM-DD\x20HH:mm:ss','omit','start','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','result','response','isUndefined'];(function(_0x5027b1,_0x1409a5){var _0x4a46cf=function(_0x121920){while(--_0x121920){_0x5027b1['push'](_0x5027b1['shift']());}};_0x4a46cf(++_0x1409a5);}(_0xcc29,0x182));var _0x9cc2=function(_0x4394ba,_0x5a2f5d){_0x4394ba=_0x4394ba-0x0;var _0x1e35fa=_0xcc29[_0x4394ba];return _0x1e35fa;};'use strict';var parser=require(_0x9cc2('0x0'));var _=require('lodash');var syncho=require(_0x9cc2('0x1'));var util=require(_0x9cc2('0x2'));var moment=require(_0x9cc2('0x3'));var config=require(_0x9cc2('0x4'));var logger=require(_0x9cc2('0x5'))(_0x9cc2('0x6'));var utilLicense=require(_0x9cc2('0x7'));var rpc=require(_0x9cc2('0x8'));var mailRpc=require('./mailRpc');var Graph=require(_0x9cc2('0x9'));var Vertices=require(_0x9cc2('0xa'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x9cc2('0x6')]=_['defaults'](config[_0x9cc2('0x6')],{'ip':_0x9cc2('0xb'),'port':0x11dd});function connectionHandler(_0x3dcaac){process[_0x9cc2('0xc')](function(){syncho(function(){try{setChannelVariables(_0x3dcaac);agiHandler(_0x3dcaac);}catch(_0x2a2faa){logger[_0x9cc2('0xd')](_0x2a2faa[_0x9cc2('0xe')]);}});});}function listeningHandler(){console[_0x9cc2('0xf')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x9cc2('0x6')][_0x9cc2('0x10')]);logger[_0x9cc2('0x11')](util['format'](_0x9cc2('0x12'),config['agi']['ip'],config[_0x9cc2('0x6')][_0x9cc2('0x10')]));}function errorHandler(_0x125719){if(_0x125719&&_0x125719['name']&&_0x125719[_0x9cc2('0x13')]){logger[_0x9cc2('0xd')](util[_0x9cc2('0x14')]('[%s]\x20%s',_0x125719[_0x9cc2('0x15')],_0x125719[_0x9cc2('0x13')]));}else{logger['error'](util[_0x9cc2('0x14')]('[ERROR]\x20%s',_0x125719[_0x9cc2('0xe')]));}}function closeHandler(){logger[_0x9cc2('0x11')](util['format'](_0x9cc2('0x16'),this[_0x9cc2('0x17')],this[_0x9cc2('0x18')],this['callerid'],this[_0x9cc2('0x19')],this[_0x9cc2('0x1a')]));try{createSquareReport(this);}catch(_0x3a6dcc){logger['error'](_0x3a6dcc[_0x9cc2('0xe')]);}}function timeoutHandler(){logger['info'](util[_0x9cc2('0x14')](_0x9cc2('0x1b'),this[_0x9cc2('0x17')],this[_0x9cc2('0x18')],this[_0x9cc2('0x1c')],this[_0x9cc2('0x19')],this[_0x9cc2('0x1a')]));}function hangupHandler(){logger[_0x9cc2('0x11')](util['format'](_0x9cc2('0x1d'),this[_0x9cc2('0x17')],this[_0x9cc2('0x18')],this[_0x9cc2('0x1c')],this['dnid'],this['uniqueid']));this[_0x9cc2('0x1e')]=!![];}function getRoot(_0x358407){return parser[_0x9cc2('0x1f')](_0x358407,{'object':!![]})[_0x9cc2('0x20')]['root'];}function addVertex(_0x435a5e,_0x5e5e45,_0x470eed){_0x5e5e45[_0x9cc2('0x21')]=_0x470eed;if(_0x5e5e45[_0x9cc2('0x22')]('retry')){_0x5e5e45[_0x9cc2('0x23')]=parseInt(_0x5e5e45['retry'],0xa);}_0x435a5e[_0x9cc2('0x24')](_['omit'](_0x5e5e45,_0x9cc2('0x25')));}function initGraph(_0x583e6c,_0x109011){var _0x33f4bb=new Graph();for(var _0x20239e in _0x583e6c){if(_0x583e6c['hasOwnProperty'](_0x20239e)){if(_[_0x9cc2('0x26')](_0x583e6c[_0x20239e])){for(var _0x25969e=0x0;_0x25969e<_0x583e6c[_0x20239e][_0x9cc2('0x27')];_0x25969e+=0x1){addVertex(_0x33f4bb,_0x583e6c[_0x20239e][_0x25969e],_0x20239e);}}else{addVertex(_0x33f4bb,_0x583e6c[_0x20239e],_0x20239e);}}}for(var _0x2f2b2f=0x0;_0x2f2b2f<_0x109011[_0x9cc2('0x27')];_0x2f2b2f+=0x1){if(_0x109011[_0x2f2b2f][_0x9cc2('0x28')]&&_0x109011[_0x2f2b2f][_0x9cc2('0x29')]){_0x33f4bb[_0x9cc2('0x2a')](_0x109011[_0x2f2b2f][_0x9cc2('0x28')],_0x109011[_0x2f2b2f][_0x9cc2('0x29')],_0x109011[_0x2f2b2f]['value']);}}return _0x33f4bb;}function getSquareProject(_0x1c298b,_0x46e399){rpc[_0x9cc2('0x2b')](_0x1c298b)[_0x9cc2('0x2c')](function(_0x79c0ff){_0x46e399(null,_0x79c0ff);})[_0x9cc2('0x2d')](function(_0x4f8ba4){_0x46e399(null,_0x4f8ba4);});}function createSquareReport(_0x285900,_0x50ed70){rpc[_0x9cc2('0x2e')](_0x285900)[_0x9cc2('0x2c')](function(_0x153457){if(_0x50ed70){_0x50ed70(null,_0x153457);}})[_0x9cc2('0x2d')](function(_0x56e725){if(_0x50ed70){_0x50ed70(null,_0x56e725);}});}function setChannelVariables(_0x538116){for(var _0x1041db in _0x538116){if(_0x538116[_0x9cc2('0x22')](_0x1041db)){if(_0x1041db[_0x9cc2('0x2f')](_0x9cc2('0x30'))===0x0){_0x538116[_0x1041db[_0x9cc2('0x31')](0x4)]=_0x538116[_0x1041db];delete _0x538116[_0x1041db];}}}}function getLogFromObject(_0x2ab0a9){return util[_0x9cc2('0x32')](_0x2ab0a9,{'showHidden':![],'depth':null});}function agiHandler(_0x4090ca){var _0xbe396d,_0x4aa9ad,_0x3fb19e,_0x2cbb1a,_0x6e3e29;logger[_0x9cc2('0x33')]('variables',JSON['stringify'](_0x4090ca,null,0x2));logger['info'](util[_0x9cc2('0x14')](_0x9cc2('0x34'),_0x4090ca['arg_1'],_0x4090ca[_0x9cc2('0x18')],_0x4090ca[_0x9cc2('0x1c')],_0x4090ca['dnid'],_0x4090ca['uniqueid']));_0x4090ca['on'](_0x9cc2('0xd'),errorHandler);_0x4090ca['on'](_0x9cc2('0x35'),closeHandler);_0x4090ca['on'](_0x9cc2('0x36'),timeoutHandler);_0x4090ca[_0x9cc2('0x1e')]=![];_0x4090ca['on']('hangup',hangupHandler);var _0x27db02=getSquareProject[_0x9cc2('0x37')](null,_0x4090ca[_0x9cc2('0x17')]);if(_0x27db02){if(_0x27db02[_0x9cc2('0x38')]){_0xbe396d=getRoot(_0x27db02['production']);if(_0xbe396d&&_0xbe396d['start']){logger['debug'](_0x9cc2('0x39'),JSON[_0x9cc2('0x3a')](_0xbe396d,null,0x2));_0x4090ca[_0x9cc2('0x3b')]=moment()[_0x9cc2('0x14')](_0x9cc2('0x3c'));_0x4aa9ad=initGraph(_[_0x9cc2('0x3d')](_0xbe396d,_0x9cc2('0x25')),_0xbe396d['mxCell']);_0x3fb19e=new Vertices(_0x4090ca,rpc,mailRpc);logger['info'](util['format']('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4090ca[_0x9cc2('0x17')],_0x4090ca['calleridname'],_0x4090ca[_0x9cc2('0x1c')],_0x4090ca[_0x9cc2('0x19')],_0x4090ca[_0x9cc2('0x1a')]));_0x4aa9ad['traverseBFS'](_0xbe396d[_0x9cc2('0x3e')]['id'],function(_0x54a560){try{_0x54a560=_0x3fb19e[_0x9cc2('0x3f')](_0x54a560);logger[_0x9cc2('0x33')](_0x9cc2('0x40'),JSON['stringify'](_0x54a560,null,0x2));if(_0x54a560['agicommand']===_0x9cc2('0x41')){logger['info'](_0x9cc2('0x42'));_0x4090ca['context']=_0x54a560['context']||_0x4090ca[_0x9cc2('0x43')];_0x4090ca[_0x9cc2('0x44')]=_0x54a560[_0x9cc2('0x44')];_0x4090ca['priority']=_0x54a560[_0x9cc2('0x45')]?_0x54a560['priority']-0x1:0x1;return null;}else if(_0x54a560&&_0x3fb19e[_0x54a560['agicommand']]){_0x6e3e29=_0x3fb19e[_0x54a560[_0x9cc2('0x21')]](_0x54a560);logger[_0x9cc2('0x11')]('response',JSON[_0x9cc2('0x3a')](_0x6e3e29,null,0x2));if(_0x6e3e29&&_0x6e3e29[_0x9cc2('0x46')]===AGI_CODE_SUCCESS&&_0x6e3e29[_0x9cc2('0x47')]!==AGI_RESULT_ERROR&&!_0x4090ca[_0x9cc2('0x1e')]){logger[_0x9cc2('0x33')](_0x9cc2('0x48'),getLogFromObject(_0x6e3e29));return _[_0x9cc2('0x49')](_0x6e3e29[_0x9cc2('0x47')])?null:_0x6e3e29['result'][_0x9cc2('0x4a')]();}else{logger[_0x9cc2('0xd')](_0x9cc2('0x48'),getLogFromObject(_0x6e3e29));return null;}}else{logger[_0x9cc2('0xd')](_0x9cc2('0x4b'));return null;}}catch(_0x772c75){logger[_0x9cc2('0xd')](_0x772c75[_0x9cc2('0xe')]);return null;}});if(_0xbe396d[_0x9cc2('0x4c')]){logger['info'](util['format'](_0x9cc2('0x4d'),_0x4090ca['arg_1'],_0x4090ca[_0x9cc2('0x18')],_0x4090ca[_0x9cc2('0x1c')],_0x4090ca['dnid'],_0x4090ca['uniqueid']));_0x4aa9ad[_0x9cc2('0x4e')](_0xbe396d[_0x9cc2('0x4c')]['id'],function(_0x489eb8){try{_0x489eb8=_0x3fb19e[_0x9cc2('0x3f')](_0x489eb8);logger[_0x9cc2('0x33')](_0x9cc2('0x40'),JSON[_0x9cc2('0x3a')](_0x489eb8,null,0x2));if(_0x489eb8&&_0x3fb19e[_0x489eb8[_0x9cc2('0x21')]]){_0x6e3e29=_0x3fb19e[_0x489eb8[_0x9cc2('0x21')]](_0x489eb8);if(_0x6e3e29){logger[_0x9cc2('0x33')](_0x9cc2('0x48'),getLogFromObject(_0x6e3e29));return _[_0x9cc2('0x49')](_0x6e3e29[_0x9cc2('0x47')])?null:_0x6e3e29[_0x9cc2('0x47')][_0x9cc2('0x4a')]();}else{logger['error']('response',getLogFromObject(_0x6e3e29));return null;}}else{logger[_0x9cc2('0xd')]('agicommand\x20not\x20found');return null;}}catch(_0x20d28a){logger['error'](_0x20d28a[_0x9cc2('0xe')]);return null;}});}logger['info'](util[_0x9cc2('0x14')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4090ca[_0x9cc2('0x17')],_0x4090ca[_0x9cc2('0x18')],_0x4090ca[_0x9cc2('0x1c')],_0x4090ca['dnid'],_0x4090ca['uniqueid']));logger[_0x9cc2('0x11')](util[_0x9cc2('0x14')](_0x9cc2('0x4f'),_0x4090ca[_0x9cc2('0x43')],_0x4090ca[_0x9cc2('0x44')],parseInt(_0x4090ca['priority'],0xa)+0x1));_0x4090ca['continueAt'](_0x4090ca[_0x9cc2('0x43')],_0x4090ca[_0x9cc2('0x44')],parseInt(_0x4090ca[_0x9cc2('0x45')],0xa)+0x1);_0x4090ca[_0x9cc2('0x35')]();}}else{logger[_0x9cc2('0xd')](util[_0x9cc2('0x14')](_0x9cc2('0x50'),_0x4090ca['arg_1']));_0x4090ca[_0x9cc2('0x51')](_0x4090ca['context'],_0x4090ca['extension'],parseInt(_0x4090ca[_0x9cc2('0x45')],0xa)+0x1);_0x4090ca['close']();}}else{logger['error'](util[_0x9cc2('0x14')](_0x9cc2('0x52'),_0x4090ca[_0x9cc2('0x17')]));_0x4090ca['continueAt'](_0x4090ca[_0x9cc2('0x43')],_0x4090ca['extension'],parseInt(_0x4090ca[_0x9cc2('0x45')],0xa)+0x1);_0x4090ca[_0x9cc2('0x35')]();}}function main(){var _0x39021e;return utilLicense[_0x9cc2('0x53')]()['then'](function(_0x46b436){if(_0x46b436){if(_0x46b436['voice']){if(_0x46b436[_0x9cc2('0x54')]&&_0x46b436[_0x9cc2('0x54')]>0x0){logger['info'](util[_0x9cc2('0x14')](_0x9cc2('0x55'),_0x46b436[_0x9cc2('0x54')]));_0x39021e=_0x46b436[_0x9cc2('0x54')];}else{logger[_0x9cc2('0x11')](_0x9cc2('0x56'));}}else{logger[_0x9cc2('0x11')](_0x9cc2('0x57'));_0x39021e=-0x1;}}})[_0x9cc2('0x2d')](function(_0x39107a){logger[_0x9cc2('0xd')](_0x9cc2('0x58'),_0x39107a[_0x9cc2('0xe')]);})[_0x9cc2('0x4c')](function(){var _0x3cfa87=require(_0x9cc2('0x59'))(config[_0x9cc2('0x6')]['port'],config[_0x9cc2('0x6')]['ip'],_0x39021e);_0x3cfa87['on']('error',errorHandler);_0x3cfa87['on'](_0x9cc2('0x5a'),listeningHandler);_0x3cfa87['on'](_0x9cc2('0x5b'),connectionHandler);_0x3cfa87['on'](_0x9cc2('0x35'),closeHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index 1c935a4..189fdc4 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 _0x4230=['http','then','error','message','result','SendMail','bluebird','client'];(function(_0x3998ff,_0x58f511){var _0xfd997d=function(_0x114dc6){while(--_0x114dc6){_0x3998ff['push'](_0x3998ff['shift']());}};_0xfd997d(++_0x58f511);}(_0x4230,0x176));var _0x0423=function(_0x1ad1f5,_0x289284){_0x1ad1f5=_0x1ad1f5-0x0;var _0x4cf142=_0x4230[_0x1ad1f5];return _0x4cf142;};'use strict';var BPromise=require(_0x0423('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x0423('0x1')][_0x0423('0x2')]({'port':0x232b});function request(_0x1df69e,_0x31d72d){return new BPromise(function(_0x4ca2d3,_0xa61113){return client['request'](_0x1df69e,_0x31d72d)[_0x0423('0x3')](function(_0x454c7e){if(_0x454c7e[_0x0423('0x4')]){return _0xa61113(_0x454c7e[_0x0423('0x4')][_0x0423('0x5')]);}else{return _0x4ca2d3(_0x454c7e[_0x0423('0x6')]);}})['catch'](function(_0x213a99){return _0xa61113(_0x213a99);});});}exports['sendMailMessage']=function(_0x484c62,_0x16a229){return request(_0x0423('0x7'),{'account':_0x484c62,'message':_0x16a229});}; \ No newline at end of file +var _0xa26d=['then','message','result','catch','sendMailMessage','SendMail','bluebird','client','http','request'];(function(_0x42cc58,_0x5a4760){var _0x5ca9cb=function(_0xf46e9b){while(--_0xf46e9b){_0x42cc58['push'](_0x42cc58['shift']());}};_0x5ca9cb(++_0x5a4760);}(_0xa26d,0x128));var _0xda26=function(_0x4cf8fa,_0x8cd69f){_0x4cf8fa=_0x4cf8fa-0x0;var _0x4e50a2=_0xa26d[_0x4cf8fa];return _0x4e50a2;};'use strict';var BPromise=require(_0xda26('0x0'));var jayson=require('jayson/promise');var client=jayson[_0xda26('0x1')][_0xda26('0x2')]({'port':0x232b});function request(_0x33e396,_0x3b0df8){return new BPromise(function(_0x9f4718,_0x2da00f){return client[_0xda26('0x3')](_0x33e396,_0x3b0df8)[_0xda26('0x4')](function(_0x212079){if(_0x212079['error']){return _0x2da00f(_0x212079['error'][_0xda26('0x5')]);}else{return _0x9f4718(_0x212079[_0xda26('0x6')]);}})[_0xda26('0x7')](function(_0x247b66){return _0x2da00f(_0x247b66);});});}exports[_0xda26('0x8')]=function(_0x4a3b18,_0x6bb74e){return request(_0xda26('0x9'),{'account':_0x4a3b18,'message':_0x6bb74e});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index b6aff59..eed8ddb 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 _0x34ad=['trim','headers','emit','line','exports','util','stream','Transform','_localBuffer','_inBody','inherits','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','split','slice'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x34ad,0x181));var _0xd34a=function(_0x342465,_0x3aa51b){_0x342465=_0x342465-0x0;var _0x4a4da7=_0x34ad[_0x342465];return _0x4a4da7;};'use strict';var util=require(_0xd34a('0x0'));var Transform=require(_0xd34a('0x1'))[_0xd34a('0x2')];function AGIReply(_0x220b24){Transform['call'](this,_0x220b24);this[_0xd34a('0x3')]='';this[_0xd34a('0x4')]=![];}util[_0xd34a('0x5')](AGIReply,Transform);AGIReply['prototype'][_0xd34a('0x6')]=function(_0x35f184,_0x12f73d,_0x200419){var _0x533822='\x0a',_0x4b8326=['\x0a\x0a',_0xd34a('0x7')],_0x5bf54c=-0x1,_0x42557b=-0x1,_0x2d62ce='',_0x5c1a24=0x0,_0x29f93c='',_0x101944='';this[_0xd34a('0x3')]+=_0x35f184[_0xd34a('0x8')]();_0x29f93c=this[_0xd34a('0x3')];if(!this[_0xd34a('0x4')]){_0x5c1a24=0x0;while(_0x4b8326[_0x5c1a24]){while((_0x42557b=_0x29f93c[_0xd34a('0x9')](_0x4b8326[_0x5c1a24]))!=-0x1){_0x2d62ce=_0x4b8326[_0x5c1a24];_0x101944=_0x29f93c[_0xd34a('0xa')](0x0,_0x42557b);_0x29f93c=_0x29f93c[_0xd34a('0xa')](_0x42557b+_0x2d62ce[_0xd34a('0xb')]);var _0x5ebb2d=_0x101944[_0xd34a('0xc')](_0x533822),_0x1b403b=0x0,_0x28a0cd={},_0x58c237='',_0x2eeca5='',_0x2b6a50=-0x1;while(_0x5ebb2d[_0x1b403b]){_0x2b6a50=_0x5ebb2d[_0x1b403b][_0xd34a('0x9')](':');if(_0x2b6a50!=-0x1){_0x58c237=_0x5ebb2d[_0x1b403b][_0xd34a('0xd')](0x0,_0x2b6a50)[_0xd34a('0xe')]();_0x2eeca5=_0x5ebb2d[_0x1b403b][_0xd34a('0xd')](_0x2b6a50+0x1)[_0xd34a('0xe')]();if(_0x58c237['length']>0x0){_0x28a0cd[_0x58c237]=_0x2eeca5;}}else{}_0x1b403b++;}this['emit'](_0xd34a('0xf'),_0x28a0cd);this['_inBody']=!![];}_0x5c1a24++;}this[_0xd34a('0x3')]=_0x29f93c;}else{while((_0x5bf54c=_0x29f93c['indexOf'](_0x533822))!=-0x1){_0x101944=_0x29f93c[_0xd34a('0xa')](0x0,_0x5bf54c);this[_0xd34a('0x10')](_0xd34a('0x11'),_0x101944);_0x29f93c=_0x29f93c['substring'](_0x5bf54c+_0x533822[_0xd34a('0xb')]);}this[_0xd34a('0x3')]=_0x29f93c;}_0x200419();};module[_0xd34a('0x12')]=AGIReply; \ No newline at end of file +var _0xcc8d=['stream','Transform','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','split','slice','trim','emit','line'];(function(_0x53abe5,_0x33a9e5){var _0xc1c37e=function(_0xd53c6e){while(--_0xd53c6e){_0x53abe5['push'](_0x53abe5['shift']());}};_0xc1c37e(++_0x33a9e5);}(_0xcc8d,0xbb));var _0xdcc8=function(_0x5161fc,_0x37c5f6){_0x5161fc=_0x5161fc-0x0;var _0x38490b=_0xcc8d[_0x5161fc];return _0x38490b;};'use strict';var util=require('util');var Transform=require(_0xdcc8('0x0'))[_0xdcc8('0x1')];function AGIReply(_0x54464b){Transform['call'](this,_0x54464b);this[_0xdcc8('0x2')]='';this[_0xdcc8('0x3')]=![];}util[_0xdcc8('0x4')](AGIReply,Transform);AGIReply[_0xdcc8('0x5')][_0xdcc8('0x6')]=function(_0x1bf391,_0x28713a,_0x47b30e){var _0x44e0b0='\x0a',_0xfeebba=['\x0a\x0a',_0xdcc8('0x7')],_0x10dd63=-0x1,_0x237528=-0x1,_0x11c497='',_0x5a85bd=0x0,_0x2bdaff='',_0xa991a1='';this[_0xdcc8('0x2')]+=_0x1bf391[_0xdcc8('0x8')]();_0x2bdaff=this[_0xdcc8('0x2')];if(!this[_0xdcc8('0x3')]){_0x5a85bd=0x0;while(_0xfeebba[_0x5a85bd]){while((_0x237528=_0x2bdaff[_0xdcc8('0x9')](_0xfeebba[_0x5a85bd]))!=-0x1){_0x11c497=_0xfeebba[_0x5a85bd];_0xa991a1=_0x2bdaff[_0xdcc8('0xa')](0x0,_0x237528);_0x2bdaff=_0x2bdaff[_0xdcc8('0xa')](_0x237528+_0x11c497[_0xdcc8('0xb')]);var _0x312dd7=_0xa991a1[_0xdcc8('0xc')](_0x44e0b0),_0x59af51=0x0,_0x4160ff={},_0x37d3c1='',_0x5d5554='',_0x2b658e=-0x1;while(_0x312dd7[_0x59af51]){_0x2b658e=_0x312dd7[_0x59af51][_0xdcc8('0x9')](':');if(_0x2b658e!=-0x1){_0x37d3c1=_0x312dd7[_0x59af51][_0xdcc8('0xd')](0x0,_0x2b658e)['trim']();_0x5d5554=_0x312dd7[_0x59af51][_0xdcc8('0xd')](_0x2b658e+0x1)[_0xdcc8('0xe')]();if(_0x37d3c1['length']>0x0){_0x4160ff[_0x37d3c1]=_0x5d5554;}}else{}_0x59af51++;}this[_0xdcc8('0xf')]('headers',_0x4160ff);this[_0xdcc8('0x3')]=!![];}_0x5a85bd++;}this[_0xdcc8('0x2')]=_0x2bdaff;}else{while((_0x10dd63=_0x2bdaff[_0xdcc8('0x9')](_0x44e0b0))!=-0x1){_0xa991a1=_0x2bdaff[_0xdcc8('0xa')](0x0,_0x10dd63);this[_0xdcc8('0xf')](_0xdcc8('0x10'),_0xa991a1);_0x2bdaff=_0x2bdaff[_0xdcc8('0xa')](_0x10dd63+_0x44e0b0['length']);}this['_localBuffer']=_0x2bdaff;}_0x47b30e();};module['exports']=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index e65eb23..57d01ce 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 _0x618a=['ShowUser','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','Interval','Intervals','getSmsAccountById','ShowSmsAccount','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','getPauseById','agentLogin','LoginUser','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','util','jayson/promise','client','http','request','then','error','result','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','name','email','getVoiceQueueById','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','getUserById'];(function(_0x29bb26,_0x43d295){var _0x4b4072=function(_0x418574){while(--_0x418574){_0x29bb26['push'](_0x29bb26['shift']());}};_0x4b4072(++_0x43d295);}(_0x618a,0x148));var _0xa618=function(_0x29b997,_0x3f7266){_0x29b997=_0x29b997-0x0;var _0x18fe58=_0x618a[_0x29b997];return _0x18fe58;};'use strict';var BPromise=require(_0xa618('0x0'));var moment=require(_0xa618('0x1'));var _=require(_0xa618('0x2'));var util=require(_0xa618('0x3'));var jayson=require(_0xa618('0x4'));var client=jayson[_0xa618('0x5')][_0xa618('0x6')]({'port':0x2329});function request(_0x541fee,_0x66c863){return new BPromise(function(_0x486970,_0x8b5fb){return client[_0xa618('0x7')](_0x541fee,_0x66c863)[_0xa618('0x8')](function(_0x4b8caa){if(_0x4b8caa[_0xa618('0x9')]){return _0x8b5fb(_0x4b8caa[_0xa618('0x9')]['message']);}else{return _0x486970(_0x4b8caa[_0xa618('0xa')]);}})[_0xa618('0xb')](function(_0x49889d){return _0x8b5fb(_0x49889d);});});}exports[_0xa618('0xc')]=function(_0x3b88a2){return request(_0xa618('0xd'),{'options':{'raw':![],'where':{'name':_0x3b88a2},'attributes':[_0xa618('0xe')]}});};exports[_0xa618('0xf')]=function(_0x2c007b){return request(_0xa618('0x10'),{'options':{'raw':![],'where':{'id':_0x2c007b},'include':[{'model':_0xa618('0x11'),'as':'Smtp'}],'attributes':['id',_0xa618('0x12'),_0xa618('0x13')]}});};exports['getSquareProjectById']=function(_0x519b8c){return request(_0xa618('0xd'),{'options':{'where':{'id':_0x519b8c},'attributes':[_0xa618('0x12')]}});};exports[_0xa618('0x14')]=function(_0x11af7e){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x11af7e},'attributes':[_0xa618('0x12')]}});};exports[_0xa618('0x15')]=function(_0x578d98){return request(_0xa618('0x16'),{'options':{'where':{'id':_0x578d98},'attributes':['name']}});};exports[_0xa618('0x17')]=function(_0x2b3a3f){return request(_0xa618('0x18'),{'options':{'where':{'id':_0x2b3a3f},'attributes':['dsn']}});};exports[_0xa618('0x19')]=function(_0x5bb818){return request(_0xa618('0x1a'),{'options':{'where':{'id':_0x5bb818},'attributes':[_0xa618('0x12')]}});};exports[_0xa618('0x1b')]=function(_0x297919){return request(_0xa618('0x1c'),{'options':{'where':{'id':_0x297919},'attributes':['name']}});};exports[_0xa618('0x1d')]=function(_0x503d71){return request(_0xa618('0x1e'),{'options':{'where':{'id':_0x503d71},'attributes':[_0xa618('0x1f')]}});};exports['getIntervalById']=function(_0xe0ac96){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0xe0ac96},'include':[{'model':_0xa618('0x20'),'as':_0xa618('0x21')}]}});};exports[_0xa618('0x22')]=function(_0x11ca72){return request(_0xa618('0x23'),{'options':{'where':{'id':_0x11ca72},'attributes':['id',_0xa618('0x12')]}});};exports['createSmsMessage']=function(_0xe08674){return request('CreateSmsMessage',{'body':_0xe08674});};exports['createSquareDetailsReport']=function(_0x1ad30f){return request(_0xa618('0x24'),{'body':_0x1ad30f});};exports[_0xa618('0x25')]=function(_0xfb204f){return request(_0xa618('0x26'),{'body':_[_0xa618('0x27')](_0xfb204f,{'project_name':_0xfb204f[_0xa618('0x28')],'prev_project_name':_0xfb204f[_0xa618('0x29')]||'','is_subproject':_0xfb204f['arg_2']?!![]:![],'leaveAt':moment()[_0xa618('0x2a')](_0xa618('0x2b'))})});};exports['createSquareRecording']=function(_0xc89a15){return request(_0xa618('0x2c'),{'body':_0xc89a15});};exports[_0xa618('0x2d')]=function(_0x22a84a){return request(_0xa618('0x2e'),{'body':_0x22a84a});};exports[_0xa618('0x2f')]=function(_0x3d1545){return request(_0xa618('0x30'),{'options':{'raw':![],'where':{'phone':_0x3d1545['phone'],'ListId':_0x3d1545[_0xa618('0x31')]}}})[_0xa618('0x8')](function(_0x4743bb){if(_0x4743bb){return _0x4743bb;}return request(_0xa618('0x32'),{'body':_0x3d1545});});};exports[_0xa618('0x33')]=function(_0x5da932){return request('ShowPause',{'options':{'where':{'id':_0x5da932},'attributes':[_0xa618('0x12')]}});};exports[_0xa618('0x34')]=function(_0x45ff75,_0xbd71fb){return request(_0xa618('0x35'),{'body':{'interface':_0xbd71fb},'options':{'where':_0x45ff75}});};exports['agentPause']=function(_0x35a3a8,_0x1a5b10,_0x246302){return request(_0xa618('0x36'),{'body':{'type':_0x1a5b10,'uniqueid':_0x246302},'options':{'where':_0x35a3a8}});};exports[_0xa618('0x37')]=function(_0xf40eef){return request(_0xa618('0x38'),{'body':{},'options':{'where':_0xf40eef}});};exports[_0xa618('0x39')]=function(_0x31862e){return request(_0xa618('0x3a'),{'body':{},'options':{'where':_0x31862e}});}; \ No newline at end of file +var _0xf781=['PauseUser','agentUnpause','UnpauseUser','agentLogout','bluebird','moment','lodash','util','client','http','then','error','getSquareProject','ShowSquareProject','production','getMailAccountById','MailServerOut','Smtp','name','email','getVoiceQueueById','ShowVoiceQueue','getVariableById','getSquareOdbcById','ShowSquareOdbc','dsn','ShowUser','getTrunkById','ShowTrunk','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin'];(function(_0x351eff,_0x544e14){var _0x169489=function(_0x4f558e){while(--_0x4f558e){_0x351eff['push'](_0x351eff['shift']());}};_0x169489(++_0x544e14);}(_0xf781,0x185));var _0x1f78=function(_0x56f9f3,_0xf5edc3){_0x56f9f3=_0x56f9f3-0x0;var _0x2f12af=_0xf781[_0x56f9f3];return _0x2f12af;};'use strict';var BPromise=require(_0x1f78('0x0'));var moment=require(_0x1f78('0x1'));var _=require(_0x1f78('0x2'));var util=require(_0x1f78('0x3'));var jayson=require('jayson/promise');var client=jayson[_0x1f78('0x4')][_0x1f78('0x5')]({'port':0x2329});function request(_0x13fecf,_0x24e733){return new BPromise(function(_0x2575bd,_0x2f3050){return client['request'](_0x13fecf,_0x24e733)[_0x1f78('0x6')](function(_0x2ab629){if(_0x2ab629[_0x1f78('0x7')]){return _0x2f3050(_0x2ab629[_0x1f78('0x7')]['message']);}else{return _0x2575bd(_0x2ab629['result']);}})['catch'](function(_0x562fe2){return _0x2f3050(_0x562fe2);});});}exports[_0x1f78('0x8')]=function(_0x584a41){return request(_0x1f78('0x9'),{'options':{'raw':![],'where':{'name':_0x584a41},'attributes':[_0x1f78('0xa')]}});};exports[_0x1f78('0xb')]=function(_0x40676e){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x40676e},'include':[{'model':_0x1f78('0xc'),'as':_0x1f78('0xd')}],'attributes':['id',_0x1f78('0xe'),_0x1f78('0xf')]}});};exports['getSquareProjectById']=function(_0x448e94){return request(_0x1f78('0x9'),{'options':{'where':{'id':_0x448e94},'attributes':[_0x1f78('0xe')]}});};exports[_0x1f78('0x10')]=function(_0x4edbd9){return request(_0x1f78('0x11'),{'options':{'where':{'id':_0x4edbd9},'attributes':['name']}});};exports[_0x1f78('0x12')]=function(_0x28f4f1){return request('ShowVariable',{'options':{'where':{'id':_0x28f4f1},'attributes':[_0x1f78('0xe')]}});};exports[_0x1f78('0x13')]=function(_0x253a17){return request(_0x1f78('0x14'),{'options':{'where':{'id':_0x253a17},'attributes':[_0x1f78('0x15')]}});};exports['getUserById']=function(_0x12ebbc){return request(_0x1f78('0x16'),{'options':{'where':{'id':_0x12ebbc},'attributes':[_0x1f78('0xe')]}});};exports[_0x1f78('0x17')]=function(_0x21bb76){return request(_0x1f78('0x18'),{'options':{'where':{'id':_0x21bb76},'attributes':[_0x1f78('0xe')]}});};exports['getSoundById']=function(_0x47ee0f){return request('ShowSound',{'options':{'where':{'id':_0x47ee0f},'attributes':[_0x1f78('0x19')]}});};exports[_0x1f78('0x1a')]=function(_0x4a4f4c){return request(_0x1f78('0x1b'),{'options':{'raw':![],'where':{'id':_0x4a4f4c},'include':[{'model':_0x1f78('0x1c'),'as':_0x1f78('0x1d')}]}});};exports[_0x1f78('0x1e')]=function(_0x25a916){return request(_0x1f78('0x1f'),{'options':{'where':{'id':_0x25a916},'attributes':['id',_0x1f78('0xe')]}});};exports[_0x1f78('0x20')]=function(_0x1bda25){return request(_0x1f78('0x21'),{'body':_0x1bda25});};exports[_0x1f78('0x22')]=function(_0x4d394f){return request(_0x1f78('0x23'),{'body':_0x4d394f});};exports[_0x1f78('0x24')]=function(_0xc121d5){return request(_0x1f78('0x25'),{'body':_[_0x1f78('0x26')](_0xc121d5,{'project_name':_0xc121d5[_0x1f78('0x27')],'prev_project_name':_0xc121d5[_0x1f78('0x28')]||'','is_subproject':_0xc121d5['arg_2']?!![]:![],'leaveAt':moment()['format'](_0x1f78('0x29'))})});};exports['createSquareRecording']=function(_0x417aef){return request('CreateSquareRecording',{'body':_0x417aef});};exports['createSquareMessage']=function(_0x2b7071){return request(_0x1f78('0x2a'),{'body':_0x2b7071});};exports[_0x1f78('0x2b')]=function(_0x145652){return request(_0x1f78('0x2c'),{'options':{'raw':![],'where':{'phone':_0x145652[_0x1f78('0x2d')],'ListId':_0x145652[_0x1f78('0x2e')]}}})[_0x1f78('0x6')](function(_0x2bc98f){if(_0x2bc98f){return _0x2bc98f;}return request(_0x1f78('0x2f'),{'body':_0x145652});});};exports[_0x1f78('0x30')]=function(_0x2077a9){return request(_0x1f78('0x31'),{'options':{'where':{'id':_0x2077a9},'attributes':['name']}});};exports[_0x1f78('0x32')]=function(_0x3c7174,_0x3e8a56){return request('LoginUser',{'body':{'interface':_0x3e8a56},'options':{'where':_0x3c7174}});};exports['agentPause']=function(_0x4e11fa,_0x2d7284,_0x1a631b){return request(_0x1f78('0x33'),{'body':{'type':_0x2d7284,'uniqueid':_0x1a631b},'options':{'where':_0x4e11fa}});};exports[_0x1f78('0x34')]=function(_0x72ab93){return request(_0x1f78('0x35'),{'body':{},'options':{'where':_0x72ab93}});};exports[_0x1f78('0x36')]=function(_0x4f8e0a){return request('LogoutUser',{'body':{},'options':{'where':_0x4f8e0a}});}; \ 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 8c700b6..fccc4b7 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 _0x8917=['exports','./polly'];(function(_0x14f10c,_0x10ad25){var _0x3801e4=function(_0x2ce2df){while(--_0x2ce2df){_0x14f10c['push'](_0x14f10c['shift']());}};_0x3801e4(++_0x10ad25);}(_0x8917,0x1d7));var _0x7891=function(_0x5e36dc,_0x711e89){_0x5e36dc=_0x5e36dc-0x0;var _0x30746f=_0x8917[_0x5e36dc];return _0x30746f;};var polly=require(_0x7891('0x0'));var lex=require('./lex');module[_0x7891('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x4453=['./polly','./lex'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4453,0x9c));var _0x3445=function(_0x43173e,_0x1d793a){_0x43173e=_0x43173e-0x0;var _0x435fe7=_0x4453[_0x43173e];return _0x435fe7;};var polly=require(_0x3445('0x0'));var lex=require(_0x3445('0x1'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 80299b8..aa6bf74 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 _0xd64b=['./lib/api'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd64b,0xc1));var _0xbd64=function(_0x460013,_0x2ebc73){_0x460013=_0x460013-0x0;var _0x55924f=_0xd64b[_0x460013];return _0x55924f;};'use strict';var lex=require(_0xbd64('0x0'));module['exports']=function(_0xf0de04,_0x4bfb7c,_0x30b9b3,_0xcbecd5,_0x64bd3b,_0x3f1f05){return lex(_0xf0de04,_0x4bfb7c,_0x30b9b3,_0xcbecd5,_0x64bd3b,_0x3f1f05);}; \ No newline at end of file +var _0xdace=['./lib/api'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xdace,0xc5));var _0xedac=function(_0x220afa,_0xf5f6cc){_0x220afa=_0x220afa-0x0;var _0x1b79d1=_0xdace[_0x220afa];return _0x1b79d1;};'use strict';var lex=require(_0xedac('0x0'));module['exports']=function(_0x1c76b2,_0x13adb5,_0x46eba0,_0x518516,_0x413d77,_0x36bcd2){return lex(_0x1c76b2,_0x13adb5,_0x46eba0,_0x518516,_0x413d77,_0x36bcd2);}; \ 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 533f0e8..d211a0a 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(_0x1e253b,_0x57cc14){var _0x41fc32=function(_0x595fe2){while(--_0x595fe2){_0x1e253b['push'](_0x1e253b['shift']());}};_0x41fc32(++_0x57cc14);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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(_0x12cec2,_0x58da6c){var _0x5bddea=function(_0x5b4516){while(--_0x5b4516){_0x12cec2['push'](_0x12cec2['shift']());}};_0x5bddea(++_0x58da6c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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 58df500..8b4e1db 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 _0x4225=['exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4225,0x14f));var _0x5422=function(_0x175f69,_0x1126d7){_0x175f69=_0x175f69-0x0;var _0x52ca70=_0x4225[_0x175f69];return _0x52ca70;};'use strict';var polly=require('./lib/api');module[_0x5422('0x0')]=function(_0x85e35c,_0xc0f258,_0x259ace,_0x3088cd,_0x90401a,_0x240569,_0x5ba78d){return polly(_0x85e35c,_0xc0f258,_0x259ace,_0x3088cd,_0x90401a,_0x240569,_0x5ba78d);}; \ No newline at end of file +var _0xaa24=['exports'];(function(_0x2bd67f,_0x373e28){var _0x4cd465=function(_0x4e1e77){while(--_0x4e1e77){_0x2bd67f['push'](_0x2bd67f['shift']());}};_0x4cd465(++_0x373e28);}(_0xaa24,0x1ed));var _0x4aa2=function(_0xa18875,_0x5565a1){_0xa18875=_0xa18875-0x0;var _0x13c825=_0xaa24[_0xa18875];return _0x13c825;};'use strict';var polly=require('./lib/api');module[_0x4aa2('0x0')]=function(_0x4c39e9,_0x4617ee,_0x2dc95a,_0x94d1ce,_0x3e7a71,_0x2c7102,_0x1c0789){return polly(_0x4c39e9,_0x4617ee,_0x2dc95a,_0x94d1ce,_0x3e7a71,_0x2c7102,_0x1c0789);}; \ 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 c5e1496..10be0fc 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 _0xfca0=['synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','text','path','bluebird','randomstring','aws-sdk'];(function(_0x42167f,_0x36c277){var _0x20f119=function(_0x1f79f3){while(--_0x1f79f3){_0x42167f['push'](_0x42167f['shift']());}};_0x20f119(++_0x36c277);}(_0xfca0,0xe3));var _0x0fca=function(_0x331d14,_0x5af293){_0x331d14=_0x331d14-0x0;var _0x3f39ab=_0xfca0[_0x331d14];return _0x3f39ab;};'use strict';var fs=require('fs');var path=require(_0x0fca('0x0'));var BPromise=require(_0x0fca('0x1'));var rs=require(_0x0fca('0x2'));var AWS=require(_0x0fca('0x3'));function pollyResult(_0x5e3701,_0x207dd1,_0x1906b6){return new BPromise(function(_0x7fdd8f,_0x2a4ce3){_0x5e3701[_0x0fca('0x4')](_0x207dd1,function(_0x1f995d,_0x2dfc56){if(_0x1f995d){_0x2a4ce3(_0x1f995d);}else if(_0x2dfc56){if(_0x2dfc56[_0x0fca('0x5')]instanceof Buffer){fs[_0x0fca('0x6')](_0x1906b6,_0x2dfc56[_0x0fca('0x5')],function(_0x575eb5){if(_0x575eb5){_0x2a4ce3(_0x575eb5);}else{_0x7fdd8f();}});}else{_0x2a4ce3(new Error(_0x0fca('0x7')));}}else{_0x2a4ce3(new Error(_0x0fca('0x8')));}});});}module[_0x0fca('0x9')]=function(_0x59fcd0,_0x17c6f5,_0x30ed69,_0x18e5f4,_0x1fb247,_0x290b7e,_0x1f6728){var _0x3a98b7=new AWS['Polly']({'accessKeyId':_0x59fcd0,'secretAccessKey':_0x17c6f5,'region':_0x30ed69});var _0x553fe1={'Text':_0x1fb247,'TextType':_0x290b7e||_0x0fca('0xa'),'OutputFormat':'mp3','VoiceId':_0x18e5f4};return pollyResult(_0x3a98b7,_0x553fe1,_0x1f6728);}; \ No newline at end of file +var _0x2140=['path','bluebird','randomstring','synthesizeSpeech','AudioStream','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly'];(function(_0x218972,_0x1f9794){var _0x1bb1a8=function(_0x3fb962){while(--_0x3fb962){_0x218972['push'](_0x218972['shift']());}};_0x1bb1a8(++_0x1f9794);}(_0x2140,0xe8));var _0x0214=function(_0x3c4a32,_0x3bceea){_0x3c4a32=_0x3c4a32-0x0;var _0x2063bc=_0x2140[_0x3c4a32];return _0x2063bc;};'use strict';var fs=require('fs');var path=require(_0x0214('0x0'));var BPromise=require(_0x0214('0x1'));var rs=require(_0x0214('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x23b270,_0x257b5a,_0x301eb6){return new BPromise(function(_0x3e5592,_0x29368d){_0x23b270[_0x0214('0x3')](_0x257b5a,function(_0x485012,_0x3ce5b6){if(_0x485012){_0x29368d(_0x485012);}else if(_0x3ce5b6){if(_0x3ce5b6[_0x0214('0x4')]instanceof Buffer){fs['writeFile'](_0x301eb6,_0x3ce5b6[_0x0214('0x4')],function(_0x4f0e6a){if(_0x4f0e6a){_0x29368d(_0x4f0e6a);}else{_0x3e5592();}});}else{_0x29368d(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x29368d(new Error(_0x0214('0x5')));}});});}module[_0x0214('0x6')]=function(_0x67eef8,_0x106f48,_0x285fba,_0x404605,_0x2e9c82,_0x66f7e7,_0x33b588){var _0x3948ec=new AWS[(_0x0214('0x7'))]({'accessKeyId':_0x67eef8,'secretAccessKey':_0x106f48,'region':_0x285fba});var _0x2429aa={'Text':_0x2e9c82,'TextType':_0x66f7e7||'text','OutputFormat':'mp3','VoiceId':_0x404605};return pollyResult(_0x3948ec,_0x2429aa,_0x33b588);}; \ 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 863c562..6db0a17 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 _0xdc65=['./lib/api'];(function(_0xba4cfa,_0xa11317){var _0x295adc=function(_0x26bd0b){while(--_0x26bd0b){_0xba4cfa['push'](_0xba4cfa['shift']());}};_0x295adc(++_0xa11317);}(_0xdc65,0xfe));var _0x5dc6=function(_0x446f43,_0x3643a3){_0x446f43=_0x446f43-0x0;var _0x4e7816=_0xdc65[_0x446f43];return _0x4e7816;};'use strict';var asr=require(_0x5dc6('0x0'));module['exports']=function(_0x209dbf,_0x1a4785,_0x20fde2,_0x4ebc94){return asr(_0x209dbf,_0x1a4785,_0x20fde2);}; \ No newline at end of file +var _0x7ff5=['./lib/api','exports'];(function(_0x5f5af9,_0x1077d7){var _0x956d55=function(_0x2624b0){while(--_0x2624b0){_0x5f5af9['push'](_0x5f5af9['shift']());}};_0x956d55(++_0x1077d7);}(_0x7ff5,0x190));var _0x57ff=function(_0x46c76f,_0x3de6e3){_0x46c76f=_0x46c76f-0x0;var _0x3d24be=_0x7ff5[_0x46c76f];return _0x3d24be;};'use strict';var asr=require(_0x57ff('0x0'));module[_0x57ff('0x1')]=function(_0x2da3a6,_0x378b37,_0x10cebf,_0xc1aef9){return asr(_0x2da3a6,_0x378b37,_0x10cebf);}; \ 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 9359e45..9a44382 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 _0xec56=['length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','exports','string'];(function(_0x5b102c,_0x58b78f){var _0x347703=function(_0x5389cd){while(--_0x5389cd){_0x5b102c['push'](_0x5b102c['shift']());}};_0x347703(++_0x58b78f);}(_0xec56,0x1bd));var _0x6ec5=function(_0x45065b,_0x6349d4){_0x45065b=_0x45065b-0x0;var _0x20ff1f=_0xec56[_0x45065b];return _0x20ff1f;};'use strict';var url=require(_0x6ec5('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host='https://speech.googleapis.com';module[_0x6ec5('0x1')]=function(_0x3b8a3f,_0x26a5af,_0x240ccf){return new BPromise(function(_0x43c2cd,_0x399441){var _0x469679;if(typeof _0x3b8a3f!==_0x6ec5('0x2')||_0x3b8a3f[_0x6ec5('0x3')]===0x0){return _0x399441(_0x6ec5('0x4'));}if(typeof _0x26a5af!==_0x6ec5('0x2')||_0x26a5af[_0x6ec5('0x3')]===0x0){return _0x399441(_0x6ec5('0x5'));}if(typeof _0x240ccf!==_0x6ec5('0x6')&&(typeof _0x240ccf!==_0x6ec5('0x2')||_0x240ccf[_0x6ec5('0x3')]===0x0)){return _0x399441(_0x6ec5('0x7'));}try{_0x469679=fs[_0x6ec5('0x8')](_0x3b8a3f)[_0x6ec5('0x9')]('base64');}catch(_0x2e880d){return _0x399441(_0x2e880d);}return _0x43c2cd({'method':_0x6ec5('0xa'),'uri':host+_0x6ec5('0xb')+_0x26a5af,'body':{'config':{'encoding':_0x6ec5('0xc'),'sampleRateHertz':_0x6ec5('0xd'),'languageCode':_0x240ccf},'audio':{'content':_0x469679}},'json':!![]});});}; \ No newline at end of file +var _0x89f7=['string','length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','POST','/v1/speech:recognize?key=','url','bluebird','https://speech.googleapis.com'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x89f7,0x105));var _0x789f=function(_0x529059,_0x294a33){_0x529059=_0x529059-0x0;var _0x156bc2=_0x89f7[_0x529059];return _0x156bc2;};'use strict';var url=require(_0x789f('0x0'));var BPromise=require(_0x789f('0x1'));var fs=require('fs');var host=_0x789f('0x2');module['exports']=function(_0x2e09ac,_0x564d48,_0x1c55ac){return new BPromise(function(_0x48fa02,_0xf6ef5d){var _0x14a3e7;if(typeof _0x2e09ac!==_0x789f('0x3')||_0x2e09ac[_0x789f('0x4')]===0x0){return _0xf6ef5d('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x564d48!==_0x789f('0x3')||_0x564d48[_0x789f('0x4')]===0x0){return _0xf6ef5d(_0x789f('0x5'));}if(typeof _0x1c55ac!==_0x789f('0x6')&&(typeof _0x1c55ac!=='string'||_0x1c55ac['length']===0x0)){return _0xf6ef5d(_0x789f('0x7'));}try{_0x14a3e7=fs[_0x789f('0x8')](_0x2e09ac)[_0x789f('0x9')]('base64');}catch(_0x300d27){return _0xf6ef5d(_0x300d27);}return _0x48fa02({'method':_0x789f('0xa'),'uri':host+_0x789f('0xb')+_0x564d48,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':'8000','languageCode':_0x1c55ac},'audio':{'content':_0x14a3e7}},'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 10cb4be..c7d2123 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 asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file +var _0x9989=['exports'];(function(_0x2da27c,_0x593bfb){var _0x3c313d=function(_0x430bee){while(--_0x430bee){_0x2da27c['push'](_0x2da27c['shift']());}};_0x3c313d(++_0x593bfb);}(_0x9989,0x18c));var _0x9998=function(_0x1ac157,_0x1c998d){_0x1ac157=_0x1ac157-0x0;var _0x11e1f8=_0x9989[_0x1ac157];return _0x11e1f8;};var asr=require('./asr');module[_0x9998('0x0')]={'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 940b684..1a66662 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 _0xd684=['model=%s','freeform=3','sestekNDA','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','dirName','bluebird','dialogflow','http','https','path','querystring','request-promise','randomstring','sox','google-tts-api','url','parse','util','./aws','../../../config/logger','https://api.ispeech.org/api/rest','https:','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','protocol','data','transcode','error\x20convert','info','finish\x20to\x20convert','start','resolve','tmp','generate','writeFileSync','base64','then','chmodSync','split','readFileSync','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','MP3','text:synthesize','.mp3','audioContent','writeFile','777','.wav','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','POST','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','map','alternatives','transcript','join','results','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','name','message','googleDialogflow','textRequest','result','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','queryResult','allRequiredParamsPresent','end_conversation','boolValue','fulfillmentText','intent','isFallback','languageCode','responseId','intentDetectionConfidence','tildeASR','asr','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR'];(function(_0x43e4b3,_0x1444de){var _0x10c655=function(_0x56c01d){while(--_0x56c01d){_0x43e4b3['push'](_0x43e4b3['shift']());}};_0x10c655(++_0x1444de);}(_0xd684,0x91));var _0x4d68=function(_0x530191,_0x52edef){_0x530191=_0x530191-0x0;var _0x212d5d=_0xd684[_0x530191];return _0x212d5d;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0x4d68('0x0'));var dialogflow=require(_0x4d68('0x1'));var fs=require('fs');var http=require(_0x4d68('0x2'));var https=require(_0x4d68('0x3'));var md5=require('md5');var path=require(_0x4d68('0x4'));var querystring=require(_0x4d68('0x5'));var rp=require(_0x4d68('0x6'));var rs=require(_0x4d68('0x7'));var sox=require(_0x4d68('0x8'));var tts=require(_0x4d68('0x9'));var urlParse=require(_0x4d68('0xa'))[_0x4d68('0xb')];var util=require(_0x4d68('0xc'));var aws=require(_0x4d68('0xd'));var google=require('./google');var sestek=require('./sestek');var tilde=require('./tilde');var logger=require(_0x4d68('0xe'))('agi');var ISPEECH_API=_0x4d68('0xf');function downloadFile(_0x3e37d0,_0x270e75){return new BPromise(function(_0x108b37,_0x3c57cb){var _0x245b97=urlParse(_0x3e37d0);var _0x4aa85f=_0x245b97['protocol']===_0x4d68('0x10')?https:http;var _0x4c45de={'host':_0x245b97[_0x4d68('0x11')],'path':_0x245b97[_0x4d68('0x4')],'headers':{'user-agent':_0x4d68('0x12')}};_0x4aa85f[_0x4d68('0x13')](_0x4c45de,function(_0x5b59b3){if(_0x5b59b3[_0x4d68('0x14')]!==0xc8){logger[_0x4d68('0x15')](_0x4d68('0x16')+_0x3e37d0+_0x4d68('0x17')+_0x5b59b3[_0x4d68('0x14')]+'\x20('+_0x5b59b3['statusMessage']+')');_0x3c57cb(new Error('request\x20to\x20'+_0x3e37d0+_0x4d68('0x17')+_0x5b59b3[_0x4d68('0x14')]+'\x20('+_0x5b59b3[_0x4d68('0x18')]+')'));return;}var _0x1b1ac7=fs[_0x4d68('0x19')](_0x270e75);_0x1b1ac7['on'](_0x4d68('0x1a'),function(){logger['info'](_0x4d68('0x1b'));_0x1b1ac7[_0x4d68('0x1c')](_0x108b37);});_0x1b1ac7['on']('error',function(_0x38f60c){fs[_0x4d68('0x1d')](_0x270e75);logger[_0x4d68('0x15')](_0x4d68('0x1e'),_0x38f60c);_0x3c57cb(_0x38f60c);});_0x5b59b3[_0x4d68('0x1f')](_0x1b1ac7);})['on'](_0x4d68('0x15'),function(_0x46089c){logger['error'](_0x46089c);_0x3c57cb(_0x46089c);})[_0x4d68('0x20')]();});}function uploadFile(_0x3926f9){return new BPromise(function(_0x5c098b,_0x1e79a3){var _0x5b4744=urlParse(_0x3926f9);var _0x576df0=_0x5b4744[_0x4d68('0x21')]===_0x4d68('0x10')?https:http;var _0x4841bd={'host':_0x5b4744['host'],'path':_0x5b4744['path'],'headers':{'user-agent':_0x4d68('0x12')}};_0x576df0[_0x4d68('0x13')](_0x4841bd,function(_0x3c7f99){if(_0x3c7f99[_0x4d68('0x14')]!==0xc8){_0x1e79a3(new Error(_0x4d68('0x16')+_0x3926f9+'\x20failed,\x20status\x20code\x20=\x20'+_0x3c7f99[_0x4d68('0x14')]+'\x20('+_0x3c7f99[_0x4d68('0x18')]+')'));return;}var _0x4b7d64='';_0x3c7f99['on'](_0x4d68('0x22'),function(_0x3cdf7c){_0x4b7d64+=_0x3cdf7c;});_0x3c7f99['on'](_0x4d68('0x20'),function(){_0x5c098b(_0x4b7d64);});})['on'](_0x4d68('0x15'),function(_0x599e0f){_0x1e79a3(_0x599e0f);})[_0x4d68('0x20')]();});}function convertFile(_0xfba608,_0x43159a){return new BPromise(function(_0x52b0f5,_0x59f245){var _0x408a95=sox[_0x4d68('0x23')](_0xfba608,_0x43159a,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x408a95['on']('error',function(_0x69f54a){logger[_0x4d68('0x15')](_0x4d68('0x24'),_0x69f54a);_0x59f245(_0x69f54a);});_0x408a95['on']('end',function(){logger[_0x4d68('0x25')](_0x4d68('0x26'));_0x52b0f5();});_0x408a95[_0x4d68('0x27')]();});}function base64Decode(_0x44a475,_0x3d68b8){var _0x36f8fc=path[_0x4d68('0x28')](__dirname,_0x4d68('0x29'),rs[_0x4d68('0x2a')](0x4)+'.wav');fs[_0x4d68('0x2b')](_0x36f8fc,_0x44a475,_0x4d68('0x2c'));return convertFile(_0x36f8fc,_0x3d68b8)[_0x4d68('0x2d')](function(){try{fs['unlink'](_0x36f8fc);fs[_0x4d68('0x2e')](_0x3d68b8,'777');}catch(_0x254eb7){logger['error'](_0x254eb7);}return _0x3d68b8[_0x4d68('0x2f')]('.')[0x0];});}function base64Encode(_0x2be9bf){var _0x21ba3d=fs[_0x4d68('0x30')](_0x2be9bf);return new Buffer(_0x21ba3d)['toString'](_0x4d68('0x2c'));}exports[_0x4d68('0x31')]=function(_0x4ba64f,_0x1b6781,_0x1f0666,_0x578e73,_0x28e7d1,_0x24d382){var _0x57d8e4,_0x40b7bb;var _0x3bd804=_0x4d68('0x32');var _0x509a76=_0x4d68('0x33')+_0x4ba64f;var _0x511c14={};if(_0x1b6781===_0x4d68('0x34')){_0x511c14['input']={'ssml':_0x1f0666};}else{_0x511c14[_0x4d68('0x35')]={'text':_0x1f0666};};_0x511c14[_0x4d68('0x36')]={'languageCode':_0x578e73,'ssmlGender':_0x28e7d1};_0x511c14['audioConfig']={'audioEncoding':_0x4d68('0x37'),'sampleRateHertz':0x1f40};var _0x12b1a3={'url':_0x3bd804+_0x4d68('0x38')+_0x509a76,'method':'POST','json':!![],'body':_0x511c14};return rp(_0x12b1a3)[_0x4d68('0x2d')](function(_0x39ff0f){return new BPromise(function(_0x58b259,_0x402811){_0x57d8e4=path[_0x4d68('0x28')](__dirname,_0x4d68('0x29'),rs[_0x4d68('0x2a')](0x4)+_0x4d68('0x39'));var _0x47f6d9=Buffer['from'](_0x39ff0f[_0x4d68('0x3a')],_0x4d68('0x2c'));return fs[_0x4d68('0x3b')](_0x57d8e4,_0x47f6d9,function(_0xf7c330){_0x402811(_0xf7c330);},function(_0x45ca95){fs[_0x4d68('0x2e')](_0x57d8e4,_0x4d68('0x3c'));_0x58b259(_0x45ca95);});});})[_0x4d68('0x2d')](function(_0x102928){_0x40b7bb=path[_0x4d68('0x28')](__dirname,_0x4d68('0x29'),rs[_0x4d68('0x2a')](0x4)+_0x4d68('0x3d'));return convertFile(_0x57d8e4,_0x40b7bb);})['then'](function(){try{fs[_0x4d68('0x1d')](_0x57d8e4);fs[_0x4d68('0x2e')](_0x40b7bb,_0x4d68('0x3c'));}catch(_0x43c900){logger['error'](_0x43c900);}logger[_0x4d68('0x25')](_0x4d68('0x3e'),_0x40b7bb['split']('.')[0x0]);return _0x40b7bb[_0x4d68('0x2f')]('.')[0x0];});};exports[_0x4d68('0x3f')]=function(_0x16d83d,_0x395e2e){var _0x459bdd=_0x4d68('0x40');var _0x1e1c32,_0x39a753;var _0x148e35;var _0xbdb0fc={'encoding':'utf8','method':_0x4d68('0x41'),'timeout':0x2710,'url':_0x459bdd,'headers':{'Content-Type':_0x4d68('0x42')},'body':_0x4d68('0x43')+encodeURIComponent(JSON[_0x4d68('0x44')]([[[_0x4d68('0x45'),JSON['stringify']([_0x16d83d,_0x395e2e||'en',![],'null']),null,_0x4d68('0x46')]]]))};return rp(_0xbdb0fc)[_0x4d68('0x2d')](function(_0x5ec0bc){try{_0x148e35=eval(_0x5ec0bc[_0x4d68('0x47')](0x5))[0x0][0x2];}catch(_0x10c234){throw new Error(_0x4d68('0x48')+_0x5ec0bc[_0x4d68('0x22')]);}if(!_0x148e35){if(_0x16d83d[_0x4d68('0x49')]>0xc8){throw new Error(_0x4d68('0x4a'));}else{throw new Error('lang\x20\x22'+_0x395e2e+_0x4d68('0x4b'));}}try{_0x148e35=eval(_0x148e35)[0x0];}catch(_0x3f18c7){throw new Error(_0x4d68('0x48')+res[_0x4d68('0x22')]);}const _0x43fe0e=_0x148e35;_0x1e1c32=path[_0x4d68('0x28')](__dirname,_0x4d68('0x29'),rs[_0x4d68('0x2a')](0x4)+'.mp3');fs[_0x4d68('0x2b')](_0x1e1c32,_0x148e35,{'encoding':_0x4d68('0x2c')});_0x39a753=path[_0x4d68('0x28')](__dirname,_0x4d68('0x29'),rs[_0x4d68('0x2a')](0x4)+_0x4d68('0x3d'));return convertFile(_0x1e1c32,_0x39a753);})[_0x4d68('0x2d')](function(){try{fs[_0x4d68('0x1d')](_0x1e1c32);fs['chmodSync'](_0x39a753,_0x4d68('0x3c'));}catch(_0x3ba348){logger[_0x4d68('0x15')](_0x3ba348);}logger[_0x4d68('0x25')]('goggleTTS\x20path',_0x39a753[_0x4d68('0x2f')]('.')[0x0]);return _0x39a753['split']('.')[0x0];});};exports['googleASR']=function(_0x36055f,_0x56d072,_0x194176){return google['asr'](_0x36055f,_0x56d072,_0x194176)[_0x4d68('0x2d')](function(_0x40384d){logger[_0x4d68('0x25')](_0x40384d['uri']);return rp(_0x40384d);})[_0x4d68('0x2d')](function(_0x93b1bd){var _0x419db1='';var _0x44a7a8=0x0;try{fs['unlink'](_0x36055f);}catch(_0x32f81b){logger[_0x4d68('0x15')](_0x32f81b);}if(_0x93b1bd&&_0x93b1bd['results']){_0x419db1=_0x93b1bd['results'][_0x4d68('0x4c')](function(_0x5da8c9){return _0x5da8c9&&_0x5da8c9[_0x4d68('0x4d')][0x0]&&_0x5da8c9['alternatives'][0x0][_0x4d68('0x4e')]?_0x5da8c9[_0x4d68('0x4d')][0x0][_0x4d68('0x4e')]:'';})[_0x4d68('0x4f')]('\x0a');_0x44a7a8=_0x93b1bd[_0x4d68('0x50')][_0x4d68('0x4c')](function(_0x26f912){return _0x26f912&&_0x26f912[_0x4d68('0x4d')][0x0]&&_0x26f912[_0x4d68('0x4d')][0x0][_0x4d68('0x51')]?_0x26f912[_0x4d68('0x4d')][0x0][_0x4d68('0x51')]:0x0;})[_0x4d68('0x4f')]('\x0a');}logger[_0x4d68('0x25')](_0x4d68('0x52'),_0x419db1);logger[_0x4d68('0x25')](_0x4d68('0x53'),_0x44a7a8);return{'transcript':_0x419db1,'confidence':_0x44a7a8};})[_0x4d68('0x54')](function(_0x59440a){logger[_0x4d68('0x15')]('[%s]\x20%s:%s',_0x59440a['statusCode'],_0x59440a[_0x4d68('0x55')],_0x59440a[_0x4d68('0x56')]);});};exports[_0x4d68('0x57')]=function(_0x1d9fea,_0x3e25ea,_0x2d2a70,_0x13552a){var _0x202af6=apiai(_0x3e25ea,{'language':_0x13552a||'en'});return _0x202af6[_0x4d68('0x58')](_0x2d2a70,{'sessionId':md5(_0x1d9fea)})['then'](function(_0x134503){logger[_0x4d68('0x25')](JSON[_0x4d68('0x44')](_0x134503));return{'source':_0x134503[_0x4d68('0x59')]['source'],'resolvedQuery':_0x134503[_0x4d68('0x59')][_0x4d68('0x5a')],'action':_0x134503[_0x4d68('0x59')][_0x4d68('0x5b')],'actionIncomplete':_0x134503['result'][_0x4d68('0x5c')],'speech':_0x134503['result'][_0x4d68('0x5d')][_0x4d68('0x5e')],'score':_0x134503['result'][_0x4d68('0x5f')],'statusCode':_0x134503[_0x4d68('0x60')]['code'],'endConversation':_0x134503[_0x4d68('0x59')][_0x4d68('0x61')][_0x4d68('0x62')]||![],'isFallbackIntent':_0x134503[_0x4d68('0x59')][_0x4d68('0x61')][_0x4d68('0x63')]};});};exports[_0x4d68('0x64')]=function(_0x3222c6,_0x4baafa,_0x512639,_0x30a1bd,_0x2a3109,_0x28df70){var _0x4eecfb=_0x30a1bd[_0x4d68('0x65')](/\\n/g,'\x0a');var _0x216d5f={'credentials':{'private_key':_0x4eecfb,'client_email':_0x512639}};var _0x43f234=new dialogflow[(_0x4d68('0x66'))](_0x216d5f);var _0x2c7b81=_0x43f234[_0x4d68('0x67')](_0x4baafa,md5(_0x3222c6));var _0x1fae98={'session':_0x2c7b81,'queryInput':{'text':{'text':_0x2a3109,'languageCode':_0x28df70}}};return _0x43f234[_0x4d68('0x68')](_0x1fae98)[_0x4d68('0x2d')](function(_0x58ae54){if(_0x58ae54&&_0x58ae54['length']){logger['info']('Dialogflow\x20V2\x20response:',JSON[_0x4d68('0x44')](_0x58ae54));var _0x5e76f6=_0x58ae54[0x0];if(_0x5e76f6){var _0x224ddb={'action':_0x5e76f6[_0x4d68('0x69')][_0x4d68('0x5b')],'allRequiredParamsPresent':_0x5e76f6[_0x4d68('0x69')][_0x4d68('0x6a')],'endConversation':_0x5e76f6[_0x4d68('0x69')]['diagnosticInfo']&&_0x5e76f6[_0x4d68('0x69')]['diagnosticInfo']['fields']?_0x5e76f6['queryResult']['diagnosticInfo']['fields'][_0x4d68('0x6b')][_0x4d68('0x6c')]:![],'fulfillmentText':_0x5e76f6[_0x4d68('0x69')][_0x4d68('0x6d')],'intentName':_0x5e76f6[_0x4d68('0x69')]['intent'][_0x4d68('0x55')],'intentDisplayName':_0x5e76f6['queryResult'][_0x4d68('0x6e')]['displayName'],'isFallbackIntent':_0x5e76f6[_0x4d68('0x69')][_0x4d68('0x6e')][_0x4d68('0x6f')],'languageCode':_0x5e76f6[_0x4d68('0x69')][_0x4d68('0x70')],'queryText':_0x5e76f6['queryResult']['queryText'],'responseId':_0x5e76f6[_0x4d68('0x71')],'score':_0x5e76f6[_0x4d68('0x69')][_0x4d68('0x72')],'speech':_0x5e76f6[_0x4d68('0x69')][_0x4d68('0x6d')],'providerResponse':JSON[_0x4d68('0x44')](_0x58ae54)};return _0x224ddb;}}});};exports[_0x4d68('0x73')]=function(_0xf9d4a9,_0x5ca7b5,_0x14a895,_0xc076d){return tilde[_0x4d68('0x74')](_0xf9d4a9,_0x5ca7b5,_0x14a895,_0xc076d)[_0x4d68('0x2d')](function(_0x27f5cf){try{fs[_0x4d68('0x1d')](_0xf9d4a9);}catch(_0x170f6a){logger[_0x4d68('0x15')](_0x170f6a);}logger['info'](_0x4d68('0x75'),_0x27f5cf[_0x4d68('0x4e')]);logger[_0x4d68('0x25')](_0x4d68('0x76'),_0x27f5cf[_0x4d68('0x51')]);return _0x27f5cf;});};exports['awsPolly']=function(_0x337bc3,_0x2ccd47,_0x34ec99,_0x4371f5,_0x35d1e1,_0x5a498c){var _0x32d4e7=path[_0x4d68('0x28')](__dirname,_0x4d68('0x29'),rs[_0x4d68('0x2a')](0x4)+_0x4d68('0x39'));var _0x59bcbf;return aws[_0x4d68('0x77')](_0x337bc3,_0x2ccd47,_0x34ec99,_0x4371f5,_0x35d1e1,_0x5a498c,_0x32d4e7)[_0x4d68('0x2d')](function(){_0x59bcbf=path[_0x4d68('0x28')](__dirname,'tmp',rs[_0x4d68('0x2a')](0x4)+_0x4d68('0x3d'));return convertFile(_0x32d4e7,_0x59bcbf);})[_0x4d68('0x2d')](function(){try{fs[_0x4d68('0x1d')](_0x32d4e7);fs[_0x4d68('0x2e')](_0x59bcbf,_0x4d68('0x3c'));}catch(_0x3d8df2){logger['error'](_0x3d8df2);}return _0x59bcbf[_0x4d68('0x2f')]('.')[0x0];});};exports['awsLex']=function(_0x1b37de,_0x29a0c7,_0x5b1e1e,_0xa1058b,_0x3b85ae,_0x49d862){return aws[_0x4d68('0x78')](_0x1b37de,_0x29a0c7,_0x5b1e1e,_0xa1058b,_0x3b85ae,_0x49d862)[_0x4d68('0x2d')](function(_0x432fed){logger[_0x4d68('0x25')](JSON[_0x4d68('0x44')](_0x432fed));return _0x432fed;});};exports[_0x4d68('0x79')]=function(_0x57e580,_0x258a46,_0x17ed92,_0x597323){var _0x4f0dc4=util[_0x4d68('0x7a')](_0x4d68('0x7b'),ISPEECH_API,_0x57e580,encodeURIComponent(_0x258a46),_0x17ed92,_0x597323);var _0x1d9c24=path[_0x4d68('0x28')](__dirname,_0x4d68('0x29'),rs[_0x4d68('0x2a')](0x4)+_0x4d68('0x39'));var _0x5c1724;return downloadFile(_0x4f0dc4,_0x1d9c24)[_0x4d68('0x2d')](function(){_0x5c1724=path[_0x4d68('0x28')](__dirname,_0x4d68('0x29'),rs[_0x4d68('0x2a')](0x4)+'.wav');return convertFile(_0x1d9c24,_0x5c1724);})[_0x4d68('0x2d')](function(){try{fs[_0x4d68('0x1d')](_0x1d9c24);fs[_0x4d68('0x2e')](_0x5c1724,_0x4d68('0x3c'));}catch(_0x5d014f){logger[_0x4d68('0x15')](_0x5d014f);}return _0x5c1724['split']('.')[0x0];});};exports[_0x4d68('0x7c')]=function(_0x3ee03f,_0x7145fa,_0x486bcd,_0x13f33f){var _0x4bc463=util[_0x4d68('0x7a')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x7145fa,_0x486bcd,base64Encode(_0x3ee03f),_0x13f33f?util[_0x4d68('0x7a')](_0x4d68('0x7d'),encodeURIComponent(_0x13f33f)):_0x4d68('0x7e'));return uploadFile(_0x4bc463)[_0x4d68('0x2d')](function(_0x6d497d){return querystring[_0x4d68('0xb')](_0x6d497d);});};exports[_0x4d68('0x7f')]=function(_0xcddef9,_0x1670db){return sestek['nda'](_0xcddef9,_0x1670db)['then'](function(_0x265b0b){logger[_0x4d68('0x25')](JSON[_0x4d68('0x44')](_0x265b0b));var _0x188735={'speech':_0x265b0b[_0x4d68('0x80')],'action':_0x265b0b['channelData']?_0x265b0b[_0x4d68('0x81')][_0x4d68('0x82')]:undefined,'actiondata':_0x265b0b[_0x4d68('0x81')]?_0x265b0b[_0x4d68('0x81')][_0x4d68('0x83')]:undefined};if(_0x265b0b['channelData']&&_0x265b0b[_0x4d68('0x81')][_0x4d68('0x84')]){return base64Decode(_0x265b0b[_0x4d68('0x81')][_0x4d68('0x84')][_0x4d68('0x85')],path[_0x4d68('0x28')](__dirname,_0x4d68('0x29'),rs[_0x4d68('0x2a')](0x4)+_0x4d68('0x3d')))[_0x4d68('0x2d')](function(_0x44f3ce){_0x188735['audiofile']=_0x44f3ce;return _0x188735;});}return _0x188735;});};exports[_0x4d68('0x86')]=function(){return __dirname;}; \ No newline at end of file +var _0x0006=['?key=','input','voice','MP3','text:synthesize','then','.mp3','from','audioContent','writeFile','split','googleTTS','utf8','POST','application/x-www-form-urlencoded','f.req=','jQ1olc','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','goggleTTS\x20path','googleASR','asr','results','alternatives','transcript','map','confidence','join','googleASR\x20confidence','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','endConversation','metadata','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','stringify','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','languageCode','queryText','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','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','sestekNDA','text','channelData','CustomAction','AudioFromTts','dirName','apiai-promise','bluebird','dialogflow','https','md5','path','querystring','request-promise','randomstring','google-tts-api','url','parse','util','./aws','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish','info','close','unlink','pipe','end','data','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','chmodSync','777','readFileSync','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/'];(function(_0x1f4f14,_0x570d4b){var _0x3135b1=function(_0x89b844){while(--_0x89b844){_0x1f4f14['push'](_0x1f4f14['shift']());}};_0x3135b1(++_0x570d4b);}(_0x0006,0xdf));var _0x6000=function(_0x35db8b,_0x5aafdb){_0x35db8b=_0x35db8b-0x0;var _0xf74e7f=_0x0006[_0x35db8b];return _0xf74e7f;};'use strict';var apiai=require(_0x6000('0x0'));var BPromise=require(_0x6000('0x1'));var dialogflow=require(_0x6000('0x2'));var fs=require('fs');var http=require('http');var https=require(_0x6000('0x3'));var md5=require(_0x6000('0x4'));var path=require(_0x6000('0x5'));var querystring=require(_0x6000('0x6'));var rp=require(_0x6000('0x7'));var rs=require(_0x6000('0x8'));var sox=require('sox');var tts=require(_0x6000('0x9'));var urlParse=require(_0x6000('0xa'))[_0x6000('0xb')];var util=require(_0x6000('0xc'));var aws=require(_0x6000('0xd'));var google=require('./google');var sestek=require(_0x6000('0xe'));var tilde=require('./tilde');var logger=require(_0x6000('0xf'))(_0x6000('0x10'));var ISPEECH_API=_0x6000('0x11');function downloadFile(_0x30bfbd,_0x383168){return new BPromise(function(_0xa1831b,_0x250d9e){var _0x50f9ff=urlParse(_0x30bfbd);var _0x458b90=_0x50f9ff[_0x6000('0x12')]===_0x6000('0x13')?https:http;var _0x13e4ee={'host':_0x50f9ff[_0x6000('0x14')],'path':_0x50f9ff[_0x6000('0x5')],'headers':{'user-agent':_0x6000('0x15')}};_0x458b90[_0x6000('0x16')](_0x13e4ee,function(_0x52e916){if(_0x52e916[_0x6000('0x17')]!==0xc8){logger[_0x6000('0x18')](_0x6000('0x19')+_0x30bfbd+_0x6000('0x1a')+_0x52e916[_0x6000('0x17')]+'\x20('+_0x52e916[_0x6000('0x1b')]+')');_0x250d9e(new Error(_0x6000('0x19')+_0x30bfbd+_0x6000('0x1a')+_0x52e916['statusCode']+'\x20('+_0x52e916[_0x6000('0x1b')]+')'));return;}var _0x61633f=fs['createWriteStream'](_0x383168);_0x61633f['on'](_0x6000('0x1c'),function(){logger[_0x6000('0x1d')]('finish\x20download\x20file');_0x61633f[_0x6000('0x1e')](_0xa1831b);});_0x61633f['on'](_0x6000('0x18'),function(_0x5b74fa){fs[_0x6000('0x1f')](_0x383168);logger[_0x6000('0x18')]('download\x20error',_0x5b74fa);_0x250d9e(_0x5b74fa);});_0x52e916[_0x6000('0x20')](_0x61633f);})['on'](_0x6000('0x18'),function(_0x4efa5d){logger[_0x6000('0x18')](_0x4efa5d);_0x250d9e(_0x4efa5d);})[_0x6000('0x21')]();});}function uploadFile(_0x3c945d){return new BPromise(function(_0x4b4d72,_0x292a7d){var _0x57ab5b=urlParse(_0x3c945d);var _0x800eb5=_0x57ab5b[_0x6000('0x12')]===_0x6000('0x13')?https:http;var _0x120c2f={'host':_0x57ab5b['host'],'path':_0x57ab5b[_0x6000('0x5')],'headers':{'user-agent':_0x6000('0x15')}};_0x800eb5[_0x6000('0x16')](_0x120c2f,function(_0x24aad4){if(_0x24aad4[_0x6000('0x17')]!==0xc8){_0x292a7d(new Error(_0x6000('0x19')+_0x3c945d+_0x6000('0x1a')+_0x24aad4[_0x6000('0x17')]+'\x20('+_0x24aad4[_0x6000('0x1b')]+')'));return;}var _0x2788a0='';_0x24aad4['on'](_0x6000('0x22'),function(_0x2b03dc){_0x2788a0+=_0x2b03dc;});_0x24aad4['on'](_0x6000('0x21'),function(){_0x4b4d72(_0x2788a0);});})['on']('error',function(_0x3e70ee){_0x292a7d(_0x3e70ee);})[_0x6000('0x21')]();});}function convertFile(_0x3adc12,_0x25f435){return new BPromise(function(_0x25d15c,_0x569a38){var _0x2611f4=sox[_0x6000('0x23')](_0x3adc12,_0x25f435,{'sampleRate':0x1f40,'format':_0x6000('0x24'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2611f4['on'](_0x6000('0x18'),function(_0x12a867){logger['error'](_0x6000('0x25'),_0x12a867);_0x569a38(_0x12a867);});_0x2611f4['on'](_0x6000('0x21'),function(){logger[_0x6000('0x1d')](_0x6000('0x26'));_0x25d15c();});_0x2611f4[_0x6000('0x27')]();});}function base64Decode(_0x44b64d,_0x47a8cc){var _0x15cfbf=path[_0x6000('0x28')](__dirname,_0x6000('0x29'),rs[_0x6000('0x2a')](0x4)+_0x6000('0x2b'));fs[_0x6000('0x2c')](_0x15cfbf,_0x44b64d,'base64');return convertFile(_0x15cfbf,_0x47a8cc)['then'](function(){try{fs[_0x6000('0x1f')](_0x15cfbf);fs[_0x6000('0x2d')](_0x47a8cc,_0x6000('0x2e'));}catch(_0x34b4e3){logger[_0x6000('0x18')](_0x34b4e3);}return _0x47a8cc['split']('.')[0x0];});}function base64Encode(_0x48188a){var _0x1ee5dc=fs[_0x6000('0x2f')](_0x48188a);return new Buffer(_0x1ee5dc)['toString'](_0x6000('0x30'));}exports[_0x6000('0x31')]=function(_0x3945c6,_0x25ba51,_0x2858a1,_0x20dcb1,_0xf93c4,_0x3b2b47){var _0x1150b2,_0x24b00b;var _0x2ba408=_0x6000('0x32');var _0x21f008=_0x6000('0x33')+_0x3945c6;var _0x399eb5={};if(_0x25ba51==='ssml'){_0x399eb5[_0x6000('0x34')]={'ssml':_0x2858a1};}else{_0x399eb5[_0x6000('0x34')]={'text':_0x2858a1};};_0x399eb5[_0x6000('0x35')]={'languageCode':_0x20dcb1,'ssmlGender':_0xf93c4};_0x399eb5['audioConfig']={'audioEncoding':_0x6000('0x36'),'sampleRateHertz':0x1f40};var _0x3a77b2={'url':_0x2ba408+_0x6000('0x37')+_0x21f008,'method':'POST','json':!![],'body':_0x399eb5};return rp(_0x3a77b2)[_0x6000('0x38')](function(_0x4cb8bc){return new BPromise(function(_0x442226,_0x4ffbf0){_0x1150b2=path[_0x6000('0x28')](__dirname,_0x6000('0x29'),rs['generate'](0x4)+_0x6000('0x39'));var _0x329ec5=Buffer[_0x6000('0x3a')](_0x4cb8bc[_0x6000('0x3b')],_0x6000('0x30'));return fs[_0x6000('0x3c')](_0x1150b2,_0x329ec5,function(_0x5816e1){_0x4ffbf0(_0x5816e1);},function(_0x3bae33){fs[_0x6000('0x2d')](_0x1150b2,_0x6000('0x2e'));_0x442226(_0x3bae33);});});})['then'](function(_0x31eaed){_0x24b00b=path[_0x6000('0x28')](__dirname,_0x6000('0x29'),rs['generate'](0x4)+_0x6000('0x2b'));return convertFile(_0x1150b2,_0x24b00b);})[_0x6000('0x38')](function(){try{fs[_0x6000('0x1f')](_0x1150b2);fs[_0x6000('0x2d')](_0x24b00b,_0x6000('0x2e'));}catch(_0x2c3b18){logger[_0x6000('0x18')](_0x2c3b18);}logger[_0x6000('0x1d')]('googleCloudTTS\x20path',_0x24b00b[_0x6000('0x3d')]('.')[0x0]);return _0x24b00b[_0x6000('0x3d')]('.')[0x0];});};exports[_0x6000('0x3e')]=function(_0x7d134c,_0x2d5745){var _0xaf52b4='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x256a18,_0x36490f;var _0x4b3350;var _0x10b83d={'encoding':_0x6000('0x3f'),'method':_0x6000('0x40'),'timeout':0x2710,'url':_0xaf52b4,'headers':{'Content-Type':_0x6000('0x41')},'body':_0x6000('0x42')+encodeURIComponent(JSON['stringify']([[[_0x6000('0x43'),JSON['stringify']([_0x7d134c,_0x2d5745||'en',![],'null']),null,'generic']]]))};return rp(_0x10b83d)['then'](function(_0x4c53f9){try{_0x4b3350=eval(_0x4c53f9[_0x6000('0x44')](0x5))[0x0][0x2];}catch(_0x4eb65f){throw new Error(_0x6000('0x45')+_0x4c53f9['data']);}if(!_0x4b3350){if(_0x7d134c[_0x6000('0x46')]>0xc8){throw new Error(_0x6000('0x47'));}else{throw new Error(_0x6000('0x48')+_0x2d5745+'\x22\x20might\x20not\x20exist');}}try{_0x4b3350=eval(_0x4b3350)[0x0];}catch(_0x227ff8){throw new Error(_0x6000('0x45')+res[_0x6000('0x22')]);}const _0xfe8cb3=_0x4b3350;_0x256a18=path[_0x6000('0x28')](__dirname,_0x6000('0x29'),rs[_0x6000('0x2a')](0x4)+_0x6000('0x39'));fs[_0x6000('0x2c')](_0x256a18,_0x4b3350,{'encoding':_0x6000('0x30')});_0x36490f=path['resolve'](__dirname,'tmp',rs[_0x6000('0x2a')](0x4)+_0x6000('0x2b'));return convertFile(_0x256a18,_0x36490f);})[_0x6000('0x38')](function(){try{fs[_0x6000('0x1f')](_0x256a18);fs[_0x6000('0x2d')](_0x36490f,_0x6000('0x2e'));}catch(_0x47c69c){logger[_0x6000('0x18')](_0x47c69c);}logger[_0x6000('0x1d')](_0x6000('0x49'),_0x36490f[_0x6000('0x3d')]('.')[0x0]);return _0x36490f[_0x6000('0x3d')]('.')[0x0];});};exports[_0x6000('0x4a')]=function(_0x5e5b66,_0x2a85ba,_0x29ea14){return google[_0x6000('0x4b')](_0x5e5b66,_0x2a85ba,_0x29ea14)[_0x6000('0x38')](function(_0xd3eb5){logger[_0x6000('0x1d')](_0xd3eb5['uri']);return rp(_0xd3eb5);})[_0x6000('0x38')](function(_0x21e75c){var _0x568537='';var _0x714bf0=0x0;try{fs[_0x6000('0x1f')](_0x5e5b66);}catch(_0x339341){logger[_0x6000('0x18')](_0x339341);}if(_0x21e75c&&_0x21e75c[_0x6000('0x4c')]){_0x568537=_0x21e75c[_0x6000('0x4c')]['map'](function(_0x40c5e1){return _0x40c5e1&&_0x40c5e1[_0x6000('0x4d')][0x0]&&_0x40c5e1[_0x6000('0x4d')][0x0][_0x6000('0x4e')]?_0x40c5e1[_0x6000('0x4d')][0x0]['transcript']:'';})['join']('\x0a');_0x714bf0=_0x21e75c['results'][_0x6000('0x4f')](function(_0x1e5d30){return _0x1e5d30&&_0x1e5d30[_0x6000('0x4d')][0x0]&&_0x1e5d30[_0x6000('0x4d')][0x0][_0x6000('0x50')]?_0x1e5d30[_0x6000('0x4d')][0x0][_0x6000('0x50')]:0x0;})[_0x6000('0x51')]('\x0a');}logger[_0x6000('0x1d')]('googleASR\x20transcription',_0x568537);logger[_0x6000('0x1d')](_0x6000('0x52'),_0x714bf0);return{'transcript':_0x568537,'confidence':_0x714bf0};})['catch'](function(_0x3c131a){logger['error'](_0x6000('0x53'),_0x3c131a[_0x6000('0x17')],_0x3c131a[_0x6000('0x54')],_0x3c131a[_0x6000('0x55')]);});};exports[_0x6000('0x56')]=function(_0x626a62,_0x15a7b8,_0x14efe1,_0x3b9856){var _0x26f203=apiai(_0x15a7b8,{'language':_0x3b9856||'en'});return _0x26f203[_0x6000('0x57')](_0x14efe1,{'sessionId':md5(_0x626a62)})[_0x6000('0x38')](function(_0x5cb494){logger[_0x6000('0x1d')](JSON['stringify'](_0x5cb494));return{'source':_0x5cb494[_0x6000('0x58')][_0x6000('0x59')],'resolvedQuery':_0x5cb494[_0x6000('0x58')][_0x6000('0x5a')],'action':_0x5cb494[_0x6000('0x58')][_0x6000('0x5b')],'actionIncomplete':_0x5cb494[_0x6000('0x58')][_0x6000('0x5c')],'speech':_0x5cb494[_0x6000('0x58')][_0x6000('0x5d')][_0x6000('0x5e')],'score':_0x5cb494[_0x6000('0x58')][_0x6000('0x5f')],'statusCode':_0x5cb494[_0x6000('0x60')]['code'],'endConversation':_0x5cb494['result']['metadata'][_0x6000('0x61')]||![],'isFallbackIntent':_0x5cb494[_0x6000('0x58')][_0x6000('0x62')][_0x6000('0x63')]};});};exports[_0x6000('0x64')]=function(_0x5b886f,_0x499c79,_0x3daafc,_0x36219b,_0x1f96f5,_0x34fb2b){var _0x122757=_0x36219b[_0x6000('0x65')](/\\n/g,'\x0a');var _0x4c7b4e={'credentials':{'private_key':_0x122757,'client_email':_0x3daafc}};var _0x21eae2=new dialogflow[(_0x6000('0x66'))](_0x4c7b4e);var _0xaec5bd=_0x21eae2[_0x6000('0x67')](_0x499c79,md5(_0x5b886f));var _0x7fbb2b={'session':_0xaec5bd,'queryInput':{'text':{'text':_0x1f96f5,'languageCode':_0x34fb2b}}};return _0x21eae2[_0x6000('0x68')](_0x7fbb2b)[_0x6000('0x38')](function(_0x1320f1){if(_0x1320f1&&_0x1320f1[_0x6000('0x46')]){logger[_0x6000('0x1d')](_0x6000('0x69'),JSON[_0x6000('0x6a')](_0x1320f1));var _0xa91033=_0x1320f1[0x0];if(_0xa91033){var _0x1cf667={'action':_0xa91033[_0x6000('0x6b')]['action'],'allRequiredParamsPresent':_0xa91033['queryResult'][_0x6000('0x6c')],'endConversation':_0xa91033[_0x6000('0x6b')]['diagnosticInfo']&&_0xa91033[_0x6000('0x6b')][_0x6000('0x6d')]['fields']?_0xa91033[_0x6000('0x6b')][_0x6000('0x6d')][_0x6000('0x6e')][_0x6000('0x6f')][_0x6000('0x70')]:![],'fulfillmentText':_0xa91033['queryResult'][_0x6000('0x71')],'intentName':_0xa91033[_0x6000('0x6b')]['intent'][_0x6000('0x54')],'intentDisplayName':_0xa91033[_0x6000('0x6b')][_0x6000('0x72')][_0x6000('0x73')],'isFallbackIntent':_0xa91033['queryResult'][_0x6000('0x72')]['isFallback'],'languageCode':_0xa91033['queryResult'][_0x6000('0x74')],'queryText':_0xa91033[_0x6000('0x6b')][_0x6000('0x75')],'responseId':_0xa91033['responseId'],'score':_0xa91033[_0x6000('0x6b')][_0x6000('0x76')],'speech':_0xa91033[_0x6000('0x6b')][_0x6000('0x71')],'providerResponse':JSON['stringify'](_0x1320f1)};return _0x1cf667;}}});};exports[_0x6000('0x77')]=function(_0x2973fc,_0x41faa6,_0x5ef752,_0x20f4af){return tilde[_0x6000('0x4b')](_0x2973fc,_0x41faa6,_0x5ef752,_0x20f4af)[_0x6000('0x38')](function(_0x3e655f){try{fs[_0x6000('0x1f')](_0x2973fc);}catch(_0x12563e){logger[_0x6000('0x18')](_0x12563e);}logger[_0x6000('0x1d')]('Tilde\x20ASR\x20transcription',_0x3e655f[_0x6000('0x4e')]);logger['info'](_0x6000('0x78'),_0x3e655f[_0x6000('0x50')]);return _0x3e655f;});};exports[_0x6000('0x79')]=function(_0x3da29c,_0x36c5ba,_0x63d292,_0x672224,_0x52e449,_0x1d675e){var _0x44c7ff=path[_0x6000('0x28')](__dirname,'tmp',rs[_0x6000('0x2a')](0x4)+'.mp3');var _0x1307da;return aws[_0x6000('0x7a')](_0x3da29c,_0x36c5ba,_0x63d292,_0x672224,_0x52e449,_0x1d675e,_0x44c7ff)[_0x6000('0x38')](function(){_0x1307da=path[_0x6000('0x28')](__dirname,_0x6000('0x29'),rs[_0x6000('0x2a')](0x4)+_0x6000('0x2b'));return convertFile(_0x44c7ff,_0x1307da);})[_0x6000('0x38')](function(){try{fs[_0x6000('0x1f')](_0x44c7ff);fs[_0x6000('0x2d')](_0x1307da,'777');}catch(_0x4b870b){logger[_0x6000('0x18')](_0x4b870b);}return _0x1307da[_0x6000('0x3d')]('.')[0x0];});};exports[_0x6000('0x7b')]=function(_0x35eafe,_0x2d1f69,_0x46a2f0,_0x398fef,_0x54f77d,_0x2cf5d8){return aws[_0x6000('0x7c')](_0x35eafe,_0x2d1f69,_0x46a2f0,_0x398fef,_0x54f77d,_0x2cf5d8)[_0x6000('0x38')](function(_0x4bd0f1){logger['info'](JSON[_0x6000('0x6a')](_0x4bd0f1));return _0x4bd0f1;});};exports[_0x6000('0x7d')]=function(_0x376323,_0x31bcc2,_0x5931cc,_0xccb8b1){var _0x4d85d9=util[_0x6000('0x7e')](_0x6000('0x7f'),ISPEECH_API,_0x376323,encodeURIComponent(_0x31bcc2),_0x5931cc,_0xccb8b1);var _0x5106a6=path['resolve'](__dirname,_0x6000('0x29'),rs[_0x6000('0x2a')](0x4)+_0x6000('0x39'));var _0x40feef;return downloadFile(_0x4d85d9,_0x5106a6)[_0x6000('0x38')](function(){_0x40feef=path['resolve'](__dirname,_0x6000('0x29'),rs['generate'](0x4)+_0x6000('0x2b'));return convertFile(_0x5106a6,_0x40feef);})[_0x6000('0x38')](function(){try{fs['unlink'](_0x5106a6);fs['chmodSync'](_0x40feef,_0x6000('0x2e'));}catch(_0x4b689c){logger[_0x6000('0x18')](_0x4b689c);}return _0x40feef[_0x6000('0x3d')]('.')[0x0];});};exports[_0x6000('0x80')]=function(_0x2a5500,_0x57d412,_0x16a2bf,_0xdb0a01){var _0x19aa61=util[_0x6000('0x7e')](_0x6000('0x81'),ISPEECH_API,_0x57d412,_0x16a2bf,base64Encode(_0x2a5500),_0xdb0a01?util['format'](_0x6000('0x82'),encodeURIComponent(_0xdb0a01)):'freeform=3');return uploadFile(_0x19aa61)['then'](function(_0x2a9238){return querystring[_0x6000('0xb')](_0x2a9238);});};exports[_0x6000('0x83')]=function(_0x2875d2,_0xe46edc){return sestek['nda'](_0x2875d2,_0xe46edc)[_0x6000('0x38')](function(_0x1f6bc8){logger['info'](JSON[_0x6000('0x6a')](_0x1f6bc8));var _0x33acfc={'speech':_0x1f6bc8[_0x6000('0x84')],'action':_0x1f6bc8[_0x6000('0x85')]?_0x1f6bc8[_0x6000('0x85')][_0x6000('0x86')]:undefined,'actiondata':_0x1f6bc8[_0x6000('0x85')]?_0x1f6bc8['channelData']['CustomActionData']:undefined};if(_0x1f6bc8[_0x6000('0x85')]&&_0x1f6bc8[_0x6000('0x85')][_0x6000('0x87')]){return base64Decode(_0x1f6bc8['channelData'][_0x6000('0x87')]['Data'],path['resolve'](__dirname,'tmp',rs[_0x6000('0x2a')](0x4)+'.wav'))[_0x6000('0x38')](function(_0x4584bb){_0x33acfc['audiofile']=_0x4584bb;return _0x33acfc;});}return _0x33acfc;});};exports[_0x6000('0x88')]=function(){return __dirname;}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/index.js b/server/services/agi/scripts/sestek/index.js index b27d840..917ead6 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 _0x3f90=['exports','./nda'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x3f90,0x15b));var _0x03f9=function(_0x218524,_0x1a4f4f){_0x218524=_0x218524-0x0;var _0xb53062=_0x3f90[_0x218524];return _0xb53062;};var nda=require(_0x03f9('0x0'));module[_0x03f9('0x1')]={'nda':nda}; \ No newline at end of file +var _0x4a40=['exports','./nda'];(function(_0x6bbb78,_0x3a3015){var _0x2d37b9=function(_0x24212d){while(--_0x24212d){_0x6bbb78['push'](_0x6bbb78['shift']());}};_0x2d37b9(++_0x3a3015);}(_0x4a40,0xeb));var _0x04a4=function(_0x171945,_0xd87274){_0x171945=_0x171945-0x0;var _0x2d73e6=_0x4a40[_0x171945];return _0x2d73e6;};var nda=require(_0x04a4('0x0'));module[_0x04a4('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 59ba364..1b149bc 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 _0x9348=['POST','message','uniqueid','callerid','calleridname','dnid','extension','text','Bearer\x20','access_token','body','channelData','ProjectName','project','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','request-promise','url','../../../../../config/logger','agi','exports','resolve','ndauth_url','/token','password','username'];(function(_0x57cbfb,_0x2de760){var _0x4cb933=function(_0x33cf6a){while(--_0x33cf6a){_0x57cbfb['push'](_0x57cbfb['shift']());}};_0x4cb933(++_0x2de760);}(_0x9348,0x10d));var _0x8934=function(_0x3586ef,_0x50ad8a){_0x3586ef=_0x3586ef-0x0;var _0x36632e=_0x9348[_0x3586ef];return _0x36632e;};'use strict';var rp=require(_0x8934('0x0'));var url=require(_0x8934('0x1'));var logger=require(_0x8934('0x2'))(_0x8934('0x3'));module[_0x8934('0x4')]=function(_0x4a2577,_0x34d032){var _0x35da0b={'method':'POST','uri':url[_0x8934('0x5')](_0x34d032[_0x8934('0x6')],_0x8934('0x7')),'form':{'grant_type':_0x8934('0x8'),'username':_0x34d032[_0x8934('0x9')],'password':_0x34d032[_0x8934('0x8')]},'json':!![]};return rp(_0x35da0b)['then'](function(_0x284a62){var _0x3734c5={'method':_0x8934('0xa'),'uri':url['resolve'](_0x34d032['ndassistant_url'],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x34d032['ndaactivity_type']||_0x8934('0xb'),'channelId':'Nda','conversation':{'id':_0x4a2577[_0x8934('0xc')]},'from':{'id':_0x4a2577[_0x8934('0xd')],'name':_0x4a2577[_0x8934('0xe')]},'recipient':{'id':_0x4a2577[_0x8934('0xf')],'name':_0x4a2577[_0x8934('0x10')]},'text':_0x34d032[_0x8934('0x11')],'channelData':{}},'headers':{'Authorization':_0x8934('0x12')+_0x284a62[_0x8934('0x13')]},'json':!![]};if(_0x34d032['project']){_0x3734c5[_0x8934('0x14')][_0x8934('0x15')][_0x8934('0x16')]=_0x34d032[_0x8934('0x17')];}if(_0x34d032[_0x8934('0x18')]=='1'){_0x3734c5[_0x8934('0x14')]['channelData'][_0x8934('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x8934('0x1a')};}if(_0x34d032[_0x8934('0x1b')]){_0x3734c5[_0x8934('0x14')][_0x8934('0x15')][_0x8934('0x1c')]=_0x34d032[_0x8934('0x1b')];if(_0x34d032[_0x8934('0x1d')]){_0x3734c5['body'][_0x8934('0x15')][_0x8934('0x1e')]=_0x34d032[_0x8934('0x1d')];}}logger['info'](JSON['stringify'](_0x3734c5));return rp(_0x3734c5);});}; \ No newline at end of file +var _0x0565=['resolve','/token','password','username','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','callerid','calleridname','dnid','Bearer\x20','channelData','project','ndagenerate_audio','body','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x0565,0xf2));var _0x5056=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x0565[_0x45783c];return _0x1161da;};'use strict';var rp=require(_0x5056('0x0'));var url=require(_0x5056('0x1'));var logger=require(_0x5056('0x2'))(_0x5056('0x3'));module[_0x5056('0x4')]=function(_0x397289,_0xd4624d){var _0x300055={'method':_0x5056('0x5'),'uri':url[_0x5056('0x6')](_0xd4624d['ndauth_url'],_0x5056('0x7')),'form':{'grant_type':_0x5056('0x8'),'username':_0xd4624d[_0x5056('0x9')],'password':_0xd4624d[_0x5056('0x8')]},'json':!![]};return rp(_0x300055)['then'](function(_0x52b01f){var _0x38f74={'method':_0x5056('0x5'),'uri':url[_0x5056('0x6')](_0xd4624d[_0x5056('0xa')],_0x5056('0xb')),'body':{'type':_0xd4624d[_0x5056('0xc')]||_0x5056('0xd'),'channelId':_0x5056('0xe'),'conversation':{'id':_0x397289['uniqueid']},'from':{'id':_0x397289[_0x5056('0xf')],'name':_0x397289[_0x5056('0x10')]},'recipient':{'id':_0x397289[_0x5056('0x11')],'name':_0x397289['extension']},'text':_0xd4624d['text'],'channelData':{}},'headers':{'Authorization':_0x5056('0x12')+_0x52b01f['access_token']},'json':!![]};if(_0xd4624d['project']){_0x38f74['body'][_0x5056('0x13')]['ProjectName']=_0xd4624d[_0x5056('0x14')];}if(_0xd4624d[_0x5056('0x15')]=='1'){_0x38f74[_0x5056('0x16')]['channelData'][_0x5056('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x5056('0x18')};}if(_0xd4624d[_0x5056('0x19')]){_0x38f74[_0x5056('0x16')][_0x5056('0x13')][_0x5056('0x1a')]=_0xd4624d['custom_action'];if(_0xd4624d[_0x5056('0x1b')]){_0x38f74['body'][_0x5056('0x13')][_0x5056('0x1c')]=_0xd4624d[_0x5056('0x1b')];}}logger[_0x5056('0x1d')](JSON[_0x5056('0x1e')](_0x38f74));return rp(_0x38f74);});}; \ 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 ff24a23..c68e4c3 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. * // * * // ************************************************************************* -'use strict';var asr=require('./lib/api');module['exports']=function(_0x1d9bf6,_0x484c84,_0x3dc235,_0x4ca4eb){return asr(_0x1d9bf6,_0x484c84,_0x3dc235,_0x4ca4eb);}; \ No newline at end of file +var _0x709b=['./lib/api','exports'];(function(_0x609988,_0x507944){var _0x159984=function(_0x39d9ce){while(--_0x39d9ce){_0x609988['push'](_0x609988['shift']());}};_0x159984(++_0x507944);}(_0x709b,0x1ea));var _0xb709=function(_0x4f030a,_0x2e4618){_0x4f030a=_0x4f030a-0x0;var _0x45ce23=_0x709b[_0x4f030a];return _0x45ce23;};'use strict';var asr=require(_0xb709('0x0'));module[_0xb709('0x1')]=function(_0x47f7ff,_0x1a27b1,_0x2e5874,_0x6d0445){return asr(_0x47f7ff,_0x1a27b1,_0x2e5874,_0x6d0445);}; \ 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 36836ac..6b0b18c 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 _0xa8da=['Error\x20Tilde\x20ASR\x20socket','isNil','isObject','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','update','send','stringify','createReadStream','data','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Close\x20Tilde\x20ASR\x20socket'];(function(_0x247c79,_0x1c7ff1){var _0x43365b=function(_0x2c1c6d){while(--_0x2c1c6d){_0x247c79['push'](_0x247c79['shift']());}};_0x43365b(++_0x1c7ff1);}(_0xa8da,0x1a8));var _0xaa8d=function(_0x269a8e,_0x2080ae){_0x269a8e=_0x269a8e-0x0;var _0x21a45d=_0xa8da[_0x269a8e];return _0x21a45d;};'use strict';var BPromise=require(_0xaa8d('0x0'));var _=require(_0xaa8d('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xaa8d('0x2'));var crypto=require(_0xaa8d('0x3'));var logger=require(_0xaa8d('0x4'))(_0xaa8d('0x5'));module[_0xaa8d('0x6')]=function(_0x465e7d,_0x3e248a,_0x2f92a8,_0x4ee56b){return new BPromise(function(_0x4fdae7,_0x519330){logger[_0xaa8d('0x7')]('Tilde\x20URI',_0x4ee56b||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x2a9a49=new WebSocket(_0x4ee56b||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x152647='';var _0x20765a='0';var _0x232e35='1';var _0x2f15de=_0xaa8d('0x8');function _0x20e5d0(_0x271ecb){var _0x180884=crypto[_0xaa8d('0x9')]('sha1');_0x180884[_0xaa8d('0xa')](_0x271ecb);return _0x180884['digest']('hex');}function _0x485a6d(){try{logger[_0xaa8d('0x7')]('Open\x20Tilde\x20ASR\x20socket');var _0x1954f8=moment()['unix']();var _0x412452=_0x20e5d0(_0x1954f8+_0x3e248a+_0x2f92a8);_0x2a9a49[_0xaa8d('0xb')](JSON[_0xaa8d('0xc')]({'appID':_0x3e248a,'timestamp':_0x1954f8,'appKey':_0x412452}));var _0x58b9e6=fs[_0xaa8d('0xd')](_0x465e7d);_0x58b9e6['on'](_0xaa8d('0xe'),function(_0x2e1b3){_0x2a9a49['send'](_0x2e1b3);});_0x58b9e6['on']('close',function(){_0x2a9a49['send'](_0xaa8d('0xf'));});}catch(_0x30714b){logger[_0xaa8d('0x10')](_0xaa8d('0x11'),JSON[_0xaa8d('0xc')](_0x30714b));_0x2a9a49[_0xaa8d('0x12')]();}}function _0x55515d(_0x2a6fa2){try{if(_0x2a6fa2){var _0x101a3b=JSON[_0xaa8d('0x13')](_0x2a6fa2);switch(_0x101a3b[_0xaa8d('0x14')]){case 0x0:if(_0x101a3b[_0xaa8d('0x15')]){if(_0x101a3b[_0xaa8d('0x15')][_0xaa8d('0x16')]){logger[_0xaa8d('0x7')](_0xaa8d('0x17'),JSON[_0xaa8d('0xc')](_0x101a3b['result'][_0xaa8d('0x18')]));_0x152647=_0x101a3b[_0xaa8d('0x15')][_0xaa8d('0x18')][0x0]['transcript'];_0x20765a=_0x101a3b[_0xaa8d('0x15')][_0xaa8d('0x18')][0x0]['likelihood'];_0x232e35='0';_0x2f15de=_0xaa8d('0x19');_0x2a9a49[_0xaa8d('0x12')]();}}break;case 0x1:logger[_0xaa8d('0x7')](_0xaa8d('0x8'));_0x232e35='1';_0x2f15de=_0xaa8d('0x8');break;case 0x2:logger[_0xaa8d('0x7')](_0xaa8d('0x1a'));_0x232e35='2';_0x2f15de=_0xaa8d('0x1a');break;case 0x9:logger[_0xaa8d('0x7')](_0xaa8d('0x1b'));_0x232e35='9';_0x2f15de=_0xaa8d('0x1b');break;case 0xa:logger[_0xaa8d('0x7')](_0xaa8d('0x1c'));_0x232e35='10';_0x2f15de=_0xaa8d('0x1c');break;case 0xb:logger['info'](_0xaa8d('0x1d'));_0x232e35='11';_0x2f15de=_0xaa8d('0x1d');}}}catch(_0x451b15){logger['error']('Tilde\x20ASR\x20parse\x20error',JSON[_0xaa8d('0xc')](_0x451b15));_0x2a9a49[_0xaa8d('0x12')]();}}function _0x140ac9(){logger['info'](_0xaa8d('0x1e'));_0x4fdae7({'transcript':_0x152647,'confidence':_0x20765a,'status':_0x232e35,'status_message':_0x2f15de});}function _0x1dc47c(_0xe30a38){logger[_0xaa8d('0x10')](_0xaa8d('0x1f'));if(!_[_0xaa8d('0x20')](_0xe30a38)){logger['error'](_[_0xaa8d('0x21')](_0xe30a38)?JSON['stringify'](_0xe30a38):_0xe30a38);}}_0x2a9a49['on']('open',_0x485a6d);_0x2a9a49['on'](_0xaa8d('0x22'),_0x55515d);_0x2a9a49['on']('close',_0x140ac9);_0x2a9a49['on'](_0xaa8d('0x10'),_0x1dc47c);});}; \ No newline at end of file +var _0x8cf7=['close','bluebird','lodash','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','sha1','update','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','data','EOS','error','terminate','parse','result','final','Tilde\x20ASR\x20hypoteses','likelihood','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x8cf7,0xcd));var _0x78cf=function(_0x14af04,_0x5ab6c4){_0x14af04=_0x14af04-0x0;var _0x44cb0a=_0x8cf7[_0x14af04];return _0x44cb0a;};'use strict';var BPromise=require(_0x78cf('0x0'));var _=require(_0x78cf('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require('crypto');var logger=require('../../../../../../config/logger')('agi');module[_0x78cf('0x2')]=function(_0x48e53c,_0x4e2008,_0x44d107,_0x2f0985){return new BPromise(function(_0x1f77b7,_0x15da71){logger[_0x78cf('0x3')](_0x78cf('0x4'),_0x2f0985||_0x78cf('0x5'));var _0x3460d1=new WebSocket(_0x2f0985||_0x78cf('0x5'),{'perMessageDeflate':![]});var _0xa576e3='';var _0x3dfbbb='0';var _0x2e02d5='1';var _0x3f8915='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x5b8d54(_0x4bd14a){var _0x1aa602=crypto['createHash'](_0x78cf('0x6'));_0x1aa602[_0x78cf('0x7')](_0x4bd14a);return _0x1aa602['digest'](_0x78cf('0x8'));}function _0x312ffd(){try{logger[_0x78cf('0x3')](_0x78cf('0x9'));var _0xb63345=moment()[_0x78cf('0xa')]();var _0xe70cf2=_0x5b8d54(_0xb63345+_0x4e2008+_0x44d107);_0x3460d1[_0x78cf('0xb')](JSON[_0x78cf('0xc')]({'appID':_0x4e2008,'timestamp':_0xb63345,'appKey':_0xe70cf2}));var _0x5ff9b8=fs['createReadStream'](_0x48e53c);_0x5ff9b8['on'](_0x78cf('0xd'),function(_0x248f38){_0x3460d1['send'](_0x248f38);});_0x5ff9b8['on']('close',function(){_0x3460d1[_0x78cf('0xb')](_0x78cf('0xe'));});}catch(_0xe9e089){logger[_0x78cf('0xf')]('Tilde\x20ASR\x20send\x20error',JSON['stringify'](_0xe9e089));_0x3460d1[_0x78cf('0x10')]();}}function _0x4176a1(_0x8a3c76){try{if(_0x8a3c76){var _0x54196e=JSON[_0x78cf('0x11')](_0x8a3c76);switch(_0x54196e['status']){case 0x0:if(_0x54196e[_0x78cf('0x12')]){if(_0x54196e['result'][_0x78cf('0x13')]){logger[_0x78cf('0x3')](_0x78cf('0x14'),JSON[_0x78cf('0xc')](_0x54196e[_0x78cf('0x12')]['hypotheses']));_0xa576e3=_0x54196e['result']['hypotheses'][0x0]['transcript'];_0x3dfbbb=_0x54196e[_0x78cf('0x12')]['hypotheses'][0x0][_0x78cf('0x15')];_0x2e02d5='0';_0x3f8915='Success.';_0x3460d1[_0x78cf('0x10')]();}}break;case 0x1:logger[_0x78cf('0x3')](_0x78cf('0x16'));_0x2e02d5='1';_0x3f8915=_0x78cf('0x16');break;case 0x2:logger[_0x78cf('0x3')](_0x78cf('0x17'));_0x2e02d5='2';_0x3f8915='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x78cf('0x3')](_0x78cf('0x18'));_0x2e02d5='9';_0x3f8915=_0x78cf('0x18');break;case 0xa:logger[_0x78cf('0x3')](_0x78cf('0x19'));_0x2e02d5='10';_0x3f8915='Authentication\x20failed.';break;case 0xb:logger[_0x78cf('0x3')](_0x78cf('0x1a'));_0x2e02d5='11';_0x3f8915=_0x78cf('0x1a');}}}catch(_0x1a37e3){logger['error'](_0x78cf('0x1b'),JSON[_0x78cf('0xc')](_0x1a37e3));_0x3460d1[_0x78cf('0x10')]();}}function _0x585462(){logger[_0x78cf('0x3')]('Close\x20Tilde\x20ASR\x20socket');_0x1f77b7({'transcript':_0xa576e3,'confidence':_0x3dfbbb,'status':_0x2e02d5,'status_message':_0x3f8915});}function _0xf3b221(_0x10ab05){logger[_0x78cf('0xf')](_0x78cf('0x1c'));if(!_[_0x78cf('0x1d')](_0x10ab05)){logger[_0x78cf('0xf')](_[_0x78cf('0x1e')](_0x10ab05)?JSON[_0x78cf('0xc')](_0x10ab05):_0x10ab05);}}_0x3460d1['on'](_0x78cf('0x1f'),_0x312ffd);_0x3460d1['on'](_0x78cf('0x20'),_0x4176a1);_0x3460d1['on'](_0x78cf('0x21'),_0x585462);_0x3460d1['on']('error',_0xf3b221);});}; \ 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 c7b86d8..944e16c 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 _0xaf06=['exports'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xaf06,0xbf));var _0x6af0=function(_0x296079,_0x14e860){_0x296079=_0x296079-0x0;var _0x268dda=_0xaf06[_0x296079];return _0x268dda;};var asr=require('./asr');module[_0x6af0('0x0')]={'asr':asr}; \ No newline at end of file +var _0x8e30=['exports','./asr'];(function(_0x57cc22,_0x2d351f){var _0x6f7bdc=function(_0x4935b5){while(--_0x4935b5){_0x57cc22['push'](_0x57cc22['shift']());}};_0x6f7bdc(++_0x2d351f);}(_0x8e30,0x113));var _0x08e3=function(_0x4d15e8,_0x32386e){_0x4d15e8=_0x4d15e8-0x0;var _0x10e13b=_0x8e30[_0x4d15e8];return _0x10e13b;};var asr=require(_0x08e3('0x0'));module[_0x08e3('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index dd1f98a..50be61d 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 _0x5308=['E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','events','EventEmitter','./error','./channel','127.0.0.1','call','error','createServer','listen','listening','emit','connection','getConnections','E_AGI_SERVER_ERROR','destroy','ready','code','close'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0x5308,0x77));var _0x8530=function(_0x3b9d5f,_0x2e9039){_0x3b9d5f=_0x3b9d5f-0x0;var _0x39924e=_0x5308[_0x3b9d5f];return _0x39924e;};'use strict';var util=require(_0x8530('0x0'));var net=require('net');var EventEmitter=require(_0x8530('0x1'))[_0x8530('0x2')];var AGIError=require(_0x8530('0x3'));var AGIChannel=require(_0x8530('0x4'));var AGIServer=function(_0x31d810,_0x4de5f9,_0x4d6d3d){var _0x1eb13f=this,_0x31d810=_0x31d810||0x11dd,_0x4de5f9=_0x4de5f9||_0x8530('0x5'),_0x4325bf=null,_0x1bb655=0x0;EventEmitter[_0x8530('0x6')](_0x1eb13f);function _0x3aff34(){if(!_0x31d810){_0x1eb13f['emit'](_0x8530('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x4325bf=net[_0x8530('0x8')]();_0x4325bf[_0x8530('0x9')](_0x31d810,_0x4de5f9);_0x4325bf['on'](_0x8530('0xa'),function(){_0x1eb13f[_0x8530('0xb')]('listening');});_0x4325bf['on'](_0x8530('0xc'),function(_0x182a68){_0x4325bf[_0x8530('0xd')](function(_0x1534f3,_0x35c1eb){if(_0x1534f3){_0x1eb13f[_0x8530('0xb')](_0x8530('0x7'),new AGIError(_0x8530('0xe'),_0x1534f3));}else if(_0x4d6d3d&&_0x4d6d3d<0x0){_0x1eb13f[_0x8530('0xb')](_0x8530('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x182a68[_0x8530('0xf')]();}else if(_0x4d6d3d&&_0x4d6d3d>0x0&&_0x4d6d3d<_0x35c1eb){_0x1bb655+=0x1;_0x1eb13f[_0x8530('0xb')]('error',new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x1bb655));_0x182a68[_0x8530('0xf')]();}else{var _0xe817f=new AGIChannel(_0x182a68);_0xe817f['on'](_0x8530('0x10'),function(){_0x1eb13f[_0x8530('0xb')](_0x8530('0xc'),_0xe817f);});}});});_0x4325bf['on'](_0x8530('0x7'),function(_0x3e5f67){_0x1eb13f[_0x8530('0xb')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x3e5f67[_0x8530('0x11')]));});_0x4325bf['on']('close',function(){_0x1eb13f['emit'](_0x8530('0x12'),new AGIError(_0x8530('0x13')));});}process[_0x8530('0x14')](function(){_0x3aff34();});};util[_0x8530('0x15')](AGIServer,EventEmitter);module[_0x8530('0x16')]=function(_0x30cc33,_0x3da58b,_0x4abc8f){return new AGIServer(_0x30cc33,_0x3da58b,_0x4abc8f);}; \ No newline at end of file +var _0xf5c3=['EventEmitter','./error','./channel','127.0.0.1','call','error','createServer','listen','listening','connection','getConnections','emit','E_AGI_SERVER_VOICE_DISABLED','destroy','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','events'];(function(_0x3f7869,_0x19a57f){var _0x4c5697=function(_0xbf3dee){while(--_0xbf3dee){_0x3f7869['push'](_0x3f7869['shift']());}};_0x4c5697(++_0x19a57f);}(_0xf5c3,0x88));var _0x3f5c=function(_0xffa747,_0x525550){_0xffa747=_0xffa747-0x0;var _0x4a5607=_0xf5c3[_0xffa747];return _0x4a5607;};'use strict';var util=require(_0x3f5c('0x0'));var net=require('net');var EventEmitter=require(_0x3f5c('0x1'))[_0x3f5c('0x2')];var AGIError=require(_0x3f5c('0x3'));var AGIChannel=require(_0x3f5c('0x4'));var AGIServer=function(_0x3ab6ab,_0x4f1510,_0x2e5d7c){var _0x2cd151=this,_0x3ab6ab=_0x3ab6ab||0x11dd,_0x4f1510=_0x4f1510||_0x3f5c('0x5'),_0x3ec722=null,_0xc210f7=0x0;EventEmitter[_0x3f5c('0x6')](_0x2cd151);function _0x3fa9c4(){if(!_0x3ab6ab){_0x2cd151['emit'](_0x3f5c('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x3ec722=net[_0x3f5c('0x8')]();_0x3ec722[_0x3f5c('0x9')](_0x3ab6ab,_0x4f1510);_0x3ec722['on'](_0x3f5c('0xa'),function(){_0x2cd151['emit'](_0x3f5c('0xa'));});_0x3ec722['on'](_0x3f5c('0xb'),function(_0x3419b3){_0x3ec722[_0x3f5c('0xc')](function(_0xf288e7,_0x10130d){if(_0xf288e7){_0x2cd151[_0x3f5c('0xd')](_0x3f5c('0x7'),new AGIError('E_AGI_SERVER_ERROR',_0xf288e7));}else if(_0x2e5d7c&&_0x2e5d7c<0x0){_0x2cd151[_0x3f5c('0xd')]('error',new AGIError(_0x3f5c('0xe')));_0x3419b3[_0x3f5c('0xf')]();}else if(_0x2e5d7c&&_0x2e5d7c>0x0&&_0x2e5d7c<_0x10130d){_0xc210f7+=0x1;_0x2cd151[_0x3f5c('0xd')](_0x3f5c('0x7'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0xc210f7));_0x3419b3['destroy']();}else{var _0x38a2e5=new AGIChannel(_0x3419b3);_0x38a2e5['on'](_0x3f5c('0x10'),function(){_0x2cd151[_0x3f5c('0xd')](_0x3f5c('0xb'),_0x38a2e5);});}});});_0x3ec722['on'](_0x3f5c('0x7'),function(_0x1d21d8){_0x2cd151['emit'](_0x3f5c('0x7'),new AGIError('E_AGI_SERVER_ERROR',_0x1d21d8[_0x3f5c('0x11')]));});_0x3ec722['on'](_0x3f5c('0x12'),function(){_0x2cd151[_0x3f5c('0xd')](_0x3f5c('0x12'),new AGIError(_0x3f5c('0x13')));});}process[_0x3f5c('0x14')](function(){_0x3fa9c4();});};util[_0x3f5c('0x15')](AGIServer,EventEmitter);module[_0x3f5c('0x16')]=function(_0x4ca8fb,_0x33bfc2,_0x3902e3){return new AGIServer(_0x4ca8fb,_0x33bfc2,_0x3902e3);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 76900fe..57bba46 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 _0x8f6f=['sendMailMessage','mailRpc','getIntervals','getIntervalById','interval','map','Intervals','getQueryOdbc','open','error','ODBC\x20connection\x20successfully','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','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','toString','getPause','agentPause','agent','agentUnpause','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','googleTTS','google_tts_language','restAPI','timeout','number','includes','POST','method','body','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','statusMessage','statusCode','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','speed','ispeechASR','key','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','awsLex','aws_bot_name','googleASR','tildeASR','clear','clone','hasOwnProperty','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','saveRestApiResult','format','%s.%s','length','split','getVariable','result','extra','setVariable','retry','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','exec','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','grammar','no\x20grammar\x20configured','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','getAndSetVariable','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','agi','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Wait\x20%s\x20seconds\x20before\x20answer','wait','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','delay','minutes','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','MRCPRecog','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','query','no\x20query\x20configured','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','sip_id','no\x20user\x20selected','DIAL','SIP/%s','opts','url','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','no\x20private_key\x20configured','no\x20anguage\x20configured','bot','Trying\x20DialogflowV2:\x20%s','providerResponse','out','dialogflowV2','DialogflowV2\x20Result\x20%s','speech','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','streamFile','unlink','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','Executed\x20command\x20%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','getSound','no\x20file\x20audio\x20found','getData','response','maxdigit','mindigit','no\x20variable\x20found','hiddendigitsnum','first','substr','generate','getsecretdigits','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','awspolly','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','.wav','aws\x20Polly\x20is\x20unreachable','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','isString','AWS_LEX_%s','message','amazonlex','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','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appid\x20configured','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','condition','false','gotoiftime','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','true','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','NOBEEP','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','agentLogout','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','digit','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','Smtp','no\x20mail\x20account\x20found','email','bcc','service','host','port','secure','authentication','auth','user','pass','template_id','Trying\x20SendMail\x20with\x20account\x20%s','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','join','exports','path','util','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','channel','rpc','getVariableById','then','name','prototype','getVoiceQueue','getSquareProject','catch','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSoundById','getSoundPath','save_name'];(function(_0x5c6a1a,_0x407cd9){var _0x3e2f16=function(_0x3eba39){while(--_0x3eba39){_0x5c6a1a['push'](_0x5c6a1a['shift']());}};_0x3e2f16(++_0x407cd9);}(_0x8f6f,0x1a9));var _0xf8f6=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x8f6f[_0x9aada2];return _0x196dff;};'use strict';var fs=require('fs');var path=require(_0xf8f6('0x0'));var util=require(_0xf8f6('0x1'));var _=require(_0xf8f6('0x2'));var sh=require(_0xf8f6('0x3'));var odbc=require(_0xf8f6('0x4'))();var rs=require(_0xf8f6('0x5'));var moment=require(_0xf8f6('0x6'));var Mustache=require(_0xf8f6('0x7'));var rp=require(_0xf8f6('0x8'));var logger=require(_0xf8f6('0x9'))('agi');var config=require(_0xf8f6('0xa'));var scripts=require(_0xf8f6('0xb'));var FILES_PATH=_0xf8f6('0xc');var recursiveMapAttributes=[_0xf8f6('0xd'),_0xf8f6('0xe')];var verticesWithRetry=[_0xf8f6('0xf'),_0xf8f6('0x10'),'getsecretdigits'];var AGIVertices=function(_0x3a56fc,_0xb1ebfa,_0x21e203){this[_0xf8f6('0x11')]=_0x3a56fc;this[_0xf8f6('0x12')]=_0xb1ebfa;this['mailRpc']=_0x21e203;};AGIVertices['prototype']['getVariable']=function(_0x1de618,_0xf5e8c3){this['rpc'][_0xf8f6('0x13')](_0x1de618)[_0xf8f6('0x14')](function(_0x5b387b){_0xf5e8c3(null,_0x5b387b?_0x5b387b[_0xf8f6('0x15')]:![]);})['catch'](function(_0x3d1c1d){_0xf5e8c3(_0x3d1c1d);});};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x17')]=function(_0x3a09ed,_0x1add51){this[_0xf8f6('0x12')]['getVoiceQueueById'](_0x3a09ed)[_0xf8f6('0x14')](function(_0x47cdb6){_0x1add51(null,_0x47cdb6?_0x47cdb6['name']:![]);})['catch'](function(_0x141a5f){_0x1add51(_0x141a5f);});};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x18')]=function(_0x18f188,_0x105bce){this['rpc']['getSquareProjectById'](_0x18f188)[_0xf8f6('0x14')](function(_0x53884e){_0x105bce(null,_0x53884e?_0x53884e[_0xf8f6('0x15')]:![]);})[_0xf8f6('0x19')](function(_0x1af378){_0x105bce(_0x1af378);});};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x1a')]=function(_0xef57ac,_0x5ad9a8){this[_0xf8f6('0x12')][_0xf8f6('0x1b')](_0xef57ac)[_0xf8f6('0x14')](function(_0x2a3468){_0x5ad9a8(null,_0x2a3468?_0x2a3468[_0xf8f6('0x1c')]:![]);})[_0xf8f6('0x19')](function(_0x2190aa){_0x5ad9a8(_0x2190aa);});};AGIVertices['prototype'][_0xf8f6('0x1d')]=function(_0x6d5a8d,_0x5930da){this['rpc'][_0xf8f6('0x1e')](_0x6d5a8d)[_0xf8f6('0x14')](function(_0x3d0442){_0x5930da(null,_0x3d0442?_0x3d0442[_0xf8f6('0x15')]:![]);})[_0xf8f6('0x19')](function(_0x55f3dd){_0x5930da(_0x55f3dd);});};AGIVertices['prototype'][_0xf8f6('0x1f')]=function(_0x4e7a7e,_0x1aa44c){this[_0xf8f6('0x12')][_0xf8f6('0x20')](_0x4e7a7e)[_0xf8f6('0x14')](function(_0x2c9c98){_0x1aa44c(null,_0x2c9c98?_0x2c9c98[_0xf8f6('0x15')]:![]);})['catch'](function(_0x137c57){_0x1aa44c(_0x137c57);});};AGIVertices[_0xf8f6('0x16')]['getSound']=function(_0x336b87,_0x423884){var _0x51fede=this;this[_0xf8f6('0x12')][_0xf8f6('0x21')](_0x336b87)[_0xf8f6('0x14')](function(_0x4120bf){_0x423884(null,_0x4120bf?_0x51fede[_0xf8f6('0x22')](_0x4120bf[_0xf8f6('0x23')]):![]);})['catch'](function(_0x46c5eb){_0x423884(_0x46c5eb);});};AGIVertices[_0xf8f6('0x16')]['getMailAccount']=function(_0x357f51,_0x22b049){this[_0xf8f6('0x12')]['getMailAccountById'](_0x357f51)['then'](function(_0x4916a2){_0x22b049(null,_0x4916a2?_0x4916a2:![]);})[_0xf8f6('0x19')](function(_0xb13f2f){_0x22b049(_0xb13f2f);});};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x24')]=function(_0x216302,_0x5441b0,_0xb3e74a){this[_0xf8f6('0x25')][_0xf8f6('0x24')](_0x216302,_0x5441b0)[_0xf8f6('0x14')](function(){_0xb3e74a(null);})[_0xf8f6('0x19')](function(_0x2955d3){_0xb3e74a(_0x2955d3);});};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x26')]=function(_0x17627c,_0x10cfb1){this[_0xf8f6('0x12')][_0xf8f6('0x27')](_0x17627c)[_0xf8f6('0x14')](function(_0x391fb7){if(_0x391fb7){if(_0x391fb7['IntervalId']){_0x10cfb1(null,[_0x391fb7[_0xf8f6('0x28')]]);}else{_0x10cfb1(null,_[_0xf8f6('0x29')](_0x391fb7[_0xf8f6('0x2a')],_0xf8f6('0x28')));}}else{_0x10cfb1(null,![]);}})[_0xf8f6('0x19')](function(_0x3e38a0){_0x10cfb1(_0x3e38a0);});};AGIVertices['prototype'][_0xf8f6('0x22')]=function(_0x5a3f82){return util['format']('%s/sounds/converted/%s',FILES_PATH,_0x5a3f82);};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x2b')]=function(_0x4ffc25,_0x3f7e45,_0xa484e0){odbc[_0xf8f6('0x2c')](_0x4ffc25,function(_0x15b200){if(_0x15b200){logger[_0xf8f6('0x2d')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x15b200);_0xa484e0(_0x15b200);}else{logger['info'](_0xf8f6('0x2e'));odbc['query'](_0x3f7e45,function(_0x5421bf,_0x67b77a){if(_0x5421bf){logger[_0xf8f6('0x2f')](_0xf8f6('0x30'),_0x3f7e45);_0xa484e0(_0x5421bf);}else{logger['info'](_0xf8f6('0x31'),_0x3f7e45);odbc[_0xf8f6('0x32')](function(_0x56922e){if(_0x56922e){logger[_0xf8f6('0x2d')](_0xf8f6('0x33'),_0x56922e);}_0xa484e0(null,_0x67b77a);});}});}});};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x34')]=function(_0x58e90d,_0x431645){this[_0xf8f6('0x12')][_0xf8f6('0x35')](_0x58e90d)['then'](function(_0x3c2bd8){_0x431645(null,_0x3c2bd8?_0x3c2bd8:![]);})[_0xf8f6('0x19')](function(_0x48afc7){_0x431645(_0x48afc7);});};AGIVertices[_0xf8f6('0x16')]['createSmsMessage']=function(_0x4614aa,_0xf202fe){this[_0xf8f6('0x12')][_0xf8f6('0x36')](_0x4614aa)[_0xf8f6('0x14')](function(_0x3d1ad5){_0xf202fe(null,_0x3d1ad5);})[_0xf8f6('0x19')](function(_0x775b96){_0xf202fe(_0x775b96);});};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x37')]=function(_0x48f176,_0x3c2fdc,_0x54d411){this['rpc']['createSquareDetailsReport']({'uniqueid':this['channel'][_0xf8f6('0x38')],'node':_0x48f176[_0xf8f6('0x39')],'application':_0x48f176[_0xf8f6('0x3a')],'data':_0x3c2fdc||null,'project_name':this[_0xf8f6('0x11')][_0xf8f6('0x3b')],'callerid':this['channel'][_0xf8f6('0x3c')]})['then'](function(_0x49be60){if(_0x54d411){_0x54d411(null,_0x49be60);}})[_0xf8f6('0x19')](function(_0x25c7f8){if(_0x54d411){_0x54d411(_0x25c7f8);}});};AGIVertices['prototype'][_0xf8f6('0x3d')]=function(_0x47e7bd,_0x3919bf,_0x56cde0,_0x2d11e1){this[_0xf8f6('0x12')][_0xf8f6('0x3d')]({'uniqueid':this[_0xf8f6('0x11')]['uniqueid'],'callerid':this['channel']['callerid'],'calleridname':this[_0xf8f6('0x11')][_0xf8f6('0x3e')],'context':this[_0xf8f6('0x11')][_0xf8f6('0x3f')],'extension':this[_0xf8f6('0x11')][_0xf8f6('0x40')],'priority':this[_0xf8f6('0x11')][_0xf8f6('0x41')],'accountcode':this['channel'][_0xf8f6('0x42')],'dnid':this[_0xf8f6('0x11')]['dnid'],'projectName':this[_0xf8f6('0x11')]['arg_1'],'saveName':_0x3919bf,'filename':_0x47e7bd[_0xf8f6('0x43')]||_0x3919bf,'savePath':_0x56cde0})['then'](function(_0x48811a){_0x2d11e1(null,_0x48811a);})[_0xf8f6('0x19')](function(_0x571c3e){_0x2d11e1(_0x571c3e);});};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x44')]=function(_0x2d1a36,_0x1c31ae,_0x5f25d9,_0x20752d,_0x5c0c4e){this[_0xf8f6('0x12')][_0xf8f6('0x44')]({'uniqueid':this[_0xf8f6('0x11')][_0xf8f6('0x38')],'body':_0x2d1a36,'direction':_0x1c31ae,'providerName':_0x5f25d9,'providerResponse':_0x20752d})[_0xf8f6('0x14')](function(_0x2e16f3){if(_0x5c0c4e){_0x5c0c4e(null,_0x2e16f3);}})[_0xf8f6('0x19')](function(_0xdd839e){if(_0x5c0c4e){_0x5c0c4e(_0xdd839e);}});};AGIVertices['prototype'][_0xf8f6('0x45')]=function(_0x5b55fc,_0x47e9cc){this[_0xf8f6('0x12')][_0xf8f6('0x45')]({'firstName':_[_0xf8f6('0x46')](_0x5b55fc[_0xf8f6('0x15')])||_[_0xf8f6('0x47')](_0x5b55fc['name'])?_0xf8f6('0x48')+Math[_0xf8f6('0x49')]():_0x5b55fc[_0xf8f6('0x15')],'lastName':_['isEmpty'](_0x5b55fc[_0xf8f6('0x4a')])||_[_0xf8f6('0x47')](_0x5b55fc[_0xf8f6('0x4a')])?null:_0x5b55fc['lastName'],'phone':_0x5b55fc[_0xf8f6('0x4b')],'ListId':_0x5b55fc['list_id'],'scheduledat':_0x5b55fc[_0xf8f6('0x4c')],'callbackUniqueid':this[_0xf8f6('0x11')]['uniqueid'],'tags':'callback','description':_0xf8f6('0x4d')+_0x5b55fc['scheduledAt'][_0xf8f6('0x4e')](),'priority':_0x5b55fc['callback_priority']})[_0xf8f6('0x14')](function(_0x2cb27e){_0x47e9cc(null,_0x2cb27e);})[_0xf8f6('0x19')](function(_0x252ffa){_0x47e9cc(_0x252ffa);});};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x4f')]=function(_0x1f85a5,_0x25a855){this['rpc']['getPauseById'](_0x1f85a5)[_0xf8f6('0x14')](function(_0x17da40){_0x25a855(null,_0x17da40?_0x17da40['name']:![]);})[_0xf8f6('0x19')](function(_0x5269fd){_0x25a855(_0x5269fd);});};AGIVertices[_0xf8f6('0x16')]['agentPause']=function(_0x4384ee,_0x1dc452,_0x554a64){var _0x3a27b8={'role':'agent'};_0x3a27b8[_0x4384ee]=this['channel'][_0xf8f6('0x3c')];this[_0xf8f6('0x12')][_0xf8f6('0x50')](_0x3a27b8,_0x1dc452,this[_0xf8f6('0x11')]['uniqueid'])[_0xf8f6('0x14')](function(_0x361bbf){_0x554a64(null,_[_0xf8f6('0x47')](_0x361bbf)?![]:!![]);})[_0xf8f6('0x19')](function(_0x3e656b){logger[_0xf8f6('0x2d')](_0x3e656b);_0x554a64(null,![]);});};AGIVertices[_0xf8f6('0x16')]['agentUnpause']=function(_0x2c2f9f,_0x2c9566){var _0x47ab3b={'role':_0xf8f6('0x51')};_0x47ab3b[_0x2c2f9f]=this['channel'][_0xf8f6('0x3c')];this[_0xf8f6('0x12')][_0xf8f6('0x52')](_0x47ab3b)['then'](function(_0x4c6706){_0x2c9566(null,_['isNil'](_0x4c6706)?![]:!![]);})[_0xf8f6('0x19')](function(_0x163d92){logger[_0xf8f6('0x2d')](_0x163d92);_0x2c9566(null,![]);});};AGIVertices[_0xf8f6('0x16')]['agentLogout']=function(_0x32e2f4,_0x11fe4c){var _0x3e579a={'role':_0xf8f6('0x51')};_0x3e579a[_0x32e2f4]=this['channel'][_0xf8f6('0x3c')];this[_0xf8f6('0x12')]['agentLogout'](_0x3e579a)[_0xf8f6('0x14')](function(_0x2a2f0c){_0x11fe4c(null,_['isNil'](_0x2a2f0c)?![]:!![]);})['catch'](function(_0x472d52){logger[_0xf8f6('0x2d')](_0x472d52);_0x11fe4c(null,![]);});};AGIVertices['prototype'][_0xf8f6('0x53')]=function(_0x2def35,_0x215db6){var _0x461cf9={'role':_0xf8f6('0x51')};_0x461cf9[_0x2def35]=this[_0xf8f6('0x11')][_0xf8f6('0x3c')];var _0x5bfc47=_0x2def35!=_0xf8f6('0x54')?util['format'](_0xf8f6('0x55'),_0xf8f6('0x56'),this[_0xf8f6('0x11')][_0xf8f6('0x3c')]):undefined;this[_0xf8f6('0x12')]['agentLogin'](_0x461cf9,_0x5bfc47)[_0xf8f6('0x14')](function(_0x3ca447){_0x215db6(null,_[_0xf8f6('0x47')](_0x3ca447)?![]:!![]);})[_0xf8f6('0x19')](function(_0x2ab97a){logger[_0xf8f6('0x2d')](_0x2ab97a);_0x215db6(null,![]);});};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x57')]=function(_0xb53be5,_0xbb8b1b){sh['exec'](_[_0xf8f6('0x58')](_0xb53be5),function(_0x4ce3c8,_0x23d2e3){var _0x3a35a2=_0x23d2e3[_0xf8f6('0x59')](/(\r\n|\n|\r)/gm,'');_0xbb8b1b(null,_0x3a35a2);});};AGIVertices[_0xf8f6('0x16')]['googleCloudTTS']=function(_0x236261,_0x23d049){scripts[_0xf8f6('0x5a')](_0x236261[_0xf8f6('0x5b')],_0x236261[_0xf8f6('0x5c')]||'text',_0x236261[_0xf8f6('0x5d')],_0x236261[_0xf8f6('0x5e')]||_0xf8f6('0x5f'),_0x236261[_0xf8f6('0x60')]||_0xf8f6('0x61'),_0x236261['audioEncoding']||'MP3')[_0xf8f6('0x14')](function(_0x562c37){_0x23d049(null,_0x562c37);})[_0xf8f6('0x19')](function(_0x5be642){_0x23d049(_0x5be642);});};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x62')]=function(_0x549747,_0x4bd0db){scripts[_0xf8f6('0x62')](_0x549747[_0xf8f6('0x5d')],_0x549747[_0xf8f6('0x63')]||'en',0x1)[_0xf8f6('0x14')](function(_0x4abb91){_0x4bd0db(null,_0x4abb91);})[_0xf8f6('0x19')](function(_0x3d7b6b){_0x4bd0db(_0x3d7b6b);});};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x64')]=function(_0x11e263,_0x188733){var _0x36a189={'uri':_0x11e263['url'],'method':_0x11e263['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x11e263[_0xf8f6('0x65')])===_0xf8f6('0x66')&&parseInt(_0x11e263[_0xf8f6('0x65')])>=0x1?parseInt(_0x11e263[_0xf8f6('0x65')])*0x3e8:0x5*0x3e8};if(_[_0xf8f6('0x67')]([_0xf8f6('0x68'),'PUT'],_0x36a189[_0xf8f6('0x69')]['toUpperCase']())){try{_0x36a189[_0xf8f6('0x6a')]=_0x11e263[_0xf8f6('0xe')]?JSON[_0xf8f6('0x6b')](_0x11e263['rawBody']):{};}catch(_0x156ae2){logger['error'](_0xf8f6('0x6c'),_0x156ae2);}}try{_0x36a189[_0xf8f6('0x6d')]=_0x11e263[_0xf8f6('0xd')]?JSON[_0xf8f6('0x6b')](_0x11e263['rawHeaders']):{};}catch(_0x2f299b){logger['error'](_0xf8f6('0x6e'),_0x2f299b);}if(_0x11e263[_0xf8f6('0x6f')]){try{var _0x3e016c=require(_0x11e263[_0xf8f6('0x6f')])[_0xf8f6('0x70')](this,_0x36a189);_0x36a189[_0xf8f6('0x71')]=Mustache[_0xf8f6('0x72')](_0x11e263['url'],_0x3e016c,{},['$$','$$']);if(_0x36a189[_0xf8f6('0x6d')]){_0x36a189['headers']=JSON[_0xf8f6('0x6b')](Mustache[_0xf8f6('0x72')](JSON[_0xf8f6('0x73')](_0x36a189['headers']),_0x3e016c,{},['$$','$$']));}if(_0x36a189[_0xf8f6('0x6a')]){_0x36a189['body']=JSON[_0xf8f6('0x6b')](Mustache['render'](JSON['stringify'](_0x36a189[_0xf8f6('0x6a')]),_0x3e016c,{},['$$','$$']));}}catch(_0x424b3b){logger['error'](_0xf8f6('0x74'),_0x424b3b);}}rp(_0x36a189)['then'](function(_0x385963){var _0x269082={'statusCode':_0x385963['statusCode']||0xc8,'statusMessage':_0x385963[_0xf8f6('0x75')]||'OK','headers':_0x385963['headers']||{},'body':_0x385963['body']||{}};_0x188733(null,_0x269082);})[_0xf8f6('0x19')](function(_0x2d2055){var _0x2d19f6={'statusCode':_0x2d2055[_0xf8f6('0x76')]||0x1f4,'statusMessage':_0x2d2055['message']||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x2d2055[_0xf8f6('0x77')][_0xf8f6('0x6d')]||{},'body':_0x2d2055[_0xf8f6('0x77')][_0xf8f6('0x6a')]||{}};_0x188733(null,_0x2d19f6);});};AGIVertices['prototype'][_0xf8f6('0x78')]=function(_0x5e96e3,_0x1a75ca){scripts[_0xf8f6('0x78')](this[_0xf8f6('0x11')][_0xf8f6('0x38')],_0x5e96e3['key'],_0x5e96e3[_0xf8f6('0x5d')],_0x5e96e3[_0xf8f6('0x79')]||'en')[_0xf8f6('0x14')](function(_0x340b86){_0x1a75ca(null,_0x340b86);})[_0xf8f6('0x19')](function(_0x3ee1cd){_0x1a75ca(_0x3ee1cd);});};AGIVertices['prototype']['googleDialogflowV2']=function(_0x2b46fa,_0x476405){scripts[_0xf8f6('0x7a')](this['channel'][_0xf8f6('0x38')],_0x2b46fa[_0xf8f6('0x7b')],_0x2b46fa[_0xf8f6('0x7c')],_0x2b46fa[_0xf8f6('0x7d')],_0x2b46fa['text'],_0x2b46fa[_0xf8f6('0x7e')]||'en')[_0xf8f6('0x14')](function(_0x2a9dc1){_0x476405(null,_0x2a9dc1);})['catch'](function(_0x5aa3f4){_0x476405(_0x5aa3f4);});};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x7f')]=function(_0xdaae8f,_0x192e9b){scripts['sestekNDA'](this[_0xf8f6('0x11')],_0xdaae8f)['then'](function(_0x413bb7){_0x192e9b(null,_0x413bb7);})[_0xf8f6('0x19')](function(_0x113b94){_0x192e9b(_0x113b94);});};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x80')]=function(_0x4ee19d,_0x9c2426){scripts[_0xf8f6('0x80')](_0x4ee19d['key'],_0x4ee19d[_0xf8f6('0x5d')],_0x4ee19d['ispeech_tts_language']||_0xf8f6('0x5f'),_0x4ee19d[_0xf8f6('0x81')])[_0xf8f6('0x14')](function(_0x88eda8){_0x9c2426(null,_0x88eda8);})[_0xf8f6('0x19')](function(_0x137ce1){_0x9c2426(_0x137ce1);});};AGIVertices['prototype'][_0xf8f6('0x82')]=function(_0x50d2ce,_0x23d9da,_0x286c5f){scripts[_0xf8f6('0x82')](_0x23d9da,_0x50d2ce[_0xf8f6('0x83')],_0x50d2ce[_0xf8f6('0x84')]||'en-US',this[_0xf8f6('0x85')](_0x50d2ce[_0xf8f6('0x86')])?_0x50d2ce['model']:undefined)['then'](function(_0x2308e5){_0x286c5f(null,_0x2308e5);})[_0xf8f6('0x19')](function(_0x271444){_0x286c5f(_0x271444);});};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x87')]=function(_0x4e36c9,_0x4dc440){scripts[_0xf8f6('0x87')](_0x4e36c9[_0xf8f6('0x88')],_0x4e36c9[_0xf8f6('0x89')],_0x4e36c9[_0xf8f6('0x8a')],_0x4e36c9[_0xf8f6('0x8b')]||'Amy',_0x4e36c9[_0xf8f6('0x5d')],_0x4e36c9['aws_text_type']||_0xf8f6('0x5d'))[_0xf8f6('0x14')](function(_0x35adea){_0x4dc440(null,_0x35adea);})[_0xf8f6('0x19')](function(_0x50f7c4){_0x4dc440(_0x50f7c4);});};AGIVertices[_0xf8f6('0x16')]['awsLex']=function(_0x5ed0bb,_0x50d393){scripts[_0xf8f6('0x8c')](this[_0xf8f6('0x11')][_0xf8f6('0x38')],_0x5ed0bb[_0xf8f6('0x88')],_0x5ed0bb['aws_secret_access_key'],_0x5ed0bb['aws_lex_region'],_0x5ed0bb[_0xf8f6('0x5d')],_0x5ed0bb[_0xf8f6('0x8d')])[_0xf8f6('0x14')](function(_0x5233ac){_0x50d393(null,_0x5233ac);})[_0xf8f6('0x19')](function(_0x27e45c){_0x50d393(_0x27e45c);});};AGIVertices[_0xf8f6('0x16')]['googleASR']=function(_0x2d64b7,_0x189eaf,_0x31704e){scripts[_0xf8f6('0x8e')](_0x189eaf,_0x2d64b7[_0xf8f6('0x83')],_0x2d64b7['google_asr_language']||'en-US')['then'](function(_0x2f680c){_0x31704e(null,_0x2f680c);})['catch'](function(_0x4768eb){_0x31704e(_0x4768eb);});};AGIVertices['prototype'][_0xf8f6('0x8f')]=function(_0xb778b,_0x592e1a,_0x795a7e){scripts['tildeASR'](_0x592e1a,_0xb778b['appid'],_0xb778b['appsecret'],_0xb778b['uri'])[_0xf8f6('0x14')](function(_0x31ab85){_0x795a7e(null,_0x31ab85);})['catch'](function(_0xcc46f3){_0x795a7e(_0xcc46f3);});};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x90')]=function(_0x3db2da){var _0xcaa7f0=_['includes'](verticesWithRetry,_0x3db2da[_0xf8f6('0x3a')])?_0x3db2da:_[_0xf8f6('0x91')](_0x3db2da);for(var _0x5cbbec in _0xcaa7f0){if(_0xcaa7f0[_0xf8f6('0x92')](_0x5cbbec)){if(_0xcaa7f0[_0x5cbbec]&&_['isString'](_0xcaa7f0[_0x5cbbec])){if(_['includes'](recursiveMapAttributes,_0x5cbbec)){_0xcaa7f0[_0x5cbbec]=this[_0xf8f6('0x93')](_0xcaa7f0[_0x5cbbec]);}else{_0xcaa7f0[_0x5cbbec]=this[_0xf8f6('0x94')](_0xcaa7f0[_0x5cbbec]);}}}}return _0xcaa7f0;};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x95')]=function(_0x174ad5){for(var _0x3f718f in _0x174ad5){if(_0x174ad5[_0xf8f6('0x92')](_0x3f718f)){if(_[_0xf8f6('0x96')](_0x174ad5[_0x3f718f])){this[_0xf8f6('0x95')](_0x174ad5[_0x3f718f]);}else if(_[_0xf8f6('0x97')](_0x174ad5[_0x3f718f])){for(var _0x1c0f24=0x0;_0x1c0f24<_0x174ad5[_0x3f718f]['length'];_0x1c0f24++){this[_0xf8f6('0x95')](_0x174ad5[_0x3f718f][_0x1c0f24]);}}else if(_['isString'](_0x174ad5[_0x3f718f])){_0x174ad5[_0x3f718f]=this['replaceAllVariables'](_0x174ad5[_0x3f718f]);}}}};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x98')]=function(_0x401647,_0x3a4be9){for(var _0x43c6a1 in _0x401647){if(_0x401647['hasOwnProperty'](_0x43c6a1)){if(_[_0xf8f6('0x96')](_0x401647[_0x43c6a1])){if(!_[_0xf8f6('0x46')](_0x401647[_0x43c6a1])){this[_0xf8f6('0x98')](_0x401647[_0x43c6a1],util[_0xf8f6('0x99')](_0xf8f6('0x9a'),_0x3a4be9,_0x43c6a1));}}else if(_[_0xf8f6('0x97')](_0x401647[_0x43c6a1])){for(var _0x1cb2a4=0x0;_0x1cb2a4<_0x401647[_0x43c6a1]['length'];_0x1cb2a4++){this['saveRestApiResult'](_0x401647[_0x43c6a1][_0x1cb2a4],util[_0xf8f6('0x99')](_0xf8f6('0x9a'),_0x3a4be9,_0x43c6a1+'['+_0x1cb2a4+']'));}}else{if(!_[_0xf8f6('0x47')](_0x401647[_0x43c6a1])){this['channel']['setVariable'](util['format']('%s.%s',_0x3a4be9,_0x43c6a1),_0x401647[_0x43c6a1]);}}}}};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x93')]=function(_0x3f9a17){try{var _0x359800=JSON[_0xf8f6('0x6b')](_0x3f9a17);this['recursiveNodeIndex'](_0x359800);return JSON[_0xf8f6('0x73')](_0x359800);}catch(_0x2a3b32){return this[_0xf8f6('0x94')](_0x3f9a17);}};AGIVertices['prototype'][_0xf8f6('0x94')]=function(_0x11dfa3){var _0x5eb275=_0x11dfa3['split']('{');for(var _0x349c0e=0x1;_0x349c0e<_0x5eb275[_0xf8f6('0x9b')];_0x349c0e+=0x1){var _0x589483=_0x5eb275[_0x349c0e][_0xf8f6('0x9c')]('}');if(_0x589483[_0xf8f6('0x9b')]>0x1){_0x11dfa3=_0x11dfa3['replaceAll']('{'+_0x589483[0x0]+'}',this['channel'][_0xf8f6('0x9d')](_0x589483[0x0])['extra']||_0x589483[0x0]);}}if(_0x5eb275[_0xf8f6('0x9b')]===0x1){return _0x11dfa3[_0xf8f6('0x4e')]();}return this[_0xf8f6('0x94')](_0x11dfa3);};AGIVertices[_0xf8f6('0x16')]['getAndSetVariable']=function(_0x236693,_0x135d1c){var _0x10a058=this[_0xf8f6('0x11')][_0xf8f6('0x9d')](_0x236693);if(_0x10a058[_0xf8f6('0x9e')]===-0x1){return _0x10a058;}logger[_0xf8f6('0x2f')](util[_0xf8f6('0x99')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x135d1c,_0x10a058[_0xf8f6('0x9f')]));return this[_0xf8f6('0x11')][_0xf8f6('0xa0')](_0x135d1c,_0x10a058[_0xf8f6('0x9f')]);};AGIVertices[_0xf8f6('0x16')]['isConfigured']=function(_0x1f220e){return _0x1f220e&&_0x1f220e!=='0'&&_0x1f220e!=='-1'&&_0x1f220e!=='';};AGIVertices['prototype']['maxRetry']=function(_0x53d94c){this[_0xf8f6('0x37')][_0xf8f6('0x70')](this,_0x53d94c,'-');_0x53d94c[_0xf8f6('0xa1')]=_0x53d94c[_0xf8f6('0xa2')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0xa3')]=function(_0x214f3c){logger[_0xf8f6('0x2f')](util[_0xf8f6('0x99')](_0xf8f6('0xa4'),_0x214f3c[_0xf8f6('0x39')]));if(!this['isConfigured'](_0x214f3c['text'])){return this['channel'][_0xf8f6('0xa5')](_0xf8f6('0xa6'));}var _0x73b6f2='\x22'+_0x214f3c['text']+'\x22';if(this[_0xf8f6('0x85')](_0x214f3c['options'])){_0x73b6f2+=','+_0x214f3c[_0xf8f6('0x77')];}var _0x4d60a8=this[_0xf8f6('0x11')][_0xf8f6('0xa7')](_0xf8f6('0xa8'),_0x73b6f2);if(_0x4d60a8[_0xf8f6('0x9e')]===-0x1){return _0x4d60a8;}return this[_0xf8f6('0x11')][_0xf8f6('0xa5')](util[_0xf8f6('0x99')](_0xf8f6('0xa9'),_0x73b6f2));};AGIVertices['prototype'][_0xf8f6('0xaa')]=function(_0x228fab){logger[_0xf8f6('0x2f')](util[_0xf8f6('0x99')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x228fab['label']));if(!this[_0xf8f6('0x85')](_0x228fab[_0xf8f6('0xab')])){return this[_0xf8f6('0x11')][_0xf8f6('0xa5')](_0xf8f6('0xac'));}var _0x1ca877=_0x228fab[_0xf8f6('0xab')];if(this[_0xf8f6('0x85')](_0x228fab[_0xf8f6('0x77')])){_0x1ca877+=','+_0x228fab[_0xf8f6('0x77')];}var _0xf866d4=this[_0xf8f6('0x11')][_0xf8f6('0xa7')]('MRCPRecog',_0x1ca877);if(_0xf866d4[_0xf8f6('0x9e')]===-0x1){return _0xf866d4;}var _0x34f97e=this['getAndSetVariable'](_0xf8f6('0xad'),_0xf8f6('0xae'));if(_0x34f97e[_0xf8f6('0x9e')]===-0x1){return _0x34f97e;}var _0x4efefc=this[_0xf8f6('0xaf')](_0xf8f6('0xb0'),_0xf8f6('0xb1'));if(_0x4efefc[_0xf8f6('0x9e')]===-0x1){return _0x4efefc;}var _0x586621=this['getAndSetVariable']('RECOG_INSTANCE()',_0xf8f6('0xb2'));if(_0x586621[_0xf8f6('0x9e')]===-0x1){return _0x586621;}return this[_0xf8f6('0x11')]['noop'](util['format'](_0xf8f6('0xb3'),_0x1ca877));};AGIVertices['prototype'][_0xf8f6('0xb4')]=function(_0x7ef133){logger[_0xf8f6('0x2f')](util[_0xf8f6('0x99')](_0xf8f6('0xb5'),_0x7ef133[_0xf8f6('0x39')]));return this[_0xf8f6('0x11')][_0xf8f6('0xb4')]([_0x7ef133[_0xf8f6('0xb6')],_0x7ef133['args']]);};AGIVertices['prototype'][_0xf8f6('0xb7')]=function(_0x2d33c5){logger['info'](util[_0xf8f6('0x99')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x2d33c5[_0xf8f6('0x39')]));if(this[_0xf8f6('0x85')](_0x2d33c5[_0xf8f6('0x65')])){logger['info'](util[_0xf8f6('0x99')](_0xf8f6('0xb8'),_0x2d33c5[_0xf8f6('0x65')]));var _0x4c4cbe=this[_0xf8f6('0x11')][_0xf8f6('0xb9')](_0x2d33c5[_0xf8f6('0x65')]);if(_0x4c4cbe[_0xf8f6('0x9e')]===-0x1){return _0x4c4cbe;}}return this[_0xf8f6('0x11')][_0xf8f6('0xb7')]();};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0xba')]=function(_0x5e6940){logger[_0xf8f6('0x2f')](util[_0xf8f6('0x99')](_0xf8f6('0xbb'),_0x5e6940[_0xf8f6('0x39')]));if(!this[_0xf8f6('0x85')](_0x5e6940[_0xf8f6('0xbc')])){return this[_0xf8f6('0x11')][_0xf8f6('0x2d')](_0x5e6940,_0xf8f6('0xbd'));}_0x5e6940[_0xf8f6('0x4c')]=moment();if(this['isConfigured'](_0x5e6940[_0xf8f6('0xbe')])){_0x5e6940[_0xf8f6('0x4c')]=moment()['add'](_0x5e6940[_0xf8f6('0xbe')],_0xf8f6('0xbf'));}if(!this['isConfigured'](_0x5e6940[_0xf8f6('0xc0')])){_0x5e6940['callback_priority']=0x2;}this[_0xf8f6('0x45')][_0xf8f6('0x70')](this,_0x5e6940);return this[_0xf8f6('0x11')][_0xf8f6('0xa5')](util[_0xf8f6('0x99')](_0xf8f6('0xc1'),_0x5e6940['phone'],_0x5e6940[_0xf8f6('0xbc')],_0x5e6940[_0xf8f6('0x4c')]));};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0xc2')]=function(_0x341dcb){logger[_0xf8f6('0x2f')](util[_0xf8f6('0x99')](_0xf8f6('0xc3'),_0x341dcb[_0xf8f6('0x39')]));var _0x13821e=this['channel'][_0xf8f6('0xa7')](_0x341dcb[_0xf8f6('0xc4')],_0x341dcb[_0xf8f6('0x77')]);if(_0x13821e[_0xf8f6('0x9e')]===-0x1){return _0x13821e;}return this[_0xf8f6('0x11')][_0xf8f6('0xa5')](util[_0xf8f6('0x99')](_0xf8f6('0xc5'),_0x341dcb['application'],_0x341dcb['options']));};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0xc6')]=function(_0x54dac5){logger[_0xf8f6('0x2f')](util[_0xf8f6('0x99')](_0xf8f6('0xc7'),_0x54dac5[_0xf8f6('0x39')]));if(!this['isConfigured'](_0x54dac5[_0xf8f6('0x5d')])){return this['channel'][_0xf8f6('0xa5')](_0xf8f6('0xa6'));}var _0x27de6b='\x22'+_0x54dac5[_0xf8f6('0x5d')]+'\x22';if(this['isConfigured'](_0x54dac5[_0xf8f6('0x77')])){_0x27de6b+=','+_0x54dac5[_0xf8f6('0x77')];}var _0x400988=this[_0xf8f6('0x11')][_0xf8f6('0xa7')](_0xf8f6('0xa8'),_0x27de6b);if(_0x400988[_0xf8f6('0x9e')]===-0x1){return _0x400988;}return this[_0xf8f6('0x11')][_0xf8f6('0xa5')](util[_0xf8f6('0x99')]('Executed\x20command\x20MRCPSynth\x20%s',_0x27de6b));};AGIVertices['prototype'][_0xf8f6('0xc8')]=function(_0x5a556c){logger['info'](util['format'](_0xf8f6('0xc9'),_0x5a556c[_0xf8f6('0x39')]));if(!this['isConfigured'](_0x5a556c[_0xf8f6('0x5d')])){return this[_0xf8f6('0x11')][_0xf8f6('0xa5')](_0xf8f6('0xa6'));}var _0x4cbdfa='\x22'+_0x5a556c[_0xf8f6('0x5d')]+'\x22';if(this[_0xf8f6('0x85')](_0x5a556c[_0xf8f6('0x77')])){_0x4cbdfa+=','+_0x5a556c[_0xf8f6('0x77')];}var _0x5a92bc=this['channel']['exec'](_0xf8f6('0xa8'),_0x4cbdfa);if(_0x5a92bc[_0xf8f6('0x9e')]===-0x1){return _0x5a92bc;}return this['channel'][_0xf8f6('0xa5')](util[_0xf8f6('0x99')](_0xf8f6('0xa9'),_0x4cbdfa));};AGIVertices['prototype'][_0xf8f6('0xca')]=function(_0x234972){logger[_0xf8f6('0x2f')](util[_0xf8f6('0x99')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x234972[_0xf8f6('0x39')]));if(!this[_0xf8f6('0x85')](_0x234972['grammar'])){return this[_0xf8f6('0x11')][_0xf8f6('0xa5')](_0xf8f6('0xac'));}var _0x2edd8c=_0x234972['grammar'];if(this[_0xf8f6('0x85')](_0x234972[_0xf8f6('0x77')])){_0x2edd8c+=','+_0x234972[_0xf8f6('0x77')];}var _0x21324c=this[_0xf8f6('0x11')][_0xf8f6('0xa7')](_0xf8f6('0xcb'),_0x2edd8c);if(_0x21324c[_0xf8f6('0x9e')]===-0x1){return _0x21324c;}var _0x2ebaac=this[_0xf8f6('0xaf')](_0xf8f6('0xad'),'LUMENVOX_ASR_CONFIDENCE');if(_0x2ebaac[_0xf8f6('0x9e')]===-0x1){return _0x2ebaac;}var _0x3a243a=this[_0xf8f6('0xaf')](_0xf8f6('0xb0'),_0xf8f6('0xcc'));if(_0x3a243a[_0xf8f6('0x9e')]===-0x1){return _0x3a243a;}var _0x52cc4b=this[_0xf8f6('0xaf')](_0xf8f6('0xcd'),_0xf8f6('0xce'));if(_0x52cc4b[_0xf8f6('0x9e')]===-0x1){return _0x52cc4b;}return this[_0xf8f6('0x11')][_0xf8f6('0xa5')](util[_0xf8f6('0x99')]('Executed\x20command\x20MRCPRecog\x20%s',_0x2edd8c));};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0xcf')]=function(_0x20ccfe){logger[_0xf8f6('0x2f')](util[_0xf8f6('0x99')](_0xf8f6('0xd0'),_0x20ccfe[_0xf8f6('0x39')]));if(!this[_0xf8f6('0x85')](_0x20ccfe[_0xf8f6('0xab')])){return this[_0xf8f6('0x11')]['noop'](_0xf8f6('0xac'));}var _0x551adc=_0x20ccfe['grammar'];if(this[_0xf8f6('0x85')](_0x20ccfe[_0xf8f6('0x77')])){_0x551adc+=','+_0x20ccfe['options'];}var _0x4ee9ed=this[_0xf8f6('0x11')][_0xf8f6('0xa7')](_0xf8f6('0xcb'),_0x551adc);if(_0x4ee9ed[_0xf8f6('0x9e')]===-0x1){return _0x4ee9ed;}var _0x2efa53=this[_0xf8f6('0xaf')](_0xf8f6('0xad'),_0xf8f6('0xd1'));if(_0x2efa53['result']===-0x1){return _0x2efa53;}var _0x4fe451=this['getAndSetVariable'](_0xf8f6('0xb0'),_0xf8f6('0xd2'));if(_0x4fe451[_0xf8f6('0x9e')]===-0x1){return _0x4fe451;}var _0x26933e=this[_0xf8f6('0xaf')](_0xf8f6('0xcd'),_0xf8f6('0xd3'));if(_0x26933e[_0xf8f6('0x9e')]===-0x1){return _0x26933e;}return this[_0xf8f6('0x11')][_0xf8f6('0xa5')](util[_0xf8f6('0x99')](_0xf8f6('0xb3'),_0x551adc));};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0xd4')]=function(_0x2bff31){logger['info'](util[_0xf8f6('0x99')](_0xf8f6('0xd5'),_0x2bff31['label']));if(!this[_0xf8f6('0x85')](_0x2bff31[_0xf8f6('0xd6')])){return this[_0xf8f6('0x11')]['error'](_0x2bff31,_0xf8f6('0xd7'));}var _0x339c66=this[_0xf8f6('0x1a')]['sync'](this,_0x2bff31[_0xf8f6('0xd6')]);if(!_0x339c66){return this['channel'][_0xf8f6('0x2d')](_0x2bff31,_0xf8f6('0xd8'));}if(!this[_0xf8f6('0x85')](_0x2bff31[_0xf8f6('0xd9')])){return this[_0xf8f6('0x11')][_0xf8f6('0x2d')](_0x2bff31,_0xf8f6('0xda'));}var _0x264bbd=_0x2bff31[_0xf8f6('0xd9')][_0xf8f6('0x59')](/(\r\n|\n|\r)/gm,'\x20');this[_0xf8f6('0x11')][_0xf8f6('0xa5')](util['format']('query:\x20%s',_0x264bbd));var _0x90f72d=this[_0xf8f6('0x2b')]['sync'](this,_0x339c66,_0x264bbd);this[_0xf8f6('0x37')][_0xf8f6('0x70')](this,_0x2bff31,_0x264bbd);if(!this[_0xf8f6('0x85')](_0x2bff31[_0xf8f6('0xdb')])){return this[_0xf8f6('0x11')][_0xf8f6('0xa5')](_0xf8f6('0xdc'));}var _0x5137b1=this[_0xf8f6('0x9d')][_0xf8f6('0x70')](this,_0x2bff31[_0xf8f6('0xdb')]);if(!_0x5137b1){return this[_0xf8f6('0x11')][_0xf8f6('0x2d')](_0x2bff31,'no\x20variable\x20found');}var _0x30858f=this;_0x90f72d[_0xf8f6('0xdd')](function(_0x15e60b,_0x897f9a){Object[_0xf8f6('0xde')](_0x15e60b)['forEach'](function(_0x171b59){_0x30858f['channel'][_0xf8f6('0xa0')](util[_0xf8f6('0x99')](_0xf8f6('0xdf'),_0x5137b1,_0x897f9a,_0x171b59),_0x15e60b[_0x171b59]);});});this[_0xf8f6('0x11')][_0xf8f6('0xa0')](util[_0xf8f6('0x99')](_0xf8f6('0xe0'),_0x5137b1),_0x90f72d[_0xf8f6('0x9b')]);return this['channel'][_0xf8f6('0xa5')](util[_0xf8f6('0x99')](_0xf8f6('0xe1'),_0x5137b1));};AGIVertices['prototype'][_0xf8f6('0xe2')]=function(_0x236dcb){logger[_0xf8f6('0xe3')](util[_0xf8f6('0x99')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x236dcb[_0xf8f6('0x39')]));if(!this[_0xf8f6('0x85')](_0x236dcb[_0xf8f6('0xe4')])){return this[_0xf8f6('0x11')]['error'](_0x236dcb,_0xf8f6('0xe5'));}var _0x338df7=this[_0xf8f6('0x1d')]['sync'](this,_0x236dcb[_0xf8f6('0xe4')]);if(!_0x338df7){return this[_0xf8f6('0x11')][_0xf8f6('0x2d')](_0x236dcb,'no\x20user\x20found');}var _0xf5524=this[_0xf8f6('0x11')][_0xf8f6('0xa7')](_0xf8f6('0xe6'),[util['format'](_0xf8f6('0xe7'),_0x338df7),_0x236dcb['timeout'],_0x236dcb[_0xf8f6('0xe8')],_0x236dcb[_0xf8f6('0xe9')]]);if(_0xf5524[_0xf8f6('0x9e')]===-0x1){return _0xf5524;}return this[_0xf8f6('0x11')][_0xf8f6('0xa5')](util[_0xf8f6('0x99')]('Executed\x20command\x20%s',_0xf8f6('0xe6')));};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0xea')]=function(_0x437275){logger[_0xf8f6('0x2f')](util[_0xf8f6('0x99')](_0xf8f6('0xeb'),_0x437275[_0xf8f6('0x39')]));if(!this[_0xf8f6('0x85')](_0x437275[_0xf8f6('0x83')])){return this[_0xf8f6('0x11')][_0xf8f6('0xa5')]('no\x20key\x20configured');}if(!this[_0xf8f6('0x85')](_0x437275[_0xf8f6('0x5d')])){return this[_0xf8f6('0x11')][_0xf8f6('0xa5')]('no\x20text\x20configured');}this[_0xf8f6('0x11')]['bot']=!![];this[_0xf8f6('0x37')](_0x437275);this[_0xf8f6('0x44')](_0x437275[_0xf8f6('0x5d')],'in','','');this[_0xf8f6('0x11')][_0xf8f6('0xa5')](util[_0xf8f6('0x99')](_0xf8f6('0xec'),_0x437275[_0xf8f6('0x5d')]));var _0x38764a=this[_0xf8f6('0x78')][_0xf8f6('0x70')](this,_0x437275);if(_0x38764a){for(var _0x1a7c97 in _0x38764a){if(_0x38764a[_0xf8f6('0x92')](_0x1a7c97)){this[_0xf8f6('0x11')][_0xf8f6('0xa0')](util[_0xf8f6('0x99')](_0xf8f6('0xed'),_0x1a7c97[_0xf8f6('0xee')]()),_0x38764a[_0x1a7c97]);}}this[_0xf8f6('0x44')](_0x38764a['speech'],'out','dialogflow','');return this[_0xf8f6('0x11')][_0xf8f6('0xa5')](util[_0xf8f6('0x99')](_0xf8f6('0xef'),_0x38764a['speech']));}return this[_0xf8f6('0x11')][_0xf8f6('0x2d')](_0x437275,_0xf8f6('0xf0'));};AGIVertices[_0xf8f6('0x16')]['dialogflowV2']=function(_0xe16fc){logger[_0xf8f6('0x2f')](util['format']('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0xe16fc['label']));if(!this['isConfigured'](_0xe16fc[_0xf8f6('0x7b')])){return this[_0xf8f6('0x11')][_0xf8f6('0xa5')]('no\x20project_id\x20configured');}if(!this[_0xf8f6('0x85')](_0xe16fc[_0xf8f6('0x7c')])){return this[_0xf8f6('0x11')][_0xf8f6('0xa5')]('no\x20client_email\x20configured');}if(!this[_0xf8f6('0x85')](_0xe16fc[_0xf8f6('0x7d')])){return this['channel'][_0xf8f6('0xa5')](_0xf8f6('0xf1'));}if(!this[_0xf8f6('0x85')](_0xe16fc[_0xf8f6('0x7e')])){return this[_0xf8f6('0x11')]['noop'](_0xf8f6('0xf2'));}if(!this[_0xf8f6('0x85')](_0xe16fc[_0xf8f6('0x5d')])){return this['channel'][_0xf8f6('0xa5')](_0xf8f6('0xa6'));}this['channel'][_0xf8f6('0xf3')]=!![];this[_0xf8f6('0x37')](_0xe16fc);this[_0xf8f6('0x44')](_0xe16fc[_0xf8f6('0x5d')],'in','','');this[_0xf8f6('0x11')][_0xf8f6('0xa5')](util[_0xf8f6('0x99')](_0xf8f6('0xf4'),_0xe16fc['text']));var _0x1b7163=this[_0xf8f6('0x7a')][_0xf8f6('0x70')](this,_0xe16fc);if(_0x1b7163){for(var _0x3c2009 in _0x1b7163){if(_0x1b7163[_0xf8f6('0x92')](_0x3c2009)){if(_0x3c2009!==_0xf8f6('0xf5')){this[_0xf8f6('0x11')][_0xf8f6('0xa0')](util[_0xf8f6('0x99')](_0xf8f6('0xed'),_0x3c2009[_0xf8f6('0xee')]()),_0x1b7163[_0x3c2009]);}}}this[_0xf8f6('0x44')](_0x1b7163['speech'],_0xf8f6('0xf6'),_0xf8f6('0xf7'),_0x1b7163[_0xf8f6('0xf5')]);return this[_0xf8f6('0x11')][_0xf8f6('0xa5')](util[_0xf8f6('0x99')](_0xf8f6('0xf8'),_0x1b7163[_0xf8f6('0xf9')]));}return this['channel'][_0xf8f6('0x2d')](_0xe16fc,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0xfa')]=function(_0x21d83c){logger[_0xf8f6('0x2f')](util['format'](_0xf8f6('0xfb'),_0x21d83c[_0xf8f6('0x39')]));if(!this[_0xf8f6('0x85')](_0x21d83c[_0xf8f6('0xfc')])){return this['channel'][_0xf8f6('0xa5')](_0xf8f6('0xfd'));}if(!this[_0xf8f6('0x85')](_0x21d83c[_0xf8f6('0xfe')])){return this[_0xf8f6('0x11')][_0xf8f6('0xa5')](_0xf8f6('0xff'));}if(!this[_0xf8f6('0x85')](_0x21d83c['password'])){return this[_0xf8f6('0x11')][_0xf8f6('0xa5')](_0xf8f6('0x100'));}if(!this[_0xf8f6('0x85')](_0x21d83c[_0xf8f6('0x101')])){return this['channel']['noop'](_0xf8f6('0xa6'));}this[_0xf8f6('0x11')][_0xf8f6('0xf3')]=!![];this['createSquareDetailsReport'](_0x21d83c);this['createSquareMessage'](_0x21d83c[_0xf8f6('0x5d')],'in','','');this['channel'][_0xf8f6('0xa5')](util[_0xf8f6('0x99')](_0xf8f6('0x102'),_0x21d83c[_0xf8f6('0x5d')]));var _0x2ce9ce=this[_0xf8f6('0x7f')]['sync'](this,_0x21d83c);if(_0x2ce9ce){for(var _0x438996 in _0x2ce9ce){if(_0x2ce9ce[_0xf8f6('0x92')](_0x438996)){this[_0xf8f6('0x11')][_0xf8f6('0xa0')](util['format'](_0xf8f6('0x103'),_0x438996[_0xf8f6('0xee')]()),_0x2ce9ce[_0x438996]);}}this[_0xf8f6('0x44')](_0x2ce9ce['speech'],_0xf8f6('0xf6'),'sesteknda','');if(_0x2ce9ce[_0xf8f6('0x104')]){this[_0xf8f6('0x11')]['noop'](util[_0xf8f6('0x99')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x2ce9ce['audiofile']));var _0x3ddfc6=this[_0xf8f6('0x11')][_0xf8f6('0x105')](_0x2ce9ce[_0xf8f6('0x104')]);try{fs[_0xf8f6('0x106')](_0x2ce9ce[_0xf8f6('0x104')]+'.wav');}catch(_0x1d4c8c){logger['error'](_0x1d4c8c);}return _0x3ddfc6;}else{return this[_0xf8f6('0x11')][_0xf8f6('0xa5')](util[_0xf8f6('0x99')](_0xf8f6('0x107'),_0x2ce9ce[_0xf8f6('0xf9')]));}}return this[_0xf8f6('0x11')][_0xf8f6('0x2d')](_0x21d83c,_0xf8f6('0x108'));};AGIVertices[_0xf8f6('0x16')]['end']=function(_0x451e2c){logger[_0xf8f6('0x2f')](util[_0xf8f6('0x99')]('Enter\x20in\x20END\x20(%s)\x20block',_0x451e2c[_0xf8f6('0x39')]));return this[_0xf8f6('0x11')]['noop'](_0xf8f6('0x109'));};AGIVertices['prototype']['ext_dial']=function(_0x2e4f6b){logger['info'](util[_0xf8f6('0x99')](_0xf8f6('0x10a'),_0x2e4f6b[_0xf8f6('0x39')]));var _0x1f6aad='';if(_0x2e4f6b[_0xf8f6('0x10b')]){if(!this[_0xf8f6('0x85')](_0x2e4f6b['trunk_id'])){return this[_0xf8f6('0x11')]['error'](_0x2e4f6b,'no\x20trunk\x20selected');}else{var _0x3c526a=parseInt(_0x2e4f6b[_0xf8f6('0x10b')],0xa);if(isNaN(_0x3c526a)){_0x1f6aad=_0x2e4f6b[_0xf8f6('0x10b')];}else{_0x1f6aad=this['getTrunk'][_0xf8f6('0x70')](this,_0x2e4f6b[_0xf8f6('0x10b')]);if(!_0x1f6aad){return this[_0xf8f6('0x11')][_0xf8f6('0x2d')](_0x2e4f6b,_0xf8f6('0x10c'));}}}}else if(_0x2e4f6b[_0xf8f6('0x10d')]){_0x1f6aad=_0x2e4f6b[_0xf8f6('0x10d')];}else{return this['channel'][_0xf8f6('0x2d')](_0x2e4f6b,_0xf8f6('0x10e'));}var _0x39fa5b=this[_0xf8f6('0x11')]['exec'](_0xf8f6('0xe6'),[util[_0xf8f6('0x99')](_0xf8f6('0x10f'),_0x1f6aad,_0x2e4f6b[_0xf8f6('0x4b')]),_0x2e4f6b[_0xf8f6('0x65')],_0x2e4f6b['opts'],_0x2e4f6b[_0xf8f6('0xe9')]]);if(_0x39fa5b['result']===-0x1){return _0x39fa5b;}return this[_0xf8f6('0x11')][_0xf8f6('0xa5')](util[_0xf8f6('0x99')](_0xf8f6('0x110'),_0xf8f6('0xe6')));};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x111')]=function(_0x289e6e){logger[_0xf8f6('0x2f')](util[_0xf8f6('0x99')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x289e6e[_0xf8f6('0x39')]));return this['channel'][_0xf8f6('0xa5')](_0xf8f6('0x111'));};AGIVertices[_0xf8f6('0x16')]['getdigits']=function(_0x21ca0c){logger['info'](util[_0xf8f6('0x99')](_0xf8f6('0x112'),_0x21ca0c[_0xf8f6('0x39')]));if(_0x21ca0c[_0xf8f6('0xa1')]===0x0){return this[_0xf8f6('0xa2')](_0x21ca0c);}_0x21ca0c[_0xf8f6('0xa1')]-=0x1;if(!this['isConfigured'](_0x21ca0c[_0xf8f6('0x113')])){return this[_0xf8f6('0x11')]['error'](_0x21ca0c,'no\x20file\x20audio\x20selected');}var _0x51671a=this[_0xf8f6('0x114')][_0xf8f6('0x70')](this,_0x21ca0c['file_id']);if(!_0x51671a){return this[_0xf8f6('0x11')][_0xf8f6('0x2d')](_0x21ca0c,_0xf8f6('0x115'));}if(!this[_0xf8f6('0x85')](_0x21ca0c[_0xf8f6('0xdb')])){return this[_0xf8f6('0x11')]['error'](_0xf8f6('0xdc'));}var _0x367ef6=this['channel'][_0xf8f6('0x116')](_0x51671a,_0x21ca0c[_0xf8f6('0x117')],_0x21ca0c[_0xf8f6('0x118')]);var _0x3411e9=_0x367ef6['result']?_0x367ef6['result'][_0xf8f6('0x4e')]():'';logger[_0xf8f6('0x2f')]('test',JSON[_0xf8f6('0x73')](_0x367ef6));if(_0x367ef6[_0xf8f6('0x9e')]===-0x1){this[_0xf8f6('0x37')]['sync'](this,_0x21ca0c,_0x3411e9);return _0x367ef6;}else if(_0x367ef6[_0xf8f6('0x9f')]===_0xf8f6('0x65')){_0x367ef6[_0xf8f6('0x9e')]=_0x3411e9[_0xf8f6('0x9b')]>=parseInt(_0x21ca0c[_0xf8f6('0x119')])?'x':'i';}else{_0x367ef6[_0xf8f6('0x9e')]=_0x3411e9['length']>=parseInt(_0x21ca0c[_0xf8f6('0x119')])&&_0x3411e9[_0xf8f6('0x9b')]<=parseInt(_0x21ca0c[_0xf8f6('0x118')])?'x':'i';}var _0x18bf3a=this['getVariable'][_0xf8f6('0x70')](this,_0x21ca0c[_0xf8f6('0xdb')]);if(!_0x18bf3a){return this[_0xf8f6('0x11')]['error'](_0x21ca0c,_0xf8f6('0x11a'));}this[_0xf8f6('0x11')][_0xf8f6('0xa0')](_0x18bf3a,_0x3411e9);if(this[_0xf8f6('0x85')](_0x21ca0c[_0xf8f6('0x11b')])){var _0x86dead=parseInt(_0x21ca0c[_0xf8f6('0x11b')],0xa);var _0x2fbdec=rs['generate']({'charset':'*','length':_0x86dead});var _0x2e04b1=_0x3411e9[_0xf8f6('0x9b')];if(_0x2e04b1>0x0){if(_0x2e04b1>_0x86dead){this['createSquareDetailsReport'][_0xf8f6('0x70')](this,_0x21ca0c,_0x21ca0c['hiddendigitspos']===_0xf8f6('0x11c')?_0x2fbdec+_0x3411e9[_0xf8f6('0x11d')](_0x86dead):_0x3411e9['substr'](0x0,_0x2e04b1-_0x86dead)+_0x2fbdec);}else{this[_0xf8f6('0x37')][_0xf8f6('0x70')](this,_0x21ca0c,rs[_0xf8f6('0x11e')]({'charset':'*','length':_0x2e04b1}));}}else{this['createSquareDetailsReport'][_0xf8f6('0x70')](this,_0x21ca0c,'');}}else{this[_0xf8f6('0x37')][_0xf8f6('0x70')](this,_0x21ca0c,_0x3411e9);}return _0x367ef6;};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x11f')]=function(_0x2c24cf){logger['info'](util[_0xf8f6('0x99')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x2c24cf[_0xf8f6('0x39')]));return this['getdigits'](_0x2c24cf);};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x120')]=function(_0xd35a76){logger[_0xf8f6('0x2f')](util['format'](_0xf8f6('0x121'),_0xd35a76[_0xf8f6('0x39')]));this['createSquareDetailsReport']['sync'](this,_0xd35a76,_0xd35a76['goalname']);return this[_0xf8f6('0x11')]['noop'](util[_0xf8f6('0x99')]('GOAL\x20%s',_0xd35a76['goalname']));};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x122')]=function(_0x2c7b69){logger[_0xf8f6('0x2f')](util[_0xf8f6('0x99')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x2c7b69[_0xf8f6('0x39')]));if(!this[_0xf8f6('0x85')](_0x2c7b69['aws_access_key_id'])||!this[_0xf8f6('0x85')](_0x2c7b69['aws_secret_access_key'])){return this['channel'][_0xf8f6('0xa5')](_0xf8f6('0x123'));}if(!this[_0xf8f6('0x85')](_0x2c7b69[_0xf8f6('0x5d')])){return this[_0xf8f6('0x11')][_0xf8f6('0xa5')](_0xf8f6('0xa6'));}this[_0xf8f6('0x11')][_0xf8f6('0xa5')](util[_0xf8f6('0x99')](_0xf8f6('0x124'),_0x2c7b69[_0xf8f6('0x5d')]));var _0x2f654d=this[_0xf8f6('0x87')][_0xf8f6('0x70')](this,_0x2c7b69);if(_0x2f654d){this['channel']['noop'](util['format'](_0xf8f6('0x125'),_0x2f654d));var _0x43b17c=this[_0xf8f6('0x11')][_0xf8f6('0x105')](_0x2f654d);try{fs[_0xf8f6('0x106')](_0x2f654d+_0xf8f6('0x126'));}catch(_0x1ea3cb){logger[_0xf8f6('0x2d')](_0x1ea3cb);}return _0x43b17c;}return this[_0xf8f6('0x11')][_0xf8f6('0x2d')](_0x2c7b69,_0xf8f6('0x127'));};AGIVertices[_0xf8f6('0x16')]['awslex']=function(_0x234938){logger['info'](util['format']('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x234938[_0xf8f6('0x39')]));if(!this[_0xf8f6('0x85')](_0x234938[_0xf8f6('0x88')])||!this[_0xf8f6('0x85')](_0x234938[_0xf8f6('0x89')])){return this[_0xf8f6('0x11')]['noop'](_0xf8f6('0x123'));}if(!this['isConfigured'](_0x234938['aws_bot_name'])){return this[_0xf8f6('0x11')][_0xf8f6('0xa5')](_0xf8f6('0x128'));}if(!this[_0xf8f6('0x85')](_0x234938[_0xf8f6('0x5d')])){return this[_0xf8f6('0x11')][_0xf8f6('0xa5')]('no\x20text\x20configured');}this[_0xf8f6('0x11')][_0xf8f6('0xf3')]=!![];this[_0xf8f6('0x37')](_0x234938);this[_0xf8f6('0x44')](_0x234938[_0xf8f6('0x5d')],'in','','');this['channel'][_0xf8f6('0xa5')](util['format'](_0xf8f6('0x129'),_0x234938[_0xf8f6('0x5d')]));var _0x5ed129=this[_0xf8f6('0x8c')][_0xf8f6('0x70')](this,_0x234938);if(_0x5ed129){for(var _0x17187f in _0x5ed129){if(_0x5ed129[_0xf8f6('0x92')](_0x17187f)&&_[_0xf8f6('0x12a')](_0x5ed129[_0x17187f])){this[_0xf8f6('0x11')][_0xf8f6('0xa0')](util[_0xf8f6('0x99')](_0xf8f6('0x12b'),_0x17187f['toUpperCase']()),_0x5ed129[_0x17187f]);}}if(_['isNil'](_0x5ed129[_0xf8f6('0x12c')])){return this[_0xf8f6('0x11')][_0xf8f6('0xa5')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0xf8f6('0x44')](_0x5ed129[_0xf8f6('0x12c')],_0xf8f6('0xf6'),_0xf8f6('0x12d'),'');return this[_0xf8f6('0x11')][_0xf8f6('0xa5')](util[_0xf8f6('0x99')](_0xf8f6('0x12e'),_0x5ed129[_0xf8f6('0x12c')]));}}return this[_0xf8f6('0x11')][_0xf8f6('0x2d')](_0x234938,_0xf8f6('0x12f'));};AGIVertices[_0xf8f6('0x16')]['googleasr']=function(_0x1757c2){logger[_0xf8f6('0x2f')](util[_0xf8f6('0x99')](_0xf8f6('0x130'),_0x1757c2[_0xf8f6('0x39')],_0x1757c2['timeout']));if(!this['isConfigured'](_0x1757c2[_0xf8f6('0x83')])){return this['channel'][_0xf8f6('0xa5')](_0xf8f6('0x131'));}var _0xa24505=_0xf8f6('0x132');var _0x1b90d0=util[_0xf8f6('0x99')](_0xf8f6('0x133'),FILES_PATH,rs[_0xf8f6('0x11e')](0x4));var _0x27bbc4=util['format'](_0xf8f6('0x9a'),_0x1b90d0,_0xa24505);var _0x5884e4=!![];if(_0x1757c2[_0xf8f6('0x134')]==='NOBEEP'){_0x5884e4=![];}var _0x4649e6=this[_0xf8f6('0x11')][_0xf8f6('0x135')](_0x1b90d0,_0xa24505,_0x1757c2[_0xf8f6('0x136')],_0x1757c2[_0xf8f6('0x65')],undefined,_0x5884e4);if(_0x4649e6[_0xf8f6('0x9e')]!==-0x1){this[_0xf8f6('0x11')][_0xf8f6('0xa5')](util[_0xf8f6('0x99')](_0xf8f6('0x137'),_0x27bbc4));var _0x46754e=this['googleASR'][_0xf8f6('0x70')](this,_0x1757c2,_0x27bbc4);if(_0x46754e){for(var _0x2c8e8b in _0x46754e){if(_0x46754e[_0xf8f6('0x92')](_0x2c8e8b)){this[_0xf8f6('0x11')][_0xf8f6('0xa0')](util[_0xf8f6('0x99')](_0xf8f6('0x138'),_0x2c8e8b[_0xf8f6('0xee')]()),_0x46754e[_0x2c8e8b]);}}return this['channel'][_0xf8f6('0xa5')](util[_0xf8f6('0x99')]('GoogleASR\x20Result\x20%s',JSON[_0xf8f6('0x73')](_0x46754e)));}}return _0x4649e6;};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x139')]=function(_0x2ded8d){logger[_0xf8f6('0x2f')](util['format'](_0xf8f6('0x13a'),_0x2ded8d[_0xf8f6('0x39')]));if(!this[_0xf8f6('0x85')](_0x2ded8d[_0xf8f6('0x13b')])){return this[_0xf8f6('0x11')][_0xf8f6('0xa5')](_0xf8f6('0x13c'));}if(!this[_0xf8f6('0x85')](_0x2ded8d['appsecret'])){return this[_0xf8f6('0x11')]['noop']('no\x20appsecret\x20configured');}var _0x1a39cc='wav';var _0x5cb979=util[_0xf8f6('0x99')](_0xf8f6('0x133'),FILES_PATH,rs[_0xf8f6('0x11e')](0x4));var _0x11ffed=util[_0xf8f6('0x99')]('%s.%s',_0x5cb979,_0x1a39cc);var _0x439e29=!![];if(_0x2ded8d[_0xf8f6('0x134')]==='NOBEEP'){_0x439e29=![];}var _0x1068cf=this['channel'][_0xf8f6('0x135')](_0x5cb979,_0x1a39cc,_0x2ded8d[_0xf8f6('0x136')],_0x2ded8d[_0xf8f6('0x65')],undefined,_0x439e29);if(_0x1068cf[_0xf8f6('0x9e')]!==-0x1){this[_0xf8f6('0x11')]['noop'](util[_0xf8f6('0x99')]('tilde\x20%s\x20file\x20created',_0x11ffed));var _0x1e6bca=this[_0xf8f6('0x8f')]['sync'](this,_0x2ded8d,_0x11ffed);if(_0x1e6bca){for(var _0x830848 in _0x1e6bca){if(_0x1e6bca[_0xf8f6('0x92')](_0x830848)){this['channel'][_0xf8f6('0xa0')](util[_0xf8f6('0x99')]('TILDE_ASR_%s',_0x830848[_0xf8f6('0xee')]()),_0x1e6bca[_0x830848]);}}return this['channel'][_0xf8f6('0xa5')](util['format'](_0xf8f6('0x13d'),JSON[_0xf8f6('0x73')](_0x1e6bca)));}}return _0x1068cf;};AGIVertices['prototype']['gotoc']=function(_0x2fb146){logger[_0xf8f6('0x2f')](util['format'](_0xf8f6('0x13e'),_0x2fb146[_0xf8f6('0x39')]));return this['channel'][_0xf8f6('0x13f')](_0x2fb146[_0xf8f6('0x3f')],_0x2fb146['extension'],_0x2fb146[_0xf8f6('0x41')]);};AGIVertices['prototype'][_0xf8f6('0x140')]=function(_0x25b572){logger[_0xf8f6('0x2f')](util['format'](_0xf8f6('0x141'),_0x25b572[_0xf8f6('0x39')]));if(!this[_0xf8f6('0x85')](_0x25b572['condition'])){return this[_0xf8f6('0x11')]['error'](_0x25b572,_0xf8f6('0x142'));}try{var _0x1d5256=eval(_0x25b572[_0xf8f6('0x143')])?'true':_0xf8f6('0x144');this[_0xf8f6('0x11')][_0xf8f6('0xa5')](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0x25b572['condition'],_0x1d5256));return{'code':0xc8,'result':_0x1d5256};}catch(_0x1f273c){return{'code':0xc8,'result':'false'};}};AGIVertices['prototype'][_0xf8f6('0x145')]=function(_0x5d5328){logger[_0xf8f6('0x2f')](util[_0xf8f6('0x99')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x5d5328[_0xf8f6('0x39')]));if(!this[_0xf8f6('0x85')](_0x5d5328['interval_id'])){return this['channel'][_0xf8f6('0x2d')](_0x5d5328,_0xf8f6('0x146'));}var _0x5c0e47=this[_0xf8f6('0x26')]['sync'](this,_0x5d5328[_0xf8f6('0x147')]);if(!_0x5c0e47){return this[_0xf8f6('0x11')][_0xf8f6('0x2d')](_0x5d5328,_0xf8f6('0x148'));}for(var _0x244d5e=0x0;_0x244d5e<_0x5c0e47['length'];_0x244d5e+=0x1){var _0x58f130=this[_0xf8f6('0x11')][_0xf8f6('0x9d')](util[_0xf8f6('0x99')](_0xf8f6('0x149'),_0x5c0e47[_0x244d5e]));if(_0x58f130[_0xf8f6('0x9e')]===-0x1){return _0x58f130;}logger[_0xf8f6('0x2f')](util['format']('IFTIME\x20%s\x20%s',_0x5c0e47[_0x244d5e],_0x58f130[_0xf8f6('0x9f')]));if(_0x58f130[_0xf8f6('0x9f')]===_0xf8f6('0x14a')){logger[_0xf8f6('0x2f')](util[_0xf8f6('0x99')](_0xf8f6('0x14b'),_0x5c0e47[_0x244d5e],_0xf8f6('0x14a')));this[_0xf8f6('0x11')][_0xf8f6('0xa5')](util[_0xf8f6('0x99')](_0xf8f6('0x14b'),_0x5c0e47[_0x244d5e],'true'));return{'code':0xc8,'result':_0xf8f6('0x14a')};}else{logger[_0xf8f6('0x2f')](util[_0xf8f6('0x99')]('IFTIME\x20%s\x20%s',_0x5c0e47[_0x244d5e],_0xf8f6('0x144')));this[_0xf8f6('0x11')][_0xf8f6('0xa5')](util['format'](_0xf8f6('0x14b'),_0x5c0e47[_0x244d5e],_0xf8f6('0x144')));}}return{'code':0xc8,'result':_0xf8f6('0x144')};};AGIVertices['prototype'][_0xf8f6('0x14c')]=function(_0x86c6cc){logger['info'](util['format'](_0xf8f6('0x14d'),_0x86c6cc[_0xf8f6('0x39')]));return this[_0xf8f6('0x11')]['hangup']();};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x14e')]=function(_0x4007a3){logger[_0xf8f6('0x2f')](util[_0xf8f6('0x99')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x4007a3[_0xf8f6('0x39')]));if(!this[_0xf8f6('0x85')](_0x4007a3[_0xf8f6('0x83')])){return this['channel']['noop']('no\x20key\x20configured');}var _0x40b994=_0xf8f6('0x132');var _0x3dd85a=util[_0xf8f6('0x99')](_0xf8f6('0x133'),FILES_PATH,rs[_0xf8f6('0x11e')](0x4));var _0x561187=util[_0xf8f6('0x99')](_0xf8f6('0x9a'),_0x3dd85a,_0x40b994);var _0x2c6262=!![];if(_0x4007a3[_0xf8f6('0x134')]===_0xf8f6('0x14f')){_0x2c6262=![];}var _0x1f5eb6=this['channel'][_0xf8f6('0x135')](_0x3dd85a,_0x40b994,_0x4007a3[_0xf8f6('0x136')],_0x4007a3['timeout'],undefined,_0x2c6262);if(_0x1f5eb6[_0xf8f6('0x9e')]!==-0x1){this['channel'][_0xf8f6('0xa5')](util[_0xf8f6('0x99')]('ispeech\x20%s\x20file\x20created',_0x561187));var _0x45011f=this[_0xf8f6('0x82')][_0xf8f6('0x70')](this,_0x4007a3,_0x561187);if(_0x45011f){for(var _0x172644 in _0x45011f){if(_0x45011f[_0xf8f6('0x92')](_0x172644)){this[_0xf8f6('0x11')][_0xf8f6('0xa0')](util[_0xf8f6('0x99')](_0xf8f6('0x150'),_0x172644[_0xf8f6('0xee')]()),_0x45011f[_0x172644]);}}return this[_0xf8f6('0x11')]['noop'](util[_0xf8f6('0x99')](_0xf8f6('0x151'),JSON[_0xf8f6('0x73')](_0x45011f)));}}return _0x1f5eb6;};AGIVertices[_0xf8f6('0x16')]['ispeechtts']=function(_0x553c0a){logger[_0xf8f6('0x2f')](util['format']('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x553c0a[_0xf8f6('0x39')]));if(!this[_0xf8f6('0x85')](_0x553c0a[_0xf8f6('0x83')])){return this[_0xf8f6('0x11')][_0xf8f6('0xa5')](_0xf8f6('0x131'));}if(!this[_0xf8f6('0x85')](_0x553c0a[_0xf8f6('0x5d')])){return this[_0xf8f6('0x11')][_0xf8f6('0xa5')](_0xf8f6('0xa6'));}this[_0xf8f6('0x11')]['noop'](util[_0xf8f6('0x99')](_0xf8f6('0x152'),_0x553c0a['text']));var _0x5cb841=this[_0xf8f6('0x80')][_0xf8f6('0x70')](this,_0x553c0a);if(_0x5cb841){this[_0xf8f6('0x11')][_0xf8f6('0xa5')](util[_0xf8f6('0x99')]('ispeech\x20%s\x20file\x20created',_0x5cb841));var _0x137f6b=this[_0xf8f6('0x11')]['streamFile'](_0x5cb841,_0x553c0a[_0xf8f6('0x136')]);try{fs[_0xf8f6('0x106')](_0x5cb841+_0xf8f6('0x126'));}catch(_0x41f9d0){logger['error'](_0x41f9d0);}return _0x137f6b;}return this[_0xf8f6('0x11')][_0xf8f6('0x2d')](_0x553c0a,_0xf8f6('0x153'));};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x154')]=function(_0x19ed87){logger[_0xf8f6('0x2f')](util[_0xf8f6('0x99')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x19ed87['label']));if(!this['isConfigured'](_0x19ed87[_0xf8f6('0x155')])){return this['channel']['error'](_0x19ed87,_0xf8f6('0x156'));}logger[_0xf8f6('0x2f')](util[_0xf8f6('0x99')](_0xf8f6('0x157'),this[_0xf8f6('0x11')]['callerid'],_0x19ed87[_0xf8f6('0x155')]));var _0x3ed477=this[_0xf8f6('0x53')][_0xf8f6('0x70')](this,_0x19ed87[_0xf8f6('0x155')]);if(_0x3ed477){logger[_0xf8f6('0x2f')](util[_0xf8f6('0x99')](_0xf8f6('0x158'),this[_0xf8f6('0x11')][_0xf8f6('0x3c')],_0x19ed87['findBy']));this[_0xf8f6('0x11')][_0xf8f6('0xa5')](util[_0xf8f6('0x99')](_0xf8f6('0x158'),this['channel'][_0xf8f6('0x3c')],_0x19ed87[_0xf8f6('0x155')]));return{'code':0xc8,'result':_0xf8f6('0x159')};}else{logger[_0xf8f6('0x2f')](util['format'](_0xf8f6('0x15a'),this[_0xf8f6('0x11')][_0xf8f6('0x3c')],_0x19ed87[_0xf8f6('0x155')]));this['channel']['noop'](util[_0xf8f6('0x99')](_0xf8f6('0x15a'),this[_0xf8f6('0x11')][_0xf8f6('0x3c')],_0x19ed87['findBy']));return{'code':0xc8,'result':_0xf8f6('0x15b')};}};AGIVertices['prototype']['logout']=function(_0x25ed59){logger['info'](util[_0xf8f6('0x99')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x25ed59[_0xf8f6('0x39')]));if(!this['isConfigured'](_0x25ed59[_0xf8f6('0x155')])){return this['channel']['error'](_0x25ed59,'no\x20find\x20by\x20configured');}logger['info'](util['format'](_0xf8f6('0x157'),this['channel'][_0xf8f6('0x3c')],_0x25ed59[_0xf8f6('0x155')]));var _0x588cd1=this[_0xf8f6('0x15c')][_0xf8f6('0x70')](this,_0x25ed59[_0xf8f6('0x155')]);if(_0x588cd1){logger[_0xf8f6('0x2f')](util['format'](_0xf8f6('0x158'),this[_0xf8f6('0x11')][_0xf8f6('0x3c')],_0x25ed59[_0xf8f6('0x155')]));this[_0xf8f6('0x11')][_0xf8f6('0xa5')](util[_0xf8f6('0x99')](_0xf8f6('0x158'),this[_0xf8f6('0x11')][_0xf8f6('0x3c')],_0x25ed59[_0xf8f6('0x155')]));return{'code':0xc8,'result':_0xf8f6('0x159')};}else{logger[_0xf8f6('0x2f')](util[_0xf8f6('0x99')](_0xf8f6('0x15a'),this[_0xf8f6('0x11')][_0xf8f6('0x3c')],_0x25ed59[_0xf8f6('0x155')]));this['channel']['noop'](util[_0xf8f6('0x99')](_0xf8f6('0x15a'),this[_0xf8f6('0x11')][_0xf8f6('0x3c')],_0x25ed59[_0xf8f6('0x155')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0xf8f6('0x15d')]=function(_0x4ce86d){logger['info'](util[_0xf8f6('0x99')](_0xf8f6('0x15e'),_0x4ce86d[_0xf8f6('0x39')]));if(!this[_0xf8f6('0x85')](_0x4ce86d['operation'])){return this[_0xf8f6('0x11')]['error'](_0x4ce86d,_0xf8f6('0x15f'));}this['channel'][_0xf8f6('0xa5')](util[_0xf8f6('0x99')](_0xf8f6('0x160'),_0x4ce86d[_0xf8f6('0x161')]));var _0x44cc9b=eval(_0x4ce86d['operation']);if(!this[_0xf8f6('0x85')](_0x4ce86d[_0xf8f6('0xdb')])){return this[_0xf8f6('0x11')][_0xf8f6('0xa5')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x4f9e01=this['getVariable'][_0xf8f6('0x70')](this,_0x4ce86d['variable_id']);if(!_0x4f9e01){return this['channel'][_0xf8f6('0x2d')](_0x4ce86d,_0xf8f6('0x11a'));}if(_[_0xf8f6('0x97')](_0x44cc9b)){var _0xd5255f=this;_0x44cc9b[_0xf8f6('0xdd')](function(_0x15930c,_0x301a56){_0xd5255f[_0xf8f6('0x11')][_0xf8f6('0xa0')](util['format'](_0xf8f6('0x162'),_0x4f9e01,_0x301a56),_0x15930c);});return this[_0xf8f6('0x11')]['noop'](util[_0xf8f6('0x99')](_0xf8f6('0x163'),_0x4f9e01));}else{return this[_0xf8f6('0x11')][_0xf8f6('0xa0')](_0x4f9e01,_0x44cc9b);}};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0xf')]=function(_0x41f02b){logger[_0xf8f6('0x2f')](util[_0xf8f6('0x99')](_0xf8f6('0x164'),_0x41f02b['label']));if(_0x41f02b[_0xf8f6('0xa1')]===0x0){return this['maxRetry'](_0x41f02b);}_0x41f02b[_0xf8f6('0xa1')]-=0x1;if(!this[_0xf8f6('0x85')](_0x41f02b['file_id'])){return this['channel'][_0xf8f6('0x2d')](_0x41f02b,_0xf8f6('0x165'));}var _0x257356=this[_0xf8f6('0x114')]['sync'](this,_0x41f02b['file_id']);if(!_0x257356){return this[_0xf8f6('0x11')]['error'](_0x41f02b,_0xf8f6('0x115'));}var _0x3eb748=this[_0xf8f6('0x11')]['getData'](_0x257356,_0x41f02b[_0xf8f6('0x117')],_0x41f02b[_0xf8f6('0x166')]);var _0x522897=_0x3eb748[_0xf8f6('0x9e')];if(_0x3eb748['result']===-0x1){this[_0xf8f6('0x37')][_0xf8f6('0x70')](this,_0x41f02b,'-1');return _0x3eb748;}else if(_0x3eb748['extra']===_0xf8f6('0x65')){_0x3eb748['result']=_0x3eb748[_0xf8f6('0x9e')][_0xf8f6('0x9b')]>0x0?_0x3eb748['result']:'t';}else if(_['isEmpty'](_0x3eb748['result'])){_0x3eb748[_0xf8f6('0x9e')]='#';_0x522897='#';}if(!this[_0xf8f6('0x85')](_0x41f02b[_0xf8f6('0xdb')])){this[_0xf8f6('0x11')][_0xf8f6('0xa5')](_0xf8f6('0xdc'));}else{var _0x1ad832=this[_0xf8f6('0x9d')]['sync'](this,_0x41f02b[_0xf8f6('0xdb')]);if(!_0x1ad832){return this['channel'][_0xf8f6('0x2d')](_0x41f02b,_0xf8f6('0x11a'));}this['channel']['setVariable'](_0x1ad832,_0x522897);}this[_0xf8f6('0x37')][_0xf8f6('0x70')](this,_0x41f02b,_0x522897);return _0x3eb748;};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0xa5')]=function(_0x1c8e99){logger[_0xf8f6('0x2f')](util['format']('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x1c8e99[_0xf8f6('0x39')]));return this[_0xf8f6('0x11')][_0xf8f6('0xa5')](_0x1c8e99[_0xf8f6('0x167')]||_0x1c8e99[_0xf8f6('0x39')]);};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x168')]=function(_0x421855){logger[_0xf8f6('0x2f')](util['format'](_0xf8f6('0x169'),_0x421855[_0xf8f6('0x39')]));if(!this[_0xf8f6('0x85')](_0x421855[_0xf8f6('0x155')])){return this[_0xf8f6('0x11')][_0xf8f6('0x2d')](_0x421855,_0xf8f6('0x156'));}logger['info'](util[_0xf8f6('0x99')](_0xf8f6('0x157'),this[_0xf8f6('0x11')]['callerid'],_0x421855[_0xf8f6('0x155')]));var _0x481c43=this['getPause'][_0xf8f6('0x70')](this,_0x421855[_0xf8f6('0x16a')]);var _0x1fd1e1=this[_0xf8f6('0x50')][_0xf8f6('0x70')](this,_0x421855[_0xf8f6('0x155')],_0x481c43);if(_0x1fd1e1){logger[_0xf8f6('0x2f')](util[_0xf8f6('0x99')](_0xf8f6('0x158'),this[_0xf8f6('0x11')]['callerid'],_0x421855[_0xf8f6('0x155')]));this['channel'][_0xf8f6('0xa5')](util[_0xf8f6('0x99')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xf8f6('0x11')][_0xf8f6('0x3c')],_0x421855['findBy']));return{'code':0xc8,'result':_0xf8f6('0x159')};}else{logger[_0xf8f6('0x2f')](util[_0xf8f6('0x99')](_0xf8f6('0x15a'),this['channel']['callerid'],_0x421855['findBy']));this['channel'][_0xf8f6('0xa5')](util[_0xf8f6('0x99')](_0xf8f6('0x158'),this[_0xf8f6('0x11')][_0xf8f6('0x3c')],_0x421855[_0xf8f6('0x155')]));return{'code':0xc8,'result':_0xf8f6('0x15b')};}};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x16b')]=function(_0x575121){logger['info'](util['format'](_0xf8f6('0x16c'),_0x575121['label']));if(!this[_0xf8f6('0x85')](_0x575121[_0xf8f6('0x113')])){return this[_0xf8f6('0x11')]['error'](_0x575121,'no\x20file\x20audio\x20selected');}var _0x567e85=this[_0xf8f6('0x114')][_0xf8f6('0x70')](this,_0x575121[_0xf8f6('0x113')]);if(!_0x567e85){return this['channel'][_0xf8f6('0x2d')](_0x575121,'no\x20file\x20audio\x20found');}var _0x30626e=this[_0xf8f6('0x11')][_0xf8f6('0xa7')]('PLAYBACK',[_0x567e85,_0x575121[_0xf8f6('0xe8')]]);if(_0x30626e[_0xf8f6('0x9e')]===-0x1){return _0x30626e;}return this[_0xf8f6('0x11')][_0xf8f6('0xa5')](util[_0xf8f6('0x99')](_0xf8f6('0xc5'),_0xf8f6('0x16d'),_0x567e85));};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x16e')]=function(_0x4ab5cb){logger[_0xf8f6('0x2f')](util['format'](_0xf8f6('0x16f'),_0x4ab5cb[_0xf8f6('0x39')]));if(!this[_0xf8f6('0x85')](_0x4ab5cb[_0xf8f6('0x170')])){return this[_0xf8f6('0x11')][_0xf8f6('0x2d')](_0x4ab5cb,_0xf8f6('0x171'));}var _0x30144e='';var _0x363cff=parseInt(_0x4ab5cb[_0xf8f6('0x170')],0xa);if(isNaN(_0x363cff)){_0x30144e=_0x4ab5cb[_0xf8f6('0x170')];}else{_0x30144e=this[_0xf8f6('0x17')]['sync'](this,_0x4ab5cb[_0xf8f6('0x170')]);if(!_0x30144e){return this[_0xf8f6('0x11')][_0xf8f6('0x2d')](_0x4ab5cb,'no\x20queue\x20found');}}var _0x3eced4='';if(this[_0xf8f6('0x85')](_0x4ab5cb[_0xf8f6('0x113')])){var _0x17a0b8=this[_0xf8f6('0x114')][_0xf8f6('0x70')](this,_0x4ab5cb[_0xf8f6('0x113')]);if(_0x17a0b8){_0x3eced4=_0x17a0b8;}}this[_0xf8f6('0x37')][_0xf8f6('0x70')](this,_0x4ab5cb,_0x30144e);if(_0x4ab5cb[_0xf8f6('0xe8')][_0xf8f6('0x172')]('x')<0x0){_0x4ab5cb[_0xf8f6('0xe8')]+='x';}if(_0x4ab5cb['opts'][_0xf8f6('0x172')]('X')<0x0){_0x4ab5cb[_0xf8f6('0xe8')]+='X';}this[_0xf8f6('0x11')][_0xf8f6('0xa0')](_0xf8f6('0x173'),_0x30144e?_0x30144e[_0xf8f6('0x174')]():'');var _0x364cbe=this[_0xf8f6('0x11')]['exec'](_0xf8f6('0x175'),[_0x30144e,_0x4ab5cb[_0xf8f6('0xe8')],_0x4ab5cb['url'],_0x3eced4,_0x4ab5cb['timeout'],_0x4ab5cb['agi'],_0x4ab5cb[_0xf8f6('0x176')],_0x4ab5cb['gosub'],'',_0x4ab5cb[_0xf8f6('0x177')]]);if(_0x364cbe['result']===-0x1){return _0x364cbe;}return this[_0xf8f6('0x11')][_0xf8f6('0xa5')](util[_0xf8f6('0x99')](_0xf8f6('0xc5'),_0xf8f6('0x175'),_0x30144e));};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x178')]=function(_0x1ccc39){logger['info'](util['format'](_0xf8f6('0x179'),_0x1ccc39[_0xf8f6('0x39')]));var _0x406df0=_0x1ccc39['recordingFormat']||'wav';var _0x4edf36=util[_0xf8f6('0x99')](_0xf8f6('0x17a'),this[_0xf8f6('0x11')][_0xf8f6('0x38')],rs[_0xf8f6('0x11e')](0x5));var _0x375ac4=util[_0xf8f6('0x99')](_0xf8f6('0x17b'),FILES_PATH,_0x4edf36,_0x406df0);var _0x5e41ae=util[_0xf8f6('0x99')](_0xf8f6('0x133'),FILES_PATH,_0x4edf36);this[_0xf8f6('0x3d')][_0xf8f6('0x70')](this,_0x1ccc39,_0x4edf36,_0x375ac4);this[_0xf8f6('0x11')][_0xf8f6('0xa0')](_0xf8f6('0x17c'),_0x4edf36);logger[_0xf8f6('0x2f')](_0xf8f6('0x17d'),_0x5e41ae,_0x406df0,_0x1ccc39[_0xf8f6('0x17e')],_0x1ccc39[_0xf8f6('0x65')]);return this[_0xf8f6('0x11')][_0xf8f6('0x135')](_0x5e41ae,_0x406df0,_0x1ccc39[_0xf8f6('0x17e')],_0x1ccc39[_0xf8f6('0x65')],undefined,!![]);};AGIVertices['prototype'][_0xf8f6('0x17f')]=function(_0x2b4d79){logger[_0xf8f6('0x2f')](util[_0xf8f6('0x99')](_0xf8f6('0x180'),_0x2b4d79['label']));if(!this[_0xf8f6('0x85')](_0x2b4d79[_0xf8f6('0xe9')])){return this[_0xf8f6('0x11')][_0xf8f6('0xa5')](_0xf8f6('0x181'));}var _0x179d1=this[_0xf8f6('0x64')][_0xf8f6('0x70')](this,_0x2b4d79);logger[_0xf8f6('0x2f')](util[_0xf8f6('0x99')](_0xf8f6('0x182'),util[_0xf8f6('0x183')](_0x179d1,{'showHidden':![],'depth':null})));if(!this[_0xf8f6('0x85')](_0x2b4d79['variable_id'])){return this[_0xf8f6('0x11')][_0xf8f6('0xa5')](_0xf8f6('0x184'));}var _0x119f87=this[_0xf8f6('0x9d')][_0xf8f6('0x70')](this,_0x2b4d79['variable_id']);if(!_0x119f87){return this[_0xf8f6('0x11')][_0xf8f6('0x2d')](_0x2b4d79,_0xf8f6('0x11a'));}this[_0xf8f6('0x11')][_0xf8f6('0xa0')](util['format'](_0xf8f6('0x185'),_0x119f87),_0x179d1[_0xf8f6('0x76')]?_0x179d1[_0xf8f6('0x76')]:_0xf8f6('0x186'));this[_0xf8f6('0x11')]['setVariable'](util[_0xf8f6('0x99')](_0xf8f6('0x187'),_0x119f87),_0x179d1[_0xf8f6('0x75')]?_0x179d1[_0xf8f6('0x75')]:'OK');if(_0x179d1[_0xf8f6('0x6a')]){try{this[_0xf8f6('0x98')](_0x179d1[_0xf8f6('0x6a')],_0x119f87);}catch(_0x3f94b1){logger['error'](util['format'](_0xf8f6('0x188'),_0x119f87));}}return this[_0xf8f6('0x11')]['noop'](util[_0xf8f6('0x99')](_0xf8f6('0xe1'),_0x119f87));};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x189')]=function(_0x3c1649){logger['info'](util['format']('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x3c1649[_0xf8f6('0x39')]));return this[_0xf8f6('0x11')]['sayDigits'](_0x3c1649[_0xf8f6('0x18a')][_0xf8f6('0x59')](/\s+/g,''),_0x3c1649['escape_digits']);};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x18b')]=function(_0x4a9f41){logger['info'](util[_0xf8f6('0x99')](_0xf8f6('0x18c'),_0x4a9f41[_0xf8f6('0x39')]));return this[_0xf8f6('0x11')][_0xf8f6('0x18d')](_0x4a9f41[_0xf8f6('0x66')][_0xf8f6('0x59')](/\s+/g,''),_0x4a9f41['escape_digits']);};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x18e')]=function(_0x101de2){logger[_0xf8f6('0x2f')](util[_0xf8f6('0x99')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x101de2[_0xf8f6('0x39')]));return this[_0xf8f6('0x11')]['sayPhonetic'](_0x101de2[_0xf8f6('0x5d')],_0x101de2[_0xf8f6('0x17e')]);};AGIVertices['prototype']['sendMail']=function(_0x400775){logger['info'](util['format'](_0xf8f6('0x18f'),_0x400775['label']));if(!this[_0xf8f6('0x85')](_0x400775['account_id'])){return this[_0xf8f6('0x11')]['noop']('no\x20mail\x20account\x20configured');}var _0x2f3862=this['getMailAccount'][_0xf8f6('0x70')](this,_0x400775[_0xf8f6('0x190')]);if(!_0x2f3862||!_0x2f3862[_0xf8f6('0x191')]){return this[_0xf8f6('0x11')]['error'](_0x400775,_0xf8f6('0x192'));}var _0x45ae2f={'from':util['format']('\x22%s\x22\x20<%s>',_0x2f3862[_0xf8f6('0x15')],_0x2f3862[_0xf8f6('0x193')]||_0x2f3862[_0xf8f6('0x191')]['user']),'to':_0x400775['to']||'','cc':_0x400775['cc']||'','bcc':_0x400775[_0xf8f6('0x194')]||'','subject':_0x400775['subject'],'html':_0x400775[_0xf8f6('0x5d')],'text':_0x400775[_0xf8f6('0x5d')]};var _0x55e58a={'tls':{'rejectUnauthorized':![]}};if(_0x2f3862['Smtp']['service']){_0x55e58a[_0xf8f6('0x195')]=_0x2f3862[_0xf8f6('0x191')][_0xf8f6('0x195')];}else{_0x55e58a[_0xf8f6('0x196')]=_0x2f3862[_0xf8f6('0x191')]['host'];_0x55e58a[_0xf8f6('0x197')]=_0x2f3862[_0xf8f6('0x191')][_0xf8f6('0x197')];_0x55e58a['secure']=_0x2f3862['Smtp'][_0xf8f6('0x198')];}if(_0x2f3862[_0xf8f6('0x191')][_0xf8f6('0x199')]){_0x55e58a[_0xf8f6('0x19a')]={'user':_0x2f3862[_0xf8f6('0x191')][_0xf8f6('0x19b')],'pass':_0x2f3862[_0xf8f6('0x191')][_0xf8f6('0x19c')]};}if(this[_0xf8f6('0x85')](_0x400775[_0xf8f6('0x19d')])){}logger[_0xf8f6('0xe3')]('sendMail\x20message',JSON[_0xf8f6('0x73')](_0x45ae2f));this[_0xf8f6('0x37')][_0xf8f6('0x70')](this,_0x400775,_0x400775[_0xf8f6('0x190')]);this[_0xf8f6('0x11')][_0xf8f6('0xa5')](util[_0xf8f6('0x99')](_0xf8f6('0x19e'),_0x2f3862[_0xf8f6('0x15')]));this[_0xf8f6('0x24')][_0xf8f6('0x70')](this,_0x55e58a,_0x45ae2f);return this[_0xf8f6('0x11')][_0xf8f6('0xa5')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xf8f6('0x16')]['sendFax']=function(_0x1745d6){logger[_0xf8f6('0x2f')](util[_0xf8f6('0x99')](_0xf8f6('0x19f'),_0x1745d6[_0xf8f6('0x39')]));return this['channel']['noop'](_0xf8f6('0x1a0'));};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x1a1')]=function(_0x1db31c){logger[_0xf8f6('0x2f')](util['format'](_0xf8f6('0x1a2'),_0x1db31c[_0xf8f6('0x39')]));if(!this[_0xf8f6('0x85')](_0x1db31c['sms_account_id'])){return this['channel'][_0xf8f6('0xa5')](_0xf8f6('0x1a3'));}var _0x3b44f6=this[_0xf8f6('0x34')][_0xf8f6('0x70')](this,_0x1db31c['sms_account_id']);if(!_0x3b44f6){return this[_0xf8f6('0x11')][_0xf8f6('0x2d')](_0x1db31c,_0xf8f6('0x1a4'));}var _0x2a2b8b={'body':_0x1db31c[_0xf8f6('0x1a5')],'phone':_0x1db31c['to']||'','SmsAccountId':_0x3b44f6['id']};logger['debug'](_0xf8f6('0x1a6'),JSON[_0xf8f6('0x73')](_0x2a2b8b));this['createSquareDetailsReport'][_0xf8f6('0x70')](this,_0x1db31c,_0x1db31c['sms_account_id']);this[_0xf8f6('0x11')][_0xf8f6('0xa5')](util[_0xf8f6('0x99')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x3b44f6['name']));this[_0xf8f6('0x36')]['sync'](this,_0x2a2b8b);return this[_0xf8f6('0x11')][_0xf8f6('0xa5')](_0xf8f6('0x1a7'));};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x1a8')]=function(_0x51549d){logger[_0xf8f6('0x2f')](util['format'](_0xf8f6('0x1a9'),_0x51549d[_0xf8f6('0x39')]));if(!this[_0xf8f6('0x85')](_0x51549d[_0xf8f6('0xdb')])){return this[_0xf8f6('0x11')][_0xf8f6('0x2d')](_0x51549d,'no\x20variable\x20selected');}var _0x2df54b=this[_0xf8f6('0x9d')][_0xf8f6('0x70')](this,_0x51549d['variable_id']);if(!_0x2df54b){return this[_0xf8f6('0x11')][_0xf8f6('0x2d')](_0x51549d,_0xf8f6('0x11a'));}return this['channel'][_0xf8f6('0xa0')](_0x2df54b,_0x51549d[_0xf8f6('0x1aa')]);};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x1ab')]=function(_0x507e5c){logger[_0xf8f6('0x2f')](util[_0xf8f6('0x99')](_0xf8f6('0x1ac'),_0x507e5c[_0xf8f6('0x39')]));this['channel'][_0xf8f6('0xa5')]('START\x20CALLY\x20SQUARE');if(_0x507e5c[_0xf8f6('0xb7')]==='yes'){this[_0xf8f6('0x11')][_0xf8f6('0xa5')](_0xf8f6('0x1ad'));return this[_0xf8f6('0x11')][_0xf8f6('0xb7')]();}return this[_0xf8f6('0x11')]['noop']('Skipped\x20Answer');};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x1ae')]=function(_0x5d5bc6){logger[_0xf8f6('0x2f')](util[_0xf8f6('0x99')](_0xf8f6('0x1af'),_0x5d5bc6[_0xf8f6('0x39')]));if(!this[_0xf8f6('0x85')](_0x5d5bc6['project_id'])){return this[_0xf8f6('0x11')][_0xf8f6('0x2d')](_0x5d5bc6,_0xf8f6('0x1b0'));}var _0x2be3e4=this[_0xf8f6('0x18')][_0xf8f6('0x70')](this,_0x5d5bc6[_0xf8f6('0x1b1')]);if(!this[_0xf8f6('0x85')](_0x2be3e4)){return this[_0xf8f6('0x11')][_0xf8f6('0x2d')](_0x5d5bc6,util[_0xf8f6('0x99')](_0xf8f6('0x1b2'),_0x5d5bc6[_0xf8f6('0x1b1')]));}if(_0x2be3e4===this['channel'][_0xf8f6('0x3b')]){return this['channel'][_0xf8f6('0x2d')](_0x5d5bc6,_0xf8f6('0x1b3'));}this['createSquareDetailsReport'][_0xf8f6('0x70')](this,_0x5d5bc6,_0x2be3e4);var _0x3b78fc=this[_0xf8f6('0x11')][_0xf8f6('0xa7')](_0xf8f6('0x1b4'),util[_0xf8f6('0x99')](_0xf8f6('0x1b5'),config[_0xf8f6('0xb4')][_0xf8f6('0x196')]||_0xf8f6('0x1b6'),_0x2be3e4,this[_0xf8f6('0x11')]['arg_1']));if(_0x3b78fc[_0xf8f6('0x9e')]===-0x1){return _0x3b78fc;}return this[_0xf8f6('0x11')][_0xf8f6('0xa5')](util[_0xf8f6('0x99')](_0xf8f6('0xc5'),_0xf8f6('0x1b4'),_0x2be3e4));};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x1b7')]=function(_0x3e5289){logger[_0xf8f6('0x2f')](util[_0xf8f6('0x99')](_0xf8f6('0x1b8'),_0x3e5289[_0xf8f6('0x39')]));var _0x4b5672=this[_0xf8f6('0x57')]['sync'](this,_0x3e5289['command']);this['createSquareDetailsReport'][_0xf8f6('0x70')](this,_0x3e5289,_0x3e5289['command']);if(this[_0xf8f6('0x85')](_0x3e5289['variable_id'])){var _0x361067=this['getVariable'][_0xf8f6('0x70')](this,_0x3e5289[_0xf8f6('0xdb')]);if(_0x361067){this[_0xf8f6('0x11')][_0xf8f6('0xa0')](_0x361067,_0x4b5672);return this[_0xf8f6('0x11')]['noop'](util[_0xf8f6('0x99')](_0xf8f6('0x1b9'),_0x3e5289[_0xf8f6('0xb6')],_0x361067));}}return this[_0xf8f6('0x11')][_0xf8f6('0xa5')](util[_0xf8f6('0x99')](_0xf8f6('0x1ba'),_0x3e5289[_0xf8f6('0xb6')]));};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x1bb')]=function(_0x166263){logger[_0xf8f6('0x2f')](util[_0xf8f6('0x99')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x166263[_0xf8f6('0x39')]));_0x166263[_0xf8f6('0x5d')]=_0x166263[_0xf8f6('0x5d')][_0xf8f6('0x59')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x166263['apiKey'])){return this[_0xf8f6('0x11')][_0xf8f6('0xa5')](_0xf8f6('0x1bc'));}if(!this[_0xf8f6('0x85')](_0x166263['text'])){return this[_0xf8f6('0x11')][_0xf8f6('0xa5')]('no\x20text\x20configured');}this[_0xf8f6('0x11')][_0xf8f6('0xa5')](util[_0xf8f6('0x99')](_0xf8f6('0x1bd'),_0x166263[_0xf8f6('0x5d')]));var _0x3b5577=this['googleCloudTTS'][_0xf8f6('0x70')](this,_0x166263);if(_0x3b5577){this['channel'][_0xf8f6('0xa5')](util[_0xf8f6('0x99')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x3b5577));var _0x135692=this[_0xf8f6('0x11')]['streamFile'](_0x3b5577);try{fs[_0xf8f6('0x106')](_0x3b5577+_0xf8f6('0x126'));}catch(_0x170785){logger[_0xf8f6('0x2d')](_0x170785);}return _0x135692;}return this[_0xf8f6('0x11')][_0xf8f6('0x2d')](_0x166263,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0xf8f6('0x16')][_0xf8f6('0x1be')]=function(_0x3825a4){logger['info'](util[_0xf8f6('0x99')](_0xf8f6('0x1bf'),_0x3825a4[_0xf8f6('0x39')]));_0x3825a4[_0xf8f6('0x5d')]=_0x3825a4[_0xf8f6('0x5d')][_0xf8f6('0x59')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xf8f6('0x85')](_0x3825a4['text'])){return this[_0xf8f6('0x11')][_0xf8f6('0xa5')](_0xf8f6('0xa6'));}this[_0xf8f6('0x11')]['noop'](util[_0xf8f6('0x99')](_0xf8f6('0x1c0'),_0x3825a4[_0xf8f6('0x5d')]));var _0x573303=this[_0xf8f6('0x62')][_0xf8f6('0x70')](this,_0x3825a4);if(_0x573303){this[_0xf8f6('0x11')][_0xf8f6('0xa5')](util['format'](_0xf8f6('0x1c1'),_0x573303));var _0x17edc2=this['channel'][_0xf8f6('0x105')](_0x573303);try{fs[_0xf8f6('0x106')](_0x573303+_0xf8f6('0x126'));}catch(_0x35e68d){logger[_0xf8f6('0x2d')](_0x35e68d);}return _0x17edc2;}return this['channel']['error'](_0x3825a4,'Google\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0xf8f6('0x1c2')]=function(_0x2beb94){logger['info'](util[_0xf8f6('0x99')](_0xf8f6('0x1c3'),_0x2beb94['label']));if(!this[_0xf8f6('0x85')](_0x2beb94[_0xf8f6('0x155')])){return this[_0xf8f6('0x11')][_0xf8f6('0x2d')](_0x2beb94,_0xf8f6('0x156'));}logger[_0xf8f6('0x2f')](util['format'](_0xf8f6('0x157'),this[_0xf8f6('0x11')][_0xf8f6('0x3c')],_0x2beb94[_0xf8f6('0x155')]));var _0xe1c8cb=this[_0xf8f6('0x52')][_0xf8f6('0x70')](this,_0x2beb94[_0xf8f6('0x155')]);if(_0xe1c8cb){logger[_0xf8f6('0x2f')](util['format'](_0xf8f6('0x158'),this['channel'][_0xf8f6('0x3c')],_0x2beb94['findBy']));this['channel'][_0xf8f6('0xa5')](util['format'](_0xf8f6('0x158'),this[_0xf8f6('0x11')]['callerid'],_0x2beb94[_0xf8f6('0x155')]));return{'code':0xc8,'result':_0xf8f6('0x159')};}else{logger[_0xf8f6('0x2f')](util[_0xf8f6('0x99')](_0xf8f6('0x15a'),this[_0xf8f6('0x11')][_0xf8f6('0x3c')],_0x2beb94[_0xf8f6('0x155')]));this[_0xf8f6('0x11')][_0xf8f6('0xa5')](util['format'](_0xf8f6('0x15a'),this['channel'][_0xf8f6('0x3c')],_0x2beb94[_0xf8f6('0x155')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0xf8f6('0x1c4')]=function(_0x23bbed){logger[_0xf8f6('0x2f')](util[_0xf8f6('0x99')](_0xf8f6('0x1c5'),_0x23bbed[_0xf8f6('0x39')]));var _0x59d009=this[_0xf8f6('0x11')][_0xf8f6('0xa7')](_0xf8f6('0x1c6'),[_0x23bbed[_0xf8f6('0x1c7')],_0x23bbed[_0xf8f6('0x77')]]);if(_0x59d009[_0xf8f6('0x9e')]===-0x1){return _0x59d009;}return this[_0xf8f6('0x11')][_0xf8f6('0xa5')](util[_0xf8f6('0x99')]('Executed\x20command\x20%s\x20%s',_0xf8f6('0x1c6'),_0x23bbed['mailbox']));};AGIVertices['prototype'][_0xf8f6('0x1c8')]=function(_0x167c36){logger[_0xf8f6('0x2f')](util[_0xf8f6('0x99')](_0xf8f6('0x1c9'),_0x167c36[_0xf8f6('0x39')]));if(!this['isConfigured'](_0x167c36[_0xf8f6('0xdb')])){return this[_0xf8f6('0x11')][_0xf8f6('0x2d')](_0x167c36,_0xf8f6('0x1ca'));}var _0x2878a2=this['getVariable'][_0xf8f6('0x70')](this,_0x167c36[_0xf8f6('0xdb')]);if(!_0x2878a2){return this['channel'][_0xf8f6('0x2d')](_0x167c36,_0xf8f6('0x11a'));}var _0x4a45c9=this[_0xf8f6('0x11')][_0xf8f6('0x9d')](_0x2878a2);return{'code':0xc8,'result':_0x4a45c9[_0xf8f6('0x9f')]?_0x4a45c9['extra']:'-'};};String[_0xf8f6('0x16')]['replaceAll']=function(_0x2fbcd2,_0x4e4e10){return this[_0xf8f6('0x9c')](_0x2fbcd2)[_0xf8f6('0x1cb')](_0x4e4e10);};module[_0xf8f6('0x1cc')]=AGIVertices; \ No newline at end of file +var _0x85b0=['ispeech\x20TTS\x20is\x20unreachable','login','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20MATH\x20(%s)\x20block','operation','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','getData','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','no\x20file\x20audio\x20found','PLAYBACK','no\x20queue\x20selected','queue_id','getVoiceQueue','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','macro','gosub','position','QUEUE','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Response:','inspect','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','saydigits','sayDigits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','getMailAccount','Smtp','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','host','port','secure','authentication','auth','template_id','debug','sendMail\x20message','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','no\x20variable\x20selected','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','googleTTS','Google\x20TTS\x20%s\x20file\x20created','unpause','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','path','util','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','/var/opt/motion2/server/files','rawBody','menu','getdigits','mailRpc','prototype','getVariable','rpc','getVariableById','then','name','catch','getVoiceQueueById','getSquareProject','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunkById','getSound','getSoundById','getSoundPath','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','interval','map','format','getQueryOdbc','info','query','Query\x20executed\x20correctly\x20%s','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','channel','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','googleCloudTTS','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','restAPI','url','method','timeout','number','includes','POST','PUT','toUpperCase','body','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','rawHeaders','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','headers','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','speed','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_secret_access_key','aws_bot_name','googleASR','google_asr_language','tildeASR','appsecret','clear','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','isPlainObject','recursiveNodeIndex','isArray','length','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','no\x20text\x20configured','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','no\x20grammar\x20configured','grammar','MRCPRecog','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','MRCPSynth','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','SESTEK_ASR_CONFIDENCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','no\x20odbc\x20database\x20found','replace','variable_id','forEach','keys','%s[%s][%s]','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','DIAL','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','providerResponse','out','DialogflowV2\x20Result\x20%s','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','password','ndassistant_url','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','end','ext_dial','no\x20trunk\x20selected','trunk_id','getTrunk','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20variable\x20selected\x20for\x20the\x20result','response','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','no\x20bot\x20name\x20configured','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','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','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','no\x20appid\x20configured','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','no\x20key\x20configured','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s'];(function(_0x2eee3d,_0xed25ae){var _0x149d3b=function(_0x5275fd){while(--_0x5275fd){_0x2eee3d['push'](_0x2eee3d['shift']());}};_0x149d3b(++_0xed25ae);}(_0x85b0,0x7f));var _0x085b=function(_0x31c359,_0x1d6736){_0x31c359=_0x31c359-0x0;var _0x35f3f7=_0x85b0[_0x31c359];return _0x35f3f7;};'use strict';var fs=require('fs');var path=require(_0x085b('0x0'));var util=require(_0x085b('0x1'));var _=require('lodash');var sh=require(_0x085b('0x2'));var odbc=require(_0x085b('0x3'))();var rs=require(_0x085b('0x4'));var moment=require(_0x085b('0x5'));var Mustache=require(_0x085b('0x6'));var rp=require(_0x085b('0x7'));var logger=require(_0x085b('0x8'))(_0x085b('0x9'));var config=require(_0x085b('0xa'));var scripts=require('./scripts');var FILES_PATH=_0x085b('0xb');var recursiveMapAttributes=['rawHeaders',_0x085b('0xc')];var verticesWithRetry=[_0x085b('0xd'),_0x085b('0xe'),'getsecretdigits'];var AGIVertices=function(_0x43a0a5,_0x2d71c9,_0x41a495){this['channel']=_0x43a0a5;this['rpc']=_0x2d71c9;this[_0x085b('0xf')]=_0x41a495;};AGIVertices[_0x085b('0x10')][_0x085b('0x11')]=function(_0x3cb024,_0x2eae03){this[_0x085b('0x12')][_0x085b('0x13')](_0x3cb024)[_0x085b('0x14')](function(_0x49c5cf){_0x2eae03(null,_0x49c5cf?_0x49c5cf[_0x085b('0x15')]:![]);})[_0x085b('0x16')](function(_0x5b9d39){_0x2eae03(_0x5b9d39);});};AGIVertices[_0x085b('0x10')]['getVoiceQueue']=function(_0x494e68,_0x34a834){this['rpc'][_0x085b('0x17')](_0x494e68)[_0x085b('0x14')](function(_0x4b19bf){_0x34a834(null,_0x4b19bf?_0x4b19bf[_0x085b('0x15')]:![]);})[_0x085b('0x16')](function(_0x2adb28){_0x34a834(_0x2adb28);});};AGIVertices['prototype'][_0x085b('0x18')]=function(_0x344f06,_0x31f0b6){this[_0x085b('0x12')]['getSquareProjectById'](_0x344f06)['then'](function(_0x36bf75){_0x31f0b6(null,_0x36bf75?_0x36bf75[_0x085b('0x15')]:![]);})[_0x085b('0x16')](function(_0x260598){_0x31f0b6(_0x260598);});};AGIVertices[_0x085b('0x10')][_0x085b('0x19')]=function(_0xc20181,_0x532019){this[_0x085b('0x12')][_0x085b('0x1a')](_0xc20181)['then'](function(_0x21f8d7){_0x532019(null,_0x21f8d7?_0x21f8d7[_0x085b('0x1b')]:![]);})[_0x085b('0x16')](function(_0x3f8d7a){_0x532019(_0x3f8d7a);});};AGIVertices['prototype'][_0x085b('0x1c')]=function(_0x1ebbe0,_0x581b91){this[_0x085b('0x12')][_0x085b('0x1d')](_0x1ebbe0)[_0x085b('0x14')](function(_0x59f8d1){_0x581b91(null,_0x59f8d1?_0x59f8d1['name']:![]);})['catch'](function(_0x311722){_0x581b91(_0x311722);});};AGIVertices[_0x085b('0x10')]['getTrunk']=function(_0x2b38e8,_0x1f684b){this[_0x085b('0x12')][_0x085b('0x1e')](_0x2b38e8)[_0x085b('0x14')](function(_0x1d79ae){_0x1f684b(null,_0x1d79ae?_0x1d79ae[_0x085b('0x15')]:![]);})[_0x085b('0x16')](function(_0x30ab8d){_0x1f684b(_0x30ab8d);});};AGIVertices[_0x085b('0x10')][_0x085b('0x1f')]=function(_0x5358e5,_0x311295){var _0x196105=this;this[_0x085b('0x12')][_0x085b('0x20')](_0x5358e5)[_0x085b('0x14')](function(_0x39c4c3){_0x311295(null,_0x39c4c3?_0x196105[_0x085b('0x21')](_0x39c4c3['save_name']):![]);})[_0x085b('0x16')](function(_0x7f0129){_0x311295(_0x7f0129);});};AGIVertices[_0x085b('0x10')]['getMailAccount']=function(_0x29e04b,_0xdffe7e){this[_0x085b('0x12')][_0x085b('0x22')](_0x29e04b)[_0x085b('0x14')](function(_0x1059e3){_0xdffe7e(null,_0x1059e3?_0x1059e3:![]);})[_0x085b('0x16')](function(_0x41d595){_0xdffe7e(_0x41d595);});};AGIVertices['prototype'][_0x085b('0x23')]=function(_0x1201fa,_0x3e9400,_0x118973){this[_0x085b('0xf')][_0x085b('0x23')](_0x1201fa,_0x3e9400)[_0x085b('0x14')](function(){_0x118973(null);})[_0x085b('0x16')](function(_0x15750b){_0x118973(_0x15750b);});};AGIVertices[_0x085b('0x10')][_0x085b('0x24')]=function(_0x3002c2,_0x56d1d3){this[_0x085b('0x12')][_0x085b('0x25')](_0x3002c2)['then'](function(_0x4a7bce){if(_0x4a7bce){if(_0x4a7bce['IntervalId']){_0x56d1d3(null,[_0x4a7bce[_0x085b('0x26')]]);}else{_0x56d1d3(null,_[_0x085b('0x27')](_0x4a7bce['Intervals'],_0x085b('0x26')));}}else{_0x56d1d3(null,![]);}})['catch'](function(_0x5711ef){_0x56d1d3(_0x5711ef);});};AGIVertices['prototype'][_0x085b('0x21')]=function(_0x267d03){return util[_0x085b('0x28')]('%s/sounds/converted/%s',FILES_PATH,_0x267d03);};AGIVertices[_0x085b('0x10')][_0x085b('0x29')]=function(_0x543af2,_0x5b239c,_0x414aa5){odbc['open'](_0x543af2,function(_0x1179c3){if(_0x1179c3){logger['error']('Error\x20getting\x20ODBC\x20connection\x20%s',_0x1179c3);_0x414aa5(_0x1179c3);}else{logger[_0x085b('0x2a')]('ODBC\x20connection\x20successfully');odbc[_0x085b('0x2b')](_0x5b239c,function(_0x1c8106,_0x4f1b3d){if(_0x1c8106){logger[_0x085b('0x2a')]('Error\x20executing\x20query\x20%s',_0x5b239c);_0x414aa5(_0x1c8106);}else{logger[_0x085b('0x2a')](_0x085b('0x2c'),_0x5b239c);odbc[_0x085b('0x2d')](function(_0x5cc9d2){if(_0x5cc9d2){logger[_0x085b('0x2e')](_0x085b('0x2f'),_0x5cc9d2);}_0x414aa5(null,_0x4f1b3d);});}});}});};AGIVertices[_0x085b('0x10')][_0x085b('0x30')]=function(_0x328b80,_0x21c5ce){this[_0x085b('0x12')][_0x085b('0x31')](_0x328b80)[_0x085b('0x14')](function(_0x1b0955){_0x21c5ce(null,_0x1b0955?_0x1b0955:![]);})['catch'](function(_0x52b40a){_0x21c5ce(_0x52b40a);});};AGIVertices[_0x085b('0x10')][_0x085b('0x32')]=function(_0x592895,_0x2db24b){this[_0x085b('0x12')][_0x085b('0x32')](_0x592895)[_0x085b('0x14')](function(_0x1e151d){_0x2db24b(null,_0x1e151d);})[_0x085b('0x16')](function(_0x719428){_0x2db24b(_0x719428);});};AGIVertices[_0x085b('0x10')][_0x085b('0x33')]=function(_0x148ec6,_0x8a4f81,_0x5768a4){this[_0x085b('0x12')]['createSquareDetailsReport']({'uniqueid':this['channel'][_0x085b('0x34')],'node':_0x148ec6[_0x085b('0x35')],'application':_0x148ec6[_0x085b('0x36')],'data':_0x8a4f81||null,'project_name':this[_0x085b('0x37')][_0x085b('0x38')],'callerid':this['channel'][_0x085b('0x39')]})[_0x085b('0x14')](function(_0x456744){if(_0x5768a4){_0x5768a4(null,_0x456744);}})[_0x085b('0x16')](function(_0x57233b){if(_0x5768a4){_0x5768a4(_0x57233b);}});};AGIVertices['prototype'][_0x085b('0x3a')]=function(_0x56c6be,_0x1d2f30,_0x5daad7,_0x2d97cf){this[_0x085b('0x12')]['createSquareRecording']({'uniqueid':this[_0x085b('0x37')][_0x085b('0x34')],'callerid':this[_0x085b('0x37')]['callerid'],'calleridname':this['channel'][_0x085b('0x3b')],'context':this['channel'][_0x085b('0x3c')],'extension':this[_0x085b('0x37')][_0x085b('0x3d')],'priority':this['channel'][_0x085b('0x3e')],'accountcode':this['channel'][_0x085b('0x3f')],'dnid':this[_0x085b('0x37')][_0x085b('0x40')],'projectName':this[_0x085b('0x37')][_0x085b('0x38')],'saveName':_0x1d2f30,'filename':_0x56c6be[_0x085b('0x41')]||_0x1d2f30,'savePath':_0x5daad7})[_0x085b('0x14')](function(_0x1d074f){_0x2d97cf(null,_0x1d074f);})[_0x085b('0x16')](function(_0x36d253){_0x2d97cf(_0x36d253);});};AGIVertices['prototype'][_0x085b('0x42')]=function(_0x32845f,_0x7720fd,_0x1278c1,_0x434583,_0x17de16){this[_0x085b('0x12')][_0x085b('0x42')]({'uniqueid':this[_0x085b('0x37')]['uniqueid'],'body':_0x32845f,'direction':_0x7720fd,'providerName':_0x1278c1,'providerResponse':_0x434583})['then'](function(_0xb3995e){if(_0x17de16){_0x17de16(null,_0xb3995e);}})[_0x085b('0x16')](function(_0x18bf61){if(_0x17de16){_0x17de16(_0x18bf61);}});};AGIVertices[_0x085b('0x10')][_0x085b('0x43')]=function(_0x13db12,_0x1f3611){this[_0x085b('0x12')][_0x085b('0x43')]({'firstName':_[_0x085b('0x44')](_0x13db12[_0x085b('0x15')])||_[_0x085b('0x45')](_0x13db12['name'])?'callback_'+Math[_0x085b('0x46')]():_0x13db12[_0x085b('0x15')],'lastName':_[_0x085b('0x44')](_0x13db12['lastName'])||_[_0x085b('0x45')](_0x13db12[_0x085b('0x47')])?null:_0x13db12[_0x085b('0x47')],'phone':_0x13db12['phone'],'ListId':_0x13db12['list_id'],'scheduledat':_0x13db12['scheduledAt'],'callbackUniqueid':this[_0x085b('0x37')][_0x085b('0x34')],'tags':_0x085b('0x48'),'description':_0x085b('0x49')+_0x13db12[_0x085b('0x4a')][_0x085b('0x4b')](),'priority':_0x13db12[_0x085b('0x4c')]})[_0x085b('0x14')](function(_0x3349d8){_0x1f3611(null,_0x3349d8);})[_0x085b('0x16')](function(_0x256728){_0x1f3611(_0x256728);});};AGIVertices[_0x085b('0x10')][_0x085b('0x4d')]=function(_0x1554fe,_0x3fc8cd){this[_0x085b('0x12')][_0x085b('0x4e')](_0x1554fe)[_0x085b('0x14')](function(_0xf3d861){_0x3fc8cd(null,_0xf3d861?_0xf3d861[_0x085b('0x15')]:![]);})[_0x085b('0x16')](function(_0x1bafc7){_0x3fc8cd(_0x1bafc7);});};AGIVertices['prototype'][_0x085b('0x4f')]=function(_0x2933ba,_0x5783c0,_0x5d3ccf){var _0x757833={'role':_0x085b('0x50')};_0x757833[_0x2933ba]=this[_0x085b('0x37')][_0x085b('0x39')];this['rpc'][_0x085b('0x4f')](_0x757833,_0x5783c0,this[_0x085b('0x37')][_0x085b('0x34')])['then'](function(_0x47e8a1){_0x5d3ccf(null,_[_0x085b('0x45')](_0x47e8a1)?![]:!![]);})['catch'](function(_0x72a673){logger['error'](_0x72a673);_0x5d3ccf(null,![]);});};AGIVertices[_0x085b('0x10')]['agentUnpause']=function(_0x1e838b,_0x1fa781){var _0x1fe5b2={'role':_0x085b('0x50')};_0x1fe5b2[_0x1e838b]=this[_0x085b('0x37')]['callerid'];this[_0x085b('0x12')][_0x085b('0x51')](_0x1fe5b2)[_0x085b('0x14')](function(_0x17d2d5){_0x1fa781(null,_['isNil'](_0x17d2d5)?![]:!![]);})[_0x085b('0x16')](function(_0x5e3689){logger[_0x085b('0x2e')](_0x5e3689);_0x1fa781(null,![]);});};AGIVertices[_0x085b('0x10')][_0x085b('0x52')]=function(_0x4b5f27,_0x35dcc6){var _0xe7731d={'role':'agent'};_0xe7731d[_0x4b5f27]=this[_0x085b('0x37')][_0x085b('0x39')];this[_0x085b('0x12')][_0x085b('0x52')](_0xe7731d)['then'](function(_0x410427){_0x35dcc6(null,_[_0x085b('0x45')](_0x410427)?![]:!![]);})['catch'](function(_0x27e5e6){logger['error'](_0x27e5e6);_0x35dcc6(null,![]);});};AGIVertices[_0x085b('0x10')][_0x085b('0x53')]=function(_0x4741c4,_0x537eb4){var _0x3b6fa5={'role':'agent'};_0x3b6fa5[_0x4741c4]=this[_0x085b('0x37')][_0x085b('0x39')];var _0x2adb5e=_0x4741c4!=_0x085b('0x54')?util[_0x085b('0x28')](_0x085b('0x55'),_0x085b('0x56'),this[_0x085b('0x37')][_0x085b('0x39')]):undefined;this['rpc'][_0x085b('0x53')](_0x3b6fa5,_0x2adb5e)[_0x085b('0x14')](function(_0x21b957){_0x537eb4(null,_[_0x085b('0x45')](_0x21b957)?![]:!![]);})['catch'](function(_0x468384){logger[_0x085b('0x2e')](_0x468384);_0x537eb4(null,![]);});};AGIVertices[_0x085b('0x10')][_0x085b('0x57')]=function(_0xf4049b,_0xb0c795){sh[_0x085b('0x58')](_['trim'](_0xf4049b),function(_0x93ce62,_0x23b0b2){var _0x1fd86d=_0x23b0b2['replace'](/(\r\n|\n|\r)/gm,'');_0xb0c795(null,_0x1fd86d);});};AGIVertices[_0x085b('0x10')][_0x085b('0x59')]=function(_0x20cc7e,_0x1610c0){scripts[_0x085b('0x59')](_0x20cc7e['apiKey'],_0x20cc7e[_0x085b('0x5a')]||_0x085b('0x5b'),_0x20cc7e[_0x085b('0x5b')],_0x20cc7e[_0x085b('0x5c')]||_0x085b('0x5d'),_0x20cc7e[_0x085b('0x5e')]||_0x085b('0x5f'),_0x20cc7e[_0x085b('0x60')]||_0x085b('0x61'))[_0x085b('0x14')](function(_0x3ef627){_0x1610c0(null,_0x3ef627);})['catch'](function(_0x3a900a){_0x1610c0(_0x3a900a);});};AGIVertices['prototype']['googleTTS']=function(_0x5bc030,_0x1d8603){scripts['googleTTS'](_0x5bc030[_0x085b('0x5b')],_0x5bc030['google_tts_language']||'en',0x1)['then'](function(_0x5607d7){_0x1d8603(null,_0x5607d7);})[_0x085b('0x16')](function(_0x3eadad){_0x1d8603(_0x3eadad);});};AGIVertices[_0x085b('0x10')][_0x085b('0x62')]=function(_0x37ab25,_0x3903bb){var _0x154cc1={'uri':_0x37ab25[_0x085b('0x63')],'method':_0x37ab25[_0x085b('0x64')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x37ab25[_0x085b('0x65')])===_0x085b('0x66')&&parseInt(_0x37ab25[_0x085b('0x65')])>=0x1?parseInt(_0x37ab25[_0x085b('0x65')])*0x3e8:0x5*0x3e8};if(_[_0x085b('0x67')]([_0x085b('0x68'),_0x085b('0x69')],_0x154cc1['method'][_0x085b('0x6a')]())){try{_0x154cc1[_0x085b('0x6b')]=_0x37ab25['rawBody']?JSON['parse'](_0x37ab25[_0x085b('0xc')]):{};}catch(_0x22d790){logger[_0x085b('0x2e')](_0x085b('0x6c'),_0x22d790);}}try{_0x154cc1['headers']=_0x37ab25[_0x085b('0x6d')]?JSON[_0x085b('0x6e')](_0x37ab25[_0x085b('0x6d')]):{};}catch(_0xd86919){logger[_0x085b('0x2e')](_0x085b('0x6f'),_0xd86919);}if(_0x37ab25[_0x085b('0x70')]){try{var _0x3fbc2a=require(_0x37ab25[_0x085b('0x70')])[_0x085b('0x71')](this,_0x154cc1);_0x154cc1[_0x085b('0x72')]=Mustache[_0x085b('0x73')](_0x37ab25[_0x085b('0x63')],_0x3fbc2a,{},['$$','$$']);if(_0x154cc1[_0x085b('0x74')]){_0x154cc1[_0x085b('0x74')]=JSON[_0x085b('0x6e')](Mustache[_0x085b('0x73')](JSON[_0x085b('0x75')](_0x154cc1[_0x085b('0x74')]),_0x3fbc2a,{},['$$','$$']));}if(_0x154cc1[_0x085b('0x6b')]){_0x154cc1['body']=JSON[_0x085b('0x6e')](Mustache[_0x085b('0x73')](JSON[_0x085b('0x75')](_0x154cc1[_0x085b('0x6b')]),_0x3fbc2a,{},['$$','$$']));}}catch(_0xf0effe){logger[_0x085b('0x2e')](_0x085b('0x76'),_0xf0effe);}}rp(_0x154cc1)['then'](function(_0x148383){var _0x9184e2={'statusCode':_0x148383[_0x085b('0x77')]||0xc8,'statusMessage':_0x148383[_0x085b('0x78')]||'OK','headers':_0x148383['headers']||{},'body':_0x148383[_0x085b('0x6b')]||{}};_0x3903bb(null,_0x9184e2);})['catch'](function(_0x45eac2){var _0x47c212={'statusCode':_0x45eac2[_0x085b('0x77')]||0x1f4,'statusMessage':_0x45eac2[_0x085b('0x79')]||_0x085b('0x7a'),'headers':_0x45eac2[_0x085b('0x7b')][_0x085b('0x74')]||{},'body':_0x45eac2[_0x085b('0x7b')]['body']||{}};_0x3903bb(null,_0x47c212);});};AGIVertices['prototype'][_0x085b('0x7c')]=function(_0x44df9d,_0x2d1bc4){scripts[_0x085b('0x7c')](this[_0x085b('0x37')]['uniqueid'],_0x44df9d[_0x085b('0x7d')],_0x44df9d[_0x085b('0x5b')],_0x44df9d['dialogflow_language']||'en')[_0x085b('0x14')](function(_0x2d2880){_0x2d1bc4(null,_0x2d2880);})['catch'](function(_0x1ffe19){_0x2d1bc4(_0x1ffe19);});};AGIVertices[_0x085b('0x10')][_0x085b('0x7e')]=function(_0x2e1db5,_0x1f6e93){scripts['googleDialogflowV2'](this[_0x085b('0x37')][_0x085b('0x34')],_0x2e1db5[_0x085b('0x7f')],_0x2e1db5[_0x085b('0x80')],_0x2e1db5[_0x085b('0x81')],_0x2e1db5['text'],_0x2e1db5[_0x085b('0x82')]||'en')[_0x085b('0x14')](function(_0x2e727f){_0x1f6e93(null,_0x2e727f);})[_0x085b('0x16')](function(_0x4a1087){_0x1f6e93(_0x4a1087);});};AGIVertices[_0x085b('0x10')][_0x085b('0x83')]=function(_0x46ddfb,_0xc26471){scripts[_0x085b('0x83')](this['channel'],_0x46ddfb)[_0x085b('0x14')](function(_0x5f7ef4){_0xc26471(null,_0x5f7ef4);})[_0x085b('0x16')](function(_0x3e8e8a){_0xc26471(_0x3e8e8a);});};AGIVertices[_0x085b('0x10')][_0x085b('0x84')]=function(_0x2efc83,_0xef2bfe){scripts[_0x085b('0x84')](_0x2efc83['key'],_0x2efc83[_0x085b('0x5b')],_0x2efc83['ispeech_tts_language']||_0x085b('0x5d'),_0x2efc83[_0x085b('0x85')])['then'](function(_0x214601){_0xef2bfe(null,_0x214601);})[_0x085b('0x16')](function(_0x195374){_0xef2bfe(_0x195374);});};AGIVertices[_0x085b('0x10')]['ispeechASR']=function(_0x40d6bc,_0x17e73f,_0x436a1e){scripts['ispeechASR'](_0x17e73f,_0x40d6bc[_0x085b('0x7d')],_0x40d6bc[_0x085b('0x86')]||_0x085b('0x5d'),this[_0x085b('0x87')](_0x40d6bc[_0x085b('0x88')])?_0x40d6bc[_0x085b('0x88')]:undefined)[_0x085b('0x14')](function(_0x32fa24){_0x436a1e(null,_0x32fa24);})[_0x085b('0x16')](function(_0x4fbb7a){_0x436a1e(_0x4fbb7a);});};AGIVertices[_0x085b('0x10')][_0x085b('0x89')]=function(_0x37fc5b,_0xc66272){scripts['awsPolly'](_0x37fc5b[_0x085b('0x8a')],_0x37fc5b['aws_secret_access_key'],_0x37fc5b[_0x085b('0x8b')],_0x37fc5b[_0x085b('0x8c')]||_0x085b('0x8d'),_0x37fc5b['text'],_0x37fc5b[_0x085b('0x8e')]||_0x085b('0x5b'))[_0x085b('0x14')](function(_0x2a4993){_0xc66272(null,_0x2a4993);})[_0x085b('0x16')](function(_0x30e918){_0xc66272(_0x30e918);});};AGIVertices[_0x085b('0x10')][_0x085b('0x8f')]=function(_0x366006,_0x2b22e9){scripts[_0x085b('0x8f')](this[_0x085b('0x37')][_0x085b('0x34')],_0x366006['aws_access_key_id'],_0x366006[_0x085b('0x90')],_0x366006['aws_lex_region'],_0x366006[_0x085b('0x5b')],_0x366006[_0x085b('0x91')])[_0x085b('0x14')](function(_0x4544d1){_0x2b22e9(null,_0x4544d1);})['catch'](function(_0x5a22b4){_0x2b22e9(_0x5a22b4);});};AGIVertices[_0x085b('0x10')][_0x085b('0x92')]=function(_0x4f17f3,_0xa9cbf3,_0x233ef1){scripts[_0x085b('0x92')](_0xa9cbf3,_0x4f17f3[_0x085b('0x7d')],_0x4f17f3[_0x085b('0x93')]||'en-US')[_0x085b('0x14')](function(_0x56d79a){_0x233ef1(null,_0x56d79a);})[_0x085b('0x16')](function(_0x4c0e17){_0x233ef1(_0x4c0e17);});};AGIVertices[_0x085b('0x10')][_0x085b('0x94')]=function(_0x46822e,_0x119ff9,_0x5fa0c9){scripts[_0x085b('0x94')](_0x119ff9,_0x46822e['appid'],_0x46822e[_0x085b('0x95')],_0x46822e[_0x085b('0x72')])['then'](function(_0x434bbc){_0x5fa0c9(null,_0x434bbc);})[_0x085b('0x16')](function(_0x22aebe){_0x5fa0c9(_0x22aebe);});};AGIVertices[_0x085b('0x10')][_0x085b('0x96')]=function(_0x41ce8e){var _0x346d09=_['includes'](verticesWithRetry,_0x41ce8e[_0x085b('0x36')])?_0x41ce8e:_['clone'](_0x41ce8e);for(var _0x5a1e47 in _0x346d09){if(_0x346d09[_0x085b('0x97')](_0x5a1e47)){if(_0x346d09[_0x5a1e47]&&_[_0x085b('0x98')](_0x346d09[_0x5a1e47])){if(_['includes'](recursiveMapAttributes,_0x5a1e47)){_0x346d09[_0x5a1e47]=this[_0x085b('0x99')](_0x346d09[_0x5a1e47]);}else{_0x346d09[_0x5a1e47]=this[_0x085b('0x9a')](_0x346d09[_0x5a1e47]);}}}}return _0x346d09;};AGIVertices[_0x085b('0x10')]['recursiveNodeIndex']=function(_0x241858){for(var _0x3fb65a in _0x241858){if(_0x241858[_0x085b('0x97')](_0x3fb65a)){if(_[_0x085b('0x9b')](_0x241858[_0x3fb65a])){this[_0x085b('0x9c')](_0x241858[_0x3fb65a]);}else if(_[_0x085b('0x9d')](_0x241858[_0x3fb65a])){for(var _0x1af12c=0x0;_0x1af12c<_0x241858[_0x3fb65a][_0x085b('0x9e')];_0x1af12c++){this[_0x085b('0x9c')](_0x241858[_0x3fb65a][_0x1af12c]);}}else if(_[_0x085b('0x98')](_0x241858[_0x3fb65a])){_0x241858[_0x3fb65a]=this[_0x085b('0x9a')](_0x241858[_0x3fb65a]);}}}};AGIVertices[_0x085b('0x10')][_0x085b('0x9f')]=function(_0x1f13da,_0x2b5172){for(var _0x1dc397 in _0x1f13da){if(_0x1f13da['hasOwnProperty'](_0x1dc397)){if(_[_0x085b('0x9b')](_0x1f13da[_0x1dc397])){if(!_['isEmpty'](_0x1f13da[_0x1dc397])){this[_0x085b('0x9f')](_0x1f13da[_0x1dc397],util[_0x085b('0x28')](_0x085b('0xa0'),_0x2b5172,_0x1dc397));}}else if(_[_0x085b('0x9d')](_0x1f13da[_0x1dc397])){for(var _0xfec50d=0x0;_0xfec50d<_0x1f13da[_0x1dc397][_0x085b('0x9e')];_0xfec50d++){this[_0x085b('0x9f')](_0x1f13da[_0x1dc397][_0xfec50d],util[_0x085b('0x28')](_0x085b('0xa0'),_0x2b5172,_0x1dc397+'['+_0xfec50d+']'));}}else{if(!_['isNil'](_0x1f13da[_0x1dc397])){this[_0x085b('0x37')][_0x085b('0xa1')](util['format'](_0x085b('0xa0'),_0x2b5172,_0x1dc397),_0x1f13da[_0x1dc397]);}}}}};AGIVertices[_0x085b('0x10')][_0x085b('0x99')]=function(_0x12222c){try{var _0x3645d8=JSON['parse'](_0x12222c);this[_0x085b('0x9c')](_0x3645d8);return JSON[_0x085b('0x75')](_0x3645d8);}catch(_0x3c62fe){return this[_0x085b('0x9a')](_0x12222c);}};AGIVertices['prototype'][_0x085b('0x9a')]=function(_0x5e3ec2){var _0x1d95f4=_0x5e3ec2[_0x085b('0xa2')]('{');for(var _0xf6e094=0x1;_0xf6e094<_0x1d95f4['length'];_0xf6e094+=0x1){var _0x27cd56=_0x1d95f4[_0xf6e094][_0x085b('0xa2')]('}');if(_0x27cd56[_0x085b('0x9e')]>0x1){_0x5e3ec2=_0x5e3ec2[_0x085b('0xa3')]('{'+_0x27cd56[0x0]+'}',this[_0x085b('0x37')]['getVariable'](_0x27cd56[0x0])[_0x085b('0xa4')]||_0x27cd56[0x0]);}}if(_0x1d95f4[_0x085b('0x9e')]===0x1){return _0x5e3ec2[_0x085b('0x4b')]();}return this[_0x085b('0x9a')](_0x5e3ec2);};AGIVertices[_0x085b('0x10')][_0x085b('0xa5')]=function(_0x264160,_0x202fa1){var _0x1833e2=this[_0x085b('0x37')][_0x085b('0x11')](_0x264160);if(_0x1833e2[_0x085b('0xa6')]===-0x1){return _0x1833e2;}logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0xa7'),_0x202fa1,_0x1833e2[_0x085b('0xa4')]));return this['channel'][_0x085b('0xa1')](_0x202fa1,_0x1833e2[_0x085b('0xa4')]);};AGIVertices[_0x085b('0x10')][_0x085b('0x87')]=function(_0x3fff03){return _0x3fff03&&_0x3fff03!=='0'&&_0x3fff03!=='-1'&&_0x3fff03!=='';};AGIVertices[_0x085b('0x10')][_0x085b('0xa8')]=function(_0xcb0b7f){this[_0x085b('0x33')][_0x085b('0x71')](this,_0xcb0b7f,'-');_0xcb0b7f['retry']=_0xcb0b7f['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x085b('0x10')][_0x085b('0xa9')]=function(_0x1f72ce){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0xaa'),_0x1f72ce[_0x085b('0x35')]));if(!this[_0x085b('0x87')](_0x1f72ce['text'])){return this[_0x085b('0x37')]['noop'](_0x085b('0xab'));}var _0x248095='\x22'+_0x1f72ce['text']+'\x22';if(this[_0x085b('0x87')](_0x1f72ce[_0x085b('0x7b')])){_0x248095+=','+_0x1f72ce[_0x085b('0x7b')];}var _0x44b66e=this[_0x085b('0x37')][_0x085b('0x58')]('MRCPSynth',_0x248095);if(_0x44b66e['result']===-0x1){return _0x44b66e;}return this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0xad'),_0x248095));};AGIVertices['prototype'][_0x085b('0xae')]=function(_0x6ae674){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0xaf'),_0x6ae674['label']));if(!this[_0x085b('0x87')](_0x6ae674['grammar'])){return this[_0x085b('0x37')][_0x085b('0xac')](_0x085b('0xb0'));}var _0x49b6b4=_0x6ae674[_0x085b('0xb1')];if(this[_0x085b('0x87')](_0x6ae674[_0x085b('0x7b')])){_0x49b6b4+=','+_0x6ae674['options'];}var _0x15a3d9=this['channel'][_0x085b('0x58')](_0x085b('0xb2'),_0x49b6b4);if(_0x15a3d9[_0x085b('0xa6')]===-0x1){return _0x15a3d9;}var _0x1f64e0=this[_0x085b('0xa5')]('RECOG_CONFIDENCE()',_0x085b('0xb3'));if(_0x1f64e0[_0x085b('0xa6')]===-0x1){return _0x1f64e0;}var _0x1bc187=this['getAndSetVariable'](_0x085b('0xb4'),_0x085b('0xb5'));if(_0x1bc187[_0x085b('0xa6')]===-0x1){return _0x1bc187;}var _0x3055dd=this[_0x085b('0xa5')](_0x085b('0xb6'),_0x085b('0xb7'));if(_0x3055dd[_0x085b('0xa6')]===-0x1){return _0x3055dd;}return this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0xb8'),_0x49b6b4));};AGIVertices['prototype'][_0x085b('0x9')]=function(_0x3881f3){logger[_0x085b('0x2a')](util[_0x085b('0x28')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x3881f3[_0x085b('0x35')]));return this[_0x085b('0x37')][_0x085b('0x9')]([_0x3881f3[_0x085b('0xb9')],_0x3881f3[_0x085b('0xba')]]);};AGIVertices['prototype'][_0x085b('0xbb')]=function(_0x13c1a6){logger[_0x085b('0x2a')](util['format'](_0x085b('0xbc'),_0x13c1a6[_0x085b('0x35')]));if(this[_0x085b('0x87')](_0x13c1a6[_0x085b('0x65')])){logger['info'](util[_0x085b('0x28')](_0x085b('0xbd'),_0x13c1a6[_0x085b('0x65')]));var _0x2f9173=this[_0x085b('0x37')]['wait'](_0x13c1a6[_0x085b('0x65')]);if(_0x2f9173[_0x085b('0xa6')]===-0x1){return _0x2f9173;}}return this[_0x085b('0x37')][_0x085b('0xbb')]();};AGIVertices['prototype'][_0x085b('0x48')]=function(_0xbd229e){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0xbe'),_0xbd229e[_0x085b('0x35')]));if(!this[_0x085b('0x87')](_0xbd229e[_0x085b('0xbf')])){return this['channel']['error'](_0xbd229e,_0x085b('0xc0'));}_0xbd229e[_0x085b('0x4a')]=moment();if(this[_0x085b('0x87')](_0xbd229e[_0x085b('0xc1')])){_0xbd229e[_0x085b('0x4a')]=moment()[_0x085b('0xc2')](_0xbd229e['delay'],_0x085b('0xc3'));}if(!this[_0x085b('0x87')](_0xbd229e['callback_priority'])){_0xbd229e['callback_priority']=0x2;}this['createCmContact'][_0x085b('0x71')](this,_0xbd229e);return this['channel'][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0xc4'),_0xbd229e[_0x085b('0xc5')],_0xbd229e[_0x085b('0xbf')],_0xbd229e['scheduledAt']));};AGIVertices[_0x085b('0x10')][_0x085b('0xc6')]=function(_0x150d27){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0xc7'),_0x150d27[_0x085b('0x35')]));var _0x2b42ef=this[_0x085b('0x37')][_0x085b('0x58')](_0x150d27[_0x085b('0xc8')],_0x150d27['options']);if(_0x2b42ef[_0x085b('0xa6')]===-0x1){return _0x2b42ef;}return this['channel'][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0xc9'),_0x150d27['application'],_0x150d27['options']));};AGIVertices[_0x085b('0x10')][_0x085b('0xca')]=function(_0x31e77c){logger[_0x085b('0x2a')](util[_0x085b('0x28')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x31e77c[_0x085b('0x35')]));if(!this['isConfigured'](_0x31e77c[_0x085b('0x5b')])){return this[_0x085b('0x37')]['noop'](_0x085b('0xab'));}var _0xbd6bbb='\x22'+_0x31e77c[_0x085b('0x5b')]+'\x22';if(this['isConfigured'](_0x31e77c[_0x085b('0x7b')])){_0xbd6bbb+=','+_0x31e77c[_0x085b('0x7b')];}var _0x1c7528=this['channel'][_0x085b('0x58')](_0x085b('0xcb'),_0xbd6bbb);if(_0x1c7528[_0x085b('0xa6')]===-0x1){return _0x1c7528;}return this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0xad'),_0xbd6bbb));};AGIVertices[_0x085b('0x10')][_0x085b('0xcc')]=function(_0x49d00f){logger['info'](util[_0x085b('0x28')](_0x085b('0xcd'),_0x49d00f[_0x085b('0x35')]));if(!this[_0x085b('0x87')](_0x49d00f[_0x085b('0x5b')])){return this[_0x085b('0x37')][_0x085b('0xac')]('no\x20text\x20configured');}var _0x25c4f3='\x22'+_0x49d00f['text']+'\x22';if(this[_0x085b('0x87')](_0x49d00f[_0x085b('0x7b')])){_0x25c4f3+=','+_0x49d00f[_0x085b('0x7b')];}var _0x5d7ba9=this['channel'][_0x085b('0x58')](_0x085b('0xcb'),_0x25c4f3);if(_0x5d7ba9[_0x085b('0xa6')]===-0x1){return _0x5d7ba9;}return this['channel']['noop'](util[_0x085b('0x28')](_0x085b('0xad'),_0x25c4f3));};AGIVertices[_0x085b('0x10')][_0x085b('0xce')]=function(_0x2211f8){logger['info'](util[_0x085b('0x28')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x2211f8[_0x085b('0x35')]));if(!this[_0x085b('0x87')](_0x2211f8['grammar'])){return this['channel'][_0x085b('0xac')](_0x085b('0xb0'));}var _0x23dd43=_0x2211f8[_0x085b('0xb1')];if(this['isConfigured'](_0x2211f8[_0x085b('0x7b')])){_0x23dd43+=','+_0x2211f8[_0x085b('0x7b')];}var _0x265dfd=this[_0x085b('0x37')][_0x085b('0x58')]('MRCPRecog',_0x23dd43);if(_0x265dfd['result']===-0x1){return _0x265dfd;}var _0x56f240=this[_0x085b('0xa5')]('RECOG_CONFIDENCE()',_0x085b('0xcf'));if(_0x56f240[_0x085b('0xa6')]===-0x1){return _0x56f240;}var _0x5ab6b0=this['getAndSetVariable'](_0x085b('0xb4'),_0x085b('0xd0'));if(_0x5ab6b0['result']===-0x1){return _0x5ab6b0;}var _0x221b15=this['getAndSetVariable']('RECOG_INSTANCE()',_0x085b('0xd1'));if(_0x221b15[_0x085b('0xa6')]===-0x1){return _0x221b15;}return this[_0x085b('0x37')]['noop'](util['format'](_0x085b('0xb8'),_0x23dd43));};AGIVertices[_0x085b('0x10')][_0x085b('0xd2')]=function(_0x1815fb){logger[_0x085b('0x2a')](util[_0x085b('0x28')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x1815fb[_0x085b('0x35')]));if(!this[_0x085b('0x87')](_0x1815fb[_0x085b('0xb1')])){return this['channel']['noop']('no\x20grammar\x20configured');}var _0x5fb179=_0x1815fb[_0x085b('0xb1')];if(this['isConfigured'](_0x1815fb[_0x085b('0x7b')])){_0x5fb179+=','+_0x1815fb[_0x085b('0x7b')];}var _0x4332ca=this[_0x085b('0x37')][_0x085b('0x58')](_0x085b('0xb2'),_0x5fb179);if(_0x4332ca[_0x085b('0xa6')]===-0x1){return _0x4332ca;}var _0xffd218=this[_0x085b('0xa5')]('RECOG_CONFIDENCE()',_0x085b('0xd3'));if(_0xffd218['result']===-0x1){return _0xffd218;}var _0x3bf569=this[_0x085b('0xa5')](_0x085b('0xb4'),'SESTEK_ASR_TRANSCRIPT');if(_0x3bf569[_0x085b('0xa6')]===-0x1){return _0x3bf569;}var _0x1e4b33=this['getAndSetVariable'](_0x085b('0xb6'),'SESTEK_ASR_INSTANCE');if(_0x1e4b33['result']===-0x1){return _0x1e4b33;}return this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0xb8'),_0x5fb179));};AGIVertices['prototype'][_0x085b('0xd4')]=function(_0x254761){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0xd5'),_0x254761['label']));if(!this[_0x085b('0x87')](_0x254761['odbc_id'])){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x254761,_0x085b('0xd6'));}var _0x3b162b=this[_0x085b('0x19')]['sync'](this,_0x254761['odbc_id']);if(!_0x3b162b){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x254761,_0x085b('0xd7'));}if(!this[_0x085b('0x87')](_0x254761['query'])){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x254761,'no\x20query\x20configured');}var _0x3c5126=_0x254761[_0x085b('0x2b')][_0x085b('0xd8')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x085b('0xac')](util[_0x085b('0x28')]('query:\x20%s',_0x3c5126));var _0x3b85e3=this['getQueryOdbc'][_0x085b('0x71')](this,_0x3b162b,_0x3c5126);this[_0x085b('0x33')][_0x085b('0x71')](this,_0x254761,_0x3c5126);if(!this[_0x085b('0x87')](_0x254761[_0x085b('0xd9')])){return this[_0x085b('0x37')][_0x085b('0xac')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x24a7e0=this[_0x085b('0x11')][_0x085b('0x71')](this,_0x254761[_0x085b('0xd9')]);if(!_0x24a7e0){return this['channel'][_0x085b('0x2e')](_0x254761,'no\x20variable\x20found');}var _0xe27160=this;_0x3b85e3[_0x085b('0xda')](function(_0x4c1d25,_0xbc741b){Object[_0x085b('0xdb')](_0x4c1d25)[_0x085b('0xda')](function(_0x44da06){_0xe27160[_0x085b('0x37')]['setVariable'](util[_0x085b('0x28')](_0x085b('0xdc'),_0x24a7e0,_0xbc741b,_0x44da06),_0x4c1d25[_0x44da06]);});});this[_0x085b('0x37')][_0x085b('0xa1')](util[_0x085b('0x28')]('%s_ROWS_COUNT',_0x24a7e0),_0x3b85e3['length']);return this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')]('variable\x20%s\x20set',_0x24a7e0));};AGIVertices[_0x085b('0x10')][_0x085b('0xdd')]=function(_0x559b87){logger['debug'](util[_0x085b('0x28')](_0x085b('0xde'),_0x559b87[_0x085b('0x35')]));if(!this['isConfigured'](_0x559b87[_0x085b('0xdf')])){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x559b87,_0x085b('0xe0'));}var _0x31c416=this[_0x085b('0x1c')][_0x085b('0x71')](this,_0x559b87[_0x085b('0xdf')]);if(!_0x31c416){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x559b87,'no\x20user\x20found');}var _0x5d37b9=this['channel'][_0x085b('0x58')](_0x085b('0xe1'),[util[_0x085b('0x28')]('SIP/%s',_0x31c416),_0x559b87[_0x085b('0x65')],_0x559b87[_0x085b('0xe2')],_0x559b87['url']]);if(_0x5d37b9[_0x085b('0xa6')]===-0x1){return _0x5d37b9;}return this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0xe3'),_0x085b('0xe1')));};AGIVertices[_0x085b('0x10')][_0x085b('0xe4')]=function(_0x5c5e09){logger[_0x085b('0x2a')](util['format'](_0x085b('0xe5'),_0x5c5e09[_0x085b('0x35')]));if(!this[_0x085b('0x87')](_0x5c5e09[_0x085b('0x7d')])){return this[_0x085b('0x37')]['noop']('no\x20key\x20configured');}if(!this[_0x085b('0x87')](_0x5c5e09[_0x085b('0x5b')])){return this[_0x085b('0x37')][_0x085b('0xac')](_0x085b('0xab'));}this[_0x085b('0x37')][_0x085b('0xe6')]=!![];this[_0x085b('0x33')](_0x5c5e09);this[_0x085b('0x42')](_0x5c5e09['text'],'in','','');this[_0x085b('0x37')]['noop'](util[_0x085b('0x28')](_0x085b('0xe7'),_0x5c5e09['text']));var _0x55bbab=this[_0x085b('0x7c')]['sync'](this,_0x5c5e09);if(_0x55bbab){for(var _0x41549c in _0x55bbab){if(_0x55bbab[_0x085b('0x97')](_0x41549c)){this[_0x085b('0x37')][_0x085b('0xa1')](util[_0x085b('0x28')](_0x085b('0xe8'),_0x41549c[_0x085b('0x6a')]()),_0x55bbab[_0x41549c]);}}this[_0x085b('0x42')](_0x55bbab[_0x085b('0xe9')],'out',_0x085b('0xe4'),'');return this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')]('Dialogflow\x20Result\x20%s',_0x55bbab['speech']));}return this['channel']['error'](_0x5c5e09,_0x085b('0xea'));};AGIVertices[_0x085b('0x10')][_0x085b('0xeb')]=function(_0x4237ba){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0xec'),_0x4237ba[_0x085b('0x35')]));if(!this[_0x085b('0x87')](_0x4237ba['dialogflowV2_project_id'])){return this['channel']['noop'](_0x085b('0xed'));}if(!this[_0x085b('0x87')](_0x4237ba[_0x085b('0x80')])){return this[_0x085b('0x37')][_0x085b('0xac')]('no\x20client_email\x20configured');}if(!this[_0x085b('0x87')](_0x4237ba['private_key'])){return this[_0x085b('0x37')][_0x085b('0xac')](_0x085b('0xee'));}if(!this[_0x085b('0x87')](_0x4237ba[_0x085b('0x82')])){return this['channel'][_0x085b('0xac')](_0x085b('0xef'));}if(!this['isConfigured'](_0x4237ba['text'])){return this[_0x085b('0x37')]['noop'](_0x085b('0xab'));}this[_0x085b('0x37')][_0x085b('0xe6')]=!![];this['createSquareDetailsReport'](_0x4237ba);this[_0x085b('0x42')](_0x4237ba[_0x085b('0x5b')],'in','','');this[_0x085b('0x37')][_0x085b('0xac')](util['format']('Trying\x20DialogflowV2:\x20%s',_0x4237ba['text']));var _0x4cc029=this[_0x085b('0x7e')][_0x085b('0x71')](this,_0x4237ba);if(_0x4cc029){for(var _0x175950 in _0x4cc029){if(_0x4cc029[_0x085b('0x97')](_0x175950)){if(_0x175950!==_0x085b('0xf0')){this[_0x085b('0x37')]['setVariable'](util[_0x085b('0x28')]('DIALOGFLOW_%s',_0x175950[_0x085b('0x6a')]()),_0x4cc029[_0x175950]);}}}this[_0x085b('0x42')](_0x4cc029['speech'],_0x085b('0xf1'),_0x085b('0xeb'),_0x4cc029['providerResponse']);return this[_0x085b('0x37')][_0x085b('0xac')](util['format'](_0x085b('0xf2'),_0x4cc029[_0x085b('0xe9')]));}return this[_0x085b('0x37')][_0x085b('0x2e')](_0x4237ba,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0x085b('0x10')][_0x085b('0xf3')]=function(_0x50a9f2){logger['info'](util[_0x085b('0x28')](_0x085b('0xf4'),_0x50a9f2[_0x085b('0x35')]));if(!this[_0x085b('0x87')](_0x50a9f2[_0x085b('0xf5')])){return this[_0x085b('0x37')][_0x085b('0xac')](_0x085b('0xf6'));}if(!this[_0x085b('0x87')](_0x50a9f2[_0x085b('0xf7')])){return this[_0x085b('0x37')]['noop']('no\x20username\x20configured');}if(!this[_0x085b('0x87')](_0x50a9f2[_0x085b('0xf8')])){return this[_0x085b('0x37')][_0x085b('0xac')]('no\x20password\x20configured');}if(!this[_0x085b('0x87')](_0x50a9f2[_0x085b('0xf9')])){return this[_0x085b('0x37')][_0x085b('0xac')]('no\x20text\x20configured');}this[_0x085b('0x37')][_0x085b('0xe6')]=!![];this[_0x085b('0x33')](_0x50a9f2);this[_0x085b('0x42')](_0x50a9f2[_0x085b('0x5b')],'in','','');this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')]('Trying\x20SestekNDA:\x20%s',_0x50a9f2[_0x085b('0x5b')]));var _0x23dc63=this[_0x085b('0x83')]['sync'](this,_0x50a9f2);if(_0x23dc63){for(var _0x38e4e8 in _0x23dc63){if(_0x23dc63[_0x085b('0x97')](_0x38e4e8)){this[_0x085b('0x37')][_0x085b('0xa1')](util[_0x085b('0x28')](_0x085b('0xfa'),_0x38e4e8[_0x085b('0x6a')]()),_0x23dc63[_0x38e4e8]);}}this['createSquareMessage'](_0x23dc63[_0x085b('0xe9')],'out',_0x085b('0xf3'),'');if(_0x23dc63[_0x085b('0xfb')]){this['channel'][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0xfc'),_0x23dc63[_0x085b('0xfb')]));var _0x331143=this['channel'][_0x085b('0xfd')](_0x23dc63['audiofile']);try{fs[_0x085b('0xfe')](_0x23dc63[_0x085b('0xfb')]+_0x085b('0xff'));}catch(_0x789a8){logger[_0x085b('0x2e')](_0x789a8);}return _0x331143;}else{return this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0x100'),_0x23dc63[_0x085b('0xe9')]));}}return this[_0x085b('0x37')][_0x085b('0x2e')](_0x50a9f2,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x085b('0x10')][_0x085b('0x101')]=function(_0x2b6f90){logger['info'](util['format']('Enter\x20in\x20END\x20(%s)\x20block',_0x2b6f90[_0x085b('0x35')]));return this['channel']['noop'](_0x085b('0x101'));};AGIVertices['prototype'][_0x085b('0x102')]=function(_0x454e23){logger[_0x085b('0x2a')](util['format']('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x454e23[_0x085b('0x35')]));var _0x41e1e7='';if(_0x454e23['trunk_id']){if(!this[_0x085b('0x87')](_0x454e23['trunk_id'])){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x454e23,_0x085b('0x103'));}else{var _0x240419=parseInt(_0x454e23[_0x085b('0x104')],0xa);if(isNaN(_0x240419)){_0x41e1e7=_0x454e23[_0x085b('0x104')];}else{_0x41e1e7=this[_0x085b('0x105')][_0x085b('0x71')](this,_0x454e23[_0x085b('0x104')]);if(!_0x41e1e7){return this['channel'][_0x085b('0x2e')](_0x454e23,_0x085b('0x106'));}}}}else if(_0x454e23['trunk_name']){_0x41e1e7=_0x454e23[_0x085b('0x107')];}else{return this[_0x085b('0x37')][_0x085b('0x2e')](_0x454e23,_0x085b('0x103'));}var _0x555d6b=this[_0x085b('0x37')][_0x085b('0x58')](_0x085b('0xe1'),[util[_0x085b('0x28')](_0x085b('0x108'),_0x41e1e7,_0x454e23[_0x085b('0xc5')]),_0x454e23[_0x085b('0x65')],_0x454e23[_0x085b('0xe2')],_0x454e23[_0x085b('0x63')]]);if(_0x555d6b[_0x085b('0xa6')]===-0x1){return _0x555d6b;}return this['channel'][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0xe3'),_0x085b('0xe1')));};AGIVertices[_0x085b('0x10')][_0x085b('0x109')]=function(_0x987029){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x10a'),_0x987029['label']));return this['channel']['noop'](_0x085b('0x109'));};AGIVertices['prototype'][_0x085b('0xe')]=function(_0x565e3e){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x10b'),_0x565e3e[_0x085b('0x35')]));if(_0x565e3e[_0x085b('0x10c')]===0x0){return this['maxRetry'](_0x565e3e);}_0x565e3e[_0x085b('0x10c')]-=0x1;if(!this['isConfigured'](_0x565e3e[_0x085b('0x10d')])){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x565e3e,'no\x20file\x20audio\x20selected');}var _0x1526e8=this[_0x085b('0x1f')]['sync'](this,_0x565e3e[_0x085b('0x10d')]);if(!_0x1526e8){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x565e3e,'no\x20file\x20audio\x20found');}if(!this[_0x085b('0x87')](_0x565e3e['variable_id'])){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x085b('0x10e'));}var _0x508ef9=this[_0x085b('0x37')]['getData'](_0x1526e8,_0x565e3e[_0x085b('0x10f')],_0x565e3e[_0x085b('0x110')]);var _0x451b26=_0x508ef9[_0x085b('0xa6')]?_0x508ef9[_0x085b('0xa6')]['toString']():'';logger[_0x085b('0x2a')](_0x085b('0x111'),JSON[_0x085b('0x75')](_0x508ef9));if(_0x508ef9['result']===-0x1){this['createSquareDetailsReport'][_0x085b('0x71')](this,_0x565e3e,_0x451b26);return _0x508ef9;}else if(_0x508ef9[_0x085b('0xa4')]==='timeout'){_0x508ef9[_0x085b('0xa6')]=_0x451b26[_0x085b('0x9e')]>=parseInt(_0x565e3e[_0x085b('0x112')])?'x':'i';}else{_0x508ef9['result']=_0x451b26[_0x085b('0x9e')]>=parseInt(_0x565e3e[_0x085b('0x112')])&&_0x451b26[_0x085b('0x9e')]<=parseInt(_0x565e3e[_0x085b('0x110')])?'x':'i';}var _0x263405=this[_0x085b('0x11')]['sync'](this,_0x565e3e[_0x085b('0xd9')]);if(!_0x263405){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x565e3e,_0x085b('0x113'));}this[_0x085b('0x37')]['setVariable'](_0x263405,_0x451b26);if(this[_0x085b('0x87')](_0x565e3e[_0x085b('0x114')])){var _0x2eb9b3=parseInt(_0x565e3e[_0x085b('0x114')],0xa);var _0x364b4a=rs[_0x085b('0x115')]({'charset':'*','length':_0x2eb9b3});var _0x3061c7=_0x451b26[_0x085b('0x9e')];if(_0x3061c7>0x0){if(_0x3061c7>_0x2eb9b3){this[_0x085b('0x33')]['sync'](this,_0x565e3e,_0x565e3e['hiddendigitspos']===_0x085b('0x116')?_0x364b4a+_0x451b26[_0x085b('0x117')](_0x2eb9b3):_0x451b26[_0x085b('0x117')](0x0,_0x3061c7-_0x2eb9b3)+_0x364b4a);}else{this['createSquareDetailsReport'][_0x085b('0x71')](this,_0x565e3e,rs['generate']({'charset':'*','length':_0x3061c7}));}}else{this[_0x085b('0x33')][_0x085b('0x71')](this,_0x565e3e,'');}}else{this['createSquareDetailsReport']['sync'](this,_0x565e3e,_0x451b26);}return _0x508ef9;};AGIVertices[_0x085b('0x10')][_0x085b('0x118')]=function(_0x5ba143){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x119'),_0x5ba143[_0x085b('0x35')]));return this['getdigits'](_0x5ba143);};AGIVertices[_0x085b('0x10')]['goal']=function(_0x30d8bc){logger[_0x085b('0x2a')](util['format'](_0x085b('0x11a'),_0x30d8bc[_0x085b('0x35')]));this[_0x085b('0x33')][_0x085b('0x71')](this,_0x30d8bc,_0x30d8bc[_0x085b('0x11b')]);return this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0x11c'),_0x30d8bc[_0x085b('0x11b')]));};AGIVertices[_0x085b('0x10')][_0x085b('0x11d')]=function(_0x4308a9){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x11e'),_0x4308a9[_0x085b('0x35')]));if(!this[_0x085b('0x87')](_0x4308a9['aws_access_key_id'])||!this[_0x085b('0x87')](_0x4308a9['aws_secret_access_key'])){return this[_0x085b('0x37')]['noop'](_0x085b('0x11f'));}if(!this[_0x085b('0x87')](_0x4308a9['text'])){return this[_0x085b('0x37')][_0x085b('0xac')]('no\x20text\x20configured');}this['channel'][_0x085b('0xac')](util['format'](_0x085b('0x120'),_0x4308a9[_0x085b('0x5b')]));var _0x3273e3=this[_0x085b('0x89')][_0x085b('0x71')](this,_0x4308a9);if(_0x3273e3){this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0x121'),_0x3273e3));var _0x22b53b=this[_0x085b('0x37')][_0x085b('0xfd')](_0x3273e3);try{fs['unlink'](_0x3273e3+'.wav');}catch(_0xfa065c){logger[_0x085b('0x2e')](_0xfa065c);}return _0x22b53b;}return this['channel']['error'](_0x4308a9,_0x085b('0x122'));};AGIVertices[_0x085b('0x10')]['awslex']=function(_0x395099){logger['info'](util['format']('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x395099[_0x085b('0x35')]));if(!this[_0x085b('0x87')](_0x395099[_0x085b('0x8a')])||!this[_0x085b('0x87')](_0x395099['aws_secret_access_key'])){return this[_0x085b('0x37')]['noop']('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x395099[_0x085b('0x91')])){return this['channel'][_0x085b('0xac')](_0x085b('0x123'));}if(!this[_0x085b('0x87')](_0x395099['text'])){return this[_0x085b('0x37')][_0x085b('0xac')](_0x085b('0xab'));}this[_0x085b('0x37')]['bot']=!![];this[_0x085b('0x33')](_0x395099);this[_0x085b('0x42')](_0x395099['text'],'in','','');this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')]('Trying\x20Amazon\x20Lex:\x20%s',_0x395099['text']));var _0x157495=this[_0x085b('0x8f')][_0x085b('0x71')](this,_0x395099);if(_0x157495){for(var _0x1cbec6 in _0x157495){if(_0x157495[_0x085b('0x97')](_0x1cbec6)&&_[_0x085b('0x98')](_0x157495[_0x1cbec6])){this[_0x085b('0x37')][_0x085b('0xa1')](util[_0x085b('0x28')](_0x085b('0x124'),_0x1cbec6[_0x085b('0x6a')]()),_0x157495[_0x1cbec6]);}}if(_[_0x085b('0x45')](_0x157495[_0x085b('0x79')])){return this[_0x085b('0x37')][_0x085b('0xac')](_0x085b('0x125'));}else{this['createSquareMessage'](_0x157495[_0x085b('0x79')],_0x085b('0xf1'),_0x085b('0x126'),'');return this[_0x085b('0x37')]['noop'](util[_0x085b('0x28')](_0x085b('0x127'),_0x157495[_0x085b('0x79')]));}}return this[_0x085b('0x37')][_0x085b('0x2e')](_0x395099,_0x085b('0x128'));};AGIVertices[_0x085b('0x10')][_0x085b('0x129')]=function(_0x1e7ceb){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x12a'),_0x1e7ceb['label'],_0x1e7ceb[_0x085b('0x65')]));if(!this['isConfigured'](_0x1e7ceb[_0x085b('0x7d')])){return this[_0x085b('0x37')][_0x085b('0xac')]('no\x20key\x20configured');}var _0x21bfc7=_0x085b('0x12b');var _0x554e59=util['format'](_0x085b('0x12c'),FILES_PATH,rs[_0x085b('0x115')](0x4));var _0x426511=util[_0x085b('0x28')](_0x085b('0xa0'),_0x554e59,_0x21bfc7);var _0x430ff7=!![];if(_0x1e7ceb[_0x085b('0x12d')]===_0x085b('0x12e')){_0x430ff7=![];}var _0x4c9706=this[_0x085b('0x37')][_0x085b('0x12f')](_0x554e59,_0x21bfc7,_0x1e7ceb[_0x085b('0x130')],_0x1e7ceb[_0x085b('0x65')],undefined,_0x430ff7);if(_0x4c9706[_0x085b('0xa6')]!==-0x1){this['channel'][_0x085b('0xac')](util[_0x085b('0x28')]('google\x20%s\x20file\x20created',_0x426511));var _0x50687d=this[_0x085b('0x92')][_0x085b('0x71')](this,_0x1e7ceb,_0x426511);if(_0x50687d){for(var _0x3b196a in _0x50687d){if(_0x50687d[_0x085b('0x97')](_0x3b196a)){this['channel'][_0x085b('0xa1')](util[_0x085b('0x28')](_0x085b('0x131'),_0x3b196a[_0x085b('0x6a')]()),_0x50687d[_0x3b196a]);}}return this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0x132'),JSON[_0x085b('0x75')](_0x50687d)));}}return _0x4c9706;};AGIVertices[_0x085b('0x10')]['tildeasr']=function(_0x4aa1f0){logger['info'](util[_0x085b('0x28')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x4aa1f0[_0x085b('0x35')]));if(!this[_0x085b('0x87')](_0x4aa1f0['appid'])){return this['channel'][_0x085b('0xac')](_0x085b('0x133'));}if(!this['isConfigured'](_0x4aa1f0['appsecret'])){return this[_0x085b('0x37')][_0x085b('0xac')]('no\x20appsecret\x20configured');}var _0xdf106f=_0x085b('0x12b');var _0x199f3f=util[_0x085b('0x28')]('%s/recordings/%s',FILES_PATH,rs[_0x085b('0x115')](0x4));var _0x3b2156=util[_0x085b('0x28')](_0x085b('0xa0'),_0x199f3f,_0xdf106f);var _0x438fd9=!![];if(_0x4aa1f0['beep']===_0x085b('0x12e')){_0x438fd9=![];}var _0x219f27=this[_0x085b('0x37')][_0x085b('0x12f')](_0x199f3f,_0xdf106f,_0x4aa1f0[_0x085b('0x130')],_0x4aa1f0[_0x085b('0x65')],undefined,_0x438fd9);if(_0x219f27[_0x085b('0xa6')]!==-0x1){this[_0x085b('0x37')]['noop'](util['format']('tilde\x20%s\x20file\x20created',_0x3b2156));var _0x2e029f=this['tildeASR'][_0x085b('0x71')](this,_0x4aa1f0,_0x3b2156);if(_0x2e029f){for(var _0x48d4a6 in _0x2e029f){if(_0x2e029f['hasOwnProperty'](_0x48d4a6)){this[_0x085b('0x37')][_0x085b('0xa1')](util[_0x085b('0x28')](_0x085b('0x134'),_0x48d4a6[_0x085b('0x6a')]()),_0x2e029f[_0x48d4a6]);}}return this[_0x085b('0x37')]['noop'](util['format'](_0x085b('0x135'),JSON['stringify'](_0x2e029f)));}}return _0x219f27;};AGIVertices['prototype'][_0x085b('0x136')]=function(_0x5d5155){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x137'),_0x5d5155[_0x085b('0x35')]));return this[_0x085b('0x37')][_0x085b('0x138')](_0x5d5155[_0x085b('0x3c')],_0x5d5155['extension'],_0x5d5155[_0x085b('0x3e')]);};AGIVertices[_0x085b('0x10')][_0x085b('0x139')]=function(_0x104ee){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x13a'),_0x104ee[_0x085b('0x35')]));if(!this[_0x085b('0x87')](_0x104ee[_0x085b('0x13b')])){return this[_0x085b('0x37')]['error'](_0x104ee,'no\x20condition\x20configured');}try{var _0x20bdc9=eval(_0x104ee[_0x085b('0x13b')])?_0x085b('0x13c'):_0x085b('0x13d');this[_0x085b('0x37')][_0x085b('0xac')](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0x104ee[_0x085b('0x13b')],_0x20bdc9));return{'code':0xc8,'result':_0x20bdc9};}catch(_0x1879f6){return{'code':0xc8,'result':_0x085b('0x13d')};}};AGIVertices[_0x085b('0x10')][_0x085b('0x13e')]=function(_0x943c91){logger[_0x085b('0x2a')](util['format'](_0x085b('0x13f'),_0x943c91[_0x085b('0x35')]));if(!this['isConfigured'](_0x943c91[_0x085b('0x140')])){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x943c91,'no\x20interval\x20configured');}var _0x4184f8=this[_0x085b('0x24')][_0x085b('0x71')](this,_0x943c91[_0x085b('0x140')]);if(!_0x4184f8){return this[_0x085b('0x37')]['error'](_0x943c91,_0x085b('0x141'));}for(var _0x1b263d=0x0;_0x1b263d<_0x4184f8[_0x085b('0x9e')];_0x1b263d+=0x1){var _0x1b5bdf=this['channel'][_0x085b('0x11')](util[_0x085b('0x28')]('IFTIME(%s?true:false)',_0x4184f8[_0x1b263d]));if(_0x1b5bdf[_0x085b('0xa6')]===-0x1){return _0x1b5bdf;}logger['info'](util[_0x085b('0x28')](_0x085b('0x142'),_0x4184f8[_0x1b263d],_0x1b5bdf[_0x085b('0xa4')]));if(_0x1b5bdf[_0x085b('0xa4')]===_0x085b('0x13c')){logger[_0x085b('0x2a')](util['format']('IFTIME\x20%s\x20%s',_0x4184f8[_0x1b263d],_0x085b('0x13c')));this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0x142'),_0x4184f8[_0x1b263d],_0x085b('0x13c')));return{'code':0xc8,'result':_0x085b('0x13c')};}else{logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x142'),_0x4184f8[_0x1b263d],_0x085b('0x13d')));this[_0x085b('0x37')][_0x085b('0xac')](util['format']('IFTIME\x20%s\x20%s',_0x4184f8[_0x1b263d],'false'));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x085b('0x10')][_0x085b('0x143')]=function(_0x52054c){logger['info'](util[_0x085b('0x28')](_0x085b('0x144'),_0x52054c['label']));return this['channel']['hangup']();};AGIVertices[_0x085b('0x10')]['ispeechasr']=function(_0x51b7ab){logger[_0x085b('0x2a')](util['format'](_0x085b('0x145'),_0x51b7ab[_0x085b('0x35')]));if(!this['isConfigured'](_0x51b7ab[_0x085b('0x7d')])){return this['channel']['noop'](_0x085b('0x146'));}var _0x27bff6='wav';var _0x5007ba=util['format'](_0x085b('0x12c'),FILES_PATH,rs['generate'](0x4));var _0x22a8c9=util['format']('%s.%s',_0x5007ba,_0x27bff6);var _0x87a4e7=!![];if(_0x51b7ab[_0x085b('0x12d')]==='NOBEEP'){_0x87a4e7=![];}var _0x42d48e=this[_0x085b('0x37')][_0x085b('0x12f')](_0x5007ba,_0x27bff6,_0x51b7ab[_0x085b('0x130')],_0x51b7ab[_0x085b('0x65')],undefined,_0x87a4e7);if(_0x42d48e[_0x085b('0xa6')]!==-0x1){this['channel']['noop'](util[_0x085b('0x28')](_0x085b('0x147'),_0x22a8c9));var _0xc96fd1=this['ispeechASR'][_0x085b('0x71')](this,_0x51b7ab,_0x22a8c9);if(_0xc96fd1){for(var _0x29d3ba in _0xc96fd1){if(_0xc96fd1['hasOwnProperty'](_0x29d3ba)){this[_0x085b('0x37')][_0x085b('0xa1')](util[_0x085b('0x28')](_0x085b('0x148'),_0x29d3ba[_0x085b('0x6a')]()),_0xc96fd1[_0x29d3ba]);}}return this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0x149'),JSON[_0x085b('0x75')](_0xc96fd1)));}}return _0x42d48e;};AGIVertices[_0x085b('0x10')][_0x085b('0x14a')]=function(_0x32c10c){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x14b'),_0x32c10c[_0x085b('0x35')]));if(!this[_0x085b('0x87')](_0x32c10c[_0x085b('0x7d')])){return this[_0x085b('0x37')]['noop'](_0x085b('0x146'));}if(!this['isConfigured'](_0x32c10c[_0x085b('0x5b')])){return this[_0x085b('0x37')][_0x085b('0xac')]('no\x20text\x20configured');}this['channel'][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0x14c'),_0x32c10c[_0x085b('0x5b')]));var _0x18d393=this[_0x085b('0x84')][_0x085b('0x71')](this,_0x32c10c);if(_0x18d393){this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0x147'),_0x18d393));var _0x36651e=this['channel'][_0x085b('0xfd')](_0x18d393,_0x32c10c[_0x085b('0x130')]);try{fs[_0x085b('0xfe')](_0x18d393+_0x085b('0xff'));}catch(_0x12a2ec){logger[_0x085b('0x2e')](_0x12a2ec);}return _0x36651e;}return this[_0x085b('0x37')][_0x085b('0x2e')](_0x32c10c,_0x085b('0x14d'));};AGIVertices['prototype'][_0x085b('0x14e')]=function(_0x3b42e5){logger[_0x085b('0x2a')](util[_0x085b('0x28')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x3b42e5['label']));if(!this['isConfigured'](_0x3b42e5['findBy'])){return this[_0x085b('0x37')]['error'](_0x3b42e5,_0x085b('0x14f'));}logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x150'),this['channel'][_0x085b('0x39')],_0x3b42e5['findBy']));var _0x759410=this[_0x085b('0x53')]['sync'](this,_0x3b42e5[_0x085b('0x151')]);if(_0x759410){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x152'),this[_0x085b('0x37')]['callerid'],_0x3b42e5[_0x085b('0x151')]));this['channel'][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0x152'),this[_0x085b('0x37')][_0x085b('0x39')],_0x3b42e5['findBy']));return{'code':0xc8,'result':_0x085b('0x153')};}else{logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x154'),this['channel'][_0x085b('0x39')],_0x3b42e5[_0x085b('0x151')]));this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0x154'),this[_0x085b('0x37')]['callerid'],_0x3b42e5[_0x085b('0x151')]));return{'code':0xc8,'result':_0x085b('0x155')};}};AGIVertices[_0x085b('0x10')][_0x085b('0x156')]=function(_0x4ed671){logger[_0x085b('0x2a')](util[_0x085b('0x28')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x4ed671[_0x085b('0x35')]));if(!this[_0x085b('0x87')](_0x4ed671[_0x085b('0x151')])){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x4ed671,_0x085b('0x14f'));}logger[_0x085b('0x2a')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x085b('0x37')][_0x085b('0x39')],_0x4ed671['findBy']));var _0x5a84a5=this[_0x085b('0x52')][_0x085b('0x71')](this,_0x4ed671['findBy']);if(_0x5a84a5){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x152'),this[_0x085b('0x37')]['callerid'],_0x4ed671[_0x085b('0x151')]));this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0x152'),this[_0x085b('0x37')][_0x085b('0x39')],_0x4ed671[_0x085b('0x151')]));return{'code':0xc8,'result':'success'};}else{logger[_0x085b('0x2a')](util['format'](_0x085b('0x154'),this[_0x085b('0x37')][_0x085b('0x39')],_0x4ed671[_0x085b('0x151')]));this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x085b('0x37')]['callerid'],_0x4ed671[_0x085b('0x151')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype']['math']=function(_0x491f7c){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x157'),_0x491f7c['label']));if(!this[_0x085b('0x87')](_0x491f7c[_0x085b('0x158')])){return this['channel'][_0x085b('0x2e')](_0x491f7c,'no\x20operation\x20configured');}this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')]('math\x20%s',_0x491f7c[_0x085b('0x158')]));var _0x4ac202=eval(_0x491f7c[_0x085b('0x158')]);if(!this[_0x085b('0x87')](_0x491f7c[_0x085b('0xd9')])){return this[_0x085b('0x37')]['noop'](_0x085b('0x10e'));}var _0x214d79=this['getVariable'][_0x085b('0x71')](this,_0x491f7c[_0x085b('0xd9')]);if(!_0x214d79){return this[_0x085b('0x37')]['error'](_0x491f7c,_0x085b('0x113'));}if(_[_0x085b('0x9d')](_0x4ac202)){var _0x30155e=this;_0x4ac202[_0x085b('0xda')](function(_0x31f568,_0x131491){_0x30155e['channel'][_0x085b('0xa1')](util[_0x085b('0x28')](_0x085b('0x159'),_0x214d79,_0x131491),_0x31f568);});return this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0x15a'),_0x214d79));}else{return this[_0x085b('0x37')]['setVariable'](_0x214d79,_0x4ac202);}};AGIVertices[_0x085b('0x10')]['menu']=function(_0x37efde){logger[_0x085b('0x2a')](util['format'](_0x085b('0x15b'),_0x37efde[_0x085b('0x35')]));if(_0x37efde[_0x085b('0x10c')]===0x0){return this[_0x085b('0xa8')](_0x37efde);}_0x37efde[_0x085b('0x10c')]-=0x1;if(!this[_0x085b('0x87')](_0x37efde[_0x085b('0x10d')])){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x37efde,_0x085b('0x15c'));}var _0x10c809=this[_0x085b('0x1f')][_0x085b('0x71')](this,_0x37efde['file_id']);if(!_0x10c809){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x37efde,'no\x20file\x20audio\x20found');}var _0x1ec0d4=this[_0x085b('0x37')][_0x085b('0x15d')](_0x10c809,_0x37efde['response'],_0x37efde[_0x085b('0x15e')]);var _0x553755=_0x1ec0d4['result'];if(_0x1ec0d4['result']===-0x1){this['createSquareDetailsReport'][_0x085b('0x71')](this,_0x37efde,'-1');return _0x1ec0d4;}else if(_0x1ec0d4['extra']===_0x085b('0x65')){_0x1ec0d4[_0x085b('0xa6')]=_0x1ec0d4[_0x085b('0xa6')]['length']>0x0?_0x1ec0d4[_0x085b('0xa6')]:'t';}else if(_[_0x085b('0x44')](_0x1ec0d4[_0x085b('0xa6')])){_0x1ec0d4[_0x085b('0xa6')]='#';_0x553755='#';}if(!this[_0x085b('0x87')](_0x37efde['variable_id'])){this[_0x085b('0x37')][_0x085b('0xac')](_0x085b('0x10e'));}else{var _0x5afc7c=this['getVariable'][_0x085b('0x71')](this,_0x37efde['variable_id']);if(!_0x5afc7c){return this['channel'][_0x085b('0x2e')](_0x37efde,_0x085b('0x113'));}this[_0x085b('0x37')][_0x085b('0xa1')](_0x5afc7c,_0x553755);}this['createSquareDetailsReport'][_0x085b('0x71')](this,_0x37efde,_0x553755);return _0x1ec0d4;};AGIVertices[_0x085b('0x10')][_0x085b('0xac')]=function(_0xfeef21){logger['info'](util['format'](_0x085b('0x15f'),_0xfeef21[_0x085b('0x35')]));return this['channel']['noop'](_0xfeef21[_0x085b('0x160')]||_0xfeef21[_0x085b('0x35')]);};AGIVertices[_0x085b('0x10')][_0x085b('0x161')]=function(_0x28c804){logger['info'](util[_0x085b('0x28')](_0x085b('0x162'),_0x28c804[_0x085b('0x35')]));if(!this['isConfigured'](_0x28c804[_0x085b('0x151')])){return this['channel'][_0x085b('0x2e')](_0x28c804,_0x085b('0x14f'));}logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x150'),this[_0x085b('0x37')][_0x085b('0x39')],_0x28c804[_0x085b('0x151')]));var _0x3fa468=this[_0x085b('0x4d')][_0x085b('0x71')](this,_0x28c804['pause_id']);var _0x460fb8=this[_0x085b('0x4f')][_0x085b('0x71')](this,_0x28c804[_0x085b('0x151')],_0x3fa468);if(_0x460fb8){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x152'),this[_0x085b('0x37')]['callerid'],_0x28c804[_0x085b('0x151')]));this[_0x085b('0x37')]['noop'](util['format'](_0x085b('0x152'),this['channel']['callerid'],_0x28c804['findBy']));return{'code':0xc8,'result':_0x085b('0x153')};}else{logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x154'),this[_0x085b('0x37')]['callerid'],_0x28c804['findBy']));this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0x152'),this['channel'][_0x085b('0x39')],_0x28c804[_0x085b('0x151')]));return{'code':0xc8,'result':_0x085b('0x155')};}};AGIVertices[_0x085b('0x10')][_0x085b('0x163')]=function(_0x249235){logger[_0x085b('0x2a')](util['format'](_0x085b('0x164'),_0x249235[_0x085b('0x35')]));if(!this[_0x085b('0x87')](_0x249235['file_id'])){return this[_0x085b('0x37')]['error'](_0x249235,'no\x20file\x20audio\x20selected');}var _0x3cfd3d=this[_0x085b('0x1f')][_0x085b('0x71')](this,_0x249235[_0x085b('0x10d')]);if(!_0x3cfd3d){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x249235,_0x085b('0x165'));}var _0x333e97=this[_0x085b('0x37')][_0x085b('0x58')](_0x085b('0x166'),[_0x3cfd3d,_0x249235[_0x085b('0xe2')]]);if(_0x333e97[_0x085b('0xa6')]===-0x1){return _0x333e97;}return this['channel']['noop'](util[_0x085b('0x28')](_0x085b('0xc9'),_0x085b('0x166'),_0x3cfd3d));};AGIVertices[_0x085b('0x10')]['queue']=function(_0x200ce3){logger['info'](util['format']('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x200ce3[_0x085b('0x35')]));if(!this[_0x085b('0x87')](_0x200ce3['queue_id'])){return this['channel'][_0x085b('0x2e')](_0x200ce3,_0x085b('0x167'));}var _0x1a2e5e='';var _0x3fd69d=parseInt(_0x200ce3[_0x085b('0x168')],0xa);if(isNaN(_0x3fd69d)){_0x1a2e5e=_0x200ce3[_0x085b('0x168')];}else{_0x1a2e5e=this[_0x085b('0x169')][_0x085b('0x71')](this,_0x200ce3[_0x085b('0x168')]);if(!_0x1a2e5e){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x200ce3,_0x085b('0x16a'));}}var _0x1492d3='';if(this[_0x085b('0x87')](_0x200ce3['file_id'])){var _0xbc5a5b=this['getSound']['sync'](this,_0x200ce3[_0x085b('0x10d')]);if(_0xbc5a5b){_0x1492d3=_0xbc5a5b;}}this[_0x085b('0x33')][_0x085b('0x71')](this,_0x200ce3,_0x1a2e5e);if(_0x200ce3[_0x085b('0xe2')]['indexOf']('x')<0x0){_0x200ce3['opts']+='x';}if(_0x200ce3[_0x085b('0xe2')][_0x085b('0x16b')]('X')<0x0){_0x200ce3['opts']+='X';}this['channel']['setVariable'](_0x085b('0x16c'),_0x1a2e5e?_0x1a2e5e[_0x085b('0x16d')]():'');var _0x479613=this[_0x085b('0x37')][_0x085b('0x58')]('QUEUE',[_0x1a2e5e,_0x200ce3[_0x085b('0xe2')],_0x200ce3[_0x085b('0x63')],_0x1492d3,_0x200ce3[_0x085b('0x65')],_0x200ce3[_0x085b('0x9')],_0x200ce3[_0x085b('0x16e')],_0x200ce3[_0x085b('0x16f')],'',_0x200ce3[_0x085b('0x170')]]);if(_0x479613[_0x085b('0xa6')]===-0x1){return _0x479613;}return this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0xc9'),_0x085b('0x171'),_0x1a2e5e));};AGIVertices[_0x085b('0x10')][_0x085b('0x172')]=function(_0x1932e0){logger['info'](util[_0x085b('0x28')](_0x085b('0x173'),_0x1932e0[_0x085b('0x35')]));var _0x66e2ef=_0x1932e0[_0x085b('0x174')]||_0x085b('0x12b');var _0x3527a5=util[_0x085b('0x28')](_0x085b('0x175'),this[_0x085b('0x37')]['uniqueid'],rs[_0x085b('0x115')](0x5));var _0x271099=util[_0x085b('0x28')](_0x085b('0x176'),FILES_PATH,_0x3527a5,_0x66e2ef);var _0x1f1783=util[_0x085b('0x28')](_0x085b('0x12c'),FILES_PATH,_0x3527a5);this[_0x085b('0x3a')][_0x085b('0x71')](this,_0x1932e0,_0x3527a5,_0x271099);this[_0x085b('0x37')]['setVariable']('RECORDING_SAVENAME',_0x3527a5);logger['info'](_0x085b('0x177'),_0x1f1783,_0x66e2ef,_0x1932e0[_0x085b('0x178')],_0x1932e0[_0x085b('0x65')]);return this[_0x085b('0x37')]['recordFile'](_0x1f1783,_0x66e2ef,_0x1932e0[_0x085b('0x178')],_0x1932e0[_0x085b('0x65')],undefined,!![]);};AGIVertices['prototype'][_0x085b('0x179')]=function(_0x49f7d6){logger[_0x085b('0x2a')](util[_0x085b('0x28')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x49f7d6[_0x085b('0x35')]));if(!this[_0x085b('0x87')](_0x49f7d6['url'])){return this[_0x085b('0x37')]['noop']('no\x20url\x20configured');}var _0x43b52f=this[_0x085b('0x62')][_0x085b('0x71')](this,_0x49f7d6);logger[_0x085b('0x2a')](util['format'](_0x085b('0x17a'),util[_0x085b('0x17b')](_0x43b52f,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x49f7d6[_0x085b('0xd9')])){return this[_0x085b('0x37')][_0x085b('0xac')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x431628=this['getVariable'][_0x085b('0x71')](this,_0x49f7d6['variable_id']);if(!_0x431628){return this[_0x085b('0x37')]['error'](_0x49f7d6,_0x085b('0x113'));}this[_0x085b('0x37')][_0x085b('0xa1')](util[_0x085b('0x28')](_0x085b('0x17c'),_0x431628),_0x43b52f[_0x085b('0x77')]?_0x43b52f[_0x085b('0x77')]:_0x085b('0x17d'));this[_0x085b('0x37')][_0x085b('0xa1')](util[_0x085b('0x28')]('%s_STATUS_MESSAGE',_0x431628),_0x43b52f[_0x085b('0x78')]?_0x43b52f['statusMessage']:'OK');if(_0x43b52f[_0x085b('0x6b')]){try{this[_0x085b('0x9f')](_0x43b52f[_0x085b('0x6b')],_0x431628);}catch(_0x239086){logger[_0x085b('0x2e')](util['format'](_0x085b('0x17e'),_0x431628));}}return this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0x17f'),_0x431628));};AGIVertices[_0x085b('0x10')][_0x085b('0x180')]=function(_0x2f3e1f){logger[_0x085b('0x2a')](util[_0x085b('0x28')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x2f3e1f['label']));return this[_0x085b('0x37')][_0x085b('0x181')](_0x2f3e1f['digits'][_0x085b('0xd8')](/\s+/g,''),_0x2f3e1f[_0x085b('0x178')]);};AGIVertices[_0x085b('0x10')][_0x085b('0x182')]=function(_0x39e1f2){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x183'),_0x39e1f2[_0x085b('0x35')]));return this[_0x085b('0x37')][_0x085b('0x184')](_0x39e1f2[_0x085b('0x66')][_0x085b('0xd8')](/\s+/g,''),_0x39e1f2[_0x085b('0x178')]);};AGIVertices[_0x085b('0x10')]['sayphonetic']=function(_0x47aa62){logger['info'](util[_0x085b('0x28')](_0x085b('0x185'),_0x47aa62[_0x085b('0x35')]));return this['channel'][_0x085b('0x186')](_0x47aa62[_0x085b('0x5b')],_0x47aa62[_0x085b('0x178')]);};AGIVertices['prototype'][_0x085b('0x187')]=function(_0x495afe){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x188'),_0x495afe[_0x085b('0x35')]));if(!this[_0x085b('0x87')](_0x495afe[_0x085b('0x189')])){return this[_0x085b('0x37')][_0x085b('0xac')](_0x085b('0x18a'));}var _0x3495d9=this[_0x085b('0x18b')][_0x085b('0x71')](this,_0x495afe[_0x085b('0x189')]);if(!_0x3495d9||!_0x3495d9[_0x085b('0x18c')]){return this['channel'][_0x085b('0x2e')](_0x495afe,'no\x20mail\x20account\x20found');}var _0x5bb0f3={'from':util[_0x085b('0x28')](_0x085b('0x18d'),_0x3495d9['name'],_0x3495d9[_0x085b('0x18e')]||_0x3495d9[_0x085b('0x18c')][_0x085b('0x18f')]),'to':_0x495afe['to']||'','cc':_0x495afe['cc']||'','bcc':_0x495afe[_0x085b('0x190')]||'','subject':_0x495afe[_0x085b('0x191')],'html':_0x495afe['text'],'text':_0x495afe['text']};var _0x1f7d30={'tls':{'rejectUnauthorized':![]}};if(_0x3495d9[_0x085b('0x18c')][_0x085b('0x192')]){_0x1f7d30['service']=_0x3495d9[_0x085b('0x18c')]['service'];}else{_0x1f7d30['host']=_0x3495d9[_0x085b('0x18c')][_0x085b('0x193')];_0x1f7d30[_0x085b('0x194')]=_0x3495d9[_0x085b('0x18c')][_0x085b('0x194')];_0x1f7d30[_0x085b('0x195')]=_0x3495d9[_0x085b('0x18c')][_0x085b('0x195')];}if(_0x3495d9['Smtp'][_0x085b('0x196')]){_0x1f7d30[_0x085b('0x197')]={'user':_0x3495d9[_0x085b('0x18c')][_0x085b('0x18f')],'pass':_0x3495d9['Smtp']['pass']};}if(this[_0x085b('0x87')](_0x495afe[_0x085b('0x198')])){}logger[_0x085b('0x199')](_0x085b('0x19a'),JSON[_0x085b('0x75')](_0x5bb0f3));this[_0x085b('0x33')][_0x085b('0x71')](this,_0x495afe,_0x495afe[_0x085b('0x189')]);this['channel'][_0x085b('0xac')](util[_0x085b('0x28')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x3495d9[_0x085b('0x15')]));this[_0x085b('0x23')][_0x085b('0x71')](this,_0x1f7d30,_0x5bb0f3);return this[_0x085b('0x37')][_0x085b('0xac')](_0x085b('0x19b'));};AGIVertices['prototype'][_0x085b('0x19c')]=function(_0x3f22dd){logger['info'](util[_0x085b('0x28')](_0x085b('0x19d'),_0x3f22dd['label']));return this['channel'][_0x085b('0xac')](_0x085b('0x19e'));};AGIVertices['prototype']['sendSMS']=function(_0x58d8ee){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x19f'),_0x58d8ee[_0x085b('0x35')]));if(!this[_0x085b('0x87')](_0x58d8ee['sms_account_id'])){return this[_0x085b('0x37')][_0x085b('0xac')](_0x085b('0x1a0'));}var _0x1ff8fd=this[_0x085b('0x30')]['sync'](this,_0x58d8ee[_0x085b('0x1a1')]);if(!_0x1ff8fd){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x58d8ee,_0x085b('0x1a2'));}var _0xfef726={'body':_0x58d8ee[_0x085b('0x1a3')],'phone':_0x58d8ee['to']||'','SmsAccountId':_0x1ff8fd['id']};logger['debug'](_0x085b('0x1a4'),JSON[_0x085b('0x75')](_0xfef726));this[_0x085b('0x33')][_0x085b('0x71')](this,_0x58d8ee,_0x58d8ee[_0x085b('0x1a1')]);this[_0x085b('0x37')]['noop'](util[_0x085b('0x28')](_0x085b('0x1a5'),_0x1ff8fd[_0x085b('0x15')]));this[_0x085b('0x32')]['sync'](this,_0xfef726);return this[_0x085b('0x37')]['noop']('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x085b('0x10')][_0x085b('0x1a6')]=function(_0x5392da){logger[_0x085b('0x2a')](util[_0x085b('0x28')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x5392da[_0x085b('0x35')]));if(!this['isConfigured'](_0x5392da[_0x085b('0xd9')])){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x5392da,_0x085b('0x1a7'));}var _0x1d599e=this[_0x085b('0x11')]['sync'](this,_0x5392da['variable_id']);if(!_0x1d599e){return this['channel'][_0x085b('0x2e')](_0x5392da,_0x085b('0x113'));}return this[_0x085b('0x37')]['setVariable'](_0x1d599e,_0x5392da['variable_value']);};AGIVertices[_0x085b('0x10')][_0x085b('0x1a8')]=function(_0x3d4fb9){logger[_0x085b('0x2a')](util['format'](_0x085b('0x1a9'),_0x3d4fb9[_0x085b('0x35')]));this[_0x085b('0x37')][_0x085b('0xac')](_0x085b('0x1aa'));if(_0x3d4fb9[_0x085b('0xbb')]===_0x085b('0x1ab')){this[_0x085b('0x37')]['noop'](_0x085b('0x1ac'));return this[_0x085b('0x37')][_0x085b('0xbb')]();}return this[_0x085b('0x37')]['noop'](_0x085b('0x1ad'));};AGIVertices['prototype'][_0x085b('0x1ae')]=function(_0x15946e){logger[_0x085b('0x2a')](util['format'](_0x085b('0x1af'),_0x15946e[_0x085b('0x35')]));if(!this['isConfigured'](_0x15946e[_0x085b('0x1b0')])){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x15946e,'no\x20subproject\x20selected');}var _0x2636c6=this[_0x085b('0x18')][_0x085b('0x71')](this,_0x15946e[_0x085b('0x1b0')]);if(!this[_0x085b('0x87')](_0x2636c6)){return this['channel'][_0x085b('0x2e')](_0x15946e,util[_0x085b('0x28')](_0x085b('0x1b1'),_0x15946e[_0x085b('0x1b0')]));}if(_0x2636c6===this[_0x085b('0x37')][_0x085b('0x38')]){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x15946e,_0x085b('0x1b2'));}this[_0x085b('0x33')][_0x085b('0x71')](this,_0x15946e,_0x2636c6);var _0xca02af=this['channel']['exec'](_0x085b('0x1b3'),util[_0x085b('0x28')](_0x085b('0x1b4'),config[_0x085b('0x9')][_0x085b('0x193')]||_0x085b('0x1b5'),_0x2636c6,this[_0x085b('0x37')]['arg_1']));if(_0xca02af['result']===-0x1){return _0xca02af;}return this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')]('Executed\x20command\x20%s\x20%s',_0x085b('0x1b3'),_0x2636c6));};AGIVertices[_0x085b('0x10')][_0x085b('0x1b6')]=function(_0xe0dda9){logger[_0x085b('0x2a')](util['format'](_0x085b('0x1b7'),_0xe0dda9['label']));var _0x350422=this['shellCommand'][_0x085b('0x71')](this,_0xe0dda9['command']);this[_0x085b('0x33')][_0x085b('0x71')](this,_0xe0dda9,_0xe0dda9[_0x085b('0xb9')]);if(this[_0x085b('0x87')](_0xe0dda9['variable_id'])){var _0xecd800=this[_0x085b('0x11')][_0x085b('0x71')](this,_0xe0dda9[_0x085b('0xd9')]);if(_0xecd800){this['channel'][_0x085b('0xa1')](_0xecd800,_0x350422);return this['channel'][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0x1b8'),_0xe0dda9[_0x085b('0xb9')],_0xecd800));}}return this[_0x085b('0x37')]['noop'](util[_0x085b('0x28')](_0x085b('0x1b9'),_0xe0dda9[_0x085b('0xb9')]));};AGIVertices[_0x085b('0x10')][_0x085b('0x1ba')]=function(_0x179957){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x1bb'),_0x179957['label']));_0x179957[_0x085b('0x5b')]=_0x179957[_0x085b('0x5b')][_0x085b('0xd8')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x179957['apiKey'])){return this[_0x085b('0x37')][_0x085b('0xac')]('no\x20apiKey\x20configured');}if(!this[_0x085b('0x87')](_0x179957['text'])){return this[_0x085b('0x37')]['noop'](_0x085b('0xab'));}this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x179957['text']));var _0x33819d=this[_0x085b('0x59')][_0x085b('0x71')](this,_0x179957);if(_0x33819d){this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0x1bc'),_0x33819d));var _0x4ec91f=this['channel'][_0x085b('0xfd')](_0x33819d);try{fs[_0x085b('0xfe')](_0x33819d+_0x085b('0xff'));}catch(_0x5cdecf){logger[_0x085b('0x2e')](_0x5cdecf);}return _0x4ec91f;}return this[_0x085b('0x37')][_0x085b('0x2e')](_0x179957,_0x085b('0x1bd'));};AGIVertices[_0x085b('0x10')][_0x085b('0x1be')]=function(_0x2f0553){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x1bf'),_0x2f0553[_0x085b('0x35')]));_0x2f0553[_0x085b('0x5b')]=_0x2f0553[_0x085b('0x5b')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x085b('0x87')](_0x2f0553[_0x085b('0x5b')])){return this[_0x085b('0x37')][_0x085b('0xac')](_0x085b('0xab'));}this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0x1c0'),_0x2f0553['text']));var _0x89bcb4=this[_0x085b('0x1c1')]['sync'](this,_0x2f0553);if(_0x89bcb4){this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0x1c2'),_0x89bcb4));var _0x5800de=this[_0x085b('0x37')][_0x085b('0xfd')](_0x89bcb4);try{fs['unlink'](_0x89bcb4+_0x085b('0xff'));}catch(_0x17f6e3){logger['error'](_0x17f6e3);}return _0x5800de;}return this[_0x085b('0x37')][_0x085b('0x2e')](_0x2f0553,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x085b('0x10')][_0x085b('0x1c3')]=function(_0x37ca78){logger[_0x085b('0x2a')](util[_0x085b('0x28')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x37ca78['label']));if(!this[_0x085b('0x87')](_0x37ca78[_0x085b('0x151')])){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x37ca78,_0x085b('0x14f'));}logger['info'](util[_0x085b('0x28')](_0x085b('0x150'),this[_0x085b('0x37')][_0x085b('0x39')],_0x37ca78['findBy']));var _0x4dbaec=this[_0x085b('0x51')][_0x085b('0x71')](this,_0x37ca78[_0x085b('0x151')]);if(_0x4dbaec){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x152'),this[_0x085b('0x37')]['callerid'],_0x37ca78[_0x085b('0x151')]));this['channel'][_0x085b('0xac')](util[_0x085b('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x085b('0x37')][_0x085b('0x39')],_0x37ca78[_0x085b('0x151')]));return{'code':0xc8,'result':_0x085b('0x153')};}else{logger['info'](util[_0x085b('0x28')](_0x085b('0x154'),this['channel'][_0x085b('0x39')],_0x37ca78[_0x085b('0x151')]));this[_0x085b('0x37')]['noop'](util['format'](_0x085b('0x154'),this[_0x085b('0x37')][_0x085b('0x39')],_0x37ca78['findBy']));return{'code':0xc8,'result':_0x085b('0x155')};}};AGIVertices[_0x085b('0x10')][_0x085b('0x1c4')]=function(_0x5497b0){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x1c5'),_0x5497b0[_0x085b('0x35')]));var _0x40e1cb=this[_0x085b('0x37')]['exec'](_0x085b('0x1c6'),[_0x5497b0[_0x085b('0x1c7')],_0x5497b0['options']]);if(_0x40e1cb['result']===-0x1){return _0x40e1cb;}return this['channel'][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0xc9'),_0x085b('0x1c6'),_0x5497b0['mailbox']));};AGIVertices[_0x085b('0x10')][_0x085b('0x1c8')]=function(_0x423b23){logger[_0x085b('0x2a')](util['format'](_0x085b('0x1c9'),_0x423b23['label']));if(!this[_0x085b('0x87')](_0x423b23[_0x085b('0xd9')])){return this['channel']['error'](_0x423b23,_0x085b('0x1a7'));}var _0x4ba525=this[_0x085b('0x11')][_0x085b('0x71')](this,_0x423b23[_0x085b('0xd9')]);if(!_0x4ba525){return this['channel'][_0x085b('0x2e')](_0x423b23,'no\x20variable\x20found');}var _0x75d981=this[_0x085b('0x37')][_0x085b('0x11')](_0x4ba525);return{'code':0xc8,'result':_0x75d981[_0x085b('0xa4')]?_0x75d981[_0x085b('0xa4')]:'-'};};String['prototype']['replaceAll']=function(_0x57f213,_0xa38d6){return this[_0x085b('0xa2')](_0x57f213)[_0x085b('0x1ca')](_0xa38d6);};module[_0x085b('0x1cb')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 80b5c07..d013963 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 _0xc5cd=['[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','autopause','all','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','queue','ACW','name','mandatoryDispositionPause','Action','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','format','YYYY-MM-DD\x20HH:mm:ss','update','uniqueid','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','acwTimeout','[ACW][START]\x20%s','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','message','[ACW][syncAgentConnectPreview]\x20%s','attended','[%s][HANGUP:UNIQUEID]','linkedid','isUndefined'];(function(_0x14a07a,_0xdf5495){var _0x2b609c=function(_0x1c23a6){while(--_0x1c23a6){_0x14a07a['push'](_0x14a07a['shift']());}};_0x2b609c(++_0xdf5495);}(_0xc5cd,0x6a));var _0xdc5c=function(_0x1201b5,_0x4057bb){_0x1201b5=_0x1201b5-0x0;var _0xe99bec=_0xc5cd[_0x1201b5];return _0xe99bec;};'use strict';var util=require(_0xdc5c('0x0'));var _=require('lodash');var moment=require(_0xdc5c('0x1'));var ami=require(_0xdc5c('0x2'));var logger=require(_0xdc5c('0x3'))(_0xdc5c('0x4'));var RpcUser=require(_0xdc5c('0x5'));var RpcVoiceAgentReport=require(_0xdc5c('0x6'));function Acw(_0x19b242){this['voiceQueues']=_0x19b242[_0xdc5c('0x7')];this[_0xdc5c('0x8')]=_0x19b242['agents'];this[_0xdc5c('0x9')]=_0x19b242[_0xdc5c('0x9')];this[_0xdc5c('0xa')]={};ami['on']('agentconnect',this[_0xdc5c('0xb')][_0xdc5c('0xc')](this));ami['on'](_0xdc5c('0xd'),this[_0xdc5c('0xe')][_0xdc5c('0xc')](this));ami['on'](_0xdc5c('0xf'),this[_0xdc5c('0x10')][_0xdc5c('0xc')](this));ami['on'](_0xdc5c('0x11'),this[_0xdc5c('0x12')][_0xdc5c('0xc')](this));ami['on'](_0xdc5c('0x13'),this[_0xdc5c('0x14')][_0xdc5c('0xc')](this));ami['on'](_0xdc5c('0x15'),this[_0xdc5c('0x16')][_0xdc5c('0xc')](this));ami['on'](_0xdc5c('0x17'),this[_0xdc5c('0x18')]['bind'](this));}function getDiff(_0x32c873){var _0x329e4b=moment()[_0xdc5c('0x19')](0x0);var _0x3c16e8=moment(_0x32c873)[_0xdc5c('0x19')](0x0);return _0x329e4b[_0xdc5c('0x1a')](_0x3c16e8,_0xdc5c('0x1b'));}Acw[_0xdc5c('0x1c')][_0xdc5c('0x1d')]=function(_0x820b4a){try{var _0x4200b9=this;var _0x33b7e0=this[_0xdc5c('0xa')][_0x820b4a][_0xdc5c('0x1e')];var _0x76c6d4=this['channels'][_0x820b4a][_0xdc5c('0x1f')];var _0x317d3e=this['voiceQueues'][_0x76c6d4];var _0xa32c2d=![];var _0x3ab4a9=_0xdc5c('0x20');if(_0x317d3e['mandatoryDisposition']){if(_0x317d3e['mandatoryDispositionPause'][_0xdc5c('0x21')]){_0xa32c2d=!![];_0x3ab4a9=_0x317d3e[_0xdc5c('0x22')][_0xdc5c('0x21')];}}ami[_0xdc5c('0x23')]({'action':_0xdc5c('0x24'),'interface':_0x33b7e0,'paused':!![],'reason':_0x3ab4a9})[_0xdc5c('0x25')](function(_0x373596){if(_0x4200b9['agents'][_0x33b7e0]){return RpcUser[_0xdc5c('0x26')](_0x4200b9[_0xdc5c('0x8')][_0x33b7e0]['id'])[_0xdc5c('0x25')](function(_0x385cd3){if(_0x385cd3&&!_0x385cd3[_0xdc5c('0x27')]){logger[_0xdc5c('0x28')](_0xdc5c('0x29'),_0x820b4a,_0x33b7e0,_0x76c6d4);var _0x2febff=_0x4200b9['channels'][_0x820b4a]['attended']&&_0x4200b9['channels'][_0x820b4a][_0xdc5c('0x2a')]?_0x4200b9[_0xdc5c('0xa')][_0x820b4a]['destlinkedid']:_0x820b4a;return RpcUser['savePause'](_0x4200b9['agents'][_0x33b7e0],_0x3ab4a9,_0x2febff)[_0xdc5c('0x25')](function(_0xfceb07){if(!_0xa32c2d){_0x4200b9[_0xdc5c('0x9')][_0x33b7e0]={};logger[_0xdc5c('0x28')](_0xdc5c('0x2b'),_0x820b4a,_0x4200b9[_0xdc5c('0x7')][_0x76c6d4]['acwTimeout'],_0x33b7e0,_0x76c6d4);_0x4200b9[_0xdc5c('0x9')][_0x33b7e0][_0xdc5c('0x2c')]=setTimeout(_0x4200b9['stopAcw']['bind'](_0x4200b9,_0x33b7e0),_0x4200b9[_0xdc5c('0x7')][_0x76c6d4]['acwTimeout']*0x3e8);_0x4200b9[_0xdc5c('0x9')][_0x33b7e0]['lastPauseAt']=moment()[_0xdc5c('0x2d')](_0xdc5c('0x2e'));_0x4200b9[_0xdc5c('0x9')][_0x33b7e0]['uniqueid']=_0x820b4a;_0x4200b9[_0xdc5c('0x9')][_0x33b7e0][_0xdc5c('0x1f')]=_0x76c6d4;_0x4200b9['timers'][_0x33b7e0]['updateAcw']=function(){var _0x226e74=getDiff(_0x4200b9[_0xdc5c('0x9')][_0x33b7e0]['lastPauseAt']);clearTimeout(_0x4200b9[_0xdc5c('0x9')][_0x33b7e0][_0xdc5c('0x2c')]);_0x4200b9[_0xdc5c('0x9')][_0x33b7e0][_0xdc5c('0x2c')]=![];RpcVoiceAgentReport[_0xdc5c('0x2f')]({'acwtime':_0x226e74},_0x4200b9[_0xdc5c('0x9')][_0x33b7e0][_0xdc5c('0x30')],_0x33b7e0)[_0xdc5c('0x25')](function(_0x9c980){logger['info'](_0xdc5c('0x31'),_0x820b4a,_0x226e74,_0x9c980);})[_0xdc5c('0x32')](function(_0x285648){logger[_0xdc5c('0x33')](_0xdc5c('0x34'),_0x820b4a,_0x285648);});delete _0x4200b9[_0xdc5c('0x9')][_0x33b7e0];};}});}else{logger[_0xdc5c('0x28')](_0xdc5c('0x35'),_0x820b4a,_0x33b7e0,_0x76c6d4);}});}})[_0xdc5c('0x32')](function(_0x1eb81d){logger['error'](_0xdc5c('0x2b'),_0x820b4a,_0x4200b9[_0xdc5c('0x7')][_0x76c6d4][_0xdc5c('0x36')],_0x33b7e0,_0x76c6d4);})['finally'](function(){delete _0x4200b9[_0xdc5c('0xa')][_0x820b4a];});}catch(_0x235a8f){logger[_0xdc5c('0x33')](_0xdc5c('0x37'),_0x235a8f['message']);}};Acw[_0xdc5c('0x1c')]['stopAcw']=function(_0x49565b){try{var _0x448d0b=this;if(_0x448d0b[_0xdc5c('0x9')][_0x49565b]){_0x448d0b[_0xdc5c('0x9')][_0x49565b]['timer']=![];var _0xae6504=_0x448d0b[_0xdc5c('0x9')][_0x49565b][_0xdc5c('0x30')];var _0x1c1a4c=_0x448d0b['timers'][_0x49565b][_0xdc5c('0x1f')];var _0x3d8fdc=_0x448d0b[_0xdc5c('0x7')][_0x1c1a4c][_0xdc5c('0x36')];logger[_0xdc5c('0x28')]('[%s][TIMER][STOP][AGENT:%s]',_0xae6504,_0x49565b);RpcUser['saveUnpause'](this['agents'][_0x49565b]);RpcVoiceAgentReport[_0xdc5c('0x2f')]({'acwtime':_0x3d8fdc,'agentacw':!![]},_0xae6504,_0x49565b)[_0xdc5c('0x25')](function(_0x18d551){logger[_0xdc5c('0x28')]('[%s][UPDATE][ACWTIME:%s]',_0xae6504,_0x3d8fdc,_0x18d551);})['catch'](function(_0x5b6cb7){logger[_0xdc5c('0x33')]('[%s][UPDATE][ERRORS:%s]',_0xae6504,_0x5b6cb7);});}else{logger[_0xdc5c('0x33')](_0xdc5c('0x38'),_0x49565b);if(_0x448d0b['timers']){logger['info'](_0xdc5c('0x39'),JSON['stringify'](_0x448d0b[_0xdc5c('0x9')]));}}}catch(_0x4c235c){logger[_0xdc5c('0x33')]('[ACW][STOP]\x20%s',_0x4c235c[_0xdc5c('0x3a')]);}};Acw['prototype'][_0xdc5c('0xb')]=function(_0x2cc79d){try{if(this[_0xdc5c('0x7')][_0x2cc79d[_0xdc5c('0x1f')]]&&(this[_0xdc5c('0x7')][_0x2cc79d[_0xdc5c('0x1f')]]['acw']||this[_0xdc5c('0x7')][_0x2cc79d['queue']]['mandatoryDisposition'])){if(this[_0xdc5c('0x8')][_0x2cc79d[_0xdc5c('0x1e')]]){this[_0xdc5c('0xa')][_0x2cc79d['uniqueid']]={'queue':_0x2cc79d[_0xdc5c('0x1f')],'interface':_0x2cc79d['interface'],'destlinkedid':_0x2cc79d[_0xdc5c('0x2a')]};}}}catch(_0x4cd6fa){logger[_0xdc5c('0x33')]('[ACW][syncAgentConnect]\x20%s',_0x4cd6fa[_0xdc5c('0x3a')]);}};Acw[_0xdc5c('0x1c')][_0xdc5c('0x18')]=function(_0x2dd53a){try{if(this[_0xdc5c('0x7')][_0x2dd53a[_0xdc5c('0x1f')]]&&(this[_0xdc5c('0x7')][_0x2dd53a[_0xdc5c('0x1f')]][_0xdc5c('0x4')]||this[_0xdc5c('0x7')][_0x2dd53a['queue']]['mandatoryDisposition'])){if(this[_0xdc5c('0x8')][_0x2dd53a[_0xdc5c('0x1e')]]){this[_0xdc5c('0xa')][_0x2dd53a[_0xdc5c('0x30')]]={'queue':_0x2dd53a[_0xdc5c('0x1f')],'interface':_0x2dd53a[_0xdc5c('0x1e')]};}}}catch(_0x1316a7){logger[_0xdc5c('0x33')](_0xdc5c('0x3b'),_0x1316a7[_0xdc5c('0x3a')]);}};Acw['prototype'][_0xdc5c('0xe')]=function(_0x7a76c6){try{if(this[_0xdc5c('0xa')][_0x7a76c6[_0xdc5c('0x30')]]&&_['isUndefined'](this['channels'][_0x7a76c6[_0xdc5c('0x30')]][_0xdc5c('0x3c')])){logger[_0xdc5c('0x28')](_0xdc5c('0x3d'),_0x7a76c6['uniqueid']);this[_0xdc5c('0x1d')](_0x7a76c6['uniqueid']);}else if(this['channels'][_0x7a76c6[_0xdc5c('0x3e')]]&&_[_0xdc5c('0x3f')](this[_0xdc5c('0xa')][_0x7a76c6[_0xdc5c('0x3e')]][_0xdc5c('0x3c')])){logger[_0xdc5c('0x28')](_0xdc5c('0x40'),_0x7a76c6['linkedid']);this[_0xdc5c('0x1d')](_0x7a76c6[_0xdc5c('0x3e')]);}}catch(_0x1390f3){logger[_0xdc5c('0x33')](_0xdc5c('0x41'),_0x1390f3[_0xdc5c('0x3a')]);}};Acw[_0xdc5c('0x1c')][_0xdc5c('0x10')]=function(_0x8e77e1){try{if(this['channels'][_0x8e77e1['uniqueid']]&&this[_0xdc5c('0xa')][_0x8e77e1['uniqueid']][_0xdc5c('0x3c')]){logger['info'](_0xdc5c('0x42'),_0x8e77e1[_0xdc5c('0x30')]);this[_0xdc5c('0x1d')](_0x8e77e1[_0xdc5c('0x30')]);}else if(this[_0xdc5c('0xa')][_0x8e77e1['linkedid']]&&this['channels'][_0x8e77e1['linkedid']]['attended']){logger['info']('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x8e77e1[_0xdc5c('0x3e')]);this[_0xdc5c('0x1d')](_0x8e77e1[_0xdc5c('0x3e')]);}}catch(_0x3186ed){logger[_0xdc5c('0x33')](_0xdc5c('0x43'),_0x3186ed[_0xdc5c('0x3a')]);}};Acw[_0xdc5c('0x1c')][_0xdc5c('0x14')]=function(_0x29b1c8){try{if(!_[_0xdc5c('0x44')](this[_0xdc5c('0xa')][_0x29b1c8['transfereeuniqueid']])){this[_0xdc5c('0x1d')](_0x29b1c8[_0xdc5c('0x45')]);if(this[_0xdc5c('0xa')][_0x29b1c8['secondtransfereruniqueid']]){this[_0xdc5c('0xa')][_0x29b1c8[_0xdc5c('0x46')]][_0xdc5c('0x3c')]=!![];this['channels'][_0x29b1c8[_0xdc5c('0x47')]]=this['channels'][_0x29b1c8[_0xdc5c('0x46')]];delete this['channels'][_0x29b1c8[_0xdc5c('0x46')]];}}else if(!_['isNil'](this[_0xdc5c('0xa')][_0x29b1c8['transfertargetuniqueid']])){this[_0xdc5c('0x1d')](_0x29b1c8[_0xdc5c('0x47')]);if(this['channels'][_0x29b1c8[_0xdc5c('0x48')]]){this[_0xdc5c('0xa')][_0x29b1c8[_0xdc5c('0x48')]][_0xdc5c('0x3c')]=!![];this[_0xdc5c('0xa')][_0x29b1c8[_0xdc5c('0x45')]]=this['channels'][_0x29b1c8[_0xdc5c('0x48')]];delete this[_0xdc5c('0xa')][_0x29b1c8[_0xdc5c('0x48')]];}}}catch(_0x3c1670){logger[_0xdc5c('0x33')](_0xdc5c('0x49'),_0x3c1670[_0xdc5c('0x3a')]);}};Acw[_0xdc5c('0x1c')][_0xdc5c('0x16')]=function(_0x208216){try{if(this[_0xdc5c('0xa')][_0x208216[_0xdc5c('0x4a')]]){logger[_0xdc5c('0x28')](_0xdc5c('0x4b'),JSON[_0xdc5c('0x4c')](_0x208216['transfereruniqueid']));this[_0xdc5c('0x1d')](_0x208216[_0xdc5c('0x4a')]);}else if(this[_0xdc5c('0xa')][_0x208216[_0xdc5c('0x4d')]]){logger['info'](_0xdc5c('0x4e'),JSON[_0xdc5c('0x4c')](_0x208216[_0xdc5c('0x4d')]));this[_0xdc5c('0x1d')](_0x208216['transfererlinkedid']);}}catch(_0x19e4ec){logger['error']('[ACW][syncBlindTransfer]\x20%s',_0x19e4ec[_0xdc5c('0x3a')]);}};Acw['prototype']['syncAgentRingNoAnswer']=function(_0x3f9fcb){try{if(this['voiceQueues'][_0x3f9fcb[_0xdc5c('0x1f')]]&&this['voiceQueues'][_0x3f9fcb[_0xdc5c('0x1f')]][_0xdc5c('0x4f')]===_0xdc5c('0x50')){if(this[_0xdc5c('0x8')][_0x3f9fcb[_0xdc5c('0x1e')]]){logger[_0xdc5c('0x28')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x3f9fcb[_0xdc5c('0x30')],_0x3f9fcb[_0xdc5c('0x1e')],_0x3f9fcb[_0xdc5c('0x1f')]);return RpcUser[_0xdc5c('0x51')](this[_0xdc5c('0x8')][_0x3f9fcb['interface']],_0xdc5c('0x52'),_0x3f9fcb[_0xdc5c('0x30')]);}}}catch(_0x4e9096){logger[_0xdc5c('0x33')](_0xdc5c('0x53'),_0x4e9096['message']);}};module[_0xdc5c('0x54')]=Acw; \ No newline at end of file +var _0xfcb3=['mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','stopAcw','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','linkedid','isUndefined','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','startAcw','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','util','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','interface','queue','mandatoryDisposition'];(function(_0x322fe3,_0x52813f){var _0x138aab=function(_0x40422b){while(--_0x40422b){_0x322fe3['push'](_0x322fe3['shift']());}};_0x138aab(++_0x52813f);}(_0xfcb3,0x8f));var _0x3fcb=function(_0x263466,_0x3becf8){_0x263466=_0x263466-0x0;var _0x238730=_0xfcb3[_0x263466];return _0x238730;};'use strict';var util=require(_0x3fcb('0x0'));var _=require(_0x3fcb('0x1'));var moment=require(_0x3fcb('0x2'));var ami=require(_0x3fcb('0x3'));var logger=require(_0x3fcb('0x4'))(_0x3fcb('0x5'));var RpcUser=require(_0x3fcb('0x6'));var RpcVoiceAgentReport=require(_0x3fcb('0x7'));function Acw(_0x5dd380){this[_0x3fcb('0x8')]=_0x5dd380[_0x3fcb('0x8')];this['agents']=_0x5dd380[_0x3fcb('0x9')];this[_0x3fcb('0xa')]=_0x5dd380[_0x3fcb('0xa')];this[_0x3fcb('0xb')]={};ami['on'](_0x3fcb('0xc'),this[_0x3fcb('0xd')][_0x3fcb('0xe')](this));ami['on'](_0x3fcb('0xf'),this[_0x3fcb('0x10')]['bind'](this));ami['on'](_0x3fcb('0x11'),this['syncHangup'][_0x3fcb('0xe')](this));ami['on'](_0x3fcb('0x12'),this[_0x3fcb('0x13')][_0x3fcb('0xe')](this));ami['on'](_0x3fcb('0x14'),this[_0x3fcb('0x15')][_0x3fcb('0xe')](this));ami['on'](_0x3fcb('0x16'),this[_0x3fcb('0x17')]['bind'](this));ami['on'](_0x3fcb('0x18'),this[_0x3fcb('0x19')][_0x3fcb('0xe')](this));}function getDiff(_0x599ce2){var _0x16435b=moment()[_0x3fcb('0x1a')](0x0);var _0x28fd19=moment(_0x599ce2)['milliseconds'](0x0);return _0x16435b[_0x3fcb('0x1b')](_0x28fd19,_0x3fcb('0x1c'));}Acw[_0x3fcb('0x1d')]['startAcw']=function(_0x2a65f9){try{var _0x32bc20=this;var _0x371c8d=this['channels'][_0x2a65f9][_0x3fcb('0x1e')];var _0x4ad1bd=this[_0x3fcb('0xb')][_0x2a65f9][_0x3fcb('0x1f')];var _0x4d9ddb=this[_0x3fcb('0x8')][_0x4ad1bd];var _0x1c217f=![];var _0x569174='ACW';if(_0x4d9ddb[_0x3fcb('0x20')]){if(_0x4d9ddb[_0x3fcb('0x21')][_0x3fcb('0x22')]){_0x1c217f=!![];_0x569174=_0x4d9ddb[_0x3fcb('0x21')][_0x3fcb('0x22')];}}ami[_0x3fcb('0x23')]({'action':_0x3fcb('0x24'),'interface':_0x371c8d,'paused':!![],'reason':_0x569174})[_0x3fcb('0x25')](function(_0x56f207){if(_0x32bc20[_0x3fcb('0x9')][_0x371c8d]){return RpcUser[_0x3fcb('0x26')](_0x32bc20['agents'][_0x371c8d]['id'])['then'](function(_0x389815){if(_0x389815&&!_0x389815[_0x3fcb('0x27')]){logger[_0x3fcb('0x28')](_0x3fcb('0x29'),_0x2a65f9,_0x371c8d,_0x4ad1bd);var _0x40301b=_0x32bc20[_0x3fcb('0xb')][_0x2a65f9][_0x3fcb('0x2a')]&&_0x32bc20[_0x3fcb('0xb')][_0x2a65f9][_0x3fcb('0x2b')]?_0x32bc20[_0x3fcb('0xb')][_0x2a65f9][_0x3fcb('0x2b')]:_0x2a65f9;return RpcUser['savePause'](_0x32bc20[_0x3fcb('0x9')][_0x371c8d],_0x569174,_0x40301b)['then'](function(_0x4150da){if(!_0x1c217f){_0x32bc20[_0x3fcb('0xa')][_0x371c8d]={};logger[_0x3fcb('0x28')](_0x3fcb('0x2c'),_0x2a65f9,_0x32bc20[_0x3fcb('0x8')][_0x4ad1bd]['acwTimeout'],_0x371c8d,_0x4ad1bd);_0x32bc20['timers'][_0x371c8d][_0x3fcb('0x2d')]=setTimeout(_0x32bc20[_0x3fcb('0x2e')]['bind'](_0x32bc20,_0x371c8d),_0x32bc20[_0x3fcb('0x8')][_0x4ad1bd][_0x3fcb('0x2f')]*0x3e8);_0x32bc20[_0x3fcb('0xa')][_0x371c8d][_0x3fcb('0x30')]=moment()[_0x3fcb('0x31')](_0x3fcb('0x32'));_0x32bc20[_0x3fcb('0xa')][_0x371c8d]['uniqueid']=_0x2a65f9;_0x32bc20[_0x3fcb('0xa')][_0x371c8d][_0x3fcb('0x1f')]=_0x4ad1bd;_0x32bc20[_0x3fcb('0xa')][_0x371c8d]['updateAcw']=function(){var _0x3dff5d=getDiff(_0x32bc20[_0x3fcb('0xa')][_0x371c8d][_0x3fcb('0x30')]);clearTimeout(_0x32bc20[_0x3fcb('0xa')][_0x371c8d]['timer']);_0x32bc20['timers'][_0x371c8d]['timer']=![];RpcVoiceAgentReport['update']({'acwtime':_0x3dff5d},_0x32bc20[_0x3fcb('0xa')][_0x371c8d][_0x3fcb('0x33')],_0x371c8d)[_0x3fcb('0x25')](function(_0x5a17a1){logger[_0x3fcb('0x28')](_0x3fcb('0x34'),_0x2a65f9,_0x3dff5d,_0x5a17a1);})[_0x3fcb('0x35')](function(_0x265004){logger[_0x3fcb('0x36')](_0x3fcb('0x37'),_0x2a65f9,_0x265004);});delete _0x32bc20[_0x3fcb('0xa')][_0x371c8d];};}});}else{logger[_0x3fcb('0x28')](_0x3fcb('0x38'),_0x2a65f9,_0x371c8d,_0x4ad1bd);}});}})[_0x3fcb('0x35')](function(_0x705c73){logger[_0x3fcb('0x36')](_0x3fcb('0x2c'),_0x2a65f9,_0x32bc20[_0x3fcb('0x8')][_0x4ad1bd][_0x3fcb('0x2f')],_0x371c8d,_0x4ad1bd);})[_0x3fcb('0x39')](function(){delete _0x32bc20[_0x3fcb('0xb')][_0x2a65f9];});}catch(_0x87993a){logger['error']('[ACW][START]\x20%s',_0x87993a[_0x3fcb('0x3a')]);}};Acw['prototype'][_0x3fcb('0x2e')]=function(_0x593689){try{var _0x6dec6e=this;if(_0x6dec6e[_0x3fcb('0xa')][_0x593689]){_0x6dec6e[_0x3fcb('0xa')][_0x593689][_0x3fcb('0x2d')]=![];var _0x4aea77=_0x6dec6e[_0x3fcb('0xa')][_0x593689][_0x3fcb('0x33')];var _0x34f5ba=_0x6dec6e[_0x3fcb('0xa')][_0x593689]['queue'];var _0x4ff90b=_0x6dec6e[_0x3fcb('0x8')][_0x34f5ba][_0x3fcb('0x2f')];logger[_0x3fcb('0x28')](_0x3fcb('0x3b'),_0x4aea77,_0x593689);RpcUser[_0x3fcb('0x3c')](this[_0x3fcb('0x9')][_0x593689]);RpcVoiceAgentReport[_0x3fcb('0x3d')]({'acwtime':_0x4ff90b,'agentacw':!![]},_0x4aea77,_0x593689)[_0x3fcb('0x25')](function(_0x212faf){logger['info'](_0x3fcb('0x34'),_0x4aea77,_0x4ff90b,_0x212faf);})[_0x3fcb('0x35')](function(_0x142e37){logger[_0x3fcb('0x36')]('[%s][UPDATE][ERRORS:%s]',_0x4aea77,_0x142e37);});}else{logger['error'](_0x3fcb('0x3e'),_0x593689);if(_0x6dec6e['timers']){logger[_0x3fcb('0x28')](_0x3fcb('0x3f'),JSON[_0x3fcb('0x40')](_0x6dec6e['timers']));}}}catch(_0x53408a){logger[_0x3fcb('0x36')](_0x3fcb('0x41'),_0x53408a[_0x3fcb('0x3a')]);}};Acw[_0x3fcb('0x1d')][_0x3fcb('0xd')]=function(_0x2cfe06){try{if(this[_0x3fcb('0x8')][_0x2cfe06['queue']]&&(this[_0x3fcb('0x8')][_0x2cfe06[_0x3fcb('0x1f')]][_0x3fcb('0x5')]||this[_0x3fcb('0x8')][_0x2cfe06[_0x3fcb('0x1f')]][_0x3fcb('0x20')])){if(this[_0x3fcb('0x9')][_0x2cfe06[_0x3fcb('0x1e')]]){this[_0x3fcb('0xb')][_0x2cfe06['uniqueid']]={'queue':_0x2cfe06['queue'],'interface':_0x2cfe06[_0x3fcb('0x1e')],'destlinkedid':_0x2cfe06[_0x3fcb('0x2b')]};}}}catch(_0x3689bd){logger[_0x3fcb('0x36')](_0x3fcb('0x42'),_0x3689bd[_0x3fcb('0x3a')]);}};Acw[_0x3fcb('0x1d')][_0x3fcb('0x19')]=function(_0x49b7f4){try{if(this[_0x3fcb('0x8')][_0x49b7f4[_0x3fcb('0x1f')]]&&(this['voiceQueues'][_0x49b7f4[_0x3fcb('0x1f')]][_0x3fcb('0x5')]||this[_0x3fcb('0x8')][_0x49b7f4[_0x3fcb('0x1f')]][_0x3fcb('0x20')])){if(this[_0x3fcb('0x9')][_0x49b7f4[_0x3fcb('0x1e')]]){this['channels'][_0x49b7f4[_0x3fcb('0x33')]]={'queue':_0x49b7f4[_0x3fcb('0x1f')],'interface':_0x49b7f4[_0x3fcb('0x1e')]};}}}catch(_0x2ff5ad){logger[_0x3fcb('0x36')]('[ACW][syncAgentConnectPreview]\x20%s',_0x2ff5ad[_0x3fcb('0x3a')]);}};Acw['prototype'][_0x3fcb('0x10')]=function(_0x36ff4b){try{if(this[_0x3fcb('0xb')][_0x36ff4b['uniqueid']]&&_['isUndefined'](this[_0x3fcb('0xb')][_0x36ff4b[_0x3fcb('0x33')]]['attended'])){logger[_0x3fcb('0x28')]('[%s][HANGUP:UNIQUEID]',_0x36ff4b[_0x3fcb('0x33')]);this['startAcw'](_0x36ff4b['uniqueid']);}else if(this[_0x3fcb('0xb')][_0x36ff4b[_0x3fcb('0x43')]]&&_[_0x3fcb('0x44')](this[_0x3fcb('0xb')][_0x36ff4b[_0x3fcb('0x43')]]['attended'])){logger[_0x3fcb('0x28')](_0x3fcb('0x45'),_0x36ff4b['linkedid']);this['startAcw'](_0x36ff4b['linkedid']);}}catch(_0x4bfb37){logger[_0x3fcb('0x36')](_0x3fcb('0x46'),_0x4bfb37[_0x3fcb('0x3a')]);}};Acw['prototype'][_0x3fcb('0x47')]=function(_0x2c2a09){try{if(this[_0x3fcb('0xb')][_0x2c2a09[_0x3fcb('0x33')]]&&this[_0x3fcb('0xb')][_0x2c2a09[_0x3fcb('0x33')]][_0x3fcb('0x2a')]){logger[_0x3fcb('0x28')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x2c2a09[_0x3fcb('0x33')]);this['startAcw'](_0x2c2a09[_0x3fcb('0x33')]);}else if(this[_0x3fcb('0xb')][_0x2c2a09['linkedid']]&&this[_0x3fcb('0xb')][_0x2c2a09[_0x3fcb('0x43')]]['attended']){logger[_0x3fcb('0x28')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x2c2a09[_0x3fcb('0x43')]);this[_0x3fcb('0x48')](_0x2c2a09[_0x3fcb('0x43')]);}}catch(_0x214980){logger['error'](_0x3fcb('0x49'),_0x214980['message']);}};Acw[_0x3fcb('0x1d')]['syncAttendedTransfer']=function(_0x3facc4){try{if(!_[_0x3fcb('0x4a')](this[_0x3fcb('0xb')][_0x3facc4['transfereeuniqueid']])){this[_0x3fcb('0x48')](_0x3facc4[_0x3fcb('0x4b')]);if(this[_0x3fcb('0xb')][_0x3facc4[_0x3fcb('0x4c')]]){this[_0x3fcb('0xb')][_0x3facc4[_0x3fcb('0x4c')]][_0x3fcb('0x2a')]=!![];this[_0x3fcb('0xb')][_0x3facc4[_0x3fcb('0x4d')]]=this['channels'][_0x3facc4[_0x3fcb('0x4c')]];delete this['channels'][_0x3facc4[_0x3fcb('0x4c')]];}}else if(!_[_0x3fcb('0x4a')](this[_0x3fcb('0xb')][_0x3facc4['transfertargetuniqueid']])){this['startAcw'](_0x3facc4[_0x3fcb('0x4d')]);if(this[_0x3fcb('0xb')][_0x3facc4[_0x3fcb('0x4e')]]){this[_0x3fcb('0xb')][_0x3facc4[_0x3fcb('0x4e')]][_0x3fcb('0x2a')]=!![];this[_0x3fcb('0xb')][_0x3facc4[_0x3fcb('0x4b')]]=this[_0x3fcb('0xb')][_0x3facc4['origtransfereruniqueid']];delete this[_0x3fcb('0xb')][_0x3facc4['origtransfereruniqueid']];}}}catch(_0x244be7){logger['error']('[ACW][syncAttendedTransfer]\x20%s',_0x244be7[_0x3fcb('0x3a')]);}};Acw['prototype'][_0x3fcb('0x17')]=function(_0xb38701){try{if(this['channels'][_0xb38701[_0x3fcb('0x4f')]]){logger[_0x3fcb('0x28')](_0x3fcb('0x50'),JSON[_0x3fcb('0x40')](_0xb38701[_0x3fcb('0x4f')]));this[_0x3fcb('0x48')](_0xb38701[_0x3fcb('0x4f')]);}else if(this[_0x3fcb('0xb')][_0xb38701[_0x3fcb('0x51')]]){logger[_0x3fcb('0x28')](_0x3fcb('0x52'),JSON[_0x3fcb('0x40')](_0xb38701[_0x3fcb('0x51')]));this[_0x3fcb('0x48')](_0xb38701['transfererlinkedid']);}}catch(_0x1cd733){logger[_0x3fcb('0x36')]('[ACW][syncBlindTransfer]\x20%s',_0x1cd733['message']);}};Acw['prototype'][_0x3fcb('0x13')]=function(_0x1fa45e){try{if(this[_0x3fcb('0x8')][_0x1fa45e[_0x3fcb('0x1f')]]&&this[_0x3fcb('0x8')][_0x1fa45e[_0x3fcb('0x1f')]]['autopause']===_0x3fcb('0x53')){if(this[_0x3fcb('0x9')][_0x1fa45e['interface']]){logger[_0x3fcb('0x28')](_0x3fcb('0x54'),_0x1fa45e[_0x3fcb('0x33')],_0x1fa45e[_0x3fcb('0x1e')],_0x1fa45e[_0x3fcb('0x1f')]);return RpcUser[_0x3fcb('0x55')](this[_0x3fcb('0x9')][_0x1fa45e['interface']],_0x3fcb('0x56'),_0x1fa45e['uniqueid']);}}}catch(_0x242120){logger['error'](_0x3fcb('0x57'),_0x242120['message']);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 52580b3..dc7a628 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 _0xd834=['actionDeviceStateList','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','info','once','close','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','then','log','exports','asterisk-manager','util','lodash','../../config/logger','ami','../../config/environment','asterisk','port','password','keepConnected','Action','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','format','actionSipShowRegistry','sipshowregistry'];(function(_0x84e17a,_0x8012d){var _0x1deaba=function(_0x5f36eb){while(--_0x5f36eb){_0x84e17a['push'](_0x84e17a['shift']());}};_0x1deaba(++_0x8012d);}(_0xd834,0x1ea));var _0x4d83=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xd834[_0x46698a];return _0x356db0;};'use strict';var Manager=require(_0x4d83('0x0'));var BPromise=require('bluebird');var moment=require('moment');var util=require(_0x4d83('0x1'));var _=require(_0x4d83('0x2'));var logger=require(_0x4d83('0x3'))(_0x4d83('0x4'));var config=require(_0x4d83('0x5'));var ami=new Manager(config[_0x4d83('0x6')][_0x4d83('0x7')],config[_0x4d83('0x6')]['ip'],config[_0x4d83('0x6')]['username'],config['asterisk'][_0x4d83('0x8')],!![]);ami[_0x4d83('0x9')]();ami[_0x4d83('0xa')]=BPromise[_0x4d83('0xb')](ami[_0x4d83('0xc')]);function error(_0x51f3f4){logger[_0x4d83('0xd')](util['format'](_0x4d83('0xe'),config['asterisk'][_0x4d83('0xf')],config[_0x4d83('0x6')]['ip'],config[_0x4d83('0x6')][_0x4d83('0x7')],util[_0x4d83('0x10')](_0x51f3f4,![],null)));}function close(){logger[_0x4d83('0xd')](util[_0x4d83('0x11')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x4d83('0x6')][_0x4d83('0xf')],config['asterisk']['ip'],config['asterisk']['port']));}ami[_0x4d83('0x12')]=function(){return function(){return ami[_0x4d83('0xa')]({'action':_0x4d83('0x13')});};};ami[_0x4d83('0x14')]=function(){return function(){return ami['Action']({'action':'devicestatelist'});};};ami[_0x4d83('0x15')]=function(){return function(){return ami[_0x4d83('0xa')]({'action':_0x4d83('0x16')});};};ami[_0x4d83('0x17')]=function(){return function(){return ami[_0x4d83('0xa')]({'action':_0x4d83('0x18')});};};ami[_0x4d83('0x19')]=function(){return function(){return ami[_0x4d83('0xa')]({'action':'coreshowchannels'});};};function connect(_0x630efb){logger[_0x4d83('0x1a')](util[_0x4d83('0x11')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0x4d83('0x6')][_0x4d83('0xf')],config[_0x4d83('0x6')]['ip'],config[_0x4d83('0x6')][_0x4d83('0x7')]));ami[_0x4d83('0x1b')](_0x4d83('0xd'),error);ami[_0x4d83('0x1b')](_0x4d83('0x1c'),close);}ami['on']('connect',connect);ami['on']('shutdown',function(_0x14368a){logger[_0x4d83('0x1a')](util[_0x4d83('0x11')](_0x4d83('0x1d'),config['asterisk'][_0x4d83('0xf')],config[_0x4d83('0x6')]['ip'],config[_0x4d83('0x6')][_0x4d83('0x7')],util[_0x4d83('0x10')](_0x14368a,![],null)));});ami['on'](_0x4d83('0x1e'),function(_0x4adeca){logger[_0x4d83('0x1a')](util[_0x4d83('0x11')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x4d83('0x6')][_0x4d83('0xf')],config[_0x4d83('0x6')]['ip'],config['asterisk']['port']));return BPromise['resolve']()['then'](ami['actionSipShowRegistry']())[_0x4d83('0x1f')](ami[_0x4d83('0x14')]())['then'](ami[_0x4d83('0x15')]())['then'](ami[_0x4d83('0x17')]())[_0x4d83('0x1f')](ami[_0x4d83('0x19')]())['catch'](function(_0x316cd7){console[_0x4d83('0x20')](_0x316cd7);});});ami['once'](_0x4d83('0xd'),error);ami[_0x4d83('0x1b')](_0x4d83('0x1c'),close);module[_0x4d83('0x21')]=ami; \ No newline at end of file +var _0x85ec=['Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','catch','log','exports','asterisk-manager','bluebird','lodash','ami','../../config/environment','asterisk','port','username','password','keepConnected','Action','promisify','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','actionQueueSummary','actionCoreShowChannels','coreshowchannels','info'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x85ec,0x10f));var _0xc85e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x85ec[_0x3dd15e];return _0x231fd0;};'use strict';var Manager=require(_0xc85e('0x0'));var BPromise=require(_0xc85e('0x1'));var moment=require('moment');var util=require('util');var _=require(_0xc85e('0x2'));var logger=require('../../config/logger')(_0xc85e('0x3'));var config=require(_0xc85e('0x4'));var ami=new Manager(config[_0xc85e('0x5')][_0xc85e('0x6')],config[_0xc85e('0x5')]['ip'],config['asterisk'][_0xc85e('0x7')],config['asterisk'][_0xc85e('0x8')],!![]);ami[_0xc85e('0x9')]();ami[_0xc85e('0xa')]=BPromise[_0xc85e('0xb')](ami['action']);function error(_0x24a804){logger[_0xc85e('0xc')](util[_0xc85e('0xd')](_0xc85e('0xe'),config[_0xc85e('0x5')]['username'],config[_0xc85e('0x5')]['ip'],config[_0xc85e('0x5')][_0xc85e('0x6')],util[_0xc85e('0xf')](_0x24a804,![],null)));}function close(){logger[_0xc85e('0xc')](util['format'](_0xc85e('0x10'),config[_0xc85e('0x5')][_0xc85e('0x7')],config['asterisk']['ip'],config[_0xc85e('0x5')][_0xc85e('0x6')]));}ami[_0xc85e('0x11')]=function(){return function(){return ami[_0xc85e('0xa')]({'action':'sipshowregistry'});};};ami[_0xc85e('0x12')]=function(){return function(){return ami[_0xc85e('0xa')]({'action':_0xc85e('0x13')});};};ami[_0xc85e('0x14')]=function(){return function(){return ami[_0xc85e('0xa')]({'action':'sippeerstatus'});};};ami[_0xc85e('0x15')]=function(){return function(){return ami[_0xc85e('0xa')]({'action':'queuesummary'});};};ami[_0xc85e('0x16')]=function(){return function(){return ami['Action']({'action':_0xc85e('0x17')});};};function connect(_0x4ff1a9){logger[_0xc85e('0x18')](util[_0xc85e('0xd')](_0xc85e('0x19'),config[_0xc85e('0x5')][_0xc85e('0x7')],config[_0xc85e('0x5')]['ip'],config['asterisk']['port']));ami[_0xc85e('0x1a')](_0xc85e('0xc'),error);ami[_0xc85e('0x1a')](_0xc85e('0x1b'),close);}ami['on'](_0xc85e('0x1c'),connect);ami['on'](_0xc85e('0x1d'),function(_0x489648){logger[_0xc85e('0x18')](util['format'](_0xc85e('0x1e'),config['asterisk'][_0xc85e('0x7')],config[_0xc85e('0x5')]['ip'],config[_0xc85e('0x5')][_0xc85e('0x6')],util['inspect'](_0x489648,![],null)));});ami['on'](_0xc85e('0x1f'),function(_0x360f4b){logger['info'](util[_0xc85e('0xd')](_0xc85e('0x20'),config[_0xc85e('0x5')][_0xc85e('0x7')],config[_0xc85e('0x5')]['ip'],config['asterisk'][_0xc85e('0x6')]));return BPromise['resolve']()['then'](ami[_0xc85e('0x11')]())[_0xc85e('0x21')](ami[_0xc85e('0x12')]())[_0xc85e('0x21')](ami[_0xc85e('0x14')]())['then'](ami['actionQueueSummary']())[_0xc85e('0x21')](ami['actionCoreShowChannels']())[_0xc85e('0x22')](function(_0x3f3e59){console[_0xc85e('0x23')](_0x3f3e59);});});ami[_0xc85e('0x1a')](_0xc85e('0xc'),error);ami[_0xc85e('0x1a')]('close',close);module[_0xc85e('0x24')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 39e9fc1..d9f65eb 100644 --- a/server/services/ami/client.js +++ b/server/services/ami/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['rpc','memberReport','error','message','result','catch','exports','../../config/logger','ami','client','http','Request','request','then','debug'];(function(_0x28e8fe,_0x25ecdd){var _0x594f0c=function(_0x4fc2a1){while(--_0x4fc2a1){_0x28e8fe['push'](_0x28e8fe['shift']());}};_0x594f0c(++_0x25ecdd);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var client=jayson[_0x3071('0x2')][_0x3071('0x3')]({'port':0x2329});client[_0x3071('0x4')]=function(_0x52b5fb,_0x2c547f){return new BPromise(function(_0x7b18a4,_0x33a70c){return client[_0x3071('0x5')](_0x52b5fb,_0x2c547f)[_0x3071('0x6')](function(_0x41cf76){logger[_0x3071('0x7')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x2c547f,_0x41cf76);if(_0x41cf76[_0x3071('0xa')]){logger[_0x3071('0xa')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x41cf76['error'][_0x3071('0xb')],_0x2c547f);return _0x33a70c(_0x41cf76[_0x3071('0xa')][_0x3071('0xb')]);}else{return _0x7b18a4(_0x41cf76[_0x3071('0xc')]);}})[_0x3071('0xd')](function(_0x4a470a){logger[_0x3071('0xa')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x4a470a,_0x2c547f);return _0x33a70c(_0x4a470a);});});};module[_0x3071('0xe')]=client; \ No newline at end of file +var _0xe706=['result','catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','request','then','debug','rpc','memberReport','error','message'];(function(_0x343e44,_0x519af9){var _0xa5130e=function(_0xae1fa0){while(--_0xae1fa0){_0x343e44['push'](_0x343e44['shift']());}};_0xa5130e(++_0x519af9);}(_0xe706,0xa3));var _0x6e70=function(_0x1cdabe,_0x286194){_0x1cdabe=_0x1cdabe-0x0;var _0x3dcc9c=_0xe706[_0x1cdabe];return _0x3dcc9c;};'use strict';var jayson=require(_0x6e70('0x0'));var BPromise=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('ami');var client=jayson[_0x6e70('0x3')][_0x6e70('0x4')]({'port':0x2329});client[_0x6e70('0x5')]=function(_0x7dfbc3,_0x142c27){return new BPromise(function(_0x2164a4,_0x376a8d){return client[_0x6e70('0x6')](_0x7dfbc3,_0x142c27)[_0x6e70('0x7')](function(_0x4381d1){logger[_0x6e70('0x8')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x142c27,_0x4381d1);if(_0x4381d1[_0x6e70('0xb')]){logger[_0x6e70('0xb')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')],_0x142c27);return _0x376a8d(_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')]);}else{return _0x2164a4(_0x4381d1[_0x6e70('0xd')]);}})[_0x6e70('0xe')](function(_0x4600f9){logger['error']('rpc',_0x6e70('0xa'),_0x7dfbc3,_0x4600f9,_0x142c27);return _0x376a8d(_0x4600f9);});});};module[_0x6e70('0xf')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 41a9bb2..55c1d63 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 _0x16bf=['callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','dialCutDigit','substring','exports','lodash','isNil','string','Contact','phone','number','queue','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid'];(function(_0x4e6102,_0x421938){var _0x597bcc=function(_0x5b6fee){while(--_0x5b6fee){_0x4e6102['push'](_0x4e6102['shift']());}};_0x597bcc(++_0x421938);}(_0x16bf,0xfe));var _0xf16b=function(_0x7d2b5d,_0x59451f){_0x7d2b5d=_0x7d2b5d-0x0;var _0x2cf5aa=_0x16bf[_0x7d2b5d];return _0x2cf5aa;};'use strict';var util=require('util');var _=require(_0xf16b('0x0'));var moment=require('moment');function checkNameSurname(_0x194258,_0x3b0050,_0x2d4a6d){var _0x270859='';if(!_[_0xf16b('0x1')](_0x3b0050)&&_0xf16b('0x2')===typeof _0x3b0050){_0x270859+=_0x3b0050;}if(!_['isNil'](_0x2d4a6d)&&_0xf16b('0x2')===typeof _0x2d4a6d){_0x270859+='\x20'+_0x2d4a6d;}if(_0x270859!==''){return _0x270859;}return _0x194258;}function Action(_0x4dba20,_0x42fbfe,_0x4fbdfb){this['voiceQueue']=_0x4dba20;this['uniqueid']=_0x4fbdfb||undefined;this['name']=checkNameSurname(_0x42fbfe[_0xf16b('0x3')][_0xf16b('0x4')],_0x42fbfe[_0xf16b('0x3')]['firstName'],_0x42fbfe[_0xf16b('0x3')]['lastName']);this[_0xf16b('0x5')]=_0x42fbfe[_0xf16b('0x3')][_0xf16b('0x4')];this[_0xf16b('0x6')]=_0x4dba20[_0xf16b('0x7')];this['active']=_0x42fbfe[_0xf16b('0x8')]||![];this[_0xf16b('0x9')]=_0x4dba20[_0xf16b('0x9')];this[_0xf16b('0xa')]=_0x4dba20[_0xf16b('0xa')]||0x3;this['scheduledat']=_0x42fbfe[_0xf16b('0xb')];this['countbusyretry']=_0x42fbfe[_0xf16b('0xc')];this[_0xf16b('0xd')]=_0x42fbfe[_0xf16b('0xd')];this[_0xf16b('0xe')]=_0x42fbfe['countnoanswerretry'];this['countnosuchnumberretry']=_0x42fbfe[_0xf16b('0xf')];this[_0xf16b('0x10')]=_0x42fbfe[_0xf16b('0x10')];this[_0xf16b('0x11')]=_0x42fbfe[_0xf16b('0x11')];this[_0xf16b('0x12')]=_0x42fbfe[_0xf16b('0x12')];this[_0xf16b('0x13')]=_0x42fbfe[_0xf16b('0x13')];this[_0xf16b('0x14')]=_0x42fbfe[_0xf16b('0x14')];this['ListId']=_0x42fbfe[_0xf16b('0x15')];this[_0xf16b('0x16')]=_0x42fbfe[_0xf16b('0x16')];this[_0xf16b('0x17')]=_0x42fbfe[_0xf16b('0x17')];this[_0xf16b('0x18')]=_0x42fbfe['CampaignId'];this[_0xf16b('0x19')]=_0x42fbfe['id'];this[_0xf16b('0x1a')]=_0x42fbfe[_0xf16b('0x3')][_0xf16b('0x1b')]||'';this[_0xf16b('0x1c')]=moment()[_0xf16b('0x1d')](_0xf16b('0x1e'));this[_0xf16b('0x1f')]=_0x42fbfe[_0xf16b('0x1f')];this['callbackuniqueid']=_0x42fbfe[_0xf16b('0x20')];this[_0xf16b('0x21')]=_0x42fbfe[_0xf16b('0x21')];this[_0xf16b('0x22')]=_0x42fbfe[_0xf16b('0x22')];this[_0xf16b('0x23')]='';this[_0xf16b('0x24')]='';}Action[_0xf16b('0x25')]['getCaller']=function(){return util[_0xf16b('0x1d')]('\x22%s\x22\x20<%s>',this['name'],this['voiceQueue'][_0xf16b('0x26')]>0x0?this[_0xf16b('0x5')][_0xf16b('0x27')](this['voiceQueue'][_0xf16b('0x26')]):this[_0xf16b('0x5')]);};Action['prototype']['getQueue']=function(){return this[_0xf16b('0x6')];};module[_0xf16b('0x28')]=Action; \ No newline at end of file +var _0xded1=['countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','prototype','getCaller','format','\x22%s\x22\x20<%s>','dialCutDigit','number','substring','getQueue','exports','util','moment','string','voiceQueue','name','Contact','phone','firstName','lastName','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry'];(function(_0x2914fc,_0x25a703){var _0x273f89=function(_0xf2d690){while(--_0xf2d690){_0x2914fc['push'](_0x2914fc['shift']());}};_0x273f89(++_0x25a703);}(_0xded1,0x190));var _0x1ded=function(_0x182b41,_0x3710ca){_0x182b41=_0x182b41-0x0;var _0x39e4dc=_0xded1[_0x182b41];return _0x39e4dc;};'use strict';var util=require(_0x1ded('0x0'));var _=require('lodash');var moment=require(_0x1ded('0x1'));function checkNameSurname(_0x56ded8,_0x39b8e4,_0x4f7322){var _0x10e14e='';if(!_['isNil'](_0x39b8e4)&&_0x1ded('0x2')===typeof _0x39b8e4){_0x10e14e+=_0x39b8e4;}if(!_['isNil'](_0x4f7322)&&'string'===typeof _0x4f7322){_0x10e14e+='\x20'+_0x4f7322;}if(_0x10e14e!==''){return _0x10e14e;}return _0x56ded8;}function Action(_0xb71635,_0x450647,_0x393d11){this[_0x1ded('0x3')]=_0xb71635;this['uniqueid']=_0x393d11||undefined;this[_0x1ded('0x4')]=checkNameSurname(_0x450647[_0x1ded('0x5')][_0x1ded('0x6')],_0x450647['Contact'][_0x1ded('0x7')],_0x450647[_0x1ded('0x5')][_0x1ded('0x8')]);this['number']=_0x450647[_0x1ded('0x5')][_0x1ded('0x6')];this['queue']=_0xb71635[_0x1ded('0x4')];this[_0x1ded('0x9')]=_0x450647[_0x1ded('0x9')]||![];this['type']=_0xb71635[_0x1ded('0xa')];this['dialQueueTimeout']=_0xb71635[_0x1ded('0xb')]||0x3;this[_0x1ded('0xc')]=_0x450647[_0x1ded('0xc')];this['countbusyretry']=_0x450647[_0x1ded('0xd')];this[_0x1ded('0xe')]=_0x450647[_0x1ded('0xe')];this[_0x1ded('0xf')]=_0x450647[_0x1ded('0xf')];this[_0x1ded('0x10')]=_0x450647[_0x1ded('0x10')];this[_0x1ded('0x11')]=_0x450647[_0x1ded('0x11')];this[_0x1ded('0x12')]=_0x450647[_0x1ded('0x12')];this[_0x1ded('0x13')]=_0x450647['countmachineretry'];this['countagentrejectretry']=_0x450647[_0x1ded('0x14')];this[_0x1ded('0x15')]=_0x450647['ContactId'];this[_0x1ded('0x16')]=_0x450647['ListId'];this[_0x1ded('0x17')]=_0x450647[_0x1ded('0x17')];this[_0x1ded('0x18')]=_0x450647[_0x1ded('0x18')];this['CampaignId']=_0x450647[_0x1ded('0x19')];this[_0x1ded('0x1a')]=_0x450647['id'];this['ContactFirstName']=_0x450647[_0x1ded('0x5')][_0x1ded('0x7')]||'';this[_0x1ded('0x1b')]=moment()['format'](_0x1ded('0x1c'));this['callback']=_0x450647[_0x1ded('0x1d')];this[_0x1ded('0x1e')]=_0x450647[_0x1ded('0x1e')];this[_0x1ded('0x1f')]=_0x450647[_0x1ded('0x1f')];this[_0x1ded('0x20')]=_0x450647[_0x1ded('0x20')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0x1ded('0x21')][_0x1ded('0x22')]=function(){return util[_0x1ded('0x23')](_0x1ded('0x24'),this[_0x1ded('0x4')],this['voiceQueue'][_0x1ded('0x25')]>0x0?this[_0x1ded('0x26')][_0x1ded('0x27')](this[_0x1ded('0x3')][_0x1ded('0x25')]):this['number']);};Action[_0x1ded('0x21')][_0x1ded('0x28')]=function(){return this['queue'];};module[_0x1ded('0x29')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index ff61aa0..552706b 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 _0x1c63=['seconds','state','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','answertime','talktime','membername','reason','callback','callbackat','recallme','ContactId','ListId','VoiceQueueId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff'];(function(_0xd0146e,_0x1739c0){var _0xdae065=function(_0x4af704){while(--_0x4af704){_0xd0146e['push'](_0xd0146e['shift']());}};_0xdae065(++_0x1739c0);}(_0x1c63,0xdc));var _0x31c6=function(_0x1ecbad,_0xe90ac4){_0x1ecbad=_0x1ecbad-0x0;var _0x50fe57=_0x1c63[_0x1ecbad];return _0x50fe57;};'use strict';var util=require(_0x31c6('0x0'));var _=require(_0x31c6('0x1'));var moment=require(_0x31c6('0x2'));function getSeconds(_0x3db4b7,_0x5983ef){var _0x21dc5c=moment(_0x3db4b7)[_0x31c6('0x3')](0x0);var _0x2501a8=moment(_0x5983ef)['milliseconds'](0x0);return _0x21dc5c[_0x31c6('0x4')](_0x2501a8,_0x31c6('0x5'));}function AgentComplete(_0x472d52,_0x1f4994){this[_0x31c6('0x6')]=0x4;this['statedesc']='Answer';this[_0x31c6('0x7')]=_0x472d52[_0x31c6('0x7')];this[_0x31c6('0x8')]=_0x472d52[_0x31c6('0x8')];this[_0x31c6('0x9')]=_0x472d52['type']===_0x31c6('0xa')?_0x31c6('0xb'):_0x472d52[_0x31c6('0x8')];this[_0x31c6('0xc')]=_0x472d52[_0x31c6('0xc')];this['countcongestionretry']=_0x472d52[_0x31c6('0xd')];this['countnoanswerretry']=_0x472d52[_0x31c6('0xe')];this[_0x31c6('0xf')]=_0x472d52['countbusyretry']+_0x472d52[_0x31c6('0xd')]+_0x472d52[_0x31c6('0xe')]+_0x472d52[_0x31c6('0x10')]+_0x472d52[_0x31c6('0x11')]+_0x472d52[_0x31c6('0x12')]+_0x472d52[_0x31c6('0x13')]+_0x472d52['countagentrejectretry'];this[_0x31c6('0x10')]=_0x472d52[_0x31c6('0x10')];this[_0x31c6('0x11')]=_0x472d52[_0x31c6('0x11')];this[_0x31c6('0x12')]=_0x472d52['countabandonedretry'];this['countmachineretry']=_0x472d52['countmachineretry'];this['countagentrejectretry']=_0x472d52[_0x31c6('0x14')];this['uniqueid']=_0x1f4994[_0x31c6('0x15')];this[_0x31c6('0x16')]=_0x472d52[_0x31c6('0x17')];this[_0x31c6('0x18')]=_0x472d52[_0x31c6('0x19')];this[_0x31c6('0x1a')]=_0x472d52[_0x31c6('0x1a')];this[_0x31c6('0x1b')]=_0x472d52['responsetime'];this['answertime']=_0x472d52['answertime'];this[_0x31c6('0x1c')]=moment()[_0x31c6('0x1d')](_0x31c6('0x1e'));this[_0x31c6('0x1f')]=getSeconds(_0x472d52['responsetime'],_0x472d52['starttime']);this[_0x31c6('0x20')]=getSeconds(_0x472d52[_0x31c6('0x21')],_0x472d52['responsetime']);this[_0x31c6('0x22')]=getSeconds(this[_0x31c6('0x1c')],_0x472d52[_0x31c6('0x21')]);this[_0x31c6('0xb')]=_0x1f4994[_0x31c6('0xb')];this['membername']=_0x1f4994[_0x31c6('0x23')];this['reason']=_0x1f4994[_0x31c6('0x24')];this[_0x31c6('0x25')]=_0x472d52['callback'];this['callbackuniqueid']=_0x472d52['callbackuniqueid'];this[_0x31c6('0x26')]=_0x472d52[_0x31c6('0x26')];this['recallme']=_0x472d52[_0x31c6('0x27')];this[_0x31c6('0x28')]=_0x472d52[_0x31c6('0x28')];this[_0x31c6('0x29')]=_0x472d52['ListId'];this['UserId']=_0x472d52['UserId'];this['VoiceQueueId']=_0x472d52[_0x31c6('0x2a')];this['CampaignId']=_0x472d52['CampaignId'];this[_0x31c6('0x2b')]=_0x472d52[_0x31c6('0x2b')]||'';this['originatecalleridname']=_0x472d52[_0x31c6('0x2c')]||'';}module['exports']=AgentComplete; \ No newline at end of file +var _0x70a7=['countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','uniqueid','calleridname','calleridnum','starttime','responsetime','answertime','endtime','membername','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry'];(function(_0x5897fc,_0x9bbad6){var _0x292681=function(_0x45bc59){while(--_0x45bc59){_0x5897fc['push'](_0x5897fc['shift']());}};_0x292681(++_0x9bbad6);}(_0x70a7,0x116));var _0x770a=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0x70a7[_0x12f688];return _0x59c3de;};'use strict';var util=require(_0x770a('0x0'));var _=require(_0x770a('0x1'));var moment=require(_0x770a('0x2'));function getSeconds(_0x1ab751,_0x3f4e4c){var _0x4391ea=moment(_0x1ab751)[_0x770a('0x3')](0x0);var _0x16a45a=moment(_0x3f4e4c)[_0x770a('0x3')](0x0);return _0x4391ea[_0x770a('0x4')](_0x16a45a,_0x770a('0x5'));}function AgentComplete(_0x526ae8,_0x161ebf){this[_0x770a('0x6')]=0x4;this[_0x770a('0x7')]=_0x770a('0x8');this['scheduledat']=_0x526ae8[_0x770a('0x9')];this[_0x770a('0xa')]=_0x526ae8[_0x770a('0xa')];this[_0x770a('0xb')]=_0x526ae8[_0x770a('0xa')]===_0x770a('0xc')?_0x770a('0xd'):_0x526ae8[_0x770a('0xa')];this[_0x770a('0xe')]=_0x526ae8[_0x770a('0xe')];this['countcongestionretry']=_0x526ae8[_0x770a('0xf')];this[_0x770a('0x10')]=_0x526ae8[_0x770a('0x10')];this[_0x770a('0x11')]=_0x526ae8[_0x770a('0xe')]+_0x526ae8[_0x770a('0xf')]+_0x526ae8[_0x770a('0x10')]+_0x526ae8['countnosuchnumberretry']+_0x526ae8[_0x770a('0x12')]+_0x526ae8[_0x770a('0x13')]+_0x526ae8['countmachineretry']+_0x526ae8[_0x770a('0x14')];this[_0x770a('0x15')]=_0x526ae8['countnosuchnumberretry'];this[_0x770a('0x12')]=_0x526ae8['countdropretry'];this[_0x770a('0x13')]=_0x526ae8['countabandonedretry'];this[_0x770a('0x16')]=_0x526ae8[_0x770a('0x16')];this[_0x770a('0x14')]=_0x526ae8['countagentrejectretry'];this[_0x770a('0x17')]=_0x161ebf[_0x770a('0x17')];this[_0x770a('0x18')]=_0x526ae8['name'];this[_0x770a('0x19')]=_0x526ae8['number'];this[_0x770a('0x1a')]=_0x526ae8[_0x770a('0x1a')];this[_0x770a('0x1b')]=_0x526ae8[_0x770a('0x1b')];this[_0x770a('0x1c')]=_0x526ae8[_0x770a('0x1c')];this[_0x770a('0x1d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=getSeconds(_0x526ae8[_0x770a('0x1b')],_0x526ae8[_0x770a('0x1a')]);this['holdtime']=getSeconds(_0x526ae8[_0x770a('0x1c')],_0x526ae8[_0x770a('0x1b')]);this['talktime']=getSeconds(this['endtime'],_0x526ae8['answertime']);this[_0x770a('0xd')]=_0x161ebf[_0x770a('0xd')];this[_0x770a('0x1e')]=_0x161ebf[_0x770a('0x1e')];this['reason']=_0x161ebf['reason'];this[_0x770a('0x1f')]=_0x526ae8[_0x770a('0x1f')];this[_0x770a('0x20')]=_0x526ae8[_0x770a('0x20')];this['callbackat']=_0x526ae8[_0x770a('0x21')];this[_0x770a('0x22')]=_0x526ae8[_0x770a('0x22')];this['ContactId']=_0x526ae8[_0x770a('0x23')];this[_0x770a('0x24')]=_0x526ae8[_0x770a('0x24')];this[_0x770a('0x25')]=_0x526ae8[_0x770a('0x25')];this['VoiceQueueId']=_0x526ae8['VoiceQueueId'];this[_0x770a('0x26')]=_0x526ae8[_0x770a('0x26')];this['originatecalleridnum']=_0x526ae8[_0x770a('0x27')]||'';this['originatecalleridname']=_0x526ae8[_0x770a('0x28')]||'';}module[_0x770a('0x29')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 444c202..e3cb026 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 _0xd67b=['calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','diff','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x337003,_0x4272fb){var _0x282c78=function(_0x1ea94d){while(--_0x1ea94d){_0x337003['push'](_0x337003['shift']());}};_0x282c78(++_0x4272fb);}(_0xd67b,0x133));var _0xbd67=function(_0x1e35cc,_0x224886){_0x1e35cc=_0x1e35cc-0x0;var _0x41d80a=_0xd67b[_0x1e35cc];return _0x41d80a;};'use strict';var util=require('util');var _=require(_0xbd67('0x0'));var moment=require('moment');function getSeconds(_0x1da24d,_0x280954){var _0x317e33=moment(_0x1da24d)['milliseconds'](0x0);var _0x40e384=moment(_0x280954)['milliseconds'](0x0);return _0x317e33[_0xbd67('0x1')](_0x40e384,'seconds');}function Final(_0x309962){this[_0xbd67('0x2')]=_0x309962[_0xbd67('0x2')];this[_0xbd67('0x3')]=_0x309962[_0xbd67('0x3')];this[_0xbd67('0x4')]=_0x309962[_0xbd67('0x4')];this[_0xbd67('0x5')]=_0x309962[_0xbd67('0x4')]===_0xbd67('0x6')?_0xbd67('0x7'):_0x309962[_0xbd67('0x4')];this[_0xbd67('0x8')]=_0x309962['countbusyretry'];this['countcongestionretry']=_0x309962[_0xbd67('0x9')];this['countnoanswerretry']=_0x309962[_0xbd67('0xa')];this[_0xbd67('0xb')]=_0x309962[_0xbd67('0x8')]+_0x309962[_0xbd67('0x9')]+_0x309962[_0xbd67('0xa')]+_0x309962[_0xbd67('0xc')]+_0x309962[_0xbd67('0xd')]+_0x309962[_0xbd67('0xe')]+_0x309962[_0xbd67('0xf')]+_0x309962[_0xbd67('0x10')];this['countnosuchnumberretry']=_0x309962[_0xbd67('0xc')];this[_0xbd67('0xd')]=_0x309962[_0xbd67('0xd')];this[_0xbd67('0xe')]=_0x309962[_0xbd67('0xe')];this[_0xbd67('0xf')]=_0x309962[_0xbd67('0xf')];this[_0xbd67('0x10')]=_0x309962[_0xbd67('0x10')];this[_0xbd67('0x7')]=_0x309962['queue'];this['calleridname']=_0x309962[_0xbd67('0x11')];this[_0xbd67('0x12')]=_0x309962[_0xbd67('0x12')];this['starttime']=_0x309962[_0xbd67('0x13')];this[_0xbd67('0x14')]=_0x309962[_0xbd67('0x14')];this['endtime']=_0x309962[_0xbd67('0x14')];this['ringtime']=_0x309962[_0xbd67('0x15')]||0x0;this[_0xbd67('0x16')]=_0x309962[_0xbd67('0x16')]||0x0;this['talktime']=_0x309962[_0xbd67('0x17')]||0x0;this[_0xbd67('0x18')]=_0x309962[_0xbd67('0x18')];this[_0xbd67('0x19')]=_0x309962[_0xbd67('0x19')];this[_0xbd67('0x1a')]=_0x309962['callbackat'];this[_0xbd67('0x1b')]=_0x309962[_0xbd67('0x1b')];this[_0xbd67('0x1c')]=_0x309962[_0xbd67('0x1c')];this[_0xbd67('0x1d')]=_0x309962[_0xbd67('0x1d')];this[_0xbd67('0x1e')]=_0x309962[_0xbd67('0x1e')];this[_0xbd67('0x1f')]=_0x309962[_0xbd67('0x1f')];this[_0xbd67('0x20')]=_0x309962['CampaignId'];this[_0xbd67('0x21')]=_0x309962['originatecalleridnum']||'';this[_0xbd67('0x22')]=_0x309962[_0xbd67('0x22')]||'';}module[_0xbd67('0x23')]=Final; \ No newline at end of file +var _0x8ef6=['countabandonedretry','countmachineretry','countagentrejectretry','calleridname','starttime','endtime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry'];(function(_0x232a4d,_0x2447bc){var _0x379449=function(_0x423644){while(--_0x423644){_0x232a4d['push'](_0x232a4d['shift']());}};_0x379449(++_0x2447bc);}(_0x8ef6,0xf2));var _0x68ef=function(_0x2f80a8,_0x3df49b){_0x2f80a8=_0x2f80a8-0x0;var _0xf62f4=_0x8ef6[_0x2f80a8];return _0xf62f4;};'use strict';var util=require(_0x68ef('0x0'));var _=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));function getSeconds(_0x279e08,_0x2cc97b){var _0x44e0d3=moment(_0x279e08)[_0x68ef('0x3')](0x0);var _0x4a72b8=moment(_0x2cc97b)[_0x68ef('0x3')](0x0);return _0x44e0d3[_0x68ef('0x4')](_0x4a72b8,_0x68ef('0x5'));}function Final(_0x2ac782){this['uniqueid']=_0x2ac782['uniqueid'];this[_0x68ef('0x6')]=_0x2ac782[_0x68ef('0x6')];this[_0x68ef('0x7')]=_0x2ac782['type'];this[_0x68ef('0x8')]=_0x2ac782[_0x68ef('0x7')]===_0x68ef('0x9')?_0x68ef('0xa'):_0x2ac782[_0x68ef('0x7')];this[_0x68ef('0xb')]=_0x2ac782[_0x68ef('0xb')];this[_0x68ef('0xc')]=_0x2ac782[_0x68ef('0xc')];this[_0x68ef('0xd')]=_0x2ac782[_0x68ef('0xd')];this[_0x68ef('0xe')]=_0x2ac782['countbusyretry']+_0x2ac782[_0x68ef('0xc')]+_0x2ac782[_0x68ef('0xd')]+_0x2ac782[_0x68ef('0xf')]+_0x2ac782[_0x68ef('0x10')]+_0x2ac782[_0x68ef('0x11')]+_0x2ac782[_0x68ef('0x12')]+_0x2ac782['countagentrejectretry'];this[_0x68ef('0xf')]=_0x2ac782[_0x68ef('0xf')];this[_0x68ef('0x10')]=_0x2ac782['countdropretry'];this[_0x68ef('0x11')]=_0x2ac782[_0x68ef('0x11')];this[_0x68ef('0x12')]=_0x2ac782['countmachineretry'];this[_0x68ef('0x13')]=_0x2ac782[_0x68ef('0x13')];this[_0x68ef('0xa')]=_0x2ac782[_0x68ef('0xa')];this['calleridname']=_0x2ac782[_0x68ef('0x14')];this['calleridnum']=_0x2ac782['calleridnum'];this[_0x68ef('0x15')]=_0x2ac782[_0x68ef('0x15')];this['responsetime']=_0x2ac782['responsetime'];this[_0x68ef('0x16')]=_0x2ac782[_0x68ef('0x17')];this[_0x68ef('0x18')]=_0x2ac782['ringtime']||0x0;this[_0x68ef('0x19')]=_0x2ac782[_0x68ef('0x19')]||0x0;this[_0x68ef('0x1a')]=_0x2ac782['talktime']||0x0;this[_0x68ef('0x1b')]=_0x2ac782[_0x68ef('0x1b')];this['callbackuniqueid']=_0x2ac782[_0x68ef('0x1c')];this[_0x68ef('0x1d')]=_0x2ac782[_0x68ef('0x1d')];this['recallme']=_0x2ac782['recallme'];this['ContactId']=_0x2ac782[_0x68ef('0x1e')];this[_0x68ef('0x1f')]=_0x2ac782[_0x68ef('0x1f')];this[_0x68ef('0x20')]=_0x2ac782[_0x68ef('0x20')];this[_0x68ef('0x21')]=_0x2ac782[_0x68ef('0x21')];this[_0x68ef('0x22')]=_0x2ac782[_0x68ef('0x22')];this[_0x68ef('0x23')]=_0x2ac782['originatecalleridnum']||'';this[_0x68ef('0x24')]=_0x2ac782['originatecalleridname']||'';}module['exports']=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 7d3cd50..0296066 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 _0x68d4=['seconds','state','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countcongestionretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','exports','util','moment','milliseconds','diff'];(function(_0x2e2e41,_0x3a7848){var _0x266226=function(_0x458e0a){while(--_0x458e0a){_0x2e2e41['push'](_0x2e2e41['shift']());}};_0x266226(++_0x3a7848);}(_0x68d4,0xa4));var _0x468d=function(_0x1c212f,_0x59d13f){_0x1c212f=_0x1c212f-0x0;var _0x212fee=_0x68d4[_0x1c212f];return _0x212fee;};'use strict';var util=require(_0x468d('0x0'));var _=require('lodash');var moment=require(_0x468d('0x1'));function getSeconds(_0x5fb61b,_0x3042aa){var _0x49609f=moment(_0x5fb61b)['milliseconds'](0x0);var _0x102e0e=moment(_0x3042aa)[_0x468d('0x2')](0x0);return _0x49609f[_0x468d('0x3')](_0x102e0e,_0x468d('0x4'));}function Hangup(_0x531c39,_0x1b529b){this[_0x468d('0x5')]=0x4;this[_0x468d('0x6')]='Answer';this[_0x468d('0x7')]=_0x531c39[_0x468d('0x7')];this[_0x468d('0x8')]=_0x531c39[_0x468d('0x8')];this[_0x468d('0x9')]=_0x531c39[_0x468d('0x8')]===_0x468d('0xa')?_0x468d('0xb'):_0x531c39[_0x468d('0x8')];this['countbusyretry']=_0x531c39[_0x468d('0xc')];this['countcongestionretry']=_0x531c39['countcongestionretry'];this['countnoanswerretry']=_0x531c39[_0x468d('0xd')];this['countglobal']=_0x531c39[_0x468d('0xc')]+_0x531c39[_0x468d('0xe')]+_0x531c39[_0x468d('0xd')]+_0x531c39[_0x468d('0xf')]+_0x531c39[_0x468d('0x10')]+_0x531c39['countabandonedretry']+_0x531c39[_0x468d('0x11')]+_0x531c39[_0x468d('0x12')];this[_0x468d('0xf')]=_0x531c39[_0x468d('0xf')];this['countdropretry']=_0x531c39[_0x468d('0x10')];this[_0x468d('0x13')]=_0x531c39[_0x468d('0x13')];this['countmachineretry']=_0x531c39[_0x468d('0x11')];this['countagentrejectretry']=_0x531c39[_0x468d('0x12')];this[_0x468d('0x14')]=_0x1b529b[_0x468d('0x14')];this['calleridname']=_0x531c39['name'];this['calleridnum']=_0x531c39[_0x468d('0x15')];this['starttime']=_0x531c39[_0x468d('0x16')];this[_0x468d('0x17')]=_0x531c39[_0x468d('0x17')];this[_0x468d('0x18')]=moment()['format'](_0x468d('0x19'));this[_0x468d('0x1a')]=getSeconds(_0x531c39['responsetime'],_0x531c39[_0x468d('0x16')]);this[_0x468d('0x1b')]=0x0;this[_0x468d('0x1c')]=getSeconds(this['endtime'],_0x531c39[_0x468d('0x17')]);this[_0x468d('0xb')]=_0x531c39['queue'];this[_0x468d('0x1d')]=_0x468d('0x1e');this[_0x468d('0x1f')]=_0x1b529b[_0x468d('0x20')];this[_0x468d('0x21')]=_0x531c39[_0x468d('0x21')];this[_0x468d('0x22')]=_0x531c39[_0x468d('0x22')];this[_0x468d('0x23')]=_0x531c39[_0x468d('0x23')];this['recallme']=_0x531c39[_0x468d('0x24')];this[_0x468d('0x25')]=_0x531c39[_0x468d('0x25')];this[_0x468d('0x26')]=_0x531c39['ListId'];this['UserId']=_0x531c39['UserId'];this[_0x468d('0x27')]=_0x531c39[_0x468d('0x27')];this[_0x468d('0x28')]=_0x531c39[_0x468d('0x28')];}module[_0x468d('0x29')]=Hangup; \ No newline at end of file +var _0x9d14=['calleridname','name','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','uniqueid'];(function(_0x24f6e5,_0x23863b){var _0x262b55=function(_0x5c635b){while(--_0x5c635b){_0x24f6e5['push'](_0x24f6e5['shift']());}};_0x262b55(++_0x23863b);}(_0x9d14,0x118));var _0x49d1=function(_0x1ea36c,_0x4388f1){_0x1ea36c=_0x1ea36c-0x0;var _0x403020=_0x9d14[_0x1ea36c];return _0x403020;};'use strict';var util=require(_0x49d1('0x0'));var _=require(_0x49d1('0x1'));var moment=require(_0x49d1('0x2'));function getSeconds(_0x283701,_0x5dddaf){var _0x5914be=moment(_0x283701)['milliseconds'](0x0);var _0x547757=moment(_0x5dddaf)[_0x49d1('0x3')](0x0);return _0x5914be[_0x49d1('0x4')](_0x547757,_0x49d1('0x5'));}function Hangup(_0x3d33c6,_0x79baea){this[_0x49d1('0x6')]=0x4;this[_0x49d1('0x7')]=_0x49d1('0x8');this['scheduledat']=_0x3d33c6['scheduledat'];this[_0x49d1('0x9')]=_0x3d33c6[_0x49d1('0x9')];this['campaigntype']=_0x3d33c6['type']==='outbound'?_0x49d1('0xa'):_0x3d33c6[_0x49d1('0x9')];this[_0x49d1('0xb')]=_0x3d33c6[_0x49d1('0xb')];this[_0x49d1('0xc')]=_0x3d33c6[_0x49d1('0xc')];this[_0x49d1('0xd')]=_0x3d33c6['countnoanswerretry'];this[_0x49d1('0xe')]=_0x3d33c6[_0x49d1('0xb')]+_0x3d33c6[_0x49d1('0xc')]+_0x3d33c6['countnoanswerretry']+_0x3d33c6['countnosuchnumberretry']+_0x3d33c6[_0x49d1('0xf')]+_0x3d33c6[_0x49d1('0x10')]+_0x3d33c6[_0x49d1('0x11')]+_0x3d33c6['countagentrejectretry'];this['countnosuchnumberretry']=_0x3d33c6[_0x49d1('0x12')];this[_0x49d1('0xf')]=_0x3d33c6[_0x49d1('0xf')];this[_0x49d1('0x10')]=_0x3d33c6[_0x49d1('0x10')];this[_0x49d1('0x11')]=_0x3d33c6['countmachineretry'];this[_0x49d1('0x13')]=_0x3d33c6[_0x49d1('0x13')];this['uniqueid']=_0x79baea[_0x49d1('0x14')];this[_0x49d1('0x15')]=_0x3d33c6[_0x49d1('0x16')];this['calleridnum']=_0x3d33c6[_0x49d1('0x17')];this[_0x49d1('0x18')]=_0x3d33c6[_0x49d1('0x18')];this['responsetime']=_0x3d33c6[_0x49d1('0x19')];this[_0x49d1('0x1a')]=moment()[_0x49d1('0x1b')](_0x49d1('0x1c'));this[_0x49d1('0x1d')]=getSeconds(_0x3d33c6['responsetime'],_0x3d33c6[_0x49d1('0x18')]);this['holdtime']=0x0;this[_0x49d1('0x1e')]=getSeconds(this[_0x49d1('0x1a')],_0x3d33c6[_0x49d1('0x19')]);this[_0x49d1('0xa')]=_0x3d33c6['queue'];this['membername']=_0x49d1('0x1f');this[_0x49d1('0x20')]=_0x79baea[_0x49d1('0x21')];this[_0x49d1('0x22')]=_0x3d33c6[_0x49d1('0x22')];this[_0x49d1('0x23')]=_0x3d33c6[_0x49d1('0x23')];this[_0x49d1('0x24')]=_0x3d33c6[_0x49d1('0x24')];this[_0x49d1('0x25')]=_0x3d33c6[_0x49d1('0x25')];this['ContactId']=_0x3d33c6[_0x49d1('0x26')];this[_0x49d1('0x27')]=_0x3d33c6[_0x49d1('0x27')];this[_0x49d1('0x28')]=_0x3d33c6['UserId'];this[_0x49d1('0x29')]=_0x3d33c6[_0x49d1('0x29')];this['CampaignId']=_0x3d33c6['CampaignId'];}module[_0x49d1('0x2a')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 47930c4..b21b0e1 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 _0x2d6e=['countdropretry','countagentrejectretry','countabandonedretry','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','uniqueid','scheduledat','outbound','queue','type','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry'];(function(_0x44c974,_0x1bcfde){var _0x5214c6=function(_0x10aad5){while(--_0x10aad5){_0x44c974['push'](_0x44c974['shift']());}};_0x5214c6(++_0x1bcfde);}(_0x2d6e,0x82));var _0xe2d6=function(_0x536054,_0x1a73c7){_0x536054=_0x536054-0x0;var _0x10b96e=_0x2d6e[_0x536054];return _0x10b96e;};'use strict';var util=require(_0xe2d6('0x0'));var _=require(_0xe2d6('0x1'));var moment=require(_0xe2d6('0x2'));function getSeconds(_0xdf98a5,_0x1eed01){var _0x4aaf26=moment(_0xdf98a5)['milliseconds'](0x0);var _0x3c44f2=moment(_0x1eed01)[_0xe2d6('0x3')](0x0);return _0x4aaf26[_0xe2d6('0x4')](_0x3c44f2,'seconds');}function History(_0x5aa1f2){this[_0xe2d6('0x5')]=_0x5aa1f2[_0xe2d6('0x5')];this['scheduledat']=_0x5aa1f2[_0xe2d6('0x6')]||undefined;this['type']=_0x5aa1f2['type'];this['campaigntype']=_0x5aa1f2['type']===_0xe2d6('0x7')?_0xe2d6('0x8'):_0x5aa1f2[_0xe2d6('0x9')];this['countbusyretry']=_0x5aa1f2['countbusyretry'];this['countcongestionretry']=_0x5aa1f2[_0xe2d6('0xa')];this[_0xe2d6('0xb')]=_0x5aa1f2[_0xe2d6('0xb')];this[_0xe2d6('0xc')]=_0x5aa1f2['countbusyretry']+_0x5aa1f2[_0xe2d6('0xa')]+_0x5aa1f2[_0xe2d6('0xb')]+_0x5aa1f2[_0xe2d6('0xd')]+_0x5aa1f2[_0xe2d6('0xe')]+_0x5aa1f2['countabandonedretry']+_0x5aa1f2['countmachineretry']+_0x5aa1f2[_0xe2d6('0xf')];this[_0xe2d6('0xd')]=_0x5aa1f2['countnosuchnumberretry'];this[_0xe2d6('0xe')]=_0x5aa1f2[_0xe2d6('0xe')];this['countabandonedretry']=_0x5aa1f2[_0xe2d6('0x10')];this['countmachineretry']=_0x5aa1f2['countmachineretry'];this['countagentrejectretry']=_0x5aa1f2[_0xe2d6('0xf')];this['queue']=_0x5aa1f2[_0xe2d6('0x8')];this['calleridname']=_0x5aa1f2[_0xe2d6('0x11')];this[_0xe2d6('0x12')]=_0x5aa1f2[_0xe2d6('0x13')];this[_0xe2d6('0x14')]=_0x5aa1f2[_0xe2d6('0x14')];this[_0xe2d6('0x15')]=_0x5aa1f2[_0xe2d6('0x15')];this[_0xe2d6('0x16')]=_0x5aa1f2[_0xe2d6('0x15')];this[_0xe2d6('0x17')]=getSeconds(_0x5aa1f2[_0xe2d6('0x15')],_0x5aa1f2[_0xe2d6('0x14')]);this[_0xe2d6('0x18')]=0x0;this['talktime']=0x0;this[_0xe2d6('0x19')]=_0x5aa1f2['callback'];this[_0xe2d6('0x1a')]=_0x5aa1f2[_0xe2d6('0x1a')];this['callbackat']=_0x5aa1f2[_0xe2d6('0x1b')];this[_0xe2d6('0x1c')]=_0x5aa1f2[_0xe2d6('0x1c')];this[_0xe2d6('0x1d')]=_0x5aa1f2[_0xe2d6('0x1d')];this['ListId']=_0x5aa1f2['ListId'];this[_0xe2d6('0x1e')]=_0x5aa1f2[_0xe2d6('0x1e')];this[_0xe2d6('0x1f')]=_0x5aa1f2[_0xe2d6('0x1f')];this[_0xe2d6('0x20')]=_0x5aa1f2['CampaignId'];this[_0xe2d6('0x21')]=_0x5aa1f2[_0xe2d6('0x21')]||'';this[_0xe2d6('0x22')]=_0x5aa1f2[_0xe2d6('0x22')]||'';}module[_0xe2d6('0x23')]=History; \ No newline at end of file +var _0x8ca7=['responsetime','endtime','ringtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','countdropretry','countabandonedretry','countmachineretry','name','calleridnum','number','starttime'];(function(_0x17d241,_0xed198d){var _0x1908f1=function(_0x4fb558){while(--_0x4fb558){_0x17d241['push'](_0x17d241['shift']());}};_0x1908f1(++_0xed198d);}(_0x8ca7,0x1b2));var _0x78ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ca7[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x78ca('0x0'));function getSeconds(_0x3e9102,_0x19644c){var _0x56a461=moment(_0x3e9102)['milliseconds'](0x0);var _0x24f861=moment(_0x19644c)[_0x78ca('0x1')](0x0);return _0x56a461[_0x78ca('0x2')](_0x24f861,_0x78ca('0x3'));}function History(_0x1f28a1){this['uniqueid']=_0x1f28a1['uniqueid'];this['scheduledat']=_0x1f28a1[_0x78ca('0x4')]||undefined;this[_0x78ca('0x5')]=_0x1f28a1['type'];this[_0x78ca('0x6')]=_0x1f28a1[_0x78ca('0x5')]===_0x78ca('0x7')?_0x78ca('0x8'):_0x1f28a1[_0x78ca('0x5')];this[_0x78ca('0x9')]=_0x1f28a1[_0x78ca('0x9')];this[_0x78ca('0xa')]=_0x1f28a1[_0x78ca('0xa')];this[_0x78ca('0xb')]=_0x1f28a1['countnoanswerretry'];this['countglobal']=_0x1f28a1[_0x78ca('0x9')]+_0x1f28a1[_0x78ca('0xa')]+_0x1f28a1[_0x78ca('0xb')]+_0x1f28a1[_0x78ca('0xc')]+_0x1f28a1['countdropretry']+_0x1f28a1['countabandonedretry']+_0x1f28a1['countmachineretry']+_0x1f28a1[_0x78ca('0xd')];this[_0x78ca('0xc')]=_0x1f28a1[_0x78ca('0xc')];this[_0x78ca('0xe')]=_0x1f28a1[_0x78ca('0xe')];this[_0x78ca('0xf')]=_0x1f28a1[_0x78ca('0xf')];this[_0x78ca('0x10')]=_0x1f28a1['countmachineretry'];this[_0x78ca('0xd')]=_0x1f28a1[_0x78ca('0xd')];this[_0x78ca('0x8')]=_0x1f28a1[_0x78ca('0x8')];this['calleridname']=_0x1f28a1[_0x78ca('0x11')];this[_0x78ca('0x12')]=_0x1f28a1[_0x78ca('0x13')];this[_0x78ca('0x14')]=_0x1f28a1[_0x78ca('0x14')];this[_0x78ca('0x15')]=_0x1f28a1['responsetime'];this[_0x78ca('0x16')]=_0x1f28a1['responsetime'];this[_0x78ca('0x17')]=getSeconds(_0x1f28a1[_0x78ca('0x15')],_0x1f28a1[_0x78ca('0x14')]);this['holdtime']=0x0;this['talktime']=0x0;this[_0x78ca('0x18')]=_0x1f28a1[_0x78ca('0x18')];this[_0x78ca('0x19')]=_0x1f28a1[_0x78ca('0x19')];this[_0x78ca('0x1a')]=_0x1f28a1[_0x78ca('0x1a')];this['recallme']=_0x1f28a1[_0x78ca('0x1b')];this[_0x78ca('0x1c')]=_0x1f28a1[_0x78ca('0x1c')];this[_0x78ca('0x1d')]=_0x1f28a1['ListId'];this[_0x78ca('0x1e')]=_0x1f28a1[_0x78ca('0x1e')];this[_0x78ca('0x1f')]=_0x1f28a1['VoiceQueueId'];this[_0x78ca('0x20')]=_0x1f28a1[_0x78ca('0x20')];this[_0x78ca('0x21')]=_0x1f28a1[_0x78ca('0x21')]||'';this[_0x78ca('0x22')]=_0x1f28a1[_0x78ca('0x22')]||'';}module['exports']=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 55adcb8..0d43e49 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 _0xc68d=['NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','endtime','starttime','clearZombieChannels','[uniqueid]','actions','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','resolve','then','countReScheduled','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','averageHandleTime','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','Success','isTrunkReachable','SIP/%s','reachable','syncVarSet','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerCallsDay','statedesc','HangupInAMD','membername','custom:amd','buildObj','amd','[syncHangupInAMD]','MACHINE','state','countmachineretry','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','AMD','[syncHangupInAMDIvr][createHistory]','countglobal','[syncAgentComplete][createHistory][0]','countdropretry','countagentrejectretry','minutes','syncHangup','ivrAnswerCallsDay','[syncHangupIvr]','dialQueueProject','AGI','[syncHangupIvr][createHistory]','outboundUnknownCallsDay','cause-txt','Unknow','reason','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete]','answertime','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','dialDropMaxRetry','queueCallerAbandonCreateState','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','Abandoned','syncQueueMember','actionid','strategy','stateinterface','locked','push','idHopper','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','_rr','paused','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','Agent:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','\x20trunk\x20is\x20not\x20reachable','ifTime','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','iftime\x20%s,%s','interval','content','command','indexOf','true','some','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','checkDialMethod','progressive','handlePower','power','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','checkIfTime','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','originate','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','outbound','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','createdAt','%s%s','XMD-','toUpper','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','OriginateError','[originate][error]','originate\x20action\x20Error','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','NoAnswer','noanswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','Busy','busy','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','Congestion','reason\x208\x20congestion','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','AgentReject','custom:agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','available','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','dialRecallMeTimeout','Agent','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','inBlackList','dialOrderByScheduledAt','[getContactCampaign2][Empty]','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[getContactCampaign2]','dialLimitQueue','not_inuse','RUNNING','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','checkContactBlack','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','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]','m\x20=\x20','p\x20=\x20','Umin\x20=\x20','lodash','bluebird','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','defaults','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./history','./final','./queueCallerAbandon','./hangup','env','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','originateresponse','syncAgentComplete','custom:queuesummary','hangup','newexten','syncNewExten','varset','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','name','\x20AGENTS\x20NOT\x20LOGGED','\x20NOT\x20Active','Interval','Intervals','\x20INTERVAL_IS_NULL','isEmpty','Error','stringify','milliseconds','diff','emit','type','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','dialActive','dialMethod','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangBusyFactor','Trunk','callerid','format','voice:queue:%s','voice_queue:save','ivr','campaign:save','-----\x20Stats\x20Predictive\x20---','info','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','merge','seconds','clearing\x20variable\x20start\x20progressive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','stack','inspect','length','undefined','originated','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive'];(function(_0x47e235,_0x40dffa){var _0x567270=function(_0x2ebce9){while(--_0x2ebce9){_0x47e235['push'](_0x47e235['shift']());}};_0x567270(++_0x40dffa);}(_0xc68d,0x17a));var _0xdc68=function(_0x21973b,_0xa729ba){_0x21973b=_0x21973b-0x0;var _0x55286c=_0xc68d[_0x21973b];return _0x55286c;};'use strict';var util=require('util');var _=require(_0xdc68('0x0'));var BPromise=require(_0xdc68('0x1'));var uuid=require('uuid');var moment=require('moment');var rr=require('rr');var md5=require(_0xdc68('0x2'));var Redis=require(_0xdc68('0x3'));var ut=require(_0xdc68('0x4'));var config=require(_0xdc68('0x5'));var logger=require(_0xdc68('0x6'))(_0xdc68('0x7'));var loggerBooked=require('../../../config/logger')(_0xdc68('0x8'));var loggerPredictive=require(_0xdc68('0x6'))(_0xdc68('0x9'));var loggerPredictiveCalls=require('../../../config/logger')(_0xdc68('0xa'));var loggerSyncQueueSummary=require(_0xdc68('0x6'))(_0xdc68('0xb'));var ami=require('../ami');config['redis']=_[_0xdc68('0xc')](config[_0xdc68('0xd')],{'host':_0xdc68('0xe'),'port':0x18eb});var io=require(_0xdc68('0xf'))(new Redis(config['redis']));var cmHopper=require(_0xdc68('0x10'));var cmHopperHistory=require(_0xdc68('0x11'));var cmHopperBlack=require(_0xdc68('0x12'));var voiceQueueRt=require(_0xdc68('0x13'));var Action=require('./action');var History=require(_0xdc68('0x14'));var Final=require(_0xdc68('0x15'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0xdc68('0x16'));var Hangup=require(_0xdc68('0x17'));var ipAgi=process[_0xdc68('0x18')]['XCALLY_IP_AGI']||_0xdc68('0x19');var strategy={'rrmemory':_0xdc68('0x1a'),'roundrobin':_0xdc68('0x1b')};var Sequence=function(){};Sequence[_0xdc68('0x1c')][_0xdc68('0x1d')]=function(_0x10b249){this[_0xdc68('0x1e')]=this['tail']?this[_0xdc68('0x1e')]['finally'](_0x10b249):_0x10b249();};function Dialer(_0x40c2ff,_0x521c52){this[_0xdc68('0x1f')]=new Sequence();this[_0xdc68('0x20')]=_0x521c52;this['voiceQueues']=_0x40c2ff[_0xdc68('0x21')];this[_0xdc68('0x22')]=_0x40c2ff[_0xdc68('0x22')];this['agents']=_0x40c2ff[_0xdc68('0x23')];this[_0xdc68('0x24')]=_0x40c2ff[_0xdc68('0x24')];this[_0xdc68('0x25')]=config['maxNumberOriginate']||0x2;this['channels']={};this['actions']={};this[_0xdc68('0x26')]={};this[_0xdc68('0x27')]={};this[_0xdc68('0x28')]={};this[_0xdc68('0x29')]={};this[_0xdc68('0x2a')]={};this['ivrOriginated']={};this[_0xdc68('0x2b')]={};this[_0xdc68('0x2c')]={};ami['on'](_0xdc68('0x2d'),this[_0xdc68('0x2e')][_0xdc68('0x2f')](this));ami['on'](_0xdc68('0x30'),this['syncQueueCallerAbandon'][_0xdc68('0x2f')](this));ami['on'](_0xdc68('0x31'),this['syncOriginateResponse'][_0xdc68('0x2f')](this));ami['on']('agentcomplete',this[_0xdc68('0x32')][_0xdc68('0x2f')](this));ami['on'](_0xdc68('0x33'),this[_0xdc68('0xb')]['bind'](this));ami['on'](_0xdc68('0x34'),this['syncHangup'][_0xdc68('0x2f')](this));ami['on'](_0xdc68('0x35'),this[_0xdc68('0x36')][_0xdc68('0x2f')](this));ami['on'](_0xdc68('0x37'),this['syncVarSet']['bind'](this));ami['on']('queuemember',this['syncQueueMember'][_0xdc68('0x2f')](this));ami['on'](_0xdc68('0x38'),this[_0xdc68('0x39')][_0xdc68('0x2f')](this));this[_0xdc68('0x3a')]();this[_0xdc68('0x3b')]();}function isNotNull(_0x26061a){return _0x26061a!==null&&!_[_0xdc68('0x3c')](_0x26061a);}function checkIsLoggedIn(_0x440598,_0x1d29d4){return function(){if(_0x1d29d4<=0x0){_0x440598[_0xdc68('0x3d')]='AGENTS_NOT_LOGGED';throw _0x440598[_0xdc68('0x3e')]+_0xdc68('0x3f');}};}function isActive(_0x57310e){return _0x57310e;}function checkIsActive(_0x51cc29,_0x400cb8){return function(){if(!isActive(_0x400cb8)){_0x51cc29[_0xdc68('0x3d')]='NOT_ACTIVE';throw _0x51cc29[_0xdc68('0x3e')]+_0xdc68('0x40');}};}function checkInterval(_0x58bfb1){return function(){if(!isNotNull(_0x58bfb1[_0xdc68('0x41')])){_0x58bfb1['message']='INTERVAL_IS_NULL';throw _0x58bfb1[_0xdc68('0x3e')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x58bfb1[_0xdc68('0x41')][_0xdc68('0x42')])){_0x58bfb1['message']='INTERVAL_IS_NULL';throw _0x58bfb1[_0xdc68('0x3e')]+_0xdc68('0x43');}if(!isNotNull(_[_0xdc68('0x44')](_0x58bfb1['Interval'][_0xdc68('0x42')]))){_0x58bfb1[_0xdc68('0x3d')]='INTERVAL_IS_NULL';throw _0x58bfb1[_0xdc68('0x3e')]+_0xdc68('0x43');}};}function msgResponse(_0x219fa6,_0x472ec6,_0x3dfe65){return{'action':_0x219fa6,'response':_0x472ec6,'message':_0x3dfe65,'stack':_0x3dfe65};}function myreject(_0x422801){return function(_0x3cd414){return _0x422801(msgResponse('[ifTime][Action]',_0xdc68('0x45'),JSON[_0xdc68('0x46')](_0x3cd414)));};}function getSeconds(_0x4d0f44,_0x3dc195){var _0x3ba74f=moment(_0x4d0f44)['milliseconds'](0x0);var _0x1e563a=moment(_0x3dc195)[_0xdc68('0x47')](0x0);return _0x3ba74f[_0xdc68('0x48')](_0x1e563a,'seconds');}function emit(_0x2e431f,_0x3c4972,_0x465ed8){io['to'](_0x2e431f)[_0xdc68('0x49')](_0x3c4972,_0x465ed8);}function emitVoiceQueueSummary(_0x3adc28){if(_0x3adc28[_0xdc68('0x4a')]==='outbound'){var _0x4972ef={'id':_0x3adc28['id'],'name':_0x3adc28[_0xdc68('0x3e')],'strategy':_0x3adc28['strategy'],'answered':_0x3adc28['answered'],'available':_0x3adc28['available'],'loggedIn':_0x3adc28[_0xdc68('0x4b')],'pTalking':_0x3adc28[_0xdc68('0x4c')],'sumBillable':_0x3adc28[_0xdc68('0x4d')],'sumDuration':_0x3adc28[_0xdc68('0x4e')],'sumHoldTime':_0x3adc28[_0xdc68('0x4f')]||0x0,'talking':_0x3adc28[_0xdc68('0x50')],'total':_0x3adc28[_0xdc68('0x51')],'type':_0x3adc28['type'],'unmanaged':_0x3adc28[_0xdc68('0x52')],'abandoned':_0x3adc28[_0xdc68('0x53')],'waiting':_0x3adc28[_0xdc68('0x54')],'loggedInDb':_0x3adc28['loggedInDb'],'dialActive':_0x3adc28[_0xdc68('0x55')],'dialMethod':_0x3adc28[_0xdc68('0x56')],'dialOriginateCallerIdName':_0x3adc28['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x3adc28['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x3adc28[_0xdc68('0x57')],'dialPrefix':_0x3adc28[_0xdc68('0x58')],'outboundAnswerAgiCallsDay':_0x3adc28[_0xdc68('0x59')],'outboundAnswerCallsDay':_0x3adc28['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x3adc28[_0xdc68('0x5a')],'outboundBusyCallsDay':_0x3adc28[_0xdc68('0x5b')],'outboundCongestionCallsDay':_0x3adc28[_0xdc68('0x5c')],'outboundDropCallsDayACS':_0x3adc28['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x3adc28[_0xdc68('0x5d')],'outboundDropCallsDayTimeout':_0x3adc28['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x3adc28['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x3adc28[_0xdc68('0x5e')],'outboundOriginateFailureCallsDay':_0x3adc28[_0xdc68('0x5f')],'outboundReCallsDay':_0x3adc28[_0xdc68('0x60')],'outboundRejectCallsDay':_0x3adc28[_0xdc68('0x61')],'outboundUnknownCallsDay':_0x3adc28['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x3adc28[_0xdc68('0x62')],'predictiveIntervalAvgHoldtime':_0x3adc28[_0xdc68('0x63')],'predictiveIntervalAvgTalktime':_0x3adc28[_0xdc68('0x64')],'predictiveIntervalDroppedCallsCallersExit':_0x3adc28[_0xdc68('0x65')],'predictiveIntervalDroppedCallsTimeout':_0x3adc28[_0xdc68('0x66')],'predictiveIntervalErlangCalls':_0x3adc28[_0xdc68('0x67')],'predictiveIntervalErlangCallsDroppedCalls':_0x3adc28['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x3adc28[_0xdc68('0x68')],'predictiveIntervalMultiplicativeFactor':_0x3adc28[_0xdc68('0x69')],'predictiveIntervalPauses':_0x3adc28[_0xdc68('0x6a')],'predictiveIntervalAvailable':_0x3adc28[_0xdc68('0x6b')],'predictiveIntervalTotalCalls':_0x3adc28[_0xdc68('0x6c')],'message':_0x3adc28[_0xdc68('0x3d')],'originated':_0x3adc28['originated'],'erlangCalls':_0x3adc28[_0xdc68('0x6d')],'erlangCallToSecond':_0x3adc28[_0xdc68('0x6e')],'erlangAbandonmentRate':_0x3adc28['erlangAbandonmentRate'],'erlangBusyFactor':_0x3adc28[_0xdc68('0x6f')],'startPredictive':_0x3adc28[_0xdc68('0x29')],'startProgressive':_0x3adc28['startProgressive']};if(_0x3adc28[_0xdc68('0x70')]){_0x4972ef[_0xdc68('0x70')]={'id':_0x3adc28[_0xdc68('0x70')]['id'],'name':_0x3adc28[_0xdc68('0x70')][_0xdc68('0x3e')],'active':_0x3adc28[_0xdc68('0x70')]['active'],'callerid':_0x3adc28[_0xdc68('0x70')][_0xdc68('0x71')]};}if(_0x3adc28['Interval']){_0x4972ef[_0xdc68('0x41')]={'id':_0x3adc28['Interval']['id'],'name':_0x3adc28['Interval'][_0xdc68('0x3e')]};}var _0x239e37=md5(JSON[_0xdc68('0x46')](_0x4972ef));if(_0x3adc28[_0xdc68('0x2')]!==_0x239e37){_0x3adc28[_0xdc68('0x2')]=_0x239e37;emit(util[_0xdc68('0x72')](_0xdc68('0x73'),_0x4972ef[_0xdc68('0x3e')]),_0xdc68('0x74'),_0x4972ef);}}}function emitCampaignSummary(_0x140dea){if(_0x140dea['type']===_0xdc68('0x75')){emit(util[_0xdc68('0x72')]('campaign:ivr:%s',_0x140dea[_0xdc68('0x3e')]),_0xdc68('0x76'),_0x140dea);}}function checkGetDataPredictive(_0x58fccf){if(isNotNull(_0x58fccf)&&!_[_0xdc68('0x44')](_0x58fccf)){loggerPredictive['info'](_0xdc68('0x77'));loggerPredictive[_0xdc68('0x78')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x58fccf[_0xdc68('0x6c')]);loggerPredictive[_0xdc68('0x78')](_0xdc68('0x79'),_0x58fccf['predictiveIntervalAnsweredCalls']);loggerPredictive[_0xdc68('0x78')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x58fccf[_0xdc68('0x66')]);loggerPredictive[_0xdc68('0x78')](_0xdc68('0x7a'),_0x58fccf[_0xdc68('0x65')]);loggerPredictive[_0xdc68('0x78')](_0xdc68('0x7b'),_0x58fccf['predictiveIntervalAvgHoldtime']);loggerPredictive['info'](_0xdc68('0x7c'),_0x58fccf[_0xdc68('0x64')]);loggerPredictive['info']('---------------------------');if(_0x58fccf[_0xdc68('0x6c')]>0x0){if(!_[_0xdc68('0x3c')](_0x58fccf[_0xdc68('0x64')])&&_0x58fccf[_0xdc68('0x64')]>0x0){return!![];}loggerPredictive[_0xdc68('0x78')](_0xdc68('0x7d'));if(!_[_0xdc68('0x3c')](_0x58fccf[_0xdc68('0x63')])&&_0x58fccf[_0xdc68('0x63')]>0x0){return!![];}loggerPredictive['info'](_0xdc68('0x7e'));}else{loggerPredictive[_0xdc68('0x78')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xdc68('0x78')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x22eb95){return function(_0x1d74c9){loggerPredictive[_0xdc68('0x78')](_0xdc68('0x7f'));loggerPredictive['info'](_0xdc68('0x80'),_0x1d74c9[_0xdc68('0x6d')]);loggerPredictive[_0xdc68('0x78')](_0xdc68('0x81'),_0x1d74c9[_0xdc68('0x6e')]);loggerPredictive[_0xdc68('0x78')](_0xdc68('0x82'),_0x1d74c9[_0xdc68('0x83')]);loggerPredictive[_0xdc68('0x78')](_0xdc68('0x84'),_0x1d74c9['erlangBusyFactor']);loggerPredictive[_0xdc68('0x78')](_0xdc68('0x82'),_0x1d74c9['erlangAbandonmentRate']);loggerPredictive[_0xdc68('0x78')](_0xdc68('0x85'));_[_0xdc68('0x86')](_0x22eb95,_0x1d74c9);};}function getDiff(_0x3e61ea){var _0x350001=moment()[_0xdc68('0x47')](0x0);var _0x29b331=moment(_0x3e61ea)['milliseconds'](0x0);return _0x350001[_0xdc68('0x48')](_0x29b331,_0xdc68('0x87'));}function ifInterval(_0x384c5c,_0x514d67){if(_[_0xdc68('0x3c')](_0x514d67)){return![];}return getDiff(_0x514d67)<_0x384c5c*0x3c;}function freeVariablesPredictive(_0xdeaee4){if(isNotNull(_0xdeaee4)){if(!_[_0xdc68('0x3c')](_0xdeaee4[_0xdc68('0x2a')])){_0xdeaee4[_0xdc68('0x2a')]=undefined;loggerPredictive['info'](_0xdeaee4[_0xdc68('0x3e')],_0xdc68('0x88'));}if(!_[_0xdc68('0x3c')](_0xdeaee4['startPredictive'])){_0xdeaee4['startPredictive']=undefined;loggerPredictive['info'](_0xdeaee4[_0xdc68('0x3e')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0xdc68('0x3c')](_0xdeaee4[_0xdc68('0x89')])){clearInterval(_0xdeaee4['handlePredictive']);_0xdeaee4['handlePredictive']=undefined;loggerPredictive['info'](_0xdeaee4[_0xdc68('0x3e')],_0xdc68('0x8a'));}}}function erlangb(_0x5c2df5,_0x3f020d){if(_0x3f020d===0x0){return 0x0;}var _0x237b02=0x1;for(var _0x2258cb=0x1;_0x2258cb<=_0x3f020d;_0x2258cb+=0x1){_0x237b02=0x1+_0x237b02*_0x2258cb/_0x5c2df5;}return 0x1/_0x237b02;}function isVoiceQueueOutbound(_0x2faf82){return _0x2faf82==='outbound';}function isNotPreview(_0x199fa1){return _0x199fa1!==_0xdc68('0x20');}function isCampaignIvr(_0x3c7edf){return _0x3c7edf===_0xdc68('0x75');}function getCallerId(_0x22c0b8,_0x4996bb,_0x27442a){if(!_[_0xdc68('0x3c')](_0x27442a)&&typeof _0x27442a===_0xdc68('0x8b')&&!_['isEmpty'](_0x27442a)){if(!_[_0xdc68('0x3c')](_0x4996bb)&&typeof _0x4996bb===_0xdc68('0x8b')&&!_[_0xdc68('0x44')](_0x4996bb)){return util[_0xdc68('0x72')](_0xdc68('0x8c'),_0x4996bb,_0x27442a);}return util['format'](_0xdc68('0x8c'),_0x27442a,_0x27442a);}if(!_['isUndefined'](_0x22c0b8)&&typeof _0x22c0b8==='string'&&!_[_0xdc68('0x44')](_0x22c0b8)){return _0x22c0b8;}return _0xdc68('0x8d');}function loggerCatchQueueSummary(_0x306e94,_0x1c9afe){return function(_0xcb489){freeVariablesPredictive(_0x1c9afe);emitVoiceQueueSummary(_0x1c9afe);emitCampaignSummary(_0x1c9afe);loggerSyncQueueSummary['error'](_0x306e94,util['inspect'](_0xcb489,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x2611ad,_0x2cff6f){return function(_0x685e44){loggerPredictive[_0xdc68('0x8e')](_0x2cff6f['name'],_0x2611ad);loggerPredictive[_0xdc68('0x8e')](_0x685e44[_0xdc68('0x8f')]);freeVariablesPredictive(_0x2cff6f);};}function loggerCatch(_0x3eeacb){return function(_0x1bc701){logger[_0xdc68('0x8e')](_0x3eeacb,util[_0xdc68('0x90')](_0x1bc701,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x8b5084){return _0x8b5084&&!_[_0xdc68('0x3c')](_0x8b5084)&&_0x8b5084[_0xdc68('0x91')]>0x0;}function decremetOriginate(_0x262306){if(!_[_0xdc68('0x3c')](_0x262306)&&_0x262306!==null){if(typeof _0x262306['originated']!==_0xdc68('0x92')){if(_0x262306[_0xdc68('0x93')]>0x0){_0x262306[_0xdc68('0x93')]-=0x1;}else{logger[_0xdc68('0x8e')](_0xdc68('0x94'));}}}else{logger[_0xdc68('0x8e')](_0xdc68('0x95'));}}function checkContactLowerLimitOriginate(_0x353a20,_0x3243e3,_0x5c842c){if(_0x3243e3>_0x5c842c){for(var _0x3bcfb6=0x0;_0x3bcfb6<_0x3243e3-_0x5c842c;_0x3bcfb6+=0x1){decremetOriginate(_0x353a20);}}}function loggerGetContactDialer(_0x130d01,_0x15f481,_0x459b17){return function(_0x4e03b2){checkContactLowerLimitOriginate(_0x15f481,_0x459b17,0x0);logger['error'](_0x130d01,util[_0xdc68('0x90')](_0x4e03b2,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x488f6d){return function(_0x46be28){if(isNotNull(_0x46be28)&&isNotNull(_0x46be28[0x0])){if(_0x46be28[0x0][_0xdc68('0x96')]>0x0){_0x488f6d[_0xdc68('0x3d')]=_0xdc68('0x97');logger[_0xdc68('0x78')](_0xdc68('0x98')+_0x488f6d['name'],_0x46be28[0x0]['contactsRescheduled'],_0xdc68('0x99'));}else{_0x488f6d[_0xdc68('0x3d')]=_0xdc68('0x9a');logger[_0xdc68('0x78')](_0xdc68('0x9b')+_0x488f6d[_0xdc68('0x3e')]);}}};}function notSendMessagesQueue(_0x1cdd4a){if(_0x1cdd4a[_0xdc68('0x9c')]){freeVariablesPredictive(_0x1cdd4a);if(_0x1cdd4a['originated']===0x0&&_0x1cdd4a[_0xdc68('0x50')]===0x0&&_0x1cdd4a['waiting']===0x0&&(_0x1cdd4a[_0xdc68('0x4c')]||0x0)===0x0){_0x1cdd4a['sendMessageOneNotActive']=![];_0x1cdd4a['available']=0x0;_0x1cdd4a[_0xdc68('0x3d')]=_0xdc68('0x9d');loggerSyncQueueSummary[_0xdc68('0x8e')](_0xdc68('0x9e'),_0x1cdd4a[_0xdc68('0x3e')],_0xdc68('0x9f'));}else{_0x1cdd4a[_0xdc68('0x3d')]=_0xdc68('0xa0');loggerSyncQueueSummary[_0xdc68('0x8e')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x1cdd4a['name'],_0xdc68('0xa1'));}emitVoiceQueueSummary(_0x1cdd4a);}}function notSendMessagesCampaign(_0x427ea6){if(_0x427ea6[_0xdc68('0x9c')]){if(_0x427ea6[_0xdc68('0x93')]===0x0){_0x427ea6['sendMessageOneNotActive']=![];_0x427ea6['message']='NOT_ACTIVE';loggerSyncQueueSummary[_0xdc68('0x8e')](_0xdc68('0xa2'),_0x427ea6[_0xdc68('0x3e')],'is\x20not\x20active');}else{_0x427ea6[_0xdc68('0x3d')]=_0xdc68('0xa0');loggerSyncQueueSummary['error'](_0xdc68('0xa2'),_0x427ea6[_0xdc68('0x3e')],_0xdc68('0xa1'));}emitCampaignSummary(_0x427ea6);}}function createObjHistory(_0x34f4cd,_0x34a6e9,_0x52e405,_0x45e309,_0x177c13){_0x34f4cd[_0xdc68('0x3d')]=_0x52e405;var _0xa0332c=new Action(_0x34f4cd,_0x34a6e9);var _0x518796=new History(_0xa0332c);_0x518796['state']=_0x45e309;_0x518796['statedesc']=_0x177c13;_0x518796[_0xdc68('0xa3')]=_0xa0332c[_0xdc68('0xa4')];return _0x518796;}Dialer[_0xdc68('0x1c')][_0xdc68('0x3b')]=function(){var _0x15bc98=this;setInterval(function(){_0x15bc98[_0xdc68('0xa5')](_0x15bc98[_0xdc68('0x27')],_0xdc68('0xa6'));_0x15bc98['clearZombieChannels'](_0x15bc98[_0xdc68('0xa7')],'[actions]');},0x32c8);};Dialer[_0xdc68('0x1c')]['clearZombieChannels']=function(_0x2b3252,_0x1ed87a){var _0x49c899=this;for(var _0x10ef30 in _0x2b3252){if(typeof _0x2b3252[_0x10ef30]!==_0xdc68('0x92')){this[_0xdc68('0x1f')]['enqueue'](function(){if(!_[_0xdc68('0xa8')](_0x2b3252[_0x10ef30])){return ami[_0xdc68('0xa9')]({'action':_0xdc68('0xaa'),'channel':_0x2b3252[_0x10ef30][_0xdc68('0xab')]})[_0xdc68('0xac')](function(_0x3ddf18){if(_0x3ddf18[_0xdc68('0x3d')]===_0xdc68('0xad')){setTimeout(function(){if(_0x2b3252[_0x10ef30]&&_0x2b3252[_0x10ef30]['type']!=='ivr'){_0x49c899[_0xdc68('0xae')](_0x49c899[_0xdc68('0x21')][_0x2b3252[_0x10ef30][_0xdc68('0xaf')]]);logger['error']('[Dialer][checkChannel]',_0x1ed87a,_0x10ef30,_0x2b3252[_0x10ef30][_0xdc68('0xaf')]);delete _0x2b3252[_0x10ef30];}if(_0x2b3252[_0x10ef30]&&_0x2b3252[_0x10ef30][_0xdc68('0x4a')]===_0xdc68('0x75')){_0x49c899[_0xdc68('0xae')](_0x49c899['campaigns'][_0x2b3252[_0x10ef30][_0xdc68('0xaf')]]);logger[_0xdc68('0x8e')]('[Dialer][checkChannel][ivr]',_0x1ed87a,_0x10ef30,_0x2b3252[_0x10ef30][_0xdc68('0xaf')]);delete _0x2b3252[_0x10ef30];}},0x2328);}});}});}}};Dialer['prototype']['countReScheduled']=function(_0x4c410a){return BPromise[_0xdc68('0xb0')]()[_0xdc68('0xb1')](cmHopper[_0xdc68('0xb2')](_0x4c410a))[_0xdc68('0xac')](loggerCatch(_0xdc68('0xb3')));};Dialer[_0xdc68('0x1c')]['checkIsBlackList']=function(_0x3d9eee){return BPromise[_0xdc68('0xb0')]()['then'](cmHopperBlack[_0xdc68('0xb4')](_0x3d9eee))[_0xdc68('0xac')](loggerCatch(_0xdc68('0xb5')));};Dialer[_0xdc68('0x1c')][_0xdc68('0xb6')]=function(_0x72ca32){return BPromise['resolve']()[_0xdc68('0xb1')](cmHopperBlack[_0xdc68('0xb6')](_0x72ca32))['catch'](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0xdc68('0x1c')][_0xdc68('0xb7')]=function(_0x21c047){return BPromise[_0xdc68('0xb0')]()[_0xdc68('0xb1')](cmHopperHistory['avgHandleTime'](_0x21c047))[_0xdc68('0xac')](loggerCatch('[averageHandleTime]\x20'));};Dialer['prototype'][_0xdc68('0xb8')]=function(_0x1743dd){return BPromise[_0xdc68('0xb0')]()[_0xdc68('0xb1')](cmHopper[_0xdc68('0xb8')](_0x1743dd))['catch'](loggerCatch(_0xdc68('0xb9')));};Dialer[_0xdc68('0x1c')][_0xdc68('0xba')]=function(_0x59ccaa,_0x44aed7,_0x475ead){return BPromise[_0xdc68('0xb0')]()[_0xdc68('0xb1')](cmHopper[_0xdc68('0xba')](_0x59ccaa,_0x44aed7,_0x475ead))[_0xdc68('0xac')](loggerCatch(_0xdc68('0xbb')));};Dialer[_0xdc68('0x1c')][_0xdc68('0xbc')]=function(_0x41ce4b,_0x5e10c4,_0x3c4da9,_0x27bc7b,_0x582b25){return BPromise['resolve']()['then'](cmHopper[_0xdc68('0xbc')](_0x41ce4b,_0x5e10c4,_0x3c4da9,_0x27bc7b))[_0xdc68('0xac')](function(_0x10df38){_0x582b25[_0xdc68('0xbd')]-=_0x3c4da9;_0x582b25[_0xdc68('0xbd')]=_0x582b25[_0xdc68('0xbd')]>0x0?_0x582b25[_0xdc68('0xbd')]:0x0;loggerCatch(_0xdc68('0xbe'))(_0x10df38);});};Dialer[_0xdc68('0x1c')][_0xdc68('0xbf')]=function(_0x4c1854,_0x219bfd,_0x172991,_0x49b10c){return BPromise['resolve']()['then'](cmHopper[_0xdc68('0xbf')](_0x4c1854,_0x219bfd,_0x172991))[_0xdc68('0xac')](function(_0x34d1b7){_0x49b10c[_0xdc68('0xbd')]-=_0x219bfd;_0x49b10c[_0xdc68('0xbd')]=_0x49b10c[_0xdc68('0xbd')]>0x0?_0x49b10c['temp']:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0x34d1b7);});};Dialer[_0xdc68('0x1c')][_0xdc68('0xc0')]=function(_0x550080){return BPromise[_0xdc68('0xb0')]()[_0xdc68('0xb1')](voiceQueueRt['getVoiceQueueRtPauses'](_0x550080))['catch'](loggerCatch(_0xdc68('0xc1')));};Dialer[_0xdc68('0x1c')][_0xdc68('0xc2')]=function(_0x368296){return BPromise[_0xdc68('0xb0')]()[_0xdc68('0xb1')](cmHopper[_0xdc68('0xc2')](_0x368296))[_0xdc68('0xac')](loggerCatch(_0xdc68('0xc3')));};Dialer[_0xdc68('0x1c')][_0xdc68('0xc4')]=function(_0x2e5e87){return BPromise[_0xdc68('0xb0')]()['then'](cmHopperHistory[_0xdc68('0xc4')](_0x2e5e87))[_0xdc68('0xac')](loggerCatch(_0xdc68('0xc5')));};Dialer[_0xdc68('0x1c')][_0xdc68('0xae')]=function(_0x1144bd){if(!_[_0xdc68('0x3c')](_0x1144bd)&&_0x1144bd!==null){if(typeof _0x1144bd['originated']!==_0xdc68('0x92')){if(_0x1144bd['originated']>0x0){_0x1144bd[_0xdc68('0x93')]-=0x1;}else{logger[_0xdc68('0x8e')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xdc68('0x8e')](_0xdc68('0xc6'));}};Dialer['prototype'][_0xdc68('0xc7')]=function(_0x2416d5,_0x10a516){var _0x593266=this;return function(_0x2d7ae9){_0x593266['updateOriginated'](_0x10a516);logger['error'](_0x2416d5,util[_0xdc68('0x90')](_0x2d7ae9,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0xdc68('0xc8')]=function(_0x3f1377,_0x3753b9,_0xd5161f){var _0x47dea3={'state':0x19,'statedesc':'notFound'};this[_0xdc68('0xae')](_0x3753b9);this[_0xdc68('0xc9')](_['merge'](_0x47dea3,_[_0xdc68('0xca')](_0xd5161f,[_0xdc68('0xcb'),_0xdc68('0xcc'),_0xdc68('0xcd'),_0xdc68('0xce'),_0xdc68('0xcf')])),_0xdc68('0xd0'),_0xdc68('0xd1'));logger['error'](_0x3f1377);};Dialer[_0xdc68('0x1c')]['isSuccess']=function(_0x4c0ddd){return _0x4c0ddd===_0xdc68('0xd2');};Dialer[_0xdc68('0x1c')][_0xdc68('0xd3')]=function(_0x5ec9e9){return!_[_0xdc68('0x3c')](_0x5ec9e9)&&_0x5ec9e9&&!_[_0xdc68('0x3c')](_0x5ec9e9[_0xdc68('0x3e')])&&!_['isUndefined'](_0x5ec9e9['active'])&&_0x5ec9e9['active']&&(this[_0xdc68('0x24')][util[_0xdc68('0x72')](_0xdc68('0xd4'),_0x5ec9e9[_0xdc68('0x3e')])]['status']===_0xdc68('0xd5')||this[_0xdc68('0x24')][util['format'](_0xdc68('0xd4'),_0x5ec9e9[_0xdc68('0x3e')])]['status']==='unmonitored');};Dialer[_0xdc68('0x1c')]['saveInDb']=function(_0x526ad1,_0x37ee30,_0x3ebe32){this[_0xdc68('0xc4')](_0x526ad1)[_0xdc68('0xac')](loggerCatch(_0x37ee30));this[_0xdc68('0xc2')](_0x526ad1)[_0xdc68('0xac')](loggerCatch(_0x3ebe32));};Dialer['prototype'][_0xdc68('0xd6')]=function(_0x528e45){var _0x29156d=this['uniqueId'][_0x528e45[_0xdc68('0xd7')]];var _0x56c96c;if(!_[_0xdc68('0xa8')](_0x528e45)&&!_['isNil'](_0x528e45[_0xdc68('0xd8')])&&!_[_0xdc68('0xa8')](_0x528e45[_0xdc68('0xd8')][_0xdc68('0xd9')])&&_0x528e45[_0xdc68('0xda')]===_0xdc68('0xdb')&&_0x29156d){if(_0x29156d['type']!==_0xdc68('0x75')&&this[_0xdc68('0x21')][_0x29156d['queue']][_0xdc68('0xdc')]&&_0x528e45[_0xdc68('0xdd')]===_0xdc68('0xde')){delete this[_0xdc68('0x27')][_0x528e45[_0xdc68('0xd7')]];this[_0xdc68('0xae')](this[_0xdc68('0x21')][_0x29156d[_0xdc68('0xaf')]]);this[_0xdc68('0x21')][_0x29156d['queue']][_0xdc68('0xdf')]+=0x1;this[_0xdc68('0x21')][_0x29156d[_0xdc68('0xaf')]][_0xdc68('0x59')]+=0x1;_0x56c96c=new Hangup(_0x29156d,_0x528e45);_0x56c96c['state']=0x12;_0x56c96c[_0xdc68('0xe0')]=_0xdc68('0xe1');_0x56c96c[_0xdc68('0xe2')]='AMD';ami['emit'](_0xdc68('0xe3'),ut[_0xdc68('0xe4')](_0x56c96c,_0xdc68('0xe5')));this[_0xdc68('0xc9')](_0x56c96c,'[syncHangupInAMD][createHistory]',_0xdc68('0xe6'));}if(_0x29156d[_0xdc68('0x4a')]!=='ivr'&&this['voiceQueues'][_0x29156d[_0xdc68('0xaf')]][_0xdc68('0xdc')]&&_0x528e45['value']===_0xdc68('0xe7')){var _0x5330e3=this;return new BPromise(function(_0x2c3713,_0x49df93){delete _0x5330e3[_0xdc68('0x27')][_0x528e45['uniqueid']];_0x5330e3[_0xdc68('0xae')](_0x5330e3['voiceQueues'][_0x29156d['queue']]);_0x5330e3[_0xdc68('0x21')][_0x29156d['queue']][_0xdc68('0xdf')]+=0x1;_0x5330e3[_0xdc68('0x21')][_0x29156d[_0xdc68('0xaf')]][_0xdc68('0x59')]+=0x1;var _0x1c368f=_0x5330e3[_0xdc68('0x21')][_0x29156d['queue']];var _0x38d8fa=new Hangup(_0x29156d,_0x528e45);_0x38d8fa[_0xdc68('0xe8')]=0x13;_0x38d8fa[_0xdc68('0xe0')]='Machine';_0x38d8fa['membername']='AMD';_0x38d8fa[_0xdc68('0xe9')]+=0x1;_0x38d8fa['countglobal']+=0x1;_0x38d8fa[_0xdc68('0xe5')]=!![];ami['emit'](_0xdc68('0xe3'),ut[_0xdc68('0xe4')](_0x38d8fa,_0xdc68('0xe5')));_0x5330e3[_0xdc68('0xc4')](_0x38d8fa)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x38d8fa[_0xdc68('0xea')]+_0x38d8fa[_0xdc68('0xeb')]+_0x38d8fa[_0xdc68('0xec')]+_0x38d8fa[_0xdc68('0xed')]+_0x38d8fa['countdropretry']+_0x38d8fa[_0xdc68('0xee')]+_0x38d8fa[_0xdc68('0xe9')]+_0x38d8fa['countagentrejectretry']>=_0x1c368f[_0xdc68('0xef')]){_0x5330e3[_0xdc68('0xf0')](_0x38d8fa,_0x2c3713,_0x49df93,_0xdc68('0xf1'));}else{if(_0x38d8fa[_0xdc68('0xe9')]>=_0x1c368f[_0xdc68('0xf2')]){_0x5330e3[_0xdc68('0xf3')](_0x38d8fa,_0x2c3713,_0x49df93,_0xdc68('0xf4'));}else{_0x5330e3[_0xdc68('0xb8')]({'active':![],'countmachineretry':_0x38d8fa[_0xdc68('0xe9')],'scheduledat':moment()[_0xdc68('0xf5')](_0x1c368f[_0xdc68('0xf6')],'minutes')[_0xdc68('0x72')](_0xdc68('0xf7')),'ContactId':_0x38d8fa[_0xdc68('0xcb')],'ListId':_0x38d8fa['ListId'],'VoiceQueueId':_0x38d8fa[_0xdc68('0xce')]||undefined,'CampaignId':_0x38d8fa[_0xdc68('0xcf')]||undefined})['catch'](loggerCatch(_0xdc68('0xf8')));_0x2c3713({'reschedule':0x1});}}});}if(_0x29156d[_0xdc68('0x4a')]===_0xdc68('0x75')&&this[_0xdc68('0x22')][_0x29156d[_0xdc68('0xaf')]]['dialAMDActive']&&_0x528e45[_0xdc68('0xdd')]===_0xdc68('0xde')){delete this[_0xdc68('0x27')][_0x528e45[_0xdc68('0xd7')]];this[_0xdc68('0xae')](this['campaigns'][_0x29156d[_0xdc68('0xaf')]]);_0x56c96c=new Hangup(_0x29156d,_0x528e45);_0x56c96c[_0xdc68('0xe8')]=0x12;_0x56c96c[_0xdc68('0xe0')]=_0xdc68('0xe1');_0x56c96c[_0xdc68('0xe2')]=_0xdc68('0xf9');ami[_0xdc68('0x49')]('custom:amd',ut['buildObj'](_0x56c96c,_0xdc68('0xe5')));this[_0xdc68('0xc9')](_0x56c96c,_0xdc68('0xfa'),'[syncHangupInAMDIvr]');}if(_0x29156d[_0xdc68('0x4a')]===_0xdc68('0x75')&&this[_0xdc68('0x22')][_0x29156d[_0xdc68('0xaf')]][_0xdc68('0xdc')]&&_0x528e45['value']===_0xdc68('0xe7')){var _0x5330e3=this;return new BPromise(function(_0x1e257d,_0x4eede5){delete _0x5330e3[_0xdc68('0x27')][_0x528e45[_0xdc68('0xd7')]];_0x5330e3[_0xdc68('0xae')](_0x5330e3[_0xdc68('0x22')][_0x29156d[_0xdc68('0xaf')]]);_0x5330e3[_0xdc68('0x22')][_0x29156d[_0xdc68('0xaf')]][_0xdc68('0xdf')]+=0x1;_0x5330e3[_0xdc68('0x22')][_0x29156d[_0xdc68('0xaf')]][_0xdc68('0x59')]+=0x1;var _0x4be654=_0x5330e3[_0xdc68('0x22')][_0x29156d[_0xdc68('0xaf')]];var _0x16181d=new Hangup(_0x29156d,_0x528e45);_0x16181d[_0xdc68('0xe8')]=0x13;_0x16181d[_0xdc68('0xe0')]='Machine';_0x16181d[_0xdc68('0xe2')]=_0xdc68('0xf9');_0x16181d[_0xdc68('0xe9')]+=0x1;_0x16181d[_0xdc68('0xfb')]+=0x1;_0x16181d[_0xdc68('0xe5')]=!![];ami[_0xdc68('0x49')]('custom:amd',ut['buildObj'](_0x16181d,_0xdc68('0xe5')));_0x5330e3[_0xdc68('0xc4')](_0x16181d)[_0xdc68('0xac')](loggerCatch(_0xdc68('0xfc')));if(_0x16181d['countbusyretry']+_0x16181d[_0xdc68('0xeb')]+_0x16181d[_0xdc68('0xec')]+_0x16181d[_0xdc68('0xed')]+_0x16181d[_0xdc68('0xfd')]+_0x16181d[_0xdc68('0xee')]+_0x16181d['countmachineretry']+_0x16181d[_0xdc68('0xfe')]>=_0x4be654[_0xdc68('0xef')]){_0x5330e3[_0xdc68('0xf0')](_0x16181d,_0x1e257d,_0x4eede5,'reason19\x20machine....');}else{if(_0x16181d[_0xdc68('0xe9')]>=_0x4be654['dialMachineMaxRetry']){_0x5330e3[_0xdc68('0xf3')](_0x16181d,_0x1e257d,_0x4eede5,_0xdc68('0xf4'));}else{_0x5330e3[_0xdc68('0xb8')]({'active':![],'countmachineretry':_0x16181d[_0xdc68('0xe9')],'scheduledat':moment()['add'](_0x4be654[_0xdc68('0xf6')],_0xdc68('0xff'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x16181d[_0xdc68('0xcb')],'ListId':_0x16181d[_0xdc68('0xcc')],'VoiceQueueId':_0x16181d['VoiceQueueId']||undefined,'CampaignId':_0x16181d[_0xdc68('0xcf')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x1e257d({'reschedule':0x1});}}});}}};Dialer['prototype'][_0xdc68('0x100')]=function(_0x354d9d){var _0x4fb0d7=this[_0xdc68('0x27')][_0x354d9d[_0xdc68('0xd7')]];var _0x62bb7=this;var _0x339e29;if(_0x4fb0d7&&_0x4fb0d7['type']===_0xdc68('0x75')){delete this[_0xdc68('0x27')][_0x354d9d[_0xdc68('0xd7')]];this[_0xdc68('0xae')](this[_0xdc68('0x22')][_0x4fb0d7[_0xdc68('0xaf')]]);this[_0xdc68('0x22')][_0x4fb0d7['queue']][_0xdc68('0x101')]+=0x1;_0x339e29=new Hangup(_0x4fb0d7,_0x354d9d);this[_0xdc68('0xc4')](_0x339e29)[_0xdc68('0xac')](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x339e29)[_0xdc68('0xac')](loggerCatch(_0xdc68('0x102')));}if(_0x4fb0d7&&_0x4fb0d7[_0xdc68('0x4a')]!==_0xdc68('0x75')&&isNotNull(this[_0xdc68('0x21')][_0x4fb0d7[_0xdc68('0xaf')]][_0xdc68('0x103')])){delete this[_0xdc68('0x27')][_0x354d9d[_0xdc68('0xd7')]];this[_0xdc68('0xae')](this['voiceQueues'][_0x4fb0d7['queue']]);this['voiceQueues'][_0x4fb0d7['queue']][_0xdc68('0xdf')]+=0x1;this[_0xdc68('0x21')][_0x4fb0d7['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x339e29=new Hangup(_0x4fb0d7,_0x354d9d);_0x339e29[_0xdc68('0xe8')]=0x10;_0x339e29[_0xdc68('0xe0')]='AnswerAGI';_0x339e29['membername']=_0xdc68('0x104');this[_0xdc68('0xc4')](_0x339e29)[_0xdc68('0xac')](loggerCatch(_0xdc68('0x105')));this[_0xdc68('0xc2')](_0x339e29)[_0xdc68('0xac')](loggerCatch(_0xdc68('0x102')));}if(_0x4fb0d7&&_0x4fb0d7[_0xdc68('0x4a')]!==_0xdc68('0x75')&&!isNotNull(this['voiceQueues'][_0x4fb0d7[_0xdc68('0xaf')]][_0xdc68('0x103')])){delete this['uniqueId'][_0x354d9d[_0xdc68('0xd7')]];this['updateOriginated'](this[_0xdc68('0x21')][_0x4fb0d7[_0xdc68('0xaf')]]);this[_0xdc68('0x21')][_0x4fb0d7[_0xdc68('0xaf')]][_0xdc68('0x106')]+=0x1;_0x339e29=new Hangup(_0x4fb0d7,_0x354d9d);_0x339e29[_0xdc68('0xe8')]=0xc;_0x339e29[_0xdc68('0xe0')]=_0x354d9d[_0xdc68('0x107')];_0x339e29['membername']=_0xdc68('0x108');this['createHistory'](_0x339e29)[_0xdc68('0xac')](loggerCatch(_0xdc68('0x105')));this[_0xdc68('0xc2')](_0x339e29)[_0xdc68('0xac')](loggerCatch(_0xdc68('0x102')));}};Dialer[_0xdc68('0x1c')][_0xdc68('0x32')]=function(_0x23c277){var _0x142072=this['uniqueId'][_0x23c277[_0xdc68('0xd7')]];var _0x54e577=this;if(this['voiceQueues'][_0x23c277['queue']]){if(_0x142072&&_0x142072[_0xdc68('0x4a')]!==_0xdc68('0x75')){delete this[_0xdc68('0x27')][_0x23c277[_0xdc68('0xd7')]];this[_0xdc68('0x21')][_0x23c277['queue']][_0xdc68('0xdf')]+=0x1;var _0xf2a51a=new AgentComplete(_0x142072,_0x23c277);if(_0x23c277[_0xdc68('0x109')]==='agent'){_0xf2a51a[_0xdc68('0x10a')]=this[_0xdc68('0x21')][_0x23c277[_0xdc68('0xaf')]][_0xdc68('0x10b')]&&this[_0xdc68('0x21')][_0x23c277[_0xdc68('0xaf')]][_0xdc68('0x10c')]?moment()[_0xdc68('0x72')](_0xdc68('0xf7')):undefined;}this[_0xdc68('0xc4')](_0xf2a51a)[_0xdc68('0xac')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0xdc68('0xc2')](_0xf2a51a)[_0xdc68('0xac')](loggerCatch(_0xdc68('0x10d')));}}};Dialer['prototype'][_0xdc68('0x2e')]=function(_0x4ff401){if(this['voiceQueues'][_0x4ff401[_0xdc68('0xaf')]]){if(this[_0xdc68('0x27')][_0x4ff401['uniqueid']]&&this[_0xdc68('0x27')][_0x4ff401['uniqueid']][_0xdc68('0x4a')]!==_0xdc68('0x75')){this['updateOriginated'](this[_0xdc68('0x21')][_0x4ff401[_0xdc68('0xaf')]]);this[_0xdc68('0x27')][_0x4ff401[_0xdc68('0xd7')]][_0xdc68('0x10e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0xdc68('0x1c')]['queueCallerAbandonCreateState']=function(_0x2f35d5){this['createHistory'](_0x2f35d5)['catch'](loggerCatch(_0xdc68('0x10f')));this[_0xdc68('0xc2')](_0x2f35d5)[_0xdc68('0xac')](loggerCatch(_0xdc68('0x110')));};Dialer[_0xdc68('0x1c')][_0xdc68('0x111')]=function(_0x2ebfa6){var _0x20792d=this['uniqueId'][_0x2ebfa6['uniqueid']];var _0x2bac66=this;if(this[_0xdc68('0x21')][_0x2ebfa6[_0xdc68('0xaf')]]){if(_0x20792d&&_0x20792d[_0xdc68('0x4a')]!==_0xdc68('0x75')){delete this[_0xdc68('0x27')][_0x2ebfa6[_0xdc68('0xd7')]];this[_0xdc68('0xae')](this[_0xdc68('0x21')][_0x2ebfa6['queue']]);_0x20792d[_0xdc68('0x112')]=moment()[_0xdc68('0x72')]('YYYY-MM-DD\x20HH:mm:ss');var _0x152f75=new QueueCallerAbandon(_0x20792d,_0x2ebfa6);if(getSeconds(_0x20792d[_0xdc68('0x112')],_0x20792d['responsetime'])>=_0x20792d[_0xdc68('0x113')]){this[_0xdc68('0x21')][_0x2ebfa6[_0xdc68('0xaf')]][_0xdc68('0x66')]+=0x1;this[_0xdc68('0x21')][_0x2ebfa6[_0xdc68('0xaf')]][_0xdc68('0x114')]+=0x1;this['voiceQueues'][_0x2ebfa6[_0xdc68('0xaf')]][_0xdc68('0x115')]+=0x1;_0x152f75[_0xdc68('0xe8')]=0xa;_0x152f75['statedesc']=_0xdc68('0x116');_0x152f75[_0xdc68('0x117')]='TIMEOUT';_0x152f75[_0xdc68('0x10a')]=this['voiceQueues'][_0x2ebfa6['queue']][_0xdc68('0x10b')]?moment()[_0xdc68('0x72')](_0xdc68('0xf7')):undefined;_0x152f75[_0xdc68('0xfd')]+=0x1;_0x152f75[_0xdc68('0xfb')]+=0x1;if(_0x152f75[_0xdc68('0xfd')]>=this['voiceQueues'][_0x2ebfa6[_0xdc68('0xaf')]][_0xdc68('0x118')]){this[_0xdc68('0x119')](_0x152f75);}else{this[_0xdc68('0xb8')]({'active':![],'countdropretry':_0x152f75[_0xdc68('0xfd')],'scheduledat':moment()['add'](this[_0xdc68('0x21')][_0x2ebfa6['queue']][_0xdc68('0x11a')],'minutes')['format'](_0xdc68('0xf7')),'ContactId':_0x20792d['ContactId'],'ListId':_0x20792d[_0xdc68('0xcc')],'VoiceQueueId':_0x20792d['VoiceQueueId']||undefined,'CampaignId':_0x20792d[_0xdc68('0xcf')]||undefined})['catch'](loggerCatch(_0xdc68('0x11b')));var _0xd38eb4=new History(_0x152f75);_0xd38eb4[_0xdc68('0xe8')]=0xa;_0xd38eb4[_0xdc68('0xe0')]=_0xdc68('0x116');_0xd38eb4[_0xdc68('0xa4')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0xd38eb4[_0xdc68('0xa3')]=_0xd38eb4['starttime'];_0xd38eb4[_0xdc68('0x11c')]=_0x152f75['calleridname'];_0xd38eb4[_0xdc68('0x11d')]=_0x152f75[_0xdc68('0x11d')];this[_0xdc68('0xc4')](_0xd38eb4)[_0xdc68('0xac')](loggerCatch(_0xdc68('0x11e')));}}else{this['voiceQueues'][_0x2ebfa6[_0xdc68('0xaf')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this['voiceQueues'][_0x2ebfa6['queue']][_0xdc68('0x5d')]+=0x1;_0x152f75['state']=0xb;_0x152f75[_0xdc68('0xe0')]='Abandoned';_0x152f75['dropreason']=_0xdc68('0x11f');_0x152f75[_0xdc68('0xee')]+=0x1;_0x152f75[_0xdc68('0xfb')]+=0x1;if(_0x152f75[_0xdc68('0xee')]>=this[_0xdc68('0x21')][_0x2ebfa6[_0xdc68('0xaf')]][_0xdc68('0x120')]){this[_0xdc68('0x119')](_0x152f75);}else{this[_0xdc68('0xb8')]({'active':![],'countabandonedretry':_0x152f75[_0xdc68('0xee')],'scheduledat':moment()[_0xdc68('0xf5')](this[_0xdc68('0x21')][_0x2ebfa6[_0xdc68('0xaf')]][_0xdc68('0x121')],_0xdc68('0xff'))[_0xdc68('0x72')](_0xdc68('0xf7')),'ContactId':_0x20792d['ContactId'],'ListId':_0x20792d[_0xdc68('0xcc')],'VoiceQueueId':_0x20792d[_0xdc68('0xce')]||undefined,'CampaignId':_0x20792d[_0xdc68('0xcf')]||undefined})[_0xdc68('0xac')](loggerCatch(_0xdc68('0x122')));var _0xd38eb4=new History(_0x152f75);_0xd38eb4[_0xdc68('0xe8')]=0xb;_0xd38eb4[_0xdc68('0xe0')]=_0xdc68('0x123');_0xd38eb4[_0xdc68('0xa4')]=moment()['format'](_0xdc68('0xf7'));_0xd38eb4['endtime']=_0xd38eb4[_0xdc68('0xa4')];_0xd38eb4[_0xdc68('0x11c')]=_0x152f75[_0xdc68('0x11c')];_0xd38eb4[_0xdc68('0x11d')]=_0x152f75[_0xdc68('0x11d')];this[_0xdc68('0xc4')](_0xd38eb4)[_0xdc68('0xac')](loggerCatch('[syncAgentComplete][createHistory][11]'));}}}}};Dialer[_0xdc68('0x1c')][_0xdc68('0x36')]=function(_0x769c9d){if(this['actions'][_0x769c9d['uniqueid']]){this[_0xdc68('0xa7')][_0x769c9d[_0xdc68('0xd7')]][_0xdc68('0xab')]=_0x769c9d['channel'];}if(this[_0xdc68('0x27')][_0x769c9d['uniqueid']]){this[_0xdc68('0x27')][_0x769c9d[_0xdc68('0xd7')]][_0xdc68('0xab')]=_0x769c9d['channel'];}};Dialer[_0xdc68('0x1c')][_0xdc68('0x124')]=function(_0x368412){if(strategy[this['voiceQueues'][this[_0xdc68('0xa7')][_0x368412[_0xdc68('0x125')]][_0xdc68('0xaf')]][_0xdc68('0x126')]]===_0xdc68('0x1b')){if(this[_0xdc68('0xa7')][_0x368412[_0xdc68('0x125')]]&&_[_0xdc68('0xa8')](this[_0xdc68('0xa7')][_0x368412[_0xdc68('0x125')]]['locked'])&&_0x368412[_0xdc68('0xaa')]==='1'&&_0x368412['paused']==='0'){if(this[_0xdc68('0x23')][_0x368412['stateinterface']]){if(!this[_0xdc68('0x23')][_0x368412[_0xdc68('0x127')]][_0xdc68('0x128')]){this[_0xdc68('0x23')][_0x368412[_0xdc68('0x127')]][_0xdc68('0x128')]=!![];this[_0xdc68('0xa7')][_0x368412[_0xdc68('0x125')]][_0xdc68('0x128')]=!![];this[_0xdc68('0xa7')][_0x368412[_0xdc68('0x125')]][_0xdc68('0x127')]=_0x368412[_0xdc68('0x127')];}}}}else if((strategy[this['voiceQueues'][this['actions'][_0x368412[_0xdc68('0x125')]][_0xdc68('0xaf')]][_0xdc68('0x126')]]||_0xdc68('0x1a'))===_0xdc68('0x1a')){if(this['actions'][_0x368412[_0xdc68('0x125')]]){if(this[_0xdc68('0x23')][_0x368412[_0xdc68('0x127')]]){this[_0xdc68('0xa7')][_0x368412[_0xdc68('0x125')]][_0xdc68('0x127')]=_0x368412[_0xdc68('0x127')];if(_['isNil'](this[_0xdc68('0x2b')][this[_0xdc68('0xa7')][_0x368412[_0xdc68('0x125')]][_0xdc68('0xaf')]])){this[_0xdc68('0x2b')][this[_0xdc68('0xa7')][_0x368412[_0xdc68('0x125')]][_0xdc68('0xaf')]]=[];}this[_0xdc68('0x2b')][this[_0xdc68('0xa7')][_0x368412['actionid']][_0xdc68('0xaf')]][_0xdc68('0x129')](_['merge'](_[_0xdc68('0xca')](this[_0xdc68('0xa7')][_0x368412[_0xdc68('0x125')]],[_0xdc68('0x12a'),_0xdc68('0x127')]),{'status':_0x368412[_0xdc68('0xaa')],'paused':_0x368412['paused']}));}}}};function unlockQueueStatus(_0x4b9822,_0x41ceda){setTimeout(function(){if(_['isUndefined'](_0x4b9822['queueStatusComplete'])){loggerBooked[_0xdc68('0x8e')](_0xdc68('0x12b'),_0x41ceda);}_0x4b9822[_0xdc68('0x12c')]=!![];loggerBooked[_0xdc68('0x78')](_0xdc68('0x12d'),_0x41ceda,JSON[_0xdc68('0x46')](_['pick'](_0x4b9822,[_0xdc68('0x3e'),'queueStatusComplete'])));},0x1f3);}Dialer[_0xdc68('0x1c')]['syncQueueStatusComplete']=function(_0x462e87){var _0x5ead6d=this;var _0x1304d2=_0x5ead6d[_0xdc68('0x21')][_0x5ead6d['actions'][_0x462e87[_0xdc68('0x125')]][_0xdc68('0xaf')]];if(strategy[this[_0xdc68('0x21')][this['actions'][_0x462e87['actionid']][_0xdc68('0xaf')]][_0xdc68('0x126')]]===_0xdc68('0x1b')){if(this['actions'][_0x462e87[_0xdc68('0x125')]]&&this['actions'][_0x462e87[_0xdc68('0x125')]]['stateinterface']){this[_0xdc68('0x20')][_0xdc68('0x12e')](this[_0xdc68('0xa7')][_0x462e87[_0xdc68('0x125')]][_0xdc68('0x12a')],this['actions'][_0x462e87[_0xdc68('0x125')]]['stateinterface'])[_0xdc68('0xac')](function(_0x6ae75f){logger[_0xdc68('0x8e')](_0xdc68('0x12f'),util['inspect'](_0x6ae75f,{'showHidden':![],'depth':null}));})[_0xdc68('0x130')](function(){_0x5ead6d['updateOriginated'](_0x5ead6d[_0xdc68('0x21')][_0x5ead6d['actions'][_0x462e87['actionid']][_0xdc68('0xaf')]]);_0x5ead6d[_0xdc68('0x23')][_0x5ead6d[_0xdc68('0xa7')][_0x462e87[_0xdc68('0x125')]][_0xdc68('0x127')]][_0xdc68('0x128')]=![];delete _0x5ead6d[_0xdc68('0xa7')][_0x462e87[_0xdc68('0x125')]];unlockQueueStatus(_0x1304d2);});}else{this['updateOriginated'](this[_0xdc68('0x21')][this[_0xdc68('0xa7')][_0x462e87[_0xdc68('0x125')]][_0xdc68('0xaf')]]);this[_0xdc68('0xb8')]({'active':![],'ContactId':this['actions'][_0x462e87[_0xdc68('0x125')]][_0xdc68('0xcb')],'ListId':this['actions'][_0x462e87[_0xdc68('0x125')]][_0xdc68('0xcc')],'VoiceQueueId':this[_0xdc68('0xa7')][_0x462e87[_0xdc68('0x125')]][_0xdc68('0xce')]||undefined,'CampaignId':this['actions'][_0x462e87[_0xdc68('0x125')]]['CampaignId']||undefined})[_0xdc68('0xac')](loggerCatch(_0xdc68('0x131')));delete this[_0xdc68('0xa7')][_0x462e87['actionid']];unlockQueueStatus(_0x1304d2);}}else if((strategy[this[_0xdc68('0x21')][this[_0xdc68('0xa7')][_0x462e87['actionid']][_0xdc68('0xaf')]][_0xdc68('0x126')]]||_0xdc68('0x1a'))==='rrmemory'){var _0x435964;if(this[_0xdc68('0xa7')][_0x462e87[_0xdc68('0x125')]]&&!_['isEmpty'](this['queueBooked'][this[_0xdc68('0xa7')][_0x462e87['actionid']]['queue']])){if(this[_0xdc68('0x2c')][_0x5ead6d['actions'][_0x462e87[_0xdc68('0x125')]]['queue']]){this[_0xdc68('0x2c')][_0x5ead6d[_0xdc68('0xa7')][_0x462e87[_0xdc68('0x125')]]['queue']]=this[_0xdc68('0x2c')][this[_0xdc68('0xa7')][_0x462e87['actionid']]['queue']]?this[_0xdc68('0x2c')][this['actions'][_0x462e87['actionid']][_0xdc68('0xaf')]]:this[_0xdc68('0x2b')][this[_0xdc68('0xa7')][_0x462e87[_0xdc68('0x125')]][_0xdc68('0xaf')]]?this['queueBooked'][this[_0xdc68('0xa7')][_0x462e87[_0xdc68('0x125')]][_0xdc68('0xaf')]][_0xdc68('0x132')]||0x0:0x0;}this[_0xdc68('0x2b')][this[_0xdc68('0xa7')][_0x462e87[_0xdc68('0x125')]]['queue']][_0xdc68('0x132')]=this[_0xdc68('0x2c')][this[_0xdc68('0xa7')][_0x462e87[_0xdc68('0x125')]][_0xdc68('0xaf')]];for(var _0x2eb3a7=0x0;_0x2eb3a7=0x0;})[_0xdc68('0xac')](myreject(_0x5361c9)));}}else{_0x16af99[_0xdc68('0x129')](ami['Action']({'action':_0xdc68('0x149'),'command':util[_0xdc68('0x72')](_0xdc68('0x146'),_0x1190e9,!_[_0xdc68('0x3c')](config['timezones'][_0x2b0aac])?_0x2b0aac:'')})['then'](function(_0x2f8f8d){return _0x2f8f8d[_0xdc68('0x148')][_0xdc68('0x14a')](_0xdc68('0x14b'))>=0x0;})[_0xdc68('0xac')](myreject(_0x5361c9)));}BPromise['all'](_0x16af99)[_0xdc68('0xb1')](function(_0x3ba155){var _0xd9ee5f=_[_0xdc68('0x14c')](_0x3ba155);if(_0xd9ee5f){return _0x2bd0bb(_0xd9ee5f);}else{_0xd3f9f3[_0xdc68('0x3d')]=_0x191ab4?'GLOBAL_INTERVAL_IS_OVERTIME':_0xdc68('0x14d');return _0x5361c9(msgResponse(_0xdc68('0x14e'),'Failure',_0xdc68('0x14f')+_0x191ab4+'\x20'+_0x470be7+_0xdc68('0x150')+util[_0xdc68('0x90')](_0x1190e9,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x2b0aac));}})['catch'](function(_0x166692){return _0x5361c9(msgResponse(_0xdc68('0x13e'),'Failure',JSON[_0xdc68('0x46')](_0x166692)));});});};Dialer[_0xdc68('0x1c')][_0xdc68('0x151')]=function(_0x34df0e){var _0xd83156=this;return function(){switch(_0x34df0e[_0xdc68('0x56')]){case _0xdc68('0x152'):freeVariablesPredictive(_0x34df0e);_0xd83156[_0xdc68('0x153')](_0x34df0e,0x1);break;case _0xdc68('0x154'):freeVariablesPredictive(_0x34df0e);_0xd83156[_0xdc68('0x153')](_0x34df0e,_0x34df0e['dialPowerLevel']);break;case'predictive':_0xd83156['predictive'](_0x34df0e);break;case'booked':freeVariablesPredictive(_0x34df0e);_0xd83156[_0xdc68('0x153')](_0x34df0e,0x1);break;default:freeVariablesPredictive(_0x34df0e);logger['error'](_0xdc68('0x155'),_0x34df0e[_0xdc68('0x3e')],_0xdc68('0x156'));}};};Dialer[_0xdc68('0x1c')][_0xdc68('0x157')]=function(_0x357291){var _0x1024d6=this;return function(){_0x1024d6[_0xdc68('0x158')](_0x357291);};};Dialer[_0xdc68('0x1c')][_0xdc68('0xb')]=function(_0x1b2187){var _0x30e38a=this;if(isNotPreview(_0x1b2187[_0xdc68('0x56')])){if(isVoiceQueueOutbound(_0x1b2187[_0xdc68('0x4a')])&&isActive(_0x1b2187[_0xdc68('0x55')])){_0x1b2187[_0xdc68('0x9c')]=!![];BPromise['resolve']()['then'](checkIsLoggedIn(_0x1b2187,_0x1b2187[_0xdc68('0x4b')]))['then'](checkIsActive(_0x1b2187,_0x1b2187[_0xdc68('0x55')]))['then'](checkInterval(_0x1b2187))[_0xdc68('0xb1')](_0x30e38a[_0xdc68('0x13c')](_0x1b2187))[_0xdc68('0xb1')](_0x30e38a[_0xdc68('0x159')](_0x1b2187[_0xdc68('0x15a')],_0x1b2187[_0xdc68('0x15b')],_0x1b2187[_0xdc68('0x3e')],_0x1b2187))['then'](_0x30e38a[_0xdc68('0x15c')](_0x1b2187['Interval'],_0x1b2187[_0xdc68('0x15b')],_0x1b2187[_0xdc68('0x3e')],_0x1b2187))[_0xdc68('0xb1')](_0x30e38a['checkDialMethod'](_0x1b2187))['catch'](loggerCatchQueueSummary(_0xdc68('0x15d'),_0x1b2187));}else{notSendMessagesQueue(_0x1b2187);}}else{freeVariablesPredictive(_0x1b2187);}};Dialer['prototype'][_0xdc68('0x13b')]=function(){var _0x55b661=this;var _0x52700c;for(var _0x230e2e in this[_0xdc68('0x22')]){if(typeof this[_0xdc68('0x22')][_0x230e2e]!=='undefined'){_0x52700c=this['campaigns'][_0x230e2e];if(isCampaignIvr(_0x52700c[_0xdc68('0x4a')])&&isActive(_0x52700c['active'])){_0x52700c[_0xdc68('0x9c')]=!![];BPromise[_0xdc68('0xb0')]()['then'](checkIsActive(_0x52700c,_0x52700c['active']))[_0xdc68('0xb1')](checkInterval(_0x52700c))[_0xdc68('0xb1')](_0x55b661[_0xdc68('0x13c')](_0x52700c))[_0xdc68('0xb1')](_0x55b661['checkIfTime'](_0x52700c[_0xdc68('0x15a')],_0x52700c[_0xdc68('0x15b')],_0x52700c[_0xdc68('0x3e')],_0x52700c))['then'](_0x55b661[_0xdc68('0x15c')](_0x52700c[_0xdc68('0x41')],_0x52700c[_0xdc68('0x15b')],_0x52700c[_0xdc68('0x3e')],_0x52700c))[_0xdc68('0xb1')](_0x55b661[_0xdc68('0x157')](_0x52700c))[_0xdc68('0xac')](loggerCatchQueueSummary(_0xdc68('0x15e'),_0x52700c));}else{notSendMessagesCampaign(_0x52700c);}}}};function getCallerIdRandom(_0x289195,_0x4b9a02){var _0x41f304;var _0x3926c3;var _0x239b09;if(_0x4b9a02<=0x0){_0x4b9a02=0x1;}_0x41f304=new RegExp(_0xdc68('0x15f')+_0x4b9a02+'}$');_0x3926c3=Math[_0xdc68('0x160')](0xa,_0x4b9a02-0x1);_0x239b09=Math[_0xdc68('0x160')](0xa,_0x4b9a02)-0x1;return util[_0xdc68('0x72')]('%s',_[_0xdc68('0x161')](_0x289195,_0x41f304,_[_0xdc68('0x162')](_0x3926c3,_0x239b09)));}function extractCalleridName(_0x824e5c){var _0x326c54=_0x824e5c[_0xdc68('0x163')](/"(.*?)"/);return _0x326c54?_0x326c54[0x1]:_0x824e5c;}function extractCalleridNumber(_0x2bcb43){var _0x7aadd0=_0x2bcb43[_0xdc68('0x163')](/<(.*?)>/);return _0x7aadd0?_0x7aadd0[0x1]:_0x2bcb43;}Dialer[_0xdc68('0x1c')][_0xdc68('0x164')]=function(_0x1383e4,_0x484cb2){var _0x45c083=this;var _0x5d94ae=uuid['v4']();this[_0xdc68('0xa7')][_0x5d94ae]=new Action(_0x1383e4,_0x484cb2,_0x5d94ae);return new BPromise(function(_0x5f3bcd,_0x2450e3){if(_[_0xdc68('0x3c')](_0x1383e4)&&typeof _0x1383e4!==_0xdc68('0x165')){return _0x2450e3(msgResponse(_0xdc68('0x166'),_0xdc68('0x13f'),'voiceQueue\x20is\x20undefine'));}if(_[_0xdc68('0x3c')](_0x484cb2[_0xdc68('0x167')]['phone'])||_0x484cb2[_0xdc68('0x167')][_0xdc68('0x168')]===null){return _0x2450e3(msgResponse(_0xdc68('0x166'),_0xdc68('0x13f'),_0xdc68('0x169')));}var _0x21f39d={'XMD-CALLERID':_0x45c083['actions'][_0x5d94ae][_0xdc68('0x16a')](),'XMD-AGI':_0x1383e4['dialQueueProject']?util[_0xdc68('0x72')](_0xdc68('0x16b'),ipAgi,_0x1383e4['dialQueueProject']):_0xdc68('0x16c'),'XMD-AGIAFTER':_0x1383e4['dialQueueProject2']?util['format'](_0xdc68('0x16b'),ipAgi,_0x1383e4['dialQueueProject2']):_0xdc68('0x16c'),'XMD-QUEUE':_0x1383e4['type']===_0xdc68('0x16d')?util[_0xdc68('0x72')](_0xdc68('0x16e'),_0x1383e4['name'],_0x1383e4[_0xdc68('0x16f')]||'',_0x1383e4[_0xdc68('0x10c')]?'c':'',_0x1383e4[_0xdc68('0x113')]||0x3):'NONE','XMD-CONTACTID':_0x484cb2[_0xdc68('0xcb')],'XMD-CDRTYPE':_0xdc68('0x7'),'CALLERID(all)':_0x45c083[_0xdc68('0xa7')][_0x5d94ae][_0xdc68('0x16a')](),'XMD-AMD':_0x1383e4[_0xdc68('0xdc')]?'ACTIVE':_0xdc68('0x16c'),'XMD-DESTINATION':_0xdc68('0xdb')};if(_0x1383e4[_0xdc68('0xdc')]){_0x21f39d['XMD-AMDINITIALSILENCE']=_0x1383e4[_0xdc68('0x170')]||0x9c4;_0x21f39d[_0xdc68('0x171')]=_0x1383e4[_0xdc68('0x172')]||0x5dc;_0x21f39d[_0xdc68('0x173')]=_0x1383e4[_0xdc68('0x174')]||0x320;_0x21f39d['XMD-AMDTOTALANALYSISTIME']=_0x1383e4[_0xdc68('0x175')]||0x1388;_0x21f39d[_0xdc68('0x176')]=_0x1383e4[_0xdc68('0x177')]||0x64;_0x21f39d['XMD-AMDBETWEENWORDSSILENCE']=_0x1383e4['dialAMDBetweenWordsSilence']||0x32;_0x21f39d[_0xdc68('0x178')]=_0x1383e4[_0xdc68('0x179')]||0x3;_0x21f39d[_0xdc68('0x17a')]=_0x1383e4[_0xdc68('0x17b')]||0x100;_0x21f39d[_0xdc68('0x17c')]=_0x1383e4[_0xdc68('0x17d')]||0x1388;}if(_0x1383e4['type']===_0xdc68('0x16d')){_0x21f39d[_0xdc68('0x17e')]=_0x484cb2['VoiceQueueId'];}else{_0x21f39d[_0xdc68('0x17f')]=_0x484cb2[_0xdc68('0xcf')];}for(var _0x461bc0 in _0x484cb2[_0xdc68('0x167')]){if(typeof _0x484cb2[_0xdc68('0x167')][_0x461bc0]!=='undefined'){if(isNotNull(_0x484cb2['Contact'][_0x461bc0])&&_0x461bc0!=='id'&&_0x461bc0!=='tags'&&_0x461bc0!==_0xdc68('0x180')&&_0x461bc0!=='updatedAt'){_0x21f39d[util[_0xdc68('0x72')](_0xdc68('0x181'),_0xdc68('0x182'),_[_0xdc68('0x183')](_0x461bc0))]=_0x484cb2[_0xdc68('0x167')][_0x461bc0];}}}var _0x24351=_0x45c083[_0xdc68('0xd3')](_0x1383e4[_0xdc68('0x70')])?getCallerId(_0x1383e4[_0xdc68('0x70')]['callerid'],_0x1383e4[_0xdc68('0x184')],_0x1383e4[_0xdc68('0x185')]>0x0?getCallerIdRandom(_0x1383e4['dialOriginateCallerIdNumber'],_0x1383e4[_0xdc68('0x185')]):_0x1383e4[_0xdc68('0x186')]):getCallerId(_['isNil'](_0x1383e4[_0xdc68('0x187')])?_0x1383e4[_0xdc68('0x70')][_0xdc68('0x71')]:_0x1383e4['TrunkBackup']['callerid'],_0x1383e4['dialOriginateCallerIdName'],_0x1383e4['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x1383e4[_0xdc68('0x186')],_0x1383e4[_0xdc68('0x185')]):_0x1383e4['dialOriginateCallerIdNumber']);if(_0x24351){_0x21f39d[_0xdc68('0x188')]=_0x45c083['actions'][_0x5d94ae][_0xdc68('0x189')]=extractCalleridName(_0x24351);_0x21f39d[_0xdc68('0x18a')]=_0x45c083['actions'][_0x5d94ae][_0xdc68('0x18b')]=extractCalleridNumber(_0x24351);}return ami[_0xdc68('0xa9')]({'actionid':_0x5d94ae,'action':_0xdc68('0x166'),'channel':_0x45c083['isTrunkReachable'](_0x1383e4['Trunk'])?util[_0xdc68('0x72')](_0xdc68('0x18c'),_0x1383e4[_0xdc68('0x70')][_0xdc68('0x3e')],isNotNull(_0x1383e4[_0xdc68('0x58')])?_0x1383e4['dialPrefix'][_0xdc68('0x18d')]()||'':'',_0x1383e4[_0xdc68('0x18e')]>0x0?_0x484cb2[_0xdc68('0x167')][_0xdc68('0x168')]['substring'](_0x1383e4['dialCutDigit']):_0x484cb2[_0xdc68('0x167')][_0xdc68('0x168')]):util[_0xdc68('0x72')](_0xdc68('0x18c'),_[_0xdc68('0xa8')](_0x1383e4[_0xdc68('0x187')])?_0x1383e4[_0xdc68('0x70')][_0xdc68('0x3e')]:_0x1383e4[_0xdc68('0x187')][_0xdc68('0x3e')],isNotNull(_0x1383e4['dialPrefix'])?_0x1383e4[_0xdc68('0x58')][_0xdc68('0x18d')]()||'':'',_0x1383e4[_0xdc68('0x18e')]>0x0?_0x484cb2[_0xdc68('0x167')][_0xdc68('0x168')][_0xdc68('0x18f')](_0x1383e4[_0xdc68('0x18e')]):_0x484cb2[_0xdc68('0x167')][_0xdc68('0x168')]),'callerid':_0x24351,'Exten':'xcally-motion-dialer','Context':_0xdc68('0x190'),'Priority':'1','variable':_0x21f39d,'timeout':(_0x1383e4['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x5d94ae})[_0xdc68('0xb1')](function(_0x336e45){return _0x5f3bcd(_0x336e45);})[_0xdc68('0xac')](function(_0x5a0306){_0x1383e4['outboundOriginateFailureCallsDay']+=0x1;var _0x5c4024=new History(_0x45c083[_0xdc68('0xa7')][_0x5d94ae]);logger[_0xdc68('0x8e')](util[_0xdc68('0x72')]('[originateError]:\x20%s',JSON[_0xdc68('0x46')](_0x5a0306)));_0x5c4024[_0xdc68('0xe8')]=0xe;_0x5c4024['statedesc']=_0xdc68('0x191');_0x5c4024[_0xdc68('0xa4')]=moment()[_0xdc68('0x72')](_0xdc68('0xf7'));_0x5c4024[_0xdc68('0xa3')]=_0x5c4024[_0xdc68('0xa4')];_0x45c083[_0xdc68('0xc4')](_0x5c4024)[_0xdc68('0xac')](loggerCatch(_0xdc68('0x192')));_0x45c083[_0xdc68('0xc2')](_0x5c4024)[_0xdc68('0xac')](loggerCatch(_0xdc68('0x192')))[_0xdc68('0x130')](function(){delete _0x45c083[_0xdc68('0xa7')][_0x5d94ae];return _0x2450e3(msgResponse(_0xdc68('0x166'),_0xdc68('0x45'),_0xdc68('0x193')));});});});};Dialer['prototype']['syncOriginateResponse']=function(_0x2660f0){var _0x48a595=this['actions'][_0x2660f0['actionid']];if(_0x48a595){delete this[_0xdc68('0xa7')][_0x2660f0[_0xdc68('0x125')]];_0x48a595['responsetime']=moment()[_0xdc68('0x72')](_0xdc68('0xf7'));var _0x2a907e=_0x48a595[_0xdc68('0x4a')]==='ivr'?this['campaigns'][_0x48a595[_0xdc68('0xaf')]]:this['voiceQueues'][_0x48a595['getQueue']()];if(!this['isSuccess'](_0x2660f0[_0xdc68('0x194')])){this[_0xdc68('0xae')](_0x2a907e);return this[_0xdc68('0x195')](_0x48a595,_0x2a907e,_0x2660f0)[_0xdc68('0xac')](loggerCatch(_0xdc68('0x196')));}this[_0xdc68('0x27')][_0x2660f0[_0xdc68('0xd7')]]=_0x48a595;}};Dialer[_0xdc68('0x1c')][_0xdc68('0x197')]=function(_0xa86184,_0x5f3778,_0x559305){var _0x5e512d=new History(_0x5f3778);if(_0x5e512d[_0xdc68('0xea')]+_0x5e512d[_0xdc68('0xeb')]+_0x5e512d[_0xdc68('0xec')]+_0x5e512d['countnosuchnumberretry']+_0x5e512d[_0xdc68('0xfd')]+_0x5e512d[_0xdc68('0xee')]+_0x5e512d[_0xdc68('0xe9')]+_0x5e512d['countagentrejectretry']>=_0x559305[_0xdc68('0xef')]-0x1){return!![];}switch(_0xa86184){case 0x3:if(_0x5e512d[_0xdc68('0xec')]>=_0x559305['dialNoAnswerMaxRetry']-0x1){return!![];}this[_0xdc68('0xb8')]({'active':![],'countnoanswerretry':_0x5e512d[_0xdc68('0xec')]+=0x1,'scheduledat':moment()[_0xdc68('0xf5')](_0x559305[_0xdc68('0x198')],_0xdc68('0xff'))[_0xdc68('0x72')](_0xdc68('0xf7')),'ContactId':_0x5e512d['ContactId'],'ListId':_0x5e512d[_0xdc68('0xcc')],'VoiceQueueId':_0x5e512d[_0xdc68('0xce')]||undefined,'CampaignId':_0x5e512d[_0xdc68('0xcf')]||undefined})[_0xdc68('0xac')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x5e512d[_0xdc68('0xea')]>=_0x559305['dialBusyMaxRetry']-0x1){return!![];}this[_0xdc68('0xb8')]({'active':![],'countbusyretry':_0x5e512d['countbusyretry']+=0x1,'scheduledat':moment()[_0xdc68('0xf5')](_0x559305['dialBusyRetryFrequency'],_0xdc68('0xff'))['format'](_0xdc68('0xf7')),'ContactId':_0x5e512d[_0xdc68('0xcb')],'ListId':_0x5e512d[_0xdc68('0xcc')],'VoiceQueueId':_0x5e512d[_0xdc68('0xce')]||undefined,'CampaignId':_0x5e512d['CampaignId']||undefined})[_0xdc68('0xac')](loggerCatch(_0xdc68('0x199')));break;case 0x8:if(_0x5e512d['countcongestionretry']>=_0x559305[_0xdc68('0x19a')]-0x1){return!![];}this[_0xdc68('0xb8')]({'active':![],'countcongestionretry':_0x5e512d['countcongestionretry']+=0x1,'scheduledat':moment()[_0xdc68('0xf5')](_0x559305[_0xdc68('0x19b')],_0xdc68('0xff'))[_0xdc68('0x72')](_0xdc68('0xf7')),'ContactId':_0x5e512d[_0xdc68('0xcb')],'ListId':_0x5e512d['ListId'],'VoiceQueueId':_0x5e512d[_0xdc68('0xce')]||undefined,'CampaignId':_0x5e512d[_0xdc68('0xcf')]||undefined})[_0xdc68('0xac')](loggerCatch(_0xdc68('0x19c')));break;case 0x0:if(_0x5e512d[_0xdc68('0xed')]>=_0x559305[_0xdc68('0x19d')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x5e512d[_0xdc68('0xed')]+=0x1,'scheduledat':moment()[_0xdc68('0xf5')](_0x559305[_0xdc68('0x19e')],'minutes')[_0xdc68('0x72')](_0xdc68('0xf7')),'ContactId':_0x5e512d[_0xdc68('0xcb')],'ListId':_0x5e512d['ListId'],'VoiceQueueId':_0x5e512d['VoiceQueueId']||undefined,'CampaignId':_0x5e512d[_0xdc68('0xcf')]||undefined})[_0xdc68('0xac')](loggerCatch(_0xdc68('0x19f')));}break;case 0xa:if(_0x5e512d[_0xdc68('0xfd')]>=_0x559305[_0xdc68('0x118')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x5e512d[_0xdc68('0xfd')]+=0x1,'scheduledat':moment()[_0xdc68('0xf5')](_0x559305[_0xdc68('0x11a')],_0xdc68('0xff'))[_0xdc68('0x72')](_0xdc68('0xf7')),'ContactId':_0x5e512d[_0xdc68('0xcb')],'ListId':_0x5e512d[_0xdc68('0xcc')],'VoiceQueueId':_0x5e512d['VoiceQueueId']||undefined,'CampaignId':_0x5e512d['CampaignId']||undefined})[_0xdc68('0xac')](loggerCatch(_0xdc68('0x11b')));break;case 0xb:if(_0x5e512d[_0xdc68('0xee')]>=_0x559305[_0xdc68('0x120')]-0x1){return!![];}this[_0xdc68('0xb8')]({'active':![],'countabandonedretry':_0x5e512d[_0xdc68('0xee')]+=0x1,'scheduledat':moment()[_0xdc68('0xf5')](_0x559305[_0xdc68('0x121')],'minutes')[_0xdc68('0x72')](_0xdc68('0xf7')),'ContactId':_0x5e512d[_0xdc68('0xcb')],'ListId':_0x5e512d[_0xdc68('0xcc')],'VoiceQueueId':_0x5e512d[_0xdc68('0xce')]||undefined,'CampaignId':_0x5e512d[_0xdc68('0xcf')]||undefined})[_0xdc68('0xac')](loggerCatch(_0xdc68('0x122')));break;case 0x13:if(_0x5e512d[_0xdc68('0xe9')]>=_0x559305[_0xdc68('0xf2')]-0x1){return!![];}this[_0xdc68('0xb8')]({'active':![],'countmachineretry':_0x5e512d['countmachineretry']+=0x1,'scheduledat':moment()[_0xdc68('0xf5')](_0x559305[_0xdc68('0xf6')],'minutes')[_0xdc68('0x72')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5e512d['ContactId'],'ListId':_0x5e512d[_0xdc68('0xcc')],'VoiceQueueId':_0x5e512d['VoiceQueueId']||undefined,'CampaignId':_0x5e512d[_0xdc68('0xcf')]||undefined})[_0xdc68('0xac')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x5e512d[_0xdc68('0xfe')]>=_0x559305[_0xdc68('0x1a0')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x5e512d[_0xdc68('0xfe')]+=0x1,'scheduledat':moment()[_0xdc68('0xf5')](_0x559305[_0xdc68('0x1a1')],_0xdc68('0xff'))[_0xdc68('0x72')](_0xdc68('0xf7')),'ContactId':_0x5e512d['ContactId'],'ListId':_0x5e512d[_0xdc68('0xcc')],'VoiceQueueId':_0x5e512d[_0xdc68('0xce')]||undefined,'CampaignId':_0x5e512d[_0xdc68('0xcf')]||undefined})[_0xdc68('0xac')](loggerCatch(_0xdc68('0x1a2')));break;default:return!![];}};Dialer[_0xdc68('0x1c')][_0xdc68('0x195')]=function(_0x52a8d0,_0xffc08e,_0x5e1d8d){var _0x5b2e6e=this;var _0x5cf463=new History(_0x52a8d0);return new BPromise(function(_0x3fa4fa,_0x64955){if(_[_0xdc68('0x3c')](_0xffc08e)&&typeof _0xffc08e!==_0xdc68('0x165')){return _0x64955(msgResponse(_0xdc68('0x1a3'),_0xdc68('0x13f'),_0xdc68('0x1a4')));}if(_[_0xdc68('0x3c')](_0x5e1d8d)&&typeof _0x5e1d8d!==_0xdc68('0x165')){return _0x64955(msgResponse(_0xdc68('0x1a3'),_0xdc68('0x13f'),_0xdc68('0x1a5')));}switch(_0x5e1d8d[_0xdc68('0x109')]){case'0':_0xffc08e['outboundNoSuchCallsDay']+=0x1;_0x5cf463[_0xdc68('0xe8')]=0x0;_0x5cf463[_0xdc68('0xe0')]=_0xdc68('0x1a6');_0x5cf463['countnosuchnumberretry']+=0x1;_0x5cf463[_0xdc68('0xfb')]+=0x1;ami[_0xdc68('0x49')](_0xdc68('0x1a7'),ut['buildObj'](_0x52a8d0,_0xdc68('0x1a8')));_0x5b2e6e['createHistory'](_0x5cf463)[_0xdc68('0xac')](loggerCatch(_0xdc68('0xfc')));if(_0x5b2e6e[_0xdc68('0x197')](0x0,_0x52a8d0,_0xffc08e)){if(_0x5cf463[_0xdc68('0xed')]>=_0xffc08e['dialNoSuchNumberMaxRetry']){_0x5b2e6e[_0xdc68('0xf3')](_0x5cf463,_0x3fa4fa,_0x64955,'reason\x200\x20no\x20such\x20number....');}else{_0x5b2e6e[_0xdc68('0xf0')](_0x5cf463,_0x3fa4fa,_0x64955,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0xffc08e['outboundNoAnswerCallsDay']+=0x1;_0x5cf463[_0xdc68('0xe8')]=0x3;_0x5cf463[_0xdc68('0xe0')]=_0xdc68('0x1a9');_0x5cf463[_0xdc68('0xec')]+=0x1;_0x5cf463[_0xdc68('0xfb')]+=0x1;ami['emit']('custom:agentnoanswer',ut['buildObj'](_0x52a8d0,_0xdc68('0x1aa')));_0x5b2e6e[_0xdc68('0xc4')](_0x5cf463)['catch'](loggerCatch(_0xdc68('0x1ab')));if(_0x5b2e6e[_0xdc68('0x197')](0x3,_0x52a8d0,_0xffc08e)){if(_0x5cf463['countnoanswerretry']>=_0xffc08e[_0xdc68('0x1ac')]){_0x5b2e6e[_0xdc68('0xf3')](_0x5cf463,_0x3fa4fa,_0x64955,'reason\x203\x20ringing\x20no\x20answer');}else{_0x5b2e6e[_0xdc68('0xf0')](_0x5cf463,_0x3fa4fa,_0x64955,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0xffc08e[_0xdc68('0x5b')]+=0x1;_0x5cf463[_0xdc68('0xe8')]=0x5;_0x5cf463['statedesc']=_0xdc68('0x1ad');_0x5cf463[_0xdc68('0xea')]+=0x1;_0x5cf463['countglobal']+=0x1;ami['emit']('custom:agentbusy',ut[_0xdc68('0xe4')](_0x52a8d0,_0xdc68('0x1ae')));_0x5b2e6e[_0xdc68('0xc4')](_0x5cf463)[_0xdc68('0xac')](loggerCatch(_0xdc68('0x1af')));if(_0x5b2e6e['checkRetriveMax'](0x5,_0x52a8d0,_0xffc08e)){if(_0x5cf463[_0xdc68('0xea')]>=_0xffc08e[_0xdc68('0x1b0')]){_0x5b2e6e[_0xdc68('0xf3')](_0x5cf463,_0x3fa4fa,_0x64955,_0xdc68('0x1b1'));}else{_0x5b2e6e[_0xdc68('0xf0')](_0x5cf463,_0x3fa4fa,_0x64955,_0xdc68('0x1b1'));}}break;case'8':_0xffc08e[_0xdc68('0x5c')]+=0x1;_0x5cf463[_0xdc68('0xe8')]=0x8;_0x5cf463[_0xdc68('0xe0')]=_0xdc68('0x1b2');_0x5cf463[_0xdc68('0xeb')]+=0x1;_0x5cf463[_0xdc68('0xfb')]+=0x1;ami[_0xdc68('0x49')]('custom:agentcongestion',ut[_0xdc68('0xe4')](_0x52a8d0,'congestion'));_0x5b2e6e[_0xdc68('0xc4')](_0x5cf463)[_0xdc68('0xac')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x5b2e6e['checkRetriveMax'](0x8,_0x52a8d0,_0xffc08e)){if(_0x5cf463[_0xdc68('0xeb')]>=_0xffc08e[_0xdc68('0x19a')]){_0x5b2e6e[_0xdc68('0xf3')](_0x5cf463,_0x3fa4fa,_0x64955,_0xdc68('0x1b3'));}else{_0x5b2e6e[_0xdc68('0xf0')](_0x5cf463,_0x3fa4fa,_0x64955,_0xdc68('0x1b3'));}}break;case'11':_0xffc08e['outboundAbandonedCallsDay']+=0x1;_0x5cf463['state']=0xb;_0x5cf463[_0xdc68('0xe0')]=_0xdc68('0x123');_0x5cf463[_0xdc68('0xee')]+=0x1;_0x5cf463[_0xdc68('0xfb')]+=0x1;_0x5b2e6e[_0xdc68('0xc4')](_0x5cf463)[_0xdc68('0xac')](loggerCatch(_0xdc68('0x1b4')));if(_0x5b2e6e['checkRetriveMax'](0xb,_0x52a8d0,_0xffc08e)){if(_0x5cf463['countabandonedretry']>=_0xffc08e[_0xdc68('0x120')]){_0x5b2e6e[_0xdc68('0xf3')](_0x5cf463,_0x3fa4fa,_0x64955,_0xdc68('0x1b5'));}else{_0x5b2e6e[_0xdc68('0xf0')](_0x5cf463,_0x3fa4fa,_0x64955,_0xdc68('0x1b5'));}}break;case'20':_0xffc08e[_0xdc68('0x61')]+=0x1;_0x5cf463[_0xdc68('0xe8')]=0x14;_0x5cf463['statedesc']=_0xdc68('0x1b6');_0x5cf463[_0xdc68('0xfe')]+=0x1;_0x5cf463[_0xdc68('0xfb')]+=0x1;ami['emit'](_0xdc68('0x1b7'),ut[_0xdc68('0xe4')](_0x52a8d0,'agentreject'));_0x5b2e6e[_0xdc68('0xc4')](_0x5cf463)[_0xdc68('0xac')](loggerCatch(_0xdc68('0x1b8')));if(_0x5b2e6e[_0xdc68('0x197')](0x14,_0x52a8d0,_0xffc08e)){if(_0x5cf463['countagentrejectretry']>=_0xffc08e['dialAgentRejectMaxRetry']){_0x5b2e6e['createStateFinal'](_0x5cf463,_0x3fa4fa,_0x64955,_0xdc68('0x1b9'));}else{_0x5b2e6e[_0xdc68('0xf0')](_0x5cf463,_0x3fa4fa,_0x64955,_0xdc68('0x1b9'));}}break;default:_0xffc08e[_0xdc68('0x106')]+=0x1;_0x5cf463[_0xdc68('0xe8')]=0xc;_0x5cf463[_0xdc68('0xe0')]=_0x5e1d8d[_0xdc68('0x109')];_0x5b2e6e[_0xdc68('0xc4')](_0x5cf463)[_0xdc68('0xac')](loggerCatch(_0xdc68('0x1ba')));if(_0x5b2e6e[_0xdc68('0x197')](_0x5e1d8d[_0xdc68('0x109')],_0x52a8d0,_0xffc08e)){if(_0x5cf463[_0xdc68('0xea')]+_0x5cf463[_0xdc68('0xeb')]+_0x5cf463[_0xdc68('0xec')]+_0x5cf463[_0xdc68('0xed')]+_0x5cf463[_0xdc68('0xfd')]+_0x5cf463[_0xdc68('0xee')]+_0x5cf463[_0xdc68('0xe9')]+_0x5cf463[_0xdc68('0xfe')]>=_0xffc08e[_0xdc68('0xef')]){_0x5b2e6e[_0xdc68('0xf0')](_0x5cf463,_0x3fa4fa,_0x64955,_0x5e1d8d[_0xdc68('0x109')]);}else{_0x5b2e6e[_0xdc68('0xf3')](_0x5cf463,_0x3fa4fa,_0x64955,_0x5e1d8d[_0xdc68('0x109')]);}}}});};Dialer[_0xdc68('0x1c')]['stateGlobal']=function(_0x302b59,_0x4c047c,_0x535cd7,_0x3736a7){var _0x39a963=new Final(_0x302b59);_0x39a963[_0xdc68('0xe8')]=0xf;_0x39a963[_0xdc68('0xe0')]=_0xdc68('0x1bb');this[_0xdc68('0xf3')](_0x39a963,_0x4c047c,_0x535cd7,_0x3736a7);};Dialer[_0xdc68('0x1c')][_0xdc68('0xf3')]=function(_0x44a642,_0x25d465,_0x1fc5d8,_0x404749){this[_0xdc68('0xc2')](_0x44a642)[_0xdc68('0xb1')](function(){return _0x25d465(msgResponse(_0xdc68('0x1a3'),_0xdc68('0xd2'),_0x404749));})[_0xdc68('0xac')](function(){return _0x1fc5d8(msgResponse('[moveContactManagedDialer][0]',_0xdc68('0x13f'),_0xdc68('0x1bc')));});};Dialer['prototype'][_0xdc68('0x9')]=function(_0x1a0fee){var _0x3f2c1b=_0x1a0fee[_0xdc68('0x1bd')]/0x64;var _0x304c21=_0x1a0fee[_0xdc68('0x114')]/(_0x1a0fee[_0xdc68('0x114')]+_0x1a0fee[_0xdc68('0xdf')]);var _0xff2fb0=Math[_0xdc68('0x1be')](_0x1a0fee[_0xdc68('0x6b')]*(_0x1a0fee[_0xdc68('0x1bf')]/0x64));var _0x176797=Math[_0xdc68('0x1be')](_0x1a0fee['predictiveIntervalAvailable']*(_0x1a0fee[_0xdc68('0x1c0')]/0x64));var _0x73248f=_0x1a0fee[_0xdc68('0x1c1')]+_0x1a0fee[_0xdc68('0x50')];var _0x12de4c=Math[_0xdc68('0x1c2')](_0x1a0fee[_0xdc68('0x6d')]*_0x1a0fee[_0xdc68('0x83')]*_0x1a0fee[_0xdc68('0x68')]*_0x1a0fee[_0xdc68('0x69')]);if(_[_0xdc68('0x3c')](_0x1a0fee['startProgressive'])){if(!_[_0xdc68('0x3c')](_0x1a0fee['startPredictive'])){_0x1a0fee[_0xdc68('0x29')]=undefined;loggerPredictive[_0xdc68('0x8e')](_0xdc68('0x1c3'),_0xdc68('0x1c4'));}if(!_[_0xdc68('0x3c')](_0x1a0fee['handlePredictive'])){loggerPredictive[_0xdc68('0x8e')]('[startMethodPredictive][StartProgressive]',_0xdc68('0x1c5'));clearInterval(_0x1a0fee['handlePredictive']);_0x1a0fee[_0xdc68('0x89')]=undefined;}_0x1a0fee[_0xdc68('0x2a')]=moment()[_0xdc68('0x72')](_0xdc68('0xf7'));loggerPredictive['info'](_0x1a0fee['name'],'collection\x20data\x20in\x20progressive\x20at',_0x1a0fee[_0xdc68('0x2a')]);this[_0xdc68('0x153')](_0x1a0fee,0x1);}else if(ifInterval(_0x1a0fee[_0xdc68('0x1c6')],_0x1a0fee[_0xdc68('0x2a')])){this[_0xdc68('0x153')](_0x1a0fee,0x1);loggerPredictiveCalls['info'](_0xdc68('0x1c7'),_0x1a0fee[_0xdc68('0x2a')],_0x1a0fee[_0xdc68('0x3e')]);_0x1a0fee[_0xdc68('0x6d')]=0x0;_0x1a0fee[_0xdc68('0x115')]=0x0;}else if(_0x3f2c1b<_0x304c21&&_0x1a0fee['dialPredictiveOptimization']===_0xdc68('0x1c8')){freeVariablesPredictive(_0x1a0fee);loggerPredictive[_0xdc68('0x78')](_0xdc68('0x1c9'),_0xdc68('0x1ca'),_0x304c21,_0xdc68('0x2a'),_0x1a0fee[_0xdc68('0x3e')]);}else if(_0x12de4c<_0x1a0fee[_0xdc68('0x115')]&&_0x1a0fee[_0xdc68('0x1cb')]==='dropRate'){freeVariablesPredictive(_0x1a0fee);loggerPredictive[_0xdc68('0x78')](_0xdc68('0x1cc'),_0xdc68('0x1cd'),_0x12de4c,_0xdc68('0x1ce'),_0x1a0fee[_0xdc68('0x115')],_0xdc68('0x2a'),_0x1a0fee[_0xdc68('0x3e')]);}else if(!ifInterval(_0x1a0fee['dialPredictiveInterval'],_0x1a0fee[_0xdc68('0x2a')])&&_[_0xdc68('0x3c')](_0x1a0fee[_0xdc68('0x29')])&&!_[_0xdc68('0x3c')](_0x1a0fee[_0xdc68('0x2a')])){_0x1a0fee[_0xdc68('0x29')]=moment()[_0xdc68('0x72')](_0xdc68('0xf7'));loggerPredictive['info'](_0x1a0fee[_0xdc68('0x3e')],_0xdc68('0x1cf'),_0x1a0fee['startPredictive']);this[_0xdc68('0xb7')](_0x1a0fee[_0xdc68('0x1c6')])['then'](this[_0xdc68('0x1d0')](_0x1a0fee))['then'](mergeDataErlangB(_0x1a0fee))[_0xdc68('0xb1')](this[_0xdc68('0x1d1')](_0x1a0fee))[_0xdc68('0xac')](loggerCatchPredictive(_0xdc68('0x1d2'),_0x1a0fee));}else if(!ifInterval(_0x1a0fee[_0xdc68('0x1c6')],_0x1a0fee[_0xdc68('0x29')])){_0x1a0fee[_0xdc68('0x115')]=0x0;_0x1a0fee[_0xdc68('0x29')]=moment()[_0xdc68('0x72')](_0xdc68('0xf7'));loggerPredictive['info'](_0x1a0fee['name'],_0xdc68('0x1d3'),_0x1a0fee['startPredictive']);clearInterval(_0x1a0fee[_0xdc68('0x89')]);_0x1a0fee[_0xdc68('0x89')]=undefined;this[_0xdc68('0xb7')](_0x1a0fee[_0xdc68('0x1c6')])['then'](this['getDataPredictive'](_0x1a0fee))[_0xdc68('0xb1')](mergeDataErlangB(_0x1a0fee))['then'](this[_0xdc68('0x1d1')](_0x1a0fee))[_0xdc68('0xac')](loggerCatchPredictive(_0xdc68('0x1d4'),_0x1a0fee));}else if(_0x1a0fee['predictiveIntervalAvailable']&&_0x73248f<_0x1a0fee[_0xdc68('0x6b')]-_0x176797){freeVariablesPredictive(_0x1a0fee);loggerPredictive[_0xdc68('0x78')](_0x1a0fee[_0xdc68('0x3e')],_0xdc68('0x1d5'),_0x73248f,_0xdc68('0x1d6'),_0x1a0fee['predictiveIntervalAvailable'],'-',_0x176797,'=',_0x1a0fee[_0xdc68('0x6b')]-_0x176797,')');}else if(_0x1a0fee['predictiveIntervalAvailable']&&_0x73248f>_0x1a0fee['predictiveIntervalAvailable']+_0xff2fb0){freeVariablesPredictive(_0x1a0fee);loggerPredictive[_0xdc68('0x78')](_0x1a0fee[_0xdc68('0x3e')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x73248f,')\x20are\x20more\x20than\x20threshold\x20(',_0x1a0fee[_0xdc68('0x6b')],'+',_0xff2fb0,'=',_0x1a0fee[_0xdc68('0x6b')]+_0xff2fb0,')');}};Dialer[_0xdc68('0x1c')]['getDataPredictive']=function(_0x293d9f){var _0x12fec2=this;return function(_0x4b043a){return new BPromise(function(_0x5dc810,_0x265012){_[_0xdc68('0x86')](_0x293d9f,_0x4b043a[0x0]);if(checkGetDataPredictive(_0x4b043a[0x0])){var _0x1750ec=_0x293d9f[_0xdc68('0x6b')]=_0x293d9f[_0xdc68('0x50')]+_0x293d9f['available'];var _0x1f9ec7=_0x293d9f[_0xdc68('0x1c6')]*0x3c;var _0x10f25c=_0x4b043a[0x0][_0xdc68('0x64')]+_0x4b043a[0x0]['predictiveIntervalAvgHoldtime'];var _0x2e3a2e=(_0x4b043a[0x0][_0xdc68('0x62')]+_0x4b043a[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x4b043a[0x0][_0xdc68('0x65')])/_0x4b043a[0x0][_0xdc68('0x6c')];_0x293d9f['predictiveIntervalHitRate']=_0x2e3a2e>0x0?_0x2e3a2e:0x1;switch(_0x293d9f[_0xdc68('0x1cb')]){case _0xdc68('0x1c8'):var _0x142c87=_0x293d9f['dialPredictiveOptimizationPercentage']/0x64;return _0x12fec2[_0xdc68('0x1d7')](_0x1750ec,_0x1f9ec7,_0x10f25c,_0x2e3a2e,_0x142c87)[_0xdc68('0xb1')](function(_0x8837a8){return _0x5dc810(_0x8837a8);});case _0xdc68('0x1d8'):var _0x446eb6=_0x293d9f['dialPredictiveOptimizationPercentage']/0x64;return _0x12fec2[_0xdc68('0x1d9')](_0x1750ec,_0x1f9ec7,_0x10f25c,_0x2e3a2e,_0x446eb6)[_0xdc68('0xb1')](function(_0x8cc6c6){return _0x5dc810(_0x8cc6c6);});default:return _0x265012(msgResponse(_0xdc68('0x1da'),'Failure','Unknown\x20Predictive'));}}else{return _0x265012(msgResponse(_0xdc68('0x1da'),'Failure',_0xdc68('0x1db')));}});};};Dialer[_0xdc68('0x1c')][_0xdc68('0x1dc')]=function(_0x1f8f18){var _0x4c3b58=this;return function(_0x5be7e4){return new BPromise(function(_0x29918f,_0x303680){_[_0xdc68('0x86')](_0x1f8f18,_0x5be7e4[0x0]);if(checkGetDataPredictive(_0x5be7e4[0x0])){loggerPredictive[_0xdc68('0x78')](JSON[_0xdc68('0x46')](_0x5be7e4[0x0]));if(_0x1f8f18[_0xdc68('0x1cb')]==='dropRate'){return _0x4c3b58[_0xdc68('0xc0')](_0x1f8f18['id'])[_0xdc68('0xb1')](function(_0x451809){var _0x2c13f2=_0x1f8f18[_0xdc68('0x4b')]-_0x451809[0x0][_0xdc68('0x1dd')];var _0x25a7d9=_0x1f8f18[_0xdc68('0x1c6')]*0x3c;var _0x3f9169=_0x5be7e4[0x0][_0xdc68('0x64')]+_0x5be7e4[0x0][_0xdc68('0x63')];var _0x5e725b=(_0x5be7e4[0x0][_0xdc68('0x62')]+_0x5be7e4[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x5be7e4[0x0][_0xdc68('0x65')])/_0x5be7e4[0x0][_0xdc68('0x6c')];var _0x4cb61c=_0x1f8f18[_0xdc68('0x1bd')]/0x64;_0x1f8f18[_0xdc68('0x6a')]=_0x451809[0x0][_0xdc68('0x1dd')]||0x0;_0x1f8f18[_0xdc68('0x68')]=_0x5e725b>0x0?_0x5e725b:0x1;return _0x4c3b58[_0xdc68('0x1d7')](_0x2c13f2,_0x25a7d9,_0x3f9169,_0x5e725b,_0x4cb61c);})[_0xdc68('0xb1')](function(_0x1339fc){return _0x29918f(_0x1339fc);})[_0xdc68('0xac')](function(_0x4e53a6){return _0x303680(msgResponse('[CatchErlangB]',_0xdc68('0x13f'),JSON[_0xdc68('0x46')](_0x4e53a6)));});}if(_0x1f8f18[_0xdc68('0x1cb')]===_0xdc68('0x1d8')){return _0x4c3b58[_0xdc68('0xc0')](_0x1f8f18['id'])[_0xdc68('0xb1')](function(_0x32fd06){var _0x3be29e=_0x1f8f18['loggedIn']-_0x32fd06[0x0]['outboundQueuePauses'];var _0x1a713a=_0x1f8f18[_0xdc68('0x1c6')]*0x3c;var _0x106ac3=_0x5be7e4[0x0][_0xdc68('0x64')]+_0x5be7e4[0x0][_0xdc68('0x63')];var _0x396dbf=(_0x5be7e4[0x0][_0xdc68('0x62')]+_0x5be7e4[0x0][_0xdc68('0x66')]+_0x5be7e4[0x0][_0xdc68('0x65')])/_0x5be7e4[0x0][_0xdc68('0x6c')];var _0x1cd14b=_0x1f8f18[_0xdc68('0x1bd')]/0x64;_0x1f8f18['predictiveIntervalPauses']=_0x32fd06[0x0][_0xdc68('0x1dd')]||0x0;_0x1f8f18[_0xdc68('0x68')]=_0x396dbf>0x0?_0x396dbf:0x1;return _0x4c3b58['busyFactor'](_0x3be29e,_0x1a713a,_0x106ac3,_0x396dbf,_0x1cd14b);})['then'](function(_0x1d42df){return _0x29918f(_0x1d42df);})[_0xdc68('0xac')](function(_0x4189f3){return _0x303680(msgResponse(_0xdc68('0x1de'),'Failure',JSON[_0xdc68('0x46')](_0x4189f3)));});}}else{return _0x303680(msgResponse(_0xdc68('0x1da'),'Failure',_0xdc68('0x1db')));}});};};Dialer['prototype'][_0xdc68('0x1d1')]=function(_0x6aeaa4){var _0x1a2957=this;return function(){var _0x3e273c=0x0;var _0x493b3f=Math[_0xdc68('0x1c2')](_0x6aeaa4[_0xdc68('0x6e')]*0x3e8);if(_0x493b3f>0x0){_0x493b3f=_0x493b3f<0x64?0x64:_0x493b3f;loggerPredictive['info'](_0x6aeaa4['name'],_0xdc68('0x1df'),_0x493b3f,_0xdc68('0x47'));_0x6aeaa4[_0xdc68('0x89')]=setInterval(function(){_0x1a2957['handlePredictive'](_0x6aeaa4);loggerPredictiveCalls[_0xdc68('0x78')](_0xdc68('0x1e0'),_0x3e273c+=0x1);},_0x493b3f);}else{loggerPredictive[_0xdc68('0x78')](_0x6aeaa4[_0xdc68('0x3e')],_0xdc68('0x1e1'));}};};Dialer[_0xdc68('0x1c')]['checkContactBlack']=function(_0xd2a6d6,_0x351fab){var _0x5bf663=this;return function(_0x3543f5){if(_[_0xdc68('0x44')](_0x3543f5)){if(_[_0xdc68('0xa8')](_0x351fab['UserId'])||!_0x351fab['recallme']){if(_0xd2a6d6[_0xdc68('0x56')]===_0xdc68('0x8')){_0xd2a6d6[_0xdc68('0x12c')]=_['isUndefined'](_0xd2a6d6[_0xdc68('0x12c')])?!![]:_0xd2a6d6[_0xdc68('0x12c')];var _0x5dc05b=uuid['v4']();_0x5bf663['actions'][_0x5dc05b]=new Action(_0xd2a6d6,_0x351fab,_0x5dc05b);loggerBooked[_0xdc68('0x78')](_0xdc68('0x1e2'),_0x5dc05b,_0xdc68('0x1e3'),JSON[_0xdc68('0x46')](_0xd2a6d6[_0xdc68('0x12c')]),_0xdc68('0x1e4'),_0xd2a6d6[_0xdc68('0x3e')]);if(_0xd2a6d6[_0xdc68('0x12c')]){_0xd2a6d6['queueStatusComplete']=![];_0x5bf663[_0xdc68('0x2b')][_0x5bf663['actions'][_0x5dc05b][_0xdc68('0xaf')]]=[];ami['Action']({'actionid':_0x5dc05b,'action':_0xdc68('0x1e5'),'queue':_0xd2a6d6[_0xdc68('0x3e')]})['catch'](function(){_0x5bf663[_0xdc68('0xae')](_0xd2a6d6);_0x5bf663[_0xdc68('0xb8')]({'active':![],'ContactId':_0x5bf663[_0xdc68('0xa7')][_0x5dc05b][_0xdc68('0xcb')],'ListId':_0x5bf663['actions'][_0x5dc05b][_0xdc68('0xcc')],'VoiceQueueId':_0x5bf663[_0xdc68('0xa7')][_0x5dc05b]['VoiceQueueId']||undefined,'CampaignId':_0x5bf663[_0xdc68('0xa7')][_0x5dc05b]['CampaignId']||undefined})[_0xdc68('0xac')](loggerCatch(_0xdc68('0x1e6')));delete _0x5bf663[_0xdc68('0xa7')][_0x5dc05b];});}else{loggerBooked['info'](_0xdc68('0x1e7'),JSON['stringify'](_0xd2a6d6[_0xdc68('0x12c')]),_0xdc68('0x1e4'),_0xd2a6d6[_0xdc68('0x3e')]);_0x5bf663[_0xdc68('0xae')](_0xd2a6d6);_0x5bf663[_0xdc68('0xb8')]({'active':![],'ContactId':_0x5bf663['actions'][_0x5dc05b][_0xdc68('0xcb')],'ListId':_0x5bf663[_0xdc68('0xa7')][_0x5dc05b][_0xdc68('0xcc')],'VoiceQueueId':_0x5bf663[_0xdc68('0xa7')][_0x5dc05b][_0xdc68('0xce')]||undefined,'CampaignId':_0x5bf663['actions'][_0x5dc05b][_0xdc68('0xcf')]||undefined})[_0xdc68('0xac')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x5bf663[_0xdc68('0xa7')][_0x5dc05b];}}else{return _0x5bf663[_0xdc68('0x164')](_0xd2a6d6,_0x351fab);}}else{if(getDiff(_0x351fab['scheduledat'])<_0xd2a6d6[_0xdc68('0x1e8')]*0x3c){if(_0x351fab[_0xdc68('0x1e9')]&&!_0x351fab['Agent'][_0xdc68('0x1ea')]){_0x5bf663[_0xdc68('0x20')][_0xdc68('0x12e')](_0x351fab['id'])[_0xdc68('0x130')](function(){_0x5bf663[_0xdc68('0xae')](_0xd2a6d6);});}else{_0x5bf663[_0xdc68('0xba')]({'active':![]},_0x351fab['id'],0x1)[_0xdc68('0x130')](function(){_0x5bf663[_0xdc68('0xae')](_0xd2a6d6);});}}else{_0xd2a6d6[_0xdc68('0x60')]+=0x1;_0x5bf663[_0xdc68('0xae')](_0xd2a6d6);if(_0xd2a6d6[_0xdc68('0x1eb')]){_0x5bf663[_0xdc68('0xb8')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x351fab['ContactId'],'ListId':_0x351fab[_0xdc68('0xcc')],'VoiceQueueId':_0x351fab[_0xdc68('0xce')]||undefined,'CampaignId':_0x351fab[_0xdc68('0xcf')]||undefined})[_0xdc68('0xac')](loggerCatch(_0xdc68('0x1ec')));_0x5bf663[_0xdc68('0xc4')](createObjHistory(_0xd2a6d6,_0x351fab,_0xdc68('0x1ed'),0x17,_0xdc68('0x1ee')))[_0xdc68('0xac')](loggerCatch(_0xdc68('0x1ef')));}else{_0x5bf663[_0xdc68('0xc9')](createObjHistory(_0xd2a6d6,_0x351fab,_0xdc68('0x1f0'),0x16,_0xdc68('0x1f1')),_0xdc68('0x1f2'),_0xdc68('0x1f3'));}}}}else{_0xd2a6d6[_0xdc68('0x5a')]+=0x1;_0x5bf663[_0xdc68('0xc9')](createObjHistory(_0xd2a6d6,_0x351fab,_0xdc68('0x1f4'),0xd,_0xdc68('0x1f5')),_0xdc68('0x1f6'),'[Originate][MoveBlacklist]');throw _0xdc68('0x1f7');}};};Dialer[_0xdc68('0x1c')][_0xdc68('0x158')]=function(_0x30bb5a){var _0xacd068=this;var _0x268f52=_0x30bb5a['limitCalls']-_0x30bb5a[_0xdc68('0x93')]-_0x30bb5a[_0xdc68('0xbd')];emitCampaignSummary(_0x30bb5a);if(_0x268f52>0x0){if(_0x268f52>this['maxNumberOriginate']){_0x268f52=this[_0xdc68('0x25')];}_0x30bb5a[_0xdc68('0xbd')]+=_0x268f52;this['getContactDialerIvr'](_0x30bb5a['id'],_0x268f52,_0x30bb5a[_0xdc68('0x1f8')],_0x30bb5a)[_0xdc68('0xb1')](function(_0x16764e){_0x30bb5a[_0xdc68('0xbd')]-=_0x268f52;_0x30bb5a['temp']=_0x30bb5a['temp']>0x0?_0x30bb5a[_0xdc68('0xbd')]:0x0;if(!checkContactEmpty(_0x16764e)){_0x30bb5a[_0xdc68('0x3d')]=_0xdc68('0x9a');logger[_0xdc68('0x78')](_0xdc68('0x1f9')+_0x30bb5a[_0xdc68('0x3e')]);}else{_0x30bb5a[_0xdc68('0x93')]+=_0x16764e['length'];_0x30bb5a[_0xdc68('0x3d')]='RUNNING';for(var _0x3a3144=0x0;_0x3a3144<_0x16764e[_0xdc68('0x91')];_0x3a3144+=0x1){_0x30bb5a[_0xdc68('0x1fa')]+=0x1;if(_[_0xdc68('0xa8')](_0x16764e[_0x3a3144])||_[_0xdc68('0xa8')](_0x16764e[_0x3a3144][_0xdc68('0x167')])||_[_0xdc68('0xa8')](_0x16764e[_0x3a3144]['Contact'][_0xdc68('0x168')])){_0xacd068[_0xdc68('0xc8')](_0xdc68('0x1fb'),_0x30bb5a,_0x16764e[_0x3a3144]);}else{_0xacd068[_0xdc68('0xb6')](_['pick'](_0x16764e[_0x3a3144],[_0xdc68('0xcf'),_0xdc68('0x1fc')]))[_0xdc68('0xb1')](_0xacd068['checkContactBlack'](_0x30bb5a,_0x16764e[_0x3a3144]))['catch'](_0xacd068[_0xdc68('0xc7')]('[actionOriginateIvr]\x20',_0x30bb5a));}}}})['catch'](loggerGetContactDialer(_0xdc68('0x1fd'),_0x30bb5a,_0x268f52));}};Dialer[_0xdc68('0x1c')]['handlePower']=function(_0x31175f,_0x2e92ba){var _0x2caf91=this;var _0x43849b=[];var _0x463ab4=_0x2e92ba>=0x1?_0x2e92ba:0x1;if(_0x31175f[_0xdc68('0x56')]===_0xdc68('0x8')){_0x463ab4=0x1;}var _0x5bda77=Math[_0xdc68('0x1c2')](_0x31175f['available']*_0x463ab4)-_0x31175f[_0xdc68('0x93')]-_0x31175f['temp'];emitVoiceQueueSummary(_0x31175f);if(_0x31175f[_0xdc68('0x1fe')]>0x0){var _0x2d9d29=_0x31175f[_0xdc68('0x1fe')]-_0x31175f['originated']-_0x31175f['talking']-_0x31175f[_0xdc68('0xbd')]-_0x31175f['pTalking'];if(_0x5bda77>_0x2d9d29){_0x5bda77=_0x2d9d29;}}if(_0x5bda77>0x0){if(_0x31175f[_0xdc68('0x56')]===_0xdc68('0x8')){_0x5bda77=0x1;}if(_0x5bda77>this[_0xdc68('0x25')]){_0x5bda77=this['maxNumberOriginate'];}_0x31175f[_0xdc68('0xbd')]+=_0x5bda77;for(var _0x2d301b in this[_0xdc68('0x23')]){if(typeof this[_0xdc68('0x23')][_0x2d301b]!==_0xdc68('0x92')){if(this[_0xdc68('0x23')][_0x2d301b][_0xdc68('0xe8')]===_0xdc68('0x1ff')&&this[_0xdc68('0x23')][_0x2d301b][_0xdc68('0xaa')]===_0xdc68('0xd5')){_0x43849b[_0xdc68('0x129')](this[_0xdc68('0x23')][_0x2d301b]['id']);}}}this[_0xdc68('0xbc')](_0x31175f['id'],_0x43849b,_0x5bda77,_0x31175f['dialOrderByScheduledAt'],_0x31175f)[_0xdc68('0xb1')](function(_0x4a1dd8){_0x31175f[_0xdc68('0xbd')]-=_0x5bda77;_0x31175f['temp']=_0x31175f[_0xdc68('0xbd')]>0x0?_0x31175f[_0xdc68('0xbd')]:0x0;if(!checkContactEmpty(_0x4a1dd8)){_0x2caf91[_0xdc68('0xb2')](_0x31175f)[_0xdc68('0xb1')](sendMessageReschedule(_0x31175f))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x31175f[_0xdc68('0x93')]+=_0x4a1dd8[_0xdc68('0x91')];_0x31175f['message']=_0x31175f[_0xdc68('0x56')]===_0xdc68('0x8')?'ACTIVE':_0xdc68('0x200');for(var _0x2dff31=0x0;_0x2dff31<_0x4a1dd8[_0xdc68('0x91')];_0x2dff31+=0x1){if(_[_0xdc68('0xa8')](_0x4a1dd8[_0x2dff31])||_[_0xdc68('0xa8')](_0x4a1dd8[_0x2dff31][_0xdc68('0x167')])||_[_0xdc68('0xa8')](_0x4a1dd8[_0x2dff31]['Contact']['phone'])){_0x2caf91[_0xdc68('0xc8')](_0xdc68('0x1fb'),_0x31175f,_0x4a1dd8[_0x2dff31]);}else{_0x2caf91[_0xdc68('0xb4')](_['pick'](_0x4a1dd8[_0x2dff31],[_0xdc68('0xce'),_0xdc68('0x1fc')]))['then'](_0x2caf91['checkContactBlack'](_0x31175f,_0x4a1dd8[_0x2dff31]))[_0xdc68('0xac')](_0x2caf91[_0xdc68('0xc7')](_0xdc68('0x1fb'),_0x31175f));}}}})[_0xdc68('0xac')](loggerGetContactDialer(_0xdc68('0x201'),_0x31175f,_0x5bda77));}};Dialer[_0xdc68('0x1c')][_0xdc68('0x89')]=function(_0x4cda45){if(_0x4cda45['dialLimitQueue']>0x0){var _0x7d7329=_0x4cda45['dialLimitQueue']-_0x4cda45['originated']-_0x4cda45['talking'];if(_0x7d7329>0x0){this[_0xdc68('0x202')](_0x4cda45);}else{loggerPredictiveCalls['info'](_0xdc68('0x203'));}}else{this['tryOriginatePredictive'](_0x4cda45);}};Dialer[_0xdc68('0x1c')][_0xdc68('0x202')]=function(_0x46653c){var _0x2964b2=this;var _0x42205b=[];_0x46653c[_0xdc68('0x93')]+=0x1;for(var _0x35a620 in this[_0xdc68('0x23')]){if(typeof this[_0xdc68('0x23')][_0x35a620]!==_0xdc68('0x92')){if(this[_0xdc68('0x23')][_0x35a620][_0xdc68('0xe8')]==='not_inuse'&&this['agents'][_0x35a620][_0xdc68('0xaa')]==='reachable'){_0x42205b[_0xdc68('0x129')](this['agents'][_0x35a620]['id']);}}}this['getContactDialer'](_0x46653c['id'],_0x42205b,0x1,_0x46653c['dialOrderByScheduledAt'],_0x46653c)[_0xdc68('0xb1')](function(_0x104cbf){if(!checkContactEmpty(_0x104cbf)){checkContactLowerLimitOriginate(_0x46653c,0x1,0x0);_0x2964b2['countReScheduled'](_0x46653c)[_0xdc68('0xb1')](sendMessageReschedule(_0x46653c))[_0xdc68('0xac')](loggerCatch(_0xdc68('0xb3')));}else{_0x46653c[_0xdc68('0x3d')]=_0xdc68('0x200');if(_['isNil'](_0x104cbf[0x0])||_[_0xdc68('0xa8')](_0x104cbf[0x0][_0xdc68('0x167')])||_['isNil'](_0x104cbf[0x0]['Contact'][_0xdc68('0x168')])){_0x2964b2['emptyContact']('[actionOriginate]\x20',_0x46653c,_0x104cbf[0x0]);}else{_0x2964b2[_0xdc68('0xb4')](_['pick'](_0x104cbf[0x0],[_0xdc68('0xce'),'Contact.phone']))[_0xdc68('0xb1')](_0x2964b2[_0xdc68('0x204')](_0x46653c,_0x104cbf[0x0]))[_0xdc68('0xac')](_0x2964b2[_0xdc68('0xc7')](_0xdc68('0x205'),_0x46653c));}}})[_0xdc68('0xac')](loggerGetContactDialer(_0xdc68('0x206'),_0x46653c,0x1));emitVoiceQueueSummary(_0x46653c);};Dialer[_0xdc68('0x1c')][_0xdc68('0x1d7')]=function(_0x4acef0,_0x5186ae,_0x464788,_0x57ee98,_0x516737,_0x2c57d8){loggerPredictive[_0xdc68('0x78')](_0xdc68('0x207'));loggerPredictive['info'](_0xdc68('0x208'),_0x4acef0);loggerPredictive[_0xdc68('0x78')](_0xdc68('0x209'),_0x5186ae);loggerPredictive[_0xdc68('0x78')](_0xdc68('0x20a'),_0x464788);loggerPredictive[_0xdc68('0x78')](_0xdc68('0x20b'),_0x57ee98);loggerPredictive['info'](_0xdc68('0x20c'),_0x516737);loggerPredictive[_0xdc68('0x78')](_0xdc68('0x85'));return new BPromise(function(_0x25566b,_0x30a3df){if(_0x4acef0<=0x0||isNaN(_0x4acef0)){return _0x30a3df(msgResponse('[abandonmentRate]',_0xdc68('0x45'),'m\x20=\x20'+_0x4acef0));}if(_0x464788<=0x0||isNaN(_0x464788)){return _0x30a3df(msgResponse(_0xdc68('0x20d'),'Error',_0xdc68('0x20e')+_0x464788));}if(_0x57ee98<=0x0||isNaN(_0x57ee98)){return _0x30a3df(msgResponse('[abandonmentRate]',_0xdc68('0x45'),'p\x20=\x20'+_0x57ee98));}if(_0x5186ae<=0x0||isNaN(_0x5186ae)){return _0x30a3df(msgResponse(_0xdc68('0x20d'),_0xdc68('0x45'),_0xdc68('0x20f')+_0x5186ae));}if(_0x516737<=0x0||isNaN(_0x516737)){return _0x30a3df(msgResponse(_0xdc68('0x20d'),_0xdc68('0x45'),_0xdc68('0x210')+_0x516737));}_0x2c57d8=_0x2c57d8||0x0;var _0x321298=0x1/_0x464788;var _0x5860db=0x0;var _0xc5741c=0x0;var _0x375df4=0x0;var _0x44aba5=0x0;for(var _0x100f92=0x0;_0x375df4<_0x516737;_0x100f92+=0x1){_0xc5741c=_0x100f92/_0x5186ae;_0x5860db=(_0x57ee98*_0xc5741c+_0x2c57d8)/_0x321298;_0x375df4=erlangb(_0x5860db,_0x4acef0);_0x44aba5=_0x5860db/_0x4acef0*(0x1-erlangb(_0x5860db,_0x4acef0));}return _0x25566b({'erlangCalls':_0x100f92,'erlangCallToSecond':_0x5186ae/_0x100f92,'erlangAbandonmentRate':_0x375df4,'erlangBusyFactor':_0x44aba5});});};Dialer[_0xdc68('0x1c')][_0xdc68('0x1d9')]=function(_0x270a29,_0xf27fed,_0x5d6b77,_0x1d43b1,_0x2f4397,_0xf9675){loggerPredictive[_0xdc68('0x78')](_0xdc68('0x211'));loggerPredictive[_0xdc68('0x78')](_0xdc68('0x208'),_0x270a29);loggerPredictive[_0xdc68('0x78')](_0xdc68('0x209'),_0xf27fed);loggerPredictive['info'](_0xdc68('0x20a'),_0x5d6b77);loggerPredictive[_0xdc68('0x78')](_0xdc68('0x20b'),_0x1d43b1);loggerPredictive[_0xdc68('0x78')](_0xdc68('0x212'),_0x2f4397);loggerPredictive[_0xdc68('0x78')](_0xdc68('0x85'));return new BPromise(function(_0x3c99e4,_0x387083){if(_0x270a29<=0x0||isNaN(_0x270a29)){return _0x387083(msgResponse(_0xdc68('0x213'),'Error',_0xdc68('0x214')+_0x270a29));}if(_0x5d6b77<=0x0||isNaN(_0x5d6b77)){return _0x387083(msgResponse(_0xdc68('0x213'),_0xdc68('0x45'),_0xdc68('0x20e')+_0x5d6b77));}if(_0x1d43b1<=0x0||isNaN(_0x1d43b1)){return _0x387083(msgResponse('[busyFactor]',_0xdc68('0x45'),_0xdc68('0x215')+_0x1d43b1));}if(_0xf27fed<=0x0||isNaN(_0xf27fed)){return _0x387083(msgResponse(_0xdc68('0x213'),_0xdc68('0x45'),_0xdc68('0x20f')+_0xf27fed));}if(_0x2f4397<=0x0||isNaN(_0x2f4397)){return _0x387083(msgResponse(_0xdc68('0x213'),_0xdc68('0x45'),_0xdc68('0x216')+_0x2f4397));}_0xf9675=_0xf9675||0x0;var _0x42424f=0x1/_0x5d6b77;var _0x43a1bd=0x0;var _0x2e2648=0x0;var _0x31b837=0x0;var _0x23f28c=0x0;for(var _0x26287e=0x0;_0x23f28c<_0x2f4397;_0x26287e+=0x1){_0x2e2648=_0x26287e/_0xf27fed;_0x43a1bd=(_0x1d43b1*_0x2e2648+_0xf9675)/_0x42424f;_0x31b837=erlangb(_0x43a1bd,_0x270a29);_0x23f28c=_0x43a1bd/_0x270a29*(0x1-erlangb(_0x43a1bd,_0x270a29));}return _0x3c99e4({'erlangCalls':_0x26287e,'erlangCallToSecond':_0xf27fed/_0x26287e,'erlangAbandonmentRate':_0x31b837,'erlangBusyFactor':_0x23f28c});});};module['exports']=Dialer; \ No newline at end of file +var _0xfa12=['outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','stringify','format','voice_queue:save','ivr','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','diff','clearing\x20variable\x20start\x20progressive','handlePredictive','outbound','string','\x22%s\x22\x20<%s>','error','inspect','stack','length','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','contacts','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','endtime','starttime','clearZombieChannels','uniqueId','[actions]','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','countReScheduled','then','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','resolve','unlockContact','[unlockContact]\x20','getContactDialer','temp','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','undefined','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','saveInDb','merge','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','Success','isTrunkReachable','trunks','SIP/%s','reachable','uniqueid','isNil','variable','amdstatus','exten','xcally-motion-dialer','value','HANGUP','outboundAnswerCallsDay','state','statedesc','HangupInAMD','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','membername','countmachineretry','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','stateGlobal','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','add','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','dialAMDActive','[syncHangupInAMDIvr][createHistory]','countglobal','dialGlobalMaxRetry','dialMachineMaxRetry','[syncHangupIvr]','AGI','[syncHangupIvr][createHistory]','dialQueueProject','cause-txt','Unknow','syncAgentComplete','reason','agent','dialQueueProject2','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','predictiveIntervalDroppedCallsTimeout','Drop','dropreason','TIMEOUT','agiafterat','countdropretry','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','actionid','locked','stateinterface','rrmemory','idHopper','paused','queueStatusComplete','[booked][unlockQueueStatus]','finally','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','run','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','syncCampaigns','checkIsTrunkReachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','push','command','interval','content','indexOf','iftime\x20%s,%s','true','all','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','handlePower','power','dialPowerLevel','booked','Queue','launchHandleIvr','handleIvr','dialGlobalInterval','dialTimezone','checkDialMethod','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','toUpper','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','originatecalleridnum','SIP/%s/%s%s','trim','substring','dialCutDigit','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','isSuccess','response','callProgressDetecting','[callProgressDetecting]\x20','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','busy','reason\x205\x20busy','custom:agentcongestion','congestion','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','erlangCalls','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalHitRate','abandonmentRate','[CatchErlangB]','predictiveIntervalPauses','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Agent','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','[Originate][historyBlacklist]','inBlackList','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','[countReScheduled]\x20','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','Contact.phone','[actionOriginatePredictive]\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','Error','m\x20=\x20','Ts\x20=\x20','[abandonmentRate]','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','p\x20=\x20','Umin\x20=\x20','exports','util','lodash','uuid','moment','md5','ioredis','../../../config/environment/','../../../config/logger','dialer','predictive','predictiveCalls','syncQueueSummary','../ami','defaults','redis','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','roundrobin','prototype','enqueue','tail','sequence','preview','voiceQueues','campaigns','agents','maxNumberOriginate','channels','actions','contactsId','optionPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','milliseconds','seconds','emit','strategy','answered','available','loggedIn','pTalking','sumBillable','sumHoldTime','talking','type','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay'];(function(_0x134991,_0x2a0072){var _0x47765b=function(_0x239145){while(--_0x239145){_0x134991['push'](_0x134991['shift']());}};_0x47765b(++_0x2a0072);}(_0xfa12,0x1b2));var _0x2fa1=function(_0x64411,_0x2dd485){_0x64411=_0x64411-0x0;var _0x19c7fe=_0xfa12[_0x64411];return _0x19c7fe;};'use strict';var util=require(_0x2fa1('0x0'));var _=require(_0x2fa1('0x1'));var BPromise=require('bluebird');var uuid=require(_0x2fa1('0x2'));var moment=require(_0x2fa1('0x3'));var rr=require('rr');var md5=require(_0x2fa1('0x4'));var Redis=require(_0x2fa1('0x5'));var ut=require('../preview/util/util');var config=require(_0x2fa1('0x6'));var logger=require(_0x2fa1('0x7'))(_0x2fa1('0x8'));var loggerBooked=require(_0x2fa1('0x7'))('booked');var loggerPredictive=require(_0x2fa1('0x7'))(_0x2fa1('0x9'));var loggerPredictiveCalls=require('../../../config/logger')(_0x2fa1('0xa'));var loggerSyncQueueSummary=require(_0x2fa1('0x7'))(_0x2fa1('0xb'));var ami=require(_0x2fa1('0xc'));config['redis']=_[_0x2fa1('0xd')](config[_0x2fa1('0xe')],{'host':'localhost','port':0x18eb});var io=require(_0x2fa1('0xf'))(new Redis(config[_0x2fa1('0xe')]));var cmHopper=require(_0x2fa1('0x10'));var cmHopperHistory=require(_0x2fa1('0x11'));var cmHopperBlack=require(_0x2fa1('0x12'));var voiceQueueRt=require(_0x2fa1('0x13'));var Action=require(_0x2fa1('0x14'));var History=require(_0x2fa1('0x15'));var Final=require('./final');var AgentComplete=require(_0x2fa1('0x16'));var QueueCallerAbandon=require(_0x2fa1('0x17'));var Hangup=require(_0x2fa1('0x18'));var ipAgi=process[_0x2fa1('0x19')][_0x2fa1('0x1a')]||_0x2fa1('0x1b');var strategy={'rrmemory':'rrmemory','roundrobin':_0x2fa1('0x1c')};var Sequence=function(){};Sequence[_0x2fa1('0x1d')][_0x2fa1('0x1e')]=function(_0x20c559){this['tail']=this[_0x2fa1('0x1f')]?this[_0x2fa1('0x1f')]['finally'](_0x20c559):_0x20c559();};function Dialer(_0x3f41f3,_0x328712){this[_0x2fa1('0x20')]=new Sequence();this[_0x2fa1('0x21')]=_0x328712;this[_0x2fa1('0x22')]=_0x3f41f3[_0x2fa1('0x22')];this[_0x2fa1('0x23')]=_0x3f41f3[_0x2fa1('0x23')];this['agents']=_0x3f41f3[_0x2fa1('0x24')];this['trunks']=_0x3f41f3['trunks'];this[_0x2fa1('0x25')]=config[_0x2fa1('0x25')]||0x2;this[_0x2fa1('0x26')]={};this[_0x2fa1('0x27')]={};this[_0x2fa1('0x28')]={};this['uniqueId']={};this[_0x2fa1('0x29')]={};this['startPredictive']={};this[_0x2fa1('0x2a')]={};this[_0x2fa1('0x2b')]={};this[_0x2fa1('0x2c')]={};this[_0x2fa1('0x2d')]={};ami['on'](_0x2fa1('0x2e'),this[_0x2fa1('0x2f')][_0x2fa1('0x30')](this));ami['on'](_0x2fa1('0x31'),this[_0x2fa1('0x32')][_0x2fa1('0x30')](this));ami['on']('originateresponse',this[_0x2fa1('0x33')]['bind'](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0x2fa1('0x30')](this));ami['on']('custom:queuesummary',this['syncQueueSummary'][_0x2fa1('0x30')](this));ami['on'](_0x2fa1('0x34'),this[_0x2fa1('0x35')][_0x2fa1('0x30')](this));ami['on'](_0x2fa1('0x36'),this[_0x2fa1('0x37')][_0x2fa1('0x30')](this));ami['on'](_0x2fa1('0x38'),this[_0x2fa1('0x39')][_0x2fa1('0x30')](this));ami['on'](_0x2fa1('0x3a'),this[_0x2fa1('0x3b')][_0x2fa1('0x30')](this));ami['on'](_0x2fa1('0x3c'),this[_0x2fa1('0x3d')][_0x2fa1('0x30')](this));this[_0x2fa1('0x3e')]();this[_0x2fa1('0x3f')]();}function isNotNull(_0x5f41d1){return _0x5f41d1!==null&&!_[_0x2fa1('0x40')](_0x5f41d1);}function checkIsLoggedIn(_0x1860a0,_0x4bf6b5){return function(){if(_0x4bf6b5<=0x0){_0x1860a0[_0x2fa1('0x41')]=_0x2fa1('0x42');throw _0x1860a0[_0x2fa1('0x43')]+_0x2fa1('0x44');}};}function isActive(_0x22d992){return _0x22d992;}function checkIsActive(_0x4d82e3,_0x2b4a68){return function(){if(!isActive(_0x2b4a68)){_0x4d82e3[_0x2fa1('0x41')]=_0x2fa1('0x45');throw _0x4d82e3[_0x2fa1('0x43')]+'\x20NOT\x20Active';}};}function checkInterval(_0x1eb469){return function(){if(!isNotNull(_0x1eb469[_0x2fa1('0x46')])){_0x1eb469['message']=_0x2fa1('0x47');throw _0x1eb469['name']+_0x2fa1('0x48');}if(!isNotNull(_0x1eb469[_0x2fa1('0x46')][_0x2fa1('0x49')])){_0x1eb469[_0x2fa1('0x41')]=_0x2fa1('0x47');throw _0x1eb469[_0x2fa1('0x43')]+_0x2fa1('0x48');}if(!isNotNull(_[_0x2fa1('0x4a')](_0x1eb469['Interval'][_0x2fa1('0x49')]))){_0x1eb469[_0x2fa1('0x41')]='INTERVAL_IS_NULL';throw _0x1eb469[_0x2fa1('0x43')]+_0x2fa1('0x48');}};}function msgResponse(_0x15cf1b,_0x227880,_0x18b8cd){return{'action':_0x15cf1b,'response':_0x227880,'message':_0x18b8cd,'stack':_0x18b8cd};}function myreject(_0x39ca6f){return function(_0x1e8177){return _0x39ca6f(msgResponse(_0x2fa1('0x4b'),'Error',JSON['stringify'](_0x1e8177)));};}function getSeconds(_0x50cfee,_0x3f27b5){var _0x4663ff=moment(_0x50cfee)['milliseconds'](0x0);var _0x5802fc=moment(_0x3f27b5)[_0x2fa1('0x4c')](0x0);return _0x4663ff['diff'](_0x5802fc,_0x2fa1('0x4d'));}function emit(_0x4bf096,_0x17eeb5,_0x3b9585){io['to'](_0x4bf096)[_0x2fa1('0x4e')](_0x17eeb5,_0x3b9585);}function emitVoiceQueueSummary(_0x1b129a){if(_0x1b129a['type']==='outbound'){var _0x15c7d7={'id':_0x1b129a['id'],'name':_0x1b129a[_0x2fa1('0x43')],'strategy':_0x1b129a[_0x2fa1('0x4f')],'answered':_0x1b129a[_0x2fa1('0x50')],'available':_0x1b129a[_0x2fa1('0x51')],'loggedIn':_0x1b129a[_0x2fa1('0x52')],'pTalking':_0x1b129a[_0x2fa1('0x53')],'sumBillable':_0x1b129a[_0x2fa1('0x54')],'sumDuration':_0x1b129a['sumDuration'],'sumHoldTime':_0x1b129a[_0x2fa1('0x55')]||0x0,'talking':_0x1b129a[_0x2fa1('0x56')],'total':_0x1b129a['total'],'type':_0x1b129a[_0x2fa1('0x57')],'unmanaged':_0x1b129a[_0x2fa1('0x58')],'abandoned':_0x1b129a[_0x2fa1('0x59')],'waiting':_0x1b129a[_0x2fa1('0x5a')],'loggedInDb':_0x1b129a[_0x2fa1('0x5b')],'dialActive':_0x1b129a[_0x2fa1('0x5c')],'dialMethod':_0x1b129a[_0x2fa1('0x5d')],'dialOriginateCallerIdName':_0x1b129a['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x1b129a[_0x2fa1('0x5e')],'dialOriginateTimeout':_0x1b129a[_0x2fa1('0x5f')],'dialPrefix':_0x1b129a[_0x2fa1('0x60')],'outboundAnswerAgiCallsDay':_0x1b129a[_0x2fa1('0x61')],'outboundAnswerCallsDay':_0x1b129a['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x1b129a[_0x2fa1('0x62')],'outboundBusyCallsDay':_0x1b129a[_0x2fa1('0x63')],'outboundCongestionCallsDay':_0x1b129a[_0x2fa1('0x64')],'outboundDropCallsDayACS':_0x1b129a[_0x2fa1('0x65')],'outboundDropCallsDayCallersExit':_0x1b129a['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x1b129a[_0x2fa1('0x66')],'outboundNoAnswerCallsDay':_0x1b129a[_0x2fa1('0x67')],'outboundNoSuchCallsDay':_0x1b129a[_0x2fa1('0x68')],'outboundOriginateFailureCallsDay':_0x1b129a[_0x2fa1('0x69')],'outboundReCallsDay':_0x1b129a[_0x2fa1('0x6a')],'outboundRejectCallsDay':_0x1b129a[_0x2fa1('0x6b')],'outboundUnknownCallsDay':_0x1b129a[_0x2fa1('0x6c')],'predictiveIntervalAnsweredCalls':_0x1b129a[_0x2fa1('0x6d')],'predictiveIntervalAvgHoldtime':_0x1b129a[_0x2fa1('0x6e')],'predictiveIntervalAvgTalktime':_0x1b129a[_0x2fa1('0x6f')],'predictiveIntervalDroppedCallsCallersExit':_0x1b129a['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x1b129a['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x1b129a['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x1b129a[_0x2fa1('0x70')],'predictiveIntervalHitRate':_0x1b129a['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x1b129a['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x1b129a['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x1b129a[_0x2fa1('0x71')],'predictiveIntervalTotalCalls':_0x1b129a[_0x2fa1('0x72')],'message':_0x1b129a[_0x2fa1('0x41')],'originated':_0x1b129a[_0x2fa1('0x73')],'erlangCalls':_0x1b129a['erlangCalls'],'erlangCallToSecond':_0x1b129a[_0x2fa1('0x74')],'erlangAbandonmentRate':_0x1b129a[_0x2fa1('0x75')],'erlangBusyFactor':_0x1b129a[_0x2fa1('0x76')],'startPredictive':_0x1b129a[_0x2fa1('0x77')],'startProgressive':_0x1b129a[_0x2fa1('0x2a')]};if(_0x1b129a[_0x2fa1('0x78')]){_0x15c7d7[_0x2fa1('0x78')]={'id':_0x1b129a[_0x2fa1('0x78')]['id'],'name':_0x1b129a[_0x2fa1('0x78')][_0x2fa1('0x43')],'active':_0x1b129a['Trunk'][_0x2fa1('0x79')],'callerid':_0x1b129a[_0x2fa1('0x78')][_0x2fa1('0x7a')]};}if(_0x1b129a[_0x2fa1('0x46')]){_0x15c7d7[_0x2fa1('0x46')]={'id':_0x1b129a['Interval']['id'],'name':_0x1b129a[_0x2fa1('0x46')][_0x2fa1('0x43')]};}var _0x1b8556=md5(JSON[_0x2fa1('0x7b')](_0x15c7d7));if(_0x1b129a['md5']!==_0x1b8556){_0x1b129a['md5']=_0x1b8556;emit(util[_0x2fa1('0x7c')]('voice:queue:%s',_0x15c7d7[_0x2fa1('0x43')]),_0x2fa1('0x7d'),_0x15c7d7);}}}function emitCampaignSummary(_0x1f227d){if(_0x1f227d[_0x2fa1('0x57')]===_0x2fa1('0x7e')){emit(util[_0x2fa1('0x7c')]('campaign:ivr:%s',_0x1f227d['name']),'campaign:save',_0x1f227d);}}function checkGetDataPredictive(_0x5cab79){if(isNotNull(_0x5cab79)&&!_['isEmpty'](_0x5cab79)){loggerPredictive[_0x2fa1('0x7f')](_0x2fa1('0x80'));loggerPredictive[_0x2fa1('0x7f')](_0x2fa1('0x81'),_0x5cab79[_0x2fa1('0x72')]);loggerPredictive['info']('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5cab79['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x2fa1('0x7f')](_0x2fa1('0x82'),_0x5cab79['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x2fa1('0x7f')](_0x2fa1('0x83'),_0x5cab79[_0x2fa1('0x84')]);loggerPredictive[_0x2fa1('0x7f')](_0x2fa1('0x85'),_0x5cab79['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x2fa1('0x7f')](_0x2fa1('0x86'),_0x5cab79['predictiveIntervalAvgTalktime']);loggerPredictive['info'](_0x2fa1('0x87'));if(_0x5cab79[_0x2fa1('0x72')]>0x0){if(!_[_0x2fa1('0x40')](_0x5cab79['predictiveIntervalAvgTalktime'])&&_0x5cab79[_0x2fa1('0x6f')]>0x0){return!![];}loggerPredictive[_0x2fa1('0x7f')](_0x2fa1('0x88'));if(!_[_0x2fa1('0x40')](_0x5cab79[_0x2fa1('0x6e')])&&_0x5cab79['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x2fa1('0x7f')](_0x2fa1('0x89'));}else{loggerPredictive['info'](_0x2fa1('0x8a'));}}else{loggerPredictive[_0x2fa1('0x7f')](_0x2fa1('0x8b'));}return![];}function mergeDataErlangB(_0x1baaee){return function(_0x3a9076){loggerPredictive[_0x2fa1('0x7f')]('---------\x20ErlangB\x20---------');loggerPredictive[_0x2fa1('0x7f')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3a9076['erlangCalls']);loggerPredictive['info'](_0x2fa1('0x8c'),_0x3a9076['erlangCallToSecond']);loggerPredictive['info'](_0x2fa1('0x8d'),_0x3a9076[_0x2fa1('0x75')]);loggerPredictive[_0x2fa1('0x7f')](_0x2fa1('0x8e'),_0x3a9076[_0x2fa1('0x76')]);loggerPredictive[_0x2fa1('0x7f')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3a9076['erlangAbandonmentRate']);loggerPredictive['info'](_0x2fa1('0x87'));_['merge'](_0x1baaee,_0x3a9076);};}function getDiff(_0x3968a5){var _0x1fa81b=moment()[_0x2fa1('0x4c')](0x0);var _0x2f2bc0=moment(_0x3968a5)['milliseconds'](0x0);return _0x1fa81b[_0x2fa1('0x8f')](_0x2f2bc0,_0x2fa1('0x4d'));}function ifInterval(_0x4b0250,_0x9101b7){if(_[_0x2fa1('0x40')](_0x9101b7)){return![];}return getDiff(_0x9101b7)<_0x4b0250*0x3c;}function freeVariablesPredictive(_0x163145){if(isNotNull(_0x163145)){if(!_[_0x2fa1('0x40')](_0x163145['startProgressive'])){_0x163145[_0x2fa1('0x2a')]=undefined;loggerPredictive['info'](_0x163145['name'],_0x2fa1('0x90'));}if(!_[_0x2fa1('0x40')](_0x163145['startPredictive'])){_0x163145['startPredictive']=undefined;loggerPredictive['info'](_0x163145[_0x2fa1('0x43')],'clearing\x20variable\x20start\x20predictive');}if(!_['isUndefined'](_0x163145[_0x2fa1('0x91')])){clearInterval(_0x163145[_0x2fa1('0x91')]);_0x163145[_0x2fa1('0x91')]=undefined;loggerPredictive[_0x2fa1('0x7f')](_0x163145[_0x2fa1('0x43')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0xaa354,_0x11e2fa){if(_0x11e2fa===0x0){return 0x0;}var _0x1f8911=0x1;for(var _0x2ca396=0x1;_0x2ca396<=_0x11e2fa;_0x2ca396+=0x1){_0x1f8911=0x1+_0x1f8911*_0x2ca396/_0xaa354;}return 0x1/_0x1f8911;}function isVoiceQueueOutbound(_0x4e8d81){return _0x4e8d81===_0x2fa1('0x92');}function isNotPreview(_0x175712){return _0x175712!==_0x2fa1('0x21');}function isCampaignIvr(_0x288187){return _0x288187===_0x2fa1('0x7e');}function getCallerId(_0x2a0a5d,_0x253c36,_0x3b86db){if(!_[_0x2fa1('0x40')](_0x3b86db)&&typeof _0x3b86db===_0x2fa1('0x93')&&!_['isEmpty'](_0x3b86db)){if(!_['isUndefined'](_0x253c36)&&typeof _0x253c36===_0x2fa1('0x93')&&!_[_0x2fa1('0x4a')](_0x253c36)){return util[_0x2fa1('0x7c')](_0x2fa1('0x94'),_0x253c36,_0x3b86db);}return util['format'](_0x2fa1('0x94'),_0x3b86db,_0x3b86db);}if(!_[_0x2fa1('0x40')](_0x2a0a5d)&&typeof _0x2a0a5d===_0x2fa1('0x93')&&!_['isEmpty'](_0x2a0a5d)){return _0x2a0a5d;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x35b9a7,_0x4d292e){return function(_0x521fa9){freeVariablesPredictive(_0x4d292e);emitVoiceQueueSummary(_0x4d292e);emitCampaignSummary(_0x4d292e);loggerSyncQueueSummary[_0x2fa1('0x95')](_0x35b9a7,util[_0x2fa1('0x96')](_0x521fa9,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x2b4088,_0x295a28){return function(_0x4f6ded){loggerPredictive[_0x2fa1('0x95')](_0x295a28['name'],_0x2b4088);loggerPredictive['error'](_0x4f6ded[_0x2fa1('0x97')]);freeVariablesPredictive(_0x295a28);};}function loggerCatch(_0x4e62a8){return function(_0x35dbd3){logger[_0x2fa1('0x95')](_0x4e62a8,util['inspect'](_0x35dbd3,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0xbf42ab){return _0xbf42ab&&!_[_0x2fa1('0x40')](_0xbf42ab)&&_0xbf42ab[_0x2fa1('0x98')]>0x0;}function decremetOriginate(_0x4fad8a){if(!_['isUndefined'](_0x4fad8a)&&_0x4fad8a!==null){if(typeof _0x4fad8a[_0x2fa1('0x73')]!=='undefined'){if(_0x4fad8a[_0x2fa1('0x73')]>0x0){_0x4fad8a[_0x2fa1('0x73')]-=0x1;}else{logger['error'](_0x2fa1('0x99'));}}}else{logger[_0x2fa1('0x95')](_0x2fa1('0x9a'));}}function checkContactLowerLimitOriginate(_0x35b680,_0x18d16d,_0x2db33c){if(_0x18d16d>_0x2db33c){for(var _0x2dc426=0x0;_0x2dc426<_0x18d16d-_0x2db33c;_0x2dc426+=0x1){decremetOriginate(_0x35b680);}}}function loggerGetContactDialer(_0x50441f,_0x456cd2,_0x175973){return function(_0x1c39c8){checkContactLowerLimitOriginate(_0x456cd2,_0x175973,0x0);logger[_0x2fa1('0x95')](_0x50441f,util['inspect'](_0x1c39c8,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x1a0863){return function(_0x469b71){if(isNotNull(_0x469b71)&&isNotNull(_0x469b71[0x0])){if(_0x469b71[0x0][_0x2fa1('0x9b')]>0x0){_0x1a0863[_0x2fa1('0x41')]=_0x2fa1('0x9c');logger[_0x2fa1('0x7f')]('[getContactDialer2][ReScheduled]'+_0x1a0863[_0x2fa1('0x43')],_0x469b71[0x0]['contactsRescheduled'],_0x2fa1('0x9d'));}else{_0x1a0863[_0x2fa1('0x41')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x2fa1('0x7f')](_0x2fa1('0x9e')+_0x1a0863[_0x2fa1('0x43')]);}}};}function notSendMessagesQueue(_0x1b58de){if(_0x1b58de[_0x2fa1('0x9f')]){freeVariablesPredictive(_0x1b58de);if(_0x1b58de[_0x2fa1('0x73')]===0x0&&_0x1b58de[_0x2fa1('0x56')]===0x0&&_0x1b58de[_0x2fa1('0x5a')]===0x0&&(_0x1b58de['pTalking']||0x0)===0x0){_0x1b58de[_0x2fa1('0x9f')]=![];_0x1b58de[_0x2fa1('0x51')]=0x0;_0x1b58de['message']=_0x2fa1('0x45');loggerSyncQueueSummary[_0x2fa1('0x95')](_0x2fa1('0xa0'),_0x1b58de[_0x2fa1('0x43')],_0x2fa1('0xa1'));}else{_0x1b58de['message']=_0x2fa1('0xa2');loggerSyncQueueSummary['error'](_0x2fa1('0xa0'),_0x1b58de[_0x2fa1('0x43')],_0x2fa1('0xa3'));}emitVoiceQueueSummary(_0x1b58de);}}function notSendMessagesCampaign(_0x3ebb7b){if(_0x3ebb7b[_0x2fa1('0x9f')]){if(_0x3ebb7b[_0x2fa1('0x73')]===0x0){_0x3ebb7b['sendMessageOneNotActive']=![];_0x3ebb7b[_0x2fa1('0x41')]=_0x2fa1('0x45');loggerSyncQueueSummary[_0x2fa1('0x95')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x3ebb7b[_0x2fa1('0x43')],_0x2fa1('0xa1'));}else{_0x3ebb7b[_0x2fa1('0x41')]=_0x2fa1('0xa2');loggerSyncQueueSummary[_0x2fa1('0x95')](_0x2fa1('0xa4'),_0x3ebb7b[_0x2fa1('0x43')],_0x2fa1('0xa3'));}emitCampaignSummary(_0x3ebb7b);}}function createObjHistory(_0x57479b,_0x5012e5,_0xcd060c,_0x4e100f,_0x92deb9){_0x57479b['message']=_0xcd060c;var _0x2ba1f5=new Action(_0x57479b,_0x5012e5);var _0x3dc0be=new History(_0x2ba1f5);_0x3dc0be['state']=_0x4e100f;_0x3dc0be['statedesc']=_0x92deb9;_0x3dc0be[_0x2fa1('0xa5')]=_0x2ba1f5[_0x2fa1('0xa6')];return _0x3dc0be;}Dialer['prototype'][_0x2fa1('0x3f')]=function(){var _0x7a1a2b=this;setInterval(function(){_0x7a1a2b[_0x2fa1('0xa7')](_0x7a1a2b[_0x2fa1('0xa8')],'[uniqueid]');_0x7a1a2b['clearZombieChannels'](_0x7a1a2b[_0x2fa1('0x27')],_0x2fa1('0xa9'));},0x32c8);};Dialer[_0x2fa1('0x1d')][_0x2fa1('0xa7')]=function(_0x579ccb,_0x49ad67){var _0x5d6dfd=this;for(var _0x1e156b in _0x579ccb){if(typeof _0x579ccb[_0x1e156b]!=='undefined'){this[_0x2fa1('0x20')][_0x2fa1('0x1e')](function(){if(!_['isNil'](_0x579ccb[_0x1e156b])){return ami[_0x2fa1('0xaa')]({'action':_0x2fa1('0xab'),'channel':_0x579ccb[_0x1e156b][_0x2fa1('0xac')]})[_0x2fa1('0xad')](function(_0xe76580){if(_0xe76580[_0x2fa1('0x41')]===_0x2fa1('0xae')){setTimeout(function(){if(_0x579ccb[_0x1e156b]&&_0x579ccb[_0x1e156b][_0x2fa1('0x57')]!==_0x2fa1('0x7e')){_0x5d6dfd[_0x2fa1('0xaf')](_0x5d6dfd[_0x2fa1('0x22')][_0x579ccb[_0x1e156b][_0x2fa1('0xb0')]]);logger[_0x2fa1('0x95')](_0x2fa1('0xb1'),_0x49ad67,_0x1e156b,_0x579ccb[_0x1e156b]['queue']);delete _0x579ccb[_0x1e156b];}if(_0x579ccb[_0x1e156b]&&_0x579ccb[_0x1e156b][_0x2fa1('0x57')]===_0x2fa1('0x7e')){_0x5d6dfd[_0x2fa1('0xaf')](_0x5d6dfd['campaigns'][_0x579ccb[_0x1e156b]['queue']]);logger[_0x2fa1('0x95')]('[Dialer][checkChannel][ivr]',_0x49ad67,_0x1e156b,_0x579ccb[_0x1e156b][_0x2fa1('0xb0')]);delete _0x579ccb[_0x1e156b];}},0x2328);}});}});}}};Dialer[_0x2fa1('0x1d')][_0x2fa1('0xb2')]=function(_0x274709){return BPromise['resolve']()[_0x2fa1('0xb3')](cmHopper[_0x2fa1('0xb2')](_0x274709))['catch'](loggerCatch('[countReScheduled]\x20'));};Dialer[_0x2fa1('0x1d')]['checkIsBlackList']=function(_0x3d5cd4){return BPromise['resolve']()[_0x2fa1('0xb3')](cmHopperBlack[_0x2fa1('0xb4')](_0x3d5cd4))['catch'](loggerCatch(_0x2fa1('0xb5')));};Dialer[_0x2fa1('0x1d')][_0x2fa1('0xb6')]=function(_0x194d9b){return BPromise['resolve']()['then'](cmHopperBlack[_0x2fa1('0xb6')](_0x194d9b))[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0xb7')));};Dialer['prototype'][_0x2fa1('0xb8')]=function(_0x43aada){return BPromise['resolve']()[_0x2fa1('0xb3')](cmHopperHistory['avgHandleTime'](_0x43aada))[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0xb9')));};Dialer['prototype'][_0x2fa1('0xba')]=function(_0x4871fb){return BPromise[_0x2fa1('0xbb')]()[_0x2fa1('0xb3')](cmHopper[_0x2fa1('0xba')](_0x4871fb))[_0x2fa1('0xad')](loggerCatch('[rescheduleContact]\x20'));};Dialer['prototype']['unlockContact']=function(_0x4b6ba2,_0x582db4,_0x5c919d){return BPromise['resolve']()[_0x2fa1('0xb3')](cmHopper[_0x2fa1('0xbc')](_0x4b6ba2,_0x582db4,_0x5c919d))[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0xbd')));};Dialer['prototype'][_0x2fa1('0xbe')]=function(_0x1bdf48,_0x8a2912,_0x26a2bb,_0x473ac6,_0x56c33e){return BPromise[_0x2fa1('0xbb')]()['then'](cmHopper[_0x2fa1('0xbe')](_0x1bdf48,_0x8a2912,_0x26a2bb,_0x473ac6))[_0x2fa1('0xad')](function(_0x3ad1d6){_0x56c33e[_0x2fa1('0xbf')]-=_0x26a2bb;_0x56c33e[_0x2fa1('0xbf')]=_0x56c33e['temp']>0x0?_0x56c33e['temp']:0x0;loggerCatch('[getContactDialer]\x20')(_0x3ad1d6);});};Dialer[_0x2fa1('0x1d')][_0x2fa1('0xc0')]=function(_0x30af80,_0x593fad,_0x32f969,_0x19510c){return BPromise['resolve']()['then'](cmHopper[_0x2fa1('0xc0')](_0x30af80,_0x593fad,_0x32f969))[_0x2fa1('0xad')](function(_0x3e9340){_0x19510c[_0x2fa1('0xbf')]-=_0x593fad;_0x19510c['temp']=_0x19510c[_0x2fa1('0xbf')]>0x0?_0x19510c['temp']:0x0;loggerCatch(_0x2fa1('0xc1'))(_0x3e9340);});};Dialer['prototype'][_0x2fa1('0xc2')]=function(_0x79add5){return BPromise['resolve']()[_0x2fa1('0xb3')](voiceQueueRt[_0x2fa1('0xc2')](_0x79add5))[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0xc3')));};Dialer[_0x2fa1('0x1d')][_0x2fa1('0xc4')]=function(_0x5875df){return BPromise['resolve']()[_0x2fa1('0xb3')](cmHopper[_0x2fa1('0xc4')](_0x5875df))['catch'](loggerCatch(_0x2fa1('0xc5')));};Dialer[_0x2fa1('0x1d')]['createHistory']=function(_0x3c8d9c){return BPromise[_0x2fa1('0xbb')]()[_0x2fa1('0xb3')](cmHopperHistory[_0x2fa1('0xc6')](_0x3c8d9c))['catch'](loggerCatch(_0x2fa1('0xc7')));};Dialer[_0x2fa1('0x1d')]['updateOriginated']=function(_0x15f171){if(!_[_0x2fa1('0x40')](_0x15f171)&&_0x15f171!==null){if(typeof _0x15f171['originated']!==_0x2fa1('0xc8')){if(_0x15f171[_0x2fa1('0x73')]>0x0){_0x15f171[_0x2fa1('0x73')]-=0x1;}else{logger[_0x2fa1('0x95')](_0x2fa1('0xc9'));}}}else{logger[_0x2fa1('0x95')](_0x2fa1('0xca'));}};Dialer['prototype']['loggerHandler']=function(_0x1e50c7,_0x4348f5){var _0x300740=this;return function(_0x3e8c84){_0x300740[_0x2fa1('0xaf')](_0x4348f5);logger[_0x2fa1('0x95')](_0x1e50c7,util[_0x2fa1('0x96')](_0x3e8c84,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x2fa1('0xcb')]=function(_0x1b1ddb,_0x165fc6,_0x584e2d){var _0x36bebf={'state':0x19,'statedesc':_0x2fa1('0xcc')};this['updateOriginated'](_0x165fc6);this[_0x2fa1('0xcd')](_[_0x2fa1('0xce')](_0x36bebf,_[_0x2fa1('0xcf')](_0x584e2d,[_0x2fa1('0xd0'),_0x2fa1('0xd1'),_0x2fa1('0xd2'),_0x2fa1('0xd3'),_0x2fa1('0xd4')])),_0x2fa1('0xd5'),_0x2fa1('0xd6'));logger[_0x2fa1('0x95')](_0x1b1ddb);};Dialer[_0x2fa1('0x1d')]['isSuccess']=function(_0xb4e7af){return _0xb4e7af===_0x2fa1('0xd7');};Dialer[_0x2fa1('0x1d')][_0x2fa1('0xd8')]=function(_0x464321){return!_[_0x2fa1('0x40')](_0x464321)&&_0x464321&&!_[_0x2fa1('0x40')](_0x464321[_0x2fa1('0x43')])&&!_[_0x2fa1('0x40')](_0x464321[_0x2fa1('0x79')])&&_0x464321[_0x2fa1('0x79')]&&(this[_0x2fa1('0xd9')][util[_0x2fa1('0x7c')](_0x2fa1('0xda'),_0x464321['name'])]['status']===_0x2fa1('0xdb')||this['trunks'][util[_0x2fa1('0x7c')]('SIP/%s',_0x464321[_0x2fa1('0x43')])][_0x2fa1('0xab')]==='unmonitored');};Dialer[_0x2fa1('0x1d')][_0x2fa1('0xcd')]=function(_0x461761,_0x25aa78,_0x4d46f6){this['createHistory'](_0x461761)[_0x2fa1('0xad')](loggerCatch(_0x25aa78));this[_0x2fa1('0xc4')](_0x461761)[_0x2fa1('0xad')](loggerCatch(_0x4d46f6));};Dialer['prototype'][_0x2fa1('0x39')]=function(_0xf21049){var _0x5ee20d=this[_0x2fa1('0xa8')][_0xf21049[_0x2fa1('0xdc')]];var _0x447211;if(!_['isNil'](_0xf21049)&&!_[_0x2fa1('0xdd')](_0xf21049[_0x2fa1('0xde')])&&!_[_0x2fa1('0xdd')](_0xf21049[_0x2fa1('0xde')][_0x2fa1('0xdf')])&&_0xf21049[_0x2fa1('0xe0')]===_0x2fa1('0xe1')&&_0x5ee20d){if(_0x5ee20d[_0x2fa1('0x57')]!==_0x2fa1('0x7e')&&this['voiceQueues'][_0x5ee20d[_0x2fa1('0xb0')]]['dialAMDActive']&&_0xf21049[_0x2fa1('0xe2')]===_0x2fa1('0xe3')){delete this[_0x2fa1('0xa8')][_0xf21049[_0x2fa1('0xdc')]];this[_0x2fa1('0xaf')](this[_0x2fa1('0x22')][_0x5ee20d[_0x2fa1('0xb0')]]);this[_0x2fa1('0x22')][_0x5ee20d[_0x2fa1('0xb0')]][_0x2fa1('0xe4')]+=0x1;this[_0x2fa1('0x22')][_0x5ee20d['queue']][_0x2fa1('0x61')]+=0x1;_0x447211=new Hangup(_0x5ee20d,_0xf21049);_0x447211[_0x2fa1('0xe5')]=0x12;_0x447211[_0x2fa1('0xe6')]=_0x2fa1('0xe7');_0x447211['membername']=_0x2fa1('0xe8');ami[_0x2fa1('0x4e')](_0x2fa1('0xe9'),ut[_0x2fa1('0xea')](_0x447211,_0x2fa1('0xeb')));this[_0x2fa1('0xcd')](_0x447211,_0x2fa1('0xec'),_0x2fa1('0xed'));}if(_0x5ee20d[_0x2fa1('0x57')]!==_0x2fa1('0x7e')&&this[_0x2fa1('0x22')][_0x5ee20d[_0x2fa1('0xb0')]]['dialAMDActive']&&_0xf21049[_0x2fa1('0xe2')]===_0x2fa1('0xee')){var _0x5d2ae6=this;return new BPromise(function(_0x190a18,_0x34bbb6){delete _0x5d2ae6[_0x2fa1('0xa8')][_0xf21049[_0x2fa1('0xdc')]];_0x5d2ae6['updateOriginated'](_0x5d2ae6['voiceQueues'][_0x5ee20d[_0x2fa1('0xb0')]]);_0x5d2ae6[_0x2fa1('0x22')][_0x5ee20d[_0x2fa1('0xb0')]][_0x2fa1('0xe4')]+=0x1;_0x5d2ae6[_0x2fa1('0x22')][_0x5ee20d['queue']][_0x2fa1('0x61')]+=0x1;var _0x22dd29=_0x5d2ae6[_0x2fa1('0x22')][_0x5ee20d[_0x2fa1('0xb0')]];var _0x28d67b=new Hangup(_0x5ee20d,_0xf21049);_0x28d67b[_0x2fa1('0xe5')]=0x13;_0x28d67b[_0x2fa1('0xe6')]=_0x2fa1('0xef');_0x28d67b[_0x2fa1('0xf0')]=_0x2fa1('0xe8');_0x28d67b[_0x2fa1('0xf1')]+=0x1;_0x28d67b['countglobal']+=0x1;_0x28d67b[_0x2fa1('0xeb')]=!![];ami['emit']('custom:amd',ut['buildObj'](_0x28d67b,_0x2fa1('0xeb')));_0x5d2ae6[_0x2fa1('0xc6')](_0x28d67b)['catch'](loggerCatch(_0x2fa1('0xf2')));if(_0x28d67b[_0x2fa1('0xf3')]+_0x28d67b[_0x2fa1('0xf4')]+_0x28d67b[_0x2fa1('0xf5')]+_0x28d67b[_0x2fa1('0xf6')]+_0x28d67b['countdropretry']+_0x28d67b[_0x2fa1('0xf7')]+_0x28d67b[_0x2fa1('0xf1')]+_0x28d67b[_0x2fa1('0xf8')]>=_0x22dd29['dialGlobalMaxRetry']){_0x5d2ae6[_0x2fa1('0xf9')](_0x28d67b,_0x190a18,_0x34bbb6,_0x2fa1('0xfa'));}else{if(_0x28d67b['countmachineretry']>=_0x22dd29['dialMachineMaxRetry']){_0x5d2ae6[_0x2fa1('0xfb')](_0x28d67b,_0x190a18,_0x34bbb6,_0x2fa1('0xfc'));}else{_0x5d2ae6['rescheduleContact']({'active':![],'countmachineretry':_0x28d67b[_0x2fa1('0xf1')],'scheduledat':moment()[_0x2fa1('0xfd')](_0x22dd29['dialMachineRetryFrequency'],_0x2fa1('0xfe'))['format'](_0x2fa1('0xff')),'ContactId':_0x28d67b[_0x2fa1('0xd0')],'ListId':_0x28d67b[_0x2fa1('0xd1')],'VoiceQueueId':_0x28d67b['VoiceQueueId']||undefined,'CampaignId':_0x28d67b['CampaignId']||undefined})[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x100')));_0x190a18({'reschedule':0x1});}}});}if(_0x5ee20d['type']===_0x2fa1('0x7e')&&this[_0x2fa1('0x23')][_0x5ee20d[_0x2fa1('0xb0')]][_0x2fa1('0x101')]&&_0xf21049['value']===_0x2fa1('0xe3')){delete this[_0x2fa1('0xa8')][_0xf21049[_0x2fa1('0xdc')]];this['updateOriginated'](this['campaigns'][_0x5ee20d[_0x2fa1('0xb0')]]);_0x447211=new Hangup(_0x5ee20d,_0xf21049);_0x447211[_0x2fa1('0xe5')]=0x12;_0x447211['statedesc']=_0x2fa1('0xe7');_0x447211[_0x2fa1('0xf0')]=_0x2fa1('0xe8');ami['emit'](_0x2fa1('0xe9'),ut[_0x2fa1('0xea')](_0x447211,_0x2fa1('0xeb')));this[_0x2fa1('0xcd')](_0x447211,_0x2fa1('0x102'),'[syncHangupInAMDIvr]');}if(_0x5ee20d[_0x2fa1('0x57')]==='ivr'&&this[_0x2fa1('0x23')][_0x5ee20d[_0x2fa1('0xb0')]][_0x2fa1('0x101')]&&_0xf21049[_0x2fa1('0xe2')]==='MACHINE'){var _0x5d2ae6=this;return new BPromise(function(_0x1f1324,_0x3a4c80){delete _0x5d2ae6[_0x2fa1('0xa8')][_0xf21049['uniqueid']];_0x5d2ae6['updateOriginated'](_0x5d2ae6[_0x2fa1('0x23')][_0x5ee20d['queue']]);_0x5d2ae6[_0x2fa1('0x23')][_0x5ee20d[_0x2fa1('0xb0')]][_0x2fa1('0xe4')]+=0x1;_0x5d2ae6[_0x2fa1('0x23')][_0x5ee20d[_0x2fa1('0xb0')]][_0x2fa1('0x61')]+=0x1;var _0x2ba616=_0x5d2ae6[_0x2fa1('0x23')][_0x5ee20d[_0x2fa1('0xb0')]];var _0x4074d4=new Hangup(_0x5ee20d,_0xf21049);_0x4074d4['state']=0x13;_0x4074d4[_0x2fa1('0xe6')]=_0x2fa1('0xef');_0x4074d4['membername']=_0x2fa1('0xe8');_0x4074d4[_0x2fa1('0xf1')]+=0x1;_0x4074d4[_0x2fa1('0x103')]+=0x1;_0x4074d4[_0x2fa1('0xeb')]=!![];ami[_0x2fa1('0x4e')](_0x2fa1('0xe9'),ut['buildObj'](_0x4074d4,'amd'));_0x5d2ae6['createHistory'](_0x4074d4)['catch'](loggerCatch(_0x2fa1('0xf2')));if(_0x4074d4[_0x2fa1('0xf3')]+_0x4074d4[_0x2fa1('0xf4')]+_0x4074d4[_0x2fa1('0xf5')]+_0x4074d4[_0x2fa1('0xf6')]+_0x4074d4['countdropretry']+_0x4074d4['countabandonedretry']+_0x4074d4[_0x2fa1('0xf1')]+_0x4074d4[_0x2fa1('0xf8')]>=_0x2ba616[_0x2fa1('0x104')]){_0x5d2ae6[_0x2fa1('0xf9')](_0x4074d4,_0x1f1324,_0x3a4c80,_0x2fa1('0xfa'));}else{if(_0x4074d4[_0x2fa1('0xf1')]>=_0x2ba616[_0x2fa1('0x105')]){_0x5d2ae6['createStateFinal'](_0x4074d4,_0x1f1324,_0x3a4c80,'reason\x2019\x20machine....');}else{_0x5d2ae6[_0x2fa1('0xba')]({'active':![],'countmachineretry':_0x4074d4[_0x2fa1('0xf1')],'scheduledat':moment()[_0x2fa1('0xfd')](_0x2ba616['dialMachineRetryFrequency'],_0x2fa1('0xfe'))['format'](_0x2fa1('0xff')),'ContactId':_0x4074d4[_0x2fa1('0xd0')],'ListId':_0x4074d4[_0x2fa1('0xd1')],'VoiceQueueId':_0x4074d4[_0x2fa1('0xd3')]||undefined,'CampaignId':_0x4074d4[_0x2fa1('0xd4')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x1f1324({'reschedule':0x1});}}});}}};Dialer['prototype'][_0x2fa1('0x35')]=function(_0x43acee){var _0x4287a9=this['uniqueId'][_0x43acee[_0x2fa1('0xdc')]];var _0x10aab4=this;var _0x4a21f0;if(_0x4287a9&&_0x4287a9[_0x2fa1('0x57')]===_0x2fa1('0x7e')){delete this[_0x2fa1('0xa8')][_0x43acee['uniqueid']];this[_0x2fa1('0xaf')](this[_0x2fa1('0x23')][_0x4287a9[_0x2fa1('0xb0')]]);this['campaigns'][_0x4287a9[_0x2fa1('0xb0')]]['ivrAnswerCallsDay']+=0x1;_0x4a21f0=new Hangup(_0x4287a9,_0x43acee);this['createHistory'](_0x4a21f0)[_0x2fa1('0xad')](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x4a21f0)[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x106')));}if(_0x4287a9&&_0x4287a9[_0x2fa1('0x57')]!=='ivr'&&isNotNull(this[_0x2fa1('0x22')][_0x4287a9['queue']]['dialQueueProject'])){delete this['uniqueId'][_0x43acee[_0x2fa1('0xdc')]];this[_0x2fa1('0xaf')](this[_0x2fa1('0x22')][_0x4287a9[_0x2fa1('0xb0')]]);this[_0x2fa1('0x22')][_0x4287a9['queue']][_0x2fa1('0xe4')]+=0x1;this[_0x2fa1('0x22')][_0x4287a9[_0x2fa1('0xb0')]]['outboundAnswerAgiCallsDay']+=0x1;_0x4a21f0=new Hangup(_0x4287a9,_0x43acee);_0x4a21f0[_0x2fa1('0xe5')]=0x10;_0x4a21f0[_0x2fa1('0xe6')]='AnswerAGI';_0x4a21f0[_0x2fa1('0xf0')]=_0x2fa1('0x107');this[_0x2fa1('0xc6')](_0x4a21f0)[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x108')));this[_0x2fa1('0xc4')](_0x4a21f0)[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x106')));}if(_0x4287a9&&_0x4287a9[_0x2fa1('0x57')]!==_0x2fa1('0x7e')&&!isNotNull(this[_0x2fa1('0x22')][_0x4287a9['queue']][_0x2fa1('0x109')])){delete this['uniqueId'][_0x43acee['uniqueid']];this[_0x2fa1('0xaf')](this[_0x2fa1('0x22')][_0x4287a9[_0x2fa1('0xb0')]]);this[_0x2fa1('0x22')][_0x4287a9['queue']][_0x2fa1('0x6c')]+=0x1;_0x4a21f0=new Hangup(_0x4287a9,_0x43acee);_0x4a21f0[_0x2fa1('0xe5')]=0xc;_0x4a21f0[_0x2fa1('0xe6')]=_0x43acee[_0x2fa1('0x10a')];_0x4a21f0['membername']=_0x2fa1('0x10b');this[_0x2fa1('0xc6')](_0x4a21f0)[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x108')));this[_0x2fa1('0xc4')](_0x4a21f0)[_0x2fa1('0xad')](loggerCatch('[syncHangupIvr]'));}};Dialer['prototype'][_0x2fa1('0x10c')]=function(_0x24f790){var _0xde1ae2=this[_0x2fa1('0xa8')][_0x24f790[_0x2fa1('0xdc')]];var _0xc9ae1d=this;if(this[_0x2fa1('0x22')][_0x24f790[_0x2fa1('0xb0')]]){if(_0xde1ae2&&_0xde1ae2['type']!==_0x2fa1('0x7e')){delete this[_0x2fa1('0xa8')][_0x24f790[_0x2fa1('0xdc')]];this['voiceQueues'][_0x24f790[_0x2fa1('0xb0')]]['outboundAnswerCallsDay']+=0x1;var _0x2d4c3f=new AgentComplete(_0xde1ae2,_0x24f790);if(_0x24f790[_0x2fa1('0x10d')]===_0x2fa1('0x10e')){_0x2d4c3f['agiafterat']=this[_0x2fa1('0x22')][_0x24f790[_0x2fa1('0xb0')]][_0x2fa1('0x10f')]&&this[_0x2fa1('0x22')][_0x24f790[_0x2fa1('0xb0')]]['dialAgiAfterHangupAgent']?moment()[_0x2fa1('0x7c')](_0x2fa1('0xff')):undefined;}this[_0x2fa1('0xc6')](_0x2d4c3f)['catch'](loggerCatch(_0x2fa1('0x110')));this[_0x2fa1('0xc4')](_0x2d4c3f)[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x111')));}}};Dialer[_0x2fa1('0x1d')][_0x2fa1('0x2f')]=function(_0x5ab677){if(this[_0x2fa1('0x22')][_0x5ab677['queue']]){if(this['uniqueId'][_0x5ab677[_0x2fa1('0xdc')]]&&this[_0x2fa1('0xa8')][_0x5ab677['uniqueid']]['type']!==_0x2fa1('0x7e')){this[_0x2fa1('0xaf')](this[_0x2fa1('0x22')][_0x5ab677[_0x2fa1('0xb0')]]);this[_0x2fa1('0xa8')][_0x5ab677['uniqueid']][_0x2fa1('0x112')]=moment()[_0x2fa1('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer['prototype'][_0x2fa1('0x113')]=function(_0x56f0ad){this[_0x2fa1('0xc6')](_0x56f0ad)[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x110')));this['moveContactManagedDialer'](_0x56f0ad)['catch'](loggerCatch(_0x2fa1('0x114')));};Dialer['prototype'][_0x2fa1('0x32')]=function(_0x28deaa){var _0x3ff658=this[_0x2fa1('0xa8')][_0x28deaa[_0x2fa1('0xdc')]];var _0x11eaee=this;if(this[_0x2fa1('0x22')][_0x28deaa['queue']]){if(_0x3ff658&&_0x3ff658[_0x2fa1('0x57')]!=='ivr'){delete this[_0x2fa1('0xa8')][_0x28deaa['uniqueid']];this['updateOriginated'](this[_0x2fa1('0x22')][_0x28deaa[_0x2fa1('0xb0')]]);_0x3ff658['droptime']=moment()[_0x2fa1('0x7c')](_0x2fa1('0xff'));var _0x3b870c=new QueueCallerAbandon(_0x3ff658,_0x28deaa);if(getSeconds(_0x3ff658[_0x2fa1('0x115')],_0x3ff658[_0x2fa1('0x116')])>=_0x3ff658['dialQueueTimeout']){this[_0x2fa1('0x22')][_0x28deaa[_0x2fa1('0xb0')]][_0x2fa1('0x117')]+=0x1;this[_0x2fa1('0x22')][_0x28deaa[_0x2fa1('0xb0')]]['outboundDropCallsDayTimeout']+=0x1;this['voiceQueues'][_0x28deaa[_0x2fa1('0xb0')]][_0x2fa1('0x70')]+=0x1;_0x3b870c['state']=0xa;_0x3b870c[_0x2fa1('0xe6')]=_0x2fa1('0x118');_0x3b870c[_0x2fa1('0x119')]=_0x2fa1('0x11a');_0x3b870c[_0x2fa1('0x11b')]=this[_0x2fa1('0x22')][_0x28deaa[_0x2fa1('0xb0')]]['dialQueueProject2']?moment()[_0x2fa1('0x7c')](_0x2fa1('0xff')):undefined;_0x3b870c[_0x2fa1('0x11c')]+=0x1;_0x3b870c[_0x2fa1('0x103')]+=0x1;if(_0x3b870c['countdropretry']>=this['voiceQueues'][_0x28deaa['queue']]['dialDropMaxRetry']){this['queueCallerAbandonCreateState'](_0x3b870c);}else{this[_0x2fa1('0xba')]({'active':![],'countdropretry':_0x3b870c['countdropretry'],'scheduledat':moment()[_0x2fa1('0xfd')](this['voiceQueues'][_0x28deaa[_0x2fa1('0xb0')]][_0x2fa1('0x11d')],_0x2fa1('0xfe'))[_0x2fa1('0x7c')](_0x2fa1('0xff')),'ContactId':_0x3ff658[_0x2fa1('0xd0')],'ListId':_0x3ff658[_0x2fa1('0xd1')],'VoiceQueueId':_0x3ff658[_0x2fa1('0xd3')]||undefined,'CampaignId':_0x3ff658[_0x2fa1('0xd4')]||undefined})[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x11e')));var _0x3e7dfd=new History(_0x3b870c);_0x3e7dfd[_0x2fa1('0xe5')]=0xa;_0x3e7dfd[_0x2fa1('0xe6')]=_0x2fa1('0x118');_0x3e7dfd['starttime']=moment()[_0x2fa1('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');_0x3e7dfd['endtime']=_0x3e7dfd[_0x2fa1('0xa6')];_0x3e7dfd[_0x2fa1('0x11f')]=_0x3b870c[_0x2fa1('0x11f')];_0x3e7dfd[_0x2fa1('0x120')]=_0x3b870c[_0x2fa1('0x120')];this[_0x2fa1('0xc6')](_0x3e7dfd)[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x121')));}}else{this['voiceQueues'][_0x28deaa[_0x2fa1('0xb0')]][_0x2fa1('0x84')]+=0x1;this[_0x2fa1('0x22')][_0x28deaa[_0x2fa1('0xb0')]][_0x2fa1('0x122')]+=0x1;_0x3b870c['state']=0xb;_0x3b870c[_0x2fa1('0xe6')]=_0x2fa1('0x123');_0x3b870c[_0x2fa1('0x119')]=_0x2fa1('0x124');_0x3b870c[_0x2fa1('0xf7')]+=0x1;_0x3b870c['countglobal']+=0x1;if(_0x3b870c[_0x2fa1('0xf7')]>=this[_0x2fa1('0x22')][_0x28deaa[_0x2fa1('0xb0')]][_0x2fa1('0x125')]){this[_0x2fa1('0x113')](_0x3b870c);}else{this[_0x2fa1('0xba')]({'active':![],'countabandonedretry':_0x3b870c[_0x2fa1('0xf7')],'scheduledat':moment()[_0x2fa1('0xfd')](this[_0x2fa1('0x22')][_0x28deaa['queue']]['dialAbandonedRetryFrequency'],'minutes')[_0x2fa1('0x7c')](_0x2fa1('0xff')),'ContactId':_0x3ff658[_0x2fa1('0xd0')],'ListId':_0x3ff658[_0x2fa1('0xd1')],'VoiceQueueId':_0x3ff658[_0x2fa1('0xd3')]||undefined,'CampaignId':_0x3ff658[_0x2fa1('0xd4')]||undefined})[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x126')));var _0x3e7dfd=new History(_0x3b870c);_0x3e7dfd[_0x2fa1('0xe5')]=0xb;_0x3e7dfd['statedesc']=_0x2fa1('0x123');_0x3e7dfd[_0x2fa1('0xa6')]=moment()[_0x2fa1('0x7c')](_0x2fa1('0xff'));_0x3e7dfd[_0x2fa1('0xa5')]=_0x3e7dfd[_0x2fa1('0xa6')];_0x3e7dfd[_0x2fa1('0x11f')]=_0x3b870c['calleridname'];_0x3e7dfd['calleridnum']=_0x3b870c[_0x2fa1('0x120')];this['createHistory'](_0x3e7dfd)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));}}}}};Dialer[_0x2fa1('0x1d')][_0x2fa1('0x37')]=function(_0x493e28){if(this[_0x2fa1('0x27')][_0x493e28[_0x2fa1('0xdc')]]){this[_0x2fa1('0x27')][_0x493e28[_0x2fa1('0xdc')]][_0x2fa1('0xac')]=_0x493e28[_0x2fa1('0xac')];}if(this[_0x2fa1('0xa8')][_0x493e28[_0x2fa1('0xdc')]]){this[_0x2fa1('0xa8')][_0x493e28[_0x2fa1('0xdc')]]['channel']=_0x493e28[_0x2fa1('0xac')];}};Dialer[_0x2fa1('0x1d')]['syncQueueMember']=function(_0x2f960f){if(strategy[this[_0x2fa1('0x22')][this[_0x2fa1('0x27')][_0x2f960f[_0x2fa1('0x127')]]['queue']][_0x2fa1('0x4f')]]===_0x2fa1('0x1c')){if(this[_0x2fa1('0x27')][_0x2f960f['actionid']]&&_['isNil'](this['actions'][_0x2f960f[_0x2fa1('0x127')]][_0x2fa1('0x128')])&&_0x2f960f[_0x2fa1('0xab')]==='1'&&_0x2f960f['paused']==='0'){if(this[_0x2fa1('0x24')][_0x2f960f[_0x2fa1('0x129')]]){if(!this[_0x2fa1('0x24')][_0x2f960f[_0x2fa1('0x129')]][_0x2fa1('0x128')]){this['agents'][_0x2f960f[_0x2fa1('0x129')]][_0x2fa1('0x128')]=!![];this[_0x2fa1('0x27')][_0x2f960f[_0x2fa1('0x127')]][_0x2fa1('0x128')]=!![];this['actions'][_0x2f960f['actionid']][_0x2fa1('0x129')]=_0x2f960f['stateinterface'];}}}}else if((strategy[this[_0x2fa1('0x22')][this[_0x2fa1('0x27')][_0x2f960f[_0x2fa1('0x127')]][_0x2fa1('0xb0')]][_0x2fa1('0x4f')]]||_0x2fa1('0x12a'))===_0x2fa1('0x12a')){if(this[_0x2fa1('0x27')][_0x2f960f[_0x2fa1('0x127')]]){if(this['agents'][_0x2f960f[_0x2fa1('0x129')]]){this[_0x2fa1('0x27')][_0x2f960f['actionid']]['stateinterface']=_0x2f960f[_0x2fa1('0x129')];if(_[_0x2fa1('0xdd')](this[_0x2fa1('0x2c')][this['actions'][_0x2f960f[_0x2fa1('0x127')]][_0x2fa1('0xb0')]])){this['queueBooked'][this[_0x2fa1('0x27')][_0x2f960f['actionid']][_0x2fa1('0xb0')]]=[];}this['queueBooked'][this['actions'][_0x2f960f[_0x2fa1('0x127')]][_0x2fa1('0xb0')]]['push'](_[_0x2fa1('0xce')](_[_0x2fa1('0xcf')](this[_0x2fa1('0x27')][_0x2f960f[_0x2fa1('0x127')]],[_0x2fa1('0x12b'),_0x2fa1('0x129')]),{'status':_0x2f960f[_0x2fa1('0xab')],'paused':_0x2f960f[_0x2fa1('0x12c')]}));}}}};function unlockQueueStatus(_0x3cf0ca,_0x4f0281){setTimeout(function(){if(_[_0x2fa1('0x40')](_0x3cf0ca[_0x2fa1('0x12d')])){loggerBooked[_0x2fa1('0x95')]('[unlockQueueStatus][undefined]',_0x4f0281);}_0x3cf0ca['queueStatusComplete']=!![];loggerBooked[_0x2fa1('0x7f')](_0x2fa1('0x12e'),_0x4f0281,JSON['stringify'](_[_0x2fa1('0xcf')](_0x3cf0ca,['name',_0x2fa1('0x12d')])));},0x1f3);}Dialer['prototype'][_0x2fa1('0x3d')]=function(_0x207f3f){var _0xc64e27=this;var _0x27af4e=_0xc64e27[_0x2fa1('0x22')][_0xc64e27[_0x2fa1('0x27')][_0x207f3f[_0x2fa1('0x127')]][_0x2fa1('0xb0')]];if(strategy[this[_0x2fa1('0x22')][this['actions'][_0x207f3f[_0x2fa1('0x127')]][_0x2fa1('0xb0')]][_0x2fa1('0x4f')]]===_0x2fa1('0x1c')){if(this[_0x2fa1('0x27')][_0x207f3f[_0x2fa1('0x127')]]&&this[_0x2fa1('0x27')][_0x207f3f[_0x2fa1('0x127')]]['stateinterface']){this['preview']['run'](this['actions'][_0x207f3f[_0x2fa1('0x127')]][_0x2fa1('0x12b')],this[_0x2fa1('0x27')][_0x207f3f[_0x2fa1('0x127')]][_0x2fa1('0x129')])[_0x2fa1('0xad')](function(_0x3c2133){logger[_0x2fa1('0x95')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x2fa1('0x96')](_0x3c2133,{'showHidden':![],'depth':null}));})[_0x2fa1('0x12f')](function(){_0xc64e27[_0x2fa1('0xaf')](_0xc64e27[_0x2fa1('0x22')][_0xc64e27[_0x2fa1('0x27')][_0x207f3f[_0x2fa1('0x127')]][_0x2fa1('0xb0')]]);_0xc64e27['agents'][_0xc64e27[_0x2fa1('0x27')][_0x207f3f['actionid']][_0x2fa1('0x129')]]['locked']=![];delete _0xc64e27[_0x2fa1('0x27')][_0x207f3f[_0x2fa1('0x127')]];unlockQueueStatus(_0x27af4e);});}else{this[_0x2fa1('0xaf')](this[_0x2fa1('0x22')][this[_0x2fa1('0x27')][_0x207f3f['actionid']][_0x2fa1('0xb0')]]);this[_0x2fa1('0xba')]({'active':![],'ContactId':this[_0x2fa1('0x27')][_0x207f3f['actionid']][_0x2fa1('0xd0')],'ListId':this[_0x2fa1('0x27')][_0x207f3f[_0x2fa1('0x127')]]['ListId'],'VoiceQueueId':this[_0x2fa1('0x27')][_0x207f3f[_0x2fa1('0x127')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x2fa1('0x27')][_0x207f3f[_0x2fa1('0x127')]]['CampaignId']||undefined})['catch'](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this['actions'][_0x207f3f[_0x2fa1('0x127')]];unlockQueueStatus(_0x27af4e);}}else if((strategy[this['voiceQueues'][this[_0x2fa1('0x27')][_0x207f3f[_0x2fa1('0x127')]][_0x2fa1('0xb0')]][_0x2fa1('0x4f')]]||_0x2fa1('0x12a'))===_0x2fa1('0x12a')){var _0xf0a101;if(this[_0x2fa1('0x27')][_0x207f3f['actionid']]&&!_['isEmpty'](this[_0x2fa1('0x2c')][this[_0x2fa1('0x27')][_0x207f3f[_0x2fa1('0x127')]][_0x2fa1('0xb0')]])){if(this[_0x2fa1('0x2d')][_0xc64e27['actions'][_0x207f3f['actionid']][_0x2fa1('0xb0')]]){this[_0x2fa1('0x2d')][_0xc64e27[_0x2fa1('0x27')][_0x207f3f['actionid']][_0x2fa1('0xb0')]]=this[_0x2fa1('0x2d')][this[_0x2fa1('0x27')][_0x207f3f[_0x2fa1('0x127')]][_0x2fa1('0xb0')]]?this[_0x2fa1('0x2d')][this['actions'][_0x207f3f[_0x2fa1('0x127')]]['queue']]:this[_0x2fa1('0x2c')][this[_0x2fa1('0x27')][_0x207f3f['actionid']]['queue']]?this['queueBooked'][this[_0x2fa1('0x27')][_0x207f3f[_0x2fa1('0x127')]][_0x2fa1('0xb0')]][_0x2fa1('0x130')]||0x0:0x0;}this['queueBooked'][this[_0x2fa1('0x27')][_0x207f3f['actionid']][_0x2fa1('0xb0')]]['_rr']=this[_0x2fa1('0x2d')][this[_0x2fa1('0x27')][_0x207f3f[_0x2fa1('0x127')]][_0x2fa1('0xb0')]];for(var _0x2d478d=0x0;_0x2d478d=0x0;})[_0x2fa1('0xad')](myreject(_0x4d6ff6)));}}else{_0x4c9a3b['push'](ami['Action']({'action':_0x2fa1('0x146'),'command':util[_0x2fa1('0x7c')](_0x2fa1('0x14a'),_0x57e989,!_[_0x2fa1('0x40')](config[_0x2fa1('0x141')][_0x4633d5])?_0x4633d5:'')})[_0x2fa1('0xb3')](function(_0x3ce631){return _0x3ce631[_0x2fa1('0x148')][_0x2fa1('0x149')](_0x2fa1('0x14b'))>=0x0;})[_0x2fa1('0xad')](myreject(_0x4d6ff6)));}BPromise[_0x2fa1('0x14c')](_0x4c9a3b)[_0x2fa1('0xb3')](function(_0x554c96){var _0x3a6ea1=_['some'](_0x554c96);if(_0x3a6ea1){return _0x3f942e(_0x3a6ea1);}else{_0x2953db[_0x2fa1('0x41')]=_0x41e121?_0x2fa1('0x14d'):_0x2fa1('0x14e');return _0x4d6ff6(msgResponse(_0x2fa1('0x14f'),_0x2fa1('0x13f'),_0x2fa1('0x150')+_0x41e121+'\x20'+_0x32eb04+'\x20Interval\x20is\x20overtime:\x20'+util[_0x2fa1('0x96')](_0x57e989,{'showHidden':![],'depth':null})+_0x2fa1('0x151')+_0x4633d5));}})[_0x2fa1('0xad')](function(_0x4b1092){return _0x4d6ff6(msgResponse(_0x2fa1('0x13d'),_0x2fa1('0x13f'),JSON['stringify'](_0x4b1092)));});});};Dialer[_0x2fa1('0x1d')]['checkDialMethod']=function(_0x9428a){var _0x3b785b=this;return function(){switch(_0x9428a[_0x2fa1('0x5d')]){case'progressive':freeVariablesPredictive(_0x9428a);_0x3b785b[_0x2fa1('0x152')](_0x9428a,0x1);break;case _0x2fa1('0x153'):freeVariablesPredictive(_0x9428a);_0x3b785b[_0x2fa1('0x152')](_0x9428a,_0x9428a[_0x2fa1('0x154')]);break;case _0x2fa1('0x9'):_0x3b785b[_0x2fa1('0x9')](_0x9428a);break;case _0x2fa1('0x155'):freeVariablesPredictive(_0x9428a);_0x3b785b[_0x2fa1('0x152')](_0x9428a,0x1);break;default:freeVariablesPredictive(_0x9428a);logger[_0x2fa1('0x95')](_0x2fa1('0x156'),_0x9428a[_0x2fa1('0x43')],'method\x20not\x20recognized');}};};Dialer[_0x2fa1('0x1d')][_0x2fa1('0x157')]=function(_0x2c9cdd){var _0x47c65f=this;return function(){_0x47c65f[_0x2fa1('0x158')](_0x2c9cdd);};};Dialer['prototype'][_0x2fa1('0xb')]=function(_0xee1a8f){var _0x4a5374=this;if(isNotPreview(_0xee1a8f[_0x2fa1('0x5d')])){if(isVoiceQueueOutbound(_0xee1a8f[_0x2fa1('0x57')])&&isActive(_0xee1a8f[_0x2fa1('0x5c')])){_0xee1a8f['sendMessageOneNotActive']=!![];BPromise[_0x2fa1('0xbb')]()[_0x2fa1('0xb3')](checkIsLoggedIn(_0xee1a8f,_0xee1a8f['loggedIn']))[_0x2fa1('0xb3')](checkIsActive(_0xee1a8f,_0xee1a8f['dialActive']))[_0x2fa1('0xb3')](checkInterval(_0xee1a8f))[_0x2fa1('0xb3')](_0x4a5374[_0x2fa1('0x13b')](_0xee1a8f))[_0x2fa1('0xb3')](_0x4a5374[_0x2fa1('0x13c')](_0xee1a8f[_0x2fa1('0x159')],_0xee1a8f['dialTimezone'],_0xee1a8f[_0x2fa1('0x43')],_0xee1a8f))[_0x2fa1('0xb3')](_0x4a5374[_0x2fa1('0x13e')](_0xee1a8f['Interval'],_0xee1a8f[_0x2fa1('0x15a')],_0xee1a8f[_0x2fa1('0x43')],_0xee1a8f))[_0x2fa1('0xb3')](_0x4a5374[_0x2fa1('0x15b')](_0xee1a8f))[_0x2fa1('0xad')](loggerCatchQueueSummary('[syncQueueSummary]',_0xee1a8f));}else{notSendMessagesQueue(_0xee1a8f);}}else{freeVariablesPredictive(_0xee1a8f);}};Dialer[_0x2fa1('0x1d')]['syncCampaigns']=function(){var _0x2b5bcb=this;var _0x44f94b;for(var _0x2af6be in this[_0x2fa1('0x23')]){if(typeof this['campaigns'][_0x2af6be]!=='undefined'){_0x44f94b=this[_0x2fa1('0x23')][_0x2af6be];if(isCampaignIvr(_0x44f94b[_0x2fa1('0x57')])&&isActive(_0x44f94b[_0x2fa1('0x79')])){_0x44f94b['sendMessageOneNotActive']=!![];BPromise[_0x2fa1('0xbb')]()[_0x2fa1('0xb3')](checkIsActive(_0x44f94b,_0x44f94b['active']))['then'](checkInterval(_0x44f94b))[_0x2fa1('0xb3')](_0x2b5bcb[_0x2fa1('0x13b')](_0x44f94b))[_0x2fa1('0xb3')](_0x2b5bcb[_0x2fa1('0x13c')](_0x44f94b[_0x2fa1('0x159')],_0x44f94b[_0x2fa1('0x15a')],_0x44f94b[_0x2fa1('0x43')],_0x44f94b))['then'](_0x2b5bcb[_0x2fa1('0x13e')](_0x44f94b['Interval'],_0x44f94b['dialTimezone'],_0x44f94b[_0x2fa1('0x43')],_0x44f94b))['then'](_0x2b5bcb[_0x2fa1('0x157')](_0x44f94b))[_0x2fa1('0xad')](loggerCatchQueueSummary(_0x2fa1('0x15c'),_0x44f94b));}else{notSendMessagesCampaign(_0x44f94b);}}}};function getCallerIdRandom(_0x70de73,_0x521260){var _0x310b9d;var _0x3f0ded;var _0x31ccc8;if(_0x521260<=0x0){_0x521260=0x1;}_0x310b9d=new RegExp(_0x2fa1('0x15d')+_0x521260+'}$');_0x3f0ded=Math[_0x2fa1('0x15e')](0xa,_0x521260-0x1);_0x31ccc8=Math['pow'](0xa,_0x521260)-0x1;return util[_0x2fa1('0x7c')]('%s',_[_0x2fa1('0x15f')](_0x70de73,_0x310b9d,_[_0x2fa1('0x160')](_0x3f0ded,_0x31ccc8)));}function extractCalleridName(_0x5ef578){var _0x56abba=_0x5ef578[_0x2fa1('0x161')](/"(.*?)"/);return _0x56abba?_0x56abba[0x1]:_0x5ef578;}function extractCalleridNumber(_0x1a165d){var _0x33b8d9=_0x1a165d[_0x2fa1('0x161')](/<(.*?)>/);return _0x33b8d9?_0x33b8d9[0x1]:_0x1a165d;}Dialer[_0x2fa1('0x1d')][_0x2fa1('0x162')]=function(_0x2c12d2,_0x15a538){var _0x37af8d=this;var _0x2e029f=uuid['v4']();this[_0x2fa1('0x27')][_0x2e029f]=new Action(_0x2c12d2,_0x15a538,_0x2e029f);return new BPromise(function(_0x276c99,_0x1164c6){if(_[_0x2fa1('0x40')](_0x2c12d2)&&typeof _0x2c12d2!==_0x2fa1('0x163')){return _0x1164c6(msgResponse(_0x2fa1('0x164'),_0x2fa1('0x13f'),_0x2fa1('0x165')));}if(_[_0x2fa1('0x40')](_0x15a538[_0x2fa1('0x166')][_0x2fa1('0x167')])||_0x15a538[_0x2fa1('0x166')]['phone']===null){return _0x1164c6(msgResponse(_0x2fa1('0x164'),_0x2fa1('0x13f'),'contact\x20is\x20undefine'));}var _0x205226={'XMD-CALLERID':_0x37af8d[_0x2fa1('0x27')][_0x2e029f][_0x2fa1('0x168')](),'XMD-AGI':_0x2c12d2[_0x2fa1('0x109')]?util['format'](_0x2fa1('0x169'),ipAgi,_0x2c12d2[_0x2fa1('0x109')]):_0x2fa1('0x16a'),'XMD-AGIAFTER':_0x2c12d2[_0x2fa1('0x10f')]?util['format'](_0x2fa1('0x169'),ipAgi,_0x2c12d2[_0x2fa1('0x10f')]):'NONE','XMD-QUEUE':_0x2c12d2[_0x2fa1('0x57')]===_0x2fa1('0x92')?util['format'](_0x2fa1('0x16b'),_0x2c12d2['name'],_0x2c12d2[_0x2fa1('0x16c')]||'',_0x2c12d2['dialAgiAfterHangupAgent']?'c':'',_0x2c12d2[_0x2fa1('0x16d')]||0x3):_0x2fa1('0x16a'),'XMD-CONTACTID':_0x15a538[_0x2fa1('0xd0')],'XMD-CDRTYPE':_0x2fa1('0x8'),'CALLERID(all)':_0x37af8d['actions'][_0x2e029f]['getCaller'](),'XMD-AMD':_0x2c12d2[_0x2fa1('0x101')]?_0x2fa1('0x16e'):_0x2fa1('0x16a'),'XMD-DESTINATION':_0x2fa1('0xe1')};if(_0x2c12d2[_0x2fa1('0x101')]){_0x205226[_0x2fa1('0x16f')]=_0x2c12d2[_0x2fa1('0x170')]||0x9c4;_0x205226[_0x2fa1('0x171')]=_0x2c12d2[_0x2fa1('0x172')]||0x5dc;_0x205226[_0x2fa1('0x173')]=_0x2c12d2['dialAMDAfterGreetingSilence']||0x320;_0x205226[_0x2fa1('0x174')]=_0x2c12d2['dialAMDTotalAnalysisTime']||0x1388;_0x205226[_0x2fa1('0x175')]=_0x2c12d2['dialAMDMinWordLength']||0x64;_0x205226['XMD-AMDBETWEENWORDSSILENCE']=_0x2c12d2[_0x2fa1('0x176')]||0x32;_0x205226['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x2c12d2[_0x2fa1('0x177')]||0x3;_0x205226[_0x2fa1('0x178')]=_0x2c12d2[_0x2fa1('0x179')]||0x100;_0x205226[_0x2fa1('0x17a')]=_0x2c12d2['dialAMDMaximumWordLength']||0x1388;}if(_0x2c12d2['type']==='outbound'){_0x205226[_0x2fa1('0x17b')]=_0x15a538['VoiceQueueId'];}else{_0x205226[_0x2fa1('0x17c')]=_0x15a538[_0x2fa1('0xd4')];}for(var _0x32ec59 in _0x15a538[_0x2fa1('0x166')]){if(typeof _0x15a538[_0x2fa1('0x166')][_0x32ec59]!==_0x2fa1('0xc8')){if(isNotNull(_0x15a538['Contact'][_0x32ec59])&&_0x32ec59!=='id'&&_0x32ec59!==_0x2fa1('0x17d')&&_0x32ec59!==_0x2fa1('0x17e')&&_0x32ec59!==_0x2fa1('0x17f')){_0x205226[util[_0x2fa1('0x7c')](_0x2fa1('0x180'),'XMD-',_[_0x2fa1('0x181')](_0x32ec59))]=_0x15a538['Contact'][_0x32ec59];}}}var _0x28d1c9=_0x37af8d[_0x2fa1('0xd8')](_0x2c12d2[_0x2fa1('0x78')])?getCallerId(_0x2c12d2[_0x2fa1('0x78')][_0x2fa1('0x7a')],_0x2c12d2[_0x2fa1('0x182')],_0x2c12d2['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x2c12d2['dialOriginateCallerIdNumber'],_0x2c12d2[_0x2fa1('0x183')]):_0x2c12d2[_0x2fa1('0x5e')]):getCallerId(_[_0x2fa1('0xdd')](_0x2c12d2[_0x2fa1('0x184')])?_0x2c12d2['Trunk'][_0x2fa1('0x7a')]:_0x2c12d2['TrunkBackup'][_0x2fa1('0x7a')],_0x2c12d2['dialOriginateCallerIdName'],_0x2c12d2[_0x2fa1('0x183')]>0x0?getCallerIdRandom(_0x2c12d2[_0x2fa1('0x5e')],_0x2c12d2['dialRandomLastDigitCallerIdNumber']):_0x2c12d2[_0x2fa1('0x5e')]);if(_0x28d1c9){_0x205226[_0x2fa1('0x185')]=_0x37af8d[_0x2fa1('0x27')][_0x2e029f][_0x2fa1('0x186')]=extractCalleridName(_0x28d1c9);_0x205226['XMD-ORIGINATECALLERIDNUM']=_0x37af8d[_0x2fa1('0x27')][_0x2e029f][_0x2fa1('0x187')]=extractCalleridNumber(_0x28d1c9);}return ami[_0x2fa1('0xaa')]({'actionid':_0x2e029f,'action':_0x2fa1('0x164'),'channel':_0x37af8d[_0x2fa1('0xd8')](_0x2c12d2[_0x2fa1('0x78')])?util[_0x2fa1('0x7c')](_0x2fa1('0x188'),_0x2c12d2['Trunk']['name'],isNotNull(_0x2c12d2[_0x2fa1('0x60')])?_0x2c12d2[_0x2fa1('0x60')][_0x2fa1('0x189')]()||'':'',_0x2c12d2['dialCutDigit']>0x0?_0x15a538['Contact'][_0x2fa1('0x167')][_0x2fa1('0x18a')](_0x2c12d2['dialCutDigit']):_0x15a538[_0x2fa1('0x166')][_0x2fa1('0x167')]):util[_0x2fa1('0x7c')](_0x2fa1('0x188'),_[_0x2fa1('0xdd')](_0x2c12d2[_0x2fa1('0x184')])?_0x2c12d2['Trunk'][_0x2fa1('0x43')]:_0x2c12d2[_0x2fa1('0x184')]['name'],isNotNull(_0x2c12d2['dialPrefix'])?_0x2c12d2[_0x2fa1('0x60')]['trim']()||'':'',_0x2c12d2[_0x2fa1('0x18b')]>0x0?_0x15a538[_0x2fa1('0x166')][_0x2fa1('0x167')]['substring'](_0x2c12d2[_0x2fa1('0x18b')]):_0x15a538[_0x2fa1('0x166')]['phone']),'callerid':_0x28d1c9,'Exten':_0x2fa1('0xe1'),'Context':_0x2fa1('0x18c'),'Priority':'1','variable':_0x205226,'timeout':(_0x2c12d2['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x2e029f})['then'](function(_0x315974){return _0x276c99(_0x315974);})['catch'](function(_0x4fc090){_0x2c12d2[_0x2fa1('0x69')]+=0x1;var _0x270f47=new History(_0x37af8d[_0x2fa1('0x27')][_0x2e029f]);logger[_0x2fa1('0x95')](util[_0x2fa1('0x7c')](_0x2fa1('0x18d'),JSON[_0x2fa1('0x7b')](_0x4fc090)));_0x270f47[_0x2fa1('0xe5')]=0xe;_0x270f47['statedesc']=_0x2fa1('0x18e');_0x270f47[_0x2fa1('0xa6')]=moment()[_0x2fa1('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');_0x270f47[_0x2fa1('0xa5')]=_0x270f47[_0x2fa1('0xa6')];_0x37af8d[_0x2fa1('0xc6')](_0x270f47)[_0x2fa1('0xad')](loggerCatch('[originate][error]'));_0x37af8d[_0x2fa1('0xc4')](_0x270f47)[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x18f')))[_0x2fa1('0x12f')](function(){delete _0x37af8d['actions'][_0x2e029f];return _0x1164c6(msgResponse('originate','Error',_0x2fa1('0x190')));});});});};Dialer[_0x2fa1('0x1d')][_0x2fa1('0x33')]=function(_0x4c7904){var _0x5876a4=this['actions'][_0x4c7904[_0x2fa1('0x127')]];if(_0x5876a4){delete this[_0x2fa1('0x27')][_0x4c7904[_0x2fa1('0x127')]];_0x5876a4[_0x2fa1('0x116')]=moment()[_0x2fa1('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');var _0x1867e6=_0x5876a4[_0x2fa1('0x57')]===_0x2fa1('0x7e')?this[_0x2fa1('0x23')][_0x5876a4['queue']]:this['voiceQueues'][_0x5876a4[_0x2fa1('0x191')]()];if(!this[_0x2fa1('0x192')](_0x4c7904[_0x2fa1('0x193')])){this[_0x2fa1('0xaf')](_0x1867e6);return this[_0x2fa1('0x194')](_0x5876a4,_0x1867e6,_0x4c7904)['catch'](loggerCatch(_0x2fa1('0x195')));}this['uniqueId'][_0x4c7904[_0x2fa1('0xdc')]]=_0x5876a4;}};Dialer[_0x2fa1('0x1d')]['checkRetriveMax']=function(_0x3a087b,_0x345b68,_0x2a78a4){var _0x345b27=new History(_0x345b68);if(_0x345b27[_0x2fa1('0xf3')]+_0x345b27[_0x2fa1('0xf4')]+_0x345b27['countnoanswerretry']+_0x345b27[_0x2fa1('0xf6')]+_0x345b27[_0x2fa1('0x11c')]+_0x345b27[_0x2fa1('0xf7')]+_0x345b27[_0x2fa1('0xf1')]+_0x345b27[_0x2fa1('0xf8')]>=_0x2a78a4[_0x2fa1('0x104')]-0x1){return!![];}switch(_0x3a087b){case 0x3:if(_0x345b27[_0x2fa1('0xf5')]>=_0x2a78a4[_0x2fa1('0x196')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x345b27[_0x2fa1('0xf5')]+=0x1,'scheduledat':moment()[_0x2fa1('0xfd')](_0x2a78a4['dialNoAnswerRetryFrequency'],_0x2fa1('0xfe'))[_0x2fa1('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x345b27[_0x2fa1('0xd0')],'ListId':_0x345b27[_0x2fa1('0xd1')],'VoiceQueueId':_0x345b27['VoiceQueueId']||undefined,'CampaignId':_0x345b27[_0x2fa1('0xd4')]||undefined})[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x197')));break;case 0x5:if(_0x345b27[_0x2fa1('0xf3')]>=_0x2a78a4[_0x2fa1('0x198')]-0x1){return!![];}this[_0x2fa1('0xba')]({'active':![],'countbusyretry':_0x345b27[_0x2fa1('0xf3')]+=0x1,'scheduledat':moment()['add'](_0x2a78a4[_0x2fa1('0x199')],_0x2fa1('0xfe'))[_0x2fa1('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x345b27[_0x2fa1('0xd0')],'ListId':_0x345b27[_0x2fa1('0xd1')],'VoiceQueueId':_0x345b27['VoiceQueueId']||undefined,'CampaignId':_0x345b27[_0x2fa1('0xd4')]||undefined})[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x19a')));break;case 0x8:if(_0x345b27['countcongestionretry']>=_0x2a78a4[_0x2fa1('0x19b')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x345b27[_0x2fa1('0xf4')]+=0x1,'scheduledat':moment()[_0x2fa1('0xfd')](_0x2a78a4[_0x2fa1('0x19c')],_0x2fa1('0xfe'))[_0x2fa1('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x345b27[_0x2fa1('0xd0')],'ListId':_0x345b27[_0x2fa1('0xd1')],'VoiceQueueId':_0x345b27[_0x2fa1('0xd3')]||undefined,'CampaignId':_0x345b27['CampaignId']||undefined})[_0x2fa1('0xad')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x345b27[_0x2fa1('0xf6')]>=_0x2a78a4[_0x2fa1('0x19d')]-0x1){return!![];}else{this[_0x2fa1('0xba')]({'active':![],'countnosuchnumberretry':_0x345b27[_0x2fa1('0xf6')]+=0x1,'scheduledat':moment()['add'](_0x2a78a4[_0x2fa1('0x19e')],_0x2fa1('0xfe'))[_0x2fa1('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x345b27['ContactId'],'ListId':_0x345b27[_0x2fa1('0xd1')],'VoiceQueueId':_0x345b27[_0x2fa1('0xd3')]||undefined,'CampaignId':_0x345b27[_0x2fa1('0xd4')]||undefined})[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x19f')));}break;case 0xa:if(_0x345b27[_0x2fa1('0x11c')]>=_0x2a78a4[_0x2fa1('0x1a0')]-0x1){return!![];}this[_0x2fa1('0xba')]({'active':![],'countdropretry':_0x345b27[_0x2fa1('0x11c')]+=0x1,'scheduledat':moment()['add'](_0x2a78a4[_0x2fa1('0x11d')],'minutes')['format'](_0x2fa1('0xff')),'ContactId':_0x345b27['ContactId'],'ListId':_0x345b27[_0x2fa1('0xd1')],'VoiceQueueId':_0x345b27['VoiceQueueId']||undefined,'CampaignId':_0x345b27[_0x2fa1('0xd4')]||undefined})[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x11e')));break;case 0xb:if(_0x345b27[_0x2fa1('0xf7')]>=_0x2a78a4[_0x2fa1('0x125')]-0x1){return!![];}this[_0x2fa1('0xba')]({'active':![],'countabandonedretry':_0x345b27[_0x2fa1('0xf7')]+=0x1,'scheduledat':moment()[_0x2fa1('0xfd')](_0x2a78a4[_0x2fa1('0x1a1')],_0x2fa1('0xfe'))['format'](_0x2fa1('0xff')),'ContactId':_0x345b27['ContactId'],'ListId':_0x345b27[_0x2fa1('0xd1')],'VoiceQueueId':_0x345b27[_0x2fa1('0xd3')]||undefined,'CampaignId':_0x345b27['CampaignId']||undefined})[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x126')));break;case 0x13:if(_0x345b27[_0x2fa1('0xf1')]>=_0x2a78a4[_0x2fa1('0x105')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x345b27[_0x2fa1('0xf1')]+=0x1,'scheduledat':moment()[_0x2fa1('0xfd')](_0x2a78a4[_0x2fa1('0x1a2')],'minutes')[_0x2fa1('0x7c')](_0x2fa1('0xff')),'ContactId':_0x345b27[_0x2fa1('0xd0')],'ListId':_0x345b27['ListId'],'VoiceQueueId':_0x345b27[_0x2fa1('0xd3')]||undefined,'CampaignId':_0x345b27[_0x2fa1('0xd4')]||undefined})[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x100')));break;case 0x14:if(_0x345b27['countagentrejectretry']>=_0x2a78a4[_0x2fa1('0x1a3')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x345b27[_0x2fa1('0xf8')]+=0x1,'scheduledat':moment()[_0x2fa1('0xfd')](_0x2a78a4[_0x2fa1('0x1a4')],_0x2fa1('0xfe'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x345b27[_0x2fa1('0xd0')],'ListId':_0x345b27[_0x2fa1('0xd1')],'VoiceQueueId':_0x345b27['VoiceQueueId']||undefined,'CampaignId':_0x345b27[_0x2fa1('0xd4')]||undefined})[_0x2fa1('0xad')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x2fa1('0x1d')]['callProgressDetecting']=function(_0x26a05b,_0x37305b,_0x1b95ad){var _0x5b96f3=this;var _0x1b71fe=new History(_0x26a05b);return new BPromise(function(_0x3c8d12,_0x54e7ba){if(_[_0x2fa1('0x40')](_0x37305b)&&typeof _0x37305b!==_0x2fa1('0x163')){return _0x54e7ba(msgResponse(_0x2fa1('0x1a5'),'Failure','entity\x20is\x20undefine'));}if(_[_0x2fa1('0x40')](_0x1b95ad)&&typeof _0x1b95ad!==_0x2fa1('0x163')){return _0x54e7ba(msgResponse('[callProgressDetecting]','Failure',_0x2fa1('0x1a6')));}switch(_0x1b95ad[_0x2fa1('0x10d')]){case'0':_0x37305b[_0x2fa1('0x68')]+=0x1;_0x1b71fe[_0x2fa1('0xe5')]=0x0;_0x1b71fe[_0x2fa1('0xe6')]=_0x2fa1('0x1a7');_0x1b71fe['countnosuchnumberretry']+=0x1;_0x1b71fe['countglobal']+=0x1;ami[_0x2fa1('0x4e')](_0x2fa1('0x1a8'),ut[_0x2fa1('0xea')](_0x26a05b,_0x2fa1('0x1a9')));_0x5b96f3[_0x2fa1('0xc6')](_0x1b71fe)['catch'](loggerCatch(_0x2fa1('0xf2')));if(_0x5b96f3[_0x2fa1('0x1aa')](0x0,_0x26a05b,_0x37305b)){if(_0x1b71fe['countnosuchnumberretry']>=_0x37305b['dialNoSuchNumberMaxRetry']){_0x5b96f3['createStateFinal'](_0x1b71fe,_0x3c8d12,_0x54e7ba,_0x2fa1('0x1ab'));}else{_0x5b96f3[_0x2fa1('0xf9')](_0x1b71fe,_0x3c8d12,_0x54e7ba,_0x2fa1('0x1ab'));}}break;case'3':_0x37305b['outboundNoAnswerCallsDay']+=0x1;_0x1b71fe[_0x2fa1('0xe5')]=0x3;_0x1b71fe['statedesc']='NoAnswer';_0x1b71fe[_0x2fa1('0xf5')]+=0x1;_0x1b71fe[_0x2fa1('0x103')]+=0x1;ami[_0x2fa1('0x4e')](_0x2fa1('0x1ac'),ut['buildObj'](_0x26a05b,_0x2fa1('0x1ad')));_0x5b96f3['createHistory'](_0x1b71fe)[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x1ae')));if(_0x5b96f3[_0x2fa1('0x1aa')](0x3,_0x26a05b,_0x37305b)){if(_0x1b71fe[_0x2fa1('0xf5')]>=_0x37305b[_0x2fa1('0x196')]){_0x5b96f3['createStateFinal'](_0x1b71fe,_0x3c8d12,_0x54e7ba,'reason\x203\x20ringing\x20no\x20answer');}else{_0x5b96f3[_0x2fa1('0xf9')](_0x1b71fe,_0x3c8d12,_0x54e7ba,_0x2fa1('0x1af'));}}break;case'5':_0x37305b[_0x2fa1('0x63')]+=0x1;_0x1b71fe[_0x2fa1('0xe5')]=0x5;_0x1b71fe[_0x2fa1('0xe6')]='Busy';_0x1b71fe['countbusyretry']+=0x1;_0x1b71fe['countglobal']+=0x1;ami[_0x2fa1('0x4e')](_0x2fa1('0x1b0'),ut[_0x2fa1('0xea')](_0x26a05b,_0x2fa1('0x1b1')));_0x5b96f3[_0x2fa1('0xc6')](_0x1b71fe)[_0x2fa1('0xad')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x5b96f3[_0x2fa1('0x1aa')](0x5,_0x26a05b,_0x37305b)){if(_0x1b71fe[_0x2fa1('0xf3')]>=_0x37305b[_0x2fa1('0x198')]){_0x5b96f3[_0x2fa1('0xfb')](_0x1b71fe,_0x3c8d12,_0x54e7ba,_0x2fa1('0x1b2'));}else{_0x5b96f3[_0x2fa1('0xf9')](_0x1b71fe,_0x3c8d12,_0x54e7ba,'reason\x205\x20busy');}}break;case'8':_0x37305b[_0x2fa1('0x64')]+=0x1;_0x1b71fe['state']=0x8;_0x1b71fe[_0x2fa1('0xe6')]='Congestion';_0x1b71fe[_0x2fa1('0xf4')]+=0x1;_0x1b71fe[_0x2fa1('0x103')]+=0x1;ami[_0x2fa1('0x4e')](_0x2fa1('0x1b3'),ut[_0x2fa1('0xea')](_0x26a05b,_0x2fa1('0x1b4')));_0x5b96f3[_0x2fa1('0xc6')](_0x1b71fe)['catch'](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x5b96f3['checkRetriveMax'](0x8,_0x26a05b,_0x37305b)){if(_0x1b71fe[_0x2fa1('0xf4')]>=_0x37305b[_0x2fa1('0x19b')]){_0x5b96f3[_0x2fa1('0xfb')](_0x1b71fe,_0x3c8d12,_0x54e7ba,'reason\x208\x20congestion');}else{_0x5b96f3[_0x2fa1('0xf9')](_0x1b71fe,_0x3c8d12,_0x54e7ba,_0x2fa1('0x1b5'));}}break;case'11':_0x37305b[_0x2fa1('0x1b6')]+=0x1;_0x1b71fe[_0x2fa1('0xe5')]=0xb;_0x1b71fe[_0x2fa1('0xe6')]=_0x2fa1('0x123');_0x1b71fe[_0x2fa1('0xf7')]+=0x1;_0x1b71fe[_0x2fa1('0x103')]+=0x1;_0x5b96f3[_0x2fa1('0xc6')](_0x1b71fe)[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x1b7')));if(_0x5b96f3[_0x2fa1('0x1aa')](0xb,_0x26a05b,_0x37305b)){if(_0x1b71fe['countabandonedretry']>=_0x37305b[_0x2fa1('0x125')]){_0x5b96f3[_0x2fa1('0xfb')](_0x1b71fe,_0x3c8d12,_0x54e7ba,'reason\x2011\x20abandoned');}else{_0x5b96f3[_0x2fa1('0xf9')](_0x1b71fe,_0x3c8d12,_0x54e7ba,_0x2fa1('0x1b8'));}}break;case'20':_0x37305b['outboundRejectCallsDay']+=0x1;_0x1b71fe[_0x2fa1('0xe5')]=0x14;_0x1b71fe[_0x2fa1('0xe6')]=_0x2fa1('0x1b9');_0x1b71fe[_0x2fa1('0xf8')]+=0x1;_0x1b71fe[_0x2fa1('0x103')]+=0x1;ami[_0x2fa1('0x4e')](_0x2fa1('0x1ba'),ut[_0x2fa1('0xea')](_0x26a05b,_0x2fa1('0x1bb')));_0x5b96f3[_0x2fa1('0xc6')](_0x1b71fe)['catch'](loggerCatch(_0x2fa1('0x1bc')));if(_0x5b96f3[_0x2fa1('0x1aa')](0x14,_0x26a05b,_0x37305b)){if(_0x1b71fe['countagentrejectretry']>=_0x37305b[_0x2fa1('0x1a3')]){_0x5b96f3['createStateFinal'](_0x1b71fe,_0x3c8d12,_0x54e7ba,_0x2fa1('0x1bd'));}else{_0x5b96f3[_0x2fa1('0xf9')](_0x1b71fe,_0x3c8d12,_0x54e7ba,'reason\x2020\x20agentreject');}}break;default:_0x37305b[_0x2fa1('0x6c')]+=0x1;_0x1b71fe[_0x2fa1('0xe5')]=0xc;_0x1b71fe[_0x2fa1('0xe6')]=_0x1b95ad['reason'];_0x5b96f3[_0x2fa1('0xc6')](_0x1b71fe)[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x1be')));if(_0x5b96f3[_0x2fa1('0x1aa')](_0x1b95ad['reason'],_0x26a05b,_0x37305b)){if(_0x1b71fe[_0x2fa1('0xf3')]+_0x1b71fe[_0x2fa1('0xf4')]+_0x1b71fe[_0x2fa1('0xf5')]+_0x1b71fe['countnosuchnumberretry']+_0x1b71fe[_0x2fa1('0x11c')]+_0x1b71fe['countabandonedretry']+_0x1b71fe['countmachineretry']+_0x1b71fe['countagentrejectretry']>=_0x37305b['dialGlobalMaxRetry']){_0x5b96f3['stateGlobal'](_0x1b71fe,_0x3c8d12,_0x54e7ba,_0x1b95ad[_0x2fa1('0x10d')]);}else{_0x5b96f3['createStateFinal'](_0x1b71fe,_0x3c8d12,_0x54e7ba,_0x1b95ad[_0x2fa1('0x10d')]);}}}});};Dialer[_0x2fa1('0x1d')][_0x2fa1('0xf9')]=function(_0x210dc5,_0x19f282,_0x3dc69e,_0x382059){var _0x2ea0a5=new Final(_0x210dc5);_0x2ea0a5[_0x2fa1('0xe5')]=0xf;_0x2ea0a5[_0x2fa1('0xe6')]=_0x2fa1('0x1bf');this[_0x2fa1('0xfb')](_0x2ea0a5,_0x19f282,_0x3dc69e,_0x382059);};Dialer[_0x2fa1('0x1d')][_0x2fa1('0xfb')]=function(_0x512e78,_0x1952e9,_0x37f53f,_0x31a933){this[_0x2fa1('0xc4')](_0x512e78)[_0x2fa1('0xb3')](function(){return _0x1952e9(msgResponse(_0x2fa1('0x1a5'),_0x2fa1('0xd7'),_0x31a933));})[_0x2fa1('0xad')](function(){return _0x37f53f(msgResponse(_0x2fa1('0x1c0'),_0x2fa1('0x13f'),_0x2fa1('0x1c1')));});};Dialer[_0x2fa1('0x1d')][_0x2fa1('0x9')]=function(_0x5221d9){var _0x1f0df6=_0x5221d9[_0x2fa1('0x1c2')]/0x64;var _0x54f8d7=_0x5221d9[_0x2fa1('0x66')]/(_0x5221d9['outboundDropCallsDayTimeout']+_0x5221d9[_0x2fa1('0xe4')]);var _0x585f75=Math[_0x2fa1('0x1c3')](_0x5221d9[_0x2fa1('0x71')]*(_0x5221d9[_0x2fa1('0x1c4')]/0x64));var _0x48a24a=Math[_0x2fa1('0x1c3')](_0x5221d9[_0x2fa1('0x71')]*(_0x5221d9[_0x2fa1('0x1c5')]/0x64));var _0x3dbc19=_0x5221d9[_0x2fa1('0x51')]+_0x5221d9[_0x2fa1('0x56')];var _0xb0b33=Math[_0x2fa1('0x1c6')](_0x5221d9[_0x2fa1('0x1c7')]*_0x5221d9[_0x2fa1('0x75')]*_0x5221d9['predictiveIntervalHitRate']*_0x5221d9[_0x2fa1('0x1c8')]);if(_[_0x2fa1('0x40')](_0x5221d9[_0x2fa1('0x2a')])){if(!_[_0x2fa1('0x40')](_0x5221d9[_0x2fa1('0x77')])){_0x5221d9['startPredictive']=undefined;loggerPredictive['error'](_0x2fa1('0x1c9'),_0x2fa1('0x1ca'));}if(!_[_0x2fa1('0x40')](_0x5221d9['handlePredictive'])){loggerPredictive[_0x2fa1('0x95')](_0x2fa1('0x1c9'),_0x2fa1('0x1cb'));clearInterval(_0x5221d9[_0x2fa1('0x91')]);_0x5221d9[_0x2fa1('0x91')]=undefined;}_0x5221d9[_0x2fa1('0x2a')]=moment()[_0x2fa1('0x7c')](_0x2fa1('0xff'));loggerPredictive[_0x2fa1('0x7f')](_0x5221d9[_0x2fa1('0x43')],_0x2fa1('0x1cc'),_0x5221d9['startProgressive']);this[_0x2fa1('0x152')](_0x5221d9,0x1);}else if(ifInterval(_0x5221d9[_0x2fa1('0x1cd')],_0x5221d9[_0x2fa1('0x2a')])){this[_0x2fa1('0x152')](_0x5221d9,0x1);loggerPredictiveCalls[_0x2fa1('0x7f')]('[startMethodPredictive][StartProgressive][Loop]',_0x5221d9[_0x2fa1('0x2a')],_0x5221d9[_0x2fa1('0x43')]);_0x5221d9[_0x2fa1('0x1c7')]=0x0;_0x5221d9['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x1f0df6<_0x54f8d7&&_0x5221d9['dialPredictiveOptimization']===_0x2fa1('0x1ce')){freeVariablesPredictive(_0x5221d9);loggerPredictive[_0x2fa1('0x7f')](_0x2fa1('0x1cf'),'Dropped\x20calls\x20day',_0x54f8d7,_0x2fa1('0x2a'),_0x5221d9[_0x2fa1('0x43')]);}else if(_0xb0b33<_0x5221d9[_0x2fa1('0x70')]&&_0x5221d9[_0x2fa1('0x1d0')]===_0x2fa1('0x1ce')){freeVariablesPredictive(_0x5221d9);loggerPredictive[_0x2fa1('0x7f')](_0x2fa1('0x1d1'),_0x2fa1('0x1d2'),_0xb0b33,_0x2fa1('0x1d3'),_0x5221d9[_0x2fa1('0x70')],_0x2fa1('0x2a'),_0x5221d9[_0x2fa1('0x43')]);}else if(!ifInterval(_0x5221d9['dialPredictiveInterval'],_0x5221d9[_0x2fa1('0x2a')])&&_[_0x2fa1('0x40')](_0x5221d9[_0x2fa1('0x77')])&&!_[_0x2fa1('0x40')](_0x5221d9['startProgressive'])){_0x5221d9[_0x2fa1('0x77')]=moment()[_0x2fa1('0x7c')](_0x2fa1('0xff'));loggerPredictive[_0x2fa1('0x7f')](_0x5221d9[_0x2fa1('0x43')],'started\x20in\x20predictive\x20at',_0x5221d9[_0x2fa1('0x77')]);this[_0x2fa1('0xb8')](_0x5221d9[_0x2fa1('0x1cd')])[_0x2fa1('0xb3')](this[_0x2fa1('0x1d4')](_0x5221d9))[_0x2fa1('0xb3')](mergeDataErlangB(_0x5221d9))[_0x2fa1('0xb3')](this[_0x2fa1('0x1d5')](_0x5221d9))[_0x2fa1('0xad')](loggerCatchPredictive(_0x2fa1('0x1d6'),_0x5221d9));}else if(!ifInterval(_0x5221d9[_0x2fa1('0x1cd')],_0x5221d9[_0x2fa1('0x77')])){_0x5221d9[_0x2fa1('0x70')]=0x0;_0x5221d9['startPredictive']=moment()[_0x2fa1('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x2fa1('0x7f')](_0x5221d9[_0x2fa1('0x43')],'recalculate\x20predictive\x20at',_0x5221d9[_0x2fa1('0x77')]);clearInterval(_0x5221d9['handlePredictive']);_0x5221d9['handlePredictive']=undefined;this[_0x2fa1('0xb8')](_0x5221d9['dialPredictiveInterval'])['then'](this[_0x2fa1('0x1d4')](_0x5221d9))['then'](mergeDataErlangB(_0x5221d9))[_0x2fa1('0xb3')](this['startMethodPredictive'](_0x5221d9))[_0x2fa1('0xad')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x5221d9));}else if(_0x5221d9[_0x2fa1('0x71')]&&_0x3dbc19<_0x5221d9['predictiveIntervalAvailable']-_0x48a24a){freeVariablesPredictive(_0x5221d9);loggerPredictive[_0x2fa1('0x7f')](_0x5221d9[_0x2fa1('0x43')],_0x2fa1('0x1d7'),_0x3dbc19,_0x2fa1('0x1d8'),_0x5221d9[_0x2fa1('0x71')],'-',_0x48a24a,'=',_0x5221d9['predictiveIntervalAvailable']-_0x48a24a,')');}else if(_0x5221d9['predictiveIntervalAvailable']&&_0x3dbc19>_0x5221d9['predictiveIntervalAvailable']+_0x585f75){freeVariablesPredictive(_0x5221d9);loggerPredictive[_0x2fa1('0x7f')](_0x5221d9[_0x2fa1('0x43')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x3dbc19,')\x20are\x20more\x20than\x20threshold\x20(',_0x5221d9['predictiveIntervalAvailable'],'+',_0x585f75,'=',_0x5221d9[_0x2fa1('0x71')]+_0x585f75,')');}};Dialer['prototype'][_0x2fa1('0x1d4')]=function(_0xbbcc8){var _0x3bfd05=this;return function(_0x5eb957){return new BPromise(function(_0x4c3c5a,_0x5a9583){_[_0x2fa1('0xce')](_0xbbcc8,_0x5eb957[0x0]);if(checkGetDataPredictive(_0x5eb957[0x0])){var _0x25bde7=_0xbbcc8['predictiveIntervalAvailable']=_0xbbcc8['talking']+_0xbbcc8[_0x2fa1('0x51')];var _0x527833=_0xbbcc8[_0x2fa1('0x1cd')]*0x3c;var _0x2cfc4f=_0x5eb957[0x0][_0x2fa1('0x6f')]+_0x5eb957[0x0][_0x2fa1('0x6e')];var _0x2723a2=(_0x5eb957[0x0][_0x2fa1('0x6d')]+_0x5eb957[0x0][_0x2fa1('0x117')]+_0x5eb957[0x0][_0x2fa1('0x84')])/_0x5eb957[0x0][_0x2fa1('0x72')];_0xbbcc8['predictiveIntervalHitRate']=_0x2723a2>0x0?_0x2723a2:0x1;switch(_0xbbcc8[_0x2fa1('0x1d0')]){case _0x2fa1('0x1ce'):var _0x25827=_0xbbcc8['dialPredictiveOptimizationPercentage']/0x64;return _0x3bfd05['abandonmentRate'](_0x25bde7,_0x527833,_0x2cfc4f,_0x2723a2,_0x25827)['then'](function(_0x531c49){return _0x4c3c5a(_0x531c49);});case _0x2fa1('0x1d9'):var _0x4b78f6=_0xbbcc8[_0x2fa1('0x1c2')]/0x64;return _0x3bfd05[_0x2fa1('0x1da')](_0x25bde7,_0x527833,_0x2cfc4f,_0x2723a2,_0x4b78f6)[_0x2fa1('0xb3')](function(_0x3c0c2e){return _0x4c3c5a(_0x3c0c2e);});default:return _0x5a9583(msgResponse(_0x2fa1('0x1db'),_0x2fa1('0x13f'),_0x2fa1('0x1dc')));}}else{return _0x5a9583(msgResponse(_0x2fa1('0x1db'),_0x2fa1('0x13f'),_0x2fa1('0x1dd')));}});};};Dialer['prototype'][_0x2fa1('0x1de')]=function(_0x4599ed){var _0x46e192=this;return function(_0x4cdb68){return new BPromise(function(_0x4a3a52,_0x589b8a){_[_0x2fa1('0xce')](_0x4599ed,_0x4cdb68[0x0]);if(checkGetDataPredictive(_0x4cdb68[0x0])){loggerPredictive[_0x2fa1('0x7f')](JSON[_0x2fa1('0x7b')](_0x4cdb68[0x0]));if(_0x4599ed[_0x2fa1('0x1d0')]==='dropRate'){return _0x46e192['getVoiceQueueRtPauses'](_0x4599ed['id'])[_0x2fa1('0xb3')](function(_0x3083d2){var _0xcff8b7=_0x4599ed[_0x2fa1('0x52')]-_0x3083d2[0x0][_0x2fa1('0x1df')];var _0x1ba1e1=_0x4599ed['dialPredictiveInterval']*0x3c;var _0x493241=_0x4cdb68[0x0][_0x2fa1('0x6f')]+_0x4cdb68[0x0]['predictiveIntervalAvgHoldtime'];var _0x1cfcc5=(_0x4cdb68[0x0][_0x2fa1('0x6d')]+_0x4cdb68[0x0][_0x2fa1('0x117')]+_0x4cdb68[0x0][_0x2fa1('0x84')])/_0x4cdb68[0x0][_0x2fa1('0x72')];var _0x4da2d3=_0x4599ed[_0x2fa1('0x1c2')]/0x64;_0x4599ed['predictiveIntervalPauses']=_0x3083d2[0x0][_0x2fa1('0x1df')]||0x0;_0x4599ed[_0x2fa1('0x1e0')]=_0x1cfcc5>0x0?_0x1cfcc5:0x1;return _0x46e192[_0x2fa1('0x1e1')](_0xcff8b7,_0x1ba1e1,_0x493241,_0x1cfcc5,_0x4da2d3);})['then'](function(_0x394944){return _0x4a3a52(_0x394944);})[_0x2fa1('0xad')](function(_0x1de2d1){return _0x589b8a(msgResponse(_0x2fa1('0x1e2'),_0x2fa1('0x13f'),JSON[_0x2fa1('0x7b')](_0x1de2d1)));});}if(_0x4599ed[_0x2fa1('0x1d0')]==='agentBusyFactor'){return _0x46e192[_0x2fa1('0xc2')](_0x4599ed['id'])[_0x2fa1('0xb3')](function(_0x57a7bd){var _0x48e405=_0x4599ed['loggedIn']-_0x57a7bd[0x0][_0x2fa1('0x1df')];var _0x1ab1e4=_0x4599ed[_0x2fa1('0x1cd')]*0x3c;var _0x39c043=_0x4cdb68[0x0][_0x2fa1('0x6f')]+_0x4cdb68[0x0][_0x2fa1('0x6e')];var _0x4517e6=(_0x4cdb68[0x0][_0x2fa1('0x6d')]+_0x4cdb68[0x0][_0x2fa1('0x117')]+_0x4cdb68[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x4cdb68[0x0][_0x2fa1('0x72')];var _0x2dceb3=_0x4599ed[_0x2fa1('0x1c2')]/0x64;_0x4599ed[_0x2fa1('0x1e3')]=_0x57a7bd[0x0][_0x2fa1('0x1df')]||0x0;_0x4599ed['predictiveIntervalHitRate']=_0x4517e6>0x0?_0x4517e6:0x1;return _0x46e192[_0x2fa1('0x1da')](_0x48e405,_0x1ab1e4,_0x39c043,_0x4517e6,_0x2dceb3);})[_0x2fa1('0xb3')](function(_0x46ea76){return _0x4a3a52(_0x46ea76);})['catch'](function(_0x519676){return _0x589b8a(msgResponse(_0x2fa1('0x1e2'),'Failure',JSON[_0x2fa1('0x7b')](_0x519676)));});}}else{return _0x589b8a(msgResponse(_0x2fa1('0x1db'),_0x2fa1('0x13f'),_0x2fa1('0x1dd')));}});};};Dialer[_0x2fa1('0x1d')][_0x2fa1('0x1d5')]=function(_0xe5882e){var _0x308617=this;return function(){var _0x3171f3=0x0;var _0x39b3ee=Math[_0x2fa1('0x1c6')](_0xe5882e['erlangCallToSecond']*0x3e8);if(_0x39b3ee>0x0){_0x39b3ee=_0x39b3ee<0x64?0x64:_0x39b3ee;loggerPredictive[_0x2fa1('0x7f')](_0xe5882e[_0x2fa1('0x43')],'one\x20call\x20every:',_0x39b3ee,_0x2fa1('0x4c'));_0xe5882e[_0x2fa1('0x91')]=setInterval(function(){_0x308617[_0x2fa1('0x91')](_0xe5882e);loggerPredictiveCalls[_0x2fa1('0x7f')](_0x2fa1('0x1e4'),_0x3171f3+=0x1);},_0x39b3ee);}else{loggerPredictive[_0x2fa1('0x7f')](_0xe5882e[_0x2fa1('0x43')],_0x2fa1('0x1e5'));}};};Dialer[_0x2fa1('0x1d')][_0x2fa1('0x1e6')]=function(_0x1f2924,_0x2f7739){var _0xee530f=this;return function(_0x458945){if(_[_0x2fa1('0x4a')](_0x458945)){if(_[_0x2fa1('0xdd')](_0x2f7739['UserId'])||!_0x2f7739[_0x2fa1('0x1e7')]){if(_0x1f2924[_0x2fa1('0x5d')]===_0x2fa1('0x155')){_0x1f2924[_0x2fa1('0x12d')]=_[_0x2fa1('0x40')](_0x1f2924['queueStatusComplete'])?!![]:_0x1f2924[_0x2fa1('0x12d')];var _0x45e290=uuid['v4']();_0xee530f[_0x2fa1('0x27')][_0x45e290]=new Action(_0x1f2924,_0x2f7739,_0x45e290);loggerBooked[_0x2fa1('0x7f')](_0x2fa1('0x1e8'),_0x45e290,_0x2fa1('0x1e9'),JSON[_0x2fa1('0x7b')](_0x1f2924[_0x2fa1('0x12d')]),_0x2fa1('0x1ea'),_0x1f2924[_0x2fa1('0x43')]);if(_0x1f2924[_0x2fa1('0x12d')]){_0x1f2924[_0x2fa1('0x12d')]=![];_0xee530f[_0x2fa1('0x2c')][_0xee530f[_0x2fa1('0x27')][_0x45e290]['queue']]=[];ami[_0x2fa1('0xaa')]({'actionid':_0x45e290,'action':'queuestatus','queue':_0x1f2924[_0x2fa1('0x43')]})[_0x2fa1('0xad')](function(){_0xee530f[_0x2fa1('0xaf')](_0x1f2924);_0xee530f[_0x2fa1('0xba')]({'active':![],'ContactId':_0xee530f[_0x2fa1('0x27')][_0x45e290][_0x2fa1('0xd0')],'ListId':_0xee530f['actions'][_0x45e290][_0x2fa1('0xd1')],'VoiceQueueId':_0xee530f['actions'][_0x45e290]['VoiceQueueId']||undefined,'CampaignId':_0xee530f[_0x2fa1('0x27')][_0x45e290]['CampaignId']||undefined})['catch'](loggerCatch(_0x2fa1('0x1eb')));delete _0xee530f[_0x2fa1('0x27')][_0x45e290];});}else{loggerBooked[_0x2fa1('0x7f')](_0x2fa1('0x1ec'),JSON[_0x2fa1('0x7b')](_0x1f2924[_0x2fa1('0x12d')]),_0x2fa1('0x1ea'),_0x1f2924[_0x2fa1('0x43')]);_0xee530f[_0x2fa1('0xaf')](_0x1f2924);_0xee530f[_0x2fa1('0xba')]({'active':![],'ContactId':_0xee530f[_0x2fa1('0x27')][_0x45e290][_0x2fa1('0xd0')],'ListId':_0xee530f[_0x2fa1('0x27')][_0x45e290][_0x2fa1('0xd1')],'VoiceQueueId':_0xee530f[_0x2fa1('0x27')][_0x45e290]['VoiceQueueId']||undefined,'CampaignId':_0xee530f[_0x2fa1('0x27')][_0x45e290]['CampaignId']||undefined})[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x1eb')));delete _0xee530f[_0x2fa1('0x27')][_0x45e290];}}else{return _0xee530f[_0x2fa1('0x162')](_0x1f2924,_0x2f7739);}}else{if(getDiff(_0x2f7739['scheduledat'])<_0x1f2924['dialRecallMeTimeout']*0x3c){if(_0x2f7739[_0x2fa1('0x1ed')]&&!_0x2f7739[_0x2fa1('0x1ed')]['voicePause']){_0xee530f[_0x2fa1('0x21')][_0x2fa1('0x135')](_0x2f7739['id'])['finally'](function(){_0xee530f[_0x2fa1('0xaf')](_0x1f2924);});}else{_0xee530f[_0x2fa1('0xbc')]({'active':![]},_0x2f7739['id'],0x1)['finally'](function(){_0xee530f[_0x2fa1('0xaf')](_0x1f2924);});}}else{_0x1f2924[_0x2fa1('0x6a')]+=0x1;_0xee530f['updateOriginated'](_0x1f2924);if(_0x1f2924['dialRecallInQueue']){_0xee530f['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x2f7739[_0x2fa1('0xd0')],'ListId':_0x2f7739[_0x2fa1('0xd1')],'VoiceQueueId':_0x2f7739[_0x2fa1('0xd3')]||undefined,'CampaignId':_0x2f7739[_0x2fa1('0xd4')]||undefined})[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x1ee')));_0xee530f[_0x2fa1('0xc6')](createObjHistory(_0x1f2924,_0x2f7739,_0x2fa1('0x1ef'),0x17,_0x2fa1('0x1f0')))[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x1f1')));}else{_0xee530f[_0x2fa1('0xcd')](createObjHistory(_0x1f2924,_0x2f7739,'RECALLFAILEDTIMEOUT',0x16,_0x2fa1('0x1f2')),_0x2fa1('0x1f3'),_0x2fa1('0x1f4'));}}}}else{_0x1f2924['outboundBlacklistCallsDay']+=0x1;_0xee530f[_0x2fa1('0xcd')](createObjHistory(_0x1f2924,_0x2f7739,'BLACKLIST',0xd,'Blacklist'),_0x2fa1('0x1f5'),'[Originate][MoveBlacklist]');throw _0x2fa1('0x1f6');}};};Dialer[_0x2fa1('0x1d')][_0x2fa1('0x158')]=function(_0x60294d){var _0x178aee=this;var _0x4f2e57=_0x60294d['limitCalls']-_0x60294d[_0x2fa1('0x73')]-_0x60294d[_0x2fa1('0xbf')];emitCampaignSummary(_0x60294d);if(_0x4f2e57>0x0){if(_0x4f2e57>this[_0x2fa1('0x25')]){_0x4f2e57=this[_0x2fa1('0x25')];}_0x60294d[_0x2fa1('0xbf')]+=_0x4f2e57;this[_0x2fa1('0xc0')](_0x60294d['id'],_0x4f2e57,_0x60294d[_0x2fa1('0x1f7')],_0x60294d)['then'](function(_0x4811a6){_0x60294d[_0x2fa1('0xbf')]-=_0x4f2e57;_0x60294d[_0x2fa1('0xbf')]=_0x60294d['temp']>0x0?_0x60294d[_0x2fa1('0xbf')]:0x0;if(!checkContactEmpty(_0x4811a6)){_0x60294d['message']=_0x2fa1('0x1f8');logger[_0x2fa1('0x7f')]('[getContactCampaign2][Empty]'+_0x60294d['name']);}else{_0x60294d[_0x2fa1('0x73')]+=_0x4811a6[_0x2fa1('0x98')];_0x60294d[_0x2fa1('0x41')]=_0x2fa1('0x1f9');for(var _0x1119c8=0x0;_0x1119c8<_0x4811a6['length'];_0x1119c8+=0x1){_0x60294d[_0x2fa1('0x1fa')]+=0x1;if(_[_0x2fa1('0xdd')](_0x4811a6[_0x1119c8])||_[_0x2fa1('0xdd')](_0x4811a6[_0x1119c8][_0x2fa1('0x166')])||_[_0x2fa1('0xdd')](_0x4811a6[_0x1119c8][_0x2fa1('0x166')][_0x2fa1('0x167')])){_0x178aee[_0x2fa1('0xcb')](_0x2fa1('0x1fb'),_0x60294d,_0x4811a6[_0x1119c8]);}else{_0x178aee[_0x2fa1('0xb6')](_['pick'](_0x4811a6[_0x1119c8],[_0x2fa1('0xd4'),'Contact.phone']))[_0x2fa1('0xb3')](_0x178aee[_0x2fa1('0x1e6')](_0x60294d,_0x4811a6[_0x1119c8]))[_0x2fa1('0xad')](_0x178aee[_0x2fa1('0x1fc')](_0x2fa1('0x1fd'),_0x60294d));}}}})['catch'](loggerGetContactDialer(_0x2fa1('0x1fe'),_0x60294d,_0x4f2e57));}};Dialer[_0x2fa1('0x1d')][_0x2fa1('0x152')]=function(_0x3794a0,_0x480741){var _0x4ef6ce=this;var _0x52b2ef=[];var _0x20761b=_0x480741>=0x1?_0x480741:0x1;if(_0x3794a0['dialMethod']===_0x2fa1('0x155')){_0x20761b=0x1;}var _0x529ae3=Math[_0x2fa1('0x1c6')](_0x3794a0[_0x2fa1('0x51')]*_0x20761b)-_0x3794a0[_0x2fa1('0x73')]-_0x3794a0[_0x2fa1('0xbf')];emitVoiceQueueSummary(_0x3794a0);if(_0x3794a0['dialLimitQueue']>0x0){var _0x3fbf9c=_0x3794a0[_0x2fa1('0x1ff')]-_0x3794a0['originated']-_0x3794a0[_0x2fa1('0x56')]-_0x3794a0[_0x2fa1('0xbf')]-_0x3794a0['pTalking'];if(_0x529ae3>_0x3fbf9c){_0x529ae3=_0x3fbf9c;}}if(_0x529ae3>0x0){if(_0x3794a0[_0x2fa1('0x5d')]===_0x2fa1('0x155')){_0x529ae3=0x1;}if(_0x529ae3>this[_0x2fa1('0x25')]){_0x529ae3=this[_0x2fa1('0x25')];}_0x3794a0['temp']+=_0x529ae3;for(var _0x3282e7 in this[_0x2fa1('0x24')]){if(typeof this[_0x2fa1('0x24')][_0x3282e7]!=='undefined'){if(this[_0x2fa1('0x24')][_0x3282e7][_0x2fa1('0xe5')]==='not_inuse'&&this[_0x2fa1('0x24')][_0x3282e7][_0x2fa1('0xab')]===_0x2fa1('0xdb')){_0x52b2ef[_0x2fa1('0x145')](this[_0x2fa1('0x24')][_0x3282e7]['id']);}}}this[_0x2fa1('0xbe')](_0x3794a0['id'],_0x52b2ef,_0x529ae3,_0x3794a0['dialOrderByScheduledAt'],_0x3794a0)['then'](function(_0x5b71e9){_0x3794a0[_0x2fa1('0xbf')]-=_0x529ae3;_0x3794a0['temp']=_0x3794a0['temp']>0x0?_0x3794a0[_0x2fa1('0xbf')]:0x0;if(!checkContactEmpty(_0x5b71e9)){_0x4ef6ce[_0x2fa1('0xb2')](_0x3794a0)[_0x2fa1('0xb3')](sendMessageReschedule(_0x3794a0))[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x200')));}else{_0x3794a0[_0x2fa1('0x73')]+=_0x5b71e9[_0x2fa1('0x98')];_0x3794a0[_0x2fa1('0x41')]=_0x3794a0[_0x2fa1('0x5d')]===_0x2fa1('0x155')?_0x2fa1('0x16e'):_0x2fa1('0x1f9');for(var _0x2fc25c=0x0;_0x2fc25c<_0x5b71e9[_0x2fa1('0x98')];_0x2fc25c+=0x1){if(_[_0x2fa1('0xdd')](_0x5b71e9[_0x2fc25c])||_[_0x2fa1('0xdd')](_0x5b71e9[_0x2fc25c]['Contact'])||_[_0x2fa1('0xdd')](_0x5b71e9[_0x2fc25c][_0x2fa1('0x166')]['phone'])){_0x4ef6ce[_0x2fa1('0xcb')](_0x2fa1('0x1fb'),_0x3794a0,_0x5b71e9[_0x2fc25c]);}else{_0x4ef6ce[_0x2fa1('0xb4')](_[_0x2fa1('0xcf')](_0x5b71e9[_0x2fc25c],['VoiceQueueId','Contact.phone']))[_0x2fa1('0xb3')](_0x4ef6ce['checkContactBlack'](_0x3794a0,_0x5b71e9[_0x2fc25c]))[_0x2fa1('0xad')](_0x4ef6ce[_0x2fa1('0x1fc')](_0x2fa1('0x1fb'),_0x3794a0));}}}})['catch'](loggerGetContactDialer(_0x2fa1('0x201'),_0x3794a0,_0x529ae3));}};Dialer[_0x2fa1('0x1d')]['handlePredictive']=function(_0x503576){if(_0x503576[_0x2fa1('0x1ff')]>0x0){var _0x2e4821=_0x503576[_0x2fa1('0x1ff')]-_0x503576[_0x2fa1('0x73')]-_0x503576[_0x2fa1('0x56')];if(_0x2e4821>0x0){this[_0x2fa1('0x202')](_0x503576);}else{loggerPredictiveCalls[_0x2fa1('0x7f')](_0x2fa1('0x203'));}}else{this['tryOriginatePredictive'](_0x503576);}};Dialer[_0x2fa1('0x1d')][_0x2fa1('0x202')]=function(_0x554947){var _0x4e485d=this;var _0x8d2042=[];_0x554947[_0x2fa1('0x73')]+=0x1;for(var _0x1ecc00 in this[_0x2fa1('0x24')]){if(typeof this[_0x2fa1('0x24')][_0x1ecc00]!==_0x2fa1('0xc8')){if(this['agents'][_0x1ecc00][_0x2fa1('0xe5')]==='not_inuse'&&this['agents'][_0x1ecc00][_0x2fa1('0xab')]===_0x2fa1('0xdb')){_0x8d2042[_0x2fa1('0x145')](this[_0x2fa1('0x24')][_0x1ecc00]['id']);}}}this[_0x2fa1('0xbe')](_0x554947['id'],_0x8d2042,0x1,_0x554947[_0x2fa1('0x1f7')],_0x554947)['then'](function(_0xf2caa3){if(!checkContactEmpty(_0xf2caa3)){checkContactLowerLimitOriginate(_0x554947,0x1,0x0);_0x4e485d[_0x2fa1('0xb2')](_0x554947)['then'](sendMessageReschedule(_0x554947))[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x200')));}else{_0x554947['message']='RUNNING';if(_[_0x2fa1('0xdd')](_0xf2caa3[0x0])||_[_0x2fa1('0xdd')](_0xf2caa3[0x0][_0x2fa1('0x166')])||_['isNil'](_0xf2caa3[0x0][_0x2fa1('0x166')][_0x2fa1('0x167')])){_0x4e485d[_0x2fa1('0xcb')](_0x2fa1('0x1fb'),_0x554947,_0xf2caa3[0x0]);}else{_0x4e485d[_0x2fa1('0xb4')](_['pick'](_0xf2caa3[0x0],[_0x2fa1('0xd3'),_0x2fa1('0x204')]))[_0x2fa1('0xb3')](_0x4e485d[_0x2fa1('0x1e6')](_0x554947,_0xf2caa3[0x0]))['catch'](_0x4e485d[_0x2fa1('0x1fc')](_0x2fa1('0x205'),_0x554947));}}})[_0x2fa1('0xad')](loggerGetContactDialer('[getContactDialerPredictive]',_0x554947,0x1));emitVoiceQueueSummary(_0x554947);};Dialer[_0x2fa1('0x1d')][_0x2fa1('0x1e1')]=function(_0x43d3f6,_0x4ec696,_0x35c146,_0x37702e,_0x2f9965,_0x3f6d7d){loggerPredictive[_0x2fa1('0x7f')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x2fa1('0x7f')]('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',_0x43d3f6);loggerPredictive[_0x2fa1('0x7f')](_0x2fa1('0x206'),_0x4ec696);loggerPredictive[_0x2fa1('0x7f')](_0x2fa1('0x207'),_0x35c146);loggerPredictive['info'](_0x2fa1('0x208'),_0x37702e);loggerPredictive[_0x2fa1('0x7f')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2f9965);loggerPredictive[_0x2fa1('0x7f')](_0x2fa1('0x87'));return new BPromise(function(_0x433ef5,_0x331d19){if(_0x43d3f6<=0x0||isNaN(_0x43d3f6)){return _0x331d19(msgResponse('[abandonmentRate]',_0x2fa1('0x209'),_0x2fa1('0x20a')+_0x43d3f6));}if(_0x35c146<=0x0||isNaN(_0x35c146)){return _0x331d19(msgResponse('[abandonmentRate]',_0x2fa1('0x209'),_0x2fa1('0x20b')+_0x35c146));}if(_0x37702e<=0x0||isNaN(_0x37702e)){return _0x331d19(msgResponse(_0x2fa1('0x20c'),_0x2fa1('0x209'),'p\x20=\x20'+_0x37702e));}if(_0x4ec696<=0x0||isNaN(_0x4ec696)){return _0x331d19(msgResponse(_0x2fa1('0x20c'),_0x2fa1('0x209'),'interval\x20=\x20'+_0x4ec696));}if(_0x2f9965<=0x0||isNaN(_0x2f9965)){return _0x331d19(msgResponse(_0x2fa1('0x20c'),_0x2fa1('0x209'),_0x2fa1('0x20d')+_0x2f9965));}_0x3f6d7d=_0x3f6d7d||0x0;var _0x290228=0x1/_0x35c146;var _0x108ba7=0x0;var _0x2e55ce=0x0;var _0x3050d0=0x0;var _0x5ad84f=0x0;for(var _0x3f46d7=0x0;_0x3050d0<_0x2f9965;_0x3f46d7+=0x1){_0x2e55ce=_0x3f46d7/_0x4ec696;_0x108ba7=(_0x37702e*_0x2e55ce+_0x3f6d7d)/_0x290228;_0x3050d0=erlangb(_0x108ba7,_0x43d3f6);_0x5ad84f=_0x108ba7/_0x43d3f6*(0x1-erlangb(_0x108ba7,_0x43d3f6));}return _0x433ef5({'erlangCalls':_0x3f46d7,'erlangCallToSecond':_0x4ec696/_0x3f46d7,'erlangAbandonmentRate':_0x3050d0,'erlangBusyFactor':_0x5ad84f});});};Dialer['prototype'][_0x2fa1('0x1da')]=function(_0x282dc6,_0xd2a23,_0x1e2cc4,_0x396d25,_0x50a13c,_0x59dd66){loggerPredictive[_0x2fa1('0x7f')](_0x2fa1('0x20e'));loggerPredictive['info'](_0x2fa1('0x20f'),_0x282dc6);loggerPredictive[_0x2fa1('0x7f')](_0x2fa1('0x206'),_0xd2a23);loggerPredictive[_0x2fa1('0x7f')]('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',_0x1e2cc4);loggerPredictive['info'](_0x2fa1('0x208'),_0x396d25);loggerPredictive[_0x2fa1('0x7f')](_0x2fa1('0x210'),_0x50a13c);loggerPredictive['info']('---------------------------');return new BPromise(function(_0x3a6381,_0x11348a){if(_0x282dc6<=0x0||isNaN(_0x282dc6)){return _0x11348a(msgResponse('[busyFactor]',_0x2fa1('0x209'),_0x2fa1('0x20a')+_0x282dc6));}if(_0x1e2cc4<=0x0||isNaN(_0x1e2cc4)){return _0x11348a(msgResponse(_0x2fa1('0x211'),_0x2fa1('0x209'),_0x2fa1('0x20b')+_0x1e2cc4));}if(_0x396d25<=0x0||isNaN(_0x396d25)){return _0x11348a(msgResponse(_0x2fa1('0x211'),_0x2fa1('0x209'),_0x2fa1('0x212')+_0x396d25));}if(_0xd2a23<=0x0||isNaN(_0xd2a23)){return _0x11348a(msgResponse(_0x2fa1('0x211'),'Error','interval\x20=\x20'+_0xd2a23));}if(_0x50a13c<=0x0||isNaN(_0x50a13c)){return _0x11348a(msgResponse(_0x2fa1('0x211'),'Error',_0x2fa1('0x213')+_0x50a13c));}_0x59dd66=_0x59dd66||0x0;var _0xe22390=0x1/_0x1e2cc4;var _0x5f46cc=0x0;var _0x26b31e=0x0;var _0x58719f=0x0;var _0x1e914d=0x0;for(var _0x451b0a=0x0;_0x1e914d<_0x50a13c;_0x451b0a+=0x1){_0x26b31e=_0x451b0a/_0xd2a23;_0x5f46cc=(_0x396d25*_0x26b31e+_0x59dd66)/_0xe22390;_0x58719f=erlangb(_0x5f46cc,_0x282dc6);_0x1e914d=_0x5f46cc/_0x282dc6*(0x1-erlangb(_0x5f46cc,_0x282dc6));}return _0x3a6381({'erlangCalls':_0x451b0a,'erlangCallToSecond':_0xd2a23/_0x451b0a,'erlangAbandonmentRate':_0x58719f,'erlangBusyFactor':_0x1e914d});});};module[_0x2fa1('0x214')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index ebd6620..dc43442 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 _0xfb90=['countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','calleridname','name','calleridnum','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','util','lodash','milliseconds','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry'];(function(_0x278390,_0x260c54){var _0x2833ee=function(_0x557d5b){while(--_0x557d5b){_0x278390['push'](_0x278390['shift']());}};_0x2833ee(++_0x260c54);}(_0xfb90,0x18f));var _0x0fb9=function(_0x296897,_0x4d23ea){_0x296897=_0x296897-0x0;var _0x2b44ab=_0xfb90[_0x296897];return _0x2b44ab;};'use strict';var util=require(_0x0fb9('0x0'));var _=require(_0x0fb9('0x1'));var moment=require('moment');function getSeconds(_0x1bf5d8,_0x4ff78f){var _0x111b15=moment(_0x1bf5d8)[_0x0fb9('0x2')](0x0);var _0x1b79ee=moment(_0x4ff78f)[_0x0fb9('0x2')](0x0);return _0x111b15['diff'](_0x1b79ee,_0x0fb9('0x3'));}function QueueCallerAbandon(_0x1701b5,_0x2dc28a){this[_0x0fb9('0x4')]=_0x1701b5[_0x0fb9('0x4')];this['type']=_0x1701b5[_0x0fb9('0x5')];this[_0x0fb9('0x6')]=_0x1701b5[_0x0fb9('0x5')]===_0x0fb9('0x7')?_0x0fb9('0x8'):_0x1701b5['type'];this[_0x0fb9('0x9')]=_0x1701b5[_0x0fb9('0x9')];this['countcongestionretry']=_0x1701b5[_0x0fb9('0xa')];this[_0x0fb9('0xb')]=_0x1701b5[_0x0fb9('0xb')];this[_0x0fb9('0xc')]=_0x1701b5[_0x0fb9('0x9')]+_0x1701b5[_0x0fb9('0xa')]+_0x1701b5[_0x0fb9('0xb')]+_0x1701b5['countnosuchnumberretry']+_0x1701b5[_0x0fb9('0xd')]+_0x1701b5[_0x0fb9('0xe')]+_0x1701b5['countmachineretry']+_0x1701b5[_0x0fb9('0xf')];this[_0x0fb9('0x10')]=_0x1701b5[_0x0fb9('0x10')];this[_0x0fb9('0xd')]=_0x1701b5[_0x0fb9('0xd')];this[_0x0fb9('0xe')]=_0x1701b5['countabandonedretry'];this['countmachineretry']=_0x1701b5[_0x0fb9('0x11')];this['countagentrejectretry']=_0x1701b5[_0x0fb9('0xf')];this['uniqueid']=_0x2dc28a['uniqueid'];this[_0x0fb9('0x12')]=_0x1701b5[_0x0fb9('0x13')];this[_0x0fb9('0x14')]=_0x1701b5['number'];this[_0x0fb9('0x15')]=_0x1701b5[_0x0fb9('0x15')];this[_0x0fb9('0x16')]=_0x1701b5[_0x0fb9('0x16')];this[_0x0fb9('0x17')]=_0x1701b5['droptime'];this[_0x0fb9('0x18')]=this[_0x0fb9('0x17')];this[_0x0fb9('0x19')]=getSeconds(_0x1701b5[_0x0fb9('0x16')],_0x1701b5['starttime']);this[_0x0fb9('0x1a')]=getSeconds(this['droptime'],_0x1701b5[_0x0fb9('0x16')]);this[_0x0fb9('0x1b')]=0x0;this['queue']=_0x2dc28a['queue'];this[_0x0fb9('0x1c')]=_0x2dc28a[_0x0fb9('0x1d')];this[_0x0fb9('0x1e')]=_0x2dc28a[_0x0fb9('0x1e')];this[_0x0fb9('0x1f')]=_0x1701b5[_0x0fb9('0x1f')];this[_0x0fb9('0x20')]=_0x1701b5['callbackuniqueid'];this[_0x0fb9('0x21')]=_0x1701b5[_0x0fb9('0x21')];this[_0x0fb9('0x22')]=_0x1701b5[_0x0fb9('0x22')];this[_0x0fb9('0x23')]=_0x1701b5[_0x0fb9('0x23')];this['ListId']=_0x1701b5[_0x0fb9('0x24')];this[_0x0fb9('0x25')]=_0x1701b5['UserId'];this['VoiceQueueId']=_0x1701b5[_0x0fb9('0x26')];this['CampaignId']=_0x1701b5['CampaignId'];this[_0x0fb9('0x27')]=_0x1701b5[_0x0fb9('0x27')]||'';this[_0x0fb9('0x28')]=_0x1701b5[_0x0fb9('0x28')]||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0xad0d=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','milliseconds','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','droptime','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x1187d6,_0x4c8832){var _0x412cf4=function(_0xdbec93){while(--_0xdbec93){_0x1187d6['push'](_0x1187d6['shift']());}};_0x412cf4(++_0x4c8832);}(_0xad0d,0x77));var _0xdad0=function(_0x4e6318,_0x54feed){_0x4e6318=_0x4e6318-0x0;var _0x22d424=_0xad0d[_0x4e6318];return _0x22d424;};'use strict';var util=require(_0xdad0('0x0'));var _=require(_0xdad0('0x1'));var moment=require('moment');function getSeconds(_0x279a17,_0x43e33c){var _0x331d8c=moment(_0x279a17)[_0xdad0('0x2')](0x0);var _0x429596=moment(_0x43e33c)[_0xdad0('0x2')](0x0);return _0x331d8c['diff'](_0x429596,_0xdad0('0x3'));}function QueueCallerAbandon(_0x36482d,_0x17f8d5){this[_0xdad0('0x4')]=_0x36482d[_0xdad0('0x4')];this[_0xdad0('0x5')]=_0x36482d['type'];this[_0xdad0('0x6')]=_0x36482d[_0xdad0('0x5')]===_0xdad0('0x7')?_0xdad0('0x8'):_0x36482d[_0xdad0('0x5')];this['countbusyretry']=_0x36482d[_0xdad0('0x9')];this[_0xdad0('0xa')]=_0x36482d[_0xdad0('0xa')];this[_0xdad0('0xb')]=_0x36482d['countnoanswerretry'];this['countglobal']=_0x36482d['countbusyretry']+_0x36482d[_0xdad0('0xa')]+_0x36482d['countnoanswerretry']+_0x36482d[_0xdad0('0xc')]+_0x36482d[_0xdad0('0xd')]+_0x36482d[_0xdad0('0xe')]+_0x36482d[_0xdad0('0xf')]+_0x36482d[_0xdad0('0x10')];this[_0xdad0('0xc')]=_0x36482d[_0xdad0('0xc')];this['countdropretry']=_0x36482d[_0xdad0('0xd')];this[_0xdad0('0xe')]=_0x36482d[_0xdad0('0xe')];this['countmachineretry']=_0x36482d['countmachineretry'];this[_0xdad0('0x10')]=_0x36482d[_0xdad0('0x10')];this[_0xdad0('0x11')]=_0x17f8d5[_0xdad0('0x11')];this[_0xdad0('0x12')]=_0x36482d[_0xdad0('0x13')];this[_0xdad0('0x14')]=_0x36482d['number'];this[_0xdad0('0x15')]=_0x36482d['starttime'];this[_0xdad0('0x16')]=_0x36482d['responsetime'];this[_0xdad0('0x17')]=_0x36482d[_0xdad0('0x17')];this[_0xdad0('0x18')]=this[_0xdad0('0x17')];this['ringtime']=getSeconds(_0x36482d[_0xdad0('0x16')],_0x36482d[_0xdad0('0x15')]);this['holdtime']=getSeconds(this[_0xdad0('0x17')],_0x36482d['responsetime']);this['talktime']=0x0;this['queue']=_0x17f8d5[_0xdad0('0x8')];this[_0xdad0('0x19')]=_0x17f8d5['connectedlinename'];this[_0xdad0('0x1a')]=_0x17f8d5[_0xdad0('0x1a')];this[_0xdad0('0x1b')]=_0x36482d['callback'];this[_0xdad0('0x1c')]=_0x36482d[_0xdad0('0x1c')];this[_0xdad0('0x1d')]=_0x36482d[_0xdad0('0x1d')];this[_0xdad0('0x1e')]=_0x36482d[_0xdad0('0x1e')];this[_0xdad0('0x1f')]=_0x36482d[_0xdad0('0x1f')];this[_0xdad0('0x20')]=_0x36482d[_0xdad0('0x20')];this[_0xdad0('0x21')]=_0x36482d[_0xdad0('0x21')];this[_0xdad0('0x22')]=_0x36482d[_0xdad0('0x22')];this[_0xdad0('0x23')]=_0x36482d[_0xdad0('0x23')];this[_0xdad0('0x24')]=_0x36482d['originatecalleridnum']||'';this['originatecalleridname']=_0x36482d[_0xdad0('0x25')]||'';}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 7bb33e8..fa584fc 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(_0x14328f,_0x396cf7){var _0x53aaab=function(_0x2d43bc){while(--_0x2d43bc){_0x14328f['push'](_0x14328f['shift']());}};_0x53aaab(++_0x396cf7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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(_0x14b0c7,_0x5b6f81){var _0x480db0=function(_0x10af9f){while(--_0x10af9f){_0x14b0c7['push'](_0x14b0c7['shift']());}};_0x480db0(++_0x5b6f81);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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 cf3ecaf..eaaac37 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 _0x3919=['Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','util','lodash','bluebird','moment','path','../../../config/logger','fax','../ami','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','actions','newchannel','syncNewchannel','bind','syncVarSet','newstate','syncNewState','syncFaxStatus','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','context','from-voip-provider','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','prototype','variable','hasOwnProperty','value','channelstate','channelstatedesc','syncNewExten','operation','status','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','parse','.pdf','application/pdf','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20sendFile\x20','faxstatus','SENDING\x20FAILED:\x20','faxstatusstring','SENDING\x20FAILED','send','FaxAccountId','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','execute','format','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','execOriginate','addVariables','ext','isTrunkReachable','isNil','active','trunks','SIP/%s','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]'];(function(_0x351fba,_0x190fd3){var _0xfa3b34=function(_0x259bf1){while(--_0x259bf1){_0x351fba['push'](_0x351fba['shift']());}};_0xfa3b34(++_0x190fd3);}(_0x3919,0x166));var _0x9391=function(_0x4df452,_0x13c538){_0x4df452=_0x4df452-0x0;var _0x151d27=_0x3919[_0x4df452];return _0x151d27;};'use strict';var util=require(_0x9391('0x0'));var _=require(_0x9391('0x1'));var BPromise=require(_0x9391('0x2'));var uuid=require('uuid');var moment=require(_0x9391('0x3'));var path=require(_0x9391('0x4'));var tiff2pdf=require('tiff2pdf');var gs=require('./util/gs');var logger=require(_0x9391('0x5'))(_0x9391('0x6'));var ami=require(_0x9391('0x7'));var rpcDb=require('./rpcDb');var Channel=require(_0x9391('0x8'));var ut=require(_0x9391('0x9'));var Action=require(_0x9391('0xa'));var faxAccount=require(_0x9391('0xb'));var attachment=require(_0x9391('0xc'));var faxMessage=require(_0x9391('0xd'));function Fax(_0x3565eb){this[_0x9391('0xe')]={};this['faxAccounts']=_0x3565eb[_0x9391('0xf')];this['trunks']=_0x3565eb['trunks'];this[_0x9391('0x10')]={};ami['on'](_0x9391('0x11'),this[_0x9391('0x12')][_0x9391('0x13')](this));ami['on']('varset',this[_0x9391('0x14')][_0x9391('0x13')](this));ami['on'](_0x9391('0x15'),this[_0x9391('0x16')][_0x9391('0x13')](this));ami['on']('newexten',this['syncNewExten']['bind'](this));ami['on']('faxstatus',this[_0x9391('0x17')][_0x9391('0x13')](this));ami['on']('receivefax',this[_0x9391('0x18')][_0x9391('0x13')](this));ami['on'](_0x9391('0x19'),this[_0x9391('0x1a')]['bind'](this));ami['on'](_0x9391('0x1b'),this[_0x9391('0x1c')][_0x9391('0x13')](this));}Fax['prototype'][_0x9391('0x12')]=function(_0x1fe277){if(_0x1fe277[_0x9391('0x1d')]===_0x9391('0x1e')){for(var _0x5cd71a in this[_0x9391('0xf')]){if(this[_0x9391('0xf')]['hasOwnProperty'](_0x5cd71a)){if(_0x1fe277[_0x9391('0x1f')]===this['faxAccounts'][_0x5cd71a][_0x9391('0x20')]){this[_0x9391('0xe')][_0x1fe277[_0x9391('0x21')]]={};this[_0x9391('0xe')][_0x1fe277['uniqueid']][_0x9391('0x22')]=_0x1fe277['channel'];this[_0x9391('0xe')][_0x1fe277[_0x9391('0x21')]]['id']=this['faxAccounts'][_0x5cd71a]['id'];this[_0x9391('0xe')][_0x1fe277[_0x9391('0x21')]][_0x9391('0x23')]=this[_0x9391('0xf')][_0x5cd71a][_0x9391('0x23')];logger[_0x9391('0x24')](_0x1fe277['uniqueid'],_0x9391('0x25'));}}}}if(this[_0x9391('0x10')][_0x1fe277['uniqueid']]){this['channels'][_0x1fe277[_0x9391('0x21')]]={};this[_0x9391('0xe')][_0x1fe277['uniqueid']]['channel']=_0x1fe277['channel'];logger[_0x9391('0x24')](_0x1fe277[_0x9391('0x21')],'\x20syncNewchannel\x20');}};Fax[_0x9391('0x26')][_0x9391('0x14')]=function(_0x24f2fc){if(this[_0x9391('0xe')][_0x24f2fc[_0x9391('0x21')]]){for(var _0x12ea9c in _0x24f2fc[_0x9391('0x27')]){if(_0x24f2fc[_0x9391('0x27')][_0x9391('0x28')](_0x12ea9c)){this['channels'][_0x24f2fc[_0x9391('0x21')]][_0x12ea9c]=_0x24f2fc[_0x9391('0x29')];}}}};Fax[_0x9391('0x26')]['syncNewState']=function(_0x5bbd0e){if(this[_0x9391('0xe')][_0x5bbd0e[_0x9391('0x21')]]){this[_0x9391('0xe')][_0x5bbd0e['uniqueid']]['channelstate']=_0x5bbd0e[_0x9391('0x2a')];this[_0x9391('0xe')][_0x5bbd0e[_0x9391('0x21')]][_0x9391('0x2b')]=_0x5bbd0e['channelstatedesc'];}};Fax[_0x9391('0x26')][_0x9391('0x2c')]=function(_0x34da4f){if(this[_0x9391('0xe')][_0x34da4f[_0x9391('0x21')]]){for(var _0x15839c in _0x34da4f['variable']){if(_0x34da4f[_0x9391('0x27')][_0x9391('0x28')](_0x15839c)){this['channels'][_0x34da4f[_0x9391('0x21')]][_0x15839c]=_0x34da4f['value'];}}}};Fax['prototype'][_0x9391('0x17')]=function(_0x3a6c12){if(this[_0x9391('0xe')][_0x3a6c12[_0x9391('0x21')]]){this[_0x9391('0xe')][_0x3a6c12['uniqueid']][_0x9391('0x2d')]=_0x3a6c12[_0x9391('0x2d')];this[_0x9391('0xe')][_0x3a6c12[_0x9391('0x21')]]['status']=_0x3a6c12[_0x9391('0x2e')];this[_0x9391('0xe')][_0x3a6c12[_0x9391('0x21')]][_0x9391('0x20')]=_0x3a6c12[_0x9391('0x20')];this[_0x9391('0xe')][_0x3a6c12[_0x9391('0x21')]][_0x9391('0x2f')]=_0x3a6c12[_0x9391('0x2f')];logger['info'](_0x3a6c12['uniqueid'],'\x20syncFaxStatus\x20');}};Fax[_0x9391('0x26')][_0x9391('0x18')]=function(_0x40e40e){var _0x408cfe=this;if(this[_0x9391('0xe')][_0x40e40e[_0x9391('0x21')]]){var _0xe2c5d6=this['channels'][_0x40e40e[_0x9391('0x21')]]['id'];this[_0x9391('0xe')][_0x40e40e[_0x9391('0x21')]][_0x9391('0x30')]=_0x40e40e['remotestationid'];this[_0x9391('0xe')][_0x40e40e[_0x9391('0x21')]]['pagestransferred']=_0x40e40e[_0x9391('0x31')];this[_0x9391('0xe')][_0x40e40e[_0x9391('0x21')]]['localstationid']=_0x40e40e[_0x9391('0x20')];this[_0x9391('0xe')][_0x40e40e[_0x9391('0x21')]][_0x9391('0x32')]=_0x40e40e[_0x9391('0x32')];this[_0x9391('0xe')][_0x40e40e[_0x9391('0x21')]][_0x9391('0x33')]=_0x40e40e[_0x9391('0x33')];this[_0x9391('0xe')][_0x40e40e[_0x9391('0x21')]][_0x9391('0x2f')]=_0x40e40e[_0x9391('0x2f')];this[_0x9391('0xe')][_0x40e40e[_0x9391('0x21')]][_0x9391('0x34')]=_0x40e40e[_0x9391('0x34')];if(this[_0x9391('0xe')][_0x40e40e['uniqueid']][_0x9391('0x31')]>0x0){tiff2pdf(_0x40e40e['filename'],_0x9391('0x35'),function(_0x4989f1){logger['info'](_0x40e40e[_0x9391('0x21')],_0x9391('0x36'),_0x4989f1[_0x9391('0x37')]);attachment['create']({'name':path[_0x9391('0x38')](_0x40e40e['filename'])[_0x9391('0x23')],'basename':path['parse'](_0x40e40e['filename'])[_0x9391('0x23')]+_0x9391('0x39'),'type':_0x9391('0x3a')})['then'](function(_0x16936d){faxAccount[_0x9391('0x3b')](_0xe2c5d6,{'from':_0x40e40e[_0x9391('0x34')],'mapKey':'fax','body':path[_0x9391('0x38')](_0x40e40e['filename'])[_0x9391('0x23')]+_0x9391('0x39'),'AttachmentId':_0x16936d['id']})[_0x9391('0x3c')](function(_0x37c0a8){logger[_0x9391('0x3d')](_0x40e40e[_0x9391('0x21')],_0x9391('0x3e'),JSON['stringify'](_0x37c0a8));});})[_0x9391('0x3c')](function(_0x366b58){logger[_0x9391('0x3d')](_0x40e40e[_0x9391('0x21')],'\x20receiveFax\x20',JSON[_0x9391('0x3f')](_0x366b58));});});}logger[_0x9391('0x24')](_0x40e40e[_0x9391('0x21')],_0x9391('0x40'));}};Fax[_0x9391('0x26')][_0x9391('0x1c')]=function(_0x1acc4c){if(this['actions'][_0x1acc4c[_0x9391('0x21')]]){_[_0x9391('0x41')](this[_0x9391('0xe')][_0x1acc4c['uniqueid']],_[_0x9391('0x42')](_0x1acc4c,[_0x9391('0x43'),_0x9391('0x44')]));}};function updateStatus(_0x4097b6){if(_0x4097b6[_0x9391('0x45')]){faxMessage[_0x9391('0x46')](_0x4097b6[_0x9391('0x45')],{'failMessage':_0x9391('0x47')})[_0x9391('0x48')](function(_0x1477c0){ut[_0x9391('0x49')](_0x9391('0x4a'),_0x1477c0);})[_0x9391('0x3c')](function(_0x3314bc){ut[_0x9391('0x49')](_0x9391('0x4b'),_0x3314bc);});}else{ut[_0x9391('0x49')]('[Fax][Message][Error][NoUpdate2]');}}Fax['prototype'][_0x9391('0x4c')]=function(_0x480b98,_0x2c45a3,_0xfd06a9){var _0x16dac0=this;var _0x416d28={};if(_0x2c45a3){_0x416d28={'read':_0x2c45a3};}else{_0x416d28={'failMessage':_0xfd06a9};}if(this[_0x9391('0x10')][_0x480b98][_0x9391('0x45')]){faxMessage[_0x9391('0x46')](this['actions'][_0x480b98][_0x9391('0x45')],_0x416d28)[_0x9391('0x48')](function(_0x411406){ut[_0x9391('0x49')](_0x9391('0x4d'),_0x411406);})[_0x9391('0x3c')](function(_0x54949a){ut[_0x9391('0x49')](_0x9391('0x4e'),_0x54949a);})[_0x9391('0x4f')](function(){delete _0x16dac0[_0x9391('0xe')][_0x480b98];delete _0x16dac0[_0x9391('0x10')][_0x480b98];});}else{ut[_0x9391('0x49')]('[Fax][Message][NoUpdate2]');delete this[_0x9391('0xe')][_0x480b98];delete this[_0x9391('0x10')][_0x480b98];}};Fax['prototype'][_0x9391('0x1a')]=function(_0x2d5732){var _0x19ff2c=this;if(this['channels'][_0x2d5732[_0x9391('0x21')]]){if(this[_0x9391('0x10')][_0x2d5732[_0x9391('0x21')]]){this[_0x9391('0xe')][_0x2d5732[_0x9391('0x21')]]['id']=this['actions'][_0x2d5732[_0x9391('0x21')]]['id'];this[_0x9391('0xe')][_0x2d5732['uniqueid']]['name']=this[_0x9391('0x10')][_0x2d5732[_0x9391('0x21')]]['name'];}logger['info'](_0x2d5732['uniqueid'],this[_0x9391('0x10')][_0x2d5732[_0x9391('0x21')]]?_0x9391('0x50'):'\x20hangup\x20faxRiceive\x20',JSON[_0x9391('0x3f')](this['channels'][_0x2d5732[_0x9391('0x21')]]));if(this[_0x9391('0x10')][_0x2d5732[_0x9391('0x21')]]){if(this[_0x9391('0xe')][_0x2d5732['uniqueid']]['faxpages']>0x0&&this['channels'][_0x2d5732[_0x9391('0x21')]][_0x9391('0x51')]==='SUCCESS'){this[_0x9391('0x4c')](_0x2d5732[_0x9391('0x21')],!![]);}else{this[_0x9391('0x4c')](_0x2d5732[_0x9391('0x21')],![],this['channels'][_0x2d5732[_0x9391('0x21')]]['faxstatusstring']?_0x9391('0x52')+this[_0x9391('0xe')][_0x2d5732['uniqueid']][_0x9391('0x53')]:_0x9391('0x54'));}}}};Fax[_0x9391('0x26')][_0x9391('0x55')]=function(_0x36f21f){var _0x761a90=this;return new BPromise(function(_0x3e73d9,_0x213c8f){_0x761a90['execOriginate'](_0x36f21f,_0x761a90['faxAccounts'][_0x36f21f[_0x9391('0x56')]])['then'](function(_0x46c95a){ut[_0x9391('0x49')](_0x9391('0x57'),_0x46c95a);_0x3e73d9(ut[_0x9391('0x37')]('Fax\x20received'));})['catch'](function(_0x1c6e72){ut[_0x9391('0x49')](_0x9391('0x58'),_0x1c6e72);updateStatus(_0x36f21f);_0x213c8f(ut[_0x9391('0x37')]('Fax\x20failed'));});});};Fax['prototype'][_0x9391('0x59')]=function(_0x63857c){var _0x5bfa1f=this;return new BPromise(function(_0x4030d8,_0x37170c){var _0x429d55=_0x5bfa1f[_0x9391('0x5a')](_0x5bfa1f[_0x9391('0xf')][_0x63857c[_0x9391('0x56')]][_0x9391('0x5b')],_0x63857c);if(_0x429d55[_0x9391('0x5c')]){_0x4030d8(ut[_0x9391('0x37')](_0x9391('0x5d')));}else{_0x37170c(ut[_0x9391('0x37')](_0x429d55[_0x9391('0x37')]));}});};function originate(_0x338f56,_0x135894,_0x9d61a3){return new BPromise(function(_0x21d941,_0x545ba8){if(_0x9d61a3){var _0x211f42=util['format']('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path['parse'](_0x338f56[_0x9391('0x4')])[_0x9391('0x23')],_0x338f56[_0x9391('0x4')]);gs[_0x9391('0x5e')](_0x211f42)[_0x9391('0x48')](function(){_0x338f56['path']=util[_0x9391('0x5f')]('%s/%s.tif',path[_0x9391('0x38')](_0x338f56[_0x9391('0x4')])[_0x9391('0x60')],path[_0x9391('0x38')](_0x338f56[_0x9391('0x4')])['name']);_0x135894[_0x9391('0x61')]=_0x338f56[_0x9391('0x4')];ut['logger'](_0x9391('0x62'),'');ami[_0x9391('0x63')](ut[_0x9391('0x64')](_0x338f56,_0x135894))['then'](function(_0x170773){_0x21d941(_0x170773);})['catch'](function(_0x2c9c6c){_0x545ba8(_0x2c9c6c);});})[_0x9391('0x3c')](function(_0x45ff4e){_0x545ba8(_0x45ff4e);});}else{ami[_0x9391('0x63')](ut['variablesAction'](_0x338f56,_0x135894))[_0x9391('0x48')](function(_0x24bee4){_0x21d941(_0x24bee4);})[_0x9391('0x3c')](function(_0x5ae81d){_0x545ba8(_0x5ae81d);});}});}Fax[_0x9391('0x26')][_0x9391('0x65')]=function(_0x1b24e8,_0x46960f){var _0x39268d=this;return new BPromise(function(_0x2dcf49,_0x16c247){var _0x14bb3f=uuid['v4']();var _0x3a7599=ut[_0x9391('0x66')](_0x1b24e8,_0x46960f);_0x39268d[_0x9391('0x10')][_0x14bb3f]=new Action(_0x14bb3f,_0x46960f,_0x1b24e8);var _0x544cfc=_0x39268d[_0x9391('0x10')][_0x14bb3f];if(path[_0x9391('0x38')](_0x1b24e8[_0x9391('0x4')])[_0x9391('0x67')]===_0x9391('0x39')){originate(_0x544cfc,_0x3a7599,!![])[_0x9391('0x48')](function(_0xcc9f04){_0x2dcf49(_0xcc9f04);})['catch'](function(_0x43bec8){_0x16c247(_0x43bec8);});}else{originate(_0x544cfc,_0x3a7599,![])['then'](function(_0x55ea0a){_0x2dcf49(_0x55ea0a);})[_0x9391('0x3c')](function(_0x23702e){_0x16c247(_0x23702e);});}});};Fax[_0x9391('0x26')][_0x9391('0x68')]=function(_0x486e9e){return!_['isNil'](_0x486e9e)&&!_[_0x9391('0x69')](_0x486e9e['name'])&&!_['isNil'](_0x486e9e[_0x9391('0x6a')])&&_0x486e9e[_0x9391('0x6a')]&&!_['isNil'](this[_0x9391('0x6b')][util['format']('SIP/%s',_0x486e9e['name'])])&&!_['isNil'](this[_0x9391('0x6b')][util[_0x9391('0x5f')](_0x9391('0x6c'),_0x486e9e[_0x9391('0x23')])]['status'])&&(this[_0x9391('0x6b')][util['format']('SIP/%s',_0x486e9e[_0x9391('0x23')])][_0x9391('0x2e')]==='reachable'||this[_0x9391('0x6b')][util[_0x9391('0x5f')](_0x9391('0x6c'),_0x486e9e['name'])][_0x9391('0x2e')]===_0x9391('0x6d'));};Fax[_0x9391('0x26')][_0x9391('0x5a')]=function(_0x58c902,_0x2d4461){if(!this[_0x9391('0x68')](_0x58c902)){ut[_0x9391('0x49')](_0x9391('0x6e'),_[_0x9391('0x69')](_0x58c902)?'':_0x58c902[_0x9391('0x23')]+_0x9391('0x6f'));return{'isValid':![],'message':_0x9391('0x70')};}if(_[_0x9391('0x69')](_0x2d4461[_0x9391('0x6')])){ut[_0x9391('0x49')](_0x9391('0x71'),JSON[_0x9391('0x3f')](_0x2d4461));return{'isValid':![],'message':_0x9391('0x72')};}if(_[_0x9391('0x69')](_0x2d4461['path'])){ut[_0x9391('0x49')](_0x9391('0x73'),JSON[_0x9391('0x3f')](_0x2d4461));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x9391('0x74')};};module[_0x9391('0x75')]=Fax; \ No newline at end of file +var _0x94d8=['./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','newchannel','syncNewchannel','varset','syncVarSet','bind','newstate','syncNewState','newexten','syncNewExten','syncFaxStatus','receivefax','hangup','syncHangup','originateresponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','actions','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','parse','notify','.pdf','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','syncOriginateResponse','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','then','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','FaxAccountId','[Fax][execOriginate][success]','message','Fax\x20received','[Fax][execOriginate][failure]','checkAfterSend','checkTrunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','path','execute','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isNil','active','SIP/%s','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','uuid','moment','fax','../ami','./channel'];(function(_0x52e272,_0x3ee0e3){var _0x34f3a2=function(_0x22804c){while(--_0x22804c){_0x52e272['push'](_0x52e272['shift']());}};_0x34f3a2(++_0x3ee0e3);}(_0x94d8,0x73));var _0x894d=function(_0x1f1584,_0x1481ba){_0x1f1584=_0x1f1584-0x0;var _0x18cf5c=_0x94d8[_0x1f1584];return _0x18cf5c;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0x894d('0x0'));var moment=require(_0x894d('0x1'));var path=require('path');var tiff2pdf=require('tiff2pdf');var gs=require('./util/gs');var logger=require('../../../config/logger')(_0x894d('0x2'));var ami=require(_0x894d('0x3'));var rpcDb=require('./rpcDb');var Channel=require(_0x894d('0x4'));var ut=require(_0x894d('0x5'));var Action=require(_0x894d('0x6'));var faxAccount=require(_0x894d('0x7'));var attachment=require(_0x894d('0x8'));var faxMessage=require(_0x894d('0x9'));function Fax(_0x3ac014){this[_0x894d('0xa')]={};this[_0x894d('0xb')]=_0x3ac014[_0x894d('0xb')];this['trunks']=_0x3ac014[_0x894d('0xc')];this['actions']={};ami['on'](_0x894d('0xd'),this[_0x894d('0xe')]['bind'](this));ami['on'](_0x894d('0xf'),this[_0x894d('0x10')][_0x894d('0x11')](this));ami['on'](_0x894d('0x12'),this[_0x894d('0x13')][_0x894d('0x11')](this));ami['on'](_0x894d('0x14'),this[_0x894d('0x15')][_0x894d('0x11')](this));ami['on']('faxstatus',this[_0x894d('0x16')]['bind'](this));ami['on'](_0x894d('0x17'),this['syncReceiveFax'][_0x894d('0x11')](this));ami['on'](_0x894d('0x18'),this[_0x894d('0x19')]['bind'](this));ami['on'](_0x894d('0x1a'),this['syncOriginateResponse'][_0x894d('0x11')](this));}Fax[_0x894d('0x1b')][_0x894d('0xe')]=function(_0x1ec27e){if(_0x1ec27e[_0x894d('0x1c')]===_0x894d('0x1d')){for(var _0x47e14b in this[_0x894d('0xb')]){if(this[_0x894d('0xb')][_0x894d('0x1e')](_0x47e14b)){if(_0x1ec27e[_0x894d('0x1f')]===this[_0x894d('0xb')][_0x47e14b][_0x894d('0x20')]){this[_0x894d('0xa')][_0x1ec27e[_0x894d('0x21')]]={};this[_0x894d('0xa')][_0x1ec27e[_0x894d('0x21')]][_0x894d('0x22')]=_0x1ec27e[_0x894d('0x22')];this[_0x894d('0xa')][_0x1ec27e[_0x894d('0x21')]]['id']=this[_0x894d('0xb')][_0x47e14b]['id'];this[_0x894d('0xa')][_0x1ec27e[_0x894d('0x21')]]['name']=this[_0x894d('0xb')][_0x47e14b][_0x894d('0x23')];logger[_0x894d('0x24')](_0x1ec27e[_0x894d('0x21')],'\x20syncNewchannel\x20');}}}}if(this[_0x894d('0x25')][_0x1ec27e[_0x894d('0x21')]]){this[_0x894d('0xa')][_0x1ec27e[_0x894d('0x21')]]={};this[_0x894d('0xa')][_0x1ec27e[_0x894d('0x21')]]['channel']=_0x1ec27e['channel'];logger[_0x894d('0x24')](_0x1ec27e['uniqueid'],_0x894d('0x26'));}};Fax['prototype'][_0x894d('0x10')]=function(_0x254797){if(this[_0x894d('0xa')][_0x254797[_0x894d('0x21')]]){for(var _0x118833 in _0x254797[_0x894d('0x27')]){if(_0x254797[_0x894d('0x27')][_0x894d('0x1e')](_0x118833)){this[_0x894d('0xa')][_0x254797[_0x894d('0x21')]][_0x118833]=_0x254797[_0x894d('0x28')];}}}};Fax[_0x894d('0x1b')][_0x894d('0x13')]=function(_0x275bee){if(this[_0x894d('0xa')][_0x275bee[_0x894d('0x21')]]){this[_0x894d('0xa')][_0x275bee['uniqueid']][_0x894d('0x29')]=_0x275bee[_0x894d('0x29')];this['channels'][_0x275bee[_0x894d('0x21')]][_0x894d('0x2a')]=_0x275bee['channelstatedesc'];}};Fax['prototype'][_0x894d('0x15')]=function(_0x258f4f){if(this[_0x894d('0xa')][_0x258f4f[_0x894d('0x21')]]){for(var _0x19ddd2 in _0x258f4f[_0x894d('0x27')]){if(_0x258f4f['variable']['hasOwnProperty'](_0x19ddd2)){this[_0x894d('0xa')][_0x258f4f[_0x894d('0x21')]][_0x19ddd2]=_0x258f4f[_0x894d('0x28')];}}}};Fax[_0x894d('0x1b')][_0x894d('0x16')]=function(_0xc6bf83){if(this['channels'][_0xc6bf83['uniqueid']]){this[_0x894d('0xa')][_0xc6bf83[_0x894d('0x21')]][_0x894d('0x2b')]=_0xc6bf83[_0x894d('0x2b')];this[_0x894d('0xa')][_0xc6bf83[_0x894d('0x21')]]['status']=_0xc6bf83[_0x894d('0x2c')];this['channels'][_0xc6bf83[_0x894d('0x21')]][_0x894d('0x20')]=_0xc6bf83[_0x894d('0x20')];this[_0x894d('0xa')][_0xc6bf83[_0x894d('0x21')]][_0x894d('0x2d')]=_0xc6bf83[_0x894d('0x2d')];logger[_0x894d('0x24')](_0xc6bf83['uniqueid'],_0x894d('0x2e'));}};Fax[_0x894d('0x1b')][_0x894d('0x2f')]=function(_0x1a6a4b){var _0x477e05=this;if(this['channels'][_0x1a6a4b[_0x894d('0x21')]]){var _0x139b74=this[_0x894d('0xa')][_0x1a6a4b[_0x894d('0x21')]]['id'];this['channels'][_0x1a6a4b[_0x894d('0x21')]]['remotestationid']=_0x1a6a4b[_0x894d('0x30')];this['channels'][_0x1a6a4b[_0x894d('0x21')]]['pagestransferred']=_0x1a6a4b[_0x894d('0x31')];this[_0x894d('0xa')][_0x1a6a4b['uniqueid']][_0x894d('0x20')]=_0x1a6a4b['localstationid'];this[_0x894d('0xa')][_0x1a6a4b[_0x894d('0x21')]][_0x894d('0x32')]=_0x1a6a4b[_0x894d('0x32')];this[_0x894d('0xa')][_0x1a6a4b[_0x894d('0x21')]]['transferrate']=_0x1a6a4b[_0x894d('0x33')];this[_0x894d('0xa')][_0x1a6a4b[_0x894d('0x21')]]['filename']=_0x1a6a4b[_0x894d('0x2d')];this[_0x894d('0xa')][_0x1a6a4b[_0x894d('0x21')]]['calleridnum']=_0x1a6a4b[_0x894d('0x34')];if(this[_0x894d('0xa')][_0x1a6a4b['uniqueid']][_0x894d('0x31')]>0x0){tiff2pdf(_0x1a6a4b[_0x894d('0x2d')],_0x894d('0x35'),function(_0x2b803c){logger['info'](_0x1a6a4b[_0x894d('0x21')],_0x894d('0x36'),_0x2b803c['message']);attachment['create']({'name':path[_0x894d('0x37')](_0x1a6a4b['filename'])[_0x894d('0x23')],'basename':path[_0x894d('0x37')](_0x1a6a4b[_0x894d('0x2d')])[_0x894d('0x23')]+'.pdf','type':'application/pdf'})['then'](function(_0xfd7930){faxAccount[_0x894d('0x38')](_0x139b74,{'from':_0x1a6a4b[_0x894d('0x34')],'mapKey':_0x894d('0x2'),'body':path[_0x894d('0x37')](_0x1a6a4b[_0x894d('0x2d')])[_0x894d('0x23')]+_0x894d('0x39'),'AttachmentId':_0xfd7930['id']})[_0x894d('0x3a')](function(_0x58ef21){logger[_0x894d('0x3b')](_0x1a6a4b[_0x894d('0x21')],_0x894d('0x3c'),JSON[_0x894d('0x3d')](_0x58ef21));});})[_0x894d('0x3a')](function(_0x100680){logger['error'](_0x1a6a4b[_0x894d('0x21')],_0x894d('0x3e'),JSON['stringify'](_0x100680));});});}logger[_0x894d('0x24')](_0x1a6a4b[_0x894d('0x21')],'\x20receiveFax\x20');}};Fax[_0x894d('0x1b')][_0x894d('0x3f')]=function(_0x1f44d5){if(this[_0x894d('0x25')][_0x1f44d5[_0x894d('0x21')]]){_[_0x894d('0x40')](this['channels'][_0x1f44d5[_0x894d('0x21')]],_[_0x894d('0x41')](_0x1f44d5,[_0x894d('0x42'),_0x894d('0x43')]));}};function updateStatus(_0x18545a){if(_0x18545a[_0x894d('0x44')]){faxMessage[_0x894d('0x45')](_0x18545a['AttachmentId'],{'failMessage':_0x894d('0x46')})['then'](function(_0x84757){ut[_0x894d('0x47')](_0x894d('0x48'),_0x84757);})['catch'](function(_0xf49ae6){ut[_0x894d('0x47')](_0x894d('0x49'),_0xf49ae6);});}else{ut[_0x894d('0x47')](_0x894d('0x4a'));}}Fax[_0x894d('0x1b')][_0x894d('0x4b')]=function(_0x2af6e0,_0x348292,_0x480879){var _0x2185a3=this;var _0x16dcd6={};if(_0x348292){_0x16dcd6={'read':_0x348292};}else{_0x16dcd6={'failMessage':_0x480879};}if(this['actions'][_0x2af6e0][_0x894d('0x44')]){faxMessage['update'](this['actions'][_0x2af6e0][_0x894d('0x44')],_0x16dcd6)[_0x894d('0x4c')](function(_0x2aba98){ut['logger'](_0x894d('0x4d'),_0x2aba98);})[_0x894d('0x3a')](function(_0x1556c4){ut[_0x894d('0x47')](_0x894d('0x4e'),_0x1556c4);})[_0x894d('0x4f')](function(){delete _0x2185a3[_0x894d('0xa')][_0x2af6e0];delete _0x2185a3[_0x894d('0x25')][_0x2af6e0];});}else{ut[_0x894d('0x47')]('[Fax][Message][NoUpdate2]');delete this[_0x894d('0xa')][_0x2af6e0];delete this['actions'][_0x2af6e0];}};Fax['prototype'][_0x894d('0x19')]=function(_0x33550e){var _0x40d170=this;if(this[_0x894d('0xa')][_0x33550e[_0x894d('0x21')]]){if(this['actions'][_0x33550e[_0x894d('0x21')]]){this['channels'][_0x33550e['uniqueid']]['id']=this['actions'][_0x33550e[_0x894d('0x21')]]['id'];this[_0x894d('0xa')][_0x33550e[_0x894d('0x21')]][_0x894d('0x23')]=this[_0x894d('0x25')][_0x33550e[_0x894d('0x21')]][_0x894d('0x23')];}logger[_0x894d('0x24')](_0x33550e[_0x894d('0x21')],this['actions'][_0x33550e[_0x894d('0x21')]]?_0x894d('0x50'):_0x894d('0x51'),JSON[_0x894d('0x3d')](this['channels'][_0x33550e[_0x894d('0x21')]]));if(this[_0x894d('0x25')][_0x33550e['uniqueid']]){if(this[_0x894d('0xa')][_0x33550e[_0x894d('0x21')]][_0x894d('0x52')]>0x0&&this[_0x894d('0xa')][_0x33550e[_0x894d('0x21')]][_0x894d('0x53')]===_0x894d('0x54')){this[_0x894d('0x4b')](_0x33550e[_0x894d('0x21')],!![]);}else{this[_0x894d('0x4b')](_0x33550e[_0x894d('0x21')],![],this['channels'][_0x33550e[_0x894d('0x21')]][_0x894d('0x55')]?_0x894d('0x56')+this[_0x894d('0xa')][_0x33550e[_0x894d('0x21')]][_0x894d('0x55')]:_0x894d('0x57'));}}}};Fax[_0x894d('0x1b')]['send']=function(_0x406853){var _0x2381bf=this;return new BPromise(function(_0x482ba6,_0x1b2716){_0x2381bf[_0x894d('0x58')](_0x406853,_0x2381bf[_0x894d('0xb')][_0x406853[_0x894d('0x59')]])[_0x894d('0x4c')](function(_0x541f0e){ut[_0x894d('0x47')](_0x894d('0x5a'),_0x541f0e);_0x482ba6(ut[_0x894d('0x5b')](_0x894d('0x5c')));})['catch'](function(_0x1ccc5f){ut[_0x894d('0x47')](_0x894d('0x5d'),_0x1ccc5f);updateStatus(_0x406853);_0x1b2716(ut['message']('Fax\x20failed'));});});};Fax[_0x894d('0x1b')][_0x894d('0x5e')]=function(_0x2e92b4){var _0x567d7c=this;return new BPromise(function(_0x2639e2,_0x1ad23d){var _0x4e400a=_0x567d7c[_0x894d('0x5f')](_0x567d7c[_0x894d('0xb')][_0x2e92b4[_0x894d('0x59')]]['Trunk'],_0x2e92b4);if(_0x4e400a[_0x894d('0x60')]){_0x2639e2(ut[_0x894d('0x5b')](_0x894d('0x61')));}else{_0x1ad23d(ut[_0x894d('0x5b')](_0x4e400a[_0x894d('0x5b')]));}});};function originate(_0x2c3130,_0x4b67f1,_0x3303f4){return new BPromise(function(_0x10fbd3,_0x2a5c29){if(_0x3303f4){var _0x1c2245=util[_0x894d('0x62')](_0x894d('0x63'),path['parse'](_0x2c3130[_0x894d('0x64')])[_0x894d('0x23')],_0x2c3130[_0x894d('0x64')]);gs[_0x894d('0x65')](_0x1c2245)[_0x894d('0x4c')](function(){_0x2c3130['path']=util[_0x894d('0x62')](_0x894d('0x66'),path[_0x894d('0x37')](_0x2c3130[_0x894d('0x64')])['dir'],path[_0x894d('0x37')](_0x2c3130[_0x894d('0x64')])[_0x894d('0x23')]);_0x4b67f1[_0x894d('0x67')]=_0x2c3130[_0x894d('0x64')];ut[_0x894d('0x47')](_0x894d('0x68'),'');ami[_0x894d('0x69')](ut[_0x894d('0x6a')](_0x2c3130,_0x4b67f1))[_0x894d('0x4c')](function(_0xe5efe3){_0x10fbd3(_0xe5efe3);})[_0x894d('0x3a')](function(_0x9314b5){_0x2a5c29(_0x9314b5);});})['catch'](function(_0x5126a4){_0x2a5c29(_0x5126a4);});}else{ami[_0x894d('0x69')](ut[_0x894d('0x6a')](_0x2c3130,_0x4b67f1))[_0x894d('0x4c')](function(_0xebc28e){_0x10fbd3(_0xebc28e);})[_0x894d('0x3a')](function(_0x35acca){_0x2a5c29(_0x35acca);});}});}Fax[_0x894d('0x1b')][_0x894d('0x58')]=function(_0x400e22,_0x57bed5){var _0x2380a7=this;return new BPromise(function(_0x46aef8,_0x3222dc){var _0x3edc7c=uuid['v4']();var _0x34eadd=ut[_0x894d('0x6b')](_0x400e22,_0x57bed5);_0x2380a7[_0x894d('0x25')][_0x3edc7c]=new Action(_0x3edc7c,_0x57bed5,_0x400e22);var _0x80fe81=_0x2380a7[_0x894d('0x25')][_0x3edc7c];if(path[_0x894d('0x37')](_0x400e22[_0x894d('0x64')])[_0x894d('0x6c')]===_0x894d('0x39')){originate(_0x80fe81,_0x34eadd,!![])[_0x894d('0x4c')](function(_0x4ce0a9){_0x46aef8(_0x4ce0a9);})[_0x894d('0x3a')](function(_0x21c379){_0x3222dc(_0x21c379);});}else{originate(_0x80fe81,_0x34eadd,![])[_0x894d('0x4c')](function(_0x3194a6){_0x46aef8(_0x3194a6);})[_0x894d('0x3a')](function(_0x4a89e7){_0x3222dc(_0x4a89e7);});}});};Fax[_0x894d('0x1b')]['isTrunkReachable']=function(_0x5684b7){return!_[_0x894d('0x6d')](_0x5684b7)&&!_['isNil'](_0x5684b7[_0x894d('0x23')])&&!_['isNil'](_0x5684b7[_0x894d('0x6e')])&&_0x5684b7[_0x894d('0x6e')]&&!_['isNil'](this['trunks'][util[_0x894d('0x62')](_0x894d('0x6f'),_0x5684b7[_0x894d('0x23')])])&&!_['isNil'](this['trunks'][util[_0x894d('0x62')](_0x894d('0x6f'),_0x5684b7[_0x894d('0x23')])][_0x894d('0x2c')])&&(this[_0x894d('0xc')][util['format'](_0x894d('0x6f'),_0x5684b7[_0x894d('0x23')])][_0x894d('0x2c')]==='reachable'||this[_0x894d('0xc')][util['format'](_0x894d('0x6f'),_0x5684b7[_0x894d('0x23')])][_0x894d('0x2c')]==='unmonitored');};Fax[_0x894d('0x1b')][_0x894d('0x5f')]=function(_0xf005c1,_0x230985){if(!this[_0x894d('0x70')](_0xf005c1)){ut[_0x894d('0x47')](_0x894d('0x71'),_[_0x894d('0x6d')](_0xf005c1)?'':_0xf005c1['name']+_0x894d('0x72'));return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0x894d('0x6d')](_0x230985[_0x894d('0x2')])){ut[_0x894d('0x47')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x894d('0x3d')](_0x230985));return{'isValid':![],'message':_0x894d('0x73')};}if(_[_0x894d('0x6d')](_0x230985['path'])){ut[_0x894d('0x47')](_0x894d('0x74'),JSON[_0x894d('0x3d')](_0x230985));return{'isValid':![],'message':_0x894d('0x75')};}return{'isValid':!![],'message':_0x894d('0x76')};};module[_0x894d('0x77')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 5d7e344..48c7212 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 _0x4728=['notify','resolve','then','[Notify]\x20','util','bluebird','../../../config/logger','lodash','../rpc/faxAccount','error','inspect'];(function(_0x2212d1,_0x483fc8){var _0x15eec5=function(_0x15e6ac){while(--_0x15e6ac){_0x2212d1['push'](_0x2212d1['shift']());}};_0x15eec5(++_0x483fc8);}(_0x4728,0x117));var _0x8472=function(_0x136a0d,_0x476fe2){_0x136a0d=_0x136a0d-0x0;var _0x212ea5=_0x4728[_0x136a0d];return _0x212ea5;};'use strict';var util=require(_0x8472('0x0'));var BPromise=require(_0x8472('0x1'));var logger=require(_0x8472('0x2'))('preview');var _=require(_0x8472('0x3'));var faxAccount=require(_0x8472('0x4'));function loggerCatch(_0x29fdd9){return function(_0x15fe8b){logger[_0x8472('0x5')](_0x29fdd9,util[_0x8472('0x6')](_0x15fe8b,{'showHidden':![],'depth':null}));};}exports[_0x8472('0x7')]=function(_0x99c508,_0x1ff1ef){return BPromise[_0x8472('0x8')]()[_0x8472('0x9')](faxAccount[_0x8472('0x7')](_0x99c508,_0x1ff1ef))['catch'](loggerCatch(_0x8472('0xa')));}; \ No newline at end of file +var _0x1c50=['lodash','../rpc/faxAccount','error','inspect','notify','resolve','then','util','bluebird','../../../config/logger','preview'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1c50,0x11a));var _0x01c5=function(_0x2c9a9b,_0x53b928){_0x2c9a9b=_0x2c9a9b-0x0;var _0x4e35cf=_0x1c50[_0x2c9a9b];return _0x4e35cf;};'use strict';var util=require(_0x01c5('0x0'));var BPromise=require(_0x01c5('0x1'));var logger=require(_0x01c5('0x2'))(_0x01c5('0x3'));var _=require(_0x01c5('0x4'));var faxAccount=require(_0x01c5('0x5'));function loggerCatch(_0x3b7433){return function(_0x4e42d6){logger[_0x01c5('0x6')](_0x3b7433,util[_0x01c5('0x7')](_0x4e42d6,{'showHidden':![],'depth':null}));};}exports[_0x01c5('0x8')]=function(_0x11b266,_0x741294){return BPromise[_0x01c5('0x9')]()[_0x01c5('0xa')](faxAccount[_0x01c5('0x8')](_0x11b266,_0x741294))['catch'](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 6ac0ad4..c4984cd 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 _0x3334=['exec','info','Exec\x20gs','inspect','../../../../config/logger','fax','bluebird','child_process'];(function(_0x399941,_0x34b885){var _0x52c9f2=function(_0x21ea6c){while(--_0x21ea6c){_0x399941['push'](_0x399941['shift']());}};_0x52c9f2(++_0x34b885);}(_0x3334,0x15c));var _0x4333=function(_0x2fd2f8,_0x1f18b6){_0x2fd2f8=_0x2fd2f8-0x0;var _0x53d24e=_0x3334[_0x2fd2f8];return _0x53d24e;};'use strict';var util=require('util');var logger=require(_0x4333('0x0'))(_0x4333('0x1'));var BPromise=require(_0x4333('0x2'));var exec=require(_0x4333('0x3'))[_0x4333('0x4')];exports['execute']=function(_0x2fbf5a){return new BPromise(function(_0x3200e3,_0x54a288){exec(_0x2fbf5a,function(_0x5c8274,_0x548750,_0x53f92e){logger[_0x4333('0x5')](_0x4333('0x6'),_0x548750);if(_0x5c8274){logger[_0x4333('0x5')](_0x4333('0x6'),'\x20Error\x20:',util[_0x4333('0x7')](_0x5c8274,{'showHidden':![],'depth':null}),_0x548750,_0x53f92e);_0x54a288(_0x5c8274);}_0x3200e3(_0x548750);});});}; \ No newline at end of file +var _0x5d11=['Exec\x20gs','inspect','../../../../config/logger','fax','bluebird','child_process','execute','info'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x5d11,0x72));var _0x15d1=function(_0x499ca5,_0x4986cf){_0x499ca5=_0x499ca5-0x0;var _0x7bfd9c=_0x5d11[_0x499ca5];return _0x7bfd9c;};'use strict';var util=require('util');var logger=require(_0x15d1('0x0'))(_0x15d1('0x1'));var BPromise=require(_0x15d1('0x2'));var exec=require(_0x15d1('0x3'))['exec'];exports[_0x15d1('0x4')]=function(_0x32a157){return new BPromise(function(_0xbc30b9,_0x3f099d){exec(_0x32a157,function(_0x4dfe3f,_0xed158e,_0x297842){logger[_0x15d1('0x5')](_0x15d1('0x6'),_0xed158e);if(_0x4dfe3f){logger[_0x15d1('0x5')](_0x15d1('0x6'),'\x20Error\x20:',util[_0x15d1('0x7')](_0x4dfe3f,{'showHidden':![],'depth':null}),_0xed158e,_0x297842);_0x3f099d(_0x4dfe3f);}_0xbc30b9(_0xed158e);});});}; \ 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 6f4d925..c9d1555 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 _0xb318=['moment','../../../../config/logger','message','info','inspect','addVariables','ecm','maxrate','format','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','headerinfo','uniqueid','lodash'];(function(_0x460f66,_0xbf6681){var _0x187897=function(_0x2dcc0b){while(--_0x2dcc0b){_0x460f66['push'](_0x460f66['shift']());}};_0x187897(++_0xbf6681);}(_0xb318,0xdb));var _0x8b31=function(_0x5b3422,_0x575f50){_0x5b3422=_0x5b3422-0x0;var _0x4b896e=_0xb318[_0x5b3422];return _0x4b896e;};'use strict';var util=require('util');var _=require(_0x8b31('0x0'));var moment=require(_0x8b31('0x1'));var logger=require(_0x8b31('0x2'))('fax');exports[_0x8b31('0x3')]=function(_0x220231){return{'message':_0x220231};};exports['logger']=function(_0x2aa916,_0x1d8d65){logger[_0x8b31('0x4')](_0x2aa916,util[_0x8b31('0x5')](_0x1d8d65,{'showHidden':![],'depth':null}));};exports[_0x8b31('0x6')]=function(_0x2c29ce,_0x47f0d7){var _0x5aba48={'XMF-ECM':_0x47f0d7[_0x8b31('0x7')],'XMF-HEADERINFO':_0x47f0d7['headerinfo'],'XMF-MINRATE':_0x47f0d7['minrate'],'XMF-MAXRATE':_0x47f0d7[_0x8b31('0x8')],'XMF-MODEM':util[_0x8b31('0x9')]('\x22%s\x22',_0x47f0d7['modem']),'XMF-GATEWAY':_0x47f0d7[_0x8b31('0xa')],'XMF-FAXDETECT':_0x47f0d7[_0x8b31('0xb')],'XMF-T38TIMEOUT':_0x47f0d7[_0x8b31('0xc')],'XMF-LOCALSTATIONID':_0x47f0d7[_0x8b31('0xd')],'XMF-PATH':_0x2c29ce[_0x8b31('0xe')]};return _0x5aba48;};exports[_0x8b31('0xf')]=function(_0x18ec0a,_0x24e61f){return{'actionid':_0x18ec0a['uniqueid'],'action':'originate','channel':_0x18ec0a[_0x8b31('0x10')],'Exten':_0x8b31('0x11'),'Context':_0x8b31('0x12'),'Priority':'1','callerid':util['format'](_0x8b31('0x13'),_0x18ec0a[_0x8b31('0x14')]?_0x18ec0a[_0x8b31('0x14')]:'',_0x18ec0a[_0x8b31('0xd')]),'variable':_0x24e61f,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x18ec0a[_0x8b31('0x15')]};}; \ No newline at end of file +var _0x51fc=['moment','../../../../config/logger','fax','message','logger','info','inspect','ecm','headerinfo','minrate','maxrate','\x22%s\x22','modem','gateway','faxdetect','path','variablesAction','uniqueid','originate','channel','from-sip','localstationid','util'];(function(_0x9decac,_0x249b5c){var _0x267afb=function(_0x3bc773){while(--_0x3bc773){_0x9decac['push'](_0x9decac['shift']());}};_0x267afb(++_0x249b5c);}(_0x51fc,0x1b4));var _0xc51f=function(_0x185deb,_0x20e36f){_0x185deb=_0x185deb-0x0;var _0x37436e=_0x51fc[_0x185deb];return _0x37436e;};'use strict';var util=require(_0xc51f('0x0'));var _=require('lodash');var moment=require(_0xc51f('0x1'));var logger=require(_0xc51f('0x2'))(_0xc51f('0x3'));exports[_0xc51f('0x4')]=function(_0xcd6db1){return{'message':_0xcd6db1};};exports[_0xc51f('0x5')]=function(_0xa290a9,_0x241e44){logger[_0xc51f('0x6')](_0xa290a9,util[_0xc51f('0x7')](_0x241e44,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x22e166,_0x3d86f9){var _0xcdad90={'XMF-ECM':_0x3d86f9[_0xc51f('0x8')],'XMF-HEADERINFO':_0x3d86f9[_0xc51f('0x9')],'XMF-MINRATE':_0x3d86f9[_0xc51f('0xa')],'XMF-MAXRATE':_0x3d86f9[_0xc51f('0xb')],'XMF-MODEM':util['format'](_0xc51f('0xc'),_0x3d86f9[_0xc51f('0xd')]),'XMF-GATEWAY':_0x3d86f9[_0xc51f('0xe')],'XMF-FAXDETECT':_0x3d86f9[_0xc51f('0xf')],'XMF-T38TIMEOUT':_0x3d86f9['t38timeout'],'XMF-LOCALSTATIONID':_0x3d86f9['localstationid'],'XMF-PATH':_0x22e166[_0xc51f('0x10')]};return _0xcdad90;};exports[_0xc51f('0x11')]=function(_0x615cdd,_0x5971e8){return{'actionid':_0x615cdd[_0xc51f('0x12')],'action':_0xc51f('0x13'),'channel':_0x615cdd[_0xc51f('0x14')],'Exten':'xcally-motion-fax','Context':_0xc51f('0x15'),'Priority':'1','callerid':util['format']('\x22%s\x22\x20<%s>',_0x615cdd['headerinfo']?_0x615cdd[_0xc51f('0x9')]:'',_0x615cdd[_0xc51f('0x16')]),'variable':_0x5971e8,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x615cdd[_0xc51f('0x12')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index c78ef72..d83e163 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 _0x4558=['catch','listen','sync','log','bluebird','moment','./realtime','./acw','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','get','hour','initAgents','then','getTelephones','initTelephones','getTrunks','getVoiceQueues','initVoiceQueues','getTriggers','getTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getFaxAccounts','resolve','getVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports'];(function(_0x4b2010,_0x5153a6){var _0x378aa8=function(_0x1ae62e){while(--_0x1ae62e){_0x4b2010['push'](_0x4b2010['shift']());}};_0x378aa8(++_0x5153a6);}(_0x4558,0x7c));var _0x8455=function(_0x12e4a6,_0x11b4e0){_0x12e4a6=_0x12e4a6-0x0;var _0x426c47=_0x4558[_0x12e4a6];return _0x426c47;};'use strict';var BPromise=require(_0x8455('0x0'));var util=require('util');var moment=require(_0x8455('0x1'));var server=require('./server');var Realtime=require(_0x8455('0x2'));var Report=require('./report');var Acw=require(_0x8455('0x3'));var Trigger=require('./trigger');var Dialer=require(_0x8455('0x4'));var Preview=require(_0x8455('0x5'));var Fax=require(_0x8455('0x6'));var user=require(_0x8455('0x7'));var voiceQueue=require(_0x8455('0x8'));var voiceQueueReport=require(_0x8455('0x9'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x8455('0xa'));var trigger=require('./rpc/trigger');var template=require('./rpc/template');var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x8455('0xb'));var voiceExtension=require(_0x8455('0xc'));var faxAccount=require(_0x8455('0xd'));var zendesk=require(_0x8455('0xe'));var salesforce=require(_0x8455('0xf'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x8455('0x10'));var zoho=require(_0x8455('0x11'));var vtiger=require(_0x8455('0x12'));var freshsales=require(_0x8455('0x13'));var servicenow=require(_0x8455('0x14'));var dynamics365=require('./rpc/integrations/dynamics365');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 isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x8455('0x15')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x8455('0x16'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()['then'](user['getAgents']())['then'](realtime[_0x8455('0x17')]())[_0x8455('0x18')](user[_0x8455('0x19')]())[_0x8455('0x18')](realtime[_0x8455('0x1a')]())['then'](trunk[_0x8455('0x1b')]())['then'](realtime['initTrunks']())['then'](voiceQueue[_0x8455('0x1c')]())['then'](realtime[_0x8455('0x1d')]())[_0x8455('0x18')](trigger[_0x8455('0x1e')]())[_0x8455('0x18')](realtime['initTriggers']())[_0x8455('0x18')](template[_0x8455('0x1f')]())[_0x8455('0x18')](realtime['initTemplates']())[_0x8455('0x18')](zendesk[_0x8455('0x20')]())[_0x8455('0x18')](realtime[_0x8455('0x21')]())[_0x8455('0x18')](salesforce['getSalesforceAccounts']())[_0x8455('0x18')](realtime[_0x8455('0x22')]())[_0x8455('0x18')](sugarcrm[_0x8455('0x23')]())[_0x8455('0x18')](realtime[_0x8455('0x24')]())[_0x8455('0x18')](freshdesk[_0x8455('0x25')]())[_0x8455('0x18')](realtime[_0x8455('0x26')]())[_0x8455('0x18')](desk['getDeskAccounts']())['then'](realtime[_0x8455('0x27')]())['then'](zoho[_0x8455('0x28')]())['then'](realtime[_0x8455('0x29')]())[_0x8455('0x18')](vtiger[_0x8455('0x2a')]())[_0x8455('0x18')](realtime['initVtigerAccounts']())[_0x8455('0x18')](freshsales['getFreshsalesAccounts']())[_0x8455('0x18')](realtime['initFreshsalesAccounts']())[_0x8455('0x18')](servicenow['getServicenowAccounts']())['then'](realtime[_0x8455('0x2b')]())['then'](dynamics365[_0x8455('0x2c')]())[_0x8455('0x18')](realtime[_0x8455('0x2d')]())[_0x8455('0x18')](campaign[_0x8455('0x2e')]())['then'](realtime[_0x8455('0x2f')]())[_0x8455('0x18')](voiceExtension['getVoiceExtensions']())[_0x8455('0x18')](realtime['initVoiceExtensions']())[_0x8455('0x18')](faxAccount[_0x8455('0x30')]())[_0x8455('0x18')](realtime['initFaxAccounts']())[_0x8455('0x18')](function(){return realtime;});}function initParams(){return BPromise[_0x8455('0x31')]()[_0x8455('0x18')](voiceQueueReport[_0x8455('0x32')]())[_0x8455('0x18')](realtime['initVoiceQueueReports']())[_0x8455('0x18')](cmHopperHistory[_0x8455('0x33')]())[_0x8455('0x18')](realtime[_0x8455('0x34')]())['then'](cmHopperHistory[_0x8455('0x35')]())[_0x8455('0x18')](realtime['initCampaignHopperHistory']())['then'](voiceCallReport[_0x8455('0x36')]())[_0x8455('0x18')](realtime[_0x8455('0x37')]())['then'](function(_0x6944a7){})[_0x8455('0x38')](function(_0x245f6e){console['log'](_0x245f6e);});}function main(){return server[_0x8455('0x39')](realtime,preview,fax)[_0x8455('0x18')](function(_0x3a5c44){return initRealtime();})[_0x8455('0x18')](function(){return initParams();})['then'](function(){report[_0x8455('0x3a')]();setInterval(initRealtime,0x1388);})[_0x8455('0x38')](function(_0x308f7f){console[_0x8455('0x3b')](_0x308f7f);});}main(); \ No newline at end of file +var _0xd2ab=['getZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','getZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','catch','listen','sync','log','bluebird','util','./server','./realtime','./report','./acw','./dialer','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','hour','resolve','then','getAgents','initAgents','getTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','initTemplates'];(function(_0x48dc11,_0x5b63b5){var _0x552608=function(_0x7b6683){while(--_0x7b6683){_0x48dc11['push'](_0x48dc11['shift']());}};_0x552608(++_0x5b63b5);}(_0xd2ab,0x137));var _0xbd2a=function(_0x59136e,_0x50137e){_0x59136e=_0x59136e-0x0;var _0x3f136c=_0xd2ab[_0x59136e];return _0x3f136c;};'use strict';var BPromise=require(_0xbd2a('0x0'));var util=require(_0xbd2a('0x1'));var moment=require('moment');var server=require(_0xbd2a('0x2'));var Realtime=require(_0xbd2a('0x3'));var Report=require(_0xbd2a('0x4'));var Acw=require(_0xbd2a('0x5'));var Trigger=require('./trigger');var Dialer=require(_0xbd2a('0x6'));var Preview=require('./preview');var Fax=require(_0xbd2a('0x7'));var user=require(_0xbd2a('0x8'));var voiceQueue=require(_0xbd2a('0x9'));var voiceQueueReport=require(_0xbd2a('0xa'));var voiceCallReport=require(_0xbd2a('0xb'));var trunk=require(_0xbd2a('0xc'));var trigger=require(_0xbd2a('0xd'));var template=require('./rpc/template');var cmHopperHistory=require(_0xbd2a('0xe'));var campaign=require(_0xbd2a('0xf'));var voiceExtension=require(_0xbd2a('0x10'));var faxAccount=require(_0xbd2a('0x11'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0xbd2a('0x12'));var sugarcrm=require(_0xbd2a('0x13'));var freshdesk=require(_0xbd2a('0x14'));var desk=require(_0xbd2a('0x15'));var zoho=require(_0xbd2a('0x16'));var vtiger=require(_0xbd2a('0x17'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0xbd2a('0x18'));var dynamics365=require(_0xbd2a('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 isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0xbd2a('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0xbd2a('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xbd2a('0x1b')]()[_0xbd2a('0x1c')](user[_0xbd2a('0x1d')]())[_0xbd2a('0x1c')](realtime[_0xbd2a('0x1e')]())[_0xbd2a('0x1c')](user[_0xbd2a('0x1f')]())['then'](realtime['initTelephones']())[_0xbd2a('0x1c')](trunk[_0xbd2a('0x20')]())['then'](realtime[_0xbd2a('0x21')]())['then'](voiceQueue[_0xbd2a('0x22')]())['then'](realtime[_0xbd2a('0x23')]())[_0xbd2a('0x1c')](trigger[_0xbd2a('0x24')]())['then'](realtime[_0xbd2a('0x25')]())[_0xbd2a('0x1c')](template['getTemplates']())[_0xbd2a('0x1c')](realtime[_0xbd2a('0x26')]())[_0xbd2a('0x1c')](zendesk[_0xbd2a('0x27')]())[_0xbd2a('0x1c')](realtime['initZendeskAccounts']())[_0xbd2a('0x1c')](salesforce['getSalesforceAccounts']())['then'](realtime[_0xbd2a('0x28')]())[_0xbd2a('0x1c')](sugarcrm[_0xbd2a('0x29')]())['then'](realtime[_0xbd2a('0x2a')]())[_0xbd2a('0x1c')](freshdesk[_0xbd2a('0x2b')]())['then'](realtime['initFreshdeskAccounts']())['then'](desk[_0xbd2a('0x2c')]())[_0xbd2a('0x1c')](realtime['initDeskAccounts']())[_0xbd2a('0x1c')](zoho[_0xbd2a('0x2d')]())[_0xbd2a('0x1c')](realtime['initZohoAccounts']())[_0xbd2a('0x1c')](vtiger[_0xbd2a('0x2e')]())[_0xbd2a('0x1c')](realtime[_0xbd2a('0x2f')]())[_0xbd2a('0x1c')](freshsales[_0xbd2a('0x30')]())['then'](realtime[_0xbd2a('0x31')]())[_0xbd2a('0x1c')](servicenow[_0xbd2a('0x32')]())['then'](realtime[_0xbd2a('0x33')]())[_0xbd2a('0x1c')](dynamics365[_0xbd2a('0x34')]())[_0xbd2a('0x1c')](realtime[_0xbd2a('0x35')]())[_0xbd2a('0x1c')](campaign[_0xbd2a('0x36')]())[_0xbd2a('0x1c')](realtime[_0xbd2a('0x37')]())[_0xbd2a('0x1c')](voiceExtension[_0xbd2a('0x38')]())[_0xbd2a('0x1c')](realtime[_0xbd2a('0x39')]())[_0xbd2a('0x1c')](faxAccount[_0xbd2a('0x3a')]())['then'](realtime['initFaxAccounts']())[_0xbd2a('0x1c')](function(){return realtime;});}function initParams(){return BPromise[_0xbd2a('0x1b')]()[_0xbd2a('0x1c')](voiceQueueReport[_0xbd2a('0x3b')]())[_0xbd2a('0x1c')](realtime[_0xbd2a('0x3c')]())['then'](cmHopperHistory[_0xbd2a('0x3d')]())[_0xbd2a('0x1c')](realtime[_0xbd2a('0x3e')]())[_0xbd2a('0x1c')](cmHopperHistory[_0xbd2a('0x3f')]())['then'](realtime[_0xbd2a('0x40')]())[_0xbd2a('0x1c')](voiceCallReport[_0xbd2a('0x41')]())[_0xbd2a('0x1c')](realtime['initVoiceCallReports']())['then'](function(_0x54656f){})[_0xbd2a('0x42')](function(_0x2c71d0){console['log'](_0x2c71d0);});}function main(){return server[_0xbd2a('0x43')](realtime,preview,fax)[_0xbd2a('0x1c')](function(_0x8b1171){return initRealtime();})[_0xbd2a('0x1c')](function(){return initParams();})[_0xbd2a('0x1c')](function(){report[_0xbd2a('0x44')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x2f3a14){console[_0xbd2a('0x45')](_0x2f3a14);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 186f4f6..80571bf 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 _0x9c44=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','stateTime','address','voiceStatusQueue','stringify','format','user:%s','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','state','status','unknown'];(function(_0x5305c0,_0x2588e3){var _0x5c27bd=function(_0x3e5cce){while(--_0x3e5cce){_0x5305c0['push'](_0x5305c0['shift']());}};_0x5c27bd(++_0x2588e3);}(_0x9c44,0x178));var _0x49c4=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x9c44[_0x279d37];return _0x530173;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var Redis=require(_0x49c4('0x2'));var config=require(_0x49c4('0x3'));config[_0x49c4('0x4')]=_[_0x49c4('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x49c4('0x6'))(new Redis(config['redis']));function Agent(_0xc1278f){this['id']=_0xc1278f['id']||0x0;this[_0x49c4('0x7')]=_0xc1278f[_0x49c4('0x7')]||'';this[_0x49c4('0x8')]=_0xc1278f[_0x49c4('0x8')]||'';this['accountcode']=_0xc1278f[_0x49c4('0x9')]||'';this[_0x49c4('0xa')]=_0xc1278f[_0x49c4('0xa')]||'';this[_0x49c4('0xb')]='unknown';this['stateTime']=0x0;this[_0x49c4('0xc')]=_0x49c4('0xd');this['address']='';this[_0x49c4('0xe')]='';this[_0x49c4('0xf')]='';this['interface']='';this['online']=_0xc1278f[_0x49c4('0x10')]||![];this[_0x49c4('0x11')]='unknown';this[_0x49c4('0x12')]=0x0;this[_0x49c4('0x13')]='';this['voiceStatusQueue']='';this[_0x49c4('0x14')]=![];this[_0x49c4('0x15')]=![];this[_0x49c4('0x1')]='';}Agent[_0x49c4('0x16')][_0x49c4('0x17')]=function(_0x18211c){var _0x75ea8;if(_0x18211c&&_0x18211c[_0x49c4('0xb')]){_0x75ea8=_0x18211c['state'][_0x49c4('0x18')]();switch(_0x75ea8){case _0x49c4('0x19'):_0x75ea8=_0x49c4('0x1a');break;case _0x49c4('0x1b'):_0x75ea8=_0x49c4('0x1c');break;}}if(_0x75ea8&&this['voiceStatus']!==_0x75ea8||_0x18211c[_0x49c4('0x1d')]){this[_0x49c4('0x12')]=_['toNumber'](moment()['format']('x'));}if(_0x75ea8){this[_0x49c4('0x11')]=_0x75ea8;}var _0x2f82d5={'id':this['id'],'name':this[_0x49c4('0x7')],'email':this['email'],'accountcode':this[_0x49c4('0x9')],'fullname':this['fullname'],'state':this[_0x49c4('0xb')],'stateTime':this[_0x49c4('0x1e')],'status':this[_0x49c4('0xc')],'address':this[_0x49c4('0x1f')],'online':this[_0x49c4('0x10')],'voiceStatus':this[_0x49c4('0x11')],'voiceStatusTime':this[_0x49c4('0x12')],'voiceStatusCallerIdNumber':this[_0x49c4('0x13')],'voiceStatusQueue':this[_0x49c4('0x20')],'interface':this['interface'],'onhold':this['onhold']};var _0x57f502=md5(JSON[_0x49c4('0x21')](_0x2f82d5));if(this['md5']!==_0x57f502){this['md5']=_0x57f502;io['to'](util[_0x49c4('0x22')](_0x49c4('0x23'),_0x2f82d5[_0x49c4('0x7')]))[_0x49c4('0x24')]('user:save',_0x2f82d5);io['emit'](_0x49c4('0x25'),_0x2f82d5);}};module[_0x49c4('0x26')]=Agent; \ No newline at end of file +var _0x0713=['idle','inuse','talking','voiceStatusTime','toNumber','format','voiceStatusQueue','stringify','user:%s','emit','user:save','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusCallerIdNumber','onhold','local','prototype','state','toLowerCase','not_inuse'];(function(_0x4e720e,_0x15919d){var _0x185d01=function(_0x5b05de){while(--_0x5b05de){_0x4e720e['push'](_0x4e720e['shift']());}};_0x185d01(++_0x15919d);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var md5=require(_0x3071('0x1'));var Redis=require(_0x3071('0x2'));var config=require(_0x3071('0x3'));config[_0x3071('0x4')]=_['defaults'](config[_0x3071('0x4')],{'host':_0x3071('0x5'),'port':0x18eb});var io=require(_0x3071('0x6'))(new Redis(config[_0x3071('0x4')]));function Agent(_0xabd7b6){this['id']=_0xabd7b6['id']||0x0;this[_0x3071('0x7')]=_0xabd7b6[_0x3071('0x7')]||'';this[_0x3071('0x8')]=_0xabd7b6[_0x3071('0x8')]||'';this[_0x3071('0x9')]=_0xabd7b6[_0x3071('0x9')]||'';this[_0x3071('0xa')]=_0xabd7b6[_0x3071('0xa')]||'';this['state']=_0x3071('0xb');this[_0x3071('0xc')]=0x0;this[_0x3071('0xd')]=_0x3071('0xb');this[_0x3071('0xe')]='';this['phone']='';this[_0x3071('0xf')]='';this[_0x3071('0x10')]='';this[_0x3071('0x11')]=_0xabd7b6[_0x3071('0x11')]||![];this[_0x3071('0x12')]='unknown';this['voiceStatusTime']=0x0;this[_0x3071('0x13')]='';this['voiceStatusQueue']='';this[_0x3071('0x14')]=![];this[_0x3071('0x15')]=![];this['md5']='';}Agent[_0x3071('0x16')]['updateStatusRealtime']=function(_0x2fc15d){var _0x45c93b;if(_0x2fc15d&&_0x2fc15d[_0x3071('0x17')]){_0x45c93b=_0x2fc15d[_0x3071('0x17')][_0x3071('0x18')]();switch(_0x45c93b){case _0x3071('0x19'):_0x45c93b=_0x3071('0x1a');break;case _0x3071('0x1b'):_0x45c93b=_0x3071('0x1c');break;}}if(_0x45c93b&&this[_0x3071('0x12')]!==_0x45c93b||_0x2fc15d['statePause']){this[_0x3071('0x1d')]=_[_0x3071('0x1e')](moment()[_0x3071('0x1f')]('x'));}if(_0x45c93b){this[_0x3071('0x12')]=_0x45c93b;}var _0x3acf0e={'id':this['id'],'name':this[_0x3071('0x7')],'email':this[_0x3071('0x8')],'accountcode':this[_0x3071('0x9')],'fullname':this['fullname'],'state':this[_0x3071('0x17')],'stateTime':this[_0x3071('0xc')],'status':this[_0x3071('0xd')],'address':this['address'],'online':this[_0x3071('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x3071('0x1d')],'voiceStatusCallerIdNumber':this[_0x3071('0x13')],'voiceStatusQueue':this[_0x3071('0x20')],'interface':this[_0x3071('0x10')],'onhold':this[_0x3071('0x14')]};var _0x34c50e=md5(JSON[_0x3071('0x21')](_0x3acf0e));if(this[_0x3071('0x1')]!==_0x34c50e){this['md5']=_0x34c50e;io['to'](util['format'](_0x3071('0x22'),_0x3acf0e[_0x3071('0x7')]))[_0x3071('0x23')](_0x3071('0x24'),_0x3acf0e);io[_0x3071('0x23')](_0x3071('0x25'),_0x3acf0e);}};module[_0x3071('0x26')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index ff9eb5a..bd1e66e 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 _0x4141=['dialAMDMaximumWordLength','exports','name','type','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','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x4141,0xf7));var _0x1414=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4141[_0x122ef9];return _0x42fba0;};'use strict';function Campaign(_0x25b563){this['id']=_0x25b563['id']||0x0;this[_0x1414('0x0')]=_0x25b563[_0x1414('0x0')]||'';this[_0x1414('0x1')]=_0x25b563[_0x1414('0x1')]||'campaign';this[_0x1414('0x2')]=0x0;this['temp']=0x0;this[_0x1414('0x3')]=0x0;this[_0x1414('0x4')]=0x0;this[_0x1414('0x5')]='';this[_0x1414('0x6')]=!![];this[_0x1414('0x7')]=_0x25b563[_0x1414('0x7')];this[_0x1414('0x8')]=_0x25b563['limitCalls'];this[_0x1414('0x9')]=_0x25b563[_0x1414('0x9')]||null;this[_0x1414('0xa')]=_0x25b563[_0x1414('0xa')]?_0x25b563[_0x1414('0xa')]:null;this[_0x1414('0xb')]=_0x25b563[_0x1414('0xb')];this[_0x1414('0xc')]=_0x25b563[_0x1414('0xc')];this[_0x1414('0xd')]=_0x25b563[_0x1414('0xd')]||0x1e;this['dialCongestionMaxRetry']=_0x25b563[_0x1414('0xe')];this[_0x1414('0xf')]=_0x25b563['dialCongestionRetryFrequency'];this[_0x1414('0x10')]=_0x25b563[_0x1414('0x10')];this[_0x1414('0x11')]=_0x25b563['dialBusyRetryFrequency'];this[_0x1414('0x12')]=_0x25b563[_0x1414('0x12')];this['dialNoAnswerRetryFrequency']=_0x25b563[_0x1414('0x13')];this[_0x1414('0x14')]=_0x25b563[_0x1414('0x14')];this[_0x1414('0x15')]=_0x25b563[_0x1414('0x15')]||0x3;this[_0x1414('0x16')]=_0x25b563[_0x1414('0x16')]||0x96;this['dialDropMaxRetry']=_0x25b563[_0x1414('0x17')]||0x3;this[_0x1414('0x18')]=_0x25b563[_0x1414('0x18')]||0x96;this[_0x1414('0x19')]=_0x25b563['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x25b563[_0x1414('0x1a')]||0x96;this['dialMachineMaxRetry']=_0x25b563['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x25b563[_0x1414('0x1b')]||0x96;this[_0x1414('0x1c')]=_0x25b563['dialAgentRejectMaxRetry']||0x3;this['dialAgentRejectRetryFrequency']=_0x25b563[_0x1414('0x1d')]||0x96;this[_0x1414('0x1e')]=_0x25b563[_0x1414('0x1e')]||'DESC';this[_0x1414('0x1f')]=_0x25b563['dialPrefix']||undefined;this[_0x1414('0x20')]=_0x25b563['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x25b563['dialCutDigit']||undefined;this[_0x1414('0x21')]=_0x25b563['TrunkBackup']?_0x25b563[_0x1414('0x21')]:undefined;this[_0x1414('0x22')]=_0x25b563[_0x1414('0x22')]?_0x25b563[_0x1414('0x22')]:undefined;this[_0x1414('0x23')]=_0x25b563[_0x1414('0x23')]?_0x25b563[_0x1414('0x23')]:undefined;this[_0x1414('0x24')]=_0x25b563[_0x1414('0x24')]?_0x25b563[_0x1414('0x24')]:undefined;this[_0x1414('0x25')]=_0x25b563[_0x1414('0x24')]?_0x25b563['SquareProject'][_0x1414('0x0')]:undefined;this['dialAMDActive']=_0x25b563[_0x1414('0x26')]||![];this[_0x1414('0x27')]=_0x25b563[_0x1414('0x27')];this[_0x1414('0x28')]=_0x25b563[_0x1414('0x28')];this['dialAMDAfterGreetingSilence']=_0x25b563[_0x1414('0x29')];this[_0x1414('0x2a')]=_0x25b563[_0x1414('0x2a')];this[_0x1414('0x2b')]=_0x25b563[_0x1414('0x2b')];this[_0x1414('0x2c')]=_0x25b563[_0x1414('0x2c')];this[_0x1414('0x2d')]=_0x25b563['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x25b563[_0x1414('0x2e')];this[_0x1414('0x2f')]=_0x25b563[_0x1414('0x2f')];}module[_0x1414('0x30')]=Campaign; \ No newline at end of file +var _0x08ec=['Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','TrunkBackup'];(function(_0x5e4b85,_0x6cf965){var _0x5cd3cb=function(_0x589c9e){while(--_0x589c9e){_0x5e4b85['push'](_0x5e4b85['shift']());}};_0x5cd3cb(++_0x6cf965);}(_0x08ec,0x1d1));var _0xc08e=function(_0x4d0468,_0x1f9694){_0x4d0468=_0x4d0468-0x0;var _0x481f9b=_0x08ec[_0x4d0468];return _0x481f9b;};'use strict';function Campaign(_0xbf0103){this['id']=_0xbf0103['id']||0x0;this[_0xc08e('0x0')]=_0xbf0103[_0xc08e('0x0')]||'';this[_0xc08e('0x1')]=_0xbf0103['type']||_0xc08e('0x2');this[_0xc08e('0x3')]=0x0;this[_0xc08e('0x4')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0xc08e('0x5')]=0x0;this[_0xc08e('0x6')]='';this[_0xc08e('0x7')]=!![];this['active']=_0xbf0103[_0xc08e('0x8')];this[_0xc08e('0x9')]=_0xbf0103[_0xc08e('0x9')];this[_0xc08e('0xa')]=_0xbf0103[_0xc08e('0xa')]||null;this[_0xc08e('0xb')]=_0xbf0103[_0xc08e('0xb')]?_0xbf0103['dialGlobalInterval']:null;this[_0xc08e('0xc')]=_0xbf0103['dialOriginateCallerIdName'];this['dialOriginateCallerIdNumber']=_0xbf0103[_0xc08e('0xd')];this['dialOriginateTimeout']=_0xbf0103[_0xc08e('0xe')]||0x1e;this['dialCongestionMaxRetry']=_0xbf0103[_0xc08e('0xf')];this['dialCongestionRetryFrequency']=_0xbf0103[_0xc08e('0x10')];this['dialBusyMaxRetry']=_0xbf0103[_0xc08e('0x11')];this['dialBusyRetryFrequency']=_0xbf0103[_0xc08e('0x12')];this[_0xc08e('0x13')]=_0xbf0103[_0xc08e('0x13')];this['dialNoAnswerRetryFrequency']=_0xbf0103[_0xc08e('0x14')];this[_0xc08e('0x15')]=_0xbf0103['dialGlobalMaxRetry'];this[_0xc08e('0x16')]=_0xbf0103[_0xc08e('0x16')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0xbf0103['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0xbf0103['dialDropMaxRetry']||0x3;this[_0xc08e('0x17')]=_0xbf0103[_0xc08e('0x17')]||0x96;this[_0xc08e('0x18')]=_0xbf0103['dialAbandonedMaxRetry']||0x3;this[_0xc08e('0x19')]=_0xbf0103[_0xc08e('0x19')]||0x96;this['dialMachineMaxRetry']=_0xbf0103[_0xc08e('0x1a')]||0x3;this[_0xc08e('0x1b')]=_0xbf0103[_0xc08e('0x1b')]||0x96;this[_0xc08e('0x1c')]=_0xbf0103[_0xc08e('0x1c')]||0x3;this[_0xc08e('0x1d')]=_0xbf0103[_0xc08e('0x1d')]||0x96;this[_0xc08e('0x1e')]=_0xbf0103[_0xc08e('0x1e')]||_0xc08e('0x1f');this[_0xc08e('0x20')]=_0xbf0103[_0xc08e('0x20')]||undefined;this[_0xc08e('0x21')]=_0xbf0103[_0xc08e('0x21')]||undefined;this['dialCutDigit']=_0xbf0103['dialCutDigit']||undefined;this[_0xc08e('0x22')]=_0xbf0103[_0xc08e('0x22')]?_0xbf0103['TrunkBackup']:undefined;this[_0xc08e('0x23')]=_0xbf0103[_0xc08e('0x23')]?_0xbf0103[_0xc08e('0x23')]:undefined;this[_0xc08e('0x24')]=_0xbf0103[_0xc08e('0x24')]?_0xbf0103['Interval']:undefined;this['SquareProject']=_0xbf0103[_0xc08e('0x25')]?_0xbf0103[_0xc08e('0x25')]:undefined;this[_0xc08e('0x26')]=_0xbf0103[_0xc08e('0x25')]?_0xbf0103[_0xc08e('0x25')]['name']:undefined;this[_0xc08e('0x27')]=_0xbf0103[_0xc08e('0x27')]||![];this[_0xc08e('0x28')]=_0xbf0103[_0xc08e('0x28')];this['dialAMDGreeting']=_0xbf0103[_0xc08e('0x29')];this[_0xc08e('0x2a')]=_0xbf0103[_0xc08e('0x2a')];this['dialAMDTotalAnalysisTime']=_0xbf0103[_0xc08e('0x2b')];this[_0xc08e('0x2c')]=_0xbf0103['dialAMDMinWordLength'];this[_0xc08e('0x2d')]=_0xbf0103[_0xc08e('0x2d')];this[_0xc08e('0x2e')]=_0xbf0103[_0xc08e('0x2e')];this[_0xc08e('0x2f')]=_0xbf0103[_0xc08e('0x2f')];this[_0xc08e('0x30')]=_0xbf0103[_0xc08e('0x30')];}module[_0xc08e('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 f21c477..858d26d 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 _0x793b=['unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','type','tag','monitor','monitorFilename','transfercalleridnum','transferconnectedlinenum','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinename','accountcode','linkedid','exten','answered','answertime','endtime'];(function(_0x2c9b79,_0x7cf58b){var _0x265032=function(_0x188a92){while(--_0x188a92){_0x2c9b79['push'](_0x2c9b79['shift']());}};_0x265032(++_0x7cf58b);}(_0x793b,0x189));var _0xb793=function(_0x2d67f0,_0x581665){_0x2d67f0=_0x2d67f0-0x0;var _0x191a9b=_0x793b[_0x2d67f0];return _0x191a9b;};'use strict';function Channel(){this[_0xb793('0x0')]=null;this[_0xb793('0x1')]='';this[_0xb793('0x2')]='';this[_0xb793('0x3')]=0x0;this[_0xb793('0x4')]='';this['connectedlinenum']=undefined;this[_0xb793('0x5')]=undefined;this[_0xb793('0x6')]=0x0;this['context']='';this['uniqueid']=0x0;this[_0xb793('0x7')]=0x0;this[_0xb793('0x8')]=0x0;this[_0xb793('0x9')]=![];this[_0xb793('0xa')]=null;this[_0xb793('0xb')]=null;this[_0xb793('0xc')]=![];this[_0xb793('0xd')]=![];this[_0xb793('0xe')]='';this[_0xb793('0xf')]='';this[_0xb793('0x10')]=0x0;this[_0xb793('0x11')]=0x0;this[_0xb793('0x12')]=0x0;this[_0xb793('0x13')]=null;this[_0xb793('0x14')]=null;this['disposition']=null;this[_0xb793('0x15')]=![];this[_0xb793('0x16')]=null;this['queue']=null;this['monitors']=[];this[_0xb793('0x17')]=undefined;this[_0xb793('0x18')]=undefined;this['transferType']=undefined;this[_0xb793('0x19')]=0x0;}module[_0xb793('0x1a')]=Channel; \ No newline at end of file +var _0xdf28=['exports','starttime','destinationchannel','calleridname','connectedlinenum','accountcode','context','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned','lastdata','duration','billableseconds','holdtime','type','monitorFilename','queue','transfercalleridnum','transferType','mohtime'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdf28,0x1c3));var _0x8df2=function(_0x393db8,_0x3e1157){_0x393db8=_0x393db8-0x0;var _0x4295cc=_0xdf28[_0x393db8];return _0x4295cc;};'use strict';function Channel(){this[_0x8df2('0x0')]=null;this['channel']='';this[_0x8df2('0x1')]='';this['calleridnum']=0x0;this[_0x8df2('0x2')]='';this[_0x8df2('0x3')]=undefined;this['connectedlinename']=undefined;this[_0x8df2('0x4')]=0x0;this[_0x8df2('0x5')]='';this[_0x8df2('0x6')]=0x0;this[_0x8df2('0x7')]=0x0;this[_0x8df2('0x8')]=0x0;this[_0x8df2('0x9')]=![];this[_0x8df2('0xa')]=null;this[_0x8df2('0xb')]=null;this[_0x8df2('0xc')]=![];this[_0x8df2('0xd')]=![];this['lastapplication']='';this[_0x8df2('0xe')]='';this[_0x8df2('0xf')]=0x0;this[_0x8df2('0x10')]=0x0;this[_0x8df2('0x11')]=0x0;this[_0x8df2('0x12')]=null;this['tag']=null;this['disposition']=null;this['monitor']=![];this[_0x8df2('0x13')]=null;this[_0x8df2('0x14')]=null;this['monitors']=[];this[_0x8df2('0x15')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x8df2('0x16')]=undefined;this[_0x8df2('0x17')]=0x0;}module[_0x8df2('0x18')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 0a82a1b..d7eb2bd 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 _0xf65f=['remoteUri','authType','password','consumerKey','consumerSecret','tokenSecret','type','serverUrl','Configurations','exports','name','username'];(function(_0x363901,_0x5750af){var _0x20a769=function(_0x2bb2ca){while(--_0x2bb2ca){_0x363901['push'](_0x363901['shift']());}};_0x20a769(++_0x5750af);}(_0xf65f,0x1c6));var _0xff65=function(_0x509c83,_0x511882){_0x509c83=_0x509c83-0x0;var _0x534626=_0xf65f[_0x509c83];return _0x534626;};'use strict';function DeskAccount(_0x18b01e){this['id']=_0x18b01e['id']||0x0;this[_0xff65('0x0')]=_0x18b01e[_0xff65('0x0')]||'';this[_0xff65('0x1')]=_0x18b01e[_0xff65('0x1')]||'';this[_0xff65('0x2')]=_0x18b01e[_0xff65('0x2')]||'';this[_0xff65('0x3')]=_0x18b01e[_0xff65('0x3')]||'';this['password']=_0x18b01e[_0xff65('0x4')]||'';this[_0xff65('0x5')]=_0x18b01e[_0xff65('0x5')]||'';this[_0xff65('0x6')]=_0x18b01e[_0xff65('0x6')]||'';this['token']=_0x18b01e['token']||'';this[_0xff65('0x7')]=_0x18b01e[_0xff65('0x7')]||'';this[_0xff65('0x8')]=_0x18b01e[_0xff65('0x8')]||'';this['serverUrl']=_0x18b01e[_0xff65('0x9')]||'';this[_0xff65('0xa')]=_0x18b01e['Configurations']||{};}module[_0xff65('0xb')]=DeskAccount; \ No newline at end of file +var _0xd25f=['consumerSecret','token','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey'];(function(_0x64bbb9,_0x909c76){var _0x5c3707=function(_0x26ded5){while(--_0x26ded5){_0x64bbb9['push'](_0x64bbb9['shift']());}};_0x5c3707(++_0x909c76);}(_0xd25f,0x162));var _0xfd25=function(_0x1bc013,_0x7771c6){_0x1bc013=_0x1bc013-0x0;var _0x55df36=_0xd25f[_0x1bc013];return _0x55df36;};'use strict';function DeskAccount(_0x4edaaf){this['id']=_0x4edaaf['id']||0x0;this[_0xfd25('0x0')]=_0x4edaaf[_0xfd25('0x0')]||'';this['username']=_0x4edaaf[_0xfd25('0x1')]||'';this[_0xfd25('0x2')]=_0x4edaaf[_0xfd25('0x2')]||'';this['authType']=_0x4edaaf[_0xfd25('0x3')]||'';this[_0xfd25('0x4')]=_0x4edaaf[_0xfd25('0x4')]||'';this[_0xfd25('0x5')]=_0x4edaaf[_0xfd25('0x5')]||'';this[_0xfd25('0x6')]=_0x4edaaf[_0xfd25('0x6')]||'';this[_0xfd25('0x7')]=_0x4edaaf[_0xfd25('0x7')]||'';this['tokenSecret']=_0x4edaaf['tokenSecret']||'';this[_0xfd25('0x8')]=_0x4edaaf[_0xfd25('0x8')]||'';this[_0xfd25('0x9')]=_0x4edaaf[_0xfd25('0x9')]||'';this[_0xfd25('0xa')]=_0x4edaaf['Configurations']||{};}module[_0xfd25('0xb')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index ff7d68e..df74079 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 _0x5b02=['username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5b02,0xe9));var _0x25b0=function(_0x2df0db,_0x3fa42d){_0x2df0db=_0x2df0db-0x0;var _0x492caf=_0x5b02[_0x2df0db];return _0x492caf;};'use strict';function Dynamics365Account(_0x5d3c24){this['id']=_0x5d3c24['id']||0x0;this[_0x25b0('0x0')]=_0x5d3c24[_0x25b0('0x0')]||'';this[_0x25b0('0x1')]=_0x5d3c24['username']||'';this['password']=_0x5d3c24[_0x25b0('0x2')]||'';this['remoteUri']=_0x5d3c24[_0x25b0('0x3')]||'';this[_0x25b0('0x4')]=_0x5d3c24[_0x25b0('0x4')]||'';this[_0x25b0('0x5')]=_0x5d3c24[_0x25b0('0x5')]||'';this['clientSecret']=_0x5d3c24[_0x25b0('0x6')]||{};this[_0x25b0('0x7')]=_0x5d3c24['serverUrl']||'';this[_0x25b0('0x8')]=_0x5d3c24['Configurations']||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0xda3f=['clientId','serverUrl','Configurations','exports','name','password','remoteUri','tenantId'];(function(_0x543167,_0x1b53bf){var _0x527731=function(_0x3e3d28){while(--_0x3e3d28){_0x543167['push'](_0x543167['shift']());}};_0x527731(++_0x1b53bf);}(_0xda3f,0xec));var _0xfda3=function(_0x2caa44,_0x5776ed){_0x2caa44=_0x2caa44-0x0;var _0x77d435=_0xda3f[_0x2caa44];return _0x77d435;};'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 diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index c7c9bd5..86c8fb5 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 _0xa4b1=['exports','name','description','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId'];(function(_0xb8feff,_0x1185f7){var _0x27a7e1=function(_0x12936b){while(--_0x12936b){_0xb8feff['push'](_0xb8feff['shift']());}};_0x27a7e1(++_0x1185f7);}(_0xa4b1,0x101));var _0x1a4b=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa4b1[_0x19e35c];return _0x3e1fe8;};'use strict';function FaxAccount(_0x570c39){this['id']=_0x570c39['id']||0x0;this['name']=_0x570c39[_0x1a4b('0x0')]||'';this[_0x1a4b('0x1')]=_0x570c39['description'];this['ecm']=_0x570c39['ecm'];this[_0x1a4b('0x2')]=_0x570c39[_0x1a4b('0x2')];this['localstationid']=_0x570c39[_0x1a4b('0x3')];this[_0x1a4b('0x4')]=_0x570c39[_0x1a4b('0x4')]||0x960;this[_0x1a4b('0x5')]=_0x570c39[_0x1a4b('0x5')]||0x3840;this[_0x1a4b('0x6')]=_0x570c39[_0x1a4b('0x6')]||_0x1a4b('0x7');this[_0x1a4b('0x8')]=_0x570c39[_0x1a4b('0x8')]||'no';this['faxdetect']=_0x570c39[_0x1a4b('0x9')]||'no';this[_0x1a4b('0xa')]=_0x570c39['t38timeout']||0x1388;this[_0x1a4b('0xb')]=_0x570c39[_0x1a4b('0xb')]||_0x1a4b('0xc');this[_0x1a4b('0xd')]=_0x570c39[_0x1a4b('0xd')]?_0x570c39[_0x1a4b('0xd')]:undefined;this[_0x1a4b('0xe')]=_0x570c39[_0x1a4b('0xe')];this['key']=_0x570c39['key'];}module[_0x1a4b('0xf')]=FaxAccount; \ No newline at end of file +var _0x7d65=['description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name'];(function(_0x2f4a8c,_0x178a48){var _0x370ae6=function(_0x3b042c){while(--_0x3b042c){_0x2f4a8c['push'](_0x2f4a8c['shift']());}};_0x370ae6(++_0x178a48);}(_0x7d65,0xb3));var _0x57d6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x7d65[_0x2dafbe];return _0x58a45a;};'use strict';function FaxAccount(_0x40f946){this['id']=_0x40f946['id']||0x0;this[_0x57d6('0x0')]=_0x40f946[_0x57d6('0x0')]||'';this[_0x57d6('0x1')]=_0x40f946[_0x57d6('0x1')];this[_0x57d6('0x2')]=_0x40f946[_0x57d6('0x2')];this[_0x57d6('0x3')]=_0x40f946[_0x57d6('0x3')];this[_0x57d6('0x4')]=_0x40f946[_0x57d6('0x4')];this[_0x57d6('0x5')]=_0x40f946['minrate']||0x960;this['maxrate']=_0x40f946[_0x57d6('0x6')]||0x3840;this[_0x57d6('0x7')]=_0x40f946[_0x57d6('0x7')]||_0x57d6('0x8');this['gateway']=_0x40f946[_0x57d6('0x9')]||'no';this[_0x57d6('0xa')]=_0x40f946[_0x57d6('0xa')]||'no';this[_0x57d6('0xb')]=_0x40f946[_0x57d6('0xb')]||0x1388;this[_0x57d6('0xc')]=_0x40f946[_0x57d6('0xc')]||_0x57d6('0xd');this[_0x57d6('0xe')]=_0x40f946[_0x57d6('0xe')]?_0x40f946['Trunk']:undefined;this[_0x57d6('0xf')]=_0x40f946[_0x57d6('0xf')];this[_0x57d6('0x10')]=_0x40f946[_0x57d6('0x10')];}module[_0x57d6('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 af72798..783fc33 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 _0xc3ba=['username','token','remoteUri','serverUrl','Configurations','name'];(function(_0x9350dd,_0x550ebe){var _0x36c41a=function(_0x2212b6){while(--_0x2212b6){_0x9350dd['push'](_0x9350dd['shift']());}};_0x36c41a(++_0x550ebe);}(_0xc3ba,0x137));var _0xac3b=function(_0x44e605,_0x11bda5){_0x44e605=_0x44e605-0x0;var _0x285176=_0xc3ba[_0x44e605];return _0x285176;};'use strict';function FreshdeskAccount(_0x4e5610){this['id']=_0x4e5610['id']||0x0;this['name']=_0x4e5610[_0xac3b('0x0')]||'';this[_0xac3b('0x1')]=_0x4e5610['username']||'';this['apiKey']=_0x4e5610[_0xac3b('0x2')]||'';this[_0xac3b('0x3')]=_0x4e5610[_0xac3b('0x3')]||'';this[_0xac3b('0x4')]=_0x4e5610[_0xac3b('0x4')]||'';this['Configurations']=_0x4e5610[_0xac3b('0x5')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0xa137=['username','apiKey','token','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x54e46c,_0x3707e1){var _0x193c09=function(_0x5206f2){while(--_0x5206f2){_0x54e46c['push'](_0x54e46c['shift']());}};_0x193c09(++_0x3707e1);}(_0xa137,0x177));var _0x7a13=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xa137[_0x3e5086];return _0xfeb102;};'use strict';function FreshdeskAccount(_0x6a34bb){this['id']=_0x6a34bb['id']||0x0;this[_0x7a13('0x0')]=_0x6a34bb[_0x7a13('0x0')]||'';this['username']=_0x6a34bb[_0x7a13('0x1')]||'';this[_0x7a13('0x2')]=_0x6a34bb[_0x7a13('0x3')]||'';this[_0x7a13('0x4')]=_0x6a34bb['remoteUri']||'';this[_0x7a13('0x5')]=_0x6a34bb['serverUrl']||'';this[_0x7a13('0x6')]=_0x6a34bb[_0x7a13('0x6')]||{};}module[_0x7a13('0x7')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 0d15909..e439def 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 _0xf2ca=['Configurations','exports','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x1cba28,_0x335221){var _0x4af978=function(_0x4a5567){while(--_0x4a5567){_0x1cba28['push'](_0x1cba28['shift']());}};_0x4af978(++_0x335221);}(_0xf2ca,0x16a));var _0xaf2c=function(_0xe4d6c6,_0x3bdbf2){_0xe4d6c6=_0xe4d6c6-0x0;var _0x3a8935=_0xf2ca[_0xe4d6c6];return _0x3a8935;};'use strict';function FreshsalesAccount(_0x45e586){this['id']=_0x45e586['id']||0x0;this[_0xaf2c('0x0')]=_0x45e586[_0xaf2c('0x0')]||'';this['username']=_0x45e586[_0xaf2c('0x1')]||'';this[_0xaf2c('0x2')]=_0x45e586[_0xaf2c('0x3')]||'';this[_0xaf2c('0x4')]=_0x45e586[_0xaf2c('0x4')]||'';this[_0xaf2c('0x5')]=_0x45e586['serverUrl']||'';this[_0xaf2c('0x6')]=_0x45e586[_0xaf2c('0x6')]||{};}module[_0xaf2c('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0x0f80=['apiKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x4efe30,_0x10d4c3){var _0x154f4e=function(_0xd12157){while(--_0xd12157){_0x4efe30['push'](_0x4efe30['shift']());}};_0x154f4e(++_0x10d4c3);}(_0x0f80,0x108));var _0x00f8=function(_0x52c4ae,_0x596203){_0x52c4ae=_0x52c4ae-0x0;var _0x54571d=_0x0f80[_0x52c4ae];return _0x54571d;};'use strict';function FreshsalesAccount(_0x2aaa24){this['id']=_0x2aaa24['id']||0x0;this[_0x00f8('0x0')]=_0x2aaa24[_0x00f8('0x0')]||'';this[_0x00f8('0x1')]=_0x2aaa24[_0x00f8('0x1')]||'';this[_0x00f8('0x2')]=_0x2aaa24['token']||'';this[_0x00f8('0x3')]=_0x2aaa24[_0x00f8('0x3')]||'';this[_0x00f8('0x4')]=_0x2aaa24['serverUrl']||'';this[_0x00f8('0x5')]=_0x2aaa24[_0x00f8('0x5')]||{};}module[_0x00f8('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 b23db3d..62b0773 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 _0x437f=['lastAssignedTo','motionChannel','variables','type','inbound','uniqueid','calleridnum','queue','queuecallerjoinAt','queuecallerleaveAt','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','accountcode','context','priority','assigned'];(function(_0x1bc505,_0x1b8139){var _0x150582=function(_0x379b50){while(--_0x379b50){_0x1bc505['push'](_0x1bc505['shift']());}};_0x150582(++_0x1b8139);}(_0x437f,0x16b));var _0xf437=function(_0x1f2b50,_0x20b570){_0x1f2b50=_0x1f2b50-0x0;var _0x5675c1=_0x437f[_0x1f2b50];return _0x5675c1;};'use strict';function QueueReport(){this[_0xf437('0x0')]=_0xf437('0x1');this[_0xf437('0x2')]='';this[_0xf437('0x3')]='';this['calleridname']='';this[_0xf437('0x4')]='';this[_0xf437('0x5')]=null;this[_0xf437('0x6')]=null;this['position']=0x1;this[_0xf437('0x7')]=0x1;this[_0xf437('0x8')]=![];this[_0xf437('0x9')]=null;this[_0xf437('0xa')]=![];this[_0xf437('0xb')]=null;this[_0xf437('0xc')]=![];this[_0xf437('0xd')]=null;this[_0xf437('0xe')]=0x1;this[_0xf437('0xf')]='';this[_0xf437('0x10')]='';this['connectedlinename']='';this[_0xf437('0x11')]='';this[_0xf437('0x12')]='';this['exten']='';this[_0xf437('0x13')]='';this['holdtime']=0x0;this[_0xf437('0x14')]=![];this[_0xf437('0x15')]='';this[_0xf437('0x16')]='voice';this['mohtime']=0x0;this[_0xf437('0x17')]={};}module['exports']=QueueReport; \ No newline at end of file +var _0x221e=['priority','holdtime','motionChannel','voice','mohtime','variables','inbound','uniqueid','calleridnum','calleridname','queuecallerleaveAt','position','count','queuecallercomplete','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','exten'];(function(_0x4bea2a,_0x1638c5){var _0x152ad2=function(_0x25c627){while(--_0x25c627){_0x4bea2a['push'](_0x4bea2a['shift']());}};_0x152ad2(++_0x1638c5);}(_0x221e,0x166));var _0xe221=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x221e[_0x39096d];return _0x13da4f;};'use strict';function QueueReport(){this['type']=_0xe221('0x0');this[_0xe221('0x1')]='';this[_0xe221('0x2')]='';this[_0xe221('0x3')]='';this['queue']='';this['queuecallerjoinAt']=null;this[_0xe221('0x4')]=null;this[_0xe221('0x5')]=0x1;this[_0xe221('0x6')]=0x1;this['queuecallerabandon']=![];this['queuecallerabandonAt']=null;this[_0xe221('0x7')]=![];this['queuecallercompleteAt']=null;this[_0xe221('0x8')]=![];this[_0xe221('0x9')]=null;this[_0xe221('0xa')]=0x1;this[_0xe221('0xb')]='';this[_0xe221('0xc')]='';this[_0xe221('0xd')]='';this[_0xe221('0xe')]='';this['context']='';this[_0xe221('0xf')]='';this[_0xe221('0x10')]='';this[_0xe221('0x11')]=0x0;this['assigned']=![];this['lastAssignedTo']='';this[_0xe221('0x12')]=_0xe221('0x13');this[_0xe221('0x14')]=0x0;this[_0xe221('0x15')]={};}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 bc7d407..3832050 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 _0x918e=['username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name'];(function(_0x54037b,_0x5da998){var _0x3e1921=function(_0x2341ef){while(--_0x2341ef){_0x54037b['push'](_0x54037b['shift']());}};_0x3e1921(++_0x5da998);}(_0x918e,0x173));var _0xe918=function(_0x2ad92f,_0x4b729f){_0x2ad92f=_0x2ad92f-0x0;var _0x4d731c=_0x918e[_0x2ad92f];return _0x4d731c;};'use strict';function SalesforceAccount(_0x3a9d08){this['id']=_0x3a9d08['id']||0x0;this[_0xe918('0x0')]=_0x3a9d08[_0xe918('0x0')]||'';this['username']=_0x3a9d08[_0xe918('0x1')]||'';this[_0xe918('0x2')]=_0x3a9d08[_0xe918('0x2')]||'';this[_0xe918('0x3')]=_0x3a9d08[_0xe918('0x3')]||'';this[_0xe918('0x4')]=_0x3a9d08[_0xe918('0x4')]||'';this[_0xe918('0x5')]=_0x3a9d08[_0xe918('0x5')]||'';this['securityToken']=_0x3a9d08[_0xe918('0x6')]||'';this['type']=_0x3a9d08[_0xe918('0x7')]||_0xe918('0x8');this[_0xe918('0x9')]=_0x3a9d08[_0xe918('0x9')]||'';this[_0xe918('0xa')]=_0x3a9d08[_0xe918('0xa')]||{};}module[_0xe918('0xb')]=SalesforceAccount; \ No newline at end of file +var _0x1544=['clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','username','remoteUri','password','clientId'];(function(_0x11d7f6,_0x2aaf46){var _0x5732bd=function(_0x5bc6db){while(--_0x5bc6db){_0x11d7f6['push'](_0x11d7f6['shift']());}};_0x5732bd(++_0x2aaf46);}(_0x1544,0x6a));var _0x4154=function(_0x45fb8f,_0x46da98){_0x45fb8f=_0x45fb8f-0x0;var _0x3d906b=_0x1544[_0x45fb8f];return _0x3d906b;};'use strict';function SalesforceAccount(_0x1a2af2){this['id']=_0x1a2af2['id']||0x0;this['name']=_0x1a2af2['name']||'';this[_0x4154('0x0')]=_0x1a2af2[_0x4154('0x0')]||'';this[_0x4154('0x1')]=_0x1a2af2[_0x4154('0x1')]||'';this[_0x4154('0x2')]=_0x1a2af2[_0x4154('0x2')]||'';this[_0x4154('0x3')]=_0x1a2af2['clientId']||'';this[_0x4154('0x4')]=_0x1a2af2[_0x4154('0x4')]||'';this[_0x4154('0x5')]=_0x1a2af2['securityToken']||'';this[_0x4154('0x6')]=_0x1a2af2[_0x4154('0x6')]||_0x4154('0x7');this['serverUrl']=_0x1a2af2[_0x4154('0x8')]||'';this[_0x4154('0x9')]=_0x1a2af2['Configurations']||{};}module[_0x4154('0xa')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 3c9cee2..a3696d3 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 _0xa39f=['password','remoteUri','serverUrl','Configurations','name','username'];(function(_0x320839,_0x3a18a5){var _0x29387e=function(_0x4f52ad){while(--_0x4f52ad){_0x320839['push'](_0x320839['shift']());}};_0x29387e(++_0x3a18a5);}(_0xa39f,0x1e4));var _0xfa39=function(_0x952282,_0x51a614){_0x952282=_0x952282-0x0;var _0x613507=_0xa39f[_0x952282];return _0x613507;};'use strict';function ServicenowAccount(_0x38d17c){this['id']=_0x38d17c['id']||0x0;this[_0xfa39('0x0')]=_0x38d17c[_0xfa39('0x0')]||'';this['username']=_0x38d17c[_0xfa39('0x1')]||'';this[_0xfa39('0x2')]=_0x38d17c[_0xfa39('0x2')]||'';this[_0xfa39('0x3')]=_0x38d17c[_0xfa39('0x3')]||'';this[_0xfa39('0x4')]=_0x38d17c[_0xfa39('0x4')]||'';this[_0xfa39('0x5')]=_0x38d17c['Configurations']||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0x4b2d=['username','password','remoteUri','serverUrl','Configurations','name'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x4b2d,0x13d));var _0xd4b2=function(_0x37e886,_0x17d0ad){_0x37e886=_0x37e886-0x0;var _0x57c5cd=_0x4b2d[_0x37e886];return _0x57c5cd;};'use strict';function ServicenowAccount(_0x44819f){this['id']=_0x44819f['id']||0x0;this['name']=_0x44819f[_0xd4b2('0x0')]||'';this[_0xd4b2('0x1')]=_0x44819f['username']||'';this[_0xd4b2('0x2')]=_0x44819f[_0xd4b2('0x2')]||'';this['remoteUri']=_0x44819f[_0xd4b2('0x3')]||'';this[_0xd4b2('0x4')]=_0x44819f[_0xd4b2('0x4')]||'';this[_0xd4b2('0x5')]=_0x44819f[_0xd4b2('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 9fa091f..3774750 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 _0x2903=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x37b680,_0x5582a0){var _0xe435f5=function(_0x551794){while(--_0x551794){_0x37b680['push'](_0x37b680['shift']());}};_0xe435f5(++_0x5582a0);}(_0x2903,0x119));var _0x3290=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x2903[_0x5c2e3e];return _0x53f64a;};'use strict';function SugarcrmAccount(_0x3e25b0){this['id']=_0x3e25b0['id']||0x0;this[_0x3290('0x0')]=_0x3e25b0[_0x3290('0x0')]||'';this[_0x3290('0x1')]=_0x3e25b0[_0x3290('0x1')]||'';this['password']=_0x3e25b0[_0x3290('0x2')]||'';this[_0x3290('0x3')]=_0x3e25b0[_0x3290('0x3')]||'';this[_0x3290('0x4')]=_0x3e25b0[_0x3290('0x4')]||'';this[_0x3290('0x5')]=_0x3e25b0['Configurations']||{};}module[_0x3290('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0xc2b0=['Configurations','username','password','remoteUri','serverUrl'];(function(_0x4268d1,_0x5e1221){var _0x452963=function(_0x76b76f){while(--_0x76b76f){_0x4268d1['push'](_0x4268d1['shift']());}};_0x452963(++_0x5e1221);}(_0xc2b0,0x13c));var _0x0c2b=function(_0x261b08,_0x563d91){_0x261b08=_0x261b08-0x0;var _0xeeaf84=_0xc2b0[_0x261b08];return _0xeeaf84;};'use strict';function SugarcrmAccount(_0x2c57e2){this['id']=_0x2c57e2['id']||0x0;this['name']=_0x2c57e2['name']||'';this[_0x0c2b('0x0')]=_0x2c57e2[_0x0c2b('0x0')]||'';this['password']=_0x2c57e2[_0x0c2b('0x1')]||'';this[_0x0c2b('0x2')]=_0x2c57e2[_0x0c2b('0x2')]||'';this[_0x0c2b('0x3')]=_0x2c57e2[_0x0c2b('0x3')]||'';this['Configurations']=_0x2c57e2[_0x0c2b('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 3417774..c0b5a88 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 _0x0490=['status','address','exports','name','unknown','stateTime'];(function(_0x5df5a5,_0x533c87){var _0x543a84=function(_0x167d59){while(--_0x167d59){_0x5df5a5['push'](_0x5df5a5['shift']());}};_0x543a84(++_0x533c87);}(_0x0490,0x147));var _0x0049=function(_0x301198,_0x5ba544){_0x301198=_0x301198-0x0;var _0x5874e3=_0x0490[_0x301198];return _0x5874e3;};'use strict';function Telephone(_0x4eb74c){this['id']=_0x4eb74c['id']||0x0;this[_0x0049('0x0')]=_0x4eb74c['name']||'';this['accountcode']=_0x4eb74c['accountcode']||'';this['state']=_0x0049('0x1');this[_0x0049('0x2')]=0x0;this[_0x0049('0x3')]=_0x0049('0x1');this[_0x0049('0x4')]='';}module[_0x0049('0x5')]=Telephone; \ No newline at end of file +var _0x6827=['address','exports','name','accountcode','unknown','stateTime'];(function(_0xf5ed1b,_0x33a489){var _0x5ecbdb=function(_0x152c8e){while(--_0x152c8e){_0xf5ed1b['push'](_0xf5ed1b['shift']());}};_0x5ecbdb(++_0x33a489);}(_0x6827,0xda));var _0x7682=function(_0xbacb69,_0x447ae3){_0xbacb69=_0xbacb69-0x0;var _0x2876a8=_0x6827[_0xbacb69];return _0x2876a8;};'use strict';function Telephone(_0x400276){this['id']=_0x400276['id']||0x0;this[_0x7682('0x0')]=_0x400276[_0x7682('0x0')]||'';this[_0x7682('0x1')]=_0x400276[_0x7682('0x1')]||'';this['state']=_0x7682('0x2');this[_0x7682('0x3')]=0x0;this['status']=_0x7682('0x2');this[_0x7682('0x4')]='';}module[_0x7682('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 1d6df17..5afd1b6 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(_0x114d30,_0x2796e1){var _0x270679=function(_0x45a20a){while(--_0x45a20a){_0x114d30['push'](_0x114d30['shift']());}};_0x270679(++_0x2796e1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xb10b=['name','html'];(function(_0x1a55be,_0x7839d9){var _0xcf466b=function(_0x36cc4b){while(--_0x36cc4b){_0x1a55be['push'](_0x1a55be['shift']());}};_0xcf466b(++_0x7839d9);}(_0xb10b,0x12a));var _0xbb10=function(_0x3d86f4,_0x2a9220){_0x3d86f4=_0x3d86f4-0x0;var _0x5d8e87=_0xb10b[_0x3d86f4];return _0x5d8e87;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 71c8b0e..e4a27f1 100644 --- a/server/services/ami/model/trigger.js +++ b/server/services/ami/model/trigger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8603=['exports','name','channel','status','AllConditions','AnyConditions','Actions'];(function(_0x2574f4,_0x11d4b8){var _0x3c7b21=function(_0x3f0e22){while(--_0x3f0e22){_0x2574f4['push'](_0x2574f4['shift']());}};_0x3c7b21(++_0x11d4b8);}(_0x8603,0x190));var _0x3860=function(_0x65eae,_0x32dc5f){_0x65eae=_0x65eae-0x0;var _0x18e82b=_0x8603[_0x65eae];return _0x18e82b;};'use strict';function Trigger(_0xba4b79){this['id']=_0xba4b79['id']||0x0;this[_0x3860('0x0')]=_0xba4b79[_0x3860('0x0')]||'';this[_0x3860('0x1')]=_0xba4b79['channel']||'voice';this[_0x3860('0x2')]=_0xba4b79[_0x3860('0x2')]||![];this[_0x3860('0x3')]=_0xba4b79['AllConditions']||[];this[_0x3860('0x4')]=_0xba4b79['AnyConditions']||[];this[_0x3860('0x5')]=_0xba4b79[_0x3860('0x5')]||[];}module[_0x3860('0x6')]=Trigger; \ No newline at end of file +var _0x4fc2=['name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x594f77,_0x15659a){var _0x2c62cc=function(_0x4eb060){while(--_0x4eb060){_0x594f77['push'](_0x594f77['shift']());}};_0x2c62cc(++_0x15659a);}(_0x4fc2,0x111));var _0x24fc=function(_0x380d90,_0x4f711d){_0x380d90=_0x380d90-0x0;var _0x1ff262=_0x4fc2[_0x380d90];return _0x1ff262;};'use strict';function Trigger(_0x5ea3ab){this['id']=_0x5ea3ab['id']||0x0;this[_0x24fc('0x0')]=_0x5ea3ab[_0x24fc('0x0')]||'';this[_0x24fc('0x1')]=_0x5ea3ab['channel']||_0x24fc('0x2');this[_0x24fc('0x3')]=_0x5ea3ab[_0x24fc('0x3')]||![];this['AllConditions']=_0x5ea3ab[_0x24fc('0x4')]||[];this[_0x24fc('0x5')]=_0x5ea3ab['AnyConditions']||[];this[_0x24fc('0x6')]=_0x5ea3ab[_0x24fc('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index de0faf5..7d45694 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 _0xa187=['host','domain','refresh','stateRegistry','registrationtime','address','defaultuser','name','state','unknown','stateTime','status','registry','indexOf','split'];(function(_0x4d22f4,_0x1b5bd6){var _0x4047be=function(_0x3501a1){while(--_0x3501a1){_0x4d22f4['push'](_0x4d22f4['shift']());}};_0x4047be(++_0x1b5bd6);}(_0xa187,0x9d));var _0x7a18=function(_0x5db4b0,_0x17dfb5){_0x5db4b0=_0x5db4b0-0x0;var _0x126c9f=_0xa187[_0x5db4b0];return _0x126c9f;};'use strict';function Trunk(_0x393f0d){this['id']=_0x393f0d['id']||0x0;this['active']=_0x393f0d['active']||![];this[_0x7a18('0x0')]=_0x393f0d[_0x7a18('0x0')]||'';this[_0x7a18('0x1')]=_0x7a18('0x2');this[_0x7a18('0x3')]=0x0;this[_0x7a18('0x4')]=_0x7a18('0x2');this[_0x7a18('0x5')]=_0x393f0d[_0x7a18('0x5')]&&_0x393f0d['registry'][_0x7a18('0x6')](':')?_0x393f0d[_0x7a18('0x5')][_0x7a18('0x7')](':')[0x0]:'';this[_0x7a18('0x8')]='';this['port']='';this[_0x7a18('0x9')]='';this['domainport']='';this[_0x7a18('0xa')]='';this[_0x7a18('0xb')]=_0x7a18('0x2');this[_0x7a18('0xc')]='';this[_0x7a18('0xd')]='';this[_0x7a18('0xe')]=_0x393f0d[_0x7a18('0xe')]||'';}module['exports']=Trunk; \ No newline at end of file +var _0x08cd=['exports','active','name','unknown','status','registry','indexOf','split','host','port','domain','domainport','stateRegistry','registrationtime','address','defaultuser'];(function(_0x1b4722,_0x2e6118){var _0x48fa16=function(_0x447a61){while(--_0x447a61){_0x1b4722['push'](_0x1b4722['shift']());}};_0x48fa16(++_0x2e6118);}(_0x08cd,0x81));var _0xd08c=function(_0xbb5c78,_0x52a47a){_0xbb5c78=_0xbb5c78-0x0;var _0x3cb12d=_0x08cd[_0xbb5c78];return _0x3cb12d;};'use strict';function Trunk(_0x737cab){this['id']=_0x737cab['id']||0x0;this[_0xd08c('0x0')]=_0x737cab['active']||![];this[_0xd08c('0x1')]=_0x737cab['name']||'';this['state']=_0xd08c('0x2');this['stateTime']=0x0;this[_0xd08c('0x3')]='unknown';this['registry']=_0x737cab[_0xd08c('0x4')]&&_0x737cab[_0xd08c('0x4')][_0xd08c('0x5')](':')?_0x737cab['registry'][_0xd08c('0x6')](':')[0x0]:'';this[_0xd08c('0x7')]='';this[_0xd08c('0x8')]='';this[_0xd08c('0x9')]='';this[_0xd08c('0xa')]='';this['refresh']='';this[_0xd08c('0xb')]='unknown';this[_0xd08c('0xc')]='';this[_0xd08c('0xd')]='';this[_0xd08c('0xe')]=_0x737cab[_0xd08c('0xe')]||'';}module[_0xd08c('0xf')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index b819ae1..57c803a 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 _0xc53b=['none','mandatoryDisposition','exten','recordingFormat'];(function(_0x1f7a83,_0x409f6a){var _0x29e1be=function(_0x427609){while(--_0x427609){_0x1f7a83['push'](_0x1f7a83['shift']());}};_0x29e1be(++_0x409f6a);}(_0xc53b,0x18e));var _0xbc53=function(_0x5b7f4b,_0x57686c){_0x5b7f4b=_0x5b7f4b-0x0;var _0x514b5e=_0xc53b[_0x5b7f4b];return _0x514b5e;};'use strict';function voiceExtension(_0x4cb11f){this['id']=_0x4cb11f['id']||0x0;this[_0xbc53('0x0')]=_0x4cb11f[_0xbc53('0x0')]||'';this[_0xbc53('0x1')]=_0x4cb11f[_0xbc53('0x1')]||_0xbc53('0x2');this[_0xbc53('0x3')]=_0x4cb11f[_0xbc53('0x3')]||![];}module['exports']=voiceExtension; \ No newline at end of file +var _0x0df8=['mandatoryDisposition','exports','exten'];(function(_0x16c87e,_0x5eed1a){var _0xdfafec=function(_0x5302b7){while(--_0x5302b7){_0x16c87e['push'](_0x16c87e['shift']());}};_0xdfafec(++_0x5eed1a);}(_0x0df8,0x1df));var _0x80df=function(_0x42ed93,_0x448249){_0x42ed93=_0x42ed93-0x0;var _0x12c2b9=_0x0df8[_0x42ed93];return _0x12c2b9;};'use strict';function voiceExtension(_0x26205a){this['id']=_0x26205a['id']||0x0;this['exten']=_0x26205a[_0x80df('0x0')]||'';this['recordingFormat']=_0x26205a['recordingFormat']||'none';this[_0x80df('0x1')]=_0x26205a[_0x80df('0x1')]||![];}module[_0x80df('0x2')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 9cbc8ca..9b5f5d1 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 _0xe3ef=['inbound','waiting','talking','total','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCallToSecond','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','mandatoryDisposition','mandatoryDispositionPause','exports','not_inuse','inuse','busy','invalid','unavailable','ringing','wav','wav49','gsm','rrmemory','name','monitor_format','type'];(function(_0xf9bd09,_0x29fed7){var _0x61d5de=function(_0x49f45e){while(--_0x49f45e){_0xf9bd09['push'](_0xf9bd09['shift']());}};_0x61d5de(++_0x29fed7);}(_0xe3ef,0x1bb));var _0xfe3e=function(_0x2ab5d5,_0x40fb8c){_0x2ab5d5=_0x2ab5d5-0x0;var _0x4a5448=_0xe3ef[_0x2ab5d5];return _0x4a5448;};'use strict';var statusDesc=['unknown',_0xfe3e('0x0'),_0xfe3e('0x1'),_0xfe3e('0x2'),_0xfe3e('0x3'),_0xfe3e('0x4'),_0xfe3e('0x5'),'ringinuse','onhold'];var monitorFormat={'wav':_0xfe3e('0x6'),'wav49':_0xfe3e('0x7'),'gsm':_0xfe3e('0x8')};var strategy={'rrmemory':_0xfe3e('0x9'),'roundrobin':'roundrobin'};function VoiceQueue(_0x3d31a3){this['id']=_0x3d31a3['id']||0x0;this[_0xfe3e('0xa')]=_0x3d31a3[_0xfe3e('0xa')]||'';this['monitor_format']=_0x3d31a3[_0xfe3e('0xb')]||'';this['type']=_0x3d31a3[_0xfe3e('0xc')]||_0xfe3e('0xd');this[_0xfe3e('0xe')]=0x0;this[_0xfe3e('0xf')]=0x0;this[_0xfe3e('0x10')]=0x0;this['answered']=0x0;this[_0xfe3e('0x11')]=0x0;this[_0xfe3e('0x12')]=0x0;this[_0xfe3e('0x13')]=0x0;this[_0xfe3e('0x14')]=0x0;this[_0xfe3e('0x15')]=0x0;this[_0xfe3e('0x16')]=0x0;this[_0xfe3e('0x17')]=0x0;this[_0xfe3e('0x18')]=_0x3d31a3[_0xfe3e('0x18')]||![];this[_0xfe3e('0x19')]=_0x3d31a3[_0xfe3e('0x19')]||0xa;this[_0xfe3e('0x1a')]=_0x3d31a3['autopause']||'no';this[_0xfe3e('0x1b')]=!![];this['message']='';this[_0xfe3e('0x1c')]=0x0;this['temp']=0x0;this['dialTimezone']=_0x3d31a3[_0xfe3e('0x1d')]||null;this[_0xfe3e('0x1e')]=_0x3d31a3[_0xfe3e('0x1e')]?_0x3d31a3['dialGlobalInterval']:null;this[_0xfe3e('0x1f')]=_0x3d31a3[_0xfe3e('0x1f')];this[_0xfe3e('0x20')]=_0x3d31a3[_0xfe3e('0x20')]||_0xfe3e('0x21');this[_0xfe3e('0x22')]=_0x3d31a3[_0xfe3e('0x22')]||0x0;this[_0xfe3e('0x23')]=_0x3d31a3[_0xfe3e('0x23')]||0x0;this[_0xfe3e('0x24')]=_0x3d31a3[_0xfe3e('0x24')]||0x1;this['dialPredictiveOptimization']=_0x3d31a3[_0xfe3e('0x25')]||_0xfe3e('0x26');this[_0xfe3e('0x27')]=_0x3d31a3[_0xfe3e('0x27')]||0.03;this['dialPredictiveInterval']=_0x3d31a3['dialPredictiveInterval']||0x258;this[_0xfe3e('0x28')]=_0x3d31a3[_0xfe3e('0x28')]||'anonymous';this[_0xfe3e('0x29')]=_0x3d31a3[_0xfe3e('0x29')]||_0xfe3e('0x2a');this[_0xfe3e('0x2b')]=_0x3d31a3['dialOriginateTimeout']||0x1e;this[_0xfe3e('0x2c')]=_0x3d31a3[_0xfe3e('0x2c')]||_0xfe3e('0x2d');this[_0xfe3e('0x2e')]=_0x3d31a3[_0xfe3e('0x2e')]||0x3;this[_0xfe3e('0x2f')]=_0x3d31a3[_0xfe3e('0x2f')]||undefined;this[_0xfe3e('0x30')]=_0x3d31a3[_0xfe3e('0x30')]||0x3;this[_0xfe3e('0x31')]=_0x3d31a3[_0xfe3e('0x31')]||0x96;this[_0xfe3e('0x32')]=_0x3d31a3[_0xfe3e('0x32')]||0x3;this['dialBusyRetryFrequency']=_0x3d31a3[_0xfe3e('0x33')]||0x96;this[_0xfe3e('0x34')]=_0x3d31a3[_0xfe3e('0x34')]||0x3;this[_0xfe3e('0x35')]=_0x3d31a3['dialNoAnswerRetryFrequency']||0x96;this[_0xfe3e('0x36')]=_0x3d31a3[_0xfe3e('0x36')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x3d31a3['dialNoSuchNumberRetryFrequency']||0x96;this[_0xfe3e('0x37')]=_0x3d31a3[_0xfe3e('0x37')]||0x3;this[_0xfe3e('0x38')]=_0x3d31a3[_0xfe3e('0x38')]||0x96;this[_0xfe3e('0x39')]=_0x3d31a3[_0xfe3e('0x39')]||0x3;this[_0xfe3e('0x3a')]=_0x3d31a3[_0xfe3e('0x3a')]||0x96;this['dialMachineMaxRetry']=_0x3d31a3[_0xfe3e('0x3b')]||0x3;this[_0xfe3e('0x3c')]=_0x3d31a3[_0xfe3e('0x3c')]||0x96;this[_0xfe3e('0x3d')]=_0x3d31a3['dialAgentRejectMaxRetry']||0x3;this[_0xfe3e('0x3e')]=_0x3d31a3[_0xfe3e('0x3e')]||0x96;this[_0xfe3e('0x3f')]=_0x3d31a3['dialGlobalMaxRetry']||0x4;this['Trunk']=_0x3d31a3[_0xfe3e('0x40')]?_0x3d31a3[_0xfe3e('0x40')]:undefined;this['TrunkBackup']=_0x3d31a3[_0xfe3e('0x41')]?_0x3d31a3[_0xfe3e('0x41')]:undefined;this[_0xfe3e('0x42')]=_0x3d31a3[_0xfe3e('0x42')]||undefined;this[_0xfe3e('0x43')]=_0x3d31a3[_0xfe3e('0x43')]?_0x3d31a3['Interval']:undefined;this[_0xfe3e('0x44')]=_0x3d31a3['dialOrderByScheduledAt']||'DESC';this[_0xfe3e('0x45')]=_0x3d31a3[_0xfe3e('0x45')]||undefined;this['dialCutDigit']=_0x3d31a3['dialCutDigit']||undefined;this['strategy']=strategy[_0x3d31a3[_0xfe3e('0x46')]]||'rrmemory';this[_0xfe3e('0x47')]=!![];this[_0xfe3e('0x48')]=_0x3d31a3['dialAMDActive']||![];this[_0xfe3e('0x49')]=_0x3d31a3[_0xfe3e('0x49')];this['dialAMDGreeting']=_0x3d31a3['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x3d31a3[_0xfe3e('0x4a')];this['dialAMDTotalAnalysisTime']=_0x3d31a3[_0xfe3e('0x4b')];this[_0xfe3e('0x4c')]=_0x3d31a3[_0xfe3e('0x4c')];this['dialAMDBetweenWordsSilence']=_0x3d31a3[_0xfe3e('0x4d')];this[_0xfe3e('0x4e')]=_0x3d31a3[_0xfe3e('0x4e')];this[_0xfe3e('0x4f')]=_0x3d31a3[_0xfe3e('0x4f')];this[_0xfe3e('0x50')]=_0x3d31a3[_0xfe3e('0x50')];this[_0xfe3e('0x51')]=0x0;this['pTalking']=0x0;this[_0xfe3e('0x52')]=_0x3d31a3['timeout'];this[_0xfe3e('0x53')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0xfe3e('0x54')]=0x0;this[_0xfe3e('0x55')]=0x0;this[_0xfe3e('0x56')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0xfe3e('0x57')]=0x0;this[_0xfe3e('0x58')]=0x0;this[_0xfe3e('0x59')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0xfe3e('0x5a')]=0x0;this[_0xfe3e('0x5b')]=0x0;this['outboundReCallsDay']=0x0;this[_0xfe3e('0x5c')]=0x0;this[_0xfe3e('0x5d')]=undefined;this[_0xfe3e('0x5e')]=undefined;this['handlePredictive']=undefined;this[_0xfe3e('0x5f')]=1.05;this[_0xfe3e('0x60')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0xfe3e('0x61')]=0x0;this[_0xfe3e('0x62')]=0x0;this[_0xfe3e('0x63')]=0x0;this[_0xfe3e('0x64')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0xfe3e('0x65')]=0x0;this['predictiveIntervalMaxThreshold']=_0x3d31a3[_0xfe3e('0x66')]||0x14;this[_0xfe3e('0x67')]=_0x3d31a3[_0xfe3e('0x66')]||0xa;this[_0xfe3e('0x68')]=0x0;this[_0xfe3e('0x69')]=0x0;this['predictiveIntervalHitRate']=0x1;this['erlangCalls']=0x0;this[_0xfe3e('0x6a')]=0x0;this['erlangAbandonmentRate']=0x0;this['erlangBusyFactor']=0x0;this[_0xfe3e('0x6b')]=_0x3d31a3[_0xfe3e('0x6b')]||0x1e;this[_0xfe3e('0x6c')]=_0x3d31a3['dialRecallInQueue']||![];this[_0xfe3e('0x6d')]=_0x3d31a3['dialQueueProject2']||undefined;this[_0xfe3e('0x6e')]=_0x3d31a3['dialAgiAfterHangupClient']||![];this['dialAgiAfterHangupAgent']=_0x3d31a3['dialAgiAfterHangupAgent']||![];this[_0xfe3e('0xb')]=monitorFormat[_0x3d31a3[_0xfe3e('0xb')]]?monitorFormat[_0x3d31a3[_0xfe3e('0xb')]]:undefined;this[_0xfe3e('0x6f')]=_0x3d31a3[_0xfe3e('0x6f')]||![];this['mandatoryDispositionPause']=_0x3d31a3[_0xfe3e('0x70')]?_0x3d31a3[_0xfe3e('0x70')]:undefined;}module[_0xfe3e('0x71')]=VoiceQueue; \ No newline at end of file +var _0x150a=['dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundAbandonedDay','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','invalid','unavailable','ringing','ringinuse','wav','wav49','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','answered','sumDuration','sumBillable','abandoned','loggedIn','available','acw','acwTimeout','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialMethod','progressive','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency'];(function(_0x4e6175,_0x5c608f){var _0x1143e8=function(_0x31e59d){while(--_0x31e59d){_0x4e6175['push'](_0x4e6175['shift']());}};_0x1143e8(++_0x5c608f);}(_0x150a,0x1a7));var _0xa150=function(_0x5e84ee,_0x9645a6){_0x5e84ee=_0x5e84ee-0x0;var _0xa2b329=_0x150a[_0x5e84ee];return _0xa2b329;};'use strict';var statusDesc=[_0xa150('0x0'),_0xa150('0x1'),_0xa150('0x2'),'busy',_0xa150('0x3'),_0xa150('0x4'),_0xa150('0x5'),_0xa150('0x6'),'onhold'];var monitorFormat={'wav':_0xa150('0x7'),'wav49':_0xa150('0x8'),'gsm':'gsm'};var strategy={'rrmemory':'rrmemory','roundrobin':_0xa150('0x9')};function VoiceQueue(_0x263d27){this['id']=_0x263d27['id']||0x0;this[_0xa150('0xa')]=_0x263d27[_0xa150('0xa')]||'';this[_0xa150('0xb')]=_0x263d27['monitor_format']||'';this[_0xa150('0xc')]=_0x263d27[_0xa150('0xc')]||_0xa150('0xd');this[_0xa150('0xe')]=0x0;this[_0xa150('0xf')]=0x0;this[_0xa150('0x10')]=0x0;this[_0xa150('0x11')]=0x0;this[_0xa150('0x12')]=0x0;this['sumHoldTime']=0x0;this[_0xa150('0x13')]=0x0;this['unmanaged']=0x0;this[_0xa150('0x14')]=0x0;this[_0xa150('0x15')]=0x0;this[_0xa150('0x16')]=0x0;this[_0xa150('0x17')]=_0x263d27[_0xa150('0x17')]||![];this['acwTimeout']=_0x263d27[_0xa150('0x18')]||0xa;this['autopause']=_0x263d27['autopause']||'no';this[_0xa150('0x19')]=!![];this[_0xa150('0x1a')]='';this[_0xa150('0x1b')]=0x0;this[_0xa150('0x1c')]=0x0;this[_0xa150('0x1d')]=_0x263d27[_0xa150('0x1d')]||null;this[_0xa150('0x1e')]=_0x263d27['dialGlobalInterval']?_0x263d27['dialGlobalInterval']:null;this['dialActive']=_0x263d27['dialActive'];this[_0xa150('0x1f')]=_0x263d27[_0xa150('0x1f')]||_0xa150('0x20');this['dialLimitChannel']=_0x263d27[_0xa150('0x21')]||0x0;this['dialLimitQueue']=_0x263d27['dialLimitQueue']||0x0;this[_0xa150('0x22')]=_0x263d27['dialPowerLevel']||0x1;this['dialPredictiveOptimization']=_0x263d27[_0xa150('0x23')]||'dropRate';this['dialPredictiveOptimizationPercentage']=_0x263d27['dialPredictiveOptimizationPercentage']||0.03;this[_0xa150('0x24')]=_0x263d27[_0xa150('0x24')]||0x258;this[_0xa150('0x25')]=_0x263d27[_0xa150('0x25')]||_0xa150('0x26');this[_0xa150('0x27')]=_0x263d27['dialOriginateCallerIdNumber']||_0xa150('0x26');this['dialOriginateTimeout']=_0x263d27[_0xa150('0x28')]||0x1e;this['dialQueueOptions']=_0x263d27[_0xa150('0x29')]||_0xa150('0x2a');this[_0xa150('0x2b')]=_0x263d27['dialQueueTimeout']||0x3;this[_0xa150('0x2c')]=_0x263d27[_0xa150('0x2c')]||undefined;this[_0xa150('0x2d')]=_0x263d27['dialCongestionMaxRetry']||0x3;this[_0xa150('0x2e')]=_0x263d27['dialCongestionRetryFrequency']||0x96;this[_0xa150('0x2f')]=_0x263d27[_0xa150('0x2f')]||0x3;this[_0xa150('0x30')]=_0x263d27[_0xa150('0x30')]||0x96;this['dialNoAnswerMaxRetry']=_0x263d27[_0xa150('0x31')]||0x3;this[_0xa150('0x32')]=_0x263d27['dialNoAnswerRetryFrequency']||0x96;this[_0xa150('0x33')]=_0x263d27['dialNoSuchNumberMaxRetry']||0x3;this[_0xa150('0x34')]=_0x263d27['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0x263d27[_0xa150('0x35')]||0x3;this[_0xa150('0x36')]=_0x263d27['dialDropRetryFrequency']||0x96;this['dialAbandonedMaxRetry']=_0x263d27[_0xa150('0x37')]||0x3;this[_0xa150('0x38')]=_0x263d27[_0xa150('0x38')]||0x96;this['dialMachineMaxRetry']=_0x263d27['dialMachineMaxRetry']||0x3;this[_0xa150('0x39')]=_0x263d27['dialMachineRetryFrequency']||0x96;this[_0xa150('0x3a')]=_0x263d27[_0xa150('0x3a')]||0x3;this['dialAgentRejectRetryFrequency']=_0x263d27[_0xa150('0x3b')]||0x96;this[_0xa150('0x3c')]=_0x263d27[_0xa150('0x3c')]||0x4;this[_0xa150('0x3d')]=_0x263d27[_0xa150('0x3d')]?_0x263d27[_0xa150('0x3d')]:undefined;this[_0xa150('0x3e')]=_0x263d27[_0xa150('0x3e')]?_0x263d27[_0xa150('0x3e')]:undefined;this[_0xa150('0x3f')]=_0x263d27['dialPrefix']||undefined;this[_0xa150('0x40')]=_0x263d27['Interval']?_0x263d27[_0xa150('0x40')]:undefined;this[_0xa150('0x41')]=_0x263d27['dialOrderByScheduledAt']||_0xa150('0x42');this['dialRandomLastDigitCallerIdNumber']=_0x263d27['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xa150('0x43')]=_0x263d27[_0xa150('0x43')]||undefined;this[_0xa150('0x44')]=strategy[_0x263d27[_0xa150('0x44')]]||'rrmemory';this[_0xa150('0x45')]=!![];this[_0xa150('0x46')]=_0x263d27[_0xa150('0x46')]||![];this[_0xa150('0x47')]=_0x263d27[_0xa150('0x47')];this[_0xa150('0x48')]=_0x263d27[_0xa150('0x48')];this[_0xa150('0x49')]=_0x263d27[_0xa150('0x49')];this[_0xa150('0x4a')]=_0x263d27[_0xa150('0x4a')];this[_0xa150('0x4b')]=_0x263d27[_0xa150('0x4b')];this['dialAMDBetweenWordsSilence']=_0x263d27[_0xa150('0x4c')];this[_0xa150('0x4d')]=_0x263d27[_0xa150('0x4d')];this[_0xa150('0x4e')]=_0x263d27[_0xa150('0x4e')];this[_0xa150('0x4f')]=_0x263d27[_0xa150('0x4f')];this['outboundRejectCallsDay']=0x0;this['pTalking']=0x0;this['timeout']=_0x263d27[_0xa150('0x50')];this[_0xa150('0x51')]=0x0;this[_0xa150('0x52')]=0x0;this[_0xa150('0x53')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0xa150('0x54')]=0x0;this[_0xa150('0x55')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0xa150('0x56')]=0x0;this[_0xa150('0x57')]=0x0;this[_0xa150('0x58')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0xa150('0x59')]=0x0;this['outboundReCallsDay']=0x0;this[_0xa150('0x5a')]=0x0;this['startProgressive']=undefined;this[_0xa150('0x5b')]=undefined;this[_0xa150('0x5c')]=undefined;this[_0xa150('0x5d')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0xa150('0x5e')]=0x0;this[_0xa150('0x5f')]=0x0;this[_0xa150('0x60')]=0x0;this[_0xa150('0x61')]=0x0;this[_0xa150('0x62')]=0x0;this[_0xa150('0x63')]=0x0;this[_0xa150('0x64')]=0x0;this[_0xa150('0x65')]=_0x263d27['dialPredictiveIntervalMaxThreshold']||0x14;this[_0xa150('0x66')]=_0x263d27[_0xa150('0x67')]||0xa;this[_0xa150('0x68')]=0x0;this[_0xa150('0x69')]=0x0;this[_0xa150('0x6a')]=0x1;this[_0xa150('0x6b')]=0x0;this[_0xa150('0x6c')]=0x0;this[_0xa150('0x6d')]=0x0;this[_0xa150('0x6e')]=0x0;this[_0xa150('0x6f')]=_0x263d27['dialRecallMeTimeout']||0x1e;this[_0xa150('0x70')]=_0x263d27['dialRecallInQueue']||![];this[_0xa150('0x71')]=_0x263d27[_0xa150('0x71')]||undefined;this['dialAgiAfterHangupClient']=_0x263d27[_0xa150('0x72')]||![];this[_0xa150('0x73')]=_0x263d27[_0xa150('0x73')]||![];this[_0xa150('0xb')]=monitorFormat[_0x263d27[_0xa150('0xb')]]?monitorFormat[_0x263d27[_0xa150('0xb')]]:undefined;this[_0xa150('0x74')]=_0x263d27['mandatoryDisposition']||![];this['mandatoryDispositionPause']=_0x263d27[_0xa150('0x75')]?_0x263d27[_0xa150('0x75')]:undefined;}module[_0xa150('0x76')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index b0c81dc..4612e14 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 _0x827d=['exports','name','username','accessKey','remoteUri','serverUrl'];(function(_0x47274f,_0x50ed9b){var _0x563b17=function(_0x5e22c4){while(--_0x5e22c4){_0x47274f['push'](_0x47274f['shift']());}};_0x563b17(++_0x50ed9b);}(_0x827d,0x157));var _0xd827=function(_0x5fe321,_0x30c019){_0x5fe321=_0x5fe321-0x0;var _0x30534e=_0x827d[_0x5fe321];return _0x30534e;};'use strict';function VtigerAccount(_0x2672bb){this['id']=_0x2672bb['id']||0x0;this[_0xd827('0x0')]=_0x2672bb[_0xd827('0x0')]||'';this[_0xd827('0x1')]=_0x2672bb[_0xd827('0x1')]||'';this[_0xd827('0x2')]=_0x2672bb[_0xd827('0x2')]||'';this[_0xd827('0x3')]=_0x2672bb[_0xd827('0x3')]||'';this[_0xd827('0x4')]=_0x2672bb[_0xd827('0x4')]||'';this['Configurations']=_0x2672bb['Configurations']||{};}module[_0xd827('0x5')]=VtigerAccount; \ No newline at end of file +var _0xa123=['Configurations','exports','name','username','accessKey','remoteUri','serverUrl'];(function(_0x40bb62,_0x3fbe9e){var _0x3a3a54=function(_0x435d00){while(--_0x435d00){_0x40bb62['push'](_0x40bb62['shift']());}};_0x3a3a54(++_0x3fbe9e);}(_0xa123,0x1c2));var _0x3a12=function(_0x52404d,_0x4836fa){_0x52404d=_0x52404d-0x0;var _0x5c4a1b=_0xa123[_0x52404d];return _0x5c4a1b;};'use strict';function VtigerAccount(_0x2d5094){this['id']=_0x2d5094['id']||0x0;this[_0x3a12('0x0')]=_0x2d5094['name']||'';this[_0x3a12('0x1')]=_0x2d5094[_0x3a12('0x1')]||'';this['accessKey']=_0x2d5094[_0x3a12('0x2')]||'';this[_0x3a12('0x3')]=_0x2d5094[_0x3a12('0x3')]||'';this['serverUrl']=_0x2d5094[_0x3a12('0x4')]||'';this[_0x3a12('0x5')]=_0x2d5094['Configurations']||{};}module[_0x3a12('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index f832161..9d38cdd 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 _0xbdb8=['password','token','remoteUri','authType','type','integrationTab','serverUrl','exports','name'];(function(_0x24502f,_0x134350){var _0x402fd9=function(_0x5e90b2){while(--_0x5e90b2){_0x24502f['push'](_0x24502f['shift']());}};_0x402fd9(++_0x134350);}(_0xbdb8,0x1ee));var _0x8bdb=function(_0x1e7060,_0x453e1a){_0x1e7060=_0x1e7060-0x0;var _0x4233cf=_0xbdb8[_0x1e7060];return _0x4233cf;};'use strict';function ZendeskAccount(_0x5a0cb0){this['id']=_0x5a0cb0['id']||0x0;this[_0x8bdb('0x0')]=_0x5a0cb0[_0x8bdb('0x0')]||'';this['username']=_0x5a0cb0['username']||'';this[_0x8bdb('0x1')]=_0x5a0cb0['password']||'';this[_0x8bdb('0x2')]=_0x5a0cb0['token']||'';this['remoteUri']=_0x5a0cb0[_0x8bdb('0x3')]||'';this[_0x8bdb('0x4')]=_0x5a0cb0[_0x8bdb('0x4')]||'';this[_0x8bdb('0x5')]=_0x5a0cb0[_0x8bdb('0x5')]||_0x8bdb('0x6');this[_0x8bdb('0x7')]=_0x5a0cb0[_0x8bdb('0x7')]||'';this['Configurations']=_0x5a0cb0['Configurations']||{};}module[_0x8bdb('0x8')]=ZendeskAccount; \ No newline at end of file +var _0xbb71=['remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','username','password'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbb71,0xcd));var _0x1bb7=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xbb71[_0x2064e5];return _0x21a233;};'use strict';function ZendeskAccount(_0x20dbc9){this['id']=_0x20dbc9['id']||0x0;this['name']=_0x20dbc9['name']||'';this['username']=_0x20dbc9[_0x1bb7('0x0')]||'';this[_0x1bb7('0x1')]=_0x20dbc9[_0x1bb7('0x1')]||'';this['token']=_0x20dbc9['token']||'';this[_0x1bb7('0x2')]=_0x20dbc9[_0x1bb7('0x2')]||'';this[_0x1bb7('0x3')]=_0x20dbc9[_0x1bb7('0x3')]||'';this['type']=_0x20dbc9[_0x1bb7('0x4')]||_0x1bb7('0x5');this[_0x1bb7('0x6')]=_0x20dbc9['serverUrl']||'';this[_0x1bb7('0x7')]=_0x20dbc9[_0x1bb7('0x7')]||{};}module[_0x1bb7('0x8')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 61e9d93..fa06b9d 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 _0x8df8=['clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone'];(function(_0x2c4cad,_0xd287c){var _0x4deada=function(_0x374bbf){while(--_0x374bbf){_0x2c4cad['push'](_0x2c4cad['shift']());}};_0x4deada(++_0xd287c);}(_0x8df8,0x19e));var _0x88df=function(_0x4f75dc,_0x463ad4){_0x4f75dc=_0x4f75dc-0x0;var _0x3f297c=_0x8df8[_0x4f75dc];return _0x3f297c;};'use strict';function ZohoAccount(_0x3412cc){this['id']=_0x3412cc['id']||0x0;this[_0x88df('0x0')]=_0x3412cc['name']||'';this[_0x88df('0x1')]=_0x3412cc['description']||'';this[_0x88df('0x2')]=_0x3412cc[_0x88df('0x2')]||'';this['zone']=_0x3412cc[_0x88df('0x3')]||'';this[_0x88df('0x4')]=_0x3412cc['clientId']||'';this[_0x88df('0x5')]=_0x3412cc[_0x88df('0x5')]||'';this[_0x88df('0x6')]=_0x3412cc[_0x88df('0x6')]||'';this['code']=_0x3412cc[_0x88df('0x7')]||'';this['refreshToken']=_0x3412cc[_0x88df('0x8')]||'';this[_0x88df('0x9')]=_0x3412cc['Configurations']||{};}module[_0x88df('0xa')]=ZohoAccount; \ No newline at end of file +var _0xbcd9=['serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret'];(function(_0x7f7579,_0x44ef50){var _0x5a0902=function(_0x31d144){while(--_0x31d144){_0x7f7579['push'](_0x7f7579['shift']());}};_0x5a0902(++_0x44ef50);}(_0xbcd9,0x102));var _0x9bcd=function(_0x4cf6b7,_0x429f3f){_0x4cf6b7=_0x4cf6b7-0x0;var _0x17e62f=_0xbcd9[_0x4cf6b7];return _0x17e62f;};'use strict';function ZohoAccount(_0x590adb){this['id']=_0x590adb['id']||0x0;this[_0x9bcd('0x0')]=_0x590adb[_0x9bcd('0x0')]||'';this[_0x9bcd('0x1')]=_0x590adb[_0x9bcd('0x1')]||'';this[_0x9bcd('0x2')]=_0x590adb[_0x9bcd('0x2')]||'';this[_0x9bcd('0x3')]=_0x590adb[_0x9bcd('0x3')]||'';this[_0x9bcd('0x4')]=_0x590adb[_0x9bcd('0x4')]||'';this[_0x9bcd('0x5')]=_0x590adb[_0x9bcd('0x5')]||'';this['serverUrl']=_0x590adb[_0x9bcd('0x6')]||'';this['code']=_0x590adb[_0x9bcd('0x7')]||'';this[_0x9bcd('0x8')]=_0x590adb[_0x9bcd('0x8')]||'';this[_0x9bcd('0x9')]=_0x590adb['Configurations']||{};}module[_0x9bcd('0xa')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index efc7537..86e986e 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 _0x36a2=['countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','format','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil','string','idContact','queue','type','campaigntype','dialAnswer','membername','Agent','channelAgent','SIP/%s','calleridname','Contact','firstName','lastName','active','calleridnum','phone','scheduledat','countbusyretry'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x36a2,0x1ab));var _0x236a=function(_0x154584,_0x421e12){_0x154584=_0x154584-0x0;var _0x969074=_0x36a2[_0x154584];return _0x969074;};'use strict';var util=require(_0x236a('0x0'));var _=require(_0x236a('0x1'));var moment=require(_0x236a('0x2'));function checkNameSurname(_0x8ff70b,_0x349fd1,_0x4dd9be){var _0x421997='';if(!_[_0x236a('0x3')](_0x349fd1)&&_0x236a('0x4')===typeof _0x349fd1){_0x421997+=_0x349fd1;}if(!_[_0x236a('0x3')](_0x4dd9be)&&_0x236a('0x4')===typeof _0x4dd9be){_0x421997+='\x20'+_0x4dd9be;}if(_0x421997!==''){return _0x421997;}return _0x8ff70b;}function Action(_0x1b0fe6,_0x35c822,_0x1c3667,_0x3ff44e,_0xba06a8){this['uniqueid']=_0x1c3667||undefined;this[_0x236a('0x5')]=_0x1b0fe6['id'];this[_0x236a('0x6')]=_0x35c822['name'];this['type']=_0x35c822[_0x236a('0x7')];this[_0x236a('0x8')]=_0x236a('0x6');this[_0x236a('0x9')]=![];this[_0x236a('0xa')]=_[_0x236a('0x3')](_0x1b0fe6[_0x236a('0xb')])?undefined:_0x1b0fe6[_0x236a('0xb')]['name'];this[_0x236a('0xc')]=this[_0x236a('0xa')]?util['format'](_0x236a('0xd'),this[_0x236a('0xa')]):_0x3ff44e||undefined;this[_0x236a('0xe')]=checkNameSurname(_0x1b0fe6[_0x236a('0xf')]['phone'],_0x1b0fe6[_0x236a('0xf')][_0x236a('0x10')],_0x1b0fe6['Contact'][_0x236a('0x11')]);this[_0x236a('0x12')]=_0x1b0fe6[_0x236a('0x12')]||![];this[_0x236a('0x13')]=_0x1b0fe6[_0x236a('0xf')][_0x236a('0x14')];this[_0x236a('0x15')]=_0x1b0fe6[_0x236a('0x15')];this[_0x236a('0x16')]=_0x1b0fe6[_0x236a('0x16')]||0x0;this[_0x236a('0x17')]=_0x1b0fe6[_0x236a('0x17')]||0x0;this[_0x236a('0x18')]=_0x1b0fe6[_0x236a('0x18')]||0x0;this[_0x236a('0x19')]=(_0x1b0fe6['countbusyretry']||0x0)+(_0x1b0fe6[_0x236a('0x17')]||0x0)+(_0x1b0fe6[_0x236a('0x18')]||0x0)+(_0x1b0fe6[_0x236a('0x1a')]||0x0)+(_0x1b0fe6[_0x236a('0x1b')]||0x0)+(_0x1b0fe6[_0x236a('0x1c')]||0x0)+(_0x1b0fe6[_0x236a('0x1d')]||0x0)+(_0x1b0fe6['countagentrejectretry']||0x0);this[_0x236a('0x1a')]=_0x1b0fe6[_0x236a('0x1a')]||0x0;this[_0x236a('0x1b')]=_0x1b0fe6[_0x236a('0x1b')]||0x0;this['countabandonedretry']=_0x1b0fe6[_0x236a('0x1c')]||0x0;this[_0x236a('0x1d')]=_0x1b0fe6[_0x236a('0x1d')]||0x0;this[_0x236a('0x1e')]=_0x1b0fe6[_0x236a('0x1e')]||0x0;this[_0x236a('0x1f')]=_0x1b0fe6[_0x236a('0x1f')];this[_0x236a('0x20')]=_0x1b0fe6[_0x236a('0x20')];this['callbackat']=_0x1b0fe6[_0x236a('0x21')];this[_0x236a('0x22')]=_0x1b0fe6['recallme'];this[_0x236a('0x23')]=_0x1b0fe6[_0x236a('0x23')];this['ListId']=_0x1b0fe6[_0x236a('0x24')];this[_0x236a('0x25')]=_[_0x236a('0x3')](_0x1b0fe6['Agent'])?_0x1b0fe6[_0x236a('0x25')]:_0x1b0fe6[_0x236a('0xb')]['id'];this['VoiceQueueId']=_0x1b0fe6[_0x236a('0x26')];this[_0x236a('0x27')]='';this[_0x236a('0x28')]='';}Action['prototype']['getCaller']=function(){return util[_0x236a('0x29')](_0x236a('0x2a'),this[_0x236a('0xe')],this[_0x236a('0x2b')]);};module[_0x236a('0x2c')]=Action; \ No newline at end of file +var _0xbc9c=['VoiceQueueId','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','isNil','string','idContact','type','campaigntype','queue','membername','Agent','name','channelAgent','format','SIP/%s','calleridname','phone','Contact','firstName','lastName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x348ca1,_0x429707){var _0x466322=function(_0x131ed7){while(--_0x131ed7){_0x348ca1['push'](_0x348ca1['shift']());}};_0x466322(++_0x429707);}(_0xbc9c,0x167));var _0xcbc9=function(_0x2fb110,_0x5c0176){_0x2fb110=_0x2fb110-0x0;var _0x5bc452=_0xbc9c[_0x2fb110];return _0x5bc452;};'use strict';var util=require(_0xcbc9('0x0'));var _=require(_0xcbc9('0x1'));var moment=require('moment');function checkNameSurname(_0x3670b0,_0x217b62,_0x3d8d53){var _0x113ee8='';if(!_[_0xcbc9('0x2')](_0x217b62)&&_0xcbc9('0x3')===typeof _0x217b62){_0x113ee8+=_0x217b62;}if(!_[_0xcbc9('0x2')](_0x3d8d53)&&'string'===typeof _0x3d8d53){_0x113ee8+='\x20'+_0x3d8d53;}if(_0x113ee8!==''){return _0x113ee8;}return _0x3670b0;}function Action(_0x5ced62,_0x50e596,_0x1e067f,_0x5840e3,_0x429407){this['uniqueid']=_0x1e067f||undefined;this[_0xcbc9('0x4')]=_0x5ced62['id'];this['queue']=_0x50e596['name'];this[_0xcbc9('0x5')]=_0x50e596['type'];this[_0xcbc9('0x6')]=_0xcbc9('0x7');this['dialAnswer']=![];this[_0xcbc9('0x8')]=_[_0xcbc9('0x2')](_0x5ced62[_0xcbc9('0x9')])?undefined:_0x5ced62[_0xcbc9('0x9')][_0xcbc9('0xa')];this[_0xcbc9('0xb')]=this['membername']?util[_0xcbc9('0xc')](_0xcbc9('0xd'),this[_0xcbc9('0x8')]):_0x5840e3||undefined;this[_0xcbc9('0xe')]=checkNameSurname(_0x5ced62['Contact'][_0xcbc9('0xf')],_0x5ced62[_0xcbc9('0x10')][_0xcbc9('0x11')],_0x5ced62[_0xcbc9('0x10')][_0xcbc9('0x12')]);this['active']=_0x5ced62[_0xcbc9('0x13')]||![];this['calleridnum']=_0x5ced62[_0xcbc9('0x10')][_0xcbc9('0xf')];this['scheduledat']=_0x5ced62[_0xcbc9('0x14')];this[_0xcbc9('0x15')]=_0x5ced62[_0xcbc9('0x15')]||0x0;this[_0xcbc9('0x16')]=_0x5ced62['countcongestionretry']||0x0;this[_0xcbc9('0x17')]=_0x5ced62[_0xcbc9('0x17')]||0x0;this[_0xcbc9('0x18')]=(_0x5ced62[_0xcbc9('0x15')]||0x0)+(_0x5ced62['countcongestionretry']||0x0)+(_0x5ced62['countnoanswerretry']||0x0)+(_0x5ced62[_0xcbc9('0x19')]||0x0)+(_0x5ced62[_0xcbc9('0x1a')]||0x0)+(_0x5ced62[_0xcbc9('0x1b')]||0x0)+(_0x5ced62[_0xcbc9('0x1c')]||0x0)+(_0x5ced62[_0xcbc9('0x1d')]||0x0);this[_0xcbc9('0x19')]=_0x5ced62[_0xcbc9('0x19')]||0x0;this[_0xcbc9('0x1a')]=_0x5ced62['countdropretry']||0x0;this[_0xcbc9('0x1b')]=_0x5ced62[_0xcbc9('0x1b')]||0x0;this['countmachineretry']=_0x5ced62[_0xcbc9('0x1c')]||0x0;this['countagentrejectretry']=_0x5ced62[_0xcbc9('0x1d')]||0x0;this[_0xcbc9('0x1e')]=_0x5ced62[_0xcbc9('0x1e')];this[_0xcbc9('0x1f')]=_0x5ced62[_0xcbc9('0x1f')];this[_0xcbc9('0x20')]=_0x5ced62[_0xcbc9('0x20')];this[_0xcbc9('0x21')]=_0x5ced62['recallme'];this[_0xcbc9('0x22')]=_0x5ced62[_0xcbc9('0x22')];this[_0xcbc9('0x23')]=_0x5ced62['ListId'];this[_0xcbc9('0x24')]=_[_0xcbc9('0x2')](_0x5ced62[_0xcbc9('0x9')])?_0x5ced62[_0xcbc9('0x24')]:_0x5ced62[_0xcbc9('0x9')]['id'];this[_0xcbc9('0x25')]=_0x5ced62[_0xcbc9('0x25')];this[_0xcbc9('0x26')]='';this['originatecalleridname']='';}Action[_0xcbc9('0x27')][_0xcbc9('0x28')]=function(){return util[_0xcbc9('0xc')](_0xcbc9('0x29'),this[_0xcbc9('0xe')],this[_0xcbc9('0x2a')]);};module[_0xcbc9('0x2b')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 1204fbe..b103eda 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 _0xddee=['[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','VoiceQueueId','lookAgent','isEmpty','execCall','Queue:\x20','idContact','called','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','Contact\x20in\x20black\x20List','trunks','SIP/%s','status','unmonitored','run','execRun','unlock','unlockContact','disableContact','getContactPreview','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','Agent','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','trim','dialCutDigit','substring','SIP/%s/%s%s','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variablesAction','channelAgent','destconnectedlinenum','calleridnum','user:%s','user:agentconnect','accountcode','[originated][increment]','[originateFailure][logOriginateFailure]','channel','actionid','logLookAgent','clone','isFailure','response','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','variables','filterKey','keys','variable','error','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','../ami','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','syncHangup','syncHangupRequest','dialend','syncDialEnd','newexten','varset','syncVarSet','blindtransfer','syncBlindTransfer','emit','type','name','answered','available','sumDuration','sumHoldTime','total','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','message','originated','erlangCallToSecond','startProgressive','Trunk','active','callerid','Interval','stringify','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','pTalking','paused','NOT_ACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','logger','\x20is\x20disactive','syncCampaigns','hasOwnProperty','dialMethod','clearZombieChannels','outbound','setMessage','recallMe','[clearZombieChannels][talking]','Queue','pTalking:\x20','pick','contactId','UserId','ListId','Action','No\x20such\x20channel','updateOriginated','queue','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][Preview]','[action]','size','clearZombieChannel','agentReadyId','then','isNil','length','logger2','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','catch','[getContactRecallMe]','IsNotLoggedIn','loggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','linkedid','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','connect','acw','custom:agentConnectPreview','buildAcw','complete','outboundAnswerCallsDay','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumBillable','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyRetryFrequency','activeContact','NOANSWER','countnoanswerretry','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','custom:agentcongestion','[callProgressDetectingCustomer][logCongestion]','dialCongestionMaxRetry','unlockAgent','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','agentreject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]'];(function(_0x118afa,_0x4bf0c1){var _0x167d76=function(_0x2c529b){while(--_0x2c529b){_0x118afa['push'](_0x118afa['shift']());}};_0x167d76(++_0x4bf0c1);}(_0xddee,0x1b8));var _0xedde=function(_0x25d386,_0x108d0d){_0x25d386=_0x25d386-0x0;var _0x857f4a=_0xddee[_0x25d386];return _0x857f4a;};'use strict';var util=require(_0xedde('0x0'));var _=require(_0xedde('0x1'));var BPromise=require(_0xedde('0x2'));var uuid=require(_0xedde('0x3'));var moment=require(_0xedde('0x4'));var md5=require(_0xedde('0x5'));var Redis=require(_0xedde('0x6'));var config=require(_0xedde('0x7'));var logger=require(_0xedde('0x8'))(_0xedde('0x9'));var loggerAction=require(_0xedde('0x8'))('actionPreview');var ami=require(_0xedde('0xa'));var rpcDb=require(_0xedde('0xb'));var Action=require(_0xedde('0xc'));var ut=require(_0xedde('0xd'));config[_0xedde('0xe')]=_[_0xedde('0xf')](config[_0xedde('0xe')],{'host':_0xedde('0x10'),'port':0x18eb});var io=require(_0xedde('0x11'))(new Redis(config[_0xedde('0xe')]));var Sequence=function(){};Sequence[_0xedde('0x12')][_0xedde('0x13')]=function(_0x584acf){this[_0xedde('0x14')]=this[_0xedde('0x14')]?this['tail'][_0xedde('0x15')](_0x584acf):_0x584acf();};function Preview(_0x441d44){this[_0xedde('0x16')]=new Sequence();this[_0xedde('0x17')]=_0x441d44['voiceQueues'];this['trunks']=_0x441d44['trunks'];this[_0xedde('0x18')]={};this[_0xedde('0x19')]=_0x441d44[_0xedde('0x19')];this[_0xedde('0x1a')]=0x0;ami['on'](_0xedde('0x1b'),this[_0xedde('0x1c')][_0xedde('0x1d')](this));ami['on']('hangup',this[_0xedde('0x1e')][_0xedde('0x1d')](this));ami['on']('hanguprequest',this[_0xedde('0x1f')][_0xedde('0x1d')](this));ami['on'](_0xedde('0x20'),this[_0xedde('0x21')][_0xedde('0x1d')](this));ami['on'](_0xedde('0x22'),this['syncNewExten'][_0xedde('0x1d')](this));ami['on'](_0xedde('0x23'),this[_0xedde('0x24')][_0xedde('0x1d')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0xedde('0x1d')](this));ami['on'](_0xedde('0x25'),this[_0xedde('0x26')][_0xedde('0x1d')](this));this['loopCampaigns'](this[_0xedde('0x17')]);}function emit(_0x48ca1a,_0x57f2c3,_0x28e491){io['to'](_0x48ca1a)[_0xedde('0x27')](_0x57f2c3,_0x28e491);}function emitCampaignPreview(_0x2aee22){if(_0x2aee22[_0xedde('0x28')]==='outbound'){var _0x1e45c3={'id':_0x2aee22['id'],'name':_0x2aee22[_0xedde('0x29')],'strategy':_0x2aee22['strategy'],'answered':_0x2aee22[_0xedde('0x2a')],'available':_0x2aee22[_0xedde('0x2b')],'loggedIn':_0x2aee22['loggedIn'],'pTalking':_0x2aee22['pTalking'],'sumBillable':_0x2aee22['sumBillable'],'sumDuration':_0x2aee22[_0xedde('0x2c')],'sumHoldTime':_0x2aee22[_0xedde('0x2d')]||0x0,'talking':_0x2aee22['talking'],'total':_0x2aee22[_0xedde('0x2e')],'type':_0x2aee22[_0xedde('0x28')],'unmanaged':_0x2aee22['unmanaged'],'abandoned':_0x2aee22['abandoned'],'waiting':_0x2aee22[_0xedde('0x2f')],'loggedInDb':_0x2aee22[_0xedde('0x30')],'dialActive':_0x2aee22[_0xedde('0x31')],'dialMethod':_0x2aee22['dialMethod'],'dialOriginateCallerIdName':_0x2aee22[_0xedde('0x32')],'dialOriginateCallerIdNumber':_0x2aee22[_0xedde('0x33')],'dialOriginateTimeout':_0x2aee22[_0xedde('0x34')],'dialPrefix':_0x2aee22[_0xedde('0x35')],'outboundAnswerAgiCallsDay':_0x2aee22['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x2aee22['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x2aee22['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x2aee22[_0xedde('0x36')],'outboundCongestionCallsDay':_0x2aee22[_0xedde('0x37')],'outboundDropCallsDayACS':_0x2aee22['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x2aee22['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x2aee22[_0xedde('0x38')],'outboundNoAnswerCallsDay':_0x2aee22[_0xedde('0x39')],'outboundNoSuchCallsDay':_0x2aee22[_0xedde('0x3a')],'outboundOriginateFailureCallsDay':_0x2aee22[_0xedde('0x3b')],'outboundReCallsDay':_0x2aee22[_0xedde('0x3c')],'outboundRejectCallsDay':_0x2aee22['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x2aee22['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x2aee22[_0xedde('0x3d')],'predictiveIntervalAnsweredCalls':_0x2aee22[_0xedde('0x3e')],'predictiveIntervalAvgHoldtime':_0x2aee22['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x2aee22[_0xedde('0x3f')],'predictiveIntervalDroppedCallsCallersExit':_0x2aee22[_0xedde('0x40')],'predictiveIntervalDroppedCallsTimeout':_0x2aee22[_0xedde('0x41')],'predictiveIntervalErlangCalls':_0x2aee22[_0xedde('0x42')],'predictiveIntervalErlangCallsDroppedCalls':_0x2aee22[_0xedde('0x43')],'predictiveIntervalHitRate':_0x2aee22[_0xedde('0x44')],'predictiveIntervalMultiplicativeFactor':_0x2aee22[_0xedde('0x45')],'predictiveIntervalPauses':_0x2aee22[_0xedde('0x46')],'predictiveIntervalAvailable':_0x2aee22[_0xedde('0x47')],'predictiveIntervalTotalCalls':_0x2aee22['predictiveIntervalTotalCalls'],'message':_0x2aee22[_0xedde('0x48')],'originated':_0x2aee22[_0xedde('0x49')],'erlangCalls':_0x2aee22['erlangCalls'],'erlangCallToSecond':_0x2aee22[_0xedde('0x4a')],'erlangAbandonmentRate':_0x2aee22['erlangAbandonmentRate'],'erlangBusyFactor':_0x2aee22['erlangBusyFactor'],'startPredictive':_0x2aee22['startPredictive'],'startProgressive':_0x2aee22[_0xedde('0x4b')]};if(_0x2aee22[_0xedde('0x4c')]){_0x1e45c3['Trunk']={'id':_0x2aee22[_0xedde('0x4c')]['id'],'name':_0x2aee22[_0xedde('0x4c')][_0xedde('0x29')],'active':_0x2aee22['Trunk'][_0xedde('0x4d')],'callerid':_0x2aee22[_0xedde('0x4c')][_0xedde('0x4e')]};}if(_0x2aee22[_0xedde('0x4f')]){_0x1e45c3[_0xedde('0x4f')]={'id':_0x2aee22[_0xedde('0x4f')]['id'],'name':_0x2aee22['Interval'][_0xedde('0x29')]};}var _0x26a057=md5(JSON[_0xedde('0x50')](_0x1e45c3));if(_0x2aee22[_0xedde('0x5')]!==_0x26a057){_0x2aee22[_0xedde('0x5')]=_0x26a057;emit(util['format']('voice:queue:%s',_0x1e45c3[_0xedde('0x29')]),'voice_queue:save',_0x1e45c3);}}}function emitVoiceQueueChannelRemove(_0x9ab6f3){logger[_0xedde('0x51')](_0xedde('0x52'),JSON['stringify'](_0x9ab6f3));emit(util[_0xedde('0x53')]('voice:queue:%s',_0x9ab6f3['name']),_0xedde('0x54'),_0x9ab6f3);io[_0xedde('0x27')](_0xedde('0x55'),_0x9ab6f3);}function notSendMessagesQueue(_0x1a03bd){if(_0x1a03bd[_0xedde('0x56')]){if(_0x1a03bd['originated']===0x0&&_0x1a03bd[_0xedde('0x57')]===0x0){_0x1a03bd[_0xedde('0x56')]=![];_0x1a03bd[_0xedde('0x2b')]=0x0;_0x1a03bd[_0xedde('0x58')]=0x0;_0x1a03bd[_0xedde('0x48')]=_0xedde('0x59');ut['logger'](_0xedde('0x5a'),_0x1a03bd[_0xedde('0x29')]+_0xedde('0x5b'));}else{_0x1a03bd[_0xedde('0x48')]=_0xedde('0x5c');ut[_0xedde('0x5d')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x1a03bd[_0xedde('0x29')]+_0xedde('0x5e'));}emitCampaignPreview(_0x1a03bd);}}Preview[_0xedde('0x12')]['loopCampaigns']=function(){var _0x2277c8=this;setInterval(function(){_0x2277c8[_0xedde('0x5f')]();},0x7cf);};Preview[_0xedde('0x12')]['syncCampaigns']=function(){var _0x5c3f2f=this[_0xedde('0x17')];this[_0xedde('0x1a')]+=0x1;for(var _0x57d3f3 in _0x5c3f2f){if(_0x5c3f2f[_0xedde('0x60')](_0x57d3f3)&&(_0x5c3f2f[_0x57d3f3]['dialMethod']===_0xedde('0x9')||_0x5c3f2f[_0x57d3f3][_0xedde('0x61')]==='booked')&&_0x5c3f2f[_0x57d3f3]['type']==='outbound'){if(this[_0xedde('0x1a')]>0x7){this[_0xedde('0x1a')]=0x0;this[_0xedde('0x62')]();}}if(_0x5c3f2f[_0xedde('0x60')](_0x57d3f3)&&_0x5c3f2f[_0x57d3f3][_0xedde('0x61')]===_0xedde('0x9')&&_0x5c3f2f[_0x57d3f3][_0xedde('0x28')]===_0xedde('0x63')){if(_0x5c3f2f[_0x57d3f3][_0xedde('0x31')]){this[_0xedde('0x64')](_0x5c3f2f[_0x57d3f3]);this[_0xedde('0x65')](_0x5c3f2f[_0x57d3f3]);}else{notSendMessagesQueue(_0x5c3f2f[_0x57d3f3]);}}}};Preview[_0xedde('0x12')]['clearZombieChannel']=function(_0x3a9680){var _0x5b9f21=this;this['sequence'][_0xedde('0x13')](function(){if(!_['isNil'](_0x5b9f21[_0xedde('0x18')][_0x3a9680])){loggerAction[_0xedde('0x51')](_0xedde('0x66'),_0x3a9680,_0xedde('0x67'),_0x5b9f21[_0xedde('0x18')][_0x3a9680]['queue'],'originated:\x20',JSON[_0xedde('0x50')](_0x5b9f21[_0xedde('0x17')][_0x5b9f21[_0xedde('0x18')][_0x3a9680]['queue']][_0xedde('0x49')]),_0xedde('0x68'),JSON['stringify'](_0x5b9f21[_0xedde('0x17')][_0x5b9f21[_0xedde('0x18')][_0x3a9680]['queue']][_0xedde('0x57')]),JSON[_0xedde('0x50')](_0x5b9f21[_0xedde('0x18')][_0x3a9680]['dialAnswer']),JSON[_0xedde('0x50')](_[_0xedde('0x69')](_0x5b9f21[_0xedde('0x18')][_0x3a9680],[_0xedde('0x6a'),_0xedde('0x6b'),'VoiceQueueId',_0xedde('0x6c')])));return ami[_0xedde('0x6d')]({'action':'status','channel':_0x5b9f21[_0xedde('0x18')][_0x3a9680]['channel']})['catch'](function(_0x3340d7){if(_0x3340d7[_0xedde('0x48')]===_0xedde('0x6e')){setTimeout(function(){if(_0x5b9f21[_0xedde('0x18')][_0x3a9680]){ut[_0xedde('0x6f')](_0x5b9f21[_0xedde('0x17')][_0x5b9f21[_0xedde('0x18')][_0x3a9680][_0xedde('0x70')]],'[clearZombieChannel]');if(_0x5b9f21[_0xedde('0x18')][_0x3a9680][_0xedde('0x71')]===!![]){ut[_0xedde('0x72')](_0x5b9f21[_0xedde('0x17')][_0x5b9f21[_0xedde('0x18')][_0x3a9680]['queue']],_0xedde('0x73'));ut[_0xedde('0x74')]('[Dialer][checkChannel][pTalking][Preview]'+_0x3a9680,_0x5b9f21[_0xedde('0x18')][_0x3a9680][_0xedde('0x70')]);}ut[_0xedde('0x74')](_0xedde('0x75')+_0x3a9680,_0x5b9f21[_0xedde('0x18')][_0x3a9680][_0xedde('0x70')]);delete _0x5b9f21[_0xedde('0x18')][_0x3a9680];}},0x2328);}});}});};Preview[_0xedde('0x12')][_0xedde('0x62')]=function(){var _0x4b73d4=this;loggerAction[_0xedde('0x51')](_0xedde('0x76'),_[_0xedde('0x77')](this[_0xedde('0x18')]));for(var _0x30434d in this[_0xedde('0x18')]){if(_0x4b73d4[_0xedde('0x18')][_0xedde('0x60')](_0x30434d)){_0x4b73d4[_0xedde('0x78')](_0x30434d);}}};Preview[_0xedde('0x12')][_0xedde('0x65')]=function(_0x3d7407){var _0x5eea9d=this;rpcDb['getContactRecallMe'](_0x3d7407['id'],ut[_0xedde('0x79')](this[_0xedde('0x19')]))[_0xedde('0x7a')](function(_0x315b12){if(!_[_0xedde('0x7b')](_0x315b12)){for(var _0x41b674=0x0;_0x41b674<_0x315b12[_0xedde('0x7c')];_0x41b674+=0x1){if(ut['getDiff'](_0x315b12[_0x41b674]['scheduledat'])<_0x3d7407['dialRecallMeTimeout']*0x3c){if(_0x315b12[_0x41b674]['Agent']&&!_0x315b12[_0x41b674]['Agent']['voicePause']){_0x5eea9d['run'](_0x315b12[_0x41b674]['id'])[_0xedde('0x7a')](ut[_0xedde('0x7d')](_0xedde('0x7e')))['catch'](ut[_0xedde('0x7d')](_0xedde('0x7e')));}else{rpcDb['disableContact'](_0x315b12[_0x41b674]['id']);}}else{var _0x53ed81=new Action(_0x315b12[_0x41b674],_0x3d7407);_0x53ed81[_0xedde('0x7f')]=moment()[_0xedde('0x53')](_0xedde('0x80'));_0x3d7407[_0xedde('0x3c')]+=0x1;ut[_0xedde('0x81')](_0x53ed81,0x17,'RecallInQueue');if(_0x3d7407[_0xedde('0x82')]){rpcDb[_0xedde('0x83')](ut[_0xedde('0x84')](_0x315b12[_0x41b674]));rpcDb[_0xedde('0x85')](_0x53ed81,_0xedde('0x86'));}else{ut[_0xedde('0x81')](_0x53ed81,0x16,_0xedde('0x87'));rpcDb['createCustomerHistory'](_0x53ed81,_0xedde('0x88'));rpcDb[_0xedde('0x89')](_0x53ed81,'[HistoryRecallClose]');}}}}})[_0xedde('0x8a')](ut[_0xedde('0x7d')](_0xedde('0x8b')));};Preview['prototype'][_0xedde('0x64')]=function(_0x7353c8){_0x7353c8['sendMessageOneNotActive']=!![];if(ut[_0xedde('0x8c')](_0x7353c8[_0xedde('0x8d')])){_0x7353c8[_0xedde('0x48')]=_0xedde('0x8e');}else if(!ut[_0xedde('0x8f')](_0x7353c8[_0xedde('0x31')])){_0x7353c8[_0xedde('0x48')]=_0xedde('0x59');}else if(!this[_0xedde('0x90')](_0x7353c8[_0xedde('0x4c')])){if(!this[_0xedde('0x90')](_0x7353c8['TrunkBackup'])){_0x7353c8[_0xedde('0x48')]=_0xedde('0x91');}else{_0x7353c8[_0xedde('0x48')]='ACTIVE';}}else{_0x7353c8[_0xedde('0x48')]=_0xedde('0x92');}emitCampaignPreview(_0x7353c8);};Preview['prototype'][_0xedde('0x93')]=function(_0x595972,_0x20c33f,_0x38d9ef){var _0x51e7c7=this;var _0xc9097b=this[_0xedde('0x18')][_0x20c33f];var _0x59951a=this[_0xedde('0x17')][_0xc9097b['queue']];var _0x3fe395;if(_0x59951a){switch(_0x38d9ef){case'1':_0x59951a[_0xedde('0x3a')]+=0x1;_0xc9097b[_0xedde('0x94')]+=0x1;_0xc9097b[_0xedde('0x95')]=ut[_0xedde('0x96')](_0xc9097b);ut[_0xedde('0x81')](_0xc9097b,0x0,_0xedde('0x97'));ami[_0xedde('0x27')](_0xedde('0x98'),ut[_0xedde('0x99')](_0xc9097b,_0xedde('0x9a')));rpcDb[_0xedde('0x85')](_0xc9097b,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0xedde('0x96')](_0xc9097b)>=_0x59951a[_0xedde('0x9b')]){_0x3fe395=ut['cloneAction'](_0xc9097b,0xf,_0xedde('0x9c'));rpcDb[_0xedde('0x89')](_0x3fe395,_0xedde('0x9d'));}else{if(_0xc9097b[_0xedde('0x94')]>=_0x59951a[_0xedde('0x9e')]){rpcDb['createCustomerFinal'](_0xc9097b,_0xedde('0x9d'));}else{rpcDb[_0xedde('0x9f')](ut[_0xedde('0xa0')](_0xc9097b,_0xedde('0x94'),_0x59951a['dialNoSuchNumberRetryFrequency']),_0xc9097b['unlockAgent'],_0xc9097b['activeContact']);}}delete this['actions'][_0x595972[_0xedde('0xa1')]];break;case _0xedde('0xa2'):var _0x1c46e1=moment()[_0xedde('0x53')]('YYYY-MM-DD\x20HH:mm:ss');_0xc9097b[_0xedde('0xa3')]=_0x1c46e1;_0xc9097b[_0xedde('0xa4')]=_0x1c46e1;_0xc9097b[_0xedde('0x71')]=!![];_0x59951a[_0xedde('0x57')]+=0x1;logger[_0xedde('0x51')](_0xedde('0xa5'),_0xc9097b[_0xedde('0xa6')],_0xedde('0xa7'),_0x59951a[_0xedde('0x29')],_0xedde('0x68'),_0x59951a['pTalking']);ami['emit']('custom:agentconnect',ut[_0xedde('0x99')](_0xc9097b,_0xedde('0xa8'),this[_0xedde('0x17')][_0xc9097b['queue']]));if(_0x59951a[_0xedde('0xa9')]){ami[_0xedde('0x27')](_0xedde('0xaa'),ut[_0xedde('0xab')](_0xc9097b));}break;case'16':ami[_0xedde('0x27')]('custom:agentcomplete',ut[_0xedde('0x99')](_0xc9097b,_0xedde('0xac'),this['campaignsPreview'][_0xc9097b['queue']]));emitVoiceQueueChannelRemove(ut[_0xedde('0x99')](_0xc9097b,_0xedde('0xac')));_0x59951a[_0xedde('0xad')]+=0x1;_0x59951a[_0xedde('0x2e')]+=0x1;_0x59951a[_0xedde('0x2a')]+=0x1;ut[_0xedde('0x72')](_0x59951a,_0xedde('0xae'));_0xc9097b[_0xedde('0x95')]=ut[_0xedde('0x96')](_0xc9097b);ut['logCustomer'](_0xc9097b,0x4,'Answer');rpcDb[_0xedde('0x85')](_0xc9097b,_0xedde('0xaf'));rpcDb['createCustomerFinal'](_0xc9097b,_0xedde('0xb0'));rpcDb[_0xedde('0xb1')](_0xc9097b);_0x59951a[_0xedde('0x2c')]+=_0xc9097b['talktime'];_0x59951a[_0xedde('0xb2')]+=_0xc9097b[_0xedde('0xb3')];logger[_0xedde('0x51')](_0xedde('0xb4'),_0xc9097b[_0xedde('0xa6')],_0xedde('0xa7'),_0x59951a[_0xedde('0x29')],_0xedde('0x68'),_0x59951a[_0xedde('0x57')]);delete this[_0xedde('0x18')][_0x595972[_0xedde('0xa1')]];break;case _0xedde('0xb5'):_0x59951a['outboundBusyCallsDay']+=0x1;_0xc9097b[_0xedde('0xb6')]+=0x1;_0xc9097b['countglobal']=ut[_0xedde('0x96')](_0xc9097b);ut['logCustomer'](_0xc9097b,0x5,_0xedde('0xb7'));ami[_0xedde('0x27')](_0xedde('0xb8'),ut[_0xedde('0x99')](_0xc9097b,_0xedde('0xb9')));rpcDb[_0xedde('0x85')](_0xc9097b,_0xedde('0xba'));if(ut['totalGlobal'](_0xc9097b)>=_0x59951a[_0xedde('0x9b')]){_0x3fe395=ut[_0xedde('0xbb')](_0xc9097b,0xf,_0xedde('0x9c'));rpcDb[_0xedde('0x89')](_0x3fe395,_0xedde('0xbc'));}else{if(_0xc9097b[_0xedde('0xb6')]>=_0x59951a['dialBusyMaxRetry']){rpcDb['createCustomerFinal'](_0xc9097b,_0xedde('0xba'));}else{rpcDb[_0xedde('0x9f')](ut[_0xedde('0xa0')](_0xc9097b,_0xedde('0xb6'),_0x59951a[_0xedde('0xbd')]),_0xc9097b['unlockAgent'],_0xc9097b[_0xedde('0xbe')]);}}break;case _0xedde('0xbf'):_0x59951a[_0xedde('0x39')]+=0x1;_0xc9097b[_0xedde('0xc0')]+=0x1;_0xc9097b[_0xedde('0x95')]=ut[_0xedde('0x96')](_0xc9097b);ut[_0xedde('0x81')](_0xc9097b,0x3,'NoAnswer');ami['emit'](_0xedde('0xc1'),ut['buildObj'](_0xc9097b,_0xedde('0xc2')));rpcDb[_0xedde('0x85')](_0xc9097b,_0xedde('0xc3'));if(ut[_0xedde('0x96')](_0xc9097b)>=_0x59951a[_0xedde('0x9b')]){_0x3fe395=ut[_0xedde('0xbb')](_0xc9097b,0xf,_0xedde('0x9c'));rpcDb['createCustomerFinal'](_0x3fe395,_0xedde('0xc4'));}else{if(_0xc9097b[_0xedde('0xc0')]>=_0x59951a['dialNoAnswerMaxRetry']){rpcDb[_0xedde('0x89')](_0xc9097b,_0xedde('0xc3'));}else{rpcDb[_0xedde('0x9f')](ut[_0xedde('0xa0')](_0xc9097b,_0xedde('0xc0'),_0x59951a[_0xedde('0xc5')]),_0xc9097b['unlockAgent'],_0xc9097b[_0xedde('0xbe')]);}}break;case _0xedde('0xc6'):_0x59951a[_0xedde('0x37')]+=0x1;_0xc9097b[_0xedde('0xc7')]+=0x1;_0xc9097b['countglobal']=ut[_0xedde('0x96')](_0xc9097b);ut[_0xedde('0x81')](_0xc9097b,0x8,'Congestion');ami['emit'](_0xedde('0xc8'),ut[_0xedde('0x99')](_0xc9097b,'congestion'));rpcDb['createCustomerHistory'](_0xc9097b,_0xedde('0xc9'));if(ut[_0xedde('0x96')](_0xc9097b)>=_0x59951a[_0xedde('0x9b')]){_0x3fe395=ut[_0xedde('0xbb')](_0xc9097b,0xf,_0xedde('0x9c'));rpcDb[_0xedde('0x89')](_0x3fe395,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0xc9097b[_0xedde('0xc7')]>=_0x59951a[_0xedde('0xca')]){rpcDb[_0xedde('0x89')](_0xc9097b,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0xedde('0x9f')](ut[_0xedde('0xa0')](_0xc9097b,_0xedde('0xc7'),_0x59951a[_0xedde('0xbd')]),_0xc9097b[_0xedde('0xcb')],_0xc9097b['activeContact']);}}break;case _0xedde('0xcc'):_0x59951a[_0xedde('0xcd')]+=0x1;_0xc9097b[_0xedde('0xce')]+=0x1;_0xc9097b[_0xedde('0x95')]=ut[_0xedde('0x96')](_0xc9097b);ut['logCustomer'](_0xc9097b,0x14,_0xedde('0xcf'));ami[_0xedde('0x27')]('custom:agentreject',ut[_0xedde('0x99')](_0xc9097b,_0xedde('0xd0')));rpcDb[_0xedde('0x85')](_0xc9097b,'[syncHangupRequest][logAgentReject]');if(ut[_0xedde('0x96')](_0xc9097b)>=_0x59951a[_0xedde('0x9b')]){_0x3fe395=ut['cloneAction'](_0xc9097b,0x14,_0xedde('0xcf'));rpcDb[_0xedde('0x89')](_0x3fe395,_0xedde('0xd1'));}else{if(_0xc9097b[_0xedde('0xce')]>=_0x59951a[_0xedde('0xd2')]){rpcDb[_0xedde('0x89')](_0xc9097b,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0xedde('0x9f')](ut[_0xedde('0xa0')](_0xc9097b,_0xedde('0xce'),_0x59951a['dialAgentRejectRetryFrequency']),_0xc9097b[_0xedde('0xcb')],_0xc9097b['activeContact']);}}break;case _0xedde('0xd3'):_0x59951a[_0xedde('0x3d')]+=0x1;_0xc9097b[_0xedde('0xd4')]+=0x1;_0xc9097b[_0xedde('0x95')]=ut[_0xedde('0x96')](_0xc9097b);ut[_0xedde('0x81')](_0xc9097b,0xb,'Abandoned');rpcDb[_0xedde('0x85')](_0xc9097b,'[callProgressDetectingCustomer][logAbandoned]');if(ut[_0xedde('0x96')](_0xc9097b)>=_0x59951a[_0xedde('0x9b')]){_0x3fe395=ut[_0xedde('0xbb')](_0xc9097b,0xf,_0xedde('0x9c'));rpcDb['createCustomerFinal'](_0x3fe395,_0xedde('0xd5'));}else{if(_0xc9097b['countabandonedetry']>=_0x59951a[_0xedde('0xd6')]){rpcDb[_0xedde('0x89')](_0xc9097b,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0xedde('0x9f')](ut[_0xedde('0xa0')](_0xc9097b,_0xedde('0xd4'),_0x59951a[_0xedde('0xd7')]),_0xc9097b['unlockAgent'],_0xc9097b[_0xedde('0xbe')]);}}break;case'18':_0x59951a[_0xedde('0xd8')]+=0x1;_0xc9097b['countmachineretry']+=0x1;_0xc9097b[_0xedde('0x95')]=ut['totalGlobal'](_0xc9097b);ut[_0xedde('0x81')](_0xc9097b,0x12,_0x595972[_0xedde('0xd9')]||_0x595972[_0xedde('0xda')]);ami[_0xedde('0x27')](_0xedde('0xdb'),ut['buildObj'](_0xc9097b,_0xedde('0xdc')));rpcDb['createCustomerHistory'](_0xc9097b,'[callProgressDetectingCustomer][hangupInAMD]');if(ut[_0xedde('0x96')](_0xc9097b)>=_0x59951a[_0xedde('0x9b')]){_0x3fe395=ut[_0xedde('0xbb')](_0xc9097b,0xf,_0xedde('0x9c'));rpcDb[_0xedde('0x89')](_0x3fe395,_0xedde('0xdd'));}else{rpcDb[_0xedde('0x89')](_0xc9097b,_0xedde('0xdd'));}delete this[_0xedde('0x18')][_0x595972[_0xedde('0xa1')]];break;case'19':_0x59951a[_0xedde('0xd8')]+=0x1;_0xc9097b[_0xedde('0x95')]=ut[_0xedde('0x96')](_0xc9097b);ut[_0xedde('0x81')](_0xc9097b,0x13,_0x595972[_0xedde('0xd9')]||_0x595972[_0xedde('0xda')]);ami[_0xedde('0x27')](_0xedde('0xdb'),ut[_0xedde('0x99')](_0xc9097b,_0xedde('0xdc')));rpcDb[_0xedde('0x85')](_0xc9097b,_0xedde('0xde'));if(ut[_0xedde('0x96')](_0xc9097b)>=_0x59951a[_0xedde('0x9b')]){_0x3fe395=ut[_0xedde('0xbb')](_0xc9097b,0xf,_0xedde('0x9c'));rpcDb[_0xedde('0x89')](_0x3fe395,_0xedde('0xde'));}else{rpcDb[_0xedde('0x89')](_0xc9097b,'[callProgressDetectingCustomer][machine]');}delete this[_0xedde('0x18')][_0x595972['linkedid']];break;default:if(_0xc9097b[_0xedde('0x71')]){ut[_0xedde('0x72')](_0x59951a,_0xedde('0xdf'));ut[_0xedde('0x74')](_0xedde('0xe0')+_0x59951a[_0xedde('0x29')],_0x595972);}_0x59951a[_0xedde('0xd8')]+=0x1;_0xc9097b[_0xedde('0x95')]=ut[_0xedde('0x96')](_0xc9097b);ut[_0xedde('0x81')](_0xc9097b,0xc,_0x595972[_0xedde('0xd9')]||_0x595972['dialstatus']);rpcDb[_0xedde('0x85')](_0xc9097b,_0xedde('0xe1'));if(ut[_0xedde('0x96')](_0xc9097b)>=_0x59951a[_0xedde('0x9b')]){_0x3fe395=ut[_0xedde('0xbb')](_0xc9097b,0xf,'Global');rpcDb[_0xedde('0x89')](_0x3fe395,_0xedde('0xe2'));}else{rpcDb[_0xedde('0x89')](_0xc9097b,_0xedde('0xe2'));}delete this[_0xedde('0x18')][_0x595972[_0xedde('0xa1')]];}if(!(_0xc9097b[_0xedde('0x71')]&&_0x38d9ef==='16')){ut[_0xedde('0x6f')](_0x59951a,_0xedde('0xe3'));logger[_0xedde('0x51')](_0xedde('0xe4'),_0xc9097b['uniqueid'],_0xedde('0xa7'),_0x59951a[_0xedde('0x29')],_0xedde('0xe5'),_0x59951a[_0xedde('0x49')]);}if(_0x38d9ef!==_0xedde('0xa2')){delete this[_0xedde('0x18')][_0x595972[_0xedde('0xa1')]];delete this[_0xedde('0x18')][_0x595972[_0xedde('0xe6')]];}}};Preview[_0xedde('0x12')][_0xedde('0xe7')]=function(_0x269fec,_0x5da0d8,_0x1bd9a7){if(_[_0xedde('0xe8')](_0x5da0d8)&&_0xedde('0xe9')!==typeof _0x5da0d8){return;}if(_[_0xedde('0xe8')](_0x1bd9a7)&&_0xedde('0xe9')!==typeof _0x1bd9a7){return;}switch(_0x1bd9a7[_0xedde('0xea')]){case'0':ut[_0xedde('0xeb')](_0x269fec,0x0,'NoSuchNumber');rpcDb[_0xedde('0xec')](_0x269fec,_0xedde('0xed'));break;case'3':ut['logAgent'](_0x269fec,0x3,_0xedde('0xee'));rpcDb[_0xedde('0xec')](_0x269fec,_0xedde('0xef'));break;case'5':ut['logAgent'](_0x269fec,0x5,_0xedde('0xb7'));rpcDb[_0xedde('0xec')](_0x269fec,_0xedde('0xf0'));break;case'8':ut['logAgent'](_0x269fec,0x8,_0xedde('0xf1'));rpcDb[_0xedde('0xec')](_0x269fec,_0xedde('0xf2'));break;case'22':ut[_0xedde('0xeb')](_0x269fec,0x16,_0xedde('0xf3'));rpcDb['createAgentHistory'](_0x269fec,_0xedde('0xf4'));break;default:ut[_0xedde('0xeb')](_0x269fec,0xc,_0x1bd9a7[_0xedde('0xea')]);rpcDb[_0xedde('0xec')](_0x269fec,_0xedde('0xf2'));}ut[_0xedde('0x6f')](_0x5da0d8,_0xedde('0xf5'));logger[_0xedde('0x51')](_0xedde('0xf6'),_0x269fec[_0xedde('0xa6')],_0xedde('0xa7'),_0x5da0d8[_0xedde('0x29')],_0xedde('0xe5'),_0x5da0d8[_0xedde('0x49')]);delete this[_0xedde('0x18')][_0x269fec[_0xedde('0xa6')]];};Preview[_0xedde('0x12')][_0xedde('0xf7')]=function(_0x36ac32,_0x5d96ec,_0x67939,_0xb1ddb6,_0x1981fc){var _0x362635=this;return new BPromise(function(_0x1901c4,_0xa90089){if(_[_0xedde('0x7b')](_0x5d96ec)||_[_0xedde('0x7b')](_0x5d96ec[_0xedde('0xf8')])||_['isNil'](_0x5d96ec['Contact'][_0xedde('0xf9')])||_[_0xedde('0x7b')](_0x5d96ec[_0xedde('0xfa')])){_0xa90089(ut[_0xedde('0x48')]('Contact\x20is\x20undefined',_0xb1ddb6,_0x1981fc));return;}var _0x48181c=uuid['v4']();var _0x2a7ad8=_0x362635['campaignsPreview'][_0x5d96ec[_0xedde('0x67')][_0xedde('0x29')]];var _0x4ab065=_0x67939?_0x362635[_0xedde('0x19')][_0x67939]['id']:undefined;_0x362635[_0xedde('0x18')][_0x48181c]=new Action(_0x5d96ec,_0x2a7ad8,_0x48181c,_0x67939,_0x4ab065);var _0x239cff=_0x362635[_0xedde('0x18')][_0x48181c];_0x239cff[_0xedde('0xcb')]=_0xb1ddb6;_0x239cff[_0xedde('0xbe')]=_0x1981fc;_0x239cff[_0xedde('0xfb')]=_0x67939;if(_[_0xedde('0xfc')](_0x36ac32)){_0x362635[_0xedde('0xfd')](_0x239cff,_0x2a7ad8,_0x5d96ec,_0x67939)['then'](function(_0x24e261){logger[_0xedde('0x51')]('[Preview][execCall][success]',_0xedde('0xfe')+_0x239cff['queue']+'\x20IdHopper:\x20'+_0x239cff[_0xedde('0xff')],JSON[_0xedde('0x50')](_0x24e261));ami[_0xedde('0x27')]('custom:agentcalled',ut[_0xedde('0x99')](_0x239cff,_0xedde('0x100'),_0x362635[_0xedde('0x17')][_0x239cff[_0xedde('0x70')]]));_0x1901c4(ut['message'](_0xedde('0x101')));})[_0xedde('0x8a')](function(_0xee2f57){ut[_0xedde('0x5d')](_0xedde('0x102'),_0xee2f57);_0xa90089(ut[_0xedde('0x48')](_0xedde('0x103'),_0xb1ddb6,_0x1981fc));});}else{_0x2a7ad8[_0xedde('0x104')]+=0x1;ut[_0xedde('0x105')](_0x239cff);rpcDb[_0xedde('0x106')](_0x239cff,'[Blacklist][error]');delete _0x362635[_0xedde('0x18')][_0x48181c];_0xa90089(ut[_0xedde('0x48')](_0xedde('0x107'),_0xb1ddb6,_0x1981fc));}});};Preview[_0xedde('0x12')]['isTrunkReachable']=function(_0xa943aa){return!_[_0xedde('0x7b')](_0xa943aa)&&!_['isNil'](_0xa943aa[_0xedde('0x29')])&&!_['isNil'](_0xa943aa[_0xedde('0x4d')])&&_0xa943aa[_0xedde('0x4d')]&&!_[_0xedde('0x7b')](this[_0xedde('0x108')][util['format']('SIP/%s',_0xa943aa[_0xedde('0x29')])])&&!_[_0xedde('0x7b')](this[_0xedde('0x108')][util[_0xedde('0x53')](_0xedde('0x109'),_0xa943aa[_0xedde('0x29')])]['status'])&&(this['trunks'][util[_0xedde('0x53')](_0xedde('0x109'),_0xa943aa[_0xedde('0x29')])][_0xedde('0x10a')]==='reachable'||this[_0xedde('0x108')][util[_0xedde('0x53')](_0xedde('0x109'),_0xa943aa[_0xedde('0x29')])][_0xedde('0x10a')]===_0xedde('0x10b'));};Preview[_0xedde('0x12')][_0xedde('0x10c')]=function(_0x4a7a25,_0x59c59e){var _0x22ea36=this;return new BPromise(function(_0x52951a,_0x4714c1){_0x22ea36[_0xedde('0x10d')](_0x4a7a25,_0x59c59e)[_0xedde('0x7a')](function(_0x5e4e7e){_0x52951a(_[_0xedde('0x69')](_0x5e4e7e,['message']));})[_0xedde('0x8a')](function(_0x26c04e){if(_0x26c04e[_0xedde('0x10e')]){rpcDb[_0xedde('0x10f')](_0x4a7a25);}if(_0x26c04e[_0xedde('0x4d')]){rpcDb[_0xedde('0x110')](_0x4a7a25);}_0x4714c1(_[_0xedde('0x69')](_0x26c04e,[_0xedde('0x48')]));});});};Preview[_0xedde('0x12')][_0xedde('0x10d')]=function(_0x3193f5,_0x2a8b90){var _0x51871c=this;return new BPromise(function(_0x275060,_0xd1bf99){var _0x4d572f,_0x11a7c5;rpcDb[_0xedde('0x111')](_0x3193f5)['then'](function(_0x28441c){if(!_[_0xedde('0x7b')](_0x28441c[0x0])){_0x11a7c5=_0x28441c[0x0]['recallme']?![]:!![];_0x4d572f=_0x28441c[0x0]['recallme']?!![]:![];_0x4d572f=_0x2a8b90?!![]:_0x4d572f;}var _0x16c439=_0x51871c[_0xedde('0x112')](_0x28441c);if(_0x16c439[_0xedde('0x113')]){rpcDb[_0xedde('0x114')](_['pick'](_0x28441c[0x0],[_0xedde('0xfa'),_0xedde('0x115')]))[_0xedde('0x7a')](function(_0x5b0ad4){_0x51871c[_0xedde('0xf7')](_0x5b0ad4,_0x28441c[0x0],_0x2a8b90,_0x11a7c5,_0x4d572f)['then'](function(_0x233fa1){_0x275060(_0x233fa1);})['catch'](function(_0x1291d7){_0xd1bf99(_0x1291d7);});})[_0xedde('0x8a')](function(_0x3ae6e4){ut['logger'](_0xedde('0x116'),_0x3ae6e4);_0xd1bf99(ut[_0xedde('0x48')](_0xedde('0x117'),_0x11a7c5,_0x4d572f));});}else{_0xd1bf99(ut[_0xedde('0x48')](_0x16c439['message'],_0x11a7c5,_0x4d572f));}})[_0xedde('0x8a')](function(_0x2e3d19){ut[_0xedde('0x5d')](_0xedde('0x118'),_0x2e3d19);_0xd1bf99(ut[_0xedde('0x48')]('Call\x20unsuccessful',![],!![]));});});};Preview[_0xedde('0x12')][_0xedde('0x112')]=function(_0x4542e7){if(_[_0xedde('0x7b')](_0x4542e7)||_[_0xedde('0xfc')](_0x4542e7)||!_[_0xedde('0x7b')](_0x4542e7[0x0][_0xedde('0x119')])&&_[_0xedde('0x7b')](_0x4542e7[0x0]['Agent'][_0xedde('0x29')])){ut[_0xedde('0x5d')](_0xedde('0x11a'),_0x4542e7);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x12eda7=this[_0xedde('0x17')][_0x4542e7[0x0][_0xedde('0x67')][_0xedde('0x29')]];_0x12eda7['message']=_0xedde('0x92');if(_[_0xedde('0x7b')](_0x12eda7)){ut[_0xedde('0x5d')](_0xedde('0x11b'),_0x12eda7);return{'isValid':![],'message':_0xedde('0x11c')};}if(!this[_0xedde('0x90')](_0x12eda7[_0xedde('0x4c')])){ut['logger'](_0xedde('0x11d'),_0xedde('0x11e')+_0x12eda7['name']+_0xedde('0x11f'));if(!this['isTrunkReachable'](_0x12eda7[_0xedde('0x120')])){ut[_0xedde('0x5d')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x12eda7[_0xedde('0x29')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0xedde('0x121')};}}if(!ut[_0xedde('0x8f')](_0x12eda7[_0xedde('0x31')])){ut[_0xedde('0x5d')](_0xedde('0x122'),_0x12eda7[_0xedde('0x29')]+'\x20Not\x20Active');return{'isValid':![],'message':_0xedde('0x11e')+_0x12eda7[_0xedde('0x29')]+_0xedde('0x123')};}return{'isValid':!![],'message':_0xedde('0x124')};};Preview[_0xedde('0x12')][_0xedde('0xfd')]=function(_0x35a200,_0x1f78b8,_0x4c5708,_0x5b31dd){var _0x599f2d=this;return new BPromise(function(_0x12f409,_0x4b98d6){var _0x6c5176=_0x35a200['uniqueid'];var _0x241970=_0x599f2d[_0xedde('0x90')](_0x1f78b8[_0xedde('0x4c')])?util['format']('SIP/%s/%s%s',_0x1f78b8[_0xedde('0x4c')][_0xedde('0x29')],_[_0xedde('0x7b')](_0x1f78b8['dialPrefix'])?'':_0x1f78b8[_0xedde('0x35')][_0xedde('0x125')]()||'',_0x1f78b8[_0xedde('0x126')]>0x0?_0x4c5708['Contact']['phone'][_0xedde('0x127')](_0x1f78b8[_0xedde('0x126')]):_0x4c5708[_0xedde('0xf8')][_0xedde('0xf9')]):util[_0xedde('0x53')](_0xedde('0x128'),_[_0xedde('0x7b')](_0x1f78b8[_0xedde('0x120')])?_0x1f78b8[_0xedde('0x4c')][_0xedde('0x29')]:_0x1f78b8[_0xedde('0x120')]['name'],_[_0xedde('0x7b')](_0x1f78b8[_0xedde('0x35')])?'':_0x1f78b8['dialPrefix']['trim']()||'',_0x1f78b8[_0xedde('0x126')]>0x0?_0x4c5708['Contact'][_0xedde('0xf9')][_0xedde('0x127')](_0x1f78b8[_0xedde('0x126')]):_0x4c5708[_0xedde('0xf8')][_0xedde('0xf9')]);var _0x43c501=_0x599f2d['isTrunkReachable'](_0x1f78b8[_0xedde('0x4c')])?ut[_0xedde('0x129')](_0x1f78b8['Trunk']['callerid'],_0x1f78b8[_0xedde('0x32')],_0x1f78b8[_0xedde('0x12a')]>0x0?ut[_0xedde('0x12b')](_0x1f78b8['dialOriginateCallerIdNumber'],_0x1f78b8[_0xedde('0x12a')]):_0x1f78b8['dialOriginateCallerIdNumber']):ut[_0xedde('0x129')](_[_0xedde('0x7b')](_0x1f78b8['TrunkBackup'])?_0x1f78b8['Trunk'][_0xedde('0x4e')]:_0x1f78b8[_0xedde('0x120')]['callerid'],_0x1f78b8[_0xedde('0x32')],_0x1f78b8['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xedde('0x12b')](_0x1f78b8[_0xedde('0x33')],_0x1f78b8[_0xedde('0x12a')]):_0x1f78b8[_0xedde('0x33')]);if(_0x43c501){_0x35a200[_0xedde('0x12c')]=ut['extractCalleridName'](_0x43c501);_0x35a200[_0xedde('0x12d')]=ut[_0xedde('0x12e')](_0x43c501);}var _0xb49a35=ut[_0xedde('0x12f')](_0x1f78b8,_0x4c5708,_0x241970,_0x43c501,_0x6c5176,_0x35a200);_[_0xedde('0x130')](_0x35a200,ut[_0xedde('0x131')](_0xb49a35));_0x35a200['starttime']=moment()[_0xedde('0x53')](_0xedde('0x80'));ami['Action'](ut[_0xedde('0x132')](_0x35a200,_0x1f78b8,_0xb49a35,_0x35a200[_0xedde('0xbe')],_0x5b31dd))[_0xedde('0x7a')](function(_0x27b5c3){var _0x54e292=_0x35a200[_0xedde('0x133')];if(!_[_0xedde('0x7b')](_0x54e292)){if(!_['isNil'](_0x599f2d[_0xedde('0x19')][_0x54e292])){_0x599f2d[_0xedde('0x19')][_0x54e292][_0xedde('0x134')]=_0x35a200[_0xedde('0x135')];emit(util[_0xedde('0x53')](_0xedde('0x136'),_0x599f2d[_0xedde('0x19')][_0x54e292][_0xedde('0x29')]),_0xedde('0x137'),{'destaccountcode':_0x599f2d[_0xedde('0x19')][_0x54e292][_0xedde('0x138')],'destconnectedlinenum':_0x35a200[_0xedde('0x135')]});}}_0x1f78b8[_0xedde('0x49')]+=0x1;logger[_0xedde('0x51')](_0xedde('0x139'),_0x6c5176,_0xedde('0xa7'),_0x1f78b8[_0xedde('0x29')],_0xedde('0xe5'),_0x1f78b8['originated']);_0x12f409(_0x27b5c3);})['catch'](function(_0x255342){ut[_0xedde('0xeb')](_0x35a200,0xe,'OriginateError');rpcDb[_0xedde('0xec')](_0x35a200,_0xedde('0x13a'));_0x4b98d6(_0x255342);});});};Preview['prototype']['syncNewExten']=function(_0x8dbcf2){if(this[_0xedde('0x18')][_0x8dbcf2['linkedid']]){this[_0xedde('0x18')][_0x8dbcf2[_0xedde('0xa1')]]['channel']=_0x8dbcf2[_0xedde('0x13b')];}};Preview['prototype'][_0xedde('0x1c')]=function(_0x1a1c03){var _0x179f84=this;var _0x137644=this[_0xedde('0x18')][_0x1a1c03[_0xedde('0x13c')]];if(_0x137644){if(_0x137644[_0xedde('0xfb')]&&this[_0xedde('0x19')][_0x137644[_0xedde('0xfb')]]){ut[_0xedde('0x13d')](_0x137644,this[_0xedde('0x19')][_0x137644[_0xedde('0xfb')]][_0xedde('0x29')],this[_0xedde('0x19')][_0x137644['lookAgent']]['id']);}var _0x5336df=_[_0xedde('0x13e')](_0x137644);_0x5336df[_0xedde('0xa3')]=moment()[_0xedde('0x53')](_0xedde('0x80'));var _0x2b9928=_0x179f84[_0xedde('0x17')][_0x137644['queue']];if(ut[_0xedde('0x13f')](_0x1a1c03[_0xedde('0x140')])){if(_0x137644[_0xedde('0xcb')]){rpcDb[_0xedde('0x10f')](_0x137644[_0xedde('0xff')]);}if(_0x137644[_0xedde('0xbe')]){rpcDb[_0xedde('0x110')](_0x137644[_0xedde('0xff')]);}ami[_0xedde('0x27')]('custom:agentringnoanswer',ut['buildObj'](_0x137644,'rejected',this[_0xedde('0x17')][_0x137644['queue']]));this[_0xedde('0xe7')](_0x5336df,_0x2b9928,_0x1a1c03);}else{_0x137644[_0xedde('0x7f')]=moment()[_0xedde('0x53')](_0xedde('0x80'));ut['logAgent'](_0x5336df,0x4,_0xedde('0x141'));rpcDb['createAgentHistory'](_0x5336df,_0xedde('0x142'));}}};Preview['prototype'][_0xedde('0x1e')]=function(_0x4b40c8){var _0x351ca6=this;var _0xa35e5b=this['actions'][_0x4b40c8[_0xedde('0xa1')]];var _0x374246;if(_0xa35e5b){_0x374246=this[_0xedde('0x17')][_0xa35e5b[_0xedde('0x70')]];logger['info'](_0xedde('0x143'),_0x4b40c8['linkedid'],_0xedde('0xa7'),_0x374246[_0xedde('0x29')],'pTalking:\x20',_0x374246[_0xedde('0x57')]);}if(this[_0xedde('0x18')][_0x4b40c8[_0xedde('0xa1')]]&&_0x4b40c8['linkedid']!==_0x4b40c8[_0xedde('0xa6')]){if(_0x4b40c8[_0xedde('0x144')]==='16'&&this[_0xedde('0x18')][_0x4b40c8[_0xedde('0xa1')]][_0xedde('0x71')]){this['callProgressDetectingCustomer'](_0x4b40c8,_0x4b40c8[_0xedde('0xa1')],_0x4b40c8[_0xedde('0x144')]);}else if(this[_0xedde('0x18')][_0x4b40c8[_0xedde('0xa1')]][_0xedde('0x71')]){logger[_0xedde('0x51')](_0xedde('0x145'),_0x4b40c8[_0xedde('0xa1')],_0x4b40c8['cause'],_0xedde('0xa7'),_0x374246['name'],'pTalking:\x20',_0x374246[_0xedde('0x57')]);this[_0xedde('0x93')](_0x4b40c8,_0x4b40c8['linkedid'],_0x4b40c8[_0xedde('0x144')]);}}else if(_0xa35e5b&&_['isNil'](_0xa35e5b[_0xedde('0x146')])&&_0x374246[_0xedde('0x147')]&&_0x4b40c8[_0xedde('0xa1')]===_0x4b40c8[_0xedde('0xa6')]&&_[_0xedde('0x7b')](_0x4b40c8[_0xedde('0xea')])&&_0x4b40c8[_0xedde('0x144')]==='16'&&_0x4b40c8[_0xedde('0x148')]==='6'&&_[_0xedde('0xe8')](_0xa35e5b[_0xedde('0x149')])){if(_0xa35e5b[_0xedde('0xcb')]){rpcDb[_0xedde('0x10f')](_0xa35e5b[_0xedde('0xff')]);}if(_0xa35e5b['activeContact']){rpcDb[_0xedde('0x110')](_0xa35e5b['idContact']);}_0x4b40c8[_0xedde('0xea')]='22';this[_0xedde('0xe7')](_0xa35e5b,_0x374246,_0x4b40c8);}else if(_0xa35e5b&&_0xa35e5b[_0xedde('0x149')]){if(_0x4b40c8[_0xedde('0x144')]==='16'&&this[_0xedde('0x18')][_0x4b40c8[_0xedde('0xa1')]][_0xedde('0x71')]){logger[_0xedde('0x51')](_0xedde('0x14a'),_0x4b40c8['linkedid'],_0x4b40c8[_0xedde('0x144')],_0xedde('0xa7'),_0x374246[_0xedde('0x29')],'pTalking:\x20',_0x374246[_0xedde('0x57')]);this[_0xedde('0x93')](_0x4b40c8,_0x4b40c8[_0xedde('0xa1')],_0x4b40c8['cause']);}else if(this[_0xedde('0x18')][_0x4b40c8['linkedid']][_0xedde('0x71')]){logger[_0xedde('0x51')]('[syncHangup][talking][cause]',_0x4b40c8[_0xedde('0xa1')],_0x4b40c8[_0xedde('0x144')],'\x20Queue',_0x374246[_0xedde('0x29')],_0xedde('0x68'),_0x374246[_0xedde('0x57')]);this[_0xedde('0x93')](_0x4b40c8,_0x4b40c8[_0xedde('0xa1')],_0x4b40c8[_0xedde('0x144')]);}}};Preview[_0xedde('0x12')][_0xedde('0x21')]=function(_0x17c979){if(this['actions'][_0x17c979[_0xedde('0xe6')]]&&_0x17c979['destlinkedid']!==_0x17c979[_0xedde('0x14b')]){this[_0xedde('0x93')](_0x17c979,_0x17c979[_0xedde('0xe6')],_0x17c979['dialstatus']);}};Preview[_0xedde('0x12')][_0xedde('0x1f')]=function(_0x3a1027){if(this[_0xedde('0x18')][_0x3a1027['linkedid']]&&_0x3a1027[_0xedde('0xa1')]!==_0x3a1027['uniqueid']&&!this[_0xedde('0x18')][_0x3a1027['linkedid']][_0xedde('0x71')]){if(_0x3a1027['cause']==='1'){this[_0xedde('0x93')](_0x3a1027,_0x3a1027[_0xedde('0xa1')],_0x3a1027['cause']);}}};Preview[_0xedde('0x12')]['addVariable']=function(_0x5f582b,_0x56d394,_0x34cf38){if(this[_0xedde('0x18')][_0x5f582b]){if(_[_0xedde('0x7b')](this[_0xedde('0x18')][_0x5f582b][_0xedde('0x14c')])){this[_0xedde('0x18')][_0x5f582b][_0xedde('0x14c')]={};}this['actions'][_0x5f582b][_0xedde('0x14c')][_0x56d394]=_0x34cf38;}};Preview[_0xedde('0x12')]['syncVarSet']=function(_0xd4a797){try{if(!_['isNil'](_0xd4a797)){if(ut[_0xedde('0x14d')](_[_0xedde('0x14e')](_0xd4a797['variable'])[0x0])){this['addVariable'](_0xd4a797['uniqueid'],_[_0xedde('0x14e')](_0xd4a797[_0xedde('0x14f')])[0x0],_0xd4a797['value']);}}}catch(_0x3bd3d8){logger[_0xedde('0x150')](_0xedde('0x151'),util[_0xedde('0x152')](_0x3bd3d8,{'showHidden':![],'depth':null}));}};Preview[_0xedde('0x12')][_0xedde('0x153')]=function(_0x1ea9e3){if(_0x1ea9e3){if(this['actions'][_0x1ea9e3[_0xedde('0x154')]]){this[_0xedde('0x18')][_0x1ea9e3[_0xedde('0x154')]][_0xedde('0x149')]=!![];}}};Preview['prototype']['syncBlindTransfer']=function(_0x2cae9d){if(_0x2cae9d){if(this[_0xedde('0x18')][_0x2cae9d[_0xedde('0x155')]]){this[_0xedde('0x18')][_0x2cae9d[_0xedde('0x155')]][_0xedde('0x149')]=!![];}}};module[_0xedde('0x156')]=Preview; \ No newline at end of file +var _0x43ed=['talktime','custom:agentbusy','[callProgressDetectingCustomer][logBusy]','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','dialBusyRetryFrequency','unlockAgent','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','countcongestionretry','[callProgressDetectingCustomer][logCongestion]','dialCongestionMaxRetry','CANCEL','outboundRejectCallsDay','AgentReject','agentreject','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','dialAgentRejectMaxRetry','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedRetryFrequency','countmachineretry','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','linkedid','cause-txt','custom:amd','[callProgressDetectingCustomer][machine]','[default]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','logAgent','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[originated][decrement][callProgressDetectingAgent]','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','unmonitored','execRun','unlock','recallme','validateContact','isValid','Contact.phone','checkInBlack','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','dialOriginateCallerIdName','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','merge','toLowerVariables','variablesAction','destconnectedlinenum','calleridnum','user:%s','user:agentconnect','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','transfer','[syncHangup][talking][transfer]','syncDialEnd','addVariable','variables','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','bluebird','moment','ioredis','../../../config/environment','../../../config/logger','preview','../ami','./rpcDb','./action','./util/util','redis','defaults','prototype','finally','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','syncOriginateResponse','hangup','syncHangup','bind','hanguprequest','syncHangupRequest','dialend','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','strategy','answered','available','pTalking','sumBillable','sumHoldTime','talking','total','unmanaged','waiting','dialActive','dialMethod','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','erlangCalls','erlangCallToSecond','erlangBusyFactor','startProgressive','Trunk','callerid','Interval','stringify','md5','format','voice:queue:%s','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_presence:remove','sendMessageOneNotActive','originated','paused','message','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','booked','hasOwnProperty','recallMe','sequence','enqueue','isNil','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','clearZombieChannel','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','RecallInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','setMessage','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','NOT_ACTIVE','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','logCustomer','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','activeContact','ANSWER','responsetime','answertime','uniqueid','\x20Queue','connect','buildAcw','custom:agentcomplete','complete','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration'];(function(_0x3f7d24,_0x3ce1d5){var _0x143f6e=function(_0x4689be){while(--_0x4689be){_0x3f7d24['push'](_0x3f7d24['shift']());}};_0x143f6e(++_0x3ce1d5);}(_0x43ed,0x92));var _0xd43e=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x43ed[_0x5d4607];return _0x5e4a86;};'use strict';var util=require(_0xd43e('0x0'));var _=require('lodash');var BPromise=require(_0xd43e('0x1'));var uuid=require('uuid');var moment=require(_0xd43e('0x2'));var md5=require('md5');var Redis=require(_0xd43e('0x3'));var config=require(_0xd43e('0x4'));var logger=require(_0xd43e('0x5'))(_0xd43e('0x6'));var loggerAction=require(_0xd43e('0x5'))('actionPreview');var ami=require(_0xd43e('0x7'));var rpcDb=require(_0xd43e('0x8'));var Action=require(_0xd43e('0x9'));var ut=require(_0xd43e('0xa'));config[_0xd43e('0xb')]=_[_0xd43e('0xc')](config[_0xd43e('0xb')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd43e('0xb')]));var Sequence=function(){};Sequence[_0xd43e('0xd')]['enqueue']=function(_0x186c57){this['tail']=this['tail']?this['tail'][_0xd43e('0xe')](_0x186c57):_0x186c57();};function Preview(_0x4c8edd){this['sequence']=new Sequence();this[_0xd43e('0xf')]=_0x4c8edd[_0xd43e('0x10')];this[_0xd43e('0x11')]=_0x4c8edd[_0xd43e('0x11')];this[_0xd43e('0x12')]={};this[_0xd43e('0x13')]=_0x4c8edd['agents'];this[_0xd43e('0x14')]=0x0;ami['on']('originateresponse',this[_0xd43e('0x15')]['bind'](this));ami['on'](_0xd43e('0x16'),this[_0xd43e('0x17')][_0xd43e('0x18')](this));ami['on'](_0xd43e('0x19'),this[_0xd43e('0x1a')][_0xd43e('0x18')](this));ami['on'](_0xd43e('0x1b'),this['syncDialEnd'][_0xd43e('0x18')](this));ami['on'](_0xd43e('0x1c'),this[_0xd43e('0x1d')][_0xd43e('0x18')](this));ami['on'](_0xd43e('0x1e'),this[_0xd43e('0x1f')][_0xd43e('0x18')](this));ami['on'](_0xd43e('0x20'),this[_0xd43e('0x21')][_0xd43e('0x18')](this));ami['on'](_0xd43e('0x22'),this[_0xd43e('0x23')]['bind'](this));this[_0xd43e('0x24')](this[_0xd43e('0xf')]);}function emit(_0x611285,_0x5162f7,_0x72ea78){io['to'](_0x611285)[_0xd43e('0x25')](_0x5162f7,_0x72ea78);}function emitCampaignPreview(_0x3b6fbf){if(_0x3b6fbf[_0xd43e('0x26')]===_0xd43e('0x27')){var _0x5565ef={'id':_0x3b6fbf['id'],'name':_0x3b6fbf[_0xd43e('0x28')],'strategy':_0x3b6fbf[_0xd43e('0x29')],'answered':_0x3b6fbf[_0xd43e('0x2a')],'available':_0x3b6fbf[_0xd43e('0x2b')],'loggedIn':_0x3b6fbf['loggedIn'],'pTalking':_0x3b6fbf[_0xd43e('0x2c')],'sumBillable':_0x3b6fbf[_0xd43e('0x2d')],'sumDuration':_0x3b6fbf['sumDuration'],'sumHoldTime':_0x3b6fbf[_0xd43e('0x2e')]||0x0,'talking':_0x3b6fbf[_0xd43e('0x2f')],'total':_0x3b6fbf[_0xd43e('0x30')],'type':_0x3b6fbf[_0xd43e('0x26')],'unmanaged':_0x3b6fbf[_0xd43e('0x31')],'abandoned':_0x3b6fbf['abandoned'],'waiting':_0x3b6fbf[_0xd43e('0x32')],'loggedInDb':_0x3b6fbf['loggedInDb'],'dialActive':_0x3b6fbf[_0xd43e('0x33')],'dialMethod':_0x3b6fbf[_0xd43e('0x34')],'dialOriginateCallerIdName':_0x3b6fbf['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x3b6fbf[_0xd43e('0x35')],'dialOriginateTimeout':_0x3b6fbf['dialOriginateTimeout'],'dialPrefix':_0x3b6fbf[_0xd43e('0x36')],'outboundAnswerAgiCallsDay':_0x3b6fbf[_0xd43e('0x37')],'outboundAnswerCallsDay':_0x3b6fbf[_0xd43e('0x38')],'outboundBlacklistCallsDay':_0x3b6fbf['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x3b6fbf[_0xd43e('0x39')],'outboundCongestionCallsDay':_0x3b6fbf[_0xd43e('0x3a')],'outboundDropCallsDayACS':_0x3b6fbf[_0xd43e('0x3b')],'outboundDropCallsDayCallersExit':_0x3b6fbf[_0xd43e('0x3c')],'outboundDropCallsDayTimeout':_0x3b6fbf[_0xd43e('0x3d')],'outboundNoAnswerCallsDay':_0x3b6fbf['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x3b6fbf[_0xd43e('0x3e')],'outboundOriginateFailureCallsDay':_0x3b6fbf[_0xd43e('0x3f')],'outboundReCallsDay':_0x3b6fbf[_0xd43e('0x40')],'outboundRejectCallsDay':_0x3b6fbf['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x3b6fbf[_0xd43e('0x41')],'outboundAbandonedCallsDay':_0x3b6fbf[_0xd43e('0x42')],'predictiveIntervalAnsweredCalls':_0x3b6fbf['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x3b6fbf['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x3b6fbf['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x3b6fbf[_0xd43e('0x43')],'predictiveIntervalDroppedCallsTimeout':_0x3b6fbf[_0xd43e('0x44')],'predictiveIntervalErlangCalls':_0x3b6fbf[_0xd43e('0x45')],'predictiveIntervalErlangCallsDroppedCalls':_0x3b6fbf[_0xd43e('0x46')],'predictiveIntervalHitRate':_0x3b6fbf[_0xd43e('0x47')],'predictiveIntervalMultiplicativeFactor':_0x3b6fbf[_0xd43e('0x48')],'predictiveIntervalPauses':_0x3b6fbf[_0xd43e('0x49')],'predictiveIntervalAvailable':_0x3b6fbf[_0xd43e('0x4a')],'predictiveIntervalTotalCalls':_0x3b6fbf['predictiveIntervalTotalCalls'],'message':_0x3b6fbf['message'],'originated':_0x3b6fbf['originated'],'erlangCalls':_0x3b6fbf[_0xd43e('0x4b')],'erlangCallToSecond':_0x3b6fbf[_0xd43e('0x4c')],'erlangAbandonmentRate':_0x3b6fbf['erlangAbandonmentRate'],'erlangBusyFactor':_0x3b6fbf[_0xd43e('0x4d')],'startPredictive':_0x3b6fbf['startPredictive'],'startProgressive':_0x3b6fbf[_0xd43e('0x4e')]};if(_0x3b6fbf[_0xd43e('0x4f')]){_0x5565ef[_0xd43e('0x4f')]={'id':_0x3b6fbf[_0xd43e('0x4f')]['id'],'name':_0x3b6fbf[_0xd43e('0x4f')]['name'],'active':_0x3b6fbf[_0xd43e('0x4f')]['active'],'callerid':_0x3b6fbf['Trunk'][_0xd43e('0x50')]};}if(_0x3b6fbf[_0xd43e('0x51')]){_0x5565ef[_0xd43e('0x51')]={'id':_0x3b6fbf[_0xd43e('0x51')]['id'],'name':_0x3b6fbf['Interval'][_0xd43e('0x28')]};}var _0x4e8902=md5(JSON[_0xd43e('0x52')](_0x5565ef));if(_0x3b6fbf[_0xd43e('0x53')]!==_0x4e8902){_0x3b6fbf[_0xd43e('0x53')]=_0x4e8902;emit(util[_0xd43e('0x54')](_0xd43e('0x55'),_0x5565ef[_0xd43e('0x28')]),'voice_queue:save',_0x5565ef);}}}function emitVoiceQueueChannelRemove(_0x8eb48d){logger[_0xd43e('0x56')](_0xd43e('0x57'),JSON[_0xd43e('0x52')](_0x8eb48d));emit(util[_0xd43e('0x54')](_0xd43e('0x55'),_0x8eb48d[_0xd43e('0x28')]),'voice_queue_channel:remove',_0x8eb48d);io['emit'](_0xd43e('0x58'),_0x8eb48d);}function notSendMessagesQueue(_0x4693fd){if(_0x4693fd[_0xd43e('0x59')]){if(_0x4693fd[_0xd43e('0x5a')]===0x0&&_0x4693fd[_0xd43e('0x2c')]===0x0){_0x4693fd[_0xd43e('0x59')]=![];_0x4693fd[_0xd43e('0x2b')]=0x0;_0x4693fd[_0xd43e('0x5b')]=0x0;_0x4693fd[_0xd43e('0x5c')]='NOT_ACTIVE';ut[_0xd43e('0x5d')](_0xd43e('0x5e'),_0x4693fd[_0xd43e('0x28')]+_0xd43e('0x5f'));}else{_0x4693fd[_0xd43e('0x5c')]=_0xd43e('0x60');ut[_0xd43e('0x5d')](_0xd43e('0x5e'),_0x4693fd['name']+_0xd43e('0x61'));}emitCampaignPreview(_0x4693fd);}}Preview[_0xd43e('0xd')][_0xd43e('0x24')]=function(){var _0x332617=this;setInterval(function(){_0x332617[_0xd43e('0x62')]();},0x7cf);};Preview['prototype'][_0xd43e('0x62')]=function(){var _0x4f4fa1=this[_0xd43e('0xf')];this['clockClearZombieChannels']+=0x1;for(var _0x255ab3 in _0x4f4fa1){if(_0x4f4fa1['hasOwnProperty'](_0x255ab3)&&(_0x4f4fa1[_0x255ab3][_0xd43e('0x34')]===_0xd43e('0x6')||_0x4f4fa1[_0x255ab3]['dialMethod']===_0xd43e('0x63'))&&_0x4f4fa1[_0x255ab3][_0xd43e('0x26')]===_0xd43e('0x27')){if(this[_0xd43e('0x14')]>0x7){this[_0xd43e('0x14')]=0x0;this['clearZombieChannels']();}}if(_0x4f4fa1[_0xd43e('0x64')](_0x255ab3)&&_0x4f4fa1[_0x255ab3]['dialMethod']===_0xd43e('0x6')&&_0x4f4fa1[_0x255ab3][_0xd43e('0x26')]===_0xd43e('0x27')){if(_0x4f4fa1[_0x255ab3]['dialActive']){this['setMessage'](_0x4f4fa1[_0x255ab3]);this[_0xd43e('0x65')](_0x4f4fa1[_0x255ab3]);}else{notSendMessagesQueue(_0x4f4fa1[_0x255ab3]);}}}};Preview[_0xd43e('0xd')]['clearZombieChannel']=function(_0x387dd9){var _0x3949cf=this;this[_0xd43e('0x66')][_0xd43e('0x67')](function(){if(!_[_0xd43e('0x68')](_0x3949cf[_0xd43e('0x12')][_0x387dd9])){loggerAction[_0xd43e('0x56')]('[clearZombieChannels][talking]',_0x387dd9,_0xd43e('0x69'),_0x3949cf[_0xd43e('0x12')][_0x387dd9][_0xd43e('0x6a')],_0xd43e('0x6b'),JSON[_0xd43e('0x52')](_0x3949cf[_0xd43e('0xf')][_0x3949cf[_0xd43e('0x12')][_0x387dd9][_0xd43e('0x6a')]][_0xd43e('0x5a')]),_0xd43e('0x6c'),JSON['stringify'](_0x3949cf[_0xd43e('0xf')][_0x3949cf[_0xd43e('0x12')][_0x387dd9][_0xd43e('0x6a')]]['pTalking']),JSON[_0xd43e('0x52')](_0x3949cf['actions'][_0x387dd9][_0xd43e('0x6d')]),JSON[_0xd43e('0x52')](_[_0xd43e('0x6e')](_0x3949cf[_0xd43e('0x12')][_0x387dd9],[_0xd43e('0x6f'),_0xd43e('0x70'),_0xd43e('0x71'),_0xd43e('0x72')])));return ami[_0xd43e('0x73')]({'action':_0xd43e('0x74'),'channel':_0x3949cf['actions'][_0x387dd9][_0xd43e('0x75')]})[_0xd43e('0x76')](function(_0x55c6e5){if(_0x55c6e5['message']===_0xd43e('0x77')){setTimeout(function(){if(_0x3949cf[_0xd43e('0x12')][_0x387dd9]){ut['updateOriginated'](_0x3949cf[_0xd43e('0xf')][_0x3949cf['actions'][_0x387dd9][_0xd43e('0x6a')]],_0xd43e('0x78'));if(_0x3949cf[_0xd43e('0x12')][_0x387dd9][_0xd43e('0x6d')]===!![]){ut[_0xd43e('0x79')](_0x3949cf[_0xd43e('0xf')][_0x3949cf[_0xd43e('0x12')][_0x387dd9]['queue']],'[clearZombieChannel]');ut[_0xd43e('0x7a')](_0xd43e('0x7b')+_0x387dd9,_0x3949cf[_0xd43e('0x12')][_0x387dd9][_0xd43e('0x6a')]);}ut['loggerError'](_0xd43e('0x7c')+_0x387dd9,_0x3949cf['actions'][_0x387dd9][_0xd43e('0x6a')]);delete _0x3949cf['actions'][_0x387dd9];}},0x2328);}});}});};Preview[_0xd43e('0xd')][_0xd43e('0x7d')]=function(){var _0x4e0f2a=this;loggerAction[_0xd43e('0x56')]('[action]',_['size'](this[_0xd43e('0x12')]));for(var _0x133c9f in this[_0xd43e('0x12')]){if(_0x4e0f2a['actions'][_0xd43e('0x64')](_0x133c9f)){_0x4e0f2a[_0xd43e('0x7e')](_0x133c9f);}}};Preview['prototype'][_0xd43e('0x65')]=function(_0x5e76c5){var _0x2bbd41=this;rpcDb[_0xd43e('0x7f')](_0x5e76c5['id'],ut[_0xd43e('0x80')](this[_0xd43e('0x13')]))[_0xd43e('0x81')](function(_0x2d5272){if(!_['isNil'](_0x2d5272)){for(var _0x437701=0x0;_0x437701<_0x2d5272[_0xd43e('0x82')];_0x437701+=0x1){if(ut[_0xd43e('0x83')](_0x2d5272[_0x437701][_0xd43e('0x84')])<_0x5e76c5[_0xd43e('0x85')]*0x3c){if(_0x2d5272[_0x437701][_0xd43e('0x86')]&&!_0x2d5272[_0x437701][_0xd43e('0x86')][_0xd43e('0x87')]){_0x2bbd41[_0xd43e('0x88')](_0x2d5272[_0x437701]['id'])[_0xd43e('0x81')](ut[_0xd43e('0x89')](_0xd43e('0x8a')))[_0xd43e('0x76')](ut[_0xd43e('0x89')]('[RecallMe]'));}else{rpcDb[_0xd43e('0x8b')](_0x2d5272[_0x437701]['id']);}}else{var _0x172c58=new Action(_0x2d5272[_0x437701],_0x5e76c5);_0x172c58[_0xd43e('0x8c')]=moment()['format'](_0xd43e('0x8d'));_0x5e76c5[_0xd43e('0x40')]+=0x1;ut['logCustomer'](_0x172c58,0x17,_0xd43e('0x8e'));if(_0x5e76c5['dialRecallInQueue']){rpcDb['rescheduleContactInQueue'](ut[_0xd43e('0x8f')](_0x2d5272[_0x437701]));rpcDb[_0xd43e('0x90')](_0x172c58,_0xd43e('0x91'));}else{ut['logCustomer'](_0x172c58,0x16,_0xd43e('0x92'));rpcDb[_0xd43e('0x90')](_0x172c58,'[HistoryRecallClose]');rpcDb[_0xd43e('0x93')](_0x172c58,_0xd43e('0x94'));}}}}})['catch'](ut['logger2'](_0xd43e('0x95')));};Preview[_0xd43e('0xd')][_0xd43e('0x96')]=function(_0x49b501){_0x49b501[_0xd43e('0x59')]=!![];if(ut[_0xd43e('0x97')](_0x49b501['loggedIn'])){_0x49b501[_0xd43e('0x5c')]=_0xd43e('0x98');}else if(!ut[_0xd43e('0x99')](_0x49b501[_0xd43e('0x33')])){_0x49b501[_0xd43e('0x5c')]=_0xd43e('0x9a');}else if(!this['isTrunkReachable'](_0x49b501[_0xd43e('0x4f')])){if(!this[_0xd43e('0x9b')](_0x49b501[_0xd43e('0x9c')])){_0x49b501[_0xd43e('0x5c')]='TRUNK_IS_NOT_REACHABLE';}else{_0x49b501[_0xd43e('0x5c')]=_0xd43e('0x9d');}}else{_0x49b501[_0xd43e('0x5c')]='ACTIVE';}emitCampaignPreview(_0x49b501);};Preview[_0xd43e('0xd')][_0xd43e('0x9e')]=function(_0x5748d9,_0x30c232,_0x20c09f){var _0x5bb696=this;var _0x263de1=this[_0xd43e('0x12')][_0x30c232];var _0x20ebfa=this[_0xd43e('0xf')][_0x263de1[_0xd43e('0x6a')]];var _0x5f558e;if(_0x20ebfa){switch(_0x20c09f){case'1':_0x20ebfa['outboundNoSuchCallsDay']+=0x1;_0x263de1[_0xd43e('0x9f')]+=0x1;_0x263de1[_0xd43e('0xa0')]=ut[_0xd43e('0xa1')](_0x263de1);ut[_0xd43e('0xa2')](_0x263de1,0x0,_0xd43e('0xa3'));ami['emit'](_0xd43e('0xa4'),ut[_0xd43e('0xa5')](_0x263de1,_0xd43e('0xa6')));rpcDb[_0xd43e('0x90')](_0x263de1,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0xd43e('0xa1')](_0x263de1)>=_0x20ebfa[_0xd43e('0xa7')]){_0x5f558e=ut['cloneAction'](_0x263de1,0xf,_0xd43e('0xa8'));rpcDb[_0xd43e('0x93')](_0x5f558e,_0xd43e('0xa9'));}else{if(_0x263de1[_0xd43e('0x9f')]>=_0x20ebfa[_0xd43e('0xaa')]){rpcDb['createCustomerFinal'](_0x263de1,_0xd43e('0xa9'));}else{rpcDb[_0xd43e('0xab')](ut[_0xd43e('0xac')](_0x263de1,_0xd43e('0x9f'),_0x20ebfa[_0xd43e('0xad')]),_0x263de1['unlockAgent'],_0x263de1[_0xd43e('0xae')]);}}delete this['actions'][_0x5748d9['linkedid']];break;case _0xd43e('0xaf'):var _0x8beb35=moment()[_0xd43e('0x54')](_0xd43e('0x8d'));_0x263de1[_0xd43e('0xb0')]=_0x8beb35;_0x263de1[_0xd43e('0xb1')]=_0x8beb35;_0x263de1[_0xd43e('0x6d')]=!![];_0x20ebfa['pTalking']+=0x1;logger['info']('[syncHangup][talking][increment]',_0x263de1[_0xd43e('0xb2')],_0xd43e('0xb3'),_0x20ebfa[_0xd43e('0x28')],_0xd43e('0x6c'),_0x20ebfa[_0xd43e('0x2c')]);ami[_0xd43e('0x25')]('custom:agentconnect',ut[_0xd43e('0xa5')](_0x263de1,_0xd43e('0xb4'),this['campaignsPreview'][_0x263de1[_0xd43e('0x6a')]]));if(_0x20ebfa['acw']){ami['emit']('custom:agentConnectPreview',ut[_0xd43e('0xb5')](_0x263de1));}break;case'16':ami[_0xd43e('0x25')](_0xd43e('0xb6'),ut[_0xd43e('0xa5')](_0x263de1,_0xd43e('0xb7'),this[_0xd43e('0xf')][_0x263de1['queue']]));emitVoiceQueueChannelRemove(ut[_0xd43e('0xa5')](_0x263de1,_0xd43e('0xb7')));_0x20ebfa['outboundAnswerCallsDay']+=0x1;_0x20ebfa[_0xd43e('0x30')]+=0x1;_0x20ebfa[_0xd43e('0x2a')]+=0x1;ut[_0xd43e('0x79')](_0x20ebfa,'[16]');_0x263de1['countglobal']=ut[_0xd43e('0xa1')](_0x263de1);ut[_0xd43e('0xa2')](_0x263de1,0x4,_0xd43e('0xb8'));rpcDb[_0xd43e('0x90')](_0x263de1,_0xd43e('0xb9'));rpcDb[_0xd43e('0x93')](_0x263de1,_0xd43e('0xba'));rpcDb[_0xd43e('0xbb')](_0x263de1);_0x20ebfa[_0xd43e('0xbc')]+=_0x263de1[_0xd43e('0xbd')];_0x20ebfa[_0xd43e('0x2d')]+=_0x263de1[_0xd43e('0xbd')];logger['info']('[syncHangup][talking][decrement]',_0x263de1[_0xd43e('0xb2')],_0xd43e('0xb3'),_0x20ebfa[_0xd43e('0x28')],_0xd43e('0x6c'),_0x20ebfa[_0xd43e('0x2c')]);delete this[_0xd43e('0x12')][_0x5748d9['linkedid']];break;case'BUSY':_0x20ebfa[_0xd43e('0x39')]+=0x1;_0x263de1['countbusyretry']+=0x1;_0x263de1['countglobal']=ut[_0xd43e('0xa1')](_0x263de1);ut[_0xd43e('0xa2')](_0x263de1,0x5,'Busy');ami[_0xd43e('0x25')](_0xd43e('0xbe'),ut['buildObj'](_0x263de1,'busy'));rpcDb[_0xd43e('0x90')](_0x263de1,_0xd43e('0xbf'));if(ut[_0xd43e('0xa1')](_0x263de1)>=_0x20ebfa[_0xd43e('0xa7')]){_0x5f558e=ut[_0xd43e('0xc0')](_0x263de1,0xf,_0xd43e('0xa8'));rpcDb[_0xd43e('0x93')](_0x5f558e,_0xd43e('0xc1'));}else{if(_0x263de1[_0xd43e('0xc2')]>=_0x20ebfa['dialBusyMaxRetry']){rpcDb[_0xd43e('0x93')](_0x263de1,_0xd43e('0xbf'));}else{rpcDb[_0xd43e('0xab')](ut['scheduledAt'](_0x263de1,_0xd43e('0xc2'),_0x20ebfa[_0xd43e('0xc3')]),_0x263de1[_0xd43e('0xc4')],_0x263de1[_0xd43e('0xae')]);}}break;case _0xd43e('0xc5'):_0x20ebfa[_0xd43e('0xc6')]+=0x1;_0x263de1[_0xd43e('0xc7')]+=0x1;_0x263de1[_0xd43e('0xa0')]=ut[_0xd43e('0xa1')](_0x263de1);ut[_0xd43e('0xa2')](_0x263de1,0x3,'NoAnswer');ami['emit'](_0xd43e('0xc8'),ut['buildObj'](_0x263de1,'noanswer'));rpcDb[_0xd43e('0x90')](_0x263de1,_0xd43e('0xc9'));if(ut['totalGlobal'](_0x263de1)>=_0x20ebfa[_0xd43e('0xa7')]){_0x5f558e=ut[_0xd43e('0xc0')](_0x263de1,0xf,_0xd43e('0xa8'));rpcDb[_0xd43e('0x93')](_0x5f558e,_0xd43e('0xca'));}else{if(_0x263de1[_0xd43e('0xc7')]>=_0x20ebfa[_0xd43e('0xcb')]){rpcDb[_0xd43e('0x93')](_0x263de1,_0xd43e('0xc9'));}else{rpcDb[_0xd43e('0xab')](ut[_0xd43e('0xac')](_0x263de1,_0xd43e('0xc7'),_0x20ebfa['dialNoAnswerRetryFrequency']),_0x263de1['unlockAgent'],_0x263de1[_0xd43e('0xae')]);}}break;case'CONGESTION':_0x20ebfa[_0xd43e('0x3a')]+=0x1;_0x263de1[_0xd43e('0xcc')]+=0x1;_0x263de1[_0xd43e('0xa0')]=ut[_0xd43e('0xa1')](_0x263de1);ut[_0xd43e('0xa2')](_0x263de1,0x8,'Congestion');ami[_0xd43e('0x25')]('custom:agentcongestion',ut['buildObj'](_0x263de1,'congestion'));rpcDb[_0xd43e('0x90')](_0x263de1,_0xd43e('0xcd'));if(ut[_0xd43e('0xa1')](_0x263de1)>=_0x20ebfa['dialGlobalMaxRetry']){_0x5f558e=ut[_0xd43e('0xc0')](_0x263de1,0xf,_0xd43e('0xa8'));rpcDb[_0xd43e('0x93')](_0x5f558e,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x263de1[_0xd43e('0xcc')]>=_0x20ebfa[_0xd43e('0xce')]){rpcDb[_0xd43e('0x93')](_0x263de1,_0xd43e('0xcd'));}else{rpcDb[_0xd43e('0xab')](ut[_0xd43e('0xac')](_0x263de1,_0xd43e('0xcc'),_0x20ebfa[_0xd43e('0xc3')]),_0x263de1[_0xd43e('0xc4')],_0x263de1[_0xd43e('0xae')]);}}break;case _0xd43e('0xcf'):_0x20ebfa[_0xd43e('0xd0')]+=0x1;_0x263de1['countagentrejectretry']+=0x1;_0x263de1[_0xd43e('0xa0')]=ut[_0xd43e('0xa1')](_0x263de1);ut[_0xd43e('0xa2')](_0x263de1,0x14,_0xd43e('0xd1'));ami[_0xd43e('0x25')]('custom:agentreject',ut['buildObj'](_0x263de1,_0xd43e('0xd2')));rpcDb[_0xd43e('0x90')](_0x263de1,'[syncHangupRequest][logAgentReject]');if(ut[_0xd43e('0xa1')](_0x263de1)>=_0x20ebfa[_0xd43e('0xa7')]){_0x5f558e=ut[_0xd43e('0xc0')](_0x263de1,0x14,'AgentReject');rpcDb['createCustomerFinal'](_0x5f558e,_0xd43e('0xd3'));}else{if(_0x263de1[_0xd43e('0xd4')]>=_0x20ebfa[_0xd43e('0xd5')]){rpcDb[_0xd43e('0x93')](_0x263de1,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0xd43e('0xab')](ut[_0xd43e('0xac')](_0x263de1,'countagentrejectretry',_0x20ebfa['dialAgentRejectRetryFrequency']),_0x263de1[_0xd43e('0xc4')],_0x263de1['activeContact']);}}break;case _0xd43e('0xd6'):_0x20ebfa[_0xd43e('0x42')]+=0x1;_0x263de1[_0xd43e('0xd7')]+=0x1;_0x263de1[_0xd43e('0xa0')]=ut[_0xd43e('0xa1')](_0x263de1);ut[_0xd43e('0xa2')](_0x263de1,0xb,_0xd43e('0xd8'));rpcDb[_0xd43e('0x90')](_0x263de1,_0xd43e('0xd9'));if(ut[_0xd43e('0xa1')](_0x263de1)>=_0x20ebfa[_0xd43e('0xa7')]){_0x5f558e=ut[_0xd43e('0xc0')](_0x263de1,0xf,'Global');rpcDb[_0xd43e('0x93')](_0x5f558e,_0xd43e('0xd9'));}else{if(_0x263de1[_0xd43e('0xda')]>=_0x20ebfa['dialAbandonedMaxRety']){rpcDb[_0xd43e('0x93')](_0x263de1,_0xd43e('0xd9'));}else{rpcDb[_0xd43e('0xab')](ut['scheduledAt'](_0x263de1,_0xd43e('0xd7'),_0x20ebfa[_0xd43e('0xdb')]),_0x263de1[_0xd43e('0xc4')],_0x263de1[_0xd43e('0xae')]);}}break;case'18':_0x20ebfa[_0xd43e('0x41')]+=0x1;_0x263de1[_0xd43e('0xdc')]+=0x1;_0x263de1[_0xd43e('0xa0')]=ut[_0xd43e('0xa1')](_0x263de1);ut[_0xd43e('0xa2')](_0x263de1,0x12,_0x5748d9['cause-txt']||_0x5748d9[_0xd43e('0xdd')]);ami[_0xd43e('0x25')]('custom:amd',ut[_0xd43e('0xa5')](_0x263de1,_0xd43e('0xde')));rpcDb[_0xd43e('0x90')](_0x263de1,'[callProgressDetectingCustomer][hangupInAMD]');if(ut[_0xd43e('0xa1')](_0x263de1)>=_0x20ebfa[_0xd43e('0xa7')]){_0x5f558e=ut[_0xd43e('0xc0')](_0x263de1,0xf,'Global');rpcDb[_0xd43e('0x93')](_0x5f558e,_0xd43e('0xdf'));}else{rpcDb[_0xd43e('0x93')](_0x263de1,'[callProgressDetectingCustomer][hangupInAMD]');}delete this[_0xd43e('0x12')][_0x5748d9[_0xd43e('0xe0')]];break;case'19':_0x20ebfa[_0xd43e('0x41')]+=0x1;_0x263de1['countglobal']=ut[_0xd43e('0xa1')](_0x263de1);ut['logCustomer'](_0x263de1,0x13,_0x5748d9[_0xd43e('0xe1')]||_0x5748d9[_0xd43e('0xdd')]);ami[_0xd43e('0x25')](_0xd43e('0xe2'),ut[_0xd43e('0xa5')](_0x263de1,_0xd43e('0xde')));rpcDb['createCustomerHistory'](_0x263de1,_0xd43e('0xe3'));if(ut[_0xd43e('0xa1')](_0x263de1)>=_0x20ebfa[_0xd43e('0xa7')]){_0x5f558e=ut[_0xd43e('0xc0')](_0x263de1,0xf,_0xd43e('0xa8'));rpcDb[_0xd43e('0x93')](_0x5f558e,_0xd43e('0xe3'));}else{rpcDb[_0xd43e('0x93')](_0x263de1,'[callProgressDetectingCustomer][machine]');}delete this[_0xd43e('0x12')][_0x5748d9['linkedid']];break;default:if(_0x263de1['dialAnswer']){ut['decrementTalkink'](_0x20ebfa,_0xd43e('0xe4'));ut['loggerError']('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x20ebfa[_0xd43e('0x28')],_0x5748d9);}_0x20ebfa[_0xd43e('0x41')]+=0x1;_0x263de1[_0xd43e('0xa0')]=ut[_0xd43e('0xa1')](_0x263de1);ut[_0xd43e('0xa2')](_0x263de1,0xc,_0x5748d9[_0xd43e('0xe1')]||_0x5748d9[_0xd43e('0xdd')]);rpcDb['createCustomerHistory'](_0x263de1,_0xd43e('0xe5'));if(ut['totalGlobal'](_0x263de1)>=_0x20ebfa['dialGlobalMaxRetry']){_0x5f558e=ut['cloneAction'](_0x263de1,0xf,_0xd43e('0xa8'));rpcDb[_0xd43e('0x93')](_0x5f558e,_0xd43e('0xe6'));}else{rpcDb[_0xd43e('0x93')](_0x263de1,_0xd43e('0xe6'));}delete this[_0xd43e('0x12')][_0x5748d9[_0xd43e('0xe0')]];}if(!(_0x263de1[_0xd43e('0x6d')]&&_0x20c09f==='16')){ut[_0xd43e('0xe7')](_0x20ebfa,_0xd43e('0xe8'));logger[_0xd43e('0x56')]('[originated][decrement][callProgressDetectingCustomer]',_0x263de1[_0xd43e('0xb2')],'\x20Queue',_0x20ebfa[_0xd43e('0x28')],_0xd43e('0x6b'),_0x20ebfa[_0xd43e('0x5a')]);}if(_0x20c09f!==_0xd43e('0xaf')){delete this[_0xd43e('0x12')][_0x5748d9[_0xd43e('0xe0')]];delete this[_0xd43e('0x12')][_0x5748d9[_0xd43e('0xe9')]];}}};Preview[_0xd43e('0xd')][_0xd43e('0xea')]=function(_0x1952bc,_0xa7f5ea,_0x13e034){if(_[_0xd43e('0xeb')](_0xa7f5ea)&&'object'!==typeof _0xa7f5ea){return;}if(_[_0xd43e('0xeb')](_0x13e034)&&_0xd43e('0xec')!==typeof _0x13e034){return;}switch(_0x13e034[_0xd43e('0xed')]){case'0':ut['logAgent'](_0x1952bc,0x0,_0xd43e('0xa3'));rpcDb[_0xd43e('0xee')](_0x1952bc,_0xd43e('0xef'));break;case'3':ut[_0xd43e('0xf0')](_0x1952bc,0x3,_0xd43e('0xf1'));rpcDb[_0xd43e('0xee')](_0x1952bc,_0xd43e('0xf2'));break;case'5':ut[_0xd43e('0xf0')](_0x1952bc,0x5,_0xd43e('0xf3'));rpcDb[_0xd43e('0xee')](_0x1952bc,_0xd43e('0xf4'));break;case'8':ut[_0xd43e('0xf0')](_0x1952bc,0x8,_0xd43e('0xf5'));rpcDb[_0xd43e('0xee')](_0x1952bc,_0xd43e('0xf6'));break;case'22':ut[_0xd43e('0xf0')](_0x1952bc,0x16,_0xd43e('0xf7'));rpcDb[_0xd43e('0xee')](_0x1952bc,_0xd43e('0xf8'));break;default:ut['logAgent'](_0x1952bc,0xc,_0x13e034[_0xd43e('0xed')]);rpcDb[_0xd43e('0xee')](_0x1952bc,_0xd43e('0xf6'));}ut[_0xd43e('0xe7')](_0xa7f5ea,'[callProgressDetectingAgent]');logger['info'](_0xd43e('0xf9'),_0x1952bc['uniqueid'],_0xd43e('0xb3'),_0xa7f5ea['name'],_0xd43e('0x6b'),_0xa7f5ea[_0xd43e('0x5a')]);delete this['actions'][_0x1952bc[_0xd43e('0xb2')]];};Preview[_0xd43e('0xd')]['checkInBlack']=function(_0x4be06a,_0x40a3ad,_0x518cc8,_0x3ace2d,_0x609b60){var _0x37d672=this;return new BPromise(function(_0x2e5c66,_0x176d5d){if(_[_0xd43e('0x68')](_0x40a3ad)||_['isNil'](_0x40a3ad[_0xd43e('0xfa')])||_[_0xd43e('0x68')](_0x40a3ad[_0xd43e('0xfa')][_0xd43e('0xfb')])||_[_0xd43e('0x68')](_0x40a3ad[_0xd43e('0x71')])){_0x176d5d(ut[_0xd43e('0x5c')](_0xd43e('0xfc'),_0x3ace2d,_0x609b60));return;}var _0x3ff91c=uuid['v4']();var _0x381666=_0x37d672['campaignsPreview'][_0x40a3ad['Queue'][_0xd43e('0x28')]];var _0x43feb3=_0x518cc8?_0x37d672[_0xd43e('0x13')][_0x518cc8]['id']:undefined;_0x37d672[_0xd43e('0x12')][_0x3ff91c]=new Action(_0x40a3ad,_0x381666,_0x3ff91c,_0x518cc8,_0x43feb3);var _0xcb4d7d=_0x37d672[_0xd43e('0x12')][_0x3ff91c];_0xcb4d7d[_0xd43e('0xc4')]=_0x3ace2d;_0xcb4d7d[_0xd43e('0xae')]=_0x609b60;_0xcb4d7d[_0xd43e('0xfd')]=_0x518cc8;if(_[_0xd43e('0xfe')](_0x4be06a)){_0x37d672[_0xd43e('0xff')](_0xcb4d7d,_0x381666,_0x40a3ad,_0x518cc8)[_0xd43e('0x81')](function(_0x274c3){logger[_0xd43e('0x56')](_0xd43e('0x100'),'Queue:\x20'+_0xcb4d7d[_0xd43e('0x6a')]+'\x20IdHopper:\x20'+_0xcb4d7d[_0xd43e('0x101')],JSON[_0xd43e('0x52')](_0x274c3));ami['emit'](_0xd43e('0x102'),ut[_0xd43e('0xa5')](_0xcb4d7d,_0xd43e('0x103'),_0x37d672['campaignsPreview'][_0xcb4d7d[_0xd43e('0x6a')]]));_0x2e5c66(ut[_0xd43e('0x5c')](_0xd43e('0x104')));})['catch'](function(_0x246a05){ut[_0xd43e('0x5d')](_0xd43e('0x105'),_0x246a05);_0x176d5d(ut['message'](_0xd43e('0x106'),_0x3ace2d,_0x609b60));});}else{_0x381666['outboundBlacklistCallsDay']+=0x1;ut['logBlacklist'](_0xcb4d7d);rpcDb[_0xd43e('0x107')](_0xcb4d7d,_0xd43e('0x108'));delete _0x37d672[_0xd43e('0x12')][_0x3ff91c];_0x176d5d(ut[_0xd43e('0x5c')](_0xd43e('0x109'),_0x3ace2d,_0x609b60));}});};Preview['prototype'][_0xd43e('0x9b')]=function(_0x5044fa){return!_[_0xd43e('0x68')](_0x5044fa)&&!_['isNil'](_0x5044fa['name'])&&!_[_0xd43e('0x68')](_0x5044fa[_0xd43e('0x10a')])&&_0x5044fa[_0xd43e('0x10a')]&&!_['isNil'](this['trunks'][util['format'](_0xd43e('0x10b'),_0x5044fa[_0xd43e('0x28')])])&&!_[_0xd43e('0x68')](this[_0xd43e('0x11')][util[_0xd43e('0x54')](_0xd43e('0x10b'),_0x5044fa[_0xd43e('0x28')])][_0xd43e('0x74')])&&(this[_0xd43e('0x11')][util[_0xd43e('0x54')](_0xd43e('0x10b'),_0x5044fa['name'])][_0xd43e('0x74')]==='reachable'||this[_0xd43e('0x11')][util[_0xd43e('0x54')](_0xd43e('0x10b'),_0x5044fa['name'])][_0xd43e('0x74')]===_0xd43e('0x10c'));};Preview[_0xd43e('0xd')][_0xd43e('0x88')]=function(_0x5ac9a3,_0x4b02c9){var _0x31f24e=this;return new BPromise(function(_0x45a79f,_0x13ec6e){_0x31f24e[_0xd43e('0x10d')](_0x5ac9a3,_0x4b02c9)['then'](function(_0x34be10){_0x45a79f(_[_0xd43e('0x6e')](_0x34be10,['message']));})[_0xd43e('0x76')](function(_0x3bded5){if(_0x3bded5[_0xd43e('0x10e')]){rpcDb['unlockContact'](_0x5ac9a3);}if(_0x3bded5['active']){rpcDb[_0xd43e('0x8b')](_0x5ac9a3);}_0x13ec6e(_[_0xd43e('0x6e')](_0x3bded5,[_0xd43e('0x5c')]));});});};Preview[_0xd43e('0xd')][_0xd43e('0x10d')]=function(_0x1f7cf4,_0x253dd4){var _0x3527ab=this;return new BPromise(function(_0x496735,_0x306d96){var _0x56e0df,_0x4a942a;rpcDb['getContactPreview'](_0x1f7cf4)[_0xd43e('0x81')](function(_0x213fae){if(!_[_0xd43e('0x68')](_0x213fae[0x0])){_0x4a942a=_0x213fae[0x0][_0xd43e('0x10f')]?![]:!![];_0x56e0df=_0x213fae[0x0]['recallme']?!![]:![];_0x56e0df=_0x253dd4?!![]:_0x56e0df;}var _0x1a5fb5=_0x3527ab[_0xd43e('0x110')](_0x213fae);if(_0x1a5fb5[_0xd43e('0x111')]){rpcDb['checkIsBlackList'](_[_0xd43e('0x6e')](_0x213fae[0x0],[_0xd43e('0x71'),_0xd43e('0x112')]))[_0xd43e('0x81')](function(_0x1af24c){_0x3527ab[_0xd43e('0x113')](_0x1af24c,_0x213fae[0x0],_0x253dd4,_0x4a942a,_0x56e0df)[_0xd43e('0x81')](function(_0x553ee5){_0x496735(_0x553ee5);})[_0xd43e('0x76')](function(_0x33d4b9){_0x306d96(_0x33d4b9);});})['catch'](function(_0x474ca7){ut[_0xd43e('0x5d')](_0xd43e('0x114'),_0x474ca7);_0x306d96(ut['message'](_0xd43e('0x115'),_0x4a942a,_0x56e0df));});}else{_0x306d96(ut[_0xd43e('0x5c')](_0x1a5fb5['message'],_0x4a942a,_0x56e0df));}})[_0xd43e('0x76')](function(_0x1f1007){ut[_0xd43e('0x5d')](_0xd43e('0x116'),_0x1f1007);_0x306d96(ut[_0xd43e('0x5c')]('Call\x20unsuccessful',![],!![]));});});};Preview['prototype'][_0xd43e('0x110')]=function(_0x240be5){if(_['isNil'](_0x240be5)||_[_0xd43e('0xfe')](_0x240be5)||!_[_0xd43e('0x68')](_0x240be5[0x0][_0xd43e('0x86')])&&_[_0xd43e('0x68')](_0x240be5[0x0][_0xd43e('0x86')]['name'])){ut[_0xd43e('0x5d')](_0xd43e('0x117'),_0x240be5);return{'isValid':![],'message':_0xd43e('0x118')};}var _0x203528=this[_0xd43e('0xf')][_0x240be5[0x0][_0xd43e('0x69')][_0xd43e('0x28')]];_0x203528[_0xd43e('0x5c')]=_0xd43e('0x9d');if(_[_0xd43e('0x68')](_0x203528)){ut[_0xd43e('0x5d')](_0xd43e('0x119'),_0x203528);return{'isValid':![],'message':_0xd43e('0x11a')};}if(!this[_0xd43e('0x9b')](_0x203528[_0xd43e('0x4f')])){ut[_0xd43e('0x5d')]('[Preview][validateContact][Trunk\x20not\x20work]',_0xd43e('0x11b')+_0x203528[_0xd43e('0x28')]+_0xd43e('0x11c'));if(!this[_0xd43e('0x9b')](_0x203528['TrunkBackup'])){ut[_0xd43e('0x5d')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x203528['name']+_0xd43e('0x11d'));return{'isValid':![],'message':_0xd43e('0x11e')};}}if(!ut[_0xd43e('0x99')](_0x203528[_0xd43e('0x33')])){ut[_0xd43e('0x5d')](_0xd43e('0x11f'),_0x203528[_0xd43e('0x28')]+_0xd43e('0x120'));return{'isValid':![],'message':_0xd43e('0x11b')+_0x203528[_0xd43e('0x28')]+_0xd43e('0x120')};}return{'isValid':!![],'message':_0xd43e('0x121')};};Preview[_0xd43e('0xd')][_0xd43e('0xff')]=function(_0x59f287,_0x4d4a32,_0x29cabe,_0x3a1c19){var _0x177e10=this;return new BPromise(function(_0x338a2a,_0x1b0580){var _0x3f0848=_0x59f287[_0xd43e('0xb2')];var _0x3a93e8=_0x177e10[_0xd43e('0x9b')](_0x4d4a32[_0xd43e('0x4f')])?util[_0xd43e('0x54')](_0xd43e('0x122'),_0x4d4a32[_0xd43e('0x4f')][_0xd43e('0x28')],_[_0xd43e('0x68')](_0x4d4a32[_0xd43e('0x36')])?'':_0x4d4a32[_0xd43e('0x36')][_0xd43e('0x123')]()||'',_0x4d4a32[_0xd43e('0x124')]>0x0?_0x29cabe[_0xd43e('0xfa')][_0xd43e('0xfb')]['substring'](_0x4d4a32[_0xd43e('0x124')]):_0x29cabe[_0xd43e('0xfa')][_0xd43e('0xfb')]):util['format']('SIP/%s/%s%s',_[_0xd43e('0x68')](_0x4d4a32[_0xd43e('0x9c')])?_0x4d4a32[_0xd43e('0x4f')][_0xd43e('0x28')]:_0x4d4a32[_0xd43e('0x9c')][_0xd43e('0x28')],_[_0xd43e('0x68')](_0x4d4a32['dialPrefix'])?'':_0x4d4a32[_0xd43e('0x36')][_0xd43e('0x123')]()||'',_0x4d4a32[_0xd43e('0x124')]>0x0?_0x29cabe['Contact'][_0xd43e('0xfb')][_0xd43e('0x125')](_0x4d4a32[_0xd43e('0x124')]):_0x29cabe[_0xd43e('0xfa')][_0xd43e('0xfb')]);var _0x377210=_0x177e10[_0xd43e('0x9b')](_0x4d4a32[_0xd43e('0x4f')])?ut[_0xd43e('0x126')](_0x4d4a32['Trunk']['callerid'],_0x4d4a32[_0xd43e('0x127')],_0x4d4a32['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xd43e('0x128')](_0x4d4a32[_0xd43e('0x35')],_0x4d4a32[_0xd43e('0x129')]):_0x4d4a32[_0xd43e('0x35')]):ut['getCallerId'](_[_0xd43e('0x68')](_0x4d4a32[_0xd43e('0x9c')])?_0x4d4a32['Trunk']['callerid']:_0x4d4a32['TrunkBackup'][_0xd43e('0x50')],_0x4d4a32[_0xd43e('0x127')],_0x4d4a32[_0xd43e('0x129')]>0x0?ut[_0xd43e('0x128')](_0x4d4a32[_0xd43e('0x35')],_0x4d4a32['dialRandomLastDigitCallerIdNumber']):_0x4d4a32['dialOriginateCallerIdNumber']);if(_0x377210){_0x59f287[_0xd43e('0x12a')]=ut[_0xd43e('0x12b')](_0x377210);_0x59f287[_0xd43e('0x12c')]=ut[_0xd43e('0x12d')](_0x377210);}var _0x518d11=ut['addVariables'](_0x4d4a32,_0x29cabe,_0x3a93e8,_0x377210,_0x3f0848,_0x59f287);_[_0xd43e('0x12e')](_0x59f287,ut[_0xd43e('0x12f')](_0x518d11));_0x59f287[_0xd43e('0x8c')]=moment()[_0xd43e('0x54')](_0xd43e('0x8d'));ami[_0xd43e('0x73')](ut[_0xd43e('0x130')](_0x59f287,_0x4d4a32,_0x518d11,_0x59f287[_0xd43e('0xae')],_0x3a1c19))[_0xd43e('0x81')](function(_0x18f7f5){var _0x1bdd42=_0x59f287['channelAgent'];if(!_['isNil'](_0x1bdd42)){if(!_[_0xd43e('0x68')](_0x177e10[_0xd43e('0x13')][_0x1bdd42])){_0x177e10[_0xd43e('0x13')][_0x1bdd42][_0xd43e('0x131')]=_0x59f287[_0xd43e('0x132')];emit(util[_0xd43e('0x54')](_0xd43e('0x133'),_0x177e10['agents'][_0x1bdd42][_0xd43e('0x28')]),_0xd43e('0x134'),{'destaccountcode':_0x177e10[_0xd43e('0x13')][_0x1bdd42]['accountcode'],'destconnectedlinenum':_0x59f287[_0xd43e('0x132')]});}}_0x4d4a32['originated']+=0x1;logger['info'](_0xd43e('0x135'),_0x3f0848,_0xd43e('0xb3'),_0x4d4a32[_0xd43e('0x28')],'originated:\x20',_0x4d4a32[_0xd43e('0x5a')]);_0x338a2a(_0x18f7f5);})[_0xd43e('0x76')](function(_0xddf932){ut['logAgent'](_0x59f287,0xe,_0xd43e('0x136'));rpcDb[_0xd43e('0xee')](_0x59f287,_0xd43e('0x137'));_0x1b0580(_0xddf932);});});};Preview[_0xd43e('0xd')][_0xd43e('0x1d')]=function(_0x21e79c){if(this[_0xd43e('0x12')][_0x21e79c[_0xd43e('0xe0')]]){this['actions'][_0x21e79c[_0xd43e('0xe0')]][_0xd43e('0x75')]=_0x21e79c['channel'];}};Preview[_0xd43e('0xd')][_0xd43e('0x15')]=function(_0x24a8ca){var _0x4ce84c=this;var _0x565e29=this[_0xd43e('0x12')][_0x24a8ca['actionid']];if(_0x565e29){if(_0x565e29['lookAgent']&&this['agents'][_0x565e29[_0xd43e('0xfd')]]){ut[_0xd43e('0x138')](_0x565e29,this[_0xd43e('0x13')][_0x565e29[_0xd43e('0xfd')]][_0xd43e('0x28')],this[_0xd43e('0x13')][_0x565e29[_0xd43e('0xfd')]]['id']);}var _0x3d2204=_[_0xd43e('0x139')](_0x565e29);_0x3d2204[_0xd43e('0xb0')]=moment()[_0xd43e('0x54')](_0xd43e('0x8d'));var _0x5aacd7=_0x4ce84c[_0xd43e('0xf')][_0x565e29[_0xd43e('0x6a')]];if(ut[_0xd43e('0x13a')](_0x24a8ca[_0xd43e('0x13b')])){if(_0x565e29[_0xd43e('0xc4')]){rpcDb['unlockContact'](_0x565e29[_0xd43e('0x101')]);}if(_0x565e29[_0xd43e('0xae')]){rpcDb[_0xd43e('0x8b')](_0x565e29[_0xd43e('0x101')]);}ami[_0xd43e('0x25')](_0xd43e('0x13c'),ut[_0xd43e('0xa5')](_0x565e29,'rejected',this['campaignsPreview'][_0x565e29['queue']]));this['callProgressDetectingAgent'](_0x3d2204,_0x5aacd7,_0x24a8ca);}else{_0x565e29[_0xd43e('0x8c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');ut['logAgent'](_0x3d2204,0x4,_0xd43e('0xb8'));rpcDb['createAgentHistory'](_0x3d2204,_0xd43e('0x13d'));}}};Preview[_0xd43e('0xd')][_0xd43e('0x17')]=function(_0x171933){var _0x296523=this;var _0x190dcb=this['actions'][_0x171933['linkedid']];var _0x111a28;if(_0x190dcb){_0x111a28=this[_0xd43e('0xf')][_0x190dcb[_0xd43e('0x6a')]];logger[_0xd43e('0x56')]('[syncHangup][talking]',_0x171933[_0xd43e('0xe0')],_0xd43e('0xb3'),_0x111a28[_0xd43e('0x28')],'pTalking:\x20',_0x111a28[_0xd43e('0x2c')]);}if(this[_0xd43e('0x12')][_0x171933['linkedid']]&&_0x171933[_0xd43e('0xe0')]!==_0x171933['uniqueid']){if(_0x171933[_0xd43e('0x13e')]==='16'&&this[_0xd43e('0x12')][_0x171933[_0xd43e('0xe0')]][_0xd43e('0x6d')]){this[_0xd43e('0x9e')](_0x171933,_0x171933[_0xd43e('0xe0')],_0x171933[_0xd43e('0x13e')]);}else if(this[_0xd43e('0x12')][_0x171933[_0xd43e('0xe0')]][_0xd43e('0x6d')]){logger[_0xd43e('0x56')](_0xd43e('0x13f'),_0x171933[_0xd43e('0xe0')],_0x171933[_0xd43e('0x13e')],_0xd43e('0xb3'),_0x111a28[_0xd43e('0x28')],'pTalking:\x20',_0x111a28[_0xd43e('0x2c')]);this[_0xd43e('0x9e')](_0x171933,_0x171933[_0xd43e('0xe0')],_0x171933['cause']);}}else if(_0x190dcb&&_[_0xd43e('0x68')](_0x190dcb['statedesc'])&&_0x111a28[_0xd43e('0x140')]&&_0x171933[_0xd43e('0xe0')]===_0x171933[_0xd43e('0xb2')]&&_[_0xd43e('0x68')](_0x171933[_0xd43e('0xed')])&&_0x171933[_0xd43e('0x13e')]==='16'&&_0x171933['channelstate']==='6'&&_['isUndefined'](_0x190dcb[_0xd43e('0x141')])){if(_0x190dcb['unlockAgent']){rpcDb['unlockContact'](_0x190dcb['idContact']);}if(_0x190dcb[_0xd43e('0xae')]){rpcDb[_0xd43e('0x8b')](_0x190dcb[_0xd43e('0x101')]);}_0x171933[_0xd43e('0xed')]='22';this['callProgressDetectingAgent'](_0x190dcb,_0x111a28,_0x171933);}else if(_0x190dcb&&_0x190dcb[_0xd43e('0x141')]){if(_0x171933[_0xd43e('0x13e')]==='16'&&this[_0xd43e('0x12')][_0x171933['linkedid']]['dialAnswer']){logger[_0xd43e('0x56')](_0xd43e('0x142'),_0x171933[_0xd43e('0xe0')],_0x171933[_0xd43e('0x13e')],_0xd43e('0xb3'),_0x111a28[_0xd43e('0x28')],_0xd43e('0x6c'),_0x111a28[_0xd43e('0x2c')]);this['callProgressDetectingCustomer'](_0x171933,_0x171933[_0xd43e('0xe0')],_0x171933[_0xd43e('0x13e')]);}else if(this['actions'][_0x171933[_0xd43e('0xe0')]][_0xd43e('0x6d')]){logger[_0xd43e('0x56')](_0xd43e('0x13f'),_0x171933[_0xd43e('0xe0')],_0x171933[_0xd43e('0x13e')],_0xd43e('0xb3'),_0x111a28[_0xd43e('0x28')],_0xd43e('0x6c'),_0x111a28['pTalking']);this[_0xd43e('0x9e')](_0x171933,_0x171933['linkedid'],_0x171933[_0xd43e('0x13e')]);}}};Preview[_0xd43e('0xd')][_0xd43e('0x143')]=function(_0x284998){if(this['actions'][_0x284998[_0xd43e('0xe9')]]&&_0x284998[_0xd43e('0xe9')]!==_0x284998['destuniqueid']){this[_0xd43e('0x9e')](_0x284998,_0x284998[_0xd43e('0xe9')],_0x284998[_0xd43e('0xdd')]);}};Preview[_0xd43e('0xd')][_0xd43e('0x1a')]=function(_0x49e291){if(this[_0xd43e('0x12')][_0x49e291['linkedid']]&&_0x49e291['linkedid']!==_0x49e291[_0xd43e('0xb2')]&&!this['actions'][_0x49e291[_0xd43e('0xe0')]]['dialAnswer']){if(_0x49e291[_0xd43e('0x13e')]==='1'){this[_0xd43e('0x9e')](_0x49e291,_0x49e291[_0xd43e('0xe0')],_0x49e291[_0xd43e('0x13e')]);}}};Preview[_0xd43e('0xd')][_0xd43e('0x144')]=function(_0x4b4044,_0x213147,_0x2fd72c){if(this[_0xd43e('0x12')][_0x4b4044]){if(_[_0xd43e('0x68')](this['actions'][_0x4b4044][_0xd43e('0x145')])){this[_0xd43e('0x12')][_0x4b4044][_0xd43e('0x145')]={};}this[_0xd43e('0x12')][_0x4b4044]['variables'][_0x213147]=_0x2fd72c;}};Preview[_0xd43e('0xd')][_0xd43e('0x1f')]=function(_0x5c61d5){try{if(!_[_0xd43e('0x68')](_0x5c61d5)){if(ut['filterKey'](_[_0xd43e('0x146')](_0x5c61d5[_0xd43e('0x147')])[0x0])){this['addVariable'](_0x5c61d5[_0xd43e('0xb2')],_[_0xd43e('0x146')](_0x5c61d5[_0xd43e('0x147')])[0x0],_0x5c61d5[_0xd43e('0x148')]);}}}catch(_0x44f9da){logger[_0xd43e('0x149')](_0xd43e('0x14a'),util[_0xd43e('0x14b')](_0x44f9da,{'showHidden':![],'depth':null}));}};Preview[_0xd43e('0xd')]['syncAttendedTransfer']=function(_0x4acb82){if(_0x4acb82){if(this[_0xd43e('0x12')][_0x4acb82['transfertargetlinkedid']]){this['actions'][_0x4acb82[_0xd43e('0x14c')]]['transfer']=!![];}}};Preview[_0xd43e('0xd')][_0xd43e('0x23')]=function(_0x4199c2){if(_0x4199c2){if(this[_0xd43e('0x12')][_0x4199c2['transfererlinkedid']]){this[_0xd43e('0x12')][_0x4199c2[_0xd43e('0x14d')]][_0xd43e('0x141')]=!![];}}};module[_0xd43e('0x14e')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 729ddfd..66fad22 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 _0xdd5d=['COMPLETED','[rescheduleContactInQueue]\x20','util','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/voiceQueueReport','error','inspect','then','catch','[createHistory]\x20','resolve','createHistory','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallercomplete','endtime','membername','context','from-sip','exten','xcally-motion-preview','assigned','queuecallerexitreason'];(function(_0xf03ee7,_0x4bc974){var _0x3be997=function(_0x5e0f22){while(--_0x5e0f22){_0xf03ee7['push'](_0xf03ee7['shift']());}};_0x3be997(++_0x4bc974);}(_0xdd5d,0x160));var _0xddd5=function(_0x1ee657,_0x886384){_0x1ee657=_0x1ee657-0x0;var _0x3a893d=_0xdd5d[_0x1ee657];return _0x3a893d;};'use strict';var util=require(_0xddd5('0x0'));var BPromise=require('bluebird');var logger=require(_0xddd5('0x1'))(_0xddd5('0x2'));var _=require(_0xddd5('0x3'));var cmHopper=require(_0xddd5('0x4'));var cmHopperFinal=require(_0xddd5('0x5'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xddd5('0x6'));var voiceQueueRt=require(_0xddd5('0x7'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0xddd5('0x8'));function loggerCatch(_0x4e0ff6){return function(_0xb65f34){logger[_0xddd5('0x9')](_0x4e0ff6,util[_0xddd5('0xa')](_0xb65f34,{'showHidden':![],'depth':null}));};}function create(_0x4dc4d3){return BPromise['resolve']()[_0xddd5('0xb')](cmHopperHistory['createHistory'](_0x4dc4d3))[_0xddd5('0xc')](loggerCatch(_0xddd5('0xd')));}function createAgent(_0x2ef0b2){return BPromise[_0xddd5('0xe')]()[_0xddd5('0xb')](agentReportPreview[_0xddd5('0xf')](_0x2ef0b2))[_0xddd5('0xc')](loggerCatch(_0xddd5('0xd')));}function moveContact(_0x397a38){return BPromise[_0xddd5('0xe')]()['then'](cmHopper[_0xddd5('0x10')](_0x397a38,!![]))['catch'](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0xddd5('0x11')]=function(_0x42efd7){return BPromise[_0xddd5('0xe')]()['then'](cmHopperBlack[_0xddd5('0x11')](_0x42efd7))['catch'](loggerCatch(_0xddd5('0x12')));};exports[_0xddd5('0x13')]=function(_0x92cf6e){return BPromise[_0xddd5('0xe')]()['then'](cmHopper[_0xddd5('0x13')](_0x92cf6e))[_0xddd5('0xc')](loggerCatch(_0xddd5('0x14')));};exports[_0xddd5('0xf')]=function(_0x4566c5,_0x529cc6){create(_0x4566c5)[_0xddd5('0xc')](loggerCatch(_0x529cc6));moveContact(_0x4566c5)[_0xddd5('0xc')](loggerCatch(_0x529cc6));};exports[_0xddd5('0x15')]=function(_0x16f51b,_0x4c0460){createAgent(_0x16f51b)['catch'](loggerCatch(_0x4c0460));};exports[_0xddd5('0x16')]=function(_0x2853a8,_0x180086){create(_0x2853a8)[_0xddd5('0xc')](loggerCatch(_0x180086));};exports[_0xddd5('0x17')]=function(_0x5b3769,_0x4f3013){moveContact(_0x5b3769)[_0xddd5('0xc')](loggerCatch(_0x4f3013));};exports[_0xddd5('0x18')]=function(_0x3ef4ad,_0x1ef14e,_0x419b75){if(_0x1ef14e){_0x3ef4ad[_0xddd5('0x19')]=null;}if(_0x419b75){_0x3ef4ad[_0xddd5('0x1a')]=![];}return BPromise[_0xddd5('0xe')]()['then'](cmHopper[_0xddd5('0x18')](_0x3ef4ad))[_0xddd5('0xc')](loggerCatch(_0xddd5('0x1b')));};exports['countReScheduled']=function(_0x17673c){return BPromise[_0xddd5('0xe')]()[_0xddd5('0xb')](cmHopper[_0xddd5('0x1c')](_0x17673c))[_0xddd5('0xc')](loggerCatch(_0xddd5('0x1d')));};exports[_0xddd5('0x1e')]=function(_0x21e05c){return BPromise[_0xddd5('0xe')]()['then'](cmHopper[_0xddd5('0x1e')]({'UserId':null},_0x21e05c,0x1))[_0xddd5('0xc')](loggerCatch(_0xddd5('0x1f')));};exports['disableContact']=function(_0x26d44f){return BPromise['resolve']()['then'](cmHopper['unlockContact']({'active':![]},_0x26d44f,0x1))[_0xddd5('0xc')](loggerCatch('[activeContact]\x20'));};exports[_0xddd5('0x20')]=function(_0xbee4e2){var _0x2ec812={};_0x2ec812[_0xddd5('0x21')]=_0xbee4e2['type'];_0x2ec812[_0xddd5('0x22')]=_0xbee4e2[_0xddd5('0x22')];_0x2ec812[_0xddd5('0x23')]=_0xbee4e2[_0xddd5('0x23')];_0x2ec812[_0xddd5('0x24')]=_0xbee4e2[_0xddd5('0x24')];_0x2ec812[_0xddd5('0x25')]=_0xbee4e2[_0xddd5('0x25')];_0x2ec812[_0xddd5('0x26')]=_0xbee4e2['answertime'];_0x2ec812['queuecallerleaveAt']=_0xbee4e2['answertime'];_0x2ec812[_0xddd5('0x27')]=0x1;_0x2ec812['queuecallercompleteAt']=_0xbee4e2[_0xddd5('0x28')];_0x2ec812['connectedlinename']=_0xbee4e2[_0xddd5('0x29')];_0x2ec812[_0xddd5('0x2a')]=_0xddd5('0x2b');_0x2ec812[_0xddd5('0x2c')]=_0xddd5('0x2d');_0x2ec812['holdtime']=0x0;_0x2ec812[_0xddd5('0x2e')]=0x1;_0x2ec812['lastAssignedTo']=_0xbee4e2[_0xddd5('0x29')];_0x2ec812[_0xddd5('0x2f')]=_0xddd5('0x30');return BPromise[_0xddd5('0xe')]()[_0xddd5('0xb')](voiceQueueReport['create'](_0x2ec812))[_0xddd5('0xc')](loggerCatch('[voiceQueueReport]\x20'));};exports['getContactRecallMe']=function(_0x1fe4a7,_0x57dcbf){return BPromise[_0xddd5('0xe')]()[_0xddd5('0xb')](cmHopper['getContactRecallMe'](_0x1fe4a7,_0x57dcbf))[_0xddd5('0xc')](loggerCatch('[GetContactRecallMe]\x20'));};exports['rescheduleContactInQueue']=function(_0x2c1445){return BPromise[_0xddd5('0xe')]()['then'](cmHopper[_0xddd5('0x18')](_0x2c1445,!![],!![]))[_0xddd5('0xc')](loggerCatch(_0xddd5('0x31')));}; \ No newline at end of file +var _0xc2eb=['queuecallerexitreason','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','membername','context','from-sip','exten','holdtime','assigned','lastAssignedTo'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0xc2eb,0x149));var _0xbc2e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xc2eb[_0x37c22c];return _0x119d79;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require('../../../config/logger')('preview');var _=require('lodash');var cmHopper=require(_0xbc2e('0x0'));var cmHopperFinal=require(_0xbc2e('0x1'));var cmHopperHistory=require(_0xbc2e('0x2'));var cmHopperBlack=require(_0xbc2e('0x3'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0xbc2e('0x4'));var voiceQueueReport=require(_0xbc2e('0x5'));function loggerCatch(_0x63d224){return function(_0x2d13d5){logger[_0xbc2e('0x6')](_0x63d224,util[_0xbc2e('0x7')](_0x2d13d5,{'showHidden':![],'depth':null}));};}function create(_0x40e357){return BPromise[_0xbc2e('0x8')]()[_0xbc2e('0x9')](cmHopperHistory[_0xbc2e('0xa')](_0x40e357))[_0xbc2e('0xb')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x1b81ea){return BPromise[_0xbc2e('0x8')]()[_0xbc2e('0x9')](agentReportPreview[_0xbc2e('0xa')](_0x1b81ea))[_0xbc2e('0xb')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x1c91c8){return BPromise['resolve']()[_0xbc2e('0x9')](cmHopper['moveContactManagedDialer'](_0x1c91c8,!![]))['catch'](loggerCatch(_0xbc2e('0xc')));}exports[_0xbc2e('0xd')]=function(_0x1d9fef){return BPromise['resolve']()[_0xbc2e('0x9')](cmHopperBlack[_0xbc2e('0xd')](_0x1d9fef))[_0xbc2e('0xb')](loggerCatch(_0xbc2e('0xe')));};exports[_0xbc2e('0xf')]=function(_0x4dce89){return BPromise['resolve']()[_0xbc2e('0x9')](cmHopper[_0xbc2e('0xf')](_0x4dce89))[_0xbc2e('0xb')](loggerCatch(_0xbc2e('0x10')));};exports[_0xbc2e('0xa')]=function(_0x3f5d67,_0x5db806){create(_0x3f5d67)[_0xbc2e('0xb')](loggerCatch(_0x5db806));moveContact(_0x3f5d67)[_0xbc2e('0xb')](loggerCatch(_0x5db806));};exports[_0xbc2e('0x11')]=function(_0x810b1,_0x3e0a37){createAgent(_0x810b1)[_0xbc2e('0xb')](loggerCatch(_0x3e0a37));};exports[_0xbc2e('0x12')]=function(_0x2f6514,_0x53943b){create(_0x2f6514)[_0xbc2e('0xb')](loggerCatch(_0x53943b));};exports[_0xbc2e('0x13')]=function(_0x448557,_0x31f29f){moveContact(_0x448557)['catch'](loggerCatch(_0x31f29f));};exports[_0xbc2e('0x14')]=function(_0x35636c,_0x4b3712,_0x3c46fc){if(_0x4b3712){_0x35636c[_0xbc2e('0x15')]=null;}if(_0x3c46fc){_0x35636c[_0xbc2e('0x16')]=![];}return BPromise[_0xbc2e('0x8')]()[_0xbc2e('0x9')](cmHopper['rescheduleContact'](_0x35636c))[_0xbc2e('0xb')](loggerCatch(_0xbc2e('0x17')));};exports[_0xbc2e('0x18')]=function(_0x52b849){return BPromise[_0xbc2e('0x8')]()['then'](cmHopper[_0xbc2e('0x18')](_0x52b849))[_0xbc2e('0xb')](loggerCatch(_0xbc2e('0x19')));};exports[_0xbc2e('0x1a')]=function(_0x5cf7a4){return BPromise[_0xbc2e('0x8')]()[_0xbc2e('0x9')](cmHopper['unlockContact']({'UserId':null},_0x5cf7a4,0x1))[_0xbc2e('0xb')](loggerCatch(_0xbc2e('0x1b')));};exports[_0xbc2e('0x1c')]=function(_0x5e63bf){return BPromise['resolve']()[_0xbc2e('0x9')](cmHopper[_0xbc2e('0x1a')]({'active':![]},_0x5e63bf,0x1))[_0xbc2e('0xb')](loggerCatch(_0xbc2e('0x1d')));};exports[_0xbc2e('0x1e')]=function(_0x44c534){var _0x10f47b={};_0x10f47b[_0xbc2e('0x1f')]=_0x44c534[_0xbc2e('0x1f')];_0x10f47b[_0xbc2e('0x20')]=_0x44c534[_0xbc2e('0x20')];_0x10f47b[_0xbc2e('0x21')]=_0x44c534[_0xbc2e('0x21')];_0x10f47b['calleridname']=_0x44c534[_0xbc2e('0x22')];_0x10f47b[_0xbc2e('0x23')]=_0x44c534['queue'];_0x10f47b[_0xbc2e('0x24')]=_0x44c534['answertime'];_0x10f47b[_0xbc2e('0x25')]=_0x44c534[_0xbc2e('0x26')];_0x10f47b[_0xbc2e('0x27')]=0x1;_0x10f47b[_0xbc2e('0x28')]=_0x44c534[_0xbc2e('0x29')];_0x10f47b['connectedlinename']=_0x44c534[_0xbc2e('0x2a')];_0x10f47b[_0xbc2e('0x2b')]=_0xbc2e('0x2c');_0x10f47b[_0xbc2e('0x2d')]='xcally-motion-preview';_0x10f47b[_0xbc2e('0x2e')]=0x0;_0x10f47b[_0xbc2e('0x2f')]=0x1;_0x10f47b[_0xbc2e('0x30')]=_0x44c534[_0xbc2e('0x2a')];_0x10f47b[_0xbc2e('0x31')]='COMPLETED';return BPromise['resolve']()['then'](voiceQueueReport['create'](_0x10f47b))[_0xbc2e('0xb')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0xbc2e('0x32')]=function(_0x39dfcc,_0x40259d){return BPromise[_0xbc2e('0x8')]()[_0xbc2e('0x9')](cmHopper[_0xbc2e('0x32')](_0x39dfcc,_0x40259d))['catch'](loggerCatch(_0xbc2e('0x33')));};exports[_0xbc2e('0x34')]=function(_0x31e27f){return BPromise[_0xbc2e('0x8')]()[_0xbc2e('0x9')](cmHopper[_0xbc2e('0x14')](_0x31e27f,!![],!![]))[_0xbc2e('0xb')](loggerCatch(_0xbc2e('0x35')));}; \ 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 37f0019..26e7b92 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 _0x6b7a=['../../../../config/logger','preview','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info','loggerError','logger2','message','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','addVariables','Queue','name','calleridname','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','xcally-motion-preview','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','isNil','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','membername','logCustomer','YYYY-MM-DD\x20HH:mm:ss','talktime','answertime','Failure','variablesAction','RECALL','BOOKED','originate','calleridnum','from-sip','timeout','uniqueid','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','queue','interface','channelAgent','motionChannel','voice','mandatoryDisposition','buildAcw','agentReadyId','not_inuse','reachable','push','createBody','CampaignId','filterKey','idContact','campaigntype','dialAnswer','countglobal','callback','callbackuniqueid','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialurl','xmd-dialtimeout','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqosbridged','getCallerIdRandom','\x5cw{0,','pow','random','extractCalleridName','match','util','moment'];(function(_0x3a76eb,_0x315745){var _0x1b7857=function(_0x11887d){while(--_0x11887d){_0x3a76eb['push'](_0x3a76eb['shift']());}};_0x1b7857(++_0x315745);}(_0x6b7a,0x8d));var _0xa6b7=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0x6b7a[_0xdc37a1];return _0x99b4fe;};'use strict';var util=require(_0xa6b7('0x0'));var _=require('lodash');var moment=require(_0xa6b7('0x1'));var logger=require(_0xa6b7('0x2'))(_0xa6b7('0x3'));var ipAgi=process['env'][_0xa6b7('0x4')]||_0xa6b7('0x5');function getSeconds(_0x44b052,_0x1e685d){var _0x26dbc4=moment(_0x44b052)[_0xa6b7('0x6')](0x0);var _0x3747ea=moment(_0x1e685d)[_0xa6b7('0x6')](0x0);return _0x26dbc4[_0xa6b7('0x7')](_0x3747ea,_0xa6b7('0x8'));}exports[_0xa6b7('0x9')]=function(_0x355148){return function(_0x2dd377){logger[_0xa6b7('0xa')](_0x355148,util[_0xa6b7('0xb')](_0x2dd377,{'showHidden':![],'depth':null}));};};exports[_0xa6b7('0xc')]=function(_0x567a24,_0x548607){logger[_0xa6b7('0xd')](_0x567a24,util[_0xa6b7('0xb')](_0x548607,{'showHidden':![],'depth':null}));};exports[_0xa6b7('0xe')]=function(_0x5f4972,_0x2b48b1){logger[_0xa6b7('0xa')](_0x5f4972,util[_0xa6b7('0xb')](_0x2b48b1,{'showHidden':![],'depth':null}));};exports[_0xa6b7('0xf')]=function(_0x467482){return function(_0x4f058b){logger[_0xa6b7('0xd')](_0x467482,util[_0xa6b7('0xb')](_0x4f058b,{'showHidden':![],'depth':null}));};};exports[_0xa6b7('0x10')]=function(_0x4b1520,_0x2c2b2e,_0x30bea5){return{'message':_0x4b1520,'unlock':_0x2c2b2e,'active':_0x30bea5};};exports['getCallerId']=function(_0x14de3d,_0x3a197e,_0x25b8bb){if(!_[_0xa6b7('0x11')](_0x25b8bb)&&_0xa6b7('0x12')===typeof _0x25b8bb&&!_['isEmpty'](_0x25b8bb)){if(!_[_0xa6b7('0x11')](_0x3a197e)&&_0xa6b7('0x12')===typeof _0x3a197e&&!_[_0xa6b7('0x13')](_0x3a197e)){return util[_0xa6b7('0x14')](_0xa6b7('0x15'),_0x3a197e,_0x25b8bb);}return util[_0xa6b7('0x14')](_0xa6b7('0x15'),_0x25b8bb,_0x25b8bb);}if(!_[_0xa6b7('0x11')](_0x14de3d)&&_0xa6b7('0x12')===typeof _0x14de3d&&!_['isEmpty'](_0x14de3d)){return _0x14de3d;}return _0xa6b7('0x16');};exports[_0xa6b7('0x17')]=function(_0x1025f9){if(_['isNil'](_0x1025f9)){return![];}return _0x1025f9;};exports[_0xa6b7('0x18')]=function(_0x51ec1c,_0x47e619,_0x217f81,_0x309b98,_0x53cef8,_0x3f7be5){var _0x37500d={'XMD-QUEUE':_0x47e619['Queue']?_0x47e619[_0xa6b7('0x19')][_0xa6b7('0x1a')]:'','XMD-CALLERID':_0x309b98,'XMD-CALLERID-PREVIEW':_0x3f7be5?util[_0xa6b7('0x14')]('\x22%s\x22\x20<%s>',_0x3f7be5[_0xa6b7('0x1b')],_0x3f7be5['calleridnum']):_0x309b98,'XMD-DIALID':_0x53cef8,'XMD-CONTACTID':_0x47e619[_0xa6b7('0x1c')],'XMD-CDRTYPE':_0xa6b7('0x1d'),'CALLERID(all)':_0x309b98,'XMD-VOICEQUEUEID':_0x47e619[_0xa6b7('0x1e')],'XMD-DIALCHANNEL':_0x217f81,'XMD-DIALTIMEOUT':_0x51ec1c[_0xa6b7('0x1f')]||0x1e,'XMD-DIALOPTIONS':util[_0xa6b7('0x14')](_0xa6b7('0x20'),_0x51ec1c[_0xa6b7('0x21')]?'g':'',_[_0xa6b7('0x13')](_0x51ec1c[_0xa6b7('0x22')])?'':_0xa6b7('0x23')),'XMD-DIALURL':_0x51ec1c[_0xa6b7('0x24')]||'','XMD-AGI':_0x51ec1c[_0xa6b7('0x25')]?util[_0xa6b7('0x14')](_0xa6b7('0x26'),ipAgi,_0x51ec1c[_0xa6b7('0x25')]):_0xa6b7('0x27'),'XMD-AGIAFTER':_0x51ec1c[_0xa6b7('0x21')]?util[_0xa6b7('0x14')](_0xa6b7('0x26'),ipAgi,_0x51ec1c[_0xa6b7('0x21')]):_0xa6b7('0x27'),'XMD-ORIGINATECALLERIDNUM':_0x3f7be5?_0x3f7be5[_0xa6b7('0x28')]:'','XMD-ORIGINATECALLERIDNAME':_0x3f7be5?_0x3f7be5['originatecalleridname']:'','XMD-DESTINATION':_0xa6b7('0x29')};if(!_['isEmpty'](_0x51ec1c[_0xa6b7('0x22')])){_0x37500d[util[_0xa6b7('0x14')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x51ec1c[_0xa6b7('0x22')];_0x37500d[util['format']('%s',_0xa6b7('0x2a'))]=_0x53cef8;}if(_0x47e619&&_0x47e619[_0xa6b7('0x2b')]){for(var _0x288d40 in _0x47e619[_0xa6b7('0x2b')]){if(_0x47e619[_0xa6b7('0x2b')][_0xa6b7('0x2c')](_0x288d40)){if(!_[_0xa6b7('0x2d')](_0x47e619['Contact'][_0x288d40])&&_0x288d40!=='id'&&_0x288d40!==_0xa6b7('0x2e')&&_0x288d40!==_0xa6b7('0x2f')&&_0x288d40!==_0xa6b7('0x30')){_0x37500d[util['format'](_0xa6b7('0x31'),_0xa6b7('0x32'),_[_0xa6b7('0x33')](_0x288d40))]=_0x47e619[_0xa6b7('0x2b')][_0x288d40];}}}}return _0x37500d;};exports[_0xa6b7('0x34')]=function(_0x30ca20){var _0x22bdba={};for(var _0x42ea3e in _0x30ca20){if(_0x30ca20['hasOwnProperty'](_0x42ea3e)){_0x22bdba[util[_0xa6b7('0x14')]('%s',_[_0xa6b7('0x35')](_0x42ea3e))]=_0x30ca20[_0x42ea3e];}}return{'variables':_0x22bdba};};exports[_0xa6b7('0x36')]=function(_0x217a48,_0x57c5be){if(!_[_0xa6b7('0x2d')](_0x217a48)){if(_0x217a48[_0xa6b7('0x2c')](_0xa6b7('0x37'))){if(_0x217a48[_0xa6b7('0x37')]>0x0){_0x217a48[_0xa6b7('0x37')]-=0x1;}else{logger[_0xa6b7('0xa')](_0xa6b7('0x38'),_0x57c5be);}}}else{logger['error'](_0xa6b7('0x39'),_0x57c5be);}};exports[_0xa6b7('0x3a')]=function(_0x101002){var _0x326e92=moment()[_0xa6b7('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x101002[_0xa6b7('0x3b')]=0xd;_0x101002[_0xa6b7('0x3c')]=_0xa6b7('0x3d');_0x101002[_0xa6b7('0x3e')]=_0x326e92;_0x101002[_0xa6b7('0x3f')]=_0x326e92;_0x101002[_0xa6b7('0x40')]=_0x326e92;};exports[_0xa6b7('0x41')]=function(_0x2892a7,_0x2dbef8,_0x27f214){var _0x5330ae=moment()[_0xa6b7('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x2892a7['state']=_0x2dbef8;_0x2892a7[_0xa6b7('0x3c')]=_0x27f214;_0x2892a7[_0xa6b7('0x3f')]=_0x5330ae;_0x2892a7[_0xa6b7('0x42')]=getSeconds(_0x2892a7[_0xa6b7('0x3f')],_0x2892a7[_0xa6b7('0x3e')]);};exports['logLookAgent']=function(_0x1ef459,_0x511e17,_0x5d49ef){_0x1ef459[_0xa6b7('0x43')]=_0x511e17;_0x1ef459['UserId']=_0x5d49ef;};exports[_0xa6b7('0x44')]=function(_0x3030c4,_0x2444db,_0x55659f){var _0x28e50f=moment()[_0xa6b7('0x14')](_0xa6b7('0x45'));_0x3030c4['state']=_0x2444db;_0x3030c4[_0xa6b7('0x3c')]=_0x55659f;_0x3030c4['responsetime']=_0x3030c4[_0xa6b7('0x3f')]?_0x3030c4[_0xa6b7('0x3f')]:_0x28e50f;_0x3030c4['endtime']=_0x3030c4[_0xa6b7('0x40')]?_0x3030c4['endtime']:_0x28e50f;_0x3030c4[_0xa6b7('0x42')]=getSeconds(_0x3030c4[_0xa6b7('0x3f')]||0x0,_0x3030c4[_0xa6b7('0x3e')]||0x0);_0x3030c4[_0xa6b7('0x46')]=_0x3030c4['answertime']?getSeconds(_0x3030c4[_0xa6b7('0x40')],_0x3030c4[_0xa6b7('0x47')]):0x0;};exports['isFailure']=function(_0x435c6f){return _0x435c6f===_0xa6b7('0x48');};exports[_0xa6b7('0x49')]=function(_0x2f9c73,_0x3b11fe,_0xac038f,_0x2d4211,_0x98e341){var _0x3cf705=_0x2d4211?_0xa6b7('0x4a'):_0x2f9c73['calleridname'];_0x3cf705=_0x98e341?_0xa6b7('0x4b'):_0x3cf705;return{'actionid':_0x2f9c73['uniqueid'],'action':_0xa6b7('0x4c'),'channel':_0x2f9c73['channelAgent'],'callerid':util[_0xa6b7('0x14')](_0xa6b7('0x15'),_0x3cf705,_0x2f9c73[_0xa6b7('0x4d')]),'Exten':_0xa6b7('0x29'),'Context':_0xa6b7('0x4e'),'Priority':'1','variable':_0xac038f,'timeout':(_0x3b11fe[_0xa6b7('0x4f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2f9c73[_0xa6b7('0x50')]};};exports[_0xa6b7('0x51')]=function(_0x28d2c8){return _0x28d2c8[_0xa6b7('0x52')]+_0x28d2c8[_0xa6b7('0x53')]+_0x28d2c8[_0xa6b7('0x54')]+_0x28d2c8['countagentrejectretry']+_0x28d2c8[_0xa6b7('0x55')];};exports[_0xa6b7('0x56')]=function(_0x28d628){var _0x147a18=_[_0xa6b7('0x57')](_0x28d628);_0x147a18[_0xa6b7('0x3b')]=0xf;_0x147a18[_0xa6b7('0x3c')]=_0xa6b7('0x58');return _0x147a18;};exports[_0xa6b7('0x59')]=function(_0x5eaa43,_0x2e9ed2,_0x3a24b1){var _0x3db4bf={};_0x3db4bf[_0x2e9ed2]=_0x5eaa43[_0x2e9ed2];_0x3db4bf[_0xa6b7('0x5a')]=![];_0x3db4bf[_0xa6b7('0x5b')]=moment()['add'](_0x3a24b1,_0xa6b7('0x5c'))[_0xa6b7('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x3db4bf[_0xa6b7('0x1c')]=_0x5eaa43[_0xa6b7('0x1c')];_0x3db4bf[_0xa6b7('0x5d')]=_0x5eaa43[_0xa6b7('0x5d')];_0x3db4bf[_0xa6b7('0x1e')]=_0x5eaa43[_0xa6b7('0x1e')]||undefined;return _0x3db4bf;};exports[_0xa6b7('0x5e')]=function(_0x139425,_0x22b5d7){if(!_[_0xa6b7('0x2d')](_0x139425)){if(_0x139425[_0xa6b7('0x5f')]>0x0){_0x139425[_0xa6b7('0x5f')]-=0x1;}else{logger[_0xa6b7('0xa')](_0x22b5d7,_0xa6b7('0x60'));}}else{logger[_0xa6b7('0xa')](_0x22b5d7,_0xa6b7('0x61'));}};exports['IsNotLoggedIn']=function(_0x777eef){if(_0x777eef<=0x0){return!![];}return![];};exports[_0xa6b7('0x62')]=function(_0x5b4ba7,_0x7a9194,_0x556d7d){_0x5b4ba7['lastevent']=_0x7a9194;_0x5b4ba7[_0xa6b7('0x1a')]=_0x5b4ba7[_0xa6b7('0x63')];_0x5b4ba7[_0xa6b7('0x64')]=_0x5b4ba7[_0xa6b7('0x65')];_0x5b4ba7[_0xa6b7('0x66')]=_0xa6b7('0x67');if(_0x556d7d){_0x5b4ba7[_0xa6b7('0x68')]=_0x556d7d[_0xa6b7('0x68')];}return _0x5b4ba7;};exports[_0xa6b7('0x69')]=function(_0x811990){var _0x1f281f={};_0x1f281f[_0xa6b7('0x63')]=_0x811990[_0xa6b7('0x63')];_0x1f281f[_0xa6b7('0x64')]=_0x811990['channelAgent'];_0x1f281f[_0xa6b7('0x50')]=_0x811990[_0xa6b7('0x50')];return _0x1f281f;};exports[_0xa6b7('0x6a')]=function(_0x8edd14){var _0x51f331=[];for(var _0x244398 in _0x8edd14){if(_0x8edd14[_0xa6b7('0x2c')](_0x244398)){if(!_[_0xa6b7('0x2d')](_0x8edd14[_0x244398])&&_0x8edd14[_0x244398]['state']===_0xa6b7('0x6b')&&_0x8edd14[_0x244398]['status']===_0xa6b7('0x6c')){_0x51f331[_0xa6b7('0x6d')](_0x8edd14[_0x244398]['id']);}}}return _0x51f331;};exports['getDiff']=function(_0x1f012c){var _0x3967fc=moment()['milliseconds'](0x0);var _0x110117=moment(_0x1f012c)['milliseconds'](0x0);return _0x3967fc['diff'](_0x110117,'seconds');};exports[_0xa6b7('0x6e')]=function(_0x236aca){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x236aca[_0xa6b7('0x1c')],'ListId':_0x236aca[_0xa6b7('0x5d')],'VoiceQueueId':_0x236aca['VoiceQueueId']||undefined,'CampaignId':_0x236aca[_0xa6b7('0x6f')]||undefined};};exports[_0xa6b7('0x70')]=function(_0x5ad741){if(_0x5ad741===_0xa6b7('0x50')||_0x5ad741===_0xa6b7('0x71')||_0x5ad741===_0xa6b7('0x63')||_0x5ad741==='type'||_0x5ad741===_0xa6b7('0x72')||_0x5ad741===_0xa6b7('0x73')||_0x5ad741===_0xa6b7('0x43')||_0x5ad741===_0xa6b7('0x65')||_0x5ad741===_0xa6b7('0x1b')||_0x5ad741===_0xa6b7('0x5a')||_0x5ad741===_0xa6b7('0x4d')||_0x5ad741==='scheduledat'||_0x5ad741===_0xa6b7('0x52')||_0x5ad741===_0xa6b7('0x53')||_0x5ad741===_0xa6b7('0x54')||_0x5ad741===_0xa6b7('0x74')||_0x5ad741===_0xa6b7('0x75')||_0x5ad741===_0xa6b7('0x76')||_0x5ad741==='callbackat'||_0x5ad741==='recallme'||_0x5ad741===_0xa6b7('0x1c')||_0x5ad741===_0xa6b7('0x5d')||_0x5ad741==='UserId'||_0x5ad741===_0xa6b7('0x1e')||_0x5ad741===_0xa6b7('0x77')||_0x5ad741===_0xa6b7('0x78')||_0x5ad741===_0xa6b7('0x79')||_0x5ad741===_0xa6b7('0x7a')||_0x5ad741==='xmd-listid'||_0x5ad741===_0xa6b7('0x7b')||_0x5ad741===_0xa6b7('0x7c')||_0x5ad741==='xmd-dialoptions'||_0x5ad741===_0xa6b7('0x7d')||_0x5ad741===_0xa6b7('0x7e')||_0x5ad741===_0xa6b7('0x7f')||_0x5ad741===_0xa6b7('0x80')||_0x5ad741===_0xa6b7('0x81')||_0x5ad741==='xmd-agiafter'||_0x5ad741==='xmd-agi'||_0x5ad741==='rtpaudioqos'||_0x5ad741==='rtpaudioqosbridged'||_0x5ad741===_0xa6b7('0x82')||_0x5ad741===_0xa6b7('0x83')||_0x5ad741===_0xa6b7('0x84')||_0x5ad741===_0xa6b7('0x85')||_0x5ad741==='rtpaudioqosrtt'||_0x5ad741===_0xa6b7('0x86')||_0x5ad741===_0xa6b7('0x87')||_0x5ad741===_0xa6b7('0x88')||_0x5ad741==='rtpaudioqosjitter'||_0x5ad741===_0xa6b7('0x83')||_0x5ad741===_0xa6b7('0x84')||_0x5ad741==='rtpaudioqoslossbridged'||_0x5ad741==='rtpaudioqosrtt'||_0x5ad741===_0xa6b7('0x86')||_0x5ad741==='bridgepeer'||_0x5ad741==='bridgepvtcallid'||_0x5ad741===_0xa6b7('0x3b')||_0x5ad741==='statedesc'){return![];}return!![];};exports[_0xa6b7('0x89')]=function(_0x2f2789,_0x2b9426){var _0x33fc44,_0x3aac48,_0x55c4d7;if(_0x2b9426<=0x0){_0x2b9426=0x1;}_0x33fc44=new RegExp(_0xa6b7('0x8a')+_0x2b9426+'}$');_0x3aac48=Math[_0xa6b7('0x8b')](0xa,_0x2b9426-0x1);_0x55c4d7=Math[_0xa6b7('0x8b')](0xa,_0x2b9426)-0x1;return util[_0xa6b7('0x14')]('%s',_['replace'](_0x2f2789,_0x33fc44,_[_0xa6b7('0x8c')](_0x3aac48,_0x55c4d7)));};exports[_0xa6b7('0x8d')]=function(_0xb8fa9b){var _0x4544b1=_0xb8fa9b['match'](/"(.*?)"/);return _0x4544b1?_0x4544b1[0x1]:_0xb8fa9b;};exports['extractCalleridNumber']=function(_0x7d9f36){var _0x481c1c=_0x7d9f36[_0xa6b7('0x8e')](/<(.*?)>/);return _0x481c1c?_0x481c1c[0x1]:_0x7d9f36;}; \ No newline at end of file +var _0x3bc2=['from-sip','uniqueid','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','clone','Global','scheduledAt','active','scheduledat','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','queue','interface','voice','mandatoryDisposition','agentReadyId','not_inuse','reachable','push','getDiff','milliseconds','diff','createBody','CampaignId','idContact','type','countglobal','callbackuniqueid','sipcallid','xmd-voicequeueid','xmd-phone','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqosrtt','bridgepeer','getCallerIdRandom','pow','replace','random','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','preview','XCALLY_IP_AGI','seconds','loggerCatch','error','inspect','info','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','VoiceQueueId','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridname','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','%s%s','XMD-','toUpper','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','logLookAgent','membername','UserId','talktime','answertime','isFailure','Failure','RECALL','BOOKED','originate','channelAgent','xcally-motion-preview'];(function(_0x59e846,_0x5ee51f){var _0x5173d8=function(_0x156e6f){while(--_0x156e6f){_0x59e846['push'](_0x59e846['shift']());}};_0x5173d8(++_0x5ee51f);}(_0x3bc2,0x14f));var _0x23bc=function(_0x15a00d,_0x1db175){_0x15a00d=_0x15a00d-0x0;var _0x2ce54d=_0x3bc2[_0x15a00d];return _0x2ce54d;};'use strict';var util=require(_0x23bc('0x0'));var _=require(_0x23bc('0x1'));var moment=require(_0x23bc('0x2'));var logger=require(_0x23bc('0x3'))(_0x23bc('0x4'));var ipAgi=process['env'][_0x23bc('0x5')]||'127.0.0.1';function getSeconds(_0x42759c,_0x1dc289){var _0x3a71fd=moment(_0x42759c)['milliseconds'](0x0);var _0x325f09=moment(_0x1dc289)['milliseconds'](0x0);return _0x3a71fd['diff'](_0x325f09,_0x23bc('0x6'));}exports[_0x23bc('0x7')]=function(_0x9876f7){return function(_0x25292d){logger[_0x23bc('0x8')](_0x9876f7,util[_0x23bc('0x9')](_0x25292d,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x50f3b5,_0x28ef3e){logger[_0x23bc('0xa')](_0x50f3b5,util[_0x23bc('0x9')](_0x28ef3e,{'showHidden':![],'depth':null}));};exports[_0x23bc('0xb')]=function(_0x153180,_0x7f5d1b){logger[_0x23bc('0x8')](_0x153180,util[_0x23bc('0x9')](_0x7f5d1b,{'showHidden':![],'depth':null}));};exports[_0x23bc('0xc')]=function(_0x1169f4){return function(_0x591a28){logger['info'](_0x1169f4,util[_0x23bc('0x9')](_0x591a28,{'showHidden':![],'depth':null}));};};exports[_0x23bc('0xd')]=function(_0x491953,_0x1e44fb,_0xddfdc3){return{'message':_0x491953,'unlock':_0x1e44fb,'active':_0xddfdc3};};exports[_0x23bc('0xe')]=function(_0x2356a6,_0xd4abc8,_0x4aa227){if(!_[_0x23bc('0xf')](_0x4aa227)&&_0x23bc('0x10')===typeof _0x4aa227&&!_[_0x23bc('0x11')](_0x4aa227)){if(!_['isUndefined'](_0xd4abc8)&&_0x23bc('0x10')===typeof _0xd4abc8&&!_['isEmpty'](_0xd4abc8)){return util['format'](_0x23bc('0x12'),_0xd4abc8,_0x4aa227);}return util[_0x23bc('0x13')]('\x22%s\x22\x20<%s>',_0x4aa227,_0x4aa227);}if(!_[_0x23bc('0xf')](_0x2356a6)&&_0x23bc('0x10')===typeof _0x2356a6&&!_['isEmpty'](_0x2356a6)){return _0x2356a6;}return _0x23bc('0x14');};exports[_0x23bc('0x15')]=function(_0x1e8c6d){if(_[_0x23bc('0x16')](_0x1e8c6d)){return![];}return _0x1e8c6d;};exports[_0x23bc('0x17')]=function(_0x534b49,_0x342475,_0x2e4b28,_0x247a5,_0x1479bf,_0x3a67f8){var _0x202f97={'XMD-QUEUE':_0x342475[_0x23bc('0x18')]?_0x342475['Queue'][_0x23bc('0x19')]:'','XMD-CALLERID':_0x247a5,'XMD-CALLERID-PREVIEW':_0x3a67f8?util[_0x23bc('0x13')](_0x23bc('0x12'),_0x3a67f8[_0x23bc('0x1a')],_0x3a67f8[_0x23bc('0x1b')]):_0x247a5,'XMD-DIALID':_0x1479bf,'XMD-CONTACTID':_0x342475[_0x23bc('0x1c')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x247a5,'XMD-VOICEQUEUEID':_0x342475[_0x23bc('0x1d')],'XMD-DIALCHANNEL':_0x2e4b28,'XMD-DIALTIMEOUT':_0x534b49['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util['format']('\x22rtTxX%s%s\x22',_0x534b49['dialQueueProject2']?'g':'',_[_0x23bc('0x11')](_0x534b49[_0x23bc('0x1e')])?'':_0x23bc('0x1f')),'XMD-DIALURL':_0x534b49[_0x23bc('0x20')]||'','XMD-AGI':_0x534b49[_0x23bc('0x21')]?util[_0x23bc('0x13')](_0x23bc('0x22'),ipAgi,_0x534b49['dialQueueProject']):_0x23bc('0x23'),'XMD-AGIAFTER':_0x534b49[_0x23bc('0x24')]?util[_0x23bc('0x13')](_0x23bc('0x22'),ipAgi,_0x534b49[_0x23bc('0x24')]):_0x23bc('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x3a67f8?_0x3a67f8['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x3a67f8?_0x3a67f8[_0x23bc('0x25')]:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_[_0x23bc('0x11')](_0x534b49['monitor_format'])){_0x202f97[util[_0x23bc('0x13')]('%s',_0x23bc('0x26'))]=_0x534b49[_0x23bc('0x1e')];_0x202f97[util[_0x23bc('0x13')]('%s',_0x23bc('0x27'))]=_0x1479bf;}if(_0x342475&&_0x342475['Contact']){for(var _0x2b31bb in _0x342475[_0x23bc('0x28')]){if(_0x342475[_0x23bc('0x28')][_0x23bc('0x29')](_0x2b31bb)){if(!_[_0x23bc('0x16')](_0x342475['Contact'][_0x2b31bb])&&_0x2b31bb!=='id'&&_0x2b31bb!==_0x23bc('0x2a')&&_0x2b31bb!==_0x23bc('0x2b')&&_0x2b31bb!=='updatedAt'){_0x202f97[util[_0x23bc('0x13')](_0x23bc('0x2c'),_0x23bc('0x2d'),_[_0x23bc('0x2e')](_0x2b31bb))]=_0x342475['Contact'][_0x2b31bb];}}}}return _0x202f97;};exports['toLowerVariables']=function(_0x54f123){var _0x9c3b2b={};for(var _0x45f3ac in _0x54f123){if(_0x54f123[_0x23bc('0x29')](_0x45f3ac)){_0x9c3b2b[util[_0x23bc('0x13')]('%s',_[_0x23bc('0x2f')](_0x45f3ac))]=_0x54f123[_0x45f3ac];}}return{'variables':_0x9c3b2b};};exports[_0x23bc('0x30')]=function(_0x2d56b3,_0x3e6229){if(!_[_0x23bc('0x16')](_0x2d56b3)){if(_0x2d56b3[_0x23bc('0x29')](_0x23bc('0x31'))){if(_0x2d56b3[_0x23bc('0x31')]>0x0){_0x2d56b3[_0x23bc('0x31')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x3e6229);}}}else{logger[_0x23bc('0x8')](_0x23bc('0x32'),_0x3e6229);}};exports[_0x23bc('0x33')]=function(_0x55c3b2){var _0x370595=moment()[_0x23bc('0x13')](_0x23bc('0x34'));_0x55c3b2[_0x23bc('0x35')]=0xd;_0x55c3b2[_0x23bc('0x36')]=_0x23bc('0x37');_0x55c3b2[_0x23bc('0x38')]=_0x370595;_0x55c3b2[_0x23bc('0x39')]=_0x370595;_0x55c3b2[_0x23bc('0x3a')]=_0x370595;};exports[_0x23bc('0x3b')]=function(_0x4dfd97,_0x47bc1c,_0x4f2a27){var _0x23cf8c=moment()[_0x23bc('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x4dfd97[_0x23bc('0x35')]=_0x47bc1c;_0x4dfd97['statedesc']=_0x4f2a27;_0x4dfd97[_0x23bc('0x39')]=_0x23cf8c;_0x4dfd97[_0x23bc('0x3c')]=getSeconds(_0x4dfd97[_0x23bc('0x39')],_0x4dfd97['starttime']);};exports[_0x23bc('0x3d')]=function(_0x3ff512,_0x22ded5,_0x4dafa5){_0x3ff512[_0x23bc('0x3e')]=_0x22ded5;_0x3ff512[_0x23bc('0x3f')]=_0x4dafa5;};exports['logCustomer']=function(_0x8088a8,_0x4d92e5,_0x48bde1){var _0x4e7250=moment()[_0x23bc('0x13')](_0x23bc('0x34'));_0x8088a8[_0x23bc('0x35')]=_0x4d92e5;_0x8088a8[_0x23bc('0x36')]=_0x48bde1;_0x8088a8[_0x23bc('0x39')]=_0x8088a8[_0x23bc('0x39')]?_0x8088a8['responsetime']:_0x4e7250;_0x8088a8[_0x23bc('0x3a')]=_0x8088a8['endtime']?_0x8088a8['endtime']:_0x4e7250;_0x8088a8[_0x23bc('0x3c')]=getSeconds(_0x8088a8[_0x23bc('0x39')]||0x0,_0x8088a8['starttime']||0x0);_0x8088a8[_0x23bc('0x40')]=_0x8088a8[_0x23bc('0x41')]?getSeconds(_0x8088a8[_0x23bc('0x3a')],_0x8088a8[_0x23bc('0x41')]):0x0;};exports[_0x23bc('0x42')]=function(_0x106b3e){return _0x106b3e===_0x23bc('0x43');};exports['variablesAction']=function(_0x56dabe,_0x454ad8,_0x237f50,_0x5cc695,_0x4b9452){var _0xf3c982=_0x5cc695?_0x23bc('0x44'):_0x56dabe[_0x23bc('0x1a')];_0xf3c982=_0x4b9452?_0x23bc('0x45'):_0xf3c982;return{'actionid':_0x56dabe['uniqueid'],'action':_0x23bc('0x46'),'channel':_0x56dabe[_0x23bc('0x47')],'callerid':util['format'](_0x23bc('0x12'),_0xf3c982,_0x56dabe[_0x23bc('0x1b')]),'Exten':_0x23bc('0x48'),'Context':_0x23bc('0x49'),'Priority':'1','variable':_0x237f50,'timeout':(_0x454ad8['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x56dabe[_0x23bc('0x4a')]};};exports['totalGlobal']=function(_0x382d74){return _0x382d74[_0x23bc('0x4b')]+_0x382d74[_0x23bc('0x4c')]+_0x382d74[_0x23bc('0x4d')]+_0x382d74[_0x23bc('0x4e')]+_0x382d74[_0x23bc('0x4f')];};exports['cloneAction']=function(_0x8affe8){var _0xeb622c=_[_0x23bc('0x50')](_0x8affe8);_0xeb622c[_0x23bc('0x35')]=0xf;_0xeb622c[_0x23bc('0x36')]=_0x23bc('0x51');return _0xeb622c;};exports[_0x23bc('0x52')]=function(_0x56bcd7,_0x24f5f7,_0xac2282){var _0x558e84={};_0x558e84[_0x24f5f7]=_0x56bcd7[_0x24f5f7];_0x558e84[_0x23bc('0x53')]=![];_0x558e84[_0x23bc('0x54')]=moment()['add'](_0xac2282,_0x23bc('0x55'))['format'](_0x23bc('0x34'));_0x558e84[_0x23bc('0x1c')]=_0x56bcd7[_0x23bc('0x1c')];_0x558e84[_0x23bc('0x56')]=_0x56bcd7['ListId'];_0x558e84['VoiceQueueId']=_0x56bcd7['VoiceQueueId']||undefined;return _0x558e84;};exports[_0x23bc('0x57')]=function(_0x1eb130,_0x4d9111){if(!_[_0x23bc('0x16')](_0x1eb130)){if(_0x1eb130[_0x23bc('0x58')]>0x0){_0x1eb130[_0x23bc('0x58')]-=0x1;}else{logger[_0x23bc('0x8')](_0x4d9111,_0x23bc('0x59'));}}else{logger[_0x23bc('0x8')](_0x4d9111,_0x23bc('0x5a'));}};exports[_0x23bc('0x5b')]=function(_0x19149d){if(_0x19149d<=0x0){return!![];}return![];};exports[_0x23bc('0x5c')]=function(_0x9a4ecc,_0x13f230,_0xe5f952){_0x9a4ecc[_0x23bc('0x5d')]=_0x13f230;_0x9a4ecc[_0x23bc('0x19')]=_0x9a4ecc[_0x23bc('0x5e')];_0x9a4ecc[_0x23bc('0x5f')]=_0x9a4ecc[_0x23bc('0x47')];_0x9a4ecc['motionChannel']=_0x23bc('0x60');if(_0xe5f952){_0x9a4ecc[_0x23bc('0x61')]=_0xe5f952[_0x23bc('0x61')];}return _0x9a4ecc;};exports['buildAcw']=function(_0x1bd18a){var _0xe7ef6d={};_0xe7ef6d[_0x23bc('0x5e')]=_0x1bd18a['queue'];_0xe7ef6d[_0x23bc('0x5f')]=_0x1bd18a[_0x23bc('0x47')];_0xe7ef6d['uniqueid']=_0x1bd18a[_0x23bc('0x4a')];return _0xe7ef6d;};exports[_0x23bc('0x62')]=function(_0x129850){var _0x58d5fd=[];for(var _0xc8515a in _0x129850){if(_0x129850[_0x23bc('0x29')](_0xc8515a)){if(!_[_0x23bc('0x16')](_0x129850[_0xc8515a])&&_0x129850[_0xc8515a][_0x23bc('0x35')]===_0x23bc('0x63')&&_0x129850[_0xc8515a]['status']===_0x23bc('0x64')){_0x58d5fd[_0x23bc('0x65')](_0x129850[_0xc8515a]['id']);}}}return _0x58d5fd;};exports[_0x23bc('0x66')]=function(_0x41a27f){var _0x57ed65=moment()[_0x23bc('0x67')](0x0);var _0x36fe1a=moment(_0x41a27f)[_0x23bc('0x67')](0x0);return _0x57ed65[_0x23bc('0x68')](_0x36fe1a,'seconds');};exports[_0x23bc('0x69')]=function(_0x36eac5){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x36eac5[_0x23bc('0x1c')],'ListId':_0x36eac5[_0x23bc('0x56')],'VoiceQueueId':_0x36eac5[_0x23bc('0x1d')]||undefined,'CampaignId':_0x36eac5[_0x23bc('0x6a')]||undefined};};exports['filterKey']=function(_0x24a396){if(_0x24a396===_0x23bc('0x4a')||_0x24a396===_0x23bc('0x6b')||_0x24a396==='queue'||_0x24a396===_0x23bc('0x6c')||_0x24a396==='campaigntype'||_0x24a396==='dialAnswer'||_0x24a396==='membername'||_0x24a396===_0x23bc('0x47')||_0x24a396===_0x23bc('0x1a')||_0x24a396===_0x23bc('0x53')||_0x24a396===_0x23bc('0x1b')||_0x24a396==='scheduledat'||_0x24a396===_0x23bc('0x4b')||_0x24a396==='countcongestionretry'||_0x24a396===_0x23bc('0x4d')||_0x24a396===_0x23bc('0x6d')||_0x24a396==='callback'||_0x24a396===_0x23bc('0x6e')||_0x24a396==='callbackat'||_0x24a396==='recallme'||_0x24a396===_0x23bc('0x1c')||_0x24a396===_0x23bc('0x56')||_0x24a396===_0x23bc('0x3f')||_0x24a396===_0x23bc('0x1d')||_0x24a396===_0x23bc('0x6f')||_0x24a396===_0x23bc('0x70')||_0x24a396==='xmd-queue'||_0x24a396===_0x23bc('0x71')||_0x24a396==='xmd-listid'||_0x24a396===_0x23bc('0x72')||_0x24a396===_0x23bc('0x73')||_0x24a396===_0x23bc('0x74')||_0x24a396===_0x23bc('0x75')||_0x24a396===_0x23bc('0x76')||_0x24a396===_0x23bc('0x77')||_0x24a396==='xmd-cdrtype'||_0x24a396==='xmd-callerid'||_0x24a396==='xmd-agiafter'||_0x24a396===_0x23bc('0x78')||_0x24a396===_0x23bc('0x79')||_0x24a396===_0x23bc('0x7a')||_0x24a396===_0x23bc('0x7b')||_0x24a396===_0x23bc('0x7c')||_0x24a396===_0x23bc('0x7d')||_0x24a396===_0x23bc('0x7e')||_0x24a396==='rtpaudioqosrtt'||_0x24a396===_0x23bc('0x7f')||_0x24a396==='rtpaudioqos'||_0x24a396===_0x23bc('0x7a')||_0x24a396==='rtpaudioqosjitter'||_0x24a396==='rtpaudioqosjitterbridged'||_0x24a396===_0x23bc('0x7d')||_0x24a396==='rtpaudioqoslossbridged'||_0x24a396===_0x23bc('0x80')||_0x24a396===_0x23bc('0x7f')||_0x24a396===_0x23bc('0x81')||_0x24a396==='bridgepvtcallid'||_0x24a396===_0x23bc('0x35')||_0x24a396===_0x23bc('0x36')){return![];}return!![];};exports[_0x23bc('0x82')]=function(_0xe566b2,_0x11318c){var _0x5edd42,_0xf9bcf0,_0x334fe0;if(_0x11318c<=0x0){_0x11318c=0x1;}_0x5edd42=new RegExp('\x5cw{0,'+_0x11318c+'}$');_0xf9bcf0=Math[_0x23bc('0x83')](0xa,_0x11318c-0x1);_0x334fe0=Math[_0x23bc('0x83')](0xa,_0x11318c)-0x1;return util['format']('%s',_[_0x23bc('0x84')](_0xe566b2,_0x5edd42,_[_0x23bc('0x85')](_0xf9bcf0,_0x334fe0)));};exports['extractCalleridName']=function(_0x374123){var _0x30cfdd=_0x374123[_0x23bc('0x86')](/"(.*?)"/);return _0x30cfdd?_0x30cfdd[0x1]:_0x374123;};exports[_0x23bc('0x87')]=function(_0x4dac42){var _0x360dbd=_0x4dac42[_0x23bc('0x86')](/<(.*?)>/);return _0x360dbd?_0x360dbd[0x1]:_0x4dac42;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index e036aed..d724d31 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 _0xb51a=['queueadd','string','number','queueremove','boolean','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xb51a,0x118));var _0xab51=function(_0x284174,_0x8512d0){_0x284174=_0x284174-0x0;var _0x4d685a=_0xb51a[_0x284174];return _0x4d685a;};'use strict';exports[_0xab51('0x0')]={'queue':{'type':_0xab51('0x1'),'required':!![]},'interface':{'type':_0xab51('0x1'),'required':!![]},'membername':{'type':_0xab51('0x1'),'required':!![]},'penalty':{'type':_0xab51('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0xab51('0x3')]={'queue':{'type':_0xab51('0x1'),'required':!![]},'interface':{'type':_0xab51('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':_0xab51('0x1'),'required':!![]},'paused':{'type':_0xab51('0x4')},'reason':{'type':_0xab51('0x1'),'required':![]}};exports[_0xab51('0x5')]={'module':{'type':_0xab51('0x1'),'required':![]}};exports[_0xab51('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xab51('0x7')]={'uniqueid':{'type':_0xab51('0x1'),'required':!![]},'filename':{'type':_0xab51('0x1')},'format':{'type':_0xab51('0x1')},'mixmonitorid':{'type':'string'}};exports[_0xab51('0x8')]={'uniqueid':{'type':_0xab51('0x1'),'required':!![]}};exports[_0xab51('0x9')]={'uniqueid':{'type':_0xab51('0x1'),'required':!![]},'exten':{'type':_0xab51('0x1'),'required':!![]},'context':{'type':_0xab51('0x1')}}; \ No newline at end of file +var _0x264a=['queuepause','reload','voicechannel','voicequeuechannelhangup','string','boolean','queueremove'];(function(_0x568fd6,_0x266183){var _0x3e871c=function(_0x5878d1){while(--_0x5878d1){_0x568fd6['push'](_0x568fd6['shift']());}};_0x3e871c(++_0x266183);}(_0x264a,0x1c4));var _0xa264=function(_0x230ea9,_0x1a4f64){_0x230ea9=_0x230ea9-0x0;var _0x4a3389=_0x264a[_0x230ea9];return _0x4a3389;};'use strict';exports['queueadd']={'queue':{'type':_0xa264('0x0'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0xa264('0x1'),'required':![]}};exports[_0xa264('0x2')]={'queue':{'type':_0xa264('0x0'),'required':!![]},'interface':{'type':_0xa264('0x0'),'required':!![]}};exports[_0xa264('0x3')]={'interface':{'type':_0xa264('0x0'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0xa264('0x0'),'required':![]}};exports[_0xa264('0x4')]={'module':{'type':_0xa264('0x0'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0xa264('0x0'),'required':!![]}};exports[_0xa264('0x5')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':'string'},'format':{'type':_0xa264('0x0')},'mixmonitorid':{'type':'string'}};exports[_0xa264('0x6')]={'uniqueid':{'type':_0xa264('0x0'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xa264('0x0'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0xa264('0x0')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 1357655..75221d4 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 _0xaa4f=['triggers','campaigns','templates','outbound','channels','queueChannels','outboundChannels','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','name','interface','hasOwnProperty','total','isEmpty','ivrTotalCallsDays','unmanaged','abandoned','sumHoldTime','sumDuration','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isNil','isUndefined','initTelephones','initTrunks','initVoiceQueues','initTriggers','initTemplates','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initVoiceQueueHopperHistory','merge','groupBy','queue','queuecallerexit','queuecallerabandon','queuecallerjoinAt','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','diff','queuecallercomplete','answered','queuecallerleaveAt','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','exports','bluebird','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/freshsalesAccount','agents','telephones','trunks','voiceQueues'];(function(_0xf6be36,_0x27b922){var _0x3d5df2=function(_0x7b67f5){while(--_0x7b67f5){_0xf6be36['push'](_0xf6be36['shift']());}};_0x3d5df2(++_0x27b922);}(_0xaa4f,0x12b));var _0xfaa4=function(_0x57dd0d,_0x46544f){_0x57dd0d=_0x57dd0d-0x0;var _0x3602d=_0xaa4f[_0x57dd0d];return _0x3602d;};'use strict';var BPromise=require(_0xfaa4('0x0'));var util=require(_0xfaa4('0x1'));var _=require(_0xfaa4('0x2'));var moment=require(_0xfaa4('0x3'));var Agent=require(_0xfaa4('0x4'));var Telephone=require(_0xfaa4('0x5'));var Trunk=require(_0xfaa4('0x6'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0xfaa4('0x7'));var Template=require(_0xfaa4('0x8'));var Campaign=require(_0xfaa4('0x9'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0xfaa4('0xa'));var SalesforceAccount=require(_0xfaa4('0xb'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0xfaa4('0xc'));var ZohoAccount=require(_0xfaa4('0xd'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0xfaa4('0xe'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0xfaa4('0xf')]={};this[_0xfaa4('0x10')]={};this[_0xfaa4('0x11')]={};this[_0xfaa4('0x12')]={};this[_0xfaa4('0x13')]={};this[_0xfaa4('0x14')]={};this[_0xfaa4('0x15')]={};this[_0xfaa4('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xfaa4('0x17')]={};this[_0xfaa4('0x18')]={};this[_0xfaa4('0x19')]={};this['timers']={};this[_0xfaa4('0x1a')]={};this[_0xfaa4('0x1b')]={};this['salesforceAccounts']={};this[_0xfaa4('0x1c')]={};this[_0xfaa4('0x1d')]={};this[_0xfaa4('0x1e')]={};this[_0xfaa4('0x1f')]={};this['vtigerAccounts']={};this[_0xfaa4('0x20')]={};this[_0xfaa4('0x21')]={};this[_0xfaa4('0x22')]={};this[_0xfaa4('0x23')]={};};function freeIsNotKey(_0x353075,_0x3f6fc5,_0x1ae075){var _0x1873cf=_[_0xfaa4('0x24')](_0x353075,function(_0x5d9130,_0x142ce2){return _0x5d9130[_0x1ae075];});for(var _0x3ac1e8 in _0x3f6fc5){if(_0x3f6fc5['hasOwnProperty'](_0x3ac1e8)){if(!_0x1873cf[_0x3ac1e8]){delete _0x3f6fc5[_0x3ac1e8];}}}}function freeIsNotKeySip(_0x3078be,_0x4b2c75){var _0x38c754=_['mapKeys'](_0x3078be,function(_0x16d987,_0x5ceee0){return util[_0xfaa4('0x25')](_0xfaa4('0x26'),_0x16d987[_0xfaa4('0x27')]);});for(var _0x51be4f in _0x4b2c75){if(_0x4b2c75['hasOwnProperty'](_0x51be4f)){if(!_0x38c754[_0x51be4f]){delete _0x4b2c75[_0x51be4f];}}}}function freeIsNotKeyAgent(_0x2c45fa,_0x26c97e){var _0x25b0c0=_[_0xfaa4('0x24')](_0x2c45fa,function(_0x55a2b6,_0x3eede5){var _0x403fcb=_['isNil'](_0x55a2b6[_0xfaa4('0x28')])?util[_0xfaa4('0x25')](_0xfaa4('0x26'),_0x55a2b6[_0xfaa4('0x27')]):_0x55a2b6[_0xfaa4('0x28')];return _0x403fcb;});for(var _0x53aa53 in _0x26c97e){if(_0x26c97e[_0xfaa4('0x29')](_0x53aa53)){if(!_0x25b0c0[_0x53aa53]){delete _0x26c97e[_0x53aa53];}}}}function clearVoiceCallReports(_0x37b9d9){_0x37b9d9[_0xfaa4('0x2a')]=0x0;_0x37b9d9['answered']=0x0;_0x37b9d9['sumHoldTime']=0x0;_0x37b9d9['sumDuration']=0x0;_0x37b9d9['sumBillable']=0x0;}function clearCampaigns(_0x4710f4){if(!_[_0xfaa4('0x2b')](_0x4710f4)){for(var _0x3f2b7f in _0x4710f4){if(_0x4710f4['hasOwnProperty'](_0x3f2b7f)){_0x4710f4[_0x3f2b7f][_0xfaa4('0x2c')]=0x0;_0x4710f4[_0x3f2b7f]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x3f6c3d){if(!_[_0xfaa4('0x2b')](_0x3f6c3d)){for(var _0x598937 in _0x3f6c3d){if(_0x3f6c3d[_0xfaa4('0x29')](_0x598937)){_0x3f6c3d[_0x598937][_0xfaa4('0x2a')]=0x0;_0x3f6c3d[_0x598937]['answered']=0x0;_0x3f6c3d[_0x598937][_0xfaa4('0x2d')]=0x0;_0x3f6c3d[_0x598937][_0xfaa4('0x2e')]=0x0;_0x3f6c3d[_0x598937][_0xfaa4('0x2f')]=0x0;_0x3f6c3d[_0x598937][_0xfaa4('0x30')]=0x0;_0x3f6c3d[_0x598937][_0xfaa4('0x31')]=0x0;_0x3f6c3d[_0x598937][_0xfaa4('0x32')]=0x0;_0x3f6c3d[_0x598937][_0xfaa4('0x33')]=0x0;_0x3f6c3d[_0x598937][_0xfaa4('0x34')]=0x0;_0x3f6c3d[_0x598937][_0xfaa4('0x35')]=0x0;_0x3f6c3d[_0x598937]['outboundNoSuchCallsDay']=0x0;_0x3f6c3d[_0x598937][_0xfaa4('0x36')]=0x0;_0x3f6c3d[_0x598937][_0xfaa4('0x37')]=0x0;_0x3f6c3d[_0x598937]['outboundDropCallsDayCallersExit']=0x0;_0x3f6c3d[_0x598937][_0xfaa4('0x38')]=0x0;_0x3f6c3d[_0x598937]['outboundOriginateFailureCallsDay']=0x0;_0x3f6c3d[_0x598937]['outboundRejectCallsDay']=0x0;_0x3f6c3d[_0x598937][_0xfaa4('0x39')]=0x0;_0x3f6c3d[_0x598937][_0xfaa4('0x32')]=0x0;_0x3f6c3d[_0x598937][_0xfaa4('0x3a')]=0x0;_0x3f6c3d[_0x598937][_0xfaa4('0x3b')]=!![];}}}}Realtime[_0xfaa4('0x3c')][_0xfaa4('0x3d')]=function(_0x1b1b6b,_0x2c1eed){for(var _0x74ad79 in _0x2c1eed){if(_0x1b1b6b['hasOwnProperty'](_0x74ad79)){_0x1b1b6b[_0x74ad79]=_0x2c1eed[_0x74ad79];}}};Realtime[_0xfaa4('0x3c')][_0xfaa4('0x3e')]=function(){var _0x3fb880=this;return function(_0x48eb59){if(_0x48eb59){freeIsNotKeyAgent(_0x48eb59,_0x3fb880[_0xfaa4('0xf')]);for(var _0x10c4c7=0x0,_0x17725d={},_0x1e672d={};_0x10c4c7<_0x48eb59[_0xfaa4('0x3f')];_0x10c4c7+=0x1){_0x17725d=_0x48eb59[_0x10c4c7];var _0xf92473=_[_0xfaa4('0x40')](_0x17725d[_0xfaa4('0x28')])?util['format'](_0xfaa4('0x26'),_0x17725d[_0xfaa4('0x27')]):_0x17725d['interface'];if(_[_0xfaa4('0x41')](_0x3fb880['agents'][_0xf92473])){_0x3fb880[_0xfaa4('0xf')][_0xf92473]=new Agent(_0x17725d);}else{_0x3fb880[_0xfaa4('0x3d')](_0x3fb880['agents'][_0xf92473],_0x17725d);}}}return _0x3fb880['agents'];};};Realtime[_0xfaa4('0x3c')][_0xfaa4('0x42')]=function(){var _0x21f5f6=this;return function(_0x514f0a){if(_0x514f0a){freeIsNotKeySip(_0x514f0a,_0x21f5f6[_0xfaa4('0x10')]);for(var _0x5c3d43=0x0,_0x1ea5db={},_0x320c45={};_0x5c3d43<_0x514f0a['length'];_0x5c3d43+=0x1){_0x1ea5db=_0x514f0a[_0x5c3d43];if(_[_0xfaa4('0x41')](_0x21f5f6[_0xfaa4('0x10')][util[_0xfaa4('0x25')](_0xfaa4('0x26'),_0x1ea5db[_0xfaa4('0x27')])])){_0x21f5f6[_0xfaa4('0x10')][util[_0xfaa4('0x25')](_0xfaa4('0x26'),_0x1ea5db[_0xfaa4('0x27')])]=new Telephone(_0x1ea5db);}else{_0x21f5f6[_0xfaa4('0x3d')](_0x21f5f6[_0xfaa4('0x10')][util['format'](_0xfaa4('0x26'),_0x1ea5db[_0xfaa4('0x27')])],_0x1ea5db);}}}return _0x21f5f6[_0xfaa4('0x10')];};};Realtime[_0xfaa4('0x3c')][_0xfaa4('0x43')]=function(){var _0x1873dd=this;return function(_0xdbfada){if(_0xdbfada){freeIsNotKeySip(_0xdbfada,_0x1873dd[_0xfaa4('0x11')]);for(var _0x548ec7=0x0,_0x10db64={},_0x308414={};_0x548ec7<_0xdbfada[_0xfaa4('0x3f')];_0x548ec7+=0x1){_0x10db64=_0xdbfada[_0x548ec7];if(_['isUndefined'](_0x1873dd[_0xfaa4('0x11')][util[_0xfaa4('0x25')](_0xfaa4('0x26'),_0x10db64[_0xfaa4('0x27')])])){_0x1873dd[_0xfaa4('0x11')][util[_0xfaa4('0x25')]('SIP/%s',_0x10db64['name'])]=new Trunk(_0x10db64);}else{_0x1873dd['mergeFromDatabase'](_0x1873dd[_0xfaa4('0x11')][util[_0xfaa4('0x25')]('SIP/%s',_0x10db64[_0xfaa4('0x27')])],_0x10db64);}}}return _0x1873dd[_0xfaa4('0x11')];};};Realtime[_0xfaa4('0x3c')][_0xfaa4('0x44')]=function(){var _0x43a91d=this;return function(_0x284287){if(_0x284287){freeIsNotKey(_0x284287,_0x43a91d['voiceQueues'],_0xfaa4('0x27'));for(var _0x365928=0x0,_0x294445={},_0x1e8163={};_0x365928<_0x284287[_0xfaa4('0x3f')];_0x365928+=0x1){_0x294445=_0x284287[_0x365928];if(_['isUndefined'](_0x43a91d[_0xfaa4('0x12')][_0x294445['name']])){_0x43a91d[_0xfaa4('0x12')][_0x294445[_0xfaa4('0x27')]]=new VoiceQueue(_0x294445);}else{_0x43a91d[_0xfaa4('0x3d')](_0x43a91d[_0xfaa4('0x12')][_0x294445[_0xfaa4('0x27')]],_0x294445);}}}return _0x43a91d[_0xfaa4('0x12')];};};Realtime[_0xfaa4('0x3c')][_0xfaa4('0x45')]=function(){var _0x18c34f=this;return function(_0x1e5323){if(_0x1e5323){freeIsNotKey(_0x1e5323,_0x18c34f[_0xfaa4('0x13')],'id');for(var _0xc58462=0x0,_0x2347d5={},_0x49b005={};_0xc58462<_0x1e5323[_0xfaa4('0x3f')];_0xc58462+=0x1){_0x2347d5=_0x1e5323[_0xc58462];if(_[_0xfaa4('0x41')](_0x18c34f[_0xfaa4('0x13')][_0x2347d5['id']])){_0x18c34f[_0xfaa4('0x13')][_0x2347d5['id']]=new Trigger(_0x2347d5);}else{_0x18c34f[_0xfaa4('0x3d')](_0x18c34f[_0xfaa4('0x13')][_0x2347d5['id']],_0x2347d5);}}}return _0x18c34f[_0xfaa4('0x13')];};};Realtime['prototype'][_0xfaa4('0x46')]=function(){var _0x41b4b3=this;return function(_0x31f199){if(_0x31f199){freeIsNotKey(_0x31f199,_0x41b4b3[_0xfaa4('0x15')],'id');for(var _0x30eb27=0x0,_0x4a6bbb={},_0x415525={};_0x30eb27<_0x31f199[_0xfaa4('0x3f')];_0x30eb27+=0x1){_0x4a6bbb=_0x31f199[_0x30eb27];if(_[_0xfaa4('0x41')](_0x41b4b3[_0xfaa4('0x15')][_0x4a6bbb['id']])){_0x41b4b3[_0xfaa4('0x15')][_0x4a6bbb['id']]=new Template(_0x4a6bbb);}else{_0x41b4b3[_0xfaa4('0x3d')](_0x41b4b3[_0xfaa4('0x15')][_0x4a6bbb['id']],_0x4a6bbb);}}}return _0x41b4b3[_0xfaa4('0x15')];};};Realtime['prototype']['initZendeskAccounts']=function(){var _0x57f95f=this;return function(_0x297ca3){if(_0x297ca3){freeIsNotKey(_0x297ca3,_0x57f95f[_0xfaa4('0x1b')],'id');for(var _0x13a52e=0x0,_0x5b41ab={},_0x21e28d={};_0x13a52e<_0x297ca3[_0xfaa4('0x3f')];_0x13a52e+=0x1){_0x5b41ab=_0x297ca3[_0x13a52e];if(_['isUndefined'](_0x57f95f[_0xfaa4('0x1b')][_0x5b41ab['id']])){_0x57f95f[_0xfaa4('0x1b')][_0x5b41ab['id']]=new ZendeskAccount(_0x5b41ab);}else{_0x57f95f['mergeFromDatabase'](_0x57f95f[_0xfaa4('0x1b')][_0x5b41ab['id']],_0x5b41ab);}}}return _0x57f95f[_0xfaa4('0x1b')];};};Realtime['prototype'][_0xfaa4('0x47')]=function(){var _0x22a392=this;return function(_0x8dea0c){if(_0x8dea0c){freeIsNotKey(_0x8dea0c,_0x22a392[_0xfaa4('0x48')],'id');for(var _0x3898f8=0x0,_0x309d3c={},_0x5c7fda={};_0x3898f8<_0x8dea0c[_0xfaa4('0x3f')];_0x3898f8+=0x1){_0x309d3c=_0x8dea0c[_0x3898f8];if(_[_0xfaa4('0x41')](_0x22a392[_0xfaa4('0x48')][_0x309d3c['id']])){_0x22a392[_0xfaa4('0x48')][_0x309d3c['id']]=new SalesforceAccount(_0x309d3c);}else{_0x22a392[_0xfaa4('0x3d')](_0x22a392['salesforceAccounts'][_0x309d3c['id']],_0x309d3c);}}}return _0x22a392[_0xfaa4('0x48')];};};Realtime[_0xfaa4('0x3c')][_0xfaa4('0x49')]=function(){var _0x3048ed=this;return function(_0x5d7c84){if(_0x5d7c84){freeIsNotKey(_0x5d7c84,_0x3048ed[_0xfaa4('0x1d')],'id');for(var _0x2d97fb=0x0,_0x96d512={},_0xb4663a={};_0x2d97fb<_0x5d7c84[_0xfaa4('0x3f')];_0x2d97fb+=0x1){_0x96d512=_0x5d7c84[_0x2d97fb];if(_['isUndefined'](_0x3048ed[_0xfaa4('0x1d')][_0x96d512['id']])){_0x3048ed['freshdeskAccounts'][_0x96d512['id']]=new FreshdeskAccount(_0x96d512);}else{_0x3048ed[_0xfaa4('0x3d')](_0x3048ed['freshdeskAccounts'][_0x96d512['id']],_0x96d512);}}}return _0x3048ed['freshdeskAccounts'];};};Realtime[_0xfaa4('0x3c')][_0xfaa4('0x4a')]=function(){var _0x5e3649=this;return function(_0x446847){if(_0x446847){freeIsNotKey(_0x446847,_0x5e3649[_0xfaa4('0x1e')],'id');for(var _0x187de3=0x0,_0x295710={},_0x4721e1={};_0x187de3<_0x446847[_0xfaa4('0x3f')];_0x187de3+=0x1){_0x295710=_0x446847[_0x187de3];if(_[_0xfaa4('0x41')](_0x5e3649[_0xfaa4('0x1e')][_0x295710['id']])){_0x5e3649['zohoAccounts'][_0x295710['id']]=new ZohoAccount(_0x295710);}else{_0x5e3649['mergeFromDatabase'](_0x5e3649[_0xfaa4('0x1e')][_0x295710['id']],_0x295710);}}}return _0x5e3649[_0xfaa4('0x1e')];};};Realtime[_0xfaa4('0x3c')][_0xfaa4('0x4b')]=function(){var _0x93ac62=this;return function(_0x1e0f4c){if(_0x1e0f4c){freeIsNotKey(_0x1e0f4c,_0x93ac62[_0xfaa4('0x1f')],'id');for(var _0xa959e9=0x0,_0x595d54={},_0x5c25e4={};_0xa959e9<_0x1e0f4c['length'];_0xa959e9+=0x1){_0x595d54=_0x1e0f4c[_0xa959e9];if(_[_0xfaa4('0x41')](_0x93ac62[_0xfaa4('0x1f')][_0x595d54['id']])){_0x93ac62[_0xfaa4('0x1f')][_0x595d54['id']]=new DeskAccount(_0x595d54);}else{_0x93ac62[_0xfaa4('0x3d')](_0x93ac62[_0xfaa4('0x1f')][_0x595d54['id']],_0x595d54);}}}return _0x93ac62[_0xfaa4('0x1f')];};};Realtime[_0xfaa4('0x3c')][_0xfaa4('0x4c')]=function(){var _0x417eaf=this;return function(_0x3362f2){if(_0x3362f2){freeIsNotKey(_0x3362f2,_0x417eaf['sugarcrmAccounts'],'id');for(var _0x71fa9e=0x0,_0x401196={},_0x282228={};_0x71fa9e<_0x3362f2[_0xfaa4('0x3f')];_0x71fa9e+=0x1){_0x401196=_0x3362f2[_0x71fa9e];if(_[_0xfaa4('0x41')](_0x417eaf[_0xfaa4('0x1c')][_0x401196['id']])){_0x417eaf[_0xfaa4('0x1c')][_0x401196['id']]=new SugarcrmAccount(_0x401196);}else{_0x417eaf[_0xfaa4('0x3d')](_0x417eaf[_0xfaa4('0x1c')][_0x401196['id']],_0x401196);}}}return _0x417eaf['sugarcrmAccounts'];};};Realtime[_0xfaa4('0x3c')][_0xfaa4('0x4d')]=function(){var _0x2919b0=this;return function(_0x5b676f){if(_0x5b676f){freeIsNotKey(_0x5b676f,_0x2919b0[_0xfaa4('0x4e')],'id');for(var _0x1b2986=0x0,_0x4ec5a2={},_0xf92852={};_0x1b2986<_0x5b676f[_0xfaa4('0x3f')];_0x1b2986+=0x1){_0x4ec5a2=_0x5b676f[_0x1b2986];if(_[_0xfaa4('0x41')](_0x2919b0[_0xfaa4('0x4e')][_0x4ec5a2['id']])){_0x2919b0[_0xfaa4('0x4e')][_0x4ec5a2['id']]=new VtigerAccount(_0x4ec5a2);}else{_0x2919b0['mergeFromDatabase'](_0x2919b0[_0xfaa4('0x4e')][_0x4ec5a2['id']],_0x4ec5a2);}}}return _0x2919b0['vtigerAccounts'];};};Realtime[_0xfaa4('0x3c')][_0xfaa4('0x4f')]=function(){var _0x2bf8ff=this;return function(_0x2878f7){if(_0x2878f7){freeIsNotKey(_0x2878f7,_0x2bf8ff['servicenowAccounts'],'id');for(var _0xfdfe17=0x0,_0x3c419e={},_0x20868e={};_0xfdfe17<_0x2878f7[_0xfaa4('0x3f')];_0xfdfe17+=0x1){_0x3c419e=_0x2878f7[_0xfdfe17];if(_[_0xfaa4('0x41')](_0x2bf8ff[_0xfaa4('0x20')][_0x3c419e['id']])){_0x2bf8ff[_0xfaa4('0x20')][_0x3c419e['id']]=new ServicenowAccount(_0x3c419e);}else{_0x2bf8ff[_0xfaa4('0x3d')](_0x2bf8ff[_0xfaa4('0x20')][_0x3c419e['id']],_0x3c419e);}}}return _0x2bf8ff[_0xfaa4('0x20')];};};Realtime['prototype'][_0xfaa4('0x50')]=function(){var _0x5ba75d=this;return function(_0x4c9b78){if(_0x4c9b78){freeIsNotKey(_0x4c9b78,_0x5ba75d['dynamics365Accounts'],'id');for(var _0xe7283c=0x0,_0x2d5a30={},_0x21e1a4={};_0xe7283c<_0x4c9b78['length'];_0xe7283c+=0x1){_0x2d5a30=_0x4c9b78[_0xe7283c];if(_[_0xfaa4('0x41')](_0x5ba75d['dynamics365Accounts'][_0x2d5a30['id']])){_0x5ba75d[_0xfaa4('0x21')][_0x2d5a30['id']]=new Dynamics365Account(_0x2d5a30);}else{_0x5ba75d['mergeFromDatabase'](_0x5ba75d[_0xfaa4('0x21')][_0x2d5a30['id']],_0x2d5a30);}}}return _0x5ba75d[_0xfaa4('0x21')];};};Realtime[_0xfaa4('0x3c')]['initFreshsalesAccounts']=function(){var _0x1629d0=this;return function(_0x3b2bbb){if(_0x3b2bbb){freeIsNotKey(_0x3b2bbb,_0x1629d0['freshsalesAccounts'],'id');for(var _0x37adb0=0x0,_0x336bbb={},_0x2f0194={};_0x37adb0<_0x3b2bbb[_0xfaa4('0x3f')];_0x37adb0+=0x1){_0x336bbb=_0x3b2bbb[_0x37adb0];if(_['isUndefined'](_0x1629d0['freshsalesAccounts'][_0x336bbb['id']])){_0x1629d0[_0xfaa4('0x22')][_0x336bbb['id']]=new FreshsalesAccount(_0x336bbb);}else{_0x1629d0[_0xfaa4('0x3d')](_0x1629d0[_0xfaa4('0x22')][_0x336bbb['id']],_0x336bbb);}}}return _0x1629d0['freshsalesAccounts'];};};Realtime[_0xfaa4('0x3c')][_0xfaa4('0x51')]=function(){var _0x55bbb8=this;return function(_0x53a05d){for(var _0x103602=0x0;_0x103602<_0x53a05d[_0xfaa4('0x3f')];_0x103602+=0x1){_[_0xfaa4('0x52')](_0x55bbb8[_0xfaa4('0x12')][_0x53a05d[_0x103602]['name']],_0x53a05d[_0x103602]);}return _0x55bbb8['voiceQueues'];};};Realtime[_0xfaa4('0x3c')]['initVoiceQueueReports']=function(){var _0x34f9e7=this;return function(_0x1909ce){clearVoiceQueues(_0x34f9e7[_0xfaa4('0x12')]);if(_0x1909ce){_0x1909ce=_[_0xfaa4('0x53')](_0x1909ce,'uniqueid');for(var _0x39b244 in _0x1909ce){if(_0x1909ce[_0xfaa4('0x29')](_0x39b244)){var _0x118426={};for(var _0x26ca1a=0x0;_0x26ca1a<_0x1909ce[_0x39b244][_0xfaa4('0x3f')];_0x26ca1a+=0x1){var _0x134124=_0x1909ce[_0x39b244][_0x26ca1a][_0xfaa4('0x54')];if(_0x34f9e7[_0xfaa4('0x12')][_0x134124]){if(_0x1909ce[_0x39b244][_0x26ca1a][_0xfaa4('0x55')]){_0x34f9e7[_0xfaa4('0x12')][_0x134124][_0xfaa4('0x2d')]+=0x1;}if(_0x1909ce[_0x39b244][_0x26ca1a][_0xfaa4('0x56')]){_0x34f9e7['voiceQueues'][_0x134124][_0xfaa4('0x2e')]+=0x1;}_0x34f9e7[_0xfaa4('0x12')][_0x134124][_0xfaa4('0x2f')]+=moment(_0x1909ce[_0x39b244][_0x26ca1a]['queuecallerleaveAt'])['diff'](moment(_0x1909ce[_0x39b244][_0x26ca1a][_0xfaa4('0x57')]),'seconds')||0x0;if(_0x26ca1a===_0x1909ce[_0x39b244][_0xfaa4('0x3f')]-0x1){_0x34f9e7[_0xfaa4('0x12')][_0x134124][_0xfaa4('0x30')]+=moment(_0x1909ce[_0x39b244][_0x26ca1a][_0xfaa4('0x58')]||_0x1909ce[_0x39b244][_0x26ca1a][_0xfaa4('0x59')]||_0x1909ce[_0x39b244][_0x26ca1a][_0xfaa4('0x5a')])[_0xfaa4('0x5b')](moment(_0x1909ce[_0x39b244][_0x26ca1a]['queuecallerjoinAt']),'seconds')||0x0;_0x34f9e7[_0xfaa4('0x12')][_0x134124][_0xfaa4('0x2a')]+=0x1;if(_0x1909ce[_0x39b244][_0x26ca1a][_0xfaa4('0x5c')]){_0x34f9e7[_0xfaa4('0x12')][_0x134124][_0xfaa4('0x5d')]+=0x1;_0x34f9e7[_0xfaa4('0x12')][_0x134124][_0xfaa4('0x31')]+=moment(_0x1909ce[_0x39b244][_0x26ca1a]['queuecallercompleteAt'])['diff'](moment(_0x1909ce[_0x39b244][_0x26ca1a][_0xfaa4('0x5e')]),'seconds')||0x0;}}else{_0x34f9e7['voiceQueues'][_0x134124][_0xfaa4('0x30')]+=_0x34f9e7['voiceQueues'][_0x134124]['sumHoldTime']||0x0;}}}}}}return _0x34f9e7[_0xfaa4('0x12')];};};Realtime['prototype']['initVoiceCallReports']=function(){var _0x3f5f4e=this;return function(_0x4c4df7){clearVoiceCallReports(_0x3f5f4e['outbound']);if(_0x4c4df7){for(var _0x4a265e=0x0;_0x4a265e<_0x4c4df7[_0xfaa4('0x3f')];_0x4a265e+=0x1){_0x3f5f4e[_0xfaa4('0x16')]['total']+=0x1;_0x3f5f4e[_0xfaa4('0x16')][_0xfaa4('0x30')]+=_0x4c4df7[_0x4a265e][_0xfaa4('0x5f')];if(_0x4c4df7[_0x4a265e][_0xfaa4('0x60')]===_0xfaa4('0x61')){_0x3f5f4e['outbound'][_0xfaa4('0x5d')]+=0x1;_0x3f5f4e[_0xfaa4('0x16')]['sumHoldTime']+=_0x4c4df7[_0x4a265e]['duration']-_0x4c4df7[_0x4a265e][_0xfaa4('0x62')]||0x0;_0x3f5f4e[_0xfaa4('0x16')][_0xfaa4('0x31')]+=_0x4c4df7[_0x4a265e][_0xfaa4('0x62')];}}}return _0x3f5f4e[_0xfaa4('0x16')];};};Realtime[_0xfaa4('0x3c')][_0xfaa4('0x63')]=function(){var _0x272b00=this;return function(_0x12c9d4){if(_0x12c9d4){freeIsNotKey(_0x12c9d4,_0x272b00[_0xfaa4('0x14')],'name');for(var _0x42b3d6=0x0,_0x258c0a={};_0x42b3d6<_0x12c9d4[_0xfaa4('0x3f')];_0x42b3d6+=0x1){_0x258c0a=_0x12c9d4[_0x42b3d6];if(_[_0xfaa4('0x41')](_0x272b00['campaigns'][_0x258c0a[_0xfaa4('0x27')]])){_0x272b00[_0xfaa4('0x14')][_0x258c0a[_0xfaa4('0x27')]]=new Campaign(_0x258c0a);}else{_0x272b00[_0xfaa4('0x3d')](_0x272b00[_0xfaa4('0x14')][_0x258c0a[_0xfaa4('0x27')]],_0x258c0a);_0x272b00['campaigns'][_0x258c0a[_0xfaa4('0x27')]][_0xfaa4('0x64')]=_0x258c0a[_0xfaa4('0x65')]?_0x258c0a[_0xfaa4('0x65')][_0xfaa4('0x27')]:undefined;}}}return _0x272b00['campaigns'];};};Realtime[_0xfaa4('0x3c')][_0xfaa4('0x66')]=function(){var _0x594f33=this;return function(_0x2353be){if(_0x2353be){freeIsNotKey(_0x2353be,_0x594f33[_0xfaa4('0x67')],'id');for(var _0x64a5e8=0x0,_0x8e4081={};_0x64a5e8<_0x2353be['length'];_0x64a5e8+=0x1){_0x8e4081=_0x2353be[_0x64a5e8];if(_[_0xfaa4('0x41')](_0x594f33[_0xfaa4('0x67')][_0x8e4081['id']])){_0x594f33[_0xfaa4('0x67')][_0x8e4081['id']]=new VoiceExtension(_0x8e4081);}else{_0x594f33[_0xfaa4('0x3d')](_0x594f33[_0xfaa4('0x67')][_0x8e4081['id']],_0x8e4081);}}}return _0x594f33['voiceExtensions'];};};Realtime[_0xfaa4('0x3c')][_0xfaa4('0x68')]=function(){var _0x2c0c94=this;return function(_0x27b0d3){clearCampaigns(_0x2c0c94[_0xfaa4('0x14')]);for(var _0x2d7e96=0x0;_0x2d7e96<_0x27b0d3['length'];_0x2d7e96+=0x1){_[_0xfaa4('0x52')](_0x2c0c94[_0xfaa4('0x14')][_0x27b0d3[_0x2d7e96][_0xfaa4('0x27')]],_0x27b0d3[_0x2d7e96]);}return _0x2c0c94[_0xfaa4('0x14')];};};Realtime[_0xfaa4('0x3c')]['initFaxAccounts']=function(){var _0xb5f99d=this;return function(_0x6c2fcc){if(_0x6c2fcc){freeIsNotKey(_0x6c2fcc,_0xb5f99d[_0xfaa4('0x23')],'id');for(var _0x110abc=0x0,_0x2df3f1={},_0x19e4fc={};_0x110abc<_0x6c2fcc[_0xfaa4('0x3f')];_0x110abc+=0x1){_0x2df3f1=_0x6c2fcc[_0x110abc];if(_['isUndefined'](_0xb5f99d[_0xfaa4('0x23')][_0x2df3f1['id']])){_0xb5f99d['faxAccounts'][_0x2df3f1['id']]=new FaxAccount(_0x2df3f1);}else{_0xb5f99d[_0xfaa4('0x3d')](_0xb5f99d[_0xfaa4('0x23')][_0x2df3f1['id']],_0x2df3f1);}}}return _0xb5f99d['faxAccounts'];};};module[_0xfaa4('0x69')]=Realtime; \ No newline at end of file +var _0x8c40=['sugarcrmAccounts','freshdeskAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','length','isUndefined','initTrunks','trunks','initTemplates','initZendeskAccounts','zendeskAccounts','salesforceAccounts','initFreshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','freshsalesAccounts','groupBy','queuecallerexit','queuecallerleaveAt','diff','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallerjoinAt','seconds','duration','disposition','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','merge','exports','bluebird','util','lodash','moment','../model/telephone','../model/trunk','../model/voiceQueue','../model/template','../model/campaign','../model/voiceExtension','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','settings'];(function(_0x3df382,_0x561c8f){var _0xce8e0c=function(_0x149379){while(--_0x149379){_0x3df382['push'](_0x3df382['shift']());}};_0xce8e0c(++_0x561c8f);}(_0x8c40,0x182));var _0x08c4=function(_0x58ef30,_0x248d33){_0x58ef30=_0x58ef30-0x0;var _0x2e8fc6=_0x8c40[_0x58ef30];return _0x2e8fc6;};'use strict';var BPromise=require(_0x08c4('0x0'));var util=require(_0x08c4('0x1'));var _=require(_0x08c4('0x2'));var moment=require(_0x08c4('0x3'));var Agent=require('../model/agent');var Telephone=require(_0x08c4('0x4'));var Trunk=require(_0x08c4('0x5'));var VoiceQueue=require(_0x08c4('0x6'));var Trigger=require('../model/trigger');var Template=require(_0x08c4('0x7'));var Campaign=require(_0x08c4('0x8'));var VoiceExtension=require(_0x08c4('0x9'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0x08c4('0xa'));var FreshdeskAccount=require(_0x08c4('0xb'));var SugarcrmAccount=require(_0x08c4('0xc'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0x08c4('0xd'));var ServicenowAccount=require(_0x08c4('0xe'));var Dynamics365Account=require(_0x08c4('0xf'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x08c4('0x10'));var Realtime=function(){this[_0x08c4('0x11')]={};this[_0x08c4('0x12')]={};this['trunks']={};this[_0x08c4('0x13')]={};this[_0x08c4('0x14')]={};this[_0x08c4('0x15')]={};this[_0x08c4('0x16')]={};this[_0x08c4('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x08c4('0x18')]={};this[_0x08c4('0x19')]={};this[_0x08c4('0x1a')]={};this[_0x08c4('0x1b')]={};this[_0x08c4('0x1c')]={};this[_0x08c4('0x1d')]={};this['zendeskAccounts']={};this['salesforceAccounts']={};this[_0x08c4('0x1e')]={};this[_0x08c4('0x1f')]={};this['zohoAccounts']={};this[_0x08c4('0x20')]={};this[_0x08c4('0x21')]={};this[_0x08c4('0x22')]={};this[_0x08c4('0x23')]={};this['freshsalesAccounts']={};this[_0x08c4('0x24')]={};};function freeIsNotKey(_0x59594c,_0x2e3047,_0x49d7bd){var _0x59dfb4=_[_0x08c4('0x25')](_0x59594c,function(_0x47d9f6,_0x2d8434){return _0x47d9f6[_0x49d7bd];});for(var _0x3b474f in _0x2e3047){if(_0x2e3047[_0x08c4('0x26')](_0x3b474f)){if(!_0x59dfb4[_0x3b474f]){delete _0x2e3047[_0x3b474f];}}}}function freeIsNotKeySip(_0x4082de,_0x58ad33){var _0x516270=_[_0x08c4('0x25')](_0x4082de,function(_0x3680e1,_0x536850){return util[_0x08c4('0x27')](_0x08c4('0x28'),_0x3680e1[_0x08c4('0x29')]);});for(var _0x17d4f0 in _0x58ad33){if(_0x58ad33[_0x08c4('0x26')](_0x17d4f0)){if(!_0x516270[_0x17d4f0]){delete _0x58ad33[_0x17d4f0];}}}}function freeIsNotKeyAgent(_0x9cb7dd,_0x1351a2){var _0x21f553=_[_0x08c4('0x25')](_0x9cb7dd,function(_0x164582,_0x30c562){var _0x18e20b=_[_0x08c4('0x2a')](_0x164582['interface'])?util['format'](_0x08c4('0x28'),_0x164582['name']):_0x164582[_0x08c4('0x2b')];return _0x18e20b;});for(var _0x483d3c in _0x1351a2){if(_0x1351a2[_0x08c4('0x26')](_0x483d3c)){if(!_0x21f553[_0x483d3c]){delete _0x1351a2[_0x483d3c];}}}}function clearVoiceCallReports(_0x59710b){_0x59710b[_0x08c4('0x2c')]=0x0;_0x59710b[_0x08c4('0x2d')]=0x0;_0x59710b[_0x08c4('0x2e')]=0x0;_0x59710b[_0x08c4('0x2f')]=0x0;_0x59710b[_0x08c4('0x30')]=0x0;}function clearCampaigns(_0x21da61){if(!_[_0x08c4('0x31')](_0x21da61)){for(var _0xa0ef5a in _0x21da61){if(_0x21da61['hasOwnProperty'](_0xa0ef5a)){_0x21da61[_0xa0ef5a][_0x08c4('0x32')]=0x0;_0x21da61[_0xa0ef5a][_0x08c4('0x33')]=0x0;}}}}function clearVoiceQueues(_0x8a54bf){if(!_[_0x08c4('0x31')](_0x8a54bf)){for(var _0x1c9f24 in _0x8a54bf){if(_0x8a54bf[_0x08c4('0x26')](_0x1c9f24)){_0x8a54bf[_0x1c9f24]['total']=0x0;_0x8a54bf[_0x1c9f24][_0x08c4('0x2d')]=0x0;_0x8a54bf[_0x1c9f24][_0x08c4('0x34')]=0x0;_0x8a54bf[_0x1c9f24][_0x08c4('0x35')]=0x0;_0x8a54bf[_0x1c9f24]['sumHoldTime']=0x0;_0x8a54bf[_0x1c9f24][_0x08c4('0x2f')]=0x0;_0x8a54bf[_0x1c9f24]['sumBillable']=0x0;_0x8a54bf[_0x1c9f24]['outboundAnswerAgiCallsDay']=0x0;_0x8a54bf[_0x1c9f24][_0x08c4('0x36')]=0x0;_0x8a54bf[_0x1c9f24][_0x08c4('0x37')]=0x0;_0x8a54bf[_0x1c9f24][_0x08c4('0x38')]=0x0;_0x8a54bf[_0x1c9f24]['outboundNoSuchCallsDay']=0x0;_0x8a54bf[_0x1c9f24][_0x08c4('0x39')]=0x0;_0x8a54bf[_0x1c9f24][_0x08c4('0x3a')]=0x0;_0x8a54bf[_0x1c9f24][_0x08c4('0x3b')]=0x0;_0x8a54bf[_0x1c9f24][_0x08c4('0x3c')]=0x0;_0x8a54bf[_0x1c9f24]['outboundOriginateFailureCallsDay']=0x0;_0x8a54bf[_0x1c9f24][_0x08c4('0x3d')]=0x0;_0x8a54bf[_0x1c9f24]['outboundReCallsDay']=0x0;_0x8a54bf[_0x1c9f24][_0x08c4('0x3e')]=0x0;_0x8a54bf[_0x1c9f24][_0x08c4('0x3f')]=0x0;_0x8a54bf[_0x1c9f24][_0x08c4('0x40')]=!![];}}}}Realtime[_0x08c4('0x41')][_0x08c4('0x42')]=function(_0x41a9a7,_0x2b0b3d){for(var _0x32115f in _0x2b0b3d){if(_0x41a9a7['hasOwnProperty'](_0x32115f)){_0x41a9a7[_0x32115f]=_0x2b0b3d[_0x32115f];}}};Realtime['prototype']['initAgents']=function(){var _0x2fd789=this;return function(_0x22c62a){if(_0x22c62a){freeIsNotKeyAgent(_0x22c62a,_0x2fd789[_0x08c4('0x11')]);for(var _0x1ad6cc=0x0,_0x1b6b01={},_0x3f4cc4={};_0x1ad6cc<_0x22c62a[_0x08c4('0x43')];_0x1ad6cc+=0x1){_0x1b6b01=_0x22c62a[_0x1ad6cc];var _0xdd0ab2=_['isNil'](_0x1b6b01[_0x08c4('0x2b')])?util['format'](_0x08c4('0x28'),_0x1b6b01[_0x08c4('0x29')]):_0x1b6b01[_0x08c4('0x2b')];if(_['isUndefined'](_0x2fd789[_0x08c4('0x11')][_0xdd0ab2])){_0x2fd789['agents'][_0xdd0ab2]=new Agent(_0x1b6b01);}else{_0x2fd789[_0x08c4('0x42')](_0x2fd789['agents'][_0xdd0ab2],_0x1b6b01);}}}return _0x2fd789[_0x08c4('0x11')];};};Realtime[_0x08c4('0x41')]['initTelephones']=function(){var _0xedb01=this;return function(_0x24e776){if(_0x24e776){freeIsNotKeySip(_0x24e776,_0xedb01[_0x08c4('0x12')]);for(var _0x172979=0x0,_0x2b24ae={},_0x5cdd73={};_0x172979<_0x24e776[_0x08c4('0x43')];_0x172979+=0x1){_0x2b24ae=_0x24e776[_0x172979];if(_[_0x08c4('0x44')](_0xedb01['telephones'][util[_0x08c4('0x27')](_0x08c4('0x28'),_0x2b24ae['name'])])){_0xedb01['telephones'][util[_0x08c4('0x27')]('SIP/%s',_0x2b24ae[_0x08c4('0x29')])]=new Telephone(_0x2b24ae);}else{_0xedb01[_0x08c4('0x42')](_0xedb01[_0x08c4('0x12')][util[_0x08c4('0x27')](_0x08c4('0x28'),_0x2b24ae[_0x08c4('0x29')])],_0x2b24ae);}}}return _0xedb01[_0x08c4('0x12')];};};Realtime['prototype'][_0x08c4('0x45')]=function(){var _0x21d750=this;return function(_0x4b015a){if(_0x4b015a){freeIsNotKeySip(_0x4b015a,_0x21d750[_0x08c4('0x46')]);for(var _0x331610=0x0,_0x1cadd9={},_0x2c6a2d={};_0x331610<_0x4b015a[_0x08c4('0x43')];_0x331610+=0x1){_0x1cadd9=_0x4b015a[_0x331610];if(_[_0x08c4('0x44')](_0x21d750[_0x08c4('0x46')][util[_0x08c4('0x27')](_0x08c4('0x28'),_0x1cadd9[_0x08c4('0x29')])])){_0x21d750[_0x08c4('0x46')][util[_0x08c4('0x27')](_0x08c4('0x28'),_0x1cadd9['name'])]=new Trunk(_0x1cadd9);}else{_0x21d750[_0x08c4('0x42')](_0x21d750[_0x08c4('0x46')][util[_0x08c4('0x27')]('SIP/%s',_0x1cadd9[_0x08c4('0x29')])],_0x1cadd9);}}}return _0x21d750['trunks'];};};Realtime['prototype']['initVoiceQueues']=function(){var _0x237c5f=this;return function(_0x226b3f){if(_0x226b3f){freeIsNotKey(_0x226b3f,_0x237c5f[_0x08c4('0x13')],'name');for(var _0x1fa0b7=0x0,_0x107d45={},_0x1f2a14={};_0x1fa0b7<_0x226b3f['length'];_0x1fa0b7+=0x1){_0x107d45=_0x226b3f[_0x1fa0b7];if(_[_0x08c4('0x44')](_0x237c5f[_0x08c4('0x13')][_0x107d45['name']])){_0x237c5f[_0x08c4('0x13')][_0x107d45['name']]=new VoiceQueue(_0x107d45);}else{_0x237c5f[_0x08c4('0x42')](_0x237c5f[_0x08c4('0x13')][_0x107d45[_0x08c4('0x29')]],_0x107d45);}}}return _0x237c5f['voiceQueues'];};};Realtime[_0x08c4('0x41')]['initTriggers']=function(){var _0x29573e=this;return function(_0x8c1448){if(_0x8c1448){freeIsNotKey(_0x8c1448,_0x29573e['triggers'],'id');for(var _0x4916b5=0x0,_0x17341d={},_0x421007={};_0x4916b5<_0x8c1448['length'];_0x4916b5+=0x1){_0x17341d=_0x8c1448[_0x4916b5];if(_['isUndefined'](_0x29573e['triggers'][_0x17341d['id']])){_0x29573e['triggers'][_0x17341d['id']]=new Trigger(_0x17341d);}else{_0x29573e[_0x08c4('0x42')](_0x29573e[_0x08c4('0x14')][_0x17341d['id']],_0x17341d);}}}return _0x29573e[_0x08c4('0x14')];};};Realtime[_0x08c4('0x41')][_0x08c4('0x47')]=function(){var _0x226462=this;return function(_0x25e25a){if(_0x25e25a){freeIsNotKey(_0x25e25a,_0x226462[_0x08c4('0x16')],'id');for(var _0x5b7788=0x0,_0x23f549={},_0x44bb2b={};_0x5b7788<_0x25e25a['length'];_0x5b7788+=0x1){_0x23f549=_0x25e25a[_0x5b7788];if(_['isUndefined'](_0x226462['templates'][_0x23f549['id']])){_0x226462[_0x08c4('0x16')][_0x23f549['id']]=new Template(_0x23f549);}else{_0x226462[_0x08c4('0x42')](_0x226462[_0x08c4('0x16')][_0x23f549['id']],_0x23f549);}}}return _0x226462[_0x08c4('0x16')];};};Realtime[_0x08c4('0x41')][_0x08c4('0x48')]=function(){var _0x52abd4=this;return function(_0x3dfba2){if(_0x3dfba2){freeIsNotKey(_0x3dfba2,_0x52abd4[_0x08c4('0x49')],'id');for(var _0x245b8f=0x0,_0x39ba06={},_0x21a1ef={};_0x245b8f<_0x3dfba2[_0x08c4('0x43')];_0x245b8f+=0x1){_0x39ba06=_0x3dfba2[_0x245b8f];if(_['isUndefined'](_0x52abd4['zendeskAccounts'][_0x39ba06['id']])){_0x52abd4[_0x08c4('0x49')][_0x39ba06['id']]=new ZendeskAccount(_0x39ba06);}else{_0x52abd4[_0x08c4('0x42')](_0x52abd4[_0x08c4('0x49')][_0x39ba06['id']],_0x39ba06);}}}return _0x52abd4['zendeskAccounts'];};};Realtime[_0x08c4('0x41')]['initSalesforceAccounts']=function(){var _0x808a37=this;return function(_0x4608f9){if(_0x4608f9){freeIsNotKey(_0x4608f9,_0x808a37[_0x08c4('0x4a')],'id');for(var _0xec78d5=0x0,_0x14d231={},_0x272347={};_0xec78d5<_0x4608f9[_0x08c4('0x43')];_0xec78d5+=0x1){_0x14d231=_0x4608f9[_0xec78d5];if(_[_0x08c4('0x44')](_0x808a37['salesforceAccounts'][_0x14d231['id']])){_0x808a37[_0x08c4('0x4a')][_0x14d231['id']]=new SalesforceAccount(_0x14d231);}else{_0x808a37[_0x08c4('0x42')](_0x808a37[_0x08c4('0x4a')][_0x14d231['id']],_0x14d231);}}}return _0x808a37[_0x08c4('0x4a')];};};Realtime[_0x08c4('0x41')][_0x08c4('0x4b')]=function(){var _0x3b050c=this;return function(_0x188219){if(_0x188219){freeIsNotKey(_0x188219,_0x3b050c[_0x08c4('0x1f')],'id');for(var _0x45f55e=0x0,_0x80428d={},_0x516e61={};_0x45f55e<_0x188219[_0x08c4('0x43')];_0x45f55e+=0x1){_0x80428d=_0x188219[_0x45f55e];if(_['isUndefined'](_0x3b050c[_0x08c4('0x1f')][_0x80428d['id']])){_0x3b050c[_0x08c4('0x1f')][_0x80428d['id']]=new FreshdeskAccount(_0x80428d);}else{_0x3b050c[_0x08c4('0x42')](_0x3b050c[_0x08c4('0x1f')][_0x80428d['id']],_0x80428d);}}}return _0x3b050c[_0x08c4('0x1f')];};};Realtime[_0x08c4('0x41')][_0x08c4('0x4c')]=function(){var _0x4fca86=this;return function(_0x1d4882){if(_0x1d4882){freeIsNotKey(_0x1d4882,_0x4fca86[_0x08c4('0x4d')],'id');for(var _0xaed68f=0x0,_0x418dac={},_0x3efc8a={};_0xaed68f<_0x1d4882[_0x08c4('0x43')];_0xaed68f+=0x1){_0x418dac=_0x1d4882[_0xaed68f];if(_[_0x08c4('0x44')](_0x4fca86[_0x08c4('0x4d')][_0x418dac['id']])){_0x4fca86['zohoAccounts'][_0x418dac['id']]=new ZohoAccount(_0x418dac);}else{_0x4fca86[_0x08c4('0x42')](_0x4fca86[_0x08c4('0x4d')][_0x418dac['id']],_0x418dac);}}}return _0x4fca86[_0x08c4('0x4d')];};};Realtime[_0x08c4('0x41')][_0x08c4('0x4e')]=function(){var _0x4dd4c0=this;return function(_0x4a4108){if(_0x4a4108){freeIsNotKey(_0x4a4108,_0x4dd4c0['deskAccounts'],'id');for(var _0x1389c9=0x0,_0x4e1178={},_0x51c450={};_0x1389c9<_0x4a4108['length'];_0x1389c9+=0x1){_0x4e1178=_0x4a4108[_0x1389c9];if(_[_0x08c4('0x44')](_0x4dd4c0[_0x08c4('0x20')][_0x4e1178['id']])){_0x4dd4c0['deskAccounts'][_0x4e1178['id']]=new DeskAccount(_0x4e1178);}else{_0x4dd4c0[_0x08c4('0x42')](_0x4dd4c0[_0x08c4('0x20')][_0x4e1178['id']],_0x4e1178);}}}return _0x4dd4c0['deskAccounts'];};};Realtime[_0x08c4('0x41')][_0x08c4('0x4f')]=function(){var _0x23ad2f=this;return function(_0x1e5d74){if(_0x1e5d74){freeIsNotKey(_0x1e5d74,_0x23ad2f[_0x08c4('0x1e')],'id');for(var _0x39555e=0x0,_0x354287={},_0x184c41={};_0x39555e<_0x1e5d74[_0x08c4('0x43')];_0x39555e+=0x1){_0x354287=_0x1e5d74[_0x39555e];if(_[_0x08c4('0x44')](_0x23ad2f[_0x08c4('0x1e')][_0x354287['id']])){_0x23ad2f[_0x08c4('0x1e')][_0x354287['id']]=new SugarcrmAccount(_0x354287);}else{_0x23ad2f[_0x08c4('0x42')](_0x23ad2f['sugarcrmAccounts'][_0x354287['id']],_0x354287);}}}return _0x23ad2f[_0x08c4('0x1e')];};};Realtime[_0x08c4('0x41')][_0x08c4('0x50')]=function(){var _0x1c7bd5=this;return function(_0x32b1c8){if(_0x32b1c8){freeIsNotKey(_0x32b1c8,_0x1c7bd5[_0x08c4('0x21')],'id');for(var _0xc4a8fe=0x0,_0x27d199={},_0x3155fa={};_0xc4a8fe<_0x32b1c8[_0x08c4('0x43')];_0xc4a8fe+=0x1){_0x27d199=_0x32b1c8[_0xc4a8fe];if(_[_0x08c4('0x44')](_0x1c7bd5[_0x08c4('0x21')][_0x27d199['id']])){_0x1c7bd5['vtigerAccounts'][_0x27d199['id']]=new VtigerAccount(_0x27d199);}else{_0x1c7bd5[_0x08c4('0x42')](_0x1c7bd5[_0x08c4('0x21')][_0x27d199['id']],_0x27d199);}}}return _0x1c7bd5[_0x08c4('0x21')];};};Realtime[_0x08c4('0x41')][_0x08c4('0x51')]=function(){var _0x2b7e46=this;return function(_0x4e259d){if(_0x4e259d){freeIsNotKey(_0x4e259d,_0x2b7e46[_0x08c4('0x22')],'id');for(var _0x516222=0x0,_0x362add={},_0x5bffaa={};_0x516222<_0x4e259d[_0x08c4('0x43')];_0x516222+=0x1){_0x362add=_0x4e259d[_0x516222];if(_['isUndefined'](_0x2b7e46[_0x08c4('0x22')][_0x362add['id']])){_0x2b7e46[_0x08c4('0x22')][_0x362add['id']]=new ServicenowAccount(_0x362add);}else{_0x2b7e46[_0x08c4('0x42')](_0x2b7e46['servicenowAccounts'][_0x362add['id']],_0x362add);}}}return _0x2b7e46[_0x08c4('0x22')];};};Realtime[_0x08c4('0x41')][_0x08c4('0x52')]=function(){var _0x5b3fcf=this;return function(_0x3cb345){if(_0x3cb345){freeIsNotKey(_0x3cb345,_0x5b3fcf[_0x08c4('0x23')],'id');for(var _0x29dd13=0x0,_0x10c282={},_0x26eccc={};_0x29dd13<_0x3cb345[_0x08c4('0x43')];_0x29dd13+=0x1){_0x10c282=_0x3cb345[_0x29dd13];if(_[_0x08c4('0x44')](_0x5b3fcf[_0x08c4('0x23')][_0x10c282['id']])){_0x5b3fcf[_0x08c4('0x23')][_0x10c282['id']]=new Dynamics365Account(_0x10c282);}else{_0x5b3fcf[_0x08c4('0x42')](_0x5b3fcf[_0x08c4('0x23')][_0x10c282['id']],_0x10c282);}}}return _0x5b3fcf[_0x08c4('0x23')];};};Realtime['prototype'][_0x08c4('0x53')]=function(){var _0x122cbc=this;return function(_0x57ca31){if(_0x57ca31){freeIsNotKey(_0x57ca31,_0x122cbc[_0x08c4('0x54')],'id');for(var _0x53674f=0x0,_0x3e6c6b={},_0x4bc3e2={};_0x53674f<_0x57ca31[_0x08c4('0x43')];_0x53674f+=0x1){_0x3e6c6b=_0x57ca31[_0x53674f];if(_[_0x08c4('0x44')](_0x122cbc[_0x08c4('0x54')][_0x3e6c6b['id']])){_0x122cbc['freshsalesAccounts'][_0x3e6c6b['id']]=new FreshsalesAccount(_0x3e6c6b);}else{_0x122cbc[_0x08c4('0x42')](_0x122cbc['freshsalesAccounts'][_0x3e6c6b['id']],_0x3e6c6b);}}}return _0x122cbc[_0x08c4('0x54')];};};Realtime[_0x08c4('0x41')]['initVoiceQueueHopperHistory']=function(){var _0x375be6=this;return function(_0x3c3869){for(var _0x416387=0x0;_0x416387<_0x3c3869[_0x08c4('0x43')];_0x416387+=0x1){_['merge'](_0x375be6['voiceQueues'][_0x3c3869[_0x416387]['name']],_0x3c3869[_0x416387]);}return _0x375be6[_0x08c4('0x13')];};};Realtime[_0x08c4('0x41')]['initVoiceQueueReports']=function(){var _0xfac10e=this;return function(_0xfa2417){clearVoiceQueues(_0xfac10e[_0x08c4('0x13')]);if(_0xfa2417){_0xfa2417=_[_0x08c4('0x55')](_0xfa2417,'uniqueid');for(var _0x5b1c9b in _0xfa2417){if(_0xfa2417['hasOwnProperty'](_0x5b1c9b)){var _0x1d705f={};for(var _0x17b3a6=0x0;_0x17b3a6<_0xfa2417[_0x5b1c9b]['length'];_0x17b3a6+=0x1){var _0x5ea1f2=_0xfa2417[_0x5b1c9b][_0x17b3a6]['queue'];if(_0xfac10e[_0x08c4('0x13')][_0x5ea1f2]){if(_0xfa2417[_0x5b1c9b][_0x17b3a6][_0x08c4('0x56')]){_0xfac10e[_0x08c4('0x13')][_0x5ea1f2]['unmanaged']+=0x1;}if(_0xfa2417[_0x5b1c9b][_0x17b3a6]['queuecallerabandon']){_0xfac10e[_0x08c4('0x13')][_0x5ea1f2][_0x08c4('0x35')]+=0x1;}_0xfac10e['voiceQueues'][_0x5ea1f2][_0x08c4('0x2e')]+=moment(_0xfa2417[_0x5b1c9b][_0x17b3a6][_0x08c4('0x57')])[_0x08c4('0x58')](moment(_0xfa2417[_0x5b1c9b][_0x17b3a6]['queuecallerjoinAt']),'seconds')||0x0;if(_0x17b3a6===_0xfa2417[_0x5b1c9b][_0x08c4('0x43')]-0x1){_0xfac10e[_0x08c4('0x13')][_0x5ea1f2]['sumDuration']+=moment(_0xfa2417[_0x5b1c9b][_0x17b3a6][_0x08c4('0x59')]||_0xfa2417[_0x5b1c9b][_0x17b3a6][_0x08c4('0x5a')]||_0xfa2417[_0x5b1c9b][_0x17b3a6][_0x08c4('0x5b')])[_0x08c4('0x58')](moment(_0xfa2417[_0x5b1c9b][_0x17b3a6][_0x08c4('0x5c')]),_0x08c4('0x5d'))||0x0;_0xfac10e[_0x08c4('0x13')][_0x5ea1f2][_0x08c4('0x2c')]+=0x1;if(_0xfa2417[_0x5b1c9b][_0x17b3a6]['queuecallercomplete']){_0xfac10e[_0x08c4('0x13')][_0x5ea1f2]['answered']+=0x1;_0xfac10e[_0x08c4('0x13')][_0x5ea1f2][_0x08c4('0x30')]+=moment(_0xfa2417[_0x5b1c9b][_0x17b3a6]['queuecallercompleteAt'])[_0x08c4('0x58')](moment(_0xfa2417[_0x5b1c9b][_0x17b3a6]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0xfac10e[_0x08c4('0x13')][_0x5ea1f2][_0x08c4('0x2f')]+=_0xfac10e[_0x08c4('0x13')][_0x5ea1f2][_0x08c4('0x2e')]||0x0;}}}}}}return _0xfac10e[_0x08c4('0x13')];};};Realtime[_0x08c4('0x41')]['initVoiceCallReports']=function(){var _0x46ae92=this;return function(_0x57db09){clearVoiceCallReports(_0x46ae92[_0x08c4('0x17')]);if(_0x57db09){for(var _0x20b1bf=0x0;_0x20b1bf<_0x57db09[_0x08c4('0x43')];_0x20b1bf+=0x1){_0x46ae92[_0x08c4('0x17')]['total']+=0x1;_0x46ae92[_0x08c4('0x17')]['sumDuration']+=_0x57db09[_0x20b1bf][_0x08c4('0x5e')];if(_0x57db09[_0x20b1bf][_0x08c4('0x5f')]==='ANSWERED'){_0x46ae92[_0x08c4('0x17')][_0x08c4('0x2d')]+=0x1;_0x46ae92[_0x08c4('0x17')][_0x08c4('0x2e')]+=_0x57db09[_0x20b1bf]['duration']-_0x57db09[_0x20b1bf]['billableseconds']||0x0;_0x46ae92[_0x08c4('0x17')][_0x08c4('0x30')]+=_0x57db09[_0x20b1bf][_0x08c4('0x60')];}}}return _0x46ae92[_0x08c4('0x17')];};};Realtime['prototype'][_0x08c4('0x61')]=function(){var _0x491be7=this;return function(_0x3de5c2){if(_0x3de5c2){freeIsNotKey(_0x3de5c2,_0x491be7[_0x08c4('0x15')],'name');for(var _0x506a95=0x0,_0x23d7c7={};_0x506a95<_0x3de5c2[_0x08c4('0x43')];_0x506a95+=0x1){_0x23d7c7=_0x3de5c2[_0x506a95];if(_[_0x08c4('0x44')](_0x491be7[_0x08c4('0x15')][_0x23d7c7['name']])){_0x491be7['campaigns'][_0x23d7c7[_0x08c4('0x29')]]=new Campaign(_0x23d7c7);}else{_0x491be7[_0x08c4('0x42')](_0x491be7[_0x08c4('0x15')][_0x23d7c7[_0x08c4('0x29')]],_0x23d7c7);_0x491be7['campaigns'][_0x23d7c7[_0x08c4('0x29')]][_0x08c4('0x62')]=_0x23d7c7['SquareProject']?_0x23d7c7[_0x08c4('0x63')][_0x08c4('0x29')]:undefined;}}}return _0x491be7['campaigns'];};};Realtime[_0x08c4('0x41')][_0x08c4('0x64')]=function(){var _0x9c4ef5=this;return function(_0xc12c11){if(_0xc12c11){freeIsNotKey(_0xc12c11,_0x9c4ef5[_0x08c4('0x18')],'id');for(var _0xe3214a=0x0,_0x2d4179={};_0xe3214a<_0xc12c11[_0x08c4('0x43')];_0xe3214a+=0x1){_0x2d4179=_0xc12c11[_0xe3214a];if(_[_0x08c4('0x44')](_0x9c4ef5[_0x08c4('0x18')][_0x2d4179['id']])){_0x9c4ef5[_0x08c4('0x18')][_0x2d4179['id']]=new VoiceExtension(_0x2d4179);}else{_0x9c4ef5[_0x08c4('0x42')](_0x9c4ef5[_0x08c4('0x18')][_0x2d4179['id']],_0x2d4179);}}}return _0x9c4ef5[_0x08c4('0x18')];};};Realtime[_0x08c4('0x41')][_0x08c4('0x65')]=function(){var _0x220b96=this;return function(_0x528409){clearCampaigns(_0x220b96['campaigns']);for(var _0x11e61e=0x0;_0x11e61e<_0x528409[_0x08c4('0x43')];_0x11e61e+=0x1){_[_0x08c4('0x66')](_0x220b96['campaigns'][_0x528409[_0x11e61e]['name']],_0x528409[_0x11e61e]);}return _0x220b96[_0x08c4('0x15')];};};Realtime[_0x08c4('0x41')]['initFaxAccounts']=function(){var _0x7d128a=this;return function(_0x1e1aec){if(_0x1e1aec){freeIsNotKey(_0x1e1aec,_0x7d128a[_0x08c4('0x24')],'id');for(var _0x2e15a7=0x0,_0x20eb79={},_0x2d2db2={};_0x2e15a7<_0x1e1aec['length'];_0x2e15a7+=0x1){_0x20eb79=_0x1e1aec[_0x2e15a7];if(_['isUndefined'](_0x7d128a['faxAccounts'][_0x20eb79['id']])){_0x7d128a[_0x08c4('0x24')][_0x20eb79['id']]=new FaxAccount(_0x20eb79);}else{_0x7d128a['mergeFromDatabase'](_0x7d128a[_0x08c4('0x24')][_0x20eb79['id']],_0x20eb79);}}}return _0x7d128a[_0x08c4('0x24')];};};module[_0x08c4('0x67')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index deb67a6..f3751b5 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 _0x1782=['bind','custom:voiceCallReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindTransfer','attendedTransfer','prototype','findAgent','find','accountcode','name','isNil','interface','format','SIP/%s','length','connectedlinenum','assigned','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','getAgentByInternal','keys','voiceCallReport','destination','exten','type','dialer','queue','context','callerid','from-sip','xcally-motion-preview','destinationchannel','channel','originatecalleridnum','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','calleridnum','transfers','linkedid','transfereelinkedid','uniqueid','internal','UserId','split','monitor','monitors','monitorFilename','createdAt','connectedlinename','membername','xcally-motion-dialer','isArray','forEach','startsWith','indexOf','mobile','phone','lastIndexOf','lodash','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceQueueReport','./voiceQueueReport','./voiceCallReport','realtime','agents','telephones','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport'];(function(_0x1f7109,_0x50131a){var _0x1c9771=function(_0x2f86ac){while(--_0x2f86ac){_0x1f7109['push'](_0x1f7109['shift']());}};_0x1c9771(++_0x50131a);}(_0x1782,0x13e));var _0x2178=function(_0x2ba17a,_0x319cdf){_0x2ba17a=_0x2ba17a-0x0;var _0x2aa132=_0x1782[_0x2ba17a];return _0x2aa132;};'use strict';var _=require(_0x2178('0x0'));var moment=require('moment');var util=require(_0x2178('0x1'));var config=require(_0x2178('0x2'));var ami=require(_0x2178('0x3'));var RpcVoiceAgentReport=require(_0x2178('0x4'));var RpcVoiceCallReport=require(_0x2178('0x5'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x2178('0x6'));var RpcVoiceQueueReport=require(_0x2178('0x7'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x2178('0x8'));var VoiceCallReport=require(_0x2178('0x9'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require('./voiceDialReport');var UserReport=require('./userReport');function Report(_0x3b4115){this[_0x2178('0xa')]=_0x3b4115;this[_0x2178('0xb')]=_0x3b4115[_0x2178('0xb')];this[_0x2178('0xc')]=_0x3b4115[_0x2178('0xc')];}Report['prototype'][_0x2178('0xd')]=function(_0x201b7b){var _0x33a201=new VoiceQueueReport(this[_0x2178('0xa')]);var _0x46db79=new VoiceAgentReport(this[_0x2178('0xa')]);var _0xbdb1e5=new VoiceDialReport(this[_0x2178('0xa')]);var _0x3a4284=new VoiceCallReport(this[_0x2178('0xa')]);var _0x5f1d29=new UserReport(this[_0x2178('0xa')]);if(config[_0x2178('0xe')]&&config['xdr'][_0x2178('0xf')]){ami['on'](_0x2178('0x10'),this[_0x2178('0x11')][_0x2178('0x12')](this));ami['on'](_0x2178('0x13'),this['voiceCallReport']['bind'](this));ami['on']('custom:voiceAgentReport',this[_0x2178('0x14')]['bind'](this));ami['on'](_0x2178('0x15'),this[_0x2178('0x16')]['bind'](this));ami['on']('blindtransfer',this[_0x2178('0x17')][_0x2178('0x12')](this));ami['on']('attendedtransfer',this[_0x2178('0x18')][_0x2178('0x12')](this));}};Report[_0x2178('0x19')][_0x2178('0x1a')]=function(_0x218785){var _0x443b2a;_0x443b2a=_[_0x2178('0x1b')](this[_0x2178('0xb')],function(_0x3e308b){return _0x3e308b[_0x2178('0x1c')]==_0x218785||_0x3e308b[_0x2178('0x1d')]==_0x218785;});if(_[_0x2178('0x1e')](_0x443b2a)){var _0x5ac6de=_[_0x2178('0x1b')](this[_0x2178('0xc')],function(_0x2b876b){return _0x2b876b[_0x2178('0x1c')]==_0x218785||_0x2b876b[_0x2178('0x1d')]==_0x218785;});if(_0x5ac6de){_0x443b2a=_[_0x2178('0x1b')](this[_0x2178('0xb')],function(_0x3291cd){return _0x3291cd[_0x2178('0x1f')]==util[_0x2178('0x20')](_0x2178('0x21'),_0x5ac6de[_0x2178('0x1d')]);});}}return _0x443b2a;};Report[_0x2178('0x19')][_0x2178('0x11')]=function(_0x35dcb9){for(var _0x1199fb=0x0;_0x1199fb<_0x35dcb9[_0x2178('0x22')];_0x1199fb+=0x1){var _0x3ddb6d=this[_0x2178('0x1a')](_0x35dcb9[_0x1199fb][_0x2178('0x23')]);if(_0x3ddb6d){_0x35dcb9[_0x1199fb][_0x2178('0x1c')]=_0x3ddb6d[_0x2178('0x1c')];_0x35dcb9[_0x1199fb][_0x2178('0x24')]=!![];_0x35dcb9[_0x1199fb]['lastAssignedTo']=_0x3ddb6d[_0x2178('0x1d')];_0x35dcb9[_0x1199fb][_0x2178('0x1f')]=_['isNil'](_0x3ddb6d['interface'])?util[_0x2178('0x20')]('SIP/%s',_0x3ddb6d[_0x2178('0x1d')]):_0x3ddb6d[_0x2178('0x1f')];if(_0x35dcb9[_0x1199fb][_0x2178('0x25')]){_0x35dcb9[_0x1199fb]['queuecallercompleteAt']=moment()['format'](_0x2178('0x26'));}if(_0x35dcb9[_0x1199fb][_0x2178('0x27')]){_0x35dcb9[_0x1199fb][_0x2178('0x28')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0x2178('0x11')](_0x35dcb9[_0x1199fb]);}RpcVoiceQueueReport[_0x2178('0x29')](_0x35dcb9[_0x1199fb]);}};function extractCalleridNumber(_0x4020b1){var _0x3e3ddf=_0x4020b1[_0x2178('0x2a')](/<(.*?)>/);return _0x3e3ddf?_0x3e3ddf[0x1]:_0x4020b1;}Report[_0x2178('0x19')][_0x2178('0x2b')]=function(_0x4b4875){for(var _0x84b7a5=0x0;_0x84b7a5','calleridname','transfers','linkedid','uniqueid','blindTransfer','internal','UserId','split','membername','create','monitor','monitors','monitorFilename','createdAt','exten','xcally-motion-preview','connectedlinename','forEach','Local','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','realtime','agents','telephones','prototype','xdr','disabled','bind','custom:voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','accountcode','isNil','find','name','voiceQueueReport','length','findAgent','connectedlinenum','assigned','lastAssignedTo','interface','format','SIP/%s','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','match','getAgentByInternal','keys','voiceCallReport','type','dialer','queue','lastdata','context','destination','callerid','from-sip','calleridpreview','calleridnum','originatecalleridnum'];(function(_0x2e04ef,_0x31a596){var _0x5722b0=function(_0x386fbd){while(--_0x386fbd){_0x2e04ef['push'](_0x2e04ef['shift']());}};_0x5722b0(++_0x31a596);}(_0x0cee,0x12f));var _0xe0ce=function(_0x43f47b,_0x19f40d){_0x43f47b=_0x43f47b-0x0;var _0x5ba225=_0x0cee[_0x43f47b];return _0x5ba225;};'use strict';var _=require(_0xe0ce('0x0'));var moment=require(_0xe0ce('0x1'));var util=require(_0xe0ce('0x2'));var config=require(_0xe0ce('0x3'));var ami=require(_0xe0ce('0x4'));var RpcVoiceAgentReport=require(_0xe0ce('0x5'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0xe0ce('0x6'));var RpcVoiceQueueReport=require(_0xe0ce('0x7'));var RpcVoiceRecording=require(_0xe0ce('0x8'));var RpcVoiceTransferReport=require(_0xe0ce('0x9'));var VoiceQueueReport=require(_0xe0ce('0xa'));var VoiceCallReport=require(_0xe0ce('0xb'));var VoiceAgentReport=require(_0xe0ce('0xc'));var VoiceDialReport=require(_0xe0ce('0xd'));var UserReport=require('./userReport');function Report(_0x27eea3){this[_0xe0ce('0xe')]=_0x27eea3;this['agents']=_0x27eea3[_0xe0ce('0xf')];this[_0xe0ce('0x10')]=_0x27eea3[_0xe0ce('0x10')];}Report[_0xe0ce('0x11')]['sync']=function(_0x48a0a4){var _0x5cf1d8=new VoiceQueueReport(this[_0xe0ce('0xe')]);var _0x441e01=new VoiceAgentReport(this[_0xe0ce('0xe')]);var _0x2698f8=new VoiceDialReport(this[_0xe0ce('0xe')]);var _0x3a0754=new VoiceCallReport(this[_0xe0ce('0xe')]);var _0x4598e1=new UserReport(this[_0xe0ce('0xe')]);if(config[_0xe0ce('0x12')]&&config[_0xe0ce('0x12')][_0xe0ce('0x13')]){ami['on']('custom:voiceQueueReport',this['voiceQueueReport'][_0xe0ce('0x14')](this));ami['on'](_0xe0ce('0x15'),this['voiceCallReport']['bind'](this));ami['on'](_0xe0ce('0x16'),this[_0xe0ce('0x17')][_0xe0ce('0x14')](this));ami['on'](_0xe0ce('0x18'),this[_0xe0ce('0x19')]['bind'](this));ami['on'](_0xe0ce('0x1a'),this['blindTransfer'][_0xe0ce('0x14')](this));ami['on'](_0xe0ce('0x1b'),this[_0xe0ce('0x1c')][_0xe0ce('0x14')](this));}};Report[_0xe0ce('0x11')]['findAgent']=function(_0x59bcab){var _0xadcb66;_0xadcb66=_['find'](this['agents'],function(_0x2875bf){return _0x2875bf[_0xe0ce('0x1d')]==_0x59bcab||_0x2875bf['name']==_0x59bcab;});if(_[_0xe0ce('0x1e')](_0xadcb66)){var _0x96c2a4=_[_0xe0ce('0x1f')](this[_0xe0ce('0x10')],function(_0x3b1975){return _0x3b1975['accountcode']==_0x59bcab||_0x3b1975[_0xe0ce('0x20')]==_0x59bcab;});if(_0x96c2a4){_0xadcb66=_['find'](this[_0xe0ce('0xf')],function(_0x4a394d){return _0x4a394d['interface']==util['format']('SIP/%s',_0x96c2a4[_0xe0ce('0x20')]);});}}return _0xadcb66;};Report['prototype'][_0xe0ce('0x21')]=function(_0x21f9c3){for(var _0x33211a=0x0;_0x33211a<_0x21f9c3[_0xe0ce('0x22')];_0x33211a+=0x1){var _0x3a8c3e=this[_0xe0ce('0x23')](_0x21f9c3[_0x33211a][_0xe0ce('0x24')]);if(_0x3a8c3e){_0x21f9c3[_0x33211a][_0xe0ce('0x1d')]=_0x3a8c3e[_0xe0ce('0x1d')];_0x21f9c3[_0x33211a][_0xe0ce('0x25')]=!![];_0x21f9c3[_0x33211a][_0xe0ce('0x26')]=_0x3a8c3e[_0xe0ce('0x20')];_0x21f9c3[_0x33211a]['interface']=_[_0xe0ce('0x1e')](_0x3a8c3e[_0xe0ce('0x27')])?util[_0xe0ce('0x28')](_0xe0ce('0x29'),_0x3a8c3e['name']):_0x3a8c3e[_0xe0ce('0x27')];if(_0x21f9c3[_0x33211a][_0xe0ce('0x2a')]){_0x21f9c3[_0x33211a]['queuecallercompleteAt']=moment()[_0xe0ce('0x28')](_0xe0ce('0x2b'));}if(_0x21f9c3[_0x33211a][_0xe0ce('0x2c')]){_0x21f9c3[_0x33211a][_0xe0ce('0x2d')]=moment()[_0xe0ce('0x28')](_0xe0ce('0x2b'));}RpcMemberReport[_0xe0ce('0x21')](_0x21f9c3[_0x33211a]);}RpcVoiceQueueReport['create'](_0x21f9c3[_0x33211a]);}};function extractCalleridNumber(_0x1a95a7){var _0x2d06ab=_0x1a95a7[_0xe0ce('0x2e')](/<(.*?)>/);return _0x2d06ab?_0x2d06ab[0x1]:_0x1a95a7;}Report[_0xe0ce('0x11')][_0xe0ce('0x2f')]=function(_0x1271c3){for(var _0x108260=0x0;_0x1082600x0?_0x15b698:0x0;this[_0x14d4('0x11')][_0xad45fa[_0x14d4('0x6c')]]['talking']=this[_0x14d4('0x11')][_0xad45fa[_0x14d4('0x6c')]][_0x14d4('0x5e')]>_[_0x14d4('0x71')](_0xad45fa[_0x14d4('0x72')])?_[_0x14d4('0x71')](_0xad45fa[_0x14d4('0x72')]):this['voiceQueues'][_0xad45fa['queue']][_0x14d4('0x5e')];this[_0x14d4('0x73')](this[_0x14d4('0x11')][_0xad45fa[_0x14d4('0x6c')]],_0x14d4('0x15'));}logger[_0x14d4('0x4a')](_0x14d4('0x74'),util[_0x14d4('0x40')](this['voiceQueues'][_0xad45fa[_0x14d4('0x6c')]],{'showHidden':![],'depth':null}));ami[_0x14d4('0x48')](_0x14d4('0x75'),this['voiceQueues'][_0xad45fa[_0x14d4('0x6c')]]);}}}catch(_0x5ca5be){logger[_0x14d4('0x3e')]('[voiceQueueReport][queuesummary]',util[_0x14d4('0x40')](_0x5ca5be,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x14d4('0x34')][_0x14d4('0x19')]=function(_0x58a8db){logger['debug'](_0x14d4('0x76'),util[_0x14d4('0x40')](_0x58a8db,{'showHidden':![],'depth':null}));this[_0x14d4('0x12')]=!![];};VoiceQueueReport[_0x14d4('0x34')][_0x14d4('0x77')]=function(_0x59c2d4){try{if(this[_0x14d4('0x68')](_0x59c2d4)){logger[_0x14d4('0x4a')](_0x14d4('0x78'),_0x59c2d4[_0x14d4('0x4d')],util[_0x14d4('0x40')](_0x59c2d4,{'showHidden':![],'depth':null}));if(_[_0x14d4('0x69')](this[_0x14d4('0xe')][_0x59c2d4[_0x14d4('0x4d')]]))this[_0x14d4('0xe')][_0x59c2d4['uniqueid']]=[];if(_[_0x14d4('0x69')](this[_0x14d4('0x36')][_0x59c2d4[_0x14d4('0x4d')]]))this[_0x14d4('0x36')][_0x59c2d4[_0x14d4('0x4d')]]={};var _0x179d62=new QueueReport();_0x179d62['name']=_0x59c2d4['queue'];_0x179d62[_0x14d4('0x56')]=this[_0x14d4('0x11')][_0x179d62[_0x14d4('0x50')]]&&this[_0x14d4('0x11')][_0x179d62[_0x14d4('0x50')]][_0x14d4('0x56')]?this[_0x14d4('0x11')][_0x179d62[_0x14d4('0x50')]]['type']||'inbound':_0x14d4('0x79');_0x179d62['queue']=_0x59c2d4[_0x14d4('0x6c')];_0x179d62['queuecallerjoinAt']=moment()['format'](_0x14d4('0x7a'));_0x179d62['position']=_0x59c2d4[_0x14d4('0x7b')];_0x179d62[_0x14d4('0x7c')]=_0x59c2d4[_0x14d4('0x7c')];_0x179d62[_0x14d4('0x4d')]=_0x59c2d4[_0x14d4('0x4d')];_0x179d62['routealias']=this[_0x14d4('0x36')][_0x59c2d4[_0x14d4('0x4d')]][_0x14d4('0x7d')];logger['info'](_0x14d4('0x7e'),_0x179d62['name'],_0x179d62[_0x14d4('0x56')]);_[_0x14d4('0x7f')](_0x179d62,_[_0x14d4('0x80')](_0x59c2d4,_[_0x14d4('0x81')](_0x179d62)));this[_0x14d4('0xe')][_0x59c2d4[_0x14d4('0x4d')]][_0x14d4('0x82')](_0x179d62);this[_0x14d4('0x36')][_0x59c2d4[_0x14d4('0x4d')]]=_0x179d62;this[_0x14d4('0x49')](_0x179d62,'queuecallerjoin');}}catch(_0x54cdac){logger['error'](_0x14d4('0x78'),_0x59c2d4[_0x14d4('0x4d')],util['inspect'](_0x54cdac,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x14d4('0x34')][_0x14d4('0x1c')]=function(_0x5c20a2){try{if(this['isNotNull'](_0x5c20a2)){logger[_0x14d4('0x4a')](_0x14d4('0x83'),_0x5c20a2[_0x14d4('0x4d')],util[_0x14d4('0x40')](_0x5c20a2,{'showHidden':![],'depth':null}));if(this[_0x14d4('0xe')][_0x5c20a2['uniqueid']]){var _0x54d00a=_['last'](this[_0x14d4('0xe')][_0x5c20a2[_0x14d4('0x4d')]]);_0x54d00a[_0x14d4('0x84')]=![];_0x54d00a[_0x14d4('0x85')]=null;_0x54d00a[_0x14d4('0x86')]=_0x5c20a2[_0x14d4('0x86')];_0x54d00a[_0x14d4('0x87')]=_0x5c20a2[_0x14d4('0x87')];_0x54d00a[_0x14d4('0x1b')]=!![];_0x54d00a[_0x14d4('0x88')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x54d00a[_0x14d4('0x89')]=_0x14d4('0x8a');_0x54d00a['lastAssignedTo']=null;logger[_0x14d4('0x6d')](_0x14d4('0x8b'),_0x54d00a[_0x14d4('0x50')],_0x54d00a[_0x14d4('0x56')]);this[_0x14d4('0x36')][_0x5c20a2[_0x14d4('0x4d')]]=_0x54d00a;this[_0x14d4('0x46')](_0x54d00a,_0x14d4('0x1b'));}}}catch(_0x2d91ec){logger[_0x14d4('0x3e')](_0x14d4('0x83'),_0x5c20a2[_0x14d4('0x4d')],util[_0x14d4('0x40')](_0x2d91ec,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x14d4('0x1e')]=function(_0x3e1a7a){try{if(this[_0x14d4('0x68')](_0x3e1a7a)){logger['debug'](_0x14d4('0x8c'),_0x3e1a7a[_0x14d4('0x4d')],util[_0x14d4('0x40')](_0x3e1a7a,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x3e1a7a[_0x14d4('0x4d')]]){var _0x170d57=_[_0x14d4('0x8d')](this[_0x14d4('0xe')][_0x3e1a7a[_0x14d4('0x4d')]]);_0x170d57[_0x14d4('0x8e')]=moment()[_0x14d4('0x4e')](_0x14d4('0x7a'));_0x170d57[_0x14d4('0x8f')]=_0x3e1a7a[_0x14d4('0x8f')];_0x170d57[_0x14d4('0x90')]=_0x3e1a7a['connectedlinename'];logger[_0x14d4('0x6d')](_0x14d4('0x91'),_0x170d57[_0x14d4('0x50')],_0x170d57[_0x14d4('0x56')],_0x3e1a7a[_0x14d4('0x8f')],_0x3e1a7a['connectedlinename']);this[_0x14d4('0x36')][_0x3e1a7a['uniqueid']]=_0x170d57;this[_0x14d4('0x49')](_0x170d57,_0x14d4('0x1d'));}}}catch(_0x23ae8c){logger['error'](_0x14d4('0x8c'),_0x3e1a7a[_0x14d4('0x4d')],util['inspect'](_0x23ae8c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x14d4('0x34')]['syncAgentConnect']=function(_0xe48df6){try{if(this[_0x14d4('0x68')](_0xe48df6)){logger[_0x14d4('0x4a')](_0x14d4('0x92'),_0xe48df6[_0x14d4('0x4d')],util['inspect'](_0xe48df6,{'showHidden':![],'depth':null}));if(this[_0x14d4('0xe')][_0xe48df6['uniqueid']]){var _0x118af6=_[_0x14d4('0x8d')](this[_0x14d4('0xe')][_0xe48df6[_0x14d4('0x4d')]]);_0x118af6['queuecallercomplete']=!![];_0x118af6['queuecallerexitreason']=_0x14d4('0x93');logger[_0x14d4('0x6d')](_0x14d4('0x94'),_0x118af6[_0x14d4('0x50')],_0x118af6[_0x14d4('0x56')]);}}}catch(_0x51498d){logger['error'](_0x14d4('0x92'),_0xe48df6[_0x14d4('0x4d')],util[_0x14d4('0x40')](_0x51498d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x14d4('0x34')][_0x14d4('0x20')]=function(_0x569793){try{if(this[_0x14d4('0x68')](_0x569793)){logger[_0x14d4('0x4a')](_0x14d4('0x95'),_0x569793['uniqueid'],util[_0x14d4('0x40')](_0x569793,{'showHidden':![],'depth':null}));if(this[_0x14d4('0xe')][_0x569793['uniqueid']]){var _0x203688=_[_0x14d4('0x8d')](this[_0x14d4('0xe')][_0x569793[_0x14d4('0x4d')]]);_0x203688[_0x14d4('0x1b')]=![];_0x203688[_0x14d4('0x88')]=null;_0x203688[_0x14d4('0x96')]=!![];_0x203688[_0x14d4('0x97')]=_0x569793['membername'];_0x203688[_0x14d4('0x86')]=_0x569793['holdtime'];_0x203688[_0x14d4('0x84')]=!![];_0x203688[_0x14d4('0x98')]=![];_0x203688['queuecallerexitAt']=null;if(!_0x203688['transfer']){if(_0x569793[_0x14d4('0x99')]==_0x14d4('0x9a')){_0x203688[_0x14d4('0x89')]=_0x14d4('0x9b');logger[_0x14d4('0x6d')](_0x14d4('0x9c'),_0x203688[_0x14d4('0x50')],_0x203688[_0x14d4('0x56')]);}else{if(_[_0x14d4('0x9d')](_0x569793[_0x14d4('0x3b')][_0x14d4('0x9e')](),_0x14d4('0x9f'))){if(this[_0x14d4('0xe')][_0x569793[_0x14d4('0xa0')]]){var _0x547416=_['last'](this['queueReports'][_0x569793[_0x14d4('0xa0')]]);_0x547416[_0x14d4('0x84')]=![];_0x547416[_0x14d4('0x98')]=!![];_0x547416[_0x14d4('0xa1')]=moment(_0x203688[_0x14d4('0xa2')])[_0x14d4('0xa3')](_0x569793[_0x14d4('0x86')],_0x14d4('0xa4'))['format']('YYYY-MM-DD\x20HH:mm:ss');_0x547416[_0x14d4('0x89')]='FORWARDTRANSFER';_0x547416[_0x14d4('0x9a')]=!![];_0x547416[_0x14d4('0xa5')]=_0x14d4('0xa6');_0x547416['transferexten']=_0x569793['destexten'];_0x547416[_0x14d4('0xa7')]=_0x569793[_0x14d4('0x4d')];logger[_0x14d4('0x6d')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x547416['name'],_0x547416[_0x14d4('0x56')]);var _0x2420e1=this[_0x14d4('0xe')][_0x569793[_0x14d4('0xa0')]];this['queueReports'][_0x569793[_0x14d4('0xa0')]]=this[_0x14d4('0xe')][_0x569793[_0x14d4('0x4d')]];this[_0x14d4('0xe')][_0x569793[_0x14d4('0x4d')]]=_0x2420e1;}}else{_0x203688[_0x14d4('0x89')]=_0x14d4('0xa8')+_0x569793[_0x14d4('0x99')][_0x14d4('0xa9')]();logger[_0x14d4('0x6d')](_0x14d4('0xaa'),_0x203688[_0x14d4('0x50')],_0x203688[_0x14d4('0x56')],_0x203688[_0x14d4('0x89')]);}}}this[_0x14d4('0x36')][_0x569793[_0x14d4('0x4d')]]=_0x203688;this[_0x14d4('0x46')](_0x203688,_0x14d4('0x1f'));}}}catch(_0x2634c3){logger[_0x14d4('0x3e')](_0x14d4('0x95'),_0x569793[_0x14d4('0x4d')],util[_0x14d4('0x40')](_0x2634c3,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x14d4('0x24')]=function(_0x405c10){try{if(this['isNotNull'](_0x405c10)){logger[_0x14d4('0x4a')](_0x14d4('0xab'),_0x405c10[_0x14d4('0x4d')],util[_0x14d4('0x40')](_0x405c10,{'showHidden':![],'depth':null}));this[_0x14d4('0xac')](_0x405c10[_0x14d4('0x4d')],_[_0x14d4('0x81')](_0x405c10[_0x14d4('0xad')])[0x0],_0x405c10[_0x14d4('0xae')]);if(this[_0x14d4('0xe')][_0x405c10['uniqueid']]){var _0x1806e0=_[_0x14d4('0x8d')](this[_0x14d4('0xe')][_0x405c10['uniqueid']]);if(_0x1806e0){if(this['isNotNull'](_0x405c10['variable'])&&this[_0x14d4('0x68')](_0x405c10['variable'][_0x14d4('0xaf')])){switch(_0x405c10[_0x14d4('0xae')]){case _0x14d4('0xb0'):_0x1806e0[_0x14d4('0x98')]=![];_0x1806e0[_0x14d4('0xa1')]=null;break;case _0x14d4('0xb1'):_0x1806e0['lastevent']=_0x14d4('0xb2');_0x1806e0[_0x14d4('0x98')]=!![];_0x1806e0[_0x14d4('0xa1')]=moment()[_0x14d4('0x4e')](_0x14d4('0x7a'));_0x1806e0['queuecallerleaveAt']=moment()[_0x14d4('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x14d4('0x4a')](_0x14d4('0xb3'),_0x405c10[_0x14d4('0x4d')],util[_0x14d4('0x40')](_0x1806e0,{'showHidden':![],'depth':null}));ami[_0x14d4('0x48')](_0x14d4('0xb4'),_0x1806e0);break;default:_0x1806e0[_0x14d4('0x98')]=!![];_0x1806e0[_0x14d4('0xa1')]=moment()[_0x14d4('0x4e')](_0x14d4('0x7a'));_0x1806e0['queuecallerleaveAt']=moment()[_0x14d4('0x4e')](_0x14d4('0x7a'));}_0x1806e0[_0x14d4('0x1b')]=![];_0x1806e0[_0x14d4('0x88')]=null;_0x1806e0[_0x14d4('0x89')]=_0x405c10['value'];this[_0x14d4('0x36')][_0x405c10[_0x14d4('0x4d')]]=_0x1806e0;this[_0x14d4('0x46')](_0x1806e0,_0x14d4('0x23'));}else if(this[_0x14d4('0x68')](_0x405c10[_0x14d4('0xad')])&&this[_0x14d4('0x68')](_0x405c10[_0x14d4('0xad')][_0x14d4('0xb5')])){if(!_0x1806e0[_0x14d4('0x1b')]){_0x1806e0['queuecallerexit']=!![];_0x1806e0[_0x14d4('0xa1')]=moment()[_0x14d4('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x1806e0[_0x14d4('0x89')]=_0x14d4('0xb6');_0x1806e0['queuecallerleaveAt']=moment()[_0x14d4('0x4e')](_0x14d4('0x7a'));this[_0x14d4('0x36')][_0x405c10[_0x14d4('0x4d')]]=_0x1806e0;}}logger[_0x14d4('0x6d')](_0x14d4('0xb7'),_0x405c10[_0x14d4('0x4d')],_0x1806e0['name'],_0x1806e0[_0x14d4('0x56')],_[_0x14d4('0x81')](_0x405c10[_0x14d4('0xad')])[0x0],_0x405c10[_0x14d4('0xae')]);_0x1806e0[_0x14d4('0x14')]=this[_0x14d4('0x14')][_0x405c10[_0x14d4('0x4d')]];}}}}catch(_0x3b9f38){logger[_0x14d4('0x3e')](_0x14d4('0xab'),_0x405c10[_0x14d4('0x4d')],util[_0x14d4('0x40')](_0x3b9f38,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x14d4('0x34')][_0x14d4('0xac')]=function(_0x1ff287,_0x51dd3a,_0x52f772){var _0xb5070f=[_0x14d4('0xb8'),_0x14d4('0xb9'),'rtpaudioqosjitter',_0x14d4('0xba'),'rtpaudioqosloss',_0x14d4('0xbb'),_0x14d4('0xbc'),'rtpaudioqosrttbridged','sipcallid',_0x14d4('0xbd'),_0x14d4('0xbe'),_0x14d4('0xbf'),_0x14d4('0xc0'),_0x14d4('0xc1'),'memberinterface','memberlastcall',_0x14d4('0xc2'),_0x14d4('0xc3'),_0x14d4('0xc4')];if(!_[_0x14d4('0xc5')](_0x51dd3a)&&!_[_0x14d4('0xc6')](_0xb5070f,_0x51dd3a)){if(_['isUndefined'](this[_0x14d4('0x14')][_0x1ff287])){this['variables'][_0x1ff287]={};}this[_0x14d4('0x14')][_0x1ff287][_0x51dd3a]=_0x52f772;}};VoiceQueueReport[_0x14d4('0x34')][_0x14d4('0x25')]=function(_0x451745){try{if(this['isNotNull'](_0x451745)){logger[_0x14d4('0x4a')]('[%s][voiceQueueReport][hangup]',_0x451745[_0x14d4('0x4d')],util['inspect'](_0x451745,{'showHidden':![],'depth':null}));if(this[_0x14d4('0xe')][_0x451745[_0x14d4('0x4d')]]){for(var _0x5ea682=0x0,_0x3e6c72={};_0x5ea6820x0?_0x4c77e0:0x0;this[_0x31b7('0x12')][_0x4bd00d['queue']][_0x31b7('0x6e')]=this['voiceQueues'][_0x4bd00d[_0x31b7('0x67')]][_0x31b7('0x6e')]>_[_0x31b7('0x6d')](_0x4bd00d[_0x31b7('0x6f')])?_['toNumber'](_0x4bd00d[_0x31b7('0x6f')]):this['voiceQueues'][_0x4bd00d[_0x31b7('0x67')]][_0x31b7('0x6e')];this[_0x31b7('0x50')](this[_0x31b7('0x12')][_0x4bd00d[_0x31b7('0x67')]],_0x31b7('0x16'));}logger['debug'](_0x31b7('0x70'),util[_0x31b7('0x3e')](this[_0x31b7('0x12')][_0x4bd00d[_0x31b7('0x67')]],{'showHidden':![],'depth':null}));ami[_0x31b7('0x44')](_0x31b7('0x71'),this[_0x31b7('0x12')][_0x4bd00d[_0x31b7('0x67')]]);}}}catch(_0x350fba){logger[_0x31b7('0x3d')](_0x31b7('0x65'),util[_0x31b7('0x3e')](_0x350fba,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x31b7('0xa')][_0x31b7('0x1a')]=function(_0x2de398){logger[_0x31b7('0x46')](_0x31b7('0x72'),util[_0x31b7('0x3e')](_0x2de398,{'showHidden':![],'depth':null}));this[_0x31b7('0x13')]=!![];};VoiceQueueReport[_0x31b7('0xa')][_0x31b7('0x73')]=function(_0x2640db){try{if(this[_0x31b7('0x66')](_0x2640db)){logger[_0x31b7('0x46')](_0x31b7('0x74'),_0x2640db[_0x31b7('0x48')],util[_0x31b7('0x3e')](_0x2640db,{'showHidden':![],'depth':null}));if(_[_0x31b7('0x60')](this[_0x31b7('0xe')][_0x2640db[_0x31b7('0x48')]]))this[_0x31b7('0xe')][_0x2640db[_0x31b7('0x48')]]=[];if(_[_0x31b7('0x60')](this[_0x31b7('0x10')][_0x2640db[_0x31b7('0x48')]]))this[_0x31b7('0x10')][_0x2640db[_0x31b7('0x48')]]={};var _0x4b923b=new QueueReport();_0x4b923b[_0x31b7('0x4a')]=_0x2640db[_0x31b7('0x67')];_0x4b923b['type']=this[_0x31b7('0x12')][_0x4b923b[_0x31b7('0x4a')]]&&this[_0x31b7('0x12')][_0x4b923b[_0x31b7('0x4a')]][_0x31b7('0x51')]?this['voiceQueues'][_0x4b923b[_0x31b7('0x4a')]][_0x31b7('0x51')]||_0x31b7('0x75'):_0x31b7('0x75');_0x4b923b[_0x31b7('0x67')]=_0x2640db[_0x31b7('0x67')];_0x4b923b[_0x31b7('0x76')]=moment()[_0x31b7('0x4e')](_0x31b7('0x77'));_0x4b923b[_0x31b7('0x78')]=_0x2640db[_0x31b7('0x78')];_0x4b923b[_0x31b7('0x79')]=_0x2640db['count'];_0x4b923b['uniqueid']=_0x2640db['uniqueid'];_0x4b923b[_0x31b7('0x7a')]=this['channels'][_0x2640db[_0x31b7('0x48')]][_0x31b7('0x7a')];logger['info'](_0x31b7('0x7b'),_0x4b923b[_0x31b7('0x4a')],_0x4b923b[_0x31b7('0x51')]);_[_0x31b7('0x7c')](_0x4b923b,_['pick'](_0x2640db,_['keys'](_0x4b923b)));this[_0x31b7('0xe')][_0x2640db[_0x31b7('0x48')]][_0x31b7('0x7d')](_0x4b923b);this[_0x31b7('0x10')][_0x2640db[_0x31b7('0x48')]]=_0x4b923b;this[_0x31b7('0x45')](_0x4b923b,_0x31b7('0x1b'));}}catch(_0xbb8b16){logger[_0x31b7('0x3d')](_0x31b7('0x74'),_0x2640db['uniqueid'],util[_0x31b7('0x3e')](_0xbb8b16,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x31b7('0x1c')]=function(_0x50f1b5){try{if(this[_0x31b7('0x66')](_0x50f1b5)){logger[_0x31b7('0x46')](_0x31b7('0x7e'),_0x50f1b5[_0x31b7('0x48')],util['inspect'](_0x50f1b5,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x50f1b5['uniqueid']]){var _0x1739af=_['last'](this['queueReports'][_0x50f1b5[_0x31b7('0x48')]]);_0x1739af['queuecallercomplete']=![];_0x1739af[_0x31b7('0x7f')]=null;_0x1739af[_0x31b7('0x80')]=_0x50f1b5['holdtime'];_0x1739af['originalposition']=_0x50f1b5[_0x31b7('0x81')];_0x1739af[_0x31b7('0x82')]=!![];_0x1739af[_0x31b7('0x83')]=moment()[_0x31b7('0x4e')](_0x31b7('0x77'));_0x1739af['queuecallerexitreason']=_0x31b7('0x84');_0x1739af[_0x31b7('0x85')]=null;logger[_0x31b7('0x69')](_0x31b7('0x86'),_0x1739af[_0x31b7('0x4a')],_0x1739af[_0x31b7('0x51')]);this['channels'][_0x50f1b5[_0x31b7('0x48')]]=_0x1739af;this[_0x31b7('0x42')](_0x1739af,_0x31b7('0x82'));}}}catch(_0x2f314c){logger[_0x31b7('0x3d')](_0x31b7('0x7e'),_0x50f1b5['uniqueid'],util[_0x31b7('0x3e')](_0x2f314c,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x31b7('0x1d')]=function(_0x4e369c){try{if(this[_0x31b7('0x66')](_0x4e369c)){logger['debug']('[%s][voiceQueueReport][queuecallerleave]',_0x4e369c[_0x31b7('0x48')],util[_0x31b7('0x3e')](_0x4e369c,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4e369c[_0x31b7('0x48')]]){var _0x50bde9=_[_0x31b7('0x87')](this[_0x31b7('0xe')][_0x4e369c[_0x31b7('0x48')]]);_0x50bde9[_0x31b7('0x88')]=moment()[_0x31b7('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x50bde9['connectedlinenum']=_0x4e369c[_0x31b7('0x89')];_0x50bde9[_0x31b7('0x8a')]=_0x4e369c[_0x31b7('0x8a')];logger['info'](_0x31b7('0x8b'),_0x50bde9[_0x31b7('0x4a')],_0x50bde9[_0x31b7('0x51')],_0x4e369c['connectedlinenum'],_0x4e369c['connectedlinename']);this[_0x31b7('0x10')][_0x4e369c['uniqueid']]=_0x50bde9;this[_0x31b7('0x45')](_0x50bde9,_0x31b7('0x8c'));}}}catch(_0x5da016){logger[_0x31b7('0x3d')]('[%s][voiceQueueReport][queuecallerleave]',_0x4e369c['uniqueid'],util[_0x31b7('0x3e')](_0x5da016,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x31b7('0x20')]=function(_0x323ab2){try{if(this['isNotNull'](_0x323ab2)){logger[_0x31b7('0x46')](_0x31b7('0x8d'),_0x323ab2['uniqueid'],util['inspect'](_0x323ab2,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x323ab2[_0x31b7('0x48')]]){var _0x477445=_[_0x31b7('0x87')](this[_0x31b7('0xe')][_0x323ab2[_0x31b7('0x48')]]);_0x477445[_0x31b7('0x8e')]=!![];_0x477445['queuecallerexitreason']='COMPLETEDBYAGENT';logger[_0x31b7('0x69')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x477445[_0x31b7('0x4a')],_0x477445[_0x31b7('0x51')]);}}}catch(_0x2a7141){logger[_0x31b7('0x3d')](_0x31b7('0x8d'),_0x323ab2[_0x31b7('0x48')],util[_0x31b7('0x3e')](_0x2a7141,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x31b7('0xa')][_0x31b7('0x1f')]=function(_0x100da0){try{if(this[_0x31b7('0x66')](_0x100da0)){logger[_0x31b7('0x46')]('[%s][voiceQueueReport][agentcomplete]',_0x100da0['uniqueid'],util[_0x31b7('0x3e')](_0x100da0,{'showHidden':![],'depth':null}));if(this[_0x31b7('0xe')][_0x100da0[_0x31b7('0x48')]]){var _0x18b1be=_[_0x31b7('0x87')](this[_0x31b7('0xe')][_0x100da0['uniqueid']]);_0x18b1be[_0x31b7('0x82')]=![];_0x18b1be[_0x31b7('0x83')]=null;_0x18b1be[_0x31b7('0x8f')]=!![];_0x18b1be[_0x31b7('0x85')]=_0x100da0['membername'];_0x18b1be['holdtime']=_0x100da0[_0x31b7('0x80')];_0x18b1be[_0x31b7('0x8e')]=!![];_0x18b1be[_0x31b7('0x90')]=![];_0x18b1be['queuecallerexitAt']=null;if(!_0x18b1be[_0x31b7('0x91')]){if(_0x100da0[_0x31b7('0x92')]==_0x31b7('0x91')){_0x18b1be[_0x31b7('0x93')]='COMPLETED';logger['info'](_0x31b7('0x94'),_0x18b1be[_0x31b7('0x4a')],_0x18b1be[_0x31b7('0x51')]);}else{if(_[_0x31b7('0x95')](_0x100da0[_0x31b7('0x3a')][_0x31b7('0x96')](),_0x31b7('0x97'))){if(this[_0x31b7('0xe')][_0x100da0[_0x31b7('0x98')]]){var _0x16bce7=_[_0x31b7('0x87')](this[_0x31b7('0xe')][_0x100da0[_0x31b7('0x98')]]);_0x16bce7['queuecallercomplete']=![];_0x16bce7[_0x31b7('0x90')]=!![];_0x16bce7[_0x31b7('0x99')]=moment(_0x18b1be[_0x31b7('0x76')])[_0x31b7('0x9a')](_0x100da0[_0x31b7('0x80')],_0x31b7('0x9b'))[_0x31b7('0x4e')](_0x31b7('0x77'));_0x16bce7[_0x31b7('0x93')]=_0x31b7('0x9c');_0x16bce7[_0x31b7('0x91')]=!![];_0x16bce7[_0x31b7('0x9d')]='FORWARD';_0x16bce7['transferexten']=_0x100da0[_0x31b7('0x9e')];_0x16bce7[_0x31b7('0x9f')]=_0x100da0['uniqueid'];logger[_0x31b7('0x69')](_0x31b7('0xa0'),_0x16bce7[_0x31b7('0x4a')],_0x16bce7['type']);var _0x1b1884=this['queueReports'][_0x100da0[_0x31b7('0x98')]];this[_0x31b7('0xe')][_0x100da0[_0x31b7('0x98')]]=this[_0x31b7('0xe')][_0x100da0[_0x31b7('0x48')]];this[_0x31b7('0xe')][_0x100da0[_0x31b7('0x48')]]=_0x1b1884;}}else{_0x18b1be[_0x31b7('0x93')]=_0x31b7('0xa1')+_0x100da0[_0x31b7('0x92')][_0x31b7('0xa2')]();logger['info'](_0x31b7('0xa3'),_0x18b1be[_0x31b7('0x4a')],_0x18b1be[_0x31b7('0x51')],_0x18b1be[_0x31b7('0x93')]);}}}this['channels'][_0x100da0[_0x31b7('0x48')]]=_0x18b1be;this[_0x31b7('0x42')](_0x18b1be,'agentcomplete');}}}catch(_0x12421e){logger['error'](_0x31b7('0xa4'),_0x100da0[_0x31b7('0x48')],util[_0x31b7('0x3e')](_0x12421e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x31b7('0xa')][_0x31b7('0x22')]=function(_0x3e500b){try{if(this['isNotNull'](_0x3e500b)){logger[_0x31b7('0x46')](_0x31b7('0xa5'),_0x3e500b[_0x31b7('0x48')],util[_0x31b7('0x3e')](_0x3e500b,{'showHidden':![],'depth':null}));this[_0x31b7('0xa6')](_0x3e500b[_0x31b7('0x48')],_[_0x31b7('0xa7')](_0x3e500b['variable'])[0x0],_0x3e500b['value']);if(this[_0x31b7('0xe')][_0x3e500b[_0x31b7('0x48')]]){var _0x5af354=_[_0x31b7('0x87')](this[_0x31b7('0xe')][_0x3e500b[_0x31b7('0x48')]]);if(_0x5af354){if(this[_0x31b7('0x66')](_0x3e500b[_0x31b7('0xa8')])&&this[_0x31b7('0x66')](_0x3e500b['variable'][_0x31b7('0xa9')])){switch(_0x3e500b[_0x31b7('0xaa')]){case'CONTINUE':_0x5af354[_0x31b7('0x90')]=![];_0x5af354[_0x31b7('0x99')]=null;break;case'TIMEOUT':_0x5af354[_0x31b7('0xab')]='timeout';_0x5af354[_0x31b7('0x90')]=!![];_0x5af354[_0x31b7('0x99')]=moment()[_0x31b7('0x4e')](_0x31b7('0x77'));_0x5af354[_0x31b7('0x88')]=moment()[_0x31b7('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x31b7('0x46')](_0x31b7('0xac'),_0x3e500b[_0x31b7('0x48')],util[_0x31b7('0x3e')](_0x5af354,{'showHidden':![],'depth':null}));ami[_0x31b7('0x44')](_0x31b7('0xad'),_0x5af354);break;default:_0x5af354[_0x31b7('0x90')]=!![];_0x5af354[_0x31b7('0x99')]=moment()['format'](_0x31b7('0x77'));_0x5af354[_0x31b7('0x88')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x5af354['queuecallerabandon']=![];_0x5af354[_0x31b7('0x83')]=null;_0x5af354[_0x31b7('0x93')]=_0x3e500b[_0x31b7('0xaa')];this[_0x31b7('0x10')][_0x3e500b[_0x31b7('0x48')]]=_0x5af354;this[_0x31b7('0x42')](_0x5af354,_0x31b7('0x21'));}else if(this[_0x31b7('0x66')](_0x3e500b['variable'])&&this[_0x31b7('0x66')](_0x3e500b[_0x31b7('0xa8')]['queueposition'])){if(!_0x5af354[_0x31b7('0x82')]){_0x5af354[_0x31b7('0x90')]=!![];_0x5af354[_0x31b7('0x99')]=moment()[_0x31b7('0x4e')](_0x31b7('0x77'));_0x5af354[_0x31b7('0x93')]=_0x31b7('0xae');_0x5af354[_0x31b7('0x88')]=moment()[_0x31b7('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x31b7('0x10')][_0x3e500b[_0x31b7('0x48')]]=_0x5af354;}}logger[_0x31b7('0x69')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x3e500b[_0x31b7('0x48')],_0x5af354['name'],_0x5af354['type'],_[_0x31b7('0xa7')](_0x3e500b[_0x31b7('0xa8')])[0x0],_0x3e500b['value']);_0x5af354[_0x31b7('0x15')]=this[_0x31b7('0x15')][_0x3e500b[_0x31b7('0x48')]];}}}}catch(_0x50560d){logger['error']('[%s][voiceQueueReport][varset]',_0x3e500b[_0x31b7('0x48')],util[_0x31b7('0x3e')](_0x50560d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x31b7('0xa6')]=function(_0x45cbff,_0x30d1fe,_0x885199){var _0x2a6f37=[_0x31b7('0xaf'),_0x31b7('0xb0'),'rtpaudioqosjitter',_0x31b7('0xb1'),'rtpaudioqosloss',_0x31b7('0xb2'),_0x31b7('0xb3'),_0x31b7('0xb4'),'sipcallid',_0x31b7('0xb5'),'bridgepeer',_0x31b7('0xb6'),'membercalls',_0x31b7('0xb7'),'memberinterface',_0x31b7('0xb8'),_0x31b7('0xb9'),_0x31b7('0xba'),'memberrealtime'];if(!_[_0x31b7('0xbb')](_0x30d1fe)&&!_[_0x31b7('0xbc')](_0x2a6f37,_0x30d1fe)){if(_['isUndefined'](this[_0x31b7('0x15')][_0x45cbff])){this[_0x31b7('0x15')][_0x45cbff]={};}this[_0x31b7('0x15')][_0x45cbff][_0x30d1fe]=_0x885199;}};VoiceQueueReport[_0x31b7('0xa')][_0x31b7('0x23')]=function(_0x5c8071){try{if(this[_0x31b7('0x66')](_0x5c8071)){logger[_0x31b7('0x46')](_0x31b7('0xbd'),_0x5c8071[_0x31b7('0x48')],util[_0x31b7('0x3e')](_0x5c8071,{'showHidden':![],'depth':null}));if(this[_0x31b7('0xe')][_0x5c8071[_0x31b7('0x48')]]){for(var _0x3b0fb3=0x0,_0x144c27={};_0x3b0fb3=0x0?moment(_0x5acc95[_0x45c6('0x1b')])[_0x45c6('0x1d')](_0x5acc95[_0x45c6('0x1a')],_0x45c6('0x1c')):null,'data1':_0x45c6('0x1e'),'data2':_0x5acc95[_0x45c6('0x13')],'data3':_0x5acc95[_0x45c6('0x10')],'data4':_0x5acc95[_0x45c6('0x1f')]||null,'role':_0x45c6('0x12'),'internal':_0x5acc95[_0x45c6('0x13')]?_[_0x45c6('0x20')](_0x5acc95[_0x45c6('0x13')]):undefined,'uniqueid':_0x5acc95['uniqueid']},'log':_0x45c6('0x15')});}; \ No newline at end of file +var _0xd6fa=['dialstring','moment','lodash','util','Request','CreateMemberReport','lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','queuecallerleaveAt','diff','seconds','inbound','calleridnum','exten','agent','accountcode','toNumber','uniqueid','voice','membername','starttime','endtime','outbound'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xd6fa,0x12a));var _0xad6f=function(_0x3703dd,_0x17bc12){_0x3703dd=_0x3703dd-0x0;var _0x3d62a3=_0xd6fa[_0x3703dd];return _0x3d62a3;};'use strict';var moment=require(_0xad6f('0x0'));var _=require(_0xad6f('0x1'));var util=require(_0xad6f('0x2'));var client=require('../client');exports['voiceQueueReport']=function(_0x1d3895){var _0x5663b1=_0x1d3895['queuecallercompleteAt']||_0x1d3895['queuecallerexitAt'];return client[_0xad6f('0x3')](_0xad6f('0x4'),{'body':{'channel':'voice','membername':_0x1d3895[_0xad6f('0x5')],'interface':_[_0xad6f('0x6')](_0x1d3895[_0xad6f('0x7')])?util[_0xad6f('0x8')](_0xad6f('0x9'),_0x1d3895['lastAssignedTo']):_0x1d3895[_0xad6f('0x7')],'type':_0xad6f('0xa'),'enterAt':_0x1d3895[_0xad6f('0xb')],'exitAt':_0x5663b1,'duration':moment(_0x5663b1)[_0xad6f('0xc')](_0x1d3895['queuecallerleaveAt'],_0xad6f('0xd')),'data1':_0xad6f('0xe'),'data2':_0x1d3895[_0xad6f('0xf')],'data3':_0x1d3895[_0xad6f('0x10')],'data4':null,'data5':_0x1d3895['queue'],'role':_0xad6f('0x11'),'internal':_0x1d3895[_0xad6f('0x12')]?_[_0xad6f('0x13')](_0x1d3895[_0xad6f('0x12')]):undefined,'uniqueid':_0x1d3895[_0xad6f('0x14')]},'log':'CreateMemberReport'});};exports['voiceDialReport']=function(_0x172bc0){return client['Request'](_0xad6f('0x4'),{'body':{'channel':_0xad6f('0x15'),'membername':_0x172bc0[_0xad6f('0x16')],'interface':_0x172bc0[_0xad6f('0x7')],'type':_0xad6f('0xa'),'enterAt':_0x172bc0[_0xad6f('0x17')],'exitAt':_0x172bc0[_0xad6f('0x18')],'duration':moment(_0x172bc0[_0xad6f('0x18')])['diff'](_0x172bc0[_0xad6f('0x17')],_0xad6f('0xd'))>=0x0?moment(_0x172bc0[_0xad6f('0x18')])[_0xad6f('0xc')](_0x172bc0[_0xad6f('0x17')],'seconds'):null,'data1':_0xad6f('0x19'),'data2':_0x172bc0[_0xad6f('0x12')],'data3':_0x172bc0['exten'],'data4':_0x172bc0[_0xad6f('0x1a')]||null,'role':_0xad6f('0x11'),'internal':_0x172bc0[_0xad6f('0x12')]?_[_0xad6f('0x13')](_0x172bc0[_0xad6f('0x12')]):undefined,'uniqueid':_0x172bc0[_0xad6f('0x14')]},'log':_0xad6f('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 53971e6..dd18608 100644 --- a/server/services/ami/rpc/setting.js +++ b/server/services/ami/rpc/setting.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf69b=['ShowSetting','GetSettings','getSettings'];(function(_0x44d496,_0x371873){var _0x574e08=function(_0x49c1c4){while(--_0x49c1c4){_0x44d496['push'](_0x44d496['shift']());}};_0x574e08(++_0x371873);}(_0xf69b,0xc8));var _0xbf69=function(_0x5aa63f,_0x124fb1){_0x5aa63f=_0x5aa63f-0x0;var _0x665dca=_0xf69b[_0x5aa63f];return _0x665dca;};'use strict';var client=require('../client');exports[_0xbf69('0x0')]=function(){return client['Request'](_0xbf69('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer']},'log':_0xbf69('0x2')});}; \ No newline at end of file +var _0x781f=['getSettings','ShowSetting','GetSettings','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x781f,0x13f));var _0xf781=function(_0x26fc81,_0x57fc19){_0x26fc81=_0x26fc81-0x0;var _0x9feece=_0x781f[_0x26fc81];return _0x9feece;};'use strict';var client=require(_0xf781('0x0'));exports[_0xf781('0x1')]=function(){return client['Request'](_0xf781('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer']},'log':_0xf781('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index db852b4..c62dfe1 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 _0xafff=['name','GetTemplate','../client','getTemplates','Request'];(function(_0x45c96e,_0x3ad913){var _0x56f313=function(_0x3dea4f){while(--_0x3dea4f){_0x45c96e['push'](_0x45c96e['shift']());}};_0x56f313(++_0x3ad913);}(_0xafff,0x16a));var _0xfaff=function(_0x3ccaa9,_0x54baf2){_0x3ccaa9=_0x3ccaa9-0x0;var _0x31eb12=_0xafff[_0x3ccaa9];return _0x31eb12;};'use strict';var client=require(_0xfaff('0x0'));exports[_0xfaff('0x1')]=function(_0x7fe8b8){return function(_0x4c1334){return client[_0xfaff('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0xfaff('0x3'),'html']},'log':_0xfaff('0x4')});};}; \ No newline at end of file +var _0xb346=['Request','GetTemplate','name','../client','getTemplates'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb346,0xcb));var _0x6b34=function(_0x410bae,_0x4773df){_0x410bae=_0x410bae-0x0;var _0x8b6f0a=_0xb346[_0x410bae];return _0x8b6f0a;};'use strict';var client=require(_0x6b34('0x0'));exports[_0x6b34('0x1')]=function(_0x596b5a){return function(_0x428564){return client[_0x6b34('0x2')](_0x6b34('0x3'),{'options':{'raw':!![],'attributes':['id',_0x6b34('0x4'),'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 d458c52..c725ca1 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 _0xdc62=['data2','data3','data4','data6','data7','../client','getTriggers','Request','GetTrigger','channel','status','AllConditions','field','operator','value','Condition','AnyConditions','Action','action'];(function(_0x4fbf1f,_0x3d2c29){var _0x351472=function(_0x39128a){while(--_0x39128a){_0x4fbf1f['push'](_0x4fbf1f['shift']());}};_0x351472(++_0x3d2c29);}(_0xdc62,0x194));var _0x2dc6=function(_0x4d089f,_0x4a2164){_0x4d089f=_0x4d089f-0x0;var _0x30bb53=_0xdc62[_0x4d089f];return _0x30bb53;};'use strict';var client=require(_0x2dc6('0x0'));exports[_0x2dc6('0x1')]=function(_0x22b0a0){return function(_0x2612cf){return client[_0x2dc6('0x2')](_0x2dc6('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x2dc6('0x4'),_0x2dc6('0x5')],'include':[{'model':'Condition','as':_0x2dc6('0x6'),'attributes':['id',_0x2dc6('0x7'),_0x2dc6('0x8'),_0x2dc6('0x9')]},{'model':_0x2dc6('0xa'),'as':_0x2dc6('0xb'),'attributes':['id',_0x2dc6('0x7'),_0x2dc6('0x8'),'value']},{'model':_0x2dc6('0xc'),'as':'Actions','attributes':['id',_0x2dc6('0xd'),'data1',_0x2dc6('0xe'),_0x2dc6('0xf'),_0x2dc6('0x10'),'data5',_0x2dc6('0x11'),_0x2dc6('0x12')]}]},'log':_0x2dc6('0x3')});};}; \ No newline at end of file +var _0x906e=['action','data1','data2','data3','data4','data6','data7','../client','getTriggers','GetTrigger','name','channel','status','Condition','AllConditions','field','operator','value','AnyConditions','Action','Actions'];(function(_0x21a11d,_0x18d8ec){var _0x474e50=function(_0x45d33b){while(--_0x45d33b){_0x21a11d['push'](_0x21a11d['shift']());}};_0x474e50(++_0x18d8ec);}(_0x906e,0x1c0));var _0xe906=function(_0x2067e3,_0x19bcb2){_0x2067e3=_0x2067e3-0x0;var _0x180c44=_0x906e[_0x2067e3];return _0x180c44;};'use strict';var client=require(_0xe906('0x0'));exports[_0xe906('0x1')]=function(_0x3a596b){return function(_0x160ad1){return client['Request'](_0xe906('0x2'),{'options':{'raw':![],'attributes':['id',_0xe906('0x3'),_0xe906('0x4'),_0xe906('0x5')],'include':[{'model':_0xe906('0x6'),'as':_0xe906('0x7'),'attributes':['id',_0xe906('0x8'),_0xe906('0x9'),_0xe906('0xa')]},{'model':_0xe906('0x6'),'as':_0xe906('0xb'),'attributes':['id',_0xe906('0x8'),_0xe906('0x9'),_0xe906('0xa')]},{'model':_0xe906('0xc'),'as':_0xe906('0xd'),'attributes':['id',_0xe906('0xe'),_0xe906('0xf'),_0xe906('0x10'),_0xe906('0x11'),_0xe906('0x12'),'data5',_0xe906('0x13'),_0xe906('0x14')]}]},'log':'GetTrigger'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index a37ba53..cfd330f 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 _0x501f=['name','defaultuser','GetTrunk','getTrunks'];(function(_0x26ae9f,_0x573cf9){var _0x59f4c6=function(_0x5bfff4){while(--_0x5bfff4){_0x26ae9f['push'](_0x26ae9f['shift']());}};_0x59f4c6(++_0x573cf9);}(_0x501f,0x1db));var _0xf501=function(_0xddf360,_0x5c38bb){_0xddf360=_0xddf360-0x0;var _0x3776a4=_0x501f[_0xddf360];return _0x3776a4;};'use strict';var client=require('../client');exports[_0xf501('0x0')]=function(_0x1c69ea){return function(_0x366bee){return client['Request']('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xf501('0x1'),'registry',_0xf501('0x2')]},'log':_0xf501('0x3')});};}; \ No newline at end of file +var _0xb871=['defaultuser','GetTrunk','getTrunks','Request','registry'];(function(_0x59a538,_0x43f222){var _0x591245=function(_0x248939){while(--_0x248939){_0x59a538['push'](_0x59a538['shift']());}};_0x591245(++_0x43f222);}(_0xb871,0x6b));var _0x1b87=function(_0x1f3d15,_0x5176a8){_0x1f3d15=_0x1f3d15-0x0;var _0x48617b=_0xb871[_0x1f3d15];return _0x48617b;};'use strict';var client=require('../client');exports[_0x1b87('0x0')]=function(_0x1e1274){return function(_0x1d39a3){return client[_0x1b87('0x1')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x1b87('0x2'),_0x1b87('0x3')]},'log':_0x1b87('0x4')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 3ad860e..11a13b1 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['UnpauseUser','getAgent','ShowUser','email','lastPauseAt','Request','GetUser','agent','name','accountcode','fullname','lastLoginAt','pauseType','voicePause','phone','interface','getAgents','internal','getTelephones','savePause','PauseUser'];(function(_0x200d8e,_0x352913){var _0x35d535=function(_0xf8cf76){while(--_0xf8cf76){_0x200d8e['push'](_0x200d8e['shift']());}};_0x35d535(++_0x352913);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xcb91[_0x1d1779];return _0x2377e9;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2')},'attributes':['id',_0x1cb9('0x3'),'email',_0x1cb9('0x4'),_0x1cb9('0x5'),'online',_0x1cb9('0x6'),_0x1cb9('0x7'),'lastPauseAt',_0x1cb9('0x8'),_0x1cb9('0x9'),'mobile',_0x1cb9('0xa')]},'log':_0x1cb9('0xb')});};};exports['getTelephones']=function(){return function(){return client[_0x1cb9('0x0')]('GetUser',{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x4'),_0x1cb9('0xc')]},'log':_0x1cb9('0xd')});};};exports[_0x1cb9('0xe')]=function(_0x50ce71,_0x9b58f1,_0x44a6b4){return client[_0x1cb9('0x0')](_0x1cb9('0xf'),{'body':{'type':_0x9b58f1,'uniqueid':_0x44a6b4},'options':{'where':{'id':_0x50ce71['id']}},'log':_0x1cb9('0xe')});};exports['saveUnpause']=function(_0x5e3c19){return client['Request'](_0x1cb9('0x10'),{'body':{},'options':{'where':{'id':_0x5e3c19['id']}},'log':_0x1cb9('0xe')});};exports[_0x1cb9('0x11')]=function(_0x1c714f){return client['Request'](_0x1cb9('0x12'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2'),'id':_0x1c714f},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x13'),_0x1cb9('0x4'),'fullname','online',_0x1cb9('0x6'),_0x1cb9('0x7'),_0x1cb9('0x14'),_0x1cb9('0x8'),_0x1cb9('0xa')]},'log':_0x1cb9('0x11')});}; \ No newline at end of file +var _0x34e8=['../client','getAgents','Request','GetUser','name','email','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','mobile','interface','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser','agent','lastPauseAt'];(function(_0x35fc6b,_0x2e006b){var _0x1b75a6=function(_0x3a2a57){while(--_0x3a2a57){_0x35fc6b['push'](_0x35fc6b['shift']());}};_0x1b75a6(++_0x2e006b);}(_0x34e8,0x12c));var _0x834e=function(_0x562452,_0x40e890){_0x562452=_0x562452-0x0;var _0x5ad702=_0x34e8[_0x562452];return _0x5ad702;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6'),_0x834e('0x7'),_0x834e('0x8'),_0x834e('0x9'),_0x834e('0xa'),'lastPauseAt',_0x834e('0xb'),'phone',_0x834e('0xc'),_0x834e('0xd')]},'log':_0x834e('0x1')});};};exports[_0x834e('0xe')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':!![],'where':{'role':_0x834e('0xf')},'attributes':['id',_0x834e('0x4'),_0x834e('0x6'),_0x834e('0x10')]},'log':_0x834e('0xe')});};};exports[_0x834e('0x11')]=function(_0x14038b,_0x2e1a37,_0x293514){return client[_0x834e('0x2')](_0x834e('0x12'),{'body':{'type':_0x2e1a37,'uniqueid':_0x293514},'options':{'where':{'id':_0x14038b['id']}},'log':'savePause'});};exports[_0x834e('0x13')]=function(_0x6cd9b9){return client['Request'](_0x834e('0x14'),{'body':{},'options':{'where':{'id':_0x6cd9b9['id']}},'log':_0x834e('0x11')});};exports[_0x834e('0x15')]=function(_0x21cc0a){return client['Request'](_0x834e('0x16'),{'options':{'raw':![],'where':{'role':_0x834e('0x17'),'id':_0x21cc0a},'attributes':['id','name',_0x834e('0x5'),'accountcode',_0x834e('0x7'),_0x834e('0x8'),'lastLoginAt',_0x834e('0xa'),_0x834e('0x18'),_0x834e('0xb'),'interface']},'log':_0x834e('0x15')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 16e06bd..31975e7 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 _0x1bff=['update','UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport'];(function(_0x3f07a5,_0x51a157){var _0xb055c0=function(_0x28beac){while(--_0x28beac){_0x3f07a5['push'](_0x3f07a5['shift']());}};_0xb055c0(++_0x51a157);}(_0x1bff,0x134));var _0xf1bf=function(_0x2fdce0,_0x496242){_0x2fdce0=_0x2fdce0-0x0;var _0x36f07e=_0x1bff[_0x2fdce0];return _0x36f07e;};'use strict';var client=require(_0xf1bf('0x0'));exports[_0xf1bf('0x1')]=function(_0x3434fb){return client[_0xf1bf('0x2')]('CreateVoiceAgentReport',{'body':_0x3434fb,'log':_0xf1bf('0x3')});};exports[_0xf1bf('0x4')]=function(_0x454907,_0x472297,_0x4d6add){return client[_0xf1bf('0x2')](_0xf1bf('0x5'),{'body':_0x454907,'options':{'where':{'uniqueid':_0x472297,'interface':_0x4d6add,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0x68de=['CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client','Request'];(function(_0x41eccd,_0x2052f4){var _0x4ebf84=function(_0x270f6b){while(--_0x270f6b){_0x41eccd['push'](_0x41eccd['shift']());}};_0x4ebf84(++_0x2052f4);}(_0x68de,0x125));var _0xe68d=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0x68de[_0x31a371];return _0x2a5bd6;};'use strict';var client=require(_0xe68d('0x0'));exports['create']=function(_0x351956){return client[_0xe68d('0x1')](_0xe68d('0x2'),{'body':_0x351956,'log':_0xe68d('0x2')});};exports[_0xe68d('0x3')]=function(_0xf58b73,_0x48b16c,_0xcd90eb){return client[_0xe68d('0x1')]('UpdateVoiceAgentReport',{'body':_0xf58b73,'options':{'where':{'uniqueid':_0x48b16c,'interface':_0xcd90eb,'agentcomplete':!![]}},'log':_0xe68d('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 32e2de0..543421b 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 _0xcbef=['create','CreateVoiceCallReport','context','DOCUMENTATION','getVoiceCallReports','Request','GetVoiceCallReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','billableseconds','GetVoiceCallReports','util'];(function(_0x305a2e,_0x578be1){var _0x586453=function(_0x3a521f){while(--_0x3a521f){_0x305a2e['push'](_0x305a2e['shift']());}};_0x586453(++_0x578be1);}(_0xcbef,0x15d));var _0xfcbe=function(_0x4d3835,_0x4f5f50){_0x4d3835=_0x4d3835-0x0;var _0x823439=_0xcbef[_0x4d3835];return _0x823439;};'use strict';var moment=require('moment');var util=require(_0xfcbe('0x0'));var _=require('lodash');var client=require('../client');exports[_0xfcbe('0x1')]=function(_0x436a73){return client['Request'](_0xfcbe('0x2'),{'body':_['merge'](_0x436a73,{'source':_0x436a73['calleridnum'],'destinationcontext':_0x436a73[_0xfcbe('0x3')],'callerid':_0x436a73['callerid'],'amaflags':_0xfcbe('0x4')}),'log':_0xfcbe('0x2')});};exports[_0xfcbe('0x5')]=function(){return function(){return client[_0xfcbe('0x6')](_0xfcbe('0x7'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0xfcbe('0x8')](_0xfcbe('0x9'))[_0xfcbe('0xa')](_0xfcbe('0xb')),moment()['endOf'](_0xfcbe('0x9'))[_0xfcbe('0xa')](_0xfcbe('0xb'))]}},'attributes':['type','disposition','duration',_0xfcbe('0xc')]},'log':_0xfcbe('0xd')});};}; \ No newline at end of file +var _0x7a29=['context','getVoiceCallReports','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','disposition','duration','GetVoiceCallReports','moment','util','lodash','create','Request','CreateVoiceCallReport','calleridnum'];(function(_0x2bbc02,_0x36b28a){var _0x40a67a=function(_0x50b4b3){while(--_0x50b4b3){_0x2bbc02['push'](_0x2bbc02['shift']());}};_0x40a67a(++_0x36b28a);}(_0x7a29,0x92));var _0x97a2=function(_0x357078,_0x1167ee){_0x357078=_0x357078-0x0;var _0x285339=_0x7a29[_0x357078];return _0x285339;};'use strict';var moment=require(_0x97a2('0x0'));var util=require(_0x97a2('0x1'));var _=require(_0x97a2('0x2'));var client=require('../client');exports[_0x97a2('0x3')]=function(_0x37a88a){return client[_0x97a2('0x4')](_0x97a2('0x5'),{'body':_['merge'](_0x37a88a,{'source':_0x37a88a[_0x97a2('0x6')],'destinationcontext':_0x37a88a[_0x97a2('0x7')],'callerid':_0x37a88a['callerid'],'amaflags':'DOCUMENTATION'}),'log':_0x97a2('0x5')});};exports[_0x97a2('0x8')]=function(){return function(){return client[_0x97a2('0x4')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x97a2('0x9')],'createdAt':{'$between':[moment()[_0x97a2('0xa')](_0x97a2('0xb'))[_0x97a2('0xc')](_0x97a2('0xd')),moment()['endOf'](_0x97a2('0xb'))[_0x97a2('0xc')](_0x97a2('0xd'))]}},'attributes':['type',_0x97a2('0xe'),_0x97a2('0xf'),'billableseconds']},'log':_0x97a2('0x10')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 4c1860d..65bc7fe 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 _0xe471=['../client','create','Request','CreateVoiceDialReport'];(function(_0x40216e,_0x50106c){var _0x46aa0d=function(_0x1f8e4d){while(--_0x1f8e4d){_0x40216e['push'](_0x40216e['shift']());}};_0x46aa0d(++_0x50106c);}(_0xe471,0xcc));var _0x1e47=function(_0x5a7fe2,_0x5a16c6){_0x5a7fe2=_0x5a7fe2-0x0;var _0x5c6739=_0xe471[_0x5a7fe2];return _0x5c6739;};'use strict';var client=require(_0x1e47('0x0'));exports[_0x1e47('0x1')]=function(_0x2a0721){return client[_0x1e47('0x2')]('CreateVoiceDialReport',{'body':_0x2a0721,'log':_0x1e47('0x3')});}; \ No newline at end of file +var _0x6289=['CreateVoiceDialReport','../client','create'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x6289,0x6a));var _0x9628=function(_0x3de8a2,_0x1c8615){_0x3de8a2=_0x3de8a2-0x0;var _0x267573=_0x6289[_0x3de8a2];return _0x267573;};'use strict';var client=require(_0x9628('0x0'));exports[_0x9628('0x1')]=function(_0x23aa18){return client['Request'](_0x9628('0x2'),{'body':_0x23aa18,'log':_0x9628('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 08e90f3..65b56a3 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 _0x2821=['GetVoiceExtension','exten','recordingFormat','../client','getVoiceExtensions','Request'];(function(_0xb7e71,_0xc0d6a){var _0x256bc8=function(_0x55e0d8){while(--_0x55e0d8){_0xb7e71['push'](_0xb7e71['shift']());}};_0x256bc8(++_0xc0d6a);}(_0x2821,0x87));var _0x1282=function(_0x1db45,_0xd89a76){_0x1db45=_0x1db45-0x0;var _0x4768bb=_0x2821[_0x1db45];return _0x4768bb;};'use strict';var client=require(_0x1282('0x0'));exports[_0x1282('0x1')]=function(){return function(){return client[_0x1282('0x2')](_0x1282('0x3'),{'options':{'raw':!![],'attributes':['id',_0x1282('0x4'),_0x1282('0x5')],'where':{'VoiceExtensionId':null}},'log':_0x1282('0x1')});};}; \ No newline at end of file +var _0xa0bc=['exten','recordingFormat','getVoiceExtensions','Request'];(function(_0x506664,_0x2ba4b0){var _0xeac868=function(_0xc277a9){while(--_0xc277a9){_0x506664['push'](_0x506664['shift']());}};_0xeac868(++_0x2ba4b0);}(_0xa0bc,0x1b6));var _0xca0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0bc[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0xca0b('0x0')]=function(){return function(){return client[_0xca0b('0x1')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0xca0b('0x2'),_0xca0b('0x3')],'where':{'VoiceExtensionId':null}},'log':_0xca0b('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index b024c66..a819d4d 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 _0x1528=['dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialQueueProject2','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','active','Trunk','TrunkBackup','callerid','Interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName'];(function(_0x369cf2,_0x47e28c){var _0x5c7d3e=function(_0x4143d9){while(--_0x4143d9){_0x369cf2['push'](_0x369cf2['shift']());}};_0x5c7d3e(++_0x47e28c);}(_0x1528,0x19b));var _0x8152=function(_0x425d7b,_0x454d53){_0x425d7b=_0x425d7b-0x0;var _0x5a1bc6=_0x1528[_0x425d7b];return _0x5a1bc6;};'use strict';var client=require(_0x8152('0x0'));exports[_0x8152('0x1')]=function(){return function(){return client[_0x8152('0x2')](_0x8152('0x3'),{'options':{'raw':![],'attributes':['id',_0x8152('0x4'),_0x8152('0x5'),_0x8152('0x6'),_0x8152('0x7'),'monitor_format',_0x8152('0x8'),_0x8152('0x9'),_0x8152('0xa'),_0x8152('0xb'),_0x8152('0xc'),_0x8152('0xd'),'dialPredictiveOptimization',_0x8152('0xe'),'dialPredictiveInterval',_0x8152('0xf'),_0x8152('0x10'),_0x8152('0x11'),'dialQueueOptions',_0x8152('0x12'),_0x8152('0x13'),_0x8152('0x14'),_0x8152('0x15'),_0x8152('0x16'),_0x8152('0x17'),_0x8152('0x18'),_0x8152('0x19'),_0x8152('0x1a'),_0x8152('0x1b'),_0x8152('0x1c'),_0x8152('0x1d'),_0x8152('0x1e'),'dialAMDActive',_0x8152('0x1f'),_0x8152('0x20'),_0x8152('0x21'),_0x8152('0x22'),'dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords',_0x8152('0x23'),'dialAMDMaximumWordLength',_0x8152('0x24'),_0x8152('0x25'),_0x8152('0x26'),_0x8152('0x27'),'dialAgiAfterHangupAgent','dialAgiAfterHangupClient',_0x8152('0x28'),_0x8152('0x29'),_0x8152('0x2a'),_0x8152('0x2b'),_0x8152('0x2c'),_0x8152('0x2d'),_0x8152('0x2e'),_0x8152('0x2f'),_0x8152('0x30'),'dialAbandonedMaxRetry',_0x8152('0x31'),_0x8152('0x32'),'dialMachineRetryFrequency',_0x8152('0x33'),_0x8152('0x34'),_0x8152('0x35'),_0x8152('0x36'),_0x8152('0x37')],'include':[{'model':'Trunk','as':'Trunk','attributes':['id','name','callerid',_0x8152('0x38')]},{'model':'Pause','as':'mandatoryDispositionPause','attributes':['id',_0x8152('0x4')]},{'model':_0x8152('0x39'),'as':_0x8152('0x3a'),'attributes':['id',_0x8152('0x4'),_0x8152('0x3b'),_0x8152('0x38')]},{'model':'Interval','as':_0x8152('0x3c'),'attributes':['id',_0x8152('0x4')],'include':[{'model':_0x8152('0x3c'),'as':'Intervals','attributes':['id','name','interval']}]}]},'log':_0x8152('0x1')});};}; \ No newline at end of file +var _0x046f=['getVoiceQueues','name','acw','acwTimeout','autopause','type','dialMethod','dialLimitQueue','dialPowerLevel','dialOriginateCallerIdNumber','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','../client'];(function(_0x102fdc,_0x3d5a60){var _0x24b8eb=function(_0x5916d3){while(--_0x5916d3){_0x102fdc['push'](_0x102fdc['shift']());}};_0x24b8eb(++_0x3d5a60);}(_0x046f,0x73));var _0xf046=function(_0x4eaedd,_0x4c28c0){_0x4eaedd=_0x4eaedd-0x0;var _0x1f943c=_0x046f[_0x4eaedd];return _0x1f943c;};'use strict';var client=require(_0xf046('0x0'));exports[_0xf046('0x1')]=function(){return function(){return client['Request']('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0xf046('0x2'),_0xf046('0x3'),_0xf046('0x4'),_0xf046('0x5'),'monitor_format',_0xf046('0x6'),'dialActive',_0xf046('0x7'),'dialLimitChannel',_0xf046('0x8'),_0xf046('0x9'),'dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName',_0xf046('0xa'),'dialOriginateTimeout','dialQueueOptions',_0xf046('0xb'),'dialQueueProject',_0xf046('0xc'),_0xf046('0xd'),'dialBusyMaxRetry',_0xf046('0xe'),_0xf046('0xf'),_0xf046('0x10'),_0xf046('0x11'),_0xf046('0x12'),_0xf046('0x13'),_0xf046('0x14'),_0xf046('0x15'),'dialAMDActive','dialAMDInitialSilence',_0xf046('0x16'),_0xf046('0x17'),_0xf046('0x18'),_0xf046('0x19'),_0xf046('0x1a'),_0xf046('0x1b'),'dialAMDSilenceThreshold',_0xf046('0x1c'),_0xf046('0x1d'),_0xf046('0x1e'),_0xf046('0x1f'),_0xf046('0x20'),_0xf046('0x21'),_0xf046('0x22'),_0xf046('0x23'),_0xf046('0x24'),_0xf046('0x25'),'dialRandomLastDigitCallerIdNumber',_0xf046('0x26'),'dialNoSuchNumberMaxRetry',_0xf046('0x27'),_0xf046('0x28'),_0xf046('0x29'),_0xf046('0x2a'),'dialAbandonedRetryFrequency',_0xf046('0x2b'),_0xf046('0x2c'),_0xf046('0x2d'),_0xf046('0x2e'),'mandatoryDisposition',_0xf046('0x2f'),_0xf046('0x30')],'include':[{'model':_0xf046('0x31'),'as':_0xf046('0x31'),'attributes':['id',_0xf046('0x2'),_0xf046('0x32'),_0xf046('0x33')]},{'model':_0xf046('0x34'),'as':_0xf046('0x35'),'attributes':['id',_0xf046('0x2')]},{'model':_0xf046('0x31'),'as':_0xf046('0x36'),'attributes':['id',_0xf046('0x2'),_0xf046('0x32'),_0xf046('0x33')]},{'model':_0xf046('0x37'),'as':_0xf046('0x37'),'attributes':['id',_0xf046('0x2')],'include':[{'model':'Interval','as':_0xf046('0x38'),'attributes':['id',_0xf046('0x2'),_0xf046('0x39')]}]}]},'log':_0xf046('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 4c68ab9..d37a154 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(_0x4de58e,_0x5dbdd9){var _0x42eb56=function(_0x1565c8){while(--_0x1565c8){_0x4de58e['push'](_0x4de58e['shift']());}};_0x42eb56(++_0x5dbdd9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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(_0x507cef,_0x30dd42){var _0x13ae09=function(_0x3bd5c0){while(--_0x3bd5c0){_0x507cef['push'](_0x507cef['shift']());}};_0x13ae09(++_0x30dd42);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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 3eeb2c6..0cede58 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 _0x6630=['Request','GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x3212c4,_0x5ef5f7){var _0xc89199=function(_0x2b5e7f){while(--_0x2b5e7f){_0x3212c4['push'](_0x3212c4['shift']());}};_0xc89199(++_0x5ef5f7);}(_0x6630,0x166));var _0x0663=function(_0xe89df9,_0x29ba97){_0xe89df9=_0xe89df9-0x0;var _0x173f85=_0x6630[_0xe89df9];return _0x173f85;};'use strict';var client=require(_0x0663('0x0'));exports[_0x0663('0x1')]=function(_0x2c8e5){return function(){return client[_0x0663('0x2')](_0x0663('0x3'),{'options':{'where':{'VoiceQueueId':_0x2c8e5,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file +var _0x8e8a=['../client','getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x263999,_0x477176){var _0x336996=function(_0x43c50a){while(--_0x43c50a){_0x263999['push'](_0x263999['shift']());}};_0x336996(++_0x477176);}(_0x8e8a,0xcc));var _0xa8e8=function(_0x3004cf,_0x17641f){_0x3004cf=_0x3004cf-0x0;var _0x347e8b=_0x8e8a[_0x3004cf];return _0x347e8b;};'use strict';var client=require(_0xa8e8('0x0'));exports[_0xa8e8('0x1')]=function(_0x2f02c3){return function(){return client[_0xa8e8('0x2')](_0xa8e8('0x3'),{'options':{'where':{'VoiceQueueId':_0x2f02c3,'paused':!![]},'raw':!![]},'log':_0xa8e8('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 3397ed1..88bf533 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x3c4f11,_0x3367c9){var _0x5cdb22=function(_0x9fcc67){while(--_0x9fcc67){_0x3c4f11['push'](_0x3c4f11['shift']());}};_0x5cdb22(++_0x3367c9);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x3393a6,_0x111b57){var _0x29a783=function(_0x56dd99){while(--_0x56dd99){_0x3393a6['push'](_0x3393a6['shift']());}};_0x29a783(++_0x111b57);}(_0x7a54,0x106));var _0x47a5=function(_0x1b7761,_0x28e696){_0x1b7761=_0x1b7761-0x0;var _0x4f98f4=_0x7a54[_0x1b7761];return _0x4f98f4;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index f93b809..65d1b2b 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 _0x6de8=['transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','context','blind','CreateVoiceTransferReport','attendedTransfer','Request','result','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','isexternal','origtransfererexten','attended','../client','transfers','transfererchannel','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum'];(function(_0xea1f69,_0x314681){var _0x2d272e=function(_0x587471){while(--_0x587471){_0xea1f69['push'](_0xea1f69['shift']());}};_0x2d272e(++_0x314681);}(_0x6de8,0xb7));var _0x86de=function(_0x3b0c9d,_0x3ddeb5){_0x3b0c9d=_0x3b0c9d-0x0;var _0xcfc8d7=_0x6de8[_0x3b0c9d];return _0xcfc8d7;};'use strict';var client=require(_0x86de('0x0'));exports[_0x86de('0x1')]={};exports['blindTransfer']=function(_0x4ffe44){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x4ffe44['result'],'transfererchannel':_0x4ffe44[_0x86de('0x2')],'transferercalleridnum':_0x4ffe44['transferercalleridnum'],'transferercalleridname':_0x4ffe44['transferercalleridname'],'transfererconnectedlinenum':_0x4ffe44[_0x86de('0x3')],'transfererconnectedlinename':_0x4ffe44[_0x86de('0x4')],'transfereraccountcode':_0x4ffe44[_0x86de('0x5')],'transferercontext':_0x4ffe44[_0x86de('0x6')],'transfererexten':_0x4ffe44[_0x86de('0x7')],'transfererlinkedid':_0x4ffe44[_0x86de('0x8')],'transfereechannel':_0x4ffe44['transfereechannel'],'transfereecalleridnum':_0x4ffe44[_0x86de('0x9')],'transfereecalleridname':_0x4ffe44[_0x86de('0xa')],'transfereeconnectedlinenum':_0x4ffe44[_0x86de('0xb')],'transfereeconnectedlinename':_0x4ffe44[_0x86de('0xc')],'transfereeaccountcode':_0x4ffe44[_0x86de('0xd')],'transfereecontext':_0x4ffe44[_0x86de('0xe')],'transfereeexten':_0x4ffe44[_0x86de('0xf')],'transfereelinkedid':_0x4ffe44[_0x86de('0x10')],'isexternal':_0x4ffe44['isexternal'],'context':_0x4ffe44[_0x86de('0x11')],'extension':_0x4ffe44['extension'],'type':_0x86de('0x12')},'log':_0x86de('0x13')});};exports[_0x86de('0x14')]=function(_0xcb4cd6){return client[_0x86de('0x15')](_0x86de('0x13'),{'body':{'result':_0xcb4cd6[_0x86de('0x16')],'transfererchannel':_0xcb4cd6[_0x86de('0x17')],'transferercalleridnum':_0xcb4cd6[_0x86de('0x18')],'transferercalleridname':_0xcb4cd6[_0x86de('0x19')],'transfererconnectedlinenum':_0xcb4cd6[_0x86de('0x1a')],'transfererconnectedlinename':_0xcb4cd6[_0x86de('0x1b')],'transfereraccountcode':_0xcb4cd6['origtransfereraccountcode'],'transferercontext':_0xcb4cd6[_0x86de('0x1c')],'transfererexten':_0xcb4cd6['secondtransfererexten'],'transfererlinkedid':_0xcb4cd6[_0x86de('0x1d')],'transfereechannel':_0xcb4cd6[_0x86de('0x1e')],'transfereecalleridnum':_0xcb4cd6[_0x86de('0x1f')],'transfereecalleridname':_0xcb4cd6['transfertargetcalleridname'],'transfereeconnectedlinenum':_0xcb4cd6['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0xcb4cd6[_0x86de('0x20')],'transfereeaccountcode':_0xcb4cd6[_0x86de('0x21')],'transfereecontext':_0xcb4cd6[_0x86de('0x22')],'transfereeexten':_0xcb4cd6[_0x86de('0x23')],'transfereelinkedid':_0xcb4cd6['transfertargetlinkedid'],'isexternal':_0xcb4cd6[_0x86de('0x24')],'context':_0xcb4cd6['origtransferercontext'],'extension':_0xcb4cd6[_0x86de('0x25')],'type':_0x86de('0x26')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0x4a1c=['transfereeexten','isexternal','extension','blind','CreateVoiceTransferReport','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','origtransferercontext','origtransfererexten','transfers','blindTransfer','Request','result','transfererchannel','transferercalleridname','transfererconnectedlinename','transferercontext','transfererlinkedid','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext'];(function(_0x3c9368,_0x568de8){var _0x170e77=function(_0x3fb1ad){while(--_0x3fb1ad){_0x3c9368['push'](_0x3c9368['shift']());}};_0x170e77(++_0x568de8);}(_0x4a1c,0xc5));var _0xc4a1=function(_0x21c068,_0x369d6a){_0x21c068=_0x21c068-0x0;var _0x5cf199=_0x4a1c[_0x21c068];return _0x5cf199;};'use strict';var client=require('../client');exports[_0xc4a1('0x0')]={};exports[_0xc4a1('0x1')]=function(_0xb9745a){return client[_0xc4a1('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0xb9745a[_0xc4a1('0x3')],'transfererchannel':_0xb9745a[_0xc4a1('0x4')],'transferercalleridnum':_0xb9745a['transferercalleridnum'],'transferercalleridname':_0xb9745a[_0xc4a1('0x5')],'transfererconnectedlinenum':_0xb9745a['transfererconnectedlinenum'],'transfererconnectedlinename':_0xb9745a[_0xc4a1('0x6')],'transfereraccountcode':_0xb9745a['transfereraccountcode'],'transferercontext':_0xb9745a[_0xc4a1('0x7')],'transfererexten':_0xb9745a['transfererexten'],'transfererlinkedid':_0xb9745a[_0xc4a1('0x8')],'transfereechannel':_0xb9745a['transfereechannel'],'transfereecalleridnum':_0xb9745a['transfereecalleridnum'],'transfereecalleridname':_0xb9745a['transfereecalleridname'],'transfereeconnectedlinenum':_0xb9745a[_0xc4a1('0x9')],'transfereeconnectedlinename':_0xb9745a[_0xc4a1('0xa')],'transfereeaccountcode':_0xb9745a[_0xc4a1('0xb')],'transfereecontext':_0xb9745a[_0xc4a1('0xc')],'transfereeexten':_0xb9745a[_0xc4a1('0xd')],'transfereelinkedid':_0xb9745a['transfereelinkedid'],'isexternal':_0xb9745a[_0xc4a1('0xe')],'context':_0xb9745a['context'],'extension':_0xb9745a[_0xc4a1('0xf')],'type':_0xc4a1('0x10')},'log':_0xc4a1('0x11')});};exports[_0xc4a1('0x12')]=function(_0x2c0291){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x2c0291[_0xc4a1('0x3')],'transfererchannel':_0x2c0291[_0xc4a1('0x13')],'transferercalleridnum':_0x2c0291[_0xc4a1('0x14')],'transferercalleridname':_0x2c0291[_0xc4a1('0x15')],'transfererconnectedlinenum':_0x2c0291['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x2c0291['secondtransfererconnectedlinename'],'transfereraccountcode':_0x2c0291[_0xc4a1('0x16')],'transferercontext':_0x2c0291[_0xc4a1('0x17')],'transfererexten':_0x2c0291[_0xc4a1('0x18')],'transfererlinkedid':_0x2c0291[_0xc4a1('0x19')],'transfereechannel':_0x2c0291[_0xc4a1('0x1a')],'transfereecalleridnum':_0x2c0291[_0xc4a1('0x1b')],'transfereecalleridname':_0x2c0291[_0xc4a1('0x1c')],'transfereeconnectedlinenum':_0x2c0291[_0xc4a1('0x1d')],'transfereeconnectedlinename':_0x2c0291['transfertargetconnectedlinename'],'transfereeaccountcode':_0x2c0291[_0xc4a1('0x1e')],'transfereecontext':_0x2c0291[_0xc4a1('0x1f')],'transfereeexten':_0x2c0291['transfertargetexten'],'transfereelinkedid':_0x2c0291[_0xc4a1('0x20')],'isexternal':_0x2c0291['isexternal'],'context':_0x2c0291[_0xc4a1('0x21')],'extension':_0x2c0291[_0xc4a1('0x22')],'type':'attended'},'log':_0xc4a1('0x11')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 19a8186..5788cea 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 _0x6075=['moment','../../../config/environment','../properties','../ami','listen','format','SIP','name','timers','updateAcw','agents','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','module','Reload','Action','then','message','catch','command','content','voiceQueues','hasOwnProperty','strategy','answered','loggedIn','pTalking','sumHoldTime','talking','total','type','unmanaged','waiting','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','length','find','omit','undefined','values','voicechannel','map','channels','uniqueid','channel','%s.%s','filename','MixMonitor','ai(mixmonitorid)','toLowerCase','isNil','monitors','push','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','resolve','StopMixMonitor','destinationchannel','stop','wav','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','queueChannels','voicequeuechannel','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','util','jayson/promise','validate','bluebird'];(function(_0x3ccae8,_0xca6377){var _0xed9e8=function(_0x377882){while(--_0x377882){_0x3ccae8['push'](_0x3ccae8['shift']());}};_0xed9e8(++_0xca6377);}(_0x6075,0x191));var _0x5607=function(_0x3fe5b4,_0x545d83){_0x3fe5b4=_0x3fe5b4-0x0;var _0x12b07d=_0x6075[_0x3fe5b4];return _0x12b07d;};'use strict';var _=require('lodash');var util=require(_0x5607('0x0'));var jayson=require(_0x5607('0x1'));var schema=require(_0x5607('0x2'));var BPromise=require(_0x5607('0x3'));var moment=require(_0x5607('0x4'));var config=require(_0x5607('0x5'));var properties=require(_0x5607('0x6'));var ami=require(_0x5607('0x7'));exports[_0x5607('0x8')]=function(_0x4d333d,_0x1f4637,_0xabf691){return new BPromise(function(_0x14b9f4,_0x5ab18d){var _0x53f825={'QueuePause':function(_0x3dc860){return new Promise(function(_0x25107d,_0x24d9da){var _0x299836=util[_0x5607('0x9')]('%s/%s',_0x5607('0xa'),_0x3dc860[_0x5607('0xb')]);if(_0x4d333d[_0x5607('0xc')]&&_0x4d333d['timers'][_0x299836]&&_0x4d333d[_0x5607('0xc')][_0x299836]['timer']){_0x4d333d['timers'][_0x299836][_0x5607('0xd')]();}if(_0x4d333d[_0x5607('0xe')][_0x299836]){_0x4d333d[_0x5607('0xe')][_0x299836]['updateStatusRealtime']({'statePause':_0x3dc860[_0x5607('0xf')]?!![]:![]});}_0x25107d({'code':0xc8,'message':_0x5607('0x10')});});},'Reload':function(_0xc534bd){var _0x39fc33=this;return new Promise(function(_0xe6368d,_0x33c436){if(ami[_0x5607('0x11')]()==![]){return _0x33c436(_0x39fc33[_0x5607('0x12')](0x1f4,[config[_0x5607('0x13')]['ip'],config['asterisk'][_0x5607('0x14')],_0x5607('0x15')][_0x5607('0x16')]('\x20')));}_0xc534bd=_['pick'](_0xc534bd,_['keys'](properties[_0x5607('0x17')]));_0xc534bd['action']=_0x5607('0x18');return ami[_0x5607('0x19')](_0xc534bd)[_0x5607('0x1a')](function(_0x1375e9){_0xe6368d({'code':0xc8,'message':_0x1375e9[_0x5607('0x1b')]});})[_0x5607('0x1c')](function(_0x55689e){_0x33c436(_0x39fc33[_0x5607('0x12')](0x1f5,_0x55689e['message']));});});},'Command':function(_0x180775){var _0x3e071b=this;return new Promise(function(_0x430f68,_0x5f080d){if(ami[_0x5607('0x11')]()==![]){return _0x5f080d(_0x3e071b[_0x5607('0x12')](0x1f4,[config[_0x5607('0x13')]['ip'],config['asterisk'][_0x5607('0x14')],_0x5607('0x15')][_0x5607('0x16')]('\x20')));}_0x180775=_['pick'](_0x180775,_0x5607('0x1d'));_0x180775['action']='Command';return ami[_0x5607('0x19')](_0x180775)[_0x5607('0x1a')](function(_0x32d30a){_0x430f68({'code':0xc8,'message':_0x32d30a[_0x5607('0x1e')]});})[_0x5607('0x1c')](function(_0x34df69){_0x5f080d(_0x3e071b[_0x5607('0x12')](0x1f5,_0x34df69[_0x5607('0x1b')]));});});},'VoiceQueues':function(_0x8a7592){return new Promise(function(_0x42a1af,_0x593df7){var _0x20ae60=[];for(var _0x27e144 in _0x4d333d['voiceQueues']){if(_0x4d333d[_0x5607('0x1f')][_0x5607('0x20')](_0x27e144)){var _0xdb07c8=_0x4d333d[_0x5607('0x1f')][_0x27e144];var _0x447042={'id':_0xdb07c8['id'],'name':_0xdb07c8[_0x5607('0xb')],'strategy':_0xdb07c8[_0x5607('0x21')],'answered':_0xdb07c8[_0x5607('0x22')],'available':_0xdb07c8['available'],'loggedIn':_0xdb07c8[_0x5607('0x23')],'pTalking':_0xdb07c8[_0x5607('0x24')],'sumBillable':_0xdb07c8['sumBillable'],'sumDuration':_0xdb07c8['sumDuration'],'sumHoldTime':_0xdb07c8[_0x5607('0x25')]||0x0,'talking':_0xdb07c8[_0x5607('0x26')],'total':_0xdb07c8[_0x5607('0x27')],'type':_0xdb07c8[_0x5607('0x28')],'unmanaged':_0xdb07c8[_0x5607('0x29')],'abandoned':_0xdb07c8['abandoned'],'waiting':_0xdb07c8[_0x5607('0x2a')],'loggedInDb':_0xdb07c8['loggedInDb']};if(_0xdb07c8[_0x5607('0x28')]===_0x5607('0x2b')){_0x447042[_0x5607('0x2c')]=_0xdb07c8['dialActive'];_0x447042[_0x5607('0x2d')]=_0xdb07c8['dialMethod'];_0x447042[_0x5607('0x2e')]=_0xdb07c8[_0x5607('0x2e')];_0x447042[_0x5607('0x2f')]=_0xdb07c8[_0x5607('0x2f')];_0x447042[_0x5607('0x30')]=_0xdb07c8['dialOriginateTimeout'];_0x447042[_0x5607('0x31')]=_0xdb07c8['dialPrefix'];_0x447042[_0x5607('0x32')]=_0xdb07c8[_0x5607('0x32')];_0x447042['outboundAnswerAgiCallsDay']=_0xdb07c8[_0x5607('0x33')];_0x447042[_0x5607('0x34')]=_0xdb07c8[_0x5607('0x34')];_0x447042['outboundBlacklistCallsDay']=_0xdb07c8[_0x5607('0x35')];_0x447042[_0x5607('0x36')]=_0xdb07c8[_0x5607('0x36')];_0x447042[_0x5607('0x37')]=_0xdb07c8['outboundCongestionCallsDay'];_0x447042[_0x5607('0x38')]=_0xdb07c8[_0x5607('0x38')];_0x447042['outboundDropCallsDayCallersExit']=_0xdb07c8[_0x5607('0x39')];_0x447042[_0x5607('0x3a')]=_0xdb07c8[_0x5607('0x3a')];_0x447042['outboundNoAnswerCallsDay']=_0xdb07c8[_0x5607('0x3b')];_0x447042['outboundNoSuchCallsDay']=_0xdb07c8[_0x5607('0x3c')];_0x447042[_0x5607('0x3d')]=_0xdb07c8[_0x5607('0x3d')];_0x447042['outboundReCallsDay']=_0xdb07c8['outboundReCallsDay'];_0x447042['outboundRejectCallsDay']=_0xdb07c8[_0x5607('0x3e')];_0x447042[_0x5607('0x3f')]=_0xdb07c8[_0x5607('0x3f')];_0x447042[_0x5607('0x40')]=_0xdb07c8[_0x5607('0x40')];_0x447042[_0x5607('0x41')]=_0xdb07c8[_0x5607('0x41')];_0x447042[_0x5607('0x42')]=_0xdb07c8['predictiveIntervalAvgTalktime'];_0x447042[_0x5607('0x43')]=_0xdb07c8[_0x5607('0x43')];_0x447042[_0x5607('0x44')]=_0xdb07c8[_0x5607('0x44')];_0x447042['predictiveIntervalErlangCalls']=_0xdb07c8[_0x5607('0x45')];_0x447042[_0x5607('0x46')]=_0xdb07c8['predictiveIntervalErlangCallsDroppedCalls'];_0x447042['predictiveIntervalHitRate']=_0xdb07c8[_0x5607('0x47')];_0x447042[_0x5607('0x48')]=_0xdb07c8[_0x5607('0x48')];_0x447042['predictiveIntervalPauses']=_0xdb07c8['predictiveIntervalPauses'];_0x447042['predictiveIntervalAvailable']=_0xdb07c8[_0x5607('0x49')];_0x447042[_0x5607('0x4a')]=_0xdb07c8[_0x5607('0x4a')];_0x447042['message']=_0xdb07c8[_0x5607('0x1b')];_0x447042[_0x5607('0x4b')]=_0xdb07c8[_0x5607('0x4b')];_0x447042[_0x5607('0x4c')]=_0xdb07c8[_0x5607('0x4c')];_0x447042[_0x5607('0x4d')]=_0xdb07c8[_0x5607('0x4d')];_0x447042['erlangAbandonmentRate']=_0xdb07c8['erlangAbandonmentRate'];_0x447042[_0x5607('0x4e')]=_0xdb07c8[_0x5607('0x4e')];_0x447042[_0x5607('0x4f')]=_0xdb07c8['startPredictive'];_0x447042[_0x5607('0x50')]=_0xdb07c8[_0x5607('0x50')];}if(_0xdb07c8['Trunk']){_0x447042[_0x5607('0x51')]={'id':_0xdb07c8[_0x5607('0x51')]['id'],'name':_0xdb07c8['Trunk']['name'],'active':_0xdb07c8[_0x5607('0x51')][_0x5607('0x52')],'callerid':_0xdb07c8[_0x5607('0x51')]['callerid']};}if(_0xdb07c8[_0x5607('0x53')]){_0x447042[_0x5607('0x53')]={'id':_0xdb07c8['Interval']['id'],'name':_0xdb07c8[_0x5607('0x53')][_0x5607('0xb')]};}_0x20ae60['push'](_0x447042);}}_0x42a1af({'count':_0x20ae60[_0x5607('0x54')],'rows':_0x20ae60});});},'UpdateVoiceQueue':function(_0x1dbb00){return new Promise(function(_0x4388b8,_0x5522d8){var _0x2dd1f8=_[_0x5607('0x55')](_0x4d333d[_0x5607('0x1f')],{'id':parseInt(_0x1dbb00['id'])});var _0x2dddb2=_[_0x5607('0x56')](_0x1dbb00,['id']);if(_0x2dd1f8){for(var _0x517cc5 in _0x2dddb2){if(typeof _0x2dddb2[_0x517cc5]!==_0x5607('0x57')&&typeof _0x2dd1f8[_0x517cc5]!==_0x5607('0x57')){_0x2dd1f8[_0x517cc5]=_0x2dddb2[_0x517cc5];}}_0x4388b8(_0x2dd1f8);}else{_0x5522d8();}});},'VoiceChannels':function(_0x1bae90){return new Promise(function(_0x285306,_0xd0f24f){var _0x51c1fc=_[_0x5607('0x58')](_0x4d333d['channels']);_0x285306({'count':_0x51c1fc[_0x5607('0x54')],'rows':_0x51c1fc});});},'VoiceChannelMixMonitor':function(_0x4d88d){var _0x7ab0f9=this;return new Promise(function(_0x1a0975,_0x1b52b3){if(ami[_0x5607('0x11')]()==![]){return _0x1b52b3(_0x7ab0f9['error'](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x5607('0x14')],_0x5607('0x15')]['join']('\x20')));}var _0xa6e098=schema(properties[_0x5607('0x59')])[_0x5607('0x2')](_0x4d88d);if(_0xa6e098[_0x5607('0x54')]>0x0){return _0x1b52b3(_0x7ab0f9[_0x5607('0x12')](0x1f4,_[_0x5607('0x5a')](_0xa6e098,_0x5607('0x1b'))[_0x5607('0x16')](',\x20')));}var _0xa10e08=_[_0x5607('0x55')](_0x4d333d[_0x5607('0x5b')],{'uniqueid':_0x4d88d[_0x5607('0x5c')]});if(_0xa10e08&&_0xa10e08[_0x5607('0x5d')]){var _0x13b009=util[_0x5607('0x9')](_0x5607('0x5e'),_0x4d88d[_0x5607('0x5f')]||_0x4d88d['uniqueid'],_0x4d88d[_0x5607('0x9')]||'wav');return ami[_0x5607('0x19')]({'action':_0x5607('0x60'),'channel':_0xa10e08[_0x5607('0x5d')],'file':_0x13b009,'options':_0x5607('0x61')})[_0x5607('0x1a')](function(_0x1427eb){var _0x56d456=_[_0x5607('0x55')](_0xa10e08['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x13b009[_0x5607('0x62')]()});if(_[_0x5607('0x63')](_0x56d456)){_0xa10e08[_0x5607('0x64')][_0x5607('0x65')]({'filename':'/var/spool/asterisk/monitor/'+_0x13b009[_0x5607('0x62')](),'createdAt':moment()['format'](_0x5607('0x66')),'mixmonitorid':_0x1427eb[_0x5607('0x67')],'status':_0x5607('0x68')});}else{_0x56d456[_0x5607('0x67')]=_0x1427eb['mixmonitorid'];_0x56d456[_0x5607('0x69')]=_0x5607('0x68');}_0x1a0975({'code':0xc8,'message':[_0x4d88d['uniqueid'],_0x5607('0x6a'),_0x1427eb['mixmonitorid']][_0x5607('0x16')]('\x20'),'mixmonitorid':_0x1427eb[_0x5607('0x67')]});})[_0x5607('0x1c')](function(_0x335b82){_0x1b52b3(_0x7ab0f9[_0x5607('0x12')](0x1f5,[_0x4d88d['uniqueid'],_0x335b82[_0x5607('0x1b')][_0x5607('0x62')]()][_0x5607('0x16')]('\x20')));});}else{return _0x1b52b3(_0x7ab0f9[_0x5607('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x316b43){var _0x29b46f=this;return new Promise(function(_0x4fdf0e,_0x4da3f9){if(ami[_0x5607('0x11')]()==![]){return _0x4da3f9(_0x29b46f[_0x5607('0x12')](0x1f4,[config[_0x5607('0x13')]['ip'],config[_0x5607('0x13')][_0x5607('0x14')],'ami\x20disconnected']['join']('\x20')));}var _0x279420=schema(properties['voicechannel'])[_0x5607('0x2')](_0x316b43);if(_0x279420['length']>0x0){return _0x4da3f9(_0x29b46f['error'](0x1f4,_['map'](_0x279420,'message')[_0x5607('0x16')](',\x20')));}var _0x3fc9be=_[_0x5607('0x55')](_0x4d333d[_0x5607('0x5b')],{'uniqueid':_0x316b43[_0x5607('0x5c')]});if(_0x3fc9be){return BPromise[_0x5607('0x6b')]()[_0x5607('0x1a')](function(){if(_0x3fc9be['channel']){return ami[_0x5607('0x19')]({'action':_0x5607('0x6c'),'channel':_0x3fc9be[_0x5607('0x5d')],'mixmonitorid':_0x316b43['mixmonitorid']})[_0x5607('0x1c')](function(_0xb27fd7){});}})['then'](function(){if(_0x3fc9be[_0x5607('0x6d')]){return ami['Action']({'action':_0x5607('0x6c'),'channel':_0x3fc9be[_0x5607('0x6d')],'mixmonitorid':_0x316b43['mixmonitorid']})[_0x5607('0x1c')](function(_0x1291a0){});}})[_0x5607('0x1a')](function(_0x7cf9a9){var _0x25543d=_[_0x5607('0x55')](_0x3fc9be[_0x5607('0x64')],{'mixmonitorid':_0x316b43['mixmonitorid']});if(_0x25543d){_0x25543d['status']=_0x5607('0x6e');}})[_0x5607('0x1a')](function(){var _0x24638f=util[_0x5607('0x9')](_0x5607('0x5e'),_0x316b43[_0x5607('0x5f')]||_0x316b43[_0x5607('0x5c')],_0x316b43[_0x5607('0x9')]||_0x5607('0x6f'));var _0x1c92fb=_['find'](_0x3fc9be[_0x5607('0x64')],{'filename':'/var/spool/asterisk/monitor/'+_0x24638f[_0x5607('0x62')]()});if(_0x1c92fb){_0x1c92fb[_0x5607('0x69')]=_0x5607('0x6e');}})['then'](function(){_0x4fdf0e({'code':0xc8,'message':[_0x316b43['uniqueid'],_0x5607('0x70')]['join']('\x20')});})['catch'](function(_0x48a075){_0x4da3f9(_0x29b46f['error'](0x1f5,[_0x316b43[_0x5607('0x5c')],_0x48a075[_0x5607('0x1b')][_0x5607('0x62')]()][_0x5607('0x16')]('\x20')));});}else{return _0x4da3f9(_0x29b46f[_0x5607('0x12')](0x1f5,_0x5607('0x71')));}});},'VoiceQueuesChannels':function(_0x3aba9c){return new Promise(function(_0x4f1945,_0x1e0f58){var _0x325ef1=_[_0x5607('0x58')](_0x4d333d[_0x5607('0x72')]);_0x4f1945({'count':_0x325ef1[_0x5607('0x54')],'rows':_0x325ef1});});},'VoiceQueuesChannel':function(_0x5e746c){var _0x150dcd=this;return new Promise(function(_0xf440e3,_0x37308e){var _0x559011=schema(properties[_0x5607('0x73')])[_0x5607('0x2')](_0x5e746c);if(_0x559011[_0x5607('0x54')]>0x0){return _0x37308e(_0x150dcd['error'](0x1f4,_[_0x5607('0x5a')](_0x559011,_0x5607('0x1b'))[_0x5607('0x16')](',\x20')));}var _0x29d020=_['find'](_0x4d333d[_0x5607('0x72')],{'uniqueid':_0x5e746c[_0x5607('0x5c')]});if(_0x29d020){_0xf440e3(_0x29d020);}else{return _0x37308e(_0x150dcd[_0x5607('0x12')](0x1f5,_0x5607('0x71')));}});},'VoiceQueuesChannelHangup':function(_0x302113){var _0x2bd4e2=this;return new Promise(function(_0x251e26,_0x23448a){if(ami['isConnected']()==![]){return _0x23448a(_0x2bd4e2['error'](0x1f4,[config[_0x5607('0x13')]['ip'],config[_0x5607('0x13')][_0x5607('0x14')],_0x5607('0x15')][_0x5607('0x16')]('\x20')));}var _0x2f65c3=schema(properties['voicequeuechannelhangup'])[_0x5607('0x2')](_0x302113);if(_0x2f65c3[_0x5607('0x54')]>0x0){return _0x23448a(_0x2bd4e2[_0x5607('0x12')](0x1f4,_[_0x5607('0x5a')](_0x2f65c3,_0x5607('0x1b'))[_0x5607('0x16')](',\x20')));}var _0x40f1ab=_[_0x5607('0x55')](_0x4d333d['queueChannels'],{'uniqueid':_0x302113[_0x5607('0x5c')]});if(_0x40f1ab&&_0x40f1ab[_0x5607('0x5d')]){return ami['Action']({'action':'Hangup','channel':_0x40f1ab[_0x5607('0x5d')]})['then'](function(_0x1e4d49){_0x251e26({'code':0xc8,'message':[_0x302113['uniqueid'],_0x1e4d49['message'][_0x5607('0x62')]()][_0x5607('0x16')]('\x20')});})['catch'](function(_0x5a4ccd){_0x23448a(_0x2bd4e2[_0x5607('0x12')](0x1f5,[_0x302113['uniqueid'],_0x5a4ccd['message'][_0x5607('0x62')]()][_0x5607('0x16')]('\x20')));});}else{return _0x23448a(_0x2bd4e2[_0x5607('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x3acdd2){var _0x5757e4=this;return new Promise(function(_0x9ded24,_0x201920){if(ami[_0x5607('0x11')]()==![]){return _0x201920(_0x5757e4[_0x5607('0x12')](0x1f4,[config[_0x5607('0x13')]['ip'],config['asterisk'][_0x5607('0x14')],'ami\x20disconnected'][_0x5607('0x16')]('\x20')));}var _0x4a2384=schema(properties[_0x5607('0x74')])[_0x5607('0x2')](_0x3acdd2);if(_0x4a2384[_0x5607('0x54')]>0x0){return _0x201920(_0x5757e4[_0x5607('0x12')](0x1f4,_['map'](_0x4a2384,_0x5607('0x1b'))[_0x5607('0x16')](',\x20')));}var _0x34e1c3=_[_0x5607('0x55')](_0x4d333d[_0x5607('0x72')],{'uniqueid':_0x3acdd2[_0x5607('0x5c')]});if(_0x34e1c3&&_0x34e1c3[_0x5607('0x5d')]){return ami[_0x5607('0x19')]({'action':_0x5607('0x75'),'channel':_0x34e1c3[_0x5607('0x5d')],'exten':_0x3acdd2[_0x5607('0x76')],'context':_0x3acdd2[_0x5607('0x77')]||_0x34e1c3[_0x5607('0x77')],'priority':0x1})[_0x5607('0x1a')](function(_0x41eea5){_0x9ded24({'code':0xc8,'message':[_0x3acdd2[_0x5607('0x5c')],_0x41eea5[_0x5607('0x1b')][_0x5607('0x62')]()]['join']('\x20')});})[_0x5607('0x1c')](function(_0x4ebc44){_0x201920(_0x5757e4[_0x5607('0x12')](0x1f5,[_0x3acdd2['uniqueid'],_0x4ebc44[_0x5607('0x1b')][_0x5607('0x62')]()][_0x5607('0x16')]('\x20')));});}else{return _0x201920(_0x5757e4[_0x5607('0x12')](0x1f5,_0x5607('0x71')));}});},'Agents':function(_0xd775c6){return new Promise(function(_0x14c794,_0x394640){var _0x13a4ba=_['values'](_0x4d333d['agents']);_0x14c794({'count':_0x13a4ba[_0x5607('0x54')],'rows':_0x13a4ba});});},'Telephones':function(_0x43bae9){return new Promise(function(_0x1dd3d6,_0x4191df){var _0x40f7c8=_[_0x5607('0x58')](_0x4d333d[_0x5607('0x78')]);_0x1dd3d6({'count':_0x40f7c8['length'],'rows':_0x40f7c8});});},'Trunks':function(_0x5c9959){return new Promise(function(_0x4e0d74,_0x4eef90){var _0x4b2916=_[_0x5607('0x58')](_0x4d333d[_0x5607('0x79')]);_0x4e0d74({'count':_0x4b2916[_0x5607('0x54')],'rows':_0x4b2916});});},'OutboundChannels':function(_0x1488ec){return new Promise(function(_0x5f672c,_0x2e45a5){var _0x39e6e9=_[_0x5607('0x58')](_0x4d333d[_0x5607('0x7a')]);_0x5f672c({'count':_0x39e6e9[_0x5607('0x54')],'rows':_0x39e6e9});});},'Outbound':function(_0x2d8f0a){return new Promise(function(_0x4a638d,_0x2afbc6){_0x4a638d(_0x4d333d[_0x5607('0x2b')]);});},'Campaigns':function(_0x1f13f9){return new Promise(function(_0xd4f4de,_0x2dda7a){var _0x464259=_[_0x5607('0x58')](_0x4d333d[_0x5607('0x7b')]);_0xd4f4de({'count':_0x464259[_0x5607('0x54')],'rows':_0x464259});});},'VoiceQueuesPreview':function(_0x59ede7){var _0x5b04da=this;return new Promise(function(_0x5eb939,_0x429ec8){_0x1f4637[_0x5607('0x7c')](_0x59ede7['id'])[_0x5607('0x1a')](function(_0x22c57f){_0x5eb939({'code':0xc8,'message':_0x22c57f[_0x5607('0x1b')]});})[_0x5607('0x1c')](function(_0x321197){_0x429ec8(_0x5b04da['error'](0x1f4,_0x321197[_0x5607('0x1b')]));});});},'EventManager':function(_0x3c8b56){var _0xad467=this;return new Promise(function(_0x1e9af2,_0x265fa3){if(!_0x3c8b56[_0x5607('0x7d')]){return _0x265fa3(_0xad467[_0x5607('0x12')](0x1f4,_0x5607('0x7e')));}ami[_0x5607('0x7f')](_0x5607('0x80')+_0x3c8b56[_0x5607('0x7d')],_0x3c8b56['message']);_0x1e9af2({'code':0xc8,'message':_0x3c8b56});});},'FaxAccounts':function(_0x1f404b){return new Promise(function(_0x179dc2,_0x438219){var _0x442588=_[_0x5607('0x58')](_0x4d333d[_0x5607('0x81')]);_0x179dc2({'count':_0x442588['length'],'rows':_0x442588});});},'SendFax':function(_0x2c48f8){var _0x2ee540=this;return new Promise(function(_0x11129a,_0x107b2f){_0xabf691['send'](_0x2c48f8)[_0x5607('0x1a')](function(_0x2085cc){_0x11129a({'code':0xc8,'message':_0x2085cc['message']});})['catch'](function(_0x1fc3ca){_0x107b2f(_0x2ee540['error'](0x1f4,_0x1fc3ca[_0x5607('0x1b')]));});});},'CheckAfterSend':function(_0x4ab236){var _0x2bd9c2=this;return new Promise(function(_0x2f4c43,_0x5df978){_0xabf691['checkAfterSend'](_0x4ab236)[_0x5607('0x1a')](function(_0x3a38c0){_0x2f4c43({'code':0xc8,'message':_0x3a38c0[_0x5607('0x1b')]});})['catch'](function(_0x548ed1){_0x5df978(_0x2bd9c2[_0x5607('0x12')](0x1f4,_0x548ed1[_0x5607('0x1b')]));});});}};var _0x2a59ec=jayson[_0x5607('0x82')](_0x53f825)[_0x5607('0x83')]();_0x2a59ec['on']('error',function(_0x5789a0){return _0x5ab18d(_0x5789a0);});_0x2a59ec[_0x5607('0x8')](0x232a,_0x5607('0x84'),function(){console[_0x5607('0x85')](_0x5607('0x86'),0x232a);return _0x14b9f4('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file +var _0x32f4=['outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','omit','undefined','values','channels','map','uniqueid','channel','%s.%s','wav','MixMonitor','find','monitors','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','voicechannel','StopMixMonitor','destinationchannel','status','filename','stop','voicequeuechannel','voicequeuechannelhangup','Hangup','queueChannels','exten','context','trunks','outboundChannels','campaigns','event','Event\x20name\x20mandatory','custom:','faxAccounts','send','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','moment','../../../config/environment','../ami','listen','format','%s/%s','SIP','name','timers','agents','pause','QueuePause','error','asterisk','username','ami\x20disconnected','pick','keys','module','action','Action','then','message','catch','isConnected','join','command','voiceQueues','hasOwnProperty','strategy','available','pTalking','sumDuration','talking','type','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x32f4,0x154));var _0x432f=function(_0x103a26,_0x11d0cb){_0x103a26=_0x103a26-0x0;var _0x47c27e=_0x32f4[_0x103a26];return _0x47c27e;};'use strict';var _=require(_0x432f('0x0'));var util=require(_0x432f('0x1'));var jayson=require(_0x432f('0x2'));var schema=require(_0x432f('0x3'));var BPromise=require('bluebird');var moment=require(_0x432f('0x4'));var config=require(_0x432f('0x5'));var properties=require('../properties');var ami=require(_0x432f('0x6'));exports[_0x432f('0x7')]=function(_0x344a29,_0x355b02,_0x2f5f03){return new BPromise(function(_0x5d8cc0,_0x5b5f08){var _0x2f66fd={'QueuePause':function(_0x32b062){return new Promise(function(_0x4a5b56,_0x2a2ef6){var _0x5aaf1a=util[_0x432f('0x8')](_0x432f('0x9'),_0x432f('0xa'),_0x32b062[_0x432f('0xb')]);if(_0x344a29[_0x432f('0xc')]&&_0x344a29['timers'][_0x5aaf1a]&&_0x344a29[_0x432f('0xc')][_0x5aaf1a]['timer']){_0x344a29[_0x432f('0xc')][_0x5aaf1a]['updateAcw']();}if(_0x344a29[_0x432f('0xd')][_0x5aaf1a]){_0x344a29[_0x432f('0xd')][_0x5aaf1a]['updateStatusRealtime']({'statePause':_0x32b062[_0x432f('0xe')]?!![]:![]});}_0x4a5b56({'code':0xc8,'message':_0x432f('0xf')});});},'Reload':function(_0x52e40f){var _0x10b6fa=this;return new Promise(function(_0x26aa9a,_0x5dd518){if(ami['isConnected']()==![]){return _0x5dd518(_0x10b6fa[_0x432f('0x10')](0x1f4,[config[_0x432f('0x11')]['ip'],config[_0x432f('0x11')][_0x432f('0x12')],_0x432f('0x13')]['join']('\x20')));}_0x52e40f=_[_0x432f('0x14')](_0x52e40f,_[_0x432f('0x15')](properties[_0x432f('0x16')]));_0x52e40f[_0x432f('0x17')]='Reload';return ami[_0x432f('0x18')](_0x52e40f)[_0x432f('0x19')](function(_0x42c2d2){_0x26aa9a({'code':0xc8,'message':_0x42c2d2[_0x432f('0x1a')]});})[_0x432f('0x1b')](function(_0x129582){_0x5dd518(_0x10b6fa['error'](0x1f5,_0x129582[_0x432f('0x1a')]));});});},'Command':function(_0x4ddd21){var _0x3d545d=this;return new Promise(function(_0x2bf251,_0x1799c4){if(ami[_0x432f('0x1c')]()==![]){return _0x1799c4(_0x3d545d[_0x432f('0x10')](0x1f4,[config[_0x432f('0x11')]['ip'],config[_0x432f('0x11')][_0x432f('0x12')],_0x432f('0x13')][_0x432f('0x1d')]('\x20')));}_0x4ddd21=_[_0x432f('0x14')](_0x4ddd21,_0x432f('0x1e'));_0x4ddd21['action']='Command';return ami[_0x432f('0x18')](_0x4ddd21)['then'](function(_0x28968e){_0x2bf251({'code':0xc8,'message':_0x28968e['content']});})[_0x432f('0x1b')](function(_0x175d1b){_0x1799c4(_0x3d545d[_0x432f('0x10')](0x1f5,_0x175d1b[_0x432f('0x1a')]));});});},'VoiceQueues':function(_0x2f84a7){return new Promise(function(_0x1e347a,_0x59f352){var _0x252b3b=[];for(var _0x33edec in _0x344a29['voiceQueues']){if(_0x344a29[_0x432f('0x1f')][_0x432f('0x20')](_0x33edec)){var _0x2bcbb4=_0x344a29[_0x432f('0x1f')][_0x33edec];var _0x44839={'id':_0x2bcbb4['id'],'name':_0x2bcbb4[_0x432f('0xb')],'strategy':_0x2bcbb4[_0x432f('0x21')],'answered':_0x2bcbb4['answered'],'available':_0x2bcbb4[_0x432f('0x22')],'loggedIn':_0x2bcbb4['loggedIn'],'pTalking':_0x2bcbb4[_0x432f('0x23')],'sumBillable':_0x2bcbb4['sumBillable'],'sumDuration':_0x2bcbb4[_0x432f('0x24')],'sumHoldTime':_0x2bcbb4['sumHoldTime']||0x0,'talking':_0x2bcbb4[_0x432f('0x25')],'total':_0x2bcbb4['total'],'type':_0x2bcbb4[_0x432f('0x26')],'unmanaged':_0x2bcbb4[_0x432f('0x27')],'abandoned':_0x2bcbb4[_0x432f('0x28')],'waiting':_0x2bcbb4['waiting'],'loggedInDb':_0x2bcbb4[_0x432f('0x29')]};if(_0x2bcbb4[_0x432f('0x26')]==='outbound'){_0x44839['dialActive']=_0x2bcbb4[_0x432f('0x2a')];_0x44839[_0x432f('0x2b')]=_0x2bcbb4[_0x432f('0x2b')];_0x44839[_0x432f('0x2c')]=_0x2bcbb4[_0x432f('0x2c')];_0x44839[_0x432f('0x2d')]=_0x2bcbb4['dialOriginateCallerIdNumber'];_0x44839['dialOriginateTimeout']=_0x2bcbb4[_0x432f('0x2e')];_0x44839[_0x432f('0x2f')]=_0x2bcbb4[_0x432f('0x2f')];_0x44839['temp']=_0x2bcbb4[_0x432f('0x30')];_0x44839[_0x432f('0x31')]=_0x2bcbb4[_0x432f('0x31')];_0x44839[_0x432f('0x32')]=_0x2bcbb4[_0x432f('0x32')];_0x44839[_0x432f('0x33')]=_0x2bcbb4[_0x432f('0x33')];_0x44839[_0x432f('0x34')]=_0x2bcbb4['outboundBusyCallsDay'];_0x44839['outboundCongestionCallsDay']=_0x2bcbb4[_0x432f('0x35')];_0x44839[_0x432f('0x36')]=_0x2bcbb4['outboundDropCallsDayACS'];_0x44839['outboundDropCallsDayCallersExit']=_0x2bcbb4['outboundDropCallsDayCallersExit'];_0x44839[_0x432f('0x37')]=_0x2bcbb4[_0x432f('0x37')];_0x44839['outboundNoAnswerCallsDay']=_0x2bcbb4[_0x432f('0x38')];_0x44839[_0x432f('0x39')]=_0x2bcbb4[_0x432f('0x39')];_0x44839['outboundOriginateFailureCallsDay']=_0x2bcbb4[_0x432f('0x3a')];_0x44839[_0x432f('0x3b')]=_0x2bcbb4['outboundReCallsDay'];_0x44839[_0x432f('0x3c')]=_0x2bcbb4[_0x432f('0x3c')];_0x44839['outboundUnknownCallsDay']=_0x2bcbb4[_0x432f('0x3d')];_0x44839[_0x432f('0x3e')]=_0x2bcbb4[_0x432f('0x3e')];_0x44839[_0x432f('0x3f')]=_0x2bcbb4[_0x432f('0x3f')];_0x44839[_0x432f('0x40')]=_0x2bcbb4[_0x432f('0x40')];_0x44839[_0x432f('0x41')]=_0x2bcbb4[_0x432f('0x41')];_0x44839[_0x432f('0x42')]=_0x2bcbb4[_0x432f('0x42')];_0x44839['predictiveIntervalErlangCalls']=_0x2bcbb4[_0x432f('0x43')];_0x44839['predictiveIntervalErlangCallsDroppedCalls']=_0x2bcbb4[_0x432f('0x44')];_0x44839[_0x432f('0x45')]=_0x2bcbb4['predictiveIntervalHitRate'];_0x44839[_0x432f('0x46')]=_0x2bcbb4['predictiveIntervalMultiplicativeFactor'];_0x44839[_0x432f('0x47')]=_0x2bcbb4[_0x432f('0x47')];_0x44839['predictiveIntervalAvailable']=_0x2bcbb4['predictiveIntervalAvailable'];_0x44839[_0x432f('0x48')]=_0x2bcbb4[_0x432f('0x48')];_0x44839[_0x432f('0x1a')]=_0x2bcbb4[_0x432f('0x1a')];_0x44839[_0x432f('0x49')]=_0x2bcbb4['originated'];_0x44839['erlangCalls']=_0x2bcbb4['erlangCalls'];_0x44839[_0x432f('0x4a')]=_0x2bcbb4[_0x432f('0x4a')];_0x44839['erlangAbandonmentRate']=_0x2bcbb4[_0x432f('0x4b')];_0x44839[_0x432f('0x4c')]=_0x2bcbb4[_0x432f('0x4c')];_0x44839[_0x432f('0x4d')]=_0x2bcbb4[_0x432f('0x4d')];_0x44839[_0x432f('0x4e')]=_0x2bcbb4[_0x432f('0x4e')];}if(_0x2bcbb4[_0x432f('0x4f')]){_0x44839[_0x432f('0x4f')]={'id':_0x2bcbb4['Trunk']['id'],'name':_0x2bcbb4[_0x432f('0x4f')][_0x432f('0xb')],'active':_0x2bcbb4['Trunk'][_0x432f('0x50')],'callerid':_0x2bcbb4[_0x432f('0x4f')][_0x432f('0x51')]};}if(_0x2bcbb4[_0x432f('0x52')]){_0x44839[_0x432f('0x52')]={'id':_0x2bcbb4[_0x432f('0x52')]['id'],'name':_0x2bcbb4[_0x432f('0x52')][_0x432f('0xb')]};}_0x252b3b[_0x432f('0x53')](_0x44839);}}_0x1e347a({'count':_0x252b3b[_0x432f('0x54')],'rows':_0x252b3b});});},'UpdateVoiceQueue':function(_0x12247f){return new Promise(function(_0x2b456c,_0x2c914b){var _0x77938b=_['find'](_0x344a29['voiceQueues'],{'id':parseInt(_0x12247f['id'])});var _0x31d3ad=_[_0x432f('0x55')](_0x12247f,['id']);if(_0x77938b){for(var _0xcbdcc0 in _0x31d3ad){if(typeof _0x31d3ad[_0xcbdcc0]!==_0x432f('0x56')&&typeof _0x77938b[_0xcbdcc0]!==_0x432f('0x56')){_0x77938b[_0xcbdcc0]=_0x31d3ad[_0xcbdcc0];}}_0x2b456c(_0x77938b);}else{_0x2c914b();}});},'VoiceChannels':function(_0x49a17c){return new Promise(function(_0x366230,_0x23ee80){var _0x46c5ee=_[_0x432f('0x57')](_0x344a29[_0x432f('0x58')]);_0x366230({'count':_0x46c5ee[_0x432f('0x54')],'rows':_0x46c5ee});});},'VoiceChannelMixMonitor':function(_0x26f31e){var _0x5a91ca=this;return new Promise(function(_0x3abafe,_0x2dd9c2){if(ami[_0x432f('0x1c')]()==![]){return _0x2dd9c2(_0x5a91ca['error'](0x1f4,[config[_0x432f('0x11')]['ip'],config[_0x432f('0x11')]['username'],'ami\x20disconnected'][_0x432f('0x1d')]('\x20')));}var _0x24f244=schema(properties['voicechannel'])['validate'](_0x26f31e);if(_0x24f244[_0x432f('0x54')]>0x0){return _0x2dd9c2(_0x5a91ca['error'](0x1f4,_[_0x432f('0x59')](_0x24f244,_0x432f('0x1a'))['join'](',\x20')));}var _0x12f2f7=_['find'](_0x344a29[_0x432f('0x58')],{'uniqueid':_0x26f31e[_0x432f('0x5a')]});if(_0x12f2f7&&_0x12f2f7[_0x432f('0x5b')]){var _0xe43f31=util[_0x432f('0x8')](_0x432f('0x5c'),_0x26f31e['filename']||_0x26f31e[_0x432f('0x5a')],_0x26f31e['format']||_0x432f('0x5d'));return ami[_0x432f('0x18')]({'action':_0x432f('0x5e'),'channel':_0x12f2f7[_0x432f('0x5b')],'file':_0xe43f31,'options':'ai(mixmonitorid)'})[_0x432f('0x19')](function(_0x476c09){var _0x12e177=_[_0x432f('0x5f')](_0x12f2f7[_0x432f('0x60')],{'filename':_0x432f('0x61')+_0xe43f31[_0x432f('0x62')]()});if(_['isNil'](_0x12e177)){_0x12f2f7['monitors'][_0x432f('0x53')]({'filename':_0x432f('0x61')+_0xe43f31[_0x432f('0x62')](),'createdAt':moment()[_0x432f('0x8')](_0x432f('0x63')),'mixmonitorid':_0x476c09[_0x432f('0x64')],'status':'rec'});}else{_0x12e177[_0x432f('0x64')]=_0x476c09['mixmonitorid'];_0x12e177['status']=_0x432f('0x65');}_0x3abafe({'code':0xc8,'message':[_0x26f31e[_0x432f('0x5a')],_0x432f('0x66'),_0x476c09[_0x432f('0x64')]][_0x432f('0x1d')]('\x20'),'mixmonitorid':_0x476c09[_0x432f('0x64')]});})['catch'](function(_0x46c36d){_0x2dd9c2(_0x5a91ca[_0x432f('0x10')](0x1f5,[_0x26f31e['uniqueid'],_0x46c36d[_0x432f('0x1a')][_0x432f('0x62')]()]['join']('\x20')));});}else{return _0x2dd9c2(_0x5a91ca[_0x432f('0x10')](0x1f5,_0x432f('0x67')));}});},'VoiceChannelStopMixMonitor':function(_0x348331){var _0x387999=this;return new Promise(function(_0x3d6382,_0xe729fc){if(ami[_0x432f('0x1c')]()==![]){return _0xe729fc(_0x387999[_0x432f('0x10')](0x1f4,[config[_0x432f('0x11')]['ip'],config[_0x432f('0x11')][_0x432f('0x12')],_0x432f('0x13')][_0x432f('0x1d')]('\x20')));}var _0x43577d=schema(properties[_0x432f('0x68')])[_0x432f('0x3')](_0x348331);if(_0x43577d['length']>0x0){return _0xe729fc(_0x387999['error'](0x1f4,_[_0x432f('0x59')](_0x43577d,_0x432f('0x1a'))[_0x432f('0x1d')](',\x20')));}var _0x5de9ae=_[_0x432f('0x5f')](_0x344a29[_0x432f('0x58')],{'uniqueid':_0x348331[_0x432f('0x5a')]});if(_0x5de9ae){return BPromise['resolve']()['then'](function(){if(_0x5de9ae[_0x432f('0x5b')]){return ami[_0x432f('0x18')]({'action':'StopMixMonitor','channel':_0x5de9ae[_0x432f('0x5b')],'mixmonitorid':_0x348331['mixmonitorid']})[_0x432f('0x1b')](function(_0x17d1f3){});}})[_0x432f('0x19')](function(){if(_0x5de9ae['destinationchannel']){return ami[_0x432f('0x18')]({'action':_0x432f('0x69'),'channel':_0x5de9ae[_0x432f('0x6a')],'mixmonitorid':_0x348331[_0x432f('0x64')]})['catch'](function(_0x422468){});}})[_0x432f('0x19')](function(_0x52f2ae){var _0x44fbd2=_['find'](_0x5de9ae['monitors'],{'mixmonitorid':_0x348331['mixmonitorid']});if(_0x44fbd2){_0x44fbd2[_0x432f('0x6b')]='stop';}})[_0x432f('0x19')](function(){var _0x32dfe1=util['format']('%s.%s',_0x348331[_0x432f('0x6c')]||_0x348331[_0x432f('0x5a')],_0x348331[_0x432f('0x8')]||_0x432f('0x5d'));var _0x5174cb=_[_0x432f('0x5f')](_0x5de9ae[_0x432f('0x60')],{'filename':'/var/spool/asterisk/monitor/'+_0x32dfe1[_0x432f('0x62')]()});if(_0x5174cb){_0x5174cb['status']=_0x432f('0x6d');}})[_0x432f('0x19')](function(){_0x3d6382({'code':0xc8,'message':[_0x348331[_0x432f('0x5a')],'StopMixMonitor\x20Success'][_0x432f('0x1d')]('\x20')});})[_0x432f('0x1b')](function(_0x149119){_0xe729fc(_0x387999[_0x432f('0x10')](0x1f5,[_0x348331['uniqueid'],_0x149119[_0x432f('0x1a')]['toLowerCase']()][_0x432f('0x1d')]('\x20')));});}else{return _0xe729fc(_0x387999[_0x432f('0x10')](0x1f5,_0x432f('0x67')));}});},'VoiceQueuesChannels':function(_0x2038fd){return new Promise(function(_0xef62ee,_0x891328){var _0x354e52=_[_0x432f('0x57')](_0x344a29['queueChannels']);_0xef62ee({'count':_0x354e52[_0x432f('0x54')],'rows':_0x354e52});});},'VoiceQueuesChannel':function(_0x2e0e99){var _0x3be062=this;return new Promise(function(_0x1c96ab,_0x5c06af){var _0x38d006=schema(properties[_0x432f('0x6e')])['validate'](_0x2e0e99);if(_0x38d006[_0x432f('0x54')]>0x0){return _0x5c06af(_0x3be062[_0x432f('0x10')](0x1f4,_[_0x432f('0x59')](_0x38d006,'message')[_0x432f('0x1d')](',\x20')));}var _0x197e77=_[_0x432f('0x5f')](_0x344a29['queueChannels'],{'uniqueid':_0x2e0e99['uniqueid']});if(_0x197e77){_0x1c96ab(_0x197e77);}else{return _0x5c06af(_0x3be062[_0x432f('0x10')](0x1f5,_0x432f('0x67')));}});},'VoiceQueuesChannelHangup':function(_0x439509){var _0x39930d=this;return new Promise(function(_0x5593aa,_0x5ba58b){if(ami[_0x432f('0x1c')]()==![]){return _0x5ba58b(_0x39930d['error'](0x1f4,[config[_0x432f('0x11')]['ip'],config[_0x432f('0x11')][_0x432f('0x12')],_0x432f('0x13')][_0x432f('0x1d')]('\x20')));}var _0x28e378=schema(properties[_0x432f('0x6f')])[_0x432f('0x3')](_0x439509);if(_0x28e378['length']>0x0){return _0x5ba58b(_0x39930d[_0x432f('0x10')](0x1f4,_[_0x432f('0x59')](_0x28e378,'message')[_0x432f('0x1d')](',\x20')));}var _0x8a4d01=_['find'](_0x344a29['queueChannels'],{'uniqueid':_0x439509['uniqueid']});if(_0x8a4d01&&_0x8a4d01[_0x432f('0x5b')]){return ami[_0x432f('0x18')]({'action':_0x432f('0x70'),'channel':_0x8a4d01[_0x432f('0x5b')]})[_0x432f('0x19')](function(_0x414a3d){_0x5593aa({'code':0xc8,'message':[_0x439509['uniqueid'],_0x414a3d[_0x432f('0x1a')][_0x432f('0x62')]()][_0x432f('0x1d')]('\x20')});})[_0x432f('0x1b')](function(_0x2137bd){_0x5ba58b(_0x39930d[_0x432f('0x10')](0x1f5,[_0x439509[_0x432f('0x5a')],_0x2137bd[_0x432f('0x1a')][_0x432f('0x62')]()]['join']('\x20')));});}else{return _0x5ba58b(_0x39930d[_0x432f('0x10')](0x1f5,_0x432f('0x67')));}});},'VoiceQueuesChannelRedirect':function(_0x11dec){var _0x438ed8=this;return new Promise(function(_0x43edc6,_0x465e43){if(ami[_0x432f('0x1c')]()==![]){return _0x465e43(_0x438ed8[_0x432f('0x10')](0x1f4,[config[_0x432f('0x11')]['ip'],config[_0x432f('0x11')][_0x432f('0x12')],'ami\x20disconnected'][_0x432f('0x1d')]('\x20')));}var _0x5ac391=schema(properties['voicequeuechannelredirect'])[_0x432f('0x3')](_0x11dec);if(_0x5ac391[_0x432f('0x54')]>0x0){return _0x465e43(_0x438ed8[_0x432f('0x10')](0x1f4,_['map'](_0x5ac391,'message')[_0x432f('0x1d')](',\x20')));}var _0x398b64=_[_0x432f('0x5f')](_0x344a29[_0x432f('0x71')],{'uniqueid':_0x11dec[_0x432f('0x5a')]});if(_0x398b64&&_0x398b64[_0x432f('0x5b')]){return ami[_0x432f('0x18')]({'action':'Redirect','channel':_0x398b64[_0x432f('0x5b')],'exten':_0x11dec[_0x432f('0x72')],'context':_0x11dec[_0x432f('0x73')]||_0x398b64['context'],'priority':0x1})[_0x432f('0x19')](function(_0x198bd6){_0x43edc6({'code':0xc8,'message':[_0x11dec['uniqueid'],_0x198bd6[_0x432f('0x1a')]['toLowerCase']()][_0x432f('0x1d')]('\x20')});})[_0x432f('0x1b')](function(_0x2c7794){_0x465e43(_0x438ed8[_0x432f('0x10')](0x1f5,[_0x11dec[_0x432f('0x5a')],_0x2c7794[_0x432f('0x1a')][_0x432f('0x62')]()][_0x432f('0x1d')]('\x20')));});}else{return _0x465e43(_0x438ed8['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x525560){return new Promise(function(_0x31d0f0,_0x3b53e1){var _0x5eadfe=_[_0x432f('0x57')](_0x344a29[_0x432f('0xd')]);_0x31d0f0({'count':_0x5eadfe[_0x432f('0x54')],'rows':_0x5eadfe});});},'Telephones':function(_0x778d1e){return new Promise(function(_0x54dd28,_0x243306){var _0x2c83a9=_[_0x432f('0x57')](_0x344a29['telephones']);_0x54dd28({'count':_0x2c83a9[_0x432f('0x54')],'rows':_0x2c83a9});});},'Trunks':function(_0x3a0b57){return new Promise(function(_0xc6c937,_0xb88fae){var _0x43b3d3=_[_0x432f('0x57')](_0x344a29[_0x432f('0x74')]);_0xc6c937({'count':_0x43b3d3[_0x432f('0x54')],'rows':_0x43b3d3});});},'OutboundChannels':function(_0x3463c1){return new Promise(function(_0x24cb70,_0x16b357){var _0x300eb9=_['values'](_0x344a29[_0x432f('0x75')]);_0x24cb70({'count':_0x300eb9['length'],'rows':_0x300eb9});});},'Outbound':function(_0x36618f){return new Promise(function(_0x23dfbf,_0x2d796e){_0x23dfbf(_0x344a29['outbound']);});},'Campaigns':function(_0x16ea61){return new Promise(function(_0x1150ee,_0x1da920){var _0x1302d7=_[_0x432f('0x57')](_0x344a29[_0x432f('0x76')]);_0x1150ee({'count':_0x1302d7[_0x432f('0x54')],'rows':_0x1302d7});});},'VoiceQueuesPreview':function(_0x1b9c1a){var _0x307ccc=this;return new Promise(function(_0x51023c,_0x4f196d){_0x355b02['run'](_0x1b9c1a['id'])[_0x432f('0x19')](function(_0x3bc812){_0x51023c({'code':0xc8,'message':_0x3bc812[_0x432f('0x1a')]});})[_0x432f('0x1b')](function(_0x1b678b){_0x4f196d(_0x307ccc[_0x432f('0x10')](0x1f4,_0x1b678b[_0x432f('0x1a')]));});});},'EventManager':function(_0x37c723){var _0x1496c0=this;return new Promise(function(_0x20ea13,_0x56730d){if(!_0x37c723[_0x432f('0x77')]){return _0x56730d(_0x1496c0['error'](0x1f4,_0x432f('0x78')));}ami['emit'](_0x432f('0x79')+_0x37c723[_0x432f('0x77')],_0x37c723[_0x432f('0x1a')]);_0x20ea13({'code':0xc8,'message':_0x37c723});});},'FaxAccounts':function(_0x16bb82){return new Promise(function(_0x21dd08,_0x294444){var _0x47324f=_[_0x432f('0x57')](_0x344a29[_0x432f('0x7a')]);_0x21dd08({'count':_0x47324f[_0x432f('0x54')],'rows':_0x47324f});});},'SendFax':function(_0x38c7a9){var _0x2e00bd=this;return new Promise(function(_0x4bb00d,_0x1f62bc){_0x2f5f03[_0x432f('0x7b')](_0x38c7a9)['then'](function(_0x2357ac){_0x4bb00d({'code':0xc8,'message':_0x2357ac[_0x432f('0x1a')]});})['catch'](function(_0x7ae055){_0x1f62bc(_0x2e00bd[_0x432f('0x10')](0x1f4,_0x7ae055['message']));});});},'CheckAfterSend':function(_0x2dd4b5){var _0x52ba30=this;return new Promise(function(_0x52aa1c,_0x3dd96e){_0x2f5f03['checkAfterSend'](_0x2dd4b5)[_0x432f('0x19')](function(_0xaaf183){_0x52aa1c({'code':0xc8,'message':_0xaaf183['message']});})['catch'](function(_0x4c0a7c){_0x3dd96e(_0x52ba30[_0x432f('0x10')](0x1f4,_0x4c0a7c[_0x432f('0x1a')]));});});}};var _0x28187a=jayson[_0x432f('0x7c')](_0x2f66fd)[_0x432f('0x7d')]();_0x28187a['on'](_0x432f('0x10'),function(_0x532b0d){return _0x5b5f08(_0x532b0d);});_0x28187a[_0x432f('0x7')](0x232a,_0x432f('0x7e'),function(){console[_0x432f('0x7f')](_0x432f('0x80'),0x232a);return _0x5d8cc0(_0x432f('0x81')+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 7aefb37..b568a19 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 _0x55e0=['localhost','info','[CM][%s][%s]','emit','exec','data1','data2','data5','xmd-contactid','ListId','data3','split','$or','map','routeId','calleridnum','firstName','lastName','mobile','fax','createdAt','scheduledAt','updatedAt','union','resolve','getContacts','then','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','calleridname','Unknown','destcalleridname','','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','format','user:%s','name','action','toLowerCase','merge','lodash','bluebird','ioredis','util','trigger','../../rpc/cmContact','redis','defaults'];(function(_0x5685b0,_0x2311b7){var _0x4612df=function(_0x3ddba3){while(--_0x3ddba3){_0x5685b0['push'](_0x5685b0['shift']());}};_0x4612df(++_0x2311b7);}(_0x55e0,0xdc));var _0x055e=function(_0x35a260,_0x2ddf05){_0x35a260=_0x35a260-0x0;var _0xabb77b=_0x55e0[_0x35a260];return _0xabb77b;};'use strict';var _=require(_0x055e('0x0'));var BPromise=require(_0x055e('0x1'));var Redis=require(_0x055e('0x2'));var util=require(_0x055e('0x3'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x055e('0x4'));var cmContactRpc=require(_0x055e('0x5'));config[_0x055e('0x6')]=_[_0x055e('0x7')](config[_0x055e('0x6')],{'host':_0x055e('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x4384ff,_0x4a442e,_0x8e7824,_0x3c4cf,_0x376618){logger[_0x055e('0x9')](_0x055e('0xa'),_0x4384ff,_0x4a442e['id'],_0x8e7824,_0x3c4cf,JSON['stringify'](_0x376618));io['to'](_0x8e7824)[_0x055e('0xb')](_0x3c4cf,_0x376618);}exports[_0x055e('0xc')]=function(_0xb816c,_0xa0d384,_0x238068,_0x5237d9){var _0x56c78a,_0x187cce;var _0x51c524={};var _0x3c44b2=Number(_0x238068[_0x055e('0xd')]);var _0x72d424=_0x238068[_0x055e('0xe')]?Boolean(Number(_0x238068[_0x055e('0xe')])):![];var _0x31c649;var _0x236a2b=![];if(!_['isNil'](_0x238068[_0x055e('0xf')])){if(_0x238068[_0x055e('0xf')]=='1')_0x236a2b=!![];}if(!_0x236a2b){if(_0x5237d9[_0x055e('0x10')]){_0x51c524['id']=_0x5237d9[_0x055e('0x10')];}}if(!_0x51c524['id']){_0x51c524[_0x055e('0x11')]=_0x3c44b2;_0x31c649=_0x238068['data3']&&_0x238068[_0x055e('0x12')]!=='0'?_0x238068[_0x055e('0x12')][_0x055e('0x13')](','):['phone'];_0x51c524[_0x055e('0x14')]=_[_0x055e('0x15')](_0x31c649,function(_0xb4e6ca){var _0x2bad86={};_0x2bad86[_0xb4e6ca]=_0x5237d9[_0x055e('0x16')]?_0x5237d9['destcalleridnum']:_0x5237d9[_0x055e('0x17')];return _0x2bad86;});}var _0x2cf3de=['id',_0x055e('0x18'),_0x055e('0x19'),'phone',_0x055e('0x1a'),_0x055e('0x1b'),'ListId',_0x055e('0x1c'),_0x055e('0x1d'),_0x055e('0x1e')];var _0x124d86=_[_0x055e('0x1f')](_0x2cf3de,_0x31c649);BPromise[_0x055e('0x20')]()['then'](cmContactRpc[_0x055e('0x21')]({'attributes':_0x124d86,'where':_0x51c524}))[_0x055e('0x22')](function(_0x211594){_0x187cce=_0x211594;if(!_['isEmpty'](_0x187cce)){if(_0x187cce[_0x055e('0x23')]===0x1){_0x56c78a=_0x187cce[0x0];logger[_0x055e('0x9')](_0x055e('0x24'),_0x5237d9[_0x055e('0x25')],_0xa0d384['id'],_0x56c78a['id']);}else{logger['info'](_0x055e('0x26'),_0x5237d9['uniqueid'],_0xa0d384['id'],_[_0x055e('0x15')](_0x187cce,'id')[_0x055e('0x27')](','));}return;}else{logger[_0x055e('0x9')](_0x055e('0x28'),_0x5237d9[_0x055e('0x25')],_0xa0d384['id']);var _0x4c653c={'ListId':_0x3c44b2};var _0x58caf9=_0x238068[_0x055e('0x29')]&&_0x238068[_0x055e('0x29')]!=='0'?_0x238068[_0x055e('0x29')]:'phone';if(_0x72d424){logger[_0x055e('0x9')](_0x055e('0x2a'),_0x5237d9[_0x055e('0x25')],_0xa0d384['id']);_0x4c653c[_0x58caf9]=_[_0x055e('0x2b')](_0x5237d9['routeId'])?_0x5237d9[_0x055e('0x17')]:_0x5237d9['destcalleridnum'];if(_[_0x055e('0x2b')](_0x5237d9[_0x055e('0x16')])){_0x4c653c[_0x055e('0x18')]=_0x5237d9[_0x055e('0x2c')]&&_0x5237d9[_0x055e('0x2c')]!==''?_0x5237d9[_0x055e('0x2c')]:_0x055e('0x2d');}else{_0x4c653c[_0x055e('0x18')]=_0x5237d9[_0x055e('0x2e')]&&_0x5237d9[_0x055e('0x2e')]!==_0x055e('0x2f')?_0x5237d9[_0x055e('0x2e')]:_0x055e('0x2d');}return BPromise['resolve']()[_0x055e('0x22')](cmContactRpc[_0x055e('0x30')](_0x4c653c))['then'](function(_0xd9298d){_0x56c78a=_0xd9298d;_0x187cce[_0x055e('0x31')](_0xd9298d);if(_0x56c78a){logger[_0x055e('0x9')](_0x055e('0x32'),_0x5237d9[_0x055e('0x25')],_0xa0d384['id'],_0x56c78a['id']);}return;});}else{logger[_0x055e('0x9')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x5237d9['uniqueid'],_0xa0d384['id']);_0x4c653c[_0x58caf9]=_[_0x055e('0x2b')](_0x5237d9['routeId'])?_0x5237d9['calleridnum']:_0x5237d9['destcalleridnum'];if(_[_0x055e('0x2b')](_0x5237d9[_0x055e('0x16')])){_0x4c653c[_0x055e('0x18')]=_0x5237d9[_0x055e('0x2c')]&&_0x5237d9[_0x055e('0x2c')]!==_0x055e('0x2f')?_0x5237d9[_0x055e('0x2c')]:_0x055e('0x2d');}else{_0x4c653c[_0x055e('0x18')]=_0x5237d9[_0x055e('0x2e')]&&_0x5237d9[_0x055e('0x2e')]!==_0x055e('0x2f')?_0x5237d9['destcalleridname']:'Unknown';}_0x56c78a=_0x4c653c;_0x187cce[_0x055e('0x31')](_0x4c653c);return;}}})[_0x055e('0x22')](function(){if(_0xb816c){emit(_0x5237d9[_0x055e('0x25')],_0xa0d384,util[_0x055e('0x33')](_0x055e('0x34'),_0xb816c[_0x055e('0x35')]),util[_0x055e('0x33')]('trigger:%s',_0x238068[_0x055e('0x36')][_0x055e('0x37')]()),{'evt':_[_0x055e('0x38')](_0x5237d9,{'autoCreate':_0x72d424}),'contact':_0x56c78a===undefined?{}:_0x56c78a,'contacts':_0x187cce[_0x055e('0x23')]===0x0?undefined:_0x187cce});}});}; \ No newline at end of file +var _0x3e74=['scheduledAt','updatedAt','union','resolve','getContacts','then','isEmpty','length','uniqueid','data4','[CM][%s][%s]\x20Autocreate\x20enabled','routeId','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','merge','lodash','ioredis','util','../../../../config/environment','../../rpc/cmContact','defaults','redis','localhost','socket.io-emitter','info','stringify','data1','data2','isNil','data5','ListId','data3','$or','map','destcalleridnum','calleridnum','firstName','lastName','phone','mobile','fax','createdAt'];(function(_0x246619,_0x4fd68f){var _0x1d6117=function(_0x12706c){while(--_0x12706c){_0x246619['push'](_0x246619['shift']());}};_0x1d6117(++_0x4fd68f);}(_0x3e74,0x175));var _0x43e7=function(_0x28608f,_0x41fc21){_0x28608f=_0x28608f-0x0;var _0x5dbe09=_0x3e74[_0x28608f];return _0x5dbe09;};'use strict';var _=require(_0x43e7('0x0'));var BPromise=require('bluebird');var Redis=require(_0x43e7('0x1'));var util=require(_0x43e7('0x2'));var config=require(_0x43e7('0x3'));var logger=require('../../../../config/logger')('trigger');var cmContactRpc=require(_0x43e7('0x4'));config['redis']=_[_0x43e7('0x5')](config[_0x43e7('0x6')],{'host':_0x43e7('0x7'),'port':0x18eb});var io=require(_0x43e7('0x8'))(new Redis(config[_0x43e7('0x6')]));function emit(_0x503698,_0x45a0d1,_0x3491d6,_0x2ede2d,_0x8528fc){logger[_0x43e7('0x9')]('[CM][%s][%s]',_0x503698,_0x45a0d1['id'],_0x3491d6,_0x2ede2d,JSON[_0x43e7('0xa')](_0x8528fc));io['to'](_0x3491d6)['emit'](_0x2ede2d,_0x8528fc);}exports['exec']=function(_0x39c8bd,_0x4139c9,_0x5c34f4,_0x2803d9){var _0x513707,_0xf7c520;var _0x37302c={};var _0x4ebc8e=Number(_0x5c34f4[_0x43e7('0xb')]);var _0xc960ea=_0x5c34f4[_0x43e7('0xc')]?Boolean(Number(_0x5c34f4[_0x43e7('0xc')])):![];var _0x4e008c;var _0x583d85=![];if(!_[_0x43e7('0xd')](_0x5c34f4[_0x43e7('0xe')])){if(_0x5c34f4[_0x43e7('0xe')]=='1')_0x583d85=!![];}if(!_0x583d85){if(_0x2803d9['xmd-contactid']){_0x37302c['id']=_0x2803d9['xmd-contactid'];}}if(!_0x37302c['id']){_0x37302c[_0x43e7('0xf')]=_0x4ebc8e;_0x4e008c=_0x5c34f4[_0x43e7('0x10')]&&_0x5c34f4[_0x43e7('0x10')]!=='0'?_0x5c34f4[_0x43e7('0x10')]['split'](','):['phone'];_0x37302c[_0x43e7('0x11')]=_[_0x43e7('0x12')](_0x4e008c,function(_0x273a32){var _0x5d346f={};_0x5d346f[_0x273a32]=_0x2803d9['routeId']?_0x2803d9[_0x43e7('0x13')]:_0x2803d9[_0x43e7('0x14')];return _0x5d346f;});}var _0x9037d3=['id',_0x43e7('0x15'),_0x43e7('0x16'),_0x43e7('0x17'),_0x43e7('0x18'),_0x43e7('0x19'),_0x43e7('0xf'),_0x43e7('0x1a'),_0x43e7('0x1b'),_0x43e7('0x1c')];var _0x4b5d64=_[_0x43e7('0x1d')](_0x9037d3,_0x4e008c);BPromise[_0x43e7('0x1e')]()['then'](cmContactRpc[_0x43e7('0x1f')]({'attributes':_0x4b5d64,'where':_0x37302c}))[_0x43e7('0x20')](function(_0x3945bb){_0xf7c520=_0x3945bb;if(!_[_0x43e7('0x21')](_0xf7c520)){if(_0xf7c520[_0x43e7('0x22')]===0x1){_0x513707=_0xf7c520[0x0];logger[_0x43e7('0x9')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x2803d9[_0x43e7('0x23')],_0x4139c9['id'],_0x513707['id']);}else{logger['info']('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x2803d9[_0x43e7('0x23')],_0x4139c9['id'],_[_0x43e7('0x12')](_0xf7c520,'id')['join'](','));}return;}else{logger[_0x43e7('0x9')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x2803d9[_0x43e7('0x23')],_0x4139c9['id']);var _0x5c5e67={'ListId':_0x4ebc8e};var _0x1af208=_0x5c34f4[_0x43e7('0x24')]&&_0x5c34f4[_0x43e7('0x24')]!=='0'?_0x5c34f4[_0x43e7('0x24')]:'phone';if(_0xc960ea){logger['info'](_0x43e7('0x25'),_0x2803d9['uniqueid'],_0x4139c9['id']);_0x5c5e67[_0x1af208]=_[_0x43e7('0xd')](_0x2803d9[_0x43e7('0x26')])?_0x2803d9[_0x43e7('0x14')]:_0x2803d9[_0x43e7('0x13')];if(_['isNil'](_0x2803d9[_0x43e7('0x26')])){_0x5c5e67[_0x43e7('0x15')]=_0x2803d9[_0x43e7('0x27')]&&_0x2803d9[_0x43e7('0x27')]!==_0x43e7('0x28')?_0x2803d9[_0x43e7('0x27')]:_0x43e7('0x29');}else{_0x5c5e67[_0x43e7('0x15')]=_0x2803d9[_0x43e7('0x2a')]&&_0x2803d9[_0x43e7('0x2a')]!==_0x43e7('0x28')?_0x2803d9[_0x43e7('0x2a')]:_0x43e7('0x29');}return BPromise[_0x43e7('0x1e')]()['then'](cmContactRpc[_0x43e7('0x2b')](_0x5c5e67))[_0x43e7('0x20')](function(_0x3b8f78){_0x513707=_0x3b8f78;_0xf7c520[_0x43e7('0x2c')](_0x3b8f78);if(_0x513707){logger[_0x43e7('0x9')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x2803d9[_0x43e7('0x23')],_0x4139c9['id'],_0x513707['id']);}return;});}else{logger[_0x43e7('0x9')](_0x43e7('0x2d'),_0x2803d9[_0x43e7('0x23')],_0x4139c9['id']);_0x5c5e67[_0x1af208]=_['isNil'](_0x2803d9['routeId'])?_0x2803d9['calleridnum']:_0x2803d9[_0x43e7('0x13')];if(_[_0x43e7('0xd')](_0x2803d9[_0x43e7('0x26')])){_0x5c5e67[_0x43e7('0x15')]=_0x2803d9[_0x43e7('0x27')]&&_0x2803d9[_0x43e7('0x27')]!==''?_0x2803d9['calleridname']:'Unknown';}else{_0x5c5e67['firstName']=_0x2803d9['destcalleridname']&&_0x2803d9['destcalleridname']!==''?_0x2803d9[_0x43e7('0x2a')]:'Unknown';}_0x513707=_0x5c5e67;_0xf7c520[_0x43e7('0x2c')](_0x5c5e67);return;}}})[_0x43e7('0x20')](function(){if(_0x39c8bd){emit(_0x2803d9[_0x43e7('0x23')],_0x4139c9,util[_0x43e7('0x2e')](_0x43e7('0x2f'),_0x39c8bd[_0x43e7('0x30')]),util[_0x43e7('0x2e')]('trigger:%s',_0x5c34f4['action']['toLowerCase']()),{'evt':_[_0x43e7('0x31')](_0x2803d9,{'autoCreate':_0xc960ea}),'contact':_0x513707===undefined?{}:_0x513707,'contacts':_0xf7c520[_0x43e7('0x22')]===0x0?undefined:_0xf7c520});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index fec590b..0b59e45 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 _0x79a5=['every','checkConditions','channel','length','field','account','chat','ChatWebsiteId','operator','upperFirst','AccountId','interaction','value','event','agent','membername','lastevent','exports','util','lodash','url','mustache','./urlforward','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','localhost','socket.io-emitter','popup','triggers','agents','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialconnect','syncAgentDial','custom:dialend','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:rejectmessage','emit','stringify','prototype','clone','motionChannel','voice','checkTriggers','status','checkTrigger','merge','variables','Actions','action','contactmanager','browser','data1','data2','html','render','template\x20not\x20found','uri','isNil','data3','location','uriLocation','windowWidth','data5','800','windowHeight','data6','winapp','winApplication','winArguments','format','interface','name','trigger:%s:%s','toLowerCase','jscripty','user:%s','trigger:%s','exec','integration','queue','routeId','urlforward','script','buildUri','parse','search','AllConditions'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x79a5,0x17a));var _0x579a=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0x79a5[_0x4a3898];return _0x25ceb0;};'use strict';var util=require(_0x579a('0x0'));var _=require(_0x579a('0x1'));var url=require(_0x579a('0x2'));var Mustache=require(_0x579a('0x3'));var Redis=require('ioredis');var urlforward=require(_0x579a('0x4'));var integration=require(_0x579a('0x5'));var cmContact=require(_0x579a('0x6'));var script=require(_0x579a('0x7'));var config=require(_0x579a('0x8'));var logger=require(_0x579a('0x9'))(_0x579a('0xa'));var ami=require(_0x579a('0xb'));config['redis']=_['defaults'](config[_0x579a('0xc')],{'host':_0x579a('0xd'),'port':0x18eb});var io=require(_0x579a('0xe'))(new Redis(config['redis']));var operators={'equals':function(_0x23e115,_0x2e46b1){return _0x23e115==_0x2e46b1;},'not_equals':function(_0x34434b,_0x37033d){return _0x34434b!=_0x37033d;}};var barAndWebActions=[_0x579a('0xf'),'url','winapp'];function Trigger(_0x3eaa92){this[_0x579a('0x10')]=_0x3eaa92[_0x579a('0x10')];this[_0x579a('0x11')]=_0x3eaa92[_0x579a('0x11')];this['voiceQueues']=_0x3eaa92['voiceQueues'];this[_0x579a('0x12')]=_0x3eaa92[_0x579a('0x12')];this[_0x579a('0x13')]=_0x3eaa92[_0x579a('0x13')];this['zendeskAccounts']=_0x3eaa92[_0x579a('0x14')];this['freshdeskAccounts']=_0x3eaa92[_0x579a('0x15')];this[_0x579a('0x16')]=_0x3eaa92[_0x579a('0x16')];this[_0x579a('0x17')]=_0x3eaa92[_0x579a('0x17')];this['zohoAccounts']=_0x3eaa92[_0x579a('0x18')];this[_0x579a('0x19')]=_0x3eaa92[_0x579a('0x19')];this[_0x579a('0x1a')]=_0x3eaa92['vtigerAccounts'];this[_0x579a('0x1b')]=_0x3eaa92[_0x579a('0x1b')];this['dynamics365Accounts']=_0x3eaa92[_0x579a('0x1c')];this[_0x579a('0x1d')]=_0x3eaa92[_0x579a('0x1d')];this[_0x579a('0x1e')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0x579a('0x16')],'freshdesk':this[_0x579a('0x15')],'sugarcrm':this[_0x579a('0x17')],'zoho':this[_0x579a('0x18')],'desk':this[_0x579a('0x19')],'vtiger':this[_0x579a('0x1a')],'dynamics365':this[_0x579a('0x1c')],'freshsales':this[_0x579a('0x1d')],'servicenow':this['servicenowAccounts']};ami['on']('custom:agentcalled',this[_0x579a('0x1f')][_0x579a('0x20')](this));ami['on'](_0x579a('0x21'),this[_0x579a('0x1f')][_0x579a('0x20')](this));ami['on'](_0x579a('0x22'),this[_0x579a('0x1f')][_0x579a('0x20')](this));ami['on'](_0x579a('0x23'),this[_0x579a('0x1f')][_0x579a('0x20')](this));ami['on'](_0x579a('0x24'),this[_0x579a('0x1f')][_0x579a('0x20')](this));ami['on'](_0x579a('0x25'),this[_0x579a('0x1f')][_0x579a('0x20')](this));ami['on']('custom:agentbusy',this[_0x579a('0x1f')][_0x579a('0x20')](this));ami['on'](_0x579a('0x26'),this[_0x579a('0x1f')][_0x579a('0x20')](this));ami['on'](_0x579a('0x27'),this[_0x579a('0x1f')]['bind'](this));ami['on'](_0x579a('0x28'),this[_0x579a('0x1f')][_0x579a('0x20')](this));ami['on'](_0x579a('0x29'),this[_0x579a('0x1f')][_0x579a('0x20')](this));ami['on'](_0x579a('0x2a'),this[_0x579a('0x1f')][_0x579a('0x20')](this));ami['on']('custom:dialbegin',this['syncAgentDial'][_0x579a('0x20')](this));ami['on'](_0x579a('0x2b'),this[_0x579a('0x2c')][_0x579a('0x20')](this));ami['on'](_0x579a('0x2d'),this[_0x579a('0x2c')][_0x579a('0x20')](this));ami['on']('custom:newinteraction',this['syncCustomEvent'][_0x579a('0x20')](this));ami['on'](_0x579a('0x2e'),this[_0x579a('0x1f')][_0x579a('0x20')](this));ami['on'](_0x579a('0x2f'),this[_0x579a('0x1f')]['bind'](this));ami['on'](_0x579a('0x30'),this[_0x579a('0x1f')]['bind'](this));ami['on'](_0x579a('0x31'),this['syncCustomEvent'][_0x579a('0x20')](this));ami['on']('custom:acceptmessage',this['syncCustomEvent']['bind'](this));ami['on'](_0x579a('0x32'),this[_0x579a('0x1f')][_0x579a('0x20')](this));}Trigger['prototype'][_0x579a('0x33')]=function(_0x193f58,_0x303325,_0x1c420f){logger['info'](_0x193f58,_0x303325,JSON[_0x579a('0x34')](_0x1c420f));io['to'](_0x193f58)[_0x579a('0x33')](_0x303325,_0x1c420f);};Trigger[_0x579a('0x35')][_0x579a('0x1f')]=function(_0x4a76f3){var _0x40834d=_[_0x579a('0x36')](_0x4a76f3);if(typeof _0x40834d['motionChannel']==='undefined'){_0x40834d[_0x579a('0x37')]=_0x579a('0x38');}this[_0x579a('0x39')](_0x40834d);};Trigger[_0x579a('0x35')][_0x579a('0x2c')]=function(_0x48791f){if(this[_0x579a('0x11')][_0x48791f['interface']]){this[_0x579a('0x1f')](_0x48791f);}};Trigger[_0x579a('0x35')]['checkTriggers']=function(_0x43164a){var _0x3dc30f;for(var _0x440d52 in this[_0x579a('0x10')]){if(this[_0x579a('0x10')]['hasOwnProperty'](_0x440d52)){if(this[_0x579a('0x10')][_0x440d52][_0x579a('0x3a')]){_0x3dc30f=this[_0x579a('0x3b')](this[_0x579a('0x10')][_0x440d52],_0x43164a);if(_0x3dc30f){_[_0x579a('0x3c')](_0x43164a,_0x43164a[_0x579a('0x3d')]);for(var _0x89b058=0x0,_0x4075ef,_0xc5fe40,_0x4a034d;_0x89b0580x0){_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 _0x3e74=['customField','content','idField','custom_fields','variable','variableName','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','stripTrailingSlash','serverUrl','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','newTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','The\x20Enduser\x20ID\x20is:','trigger:desk:display','trigger:browser:url','%s/agent/tickets/%s','stringify','unmanaged','monitor_format','lastevent','toUpperCase','calleridnum','lodash','md5','util','ioredis','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','then','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','debug','[HTTP]','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','total_entries','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length','forEach','includes','string','picklist','type','nameField'];(function(_0x2bc9fc,_0x18fb97){var _0x2b1a27=function(_0x2eae81){while(--_0x2eae81){_0x2bc9fc['push'](_0x2bc9fc['shift']());}};_0x2b1a27(++_0x18fb97);}(_0x3e74,0x175));var _0x43e7=function(_0x3b3989,_0x504349){_0x3b3989=_0x3b3989-0x0;var _0x34c976=_0x3e74[_0x3b3989];return _0x34c976;};'use strict';var _=require(_0x43e7('0x0'));var rp=require('request-promise');var md5=require(_0x43e7('0x1'));var util=require(_0x43e7('0x2'));var Redis=require(_0x43e7('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x43e7('0x4'))('desk');config[_0x43e7('0x5')]=_[_0x43e7('0x6')](config[_0x43e7('0x5')],{'host':_0x43e7('0x7'),'port':0x18eb});var io=require(_0x43e7('0x8'))(new Redis(config['redis']));function emit(_0x45a0d1,_0x3491d6,_0x2ede2d){io['to'](_0x45a0d1)[_0x43e7('0x9')](_0x3491d6,_0x2ede2d);}var headers={'Content-Type':_0x43e7('0xa'),'Accept':'application/json'};function getUser(_0x212c6c,_0x554d44){if(intUtil['validateEmail'](_0x554d44)===!![]){logger[_0x43e7('0xb')](_0x43e7('0xc'),_0x554d44);return request({'uri':util['format'](_0x43e7('0xd'),_0x212c6c['remoteUri'])})[_0x43e7('0xe')](function(_0x37302c){if(_0x37302c['total_entries']){return _[_0x43e7('0xf')](_0x37302c[_0x43e7('0x10')][_0x43e7('0x11')],{'email':_0x554d44});}})[_0x43e7('0xe')](function(_0x4e008c){if(_0x4e008c){logger['info'](_0x43e7('0x12'));return _0x4e008c;}else{logger[_0x43e7('0xb')](_0x43e7('0x13'));return request({'uri':util['format']('%s/users/me',_0x212c6c[_0x43e7('0x14')])});}});}else{logger[_0x43e7('0xb')](_0x43e7('0x15'));return request({'uri':util[_0x43e7('0x16')]('%s/users/me',_0x212c6c['remoteUri'])});}}function request(_0xdf16c){logger[_0x43e7('0x17')](_0x43e7('0x18'),JSON['stringify'](_0xdf16c));return rp(_['defaults'](_0xdf16c,{'method':_0x43e7('0x19'),'headers':headers,'json':!![]}));}function getAuth(_0x1ca758){var _0x9037d3;if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1b')){_0x9037d3=util[_0x43e7('0x16')](_0x43e7('0x1c'),_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1e')]);}else if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1f')){_0x9037d3=util[_0x43e7('0x16')]('%s/token:%s',_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1f')]);}return util['format'](_0x43e7('0x20'),new Buffer(_0x9037d3)[_0x43e7('0x21')](_0x43e7('0x22')));}function getEndUser(_0x28aacc,_0x4077fb,_0x2f4cb4){logger['info'](_0x43e7('0x23'),_0x2f4cb4);return request({'uri':util['format']('%s/customers/search',_0x28aacc[_0x43e7('0x14')]),'qs':{'phone':_0x2f4cb4}})[_0x43e7('0xe')](function(_0x4b2b9f){if(_0x4b2b9f[_0x43e7('0x24')]){logger['info'](_0x43e7('0x25'));return _0x4b2b9f['_embedded'][_0x43e7('0x11')][0x0];}else{logger[_0x43e7('0xb')](_0x43e7('0x26'));return request({'uri':util[_0x43e7('0x16')]('%s/customers',_0x28aacc['remoteUri']),'method':_0x43e7('0x27'),'body':{'first_name':_0x4077fb,'title':_0x4077fb,'phone_numbers':[{'type':'work','value':_0x2f4cb4}]}});}});}function getTags(_0x2dd5f,_0x40dc8f){var _0x3565cf=[];if(_0x2dd5f&&_0x2dd5f[_0x43e7('0x28')]>0x0){_0x3565cf=_['map'](_0x2dd5f,_0x40dc8f);}return _0x3565cf;}function getCustomFields(_0x33a1a5,_0x4690a6){var _0x45b675=[];var _0x50f9f5={'custom_fields':{}};if(_0x33a1a5[_0x43e7('0x28')]>0x0){_[_0x43e7('0x29')](_0x33a1a5,function(_0x2b85a5){if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5[_0x43e7('0x2d')])&&_0x2b85a5[_0x43e7('0x2e')]&&!_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x2b85a5[_0x43e7('0x2e')]['toLowerCase']()]=_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x21')]();}else if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5['type'])&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x2b85a5['content']['toString']();}else if(_0x2b85a5['type']===_0x43e7('0x33')&&_0x2b85a5[_0x43e7('0x34')]&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x34')]]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5['idField']]=_0x4690a6[_0x2b85a5['variableName']]['toString']());}else if(_0x2b85a5['type']==='customVariable'&&_0x2b85a5['Variable']&&_0x2b85a5['Variable'][_0x43e7('0x35')]&&_0x2b85a5['idField']&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x36')][_0x43e7('0x35')][_0x43e7('0x37')]()]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x4690a6[_0x2b85a5[_0x43e7('0x36')]['name']['toLowerCase']()]['toString']());}});}if(_0x50f9f5[_0x43e7('0x38')]){_0x50f9f5[_0x43e7('0x38')]=Number(_0x50f9f5[_0x43e7('0x38')]);}return _0x50f9f5;}function getTicket(_0x16cdba,_0x1b1440,_0x1ed538,_0x1d4589,_0x2ffd43){logger['info'](_0x43e7('0x39'));var _0x2b0ffe=_['merge']({'subject':intUtil[_0x43e7('0x3a')](_0x1d4589['Subjects'],_0x2ffd43,'\x20'),'type':_0x43e7('0x3b'),'status':_0x43e7('0x3c'),'labels':[_0x43e7('0x3d'),_0x43e7('0x3e'),_0x43e7('0x3f')][_0x43e7('0x40')](getTags(_0x1d4589['Tags'],'name')),'description':intUtil[_0x43e7('0x3a')](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a'),'_links':{'assigned_user':{'href':util[_0x43e7('0x16')](_0x43e7('0x42'),_0x1b1440['id']),'class':_0x43e7('0x43')}},'message':{'direction':'in','body':intUtil['getString'](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a')}},getCustomFields(_0x1d4589[_0x43e7('0x44')],_0x2ffd43));return request({'uri':util['format'](_0x43e7('0x45'),_0x16cdba['remoteUri'],_0x1ed538['id']),'method':_0x43e7('0x27'),'body':_0x2b0ffe});}exports['queue']=function(_0x3d81ae,_0x3b4235,_0x3a5807,_0x1c2c6b,_0x49b866,_0x47d6a1){var _0x103393,_0x40c509;_0x47d6a1[_0x43e7('0x14')]=intUtil[_0x43e7('0x46')](_0x47d6a1['remoteUri']);_0x47d6a1['serverUrl']=intUtil['stripTrailingSlash'](_0x47d6a1[_0x43e7('0x47')]);if(_0x49b866&&_0x49b866['monitor_format']){logger[_0x43e7('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3b4235[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x47d6a1[_0x43e7('0x47')],_0x3b4235[_0x43e7('0x4a')],md5(_0x3b4235[_0x43e7('0x4a')]));}else{_0x3b4235['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x47d6a1);return getUser(_0x47d6a1,_0x1c2c6b[_0x43e7('0x4c')])[_0x43e7('0xe')](function(_0x1fd277){_0x103393=_0x1fd277;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x103393['id']);return getEndUser(_0x47d6a1,_0x3b4235['calleridname'],_0x3b4235['calleridnum']);})[_0x43e7('0xe')](function(_0x36a09e){_0x40c509=_0x36a09e;logger[_0x43e7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x40c509['id']);return getTicket(_0x47d6a1,_0x103393,_0x40c509,_0x3a5807,_0x3b4235);})['then'](function(_0x56489b){if(_0x56489b){logger[_0x43e7('0xb')](_0x43e7('0x4e'));logger['info'](_0x43e7('0x4f'),_0x56489b['id']);switch(_0x47d6a1[_0x43e7('0x2d')]){case _0x43e7('0x50'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0x43e7('0x51'),_0x1c2c6b[_0x43e7('0x35')]),'trigger:desk:display',{'recordId':_0x56489b['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')](_0x43e7('0x53'),_0x43e7('0x54'));emit(util['format'](_0x43e7('0x51'),_0x1c2c6b['name']),'trigger:browser:url',{'uri':util[_0x43e7('0x16')](_0x43e7('0x55'),_0x56489b['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x53'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x1cd87c){console[_0x43e7('0x56')](_0x1cd87c);logger[_0x43e7('0x56')](_0x43e7('0x53'),JSON['stringify'](_0x1cd87c));});};exports[_0x43e7('0x59')]=function(_0x46c910,_0x499c03,_0x39e3ca,_0x4e6f6d,_0x35b799,_0x520857,_0x34e2ec){var _0x1f561f,_0xfe13fa;_0x520857['remoteUri']=intUtil['stripTrailingSlash'](_0x520857[_0x43e7('0x14')]);_0x520857[_0x43e7('0x47')]=intUtil[_0x43e7('0x46')](_0x520857[_0x43e7('0x47')]);if(_0x34e2ec&&_0x34e2ec[_0x43e7('0x5a')]&&_0x34e2ec[_0x43e7('0x5a')]!==_0x43e7('0x5b')){logger[_0x43e7('0xb')](_0x43e7('0x5c'),_0x43e7('0x5d'));_0x499c03[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x520857[_0x43e7('0x47')],_0x499c03['uniqueid'],md5(_0x499c03[_0x43e7('0x4a')]));}headers[_0x43e7('0x4b')]=getAuth(_0x520857);return getUser(_0x520857,_0x4e6f6d[_0x43e7('0x4c')])['then'](function(_0x5d63c6){_0x1f561f=_0x5d63c6;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x1f561f['id']);return getEndUser(_0x520857,_0x499c03['destcalleridname'],_0x499c03[_0x43e7('0x5e')]);})['then'](function(_0x49a6ce){_0xfe13fa=_0x49a6ce;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xfe13fa['id']);return getTicket(_0x520857,_0x1f561f,_0xfe13fa,_0x39e3ca,_0x499c03);})[_0x43e7('0xe')](function(_0x40155c){if(_0x40155c){logger[_0x43e7('0xb')]('Ticket\x20created!');logger[_0x43e7('0xb')](_0x43e7('0x4f'),_0x40155c['id']);switch(_0x520857['type']){case _0x43e7('0x50'):logger[_0x43e7('0xb')](_0x43e7('0x53'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format']('user:%s',_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x60'),{'recordId':_0x40155c['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x43e7('0x16')](_0x43e7('0x51'),_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x61'),{'uri':util['format'](_0x43e7('0x62'),_0x520857[_0x43e7('0x14')],_0x40155c['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x5c'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x4665db){logger[_0x43e7('0x56')](_0x43e7('0x5c'),JSON[_0x43e7('0x63')](_0x4665db));});};exports[_0x43e7('0x64')]=function(_0x57fdfe,_0x5f3824,_0x2b0711,_0x58a3a8,_0x501616,_0x50edb2){var _0xb3e981,_0xe666b0;_0x50edb2['remoteUri']=intUtil[_0x43e7('0x46')](_0x50edb2[_0x43e7('0x14')]);_0x50edb2[_0x43e7('0x47')]=intUtil['stripTrailingSlash'](_0x50edb2[_0x43e7('0x47')]);if(_0x501616&&_0x501616[_0x43e7('0x65')]){logger[_0x43e7('0xb')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',_0x43e7('0x5d'));_0x5f3824[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x50edb2[_0x43e7('0x47')],_0x5f3824[_0x43e7('0x4a')],md5(_0x5f3824['uniqueid']));}else{_0x5f3824['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x50edb2);return getUser(_0x50edb2)['then'](function(_0x5cb26e){_0xb3e981=_0x5cb26e;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0xb3e981['id']);return getEndUser(_0x50edb2,_0x5f3824['calleridname'],_0x5f3824[_0x43e7('0x68')]);})[_0x43e7('0xe')](function(_0x1e2fed){_0xe666b0=_0x1e2fed;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xe666b0['id']);return getTicket(_0x50edb2,_0xb3e981,_0xe666b0,_0x2b0711,_0x5f3824);})[_0x43e7('0xe')](function(_0x398a78){if(_0x398a78){logger['info'](_0x43e7('0x4e'));logger[_0x43e7('0xb')]('The\x20Ticket\x20ID\x20is:',_0x398a78['id']);}})[_0x43e7('0x58')](function(_0x5c2c5f){logger[_0x43e7('0x56')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',JSON[_0x43e7('0x63')](_0x5c2c5f));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 2f25bc1..05230e4 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 _0x735f=['catch','error','toUpperCase','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled',']\x20Agent\x20found\x20','systemuserid','info','userId','toLowerCase','outbound','destcalleridnum','contacts','/systemusers(','headers','substring','lastIndexOf','enduserId','calleridnum','replace','%2b','telephone1','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','includes','string','picklist','type','nameField','customField','idField','indexOf','content','ticketType','incident','incidents','assign','Subjects','getString','/contacts(','Fields','phonecall','Descriptions','callDirection','queue','odata-entityid','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','stripTrailingSlash','remoteUri','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','uniqueid','recordingURL','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:','Displaying\x20call\x20in\x20a\x20new\x20tab...','request-promise','util','./util','ioredis','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','clientId','username','password','clientSecret','then','access_token'];(function(_0x29beab,_0x386585){var _0x3aa835=function(_0x211cf7){while(--_0x211cf7){_0x29beab['push'](_0x29beab['shift']());}};_0x3aa835(++_0x386585);}(_0x735f,0x109));var _0xf735=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x735f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var rp=require(_0xf735('0x0'));var util=require(_0xf735('0x1'));var intUtil=require(_0xf735('0x2'));var md5=require('md5');var Redis=require(_0xf735('0x3'));var logger=require('../../../../config/logger')(_0xf735('0x4'));var config=require(_0xf735('0x5'));config[_0xf735('0x6')]=_[_0xf735('0x7')](config[_0xf735('0x6')],{'host':_0xf735('0x8'),'port':0x18eb});var io=require(_0xf735('0x9'))(new Redis(config[_0xf735('0x6')]));function getAuthToken(_0x55bb38,_0x303999,_0x25f931){var _0x1725d3={'method':_0xf735('0xa'),'uri':_0x303999,'form':{'client_id':_0x55bb38[_0xf735('0xb')],'resource':_0x55bb38['remoteUri'],'username':_0x55bb38[_0xf735('0xc')],'password':_0x55bb38[_0xf735('0xd')],'grant_type':_0xf735('0xd'),'client_secret':_0x55bb38[_0xf735('0xe')]},'json':!![]};return rp(_0x1725d3)[_0xf735('0xf')](function(_0x4ae2b6){return _0x4ae2b6[_0xf735('0x10')];})[_0xf735('0x11')](function(_0x1655d6){logger[_0xf735('0x12')]('['+[_0x25f931[_0xf735('0x13')]()]+']\x20Wrong\x20credentials!');return _0x1655d6[_0xf735('0x14')];});}function getUser(_0x4bc344,_0x32f441,_0x7282bc,_0x15260d,_0x55d9e4,_0x1120bc){return new BPromise(function(_0x522889,_0x2a3ffe){return getAuthToken(_0x32f441,_0x15260d,_0x1120bc)[_0xf735('0xf')](function(_0x51218b){var _0xf48b89={'method':'GET','uri':_0x55d9e4+_0xf735('0x15'),'headers':{'Authorization':_0xf735('0x16')+_0x51218b,'OData-Version':_0xf735('0x17')},'json':!![]};return rp(_0xf48b89);})[_0xf735('0xf')](function(_0x2ff879){var _0x4d3151=_0x2ff879[_0xf735('0x18')];var _0x1b45d2=![];var _0x2f4778=null;if(!_[_0xf735('0x19')](_0x7282bc)){if(intUtil[_0xf735('0x1a')](_0x7282bc[_0xf735('0x1b')])){_0x4bc344[_0xf735('0x1c')]=_0x7282bc[_0xf735('0x1b')];for(_0x2f4778=0x0;_0x2f4778<_0x4d3151[_0xf735('0x1d')];_0x2f4778++){if(_0x4d3151[_0x2f4778][_0xf735('0x1e')]===_0x7282bc[_0xf735('0x1b')]&&!_0x4d3151[_0x2f4778][_0xf735('0x1f')]){_0x1b45d2=!![];logger['info']('['+[_0x1120bc[_0xf735('0x13')]()]+_0xf735('0x20')+_0x4d3151[_0x2f4778][_0xf735('0x21')]+'!');_0x4bc344['userId']=_0x4d3151[_0x2f4778][_0xf735('0x21')];}}}}if(!_0x1b45d2){logger[_0xf735('0x22')]('['+[_0x1120bc[_0xf735('0x13')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x4bc344[_0xf735('0x1c')]=_0x32f441[_0xf735('0xc')];for(_0x2f4778=0x0;_0x2f4778<_0x4d3151['length'];_0x2f4778++){if(_0x4d3151[_0x2f4778][_0xf735('0x1e')]===_0x32f441[_0xf735('0xc')]){_0x4bc344[_0xf735('0x23')]=_0x4d3151[_0x2f4778][_0xf735('0x21')];}}}_0x522889(_0x4bc344);})[_0xf735('0x11')](function(_0xf34e76){_0x2a3ffe(_0xf34e76['message']);});});}function createEndUser(_0x5d3cba,_0x528a43,_0x9e0e95,_0x31ecb6,_0xd3ee2b,_0x24a93b){return new BPromise(function(_0x5a73a0,_0x8c0b88){return getAuthToken(_0x528a43,_0x9e0e95,_0x24a93b)[_0xf735('0xf')](function(_0x2f6b75){var _0x5f388a=_0x24a93b[_0xf735('0x24')]()===_0xf735('0x25')?_0xd3ee2b[_0xf735('0x26')]:_0xd3ee2b['calleridnum'];var _0x2b5e7d={'method':_0xf735('0xa'),'uri':_0x31ecb6+_0xf735('0x27'),'body':{'telephone1':_0x5f388a,'fullname':_0x5f388a,'firstname':_0x5f388a,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xf735('0x28')+_0x5d3cba[_0xf735('0x23')]+')'},'headers':{'Authorization':_0xf735('0x16')+_0x2f6b75,'OData-Version':_0xf735('0x17')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x2b5e7d);})['then'](function(_0x2d3fb2){var _0x40cc32=_0x2d3fb2[_0xf735('0x29')]['odata-entityid'];var _0xa64ff9=_0x40cc32[_0xf735('0x2a')](_0x40cc32['lastIndexOf']('(')+0x1,_0x40cc32[_0xf735('0x2b')](')'));_0x5d3cba[_0xf735('0x2c')]=_0xa64ff9;_0x5a73a0(_0x5d3cba);})['catch'](function(_0x1b46f8){_0x8c0b88(_0x1b46f8[_0xf735('0x14')]);});});}function getEndUser(_0x3e16bd,_0x4c07e0,_0x5c7ae2,_0x2a3637,_0x51ac5f,_0x7c184b){return new BPromise(function(_0x44050a,_0x335802){var _0x49487f=_0x7c184b['toLowerCase']()==='outbound'?_0x51ac5f[_0xf735('0x26')]:_0x51ac5f[_0xf735('0x2d')];return getAuthToken(_0x4c07e0,_0x5c7ae2,_0x7c184b)[_0xf735('0xf')](function(_0x9cfe23){var _0x1a01c1={'method':'GET','uri':_0x2a3637+'contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27'+_0x49487f[_0xf735('0x2e')]('+',_0xf735('0x2f'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x9cfe23,'If-None-Match':null,'OData-Version':_0xf735('0x17')},'json':!![]};return rp(_0x1a01c1);})[_0xf735('0xf')](function(_0x44f31a){var _0x315ffb=null;if(_0x44f31a){var _0x31085c=_0x44f31a[_0xf735('0x18')];var _0x1a3105=![];for(_0x315ffb=0x0;_0x315ffb<_0x31085c[_0xf735('0x1d')];_0x315ffb++){if(_0x31085c[_0x315ffb][_0xf735('0x30')]===_0x49487f){_0x1a3105=!![];_0x3e16bd[_0xf735('0x2c')]=_0x31085c[_0x315ffb][_0xf735('0x31')];}}if(_0x1a3105){_0x44050a(_0x3e16bd);}else{return createEndUser(_0x3e16bd,_0x4c07e0,_0x5c7ae2,_0x2a3637,_0x51ac5f,_0x7c184b)[_0xf735('0xf')](function(_0x25bd67){logger[_0xf735('0x22')]('['+[_0x7c184b[_0xf735('0x13')]()]+_0xf735('0x32'),_0x25bd67[_0xf735('0x2c')]);_0x44050a(_0x25bd67);});}}else{return createEndUser(_0x3e16bd,_0x4c07e0,_0x5c7ae2,_0x2a3637,_0x51ac5f,_0x7c184b)[_0xf735('0xf')](function(_0x2441ad){logger[_0xf735('0x22')]('['+[_0x7c184b['toUpperCase']()]+_0xf735('0x33'),_0x2441ad[_0xf735('0x2c')]);_0x44050a(_0x2441ad);});}});});}function getCustomFields(_0xb44f4,_0x1e1a1d,_0x430543){var _0x21ad5d={};if(_0xb44f4[_0xf735('0x1d')]>0x0){_[_0xf735('0x34')](_0xb44f4,function(_0x375480){if(_[_0xf735('0x35')]([_0xf735('0x36'),_0xf735('0x37')],_0x375480[_0xf735('0x38')])&&_0x375480[_0xf735('0x39')]&&!_0x375480[_0xf735('0x3a')]){var _0x16fe91=_0x375480[_0xf735('0x3b')][_0xf735('0x24')]();var _0x3026a6=_0x16fe91[_0xf735('0x2a')](0x0,_0x16fe91[_0xf735('0x3c')]('_'));var _0x429985=_0x16fe91[_0xf735('0x2a')](_0x16fe91['indexOf']('_')+0x1);if(_0x3026a6===_0x430543){_0x21ad5d[_0x429985]=_0x375480[_0xf735('0x3d')];}}});}return _0x21ad5d;}function getTicket(_0x217f36,_0x2f8cc0,_0xc84196,_0xd4b783,_0x231394,_0x428e52,_0x222c98){return new BPromise(function(_0x4181b8,_0x859e9d){var _0x4ae0dd;return getAuthToken(_0x2f8cc0,_0xc84196,_0x222c98)[_0xf735('0xf')](function(_0x44775d){if(_0x428e52[_0xf735('0x3e')]===_0xf735('0x3f')){_0x4ae0dd={'method':_0xf735('0xa'),'uri':_0xd4b783+_0xf735('0x40'),'body':Object[_0xf735('0x41')]({},{'title':intUtil['getString'](_0x428e52[_0xf735('0x42')],_0x231394,'\x20'),'description':intUtil[_0xf735('0x43')](_0x428e52['Descriptions'],_0x231394,'\x0a'),'customerid_contact@odata.bind':_0xf735('0x44')+_0x217f36[_0xf735('0x2c')]+')','ownerid@odata.bind':_0xf735('0x28')+_0x217f36[_0xf735('0x23')]+')','caseorigincode':'1'},getCustomFields(_0x428e52[_0xf735('0x45')],_0x231394,_0x428e52['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x44775d,'OData-Version':_0xf735('0x17')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x428e52[_0xf735('0x3e')]===_0xf735('0x46')){_0x4ae0dd={'method':_0xf735('0xa'),'uri':_0xd4b783+'phonecalls','body':Object[_0xf735('0x41')]({},{'subject':intUtil[_0xf735('0x43')](_0x428e52[_0xf735('0x42')],_0x231394,'\x20'),'phonenumber':String(_0x231394[_0xf735('0x2d')]),'description':intUtil[_0xf735('0x43')](_0x428e52[_0xf735('0x47')],_0x231394,'\x0a'),'regardingobjectid_contact@odata.bind':_0xf735('0x44')+_0x217f36[_0xf735('0x2c')]+')','ownerid@odata.bind':_0xf735('0x28')+_0x217f36[_0xf735('0x23')]+')','directioncode':_0x217f36[_0xf735('0x48')]===_0xf735('0x49')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':'/systemusers('+_0x217f36[_0xf735('0x23')]+')','participationtypemask':_0x217f36[_0xf735('0x48')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x217f36['enduserId']+')','participationtypemask':_0x217f36[_0xf735('0x48')]==='queue'?0x1:0x2}]},getCustomFields(_0x428e52[_0xf735('0x45')],_0x231394,_0x428e52['ticketType'])),'headers':{'Authorization':_0xf735('0x16')+_0x44775d,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x4ae0dd);})[_0xf735('0xf')](function(_0x5833fd){var _0x3dfe00=_0x5833fd[_0xf735('0x29')][_0xf735('0x4a')];var _0x2e560b=_0x3dfe00[_0xf735('0x2a')](_0x3dfe00[_0xf735('0x2b')]('(')+0x1,_0x3dfe00[_0xf735('0x2b')](')'));_0x217f36[_0xf735('0x4b')]=_0x2e560b;_0x4181b8(_0x217f36);})[_0xf735('0x11')](function(_0x253912){_0x859e9d(_0x253912[_0xf735('0x14')]);});});}function emit(_0x19314b,_0x514016,_0x49c9e3,_0x462249){var _0x160965={'uri':util[_0xf735('0x4c')](_0xf735('0x4d'),_0x19314b,_0x49c9e3,_0x462249)};io['to'](util['format']('user:%s',_0x514016))[_0xf735('0x4e')]('trigger:browser:url',_0x160965);}exports['cs']=function(_0x27d9bd,_0x47f99a,_0x4a1f79,_0x33c0d4,_0x593837,_0x14d3b5,_0x40f428,_0x19fa91){var _0x5b7058={};_0x14d3b5['remoteUri']=intUtil[_0xf735('0x4f')](_0x14d3b5[_0xf735('0x50')]);_0x14d3b5[_0xf735('0x51')]=intUtil[_0xf735('0x4f')](_0x14d3b5[_0xf735('0x51')]);_0x5b7058[_0xf735('0x48')]=_0x19fa91==='queue'||_0x19fa91===_0xf735('0x52')?'queue':'outbound';var _0x348958=util[_0xf735('0x4c')](_0xf735('0x53'),_0x14d3b5['remoteUri']);var _0x423516=util['format'](_0xf735('0x54'),_0x14d3b5['tenantId']);var _0xa3c65d=util[_0xf735('0x4c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x14d3b5[_0xf735('0x51')],_0x47f99a[_0xf735('0x55')],md5(_0x47f99a[_0xf735('0x55')]));if(_0x593837&&_0x593837['monitor_format']){logger[_0xf735('0x22')]('[QUEUE]','Recording\x20is\x20enabled!');_0x47f99a[_0xf735('0x56')]=_0xa3c65d;}else if(_0x40f428&&_0x40f428[_0xf735('0x57')]&&_0x40f428[_0xf735('0x57')]!=='none'){logger['info'](_0xf735('0x58'),_0xf735('0x59'));_0x47f99a[_0xf735('0x56')]=_0xa3c65d;}else{_0x47f99a[_0xf735('0x56')]='';}return getUser(_0x5b7058,_0x14d3b5,_0x33c0d4,_0x423516,_0x348958,_0x19fa91)['then'](function(_0x497f4d){logger[_0xf735('0x22')]('['+_0x19fa91[_0xf735('0x13')]()+_0xf735('0x5a'),_0x497f4d[_0xf735('0x23')]);logger[_0xf735('0x22')]('['+_0x19fa91['toUpperCase']()+']\x20The\x20User\x20email\x20is:',_0x497f4d[_0xf735('0x1c')]);return getEndUser(_0x497f4d,_0x14d3b5,_0x423516,_0x348958,_0x47f99a,_0x19fa91);})[_0xf735('0xf')](function(_0x39f1d5){logger['info']('['+_0x19fa91[_0xf735('0x13')]()+_0xf735('0x5b'),_0x39f1d5[_0xf735('0x2c')]);logger[_0xf735('0x22')]('['+_0x19fa91[_0xf735('0x13')]()+_0xf735('0x5c'),_0x47f99a[_0xf735('0x2d')]);return getTicket(_0x39f1d5,_0x14d3b5,_0x423516,_0x348958,_0x47f99a,_0x4a1f79,_0x19fa91);})[_0xf735('0xf')](function(_0xb7db79){logger[_0xf735('0x22')](util[_0xf735('0x4c')]('['+_0x19fa91[_0xf735('0x13')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x4a1f79['ticketType'],_0xb7db79['ticketId']));logger['info'](util[_0xf735('0x4c')]('['+_0x19fa91[_0xf735('0x13')]()+']\x20Call\x20direction:\x20%s',_0x19fa91));if(_0x19fa91!==_0xf735('0x52')){logger[_0xf735('0x22')]('['+_0x19fa91['toUpperCase']()+']',_0xf735('0x5d'));emit(_0x14d3b5[_0xf735('0x50')],_0x33c0d4['name'],_0x4a1f79[_0xf735('0x3e')],_0xb7db79[_0xf735('0x4b')]);}})['catch'](function(_0x329f18){logger['error']('['+_0x19fa91[_0xf735('0x13')]()+']\x20Error\x20running\x20Dynamics365\x20integration',util['inspect'](_0x329f18,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x1862=['util','./util','md5','ioredis','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','username','password','clientSecret','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','isNil','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','message','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','4.0','headers','substring','lastIndexOf','%2b','telephone1','enduserId','contactid',']\x20Enduser\x20created!','includes','picklist','type','nameField','customField','idField','indexOf','content','ticketType','incident','incidents','getString','Subjects','Descriptions','/contacts(','phonecalls','assign','/systemusers(','callDirection','queue','Fields','odata-entityid','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','emit','stripTrailingSlash','remoteUri','serverUrl','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','bluebird','request-promise'];(function(_0x4076fb,_0x74de32){var _0x2521a0=function(_0x31fada){while(--_0x31fada){_0x4076fb['push'](_0x4076fb['shift']());}};_0x2521a0(++_0x74de32);}(_0x1862,0x12c));var _0x2186=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1862[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2186('0x0'));var BPromise=require(_0x2186('0x1'));var rp=require(_0x2186('0x2'));var util=require(_0x2186('0x3'));var intUtil=require(_0x2186('0x4'));var md5=require(_0x2186('0x5'));var Redis=require(_0x2186('0x6'));var logger=require('../../../../config/logger')(_0x2186('0x7'));var config=require(_0x2186('0x8'));config[_0x2186('0x9')]=_[_0x2186('0xa')](config[_0x2186('0x9')],{'host':_0x2186('0xb'),'port':0x18eb});var io=require(_0x2186('0xc'))(new Redis(config['redis']));function getAuthToken(_0x447a20,_0x348552,_0x380f45){var _0x276237={'method':_0x2186('0xd'),'uri':_0x348552,'form':{'client_id':_0x447a20['clientId'],'resource':_0x447a20['remoteUri'],'username':_0x447a20[_0x2186('0xe')],'password':_0x447a20[_0x2186('0xf')],'grant_type':_0x2186('0xf'),'client_secret':_0x447a20[_0x2186('0x10')]},'json':!![]};return rp(_0x276237)['then'](function(_0x49eea3){return _0x49eea3[_0x2186('0x11')];})[_0x2186('0x12')](function(_0x28430a){logger[_0x2186('0x13')]('['+[_0x380f45[_0x2186('0x14')]()]+_0x2186('0x15'));return _0x28430a['message'];});}function getUser(_0x3468a5,_0x1c6303,_0x521c93,_0x3f246f,_0x2abde7,_0x3fb01d){return new BPromise(function(_0x3bf1c8,_0x49ed07){return getAuthToken(_0x1c6303,_0x3f246f,_0x3fb01d)[_0x2186('0x16')](function(_0x398d3f){var _0x5e8986={'method':_0x2186('0x17'),'uri':_0x2abde7+_0x2186('0x18'),'headers':{'Authorization':_0x2186('0x19')+_0x398d3f,'OData-Version':'4.0'},'json':!![]};return rp(_0x5e8986);})[_0x2186('0x16')](function(_0x4f57fb){var _0x371487=_0x4f57fb[_0x2186('0x1a')];var _0x298db2=![];var _0x3a7da2=null;if(!_[_0x2186('0x1b')](_0x521c93)){if(intUtil['validateEmail'](_0x521c93[_0x2186('0x1c')])){_0x3468a5[_0x2186('0x1d')]=_0x521c93[_0x2186('0x1c')];for(_0x3a7da2=0x0;_0x3a7da2<_0x371487[_0x2186('0x1e')];_0x3a7da2++){if(_0x371487[_0x3a7da2][_0x2186('0x1f')]===_0x521c93[_0x2186('0x1c')]&&!_0x371487[_0x3a7da2][_0x2186('0x20')]){_0x298db2=!![];logger[_0x2186('0x21')]('['+[_0x3fb01d[_0x2186('0x14')]()]+_0x2186('0x22')+_0x371487[_0x3a7da2][_0x2186('0x23')]+'!');_0x3468a5[_0x2186('0x24')]=_0x371487[_0x3a7da2]['systemuserid'];}}}}if(!_0x298db2){logger[_0x2186('0x21')]('['+[_0x3fb01d[_0x2186('0x14')]()]+_0x2186('0x25'));_0x3468a5[_0x2186('0x1d')]=_0x1c6303[_0x2186('0xe')];for(_0x3a7da2=0x0;_0x3a7da2<_0x371487[_0x2186('0x1e')];_0x3a7da2++){if(_0x371487[_0x3a7da2][_0x2186('0x1f')]===_0x1c6303[_0x2186('0xe')]){_0x3468a5[_0x2186('0x24')]=_0x371487[_0x3a7da2][_0x2186('0x23')];}}}_0x3bf1c8(_0x3468a5);})[_0x2186('0x12')](function(_0x510975){_0x49ed07(_0x510975[_0x2186('0x26')]);});});}function createEndUser(_0x269a70,_0x41014a,_0x2ebfe7,_0x17f072,_0xd23887,_0x33ca59){return new BPromise(function(_0x58945a,_0x50fd63){return getAuthToken(_0x41014a,_0x2ebfe7,_0x33ca59)['then'](function(_0x33bfa3){var _0x52dc89=_0x33ca59[_0x2186('0x27')]()===_0x2186('0x28')?_0xd23887[_0x2186('0x29')]:_0xd23887[_0x2186('0x2a')];var _0x2dbbec={'method':_0x2186('0xd'),'uri':_0x17f072+_0x2186('0x2b'),'body':{'telephone1':_0x52dc89,'fullname':_0x52dc89,'firstname':_0x52dc89,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x269a70[_0x2186('0x24')]+')'},'headers':{'Authorization':_0x2186('0x19')+_0x33bfa3,'OData-Version':_0x2186('0x2c')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x2dbbec);})[_0x2186('0x16')](function(_0x48a7b6){var _0x164bb3=_0x48a7b6[_0x2186('0x2d')]['odata-entityid'];var _0x5195f5=_0x164bb3[_0x2186('0x2e')](_0x164bb3[_0x2186('0x2f')]('(')+0x1,_0x164bb3[_0x2186('0x2f')](')'));_0x269a70['enduserId']=_0x5195f5;_0x58945a(_0x269a70);})[_0x2186('0x12')](function(_0x485f63){_0x50fd63(_0x485f63[_0x2186('0x26')]);});});}function getEndUser(_0x29dd5a,_0x24c28d,_0x582816,_0x98e4a7,_0x1b401b,_0x2d8368){return new BPromise(function(_0x3b59ef,_0x4e00fd){var _0x54e688=_0x2d8368[_0x2186('0x27')]()===_0x2186('0x28')?_0x1b401b[_0x2186('0x29')]:_0x1b401b[_0x2186('0x2a')];return getAuthToken(_0x24c28d,_0x582816,_0x2d8368)['then'](function(_0x1e926e){var _0x452d15={'method':_0x2186('0x17'),'uri':_0x98e4a7+'contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27'+_0x54e688['replace']('+',_0x2186('0x30'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x1e926e,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x452d15);})[_0x2186('0x16')](function(_0x24e31c){var _0x42d33a=null;if(_0x24e31c){var _0x225f06=_0x24e31c[_0x2186('0x1a')];var _0x174b52=![];for(_0x42d33a=0x0;_0x42d33a<_0x225f06[_0x2186('0x1e')];_0x42d33a++){if(_0x225f06[_0x42d33a][_0x2186('0x31')]===_0x54e688){_0x174b52=!![];_0x29dd5a[_0x2186('0x32')]=_0x225f06[_0x42d33a][_0x2186('0x33')];}}if(_0x174b52){_0x3b59ef(_0x29dd5a);}else{return createEndUser(_0x29dd5a,_0x24c28d,_0x582816,_0x98e4a7,_0x1b401b,_0x2d8368)[_0x2186('0x16')](function(_0x5edec7){logger[_0x2186('0x21')]('['+[_0x2d8368[_0x2186('0x14')]()]+_0x2186('0x34'),_0x5edec7['enduserId']);_0x3b59ef(_0x5edec7);});}}else{return createEndUser(_0x29dd5a,_0x24c28d,_0x582816,_0x98e4a7,_0x1b401b,_0x2d8368)[_0x2186('0x16')](function(_0x5bb18c){logger[_0x2186('0x21')]('['+[_0x2d8368['toUpperCase']()]+']\x20Enduser\x20Created!',_0x5bb18c[_0x2186('0x32')]);_0x3b59ef(_0x5bb18c);});}});});}function getCustomFields(_0x3d4550,_0x3d73ce,_0x229ce4){var _0x2fdac5={};if(_0x3d4550[_0x2186('0x1e')]>0x0){_['forEach'](_0x3d4550,function(_0x4afd9b){if(_[_0x2186('0x35')](['string',_0x2186('0x36')],_0x4afd9b[_0x2186('0x37')])&&_0x4afd9b[_0x2186('0x38')]&&!_0x4afd9b[_0x2186('0x39')]){var _0x3f9355=_0x4afd9b[_0x2186('0x3a')]['toLowerCase']();var _0x3fa55b=_0x3f9355[_0x2186('0x2e')](0x0,_0x3f9355[_0x2186('0x3b')]('_'));var _0x129236=_0x3f9355[_0x2186('0x2e')](_0x3f9355[_0x2186('0x3b')]('_')+0x1);if(_0x3fa55b===_0x229ce4){_0x2fdac5[_0x129236]=_0x4afd9b[_0x2186('0x3c')];}}});}return _0x2fdac5;}function getTicket(_0x152de7,_0x19053e,_0x20aef4,_0x3dd8ea,_0x2d7b30,_0x2d2f6d,_0x4dbd4f){return new BPromise(function(_0x590959,_0xd1d638){var _0x22b3b0;return getAuthToken(_0x19053e,_0x20aef4,_0x4dbd4f)[_0x2186('0x16')](function(_0x55052d){if(_0x2d2f6d[_0x2186('0x3d')]===_0x2186('0x3e')){_0x22b3b0={'method':_0x2186('0xd'),'uri':_0x3dd8ea+_0x2186('0x3f'),'body':Object['assign']({},{'title':intUtil[_0x2186('0x40')](_0x2d2f6d[_0x2186('0x41')],_0x2d7b30,'\x20'),'description':intUtil[_0x2186('0x40')](_0x2d2f6d[_0x2186('0x42')],_0x2d7b30,'\x0a'),'customerid_contact@odata.bind':_0x2186('0x43')+_0x152de7[_0x2186('0x32')]+')','ownerid@odata.bind':'/systemusers('+_0x152de7[_0x2186('0x24')]+')','caseorigincode':'1'},getCustomFields(_0x2d2f6d['Fields'],_0x2d7b30,_0x2d2f6d['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x55052d,'OData-Version':_0x2186('0x2c')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2d2f6d[_0x2186('0x3d')]==='phonecall'){_0x22b3b0={'method':_0x2186('0xd'),'uri':_0x3dd8ea+_0x2186('0x44'),'body':Object[_0x2186('0x45')]({},{'subject':intUtil[_0x2186('0x40')](_0x2d2f6d['Subjects'],_0x2d7b30,'\x20'),'phonenumber':String(_0x2d7b30['calleridnum']),'description':intUtil['getString'](_0x2d2f6d[_0x2186('0x42')],_0x2d7b30,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x152de7[_0x2186('0x32')]+')','ownerid@odata.bind':_0x2186('0x46')+_0x152de7[_0x2186('0x24')]+')','directioncode':_0x152de7[_0x2186('0x47')]==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x2186('0x46')+_0x152de7[_0x2186('0x24')]+')','participationtypemask':_0x152de7[_0x2186('0x47')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x2186('0x43')+_0x152de7[_0x2186('0x32')]+')','participationtypemask':_0x152de7[_0x2186('0x47')]===_0x2186('0x48')?0x1:0x2}]},getCustomFields(_0x2d2f6d[_0x2186('0x49')],_0x2d7b30,_0x2d2f6d[_0x2186('0x3d')])),'headers':{'Authorization':_0x2186('0x19')+_0x55052d,'OData-Version':_0x2186('0x2c')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x22b3b0);})[_0x2186('0x16')](function(_0xbb3903){var _0xa920da=_0xbb3903[_0x2186('0x2d')][_0x2186('0x4a')];var _0x5e4ae1=_0xa920da[_0x2186('0x2e')](_0xa920da[_0x2186('0x2f')]('(')+0x1,_0xa920da[_0x2186('0x2f')](')'));_0x152de7[_0x2186('0x4b')]=_0x5e4ae1;_0x590959(_0x152de7);})[_0x2186('0x12')](function(_0x50d1e0){_0xd1d638(_0x50d1e0[_0x2186('0x26')]);});});}function emit(_0x5265e5,_0x41b292,_0xb67ee0,_0x406a1b){var _0x27c185={'uri':util['format'](_0x2186('0x4c'),_0x5265e5,_0xb67ee0,_0x406a1b)};io['to'](util[_0x2186('0x4d')]('user:%s',_0x41b292))[_0x2186('0x4e')]('trigger:browser:url',_0x27c185);}exports['cs']=function(_0x19ea6f,_0x300db5,_0x33862a,_0x4f4f9c,_0x3aaa5b,_0x304ad5,_0x3f7e2c,_0x358019){var _0x4b0e99={};_0x304ad5['remoteUri']=intUtil[_0x2186('0x4f')](_0x304ad5[_0x2186('0x50')]);_0x304ad5[_0x2186('0x51')]=intUtil[_0x2186('0x4f')](_0x304ad5[_0x2186('0x51')]);_0x4b0e99[_0x2186('0x47')]=_0x358019===_0x2186('0x48')||_0x358019==='unmanaged'?'queue':_0x2186('0x28');var _0x398ea2=util['format'](_0x2186('0x52'),_0x304ad5['remoteUri']);var _0x38e791=util[_0x2186('0x4d')](_0x2186('0x53'),_0x304ad5[_0x2186('0x54')]);var _0x532846=util[_0x2186('0x4d')](_0x2186('0x55'),_0x304ad5[_0x2186('0x51')],_0x300db5['uniqueid'],md5(_0x300db5['uniqueid']));if(_0x3aaa5b&&_0x3aaa5b[_0x2186('0x56')]){logger[_0x2186('0x21')](_0x2186('0x57'),_0x2186('0x58'));_0x300db5[_0x2186('0x59')]=_0x532846;}else if(_0x3f7e2c&&_0x3f7e2c[_0x2186('0x5a')]&&_0x3f7e2c[_0x2186('0x5a')]!==_0x2186('0x5b')){logger[_0x2186('0x21')](_0x2186('0x5c'),'Recording\x20is\x20enabled!');_0x300db5[_0x2186('0x59')]=_0x532846;}else{_0x300db5['recordingURL']='';}return getUser(_0x4b0e99,_0x304ad5,_0x4f4f9c,_0x38e791,_0x398ea2,_0x358019)[_0x2186('0x16')](function(_0x9eb7f8){logger[_0x2186('0x21')]('['+_0x358019[_0x2186('0x14')]()+']\x20The\x20User\x20ID\x20is:',_0x9eb7f8[_0x2186('0x24')]);logger[_0x2186('0x21')]('['+_0x358019[_0x2186('0x14')]()+_0x2186('0x5d'),_0x9eb7f8[_0x2186('0x1d')]);return getEndUser(_0x9eb7f8,_0x304ad5,_0x38e791,_0x398ea2,_0x300db5,_0x358019);})[_0x2186('0x16')](function(_0x655456){logger[_0x2186('0x21')]('['+_0x358019[_0x2186('0x14')]()+_0x2186('0x5e'),_0x655456[_0x2186('0x32')]);logger[_0x2186('0x21')]('['+_0x358019['toUpperCase']()+_0x2186('0x5f'),_0x300db5[_0x2186('0x2a')]);return getTicket(_0x655456,_0x304ad5,_0x38e791,_0x398ea2,_0x300db5,_0x33862a,_0x358019);})[_0x2186('0x16')](function(_0x7dfc95){logger[_0x2186('0x21')](util[_0x2186('0x4d')]('['+_0x358019[_0x2186('0x14')]()+_0x2186('0x60'),_0x33862a[_0x2186('0x3d')],_0x7dfc95[_0x2186('0x4b')]));logger[_0x2186('0x21')](util[_0x2186('0x4d')]('['+_0x358019[_0x2186('0x14')]()+_0x2186('0x61'),_0x358019));if(_0x358019!==_0x2186('0x62')){logger['info']('['+_0x358019[_0x2186('0x14')]()+']',_0x2186('0x63'));emit(_0x304ad5['remoteUri'],_0x4f4f9c['name'],_0x33862a['ticketType'],_0x7dfc95[_0x2186('0x4b')]);}})[_0x2186('0x12')](function(_0x131140){logger[_0x2186('0x13')]('['+_0x358019[_0x2186('0x14')]()+_0x2186('0x64'),util['inspect'](_0x131140,{'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 dbbfb3e..bf2fc20 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 _0x7cff=['uniqueid','Authorization','email','calleridnum','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','recordingURL','lastevent','request-promise','md5','util','ioredis','./util','../../../../config/environment','freshdesk','socket.io-emitter','redis','application/json','emit','info','merge','format','Caller\x20-\x20%s','calleridname','getString','Subjects','Descriptions','
','Tags','name','Fields','keyBy','value','remoteUri','Ticket\x20created!','validateEmail','then','length','Agent\x20found!','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20created.','Basic\x20%s','toString','base64','stringify','defaults','GET','map','forEach','includes','picklist','nameField','toLowerCase','content','type','idField','custom_fields','push','variableName','customField','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s'];(function(_0x4f7c86,_0x1f495f){var _0x330af6=function(_0x56f1a7){while(--_0x56f1a7){_0x4f7c86['push'](_0x4f7c86['shift']());}};_0x330af6(++_0x1f495f);}(_0x7cff,0x1cc));var _0xf7cf=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x7cff[_0x82129b];return _0x2ae5dc;};'use strict';var _=require('lodash');var rp=require(_0xf7cf('0x0'));var md5=require(_0xf7cf('0x1'));var util=require(_0xf7cf('0x2'));var Redis=require(_0xf7cf('0x3'));var intUtil=require(_0xf7cf('0x4'));var config=require(_0xf7cf('0x5'));var logger=require('../../../../config/logger')(_0xf7cf('0x6'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xf7cf('0x7'))(new Redis(config[_0xf7cf('0x8')]));var headers={'Content-Type':_0xf7cf('0x9'),'Accept':_0xf7cf('0x9')};function emit(_0x3d5ca0,_0x4c29e7,_0x4e4c7e){io['to'](_0x3d5ca0)[_0xf7cf('0xa')](_0x4c29e7,_0x4e4c7e);}function getTicket(_0x417c62,_0x19742e,_0x2ed06f,_0x30a9cc,_0xe12823){logger[_0xf7cf('0xb')]('Creating\x20new\x20ticket...');var _0x2d9d36=_[_0xf7cf('0xc')]({'responder_id':_0x19742e['id'],'requester_id':_0x2ed06f['id'],'name':util[_0xf7cf('0xd')](_0xf7cf('0xe'),_0xe12823[_0xf7cf('0xf')]),'phone':_0xe12823['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xf7cf('0x10')](_0x30a9cc[_0xf7cf('0x11')],_0xe12823,'\x20'),'description':intUtil['getString'](_0x30a9cc[_0xf7cf('0x12')],_0xe12823,_0xf7cf('0x13')),'tags':getTags(_0x30a9cc[_0xf7cf('0x14')],_0xf7cf('0x15'))},getCustomFields(_0x30a9cc[_0xf7cf('0x16')],_0xe12823));_0x2d9d36['custom_fields']=_['mapValues'](_[_0xf7cf('0x17')](_0x2d9d36['custom_fields'],'id'),_0xf7cf('0x18'));return request({'uri':util[_0xf7cf('0xd')]('%s/api/v2/tickets',_0x417c62[_0xf7cf('0x19')]),'method':'POST','body':_0x2d9d36})['then'](function(_0x3c5df9){logger[_0xf7cf('0xb')](_0xf7cf('0x1a'));return _0x3c5df9;});}function getUser(_0x4579c2,_0x34d369){if(intUtil[_0xf7cf('0x1b')](_0x34d369)){return request({'uri':util[_0xf7cf('0xd')]('%s/api/v2/agents',_0x4579c2[_0xf7cf('0x19')]),'qs':{'email':_0x34d369}})[_0xf7cf('0x1c')](function(_0xdc147){if(_0xdc147[_0xf7cf('0x1d')]){logger[_0xf7cf('0xb')](_0xf7cf('0x1e'));return _[_0xf7cf('0x1f')](_0xdc147,function(_0x42ba04){return _0x42ba04[_0xf7cf('0x20')]['email']===_0x34d369;});}else{logger[_0xf7cf('0xb')](_0xf7cf('0x21'));return request({'uri':util[_0xf7cf('0xd')](_0xf7cf('0x22'),_0x4579c2[_0xf7cf('0x19')])})['then'](function(_0x141948){logger[_0xf7cf('0xb')](_0xf7cf('0x23'));return _0x141948;});}});}else{logger[_0xf7cf('0xb')](_0xf7cf('0x24'));return request({'uri':util[_0xf7cf('0xd')](_0xf7cf('0x22'),_0x4579c2[_0xf7cf('0x19')])})[_0xf7cf('0x1c')](function(_0x3dd260){logger['info'](_0xf7cf('0x23'));return _0x3dd260;});}}function getEndUser(_0x270f06,_0x117d9f,_0x5c420c){logger[_0xf7cf('0xb')]('Searching\x20enduser\x20with\x20phone',_0x5c420c);return request({'uri':util[_0xf7cf('0xd')](_0xf7cf('0x25'),_0x270f06['remoteUri']),'qs':{'phone':_0x5c420c}})[_0xf7cf('0x1c')](function(_0x54d812){if(_0x54d812[_0xf7cf('0x1d')]){logger['info'](_0xf7cf('0x26'));return _['find'](_0x54d812,{'phone':_0x5c420c});}else{logger[_0xf7cf('0xb')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xf7cf('0xd')](_0xf7cf('0x25'),_0x270f06['remoteUri']),'method':'POST','body':{'name':_0x117d9f,'phone':_0x5c420c}})[_0xf7cf('0x1c')](function(_0x1037c9){logger[_0xf7cf('0xb')](_0xf7cf('0x27'));return _0x1037c9;});}});}function getAuth(_0x5eac7a){return util[_0xf7cf('0xd')](_0xf7cf('0x28'),new Buffer(_0x5eac7a['apiKey']+':X')[_0xf7cf('0x29')](_0xf7cf('0x2a')));}function request(_0x1affc1){logger['debug']('[HTTP]',JSON[_0xf7cf('0x2b')](_0x1affc1));return rp(_[_0xf7cf('0x2c')](_0x1affc1,{'method':_0xf7cf('0x2d'),'headers':headers,'json':!![]}));}function getTags(_0x2c63c0,_0x41cb8e){var _0x3e6510=[];if(_0x2c63c0&&_0x2c63c0[_0xf7cf('0x1d')]>0x0){_0x3e6510=_[_0xf7cf('0x2e')](_0x2c63c0,_0x41cb8e);}return _0x3e6510;}function getCustomFields(_0x3f841b,_0x153e6c){var _0x310424=[];var _0x4986f9={'custom_fields':[]};if(_0x3f841b[_0xf7cf('0x1d')]>0x0){_[_0xf7cf('0x2f')](_0x3f841b,function(_0x11ef29){if(_[_0xf7cf('0x30')](['string',_0xf7cf('0x31')],_0x11ef29['type'])&&_0x11ef29[_0xf7cf('0x32')]&&!_0x11ef29['customField']){_0x4986f9[_0x11ef29['nameField'][_0xf7cf('0x33')]()]=_0x11ef29[_0xf7cf('0x34')][_0xf7cf('0x29')]();}else if(_[_0xf7cf('0x30')](['string',_0xf7cf('0x31')],_0x11ef29[_0xf7cf('0x35')])&&_0x11ef29[_0xf7cf('0x36')]&&_0x11ef29['customField']){_0x4986f9[_0xf7cf('0x37')][_0xf7cf('0x38')]({'id':_0x11ef29[_0xf7cf('0x36')],'value':_0x11ef29[_0xf7cf('0x34')][_0xf7cf('0x29')]()});}else if(_0x11ef29[_0xf7cf('0x35')]==='variable'&&_0x11ef29[_0xf7cf('0x39')]&&_0x11ef29['idField']&&_0x11ef29[_0xf7cf('0x3a')]){_0x153e6c[_0x11ef29[_0xf7cf('0x39')]]&&_0x4986f9['custom_fields'][_0xf7cf('0x38')]({'id':_0x11ef29[_0xf7cf('0x36')],'value':_0x153e6c[_0x11ef29[_0xf7cf('0x39')]][_0xf7cf('0x29')]()});}else if(_0x11ef29[_0xf7cf('0x35')]===_0xf7cf('0x3b')&&_0x11ef29[_0xf7cf('0x3c')]&&_0x11ef29[_0xf7cf('0x3c')][_0xf7cf('0x15')]&&_0x11ef29['idField']&&_0x11ef29[_0xf7cf('0x3a')]){_0x153e6c[_0x11ef29[_0xf7cf('0x3c')][_0xf7cf('0x15')][_0xf7cf('0x33')]()]&&_0x4986f9['custom_fields'][_0xf7cf('0x38')]({'id':_0x11ef29[_0xf7cf('0x36')],'value':_0x153e6c[_0x11ef29[_0xf7cf('0x3c')][_0xf7cf('0x15')][_0xf7cf('0x33')]()][_0xf7cf('0x29')]()});}});}return _0x4986f9;}exports[_0xf7cf('0x3d')]=function(_0x22a387,_0x5ae3e9,_0x48545f,_0x16b8d3,_0x3562bb,_0x1b346b){var _0x1c8815,_0x58fcc8;_0x1b346b[_0xf7cf('0x19')]=intUtil[_0xf7cf('0x3e')](_0x1b346b[_0xf7cf('0x19')]);_0x1b346b[_0xf7cf('0x3f')]=intUtil[_0xf7cf('0x3e')](_0x1b346b[_0xf7cf('0x3f')]);if(_0x3562bb&&_0x3562bb[_0xf7cf('0x40')]){logger[_0xf7cf('0xb')](_0xf7cf('0x41'),_0xf7cf('0x42'));_0x5ae3e9['recordingURL']=util[_0xf7cf('0xd')](_0xf7cf('0x43'),_0x1b346b[_0xf7cf('0x3f')],_0x5ae3e9[_0xf7cf('0x44')],md5(_0x5ae3e9[_0xf7cf('0x44')]));}else{_0x5ae3e9['recordingURL']='';}headers[_0xf7cf('0x45')]=getAuth(_0x1b346b);return getUser(_0x1b346b,_0x16b8d3[_0xf7cf('0x46')])['then'](function(_0x399f0e){_0x1c8815=_0x399f0e;logger['info']('The\x20User\x20ID\x20is:',_0x1c8815['id']);return getEndUser(_0x1b346b,_0x5ae3e9['calleridname'],_0x5ae3e9[_0xf7cf('0x47')]);})[_0xf7cf('0x1c')](function(_0x3df069){_0x58fcc8=_0x3df069;logger[_0xf7cf('0xb')]('The\x20Enduser\x20ID\x20is:',_0x58fcc8['id']);return getTicket(_0x1b346b,_0x1c8815,_0x58fcc8,_0x48545f,_0x5ae3e9);})[_0xf7cf('0x1c')](function(_0x5e6e17){if(_0x5e6e17&&_0x5e6e17['id']){logger['info'](_0xf7cf('0x1a'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x5e6e17['id']);logger[_0xf7cf('0xb')](_0xf7cf('0x41'),_0xf7cf('0x48'));emit(util['format'](_0xf7cf('0x49'),_0x16b8d3[_0xf7cf('0x15')]),_0xf7cf('0x4a'),{'uri':util[_0xf7cf('0xd')](_0xf7cf('0x4b'),_0x1b346b[_0xf7cf('0x19')],_0x5e6e17['id'])});}})[_0xf7cf('0x4c')](function(_0x45486d){logger[_0xf7cf('0x4d')](_0xf7cf('0x41'),JSON[_0xf7cf('0x2b')](_0x45486d));});};exports[_0xf7cf('0x4e')]=function(_0x809541,_0x362ed0,_0x296204,_0x1a50af,_0x492516,_0x1fe93b,_0x2fa2e0){var _0x24133d,_0x254b0e;_0x1fe93b['remoteUri']=intUtil[_0xf7cf('0x3e')](_0x1fe93b[_0xf7cf('0x19')]);_0x1fe93b['serverUrl']=intUtil[_0xf7cf('0x3e')](_0x1fe93b[_0xf7cf('0x3f')]);if(_0x2fa2e0&&_0x2fa2e0[_0xf7cf('0x4f')]&&_0x2fa2e0[_0xf7cf('0x4f')]!==_0xf7cf('0x50')){logger[_0xf7cf('0xb')](_0xf7cf('0x51'),'Recording\x20is\x20enabled!');_0x362ed0['recordingURL']=util[_0xf7cf('0xd')](_0xf7cf('0x43'),_0x1fe93b[_0xf7cf('0x3f')],_0x362ed0[_0xf7cf('0x44')],md5(_0x362ed0[_0xf7cf('0x44')]));}headers[_0xf7cf('0x45')]=getAuth(_0x1fe93b);return getUser(_0x1fe93b,_0x1a50af[_0xf7cf('0x46')])[_0xf7cf('0x1c')](function(_0x35d16f){_0x24133d=_0x35d16f;logger[_0xf7cf('0xb')](_0xf7cf('0x52'),_0x24133d['id']);return getEndUser(_0x1fe93b,_0x362ed0[_0xf7cf('0x53')],_0x362ed0[_0xf7cf('0x54')]);})[_0xf7cf('0x1c')](function(_0x3401d5){_0x254b0e=_0x3401d5;logger[_0xf7cf('0xb')](_0xf7cf('0x55'),_0x254b0e['id']);return getTicket(_0x1fe93b,_0x24133d,_0x254b0e,_0x296204,_0x362ed0);})[_0xf7cf('0x1c')](function(_0x51826a){if(_0x51826a&&_0x51826a['id']){logger['info'](_0xf7cf('0x1a'));logger[_0xf7cf('0xb')]('The\x20Ticket\x20ID\x20is:',_0x51826a['id']);logger[_0xf7cf('0xb')](_0xf7cf('0x51'),_0xf7cf('0x48'));emit(util['format']('user:%s',_0x1a50af[_0xf7cf('0x15')]),_0xf7cf('0x4a'),{'uri':util[_0xf7cf('0xd')](_0xf7cf('0x4b'),_0x1fe93b[_0xf7cf('0x19')],_0x51826a['id'])});}})[_0xf7cf('0x4c')](function(_0x5dd406){logger[_0xf7cf('0x4d')]('[OUTBOUND]',JSON[_0xf7cf('0x2b')](_0x5dd406));});};exports['unmanaged']=function(_0x38b865,_0x3f3a80,_0x332519,_0x25e9ad,_0x2b4790,_0x3ea270){var _0x52facc,_0xf32f7c;_0x3ea270['remoteUri']=intUtil[_0xf7cf('0x3e')](_0x3ea270[_0xf7cf('0x19')]);_0x3ea270['serverUrl']=intUtil[_0xf7cf('0x3e')](_0x3ea270[_0xf7cf('0x3f')]);if(_0x2b4790&&_0x2b4790[_0xf7cf('0x40')]){logger[_0xf7cf('0xb')]('['+_0x3f3a80['lastevent']['toUpperCase']()+']',_0xf7cf('0x42'));_0x3f3a80['recordingURL']=util['format'](_0xf7cf('0x43'),_0x3ea270[_0xf7cf('0x3f')],_0x3f3a80[_0xf7cf('0x44')],md5(_0x3f3a80[_0xf7cf('0x44')]));}else{_0x3f3a80[_0xf7cf('0x56')]='';}headers[_0xf7cf('0x45')]=getAuth(_0x3ea270);return getUser(_0x3ea270,'')[_0xf7cf('0x1c')](function(_0x1a1839){_0x52facc=_0x1a1839;logger['info']('The\x20User\x20ID\x20is:',_0x52facc['id']);return getEndUser(_0x3ea270,_0x3f3a80['calleridname'],_0x3f3a80[_0xf7cf('0x47')]);})[_0xf7cf('0x1c')](function(_0x4dc9d1){_0xf32f7c=_0x4dc9d1;logger[_0xf7cf('0xb')](_0xf7cf('0x55'),_0xf32f7c['id']);return getTicket(_0x3ea270,_0x52facc,_0xf32f7c,_0x332519,_0x3f3a80);})[_0xf7cf('0x1c')](function(_0x2c082b){if(_0x2c082b){logger[_0xf7cf('0xb')](_0xf7cf('0x1a'));logger[_0xf7cf('0xb')]('The\x20Ticket\x20ID\x20is:',_0x2c082b['id']);}})[_0xf7cf('0x4c')](function(_0x466b28){logger[_0xf7cf('0x4d')]('['+_0x3f3a80[_0xf7cf('0x57')]['toUpperCase']()+']',JSON['stringify'](_0x466b28));});}; \ No newline at end of file +var _0xb014=['debug','[HTTP]','GET','map','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','idField','variable','variableName','push','customVariable','Variable','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','[QUEUE]','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','error','stringify','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','unmanaged','lastevent','toUpperCase','The\x20Enduser\x20ID\x20is:','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','freshdesk','defaults','redis','localhost','application/json','emit','info','Creating\x20new\x20ticket...','merge','calleridname','getString','Subjects','Descriptions','
','name','Fields','custom_fields','mapValues','keyBy','value','format','%s/api/v2/tickets','remoteUri','POST','then','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xb014,0x158));var _0x4b01=function(_0x23ca4d,_0x5c2a32){_0x23ca4d=_0x23ca4d-0x0;var _0x435432=_0xb014[_0x23ca4d];return _0x435432;};'use strict';var _=require(_0x4b01('0x0'));var rp=require(_0x4b01('0x1'));var md5=require(_0x4b01('0x2'));var util=require(_0x4b01('0x3'));var Redis=require('ioredis');var intUtil=require(_0x4b01('0x4'));var config=require(_0x4b01('0x5'));var logger=require(_0x4b01('0x6'))(_0x4b01('0x7'));config['redis']=_[_0x4b01('0x8')](config[_0x4b01('0x9')],{'host':_0x4b01('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var headers={'Content-Type':_0x4b01('0xb'),'Accept':'application/json'};function emit(_0x319be1,_0x25d5a7,_0x2d59e1){io['to'](_0x319be1)[_0x4b01('0xc')](_0x25d5a7,_0x2d59e1);}function getTicket(_0x988726,_0x56bff6,_0x231184,_0x52793c,_0x219d71){logger[_0x4b01('0xd')](_0x4b01('0xe'));var _0xfdadef=_[_0x4b01('0xf')]({'responder_id':_0x56bff6['id'],'requester_id':_0x231184['id'],'name':util['format']('Caller\x20-\x20%s',_0x219d71[_0x4b01('0x10')]),'phone':_0x219d71['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x4b01('0x11')](_0x52793c[_0x4b01('0x12')],_0x219d71,'\x20'),'description':intUtil[_0x4b01('0x11')](_0x52793c[_0x4b01('0x13')],_0x219d71,_0x4b01('0x14')),'tags':getTags(_0x52793c['Tags'],_0x4b01('0x15'))},getCustomFields(_0x52793c[_0x4b01('0x16')],_0x219d71));_0xfdadef[_0x4b01('0x17')]=_[_0x4b01('0x18')](_[_0x4b01('0x19')](_0xfdadef['custom_fields'],'id'),_0x4b01('0x1a'));return request({'uri':util[_0x4b01('0x1b')](_0x4b01('0x1c'),_0x988726[_0x4b01('0x1d')]),'method':_0x4b01('0x1e'),'body':_0xfdadef})[_0x4b01('0x1f')](function(_0x35a014){logger[_0x4b01('0xd')]('Ticket\x20created!');return _0x35a014;});}function getUser(_0x2a7c3f,_0x4c8edf){if(intUtil[_0x4b01('0x20')](_0x4c8edf)){return request({'uri':util[_0x4b01('0x1b')](_0x4b01('0x21'),_0x2a7c3f[_0x4b01('0x1d')]),'qs':{'email':_0x4c8edf}})[_0x4b01('0x1f')](function(_0x284152){if(_0x284152[_0x4b01('0x22')]){logger[_0x4b01('0xd')](_0x4b01('0x23'));return _[_0x4b01('0x24')](_0x284152,function(_0x3f3a0b){return _0x3f3a0b[_0x4b01('0x25')][_0x4b01('0x26')]===_0x4c8edf;});}else{logger[_0x4b01('0xd')](_0x4b01('0x27'));return request({'uri':util[_0x4b01('0x1b')](_0x4b01('0x28'),_0x2a7c3f[_0x4b01('0x1d')])})[_0x4b01('0x1f')](function(_0x249302){logger['info'](_0x4b01('0x29'));return _0x249302;});}});}else{logger[_0x4b01('0xd')](_0x4b01('0x2a'));return request({'uri':util[_0x4b01('0x1b')](_0x4b01('0x28'),_0x2a7c3f[_0x4b01('0x1d')])})[_0x4b01('0x1f')](function(_0x226e93){logger[_0x4b01('0xd')](_0x4b01('0x29'));return _0x226e93;});}}function getEndUser(_0x3d5e2d,_0x9a672a,_0x49b7d3){logger['info'](_0x4b01('0x2b'),_0x49b7d3);return request({'uri':util[_0x4b01('0x1b')]('%s/api/v2/contacts',_0x3d5e2d[_0x4b01('0x1d')]),'qs':{'phone':_0x49b7d3}})[_0x4b01('0x1f')](function(_0x405753){if(_0x405753['length']){logger[_0x4b01('0xd')](_0x4b01('0x2c'));return _[_0x4b01('0x24')](_0x405753,{'phone':_0x49b7d3});}else{logger[_0x4b01('0xd')](_0x4b01('0x2d'));return request({'uri':util[_0x4b01('0x1b')](_0x4b01('0x2e'),_0x3d5e2d[_0x4b01('0x1d')]),'method':'POST','body':{'name':_0x9a672a,'phone':_0x49b7d3}})[_0x4b01('0x1f')](function(_0x3e27ee){logger[_0x4b01('0xd')](_0x4b01('0x2f'));return _0x3e27ee;});}});}function getAuth(_0x56c8ca){return util[_0x4b01('0x1b')](_0x4b01('0x30'),new Buffer(_0x56c8ca[_0x4b01('0x31')]+':X')[_0x4b01('0x32')](_0x4b01('0x33')));}function request(_0x17122f){logger[_0x4b01('0x34')](_0x4b01('0x35'),JSON['stringify'](_0x17122f));return rp(_[_0x4b01('0x8')](_0x17122f,{'method':_0x4b01('0x36'),'headers':headers,'json':!![]}));}function getTags(_0x2fe398,_0x3c3856){var _0x2b663f=[];if(_0x2fe398&&_0x2fe398['length']>0x0){_0x2b663f=_[_0x4b01('0x37')](_0x2fe398,_0x3c3856);}return _0x2b663f;}function getCustomFields(_0x377aa4,_0xfb00e8){var _0x1840fc=[];var _0xb35555={'custom_fields':[]};if(_0x377aa4[_0x4b01('0x22')]>0x0){_[_0x4b01('0x38')](_0x377aa4,function(_0x56c896){if(_[_0x4b01('0x39')](['string',_0x4b01('0x3a')],_0x56c896[_0x4b01('0x3b')])&&_0x56c896[_0x4b01('0x3c')]&&!_0x56c896[_0x4b01('0x3d')]){_0xb35555[_0x56c896['nameField'][_0x4b01('0x3e')]()]=_0x56c896[_0x4b01('0x3f')]['toString']();}else if(_[_0x4b01('0x39')](['string',_0x4b01('0x3a')],_0x56c896[_0x4b01('0x3b')])&&_0x56c896[_0x4b01('0x40')]&&_0x56c896[_0x4b01('0x3d')]){_0xb35555['custom_fields']['push']({'id':_0x56c896['idField'],'value':_0x56c896[_0x4b01('0x3f')]['toString']()});}else if(_0x56c896['type']===_0x4b01('0x41')&&_0x56c896[_0x4b01('0x42')]&&_0x56c896[_0x4b01('0x40')]&&_0x56c896[_0x4b01('0x3d')]){_0xfb00e8[_0x56c896[_0x4b01('0x42')]]&&_0xb35555[_0x4b01('0x17')][_0x4b01('0x43')]({'id':_0x56c896['idField'],'value':_0xfb00e8[_0x56c896[_0x4b01('0x42')]]['toString']()});}else if(_0x56c896['type']===_0x4b01('0x44')&&_0x56c896[_0x4b01('0x45')]&&_0x56c896[_0x4b01('0x45')][_0x4b01('0x15')]&&_0x56c896[_0x4b01('0x40')]&&_0x56c896[_0x4b01('0x3d')]){_0xfb00e8[_0x56c896[_0x4b01('0x45')][_0x4b01('0x15')][_0x4b01('0x3e')]()]&&_0xb35555[_0x4b01('0x17')][_0x4b01('0x43')]({'id':_0x56c896[_0x4b01('0x40')],'value':_0xfb00e8[_0x56c896['Variable'][_0x4b01('0x15')][_0x4b01('0x3e')]()][_0x4b01('0x32')]()});}});}return _0xb35555;}exports['queue']=function(_0x241a81,_0x498be3,_0x1cfd0e,_0x3f7c49,_0x367d1f,_0x409c6f){var _0x364c32,_0x24e46d;_0x409c6f[_0x4b01('0x1d')]=intUtil['stripTrailingSlash'](_0x409c6f['remoteUri']);_0x409c6f[_0x4b01('0x46')]=intUtil[_0x4b01('0x47')](_0x409c6f['serverUrl']);if(_0x367d1f&&_0x367d1f[_0x4b01('0x48')]){logger['info']('[QUEUE]',_0x4b01('0x49'));_0x498be3[_0x4b01('0x4a')]=util[_0x4b01('0x1b')](_0x4b01('0x4b'),_0x409c6f[_0x4b01('0x46')],_0x498be3[_0x4b01('0x4c')],md5(_0x498be3[_0x4b01('0x4c')]));}else{_0x498be3[_0x4b01('0x4a')]='';}headers[_0x4b01('0x4d')]=getAuth(_0x409c6f);return getUser(_0x409c6f,_0x3f7c49[_0x4b01('0x26')])[_0x4b01('0x1f')](function(_0x337c45){_0x364c32=_0x337c45;logger[_0x4b01('0xd')](_0x4b01('0x4e'),_0x364c32['id']);return getEndUser(_0x409c6f,_0x498be3[_0x4b01('0x10')],_0x498be3[_0x4b01('0x4f')]);})[_0x4b01('0x1f')](function(_0x3d52af){_0x24e46d=_0x3d52af;logger[_0x4b01('0xd')]('The\x20Enduser\x20ID\x20is:',_0x24e46d['id']);return getTicket(_0x409c6f,_0x364c32,_0x24e46d,_0x1cfd0e,_0x498be3);})['then'](function(_0x2ea55b){if(_0x2ea55b&&_0x2ea55b['id']){logger[_0x4b01('0xd')](_0x4b01('0x50'));logger[_0x4b01('0xd')](_0x4b01('0x51'),_0x2ea55b['id']);logger[_0x4b01('0xd')](_0x4b01('0x52'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x4b01('0x1b')](_0x4b01('0x53'),_0x3f7c49[_0x4b01('0x15')]),_0x4b01('0x54'),{'uri':util[_0x4b01('0x1b')](_0x4b01('0x55'),_0x409c6f[_0x4b01('0x1d')],_0x2ea55b['id'])});}})['catch'](function(_0x466801){logger[_0x4b01('0x56')](_0x4b01('0x52'),JSON[_0x4b01('0x57')](_0x466801));});};exports[_0x4b01('0x58')]=function(_0x3b99fe,_0x2b8cf3,_0x51ebf1,_0x40aca5,_0x162f63,_0x4c8015,_0x2fc8da){var _0x5f667b,_0x42cd5a;_0x4c8015[_0x4b01('0x1d')]=intUtil[_0x4b01('0x47')](_0x4c8015[_0x4b01('0x1d')]);_0x4c8015[_0x4b01('0x46')]=intUtil[_0x4b01('0x47')](_0x4c8015['serverUrl']);if(_0x2fc8da&&_0x2fc8da['recordingFormat']&&_0x2fc8da[_0x4b01('0x59')]!=='none'){logger[_0x4b01('0xd')](_0x4b01('0x5a'),_0x4b01('0x49'));_0x2b8cf3['recordingURL']=util[_0x4b01('0x1b')](_0x4b01('0x4b'),_0x4c8015[_0x4b01('0x46')],_0x2b8cf3[_0x4b01('0x4c')],md5(_0x2b8cf3[_0x4b01('0x4c')]));}headers['Authorization']=getAuth(_0x4c8015);return getUser(_0x4c8015,_0x40aca5[_0x4b01('0x26')])['then'](function(_0x419741){_0x5f667b=_0x419741;logger[_0x4b01('0xd')]('The\x20User\x20ID\x20is:',_0x5f667b['id']);return getEndUser(_0x4c8015,_0x2b8cf3[_0x4b01('0x5b')],_0x2b8cf3[_0x4b01('0x5c')]);})[_0x4b01('0x1f')](function(_0x4f6cc9){_0x42cd5a=_0x4f6cc9;logger['info']('The\x20Enduser\x20ID\x20is:',_0x42cd5a['id']);return getTicket(_0x4c8015,_0x5f667b,_0x42cd5a,_0x51ebf1,_0x2b8cf3);})[_0x4b01('0x1f')](function(_0x669a23){if(_0x669a23&&_0x669a23['id']){logger['info'](_0x4b01('0x50'));logger[_0x4b01('0xd')]('The\x20Ticket\x20ID\x20is:',_0x669a23['id']);logger[_0x4b01('0xd')]('[OUTBOUND]',_0x4b01('0x5d'));emit(util[_0x4b01('0x1b')]('user:%s',_0x40aca5[_0x4b01('0x15')]),_0x4b01('0x54'),{'uri':util[_0x4b01('0x1b')](_0x4b01('0x55'),_0x4c8015[_0x4b01('0x1d')],_0x669a23['id'])});}})[_0x4b01('0x5e')](function(_0x1d4fe5){logger[_0x4b01('0x56')](_0x4b01('0x5a'),JSON['stringify'](_0x1d4fe5));});};exports[_0x4b01('0x5f')]=function(_0x314a0d,_0x3653e5,_0x400d02,_0x46ae65,_0x2409f5,_0x4413b5){var _0x458daf,_0x5888ab;_0x4413b5[_0x4b01('0x1d')]=intUtil[_0x4b01('0x47')](_0x4413b5[_0x4b01('0x1d')]);_0x4413b5[_0x4b01('0x46')]=intUtil[_0x4b01('0x47')](_0x4413b5[_0x4b01('0x46')]);if(_0x2409f5&&_0x2409f5['monitor_format']){logger[_0x4b01('0xd')]('['+_0x3653e5[_0x4b01('0x60')][_0x4b01('0x61')]()+']',_0x4b01('0x49'));_0x3653e5[_0x4b01('0x4a')]=util[_0x4b01('0x1b')](_0x4b01('0x4b'),_0x4413b5[_0x4b01('0x46')],_0x3653e5[_0x4b01('0x4c')],md5(_0x3653e5[_0x4b01('0x4c')]));}else{_0x3653e5['recordingURL']='';}headers[_0x4b01('0x4d')]=getAuth(_0x4413b5);return getUser(_0x4413b5,'')[_0x4b01('0x1f')](function(_0x12a579){_0x458daf=_0x12a579;logger[_0x4b01('0xd')](_0x4b01('0x4e'),_0x458daf['id']);return getEndUser(_0x4413b5,_0x3653e5[_0x4b01('0x10')],_0x3653e5[_0x4b01('0x4f')]);})[_0x4b01('0x1f')](function(_0x56f290){_0x5888ab=_0x56f290;logger['info'](_0x4b01('0x62'),_0x5888ab['id']);return getTicket(_0x4413b5,_0x458daf,_0x5888ab,_0x400d02,_0x3653e5);})[_0x4b01('0x1f')](function(_0xbcbf4c){if(_0xbcbf4c){logger['info'](_0x4b01('0x50'));logger[_0x4b01('0xd')](_0x4b01('0x51'),_0xbcbf4c['id']);}})[_0x4b01('0x5e')](function(_0x10dc79){logger[_0x4b01('0x56')]('['+_0x3653e5[_0x4b01('0x60')]['toUpperCase']()+']',JSON[_0x4b01('0x57')](_0x10dc79));});}; \ 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 6c3239b..64adaa1 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 _0x7406=['./util','../../../../config/environment','freshsales','redis','defaults','localhost','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','email','adminId','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','Getting\x20user\x20list','agentEmail','User\x20found:','userId','Admin\x20selected','adminEmail','message','/api/lookup?q=','&entities=contact','find','contacts','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','contactNumber','Contact\x20found\x20mobile_number:','endUserId','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','/api/tasks','getString','Subjects','Descriptions','add','ticketId','task','Task\x20created:','/contacts/','user:%s','trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','moment','bluebird','ioredis'];(function(_0x170236,_0x42485d){var _0x21097a=function(_0x230eee){while(--_0x230eee){_0x170236['push'](_0x170236['shift']());}};_0x21097a(++_0x42485d);}(_0x7406,0xfb));var _0x6740=function(_0x243fda,_0x4047fb){_0x243fda=_0x243fda-0x0;var _0x2f1c94=_0x7406[_0x243fda];return _0x2f1c94;};'use strict';var _=require(_0x6740('0x0'));var rp=require(_0x6740('0x1'));var md5=require(_0x6740('0x2'));var util=require(_0x6740('0x3'));var moment=require(_0x6740('0x4'));var Promise=require(_0x6740('0x5'));var Redis=require(_0x6740('0x6'));var intUtil=require(_0x6740('0x7'));var config=require(_0x6740('0x8'));var logger=require('../../../../config/logger')(_0x6740('0x9'));config[_0x6740('0xa')]=_[_0x6740('0xb')](config[_0x6740('0xa')],{'host':_0x6740('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6740('0xa')]));function getAdminId(_0x2acaf8,_0x5d9f53,_0x3dd172,_0x33fe98){return new Promise(function(_0x293b40,_0x423fe8){var _0x12d6ee=![];var _0x76a334={'method':_0x6740('0xd'),'uri':_0x33fe98+_0x6740('0xe'),'json':!![]};_0x76a334[_0x6740('0xf')]=_0x3dd172;logger[_0x6740('0x10')](_0x6740('0x11'));return rp(_0x76a334)[_0x6740('0x12')](function(_0x4ea284){if(_0x4ea284){var _0x122fcf=_0x4ea284[_0x6740('0x13')];var _0x252df0=null;for(_0x252df0=0x0;_0x252df0<_0x122fcf[_0x6740('0x14')];_0x252df0++){if(_0x122fcf[_0x252df0][_0x6740('0x15')]===_0x2acaf8['adminEmail']){_0x2acaf8[_0x6740('0x16')]=_0x122fcf[_0x252df0]['id'];_0x12d6ee=!![];}}if(_0x12d6ee){logger[_0x6740('0x10')]('Admin\x20found:',_0x2acaf8[_0x6740('0x16')]);_0x293b40(_0x2acaf8);}else{_0x423fe8({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x423fe8({'statusCode':0x194,'message':_0x6740('0x17')});}})[_0x6740('0x18')](function(_0x368548){logger[_0x6740('0x19')]('['+[_0x5d9f53[_0x6740('0x1a')]()]+']',_0x368548['message']);_0x423fe8(_0x368548);});});}function getUser(_0x1b1c78,_0x385cb2,_0x29d6a9){return function(_0x8e592e){return new Promise(function(_0x312621,_0x4dc99f){var _0x588b38={'method':_0x6740('0xd'),'uri':_0x29d6a9+'/api/selector/owners','json':!![]};_0x588b38['headers']=_0x385cb2;logger['info'](_0x6740('0x1b'));return rp(_0x588b38)[_0x6740('0x12')](function(_0x29098b){if(_0x29098b){var _0x2b4b80=_0x29098b[_0x6740('0x13')];var _0x223a0a=![];var _0x3de6a6=null;if(_0x8e592e['agentEmail']!==null){logger[_0x6740('0x10')]('Getting\x20user\x20with\x20email',_0x8e592e[_0x6740('0x1c')]);_0x8e592e['userEmail']=_0x8e592e[_0x6740('0x1c')];for(_0x3de6a6=0x0;_0x3de6a6<_0x2b4b80[_0x6740('0x14')];_0x3de6a6++){if(_0x2b4b80[_0x3de6a6][_0x6740('0x15')]===_0x8e592e['agentEmail']){_0x223a0a=!![];_0x8e592e['userId']=_0x2b4b80[_0x3de6a6]['id'];logger[_0x6740('0x10')](_0x6740('0x1d'),_0x8e592e[_0x6740('0x1e')]);}}}if(!_0x223a0a){logger[_0x6740('0x10')](_0x6740('0x1f'));_0x8e592e['userEmail']=_0x8e592e[_0x6740('0x20')];_0x8e592e[_0x6740('0x1e')]=_0x8e592e[_0x6740('0x16')];_0x223a0a=!![];}if(_0x223a0a){_0x312621(_0x8e592e);}else{_0x4dc99f({'statusCode':0x194,'message':_0x6740('0x17')});}}else{_0x4dc99f({'statusCode':0x194,'message':_0x6740('0x17')});}})[_0x6740('0x18')](function(_0x460ac6){logger['error']('['+[_0x1b1c78[_0x6740('0x1a')]()]+']',_0x460ac6[_0x6740('0x21')]);_0x4dc99f(_0x460ac6);});});};}function searchContact(_0x1f2454,_0x325bc1,_0x512f4e,_0x2c34a4){return new Promise(function(_0x1bdddc,_0x4fbc39){var _0x331215={'method':'GET','headers':_0x325bc1,'uri':_0x1f2454+_0x6740('0x22')+_0x2c34a4+'&f='+_0x512f4e+_0x6740('0x23'),'json':!![]};rp(_0x331215)[_0x6740('0x12')](function(_0x93ef63){var _0x3e3f33=_[_0x6740('0x24')](_0x93ef63[_0x6740('0x25')][_0x6740('0x25')],[_0x512f4e,_0x2c34a4]);_0x1bdddc(_0x3e3f33);})[_0x6740('0x18')](function(_0x237478){_0x4fbc39(_0x237478);});});}function getEndUser(_0x4cf5b5,_0x1b6a91,_0x2c9b4c){return function(_0x14412e){return new Promise(function(_0x2147f7,_0x36310d){logger[_0x6740('0x10')](util['format'](_0x6740('0x26'),_0x14412e['contactNumber']));searchContact(_0x2c9b4c,_0x1b6a91,_0x6740('0x27'),_0x14412e[_0x6740('0x28')])[_0x6740('0x12')](function(_0x1995ac){if(_0x1995ac){_0x14412e['endUserId']=_0x1995ac['id'];logger['info'](_0x6740('0x29'),_0x14412e[_0x6740('0x2a')]);return _0x2147f7(_0x14412e);}searchContact(_0x2c9b4c,_0x1b6a91,_0x6740('0x2b'),_0x14412e[_0x6740('0x28')])[_0x6740('0x12')](function(_0x132389){if(_0x132389){_0x14412e['endUserId']=_0x132389['id'];logger[_0x6740('0x10')](_0x6740('0x2c'),_0x14412e[_0x6740('0x2a')]);return _0x2147f7(_0x14412e);}createEndUser(_0x14412e,_0x4cf5b5,_0x1b6a91,_0x2c9b4c)[_0x6740('0x12')](function(_0x4103a2){logger['info'](_0x6740('0x2d'),_0x4103a2[_0x6740('0x2a')]);return _0x2147f7(_0x4103a2);});});})[_0x6740('0x18')](function(_0x2c1690){_0x36310d(_0x2c1690);});});};}function createEndUser(_0x4f292a,_0x5ada44,_0x3fa491,_0x5edf6f){return new Promise(function(_0x5a062c,_0x2726f2){var _0x21d5ff=moment();var _0xf8635c={'method':_0x6740('0x2e'),'uri':_0x5edf6f+_0x6740('0x2f'),'body':{'contact':{'last_name':_0x4f292a[_0x6740('0x28')],'work_number':_0x4f292a['contactNumber'],'mobile_number':_0x4f292a[_0x6740('0x28')],'owner_id':_0x4f292a['userId'],'created_at':_0x21d5ff[_0x6740('0x30')](_0x6740('0x31'))}},'json':!![]};_0xf8635c[_0x6740('0xf')]=_0x3fa491;logger[_0x6740('0x10')](_0x6740('0x32'));return rp(_0xf8635c)[_0x6740('0x12')](function(_0x130e49){_0x4f292a[_0x6740('0x2a')]=_0x130e49[_0x6740('0x33')]['id'];_0x5a062c(_0x4f292a);})[_0x6740('0x18')](function(_0x19e442){logger[_0x6740('0x19')]('['+[_0x5ada44[_0x6740('0x1a')]()]+']',_0x19e442[_0x6740('0x21')]);_0x2726f2(_0x19e442['message']);});});}function getTicket(_0x173ca8,_0x20c85f,_0x355681,_0x25920f,_0x388a3f){return function(_0x16c635){logger[_0x6740('0x10')]('Creating\x20new\x20task');return new Promise(function(_0x227d2d,_0x3ad80e){var _0x299e45=moment();var _0x4d679d={'method':_0x6740('0x2e'),'uri':_0x355681+_0x6740('0x34'),'body':{'title':intUtil[_0x6740('0x35')](_0x25920f[_0x6740('0x36')],_0x388a3f,'\x20'),'description':intUtil[_0x6740('0x35')](_0x25920f[_0x6740('0x37')],_0x388a3f,'\x0a'),'owner_id':_0x16c635['userId'],'creater_id':_0x16c635[_0x6740('0x16')],'targetable_id':_0x16c635[_0x6740('0x2a')],'targetable_type':'Contact','created_at':_0x299e45[_0x6740('0x30')](_0x6740('0x31')),'due_date':_0x299e45[_0x6740('0x38')](0x1e,'m')['format']('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x4d679d[_0x6740('0xf')]=_0x20c85f;return rp(_0x4d679d)['then'](function(_0xe852cf){_0x16c635[_0x6740('0x39')]=_0xe852cf[_0x6740('0x3a')]['id'];logger[_0x6740('0x10')](_0x6740('0x3b'),_0x16c635['ticketId']);_0x227d2d(_0x16c635);})[_0x6740('0x18')](function(_0x1f7584){logger[_0x6740('0x19')]('['+[_0x173ca8[_0x6740('0x1a')]()]+']',_0x1f7584[_0x6740('0x21')]);_0x3ad80e(_0x1f7584[_0x6740('0x21')]);});});};}function emit(_0xf40e76,_0x5b35c5,_0x148662){var _0x35d01c={'uri':_0xf40e76+_0x6740('0x3c')+_0x148662};io['to'](util[_0x6740('0x30')](_0x6740('0x3d'),_0x5b35c5))['emit'](_0x6740('0x3e'),_0x35d01c);}exports['cs']=function(_0x39e7ec,_0x3f428c,_0x5dfe82,_0x5b9256,_0x36741a,_0x4e66c4,_0x279190,_0x5473a2){var _0x23131a={};var _0x5b17f8={'Authorization':_0x6740('0x3f')+_0x4e66c4['apiKey']};_0x4e66c4[_0x6740('0x40')]=intUtil[_0x6740('0x41')](_0x4e66c4[_0x6740('0x40')]);_0x4e66c4['serverUrl']=intUtil[_0x6740('0x41')](_0x4e66c4[_0x6740('0x42')]);var _0x477b04=_0x4e66c4['remoteUri'];_0x23131a['adminEmail']=_0x4e66c4['username'];_0x23131a['contactNumber']=_0x5473a2[_0x6740('0x43')]()===_0x6740('0x44')?_0x3f428c[_0x6740('0x45')]:_0x3f428c[_0x6740('0x46')];_0x23131a[_0x6740('0x47')]=_0x5473a2===_0x6740('0x48')||_0x5473a2===_0x6740('0x49')?'queue':_0x6740('0x44');if(_0x5b9256){_0x23131a[_0x6740('0x1c')]=_0x5b9256['email'];}var _0x11872c=util['format'](_0x6740('0x4a'),_0x4e66c4[_0x6740('0x42')],_0x3f428c['uniqueid'],md5(_0x3f428c[_0x6740('0x4b')]));if(_0x36741a&&_0x36741a[_0x6740('0x4c')]){logger['info'](_0x6740('0x4d'),_0x6740('0x4e'));_0x3f428c['recordingURL']=_0x11872c;}else if(_0x279190&&_0x279190[_0x6740('0x4f')]&&_0x279190['recordingFormat']!==_0x6740('0x50')){logger[_0x6740('0x10')](_0x6740('0x51'),'Recording\x20is\x20enabled!');_0x3f428c[_0x6740('0x52')]=_0x11872c;}else{_0x3f428c[_0x6740('0x52')]='';}return getAdminId(_0x23131a,_0x5473a2,_0x5b17f8,_0x477b04)[_0x6740('0x12')](getUser(_0x5473a2,_0x5b17f8,_0x477b04))[_0x6740('0x12')](getEndUser(_0x5473a2,_0x5b17f8,_0x477b04))[_0x6740('0x12')](getTicket(_0x5473a2,_0x5b17f8,_0x477b04,_0x5dfe82,_0x3f428c))[_0x6740('0x12')](function(_0x48b2a1){logger[_0x6740('0x10')](util[_0x6740('0x30')]('The\x20ticket\x20ID\x20is:\x20%s',_0x48b2a1['ticketId']));if(_0x5473a2!=='unmanaged'){logger['info']('['+[_0x5473a2[_0x6740('0x1a')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x477b04,_0x5b9256[_0x6740('0x53')],_0x48b2a1[_0x6740('0x2a')]);}})[_0x6740('0x18')](function(_0x3add3e){logger[_0x6740('0x19')]('['+[_0x5473a2[_0x6740('0x1a')]()]+_0x6740('0x54'),util[_0x6740('0x55')](_0x3add3e,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x9891=['error','&f=','&entities=contact','find','contacts','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','YYYY-MM-DDTHH:mm:ss','contact','Creating\x20new\x20task','/api/tasks','getString','Descriptions','Contact','format','add','task','Task\x20created:','/contacts/','emit','stripTrailingSlash','remoteUri','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','[QUEUE]','recordingURL','recordingFormat','Recording\x20is\x20enabled!','ticketId','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','md5','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','email','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','length','userId','User\x20found:'];(function(_0x401676,_0x3f1436){var _0x4f13fe=function(_0xd2f197){while(--_0xd2f197){_0x401676['push'](_0x401676['shift']());}};_0x4f13fe(++_0x3f1436);}(_0x9891,0x7f));var _0x1989=function(_0x2911e2,_0x39c3d9){_0x2911e2=_0x2911e2-0x0;var _0x111b30=_0x9891[_0x2911e2];return _0x111b30;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x1989('0x0'));var util=require('util');var moment=require(_0x1989('0x1'));var Promise=require(_0x1989('0x2'));var Redis=require(_0x1989('0x3'));var intUtil=require(_0x1989('0x4'));var config=require(_0x1989('0x5'));var logger=require(_0x1989('0x6'))('freshsales');config[_0x1989('0x7')]=_[_0x1989('0x8')](config[_0x1989('0x7')],{'host':_0x1989('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1989('0x7')]));function getAdminId(_0x135a0e,_0x5465c8,_0x2f42d8,_0x189aa0){return new Promise(function(_0x3f03e9,_0x4d98d0){var _0x5d3624=![];var _0x1043d4={'method':_0x1989('0xa'),'uri':_0x189aa0+_0x1989('0xb'),'json':!![]};_0x1043d4[_0x1989('0xc')]=_0x2f42d8;logger[_0x1989('0xd')](_0x1989('0xe'));return rp(_0x1043d4)[_0x1989('0xf')](function(_0x30b641){if(_0x30b641){var _0x18087e=_0x30b641[_0x1989('0x10')];var _0xcc664d=null;for(_0xcc664d=0x0;_0xcc664d<_0x18087e['length'];_0xcc664d++){if(_0x18087e[_0xcc664d][_0x1989('0x11')]===_0x135a0e[_0x1989('0x12')]){_0x135a0e[_0x1989('0x13')]=_0x18087e[_0xcc664d]['id'];_0x5d3624=!![];}}if(_0x5d3624){logger[_0x1989('0xd')]('Admin\x20found:',_0x135a0e[_0x1989('0x13')]);_0x3f03e9(_0x135a0e);}else{_0x4d98d0({'statusCode':0x194,'message':_0x1989('0x14')});}}else{_0x4d98d0({'statusCode':0x194,'message':_0x1989('0x14')});}})[_0x1989('0x15')](function(_0xd1390a){logger['error']('['+[_0x5465c8[_0x1989('0x16')]()]+']',_0xd1390a[_0x1989('0x17')]);_0x4d98d0(_0xd1390a);});});}function getUser(_0x392f29,_0x2a3262,_0x41ead9){return function(_0x1f6422){return new Promise(function(_0xd38bfb,_0x32cd91){var _0x6b89a4={'method':_0x1989('0xa'),'uri':_0x41ead9+_0x1989('0xb'),'json':!![]};_0x6b89a4['headers']=_0x2a3262;logger[_0x1989('0xd')](_0x1989('0x18'));return rp(_0x6b89a4)[_0x1989('0xf')](function(_0x55f675){if(_0x55f675){var _0x5ee3a0=_0x55f675[_0x1989('0x10')];var _0x5cd0e5=![];var _0x399397=null;if(_0x1f6422[_0x1989('0x19')]!==null){logger[_0x1989('0xd')](_0x1989('0x1a'),_0x1f6422[_0x1989('0x19')]);_0x1f6422[_0x1989('0x1b')]=_0x1f6422['agentEmail'];for(_0x399397=0x0;_0x399397<_0x5ee3a0[_0x1989('0x1c')];_0x399397++){if(_0x5ee3a0[_0x399397][_0x1989('0x11')]===_0x1f6422[_0x1989('0x19')]){_0x5cd0e5=!![];_0x1f6422[_0x1989('0x1d')]=_0x5ee3a0[_0x399397]['id'];logger['info'](_0x1989('0x1e'),_0x1f6422[_0x1989('0x1d')]);}}}if(!_0x5cd0e5){logger['info']('Admin\x20selected');_0x1f6422[_0x1989('0x1b')]=_0x1f6422[_0x1989('0x12')];_0x1f6422[_0x1989('0x1d')]=_0x1f6422[_0x1989('0x13')];_0x5cd0e5=!![];}if(_0x5cd0e5){_0xd38bfb(_0x1f6422);}else{_0x32cd91({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x32cd91({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x3f558d){logger[_0x1989('0x1f')]('['+[_0x392f29['toUpperCase']()]+']',_0x3f558d[_0x1989('0x17')]);_0x32cd91(_0x3f558d);});});};}function searchContact(_0x4fb52c,_0x3bd072,_0x489d90,_0x34c916){return new Promise(function(_0x25360c,_0x506ef7){var _0x4eec41={'method':_0x1989('0xa'),'headers':_0x3bd072,'uri':_0x4fb52c+'/api/lookup?q='+_0x34c916+_0x1989('0x20')+_0x489d90+_0x1989('0x21'),'json':!![]};rp(_0x4eec41)[_0x1989('0xf')](function(_0x44f5f9){var _0x275553=_[_0x1989('0x22')](_0x44f5f9[_0x1989('0x23')][_0x1989('0x23')],[_0x489d90,_0x34c916]);_0x25360c(_0x275553);})[_0x1989('0x15')](function(_0x5ca394){_0x506ef7(_0x5ca394);});});}function getEndUser(_0x41491b,_0x42b1ba,_0xada2fa){return function(_0x1e2c69){return new Promise(function(_0x2c667e,_0x5b5ff8){logger[_0x1989('0xd')](util['format'](_0x1989('0x24'),_0x1e2c69[_0x1989('0x25')]));searchContact(_0xada2fa,_0x42b1ba,_0x1989('0x26'),_0x1e2c69[_0x1989('0x25')])[_0x1989('0xf')](function(_0x44bd49){if(_0x44bd49){_0x1e2c69[_0x1989('0x27')]=_0x44bd49['id'];logger[_0x1989('0xd')](_0x1989('0x28'),_0x1e2c69[_0x1989('0x27')]);return _0x2c667e(_0x1e2c69);}searchContact(_0xada2fa,_0x42b1ba,_0x1989('0x29'),_0x1e2c69[_0x1989('0x25')])['then'](function(_0x232125){if(_0x232125){_0x1e2c69[_0x1989('0x27')]=_0x232125['id'];logger[_0x1989('0xd')](_0x1989('0x2a'),_0x1e2c69[_0x1989('0x27')]);return _0x2c667e(_0x1e2c69);}createEndUser(_0x1e2c69,_0x41491b,_0x42b1ba,_0xada2fa)[_0x1989('0xf')](function(_0x453288){logger[_0x1989('0xd')](_0x1989('0x2b'),_0x453288[_0x1989('0x27')]);return _0x2c667e(_0x453288);});});})[_0x1989('0x15')](function(_0x4ecc5e){_0x5b5ff8(_0x4ecc5e);});});};}function createEndUser(_0x247fa7,_0x3f6205,_0x5c7016,_0x47e9c6){return new Promise(function(_0x1659bb,_0x1ceafa){var _0x4fc93b=moment();var _0x3b505a={'method':_0x1989('0x2c'),'uri':_0x47e9c6+'/api/contacts','body':{'contact':{'last_name':_0x247fa7['contactNumber'],'work_number':_0x247fa7[_0x1989('0x25')],'mobile_number':_0x247fa7[_0x1989('0x25')],'owner_id':_0x247fa7['userId'],'created_at':_0x4fc93b['format'](_0x1989('0x2d'))}},'json':!![]};_0x3b505a[_0x1989('0xc')]=_0x5c7016;logger[_0x1989('0xd')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x3b505a)[_0x1989('0xf')](function(_0x378fdc){_0x247fa7[_0x1989('0x27')]=_0x378fdc[_0x1989('0x2e')]['id'];_0x1659bb(_0x247fa7);})[_0x1989('0x15')](function(_0x3668a5){logger[_0x1989('0x1f')]('['+[_0x3f6205['toUpperCase']()]+']',_0x3668a5[_0x1989('0x17')]);_0x1ceafa(_0x3668a5[_0x1989('0x17')]);});});}function getTicket(_0x320293,_0x64127d,_0x3fa59c,_0x57ade9,_0x2779e){return function(_0x5925f4){logger[_0x1989('0xd')](_0x1989('0x2f'));return new Promise(function(_0x295e8f,_0x886a8b){var _0x112a42=moment();var _0x5a26c7={'method':'POST','uri':_0x3fa59c+_0x1989('0x30'),'body':{'title':intUtil['getString'](_0x57ade9['Subjects'],_0x2779e,'\x20'),'description':intUtil[_0x1989('0x31')](_0x57ade9[_0x1989('0x32')],_0x2779e,'\x0a'),'owner_id':_0x5925f4[_0x1989('0x1d')],'creater_id':_0x5925f4[_0x1989('0x13')],'targetable_id':_0x5925f4['endUserId'],'targetable_type':_0x1989('0x33'),'created_at':_0x112a42[_0x1989('0x34')](_0x1989('0x2d')),'due_date':_0x112a42[_0x1989('0x35')](0x1e,'m')[_0x1989('0x34')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x5a26c7['headers']=_0x64127d;return rp(_0x5a26c7)[_0x1989('0xf')](function(_0x2b2c36){_0x5925f4['ticketId']=_0x2b2c36[_0x1989('0x36')]['id'];logger[_0x1989('0xd')](_0x1989('0x37'),_0x5925f4['ticketId']);_0x295e8f(_0x5925f4);})[_0x1989('0x15')](function(_0x19a1bc){logger['error']('['+[_0x320293[_0x1989('0x16')]()]+']',_0x19a1bc[_0x1989('0x17')]);_0x886a8b(_0x19a1bc[_0x1989('0x17')]);});});};}function emit(_0xff18a3,_0x2936b3,_0x5cd1cb){var _0x342f68={'uri':_0xff18a3+_0x1989('0x38')+_0x5cd1cb};io['to'](util[_0x1989('0x34')]('user:%s',_0x2936b3))[_0x1989('0x39')]('trigger:browser:url',_0x342f68);}exports['cs']=function(_0x180bdf,_0x505598,_0x491f95,_0x563ee5,_0x4d648a,_0x168764,_0x354363,_0x992f01){var _0x25bf34={};var _0x2a78f0={'Authorization':'Token\x20token='+_0x168764['apiKey']};_0x168764['remoteUri']=intUtil[_0x1989('0x3a')](_0x168764[_0x1989('0x3b')]);_0x168764['serverUrl']=intUtil['stripTrailingSlash'](_0x168764['serverUrl']);var _0x5f20f2=_0x168764[_0x1989('0x3b')];_0x25bf34[_0x1989('0x12')]=_0x168764['username'];_0x25bf34[_0x1989('0x25')]=_0x992f01[_0x1989('0x3c')]()===_0x1989('0x3d')?_0x505598[_0x1989('0x3e')]:_0x505598[_0x1989('0x3f')];_0x25bf34[_0x1989('0x40')]=_0x992f01===_0x1989('0x41')||_0x992f01===_0x1989('0x42')?_0x1989('0x41'):_0x1989('0x3d');if(_0x563ee5){_0x25bf34['agentEmail']=_0x563ee5['email'];}var _0x4683c9=util[_0x1989('0x34')](_0x1989('0x43'),_0x168764[_0x1989('0x44')],_0x505598['uniqueid'],md5(_0x505598[_0x1989('0x45')]));if(_0x4d648a&&_0x4d648a['monitor_format']){logger[_0x1989('0xd')](_0x1989('0x46'),'Recording\x20is\x20enabled!');_0x505598[_0x1989('0x47')]=_0x4683c9;}else if(_0x354363&&_0x354363[_0x1989('0x48')]&&_0x354363[_0x1989('0x48')]!=='none'){logger['info']('[OUTBOUND]',_0x1989('0x49'));_0x505598['recordingURL']=_0x4683c9;}else{_0x505598[_0x1989('0x47')]='';}return getAdminId(_0x25bf34,_0x992f01,_0x2a78f0,_0x5f20f2)[_0x1989('0xf')](getUser(_0x992f01,_0x2a78f0,_0x5f20f2))[_0x1989('0xf')](getEndUser(_0x992f01,_0x2a78f0,_0x5f20f2))[_0x1989('0xf')](getTicket(_0x992f01,_0x2a78f0,_0x5f20f2,_0x491f95,_0x505598))[_0x1989('0xf')](function(_0x5eba9c){logger[_0x1989('0xd')](util[_0x1989('0x34')]('The\x20ticket\x20ID\x20is:\x20%s',_0x5eba9c[_0x1989('0x4a')]));if(_0x992f01!==_0x1989('0x42')){logger['info']('['+[_0x992f01[_0x1989('0x16')]()]+']',_0x1989('0x4b'));emit(_0x5f20f2,_0x563ee5[_0x1989('0x4c')],_0x5eba9c[_0x1989('0x27')]);}})[_0x1989('0x15')](function(_0x4a3c87){logger[_0x1989('0x1f')]('['+[_0x992f01['toUpperCase']()]+_0x1989('0x4d'),util[_0x1989('0x4e')](_0x4a3c87,{'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 2869ef2..dc38f2b 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 _0xbef3=['%s\x20account\x20#%s\x20not\x20found','data2','lodash','util','./sugarcrm','./freshdesk','./zoho','./desk','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','desk','vtiger','dynamics365','servicenow','exec','includes','data1','toLowerCase','Configurations','data3','queue','log','EVENT\x20UNKNOWN','unmanaged','zoho','freshsales','unknown\x20integration','../../../../config/logger','error','format','%s\x20configuration\x20#%s\x20not\x20found','[EXEC]'];(function(_0x1827b5,_0x2953d8){var _0x42ca5b=function(_0x12f02d){while(--_0x12f02d){_0x1827b5['push'](_0x1827b5['shift']());}};_0x42ca5b(++_0x2953d8);}(_0xbef3,0x6b));var _0x3bef=function(_0x1ded55,_0x4c6b5a){_0x1ded55=_0x1ded55-0x0;var _0x39faa0=_0xbef3[_0x1ded55];return _0x39faa0;};'use strict';var _=require(_0x3bef('0x0'));var util=require(_0x3bef('0x1'));var zendesk=require('./zendesk');var salesforce=require('./salesforce');var sugarcrm=require(_0x3bef('0x2'));var freshdesk=require(_0x3bef('0x3'));var zoho=require(_0x3bef('0x4'));var desk=require(_0x3bef('0x5'));var vtiger=require('./vtiger');var servicenow=require('./servicenow');var dynamics365=require('./dynamics365');var freshsales=require(_0x3bef('0x6'));var integrations=[_0x3bef('0x7'),_0x3bef('0x8'),_0x3bef('0x9'),_0x3bef('0xa'),'zoho',_0x3bef('0xb'),_0x3bef('0xc'),_0x3bef('0xd'),'freshsales',_0x3bef('0xe')];exports[_0x3bef('0xf')]=function(_0x1465e5,_0x51c0da,_0x499063,_0x21b3c9,_0x1e2614,_0x25644f){if(_0x499063){if(_[_0x3bef('0x10')](integrations,_0x1465e5[_0x3bef('0x11')][_0x3bef('0x12')]())){try{var _0x4a1e1d=null;var _0x46e6a4='';var _0x2e463d=_0x499063[_0x1465e5[_0x3bef('0x11')][_0x3bef('0x12')]()];if(_0x2e463d){var _0x4dff65=_0x2e463d[_0x1465e5['data2']];if(_0x4dff65){var _0x4f70f3=_['find'](_0x4dff65[_0x3bef('0x13')],{'id':parseInt(_0x1465e5[_0x3bef('0x14')],0xa)});if(_0x4f70f3){if(_0x21b3c9){if(_0x1e2614&&_0x51c0da[_0x3bef('0x15')]){_0x46e6a4=_0x3bef('0x15');}else if(_0x51c0da['routeId']){_0x46e6a4='outbound';}else{console[_0x3bef('0x16')](_0x3bef('0x17'),_0x51c0da);}}else{_0x46e6a4=_0x3bef('0x18');}switch(_0x1465e5['data1'][_0x3bef('0x12')]()){case _0x3bef('0x7'):zendesk[_0x46e6a4](_0x1465e5,_0x51c0da,_0x4f70f3,_0x21b3c9,_0x1e2614,_0x4dff65,_0x25644f);break;case _0x3bef('0x8'):salesforce[_0x46e6a4](_0x1465e5,_0x51c0da,_0x4f70f3,_0x21b3c9,_0x1e2614,_0x4dff65,_0x25644f);break;case _0x3bef('0x9'):sugarcrm[_0x46e6a4](_0x1465e5,_0x51c0da,_0x4f70f3,_0x21b3c9,_0x1e2614,_0x4dff65,_0x25644f);break;case _0x3bef('0xa'):freshdesk[_0x46e6a4](_0x1465e5,_0x51c0da,_0x4f70f3,_0x21b3c9,_0x1e2614,_0x4dff65,_0x25644f);break;case _0x3bef('0x19'):zoho[_0x46e6a4](_0x1465e5,_0x51c0da,_0x4f70f3,_0x21b3c9,_0x1e2614,_0x4dff65,_0x25644f);break;case _0x3bef('0xb'):desk[_0x46e6a4](_0x1465e5,_0x51c0da,_0x4f70f3,_0x21b3c9,_0x1e2614,_0x4dff65,_0x25644f);break;case _0x3bef('0xc'):vtiger[_0x46e6a4](_0x1465e5,_0x51c0da,_0x4f70f3,_0x21b3c9,_0x1e2614,_0x4dff65,_0x25644f);break;case _0x3bef('0x1a'):freshsales['cs'](_0x1465e5,_0x51c0da,_0x4f70f3,_0x21b3c9,_0x1e2614,_0x4dff65,_0x25644f,_0x46e6a4);break;case _0x3bef('0xe'):servicenow['cs'](_0x1465e5,_0x51c0da,_0x4f70f3,_0x21b3c9,_0x1e2614,_0x4dff65,_0x25644f,_0x46e6a4);break;case _0x3bef('0xd'):dynamics365['cs'](_0x1465e5,_0x51c0da,_0x4f70f3,_0x21b3c9,_0x1e2614,_0x4dff65,_0x25644f,_0x46e6a4);break;default:console['log'](_0x3bef('0x1b'));}}else{_0x4a1e1d=require(_0x3bef('0x1c'))(_0x1465e5[_0x3bef('0x11')][_0x3bef('0x12')]());_0x4a1e1d[_0x3bef('0x1d')]('[EXEC]',util[_0x3bef('0x1e')](_0x3bef('0x1f'),_0x1465e5[_0x3bef('0x11')][_0x3bef('0x12')](),_0x1465e5[_0x3bef('0x14')]));}}else{_0x4a1e1d=require('../../../../config/logger')(_0x1465e5[_0x3bef('0x11')]['toLowerCase']());_0x4a1e1d[_0x3bef('0x1d')](_0x3bef('0x20'),util[_0x3bef('0x1e')](_0x3bef('0x21'),_0x1465e5[_0x3bef('0x11')][_0x3bef('0x12')](),_0x1465e5[_0x3bef('0x22')]));}}else{}}catch(_0x2d636a){console[_0x3bef('0x1d')](_0x2d636a);}}}}; \ No newline at end of file +var _0x5298=['%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','./zendesk','./freshdesk','./servicenow','./freshsales','zendesk','salesforce','sugarcrm','desk','servicenow','exec','toLowerCase','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','freshdesk','zoho','vtiger','freshsales','dynamics365','unknown\x20integration','../../../../config/logger','data1','error','[EXEC]'];(function(_0x3e2adf,_0x5420c3){var _0x20354b=function(_0x1162a1){while(--_0x1162a1){_0x3e2adf['push'](_0x3e2adf['shift']());}};_0x20354b(++_0x5420c3);}(_0x5298,0x157));var _0x8529=function(_0x10802e,_0xb4e008){_0x10802e=_0x10802e-0x0;var _0x15fa97=_0x5298[_0x10802e];return _0x15fa97;};'use strict';var _=require(_0x8529('0x0'));var util=require('util');var zendesk=require(_0x8529('0x1'));var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x8529('0x2'));var zoho=require('./zoho');var desk=require('./desk');var vtiger=require('./vtiger');var servicenow=require(_0x8529('0x3'));var dynamics365=require('./dynamics365');var freshsales=require(_0x8529('0x4'));var integrations=[_0x8529('0x5'),_0x8529('0x6'),_0x8529('0x7'),'freshdesk','zoho',_0x8529('0x8'),'vtiger','dynamics365','freshsales',_0x8529('0x9')];exports[_0x8529('0xa')]=function(_0x5f1f07,_0x4a4fca,_0x209479,_0x234c44,_0x5c8533,_0x2a5521){if(_0x209479){if(_['includes'](integrations,_0x5f1f07['data1'][_0x8529('0xb')]())){try{var _0x50bd52=null;var _0x163e57='';var _0x18d1c6=_0x209479[_0x5f1f07['data1']['toLowerCase']()];if(_0x18d1c6){var _0x54dd6e=_0x18d1c6[_0x5f1f07['data2']];if(_0x54dd6e){var _0x211b88=_['find'](_0x54dd6e['Configurations'],{'id':parseInt(_0x5f1f07[_0x8529('0xc')],0xa)});if(_0x211b88){if(_0x234c44){if(_0x5c8533&&_0x4a4fca[_0x8529('0xd')]){_0x163e57='queue';}else if(_0x4a4fca[_0x8529('0xe')]){_0x163e57=_0x8529('0xf');}else{console[_0x8529('0x10')](_0x8529('0x11'),_0x4a4fca);}}else{_0x163e57=_0x8529('0x12');}switch(_0x5f1f07['data1'][_0x8529('0xb')]()){case'zendesk':zendesk[_0x163e57](_0x5f1f07,_0x4a4fca,_0x211b88,_0x234c44,_0x5c8533,_0x54dd6e,_0x2a5521);break;case'salesforce':salesforce[_0x163e57](_0x5f1f07,_0x4a4fca,_0x211b88,_0x234c44,_0x5c8533,_0x54dd6e,_0x2a5521);break;case _0x8529('0x7'):sugarcrm[_0x163e57](_0x5f1f07,_0x4a4fca,_0x211b88,_0x234c44,_0x5c8533,_0x54dd6e,_0x2a5521);break;case _0x8529('0x13'):freshdesk[_0x163e57](_0x5f1f07,_0x4a4fca,_0x211b88,_0x234c44,_0x5c8533,_0x54dd6e,_0x2a5521);break;case _0x8529('0x14'):zoho[_0x163e57](_0x5f1f07,_0x4a4fca,_0x211b88,_0x234c44,_0x5c8533,_0x54dd6e,_0x2a5521);break;case'desk':desk[_0x163e57](_0x5f1f07,_0x4a4fca,_0x211b88,_0x234c44,_0x5c8533,_0x54dd6e,_0x2a5521);break;case _0x8529('0x15'):vtiger[_0x163e57](_0x5f1f07,_0x4a4fca,_0x211b88,_0x234c44,_0x5c8533,_0x54dd6e,_0x2a5521);break;case _0x8529('0x16'):freshsales['cs'](_0x5f1f07,_0x4a4fca,_0x211b88,_0x234c44,_0x5c8533,_0x54dd6e,_0x2a5521,_0x163e57);break;case _0x8529('0x9'):servicenow['cs'](_0x5f1f07,_0x4a4fca,_0x211b88,_0x234c44,_0x5c8533,_0x54dd6e,_0x2a5521,_0x163e57);break;case _0x8529('0x17'):dynamics365['cs'](_0x5f1f07,_0x4a4fca,_0x211b88,_0x234c44,_0x5c8533,_0x54dd6e,_0x2a5521,_0x163e57);break;default:console[_0x8529('0x10')](_0x8529('0x18'));}}else{_0x50bd52=require(_0x8529('0x19'))(_0x5f1f07[_0x8529('0x1a')]['toLowerCase']());_0x50bd52[_0x8529('0x1b')](_0x8529('0x1c'),util['format'](_0x8529('0x1d'),_0x5f1f07[_0x8529('0x1a')][_0x8529('0xb')](),_0x5f1f07[_0x8529('0xc')]));}}else{_0x50bd52=require('../../../../config/logger')(_0x5f1f07['data1'][_0x8529('0xb')]());_0x50bd52['error'](_0x8529('0x1c'),util['format'](_0x8529('0x1e'),_0x5f1f07['data1'][_0x8529('0xb')](),_0x5f1f07['data2']));}}else{}}catch(_0x40c768){console['error'](_0x40c768);}}}}; \ 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 1f92113..869fa0d 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 _0x2d47=['info','Agent\x20%s\x20found.','resolve','identity','then','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','moduleSearch','cloneDeep','additionalSearchContact','merge','$or','Contact','find','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','execute','account','Name','Phone','attributes','type','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','','format','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','forEach','includes','string','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','password','concat','securityToken','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','uniqueid','email','calleridname','calleridnum','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','toUpperCase','lastevent',']\x20Ticket\x20%s\x20created.','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','assign','getString','Subjects','Descriptions','Task','ActivityDate','utc','IsRecurrence','contact','endUserType','AccountId','lead','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','isNil','validateEmail','sobject','length'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0x2d47,0xda));var _0x72d4=function(_0x5718a2,_0x599cd1){_0x5718a2=_0x5718a2-0x0;var _0x5ac7d3=_0x2d47[_0x5718a2];return _0x5ac7d3;};'use strict';var _=require(_0x72d4('0x0'));var rp=require(_0x72d4('0x1'));var moment=require('moment');var BPromise=require(_0x72d4('0x2'));var md5=require('md5');var jsforce=require('jsforce');var util=require('util');var Redis=require(_0x72d4('0x3'));var intUtil=require('./util');var config=require(_0x72d4('0x4'));var logger=require(_0x72d4('0x5'))('salesforce');config[_0x72d4('0x6')]=_[_0x72d4('0x7')](config[_0x72d4('0x6')],{'host':_0x72d4('0x8'),'port':0x18eb});var io=require(_0x72d4('0x9'))(new Redis(config['redis']));function emit(_0x54fefc,_0xf073e9,_0x27337f){io['to'](_0x54fefc)[_0x72d4('0xa')](_0xf073e9,_0x27337f);}function getTicket(_0x15bf92,_0x93feed,_0x2ac9b0,_0x409869,_0x1bab1e,_0x207a2b,_0x1ff6f3,_0x408913){var _0x26774d=Object[_0x72d4('0xb')]({},{'OwnerId':_0x93feed['id'],'Subject':intUtil[_0x72d4('0xc')](_0x409869[_0x72d4('0xd')],_0x1bab1e,'\x20'),'Description':intUtil[_0x72d4('0xc')](_0x409869[_0x72d4('0xe')],_0x1bab1e,'\x0a')},getCustomFields(_0x207a2b,_0x1bab1e));if(_0x2ac9b0){if(_0x409869['ticketType']===_0x72d4('0xf')){_0x26774d[_0x72d4('0x10')]=moment[_0x72d4('0x11')]();_0x26774d['IsReminderSet']=![];_0x26774d[_0x72d4('0x12')]=![];if(_0x2ac9b0['endUserType']===_0x72d4('0x13')||_0x2ac9b0[_0x72d4('0x14')]==='lead'){_0x26774d['WhoId']=_0x2ac9b0['id'];}else if(_0x2ac9b0[_0x72d4('0x14')]==='account'){_0x26774d['WhatId']=_0x2ac9b0['id'];}}else if(_0x409869['ticketType']==='Case'){if(_0x2ac9b0[_0x72d4('0x14')]==='contact'){_0x26774d['ContactId']=_0x2ac9b0['id'];}else if(_0x2ac9b0['endUserType']==='account'){_0x26774d[_0x72d4('0x15')]=_0x2ac9b0['id'];}else if(_0x2ac9b0[_0x72d4('0x14')]===_0x72d4('0x16')&&_0x409869['leadId']){_0x26774d[_0x409869[_0x72d4('0x17')]]=_0x2ac9b0['id'];}else{logger['info'](_0x72d4('0x18'));}}}return _0x1ff6f3['sobject'](_0x409869['ticketType'])[_0x72d4('0x19')](_0x26774d);}function getUser(_0x29c410,_0x5a7c22,_0x2a27a1){if(!_[_0x72d4('0x1a')](_0x5a7c22)&&intUtil[_0x72d4('0x1b')](_0x5a7c22)){var _0x671dac={'Email':_0x5a7c22};var _0x2336df={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x2a27a1[_0x72d4('0x1c')]('User')['find'](_0x671dac,_0x2336df)['execute']()['then'](function(_0xde12d6){if(_0xde12d6[_0x72d4('0x1d')]){var _0x52967f=_['find'](_0xde12d6,function(_0x2d1362){return _0x2d1362['Email']===_0x5a7c22;});if(_0x52967f){logger[_0x72d4('0x1e')](_0x72d4('0x1f'),_0x5a7c22);return BPromise[_0x72d4('0x20')]({'id':_0x52967f['Id'],'name':_0x52967f['Name']});}}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x5a7c22);return _0x2a27a1[_0x72d4('0x21')]()[_0x72d4('0x22')](function(_0x169665){return BPromise[_0x72d4('0x20')]({'id':_0x169665['user_id'],'name':_0x169665[_0x72d4('0x23')]});});}});}else{logger[_0x72d4('0x1e')](_0x72d4('0x24'),_0x5a7c22);return _0x2a27a1[_0x72d4('0x21')]()[_0x72d4('0x22')](function(_0x2af8cb){return BPromise[_0x72d4('0x20')]({'id':_0x2af8cb[_0x72d4('0x25')],'name':_0x2af8cb[_0x72d4('0x23')]});});}}function getEndUser(_0x12a1bd,_0x402403,_0x26ca21,_0x180e28,_0x474f40){var _0x1b1d16={'$or':{'Phone':_0x180e28}};var _0x508cb4={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x72d4('0x20')]()['then'](function(){logger[_0x72d4('0x1e')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x180e28,_0x402403[_0x72d4('0x26')]);switch(_0x402403[_0x72d4('0x26')]){case'contact_lead':var _0x4717b7=_[_0x72d4('0x27')](_0x1b1d16);if(_0x402403[_0x72d4('0x28')]){var _0x4f1c0b={};_0x4f1c0b[_0x402403[_0x72d4('0x28')]]=_0x180e28;_[_0x72d4('0x29')](_0x4717b7[_0x72d4('0x2a')],_0x4f1c0b);}return _0x474f40['sobject'](_0x72d4('0x2b'))[_0x72d4('0x2c')](_0x4717b7,_0x508cb4)['execute']()['then'](function(_0x1533d5){if(_0x1533d5&&_0x1533d5[_0x72d4('0x1d')]){return _0x1533d5;}else{var _0x148eee=_[_0x72d4('0x27')](_0x1b1d16);if(_0x402403[_0x72d4('0x2d')]){var _0x16eede={};_0x16eede[_0x402403['additionalSearchLead']]=_0x180e28;_[_0x72d4('0x29')](_0x148eee[_0x72d4('0x2a')],_0x16eede);}return _0x474f40['sobject'](_0x72d4('0x2e'))[_0x72d4('0x2c')](_0x148eee,_0x508cb4);}});case _0x72d4('0x2f'):var _0x1fd25a=_[_0x72d4('0x27')](_0x1b1d16);if(_0x402403[_0x72d4('0x30')]){var _0x4f1c0b={};_0x4f1c0b[_0x402403[_0x72d4('0x30')]]=_0x180e28;_[_0x72d4('0x29')](_0x1fd25a['$or'],_0x4f1c0b);}return _0x474f40['sobject'](_0x72d4('0x31'))['find'](_0x1fd25a,_0x508cb4)[_0x72d4('0x32')]()[_0x72d4('0x22')](function(_0x5a4fc8){if(_0x5a4fc8&&_0x5a4fc8[_0x72d4('0x1d')]){return _0x5a4fc8;}else{var _0x4d1187=_[_0x72d4('0x27')](_0x1b1d16);if(_0x402403['additionalSearchContact']){var _0x36e0b4={};_0x36e0b4[_0x402403[_0x72d4('0x28')]]=_0x180e28;_[_0x72d4('0x29')](_0x4d1187[_0x72d4('0x2a')],_0x36e0b4);}return _0x474f40[_0x72d4('0x1c')](_0x72d4('0x2b'))[_0x72d4('0x2c')](_0x4d1187,_0x508cb4)['then'](function(_0x2949fa){if(_0x2949fa&&_0x2949fa[_0x72d4('0x1d')]){return _0x2949fa;}else{var _0xcc01d=_['cloneDeep'](_0x1b1d16);if(_0x402403[_0x72d4('0x2d')]){var _0x588718={};_0x588718[_0x402403['additionalSearchLead']]=_0x180e28;_['merge'](_0xcc01d[_0x72d4('0x2a')],_0x588718);}return _0x474f40[_0x72d4('0x1c')](_0x72d4('0x2e'))[_0x72d4('0x2c')](_0xcc01d,_0x508cb4);}});}});case'contact':var _0x4717b7=_[_0x72d4('0x27')](_0x1b1d16);if(_0x402403[_0x72d4('0x28')]){var _0x4f1c0b={};_0x4f1c0b[_0x402403[_0x72d4('0x28')]]=_0x180e28;_['merge'](_0x4717b7[_0x72d4('0x2a')],_0x4f1c0b);}return _0x474f40[_0x72d4('0x1c')](_0x72d4('0x2b'))[_0x72d4('0x2c')](_0x4717b7,_0x508cb4)[_0x72d4('0x32')]();case _0x72d4('0x16'):var _0x2f0738=_[_0x72d4('0x27')](_0x1b1d16);if(_0x402403[_0x72d4('0x2d')]){var _0x4f1c0b={};_0x4f1c0b[_0x402403[_0x72d4('0x2d')]]=_0x180e28;_[_0x72d4('0x29')](_0x2f0738['$or'],_0x4f1c0b);}return _0x474f40[_0x72d4('0x1c')]('Lead')['find'](_0x2f0738,_0x508cb4);case _0x72d4('0x33'):var _0x1fd25a=_[_0x72d4('0x27')](_0x1b1d16);if(_0x402403['additionalSearchAccount']){var _0x4f1c0b={};_0x4f1c0b[_0x402403['additionalSearchAccount']]=_0x180e28;_[_0x72d4('0x29')](_0x1fd25a[_0x72d4('0x2a')],_0x4f1c0b);}return _0x474f40[_0x72d4('0x1c')](_0x72d4('0x31'))[_0x72d4('0x2c')](_0x1fd25a,_0x508cb4);default:return null;}})['then'](function(_0x46df54){if(_0x46df54&&_0x46df54[_0x72d4('0x1d')]){var _0xf0cc55=_['first'](_0x46df54);if(_0xf0cc55){return BPromise[_0x72d4('0x20')]({'id':_0xf0cc55['Id'],'name':_0xf0cc55[_0x72d4('0x34')],'phone':_0xf0cc55[_0x72d4('0x35')],'endUserType':_0xf0cc55[_0x72d4('0x36')][_0x72d4('0x37')]['toLowerCase']()});}}})[_0x72d4('0x22')](function(_0x1ae881){if(_0x1ae881){logger[_0x72d4('0x1e')](_0x72d4('0x38'),_0x1ae881[_0x72d4('0x14')],_0x180e28);return BPromise[_0x72d4('0x20')](_0x1ae881);}else{logger['info'](_0x72d4('0x39'),_0x180e28);var _0x3d0314={'Phone':_0x180e28};if(_0x402403[_0x72d4('0x3a')]){if(_0x402403[_0x72d4('0x3a')]===_0x72d4('0x13')){logger[_0x72d4('0x1e')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x180e28,_0x402403[_0x72d4('0x3a')]);_0x3d0314[_0x72d4('0x3b')]=_0x26ca21!==_0x72d4('0x3c')?_0x26ca21:util[_0x72d4('0x3d')](_0x72d4('0x3e'),_0x180e28);}else if(_0x402403['moduleCreate']===_0x72d4('0x16')){logger[_0x72d4('0x1e')](_0x72d4('0x3f'),_0x180e28,_0x402403[_0x72d4('0x3a')]);_0x3d0314[_0x72d4('0x3b')]=_0x26ca21!==_0x72d4('0x3c')?_0x26ca21:util['format'](_0x72d4('0x3e'),_0x180e28);_0x3d0314[_0x72d4('0x40')]=_0x72d4('0x41');}else if(_0x402403['moduleCreate']===_0x72d4('0x33')){logger[_0x72d4('0x1e')](_0x72d4('0x3f'),_0x180e28,_0x402403[_0x72d4('0x3a')]);_0x3d0314[_0x72d4('0x34')]=_0x26ca21!==_0x72d4('0x3c')?_0x26ca21:util[_0x72d4('0x3d')](_0x72d4('0x3e'),_0x180e28);}else{return null;}}return _0x474f40['sobject'](_['upperFirst'](_0x402403[_0x72d4('0x3a')]))[_0x72d4('0x19')](_0x3d0314)[_0x72d4('0x22')](function(_0x3ff833){return BPromise[_0x72d4('0x20')]({'id':_0x3ff833['id'],'endUserType':_0x402403[_0x72d4('0x3a')]});});}});}function getCustomFields(_0x59a0bf,_0x37b0f4){var _0x1bf97a={};if(_0x59a0bf[_0x72d4('0x1d')]>0x0){_[_0x72d4('0x42')](_0x59a0bf,function(_0x6225f9){if(_[_0x72d4('0x43')]([_0x72d4('0x44'),_0x72d4('0x45')],_0x6225f9[_0x72d4('0x37')])&&_0x6225f9[_0x72d4('0x46')]){_0x1bf97a[_0x6225f9[_0x72d4('0x46')]]=_0x6225f9[_0x72d4('0x47')][_0x72d4('0x48')]();}else if(_0x6225f9['type']===_0x72d4('0x49')&&_0x6225f9['variableName']&&_0x6225f9[_0x72d4('0x46')]){_0x37b0f4[_0x6225f9[_0x72d4('0x4a')]]&&(_0x1bf97a[_0x6225f9['idField']]=_0x37b0f4[_0x6225f9[_0x72d4('0x4a')]][_0x72d4('0x48')]());}else if(_0x6225f9[_0x72d4('0x37')]===_0x72d4('0x4b')&&_0x6225f9['Variable']&&_0x6225f9[_0x72d4('0x4c')]['name']&&_0x6225f9['idField']){_0x37b0f4[_0x6225f9[_0x72d4('0x4c')][_0x72d4('0x4d')]['toLowerCase']()]&&(_0x1bf97a[_0x6225f9[_0x72d4('0x46')]]=_0x37b0f4[_0x6225f9[_0x72d4('0x4c')][_0x72d4('0x4d')][_0x72d4('0x4e')]()][_0x72d4('0x48')]());}});}return _0x1bf97a;}function getConnection(_0x3afce0){var _0x1ee9f2=_0x3afce0[_0x72d4('0x4f')][_0x72d4('0x50')](_0x3afce0[_0x72d4('0x51')]);var _0xf700e0=new jsforce['Connection']({'oauth2':{'loginUrl':_0x3afce0[_0x72d4('0x52')]||_0x72d4('0x53'),'clientId':_0x3afce0[_0x72d4('0x54')],'clientSecret':_0x3afce0[_0x72d4('0x55')]}});return _0xf700e0[_0x72d4('0x56')](_0x3afce0[_0x72d4('0x57')],_0x1ee9f2)[_0x72d4('0x22')](function(){logger[_0x72d4('0x1e')]('Connection\x20established.');return _0xf700e0;});}exports['queue']=function(_0x2e32af,_0x2aff21,_0x31061e,_0x11ce9b,_0x4a0eef,_0x2a6cfe){var _0x381af1,_0x2ab47c,_0x189e09,_0x238665;_0x2a6cfe['serverUrl']=intUtil['stripTrailingSlash'](_0x2a6cfe[_0x72d4('0x58')]);_0x2a6cfe['remoteUri']=intUtil[_0x72d4('0x59')](_0x2a6cfe[_0x72d4('0x52')]);if(_0x4a0eef&&_0x4a0eef[_0x72d4('0x5a')]){logger[_0x72d4('0x1e')](_0x72d4('0x5b'),'Recording\x20is\x20enabled!');_0x2aff21[_0x72d4('0x5c')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2a6cfe['serverUrl'],_0x2aff21[_0x72d4('0x5d')],md5(_0x2aff21['uniqueid']));}else{_0x2aff21[_0x72d4('0x5c')]='';}return getConnection(_0x2a6cfe)[_0x72d4('0x22')](function(_0x8e7cac){_0x238665=_0x8e7cac;return getUser(_0x2a6cfe,_0x11ce9b[_0x72d4('0x5e')],_0x238665);})[_0x72d4('0x22')](function(_0x3d1568){_0x381af1=_0x3d1568;return getEndUser(_0x2a6cfe,_0x31061e,_0x2aff21[_0x72d4('0x5f')],_0x2aff21[_0x72d4('0x60')],_0x238665);})['then'](function(_0x2acdd4){_0x2ab47c=_0x2acdd4;return getTicket(_0x2a6cfe,_0x381af1,_0x2ab47c,_0x31061e,_0x2aff21,_0x31061e[_0x72d4('0x61')],_0x238665,_0x72d4('0x62'));})['then'](function(_0x2ff76c){_0x189e09=_0x2ff76c;logger[_0x72d4('0x1e')](_0x72d4('0x63'),_0x189e09['id']);logger[_0x72d4('0x1e')](_0x72d4('0x64'),_0x189e09['id'],_0x11ce9b[_0x72d4('0x4d')],_0x2a6cfe['type']);switch(_0x2a6cfe[_0x72d4('0x37')]){case'integrationTab':emit(util[_0x72d4('0x3d')]('user:%s',_0x11ce9b[_0x72d4('0x4d')]),_0x72d4('0x65'),{'recordId':_0x189e09['id']});break;case _0x72d4('0x66'):emit(util[_0x72d4('0x3d')]('user:%s',_0x11ce9b[_0x72d4('0x4d')]),_0x72d4('0x67'),{'uri':util['format'](_0x72d4('0x68'),_0x238665[_0x72d4('0x69')],_0x189e09['id'])});break;default:logger[_0x72d4('0x6a')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x72d4('0x6b')](function(_0x4df8b1){logger['error'](_0x72d4('0x5b'),_0x4df8b1);});};exports[_0x72d4('0x6c')]=function(_0x2e9980,_0x42e366,_0x164599,_0x486bec,_0x5093f6,_0x25cf69,_0x3c6176){var _0x38b864,_0x280c48,_0x557016,_0x5d3fef;_0x25cf69['serverUrl']=intUtil['stripTrailingSlash'](_0x25cf69[_0x72d4('0x58')]);_0x25cf69[_0x72d4('0x52')]=intUtil['stripTrailingSlash'](_0x25cf69[_0x72d4('0x52')]);if(_0x3c6176&&_0x3c6176[_0x72d4('0x6d')]&&_0x3c6176[_0x72d4('0x6d')]!==_0x72d4('0x6e')){logger[_0x72d4('0x1e')](_0x72d4('0x6f'),_0x72d4('0x70'));_0x42e366[_0x72d4('0x5c')]=util[_0x72d4('0x3d')](_0x72d4('0x71'),_0x25cf69[_0x72d4('0x58')],_0x42e366[_0x72d4('0x5d')],md5(_0x42e366[_0x72d4('0x5d')]));}return getConnection(_0x25cf69)[_0x72d4('0x22')](function(_0x16ca97){_0x5d3fef=_0x16ca97;return getUser(_0x25cf69,_0x486bec[_0x72d4('0x5e')],_0x5d3fef);})[_0x72d4('0x22')](function(_0x624413){_0x38b864=_0x624413;return getEndUser(_0x25cf69,_0x164599,_0x42e366[_0x72d4('0x72')],_0x42e366[_0x72d4('0x73')],_0x5d3fef);})[_0x72d4('0x22')](function(_0x173aac){_0x280c48=_0x173aac;return getTicket(_0x25cf69,_0x38b864,_0x280c48,_0x164599,_0x42e366,_0x164599[_0x72d4('0x61')],_0x5d3fef,_0x72d4('0x6c'));})[_0x72d4('0x22')](function(_0x28e26a){_0x557016=_0x28e26a;logger[_0x72d4('0x1e')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x557016['id']);logger[_0x72d4('0x1e')](_0x72d4('0x74'),_0x557016['id'],_0x486bec[_0x72d4('0x4d')],_0x25cf69[_0x72d4('0x37')]);switch(_0x25cf69[_0x72d4('0x37')]){case _0x72d4('0x75'):emit(util[_0x72d4('0x3d')](_0x72d4('0x76'),_0x486bec[_0x72d4('0x4d')]),_0x72d4('0x65'),{'recordId':_0x557016['id']});break;case _0x72d4('0x66'):emit(util[_0x72d4('0x3d')](_0x72d4('0x76'),_0x486bec[_0x72d4('0x4d')]),'trigger:browser:url',{'uri':util[_0x72d4('0x3d')](_0x72d4('0x68'),_0x5d3fef[_0x72d4('0x69')],_0x557016['id'])});break;default:logger[_0x72d4('0x6a')](_0x72d4('0x6f'),_0x72d4('0x77'));}})[_0x72d4('0x6b')](function(_0x33dbec){logger['error'](_0x72d4('0x6f'),_0x33dbec);});};exports[_0x72d4('0x78')]=function(_0xbd5fba,_0x38f5a4,_0x1ef19e,_0x21d3e0,_0x338f9a,_0x4f07ad){var _0x23e088,_0x11f1eb,_0x13e4c3,_0x2454a2;_0x4f07ad[_0x72d4('0x58')]=intUtil[_0x72d4('0x59')](_0x4f07ad[_0x72d4('0x58')]);_0x4f07ad[_0x72d4('0x52')]=intUtil[_0x72d4('0x59')](_0x4f07ad[_0x72d4('0x52')]);if(_0x338f9a&&_0x338f9a[_0x72d4('0x5a')]){logger[_0x72d4('0x1e')]('['+_0x38f5a4['lastevent'][_0x72d4('0x79')]()+']',_0x72d4('0x70'));_0x38f5a4[_0x72d4('0x5c')]=util[_0x72d4('0x3d')](_0x72d4('0x71'),_0x4f07ad['serverUrl'],_0x38f5a4[_0x72d4('0x5d')],md5(_0x38f5a4['uniqueid']));}else{_0x38f5a4['recordingURL']='';}return getConnection(_0x4f07ad)['then'](function(_0x5b28a5){_0x2454a2=_0x5b28a5;if(!_[_0x72d4('0x1a')](_0x21d3e0)){return getUser(_0x4f07ad,_0x21d3e0[_0x72d4('0x4d')],_0x2454a2);}else{return getUser(_0x4f07ad,null,_0x2454a2);}})[_0x72d4('0x22')](function(_0x5bad58){_0x23e088=_0x5bad58;return getEndUser(_0x4f07ad,_0x1ef19e,_0x38f5a4[_0x72d4('0x5f')],_0x38f5a4[_0x72d4('0x60')],_0x2454a2);})[_0x72d4('0x22')](function(_0x57521a){_0x11f1eb=_0x57521a;return getTicket(_0x4f07ad,_0x23e088,_0x11f1eb,_0x1ef19e,_0x38f5a4,_0x1ef19e[_0x72d4('0x61')],_0x2454a2);})[_0x72d4('0x22')](function(_0x25e764){_0x13e4c3=_0x25e764;logger[_0x72d4('0x1e')]('['+_0x38f5a4[_0x72d4('0x7a')]['toUpperCase']()+_0x72d4('0x7b'),_0x13e4c3['id']);logger[_0x72d4('0x1e')]('['+_0x38f5a4[_0x72d4('0x7a')][_0x72d4('0x79')]()+']\x20Integration\x20account\x20type\x20%s.',_0x4f07ad[_0x72d4('0x37')]);})[_0x72d4('0x6b')](function(_0x3231e0){logger[_0x72d4('0x6a')]('['+_0x38f5a4[_0x72d4('0x7a')]['toUpperCase']()+']',_0x3231e0);});}; \ No newline at end of file +var _0x2bbf=['getString','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','contact','lead','WhoId','endUserType','account','WhatId','Case','ContactId','AccountId','leadId','sobject','create','validateEmail','then','length','find','Email','info','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','Contact','execute','additionalSearchLead','account_contact_lead','additionalSearchAccount','merge','Account','$or','Lead','first','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','forEach','includes','string','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','password','concat','securityToken','Connection','remoteUri','clientId','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','calleridname','calleridnum','integrationTab','user:%s','trigger:browser:url','%s/%s/e','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','email','destcalleridname','destcalleridnum','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','trigger:salesforce:display','newTab','Salesforce\x20account\x20type\x20not\x20recognized','lastevent','toUpperCase','isNil',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','md5','jsforce','util','./util','../../../../config/environment','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','emit','assign'];(function(_0x246e95,_0x33aca9){var _0x466bd7=function(_0xeb35b4){while(--_0xeb35b4){_0x246e95['push'](_0x246e95['shift']());}};_0x466bd7(++_0x33aca9);}(_0x2bbf,0x1f1));var _0xf2bb=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x2bbf[_0x24061a];return _0x82054e;};'use strict';var _=require('lodash');var rp=require(_0xf2bb('0x0'));var moment=require(_0xf2bb('0x1'));var BPromise=require(_0xf2bb('0x2'));var md5=require(_0xf2bb('0x3'));var jsforce=require(_0xf2bb('0x4'));var util=require(_0xf2bb('0x5'));var Redis=require('ioredis');var intUtil=require(_0xf2bb('0x6'));var config=require(_0xf2bb('0x7'));var logger=require(_0xf2bb('0x8'))('salesforce');config['redis']=_[_0xf2bb('0x9')](config[_0xf2bb('0xa')],{'host':_0xf2bb('0xb'),'port':0x18eb});var io=require(_0xf2bb('0xc'))(new Redis(config['redis']));function emit(_0x2aef6c,_0x5f337a,_0x1aec33){io['to'](_0x2aef6c)[_0xf2bb('0xd')](_0x5f337a,_0x1aec33);}function getTicket(_0x4b0729,_0xe539b6,_0x511b62,_0x462778,_0x4bdfc4,_0x1a8919,_0x139ad5,_0x28cc5f){var _0x56a2fc=Object[_0xf2bb('0xe')]({},{'OwnerId':_0xe539b6['id'],'Subject':intUtil[_0xf2bb('0xf')](_0x462778[_0xf2bb('0x10')],_0x4bdfc4,'\x20'),'Description':intUtil[_0xf2bb('0xf')](_0x462778[_0xf2bb('0x11')],_0x4bdfc4,'\x0a')},getCustomFields(_0x1a8919,_0x4bdfc4));if(_0x511b62){if(_0x462778[_0xf2bb('0x12')]===_0xf2bb('0x13')){_0x56a2fc[_0xf2bb('0x14')]=moment[_0xf2bb('0x15')]();_0x56a2fc['IsReminderSet']=![];_0x56a2fc['IsRecurrence']=![];if(_0x511b62['endUserType']===_0xf2bb('0x16')||_0x511b62['endUserType']===_0xf2bb('0x17')){_0x56a2fc[_0xf2bb('0x18')]=_0x511b62['id'];}else if(_0x511b62[_0xf2bb('0x19')]===_0xf2bb('0x1a')){_0x56a2fc[_0xf2bb('0x1b')]=_0x511b62['id'];}}else if(_0x462778['ticketType']===_0xf2bb('0x1c')){if(_0x511b62[_0xf2bb('0x19')]==='contact'){_0x56a2fc[_0xf2bb('0x1d')]=_0x511b62['id'];}else if(_0x511b62[_0xf2bb('0x19')]===_0xf2bb('0x1a')){_0x56a2fc[_0xf2bb('0x1e')]=_0x511b62['id'];}else if(_0x511b62['endUserType']===_0xf2bb('0x17')&&_0x462778[_0xf2bb('0x1f')]){_0x56a2fc[_0x462778[_0xf2bb('0x1f')]]=_0x511b62['id'];}else{logger['info']('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x139ad5[_0xf2bb('0x20')](_0x462778['ticketType'])[_0xf2bb('0x21')](_0x56a2fc);}function getUser(_0x120b54,_0x2602ba,_0x9d9d9){if(!_['isNil'](_0x2602ba)&&intUtil[_0xf2bb('0x22')](_0x2602ba)){var _0x50de4f={'Email':_0x2602ba};var _0x4bcbd7={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x9d9d9[_0xf2bb('0x20')]('User')['find'](_0x50de4f,_0x4bcbd7)['execute']()[_0xf2bb('0x23')](function(_0x47a7a1){if(_0x47a7a1[_0xf2bb('0x24')]){var _0x17a49d=_[_0xf2bb('0x25')](_0x47a7a1,function(_0xafd750){return _0xafd750[_0xf2bb('0x26')]===_0x2602ba;});if(_0x17a49d){logger[_0xf2bb('0x27')]('Agent\x20%s\x20found.',_0x2602ba);return BPromise[_0xf2bb('0x28')]({'id':_0x17a49d['Id'],'name':_0x17a49d[_0xf2bb('0x29')]});}}else{logger[_0xf2bb('0x27')](_0xf2bb('0x2a'),_0x2602ba);return _0x9d9d9[_0xf2bb('0x2b')]()[_0xf2bb('0x23')](function(_0x33d9d9){return BPromise[_0xf2bb('0x28')]({'id':_0x33d9d9[_0xf2bb('0x2c')],'name':_0x33d9d9[_0xf2bb('0x2d')]});});}});}else{logger[_0xf2bb('0x27')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x2602ba);return _0x9d9d9[_0xf2bb('0x2b')]()[_0xf2bb('0x23')](function(_0x367bc5){return BPromise[_0xf2bb('0x28')]({'id':_0x367bc5['user_id'],'name':_0x367bc5['display_name']});});}}function getEndUser(_0x159bd2,_0x51c612,_0x4ca70c,_0x5af443,_0xb1da88){var _0x40484b={'$or':{'Phone':_0x5af443}};var _0x2ccf79={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xf2bb('0x28')]()[_0xf2bb('0x23')](function(){logger['info'](_0xf2bb('0x2e'),_0x5af443,_0x51c612[_0xf2bb('0x2f')]);switch(_0x51c612[_0xf2bb('0x2f')]){case'contact_lead':var _0x2744e2=_[_0xf2bb('0x30')](_0x40484b);if(_0x51c612['additionalSearchContact']){var _0x44af0b={};_0x44af0b[_0x51c612[_0xf2bb('0x31')]]=_0x5af443;_['merge'](_0x2744e2['$or'],_0x44af0b);}return _0xb1da88[_0xf2bb('0x20')](_0xf2bb('0x32'))[_0xf2bb('0x25')](_0x2744e2,_0x2ccf79)[_0xf2bb('0x33')]()[_0xf2bb('0x23')](function(_0x209f97){if(_0x209f97&&_0x209f97[_0xf2bb('0x24')]){return _0x209f97;}else{var _0x50a681=_[_0xf2bb('0x30')](_0x40484b);if(_0x51c612[_0xf2bb('0x34')]){var _0x4582d3={};_0x4582d3[_0x51c612[_0xf2bb('0x34')]]=_0x5af443;_['merge'](_0x50a681['$or'],_0x4582d3);}return _0xb1da88[_0xf2bb('0x20')]('Lead')[_0xf2bb('0x25')](_0x50a681,_0x2ccf79);}});case _0xf2bb('0x35'):var _0x2a1ccb=_[_0xf2bb('0x30')](_0x40484b);if(_0x51c612[_0xf2bb('0x36')]){var _0x44af0b={};_0x44af0b[_0x51c612['additionalSearchAccount']]=_0x5af443;_[_0xf2bb('0x37')](_0x2a1ccb['$or'],_0x44af0b);}return _0xb1da88['sobject'](_0xf2bb('0x38'))[_0xf2bb('0x25')](_0x2a1ccb,_0x2ccf79)[_0xf2bb('0x33')]()[_0xf2bb('0x23')](function(_0x5524e8){if(_0x5524e8&&_0x5524e8[_0xf2bb('0x24')]){return _0x5524e8;}else{var _0x152899=_[_0xf2bb('0x30')](_0x40484b);if(_0x51c612[_0xf2bb('0x31')]){var _0xb503a6={};_0xb503a6[_0x51c612[_0xf2bb('0x31')]]=_0x5af443;_[_0xf2bb('0x37')](_0x152899[_0xf2bb('0x39')],_0xb503a6);}return _0xb1da88[_0xf2bb('0x20')](_0xf2bb('0x32'))['find'](_0x152899,_0x2ccf79)['then'](function(_0x35a6d4){if(_0x35a6d4&&_0x35a6d4[_0xf2bb('0x24')]){return _0x35a6d4;}else{var _0x346688=_['cloneDeep'](_0x40484b);if(_0x51c612[_0xf2bb('0x34')]){var _0x2ff14f={};_0x2ff14f[_0x51c612[_0xf2bb('0x34')]]=_0x5af443;_['merge'](_0x346688[_0xf2bb('0x39')],_0x2ff14f);}return _0xb1da88[_0xf2bb('0x20')](_0xf2bb('0x3a'))[_0xf2bb('0x25')](_0x346688,_0x2ccf79);}});}});case _0xf2bb('0x16'):var _0x2744e2=_['cloneDeep'](_0x40484b);if(_0x51c612['additionalSearchContact']){var _0x44af0b={};_0x44af0b[_0x51c612[_0xf2bb('0x31')]]=_0x5af443;_[_0xf2bb('0x37')](_0x2744e2[_0xf2bb('0x39')],_0x44af0b);}return _0xb1da88[_0xf2bb('0x20')](_0xf2bb('0x32'))[_0xf2bb('0x25')](_0x2744e2,_0x2ccf79)[_0xf2bb('0x33')]();case _0xf2bb('0x17'):var _0x3638b7=_[_0xf2bb('0x30')](_0x40484b);if(_0x51c612[_0xf2bb('0x34')]){var _0x44af0b={};_0x44af0b[_0x51c612[_0xf2bb('0x34')]]=_0x5af443;_[_0xf2bb('0x37')](_0x3638b7[_0xf2bb('0x39')],_0x44af0b);}return _0xb1da88['sobject'](_0xf2bb('0x3a'))[_0xf2bb('0x25')](_0x3638b7,_0x2ccf79);case _0xf2bb('0x1a'):var _0x2a1ccb=_['cloneDeep'](_0x40484b);if(_0x51c612['additionalSearchAccount']){var _0x44af0b={};_0x44af0b[_0x51c612[_0xf2bb('0x36')]]=_0x5af443;_['merge'](_0x2a1ccb[_0xf2bb('0x39')],_0x44af0b);}return _0xb1da88[_0xf2bb('0x20')](_0xf2bb('0x38'))[_0xf2bb('0x25')](_0x2a1ccb,_0x2ccf79);default:return null;}})[_0xf2bb('0x23')](function(_0x49aaa1){if(_0x49aaa1&&_0x49aaa1[_0xf2bb('0x24')]){var _0x9e3798=_[_0xf2bb('0x3b')](_0x49aaa1);if(_0x9e3798){return BPromise[_0xf2bb('0x28')]({'id':_0x9e3798['Id'],'name':_0x9e3798[_0xf2bb('0x29')],'phone':_0x9e3798['Phone'],'endUserType':_0x9e3798[_0xf2bb('0x3c')][_0xf2bb('0x3d')][_0xf2bb('0x3e')]()});}}})[_0xf2bb('0x23')](function(_0x5a6a52){if(_0x5a6a52){logger[_0xf2bb('0x27')](_0xf2bb('0x3f'),_0x5a6a52[_0xf2bb('0x19')],_0x5af443);return BPromise[_0xf2bb('0x28')](_0x5a6a52);}else{logger[_0xf2bb('0x27')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x5af443);var _0x54dcea={'Phone':_0x5af443};if(_0x51c612[_0xf2bb('0x40')]){if(_0x51c612[_0xf2bb('0x40')]===_0xf2bb('0x16')){logger[_0xf2bb('0x27')](_0xf2bb('0x41'),_0x5af443,_0x51c612[_0xf2bb('0x40')]);_0x54dcea[_0xf2bb('0x42')]=_0x4ca70c!==_0xf2bb('0x43')?_0x4ca70c:util['format'](_0xf2bb('0x44'),_0x5af443);}else if(_0x51c612[_0xf2bb('0x40')]==='lead'){logger[_0xf2bb('0x27')](_0xf2bb('0x41'),_0x5af443,_0x51c612[_0xf2bb('0x40')]);_0x54dcea[_0xf2bb('0x42')]=_0x4ca70c!==_0xf2bb('0x43')?_0x4ca70c:util['format'](_0xf2bb('0x44'),_0x5af443);_0x54dcea[_0xf2bb('0x45')]=_0xf2bb('0x46');}else if(_0x51c612[_0xf2bb('0x40')]==='account'){logger['info'](_0xf2bb('0x41'),_0x5af443,_0x51c612[_0xf2bb('0x40')]);_0x54dcea[_0xf2bb('0x29')]=_0x4ca70c!==_0xf2bb('0x43')?_0x4ca70c:util['format'](_0xf2bb('0x44'),_0x5af443);}else{return null;}}return _0xb1da88[_0xf2bb('0x20')](_[_0xf2bb('0x47')](_0x51c612[_0xf2bb('0x40')]))[_0xf2bb('0x21')](_0x54dcea)[_0xf2bb('0x23')](function(_0x33b23f){return BPromise['resolve']({'id':_0x33b23f['id'],'endUserType':_0x51c612[_0xf2bb('0x40')]});});}});}function getCustomFields(_0xe80421,_0x14413b){var _0x36e514={};if(_0xe80421[_0xf2bb('0x24')]>0x0){_[_0xf2bb('0x48')](_0xe80421,function(_0x72a247){if(_[_0xf2bb('0x49')]([_0xf2bb('0x4a'),_0xf2bb('0x4b')],_0x72a247[_0xf2bb('0x3d')])&&_0x72a247['idField']){_0x36e514[_0x72a247[_0xf2bb('0x4c')]]=_0x72a247[_0xf2bb('0x4d')][_0xf2bb('0x4e')]();}else if(_0x72a247['type']===_0xf2bb('0x4f')&&_0x72a247[_0xf2bb('0x50')]&&_0x72a247[_0xf2bb('0x4c')]){_0x14413b[_0x72a247['variableName']]&&(_0x36e514[_0x72a247['idField']]=_0x14413b[_0x72a247[_0xf2bb('0x50')]][_0xf2bb('0x4e')]());}else if(_0x72a247[_0xf2bb('0x3d')]===_0xf2bb('0x51')&&_0x72a247[_0xf2bb('0x52')]&&_0x72a247[_0xf2bb('0x52')][_0xf2bb('0x53')]&&_0x72a247[_0xf2bb('0x4c')]){_0x14413b[_0x72a247[_0xf2bb('0x52')]['name'][_0xf2bb('0x3e')]()]&&(_0x36e514[_0x72a247[_0xf2bb('0x4c')]]=_0x14413b[_0x72a247[_0xf2bb('0x52')][_0xf2bb('0x53')][_0xf2bb('0x3e')]()][_0xf2bb('0x4e')]());}});}return _0x36e514;}function getConnection(_0x58cbc3){var _0x2833a0=_0x58cbc3[_0xf2bb('0x54')][_0xf2bb('0x55')](_0x58cbc3[_0xf2bb('0x56')]);var _0x40daf2=new jsforce[(_0xf2bb('0x57'))]({'oauth2':{'loginUrl':_0x58cbc3[_0xf2bb('0x58')]||'https://login.salesforce.com','clientId':_0x58cbc3[_0xf2bb('0x59')],'clientSecret':_0x58cbc3['clientSecret']}});return _0x40daf2[_0xf2bb('0x5a')](_0x58cbc3[_0xf2bb('0x5b')],_0x2833a0)[_0xf2bb('0x23')](function(){logger['info'](_0xf2bb('0x5c'));return _0x40daf2;});}exports[_0xf2bb('0x5d')]=function(_0x3208f7,_0x308008,_0x6f86bb,_0x4eb469,_0x3fc9e4,_0x5bede4){var _0x534ecf,_0x937446,_0x1f8aa3,_0xc7dfd8;_0x5bede4[_0xf2bb('0x5e')]=intUtil[_0xf2bb('0x5f')](_0x5bede4[_0xf2bb('0x5e')]);_0x5bede4[_0xf2bb('0x58')]=intUtil[_0xf2bb('0x5f')](_0x5bede4[_0xf2bb('0x58')]);if(_0x3fc9e4&&_0x3fc9e4[_0xf2bb('0x60')]){logger[_0xf2bb('0x27')](_0xf2bb('0x61'),'Recording\x20is\x20enabled!');_0x308008['recordingURL']=util[_0xf2bb('0x62')](_0xf2bb('0x63'),_0x5bede4['serverUrl'],_0x308008[_0xf2bb('0x64')],md5(_0x308008[_0xf2bb('0x64')]));}else{_0x308008[_0xf2bb('0x65')]='';}return getConnection(_0x5bede4)[_0xf2bb('0x23')](function(_0x2033b9){_0xc7dfd8=_0x2033b9;return getUser(_0x5bede4,_0x4eb469['email'],_0xc7dfd8);})[_0xf2bb('0x23')](function(_0x2bcd5a){_0x534ecf=_0x2bcd5a;return getEndUser(_0x5bede4,_0x6f86bb,_0x308008[_0xf2bb('0x66')],_0x308008[_0xf2bb('0x67')],_0xc7dfd8);})[_0xf2bb('0x23')](function(_0x2da539){_0x937446=_0x2da539;return getTicket(_0x5bede4,_0x534ecf,_0x937446,_0x6f86bb,_0x308008,_0x6f86bb['Fields'],_0xc7dfd8,_0xf2bb('0x5d'));})[_0xf2bb('0x23')](function(_0x4bdff7){_0x1f8aa3=_0x4bdff7;logger[_0xf2bb('0x27')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x1f8aa3['id']);logger[_0xf2bb('0x27')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x1f8aa3['id'],_0x4eb469[_0xf2bb('0x53')],_0x5bede4['type']);switch(_0x5bede4['type']){case _0xf2bb('0x68'):emit(util[_0xf2bb('0x62')]('user:%s',_0x4eb469[_0xf2bb('0x53')]),'trigger:salesforce:display',{'recordId':_0x1f8aa3['id']});break;case'newTab':emit(util[_0xf2bb('0x62')](_0xf2bb('0x69'),_0x4eb469[_0xf2bb('0x53')]),_0xf2bb('0x6a'),{'uri':util[_0xf2bb('0x62')](_0xf2bb('0x6b'),_0xc7dfd8['instanceUrl'],_0x1f8aa3['id'])});break;default:logger[_0xf2bb('0x6c')](_0xf2bb('0x6d'));}})[_0xf2bb('0x6e')](function(_0x1b353a){logger['error'](_0xf2bb('0x61'),_0x1b353a);});};exports[_0xf2bb('0x6f')]=function(_0x4c890f,_0x1ea68d,_0x57b6d0,_0x1fac3f,_0x304593,_0x307ed1,_0x5a9d78){var _0x4bd398,_0x35ff8e,_0x2e9b0e,_0x360c04;_0x307ed1['serverUrl']=intUtil['stripTrailingSlash'](_0x307ed1[_0xf2bb('0x5e')]);_0x307ed1['remoteUri']=intUtil['stripTrailingSlash'](_0x307ed1[_0xf2bb('0x58')]);if(_0x5a9d78&&_0x5a9d78[_0xf2bb('0x70')]&&_0x5a9d78[_0xf2bb('0x70')]!==_0xf2bb('0x71')){logger['info'](_0xf2bb('0x72'),_0xf2bb('0x73'));_0x1ea68d[_0xf2bb('0x65')]=util['format'](_0xf2bb('0x63'),_0x307ed1[_0xf2bb('0x5e')],_0x1ea68d[_0xf2bb('0x64')],md5(_0x1ea68d[_0xf2bb('0x64')]));}return getConnection(_0x307ed1)[_0xf2bb('0x23')](function(_0xcd695c){_0x360c04=_0xcd695c;return getUser(_0x307ed1,_0x1fac3f[_0xf2bb('0x74')],_0x360c04);})['then'](function(_0xcd675f){_0x4bd398=_0xcd675f;return getEndUser(_0x307ed1,_0x57b6d0,_0x1ea68d[_0xf2bb('0x75')],_0x1ea68d[_0xf2bb('0x76')],_0x360c04);})['then'](function(_0x5e0ff1){_0x35ff8e=_0x5e0ff1;return getTicket(_0x307ed1,_0x4bd398,_0x35ff8e,_0x57b6d0,_0x1ea68d,_0x57b6d0[_0xf2bb('0x77')],_0x360c04,_0xf2bb('0x6f'));})['then'](function(_0x583a11){_0x2e9b0e=_0x583a11;logger[_0xf2bb('0x27')](_0xf2bb('0x78'),_0x2e9b0e['id']);logger[_0xf2bb('0x27')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x2e9b0e['id'],_0x1fac3f['name'],_0x307ed1[_0xf2bb('0x3d')]);switch(_0x307ed1[_0xf2bb('0x3d')]){case _0xf2bb('0x68'):emit(util[_0xf2bb('0x62')](_0xf2bb('0x69'),_0x1fac3f[_0xf2bb('0x53')]),_0xf2bb('0x79'),{'recordId':_0x2e9b0e['id']});break;case _0xf2bb('0x7a'):emit(util['format'](_0xf2bb('0x69'),_0x1fac3f['name']),_0xf2bb('0x6a'),{'uri':util[_0xf2bb('0x62')](_0xf2bb('0x6b'),_0x360c04['instanceUrl'],_0x2e9b0e['id'])});break;default:logger[_0xf2bb('0x6c')](_0xf2bb('0x72'),_0xf2bb('0x7b'));}})[_0xf2bb('0x6e')](function(_0x36365e){logger[_0xf2bb('0x6c')](_0xf2bb('0x72'),_0x36365e);});};exports['unmanaged']=function(_0x27571f,_0x103d87,_0x294d24,_0x3dd8b6,_0x4c7bc7,_0x39d060){var _0x5b076c,_0x4eedcf,_0x4671e2,_0x189bc5;_0x39d060[_0xf2bb('0x5e')]=intUtil[_0xf2bb('0x5f')](_0x39d060[_0xf2bb('0x5e')]);_0x39d060[_0xf2bb('0x58')]=intUtil['stripTrailingSlash'](_0x39d060['remoteUri']);if(_0x4c7bc7&&_0x4c7bc7[_0xf2bb('0x60')]){logger[_0xf2bb('0x27')]('['+_0x103d87[_0xf2bb('0x7c')][_0xf2bb('0x7d')]()+']',_0xf2bb('0x73'));_0x103d87[_0xf2bb('0x65')]=util[_0xf2bb('0x62')](_0xf2bb('0x63'),_0x39d060[_0xf2bb('0x5e')],_0x103d87[_0xf2bb('0x64')],md5(_0x103d87['uniqueid']));}else{_0x103d87[_0xf2bb('0x65')]='';}return getConnection(_0x39d060)[_0xf2bb('0x23')](function(_0x37717a){_0x189bc5=_0x37717a;if(!_[_0xf2bb('0x7e')](_0x3dd8b6)){return getUser(_0x39d060,_0x3dd8b6[_0xf2bb('0x53')],_0x189bc5);}else{return getUser(_0x39d060,null,_0x189bc5);}})[_0xf2bb('0x23')](function(_0x385448){_0x5b076c=_0x385448;return getEndUser(_0x39d060,_0x294d24,_0x103d87[_0xf2bb('0x66')],_0x103d87[_0xf2bb('0x67')],_0x189bc5);})['then'](function(_0x2d16f4){_0x4eedcf=_0x2d16f4;return getTicket(_0x39d060,_0x5b076c,_0x4eedcf,_0x294d24,_0x103d87,_0x294d24['Fields'],_0x189bc5);})['then'](function(_0x11df3e){_0x4671e2=_0x11df3e;logger[_0xf2bb('0x27')]('['+_0x103d87['lastevent'][_0xf2bb('0x7d')]()+']\x20Ticket\x20%s\x20created.',_0x4671e2['id']);logger[_0xf2bb('0x27')]('['+_0x103d87['lastevent'][_0xf2bb('0x7d')]()+_0xf2bb('0x7f'),_0x39d060[_0xf2bb('0x3d')]);})[_0xf2bb('0x6e')](function(_0x9a49b5){logger['error']('['+_0x103d87[_0xf2bb('0x7c')]['toUpperCase']()+']',_0x9a49b5);});}; \ 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 12ffc14..1ed2f62 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 _0x7c68=['bluebird','util','ioredis','../../../../config/logger','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','],\x20getUser\x20rp\x20obj','active','true','userId','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','adminEmail','],\x20createEndUser\x20input\x20crm','POST','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','catch','],\x20getEndUser\x20input\x20crm','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','includes','string','picklist','type','nameField','toLowerCase','content','customField','idField','toString','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','Subjects','Descriptions','Fields','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','ticketId','forEach','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','format','%s/api/now/table/','isNil','email','destcalleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash'];(function(_0x54e10b,_0x482985){var _0x13595c=function(_0x1c7b1f){while(--_0x1c7b1f){_0x54e10b['push'](_0x54e10b['shift']());}};_0x13595c(++_0x482985);}(_0x7c68,0xd5));var _0x87c6=function(_0x1e0fd7,_0x43a6cd){_0x1e0fd7=_0x1e0fd7-0x0;var _0x3255a0=_0x7c68[_0x1e0fd7];return _0x3255a0;};'use strict';var _=require(_0x87c6('0x0'));var Promise=require(_0x87c6('0x1'));var rp=require('request-promise');var util=require(_0x87c6('0x2'));var md5=require('md5');var Redis=require(_0x87c6('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x87c6('0x4'))('servicenow');config[_0x87c6('0x5')]=_['defaults'](config[_0x87c6('0x5')],{'host':_0x87c6('0x6'),'port':0x18eb});var io=require(_0x87c6('0x7'))(new Redis(config[_0x87c6('0x5')]));function getAdminUser(_0x397754,_0x2f35c5,_0x512b5d,_0x9a3647,_0x1aa4d3,_0x14a004){return new Promise(function(_0x5804b9,_0xe27bdc){var _0x450d81={'method':_0x87c6('0x8'),'uri':_0x9a3647+_0x87c6('0x9')+'&'+_0x1aa4d3+'&'+_0x14a004,'auth':_0x2f35c5,'json':!![]};return rp(_0x450d81)[_0x87c6('0xa')](function(_0x1d61b7){if(_0x1d61b7[_0x87c6('0xb')][_0x87c6('0xc')]>0x0){_0x512b5d[_0x87c6('0xd')]=_0x1d61b7[_0x87c6('0xb')][0x0][_0x87c6('0xe')];}logger[_0x87c6('0xf')]('['+[_0x397754[_0x87c6('0x10')]()]+_0x87c6('0x11'),_0x512b5d);_0x5804b9(_0x512b5d);})['catch'](function(_0x2e5f4f){logger[_0x87c6('0x12')]('['+[_0x397754[_0x87c6('0x10')]()]+']',_0x2e5f4f[_0x87c6('0x13')]);_0xe27bdc(_0x2e5f4f[_0x87c6('0x13')]);});});}function getUser(_0x493796,_0x13e689,_0x2382b9,_0x4d5294,_0xe7d831){return function(_0x3bbb46){logger['info']('['+[_0x493796[_0x87c6('0x10')]()]+_0x87c6('0x14'),_0x3bbb46);return new Promise(function(_0x496471,_0x4533e1){if(intUtil[_0x87c6('0x15')](_0x3bbb46[_0x87c6('0x16')])){var _0x21a4c0={'method':'GET','uri':_0x2382b9+'sys_user?sysparm_query=email%3D'+_0x3bbb46[_0x87c6('0x16')]+'&'+_0x4d5294+'&'+_0xe7d831,'auth':_0x13e689,'json':!![]};logger[_0x87c6('0xf')]('['+[_0x493796[_0x87c6('0x10')]()]+_0x87c6('0x17'),_0x21a4c0);return rp(_0x21a4c0)[_0x87c6('0xa')](function(_0x471d19){logger[_0x87c6('0xf')]('['+[_0x493796[_0x87c6('0x10')]()]+'],\x20getUser\x20entity',_0x471d19);if(_0x471d19[_0x87c6('0xb')][_0x87c6('0xc')]>0x0&&String(_0x471d19[_0x87c6('0xb')][0x0][_0x87c6('0x18')])===_0x87c6('0x19')){_0x3bbb46['userId']=_0x471d19[_0x87c6('0xb')][0x0][_0x87c6('0xe')];}else{_0x3bbb46[_0x87c6('0x1a')]=_0x3bbb46[_0x87c6('0xd')];_0x3bbb46[_0x87c6('0x16')]=_0x3bbb46['adminEmail'];}logger[_0x87c6('0xf')]('['+[_0x493796[_0x87c6('0x10')]()]+_0x87c6('0x1b'),_0x3bbb46);_0x496471(_0x3bbb46);})['catch'](function(_0x36b969){logger[_0x87c6('0x12')]('['+[_0x493796['toUpperCase']()]+']',_0x36b969['message']);_0x4533e1(_0x36b969['message']);});}else{logger[_0x87c6('0xf')]('['+[_0x493796[_0x87c6('0x10')]()]+_0x87c6('0x1c'));_0x3bbb46[_0x87c6('0x1a')]=_0x3bbb46[_0x87c6('0xd')];_0x3bbb46[_0x87c6('0x16')]=_0x3bbb46[_0x87c6('0x1d')];_0x496471(_0x3bbb46);}});};}function createEndUser(_0xdf00bf,_0x5bb699,_0x2b0165,_0x36fa27,_0x3840b4){logger[_0x87c6('0xf')]('['+[_0xdf00bf['toUpperCase']()]+_0x87c6('0x1e'),_0x2b0165);return new Promise(function(_0x24032d,_0x4c4a59){var _0x399d21={'method':_0x87c6('0x1f'),'uri':_0x36fa27+'sys_user?'+_0x3840b4,'body':{'user_name':_0x2b0165[_0x87c6('0x20')],'roles':_0x87c6('0x21'),'first_name':_0x2b0165['endUserNumber'],'active':'true','date_format':_0x87c6('0x22'),'phone':_0x2b0165[_0x87c6('0x20')]},'auth':_0x5bb699,'json':!![]};return rp(_0x399d21)['then'](function(_0x18e4bc){logger['info']('['+[_0xdf00bf[_0x87c6('0x10')]()]+_0x87c6('0x23'),_0x18e4bc[_0x87c6('0xb')]);_0x2b0165[_0x87c6('0x24')]=_0x18e4bc[_0x87c6('0xb')]['sys_id'];_0x24032d(_0x2b0165);})[_0x87c6('0x25')](function(_0x51d655){logger[_0x87c6('0x12')]('['+[_0xdf00bf[_0x87c6('0x10')]()]+']',_0x51d655[_0x87c6('0x13')]);_0x4c4a59(_0x51d655['message']);});});}function getEndUser(_0x2a6627,_0x12c8c2,_0x6596b5,_0x1f5375,_0x4f8239){return function(_0x514448){logger['info']('['+[_0x2a6627[_0x87c6('0x10')]()]+_0x87c6('0x26'),_0x514448);return new Promise(function(_0x2f41c3,_0x116ea6){var _0x42becb={'method':_0x87c6('0x8'),'uri':_0x6596b5+'sys_user?sysparm_query=phone%3D'+_0x514448[_0x87c6('0x20')]+'&'+_0x1f5375+'&'+_0x4f8239,'auth':_0x12c8c2,'json':!![]};return rp(_0x42becb)[_0x87c6('0xa')](function(_0x5d042d){if(_0x5d042d[_0x87c6('0xb')][_0x87c6('0xc')]>0x0){_0x514448[_0x87c6('0x24')]=_0x5d042d[_0x87c6('0xb')][0x0][_0x87c6('0xe')];logger[_0x87c6('0xf')]('['+[_0x2a6627[_0x87c6('0x10')]()]+_0x87c6('0x27'),_0x514448);_0x2f41c3(_0x514448);}else{return createEndUser(_0x2a6627,_0x12c8c2,_0x514448,_0x6596b5,_0x1f5375)[_0x87c6('0xa')](function(_0x409d17){logger[_0x87c6('0xf')]('['+[_0x2a6627['toUpperCase']()]+_0x87c6('0x28'),_0x409d17);_0x2f41c3(_0x409d17);});}})['catch'](function(_0x589b6f){logger[_0x87c6('0x12')]('['+[_0x2a6627['toUpperCase']()]+']',_0x589b6f['message']);_0x116ea6(_0x589b6f[_0x87c6('0x13')]);});});};}function getCustomFields(_0x5af008,_0x247b5d){var _0x4535ea={};if(_0x5af008[_0x87c6('0xc')]>0x0){_['forEach'](_0x5af008,function(_0x9289c){if(_[_0x87c6('0x29')]([_0x87c6('0x2a'),_0x87c6('0x2b')],_0x9289c[_0x87c6('0x2c')])&&_0x9289c[_0x87c6('0x2d')]&&!_0x9289c['customField']){_0x4535ea[_0x9289c[_0x87c6('0x2d')][_0x87c6('0x2e')]()]=_0x9289c[_0x87c6('0x2f')]['toString']();}else if(_[_0x87c6('0x29')]([_0x87c6('0x2a'),_0x87c6('0x2b')],_0x9289c[_0x87c6('0x2c')])&&_0x9289c['idField']&&_0x9289c[_0x87c6('0x30')]){_0x4535ea[_0x9289c[_0x87c6('0x31')]['toLowerCase']()]=_0x9289c[_0x87c6('0x2f')][_0x87c6('0x32')]();}else if(_0x9289c[_0x87c6('0x2c')]===_0x87c6('0x33')&&_0x9289c[_0x87c6('0x34')]&&_0x9289c[_0x87c6('0x31')]&&_0x9289c[_0x87c6('0x30')]){_0x4535ea[_0x9289c[_0x87c6('0x31')][_0x87c6('0x2e')]()]=_0x247b5d[_0x9289c['variableName']][_0x87c6('0x32')]();}else if(_0x9289c['type']==='customVariable'&&_0x9289c[_0x87c6('0x35')]&&_0x9289c[_0x87c6('0x35')][_0x87c6('0x36')]&&_0x9289c[_0x87c6('0x31')]&&_0x9289c[_0x87c6('0x30')]){_0x4535ea[_0x9289c[_0x87c6('0x31')][_0x87c6('0x2e')]()]=_0x247b5d[_0x9289c[_0x87c6('0x35')][_0x87c6('0x36')][_0x87c6('0x2e')]()][_0x87c6('0x32')]();}});}return _0x4535ea;}function getTicket(_0x397e0d,_0x2f8731,_0xbdc29b,_0x2c9dbb,_0x444077,_0x56bdfb){return function(_0xc24a99){logger['info']('['+[_0x397e0d['toUpperCase']()]+_0x87c6('0x37'),_0xc24a99);return new Promise(function(_0x3c262b,_0x47e02d){var _0x16def2=_0x397e0d[_0x87c6('0x2e')]()===_0x87c6('0x38')?_0xc24a99[_0x87c6('0x1a')]:_0xc24a99[_0x87c6('0x24')];var _0x5bbdb5={'method':'POST','uri':_0xbdc29b+_0x87c6('0x39')+'?'+_0x56bdfb,'body':Object[_0x87c6('0x3a')]({},{'active':'true','caller_id':_0x16def2,'assigned_to':_0xc24a99['userId'],'short_description':intUtil['getString'](_0x2c9dbb[_0x87c6('0x3b')],_0x444077,'\x20'),'description':intUtil['getString'](_0x2c9dbb[_0x87c6('0x3c')],_0x444077,'\x0a')},getCustomFields(_0x2c9dbb[_0x87c6('0x3d')],_0x444077)),'auth':_0x2f8731,'json':!![]};return rp(_0x5bbdb5)['then'](function(_0x107f65){logger[_0x87c6('0xf')]('['+[_0x397e0d[_0x87c6('0x10')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x107f65['result']);_0xc24a99['ticketId']=_0x107f65[_0x87c6('0xb')][_0x87c6('0xe')];_0xc24a99[_0x87c6('0x3e')]=_0x107f65['result'][_0x87c6('0x3f')];logger[_0x87c6('0xf')]('['+[_0x397e0d[_0x87c6('0x10')]()]+_0x87c6('0x40'),_0xc24a99);_0x3c262b(_0xc24a99);})['catch'](function(_0x53aa13){logger[_0x87c6('0x12')]('['+[_0x397e0d[_0x87c6('0x10')]()]+']',_0x53aa13[_0x87c6('0x13')]);_0x47e02d(_0x53aa13['message']);});});};}function createRemoteTag(_0x56c8e7,_0x57e2e4,_0x2d06f1,_0x4d39bb){return new Promise(function(_0x29984a,_0x49734f){var _0x2780ea={'method':_0x87c6('0x1f'),'uri':_0x2d06f1+_0x87c6('0x41')+'?'+_0x4d39bb,'body':{'short_description':_0x56c8e7,'global':!![],'active':!![],'name':_0x56c8e7},'auth':_0x57e2e4,'json':!![]};return rp(_0x2780ea)['then'](function(_0x2d8b78){var _0x1e18d1=_0x2d8b78[_0x87c6('0xb')]['sys_id'];_0x29984a(_0x1e18d1);});});}function getRemoteTag(_0xc7bc12,_0x167e0c,_0x1c4679,_0x10ee75,_0x3143ce){return new Promise(function(_0x580df4,_0x1b0033){var _0x296619={'method':_0x87c6('0x8'),'uri':_0x1c4679+_0x87c6('0x41')+_0x87c6('0x42')+_0xc7bc12+'&'+_0x10ee75,'auth':_0x167e0c,'json':!![]};return rp(_0x296619)[_0x87c6('0xa')](function(_0x890825){if(_0x890825['result']['length']>0x0){var _0x41543d=_0x890825[_0x87c6('0xb')][0x0]['sys_id'];_0x580df4(_0x41543d);}else{return createRemoteTag(_0xc7bc12,_0x167e0c,_0x1c4679,_0x10ee75)['then'](function(_0x438039){_0x580df4(_0x438039);});}});});}function assignTagToIncident(_0x356677,_0x335a99,_0x2c388c,_0x4253f5,_0x34f395){return new Promise(function(_0x38e19d,_0xdc3897){var _0x57e040={'method':_0x87c6('0x1f'),'uri':_0x2c388c+_0x87c6('0x43')+'?'+_0x34f395,'body':{'label':_0x356677,'table':_0x87c6('0x39'),'id_type':_0x87c6('0x44'),'table_key':_0x4253f5[_0x87c6('0x45')],'title':'Incident\x20-\x20'+_0x4253f5[_0x87c6('0x3e')],'id_display':_0x4253f5[_0x87c6('0x3e')]},'auth':_0x335a99,'json':!![]};return rp(_0x57e040)[_0x87c6('0xa')](function(_0xbe87cb){_0x38e19d();})[_0x87c6('0x25')](function(){_0x38e19d();});});}function manageTags(_0x1870dd,_0x22161f,_0x198186,_0xd53c26,_0x245ee7,_0x1ce5b8,_0x3220cf){return new Promise(function(_0x519799,_0x437326){var _0x3e8665=[];_0x22161f[_0x87c6('0x46')](function(_0x350b2b){_0x3e8665[_0x87c6('0x47')](getRemoteTag(_0x350b2b,_0x198186,_0xd53c26,_0x1ce5b8,_0x3220cf));});return Promise[_0x87c6('0x48')](_0x3e8665)[_0x87c6('0xa')](function(_0x17cbf0){if(_0x17cbf0[_0x87c6('0xc')]){logger[_0x87c6('0xf')]('['+[_0x1870dd[_0x87c6('0x10')]()]+_0x87c6('0x49'),_0x17cbf0);var _0x4411a3=[];_0x17cbf0[_0x87c6('0x46')](function(_0x24c4c5){_0x4411a3[_0x87c6('0x47')](assignTagToIncident(_0x24c4c5,_0x198186,_0xd53c26,_0x245ee7,_0x1ce5b8));});return Promise[_0x87c6('0x48')](_0x4411a3)[_0x87c6('0xa')](function(){_0x519799();})['catch'](function(){_0x519799();});}else{_0x519799();}});});}function getTags(_0x227ed9,_0x5a2d3f,_0x2b17e1,_0x43af19,_0xd8a278,_0x282fb1){return function(_0x571490){return new Promise(function(_0x40edc8,_0x2244c5){var _0x413de3=[];var _0x18ce9d=_0x43af19[_0x87c6('0x4a')];if(_0x18ce9d&&_0x18ce9d[_0x87c6('0xc')]>0x0){_0x413de3=_[_0x87c6('0x4b')](_0x18ce9d,_0x87c6('0x36'));}if(_0x413de3[_0x87c6('0xc')]>0x0){return manageTags(_0x227ed9,_0x413de3,_0x5a2d3f,_0x2b17e1,_0x571490,_0xd8a278,_0x282fb1)['then'](function(){_0x40edc8(_0x571490);});}else{_0x40edc8(_0x571490);}});};}function emit(_0x4ef243,_0x46be00,_0x59051c){var _0x282797=_0x87c6('0x4c')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x87c6('0x4d')+'%255EORDERBYDESCnumber';var _0x48e0a9={'uri':_0x4ef243+_0x87c6('0x4e')+_0x59051c+_0x282797};io['to'](util['format'](_0x87c6('0x4f'),_0x46be00))[_0x87c6('0x50')](_0x87c6('0x51'),_0x48e0a9);}exports['cs']=function(_0x60edb0,_0x2952b1,_0x333f15,_0x147d5e,_0x125a63,_0x320018,_0x4b8196,_0xeec3f1){var _0x1b91ce={};var _0x1b886d={'user':_0x320018[_0x87c6('0x52')],'pass':_0x320018[_0x87c6('0x53')]};var _0x5726e1=_0x87c6('0x54');var _0x32a947=_0x87c6('0x55');_0x320018[_0x87c6('0x56')]=intUtil[_0x87c6('0x57')](_0x320018[_0x87c6('0x56')]);_0x320018['serverUrl']=intUtil['stripTrailingSlash'](_0x320018[_0x87c6('0x58')]);var _0x17cab4=util[_0x87c6('0x59')](_0x87c6('0x5a'),_0x320018[_0x87c6('0x56')]);_0x1b91ce[_0x87c6('0x16')]=!_[_0x87c6('0x5b')](_0x147d5e)?_0x147d5e[_0x87c6('0x5c')]:null;_0x1b91ce[_0x87c6('0x1d')]=_0x320018['email'];_0x1b91ce[_0x87c6('0x20')]=_0xeec3f1['toLowerCase']()===_0x87c6('0x38')?_0x2952b1[_0x87c6('0x5d')]:_0x2952b1['calleridnum'];_0x1b91ce[_0x87c6('0x5e')]=_0xeec3f1===_0x87c6('0x5f')||_0xeec3f1==='unmanaged'?_0x87c6('0x5f'):'outbound';var _0x2a834b=util[_0x87c6('0x59')](_0x87c6('0x60'),_0x320018[_0x87c6('0x58')],_0x2952b1[_0x87c6('0x61')],md5(_0x2952b1['uniqueid']));if(_0x125a63&&_0x125a63['monitor_format']){logger[_0x87c6('0xf')](_0x87c6('0x62'),_0x87c6('0x63'));_0x2952b1[_0x87c6('0x64')]=_0x2a834b;}else if(_0x4b8196&&_0x4b8196[_0x87c6('0x65')]&&_0x4b8196['recordingFormat']!=='none'){logger[_0x87c6('0xf')](_0x87c6('0x66'),_0x87c6('0x63'));_0x2952b1[_0x87c6('0x64')]=_0x2a834b;}else{_0x2952b1['recordingURL']='';}return getAdminUser(_0xeec3f1,_0x1b886d,_0x1b91ce,_0x17cab4,_0x32a947,_0x5726e1)[_0x87c6('0xa')](getUser(_0xeec3f1,_0x1b886d,_0x17cab4,_0x32a947,_0x5726e1))[_0x87c6('0xa')](getEndUser(_0xeec3f1,_0x1b886d,_0x17cab4,_0x32a947,_0x5726e1))[_0x87c6('0xa')](getTicket(_0xeec3f1,_0x1b886d,_0x17cab4,_0x333f15,_0x2952b1,_0x32a947))[_0x87c6('0xa')](function(_0x1e2bd8){logger[_0x87c6('0xf')](util[_0x87c6('0x59')](_0x87c6('0x67'),_0x1e2bd8[_0x87c6('0x45')]));logger[_0x87c6('0xf')](util[_0x87c6('0x59')]('call\x20direction:\x20%s',_0xeec3f1));if(_0xeec3f1!=='unmanaged'){logger[_0x87c6('0xf')]('['+[_0xeec3f1[_0x87c6('0x10')]()]+']',_0x87c6('0x68'));emit(_0x320018[_0x87c6('0x56')],_0x147d5e[_0x87c6('0x36')],_0x1e2bd8[_0x87c6('0x45')]);}})['catch'](function(_0x324212){logger[_0x87c6('0x12')]('['+[_0xeec3f1['toUpperCase']()]+_0x87c6('0x69'),util[_0x87c6('0x6a')](_0x324212,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xe65b=['Incident\x20-\x20','ticketNumber','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','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','trigger:browser:url','username','password','sysparm_display_value=true','remoteUri','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','outbound','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','result','adminId','sys_id','toUpperCase','],\x20getAdminUser\x20crm','error','message','info','validateEmail','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','length','active','true','userId','adminEmail','catch',']\x20using\x20admin\x20profile','POST','sys_user?','user','endUserNumber','System','then','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','type','customField','toLowerCase','content','toString','string','picklist','idField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','Incident'];(function(_0x5cdd0f,_0x3c3a5e){var _0x4d4eb8=function(_0x106fef){while(--_0x106fef){_0x5cdd0f['push'](_0x5cdd0f['shift']());}};_0x4d4eb8(++_0x3c3a5e);}(_0xe65b,0x111));var _0xbe65=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xe65b[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xbe65('0x0'));var Promise=require(_0xbe65('0x1'));var rp=require(_0xbe65('0x2'));var util=require(_0xbe65('0x3'));var md5=require(_0xbe65('0x4'));var Redis=require(_0xbe65('0x5'));var intUtil=require(_0xbe65('0x6'));var config=require(_0xbe65('0x7'));var logger=require('../../../../config/logger')(_0xbe65('0x8'));config[_0xbe65('0x9')]=_[_0xbe65('0xa')](config['redis'],{'host':_0xbe65('0xb'),'port':0x18eb});var io=require(_0xbe65('0xc'))(new Redis(config[_0xbe65('0x9')]));function getAdminUser(_0x9982b,_0x1fe1df,_0x4de027,_0x4e05f2,_0x5e121e,_0x3d6aaa){return new Promise(function(_0x355a2f,_0x2e3096){var _0x4a8a04={'method':_0xbe65('0xd'),'uri':_0x4e05f2+_0xbe65('0xe')+'&'+_0x5e121e+'&'+_0x3d6aaa,'auth':_0x1fe1df,'json':!![]};return rp(_0x4a8a04)['then'](function(_0x37715f){if(_0x37715f[_0xbe65('0xf')]['length']>0x0){_0x4de027[_0xbe65('0x10')]=_0x37715f[_0xbe65('0xf')][0x0][_0xbe65('0x11')];}logger['info']('['+[_0x9982b[_0xbe65('0x12')]()]+_0xbe65('0x13'),_0x4de027);_0x355a2f(_0x4de027);})['catch'](function(_0x5d00aa){logger[_0xbe65('0x14')]('['+[_0x9982b[_0xbe65('0x12')]()]+']',_0x5d00aa['message']);_0x2e3096(_0x5d00aa[_0xbe65('0x15')]);});});}function getUser(_0x4fb421,_0x320e92,_0x14ff97,_0x15f6fb,_0x51d44a){return function(_0x529d64){logger[_0xbe65('0x16')]('['+[_0x4fb421['toUpperCase']()]+'],\x20getUser\x20input\x20crm',_0x529d64);return new Promise(function(_0x5cfdd0,_0x2618ca){if(intUtil[_0xbe65('0x17')](_0x529d64['userEmail'])){var _0x2857d9={'method':_0xbe65('0xd'),'uri':_0x14ff97+_0xbe65('0x18')+_0x529d64[_0xbe65('0x19')]+'&'+_0x15f6fb+'&'+_0x51d44a,'auth':_0x320e92,'json':!![]};logger[_0xbe65('0x16')]('['+[_0x4fb421[_0xbe65('0x12')]()]+_0xbe65('0x1a'),_0x2857d9);return rp(_0x2857d9)['then'](function(_0x20f296){logger[_0xbe65('0x16')]('['+[_0x4fb421[_0xbe65('0x12')]()]+_0xbe65('0x1b'),_0x20f296);if(_0x20f296['result'][_0xbe65('0x1c')]>0x0&&String(_0x20f296[_0xbe65('0xf')][0x0][_0xbe65('0x1d')])===_0xbe65('0x1e')){_0x529d64[_0xbe65('0x1f')]=_0x20f296[_0xbe65('0xf')][0x0]['sys_id'];}else{_0x529d64[_0xbe65('0x1f')]=_0x529d64['adminId'];_0x529d64[_0xbe65('0x19')]=_0x529d64[_0xbe65('0x20')];}logger[_0xbe65('0x16')]('['+[_0x4fb421[_0xbe65('0x12')]()]+'],\x20getUser\x20crm',_0x529d64);_0x5cfdd0(_0x529d64);})[_0xbe65('0x21')](function(_0x48b639){logger[_0xbe65('0x14')]('['+[_0x4fb421[_0xbe65('0x12')]()]+']',_0x48b639[_0xbe65('0x15')]);_0x2618ca(_0x48b639['message']);});}else{logger[_0xbe65('0x16')]('['+[_0x4fb421['toUpperCase']()]+_0xbe65('0x22'));_0x529d64['userId']=_0x529d64['adminId'];_0x529d64['userEmail']=_0x529d64[_0xbe65('0x20')];_0x5cfdd0(_0x529d64);}});};}function createEndUser(_0x11a18a,_0x44aba0,_0x23a9cb,_0xc5730d,_0x130689){logger[_0xbe65('0x16')]('['+[_0x11a18a[_0xbe65('0x12')]()]+'],\x20createEndUser\x20input\x20crm',_0x23a9cb);return new Promise(function(_0x4a6bee,_0x153394){var _0x44425c={'method':_0xbe65('0x23'),'uri':_0xc5730d+_0xbe65('0x24')+_0x130689,'body':{'user_name':_0x23a9cb['endUserNumber'],'roles':_0xbe65('0x25'),'first_name':_0x23a9cb[_0xbe65('0x26')],'active':_0xbe65('0x1e'),'date_format':_0xbe65('0x27'),'phone':_0x23a9cb['endUserNumber']},'auth':_0x44aba0,'json':!![]};return rp(_0x44425c)[_0xbe65('0x28')](function(_0x2deb7e){logger[_0xbe65('0x16')]('['+[_0x11a18a[_0xbe65('0x12')]()]+_0xbe65('0x29'),_0x2deb7e[_0xbe65('0xf')]);_0x23a9cb[_0xbe65('0x2a')]=_0x2deb7e[_0xbe65('0xf')][_0xbe65('0x11')];_0x4a6bee(_0x23a9cb);})['catch'](function(_0x3533c1){logger[_0xbe65('0x14')]('['+[_0x11a18a[_0xbe65('0x12')]()]+']',_0x3533c1['message']);_0x153394(_0x3533c1[_0xbe65('0x15')]);});});}function getEndUser(_0x528559,_0x30042e,_0x3a2ce1,_0x67bc2c,_0x5c81a7){return function(_0x9312cf){logger[_0xbe65('0x16')]('['+[_0x528559[_0xbe65('0x12')]()]+_0xbe65('0x2b'),_0x9312cf);return new Promise(function(_0x267e64,_0x3090be){var _0x5ee0a2={'method':_0xbe65('0xd'),'uri':_0x3a2ce1+_0xbe65('0x2c')+_0x9312cf[_0xbe65('0x26')]+'&'+_0x67bc2c+'&'+_0x5c81a7,'auth':_0x30042e,'json':!![]};return rp(_0x5ee0a2)[_0xbe65('0x28')](function(_0xb4f2da){if(_0xb4f2da['result'][_0xbe65('0x1c')]>0x0){_0x9312cf[_0xbe65('0x2a')]=_0xb4f2da[_0xbe65('0xf')][0x0][_0xbe65('0x11')];logger['info']('['+[_0x528559['toUpperCase']()]+_0xbe65('0x2d'),_0x9312cf);_0x267e64(_0x9312cf);}else{return createEndUser(_0x528559,_0x30042e,_0x9312cf,_0x3a2ce1,_0x67bc2c)[_0xbe65('0x28')](function(_0x2b9c39){logger[_0xbe65('0x16')]('['+[_0x528559[_0xbe65('0x12')]()]+_0xbe65('0x2e'),_0x2b9c39);_0x267e64(_0x2b9c39);});}})['catch'](function(_0x2deb23){logger[_0xbe65('0x14')]('['+[_0x528559[_0xbe65('0x12')]()]+']',_0x2deb23[_0xbe65('0x15')]);_0x3090be(_0x2deb23[_0xbe65('0x15')]);});});};}function getCustomFields(_0x45eeaa,_0x45a4e6){var _0x1b9123={};if(_0x45eeaa[_0xbe65('0x1c')]>0x0){_[_0xbe65('0x2f')](_0x45eeaa,function(_0x124d99){if(_[_0xbe65('0x30')](['string','picklist'],_0x124d99[_0xbe65('0x31')])&&_0x124d99['nameField']&&!_0x124d99[_0xbe65('0x32')]){_0x1b9123[_0x124d99['nameField'][_0xbe65('0x33')]()]=_0x124d99[_0xbe65('0x34')][_0xbe65('0x35')]();}else if(_[_0xbe65('0x30')]([_0xbe65('0x36'),_0xbe65('0x37')],_0x124d99[_0xbe65('0x31')])&&_0x124d99[_0xbe65('0x38')]&&_0x124d99['customField']){_0x1b9123[_0x124d99[_0xbe65('0x38')][_0xbe65('0x33')]()]=_0x124d99[_0xbe65('0x34')][_0xbe65('0x35')]();}else if(_0x124d99['type']===_0xbe65('0x39')&&_0x124d99[_0xbe65('0x3a')]&&_0x124d99['idField']&&_0x124d99[_0xbe65('0x32')]){_0x1b9123[_0x124d99[_0xbe65('0x38')][_0xbe65('0x33')]()]=_0x45a4e6[_0x124d99[_0xbe65('0x3a')]][_0xbe65('0x35')]();}else if(_0x124d99['type']===_0xbe65('0x3b')&&_0x124d99[_0xbe65('0x3c')]&&_0x124d99['Variable']['name']&&_0x124d99[_0xbe65('0x38')]&&_0x124d99[_0xbe65('0x32')]){_0x1b9123[_0x124d99[_0xbe65('0x38')][_0xbe65('0x33')]()]=_0x45a4e6[_0x124d99[_0xbe65('0x3c')][_0xbe65('0x3d')][_0xbe65('0x33')]()]['toString']();}});}return _0x1b9123;}function getTicket(_0x490a8f,_0x5aabcf,_0xb4538c,_0x372fb2,_0x85d4f9,_0x1af4be){return function(_0x9b7438){logger['info']('['+[_0x490a8f[_0xbe65('0x12')]()]+_0xbe65('0x3e'),_0x9b7438);return new Promise(function(_0xd9acbc,_0xda18f9){var _0x4e4bfc=_0x490a8f[_0xbe65('0x33')]()==='outbound'?_0x9b7438[_0xbe65('0x1f')]:_0x9b7438[_0xbe65('0x2a')];var _0x1d9167={'method':_0xbe65('0x23'),'uri':_0xb4538c+_0xbe65('0x3f')+'?'+_0x1af4be,'body':Object[_0xbe65('0x40')]({},{'active':_0xbe65('0x1e'),'caller_id':_0x4e4bfc,'assigned_to':_0x9b7438['userId'],'short_description':intUtil[_0xbe65('0x41')](_0x372fb2['Subjects'],_0x85d4f9,'\x20'),'description':intUtil[_0xbe65('0x41')](_0x372fb2[_0xbe65('0x42')],_0x85d4f9,'\x0a')},getCustomFields(_0x372fb2[_0xbe65('0x43')],_0x85d4f9)),'auth':_0x5aabcf,'json':!![]};return rp(_0x1d9167)[_0xbe65('0x28')](function(_0x5ec625){logger[_0xbe65('0x16')]('['+[_0x490a8f[_0xbe65('0x12')]()]+_0xbe65('0x44'),_0x5ec625[_0xbe65('0xf')]);_0x9b7438[_0xbe65('0x45')]=_0x5ec625[_0xbe65('0xf')][_0xbe65('0x11')];_0x9b7438['ticketNumber']=_0x5ec625[_0xbe65('0xf')][_0xbe65('0x46')];logger[_0xbe65('0x16')]('['+[_0x490a8f[_0xbe65('0x12')]()]+_0xbe65('0x47'),_0x9b7438);_0xd9acbc(_0x9b7438);})[_0xbe65('0x21')](function(_0x142238){logger[_0xbe65('0x14')]('['+[_0x490a8f[_0xbe65('0x12')]()]+']',_0x142238[_0xbe65('0x15')]);_0xda18f9(_0x142238[_0xbe65('0x15')]);});});};}function createRemoteTag(_0x2f7e78,_0x984992,_0x165b6b,_0xac565a){return new Promise(function(_0x18fdd8,_0x4f7a30){var _0x48928d={'method':_0xbe65('0x23'),'uri':_0x165b6b+_0xbe65('0x48')+'?'+_0xac565a,'body':{'short_description':_0x2f7e78,'global':!![],'active':!![],'name':_0x2f7e78},'auth':_0x984992,'json':!![]};return rp(_0x48928d)['then'](function(_0x185e64){var _0x44f0c8=_0x185e64[_0xbe65('0xf')][_0xbe65('0x11')];_0x18fdd8(_0x44f0c8);});});}function getRemoteTag(_0x35598f,_0x550b01,_0xf1f78c,_0x397de7,_0xef1e6c){return new Promise(function(_0x7ff903,_0x5a71fa){var _0x52a183={'method':'GET','uri':_0xf1f78c+'label'+_0xbe65('0x49')+_0x35598f+'&'+_0x397de7,'auth':_0x550b01,'json':!![]};return rp(_0x52a183)['then'](function(_0x3156ff){if(_0x3156ff[_0xbe65('0xf')]['length']>0x0){var _0x4ce34b=_0x3156ff['result'][0x0][_0xbe65('0x11')];_0x7ff903(_0x4ce34b);}else{return createRemoteTag(_0x35598f,_0x550b01,_0xf1f78c,_0x397de7)[_0xbe65('0x28')](function(_0x7255f3){_0x7ff903(_0x7255f3);});}});});}function assignTagToIncident(_0x4475ff,_0x1403de,_0x55646f,_0x2032c9,_0x2bc5af){return new Promise(function(_0x5118dd,_0x1c35e8){var _0x40aeae={'method':_0xbe65('0x23'),'uri':_0x55646f+'label_entry'+'?'+_0x2bc5af,'body':{'label':_0x4475ff,'table':_0xbe65('0x3f'),'id_type':_0xbe65('0x4a'),'table_key':_0x2032c9['ticketId'],'title':_0xbe65('0x4b')+_0x2032c9[_0xbe65('0x4c')],'id_display':_0x2032c9['ticketNumber']},'auth':_0x1403de,'json':!![]};return rp(_0x40aeae)['then'](function(_0x5d6933){_0x5118dd();})[_0xbe65('0x21')](function(){_0x5118dd();});});}function manageTags(_0x341221,_0x5ce253,_0x1589f6,_0xce284b,_0x508b31,_0x2b815e,_0x5b8744){return new Promise(function(_0x2eefd8,_0x3459df){var _0x814e19=[];_0x5ce253['forEach'](function(_0xdb67a4){_0x814e19[_0xbe65('0x4d')](getRemoteTag(_0xdb67a4,_0x1589f6,_0xce284b,_0x2b815e,_0x5b8744));});return Promise[_0xbe65('0x4e')](_0x814e19)[_0xbe65('0x28')](function(_0x1e1a8c){if(_0x1e1a8c['length']){logger['info']('['+[_0x341221[_0xbe65('0x12')]()]+_0xbe65('0x4f'),_0x1e1a8c);var _0x307aa2=[];_0x1e1a8c['forEach'](function(_0x151cef){_0x307aa2[_0xbe65('0x4d')](assignTagToIncident(_0x151cef,_0x1589f6,_0xce284b,_0x508b31,_0x2b815e));});return Promise['all'](_0x307aa2)[_0xbe65('0x28')](function(){_0x2eefd8();})[_0xbe65('0x21')](function(){_0x2eefd8();});}else{_0x2eefd8();}});});}function getTags(_0x496c71,_0x239947,_0x465795,_0x258751,_0x3eb816,_0x1565f1){return function(_0xe8f912){return new Promise(function(_0x30e625,_0x2e490c){var _0x41c9d1=[];var _0x5bba95=_0x258751[_0xbe65('0x50')];if(_0x5bba95&&_0x5bba95['length']>0x0){_0x41c9d1=_[_0xbe65('0x51')](_0x5bba95,'name');}if(_0x41c9d1[_0xbe65('0x1c')]>0x0){return manageTags(_0x496c71,_0x41c9d1,_0x239947,_0x465795,_0xe8f912,_0x3eb816,_0x1565f1)[_0xbe65('0x28')](function(){_0x30e625(_0xe8f912);});}else{_0x30e625(_0xe8f912);}});};}function emit(_0x309bfe,_0x354e5b,_0x3aa1cb){var _0x2afa33=_0xbe65('0x52')+_0xbe65('0x53')+_0xbe65('0x54')+_0xbe65('0x55');var _0x59d373={'uri':_0x309bfe+_0xbe65('0x56')+_0x3aa1cb+_0x2afa33};io['to'](util[_0xbe65('0x57')]('user:%s',_0x354e5b))[_0xbe65('0x58')](_0xbe65('0x59'),_0x59d373);}exports['cs']=function(_0x3bad9f,_0x529b53,_0x153ddf,_0x2f264a,_0x1eb7bd,_0x3a2761,_0x2887e,_0x104bd9){var _0x2cb82b={};var _0x11cf31={'user':_0x3a2761[_0xbe65('0x5a')],'pass':_0x3a2761[_0xbe65('0x5b')]};var _0x20e717='sysparm_limit=1';var _0x798476=_0xbe65('0x5c');_0x3a2761[_0xbe65('0x5d')]=intUtil['stripTrailingSlash'](_0x3a2761['remoteUri']);_0x3a2761[_0xbe65('0x5e')]=intUtil['stripTrailingSlash'](_0x3a2761['serverUrl']);var _0x51b218=util['format'](_0xbe65('0x5f'),_0x3a2761[_0xbe65('0x5d')]);_0x2cb82b[_0xbe65('0x19')]=!_[_0xbe65('0x60')](_0x2f264a)?_0x2f264a[_0xbe65('0x61')]:null;_0x2cb82b[_0xbe65('0x20')]=_0x3a2761[_0xbe65('0x61')];_0x2cb82b[_0xbe65('0x26')]=_0x104bd9[_0xbe65('0x33')]()==='outbound'?_0x529b53[_0xbe65('0x62')]:_0x529b53[_0xbe65('0x63')];_0x2cb82b[_0xbe65('0x64')]=_0x104bd9===_0xbe65('0x65')||_0x104bd9===_0xbe65('0x66')?_0xbe65('0x65'):_0xbe65('0x67');var _0x58d2f6=util[_0xbe65('0x57')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3a2761['serverUrl'],_0x529b53[_0xbe65('0x68')],md5(_0x529b53['uniqueid']));if(_0x1eb7bd&&_0x1eb7bd[_0xbe65('0x69')]){logger['info'](_0xbe65('0x6a'),_0xbe65('0x6b'));_0x529b53['recordingURL']=_0x58d2f6;}else if(_0x2887e&&_0x2887e[_0xbe65('0x6c')]&&_0x2887e[_0xbe65('0x6c')]!==_0xbe65('0x6d')){logger[_0xbe65('0x16')](_0xbe65('0x6e'),'Recording\x20is\x20enabled!');_0x529b53[_0xbe65('0x6f')]=_0x58d2f6;}else{_0x529b53[_0xbe65('0x6f')]='';}return getAdminUser(_0x104bd9,_0x11cf31,_0x2cb82b,_0x51b218,_0x798476,_0x20e717)['then'](getUser(_0x104bd9,_0x11cf31,_0x51b218,_0x798476,_0x20e717))[_0xbe65('0x28')](getEndUser(_0x104bd9,_0x11cf31,_0x51b218,_0x798476,_0x20e717))[_0xbe65('0x28')](getTicket(_0x104bd9,_0x11cf31,_0x51b218,_0x153ddf,_0x529b53,_0x798476))[_0xbe65('0x28')](function(_0x275327){logger['info'](util[_0xbe65('0x57')](_0xbe65('0x70'),_0x275327['ticketId']));logger[_0xbe65('0x16')](util[_0xbe65('0x57')](_0xbe65('0x71'),_0x104bd9));if(_0x104bd9!==_0xbe65('0x66')){logger[_0xbe65('0x16')]('['+[_0x104bd9[_0xbe65('0x12')]()]+']',_0xbe65('0x72'));emit(_0x3a2761[_0xbe65('0x5d')],_0x2f264a[_0xbe65('0x3d')],_0x275327['ticketId']);}})[_0xbe65('0x21')](function(_0x4cb3c2){logger['error']('['+[_0x104bd9[_0xbe65('0x12')]()]+_0xbe65('0x73'),util['inspect'](_0x4cb3c2,{'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 3833efb..13086e0 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 _0x0083=['stripTrailingSlash','remoteUri','serverUrl','uri','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','Inbound','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Fields','Outbound','Ticket\x20created!','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','%s/service/v4_1/rest.php','lastevent','toUpperCase','request-promise','bluebird','md5','util','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','created_by','Descriptions','date_start','slice','replace','duration_minutes','parent_id','parent_type','Contacts','parent_name','length','forEach','variableName','push','idField','set_entry','JSON','stringify','format','toString','get_server_info','isNil','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Enduser\x20created.','debug','[HTTP]','merge','map','type','string','nameField','customField','toLowerCase','custom_fields','content','variable','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','Calls','queue'];(function(_0x313c96,_0x3cee6e){var _0x522f53=function(_0x8961e){while(--_0x8961e){_0x313c96['push'](_0x313c96['shift']());}};_0x522f53(++_0x3cee6e);}(_0x0083,0x9f));var _0x3008=function(_0x882253,_0x744f2c){_0x882253=_0x882253-0x0;var _0x442e1e=_0x0083[_0x882253];return _0x442e1e;};'use strict';var _=require('lodash');var rp=require(_0x3008('0x0'));var BPromise=require(_0x3008('0x1'));var md5=require(_0x3008('0x2'));var util=require(_0x3008('0x3'));var Redis=require('ioredis');var intUtil=require(_0x3008('0x4'));var config=require(_0x3008('0x5'));var logger=require(_0x3008('0x6'))(_0x3008('0x7'));config[_0x3008('0x8')]=_['defaults'](config[_0x3008('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x3008('0x9'))(new Redis(config[_0x3008('0x8')]));var def={'method':_0x3008('0xa'),'json':!![]};function emit(_0x2271eb,_0x292b3d,_0x2617c5){io['to'](_0x2271eb)[_0x3008('0xb')](_0x292b3d,_0x2617c5);}function getTicket(_0x5045a3,_0x4123d4,_0x3a8290,_0x5237a1,_0x197768,_0x19ed27,_0x1cd122,_0x5efe27){logger[_0x3008('0xc')](_0x3008('0xd'));var _0x1fca3e=new Date();var _0x51429a=[{'name':_0x3008('0xe'),'value':intUtil[_0x3008('0xf')](_0x5237a1['Subjects'],_0x197768,'\x20')},{'name':'assigned_user_id','value':_0x4123d4['id']},{'name':_0x3008('0x10'),'value':_0x4123d4['id']},{'name':'description','value':intUtil[_0x3008('0xf')](_0x5237a1[_0x3008('0x11')],_0x197768,'\x0a')},{'name':_0x3008('0x12'),'value':_0x1fca3e['toISOString']()[_0x3008('0x13')](0x0,0x13)[_0x3008('0x14')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x3008('0x15'),'value':'15'},{'name':_0x3008('0x16'),'value':_0x3a8290['id']},{'name':_0x3008('0x17'),'value':_0x3008('0x18')},{'name':_0x3008('0x19'),'value':_0x3a8290['name']},{'name':'direction','value':_0x5efe27}];if(_0x19ed27[_0x3008('0x1a')]){_[_0x3008('0x1b')](_0x19ed27,function(_0x3502fe){if(_0x197768[_0x3502fe[_0x3008('0x1c')]]){_0x51429a[_0x3008('0x1d')]({'name':_0x3502fe[_0x3008('0x1e')],'value':_0x197768[_0x3502fe['variableName']]});}});}return request({'form':{'method':_0x3008('0x1f'),'input_type':_0x3008('0x20'),'response_type':'JSON','rest_data':JSON[_0x3008('0x21')]({'session':_0x1cd122['id'],'module_name':'Calls','name_value_list':_0x51429a})}});}function getAuth(_0x10918e){return util[_0x3008('0x22')]('Basic\x20%s',new Buffer(_0x10918e['apiKey']+':X')[_0x3008('0x23')]('base64'));}function getServerInfo(_0x285a59){return request({'form':{'method':_0x3008('0x24'),'input_type':_0x3008('0x20'),'response_type':_0x3008('0x20'),'rest_data':JSON[_0x3008('0x21')]({'session':_0x285a59['id']})}});}function getUser(_0x1a7f1f,_0x21b47a,_0x549209){if(!_[_0x3008('0x25')](_0x21b47a)){logger['info']('Getting\x20agent\x20with\x20name',_0x21b47a);return request({'form':{'method':_0x3008('0x26'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x3008('0x21')]({'session':_0x549209['id'],'module_name':'Employees','query':util[_0x3008('0x22')](_0x3008('0x27'),_0x21b47a),'order_by':'','offset':'0','select_fields':['id',_0x3008('0xe'),_0x3008('0x28')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3008('0x29')](function(_0x4262f8){if(_0x4262f8[_0x3008('0x2a')][_0x3008('0x1a')]){var _0x46bf23=_[_0x3008('0x2b')](_0x4262f8[_0x3008('0x2a')],function(_0x295d99){return _0x295d99[_0x3008('0x2c')]['user_name'][_0x3008('0x2d')]===_0x21b47a;});if(_0x46bf23){logger[_0x3008('0xc')](_0x3008('0x2e'));return BPromise[_0x3008('0x2f')]({'id':_0x46bf23[_0x3008('0x2c')]['id'][_0x3008('0x2d')],'name':_0x46bf23[_0x3008('0x2c')][_0x3008('0xe')]['value']});}}logger['info'](_0x3008('0x30'));return BPromise['resolve']({'id':_0x549209[_0x3008('0x2c')][_0x3008('0x31')][_0x3008('0x2d')],'name':_0x549209[_0x3008('0x2c')][_0x3008('0x28')][_0x3008('0x2d')]});});}else{logger[_0x3008('0xc')](_0x3008('0x32'));return BPromise[_0x3008('0x2f')]({'id':_0x549209[_0x3008('0x2c')]['user_id'][_0x3008('0x2d')],'name':_0x549209[_0x3008('0x2c')]['user_name'][_0x3008('0x2d')]});}}function getEndUser(_0x3c12fc,_0x30bde3,_0xb5183f,_0x3e7595){logger[_0x3008('0xc')](_0x3008('0x33'),_0xb5183f);return request({'form':{'method':_0x3008('0x26'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x3008('0x21')]({'session':_0x3e7595['id'],'module_name':_0x3008('0x18'),'query':util[_0x3008('0x22')](_0x3008('0x34'),_0xb5183f),'order_by':'','offset':'0','select_fields':['id',_0x3008('0xe'),_0x3008('0x35')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x39c7a1){if(_0x39c7a1[_0x3008('0x2a')][_0x3008('0x1a')]){var _0x39168c=_['find'](_0x39c7a1[_0x3008('0x2a')],function(_0x2b6ff6){return _0x2b6ff6[_0x3008('0x2c')][_0x3008('0x35')][_0x3008('0x2d')]===_0xb5183f;});if(_0x39168c){logger['info'](_0x3008('0x36'));return BPromise['resolve']({'id':_0x39168c[_0x3008('0x2c')]['id'][_0x3008('0x2d')],'name':_0x39168c[_0x3008('0x2c')][_0x3008('0xe')]['value'],'phone':_0x39168c[_0x3008('0x2c')][_0x3008('0x35')][_0x3008('0x2d')]});}}else{logger[_0x3008('0xc')](_0x3008('0x37'));return request({'form':{'method':_0x3008('0x1f'),'input_type':_0x3008('0x20'),'response_type':'JSON','rest_data':JSON[_0x3008('0x21')]({'session':_0x3e7595['id'],'module_name':_0x3008('0x18'),'name_value_list':[{'name':_0x3008('0x38'),'value':_0x30bde3!==_0x3008('0x39')?_0x30bde3:util[_0x3008('0x22')]('Caller\x20-\x20%s',_0xb5183f)},{'name':_0x3008('0x35'),'value':_0xb5183f}]})}})['then'](function(_0x5e14c2){logger[_0x3008('0xc')](_0x3008('0x3a'));return BPromise[_0x3008('0x2f')]({'id':_0x5e14c2['id'],'name':_0x5e14c2[_0x3008('0x2a')][_0x3008('0x38')]['value'],'phone':_0x5e14c2['entry_list'][_0x3008('0x35')]['value']});});}});}function request(_0x52d119){logger[_0x3008('0x3b')](_0x3008('0x3c'),JSON[_0x3008('0x21')](_0x52d119));return rp(_[_0x3008('0x3d')](def,_0x52d119));}function getTags(_0x3ba211,_0x52db24){var _0xc7e68b=[];if(_0x3ba211&&_0x3ba211[_0x3008('0x1a')]>0x0){_0xc7e68b=_[_0x3008('0x3e')](_0x3ba211,_0x52db24);}return _0xc7e68b;}function getCustomFields(_0x296e6c,_0x25dc08){var _0x3e7659=[];var _0x336a6c={'custom_fields':[]};if(_0x296e6c[_0x3008('0x1a')]>0x0){_[_0x3008('0x1b')](_0x296e6c,function(_0x2c671b){if(_0x2c671b[_0x3008('0x3f')]===_0x3008('0x40')&&_0x2c671b[_0x3008('0x41')]&&!_0x2c671b[_0x3008('0x42')]){_0x336a6c[_0x2c671b[_0x3008('0x41')][_0x3008('0x43')]()]=_0x2c671b['content']['toString']();}else if(_0x2c671b[_0x3008('0x3f')]===_0x3008('0x40')&&_0x2c671b['idField']&&_0x2c671b[_0x3008('0x42')]){_0x336a6c[_0x3008('0x44')][_0x3008('0x1d')]({'id':_0x2c671b[_0x3008('0x1e')],'value':_0x2c671b[_0x3008('0x45')][_0x3008('0x23')]()});}else if(_0x2c671b[_0x3008('0x3f')]===_0x3008('0x46')&&_0x2c671b['variableName']&&_0x2c671b[_0x3008('0x1e')]&&_0x2c671b[_0x3008('0x42')]){_0x25dc08[_0x2c671b['variableName']]&&_0x336a6c[_0x3008('0x44')][_0x3008('0x1d')]({'id':_0x2c671b[_0x3008('0x1e')],'value':_0x25dc08[_0x2c671b['variableName']]['toString']()});}else if(_0x2c671b[_0x3008('0x3f')]===_0x3008('0x47')&&_0x2c671b[_0x3008('0x48')]&&_0x2c671b['Variable'][_0x3008('0xe')]&&_0x2c671b[_0x3008('0x1e')]&&_0x2c671b[_0x3008('0x42')]){_0x25dc08[_0x2c671b[_0x3008('0x48')][_0x3008('0xe')][_0x3008('0x43')]()]&&_0x336a6c[_0x3008('0x44')]['push']({'id':_0x2c671b[_0x3008('0x1e')],'value':_0x25dc08[_0x2c671b[_0x3008('0x48')][_0x3008('0xe')][_0x3008('0x43')]()][_0x3008('0x23')]()});}});}return _0x336a6c;}function getConnection(_0x5169e5){return request({'method':_0x3008('0xa'),'form':{'method':_0x3008('0x49'),'input_type':_0x3008('0x20'),'response_type':_0x3008('0x20'),'rest_data':JSON[_0x3008('0x21')]({'user_auth':{'user_name':_0x5169e5[_0x3008('0x4a')],'password':_0x5169e5[_0x3008('0x4b')],'encryption':_0x3008('0x4c')},'application':_0x3008('0x4d')})}})['then'](function(_0x4cade8){var _0x250800=_0x4cade8;if(_0x250800['id']){def[_0x3008('0x4e')]=_0x250800['id'];return BPromise['resolve'](_0x250800);}else{throw new Error(util['format'](_0x3008('0x4f'),_0x5169e5['id']));}});}function setRelationship(_0x28c30a,_0x4590a0,_0x4e5b34,_0x40ee38){return request({'form':{'method':_0x3008('0x50'),'input_type':_0x3008('0x20'),'response_type':_0x3008('0x20'),'rest_data':JSON[_0x3008('0x21')]({'session':_0x28c30a['id'],'module_name':_0x3008('0x51'),'module_id':_0x4e5b34['id'],'link_field_name':_0x40ee38,'related_ids':[_0x4590a0['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x3008('0x52')]=function(_0x19c181,_0x3389fc,_0x557203,_0x24ea06,_0x23ce2e,_0x54b53b){var _0x3c1564,_0x35bbac,_0x5a0b9b,_0x55c55e;_0x54b53b['remoteUri']=intUtil[_0x3008('0x53')](_0x54b53b[_0x3008('0x54')]);_0x54b53b[_0x3008('0x55')]=intUtil[_0x3008('0x53')](_0x54b53b[_0x3008('0x55')]);def[_0x3008('0x56')]=util[_0x3008('0x22')]('%s/service/v4_1/rest.php',_0x54b53b[_0x3008('0x54')]);if(_0x23ce2e&&_0x23ce2e[_0x3008('0x57')]){logger[_0x3008('0xc')](_0x3008('0x58'),'Recording\x20is\x20enabled!');_0x3389fc[_0x3008('0x59')]=util['format'](_0x3008('0x5a'),_0x54b53b['serverUrl'],_0x3389fc[_0x3008('0x5b')],md5(_0x3389fc[_0x3008('0x5b')]));}else{_0x3389fc[_0x3008('0x59')]='';}return getConnection(_0x54b53b)[_0x3008('0x29')](function(_0x2b17e5){_0x55c55e=_0x2b17e5;return getUser(_0x54b53b,_0x24ea06[_0x3008('0xe')],_0x55c55e);})[_0x3008('0x29')](function(_0x2a6596){_0x3c1564=_0x2a6596;logger[_0x3008('0xc')]('The\x20User\x20ID\x20is:',_0x3c1564['id']);return getEndUser(_0x54b53b,_0x3389fc[_0x3008('0x5c')],_0x3389fc['calleridnum'],_0x55c55e);})[_0x3008('0x29')](function(_0x284418){_0x35bbac=_0x284418;logger['info']('The\x20Enduser\x20ID\x20is:',_0x35bbac['id']);return getTicket(_0x54b53b,_0x3c1564,_0x35bbac,_0x557203,_0x3389fc,_0x557203['Fields'],_0x55c55e,_0x3008('0x5d'));})[_0x3008('0x29')](function(_0x21972e){_0x5a0b9b=_0x21972e;logger[_0x3008('0xc')]('Ticket\x20created!');logger[_0x3008('0xc')](_0x3008('0x5e'),_0x5a0b9b['id']);return setRelationship(_0x55c55e,_0x3c1564,_0x5a0b9b,_0x3008('0x5f'));})[_0x3008('0x29')](function(){return setRelationship(_0x55c55e,_0x35bbac,_0x5a0b9b,_0x3008('0x60'));})[_0x3008('0x29')](function(){return getServerInfo(_0x55c55e);})['then'](function(_0x115f84){var _0x5ce7ab=parseInt(_0x115f84[_0x3008('0x61')][_0x3008('0x62')](0x0));var _0x64ba2a=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x54b53b[_0x3008('0x54')],_0x5a0b9b['id']);if(_0x5ce7ab>0x6){_0x64ba2a=util[_0x3008('0x22')](_0x3008('0x63'),_0x54b53b['remoteUri'],_0x5a0b9b['id']);}logger['info'](_0x3008('0x58'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x3008('0x22')](_0x3008('0x64'),_0x24ea06['name']),_0x3008('0x65'),{'uri':_0x64ba2a});})[_0x3008('0x66')](function(_0x63c922){logger[_0x3008('0x67')](_0x3008('0x58'),JSON[_0x3008('0x21')](_0x63c922));});};exports[_0x3008('0x68')]=function(_0x7f9f63,_0x3b02ed,_0x1929a8,_0x4b7aa2,_0x321ecf,_0x459a19,_0x4c25dc){var _0x1a64a0,_0x1aba71,_0x9f027e,_0x56dac0;_0x459a19['remoteUri']=intUtil[_0x3008('0x53')](_0x459a19[_0x3008('0x54')]);_0x459a19[_0x3008('0x55')]=intUtil[_0x3008('0x53')](_0x459a19[_0x3008('0x55')]);def['uri']=util[_0x3008('0x22')]('%s/service/v4_1/rest.php',_0x459a19[_0x3008('0x54')]);if(_0x4c25dc&&_0x4c25dc['recordingFormat']&&_0x4c25dc[_0x3008('0x69')]!==_0x3008('0x6a')){logger[_0x3008('0xc')](_0x3008('0x6b'),'Recording\x20is\x20enabled!');_0x3b02ed[_0x3008('0x59')]=util[_0x3008('0x22')](_0x3008('0x5a'),_0x459a19['serverUrl'],_0x3b02ed['uniqueid'],md5(_0x3b02ed[_0x3008('0x5b')]));}return getConnection(_0x459a19)[_0x3008('0x29')](function(_0x496354){_0x56dac0=_0x496354;return getUser(_0x459a19,_0x4b7aa2['name'],_0x56dac0);})[_0x3008('0x29')](function(_0xe77834){_0x1a64a0=_0xe77834;logger[_0x3008('0xc')](_0x3008('0x6c'),_0x1a64a0['id']);return getEndUser(_0x459a19,_0x3b02ed[_0x3008('0x6d')],_0x3b02ed[_0x3008('0x6e')],_0x56dac0);})[_0x3008('0x29')](function(_0x51bafc){_0x1aba71=_0x51bafc;logger[_0x3008('0xc')](_0x3008('0x6f'),_0x1aba71['id']);return getTicket(_0x459a19,_0x1a64a0,_0x1aba71,_0x1929a8,_0x3b02ed,_0x1929a8[_0x3008('0x70')],_0x56dac0,_0x3008('0x71'));})[_0x3008('0x29')](function(_0x5d9916){_0x9f027e=_0x5d9916;logger[_0x3008('0xc')](_0x3008('0x72'));logger[_0x3008('0xc')](_0x3008('0x5e'),_0x9f027e['id']);return setRelationship(_0x56dac0,_0x1a64a0,_0x9f027e,_0x3008('0x5f'));})[_0x3008('0x29')](function(){return setRelationship(_0x56dac0,_0x1aba71,_0x9f027e,'contacts');})['then'](function(){return getServerInfo(_0x56dac0);})['then'](function(_0x5daf14){var _0x22d79e=parseInt(_0x5daf14['version']['charAt'](0x0));var _0x5f3a38=util[_0x3008('0x22')](_0x3008('0x73'),_0x459a19[_0x3008('0x54')],_0x9f027e['id']);if(_0x22d79e>0x6){_0x5f3a38=util[_0x3008('0x22')](_0x3008('0x63'),_0x459a19[_0x3008('0x54')],_0x9f027e['id']);}logger[_0x3008('0xc')]('[OUTBOUND]',_0x3008('0x74'));emit(util['format']('user:%s',_0x4b7aa2[_0x3008('0xe')]),_0x3008('0x65'),{'uri':_0x5f3a38});})[_0x3008('0x66')](function(_0x23e752){logger[_0x3008('0x67')]('[OUTBOUND]',JSON[_0x3008('0x21')](_0x23e752));});};exports[_0x3008('0x75')]=function(_0x283950,_0x5bc21f,_0x575c32,_0x118b9c,_0x435e0b,_0x4ce34c){var _0x545cf5,_0x23dc66,_0x17829d,_0x42e408;_0x4ce34c[_0x3008('0x54')]=intUtil[_0x3008('0x53')](_0x4ce34c[_0x3008('0x54')]);_0x4ce34c[_0x3008('0x55')]=intUtil['stripTrailingSlash'](_0x4ce34c[_0x3008('0x55')]);def[_0x3008('0x56')]=util[_0x3008('0x22')](_0x3008('0x76'),_0x4ce34c['remoteUri']);if(_0x435e0b&&_0x435e0b[_0x3008('0x57')]){logger[_0x3008('0xc')]('['+_0x5bc21f[_0x3008('0x77')][_0x3008('0x78')]()+']','Recording\x20is\x20enabled!');_0x5bc21f[_0x3008('0x59')]=util[_0x3008('0x22')](_0x3008('0x5a'),_0x4ce34c[_0x3008('0x55')],_0x5bc21f[_0x3008('0x5b')],md5(_0x5bc21f[_0x3008('0x5b')]));}else{_0x5bc21f[_0x3008('0x59')]='';}return getConnection(_0x4ce34c)[_0x3008('0x29')](function(_0x245aa8){_0x42e408=_0x245aa8;if(!_['isNil'](_0x118b9c)){return getUser(_0x4ce34c,_0x118b9c[_0x3008('0xe')],_0x42e408);}else{return getUser(_0x4ce34c,null,_0x42e408);}})[_0x3008('0x29')](function(_0x40b2f1){_0x545cf5=_0x40b2f1;logger[_0x3008('0xc')](_0x3008('0x6c'),_0x545cf5['id']);return getEndUser(_0x4ce34c,_0x5bc21f[_0x3008('0x5c')],_0x5bc21f['calleridnum'],_0x42e408);})['then'](function(_0x286d82){_0x23dc66=_0x286d82;logger['info']('The\x20Enduser\x20ID\x20is:',_0x23dc66['id']);return getTicket(_0x4ce34c,_0x545cf5,_0x23dc66,_0x575c32,_0x5bc21f,_0x575c32[_0x3008('0x70')],_0x42e408,_0x3008('0x5d'));})[_0x3008('0x29')](function(_0x30ac07){_0x17829d=_0x30ac07;logger['info'](_0x3008('0x72'));logger[_0x3008('0xc')](_0x3008('0x5e'),_0x17829d['id']);return setRelationship(_0x42e408,_0x545cf5,_0x17829d,_0x3008('0x5f'));})[_0x3008('0x29')](function(){return setRelationship(_0x42e408,_0x23dc66,_0x17829d,_0x3008('0x60'));})[_0x3008('0x29')](function(){return getServerInfo(_0x42e408);})[_0x3008('0x66')](function(_0xb20096){logger['error']('['+_0x5bc21f[_0x3008('0x77')][_0x3008('0x78')]()+']',JSON['stringify'](_0xb20096));});}; \ No newline at end of file +var _0x7142=['duration_minutes','Contacts','direction','length','forEach','variableName','push','idField','set_entry','JSON','stringify','format','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','find','entry_list','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','phone_home','Enduser\x20created.','debug','[HTTP]','merge','map','type','string','nameField','customField','toLowerCase','custom_fields','content','variable','customVariable','Variable','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Calls','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','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...','user:%s','catch','error','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','users','version','trigger:browser:url','unmanaged','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Inbound','lodash','request-promise','bluebird','md5','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','POST','info','Creating\x20new\x20ticket...','name','getString','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','replace','duration_hours'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7142,0x152));var _0x2714=function(_0x41bf3a,_0x2a4001){_0x41bf3a=_0x41bf3a-0x0;var _0x3acb43=_0x7142[_0x41bf3a];return _0x3acb43;};'use strict';var _=require(_0x2714('0x0'));var rp=require(_0x2714('0x1'));var BPromise=require(_0x2714('0x2'));var md5=require(_0x2714('0x3'));var util=require('util');var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x2714('0x4'));var logger=require(_0x2714('0x5'))(_0x2714('0x6'));config[_0x2714('0x7')]=_[_0x2714('0x8')](config[_0x2714('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2714('0x7')]));var def={'method':_0x2714('0x9'),'json':!![]};function emit(_0x2e700a,_0x23ddcc,_0x3b028a){io['to'](_0x2e700a)['emit'](_0x23ddcc,_0x3b028a);}function getTicket(_0x5178a4,_0x2a9188,_0x22fb66,_0x1ed210,_0x571697,_0x42d076,_0x2d1183,_0x460463){logger[_0x2714('0xa')](_0x2714('0xb'));var _0x4bc983=new Date();var _0x36c207=[{'name':_0x2714('0xc'),'value':intUtil[_0x2714('0xd')](_0x1ed210['Subjects'],_0x571697,'\x20')},{'name':_0x2714('0xe'),'value':_0x2a9188['id']},{'name':_0x2714('0xf'),'value':_0x2a9188['id']},{'name':_0x2714('0x10'),'value':intUtil[_0x2714('0xd')](_0x1ed210[_0x2714('0x11')],_0x571697,'\x0a')},{'name':_0x2714('0x12'),'value':_0x4bc983[_0x2714('0x13')]()['slice'](0x0,0x13)[_0x2714('0x14')]('T','\x20')},{'name':_0x2714('0x15'),'value':'0'},{'name':_0x2714('0x16'),'value':'15'},{'name':'parent_id','value':_0x22fb66['id']},{'name':'parent_type','value':_0x2714('0x17')},{'name':'parent_name','value':_0x22fb66[_0x2714('0xc')]},{'name':_0x2714('0x18'),'value':_0x460463}];if(_0x42d076[_0x2714('0x19')]){_[_0x2714('0x1a')](_0x42d076,function(_0x5b0fe2){if(_0x571697[_0x5b0fe2[_0x2714('0x1b')]]){_0x36c207[_0x2714('0x1c')]({'name':_0x5b0fe2[_0x2714('0x1d')],'value':_0x571697[_0x5b0fe2[_0x2714('0x1b')]]});}});}return request({'form':{'method':_0x2714('0x1e'),'input_type':'JSON','response_type':_0x2714('0x1f'),'rest_data':JSON[_0x2714('0x20')]({'session':_0x2d1183['id'],'module_name':'Calls','name_value_list':_0x36c207})}});}function getAuth(_0x63144){return util[_0x2714('0x21')](_0x2714('0x22'),new Buffer(_0x63144[_0x2714('0x23')]+':X')[_0x2714('0x24')](_0x2714('0x25')));}function getServerInfo(_0x5cd9d5){return request({'form':{'method':_0x2714('0x26'),'input_type':'JSON','response_type':_0x2714('0x1f'),'rest_data':JSON[_0x2714('0x20')]({'session':_0x5cd9d5['id']})}});}function getUser(_0x13292f,_0x53fa69,_0x5916c0){if(!_[_0x2714('0x27')](_0x53fa69)){logger[_0x2714('0xa')](_0x2714('0x28'),_0x53fa69);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0x2714('0x1f'),'rest_data':JSON['stringify']({'session':_0x5916c0['id'],'module_name':_0x2714('0x29'),'query':util[_0x2714('0x21')](_0x2714('0x2a'),_0x53fa69),'order_by':'','offset':'0','select_fields':['id',_0x2714('0xc'),_0x2714('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x2714('0x2c')](function(_0x204856){if(_0x204856['entry_list'][_0x2714('0x19')]){var _0x54f0af=_[_0x2714('0x2d')](_0x204856[_0x2714('0x2e')],function(_0x2f08b4){return _0x2f08b4[_0x2714('0x2f')][_0x2714('0x2b')][_0x2714('0x30')]===_0x53fa69;});if(_0x54f0af){logger['info'](_0x2714('0x31'));return BPromise[_0x2714('0x32')]({'id':_0x54f0af[_0x2714('0x2f')]['id']['value'],'name':_0x54f0af['name_value_list']['name'][_0x2714('0x30')]});}}logger[_0x2714('0xa')](_0x2714('0x33'));return BPromise['resolve']({'id':_0x5916c0[_0x2714('0x2f')][_0x2714('0x34')][_0x2714('0x30')],'name':_0x5916c0[_0x2714('0x2f')][_0x2714('0x2b')][_0x2714('0x30')]});});}else{logger['info'](_0x2714('0x35'));return BPromise['resolve']({'id':_0x5916c0[_0x2714('0x2f')][_0x2714('0x34')][_0x2714('0x30')],'name':_0x5916c0['name_value_list'][_0x2714('0x2b')][_0x2714('0x30')]});}}function getEndUser(_0x193fbc,_0x93f84c,_0x14cfaa,_0x362160){logger['info'](_0x2714('0x36'),_0x14cfaa);return request({'form':{'method':_0x2714('0x37'),'input_type':_0x2714('0x1f'),'response_type':_0x2714('0x1f'),'rest_data':JSON[_0x2714('0x20')]({'session':_0x362160['id'],'module_name':'Contacts','query':util[_0x2714('0x21')](_0x2714('0x38'),_0x14cfaa),'order_by':'','offset':'0','select_fields':['id',_0x2714('0xc'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x2714('0x2c')](function(_0xd1ede4){if(_0xd1ede4[_0x2714('0x2e')][_0x2714('0x19')]){var _0x11d171=_[_0x2714('0x2d')](_0xd1ede4[_0x2714('0x2e')],function(_0xa33813){return _0xa33813[_0x2714('0x2f')]['phone_home'][_0x2714('0x30')]===_0x14cfaa;});if(_0x11d171){logger[_0x2714('0xa')](_0x2714('0x39'));return BPromise[_0x2714('0x32')]({'id':_0x11d171[_0x2714('0x2f')]['id'][_0x2714('0x30')],'name':_0x11d171[_0x2714('0x2f')]['name'][_0x2714('0x30')],'phone':_0x11d171[_0x2714('0x2f')]['phone_home'][_0x2714('0x30')]});}}else{logger[_0x2714('0xa')](_0x2714('0x3a'));return request({'form':{'method':_0x2714('0x1e'),'input_type':_0x2714('0x1f'),'response_type':_0x2714('0x1f'),'rest_data':JSON['stringify']({'session':_0x362160['id'],'module_name':'Contacts','name_value_list':[{'name':_0x2714('0x3b'),'value':_0x93f84c!==''?_0x93f84c:util['format']('Caller\x20-\x20%s',_0x14cfaa)},{'name':_0x2714('0x3c'),'value':_0x14cfaa}]})}})[_0x2714('0x2c')](function(_0x3b557a){logger[_0x2714('0xa')](_0x2714('0x3d'));return BPromise[_0x2714('0x32')]({'id':_0x3b557a['id'],'name':_0x3b557a[_0x2714('0x2e')][_0x2714('0x3b')][_0x2714('0x30')],'phone':_0x3b557a[_0x2714('0x2e')][_0x2714('0x3c')][_0x2714('0x30')]});});}});}function request(_0x48dc02){logger[_0x2714('0x3e')](_0x2714('0x3f'),JSON[_0x2714('0x20')](_0x48dc02));return rp(_[_0x2714('0x40')](def,_0x48dc02));}function getTags(_0x1d27f0,_0x5986aa){var _0x345f87=[];if(_0x1d27f0&&_0x1d27f0[_0x2714('0x19')]>0x0){_0x345f87=_[_0x2714('0x41')](_0x1d27f0,_0x5986aa);}return _0x345f87;}function getCustomFields(_0x2f7826,_0x40580c){var _0x2a65fb=[];var _0x1861d9={'custom_fields':[]};if(_0x2f7826[_0x2714('0x19')]>0x0){_[_0x2714('0x1a')](_0x2f7826,function(_0x540513){if(_0x540513[_0x2714('0x42')]===_0x2714('0x43')&&_0x540513[_0x2714('0x44')]&&!_0x540513[_0x2714('0x45')]){_0x1861d9[_0x540513[_0x2714('0x44')][_0x2714('0x46')]()]=_0x540513['content'][_0x2714('0x24')]();}else if(_0x540513[_0x2714('0x42')]===_0x2714('0x43')&&_0x540513['idField']&&_0x540513[_0x2714('0x45')]){_0x1861d9[_0x2714('0x47')][_0x2714('0x1c')]({'id':_0x540513['idField'],'value':_0x540513[_0x2714('0x48')][_0x2714('0x24')]()});}else if(_0x540513[_0x2714('0x42')]===_0x2714('0x49')&&_0x540513['variableName']&&_0x540513['idField']&&_0x540513[_0x2714('0x45')]){_0x40580c[_0x540513[_0x2714('0x1b')]]&&_0x1861d9[_0x2714('0x47')][_0x2714('0x1c')]({'id':_0x540513['idField'],'value':_0x40580c[_0x540513[_0x2714('0x1b')]][_0x2714('0x24')]()});}else if(_0x540513[_0x2714('0x42')]===_0x2714('0x4a')&&_0x540513[_0x2714('0x4b')]&&_0x540513[_0x2714('0x4b')][_0x2714('0xc')]&&_0x540513[_0x2714('0x1d')]&&_0x540513[_0x2714('0x45')]){_0x40580c[_0x540513[_0x2714('0x4b')][_0x2714('0xc')][_0x2714('0x46')]()]&&_0x1861d9['custom_fields'][_0x2714('0x1c')]({'id':_0x540513[_0x2714('0x1d')],'value':_0x40580c[_0x540513[_0x2714('0x4b')][_0x2714('0xc')][_0x2714('0x46')]()][_0x2714('0x24')]()});}});}return _0x1861d9;}function getConnection(_0x231eb7){return request({'method':_0x2714('0x9'),'form':{'method':'login','input_type':_0x2714('0x1f'),'response_type':'JSON','rest_data':JSON[_0x2714('0x20')]({'user_auth':{'user_name':_0x231eb7['username'],'password':_0x231eb7[_0x2714('0x4c')],'encryption':_0x2714('0x4d')},'application':_0x2714('0x4e')})}})[_0x2714('0x2c')](function(_0x51caac){var _0x133fe4=_0x51caac;if(_0x133fe4['id']){def[_0x2714('0x4f')]=_0x133fe4['id'];return BPromise[_0x2714('0x32')](_0x133fe4);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x231eb7['id']));}});}function setRelationship(_0x3d14c6,_0x6780c9,_0x56460c,_0x9a516d){return request({'form':{'method':'set_relationship','input_type':_0x2714('0x1f'),'response_type':_0x2714('0x1f'),'rest_data':JSON[_0x2714('0x20')]({'session':_0x3d14c6['id'],'module_name':_0x2714('0x50'),'module_id':_0x56460c['id'],'link_field_name':_0x9a516d,'related_ids':[_0x6780c9['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x4a3251,_0x436fc1,_0x2d5baf,_0x591bc1,_0x40ef2d,_0x170645){var _0x11a2d3,_0x4a9f02,_0x58be9f,_0x1fd1e1;_0x170645[_0x2714('0x51')]=intUtil[_0x2714('0x52')](_0x170645['remoteUri']);_0x170645[_0x2714('0x53')]=intUtil[_0x2714('0x52')](_0x170645['serverUrl']);def[_0x2714('0x54')]=util[_0x2714('0x21')](_0x2714('0x55'),_0x170645[_0x2714('0x51')]);if(_0x40ef2d&&_0x40ef2d[_0x2714('0x56')]){logger[_0x2714('0xa')](_0x2714('0x57'),_0x2714('0x58'));_0x436fc1[_0x2714('0x59')]=util[_0x2714('0x21')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x170645[_0x2714('0x53')],_0x436fc1[_0x2714('0x5a')],md5(_0x436fc1[_0x2714('0x5a')]));}else{_0x436fc1[_0x2714('0x59')]='';}return getConnection(_0x170645)[_0x2714('0x2c')](function(_0x3079bd){_0x1fd1e1=_0x3079bd;return getUser(_0x170645,_0x591bc1['name'],_0x1fd1e1);})[_0x2714('0x2c')](function(_0x5292a5){_0x11a2d3=_0x5292a5;logger['info'](_0x2714('0x5b'),_0x11a2d3['id']);return getEndUser(_0x170645,_0x436fc1[_0x2714('0x5c')],_0x436fc1[_0x2714('0x5d')],_0x1fd1e1);})[_0x2714('0x2c')](function(_0x5c763b){_0x4a9f02=_0x5c763b;logger[_0x2714('0xa')](_0x2714('0x5e'),_0x4a9f02['id']);return getTicket(_0x170645,_0x11a2d3,_0x4a9f02,_0x2d5baf,_0x436fc1,_0x2d5baf[_0x2714('0x5f')],_0x1fd1e1,'Inbound');})[_0x2714('0x2c')](function(_0x386025){_0x58be9f=_0x386025;logger[_0x2714('0xa')](_0x2714('0x60'));logger['info'](_0x2714('0x61'),_0x58be9f['id']);return setRelationship(_0x1fd1e1,_0x11a2d3,_0x58be9f,'users');})[_0x2714('0x2c')](function(){return setRelationship(_0x1fd1e1,_0x4a9f02,_0x58be9f,_0x2714('0x62'));})[_0x2714('0x2c')](function(){return getServerInfo(_0x1fd1e1);})['then'](function(_0x20b365){var _0x5bf879=parseInt(_0x20b365['version'][_0x2714('0x63')](0x0));var _0xdbd05c=util[_0x2714('0x21')](_0x2714('0x64'),_0x170645[_0x2714('0x51')],_0x58be9f['id']);if(_0x5bf879>0x6){_0xdbd05c=util[_0x2714('0x21')](_0x2714('0x65'),_0x170645[_0x2714('0x51')],_0x58be9f['id']);}logger['info'](_0x2714('0x57'),_0x2714('0x66'));emit(util['format'](_0x2714('0x67'),_0x591bc1[_0x2714('0xc')]),'trigger:browser:url',{'uri':_0xdbd05c});})[_0x2714('0x68')](function(_0x1b4b5f){logger[_0x2714('0x69')]('[QUEUE]',JSON['stringify'](_0x1b4b5f));});};exports[_0x2714('0x6a')]=function(_0x4fb42f,_0x370987,_0x953a70,_0x324f73,_0x1521c7,_0xe1daca,_0x5d7f55){var _0x425f12,_0x1f262b,_0x523b67,_0x15016a;_0xe1daca[_0x2714('0x51')]=intUtil[_0x2714('0x52')](_0xe1daca[_0x2714('0x51')]);_0xe1daca['serverUrl']=intUtil['stripTrailingSlash'](_0xe1daca[_0x2714('0x53')]);def[_0x2714('0x54')]=util[_0x2714('0x21')](_0x2714('0x55'),_0xe1daca[_0x2714('0x51')]);if(_0x5d7f55&&_0x5d7f55[_0x2714('0x6b')]&&_0x5d7f55['recordingFormat']!=='none'){logger[_0x2714('0xa')](_0x2714('0x6c'),'Recording\x20is\x20enabled!');_0x370987[_0x2714('0x59')]=util[_0x2714('0x21')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xe1daca[_0x2714('0x53')],_0x370987[_0x2714('0x5a')],md5(_0x370987['uniqueid']));}return getConnection(_0xe1daca)['then'](function(_0x32f36b){_0x15016a=_0x32f36b;return getUser(_0xe1daca,_0x324f73[_0x2714('0xc')],_0x15016a);})[_0x2714('0x2c')](function(_0x350a76){_0x425f12=_0x350a76;logger['info']('The\x20User\x20ID\x20is:',_0x425f12['id']);return getEndUser(_0xe1daca,_0x370987[_0x2714('0x6d')],_0x370987[_0x2714('0x6e')],_0x15016a);})[_0x2714('0x2c')](function(_0xbb67d3){_0x1f262b=_0xbb67d3;logger[_0x2714('0xa')](_0x2714('0x5e'),_0x1f262b['id']);return getTicket(_0xe1daca,_0x425f12,_0x1f262b,_0x953a70,_0x370987,_0x953a70[_0x2714('0x5f')],_0x15016a,_0x2714('0x6f'));})[_0x2714('0x2c')](function(_0x31c1c4){_0x523b67=_0x31c1c4;logger[_0x2714('0xa')](_0x2714('0x60'));logger['info'](_0x2714('0x61'),_0x523b67['id']);return setRelationship(_0x15016a,_0x425f12,_0x523b67,_0x2714('0x70'));})[_0x2714('0x2c')](function(){return setRelationship(_0x15016a,_0x1f262b,_0x523b67,_0x2714('0x62'));})[_0x2714('0x2c')](function(){return getServerInfo(_0x15016a);})[_0x2714('0x2c')](function(_0x488ec4){var _0x32ed57=parseInt(_0x488ec4[_0x2714('0x71')]['charAt'](0x0));var _0x4fa1e2=util[_0x2714('0x21')](_0x2714('0x64'),_0xe1daca[_0x2714('0x51')],_0x523b67['id']);if(_0x32ed57>0x6){_0x4fa1e2=util[_0x2714('0x21')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0xe1daca[_0x2714('0x51')],_0x523b67['id']);}logger[_0x2714('0xa')]('[OUTBOUND]',_0x2714('0x66'));emit(util[_0x2714('0x21')](_0x2714('0x67'),_0x324f73[_0x2714('0xc')]),_0x2714('0x72'),{'uri':_0x4fa1e2});})[_0x2714('0x68')](function(_0x493484){logger[_0x2714('0x69')](_0x2714('0x6c'),JSON[_0x2714('0x20')](_0x493484));});};exports[_0x2714('0x73')]=function(_0x59a44f,_0x40fb7b,_0x2af667,_0xac6757,_0x5d52d3,_0x36f3ad){var _0x12c590,_0xf045f5,_0x27ce38,_0x4f6aa9;_0x36f3ad[_0x2714('0x51')]=intUtil['stripTrailingSlash'](_0x36f3ad[_0x2714('0x51')]);_0x36f3ad[_0x2714('0x53')]=intUtil[_0x2714('0x52')](_0x36f3ad['serverUrl']);def[_0x2714('0x54')]=util[_0x2714('0x21')]('%s/service/v4_1/rest.php',_0x36f3ad[_0x2714('0x51')]);if(_0x5d52d3&&_0x5d52d3[_0x2714('0x56')]){logger[_0x2714('0xa')]('['+_0x40fb7b[_0x2714('0x74')][_0x2714('0x75')]()+']',_0x2714('0x58'));_0x40fb7b[_0x2714('0x59')]=util[_0x2714('0x21')](_0x2714('0x76'),_0x36f3ad[_0x2714('0x53')],_0x40fb7b[_0x2714('0x5a')],md5(_0x40fb7b[_0x2714('0x5a')]));}else{_0x40fb7b[_0x2714('0x59')]='';}return getConnection(_0x36f3ad)['then'](function(_0xdb24e7){_0x4f6aa9=_0xdb24e7;if(!_['isNil'](_0xac6757)){return getUser(_0x36f3ad,_0xac6757[_0x2714('0xc')],_0x4f6aa9);}else{return getUser(_0x36f3ad,null,_0x4f6aa9);}})['then'](function(_0x45e0c5){_0x12c590=_0x45e0c5;logger[_0x2714('0xa')](_0x2714('0x5b'),_0x12c590['id']);return getEndUser(_0x36f3ad,_0x40fb7b[_0x2714('0x5c')],_0x40fb7b[_0x2714('0x5d')],_0x4f6aa9);})['then'](function(_0x1b5037){_0xf045f5=_0x1b5037;logger['info'](_0x2714('0x5e'),_0xf045f5['id']);return getTicket(_0x36f3ad,_0x12c590,_0xf045f5,_0x2af667,_0x40fb7b,_0x2af667[_0x2714('0x5f')],_0x4f6aa9,_0x2714('0x77'));})[_0x2714('0x2c')](function(_0x3697b6){_0x27ce38=_0x3697b6;logger[_0x2714('0xa')](_0x2714('0x60'));logger[_0x2714('0xa')](_0x2714('0x61'),_0x27ce38['id']);return setRelationship(_0x4f6aa9,_0x12c590,_0x27ce38,'users');})[_0x2714('0x2c')](function(){return setRelationship(_0x4f6aa9,_0xf045f5,_0x27ce38,_0x2714('0x62'));})[_0x2714('0x2c')](function(){return getServerInfo(_0x4f6aa9);})['catch'](function(_0x18df8a){logger[_0x2714('0x69')]('['+_0x40fb7b[_0x2714('0x74')][_0x2714('0x75')]()+']',JSON[_0x2714('0x20')](_0x18df8a));});}; \ 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 4703b04..744134e 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 _0xbf1f=['name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','keyContent','join','slice','validateEmail','isNil','test','lodash','util','getString','sortBy','length','type','push','content','variable','variableName','toString','customVariable','Variable'];(function(_0xf839dc,_0x484538){var _0x26a6e8=function(_0x174d95){while(--_0x174d95){_0xf839dc['push'](_0xf839dc['shift']());}};_0x26a6e8(++_0x484538);}(_0xbf1f,0x1c7));var _0xfbf1=function(_0x52d4ad,_0x25e611){_0x52d4ad=_0x52d4ad-0x0;var _0x34a767=_0xbf1f[_0x52d4ad];return _0x34a767;};'use strict';var _=require(_0xfbf1('0x0'));var util=require(_0xfbf1('0x1'));exports[_0xfbf1('0x2')]=function(_0x3a51fe,_0x19540b,_0x1cd3b9){var _0x120bf5=[];if(_0x3a51fe['length']>0x0){var _0x92e1d9=_[_0xfbf1('0x3')](_0x3a51fe,['id']);for(var _0x45dbc8=0x0;_0x45dbc8<_0x92e1d9[_0xfbf1('0x4')];_0x45dbc8++){var _0x3ca8fd=_0x92e1d9[_0x45dbc8];if(_0x3ca8fd[_0xfbf1('0x5')]==='string'){_0x120bf5[_0xfbf1('0x6')](_0x3ca8fd[_0xfbf1('0x7')]);}else if(_0x3ca8fd['type']===_0xfbf1('0x8')&&_0x3ca8fd['variableName']){_0x19540b[_0x3ca8fd[_0xfbf1('0x9')]]&&_0x120bf5[_0xfbf1('0x6')](_0x19540b[_0x3ca8fd[_0xfbf1('0x9')]][_0xfbf1('0xa')]());}else if(_0x3ca8fd[_0xfbf1('0x5')]===_0xfbf1('0xb')&&_0x3ca8fd[_0xfbf1('0xc')]&&_0x3ca8fd['Variable'][_0xfbf1('0xd')]){_0x19540b[_0x3ca8fd[_0xfbf1('0xc')]['name'][_0xfbf1('0xe')]()]&&_0x120bf5[_0xfbf1('0x6')](_0x19540b[_0x3ca8fd[_0xfbf1('0xc')][_0xfbf1('0xd')][_0xfbf1('0xe')]()][_0xfbf1('0xa')]());}else if(_0x3ca8fd[_0xfbf1('0x5')]===_0xfbf1('0xf')){if(_0x3ca8fd[_0xfbf1('0x10')]==='string'&&_0x3ca8fd[_0xfbf1('0x11')]){_0x120bf5[_0xfbf1('0x6')](util[_0xfbf1('0x12')](_0xfbf1('0x13'),_0x3ca8fd['key'],_0x3ca8fd[_0xfbf1('0x14')]));}else if(_0x3ca8fd[_0xfbf1('0x10')]==='variable'&&_0x3ca8fd[_0xfbf1('0x9')]&&_0x3ca8fd['key']){_0x19540b[_0x3ca8fd['variableName']]&&_0x120bf5['push'](util[_0xfbf1('0x12')](_0xfbf1('0x13'),_0x3ca8fd[_0xfbf1('0x11')],_0x19540b[_0x3ca8fd[_0xfbf1('0x9')]]));}else if(_0x3ca8fd[_0xfbf1('0x10')]===_0xfbf1('0xb')&&_0x3ca8fd[_0xfbf1('0xc')]&&_0x3ca8fd[_0xfbf1('0xc')][_0xfbf1('0xd')]&&_0x3ca8fd[_0xfbf1('0x11')]){_0x19540b[_0x3ca8fd[_0xfbf1('0xc')][_0xfbf1('0xd')][_0xfbf1('0xe')]()]&&_0x120bf5['push'](util[_0xfbf1('0x12')](_0xfbf1('0x13'),_0x3ca8fd[_0xfbf1('0x11')],_0x19540b[_0x3ca8fd['Variable'][_0xfbf1('0xd')]['toLowerCase']()]));}}}}return _0x120bf5[_0xfbf1('0x15')](_0x1cd3b9);};exports['stripTrailingSlash']=function(_0x4250cb){var _0x7e2e7=_0x4250cb[_0xfbf1('0x16')](-0x1);if(_0x7e2e7==='/'){_0x4250cb=_0x4250cb['substring'](0x0,_0x4250cb['lastIndexOf'](_0x7e2e7));}return _0x4250cb;};exports[_0xfbf1('0x17')]=function(_0x31ea6f){if(!_[_0xfbf1('0x18')](_0x31ea6f)&&_0x31ea6f!==''){var _0x52da97=/^(([^<>()\[\]\\.,;:\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 _0x52da97[_0xfbf1('0x19')](String(_0x31ea6f)[_0xfbf1('0xe')]());}else{return![];}}; \ No newline at end of file +var _0x69b7=['stripTrailingSlash','slice','substring','validateEmail','test','lodash','util','getString','length','sortBy','type','string','push','content','variable','variableName','toString','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','keyContent','customVariable','join'];(function(_0x4a9ba3,_0x16e601){var _0x326416=function(_0xb76b49){while(--_0xb76b49){_0x4a9ba3['push'](_0x4a9ba3['shift']());}};_0x326416(++_0x16e601);}(_0x69b7,0x1c5));var _0x769b=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x69b7[_0x432682];return _0x463d05;};'use strict';var _=require(_0x769b('0x0'));var util=require(_0x769b('0x1'));exports[_0x769b('0x2')]=function(_0x254305,_0x4f6df3,_0x58d7e9){var _0x3b4d8d=[];if(_0x254305[_0x769b('0x3')]>0x0){var _0x170ff3=_[_0x769b('0x4')](_0x254305,['id']);for(var _0x4cff47=0x0;_0x4cff47<_0x170ff3[_0x769b('0x3')];_0x4cff47++){var _0x2b67e7=_0x170ff3[_0x4cff47];if(_0x2b67e7[_0x769b('0x5')]===_0x769b('0x6')){_0x3b4d8d[_0x769b('0x7')](_0x2b67e7[_0x769b('0x8')]);}else if(_0x2b67e7['type']===_0x769b('0x9')&&_0x2b67e7[_0x769b('0xa')]){_0x4f6df3[_0x2b67e7['variableName']]&&_0x3b4d8d['push'](_0x4f6df3[_0x2b67e7[_0x769b('0xa')]][_0x769b('0xb')]());}else if(_0x2b67e7[_0x769b('0x5')]==='customVariable'&&_0x2b67e7[_0x769b('0xc')]&&_0x2b67e7[_0x769b('0xc')][_0x769b('0xd')]){_0x4f6df3[_0x2b67e7[_0x769b('0xc')][_0x769b('0xd')][_0x769b('0xe')]()]&&_0x3b4d8d[_0x769b('0x7')](_0x4f6df3[_0x2b67e7[_0x769b('0xc')]['name']['toLowerCase']()][_0x769b('0xb')]());}else if(_0x2b67e7[_0x769b('0x5')]===_0x769b('0xf')){if(_0x2b67e7[_0x769b('0x10')]===_0x769b('0x6')&&_0x2b67e7[_0x769b('0x11')]){_0x3b4d8d[_0x769b('0x7')](util[_0x769b('0x12')](_0x769b('0x13'),_0x2b67e7[_0x769b('0x11')],_0x2b67e7[_0x769b('0x14')]));}else if(_0x2b67e7[_0x769b('0x10')]==='variable'&&_0x2b67e7['variableName']&&_0x2b67e7['key']){_0x4f6df3[_0x2b67e7['variableName']]&&_0x3b4d8d[_0x769b('0x7')](util[_0x769b('0x12')](_0x769b('0x13'),_0x2b67e7[_0x769b('0x11')],_0x4f6df3[_0x2b67e7['variableName']]));}else if(_0x2b67e7[_0x769b('0x10')]===_0x769b('0x15')&&_0x2b67e7[_0x769b('0xc')]&&_0x2b67e7[_0x769b('0xc')][_0x769b('0xd')]&&_0x2b67e7[_0x769b('0x11')]){_0x4f6df3[_0x2b67e7[_0x769b('0xc')][_0x769b('0xd')]['toLowerCase']()]&&_0x3b4d8d['push'](util[_0x769b('0x12')](_0x769b('0x13'),_0x2b67e7['key'],_0x4f6df3[_0x2b67e7['Variable'][_0x769b('0xd')]['toLowerCase']()]));}}}}return _0x3b4d8d[_0x769b('0x16')](_0x58d7e9);};exports[_0x769b('0x17')]=function(_0x24ff7b){var _0x4fb884=_0x24ff7b[_0x769b('0x18')](-0x1);if(_0x4fb884==='/'){_0x24ff7b=_0x24ff7b[_0x769b('0x19')](0x0,_0x24ff7b['lastIndexOf'](_0x4fb884));}return _0x24ff7b;};exports[_0x769b('0x1a')]=function(_0x45f8a0){if(!_['isNil'](_0x45f8a0)&&_0x45f8a0!==''){var _0x4b743b=/^(([^<>()\[\]\\.,;:\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 _0x4b743b[_0x769b('0x1b')](String(_0x45f8a0)['toLowerCase']());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index 3d7b043..195e0b2 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['info','Creating\x20new\x20ticket...','merge','Normal','Subjects','POST','format','%s/webservice.php','remoteUri','create','username','sessionName','HelpDesk','stringify','success','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','then','Agent\x20found!','resolve','email1','first_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','admin','catch','userId','getUser','Searching\x20end\x20user\x20with\x20phone','GET','query','Enduser\x20found!','firstname','Enduser\x20created.','lastname','phone','accessKey','getchallenge','login','token','getConnection','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','lastevent','toUpperCase','lodash','request-promise','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','localhost','socket.io-emitter','emit','length','forEach','includes','picklist','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var rp=require(_0x0d8b('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require('util');var Redis=require(_0x0d8b('0x2'));var intUtil=require(_0x0d8b('0x3'));var config=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));config['redis']=_['defaults'](config[_0x0d8b('0x7')],{'host':_0x0d8b('0x8'),'port':0x18eb});var io=require(_0x0d8b('0x9'))(new Redis(config['redis']));function emit(_0x413284,_0x284169,_0x58e4e2){io['to'](_0x413284)[_0x0d8b('0xa')](_0x284169,_0x58e4e2);}function getCustomFields(_0x348e65,_0x3b027f){var _0x1f4800={};if(_0x348e65[_0x0d8b('0xb')]>0x0){_[_0x0d8b('0xc')](_0x348e65,function(_0x2c5e9e){if(_[_0x0d8b('0xd')](['string',_0x0d8b('0xe')],_0x2c5e9e['type'])&&_0x2c5e9e[_0x0d8b('0xf')]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x2c5e9e[_0x0d8b('0x10')][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x13')&&_0x2c5e9e[_0x0d8b('0x14')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x15')&&_0x2c5e9e['Variable']&&_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]['toLowerCase']()]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')][_0x0d8b('0x18')]()][_0x0d8b('0x11')]();}});}return _0x1f4800;}function createTicket(_0x18dd2d,_0x264b39,_0xa3612a,_0x4a15bf,_0x27512e,_0x23d58f,_0x196c0a){logger[_0x0d8b('0x19')](_0x0d8b('0x1a'));var _0x5b709c=_[_0x0d8b('0x1b')]({'parent_id':'','assigned_user_id':_0x264b39['id'],'ticketpriorities':_0x0d8b('0x1c'),'ticketstatus':'Open','ticket_title':intUtil['getString'](_0x4a15bf[_0x0d8b('0x1d')],_0x27512e,'\x20'),'description':intUtil['getString'](_0x4a15bf['Descriptions'],_0x27512e,'\x0a'),'contact_id':_0xa3612a['id']},getCustomFields(_0x23d58f,_0x27512e));var _0x5527d8={'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x18dd2d[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'username':_0x18dd2d[_0x0d8b('0x23')],'sessionName':_0x196c0a[_0x0d8b('0x24')],'elementType':_0x0d8b('0x25'),'element':JSON[_0x0d8b('0x26')](_0x5b709c)},'json':!![]};return request(_0x5527d8)['then'](function(_0xe8bbee){if(_0xe8bbee[_0x0d8b('0x27')]){return BPromise['resolve']({'id':_0xe8bbee[_0x0d8b('0x28')]['id']});}else{throw new Error(util['format'](_0x0d8b('0x29'),JSON[_0x0d8b('0x26')](_0xe8bbee[_0x0d8b('0x2a')])));}})['catch'](function(_0x59a905){var _0x28f639=_0x59a905[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),'createTicket',_0x28f639,JSON[_0x0d8b('0x26')](_0x59a905));});}function getUser(_0x4b59e5,_0x97050a,_0x48f24f){if(intUtil[_0x0d8b('0x2d')](_0x97050a)){logger['info'](_0x0d8b('0x2e'),_0x97050a);return request({'method':'GET','uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x4b59e5[_0x0d8b('0x21')]),'qs':{'operation':'query','username':_0x4b59e5['username'],'sessionName':_0x48f24f['sessionName'],'query':util[_0x0d8b('0x1f')]('SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;',_0x97050a)},'json':!![]})[_0x0d8b('0x2f')](function(_0x54f6f3){if(_0x54f6f3['success']&&_0x54f6f3[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x30'));return BPromise[_0x0d8b('0x31')]({'id':_0x54f6f3[_0x0d8b('0x28')][0x0]['id'],'email':_0x54f6f3[_0x0d8b('0x28')][0x0][_0x0d8b('0x32')],'name':_0x54f6f3['result'][0x0][_0x0d8b('0x33')]+'\x20'+_0x54f6f3[_0x0d8b('0x28')]['last_name']});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f['userId'],'email':_0x4b59e5[_0x0d8b('0x23')],'name':_0x0d8b('0x35')});}})[_0x0d8b('0x36')](function(_0x31ceba){var _0x933e01=_0x31ceba['statusCode']||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),'getUser',_0x933e01,JSON[_0x0d8b('0x26')](_0x31ceba));});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f[_0x0d8b('0x37')],'email':_0x4b59e5['username'],'name':'admin'})[_0x0d8b('0x36')](function(_0x5c2c04){var _0x531c55=_0x5c2c04[_0x0d8b('0x2b')]||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),_0x0d8b('0x38'),_0x531c55,JSON[_0x0d8b('0x26')](_0x5c2c04));});}}function getEndUser(_0x24c789,_0x579324,_0x6e5bab,_0x6a02ad){logger[_0x0d8b('0x19')](_0x0d8b('0x39'),_0x6e5bab);return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x24c789['remoteUri']),'qs':{'operation':_0x0d8b('0x3b'),'username':_0x24c789[_0x0d8b('0x23')],'sessionName':_0x6a02ad[_0x0d8b('0x24')],'query':util[_0x0d8b('0x1f')]('SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;',_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab)},'json':!![]})[_0x0d8b('0x2f')](function(_0x4b4bde){if(_0x4b4bde[_0x0d8b('0x27')]&&_0x4b4bde[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x3c'));return BPromise[_0x0d8b('0x31')]({'id':_0x4b4bde[_0x0d8b('0x28')][0x0]['id'],'name':_0x4b4bde[_0x0d8b('0x28')][0x0][_0x0d8b('0x3d')]+'\x20'+_0x4b4bde[_0x0d8b('0x28')][0x0]['lastname'],'phone':_0x6e5bab});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':'POST','uri':util['format'](_0x0d8b('0x20'),_0x24c789[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'sessionName':_0x6a02ad['sessionName'],'elementType':'Contacts','element':JSON[_0x0d8b('0x26')]({'lastname':_0x579324,'phone':_0x6e5bab,'assigned_user_id':'\x20'})},'json':!![]})[_0x0d8b('0x2f')](function(_0x344278){logger['info'](_0x0d8b('0x3e'));return BPromise[_0x0d8b('0x31')]({'id':_0x344278['result']['id'],'name':_0x344278['result'][_0x0d8b('0x3f')],'phone':_0x344278['result'][_0x0d8b('0x40')]});})['catch'](function(_0x53f643){var _0x30ccee=_0x53f643[_0x0d8b('0x2b')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','getEndUser',_0x30ccee,JSON['stringify'](_0x53f643));});}});}function getConnection(_0x374d40){var _0x1e0498=_0x374d40[_0x0d8b('0x23')];var _0x490eda=_0x374d40[_0x0d8b('0x41')];return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'qs':{'operation':_0x0d8b('0x42'),'username':_0x1e0498},'json':!![]})[_0x0d8b('0x2f')](function(_0x1d5067){if(_0x1d5067[_0x0d8b('0x27')]){return request({'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x43'),'username':_0x1e0498,'accessKey':md5(_0x1d5067[_0x0d8b('0x28')][_0x0d8b('0x44')]+_0x490eda)},'json':!![]});}})[_0x0d8b('0x2f')](function(_0x1e162c){if(_0x1e162c[_0x0d8b('0x27')]){return BPromise['resolve'](_0x1e162c[_0x0d8b('0x28')]);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x374d40['id']));}})[_0x0d8b('0x36')](function(_0x113fb7){var _0x3f943a=_0x113fb7[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),_0x0d8b('0x45'),_0x3f943a,JSON[_0x0d8b('0x26')](_0x113fb7));});}function request(_0x241587){logger[_0x0d8b('0x19')]('[HTTP]',JSON['stringify'](_0x241587));return rp(_0x241587);}exports['queue']=function(_0x573f4f,_0x368ede,_0xf22c3c,_0x5e3bb4,_0x4950a8,_0x44c5c1){var _0x3d3cb6,_0x5c5bd7,_0x5ef6c3,_0x900906;_0x44c5c1[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x44c5c1[_0x0d8b('0x21')]);if(_0x4950a8&&_0x4950a8[_0x0d8b('0x47')]){logger['info'](_0x0d8b('0x48'),_0x0d8b('0x49'));_0x368ede['recordingURL']=util['format'](_0x0d8b('0x4a'),_0x44c5c1[_0x0d8b('0x4b')],_0x368ede['uniqueid'],md5(_0x368ede['uniqueid']));}else{_0x368ede[_0x0d8b('0x4c')]='';}return getConnection(_0x44c5c1)[_0x0d8b('0x2f')](function(_0x377027){_0x900906=_0x377027;return getUser(_0x44c5c1,_0x5e3bb4[_0x0d8b('0x4d')],_0x900906);})['then'](function(_0x356b3d){_0x3d3cb6=_0x356b3d;logger['info']('The\x20User\x20ID\x20is:',_0x3d3cb6['id']);return getEndUser(_0x44c5c1,_0x368ede[_0x0d8b('0x4e')],_0x368ede[_0x0d8b('0x4f')],_0x900906);})['then'](function(_0x4a8f33){_0x5c5bd7=_0x4a8f33;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x5c5bd7['id']);return createTicket(_0x44c5c1,_0x3d3cb6,_0x5c5bd7,_0xf22c3c,_0x368ede,_0xf22c3c[_0x0d8b('0x51')],_0x900906);})[_0x0d8b('0x2f')](function(_0x3afc3a){_0x5ef6c3=_0x3afc3a;logger[_0x0d8b('0x19')](_0x0d8b('0x52'));logger[_0x0d8b('0x19')]('The\x20Ticket\x20ID\x20is:',_0x5ef6c3['id']);var _0x24a859=util[_0x0d8b('0x1f')](_0x0d8b('0x53'),_0x44c5c1[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5ef6c3['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x48'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')]('user:%s',_0x5e3bb4[_0x0d8b('0x17')]),_0x0d8b('0x56'),{'uri':_0x24a859});})[_0x0d8b('0x36')](function(_0x23de9e){logger[_0x0d8b('0x2a')]('[QUEUE]',JSON[_0x0d8b('0x26')](_0x23de9e));});};exports[_0x0d8b('0x57')]=function(_0x181d49,_0x17a87f,_0x1d6cd4,_0x59ada2,_0x4d0e7c,_0x3b1166,_0x291b83){var _0x3e4a41,_0xbbb520,_0x5a70bd,_0x199122;_0x3b1166[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x3b1166['remoteUri']);_0x3b1166[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x3b1166[_0x0d8b('0x4b')]);if(_0x291b83&&_0x291b83[_0x0d8b('0x58')]&&_0x291b83[_0x0d8b('0x58')]!==_0x0d8b('0x59')){logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),'Recording\x20is\x20enabled!');_0x17a87f[_0x0d8b('0x4c')]=util['format'](_0x0d8b('0x4a'),_0x3b1166[_0x0d8b('0x4b')],_0x17a87f[_0x0d8b('0x5b')],md5(_0x17a87f[_0x0d8b('0x5b')]));}return getConnection(_0x3b1166)['then'](function(_0x19e097){_0x199122=_0x19e097;return getUser(_0x3b1166,_0x59ada2[_0x0d8b('0x4d')],_0x199122);})[_0x0d8b('0x2f')](function(_0x2332fc){_0x3e4a41=_0x2332fc;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0x3e4a41['id']);return getEndUser(_0x3b1166,_0x17a87f[_0x0d8b('0x5d')],_0x17a87f[_0x0d8b('0x5e')],_0x199122);})[_0x0d8b('0x2f')](function(_0x34affb){_0xbbb520=_0x34affb;logger['info']('The\x20Enduser\x20ID\x20is:',_0xbbb520['id']);return createTicket(_0x3b1166,_0x3e4a41,_0xbbb520,_0x1d6cd4,_0x17a87f,_0x1d6cd4[_0x0d8b('0x51')],_0x199122);})[_0x0d8b('0x2f')](function(_0x53e399){_0x5a70bd=_0x53e399;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger['info'](_0x0d8b('0x5f'),_0x5a70bd['id']);var _0x1c4e96=util['format']('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x3b1166[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5a70bd['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')](_0x0d8b('0x60'),_0x59ada2['name']),_0x0d8b('0x56'),{'uri':_0x1c4e96});})['catch'](function(_0x1a203e){logger[_0x0d8b('0x2a')](_0x0d8b('0x5a'),JSON[_0x0d8b('0x26')](_0x1a203e));});};exports['unmanaged']=function(_0x3fe47d,_0x4a1c4a,_0x3a356b,_0x2c6c5f,_0x1c5fe2,_0x2ebea3){var _0xc5c35f,_0x2b44e5,_0x3e927c,_0x91aa89;_0x2ebea3[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x2ebea3['remoteUri']);_0x2ebea3[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x2ebea3[_0x0d8b('0x4b')]);if(_0x1c5fe2&&_0x1c5fe2[_0x0d8b('0x47')]){logger['info']('['+_0x4a1c4a[_0x0d8b('0x61')]['toUpperCase']()+']',_0x0d8b('0x49'));_0x4a1c4a[_0x0d8b('0x4c')]=util[_0x0d8b('0x1f')](_0x0d8b('0x4a'),_0x2ebea3[_0x0d8b('0x4b')],_0x4a1c4a[_0x0d8b('0x5b')],md5(_0x4a1c4a[_0x0d8b('0x5b')]));}else{_0x4a1c4a[_0x0d8b('0x4c')]='';}return getConnection(_0x2ebea3)['then'](function(_0x10eca6){_0x91aa89=_0x10eca6;return getUser(_0x2ebea3,'',_0x91aa89);})[_0x0d8b('0x2f')](function(_0x5b2916){_0xc5c35f=_0x5b2916;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0xc5c35f['id']);return getEndUser(_0x2ebea3,_0x4a1c4a[_0x0d8b('0x4e')],_0x4a1c4a[_0x0d8b('0x4f')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0x9e44b4){_0x2b44e5=_0x9e44b4;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x2b44e5['id']);return createTicket(_0x2ebea3,_0xc5c35f,_0x2b44e5,_0x3a356b,_0x4a1c4a,_0x3a356b[_0x0d8b('0x51')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0xe35028){_0x3e927c=_0xe35028;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger[_0x0d8b('0x19')](_0x0d8b('0x5f'),_0x3e927c['id']);})[_0x0d8b('0x36')](function(_0x58525c){logger['error']('['+_0x4a1c4a[_0x0d8b('0x61')][_0x0d8b('0x62')]()+']',JSON[_0x0d8b('0x26')](_0x58525c));});}; \ No newline at end of file +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(_0x2e0443,_0x7e5974){var _0x52d450=function(_0x3a9985){while(--_0x3a9985){_0x2e0443['push'](_0x2e0443['shift']());}};_0x52d450(++_0x7e5974);}(_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 ab911f6..39e9ec5 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 _0xb2f7=['results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','user','authType','password','username','%s/token:%s','token','Basic\x20%s','toString','debug','[HTTP]','stringify','GET','forEach','string','type','nameField','customField','toLowerCase','picklist','idField','push','variable','variableName','custom_fields','customVariable','Variable','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','catch','error','inspect','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','/api/v2','unmanaged','monitor_format','toUpperCase','lastevent','lodash','request-promise','md5','util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','application/json','Creating\x20new\x20ticket...','format','remoteUri','POST','Tags','name','getString','Descriptions','then','info','Ticket\x20created!','validateEmail','%s/search.json','count','Agent\x20found!','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb2f7,0xb6));var _0x7b2f=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xb2f7[_0x3b5250];return _0xc844a1;};'use strict';var _=require(_0x7b2f('0x0'));var rp=require(_0x7b2f('0x1'));var md5=require(_0x7b2f('0x2'));var util=require(_0x7b2f('0x3'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x7b2f('0x4'));var logger=require(_0x7b2f('0x5'))(_0x7b2f('0x6'));config[_0x7b2f('0x7')]=_[_0x7b2f('0x8')](config['redis'],{'host':_0x7b2f('0x9'),'port':0x18eb});var io=require(_0x7b2f('0xa'))(new Redis(config[_0x7b2f('0x7')]));function emit(_0x4a8dbe,_0x382427,_0x130259){io['to'](_0x4a8dbe)['emit'](_0x382427,_0x130259);}var headers={'Content-Type':'application/json','Accept':_0x7b2f('0xb')};function getTicket(_0xba7998,_0x294ef0,_0x11de4a,_0x2bb249,_0x1e4ac6){logger['info'](_0x7b2f('0xc'));return request({'uri':util[_0x7b2f('0xd')]('%s/tickets.json',_0xba7998[_0x7b2f('0xe')]),'method':_0x7b2f('0xf'),'body':{'ticket':_['merge']({'requester_id':_0x11de4a['id'],'submitter_id':_0x294ef0?_0x294ef0['id']:undefined,'assignee_id':_0x294ef0?_0x294ef0['id']:undefined,'tags':getTags(_0x2bb249[_0x7b2f('0x10')],_0x7b2f('0x11')),'subject':intUtil['getString'](_0x2bb249['Subjects'],_0x1e4ac6,'\x20'),'description':intUtil[_0x7b2f('0x12')](_0x2bb249['Descriptions'],_0x1e4ac6,'\x0a'),'comment':{'public':![],'body':intUtil[_0x7b2f('0x12')](_0x2bb249[_0x7b2f('0x13')],_0x1e4ac6,'\x0a')}},getCustomFields(_0x2bb249['Fields'],_0x1e4ac6))}})[_0x7b2f('0x14')](function(_0x36e7a0){logger[_0x7b2f('0x15')](_0x7b2f('0x16'));return _0x36e7a0['ticket'];});}function getUser(_0xec2e01,_0x2bd2e7){if(intUtil[_0x7b2f('0x17')](_0x2bd2e7)){logger['info']('Getting\x20agent\x20with\x20email',_0x2bd2e7);return request({'uri':util[_0x7b2f('0xd')](_0x7b2f('0x18'),_0xec2e01[_0x7b2f('0xe')]),'qs':{'query':util[_0x7b2f('0xd')]('type:user\x20role:agent\x20email:%s',_0x2bd2e7)}})['then'](function(_0x26cf5a){if(_0x26cf5a[_0x7b2f('0x19')]){logger[_0x7b2f('0x15')](_0x7b2f('0x1a'));return _[_0x7b2f('0x1b')](_0x26cf5a[_0x7b2f('0x1c')],{'email':_0x2bd2e7,'role':_0x7b2f('0x1d')});}else{logger[_0x7b2f('0x15')](_0x7b2f('0x1e'));return request({'uri':util[_0x7b2f('0xd')]('%s/users/me.json',_0xec2e01['remoteUri'])})[_0x7b2f('0x14')](function(_0x5c694e){logger[_0x7b2f('0x15')]('Admin\x20account\x20selected.');return _0x5c694e['user'];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x7b2f('0xd')](_0x7b2f('0x1f'),_0xec2e01['remoteUri'])})['then'](function(_0x57b6f0){logger[_0x7b2f('0x15')](_0x7b2f('0x20'));return _0x57b6f0['user'];});}}function getEndUser(_0x330efb,_0x34f3d6,_0x1d98b4){logger['info'](_0x7b2f('0x21'),_0x1d98b4);return request({'uri':util['format'](_0x7b2f('0x18'),_0x330efb[_0x7b2f('0xe')]),'qs':{'query':util[_0x7b2f('0xd')](_0x7b2f('0x22'),_0x1d98b4)}})[_0x7b2f('0x14')](function(_0x18c06a){var _0x13dcdf;if(_0x18c06a[_0x7b2f('0x1c')][_0x7b2f('0x23')]){_0x18c06a[_0x7b2f('0x1c')]=_['filter'](_0x18c06a[_0x7b2f('0x1c')],{'suspended':![],'role':_0x7b2f('0x24')});if(_0x18c06a[_0x7b2f('0x1c')]['length']){_0x13dcdf=_[_0x7b2f('0x25')](_0x18c06a[_0x7b2f('0x1c')]);}}if(_0x13dcdf){logger[_0x7b2f('0x15')](_0x7b2f('0x26'));return _0x13dcdf;}else{logger[_0x7b2f('0x15')](_0x7b2f('0x27'));return request({'uri':util[_0x7b2f('0xd')](_0x7b2f('0x28'),_0x330efb[_0x7b2f('0xe')]),'method':'POST','body':{'user':{'role':_0x7b2f('0x24'),'name':util[_0x7b2f('0xd')](_0x7b2f('0x29'),_0x34f3d6||_0x1d98b4),'phone':_0x1d98b4}}})[_0x7b2f('0x14')](function(_0xc50c2a){logger[_0x7b2f('0x15')]('Enduser\x20created.');return _0xc50c2a[_0x7b2f('0x2a')];});}});}function getAuth(_0x19c0a9){var _0x394c1f;if(_0x19c0a9[_0x7b2f('0x2b')]===_0x7b2f('0x2c')){_0x394c1f=util['format']('%s:%s',_0x19c0a9[_0x7b2f('0x2d')],_0x19c0a9[_0x7b2f('0x2c')]);}else if(_0x19c0a9[_0x7b2f('0x2b')]==='token'){_0x394c1f=util['format'](_0x7b2f('0x2e'),_0x19c0a9[_0x7b2f('0x2d')],_0x19c0a9[_0x7b2f('0x2f')]);}return util[_0x7b2f('0xd')](_0x7b2f('0x30'),new Buffer(_0x394c1f)[_0x7b2f('0x31')]('base64'));}function request(_0x164e3d){logger[_0x7b2f('0x32')](_0x7b2f('0x33'),JSON[_0x7b2f('0x34')](_0x164e3d));return rp(_[_0x7b2f('0x8')](_0x164e3d,{'method':_0x7b2f('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x54aa9f,_0x11c5f6){var _0x1c76b7=[];if(_0x54aa9f&&_0x54aa9f['length']>0x0){_0x1c76b7=_['map'](_0x54aa9f,_0x11c5f6);}return _0x1c76b7;}function getCustomFields(_0xb2e355,_0x2da581){var _0x3776f9=[];var _0x17fa2f={'custom_fields':[]};if(_0xb2e355[_0x7b2f('0x23')]>0x0){_[_0x7b2f('0x36')](_0xb2e355,function(_0xc54759){if(_['includes']([_0x7b2f('0x37'),'picklist'],_0xc54759[_0x7b2f('0x38')])&&_0xc54759[_0x7b2f('0x39')]&&!_0xc54759[_0x7b2f('0x3a')]){_0x17fa2f[_0xc54759[_0x7b2f('0x39')][_0x7b2f('0x3b')]()]=_0xc54759['content'][_0x7b2f('0x31')]();}else if(_['includes']([_0x7b2f('0x37'),_0x7b2f('0x3c')],_0xc54759[_0x7b2f('0x38')])&&_0xc54759[_0x7b2f('0x3d')]&&_0xc54759[_0x7b2f('0x3a')]){_0x17fa2f['custom_fields'][_0x7b2f('0x3e')]({'id':_0xc54759[_0x7b2f('0x3d')],'value':_0xc54759['content'][_0x7b2f('0x31')]()});}else if(_0xc54759[_0x7b2f('0x38')]===_0x7b2f('0x3f')&&_0xc54759[_0x7b2f('0x40')]&&_0xc54759[_0x7b2f('0x3d')]&&_0xc54759['customField']){_0x2da581[_0xc54759[_0x7b2f('0x40')]]&&_0x17fa2f[_0x7b2f('0x41')][_0x7b2f('0x3e')]({'id':_0xc54759[_0x7b2f('0x3d')],'value':_0x2da581[_0xc54759[_0x7b2f('0x40')]][_0x7b2f('0x31')]()});}else if(_0xc54759['type']===_0x7b2f('0x42')&&_0xc54759[_0x7b2f('0x43')]&&_0xc54759[_0x7b2f('0x43')][_0x7b2f('0x11')]&&_0xc54759[_0x7b2f('0x3d')]&&_0xc54759[_0x7b2f('0x3a')]){_0x2da581[_0xc54759['Variable']['name']['toLowerCase']()]&&_0x17fa2f[_0x7b2f('0x41')][_0x7b2f('0x3e')]({'id':_0xc54759[_0x7b2f('0x3d')],'value':_0x2da581[_0xc54759[_0x7b2f('0x43')][_0x7b2f('0x11')][_0x7b2f('0x3b')]()][_0x7b2f('0x31')]()});}});}return _0x17fa2f;}exports['queue']=function(_0x4dfb19,_0x4c8ecd,_0x582598,_0x401b6b,_0x65844f,_0x3ae133){var _0x370e9e,_0x218b12;_0x3ae133[_0x7b2f('0xe')]=intUtil[_0x7b2f('0x44')](_0x3ae133[_0x7b2f('0xe')]);_0x3ae133['serverUrl']=intUtil[_0x7b2f('0x44')](_0x3ae133['serverUrl']);if(_0x65844f&&_0x65844f['monitor_format']){logger[_0x7b2f('0x15')](_0x7b2f('0x45'),_0x7b2f('0x46'));_0x4c8ecd[_0x7b2f('0x47')]=util[_0x7b2f('0xd')](_0x7b2f('0x48'),_0x3ae133[_0x7b2f('0x49')],_0x4c8ecd[_0x7b2f('0x4a')],md5(_0x4c8ecd[_0x7b2f('0x4a')]));}else{_0x4c8ecd[_0x7b2f('0x47')]='';}headers[_0x7b2f('0x4b')]=getAuth(_0x3ae133);return getUser(_0x3ae133,_0x401b6b[_0x7b2f('0x4c')])[_0x7b2f('0x14')](function(_0x1e9c9b){_0x370e9e=_0x1e9c9b;logger[_0x7b2f('0x15')](_0x7b2f('0x4d'),_0x370e9e['id']);return getEndUser(_0x3ae133,_0x4c8ecd[_0x7b2f('0x4e')],_0x4c8ecd[_0x7b2f('0x4f')]);})[_0x7b2f('0x14')](function(_0x2f9bcc){_0x218b12=_0x2f9bcc;logger[_0x7b2f('0x15')](_0x7b2f('0x50'),_0x218b12['id']);return getTicket(_0x3ae133,_0x370e9e,_0x218b12,_0x582598,_0x4c8ecd);})['then'](function(_0x187e10){if(_0x187e10){logger[_0x7b2f('0x15')](_0x7b2f('0x51'),_0x187e10['id']);switch(_0x3ae133[_0x7b2f('0x38')]){case _0x7b2f('0x52'):logger['info'](_0x7b2f('0x45'),_0x7b2f('0x53'));return request({'uri':util[_0x7b2f('0xd')](_0x7b2f('0x54'),_0x3ae133[_0x7b2f('0xe')],_0x370e9e['id'],_0x187e10['id']),'method':_0x7b2f('0xf')});case _0x7b2f('0x55'):logger[_0x7b2f('0x15')](_0x7b2f('0x45'),_0x7b2f('0x56'));emit(util[_0x7b2f('0xd')](_0x7b2f('0x57'),_0x401b6b[_0x7b2f('0x11')]),_0x7b2f('0x58'),{'uri':util[_0x7b2f('0xd')](_0x7b2f('0x59'),_0x3ae133[_0x7b2f('0xe')][_0x7b2f('0x5a')]('/api/v2',''),_0x187e10['id'])});break;default:logger['error'](_0x7b2f('0x45'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x7b2f('0x5b')](function(_0x5f8ee7){logger[_0x7b2f('0x5c')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0x7b2f('0x5d')](_0x5f8ee7,{'showHidden':!![],'depth':null}));});};exports[_0x7b2f('0x5e')]=function(_0x39d60f,_0x96942,_0x490a41,_0xfe427d,_0x32ac3f,_0x3d48de,_0x2e1b67){var _0x19c684,_0x6db699;_0x3d48de[_0x7b2f('0xe')]=intUtil[_0x7b2f('0x44')](_0x3d48de['remoteUri']);_0x3d48de[_0x7b2f('0x49')]=intUtil[_0x7b2f('0x44')](_0x3d48de[_0x7b2f('0x49')]);if(_0x2e1b67&&_0x2e1b67[_0x7b2f('0x5f')]&&_0x2e1b67[_0x7b2f('0x5f')]!==_0x7b2f('0x60')){logger[_0x7b2f('0x15')](_0x7b2f('0x61'),'Recording\x20is\x20enabled!');_0x96942[_0x7b2f('0x47')]=util[_0x7b2f('0xd')](_0x7b2f('0x48'),_0x3d48de[_0x7b2f('0x49')],_0x96942[_0x7b2f('0x4a')],md5(_0x96942['uniqueid']));}headers[_0x7b2f('0x4b')]=getAuth(_0x3d48de);return getUser(_0x3d48de,_0xfe427d['email'])['then'](function(_0x1d68d3){_0x19c684=_0x1d68d3;logger['info'](_0x7b2f('0x4d'),_0x19c684['id']);return getEndUser(_0x3d48de,_0x96942[_0x7b2f('0x62')],_0x96942[_0x7b2f('0x63')]);})['then'](function(_0xae87bc){_0x6db699=_0xae87bc;logger[_0x7b2f('0x15')](_0x7b2f('0x50'),_0x6db699['id']);return getTicket(_0x3d48de,_0x19c684,_0x6db699,_0x490a41,_0x96942);})[_0x7b2f('0x14')](function(_0x3c8bbf){if(_0x3c8bbf){logger[_0x7b2f('0x15')](_0x7b2f('0x51'),_0x3c8bbf['id']);switch(_0x3d48de['type']){case _0x7b2f('0x52'):logger[_0x7b2f('0x15')](_0x7b2f('0x61'),_0x7b2f('0x53'));return request({'uri':util['format'](_0x7b2f('0x54'),_0x3d48de['remoteUri'],_0x19c684['id'],_0x3c8bbf['id']),'method':_0x7b2f('0xf')});case _0x7b2f('0x55'):logger[_0x7b2f('0x15')](_0x7b2f('0x61'),_0x7b2f('0x56'));emit(util[_0x7b2f('0xd')](_0x7b2f('0x57'),_0xfe427d[_0x7b2f('0x11')]),_0x7b2f('0x58'),{'uri':util[_0x7b2f('0xd')]('%s/agent/tickets/%s',_0x3d48de[_0x7b2f('0xe')]['replace'](_0x7b2f('0x64'),''),_0x3c8bbf['id'])});break;default:logger['error'](_0x7b2f('0x61'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x3c0e81){logger[_0x7b2f('0x5c')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0x7b2f('0x5d')](_0x3c0e81,{'showHidden':!![],'depth':null}));});};exports[_0x7b2f('0x65')]=function(_0x22404f,_0x8a5082,_0x4ee489,_0x28c949,_0x1331c7,_0x194306){var _0x130cca,_0x43eb0b;_0x194306['remoteUri']=intUtil[_0x7b2f('0x44')](_0x194306[_0x7b2f('0xe')]);_0x194306[_0x7b2f('0x49')]=intUtil['stripTrailingSlash'](_0x194306[_0x7b2f('0x49')]);if(_0x1331c7&&_0x1331c7[_0x7b2f('0x66')]){logger[_0x7b2f('0x15')]('['+_0x8a5082['lastevent'][_0x7b2f('0x67')]()+']',_0x7b2f('0x46'));_0x8a5082[_0x7b2f('0x47')]=util[_0x7b2f('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x194306[_0x7b2f('0x49')],_0x8a5082['uniqueid'],md5(_0x8a5082['uniqueid']));}else{_0x8a5082[_0x7b2f('0x47')]='';}headers[_0x7b2f('0x4b')]=getAuth(_0x194306);return getUser(_0x194306)[_0x7b2f('0x14')](function(_0x38886e){_0x130cca=_0x38886e;logger['info'](_0x7b2f('0x4d'),_0x130cca['id']);return getEndUser(_0x194306,_0x8a5082[_0x7b2f('0x4e')],_0x8a5082[_0x7b2f('0x4f')]);})['then'](function(_0x1cc022){_0x43eb0b=_0x1cc022;logger[_0x7b2f('0x15')]('The\x20Enduser\x20ID\x20is:',_0x43eb0b['id']);return getTicket(_0x194306,_0x130cca,_0x43eb0b,_0x4ee489,_0x8a5082);})[_0x7b2f('0x14')](function(_0x54d266){if(_0x54d266){logger['info']('The\x20Ticket\x20ID\x20is:',_0x54d266['id']);}})[_0x7b2f('0x5b')](function(_0x1f75a6){logger[_0x7b2f('0x5c')]('['+_0x8a5082[_0x7b2f('0x68')][_0x7b2f('0x67')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x7b2f('0x5d')](_0x1f75a6,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xc0dc=['redis','defaults','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','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','token','%s/token:%s','Basic\x20%s','base64','debug','[HTTP]','stringify','length','map','forEach','includes','string','picklist','type','customField','toLowerCase','content','toString','idField','variable','variableName','push','customVariable','Variable','name','queue','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','stripTrailingSlash','recordingFormat','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','toUpperCase','calleridname','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','util','ioredis','../../../../config/environment','../../../../config/logger','zendesk'];(function(_0x3d19d9,_0x5ecdaa){var _0x1ab1d7=function(_0x1dfe5e){while(--_0x1dfe5e){_0x3d19d9['push'](_0x3d19d9['shift']());}};_0x1ab1d7(++_0x5ecdaa);}(_0xc0dc,0x1c5));var _0xcc0d=function(_0x1e6dfb,_0xe01cdd){_0x1e6dfb=_0x1e6dfb-0x0;var _0x32d3f1=_0xc0dc[_0x1e6dfb];return _0x32d3f1;};'use strict';var _=require(_0xcc0d('0x0'));var rp=require(_0xcc0d('0x1'));var md5=require('md5');var util=require(_0xcc0d('0x2'));var Redis=require(_0xcc0d('0x3'));var intUtil=require('./util');var config=require(_0xcc0d('0x4'));var logger=require(_0xcc0d('0x5'))(_0xcc0d('0x6'));config[_0xcc0d('0x7')]=_[_0xcc0d('0x8')](config['redis'],{'host':_0xcc0d('0x9'),'port':0x18eb});var io=require(_0xcc0d('0xa'))(new Redis(config['redis']));function emit(_0x3d5525,_0x2025e9,_0x1aa970){io['to'](_0x3d5525)['emit'](_0x2025e9,_0x1aa970);}var headers={'Content-Type':_0xcc0d('0xb'),'Accept':_0xcc0d('0xb')};function getTicket(_0x209d30,_0x46e54e,_0x5b3ebc,_0x14eddd,_0x57aa6f){logger[_0xcc0d('0xc')](_0xcc0d('0xd'));return request({'uri':util[_0xcc0d('0xe')](_0xcc0d('0xf'),_0x209d30[_0xcc0d('0x10')]),'method':_0xcc0d('0x11'),'body':{'ticket':_['merge']({'requester_id':_0x5b3ebc['id'],'submitter_id':_0x46e54e?_0x46e54e['id']:undefined,'assignee_id':_0x46e54e?_0x46e54e['id']:undefined,'tags':getTags(_0x14eddd['Tags'],'name'),'subject':intUtil[_0xcc0d('0x12')](_0x14eddd[_0xcc0d('0x13')],_0x57aa6f,'\x20'),'description':intUtil['getString'](_0x14eddd['Descriptions'],_0x57aa6f,'\x0a'),'comment':{'public':![],'body':intUtil[_0xcc0d('0x12')](_0x14eddd[_0xcc0d('0x14')],_0x57aa6f,'\x0a')}},getCustomFields(_0x14eddd[_0xcc0d('0x15')],_0x57aa6f))}})[_0xcc0d('0x16')](function(_0x202bac){logger[_0xcc0d('0xc')](_0xcc0d('0x17'));return _0x202bac[_0xcc0d('0x18')];});}function getUser(_0x3a8ad3,_0x2b9fda){if(intUtil[_0xcc0d('0x19')](_0x2b9fda)){logger[_0xcc0d('0xc')](_0xcc0d('0x1a'),_0x2b9fda);return request({'uri':util['format']('%s/search.json',_0x3a8ad3['remoteUri']),'qs':{'query':util[_0xcc0d('0xe')](_0xcc0d('0x1b'),_0x2b9fda)}})[_0xcc0d('0x16')](function(_0x2289ec){if(_0x2289ec[_0xcc0d('0x1c')]){logger[_0xcc0d('0xc')](_0xcc0d('0x1d'));return _[_0xcc0d('0x1e')](_0x2289ec[_0xcc0d('0x1f')],{'email':_0x2b9fda,'role':_0xcc0d('0x20')});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/users/me.json',_0x3a8ad3[_0xcc0d('0x10')])})[_0xcc0d('0x16')](function(_0xac5722){logger[_0xcc0d('0xc')](_0xcc0d('0x21'));return _0xac5722[_0xcc0d('0x22')];});}});}else{logger[_0xcc0d('0xc')](_0xcc0d('0x23'));return request({'uri':util[_0xcc0d('0xe')](_0xcc0d('0x24'),_0x3a8ad3[_0xcc0d('0x10')])})[_0xcc0d('0x16')](function(_0xfa1f8f){logger['info'](_0xcc0d('0x21'));return _0xfa1f8f[_0xcc0d('0x22')];});}}function getEndUser(_0x8e2b9b,_0x295b79,_0x4a117b){logger[_0xcc0d('0xc')](_0xcc0d('0x25'),_0x4a117b);return request({'uri':util[_0xcc0d('0xe')](_0xcc0d('0x26'),_0x8e2b9b[_0xcc0d('0x10')]),'qs':{'query':util['format'](_0xcc0d('0x27'),_0x4a117b)}})[_0xcc0d('0x16')](function(_0x2ea1d0){var _0x336d08;if(_0x2ea1d0[_0xcc0d('0x1f')]['length']){_0x2ea1d0[_0xcc0d('0x1f')]=_[_0xcc0d('0x28')](_0x2ea1d0[_0xcc0d('0x1f')],{'suspended':![],'role':_0xcc0d('0x29')});if(_0x2ea1d0['results']['length']){_0x336d08=_[_0xcc0d('0x2a')](_0x2ea1d0[_0xcc0d('0x1f')]);}}if(_0x336d08){logger[_0xcc0d('0xc')](_0xcc0d('0x2b'));return _0x336d08;}else{logger[_0xcc0d('0xc')](_0xcc0d('0x2c'));return request({'uri':util['format'](_0xcc0d('0x2d'),_0x8e2b9b['remoteUri']),'method':_0xcc0d('0x11'),'body':{'user':{'role':_0xcc0d('0x29'),'name':util[_0xcc0d('0xe')](_0xcc0d('0x2e'),_0x295b79||_0x4a117b),'phone':_0x4a117b}}})[_0xcc0d('0x16')](function(_0x395775){logger[_0xcc0d('0xc')](_0xcc0d('0x2f'));return _0x395775[_0xcc0d('0x22')];});}});}function getAuth(_0x242e42){var _0x39e3c2;if(_0x242e42[_0xcc0d('0x30')]===_0xcc0d('0x31')){_0x39e3c2=util[_0xcc0d('0xe')](_0xcc0d('0x32'),_0x242e42['username'],_0x242e42[_0xcc0d('0x31')]);}else if(_0x242e42[_0xcc0d('0x30')]===_0xcc0d('0x33')){_0x39e3c2=util[_0xcc0d('0xe')](_0xcc0d('0x34'),_0x242e42['username'],_0x242e42[_0xcc0d('0x33')]);}return util[_0xcc0d('0xe')](_0xcc0d('0x35'),new Buffer(_0x39e3c2)['toString'](_0xcc0d('0x36')));}function request(_0x376e71){logger[_0xcc0d('0x37')](_0xcc0d('0x38'),JSON[_0xcc0d('0x39')](_0x376e71));return rp(_[_0xcc0d('0x8')](_0x376e71,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x324cf7,_0x1a51c4){var _0x6829e8=[];if(_0x324cf7&&_0x324cf7[_0xcc0d('0x3a')]>0x0){_0x6829e8=_[_0xcc0d('0x3b')](_0x324cf7,_0x1a51c4);}return _0x6829e8;}function getCustomFields(_0x1befdd,_0x18cbd2){var _0x40ca5d=[];var _0x9b6231={'custom_fields':[]};if(_0x1befdd[_0xcc0d('0x3a')]>0x0){_[_0xcc0d('0x3c')](_0x1befdd,function(_0x1a9a2e){if(_[_0xcc0d('0x3d')]([_0xcc0d('0x3e'),_0xcc0d('0x3f')],_0x1a9a2e[_0xcc0d('0x40')])&&_0x1a9a2e['nameField']&&!_0x1a9a2e[_0xcc0d('0x41')]){_0x9b6231[_0x1a9a2e['nameField'][_0xcc0d('0x42')]()]=_0x1a9a2e[_0xcc0d('0x43')][_0xcc0d('0x44')]();}else if(_[_0xcc0d('0x3d')]([_0xcc0d('0x3e'),_0xcc0d('0x3f')],_0x1a9a2e[_0xcc0d('0x40')])&&_0x1a9a2e[_0xcc0d('0x45')]&&_0x1a9a2e[_0xcc0d('0x41')]){_0x9b6231['custom_fields']['push']({'id':_0x1a9a2e[_0xcc0d('0x45')],'value':_0x1a9a2e[_0xcc0d('0x43')]['toString']()});}else if(_0x1a9a2e[_0xcc0d('0x40')]===_0xcc0d('0x46')&&_0x1a9a2e[_0xcc0d('0x47')]&&_0x1a9a2e[_0xcc0d('0x45')]&&_0x1a9a2e[_0xcc0d('0x41')]){_0x18cbd2[_0x1a9a2e[_0xcc0d('0x47')]]&&_0x9b6231['custom_fields'][_0xcc0d('0x48')]({'id':_0x1a9a2e[_0xcc0d('0x45')],'value':_0x18cbd2[_0x1a9a2e[_0xcc0d('0x47')]]['toString']()});}else if(_0x1a9a2e[_0xcc0d('0x40')]===_0xcc0d('0x49')&&_0x1a9a2e['Variable']&&_0x1a9a2e[_0xcc0d('0x4a')]['name']&&_0x1a9a2e[_0xcc0d('0x45')]&&_0x1a9a2e[_0xcc0d('0x41')]){_0x18cbd2[_0x1a9a2e[_0xcc0d('0x4a')][_0xcc0d('0x4b')][_0xcc0d('0x42')]()]&&_0x9b6231['custom_fields']['push']({'id':_0x1a9a2e[_0xcc0d('0x45')],'value':_0x18cbd2[_0x1a9a2e[_0xcc0d('0x4a')]['name'][_0xcc0d('0x42')]()][_0xcc0d('0x44')]()});}});}return _0x9b6231;}exports[_0xcc0d('0x4c')]=function(_0x1ae04b,_0x5d6630,_0x754933,_0x362b9c,_0xe7aeb4,_0x2ad869){var _0x5c3294,_0x262f42;_0x2ad869[_0xcc0d('0x10')]=intUtil['stripTrailingSlash'](_0x2ad869[_0xcc0d('0x10')]);_0x2ad869[_0xcc0d('0x4d')]=intUtil['stripTrailingSlash'](_0x2ad869[_0xcc0d('0x4d')]);if(_0xe7aeb4&&_0xe7aeb4[_0xcc0d('0x4e')]){logger[_0xcc0d('0xc')](_0xcc0d('0x4f'),_0xcc0d('0x50'));_0x5d6630['recordingURL']=util['format'](_0xcc0d('0x51'),_0x2ad869[_0xcc0d('0x4d')],_0x5d6630[_0xcc0d('0x52')],md5(_0x5d6630[_0xcc0d('0x52')]));}else{_0x5d6630[_0xcc0d('0x53')]='';}headers[_0xcc0d('0x54')]=getAuth(_0x2ad869);return getUser(_0x2ad869,_0x362b9c[_0xcc0d('0x55')])[_0xcc0d('0x16')](function(_0x3a28ca){_0x5c3294=_0x3a28ca;logger[_0xcc0d('0xc')]('The\x20User\x20ID\x20is:',_0x5c3294['id']);return getEndUser(_0x2ad869,_0x5d6630['calleridname'],_0x5d6630[_0xcc0d('0x56')]);})[_0xcc0d('0x16')](function(_0x38ab94){_0x262f42=_0x38ab94;logger[_0xcc0d('0xc')]('The\x20Enduser\x20ID\x20is:',_0x262f42['id']);return getTicket(_0x2ad869,_0x5c3294,_0x262f42,_0x754933,_0x5d6630);})[_0xcc0d('0x16')](function(_0x1c3eee){if(_0x1c3eee){logger[_0xcc0d('0xc')](_0xcc0d('0x57'),_0x1c3eee['id']);switch(_0x2ad869[_0xcc0d('0x40')]){case _0xcc0d('0x58'):logger[_0xcc0d('0xc')](_0xcc0d('0x4f'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xcc0d('0xe')](_0xcc0d('0x59'),_0x2ad869[_0xcc0d('0x10')],_0x5c3294['id'],_0x1c3eee['id']),'method':_0xcc0d('0x11')});case _0xcc0d('0x5a'):logger[_0xcc0d('0xc')](_0xcc0d('0x4f'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xcc0d('0xe')]('user:%s',_0x362b9c[_0xcc0d('0x4b')]),_0xcc0d('0x5b'),{'uri':util[_0xcc0d('0xe')](_0xcc0d('0x5c'),_0x2ad869[_0xcc0d('0x10')][_0xcc0d('0x5d')](_0xcc0d('0x5e'),''),_0x1c3eee['id'])});break;default:logger['error'](_0xcc0d('0x4f'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x469ea6){logger[_0xcc0d('0x5f')](_0xcc0d('0x60'),util[_0xcc0d('0x61')](_0x469ea6,{'showHidden':!![],'depth':null}));});};exports[_0xcc0d('0x62')]=function(_0x32f438,_0x4251fd,_0x459049,_0x109692,_0x132d0f,_0x1f8fee,_0x2bb1cb){var _0x11587a,_0x20da39;_0x1f8fee[_0xcc0d('0x10')]=intUtil['stripTrailingSlash'](_0x1f8fee[_0xcc0d('0x10')]);_0x1f8fee['serverUrl']=intUtil[_0xcc0d('0x63')](_0x1f8fee['serverUrl']);if(_0x2bb1cb&&_0x2bb1cb[_0xcc0d('0x64')]&&_0x2bb1cb['recordingFormat']!=='none'){logger[_0xcc0d('0xc')](_0xcc0d('0x65'),_0xcc0d('0x50'));_0x4251fd['recordingURL']=util['format'](_0xcc0d('0x51'),_0x1f8fee[_0xcc0d('0x4d')],_0x4251fd['uniqueid'],md5(_0x4251fd[_0xcc0d('0x52')]));}headers['Authorization']=getAuth(_0x1f8fee);return getUser(_0x1f8fee,_0x109692['email'])['then'](function(_0xdccdd6){_0x11587a=_0xdccdd6;logger[_0xcc0d('0xc')](_0xcc0d('0x66'),_0x11587a['id']);return getEndUser(_0x1f8fee,_0x4251fd[_0xcc0d('0x67')],_0x4251fd[_0xcc0d('0x68')]);})['then'](function(_0x882ce0){_0x20da39=_0x882ce0;logger[_0xcc0d('0xc')](_0xcc0d('0x69'),_0x20da39['id']);return getTicket(_0x1f8fee,_0x11587a,_0x20da39,_0x459049,_0x4251fd);})['then'](function(_0x21273d){if(_0x21273d){logger['info'](_0xcc0d('0x57'),_0x21273d['id']);switch(_0x1f8fee[_0xcc0d('0x40')]){case _0xcc0d('0x58'):logger['info'](_0xcc0d('0x65'),_0xcc0d('0x6a'));return request({'uri':util[_0xcc0d('0xe')](_0xcc0d('0x59'),_0x1f8fee[_0xcc0d('0x10')],_0x11587a['id'],_0x21273d['id']),'method':_0xcc0d('0x11')});case _0xcc0d('0x5a'):logger[_0xcc0d('0xc')]('[OUTBOUND]',_0xcc0d('0x6b'));emit(util[_0xcc0d('0xe')](_0xcc0d('0x6c'),_0x109692[_0xcc0d('0x4b')]),'trigger:browser:url',{'uri':util[_0xcc0d('0xe')]('%s/agent/tickets/%s',_0x1f8fee[_0xcc0d('0x10')][_0xcc0d('0x5d')]('/api/v2',''),_0x21273d['id'])});break;default:logger['error']('[OUTBOUND]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xcc0d('0x6d')](function(_0x258947){logger['error'](_0xcc0d('0x6e'),util[_0xcc0d('0x61')](_0x258947,{'showHidden':!![],'depth':null}));});};exports[_0xcc0d('0x6f')]=function(_0x20b4c5,_0x4d5f68,_0x32d558,_0x7ebc63,_0x10af3d,_0x3198e5){var _0x44ccd3,_0x2c7414;_0x3198e5['remoteUri']=intUtil[_0xcc0d('0x63')](_0x3198e5[_0xcc0d('0x10')]);_0x3198e5[_0xcc0d('0x4d')]=intUtil[_0xcc0d('0x63')](_0x3198e5[_0xcc0d('0x4d')]);if(_0x10af3d&&_0x10af3d[_0xcc0d('0x4e')]){logger[_0xcc0d('0xc')]('['+_0x4d5f68['lastevent'][_0xcc0d('0x70')]()+']',_0xcc0d('0x50'));_0x4d5f68[_0xcc0d('0x53')]=util[_0xcc0d('0xe')](_0xcc0d('0x51'),_0x3198e5[_0xcc0d('0x4d')],_0x4d5f68[_0xcc0d('0x52')],md5(_0x4d5f68['uniqueid']));}else{_0x4d5f68[_0xcc0d('0x53')]='';}headers[_0xcc0d('0x54')]=getAuth(_0x3198e5);return getUser(_0x3198e5)[_0xcc0d('0x16')](function(_0x44b802){_0x44ccd3=_0x44b802;logger[_0xcc0d('0xc')]('The\x20User\x20ID\x20is:',_0x44ccd3['id']);return getEndUser(_0x3198e5,_0x4d5f68[_0xcc0d('0x71')],_0x4d5f68[_0xcc0d('0x56')]);})['then'](function(_0x3dc9de){_0x2c7414=_0x3dc9de;logger[_0xcc0d('0xc')](_0xcc0d('0x69'),_0x2c7414['id']);return getTicket(_0x3198e5,_0x44ccd3,_0x2c7414,_0x32d558,_0x4d5f68);})[_0xcc0d('0x16')](function(_0x882f5){if(_0x882f5){logger[_0xcc0d('0xc')](_0xcc0d('0x57'),_0x882f5['id']);}})[_0xcc0d('0x6d')](function(_0x399ce7){logger[_0xcc0d('0x5f')]('['+_0x4d5f68['lastevent']['toUpperCase']()+']'+_0xcc0d('0x72'),util[_0xcc0d('0x61')](_0x399ce7,{'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 b90aa9d..301930b 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 _0xefd6=['variable','variableName','customVariable','Variable','name','split','isNil','access_token','isBefore','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','refresh_token','then','add','seconds','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','error','The\x20failing\x20result\x20is','catch','data','enduserType','POST','https://www.zohoapis.','/crm/v2/','moduleCreate','first_name','last_name','Zoho-oauthtoken\x20','details','startCase','Error:\x20','log','CREATE\x20ERROR','moduleSearch','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','Leads','nothing','contact','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Creating\x20new\x20call...','Owner','role','administrator','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','format','answertime','endtime','diff','starttime','YYYY-MM-DDTHH:mm:ss','mm:ss','called','Call_Result','Called','connect','Answered','rejected','Rejected','abandoned','timeout','Timeout','Call_Start_Time','agentcalledAt','Call_Type','Inbound','Fields','/crm/v2/Calls','code','SUCCESS','err','queue','host','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','/downloads?type=uniqueid&token=','uniqueid','zoho.eu','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','/api/voice/recordings/','com','destcalleridname','destcalleridnum','Outbound','unmanaged','monitor_format','lastevent','toUpperCase','lodash','request-promise','md5','util','./util','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','socket.io-emitter','emit','[HTTP]','stringify','length','forEach','includes','string','picklist','type','idField','content','toString'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0xefd6,0x126));var _0x6efd=function(_0xd2fa07,_0x571735){_0xd2fa07=_0xd2fa07-0x0;var _0x3f4854=_0xefd6[_0xd2fa07];return _0x3f4854;};'use strict';var _=require(_0x6efd('0x0'));var rp=require(_0x6efd('0x1'));var md5=require(_0x6efd('0x2'));var util=require(_0x6efd('0x3'));var intUtil=require(_0x6efd('0x4'));var moment=require('moment');var Redis=require(_0x6efd('0x5'));var BPromise=require(_0x6efd('0x6'));var config=require(_0x6efd('0x7'));var logger=require(_0x6efd('0x8'))(_0x6efd('0x9'));config['redis']=_['defaults'](config[_0x6efd('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x6efd('0xb'))(new Redis(config[_0x6efd('0xa')]));function emit(_0x2d4a83,_0x6ccd14,_0x2b5704){io['to'](_0x2d4a83)[_0x6efd('0xc')](_0x6ccd14,_0x2b5704);}function request(_0x462a6c){logger['debug'](_0x6efd('0xd'),JSON[_0x6efd('0xe')](_0x462a6c));return rp(_0x462a6c);}function getCustomFields(_0x1cd95e,_0x347d5b){var _0x1324fe={};if(_0x1cd95e[_0x6efd('0xf')]>0x0){_[_0x6efd('0x10')](_0x1cd95e,function(_0x26d6ee){if(_[_0x6efd('0x11')]([_0x6efd('0x12'),_0x6efd('0x13')],_0x26d6ee[_0x6efd('0x14')])&&_0x26d6ee[_0x6efd('0x15')]){_0x1324fe[_0x26d6ee[_0x6efd('0x15')]]=_0x26d6ee[_0x6efd('0x16')][_0x6efd('0x17')]();}else if(_0x26d6ee[_0x6efd('0x14')]===_0x6efd('0x18')&&_0x26d6ee['variableName']&&_0x26d6ee['idField']&&_0x347d5b[_0x26d6ee['variableName']]){_0x1324fe[_0x26d6ee['idField']]=_0x347d5b[_0x26d6ee[_0x6efd('0x19')]][_0x6efd('0x17')]();}else if(_0x26d6ee[_0x6efd('0x14')]===_0x6efd('0x1a')&&_0x26d6ee[_0x6efd('0x1b')]&&_0x26d6ee[_0x6efd('0x1b')][_0x6efd('0x1c')]&&_0x26d6ee[_0x6efd('0x15')]&&_0x347d5b[_0x26d6ee[_0x6efd('0x1b')][_0x6efd('0x1c')]['toLowerCase']()]){_0x1324fe[_0x26d6ee[_0x6efd('0x15')]]=_0x347d5b[_0x26d6ee[_0x6efd('0x1b')]['name']['toLowerCase']()][_0x6efd('0x17')]();}});}return _0x1324fe;}function getName(_0x1627f3){if(_0x1627f3['indexOf']('\x20')>0x0){var _0x118197=_0x1627f3[_0x6efd('0x1d')](/ (.+)/);if(_0x118197[0x1]){return _0x118197;}}return[_0x1627f3,_0x1627f3];}var accountsTokens={};function getAccessToken(_0x4fac36){return new Promise(function(_0x1dd035,_0x2ce10b){if(!_[_0x6efd('0x1e')](accountsTokens[_0x4fac36['id']])&&!_[_0x6efd('0x1e')](accountsTokens[_0x4fac36['id']][_0x6efd('0x1f')])){if(moment()[_0x6efd('0x20')](accountsTokens[_0x4fac36['id']]['expires_in'])){_0x1dd035(accountsTokens[_0x4fac36['id']][_0x6efd('0x1f')]);}}var _0x4537d7;switch(_0x4fac36[_0x6efd('0x21')]){case'US':_0x4537d7=_0x6efd('0x22');break;case'AU':_0x4537d7=_0x6efd('0x23');break;case'EU':_0x4537d7=_0x6efd('0x24');break;case'IN':_0x4537d7='https://accounts.zoho.in';break;case'CN':_0x4537d7=_0x6efd('0x25');break;default:_0x4537d7='https://accounts.zoho.eu';break;}var _0x29718c={'method':'POST','uri':_0x4537d7+_0x6efd('0x26'),'qs':{'refresh_token':_0x4fac36[_0x6efd('0x27')],'client_id':_0x4fac36[_0x6efd('0x28')],'client_secret':_0x4fac36['clientSecret'],'grant_type':_0x6efd('0x29')},'json':!![]};return rp(_0x29718c)[_0x6efd('0x2a')](function(_0x3f2fa6){accountsTokens[_0x4fac36['id']]={'access_token':_0x3f2fa6['access_token'],'expires_in':moment()[_0x6efd('0x2b')](_0x3f2fa6['expires_in'],_0x6efd('0x2c'))};_0x1dd035(_0x3f2fa6[_0x6efd('0x1f')]);})['catch'](function(_0x5a0bba){logger['error'](_0x6efd('0x2d'),_0x5a0bba[_0x6efd('0x2e')]);_0x2ce10b(_0x5a0bba);});});}function getUser(_0x5929a9,_0x36406f,_0x5064b3,_0xa934ef){logger[_0x6efd('0x2f')](_0x6efd('0x30'));return request({'method':_0x6efd('0x31'),'uri':util['format'](_0x6efd('0x32'),_0x36406f),'qs':{'type':_0x6efd('0x33')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x5929a9},'json':!![]})[_0x6efd('0x2a')](function(_0x353146){if(_0x353146[_0x6efd('0x34')]){var _0x529072=-0x1;if(_[_0x6efd('0x35')](_0x353146[_0x6efd('0x34')])){if(!_[_0x6efd('0x1e')](_0xa934ef)){_0x529072=_[_0x6efd('0x36')](_0x353146['users'],function(_0x339a42){return _0x339a42[_0x6efd('0x37')]===_0xa934ef;});}if(_0x529072>=0x0){logger[_0x6efd('0x2f')](_0x6efd('0x38'));}else{logger[_0x6efd('0x2f')](_0x6efd('0x39'));_0x529072=_[_0x6efd('0x36')](_0x353146[_0x6efd('0x34')],function(_0x7ce4ae){return _0x7ce4ae[_0x6efd('0x3a')]['name']===_0x6efd('0x3b');});}return _0x353146[_0x6efd('0x34')][_0x529072];}else{if(_0x353146['user']['profile'][_0x6efd('0x1c')]==='Administrator'){logger[_0x6efd('0x2f')]('Using\x20the\x20admin\x20account!');user=_0x353146[_0x6efd('0x3c')];return user;}else{logger[_0x6efd('0x3d')](_0x6efd('0x3e'),JSON[_0x6efd('0xe')](_0x353146));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x6efd('0xe')](_0x353146));}}}else{logger[_0x6efd('0x3d')](_0x6efd('0x3e'),JSON[_0x6efd('0xe')](_0x353146));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x6efd('0xe')](_0x353146));}})[_0x6efd('0x3f')](function(_0x436097){console['error'](_0x436097);});}function getZohoUser(_0x3c2853,_0x4152be){return new BPromise(function(_0x20890a,_0x47d784){request(_0x3c2853)[_0x6efd('0x2a')](function(_0x4a1d83){var _0x1a0e73=null;if(_0x4a1d83){_0x1a0e73=_0x4a1d83[_0x6efd('0x40')][0x0];_0x1a0e73[_0x6efd('0x41')]=_0x4152be;}_0x20890a(_0x1a0e73);})[_0x6efd('0x3f')](function(_0xb809b7){_0x47d784(_0xb809b7);});});}function createEndUser(_0x35aaf0,_0x159adb,_0x36e7e9,_0x2c0dea,_0x239a94,_0x568507){var _0x36e7e9=getName(_0x36e7e9);return request({'method':_0x6efd('0x42'),'uri':_0x6efd('0x43')+_0x159adb+_0x6efd('0x44')+_['startCase'](_0x568507[_0x6efd('0x45')])+'s','body':{'data':[{'Last_Name':_0x36e7e9[0x1],'First_Name':_0x36e7e9[0x0],'Phone':_0x2c0dea,'Owner':{'name':!_[_0x6efd('0x1e')](_0x239a94['role'][_0x6efd('0x1c')])?_0x239a94['role']['name']:!_[_0x6efd('0x1e')](_0x239a94[_0x6efd('0x46')])?_0x239a94['first_name']+'\x20'+_0x239a94[_0x6efd('0x47')]:_0x239a94['last_name'],'id':_0x239a94['id']}}]},'headers':{'Authorization':_0x6efd('0x48')+_0x35aaf0},'json':!![]})['then'](function(_0x473bda){if(_0x473bda&&_0x473bda[_0x6efd('0x40')][0x0]['code']==='SUCCESS'){var _0x3b6508=_0x473bda['data'][0x0][_0x6efd('0x49')];_0x3b6508[_0x6efd('0x41')]=_[_0x6efd('0x4a')](_0x568507[_0x6efd('0x45')])+'s';return _0x3b6508;}logger[_0x6efd('0x3d')](_0x6efd('0x3e'),JSON[_0x6efd('0xe')](data));throw new Error(_0x6efd('0x4b')+JSON[_0x6efd('0xe')](data));})[_0x6efd('0x3f')](function(_0x578d35){console[_0x6efd('0x4c')](_0x6efd('0x4d'),_0x578d35);});}function getEndUser(_0x19e4ef,_0x28c28d,_0x6db6e6,_0x502caf,_0x126983,_0x1bc59c,_0xe78ac1){var _0x26d051={'method':_0x6efd('0x31'),'uri':'','headers':{'Authorization':_0x6efd('0x48')+_0x19e4ef},'json':!![]};switch(_0xe78ac1[_0x6efd('0x4e')]){case'contact_lead':_0x26d051['uri']=_0x6efd('0x43')+_0x28c28d+_0x6efd('0x4f')+_0x126983+'))';return getZohoUser(_0x26d051,_0x6efd('0x50'))[_0x6efd('0x2a')](function(_0x4a9af0){if(_0x4a9af0)return _0x4a9af0;_0x26d051['uri']=_0x6efd('0x43')+_0x28c28d+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x126983+'))';return getZohoUser(_0x26d051,_0x6efd('0x51'))[_0x6efd('0x2a')](function(_0x4b93a4){if(_0x4b93a4)return _0x4b93a4;if(_0xe78ac1[_0x6efd('0x45')]!=_0x6efd('0x52')){return createEndUser(_0x19e4ef,_0x28c28d,_0x502caf,_0x126983,_0x1bc59c,_0xe78ac1);}else{return{};}});});break;case _0x6efd('0x53'):_0x26d051['uri']=_0x6efd('0x43')+_0x28c28d+_0x6efd('0x4f')+_0x126983+'))';return getZohoUser(_0x26d051,_0x6efd('0x50'))['then'](function(_0x3bc8d9){if(_0x3bc8d9)return _0x3bc8d9;if(_0xe78ac1[_0x6efd('0x45')]!='nothing'){return createEndUser(_0x19e4ef,_0x28c28d,_0x502caf,_0x126983,_0x1bc59c,_0xe78ac1);}else{return{};}});break;case _0x6efd('0x54'):_0x26d051['uri']=_0x6efd('0x43')+_0x28c28d+_0x6efd('0x55')+_0x126983+'))';return getZohoUser(_0x26d051,_0x6efd('0x51'))[_0x6efd('0x2a')](function(_0x104a28){if(_0x104a28)return _0x104a28;if(_0xe78ac1[_0x6efd('0x45')]!=_0x6efd('0x52')){return createEndUser(_0x19e4ef,_0x28c28d,_0x502caf,_0x126983,_0x1bc59c,_0xe78ac1);}else{return{};}});break;}}function getCall(_0x4a1a25,_0x391209,_0xd1d0e3,_0x268fd8,_0x2dfb0b,_0x3892f6,_0x9dd541,_0x136958){logger[_0x6efd('0x2f')](_0x6efd('0x56'));var _0x472274={};_0x472274[_0x6efd('0x57')]={'name':!_[_0x6efd('0x1e')](_0x268fd8[_0x6efd('0x58')][_0x6efd('0x1c')])&&!_[_0x6efd('0x1e')](_0x268fd8['profile'][_0x6efd('0x1c')])&&_0x268fd8[_0x6efd('0x3a')][_0x6efd('0x1c')]===_0x6efd('0x59')?_0x268fd8[_0x6efd('0x58')][_0x6efd('0x1c')]:!_[_0x6efd('0x1e')](_0x268fd8[_0x6efd('0x46')])?_0x268fd8['first_name']+'\x20'+_0x268fd8[_0x6efd('0x47')]:_0x268fd8[_0x6efd('0x47')],'id':_0x268fd8['id']};_0x472274['Subject']=intUtil[_0x6efd('0x5a')](_0x3892f6[_0x6efd('0x5b')],_0x9dd541,'\x20');_0x472274[_0x6efd('0x5c')]=intUtil[_0x6efd('0x5a')](_0x3892f6[_0x6efd('0x5d')],_0x9dd541,'\x0a');if(_0x2dfb0b['enduserType']==='Contacts'){_0x472274[_0x6efd('0x5e')]={'name':!_[_0x6efd('0x1e')](_0x2dfb0b[_0x6efd('0x5f')])?_0x2dfb0b['Full_Name']:!_[_0x6efd('0x1e')](_0x2dfb0b[_0x6efd('0x60')])?_0x2dfb0b['First_Name']+'\x20'+_0x2dfb0b['Last_Name']:_0x2dfb0b[_0x6efd('0x61')],'id':_0x2dfb0b['id']};}if(_0x2dfb0b[_0x6efd('0x41')]===_0x6efd('0x51')){_0x472274[_0x6efd('0x62')]={'name':!_[_0x6efd('0x1e')](_0x2dfb0b[_0x6efd('0x5f')])?_0x2dfb0b[_0x6efd('0x5f')]:!_['isNil'](_0x2dfb0b[_0x6efd('0x60')])?_0x2dfb0b['First_Name']+'\x20'+_0x2dfb0b[_0x6efd('0x61')]:_0x2dfb0b['Last_Name'],'id':_0x2dfb0b['id']};_0x472274[_0x6efd('0x63')]=_[_0x6efd('0x4a')](_0x2dfb0b[_0x6efd('0x41')]);}if(_0x9dd541[_0x6efd('0x64')]){_0x472274[_0x6efd('0x65')]=moment[_0x6efd('0x66')](parseInt(_0x9dd541['talktime'])*0x3e8)[_0x6efd('0x67')]('mm:ss');}else if(_0x9dd541[_0x6efd('0x68')]&&_0x9dd541[_0x6efd('0x69')]){_0x472274[_0x6efd('0x65')]=moment[_0x6efd('0x66')](moment(_0x9dd541[_0x6efd('0x69')],'YYYY-MM-DDTHH:mm:ss')[_0x6efd('0x6a')](moment(_0x9dd541[_0x6efd('0x6b')],_0x6efd('0x6c'))))['format'](_0x6efd('0x6d'));}switch(_0x9dd541['lastevent']){case _0x6efd('0x6e'):_0x472274[_0x6efd('0x6f')]=_0x6efd('0x70');break;case'complete':case _0x6efd('0x71'):_0x472274[_0x6efd('0x6f')]=_0x6efd('0x72');break;case _0x6efd('0x73'):_0x472274[_0x6efd('0x6f')]=_0x6efd('0x74');break;case _0x6efd('0x75'):_0x472274[_0x6efd('0x6f')]='Abandoned';break;case _0x6efd('0x76'):_0x472274['Call_Result']=_0x6efd('0x77');default:}_0x472274[_0x6efd('0x78')]=(_0x136958==='outbound'?moment(_0x9dd541[_0x6efd('0x6b')])[_0x6efd('0x67')](_0x6efd('0x6c')):moment(_0x9dd541[_0x6efd('0x79')])['format']('YYYY-MM-DDTHH:mm:ss'))||moment()['format'](_0x6efd('0x6c'));_0x472274[_0x6efd('0x7a')]=_0x136958||_0x6efd('0x7b');_0x472274=_['merge'](_0x472274,getCustomFields(_0x3892f6[_0x6efd('0x7c')],_0x9dd541));return request({'method':_0x6efd('0x42'),'uri':'https://www.zohoapis.'+_0x391209+_0x6efd('0x7d'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4a1a25},'body':{'data':[_0x472274]},'json':!![]})[_0x6efd('0x2a')](function(_0x1b093){if(_0x1b093&&_0x1b093[_0x6efd('0x40')][0x0][_0x6efd('0x7e')]===_0x6efd('0x7f')){logger['info']('Call\x20created!');return{'id':_0x1b093['data'][0x0][_0x6efd('0x49')]['id']};}})[_0x6efd('0x3f')](function(_0x22476b){logger[_0x6efd('0x2f')](_0x6efd('0x80'),_0x22476b[_0x6efd('0x2e')]);console[_0x6efd('0x4c')](_0x6efd('0x80'),_0x22476b);});}exports[_0x6efd('0x81')]=function(_0x276fa4,_0x191d32,_0xf4fd41,_0x58f601,_0x2d5906,_0x45cb7c){var _0x4512ae,_0x12c6ae,_0x6d8106;_0x45cb7c[_0x6efd('0x82')]=intUtil[_0x6efd('0x83')](_0x45cb7c[_0x6efd('0x82')]);_0x45cb7c[_0x6efd('0x84')]=intUtil[_0x6efd('0x83')](_0x45cb7c['serverUrl']);if(_0x2d5906&&_0x2d5906['monitor_format']){logger[_0x6efd('0x2f')](_0x6efd('0x85'),'Recording\x20is\x20enabled!');_0x191d32[_0x6efd('0x86')]=_0x45cb7c[_0x6efd('0x84')]+'/api/voice/recordings/'+_0x191d32['uniqueid']+_0x6efd('0x87')+md5(_0x191d32[_0x6efd('0x88')]);}else{_0x191d32[_0x6efd('0x86')]='';}var _0x10f7c0=_0x45cb7c['host']===_0x6efd('0x89')?'eu':'com';return getAccessToken(_0x45cb7c)['then'](function(_0x951356){_0x6d8106=_0x951356;return getUser(_0x6d8106,_0x10f7c0,_0x45cb7c,_0x58f601[_0x6efd('0x37')]);})[_0x6efd('0x2a')](function(_0x3132f2){_0x4512ae=_0x3132f2;logger['info'](_0x6efd('0x8a'),_0x4512ae['id']);return getEndUser(_0x6d8106,_0x10f7c0,_0x45cb7c,_0x191d32[_0x6efd('0x8b')],_0x191d32[_0x6efd('0x8c')],_0x4512ae,_0xf4fd41);})[_0x6efd('0x2a')](function(_0x2c5bf2){_0x12c6ae=_0x2c5bf2;return getCall(_0x6d8106,_0x10f7c0,_0x45cb7c,_0x4512ae,_0x12c6ae,_0xf4fd41,_0x191d32,_0x6efd('0x7b'));})[_0x6efd('0x2a')](function(_0x768e4e){if(_0x768e4e){logger[_0x6efd('0x2f')](_0x6efd('0x8d'),_0x768e4e['id']);logger[_0x6efd('0x2f')](_0x6efd('0x85'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x6efd('0x67')](_0x6efd('0x8e'),_0x58f601[_0x6efd('0x1c')]),_0x6efd('0x8f'),{'uri':_0x6efd('0x90')+_0x45cb7c[_0x6efd('0x82')]+_0x6efd('0x91')+_0x768e4e['id']});}})[_0x6efd('0x3f')](function(_0x4ccc3a){logger[_0x6efd('0x3d')](_0x6efd('0x85'),JSON[_0x6efd('0xe')](_0x4ccc3a));});};exports['outbound']=function(_0x5c3dd5,_0x559aa0,_0x33335c,_0x4d3242,_0x5a8989,_0x1e85b4,_0x3d46b3){var _0x3f5f9f,_0x410c0b,_0x12271a;_0x1e85b4[_0x6efd('0x82')]=intUtil[_0x6efd('0x83')](_0x1e85b4[_0x6efd('0x82')]);_0x1e85b4[_0x6efd('0x84')]=intUtil[_0x6efd('0x83')](_0x1e85b4[_0x6efd('0x84')]);if(_0x3d46b3&&_0x3d46b3[_0x6efd('0x92')]&&_0x3d46b3[_0x6efd('0x92')]!==_0x6efd('0x93')){logger[_0x6efd('0x2f')](_0x6efd('0x94'),_0x6efd('0x95'));_0x559aa0[_0x6efd('0x86')]=_0x1e85b4['serverUrl']+_0x6efd('0x96')+_0x559aa0[_0x6efd('0x88')]+'/downloads?type=uniqueid&token='+md5(_0x559aa0[_0x6efd('0x88')]);}var _0x29b35f=_0x1e85b4[_0x6efd('0x82')]===_0x6efd('0x89')?'eu':_0x6efd('0x97');return getAccessToken(_0x1e85b4)['then'](function(_0x13a17f){_0x12271a=_0x13a17f;return getUser(_0x12271a,_0x29b35f,_0x1e85b4,_0x4d3242['email']);})['then'](function(_0x11d3ce){_0x3f5f9f=_0x11d3ce;logger[_0x6efd('0x2f')](_0x6efd('0x8a'),_0x3f5f9f['id']);return getEndUser(_0x12271a,_0x29b35f,_0x1e85b4,_0x559aa0[_0x6efd('0x98')],_0x559aa0[_0x6efd('0x99')],_0x3f5f9f,_0x33335c);})['then'](function(_0x310f55){_0x410c0b=_0x310f55;return getCall(_0x12271a,_0x29b35f,_0x1e85b4,_0x3f5f9f,_0x410c0b,_0x33335c,_0x559aa0,_0x6efd('0x9a'));})[_0x6efd('0x2a')](function(_0x3104b3){if(_0x3104b3){logger['info'](_0x6efd('0x8d'),_0x3104b3['id']);logger[_0x6efd('0x2f')](_0x6efd('0x94'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x6efd('0x67')]('user:%s',_0x4d3242[_0x6efd('0x1c')]),_0x6efd('0x8f'),{'uri':_0x6efd('0x90')+_0x1e85b4[_0x6efd('0x82')]+_0x6efd('0x91')+_0x3104b3['id']});}})[_0x6efd('0x3f')](function(_0x430fe0){logger[_0x6efd('0x3d')](_0x6efd('0x94'),JSON[_0x6efd('0xe')](_0x430fe0));});};exports[_0x6efd('0x9b')]=function(_0x3961f0,_0x3bebdb,_0xe16683,_0x506a62,_0x1ee898,_0x1cc8ab){var _0xd7bb43,_0x358ea7,_0x1465d4;_0x1cc8ab[_0x6efd('0x82')]=intUtil['stripTrailingSlash'](_0x1cc8ab['host']);_0x1cc8ab[_0x6efd('0x84')]=intUtil[_0x6efd('0x83')](_0x1cc8ab[_0x6efd('0x84')]);if(_0x1ee898&&_0x1ee898[_0x6efd('0x9c')]){logger[_0x6efd('0x2f')]('['+_0x3bebdb[_0x6efd('0x9d')][_0x6efd('0x9e')]()+']',_0x6efd('0x95'));_0x3bebdb[_0x6efd('0x86')]=_0x1cc8ab['serverUrl']+_0x6efd('0x96')+_0x3bebdb['uniqueid']+_0x6efd('0x87')+md5(_0x3bebdb[_0x6efd('0x88')]);}else{_0x3bebdb[_0x6efd('0x86')]='';}var _0x37fc8c=_0x1cc8ab[_0x6efd('0x82')]==='zoho.eu'?'eu':_0x6efd('0x97');return getAccessToken(_0x1cc8ab)[_0x6efd('0x2a')](function(_0x4ca7d2){_0x1465d4=_0x4ca7d2;return getUser(_0x1465d4,_0x37fc8c,_0x1cc8ab);})[_0x6efd('0x2a')](function(_0x1550a1){_0xd7bb43=_0x1550a1;logger[_0x6efd('0x2f')](_0x6efd('0x8a'),_0xd7bb43['id']);return getEndUser(_0x1465d4,_0x37fc8c,_0x1cc8ab,_0x3bebdb[_0x6efd('0x8b')],_0x3bebdb[_0x6efd('0x8c')],_0xd7bb43,_0xe16683);})[_0x6efd('0x2a')](function(_0x4517d8){_0x358ea7=_0x4517d8;return getCall(_0x1465d4,_0x37fc8c,_0x1cc8ab,_0xd7bb43,_0x358ea7,_0xe16683,_0x3bebdb,_0x6efd('0x7b'));})[_0x6efd('0x2a')](function(_0x127dac){if(_0x127dac){logger[_0x6efd('0x2f')](_0x6efd('0x8d'),_0x127dac['id']);}})[_0x6efd('0x3f')](function(_0x595d6a){logger['error']('['+_0x3bebdb['lastevent'][_0x6efd('0x9e')]()+']',JSON['stringify'](_0x595d6a));});}; \ No newline at end of file +var _0x07b9=['recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','com','destcalleridname','destcalleridnum','Outbound','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','moment','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','socket.io-emitter','debug','[HTTP]','stringify','length','forEach','string','idField','content','toString','type','variable','variableName','customVariable','Variable','toLowerCase','name','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','refresh_token','add','catch','error','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','GET','format','ActiveUsers','then','users','isArrayLikeObject','findIndex','email','Agent\x20found!','profile','Administrator','user','info','Using\x20the\x20admin\x20account!','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','code','startCase','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','contact','lead','Creating\x20new\x20call...','administrator','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','Leads','What_Id','talktime','Call_Duration','utc','mm:ss','endtime','diff','starttime','YYYY-MM-DDTHH:mm:ss','called','Call_Result','complete','Answered','Rejected','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','SUCCESS','Call\x20created!','details','queue','stripTrailingSlash','host','serverUrl','[QUEUE]','/api/voice/recordings/','uniqueid','recordingURL','zoho.eu','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id='];(function(_0x1fb1c1,_0x4ebe69){var _0x1622df=function(_0x52b793){while(--_0x52b793){_0x1fb1c1['push'](_0x1fb1c1['shift']());}};_0x1622df(++_0x4ebe69);}(_0x07b9,0x143));var _0x907b=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0x07b9[_0x42bc91];return _0x3f5507;};'use strict';var _=require(_0x907b('0x0'));var rp=require(_0x907b('0x1'));var md5=require(_0x907b('0x2'));var util=require(_0x907b('0x3'));var intUtil=require('./util');var moment=require(_0x907b('0x4'));var Redis=require('ioredis');var BPromise=require(_0x907b('0x5'));var config=require(_0x907b('0x6'));var logger=require(_0x907b('0x7'))(_0x907b('0x8'));config[_0x907b('0x9')]=_[_0x907b('0xa')](config[_0x907b('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x907b('0xb'))(new Redis(config[_0x907b('0x9')]));function emit(_0x43c574,_0x1ff1ca,_0x5e0b45){io['to'](_0x43c574)['emit'](_0x1ff1ca,_0x5e0b45);}function request(_0x34767a){logger[_0x907b('0xc')](_0x907b('0xd'),JSON[_0x907b('0xe')](_0x34767a));return rp(_0x34767a);}function getCustomFields(_0x241430,_0xb0e6d){var _0x18437b={};if(_0x241430[_0x907b('0xf')]>0x0){_[_0x907b('0x10')](_0x241430,function(_0x1ef039){if(_['includes']([_0x907b('0x11'),'picklist'],_0x1ef039['type'])&&_0x1ef039[_0x907b('0x12')]){_0x18437b[_0x1ef039[_0x907b('0x12')]]=_0x1ef039[_0x907b('0x13')][_0x907b('0x14')]();}else if(_0x1ef039[_0x907b('0x15')]===_0x907b('0x16')&&_0x1ef039['variableName']&&_0x1ef039[_0x907b('0x12')]&&_0xb0e6d[_0x1ef039[_0x907b('0x17')]]){_0x18437b[_0x1ef039['idField']]=_0xb0e6d[_0x1ef039['variableName']][_0x907b('0x14')]();}else if(_0x1ef039[_0x907b('0x15')]===_0x907b('0x18')&&_0x1ef039[_0x907b('0x19')]&&_0x1ef039[_0x907b('0x19')]['name']&&_0x1ef039[_0x907b('0x12')]&&_0xb0e6d[_0x1ef039[_0x907b('0x19')]['name'][_0x907b('0x1a')]()]){_0x18437b[_0x1ef039[_0x907b('0x12')]]=_0xb0e6d[_0x1ef039[_0x907b('0x19')][_0x907b('0x1b')][_0x907b('0x1a')]()][_0x907b('0x14')]();}});}return _0x18437b;}function getName(_0xf2acff){if(_0xf2acff[_0x907b('0x1c')]('\x20')>0x0){var _0x11fdab=_0xf2acff[_0x907b('0x1d')](/ (.+)/);if(_0x11fdab[0x1]){return _0x11fdab;}}return[_0xf2acff,_0xf2acff];}var accountsTokens={};function getAccessToken(_0x34db23){return new Promise(function(_0x3b5c6e,_0x3fe834){if(!_['isNil'](accountsTokens[_0x34db23['id']])&&!_[_0x907b('0x1e')](accountsTokens[_0x34db23['id']][_0x907b('0x1f')])){if(moment()[_0x907b('0x20')](accountsTokens[_0x34db23['id']][_0x907b('0x21')])){_0x3b5c6e(accountsTokens[_0x34db23['id']][_0x907b('0x1f')]);}}var _0x22fa2d;switch(_0x34db23[_0x907b('0x22')]){case'US':_0x22fa2d='https://accounts.zoho.com';break;case'AU':_0x22fa2d=_0x907b('0x23');break;case'EU':_0x22fa2d=_0x907b('0x24');break;case'IN':_0x22fa2d=_0x907b('0x25');break;case'CN':_0x22fa2d=_0x907b('0x26');break;default:_0x22fa2d=_0x907b('0x24');break;}var _0x1fdacc={'method':_0x907b('0x27'),'uri':_0x22fa2d+_0x907b('0x28'),'qs':{'refresh_token':_0x34db23[_0x907b('0x29')],'client_id':_0x34db23[_0x907b('0x2a')],'client_secret':_0x34db23['clientSecret'],'grant_type':_0x907b('0x2b')},'json':!![]};return rp(_0x1fdacc)['then'](function(_0x41017e){accountsTokens[_0x34db23['id']]={'access_token':_0x41017e[_0x907b('0x1f')],'expires_in':moment()[_0x907b('0x2c')](_0x41017e['expires_in'],'seconds')};_0x3b5c6e(_0x41017e[_0x907b('0x1f')]);})[_0x907b('0x2d')](function(_0x318239){logger[_0x907b('0x2e')](_0x907b('0x2f'),_0x318239[_0x907b('0x30')]);_0x3fe834(_0x318239);});});}function getUser(_0x100f98,_0x599099,_0x2b2b08,_0x270cfd){logger['info'](_0x907b('0x31'));return request({'method':_0x907b('0x32'),'uri':util[_0x907b('0x33')]('https://www.zohoapis.%s/crm/v2/users',_0x599099),'qs':{'type':_0x907b('0x34')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x100f98},'json':!![]})[_0x907b('0x35')](function(_0x346233){if(_0x346233[_0x907b('0x36')]){var _0x38a07d=-0x1;if(_[_0x907b('0x37')](_0x346233[_0x907b('0x36')])){if(!_[_0x907b('0x1e')](_0x270cfd)){_0x38a07d=_[_0x907b('0x38')](_0x346233[_0x907b('0x36')],function(_0xdbca52){return _0xdbca52[_0x907b('0x39')]===_0x270cfd;});}if(_0x38a07d>=0x0){logger['info'](_0x907b('0x3a'));}else{logger['info']('Using\x20the\x20admin\x20account!');_0x38a07d=_[_0x907b('0x38')](_0x346233['users'],function(_0x37c833){return _0x37c833[_0x907b('0x3b')][_0x907b('0x1b')]===_0x907b('0x3c');});}return _0x346233[_0x907b('0x36')][_0x38a07d];}else{if(_0x346233[_0x907b('0x3d')][_0x907b('0x3b')][_0x907b('0x1b')]===_0x907b('0x3c')){logger[_0x907b('0x3e')](_0x907b('0x3f'));user=_0x346233['user'];return user;}else{logger['error'](_0x907b('0x40'),JSON['stringify'](_0x346233));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x907b('0xe')](_0x346233));}}}else{logger['error'](_0x907b('0x40'),JSON[_0x907b('0xe')](_0x346233));throw new Error(_0x907b('0x41')+JSON[_0x907b('0xe')](_0x346233));}})[_0x907b('0x2d')](function(_0x15f89d){console['error'](_0x15f89d);});}function getZohoUser(_0x5c67ef,_0x345e92){return new BPromise(function(_0x2e7975,_0x1055b2){request(_0x5c67ef)[_0x907b('0x35')](function(_0xe52205){var _0x4e963f=null;if(_0xe52205){_0x4e963f=_0xe52205[_0x907b('0x42')][0x0];_0x4e963f[_0x907b('0x43')]=_0x345e92;}_0x2e7975(_0x4e963f);})['catch'](function(_0x27104f){_0x1055b2(_0x27104f);});});}function createEndUser(_0x648b6f,_0xeb4cef,_0x192c2c,_0x42799e,_0x52f536,_0x1525cb){var _0x192c2c=getName(_0x192c2c);return request({'method':_0x907b('0x27'),'uri':_0x907b('0x44')+_0xeb4cef+_0x907b('0x45')+_['startCase'](_0x1525cb[_0x907b('0x46')])+'s','body':{'data':[{'Last_Name':_0x192c2c[0x1],'First_Name':_0x192c2c[0x0],'Phone':_0x42799e,'Owner':{'name':!_[_0x907b('0x1e')](_0x52f536[_0x907b('0x47')]['name'])?_0x52f536[_0x907b('0x47')][_0x907b('0x1b')]:!_[_0x907b('0x1e')](_0x52f536[_0x907b('0x48')])?_0x52f536['first_name']+'\x20'+_0x52f536[_0x907b('0x49')]:_0x52f536[_0x907b('0x49')],'id':_0x52f536['id']}}]},'headers':{'Authorization':_0x907b('0x4a')+_0x648b6f},'json':!![]})[_0x907b('0x35')](function(_0x386b8a){if(_0x386b8a&&_0x386b8a[_0x907b('0x42')][0x0][_0x907b('0x4b')]==='SUCCESS'){var _0x5b55d3=_0x386b8a['data'][0x0]['details'];_0x5b55d3['enduserType']=_[_0x907b('0x4c')](_0x1525cb[_0x907b('0x46')])+'s';return _0x5b55d3;}logger[_0x907b('0x2e')]('The\x20failing\x20result\x20is',JSON['stringify'](data));throw new Error(_0x907b('0x4d')+JSON['stringify'](data));})['catch'](function(_0x53e653){console[_0x907b('0x4e')](_0x907b('0x4f'),_0x53e653);});}function getEndUser(_0x15cee2,_0x3003c,_0x551b2e,_0x4d549f,_0x3a8ff5,_0x4ef7c4,_0x49a35c){var _0x1cf274={'method':_0x907b('0x32'),'uri':'','headers':{'Authorization':_0x907b('0x4a')+_0x15cee2},'json':!![]};switch(_0x49a35c[_0x907b('0x50')]){case _0x907b('0x51'):_0x1cf274[_0x907b('0x52')]=_0x907b('0x44')+_0x3003c+_0x907b('0x53')+_0x3a8ff5+'))';return getZohoUser(_0x1cf274,_0x907b('0x54'))[_0x907b('0x35')](function(_0x560668){if(_0x560668)return _0x560668;_0x1cf274[_0x907b('0x52')]='https://www.zohoapis.'+_0x3003c+_0x907b('0x55')+_0x3a8ff5+'))';return getZohoUser(_0x1cf274,'Leads')[_0x907b('0x35')](function(_0x3bad4f){if(_0x3bad4f)return _0x3bad4f;if(_0x49a35c['moduleCreate']!=_0x907b('0x56')){return createEndUser(_0x15cee2,_0x3003c,_0x4d549f,_0x3a8ff5,_0x4ef7c4,_0x49a35c);}else{return{};}});});break;case _0x907b('0x57'):_0x1cf274['uri']=_0x907b('0x44')+_0x3003c+_0x907b('0x53')+_0x3a8ff5+'))';return getZohoUser(_0x1cf274,'Contacts')['then'](function(_0x284127){if(_0x284127)return _0x284127;if(_0x49a35c[_0x907b('0x46')]!=_0x907b('0x56')){return createEndUser(_0x15cee2,_0x3003c,_0x4d549f,_0x3a8ff5,_0x4ef7c4,_0x49a35c);}else{return{};}});break;case _0x907b('0x58'):_0x1cf274[_0x907b('0x52')]=_0x907b('0x44')+_0x3003c+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x3a8ff5+'))';return getZohoUser(_0x1cf274,'Leads')['then'](function(_0x387972){if(_0x387972)return _0x387972;if(_0x49a35c['moduleCreate']!=_0x907b('0x56')){return createEndUser(_0x15cee2,_0x3003c,_0x4d549f,_0x3a8ff5,_0x4ef7c4,_0x49a35c);}else{return{};}});break;}}function getCall(_0x2dbee8,_0x5e4de9,_0x3d8706,_0x54bca3,_0xc7b50a,_0x3f68d4,_0x2d4743,_0x1e6a07){logger[_0x907b('0x3e')](_0x907b('0x59'));var _0x4281c1={};_0x4281c1['Owner']={'name':!_[_0x907b('0x1e')](_0x54bca3[_0x907b('0x47')][_0x907b('0x1b')])&&!_[_0x907b('0x1e')](_0x54bca3[_0x907b('0x3b')][_0x907b('0x1b')])&&_0x54bca3[_0x907b('0x3b')][_0x907b('0x1b')]===_0x907b('0x5a')?_0x54bca3[_0x907b('0x47')]['name']:!_[_0x907b('0x1e')](_0x54bca3['first_name'])?_0x54bca3[_0x907b('0x48')]+'\x20'+_0x54bca3[_0x907b('0x49')]:_0x54bca3[_0x907b('0x49')],'id':_0x54bca3['id']};_0x4281c1['Subject']=intUtil[_0x907b('0x5b')](_0x3f68d4[_0x907b('0x5c')],_0x2d4743,'\x20');_0x4281c1[_0x907b('0x5d')]=intUtil[_0x907b('0x5b')](_0x3f68d4[_0x907b('0x5e')],_0x2d4743,'\x0a');if(_0xc7b50a[_0x907b('0x43')]==='Contacts'){_0x4281c1[_0x907b('0x5f')]={'name':!_[_0x907b('0x1e')](_0xc7b50a['Full_Name'])?_0xc7b50a[_0x907b('0x60')]:!_[_0x907b('0x1e')](_0xc7b50a[_0x907b('0x61')])?_0xc7b50a['First_Name']+'\x20'+_0xc7b50a[_0x907b('0x62')]:_0xc7b50a[_0x907b('0x62')],'id':_0xc7b50a['id']};}if(_0xc7b50a[_0x907b('0x43')]===_0x907b('0x63')){_0x4281c1[_0x907b('0x64')]={'name':!_[_0x907b('0x1e')](_0xc7b50a[_0x907b('0x60')])?_0xc7b50a[_0x907b('0x60')]:!_[_0x907b('0x1e')](_0xc7b50a['First_Name'])?_0xc7b50a[_0x907b('0x61')]+'\x20'+_0xc7b50a['Last_Name']:_0xc7b50a[_0x907b('0x62')],'id':_0xc7b50a['id']};_0x4281c1['$se_module']=_['startCase'](_0xc7b50a[_0x907b('0x43')]);}if(_0x2d4743[_0x907b('0x65')]){_0x4281c1[_0x907b('0x66')]=moment[_0x907b('0x67')](parseInt(_0x2d4743['talktime'])*0x3e8)[_0x907b('0x33')](_0x907b('0x68'));}else if(_0x2d4743['answertime']&&_0x2d4743[_0x907b('0x69')]){_0x4281c1[_0x907b('0x66')]=moment[_0x907b('0x67')](moment(_0x2d4743['endtime'],'YYYY-MM-DDTHH:mm:ss')[_0x907b('0x6a')](moment(_0x2d4743[_0x907b('0x6b')],_0x907b('0x6c'))))['format'](_0x907b('0x68'));}switch(_0x2d4743['lastevent']){case _0x907b('0x6d'):_0x4281c1[_0x907b('0x6e')]='Called';break;case _0x907b('0x6f'):case'connect':_0x4281c1[_0x907b('0x6e')]=_0x907b('0x70');break;case'rejected':_0x4281c1['Call_Result']=_0x907b('0x71');break;case'abandoned':_0x4281c1[_0x907b('0x6e')]=_0x907b('0x72');break;case _0x907b('0x73'):_0x4281c1[_0x907b('0x6e')]=_0x907b('0x74');default:}_0x4281c1[_0x907b('0x75')]=(_0x1e6a07===_0x907b('0x76')?moment(_0x2d4743[_0x907b('0x6b')])['format'](_0x907b('0x6c')):moment(_0x2d4743[_0x907b('0x77')])['format']('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x907b('0x33')](_0x907b('0x6c'));_0x4281c1[_0x907b('0x78')]=_0x1e6a07||_0x907b('0x79');_0x4281c1=_[_0x907b('0x7a')](_0x4281c1,getCustomFields(_0x3f68d4[_0x907b('0x7b')],_0x2d4743));return request({'method':_0x907b('0x27'),'uri':_0x907b('0x44')+_0x5e4de9+_0x907b('0x7c'),'headers':{'Authorization':_0x907b('0x4a')+_0x2dbee8},'body':{'data':[_0x4281c1]},'json':!![]})['then'](function(_0x568782){if(_0x568782&&_0x568782['data'][0x0][_0x907b('0x4b')]===_0x907b('0x7d')){logger['info'](_0x907b('0x7e'));return{'id':_0x568782[_0x907b('0x42')][0x0][_0x907b('0x7f')]['id']};}})['catch'](function(_0x15cd89){logger[_0x907b('0x3e')]('err',_0x15cd89[_0x907b('0x30')]);console[_0x907b('0x4e')]('err',_0x15cd89);});}exports[_0x907b('0x80')]=function(_0x235e1f,_0x3cf6fb,_0x589014,_0x299a47,_0x2daf38,_0x11c5c3){var _0x4d5ee5,_0x3be9eb,_0x4ac25e;_0x11c5c3['host']=intUtil[_0x907b('0x81')](_0x11c5c3[_0x907b('0x82')]);_0x11c5c3['serverUrl']=intUtil[_0x907b('0x81')](_0x11c5c3[_0x907b('0x83')]);if(_0x2daf38&&_0x2daf38['monitor_format']){logger['info'](_0x907b('0x84'),'Recording\x20is\x20enabled!');_0x3cf6fb['recordingURL']=_0x11c5c3['serverUrl']+_0x907b('0x85')+_0x3cf6fb[_0x907b('0x86')]+'/downloads?type=uniqueid&token='+md5(_0x3cf6fb['uniqueid']);}else{_0x3cf6fb[_0x907b('0x87')]='';}var _0x3fce6e=_0x11c5c3[_0x907b('0x82')]===_0x907b('0x88')?'eu':'com';return getAccessToken(_0x11c5c3)[_0x907b('0x35')](function(_0x354a6e){_0x4ac25e=_0x354a6e;return getUser(_0x4ac25e,_0x3fce6e,_0x11c5c3,_0x299a47[_0x907b('0x39')]);})[_0x907b('0x35')](function(_0x19eb61){_0x4d5ee5=_0x19eb61;logger[_0x907b('0x3e')](_0x907b('0x89'),_0x4d5ee5['id']);return getEndUser(_0x4ac25e,_0x3fce6e,_0x11c5c3,_0x3cf6fb[_0x907b('0x8a')],_0x3cf6fb[_0x907b('0x8b')],_0x4d5ee5,_0x589014);})['then'](function(_0x3b9415){_0x3be9eb=_0x3b9415;return getCall(_0x4ac25e,_0x3fce6e,_0x11c5c3,_0x4d5ee5,_0x3be9eb,_0x589014,_0x3cf6fb,_0x907b('0x79'));})[_0x907b('0x35')](function(_0x4af64c){if(_0x4af64c){logger['info'](_0x907b('0x8c'),_0x4af64c['id']);logger['info'](_0x907b('0x84'),_0x907b('0x8d'));emit(util[_0x907b('0x33')](_0x907b('0x8e'),_0x299a47[_0x907b('0x1b')]),_0x907b('0x8f'),{'uri':'https://crm.'+_0x11c5c3[_0x907b('0x82')]+_0x907b('0x90')+_0x4af64c['id']});}})[_0x907b('0x2d')](function(_0x2ed3e1){logger[_0x907b('0x2e')](_0x907b('0x84'),JSON['stringify'](_0x2ed3e1));});};exports['outbound']=function(_0x44a407,_0x19e18a,_0x4fdfee,_0x11cee4,_0x5c5363,_0x5f512f,_0x447835){var _0x10da00,_0x243342,_0x57bdab;_0x5f512f['host']=intUtil[_0x907b('0x81')](_0x5f512f[_0x907b('0x82')]);_0x5f512f[_0x907b('0x83')]=intUtil[_0x907b('0x81')](_0x5f512f[_0x907b('0x83')]);if(_0x447835&&_0x447835[_0x907b('0x91')]&&_0x447835[_0x907b('0x91')]!==_0x907b('0x92')){logger['info'](_0x907b('0x93'),_0x907b('0x94'));_0x19e18a[_0x907b('0x87')]=_0x5f512f['serverUrl']+'/api/voice/recordings/'+_0x19e18a[_0x907b('0x86')]+'/downloads?type=uniqueid&token='+md5(_0x19e18a['uniqueid']);}var _0x5e2d82=_0x5f512f[_0x907b('0x82')]===_0x907b('0x88')?'eu':_0x907b('0x95');return getAccessToken(_0x5f512f)['then'](function(_0x3a2cd8){_0x57bdab=_0x3a2cd8;return getUser(_0x57bdab,_0x5e2d82,_0x5f512f,_0x11cee4[_0x907b('0x39')]);})[_0x907b('0x35')](function(_0x2d7fc6){_0x10da00=_0x2d7fc6;logger[_0x907b('0x3e')](_0x907b('0x89'),_0x10da00['id']);return getEndUser(_0x57bdab,_0x5e2d82,_0x5f512f,_0x19e18a[_0x907b('0x96')],_0x19e18a[_0x907b('0x97')],_0x10da00,_0x4fdfee);})[_0x907b('0x35')](function(_0x3ad8af){_0x243342=_0x3ad8af;return getCall(_0x57bdab,_0x5e2d82,_0x5f512f,_0x10da00,_0x243342,_0x4fdfee,_0x19e18a,_0x907b('0x98'));})[_0x907b('0x35')](function(_0x5871b1){if(_0x5871b1){logger['info'](_0x907b('0x8c'),_0x5871b1['id']);logger[_0x907b('0x3e')](_0x907b('0x93'),_0x907b('0x8d'));emit(util[_0x907b('0x33')](_0x907b('0x8e'),_0x11cee4[_0x907b('0x1b')]),_0x907b('0x8f'),{'uri':'https://crm.'+_0x5f512f[_0x907b('0x82')]+'/crm/EntityInfo.do?module=Calls&id='+_0x5871b1['id']});}})[_0x907b('0x2d')](function(_0x56d48d){logger['error'](_0x907b('0x93'),JSON[_0x907b('0xe')](_0x56d48d));});};exports[_0x907b('0x99')]=function(_0x3a37d0,_0x28b73d,_0x3e3b99,_0x5c13ec,_0x56f5f8,_0x5df7d5){var _0x21d9b3,_0x1f1268,_0x4b1f4a;_0x5df7d5[_0x907b('0x82')]=intUtil['stripTrailingSlash'](_0x5df7d5['host']);_0x5df7d5[_0x907b('0x83')]=intUtil[_0x907b('0x81')](_0x5df7d5[_0x907b('0x83')]);if(_0x56f5f8&&_0x56f5f8['monitor_format']){logger[_0x907b('0x3e')]('['+_0x28b73d[_0x907b('0x9a')][_0x907b('0x9b')]()+']',_0x907b('0x94'));_0x28b73d[_0x907b('0x87')]=_0x5df7d5[_0x907b('0x83')]+_0x907b('0x85')+_0x28b73d[_0x907b('0x86')]+'/downloads?type=uniqueid&token='+md5(_0x28b73d[_0x907b('0x86')]);}else{_0x28b73d[_0x907b('0x87')]='';}var _0x53d085=_0x5df7d5['host']==='zoho.eu'?'eu':_0x907b('0x95');return getAccessToken(_0x5df7d5)['then'](function(_0x2498a5){_0x4b1f4a=_0x2498a5;return getUser(_0x4b1f4a,_0x53d085,_0x5df7d5);})[_0x907b('0x35')](function(_0x5d9152){_0x21d9b3=_0x5d9152;logger[_0x907b('0x3e')]('The\x20User\x20ID\x20is:',_0x21d9b3['id']);return getEndUser(_0x4b1f4a,_0x53d085,_0x5df7d5,_0x28b73d[_0x907b('0x8a')],_0x28b73d[_0x907b('0x8b')],_0x21d9b3,_0x3e3b99);})[_0x907b('0x35')](function(_0x251f14){_0x1f1268=_0x251f14;return getCall(_0x4b1f4a,_0x53d085,_0x5df7d5,_0x21d9b3,_0x1f1268,_0x3e3b99,_0x28b73d,_0x907b('0x79'));})['then'](function(_0x420fdc){if(_0x420fdc){logger[_0x907b('0x3e')](_0x907b('0x8c'),_0x420fdc['id']);}})[_0x907b('0x2d')](function(_0x45a1c5){logger[_0x907b('0x2e')]('['+_0x28b73d[_0x907b('0x9a')][_0x907b('0x9b')]()+']',JSON['stringify'](_0x45a1c5));});}; \ 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 1f64dfa..c4a53a6 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 _0x025d=['exec','data2','Script','render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger','trigger'];(function(_0x37a48d,_0x20df85){var _0x23e38e=function(_0x11cd20){while(--_0x11cd20){_0x37a48d['push'](_0x37a48d['shift']());}};_0x23e38e(++_0x20df85);}(_0x025d,0xa4));var _0xd025=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x025d[_0x19e35c];return _0x3e1fe8;};'use strict';var util=require(_0xd025('0x0'));var sh=require(_0xd025('0x1'));var Mustache=require(_0xd025('0x2'));var logger=require(_0xd025('0x3'))(_0xd025('0x4'));exports[_0xd025('0x5')]=function(_0x303f87,_0x4073c3){var _0x59964d=_0x303f87[_0xd025('0x6')]?_0x303f87[_0xd025('0x6')]:_0xd025('0x7');var _0x4c3c48=_0x303f87['data3']?Mustache[_0xd025('0x8')](_0x303f87['data3'],_0x4073c3):_0x4073c3;sh[_0xd025('0x5')](_0x4c3c48,function(_0x2a8ace,_0x48f519,_0x3384e0){if(_0x2a8ace!==0x0){logger[_0xd025('0x9')](util[_0xd025('0xa')](_0xd025('0xb'),_0x59964d,_0x4c3c48,_0x2a8ace,_0x3384e0));}else{logger['info'](util['format'](_0xd025('0xc'),_0x59964d,_0x4c3c48,_0x48f519));}});}; \ No newline at end of file +var _0xfc0b=['data3','render','info','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','../../../../config/logger','trigger','exec','data2','Script'];(function(_0x482214,_0x2550ff){var _0x38d0cb=function(_0x2ba281){while(--_0x2ba281){_0x482214['push'](_0x482214['shift']());}};_0x38d0cb(++_0x2550ff);}(_0xfc0b,0x1cd));var _0xbfc0=function(_0x4d6bd9,_0x497295){_0x4d6bd9=_0x4d6bd9-0x0;var _0x348d88=_0xfc0b[_0x4d6bd9];return _0x348d88;};'use strict';var util=require(_0xbfc0('0x0'));var sh=require(_0xbfc0('0x1'));var Mustache=require('mustache');var logger=require(_0xbfc0('0x2'))(_0xbfc0('0x3'));exports[_0xbfc0('0x4')]=function(_0x40092d,_0xb82fa4){var _0x323acb=_0x40092d['data2']?_0x40092d[_0xbfc0('0x5')]:_0xbfc0('0x6');var _0x219909=_0x40092d[_0xbfc0('0x7')]?Mustache[_0xbfc0('0x8')](_0x40092d[_0xbfc0('0x7')],_0xb82fa4):_0xb82fa4;sh[_0xbfc0('0x4')](_0x219909,function(_0x23f50b,_0x35f646,_0x264444){if(_0x23f50b!==0x0){logger['error'](util['format']('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x323acb,_0x219909,_0x23f50b,_0x264444));}else{logger[_0xbfc0('0x9')](util[_0xbfc0('0xa')](_0xbfc0('0xb'),_0x323acb,_0x219909,_0x35f646));}});}; \ 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 2ec799b..78e6289 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 _0xe05a=['then',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','name','message','request-promise','util','lodash','mustache','exec','data1','toUpperCase','render','data2','data5','number','headers','data6','parse','GET','POST','data7','body','error','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify'];(function(_0x5bc086,_0x17e92b){var _0x366bc2=function(_0x506d16){while(--_0x506d16){_0x5bc086['push'](_0x5bc086['shift']());}};_0x366bc2(++_0x17e92b);}(_0xe05a,0x1e7));var _0xae05=function(_0x12cc40,_0xeff34e){_0x12cc40=_0x12cc40-0x0;var _0xb58336=_0xe05a[_0x12cc40];return _0xb58336;};'use strict';var rp=require(_0xae05('0x0'));var util=require(_0xae05('0x1'));var _=require(_0xae05('0x2'));var Mustache=require(_0xae05('0x3'));var logger=require('../../../../config/logger')('trigger');exports[_0xae05('0x4')]=function(_0x18de35,_0x24e2e4){var _0x5911b9,_0xc4fd08;var _0x3f319f={'method':_0x18de35[_0xae05('0x5')][_0xae05('0x6')](),'uri':Mustache[_0xae05('0x7')](_0x18de35[_0xae05('0x8')],_0x24e2e4),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x18de35[_0xae05('0x9')])===_0xae05('0xa')&&parseInt(_0x18de35[_0xae05('0x9')])>=0x1&&parseInt(_0x18de35[_0xae05('0x9')])<=0xa?parseInt(_0x18de35['data5'])*0x3e8:0x5*0x3e8};try{_0x3f319f[_0xae05('0xb')]=_0x18de35[_0xae05('0xc')]?JSON[_0xae05('0xd')](Mustache[_0xae05('0x7')](_0x18de35[_0xae05('0xc')],_0x24e2e4)):{};}catch(_0x1ac8b9){logger['error'](_0x1ac8b9['stack']);}switch(_0x18de35['data1']['toUpperCase']()){case _0xae05('0xe'):case'DELETE':_0x5911b9=null;_0x3f319f['qs']=_0x24e2e4;break;case _0xae05('0xf'):case'PUT':if(_0x18de35[_0xae05('0x10')]){try{_0x5911b9=JSON['parse'](Mustache[_0xae05('0x7')](_0x18de35[_0xae05('0x10')],_0x24e2e4));_0x3f319f[_0xae05('0x11')]=_0x5911b9;}catch(_0x3e071c){logger[_0xae05('0x12')](_0x3e071c[_0xae05('0x13')]);logger['error'](_0xae05('0x14'));}}else{_0x5911b9=_0x24e2e4;_0x3f319f['body']=_0x5911b9;}break;}logger[_0xae05('0x15')](util[_0xae05('0x16')](_0xae05('0x17'),_0x18de35[_0xae05('0x5')],_0x18de35[_0xae05('0x8')],JSON[_0xae05('0x18')](_0x3f319f)));rp(_0x3f319f)[_0xae05('0x19')](function(_0x2cb895){_0x5911b9=!_['isNil'](_0x5911b9)?_0xae05('0x1a')+_0x5911b9:'';_0xc4fd08=typeof _0x2cb895[_0xae05('0x11')]===_0xae05('0x1b')?JSON[_0xae05('0x18')](_0x2cb895['body']):_0x2cb895['body'];logger[_0xae05('0x15')](util[_0xae05('0x16')](_0xae05('0x1c'),_0x18de35[_0xae05('0x5')],_0x18de35[_0xae05('0x8')],_0x2cb895[_0xae05('0x1d')],_0xc4fd08));})['catch'](function(_0x491731){logger[_0xae05('0x12')](util[_0xae05('0x16')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x18de35['data1'],_0x18de35[_0xae05('0x8')],_0x491731[_0xae05('0x1d')],_0x491731[_0xae05('0x1e')],_0x491731[_0xae05('0x1f')]));});}; \ No newline at end of file +var _0x2f06=['%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','data2','name','message','request-promise','util','lodash','mustache','trigger','exec','render','number','data5','parse','data6','stack','data1','GET','DELETE','POST','data7','body','error','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','info','format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2f06,0x10f));var _0x62f0=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x2f06[_0x15bc81];return _0x59440e;};'use strict';var rp=require(_0x62f0('0x0'));var util=require(_0x62f0('0x1'));var _=require(_0x62f0('0x2'));var Mustache=require(_0x62f0('0x3'));var logger=require('../../../../config/logger')(_0x62f0('0x4'));exports[_0x62f0('0x5')]=function(_0x2130a0,_0x1119e8){var _0x228cb7,_0x57af5c;var _0x45991e={'method':_0x2130a0['data1']['toUpperCase'](),'uri':Mustache[_0x62f0('0x6')](_0x2130a0['data2'],_0x1119e8),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x2130a0['data5'])===_0x62f0('0x7')&&parseInt(_0x2130a0[_0x62f0('0x8')])>=0x1&&parseInt(_0x2130a0[_0x62f0('0x8')])<=0xa?parseInt(_0x2130a0[_0x62f0('0x8')])*0x3e8:0x5*0x3e8};try{_0x45991e['headers']=_0x2130a0['data6']?JSON[_0x62f0('0x9')](Mustache['render'](_0x2130a0[_0x62f0('0xa')],_0x1119e8)):{};}catch(_0x3ac711){logger['error'](_0x3ac711[_0x62f0('0xb')]);}switch(_0x2130a0[_0x62f0('0xc')]['toUpperCase']()){case _0x62f0('0xd'):case _0x62f0('0xe'):_0x228cb7=null;_0x45991e['qs']=_0x1119e8;break;case _0x62f0('0xf'):case'PUT':if(_0x2130a0[_0x62f0('0x10')]){try{_0x228cb7=JSON[_0x62f0('0x9')](Mustache[_0x62f0('0x6')](_0x2130a0['data7'],_0x1119e8));_0x45991e[_0x62f0('0x11')]=_0x228cb7;}catch(_0x31c3fe){logger[_0x62f0('0x12')](_0x31c3fe[_0x62f0('0xb')]);logger[_0x62f0('0x12')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x228cb7=_0x1119e8;_0x45991e[_0x62f0('0x11')]=_0x228cb7;}break;}logger['info'](util['format'](_0x62f0('0x13'),_0x2130a0[_0x62f0('0xc')],_0x2130a0['data2'],JSON[_0x62f0('0x14')](_0x45991e)));rp(_0x45991e)[_0x62f0('0x15')](function(_0x593f03){_0x228cb7=!_[_0x62f0('0x16')](_0x228cb7)?_0x62f0('0x17')+_0x228cb7:'';_0x57af5c=typeof _0x593f03[_0x62f0('0x11')]==='object'?JSON[_0x62f0('0x14')](_0x593f03[_0x62f0('0x11')]):_0x593f03[_0x62f0('0x11')];logger[_0x62f0('0x18')](util[_0x62f0('0x19')](_0x62f0('0x1a'),_0x2130a0[_0x62f0('0xc')],_0x2130a0['data2'],_0x593f03[_0x62f0('0x1b')],_0x57af5c));})[_0x62f0('0x1c')](function(_0x111051){logger[_0x62f0('0x12')](util['format'](_0x62f0('0x1d'),_0x2130a0[_0x62f0('0xc')],_0x2130a0[_0x62f0('0x1e')],_0x111051[_0x62f0('0x1b')],_0x111051[_0x62f0('0x1f')],_0x111051[_0x62f0('0x20')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 92e4c1d..b542fd8 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 _0x2822=['jayson/promise','bluebird','routing','http','then','rpc','error','message','result','catch','exports'];(function(_0x3efff2,_0x16c3a5){var _0x354db2=function(_0x1587f4){while(--_0x1587f4){_0x3efff2['push'](_0x3efff2['shift']());}};_0x354db2(++_0x16c3a5);}(_0x2822,0x14a));var _0x2282=function(_0x449569,_0x2ed519){_0x449569=_0x449569-0x0;var _0x4b7fdd=_0x2822[_0x449569];return _0x4b7fdd;};'use strict';var jayson=require(_0x2282('0x0'));var BPromise=require(_0x2282('0x1'));var logger=require('../../config/logger')(_0x2282('0x2'));var client=jayson['client'][_0x2282('0x3')]({'port':0x2329});client['Request']=function(_0x2e0f00,_0x4dec08){return new BPromise(function(_0x12d1cd,_0x15ec5a){return client['request'](_0x2e0f00,_0x4dec08)[_0x2282('0x4')](function(_0x43b3bc){logger['debug'](_0x2282('0x5'),'routing',_0x2e0f00,_0x4dec08,_0x43b3bc);if(_0x43b3bc['error']){logger[_0x2282('0x6')](_0x2282('0x5'),_0x2282('0x2'),_0x2e0f00,_0x43b3bc[_0x2282('0x6')][_0x2282('0x7')],_0x4dec08);return _0x15ec5a(_0x43b3bc['error'][_0x2282('0x7')]);}else{return _0x12d1cd(_0x43b3bc[_0x2282('0x8')]);}})[_0x2282('0x9')](function(_0x3e1fbd){logger['error'](_0x2282('0x5'),_0x2282('0x2'),_0x2e0f00,_0x3e1fbd,_0x4dec08);return _0x15ec5a(_0x3e1fbd);});});};module[_0x2282('0xa')]=client; \ No newline at end of file +var _0x2a61=['jayson/promise','bluebird','../../config/logger','client','http','Request','request','then','debug','rpc','routing','error','message','result','catch','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2a61,0x170));var _0x12a6=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x2a61[_0x502c7d];return _0x30b7ed;};'use strict';var jayson=require(_0x12a6('0x0'));var BPromise=require(_0x12a6('0x1'));var logger=require(_0x12a6('0x2'))('routing');var client=jayson[_0x12a6('0x3')][_0x12a6('0x4')]({'port':0x2329});client[_0x12a6('0x5')]=function(_0x50da8e,_0xf86bb3){return new BPromise(function(_0x28421b,_0x4d6f97){return client[_0x12a6('0x6')](_0x50da8e,_0xf86bb3)[_0x12a6('0x7')](function(_0x42f07e){logger[_0x12a6('0x8')](_0x12a6('0x9'),_0x12a6('0xa'),_0x50da8e,_0xf86bb3,_0x42f07e);if(_0x42f07e[_0x12a6('0xb')]){logger[_0x12a6('0xb')](_0x12a6('0x9'),'routing',_0x50da8e,_0x42f07e[_0x12a6('0xb')][_0x12a6('0xc')],_0xf86bb3);return _0x4d6f97(_0x42f07e[_0x12a6('0xb')][_0x12a6('0xc')]);}else{return _0x28421b(_0x42f07e[_0x12a6('0xd')]);}})[_0x12a6('0xe')](function(_0xba903e){logger['error'](_0x12a6('0x9'),_0x12a6('0xa'),_0x50da8e,_0xba903e,_0xf86bb3);return _0x4d6f97(_0xba903e);});});};module[_0x12a6('0xf')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index ff00b74..28b4a5d 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 _0xe9ea=['./lib/email','./rpc/mailAccount','./rpc/setting','initMailAccounts','refresh','listen','then','loginMailFrequency','bluebird'];(function(_0x719293,_0x45aea5){var _0x1e6d73=function(_0x507504){while(--_0x507504){_0x719293['push'](_0x719293['shift']());}};_0x1e6d73(++_0x45aea5);}(_0xe9ea,0x128));var _0xae9e=function(_0x2051a0,_0x14b02b){_0x2051a0=_0x2051a0-0x0;var _0x27a210=_0xe9ea[_0x2051a0];return _0x27a210;};'use strict';var BPromise=require(_0xae9e('0x0'));var server=require('./server');var Realtime=require('./realtime');var EmailChannel=require(_0xae9e('0x1'));var mailAccount=require(_0xae9e('0x2'));var setting=require(_0xae9e('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise['resolve']()['then'](mailAccount['getMailAccounts']())['then'](realtime[_0xae9e('0x4')]())['then'](function(){email[_0xae9e('0x5')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0xae9e('0x6')](realtime,email)['then'](function(){return initRealtime();})[_0xae9e('0x7')](function(){return setting['getSettings']();})[_0xae9e('0x7')](function(_0x209d53){return setInterval(initRealtime,_0x209d53[_0xae9e('0x8')]*0x3e8);})['catch'](function(_0x1e3f72){console['log'](_0x1e3f72);});}main(); \ No newline at end of file +var _0xcd3e=['./realtime','./lib/email','./rpc/mailAccount','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','getSettings','loginMailFrequency','catch','log','bluebird','./server'];(function(_0x4f3c9b,_0x28e078){var _0x84e58a=function(_0x37bf49){while(--_0x37bf49){_0x4f3c9b['push'](_0x4f3c9b['shift']());}};_0x84e58a(++_0x28e078);}(_0xcd3e,0x132));var _0xecd3=function(_0x39cf70,_0x3ec55b){_0x39cf70=_0x39cf70-0x0;var _0x580424=_0xcd3e[_0x39cf70];return _0x580424;};'use strict';var BPromise=require(_0xecd3('0x0'));var server=require(_0xecd3('0x1'));var Realtime=require(_0xecd3('0x2'));var EmailChannel=require(_0xecd3('0x3'));var mailAccount=require(_0xecd3('0x4'));var setting=require('./rpc/setting');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise['resolve']()[_0xecd3('0x5')](mailAccount[_0xecd3('0x6')]())[_0xecd3('0x5')](realtime[_0xecd3('0x7')]())[_0xecd3('0x5')](function(){email[_0xecd3('0x8')](realtime[_0xecd3('0x9')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0xecd3('0x5')](function(){return initRealtime();})[_0xecd3('0x5')](function(){return setting[_0xecd3('0xa')]();})[_0xecd3('0x5')](function(_0x5f1c45){return setInterval(initRealtime,_0x5f1c45[_0xecd3('0xb')]*0x3e8);})[_0xecd3('0xc')](function(_0x2c964b){console[_0xecd3('0xd')](_0x2c964b);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index bc4caa3..63c0f02 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 _0xf335=['imapAccounts','handleImapEmail','bind','end','handleImapEnd','handleImapError','isNil','messageStatus','handleImapBox','messages','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','from','notify','then','error','send','verifySmtp','Smtp','lastSync','verify','verified','catch','exports','lodash','moment','bluebird','md5','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','../rpc/mailAccount','start\x20email\x20channel','smtp','prototype','emit','mailAccounts','name','active','Imap','status','total','stringify','mailAccount:update','refresh','hasOwnProperty'];(function(_0xdd42ad,_0xbbf5b5){var _0x463669=function(_0x565323){while(--_0x565323){_0xdd42ad['push'](_0xdd42ad['shift']());}};_0x463669(++_0xbbf5b5);}(_0xf335,0x117));var _0x5f33=function(_0x2a44c0,_0x5840db){_0x2a44c0=_0x2a44c0-0x0;var _0x5189b6=_0xf335[_0x2a44c0];return _0x5189b6;};'use strict';var _=require(_0x5f33('0x0'));var moment=require(_0x5f33('0x1'));var BPromise=require(_0x5f33('0x2'));var md5=require(_0x5f33('0x3'));var Redis=require('ioredis');var config=require(_0x5f33('0x4'));var logger=require(_0x5f33('0x5'))(_0x5f33('0x6'));config[_0x5f33('0x7')]=_[_0x5f33('0x8')](config[_0x5f33('0x7')],{'host':_0x5f33('0x9'),'port':0x18eb});var io=require(_0x5f33('0xa'))(new Redis(config[_0x5f33('0x7')]));var EmailImap=require(_0x5f33('0xb'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x5f33('0xc'));var md5Accounts={};function EmailChannel(_0x6a12ff){logger['info'](_0x5f33('0xd'));this['mailAccounts']=_0x6a12ff['mailAccounts'];this['imapAccounts']={};this[_0x5f33('0xe')]=new EmailSmtp();}EmailChannel[_0x5f33('0xf')][_0x5f33('0x10')]=function(_0x230852){var _0x9cd0a7=this[_0x5f33('0x11')][_0x230852];var _0x474a2f={'id':_0x9cd0a7['id'],'name':_0x9cd0a7[_0x5f33('0x12')],'key':_0x9cd0a7['key'],'active':_0x9cd0a7[_0x5f33('0x13')],'Imap':{'status':_0x9cd0a7[_0x5f33('0x14')][_0x5f33('0x15')],'messageStatus':_0x9cd0a7[_0x5f33('0x14')]['messageStatus'],'total':_0x9cd0a7[_0x5f33('0x14')][_0x5f33('0x16')]}};if(_['isNil'](md5Accounts[_0x230852])){md5Accounts[_0x230852]={};}var _0x36aaa0=md5(JSON[_0x5f33('0x17')](_0x474a2f));if(md5Accounts[_0x230852]['md5']!==_0x36aaa0){md5Accounts[_0x230852][_0x5f33('0x3')]=_0x36aaa0;io[_0x5f33('0x10')](_0x5f33('0x18'),_0x474a2f);}};EmailChannel[_0x5f33('0xf')][_0x5f33('0x19')]=function(_0x31a71e){for(var _0x2e5ace in _0x31a71e){if(_0x31a71e['hasOwnProperty'](_0x2e5ace)){if(_0x31a71e[_0x2e5ace][_0x5f33('0x14')]&&_0x31a71e[_0x2e5ace]['active']){var _0x4187b5=_0x31a71e[_0x2e5ace][_0x5f33('0x14')];if(!this['imapAccounts'][_0x5f33('0x1a')](_0x4187b5['id'])){this[_0x5f33('0x1b')][_0x4187b5['id']]=new EmailImap(_0x4187b5,_0x31a71e[_0x2e5ace]['email']);this[_0x5f33('0x1b')][_0x4187b5['id']]['on']('box',this['handleImapBox']['bind'](this,_0x2e5ace));this['imapAccounts'][_0x4187b5['id']]['on'](_0x5f33('0x6'),this[_0x5f33('0x1c')][_0x5f33('0x1d')](this,_0x2e5ace));this['imapAccounts'][_0x4187b5['id']]['on'](_0x5f33('0x1e'),this[_0x5f33('0x1f')][_0x5f33('0x1d')](this,_0x2e5ace));this[_0x5f33('0x1b')][_0x4187b5['id']]['on']('error',this[_0x5f33('0x20')]['bind'](this,_0x2e5ace));}}else{if(_[_0x5f33('0x21')](this['mailAccounts'][_0x2e5ace][_0x5f33('0x14')])){this[_0x5f33('0x11')][_0x2e5ace][_0x5f33('0x14')]={};}this[_0x5f33('0x11')][_0x2e5ace][_0x5f33('0x14')][_0x5f33('0x15')]='disabled';this[_0x5f33('0x11')][_0x2e5ace][_0x5f33('0x14')][_0x5f33('0x22')]='';this[_0x5f33('0x10')](_0x2e5ace);}}}};EmailChannel[_0x5f33('0xf')][_0x5f33('0x23')]=function(_0x1853c4,_0x2c0a2e){if(this['mailAccounts'][_0x1853c4]){this[_0x5f33('0x11')][_0x1853c4]['Imap'][_0x5f33('0x15')]='connected';this['mailAccounts'][_0x1853c4][_0x5f33('0x14')][_0x5f33('0x22')]=_0x2c0a2e[_0x5f33('0x12')];if(_0x2c0a2e[_0x5f33('0x24')]){this['mailAccounts'][_0x1853c4][_0x5f33('0x14')][_0x5f33('0x16')]=_0x2c0a2e['messages'][_0x5f33('0x16')];}return this[_0x5f33('0x10')](_0x1853c4);}};EmailChannel[_0x5f33('0xf')][_0x5f33('0x1c')]=function(_0x32b180,_0x281474){logger[_0x5f33('0x25')](_0x5f33('0x26'),_0x281474['firstName'],_0x281474['lastName'],_0x281474[_0x5f33('0x27')],_0x32b180);if(this[_0x5f33('0x11')][_0x32b180]){return mailAccount[_0x5f33('0x28')](_0x32b180,_0x281474)[_0x5f33('0x29')](function(_0x1c1599){if(_0x1c1599){logger[_0x5f33('0x25')]('Mail\x20accepted\x20from\x20routing');}})['catch'](function(_0xe43e92){logger[_0x5f33('0x2a')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x5f33('0x17')](_0xe43e92));});}};EmailChannel[_0x5f33('0xf')][_0x5f33('0x1f')]=function(_0x27350c){if(this[_0x5f33('0x11')][_0x27350c]&&this[_0x5f33('0x11')][_0x27350c][_0x5f33('0x14')]){if(this['imapAccounts'][this[_0x5f33('0x11')][_0x27350c][_0x5f33('0x14')]['id']]){delete this[_0x5f33('0x1b')][this['mailAccounts'][_0x27350c]['Imap']['id']];}this[_0x5f33('0x11')][_0x27350c][_0x5f33('0x14')]['lastSync']=moment();this['emit'](_0x27350c);}};EmailChannel['prototype']['handleImapError']=function(_0xc554fb,_0x3b51d6){if(this[_0x5f33('0x11')][_0xc554fb]){this[_0x5f33('0x11')][_0xc554fb][_0x5f33('0x14')][_0x5f33('0x15')]=_0x5f33('0x2a');this[_0x5f33('0x11')][_0xc554fb][_0x5f33('0x14')][_0x5f33('0x22')]=_0x3b51d6;return this[_0x5f33('0x10')](_0xc554fb);}};EmailChannel['prototype']['sendMail']=function(_0x15773f,_0x54bf7f){return this[_0x5f33('0xe')][_0x5f33('0x2b')](_0x15773f,_0x54bf7f);};EmailChannel[_0x5f33('0xf')][_0x5f33('0x2c')]=function(_0x3f7414){var _0x186ca2=this;if(this[_0x5f33('0x11')][_0x3f7414['id']]){if(_[_0x5f33('0x21')](this[_0x5f33('0x11')][_0x3f7414['id']][_0x5f33('0x2d')])){this[_0x5f33('0x11')][_0x3f7414['id']][_0x5f33('0x2d')]={};}this[_0x5f33('0x11')][_0x3f7414['id']][_0x5f33('0x2d')][_0x5f33('0x2e')]=moment();return new BPromise(function(_0x1c5649,_0x522c04){return _0x186ca2[_0x5f33('0xe')][_0x5f33('0x2f')](_0x3f7414)[_0x5f33('0x29')](function(_0x5cfa96){_0x186ca2[_0x5f33('0x11')][_0x3f7414['id']][_0x5f33('0x2d')][_0x5f33('0x15')]=_0x5f33('0x30');_0x186ca2[_0x5f33('0x11')][_0x3f7414['id']][_0x5f33('0x2d')]['messageStatus']='';_0x186ca2[_0x5f33('0x10')](_0x3f7414['id']);_0x1c5649(_0x5cfa96);})[_0x5f33('0x31')](function(_0x263b00){_0x186ca2[_0x5f33('0x11')][_0x3f7414['id']][_0x5f33('0x2d')][_0x5f33('0x15')]=_0x5f33('0x2a');_0x186ca2[_0x5f33('0x11')][_0x3f7414['id']]['Smtp']['messageStatus']=_0x263b00;_0x186ca2[_0x5f33('0x10')](_0x3f7414['id']);_0x522c04(_0x263b00);});});}return this[_0x5f33('0xe')][_0x5f33('0x2f')](_0x3f7414);};module[_0x5f33('0x32')]=EmailChannel; \ No newline at end of file +var _0x4696=['notify','then','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','lastSync','sendMail','Smtp','verify','verified','exports','lodash','bluebird','ioredis','../../../config/environment','email','defaults','redis','localhost','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','status','messageStatus','total','isNil','stringify','md5','mailAccount:update','refresh','hasOwnProperty','box','handleImapBox','bind','handleImapEmail','end','error','handleImapError','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from'];(function(_0xec54a3,_0x33d6b5){var _0x26af94=function(_0x53b37d){while(--_0x53b37d){_0xec54a3['push'](_0xec54a3['shift']());}};_0x26af94(++_0x33d6b5);}(_0x4696,0xa6));var _0x6469=function(_0x33f42b,_0x25a153){_0x33f42b=_0x33f42b-0x0;var _0x4ab30b=_0x4696[_0x33f42b];return _0x4ab30b;};'use strict';var _=require(_0x6469('0x0'));var moment=require('moment');var BPromise=require(_0x6469('0x1'));var md5=require('md5');var Redis=require(_0x6469('0x2'));var config=require(_0x6469('0x3'));var logger=require('../../../config/logger')(_0x6469('0x4'));config['redis']=_[_0x6469('0x5')](config[_0x6469('0x6')],{'host':_0x6469('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6469('0x6')]));var EmailImap=require('./imap');var EmailSmtp=require(_0x6469('0x8'));var mailAccount=require(_0x6469('0x9'));var md5Accounts={};function EmailChannel(_0x43dad4){logger[_0x6469('0xa')](_0x6469('0xb'));this['mailAccounts']=_0x43dad4[_0x6469('0xc')];this[_0x6469('0xd')]={};this[_0x6469('0xe')]=new EmailSmtp();}EmailChannel[_0x6469('0xf')][_0x6469('0x10')]=function(_0x4731f0){var _0x349784=this[_0x6469('0xc')][_0x4731f0];var _0x5c016e={'id':_0x349784['id'],'name':_0x349784[_0x6469('0x11')],'key':_0x349784[_0x6469('0x12')],'active':_0x349784[_0x6469('0x13')],'Imap':{'status':_0x349784[_0x6469('0x14')][_0x6469('0x15')],'messageStatus':_0x349784[_0x6469('0x14')][_0x6469('0x16')],'total':_0x349784['Imap'][_0x6469('0x17')]}};if(_[_0x6469('0x18')](md5Accounts[_0x4731f0])){md5Accounts[_0x4731f0]={};}var _0x97b2af=md5(JSON[_0x6469('0x19')](_0x5c016e));if(md5Accounts[_0x4731f0][_0x6469('0x1a')]!==_0x97b2af){md5Accounts[_0x4731f0][_0x6469('0x1a')]=_0x97b2af;io['emit'](_0x6469('0x1b'),_0x5c016e);}};EmailChannel[_0x6469('0xf')][_0x6469('0x1c')]=function(_0x16ce74){for(var _0x19309d in _0x16ce74){if(_0x16ce74['hasOwnProperty'](_0x19309d)){if(_0x16ce74[_0x19309d]['Imap']&&_0x16ce74[_0x19309d][_0x6469('0x13')]){var _0x1ee8be=_0x16ce74[_0x19309d][_0x6469('0x14')];if(!this[_0x6469('0xd')][_0x6469('0x1d')](_0x1ee8be['id'])){this['imapAccounts'][_0x1ee8be['id']]=new EmailImap(_0x1ee8be,_0x16ce74[_0x19309d][_0x6469('0x4')]);this[_0x6469('0xd')][_0x1ee8be['id']]['on'](_0x6469('0x1e'),this[_0x6469('0x1f')][_0x6469('0x20')](this,_0x19309d));this[_0x6469('0xd')][_0x1ee8be['id']]['on'](_0x6469('0x4'),this[_0x6469('0x21')]['bind'](this,_0x19309d));this[_0x6469('0xd')][_0x1ee8be['id']]['on'](_0x6469('0x22'),this['handleImapEnd']['bind'](this,_0x19309d));this['imapAccounts'][_0x1ee8be['id']]['on'](_0x6469('0x23'),this[_0x6469('0x24')][_0x6469('0x20')](this,_0x19309d));}}else{if(_[_0x6469('0x18')](this[_0x6469('0xc')][_0x19309d]['Imap'])){this[_0x6469('0xc')][_0x19309d][_0x6469('0x14')]={};}this[_0x6469('0xc')][_0x19309d][_0x6469('0x14')][_0x6469('0x15')]='disabled';this[_0x6469('0xc')][_0x19309d][_0x6469('0x14')][_0x6469('0x16')]='';this[_0x6469('0x10')](_0x19309d);}}}};EmailChannel['prototype'][_0x6469('0x1f')]=function(_0x14ae82,_0x30e491){if(this[_0x6469('0xc')][_0x14ae82]){this[_0x6469('0xc')][_0x14ae82][_0x6469('0x14')][_0x6469('0x15')]=_0x6469('0x25');this[_0x6469('0xc')][_0x14ae82]['Imap'][_0x6469('0x16')]=_0x30e491['name'];if(_0x30e491['messages']){this[_0x6469('0xc')][_0x14ae82][_0x6469('0x14')][_0x6469('0x17')]=_0x30e491[_0x6469('0x26')][_0x6469('0x17')];}return this[_0x6469('0x10')](_0x14ae82);}};EmailChannel['prototype'][_0x6469('0x21')]=function(_0x50369a,_0x483e76){logger['info'](_0x6469('0x27'),_0x483e76['firstName'],_0x483e76[_0x6469('0x28')],_0x483e76[_0x6469('0x29')],_0x50369a);if(this[_0x6469('0xc')][_0x50369a]){return mailAccount[_0x6469('0x2a')](_0x50369a,_0x483e76)[_0x6469('0x2b')](function(_0xcf2bd9){if(_0xcf2bd9){logger[_0x6469('0xa')]('Mail\x20accepted\x20from\x20routing');}})['catch'](function(_0x5bece5){logger[_0x6469('0x23')](_0x6469('0x2c'),JSON['stringify'](_0x5bece5));});}};EmailChannel[_0x6469('0xf')][_0x6469('0x2d')]=function(_0x5c4d81){if(this[_0x6469('0xc')][_0x5c4d81]&&this['mailAccounts'][_0x5c4d81]['Imap']){if(this[_0x6469('0xd')][this[_0x6469('0xc')][_0x5c4d81][_0x6469('0x14')]['id']]){delete this['imapAccounts'][this[_0x6469('0xc')][_0x5c4d81][_0x6469('0x14')]['id']];}this[_0x6469('0xc')][_0x5c4d81][_0x6469('0x14')][_0x6469('0x2e')]=moment();this[_0x6469('0x10')](_0x5c4d81);}};EmailChannel['prototype']['handleImapError']=function(_0x586877,_0x367d77){if(this[_0x6469('0xc')][_0x586877]){this[_0x6469('0xc')][_0x586877][_0x6469('0x14')][_0x6469('0x15')]=_0x6469('0x23');this['mailAccounts'][_0x586877][_0x6469('0x14')][_0x6469('0x16')]=_0x367d77;return this[_0x6469('0x10')](_0x586877);}};EmailChannel[_0x6469('0xf')][_0x6469('0x2f')]=function(_0x2c2a49,_0x16d5cf){return this[_0x6469('0xe')]['send'](_0x2c2a49,_0x16d5cf);};EmailChannel[_0x6469('0xf')]['verifySmtp']=function(_0x23b274){var _0x2ce20d=this;if(this[_0x6469('0xc')][_0x23b274['id']]){if(_[_0x6469('0x18')](this['mailAccounts'][_0x23b274['id']]['Smtp'])){this[_0x6469('0xc')][_0x23b274['id']][_0x6469('0x30')]={};}this['mailAccounts'][_0x23b274['id']][_0x6469('0x30')]['lastSync']=moment();return new BPromise(function(_0x3f0c8d,_0x35313d){return _0x2ce20d[_0x6469('0xe')][_0x6469('0x31')](_0x23b274)[_0x6469('0x2b')](function(_0x58420f){_0x2ce20d['mailAccounts'][_0x23b274['id']][_0x6469('0x30')][_0x6469('0x15')]=_0x6469('0x32');_0x2ce20d[_0x6469('0xc')][_0x23b274['id']][_0x6469('0x30')]['messageStatus']='';_0x2ce20d['emit'](_0x23b274['id']);_0x3f0c8d(_0x58420f);})['catch'](function(_0x53bc9b){_0x2ce20d[_0x6469('0xc')][_0x23b274['id']][_0x6469('0x30')][_0x6469('0x15')]=_0x6469('0x23');_0x2ce20d[_0x6469('0xc')][_0x23b274['id']][_0x6469('0x30')]['messageStatus']=_0x53bc9b;_0x2ce20d['emit'](_0x23b274['id']);_0x35313d(_0x53bc9b);});});}return this[_0x6469('0xe')][_0x6469('0x31')](_0x23b274);};module[_0x6469('0x33')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index ac533bf..f94f142 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 _0x5c9b=['handleReadUnseen','length','fetch','message','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','handleMessageAttributes','handleMessageEnd','stringify','textCode','hasOwnProperty','upperFirst','path','util','imap','lodash','randomstring','mailparser','iconv','Iconv','EventEmitter','./utils','../../../config/logger','email','INBOX','account','once','ready','handleReady','bind','end','handleEnd','error','handleError','inherits','prototype','getAccount','connTimeout','authTimeout','isNil','authentication','user','password','host','port','tls','autotls','required','getHost','anonymous@xcally.com','openBox','mailbox','handleOpenBox','emit','readUnseen','handleCloseBox','search'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x5c9b,0x13b));var _0xb5c9=function(_0x427f0a,_0x48a86f){_0x427f0a=_0x427f0a-0x0;var _0x238185=_0x5c9b[_0x427f0a];return _0x238185;};'use strict';var fs=require('fs');var path=require(_0xb5c9('0x0'));var util=require(_0xb5c9('0x1'));var Imap=require(_0xb5c9('0x2'));var _=require(_0xb5c9('0x3'));var rs=require(_0xb5c9('0x4'));var simpleParser=require(_0xb5c9('0x5'))['simpleParser'];var Iconv=require(_0xb5c9('0x6'))[_0xb5c9('0x7')];var EventEmitter=require('events')[_0xb5c9('0x8')];var utils=require(_0xb5c9('0x9'));var logger=require(_0xb5c9('0xa'))(_0xb5c9('0xb'));function EmailImap(_0x46e8e2,_0x2690f1){this['mailbox']=_0xb5c9('0xc');this['account']=this['getAccount'](_0x46e8e2,_0x2690f1);this['imap']=new Imap(this[_0xb5c9('0xd')]);this[_0xb5c9('0x2')][_0xb5c9('0xe')](_0xb5c9('0xf'),this[_0xb5c9('0x10')][_0xb5c9('0x11')](this));this[_0xb5c9('0x2')][_0xb5c9('0xe')](_0xb5c9('0x12'),this[_0xb5c9('0x13')][_0xb5c9('0x11')](this));this[_0xb5c9('0x2')]['on'](_0xb5c9('0x14'),this[_0xb5c9('0x15')]['bind'](this));this['imap']['connect']();}util[_0xb5c9('0x16')](EmailImap,EventEmitter);EmailImap[_0xb5c9('0x17')][_0xb5c9('0x18')]=function(_0x18f378,_0x9473c9){var _0x29c5c8={'connTimeout':_0x18f378[_0xb5c9('0x19')]?_0x18f378[_0xb5c9('0x19')]*0x3e8:0x2710,'authTimeout':_0x18f378[_0xb5c9('0x1a')]?_0x18f378[_0xb5c9('0x1a')]*0x3e8:0x1388};if(_[_0xb5c9('0x1b')](_0x18f378['service'])){if(_0x18f378[_0xb5c9('0x1c')]){_0x29c5c8[_0xb5c9('0x1d')]=_0x18f378['user'];_0x29c5c8[_0xb5c9('0x1e')]=_0x18f378[_0xb5c9('0x1e')];}_0x29c5c8[_0xb5c9('0x1f')]=_0x18f378['host'];_0x29c5c8[_0xb5c9('0x20')]=_0x18f378['port']||0x3e1;if(_0x18f378[_0xb5c9('0x21')]){_0x29c5c8[_0xb5c9('0x21')]=!![];}else{_0x29c5c8[_0xb5c9('0x21')]=![];_0x29c5c8[_0xb5c9('0x22')]=_0xb5c9('0x23');}}else{_0x29c5c8['user']=_0x18f378[_0xb5c9('0x1d')];_0x29c5c8[_0xb5c9('0x1e')]=_0x18f378[_0xb5c9('0x1e')];_0x29c5c8[_0xb5c9('0x1f')]=utils[_0xb5c9('0x24')](_0x18f378['service']);_0x29c5c8[_0xb5c9('0x20')]=0x3e1;_0x29c5c8['tls']=!![];}_0x29c5c8[_0xb5c9('0xb')]=_0x9473c9||_0x18f378[_0xb5c9('0x1d')]||_0xb5c9('0x25');return _0x29c5c8;};EmailImap['prototype'][_0xb5c9('0x10')]=function(){this[_0xb5c9('0x2')][_0xb5c9('0x26')](this[_0xb5c9('0x27')],![],this[_0xb5c9('0x28')][_0xb5c9('0x11')](this));};EmailImap['prototype'][_0xb5c9('0x28')]=function(_0x1b9f8b,_0x2281af){if(_0x1b9f8b){this[_0xb5c9('0x15')](_0x1b9f8b,!![]);}else{this[_0xb5c9('0x29')]('box',_0x2281af);this[_0xb5c9('0x2a')]();}};EmailImap[_0xb5c9('0x17')][_0xb5c9('0x2b')]=function(_0xda195c){if(_0xda195c){this[_0xb5c9('0x15')](_0xda195c,!![]);}else{this[_0xb5c9('0x2')]['end']();}};EmailImap[_0xb5c9('0x17')][_0xb5c9('0x2a')]=function(){this['imap'][_0xb5c9('0x2c')](['UNSEEN'],this[_0xb5c9('0x2d')][_0xb5c9('0x11')](this));};EmailImap[_0xb5c9('0x17')][_0xb5c9('0x2d')]=function(_0x39eb84,_0x56186a){if(_0x39eb84){this[_0xb5c9('0x15')](_0x39eb84,!![]);}else{if(_0x56186a[_0xb5c9('0x2e')]){try{var _0x1ffc1b=this[_0xb5c9('0x2')][_0xb5c9('0x2f')](_0x56186a,{'bodies':'','markSeen':!![]});_0x1ffc1b['on'](_0xb5c9('0x30'),this['handleFetchMessage'][_0xb5c9('0x11')](this));_0x1ffc1b['once'](_0xb5c9('0x14'),this[_0xb5c9('0x31')][_0xb5c9('0x11')](this));_0x1ffc1b[_0xb5c9('0xe')](_0xb5c9('0x12'),this[_0xb5c9('0x32')][_0xb5c9('0x11')](this));}catch(_0x3439d9){logger[_0xb5c9('0x14')](_0x3439d9);}}else{this[_0xb5c9('0x2')][_0xb5c9('0x33')](!![],this[_0xb5c9('0x2b')]['bind'](this));}}};EmailImap['prototype']['handleFetchMessage']=function(_0x204c81,_0x2eed9e){_0x204c81['on'](_0xb5c9('0x34'),this[_0xb5c9('0x35')][_0xb5c9('0x11')](this));_0x204c81['once']('attributes',this[_0xb5c9('0x36')]['bind'](this));_0x204c81[_0xb5c9('0xe')](_0xb5c9('0x12'),this[_0xb5c9('0x37')][_0xb5c9('0x11')](this));};EmailImap[_0xb5c9('0x17')]['handleMessageBody']=function(_0x36c8ec,_0x5be4fb){simpleParser(_0x36c8ec,{'Iconv':Iconv},this['handleSimpleParser'][_0xb5c9('0x11')](this));};EmailImap['prototype'][_0xb5c9('0x36')]=function(_0x54b3e8){};EmailImap[_0xb5c9('0x17')][_0xb5c9('0x37')]=function(){};EmailImap[_0xb5c9('0x17')]['handleSimpleParser']=function(_0xecec1e,_0x46dea6){if(_0xecec1e){logger[_0xb5c9('0x14')](_0xecec1e);}else{var _0x2aa18e=this;utils['parser'](this[_0xb5c9('0xd')],_0x46dea6,function(_0x37967e){_0x2aa18e[_0xb5c9('0x29')](_0xb5c9('0xb'),_0x37967e);});}};EmailImap[_0xb5c9('0x17')][_0xb5c9('0x32')]=function(){this[_0xb5c9('0x2')][_0xb5c9('0x33')](!![],this['handleCloseBox'][_0xb5c9('0x11')](this));};EmailImap[_0xb5c9('0x17')][_0xb5c9('0x31')]=function(_0x33a709){this[_0xb5c9('0x15')](_0x33a709);this[_0xb5c9('0x2')][_0xb5c9('0x33')](!![],this[_0xb5c9('0x2b')]['bind'](this));};EmailImap['prototype']['handleEnd']=function(){this['emit'](_0xb5c9('0x12'));};EmailImap[_0xb5c9('0x17')][_0xb5c9('0x15')]=function(_0x31a1ff,_0x330bee){logger[_0xb5c9('0x14')](_0xb5c9('0x15'),this[_0xb5c9('0xd')][_0xb5c9('0xb')],JSON[_0xb5c9('0x38')](_0x31a1ff));var _0x4d115b='';if(_0x31a1ff){if(_0x31a1ff['textCode']){_0x4d115b=_0x31a1ff[_0xb5c9('0x39')];}else{for(var _0x421c3a in _0x31a1ff){if(_0x31a1ff[_0xb5c9('0x3a')](_0x421c3a)){_0x4d115b+=_[_0xb5c9('0x3b')](_0x421c3a)+':\x20'+_0x31a1ff[_0x421c3a]+'\x0a';}}}}if(_0x330bee){this[_0xb5c9('0x2')][_0xb5c9('0x12')]();}else{this[_0xb5c9('0x29')](_0xb5c9('0x14'),_0x4d115b);this[_0xb5c9('0x29')](_0xb5c9('0x12'));}};module['exports']=EmailImap; \ No newline at end of file +var _0xe207=['required','getHost','anonymous@xcally.com','openBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','message','error','handleFetchError','handleFetchEnd','closeBox','handleFetchMessage','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','handleEnd','stringify','textCode','hasOwnProperty','upperFirst','path','util','imap','lodash','randomstring','mailparser','simpleParser','../../../config/logger','email','mailbox','INBOX','account','getAccount','ready','handleReady','bind','once','end','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls'];(function(_0x7c5058,_0xd1227f){var _0x296883=function(_0x19d4b3){while(--_0x19d4b3){_0x7c5058['push'](_0x7c5058['shift']());}};_0x296883(++_0xd1227f);}(_0xe207,0x154));var _0x7e20=function(_0xcfaa79,_0x372c22){_0xcfaa79=_0xcfaa79-0x0;var _0x414eed=_0xe207[_0xcfaa79];return _0x414eed;};'use strict';var fs=require('fs');var path=require(_0x7e20('0x0'));var util=require(_0x7e20('0x1'));var Imap=require(_0x7e20('0x2'));var _=require(_0x7e20('0x3'));var rs=require(_0x7e20('0x4'));var simpleParser=require(_0x7e20('0x5'))[_0x7e20('0x6')];var Iconv=require('iconv')['Iconv'];var EventEmitter=require('events')['EventEmitter'];var utils=require('./utils');var logger=require(_0x7e20('0x7'))(_0x7e20('0x8'));function EmailImap(_0x23d06e,_0x2aac14){this[_0x7e20('0x9')]=_0x7e20('0xa');this[_0x7e20('0xb')]=this[_0x7e20('0xc')](_0x23d06e,_0x2aac14);this[_0x7e20('0x2')]=new Imap(this[_0x7e20('0xb')]);this[_0x7e20('0x2')]['once'](_0x7e20('0xd'),this[_0x7e20('0xe')][_0x7e20('0xf')](this));this['imap'][_0x7e20('0x10')](_0x7e20('0x11'),this['handleEnd'][_0x7e20('0xf')](this));this[_0x7e20('0x2')]['on']('error',this[_0x7e20('0x12')][_0x7e20('0xf')](this));this[_0x7e20('0x2')][_0x7e20('0x13')]();}util[_0x7e20('0x14')](EmailImap,EventEmitter);EmailImap[_0x7e20('0x15')][_0x7e20('0xc')]=function(_0x29da2c,_0x59177c){var _0x47327f={'connTimeout':_0x29da2c[_0x7e20('0x16')]?_0x29da2c[_0x7e20('0x16')]*0x3e8:0x2710,'authTimeout':_0x29da2c['authTimeout']?_0x29da2c[_0x7e20('0x17')]*0x3e8:0x1388};if(_[_0x7e20('0x18')](_0x29da2c[_0x7e20('0x19')])){if(_0x29da2c[_0x7e20('0x1a')]){_0x47327f['user']=_0x29da2c[_0x7e20('0x1b')];_0x47327f['password']=_0x29da2c[_0x7e20('0x1c')];}_0x47327f[_0x7e20('0x1d')]=_0x29da2c[_0x7e20('0x1d')];_0x47327f[_0x7e20('0x1e')]=_0x29da2c[_0x7e20('0x1e')]||0x3e1;if(_0x29da2c[_0x7e20('0x1f')]){_0x47327f[_0x7e20('0x1f')]=!![];}else{_0x47327f[_0x7e20('0x1f')]=![];_0x47327f['autotls']=_0x7e20('0x20');}}else{_0x47327f['user']=_0x29da2c['user'];_0x47327f[_0x7e20('0x1c')]=_0x29da2c[_0x7e20('0x1c')];_0x47327f['host']=utils[_0x7e20('0x21')](_0x29da2c[_0x7e20('0x19')]);_0x47327f[_0x7e20('0x1e')]=0x3e1;_0x47327f['tls']=!![];}_0x47327f[_0x7e20('0x8')]=_0x59177c||_0x29da2c[_0x7e20('0x1b')]||_0x7e20('0x22');return _0x47327f;};EmailImap['prototype']['handleReady']=function(){this[_0x7e20('0x2')][_0x7e20('0x23')](this['mailbox'],![],this['handleOpenBox'][_0x7e20('0xf')](this));};EmailImap[_0x7e20('0x15')]['handleOpenBox']=function(_0x48cfbf,_0x23cdc5){if(_0x48cfbf){this['handleError'](_0x48cfbf,!![]);}else{this[_0x7e20('0x24')](_0x7e20('0x25'),_0x23cdc5);this[_0x7e20('0x26')]();}};EmailImap[_0x7e20('0x15')][_0x7e20('0x27')]=function(_0x3ddf43){if(_0x3ddf43){this[_0x7e20('0x12')](_0x3ddf43,!![]);}else{this[_0x7e20('0x2')]['end']();}};EmailImap['prototype']['readUnseen']=function(){this[_0x7e20('0x2')][_0x7e20('0x28')]([_0x7e20('0x29')],this[_0x7e20('0x2a')][_0x7e20('0xf')](this));};EmailImap[_0x7e20('0x15')][_0x7e20('0x2a')]=function(_0x44cf46,_0x53ee91){if(_0x44cf46){this[_0x7e20('0x12')](_0x44cf46,!![]);}else{if(_0x53ee91[_0x7e20('0x2b')]){try{var _0x452595=this[_0x7e20('0x2')]['fetch'](_0x53ee91,{'bodies':'','markSeen':!![]});_0x452595['on'](_0x7e20('0x2c'),this['handleFetchMessage'][_0x7e20('0xf')](this));_0x452595[_0x7e20('0x10')](_0x7e20('0x2d'),this[_0x7e20('0x2e')]['bind'](this));_0x452595[_0x7e20('0x10')](_0x7e20('0x11'),this[_0x7e20('0x2f')][_0x7e20('0xf')](this));}catch(_0x26450b){logger['error'](_0x26450b);}}else{this[_0x7e20('0x2')][_0x7e20('0x30')](!![],this[_0x7e20('0x27')][_0x7e20('0xf')](this));}}};EmailImap[_0x7e20('0x15')][_0x7e20('0x31')]=function(_0x16103a,_0x405f24){_0x16103a['on'](_0x7e20('0x32'),this[_0x7e20('0x33')]['bind'](this));_0x16103a[_0x7e20('0x10')](_0x7e20('0x34'),this[_0x7e20('0x35')][_0x7e20('0xf')](this));_0x16103a[_0x7e20('0x10')](_0x7e20('0x11'),this[_0x7e20('0x36')]['bind'](this));};EmailImap['prototype'][_0x7e20('0x33')]=function(_0x43c3e4,_0x2c39a0){simpleParser(_0x43c3e4,{'Iconv':Iconv},this[_0x7e20('0x37')][_0x7e20('0xf')](this));};EmailImap[_0x7e20('0x15')][_0x7e20('0x35')]=function(_0x6e02b9){};EmailImap[_0x7e20('0x15')][_0x7e20('0x36')]=function(){};EmailImap['prototype'][_0x7e20('0x37')]=function(_0x1269d4,_0x231065){if(_0x1269d4){logger[_0x7e20('0x2d')](_0x1269d4);}else{var _0x185ce7=this;utils[_0x7e20('0x38')](this[_0x7e20('0xb')],_0x231065,function(_0x1243e7){_0x185ce7['emit'](_0x7e20('0x8'),_0x1243e7);});}};EmailImap[_0x7e20('0x15')][_0x7e20('0x2f')]=function(){this[_0x7e20('0x2')][_0x7e20('0x30')](!![],this['handleCloseBox'][_0x7e20('0xf')](this));};EmailImap[_0x7e20('0x15')][_0x7e20('0x2e')]=function(_0x573e06){this[_0x7e20('0x12')](_0x573e06);this[_0x7e20('0x2')][_0x7e20('0x30')](!![],this[_0x7e20('0x27')][_0x7e20('0xf')](this));};EmailImap[_0x7e20('0x15')][_0x7e20('0x39')]=function(){this[_0x7e20('0x24')](_0x7e20('0x11'));};EmailImap[_0x7e20('0x15')][_0x7e20('0x12')]=function(_0x5a3c2a,_0x4968ba){logger[_0x7e20('0x2d')](_0x7e20('0x12'),this['account'][_0x7e20('0x8')],JSON[_0x7e20('0x3a')](_0x5a3c2a));var _0x4d69c0='';if(_0x5a3c2a){if(_0x5a3c2a[_0x7e20('0x3b')]){_0x4d69c0=_0x5a3c2a[_0x7e20('0x3b')];}else{for(var _0xb2d17f in _0x5a3c2a){if(_0x5a3c2a[_0x7e20('0x3c')](_0xb2d17f)){_0x4d69c0+=_[_0x7e20('0x3d')](_0xb2d17f)+':\x20'+_0x5a3c2a[_0xb2d17f]+'\x0a';}}}}if(_0x4968ba){this[_0x7e20('0x2')][_0x7e20('0x11')]();}else{this[_0x7e20('0x24')](_0x7e20('0x2d'),_0x4d69c0);this[_0x7e20('0x24')]('end');}};module['exports']=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 6d57804..c82b6d3 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 _0xe538=['use','compile','sendMail','toString','verify','exports','nodemailer','prototype','send','createTransport'];(function(_0x1e3822,_0x12d4c3){var _0x5b7104=function(_0x208e42){while(--_0x208e42){_0x1e3822['push'](_0x1e3822['shift']());}};_0x5b7104(++_0x12d4c3);}(_0xe538,0xba));var _0x8e53=function(_0x193bef,_0x229b65){_0x193bef=_0x193bef-0x0;var _0x4c725e=_0xe538[_0x193bef];return _0x4c725e;};'use strict';var nodemailer=require(_0x8e53('0x0'));var BPromise=require('bluebird');var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x8e53('0x1')][_0x8e53('0x2')]=function(_0x3e37b3,_0xe21be3){return new BPromise(function(_0xf4edae,_0x31acba){var _0x1b6aa2=nodemailer[_0x8e53('0x3')](_0x3e37b3);_0x1b6aa2[_0x8e53('0x4')](_0x8e53('0x5'),inlineBase64());_0x1b6aa2[_0x8e53('0x6')](_0xe21be3,function(_0x4e31b5,_0x5af2ae){if(_0x4e31b5){_0x31acba(_0x4e31b5[_0x8e53('0x7')]());}else{_0xf4edae(_0x5af2ae);}});});};EmailSmtp[_0x8e53('0x1')][_0x8e53('0x8')]=function(_0x5df776){return new BPromise(function(_0x283e91,_0x3f01a6){var _0x4712bd=nodemailer[_0x8e53('0x3')](_0x5df776);_0x4712bd[_0x8e53('0x8')](function(_0x2167b1,_0x3ef082){if(_0x2167b1){_0x3f01a6(_0x2167b1[_0x8e53('0x7')]());}else{if(_0x3ef082){_0x283e91(_0x3ef082);}else{_0x3f01a6('Not\x20verifired');}}});});};module[_0x8e53('0x9')]=EmailSmtp; \ No newline at end of file +var _0x7d36=['nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','toString','verify','Not\x20verifired','exports','nodemailer','bluebird'];(function(_0x1a3f6c,_0x2177cc){var _0x361953=function(_0x270019){while(--_0x270019){_0x1a3f6c['push'](_0x1a3f6c['shift']());}};_0x361953(++_0x2177cc);}(_0x7d36,0x1ea));var _0x67d3=function(_0x37c286,_0x2a3368){_0x37c286=_0x37c286-0x0;var _0x2b7ca1=_0x7d36[_0x37c286];return _0x2b7ca1;};'use strict';var nodemailer=require(_0x67d3('0x0'));var BPromise=require(_0x67d3('0x1'));var inlineBase64=require(_0x67d3('0x2'));function EmailSmtp(){}EmailSmtp[_0x67d3('0x3')][_0x67d3('0x4')]=function(_0x466748,_0x1538ed){return new BPromise(function(_0x4d83e2,_0x4872cb){var _0x599c01=nodemailer[_0x67d3('0x5')](_0x466748);_0x599c01[_0x67d3('0x6')](_0x67d3('0x7'),inlineBase64());_0x599c01['sendMail'](_0x1538ed,function(_0x386b51,_0x16323d){if(_0x386b51){_0x4872cb(_0x386b51[_0x67d3('0x8')]());}else{_0x4d83e2(_0x16323d);}});});};EmailSmtp[_0x67d3('0x3')][_0x67d3('0x9')]=function(_0x2b5ca8){return new BPromise(function(_0x3d2ea7,_0x49f202){var _0x49b395=nodemailer[_0x67d3('0x5')](_0x2b5ca8);_0x49b395[_0x67d3('0x9')](function(_0x417f1a,_0x82a495){if(_0x417f1a){_0x49f202(_0x417f1a['toString']());}else{if(_0x82a495){_0x3d2ea7(_0x82a495);}else{_0x49f202(_0x67d3('0xa'));}}});});};module[_0x67d3('0xb')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 832bb75..db2538e 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 _0x3af5=['hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','path','util','email','head','address','anonymous','generate','@xcally.com','name','substring','indexOf','split','length','slice','value','pop','html','test','replace','includes','\x20[Attachment:\x20','\x20]','body','message','originTo','isEmpty','originCc','bcc','attachments','attach','%s-%s','now','join','root','server/files/attachments/','writeFileSync','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','parser','from','subject','inReplyTo','date','format','YYYY-MM-DD\x20HH:mm:ss','textAsHtml','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','messageId','parseBuffer','first','Attachments','Title','Data','

Empty\x20message

','getHost','imap.gmail.com','imap.mail.yahoo.com'];(function(_0x21dff3,_0x481feb){var _0x2465ee=function(_0x270d39){while(--_0x270d39){_0x21dff3['push'](_0x21dff3['shift']());}};_0x2465ee(++_0x481feb);}(_0x3af5,0x1d3));var _0x53af=function(_0x3e9402,_0x130b9e){_0x3e9402=_0x3e9402-0x0;var _0x1f5996=_0x3af5[_0x3e9402];return _0x1f5996;};'use strict';var _=require(_0x53af('0x0'));var moment=require(_0x53af('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x53af('0x2'));var util=require(_0x53af('0x3'));var tnef=require('node-tnef');var logger=require('../../../config/logger')(_0x53af('0x4'));var config=require('../../../config/environment');function getAddress(_0x518926){var _0x205be1=_[_0x53af('0x5')](_0x518926['value']);return _0x205be1&&_0x205be1[_0x53af('0x6')]?_0x205be1['address']:_0x53af('0x7')+random[_0x53af('0x8')](0x6)+_0x53af('0x9');}function getFirstName(_0x22c0cb){var _0x43f1b4=_[_0x53af('0x5')](_0x22c0cb['value']);if(_0x43f1b4&&_0x43f1b4['name']){if(_0x43f1b4[_0x53af('0xa')]==_0x43f1b4['address']){return _0x43f1b4[_0x53af('0xa')][_0x53af('0xb')](0x0,_0x43f1b4['name'][_0x53af('0xc')]('@'));}var _0x1a08ca=_0x43f1b4['name'][_0x53af('0xd')](/\s+/);return _0x1a08ca[_0x53af('0xe')]>0x1?_0x1a08ca[_0x53af('0xf')](0x0,-0x1)['join']('\x20'):_0x43f1b4[_0x53af('0xa')];}return'Anonymous';}function getLastName(_0x1a2801){var _0x27d451=_[_0x53af('0x5')](_0x1a2801[_0x53af('0x10')]);if(_0x27d451&&_0x27d451[_0x53af('0xa')]){var _0x352655=_0x27d451[_0x53af('0xa')][_0x53af('0xd')](/\s+/);return _0x352655[_0x53af('0xe')]>0x1?_0x352655[_0x53af('0x11')]():'';}return'';}function getMails(_0x4d601a,_0x10d18f){var _0x2db860='';for(var _0x29bb86=0x0;_0x29bb86<_0x10d18f[_0x53af('0x10')][_0x53af('0xe')];_0x29bb86+=0x1){if(_0x10d18f[_0x53af('0x10')][_0x29bb86][_0x53af('0x6')]!==_0x4d601a){if(!_['isEmpty'](_0x2db860)){_0x2db860+=',';}_0x2db860+=_0x10d18f[_0x53af('0x10')][_0x29bb86][_0x53af('0xa')]||_0x10d18f[_0x53af('0x10')][_0x29bb86][_0x53af('0x6')]||'';_0x2db860+='\x20<';_0x2db860+=_0x10d18f['value'][_0x29bb86]['address']?_0x10d18f[_0x53af('0x10')][_0x29bb86][_0x53af('0x6')]:_0x53af('0x7')+random['generate'](0x6)+_0x53af('0x9');_0x2db860+='>';}}return _0x2db860;}function parseEmail(_0x16473a,_0x46d0d5,_0x3cd780){if(_0x46d0d5[_0x53af('0x12')]){var _0x217426=/)<[^<]*)*<\/script>/gi;while(_0x217426[_0x53af('0x13')](_0x46d0d5[_0x53af('0x12')])){_0x46d0d5['html']=_0x46d0d5[_0x53af('0x12')][_0x53af('0x14')](_0x217426,'');}if(_0x46d0d5[_0x53af('0x12')][_0x53af('0x15')](_0x53af('0x16'))){var _0x250edb=[];_0x46d0d5['attachments'][_0x53af('0x17')](_0x20cc70=>{_0x250edb[_0x53af('0x18')](_0x20cc70[_0x53af('0x19')]);});var _0x480665=/]+>/g;var _0x27dbd9=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x17d47d=_0x46d0d5[_0x53af('0x12')][_0x53af('0x14')](_0x27dbd9,_0x53af('0x1a'));var _0x152dcc=_0x17d47d[_0x53af('0x14')](_0x480665,_0x53af('0x1b'));for(let _0x5af078=0x0;_0x5af078<_0x250edb[_0x53af('0xe')];_0x5af078++){var _0x1ec47c=_0x152dcc[_0x53af('0x14')](_0x53af('0x1b'),_0x53af('0x1c')+_0x250edb[_0x5af078]+_0x53af('0x1d'));_0x152dcc=_0x1ec47c;}_0x46d0d5[_0x53af('0x12')]=_0x152dcc;}_0x3cd780['body']=_0x46d0d5['html'];}else{_0x3cd780[_0x53af('0x1e')]=_0x46d0d5['textAsHtml'];}if(_0x3cd780[_0x53af('0x1e')]){_0x3cd780[_0x53af('0x1e')]=_0x3cd780[_0x53af('0x1e')][_0x53af('0x14')](/0x0){var _0x4b83a8=[_0x53af('0x2f'),_0x53af('0x30'),_0x53af('0x31')];for(var _0x411563=0x0;_0x411563<_0x46d0d5['headerLines'][_0x53af('0xe')];_0x411563++){var _0x2e7df8=_[_0x53af('0xc')](_0x4b83a8,_0x46d0d5[_0x53af('0x2e')][_0x411563][_0x53af('0x32')]);if(_0x2e7df8>=0x0){_0x3cd780['isAutoreply']=!![];}}}return _0x3cd780;}exports[_0x53af('0x33')]=function(_0x3490ff,_0x46e4d9,_0xd636d3){var _0x36dfeb={'from':getAddress(_0x46e4d9[_0x53af('0x34')]),'firstName':getFirstName(_0x46e4d9[_0x53af('0x34')]),'lastName':getLastName(_0x46e4d9['from']),'mapKey':_0x53af('0x4'),'message':{'from':getMails(_0x3490ff[_0x53af('0x4')],_0x46e4d9[_0x53af('0x34')]),'to':_0x3490ff['email'],'cc':'','subject':_0x46e4d9[_0x53af('0x35')]||'','messageId':_0x46e4d9['messageId'],'inReplyTo':_0x46e4d9[_0x53af('0x36')],'sentAt':moment(_0x46e4d9[_0x53af('0x37')])[_0x53af('0x38')](_0x53af('0x39')),'attach':![],'attachments':[]}};if(!_0x46e4d9[_0x53af('0x12')]&&!_0x46e4d9[_0x53af('0x3a')]){var _0x275e2d=_['filter'](_0x46e4d9[_0x53af('0x24')],{'contentType':_0x53af('0x3b')});if(_0x275e2d[_0x53af('0xe')]){logger[_0x53af('0x3c')](util[_0x53af('0x38')](_0x53af('0x3d'),_0x46e4d9[_0x53af('0x3e')]));tnef[_0x53af('0x3f')](_[_0x53af('0x40')](_0x275e2d)['content'],function(_0x4f95c3,_0x3b30d6){if(_0x3b30d6){_0x46e4d9[_0x53af('0x12')]=_0x3b30d6['BodyHTML']||'

Empty\x20message

';if(_0x3b30d6[_0x53af('0x41')]){for(var _0x27c961=0x0;_0x27c961<_0x3b30d6[_0x53af('0x41')][_0x53af('0xe')];_0x27c961++){var _0x1593ee=_0x3b30d6[_0x53af('0x41')][_0x27c961];_0x36dfeb['message'][_0x53af('0x24')][_0x53af('0x18')]({'filename':_0x1593ee[_0x53af('0x42')],'content':Buffer[_0x53af('0x34')](_0x1593ee[_0x53af('0x43')])});}}}_0xd636d3(parseEmail(_0x3490ff,_0x46e4d9,_0x36dfeb));});}else{_0x46e4d9[_0x53af('0x12')]=_0x53af('0x44');_0xd636d3(parseEmail(_0x3490ff,_0x46e4d9,_0x36dfeb));}}else{_0xd636d3(parseEmail(_0x3490ff,_0x46e4d9,_0x36dfeb));}};exports[_0x53af('0x45')]=function(_0x4dfc6d){switch(_0x4dfc6d){case'gmail':return _0x53af('0x46');case'yahoo':return _0x53af('0x47');case _0x53af('0x48'):return _0x53af('0x49');case _0x53af('0x4a'):return _0x53af('0x4b');}return _0x53af('0x4c');}; \ No newline at end of file +var _0xfa9f=['BodyHTML','

Empty\x20message

','Attachments','getHost','gmail','imap.gmail.com','imap-mail.outlook.com','outlook365','127.0.0.1','moment','randomstring','path','util','node-tnef','email','value','anonymous','generate','@xcally.com','head','name','address','substring','indexOf','length','slice','join','Anonymous','pop','isEmpty','html','test','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','0x1?_0x3fb095[_0xffa9('0x10')](0x0,-0x1)[_0xffa9('0x11')]('\x20'):_0x5cc8b2[_0xffa9('0xb')];}return _0xffa9('0x12');}function getLastName(_0x78f311){var _0x10a76e=_[_0xffa9('0xa')](_0x78f311[_0xffa9('0x6')]);if(_0x10a76e&&_0x10a76e[_0xffa9('0xb')]){var _0x5812d0=_0x10a76e[_0xffa9('0xb')]['split'](/\s+/);return _0x5812d0[_0xffa9('0xf')]>0x1?_0x5812d0[_0xffa9('0x13')]():'';}return'';}function getMails(_0x54cae8,_0x7ad8ba){var _0x2eacc0='';for(var _0x1ce6c3=0x0;_0x1ce6c3<_0x7ad8ba['value'][_0xffa9('0xf')];_0x1ce6c3+=0x1){if(_0x7ad8ba[_0xffa9('0x6')][_0x1ce6c3][_0xffa9('0xc')]!==_0x54cae8){if(!_[_0xffa9('0x14')](_0x2eacc0)){_0x2eacc0+=',';}_0x2eacc0+=_0x7ad8ba['value'][_0x1ce6c3][_0xffa9('0xb')]||_0x7ad8ba['value'][_0x1ce6c3][_0xffa9('0xc')]||'';_0x2eacc0+='\x20<';_0x2eacc0+=_0x7ad8ba[_0xffa9('0x6')][_0x1ce6c3][_0xffa9('0xc')]?_0x7ad8ba[_0xffa9('0x6')][_0x1ce6c3][_0xffa9('0xc')]:_0xffa9('0x7')+random['generate'](0x6)+_0xffa9('0x9');_0x2eacc0+='>';}}return _0x2eacc0;}function parseEmail(_0x22121d,_0x41eb49,_0x27f229){if(_0x41eb49[_0xffa9('0x15')]){var _0x2c9c20=/)<[^<]*)*<\/script>/gi;while(_0x2c9c20[_0xffa9('0x16')](_0x41eb49[_0xffa9('0x15')])){_0x41eb49[_0xffa9('0x15')]=_0x41eb49['html']['replace'](_0x2c9c20,'');}if(_0x41eb49[_0xffa9('0x15')][_0xffa9('0x17')](_0xffa9('0x18'))){var _0x48a6aa=[];_0x41eb49['attachments'][_0xffa9('0x19')](_0xb9e513=>{_0x48a6aa[_0xffa9('0x1a')](_0xb9e513['filename']);});var _0x573a85=/]+>/g;var _0x43f0c7=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x57af5b=_0x41eb49[_0xffa9('0x15')][_0xffa9('0x1b')](_0x43f0c7,_0xffa9('0x1c'));var _0x331606=_0x57af5b[_0xffa9('0x1b')](_0x573a85,_0xffa9('0x1d'));for(let _0x34611e=0x0;_0x34611e<_0x48a6aa['length'];_0x34611e++){var _0x23e449=_0x331606[_0xffa9('0x1b')](_0xffa9('0x1d'),_0xffa9('0x1e')+_0x48a6aa[_0x34611e]+_0xffa9('0x1f'));_0x331606=_0x23e449;}_0x41eb49[_0xffa9('0x15')]=_0x331606;}_0x27f229['body']=_0x41eb49['html'];}else{_0x27f229[_0xffa9('0x20')]=_0x41eb49[_0xffa9('0x21')];}if(_0x27f229[_0xffa9('0x20')]){_0x27f229[_0xffa9('0x20')]=_0x27f229[_0xffa9('0x20')][_0xffa9('0x1b')](/0x0){var _0x410d17=[_0xffa9('0x30'),_0xffa9('0x31'),'Precedence:\x20auto_reply'];for(var _0x503c8a=0x0;_0x503c8a<_0x41eb49[_0xffa9('0x2f')][_0xffa9('0xf')];_0x503c8a++){var _0x39a0e5=_[_0xffa9('0xe')](_0x410d17,_0x41eb49['headerLines'][_0x503c8a][_0xffa9('0x32')]);if(_0x39a0e5>=0x0){_0x27f229[_0xffa9('0x33')]=!![];}}}return _0x27f229;}exports[_0xffa9('0x34')]=function(_0x358bd3,_0x2d3500,_0xa7013c){var _0x2a25f2={'from':getAddress(_0x2d3500[_0xffa9('0x35')]),'firstName':getFirstName(_0x2d3500[_0xffa9('0x35')]),'lastName':getLastName(_0x2d3500[_0xffa9('0x35')]),'mapKey':_0xffa9('0x5'),'message':{'from':getMails(_0x358bd3[_0xffa9('0x5')],_0x2d3500[_0xffa9('0x35')]),'to':_0x358bd3[_0xffa9('0x5')],'cc':'','subject':_0x2d3500[_0xffa9('0x36')]||'','messageId':_0x2d3500['messageId'],'inReplyTo':_0x2d3500['inReplyTo'],'sentAt':moment(_0x2d3500[_0xffa9('0x37')])[_0xffa9('0x2a')](_0xffa9('0x38')),'attach':![],'attachments':[]}};if(!_0x2d3500[_0xffa9('0x15')]&&!_0x2d3500[_0xffa9('0x21')]){var _0x3e59df=_['filter'](_0x2d3500[_0xffa9('0x27')],{'contentType':_0xffa9('0x39')});if(_0x3e59df['length']){logger['info'](util[_0xffa9('0x2a')](_0xffa9('0x3a'),_0x2d3500[_0xffa9('0x3b')]));tnef['parseBuffer'](_['first'](_0x3e59df)['content'],function(_0x22c3a5,_0x37be15){if(_0x37be15){_0x2d3500[_0xffa9('0x15')]=_0x37be15[_0xffa9('0x3c')]||_0xffa9('0x3d');if(_0x37be15[_0xffa9('0x3e')]){for(var _0x2fff16=0x0;_0x2fff16<_0x37be15['Attachments'][_0xffa9('0xf')];_0x2fff16++){var _0x33e1f5=_0x37be15[_0xffa9('0x3e')][_0x2fff16];_0x2a25f2[_0xffa9('0x23')][_0xffa9('0x27')][_0xffa9('0x1a')]({'filename':_0x33e1f5['Title'],'content':Buffer[_0xffa9('0x35')](_0x33e1f5['Data'])});}}}_0xa7013c(parseEmail(_0x358bd3,_0x2d3500,_0x2a25f2));});}else{_0x2d3500[_0xffa9('0x15')]=_0xffa9('0x3d');_0xa7013c(parseEmail(_0x358bd3,_0x2d3500,_0x2a25f2));}}else{_0xa7013c(parseEmail(_0x358bd3,_0x2d3500,_0x2a25f2));}};exports[_0xffa9('0x3f')]=function(_0x1141cc){switch(_0x1141cc){case _0xffa9('0x40'):return _0xffa9('0x41');case'yahoo':return'imap.mail.yahoo.com';case'hotmail':return _0xffa9('0x42');case _0xffa9('0x43'):return'outlook.office365.com';}return _0xffa9('0x44');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index f409a45..8fbe83a 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 _0x6874=['SERV','active','Smtp','exports','name','Service','key'];(function(_0x42cb74,_0xd030f0){var _0x264737=function(_0x4ac595){while(--_0x4ac595){_0x42cb74['push'](_0x42cb74['shift']());}};_0x264737(++_0xd030f0);}(_0x6874,0x177));var _0x4687=function(_0x15291,_0x95ec05){_0x15291=_0x15291-0x0;var _0x2c0938=_0x6874[_0x15291];return _0x2c0938;};'use strict';var _=require('lodash');function MailAccount(_0x4f47e3){this['id']=_0x4f47e3['id']||0x0;this[_0x4687('0x0')]=_0x4f47e3[_0x4687('0x0')]||_0x4687('0x1');this[_0x4687('0x2')]=_0x4f47e3['key']||_0x4687('0x3');this['active']=_0x4f47e3[_0x4687('0x4')]||![];this['Imap']=_0x4f47e3['Imap']||[];this[_0x4687('0x5')]=_0x4f47e3[_0x4687('0x5')]||[];}module[_0x4687('0x6')]=MailAccount; \ No newline at end of file +var _0xb03b=['name','key','SERV','active','Smtp','exports','lodash'];(function(_0x460150,_0x232949){var _0x340677=function(_0x5b7e32){while(--_0x5b7e32){_0x460150['push'](_0x460150['shift']());}};_0x340677(++_0x232949);}(_0xb03b,0x148));var _0xbb03=function(_0x4936bb,_0x57d99d){_0x4936bb=_0x4936bb-0x0;var _0x3909c3=_0xb03b[_0x4936bb];return _0x3909c3;};'use strict';var _=require(_0xbb03('0x0'));function MailAccount(_0x56003c){this['id']=_0x56003c['id']||0x0;this[_0xbb03('0x1')]=_0x56003c[_0xbb03('0x1')]||'Service';this[_0xbb03('0x2')]=_0x56003c[_0xbb03('0x2')]||_0xbb03('0x3');this['active']=_0x56003c[_0xbb03('0x4')]||![];this['Imap']=_0x56003c['Imap']||[];this[_0xbb03('0x5')]=_0x56003c['Smtp']||[];}module[_0xbb03('0x6')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index e50af39..20cc23e 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 _0x3991=['hasOwnProperty','mergeFromDatabase','prototype','initMailAccounts','length','isUndefined','merge','exports','lodash','../model/mailAccount','mailAccounts','mapKeys'];(function(_0x361638,_0x3eba85){var _0x5c5c31=function(_0x920588){while(--_0x920588){_0x361638['push'](_0x361638['shift']());}};_0x5c5c31(++_0x3eba85);}(_0x3991,0xec));var _0x1399=function(_0x403a45,_0x31dbc6){_0x403a45=_0x403a45-0x0;var _0x291a95=_0x3991[_0x403a45];return _0x291a95;};'use strict';var _=require(_0x1399('0x0'));var MailAccount=require(_0x1399('0x1'));var Realtime=function(){this[_0x1399('0x2')]={};};function freeIsNotKey(_0x10cb7e,_0x2bc97e,_0x52cfff){var _0x1aaeb4=_[_0x1399('0x3')](_0x10cb7e,function(_0x58f224,_0x5a2a2e){return _0x58f224[_0x52cfff];});for(var _0x5e9c0e in _0x2bc97e){if(_0x2bc97e[_0x1399('0x4')](_0x5e9c0e)){if(!_0x1aaeb4[_0x5e9c0e]){delete _0x2bc97e[_0x5e9c0e];}}}}Realtime['prototype'][_0x1399('0x5')]=function(_0x11fc69,_0x1309f5){for(var _0x34e508 in _0x1309f5){if(_0x11fc69[_0x1399('0x4')](_0x34e508)){_0x11fc69[_0x34e508]=_0x1309f5[_0x34e508];}}};Realtime[_0x1399('0x6')][_0x1399('0x7')]=function(){var _0xa95815=this;return function(_0x7c939e){if(_0x7c939e){freeIsNotKey(_0x7c939e,_0xa95815[_0x1399('0x2')],'id');for(var _0x3b3619=0x0,_0x744b18={},_0x25304e={};_0x3b3619<_0x7c939e[_0x1399('0x8')];_0x3b3619+=0x1){_0x744b18=_0x7c939e[_0x3b3619];if(_[_0x1399('0x9')](_0xa95815[_0x1399('0x2')][_0x744b18['id']])){_0xa95815['mailAccounts'][_0x744b18['id']]=new MailAccount(_0x744b18);}else{_[_0x1399('0xa')](_0xa95815[_0x1399('0x2')][_0x744b18['id']],_0x744b18);}}}return _0xa95815['mailAccounts'];};};module[_0x1399('0xb')]=Realtime; \ No newline at end of file +var _0x5097=['prototype','mergeFromDatabase','merge','exports','mailAccounts','mapKeys','hasOwnProperty'];(function(_0x3d8434,_0x41b651){var _0x1838e3=function(_0x1f1e2c){while(--_0x1f1e2c){_0x3d8434['push'](_0x3d8434['shift']());}};_0x1838e3(++_0x41b651);}(_0x5097,0x10e));var _0x7509=function(_0x165495,_0x1e6395){_0x165495=_0x165495-0x0;var _0x207a6a=_0x5097[_0x165495];return _0x207a6a;};'use strict';var _=require('lodash');var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0x7509('0x0')]={};};function freeIsNotKey(_0x4f4b8e,_0x56ec86,_0x3717b8){var _0x3d11d4=_[_0x7509('0x1')](_0x4f4b8e,function(_0x207b90,_0x4882a6){return _0x207b90[_0x3717b8];});for(var _0x3bec14 in _0x56ec86){if(_0x56ec86[_0x7509('0x2')](_0x3bec14)){if(!_0x3d11d4[_0x3bec14]){delete _0x56ec86[_0x3bec14];}}}}Realtime[_0x7509('0x3')][_0x7509('0x4')]=function(_0x173237,_0x36e375){for(var _0x2c269c in _0x36e375){if(_0x173237[_0x7509('0x2')](_0x2c269c)){_0x173237[_0x2c269c]=_0x36e375[_0x2c269c];}}};Realtime[_0x7509('0x3')]['initMailAccounts']=function(){var _0x154a8d=this;return function(_0x3964c2){if(_0x3964c2){freeIsNotKey(_0x3964c2,_0x154a8d[_0x7509('0x0')],'id');for(var _0x33de6c=0x0,_0x5cb040={},_0x5f3cb5={};_0x33de6c<_0x3964c2['length'];_0x33de6c+=0x1){_0x5cb040=_0x3964c2[_0x33de6c];if(_['isUndefined'](_0x154a8d['mailAccounts'][_0x5cb040['id']])){_0x154a8d['mailAccounts'][_0x5cb040['id']]=new MailAccount(_0x5cb040);}else{_[_0x7509('0x5')](_0x154a8d['mailAccounts'][_0x5cb040['id']],_0x5cb040);}}}return _0x154a8d[_0x7509('0x0')];};};module[_0x7509('0x6')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 1f8e495..8493c18 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 _0x36e0=['service','active','key','TemplateId','MailServerIn','Imap','MailServerOut','Smtp','getMailAccount','notify','Request','NotifyMailAccount','../client','getMailAccounts','GetMailAccount','name'];(function(_0xf9a6cf,_0x11870e){var _0x59e2bc=function(_0x1cd606){while(--_0x1cd606){_0xf9a6cf['push'](_0xf9a6cf['shift']());}};_0x59e2bc(++_0x11870e);}(_0x36e0,0x15c));var _0x036e=function(_0x564d93,_0x4f1fa5){_0x564d93=_0x564d93-0x0;var _0x2d491d=_0x36e0[_0x564d93];return _0x2d491d;};'use strict';var client=require(_0x036e('0x0'));exports[_0x036e('0x1')]=function(){return function(){return client['Request'](_0x036e('0x2'),{'options':{'attributes':['id',_0x036e('0x3'),_0x036e('0x4'),'email',_0x036e('0x5'),_0x036e('0x6'),'ListId',_0x036e('0x7')],'raw':![],'include':[{'model':_0x036e('0x8'),'as':_0x036e('0x9')},{'model':_0x036e('0xa'),'as':_0x036e('0xb')}]},'log':_0x036e('0xc')});};};exports[_0x036e('0xd')]=function(_0x5e5194,_0x592839){return client[_0x036e('0xe')](_0x036e('0xf'),{'account':{'id':_0x5e5194},'body':_0x592839,'log':_0x036e('0xf')});}; \ No newline at end of file +var _0x5e6a=['MailServerIn','Imap','Smtp','notify','NotifyMailAccount','../client','Request','GetMailAccount','name','service','email','active','key','ListId','TemplateId'];(function(_0x5a6061,_0x3bd9ec){var _0x4aa6c9=function(_0x5d5e0f){while(--_0x5d5e0f){_0x5a6061['push'](_0x5a6061['shift']());}};_0x4aa6c9(++_0x3bd9ec);}(_0x5e6a,0x1e5));var _0xa5e6=function(_0x49684e,_0x9a24fb){_0x49684e=_0x49684e-0x0;var _0x54062f=_0x5e6a[_0x49684e];return _0x54062f;};'use strict';var client=require(_0xa5e6('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0xa5e6('0x1')](_0xa5e6('0x2'),{'options':{'attributes':['id',_0xa5e6('0x3'),_0xa5e6('0x4'),_0xa5e6('0x5'),_0xa5e6('0x6'),_0xa5e6('0x7'),_0xa5e6('0x8'),_0xa5e6('0x9')],'raw':![],'include':[{'model':_0xa5e6('0xa'),'as':_0xa5e6('0xb')},{'model':'MailServerOut','as':_0xa5e6('0xc')}]},'log':'getMailAccount'});};};exports[_0xa5e6('0xd')]=function(_0x39fe06,_0x12d425){return client[_0xa5e6('0x1')](_0xa5e6('0xe'),{'account':{'id':_0x39fe06},'body':_0x12d425,'log':_0xa5e6('0xe')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 3d1bc1e..42b853e 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 _0x4077=['ShowSetting','loginMailFrequency','GetSettings','../client','getSettings','Request'];(function(_0x3c085a,_0x45f411){var _0x231943=function(_0x53b366){while(--_0x53b366){_0x3c085a['push'](_0x3c085a['shift']());}};_0x231943(++_0x45f411);}(_0x4077,0x141));var _0x7407=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4077[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x7407('0x0'));exports[_0x7407('0x1')]=function(){return client[_0x7407('0x2')](_0x7407('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x7407('0x4')]},'log':_0x7407('0x5')});}; \ No newline at end of file +var _0x9569=['ShowSetting','loginMailFrequency','../client'];(function(_0x50653f,_0x1f76b5){var _0x57d8e7=function(_0x33e2af){while(--_0x33e2af){_0x50653f['push'](_0x50653f['shift']());}};_0x57d8e7(++_0x1f76b5);}(_0x9569,0x18b));var _0x9956=function(_0x5d97ca,_0x32b0b1){_0x5d97ca=_0x5d97ca-0x0;var _0x253439=_0x9569[_0x5d97ca];return _0x253439;};'use strict';var client=require(_0x9956('0x0'));exports['getSettings']=function(){return client['Request'](_0x9956('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x9956('0x2')]},'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 04c8099..ed195f5 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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 605d33e..cf3573f 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 _0x148e=['ioredis','../../config/environment','timeout','port','polling','redis','adapter','socket.io-redis','default','../../config/express','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','sticky-session'];(function(_0x1f594e,_0x5f0879){var _0x33e1c9=function(_0x34325b){while(--_0x34325b){_0x1f594e['push'](_0x1f594e['shift']());}};_0x33e1c9(++_0x5f0879);}(_0x148e,0xa3));var _0xe148=function(_0x239c13,_0x854fd1){_0x239c13=_0x239c13-0x0;var _0x5ab20b=_0x148e[_0x239c13];return _0x5ab20b;};'use strict';var _=require(_0xe148('0x0'));var http=require('http');var express=require('express');var sticky=require(_0xe148('0x1'));var Redis=require(_0xe148('0x2'));var config=require(_0xe148('0x3'));var app=express();var server=http['createServer'](app);server[_0xe148('0x4')]=0xdbba0;if(sticky['listen'](server,config[_0xe148('0x5')])){var socketio=require('socket.io')(server,{'transports':['websocket',_0xe148('0x6')]});config[_0xe148('0x7')]=_['defaults'](config[_0xe148('0x7')],{'host':'localhost','port':0x18eb});socketio[_0xe148('0x8')](require(_0xe148('0x9'))({'pubClient':new Redis(config[_0xe148('0x7')]),'subClient':new Redis(config[_0xe148('0x7')])}));require('../../config/triggers')[_0xe148('0xa')]();require('../../config/socketio')[_0xe148('0xa')](socketio);require(_0xe148('0xb'))[_0xe148('0xa')](app);require('../../routes')['default'](app);}else{server['once']('listening',function(){console[_0xe148('0xc')](_0xe148('0xd'),config['port']);});}exports=module[_0xe148('0xe')]=app; \ No newline at end of file +var _0xf8ad=['listen','port','websocket','redis','localhost','adapter','socket.io-redis','../../config/triggers','../../config/socketio','default','../../config/express','../../routes','once','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout'];(function(_0x410981,_0x546ec1){var _0x14296e=function(_0xf77c99){while(--_0xf77c99){_0x410981['push'](_0x410981['shift']());}};_0x14296e(++_0x546ec1);}(_0xf8ad,0xd0));var _0xdf8a=function(_0x1f9f77,_0x20a988){_0x1f9f77=_0x1f9f77-0x0;var _0x52d64e=_0xf8ad[_0x1f9f77];return _0x52d64e;};'use strict';var _=require(_0xdf8a('0x0'));var http=require(_0xdf8a('0x1'));var express=require(_0xdf8a('0x2'));var sticky=require(_0xdf8a('0x3'));var Redis=require(_0xdf8a('0x4'));var config=require(_0xdf8a('0x5'));var app=express();var server=http[_0xdf8a('0x6')](app);server[_0xdf8a('0x7')]=0xdbba0;if(sticky[_0xdf8a('0x8')](server,config[_0xdf8a('0x9')])){var socketio=require('socket.io')(server,{'transports':[_0xdf8a('0xa'),'polling']});config[_0xdf8a('0xb')]=_['defaults'](config['redis'],{'host':_0xdf8a('0xc'),'port':0x18eb});socketio[_0xdf8a('0xd')](require(_0xdf8a('0xe'))({'pubClient':new Redis(config[_0xdf8a('0xb')]),'subClient':new Redis(config[_0xdf8a('0xb')])}));require(_0xdf8a('0xf'))['default']();require(_0xdf8a('0x10'))[_0xdf8a('0x11')](socketio);require(_0xdf8a('0x12'))['default'](app);require(_0xdf8a('0x13'))[_0xdf8a('0x11')](app);}else{server[_0xdf8a('0x14')]('listening',function(){console[_0xdf8a('0x15')](_0xdf8a('0x16'),config[_0xdf8a('0x9')]);});}exports=module[_0xdf8a('0x17')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 1066394..827b4e1 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 _0xa8f0=['request','then','debug','error','rpc','result','catch','jayson/promise','bluebird','../../config/logger','routing','http','Request'];(function(_0x4e7a49,_0x5dd834){var _0x38b82b=function(_0x1eff1c){while(--_0x1eff1c){_0x4e7a49['push'](_0x4e7a49['shift']());}};_0x38b82b(++_0x5dd834);}(_0xa8f0,0x19a));var _0x0a8f=function(_0x448313,_0x2b5e0f){_0x448313=_0x448313-0x0;var _0x3740be=_0xa8f0[_0x448313];return _0x3740be;};'use strict';var jayson=require(_0x0a8f('0x0'));var BPromise=require(_0x0a8f('0x1'));var logger=require(_0x0a8f('0x2'))(_0x0a8f('0x3'));var client=jayson['client'][_0x0a8f('0x4')]({'port':0x2329});client[_0x0a8f('0x5')]=function(_0x3e899c,_0x1c2896){return new BPromise(function(_0x3b2e4e,_0x4d6a12){return client[_0x0a8f('0x6')](_0x3e899c,_0x1c2896)[_0x0a8f('0x7')](function(_0x30c03e){logger[_0x0a8f('0x8')]('rpc',_0x0a8f('0x3'),_0x3e899c,_0x1c2896,_0x30c03e);if(_0x30c03e[_0x0a8f('0x9')]){logger[_0x0a8f('0x9')](_0x0a8f('0xa'),_0x0a8f('0x3'),_0x3e899c,_0x30c03e[_0x0a8f('0x9')]['message'],_0x1c2896);return _0x4d6a12(_0x30c03e[_0x0a8f('0x9')]['message']);}else{return _0x3b2e4e(_0x30c03e[_0x0a8f('0xb')]);}})[_0x0a8f('0xc')](function(_0x16475b){logger[_0x0a8f('0x9')](_0x0a8f('0xa'),_0x0a8f('0x3'),_0x3e899c,_0x16475b,_0x1c2896);return _0x4d6a12(_0x16475b);});});};module['exports']=client; \ No newline at end of file +var _0xe319=['bluebird','../../config/logger','routing','client','http','Request','request','debug','rpc','error','message','exports','jayson/promise'];(function(_0x14e2d2,_0x474a70){var _0x41e76c=function(_0x891f90){while(--_0x891f90){_0x14e2d2['push'](_0x14e2d2['shift']());}};_0x41e76c(++_0x474a70);}(_0xe319,0x103));var _0x9e31=function(_0x382fe6,_0x40b548){_0x382fe6=_0x382fe6-0x0;var _0x155c15=_0xe319[_0x382fe6];return _0x155c15;};'use strict';var jayson=require(_0x9e31('0x0'));var BPromise=require(_0x9e31('0x1'));var logger=require(_0x9e31('0x2'))(_0x9e31('0x3'));var client=jayson[_0x9e31('0x4')][_0x9e31('0x5')]({'port':0x2329});client[_0x9e31('0x6')]=function(_0x1a306d,_0x3c6fe5){return new BPromise(function(_0x45b44f,_0x5cb4a8){return client[_0x9e31('0x7')](_0x1a306d,_0x3c6fe5)['then'](function(_0x314db0){logger[_0x9e31('0x8')](_0x9e31('0x9'),_0x9e31('0x3'),_0x1a306d,_0x3c6fe5,_0x314db0);if(_0x314db0[_0x9e31('0xa')]){logger[_0x9e31('0xa')]('rpc',_0x9e31('0x3'),_0x1a306d,_0x314db0[_0x9e31('0xa')]['message'],_0x3c6fe5);return _0x5cb4a8(_0x314db0[_0x9e31('0xa')][_0x9e31('0xb')]);}else{return _0x45b44f(_0x314db0['result']);}})['catch'](function(_0x4a146c){logger['error'](_0x9e31('0x9'),_0x9e31('0x3'),_0x1a306d,_0x4a146c,_0x3c6fe5);return _0x5cb4a8(_0x4a146c);});});};module[_0x9e31('0xc')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 9ca3767..4fb07c4 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 _0x9a15=['initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','getAgents','then','initAgents','getIntervals','initIntervals','getChatQueues','initChatQueues','initSmsQueues'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x9a15,0x181));var _0x59a1=function(_0x1a9c28,_0x4ca62c){_0x1a9c28=_0x1a9c28-0x0;var _0x2aa196=_0x9a15[_0x1a9c28];return _0x2aa196;};'use strict';var BPromise=require(_0x59a1('0x0'));var server=require(_0x59a1('0x1'));var Realtime=require(_0x59a1('0x2'));var user=require(_0x59a1('0x3'));var interval=require(_0x59a1('0x4'));var openchannelQueue=require(_0x59a1('0x5'));var chatQueue=require(_0x59a1('0x6'));var smsQueue=require(_0x59a1('0x7'));var mailQueue=require(_0x59a1('0x8'));var faxQueue=require(_0x59a1('0x9'));var whatsappQueue=require(_0x59a1('0xa'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x59a1('0xb')]()['then'](user[_0x59a1('0xc')]())[_0x59a1('0xd')](realtime[_0x59a1('0xe')]())['then'](interval[_0x59a1('0xf')]())['then'](realtime[_0x59a1('0x10')]())['then'](openchannelQueue['getOpenchannelQueues']())['then'](realtime['initOpenchannelQueues']())['then'](chatQueue[_0x59a1('0x11')]())[_0x59a1('0xd')](realtime[_0x59a1('0x12')]())[_0x59a1('0xd')](smsQueue['getSmsQueues']())[_0x59a1('0xd')](realtime[_0x59a1('0x13')]())[_0x59a1('0xd')](mailQueue['getMailQueues']())[_0x59a1('0xd')](realtime[_0x59a1('0x14')]())[_0x59a1('0xd')](faxQueue[_0x59a1('0x15')]())['then'](realtime[_0x59a1('0x16')]())[_0x59a1('0xd')](whatsappQueue[_0x59a1('0x17')]())[_0x59a1('0xd')](realtime[_0x59a1('0x18')]())[_0x59a1('0xd')](function(){return realtime;});}function main(){return server[_0x59a1('0x19')](realtime)[_0x59a1('0xd')](function(_0x3cae85){return initRealtime();})[_0x59a1('0xd')](function(_0x3c84a6){return setInterval(initRealtime,0x1388);})[_0x59a1('0x1a')](function(_0x13aa5d){console['log'](_0x13aa5d);});}main(); \ No newline at end of file +var _0x389e=['initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','initWhatsappQueues','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents'];(function(_0x3b1a8c,_0x1528be){var _0x32f853=function(_0x24ca99){while(--_0x24ca99){_0x3b1a8c['push'](_0x3b1a8c['shift']());}};_0x32f853(++_0x1528be);}(_0x389e,0x16c));var _0xe389=function(_0x2f80da,_0x7ce7d8){_0x2f80da=_0x2f80da-0x0;var _0x43a267=_0x389e[_0x2f80da];return _0x43a267;};'use strict';var BPromise=require(_0xe389('0x0'));var server=require(_0xe389('0x1'));var Realtime=require(_0xe389('0x2'));var user=require(_0xe389('0x3'));var interval=require(_0xe389('0x4'));var openchannelQueue=require(_0xe389('0x5'));var chatQueue=require(_0xe389('0x6'));var smsQueue=require(_0xe389('0x7'));var mailQueue=require(_0xe389('0x8'));var faxQueue=require(_0xe389('0x9'));var whatsappQueue=require(_0xe389('0xa'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xe389('0xb')]()[_0xe389('0xc')](user[_0xe389('0xd')]())[_0xe389('0xc')](realtime[_0xe389('0xe')]())[_0xe389('0xc')](interval[_0xe389('0xf')]())[_0xe389('0xc')](realtime[_0xe389('0x10')]())[_0xe389('0xc')](openchannelQueue[_0xe389('0x11')]())[_0xe389('0xc')](realtime[_0xe389('0x12')]())[_0xe389('0xc')](chatQueue['getChatQueues']())[_0xe389('0xc')](realtime[_0xe389('0x13')]())[_0xe389('0xc')](smsQueue[_0xe389('0x14')]())[_0xe389('0xc')](realtime[_0xe389('0x15')]())[_0xe389('0xc')](mailQueue[_0xe389('0x16')]())[_0xe389('0xc')](realtime[_0xe389('0x17')]())[_0xe389('0xc')](faxQueue[_0xe389('0x18')]())[_0xe389('0xc')](realtime[_0xe389('0x19')]())['then'](whatsappQueue['getWhatsappQueues']())[_0xe389('0xc')](realtime[_0xe389('0x1a')]())[_0xe389('0xc')](function(){return realtime;});}function main(){return server['listen'](realtime)[_0xe389('0xc')](function(_0x56fdc2){return initRealtime();})[_0xe389('0xc')](function(_0x368687){return setInterval(initRealtime,0x1388);})['catch'](function(_0x569cc6){console['log'](_0x569cc6);});}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 b9e1280..bbb80a5 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(_0x10fbc5,_0x287d19){var _0x1cb3e1=function(_0x3ab48a){while(--_0x3ab48a){_0x10fbc5['push'](_0x10fbc5['shift']());}};_0x1cb3e1(++_0x287d19);}(_0x2ef3,0xba));var _0x32ef=function(_0x46b06f,_0x1b5575){_0x46b06f=_0x46b06f-0x0;var _0x5ddae4=_0x2ef3[_0x46b06f];return _0x5ddae4;};'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 _0xe14b=['next','restart','condition','noop','findRules','matches','turn','length','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','register','exports','lodash','util','isNil','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','push','sync','filter','orderBy','asc','execute','result','clone','consequence','ruleRef','name','index_','nextTick','call'];(function(_0x55a452,_0x3aed55){var _0x409dfd=function(_0x6ca585){while(--_0x6ca585){_0x55a452['push'](_0x55a452['shift']());}};_0x409dfd(++_0x3aed55);}(_0xe14b,0x93));var _0xbe14=function(_0x354048,_0x363842){_0x354048=_0x354048-0x0;var _0x52aec8=_0xe14b[_0x354048];return _0x52aec8;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var EventEmitter=require('events')['EventEmitter'];function RuleEngine(_0x11c3a0,_0x36393a){this['init']();if(!_[_0xbe14('0x2')](_0x11c3a0)){this['register'](_0x11c3a0);}if(_0x36393a){this['ignoreFactChanges']=_0x36393a[_0xbe14('0x3')];}return this;}util[_0xbe14('0x4')](RuleEngine,EventEmitter);RuleEngine[_0xbe14('0x5')][_0xbe14('0x6')]=function(_0x1d9ade){this[_0xbe14('0x7')]=[];this[_0xbe14('0x8')]=[];};RuleEngine['prototype']['register']=function(_0x496063){if(Array[_0xbe14('0x9')](_0x496063)){this[_0xbe14('0x7')]=this[_0xbe14('0x7')][_0xbe14('0xa')](_0x496063);}else if(_0x496063!==null&&_['isObject'](_0x496063)){this['rules'][_0xbe14('0xb')](_0x496063);}this[_0xbe14('0xc')]();};RuleEngine['prototype'][_0xbe14('0xc')]=function(){this[_0xbe14('0x8')]=this[_0xbe14('0x7')][_0xbe14('0xd')](function(_0x27792f){if(_[_0xbe14('0x2')](_0x27792f['on'])){_0x27792f['on']=!![];}if(_0x27792f['on']===!![]){return _0x27792f;}});this[_0xbe14('0x8')]=_[_0xbe14('0xe')](this[_0xbe14('0x8')],['p'],[_0xbe14('0xf')]);};RuleEngine[_0xbe14('0x5')][_0xbe14('0x10')]=function(_0x813399,_0x530538){var _0x55b3a7=![];_0x813399[_0xbe14('0x11')]=!![];var _0x3dc4a9=_[_0xbe14('0x12')](_0x813399);var _0x37ce4e=_['clone'](_0x813399);var _0x21c789=this[_0xbe14('0x8')];var _0xfd7b8f=[];var _0x123ede=this[_0xbe14('0x3')];(function FnRuleLoop(_0x29ab73){var _0x17ae86={'rules':function(){return _0x21c789;},'rule':function(){return _0x21c789[_0x29ab73];},'when':function(_0x5ea1f8){if(_0x5ea1f8){var _0x137ee5=_0x21c789[_0x29ab73][_0xbe14('0x13')];_0x137ee5[_0xbe14('0x14')]=_0x21c789[_0x29ab73]['id']||_0x21c789[_0x29ab73][_0xbe14('0x15')]||_0xbe14('0x16')+_0x29ab73;process[_0xbe14('0x17')](function(){_0xfd7b8f['push'](_0x137ee5[_0xbe14('0x14')]);_0x137ee5[_0xbe14('0x18')](_0x3dc4a9,_0x17ae86);});}else{process[_0xbe14('0x17')](function(){_0x17ae86[_0xbe14('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x55b3a7=!![];return FnRuleLoop(0x0);},'next':function(_0x188ec4){if(!_0x123ede&&!_['isEqual'](_0x37ce4e,_0x3dc4a9)){_0x37ce4e=_[_0xbe14('0x12')](_0x3dc4a9);process['nextTick'](function(){_0x17ae86[_0xbe14('0x1a')]();});}else{process['nextTick'](function(){if(_[_0xbe14('0x2')](_0x188ec4)){return FnRuleLoop(_0x29ab73+0x1);}else{return FnRuleLoop(_0x188ec4);}});}}};if(_0x29ab73<_0x21c789['length']&&_0x55b3a7===![]){var _0x274018=_0x21c789[_0x29ab73][_0xbe14('0x1b')];_0x274018['call'](_0x3dc4a9,_0x17ae86);}else{process[_0xbe14('0x17')](function(){_0x3dc4a9['matchPath']=_0xfd7b8f;return _0x530538?_0x530538(_0x3dc4a9):_[_0xbe14('0x1c')]();});}}(0x0));};RuleEngine['prototype'][_0xbe14('0x1d')]=function(_0x5fa043){if(_[_0xbe14('0x2')](_0x5fa043)){return this[_0xbe14('0x7')];}else{var _0x15ef02=_[_0xbe14('0x1e')](_0x5fa043);return _['filter'](this[_0xbe14('0x7')],_0x15ef02);}};RuleEngine[_0xbe14('0x5')][_0xbe14('0x1f')]=function(_0x169369,_0x5dd475){var _0x16f884=_0x169369==='on'||_0x169369==='ON'?!![]:![];var _0x29fc64=this['findRules'](_0x5dd475);for(var _0x3c3613=0x0,_0x3b3e84=_0x29fc64[_0xbe14('0x20')];_0x3c3613<_0x3b3e84;_0x3c3613+=0x1){_0x29fc64[_0x3c3613]['on']=_0x16f884;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x21')]=function(_0x31a664,_0x2b05cb){_0x31a664=parseInt(_0x31a664,0xa);var _0x4168c8=this[_0xbe14('0x1d')](_0x2b05cb);for(var _0x40538f=0x0,_0x3bf43c=_0x4168c8[_0xbe14('0x20')];_0x40538f<_0x3bf43c;_0x40538f+=0x1){_0x4168c8[_0x40538f][_0xbe14('0x22')]=_0x31a664;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x23')]=function(){var _0x2ff48e=this[_0xbe14('0x7')];if(_0x2ff48e instanceof Array){_0x2ff48e=_0x2ff48e[_0xbe14('0x24')](function(_0x581e86){_0x581e86[_0xbe14('0x1b')]=_0x581e86['condition']['toString']();_0x581e86[_0xbe14('0x13')]=_0x581e86['consequence'][_0xbe14('0x25')]();return _0x581e86;});}else if(!_[_0xbe14('0x2')](_0x2ff48e)){_0x2ff48e['condition']=_0x2ff48e['condition']['toString']();_0x2ff48e[_0xbe14('0x13')]=_0x2ff48e[_0xbe14('0x13')]['toString']();}return _0x2ff48e;};RuleEngine[_0xbe14('0x5')][_0xbe14('0x26')]=function(_0x452635){this[_0xbe14('0x6')]();if(_[_0xbe14('0x27')](_0x452635)){_0x452635=JSON['parse'](_0x452635);}if(_0x452635 instanceof Array){_0x452635=_0x452635['map'](function(_0x15a997){_0x15a997['condition']=eval('('+_0x15a997['condition']+')');_0x15a997['consequence']=eval('('+_0x15a997[_0xbe14('0x13')]+')');return _0x15a997;});}else if(_0x452635!==null&&typeof _0x452635==_0xbe14('0x28')){_0x452635[_0xbe14('0x1b')]=eval('('+_0x452635[_0xbe14('0x1b')]+')');_0x452635[_0xbe14('0x13')]=eval('('+_0x452635[_0xbe14('0x13')]+')');}this[_0xbe14('0x29')](_0x452635);};module[_0xbe14('0x2a')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index d3d7744..41874c8 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 _0xce24=['request','then','error','message','catch','sendMailMessage','SendMail','jayson/promise','client','http'];(function(_0x110d78,_0x29ec2b){var _0x5b09b8=function(_0x553f24){while(--_0x553f24){_0x110d78['push'](_0x110d78['shift']());}};_0x5b09b8(++_0x29ec2b);}(_0xce24,0x1f1));var _0x4ce2=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xce24[_0x5c351c];return _0x26f3b3;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x4ce2('0x0'));var client=jayson[_0x4ce2('0x1')][_0x4ce2('0x2')]({'port':0x232b});function request(_0x35da8b,_0x30b0c2){return new BPromise(function(_0x5ec167,_0x865b08){return client[_0x4ce2('0x3')](_0x35da8b,_0x30b0c2)[_0x4ce2('0x4')](function(_0x450cec){if(_0x450cec[_0x4ce2('0x5')]){return _0x865b08(_0x450cec[_0x4ce2('0x5')][_0x4ce2('0x6')]);}else{return _0x5ec167(_0x450cec['result']);}})[_0x4ce2('0x7')](function(_0x3227a7){return _0x865b08(_0x3227a7);});});}exports[_0x4ce2('0x8')]=function(_0x5b88dd,_0x3bff0a){return request(_0x4ce2('0x9'),{'account':_0x5b88dd,'message':_0x3bff0a});}; \ No newline at end of file +var _0xe0ca=['result','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then','error','message'];(function(_0x128f69,_0x3a502d){var _0x37cdfa=function(_0xd3f800){while(--_0xd3f800){_0x128f69['push'](_0x128f69['shift']());}};_0x37cdfa(++_0x3a502d);}(_0xe0ca,0xb3));var _0xae0c=function(_0x1b79f5,_0x1cf93a){_0x1b79f5=_0x1b79f5-0x0;var _0x26a6f1=_0xe0ca[_0x1b79f5];return _0x26a6f1;};'use strict';var BPromise=require(_0xae0c('0x0'));var jayson=require(_0xae0c('0x1'));var client=jayson[_0xae0c('0x2')][_0xae0c('0x3')]({'port':0x232b});function request(_0x11302d,_0x41551b){return new BPromise(function(_0x3de03e,_0x1a9ddf){return client[_0xae0c('0x4')](_0x11302d,_0x41551b)[_0xae0c('0x5')](function(_0x2a43b4){if(_0x2a43b4[_0xae0c('0x6')]){return _0x1a9ddf(_0x2a43b4[_0xae0c('0x6')][_0xae0c('0x7')]);}else{return _0x3de03e(_0x2a43b4[_0xae0c('0x8')]);}})['catch'](function(_0x218588){return _0x1a9ddf(_0x218588);});});}exports[_0xae0c('0x9')]=function(_0x14febc,_0x362d5d){return request(_0xae0c('0xa'),{'account':_0x14febc,'message':_0x362d5d});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 41a3e85..10fab2e 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 _0xad1b=['name','online','voicePause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','updateRealtime','prototype','CurrentCapacity','Capacity','maxcapacity','working','idle','chat','openchannel','fax','sms','whatsapp','length','getChannelStatus','StatusTime','toNumber','Status','faxStatusTime','smsStatusTime','busyQueue','stringify','emit','exports','lodash','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter'];(function(_0x4a4922,_0x82cb8f){var _0x55a8c6=function(_0x59712e){while(--_0x59712e){_0x4a4922['push'](_0x4a4922['shift']());}};_0x55a8c6(++_0x82cb8f);}(_0xad1b,0x1b0));var _0xbad1=function(_0xa4be36,_0x36ca7e){_0xa4be36=_0xa4be36-0x0;var _0x592933=_0xad1b[_0xa4be36];return _0x592933;};'use strict';var _=require(_0xbad1('0x0'));var moment=require(_0xbad1('0x1'));var md5=require(_0xbad1('0x2'));var Redis=require(_0xbad1('0x3'));var config=require(_0xbad1('0x4'));config[_0xbad1('0x5')]=_[_0xbad1('0x6')](config[_0xbad1('0x5')],{'host':_0xbad1('0x7'),'port':0x18eb});var io=require(_0xbad1('0x8'))(new Redis(config[_0xbad1('0x5')]));function Agent(_0x3576b7){this['id']=_0x3576b7['id']||0x0;this[_0xbad1('0x9')]=_0x3576b7[_0xbad1('0x9')]||'';this[_0xbad1('0xa')]=_0x3576b7[_0xbad1('0xa')]||!![];this[_0xbad1('0xb')]=_0x3576b7[_0xbad1('0xb')]||![];this['chatPause']=_0x3576b7['chatPause']||![];this[_0xbad1('0xc')]=_0x3576b7[_0xbad1('0xc')]||![];this['faxPause']=_0x3576b7[_0xbad1('0xd')]||![];this[_0xbad1('0xe')]=_0x3576b7[_0xbad1('0xe')]||![];this[_0xbad1('0xf')]=_0x3576b7[_0xbad1('0xf')]||![];this[_0xbad1('0x10')]=_0xbad1('0x11');this[_0xbad1('0x12')]=0x0;this[_0xbad1('0x13')]=_0x3576b7[_0xbad1('0x13')]||0x0;this[_0xbad1('0x14')]=0x0;this[_0xbad1('0x15')]=_0xbad1('0x11');this[_0xbad1('0x16')]=0x0;this[_0xbad1('0x17')]=_0x3576b7[_0xbad1('0x17')]||0x0;this[_0xbad1('0x18')]=0x0;this[_0xbad1('0x19')]='unknown';this['faxStatusTime']=0x0;this[_0xbad1('0x1a')]=_0x3576b7[_0xbad1('0x1a')]||0x0;this[_0xbad1('0x1b')]=0x0;this[_0xbad1('0x1c')]='unknown';this['smsStatusTime']=0x0;this[_0xbad1('0x1d')]=_0x3576b7[_0xbad1('0x1d')]||0x0;this[_0xbad1('0x1e')]=0x0;this[_0xbad1('0x1f')]='unknown';this[_0xbad1('0x20')]=0x0;this[_0xbad1('0x21')]=_0x3576b7['whatsappCapacity']||0x0;this[_0xbad1('0x22')]=0x0;this[_0xbad1('0x23')]=_0xbad1('0x11');this[_0xbad1('0x24')]=0x0;this[_0xbad1('0x25')]=_0x3576b7[_0xbad1('0x25')]||0x0;this[_0xbad1('0x26')]=0x0;this[_0xbad1('0x27')]=![];this['busyQueue']=undefined;this[_0xbad1('0x2')]='';this[_0xbad1('0x28')]();}Agent[_0xbad1('0x29')]['getChannelStatus']=function(_0x8abc98){if(this[_0x8abc98+_0xbad1('0x2a')]>0x0){if(this[_0x8abc98+_0xbad1('0x2b')]>0x0&&this[_0x8abc98+_0xbad1('0x2a')]>=this[_0x8abc98+'Capacity']){return _0xbad1('0x2c');}else{return _0xbad1('0x2d');}}else{return _0xbad1('0x2e');}};Agent[_0xbad1('0x29')][_0xbad1('0x28')]=function(){var _0x31bf92=['mail',_0xbad1('0x2f'),_0xbad1('0x30'),_0xbad1('0x31'),_0xbad1('0x32'),_0xbad1('0x33')];for(var _0x558223=0x0;_0x558223<_0x31bf92[_0xbad1('0x34')];_0x558223+=0x1){var _0xd0b52a=this[_0xbad1('0x35')](_0x31bf92[_0x558223]);if(this[_0x31bf92[_0x558223]+'Status']!==_0xd0b52a){this[_0x31bf92[_0x558223]+_0xbad1('0x36')]=_[_0xbad1('0x37')](moment()['format']('x'));}this[_0x31bf92[_0x558223]+_0xbad1('0x38')]=_0xd0b52a;}var _0x25d270={'id':this['id'],'name':this[_0xbad1('0x9')],'online':this[_0xbad1('0xa')],'voicePause':this[_0xbad1('0xb')],'chatPause':this['chatPause'],'mailPause':this[_0xbad1('0xc')],'smsPause':this[_0xbad1('0xe')],'faxPause':this[_0xbad1('0xd')],'openchannelPause':this[_0xbad1('0xf')],'chatStatus':this[_0xbad1('0x10')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0xbad1('0x14')],'mailStatus':this[_0xbad1('0x15')],'mailStatusTime':this[_0xbad1('0x16')],'mailCapacity':this[_0xbad1('0x17')],'mailCurrentCapacity':this[_0xbad1('0x18')],'faxStatus':this[_0xbad1('0x19')],'faxStatusTime':this[_0xbad1('0x39')],'faxCapacity':this[_0xbad1('0x1a')],'faxCurrentCapacity':this[_0xbad1('0x1b')],'smsStatus':this[_0xbad1('0x1c')],'smsStatusTime':this[_0xbad1('0x3a')],'smsCapacity':this[_0xbad1('0x1d')],'smsCurrentCapacity':this[_0xbad1('0x1e')],'whatsappStatus':this[_0xbad1('0x1f')],'whatsappStatusTime':this[_0xbad1('0x20')],'whatsappCapacity':this[_0xbad1('0x21')],'whatsappCurrentCapacity':this[_0xbad1('0x22')],'openchannelStatus':this[_0xbad1('0x23')],'openchannelStatusTime':this[_0xbad1('0x24')],'openchannelCapacity':this[_0xbad1('0x25')],'openchannelCurrentCapacity':this[_0xbad1('0x26')],'busy':this['busy'],'busyQueue':this[_0xbad1('0x3b')]};var _0x393399=md5(JSON[_0xbad1('0x3c')](_0x25d270));if(this['md5']!==_0x393399){this['md5']=_0x393399;io[_0xbad1('0x3d')]('user:save',_0x25d270);}};module[_0xbad1('0x3e')]=Agent; \ No newline at end of file +var _0xf6c1=['smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','md5','getChannelStatus','CurrentCapacity','Capacity','working','updateRealtime','mail','chat','openchannel','sms','whatsapp','length','Status','format','smsPause','faxStatus','stringify','emit','user:save','exports','lodash','ioredis','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','openchannelPause','chatStatus','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','unknown','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity'];(function(_0x4b8e60,_0x3cc2b9){var _0x28071c=function(_0x175b57){while(--_0x175b57){_0x4b8e60['push'](_0x4b8e60['shift']());}};_0x28071c(++_0x3cc2b9);}(_0xf6c1,0x149));var _0x1f6c=function(_0x46be2c,_0x4a8474){_0x46be2c=_0x46be2c-0x0;var _0x50ee72=_0xf6c1[_0x46be2c];return _0x50ee72;};'use strict';var _=require(_0x1f6c('0x0'));var moment=require('moment');var md5=require('md5');var Redis=require(_0x1f6c('0x1'));var config=require('../../../config/environment');config[_0x1f6c('0x2')]=_[_0x1f6c('0x3')](config[_0x1f6c('0x2')],{'host':_0x1f6c('0x4'),'port':0x18eb});var io=require(_0x1f6c('0x5'))(new Redis(config['redis']));function Agent(_0x299ce2){this['id']=_0x299ce2['id']||0x0;this[_0x1f6c('0x6')]=_0x299ce2[_0x1f6c('0x6')]||'';this[_0x1f6c('0x7')]=_0x299ce2['online']||!![];this[_0x1f6c('0x8')]=_0x299ce2[_0x1f6c('0x8')]||![];this[_0x1f6c('0x9')]=_0x299ce2[_0x1f6c('0x9')]||![];this[_0x1f6c('0xa')]=_0x299ce2[_0x1f6c('0xa')]||![];this[_0x1f6c('0xb')]=_0x299ce2[_0x1f6c('0xb')]||![];this['smsPause']=_0x299ce2['smsPause']||![];this['openchannelPause']=_0x299ce2[_0x1f6c('0xc')]||![];this[_0x1f6c('0xd')]='unknown';this[_0x1f6c('0xe')]=0x0;this[_0x1f6c('0xf')]=_0x299ce2['chatCapacity']||0x0;this[_0x1f6c('0x10')]=0x0;this[_0x1f6c('0x11')]=_0x1f6c('0x12');this[_0x1f6c('0x13')]=0x0;this[_0x1f6c('0x14')]=_0x299ce2[_0x1f6c('0x14')]||0x0;this[_0x1f6c('0x15')]=0x0;this['faxStatus']=_0x1f6c('0x12');this[_0x1f6c('0x16')]=0x0;this[_0x1f6c('0x17')]=_0x299ce2[_0x1f6c('0x17')]||0x0;this[_0x1f6c('0x18')]=0x0;this[_0x1f6c('0x19')]=_0x1f6c('0x12');this[_0x1f6c('0x1a')]=0x0;this[_0x1f6c('0x1b')]=_0x299ce2['smsCapacity']||0x0;this[_0x1f6c('0x1c')]=0x0;this[_0x1f6c('0x1d')]=_0x1f6c('0x12');this[_0x1f6c('0x1e')]=0x0;this[_0x1f6c('0x1f')]=_0x299ce2[_0x1f6c('0x1f')]||0x0;this[_0x1f6c('0x20')]=0x0;this[_0x1f6c('0x21')]='unknown';this[_0x1f6c('0x22')]=0x0;this[_0x1f6c('0x23')]=_0x299ce2[_0x1f6c('0x23')]||0x0;this[_0x1f6c('0x24')]=0x0;this[_0x1f6c('0x25')]=![];this[_0x1f6c('0x26')]=undefined;this[_0x1f6c('0x27')]='';this['updateRealtime']();}Agent['prototype'][_0x1f6c('0x28')]=function(_0x23b9e8){if(this[_0x23b9e8+_0x1f6c('0x29')]>0x0){if(this[_0x23b9e8+'Capacity']>0x0&&this[_0x23b9e8+_0x1f6c('0x29')]>=this[_0x23b9e8+_0x1f6c('0x2a')]){return'maxcapacity';}else{return _0x1f6c('0x2b');}}else{return'idle';}};Agent['prototype'][_0x1f6c('0x2c')]=function(){var _0x524a91=[_0x1f6c('0x2d'),_0x1f6c('0x2e'),_0x1f6c('0x2f'),'fax',_0x1f6c('0x30'),_0x1f6c('0x31')];for(var _0x3b3110=0x0;_0x3b3110<_0x524a91[_0x1f6c('0x32')];_0x3b3110+=0x1){var _0x51aecc=this[_0x1f6c('0x28')](_0x524a91[_0x3b3110]);if(this[_0x524a91[_0x3b3110]+_0x1f6c('0x33')]!==_0x51aecc){this[_0x524a91[_0x3b3110]+'StatusTime']=_['toNumber'](moment()[_0x1f6c('0x34')]('x'));}this[_0x524a91[_0x3b3110]+_0x1f6c('0x33')]=_0x51aecc;}var _0x438ea8={'id':this['id'],'name':this['name'],'online':this['online'],'voicePause':this['voicePause'],'chatPause':this[_0x1f6c('0x9')],'mailPause':this['mailPause'],'smsPause':this[_0x1f6c('0x35')],'faxPause':this['faxPause'],'openchannelPause':this[_0x1f6c('0xc')],'chatStatus':this[_0x1f6c('0xd')],'chatStatusTime':this[_0x1f6c('0xe')],'chatCapacity':this[_0x1f6c('0xf')],'chatCurrentCapacity':this[_0x1f6c('0x10')],'mailStatus':this[_0x1f6c('0x11')],'mailStatusTime':this[_0x1f6c('0x13')],'mailCapacity':this[_0x1f6c('0x14')],'mailCurrentCapacity':this[_0x1f6c('0x15')],'faxStatus':this[_0x1f6c('0x36')],'faxStatusTime':this[_0x1f6c('0x16')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x1f6c('0x18')],'smsStatus':this[_0x1f6c('0x19')],'smsStatusTime':this[_0x1f6c('0x1a')],'smsCapacity':this[_0x1f6c('0x1b')],'smsCurrentCapacity':this[_0x1f6c('0x1c')],'whatsappStatus':this[_0x1f6c('0x1d')],'whatsappStatusTime':this[_0x1f6c('0x1e')],'whatsappCapacity':this[_0x1f6c('0x1f')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x1f6c('0x21')],'openchannelStatusTime':this[_0x1f6c('0x22')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x1f6c('0x24')],'busy':this[_0x1f6c('0x25')],'busyQueue':this[_0x1f6c('0x26')]};var _0x19c02a=md5(JSON[_0x1f6c('0x37')](_0x438ea8));if(this[_0x1f6c('0x27')]!==_0x19c02a){this[_0x1f6c('0x27')]=_0x19c02a;io[_0x1f6c('0x38')](_0x1f6c('0x39'),_0x438ea8);}};module[_0x1f6c('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 825dded..6aea139 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 _0x3586=['defaults','redis','socket.io-emitter','timeout','strategy','Agents','mapAgentsId','updateRouting','_rr','map','updateRealtime','loggedIn','paused','online','chatPause','available','name','md5','format','chat:queue:%s','emit','chat_queue:save','exports','util','ioredis','../../../config/environment'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x3586,0xcd));var _0x6358=function(_0x153a08,_0x8d956d){_0x153a08=_0x153a08-0x0;var _0x334eaf=_0x3586[_0x153a08];return _0x334eaf;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x6358('0x0'));var Redis=require(_0x6358('0x1'));var config=require(_0x6358('0x2'));config['redis']=_[_0x6358('0x3')](config[_0x6358('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x6358('0x5'))(new Redis(config[_0x6358('0x4')]));function ChatQueue(_0x3cadb2){this['id']=_0x3cadb2['id']||0x0;this['name']=_0x3cadb2['name']||'';this[_0x6358('0x6')]=_0x3cadb2[_0x6358('0x6')]||0xa;this['strategy']=_0x3cadb2[_0x6358('0x7')]||'beepall';this[_0x6358('0x8')]=_0x3cadb2[_0x6358('0x8')];this[_0x6358('0x9')]={};this['waiting']=0x0;this['md5']='';this[_0x6358('0xa')]();this['updateRealtime']();}ChatQueue['prototype'][_0x6358('0xa')]=function(){var _0x3d215e=this[_0x6358('0x9')][_0x6358('0xb')];this[_0x6358('0x9')]=_[_0x6358('0xc')](this[_0x6358('0x8')],'id');this['mapAgentsId'][_0x6358('0xb')]=_0x3d215e;};ChatQueue['prototype'][_0x6358('0xd')]=function(){this[_0x6358('0xe')]=0x0;this[_0x6358('0xf')]=0x0;for(var _0x23724b=0x0;_0x23724b=0x0?this[_0x6358('0x12')]:0x0;var _0x43568d={'id':this['id'],'available':this[_0x6358('0x12')],'loggedIn':this['loggedIn'],'name':this[_0x6358('0x13')],'paused':this[_0x6358('0xf')],'waiting':this['waiting']};var _0x4e9903=md5(JSON['stringify'](_0x43568d));if(this[_0x6358('0x14')]!==_0x4e9903){this['md5']=_0x4e9903;io['to'](util[_0x6358('0x15')](_0x6358('0x16'),_0x43568d[_0x6358('0x13')]))[_0x6358('0x17')](_0x6358('0x18'),_0x43568d);}};module[_0x6358('0x19')]=ChatQueue; \ No newline at end of file +var _0xe8e2=['beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','online','chatPause','available','paused','stringify','format','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','name','timeout','strategy'];(function(_0x4667a5,_0x1a2dbe){var _0x4c4cba=function(_0x3e5dc4){while(--_0x3e5dc4){_0x4667a5['push'](_0x4667a5['shift']());}};_0x4c4cba(++_0x1a2dbe);}(_0xe8e2,0x1e5));var _0x2e8e=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xe8e2[_0x51020b];return _0x371e47;};'use strict';var _=require(_0x2e8e('0x0'));var md5=require(_0x2e8e('0x1'));var util=require(_0x2e8e('0x2'));var Redis=require(_0x2e8e('0x3'));var config=require(_0x2e8e('0x4'));config[_0x2e8e('0x5')]=_['defaults'](config[_0x2e8e('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function ChatQueue(_0x1ab84b){this['id']=_0x1ab84b['id']||0x0;this['name']=_0x1ab84b[_0x2e8e('0x6')]||'';this[_0x2e8e('0x7')]=_0x1ab84b['timeout']||0xa;this[_0x2e8e('0x8')]=_0x1ab84b[_0x2e8e('0x8')]||_0x2e8e('0x9');this[_0x2e8e('0xa')]=_0x1ab84b[_0x2e8e('0xa')];this[_0x2e8e('0xb')]={};this[_0x2e8e('0xc')]=0x0;this[_0x2e8e('0x1')]='';this[_0x2e8e('0xd')]();this[_0x2e8e('0xe')]();}ChatQueue[_0x2e8e('0xf')][_0x2e8e('0xd')]=function(){var _0x276a5b=this[_0x2e8e('0xb')][_0x2e8e('0x10')];this['mapAgentsId']=_['map'](this[_0x2e8e('0xa')],'id');this['mapAgentsId']['_rr']=_0x276a5b;};ChatQueue['prototype'][_0x2e8e('0xe')]=function(){this[_0x2e8e('0x11')]=0x0;this['paused']=0x0;for(var _0x5cc11f=0x0;_0x5cc11f=0x0?this['available']:0x0;var _0x2910bf={'id':this['id'],'available':this['available'],'loggedIn':this[_0x2e8e('0x11')],'name':this[_0x2e8e('0x6')],'paused':this['paused'],'waiting':this[_0x2e8e('0xc')]};var _0x59bb8d=md5(JSON[_0x2e8e('0x16')](_0x2910bf));if(this['md5']!==_0x59bb8d){this[_0x2e8e('0x1')]=_0x59bb8d;io['to'](util[_0x2e8e('0x17')]('chat:queue:%s',_0x2910bf['name']))['emit'](_0x2e8e('0x18'),_0x2910bf);}};module[_0x2e8e('0x19')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 10c971f..ea5575a 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 _0x9b0b=['strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRealtime','prototype','updateRouting','map','_rr','loggedIn','paused','length','faxPause','available','stringify','format','fax:queue:%s','emit','exports','lodash','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout'];(function(_0x4df121,_0x4cbdf4){var _0x18bab7=function(_0x51d75f){while(--_0x51d75f){_0x4df121['push'](_0x4df121['shift']());}};_0x18bab7(++_0x4cbdf4);}(_0x9b0b,0x105));var _0xb9b0=function(_0xca1f0e,_0x2713d5){_0xca1f0e=_0xca1f0e-0x0;var _0x35e4ef=_0x9b0b[_0xca1f0e];return _0x35e4ef;};'use strict';var _=require(_0xb9b0('0x0'));var md5=require('md5');var util=require(_0xb9b0('0x1'));var Redis=require(_0xb9b0('0x2'));var config=require(_0xb9b0('0x3'));config['redis']=_['defaults'](config[_0xb9b0('0x4')],{'host':_0xb9b0('0x5'),'port':0x18eb});var io=require(_0xb9b0('0x6'))(new Redis(config[_0xb9b0('0x4')]));function FaxQueue(_0x4fc757){this['id']=_0x4fc757['id']||0x0;this[_0xb9b0('0x7')]=_0x4fc757['name']||'';this[_0xb9b0('0x8')]=_0x4fc757[_0xb9b0('0x8')]||0xa;this[_0xb9b0('0x9')]=_0x4fc757[_0xb9b0('0x9')]||_0xb9b0('0xa');this['Agents']=_0x4fc757[_0xb9b0('0xb')];this[_0xb9b0('0xc')]={};this[_0xb9b0('0xd')]=0x0;this[_0xb9b0('0xe')]='';this['updateRouting']();this[_0xb9b0('0xf')]();}FaxQueue[_0xb9b0('0x10')][_0xb9b0('0x11')]=function(){var _0x1fc34d=this[_0xb9b0('0xc')]['_rr'];this[_0xb9b0('0xc')]=_[_0xb9b0('0x12')](this[_0xb9b0('0xb')],'id');this[_0xb9b0('0xc')][_0xb9b0('0x13')]=_0x1fc34d;};FaxQueue[_0xb9b0('0x10')][_0xb9b0('0xf')]=function(){this[_0xb9b0('0x14')]=0x0;this[_0xb9b0('0x15')]=0x0;for(var _0x47cbb4=0x0;_0x47cbb4=0x0?this[_0xb9b0('0x18')]:0x0;var _0x5f3511={'id':this['id'],'available':this[_0xb9b0('0x18')],'loggedIn':this[_0xb9b0('0x14')],'name':this[_0xb9b0('0x7')],'paused':this[_0xb9b0('0x15')],'waiting':this[_0xb9b0('0xd')]};var _0x41d6a5=md5(JSON[_0xb9b0('0x19')](_0x5f3511));if(this[_0xb9b0('0xe')]!==_0x41d6a5){this[_0xb9b0('0xe')]=_0x41d6a5;io['to'](util[_0xb9b0('0x1a')](_0xb9b0('0x1b'),_0x5f3511[_0xb9b0('0x7')]))[_0xb9b0('0x1c')]('fax_queue:save',_0x5f3511);}};module[_0xb9b0('0x1d')]=FaxQueue; \ No newline at end of file +var _0x787b=['strategy','beepall','Agents','waiting','updateRealtime','prototype','updateRouting','mapAgentsId','_rr','map','paused','online','faxPause','available','loggedIn','format','fax:queue:%s','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','localhost','socket.io-emitter','redis','name','timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x787b,0xc7));var _0xb787=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x787b[_0x26462c];return _0x509a42;};'use strict';var _=require(_0xb787('0x0'));var md5=require(_0xb787('0x1'));var util=require(_0xb787('0x2'));var Redis=require(_0xb787('0x3'));var config=require(_0xb787('0x4'));config['redis']=_[_0xb787('0x5')](config['redis'],{'host':_0xb787('0x6'),'port':0x18eb});var io=require(_0xb787('0x7'))(new Redis(config[_0xb787('0x8')]));function FaxQueue(_0x216b9e){this['id']=_0x216b9e['id']||0x0;this[_0xb787('0x9')]=_0x216b9e[_0xb787('0x9')]||'';this[_0xb787('0xa')]=_0x216b9e[_0xb787('0xa')]||0xa;this['strategy']=_0x216b9e[_0xb787('0xb')]||_0xb787('0xc');this[_0xb787('0xd')]=_0x216b9e[_0xb787('0xd')];this['mapAgentsId']={};this[_0xb787('0xe')]=0x0;this[_0xb787('0x1')]='';this['updateRouting']();this[_0xb787('0xf')]();}FaxQueue[_0xb787('0x10')][_0xb787('0x11')]=function(){var _0xa8ab7d=this[_0xb787('0x12')][_0xb787('0x13')];this[_0xb787('0x12')]=_[_0xb787('0x14')](this[_0xb787('0xd')],'id');this[_0xb787('0x12')][_0xb787('0x13')]=_0xa8ab7d;};FaxQueue[_0xb787('0x10')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0xb787('0x15')]=0x0;for(var _0x463219=0x0;_0x463219=0x0?this['available']:0x0;var _0x131dde={'id':this['id'],'available':this[_0xb787('0x18')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0xb787('0x15')],'waiting':this[_0xb787('0xe')]};var _0x5a27ec=md5(JSON['stringify'](_0x131dde));if(this['md5']!==_0x5a27ec){this[_0xb787('0x1')]=_0x5a27ec;io['to'](util[_0xb787('0x1a')](_0xb787('0x1b'),_0x131dde[_0xb787('0x9')]))['emit'](_0xb787('0x1c'),_0x131dde);}};module[_0xb787('0x1d')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 1f6e570..03cbe59 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 _0xefc0=['exports','name'];(function(_0x5c8ca0,_0x10d2bd){var _0x2ece34=function(_0x4b2430){while(--_0x4b2430){_0x5c8ca0['push'](_0x5c8ca0['shift']());}};_0x2ece34(++_0x10d2bd);}(_0xefc0,0x11b));var _0x0efc=function(_0x237f19,_0x24f3b9){_0x237f19=_0x237f19-0x0;var _0xdbe616=_0xefc0[_0x237f19];return _0xdbe616;};'use strict';function Interval(_0x2d19e4){this['id']=_0x2d19e4['id']||0x0;this['name']=_0x2d19e4[_0x0efc('0x0')]||'';this['Intervals']=_0x2d19e4['Intervals']||{};}module[_0x0efc('0x1')]=Interval; \ No newline at end of file +var _0xd5f2=['Intervals','exports','name'];(function(_0x18fd0b,_0xe0f9ed){var _0x3b19a3=function(_0xde37ae){while(--_0xde37ae){_0x18fd0b['push'](_0x18fd0b['shift']());}};_0x3b19a3(++_0xe0f9ed);}(_0xd5f2,0x1bb));var _0x2d5f=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0xd5f2[_0x40a825];return _0x273a54;};'use strict';function Interval(_0x379be3){this['id']=_0x379be3['id']||0x0;this[_0x2d5f('0x0')]=_0x379be3[_0x2d5f('0x0')]||'';this[_0x2d5f('0x1')]=_0x379be3['Intervals']||{};}module[_0x2d5f('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 7fe36cf..87374c6 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 _0x85f5=['defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','map','_rr','updateRealtime','loggedIn','length','mailPause','paused','available','stringify','mail:queue:%s','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis'];(function(_0x1d9fda,_0x2fd0e0){var _0x2f9c3e=function(_0x1f8237){while(--_0x1f8237){_0x1d9fda['push'](_0x1d9fda['shift']());}};_0x2f9c3e(++_0x2fd0e0);}(_0x85f5,0xa8));var _0x585f=function(_0x3e94f0,_0x382afe){_0x3e94f0=_0x3e94f0-0x0;var _0x5ddbb2=_0x85f5[_0x3e94f0];return _0x5ddbb2;};'use strict';var _=require(_0x585f('0x0'));var md5=require(_0x585f('0x1'));var util=require(_0x585f('0x2'));var Redis=require(_0x585f('0x3'));var config=require(_0x585f('0x4'));config[_0x585f('0x5')]=_[_0x585f('0x6')](config[_0x585f('0x5')],{'host':_0x585f('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function MailQueue(_0x51d44b){this['id']=_0x51d44b['id']||0x0;this[_0x585f('0x8')]=_0x51d44b['name']||'';this[_0x585f('0x9')]=_0x51d44b[_0x585f('0x9')]||0xa;this[_0x585f('0xa')]=_0x51d44b[_0x585f('0xa')]||_0x585f('0xb');this[_0x585f('0xc')]=_0x51d44b['Agents'];this[_0x585f('0xd')]={};this[_0x585f('0xe')]=0x0;this['md5']='';this[_0x585f('0xf')]();this['updateRealtime']();}MailQueue[_0x585f('0x10')]['updateRouting']=function(){var _0x2fc37d=this[_0x585f('0xd')]['_rr'];this[_0x585f('0xd')]=_[_0x585f('0x11')](this[_0x585f('0xc')],'id');this[_0x585f('0xd')][_0x585f('0x12')]=_0x2fc37d;};MailQueue[_0x585f('0x10')][_0x585f('0x13')]=function(){this[_0x585f('0x14')]=0x0;this['paused']=0x0;for(var _0x1583fe=0x0;_0x1583fe=0x0?this[_0x585f('0x18')]:0x0;var _0x35426c={'id':this['id'],'available':this[_0x585f('0x18')],'loggedIn':this[_0x585f('0x14')],'name':this['name'],'paused':this[_0x585f('0x17')],'waiting':this[_0x585f('0xe')]};var _0xa878fd=md5(JSON[_0x585f('0x19')](_0x35426c));if(this[_0x585f('0x1')]!==_0xa878fd){this[_0x585f('0x1')]=_0xa878fd;io['to'](util['format'](_0x585f('0x1a'),_0x35426c[_0x585f('0x8')]))['emit'](_0x585f('0x1b'),_0x35426c);}};module[_0x585f('0x1c')]=MailQueue; \ No newline at end of file +var _0x25e6=['format','mail:queue:%s','exports','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','map','_rr','loggedIn','paused','online','mailPause','available'];(function(_0x1c72c2,_0x2d32c5){var _0x1e43f2=function(_0x45b046){while(--_0x45b046){_0x1c72c2['push'](_0x1c72c2['shift']());}};_0x1e43f2(++_0x2d32c5);}(_0x25e6,0xb9));var _0x625e=function(_0x5c3565,_0x253757){_0x5c3565=_0x5c3565-0x0;var _0x4ebba2=_0x25e6[_0x5c3565];return _0x4ebba2;};'use strict';var _=require(_0x625e('0x0'));var md5=require(_0x625e('0x1'));var util=require(_0x625e('0x2'));var Redis=require(_0x625e('0x3'));var config=require('../../../config/environment');config[_0x625e('0x4')]=_[_0x625e('0x5')](config['redis'],{'host':_0x625e('0x6'),'port':0x18eb});var io=require(_0x625e('0x7'))(new Redis(config[_0x625e('0x4')]));function MailQueue(_0x3f5c68){this['id']=_0x3f5c68['id']||0x0;this[_0x625e('0x8')]=_0x3f5c68[_0x625e('0x8')]||'';this[_0x625e('0x9')]=_0x3f5c68[_0x625e('0x9')]||0xa;this['strategy']=_0x3f5c68[_0x625e('0xa')]||_0x625e('0xb');this[_0x625e('0xc')]=_0x3f5c68['Agents'];this[_0x625e('0xd')]={};this['waiting']=0x0;this[_0x625e('0x1')]='';this[_0x625e('0xe')]();this[_0x625e('0xf')]();}MailQueue['prototype']['updateRouting']=function(){var _0x43d971=this[_0x625e('0xd')]['_rr'];this[_0x625e('0xd')]=_[_0x625e('0x10')](this[_0x625e('0xc')],'id');this['mapAgentsId'][_0x625e('0x11')]=_0x43d971;};MailQueue['prototype'][_0x625e('0xf')]=function(){this[_0x625e('0x12')]=0x0;this[_0x625e('0x13')]=0x0;for(var _0x50c059=0x0;_0x50c059=0x0?this[_0x625e('0x16')]:0x0;var _0x21e7be={'id':this['id'],'available':this[_0x625e('0x16')],'loggedIn':this[_0x625e('0x12')],'name':this[_0x625e('0x8')],'paused':this[_0x625e('0x13')],'waiting':this['waiting']};var _0x450dc6=md5(JSON['stringify'](_0x21e7be));if(this[_0x625e('0x1')]!==_0x450dc6){this['md5']=_0x450dc6;io['to'](util[_0x625e('0x17')](_0x625e('0x18'),_0x21e7be[_0x625e('0x8')]))['emit']('mail_queue:save',_0x21e7be);}};module[_0x625e('0x19')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index c822e60..f3fa8b7 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 _0x5fc3=['format','openchannel:queue:%s','name','emit','openchannel_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','openchannelPause','available'];(function(_0x489c95,_0x53159c){var _0x10e7a7=function(_0xcb4342){while(--_0xcb4342){_0x489c95['push'](_0x489c95['shift']());}};_0x10e7a7(++_0x53159c);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x5fc3[_0x5608a3];return _0x1ed50a;};'use strict';var _=require(_0x35fc('0x0'));var md5=require(_0x35fc('0x1'));var util=require('util');var Redis=require(_0x35fc('0x2'));var config=require(_0x35fc('0x3'));config[_0x35fc('0x4')]=_[_0x35fc('0x5')](config[_0x35fc('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x35fc('0x6'))(new Redis(config[_0x35fc('0x4')]));function OpenchannelQueue(_0x186a06){this['id']=_0x186a06['id']||0x0;this['name']=_0x186a06['name']||'';this[_0x35fc('0x7')]=_0x186a06['timeout']||0xa;this[_0x35fc('0x8')]=_0x186a06[_0x35fc('0x8')]||_0x35fc('0x9');this[_0x35fc('0xa')]=_0x186a06[_0x35fc('0xa')];this[_0x35fc('0xb')]={};this[_0x35fc('0xc')]=0x0;this['md5']='';this[_0x35fc('0xd')]();this[_0x35fc('0xe')]();}OpenchannelQueue['prototype'][_0x35fc('0xd')]=function(){var _0x33f491=this['mapAgentsId'][_0x35fc('0xf')];this[_0x35fc('0xb')]=_['map'](this['Agents'],'id');this[_0x35fc('0xb')]['_rr']=_0x33f491;};OpenchannelQueue[_0x35fc('0x10')][_0x35fc('0xe')]=function(){this[_0x35fc('0x11')]=0x0;this[_0x35fc('0x12')]=0x0;for(var _0x38d9f2=0x0;_0x38d9f2=0x0?this['available']:0x0;var _0x41e165={'id':this['id'],'available':this[_0x35fc('0x14')],'loggedIn':this[_0x35fc('0x11')],'name':this['name'],'paused':this[_0x35fc('0x12')],'waiting':this[_0x35fc('0xc')]};var _0x465eb3=md5(JSON['stringify'](_0x41e165));if(this[_0x35fc('0x1')]!==_0x465eb3){this[_0x35fc('0x1')]=_0x465eb3;io['to'](util[_0x35fc('0x15')](_0x35fc('0x16'),_0x41e165[_0x35fc('0x17')]))[_0x35fc('0x18')](_0x35fc('0x19'),_0x41e165);}};module[_0x35fc('0x1a')]=OpenchannelQueue; \ No newline at end of file +var _0x2ef3=['stringify','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','paused','length','online','available','loggedIn','name'];(function(_0x3de4f8,_0x336c7d){var _0x3d81fc=function(_0x53b9f9){while(--_0x53b9f9){_0x3de4f8['push'](_0x3de4f8['shift']());}};_0x3d81fc(++_0x336c7d);}(_0x2ef3,0xba));var _0x32ef=function(_0x5e19f5,_0x23d687){_0x5e19f5=_0x5e19f5-0x0;var _0x33d570=_0x2ef3[_0x5e19f5];return _0x33d570;};'use strict';var _=require(_0x32ef('0x0'));var md5=require(_0x32ef('0x1'));var util=require(_0x32ef('0x2'));var Redis=require(_0x32ef('0x3'));var config=require(_0x32ef('0x4'));config[_0x32ef('0x5')]=_['defaults'](config[_0x32ef('0x5')],{'host':_0x32ef('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x32ef('0x5')]));function OpenchannelQueue(_0x37dd1d){this['id']=_0x37dd1d['id']||0x0;this['name']=_0x37dd1d['name']||'';this[_0x32ef('0x7')]=_0x37dd1d[_0x32ef('0x7')]||0xa;this[_0x32ef('0x8')]=_0x37dd1d[_0x32ef('0x8')]||_0x32ef('0x9');this[_0x32ef('0xa')]=_0x37dd1d[_0x32ef('0xa')];this[_0x32ef('0xb')]={};this[_0x32ef('0xc')]=0x0;this[_0x32ef('0x1')]='';this['updateRouting']();this['updateRealtime']();}OpenchannelQueue[_0x32ef('0xd')][_0x32ef('0xe')]=function(){var _0x45bfd5=this[_0x32ef('0xb')]['_rr'];this[_0x32ef('0xb')]=_['map'](this[_0x32ef('0xa')],'id');this['mapAgentsId'][_0x32ef('0xf')]=_0x45bfd5;};OpenchannelQueue[_0x32ef('0xd')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x32ef('0x10')]=0x0;for(var _0x4d8009=0x0;_0x4d8009=0x0?this[_0x32ef('0x13')]:0x0;var _0x286bfb={'id':this['id'],'available':this['available'],'loggedIn':this[_0x32ef('0x14')],'name':this[_0x32ef('0x15')],'paused':this['paused'],'waiting':this[_0x32ef('0xc')]};var _0x314ef1=md5(JSON[_0x32ef('0x16')](_0x286bfb));if(this[_0x32ef('0x1')]!==_0x314ef1){this[_0x32ef('0x1')]=_0x314ef1;io['to'](util[_0x32ef('0x17')]('openchannel:queue:%s',_0x286bfb[_0x32ef('0x15')]))['emit'](_0x32ef('0x18'),_0x286bfb);}};module[_0x32ef('0x19')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 4f54399..f552941 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 _0xb28a=['smsPause','available','stringify','format','sms:queue:%s','emit','exports','md5','util','../../../config/environment','localhost','socket.io-emitter','redis','name','timeout','beepall','Agents','mapAgentsId','waiting','updateRealtime','updateRouting','_rr','map','prototype','loggedIn','paused','online'];(function(_0x5ce9f6,_0x5e6a02){var _0x3ad63d=function(_0x4ff607){while(--_0x4ff607){_0x5ce9f6['push'](_0x5ce9f6['shift']());}};_0x3ad63d(++_0x5e6a02);}(_0xb28a,0x166));var _0xab28=function(_0x2a1b05,_0x2b2db7){_0x2a1b05=_0x2a1b05-0x0;var _0x192c86=_0xb28a[_0x2a1b05];return _0x192c86;};'use strict';var _=require('lodash');var md5=require(_0xab28('0x0'));var util=require(_0xab28('0x1'));var Redis=require('ioredis');var config=require(_0xab28('0x2'));config['redis']=_['defaults'](config['redis'],{'host':_0xab28('0x3'),'port':0x18eb});var io=require(_0xab28('0x4'))(new Redis(config[_0xab28('0x5')]));function SmsQueue(_0x3b6103){this['id']=_0x3b6103['id']||0x0;this[_0xab28('0x6')]=_0x3b6103[_0xab28('0x6')]||'';this[_0xab28('0x7')]=_0x3b6103[_0xab28('0x7')]||0xa;this['strategy']=_0x3b6103['strategy']||_0xab28('0x8');this[_0xab28('0x9')]=_0x3b6103[_0xab28('0x9')];this[_0xab28('0xa')]={};this[_0xab28('0xb')]=0x0;this[_0xab28('0x0')]='';this['updateRouting']();this[_0xab28('0xc')]();}SmsQueue['prototype'][_0xab28('0xd')]=function(){var _0x19e816=this[_0xab28('0xa')][_0xab28('0xe')];this[_0xab28('0xa')]=_[_0xab28('0xf')](this[_0xab28('0x9')],'id');this[_0xab28('0xa')]['_rr']=_0x19e816;};SmsQueue[_0xab28('0x10')][_0xab28('0xc')]=function(){this[_0xab28('0x11')]=0x0;this[_0xab28('0x12')]=0x0;for(var _0x2c05bc=0x0;_0x2c05bc=0x0?this[_0xab28('0x15')]:0x0;var _0x3d60e4={'id':this['id'],'available':this[_0xab28('0x15')],'loggedIn':this[_0xab28('0x11')],'name':this[_0xab28('0x6')],'paused':this[_0xab28('0x12')],'waiting':this[_0xab28('0xb')]};var _0x480454=md5(JSON[_0xab28('0x16')](_0x3d60e4));if(this[_0xab28('0x0')]!==_0x480454){this[_0xab28('0x0')]=_0x480454;io['to'](util[_0xab28('0x17')](_0xab28('0x18'),_0x3d60e4[_0xab28('0x6')]))[_0xab28('0x19')]('sms_queue:save',_0x3d60e4);}};module[_0xab28('0x1a')]=SmsQueue; \ No newline at end of file +var _0x07c3=['updateRouting','loggedIn','paused','length','online','smsPause','available','stringify','format','sms:queue:%s','emit','sms_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype'];(function(_0x5668a4,_0x27dee2){var _0x3995e1=function(_0x4d37dc){while(--_0x4d37dc){_0x5668a4['push'](_0x5668a4['shift']());}};_0x3995e1(++_0x27dee2);}(_0x07c3,0x1bf));var _0x307c=function(_0x45dd0e,_0x28e603){_0x45dd0e=_0x45dd0e-0x0;var _0x50e5ca=_0x07c3[_0x45dd0e];return _0x50e5ca;};'use strict';var _=require(_0x307c('0x0'));var md5=require(_0x307c('0x1'));var util=require(_0x307c('0x2'));var Redis=require(_0x307c('0x3'));var config=require(_0x307c('0x4'));config[_0x307c('0x5')]=_[_0x307c('0x6')](config[_0x307c('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x307c('0x7'))(new Redis(config[_0x307c('0x5')]));function SmsQueue(_0x27515b){this['id']=_0x27515b['id']||0x0;this[_0x307c('0x8')]=_0x27515b[_0x307c('0x8')]||'';this[_0x307c('0x9')]=_0x27515b[_0x307c('0x9')]||0xa;this[_0x307c('0xa')]=_0x27515b[_0x307c('0xa')]||_0x307c('0xb');this[_0x307c('0xc')]=_0x27515b[_0x307c('0xc')];this[_0x307c('0xd')]={};this[_0x307c('0xe')]=0x0;this[_0x307c('0x1')]='';this['updateRouting']();this[_0x307c('0xf')]();}SmsQueue[_0x307c('0x10')][_0x307c('0x11')]=function(){var _0x2af63f=this['mapAgentsId']['_rr'];this[_0x307c('0xd')]=_['map'](this[_0x307c('0xc')],'id');this[_0x307c('0xd')]['_rr']=_0x2af63f;};SmsQueue[_0x307c('0x10')][_0x307c('0xf')]=function(){this[_0x307c('0x12')]=0x0;this[_0x307c('0x13')]=0x0;for(var _0x4193d8=0x0;_0x4193d8=0x0?this[_0x307c('0x17')]:0x0;var _0x3e05e2={'id':this['id'],'available':this[_0x307c('0x17')],'loggedIn':this[_0x307c('0x12')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x307c('0xe')]};var _0x4aa3c8=md5(JSON[_0x307c('0x18')](_0x3e05e2));if(this['md5']!==_0x4aa3c8){this['md5']=_0x4aa3c8;io['to'](util[_0x307c('0x19')](_0x307c('0x1a'),_0x3e05e2['name']))[_0x307c('0x1b')](_0x307c('0x1c'),_0x3e05e2);}};module['exports']=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index a74afbf..2b2aa75 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 _0x6288=['Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','updateRealtime','paused','length','online','loggedIn','whatsappPause','available','format','emit','whatsapp_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','localhost','name','timeout','strategy','beepall'];(function(_0x36a921,_0x51cf2a){var _0x25b0d2=function(_0x1041bd){while(--_0x1041bd){_0x36a921['push'](_0x36a921['shift']());}};_0x25b0d2(++_0x51cf2a);}(_0x6288,0xce));var _0x8628=function(_0x67ef3d,_0x50f0bd){_0x67ef3d=_0x67ef3d-0x0;var _0x2ef03e=_0x6288[_0x67ef3d];return _0x2ef03e;};'use strict';var _=require('lodash');var md5=require(_0x8628('0x0'));var util=require(_0x8628('0x1'));var Redis=require(_0x8628('0x2'));var config=require(_0x8628('0x3'));config[_0x8628('0x4')]=_['defaults'](config['redis'],{'host':_0x8628('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8628('0x4')]));function WhatsappQueue(_0xe67e90){this['id']=_0xe67e90['id']||0x0;this[_0x8628('0x6')]=_0xe67e90[_0x8628('0x6')]||'';this[_0x8628('0x7')]=_0xe67e90[_0x8628('0x7')]||0xa;this[_0x8628('0x8')]=_0xe67e90[_0x8628('0x8')]||_0x8628('0x9');this['Agents']=_0xe67e90[_0x8628('0xa')];this[_0x8628('0xb')]={};this[_0x8628('0xc')]=0x0;this['md5']='';this[_0x8628('0xd')]();this['updateRealtime']();}WhatsappQueue[_0x8628('0xe')][_0x8628('0xd')]=function(){var _0x31a885=this[_0x8628('0xb')]['_rr'];this[_0x8628('0xb')]=_['map'](this['Agents'],'id');this['mapAgentsId'][_0x8628('0xf')]=_0x31a885;};WhatsappQueue[_0x8628('0xe')][_0x8628('0x10')]=function(){this['loggedIn']=0x0;this[_0x8628('0x11')]=0x0;for(var _0x36e3ac=0x0;_0x36e3ac=0x0?this['available']:0x0;var _0xdee029={'id':this['id'],'available':this['available'],'loggedIn':this[_0x8628('0x14')],'name':this['name'],'paused':this[_0x8628('0x11')],'waiting':this[_0x8628('0xc')]};var _0x21a88=md5(JSON['stringify'](_0xdee029));if(this['md5']!==_0x21a88){this[_0x8628('0x0')]=_0x21a88;io['to'](util[_0x8628('0x17')]('whatsapp:queue:%s',_0xdee029[_0x8628('0x6')]))[_0x8628('0x18')](_0x8628('0x19'),_0xdee029);}};module[_0x8628('0x1a')]=WhatsappQueue; \ No newline at end of file +var _0x6080=['length','online','whatsappPause','available','name','format','whatsapp:queue:%s','whatsapp_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','localhost','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','_rr','map','loggedIn','paused'];(function(_0x4fbf9c,_0x45db15){var _0x2f4670=function(_0x4bda1c){while(--_0x4bda1c){_0x4fbf9c['push'](_0x4fbf9c['shift']());}};_0x2f4670(++_0x45db15);}(_0x6080,0xfc));var _0x0608=function(_0x1c1131,_0x183402){_0x1c1131=_0x1c1131-0x0;var _0x32471e=_0x6080[_0x1c1131];return _0x32471e;};'use strict';var _=require(_0x0608('0x0'));var md5=require(_0x0608('0x1'));var util=require('util');var Redis=require(_0x0608('0x2'));var config=require(_0x0608('0x3'));config[_0x0608('0x4')]=_['defaults'](config[_0x0608('0x4')],{'host':_0x0608('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0608('0x4')]));function WhatsappQueue(_0x504570){this['id']=_0x504570['id']||0x0;this['name']=_0x504570['name']||'';this[_0x0608('0x6')]=_0x504570[_0x0608('0x6')]||0xa;this['strategy']=_0x504570[_0x0608('0x7')]||_0x0608('0x8');this[_0x0608('0x9')]=_0x504570[_0x0608('0x9')];this[_0x0608('0xa')]={};this[_0x0608('0xb')]=0x0;this[_0x0608('0x1')]='';this['updateRouting']();this[_0x0608('0xc')]();}WhatsappQueue[_0x0608('0xd')]['updateRouting']=function(){var _0x5eebff=this['mapAgentsId'][_0x0608('0xe')];this['mapAgentsId']=_[_0x0608('0xf')](this['Agents'],'id');this[_0x0608('0xa')]['_rr']=_0x5eebff;};WhatsappQueue['prototype']['updateRealtime']=function(){this[_0x0608('0x10')]=0x0;this[_0x0608('0x11')]=0x0;for(var _0x1ab655=0x0;_0x1ab655=0x0?this[_0x0608('0x15')]:0x0;var _0x12c253={'id':this['id'],'available':this[_0x0608('0x15')],'loggedIn':this[_0x0608('0x10')],'name':this[_0x0608('0x16')],'paused':this[_0x0608('0x11')],'waiting':this[_0x0608('0xb')]};var _0x13bca3=md5(JSON['stringify'](_0x12c253));if(this[_0x0608('0x1')]!==_0x13bca3){this[_0x0608('0x1')]=_0x13bca3;io['to'](util[_0x0608('0x17')](_0x0608('0x18'),_0x12c253[_0x0608('0x16')]))['emit'](_0x0608('0x19'),_0x12c253);}};module[_0x0608('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 4f3aefe..da5a011 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(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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 da9c079..7c1e533 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 _0xa559=['Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','../client'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xa559,0x197));var _0x9a55=function(_0x43ec3e,_0x31fb8d){_0x43ec3e=_0x43ec3e-0x0;var _0x23599d=_0xa559[_0x43ec3e];return _0x23599d;};'use strict';var client=require(_0x9a55('0x0'));exports['update']=function(_0x186d8e,_0x1b901e){return client[_0x9a55('0x1')](_0x9a55('0x2'),{'body':_0x1b901e,'options':{'where':{'id':_0x186d8e}},'log':_0x9a55('0x3')});};exports[_0x9a55('0x4')]=function(_0x49543f,_0x30a37b){return client[_0x9a55('0x1')](_0x9a55('0x5'),{'body':_0x30a37b,'options':{'where':{'id':_0x49543f}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xd334=['addTagsToChatInteraction','../client','Request','addTags','AddTagsToChatInteraction'];(function(_0x232401,_0x318157){var _0x377d50=function(_0x5cab28){while(--_0x5cab28){_0x232401['push'](_0x232401['shift']());}};_0x377d50(++_0x318157);}(_0xd334,0x150));var _0x4d33=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xd334[_0x5bd426];return _0x23a7eb;};'use strict';var client=require(_0x4d33('0x0'));exports['update']=function(_0x517c0b,_0x46fffc){return client[_0x4d33('0x1')]('UpdateChatInteraction',{'body':_0x46fffc,'options':{'where':{'id':_0x517c0b}},'log':'updateChatInteraction'});};exports[_0x4d33('0x2')]=function(_0x4a1735,_0x16e7f7){return client[_0x4d33('0x1')](_0x4d33('0x3'),{'body':_0x16e7f7,'options':{'where':{'id':_0x4a1735}},'log':_0x4d33('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 617bf82..2ae8538 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 _0x55b6=['create','CreateChatMessage'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x55b6,0x9a));var _0x655b=function(_0x291ced,_0x12b436){_0x291ced=_0x291ced-0x0;var _0x4301a1=_0x55b6[_0x291ced];return _0x4301a1;};'use strict';var client=require('../client');exports[_0x655b('0x0')]=function(_0x1b192d){return client['Request'](_0x655b('0x1'),{'body':_0x1b192d,'log':'createChatMessage'});}; \ No newline at end of file +var _0xf69c=['Request','createChatMessage','../client','create'];(function(_0x565d73,_0x16aff8){var _0x4ac3a0=function(_0x524d5e){while(--_0x524d5e){_0x565d73['push'](_0x565d73['shift']());}};_0x4ac3a0(++_0x16aff8);}(_0xf69c,0x1e2));var _0xcf69=function(_0x20a822,_0x5dc295){_0x20a822=_0x20a822-0x0;var _0x3775d1=_0xf69c[_0x20a822];return _0x3775d1;};'use strict';var client=require(_0xcf69('0x0'));exports[_0xcf69('0x1')]=function(_0x478546){return client[_0xcf69('0x2')]('CreateChatMessage',{'body':_0x478546,'log':_0xcf69('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 0dfbdf0..5b52081 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 _0x9c48=['../client','getChatQueues','Request','name','timeout','strategy','online'];(function(_0x20ea2e,_0x245d7d){var _0x148222=function(_0x554d2e){while(--_0x554d2e){_0x20ea2e['push'](_0x20ea2e['shift']());}};_0x148222(++_0x245d7d);}(_0x9c48,0xa1));var _0x89c4=function(_0xdca4d1,_0x3cc65a){_0xdca4d1=_0xdca4d1-0x0;var _0xef0f65=_0x9c48[_0xdca4d1];return _0xef0f65;};'use strict';var client=require(_0x89c4('0x0'));exports[_0x89c4('0x1')]=function(){return function(){return client[_0x89c4('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x89c4('0x3'),_0x89c4('0x4'),_0x89c4('0x5')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x89c4('0x3'),_0x89c4('0x6'),'chatPause']}]},'log':_0x89c4('0x1')});};}; \ No newline at end of file +var _0xaab2=['User','Agents','name','chatPause','getChatQueues','Request','GetChatQueue','timeout','strategy'];(function(_0x275454,_0x12daca){var _0x1bdb36=function(_0x569c5f){while(--_0x569c5f){_0x275454['push'](_0x275454['shift']());}};_0x1bdb36(++_0x12daca);}(_0xaab2,0xca));var _0x2aab=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xaab2[_0x5bd426];return _0x23a7eb;};'use strict';var client=require('../client');exports[_0x2aab('0x0')]=function(){return function(){return client[_0x2aab('0x1')](_0x2aab('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x2aab('0x3'),_0x2aab('0x4')],'include':[{'model':_0x2aab('0x5'),'as':_0x2aab('0x6'),'attributes':['id',_0x2aab('0x7'),'online',_0x2aab('0x8')]}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index d8728ed..c20fd11 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 _0x6873=['UpdateChatQueueReport','DESC','Request','CreateChatQueueReport','update'];(function(_0x3080ae,_0x2ad78a){var _0x1430de=function(_0x3f0db1){while(--_0x3f0db1){_0x3080ae['push'](_0x3080ae['shift']());}};_0x1430de(++_0x2ad78a);}(_0x6873,0xac));var _0x3687=function(_0x257b0e,_0x563d7e){_0x257b0e=_0x257b0e-0x0;var _0x27ac2a=_0x6873[_0x257b0e];return _0x27ac2a;};'use strict';var client=require('../client');exports['create']=function(_0x319674){return client[_0x3687('0x0')](_0x3687('0x1'),{'body':_0x319674,'log':_0x3687('0x1')});};exports[_0x3687('0x2')]=function(_0x4bbecf,_0x247d96){return client['Request'](_0x3687('0x3'),{'body':_0x247d96,'options':{'where':{'uniqueid':_0x4bbecf},'order':[['id',_0x3687('0x4')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0x5c4a=['DESC','create','CreateChatQueueReport','Request','UpdateChatQueueReport'];(function(_0x52f159,_0x419d8a){var _0x156799=function(_0xf168e8){while(--_0xf168e8){_0x52f159['push'](_0x52f159['shift']());}};_0x156799(++_0x419d8a);}(_0x5c4a,0xfb));var _0xa5c4=function(_0x2f72d0,_0x4b288d){_0x2f72d0=_0x2f72d0-0x0;var _0x1d60a3=_0x5c4a[_0x2f72d0];return _0x1d60a3;};'use strict';var client=require('../client');exports[_0xa5c4('0x0')]=function(_0x1ba095){return client['Request'](_0xa5c4('0x1'),{'body':_0x1ba095,'log':_0xa5c4('0x1')});};exports['update']=function(_0x7411a4,_0x180239){return client[_0xa5c4('0x2')](_0xa5c4('0x3'),{'body':_0x180239,'options':{'where':{'uniqueid':_0x7411a4},'order':[['id',_0xa5c4('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 9591433..ad1dda6 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(_0x39e9df,_0x1d79c9){var _0x230b89=function(_0x42254c){while(--_0x42254c){_0x39e9df['push'](_0x39e9df['shift']());}};_0x230b89(++_0x1d79c9);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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(_0xd86a22,_0x58034d){var _0x2cc68b=function(_0x16171e){while(--_0x16171e){_0xd86a22['push'](_0xd86a22['shift']());}};_0x2cc68b(++_0x58034d);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'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 acede12..bcc7483 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 _0xcbda=['createFaxMessage','../client','create','Request','CreateFaxMessage'];(function(_0x2a59e0,_0xc12ff){var _0x48813a=function(_0x58f368){while(--_0x58f368){_0x2a59e0['push'](_0x2a59e0['shift']());}};_0x48813a(++_0xc12ff);}(_0xcbda,0x79));var _0xacbd=function(_0x410989,_0x4ec5d1){_0x410989=_0x410989-0x0;var _0x2fd676=_0xcbda[_0x410989];return _0x2fd676;};'use strict';var client=require(_0xacbd('0x0'));exports[_0xacbd('0x1')]=function(_0x426db0){return client[_0xacbd('0x2')](_0xacbd('0x3'),{'body':_0x426db0,'log':_0xacbd('0x4')});}; \ No newline at end of file +var _0x03c6=['CreateFaxMessage','createFaxMessage','../client','create'];(function(_0x31351d,_0x508e96){var _0x5cab25=function(_0x1181a7){while(--_0x1181a7){_0x31351d['push'](_0x31351d['shift']());}};_0x5cab25(++_0x508e96);}(_0x03c6,0x17e));var _0x603c=function(_0x23fff2,_0x369871){_0x23fff2=_0x23fff2-0x0;var _0x466c9=_0x03c6[_0x23fff2];return _0x466c9;};'use strict';var client=require(_0x603c('0x0'));exports[_0x603c('0x1')]=function(_0x3589cc){return client['Request'](_0x603c('0x2'),{'body':_0x3589cc,'log':_0x603c('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 89354ad..dcaf055 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 _0xc1b3=['Agents','../client','getFaxQueues','Request','GetFaxQueue','name','timeout','User'];(function(_0x3d4876,_0x366386){var _0x58ca9d=function(_0x5bd045){while(--_0x5bd045){_0x3d4876['push'](_0x3d4876['shift']());}};_0x58ca9d(++_0x366386);}(_0xc1b3,0x199));var _0x3c1b=function(_0x2f8421,_0x27e278){_0x2f8421=_0x2f8421-0x0;var _0x46af84=_0xc1b3[_0x2f8421];return _0x46af84;};'use strict';var client=require(_0x3c1b('0x0'));exports[_0x3c1b('0x1')]=function(){return function(){return client[_0x3c1b('0x2')](_0x3c1b('0x3'),{'options':{'raw':![],'attributes':['id',_0x3c1b('0x4'),_0x3c1b('0x5'),'strategy'],'include':[{'model':_0x3c1b('0x6'),'as':_0x3c1b('0x7'),'attributes':['id',_0x3c1b('0x4'),'online','faxPause']}]},'log':_0x3c1b('0x1')});};}; \ No newline at end of file +var _0x9eee=['Request','GetFaxQueue','name','timeout','strategy','online','faxPause','getFaxQueues','../client'];(function(_0x42e79a,_0x263ca1){var _0x21bb28=function(_0x527c14){while(--_0x527c14){_0x42e79a['push'](_0x42e79a['shift']());}};_0x21bb28(++_0x263ca1);}(_0x9eee,0x131));var _0xe9ee=function(_0xe4c80d,_0x345e82){_0xe4c80d=_0xe4c80d-0x0;var _0x20a426=_0x9eee[_0xe4c80d];return _0x20a426;};'use strict';var client=require(_0xe9ee('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0xe9ee('0x1')](_0xe9ee('0x2'),{'options':{'raw':![],'attributes':['id',_0xe9ee('0x3'),_0xe9ee('0x4'),_0xe9ee('0x5')],'include':[{'model':'User','as':'Agents','attributes':['id',_0xe9ee('0x3'),_0xe9ee('0x6'),_0xe9ee('0x7')]}]},'log':_0xe9ee('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index eed46d4..dcac123 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 _0x5b13=['CreateFaxQueueReport','Request','UpdateFaxQueueReport','DESC','../client','create'];(function(_0x2ddb20,_0x317f71){var _0x386027=function(_0x34f214){while(--_0x34f214){_0x2ddb20['push'](_0x2ddb20['shift']());}};_0x386027(++_0x317f71);}(_0x5b13,0x1c0));var _0x35b1=function(_0x5ca51d,_0xe86f27){_0x5ca51d=_0x5ca51d-0x0;var _0x5f3d85=_0x5b13[_0x5ca51d];return _0x5f3d85;};'use strict';var client=require(_0x35b1('0x0'));exports[_0x35b1('0x1')]=function(_0x2a32d4){return client['Request'](_0x35b1('0x2'),{'body':_0x2a32d4,'log':_0x35b1('0x2')});};exports['update']=function(_0x5395f6,_0x3d304e){return client[_0x35b1('0x3')](_0x35b1('0x4'),{'body':_0x3d304e,'options':{'where':{'uniqueid':_0x5395f6},'order':[['id',_0x35b1('0x5')]],'limit':0x1},'log':_0x35b1('0x4')});}; \ No newline at end of file +var _0xde2b=['CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client','create','Request'];(function(_0x4ee174,_0x433e46){var _0x5836dc=function(_0x4f08ab){while(--_0x4f08ab){_0x4ee174['push'](_0x4ee174['shift']());}};_0x5836dc(++_0x433e46);}(_0xde2b,0x131));var _0xbde2=function(_0x44e9cb,_0x589b66){_0x44e9cb=_0x44e9cb-0x0;var _0x1102df=_0xde2b[_0x44e9cb];return _0x1102df;};'use strict';var client=require(_0xbde2('0x0'));exports[_0xbde2('0x1')]=function(_0xa394b2){return client[_0xbde2('0x2')](_0xbde2('0x3'),{'body':_0xa394b2,'log':_0xbde2('0x3')});};exports[_0xbde2('0x4')]=function(_0x3b539f,_0x22da13){return client['Request'](_0xbde2('0x5'),{'body':_0x22da13,'options':{'where':{'uniqueid':_0x3b539f},'order':[['id',_0xbde2('0x6')]],'limit':0x1},'log':_0xbde2('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 1240757..b86a44c 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 _0x0a09=['interval','getIntervals','../client','Request','GetInterval','Interval','name'];(function(_0x18f2f5,_0x3bab2c){var _0x2f5981=function(_0x347cfd){while(--_0x347cfd){_0x18f2f5['push'](_0x18f2f5['shift']());}};_0x2f5981(++_0x3bab2c);}(_0x0a09,0x1f3));var _0x90a0=function(_0x3f4dd9,_0xe0b819){_0x3f4dd9=_0x3f4dd9-0x0;var _0x31c54a=_0x0a09[_0x3f4dd9];return _0x31c54a;};'use strict';var client=require(_0x90a0('0x0'));exports['getIntervals']=function(){return function(){return client[_0x90a0('0x1')](_0x90a0('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x90a0('0x3'),'as':'Intervals','attributes':['id',_0x90a0('0x4'),_0x90a0('0x5')]}]},'log':_0x90a0('0x6')});};}; \ No newline at end of file +var _0x77a3=['interval','../client','getIntervals','Request','GetInterval','name','Interval','Intervals'];(function(_0x438685,_0x4ec0c0){var _0x41cca2=function(_0x532003){while(--_0x532003){_0x438685['push'](_0x438685['shift']());}};_0x41cca2(++_0x4ec0c0);}(_0x77a3,0xa1));var _0x377a=function(_0x209e59,_0x266c29){_0x209e59=_0x209e59-0x0;var _0x3d534c=_0x77a3[_0x209e59];return _0x3d534c;};'use strict';var client=require(_0x377a('0x0'));exports[_0x377a('0x1')]=function(){return function(){return client[_0x377a('0x2')](_0x377a('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x377a('0x4')],'include':[{'model':_0x377a('0x5'),'as':_0x377a('0x6'),'attributes':['id',_0x377a('0x4'),_0x377a('0x7')]}]},'log':'getIntervals'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index ef1d1d0..04b1d2a 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 _0x28f2=['updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x65ce4b,_0x5bfb88){var _0x54a1f6=function(_0x52217){while(--_0x52217){_0x65ce4b['push'](_0x65ce4b['shift']());}};_0x54a1f6(++_0x5bfb88);}(_0x28f2,0x193));var _0x228f=function(_0x5a72cf,_0xf05bd3){_0x5a72cf=_0x5a72cf-0x0;var _0xabd451=_0x28f2[_0x5a72cf];return _0xabd451;};'use strict';var client=require(_0x228f('0x0'));exports[_0x228f('0x1')]=function(_0x108337,_0x2e5e0b){return client[_0x228f('0x2')]('UpdateMailInteraction',{'body':_0x2e5e0b,'options':{'where':{'id':_0x108337}},'log':_0x228f('0x3')});};exports[_0x228f('0x4')]=function(_0x79ed5f,_0x4303c3){return client[_0x228f('0x2')](_0x228f('0x5'),{'body':_0x4303c3,'options':{'where':{'id':_0x79ed5f}},'log':_0x228f('0x6')});}; \ No newline at end of file +var _0x57ca=['UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','update','Request'];(function(_0x1587c2,_0x4e9c58){var _0x4ee5f5=function(_0x205dea){while(--_0x205dea){_0x1587c2['push'](_0x1587c2['shift']());}};_0x4ee5f5(++_0x4e9c58);}(_0x57ca,0x108));var _0xa57c=function(_0x22c980,_0x44cb14){_0x22c980=_0x22c980-0x0;var _0x2d1ffe=_0x57ca[_0x22c980];return _0x2d1ffe;};'use strict';var client=require('../client');exports[_0xa57c('0x0')]=function(_0x4ad696,_0x4b1712){return client[_0xa57c('0x1')](_0xa57c('0x2'),{'body':_0x4b1712,'options':{'where':{'id':_0x4ad696}},'log':_0xa57c('0x3')});};exports[_0xa57c('0x4')]=function(_0x1da469,_0x48be2d){return client[_0xa57c('0x1')](_0xa57c('0x5'),{'body':_0x48be2d,'options':{'where':{'id':_0x1da469}},'log':_0xa57c('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 485b652..c8232cd 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 _0x747f=['Request','CreateMailMessage','createMailMessage','../client','create'];(function(_0x49ebe6,_0x2921df){var _0x568d77=function(_0x5af2d7){while(--_0x5af2d7){_0x49ebe6['push'](_0x49ebe6['shift']());}};_0x568d77(++_0x2921df);}(_0x747f,0x1b1));var _0xf747=function(_0x2a0a9f,_0x778485){_0x2a0a9f=_0x2a0a9f-0x0;var _0x3efd01=_0x747f[_0x2a0a9f];return _0x3efd01;};'use strict';var client=require(_0xf747('0x0'));exports[_0xf747('0x1')]=function(_0x1c6a8f){return client[_0xf747('0x2')](_0xf747('0x3'),{'body':_0x1c6a8f,'log':_0xf747('0x4')});}; \ No newline at end of file +var _0xf659=['../client','Request','CreateMailMessage','createMailMessage'];(function(_0x5a5cb4,_0x227321){var _0x21eede=function(_0x4d09d3){while(--_0x4d09d3){_0x5a5cb4['push'](_0x5a5cb4['shift']());}};_0x21eede(++_0x227321);}(_0xf659,0x1b8));var _0x9f65=function(_0x5c88ff,_0x19e675){_0x5c88ff=_0x5c88ff-0x0;var _0x4eec40=_0xf659[_0x5c88ff];return _0x4eec40;};'use strict';var client=require(_0x9f65('0x0'));exports['create']=function(_0x24937e){return client[_0x9f65('0x1')](_0x9f65('0x2'),{'body':_0x24937e,'log':_0x9f65('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index c376c2d..88a4e7f 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 _0x82c0=['getMailQueues','Request','GetMailQueue','name','timeout','strategy','User','online','mailPause'];(function(_0x5cd993,_0x3d4f12){var _0x1f3fbe=function(_0x43627d){while(--_0x43627d){_0x5cd993['push'](_0x5cd993['shift']());}};_0x1f3fbe(++_0x3d4f12);}(_0x82c0,0xc6));var _0x082c=function(_0x5bde12,_0x2741cc){_0x5bde12=_0x5bde12-0x0;var _0x580777=_0x82c0[_0x5bde12];return _0x580777;};'use strict';var client=require('../client');exports[_0x082c('0x0')]=function(){return function(){return client[_0x082c('0x1')](_0x082c('0x2'),{'options':{'raw':![],'attributes':['id',_0x082c('0x3'),_0x082c('0x4'),_0x082c('0x5')],'include':[{'model':_0x082c('0x6'),'as':'Agents','attributes':['id',_0x082c('0x3'),_0x082c('0x7'),_0x082c('0x8')]}]},'log':_0x082c('0x0')});};}; \ No newline at end of file +var _0xabac=['mailPause','../client','getMailQueues','Request','User','Agents','name'];(function(_0x62b58e,_0x46fe1e){var _0x37fe84=function(_0x12a2ca){while(--_0x12a2ca){_0x62b58e['push'](_0x62b58e['shift']());}};_0x37fe84(++_0x46fe1e);}(_0xabac,0x1dd));var _0xcaba=function(_0x91384,_0x476988){_0x91384=_0x91384-0x0;var _0x1a16c2=_0xabac[_0x91384];return _0x1a16c2;};'use strict';var client=require(_0xcaba('0x0'));exports[_0xcaba('0x1')]=function(){return function(){return client[_0xcaba('0x2')]('GetMailQueue',{'options':{'raw':![],'attributes':['id','name','timeout','strategy'],'include':[{'model':_0xcaba('0x3'),'as':_0xcaba('0x4'),'attributes':['id',_0xcaba('0x5'),'online',_0xcaba('0x6')]}]},'log':_0xcaba('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 1b4ff7e..3841e78 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 _0x8db6=['create','CreateMailQueueReport','update','Request','UpdateMailQueueReport','DESC','../client'];(function(_0x3b8eb0,_0x354ada){var _0x3b6b34=function(_0x38cdc2){while(--_0x38cdc2){_0x3b8eb0['push'](_0x3b8eb0['shift']());}};_0x3b6b34(++_0x354ada);}(_0x8db6,0x102));var _0x68db=function(_0x162780,_0x47f2e2){_0x162780=_0x162780-0x0;var _0x1ea2dc=_0x8db6[_0x162780];return _0x1ea2dc;};'use strict';var client=require(_0x68db('0x0'));exports[_0x68db('0x1')]=function(_0x16c1ad){return client['Request'](_0x68db('0x2'),{'body':_0x16c1ad,'log':_0x68db('0x2')});};exports[_0x68db('0x3')]=function(_0x3249ae,_0x67459){return client[_0x68db('0x4')](_0x68db('0x5'),{'body':_0x67459,'options':{'where':{'uniqueid':_0x3249ae},'order':[['id',_0x68db('0x6')]],'limit':0x1},'log':_0x68db('0x5')});}; \ No newline at end of file +var _0x8ba1=['CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client','create','Request'];(function(_0x2ee952,_0x50412d){var _0x269d67=function(_0x5b9390){while(--_0x5b9390){_0x2ee952['push'](_0x2ee952['shift']());}};_0x269d67(++_0x50412d);}(_0x8ba1,0x170));var _0x18ba=function(_0x3cccca,_0x465c35){_0x3cccca=_0x3cccca-0x0;var _0x1cb192=_0x8ba1[_0x3cccca];return _0x1cb192;};'use strict';var client=require(_0x18ba('0x0'));exports[_0x18ba('0x1')]=function(_0xb382a3){return client[_0x18ba('0x2')](_0x18ba('0x3'),{'body':_0xb382a3,'log':_0x18ba('0x3')});};exports[_0x18ba('0x4')]=function(_0x2bbd1a,_0x32b8d5){return client[_0x18ba('0x2')](_0x18ba('0x5'),{'body':_0x32b8d5,'options':{'where':{'uniqueid':_0x2bbd1a},'order':[['id',_0x18ba('0x6')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 21e77cd..1688142 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 _0x7f23=['updateOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request','UpdateOpenchannelInteraction'];(function(_0x1a68ec,_0x2ab029){var _0x59ecde=function(_0x168d5a){while(--_0x168d5a){_0x1a68ec['push'](_0x1a68ec['shift']());}};_0x59ecde(++_0x2ab029);}(_0x7f23,0x122));var _0x37f2=function(_0x5710e5,_0x5cc444){_0x5710e5=_0x5710e5-0x0;var _0x43688d=_0x7f23[_0x5710e5];return _0x43688d;};'use strict';var client=require(_0x37f2('0x0'));exports[_0x37f2('0x1')]=function(_0x8b73c4,_0x5b3092){return client[_0x37f2('0x2')](_0x37f2('0x3'),{'body':_0x5b3092,'options':{'where':{'id':_0x8b73c4}},'log':_0x37f2('0x4')});};exports['addTags']=function(_0x4d4843,_0x96b685){return client['Request']('AddTagsToOpenchannelInteraction',{'body':_0x96b685,'options':{'where':{'id':_0x4d4843}},'log':_0x37f2('0x5')});}; \ No newline at end of file +var _0x7940=['Request','../client','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags'];(function(_0x5b1cf8,_0x74f6d8){var _0x4cceaf=function(_0x5a9e13){while(--_0x5a9e13){_0x5b1cf8['push'](_0x5b1cf8['shift']());}};_0x4cceaf(++_0x74f6d8);}(_0x7940,0xc9));var _0x0794=function(_0x538421,_0x4fe837){_0x538421=_0x538421-0x0;var _0xa63b46=_0x7940[_0x538421];return _0xa63b46;};'use strict';var client=require(_0x0794('0x0'));exports['update']=function(_0x33c9a7,_0x9339a9){return client['Request'](_0x0794('0x1'),{'body':_0x9339a9,'options':{'where':{'id':_0x33c9a7}},'log':_0x0794('0x2')});};exports[_0x0794('0x3')]=function(_0x5f48ef,_0x8bb7f4){return client[_0x0794('0x4')]('AddTagsToOpenchannelInteraction',{'body':_0x8bb7f4,'options':{'where':{'id':_0x5f48ef}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 41c8e8b..72b308e 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 _0x8d6f=['Request','CreateOpenchannelMessage','createOpenchannelMessage','create'];(function(_0x90f6be,_0x5ebf25){var _0x41f160=function(_0x4ea5f6){while(--_0x4ea5f6){_0x90f6be['push'](_0x90f6be['shift']());}};_0x41f160(++_0x5ebf25);}(_0x8d6f,0xb7));var _0xf8d6=function(_0x2ff8f2,_0x139c17){_0x2ff8f2=_0x2ff8f2-0x0;var _0x461fc3=_0x8d6f[_0x2ff8f2];return _0x461fc3;};'use strict';var client=require('../client');exports[_0xf8d6('0x0')]=function(_0x4a9158){return client[_0xf8d6('0x1')](_0xf8d6('0x2'),{'body':_0x4a9158,'log':_0xf8d6('0x3')});}; \ No newline at end of file +var _0x0898=['Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x5d547f,_0x50a029){var _0x66efe3=function(_0x53d84f){while(--_0x53d84f){_0x5d547f['push'](_0x5d547f['shift']());}};_0x66efe3(++_0x50a029);}(_0x0898,0x153));var _0x8089=function(_0x296606,_0x1322cb){_0x296606=_0x296606-0x0;var _0x3fe9c1=_0x0898[_0x296606];return _0x3fe9c1;};'use strict';var client=require(_0x8089('0x0'));exports['create']=function(_0x4b7ff9){return client[_0x8089('0x1')](_0x8089('0x2'),{'body':_0x4b7ff9,'log':_0x8089('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 2d3cf3f..85b2cef 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 _0x41cb=['Agents','online','openchannelPause','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','User'];(function(_0x301d39,_0x241c59){var _0x304a8f=function(_0x4c6c34){while(--_0x4c6c34){_0x301d39['push'](_0x301d39['shift']());}};_0x304a8f(++_0x241c59);}(_0x41cb,0xf6));var _0xb41c=function(_0x555de5,_0x3470ae){_0x555de5=_0x555de5-0x0;var _0x580885=_0x41cb[_0x555de5];return _0x580885;};'use strict';var client=require('../client');exports[_0xb41c('0x0')]=function(){return function(){return client[_0xb41c('0x1')](_0xb41c('0x2'),{'options':{'raw':![],'attributes':['id',_0xb41c('0x3'),_0xb41c('0x4'),'strategy'],'include':[{'model':_0xb41c('0x5'),'as':_0xb41c('0x6'),'attributes':['id',_0xb41c('0x3'),_0xb41c('0x7'),_0xb41c('0x8')]}]},'log':_0xb41c('0x0')});};}; \ No newline at end of file +var _0x30e7=['getOpenchannelQueues','GetOpenchannelQueue','name','openchannelPause','../client'];(function(_0x342012,_0x33d020){var _0x59bfd0=function(_0x193c99){while(--_0x193c99){_0x342012['push'](_0x342012['shift']());}};_0x59bfd0(++_0x33d020);}(_0x30e7,0x144));var _0x730e=function(_0x41c34f,_0x381624){_0x41c34f=_0x41c34f-0x0;var _0x37a29d=_0x30e7[_0x41c34f];return _0x37a29d;};'use strict';var client=require(_0x730e('0x0'));exports[_0x730e('0x1')]=function(){return function(){return client['Request'](_0x730e('0x2'),{'options':{'raw':![],'attributes':['id',_0x730e('0x3'),'timeout','strategy'],'include':[{'model':'User','as':'Agents','attributes':['id',_0x730e('0x3'),'online',_0x730e('0x4')]}]},'log':_0x730e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 7f0c267..cc2a028 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 _0x7208=['update','UpdateOpenchannelQueueReport','DESC','../client','Request','CreateOpenchannelQueueReport'];(function(_0x4cda83,_0x35e227){var _0x48673c=function(_0x480355){while(--_0x480355){_0x4cda83['push'](_0x4cda83['shift']());}};_0x48673c(++_0x35e227);}(_0x7208,0x16b));var _0x8720=function(_0x59f3d2,_0x5861db){_0x59f3d2=_0x59f3d2-0x0;var _0x6151ff=_0x7208[_0x59f3d2];return _0x6151ff;};'use strict';var client=require(_0x8720('0x0'));exports['create']=function(_0x71a686){return client[_0x8720('0x1')]('CreateOpenchannelQueueReport',{'body':_0x71a686,'log':_0x8720('0x2')});};exports[_0x8720('0x3')]=function(_0x5d42a6,_0x560799){return client[_0x8720('0x1')](_0x8720('0x4'),{'body':_0x560799,'options':{'where':{'uniqueid':_0x5d42a6},'order':[['id',_0x8720('0x5')]],'limit':0x1},'log':_0x8720('0x4')});}; \ No newline at end of file +var _0xf8ea=['UpdateOpenchannelQueueReport','DESC','Request','CreateOpenchannelQueueReport','update'];(function(_0x59d866,_0x27f8c9){var _0x4f3ca3=function(_0x43a0d6){while(--_0x43a0d6){_0x59d866['push'](_0x59d866['shift']());}};_0x4f3ca3(++_0x27f8c9);}(_0xf8ea,0x1bf));var _0xaf8e=function(_0x356a6c,_0x55fe73){_0x356a6c=_0x356a6c-0x0;var _0x4aeb8d=_0xf8ea[_0x356a6c];return _0x4aeb8d;};'use strict';var client=require('../client');exports['create']=function(_0x2b88db){return client[_0xaf8e('0x0')](_0xaf8e('0x1'),{'body':_0x2b88db,'log':'CreateOpenchannelQueueReport'});};exports[_0xaf8e('0x2')]=function(_0x5ed763,_0x336fa4){return client[_0xaf8e('0x0')](_0xaf8e('0x3'),{'body':_0x336fa4,'options':{'where':{'uniqueid':_0x5ed763},'order':[['id',_0xaf8e('0x4')]],'limit':0x1},'log':_0xaf8e('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index dcc265c..b629807 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 _0x425d=['updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','Request','UpdateSmsInteraction'];(function(_0x50fe7e,_0x59bde9){var _0x5cf157=function(_0x3c01a1){while(--_0x3c01a1){_0x50fe7e['push'](_0x50fe7e['shift']());}};_0x5cf157(++_0x59bde9);}(_0x425d,0x1e0));var _0xd425=function(_0x38037a,_0x196abc){_0x38037a=_0x38037a-0x0;var _0x1a1246=_0x425d[_0x38037a];return _0x1a1246;};'use strict';var client=require(_0xd425('0x0'));exports['update']=function(_0x322866,_0x2d1eb3){return client[_0xd425('0x1')](_0xd425('0x2'),{'body':_0x2d1eb3,'options':{'where':{'id':_0x322866}},'log':_0xd425('0x3')});};exports[_0xd425('0x4')]=function(_0x47043f,_0x596be7){return client[_0xd425('0x1')](_0xd425('0x5'),{'body':_0x596be7,'options':{'where':{'id':_0x47043f}},'log':_0xd425('0x6')});}; \ No newline at end of file +var _0x615a=['Request','UpdateSmsInteraction','updateSmsInteraction','addTags','addTagsToSmsInteraction','../client'];(function(_0x5c4ce7,_0x322c3b){var _0x3edbd7=function(_0x50d668){while(--_0x50d668){_0x5c4ce7['push'](_0x5c4ce7['shift']());}};_0x3edbd7(++_0x322c3b);}(_0x615a,0x119));var _0xa615=function(_0x3e151d,_0x5b96a8){_0x3e151d=_0x3e151d-0x0;var _0x10ad6a=_0x615a[_0x3e151d];return _0x10ad6a;};'use strict';var client=require(_0xa615('0x0'));exports['update']=function(_0x21ebaf,_0x5b0d82){return client[_0xa615('0x1')](_0xa615('0x2'),{'body':_0x5b0d82,'options':{'where':{'id':_0x21ebaf}},'log':_0xa615('0x3')});};exports[_0xa615('0x4')]=function(_0x52ae35,_0x1d9a38){return client[_0xa615('0x1')]('AddTagsToSmsInteraction',{'body':_0x1d9a38,'options':{'where':{'id':_0x52ae35}},'log':_0xa615('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index a7da684..d6b97de 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 _0xf120=['Request','CreateSmsMessage','create'];(function(_0x520b52,_0x1c1d2b){var _0x393906=function(_0x366832){while(--_0x366832){_0x520b52['push'](_0x520b52['shift']());}};_0x393906(++_0x1c1d2b);}(_0xf120,0x149));var _0x0f12=function(_0x399941,_0x544c88){_0x399941=_0x399941-0x0;var _0x4071b0=_0xf120[_0x399941];return _0x4071b0;};'use strict';var client=require('../client');exports[_0x0f12('0x0')]=function(_0x4130d3){return client[_0x0f12('0x1')](_0x0f12('0x2'),{'body':_0x4130d3,'log':'createSmsMessage'});}; \ No newline at end of file +var _0x318d=['CreateSmsMessage','createSmsMessage','../client','create','Request'];(function(_0x34b31b,_0x21052f){var _0x12ea38=function(_0x473640){while(--_0x473640){_0x34b31b['push'](_0x34b31b['shift']());}};_0x12ea38(++_0x21052f);}(_0x318d,0x1d3));var _0xd318=function(_0x2f037f,_0x2958c5){_0x2f037f=_0x2f037f-0x0;var _0x2d1573=_0x318d[_0x2f037f];return _0x2d1573;};'use strict';var client=require(_0xd318('0x0'));exports[_0xd318('0x1')]=function(_0x5eefa4){return client[_0xd318('0x2')](_0xd318('0x3'),{'body':_0x5eefa4,'log':_0xd318('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 1bda1e2..cabc221 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['online','../client','Request','name','strategy','Agents'];(function(_0x4f1b7b,_0x374ac1){var _0x1f9068=function(_0x501121){while(--_0x501121){_0x4f1b7b['push'](_0x4f1b7b['shift']());}};_0x1f9068(++_0x374ac1);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xb7e7[_0x2b4411];return _0x8e41ef;};'use strict';var client=require(_0x7b7e('0x0'));exports['getSmsQueues']=function(){return function(){return client[_0x7b7e('0x1')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x7b7e('0x2'),'timeout',_0x7b7e('0x3')],'include':[{'model':'User','as':_0x7b7e('0x4'),'attributes':['id',_0x7b7e('0x2'),_0x7b7e('0x5'),'smsPause']}]},'log':'getSmsQueues'});};}; \ No newline at end of file +var _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x148622,_0x4cec00){var _0x5a9875=function(_0x3be425){while(--_0x3be425){_0x148622['push'](_0x148622['shift']());}};_0x5a9875(++_0x4cec00);}(_0x70e0,0x17b));var _0x070e=function(_0x38e59c,_0x2ff0f0){_0x38e59c=_0x38e59c-0x0;var _0x439789=_0x70e0[_0x38e59c];return _0x439789;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x070e('0x3'),_0x070e('0x4')],'include':[{'model':_0x070e('0x5'),'as':_0x070e('0x6'),'attributes':['id','name',_0x070e('0x7'),'smsPause']}]},'log':_0x070e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 852dd59..bc4df7d 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 _0x70e0=['create','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0xd5f0fd,_0x1c2a3a){var _0xf46aa4=function(_0x55c9f9){while(--_0x55c9f9){_0xd5f0fd['push'](_0xd5f0fd['shift']());}};_0xf46aa4(++_0x1c2a3a);}(_0x70e0,0x17b));var _0x070e=function(_0x3f95a0,_0x2b51dd){_0x3f95a0=_0x3f95a0-0x0;var _0x597f41=_0x70e0[_0x3f95a0];return _0x597f41;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(_0x198c2e){return client['Request']('CreateSmsQueueReport',{'body':_0x198c2e,'log':_0x070e('0x2')});};exports[_0x070e('0x3')]=function(_0x277d32,_0x2593e5){return client['Request'](_0x070e('0x4'),{'body':_0x2593e5,'options':{'where':{'uniqueid':_0x277d32},'order':[['id','DESC']],'limit':0x1},'log':_0x070e('0x4')});}; \ No newline at end of file +var _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x4bb6d4,_0x32621b){var _0x126376=function(_0x2e706a){while(--_0x2e706a){_0x4bb6d4['push'](_0x4bb6d4['shift']());}};_0x126376(++_0x32621b);}(_0x34e8,0x12c));var _0x834e=function(_0x1bcfa6,_0x5d6a5c){_0x1bcfa6=_0x1bcfa6-0x0;var _0x37eccf=_0x34e8[_0x1bcfa6];return _0x37eccf;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 83b60a3..4fd79ef 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(_0x1af6ff,_0x15330f){var _0x4c2963=function(_0x4b9adc){while(--_0x4b9adc){_0x1af6ff['push'](_0x1af6ff['shift']());}};_0x4c2963(++_0x15330f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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(_0x249436,_0x51b25e){var _0x25084d=function(_0x59197e){while(--_0x59197e){_0x249436['push'](_0x249436['shift']());}};_0x25084d(++_0x51b25e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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 a0cfeea..6151c01 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 _0x3fa4=['../client','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','addTagsToWhatsappInteraction'];(function(_0x5c541f,_0x3e2fd9){var _0x390684=function(_0x4549ec){while(--_0x4549ec){_0x5c541f['push'](_0x5c541f['shift']());}};_0x390684(++_0x3e2fd9);}(_0x3fa4,0xf0));var _0x43fa=function(_0x115a1e,_0x10be6f){_0x115a1e=_0x115a1e-0x0;var _0x4ff007=_0x3fa4[_0x115a1e];return _0x4ff007;};'use strict';var client=require(_0x43fa('0x0'));exports['update']=function(_0x56dbea,_0x51997a){return client[_0x43fa('0x1')](_0x43fa('0x2'),{'body':_0x51997a,'options':{'where':{'id':_0x56dbea}},'log':_0x43fa('0x3')});};exports[_0x43fa('0x4')]=function(_0x2defb2,_0x6b36ce){return client[_0x43fa('0x1')]('AddTagsToWhatsappInteraction',{'body':_0x6b36ce,'options':{'where':{'id':_0x2defb2}},'log':_0x43fa('0x5')});}; \ No newline at end of file +var _0x5d58=['updateWhatsappInteraction','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','UpdateWhatsappInteraction'];(function(_0x3bf1e0,_0x1580be){var _0x5a9ded=function(_0x229240){while(--_0x229240){_0x3bf1e0['push'](_0x3bf1e0['shift']());}};_0x5a9ded(++_0x1580be);}(_0x5d58,0x187));var _0x85d5=function(_0x17bcf9,_0x34ecbf){_0x17bcf9=_0x17bcf9-0x0;var _0x2edea8=_0x5d58[_0x17bcf9];return _0x2edea8;};'use strict';var client=require('../client');exports['update']=function(_0x5e2da7,_0x54bfc4){return client['Request'](_0x85d5('0x0'),{'body':_0x54bfc4,'options':{'where':{'id':_0x5e2da7}},'log':_0x85d5('0x1')});};exports['addTags']=function(_0x1469fc,_0x30bfe8){return client['Request'](_0x85d5('0x2'),{'body':_0x30bfe8,'options':{'where':{'id':_0x1469fc}},'log':_0x85d5('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 45acd1f..6acdd51 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 _0xc9df=['Request','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x4a2e9d,_0x2d4a35){var _0x25eb55=function(_0xebdf54){while(--_0xebdf54){_0x4a2e9d['push'](_0x4a2e9d['shift']());}};_0x25eb55(++_0x2d4a35);}(_0xc9df,0x1ec));var _0xfc9d=function(_0x453ef9,_0x2f5a9a){_0x453ef9=_0x453ef9-0x0;var _0x2f40a3=_0xc9df[_0x453ef9];return _0x2f40a3;};'use strict';var client=require('../client');exports['create']=function(_0x56717d){return client[_0xfc9d('0x0')](_0xfc9d('0x1'),{'body':_0x56717d,'log':_0xfc9d('0x2')});}; \ No newline at end of file +var _0x85f4=['create','Request','createWhatsappMessage'];(function(_0x41beb0,_0x2298de){var _0x77cc6f=function(_0x2f2cce){while(--_0x2f2cce){_0x41beb0['push'](_0x41beb0['shift']());}};_0x77cc6f(++_0x2298de);}(_0x85f4,0x18f));var _0x485f=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x85f4[_0x334841];return _0x5beb4b;};'use strict';var client=require('../client');exports[_0x485f('0x0')]=function(_0x47728b){return client[_0x485f('0x1')]('CreateWhatsappMessage',{'body':_0x47728b,'log':_0x485f('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index cf6aa7a..056e49d 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 _0x71a3=['whatsappPause','getWhatsappQueues','Request','GetWhatsappQueue','name','timeout','strategy','User','online'];(function(_0x1a0e41,_0x2e1085){var _0x202914=function(_0x4172e7){while(--_0x4172e7){_0x1a0e41['push'](_0x1a0e41['shift']());}};_0x202914(++_0x2e1085);}(_0x71a3,0xd9));var _0x371a=function(_0xe191d6,_0x235841){_0xe191d6=_0xe191d6-0x0;var _0x278b79=_0x71a3[_0xe191d6];return _0x278b79;};'use strict';var client=require('../client');exports[_0x371a('0x0')]=function(){return function(){return client[_0x371a('0x1')](_0x371a('0x2'),{'options':{'raw':![],'attributes':['id',_0x371a('0x3'),_0x371a('0x4'),_0x371a('0x5')],'include':[{'model':_0x371a('0x6'),'as':'Agents','attributes':['id','name',_0x371a('0x7'),_0x371a('0x8')]}]},'log':_0x371a('0x0')});};}; \ No newline at end of file +var _0x95f7=['GetWhatsappQueue','timeout','User','name','online','Request'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x95f7,0x1f1));var _0x795f=function(_0x38677b,_0x33ee4c){_0x38677b=_0x38677b-0x0;var _0x5d3b12=_0x95f7[_0x38677b];return _0x5d3b12;};'use strict';var client=require('../client');exports['getWhatsappQueues']=function(){return function(){return client[_0x795f('0x0')](_0x795f('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x795f('0x2'),'strategy'],'include':[{'model':_0x795f('0x3'),'as':'Agents','attributes':['id',_0x795f('0x4'),_0x795f('0x5'),'whatsappPause']}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 4732657..a9be189 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 _0x1fff=['UpdateWhatsappQueueReport','DESC','../client','create','Request','CreateWhatsappQueueReport','update'];(function(_0x1857c6,_0x48840c){var _0x51011c=function(_0x3a4736){while(--_0x3a4736){_0x1857c6['push'](_0x1857c6['shift']());}};_0x51011c(++_0x48840c);}(_0x1fff,0x128));var _0xf1ff=function(_0x599fd3,_0x168fd8){_0x599fd3=_0x599fd3-0x0;var _0x5d14d7=_0x1fff[_0x599fd3];return _0x5d14d7;};'use strict';var client=require(_0xf1ff('0x0'));exports[_0xf1ff('0x1')]=function(_0x212774){return client[_0xf1ff('0x2')](_0xf1ff('0x3'),{'body':_0x212774,'log':_0xf1ff('0x3')});};exports[_0xf1ff('0x4')]=function(_0x2feeaf,_0xae85c){return client[_0xf1ff('0x2')](_0xf1ff('0x5'),{'body':_0xae85c,'options':{'where':{'uniqueid':_0x2feeaf},'order':[['id',_0xf1ff('0x6')]],'limit':0x1},'log':_0xf1ff('0x5')});}; \ No newline at end of file +var _0x54da=['Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC'];(function(_0x1f37e1,_0x1b42ea){var _0x329f45=function(_0x1fa98c){while(--_0x1fa98c){_0x1f37e1['push'](_0x1f37e1['shift']());}};_0x329f45(++_0x1b42ea);}(_0x54da,0x73));var _0xa54d=function(_0x4f9476,_0x3eadc7){_0x4f9476=_0x4f9476-0x0;var _0x3296a4=_0x54da[_0x4f9476];return _0x3296a4;};'use strict';var client=require('../client');exports['create']=function(_0x592b22){return client[_0xa54d('0x0')](_0xa54d('0x1'),{'body':_0x592b22,'log':_0xa54d('0x1')});};exports[_0xa54d('0x2')]=function(_0x70a58,_0x3d4242){return client[_0xa54d('0x0')](_0xa54d('0x3'),{'body':_0x3d4242,'options':{'where':{'uniqueid':_0x70a58},'order':[['id',_0xa54d('0x4')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ 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 38087d0..b3f064a 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 _0x4b21=['[%s][AGENT]\x20%s','map','message','join','find','agents','timeout','createQueue','channel','START:%s','rules','end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','stop','[%s][QUEUE]\x20%s','validate','lodash','util','seq-queue','../../../../config/logger','routing','number','timeout\x20is\x20a\x20number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','consequence','error'];(function(_0x148d11,_0x49c0c3){var _0x300a7a=function(_0x427f32){while(--_0x427f32){_0x148d11['push'](_0x148d11['shift']());}};_0x300a7a(++_0x49c0c3);}(_0x4b21,0x1dd));var _0x14b2=function(_0x4a3e53,_0x5d68db){_0x4a3e53=_0x4a3e53-0x0;var _0x50ef75=_0x4b21[_0x4a3e53];return _0x50ef75;};'use strict';var schema=require(_0x14b2('0x0'));var _=require(_0x14b2('0x1'));var util=require(_0x14b2('0x2'));var seqqueue=require(_0x14b2('0x3'));var logger=require(_0x14b2('0x4'))(_0x14b2('0x5'));var strategy=require('./strategy');var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x14b2('0x6'),'message':_0x14b2('0x7')}});function writeLog(_0x35fa49,_0x3fa013,_0x4f56ba){return logger['info'](util[_0x14b2('0x8')](_0x14b2('0x9'),_0x35fa49,_0x3fa013[_0x14b2('0xa')],_0x4f56ba));}function handleFindAgent(_0x22c695){return function(_0x1533ab){return _0x1533ab['name']['toLowerCase']()===_0x22c695['toLowerCase']();};}exports[_0x14b2('0xb')]=function(_0x584f47,_0x448a73,_0x1cc79e,_0xa84d5b){return function(_0x239926){try{var _0x57c82c={'name':_0x448a73[0x0],'timeout':_0x448a73[0x1]};var _0x34366c=queue[_0x14b2('0x0')](_0x57c82c,{'typecast':!![]});if(_0x34366c['length']){logger[_0x14b2('0xc')](_0x14b2('0xd'),_0x584f47,_[_0x14b2('0xe')](_0x34366c,_0x14b2('0xf'))[_0x14b2('0x10')](',\x20'));_0x239926['stop']();}else{var _0x287659=_[_0x14b2('0x11')](_0x1cc79e[_0x14b2('0x12')],handleFindAgent(_0x57c82c[_0x14b2('0xa')]));if(_0x287659){var _0x3caf95=(_0x57c82c[_0x14b2('0x13')]||0xa)*0x3e8;var _0xdfe1a0,_0x518e07;var _0x5f5c8c=seqqueue[_0x14b2('0x14')](_0x3caf95);_0x5f5c8c['id']=_0x584f47;_0x5f5c8c['atimeout']=_0x3caf95;_0x5f5c8c[_0x14b2('0x15')]=_0xa84d5b[_0x14b2('0x15')];writeLog(_0x584f47,_0x287659,util[_0x14b2('0x8')](_0x14b2('0x16'),_0x3caf95));_0x1cc79e[_0x14b2('0x17')][_0x584f47]['on'](_0x14b2('0x18'),function(){logger[_0x14b2('0x19')](_0x14b2('0x1a'),_0x584f47);clearTimeout(_0x518e07);_0x518e07=undefined;_0x5f5c8c[_0x14b2('0x1b')]();if(_0x1cc79e['rules'][_0x584f47]){delete _0x1cc79e[_0x14b2('0x17')][_0x584f47];}_0x239926['stop']();});_0x1cc79e[_0x14b2('0x17')][_0x584f47]['on'](_0x14b2('0x1c'),function(){if(_0x1cc79e[_0x14b2('0x17')][_0x584f47]){delete _0x1cc79e['rules'][_0x584f47];}});_0x518e07=setTimeout(function(){logger['info'](_0x14b2('0x1d'),_0x584f47);clearTimeout(_0x518e07);_0x5f5c8c[_0x14b2('0x1b')]();_0x239926[_0x14b2('0x1e')]();},_0x3caf95);strategy[_0x14b2('0x1f')](_0x5f5c8c,_0x287659,_0x1cc79e,_0xa84d5b);}else{logger[_0x14b2('0xc')](_0x14b2('0x20'),_0x584f47,_0x57c82c[_0x14b2('0xa')]);_0x239926[_0x14b2('0x21')]();}}}catch(_0x17cd48){console['log'](_0x17cd48);logger['error'](_0x14b2('0x22'),_0x584f47,_0x17cd48['stack']);_0x239926[_0x14b2('0x21')]();}};}; \ No newline at end of file +var _0x85a4=['info','format','name','toLowerCase','consequence','length','error','map','join','stop','agents','atimeout','channel','rules','end','complete','[%s][AGENT]\x20ROUTING\x20END','close','agent','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number'];(function(_0x2184f9,_0x46b7eb){var _0x2279f3=function(_0x157f54){while(--_0x157f54){_0x2184f9['push'](_0x2184f9['shift']());}};_0x2279f3(++_0x46b7eb);}(_0x85a4,0xc9));var _0x485a=function(_0x1c2c20,_0x2da7da){_0x1c2c20=_0x1c2c20-0x0;var _0x5adae=_0x85a4[_0x1c2c20];return _0x5adae;};'use strict';var schema=require(_0x485a('0x0'));var _=require(_0x485a('0x1'));var util=require(_0x485a('0x2'));var seqqueue=require(_0x485a('0x3'));var logger=require(_0x485a('0x4'))('routing');var strategy=require(_0x485a('0x5'));var queue=schema({'name':{'type':_0x485a('0x6'),'required':!![],'message':_0x485a('0x7')},'timeout':{'type':'number','message':_0x485a('0x8')}});function writeLog(_0x5b1ed7,_0xc64734,_0x43f8bd){return logger[_0x485a('0x9')](util[_0x485a('0xa')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x5b1ed7,_0xc64734[_0x485a('0xb')],_0x43f8bd));}function handleFindAgent(_0x1ad343){return function(_0x1b799a){return _0x1b799a[_0x485a('0xb')][_0x485a('0xc')]()===_0x1ad343[_0x485a('0xc')]();};}exports[_0x485a('0xd')]=function(_0x488260,_0x4d309b,_0x1f7d06,_0x17da99){return function(_0x34feba){try{var _0x5223a6={'name':_0x4d309b[0x0],'timeout':_0x4d309b[0x1]};var _0x3f46fe=queue[_0x485a('0x0')](_0x5223a6,{'typecast':!![]});if(_0x3f46fe[_0x485a('0xe')]){logger[_0x485a('0xf')]('[%s][AGENT]\x20%s',_0x488260,_[_0x485a('0x10')](_0x3f46fe,'message')[_0x485a('0x11')](',\x20'));_0x34feba[_0x485a('0x12')]();}else{var _0x1f1065=_['find'](_0x1f7d06[_0x485a('0x13')],handleFindAgent(_0x5223a6[_0x485a('0xb')]));if(_0x1f1065){var _0x1f460a=(_0x5223a6['timeout']||0xa)*0x3e8;var _0x3698ab,_0x5b448b;var _0x43952a=seqqueue['createQueue'](_0x1f460a);_0x43952a['id']=_0x488260;_0x43952a[_0x485a('0x14')]=_0x1f460a;_0x43952a['channel']=_0x17da99[_0x485a('0x15')];writeLog(_0x488260,_0x1f1065,util['format']('START:%s',_0x1f460a));_0x1f7d06[_0x485a('0x16')][_0x488260]['on'](_0x485a('0x17'),function(){logger[_0x485a('0x9')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x488260);clearTimeout(_0x5b448b);_0x5b448b=undefined;_0x43952a['close']();if(_0x1f7d06[_0x485a('0x16')][_0x488260]){delete _0x1f7d06[_0x485a('0x16')][_0x488260];}_0x34feba[_0x485a('0x12')]();});_0x1f7d06[_0x485a('0x16')][_0x488260]['on'](_0x485a('0x18'),function(){if(_0x1f7d06[_0x485a('0x16')][_0x488260]){delete _0x1f7d06[_0x485a('0x16')][_0x488260];}});_0x5b448b=setTimeout(function(){logger[_0x485a('0x9')](_0x485a('0x19'),_0x488260);clearTimeout(_0x5b448b);_0x43952a[_0x485a('0x1a')]();_0x34feba['next']();},_0x1f460a);strategy[_0x485a('0x1b')](_0x43952a,_0x1f1065,_0x1f7d06,_0x17da99);}else{logger[_0x485a('0xf')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x488260,_0x5223a6['name']);_0x34feba[_0x485a('0x12')]();}}}catch(_0x5b4419){console['log'](_0x5b4419);logger[_0x485a('0xf')](_0x485a('0x1c'),_0x488260,_0x5b4419[_0x485a('0x1d')]);_0x34feba[_0x485a('0x12')]();}};}; \ 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 15217f8..4fc7dc6 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 _0xf8c7=['body','create','then','info','catch','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','toString','message','providerName','amazonlex','providerResponse','Message','dialogState','Failed','error','lodash','moment','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','interaction','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','AccountId','upperFirst','InteractionId','created'];(function(_0x3e9c3a,_0x2f0eac){var _0x191bf7=function(_0x16a71e){while(--_0x16a71e){_0x3e9c3a['push'](_0x3e9c3a['shift']());}};_0x191bf7(++_0x2f0eac);}(_0xf8c7,0x72));var _0x7f8c=function(_0x9569a6,_0x14a8c7){_0x9569a6=_0x9569a6-0x0;var _0x2bd469=_0xf8c7[_0x9569a6];return _0x2bd469;};'use strict';var _=require(_0x7f8c('0x0'));var moment=require(_0x7f8c('0x1'));var AWS=require('aws-sdk');var utils=require(_0x7f8c('0x2'));var logger=require(_0x7f8c('0x3'))('routing');var rpc={'chatMessage':require(_0x7f8c('0x4')),'openchannelMessage':require(_0x7f8c('0x5')),'mailMessage':require(_0x7f8c('0x6')),'smsMessage':require(_0x7f8c('0x7')),'faxMessage':require(_0x7f8c('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x7f8c('0x9')]=function(_0x4fc4a6,_0x3b3e32){return function(_0x388fe4){try{if(!_['isNil'](this[_0x7f8c('0xa')][_0x7f8c('0xb')])){logger['info'](_0x7f8c('0xc'),_0x4fc4a6,_0x7f8c('0xd'));return _0x388fe4[_0x7f8c('0xe')]();}var _0x204f8c={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x7f8c('0xf')),'direction':_0x7f8c('0x10')};if(this[_0x7f8c('0x11')]===_0x7f8c('0x12')||this[_0x7f8c('0x11')]===_0x7f8c('0x13')){_0x204f8c[_0x7f8c('0x14')]=this['interaction'][_0x7f8c('0x14')];}var _0x2b5ab5=this[_0x7f8c('0x11')];if(_0x2b5ab5===_0x7f8c('0x15')){_0x204f8c[_0x7f8c('0x16')]=this['account']['id'];}else{_0x204f8c[_['upperFirst'](_0x2b5ab5)+_0x7f8c('0x17')]=this['account']['id'];}_0x204f8c[_[_0x7f8c('0x18')](_0x2b5ab5)+_0x7f8c('0x19')]=this[_0x7f8c('0xa')]['id'];if(this['interaction'][_0x7f8c('0x1a')]){var _0x4f6d1b=_0x3b3e32[0x4];if(!_['isEmpty'](_0x4f6d1b)){_0x204f8c[_0x7f8c('0x1b')]=utils['getMustacheRender'](_0x4f6d1b,this);return rpc[_0x2b5ab5+'Message'][_0x7f8c('0x1c')](_0x204f8c)[_0x7f8c('0x1d')](function(_0x4815f5){logger[_0x7f8c('0x1e')](_0x7f8c('0xc'),_0x4fc4a6,_0x204f8c[_0x7f8c('0x1b')]);})[_0x7f8c('0x1f')](function(_0x41f470){logger['error'](_0x7f8c('0xc'),_0x4fc4a6,JSON[_0x7f8c('0x20')](_0x41f470));})[_0x7f8c('0x21')](function(){logger[_0x7f8c('0x1e')](_0x7f8c('0x22'),_0x4fc4a6);_0x388fe4[_0x7f8c('0x23')]();});}else{logger[_0x7f8c('0x1e')](_0x7f8c('0x24'),_0x4fc4a6);_0x388fe4[_0x7f8c('0x23')]();}}else{var _0x1039dc=this;var _0x153f1d=new AWS['LexRuntime']({'accessKeyId':_0x3b3e32[0x0],'secretAccessKey':_0x3b3e32[0x1],'region':_0x3b3e32[0x2]});var _0x1ad26f={'botAlias':_0x7f8c('0x25'),'botName':_0x3b3e32[0x3],'inputText':this['message'][_0x7f8c('0x1b')],'userId':this[_0x7f8c('0x11')]+':'+this[_0x7f8c('0xa')]['id'][_0x7f8c('0x26')]()};_0x153f1d['postText'](_0x1ad26f,function(_0x4e3eb7,_0x4d92cb){if(_0x4e3eb7){logger['error'](_0x7f8c('0xc'),_0x4fc4a6,_0x4e3eb7[_0x7f8c('0x27')]);_0x388fe4['next']();}else if(_0x4d92cb&&_0x4d92cb[_0x7f8c('0x27')]){_0x1039dc[_0x7f8c('0x1b')]['amazonlex']=_0x4d92cb;_0x204f8c[_0x7f8c('0x1b')]=_0x4d92cb['message'];_0x204f8c[_0x7f8c('0x28')]=_0x7f8c('0x29');_0x204f8c[_0x7f8c('0x2a')]=JSON['stringify'](_0x4d92cb);return rpc[_0x2b5ab5+_0x7f8c('0x2b')][_0x7f8c('0x1c')](_0x204f8c)[_0x7f8c('0x1d')](function(_0x492516){logger[_0x7f8c('0x1e')](_0x7f8c('0xc'),_0x4fc4a6,_0x204f8c[_0x7f8c('0x1b')]);if(_0x4d92cb[_0x7f8c('0x2c')]==_0x7f8c('0x2d')){_0x388fe4[_0x7f8c('0xe')]();}else{_0x388fe4[_0x7f8c('0x23')]();}})['catch'](function(_0x2bdbd5){logger[_0x7f8c('0x2e')](_0x7f8c('0xc'),_0x4fc4a6,JSON['stringify'](_0x2bdbd5));_0x388fe4[_0x7f8c('0xe')]();});}else{_0x388fe4[_0x7f8c('0xe')]();}});}}catch(_0x5e51f5){logger[_0x7f8c('0x2e')](_0x7f8c('0xc'),_0x4fc4a6,JSON[_0x7f8c('0x20')](_0x5e51f5));_0x388fe4[_0x7f8c('0x23')]();}};}; \ No newline at end of file +var _0xf6c7=['Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','AccountId','account','upperFirst','created','isEmpty','body','getMustacheRender','Message','create','then','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','message','postText','next','amazonlex','providerName','providerResponse','dialogState','Failed','lodash','aws-sdk','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s'];(function(_0x4e8016,_0x261e9b){var _0x3e4b3e=function(_0x4d6d13){while(--_0x4d6d13){_0x4e8016['push'](_0x4e8016['shift']());}};_0x3e4b3e(++_0x261e9b);}(_0xf6c7,0x143));var _0x7f6c=function(_0x136228,_0x407cd9){_0x136228=_0x136228-0x0;var _0x3323b4=_0xf6c7[_0x136228];return _0x3323b4;};'use strict';var _=require(_0x7f6c('0x0'));var moment=require('moment');var AWS=require(_0x7f6c('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x7f6c('0x2'));var rpc={'chatMessage':require(_0x7f6c('0x3')),'openchannelMessage':require(_0x7f6c('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x7f6c('0x5')),'whatsappMessage':require(_0x7f6c('0x6'))};exports[_0x7f6c('0x7')]=function(_0x2885bf,_0x24c163){return function(_0x43af9e){try{if(!_[_0x7f6c('0x8')](this[_0x7f6c('0x9')][_0x7f6c('0xa')])){logger[_0x7f6c('0xb')](_0x7f6c('0xc'),_0x2885bf,_0x7f6c('0xd'));return _0x43af9e['next']();}var _0x381220={'ContactId':this[_0x7f6c('0xe')]['id'],'sentAt':moment()[_0x7f6c('0xf')](_0x7f6c('0x10')),'direction':_0x7f6c('0x11')};if(this[_0x7f6c('0x12')]===_0x7f6c('0x13')||this[_0x7f6c('0x12')]===_0x7f6c('0x14')){_0x381220[_0x7f6c('0x15')]=this['interaction'][_0x7f6c('0x15')];}var _0x283b9a=this[_0x7f6c('0x12')];if(_0x283b9a===_0x7f6c('0x16')){_0x381220['ChatWebsiteId']=this['account']['id'];}else{_0x381220[_['upperFirst'](_0x283b9a)+_0x7f6c('0x17')]=this[_0x7f6c('0x18')]['id'];}_0x381220[_[_0x7f6c('0x19')](_0x283b9a)+'InteractionId']=this[_0x7f6c('0x9')]['id'];if(this[_0x7f6c('0x9')][_0x7f6c('0x1a')]){var _0x39ce39=_0x24c163[0x4];if(!_[_0x7f6c('0x1b')](_0x39ce39)){_0x381220[_0x7f6c('0x1c')]=utils[_0x7f6c('0x1d')](_0x39ce39,this);return rpc[_0x283b9a+_0x7f6c('0x1e')][_0x7f6c('0x1f')](_0x381220)[_0x7f6c('0x20')](function(_0x20265c){logger[_0x7f6c('0xb')](_0x7f6c('0xc'),_0x2885bf,_0x381220[_0x7f6c('0x1c')]);})[_0x7f6c('0x21')](function(_0x3185a3){logger[_0x7f6c('0x22')](_0x7f6c('0xc'),_0x2885bf,JSON[_0x7f6c('0x23')](_0x3185a3));})[_0x7f6c('0x24')](function(){logger['info'](_0x7f6c('0x25'),_0x2885bf);_0x43af9e[_0x7f6c('0x26')]();});}else{logger[_0x7f6c('0xb')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x2885bf);_0x43af9e[_0x7f6c('0x26')]();}}else{var _0x562384=this;var _0x530b7f=new AWS[(_0x7f6c('0x27'))]({'accessKeyId':_0x24c163[0x0],'secretAccessKey':_0x24c163[0x1],'region':_0x24c163[0x2]});var _0x293f11={'botAlias':'$LATEST','botName':_0x24c163[0x3],'inputText':this[_0x7f6c('0x28')]['body'],'userId':this[_0x7f6c('0x12')]+':'+this[_0x7f6c('0x9')]['id']['toString']()};_0x530b7f[_0x7f6c('0x29')](_0x293f11,function(_0xadc6cc,_0x21cafc){if(_0xadc6cc){logger[_0x7f6c('0x22')](_0x7f6c('0xc'),_0x2885bf,_0xadc6cc[_0x7f6c('0x28')]);_0x43af9e[_0x7f6c('0x2a')]();}else if(_0x21cafc&&_0x21cafc[_0x7f6c('0x28')]){_0x562384[_0x7f6c('0x1c')][_0x7f6c('0x2b')]=_0x21cafc;_0x381220['body']=_0x21cafc[_0x7f6c('0x28')];_0x381220[_0x7f6c('0x2c')]=_0x7f6c('0x2b');_0x381220[_0x7f6c('0x2d')]=JSON[_0x7f6c('0x23')](_0x21cafc);return rpc[_0x283b9a+'Message'][_0x7f6c('0x1f')](_0x381220)[_0x7f6c('0x20')](function(_0x232c65){logger[_0x7f6c('0xb')](_0x7f6c('0xc'),_0x2885bf,_0x381220[_0x7f6c('0x1c')]);if(_0x21cafc[_0x7f6c('0x2e')]==_0x7f6c('0x2f')){_0x43af9e[_0x7f6c('0x2a')]();}else{_0x43af9e[_0x7f6c('0x26')]();}})[_0x7f6c('0x21')](function(_0x2dad18){logger[_0x7f6c('0x22')](_0x7f6c('0xc'),_0x2885bf,JSON[_0x7f6c('0x23')](_0x2dad18));_0x43af9e['next']();});}else{_0x43af9e[_0x7f6c('0x2a')]();}});}}catch(_0x5b4a84){logger[_0x7f6c('0x22')](_0x7f6c('0xc'),_0x2885bf,JSON[_0x7f6c('0x23')](_0x5b4a84));_0x43af9e[_0x7f6c('0x26')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index 5c688fb..fc11cfd 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 _0xa997=['../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','One\x20Time\x20already\x20sent','format','out','mail','body','getMustacheRender','message','from','phone','read','subject','Re:\x20','ChatWebsiteId','account','upperFirst','InteractionId','Message','Smtp','service','host','port','secure','authentication','user','pass','inReplyTo','messageId','html','','replace','','headers','All','auto_reply','sendMailMessage','then','stringify','finally','resolve','Interaction','update','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','catch','error','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','create','stop','lodash','moment','./utils','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction'];(function(_0xa39323,_0xd87129){var _0x489963=function(_0x3a3377){while(--_0x3a3377){_0xa39323['push'](_0xa39323['shift']());}};_0x489963(++_0xd87129);}(_0xa997,0x86));var _0x7a99=function(_0x59ee91,_0x5ca1ef){_0x59ee91=_0x59ee91-0x0;var _0x51b0b7=_0xa997[_0x59ee91];return _0x51b0b7;};'use strict';var _=require(_0x7a99('0x0'));var moment=require(_0x7a99('0x1'));var utils=require(_0x7a99('0x2'));var logger=require('../../../../config/logger')(_0x7a99('0x3'));var rpc={'chatMessage':require(_0x7a99('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x7a99('0x5')),'smsMessage':require(_0x7a99('0x6')),'faxMessage':require(_0x7a99('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x7a99('0x8')),'mailInteraction':require(_0x7a99('0x9')),'smsInteraction':require(_0x7a99('0xa')),'faxInteraction':require(_0x7a99('0xb')),'whatsappInteraction':require(_0x7a99('0xc'))};var mailRpc=require(_0x7a99('0xd'));exports[_0x7a99('0xe')]=function(_0x25f008,_0x34f6ad,_0x3e8475,_0x39c760){return function(_0x58c136){try{var _0xb891e4=this[_0x7a99('0xf')];if(_0xb891e4==='mail'&&_0x39c760['body']['isAutoreply']){logger[_0x7a99('0x10')](_0x7a99('0x11'),_0x25f008,_0x7a99('0x12'));return _0x58c136[_0x7a99('0x13')]();}if(_0x34f6ad[0x0]==='1'&&(_[_0x7a99('0x14')](this[_0x7a99('0x15')][_0x7a99('0x16')])||!this[_0x7a99('0x15')][_0x7a99('0x16')])){logger[_0x7a99('0x10')]('[%s][AUTOREPLY]\x20%s',_0x25f008,_0x7a99('0x17'));return _0x58c136[_0x7a99('0x13')]();}if(_0x34f6ad[0x0]==='2'&&this[_0x7a99('0x15')][_0x7a99('0x18')]){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x25f008,_0x7a99('0x19'));return _0x58c136[_0x7a99('0x13')]();}var _0x3e3888={'ContactId':this['contact']['id'],'sentAt':moment()[_0x7a99('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x7a99('0x1b')};if(this[_0x7a99('0xf')]===_0x7a99('0x1c')){_0x3e3888[_0x7a99('0x1d')]=utils['getMustacheRender'](_0x34f6ad[0x2],this);}else{_0x3e3888['body']=utils[_0x7a99('0x1e')](_0x34f6ad[0x1],this);}if(this[_0x7a99('0x1f')]){_0x3e3888['to']=this['message'][_0x7a99('0x20')]||'';if(this['channel']===_0x7a99('0x1c')&&_0x34f6ad[0x1]==='1'){_0x3e3888['cc']=this['message']['cc']||'';}_0x3e3888[_0x7a99('0x20')]=this[_0x7a99('0x1f')]['to']||'';_0x3e3888[_0x7a99('0x21')]=this[_0x7a99('0x1f')][_0x7a99('0x21')]||'';_0x3e3888[_0x7a99('0x22')]=!![];if(this[_0x7a99('0x1f')]['subject']){_0x3e3888['subject']='';_0x3e3888[_0x7a99('0x23')]+=_['startsWith'](this[_0x7a99('0x1f')][_0x7a99('0x23')],'Re:')?'':_0x7a99('0x24');_0x3e3888[_0x7a99('0x23')]+=this[_0x7a99('0x1f')][_0x7a99('0x23')];}}if(this[_0x7a99('0xf')]==='chat'){_0x3e3888[_0x7a99('0x25')]=this[_0x7a99('0x26')]['id'];}else{_0x3e3888[_[_0x7a99('0x27')](this[_0x7a99('0xf')])+'AccountId']=this[_0x7a99('0x26')]['id'];}_0x3e3888[_[_0x7a99('0x27')](this[_0x7a99('0xf')])+_0x7a99('0x28')]=this[_0x7a99('0x15')]['id'];var _0x3a5a43=this[_0x7a99('0x15')];if(rpc[this[_0x7a99('0xf')]+_0x7a99('0x29')]){if(this[_0x7a99('0xf')]===_0x7a99('0x1c')){var _0x3953bc={'tls':{'rejectUnauthorized':![]}};if(this[_0x7a99('0x26')][_0x7a99('0x2a')][_0x7a99('0x2b')]){_0x3953bc[_0x7a99('0x2b')]=this[_0x7a99('0x26')][_0x7a99('0x2a')]['service'];}else{_0x3953bc['host']=this[_0x7a99('0x26')][_0x7a99('0x2a')][_0x7a99('0x2c')];_0x3953bc[_0x7a99('0x2d')]=this[_0x7a99('0x26')][_0x7a99('0x2a')]['port'];_0x3953bc['secure']=this[_0x7a99('0x26')][_0x7a99('0x2a')][_0x7a99('0x2e')];}if(this[_0x7a99('0x26')][_0x7a99('0x2a')][_0x7a99('0x2f')]){_0x3953bc['auth']={'user':this[_0x7a99('0x26')]['Smtp'][_0x7a99('0x30')],'pass':this[_0x7a99('0x26')][_0x7a99('0x2a')][_0x7a99('0x31')]};}_0x3e3888[_0x7a99('0x32')]=this['message'][_0x7a99('0x33')];_0x3e3888[_0x7a99('0x34')]=_0x7a99('0x35')+_[_0x7a99('0x36')](_0x3e3888[_0x7a99('0x1d')],'','replace','','sendMailMessage','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','then','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','resolve','Interaction','update','Message','finally','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','out','channel','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','chat','ChatWebsiteId','account','upperFirst','Smtp','service'];(function(_0x4ab3fb,_0x776775){var _0x34fe1e=function(_0x1c94c5){while(--_0x1c94c5){_0x4ab3fb['push'](_0x4ab3fb['shift']());}};_0x34fe1e(++_0x776775);}(_0x81eb,0xf3));var _0xb81e=function(_0x28475b,_0x3800ae){_0x28475b=_0x28475b-0x0;var _0x5ba39b=_0x81eb[_0x28475b];return _0x5ba39b;};'use strict';var _=require(_0xb81e('0x0'));var moment=require(_0xb81e('0x1'));var utils=require(_0xb81e('0x2'));var logger=require('../../../../config/logger')(_0xb81e('0x3'));var rpc={'chatMessage':require(_0xb81e('0x4')),'openchannelMessage':require(_0xb81e('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xb81e('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xb81e('0x7')),'mailInteraction':require(_0xb81e('0x8')),'smsInteraction':require(_0xb81e('0x9')),'faxInteraction':require(_0xb81e('0xa')),'whatsappInteraction':require(_0xb81e('0xb'))};var mailRpc=require(_0xb81e('0xc'));exports[_0xb81e('0xd')]=function(_0x48c567,_0x1ca4ba,_0x5ce211,_0x38696c){return function(_0x9a3806){try{var _0x37e3c5=this['channel'];if(_0x37e3c5===_0xb81e('0xe')&&_0x38696c[_0xb81e('0xf')][_0xb81e('0x10')]){logger[_0xb81e('0x11')](_0xb81e('0x12'),_0x48c567,_0xb81e('0x13'));return _0x9a3806[_0xb81e('0x14')]();}if(_0x1ca4ba[0x0]==='1'&&(_[_0xb81e('0x15')](this[_0xb81e('0x16')]['created'])||!this[_0xb81e('0x16')][_0xb81e('0x17')])){logger[_0xb81e('0x11')](_0xb81e('0x12'),_0x48c567,'Autoreply\x20already\x20sent');return _0x9a3806[_0xb81e('0x14')]();}if(_0x1ca4ba[0x0]==='2'&&this[_0xb81e('0x16')][_0xb81e('0x18')]){logger[_0xb81e('0x11')](_0xb81e('0x19'),_0x48c567,_0xb81e('0x1a'));return _0x9a3806[_0xb81e('0x14')]();}var _0x20019d={'ContactId':this[_0xb81e('0x1b')]['id'],'sentAt':moment()[_0xb81e('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xb81e('0x1d')};if(this[_0xb81e('0x1e')]==='mail'){_0x20019d[_0xb81e('0xf')]=utils[_0xb81e('0x1f')](_0x1ca4ba[0x2],this);}else{_0x20019d['body']=utils['getMustacheRender'](_0x1ca4ba[0x1],this);}if(this[_0xb81e('0x20')]){_0x20019d['to']=this[_0xb81e('0x20')][_0xb81e('0x21')]||'';if(this['channel']===_0xb81e('0xe')&&_0x1ca4ba[0x1]==='1'){_0x20019d['cc']=this[_0xb81e('0x20')]['cc']||'';}_0x20019d[_0xb81e('0x21')]=this[_0xb81e('0x20')]['to']||'';_0x20019d['phone']=this[_0xb81e('0x20')][_0xb81e('0x22')]||'';_0x20019d[_0xb81e('0x23')]=!![];if(this[_0xb81e('0x20')][_0xb81e('0x24')]){_0x20019d[_0xb81e('0x24')]='';_0x20019d[_0xb81e('0x24')]+=_[_0xb81e('0x25')](this['message'][_0xb81e('0x24')],_0xb81e('0x26'))?'':'Re:\x20';_0x20019d['subject']+=this[_0xb81e('0x20')][_0xb81e('0x24')];}}if(this[_0xb81e('0x1e')]===_0xb81e('0x27')){_0x20019d[_0xb81e('0x28')]=this[_0xb81e('0x29')]['id'];}else{_0x20019d[_[_0xb81e('0x2a')](this[_0xb81e('0x1e')])+'AccountId']=this['account']['id'];}_0x20019d[_['upperFirst'](this[_0xb81e('0x1e')])+'InteractionId']=this['interaction']['id'];var _0x250f91=this[_0xb81e('0x16')];if(rpc[this[_0xb81e('0x1e')]+'Message']){if(this[_0xb81e('0x1e')]===_0xb81e('0xe')){var _0x374231={'tls':{'rejectUnauthorized':![]}};if(this[_0xb81e('0x29')][_0xb81e('0x2b')]['service']){_0x374231[_0xb81e('0x2c')]=this['account'][_0xb81e('0x2b')][_0xb81e('0x2c')];}else{_0x374231[_0xb81e('0x2d')]=this[_0xb81e('0x29')]['Smtp'][_0xb81e('0x2d')];_0x374231['port']=this[_0xb81e('0x29')][_0xb81e('0x2b')][_0xb81e('0x2e')];_0x374231['secure']=this[_0xb81e('0x29')][_0xb81e('0x2b')][_0xb81e('0x2f')];}if(this[_0xb81e('0x29')][_0xb81e('0x2b')]['authentication']){_0x374231[_0xb81e('0x30')]={'user':this['account'][_0xb81e('0x2b')][_0xb81e('0x31')],'pass':this[_0xb81e('0x29')][_0xb81e('0x2b')][_0xb81e('0x32')]};}_0x20019d[_0xb81e('0x33')]=this['message'][_0xb81e('0x34')];_0x20019d['html']=_0xb81e('0x35')+_[_0xb81e('0x36')](_0x20019d[_0xb81e('0xf')],']+(>|$)/g,''),'priorityTrue':_0x2297b9[0x1],'priorityFalse':_0x2297b9[0x2]};var _0x2fa9ea=gotoif[_0x13b5('0x0')](_0x1236ab,{'typecast':!![]});if(_0x2fa9ea[_0x13b5('0xf')]){logger['error'](_0x13b5('0x10'),_0x10f90b,_[_0x13b5('0x11')](_0x2fa9ea,_0x13b5('0x12'))[_0x13b5('0x13')](',\x20'));_0x5c3c0e['stop']();}else{try{var _0x2c5fe1=eval('('+_0x1236ab['condition']+')');var _0x384df6=_0x2c5fe1?_0x1236ab['priorityTrue']:_0x1236ab[_0x13b5('0x14')];logger[_0x13b5('0x15')](_0x13b5('0x16'),_0x10f90b,_0x1236ab[_0x13b5('0x17')],_0x2c5fe1,_0x384df6||'next');if(_0x384df6){var _0x41fe9b=_[_0x13b5('0x18')](_0x5c3c0e[_0x13b5('0x19')](),{'p':_0x384df6});if(_0x41fe9b>=0x0){logger[_0x13b5('0x15')](_0x13b5('0x1a'),_0x10f90b,_0x384df6||_0x13b5('0x1b'),_0x41fe9b);_0x5c3c0e[_0x13b5('0x1b')](_0x41fe9b);}else{logger[_0x13b5('0x15')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x10f90b,_0x384df6||'next');_0x5c3c0e[_0x13b5('0x1c')]();}}else{_0x5c3c0e['next']();}}catch(_0x187083){logger[_0x13b5('0x1d')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x10f90b,_0x187083[_0x13b5('0x12')]);_0x5c3c0e[_0x13b5('0x1c')]();}}}catch(_0x3f5225){logger[_0x13b5('0x1d')](_0x13b5('0x10'),_0x10f90b,JSON[_0x13b5('0x1e')](_0x3f5225));_0x5c3c0e['stop']();}};}; \ No newline at end of file +var _0xac13=['map','message','join','stop','priorityTrue','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','[%s][GOTOIF]\x20%s','stringify','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','consequence','replace','error'];(function(_0x1ffe7a,_0x3313b1){var _0x40af2f=function(_0x1845ca){while(--_0x1845ca){_0x1ffe7a['push'](_0x1ffe7a['shift']());}};_0x40af2f(++_0x3313b1);}(_0xac13,0x7b));var _0x3ac1=function(_0x4abcf8,_0x4191de){_0x4abcf8=_0x4abcf8-0x0;var _0x86ef7c=_0xac13[_0x4abcf8];return _0x86ef7c;};'use strict';var schema=require('validate');var _=require(_0x3ac1('0x0'));var htmlToText=require(_0x3ac1('0x1'));var utils=require(_0x3ac1('0x2'));var logger=require(_0x3ac1('0x3'))(_0x3ac1('0x4'));var gotoif=schema({'condition':{'type':_0x3ac1('0x5'),'required':!![],'message':_0x3ac1('0x6')},'priorityTrue':{'type':'number','message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x3ac1('0x7'),'message':_0x3ac1('0x8')}});exports[_0x3ac1('0x9')]=function(_0x2a7593,_0x109ead){return function(_0x2a477c){try{var _0x4ae226={'condition':htmlToText['fromString'](utils['getMustacheRender'](_0x109ead[0x0],this),{'wordwrap':![]})[_0x3ac1('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x109ead[0x1],'priorityFalse':_0x109ead[0x2]};var _0x1f9c7e=gotoif['validate'](_0x4ae226,{'typecast':!![]});if(_0x1f9c7e['length']){logger[_0x3ac1('0xb')]('[%s][GOTOIF]\x20%s',_0x2a7593,_[_0x3ac1('0xc')](_0x1f9c7e,_0x3ac1('0xd'))[_0x3ac1('0xe')](',\x20'));_0x2a477c[_0x3ac1('0xf')]();}else{try{var _0xbc892=eval('('+_0x4ae226['condition']+')');var _0x780deb=_0xbc892?_0x4ae226[_0x3ac1('0x10')]:_0x4ae226['priorityFalse'];logger[_0x3ac1('0x11')](_0x3ac1('0x12'),_0x2a7593,_0x4ae226['condition'],_0xbc892,_0x780deb||'next');if(_0x780deb){var _0x1caaf0=_[_0x3ac1('0x13')](_0x2a477c[_0x3ac1('0x14')](),{'p':_0x780deb});if(_0x1caaf0>=0x0){logger[_0x3ac1('0x11')](_0x3ac1('0x15'),_0x2a7593,_0x780deb||_0x3ac1('0x16'),_0x1caaf0);_0x2a477c['next'](_0x1caaf0);}else{logger[_0x3ac1('0x11')](_0x3ac1('0x17'),_0x2a7593,_0x780deb||'next');_0x2a477c['stop']();}}else{_0x2a477c['next']();}}catch(_0x3d8f1f){logger[_0x3ac1('0xb')](_0x3ac1('0x18'),_0x2a7593,_0x3d8f1f[_0x3ac1('0xd')]);_0x2a477c[_0x3ac1('0xf')]();}}}catch(_0x246d3a){logger['error'](_0x3ac1('0x19'),_0x2a7593,JSON[_0x3ac1('0x1a')](_0x246d3a));_0x2a477c[_0x3ac1('0xf')]();}};}; \ 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 56bf984..72e7b44 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 _0x833b=['[%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','map','join','stop','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','next','info'];(function(_0x2300f2,_0x315c5f){var _0x6bd508=function(_0x2fa0f6){while(--_0x2fa0f6){_0x2300f2['push'](_0x2300f2['shift']());}};_0x6bd508(++_0x315c5f);}(_0x833b,0xb7));var _0xb833=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0x833b[_0x56916d];return _0x2b7f1f;};'use strict';var schema=require(_0xb833('0x0'));var _=require(_0xb833('0x1'));var logger=require(_0xb833('0x2'))(_0xb833('0x3'));var gotop=schema({'priority':{'type':_0xb833('0x4'),'required':!![],'message':_0xb833('0x5')}});exports[_0xb833('0x6')]=function(_0x1a4a04,_0x2b9bcd){return function(_0x2b6beb){try{var _0x5147a9={'priority':_0x2b9bcd[0x0]};var _0x166deb=gotop[_0xb833('0x0')](_0x5147a9,{'typecast':!![]});if(_0x166deb[_0xb833('0x7')]){logger['error']('[%s][GOTOP]\x20%s',_0x1a4a04,_[_0xb833('0x8')](_0x166deb,'message')[_0xb833('0x9')](',\x20'));_0x2b6beb[_0xb833('0xa')]();}else{logger['info'](_0xb833('0xb'),_0x1a4a04,_0x5147a9[_0xb833('0xc')]);if(_0x5147a9['priority']){var _0x2bda58=_[_0xb833('0xd')](_0x2b6beb[_0xb833('0xe')](),{'p':_0x5147a9['priority']});if(_0x2bda58>=0x0){logger['info']('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x1a4a04,_0x5147a9[_0xb833('0xc')]||'next',_0x2bda58);_0x2b6beb[_0xb833('0xf')](_0x2bda58);}else{logger[_0xb833('0x10')](_0xb833('0x11'),_0x1a4a04,_0x5147a9[_0xb833('0xc')]||'next');_0x2b6beb[_0xb833('0xa')]();}}else{_0x2b6beb[_0xb833('0xf')]();}}}catch(_0x4e9abf){logger['error'](_0xb833('0x12'),_0x1a4a04,JSON[_0xb833('0x13')](_0x4e9abf));_0x2b6beb[_0xb833('0xa')]();}};}; \ No newline at end of file +var _0xcb05=['routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','lodash','../../../../config/logger'];(function(_0x56e959,_0x2acd5d){var _0x465e27=function(_0x263c14){while(--_0x263c14){_0x56e959['push'](_0x56e959['shift']());}};_0x465e27(++_0x2acd5d);}(_0xcb05,0x185));var _0x5cb0=function(_0x503182,_0x52fbeb){_0x503182=_0x503182-0x0;var _0x58913d=_0xcb05[_0x503182];return _0x58913d;};'use strict';var schema=require('validate');var _=require(_0x5cb0('0x0'));var logger=require(_0x5cb0('0x1'))(_0x5cb0('0x2'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x5cb0('0x3')}});exports[_0x5cb0('0x4')]=function(_0x43e155,_0x35966e){return function(_0x33b52b){try{var _0x43b268={'priority':_0x35966e[0x0]};var _0x22631d=gotop['validate'](_0x43b268,{'typecast':!![]});if(_0x22631d[_0x5cb0('0x5')]){logger[_0x5cb0('0x6')](_0x5cb0('0x7'),_0x43e155,_['map'](_0x22631d,'message')[_0x5cb0('0x8')](',\x20'));_0x33b52b[_0x5cb0('0x9')]();}else{logger[_0x5cb0('0xa')](_0x5cb0('0xb'),_0x43e155,_0x43b268[_0x5cb0('0xc')]);if(_0x43b268['priority']){var _0x581f90=_[_0x5cb0('0xd')](_0x33b52b[_0x5cb0('0xe')](),{'p':_0x43b268[_0x5cb0('0xc')]});if(_0x581f90>=0x0){logger[_0x5cb0('0xa')](_0x5cb0('0xf'),_0x43e155,_0x43b268[_0x5cb0('0xc')]||'next',_0x581f90);_0x33b52b[_0x5cb0('0x10')](_0x581f90);}else{logger[_0x5cb0('0xa')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x43e155,_0x43b268[_0x5cb0('0xc')]||'next');_0x33b52b['stop']();}}else{_0x33b52b[_0x5cb0('0x10')]();}}}catch(_0x4075fc){logger[_0x5cb0('0x6')](_0x5cb0('0x7'),_0x43e155,JSON['stringify'](_0x4075fc));_0x33b52b[_0x5cb0('0x9')]();}};}; \ 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 daea4de..2fa7a9a 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 _0x7044=['error','stringify','stop','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','interaction','Message','create','then','[%s][MESSAGE]\x20%s','body','next','catch'];(function(_0x113f89,_0x1d14af){var _0x3b756a=function(_0x3777b5){while(--_0x3777b5){_0x113f89['push'](_0x113f89['shift']());}};_0x3b756a(++_0x1d14af);}(_0x7044,0x147));var _0x4704=function(_0x19c75a,_0x5fde73){_0x19c75a=_0x19c75a-0x0;var _0xe51d07=_0x7044[_0x19c75a];return _0xe51d07;};'use strict';var _=require(_0x4704('0x0'));var utils=require(_0x4704('0x1'));var logger=require(_0x4704('0x2'))('routing');var rpc={'chatMessage':require(_0x4704('0x3')),'openchannelMessage':require(_0x4704('0x4')),'mailMessage':require(_0x4704('0x5')),'smsMessage':require(_0x4704('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x4704('0x7'))};exports['consequence']=function(_0x1d113e,_0x43bc86){return function(_0x48e7b8){try{var _0x5394c3={'body':utils[_0x4704('0x8')](_0x43bc86[0x0],this),'ContactId':this[_0x4704('0x9')]['id']};if(this[_0x4704('0xa')]===_0x4704('0xb')){_0x5394c3[_0x4704('0xc')]=this['account']['id'];}else{_0x5394c3[_['upperFirst'](this[_0x4704('0xa')])+'AccountId']=this[_0x4704('0xd')]['id'];}_0x5394c3[_[_0x4704('0xe')](this[_0x4704('0xa')])+_0x4704('0xf')]=this[_0x4704('0x10')]['id'];if(rpc[this['channel']+_0x4704('0x11')]){return rpc[this[_0x4704('0xa')]+_0x4704('0x11')][_0x4704('0x12')](_0x5394c3)[_0x4704('0x13')](function(_0x268453){logger['info'](_0x4704('0x14'),_0x1d113e,_0x5394c3[_0x4704('0x15')]);_0x48e7b8[_0x4704('0x16')]();})[_0x4704('0x17')](function(_0x246765){logger[_0x4704('0x18')](_0x4704('0x14'),_0x1d113e,JSON[_0x4704('0x19')](_0x246765));_0x48e7b8[_0x4704('0x1a')]();});}}catch(_0x5d5f3b){logger['error'](_0x4704('0x14'),_0x1d113e,JSON[_0x4704('0x19')](_0x5d5f3b));_0x48e7b8[_0x4704('0x1a')]();}};}; \ No newline at end of file +var _0x5761=['stop','error','stringify','lodash','./utils','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','ChatWebsiteId','account','upperFirst','InteractionId','interaction','create','then','info','[%s][MESSAGE]\x20%s','body','next','catch'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x5761,0x107));var _0x1576=function(_0x199c70,_0xc1a988){_0x199c70=_0x199c70-0x0;var _0x429b39=_0x5761[_0x199c70];return _0x429b39;};'use strict';var _=require(_0x1576('0x0'));var utils=require(_0x1576('0x1'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x1576('0x2')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x1576('0x3')),'smsMessage':require(_0x1576('0x4')),'faxMessage':require(_0x1576('0x5')),'whatsappMessage':require(_0x1576('0x6'))};exports[_0x1576('0x7')]=function(_0x1a36b6,_0x5730fd){return function(_0x4dfdf5){try{var _0x30f503={'body':utils[_0x1576('0x8')](_0x5730fd[0x0],this),'ContactId':this[_0x1576('0x9')]['id']};if(this[_0x1576('0xa')]==='chat'){_0x30f503[_0x1576('0xb')]=this[_0x1576('0xc')]['id'];}else{_0x30f503[_['upperFirst'](this[_0x1576('0xa')])+'AccountId']=this['account']['id'];}_0x30f503[_[_0x1576('0xd')](this[_0x1576('0xa')])+_0x1576('0xe')]=this[_0x1576('0xf')]['id'];if(rpc[this[_0x1576('0xa')]+'Message']){return rpc[this[_0x1576('0xa')]+'Message'][_0x1576('0x10')](_0x30f503)[_0x1576('0x11')](function(_0x137128){logger[_0x1576('0x12')](_0x1576('0x13'),_0x1a36b6,_0x30f503[_0x1576('0x14')]);_0x4dfdf5[_0x1576('0x15')]();})[_0x1576('0x16')](function(_0x2f344a){logger['error'](_0x1576('0x13'),_0x1a36b6,JSON['stringify'](_0x2f344a));_0x4dfdf5[_0x1576('0x17')]();});}}catch(_0x1d1e53){logger[_0x1576('0x18')](_0x1576('0x13'),_0x1a36b6,JSON[_0x1576('0x19')](_0x1d1e53));_0x4dfdf5[_0x1576('0x17')]();}};}; \ 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 67d1be9..6c74f32 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 _0xdd3e=['[%s][NOOP]\x20%s','error','stringify','./utils','../../../../config/logger','consequence'];(function(_0x45b1b3,_0x224dce){var _0x8f20cc=function(_0x1cefef){while(--_0x1cefef){_0x45b1b3['push'](_0x45b1b3['shift']());}};_0x8f20cc(++_0x224dce);}(_0xdd3e,0x11d));var _0xedd3=function(_0x93c9fe,_0x1c4c35){_0x93c9fe=_0x93c9fe-0x0;var _0x2b48ea=_0xdd3e[_0x93c9fe];return _0x2b48ea;};'use strict';var utils=require(_0xedd3('0x0'));var logger=require(_0xedd3('0x1'))('routing');exports[_0xedd3('0x2')]=function(_0x2d3725,_0x7d8deb){return function(_0x59bd18){try{logger['info'](_0xedd3('0x3'),_0x2d3725,utils['getMustacheRender'](_0x7d8deb[0x0],this));_0x59bd18['next']();}catch(_0xab5c16){logger[_0xedd3('0x4')](_0xedd3('0x3'),_0x2d3725,JSON[_0xedd3('0x5')](_0xab5c16));_0x59bd18['stop']();}};}; \ No newline at end of file +var _0x099c=['./utils','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','stop'];(function(_0x5f0f7a,_0x244c53){var _0x8742e7=function(_0x48ff6e){while(--_0x48ff6e){_0x5f0f7a['push'](_0x5f0f7a['shift']());}};_0x8742e7(++_0x244c53);}(_0x099c,0x100));var _0xc099=function(_0x330414,_0x4f3207){_0x330414=_0x330414-0x0;var _0x99dbff=_0x099c[_0x330414];return _0x99dbff;};'use strict';var utils=require(_0xc099('0x0'));var logger=require(_0xc099('0x1'))(_0xc099('0x2'));exports[_0xc099('0x3')]=function(_0x33553e,_0x4ea106){return function(_0x4a2e99){try{logger[_0xc099('0x4')](_0xc099('0x5'),_0x33553e,utils[_0xc099('0x6')](_0x4ea106[0x0],this));_0x4a2e99['next']();}catch(_0x1b1045){logger['error'](_0xc099('0x5'),_0x33553e,JSON['stringify'](_0x1b1045));_0x4a2e99[_0xc099('0x7')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index 7c89680..03f6027 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 _0x34e0=['atimeout','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','log','stop','lodash','util','moment','ioredis','../../../../config/logger','redis','localhost','socket.io-emitter','account','queue','from','joinAt','emit','clone','queue_id','format','%sQueuesWaitingInteractions','%s:queue:%s','save','remove','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','chat','AccountId','WebsiteId','[%s][START:QUEUE][NAME:%s]','name','message','QueueReport','create','error','create\x20queue\x20report','accepted','info','[%s][STOP:QUEUE][NAME:%s]','update','timeout','[%s][END:QUEUE][NAME:%s]','catch','update\x20queue\x20report','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','find','Queues'];(function(_0xc9b9f3,_0x4b96c4){var _0x2e4a9a=function(_0x3c6834){while(--_0x3c6834){_0xc9b9f3['push'](_0xc9b9f3['shift']());}};_0x2e4a9a(++_0x4b96c4);}(_0x34e0,0xa0));var _0x034e=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x34e0[_0x4d8ed9];return _0x1e2140;};'use strict';var schema=require('validate');var _=require(_0x034e('0x0'));var util=require(_0x034e('0x1'));var seqqueue=require('seq-queue');var moment=require(_0x034e('0x2'));var Redis=require(_0x034e('0x3'));var config=require('../../../../config/environment');var logger=require(_0x034e('0x4'))('routing');var strategy=require('./strategy');config['redis']=_['defaults'](config[_0x034e('0x5')],{'host':_0x034e('0x6'),'port':0x18eb});var io=require(_0x034e('0x7'))(new Redis(config[_0x034e('0x5')]));var attributes=['id','queue_id',_0x034e('0x8'),_0x034e('0x9'),_0x034e('0xa'),_0x034e('0xb')];function emit(_0x408324,_0x4073d5,_0xedc38d){io['to'](_0x408324)[_0x034e('0xc')](_0x4073d5,_0xedc38d);}function emitChannelQueueInteraction(_0x2fc955,_0x423243,_0x48702c,_0x2bb642,_0x4be7ed,_0x20b743,_0x1bde09,_0x511bf3){var _0xef7cdc=_[_0x034e('0xd')](_0x48702c);_0xef7cdc[_0x034e('0xe')]=_0x511bf3;_0xef7cdc[_0x034e('0x9')]=_0x423243;_0xef7cdc[_0x034e('0x8')]=_0x2bb642;_0xef7cdc['id']=_0x4be7ed;if(_0x20b743){_0x1bde09[util[_0x034e('0xf')](_0x034e('0x10'),_0x2fc955)][_0x4be7ed]=_['pick'](_0xef7cdc,attributes);}else{delete _0x1bde09[util[_0x034e('0xf')](_0x034e('0x10'),_0x2fc955)][_0x4be7ed];}emit(util[_0x034e('0xf')](_0x034e('0x11'),_0x2fc955,_0x423243),util['format']('%s_queue_waiting_interaction:%s',_0x2fc955,_0x20b743?_0x034e('0x12'):_0x034e('0x13')),_[_0x034e('0x14')](_0xef7cdc,attributes));}var rpc={'openchannelQueueReport':require(_0x034e('0x15')),'mailQueueReport':require(_0x034e('0x16')),'chatQueueReport':require(_0x034e('0x17')),'smsQueueReport':require(_0x034e('0x18')),'faxQueueReport':require(_0x034e('0x19')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0x034e('0x1a'),'required':!![],'message':_0x034e('0x1b')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x494af8,_0x3cb8ce,_0x4f8106,_0x2563f2){if(_0x494af8&&_0x3cb8ce&&_0x4f8106){_0x3cb8ce[_0x034e('0x1c')]+=0x1;var _0x2295f1={'uniqueid':_0x494af8,'from':_0x4f8106[_0x034e('0x1d')]?_0x4f8106['body'][_0x034e('0xa')]:'','joinAt':moment()['format'](_0x034e('0x1e')),'ContactId':_0x4f8106[_0x034e('0x1f')]?_0x4f8106[_0x034e('0x1f')]['id']:null,'ListId':_0x4f8106[_0x034e('0x20')]?_0x4f8106[_0x034e('0x20')]['id']:null};_0x2295f1[_[_0x034e('0x21')](_0x4f8106[_0x034e('0x22')])+_0x034e('0x23')]=_0x3cb8ce['id']||null;_0x2295f1[_['upperFirst'](_0x4f8106[_0x034e('0x22')])+_0x034e('0x24')]=_0x4f8106['interaction']?_0x4f8106[_0x034e('0x25')]['id']:null;_0x2295f1[_[_0x034e('0x21')](_0x4f8106['channel'])+_0x034e('0x26')]=_0x4f8106['message']?_0x4f8106['message']['id']:null;_0x2295f1[_['upperFirst'](_0x4f8106[_0x034e('0x22')])+(_0x4f8106['channel']!==_0x034e('0x27')?_0x034e('0x28'):_0x034e('0x29'))]=_0x4f8106['account']?_0x4f8106[_0x034e('0x8')]['id']:null;logger['info'](util[_0x034e('0xf')](_0x034e('0x2a'),_0x494af8,_0x3cb8ce[_0x034e('0x2b')]));emitChannelQueueInteraction(_0x4f8106[_0x034e('0x22')],_0x3cb8ce[_0x034e('0x2b')],_0x2295f1,_0x4f8106[_0x034e('0x8')][_0x034e('0x2b')],_0x4f8106[_0x034e('0x2c')]['id'],!![],_0x2563f2,_0x3cb8ce['id']);if(rpc[_0x4f8106['channel']+'QueueReport']){return rpc[_0x4f8106[_0x034e('0x22')]+_0x034e('0x2d')][_0x034e('0x2e')](_0x2295f1)['catch'](function(_0x46c9f8){logger[_0x034e('0x2f')](_0x034e('0x30'));});}}}function stopRouting(_0x15131f,_0x50d9ce,_0x6f0e2,_0x58a0a3){if(_0x15131f&&_0x50d9ce){_0x50d9ce[_0x034e('0x1c')]-=0x1;var _0x1c8ff3={'leaveAt':moment()[_0x034e('0xf')](_0x034e('0x1e')),'acceptAt':moment()[_0x034e('0xf')](_0x034e('0x1e')),'reason':_0x034e('0x31')};logger[_0x034e('0x32')](util[_0x034e('0xf')](_0x034e('0x33'),_0x15131f,_0x50d9ce['name']));emitChannelQueueInteraction(_0x6f0e2['channel'],_0x50d9ce['name'],_0x6f0e2[_0x034e('0x1d')],_0x6f0e2['account']['name'],_0x6f0e2['message']['id'],![],_0x58a0a3,_0x50d9ce['id']);if(rpc[_0x6f0e2['channel']+_0x034e('0x2d')]){return rpc[_0x6f0e2['channel']+_0x034e('0x2d')][_0x034e('0x34')](_0x15131f,_0x1c8ff3)['catch'](function(_0x1b442b){logger[_0x034e('0x2f')]('update\x20queue\x20report');});}}}function endRouting(_0x536047,_0x176f8e,_0x342862,_0x2c631d){if(_0x536047&&_0x176f8e){_0x176f8e[_0x034e('0x1c')]-=0x1;var _0x3bee8b={'leaveAt':moment()[_0x034e('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x034e('0xf')](_0x034e('0x1e')),'reason':_0x034e('0x35')};logger[_0x034e('0x32')](util[_0x034e('0xf')](_0x034e('0x36'),_0x536047,_0x176f8e[_0x034e('0x2b')]));emitChannelQueueInteraction(_0x342862[_0x034e('0x22')],_0x176f8e[_0x034e('0x2b')],_0x342862[_0x034e('0x1d')],_0x342862[_0x034e('0x8')][_0x034e('0x2b')],_0x342862[_0x034e('0x2c')]['id'],![],_0x2c631d);if(rpc[_0x342862['channel']+_0x034e('0x2d')]){return rpc[_0x342862[_0x034e('0x22')]+_0x034e('0x2d')]['update'](_0x536047,_0x3bee8b)[_0x034e('0x37')](function(_0x549dca){logger[_0x034e('0x2f')](_0x034e('0x38'));});}}}function handleFindQueue(_0x5416ab){return function(_0x1959a6){return _0x1959a6['name'][_0x034e('0x39')]()===_0x5416ab['toLowerCase']();};}exports[_0x034e('0x3a')]=function(_0x4ad64d,_0x4650d2,_0x88e4c1,_0x2d1696){return function(_0x10a4c5){try{var _0x933915={'name':_0x4650d2[0x0],'timeout':_0x4650d2[0x1]};var _0x281d8b=queue['validate'](_0x933915,{'typecast':!![]});if(_0x281d8b[_0x034e('0x3b')]){logger['error'](_0x034e('0x3c'),_0x4ad64d,_[_0x034e('0x3d')](_0x281d8b,_0x034e('0x2c'))[_0x034e('0x3e')](',\x20'));_0x10a4c5['stop']();}else{var _0x1cc2d6=_[_0x034e('0x3f')](_0x88e4c1[_0x2d1696[_0x034e('0x22')]+_0x034e('0x40')],handleFindQueue(_0x933915[_0x034e('0x2b')]));if(_0x1cc2d6){startRouting(_0x4ad64d,_0x1cc2d6,_0x2d1696,_0x88e4c1);var _0x27ab84=(_0x1cc2d6[_0x034e('0x35')]||0xa)*0x3e8;var _0x244705=(_0x933915[_0x034e('0x35')]||0x14)*0x3e8;var _0x5b8b54,_0x55c3b8;if(_0x27ab84>_0x244705){_0x244705=_0x27ab84;}var _0xc83f28=seqqueue['createQueue'](_0x27ab84);_0xc83f28['id']=_0x4ad64d;_0xc83f28[_0x034e('0x41')]=_0x27ab84;_0xc83f28['qtimeout']=_0x244705;_0xc83f28[_0x034e('0x22')]=_0x2d1696['channel'];_0x88e4c1['rules'][_0x4ad64d]['on']('end',function(){logger[_0x034e('0x32')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x4ad64d);stopRouting(_0x4ad64d,_0x1cc2d6,_0x2d1696,_0x88e4c1);clearTimeout(_0x5b8b54);_0x5b8b54=undefined;_0xc83f28['close'](!![]);if(_0x88e4c1['rules'][_0x4ad64d]){delete _0x88e4c1['rules'][_0x4ad64d];}_0x10a4c5['stop']();});_0x88e4c1[_0x034e('0x42')][_0x4ad64d]['on'](_0x034e('0x43'),function(){if(_0x88e4c1[_0x034e('0x42')][_0x4ad64d]){delete _0x88e4c1[_0x034e('0x42')][_0x4ad64d];}});_0x5b8b54=setTimeout(function(){logger[_0x034e('0x32')](_0x034e('0x44'),_0x4ad64d);endRouting(_0x4ad64d,_0x1cc2d6,_0x2d1696,_0x88e4c1);clearTimeout(_0x5b8b54);_0xc83f28['close'](!![]);_0x10a4c5[_0x034e('0x45')]();},_0x244705);switch(_0x1cc2d6[_0x034e('0x46')]){case _0x034e('0x47'):strategy['rrmemory'](_0xc83f28,_0x1cc2d6,_0x88e4c1,_0x2d1696);break;default:strategy[_0x034e('0x48')](_0xc83f28,_0x1cc2d6,_0x88e4c1,_0x2d1696);}}else{logger[_0x034e('0x2f')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x4ad64d,_0x933915[_0x034e('0x2b')]);_0x10a4c5['stop']();}}}catch(_0xb4b5df){console[_0x034e('0x49')](_0xb4b5df);logger[_0x034e('0x2f')](_0x034e('0x3c'),_0x4ad64d,_0xb4b5df['stack']);_0x10a4c5[_0x034e('0x4a')]();}};}; \ No newline at end of file +var _0x5c01=['../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','upperFirst','InteractionId','interaction','chat','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','waiting','accepted','[%s][STOP:QUEUE][NAME:%s]','update','error','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','message','catch','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','find','Queues','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','stop','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','moment','ioredis','routing','./strategy','redis','defaults','localhost','queue_id','account','queue','from','emit','clone','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport'];(function(_0xbc32ba,_0x469f68){var _0xe02534=function(_0x47a50c){while(--_0x47a50c){_0xbc32ba['push'](_0xbc32ba['shift']());}};_0xe02534(++_0x469f68);}(_0x5c01,0x83));var _0x15c0=function(_0x5ebc92,_0x39bfe7){_0x5ebc92=_0x5ebc92-0x0;var _0x334bd7=_0x5c01[_0x5ebc92];return _0x334bd7;};'use strict';var schema=require(_0x15c0('0x0'));var _=require(_0x15c0('0x1'));var util=require(_0x15c0('0x2'));var seqqueue=require(_0x15c0('0x3'));var moment=require(_0x15c0('0x4'));var Redis=require(_0x15c0('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x15c0('0x6'));var strategy=require(_0x15c0('0x7'));config[_0x15c0('0x8')]=_[_0x15c0('0x9')](config['redis'],{'host':_0x15c0('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var attributes=['id',_0x15c0('0xb'),_0x15c0('0xc'),_0x15c0('0xd'),_0x15c0('0xe'),'joinAt'];function emit(_0x44183e,_0x8526ca,_0x54a7c1){io['to'](_0x44183e)[_0x15c0('0xf')](_0x8526ca,_0x54a7c1);}function emitChannelQueueInteraction(_0x3e4971,_0x292b8d,_0x29bc11,_0x27aab7,_0x5d60b7,_0x58df74,_0x2a502c,_0x476ad5){var _0x2cb644=_[_0x15c0('0x10')](_0x29bc11);_0x2cb644[_0x15c0('0xb')]=_0x476ad5;_0x2cb644[_0x15c0('0xd')]=_0x292b8d;_0x2cb644[_0x15c0('0xc')]=_0x27aab7;_0x2cb644['id']=_0x5d60b7;if(_0x58df74){_0x2a502c[util[_0x15c0('0x11')](_0x15c0('0x12'),_0x3e4971)][_0x5d60b7]=_['pick'](_0x2cb644,attributes);}else{delete _0x2a502c[util[_0x15c0('0x11')](_0x15c0('0x12'),_0x3e4971)][_0x5d60b7];}emit(util[_0x15c0('0x11')](_0x15c0('0x13'),_0x3e4971,_0x292b8d),util[_0x15c0('0x11')](_0x15c0('0x14'),_0x3e4971,_0x58df74?_0x15c0('0x15'):_0x15c0('0x16')),_[_0x15c0('0x17')](_0x2cb644,attributes));}var rpc={'openchannelQueueReport':require(_0x15c0('0x18')),'mailQueueReport':require(_0x15c0('0x19')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x15c0('0x1a')),'faxQueueReport':require(_0x15c0('0x1b')),'whatsappQueueReport':require(_0x15c0('0x1c'))};var queue=schema({'name':{'type':_0x15c0('0x1d'),'required':!![],'message':_0x15c0('0x1e')},'timeout':{'type':_0x15c0('0x1f'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x56d774,_0x4acdcd,_0x13dc5a,_0x1770b6){if(_0x56d774&&_0x4acdcd&&_0x13dc5a){_0x4acdcd['waiting']+=0x1;var _0x484233={'uniqueid':_0x56d774,'from':_0x13dc5a['body']?_0x13dc5a[_0x15c0('0x20')][_0x15c0('0xe')]:'','joinAt':moment()[_0x15c0('0x11')](_0x15c0('0x21')),'ContactId':_0x13dc5a['contact']?_0x13dc5a[_0x15c0('0x22')]['id']:null,'ListId':_0x13dc5a[_0x15c0('0x23')]?_0x13dc5a[_0x15c0('0x23')]['id']:null};_0x484233[_['upperFirst'](_0x13dc5a[_0x15c0('0x24')])+'QueueId']=_0x4acdcd['id']||null;_0x484233[_[_0x15c0('0x25')](_0x13dc5a[_0x15c0('0x24')])+_0x15c0('0x26')]=_0x13dc5a[_0x15c0('0x27')]?_0x13dc5a[_0x15c0('0x27')]['id']:null;_0x484233[_[_0x15c0('0x25')](_0x13dc5a[_0x15c0('0x24')])+'MessageId']=_0x13dc5a['message']?_0x13dc5a['message']['id']:null;_0x484233[_[_0x15c0('0x25')](_0x13dc5a[_0x15c0('0x24')])+(_0x13dc5a[_0x15c0('0x24')]!==_0x15c0('0x28')?'AccountId':'WebsiteId')]=_0x13dc5a[_0x15c0('0xc')]?_0x13dc5a[_0x15c0('0xc')]['id']:null;logger[_0x15c0('0x29')](util[_0x15c0('0x11')](_0x15c0('0x2a'),_0x56d774,_0x4acdcd['name']));emitChannelQueueInteraction(_0x13dc5a['channel'],_0x4acdcd[_0x15c0('0x2b')],_0x484233,_0x13dc5a['account'][_0x15c0('0x2b')],_0x13dc5a['message']['id'],!![],_0x1770b6,_0x4acdcd['id']);if(rpc[_0x13dc5a[_0x15c0('0x24')]+_0x15c0('0x2c')]){return rpc[_0x13dc5a[_0x15c0('0x24')]+_0x15c0('0x2c')][_0x15c0('0x2d')](_0x484233)['catch'](function(_0x455f26){logger['error']('create\x20queue\x20report');});}}}function stopRouting(_0xecd47e,_0xb8fd31,_0x123d58,_0x1a340b){if(_0xecd47e&&_0xb8fd31){_0xb8fd31[_0x15c0('0x2e')]-=0x1;var _0x3c2aec={'leaveAt':moment()[_0x15c0('0x11')](_0x15c0('0x21')),'acceptAt':moment()['format'](_0x15c0('0x21')),'reason':_0x15c0('0x2f')};logger[_0x15c0('0x29')](util[_0x15c0('0x11')](_0x15c0('0x30'),_0xecd47e,_0xb8fd31['name']));emitChannelQueueInteraction(_0x123d58[_0x15c0('0x24')],_0xb8fd31[_0x15c0('0x2b')],_0x123d58[_0x15c0('0x20')],_0x123d58['account']['name'],_0x123d58['message']['id'],![],_0x1a340b,_0xb8fd31['id']);if(rpc[_0x123d58[_0x15c0('0x24')]+_0x15c0('0x2c')]){return rpc[_0x123d58[_0x15c0('0x24')]+'QueueReport'][_0x15c0('0x31')](_0xecd47e,_0x3c2aec)['catch'](function(_0x11479f){logger[_0x15c0('0x32')](_0x15c0('0x33'));});}}}function endRouting(_0x5c6030,_0x24e8b5,_0x5080dc,_0x4628ac){if(_0x5c6030&&_0x24e8b5){_0x24e8b5[_0x15c0('0x2e')]-=0x1;var _0x14cd87={'leaveAt':moment()[_0x15c0('0x11')](_0x15c0('0x21')),'exitAt':moment()[_0x15c0('0x11')](_0x15c0('0x21')),'reason':_0x15c0('0x34')};logger['info'](util[_0x15c0('0x11')](_0x15c0('0x35'),_0x5c6030,_0x24e8b5['name']));emitChannelQueueInteraction(_0x5080dc[_0x15c0('0x24')],_0x24e8b5['name'],_0x5080dc['body'],_0x5080dc[_0x15c0('0xc')][_0x15c0('0x2b')],_0x5080dc[_0x15c0('0x36')]['id'],![],_0x4628ac);if(rpc[_0x5080dc[_0x15c0('0x24')]+_0x15c0('0x2c')]){return rpc[_0x5080dc[_0x15c0('0x24')]+_0x15c0('0x2c')]['update'](_0x5c6030,_0x14cd87)[_0x15c0('0x37')](function(_0x45a5a7){logger['error'](_0x15c0('0x33'));});}}}function handleFindQueue(_0xbafe33){return function(_0x473d3c){return _0x473d3c[_0x15c0('0x2b')]['toLowerCase']()===_0xbafe33[_0x15c0('0x38')]();};}exports[_0x15c0('0x39')]=function(_0x133274,_0x177b33,_0x3ba168,_0x1c1523){return function(_0x476c12){try{var _0x254820={'name':_0x177b33[0x0],'timeout':_0x177b33[0x1]};var _0x508fdc=queue[_0x15c0('0x0')](_0x254820,{'typecast':!![]});if(_0x508fdc[_0x15c0('0x3a')]){logger['error'](_0x15c0('0x3b'),_0x133274,_[_0x15c0('0x3c')](_0x508fdc,'message')['join'](',\x20'));_0x476c12['stop']();}else{var _0x2d8ad7=_[_0x15c0('0x3d')](_0x3ba168[_0x1c1523[_0x15c0('0x24')]+_0x15c0('0x3e')],handleFindQueue(_0x254820[_0x15c0('0x2b')]));if(_0x2d8ad7){startRouting(_0x133274,_0x2d8ad7,_0x1c1523,_0x3ba168);var _0x2d8bf4=(_0x2d8ad7['timeout']||0xa)*0x3e8;var _0x42e269=(_0x254820[_0x15c0('0x34')]||0x14)*0x3e8;var _0x27999b,_0x3f63f3;if(_0x2d8bf4>_0x42e269){_0x42e269=_0x2d8bf4;}var _0x4054b0=seqqueue[_0x15c0('0x3f')](_0x2d8bf4);_0x4054b0['id']=_0x133274;_0x4054b0[_0x15c0('0x40')]=_0x2d8bf4;_0x4054b0[_0x15c0('0x41')]=_0x42e269;_0x4054b0['channel']=_0x1c1523[_0x15c0('0x24')];_0x3ba168[_0x15c0('0x42')][_0x133274]['on'](_0x15c0('0x43'),function(){logger[_0x15c0('0x29')](_0x15c0('0x44'),_0x133274);stopRouting(_0x133274,_0x2d8ad7,_0x1c1523,_0x3ba168);clearTimeout(_0x27999b);_0x27999b=undefined;_0x4054b0[_0x15c0('0x45')](!![]);if(_0x3ba168[_0x15c0('0x42')][_0x133274]){delete _0x3ba168[_0x15c0('0x42')][_0x133274];}_0x476c12[_0x15c0('0x46')]();});_0x3ba168[_0x15c0('0x42')][_0x133274]['on'](_0x15c0('0x47'),function(){if(_0x3ba168['rules'][_0x133274]){delete _0x3ba168[_0x15c0('0x42')][_0x133274];}});_0x27999b=setTimeout(function(){logger[_0x15c0('0x29')](_0x15c0('0x48'),_0x133274);endRouting(_0x133274,_0x2d8ad7,_0x1c1523,_0x3ba168);clearTimeout(_0x27999b);_0x4054b0['close'](!![]);_0x476c12[_0x15c0('0x49')]();},_0x42e269);switch(_0x2d8ad7[_0x15c0('0x4a')]){case _0x15c0('0x4b'):strategy[_0x15c0('0x4b')](_0x4054b0,_0x2d8ad7,_0x3ba168,_0x1c1523);break;default:strategy['beepall'](_0x4054b0,_0x2d8ad7,_0x3ba168,_0x1c1523);}}else{logger[_0x15c0('0x32')](_0x15c0('0x4c'),_0x133274,_0x254820['name']);_0x476c12[_0x15c0('0x46')]();}}}catch(_0x175cbd){console[_0x15c0('0x4d')](_0x175cbd);logger['error']('[%s][QUEUE]\x20%s',_0x133274,_0x175cbd[_0x15c0('0x4e')]);_0x476c12[_0x15c0('0x46')]();}};}; \ 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 f468905..6a4703c 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 _0xd175=['isNil','agents','forcedOwnership','channel','busy','busyQueue','showNotification','notificationId','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','exports','lodash','../../../../../config/logger','routing','squeue','agent','realtime','push','handleRun','bind','timeout','handleTimeout','drained','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s'];(function(_0x350df6,_0x9292f1){var _0x1a6227=function(_0x44f5e8){while(--_0x44f5e8){_0x350df6['push'](_0x350df6['shift']());}};_0x1a6227(++_0x9292f1);}(_0xd175,0x166));var _0x5d17=function(_0x23550e,_0x1c7fa5){_0x23550e=_0x23550e-0x0;var _0x2d619d=_0xd175[_0x23550e];return _0x2d619d;};'use strict';var _=require(_0x5d17('0x0'));var uuid=require('uuid');var util=require('./util');var logger=require(_0x5d17('0x1'))(_0x5d17('0x2'));var Agent=function(_0x34014c,_0xbf5a08,_0x214443,_0x5d83cc){this['notificationId']=uuid['v4']();this[_0x5d17('0x3')]=_0x34014c;this[_0x5d17('0x4')]=_0xbf5a08;this[_0x5d17('0x5')]=_0x214443;this[_0x5d17('0x2')]=_0x5d83cc;this[_0x5d17('0x3')][_0x5d17('0x6')](this[_0x5d17('0x7')][_0x5d17('0x8')](this),this['handleTimeout'][_0x5d17('0x8')](this));this[_0x5d17('0x3')]['on'](_0x5d17('0x9'),this[_0x5d17('0xa')][_0x5d17('0x8')](this));this[_0x5d17('0x3')]['on'](_0x5d17('0xb'),this[_0x5d17('0xc')][_0x5d17('0x8')](this));};Agent[_0x5d17('0xd')][_0x5d17('0x6')]=function(){this[_0x5d17('0x3')][_0x5d17('0x6')](this[_0x5d17('0x7')][_0x5d17('0x8')](this),this[_0x5d17('0xa')][_0x5d17('0x8')](this));};Agent['prototype']['handleDrained']=function(){this['handleTimeout'](!![]);};Agent[_0x5d17('0xd')][_0x5d17('0x7')]=function(_0x5187f5){logger[_0x5d17('0xe')](_0x5d17('0xf'),this[_0x5d17('0x3')]['id'],this[_0x5d17('0x4')]['id']);if(_[_0x5d17('0x10')](this['realtime'][_0x5d17('0x11')][this[_0x5d17('0x4')]['id']])){logger[_0x5d17('0xe')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x5d17('0x3')]['id'],this[_0x5d17('0x4')]['id']);setTimeout(this[_0x5d17('0x6')]['bind'](this),0x3e8);}else{if(this[_0x5d17('0x2')][_0x5d17('0x12')]||util['isAgentAvailable'](this[_0x5d17('0x3')]['id'],this[_0x5d17('0x5')][_0x5d17('0x11')][this[_0x5d17('0x4')]['id']],this[_0x5d17('0x3')][_0x5d17('0x13')],![])){this['realtime'][_0x5d17('0x11')][this['agent']['id']][_0x5d17('0x14')]=!![];this[_0x5d17('0x5')][_0x5d17('0x11')][this[_0x5d17('0x4')]['id']][_0x5d17('0x15')]=undefined;util[_0x5d17('0x16')](this[_0x5d17('0x17')],this[_0x5d17('0x3')]['id'],this[_0x5d17('0x5')][_0x5d17('0x11')][this[_0x5d17('0x4')]['id']],null,this['routing']);util[_0x5d17('0x18')](this[_0x5d17('0x3')]['id'],this['realtime'][_0x5d17('0x11')][this[_0x5d17('0x4')]['id']],_0x5d17('0x19')+(this['routing'][_0x5d17('0x12')]?_0x5d17('0x1a'):''));}else{logger['info'](_0x5d17('0x1b'),this[_0x5d17('0x3')]['id'],this[_0x5d17('0x4')]['id']);setTimeout(this['push'][_0x5d17('0x8')](this),0x3e8);}}};Agent[_0x5d17('0xd')][_0x5d17('0xa')]=function(_0x327abb){if(_[_0x5d17('0x10')](this[_0x5d17('0x5')][_0x5d17('0x11')][this[_0x5d17('0x4')]['id']])){return logger[_0x5d17('0xe')](_0x5d17('0x1c'),this[_0x5d17('0x3')]['id'],this[_0x5d17('0x4')]['id']);}else{logger[_0x5d17('0xe')](_0x5d17('0x1d'),this[_0x5d17('0x3')]['id'],this[_0x5d17('0x4')]['id']);util[_0x5d17('0x1e')](this[_0x5d17('0x17')],this['squeue']['id'],this[_0x5d17('0x5')][_0x5d17('0x11')][this[_0x5d17('0x4')]['id']],null,this[_0x5d17('0x2')]);this[_0x5d17('0x5')][_0x5d17('0x11')][this[_0x5d17('0x4')]['id']][_0x5d17('0x14')]=![];this[_0x5d17('0x5')][_0x5d17('0x11')][this[_0x5d17('0x4')]['id']][_0x5d17('0x15')]=undefined;util[_0x5d17('0x18')](this['squeue']['id'],this['realtime']['agents'][this[_0x5d17('0x4')]['id']],_0x327abb?_0x5d17('0x1f'):_0x5d17('0x20'));}if(!_0x327abb){setTimeout(this['push'][_0x5d17('0x8')](this),0x3e8);}};function agent(_0x4eeddf,_0x562494,_0x451278,_0x21afe9){return new Agent(_0x4eeddf,_0x562494,_0x451278,_0x21afe9);}module[_0x5d17('0x21')]=agent; \ No newline at end of file +var _0x7656=['busy','busyQueue','showNotification','writeLog','RINGING','forcedOwnership','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','TIMEOUT','exports','lodash','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','isNil','agents','info','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel'];(function(_0x4587fa,_0x163c40){var _0x3e7e13=function(_0x315872){while(--_0x315872){_0x4587fa['push'](_0x4587fa['shift']());}};_0x3e7e13(++_0x163c40);}(_0x7656,0x1dc));var _0x6765=function(_0x3e1c43,_0x342cbe){_0x3e1c43=_0x3e1c43-0x0;var _0x282365=_0x7656[_0x3e1c43];return _0x282365;};'use strict';var _=require(_0x6765('0x0'));var uuid=require('uuid');var util=require('./util');var logger=require(_0x6765('0x1'))(_0x6765('0x2'));var Agent=function(_0x2cf42b,_0x3aa498,_0x31c671,_0x40fa2c){this[_0x6765('0x3')]=uuid['v4']();this[_0x6765('0x4')]=_0x2cf42b;this[_0x6765('0x5')]=_0x3aa498;this[_0x6765('0x6')]=_0x31c671;this[_0x6765('0x2')]=_0x40fa2c;this[_0x6765('0x4')][_0x6765('0x7')](this[_0x6765('0x8')][_0x6765('0x9')](this),this[_0x6765('0xa')][_0x6765('0x9')](this));this[_0x6765('0x4')]['on'](_0x6765('0xb'),this[_0x6765('0xa')][_0x6765('0x9')](this));this[_0x6765('0x4')]['on'](_0x6765('0xc'),this[_0x6765('0xd')][_0x6765('0x9')](this));};Agent[_0x6765('0xe')][_0x6765('0x7')]=function(){this[_0x6765('0x4')][_0x6765('0x7')](this['handleRun'][_0x6765('0x9')](this),this['handleTimeout']['bind'](this));};Agent['prototype'][_0x6765('0xd')]=function(){this[_0x6765('0xa')](!![]);};Agent[_0x6765('0xe')][_0x6765('0x8')]=function(_0x1b8270){logger['info']('[%s][AGENT]\x20try\x20with\x20%s',this['squeue']['id'],this[_0x6765('0x5')]['id']);if(_[_0x6765('0xf')](this[_0x6765('0x6')][_0x6765('0x10')][this[_0x6765('0x5')]['id']])){logger[_0x6765('0x11')](_0x6765('0x12'),this['squeue']['id'],this[_0x6765('0x5')]['id']);setTimeout(this['push'][_0x6765('0x9')](this),0x3e8);}else{if(this['routing']['forcedOwnership']||util['isAgentAvailable'](this[_0x6765('0x4')]['id'],this['realtime']['agents'][this['agent']['id']],this['squeue'][_0x6765('0x13')],![])){this[_0x6765('0x6')][_0x6765('0x10')][this[_0x6765('0x5')]['id']][_0x6765('0x14')]=!![];this[_0x6765('0x6')][_0x6765('0x10')][this[_0x6765('0x5')]['id']][_0x6765('0x15')]=undefined;util[_0x6765('0x16')](this[_0x6765('0x3')],this[_0x6765('0x4')]['id'],this[_0x6765('0x6')][_0x6765('0x10')][this[_0x6765('0x5')]['id']],null,this['routing']);util[_0x6765('0x17')](this['squeue']['id'],this[_0x6765('0x6')][_0x6765('0x10')][this[_0x6765('0x5')]['id']],_0x6765('0x18')+(this[_0x6765('0x2')][_0x6765('0x19')]?':FORCED':''));}else{logger['info'](_0x6765('0x1a'),this['squeue']['id'],this['agent']['id']);setTimeout(this[_0x6765('0x7')]['bind'](this),0x3e8);}}};Agent[_0x6765('0xe')][_0x6765('0xa')]=function(_0x2afc03){if(_[_0x6765('0xf')](this[_0x6765('0x6')]['agents'][this[_0x6765('0x5')]['id']])){return logger[_0x6765('0x11')](_0x6765('0x12'),this[_0x6765('0x4')]['id'],this[_0x6765('0x5')]['id']);}else{logger[_0x6765('0x11')](_0x6765('0x1b'),this[_0x6765('0x4')]['id'],this[_0x6765('0x5')]['id']);util[_0x6765('0x1c')](this[_0x6765('0x3')],this['squeue']['id'],this[_0x6765('0x6')][_0x6765('0x10')][this[_0x6765('0x5')]['id']],null,this['routing']);this[_0x6765('0x6')][_0x6765('0x10')][this['agent']['id']][_0x6765('0x14')]=![];this['realtime'][_0x6765('0x10')][this[_0x6765('0x5')]['id']]['busyQueue']=undefined;util[_0x6765('0x17')](this[_0x6765('0x4')]['id'],this[_0x6765('0x6')][_0x6765('0x10')][this[_0x6765('0x5')]['id']],_0x2afc03?'STOP':_0x6765('0x1d'));}if(!_0x2afc03){setTimeout(this[_0x6765('0x7')]['bind'](this),0x3e8);}};function agent(_0x480faf,_0x55dd3b,_0x51addd,_0x17b2da){return new Agent(_0x480faf,_0x55dd3b,_0x51addd,_0x17b2da);}module[_0x6765('0x1e')]=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 7a629be..713d9f4 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 _0x49fe=['writeLog','RINGING','busyQueue','name','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','TIMEOUT','busy','exports','lodash','uuid','./util','notificationId','squeue','realtime','routing','push','bind','handleTimeout','timeout','drained','prototype','handleRun','handleDrained','isNil','queue','Agents','length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel'];(function(_0x1da90c,_0x1753b1){var _0x4108df=function(_0x18dcd4){while(--_0x18dcd4){_0x1da90c['push'](_0x1da90c['shift']());}};_0x4108df(++_0x1753b1);}(_0x49fe,0x100));var _0xe49f=function(_0x231ee7,_0x263d48){_0x231ee7=_0x231ee7-0x0;var _0x3ba65a=_0x49fe[_0x231ee7];return _0x3ba65a;};'use strict';var _=require(_0xe49f('0x0'));var uuid=require(_0xe49f('0x1'));var util=require(_0xe49f('0x2'));var logger=require('../../../../../config/logger')('routing');var Beepall=function(_0x277bc4,_0x595aeb,_0x195bcf,_0x199a0b){this[_0xe49f('0x3')]=uuid['v4']();this[_0xe49f('0x4')]=_0x277bc4;this['queue']=_0x595aeb;this[_0xe49f('0x5')]=_0x195bcf;this[_0xe49f('0x6')]=_0x199a0b;this[_0xe49f('0x4')][_0xe49f('0x7')](this['handleRun'][_0xe49f('0x8')](this),this[_0xe49f('0x9')][_0xe49f('0x8')](this));this[_0xe49f('0x4')]['on'](_0xe49f('0xa'),this['handleTimeout']['bind'](this));this[_0xe49f('0x4')]['on'](_0xe49f('0xb'),this['handleDrained']['bind'](this));};Beepall[_0xe49f('0xc')][_0xe49f('0x7')]=function(){this[_0xe49f('0x4')][_0xe49f('0x7')](this[_0xe49f('0xd')][_0xe49f('0x8')](this),this['handleTimeout']['bind'](this));};Beepall[_0xe49f('0xc')][_0xe49f('0xe')]=function(_0x7406){this[_0xe49f('0x9')](!![]);};Beepall[_0xe49f('0xc')]['handleRun']=function(_0x1f65a5){var _0x3dac3d=!![];if(!_[_0xe49f('0xf')](this['queue'])&&!_[_0xe49f('0xf')](this[_0xe49f('0x10')][_0xe49f('0x11')])&&this['queue'][_0xe49f('0x11')][_0xe49f('0x12')]>0x0){for(var _0x37c30f=0x0,_0x18d2ec;_0x37c30f0x0){for(var _0x218e76=0x0,_0x119a88;_0x218e760x0&&_0x59b37c[_0x43017d+_0xa9a5('0x24')]>=_0x59b37c[_0x43017d+'Capacity']){writeLog(_0x5c8314,_0x59b37c,_0x43017d[_0xa9a5('0x26')]()+_0xa9a5('0x27'));return![];}}return!![];};exports['showNotification']=function(_0xda152d,_0x474671,_0x5743b6,_0x11f6ce,_0x52e2ad){return sendNotification(!![],_0xda152d,_0x474671,_0x5743b6,_0x11f6ce,_0x52e2ad);};exports[_0xa9a5('0x28')]=function(_0x47ee9e,_0x1a9832,_0x3b271d,_0x4a84ad,_0x4d2629){return sendNotification(![],_0x47ee9e,_0x1a9832,_0x3b271d,_0x4a84ad,_0x4d2629);};exports[_0xa9a5('0x29')]=writeLog; \ No newline at end of file +var _0x4c60=['socket.io-emitter','user:%s','emit','user:save','split','\x20interaction','account','notificationSound','body','queue','getMustacheRender','notificationTemplate','msg','I\x20can\x27t\x20render\x20your\x20template','error','format','message','notification:%s','save','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','name','isAgentAvailable','online','OFFLINE','Pause','PAUSE','hasOwnProperty','CurrentCapacity','Capacity','toUpperCase','\x20MAXCAPACITY','writeLog','lodash','util','../utils','mustache','../../../../../config/environment','redis','localhost'];(function(_0x580cdc,_0x338623){var _0x55260c=function(_0x5b1a20){while(--_0x5b1a20){_0x580cdc['push'](_0x580cdc['shift']());}};_0x55260c(++_0x338623);}(_0x4c60,0xc1));var _0x04c6=function(_0x2ee8d9,_0x3d98e5){_0x2ee8d9=_0x2ee8d9-0x0;var _0x20acb4=_0x4c60[_0x2ee8d9];return _0x20acb4;};'use strict';var _=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var utils=require(_0x04c6('0x2'));var Mustache=require(_0x04c6('0x3'));var Redis=require('ioredis');var config=require(_0x04c6('0x4'));var logger=require('../../../../../config/logger')('routing');config['redis']=_['defaults'](config[_0x04c6('0x5')],{'host':_0x04c6('0x6'),'port':0x18eb});var io=require(_0x04c6('0x7'))(new Redis(config[_0x04c6('0x5')]));function emit(_0x2b9041,_0x39be2d,_0x8f9b13){io['to'](_0x2b9041)['emit'](_0x39be2d,_0x8f9b13);}function sendNotification(_0x2a4b51,_0x43a27e,_0x207649,_0x30b901,_0x52a9af,_0x59a98c){io['to'](util['format'](_0x04c6('0x8'),_0x30b901['name']))[_0x04c6('0x9')](_0x04c6('0xa'),_0x30b901);var _0x5236c8=_0x59a98c||{};var _0x4316f8=_0x207649[_0x04c6('0xb')]('.');var _0x119187={'uniqueid':_0x43a27e,'channel':_0x4316f8[0x0],'id':_0x4316f8[0x1],'title':_0x4316f8[0x0]+_0x04c6('0xc'),'interactionId':_0x4316f8[0x2],'queue':_0x52a9af?_0x52a9af['name']:null,'sound':_0x5236c8[_0x04c6('0xd')][_0x04c6('0xe')],'shake':_0x5236c8[_0x04c6('0xd')]['notificationShake']};try{if(!_0x5236c8[_0x04c6('0xf')]){_0x5236c8[_0x04c6('0xf')]={};}if(_0x52a9af){_0x5236c8[_0x04c6('0xf')][_0x04c6('0x10')]=_0x52a9af;}else if(_0x5236c8[_0x04c6('0xf')][_0x04c6('0x10')]){delete _0x5236c8[_0x04c6('0xf')][_0x04c6('0x10')];}_0x119187['msg']=utils[_0x04c6('0x11')](_0x5236c8[_0x04c6('0xd')][_0x04c6('0x12')],_0x5236c8);}catch(_0x2bc754){_0x119187[_0x04c6('0x13')]=_0x04c6('0x14');logger[_0x04c6('0x15')](util[_0x04c6('0x16')]('[%s][QUEUE]\x20%s',_0x43a27e,_0x2bc754[_0x04c6('0x17')]));}io['to'](util[_0x04c6('0x16')](_0x04c6('0x8'),_0x30b901['name']))['emit'](util['format'](_0x04c6('0x18'),_0x2a4b51?_0x04c6('0x19'):'remove'),_0x119187);}function writeLog(_0x5a5e9e,_0x1e6854,_0x2eed94){return logger[_0x04c6('0x1a')](util['format'](_0x04c6('0x1b'),_0x5a5e9e,_0x1e6854[_0x04c6('0x1c')],_0x2eed94));}exports[_0x04c6('0x1d')]=function(_0x49c179,_0x2d3277,_0x41e29f,_0x562491){if(_0x2d3277['busy']){writeLog(_0x49c179,_0x2d3277,'BUSY');return![];}if(!_0x2d3277[_0x04c6('0x1e')]){writeLog(_0x49c179,_0x2d3277,_0x04c6('0x1f'));return![];}if(_0x2d3277[_0x41e29f+_0x04c6('0x20')]){writeLog(_0x49c179,_0x2d3277,_0x04c6('0x21'));return![];}if(_0x562491&&_0x2d3277[_0x04c6('0x22')](_0x41e29f+'Capacity')&&_0x2d3277['hasOwnProperty'](_0x41e29f+_0x04c6('0x23'))){if(_0x2d3277[_0x41e29f+_0x04c6('0x24')]>0x0&&_0x2d3277[_0x41e29f+_0x04c6('0x23')]>=_0x2d3277[_0x41e29f+_0x04c6('0x24')]){writeLog(_0x49c179,_0x2d3277,_0x41e29f[_0x04c6('0x25')]()+_0x04c6('0x26'));return![];}}return!![];};exports['showNotification']=function(_0x1d0d3f,_0x165cb5,_0x4e00fe,_0x264cde,_0x1cd16a){return sendNotification(!![],_0x1d0d3f,_0x165cb5,_0x4e00fe,_0x264cde,_0x1cd16a);};exports['hideNotification']=function(_0x5c9003,_0x115d84,_0x3a6d92,_0x2a191f,_0xbb9e81){return sendNotification(![],_0x5c9003,_0x115d84,_0x3a6d92,_0x2a191f,_0xbb9e81);};exports[_0x04c6('0x27')]=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index 97af349..f200e59 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 _0xc6d7=['error','[%s][SYSTEM]\x20%s','map','info','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','replace','isNil','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','lodash','./utils','../../../../config/logger','string','length'];(function(_0xa7be7b,_0x1cb925){var _0x1b5a19=function(_0x144da8){while(--_0x144da8){_0xa7be7b['push'](_0xa7be7b['shift']());}};_0x1b5a19(++_0x1cb925);}(_0xc6d7,0x174));var _0x7c6d=function(_0x45c92e,_0x7814e8){_0x45c92e=_0x45c92e-0x0;var _0x494943=_0xc6d7[_0x45c92e];return _0x494943;};'use strict';var schema=require(_0x7c6d('0x0'));var sh=require('shelljs');var _=require(_0x7c6d('0x1'));var utils=require(_0x7c6d('0x2'));var logger=require(_0x7c6d('0x3'))('routing');var system=schema({'command':{'type':_0x7c6d('0x4'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x5ac6bb,_0x1dc1d8){return function(_0x47ccca){try{var _0x5a2c66={'command':_0x1dc1d8[0x0]};var _0x311891=system[_0x7c6d('0x0')](_0x5a2c66,{'typecast':!![]});if(_0x311891[_0x7c6d('0x5')]){logger[_0x7c6d('0x6')](_0x7c6d('0x7'),_0x5ac6bb,_[_0x7c6d('0x8')](_0x311891,'message')['join'](',\x20'));logger[_0x7c6d('0x9')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x5ac6bb);_0x47ccca[_0x7c6d('0xa')]();}else{var _0x250643=this;var _0x2ebfa1=utils[_0x7c6d('0xb')](_0x1dc1d8[0x0],this);logger['info'](_0x7c6d('0xc'),_0x5ac6bb,_0x2ebfa1);sh['exec'](_['trim'](_0x2ebfa1),function(_0x2c160f,_0x3bc01d){logger[_0x7c6d('0x9')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x5ac6bb,_0x2c160f);if(_0x2c160f==0x0){var _0x4c8469=_0x3bc01d[_0x7c6d('0xd')](/(\r\n|\n|\r)/gm,'');if(_[_0x7c6d('0xe')](_0x1dc1d8[0x1])||_['isEmpty'](_0x1dc1d8[0x1])){logger[_0x7c6d('0x9')](_0x7c6d('0xf'),_0x5ac6bb);_0x250643[_0x7c6d('0x10')][_0x1dc1d8[0x1]]=_0x4c8469;}else{logger[_0x7c6d('0x9')](_0x7c6d('0x11'),_0x5ac6bb,_0x1dc1d8[0x1],_0x4c8469);_0x250643[_0x7c6d('0x10')][_0x1dc1d8[0x1]]=_0x4c8469;}}_0x47ccca['next']();});}}catch(_0x3f7a60){logger[_0x7c6d('0x6')](_0x7c6d('0x7'),_0x5ac6bb,_[_0x7c6d('0x12')](_0x3f7a60)?JSON[_0x7c6d('0x13')](_0x3f7a60):_0x3f7a60);logger['info'](_0x7c6d('0x14'),_0x5ac6bb);_0x47ccca['next']();}};}; \ No newline at end of file +var _0x0fa5=['string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','[%s][SYSTEM]\x20%s','message','getMustacheRender','info','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','error','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','shelljs','lodash','./utils','../../../../config/logger','routing'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x0fa5,0x132));var _0x50fa=function(_0x1d99a1,_0x2baa4b){_0x1d99a1=_0x1d99a1-0x0;var _0x46571b=_0x0fa5[_0x1d99a1];return _0x46571b;};'use strict';var schema=require(_0x50fa('0x0'));var sh=require(_0x50fa('0x1'));var _=require(_0x50fa('0x2'));var utils=require(_0x50fa('0x3'));var logger=require(_0x50fa('0x4'))(_0x50fa('0x5'));var system=schema({'command':{'type':_0x50fa('0x6'),'required':!![],'message':_0x50fa('0x7')}});exports[_0x50fa('0x8')]=function(_0x4d38a8,_0x5be315){return function(_0x375033){try{var _0x291683={'command':_0x5be315[0x0]};var _0x573dc7=system[_0x50fa('0x0')](_0x291683,{'typecast':!![]});if(_0x573dc7['length']){logger['error'](_0x50fa('0x9'),_0x4d38a8,_['map'](_0x573dc7,_0x50fa('0xa'))['join'](',\x20'));logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x4d38a8);_0x375033['next']();}else{var _0x47512b=this;var _0x4f7d23=utils[_0x50fa('0xb')](_0x5be315[0x0],this);logger[_0x50fa('0xc')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x4d38a8,_0x4f7d23);sh[_0x50fa('0xd')](_[_0x50fa('0xe')](_0x4f7d23),function(_0x3580e0,_0x1c5f96){logger[_0x50fa('0xc')](_0x50fa('0xf'),_0x4d38a8,_0x3580e0);if(_0x3580e0==0x0){var _0x156865=_0x1c5f96[_0x50fa('0x10')](/(\r\n|\n|\r)/gm,'');if(_[_0x50fa('0x11')](_0x5be315[0x1])||_['isEmpty'](_0x5be315[0x1])){logger['info'](_0x50fa('0x12'),_0x4d38a8);_0x47512b[_0x50fa('0x13')][_0x5be315[0x1]]=_0x156865;}else{logger[_0x50fa('0xc')](_0x50fa('0x14'),_0x4d38a8,_0x5be315[0x1],_0x156865);_0x47512b[_0x50fa('0x13')][_0x5be315[0x1]]=_0x156865;}}_0x375033[_0x50fa('0x15')]();});}}catch(_0x1e3245){logger[_0x50fa('0x16')](_0x50fa('0x9'),_0x4d38a8,_[_0x50fa('0x17')](_0x1e3245)?JSON[_0x50fa('0x18')](_0x1e3245):_0x1e3245);logger[_0x50fa('0xc')](_0x50fa('0x19'),_0x4d38a8);_0x375033[_0x50fa('0x15')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index 6591413..86de99c 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 _0x40e2=['[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','then','interaction','catch','error','stringify','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0xe95af,_0x4b849b){var _0x16effb=function(_0x454cd0){while(--_0x454cd0){_0xe95af['push'](_0xe95af['shift']());}};_0x16effb(++_0x4b849b);}(_0x40e2,0xc6));var _0x240e=function(_0x339129,_0x86dcc6){_0x339129=_0x339129-0x0;var _0x1570df=_0x40e2[_0x339129];return _0x1570df;};'use strict';var schema=require(_0x240e('0x0'));var _=require(_0x240e('0x1'));var rpc={'chatInteraction':require(_0x240e('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x240e('0x3')),'mailInteraction':require(_0x240e('0x4')),'faxInteraction':require(_0x240e('0x5')),'whatsappInteraction':require(_0x240e('0x6'))};var logger=require(_0x240e('0x7'))(_0x240e('0x8'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x240e('0x9')}});exports['consequence']=function(_0x295c0a,_0x5ee43b,_0x3a214d,_0x9e3d86){return function(_0x419d51){try{var _0x596a59={'tag':_0x5ee43b[0x0]};var _0x348120=tag['validate'](_0x596a59,{'typecast':!![]});if(_0x348120['length']){logger['error'](_0x240e('0xa'),_0x295c0a,_[_0x240e('0xb')](_0x348120,_0x240e('0xc'))[_0x240e('0xd')](',\x20'));logger[_0x240e('0xe')](_0x240e('0xf'),_0x295c0a);_0x419d51[_0x240e('0x10')]();}else{var _0x38d1f5={'ids':[_0x5ee43b[0x0]]};if(rpc[_0x9e3d86[_0x240e('0x11')]+_0x240e('0x12')]){rpc[_0x9e3d86['channel']+_0x240e('0x12')][_0x240e('0x13')](_0x9e3d86['interaction']['id'],_0x38d1f5)[_0x240e('0x14')](function(_0xd8ac46){logger[_0x240e('0xe')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x295c0a,_0x5ee43b[0x1],_0x9e3d86['channel'],_0x9e3d86[_0x240e('0x15')]['id']);})[_0x240e('0x16')](function(_0x533816){logger[_0x240e('0x17')]('[%s][TAG]\x20%s',_0x295c0a,JSON[_0x240e('0x18')](_0x533816));logger[_0x240e('0xe')](_0x240e('0xf'),_0x295c0a);})['finally'](function(){_0x419d51[_0x240e('0x10')]();});}}}catch(_0x22479c){logger[_0x240e('0x17')]('[%s][TAG]\x20%s',_0x295c0a,_[_0x240e('0x19')](_0x22479c)?JSON[_0x240e('0x18')](_0x22479c):_0x22479c);logger[_0x240e('0xe')](_0x240e('0xf'),_0x295c0a);_0x419d51[_0x240e('0x10')]();}};}; \ No newline at end of file +var _0x2a09=['error','[%s][TAG]\x20%s','message','join','info','[%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','next','isObject','stringify','validate','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','consequence','length'];(function(_0x5e8dbf,_0x38d146){var _0x10c24c=function(_0x2409ea){while(--_0x2409ea){_0x5e8dbf['push'](_0x5e8dbf['shift']());}};_0x10c24c(++_0x38d146);}(_0x2a09,0x198));var _0x92a0=function(_0xae2489,_0x55adfb){_0xae2489=_0xae2489-0x0;var _0x4a40c7=_0x2a09[_0xae2489];return _0x4a40c7;};'use strict';var schema=require(_0x92a0('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0x92a0('0x1')),'openchannelInteraction':require(_0x92a0('0x2')),'smsInteraction':require(_0x92a0('0x3')),'mailInteraction':require(_0x92a0('0x4')),'faxInteraction':require(_0x92a0('0x5')),'whatsappInteraction':require(_0x92a0('0x6'))};var logger=require(_0x92a0('0x7'))(_0x92a0('0x8'));var tag=schema({'tag':{'type':_0x92a0('0x9'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x92a0('0xa')]=function(_0x5a2e80,_0x551e33,_0x420296,_0x3d598d){return function(_0x5d3e15){try{var _0x5d3881={'tag':_0x551e33[0x0]};var _0x4cb1dd=tag[_0x92a0('0x0')](_0x5d3881,{'typecast':!![]});if(_0x4cb1dd[_0x92a0('0xb')]){logger[_0x92a0('0xc')](_0x92a0('0xd'),_0x5a2e80,_['map'](_0x4cb1dd,_0x92a0('0xe'))[_0x92a0('0xf')](',\x20'));logger[_0x92a0('0x10')](_0x92a0('0x11'),_0x5a2e80);_0x5d3e15['next']();}else{var _0x115976={'ids':[_0x551e33[0x0]]};if(rpc[_0x3d598d[_0x92a0('0x12')]+_0x92a0('0x13')]){rpc[_0x3d598d[_0x92a0('0x12')]+'Interaction'][_0x92a0('0x14')](_0x3d598d[_0x92a0('0x15')]['id'],_0x115976)[_0x92a0('0x16')](function(_0x356040){logger[_0x92a0('0x10')](_0x92a0('0x17'),_0x5a2e80,_0x551e33[0x1],_0x3d598d[_0x92a0('0x12')],_0x3d598d[_0x92a0('0x15')]['id']);})[_0x92a0('0x18')](function(_0x56f7f6){logger[_0x92a0('0xc')](_0x92a0('0xd'),_0x5a2e80,JSON['stringify'](_0x56f7f6));logger[_0x92a0('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x5a2e80);})['finally'](function(){_0x5d3e15[_0x92a0('0x19')]();});}}}catch(_0x427c03){logger[_0x92a0('0xc')](_0x92a0('0xd'),_0x5a2e80,_[_0x92a0('0x1a')](_0x427c03)?JSON[_0x92a0('0x1b')](_0x427c03):_0x427c03);logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x5a2e80);_0x5d3e15[_0x92a0('0x19')]();}};}; \ 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 383c49b..9daf291 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x60223c,_0x1e966b){var _0x32e96c=function(_0x137c60){while(--_0x137c60){_0x60223c['push'](_0x60223c['shift']());}};_0x32e96c(++_0x1e966b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file +var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x2168c1,_0x166138){var _0x18c3c0=function(_0x3335c3){while(--_0x3335c3){_0x2168c1['push'](_0x2168c1['shift']());}};_0x18c3c0(++_0x166138);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index cedf84b..03132c9 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 _0xc329=['hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','chatQueues','available','name','mailQueues','loggedIn','paused','openchannelQueues','waiting','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','stringify','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','bluebird','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','Intervals','interval','rules','channel','message','interaction','applications','isArray','length','existsSync','join','app','toLowerCase','autoreply','split','mail','push','slice','dialogflow','appdata','dialogflowv2','tag','TagId','condition','./applications/','priority','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','info','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','catch','message\x20is\x20empty'];(function(_0x156903,_0x68e3b6){var _0x2fd29f=function(_0x236a96){while(--_0x236a96){_0x156903['push'](_0x156903['shift']());}};_0x2fd29f(++_0x68e3b6);}(_0xc329,0x12f));var _0x9c32=function(_0x423549,_0x242e63){_0x423549=_0x423549-0x0;var _0xdcb104=_0xc329[_0x423549];return _0xdcb104;};'use strict';var _=require(_0x9c32('0x0'));var util=require(_0x9c32('0x1'));var path=require(_0x9c32('0x2'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0x9c32('0x3'));var uuid=require('uuid');var config=require(_0x9c32('0x4'));var logger=require(_0x9c32('0x5'))(_0x9c32('0x6'));var rpc={'openchannelQueueReport':require(_0x9c32('0x7')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x9c32('0x8')),'smsQueueReport':require(_0x9c32('0x9')),'faxQueueReport':require(_0x9c32('0xa')),'whatsappQueueReport':require(_0x9c32('0xb'))};var RuleEngine=require(_0x9c32('0xc'));function getId(_0xec841f,_0x4e96c1,_0x5d499b){return util[_0x9c32('0xd')](_0x9c32('0xe'),_0xec841f,_0x4e96c1||0x0,_0x5d499b||0x0);}function getIntervals(_0x17b097,_0x6f2349){var _0x2dde80=[];if(!_['isNil'](_0x6f2349[_0x9c32('0xf')])&&!_[_0x9c32('0x10')](_0x17b097[_0x6f2349[_0x9c32('0xf')]])&&!_[_0x9c32('0x10')](_0x17b097[_0x6f2349[_0x9c32('0xf')]][_0x9c32('0x11')])){_0x2dde80=_['map'](_0x17b097[_0x6f2349[_0x9c32('0xf')]][_0x9c32('0x11')],'interval');}else if(!_[_0x9c32('0x10')](_0x6f2349['interval'])){_0x2dde80=[_0x6f2349[_0x9c32('0x12')]];}return _0x2dde80;}exports['listen']=function(_0x27b7f5){_0x27b7f5[_0x9c32('0x13')]={};return new BPromise(function(_0xd773fa,_0x3f5986){var _0x192da1={'Start':function(_0x560ebf){var _0x167093=this;return new Promise(function(_0x232575,_0x3ee20e){if(_0x560ebf){try{var _0x611cbd=[];var _0x1bf01f=getId(_0x560ebf[_0x9c32('0x14')],_0x560ebf[_0x9c32('0x15')]?_0x560ebf['message']['id']:0x0,_0x560ebf['interaction']?_0x560ebf[_0x9c32('0x16')]['id']:0x0);if(_0x560ebf[_0x9c32('0x17')]&&_[_0x9c32('0x18')](_0x560ebf[_0x9c32('0x17')])&&_0x560ebf[_0x9c32('0x17')][_0x9c32('0x19')]){for(var _0x5e096f=0x0;_0x5e096f<_0x560ebf[_0x9c32('0x17')][_0x9c32('0x19')];_0x5e096f+=0x1){var _0x3ab80e=_0x560ebf['applications'][_0x5e096f];if(fs[_0x9c32('0x1a')](path[_0x9c32('0x1b')](__dirname,_0x9c32('0x17'),_0x3ab80e[_0x9c32('0x1c')]+'.js'))){var _0x2704df=[];switch(_0x3ab80e[_0x9c32('0x1c')][_0x9c32('0x1d')]()){case _0x9c32('0x1e'):var _0x48d814=_0x3ab80e['appdata'][_0x9c32('0x1f')](',');if(_0x560ebf['channel']===_0x9c32('0x20')){_0x2704df[_0x9c32('0x21')](_0x48d814[0x0]);_0x2704df[_0x9c32('0x21')](_0x48d814[0x1]);_0x2704df[_0x9c32('0x21')](_0x48d814[_0x9c32('0x22')](0x2,_0x48d814[_0x9c32('0x19')])[_0x9c32('0x1b')](','));}else{_0x2704df['push'](_0x48d814[0x0]);_0x2704df['push'](_0x48d814[_0x9c32('0x22')](0x1,_0x48d814[_0x9c32('0x19')])[_0x9c32('0x1b')](','));}break;case _0x9c32('0x23'):var _0x5b7e00=_0x3ab80e[_0x9c32('0x24')]['split'](',');_0x2704df[_0x9c32('0x21')](_0x5b7e00[0x0]);_0x2704df[_0x9c32('0x21')](_0x5b7e00[0x1]);_0x2704df[_0x9c32('0x21')](_0x5b7e00['slice'](0x2,_0x5b7e00[_0x9c32('0x19')])[_0x9c32('0x1b')](','));break;case _0x9c32('0x25'):var _0x207ebd=_0x3ab80e[_0x9c32('0x24')]['split'](',');_0x2704df[_0x9c32('0x21')](_0x207ebd[0x0]);_0x2704df[_0x9c32('0x21')](_0x207ebd[0x1]);_0x2704df[_0x9c32('0x21')](_0x207ebd[0x2]);_0x2704df[_0x9c32('0x21')](_0x207ebd[0x3]);_0x2704df['push'](_0x207ebd['slice'](0x4,_0x207ebd[_0x9c32('0x19')])[_0x9c32('0x1b')](','));break;case'amazonlex':var _0x21bafe=_0x3ab80e[_0x9c32('0x24')][_0x9c32('0x1f')](',');_0x2704df[_0x9c32('0x21')](_0x21bafe[0x0]);_0x2704df[_0x9c32('0x21')](_0x21bafe[0x1]);_0x2704df['push'](_0x21bafe[0x2]);_0x2704df['push'](_0x21bafe[0x3]);_0x2704df[_0x9c32('0x21')](_0x21bafe[_0x9c32('0x22')](0x4,_0x21bafe['length'])[_0x9c32('0x1b')](','));break;case _0x9c32('0x15'):_0x2704df[_0x9c32('0x21')](_0x3ab80e['appdata']);break;case _0x9c32('0x26'):_0x2704df[_0x9c32('0x21')](_0x3ab80e[_0x9c32('0x27')]);_0x2704df[_0x9c32('0x21')](_0x3ab80e[_0x9c32('0x24')]);break;default:_0x2704df=_[_0x9c32('0x10')](_0x3ab80e[_0x9c32('0x24')])?[]:_0x3ab80e[_0x9c32('0x24')][_0x9c32('0x1f')](',');}var _0x3b6cb2={'id':util['format']('%s:%s:%s',_0x1bf01f,_0x3ab80e['id'],_0x3ab80e[_0x9c32('0x1c')]),'condition':require('./interval')[_0x9c32('0x28')](_0x1bf01f,getIntervals(_0x27b7f5['intervals'],_0x3ab80e),_0x27b7f5),'consequence':require(_0x9c32('0x29')+_0x3ab80e[_0x9c32('0x1c')])['consequence'](_0x1bf01f,_0x2704df,_0x27b7f5,_0x560ebf),'p':_0x3ab80e[_0x9c32('0x2a')]||0x0};logger['info'](_0x9c32('0x2b'),_0x3b6cb2['id'],_0x9c32('0x2c'),getIntervals(_0x27b7f5['intervals'],_0x3ab80e)[_0x9c32('0x1b')](_0x9c32('0x2d')));_0x611cbd[_0x9c32('0x21')](_0x3b6cb2);}else{logger[_0x9c32('0x2e')](_0x9c32('0x2f'),path[_0x9c32('0x1b')](__dirname,_0x9c32('0x17'),_0x3ab80e[_0x9c32('0x1c')]+'.js'));}}_0x27b7f5[_0x9c32('0x13')][_0x1bf01f]=new RuleEngine(_0x611cbd);_0x27b7f5['rules'][_0x1bf01f][_0x9c32('0x30')](_0x560ebf,function(_0x20a7e8){logger[_0x9c32('0x31')]('Applications\x20executed',JSON['stringify'](_0x20a7e8[_0x9c32('0x32')]));if(_0x27b7f5[_0x9c32('0x13')][_0x1bf01f]){_0x27b7f5[_0x9c32('0x13')][_0x1bf01f][_0x9c32('0x33')](_0x9c32('0x34'));}});return _0x232575({'code':0xc8,'message':_0x560ebf});}else{logger[_0x9c32('0x31')](_0x9c32('0x35'));return _0x232575({'code':0xc8,'message':_0x560ebf});}}catch(_0x374ca0){logger['error'](_0x374ca0[_0x9c32('0x36')]);return _0x3ee20e(_0x167093[_0x9c32('0x2e')](0x1f4,_0x374ca0));}}return _0x3ee20e(_0x9c32('0x37'));});},'AcceptMessage':function(_0x18258e){var _0x331379=this;return new Promise(function(_0xbc0732,_0x21c9db){if(_0x18258e['agent']&&_0x18258e[_0x9c32('0x38')]['id']){if(_0x27b7f5[_0x9c32('0x39')][_0x18258e[_0x9c32('0x38')]['id']]){_0x27b7f5[_0x9c32('0x39')][_0x18258e[_0x9c32('0x38')]['id']][_0x9c32('0x3a')]=![];_0x27b7f5['agents'][_0x18258e[_0x9c32('0x38')]['id']][_0x9c32('0x3b')]=undefined;}}if(_0x18258e[_0x9c32('0x15')]&&_0x18258e[_0x9c32('0x15')]['id']){try{var _0x1f614e=getId(_0x18258e[_0x9c32('0x14')],_0x18258e[_0x9c32('0x15')]?_0x18258e[_0x9c32('0x15')]['id']:0x0,_0x18258e[_0x9c32('0x16')]?_0x18258e[_0x9c32('0x16')]['id']:0x0);if(_0x27b7f5['rules'][_0x1f614e]){_0x27b7f5[_0x9c32('0x13')][_0x1f614e][_0x9c32('0x33')](_0x9c32('0x3c'));if(rpc[_0x18258e[_0x9c32('0x14')]+'QueueReport']){rpc[_0x18258e[_0x9c32('0x14')]+_0x9c32('0x3d')][_0x9c32('0x3e')](_0x1f614e,{'UserId':_0x18258e[_0x9c32('0x15')]['UserId']})[_0x9c32('0x3f')](function(_0x1fd02){logger[_0x9c32('0x2e')]('error\x20update\x20queue\x20report');});}}return _0xbc0732({'code':0xc8,'message':_0x18258e});}catch(_0x51cb63){logger[_0x9c32('0x2e')](_0x51cb63[_0x9c32('0x36')]);return _0x21c9db(_0x331379[_0x9c32('0x2e')](0x1f4,_0x51cb63));}}logger[_0x9c32('0x2e')]('message\x20is\x20empty');return _0x21c9db(_0x331379['error'](0x1f4,_0x9c32('0x40')));});},'RejectMessage':function(_0x3cdbd3){var _0x24acd0=this;return new Promise(function(_0xb8e750,_0x3ee26f){if(_0x3cdbd3['agent']&&_0x3cdbd3['agent']['id']){try{if(_0x27b7f5[_0x9c32('0x39')][_0x3cdbd3[_0x9c32('0x38')]['id']]){_0x27b7f5[_0x9c32('0x39')][_0x3cdbd3[_0x9c32('0x38')]['id']]['busy']=![];_0x27b7f5[_0x9c32('0x39')][_0x3cdbd3[_0x9c32('0x38')]['id']]['busyQueue']=undefined;}return _0xb8e750({'code':0xc8,'message':_0x3cdbd3});}catch(_0x2db397){logger[_0x9c32('0x2e')](_0x2db397['stack']);return _0x3ee26f(_0x24acd0[_0x9c32('0x2e')](0x1f4,_0x2db397));}}logger[_0x9c32('0x2e')]('message\x20is\x20empty');return _0x3ee26f(_0x24acd0[_0x9c32('0x2e')](0x1f4,_0x9c32('0x40')));});},'AbandonInteraction':function(_0x54f421){var _0x4116ac=this;return new Promise(function(_0x1cce99,_0x163295){if(_0x54f421['channel']&&_0x54f421[_0x9c32('0x16')]&&_0x54f421[_0x9c32('0x16')]['id']){try{var _0x4cc3a8=getId(_0x54f421['channel'],_0x54f421[_0x9c32('0x15')]?_0x54f421['message']['id']:0x0,_0x54f421['interaction']?_0x54f421[_0x9c32('0x16')]['id']:0x0);if(_0x27b7f5['rules'][_0x4cc3a8]){_0x27b7f5[_0x9c32('0x13')][_0x4cc3a8]['emit'](_0x9c32('0x3c'));}return _0x1cce99({'code':0xc8,'message':_0x54f421});}catch(_0x5c2859){logger[_0x9c32('0x2e')](_0x5c2859['stack']);return _0x163295(_0x4116ac[_0x9c32('0x2e')](0x1f4,_0x5c2859));}}logger[_0x9c32('0x2e')](_0x9c32('0x40'));return _0x163295(_0x4116ac['error'](0x1f4,_0x9c32('0x40')));});},'AgentCapacity':function(_0x124ffb){var _0x3f1d95=this;return new Promise(function(_0x5a3772,_0x3ebb48){if(_0x27b7f5[_0x9c32('0x39')][_0x9c32('0x41')](_0x124ffb['id'])){for(var _0x5d61a9 in _0x124ffb[_0x9c32('0x42')]){if(_0x124ffb[_0x9c32('0x42')][_0x9c32('0x41')](_0x5d61a9)){if(_0x27b7f5[_0x9c32('0x39')][_0x124ffb['id']]['hasOwnProperty'](_0x5d61a9+_0x9c32('0x43'))){_0x27b7f5['agents'][_0x124ffb['id']][_0x5d61a9+_0x9c32('0x43')]=parseInt(_0x124ffb[_0x9c32('0x42')][_0x5d61a9],0xa);}}}_0x27b7f5[_0x9c32('0x39')][_0x124ffb['id']][_0x9c32('0x44')]();return _0x5a3772({'code':0xc8,'message':_0x27b7f5[_0x9c32('0x39')][_0x124ffb['id']]});}else{return _0x3ebb48(_0x3f1d95[_0x9c32('0x2e')](0x1f4,_0x9c32('0x45')));}});},'Agents':function(_0x2cadaa){return new Promise(function(_0x17b9af,_0x1835e7){var _0x2b24c3=_['values'](_0x27b7f5[_0x9c32('0x39')]);_0x17b9af({'count':_0x2b24c3[_0x9c32('0x19')],'rows':_0x2b24c3});});},'ChatQueues':function(_0x27ec40){return new Promise(function(_0x1e98a9,_0x302809){var _0x4a103a=[];for(var _0x3616fa in _0x27b7f5[_0x9c32('0x46')]){if(_0x27b7f5[_0x9c32('0x46')][_0x9c32('0x41')](_0x3616fa)){var _0x2bee22=_0x27b7f5['chatQueues'][_0x3616fa];var _0x3b1ba3={'id':_0x2bee22['id'],'available':_0x2bee22[_0x9c32('0x47')],'loggedIn':_0x2bee22['loggedIn'],'name':_0x2bee22[_0x9c32('0x48')],'paused':_0x2bee22['paused'],'waiting':_0x2bee22['waiting']};_0x4a103a[_0x9c32('0x21')](_0x3b1ba3);}}_0x1e98a9({'count':_0x4a103a[_0x9c32('0x19')],'rows':_0x4a103a});});},'MailQueues':function(_0x4347f7){return new Promise(function(_0x44399f,_0x4efee1){var _0x42e651=[];for(var _0xa3d71b in _0x27b7f5[_0x9c32('0x49')]){if(_0x27b7f5[_0x9c32('0x49')][_0x9c32('0x41')](_0xa3d71b)){var _0x24e710=_0x27b7f5['mailQueues'][_0xa3d71b];var _0x5c4101={'id':_0x24e710['id'],'available':_0x24e710[_0x9c32('0x47')],'loggedIn':_0x24e710[_0x9c32('0x4a')],'name':_0x24e710[_0x9c32('0x48')],'paused':_0x24e710[_0x9c32('0x4b')],'waiting':_0x24e710['waiting']};_0x42e651[_0x9c32('0x21')](_0x5c4101);}}_0x44399f({'count':_0x42e651[_0x9c32('0x19')],'rows':_0x42e651});});},'OpenchannelQueues':function(_0x52b05a){return new Promise(function(_0x102d95,_0x1ac7de){var _0xaae49d=[];for(var _0x28a5e3 in _0x27b7f5[_0x9c32('0x4c')]){if(_0x27b7f5['openchannelQueues'][_0x9c32('0x41')](_0x28a5e3)){var _0x47af34=_0x27b7f5[_0x9c32('0x4c')][_0x28a5e3];var _0x34954a={'id':_0x47af34['id'],'available':_0x47af34['available'],'loggedIn':_0x47af34['loggedIn'],'name':_0x47af34[_0x9c32('0x48')],'paused':_0x47af34[_0x9c32('0x4b')],'waiting':_0x47af34[_0x9c32('0x4d')]};_0xaae49d[_0x9c32('0x21')](_0x34954a);}}_0x102d95({'count':_0xaae49d[_0x9c32('0x19')],'rows':_0xaae49d});});},'SmsQueues':function(_0x607c52){return new Promise(function(_0x4d63ed,_0x542df2){var _0xb631e4=[];for(var _0x2e0742 in _0x27b7f5[_0x9c32('0x4e')]){if(_0x27b7f5['smsQueues'][_0x9c32('0x41')](_0x2e0742)){var _0x5aab00=_0x27b7f5['smsQueues'][_0x2e0742];var _0x5f1443={'id':_0x5aab00['id'],'available':_0x5aab00[_0x9c32('0x47')],'loggedIn':_0x5aab00['loggedIn'],'name':_0x5aab00[_0x9c32('0x48')],'paused':_0x5aab00['paused'],'waiting':_0x5aab00['waiting']};_0xb631e4[_0x9c32('0x21')](_0x5f1443);}}_0x4d63ed({'count':_0xb631e4[_0x9c32('0x19')],'rows':_0xb631e4});});},'FaxQueues':function(_0x4a8063){return new Promise(function(_0x13cc2f,_0x46f7e0){var _0x2958d=[];for(var _0x2d4f1d in _0x27b7f5['faxQueues']){if(_0x27b7f5['faxQueues'][_0x9c32('0x41')](_0x2d4f1d)){var _0x27e945=_0x27b7f5[_0x9c32('0x4f')][_0x2d4f1d];var _0x13bd22={'id':_0x27e945['id'],'available':_0x27e945[_0x9c32('0x47')],'loggedIn':_0x27e945['loggedIn'],'name':_0x27e945[_0x9c32('0x48')],'paused':_0x27e945[_0x9c32('0x4b')],'waiting':_0x27e945[_0x9c32('0x4d')]};_0x2958d[_0x9c32('0x21')](_0x13bd22);}}_0x13cc2f({'count':_0x2958d['length'],'rows':_0x2958d});});},'WhatsappQueues':function(_0x565242){return new Promise(function(_0x248663,_0x146918){var _0x5b1a88=[];for(var _0x4fd6ac in _0x27b7f5[_0x9c32('0x50')]){if(_0x27b7f5[_0x9c32('0x50')][_0x9c32('0x41')](_0x4fd6ac)){var _0x2b5984=_0x27b7f5[_0x9c32('0x50')][_0x4fd6ac];var _0x1dc0d4={'id':_0x2b5984['id'],'available':_0x2b5984[_0x9c32('0x47')],'loggedIn':_0x2b5984[_0x9c32('0x4a')],'name':_0x2b5984[_0x9c32('0x48')],'paused':_0x2b5984['paused'],'waiting':_0x2b5984[_0x9c32('0x4d')]};_0x5b1a88[_0x9c32('0x21')](_0x1dc0d4);}}_0x248663({'count':_0x5b1a88[_0x9c32('0x19')],'rows':_0x5b1a88});});},'ChatQueuesWaitingInteractions':function(_0xd626fd){return new Promise(function(_0x31b459,_0x3d0042){var _0xd07ea1=_[_0x9c32('0x51')](_0x27b7f5[_0x9c32('0x52')]);_0x31b459({'count':_0xd07ea1['length'],'rows':_0xd07ea1});});},'MailQueuesWaitingInteractions':function(_0xa2daa3){return new Promise(function(_0x2b61fa,_0x2fc86e){var _0xa32fa=_[_0x9c32('0x51')](_0x27b7f5[_0x9c32('0x53')]);_0x2b61fa({'count':_0xa32fa[_0x9c32('0x19')],'rows':_0xa32fa});});},'OpenchannelQueuesWaitingInteractions':function(_0x497fc4){return new Promise(function(_0x40785e,_0x2dbfa8){var _0xdbeff3=_[_0x9c32('0x51')](_0x27b7f5['openchannelQueuesWaitingInteractions']);_0x40785e({'count':_0xdbeff3[_0x9c32('0x19')],'rows':_0xdbeff3});});},'SmsQueuesWaitingInteractions':function(_0x273650){return new Promise(function(_0x29a20e,_0x221f6b){var _0x57a62c=_[_0x9c32('0x51')](_0x27b7f5[_0x9c32('0x54')]);_0x29a20e({'count':_0x57a62c[_0x9c32('0x19')],'rows':_0x57a62c});});},'FaxQueuesWaitingInteractions':function(_0x57e3d9){return new Promise(function(_0x33b644,_0x3db205){var _0x496182=_['values'](_0x27b7f5[_0x9c32('0x55')]);_0x33b644({'count':_0x496182[_0x9c32('0x19')],'rows':_0x496182});});},'WhatsappQueuesWaitingInteractions':function(_0x1cc4e6){return new Promise(function(_0xb04554,_0x5f0c5b){var _0xf9197d=_[_0x9c32('0x51')](_0x27b7f5[_0x9c32('0x56')]);_0xb04554({'count':_0xf9197d['length'],'rows':_0xf9197d});});}};var _0x14e474=jayson[_0x9c32('0x57')](_0x192da1)[_0x9c32('0x58')]();_0x14e474['on'](_0x9c32('0x2e'),function(_0x1ea243){logger[_0x9c32('0x2e')](JSON[_0x9c32('0x59')](_0x1ea243));return _0x3f5986(_0x1ea243);});_0x14e474['listen'](0x232c,'127.0.0.1',function(){console['log'](_0x9c32('0x5a'),0x232c);return _0xd773fa(_0x9c32('0x5b')+0x232c);});});}; \ No newline at end of file +var _0x8109=['length','join','app','.js','autoreply','split','channel','mail','push','slice','appdata','dialogflowv2','amazonlex','TagId','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','complete','stack','agent','agents','busy','emit','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busyQueue','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','waiting','mailQueues','openchannelQueues','paused','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','path','jayson/promise','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','message','interaction','applications','isArray'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x8109,0xa9));var _0x9810=function(_0xecc3e8,_0x459433){_0xecc3e8=_0xecc3e8-0x0;var _0x5c236c=_0x8109[_0xecc3e8];return _0x5c236c;};'use strict';var _=require(_0x9810('0x0'));var util=require('util');var path=require(_0x9810('0x1'));var fs=require('fs');var jayson=require(_0x9810('0x2'));var BPromise=require('bluebird');var uuid=require(_0x9810('0x3'));var config=require(_0x9810('0x4'));var logger=require(_0x9810('0x5'))(_0x9810('0x6'));var rpc={'openchannelQueueReport':require(_0x9810('0x7')),'mailQueueReport':require(_0x9810('0x8')),'chatQueueReport':require(_0x9810('0x9')),'smsQueueReport':require(_0x9810('0xa')),'faxQueueReport':require(_0x9810('0xb')),'whatsappQueueReport':require(_0x9810('0xc'))};var RuleEngine=require(_0x9810('0xd'));function getId(_0x5e367b,_0x3b0e0d,_0xafe932){return util[_0x9810('0xe')](_0x9810('0xf'),_0x5e367b,_0x3b0e0d||0x0,_0xafe932||0x0);}function getIntervals(_0xd9e6d,_0x57707e){var _0x3d2f90=[];if(!_[_0x9810('0x10')](_0x57707e[_0x9810('0x11')])&&!_['isNil'](_0xd9e6d[_0x57707e[_0x9810('0x11')]])&&!_['isNil'](_0xd9e6d[_0x57707e['IntervalId']][_0x9810('0x12')])){_0x3d2f90=_[_0x9810('0x13')](_0xd9e6d[_0x57707e[_0x9810('0x11')]][_0x9810('0x12')],_0x9810('0x14'));}else if(!_[_0x9810('0x10')](_0x57707e['interval'])){_0x3d2f90=[_0x57707e[_0x9810('0x14')]];}return _0x3d2f90;}exports[_0x9810('0x15')]=function(_0x3c74b0){_0x3c74b0[_0x9810('0x16')]={};return new BPromise(function(_0x2d52b1,_0x333ad4){var _0x22366c={'Start':function(_0x5c39eb){var _0x3796e2=this;return new Promise(function(_0x1a4735,_0xd6188c){if(_0x5c39eb){try{var _0x260be2=[];var _0x59d8e0=getId(_0x5c39eb['channel'],_0x5c39eb[_0x9810('0x17')]?_0x5c39eb['message']['id']:0x0,_0x5c39eb['interaction']?_0x5c39eb[_0x9810('0x18')]['id']:0x0);if(_0x5c39eb[_0x9810('0x19')]&&_[_0x9810('0x1a')](_0x5c39eb[_0x9810('0x19')])&&_0x5c39eb[_0x9810('0x19')][_0x9810('0x1b')]){for(var _0x5c4a9b=0x0;_0x5c4a9b<_0x5c39eb['applications']['length'];_0x5c4a9b+=0x1){var _0x3e5fac=_0x5c39eb[_0x9810('0x19')][_0x5c4a9b];if(fs['existsSync'](path[_0x9810('0x1c')](__dirname,_0x9810('0x19'),_0x3e5fac[_0x9810('0x1d')]+_0x9810('0x1e')))){var _0x1ba97a=[];switch(_0x3e5fac[_0x9810('0x1d')]['toLowerCase']()){case _0x9810('0x1f'):var _0x164c42=_0x3e5fac['appdata'][_0x9810('0x20')](',');if(_0x5c39eb[_0x9810('0x21')]===_0x9810('0x22')){_0x1ba97a['push'](_0x164c42[0x0]);_0x1ba97a[_0x9810('0x23')](_0x164c42[0x1]);_0x1ba97a['push'](_0x164c42[_0x9810('0x24')](0x2,_0x164c42['length'])[_0x9810('0x1c')](','));}else{_0x1ba97a[_0x9810('0x23')](_0x164c42[0x0]);_0x1ba97a[_0x9810('0x23')](_0x164c42[_0x9810('0x24')](0x1,_0x164c42['length'])['join'](','));}break;case'dialogflow':var _0x137b47=_0x3e5fac[_0x9810('0x25')]['split'](',');_0x1ba97a[_0x9810('0x23')](_0x137b47[0x0]);_0x1ba97a['push'](_0x137b47[0x1]);_0x1ba97a['push'](_0x137b47[_0x9810('0x24')](0x2,_0x137b47[_0x9810('0x1b')])[_0x9810('0x1c')](','));break;case _0x9810('0x26'):var _0x17f314=_0x3e5fac[_0x9810('0x25')]['split'](',');_0x1ba97a[_0x9810('0x23')](_0x17f314[0x0]);_0x1ba97a[_0x9810('0x23')](_0x17f314[0x1]);_0x1ba97a[_0x9810('0x23')](_0x17f314[0x2]);_0x1ba97a['push'](_0x17f314[0x3]);_0x1ba97a[_0x9810('0x23')](_0x17f314['slice'](0x4,_0x17f314[_0x9810('0x1b')])['join'](','));break;case _0x9810('0x27'):var _0x167058=_0x3e5fac[_0x9810('0x25')][_0x9810('0x20')](',');_0x1ba97a[_0x9810('0x23')](_0x167058[0x0]);_0x1ba97a[_0x9810('0x23')](_0x167058[0x1]);_0x1ba97a['push'](_0x167058[0x2]);_0x1ba97a[_0x9810('0x23')](_0x167058[0x3]);_0x1ba97a[_0x9810('0x23')](_0x167058[_0x9810('0x24')](0x4,_0x167058[_0x9810('0x1b')])['join'](','));break;case'message':_0x1ba97a['push'](_0x3e5fac['appdata']);break;case'tag':_0x1ba97a['push'](_0x3e5fac[_0x9810('0x28')]);_0x1ba97a[_0x9810('0x23')](_0x3e5fac[_0x9810('0x25')]);break;default:_0x1ba97a=_[_0x9810('0x10')](_0x3e5fac[_0x9810('0x25')])?[]:_0x3e5fac['appdata'][_0x9810('0x20')](',');}var _0x51effd={'id':util[_0x9810('0xe')](_0x9810('0x29'),_0x59d8e0,_0x3e5fac['id'],_0x3e5fac['app']),'condition':require(_0x9810('0x2a'))[_0x9810('0x2b')](_0x59d8e0,getIntervals(_0x3c74b0[_0x9810('0x2c')],_0x3e5fac),_0x3c74b0),'consequence':require(_0x9810('0x2d')+_0x3e5fac[_0x9810('0x1d')])[_0x9810('0x2e')](_0x59d8e0,_0x1ba97a,_0x3c74b0,_0x5c39eb),'p':_0x3e5fac[_0x9810('0x2f')]||0x0};logger[_0x9810('0x30')](_0x9810('0x31'),_0x51effd['id'],'on\x20interval',getIntervals(_0x3c74b0[_0x9810('0x2c')],_0x3e5fac)[_0x9810('0x1c')]('\x20|\x20'));_0x260be2[_0x9810('0x23')](_0x51effd);}else{logger[_0x9810('0x32')](_0x9810('0x33'),path[_0x9810('0x1c')](__dirname,_0x9810('0x19'),_0x3e5fac['app']+_0x9810('0x1e')));}}_0x3c74b0[_0x9810('0x16')][_0x59d8e0]=new RuleEngine(_0x260be2);_0x3c74b0[_0x9810('0x16')][_0x59d8e0][_0x9810('0x34')](_0x5c39eb,function(_0x1ca47b){logger[_0x9810('0x30')](_0x9810('0x35'),JSON[_0x9810('0x36')](_0x1ca47b[_0x9810('0x37')]));if(_0x3c74b0[_0x9810('0x16')][_0x59d8e0]){_0x3c74b0[_0x9810('0x16')][_0x59d8e0]['emit'](_0x9810('0x38'));}});return _0x1a4735({'code':0xc8,'message':_0x5c39eb});}else{logger[_0x9810('0x30')]('No\x20applications\x20to\x20execute');return _0x1a4735({'code':0xc8,'message':_0x5c39eb});}}catch(_0x4afdd8){logger[_0x9810('0x32')](_0x4afdd8[_0x9810('0x39')]);return _0xd6188c(_0x3796e2[_0x9810('0x32')](0x1f4,_0x4afdd8));}}return _0xd6188c('routing\x20is\x20empty');});},'AcceptMessage':function(_0x132309){var _0x1b5989=this;return new Promise(function(_0xf4541a,_0x43640){if(_0x132309[_0x9810('0x3a')]&&_0x132309[_0x9810('0x3a')]['id']){if(_0x3c74b0[_0x9810('0x3b')][_0x132309[_0x9810('0x3a')]['id']]){_0x3c74b0[_0x9810('0x3b')][_0x132309[_0x9810('0x3a')]['id']][_0x9810('0x3c')]=![];_0x3c74b0[_0x9810('0x3b')][_0x132309['agent']['id']]['busyQueue']=undefined;}}if(_0x132309[_0x9810('0x17')]&&_0x132309[_0x9810('0x17')]['id']){try{var _0x359865=getId(_0x132309[_0x9810('0x21')],_0x132309[_0x9810('0x17')]?_0x132309['message']['id']:0x0,_0x132309[_0x9810('0x18')]?_0x132309[_0x9810('0x18')]['id']:0x0);if(_0x3c74b0['rules'][_0x359865]){_0x3c74b0[_0x9810('0x16')][_0x359865][_0x9810('0x3d')](_0x9810('0x3e'));if(rpc[_0x132309[_0x9810('0x21')]+_0x9810('0x3f')]){rpc[_0x132309[_0x9810('0x21')]+_0x9810('0x3f')][_0x9810('0x40')](_0x359865,{'UserId':_0x132309[_0x9810('0x17')][_0x9810('0x41')]})[_0x9810('0x42')](function(_0x99ec07){logger[_0x9810('0x32')](_0x9810('0x43'));});}}return _0xf4541a({'code':0xc8,'message':_0x132309});}catch(_0x781a8b){logger[_0x9810('0x32')](_0x781a8b[_0x9810('0x39')]);return _0x43640(_0x1b5989[_0x9810('0x32')](0x1f4,_0x781a8b));}}logger[_0x9810('0x32')]('message\x20is\x20empty');return _0x43640(_0x1b5989[_0x9810('0x32')](0x1f4,_0x9810('0x44')));});},'RejectMessage':function(_0x2fd6ea){var _0x42db0a=this;return new Promise(function(_0x3c8ef2,_0x283630){if(_0x2fd6ea[_0x9810('0x3a')]&&_0x2fd6ea[_0x9810('0x3a')]['id']){try{if(_0x3c74b0[_0x9810('0x3b')][_0x2fd6ea[_0x9810('0x3a')]['id']]){_0x3c74b0[_0x9810('0x3b')][_0x2fd6ea[_0x9810('0x3a')]['id']][_0x9810('0x3c')]=![];_0x3c74b0[_0x9810('0x3b')][_0x2fd6ea[_0x9810('0x3a')]['id']][_0x9810('0x45')]=undefined;}return _0x3c8ef2({'code':0xc8,'message':_0x2fd6ea});}catch(_0xb2ffc7){logger[_0x9810('0x32')](_0xb2ffc7['stack']);return _0x283630(_0x42db0a[_0x9810('0x32')](0x1f4,_0xb2ffc7));}}logger[_0x9810('0x32')](_0x9810('0x44'));return _0x283630(_0x42db0a[_0x9810('0x32')](0x1f4,_0x9810('0x44')));});},'AbandonInteraction':function(_0x56b8a3){var _0x2061bc=this;return new Promise(function(_0x2184f8,_0x2b7e10){if(_0x56b8a3[_0x9810('0x21')]&&_0x56b8a3['interaction']&&_0x56b8a3[_0x9810('0x18')]['id']){try{var _0x1151c2=getId(_0x56b8a3[_0x9810('0x21')],_0x56b8a3['message']?_0x56b8a3['message']['id']:0x0,_0x56b8a3[_0x9810('0x18')]?_0x56b8a3[_0x9810('0x18')]['id']:0x0);if(_0x3c74b0[_0x9810('0x16')][_0x1151c2]){_0x3c74b0[_0x9810('0x16')][_0x1151c2][_0x9810('0x3d')](_0x9810('0x3e'));}return _0x2184f8({'code':0xc8,'message':_0x56b8a3});}catch(_0x442f14){logger[_0x9810('0x32')](_0x442f14['stack']);return _0x2b7e10(_0x2061bc[_0x9810('0x32')](0x1f4,_0x442f14));}}logger[_0x9810('0x32')](_0x9810('0x44'));return _0x2b7e10(_0x2061bc['error'](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x586864){var _0x556085=this;return new Promise(function(_0x3b9518,_0x1a59c0){if(_0x3c74b0[_0x9810('0x3b')]['hasOwnProperty'](_0x586864['id'])){for(var _0x4d5c8f in _0x586864[_0x9810('0x46')]){if(_0x586864[_0x9810('0x46')][_0x9810('0x47')](_0x4d5c8f)){if(_0x3c74b0[_0x9810('0x3b')][_0x586864['id']]['hasOwnProperty'](_0x4d5c8f+'CurrentCapacity')){_0x3c74b0['agents'][_0x586864['id']][_0x4d5c8f+_0x9810('0x48')]=parseInt(_0x586864[_0x9810('0x46')][_0x4d5c8f],0xa);}}}_0x3c74b0['agents'][_0x586864['id']][_0x9810('0x49')]();return _0x3b9518({'code':0xc8,'message':_0x3c74b0[_0x9810('0x3b')][_0x586864['id']]});}else{return _0x1a59c0(_0x556085[_0x9810('0x32')](0x1f4,_0x9810('0x4a')));}});},'Agents':function(_0xfe18ab){return new Promise(function(_0x5b3f37,_0xa1b3a2){var _0x36fc91=_[_0x9810('0x4b')](_0x3c74b0[_0x9810('0x3b')]);_0x5b3f37({'count':_0x36fc91[_0x9810('0x1b')],'rows':_0x36fc91});});},'ChatQueues':function(_0x232891){return new Promise(function(_0xdfa02,_0x1c3d70){var _0x5ceac9=[];for(var _0x3fd52b in _0x3c74b0[_0x9810('0x4c')]){if(_0x3c74b0[_0x9810('0x4c')]['hasOwnProperty'](_0x3fd52b)){var _0x3772d4=_0x3c74b0[_0x9810('0x4c')][_0x3fd52b];var _0x11e3d0={'id':_0x3772d4['id'],'available':_0x3772d4[_0x9810('0x4d')],'loggedIn':_0x3772d4[_0x9810('0x4e')],'name':_0x3772d4[_0x9810('0x4f')],'paused':_0x3772d4['paused'],'waiting':_0x3772d4[_0x9810('0x50')]};_0x5ceac9[_0x9810('0x23')](_0x11e3d0);}}_0xdfa02({'count':_0x5ceac9[_0x9810('0x1b')],'rows':_0x5ceac9});});},'MailQueues':function(_0x2dbd93){return new Promise(function(_0x4a4808,_0x304516){var _0x588fba=[];for(var _0x1757b3 in _0x3c74b0[_0x9810('0x51')]){if(_0x3c74b0[_0x9810('0x51')][_0x9810('0x47')](_0x1757b3)){var _0x1d5786=_0x3c74b0[_0x9810('0x51')][_0x1757b3];var _0x2c053e={'id':_0x1d5786['id'],'available':_0x1d5786[_0x9810('0x4d')],'loggedIn':_0x1d5786[_0x9810('0x4e')],'name':_0x1d5786[_0x9810('0x4f')],'paused':_0x1d5786['paused'],'waiting':_0x1d5786[_0x9810('0x50')]};_0x588fba['push'](_0x2c053e);}}_0x4a4808({'count':_0x588fba[_0x9810('0x1b')],'rows':_0x588fba});});},'OpenchannelQueues':function(_0x542f07){return new Promise(function(_0x326c23,_0x4804fd){var _0x132617=[];for(var _0x4d3920 in _0x3c74b0[_0x9810('0x52')]){if(_0x3c74b0['openchannelQueues'][_0x9810('0x47')](_0x4d3920)){var _0x1dca5b=_0x3c74b0[_0x9810('0x52')][_0x4d3920];var _0x2fd327={'id':_0x1dca5b['id'],'available':_0x1dca5b[_0x9810('0x4d')],'loggedIn':_0x1dca5b['loggedIn'],'name':_0x1dca5b[_0x9810('0x4f')],'paused':_0x1dca5b[_0x9810('0x53')],'waiting':_0x1dca5b[_0x9810('0x50')]};_0x132617['push'](_0x2fd327);}}_0x326c23({'count':_0x132617['length'],'rows':_0x132617});});},'SmsQueues':function(_0x2877ba){return new Promise(function(_0x231c1f,_0x54a368){var _0x3a9aae=[];for(var _0x44f1b1 in _0x3c74b0['smsQueues']){if(_0x3c74b0[_0x9810('0x54')][_0x9810('0x47')](_0x44f1b1)){var _0x21e983=_0x3c74b0[_0x9810('0x54')][_0x44f1b1];var _0x30016b={'id':_0x21e983['id'],'available':_0x21e983[_0x9810('0x4d')],'loggedIn':_0x21e983['loggedIn'],'name':_0x21e983[_0x9810('0x4f')],'paused':_0x21e983['paused'],'waiting':_0x21e983[_0x9810('0x50')]};_0x3a9aae[_0x9810('0x23')](_0x30016b);}}_0x231c1f({'count':_0x3a9aae[_0x9810('0x1b')],'rows':_0x3a9aae});});},'FaxQueues':function(_0x134fb8){return new Promise(function(_0x49867f,_0x17a3e6){var _0x54f9eb=[];for(var _0x1eba47 in _0x3c74b0[_0x9810('0x55')]){if(_0x3c74b0[_0x9810('0x55')][_0x9810('0x47')](_0x1eba47)){var _0x337b50=_0x3c74b0[_0x9810('0x55')][_0x1eba47];var _0x130b0f={'id':_0x337b50['id'],'available':_0x337b50['available'],'loggedIn':_0x337b50['loggedIn'],'name':_0x337b50[_0x9810('0x4f')],'paused':_0x337b50['paused'],'waiting':_0x337b50[_0x9810('0x50')]};_0x54f9eb['push'](_0x130b0f);}}_0x49867f({'count':_0x54f9eb['length'],'rows':_0x54f9eb});});},'WhatsappQueues':function(_0x57a2fd){return new Promise(function(_0x2da6d7,_0x4b76be){var _0xa50ad=[];for(var _0x4f9478 in _0x3c74b0[_0x9810('0x56')]){if(_0x3c74b0[_0x9810('0x56')][_0x9810('0x47')](_0x4f9478)){var _0x58c08a=_0x3c74b0[_0x9810('0x56')][_0x4f9478];var _0x5d9b0d={'id':_0x58c08a['id'],'available':_0x58c08a[_0x9810('0x4d')],'loggedIn':_0x58c08a['loggedIn'],'name':_0x58c08a[_0x9810('0x4f')],'paused':_0x58c08a['paused'],'waiting':_0x58c08a[_0x9810('0x50')]};_0xa50ad['push'](_0x5d9b0d);}}_0x2da6d7({'count':_0xa50ad['length'],'rows':_0xa50ad});});},'ChatQueuesWaitingInteractions':function(_0x39e363){return new Promise(function(_0x3ad0f4,_0x1f953f){var _0x474800=_['values'](_0x3c74b0[_0x9810('0x57')]);_0x3ad0f4({'count':_0x474800[_0x9810('0x1b')],'rows':_0x474800});});},'MailQueuesWaitingInteractions':function(_0x280ef8){return new Promise(function(_0x33ce7d,_0x21894b){var _0x25766b=_[_0x9810('0x4b')](_0x3c74b0[_0x9810('0x58')]);_0x33ce7d({'count':_0x25766b[_0x9810('0x1b')],'rows':_0x25766b});});},'OpenchannelQueuesWaitingInteractions':function(_0x20e3a6){return new Promise(function(_0x264d17,_0x3433a4){var _0x25e422=_[_0x9810('0x4b')](_0x3c74b0[_0x9810('0x59')]);_0x264d17({'count':_0x25e422[_0x9810('0x1b')],'rows':_0x25e422});});},'SmsQueuesWaitingInteractions':function(_0x114fcb){return new Promise(function(_0x33eda4,_0x4575ba){var _0x2320ec=_[_0x9810('0x4b')](_0x3c74b0[_0x9810('0x5a')]);_0x33eda4({'count':_0x2320ec['length'],'rows':_0x2320ec});});},'FaxQueuesWaitingInteractions':function(_0x44c600){return new Promise(function(_0x39cf53,_0x2d5642){var _0x5d6c4b=_['values'](_0x3c74b0[_0x9810('0x5b')]);_0x39cf53({'count':_0x5d6c4b[_0x9810('0x1b')],'rows':_0x5d6c4b});});},'WhatsappQueuesWaitingInteractions':function(_0xcee5ab){return new Promise(function(_0x2fc42c,_0x589aac){var _0x46b7ce=_[_0x9810('0x4b')](_0x3c74b0[_0x9810('0x5c')]);_0x2fc42c({'count':_0x46b7ce['length'],'rows':_0x46b7ce});});}};var _0x48f6e3=jayson[_0x9810('0x5d')](_0x22366c)[_0x9810('0x5e')]();_0x48f6e3['on'](_0x9810('0x32'),function(_0x40d6c5){logger[_0x9810('0x32')](JSON[_0x9810('0x36')](_0x40d6c5));return _0x333ad4(_0x40d6c5);});_0x48f6e3[_0x9810('0x15')](0x232c,'127.0.0.1',function(){console[_0x9810('0x5f')](_0x9810('0x60'),0x232c);return _0x2d52b1(_0x9810('0x61')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 5ce59a7..2c0e3af 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 _0xbd20=['jayson/promise','lodash','client','http','request','then','error','message','result','condition','info','stop','length','push','Command','format','indexOf','true','catch','[%s][INTERVAL]\x20%s','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','util','bluebird'];(function(_0x517fa8,_0x55f43a){var _0x4aab3b=function(_0xf6693){while(--_0xf6693){_0x517fa8['push'](_0x517fa8['shift']());}};_0x4aab3b(++_0x55f43a);}(_0xbd20,0xce));var _0x0bd2=function(_0x90b1b1,_0x3c996d){_0x90b1b1=_0x90b1b1-0x0;var _0x2f23dc=_0xbd20[_0x90b1b1];return _0x2f23dc;};'use strict';var util=require(_0x0bd2('0x0'));var BPromise=require(_0x0bd2('0x1'));var jayson=require(_0x0bd2('0x2'));var _=require(_0x0bd2('0x3'));var logger=require('../../../config/logger')('routing');var client=jayson[_0x0bd2('0x4')][_0x0bd2('0x5')]({'port':0x232a});function request(_0x201cec,_0x3da63f){return new BPromise(function(_0x3bc49a,_0x4d94a0){return client[_0x0bd2('0x6')](_0x201cec,_0x3da63f)[_0x0bd2('0x7')](function(_0x349884){if(_0x349884[_0x0bd2('0x8')]){return _0x4d94a0(_0x349884[_0x0bd2('0x8')][_0x0bd2('0x9')]);}else{return _0x3bc49a(_0x349884[_0x0bd2('0xa')]);}})['catch'](function(_0x413c79){return _0x4d94a0(_0x413c79);});});}exports[_0x0bd2('0xb')]=function(_0x47fabe,_0x413609,_0x14217d){return function(_0xe8d6e3){if(_0x14217d['rules']&&!_0x14217d['rules'][_0x47fabe]){logger[_0x0bd2('0xc')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x47fabe);return _0xe8d6e3[_0x0bd2('0xd')]();}var _0x51058a=[];for(var _0x1a2222=0x0;_0x1a2222<_0x413609[_0x0bd2('0xe')];_0x1a2222+=0x1){_0x51058a[_0x0bd2('0xf')](request(_0x0bd2('0x10'),{'command':util[_0x0bd2('0x11')]('iftime\x20%s',_0x413609[_0x1a2222])})[_0x0bd2('0x7')](function(_0x64ab26){return _0x64ab26&&_0x64ab26['message']&&_0x64ab26[_0x0bd2('0x9')][_0x0bd2('0x12')](_0x0bd2('0x13'))>=0x0?!![]:![];})[_0x0bd2('0x14')](function(_0x40a18a){logger[_0x0bd2('0x8')](_0x0bd2('0x15'),_0x47fabe,_0x413609[_0x1a2222]);}));}BPromise['all'](_0x51058a)[_0x0bd2('0x7')](function(_0x2af695){var _0x305b99=_['some'](_0x2af695);logger[_0x0bd2('0xc')](_0x0bd2('0x16'),_0x47fabe,_0x413609[_0x0bd2('0x17')](_0x0bd2('0x18')),_0x305b99);_0xe8d6e3[_0x0bd2('0x19')](_0x305b99);})[_0x0bd2('0x14')](function(_0x22a91e){console['log'](_0x22a91e);logger[_0x0bd2('0x8')](_0x0bd2('0x16'),_0x47fabe,_0x413609[_0x0bd2('0x17')](_0x0bd2('0x18')),_0x22a91e['stack']);_0xe8d6e3[_0x0bd2('0xd')]();});};}; \ No newline at end of file +var _0x9c51=['info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','push','format','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','stop','util','bluebird','jayson/promise','../../../config/logger','routing','http','request','then','error','message','result','catch','condition','rules'];(function(_0x40c118,_0x1c7114){var _0x7c7f1e=function(_0x4be17b){while(--_0x4be17b){_0x40c118['push'](_0x40c118['shift']());}};_0x7c7f1e(++_0x1c7114);}(_0x9c51,0xf2));var _0x19c5=function(_0x12447c,_0x136527){_0x12447c=_0x12447c-0x0;var _0x4a3ae8=_0x9c51[_0x12447c];return _0x4a3ae8;};'use strict';var util=require(_0x19c5('0x0'));var BPromise=require(_0x19c5('0x1'));var jayson=require(_0x19c5('0x2'));var _=require('lodash');var logger=require(_0x19c5('0x3'))(_0x19c5('0x4'));var client=jayson['client'][_0x19c5('0x5')]({'port':0x232a});function request(_0x13cb18,_0x6900db){return new BPromise(function(_0x195997,_0x54003b){return client[_0x19c5('0x6')](_0x13cb18,_0x6900db)[_0x19c5('0x7')](function(_0x24fead){if(_0x24fead[_0x19c5('0x8')]){return _0x54003b(_0x24fead[_0x19c5('0x8')][_0x19c5('0x9')]);}else{return _0x195997(_0x24fead[_0x19c5('0xa')]);}})[_0x19c5('0xb')](function(_0x281340){return _0x54003b(_0x281340);});});}exports[_0x19c5('0xc')]=function(_0x412ecb,_0x32fd53,_0x75dfef){return function(_0x3da8a4){if(_0x75dfef[_0x19c5('0xd')]&&!_0x75dfef[_0x19c5('0xd')][_0x412ecb]){logger[_0x19c5('0xe')](_0x19c5('0xf'),_0x412ecb);return _0x3da8a4['stop']();}var _0x4ef586=[];for(var _0x1d400f=0x0;_0x1d400f<_0x32fd53[_0x19c5('0x10')];_0x1d400f+=0x1){_0x4ef586[_0x19c5('0x11')](request('Command',{'command':util[_0x19c5('0x12')](_0x19c5('0x13'),_0x32fd53[_0x1d400f])})['then'](function(_0x49992c){return _0x49992c&&_0x49992c['message']&&_0x49992c['message'][_0x19c5('0x14')](_0x19c5('0x15'))>=0x0?!![]:![];})['catch'](function(_0xcfb091){logger['error'](_0x19c5('0x16'),_0x412ecb,_0x32fd53[_0x1d400f]);}));}BPromise[_0x19c5('0x17')](_0x4ef586)[_0x19c5('0x7')](function(_0x142e99){var _0x4d7811=_[_0x19c5('0x18')](_0x142e99);logger['info'](_0x19c5('0x19'),_0x412ecb,_0x32fd53[_0x19c5('0x1a')](_0x19c5('0x1b')),_0x4d7811);_0x3da8a4[_0x19c5('0x1c')](_0x4d7811);})[_0x19c5('0xb')](function(_0x10a07a){console[_0x19c5('0x1d')](_0x10a07a);logger['error'](_0x19c5('0x19'),_0x412ecb,_0x32fd53[_0x19c5('0x1a')](_0x19c5('0x1b')),_0x10a07a[_0x19c5('0x1e')]);_0x3da8a4[_0x19c5('0x1f')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index b5dc299..b4e255e 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 _0xf45e=['secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfererexten','transferuniqueid','transfereeuniqueid','clone','calleridname','agentcalledAt','ATTENDED','transfertargetuniqueid','agententerreason','hangup','[%s][agents][hangup]','cause','rejected','indexOf','splice','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentcomplete','acw','acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentcalled]','agentringnoanswer','debug','[%s][agents][agentringnoanswer]','agentringnoanswerAt','timeout','ringtime','includes','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','holdtime','talktime','agentconnect','[%s][agents][agentconnect]','agentconnectAt','now','connectedlinename','answered_elsewhere','reason','answeredelsewheremembername','isNil','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','blindtransfer','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','[%s][agents][blindtransfer]','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0xf45e,0x115));var _0xef45=function(_0x41543d,_0x24fb53){_0x41543d=_0x41543d-0x0;var _0x32c404=_0xf45e[_0x41543d];return _0x32c404;};'use strict';var _=require(_0xef45('0x0'));var util=require('util');var utils=require(_0xef45('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x5762da,_0x17b897){utils[_0xef45('0x2')](util[_0xef45('0x3')](_0xef45('0x4'),_0x5762da[_0xef45('0x5')],_0x5762da[_0xef45('0x6')],_0x5762da[_0xef45('0x7')],_0x5762da[_0xef45('0x8')],_0x5762da[_0xef45('0x9')],_0x5762da[_0xef45('0xa')],_0x5762da[_0xef45('0xb')],_0x5762da[_0xef45('0xc')]));if(_0x5762da[_0xef45('0x7')]){utils[_0xef45('0xd')](_0x5762da[_0xef45('0x7')])[_0xef45('0xe')](function(_0x134c86){if(_0x134c86){_0x5762da[_0xef45('0xf')]=_0x134c86[_0xef45('0xf')];_0x5762da['agentacw']=_0x5762da[_0xef45('0x10')]?_0x134c86[_0xef45('0x11')]:![];_0x5762da[_0xef45('0x12')]=_0x5762da[_0xef45('0x13')]?_0x134c86[_0xef45('0x14')]:0x0;}utils[_0xef45('0x15')]('CreateVoiceAgentReport',_0x5762da);});}else{utils[_0xef45('0x15')](_0xef45('0x16'),_0x5762da);}if(_0x17b897){delete transfers[_0x5762da[_0xef45('0x5')]];}else{delete agents[_0x5762da[_0xef45('0x17')]];}}exports[_0xef45('0x18')]=function(_0x4a6e5c){try{utils['debug'](util[_0xef45('0x3')]('[%s][agents][agentcalled]',_0x4a6e5c[_0xef45('0x5')]),_0x4a6e5c);agents[_0x4a6e5c[_0xef45('0x17')]]=_0x4a6e5c;agents[_0x4a6e5c[_0xef45('0x17')]]['agentcalledAt']=utils['now']();agents[_0x4a6e5c[_0xef45('0x17')]]['lastevent']=_0xef45('0x19');agents[_0x4a6e5c[_0xef45('0x17')]][_0xef45('0xb')]=null;agents[_0x4a6e5c[_0xef45('0x17')]]['connectedlinename']=null;utils['info'](util[_0xef45('0x3')](_0xef45('0x1a'),_0x4a6e5c[_0xef45('0x5')],agents[_0x4a6e5c[_0xef45('0x17')]]['membername'],_0x4a6e5c['destuniqueid']));}catch(_0x2c57fc){utils[_0xef45('0x1b')](util[_0xef45('0x3')](_0xef45('0x1c'),_0x4a6e5c[_0xef45('0x5')]),_0x2c57fc);}};exports[_0xef45('0x1d')]=function(_0x375cbd){try{if(!_['isNil'](agents[_0x375cbd[_0xef45('0x17')]])){utils[_0xef45('0x1e')](util[_0xef45('0x3')](_0xef45('0x1f'),_0x375cbd[_0xef45('0x5')]),_0x375cbd);utils['info'](util[_0xef45('0x3')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x375cbd['uniqueid'],agents[_0x375cbd[_0xef45('0x17')]][_0xef45('0x8')],_0x375cbd[_0xef45('0x17')]));agents[_0x375cbd[_0xef45('0x17')]][_0xef45('0x1d')]=!![];agents[_0x375cbd[_0xef45('0x17')]][_0xef45('0x20')]=utils['now']();agents[_0x375cbd[_0xef45('0x17')]]['lastevent']=_0xef45('0x21');agents[_0x375cbd[_0xef45('0x17')]]['reason']=_0xef45('0x21');agents[_0x375cbd[_0xef45('0x17')]]['holdtime']=_0x375cbd[_0xef45('0x22')]?parseInt(_0x375cbd['ringtime'])/0x3e8:0x0;agents[_0x375cbd['destuniqueid']]['talktime']=0x0;unanswered['push'](_0x375cbd[_0xef45('0x17')]);}}catch(_0x2f72ef){utils[_0xef45('0x1b')](util[_0xef45('0x3')]('[%s][agents][agentringnoanswer]',_0x375cbd[_0xef45('0x5')]),_0x2f72ef);}};exports['queuecallerabandon']=function(_0x2525da){try{_['forIn'](agents,function(_0x3e6922,_0x5bfd2d){if(_0x3e6922['uniqueid']==_0x2525da[_0xef45('0x5')]&&!_[_0xef45('0x23')](unanswered,_0x3e6922[_0xef45('0x17')])){utils[_0xef45('0x1e')](util[_0xef45('0x3')]('[%s][agents][queuecallerabandon]',_0x2525da['uniqueid']),_0x2525da);utils['info'](util[_0xef45('0x3')](_0xef45('0x24'),_0x2525da[_0xef45('0x5')],_0x3e6922[_0xef45('0x8')],_0x3e6922[_0xef45('0x17')]));_0x3e6922[_0xef45('0x1d')]=!![];_0x3e6922[_0xef45('0x20')]=utils['now']();_0x3e6922['lastevent']=_0xef45('0x25');_0x3e6922['reason']=_0xef45('0x25');_0x3e6922['holdtime']=_0x2525da[_0xef45('0x26')];_0x3e6922[_0xef45('0x27')]=0x0;writeDB(_0x3e6922);}});}catch(_0x2a7c53){utils[_0xef45('0x1b')](util[_0xef45('0x3')]('[%s][agents][queuecallerabandon]',_0x2525da[_0xef45('0x5')]),_0x2a7c53);}};exports[_0xef45('0x28')]=function(_0x9df07e){try{if(agents[_0x9df07e['destuniqueid']]){utils['debug'](util[_0xef45('0x3')](_0xef45('0x29'),_0x9df07e['uniqueid']),_0x9df07e);utils[_0xef45('0x2')](util['format']('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x9df07e[_0xef45('0x5')],agents[_0x9df07e[_0xef45('0x17')]][_0xef45('0x8')],_0x9df07e['destuniqueid']));agents[_0x9df07e[_0xef45('0x17')]][_0xef45('0x2a')]=utils[_0xef45('0x2b')]();agents[_0x9df07e[_0xef45('0x17')]]['connectedlinenum']=_0x9df07e['connectedlinenum'];agents[_0x9df07e[_0xef45('0x17')]][_0xef45('0x2c')]=_0x9df07e[_0xef45('0x2c')];agents[_0x9df07e[_0xef45('0x17')]][_0xef45('0x26')]=_0x9df07e[_0xef45('0x22')];agents[_0x9df07e[_0xef45('0x17')]][_0xef45('0xc')]='connect';_['forIn'](agents,function(_0x13f8b2,_0x35d014){if(_0x13f8b2[_0xef45('0x17')]!=_0x9df07e[_0xef45('0x17')]&&_0x13f8b2[_0xef45('0x5')]==_0x9df07e[_0xef45('0x5')]){_0x13f8b2[_0xef45('0x27')]=0x0;_0x13f8b2[_0xef45('0x26')]=_0x9df07e[_0xef45('0x22')];_0x13f8b2[_0xef45('0x1d')]=!![];_0x13f8b2[_0xef45('0x20')]=utils[_0xef45('0x2b')]();_0x13f8b2[_0xef45('0xc')]=_0xef45('0x2d');_0x13f8b2[_0xef45('0x2e')]=_0xef45('0x2d');_0x13f8b2['answeredelsewheredestinationuniqueid']=_0x9df07e[_0xef45('0x17')];_0x13f8b2[_0xef45('0x2f')]=_0x9df07e[_0xef45('0x8')];writeDB(_0x13f8b2);}});}}catch(_0x82c123){utils['error'](util[_0xef45('0x3')]('[%s][agents][agentconnect]',_0x9df07e[_0xef45('0x5')]),_0x82c123);}};exports['agentcomplete']=function(_0x5faf67){try{if(!_[_0xef45('0x30')](agents[_0x5faf67[_0xef45('0x17')]])){utils[_0xef45('0x1e')](util[_0xef45('0x3')](_0xef45('0x31'),_0x5faf67[_0xef45('0x5')]),_0x5faf67);utils['info'](util[_0xef45('0x3')](_0xef45('0x32'),_0x5faf67[_0xef45('0x5')],agents[_0x5faf67[_0xef45('0x17')]][_0xef45('0x8')],_0x5faf67[_0xef45('0x17')]));agents[_0x5faf67[_0xef45('0x17')]][_0xef45('0x10')]=!![];agents[_0x5faf67[_0xef45('0x17')]][_0xef45('0x33')]=utils[_0xef45('0x2b')]();agents[_0x5faf67[_0xef45('0x17')]][_0xef45('0x27')]=utils[_0xef45('0x34')](agents[_0x5faf67[_0xef45('0x17')]]['agentcompleteAt'],agents[_0x5faf67[_0xef45('0x17')]][_0xef45('0x2a')]);agents[_0x5faf67[_0xef45('0x17')]]['reason']=_0x5faf67['reason'];agents[_0x5faf67['destuniqueid']][_0xef45('0xc')]=_0xef45('0x35');writeDB(agents[_0x5faf67[_0xef45('0x17')]]);}}catch(_0x34e9d5){utils[_0xef45('0x1b')](util[_0xef45('0x3')]('[%s][agents][agentcomplete]',_0x5faf67[_0xef45('0x5')]),_0x34e9d5);}};exports[_0xef45('0x36')]=function(_0x2b2419){try{if(!_['isNil'](agents[_0x2b2419['transfereruniqueid']])){utils[_0xef45('0x1e')](util[_0xef45('0x3')]('[%s][agents][blindtransfer]',_0x2b2419[_0xef45('0x5')]),_0x2b2419);utils[_0xef45('0x2')](util[_0xef45('0x3')](_0xef45('0x37'),_0x2b2419[_0xef45('0x5')],agents[_0x2b2419[_0xef45('0x38')]][_0xef45('0x8')],agents[_0x2b2419[_0xef45('0x38')]][_0xef45('0x5')]));agents[_0x2b2419[_0xef45('0x38')]][_0xef45('0x39')]=!![];agents[_0x2b2419[_0xef45('0x38')]][_0xef45('0x3a')]=_0xef45('0x3b');agents[_0x2b2419['transfereruniqueid']][_0xef45('0x3c')]=_0x2b2419[_0xef45('0x3d')];agents[_0x2b2419[_0xef45('0x38')]]['transferuniqueid']=agents[_0x2b2419[_0xef45('0x38')]][_0xef45('0x5')];}}catch(_0x464bda){utils[_0xef45('0x1b')](util['format'](_0xef45('0x3e'),_0x2b2419[_0xef45('0x5')]),_0x464bda);}};exports[_0xef45('0x3f')]=function(_0x310105){try{utils[_0xef45('0x1e')](util[_0xef45('0x3')](_0xef45('0x40'),_0x310105[_0xef45('0x41')]),_0x310105);if(_0x310105[_0xef45('0x41')]==_0x310105[_0xef45('0x42')]){if(!_[_0xef45('0x30')](agents[_0x310105[_0xef45('0x43')]])){utils['info'](util[_0xef45('0x3')](_0xef45('0x44'),_0x310105[_0xef45('0x41')],agents[_0x310105[_0xef45('0x43')]][_0xef45('0x8')]));agents[_0x310105[_0xef45('0x43')]]['transfer']=!![];agents[_0x310105['secondtransfereruniqueid']][_0xef45('0x3a')]='ATTENDED';agents[_0x310105[_0xef45('0x43')]][_0xef45('0x3c')]=_0x310105[_0xef45('0x45')];agents[_0x310105['secondtransfereruniqueid']][_0xef45('0x46')]=_0x310105[_0xef45('0x41')];}if(_0x310105['transfereeuniqueid']&&agents[_0x310105[_0xef45('0x47')]]){agents[_0x310105['transfereeuniqueid']]['agententerreason']=0x1;transfers[_0x310105[_0xef45('0x47')]]=_[_0xef45('0x48')](agents[_0x310105[_0xef45('0x47')]]);transfers[_0x310105[_0xef45('0x47')]][_0xef45('0xa')]=agents[_0x310105['secondtransfereruniqueid']][_0xef45('0xa')];transfers[_0x310105[_0xef45('0x47')]]['calleridname']=agents[_0x310105[_0xef45('0x43')]][_0xef45('0x49')];transfers[_0x310105[_0xef45('0x47')]][_0xef45('0x4a')]=utils[_0xef45('0x2b')]();transfers[_0x310105[_0xef45('0x47')]][_0xef45('0x2a')]=utils[_0xef45('0x2b')]();transfers[_0x310105['transfereeuniqueid']][_0xef45('0x26')]=0x0;transfers[_0x310105['transfereeuniqueid']]['agententerreason']=0x2;}}else if(_0x310105[_0xef45('0x43')]==_0x310105['secondtransfererlinkedid']){if(!_[_0xef45('0x30')](agents[_0x310105[_0xef45('0x41')]])){utils['info'](util[_0xef45('0x3')](_0xef45('0x44'),_0x310105[_0xef45('0x41')],agents[_0x310105[_0xef45('0x41')]][_0xef45('0x8')]));agents[_0x310105[_0xef45('0x41')]]['transfer']=!![];agents[_0x310105[_0xef45('0x41')]][_0xef45('0x3a')]=_0xef45('0x4b');agents[_0x310105[_0xef45('0x41')]][_0xef45('0x3c')]=_0x310105['secondtransfererexten'];agents[_0x310105[_0xef45('0x41')]]['transferuniqueid']=_0x310105[_0xef45('0x43')];}if(_0x310105[_0xef45('0x4c')]&&agents[_0x310105['transfertargetuniqueid']]){agents[_0x310105[_0xef45('0x4c')]][_0xef45('0x4d')]=0x1;transfers[_0x310105[_0xef45('0x4c')]]=_['clone'](agents[_0x310105['transfertargetuniqueid']]);transfers[_0x310105[_0xef45('0x4c')]][_0xef45('0xa')]=agents[_0x310105[_0xef45('0x41')]]['calleridnum'];transfers[_0x310105[_0xef45('0x4c')]][_0xef45('0x49')]=agents[_0x310105['origtransfereruniqueid']][_0xef45('0x49')];transfers[_0x310105['transfertargetuniqueid']][_0xef45('0x4a')]=utils[_0xef45('0x2b')]();transfers[_0x310105[_0xef45('0x4c')]][_0xef45('0x2a')]=utils[_0xef45('0x2b')]();transfers[_0x310105[_0xef45('0x4c')]][_0xef45('0x26')]=0x0;transfers[_0x310105[_0xef45('0x4c')]]['agententerreason']=0x2;}}}catch(_0x3e6b06){utils[_0xef45('0x1b')](util[_0xef45('0x3')](_0xef45('0x40'),_0x310105[_0xef45('0x41')]),_0x3e6b06);}};exports[_0xef45('0x4e')]=function(_0xef7b79){try{utils[_0xef45('0x1e')](util[_0xef45('0x3')](_0xef45('0x4f'),_0xef7b79[_0xef45('0x5')]),_0xef7b79);if(agents[_0xef7b79['uniqueid']]&&agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2e')]===_0xef45('0x21')){if(_0xef7b79[_0xef45('0x50')]==='21'){agents[_0xef7b79[_0xef45('0x5')]]['reason']=_0xef45('0x51');agents[_0xef7b79[_0xef45('0x5')]]['lastevent']='rejected';}utils[_0xef45('0x2')](util[_0xef45('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0xef7b79['uniqueid'],agents[_0xef7b79['uniqueid']][_0xef45('0x8')],agents[_0xef7b79[_0xef45('0x5')]]['reason'],agents[_0xef7b79['uniqueid']][_0xef45('0xc')]));writeDB(agents[_0xef7b79['uniqueid']]);var _0x36586a=unanswered[_0xef45('0x52')](_0xef7b79[_0xef45('0x5')]);if(_0x36586a>-0x1){unanswered[_0xef45('0x53')](_0x36586a,0x1);}}if(transfers[_0xef7b79[_0xef45('0x5')]]){transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0x10')]=!![];transfers[_0xef7b79['uniqueid']][_0xef45('0x33')]=utils[_0xef45('0x2b')]();transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0x27')]=utils[_0xef45('0x34')](transfers[_0xef7b79[_0xef45('0x5')]]['agentcompleteAt'],transfers[_0xef7b79['uniqueid']][_0xef45('0x2a')]);transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2e')]=_0xef45('0x54');transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0xc')]=_0xef45('0x35');utils[_0xef45('0x2')](util['format'](_0xef45('0x55'),_0xef7b79[_0xef45('0x5')],transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0x8')],transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2e')],transfers[_0xef7b79[_0xef45('0x5')]]['lastevent']));writeDB(transfers[_0xef7b79[_0xef45('0x5')]],!![]);}if(agents[_0xef7b79['uniqueid']]&&agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2a')]){agents[_0xef7b79['uniqueid']][_0xef45('0x10')]=!![];agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x33')]=utils['now']();agents[_0xef7b79[_0xef45('0x5')]]['talktime']=utils[_0xef45('0x34')](agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x33')],agents[_0xef7b79[_0xef45('0x5')]]['agentconnectAt']);agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2e')]=agents[_0xef7b79[_0xef45('0x5')]]['transfer']?_0xef45('0x39'):_0xef45('0x54');agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0xc')]=_0xef45('0x35');utils['info'](util[_0xef45('0x3')](_0xef45('0x55'),_0xef7b79[_0xef45('0x5')],agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x8')],agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2e')],agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0xc')]));writeDB(agents[_0xef7b79['uniqueid']]);}}catch(_0xd3a51e){utils[_0xef45('0x1b')](util[_0xef45('0x3')]('[%s][agents][hangup]',_0xef7b79[_0xef45('0x5')]),_0xd3a51e);}}; \ No newline at end of file +var _0x0bb5=['called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','isNil','[%s][agents][agentringnoanswer]','agentringnoanswer','agentringnoanswerAt','now','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','holdtime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheremembername','agentcomplete','[%s][agents][agentcomplete]','agentcompleteAt','diffTime','complete','blindtransfer','[%s][agents][blindtransfer]','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridnum','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','[%s][agents][hangup]','timeout','cause','rejected','indexOf','splice','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','util','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','connectedlinenum','lastevent','getVoiceQueueByName','type','agentacw','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','agentcalled','debug','[%s][agents][agentcalled]','destuniqueid','agentcalledAt'];(function(_0x273502,_0x1c173c){var _0x379e87=function(_0x563348){while(--_0x563348){_0x273502['push'](_0x273502['shift']());}};_0x379e87(++_0x1c173c);}(_0x0bb5,0x148));var _0x50bb=function(_0xd02786,_0x197522){_0xd02786=_0xd02786-0x0;var _0x1d5767=_0x0bb5[_0xd02786];return _0x1d5767;};'use strict';var _=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x5a12b6,_0x348380){utils[_0x50bb('0x2')](util[_0x50bb('0x3')](_0x50bb('0x4'),_0x5a12b6[_0x50bb('0x5')],_0x5a12b6[_0x50bb('0x6')],_0x5a12b6[_0x50bb('0x7')],_0x5a12b6[_0x50bb('0x8')],_0x5a12b6['interface'],_0x5a12b6['calleridnum'],_0x5a12b6[_0x50bb('0x9')],_0x5a12b6[_0x50bb('0xa')]));if(_0x5a12b6[_0x50bb('0x7')]){utils[_0x50bb('0xb')](_0x5a12b6['queue'])['then'](function(_0x2bede8){if(_0x2bede8){_0x5a12b6[_0x50bb('0xc')]=_0x2bede8[_0x50bb('0xc')];_0x5a12b6[_0x50bb('0xd')]=_0x5a12b6['agentcomplete']?_0x2bede8[_0x50bb('0xe')]:![];_0x5a12b6[_0x50bb('0xf')]=_0x5a12b6[_0x50bb('0xd')]?_0x2bede8[_0x50bb('0x10')]:0x0;}utils[_0x50bb('0x11')](_0x50bb('0x12'),_0x5a12b6);});}else{utils[_0x50bb('0x11')]('CreateVoiceAgentReport',_0x5a12b6);}if(_0x348380){delete transfers[_0x5a12b6[_0x50bb('0x5')]];}else{delete agents[_0x5a12b6['destuniqueid']];}}exports[_0x50bb('0x13')]=function(_0xd8ab27){try{utils[_0x50bb('0x14')](util['format'](_0x50bb('0x15'),_0xd8ab27[_0x50bb('0x5')]),_0xd8ab27);agents[_0xd8ab27[_0x50bb('0x16')]]=_0xd8ab27;agents[_0xd8ab27['destuniqueid']][_0x50bb('0x17')]=utils['now']();agents[_0xd8ab27[_0x50bb('0x16')]][_0x50bb('0xa')]=_0x50bb('0x18');agents[_0xd8ab27[_0x50bb('0x16')]][_0x50bb('0x9')]=null;agents[_0xd8ab27['destuniqueid']][_0x50bb('0x19')]=null;utils[_0x50bb('0x2')](util['format'](_0x50bb('0x1a'),_0xd8ab27['uniqueid'],agents[_0xd8ab27[_0x50bb('0x16')]][_0x50bb('0x8')],_0xd8ab27['destuniqueid']));}catch(_0x4f1c0a){utils[_0x50bb('0x1b')](util[_0x50bb('0x3')](_0x50bb('0x15'),_0xd8ab27[_0x50bb('0x5')]),_0x4f1c0a);}};exports['agentringnoanswer']=function(_0x19dc5d){try{if(!_[_0x50bb('0x1c')](agents[_0x19dc5d[_0x50bb('0x16')]])){utils['debug'](util[_0x50bb('0x3')](_0x50bb('0x1d'),_0x19dc5d[_0x50bb('0x5')]),_0x19dc5d);utils['info'](util[_0x50bb('0x3')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x19dc5d[_0x50bb('0x5')],agents[_0x19dc5d[_0x50bb('0x16')]][_0x50bb('0x8')],_0x19dc5d[_0x50bb('0x16')]));agents[_0x19dc5d[_0x50bb('0x16')]][_0x50bb('0x1e')]=!![];agents[_0x19dc5d['destuniqueid']][_0x50bb('0x1f')]=utils[_0x50bb('0x20')]();agents[_0x19dc5d[_0x50bb('0x16')]][_0x50bb('0xa')]='timeout';agents[_0x19dc5d[_0x50bb('0x16')]]['reason']='timeout';agents[_0x19dc5d[_0x50bb('0x16')]]['holdtime']=_0x19dc5d['ringtime']?parseInt(_0x19dc5d[_0x50bb('0x21')])/0x3e8:0x0;agents[_0x19dc5d[_0x50bb('0x16')]][_0x50bb('0x22')]=0x0;unanswered[_0x50bb('0x23')](_0x19dc5d[_0x50bb('0x16')]);}}catch(_0x269479){utils[_0x50bb('0x1b')](util[_0x50bb('0x3')]('[%s][agents][agentringnoanswer]',_0x19dc5d[_0x50bb('0x5')]),_0x269479);}};exports[_0x50bb('0x24')]=function(_0x15ee2e){try{_[_0x50bb('0x25')](agents,function(_0x560b07,_0x13dc3c){if(_0x560b07[_0x50bb('0x5')]==_0x15ee2e[_0x50bb('0x5')]&&!_[_0x50bb('0x26')](unanswered,_0x560b07[_0x50bb('0x16')])){utils[_0x50bb('0x14')](util[_0x50bb('0x3')](_0x50bb('0x27'),_0x15ee2e[_0x50bb('0x5')]),_0x15ee2e);utils[_0x50bb('0x2')](util[_0x50bb('0x3')](_0x50bb('0x28'),_0x15ee2e['uniqueid'],_0x560b07[_0x50bb('0x8')],_0x560b07[_0x50bb('0x16')]));_0x560b07[_0x50bb('0x1e')]=!![];_0x560b07[_0x50bb('0x1f')]=utils[_0x50bb('0x20')]();_0x560b07[_0x50bb('0xa')]=_0x50bb('0x29');_0x560b07[_0x50bb('0x2a')]=_0x50bb('0x29');_0x560b07[_0x50bb('0x2b')]=_0x15ee2e[_0x50bb('0x2b')];_0x560b07['talktime']=0x0;writeDB(_0x560b07);}});}catch(_0x364ea0){utils[_0x50bb('0x1b')](util[_0x50bb('0x3')](_0x50bb('0x27'),_0x15ee2e[_0x50bb('0x5')]),_0x364ea0);}};exports[_0x50bb('0x2c')]=function(_0x53600a){try{if(agents[_0x53600a['destuniqueid']]){utils[_0x50bb('0x14')](util['format'](_0x50bb('0x2d'),_0x53600a[_0x50bb('0x5')]),_0x53600a);utils[_0x50bb('0x2')](util[_0x50bb('0x3')](_0x50bb('0x2e'),_0x53600a['uniqueid'],agents[_0x53600a[_0x50bb('0x16')]]['membername'],_0x53600a[_0x50bb('0x16')]));agents[_0x53600a[_0x50bb('0x16')]][_0x50bb('0x2f')]=utils['now']();agents[_0x53600a['destuniqueid']][_0x50bb('0x9')]=_0x53600a[_0x50bb('0x9')];agents[_0x53600a[_0x50bb('0x16')]][_0x50bb('0x19')]=_0x53600a['connectedlinename'];agents[_0x53600a[_0x50bb('0x16')]]['holdtime']=_0x53600a['ringtime'];agents[_0x53600a[_0x50bb('0x16')]]['lastevent']=_0x50bb('0x30');_[_0x50bb('0x25')](agents,function(_0x1ef231,_0x1f156e){if(_0x1ef231[_0x50bb('0x16')]!=_0x53600a[_0x50bb('0x16')]&&_0x1ef231[_0x50bb('0x5')]==_0x53600a[_0x50bb('0x5')]){_0x1ef231[_0x50bb('0x22')]=0x0;_0x1ef231[_0x50bb('0x2b')]=_0x53600a['ringtime'];_0x1ef231['agentringnoanswer']=!![];_0x1ef231[_0x50bb('0x1f')]=utils[_0x50bb('0x20')]();_0x1ef231[_0x50bb('0xa')]=_0x50bb('0x31');_0x1ef231['reason']=_0x50bb('0x31');_0x1ef231['answeredelsewheredestinationuniqueid']=_0x53600a[_0x50bb('0x16')];_0x1ef231[_0x50bb('0x32')]=_0x53600a[_0x50bb('0x8')];writeDB(_0x1ef231);}});}}catch(_0x40748d){utils[_0x50bb('0x1b')](util[_0x50bb('0x3')](_0x50bb('0x2d'),_0x53600a[_0x50bb('0x5')]),_0x40748d);}};exports[_0x50bb('0x33')]=function(_0x46c1c3){try{if(!_[_0x50bb('0x1c')](agents[_0x46c1c3[_0x50bb('0x16')]])){utils[_0x50bb('0x14')](util[_0x50bb('0x3')](_0x50bb('0x34'),_0x46c1c3[_0x50bb('0x5')]),_0x46c1c3);utils['info'](util[_0x50bb('0x3')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x46c1c3[_0x50bb('0x5')],agents[_0x46c1c3[_0x50bb('0x16')]][_0x50bb('0x8')],_0x46c1c3[_0x50bb('0x16')]));agents[_0x46c1c3[_0x50bb('0x16')]][_0x50bb('0x33')]=!![];agents[_0x46c1c3[_0x50bb('0x16')]][_0x50bb('0x35')]=utils[_0x50bb('0x20')]();agents[_0x46c1c3[_0x50bb('0x16')]][_0x50bb('0x22')]=utils[_0x50bb('0x36')](agents[_0x46c1c3[_0x50bb('0x16')]][_0x50bb('0x35')],agents[_0x46c1c3['destuniqueid']][_0x50bb('0x2f')]);agents[_0x46c1c3['destuniqueid']][_0x50bb('0x2a')]=_0x46c1c3[_0x50bb('0x2a')];agents[_0x46c1c3[_0x50bb('0x16')]][_0x50bb('0xa')]=_0x50bb('0x37');writeDB(agents[_0x46c1c3[_0x50bb('0x16')]]);}}catch(_0x133dd9){utils[_0x50bb('0x1b')](util['format'](_0x50bb('0x34'),_0x46c1c3[_0x50bb('0x5')]),_0x133dd9);}};exports[_0x50bb('0x38')]=function(_0x13afe2){try{if(!_[_0x50bb('0x1c')](agents[_0x13afe2['transfereruniqueid']])){utils[_0x50bb('0x14')](util[_0x50bb('0x3')](_0x50bb('0x39'),_0x13afe2[_0x50bb('0x5')]),_0x13afe2);utils[_0x50bb('0x2')](util['format']('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x13afe2[_0x50bb('0x5')],agents[_0x13afe2['transfereruniqueid']][_0x50bb('0x8')],agents[_0x13afe2['transfereruniqueid']][_0x50bb('0x5')]));agents[_0x13afe2[_0x50bb('0x3a')]][_0x50bb('0x3b')]=!![];agents[_0x13afe2['transfereruniqueid']][_0x50bb('0x3c')]=_0x50bb('0x3d');agents[_0x13afe2['transfereruniqueid']][_0x50bb('0x3e')]=_0x13afe2[_0x50bb('0x3f')];agents[_0x13afe2[_0x50bb('0x3a')]][_0x50bb('0x40')]=agents[_0x13afe2['transfereruniqueid']][_0x50bb('0x5')];}}catch(_0x46b51e){utils[_0x50bb('0x1b')](util[_0x50bb('0x3')](_0x50bb('0x39'),_0x13afe2['uniqueid']),_0x46b51e);}};exports[_0x50bb('0x41')]=function(_0x50943a){try{utils[_0x50bb('0x14')](util['format']('[%s][agents][attendedtransfer]',_0x50943a[_0x50bb('0x42')]),_0x50943a);if(_0x50943a['origtransfereruniqueid']==_0x50943a['origtransfererlinkedid']){if(!_[_0x50bb('0x1c')](agents[_0x50943a[_0x50bb('0x43')]])){utils[_0x50bb('0x2')](util[_0x50bb('0x3')](_0x50bb('0x44'),_0x50943a[_0x50bb('0x42')],agents[_0x50943a[_0x50bb('0x43')]][_0x50bb('0x8')]));agents[_0x50943a['secondtransfereruniqueid']]['transfer']=!![];agents[_0x50943a[_0x50bb('0x43')]][_0x50bb('0x3c')]=_0x50bb('0x45');agents[_0x50943a[_0x50bb('0x43')]][_0x50bb('0x3e')]=_0x50943a[_0x50bb('0x46')];agents[_0x50943a[_0x50bb('0x43')]]['transferuniqueid']=_0x50943a[_0x50bb('0x42')];}if(_0x50943a[_0x50bb('0x47')]&&agents[_0x50943a[_0x50bb('0x47')]]){agents[_0x50943a[_0x50bb('0x47')]][_0x50bb('0x48')]=0x1;transfers[_0x50943a['transfereeuniqueid']]=_[_0x50bb('0x49')](agents[_0x50943a[_0x50bb('0x47')]]);transfers[_0x50943a[_0x50bb('0x47')]][_0x50bb('0x4a')]=agents[_0x50943a[_0x50bb('0x43')]]['calleridnum'];transfers[_0x50943a[_0x50bb('0x47')]]['calleridname']=agents[_0x50943a['secondtransfereruniqueid']][_0x50bb('0x4b')];transfers[_0x50943a[_0x50bb('0x47')]][_0x50bb('0x17')]=utils[_0x50bb('0x20')]();transfers[_0x50943a[_0x50bb('0x47')]][_0x50bb('0x2f')]=utils[_0x50bb('0x20')]();transfers[_0x50943a[_0x50bb('0x47')]][_0x50bb('0x2b')]=0x0;transfers[_0x50943a[_0x50bb('0x47')]][_0x50bb('0x48')]=0x2;}}else if(_0x50943a['secondtransfereruniqueid']==_0x50943a[_0x50bb('0x4c')]){if(!_['isNil'](agents[_0x50943a[_0x50bb('0x42')]])){utils[_0x50bb('0x2')](util['format'](_0x50bb('0x44'),_0x50943a[_0x50bb('0x42')],agents[_0x50943a[_0x50bb('0x42')]][_0x50bb('0x8')]));agents[_0x50943a[_0x50bb('0x42')]][_0x50bb('0x3b')]=!![];agents[_0x50943a[_0x50bb('0x42')]][_0x50bb('0x3c')]='ATTENDED';agents[_0x50943a[_0x50bb('0x42')]][_0x50bb('0x3e')]=_0x50943a[_0x50bb('0x4d')];agents[_0x50943a['origtransfereruniqueid']][_0x50bb('0x40')]=_0x50943a[_0x50bb('0x43')];}if(_0x50943a[_0x50bb('0x4e')]&&agents[_0x50943a[_0x50bb('0x4e')]]){agents[_0x50943a[_0x50bb('0x4e')]][_0x50bb('0x48')]=0x1;transfers[_0x50943a['transfertargetuniqueid']]=_[_0x50bb('0x49')](agents[_0x50943a[_0x50bb('0x4e')]]);transfers[_0x50943a[_0x50bb('0x4e')]][_0x50bb('0x4a')]=agents[_0x50943a[_0x50bb('0x42')]][_0x50bb('0x4a')];transfers[_0x50943a['transfertargetuniqueid']][_0x50bb('0x4b')]=agents[_0x50943a[_0x50bb('0x42')]][_0x50bb('0x4b')];transfers[_0x50943a[_0x50bb('0x4e')]][_0x50bb('0x17')]=utils[_0x50bb('0x20')]();transfers[_0x50943a[_0x50bb('0x4e')]][_0x50bb('0x2f')]=utils[_0x50bb('0x20')]();transfers[_0x50943a['transfertargetuniqueid']][_0x50bb('0x2b')]=0x0;transfers[_0x50943a[_0x50bb('0x4e')]][_0x50bb('0x48')]=0x2;}}}catch(_0x2d2463){utils[_0x50bb('0x1b')](util[_0x50bb('0x3')](_0x50bb('0x4f'),_0x50943a[_0x50bb('0x42')]),_0x2d2463);}};exports[_0x50bb('0x50')]=function(_0x578ff3){try{utils['debug'](util['format'](_0x50bb('0x51'),_0x578ff3['uniqueid']),_0x578ff3);if(agents[_0x578ff3['uniqueid']]&&agents[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x2a')]===_0x50bb('0x52')){if(_0x578ff3[_0x50bb('0x53')]==='21'){agents[_0x578ff3['uniqueid']][_0x50bb('0x2a')]=_0x50bb('0x54');agents[_0x578ff3['uniqueid']][_0x50bb('0xa')]='rejected';}utils[_0x50bb('0x2')](util[_0x50bb('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x578ff3[_0x50bb('0x5')],agents[_0x578ff3['uniqueid']][_0x50bb('0x8')],agents[_0x578ff3[_0x50bb('0x5')]]['reason'],agents[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0xa')]));writeDB(agents[_0x578ff3[_0x50bb('0x5')]]);var _0x51142c=unanswered[_0x50bb('0x55')](_0x578ff3[_0x50bb('0x5')]);if(_0x51142c>-0x1){unanswered[_0x50bb('0x56')](_0x51142c,0x1);}}if(transfers[_0x578ff3[_0x50bb('0x5')]]){transfers[_0x578ff3['uniqueid']][_0x50bb('0x33')]=!![];transfers[_0x578ff3[_0x50bb('0x5')]]['agentcompleteAt']=utils['now']();transfers[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x22')]=utils['diffTime'](transfers[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x35')],transfers[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x2f')]);transfers[_0x578ff3[_0x50bb('0x5')]]['reason']='agent';transfers[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0xa')]=_0x50bb('0x37');utils[_0x50bb('0x2')](util['format'](_0x50bb('0x57'),_0x578ff3['uniqueid'],transfers[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x8')],transfers[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x2a')],transfers[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0xa')]));writeDB(transfers[_0x578ff3[_0x50bb('0x5')]],!![]);}if(agents[_0x578ff3['uniqueid']]&&agents[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x2f')]){agents[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x33')]=!![];agents[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x35')]=utils[_0x50bb('0x20')]();agents[_0x578ff3['uniqueid']][_0x50bb('0x22')]=utils[_0x50bb('0x36')](agents[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x35')],agents[_0x578ff3[_0x50bb('0x5')]]['agentconnectAt']);agents[_0x578ff3['uniqueid']][_0x50bb('0x2a')]=agents[_0x578ff3['uniqueid']][_0x50bb('0x3b')]?_0x50bb('0x3b'):'agent';agents[_0x578ff3['uniqueid']][_0x50bb('0xa')]=_0x50bb('0x37');utils[_0x50bb('0x2')](util['format'](_0x50bb('0x57'),_0x578ff3[_0x50bb('0x5')],agents[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x8')],agents[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x2a')],agents[_0x578ff3[_0x50bb('0x5')]]['lastevent']));writeDB(agents[_0x578ff3['uniqueid']]);}}catch(_0x28c99d){utils[_0x50bb('0x1b')](util[_0x50bb('0x3')](_0x50bb('0x51'),_0x578ff3[_0x50bb('0x5')]),_0x28c99d);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 424a785..10df25b 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 _0xe1da=['calleridname','calleridnum','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','billableseconds','diffTime','attendedtransfer','localtwolinkedid','origtransfereruniqueid','transfereechannel','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','variable','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','value','destination','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmcs-queue','xmd-queue','lastapplication','Queue','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','sipcallid','newexten','[%s][calls][newexten]','application','set','appdata','toLowerCase','cdr','split','substring','lastIndexOf','includes','noop','execif','gotoif','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','connectedlinenum','accountcode','getUserByInternal','UserId','request','CreateVoiceCallReport','newchannel','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','debug','[%s][calls][newstate]','isNil','channelstate','systemanswertime','destinationchannel','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','callerid'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe1da,0x10a));var _0xae1d=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xe1da[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require(_0xae1d('0x0'));var utils=require(_0xae1d('0x1'));var transfers=require(_0xae1d('0x2'));var dispositions=[_0xae1d('0x3'),'FAILED',_0xae1d('0x4'),_0xae1d('0x3'),_0xae1d('0x3'),_0xae1d('0x3'),_0xae1d('0x5'),_0xae1d('0x6'),_0xae1d('0x4'),'FAILED','FAILED'];var channels={};function writeDB(_0x5a275b){var _0x37d133;if(transfers['blinds'][_0x5a275b[_0xae1d('0x7')]]){_0x37d133=_0x5a275b[_0xae1d('0x7')];_0x5a275b['uniqueid']=transfers['blinds'][_0x5a275b[_0xae1d('0x7')]][_0xae1d('0x8')];}utils[_0xae1d('0x9')](util[_0xae1d('0xa')](_0xae1d('0xb'),_0x5a275b[_0xae1d('0x7')],_0x5a275b[_0xae1d('0xc')],_0x5a275b[_0xae1d('0xd')],_0x5a275b[_0xae1d('0xe')],_0x5a275b['interface'],_0x5a275b['calleridnum'],_0x5a275b[_0xae1d('0xf')],_0x5a275b['lastevent']));if(_0x5a275b[_0xae1d('0x10')]){utils[_0xae1d('0x11')](_0x5a275b[_0xae1d('0x10')])['then'](function(_0x281822){if(_0x281822){_0x5a275b[_0xae1d('0x12')]=_0x281822['id'];}utils[_0xae1d('0x13')](_0xae1d('0x14'),_0x5a275b);});}else{utils[_0xae1d('0x13')](_0xae1d('0x14'),_0x5a275b);}if(channels[_0x5a275b['uniqueid']]){delete channels[_0x5a275b[_0xae1d('0x7')]];}else if(_0x37d133&&channels[_0x37d133]){delete transfers['blinds'][_0x37d133];delete channels[_0x37d133];}}exports[_0xae1d('0x15')]=function(_0x3e22e6){try{utils['debug'](util['format'](_0xae1d('0x16'),_0x3e22e6[_0xae1d('0x7')]),_0x3e22e6);if(_0x3e22e6['uniqueid']==_0x3e22e6[_0xae1d('0x17')]&&_0x3e22e6['channel']!=_0xae1d('0x18')){utils[_0xae1d('0x9')](util[_0xae1d('0xa')](_0xae1d('0x19'),_0x3e22e6['uniqueid'],_0x3e22e6[_0xae1d('0x1a')],_0x3e22e6[_0xae1d('0x1b')]));channels[_0x3e22e6[_0xae1d('0x7')]]={'uniqueid':_0x3e22e6[_0xae1d('0x7')],'accountcode':_0x3e22e6[_0xae1d('0x10')],'source':_0x3e22e6['calleridnum'],'destination':_0x3e22e6[_0xae1d('0x1b')],'destinationcontext':_0x3e22e6[_0xae1d('0x1a')],'channel':_0x3e22e6[_0xae1d('0xc')],'starttime':utils[_0xae1d('0x1c')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xae1d('0x3'),'amaflags':_0xae1d('0x1d')};}}catch(_0x4caa32){utils[_0xae1d('0x1e')](util[_0xae1d('0xa')](_0xae1d('0x16'),_0x3e22e6[_0xae1d('0x7')]),_0x4caa32);}};exports['newstate']=function(_0x9d4ae7){try{utils[_0xae1d('0x1f')](util[_0xae1d('0xa')](_0xae1d('0x20'),_0x9d4ae7['uniqueid']),_0x9d4ae7);if(!_[_0xae1d('0x21')](channels[_0x9d4ae7[_0xae1d('0x7')]])&&_0x9d4ae7[_0xae1d('0x22')]==0x6){utils[_0xae1d('0x9')](util[_0xae1d('0xa')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x9d4ae7['uniqueid'],_0x9d4ae7[_0xae1d('0x1a')],_0x9d4ae7[_0xae1d('0xc')]));if(_[_0xae1d('0x21')](channels[_0x9d4ae7[_0xae1d('0x7')]][_0xae1d('0x23')])){channels[_0x9d4ae7[_0xae1d('0x7')]][_0xae1d('0x23')]=utils[_0xae1d('0x1c')]();}}else if(!_['isNil'](channels[_0x9d4ae7[_0xae1d('0x17')]])&&_0x9d4ae7[_0xae1d('0x22')]==0x6&&_0x9d4ae7['context']!='transfer'){utils[_0xae1d('0x9')](util[_0xae1d('0xa')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x9d4ae7['uniqueid'],_0x9d4ae7['linkedid'],_0x9d4ae7[_0xae1d('0x1a')],_0x9d4ae7[_0xae1d('0xc')]));channels[_0x9d4ae7[_0xae1d('0x17')]][_0xae1d('0x10')]=_0x9d4ae7[_0xae1d('0x10')];channels[_0x9d4ae7[_0xae1d('0x17')]][_0xae1d('0x24')]=_0x9d4ae7[_0xae1d('0xc')];if(_[_0xae1d('0x21')](channels[_0x9d4ae7['linkedid']]['answertime'])){channels[_0x9d4ae7[_0xae1d('0x17')]][_0xae1d('0x25')]=utils['now']();}channels[_0x9d4ae7[_0xae1d('0x17')]][_0xae1d('0x26')]=dispositions[_[_0xae1d('0x27')](_0x9d4ae7[_0xae1d('0x22')])]||_0xae1d('0x5');}}catch(_0x510879){utils['error'](util[_0xae1d('0xa')]('[%s][calls][newstate]',_0x9d4ae7[_0xae1d('0x7')]),_0x510879);}};exports[_0xae1d('0x28')]=function(_0x510740){try{if(!_['isNil'](channels[_0x510740[_0xae1d('0x7')]])){utils[_0xae1d('0x1f')](util['format'](_0xae1d('0x29'),_0x510740[_0xae1d('0x7')]),_0x510740);if(_[_0xae1d('0x21')](channels[_0x510740[_0xae1d('0x7')]][_0xae1d('0x2a')])){channels[_0x510740[_0xae1d('0x7')]]['callerid']=_0x510740[_0xae1d('0x2b')]+'\x20<'+_0x510740[_0xae1d('0x2c')]+'>';}utils['info'](util['format'](_0xae1d('0x2d'),_0x510740['uniqueid'],channels[_0x510740[_0xae1d('0x7')]][_0xae1d('0x2a')],_0x510740[_0xae1d('0x2e')]));channels[_0x510740[_0xae1d('0x7')]][_0xae1d('0x2f')]=utils[_0xae1d('0x1c')]();channels[_0x510740['uniqueid']][_0xae1d('0x30')]=utils['diffTime'](channels[_0x510740[_0xae1d('0x7')]]['endtime'],channels[_0x510740[_0xae1d('0x7')]]['starttime']);channels[_0x510740[_0xae1d('0x7')]][_0xae1d('0x31')]=channels[_0x510740['uniqueid']][_0xae1d('0x25')]?utils[_0xae1d('0x32')](channels[_0x510740['uniqueid']]['endtime'],channels[_0x510740[_0xae1d('0x7')]]['answertime']):0x0;writeDB(channels[_0x510740[_0xae1d('0x7')]]);}}catch(_0x5edfc4){utils[_0xae1d('0x1e')](util[_0xae1d('0xa')]('[%s][calls][hangup]',_0x510740[_0xae1d('0x7')]),_0x5edfc4);}};exports[_0xae1d('0x33')]=function(_0x47cadc){try{if(!_[_0xae1d('0x21')](channels[_0x47cadc[_0xae1d('0x34')]])){utils[_0xae1d('0x1f')](util[_0xae1d('0xa')]('[%s][calls][attendedtransfer]',_0x47cadc[_0xae1d('0x35')]),_0x47cadc);if(channels[_0x47cadc['localtwolinkedid']][_0xae1d('0xc')]==_0x47cadc[_0xae1d('0x36')]){utils[_0xae1d('0x9')](util[_0xae1d('0xa')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x47cadc[_0xae1d('0x35')],_0x47cadc[_0xae1d('0x34')],_0x47cadc[_0xae1d('0x37')]));channels[_0x47cadc[_0xae1d('0x34')]]['destinationchannel']=_0x47cadc[_0xae1d('0x37')];channels[_0x47cadc[_0xae1d('0x34')]][_0xae1d('0x38')]=_0xae1d('0x39');}else if(channels[_0x47cadc[_0xae1d('0x34')]][_0xae1d('0xc')]=_0x47cadc[_0xae1d('0x3a')]){utils[_0xae1d('0x9')](util[_0xae1d('0xa')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x47cadc[_0xae1d('0x35')],_0x47cadc['localtwolinkedid'],_0x47cadc[_0xae1d('0x3b')]));channels[_0x47cadc['localtwolinkedid']]['destinationchannel']=_0x47cadc[_0xae1d('0x3b')];channels[_0x47cadc[_0xae1d('0x34')]][_0xae1d('0x38')]=_0xae1d('0x39');}}}catch(_0x20173b){utils['error'](util[_0xae1d('0xa')]('[%s][calls][attendedtransfer]',_0x47cadc['origtransfereruniqueid']),_0x20173b);}};exports[_0xae1d('0x3c')]=function(_0x165f87){try{if(!_[_0xae1d('0x21')](channels[_0x165f87[_0xae1d('0x7')]])){utils[_0xae1d('0x1f')](util['format'](_0xae1d('0x3d'),_0x165f87[_0xae1d('0x7')]),_0x165f87);channels[_0x165f87[_0xae1d('0x7')]]['musiconholdstartAt']=utils[_0xae1d('0x1c')]();utils[_0xae1d('0x9')](util[_0xae1d('0xa')](_0xae1d('0x3e'),_0x165f87['uniqueid'],channels[_0x165f87[_0xae1d('0x7')]][_0xae1d('0x3f')]));}}catch(_0x438369){utils['error'](util[_0xae1d('0xa')](_0xae1d('0x3d'),_0x165f87['uniqueid']),_0x438369);}};exports[_0xae1d('0x40')]=function(_0x2847aa){try{if(!_[_0xae1d('0x21')](channels[_0x2847aa[_0xae1d('0x7')]])){utils[_0xae1d('0x1f')](util[_0xae1d('0xa')](_0xae1d('0x41'),_0x2847aa[_0xae1d('0x7')]),_0x2847aa);if(!_[_0xae1d('0x21')](channels[_0x2847aa['uniqueid']][_0xae1d('0x3f')])){channels[_0x2847aa[_0xae1d('0x7')]]['mohtime']+=utils['diffTime'](utils[_0xae1d('0x1c')](),channels[_0x2847aa[_0xae1d('0x7')]][_0xae1d('0x3f')]);utils['info'](util[_0xae1d('0xa')](_0xae1d('0x42'),_0x2847aa[_0xae1d('0x7')],channels[_0x2847aa['uniqueid']]['mohtime']));delete channels[_0x2847aa[_0xae1d('0x7')]]['musiconholdstartAt'];}}}catch(_0x26932d){utils[_0xae1d('0x1e')](util[_0xae1d('0xa')]('[%s][calls][musiconholdstop]',_0x2847aa[_0xae1d('0x7')]),_0x26932d);}};exports[_0xae1d('0x43')]=function(_0x425579){try{if(!_['isNil'](channels[_0x425579[_0xae1d('0x7')]])){utils[_0xae1d('0x1f')](util[_0xae1d('0xa')]('[%s][calls][varset]',_0x425579[_0xae1d('0x7')]),_0x425579);if(!_[_0xae1d('0x21')](_0x425579['variable'][_0xae1d('0x44')])){utils['info'](util['format'](_0xae1d('0x45'),_0x425579[_0xae1d('0x7')],_0x425579['value']));channels[_0x425579[_0xae1d('0x7')]][_0xae1d('0x46')]=_0x425579['value'];}if(!_[_0xae1d('0x21')](_0x425579[_0xae1d('0x47')][_0xae1d('0x48')])){utils['info'](util[_0xae1d('0xa')](_0xae1d('0x49'),_0x425579['uniqueid'],_0x425579[_0xae1d('0x4a')]));channels[_0x425579[_0xae1d('0x7')]][_0xae1d('0x4b')]=_0x425579['value'];channels[_0x425579[_0xae1d('0x7')]][_0xae1d('0x2a')]='\x22'+_0x425579[_0xae1d('0x4a')]+'\x22\x20<'+_0x425579[_0xae1d('0x4a')]+'>';}if(!_[_0xae1d('0x21')](_0x425579[_0xae1d('0x47')][_0xae1d('0x4c')])||!_['isNil'](_0x425579['variable'][_0xae1d('0x4d')])){utils[_0xae1d('0x9')](util[_0xae1d('0xa')](_0xae1d('0x4e'),_0x425579[_0xae1d('0x7')],!_[_0xae1d('0x21')](_0x425579[_0xae1d('0x47')][_0xae1d('0x4c')])?_0xae1d('0x4c'):'xmd-callerid',_0x425579['value']));channels[_0x425579['uniqueid']]['callerid']=_0x425579[_0xae1d('0x4a')];}if(!_['isNil'](_0x425579[_0xae1d('0x47')]['xmd-queue'])||!_[_0xae1d('0x21')](_0x425579['variable'][_0xae1d('0x4f')])){utils['info'](util[_0xae1d('0xa')](_0xae1d('0x4e'),_0x425579[_0xae1d('0x7')],!_[_0xae1d('0x21')](_0x425579['variable']['xmd-queue'])?_0xae1d('0x50'):_0xae1d('0x4f'),_0x425579[_0xae1d('0x4a')]));channels[_0x425579['uniqueid']][_0xae1d('0x51')]=_0xae1d('0x52');channels[_0x425579[_0xae1d('0x7')]][_0xae1d('0x53')]=_0x425579[_0xae1d('0x4a')];channels[_0x425579[_0xae1d('0x7')]][_0xae1d('0xd')]=!![];}if(!_[_0xae1d('0x21')](_0x425579[_0xae1d('0x47')]['xmd-contactid'])){utils[_0xae1d('0x9')](util[_0xae1d('0xa')](_0xae1d('0x54'),_0x425579[_0xae1d('0x7')],_0x425579['value']));channels[_0x425579[_0xae1d('0x7')]]['ContactId']=_0x425579['value'];}if(!_[_0xae1d('0x21')](_0x425579[_0xae1d('0x47')][_0xae1d('0x55')])){utils[_0xae1d('0x9')](util[_0xae1d('0xa')](_0xae1d('0x56'),_0x425579['uniqueid'],_0x425579[_0xae1d('0x4a')]));channels[_0x425579[_0xae1d('0x7')]]['type']=_0x425579[_0xae1d('0x4a')];}if(!_[_0xae1d('0x21')](_0x425579[_0xae1d('0x47')][_0xae1d('0x57')])){utils[_0xae1d('0x9')](util[_0xae1d('0xa')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x425579[_0xae1d('0x7')],_0x425579['value']));channels[_0x425579[_0xae1d('0x7')]]['routeid']=_0x425579[_0xae1d('0x4a')];}if(!_[_0xae1d('0x21')](_0x425579[_0xae1d('0x47')][_0xae1d('0x58')])){utils[_0xae1d('0x9')](util['format']('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x425579[_0xae1d('0x7')],_0x425579[_0xae1d('0x4a')]));channels[_0x425579[_0xae1d('0x7')]]['sipcallid']=_0x425579[_0xae1d('0x4a')];}}}catch(_0xc93a2c){utils[_0xae1d('0x1e')](util['format']('[%s][calls][varset]',_0x425579['uniqueid']),_0xc93a2c);}};exports[_0xae1d('0x59')]=function(_0x2a9d87){try{if(!_[_0xae1d('0x21')](channels[_0x2a9d87[_0xae1d('0x7')]])){utils[_0xae1d('0x1f')](util[_0xae1d('0xa')](_0xae1d('0x5a'),_0x2a9d87['uniqueid']),_0x2a9d87);utils[_0xae1d('0x9')](util[_0xae1d('0xa')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x2a9d87[_0xae1d('0x7')],_0x2a9d87['application'],_0x2a9d87['appdata']));if(_0x2a9d87[_0xae1d('0x5b')]['toLowerCase']()==_0xae1d('0x5c')&&_['startsWith'](_0x2a9d87[_0xae1d('0x5d')][_0xae1d('0x5e')](),_0xae1d('0x5f'))){var _0x464bf7=_0x2a9d87[_0xae1d('0x5d')][_0xae1d('0x60')]('=');var _0x9bba27=_0x464bf7[0x0][_0xae1d('0x61')](_0x464bf7[0x0][_0xae1d('0x62')]('(')+0x1,_0x464bf7[0x0][_0xae1d('0x62')](')'));var _0x143ece=_0x464bf7[0x1];channels[_0x2a9d87['uniqueid']][_0x9bba27]=_0x143ece;}if(!_[_0xae1d('0x63')]([_0xae1d('0x28'),_0xae1d('0x64'),_0xae1d('0x65'),_0xae1d('0x5c'),_0xae1d('0x66')],_0x2a9d87['application'][_0xae1d('0x5e')]())){channels[_0x2a9d87['uniqueid']][_0xae1d('0x51')]=_0x2a9d87['application'];channels[_0x2a9d87[_0xae1d('0x7')]][_0xae1d('0x53')]=_0x2a9d87[_0xae1d('0x5d')];}}}catch(_0x5d3d1f){utils[_0xae1d('0x1e')](util[_0xae1d('0xa')](_0xae1d('0x5a'),_0x2a9d87[_0xae1d('0x7')]),_0x5d3d1f);}}; \ No newline at end of file +var _0xa34a=['calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','duration','endtime','starttime','billableseconds','diffTime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','secondtransfererchannel','userfield','_attended','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','musiconholdstartAt','mohtime','varset','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','value','xmd-phone','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][varset]','[%s][calls][newexten]','application','toLowerCase','set','cdr','appdata','split','substring','lastIndexOf','includes','noop','execif','gotoif','lastapplication','lodash','./transfers.controller','FAILED','NO\x20ANSWER','BUSY','blinds','uniqueid','transfereeuniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','CreateVoiceCallReport','request','newchannel','debug','[%s][calls][newchannel]','OutgoingSpoolFailed','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','context','now','DOCUMENTATION','error','[%s][calls][newstate]','isNil','channelstate','systemanswertime','linkedid','transfer','destinationchannel','answertime','disposition','toNumber','ANSWERED','hangup','[%s][calls][hangup]','callerid'];(function(_0x5737f7,_0xfe62e2){var _0x56d0c0=function(_0x2030cc){while(--_0x2030cc){_0x5737f7['push'](_0x5737f7['shift']());}};_0x56d0c0(++_0xfe62e2);}(_0xa34a,0x10a));var _0xaa34=function(_0x44457c,_0x581958){_0x44457c=_0x44457c-0x0;var _0x4e6d68=_0xa34a[_0x44457c];return _0x4e6d68;};'use strict';var _=require(_0xaa34('0x0'));var util=require('util');var utils=require('./utils');var transfers=require(_0xaa34('0x1'));var dispositions=['NO\x20ANSWER',_0xaa34('0x2'),_0xaa34('0x2'),_0xaa34('0x3'),_0xaa34('0x3'),_0xaa34('0x3'),'ANSWERED',_0xaa34('0x4'),_0xaa34('0x2'),'FAILED',_0xaa34('0x2')];var channels={};function writeDB(_0x3686a2){var _0x534798;if(transfers[_0xaa34('0x5')][_0x3686a2[_0xaa34('0x6')]]){_0x534798=_0x3686a2[_0xaa34('0x6')];_0x3686a2['uniqueid']=transfers['blinds'][_0x3686a2[_0xaa34('0x6')]][_0xaa34('0x7')];}utils['info'](util[_0xaa34('0x8')](_0xaa34('0x9'),_0x3686a2[_0xaa34('0x6')],_0x3686a2[_0xaa34('0xa')],_0x3686a2[_0xaa34('0xb')],_0x3686a2[_0xaa34('0xc')],_0x3686a2[_0xaa34('0xd')],_0x3686a2[_0xaa34('0xe')],_0x3686a2[_0xaa34('0xf')],_0x3686a2[_0xaa34('0x10')]));if(_0x3686a2[_0xaa34('0x11')]){utils[_0xaa34('0x12')](_0x3686a2['accountcode'])['then'](function(_0x273558){if(_0x273558){_0x3686a2['UserId']=_0x273558['id'];}utils['request'](_0xaa34('0x13'),_0x3686a2);});}else{utils[_0xaa34('0x14')]('CreateVoiceCallReport',_0x3686a2);}if(channels[_0x3686a2['uniqueid']]){delete channels[_0x3686a2[_0xaa34('0x6')]];}else if(_0x534798&&channels[_0x534798]){delete transfers[_0xaa34('0x5')][_0x534798];delete channels[_0x534798];}}exports[_0xaa34('0x15')]=function(_0x58a6dd){try{utils[_0xaa34('0x16')](util['format'](_0xaa34('0x17'),_0x58a6dd[_0xaa34('0x6')]),_0x58a6dd);if(_0x58a6dd['uniqueid']==_0x58a6dd['linkedid']&&_0x58a6dd[_0xaa34('0xa')]!=_0xaa34('0x18')){utils[_0xaa34('0x19')](util[_0xaa34('0x8')](_0xaa34('0x1a'),_0x58a6dd[_0xaa34('0x6')],_0x58a6dd['context'],_0x58a6dd[_0xaa34('0x1b')]));channels[_0x58a6dd[_0xaa34('0x6')]]={'uniqueid':_0x58a6dd[_0xaa34('0x6')],'accountcode':_0x58a6dd['accountcode'],'source':_0x58a6dd[_0xaa34('0xe')],'destination':_0x58a6dd[_0xaa34('0x1b')],'destinationcontext':_0x58a6dd[_0xaa34('0x1c')],'channel':_0x58a6dd[_0xaa34('0xa')],'starttime':utils[_0xaa34('0x1d')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0xaa34('0x1e')};}}catch(_0x9d4f34){utils[_0xaa34('0x1f')](util[_0xaa34('0x8')](_0xaa34('0x17'),_0x58a6dd[_0xaa34('0x6')]),_0x9d4f34);}};exports['newstate']=function(_0x4c1471){try{utils['debug'](util['format'](_0xaa34('0x20'),_0x4c1471[_0xaa34('0x6')]),_0x4c1471);if(!_[_0xaa34('0x21')](channels[_0x4c1471[_0xaa34('0x6')]])&&_0x4c1471[_0xaa34('0x22')]==0x6){utils[_0xaa34('0x19')](util[_0xaa34('0x8')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x4c1471[_0xaa34('0x6')],_0x4c1471['context'],_0x4c1471[_0xaa34('0xa')]));if(_[_0xaa34('0x21')](channels[_0x4c1471[_0xaa34('0x6')]][_0xaa34('0x23')])){channels[_0x4c1471[_0xaa34('0x6')]][_0xaa34('0x23')]=utils['now']();}}else if(!_[_0xaa34('0x21')](channels[_0x4c1471[_0xaa34('0x24')]])&&_0x4c1471[_0xaa34('0x22')]==0x6&&_0x4c1471[_0xaa34('0x1c')]!=_0xaa34('0x25')){utils['info'](util[_0xaa34('0x8')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x4c1471[_0xaa34('0x6')],_0x4c1471[_0xaa34('0x24')],_0x4c1471[_0xaa34('0x1c')],_0x4c1471[_0xaa34('0xa')]));channels[_0x4c1471[_0xaa34('0x24')]][_0xaa34('0x11')]=_0x4c1471[_0xaa34('0x11')];channels[_0x4c1471[_0xaa34('0x24')]][_0xaa34('0x26')]=_0x4c1471[_0xaa34('0xa')];if(_[_0xaa34('0x21')](channels[_0x4c1471[_0xaa34('0x24')]][_0xaa34('0x27')])){channels[_0x4c1471[_0xaa34('0x24')]][_0xaa34('0x27')]=utils['now']();}channels[_0x4c1471['linkedid']][_0xaa34('0x28')]=dispositions[_[_0xaa34('0x29')](_0x4c1471['channelstate'])]||_0xaa34('0x2a');}}catch(_0x32f213){utils[_0xaa34('0x1f')](util[_0xaa34('0x8')](_0xaa34('0x20'),_0x4c1471[_0xaa34('0x6')]),_0x32f213);}};exports[_0xaa34('0x2b')]=function(_0x57a00b){try{if(!_['isNil'](channels[_0x57a00b[_0xaa34('0x6')]])){utils[_0xaa34('0x16')](util['format'](_0xaa34('0x2c'),_0x57a00b[_0xaa34('0x6')]),_0x57a00b);if(_[_0xaa34('0x21')](channels[_0x57a00b[_0xaa34('0x6')]][_0xaa34('0x2d')])){channels[_0x57a00b[_0xaa34('0x6')]][_0xaa34('0x2d')]=_0x57a00b[_0xaa34('0x2e')]+'\x20<'+_0x57a00b[_0xaa34('0xe')]+'>';}utils[_0xaa34('0x19')](util[_0xaa34('0x8')](_0xaa34('0x2f'),_0x57a00b[_0xaa34('0x6')],channels[_0x57a00b[_0xaa34('0x6')]][_0xaa34('0x2d')],_0x57a00b[_0xaa34('0x30')]));channels[_0x57a00b[_0xaa34('0x6')]]['endtime']=utils['now']();channels[_0x57a00b[_0xaa34('0x6')]][_0xaa34('0x31')]=utils['diffTime'](channels[_0x57a00b['uniqueid']][_0xaa34('0x32')],channels[_0x57a00b[_0xaa34('0x6')]][_0xaa34('0x33')]);channels[_0x57a00b[_0xaa34('0x6')]][_0xaa34('0x34')]=channels[_0x57a00b[_0xaa34('0x6')]]['answertime']?utils[_0xaa34('0x35')](channels[_0x57a00b[_0xaa34('0x6')]][_0xaa34('0x32')],channels[_0x57a00b[_0xaa34('0x6')]]['answertime']):0x0;writeDB(channels[_0x57a00b[_0xaa34('0x6')]]);}}catch(_0x4e46cc){utils[_0xaa34('0x1f')](util['format'](_0xaa34('0x2c'),_0x57a00b[_0xaa34('0x6')]),_0x4e46cc);}};exports[_0xaa34('0x36')]=function(_0x34f9e8){try{if(!_[_0xaa34('0x21')](channels[_0x34f9e8[_0xaa34('0x37')]])){utils['debug'](util['format'](_0xaa34('0x38'),_0x34f9e8[_0xaa34('0x39')]),_0x34f9e8);if(channels[_0x34f9e8[_0xaa34('0x37')]][_0xaa34('0xa')]==_0x34f9e8[_0xaa34('0x3a')]){utils[_0xaa34('0x19')](util[_0xaa34('0x8')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x34f9e8[_0xaa34('0x39')],_0x34f9e8[_0xaa34('0x37')],_0x34f9e8[_0xaa34('0x3b')]));channels[_0x34f9e8[_0xaa34('0x37')]]['destinationchannel']=_0x34f9e8[_0xaa34('0x3b')];channels[_0x34f9e8[_0xaa34('0x37')]][_0xaa34('0x3c')]=_0xaa34('0x3d');}else if(channels[_0x34f9e8[_0xaa34('0x37')]][_0xaa34('0xa')]=_0x34f9e8['transfertargetchannel']){utils['info'](util[_0xaa34('0x8')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x34f9e8[_0xaa34('0x39')],_0x34f9e8[_0xaa34('0x37')],_0x34f9e8[_0xaa34('0x3e')]));channels[_0x34f9e8[_0xaa34('0x37')]][_0xaa34('0x26')]=_0x34f9e8[_0xaa34('0x3e')];channels[_0x34f9e8[_0xaa34('0x37')]][_0xaa34('0x3c')]=_0xaa34('0x3d');}}}catch(_0x2ff1f2){utils[_0xaa34('0x1f')](util['format'](_0xaa34('0x38'),_0x34f9e8['origtransfereruniqueid']),_0x2ff1f2);}};exports[_0xaa34('0x3f')]=function(_0x3bb18d){try{if(!_[_0xaa34('0x21')](channels[_0x3bb18d[_0xaa34('0x6')]])){utils[_0xaa34('0x16')](util[_0xaa34('0x8')](_0xaa34('0x40'),_0x3bb18d[_0xaa34('0x6')]),_0x3bb18d);channels[_0x3bb18d['uniqueid']]['musiconholdstartAt']=utils[_0xaa34('0x1d')]();utils[_0xaa34('0x19')](util[_0xaa34('0x8')](_0xaa34('0x41'),_0x3bb18d['uniqueid'],channels[_0x3bb18d['uniqueid']]['musiconholdstartAt']));}}catch(_0x2dc08a){utils[_0xaa34('0x1f')](util[_0xaa34('0x8')](_0xaa34('0x40'),_0x3bb18d[_0xaa34('0x6')]),_0x2dc08a);}};exports[_0xaa34('0x42')]=function(_0x12d112){try{if(!_[_0xaa34('0x21')](channels[_0x12d112[_0xaa34('0x6')]])){utils['debug'](util['format'](_0xaa34('0x43'),_0x12d112['uniqueid']),_0x12d112);if(!_[_0xaa34('0x21')](channels[_0x12d112[_0xaa34('0x6')]][_0xaa34('0x44')])){channels[_0x12d112[_0xaa34('0x6')]]['mohtime']+=utils[_0xaa34('0x35')](utils[_0xaa34('0x1d')](),channels[_0x12d112[_0xaa34('0x6')]][_0xaa34('0x44')]);utils[_0xaa34('0x19')](util[_0xaa34('0x8')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x12d112[_0xaa34('0x6')],channels[_0x12d112[_0xaa34('0x6')]][_0xaa34('0x45')]));delete channels[_0x12d112[_0xaa34('0x6')]][_0xaa34('0x44')];}}}catch(_0x23ef00){utils[_0xaa34('0x1f')](util[_0xaa34('0x8')](_0xaa34('0x43'),_0x12d112[_0xaa34('0x6')]),_0x23ef00);}};exports[_0xaa34('0x46')]=function(_0x4bad49){try{if(!_[_0xaa34('0x21')](channels[_0x4bad49[_0xaa34('0x6')]])){utils[_0xaa34('0x16')](util[_0xaa34('0x8')]('[%s][calls][varset]',_0x4bad49['uniqueid']),_0x4bad49);if(!_['isNil'](_0x4bad49[_0xaa34('0x47')][_0xaa34('0x48')])){utils[_0xaa34('0x19')](util[_0xaa34('0x8')](_0xaa34('0x49'),_0x4bad49[_0xaa34('0x6')],_0x4bad49['value']));channels[_0x4bad49['uniqueid']][_0xaa34('0x4a')]=_0x4bad49[_0xaa34('0x4b')];}if(!_[_0xaa34('0x21')](_0x4bad49['variable'][_0xaa34('0x4c')])){utils[_0xaa34('0x19')](util[_0xaa34('0x8')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x4bad49[_0xaa34('0x6')],_0x4bad49[_0xaa34('0x4b')]));channels[_0x4bad49[_0xaa34('0x6')]]['destination']=_0x4bad49[_0xaa34('0x4b')];channels[_0x4bad49['uniqueid']][_0xaa34('0x2d')]='\x22'+_0x4bad49[_0xaa34('0x4b')]+'\x22\x20<'+_0x4bad49[_0xaa34('0x4b')]+'>';}if(!_[_0xaa34('0x21')](_0x4bad49[_0xaa34('0x47')][_0xaa34('0x4d')])||!_['isNil'](_0x4bad49['variable'][_0xaa34('0x4e')])){utils[_0xaa34('0x19')](util[_0xaa34('0x8')](_0xaa34('0x4f'),_0x4bad49[_0xaa34('0x6')],!_[_0xaa34('0x21')](_0x4bad49['variable']['xmd-callerid-preview'])?'xmd-callerid-preview':'xmd-callerid',_0x4bad49[_0xaa34('0x4b')]));channels[_0x4bad49[_0xaa34('0x6')]][_0xaa34('0x2d')]=_0x4bad49[_0xaa34('0x4b')];}if(!_['isNil'](_0x4bad49[_0xaa34('0x47')][_0xaa34('0x50')])||!_[_0xaa34('0x21')](_0x4bad49[_0xaa34('0x47')]['xmcs-queue'])){utils[_0xaa34('0x19')](util[_0xaa34('0x8')](_0xaa34('0x4f'),_0x4bad49[_0xaa34('0x6')],!_[_0xaa34('0x21')](_0x4bad49[_0xaa34('0x47')]['xmd-queue'])?_0xaa34('0x50'):'xmcs-queue',_0x4bad49[_0xaa34('0x4b')]));channels[_0x4bad49['uniqueid']]['lastapplication']='Queue';channels[_0x4bad49[_0xaa34('0x6')]][_0xaa34('0x51')]=_0x4bad49[_0xaa34('0x4b')];channels[_0x4bad49['uniqueid']][_0xaa34('0xb')]=!![];}if(!_[_0xaa34('0x21')](_0x4bad49['variable']['xmd-contactid'])){utils[_0xaa34('0x19')](util[_0xaa34('0x8')](_0xaa34('0x52'),_0x4bad49[_0xaa34('0x6')],_0x4bad49[_0xaa34('0x4b')]));channels[_0x4bad49[_0xaa34('0x6')]]['ContactId']=_0x4bad49[_0xaa34('0x4b')];}if(!_[_0xaa34('0x21')](_0x4bad49[_0xaa34('0x47')][_0xaa34('0x53')])){utils[_0xaa34('0x19')](util[_0xaa34('0x8')](_0xaa34('0x54'),_0x4bad49[_0xaa34('0x6')],_0x4bad49[_0xaa34('0x4b')]));channels[_0x4bad49[_0xaa34('0x6')]]['type']=_0x4bad49[_0xaa34('0x4b')];}if(!_['isNil'](_0x4bad49[_0xaa34('0x47')]['outboundrouteid'])){utils[_0xaa34('0x19')](util[_0xaa34('0x8')](_0xaa34('0x55'),_0x4bad49[_0xaa34('0x6')],_0x4bad49[_0xaa34('0x4b')]));channels[_0x4bad49['uniqueid']][_0xaa34('0x56')]=_0x4bad49[_0xaa34('0x4b')];}if(!_[_0xaa34('0x21')](_0x4bad49[_0xaa34('0x47')][_0xaa34('0x57')])){utils['info'](util[_0xaa34('0x8')](_0xaa34('0x58'),_0x4bad49['uniqueid'],_0x4bad49['value']));channels[_0x4bad49[_0xaa34('0x6')]][_0xaa34('0x57')]=_0x4bad49[_0xaa34('0x4b')];}}}catch(_0x40157b){utils[_0xaa34('0x1f')](util['format'](_0xaa34('0x59'),_0x4bad49[_0xaa34('0x6')]),_0x40157b);}};exports['newexten']=function(_0x267633){try{if(!_[_0xaa34('0x21')](channels[_0x267633[_0xaa34('0x6')]])){utils[_0xaa34('0x16')](util['format'](_0xaa34('0x5a'),_0x267633[_0xaa34('0x6')]),_0x267633);utils[_0xaa34('0x19')](util[_0xaa34('0x8')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x267633[_0xaa34('0x6')],_0x267633['application'],_0x267633['appdata']));if(_0x267633[_0xaa34('0x5b')][_0xaa34('0x5c')]()==_0xaa34('0x5d')&&_['startsWith'](_0x267633['appdata'][_0xaa34('0x5c')](),_0xaa34('0x5e'))){var _0x18267b=_0x267633[_0xaa34('0x5f')][_0xaa34('0x60')]('=');var _0x22b349=_0x18267b[0x0][_0xaa34('0x61')](_0x18267b[0x0]['lastIndexOf']('(')+0x1,_0x18267b[0x0][_0xaa34('0x62')](')'));var _0x4b5a6f=_0x18267b[0x1];channels[_0x267633[_0xaa34('0x6')]][_0x22b349]=_0x4b5a6f;}if(!_[_0xaa34('0x63')]([_0xaa34('0x2b'),_0xaa34('0x64'),_0xaa34('0x65'),'set',_0xaa34('0x66')],_0x267633[_0xaa34('0x5b')][_0xaa34('0x5c')]())){channels[_0x267633[_0xaa34('0x6')]][_0xaa34('0x67')]=_0x267633[_0xaa34('0x5b')];channels[_0x267633[_0xaa34('0x6')]]['lastdata']=_0x267633['appdata'];}}}catch(_0x308a0a){utils[_0xaa34('0x1f')](util[_0xaa34('0x8')](_0xaa34('0x5a'),_0x267633[_0xaa34('0x6')]),_0x308a0a);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 1330883..1676602 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 _0xb5cb=['connect','shutdown','info','[core]\x20shutdown','fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent'];(function(_0x21ca26,_0x5f20a4){var _0x482fa5=function(_0x3697bb){while(--_0x3697bb){_0x21ca26['push'](_0x21ca26['shift']());}};_0x482fa5(++_0x5f20a4);}(_0xb5cb,0xdc));var _0xbb5c=function(_0x16172c,_0x663378){_0x16172c=_0x16172c-0x0;var _0x2a633a=_0xb5cb[_0x16172c];return _0x2a633a;};'use strict';var utils=require('./utils');exports[_0xbb5c('0x0')]=function(){utils['info']('[core]\x20connected');};exports[_0xbb5c('0x1')]=function(){utils[_0xbb5c('0x2')](_0xbb5c('0x3'));};exports[_0xbb5c('0x4')]=function(){utils[_0xbb5c('0x2')]('[core]\x20fullybooted');};exports[_0xbb5c('0x5')]=function(_0x5b6100){utils[_0xbb5c('0x5')](_0xbb5c('0x6'),_0x5b6100);};exports[_0xbb5c('0x7')]=function(){utils[_0xbb5c('0x2')](_0xbb5c('0x8'));};exports[_0xbb5c('0x9')]=function(_0x4d857f){}; \ No newline at end of file +var _0xd7ad=['shutdown','info','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','close','managerevent','./utils','connect'];(function(_0x487870,_0x527924){var _0x3ab6af=function(_0x1febe3){while(--_0x1febe3){_0x487870['push'](_0x487870['shift']());}};_0x3ab6af(++_0x527924);}(_0xd7ad,0x15c));var _0xdd7a=function(_0x903228,_0x42c429){_0x903228=_0x903228-0x0;var _0xcec81d=_0xd7ad[_0x903228];return _0xcec81d;};'use strict';var utils=require(_0xdd7a('0x0'));exports[_0xdd7a('0x1')]=function(){utils['info']('[core]\x20connected');};exports[_0xdd7a('0x2')]=function(){utils[_0xdd7a('0x3')](_0xdd7a('0x4'));};exports[_0xdd7a('0x5')]=function(){utils['info'](_0xdd7a('0x6'));};exports[_0xdd7a('0x7')]=function(_0x46f9c7){utils[_0xdd7a('0x7')]('[core]\x20error',_0x46f9c7);};exports[_0xdd7a('0x8')]=function(){utils[_0xdd7a('0x3')]('[core]\x20close');};exports[_0xdd7a('0x9')]=function(_0x3263d9){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 83dfbef..ba345b8 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 _0xcf39=['set','startsWith','error','debug','[%s][dials][varset]','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','isNil','[%s][dials][dialbegin]','assign','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','dialend','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridnum','calleridname','complete','duration','diffTime','endtime','holdtime','billableseconds','lodash','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','dialstring','connectedlinenum','dialstatus','request','newexten','appdata','application','toLowerCase'];(function(_0x36ce80,_0xe65226){var _0x1302b2=function(_0x1b2171){while(--_0x1b2171){_0x36ce80['push'](_0x36ce80['shift']());}};_0x1302b2(++_0xe65226);}(_0xcf39,0xe1));var _0x9cf3=function(_0xc9b9f3,_0x4b96c4){_0xc9b9f3=_0xc9b9f3-0x0;var _0x2e4a9a=_0xcf39[_0xc9b9f3];return _0x2e4a9a;};'use strict';var _=require(_0x9cf3('0x0'));var util=require(_0x9cf3('0x1'));var utils=require(_0x9cf3('0x2'));var dials={};function writeDB(_0x27bcbb){utils[_0x9cf3('0x3')](util[_0x9cf3('0x4')](_0x9cf3('0x5'),_0x27bcbb[_0x9cf3('0x6')],_0x27bcbb['channel'],_0x27bcbb[_0x9cf3('0x7')],_0x27bcbb['calleridnum'],_0x27bcbb[_0x9cf3('0x8')],_0x27bcbb[_0x9cf3('0x9')]));utils[_0x9cf3('0xa')]('CreateVoiceDialReport',_0x27bcbb);delete dials[_0x27bcbb[_0x9cf3('0x6')]];}exports[_0x9cf3('0xb')]=function(_0x27be4a){try{utils['debug'](util[_0x9cf3('0x4')]('[%s][dials][newexten]',_0x27be4a[_0x9cf3('0x6')]),_0x27be4a);utils[_0x9cf3('0x3')](util[_0x9cf3('0x4')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x27be4a[_0x9cf3('0x6')],_0x27be4a['application'],_0x27be4a[_0x9cf3('0xc')]));if(_0x27be4a[_0x9cf3('0xd')][_0x9cf3('0xe')]()==_0x9cf3('0xf')&&_[_0x9cf3('0x10')](_0x27be4a[_0x9cf3('0xc')][_0x9cf3('0xe')](),'cdr(routeid)')){var _0x497e55=_0x27be4a[_0x9cf3('0xc')]['split']('=');dials[_0x27be4a[_0x9cf3('0x6')]]={'routeId':_0x497e55[0x1]};}}catch(_0x1c44ff){utils[_0x9cf3('0x11')](util[_0x9cf3('0x4')]('[%s][dials][newexten]',_0x27be4a[_0x9cf3('0x6')]),_0x1c44ff);}};exports['varset']=function(_0x8df497){try{utils[_0x9cf3('0x12')](util['format'](_0x9cf3('0x13'),_0x8df497[_0x9cf3('0x6')]),_0x8df497);if(!_['isNil'](_0x8df497['variable'][_0x9cf3('0x14')])){utils['info'](util[_0x9cf3('0x4')](_0x9cf3('0x15'),_0x8df497[_0x9cf3('0x6')],_0x8df497[_0x9cf3('0x16')]));dials[_0x8df497['uniqueid']]={'routeId':_0x8df497[_0x9cf3('0x16')]};}}catch(_0x384650){utils['error'](util[_0x9cf3('0x4')](_0x9cf3('0x13'),_0x8df497[_0x9cf3('0x6')]),_0x384650);}};exports[_0x9cf3('0x17')]=function(_0x2da735){try{if(!_[_0x9cf3('0x18')](dials[_0x2da735[_0x9cf3('0x6')]])){utils[_0x9cf3('0x12')](util[_0x9cf3('0x4')](_0x9cf3('0x19'),_0x2da735[_0x9cf3('0x6')]),_0x2da735);dials[_0x2da735[_0x9cf3('0x6')]]=_[_0x9cf3('0x1a')](dials[_0x2da735[_0x9cf3('0x6')]],_0x2da735);dials[_0x2da735[_0x9cf3('0x6')]]['starttime']=utils[_0x9cf3('0x1b')]();dials[_0x2da735[_0x9cf3('0x6')]][_0x9cf3('0x1c')]=_0x9cf3('0x1d');utils['info'](util[_0x9cf3('0x4')](_0x9cf3('0x1e'),_0x2da735[_0x9cf3('0x6')],dials[_0x2da735[_0x9cf3('0x6')]][_0x9cf3('0x1f')]));}}catch(_0x417623){utils[_0x9cf3('0x11')](util['format']('[%s][dials][dialbegin]',_0x2da735['uniqueid']),_0x417623);}};exports[_0x9cf3('0x20')]=function(_0x846b16){try{if(!_['isNil'](dials[_0x846b16[_0x9cf3('0x6')]])){utils['debug'](util[_0x9cf3('0x4')]('[%s][dials][dialend]',_0x846b16[_0x9cf3('0x6')]),_0x846b16);dials[_0x846b16[_0x9cf3('0x6')]][_0x9cf3('0x9')]=_0x846b16[_0x9cf3('0x9')];if(_0x846b16['dialstatus']=='ANSWER'){dials[_0x846b16[_0x9cf3('0x6')]]=_[_0x9cf3('0x1a')](dials[_0x846b16[_0x9cf3('0x6')]],_0x846b16);dials[_0x846b16['uniqueid']][_0x9cf3('0x21')]=utils[_0x9cf3('0x1b')]();dials[_0x846b16['uniqueid']][_0x9cf3('0x1c')]=_0x9cf3('0x22');utils[_0x9cf3('0x3')](util[_0x9cf3('0x4')](_0x9cf3('0x23'),_0x846b16[_0x9cf3('0x6')],_0x846b16[_0x9cf3('0x9')],dials[_0x846b16[_0x9cf3('0x6')]][_0x9cf3('0x21')]));}else{utils[_0x9cf3('0x3')](util[_0x9cf3('0x4')](_0x9cf3('0x24'),_0x846b16['uniqueid'],_0x846b16[_0x9cf3('0x9')]));}}}catch(_0x1234dc){utils['error'](util[_0x9cf3('0x4')](_0x9cf3('0x25'),_0x846b16[_0x9cf3('0x6')]),_0x1234dc);}};exports['hangup']=function(_0x288e60){try{if(!_[_0x9cf3('0x18')](dials[_0x288e60[_0x9cf3('0x6')]])){utils[_0x9cf3('0x12')](util[_0x9cf3('0x4')](_0x9cf3('0x26'),_0x288e60[_0x9cf3('0x6')]),_0x288e60);utils[_0x9cf3('0x3')](util[_0x9cf3('0x4')](_0x9cf3('0x27'),_0x288e60[_0x9cf3('0x6')],_0x288e60[_0x9cf3('0x28')],_0x288e60[_0x9cf3('0x29')],_0x288e60['cause-txt']));dials[_0x288e60['uniqueid']]=_[_0x9cf3('0x1a')](dials[_0x288e60[_0x9cf3('0x6')]],{'endtime':utils['now'](),'lastevent':_0x9cf3('0x2a')});dials[_0x288e60['uniqueid']][_0x9cf3('0x2b')]=utils[_0x9cf3('0x2c')](dials[_0x288e60[_0x9cf3('0x6')]][_0x9cf3('0x2d')],dials[_0x288e60[_0x9cf3('0x6')]][_0x9cf3('0x1f')]);dials[_0x288e60[_0x9cf3('0x6')]][_0x9cf3('0x2e')]=utils[_0x9cf3('0x2c')](dials[_0x288e60[_0x9cf3('0x6')]]['answertime']||dials[_0x288e60[_0x9cf3('0x6')]][_0x9cf3('0x2d')],dials[_0x288e60[_0x9cf3('0x6')]][_0x9cf3('0x1f')]);dials[_0x288e60[_0x9cf3('0x6')]][_0x9cf3('0x2f')]=dials[_0x288e60[_0x9cf3('0x6')]][_0x9cf3('0x21')]?utils[_0x9cf3('0x2c')](dials[_0x288e60[_0x9cf3('0x6')]][_0x9cf3('0x2d')],dials[_0x288e60[_0x9cf3('0x6')]][_0x9cf3('0x21')]):0x0;writeDB(dials[_0x288e60[_0x9cf3('0x6')]]);}}catch(_0x350e68){utils['error'](util[_0x9cf3('0x4')](_0x9cf3('0x26'),_0x288e60[_0x9cf3('0x6')]),_0x350e68);}}; \ No newline at end of file +var _0x500b=['isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','endtime','diffTime','billableseconds','[%s][dials][hangup]','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','uniqueid','newexten','debug','[%s][dials][newexten]','application','toLowerCase','cdr(routeid)','appdata','error','varset','[%s][dials][varset]'];(function(_0x353753,_0x2658f3){var _0x89b646=function(_0x1e2cba){while(--_0x1e2cba){_0x353753['push'](_0x353753['shift']());}};_0x89b646(++_0x2658f3);}(_0x500b,0x110));var _0xb500=function(_0x58ee96,_0x5affd5){_0x58ee96=_0x58ee96-0x0;var _0xb346aa=_0x500b[_0x58ee96];return _0xb346aa;};'use strict';var _=require('lodash');var util=require(_0xb500('0x0'));var utils=require(_0xb500('0x1'));var dials={};function writeDB(_0x4c35f0){utils[_0xb500('0x2')](util[_0xb500('0x3')](_0xb500('0x4'),_0x4c35f0['uniqueid'],_0x4c35f0['channel'],_0x4c35f0[_0xb500('0x5')],_0x4c35f0[_0xb500('0x6')],_0x4c35f0[_0xb500('0x7')],_0x4c35f0[_0xb500('0x8')]));utils[_0xb500('0x9')](_0xb500('0xa'),_0x4c35f0);delete dials[_0x4c35f0[_0xb500('0xb')]];}exports[_0xb500('0xc')]=function(_0x4c8435){try{utils[_0xb500('0xd')](util[_0xb500('0x3')](_0xb500('0xe'),_0x4c8435[_0xb500('0xb')]),_0x4c8435);utils['info'](util[_0xb500('0x3')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x4c8435[_0xb500('0xb')],_0x4c8435[_0xb500('0xf')],_0x4c8435['appdata']));if(_0x4c8435['application'][_0xb500('0x10')]()=='set'&&_['startsWith'](_0x4c8435['appdata'][_0xb500('0x10')](),_0xb500('0x11'))){var _0x499beb=_0x4c8435[_0xb500('0x12')]['split']('=');dials[_0x4c8435[_0xb500('0xb')]]={'routeId':_0x499beb[0x1]};}}catch(_0x5a77e2){utils[_0xb500('0x13')](util[_0xb500('0x3')]('[%s][dials][newexten]',_0x4c8435['uniqueid']),_0x5a77e2);}};exports[_0xb500('0x14')]=function(_0x51aff3){try{utils[_0xb500('0xd')](util[_0xb500('0x3')](_0xb500('0x15'),_0x51aff3[_0xb500('0xb')]),_0x51aff3);if(!_[_0xb500('0x16')](_0x51aff3[_0xb500('0x17')][_0xb500('0x18')])){utils[_0xb500('0x2')](util['format'](_0xb500('0x19'),_0x51aff3[_0xb500('0xb')],_0x51aff3[_0xb500('0x1a')]));dials[_0x51aff3[_0xb500('0xb')]]={'routeId':_0x51aff3[_0xb500('0x1a')]};}}catch(_0x54b71f){utils[_0xb500('0x13')](util[_0xb500('0x3')]('[%s][dials][varset]',_0x51aff3['uniqueid']),_0x54b71f);}};exports['dialbegin']=function(_0x185540){try{if(!_[_0xb500('0x16')](dials[_0x185540[_0xb500('0xb')]])){utils['debug'](util['format'](_0xb500('0x1b'),_0x185540[_0xb500('0xb')]),_0x185540);dials[_0x185540[_0xb500('0xb')]]=_[_0xb500('0x1c')](dials[_0x185540[_0xb500('0xb')]],_0x185540);dials[_0x185540[_0xb500('0xb')]][_0xb500('0x1d')]=utils[_0xb500('0x1e')]();dials[_0x185540[_0xb500('0xb')]][_0xb500('0x1f')]=_0xb500('0x20');utils[_0xb500('0x2')](util[_0xb500('0x3')](_0xb500('0x21'),_0x185540[_0xb500('0xb')],dials[_0x185540['uniqueid']][_0xb500('0x1d')]));}}catch(_0x11f644){utils['error'](util['format'](_0xb500('0x1b'),_0x185540[_0xb500('0xb')]),_0x11f644);}};exports[_0xb500('0x22')]=function(_0x1d98c2){try{if(!_[_0xb500('0x16')](dials[_0x1d98c2['uniqueid']])){utils[_0xb500('0xd')](util[_0xb500('0x3')](_0xb500('0x23'),_0x1d98c2[_0xb500('0xb')]),_0x1d98c2);dials[_0x1d98c2['uniqueid']][_0xb500('0x8')]=_0x1d98c2['dialstatus'];if(_0x1d98c2[_0xb500('0x8')]=='ANSWER'){dials[_0x1d98c2[_0xb500('0xb')]]=_[_0xb500('0x1c')](dials[_0x1d98c2[_0xb500('0xb')]],_0x1d98c2);dials[_0x1d98c2['uniqueid']][_0xb500('0x24')]=utils['now']();dials[_0x1d98c2[_0xb500('0xb')]][_0xb500('0x1f')]=_0xb500('0x25');utils[_0xb500('0x2')](util[_0xb500('0x3')](_0xb500('0x26'),_0x1d98c2[_0xb500('0xb')],_0x1d98c2[_0xb500('0x8')],dials[_0x1d98c2[_0xb500('0xb')]]['answertime']));}else{utils[_0xb500('0x2')](util[_0xb500('0x3')](_0xb500('0x27'),_0x1d98c2[_0xb500('0xb')],_0x1d98c2[_0xb500('0x8')]));}}}catch(_0x38b80e){utils[_0xb500('0x13')](util[_0xb500('0x3')](_0xb500('0x23'),_0x1d98c2['uniqueid']),_0x38b80e);}};exports[_0xb500('0x28')]=function(_0x4981e3){try{if(!_[_0xb500('0x16')](dials[_0x4981e3[_0xb500('0xb')]])){utils[_0xb500('0xd')](util[_0xb500('0x3')]('[%s][dials][hangup]',_0x4981e3[_0xb500('0xb')]),_0x4981e3);utils[_0xb500('0x2')](util[_0xb500('0x3')](_0xb500('0x29'),_0x4981e3[_0xb500('0xb')],_0x4981e3['calleridnum'],_0x4981e3[_0xb500('0x2a')],_0x4981e3[_0xb500('0x2b')]));dials[_0x4981e3[_0xb500('0xb')]]=_[_0xb500('0x1c')](dials[_0x4981e3['uniqueid']],{'endtime':utils[_0xb500('0x1e')](),'lastevent':_0xb500('0x2c')});dials[_0x4981e3[_0xb500('0xb')]]['duration']=utils['diffTime'](dials[_0x4981e3[_0xb500('0xb')]][_0xb500('0x2d')],dials[_0x4981e3[_0xb500('0xb')]]['starttime']);dials[_0x4981e3[_0xb500('0xb')]]['holdtime']=utils[_0xb500('0x2e')](dials[_0x4981e3['uniqueid']]['answertime']||dials[_0x4981e3['uniqueid']][_0xb500('0x2d')],dials[_0x4981e3[_0xb500('0xb')]]['starttime']);dials[_0x4981e3[_0xb500('0xb')]][_0xb500('0x2f')]=dials[_0x4981e3[_0xb500('0xb')]][_0xb500('0x24')]?utils['diffTime'](dials[_0x4981e3[_0xb500('0xb')]][_0xb500('0x2d')],dials[_0x4981e3[_0xb500('0xb')]][_0xb500('0x24')]):0x0;writeDB(dials[_0x4981e3['uniqueid']]);}}catch(_0x4f1cb9){utils[_0xb500('0x13')](util[_0xb500('0x3')](_0xb500('0x30'),_0x4981e3[_0xb500('0xb')]),_0x4f1cb9);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index a19f08b..02a4ee4 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 _0x6a12=['./core.controller','connect','shutdown','fullybooted','error','close','devicestatechange','debug','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','format','[%s][index][agentringnoanswer]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','asterisk','username','password','keepConnected','xdr','disabled','./agents.controller','./recordings.controller','./dials.controller','./transfers.controller'];(function(_0x5727e8,_0x89611a){var _0x5838cb=function(_0x29d636){while(--_0x29d636){_0x5727e8['push'](_0x5727e8['shift']());}};_0x5838cb(++_0x89611a);}(_0x6a12,0x183));var _0x26a1=function(_0x5b8241,_0x5e0318){_0x5b8241=_0x5b8241-0x0;var _0xa6f0a0=_0x6a12[_0x5b8241];return _0xa6f0a0;};var AsteriskManager=require(_0x26a1('0x0'));var config=require(_0x26a1('0x1'));var utils=require('./utils');var util=require('util');var ami=new AsteriskManager(config[_0x26a1('0x2')]['port'],config[_0x26a1('0x2')]['ip'],config[_0x26a1('0x2')][_0x26a1('0x3')],config[_0x26a1('0x2')][_0x26a1('0x4')],!![]);ami[_0x26a1('0x5')]();if(config[_0x26a1('0x6')]&&config[_0x26a1('0x6')][_0x26a1('0x7')]){utils['info']('XDR\x20DISABLED');}else{var agents=require(_0x26a1('0x8'));var calls=require('./calls.controller');var queues=require('./queues.controller');var recordings=require(_0x26a1('0x9'));var members=require('./members.controller');var dials=require(_0x26a1('0xa'));var transfers=require(_0x26a1('0xb'));var core=require(_0x26a1('0xc'));ami['on'](_0x26a1('0xd'),core['connect']);ami['on'](_0x26a1('0xe'),core[_0x26a1('0xe')]);ami['on'](_0x26a1('0xf'),core[_0x26a1('0xf')]);ami['on'](_0x26a1('0x10'),core[_0x26a1('0x10')]);ami['on'](_0x26a1('0x11'),core[_0x26a1('0x11')]);ami['on']('managerevent',core['managerevent']);ami['on'](_0x26a1('0x12'),function(_0x57e24b){try{utils[_0x26a1('0x13')](util['format'](_0x26a1('0x14'),_0x57e24b[_0x26a1('0x15')]),_0x57e24b);members[_0x26a1('0x12')](_0x57e24b);}catch(_0x4f7f81){utils[_0x26a1('0x10')](util['format'](_0x26a1('0x14'),_0x57e24b[_0x26a1('0x15')]),_0x4f7f81);}});ami['on'](_0x26a1('0x16'),function(_0x2906dd){try{utils[_0x26a1('0x13')](util['format'](_0x26a1('0x17'),_0x2906dd[_0x26a1('0x18')]),_0x2906dd);agents['agentcalled'](_0x2906dd);}catch(_0x2f90ed){utils[_0x26a1('0x10')](util[_0x26a1('0x19')](_0x26a1('0x17'),_0x2906dd[_0x26a1('0x18')]),_0x2f90ed);}});ami['on']('agentringnoanswer',function(_0x510cd9){try{utils[_0x26a1('0x13')](util['format'](_0x26a1('0x1a'),_0x510cd9[_0x26a1('0x18')]),_0x510cd9);agents['agentringnoanswer'](_0x510cd9);}catch(_0x536745){utils['error'](util['format']('[%s][index][agentringnoanswer]',_0x510cd9['uniqueid']),_0x536745);}});ami['on'](_0x26a1('0x1b'),function(_0x4f97dc){try{utils[_0x26a1('0x13')](util[_0x26a1('0x19')]('[%s][index][agentconnect]',_0x4f97dc[_0x26a1('0x18')]),_0x4f97dc);agents[_0x26a1('0x1b')](_0x4f97dc);queues[_0x26a1('0x1b')](_0x4f97dc);}catch(_0x4d3397){utils[_0x26a1('0x10')](util[_0x26a1('0x19')]('[%s][index][agentconnect]',_0x4f97dc[_0x26a1('0x18')]),_0x4d3397);}});ami['on'](_0x26a1('0x1c'),function(_0x3e43c7){try{utils[_0x26a1('0x13')](util[_0x26a1('0x19')](_0x26a1('0x1d'),_0x3e43c7[_0x26a1('0x18')]),_0x3e43c7);agents['agentcomplete'](_0x3e43c7);queues[_0x26a1('0x1c')](_0x3e43c7);members['agentcomplete'](_0x3e43c7);}catch(_0x2328bd){utils['error'](util['format']('[%s][index][agentcomplete]',_0x3e43c7[_0x26a1('0x18')]),_0x2328bd);}});ami['on'](_0x26a1('0x1e'),function(_0x19ba72){try{utils['debug'](util[_0x26a1('0x19')]('[%s][index][queuecallerabandon]',_0x19ba72[_0x26a1('0x18')]),_0x19ba72);agents[_0x26a1('0x1e')](_0x19ba72);queues['queuecallerabandon'](_0x19ba72);}catch(_0x473ca4){utils['error'](util[_0x26a1('0x19')]('[%s][index][queuecallerabandon]',_0x19ba72[_0x26a1('0x18')]),_0x473ca4);}});ami['on']('queuecallerjoin',function(_0x2ed870){try{utils[_0x26a1('0x13')](util[_0x26a1('0x19')]('[%s][index][queuecallerjoin]',_0x2ed870[_0x26a1('0x18')]),_0x2ed870);queues[_0x26a1('0x1f')](_0x2ed870);recordings[_0x26a1('0x1f')](_0x2ed870);}catch(_0x410b0c){utils[_0x26a1('0x10')](util[_0x26a1('0x19')]('[%s][index][queuecallerjoin]',_0x2ed870[_0x26a1('0x18')]),_0x410b0c);}});ami['on'](_0x26a1('0x20'),function(_0x2cb78b){try{utils[_0x26a1('0x13')](util[_0x26a1('0x19')](_0x26a1('0x21'),_0x2cb78b['uniqueid']),_0x2cb78b);queues[_0x26a1('0x20')](_0x2cb78b);}catch(_0xabda25){utils[_0x26a1('0x10')](util[_0x26a1('0x19')]('[%s][index][queuecallerleave]',_0x2cb78b[_0x26a1('0x18')]),_0xabda25);}});ami['on']('musiconholdstart',function(_0x36b3f8){try{utils[_0x26a1('0x13')](util['format']('[%s][index][musiconholdstart]',_0x36b3f8[_0x26a1('0x18')]),_0x36b3f8);queues[_0x26a1('0x22')](_0x36b3f8);calls[_0x26a1('0x22')](_0x36b3f8);}catch(_0x4375b7){utils[_0x26a1('0x10')](util[_0x26a1('0x19')](_0x26a1('0x23'),_0x36b3f8[_0x26a1('0x18')]),_0x4375b7);}});ami['on']('musiconholdstop',function(_0x441ebd){try{utils['debug'](util['format'](_0x26a1('0x24'),_0x441ebd[_0x26a1('0x18')]),_0x441ebd);queues[_0x26a1('0x25')](_0x441ebd);calls[_0x26a1('0x25')](_0x441ebd);}catch(_0x47e5ae){utils[_0x26a1('0x10')](util['format']('[%s][index][musiconholdstop]',_0x441ebd[_0x26a1('0x18')]),_0x47e5ae);}});ami['on']('newstate',function(_0x2680c4){try{utils['debug'](util[_0x26a1('0x19')](_0x26a1('0x26'),_0x2680c4[_0x26a1('0x18')]),_0x2680c4);calls['newstate'](_0x2680c4);recordings['newstate'](_0x2680c4);}catch(_0x14992d){utils[_0x26a1('0x10')](util['format'](_0x26a1('0x26'),_0x2680c4['uniqueid']),_0x14992d);}});ami['on'](_0x26a1('0x27'),function(_0x1b79e5){try{utils['debug'](util['format'](_0x26a1('0x28'),_0x1b79e5[_0x26a1('0x18')]),_0x1b79e5);calls['hangup'](_0x1b79e5);recordings['hangup'](_0x1b79e5);dials['hangup'](_0x1b79e5);agents[_0x26a1('0x27')](_0x1b79e5);queues['hangup'](_0x1b79e5);}catch(_0x2637ba){utils[_0x26a1('0x10')](util[_0x26a1('0x19')]('[%s][index][hangup]',_0x1b79e5[_0x26a1('0x18')]),_0x2637ba);}});ami['on'](_0x26a1('0x29'),function(_0x5620ee){try{utils[_0x26a1('0x13')](util['format'](_0x26a1('0x2a'),_0x5620ee['uniqueid']),_0x5620ee);members[_0x26a1('0x29')](_0x5620ee);}catch(_0x2770d7){utils[_0x26a1('0x10')](util[_0x26a1('0x19')](_0x26a1('0x2a'),_0x5620ee['uniqueid']),_0x2770d7);}});ami['on'](_0x26a1('0x2b'),function(_0x52a54b){try{utils[_0x26a1('0x13')](util[_0x26a1('0x19')](_0x26a1('0x2c'),_0x52a54b[_0x26a1('0x18')]),_0x52a54b);queues['blindtransfer'](_0x52a54b);agents['blindtransfer'](_0x52a54b);transfers[_0x26a1('0x2b')](_0x52a54b);}catch(_0x2dc8a5){utils[_0x26a1('0x10')](util[_0x26a1('0x19')](_0x26a1('0x2c'),_0x52a54b[_0x26a1('0x18')]),_0x2dc8a5);}});ami['on'](_0x26a1('0x2d'),function(_0x25df55){try{utils['debug'](util['format'](_0x26a1('0x2e'),_0x25df55[_0x26a1('0x2f')]),_0x25df55);queues[_0x26a1('0x2d')](_0x25df55);transfers[_0x26a1('0x2d')](_0x25df55);agents[_0x26a1('0x2d')](_0x25df55);calls[_0x26a1('0x2d')](_0x25df55);}catch(_0x310578){utils['error'](util[_0x26a1('0x19')]('[%s][index][attendedtransfer]',_0x25df55[_0x26a1('0x2f')]),_0x310578);}});ami['on']('varset',function(_0x27b085){try{utils[_0x26a1('0x13')](util['format']('[%s][index][varset]',_0x27b085[_0x26a1('0x18')]),_0x27b085);queues[_0x26a1('0x30')](_0x27b085);recordings[_0x26a1('0x30')](_0x27b085);calls[_0x26a1('0x30')](_0x27b085);dials[_0x26a1('0x30')](_0x27b085);}catch(_0x11bdd4){utils[_0x26a1('0x10')](util[_0x26a1('0x19')]('[%s][index][varset]',_0x27b085[_0x26a1('0x18')]),_0x11bdd4);}});ami['on'](_0x26a1('0x31'),function(_0x77d724){try{utils['debug'](util[_0x26a1('0x19')]('[%s][index][newexten]',_0x77d724[_0x26a1('0x18')]),_0x77d724);calls['newexten'](_0x77d724);recordings[_0x26a1('0x31')](_0x77d724);dials['newexten'](_0x77d724);}catch(_0xbe9f9e){utils[_0x26a1('0x10')](util['format']('[%s][index][newexten]',_0x77d724['uniqueid']),_0xbe9f9e);}});ami['on'](_0x26a1('0x32'),function(_0x43ddd8){try{utils[_0x26a1('0x13')](util['format'](_0x26a1('0x33'),_0x43ddd8['uniqueid']),_0x43ddd8);calls[_0x26a1('0x32')](_0x43ddd8);recordings[_0x26a1('0x32')](_0x43ddd8);}catch(_0x3b9bbb){utils[_0x26a1('0x10')](util['format'](_0x26a1('0x33'),_0x43ddd8[_0x26a1('0x18')]),_0x3b9bbb);}});ami['on'](_0x26a1('0x34'),function(_0x3d1f02){try{utils[_0x26a1('0x13')](util[_0x26a1('0x19')](_0x26a1('0x35'),_0x3d1f02[_0x26a1('0x18')]),_0x3d1f02);dials['dialbegin'](_0x3d1f02);}catch(_0x176e23){utils[_0x26a1('0x10')](util[_0x26a1('0x19')](_0x26a1('0x36'),_0x3d1f02[_0x26a1('0x18')]),_0x176e23);}});ami['on'](_0x26a1('0x37'),function(_0xd7ecea){try{utils['debug'](util[_0x26a1('0x19')](_0x26a1('0x38'),_0xd7ecea[_0x26a1('0x18')]),_0xd7ecea);dials[_0x26a1('0x37')](_0xd7ecea);}catch(_0x27a277){utils['error'](util[_0x26a1('0x19')]('[%s][index][dialend]',_0xd7ecea[_0x26a1('0x18')]),_0x27a277);}});} \ No newline at end of file +var _0x4c65=['[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','[%s][index][newchannel]','newchannel','[%s][index][dialbegin]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','port','asterisk','username','password','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./calls.controller','./queues.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','[%s][index][agentcalled]','agentcalled','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart'];(function(_0x439d59,_0x11ccdf){var _0x3670c7=function(_0x11cfcb){while(--_0x11cfcb){_0x439d59['push'](_0x439d59['shift']());}};_0x3670c7(++_0x11ccdf);}(_0x4c65,0xeb));var _0x54c6=function(_0xc6c6cf,_0x5e477d){_0xc6c6cf=_0xc6c6cf-0x0;var _0x1b1580=_0x4c65[_0xc6c6cf];return _0x1b1580;};var AsteriskManager=require(_0x54c6('0x0'));var config=require(_0x54c6('0x1'));var utils=require(_0x54c6('0x2'));var util=require(_0x54c6('0x3'));var ami=new AsteriskManager(config['asterisk'][_0x54c6('0x4')],config[_0x54c6('0x5')]['ip'],config[_0x54c6('0x5')][_0x54c6('0x6')],config[_0x54c6('0x5')][_0x54c6('0x7')],!![]);ami[_0x54c6('0x8')]();if(config['xdr']&&config[_0x54c6('0x9')][_0x54c6('0xa')]){utils[_0x54c6('0xb')](_0x54c6('0xc'));}else{var agents=require('./agents.controller');var calls=require(_0x54c6('0xd'));var queues=require(_0x54c6('0xe'));var recordings=require('./recordings.controller');var members=require('./members.controller');var dials=require(_0x54c6('0xf'));var transfers=require(_0x54c6('0x10'));var core=require(_0x54c6('0x11'));ami['on'](_0x54c6('0x12'),core[_0x54c6('0x12')]);ami['on'](_0x54c6('0x13'),core[_0x54c6('0x13')]);ami['on'](_0x54c6('0x14'),core[_0x54c6('0x14')]);ami['on'](_0x54c6('0x15'),core['error']);ami['on'](_0x54c6('0x16'),core[_0x54c6('0x16')]);ami['on'](_0x54c6('0x17'),core['managerevent']);ami['on'](_0x54c6('0x18'),function(_0x6fbb45){try{utils[_0x54c6('0x19')](util[_0x54c6('0x1a')](_0x54c6('0x1b'),_0x6fbb45[_0x54c6('0x1c')]),_0x6fbb45);members[_0x54c6('0x18')](_0x6fbb45);}catch(_0x244974){utils['error'](util[_0x54c6('0x1a')](_0x54c6('0x1b'),_0x6fbb45['device']),_0x244974);}});ami['on']('agentcalled',function(_0x427d02){try{utils['debug'](util[_0x54c6('0x1a')](_0x54c6('0x1d'),_0x427d02['uniqueid']),_0x427d02);agents[_0x54c6('0x1e')](_0x427d02);}catch(_0x54e393){utils['error'](util['format'](_0x54c6('0x1d'),_0x427d02[_0x54c6('0x1f')]),_0x54e393);}});ami['on'](_0x54c6('0x20'),function(_0x552112){try{utils[_0x54c6('0x19')](util[_0x54c6('0x1a')]('[%s][index][agentringnoanswer]',_0x552112[_0x54c6('0x1f')]),_0x552112);agents['agentringnoanswer'](_0x552112);}catch(_0x453168){utils['error'](util[_0x54c6('0x1a')](_0x54c6('0x21'),_0x552112[_0x54c6('0x1f')]),_0x453168);}});ami['on']('agentconnect',function(_0x5a2e68){try{utils[_0x54c6('0x19')](util[_0x54c6('0x1a')]('[%s][index][agentconnect]',_0x5a2e68[_0x54c6('0x1f')]),_0x5a2e68);agents[_0x54c6('0x22')](_0x5a2e68);queues['agentconnect'](_0x5a2e68);}catch(_0x34e5f0){utils[_0x54c6('0x15')](util[_0x54c6('0x1a')](_0x54c6('0x23'),_0x5a2e68[_0x54c6('0x1f')]),_0x34e5f0);}});ami['on']('agentcomplete',function(_0x2b5444){try{utils[_0x54c6('0x19')](util[_0x54c6('0x1a')](_0x54c6('0x24'),_0x2b5444[_0x54c6('0x1f')]),_0x2b5444);agents['agentcomplete'](_0x2b5444);queues[_0x54c6('0x25')](_0x2b5444);members[_0x54c6('0x25')](_0x2b5444);}catch(_0x441d3e){utils[_0x54c6('0x15')](util[_0x54c6('0x1a')](_0x54c6('0x24'),_0x2b5444['uniqueid']),_0x441d3e);}});ami['on'](_0x54c6('0x26'),function(_0x59e112){try{utils[_0x54c6('0x19')](util[_0x54c6('0x1a')](_0x54c6('0x27'),_0x59e112['uniqueid']),_0x59e112);agents[_0x54c6('0x26')](_0x59e112);queues[_0x54c6('0x26')](_0x59e112);}catch(_0x90c965){utils[_0x54c6('0x15')](util[_0x54c6('0x1a')](_0x54c6('0x27'),_0x59e112[_0x54c6('0x1f')]),_0x90c965);}});ami['on'](_0x54c6('0x28'),function(_0x11c7b2){try{utils[_0x54c6('0x19')](util[_0x54c6('0x1a')](_0x54c6('0x29'),_0x11c7b2[_0x54c6('0x1f')]),_0x11c7b2);queues[_0x54c6('0x28')](_0x11c7b2);recordings[_0x54c6('0x28')](_0x11c7b2);}catch(_0x1aeebe){utils['error'](util['format']('[%s][index][queuecallerjoin]',_0x11c7b2[_0x54c6('0x1f')]),_0x1aeebe);}});ami['on'](_0x54c6('0x2a'),function(_0xff0c0){try{utils[_0x54c6('0x19')](util['format'](_0x54c6('0x2b'),_0xff0c0[_0x54c6('0x1f')]),_0xff0c0);queues['queuecallerleave'](_0xff0c0);}catch(_0x411ee3){utils[_0x54c6('0x15')](util[_0x54c6('0x1a')]('[%s][index][queuecallerleave]',_0xff0c0[_0x54c6('0x1f')]),_0x411ee3);}});ami['on'](_0x54c6('0x2c'),function(_0x1372a2){try{utils['debug'](util[_0x54c6('0x1a')](_0x54c6('0x2d'),_0x1372a2[_0x54c6('0x1f')]),_0x1372a2);queues[_0x54c6('0x2c')](_0x1372a2);calls['musiconholdstart'](_0x1372a2);}catch(_0x2c00f4){utils[_0x54c6('0x15')](util[_0x54c6('0x1a')]('[%s][index][musiconholdstart]',_0x1372a2[_0x54c6('0x1f')]),_0x2c00f4);}});ami['on'](_0x54c6('0x2e'),function(_0x2e3b68){try{utils[_0x54c6('0x19')](util[_0x54c6('0x1a')](_0x54c6('0x2f'),_0x2e3b68[_0x54c6('0x1f')]),_0x2e3b68);queues[_0x54c6('0x2e')](_0x2e3b68);calls[_0x54c6('0x2e')](_0x2e3b68);}catch(_0x475efd){utils[_0x54c6('0x15')](util['format'](_0x54c6('0x2f'),_0x2e3b68[_0x54c6('0x1f')]),_0x475efd);}});ami['on']('newstate',function(_0x335a9d){try{utils['debug'](util[_0x54c6('0x1a')](_0x54c6('0x30'),_0x335a9d[_0x54c6('0x1f')]),_0x335a9d);calls['newstate'](_0x335a9d);recordings[_0x54c6('0x31')](_0x335a9d);}catch(_0x2536bb){utils[_0x54c6('0x15')](util[_0x54c6('0x1a')]('[%s][index][newstate]',_0x335a9d[_0x54c6('0x1f')]),_0x2536bb);}});ami['on'](_0x54c6('0x32'),function(_0x17d13a){try{utils[_0x54c6('0x19')](util[_0x54c6('0x1a')](_0x54c6('0x33'),_0x17d13a[_0x54c6('0x1f')]),_0x17d13a);calls[_0x54c6('0x32')](_0x17d13a);recordings[_0x54c6('0x32')](_0x17d13a);dials[_0x54c6('0x32')](_0x17d13a);agents[_0x54c6('0x32')](_0x17d13a);queues[_0x54c6('0x32')](_0x17d13a);}catch(_0x38e7d8){utils[_0x54c6('0x15')](util[_0x54c6('0x1a')](_0x54c6('0x33'),_0x17d13a[_0x54c6('0x1f')]),_0x38e7d8);}});ami['on'](_0x54c6('0x34'),function(_0x90eec0){try{utils[_0x54c6('0x19')](util[_0x54c6('0x1a')](_0x54c6('0x35'),_0x90eec0[_0x54c6('0x1f')]),_0x90eec0);members[_0x54c6('0x34')](_0x90eec0);}catch(_0x3a4744){utils[_0x54c6('0x15')](util['format'](_0x54c6('0x35'),_0x90eec0[_0x54c6('0x1f')]),_0x3a4744);}});ami['on']('blindtransfer',function(_0x1fc8c7){try{utils['debug'](util[_0x54c6('0x1a')](_0x54c6('0x36'),_0x1fc8c7[_0x54c6('0x1f')]),_0x1fc8c7);queues[_0x54c6('0x37')](_0x1fc8c7);agents[_0x54c6('0x37')](_0x1fc8c7);transfers[_0x54c6('0x37')](_0x1fc8c7);}catch(_0xe82438){utils['error'](util['format']('[%s][index][blindtransfer]',_0x1fc8c7['uniqueid']),_0xe82438);}});ami['on'](_0x54c6('0x38'),function(_0x4860b3){try{utils['debug'](util[_0x54c6('0x1a')](_0x54c6('0x39'),_0x4860b3[_0x54c6('0x3a')]),_0x4860b3);queues['attendedtransfer'](_0x4860b3);transfers[_0x54c6('0x38')](_0x4860b3);agents['attendedtransfer'](_0x4860b3);calls[_0x54c6('0x38')](_0x4860b3);}catch(_0x345b7d){utils['error'](util['format'](_0x54c6('0x39'),_0x4860b3['origtransfereruniqueid']),_0x345b7d);}});ami['on'](_0x54c6('0x3b'),function(_0x2df048){try{utils['debug'](util[_0x54c6('0x1a')](_0x54c6('0x3c'),_0x2df048[_0x54c6('0x1f')]),_0x2df048);queues[_0x54c6('0x3b')](_0x2df048);recordings[_0x54c6('0x3b')](_0x2df048);calls[_0x54c6('0x3b')](_0x2df048);dials['varset'](_0x2df048);}catch(_0x611118){utils[_0x54c6('0x15')](util[_0x54c6('0x1a')]('[%s][index][varset]',_0x2df048[_0x54c6('0x1f')]),_0x611118);}});ami['on'](_0x54c6('0x3d'),function(_0x7eeded){try{utils['debug'](util[_0x54c6('0x1a')](_0x54c6('0x3e'),_0x7eeded[_0x54c6('0x1f')]),_0x7eeded);calls[_0x54c6('0x3d')](_0x7eeded);recordings[_0x54c6('0x3d')](_0x7eeded);dials[_0x54c6('0x3d')](_0x7eeded);}catch(_0x5da356){utils[_0x54c6('0x15')](util['format']('[%s][index][newexten]',_0x7eeded[_0x54c6('0x1f')]),_0x5da356);}});ami['on']('newchannel',function(_0x190117){try{utils[_0x54c6('0x19')](util['format'](_0x54c6('0x3f'),_0x190117['uniqueid']),_0x190117);calls['newchannel'](_0x190117);recordings[_0x54c6('0x40')](_0x190117);}catch(_0x507f15){utils['error'](util['format'](_0x54c6('0x3f'),_0x190117[_0x54c6('0x1f')]),_0x507f15);}});ami['on']('dialbegin',function(_0x1f4b25){try{utils[_0x54c6('0x19')](util[_0x54c6('0x1a')](_0x54c6('0x41'),_0x1f4b25[_0x54c6('0x1f')]),_0x1f4b25);dials[_0x54c6('0x42')](_0x1f4b25);}catch(_0x15a0c1){utils[_0x54c6('0x15')](util[_0x54c6('0x1a')](_0x54c6('0x43'),_0x1f4b25[_0x54c6('0x1f')]),_0x15a0c1);}});ami['on'](_0x54c6('0x44'),function(_0x43fbcf){try{utils[_0x54c6('0x19')](util[_0x54c6('0x1a')](_0x54c6('0x45'),_0x43fbcf[_0x54c6('0x1f')]),_0x43fbcf);dials[_0x54c6('0x44')](_0x43fbcf);}catch(_0x59b76d){utils['error'](util['format']('[%s][index][dialend]',_0x43fbcf[_0x54c6('0x1f')]),_0x59b76d);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 3987ebc..9a9ccd6 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 _0xb3ea=['catch','format','some','devicestatechange','debug','device','state','INUSE','BUSY','voice','TALKING','isNil','diffTime','exitAt','error','[%s][members][devicestatechange]','agentcomplete','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','[%s][members][agentcomplete]','cdr','[%s][members][cdr]','assign','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','lodash','util','./utils','Queue:','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','type','getUserByInterface','membername','internal','getUserByName','split','then','request','CreateMemberReport'];(function(_0x3c40f4,_0x500b8a){var _0x1209d=function(_0x46b429){while(--_0x46b429){_0x3c40f4['push'](_0x3c40f4['shift']());}};_0x1209d(++_0x500b8a);}(_0xb3ea,0x10d));var _0xab3e=function(_0x4e9a9f,_0x324d4f){_0x4e9a9f=_0x4e9a9f-0x0;var _0x47d7d9=_0xb3ea[_0x4e9a9f];return _0x47d7d9;};'use strict';var _=require(_0xab3e('0x0'));var util=require(_0xab3e('0x1'));var utils=require(_0xab3e('0x2'));var members={};var exclude=['Local/_attended@transfer',_0xab3e('0x3')];function writeDB(_0x4b9d20){utils[_0xab3e('0x4')](util['format'](_0xab3e('0x5'),_0x4b9d20[_0xab3e('0x6')],_0x4b9d20[_0xab3e('0x7')],_0x4b9d20[_0xab3e('0x8')],_0x4b9d20[_0xab3e('0x9')],_0x4b9d20['membername'],_0x4b9d20[_0xab3e('0xa')]));if(_0x4b9d20['interface']){utils[_0xab3e('0xb')](_0x4b9d20[_0xab3e('0x7')])['then'](function(_0x9169bb){if(_0x9169bb){_0x4b9d20[_0xab3e('0xc')]=_0x9169bb['name'];_0x4b9d20[_0xab3e('0xd')]=_0x9169bb[_0xab3e('0xd')];utils['request']('CreateMemberReport',_0x4b9d20);}else{utils[_0xab3e('0xe')](_0x4b9d20[_0xab3e('0x7')][_0xab3e('0xf')]('/')[0x1])[_0xab3e('0x10')](function(_0x31fc10){if(_0x31fc10){_0x4b9d20[_0xab3e('0xc')]=_0x31fc10['name'];_0x4b9d20['internal']=_0x31fc10['internal'];utils[_0xab3e('0x11')](_0xab3e('0x12'),_0x4b9d20);}});}})[_0xab3e('0x13')](function(_0x2394e6){utils['error'](util[_0xab3e('0x14')]('[%s][members][writeDB]',_0x4b9d20['uniqueid']),_0x2394e6);});}delete members[_0x4b9d20[_0xab3e('0x7')]];}function startsWith(_0x1cedbc,_0x4870e4){return _[_0xab3e('0x15')](_0x1cedbc,function(_0x161ff9){return _['startsWith'](_0x4870e4,_0x161ff9);});}exports[_0xab3e('0x16')]=function(_0x516b1d){try{utils[_0xab3e('0x17')](util['format']('[%s][members][devicestatechange]',members[_0x516b1d[_0xab3e('0x18')]]?members[_0x516b1d[_0xab3e('0x18')]][_0xab3e('0x6')]:_0x516b1d[_0xab3e('0x18')]),_0x516b1d);utils[_0xab3e('0x4')](util[_0xab3e('0x14')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x516b1d[_0xab3e('0x18')]]?members[_0x516b1d[_0xab3e('0x18')]][_0xab3e('0x6')]:_0x516b1d['device'],_0x516b1d[_0xab3e('0x19')],_0x516b1d[_0xab3e('0x18')]));switch(_0x516b1d[_0xab3e('0x19')]){case _0xab3e('0x1a'):case _0xab3e('0x1b'):if(!startsWith(exclude,_0x516b1d[_0xab3e('0x18')])){members[_0x516b1d[_0xab3e('0x18')]]={'channel':_0xab3e('0x1c'),'interface':_0x516b1d[_0xab3e('0x18')],'type':_0xab3e('0x1d'),'enterAt':utils['now'](),'role':'agent'};}break;case'NOT_INUSE':if(!_[_0xab3e('0x1e')](members[_0x516b1d[_0xab3e('0x18')]])){members[_0x516b1d['device']]['exitAt']=utils['now']();members[_0x516b1d[_0xab3e('0x18')]]['duration']=utils[_0xab3e('0x1f')](members[_0x516b1d['device']][_0xab3e('0x20')],members[_0x516b1d[_0xab3e('0x18')]]['enterAt']);if(members[_0x516b1d[_0xab3e('0x18')]]['uniqueid']){writeDB(members[_0x516b1d[_0xab3e('0x18')]]);}}break;default:break;}}catch(_0x21408c){utils[_0xab3e('0x21')](util[_0xab3e('0x14')](_0xab3e('0x22'),members[_0x516b1d[_0xab3e('0x18')]]?members[_0x516b1d[_0xab3e('0x18')]]['uniqueid']:_0x516b1d[_0xab3e('0x18')]),_0x21408c);}};exports[_0xab3e('0x23')]=function(_0x41bb99){try{if(!_[_0xab3e('0x1e')](members[_0x41bb99['interface']])){utils[_0xab3e('0x17')](util[_0xab3e('0x14')]('[%s][members][agentcomplete]',_0x41bb99[_0xab3e('0x6')]),_0x41bb99);utils['info'](util['format'](_0xab3e('0x24'),_0x41bb99['uniqueid'],_0x41bb99[_0xab3e('0x7')],_0x41bb99[_0xab3e('0x25')]));members[_0x41bb99[_0xab3e('0x7')]]=_['assign'](members[_0x41bb99[_0xab3e('0x7')]],{'data4':_0x41bb99[_0xab3e('0x25')],'uniqueid':_0x41bb99[_0xab3e('0x6')]});}}catch(_0xdf27c9){utils[_0xab3e('0x21')](util[_0xab3e('0x14')](_0xab3e('0x26'),_0x41bb99[_0xab3e('0x6')]),_0xdf27c9);}};exports[_0xab3e('0x27')]=function(_0x4facd4){try{utils[_0xab3e('0x17')](util['format'](_0xab3e('0x28'),_0x4facd4[_0xab3e('0x6')]),_0x4facd4);if(_0x4facd4['channel']){var _0x38843f=_0x4facd4['channel'][_0xab3e('0xf')]('-')[0x0];if(!_[_0xab3e('0x1e')](members[_0x38843f])){members[_0x38843f]=_[_0xab3e('0x29')](members[_0x38843f],{'data1':members[_0x38843f][_0xab3e('0x2a')]||_0x4facd4[_0xab3e('0xa')],'data2':members[_0x38843f][_0xab3e('0x9')]||_0x4facd4[_0xab3e('0x2b')],'data3':members[_0x38843f][_0xab3e('0x2c')]||_0x4facd4[_0xab3e('0x2d')],'uniqueid':members[_0x38843f][_0xab3e('0x6')]||_0x4facd4['uniqueid']});utils['info'](util[_0xab3e('0x14')](_0xab3e('0x2e'),_0x4facd4[_0xab3e('0x6')],members[_0x38843f][_0xab3e('0x2a')],members[_0x38843f][_0xab3e('0x9')],members[_0x38843f][_0xab3e('0x2c')]));if(members[_0x38843f][_0xab3e('0x20')]){writeDB(members[_0x38843f]);}}}if(_0x4facd4['destinationchannel']){var _0x35c287=_0x4facd4[_0xab3e('0x2f')][_0xab3e('0xf')]('-')[0x0];if(!_[_0xab3e('0x1e')](members[_0x35c287])){members[_0x35c287]=_['assign'](members[_0x35c287],{'data1':members[_0x35c287][_0xab3e('0x2a')]||_0x4facd4['type'],'data2':members[_0x35c287][_0xab3e('0x9')]||_0x4facd4[_0xab3e('0x2b')],'data3':members[_0x35c287][_0xab3e('0x2c')]||_0x4facd4[_0xab3e('0x2d')],'uniqueid':members[_0x35c287][_0xab3e('0x6')]||_0x4facd4[_0xab3e('0x6')]});utils[_0xab3e('0x4')](util[_0xab3e('0x14')](_0xab3e('0x2e'),_0x4facd4[_0xab3e('0x6')],members[_0x35c287]['data1'],members[_0x35c287][_0xab3e('0x9')],members[_0x35c287]['data3']));if(members[_0x35c287][_0xab3e('0x20')]){writeDB(members[_0x35c287]);}}}}catch(_0x2928e1){utils['error'](util['format'](_0xab3e('0x28'),_0x4facd4[_0xab3e('0x6')]),_0x2928e1);}}; \ No newline at end of file +var _0x48e0=['destinationchannel','destination','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','membername','type','then','name','internal','request','getUserByName','split','CreateMemberReport','catch','error','[%s][members][writeDB]','some','startsWith','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','agent','isNil','exitAt','now','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','cdr','[%s][members][cdr]','channel','assign','data2','source','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1'];(function(_0x5d5d44,_0x322f78){var _0x4a76cd=function(_0x15e72b){while(--_0x15e72b){_0x5d5d44['push'](_0x5d5d44['shift']());}};_0x4a76cd(++_0x322f78);}(_0x48e0,0x146));var _0x048e=function(_0x112ba3,_0x385b57){_0x112ba3=_0x112ba3-0x0;var _0x140b50=_0x48e0[_0x112ba3];return _0x140b50;};'use strict';var _=require('lodash');var util=require(_0x048e('0x0'));var utils=require(_0x048e('0x1'));var members={};var exclude=[_0x048e('0x2'),_0x048e('0x3')];function writeDB(_0x417571){utils[_0x048e('0x4')](util[_0x048e('0x5')](_0x048e('0x6'),_0x417571[_0x048e('0x7')],_0x417571[_0x048e('0x8')],_0x417571['channel'],_0x417571['data2'],_0x417571[_0x048e('0x9')],_0x417571[_0x048e('0xa')]));if(_0x417571['interface']){utils['getUserByInterface'](_0x417571['interface'])[_0x048e('0xb')](function(_0x29d1aa){if(_0x29d1aa){_0x417571[_0x048e('0x9')]=_0x29d1aa[_0x048e('0xc')];_0x417571[_0x048e('0xd')]=_0x29d1aa['internal'];utils[_0x048e('0xe')]('CreateMemberReport',_0x417571);}else{utils[_0x048e('0xf')](_0x417571[_0x048e('0x8')][_0x048e('0x10')]('/')[0x1])[_0x048e('0xb')](function(_0x45357b){if(_0x45357b){_0x417571['membername']=_0x45357b[_0x048e('0xc')];_0x417571[_0x048e('0xd')]=_0x45357b[_0x048e('0xd')];utils[_0x048e('0xe')](_0x048e('0x11'),_0x417571);}});}})[_0x048e('0x12')](function(_0x4aeb76){utils[_0x048e('0x13')](util[_0x048e('0x5')](_0x048e('0x14'),_0x417571[_0x048e('0x7')]),_0x4aeb76);});}delete members[_0x417571[_0x048e('0x8')]];}function startsWith(_0x1fb126,_0x110540){return _[_0x048e('0x15')](_0x1fb126,function(_0x578975){return _[_0x048e('0x16')](_0x110540,_0x578975);});}exports['devicestatechange']=function(_0x234e25){try{utils[_0x048e('0x17')](util[_0x048e('0x5')](_0x048e('0x18'),members[_0x234e25[_0x048e('0x19')]]?members[_0x234e25[_0x048e('0x19')]][_0x048e('0x7')]:_0x234e25[_0x048e('0x19')]),_0x234e25);utils['info'](util[_0x048e('0x5')](_0x048e('0x1a'),members[_0x234e25[_0x048e('0x19')]]?members[_0x234e25[_0x048e('0x19')]][_0x048e('0x7')]:_0x234e25[_0x048e('0x19')],_0x234e25[_0x048e('0x1b')],_0x234e25[_0x048e('0x19')]));switch(_0x234e25['state']){case _0x048e('0x1c'):case _0x048e('0x1d'):if(!startsWith(exclude,_0x234e25['device'])){members[_0x234e25[_0x048e('0x19')]]={'channel':_0x048e('0x1e'),'interface':_0x234e25['device'],'type':_0x048e('0x1f'),'enterAt':utils['now'](),'role':_0x048e('0x20')};}break;case'NOT_INUSE':if(!_[_0x048e('0x21')](members[_0x234e25['device']])){members[_0x234e25['device']][_0x048e('0x22')]=utils[_0x048e('0x23')]();members[_0x234e25[_0x048e('0x19')]][_0x048e('0x24')]=utils[_0x048e('0x25')](members[_0x234e25[_0x048e('0x19')]][_0x048e('0x22')],members[_0x234e25[_0x048e('0x19')]][_0x048e('0x26')]);if(members[_0x234e25[_0x048e('0x19')]][_0x048e('0x7')]){writeDB(members[_0x234e25[_0x048e('0x19')]]);}}break;default:break;}}catch(_0x1170be){utils['error'](util['format'](_0x048e('0x18'),members[_0x234e25[_0x048e('0x19')]]?members[_0x234e25[_0x048e('0x19')]][_0x048e('0x7')]:_0x234e25['device']),_0x1170be);}};exports[_0x048e('0x27')]=function(_0x5e58cb){try{if(!_[_0x048e('0x21')](members[_0x5e58cb[_0x048e('0x8')]])){utils[_0x048e('0x17')](util[_0x048e('0x5')](_0x048e('0x28'),_0x5e58cb[_0x048e('0x7')]),_0x5e58cb);utils[_0x048e('0x4')](util[_0x048e('0x5')](_0x048e('0x29'),_0x5e58cb[_0x048e('0x7')],_0x5e58cb[_0x048e('0x8')],_0x5e58cb[_0x048e('0x2a')]));members[_0x5e58cb[_0x048e('0x8')]]=_['assign'](members[_0x5e58cb[_0x048e('0x8')]],{'data4':_0x5e58cb[_0x048e('0x2a')],'uniqueid':_0x5e58cb[_0x048e('0x7')]});}}catch(_0x3467c4){utils['error'](util[_0x048e('0x5')](_0x048e('0x28'),_0x5e58cb[_0x048e('0x7')]),_0x3467c4);}};exports[_0x048e('0x2b')]=function(_0x3df30b){try{utils['debug'](util[_0x048e('0x5')](_0x048e('0x2c'),_0x3df30b[_0x048e('0x7')]),_0x3df30b);if(_0x3df30b[_0x048e('0x2d')]){var _0x24a41f=_0x3df30b[_0x048e('0x2d')][_0x048e('0x10')]('-')[0x0];if(!_[_0x048e('0x21')](members[_0x24a41f])){members[_0x24a41f]=_[_0x048e('0x2e')](members[_0x24a41f],{'data1':members[_0x24a41f]['data1']||_0x3df30b['type'],'data2':members[_0x24a41f][_0x048e('0x2f')]||_0x3df30b[_0x048e('0x30')],'data3':members[_0x24a41f][_0x048e('0x31')]||_0x3df30b['destination'],'uniqueid':members[_0x24a41f][_0x048e('0x7')]||_0x3df30b[_0x048e('0x7')]});utils['info'](util['format'](_0x048e('0x32'),_0x3df30b['uniqueid'],members[_0x24a41f][_0x048e('0x33')],members[_0x24a41f][_0x048e('0x2f')],members[_0x24a41f]['data3']));if(members[_0x24a41f][_0x048e('0x22')]){writeDB(members[_0x24a41f]);}}}if(_0x3df30b[_0x048e('0x34')]){var _0x39910c=_0x3df30b[_0x048e('0x34')][_0x048e('0x10')]('-')[0x0];if(!_['isNil'](members[_0x39910c])){members[_0x39910c]=_['assign'](members[_0x39910c],{'data1':members[_0x39910c][_0x048e('0x33')]||_0x3df30b[_0x048e('0xa')],'data2':members[_0x39910c][_0x048e('0x2f')]||_0x3df30b[_0x048e('0x30')],'data3':members[_0x39910c][_0x048e('0x31')]||_0x3df30b[_0x048e('0x35')],'uniqueid':members[_0x39910c][_0x048e('0x7')]||_0x3df30b[_0x048e('0x7')]});utils[_0x048e('0x4')](util[_0x048e('0x5')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x3df30b[_0x048e('0x7')],members[_0x39910c][_0x048e('0x33')],members[_0x39910c][_0x048e('0x2f')],members[_0x39910c]['data3']));if(members[_0x39910c][_0x048e('0x22')]){writeDB(members[_0x39910c]);}}}}catch(_0x35bc2e){utils[_0x048e('0x13')](util[_0x048e('0x5')](_0x048e('0x2c'),_0x3df30b[_0x048e('0x7')]),_0x35bc2e);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index db6437f..f54eed8 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 _0x44c8=['[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]','[%s][queues][queuecallerabandon]','ABANDONED','queuecallerleave','debug','[%s][queues][queuecallerleave]','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','membername','assigned','destaccountcode','agentcomplete','[%s][queues][agentcomplete]','queuecallercompleteAt','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','origtransfererexten','secondtransfererlinkedid','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','secondtransfereruniqueid','transfertargetlinkedid','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','lodash','util','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','queuecallerjoin','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','now','error','isNil','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','COMPLETEDBYAGENT','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','variable','value','toUpperCase','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerabandonAt','EXITWITHKEY'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x44c8,0x164));var _0x844c=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x44c8[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0x844c('0x0'));var util=require(_0x844c('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x2a59ba){utils[_0x844c('0x2')](util[_0x844c('0x3')](_0x844c('0x4'),_0x2a59ba[_0x844c('0x5')],_0x2a59ba[_0x844c('0x6')],_0x2a59ba[_0x844c('0x7')],_0x2a59ba[_0x844c('0x8')],_0x2a59ba[_0x844c('0x9')],_0x2a59ba[_0x844c('0xa')],_0x2a59ba[_0x844c('0xb')]));if(_0x2a59ba['queue']){utils[_0x844c('0xc')](_0x2a59ba[_0x844c('0x7')])['then'](function(_0x19b796){if(_0x19b796){_0x2a59ba[_0x844c('0xd')]=_0x19b796[_0x844c('0xd')];}utils[_0x844c('0xe')](_0x844c('0xf'),_0x2a59ba);});}else{utils['request'](_0x844c('0xf'),_0x2a59ba);}if(_0x2a59ba['transfereduniqueid']){delete queues[_0x2a59ba[_0x844c('0x10')]];}else{delete queues[_0x2a59ba[_0x844c('0x5')]];}}exports[_0x844c('0x11')]=function(_0x154f77){try{utils['debug'](util[_0x844c('0x3')](_0x844c('0x12'),_0x154f77[_0x844c('0x5')]),_0x154f77);utils[_0x844c('0x2')](util[_0x844c('0x3')](_0x844c('0x13'),_0x154f77[_0x844c('0x5')],_0x154f77['queue'],_0x154f77[_0x844c('0x14')]));queues[_0x154f77[_0x844c('0x5')]]=_['assign'](_0x154f77,{'originalposition':_0x154f77[_0x844c('0x14')],'queuecallerjoinAt':utils[_0x844c('0x15')](),'mohtime':0x0});}catch(_0x26a038){utils[_0x844c('0x16')](util[_0x844c('0x3')]('[%s][queues][queuecallerjoin]',_0x154f77['uniqueid']),_0x26a038);}};exports['hangup']=function(_0x4fc6a2){try{if(!_[_0x844c('0x17')](queues[_0x4fc6a2['uniqueid']])){utils['debug'](util[_0x844c('0x3')]('[%s][queues][hangup]',_0x4fc6a2[_0x844c('0x5')]),_0x4fc6a2);if(queues[_0x4fc6a2[_0x844c('0x5')]][_0x844c('0x18')]){if(!queues[_0x4fc6a2[_0x844c('0x5')]][_0x844c('0x19')]&&!queues[_0x4fc6a2[_0x844c('0x5')]][_0x844c('0x1a')]){queues[_0x4fc6a2[_0x844c('0x5')]][_0x844c('0x1b')]=!![];queues[_0x4fc6a2[_0x844c('0x5')]]['queuecallercompleteAt']=utils[_0x844c('0x15')]();queues[_0x4fc6a2[_0x844c('0x5')]][_0x844c('0xb')]=_0x844c('0x1c');}utils[_0x844c('0x2')](util[_0x844c('0x3')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x4fc6a2[_0x844c('0x5')],queues[_0x4fc6a2['uniqueid']][_0x844c('0x1d')],queues[_0x4fc6a2['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x4fc6a2['uniqueid']]);}else if(queues[_0x4fc6a2[_0x844c('0x5')]][_0x844c('0x10')]){utils[_0x844c('0x2')](util[_0x844c('0x3')](_0x844c('0x1e'),_0x4fc6a2[_0x844c('0x5')],queues[_0x4fc6a2[_0x844c('0x5')]][_0x844c('0x1d')],queues[_0x4fc6a2['uniqueid']][_0x844c('0x10')]));queues[queues[_0x4fc6a2['uniqueid']][_0x844c('0x10')]]=queues[_0x4fc6a2[_0x844c('0x5')]];queues[queues[_0x4fc6a2[_0x844c('0x5')]][_0x844c('0x10')]][_0x844c('0x1f')]=0x2;delete queues[_0x4fc6a2[_0x844c('0x5')]];}}}catch(_0x15149d){utils[_0x844c('0x16')](util[_0x844c('0x3')]('[%s][queues][hangup]',_0x4fc6a2[_0x844c('0x5')]),_0x15149d);}};exports['varset']=function(_0x204fd3){try{utils['debug'](util[_0x844c('0x3')]('[%s][queues][varset]',_0x204fd3[_0x844c('0x5')]),_0x204fd3);if(!_[_0x844c('0x17')](_0x204fd3[_0x844c('0x20')]['queuestatus'])&&_0x204fd3[_0x844c('0x21')][_0x844c('0x22')]()!=='CONTINUE'){if(!_[_0x844c('0x17')](queues[_0x204fd3[_0x844c('0x5')]])){queues[_0x204fd3[_0x844c('0x5')]][_0x844c('0x19')]=![];queues[_0x204fd3[_0x844c('0x5')]]['queuecallerabandonAt']=null;queues[_0x204fd3[_0x844c('0x5')]][_0x844c('0x1a')]=!![];queues[_0x204fd3[_0x844c('0x5')]][_0x844c('0x23')]=utils[_0x844c('0x15')]();queues[_0x204fd3[_0x844c('0x5')]][_0x844c('0xb')]=_0x204fd3['value'][_0x844c('0x22')]();utils[_0x844c('0x2')](util[_0x844c('0x3')](_0x844c('0x24'),_0x204fd3['uniqueid'],queues[_0x204fd3[_0x844c('0x5')]][_0x844c('0x1d')],_0x204fd3[_0x844c('0x21')],queues[_0x204fd3['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x204fd3['uniqueid']]);}}else if(!_['isNil'](_0x204fd3[_0x844c('0x20')][_0x844c('0x25')])){if(!_[_0x844c('0x17')](queues[_0x204fd3[_0x844c('0x5')]])&&!queues[_0x204fd3[_0x844c('0x5')]][_0x844c('0x19')]){queues[_0x204fd3[_0x844c('0x5')]][_0x844c('0x19')]=![];queues[_0x204fd3['uniqueid']][_0x844c('0x26')]=null;queues[_0x204fd3[_0x844c('0x5')]][_0x844c('0x1a')]=!![];queues[_0x204fd3[_0x844c('0x5')]]['queuecallerexitAt']=utils['now']();queues[_0x204fd3[_0x844c('0x5')]][_0x844c('0xb')]=_0x844c('0x27');utils[_0x844c('0x2')](util[_0x844c('0x3')](_0x844c('0x28'),_0x204fd3['uniqueid'],queues[_0x204fd3[_0x844c('0x5')]]['name'],_0x204fd3[_0x844c('0x21')],queues[_0x204fd3[_0x844c('0x5')]][_0x844c('0xb')]));}}}catch(_0x3da29e){utils['error'](util[_0x844c('0x3')](_0x844c('0x29'),_0x204fd3[_0x844c('0x5')]),_0x3da29e);}};exports[_0x844c('0x19')]=function(_0x1519ff){try{if(!_[_0x844c('0x17')](queues[_0x1519ff['uniqueid']])){utils['debug'](util[_0x844c('0x3')](_0x844c('0x2a'),_0x1519ff['uniqueid']),_0x1519ff);queues[_0x1519ff[_0x844c('0x5')]][_0x844c('0x1a')]=![];queues[_0x1519ff['uniqueid']][_0x844c('0x23')]=null;queues[_0x1519ff[_0x844c('0x5')]][_0x844c('0x19')]=!![];queues[_0x1519ff[_0x844c('0x5')]][_0x844c('0x26')]=utils[_0x844c('0x15')]();queues[_0x1519ff['uniqueid']]['queuecallerexitreason']=_0x844c('0x2b');utils[_0x844c('0x2')](util[_0x844c('0x3')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x1519ff[_0x844c('0x5')],queues[_0x1519ff['uniqueid']]['name'],queues[_0x1519ff[_0x844c('0x5')]]['queuecallerexitreason']));}}catch(_0x58149e){utils[_0x844c('0x16')](util[_0x844c('0x3')](_0x844c('0x2a'),_0x1519ff['uniqueid']),_0x58149e);}};exports[_0x844c('0x2c')]=function(_0x1814d2){try{if(!_[_0x844c('0x17')](queues[_0x1814d2[_0x844c('0x5')]])){utils[_0x844c('0x2d')](util[_0x844c('0x3')](_0x844c('0x2e'),_0x1814d2[_0x844c('0x5')]),_0x1814d2);utils['info'](util[_0x844c('0x3')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x1814d2[_0x844c('0x5')],queues[_0x1814d2[_0x844c('0x5')]]['name'],_0x1814d2[_0x844c('0x2f')],_0x1814d2[_0x844c('0x30')]));queues[_0x1814d2[_0x844c('0x5')]]['queuecallerleave']=!![];queues[_0x1814d2[_0x844c('0x5')]][_0x844c('0x18')]=utils['now']();queues[_0x1814d2[_0x844c('0x5')]][_0x844c('0x31')]=utils[_0x844c('0x32')](queues[_0x1814d2[_0x844c('0x5')]]['queuecallerleaveAt'],queues[_0x1814d2[_0x844c('0x5')]][_0x844c('0x33')]);queues[_0x1814d2[_0x844c('0x5')]]['position']=_0x1814d2[_0x844c('0x14')];queues[_0x1814d2[_0x844c('0x5')]][_0x844c('0x34')]=_0x1814d2[_0x844c('0x34')];queues[_0x1814d2[_0x844c('0x5')]]['connectedlinenum']=_0x1814d2['connectedlinenum'];queues[_0x1814d2[_0x844c('0x5')]][_0x844c('0x30')]=_0x1814d2[_0x844c('0x30')];}}catch(_0x502564){utils[_0x844c('0x16')](util[_0x844c('0x3')](_0x844c('0x2e'),_0x1814d2[_0x844c('0x5')]),_0x502564);}};exports['agentconnect']=function(_0x285738){try{if(!_[_0x844c('0x17')](queues[_0x285738[_0x844c('0x5')]])){utils[_0x844c('0x2d')](util[_0x844c('0x3')]('[%s][queues][agentconnect]',_0x285738[_0x844c('0x5')]),_0x285738);utils[_0x844c('0x2')](util['format']('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x285738[_0x844c('0x5')],queues[_0x285738[_0x844c('0x5')]][_0x844c('0x1d')],_0x285738[_0x844c('0x35')],_0x285738['destaccountcode']));queues[_0x285738[_0x844c('0x5')]][_0x844c('0x19')]=![];queues[_0x285738[_0x844c('0x5')]][_0x844c('0x19')]=![];queues[_0x285738[_0x844c('0x5')]][_0x844c('0x26')]=null;queues[_0x285738[_0x844c('0x5')]]['queuecallerexit']=![];queues[_0x285738[_0x844c('0x5')]]['queuecallerexitreason']=null;queues[_0x285738[_0x844c('0x5')]][_0x844c('0x23')]=null;queues[_0x285738[_0x844c('0x5')]][_0x844c('0x36')]=!![];queues[_0x285738['uniqueid']][_0x844c('0xa')]=_0x285738[_0x844c('0x37')];queues[_0x285738[_0x844c('0x5')]][_0x844c('0x8')]=_0x285738[_0x844c('0x35')];}}catch(_0x5d1f20){utils[_0x844c('0x16')](util[_0x844c('0x3')]('[%s][queues][agentconnect]',_0x285738[_0x844c('0x5')]),_0x5d1f20);}};exports[_0x844c('0x38')]=function(_0x1311a3){try{if(!_[_0x844c('0x17')](queues[_0x1311a3[_0x844c('0x5')]])){if(queues[_0x1311a3[_0x844c('0x5')]][_0x844c('0x18')]){utils[_0x844c('0x2d')](util['format'](_0x844c('0x39'),_0x1311a3[_0x844c('0x5')]),_0x1311a3);queues[_0x1311a3[_0x844c('0x5')]]['queuecallerabandon']=![];queues[_0x1311a3[_0x844c('0x5')]][_0x844c('0x19')]=![];queues[_0x1311a3['uniqueid']]['queuecallerabandonAt']=null;queues[_0x1311a3[_0x844c('0x5')]]['queuecallerexit']=![];queues[_0x1311a3[_0x844c('0x5')]][_0x844c('0x23')]=null;queues[_0x1311a3[_0x844c('0x5')]][_0x844c('0x36')]=!![];queues[_0x1311a3[_0x844c('0x5')]][_0x844c('0x8')]=_0x1311a3['membername'];queues[_0x1311a3[_0x844c('0x5')]][_0x844c('0x1b')]=!![];queues[_0x1311a3[_0x844c('0x5')]][_0x844c('0x3a')]=utils[_0x844c('0x15')]();if(_0x1311a3[_0x844c('0x3b')]=='transfer'){if(!queues[_0x1311a3[_0x844c('0x5')]][_0x844c('0x3c')]){queues[_0x1311a3['uniqueid']][_0x844c('0xb')]=_0x844c('0x3d');}}else{queues[_0x1311a3[_0x844c('0x5')]][_0x844c('0xb')]=_0x844c('0x3e')+_0x1311a3[_0x844c('0x3b')][_0x844c('0x22')]();}utils['info'](util[_0x844c('0x3')](_0x844c('0x3f'),_0x1311a3['uniqueid'],queues[_0x1311a3['uniqueid']][_0x844c('0x1d')],_0x1311a3[_0x844c('0x35')],queues[_0x1311a3[_0x844c('0x5')]][_0x844c('0xb')]));writeDB(queues[_0x1311a3['uniqueid']]);}}}catch(_0x252e46){utils['error'](util[_0x844c('0x3')](_0x844c('0x39'),_0x1311a3[_0x844c('0x5')]),_0x252e46);}};exports[_0x844c('0x40')]=function(_0x2c3099){try{if(!_[_0x844c('0x17')](queues[_0x2c3099[_0x844c('0x41')]])){utils[_0x844c('0x2d')](util[_0x844c('0x3')](_0x844c('0x42'),_0x2c3099[_0x844c('0x5')]),_0x2c3099);queues[_0x2c3099[_0x844c('0x41')]][_0x844c('0x3c')]=!![];queues[_0x2c3099[_0x844c('0x41')]][_0x844c('0x43')]=_0x844c('0x44');queues[_0x2c3099[_0x844c('0x41')]][_0x844c('0x45')]=_0x2c3099['extension'];queues[_0x2c3099['transfereeuniqueid']][_0x844c('0x46')]=_0x2c3099['transfereeuniqueid'];queues[_0x2c3099[_0x844c('0x41')]][_0x844c('0xb')]=_0x844c('0x47');utils[_0x844c('0x2')](util[_0x844c('0x3')](_0x844c('0x48'),_0x2c3099[_0x844c('0x5')],queues[_0x2c3099[_0x844c('0x41')]][_0x844c('0x1d')],_0x2c3099['transfereeuniqueid'],_0x2c3099['extension']));}}catch(_0x41e65d){utils[_0x844c('0x16')](util[_0x844c('0x3')]('[%s][queues][blindtransfer]',_0x2c3099['uniqueid']),_0x41e65d);}};exports[_0x844c('0x49')]=function(_0x56cb22){try{utils[_0x844c('0x2d')](util[_0x844c('0x3')]('[%s][queues][attendedtransfer]',_0x56cb22[_0x844c('0x4a')]),_0x56cb22);if(_0x56cb22[_0x844c('0x4a')]==_0x56cb22[_0x844c('0x4b')]){if(!_[_0x844c('0x17')](queues[_0x56cb22['secondtransfererlinkedid']])){utils['info'](util[_0x844c('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x56cb22['origtransfereruniqueid'],queues[_0x56cb22['secondtransfererlinkedid']]['name'],_0x56cb22[_0x844c('0x4c')]));queues[_0x56cb22[_0x844c('0x4d')]][_0x844c('0x3c')]=!![];queues[_0x56cb22[_0x844c('0x4d')]][_0x844c('0x43')]=_0x844c('0x4e');queues[_0x56cb22[_0x844c('0x4d')]][_0x844c('0x45')]=_0x56cb22['origtransfererexten'];queues[_0x56cb22['secondtransfererlinkedid']][_0x844c('0x46')]=_0x56cb22['origtransfereruniqueid'];queues[_0x56cb22[_0x844c('0x4d')]][_0x844c('0xb')]=_0x844c('0x4f');}if(!_[_0x844c('0x17')](queues[_0x56cb22[_0x844c('0x4b')]])){if(_0x56cb22[_0x844c('0x50')]&&queues[_0x56cb22['transfereelinkedid']]){queues[_0x56cb22[_0x844c('0x50')]]['queuecallerenterreason']=0x1;queues[_0x56cb22['transfereeuniqueid']]=_[_0x844c('0x51')](queues[_0x56cb22[_0x844c('0x50')]]);queues[_0x56cb22[_0x844c('0x41')]][_0x844c('0x10')]=_0x56cb22[_0x844c('0x52')];queues[_0x56cb22[_0x844c('0x41')]]['queuecallerenterreason']=0x2;queues[_0x56cb22[_0x844c('0x41')]][_0x844c('0x9')]=queues[_0x56cb22['secondtransfererlinkedid']][_0x844c('0x9')];queues[_0x56cb22[_0x844c('0x41')]]['calleridname']=queues[_0x56cb22[_0x844c('0x4d')]][_0x844c('0x53')];queues[_0x56cb22[_0x844c('0x41')]][_0x844c('0x33')]=utils['now']();queues[_0x56cb22[_0x844c('0x41')]]['queuecallerleaveAt']=utils[_0x844c('0x15')]();queues[_0x56cb22[_0x844c('0x41')]][_0x844c('0x31')]=0x0;queues[_0x56cb22['transfereeuniqueid']][_0x844c('0x54')]=0x0;utils[_0x844c('0x2')](util[_0x844c('0x3')](_0x844c('0x55'),_0x56cb22['origtransfereruniqueid'],queues[_0x56cb22['transfereeuniqueid']]['name'],queues[_0x56cb22[_0x844c('0x41')]][_0x844c('0x9')],queues[_0x56cb22[_0x844c('0x41')]][_0x844c('0x53')]));}else{utils[_0x844c('0x2')](util['format'](_0x844c('0x56'),_0x56cb22[_0x844c('0x4a')],queues[_0x56cb22[_0x844c('0x4b')]][_0x844c('0x1d')],_0x56cb22[_0x844c('0x4d')]));queues[_0x56cb22[_0x844c('0x4b')]][_0x844c('0x10')]=_0x56cb22[_0x844c('0x4d')];}}}else if(_0x56cb22['secondtransfereruniqueid']==_0x56cb22[_0x844c('0x4d')]){if(!_[_0x844c('0x17')](queues[_0x56cb22[_0x844c('0x4b')]])){utils[_0x844c('0x2')](util[_0x844c('0x3')](_0x844c('0x57'),_0x56cb22[_0x844c('0x4a')],queues[_0x56cb22['origtransfererlinkedid']][_0x844c('0x1d')],_0x56cb22['secondtransfereruniqueid'],_0x56cb22[_0x844c('0x58')]));queues[_0x56cb22[_0x844c('0x4b')]]['transfer']=!![];queues[_0x56cb22[_0x844c('0x4b')]][_0x844c('0x43')]='ATTENDED';queues[_0x56cb22[_0x844c('0x4b')]]['transferexten']=_0x56cb22['secondtransfererexten'];queues[_0x56cb22[_0x844c('0x4b')]][_0x844c('0x46')]=_0x56cb22[_0x844c('0x59')];queues[_0x56cb22[_0x844c('0x4b')]][_0x844c('0xb')]=_0x844c('0x4f');}if(!_[_0x844c('0x17')](queues[_0x56cb22[_0x844c('0x4d')]])){if(_0x56cb22[_0x844c('0x5a')]&&queues[_0x56cb22[_0x844c('0x5a')]]){queues[_0x56cb22[_0x844c('0x5a')]][_0x844c('0x1f')]=0x1;queues[_0x56cb22[_0x844c('0x52')]]=_['clone'](queues[_0x56cb22[_0x844c('0x5a')]]);queues[_0x56cb22['transfertargetuniqueid']][_0x844c('0x10')]=_0x56cb22[_0x844c('0x52')];queues[_0x56cb22[_0x844c('0x52')]][_0x844c('0x1f')]=0x2;queues[_0x56cb22[_0x844c('0x52')]][_0x844c('0x9')]=queues[_0x56cb22[_0x844c('0x4b')]]['calleridnum'];queues[_0x56cb22['transfertargetuniqueid']]['calleridname']=queues[_0x56cb22[_0x844c('0x4b')]]['calleridname'];queues[_0x56cb22[_0x844c('0x52')]]['queuecallerjoinAt']=utils['now']();queues[_0x56cb22[_0x844c('0x52')]][_0x844c('0x18')]=utils[_0x844c('0x15')]();queues[_0x56cb22[_0x844c('0x52')]][_0x844c('0x31')]=0x0;queues[_0x56cb22['transfertargetuniqueid']][_0x844c('0x54')]=0x0;utils[_0x844c('0x2')](util[_0x844c('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x56cb22[_0x844c('0x4a')],queues[_0x56cb22['transfertargetuniqueid']][_0x844c('0x1d')],queues[_0x56cb22['transfertargetuniqueid']][_0x844c('0x10')],queues[_0x56cb22['transfertargetuniqueid']][_0x844c('0x9')],queues[_0x56cb22['transfertargetuniqueid']][_0x844c('0x53')]));}else{utils[_0x844c('0x2')](util[_0x844c('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x56cb22['origtransfereruniqueid'],queues[_0x56cb22['secondtransfererlinkedid']]['name'],_0x56cb22['origtransfererlinkedid']));queues[_0x56cb22[_0x844c('0x4d')]][_0x844c('0x10')]=_0x56cb22[_0x844c('0x4b')];}}}}catch(_0x2806bc){utils['error'](util[_0x844c('0x3')](_0x844c('0x5b'),_0x56cb22['origtransfereruniqueid']),_0x2806bc);}};exports[_0x844c('0x5c')]=function(_0x468cac){try{if(!_[_0x844c('0x17')](queues[_0x468cac[_0x844c('0x5')]])){utils[_0x844c('0x2d')](util[_0x844c('0x3')](_0x844c('0x5d'),_0x468cac[_0x844c('0x5')]),_0x468cac);queues[_0x468cac[_0x844c('0x5')]][_0x844c('0x5e')]=utils['now']();utils[_0x844c('0x2')](util[_0x844c('0x3')](_0x844c('0x5f'),_0x468cac[_0x844c('0x5')],queues[_0x468cac[_0x844c('0x5')]][_0x844c('0x1d')],queues[_0x468cac[_0x844c('0x5')]][_0x844c('0x5e')]));}}catch(_0x33fb38){utils['error'](util['format']('[%s][queues][musiconholdstart]',_0x468cac[_0x844c('0x5')]),_0x33fb38);}};exports[_0x844c('0x60')]=function(_0x3cf46d){try{if(!_[_0x844c('0x17')](queues[_0x3cf46d['uniqueid']])){if(!_[_0x844c('0x17')](queues[_0x3cf46d['uniqueid']][_0x844c('0x5e')])){utils[_0x844c('0x2d')](util[_0x844c('0x3')]('[%s][queues][musiconholdstop]',_0x3cf46d[_0x844c('0x5')]),_0x3cf46d);queues[_0x3cf46d[_0x844c('0x5')]][_0x844c('0x54')]+=utils[_0x844c('0x32')](utils[_0x844c('0x15')](),queues[_0x3cf46d['uniqueid']][_0x844c('0x5e')]);utils[_0x844c('0x2')](util[_0x844c('0x3')](_0x844c('0x61'),_0x3cf46d[_0x844c('0x5')],queues[_0x3cf46d[_0x844c('0x5')]][_0x844c('0x1d')],queues[_0x3cf46d[_0x844c('0x5')]][_0x844c('0x54')]));delete queues[_0x3cf46d[_0x844c('0x5')]][_0x844c('0x5e')];}}}catch(_0x31c42f){utils[_0x844c('0x16')](util[_0x844c('0x3')](_0x844c('0x62'),_0x3cf46d[_0x844c('0x5')]),_0x31c42f);}}; \ No newline at end of file +var _0x485d=['[%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','lastAssignedTo','accountcode','queuecallerexitreason','queue','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','position','assign','error','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','now','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','[%s][queues][hangup]','varset','[%s][queues][varset]','variable','queuestatus','toUpperCase','CONTINUE','isNil','queuecallerexit','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','value','queueposition','queuecallerabandonAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','queuecallerleave','[%s][queues][queuecallerleave]','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','assigned','destaccountcode','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','transfertype','transferuniqueid','extension','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','ATTENDED','transferexten','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridnum','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstart]','musiconholdstop','musiconholdstartAt'];(function(_0x5bbae4,_0x2a4a4e){var _0x338a50=function(_0x478845){while(--_0x478845){_0x5bbae4['push'](_0x5bbae4['shift']());}};_0x338a50(++_0x2a4a4e);}(_0x485d,0x137));var _0xd485=function(_0x35ef6b,_0x202c42){_0x35ef6b=_0x35ef6b-0x0;var _0x3ad145=_0x485d[_0x35ef6b];return _0x3ad145;};'use strict';var _=require(_0xd485('0x0'));var util=require(_0xd485('0x1'));var utils=require(_0xd485('0x2'));var queues={};function writeDB(_0x358714){utils[_0xd485('0x3')](util[_0xd485('0x4')](_0xd485('0x5'),_0x358714[_0xd485('0x6')],_0x358714[_0xd485('0x7')],_0x358714['queue'],_0x358714[_0xd485('0x8')],_0x358714['calleridnum'],_0x358714[_0xd485('0x9')],_0x358714[_0xd485('0xa')]));if(_0x358714[_0xd485('0xb')]){utils['getVoiceQueueByName'](_0x358714[_0xd485('0xb')])[_0xd485('0xc')](function(_0x578505){if(_0x578505){_0x358714[_0xd485('0xd')]=_0x578505[_0xd485('0xd')];}utils[_0xd485('0xe')]('CreateVoiceQueueReport',_0x358714);});}else{utils[_0xd485('0xe')](_0xd485('0xf'),_0x358714);}if(_0x358714[_0xd485('0x10')]){delete queues[_0x358714[_0xd485('0x10')]];}else{delete queues[_0x358714['uniqueid']];}}exports[_0xd485('0x11')]=function(_0x2849d6){try{utils[_0xd485('0x12')](util[_0xd485('0x4')](_0xd485('0x13'),_0x2849d6[_0xd485('0x6')]),_0x2849d6);utils[_0xd485('0x3')](util['format']('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x2849d6[_0xd485('0x6')],_0x2849d6[_0xd485('0xb')],_0x2849d6[_0xd485('0x14')]));queues[_0x2849d6[_0xd485('0x6')]]=_[_0xd485('0x15')](_0x2849d6,{'originalposition':_0x2849d6[_0xd485('0x14')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x34aa51){utils[_0xd485('0x16')](util[_0xd485('0x4')](_0xd485('0x13'),_0x2849d6['uniqueid']),_0x34aa51);}};exports['hangup']=function(_0x1e1355){try{if(!_['isNil'](queues[_0x1e1355['uniqueid']])){utils[_0xd485('0x12')](util[_0xd485('0x4')]('[%s][queues][hangup]',_0x1e1355['uniqueid']),_0x1e1355);if(queues[_0x1e1355[_0xd485('0x6')]][_0xd485('0x17')]){if(!queues[_0x1e1355[_0xd485('0x6')]][_0xd485('0x18')]&&!queues[_0x1e1355[_0xd485('0x6')]]['queuecallerexit']){queues[_0x1e1355[_0xd485('0x6')]][_0xd485('0x19')]=!![];queues[_0x1e1355[_0xd485('0x6')]][_0xd485('0x1a')]=utils[_0xd485('0x1b')]();queues[_0x1e1355[_0xd485('0x6')]]['queuecallerexitreason']=_0xd485('0x1c');}utils[_0xd485('0x3')](util[_0xd485('0x4')](_0xd485('0x1d'),_0x1e1355['uniqueid'],queues[_0x1e1355[_0xd485('0x6')]]['name'],queues[_0x1e1355[_0xd485('0x6')]][_0xd485('0xa')]));writeDB(queues[_0x1e1355[_0xd485('0x6')]]);}else if(queues[_0x1e1355[_0xd485('0x6')]][_0xd485('0x10')]){utils[_0xd485('0x3')](util[_0xd485('0x4')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x1e1355[_0xd485('0x6')],queues[_0x1e1355[_0xd485('0x6')]][_0xd485('0x1e')],queues[_0x1e1355[_0xd485('0x6')]][_0xd485('0x10')]));queues[queues[_0x1e1355['uniqueid']][_0xd485('0x10')]]=queues[_0x1e1355[_0xd485('0x6')]];queues[queues[_0x1e1355[_0xd485('0x6')]][_0xd485('0x10')]][_0xd485('0x1f')]=0x2;delete queues[_0x1e1355[_0xd485('0x6')]];}}}catch(_0x2179f2){utils[_0xd485('0x16')](util[_0xd485('0x4')](_0xd485('0x20'),_0x1e1355[_0xd485('0x6')]),_0x2179f2);}};exports[_0xd485('0x21')]=function(_0x1545d2){try{utils[_0xd485('0x12')](util[_0xd485('0x4')](_0xd485('0x22'),_0x1545d2['uniqueid']),_0x1545d2);if(!_['isNil'](_0x1545d2[_0xd485('0x23')][_0xd485('0x24')])&&_0x1545d2['value'][_0xd485('0x25')]()!==_0xd485('0x26')){if(!_[_0xd485('0x27')](queues[_0x1545d2[_0xd485('0x6')]])){queues[_0x1545d2['uniqueid']][_0xd485('0x18')]=![];queues[_0x1545d2['uniqueid']]['queuecallerabandonAt']=null;queues[_0x1545d2['uniqueid']][_0xd485('0x28')]=!![];queues[_0x1545d2[_0xd485('0x6')]][_0xd485('0x29')]=utils['now']();queues[_0x1545d2[_0xd485('0x6')]][_0xd485('0xa')]=_0x1545d2['value'][_0xd485('0x25')]();utils[_0xd485('0x3')](util[_0xd485('0x4')](_0xd485('0x2a'),_0x1545d2[_0xd485('0x6')],queues[_0x1545d2[_0xd485('0x6')]][_0xd485('0x1e')],_0x1545d2[_0xd485('0x2b')],queues[_0x1545d2[_0xd485('0x6')]][_0xd485('0xa')]));writeDB(queues[_0x1545d2[_0xd485('0x6')]]);}}else if(!_['isNil'](_0x1545d2[_0xd485('0x23')][_0xd485('0x2c')])){if(!_[_0xd485('0x27')](queues[_0x1545d2[_0xd485('0x6')]])&&!queues[_0x1545d2[_0xd485('0x6')]][_0xd485('0x18')]){queues[_0x1545d2['uniqueid']][_0xd485('0x18')]=![];queues[_0x1545d2['uniqueid']][_0xd485('0x2d')]=null;queues[_0x1545d2[_0xd485('0x6')]]['queuecallerexit']=!![];queues[_0x1545d2['uniqueid']][_0xd485('0x29')]=utils[_0xd485('0x1b')]();queues[_0x1545d2['uniqueid']][_0xd485('0xa')]=_0xd485('0x2e');utils[_0xd485('0x3')](util[_0xd485('0x4')](_0xd485('0x2f'),_0x1545d2[_0xd485('0x6')],queues[_0x1545d2[_0xd485('0x6')]][_0xd485('0x1e')],_0x1545d2[_0xd485('0x2b')],queues[_0x1545d2[_0xd485('0x6')]][_0xd485('0xa')]));}}}catch(_0x38c1d0){utils[_0xd485('0x16')](util['format']('[%s][queues][varset]',_0x1545d2[_0xd485('0x6')]),_0x38c1d0);}};exports['queuecallerabandon']=function(_0x348825){try{if(!_[_0xd485('0x27')](queues[_0x348825[_0xd485('0x6')]])){utils[_0xd485('0x12')](util[_0xd485('0x4')](_0xd485('0x30'),_0x348825[_0xd485('0x6')]),_0x348825);queues[_0x348825[_0xd485('0x6')]][_0xd485('0x28')]=![];queues[_0x348825[_0xd485('0x6')]][_0xd485('0x29')]=null;queues[_0x348825[_0xd485('0x6')]][_0xd485('0x18')]=!![];queues[_0x348825[_0xd485('0x6')]][_0xd485('0x2d')]=utils[_0xd485('0x1b')]();queues[_0x348825[_0xd485('0x6')]][_0xd485('0xa')]=_0xd485('0x31');utils[_0xd485('0x3')](util['format']('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x348825['uniqueid'],queues[_0x348825[_0xd485('0x6')]][_0xd485('0x1e')],queues[_0x348825[_0xd485('0x6')]][_0xd485('0xa')]));}}catch(_0x53b8f8){utils[_0xd485('0x16')](util[_0xd485('0x4')](_0xd485('0x30'),_0x348825[_0xd485('0x6')]),_0x53b8f8);}};exports[_0xd485('0x32')]=function(_0x1354d6){try{if(!_[_0xd485('0x27')](queues[_0x1354d6[_0xd485('0x6')]])){utils['debug'](util[_0xd485('0x4')](_0xd485('0x33'),_0x1354d6['uniqueid']),_0x1354d6);utils['info'](util[_0xd485('0x4')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x1354d6['uniqueid'],queues[_0x1354d6[_0xd485('0x6')]][_0xd485('0x1e')],_0x1354d6['connectedlinenum'],_0x1354d6[_0xd485('0x34')]));queues[_0x1354d6[_0xd485('0x6')]][_0xd485('0x32')]=!![];queues[_0x1354d6[_0xd485('0x6')]][_0xd485('0x17')]=utils[_0xd485('0x1b')]();queues[_0x1354d6[_0xd485('0x6')]][_0xd485('0x35')]=utils[_0xd485('0x36')](queues[_0x1354d6['uniqueid']][_0xd485('0x17')],queues[_0x1354d6[_0xd485('0x6')]][_0xd485('0x37')]);queues[_0x1354d6['uniqueid']][_0xd485('0x14')]=_0x1354d6[_0xd485('0x14')];queues[_0x1354d6[_0xd485('0x6')]][_0xd485('0x38')]=_0x1354d6[_0xd485('0x38')];queues[_0x1354d6[_0xd485('0x6')]][_0xd485('0x39')]=_0x1354d6[_0xd485('0x39')];queues[_0x1354d6[_0xd485('0x6')]][_0xd485('0x34')]=_0x1354d6[_0xd485('0x34')];}}catch(_0x4faef9){utils[_0xd485('0x16')](util[_0xd485('0x4')](_0xd485('0x33'),_0x1354d6['uniqueid']),_0x4faef9);}};exports[_0xd485('0x3a')]=function(_0xa717c0){try{if(!_[_0xd485('0x27')](queues[_0xa717c0['uniqueid']])){utils[_0xd485('0x12')](util[_0xd485('0x4')](_0xd485('0x3b'),_0xa717c0['uniqueid']),_0xa717c0);utils['info'](util['format'](_0xd485('0x3c'),_0xa717c0['uniqueid'],queues[_0xa717c0[_0xd485('0x6')]][_0xd485('0x1e')],_0xa717c0[_0xd485('0x3d')],_0xa717c0['destaccountcode']));queues[_0xa717c0[_0xd485('0x6')]][_0xd485('0x18')]=![];queues[_0xa717c0[_0xd485('0x6')]]['queuecallerabandon']=![];queues[_0xa717c0['uniqueid']][_0xd485('0x2d')]=null;queues[_0xa717c0[_0xd485('0x6')]][_0xd485('0x28')]=![];queues[_0xa717c0['uniqueid']]['queuecallerexitreason']=null;queues[_0xa717c0[_0xd485('0x6')]][_0xd485('0x29')]=null;queues[_0xa717c0['uniqueid']][_0xd485('0x3e')]=!![];queues[_0xa717c0[_0xd485('0x6')]][_0xd485('0x9')]=_0xa717c0[_0xd485('0x3f')];queues[_0xa717c0[_0xd485('0x6')]][_0xd485('0x8')]=_0xa717c0[_0xd485('0x3d')];}}catch(_0x43ddb6){utils[_0xd485('0x16')](util[_0xd485('0x4')]('[%s][queues][agentconnect]',_0xa717c0[_0xd485('0x6')]),_0x43ddb6);}};exports[_0xd485('0x40')]=function(_0x198e8a){try{if(!_[_0xd485('0x27')](queues[_0x198e8a['uniqueid']])){if(queues[_0x198e8a['uniqueid']]['queuecallerleaveAt']){utils[_0xd485('0x12')](util[_0xd485('0x4')](_0xd485('0x41'),_0x198e8a[_0xd485('0x6')]),_0x198e8a);queues[_0x198e8a['uniqueid']][_0xd485('0x18')]=![];queues[_0x198e8a[_0xd485('0x6')]]['queuecallerabandon']=![];queues[_0x198e8a[_0xd485('0x6')]]['queuecallerabandonAt']=null;queues[_0x198e8a[_0xd485('0x6')]][_0xd485('0x28')]=![];queues[_0x198e8a[_0xd485('0x6')]][_0xd485('0x29')]=null;queues[_0x198e8a[_0xd485('0x6')]][_0xd485('0x3e')]=!![];queues[_0x198e8a[_0xd485('0x6')]][_0xd485('0x8')]=_0x198e8a[_0xd485('0x3d')];queues[_0x198e8a[_0xd485('0x6')]][_0xd485('0x19')]=!![];queues[_0x198e8a[_0xd485('0x6')]][_0xd485('0x1a')]=utils[_0xd485('0x1b')]();if(_0x198e8a[_0xd485('0x42')]==_0xd485('0x43')){if(!queues[_0x198e8a['uniqueid']][_0xd485('0x43')]){queues[_0x198e8a['uniqueid']]['queuecallerexitreason']=_0xd485('0x44');}}else{queues[_0x198e8a['uniqueid']][_0xd485('0xa')]='COMPLETEDBY'+_0x198e8a['reason'][_0xd485('0x25')]();}utils['info'](util[_0xd485('0x4')](_0xd485('0x45'),_0x198e8a[_0xd485('0x6')],queues[_0x198e8a[_0xd485('0x6')]][_0xd485('0x1e')],_0x198e8a[_0xd485('0x3d')],queues[_0x198e8a['uniqueid']][_0xd485('0xa')]));writeDB(queues[_0x198e8a['uniqueid']]);}}}catch(_0x1d3b2d){utils['error'](util[_0xd485('0x4')](_0xd485('0x41'),_0x198e8a[_0xd485('0x6')]),_0x1d3b2d);}};exports[_0xd485('0x46')]=function(_0x12efdb){try{if(!_[_0xd485('0x27')](queues[_0x12efdb['transfereeuniqueid']])){utils[_0xd485('0x12')](util[_0xd485('0x4')]('[%s][queues][blindtransfer]',_0x12efdb[_0xd485('0x6')]),_0x12efdb);queues[_0x12efdb[_0xd485('0x47')]][_0xd485('0x43')]=!![];queues[_0x12efdb[_0xd485('0x47')]][_0xd485('0x48')]='BLIND';queues[_0x12efdb[_0xd485('0x47')]]['transferexten']=_0x12efdb['extension'];queues[_0x12efdb[_0xd485('0x47')]][_0xd485('0x49')]=_0x12efdb[_0xd485('0x47')];queues[_0x12efdb[_0xd485('0x47')]][_0xd485('0xa')]='BLINDTRANSFER';utils[_0xd485('0x3')](util[_0xd485('0x4')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x12efdb[_0xd485('0x6')],queues[_0x12efdb[_0xd485('0x47')]][_0xd485('0x1e')],_0x12efdb[_0xd485('0x47')],_0x12efdb[_0xd485('0x4a')]));}}catch(_0x28ec3b){utils[_0xd485('0x16')](util[_0xd485('0x4')]('[%s][queues][blindtransfer]',_0x12efdb['uniqueid']),_0x28ec3b);}};exports['attendedtransfer']=function(_0x12d65d){try{utils[_0xd485('0x12')](util['format']('[%s][queues][attendedtransfer]',_0x12d65d['origtransfereruniqueid']),_0x12d65d);if(_0x12d65d[_0xd485('0x4b')]==_0x12d65d[_0xd485('0x4c')]){if(!_[_0xd485('0x27')](queues[_0x12d65d[_0xd485('0x4d')]])){utils[_0xd485('0x3')](util['format'](_0xd485('0x4e'),_0x12d65d['origtransfereruniqueid'],queues[_0x12d65d[_0xd485('0x4d')]][_0xd485('0x1e')],_0x12d65d['origtransfererexten']));queues[_0x12d65d[_0xd485('0x4d')]]['transfer']=!![];queues[_0x12d65d['secondtransfererlinkedid']]['transfertype']=_0xd485('0x4f');queues[_0x12d65d[_0xd485('0x4d')]][_0xd485('0x50')]=_0x12d65d[_0xd485('0x51')];queues[_0x12d65d[_0xd485('0x4d')]]['transferuniqueid']=_0x12d65d[_0xd485('0x4b')];queues[_0x12d65d['secondtransfererlinkedid']]['queuecallerexitreason']=_0xd485('0x52');}if(!_['isNil'](queues[_0x12d65d[_0xd485('0x4c')]])){if(_0x12d65d['transfereelinkedid']&&queues[_0x12d65d[_0xd485('0x53')]]){queues[_0x12d65d[_0xd485('0x53')]][_0xd485('0x1f')]=0x1;queues[_0x12d65d[_0xd485('0x47')]]=_[_0xd485('0x54')](queues[_0x12d65d[_0xd485('0x53')]]);queues[_0x12d65d[_0xd485('0x47')]]['transfereduniqueid']=_0x12d65d[_0xd485('0x55')];queues[_0x12d65d[_0xd485('0x47')]][_0xd485('0x1f')]=0x2;queues[_0x12d65d[_0xd485('0x47')]][_0xd485('0x56')]=queues[_0x12d65d[_0xd485('0x4d')]][_0xd485('0x56')];queues[_0x12d65d['transfereeuniqueid']][_0xd485('0x57')]=queues[_0x12d65d[_0xd485('0x4d')]][_0xd485('0x57')];queues[_0x12d65d[_0xd485('0x47')]][_0xd485('0x37')]=utils[_0xd485('0x1b')]();queues[_0x12d65d[_0xd485('0x47')]]['queuecallerleaveAt']=utils['now']();queues[_0x12d65d[_0xd485('0x47')]]['holdtime']=0x0;queues[_0x12d65d['transfereeuniqueid']][_0xd485('0x58')]=0x0;utils[_0xd485('0x3')](util[_0xd485('0x4')](_0xd485('0x59'),_0x12d65d[_0xd485('0x4b')],queues[_0x12d65d['transfereeuniqueid']]['name'],queues[_0x12d65d[_0xd485('0x47')]][_0xd485('0x56')],queues[_0x12d65d['transfereeuniqueid']][_0xd485('0x57')]));}else{utils[_0xd485('0x3')](util[_0xd485('0x4')](_0xd485('0x5a'),_0x12d65d[_0xd485('0x4b')],queues[_0x12d65d[_0xd485('0x4c')]][_0xd485('0x1e')],_0x12d65d[_0xd485('0x4d')]));queues[_0x12d65d[_0xd485('0x4c')]]['transfereduniqueid']=_0x12d65d[_0xd485('0x4d')];}}}else if(_0x12d65d[_0xd485('0x5b')]==_0x12d65d[_0xd485('0x4d')]){if(!_[_0xd485('0x27')](queues[_0x12d65d[_0xd485('0x4c')]])){utils[_0xd485('0x3')](util[_0xd485('0x4')](_0xd485('0x5c'),_0x12d65d[_0xd485('0x4b')],queues[_0x12d65d[_0xd485('0x4c')]][_0xd485('0x1e')],_0x12d65d[_0xd485('0x5b')],_0x12d65d['secondtransfererexten']));queues[_0x12d65d[_0xd485('0x4c')]][_0xd485('0x43')]=!![];queues[_0x12d65d[_0xd485('0x4c')]][_0xd485('0x48')]=_0xd485('0x4f');queues[_0x12d65d[_0xd485('0x4c')]][_0xd485('0x50')]=_0x12d65d[_0xd485('0x5d')];queues[_0x12d65d[_0xd485('0x4c')]][_0xd485('0x49')]=_0x12d65d[_0xd485('0x5b')];queues[_0x12d65d['origtransfererlinkedid']]['queuecallerexitreason']=_0xd485('0x52');}if(!_[_0xd485('0x27')](queues[_0x12d65d[_0xd485('0x4d')]])){if(_0x12d65d[_0xd485('0x5e')]&&queues[_0x12d65d[_0xd485('0x5e')]]){queues[_0x12d65d[_0xd485('0x5e')]][_0xd485('0x1f')]=0x1;queues[_0x12d65d[_0xd485('0x55')]]=_[_0xd485('0x54')](queues[_0x12d65d[_0xd485('0x5e')]]);queues[_0x12d65d[_0xd485('0x55')]][_0xd485('0x10')]=_0x12d65d['transfertargetuniqueid'];queues[_0x12d65d[_0xd485('0x55')]][_0xd485('0x1f')]=0x2;queues[_0x12d65d['transfertargetuniqueid']][_0xd485('0x56')]=queues[_0x12d65d[_0xd485('0x4c')]][_0xd485('0x56')];queues[_0x12d65d[_0xd485('0x55')]][_0xd485('0x57')]=queues[_0x12d65d[_0xd485('0x4c')]][_0xd485('0x57')];queues[_0x12d65d['transfertargetuniqueid']]['queuecallerjoinAt']=utils[_0xd485('0x1b')]();queues[_0x12d65d[_0xd485('0x55')]][_0xd485('0x17')]=utils[_0xd485('0x1b')]();queues[_0x12d65d[_0xd485('0x55')]][_0xd485('0x35')]=0x0;queues[_0x12d65d[_0xd485('0x55')]]['mohtime']=0x0;utils[_0xd485('0x3')](util['format'](_0xd485('0x5f'),_0x12d65d[_0xd485('0x4b')],queues[_0x12d65d[_0xd485('0x55')]][_0xd485('0x1e')],queues[_0x12d65d[_0xd485('0x55')]][_0xd485('0x10')],queues[_0x12d65d[_0xd485('0x55')]]['calleridnum'],queues[_0x12d65d[_0xd485('0x55')]][_0xd485('0x57')]));}else{utils['info'](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x12d65d['origtransfereruniqueid'],queues[_0x12d65d[_0xd485('0x4d')]][_0xd485('0x1e')],_0x12d65d[_0xd485('0x4c')]));queues[_0x12d65d[_0xd485('0x4d')]][_0xd485('0x10')]=_0x12d65d[_0xd485('0x4c')];}}}}catch(_0x3450ba){utils['error'](util[_0xd485('0x4')](_0xd485('0x60'),_0x12d65d[_0xd485('0x4b')]),_0x3450ba);}};exports['musiconholdstart']=function(_0x1ad6d9){try{if(!_[_0xd485('0x27')](queues[_0x1ad6d9[_0xd485('0x6')]])){utils['debug'](util[_0xd485('0x4')]('[%s][queues][musiconholdstart]',_0x1ad6d9['uniqueid']),_0x1ad6d9);queues[_0x1ad6d9[_0xd485('0x6')]]['musiconholdstartAt']=utils[_0xd485('0x1b')]();utils['info'](util[_0xd485('0x4')](_0xd485('0x61'),_0x1ad6d9['uniqueid'],queues[_0x1ad6d9[_0xd485('0x6')]][_0xd485('0x1e')],queues[_0x1ad6d9['uniqueid']]['musiconholdstartAt']));}}catch(_0x539b28){utils[_0xd485('0x16')](util['format'](_0xd485('0x62'),_0x1ad6d9[_0xd485('0x6')]),_0x539b28);}};exports[_0xd485('0x63')]=function(_0x5c5a68){try{if(!_['isNil'](queues[_0x5c5a68[_0xd485('0x6')]])){if(!_[_0xd485('0x27')](queues[_0x5c5a68[_0xd485('0x6')]][_0xd485('0x64')])){utils[_0xd485('0x12')](util[_0xd485('0x4')](_0xd485('0x65'),_0x5c5a68[_0xd485('0x6')]),_0x5c5a68);queues[_0x5c5a68[_0xd485('0x6')]][_0xd485('0x58')]+=utils[_0xd485('0x36')](utils[_0xd485('0x1b')](),queues[_0x5c5a68[_0xd485('0x6')]][_0xd485('0x64')]);utils[_0xd485('0x3')](util[_0xd485('0x4')](_0xd485('0x66'),_0x5c5a68['uniqueid'],queues[_0x5c5a68[_0xd485('0x6')]][_0xd485('0x1e')],queues[_0x5c5a68[_0xd485('0x6')]][_0xd485('0x58')]));delete queues[_0x5c5a68[_0xd485('0x6')]][_0xd485('0x64')];}}}catch(_0x24ba6e){utils[_0xd485('0x16')](util['format'](_0xd485('0x65'),_0x5c5a68[_0xd485('0x6')]),_0x24ba6e);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 832c3f8..de70354 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 _0x210c=['format','accountcode','then','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','uniqueid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','linkedid','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','error','varset','variable','[%s][recordings][varset]','value','.wav49','replace','find','monitors','push','hangup','[%s][recordings][hangup]','info','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','appdata','cdr','split','substring','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','util','./utils'];(function(_0x32abf8,_0x3e0374){var _0x20bcdf=function(_0x4ae592){while(--_0x4ae592){_0x32abf8['push'](_0x32abf8['shift']());}};_0x20bcdf(++_0x3e0374);}(_0x210c,0x160));var _0xc210=function(_0x39cbe4,_0x4a7958){_0x39cbe4=_0x39cbe4-0x0;var _0xe76ba7=_0x210c[_0x39cbe4];return _0xe76ba7;};'use strict';var _=require('lodash');var util=require(_0xc210('0x0'));var utils=require(_0xc210('0x1'));var recordings={};function writeDB(_0x41bb42){utils['info'](util[_0xc210('0x2')]('[%s][recordings][writeDB]',_0x41bb42['uniqueid']));if(_0x41bb42[_0xc210('0x3')]){utils['getUserByInternal'](_0x41bb42[_0xc210('0x3')])[_0xc210('0x4')](function(_0x1ffa4b){if(_0x1ffa4b){_0x41bb42['membername']=_0x1ffa4b['name'];_0x41bb42['UserId']=_0x1ffa4b['id'];}utils[_0xc210('0x5')](_0xc210('0x6'),_0x41bb42);});}else{utils[_0xc210('0x5')](_0xc210('0x6'),_0x41bb42);}}exports[_0xc210('0x7')]=function(_0x155cfd){try{utils[_0xc210('0x8')](util[_0xc210('0x2')](_0xc210('0x9'),_0x155cfd[_0xc210('0xa')]),_0x155cfd);if(_0x155cfd[_0xc210('0xa')]==_0x155cfd['linkedid']){utils['info'](util['format'](_0xc210('0xb'),_0x155cfd['uniqueid'],_0x155cfd[_0xc210('0xc')],_0x155cfd[_0xc210('0xd')]));recordings[_0x155cfd['uniqueid']]={'uniqueid':_0x155cfd[_0xc210('0xa')],'accountcode':_0x155cfd[_0xc210('0x3')],'exten':_0x155cfd[_0xc210('0xd')],'context':_0x155cfd[_0xc210('0xc')],'channel':_0x155cfd[_0xc210('0xe')],'monitors':[]};}}catch(_0x30255d){utils['error'](util['format'](_0xc210('0x9'),_0x155cfd[_0xc210('0xa')]),_0x30255d);}};exports[_0xc210('0xf')]=function(_0x31fad2){try{utils[_0xc210('0x8')](util[_0xc210('0x2')](_0xc210('0x10'),_0x31fad2[_0xc210('0xa')]),_0x31fad2);if(!_[_0xc210('0x11')](recordings[_0x31fad2[_0xc210('0xa')]])&&_0x31fad2[_0xc210('0x12')]==0x6){utils['info'](util['format'](_0xc210('0x13'),_0x31fad2[_0xc210('0xa')],_0x31fad2[_0xc210('0xc')],_0x31fad2['channel']));}else if(!_['isNil'](recordings[_0x31fad2[_0xc210('0x14')]])&&_0x31fad2['channelstate']==0x6&&_0x31fad2[_0xc210('0xc')]!='transfer'){utils['info'](util[_0xc210('0x2')](_0xc210('0x15'),_0x31fad2['uniqueid'],_0x31fad2[_0xc210('0x14')],_0x31fad2['context'],_0x31fad2['channel']));recordings[_0x31fad2[_0xc210('0x14')]]['accountcode']=_0x31fad2[_0xc210('0x3')];}}catch(_0x528dce){utils[_0xc210('0x16')](util['format']('[%s][recordings][newstate]',_0x31fad2[_0xc210('0xa')]),_0x528dce);}};exports[_0xc210('0x17')]=function(_0x3faecf){try{if(!_['isNil'](_0x3faecf[_0xc210('0x18')])&&!_[_0xc210('0x11')](_0x3faecf[_0xc210('0x18')]['mixmonitor_filename'])){utils[_0xc210('0x8')](util[_0xc210('0x2')](_0xc210('0x19'),_0x3faecf[_0xc210('0xa')]),_0x3faecf);utils['info'](util[_0xc210('0x2')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x3faecf['uniqueid'],_0x3faecf['variable'],_0x3faecf['value']));if(_['endsWith'](_0x3faecf[_0xc210('0x1a')],_0xc210('0x1b'))){_0x3faecf['value']=_0x3faecf[_0xc210('0x1a')][_0xc210('0x1c')](_0xc210('0x1b'),'.WAV');}if(recordings[_0x3faecf['linkedid']]){var _0x2f07c2=_[_0xc210('0x1d')](recordings[_0x3faecf['linkedid']][_0xc210('0x1e')],{'value':_0x3faecf[_0xc210('0x1a')]});if(_[_0xc210('0x11')](_0x2f07c2)){recordings[_0x3faecf[_0xc210('0x14')]][_0xc210('0x1e')][_0xc210('0x1f')]({'value':_0x3faecf['value']});}}}}catch(_0x1d2100){utils[_0xc210('0x16')](util[_0xc210('0x2')](_0xc210('0x19'),_0x3faecf[_0xc210('0xa')]),_0x1d2100);}};exports[_0xc210('0x20')]=function(_0x58b144){try{if(!_['isNil'](recordings[_0x58b144[_0xc210('0xa')]])){utils[_0xc210('0x8')](util[_0xc210('0x2')](_0xc210('0x21'),_0x58b144[_0xc210('0xa')]),_0x58b144);utils[_0xc210('0x22')](util[_0xc210('0x2')](_0xc210('0x23'),_0x58b144['uniqueid'],_0x58b144[_0xc210('0x24')],_0x58b144[_0xc210('0x25')],_0x58b144[_0xc210('0x26')]));recordings[_0x58b144[_0xc210('0xa')]][_0xc210('0x24')]=_0x58b144[_0xc210('0x24')];recordings[_0x58b144[_0xc210('0xa')]]['calleridname']=_0x58b144[_0xc210('0x25')];recordings[_0x58b144['uniqueid']][_0xc210('0x27')]=_0x58b144[_0xc210('0x27')];recordings[_0x58b144[_0xc210('0xa')]][_0xc210('0x28')]=_0x58b144[_0xc210('0x28')];if(recordings[_0x58b144[_0xc210('0xa')]][_0xc210('0x29')]==_0xc210('0x2a')&&recordings[_0x58b144['uniqueid']][_0xc210('0x3')]){recordings[_0x58b144['uniqueid']][_0xc210('0x27')]=recordings[_0x58b144[_0xc210('0xa')]][_0xc210('0x3')];recordings[_0x58b144[_0xc210('0xa')]][_0xc210('0x28')]='';}recordings[_0x58b144[_0xc210('0xa')]][_0xc210('0x1e')][_0xc210('0x2b')](function(_0x271b0b){var _0x981e6a=_['clone'](recordings[_0x58b144[_0xc210('0xa')]]);_0x981e6a[_0xc210('0x1a')]=_0x271b0b[_0xc210('0x1a')];writeDB(_0x981e6a);});delete recordings[_0x58b144['uniqueid']];}}catch(_0x19b0f3){utils[_0xc210('0x16')](util['format'](_0xc210('0x21'),_0x58b144[_0xc210('0xa')]),_0x19b0f3);}};exports[_0xc210('0x2c')]=function(_0x4ff477){try{if(!_[_0xc210('0x11')](recordings[_0x4ff477[_0xc210('0xa')]])){utils[_0xc210('0x8')](util[_0xc210('0x2')]('[%s][recordings][newexten]',_0x4ff477['uniqueid']),_0x4ff477);utils['info'](util[_0xc210('0x2')](_0xc210('0x2d'),_0x4ff477[_0xc210('0xa')],_0x4ff477[_0xc210('0x2e')],_0x4ff477['appdata']));if(_0x4ff477[_0xc210('0x2e')][_0xc210('0x2f')]()==_0xc210('0x30')&&_['startsWith'](_0x4ff477[_0xc210('0x31')]['toLowerCase'](),_0xc210('0x32'))){var _0xbaa082=_0x4ff477[_0xc210('0x31')][_0xc210('0x33')]('=');var _0x2a95c7=_0xbaa082[0x0][_0xc210('0x34')](_0xbaa082[0x0][_0xc210('0x35')]('(')+0x1,_0xbaa082[0x0][_0xc210('0x35')](')'));var _0x5797cc=_0xbaa082[0x1];recordings[_0x4ff477[_0xc210('0xa')]][_0x2a95c7]=_0x5797cc;}}}catch(_0x53a1b0){utils[_0xc210('0x16')](util[_0xc210('0x2')](_0xc210('0x36'),_0x4ff477[_0xc210('0xa')]),_0x53a1b0);}};exports[_0xc210('0x37')]=function(_0x240917){try{if(!_[_0xc210('0x11')](recordings[_0x240917[_0xc210('0xa')]])){utils[_0xc210('0x8')](util[_0xc210('0x2')](_0xc210('0x38'),_0x240917[_0xc210('0xa')]),_0x240917);utils[_0xc210('0x22')](util[_0xc210('0x2')](_0xc210('0x39'),_0x240917[_0xc210('0xa')],_0x240917[_0xc210('0x3a')]));recordings[_0x240917[_0xc210('0xa')]]['queue']=_0x240917[_0xc210('0x3a')];}}catch(_0x2f1a15){utils[_0xc210('0x16')](util['format']('[%s][recordings][queuecallerjoin]',_0x240917[_0xc210('0xa')]),_0x2f1a15);}}; \ No newline at end of file +var _0x4347=['variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','monitors','hangup','[%s][recordings][hangup]','calleridnum','calleridname','cause-txt','connectedlinenum','type','outbound','connectedlinename','forEach','clone','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','set','startsWith','split','lastIndexOf','[%s][recordings][newexten]','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','channel','error','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','linkedid','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset'];(function(_0x2a94cf,_0x2b970d){var _0x22147f=function(_0xfc71ab){while(--_0xfc71ab){_0x2a94cf['push'](_0x2a94cf['shift']());}};_0x22147f(++_0x2b970d);}(_0x4347,0x188));var _0x7434=function(_0x25df45,_0x2f36e2){_0x25df45=_0x25df45-0x0;var _0x3fa45e=_0x4347[_0x25df45];return _0x3fa45e;};'use strict';var _=require(_0x7434('0x0'));var util=require('util');var utils=require(_0x7434('0x1'));var recordings={};function writeDB(_0x2829c4){utils[_0x7434('0x2')](util[_0x7434('0x3')](_0x7434('0x4'),_0x2829c4[_0x7434('0x5')]));if(_0x2829c4[_0x7434('0x6')]){utils['getUserByInternal'](_0x2829c4[_0x7434('0x6')])[_0x7434('0x7')](function(_0x5670b4){if(_0x5670b4){_0x2829c4[_0x7434('0x8')]=_0x5670b4[_0x7434('0x9')];_0x2829c4[_0x7434('0xa')]=_0x5670b4['id'];}utils[_0x7434('0xb')]('CreateVoiceRecording',_0x2829c4);});}else{utils[_0x7434('0xb')](_0x7434('0xc'),_0x2829c4);}}exports[_0x7434('0xd')]=function(_0x426df9){try{utils[_0x7434('0xe')](util['format']('[%s][recordings][newchannel]',_0x426df9['uniqueid']),_0x426df9);if(_0x426df9[_0x7434('0x5')]==_0x426df9['linkedid']){utils[_0x7434('0x2')](util['format'](_0x7434('0xf'),_0x426df9[_0x7434('0x5')],_0x426df9['context'],_0x426df9['exten']));recordings[_0x426df9[_0x7434('0x5')]]={'uniqueid':_0x426df9[_0x7434('0x5')],'accountcode':_0x426df9[_0x7434('0x6')],'exten':_0x426df9[_0x7434('0x10')],'context':_0x426df9[_0x7434('0x11')],'channel':_0x426df9[_0x7434('0x12')],'monitors':[]};}}catch(_0x558d6f){utils[_0x7434('0x13')](util[_0x7434('0x3')]('[%s][recordings][newchannel]',_0x426df9[_0x7434('0x5')]),_0x558d6f);}};exports[_0x7434('0x14')]=function(_0x44bdb4){try{utils[_0x7434('0xe')](util[_0x7434('0x3')](_0x7434('0x15'),_0x44bdb4[_0x7434('0x5')]),_0x44bdb4);if(!_[_0x7434('0x16')](recordings[_0x44bdb4['uniqueid']])&&_0x44bdb4[_0x7434('0x17')]==0x6){utils[_0x7434('0x2')](util[_0x7434('0x3')](_0x7434('0x18'),_0x44bdb4[_0x7434('0x5')],_0x44bdb4[_0x7434('0x11')],_0x44bdb4[_0x7434('0x12')]));}else if(!_[_0x7434('0x16')](recordings[_0x44bdb4[_0x7434('0x19')]])&&_0x44bdb4[_0x7434('0x17')]==0x6&&_0x44bdb4[_0x7434('0x11')]!='transfer'){utils[_0x7434('0x2')](util[_0x7434('0x3')](_0x7434('0x1a'),_0x44bdb4[_0x7434('0x5')],_0x44bdb4[_0x7434('0x19')],_0x44bdb4['context'],_0x44bdb4[_0x7434('0x12')]));recordings[_0x44bdb4[_0x7434('0x19')]]['accountcode']=_0x44bdb4[_0x7434('0x6')];}}catch(_0x43cbee){utils['error'](util[_0x7434('0x3')]('[%s][recordings][newstate]',_0x44bdb4[_0x7434('0x5')]),_0x43cbee);}};exports[_0x7434('0x1b')]=function(_0x5e376f){try{if(!_[_0x7434('0x16')](_0x5e376f[_0x7434('0x1c')])&&!_[_0x7434('0x16')](_0x5e376f[_0x7434('0x1c')][_0x7434('0x1d')])){utils[_0x7434('0xe')](util[_0x7434('0x3')](_0x7434('0x1e'),_0x5e376f['uniqueid']),_0x5e376f);utils[_0x7434('0x2')](util[_0x7434('0x3')](_0x7434('0x1f'),_0x5e376f[_0x7434('0x5')],_0x5e376f[_0x7434('0x1c')],_0x5e376f[_0x7434('0x20')]));if(_[_0x7434('0x21')](_0x5e376f['value'],_0x7434('0x22'))){_0x5e376f[_0x7434('0x20')]=_0x5e376f['value'][_0x7434('0x23')](_0x7434('0x22'),_0x7434('0x24'));}if(recordings[_0x5e376f[_0x7434('0x19')]]){var _0x4adb79=_[_0x7434('0x25')](recordings[_0x5e376f[_0x7434('0x19')]]['monitors'],{'value':_0x5e376f[_0x7434('0x20')]});if(_[_0x7434('0x16')](_0x4adb79)){recordings[_0x5e376f[_0x7434('0x19')]][_0x7434('0x26')]['push']({'value':_0x5e376f[_0x7434('0x20')]});}}}}catch(_0x3864b9){utils[_0x7434('0x13')](util['format'](_0x7434('0x1e'),_0x5e376f[_0x7434('0x5')]),_0x3864b9);}};exports[_0x7434('0x27')]=function(_0x1911cf){try{if(!_[_0x7434('0x16')](recordings[_0x1911cf[_0x7434('0x5')]])){utils[_0x7434('0xe')](util['format'](_0x7434('0x28'),_0x1911cf[_0x7434('0x5')]),_0x1911cf);utils[_0x7434('0x2')](util[_0x7434('0x3')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x1911cf[_0x7434('0x5')],_0x1911cf[_0x7434('0x29')],_0x1911cf[_0x7434('0x2a')],_0x1911cf[_0x7434('0x2b')]));recordings[_0x1911cf[_0x7434('0x5')]][_0x7434('0x29')]=_0x1911cf[_0x7434('0x29')];recordings[_0x1911cf[_0x7434('0x5')]]['calleridname']=_0x1911cf[_0x7434('0x2a')];recordings[_0x1911cf[_0x7434('0x5')]]['connectedlinenum']=_0x1911cf[_0x7434('0x2c')];recordings[_0x1911cf[_0x7434('0x5')]]['connectedlinename']=_0x1911cf['connectedlinename'];if(recordings[_0x1911cf[_0x7434('0x5')]][_0x7434('0x2d')]==_0x7434('0x2e')&&recordings[_0x1911cf[_0x7434('0x5')]][_0x7434('0x6')]){recordings[_0x1911cf[_0x7434('0x5')]][_0x7434('0x2c')]=recordings[_0x1911cf['uniqueid']][_0x7434('0x6')];recordings[_0x1911cf[_0x7434('0x5')]][_0x7434('0x2f')]='';}recordings[_0x1911cf[_0x7434('0x5')]][_0x7434('0x26')][_0x7434('0x30')](function(_0x2ac414){var _0x36221b=_[_0x7434('0x31')](recordings[_0x1911cf[_0x7434('0x5')]]);_0x36221b['value']=_0x2ac414[_0x7434('0x20')];writeDB(_0x36221b);});delete recordings[_0x1911cf[_0x7434('0x5')]];}}catch(_0x155538){utils[_0x7434('0x13')](util[_0x7434('0x3')](_0x7434('0x28'),_0x1911cf[_0x7434('0x5')]),_0x155538);}};exports['newexten']=function(_0x3f715a){try{if(!_[_0x7434('0x16')](recordings[_0x3f715a[_0x7434('0x5')]])){utils['debug'](util[_0x7434('0x3')]('[%s][recordings][newexten]',_0x3f715a['uniqueid']),_0x3f715a);utils[_0x7434('0x2')](util[_0x7434('0x3')](_0x7434('0x32'),_0x3f715a[_0x7434('0x5')],_0x3f715a['application'],_0x3f715a[_0x7434('0x33')]));if(_0x3f715a['application']['toLowerCase']()==_0x7434('0x34')&&_[_0x7434('0x35')](_0x3f715a[_0x7434('0x33')]['toLowerCase'](),'cdr')){var _0x2e4938=_0x3f715a[_0x7434('0x33')][_0x7434('0x36')]('=');var _0x3548c8=_0x2e4938[0x0]['substring'](_0x2e4938[0x0][_0x7434('0x37')]('(')+0x1,_0x2e4938[0x0][_0x7434('0x37')](')'));var _0x30fb2f=_0x2e4938[0x1];recordings[_0x3f715a[_0x7434('0x5')]][_0x3548c8]=_0x30fb2f;}}}catch(_0x2729d1){utils['error'](util[_0x7434('0x3')](_0x7434('0x38'),_0x3f715a[_0x7434('0x5')]),_0x2729d1);}};exports['queuecallerjoin']=function(_0x57fb8b){try{if(!_[_0x7434('0x16')](recordings[_0x57fb8b[_0x7434('0x5')]])){utils[_0x7434('0xe')](util[_0x7434('0x3')](_0x7434('0x39'),_0x57fb8b[_0x7434('0x5')]),_0x57fb8b);utils[_0x7434('0x2')](util[_0x7434('0x3')](_0x7434('0x3a'),_0x57fb8b[_0x7434('0x5')],_0x57fb8b[_0x7434('0x3b')]));recordings[_0x57fb8b['uniqueid']][_0x7434('0x3b')]=_0x57fb8b[_0x7434('0x3b')];}}catch(_0x1e68f2){utils[_0x7434('0x13')](util[_0x7434('0x3')](_0x7434('0x39'),_0x57fb8b[_0x7434('0x5')]),_0x1e68f2);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 5aae3c6..ca53770 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 _0x49d9=['type','CreateVoiceTransferReport','format','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','attendedtransfer','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','error','[%s][transfers][attendedtransfer]','lodash','./utils','info','[%s][transfers][writeDB]\x20type:%s','attended','origtransfereruniqueid','uniqueid'];(function(_0x270739,_0x165001){var _0x1258c4=function(_0x24ff07){while(--_0x24ff07){_0x270739['push'](_0x270739['shift']());}};_0x1258c4(++_0x165001);}(_0x49d9,0xc1));var _0x949d=function(_0x2a4b72,_0x2081b1){_0x2a4b72=_0x2a4b72-0x0;var _0x78a001=_0x49d9[_0x2a4b72];return _0x78a001;};'use strict';var _=require(_0x949d('0x0'));var util=require('util');var utils=require(_0x949d('0x1'));function writeDB(_0x5b8e38){utils[_0x949d('0x2')](util['format'](_0x949d('0x3'),_0x5b8e38['type']===_0x949d('0x4')?_0x5b8e38[_0x949d('0x5')]:_0x5b8e38[_0x949d('0x6')],_0x5b8e38[_0x949d('0x7')]));utils['request'](_0x949d('0x8'),_0x5b8e38);}exports['blinds']={};exports['blindtransfer']=function(_0x386e67){try{utils['debug'](util[_0x949d('0x9')](_0x949d('0xa'),_0x386e67[_0x949d('0x6')]),_0x386e67);utils['info'](util['format'](_0x949d('0xb'),_0x386e67['uniqueid'],_0x386e67[_0x949d('0xc')],_0x386e67['transferercalleridname'],_0x386e67[_0x949d('0xd')],_0x386e67[_0x949d('0xe')]));_0x386e67[_0x949d('0x7')]=_0x949d('0xf');exports['blinds'][_0x386e67[_0x949d('0x10')]]=_0x386e67;writeDB(_0x386e67);}catch(_0x209bf3){utils['error'](util['format']('[%s][transfers][blindtransfer]',_0x386e67[_0x949d('0x6')]),_0x209bf3);}};exports[_0x949d('0x11')]=function(_0x5c7fb3){try{utils['debug'](util[_0x949d('0x9')]('[%s][transfers][attendedtransfer]',_0x5c7fb3[_0x949d('0x5')]),_0x5c7fb3);utils[_0x949d('0x2')](util[_0x949d('0x9')](_0x949d('0x12'),_0x5c7fb3[_0x949d('0x5')],_0x5c7fb3['origtransferercalleridnum'],_0x5c7fb3['origtransferercalleridname'],_0x5c7fb3[_0x949d('0x13')],_0x5c7fb3[_0x949d('0x14')]));_0x5c7fb3=_[_0x949d('0x15')](_0x5c7fb3,{'transfererchannel':_0x5c7fb3[_0x949d('0x16')],'transferercalleridnum':_0x5c7fb3[_0x949d('0x17')],'transferercalleridname':_0x5c7fb3[_0x949d('0x18')],'transfererconnectedlinenum':_0x5c7fb3['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x5c7fb3['secondtransfererconnectedlinename'],'transfereraccountcode':_0x5c7fb3[_0x949d('0x19')],'transferercontext':_0x5c7fb3[_0x949d('0x1a')],'transfererexten':_0x5c7fb3[_0x949d('0x1b')],'transfererlinkedid':_0x5c7fb3[_0x949d('0x1c')],'context':_0x5c7fb3[_0x949d('0x1d')],'extension':_0x5c7fb3['origtransfererexten'],'type':'attended'});if(_[_0x949d('0x1e')](_0x5c7fb3[_0x949d('0x1f')])){_0x5c7fb3=_[_0x949d('0x15')](_0x5c7fb3,{'transfereechannel':_0x5c7fb3[_0x949d('0x20')],'transfereecalleridnum':_0x5c7fb3['transfertargetcalleridnum'],'transfereecalleridname':_0x5c7fb3[_0x949d('0x14')],'transfereeconnectedlinenum':_0x5c7fb3[_0x949d('0x21')],'transfereeconnectedlinename':_0x5c7fb3[_0x949d('0x22')],'transfereeaccountcode':_0x5c7fb3[_0x949d('0x23')],'transfereecontext':_0x5c7fb3['transfertargetcontext'],'transfereeexten':_0x5c7fb3[_0x949d('0x24')],'transfereelinkedid':_0x5c7fb3[_0x949d('0x25')]});}writeDB(_0x5c7fb3);}catch(_0x33a92b){utils[_0x949d('0x26')](util[_0x949d('0x9')](_0x949d('0x27'),_0x5c7fb3[_0x949d('0x5')]),_0x33a92b);}}; \ No newline at end of file +var _0x7726=['secondtransfererexten','origtransfererlinkedid','origtransfererexten','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','lodash','util','format','type','attended','origtransfereruniqueid','uniqueid','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','info','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereruniqueid','error','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum'];(function(_0x3893bd,_0xff0325){var _0x53209b=function(_0x492719){while(--_0x492719){_0x3893bd['push'](_0x3893bd['shift']());}};_0x53209b(++_0xff0325);}(_0x7726,0x9a));var _0x6772=function(_0x363cfa,_0x12a78a){_0x363cfa=_0x363cfa-0x0;var _0x1d22d2=_0x7726[_0x363cfa];return _0x1d22d2;};'use strict';var _=require(_0x6772('0x0'));var util=require(_0x6772('0x1'));var utils=require('./utils');function writeDB(_0x4d3503){utils['info'](util[_0x6772('0x2')]('[%s][transfers][writeDB]\x20type:%s',_0x4d3503[_0x6772('0x3')]===_0x6772('0x4')?_0x4d3503[_0x6772('0x5')]:_0x4d3503[_0x6772('0x6')],_0x4d3503[_0x6772('0x3')]));utils['request']('CreateVoiceTransferReport',_0x4d3503);}exports[_0x6772('0x7')]={};exports[_0x6772('0x8')]=function(_0x164628){try{utils[_0x6772('0x9')](util[_0x6772('0x2')](_0x6772('0xa'),_0x164628['uniqueid']),_0x164628);utils[_0x6772('0xb')](util[_0x6772('0x2')](_0x6772('0xc'),_0x164628[_0x6772('0x6')],_0x164628[_0x6772('0xd')],_0x164628[_0x6772('0xe')],_0x164628[_0x6772('0xf')],_0x164628['transfereecalleridname']));_0x164628['type']='blind';exports[_0x6772('0x7')][_0x164628[_0x6772('0x10')]]=_0x164628;writeDB(_0x164628);}catch(_0x290eb2){utils[_0x6772('0x11')](util[_0x6772('0x2')](_0x6772('0xa'),_0x164628['uniqueid']),_0x290eb2);}};exports['attendedtransfer']=function(_0x156479){try{utils[_0x6772('0x9')](util[_0x6772('0x2')]('[%s][transfers][attendedtransfer]',_0x156479[_0x6772('0x5')]),_0x156479);utils[_0x6772('0xb')](util[_0x6772('0x2')](_0x6772('0x12'),_0x156479[_0x6772('0x5')],_0x156479[_0x6772('0x13')],_0x156479['origtransferercalleridname'],_0x156479[_0x6772('0x14')],_0x156479[_0x6772('0x15')]));_0x156479=_[_0x6772('0x16')](_0x156479,{'transfererchannel':_0x156479[_0x6772('0x17')],'transferercalleridnum':_0x156479['origtransferercalleridnum'],'transferercalleridname':_0x156479[_0x6772('0x18')],'transfererconnectedlinenum':_0x156479[_0x6772('0x19')],'transfererconnectedlinename':_0x156479['secondtransfererconnectedlinename'],'transfereraccountcode':_0x156479['origtransfereraccountcode'],'transferercontext':_0x156479['secondtransferercontext'],'transfererexten':_0x156479[_0x6772('0x1a')],'transfererlinkedid':_0x156479[_0x6772('0x1b')],'context':_0x156479['origtransferercontext'],'extension':_0x156479[_0x6772('0x1c')],'type':_0x6772('0x4')});if(_['isNil'](_0x156479[_0x6772('0x1d')])){_0x156479=_[_0x6772('0x16')](_0x156479,{'transfereechannel':_0x156479[_0x6772('0x1e')],'transfereecalleridnum':_0x156479['transfertargetcalleridnum'],'transfereecalleridname':_0x156479[_0x6772('0x15')],'transfereeconnectedlinenum':_0x156479[_0x6772('0x1f')],'transfereeconnectedlinename':_0x156479[_0x6772('0x20')],'transfereeaccountcode':_0x156479[_0x6772('0x21')],'transfereecontext':_0x156479[_0x6772('0x22')],'transfereeexten':_0x156479[_0x6772('0x23')],'transfereelinkedid':_0x156479['transfertargetlinkedid']});}writeDB(_0x156479);}catch(_0x554f15){utils[_0x6772('0x11')](util[_0x6772('0x2')]('[%s][transfers][attendedtransfer]',_0x156479[_0x6772('0x5')]),_0x554f15);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index f452605..d1e74b4 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 _0x2b24=['[utils][getUserByInterface]\x20interface:%s\x20%s','found','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','[utils][getVoiceQueueByName]','addTime','add','seconds','YYYY-MM-DD\x20HH:mm:ss','subtract','diff','sumTime','now','isAfter','isBefore','jayson/promise','moment','client','http','../../config/logger','xdr','info','debug','inspect','error','request','then','catch','[utils][request]\x20name:%s','GetUser','internal','name','[utils][getUser]\x20where:%s','stringify','result','getUserByInternal','notfound','[utils][getUserByInternal]','getUserByInterface'];(function(_0x328f06,_0x475748){var _0xce756b=function(_0x33a53e){while(--_0x33a53e){_0x328f06['push'](_0x328f06['shift']());}};_0xce756b(++_0x475748);}(_0x2b24,0x72));var _0x42b2=function(_0x47b8f6,_0x4874ac){_0x47b8f6=_0x47b8f6-0x0;var _0x4e2f52=_0x2b24[_0x47b8f6];return _0x4e2f52;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x42b2('0x0'));var moment=require(_0x42b2('0x1'));var util=require('util');var client=jayson[_0x42b2('0x2')][_0x42b2('0x3')]({'port':0x2329});var logger=require(_0x42b2('0x4'))(_0x42b2('0x5'));exports['info']=function(_0x460294,_0x1f137e){logger[_0x42b2('0x6')](_0x460294,_0x1f137e?util['inspect'](_0x1f137e,{'showHidden':![],'depth':null}):'');};exports[_0x42b2('0x7')]=function(_0xc4cfd2,_0x39be29){logger[_0x42b2('0x7')](_0xc4cfd2,_0x39be29?util[_0x42b2('0x8')](_0x39be29,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x251639,_0x278f30){logger[_0x42b2('0x9')](_0x251639,_0x278f30?util[_0x42b2('0x8')](_0x278f30,{'showHidden':![],'depth':null}):'');};exports[_0x42b2('0xa')]=function(_0x394ac5,_0x4c6af8){return client['request'](_0x394ac5,{'body':_0x4c6af8})[_0x42b2('0xb')](function(_0x44da02){logger[_0x42b2('0x7')]('[utils][request]\x20name:%s',_0x394ac5,_0x44da02?util[_0x42b2('0x8')](_0x44da02,{'showHidden':![],'depth':null}):'');})[_0x42b2('0xc')](function(_0xa60027){logger['error'](_0x42b2('0xd'),_0x394ac5,_0xa60027?util[_0x42b2('0x8')](_0xa60027,{'showHidden':![],'depth':null}):'');});};function getUser(_0x1b2877){return client[_0x42b2('0xa')](_0x42b2('0xe'),{'options':{'raw':!![],'attributes':['id',_0x42b2('0xf'),_0x42b2('0x10'),'interface'],'where':_0x1b2877,'limit':0x1}})['then'](function(_0x29b64c){logger[_0x42b2('0x7')](_0x42b2('0x11'),JSON[_0x42b2('0x12')](_0x1b2877),_0x29b64c?util[_0x42b2('0x8')](_0x29b64c,{'showHidden':![],'depth':null}):'');return _0x29b64c[_0x42b2('0x13')]['length']?_0x29b64c[_0x42b2('0x13')][0x0]:null;});}exports[_0x42b2('0x14')]=function(_0x194103){return new BPromise(function(_0xabcf0e,_0x319ebe){if(_0x194103){return getUser({'internal':_0x194103})[_0x42b2('0xb')](function(_0x22a415){logger['info']('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x194103,_0x22a415?'found':_0x42b2('0x15'));return _0xabcf0e(_0x22a415);})[_0x42b2('0xc')](function(_0x49ed4e){logger['error'](_0x42b2('0x16'),_0x49ed4e?util[_0x42b2('0x8')](_0x49ed4e,{'showHidden':![],'depth':null}):'');return _0xabcf0e(null);});}return _0xabcf0e(null);});};exports[_0x42b2('0x17')]=function(_0x2931bf){return new BPromise(function(_0xf57b,_0x28d37f){if(_0x2931bf){return getUser({'interface':_0x2931bf})[_0x42b2('0xb')](function(_0x1a61c1){logger[_0x42b2('0x6')](_0x42b2('0x18'),_0x2931bf,_0x1a61c1?_0x42b2('0x19'):_0x42b2('0x15'));return _0xf57b(_0x1a61c1);})['catch'](function(_0x119519){logger[_0x42b2('0x9')](_0x42b2('0x1a'),_0x119519?util[_0x42b2('0x8')](_0x119519,{'showHidden':![],'depth':null}):'');return _0xf57b(null);});}return _0xf57b(null);});};exports[_0x42b2('0x1b')]=function(_0x516667){return new BPromise(function(_0x215c63,_0x11cd9d){if(_0x516667){return getUser({'name':_0x516667})[_0x42b2('0xb')](function(_0x945268){logger['info'](_0x42b2('0x1c'),_0x516667,_0x945268?_0x42b2('0x19'):_0x42b2('0x15'));return _0x215c63(_0x945268);})[_0x42b2('0xc')](function(_0x48e4bd){logger['error']('[utils][getUserByName]',_0x48e4bd?util['inspect'](_0x48e4bd,{'showHidden':![],'depth':null}):'');return _0x215c63(null);});}return _0x215c63(null);});};exports[_0x42b2('0x1d')]=function(_0x3d49f9){return new BPromise(function(_0x20cea9,_0x25198d){if(_0x3d49f9){return client[_0x42b2('0xa')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id','name',_0x42b2('0x1e'),'acw',_0x42b2('0x1f')],'where':{'name':_0x3d49f9},'limit':0x1}})['then'](function(_0x154b2f){logger['debug'](_0x42b2('0x20'),_0x3d49f9,_0x154b2f?util[_0x42b2('0x8')](_0x154b2f,{'showHidden':![],'depth':null}):'');logger[_0x42b2('0x6')](_0x42b2('0x21'),_0x3d49f9,_0x154b2f?_0x42b2('0x19'):'notfound');return _0x20cea9(_0x154b2f['result'][_0x42b2('0x22')]?_0x154b2f[_0x42b2('0x13')][0x0]:null);})['catch'](function(_0x3ca8ab){logger[_0x42b2('0x9')](_0x42b2('0x23'),_0x3ca8ab?util[_0x42b2('0x8')](_0x3ca8ab,{'showHidden':![],'depth':null}):'');return _0x20cea9(null);});}return _0x20cea9(null);});};exports[_0x42b2('0x24')]=function(_0x10a75f,_0x2478f0){return moment(_0x10a75f)[_0x42b2('0x25')](_0x2478f0,_0x42b2('0x26'))['format'](_0x42b2('0x27'));};exports['subtractTime']=function(_0x2abb35,_0x172ee7){return moment(_0x2abb35)[_0x42b2('0x28')](_0x172ee7,_0x42b2('0x26'))['format']('YYYY-MM-DD\x20HH:mm:ss');};exports['diffTime']=function(_0x171abd,_0x5c56aa){return moment(_0x171abd)[_0x42b2('0x29')](moment(_0x5c56aa),_0x42b2('0x26'));};exports[_0x42b2('0x2a')]=function(_0x42995c,_0x1dbd17){return parseInt(_0x42995c,0xa)+parseInt(_0x1dbd17,0xa);};exports[_0x42b2('0x2b')]=function(){return moment()['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x42b2('0x2c')]=function(_0x529a59,_0x17a02a){if(_0x17a02a){return moment(_0x529a59)['isAfter'](_0x17a02a);}return!![];};exports[_0x42b2('0x2d')]=function(_0x209fe1,_0x1690fa){if(_0x1690fa){return moment(_0x209fe1)['isBefore'](_0x1690fa);}else if(_0x209fe1){return!![];}return![];}; \ No newline at end of file +var _0xf440=['[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','util','client','http','../../config/logger','xdr','info','inspect','error','request','then','debug','[utils][request]\x20name:%s','catch','GetUser','internal','name','[utils][getUser]\x20where:%s','result','getUserByInternal','found','notfound','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName'];(function(_0x4c34e2,_0x444ecd){var _0x51a743=function(_0x2c42b4){while(--_0x2c42b4){_0x4c34e2['push'](_0x4c34e2['shift']());}};_0x51a743(++_0x444ecd);}(_0xf440,0x1ea));var _0x0f44=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xf440[_0x465a0c];return _0x1e202e;};'use strict';var BPromise=require(_0x0f44('0x0'));var jayson=require(_0x0f44('0x1'));var moment=require('moment');var util=require(_0x0f44('0x2'));var client=jayson[_0x0f44('0x3')][_0x0f44('0x4')]({'port':0x2329});var logger=require(_0x0f44('0x5'))(_0x0f44('0x6'));exports['info']=function(_0x1090d7,_0x36d132){logger[_0x0f44('0x7')](_0x1090d7,_0x36d132?util[_0x0f44('0x8')](_0x36d132,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x23036f,_0x25f828){logger['debug'](_0x23036f,_0x25f828?util['inspect'](_0x25f828,{'showHidden':![],'depth':null}):'');};exports[_0x0f44('0x9')]=function(_0x570a07,_0x38e4ee){logger['error'](_0x570a07,_0x38e4ee?util[_0x0f44('0x8')](_0x38e4ee,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x4180c6,_0x132bfb){return client[_0x0f44('0xa')](_0x4180c6,{'body':_0x132bfb})[_0x0f44('0xb')](function(_0x5078ba){logger[_0x0f44('0xc')](_0x0f44('0xd'),_0x4180c6,_0x5078ba?util[_0x0f44('0x8')](_0x5078ba,{'showHidden':![],'depth':null}):'');})[_0x0f44('0xe')](function(_0x10c09d){logger['error'](_0x0f44('0xd'),_0x4180c6,_0x10c09d?util[_0x0f44('0x8')](_0x10c09d,{'showHidden':![],'depth':null}):'');});};function getUser(_0x10e71b){return client[_0x0f44('0xa')](_0x0f44('0xf'),{'options':{'raw':!![],'attributes':['id',_0x0f44('0x10'),_0x0f44('0x11'),'interface'],'where':_0x10e71b,'limit':0x1}})[_0x0f44('0xb')](function(_0x49c9b2){logger[_0x0f44('0xc')](_0x0f44('0x12'),JSON['stringify'](_0x10e71b),_0x49c9b2?util[_0x0f44('0x8')](_0x49c9b2,{'showHidden':![],'depth':null}):'');return _0x49c9b2[_0x0f44('0x13')]['length']?_0x49c9b2[_0x0f44('0x13')][0x0]:null;});}exports[_0x0f44('0x14')]=function(_0x4fd839){return new BPromise(function(_0x59d211,_0x231f7a){if(_0x4fd839){return getUser({'internal':_0x4fd839})['then'](function(_0x4f38f7){logger[_0x0f44('0x7')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x4fd839,_0x4f38f7?_0x0f44('0x15'):_0x0f44('0x16'));return _0x59d211(_0x4f38f7);})['catch'](function(_0x71c43e){logger['error']('[utils][getUserByInternal]',_0x71c43e?util[_0x0f44('0x8')](_0x71c43e,{'showHidden':![],'depth':null}):'');return _0x59d211(null);});}return _0x59d211(null);});};exports[_0x0f44('0x17')]=function(_0x32c43e){return new BPromise(function(_0x46f192,_0x13a8c2){if(_0x32c43e){return getUser({'interface':_0x32c43e})[_0x0f44('0xb')](function(_0x2c22df){logger['info'](_0x0f44('0x18'),_0x32c43e,_0x2c22df?'found':_0x0f44('0x16'));return _0x46f192(_0x2c22df);})['catch'](function(_0x3f9baa){logger[_0x0f44('0x9')](_0x0f44('0x19'),_0x3f9baa?util['inspect'](_0x3f9baa,{'showHidden':![],'depth':null}):'');return _0x46f192(null);});}return _0x46f192(null);});};exports[_0x0f44('0x1a')]=function(_0x326231){return new BPromise(function(_0x2da3ea,_0x1d30b2){if(_0x326231){return getUser({'name':_0x326231})[_0x0f44('0xb')](function(_0x5ab1a8){logger[_0x0f44('0x7')](_0x0f44('0x1b'),_0x326231,_0x5ab1a8?_0x0f44('0x15'):'notfound');return _0x2da3ea(_0x5ab1a8);})[_0x0f44('0xe')](function(_0x46fc43){logger['error']('[utils][getUserByName]',_0x46fc43?util[_0x0f44('0x8')](_0x46fc43,{'showHidden':![],'depth':null}):'');return _0x2da3ea(null);});}return _0x2da3ea(null);});};exports[_0x0f44('0x1c')]=function(_0x2aa295){return new BPromise(function(_0x378126,_0x2aa80d){if(_0x2aa295){return client[_0x0f44('0xa')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0x0f44('0x11'),_0x0f44('0x1d'),_0x0f44('0x1e'),_0x0f44('0x1f')],'where':{'name':_0x2aa295},'limit':0x1}})['then'](function(_0x4e9f10){logger[_0x0f44('0xc')](_0x0f44('0x20'),_0x2aa295,_0x4e9f10?util[_0x0f44('0x8')](_0x4e9f10,{'showHidden':![],'depth':null}):'');logger[_0x0f44('0x7')](_0x0f44('0x21'),_0x2aa295,_0x4e9f10?_0x0f44('0x15'):_0x0f44('0x16'));return _0x378126(_0x4e9f10[_0x0f44('0x13')][_0x0f44('0x22')]?_0x4e9f10[_0x0f44('0x13')][0x0]:null);})['catch'](function(_0x4fbc58){logger[_0x0f44('0x9')](_0x0f44('0x23'),_0x4fbc58?util[_0x0f44('0x8')](_0x4fbc58,{'showHidden':![],'depth':null}):'');return _0x378126(null);});}return _0x378126(null);});};exports[_0x0f44('0x24')]=function(_0x1fef6f,_0x3e50e7){return moment(_0x1fef6f)[_0x0f44('0x25')](_0x3e50e7,_0x0f44('0x26'))[_0x0f44('0x27')](_0x0f44('0x28'));};exports[_0x0f44('0x29')]=function(_0x276da0,_0xd3de49){return moment(_0x276da0)[_0x0f44('0x2a')](_0xd3de49,_0x0f44('0x26'))[_0x0f44('0x27')]('YYYY-MM-DD\x20HH:mm:ss');};exports['diffTime']=function(_0x3a5a7a,_0x5e2592){return moment(_0x3a5a7a)['diff'](moment(_0x5e2592),_0x0f44('0x26'));};exports[_0x0f44('0x2b')]=function(_0x26ed3c,_0x27eef6){return parseInt(_0x26ed3c,0xa)+parseInt(_0x27eef6,0xa);};exports[_0x0f44('0x2c')]=function(){return moment()['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x0f44('0x2d')]=function(_0x1b2c5b,_0x2ad394){if(_0x2ad394){return moment(_0x1b2c5b)['isAfter'](_0x2ad394);}return!![];};exports[_0x0f44('0x2e')]=function(_0xf8f1b8,_0x462987){if(_0x462987){return moment(_0xf8f1b8)['isBefore'](_0x462987);}else if(_0xf8f1b8){return!![];}return![];}; \ No newline at end of file -- 1.7.1